From: support Date: Wed, 6 Apr 2022 16:57:31 +0000 (+0000) Subject: Built motion from commit bc8fc54e.|2.6.7 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%22?a=commitdiff_plain;h=233092a7219680a6fcb8026f036db48a5da16f7c;p=motion2.git Built motion from commit bc8fc54e.|2.6.7 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f05bffe..9374a89 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-04-06T16:36:26.504Z", + "time": "2022-04-06T16:49:40.963Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 16fdb15..ddba5e4 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-06T16:36:26.504Z", + "time": "2022-04-06T16:49:40.963Z", "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 d01b2b2..d47c4cc 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 _0xa0f6=['exports','getDataValue','action','STRING','contactManager','motionbar','urlForward','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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xa0f6,0x164));var _0x6a0f=function(_0x4852bd,_0x1b0314){_0x4852bd=_0x4852bd-0x0;var _0x4b150a=_0xa0f6[_0x4852bd];return _0x4b150a;};'use strict';var Sequelize=require(_0x6a0f('0x0'));module[_0x6a0f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x27c93f){return this[_0x6a0f('0x2')](_0x6a0f('0x3'));}},'action':{'type':Sequelize[_0x6a0f('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6a0f('0x5'),'integration',_0x6a0f('0x6'),'jscripty',_0x6a0f('0x7'),'browser','bot',_0x6a0f('0x8')]],'msg':_0x6a0f('0x9')}},'comment':_0x6a0f('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6a0f('0xa')},'data2':{'type':Sequelize[_0x6a0f('0x4')](0x1000),'comment':_0x6a0f('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x6a0f('0x4')](0x1000),'comments':_0x6a0f('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x6a0f('0xd')},'data6':{'type':Sequelize[_0x6a0f('0x4')],'comments':_0x6a0f('0xe')},'data7':{'type':Sequelize[_0x6a0f('0xf')],'comments':_0x6a0f('0x10')}}; \ No newline at end of file +var _0x8fed=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8fed,0xab));var _0xd8fe=function(_0x4864f1,_0x5eeb5f){_0x4864f1=_0x4864f1-0x0;var _0x585f9c=_0x8fed[_0x4864f1];return _0x585f9c;};'use strict';var Sequelize=require(_0xd8fe('0x0'));module[_0xd8fe('0x1')]={'name':{'type':Sequelize[_0xd8fe('0x2')],'get':function(_0x3352ad){return this[_0xd8fe('0x3')](_0xd8fe('0x4'));}},'action':{'type':Sequelize[_0xd8fe('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd8fe('0x6'),_0xd8fe('0x7'),_0xd8fe('0x8'),_0xd8fe('0x9'),_0xd8fe('0xa'),_0xd8fe('0xb'),_0xd8fe('0xc'),'script']],'msg':_0xd8fe('0xd')}},'comment':_0xd8fe('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xd8fe('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xd8fe('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xd8fe('0x10')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xd8fe('0x5')](0x1000),'comments':_0xd8fe('0x11')},'data6':{'type':Sequelize[_0xd8fe('0x5')],'comments':_0xd8fe('0x12')},'data7':{'type':Sequelize[_0xd8fe('0x13')],'comments':_0xd8fe('0x14')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 839019d..78b2679 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 _0xa8bb=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','error','stack','name','body','Action','find','params','catch','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa8bb,0x15a));var _0xba8b=function(_0x576e84,_0x25bb00){_0x576e84=_0x576e84-0x0;var _0x425803=_0xa8bb[_0x576e84];return _0x425803;};'use strict';var emlformat=require(_0xba8b('0x0'));var rimraf=require(_0xba8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba8b('0x2'));var rp=require(_0xba8b('0x3'));var moment=require(_0xba8b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba8b('0x5'));var path=require('path');var sox=require(_0xba8b('0x6'));var csv=require(_0xba8b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba8b('0x8'));var _=require(_0xba8b('0x9'));var squel=require(_0xba8b('0xa'));var crypto=require(_0xba8b('0xb'));var jsforce=require(_0xba8b('0xc'));var deskjs=require(_0xba8b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba8b('0xe'));var Papa=require(_0xba8b('0xf'));var Redis=require(_0xba8b('0x10'));var authService=require(_0xba8b('0x11'));var qs=require(_0xba8b('0x12'));var as=require(_0xba8b('0x13'));var hardwareService=require(_0xba8b('0x14'));var logger=require('../../config/logger')(_0xba8b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xba8b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ac234,_0x3ff0c4){_0x3ff0c4=_0x3ff0c4||0xcc;return function(_0x3e0fb7){if(_0x3e0fb7){return _0x2ac234[_0xba8b('0x17')](_0x3ff0c4);}return _0x2ac234[_0xba8b('0x18')](_0x3ff0c4)['end']();};}function respondWithResult(_0x52cad6,_0x4fa1a9){_0x4fa1a9=_0x4fa1a9||0xc8;return function(_0x5daea6){if(_0x5daea6){return _0x52cad6[_0xba8b('0x18')](_0x4fa1a9)[_0xba8b('0x19')](_0x5daea6);}};}function respondWithFilteredResult(_0x3a1fc7,_0x23757b){return function(_0xde728e){if(_0xde728e){var _0x16270a=typeof _0x23757b['offset']===_0xba8b('0x1a')&&typeof _0x23757b[_0xba8b('0x1b')]===_0xba8b('0x1a');var _0x132619=_0xde728e[_0xba8b('0x1c')];var _0x1ee697=_0x16270a?0x0:_0x23757b['offset'];var _0xe9e3dc=_0x16270a?_0xde728e[_0xba8b('0x1c')]:_0x23757b[_0xba8b('0x1d')]+_0x23757b[_0xba8b('0x1b')];var _0x4ffcbf;if(_0xe9e3dc>=_0x132619){_0xe9e3dc=_0x132619;_0x4ffcbf=0xc8;}else{_0x4ffcbf=0xce;}_0x3a1fc7['status'](_0x4ffcbf);return _0x3a1fc7[_0xba8b('0x1e')]('Content-Range',_0x1ee697+'-'+_0xe9e3dc+'/'+_0x132619)[_0xba8b('0x19')](_0xde728e);}return null;};}function patchUpdates(_0x50edd6){return function(_0x1586ad){try{jsonpatch[_0xba8b('0x1f')](_0x1586ad,_0x50edd6,!![]);}catch(_0x266f7b){return BPromise[_0xba8b('0x20')](_0x266f7b);}return _0x1586ad[_0xba8b('0x21')]();};}function saveUpdates(_0x4ada7c,_0xafbec2){return function(_0x1e6616){if(_0x1e6616){return _0x1e6616[_0xba8b('0x22')](_0x4ada7c)[_0xba8b('0x23')](function(_0xfd4764){return _0xfd4764;});}return null;};}function removeEntity(_0x407a0a,_0x431f96){return function(_0x37fafe){if(_0x37fafe){return _0x37fafe['destroy']()['then'](function(){_0x407a0a[_0xba8b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd640dc,_0x2f06bb){return function(_0x59411b){if(!_0x59411b){_0xd640dc[_0xba8b('0x17')](0x194);}return _0x59411b;};}function handleError(_0x2f9295,_0x557d64){_0x557d64=_0x557d64||0x1f4;return function(_0x59db1b){logger[_0xba8b('0x24')](_0x59db1b[_0xba8b('0x25')]);if(_0x59db1b[_0xba8b('0x26')]){delete _0x59db1b[_0xba8b('0x26')];}_0x2f9295[_0xba8b('0x18')](_0x557d64)['send'](_0x59db1b);};}exports[_0xba8b('0x22')]=function(_0x2fa5b3,_0x47d375){if(_0x2fa5b3[_0xba8b('0x27')]['id']){delete _0x2fa5b3['body']['id'];}return db[_0xba8b('0x28')][_0xba8b('0x29')]({'where':{'id':_0x2fa5b3[_0xba8b('0x2a')]['id']}})[_0xba8b('0x23')](handleEntityNotFound(_0x47d375,null))[_0xba8b('0x23')](saveUpdates(_0x2fa5b3['body'],null))[_0xba8b('0x23')](respondWithResult(_0x47d375,null))[_0xba8b('0x2b')](handleError(_0x47d375,null));};exports[_0xba8b('0x2c')]=function(_0x3e5f86,_0x55a4ae){return db['Action'][_0xba8b('0x29')]({'where':{'id':_0x3e5f86[_0xba8b('0x2a')]['id']}})[_0xba8b('0x23')](handleEntityNotFound(_0x55a4ae,null))['then'](removeEntity(_0x55a4ae,null))[_0xba8b('0x2b')](handleError(_0x55a4ae,null));}; \ No newline at end of file +var _0x2af5=['catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','error','name','update','body','find','params','Action'];(function(_0x41a66e,_0x335b49){var _0x1f8f70=function(_0x928ef5){while(--_0x928ef5){_0x41a66e['push'](_0x41a66e['shift']());}};_0x1f8f70(++_0x335b49);}(_0x2af5,0x109));var _0x52af=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0x2af5[_0x2134b7];return _0x6c5914;};'use strict';var emlformat=require(_0x52af('0x0'));var rimraf=require(_0x52af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x52af('0x2'));var moment=require(_0x52af('0x3'));var BPromise=require(_0x52af('0x4'));var Mustache=require(_0x52af('0x5'));var util=require(_0x52af('0x6'));var path=require(_0x52af('0x7'));var sox=require('sox');var csv=require(_0x52af('0x8'));var ejs=require(_0x52af('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x52af('0xa'));var squel=require(_0x52af('0xb'));var crypto=require('crypto');var jsforce=require(_0x52af('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x52af('0x8'));var querystring=require('querystring');var Papa=require(_0x52af('0xd'));var Redis=require(_0x52af('0xe'));var authService=require(_0x52af('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x52af('0x10'));var hardwareService=require(_0x52af('0x11'));var logger=require(_0x52af('0x12'))(_0x52af('0x13'));var utils=require(_0x52af('0x14'));var config=require(_0x52af('0x15'));var licenseUtil=require(_0x52af('0x16'));var db=require(_0x52af('0x17'))['db'];function respondWithStatusCode(_0x208c69,_0x388bea){_0x388bea=_0x388bea||0xcc;return function(_0x5ca8d0){if(_0x5ca8d0){return _0x208c69[_0x52af('0x18')](_0x388bea);}return _0x208c69[_0x52af('0x19')](_0x388bea)[_0x52af('0x1a')]();};}function respondWithResult(_0x3328eb,_0x19a1f2){_0x19a1f2=_0x19a1f2||0xc8;return function(_0x15386b){if(_0x15386b){return _0x3328eb[_0x52af('0x19')](_0x19a1f2)['json'](_0x15386b);}};}function respondWithFilteredResult(_0x3bf853,_0x129e86){return function(_0x1c4630){if(_0x1c4630){var _0x22e0f0=typeof _0x129e86[_0x52af('0x1b')]===_0x52af('0x1c')&&typeof _0x129e86[_0x52af('0x1d')]===_0x52af('0x1c');var _0x240370=_0x1c4630[_0x52af('0x1e')];var _0xb2530=_0x22e0f0?0x0:_0x129e86[_0x52af('0x1b')];var _0xaf1ea8=_0x22e0f0?_0x1c4630['count']:_0x129e86[_0x52af('0x1b')]+_0x129e86[_0x52af('0x1d')];var _0x2c6cd7;if(_0xaf1ea8>=_0x240370){_0xaf1ea8=_0x240370;_0x2c6cd7=0xc8;}else{_0x2c6cd7=0xce;}_0x3bf853[_0x52af('0x19')](_0x2c6cd7);return _0x3bf853['set'](_0x52af('0x1f'),_0xb2530+'-'+_0xaf1ea8+'/'+_0x240370)['json'](_0x1c4630);}return null;};}function patchUpdates(_0x2a9553){return function(_0xca07db){try{jsonpatch[_0x52af('0x20')](_0xca07db,_0x2a9553,!![]);}catch(_0x18c00a){return BPromise[_0x52af('0x21')](_0x18c00a);}return _0xca07db['save']();};}function saveUpdates(_0x1bf3a8,_0x3bb22d){return function(_0x437796){if(_0x437796){return _0x437796['update'](_0x1bf3a8)[_0x52af('0x22')](function(_0x42ed1c){return _0x42ed1c;});}return null;};}function removeEntity(_0x1b9541,_0x3fc3ad){return function(_0x40b2fb){if(_0x40b2fb){return _0x40b2fb[_0x52af('0x23')]()['then'](function(){_0x1b9541['status'](0xcc)[_0x52af('0x1a')]();});}};}function handleEntityNotFound(_0x5493b9,_0x313ad2){return function(_0x216337){if(!_0x216337){_0x5493b9['sendStatus'](0x194);}return _0x216337;};}function handleError(_0x1436ac,_0x1a7e64){_0x1a7e64=_0x1a7e64||0x1f4;return function(_0x39e12c){logger[_0x52af('0x24')](_0x39e12c['stack']);if(_0x39e12c[_0x52af('0x25')]){delete _0x39e12c['name'];}_0x1436ac['status'](_0x1a7e64)['send'](_0x39e12c);};}exports[_0x52af('0x26')]=function(_0x388b94,_0x2e73a3){if(_0x388b94[_0x52af('0x27')]['id']){delete _0x388b94[_0x52af('0x27')]['id'];}return db['Action'][_0x52af('0x28')]({'where':{'id':_0x388b94[_0x52af('0x29')]['id']}})[_0x52af('0x22')](handleEntityNotFound(_0x2e73a3,null))[_0x52af('0x22')](saveUpdates(_0x388b94[_0x52af('0x27')],null))[_0x52af('0x22')](respondWithResult(_0x2e73a3,null))['catch'](handleError(_0x2e73a3,null));};exports[_0x52af('0x23')]=function(_0x1e8a21,_0xd42380){return db[_0x52af('0x2a')][_0x52af('0x28')]({'where':{'id':_0x1e8a21[_0x52af('0x29')]['id']}})[_0x52af('0x22')](handleEntityNotFound(_0xd42380,null))[_0x52af('0x22')](removeEntity(_0xd42380,null))[_0x52af('0x2b')](handleError(_0xd42380,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6830fd0..76c581f 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 _0x9188=['./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x511da1,_0x5b55c1){var _0x3568bf=function(_0x28f323){while(--_0x28f323){_0x511da1['push'](_0x511da1['shift']());}};_0x3568bf(++_0x5b55c1);}(_0x9188,0xfc));var _0x8918=function(_0x23c2ae,_0x2c9ca5){_0x23c2ae=_0x23c2ae-0x0;var _0xb5c94e=_0x9188[_0x23c2ae];return _0xb5c94e;};'use strict';var _=require('lodash');var util=require(_0x8918('0x0'));var logger=require(_0x8918('0x1'))(_0x8918('0x2'));var moment=require(_0x8918('0x3'));var BPromise=require(_0x8918('0x4'));var rp=require(_0x8918('0x5'));var fs=require('fs');var path=require(_0x8918('0x6'));var rimraf=require('rimraf');var config=require(_0x8918('0x7'));var attributes=require(_0x8918('0x8'));module[_0x8918('0x9')]=function(_0x58f164,_0x357589){return _0x58f164[_0x8918('0xa')](_0x8918('0xb'),attributes,{'tableName':_0x8918('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a76=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash'];(function(_0xb42da0,_0x5e98b4){var _0x4036c7=function(_0x1ca1dc){while(--_0x1ca1dc){_0xb42da0['push'](_0xb42da0['shift']());}};_0x4036c7(++_0x5e98b4);}(_0x2a76,0xe9));var _0x62a7=function(_0x18d192,_0x49ae86){_0x18d192=_0x18d192-0x0;var _0x54f329=_0x2a76[_0x18d192];return _0x54f329;};'use strict';var _=require(_0x62a7('0x0'));var util=require(_0x62a7('0x1'));var logger=require(_0x62a7('0x2'))(_0x62a7('0x3'));var moment=require(_0x62a7('0x4'));var BPromise=require('bluebird');var rp=require(_0x62a7('0x5'));var fs=require('fs');var path=require(_0x62a7('0x6'));var rimraf=require(_0x62a7('0x7'));var config=require(_0x62a7('0x8'));var attributes=require(_0x62a7('0x9'));module[_0x62a7('0xa')]=function(_0x1365f4,_0x13d50d){return _0x1365f4['define'](_0x62a7('0xb'),attributes,{'tableName':_0x62a7('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 364956a..050fd80 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5aba4f,_0x1afb63){var _0x10cf5c=function(_0x1adea5){while(--_0x1adea5){_0x5aba4f['push'](_0x5aba4f['shift']());}};_0x10cf5c(++_0x1afb63);}(_0x5fab,0x177));var _0xb5fa=function(_0x5489bc,_0x9fb1ce){_0x5489bc=_0x5489bc-0x0;var _0x1f64b3=_0x5fab[_0x5489bc];return _0x1f64b3;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x227ea0,_0x4d3e91){var _0x5edb7e=function(_0x7c4636){while(--_0x7c4636){_0x227ea0['push'](_0x227ea0['shift']());}};_0x5edb7e(++_0x4d3e91);}(_0x5fab,0x177));var _0xb5fa=function(_0x5448a9,_0x4764da){_0x5448a9=_0x5448a9-0x0;var _0x1924af=_0x5fab[_0x5448a9];return _0x1924af;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 6f96b48..9895ca9 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 _0x1525=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x1525,0x133));var _0x5152=function(_0x193446,_0x30edfb){_0x193446=_0x193446-0x0;var _0x1aa0ef=_0x1525[_0x193446];return _0x1aa0ef;};'use strict';var multer=require(_0x5152('0x0'));var util=require(_0x5152('0x1'));var path=require(_0x5152('0x2'));var timeout=require(_0x5152('0x3'));var express=require(_0x5152('0x4'));var router=express[_0x5152('0x5')]();var fs_extra=require(_0x5152('0x6'));var auth=require(_0x5152('0x7'));var interaction=require(_0x5152('0x8'));var config=require(_0x5152('0x9'));var controller=require(_0x5152('0xa'));router[_0x5152('0xb')](_0x5152('0xc'),auth[_0x5152('0xd')](),controller[_0x5152('0xe')]);router[_0x5152('0xf')](_0x5152('0xc'),auth[_0x5152('0xd')](),controller[_0x5152('0x10')]);module[_0x5152('0x11')]=router; \ No newline at end of file +var _0xd0dd=['/:id','isAuthenticated','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x149dfe,_0x386f0e){var _0x5f5b6b=function(_0x127371){while(--_0x127371){_0x149dfe['push'](_0x149dfe['shift']());}};_0x5f5b6b(++_0x386f0e);}(_0xd0dd,0xc9));var _0xdd0d=function(_0x132bf6,_0x74d929){_0x132bf6=_0x132bf6-0x0;var _0x3f3e38=_0xd0dd[_0x132bf6];return _0x3f3e38;};'use strict';var multer=require(_0xdd0d('0x0'));var util=require('util');var path=require(_0xdd0d('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd0d('0x2'));var router=express['Router']();var fs_extra=require(_0xdd0d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdd0d('0x4'));var config=require(_0xdd0d('0x5'));var controller=require(_0xdd0d('0x6'));router[_0xdd0d('0x7')](_0xdd0d('0x8'),auth[_0xdd0d('0x9')](),controller['update']);router['delete']('/:id',auth[_0xdd0d('0x9')](),controller['destroy']);module[_0xdd0d('0xa')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 1f763bd..706d0e2 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0xafc4,0x69));var _0x4afc=function(_0x36fd10,_0x30c067){_0x36fd10=_0x36fd10-0x0;var _0x1d6935=_0xafc4[_0x36fd10];return _0x1d6935;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file +var _0x207c=['STRING','TEXT','exports'];(function(_0x39a1c8,_0x3c6266){var _0x258cb7=function(_0x355bc4){while(--_0x355bc4){_0x39a1c8['push'](_0x39a1c8['shift']());}};_0x258cb7(++_0x3c6266);}(_0x207c,0x1e8));var _0xc207=function(_0x2efe4f,_0x35b3d9){_0x2efe4f=_0x2efe4f-0x0;var _0x251e7e=_0x207c[_0x2efe4f];return _0x251e7e;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index bb9217d..2bc4fdc 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 _0xa81d=['map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','join','right_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','DATE(%s)','operator','Sequelize','AnalyticMetric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','run','left_join','GROUP_CONCAT(%s)','IS\x20NULL','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','end','error','stack','name','send','index'];(function(_0x1834ea,_0xb727a4){var _0x18bdea=function(_0x5bab09){while(--_0x5bab09){_0x1834ea['push'](_0x1834ea['shift']());}};_0x18bdea(++_0xb727a4);}(_0xa81d,0x11e));var _0xda81=function(_0x48ea38,_0xb5b397){_0x48ea38=_0x48ea38-0x0;var _0xa6780=_0xa81d[_0x48ea38];return _0xa6780;};'use strict';var emlformat=require(_0xda81('0x0'));var rimraf=require(_0xda81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda81('0x2'));var rp=require('request-promise');var moment=require(_0xda81('0x3'));var BPromise=require(_0xda81('0x4'));var Mustache=require(_0xda81('0x5'));var util=require(_0xda81('0x6'));var path=require(_0xda81('0x7'));var sox=require(_0xda81('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda81('0x9'));var _=require('lodash');var squel=require(_0xda81('0xa'));var crypto=require(_0xda81('0xb'));var jsforce=require(_0xda81('0xc'));var deskjs=require(_0xda81('0xd'));var toCsv=require(_0xda81('0xe'));var querystring=require(_0xda81('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda81('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xda81('0x11'));var hardwareService=require(_0xda81('0x12'));var logger=require(_0xda81('0x13'))(_0xda81('0x14'));var utils=require(_0xda81('0x15'));var config=require(_0xda81('0x16'));var licenseUtil=require(_0xda81('0x17'));var db=require(_0xda81('0x18'))['db'];var dbH=require(_0xda81('0x18'))[_0xda81('0x19')];function respondWithStatusCode(_0x58b90d,_0xa7f2bb){_0xa7f2bb=_0xa7f2bb||0xcc;return function(_0x36f9ae){if(_0x36f9ae){return _0x58b90d['sendStatus'](_0xa7f2bb);}return _0x58b90d[_0xda81('0x1a')](_0xa7f2bb)['end']();};}function respondWithResult(_0x151d89,_0x5d8b0a){_0x5d8b0a=_0x5d8b0a||0xc8;return function(_0x199357){if(_0x199357){return _0x151d89[_0xda81('0x1a')](_0x5d8b0a)[_0xda81('0x1b')](_0x199357);}};}function respondWithFilteredResult(_0x27facb,_0xe2adb4){return function(_0x1d3e0d){if(_0x1d3e0d){var _0x57bab1=typeof _0xe2adb4[_0xda81('0x1c')]===_0xda81('0x1d')&&typeof _0xe2adb4[_0xda81('0x1e')]===_0xda81('0x1d');var _0xa4de73=_0x1d3e0d[_0xda81('0x1f')];var _0x672c04=_0x57bab1?0x0:_0xe2adb4[_0xda81('0x1c')];var _0x415465=_0x57bab1?_0x1d3e0d[_0xda81('0x1f')]:_0xe2adb4[_0xda81('0x1c')]+_0xe2adb4['limit'];var _0x186539;if(_0x415465>=_0xa4de73){_0x415465=_0xa4de73;_0x186539=0xc8;}else{_0x186539=0xce;}_0x27facb['status'](_0x186539);return _0x27facb[_0xda81('0x20')](_0xda81('0x21'),_0x672c04+'-'+_0x415465+'/'+_0xa4de73)[_0xda81('0x1b')](_0x1d3e0d);}return null;};}function patchUpdates(_0x2a1a8e){return function(_0x1d95c3){try{jsonpatch[_0xda81('0x22')](_0x1d95c3,_0x2a1a8e,!![]);}catch(_0x37f555){return BPromise[_0xda81('0x23')](_0x37f555);}return _0x1d95c3[_0xda81('0x24')]();};}function saveUpdates(_0x456c4c,_0x3e9e82){return function(_0x83c0b8){if(_0x83c0b8){return _0x83c0b8[_0xda81('0x25')](_0x456c4c)[_0xda81('0x26')](function(_0x4d6598){return _0x4d6598;});}return null;};}function removeEntity(_0x524b90,_0x378ae3){return function(_0x3d33c7){if(_0x3d33c7){return _0x3d33c7[_0xda81('0x27')]()[_0xda81('0x26')](function(){var _0x431774=_0x3d33c7['get']({'plain':!![]});var _0x2caa71=_0xda81('0x28');return db[_0xda81('0x29')][_0xda81('0x27')]({'where':{'type':_0x2caa71,'resourceId':_0x431774['id']}})[_0xda81('0x26')](function(){return _0x3d33c7;});})[_0xda81('0x26')](function(){_0x524b90[_0xda81('0x1a')](0xcc)[_0xda81('0x2a')]();});}};}function handleEntityNotFound(_0x472621,_0x1dae09){return function(_0x25bda3){if(!_0x25bda3){_0x472621['sendStatus'](0x194);}return _0x25bda3;};}function handleError(_0x3948af,_0x1e4492){_0x1e4492=_0x1e4492||0x1f4;return function(_0x369abf){logger[_0xda81('0x2b')](_0x369abf[_0xda81('0x2c')]);if(_0x369abf[_0xda81('0x2d')]){delete _0x369abf[_0xda81('0x2d')];}_0x3948af[_0xda81('0x1a')](_0x1e4492)[_0xda81('0x2e')](_0x369abf);};}exports[_0xda81('0x2f')]=function(_0x103322,_0x3337f6){var _0x36ef88={},_0x16934a={},_0x57dc6d={'count':0x0,'rows':[]};var _0x26db35=_[_0xda81('0x30')](db[_0xda81('0x31')][_0xda81('0x32')],function(_0x39d43f){return{'name':_0x39d43f[_0xda81('0x33')],'type':_0x39d43f[_0xda81('0x34')][_0xda81('0x35')]};});_0x16934a[_0xda81('0x36')]=_[_0xda81('0x30')](_0x26db35,_0xda81('0x2d'));_0x16934a[_0xda81('0x37')]=_['keys'](_0x103322[_0xda81('0x37')]);_0x16934a[_0xda81('0x38')]=_['intersection'](_0x16934a['model'],_0x16934a[_0xda81('0x37')]);_0x36ef88['attributes']=_[_0xda81('0x39')](_0x16934a[_0xda81('0x36')],qs[_0xda81('0x3a')](_0x103322[_0xda81('0x37')][_0xda81('0x3a')]));_0x36ef88['attributes']=_0x36ef88[_0xda81('0x3b')][_0xda81('0x3c')]?_0x36ef88['attributes']:_0x16934a['model'];if(!_0x103322[_0xda81('0x37')][_0xda81('0x3d')](_0xda81('0x3e'))){_0x36ef88[_0xda81('0x1e')]=qs[_0xda81('0x1e')](_0x103322[_0xda81('0x37')]['limit']);_0x36ef88['offset']=qs[_0xda81('0x1c')](_0x103322['query'][_0xda81('0x1c')]);}_0x36ef88[_0xda81('0x3f')]=qs['sort'](_0x103322[_0xda81('0x37')]['sort']);_0x36ef88[_0xda81('0x40')]=qs[_0xda81('0x38')](_[_0xda81('0x41')](_0x103322[_0xda81('0x37')],_0x16934a[_0xda81('0x38')]),_0x26db35);if(_0x103322[_0xda81('0x37')]['filter']){_0x36ef88[_0xda81('0x40')]=_[_0xda81('0x42')](_0x36ef88[_0xda81('0x40')],{'$or':_[_0xda81('0x30')](_0x26db35,function(_0x818615){if(_0x818615[_0xda81('0x34')]!==_0xda81('0x43')){var _0x1e00a0={};_0x1e00a0[_0x818615[_0xda81('0x2d')]]={'$like':'%'+_0x103322[_0xda81('0x37')][_0xda81('0x44')]+'%'};return _0x1e00a0;}})});}_0x36ef88=_[_0xda81('0x42')]({},_0x36ef88,_0x103322['options']);var _0x453203={'where':_0x36ef88[_0xda81('0x40')]};return db[_0xda81('0x31')][_0xda81('0x1f')](_0x453203)[_0xda81('0x26')](function(_0x2b483e){_0x57dc6d[_0xda81('0x1f')]=_0x2b483e;if(_0x103322['query'][_0xda81('0x45')]){_0x36ef88['include']=[{'all':!![]}];}return db[_0xda81('0x31')][_0xda81('0x46')](_0x36ef88);})[_0xda81('0x26')](function(_0x3d652d){_0x57dc6d[_0xda81('0x47')]=_0x3d652d;return _0x57dc6d;})['then'](respondWithFilteredResult(_0x3337f6,_0x36ef88))[_0xda81('0x48')](handleError(_0x3337f6,null));};exports[_0xda81('0x49')]=function(_0x5414b3,_0x2c5669){var _0x4f9163={'raw':![],'where':{'id':_0x5414b3[_0xda81('0x4a')]['id']}},_0x42774a={};_0x42774a[_0xda81('0x36')]=_[_0xda81('0x4b')](db['AnalyticCustomReport'][_0xda81('0x32')]);_0x42774a['query']=_['keys'](_0x5414b3[_0xda81('0x37')]);_0x42774a['filters']=_[_0xda81('0x39')](_0x42774a['model'],_0x42774a[_0xda81('0x37')]);_0x4f9163[_0xda81('0x3b')]=_['intersection'](_0x42774a['model'],qs[_0xda81('0x3a')](_0x5414b3[_0xda81('0x37')][_0xda81('0x3a')]));_0x4f9163[_0xda81('0x3b')]=_0x4f9163[_0xda81('0x3b')][_0xda81('0x3c')]?_0x4f9163[_0xda81('0x3b')]:_0x42774a[_0xda81('0x36')];if(_0x5414b3['query']['includeAll']){_0x4f9163['include']=[{'all':!![]}];}_0x4f9163=_[_0xda81('0x42')]({},_0x4f9163,_0x5414b3['options']);return db[_0xda81('0x31')][_0xda81('0x4c')](_0x4f9163)[_0xda81('0x26')](handleEntityNotFound(_0x2c5669,null))[_0xda81('0x26')](respondWithResult(_0x2c5669,null))[_0xda81('0x48')](handleError(_0x2c5669,null));};exports[_0xda81('0x4d')]=function(_0x511c11,_0x3531ed){return db[_0xda81('0x31')]['create'](_0x511c11[_0xda81('0x4e')],{})['then'](function(_0x1ac89c){var _0x3a6a56=_0x511c11[_0xda81('0x4f')][_0xda81('0x50')]({'plain':!![]});if(!_0x3a6a56)throw new Error(_0xda81('0x51'));if(_0x3a6a56[_0xda81('0x52')]==='user'){var _0x44bb5a=_0x1ac89c[_0xda81('0x50')]({'plain':!![]});var _0x14a960=_0xda81('0x53');return db[_0xda81('0x54')][_0xda81('0x4c')]({'where':{'name':_0x14a960,'userProfileId':_0x3a6a56[_0xda81('0x55')]},'raw':!![]})[_0xda81('0x26')](function(_0x1fa872){if(_0x1fa872&&_0x1fa872[_0xda81('0x56')]===0x0){return db[_0xda81('0x29')][_0xda81('0x4d')]({'name':_0x44bb5a[_0xda81('0x2d')],'resourceId':_0x44bb5a['id'],'type':'CustomReports','sectionId':_0x1fa872['id']},{})[_0xda81('0x26')](function(){return _0x1ac89c;});}else{return _0x1ac89c;}})[_0xda81('0x48')](function(_0x202cb1){logger[_0xda81('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x202cb1);throw _0x202cb1;});}return _0x1ac89c;})[_0xda81('0x26')](respondWithResult(_0x3531ed,0xc9))[_0xda81('0x48')](handleError(_0x3531ed,null));};exports[_0xda81('0x25')]=function(_0xfd7a54,_0x562459){if(_0xfd7a54[_0xda81('0x4e')]['id']){delete _0xfd7a54['body']['id'];}return db[_0xda81('0x31')][_0xda81('0x4c')]({'where':{'id':_0xfd7a54[_0xda81('0x4a')]['id']}})[_0xda81('0x26')](handleEntityNotFound(_0x562459,null))[_0xda81('0x26')](saveUpdates(_0xfd7a54[_0xda81('0x4e')],null))[_0xda81('0x26')](respondWithResult(_0x562459,null))[_0xda81('0x48')](handleError(_0x562459,null));};exports['destroy']=function(_0x776a06,_0x3fd79e){return db[_0xda81('0x31')][_0xda81('0x4c')]({'where':{'id':_0x776a06[_0xda81('0x4a')]['id']}})[_0xda81('0x26')](handleEntityNotFound(_0x3fd79e,null))[_0xda81('0x26')](removeEntity(_0x3fd79e,null))[_0xda81('0x48')](handleError(_0x3fd79e,null));};exports['preview']=function(_0x2bdd6a,_0x2b34e7){var _0x2aa687=0xa;var _0x49b996=[_0xda81('0x57'),'left_join',_0xda81('0x58'),'cross_join'];var _0x159617={'SUM':'SUM(%s)','COUNT':_0xda81('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xda81('0x5a'),'MIN':_0xda81('0x5b'),'AVG':_0xda81('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xda81('0x5d'),'GROUP_CONCAT DESC':_0xda81('0x5e')};var _0x2097f8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xda81('0x5f'),'ROUND':_0xda81('0x60'),'UNIX_TIMESTAMP':_0xda81('0x61')};var _0x3ab318=function(_0x50de7c){return!_[_0xda81('0x62')](['IS\x20NULL',_0xda81('0x63'),_0xda81('0x64'),_0xda81('0x65')],_0x50de7c);};var _0x22c506=function(_0x258f9d){if(!_0x258f9d||!_0x258f9d[_0xda81('0x66')][_0xda81('0x3c')]){return'';}for(var _0xbab530='(',_0x480d1b=0x0;_0x480d1b<_0x258f9d['rules']['length'];_0x480d1b+=0x1){_0x480d1b>0x0&&(_0xbab530+='\x20'+_0x258f9d['operator']+'\x20');_0xbab530+=_0x258f9d['rules'][_0x480d1b][_0xda81('0x67')]?_0x22c506(_0x258f9d['rules'][_0x480d1b][_0xda81('0x67')]):_0x258f9d[_0xda81('0x66')][_0x480d1b][_0xda81('0x68')]+'\x20'+_0x258f9d[_0xda81('0x66')][_0x480d1b][_0xda81('0x69')]+(_0x3ab318(_0x258f9d[_0xda81('0x66')][_0x480d1b]['condition'])?'\x20'+_0x258f9d[_0xda81('0x66')][_0x480d1b][_0xda81('0x6a')]:'');}return _0xbab530+')';};var _0x579f47={'where':{'id':_0x2bdd6a[_0xda81('0x4a')]['id']}},_0x5d7ae3,_0x3ee13b,_0x547b48,_0x45a6d9,_0x2dee0f;_0x579f47=_[_0xda81('0x42')]({},_0x579f47,_0x2bdd6a[_0xda81('0x6b')]);return db[_0xda81('0x31')][_0xda81('0x4c')](_0x579f47)[_0xda81('0x26')](function(_0x20802f){if(_0x20802f){_0x5d7ae3=_0x20802f;return _0x20802f[_0xda81('0x6c')]();}return null;})[_0xda81('0x26')](function(_0x364c0e){if(_0x364c0e){if(!_0x364c0e[_0xda81('0x3c')]){throw new db['Sequelize'][(_0xda81('0x6d'))](_0xda81('0x6e'),0x193);}_0x3ee13b=_0x364c0e;return db['AnalyticMetric'][_0xda81('0x46')]({'raw':!![]});}return null;})[_0xda81('0x26')](function(_0x3fba80){if(_0x3fba80){_0x547b48=_[_0xda81('0x6f')](_0x3fba80,'id');var _0x52de46;var _0x4112cc=squel[_0xda81('0x70')]();_0x4112cc[_0xda81('0x71')](_0x5d7ae3[_0xda81('0x72')]);for(var _0x558531=0x0;_0x558531<_0x3ee13b[_0xda81('0x3c')];_0x558531+=0x1){_0x52de46=_0x3ee13b[_0x558531][_0xda81('0x73')]?_0x547b48[_0x3ee13b[_0x558531][_0xda81('0x73')]][_0xda81('0x74')]:_0x3ee13b[_0x558531][_0xda81('0x68')];_0x52de46=_0x3ee13b[_0x558531][_0xda81('0x75')]?_[_0xda81('0x76')](_0x159617[_0x3ee13b[_0x558531][_0xda81('0x75')]],'%s',_0x52de46):_0x52de46;_0x52de46=_0x3ee13b[_0x558531][_0xda81('0x77')]?_[_0xda81('0x76')](_0x2097f8[_0x3ee13b[_0x558531]['format']],'%s',_0x52de46):_0x52de46;if(_0x3ee13b[_0x558531][_0xda81('0x78')]){_0x4112cc[_0xda81('0x67')](_0x52de46);}_0x3ee13b[_0x558531][_0xda81('0x79')]&&_0x4112cc[_0xda81('0x3f')](_0x52de46,_0x3ee13b[_0x558531][_0xda81('0x79')]==='DESC'?![]:!![]);_0x4112cc['field'](_0x52de46,_0x3ee13b[_0x558531][_0xda81('0x7a')]||_0x52de46);}if(_0x5d7ae3['joins']){_0x5d7ae3[_0xda81('0x7b')]=JSON[_0xda81('0x7c')](_0x5d7ae3[_0xda81('0x7b')]);for(var _0x1bc9ec=0x0;_0x1bc9ec<_0x5d7ae3[_0xda81('0x7b')][_0xda81('0x3c')];_0x1bc9ec+=0x1){if(_0x5d7ae3[_0xda81('0x7b')][_0x1bc9ec]['type']&&_[_0xda81('0x62')](_0x49b996,_0x5d7ae3[_0xda81('0x7b')][_0x1bc9ec][_0xda81('0x34')])&&_0x5d7ae3[_0xda81('0x7b')][_0x1bc9ec][_0xda81('0x7d')]&&_0x5d7ae3['joins'][_0x1bc9ec]['foreignTable']&&_0x5d7ae3[_0xda81('0x7b')][_0x1bc9ec]['foreignKey']){_0x4112cc[_0x5d7ae3[_0xda81('0x7b')][_0x1bc9ec][_0xda81('0x34')]](_0x5d7ae3['joins'][_0x1bc9ec][_0xda81('0x7e')],null,util[_0xda81('0x77')](_0xda81('0x7f'),_0x5d7ae3[_0xda81('0x72')],_0x5d7ae3[_0xda81('0x7b')][_0x1bc9ec][_0xda81('0x7d')],_0x5d7ae3[_0xda81('0x7b')][_0x1bc9ec][_0xda81('0x7e')],_0x5d7ae3['joins'][_0x1bc9ec][_0xda81('0x80')]));}}}if(_0x5d7ae3[_0xda81('0x81')]){_0x5d7ae3['conditions']=JSON['parse'](_0x5d7ae3[_0xda81('0x81')]);_0x4112cc[_0xda81('0x40')](_0x22c506(_0x5d7ae3[_0xda81('0x81')][_0xda81('0x67')]));}_0x2dee0f=_0x4112cc['clone']();_0x4112cc[_0xda81('0x1e')](_0x2aa687);_0x4112cc['offset'](0x0);logger[_0xda81('0x82')](_0xda81('0x83'),_0x4112cc['toString']());return dbH[_0xda81('0x84')][_0xda81('0x37')](_0x4112cc[_0xda81('0x85')](),{'type':dbH[_0xda81('0x84')][_0xda81('0x86')][_0xda81('0x87')]});}})['then'](respondWithResult(_0x2b34e7,null))[_0xda81('0x48')](handleError(_0x2b34e7,null));};function runReport(_0x45e6a5,_0x220a6c,_0x318d65){var _0x3a451f=_0x220a6c[_0xda81('0x2d')];var _0x550f72=0xa;var _0x144a11=[_0xda81('0x57'),'left_join',_0xda81('0x58'),_0xda81('0x88')];var _0x17296c={'SUM':_0xda81('0x89'),'COUNT':_0xda81('0x59'),'COUNT DISTINCT':_0xda81('0x8a'),'MAX':_0xda81('0x5a'),'MIN':'MIN(%s)','AVG':_0xda81('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xda81('0x5d'),'GROUP_CONCAT DESC':_0xda81('0x5e')};var _0x57d732={'SEC_TO_TIME':_0xda81('0x8b'),'DATE':_0xda81('0x8c'),'HOUR':_0xda81('0x5f'),'ROUND':_0xda81('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3a2468=function(_0x3733a4){return!_[_0xda81('0x62')](['IS\x20NULL',_0xda81('0x63'),_0xda81('0x64'),'IS\x20NOT\x20EMPTY'],_0x3733a4);};var _0x1c1f6f=function(_0x2b1f92){if(!_0x2b1f92||!_0x2b1f92['rules']['length']){return'';}for(var _0x32f9cb='(',_0x22576d=0x0;_0x22576d<_0x2b1f92[_0xda81('0x66')][_0xda81('0x3c')];_0x22576d+=0x1){_0x22576d>0x0&&(_0x32f9cb+='\x20'+_0x2b1f92[_0xda81('0x8d')]+'\x20');_0x32f9cb+=_0x2b1f92[_0xda81('0x66')][_0x22576d][_0xda81('0x67')]?_0x1c1f6f(_0x2b1f92[_0xda81('0x66')][_0x22576d][_0xda81('0x67')]):_0x2b1f92[_0xda81('0x66')][_0x22576d]['field']+'\x20'+_0x2b1f92[_0xda81('0x66')][_0x22576d][_0xda81('0x69')]+(_0x3a2468(_0x2b1f92[_0xda81('0x66')][_0x22576d][_0xda81('0x69')])?'\x20'+_0x2b1f92[_0xda81('0x66')][_0x22576d][_0xda81('0x6a')]:'');}return _0x32f9cb+')';};var _0x434115={'where':{'id':_0x45e6a5['id']}},_0x28d96f,_0x474db4,_0x4ba292,_0x2b1a09,_0x586bb9;_0x434115=_['merge']({},_0x434115,_0x318d65);return db[_0xda81('0x31')]['find'](_0x434115)[_0xda81('0x26')](function(_0x47d93e){if(_0x47d93e){_0x28d96f=_0x47d93e;return _0x47d93e[_0xda81('0x6c')]();}return null;})['then'](function(_0x377074){if(_0x377074){if(!_0x377074[_0xda81('0x3c')]){throw new db[(_0xda81('0x8e'))][(_0xda81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x474db4=_0x377074;return db[_0xda81('0x8f')][_0xda81('0x46')]({'raw':!![]});}return null;})[_0xda81('0x26')](function(_0x376a67){if(_0x376a67){_0x4ba292=_['keyBy'](_0x376a67,'id');var _0x52c6ad;var _0x20c87a=squel[_0xda81('0x70')]();_0x20c87a[_0xda81('0x71')](_0x28d96f['table']);for(var _0x3020d4=0x0;_0x3020d4<_0x474db4[_0xda81('0x3c')];_0x3020d4+=0x1){_0x52c6ad=_0x474db4[_0x3020d4][_0xda81('0x73')]?_0x4ba292[_0x474db4[_0x3020d4][_0xda81('0x73')]][_0xda81('0x74')]:_0x474db4[_0x3020d4][_0xda81('0x68')];_0x52c6ad=_0x474db4[_0x3020d4][_0xda81('0x75')]?_[_0xda81('0x76')](_0x17296c[_0x474db4[_0x3020d4]['function']],'%s',_0x52c6ad):_0x52c6ad;_0x52c6ad=_0x474db4[_0x3020d4][_0xda81('0x77')]?_[_0xda81('0x76')](_0x57d732[_0x474db4[_0x3020d4][_0xda81('0x77')]],'%s',_0x52c6ad):_0x52c6ad;if(_0x474db4[_0x3020d4]['groupBy']){_0x20c87a['group'](_0x52c6ad);}_0x474db4[_0x3020d4][_0xda81('0x79')]&&_0x20c87a[_0xda81('0x3f')](_0x52c6ad,_0x474db4[_0x3020d4][_0xda81('0x79')]===_0xda81('0x90')?![]:!![]);_0x20c87a[_0xda81('0x68')](_0x52c6ad,_0x474db4[_0x3020d4]['alias']||_0x52c6ad);}if(_0x28d96f[_0xda81('0x7b')]){_0x28d96f[_0xda81('0x7b')]=JSON[_0xda81('0x7c')](_0x28d96f[_0xda81('0x7b')]);for(var _0x56cfe6=0x0;_0x56cfe6<_0x28d96f[_0xda81('0x7b')]['length'];_0x56cfe6+=0x1){if(_0x28d96f['joins'][_0x56cfe6]['type']&&_['includes'](_0x144a11,_0x28d96f[_0xda81('0x7b')][_0x56cfe6]['type'])&&_0x28d96f[_0xda81('0x7b')][_0x56cfe6][_0xda81('0x7d')]&&_0x28d96f[_0xda81('0x7b')][_0x56cfe6][_0xda81('0x7e')]&&_0x28d96f[_0xda81('0x7b')][_0x56cfe6][_0xda81('0x80')]){_0x20c87a[_0x28d96f['joins'][_0x56cfe6][_0xda81('0x34')]](_0x28d96f[_0xda81('0x7b')][_0x56cfe6][_0xda81('0x7e')],null,util[_0xda81('0x77')]('%s.%s\x20=\x20%s.%s',_0x28d96f['table'],_0x28d96f[_0xda81('0x7b')][_0x56cfe6][_0xda81('0x7d')],_0x28d96f[_0xda81('0x7b')][_0x56cfe6]['foreignTable'],_0x28d96f['joins'][_0x56cfe6][_0xda81('0x80')]));}}}if(_0x28d96f[_0xda81('0x81')]){_0x28d96f[_0xda81('0x81')]=JSON[_0xda81('0x7c')](_0x28d96f[_0xda81('0x81')]);_0x20c87a[_0xda81('0x40')](_0x1c1f6f(_0x28d96f[_0xda81('0x81')]['group']));}_0x586bb9=_0x20c87a[_0xda81('0x91')]();_0x20c87a['limit'](_0x550f72);_0x20c87a[_0xda81('0x1c')](0x0);return;}})[_0xda81('0x26')](function(){if(_0x220a6c[_0xda81('0x92')]==='web'){return null;}var _0x19ec1a=_[_0xda81('0x42')](_0x220a6c,{'name':_0x220a6c[_0xda81('0x93')]||_0x220a6c['name']||_0x28d96f[_0xda81('0x2d')],'basename':_0x3a451f,'savename':util[_0xda81('0x77')](_0xda81('0x94'),_0x220a6c[_0xda81('0x2d')]||_0x28d96f[_0xda81('0x2d')],require(_0xda81('0x95'))[_0xda81('0x96')](0x4),_0x220a6c[_0xda81('0x92')]||'csv'),'reportId':_0x28d96f['id'],'reportType':_0xda81('0x97')});return db['AnalyticExtractedReport']['create'](_0x19ec1a,{'raw':!![]});})[_0xda81('0x26')](function(_0x1b072a){if(_0x28d96f[_0xda81('0x72')]===_0xda81('0x98')){_0x586bb9[_0xda81('0x40')](_0x28d96f[_0xda81('0x72')]+_0xda81('0x99'),_0x220a6c['startDate'],_0x220a6c[_0xda81('0x9a')]);}else{_0x586bb9[_0xda81('0x40')](_0x28d96f[_0xda81('0x72')]+_0xda81('0x9b'),_0x220a6c[_0xda81('0x9c')],_0x220a6c[_0xda81('0x9a')]);}if(_0x1b072a){logger[_0xda81('0x9d')](_0xda81('0x9e'),_0x586bb9['toString']());require(_0xda81('0x9f'))[_0xda81('0xa0')](path[_0xda81('0x57')](__dirname,'../../components/export/',_0x1b072a['output']),[_0x1b072a['id'],_0x586bb9[_0xda81('0x85')](),path[_0xda81('0x57')](__dirname,_0xda81('0xa1'),_0x1b072a['savename']),_0x3a451f]);return _0x1b072a;}else{var _0x4674fc=squel[_0xda81('0x70')]();_0x4674fc[_0xda81('0x71')]('('+_0x586bb9[_0xda81('0x85')]()+')',_0xda81('0xa2'));_0x4674fc['field']('COUNT(*)','count');_0x586bb9[_0xda81('0x1e')](_0x220a6c['limit']||_0x550f72);_0x586bb9[_0xda81('0x1c')](_0x220a6c['offset']||0x0);return dbH['sequelize']['query'](_0x4674fc['toString'](),{'type':dbH[_0xda81('0x84')][_0xda81('0x86')][_0xda81('0x87')]})[_0xda81('0x26')](function(_0x39c633){if(!_0x39c633[_0xda81('0x3c')]){_0x2b1a09=0x0;}else{_0x2b1a09=_0x39c633[0x0][_0xda81('0x1f')]||0x0;}return dbH['sequelize']['query'](_0x586bb9[_0xda81('0x85')](),{'type':dbH['sequelize'][_0xda81('0x86')][_0xda81('0x87')]});})['then'](function(_0x1493fb){return{'rows':_0x1493fb||[],'count':_0x2b1a09};});}});}exports[_0xda81('0xa3')]=function(_0x16be96,_0x138377){return runReport(_0x16be96[_0xda81('0x4a')],_0x16be96[_0xda81('0x37')],_0x16be96['options'])['then'](respondWithResult(_0x138377,null))[_0xda81('0x48')](handleError(_0x138377,null));};exports['runReport']=runReport;exports[_0xda81('0x37')]=function(_0xdc0c19,_0x3c3fc4){var _0x9488d7=0xa;var _0x548734=[_0xda81('0x57'),_0xda81('0xa4'),'right_join',_0xda81('0x88')];var _0x57b005={'SUM':_0xda81('0x89'),'COUNT':_0xda81('0x59'),'COUNT DISTINCT':_0xda81('0x8a'),'MAX':'MAX(%s)','MIN':_0xda81('0x5b'),'AVG':_0xda81('0x5c'),'GROUP_CONCAT':_0xda81('0xa5'),'GROUP_CONCAT ASC':_0xda81('0x5d'),'GROUP_CONCAT DESC':_0xda81('0x5e')};var _0x288a26={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xda81('0x8c'),'HOUR':'HOUR(%s)','ROUND':_0xda81('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x87158c=function(_0x210a96){return!_[_0xda81('0x62')]([_0xda81('0xa6'),_0xda81('0x63'),'IS\x20EMPTY',_0xda81('0x65')],_0x210a96);};var _0x5785bc=function(_0x584d0d){if(!_0x584d0d||!_0x584d0d[_0xda81('0x66')][_0xda81('0x3c')]){return'';}for(var _0x2ce323='(',_0x3e0669=0x0;_0x3e0669<_0x584d0d[_0xda81('0x66')][_0xda81('0x3c')];_0x3e0669+=0x1){_0x3e0669>0x0&&(_0x2ce323+='\x20'+_0x584d0d[_0xda81('0x8d')]+'\x20');_0x2ce323+=_0x584d0d[_0xda81('0x66')][_0x3e0669][_0xda81('0x67')]?_0x5785bc(_0x584d0d[_0xda81('0x66')][_0x3e0669][_0xda81('0x67')]):_0x584d0d[_0xda81('0x66')][_0x3e0669][_0xda81('0x68')]+'\x20'+_0x584d0d['rules'][_0x3e0669][_0xda81('0x69')]+(_0x87158c(_0x584d0d[_0xda81('0x66')][_0x3e0669][_0xda81('0x69')])?'\x20'+_0x584d0d['rules'][_0x3e0669][_0xda81('0x6a')]:'');}return _0x2ce323+')';};var _0x349ca9={'where':{'id':_0xdc0c19[_0xda81('0x4a')]['id']}},_0x41ea91,_0x5972c5,_0x3b0cfa,_0x1f8e50,_0x4e70e1;_0x349ca9=_[_0xda81('0x42')]({},_0x349ca9,_0xdc0c19[_0xda81('0x6b')]);return db[_0xda81('0x31')][_0xda81('0x4c')](_0x349ca9)[_0xda81('0x26')](function(_0x183c00){if(_0x183c00){_0x41ea91=_0x183c00;return _0x183c00[_0xda81('0x6c')]();}return null;})['then'](function(_0x194137){if(_0x194137){if(!_0x194137[_0xda81('0x3c')]){throw new db['Sequelize'][(_0xda81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5972c5=_0x194137;return db[_0xda81('0x8f')][_0xda81('0x46')]({'raw':!![]});}return null;})[_0xda81('0x26')](function(_0x4e75f9){if(_0x4e75f9){_0x3b0cfa=_[_0xda81('0x6f')](_0x4e75f9,'id');var _0x1ef81c;var _0x23e50e=squel[_0xda81('0x70')]();_0x23e50e['from'](_0x41ea91[_0xda81('0x72')]);for(var _0x19c604=0x0;_0x19c604<_0x5972c5[_0xda81('0x3c')];_0x19c604+=0x1){_0x1ef81c=_0x5972c5[_0x19c604][_0xda81('0x73')]?_0x3b0cfa[_0x5972c5[_0x19c604]['MetricId']]['metric']:_0x5972c5[_0x19c604][_0xda81('0x68')];_0x1ef81c=_0x5972c5[_0x19c604][_0xda81('0x75')]?_['replace'](_0x57b005[_0x5972c5[_0x19c604][_0xda81('0x75')]],'%s',_0x1ef81c):_0x1ef81c;_0x1ef81c=_0x5972c5[_0x19c604][_0xda81('0x77')]?_[_0xda81('0x76')](_0x288a26[_0x5972c5[_0x19c604][_0xda81('0x77')]],'%s',_0x1ef81c):_0x1ef81c;if(_0x5972c5[_0x19c604][_0xda81('0x78')]){_0x23e50e[_0xda81('0x67')](_0x1ef81c);}_0x5972c5[_0x19c604][_0xda81('0x79')]&&_0x23e50e[_0xda81('0x3f')](_0x1ef81c,_0x5972c5[_0x19c604][_0xda81('0x79')]===_0xda81('0x90')?![]:!![]);_0x23e50e[_0xda81('0x68')](_0x1ef81c,_0x5972c5[_0x19c604]['alias']||_0x1ef81c);}if(_0x41ea91[_0xda81('0x7b')]){_0x41ea91[_0xda81('0x7b')]=JSON[_0xda81('0x7c')](_0x41ea91[_0xda81('0x7b')]);for(var _0x2849d6=0x0;_0x2849d6<_0x41ea91[_0xda81('0x7b')][_0xda81('0x3c')];_0x2849d6+=0x1){if(_0x41ea91['joins'][_0x2849d6]['type']&&_[_0xda81('0x62')](_0x548734,_0x41ea91['joins'][_0x2849d6][_0xda81('0x34')])&&_0x41ea91[_0xda81('0x7b')][_0x2849d6][_0xda81('0x7d')]&&_0x41ea91['joins'][_0x2849d6][_0xda81('0x7e')]&&_0x41ea91[_0xda81('0x7b')][_0x2849d6]['foreignKey']){_0x23e50e[_0x41ea91['joins'][_0x2849d6][_0xda81('0x34')]](_0x41ea91[_0xda81('0x7b')][_0x2849d6][_0xda81('0x7e')],null,util[_0xda81('0x77')]('%s.%s\x20=\x20%s.%s',_0x41ea91[_0xda81('0x72')],_0x41ea91[_0xda81('0x7b')][_0x2849d6][_0xda81('0x7d')],_0x41ea91[_0xda81('0x7b')][_0x2849d6][_0xda81('0x7e')],_0x41ea91[_0xda81('0x7b')][_0x2849d6][_0xda81('0x80')]));}}}if(_0x41ea91[_0xda81('0x81')]){_0x41ea91['conditions']=JSON[_0xda81('0x7c')](_0x41ea91[_0xda81('0x81')]);_0x23e50e[_0xda81('0x40')](_0x5785bc(_0x41ea91[_0xda81('0x81')][_0xda81('0x67')]));}_0x4e70e1=_0x23e50e['clone']();_0x23e50e['limit'](_0x9488d7);_0x23e50e[_0xda81('0x1c')](0x0);logger[_0xda81('0x82')]('Limited\x20Query:',_0x23e50e[_0xda81('0x85')]());return dbH[_0xda81('0x84')][_0xda81('0x37')](_0x23e50e['toString'](),{'type':dbH[_0xda81('0x84')]['QueryTypes']['SELECT']});}})[_0xda81('0x26')](function(){return{'sql':_0x4e70e1[_0xda81('0x85')]()};})['then'](respondWithResult(_0x3c3fc4,null))[_0xda81('0x48')](handleError(_0x3c3fc4,null));}; \ No newline at end of file +var _0x049b=['SELECT','join','cross_join','DATE(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','value','output','fullPath','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','IS\x20NOT\x20EMPTY','keyBy','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','includes','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','QueryTypes'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0x049b,0xc1));var _0xb049=function(_0x156ab9,_0x27509a){_0x156ab9=_0x156ab9-0x0;var _0x1feb8b=_0x049b[_0x156ab9];return _0x1feb8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb049('0x0'));var zipdir=require(_0xb049('0x1'));var jsonpatch=require(_0xb049('0x2'));var rp=require(_0xb049('0x3'));var moment=require(_0xb049('0x4'));var BPromise=require(_0xb049('0x5'));var Mustache=require(_0xb049('0x6'));var util=require(_0xb049('0x7'));var path=require(_0xb049('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb049('0x9'));var fs=require('fs');var fs_extra=require(_0xb049('0xa'));var _=require(_0xb049('0xb'));var squel=require(_0xb049('0xc'));var crypto=require(_0xb049('0xd'));var jsforce=require(_0xb049('0xe'));var deskjs=require(_0xb049('0xf'));var toCsv=require(_0xb049('0x10'));var querystring=require('querystring');var Papa=require(_0xb049('0x11'));var Redis=require(_0xb049('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb049('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb049('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb049('0x15'))['db'];var dbH=require(_0xb049('0x15'))[_0xb049('0x16')];function respondWithStatusCode(_0xc03cb,_0x5427f5){_0x5427f5=_0x5427f5||0xcc;return function(_0xc96cb5){if(_0xc96cb5){return _0xc03cb[_0xb049('0x17')](_0x5427f5);}return _0xc03cb[_0xb049('0x18')](_0x5427f5)[_0xb049('0x19')]();};}function respondWithResult(_0x4e0a42,_0x2c4756){_0x2c4756=_0x2c4756||0xc8;return function(_0x323deb){if(_0x323deb){return _0x4e0a42[_0xb049('0x18')](_0x2c4756)[_0xb049('0x1a')](_0x323deb);}};}function respondWithFilteredResult(_0x3087ea,_0x42795e){return function(_0x598047){if(_0x598047){var _0x5971ec=typeof _0x42795e[_0xb049('0x1b')]===_0xb049('0x1c')&&typeof _0x42795e[_0xb049('0x1d')]==='undefined';var _0x2135e4=_0x598047[_0xb049('0x1e')];var _0xa041ca=_0x5971ec?0x0:_0x42795e[_0xb049('0x1b')];var _0x48a573=_0x5971ec?_0x598047[_0xb049('0x1e')]:_0x42795e[_0xb049('0x1b')]+_0x42795e['limit'];var _0x19e296;if(_0x48a573>=_0x2135e4){_0x48a573=_0x2135e4;_0x19e296=0xc8;}else{_0x19e296=0xce;}_0x3087ea[_0xb049('0x18')](_0x19e296);return _0x3087ea[_0xb049('0x1f')](_0xb049('0x20'),_0xa041ca+'-'+_0x48a573+'/'+_0x2135e4)['json'](_0x598047);}return null;};}function patchUpdates(_0x123269){return function(_0x17739a){try{jsonpatch[_0xb049('0x21')](_0x17739a,_0x123269,!![]);}catch(_0x359b6b){return BPromise['reject'](_0x359b6b);}return _0x17739a['save']();};}function saveUpdates(_0x41ffea,_0x5dd8d4){return function(_0x3f5111){if(_0x3f5111){return _0x3f5111[_0xb049('0x22')](_0x41ffea)[_0xb049('0x23')](function(_0x32e1b4){return _0x32e1b4;});}return null;};}function removeEntity(_0x22d09d,_0x469d47){return function(_0x1544c2){if(_0x1544c2){return _0x1544c2[_0xb049('0x24')]()[_0xb049('0x23')](function(){var _0x40c78f=_0x1544c2[_0xb049('0x25')]({'plain':!![]});var _0xdf22c5=_0xb049('0x26');return db[_0xb049('0x27')][_0xb049('0x24')]({'where':{'type':_0xdf22c5,'resourceId':_0x40c78f['id']}})['then'](function(){return _0x1544c2;});})['then'](function(){_0x22d09d[_0xb049('0x18')](0xcc)[_0xb049('0x19')]();});}};}function handleEntityNotFound(_0x34224a,_0x37216c){return function(_0x15ebb1){if(!_0x15ebb1){_0x34224a['sendStatus'](0x194);}return _0x15ebb1;};}function handleError(_0x1fae36,_0x375713){_0x375713=_0x375713||0x1f4;return function(_0x35d13f){logger[_0xb049('0x28')](_0x35d13f['stack']);if(_0x35d13f[_0xb049('0x29')]){delete _0x35d13f[_0xb049('0x29')];}_0x1fae36[_0xb049('0x18')](_0x375713)[_0xb049('0x2a')](_0x35d13f);};}exports[_0xb049('0x2b')]=function(_0x15dabe,_0x2c84be){var _0x31e3cc={},_0x4ad442={},_0x2222dd={'count':0x0,'rows':[]};var _0x3db1cf=_['map'](db[_0xb049('0x2c')][_0xb049('0x2d')],function(_0x3b2fb8){return{'name':_0x3b2fb8[_0xb049('0x2e')],'type':_0x3b2fb8['type']['key']};});_0x4ad442[_0xb049('0x2f')]=_['map'](_0x3db1cf,_0xb049('0x29'));_0x4ad442[_0xb049('0x30')]=_['keys'](_0x15dabe['query']);_0x4ad442[_0xb049('0x31')]=_[_0xb049('0x32')](_0x4ad442[_0xb049('0x2f')],_0x4ad442[_0xb049('0x30')]);_0x31e3cc[_0xb049('0x33')]=_[_0xb049('0x32')](_0x4ad442[_0xb049('0x2f')],qs[_0xb049('0x34')](_0x15dabe[_0xb049('0x30')][_0xb049('0x34')]));_0x31e3cc['attributes']=_0x31e3cc[_0xb049('0x33')][_0xb049('0x35')]?_0x31e3cc[_0xb049('0x33')]:_0x4ad442['model'];if(!_0x15dabe[_0xb049('0x30')][_0xb049('0x36')](_0xb049('0x37'))){_0x31e3cc['limit']=qs['limit'](_0x15dabe[_0xb049('0x30')]['limit']);_0x31e3cc['offset']=qs[_0xb049('0x1b')](_0x15dabe[_0xb049('0x30')][_0xb049('0x1b')]);}_0x31e3cc[_0xb049('0x38')]=qs[_0xb049('0x39')](_0x15dabe[_0xb049('0x30')][_0xb049('0x39')]);_0x31e3cc[_0xb049('0x3a')]=qs[_0xb049('0x31')](_[_0xb049('0x3b')](_0x15dabe[_0xb049('0x30')],_0x4ad442[_0xb049('0x31')]),_0x3db1cf);if(_0x15dabe['query'][_0xb049('0x3c')]){_0x31e3cc[_0xb049('0x3a')]=_[_0xb049('0x3d')](_0x31e3cc['where'],{'$or':_[_0xb049('0x3e')](_0x3db1cf,function(_0x15d3a2){if(_0x15d3a2[_0xb049('0x3f')]!==_0xb049('0x40')){var _0x5a1f3f={};_0x5a1f3f[_0x15d3a2[_0xb049('0x29')]]={'$like':'%'+_0x15dabe[_0xb049('0x30')][_0xb049('0x3c')]+'%'};return _0x5a1f3f;}})});}_0x31e3cc=_[_0xb049('0x3d')]({},_0x31e3cc,_0x15dabe[_0xb049('0x41')]);var _0x767b49={'where':_0x31e3cc[_0xb049('0x3a')]};return db[_0xb049('0x2c')][_0xb049('0x1e')](_0x767b49)[_0xb049('0x23')](function(_0xd05657){_0x2222dd[_0xb049('0x1e')]=_0xd05657;if(_0x15dabe['query'][_0xb049('0x42')]){_0x31e3cc[_0xb049('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xb049('0x44')](_0x31e3cc);})[_0xb049('0x23')](function(_0x365e9e){_0x2222dd[_0xb049('0x45')]=_0x365e9e;return _0x2222dd;})['then'](respondWithFilteredResult(_0x2c84be,_0x31e3cc))[_0xb049('0x46')](handleError(_0x2c84be,null));};exports['show']=function(_0x4392db,_0x343c62){var _0x12970f={'raw':![],'where':{'id':_0x4392db[_0xb049('0x47')]['id']}},_0xf7bc6b={};_0xf7bc6b['model']=_[_0xb049('0x48')](db[_0xb049('0x2c')][_0xb049('0x2d')]);_0xf7bc6b[_0xb049('0x30')]=_[_0xb049('0x48')](_0x4392db[_0xb049('0x30')]);_0xf7bc6b[_0xb049('0x31')]=_[_0xb049('0x32')](_0xf7bc6b[_0xb049('0x2f')],_0xf7bc6b[_0xb049('0x30')]);_0x12970f[_0xb049('0x33')]=_[_0xb049('0x32')](_0xf7bc6b['model'],qs[_0xb049('0x34')](_0x4392db[_0xb049('0x30')][_0xb049('0x34')]));_0x12970f[_0xb049('0x33')]=_0x12970f[_0xb049('0x33')][_0xb049('0x35')]?_0x12970f[_0xb049('0x33')]:_0xf7bc6b['model'];if(_0x4392db[_0xb049('0x30')][_0xb049('0x42')]){_0x12970f[_0xb049('0x43')]=[{'all':!![]}];}_0x12970f=_[_0xb049('0x3d')]({},_0x12970f,_0x4392db[_0xb049('0x41')]);return db[_0xb049('0x2c')][_0xb049('0x49')](_0x12970f)[_0xb049('0x23')](handleEntityNotFound(_0x343c62,null))[_0xb049('0x23')](respondWithResult(_0x343c62,null))[_0xb049('0x46')](handleError(_0x343c62,null));};exports[_0xb049('0x4a')]=function(_0x564c32,_0x616fa0){return db[_0xb049('0x2c')][_0xb049('0x4a')](_0x564c32[_0xb049('0x4b')],{})['then'](function(_0x25be55){var _0x2f62b1=_0x564c32['user'][_0xb049('0x25')]({'plain':!![]});if(!_0x2f62b1)throw new Error(_0xb049('0x4c'));if(_0x2f62b1['role']===_0xb049('0x4d')){var _0x347b22=_0x25be55[_0xb049('0x25')]({'plain':!![]});var _0x286503=_0xb049('0x4e');return db[_0xb049('0x4f')][_0xb049('0x49')]({'where':{'name':_0x286503,'userProfileId':_0x2f62b1[_0xb049('0x50')]},'raw':!![]})[_0xb049('0x23')](function(_0x1b645d){if(_0x1b645d&&_0x1b645d[_0xb049('0x51')]===0x0){return db[_0xb049('0x27')][_0xb049('0x4a')]({'name':_0x347b22[_0xb049('0x29')],'resourceId':_0x347b22['id'],'type':_0xb049('0x26'),'sectionId':_0x1b645d['id']},{})[_0xb049('0x23')](function(){return _0x25be55;});}else{return _0x25be55;}})['catch'](function(_0x296f9b){logger[_0xb049('0x28')](_0xb049('0x52'),_0x296f9b);throw _0x296f9b;});}return _0x25be55;})['then'](respondWithResult(_0x616fa0,0xc9))[_0xb049('0x46')](handleError(_0x616fa0,null));};exports[_0xb049('0x22')]=function(_0x3d873f,_0x55f569){if(_0x3d873f[_0xb049('0x4b')]['id']){delete _0x3d873f[_0xb049('0x4b')]['id'];}return db[_0xb049('0x2c')][_0xb049('0x49')]({'where':{'id':_0x3d873f[_0xb049('0x47')]['id']}})[_0xb049('0x23')](handleEntityNotFound(_0x55f569,null))['then'](saveUpdates(_0x3d873f[_0xb049('0x4b')],null))['then'](respondWithResult(_0x55f569,null))[_0xb049('0x46')](handleError(_0x55f569,null));};exports['destroy']=function(_0x59e27a,_0x4060d1){return db[_0xb049('0x2c')][_0xb049('0x49')]({'where':{'id':_0x59e27a[_0xb049('0x47')]['id']}})[_0xb049('0x23')](handleEntityNotFound(_0x4060d1,null))[_0xb049('0x23')](removeEntity(_0x4060d1,null))[_0xb049('0x46')](handleError(_0x4060d1,null));};exports[_0xb049('0x53')]=function(_0x4a6e40,_0x43d44c){var _0x556f0d=0xa;var _0x4b7ac0=['join',_0xb049('0x54'),_0xb049('0x55'),'cross_join'];var _0x57bc4e={'SUM':_0xb049('0x56'),'COUNT':_0xb049('0x57'),'COUNT DISTINCT':_0xb049('0x58'),'MAX':_0xb049('0x59'),'MIN':_0xb049('0x5a'),'AVG':_0xb049('0x5b'),'GROUP_CONCAT':_0xb049('0x5c'),'GROUP_CONCAT ASC':_0xb049('0x5d'),'GROUP_CONCAT DESC':_0xb049('0x5e')};var _0x59425d={'SEC_TO_TIME':_0xb049('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb049('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb049('0x61')};var _0x42c802=function(_0x34b7ce){return!_['includes']([_0xb049('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x34b7ce);};var _0x47d0c0=function(_0x706d93){if(!_0x706d93||!_0x706d93[_0xb049('0x63')]['length']){return'';}for(var _0x33ad8d='(',_0x3fe11e=0x0;_0x3fe11e<_0x706d93[_0xb049('0x63')][_0xb049('0x35')];_0x3fe11e+=0x1){_0x3fe11e>0x0&&(_0x33ad8d+='\x20'+_0x706d93['operator']+'\x20');_0x33ad8d+=_0x706d93['rules'][_0x3fe11e][_0xb049('0x64')]?_0x47d0c0(_0x706d93[_0xb049('0x63')][_0x3fe11e][_0xb049('0x64')]):_0x706d93['rules'][_0x3fe11e]['field']+'\x20'+_0x706d93['rules'][_0x3fe11e][_0xb049('0x65')]+(_0x42c802(_0x706d93[_0xb049('0x63')][_0x3fe11e][_0xb049('0x65')])?'\x20'+_0x706d93[_0xb049('0x63')][_0x3fe11e]['value']:'');}return _0x33ad8d+')';};var _0x11874f={'where':{'id':_0x4a6e40[_0xb049('0x47')]['id']}},_0x1be827,_0x3ed879,_0x26e8d5,_0x52ba4a,_0x32c2e1;_0x11874f=_[_0xb049('0x3d')]({},_0x11874f,_0x4a6e40[_0xb049('0x41')]);return db[_0xb049('0x2c')][_0xb049('0x49')](_0x11874f)['then'](function(_0x3638d0){if(_0x3638d0){_0x1be827=_0x3638d0;return _0x3638d0[_0xb049('0x66')]();}return null;})[_0xb049('0x23')](function(_0x255e2e){if(_0x255e2e){if(!_0x255e2e[_0xb049('0x35')]){throw new db[(_0xb049('0x67'))][(_0xb049('0x68'))](_0xb049('0x69'),0x193);}_0x3ed879=_0x255e2e;return db[_0xb049('0x6a')][_0xb049('0x44')]({'raw':!![]});}return null;})['then'](function(_0x5498c3){if(_0x5498c3){_0x26e8d5=_['keyBy'](_0x5498c3,'id');var _0x3d3930;var _0x2499ec=squel[_0xb049('0x6b')]();_0x2499ec[_0xb049('0x6c')](_0x1be827['table']);for(var _0x562800=0x0;_0x562800<_0x3ed879['length'];_0x562800+=0x1){_0x3d3930=_0x3ed879[_0x562800][_0xb049('0x6d')]?_0x26e8d5[_0x3ed879[_0x562800][_0xb049('0x6d')]][_0xb049('0x6e')]:_0x3ed879[_0x562800]['field'];_0x3d3930=_0x3ed879[_0x562800][_0xb049('0x6f')]?_[_0xb049('0x70')](_0x57bc4e[_0x3ed879[_0x562800]['function']],'%s',_0x3d3930):_0x3d3930;_0x3d3930=_0x3ed879[_0x562800][_0xb049('0x71')]?_['replace'](_0x59425d[_0x3ed879[_0x562800][_0xb049('0x71')]],'%s',_0x3d3930):_0x3d3930;if(_0x3ed879[_0x562800][_0xb049('0x72')]){_0x2499ec['group'](_0x3d3930);}_0x3ed879[_0x562800][_0xb049('0x73')]&&_0x2499ec[_0xb049('0x38')](_0x3d3930,_0x3ed879[_0x562800][_0xb049('0x73')]===_0xb049('0x74')?![]:!![]);_0x2499ec[_0xb049('0x75')](_0x3d3930,_0x3ed879[_0x562800][_0xb049('0x76')]||_0x3d3930);}if(_0x1be827['joins']){_0x1be827[_0xb049('0x77')]=JSON[_0xb049('0x78')](_0x1be827[_0xb049('0x77')]);for(var _0x12c67e=0x0;_0x12c67e<_0x1be827['joins'][_0xb049('0x35')];_0x12c67e+=0x1){if(_0x1be827['joins'][_0x12c67e][_0xb049('0x3f')]&&_[_0xb049('0x79')](_0x4b7ac0,_0x1be827['joins'][_0x12c67e][_0xb049('0x3f')])&&_0x1be827['joins'][_0x12c67e][_0xb049('0x7a')]&&_0x1be827['joins'][_0x12c67e]['foreignTable']&&_0x1be827[_0xb049('0x77')][_0x12c67e][_0xb049('0x7b')]){_0x2499ec[_0x1be827[_0xb049('0x77')][_0x12c67e]['type']](_0x1be827[_0xb049('0x77')][_0x12c67e][_0xb049('0x7c')],null,util[_0xb049('0x71')](_0xb049('0x7d'),_0x1be827[_0xb049('0x7e')],_0x1be827[_0xb049('0x77')][_0x12c67e][_0xb049('0x7a')],_0x1be827[_0xb049('0x77')][_0x12c67e][_0xb049('0x7c')],_0x1be827[_0xb049('0x77')][_0x12c67e][_0xb049('0x7b')]));}}}if(_0x1be827['conditions']){_0x1be827['conditions']=JSON['parse'](_0x1be827['conditions']);_0x2499ec['where'](_0x47d0c0(_0x1be827[_0xb049('0x7f')]['group']));}_0x32c2e1=_0x2499ec[_0xb049('0x80')]();_0x2499ec['limit'](_0x556f0d);_0x2499ec[_0xb049('0x1b')](0x0);logger[_0xb049('0x81')]('Limited\x20Query:',_0x2499ec[_0xb049('0x82')]());return dbH[_0xb049('0x83')]['query'](_0x2499ec[_0xb049('0x82')](),{'type':dbH['sequelize'][_0xb049('0x84')][_0xb049('0x85')]});}})['then'](respondWithResult(_0x43d44c,null))[_0xb049('0x46')](handleError(_0x43d44c,null));};function runReport(_0x2c178f,_0x304fde,_0x657f58){var _0x25d139=_0x304fde[_0xb049('0x29')];var _0x253313=0xa;var _0x572c2b=[_0xb049('0x86'),_0xb049('0x54'),_0xb049('0x55'),_0xb049('0x87')];var _0x68d51d={'SUM':_0xb049('0x56'),'COUNT':_0xb049('0x57'),'COUNT DISTINCT':_0xb049('0x58'),'MAX':_0xb049('0x59'),'MIN':_0xb049('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb049('0x5c'),'GROUP_CONCAT ASC':_0xb049('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1dc95b={'SEC_TO_TIME':_0xb049('0x5f'),'DATE':_0xb049('0x88'),'HOUR':_0xb049('0x60'),'ROUND':_0xb049('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4423df=function(_0x3ae380){return!_[_0xb049('0x79')]([_0xb049('0x62'),_0xb049('0x8a'),_0xb049('0x8b'),'IS\x20NOT\x20EMPTY'],_0x3ae380);};var _0x468a47=function(_0x13eec7){if(!_0x13eec7||!_0x13eec7[_0xb049('0x63')][_0xb049('0x35')]){return'';}for(var _0x307162='(',_0x122e9f=0x0;_0x122e9f<_0x13eec7['rules'][_0xb049('0x35')];_0x122e9f+=0x1){_0x122e9f>0x0&&(_0x307162+='\x20'+_0x13eec7[_0xb049('0x8c')]+'\x20');_0x307162+=_0x13eec7[_0xb049('0x63')][_0x122e9f][_0xb049('0x64')]?_0x468a47(_0x13eec7['rules'][_0x122e9f][_0xb049('0x64')]):_0x13eec7[_0xb049('0x63')][_0x122e9f][_0xb049('0x75')]+'\x20'+_0x13eec7[_0xb049('0x63')][_0x122e9f]['condition']+(_0x4423df(_0x13eec7[_0xb049('0x63')][_0x122e9f][_0xb049('0x65')])?'\x20'+_0x13eec7[_0xb049('0x63')][_0x122e9f][_0xb049('0x8d')]:'');}return _0x307162+')';};var _0x844c65={'where':{'id':_0x2c178f['id']}},_0x1eb131,_0x1f6825,_0x34fdc9,_0x2e2cbd,_0x29fcb8;_0x844c65=_[_0xb049('0x3d')]({},_0x844c65,_0x657f58);return db[_0xb049('0x2c')][_0xb049('0x49')](_0x844c65)[_0xb049('0x23')](function(_0x540ffa){if(_0x540ffa){_0x1eb131=_0x540ffa;return _0x540ffa[_0xb049('0x66')]();}return null;})[_0xb049('0x23')](function(_0x4c8189){if(_0x4c8189){if(!_0x4c8189['length']){throw new db[(_0xb049('0x67'))][(_0xb049('0x68'))](_0xb049('0x69'),0x193);}_0x1f6825=_0x4c8189;return db[_0xb049('0x6a')][_0xb049('0x44')]({'raw':!![]});}return null;})[_0xb049('0x23')](function(_0x35b392){if(_0x35b392){_0x34fdc9=_['keyBy'](_0x35b392,'id');var _0x17c167;var _0x33a71f=squel[_0xb049('0x6b')]();_0x33a71f['from'](_0x1eb131[_0xb049('0x7e')]);for(var _0x1d2694=0x0;_0x1d2694<_0x1f6825[_0xb049('0x35')];_0x1d2694+=0x1){_0x17c167=_0x1f6825[_0x1d2694][_0xb049('0x6d')]?_0x34fdc9[_0x1f6825[_0x1d2694][_0xb049('0x6d')]][_0xb049('0x6e')]:_0x1f6825[_0x1d2694][_0xb049('0x75')];_0x17c167=_0x1f6825[_0x1d2694][_0xb049('0x6f')]?_[_0xb049('0x70')](_0x68d51d[_0x1f6825[_0x1d2694]['function']],'%s',_0x17c167):_0x17c167;_0x17c167=_0x1f6825[_0x1d2694][_0xb049('0x71')]?_['replace'](_0x1dc95b[_0x1f6825[_0x1d2694]['format']],'%s',_0x17c167):_0x17c167;if(_0x1f6825[_0x1d2694][_0xb049('0x72')]){_0x33a71f[_0xb049('0x64')](_0x17c167);}_0x1f6825[_0x1d2694][_0xb049('0x73')]&&_0x33a71f[_0xb049('0x38')](_0x17c167,_0x1f6825[_0x1d2694][_0xb049('0x73')]===_0xb049('0x74')?![]:!![]);_0x33a71f[_0xb049('0x75')](_0x17c167,_0x1f6825[_0x1d2694][_0xb049('0x76')]||_0x17c167);}if(_0x1eb131[_0xb049('0x77')]){_0x1eb131['joins']=JSON[_0xb049('0x78')](_0x1eb131[_0xb049('0x77')]);for(var _0x31a753=0x0;_0x31a753<_0x1eb131[_0xb049('0x77')][_0xb049('0x35')];_0x31a753+=0x1){if(_0x1eb131['joins'][_0x31a753][_0xb049('0x3f')]&&_[_0xb049('0x79')](_0x572c2b,_0x1eb131[_0xb049('0x77')][_0x31a753]['type'])&&_0x1eb131[_0xb049('0x77')][_0x31a753][_0xb049('0x7a')]&&_0x1eb131[_0xb049('0x77')][_0x31a753][_0xb049('0x7c')]&&_0x1eb131['joins'][_0x31a753][_0xb049('0x7b')]){_0x33a71f[_0x1eb131[_0xb049('0x77')][_0x31a753][_0xb049('0x3f')]](_0x1eb131[_0xb049('0x77')][_0x31a753][_0xb049('0x7c')],null,util[_0xb049('0x71')]('%s.%s\x20=\x20%s.%s',_0x1eb131[_0xb049('0x7e')],_0x1eb131[_0xb049('0x77')][_0x31a753][_0xb049('0x7a')],_0x1eb131[_0xb049('0x77')][_0x31a753][_0xb049('0x7c')],_0x1eb131[_0xb049('0x77')][_0x31a753]['foreignKey']));}}}if(_0x1eb131[_0xb049('0x7f')]){_0x1eb131[_0xb049('0x7f')]=JSON[_0xb049('0x78')](_0x1eb131['conditions']);_0x33a71f[_0xb049('0x3a')](_0x468a47(_0x1eb131[_0xb049('0x7f')][_0xb049('0x64')]));}_0x29fcb8=_0x33a71f[_0xb049('0x80')]();_0x33a71f[_0xb049('0x1d')](_0x253313);_0x33a71f[_0xb049('0x1b')](0x0);return;}})[_0xb049('0x23')](function(){if(_0x304fde[_0xb049('0x8e')]==='web'){return null;}var _0xb07b78=_[_0xb049('0x3d')](_0x304fde,{'name':_0x304fde[_0xb049('0x8f')]||_0x304fde['name']||_0x1eb131[_0xb049('0x29')],'basename':_0x25d139,'savename':util[_0xb049('0x71')]('%s-%s.%s',_0x304fde[_0xb049('0x29')]||_0x1eb131['name'],require('randomstring')[_0xb049('0x90')](0x4),_0x304fde[_0xb049('0x8e')]||_0xb049('0x91')),'reportId':_0x1eb131['id'],'reportType':_0xb049('0x92')});return db[_0xb049('0x93')][_0xb049('0x4a')](_0xb07b78,{'raw':!![]});})[_0xb049('0x23')](function(_0x8c3c75){if(_0x1eb131['table']==='cdr'){_0x29fcb8[_0xb049('0x3a')](_0x1eb131[_0xb049('0x7e')]+_0xb049('0x94'),_0x304fde[_0xb049('0x95')],_0x304fde[_0xb049('0x96')]);}else{_0x29fcb8[_0xb049('0x3a')](_0x1eb131[_0xb049('0x7e')]+_0xb049('0x97'),_0x304fde['startDate'],_0x304fde['endDate']);}if(_0x8c3c75){logger['info'](_0xb049('0x98'),_0x29fcb8[_0xb049('0x82')]());require('child_process')[_0xb049('0x99')](path[_0xb049('0x86')](__dirname,_0xb049('0x9a'),_0x8c3c75[_0xb049('0x8e')]),[_0x8c3c75['id'],_0x29fcb8['toString'](),path[_0xb049('0x86')](__dirname,_0xb049('0x9b'),_0x8c3c75[_0xb049('0x9c')]),_0x25d139]);return _0x8c3c75;}else{var _0x3a7a14=squel[_0xb049('0x6b')]();_0x3a7a14[_0xb049('0x6c')]('('+_0x29fcb8[_0xb049('0x82')]()+')',_0xb049('0x9d'));_0x3a7a14[_0xb049('0x75')]('COUNT(*)',_0xb049('0x1e'));_0x29fcb8[_0xb049('0x1d')](_0x304fde[_0xb049('0x1d')]||_0x253313);_0x29fcb8[_0xb049('0x1b')](_0x304fde[_0xb049('0x1b')]||0x0);return dbH['sequelize'][_0xb049('0x30')](_0x3a7a14[_0xb049('0x82')](),{'type':dbH[_0xb049('0x83')]['QueryTypes']['SELECT']})[_0xb049('0x23')](function(_0x5594ac){if(!_0x5594ac[_0xb049('0x35')]){_0x2e2cbd=0x0;}else{_0x2e2cbd=_0x5594ac[0x0]['count']||0x0;}return dbH[_0xb049('0x83')]['query'](_0x29fcb8[_0xb049('0x82')](),{'type':dbH[_0xb049('0x83')][_0xb049('0x84')][_0xb049('0x85')]});})['then'](function(_0x2eec70){return{'rows':_0x2eec70||[],'count':_0x2e2cbd};});}});}exports[_0xb049('0x9e')]=function(_0x17d5b2,_0x3f5c7d){return runReport(_0x17d5b2[_0xb049('0x47')],_0x17d5b2[_0xb049('0x30')],_0x17d5b2[_0xb049('0x41')])[_0xb049('0x23')](respondWithResult(_0x3f5c7d,null))[_0xb049('0x46')](handleError(_0x3f5c7d,null));};exports[_0xb049('0x9f')]=runReport;exports[_0xb049('0x30')]=function(_0x4474c9,_0x4b3a6c){var _0x49c059=0xa;var _0x13255b=[_0xb049('0x86'),'left_join','right_join',_0xb049('0x87')];var _0x333e5a={'SUM':_0xb049('0x56'),'COUNT':_0xb049('0x57'),'COUNT DISTINCT':_0xb049('0x58'),'MAX':'MAX(%s)','MIN':_0xb049('0x5a'),'AVG':_0xb049('0x5b'),'GROUP_CONCAT':_0xb049('0x5c'),'GROUP_CONCAT ASC':_0xb049('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x41175c={'SEC_TO_TIME':_0xb049('0x5f'),'DATE':_0xb049('0x88'),'HOUR':_0xb049('0x60'),'ROUND':_0xb049('0x89'),'UNIX_TIMESTAMP':_0xb049('0x61')};var _0x4d8fc9=function(_0x2d8884){return!_[_0xb049('0x79')]([_0xb049('0x62'),_0xb049('0x8a'),_0xb049('0x8b'),_0xb049('0xa0')],_0x2d8884);};var _0x2534a9=function(_0x34a3ce){if(!_0x34a3ce||!_0x34a3ce[_0xb049('0x63')][_0xb049('0x35')]){return'';}for(var _0x4dc5d4='(',_0x380195=0x0;_0x380195<_0x34a3ce[_0xb049('0x63')][_0xb049('0x35')];_0x380195+=0x1){_0x380195>0x0&&(_0x4dc5d4+='\x20'+_0x34a3ce[_0xb049('0x8c')]+'\x20');_0x4dc5d4+=_0x34a3ce['rules'][_0x380195][_0xb049('0x64')]?_0x2534a9(_0x34a3ce[_0xb049('0x63')][_0x380195][_0xb049('0x64')]):_0x34a3ce[_0xb049('0x63')][_0x380195]['field']+'\x20'+_0x34a3ce[_0xb049('0x63')][_0x380195][_0xb049('0x65')]+(_0x4d8fc9(_0x34a3ce['rules'][_0x380195]['condition'])?'\x20'+_0x34a3ce[_0xb049('0x63')][_0x380195][_0xb049('0x8d')]:'');}return _0x4dc5d4+')';};var _0xe6f86c={'where':{'id':_0x4474c9[_0xb049('0x47')]['id']}},_0x3dbf34,_0x8db71f,_0x3b9959,_0x33c833,_0x1c0ded;_0xe6f86c=_[_0xb049('0x3d')]({},_0xe6f86c,_0x4474c9['options']);return db[_0xb049('0x2c')][_0xb049('0x49')](_0xe6f86c)[_0xb049('0x23')](function(_0x3bc5a6){if(_0x3bc5a6){_0x3dbf34=_0x3bc5a6;return _0x3bc5a6['getFields']();}return null;})[_0xb049('0x23')](function(_0x24b2ac){if(_0x24b2ac){if(!_0x24b2ac['length']){throw new db[(_0xb049('0x67'))][(_0xb049('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x8db71f=_0x24b2ac;return db['AnalyticMetric'][_0xb049('0x44')]({'raw':!![]});}return null;})['then'](function(_0x3c1296){if(_0x3c1296){_0x3b9959=_[_0xb049('0xa1')](_0x3c1296,'id');var _0xf4bc45;var _0x25a6e7=squel[_0xb049('0x6b')]();_0x25a6e7[_0xb049('0x6c')](_0x3dbf34['table']);for(var _0x72dc22=0x0;_0x72dc22<_0x8db71f[_0xb049('0x35')];_0x72dc22+=0x1){_0xf4bc45=_0x8db71f[_0x72dc22][_0xb049('0x6d')]?_0x3b9959[_0x8db71f[_0x72dc22][_0xb049('0x6d')]][_0xb049('0x6e')]:_0x8db71f[_0x72dc22]['field'];_0xf4bc45=_0x8db71f[_0x72dc22][_0xb049('0x6f')]?_['replace'](_0x333e5a[_0x8db71f[_0x72dc22][_0xb049('0x6f')]],'%s',_0xf4bc45):_0xf4bc45;_0xf4bc45=_0x8db71f[_0x72dc22][_0xb049('0x71')]?_['replace'](_0x41175c[_0x8db71f[_0x72dc22]['format']],'%s',_0xf4bc45):_0xf4bc45;if(_0x8db71f[_0x72dc22]['groupBy']){_0x25a6e7['group'](_0xf4bc45);}_0x8db71f[_0x72dc22][_0xb049('0x73')]&&_0x25a6e7[_0xb049('0x38')](_0xf4bc45,_0x8db71f[_0x72dc22][_0xb049('0x73')]==='DESC'?![]:!![]);_0x25a6e7['field'](_0xf4bc45,_0x8db71f[_0x72dc22][_0xb049('0x76')]||_0xf4bc45);}if(_0x3dbf34[_0xb049('0x77')]){_0x3dbf34['joins']=JSON[_0xb049('0x78')](_0x3dbf34[_0xb049('0x77')]);for(var _0x4a7d1d=0x0;_0x4a7d1d<_0x3dbf34[_0xb049('0x77')]['length'];_0x4a7d1d+=0x1){if(_0x3dbf34['joins'][_0x4a7d1d][_0xb049('0x3f')]&&_[_0xb049('0x79')](_0x13255b,_0x3dbf34[_0xb049('0x77')][_0x4a7d1d][_0xb049('0x3f')])&&_0x3dbf34[_0xb049('0x77')][_0x4a7d1d][_0xb049('0x7a')]&&_0x3dbf34['joins'][_0x4a7d1d][_0xb049('0x7c')]&&_0x3dbf34[_0xb049('0x77')][_0x4a7d1d][_0xb049('0x7b')]){_0x25a6e7[_0x3dbf34[_0xb049('0x77')][_0x4a7d1d][_0xb049('0x3f')]](_0x3dbf34[_0xb049('0x77')][_0x4a7d1d][_0xb049('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3dbf34[_0xb049('0x7e')],_0x3dbf34[_0xb049('0x77')][_0x4a7d1d][_0xb049('0x7a')],_0x3dbf34['joins'][_0x4a7d1d]['foreignTable'],_0x3dbf34[_0xb049('0x77')][_0x4a7d1d][_0xb049('0x7b')]));}}}if(_0x3dbf34[_0xb049('0x7f')]){_0x3dbf34['conditions']=JSON[_0xb049('0x78')](_0x3dbf34['conditions']);_0x25a6e7[_0xb049('0x3a')](_0x2534a9(_0x3dbf34[_0xb049('0x7f')][_0xb049('0x64')]));}_0x1c0ded=_0x25a6e7[_0xb049('0x80')]();_0x25a6e7['limit'](_0x49c059);_0x25a6e7[_0xb049('0x1b')](0x0);logger[_0xb049('0x81')](_0xb049('0xa2'),_0x25a6e7[_0xb049('0x82')]());return dbH[_0xb049('0x83')]['query'](_0x25a6e7[_0xb049('0x82')](),{'type':dbH[_0xb049('0x83')][_0xb049('0x84')][_0xb049('0x85')]});}})[_0xb049('0x23')](function(){return{'sql':_0x1c0ded['toString']()};})['then'](respondWithResult(_0x4b3a6c,null))['catch'](handleError(_0x4b3a6c,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index d9e6cf0..f105366 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 _0x8289=['moment','bluebird','request-promise','path','rimraf','../../config/environment','AnalyticCustomReport','lodash','../../config/logger'];(function(_0x2b3332,_0x5d07c5){var _0x4ba944=function(_0x41467a){while(--_0x41467a){_0x2b3332['push'](_0x2b3332['shift']());}};_0x4ba944(++_0x5d07c5);}(_0x8289,0x1c9));var _0x9828=function(_0xafde54,_0x3388aa){_0xafde54=_0xafde54-0x0;var _0x4153de=_0x8289[_0xafde54];return _0x4153de;};'use strict';var _=require(_0x9828('0x0'));var util=require('util');var logger=require(_0x9828('0x1'))('api');var moment=require(_0x9828('0x2'));var BPromise=require(_0x9828('0x3'));var rp=require(_0x9828('0x4'));var fs=require('fs');var path=require(_0x9828('0x5'));var rimraf=require(_0x9828('0x6'));var config=require(_0x9828('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x4b4eec,_0x192e3f){return _0x4b4eec['define'](_0x9828('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b83=['lodash','util','../../config/logger','api','moment','bluebird','path','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x4efb22,_0x355f1e){var _0x4962f6=function(_0x501d1a){while(--_0x501d1a){_0x4efb22['push'](_0x4efb22['shift']());}};_0x4962f6(++_0x355f1e);}(_0x9b83,0xe7));var _0x39b8=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x9b83[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var logger=require(_0x39b8('0x2'))(_0x39b8('0x3'));var moment=require(_0x39b8('0x4'));var BPromise=require(_0x39b8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39b8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x39b8('0x7'));module[_0x39b8('0x8')]=function(_0x19b654,_0x3df839){return _0x19b654[_0x39b8('0x9')](_0x39b8('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index d9e1944..1149d6e 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 _0x324e=['jayson/promise','client','http','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0x324e,0x19d));var _0xe324=function(_0x27db58,_0x56f303){_0x27db58=_0x27db58-0x0;var _0x499f4a=_0x324e[_0x27db58];return _0x499f4a;};'use strict';var _=require('lodash');var util=require(_0xe324('0x0'));var moment=require(_0xe324('0x1'));var BPromise=require(_0xe324('0x2'));var rs=require(_0xe324('0x3'));var fs=require('fs');var Redis=require(_0xe324('0x4'));var db=require(_0xe324('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe324('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe324('0x7'));var client=jayson[_0xe324('0x8')][_0xe324('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x393b7a,_0x270e96,_0x2cf9ff){return new BPromise(function(_0x173b96,_0x57c133){return client[_0xe324('0xa')](_0x393b7a,_0x2cf9ff)[_0xe324('0xb')](function(_0x3c5090){logger[_0xe324('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x270e96,_0xe324('0xd'));logger['debug'](_0xe324('0xe'),_0x270e96,_0xe324('0xd'),JSON['stringify'](_0x3c5090));if(_0x3c5090[_0xe324('0xf')]){if(_0x3c5090[_0xe324('0xf')][_0xe324('0x10')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x270e96,_0x3c5090[_0xe324('0xf')][_0xe324('0x11')]);return _0x57c133(_0x3c5090['error'][_0xe324('0x11')]);}logger[_0xe324('0xf')](_0xe324('0x12'),_0x270e96,_0x3c5090['error']['message']);return _0x173b96(_0x3c5090[_0xe324('0xf')][_0xe324('0x11')]);}else{logger['info'](_0xe324('0x12'),_0x270e96,_0xe324('0xd'));_0x173b96(_0x3c5090['result'][_0xe324('0x11')]);}})[_0xe324('0x13')](function(_0x1d7ead){logger['error'](_0xe324('0x12'),_0x270e96,_0x1d7ead);_0x57c133(_0x1d7ead);});});} \ No newline at end of file +var _0xab21=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','lodash','util'];(function(_0x446817,_0xc21bb1){var _0x14f391=function(_0x1bb931){while(--_0x1bb931){_0x446817['push'](_0x446817['shift']());}};_0x14f391(++_0xc21bb1);}(_0xab21,0xf0));var _0x1ab2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xab21[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x1ab2('0x0'));var util=require(_0x1ab2('0x1'));var moment=require('moment');var BPromise=require(_0x1ab2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ab2('0x3'));var db=require(_0x1ab2('0x4'))['db'];var utils=require(_0x1ab2('0x5'));var logger=require(_0x1ab2('0x6'))(_0x1ab2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ab2('0x8')][_0x1ab2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5aa1f5,_0x28a014,_0x3a2335){return new BPromise(function(_0xeb5000,_0x33ad55){return client[_0x1ab2('0xa')](_0x5aa1f5,_0x3a2335)[_0x1ab2('0xb')](function(_0x5b069c){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x28a014,_0x1ab2('0xc'));logger[_0x1ab2('0xd')](_0x1ab2('0xe'),_0x28a014,'request\x20sent',JSON[_0x1ab2('0xf')](_0x5b069c));if(_0x5b069c['error']){if(_0x5b069c[_0x1ab2('0x10')][_0x1ab2('0x11')]===0x1f4){logger[_0x1ab2('0x10')](_0x1ab2('0x12'),_0x28a014,_0x5b069c[_0x1ab2('0x10')][_0x1ab2('0x13')]);return _0x33ad55(_0x5b069c['error'][_0x1ab2('0x13')]);}logger[_0x1ab2('0x10')](_0x1ab2('0x12'),_0x28a014,_0x5b069c[_0x1ab2('0x10')][_0x1ab2('0x13')]);return _0xeb5000(_0x5b069c[_0x1ab2('0x10')]['message']);}else{logger[_0x1ab2('0x14')](_0x1ab2('0x12'),_0x28a014,_0x1ab2('0xc'));_0xeb5000(_0x5b069c[_0x1ab2('0x15')]['message']);}})['catch'](function(_0x1e7d98){logger[_0x1ab2('0x10')](_0x1ab2('0x12'),_0x28a014,_0x1e7d98);_0x33ad55(_0x1e7d98);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 3c7acb4..1f8ac66 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 _0xc386=['multer','util','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','get','index','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc386,0x1b8));var _0x6c38=function(_0x47c5ff,_0x25c22a){_0x47c5ff=_0x47c5ff-0x0;var _0x4b5692=_0xc386[_0x47c5ff];return _0x4b5692;};'use strict';var multer=require(_0x6c38('0x0'));var util=require(_0x6c38('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c38('0x2')]();var fs_extra=require(_0x6c38('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c38('0x4'));var controller=require(_0x6c38('0x5'));router[_0x6c38('0x6')]('/',auth['isAuthenticated'](),controller[_0x6c38('0x7')]);router['get']('/:id',auth[_0x6c38('0x8')](),controller['show']);router[_0x6c38('0x6')](_0x6c38('0x9'),auth[_0x6c38('0x8')](),controller[_0x6c38('0xa')]);router['get'](_0x6c38('0xb'),auth[_0x6c38('0x8')](),controller[_0x6c38('0xc')]);router[_0x6c38('0x6')](_0x6c38('0xd'),auth['isAuthenticated'](),controller[_0x6c38('0xe')]);router[_0x6c38('0xf')]('/',auth[_0x6c38('0x8')](),controller[_0x6c38('0x10')]);router[_0x6c38('0x11')](_0x6c38('0x12'),auth[_0x6c38('0x8')](),controller['update']);router[_0x6c38('0x13')]('/:id',auth[_0x6c38('0x8')](),controller[_0x6c38('0x14')]);module[_0x6c38('0x15')]=router; \ No newline at end of file +var _0xcc58=['isAuthenticated','preview','run','/:id/query','query','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','index','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc58,0x117));var _0x8cc5=function(_0x5a4f2a,_0x4b9ab3){_0x5a4f2a=_0x5a4f2a-0x0;var _0x3c5fd9=_0xcc58[_0x5a4f2a];return _0x3c5fd9;};'use strict';var multer=require(_0x8cc5('0x0'));var util=require(_0x8cc5('0x1'));var path=require(_0x8cc5('0x2'));var timeout=require(_0x8cc5('0x3'));var express=require(_0x8cc5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cc5('0x5'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8cc5('0x6')]);router[_0x8cc5('0x7')](_0x8cc5('0x8'),auth[_0x8cc5('0x9')](),controller['show']);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x8cc5('0xa')]);router[_0x8cc5('0x7')]('/:id/run',auth[_0x8cc5('0x9')](),controller[_0x8cc5('0xb')]);router[_0x8cc5('0x7')](_0x8cc5('0xc'),auth['isAuthenticated'](),controller[_0x8cc5('0xd')]);router['post']('/',auth[_0x8cc5('0x9')](),controller['create']);router[_0x8cc5('0xe')](_0x8cc5('0x8'),auth[_0x8cc5('0x9')](),controller[_0x8cc5('0xf')]);router[_0x8cc5('0x10')](_0x8cc5('0x8'),auth[_0x8cc5('0x9')](),controller[_0x8cc5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c18528a..c8af49d 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 _0x8958=['TEXT','exports'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x8958,0x93));var _0x8895=function(_0x2b4b5d,_0x4a6eb0){_0x2b4b5d=_0x2b4b5d-0x0;var _0x51432f=_0x8958[_0x2b4b5d];return _0x51432f;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x5ba46a,_0x582fe0){var _0x5cbf4f=function(_0x22349b){while(--_0x22349b){_0x5ba46a['push'](_0x5ba46a['shift']());}};_0x5cbf4f(++_0x582fe0);}(_0x5075,0x73));var _0x5507=function(_0x31b950,_0x48a4e9){_0x31b950=_0x31b950-0x0;var _0x415d87=_0x5075[_0x31b950];return _0x415d87;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index f4d3a94..5f5f4dd 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 _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x8edc1f,_0x1e6845){var _0x521b9a=function(_0x55f6a9){while(--_0x55f6a9){_0x8edc1f['push'](_0x8edc1f['shift']());}};_0x521b9a(++_0x1e6845);}(_0x1cb9,0x14e));var _0x91cb=function(_0x54ae54,_0x10bf78){_0x54ae54=_0x54ae54-0x0;var _0x54a3d6=_0x1cb9[_0x54ae54];return _0x54a3d6;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));}; \ No newline at end of file +var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x18d6e4,_0x2f192a){var _0x19deb4=function(_0x423811){while(--_0x423811){_0x18d6e4['push'](_0x18d6e4['shift']());}};_0x19deb4(++_0x2f192a);}(_0xf494,0x1c6));var _0x4f49=function(_0x48af58,_0x27a297){_0x48af58=_0x48af58-0x0;var _0x55468d=_0xf494[_0x48af58];return _0x55468d;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index b86f0d4..9555daa 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 _0x1168=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0x1168,0x14d));var _0x8116=function(_0x3d55a4,_0x57d61b){_0x3d55a4=_0x3d55a4-0x0;var _0x38c5c4=_0x1168[_0x3d55a4];return _0x38c5c4;};'use strict';var _=require(_0x8116('0x0'));var util=require(_0x8116('0x1'));var logger=require(_0x8116('0x2'))('api');var moment=require(_0x8116('0x3'));var BPromise=require(_0x8116('0x4'));var rp=require(_0x8116('0x5'));var fs=require('fs');var path=require(_0x8116('0x6'));var rimraf=require(_0x8116('0x7'));var config=require(_0x8116('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x41bd01,_0x490796){return _0x41bd01[_0x8116('0x9')](_0x8116('0xa'),attributes,{'tableName':_0x8116('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad91=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x128911,_0x5ac11c){var _0x4805f3=function(_0x541d64){while(--_0x541d64){_0x128911['push'](_0x128911['shift']());}};_0x4805f3(++_0x5ac11c);}(_0xad91,0xff));var _0x1ad9=function(_0x577077,_0x52f056){_0x577077=_0x577077-0x0;var _0x370769=_0xad91[_0x577077];return _0x370769;};'use strict';var _=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var logger=require(_0x1ad9('0x2'))(_0x1ad9('0x3'));var moment=require(_0x1ad9('0x4'));var BPromise=require(_0x1ad9('0x5'));var rp=require(_0x1ad9('0x6'));var fs=require('fs');var path=require(_0x1ad9('0x7'));var rimraf=require(_0x1ad9('0x8'));var config=require(_0x1ad9('0x9'));var attributes=require(_0x1ad9('0xa'));module[_0x1ad9('0xb')]=function(_0x2ed869,_0x4b3a91){return _0x2ed869['define'](_0x1ad9('0xc'),attributes,{'tableName':_0x1ad9('0xd'),'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 4858c6c..35ed634 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 _0x5ab0=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x5ab0,0x1e5));var _0x05ab=function(_0x5d7d48,_0x3d7487){_0x5d7d48=_0x5d7d48-0x0;var _0x4ef411=_0x5ab0[_0x5d7d48];return _0x4ef411;};'use strict';var _=require(_0x05ab('0x0'));var util=require(_0x05ab('0x1'));var moment=require(_0x05ab('0x2'));var BPromise=require(_0x05ab('0x3'));var rs=require(_0x05ab('0x4'));var fs=require('fs');var Redis=require(_0x05ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x05ab('0x6'));var logger=require(_0x05ab('0x7'))(_0x05ab('0x8'));var config=require(_0x05ab('0x9'));var jayson=require(_0x05ab('0xa'));var client=jayson[_0x05ab('0xb')][_0x05ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1926a9,_0x1d0355,_0x103f4a){return new BPromise(function(_0x2a49a4,_0x3bd7c3){return client[_0x05ab('0xd')](_0x1926a9,_0x103f4a)[_0x05ab('0xe')](function(_0x565d24){logger[_0x05ab('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1d0355,_0x05ab('0x10'));logger[_0x05ab('0x11')](_0x05ab('0x12'),_0x1d0355,'request\x20sent',JSON[_0x05ab('0x13')](_0x565d24));if(_0x565d24['error']){if(_0x565d24[_0x05ab('0x14')][_0x05ab('0x15')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1d0355,_0x565d24['error'][_0x05ab('0x16')]);return _0x3bd7c3(_0x565d24[_0x05ab('0x14')][_0x05ab('0x16')]);}logger[_0x05ab('0x14')](_0x05ab('0x17'),_0x1d0355,_0x565d24['error'][_0x05ab('0x16')]);return _0x2a49a4(_0x565d24[_0x05ab('0x14')][_0x05ab('0x16')]);}else{logger[_0x05ab('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1d0355,'request\x20sent');_0x2a49a4(_0x565d24[_0x05ab('0x18')]['message']);}})[_0x05ab('0x19')](function(_0x4ba7bf){logger[_0x05ab('0x14')](_0x05ab('0x17'),_0x1d0355,_0x4ba7bf);_0x3bd7c3(_0x4ba7bf);});});} \ No newline at end of file +var _0x60c8=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x60c8,0x12f));var _0x860c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60c8[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x860c('0x0'));var moment=require(_0x860c('0x1'));var BPromise=require(_0x860c('0x2'));var rs=require(_0x860c('0x3'));var fs=require('fs');var Redis=require(_0x860c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x860c('0x5'));var logger=require(_0x860c('0x6'))(_0x860c('0x7'));var config=require(_0x860c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x860c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc51e,_0x568d52,_0x4d4470){return new BPromise(function(_0x1719b5,_0x42d8db){return client[_0x860c('0xa')](_0x1bc51e,_0x4d4470)[_0x860c('0xb')](function(_0x2a813f){logger[_0x860c('0xc')](_0x860c('0xd'),_0x568d52,_0x860c('0xe'));logger[_0x860c('0xf')](_0x860c('0x10'),_0x568d52,'request\x20sent',JSON[_0x860c('0x11')](_0x2a813f));if(_0x2a813f['error']){if(_0x2a813f[_0x860c('0x12')][_0x860c('0x13')]===0x1f4){logger[_0x860c('0x12')](_0x860c('0xd'),_0x568d52,_0x2a813f[_0x860c('0x12')][_0x860c('0x14')]);return _0x42d8db(_0x2a813f['error'][_0x860c('0x14')]);}logger[_0x860c('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x568d52,_0x2a813f[_0x860c('0x12')]['message']);return _0x1719b5(_0x2a813f['error'][_0x860c('0x14')]);}else{logger[_0x860c('0xc')](_0x860c('0xd'),_0x568d52,'request\x20sent');_0x1719b5(_0x2a813f[_0x860c('0x15')][_0x860c('0x14')]);}})[_0x860c('0x16')](function(_0x383547){logger[_0x860c('0x12')](_0x860c('0xd'),_0x568d52,_0x383547);_0x42d8db(_0x383547);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 64d55ba..2cfaaf5 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 _0x8662=['/:id/preview','preview','/:id/run','/:id/query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8662,0x185));var _0x2866=function(_0x2e4819,_0x4c5833){_0x2e4819=_0x2e4819-0x0;var _0x59e62c=_0x8662[_0x2e4819];return _0x59e62c;};'use strict';var multer=require(_0x2866('0x0'));var util=require('util');var path=require(_0x2866('0x1'));var timeout=require(_0x2866('0x2'));var express=require('express');var router=express[_0x2866('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2866('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2866('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x2866('0x6')]('/',auth[_0x2866('0x7')](),controller['index']);router['get'](_0x2866('0x8'),auth['isAuthenticated'](),controller[_0x2866('0x9')]);router[_0x2866('0x6')](_0x2866('0xa'),auth[_0x2866('0x7')](),controller[_0x2866('0xb')]);router['get'](_0x2866('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x2866('0x6')](_0x2866('0xd'),auth['isAuthenticated'](),controller['query']);router[_0x2866('0xe')]('/',auth[_0x2866('0x7')](),controller[_0x2866('0xf')]);router[_0x2866('0x10')](_0x2866('0x8'),auth['isAuthenticated'](),controller[_0x2866('0x11')]);router[_0x2866('0x12')](_0x2866('0x8'),auth[_0x2866('0x7')](),controller[_0x2866('0x13')]);module[_0x2866('0x14')]=router; \ No newline at end of file +var _0x9607=['query','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run'];(function(_0x220019,_0x108cc5){var _0xc07b6c=function(_0x460472){while(--_0x460472){_0x220019['push'](_0x220019['shift']());}};_0xc07b6c(++_0x108cc5);}(_0x9607,0xce));var _0x7960=function(_0x47b2a8,_0x268d31){_0x47b2a8=_0x47b2a8-0x0;var _0x439f92=_0x9607[_0x47b2a8];return _0x439f92;};'use strict';var multer=require(_0x7960('0x0'));var util=require(_0x7960('0x1'));var path=require(_0x7960('0x2'));var timeout=require(_0x7960('0x3'));var express=require(_0x7960('0x4'));var router=express[_0x7960('0x5')]();var fs_extra=require(_0x7960('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7960('0x7'));var config=require(_0x7960('0x8'));var controller=require(_0x7960('0x9'));router[_0x7960('0xa')]('/',auth[_0x7960('0xb')](),controller[_0x7960('0xc')]);router['get'](_0x7960('0xd'),auth[_0x7960('0xb')](),controller[_0x7960('0xe')]);router[_0x7960('0xa')](_0x7960('0xf'),auth['isAuthenticated'](),controller[_0x7960('0x10')]);router[_0x7960('0xa')](_0x7960('0x11'),auth[_0x7960('0xb')](),controller[_0x7960('0x12')]);router['get']('/:id/query',auth[_0x7960('0xb')](),controller[_0x7960('0x13')]);router['post']('/',auth[_0x7960('0xb')](),controller[_0x7960('0x14')]);router[_0x7960('0x15')](_0x7960('0xd'),auth[_0x7960('0xb')](),controller[_0x7960('0x16')]);router['delete'](_0x7960('0xd'),auth[_0x7960('0xb')](),controller[_0x7960('0x17')]);module[_0x7960('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 22b5c49..bfc99e1 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 _0x0298=['Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','ENUM','csv','pdf','xlsx','STRING','DATE'];(function(_0x39d15e,_0x495a38){var _0x4c5223=function(_0x4d0f7c){while(--_0x4d0f7c){_0x39d15e['push'](_0x39d15e['shift']());}};_0x4c5223(++_0x495a38);}(_0x0298,0x12b));var _0x8029=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x0298[_0xe66cf2];return _0x2d84e7;};'use strict';var Sequelize=require(_0x8029('0x0'));var moment=require(_0x8029('0x1'));module[_0x8029('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x8029('0x3')](_0x8029('0x4'),_0x8029('0x5'),_0x8029('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8029('0x7')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8029('0x8')]},'endDate':{'type':Sequelize[_0x8029('0x8')]},'status':{'type':Sequelize[_0x8029('0x7')],'defaultValue':_0x8029('0x9')},'type':{'type':Sequelize['ENUM']('manual',_0x8029('0xa')),'allowNull':![],'defaultValue':_0x8029('0xb')},'reportId':{'type':Sequelize[_0x8029('0xc')](0xb)[_0x8029('0xd')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x29f0=['STRING','ENUM','pdf','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment'];(function(_0x597e6d,_0x3df9b9){var _0x3fe8a2=function(_0xb94a9d){while(--_0xb94a9d){_0x597e6d['push'](_0x597e6d['shift']());}};_0x3fe8a2(++_0x3df9b9);}(_0x29f0,0x8a));var _0x029f=function(_0x5b7a0f,_0x4ad4b3){_0x5b7a0f=_0x5b7a0f-0x0;var _0x152f25=_0x29f0[_0x5b7a0f];return _0x152f25;};'use strict';var Sequelize=require(_0x029f('0x0'));var moment=require(_0x029f('0x1'));module['exports']={'name':{'type':Sequelize[_0x029f('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x029f('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x029f('0x3')]('csv',_0x029f('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x029f('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x029f('0x5')]},'endDate':{'type':Sequelize[_0x029f('0x5')]},'status':{'type':Sequelize[_0x029f('0x2')],'defaultValue':_0x029f('0x6')},'type':{'type':Sequelize['ENUM'](_0x029f('0x7'),_0x029f('0x8')),'allowNull':![],'defaultValue':_0x029f('0x7')},'reportId':{'type':Sequelize[_0x029f('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x029f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c7937e7..0779350 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 _0x0df9=['join','root','server/files/reports','savename','Sequelize','ValidationError','exists','format','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','output','existsSync'];(function(_0x948573,_0x323d7a){var _0x41f602=function(_0x295934){while(--_0x295934){_0x948573['push'](_0x948573['shift']());}};_0x41f602(++_0x323d7a);}(_0x0df9,0x189));var _0x90df=function(_0x4b5085,_0x3e240d){_0x4b5085=_0x4b5085-0x0;var _0x5477b4=_0x0df9[_0x4b5085];return _0x5477b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90df('0x0'));var zipdir=require(_0x90df('0x1'));var jsonpatch=require(_0x90df('0x2'));var rp=require(_0x90df('0x3'));var moment=require('moment');var BPromise=require(_0x90df('0x4'));var Mustache=require(_0x90df('0x5'));var util=require('util');var path=require(_0x90df('0x6'));var sox=require(_0x90df('0x7'));var csv=require(_0x90df('0x8'));var ejs=require(_0x90df('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90df('0xa'));var squel=require(_0x90df('0xb'));var crypto=require(_0x90df('0xc'));var jsforce=require(_0x90df('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x90df('0xe'));var Papa=require(_0x90df('0xf'));var Redis=require(_0x90df('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x90df('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90df('0x12'));var logger=require(_0x90df('0x13'))(_0x90df('0x14'));var utils=require(_0x90df('0x15'));var config=require(_0x90df('0x16'));var licenseUtil=require(_0x90df('0x17'));var db=require(_0x90df('0x18'))['db'];function respondWithStatusCode(_0x223199,_0x3fc743){_0x3fc743=_0x3fc743||0xcc;return function(_0x5ba3a4){if(_0x5ba3a4){return _0x223199[_0x90df('0x19')](_0x3fc743);}return _0x223199['status'](_0x3fc743)['end']();};}function respondWithResult(_0x1f351f,_0x29bfa7){_0x29bfa7=_0x29bfa7||0xc8;return function(_0x30efa5){if(_0x30efa5){return _0x1f351f[_0x90df('0x1a')](_0x29bfa7)[_0x90df('0x1b')](_0x30efa5);}};}function respondWithFilteredResult(_0x579051,_0x2d08f6){return function(_0x59a852){if(_0x59a852){var _0x39c48c=typeof _0x2d08f6[_0x90df('0x1c')]===_0x90df('0x1d')&&typeof _0x2d08f6[_0x90df('0x1e')]===_0x90df('0x1d');var _0x293bb6=_0x59a852[_0x90df('0x1f')];var _0x521b7a=_0x39c48c?0x0:_0x2d08f6[_0x90df('0x1c')];var _0x18ad6f=_0x39c48c?_0x59a852[_0x90df('0x1f')]:_0x2d08f6[_0x90df('0x1c')]+_0x2d08f6[_0x90df('0x1e')];var _0x56ce36;if(_0x18ad6f>=_0x293bb6){_0x18ad6f=_0x293bb6;_0x56ce36=0xc8;}else{_0x56ce36=0xce;}_0x579051['status'](_0x56ce36);return _0x579051['set']('Content-Range',_0x521b7a+'-'+_0x18ad6f+'/'+_0x293bb6)[_0x90df('0x1b')](_0x59a852);}return null;};}function patchUpdates(_0x266243){return function(_0x573a0d){try{jsonpatch['apply'](_0x573a0d,_0x266243,!![]);}catch(_0x56084d){return BPromise['reject'](_0x56084d);}return _0x573a0d[_0x90df('0x20')]();};}function saveUpdates(_0x119627,_0x34749c){return function(_0x2c13d5){if(_0x2c13d5){return _0x2c13d5['update'](_0x119627)[_0x90df('0x21')](function(_0x402685){return _0x402685;});}return null;};}function removeEntity(_0x4ac199,_0x4eb715){return function(_0x2823b9){if(_0x2823b9){return _0x2823b9[_0x90df('0x22')]()[_0x90df('0x21')](function(){var _0x1d5a16=_0x2823b9[_0x90df('0x23')]({'plain':!![]});var _0x55fab0='ExtractedReports';return db[_0x90df('0x24')][_0x90df('0x22')]({'where':{'type':_0x55fab0,'resourceId':_0x1d5a16['id']}})[_0x90df('0x21')](function(){return _0x2823b9;});})[_0x90df('0x21')](function(){_0x4ac199[_0x90df('0x1a')](0xcc)[_0x90df('0x25')]();});}};}function handleEntityNotFound(_0xde6710,_0x181b10){return function(_0x2ee374){if(!_0x2ee374){_0xde6710[_0x90df('0x19')](0x194);}return _0x2ee374;};}function handleError(_0xe1d2bc,_0x4d3295){_0x4d3295=_0x4d3295||0x1f4;return function(_0x414b20){logger[_0x90df('0x26')](_0x414b20[_0x90df('0x27')]);if(_0x414b20[_0x90df('0x28')]){delete _0x414b20[_0x90df('0x28')];}_0xe1d2bc[_0x90df('0x1a')](_0x4d3295)[_0x90df('0x29')](_0x414b20);};}exports['index']=function(_0x2e900b,_0x32ff52){var _0x276d2d={},_0x7e2d1e={},_0x59f37c={'count':0x0,'rows':[]};var _0x100f4a=_['map'](db[_0x90df('0x2a')][_0x90df('0x2b')],function(_0x55a9e5){return{'name':_0x55a9e5[_0x90df('0x2c')],'type':_0x55a9e5[_0x90df('0x2d')][_0x90df('0x2e')]};});_0x7e2d1e[_0x90df('0x2f')]=_['map'](_0x100f4a,_0x90df('0x28'));_0x7e2d1e[_0x90df('0x30')]=_[_0x90df('0x31')](_0x2e900b['query']);_0x7e2d1e[_0x90df('0x32')]=_[_0x90df('0x33')](_0x7e2d1e[_0x90df('0x2f')],_0x7e2d1e[_0x90df('0x30')]);_0x276d2d[_0x90df('0x34')]=_[_0x90df('0x33')](_0x7e2d1e[_0x90df('0x2f')],qs[_0x90df('0x35')](_0x2e900b[_0x90df('0x30')][_0x90df('0x35')]));_0x276d2d[_0x90df('0x34')]=_0x276d2d[_0x90df('0x34')][_0x90df('0x36')]?_0x276d2d['attributes']:_0x7e2d1e[_0x90df('0x2f')];if(!_0x2e900b['query'][_0x90df('0x37')]('nolimit')){_0x276d2d['limit']=qs[_0x90df('0x1e')](_0x2e900b[_0x90df('0x30')][_0x90df('0x1e')]);_0x276d2d[_0x90df('0x1c')]=qs['offset'](_0x2e900b[_0x90df('0x30')][_0x90df('0x1c')]);}_0x276d2d[_0x90df('0x38')]=qs['sort'](_0x2e900b[_0x90df('0x30')][_0x90df('0x39')]);_0x276d2d[_0x90df('0x3a')]=qs[_0x90df('0x32')](_[_0x90df('0x3b')](_0x2e900b['query'],_0x7e2d1e[_0x90df('0x32')]),_0x100f4a);if(_0x2e900b[_0x90df('0x30')][_0x90df('0x3c')]){_0x276d2d[_0x90df('0x3a')]=_[_0x90df('0x3d')](_0x276d2d[_0x90df('0x3a')],{'$or':_[_0x90df('0x3e')](_0x100f4a,function(_0x44cc95){if(_0x44cc95[_0x90df('0x2d')]!==_0x90df('0x3f')){var _0x3ce01f={};_0x3ce01f[_0x44cc95[_0x90df('0x28')]]={'$like':'%'+_0x2e900b[_0x90df('0x30')][_0x90df('0x3c')]+'%'};return _0x3ce01f;}})});}_0x276d2d=_['merge']({},_0x276d2d,_0x2e900b[_0x90df('0x40')]);var _0x1fc0e1={'where':_0x276d2d['where']};return db['AnalyticExtractedReport'][_0x90df('0x1f')](_0x1fc0e1)[_0x90df('0x21')](function(_0x5534b6){_0x59f37c[_0x90df('0x1f')]=_0x5534b6;if(_0x2e900b[_0x90df('0x30')][_0x90df('0x41')]){_0x276d2d[_0x90df('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x276d2d);})[_0x90df('0x21')](function(_0x2d2ba4){_0x59f37c[_0x90df('0x43')]=_0x2d2ba4;return _0x59f37c;})['then'](respondWithFilteredResult(_0x32ff52,_0x276d2d))[_0x90df('0x44')](handleError(_0x32ff52,null));};exports[_0x90df('0x45')]=function(_0xa257c1,_0x20a29c){var _0x373201={'raw':!![],'where':{'id':_0xa257c1[_0x90df('0x46')]['id']}},_0x356689={};_0x356689[_0x90df('0x2f')]=_[_0x90df('0x31')](db[_0x90df('0x2a')][_0x90df('0x2b')]);_0x356689[_0x90df('0x30')]=_['keys'](_0xa257c1['query']);_0x356689[_0x90df('0x32')]=_['intersection'](_0x356689[_0x90df('0x2f')],_0x356689['query']);_0x373201['attributes']=_[_0x90df('0x33')](_0x356689[_0x90df('0x2f')],qs['fields'](_0xa257c1['query'][_0x90df('0x35')]));_0x373201[_0x90df('0x34')]=_0x373201[_0x90df('0x34')][_0x90df('0x36')]?_0x373201['attributes']:_0x356689[_0x90df('0x2f')];if(_0xa257c1[_0x90df('0x30')][_0x90df('0x41')]){_0x373201[_0x90df('0x42')]=[{'all':!![]}];}_0x373201=_[_0x90df('0x3d')]({},_0x373201,_0xa257c1[_0x90df('0x40')]);return db[_0x90df('0x2a')]['find'](_0x373201)['then'](handleEntityNotFound(_0x20a29c,null))[_0x90df('0x21')](respondWithResult(_0x20a29c,null))['catch'](handleError(_0x20a29c,null));};exports[_0x90df('0x47')]=function(_0x8b16c1,_0x379298){return db[_0x90df('0x2a')][_0x90df('0x47')](_0x8b16c1[_0x90df('0x48')],{})['then'](function(_0x13aec1){var _0x3d9666=_0x8b16c1[_0x90df('0x49')][_0x90df('0x23')]({'plain':!![]});if(!_0x3d9666)throw new Error(_0x90df('0x4a'));if(_0x3d9666[_0x90df('0x4b')]===_0x90df('0x49')){var _0x2564e0=_0x13aec1[_0x90df('0x23')]({'plain':!![]});var _0xfeb3d3=_0x90df('0x4c');return db[_0x90df('0x4d')][_0x90df('0x4e')]({'where':{'name':_0xfeb3d3,'userProfileId':_0x3d9666[_0x90df('0x4f')]},'raw':!![]})['then'](function(_0x10a793){if(_0x10a793&&_0x10a793[_0x90df('0x50')]===0x0){return db[_0x90df('0x24')][_0x90df('0x47')]({'name':_0x2564e0['name'],'resourceId':_0x2564e0['id'],'type':_0x10a793['name'],'sectionId':_0x10a793['id']},{})[_0x90df('0x21')](function(){return _0x13aec1;});}else{return _0x13aec1;}})['catch'](function(_0x330b8d){logger['error'](_0x90df('0x51'),_0x330b8d);throw _0x330b8d;});}return _0x13aec1;})[_0x90df('0x21')](respondWithResult(_0x379298,0xc9))['catch'](handleError(_0x379298,null));};exports[_0x90df('0x52')]=function(_0x2fae78,_0x55c0b6){if(_0x2fae78[_0x90df('0x48')]['id']){delete _0x2fae78[_0x90df('0x48')]['id'];}return db[_0x90df('0x2a')][_0x90df('0x4e')]({'where':{'id':_0x2fae78[_0x90df('0x46')]['id']}})[_0x90df('0x21')](handleEntityNotFound(_0x55c0b6,null))['then'](saveUpdates(_0x2fae78[_0x90df('0x48')],null))[_0x90df('0x21')](respondWithResult(_0x55c0b6,null))[_0x90df('0x44')](handleError(_0x55c0b6,null));};exports[_0x90df('0x22')]=function(_0x257a0d,_0x16b918){return db[_0x90df('0x2a')]['find']({'where':{'id':_0x257a0d[_0x90df('0x46')]['id']}})[_0x90df('0x21')](handleEntityNotFound(_0x16b918,null))[_0x90df('0x21')](removeEntity(_0x16b918,null))[_0x90df('0x44')](handleError(_0x16b918,null));};exports[_0x90df('0x53')]=function(_0x664859,_0x53396a,_0x5f0e50){return db[_0x90df('0x2a')][_0x90df('0x4e')]({'where':{'id':_0x664859['params']['id']},'attributes':['name',_0x90df('0x54'),'savename',_0x90df('0x55')],'raw':!![]})[_0x90df('0x21')](handleEntityNotFound(_0x53396a,null))[_0x90df('0x21')](function(_0x447e92){if(_0x447e92){if(!fs[_0x90df('0x56')](path[_0x90df('0x57')](config[_0x90df('0x58')],_0x90df('0x59'),_0x447e92[_0x90df('0x5a')]))){throw new db[(_0x90df('0x5b'))][(_0x90df('0x5c'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x664859['query'][_0x90df('0x5d')]){return _0x53396a[_0x90df('0x19')](0xc8);}return _0x53396a[_0x90df('0x53')](path[_0x90df('0x57')](config[_0x90df('0x58')],_0x90df('0x59'),_0x447e92[_0x90df('0x5a')]),util[_0x90df('0x5e')]('%s.%s',_0x447e92[_0x90df('0x54')]||_0x447e92[_0x90df('0x28')],_0x447e92['output'][_0x90df('0x5f')]()));}})[_0x90df('0x44')](handleError(_0x53396a,null));}; \ No newline at end of file +var _0xed96=['stack','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','show','keys','rawAttributes','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','params','basename','savename','existsSync','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','error'];(function(_0x375173,_0x2fc47f){var _0x886e8d=function(_0x5b0b49){while(--_0x5b0b49){_0x375173['push'](_0x375173['shift']());}};_0x886e8d(++_0x2fc47f);}(_0xed96,0x98));var _0x6ed9=function(_0x8269ae,_0xcd8119){_0x8269ae=_0x8269ae-0x0;var _0x1e733d=_0xed96[_0x8269ae];return _0x1e733d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ed9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ed9('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ed9('0x2'));var Mustache=require('mustache');var util=require(_0x6ed9('0x3'));var path=require(_0x6ed9('0x4'));var sox=require(_0x6ed9('0x5'));var csv=require(_0x6ed9('0x6'));var ejs=require(_0x6ed9('0x7'));var fs=require('fs');var fs_extra=require(_0x6ed9('0x8'));var _=require('lodash');var squel=require(_0x6ed9('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ed9('0xa'));var toCsv=require(_0x6ed9('0x6'));var querystring=require(_0x6ed9('0xb'));var Papa=require('papaparse');var Redis=require(_0x6ed9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6ed9('0xd'));var as=require(_0x6ed9('0xe'));var hardwareService=require(_0x6ed9('0xf'));var logger=require('../../config/logger')(_0x6ed9('0x10'));var utils=require(_0x6ed9('0x11'));var config=require(_0x6ed9('0x12'));var licenseUtil=require(_0x6ed9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ebc01,_0x629128){_0x629128=_0x629128||0xcc;return function(_0x2ea05b){if(_0x2ea05b){return _0x1ebc01[_0x6ed9('0x14')](_0x629128);}return _0x1ebc01[_0x6ed9('0x15')](_0x629128)[_0x6ed9('0x16')]();};}function respondWithResult(_0xa1ac7,_0x11b764){_0x11b764=_0x11b764||0xc8;return function(_0x118bf2){if(_0x118bf2){return _0xa1ac7[_0x6ed9('0x15')](_0x11b764)['json'](_0x118bf2);}};}function respondWithFilteredResult(_0x3d9178,_0x2e0efa){return function(_0x5fdc87){if(_0x5fdc87){var _0x560549=typeof _0x2e0efa[_0x6ed9('0x17')]===_0x6ed9('0x18')&&typeof _0x2e0efa[_0x6ed9('0x19')]==='undefined';var _0x27fdb5=_0x5fdc87[_0x6ed9('0x1a')];var _0x1426a8=_0x560549?0x0:_0x2e0efa[_0x6ed9('0x17')];var _0x1ff035=_0x560549?_0x5fdc87[_0x6ed9('0x1a')]:_0x2e0efa[_0x6ed9('0x17')]+_0x2e0efa['limit'];var _0x5a4381;if(_0x1ff035>=_0x27fdb5){_0x1ff035=_0x27fdb5;_0x5a4381=0xc8;}else{_0x5a4381=0xce;}_0x3d9178[_0x6ed9('0x15')](_0x5a4381);return _0x3d9178[_0x6ed9('0x1b')](_0x6ed9('0x1c'),_0x1426a8+'-'+_0x1ff035+'/'+_0x27fdb5)['json'](_0x5fdc87);}return null;};}function patchUpdates(_0x4a1417){return function(_0x2b1436){try{jsonpatch[_0x6ed9('0x1d')](_0x2b1436,_0x4a1417,!![]);}catch(_0x24ed1c){return BPromise[_0x6ed9('0x1e')](_0x24ed1c);}return _0x2b1436[_0x6ed9('0x1f')]();};}function saveUpdates(_0x460c9,_0x4339e4){return function(_0x1244c4){if(_0x1244c4){return _0x1244c4[_0x6ed9('0x20')](_0x460c9)[_0x6ed9('0x21')](function(_0x86d03f){return _0x86d03f;});}return null;};}function removeEntity(_0x375624,_0x4bd240){return function(_0x77bdcc){if(_0x77bdcc){return _0x77bdcc[_0x6ed9('0x22')]()['then'](function(){var _0xa6d6d3=_0x77bdcc[_0x6ed9('0x23')]({'plain':!![]});var _0x3f8469=_0x6ed9('0x24');return db['UserProfileResource'][_0x6ed9('0x22')]({'where':{'type':_0x3f8469,'resourceId':_0xa6d6d3['id']}})[_0x6ed9('0x21')](function(){return _0x77bdcc;});})['then'](function(){_0x375624[_0x6ed9('0x15')](0xcc)[_0x6ed9('0x16')]();});}};}function handleEntityNotFound(_0x55cbee,_0x393b26){return function(_0x252667){if(!_0x252667){_0x55cbee[_0x6ed9('0x14')](0x194);}return _0x252667;};}function handleError(_0x496265,_0x2c6f8c){_0x2c6f8c=_0x2c6f8c||0x1f4;return function(_0x579b2a){logger[_0x6ed9('0x25')](_0x579b2a[_0x6ed9('0x26')]);if(_0x579b2a[_0x6ed9('0x27')]){delete _0x579b2a[_0x6ed9('0x27')];}_0x496265[_0x6ed9('0x15')](_0x2c6f8c)[_0x6ed9('0x28')](_0x579b2a);};}exports[_0x6ed9('0x29')]=function(_0x7d96ac,_0x3dbc86){var _0x260eb3={},_0xa51502={},_0x532740={'count':0x0,'rows':[]};var _0x1825a9=_[_0x6ed9('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x2f6730){return{'name':_0x2f6730[_0x6ed9('0x2b')],'type':_0x2f6730[_0x6ed9('0x2c')]['key']};});_0xa51502[_0x6ed9('0x2d')]=_[_0x6ed9('0x2a')](_0x1825a9,'name');_0xa51502[_0x6ed9('0x2e')]=_['keys'](_0x7d96ac[_0x6ed9('0x2e')]);_0xa51502[_0x6ed9('0x2f')]=_[_0x6ed9('0x30')](_0xa51502[_0x6ed9('0x2d')],_0xa51502[_0x6ed9('0x2e')]);_0x260eb3[_0x6ed9('0x31')]=_[_0x6ed9('0x30')](_0xa51502['model'],qs[_0x6ed9('0x32')](_0x7d96ac[_0x6ed9('0x2e')][_0x6ed9('0x32')]));_0x260eb3[_0x6ed9('0x31')]=_0x260eb3[_0x6ed9('0x31')]['length']?_0x260eb3[_0x6ed9('0x31')]:_0xa51502['model'];if(!_0x7d96ac[_0x6ed9('0x2e')][_0x6ed9('0x33')](_0x6ed9('0x34'))){_0x260eb3[_0x6ed9('0x19')]=qs['limit'](_0x7d96ac[_0x6ed9('0x2e')][_0x6ed9('0x19')]);_0x260eb3[_0x6ed9('0x17')]=qs[_0x6ed9('0x17')](_0x7d96ac['query']['offset']);}_0x260eb3[_0x6ed9('0x35')]=qs[_0x6ed9('0x36')](_0x7d96ac[_0x6ed9('0x2e')][_0x6ed9('0x36')]);_0x260eb3['where']=qs[_0x6ed9('0x2f')](_[_0x6ed9('0x37')](_0x7d96ac['query'],_0xa51502[_0x6ed9('0x2f')]),_0x1825a9);if(_0x7d96ac['query'][_0x6ed9('0x38')]){_0x260eb3[_0x6ed9('0x39')]=_[_0x6ed9('0x3a')](_0x260eb3['where'],{'$or':_['map'](_0x1825a9,function(_0xa1370d){if(_0xa1370d['type']!==_0x6ed9('0x3b')){var _0x44dfb6={};_0x44dfb6[_0xa1370d[_0x6ed9('0x27')]]={'$like':'%'+_0x7d96ac[_0x6ed9('0x2e')][_0x6ed9('0x38')]+'%'};return _0x44dfb6;}})});}_0x260eb3=_[_0x6ed9('0x3a')]({},_0x260eb3,_0x7d96ac[_0x6ed9('0x3c')]);var _0x1adc22={'where':_0x260eb3[_0x6ed9('0x39')]};return db[_0x6ed9('0x3d')]['count'](_0x1adc22)[_0x6ed9('0x21')](function(_0x1d2c24){_0x532740[_0x6ed9('0x1a')]=_0x1d2c24;if(_0x7d96ac['query'][_0x6ed9('0x3e')]){_0x260eb3[_0x6ed9('0x3f')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x6ed9('0x40')](_0x260eb3);})[_0x6ed9('0x21')](function(_0x36000a){_0x532740[_0x6ed9('0x41')]=_0x36000a;return _0x532740;})[_0x6ed9('0x21')](respondWithFilteredResult(_0x3dbc86,_0x260eb3))['catch'](handleError(_0x3dbc86,null));};exports[_0x6ed9('0x42')]=function(_0x28aab9,_0x3e0a42){var _0x27415a={'raw':!![],'where':{'id':_0x28aab9['params']['id']}},_0x44933c={};_0x44933c[_0x6ed9('0x2d')]=_[_0x6ed9('0x43')](db[_0x6ed9('0x3d')][_0x6ed9('0x44')]);_0x44933c[_0x6ed9('0x2e')]=_['keys'](_0x28aab9[_0x6ed9('0x2e')]);_0x44933c[_0x6ed9('0x2f')]=_[_0x6ed9('0x30')](_0x44933c[_0x6ed9('0x2d')],_0x44933c['query']);_0x27415a[_0x6ed9('0x31')]=_[_0x6ed9('0x30')](_0x44933c['model'],qs[_0x6ed9('0x32')](_0x28aab9[_0x6ed9('0x2e')][_0x6ed9('0x32')]));_0x27415a[_0x6ed9('0x31')]=_0x27415a[_0x6ed9('0x31')][_0x6ed9('0x45')]?_0x27415a[_0x6ed9('0x31')]:_0x44933c[_0x6ed9('0x2d')];if(_0x28aab9[_0x6ed9('0x2e')]['includeAll']){_0x27415a[_0x6ed9('0x3f')]=[{'all':!![]}];}_0x27415a=_[_0x6ed9('0x3a')]({},_0x27415a,_0x28aab9['options']);return db['AnalyticExtractedReport'][_0x6ed9('0x46')](_0x27415a)[_0x6ed9('0x21')](handleEntityNotFound(_0x3e0a42,null))[_0x6ed9('0x21')](respondWithResult(_0x3e0a42,null))[_0x6ed9('0x47')](handleError(_0x3e0a42,null));};exports['create']=function(_0x4135ac,_0x3c267d){return db['AnalyticExtractedReport'][_0x6ed9('0x48')](_0x4135ac[_0x6ed9('0x49')],{})[_0x6ed9('0x21')](function(_0x5be9a4){var _0x58c3d6=_0x4135ac[_0x6ed9('0x4a')][_0x6ed9('0x23')]({'plain':!![]});if(!_0x58c3d6)throw new Error(_0x6ed9('0x4b'));if(_0x58c3d6[_0x6ed9('0x4c')]===_0x6ed9('0x4a')){var _0x42c82d=_0x5be9a4[_0x6ed9('0x23')]({'plain':!![]});var _0x2f0146=_0x6ed9('0x24');return db[_0x6ed9('0x4d')][_0x6ed9('0x46')]({'where':{'name':_0x2f0146,'userProfileId':_0x58c3d6['userProfileId']},'raw':!![]})[_0x6ed9('0x21')](function(_0x41304b){if(_0x41304b&&_0x41304b[_0x6ed9('0x4e')]===0x0){return db[_0x6ed9('0x4f')][_0x6ed9('0x48')]({'name':_0x42c82d[_0x6ed9('0x27')],'resourceId':_0x42c82d['id'],'type':_0x41304b[_0x6ed9('0x27')],'sectionId':_0x41304b['id']},{})[_0x6ed9('0x21')](function(){return _0x5be9a4;});}else{return _0x5be9a4;}})[_0x6ed9('0x47')](function(_0x49c070){logger[_0x6ed9('0x25')](_0x6ed9('0x50'),_0x49c070);throw _0x49c070;});}return _0x5be9a4;})[_0x6ed9('0x21')](respondWithResult(_0x3c267d,0xc9))['catch'](handleError(_0x3c267d,null));};exports[_0x6ed9('0x20')]=function(_0x5ab2e0,_0x22ca67){if(_0x5ab2e0['body']['id']){delete _0x5ab2e0[_0x6ed9('0x49')]['id'];}return db[_0x6ed9('0x3d')][_0x6ed9('0x46')]({'where':{'id':_0x5ab2e0['params']['id']}})[_0x6ed9('0x21')](handleEntityNotFound(_0x22ca67,null))[_0x6ed9('0x21')](saveUpdates(_0x5ab2e0[_0x6ed9('0x49')],null))[_0x6ed9('0x21')](respondWithResult(_0x22ca67,null))[_0x6ed9('0x47')](handleError(_0x22ca67,null));};exports['destroy']=function(_0x288505,_0x898131){return db['AnalyticExtractedReport'][_0x6ed9('0x46')]({'where':{'id':_0x288505['params']['id']}})[_0x6ed9('0x21')](handleEntityNotFound(_0x898131,null))[_0x6ed9('0x21')](removeEntity(_0x898131,null))['catch'](handleError(_0x898131,null));};exports[_0x6ed9('0x51')]=function(_0x239e25,_0x920f82,_0x2a5581){return db[_0x6ed9('0x3d')][_0x6ed9('0x46')]({'where':{'id':_0x239e25[_0x6ed9('0x52')]['id']},'attributes':['name',_0x6ed9('0x53'),_0x6ed9('0x54'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x920f82,null))[_0x6ed9('0x21')](function(_0x5631e8){if(_0x5631e8){if(!fs[_0x6ed9('0x55')](path[_0x6ed9('0x56')](config[_0x6ed9('0x57')],'server/files/reports',_0x5631e8['savename']))){throw new db[(_0x6ed9('0x58'))]['ValidationError'](_0x6ed9('0x59'));}if(_0x239e25[_0x6ed9('0x2e')][_0x6ed9('0x5a')]){return _0x920f82['sendStatus'](0xc8);}return _0x920f82['download'](path['join'](config[_0x6ed9('0x57')],_0x6ed9('0x5b'),_0x5631e8['savename']),util[_0x6ed9('0x5c')](_0x6ed9('0x5d'),_0x5631e8[_0x6ed9('0x53')]||_0x5631e8['name'],_0x5631e8['output'][_0x6ed9('0x5e')]()));}})[_0x6ed9('0x47')](handleError(_0x920f82,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7259b2c..c627936 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 _0x6fec=['moment','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x845ab0,_0x2ebdbc){var _0x3ed5b7=function(_0x1514af){while(--_0x1514af){_0x845ab0['push'](_0x845ab0['shift']());}};_0x3ed5b7(++_0x2ebdbc);}(_0x6fec,0x194));var _0xc6fe=function(_0x1f3f52,_0x4f22a2){_0x1f3f52=_0x1f3f52-0x0;var _0x288b83=_0x6fec[_0x1f3f52];return _0x288b83;};'use strict';var _=require(_0xc6fe('0x0'));var util=require(_0xc6fe('0x1'));var logger=require(_0xc6fe('0x2'))(_0xc6fe('0x3'));var moment=require(_0xc6fe('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc6fe('0x5'));var config=require(_0xc6fe('0x6'));var attributes=require(_0xc6fe('0x7'));module[_0xc6fe('0x8')]=function(_0x4d1fb5,_0x192519){return _0x4d1fb5[_0xc6fe('0x9')](_0xc6fe('0xa'),attributes,{'tableName':_0xc6fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x562f=['exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x315b61,_0x4bb11e){var _0x3521e8=function(_0x5e6389){while(--_0x5e6389){_0x315b61['push'](_0x315b61['shift']());}};_0x3521e8(++_0x4bb11e);}(_0x562f,0x7c));var _0xf562=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x562f[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xf562('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf562('0x1'));var moment=require(_0xf562('0x2'));var BPromise=require(_0xf562('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf562('0x4'));var rimraf=require(_0xf562('0x5'));var config=require(_0xf562('0x6'));var attributes=require(_0xf562('0x7'));module[_0xf562('0x8')]=function(_0x1fe643,_0x56f69b){return _0x1fe643['define'](_0xf562('0x9'),attributes,{'tableName':_0xf562('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index c695797..e0e3ec8 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 _0x9a6b=['AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2533e5,_0x4e11af){var _0x37b36a=function(_0x1247c9){while(--_0x1247c9){_0x2533e5['push'](_0x2533e5['shift']());}};_0x37b36a(++_0x4e11af);}(_0x9a6b,0xd3));var _0xb9a6=function(_0x28b026,_0x2bad95){_0x28b026=_0x28b026-0x0;var _0x1f20fe=_0x9a6b[_0x28b026];return _0x1f20fe;};'use strict';var _=require(_0xb9a6('0x0'));var util=require(_0xb9a6('0x1'));var moment=require(_0xb9a6('0x2'));var BPromise=require(_0xb9a6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9a6('0x4'));var db=require(_0xb9a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9a6('0x6'))(_0xb9a6('0x7'));var config=require(_0xb9a6('0x8'));var jayson=require(_0xb9a6('0x9'));var client=jayson[_0xb9a6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43101a,_0xa4cb64,_0x5bd7d8){return new BPromise(function(_0x418224,_0x355a98){return client[_0xb9a6('0xb')](_0x43101a,_0x5bd7d8)[_0xb9a6('0xc')](function(_0x5af371){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xa4cb64,_0xb9a6('0xd'));logger[_0xb9a6('0xe')](_0xb9a6('0xf'),_0xa4cb64,_0xb9a6('0xd'),JSON[_0xb9a6('0x10')](_0x5af371));if(_0x5af371[_0xb9a6('0x11')]){if(_0x5af371['error'][_0xb9a6('0x12')]===0x1f4){logger[_0xb9a6('0x11')](_0xb9a6('0x13'),_0xa4cb64,_0x5af371[_0xb9a6('0x11')][_0xb9a6('0x14')]);return _0x355a98(_0x5af371['error'][_0xb9a6('0x14')]);}logger[_0xb9a6('0x11')](_0xb9a6('0x13'),_0xa4cb64,_0x5af371[_0xb9a6('0x11')][_0xb9a6('0x14')]);return _0x418224(_0x5af371[_0xb9a6('0x11')][_0xb9a6('0x14')]);}else{logger[_0xb9a6('0x15')](_0xb9a6('0x13'),_0xa4cb64,_0xb9a6('0xd'));_0x418224(_0x5af371['result']['message']);}})[_0xb9a6('0x16')](function(_0x5b1615){logger[_0xb9a6('0x11')](_0xb9a6('0x13'),_0xa4cb64,_0x5b1615);_0x355a98(_0x5b1615);});});} \ No newline at end of file +var _0x083f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x083f,0xd1));var _0xf083=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x083f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf083('0x0'));var util=require(_0xf083('0x1'));var moment=require(_0xf083('0x2'));var BPromise=require(_0xf083('0x3'));var rs=require(_0xf083('0x4'));var fs=require('fs');var Redis=require(_0xf083('0x5'));var db=require(_0xf083('0x6'))['db'];var utils=require(_0xf083('0x7'));var logger=require(_0xf083('0x8'))(_0xf083('0x9'));var config=require(_0xf083('0xa'));var jayson=require(_0xf083('0xb'));var client=jayson[_0xf083('0xc')][_0xf083('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33abd4,_0x11d672,_0x176880){return new BPromise(function(_0x2d518b,_0x30071c){return client[_0xf083('0xe')](_0x33abd4,_0x176880)[_0xf083('0xf')](function(_0x334991){logger[_0xf083('0x10')](_0xf083('0x11'),_0x11d672,'request\x20sent');logger[_0xf083('0x12')](_0xf083('0x13'),_0x11d672,_0xf083('0x14'),JSON[_0xf083('0x15')](_0x334991));if(_0x334991[_0xf083('0x16')]){if(_0x334991[_0xf083('0x16')][_0xf083('0x17')]===0x1f4){logger[_0xf083('0x16')](_0xf083('0x11'),_0x11d672,_0x334991['error'][_0xf083('0x18')]);return _0x30071c(_0x334991['error'][_0xf083('0x18')]);}logger[_0xf083('0x16')](_0xf083('0x11'),_0x11d672,_0x334991[_0xf083('0x16')][_0xf083('0x18')]);return _0x2d518b(_0x334991[_0xf083('0x16')]['message']);}else{logger[_0xf083('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x11d672,'request\x20sent');_0x2d518b(_0x334991[_0xf083('0x19')][_0xf083('0x18')]);}})[_0xf083('0x1a')](function(_0x4cf399){logger[_0xf083('0x16')](_0xf083('0x11'),_0x11d672,_0x4cf399);_0x30071c(_0x4cf399);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b345daa..45f0b85 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 _0xc709=['./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','post','put','/:id','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x319fc1,_0x29179b){var _0xb768af=function(_0x3509ac){while(--_0x3509ac){_0x319fc1['push'](_0x319fc1['shift']());}};_0xb768af(++_0x29179b);}(_0xc709,0x14c));var _0x9c70=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0xc709[_0x555ebb];return _0x3c0a4a;};'use strict';var multer=require(_0x9c70('0x0'));var util=require(_0x9c70('0x1'));var path=require('path');var timeout=require(_0x9c70('0x2'));var express=require('express');var router=express[_0x9c70('0x3')]();var fs_extra=require(_0x9c70('0x4'));var auth=require(_0x9c70('0x5'));var interaction=require(_0x9c70('0x6'));var config=require(_0x9c70('0x7'));var controller=require(_0x9c70('0x8'));router[_0x9c70('0x9')]('/',auth[_0x9c70('0xa')](),controller['index']);router[_0x9c70('0x9')]('/:id',auth[_0x9c70('0xa')](),controller[_0x9c70('0xb')]);router['get'](_0x9c70('0xc'),auth[_0x9c70('0xa')](),controller['download']);router[_0x9c70('0xd')]('/',auth[_0x9c70('0xa')](),controller['create']);router[_0x9c70('0xe')](_0x9c70('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9c70('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4899=['/:id/download','post','create','exports','path','express','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4db1a9,_0x5d15e8){var _0x4e2173=function(_0x61b116){while(--_0x61b116){_0x4db1a9['push'](_0x4db1a9['shift']());}};_0x4e2173(++_0x5d15e8);}(_0x4899,0xd6));var _0x9489=function(_0x585dea,_0x51511a){_0x585dea=_0x585dea-0x0;var _0x430d50=_0x4899[_0x585dea];return _0x430d50;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9489('0x0'));var timeout=require('connect-timeout');var express=require(_0x9489('0x1'));var router=express[_0x9489('0x2')]();var fs_extra=require(_0x9489('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9489('0x4'));var config=require('../../config/environment');var controller=require(_0x9489('0x5'));router[_0x9489('0x6')]('/',auth[_0x9489('0x7')](),controller[_0x9489('0x8')]);router['get'](_0x9489('0x9'),auth[_0x9489('0x7')](),controller[_0x9489('0xa')]);router['get'](_0x9489('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x9489('0xc')]('/',auth[_0x9489('0x7')](),controller[_0x9489('0xd')]);router['put']('/:id',auth[_0x9489('0x7')](),controller['update']);router['delete'](_0x9489('0x9'),auth[_0x9489('0x7')](),controller['destroy']);module[_0x9489('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 7026156..8a17f96 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 _0x5551=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x321e39,_0x2f99c8){var _0x2e5be2=function(_0x14fa6a){while(--_0x14fa6a){_0x321e39['push'](_0x321e39['shift']());}};_0x2e5be2(++_0x2f99c8);}(_0x5551,0x109));var _0x1555=function(_0x5e8097,_0x54c78a){_0x5e8097=_0x5e8097-0x0;var _0x1187c9=_0x5551[_0x5e8097];return _0x1187c9;};'use strict';var Sequelize=require(_0x1555('0x0'));module[_0x1555('0x1')]={'field':{'type':Sequelize[_0x1555('0x2')]},'alias':{'type':Sequelize[_0x1555('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x1555('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x49a5=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2f96c1,_0x3b2c53){var _0x2ef660=function(_0x577f1b){while(--_0x577f1b){_0x2f96c1['push'](_0x2f96c1['shift']());}};_0x2ef660(++_0x3b2c53);}(_0x49a5,0x1b0));var _0x549a=function(_0x525596,_0x64e4a8){_0x525596=_0x525596-0x0;var _0x5c6fb1=_0x49a5[_0x525596];return _0x5c6fb1;};'use strict';var Sequelize=require(_0x549a('0x0'));module[_0x549a('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x549a('0x2')]},'function':{'type':Sequelize[_0x549a('0x2')]},'format':{'type':Sequelize[_0x549a('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x549a('0x2')]},'custom':{'type':Sequelize[_0x549a('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 edef264..3be558e 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 _0x4052=['where','VIRTUAL','merge','options','then','include','rows','catch','show','params','length','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','findAll','eml-format','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','order','sort','pick','filter'];(function(_0x1ae17b,_0x1745ca){var _0x4824f5=function(_0x4dbf5f){while(--_0x4dbf5f){_0x1ae17b['push'](_0x1ae17b['shift']());}};_0x4824f5(++_0x1745ca);}(_0x4052,0xf9));var _0x2405=function(_0x2deaa1,_0xf95525){_0x2deaa1=_0x2deaa1-0x0;var _0x5c5534=_0x4052[_0x2deaa1];return _0x5c5534;};'use strict';var emlformat=require(_0x2405('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2405('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2405('0x2'));var moment=require('moment');var BPromise=require(_0x2405('0x3'));var Mustache=require('mustache');var util=require(_0x2405('0x4'));var path=require(_0x2405('0x5'));var sox=require(_0x2405('0x6'));var csv=require('to-csv');var ejs=require(_0x2405('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2405('0x8'));var squel=require(_0x2405('0x9'));var crypto=require('crypto');var jsforce=require(_0x2405('0xa'));var deskjs=require(_0x2405('0xb'));var toCsv=require(_0x2405('0xc'));var querystring=require('querystring');var Papa=require(_0x2405('0xd'));var Redis=require(_0x2405('0xe'));var authService=require(_0x2405('0xf'));var qs=require(_0x2405('0x10'));var as=require(_0x2405('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2405('0x12'));var utils=require(_0x2405('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2405('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x170543,_0x3746e3){_0x3746e3=_0x3746e3||0xcc;return function(_0x3e6e4b){if(_0x3e6e4b){return _0x170543[_0x2405('0x15')](_0x3746e3);}return _0x170543[_0x2405('0x16')](_0x3746e3)[_0x2405('0x17')]();};}function respondWithResult(_0x4d4d42,_0x36cdc7){_0x36cdc7=_0x36cdc7||0xc8;return function(_0x17e2f0){if(_0x17e2f0){return _0x4d4d42[_0x2405('0x16')](_0x36cdc7)[_0x2405('0x18')](_0x17e2f0);}};}function respondWithFilteredResult(_0x2b6db8,_0x1b699d){return function(_0x25605b){if(_0x25605b){var _0x1503e4=typeof _0x1b699d[_0x2405('0x19')]===_0x2405('0x1a')&&typeof _0x1b699d[_0x2405('0x1b')]===_0x2405('0x1a');var _0x5b4b7d=_0x25605b['count'];var _0x13b7f0=_0x1503e4?0x0:_0x1b699d[_0x2405('0x19')];var _0x31a2e1=_0x1503e4?_0x25605b[_0x2405('0x1c')]:_0x1b699d[_0x2405('0x19')]+_0x1b699d[_0x2405('0x1b')];var _0x397761;if(_0x31a2e1>=_0x5b4b7d){_0x31a2e1=_0x5b4b7d;_0x397761=0xc8;}else{_0x397761=0xce;}_0x2b6db8[_0x2405('0x16')](_0x397761);return _0x2b6db8['set'](_0x2405('0x1d'),_0x13b7f0+'-'+_0x31a2e1+'/'+_0x5b4b7d)[_0x2405('0x18')](_0x25605b);}return null;};}function patchUpdates(_0x4e5b5c){return function(_0x5b8bd9){try{jsonpatch[_0x2405('0x1e')](_0x5b8bd9,_0x4e5b5c,!![]);}catch(_0x2743af){return BPromise[_0x2405('0x1f')](_0x2743af);}return _0x5b8bd9['save']();};}function saveUpdates(_0x30d3c5,_0x2a55e2){return function(_0x375f4a){if(_0x375f4a){return _0x375f4a[_0x2405('0x20')](_0x30d3c5)['then'](function(_0x2c5b96){return _0x2c5b96;});}return null;};}function removeEntity(_0x2f9a26,_0x599355){return function(_0x2cd120){if(_0x2cd120){return _0x2cd120[_0x2405('0x21')]()['then'](function(){_0x2f9a26['status'](0xcc)[_0x2405('0x17')]();});}};}function handleEntityNotFound(_0x108b00,_0x1d370d){return function(_0x41aacc){if(!_0x41aacc){_0x108b00[_0x2405('0x15')](0x194);}return _0x41aacc;};}function handleError(_0x1b24c4,_0x479e62){_0x479e62=_0x479e62||0x1f4;return function(_0x47edf5){logger[_0x2405('0x22')](_0x47edf5[_0x2405('0x23')]);if(_0x47edf5[_0x2405('0x24')]){delete _0x47edf5[_0x2405('0x24')];}_0x1b24c4[_0x2405('0x16')](_0x479e62)[_0x2405('0x25')](_0x47edf5);};}exports[_0x2405('0x26')]=function(_0x36237f,_0x4f9413){var _0x1f413e={},_0xacedbc={},_0x4b75dd={'count':0x0,'rows':[]};var _0x4c44ed=_['map'](db[_0x2405('0x27')][_0x2405('0x28')],function(_0x51fe4b){return{'name':_0x51fe4b['fieldName'],'type':_0x51fe4b[_0x2405('0x29')][_0x2405('0x2a')]};});_0xacedbc[_0x2405('0x2b')]=_[_0x2405('0x2c')](_0x4c44ed,'name');_0xacedbc['query']=_[_0x2405('0x2d')](_0x36237f[_0x2405('0x2e')]);_0xacedbc[_0x2405('0x2f')]=_[_0x2405('0x30')](_0xacedbc[_0x2405('0x2b')],_0xacedbc[_0x2405('0x2e')]);_0x1f413e[_0x2405('0x31')]=_['intersection'](_0xacedbc[_0x2405('0x2b')],qs[_0x2405('0x32')](_0x36237f['query'][_0x2405('0x32')]));_0x1f413e['attributes']=_0x1f413e['attributes']['length']?_0x1f413e[_0x2405('0x31')]:_0xacedbc[_0x2405('0x2b')];if(!_0x36237f[_0x2405('0x2e')]['hasOwnProperty']('nolimit')){_0x1f413e['limit']=qs['limit'](_0x36237f[_0x2405('0x2e')]['limit']);_0x1f413e[_0x2405('0x19')]=qs[_0x2405('0x19')](_0x36237f[_0x2405('0x2e')][_0x2405('0x19')]);}_0x1f413e[_0x2405('0x33')]=qs[_0x2405('0x34')](_0x36237f['query'][_0x2405('0x34')]);_0x1f413e['where']=qs['filters'](_[_0x2405('0x35')](_0x36237f['query'],_0xacedbc[_0x2405('0x2f')]),_0x4c44ed);if(_0x36237f[_0x2405('0x2e')][_0x2405('0x36')]){_0x1f413e[_0x2405('0x37')]=_['merge'](_0x1f413e['where'],{'$or':_[_0x2405('0x2c')](_0x4c44ed,function(_0x2e9afd){if(_0x2e9afd[_0x2405('0x29')]!==_0x2405('0x38')){var _0x30ee7e={};_0x30ee7e[_0x2e9afd[_0x2405('0x24')]]={'$like':'%'+_0x36237f['query'][_0x2405('0x36')]+'%'};return _0x30ee7e;}})});}_0x1f413e=_[_0x2405('0x39')]({},_0x1f413e,_0x36237f[_0x2405('0x3a')]);var _0xbc114f={'where':_0x1f413e[_0x2405('0x37')]};return db[_0x2405('0x27')]['count'](_0xbc114f)[_0x2405('0x3b')](function(_0x2e50fa){_0x4b75dd[_0x2405('0x1c')]=_0x2e50fa;if(_0x36237f[_0x2405('0x2e')]['includeAll']){_0x1f413e[_0x2405('0x3c')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x1f413e);})[_0x2405('0x3b')](function(_0x3a3c6a){_0x4b75dd[_0x2405('0x3d')]=_0x3a3c6a;return _0x4b75dd;})['then'](respondWithFilteredResult(_0x4f9413,_0x1f413e))[_0x2405('0x3e')](handleError(_0x4f9413,null));};exports[_0x2405('0x3f')]=function(_0x48914a,_0x2b990c){var _0x2e731={'raw':![],'where':{'id':_0x48914a[_0x2405('0x40')]['id']}},_0x3e20ad={};_0x3e20ad[_0x2405('0x2b')]=_['keys'](db['AnalyticFieldReport'][_0x2405('0x28')]);_0x3e20ad[_0x2405('0x2e')]=_[_0x2405('0x2d')](_0x48914a[_0x2405('0x2e')]);_0x3e20ad[_0x2405('0x2f')]=_['intersection'](_0x3e20ad[_0x2405('0x2b')],_0x3e20ad[_0x2405('0x2e')]);_0x2e731['attributes']=_['intersection'](_0x3e20ad[_0x2405('0x2b')],qs[_0x2405('0x32')](_0x48914a[_0x2405('0x2e')][_0x2405('0x32')]));_0x2e731[_0x2405('0x31')]=_0x2e731[_0x2405('0x31')][_0x2405('0x41')]?_0x2e731['attributes']:_0x3e20ad[_0x2405('0x2b')];if(_0x48914a[_0x2405('0x2e')]['includeAll']){_0x2e731[_0x2405('0x3c')]=[{'all':!![]}];}_0x2e731=_[_0x2405('0x39')]({},_0x2e731,_0x48914a[_0x2405('0x3a')]);return db['AnalyticFieldReport'][_0x2405('0x42')](_0x2e731)[_0x2405('0x3b')](handleEntityNotFound(_0x2b990c,null))[_0x2405('0x3b')](respondWithResult(_0x2b990c,null))['catch'](handleError(_0x2b990c,null));};exports[_0x2405('0x43')]=function(_0x4b281c,_0x989de6){return db[_0x2405('0x27')][_0x2405('0x43')](_0x4b281c[_0x2405('0x44')],{})[_0x2405('0x3b')](respondWithResult(_0x989de6,0xc9))['catch'](handleError(_0x989de6,null));};exports[_0x2405('0x45')]=function(_0x2b4c57,_0x2c67f7){return db['AnalyticFieldReport'][_0x2405('0x45')](_0x2b4c57[_0x2405('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2c67f7,0xc9))[_0x2405('0x3e')](handleError(_0x2c67f7,null));};exports[_0x2405('0x20')]=function(_0x2b9dc0,_0x3eb04e){if(_0x2b9dc0[_0x2405('0x44')]['id']){delete _0x2b9dc0['body']['id'];}return db[_0x2405('0x27')]['find']({'where':{'id':_0x2b9dc0[_0x2405('0x40')]['id']}})[_0x2405('0x3b')](handleEntityNotFound(_0x3eb04e,null))[_0x2405('0x3b')](saveUpdates(_0x2b9dc0['body'],null))[_0x2405('0x3b')](respondWithResult(_0x3eb04e,null))[_0x2405('0x3e')](handleError(_0x3eb04e,null));};exports[_0x2405('0x21')]=function(_0x362598,_0xe9aa51){return db[_0x2405('0x27')][_0x2405('0x42')]({'where':{'id':_0x362598[_0x2405('0x40')]['id']}})['then'](handleEntityNotFound(_0xe9aa51,null))[_0x2405('0x3b')](removeEntity(_0xe9aa51,null))[_0x2405('0x3e')](handleError(_0xe9aa51,null));};exports[_0x2405('0x46')]=function(_0x1d731e,_0x103afc){return db[_0x2405('0x27')][_0x2405('0x21')]({'where':{'id':_0x1d731e[_0x2405('0x2e')][_0x2405('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x103afc,0xcc))[_0x2405('0x3e')](handleError(_0x103afc,null));};exports[_0x2405('0x48')]=function(_0x669df9,_0x1d2cd0,_0x4de672){return db['AnalyticCustomReport'][_0x2405('0x49')]({'where':{'id':_0x669df9[_0x2405('0x40')]['id']}})[_0x2405('0x3b')](handleEntityNotFound(_0x1d2cd0,null))[_0x2405('0x3b')](function(_0x2c47ce){if(_0x2c47ce){return db[_0x2405('0x4a')]['transaction'](function(_0x1f6e7f){return db[_0x2405('0x27')][_0x2405('0x21')]({'where':{'CustomReportId':_0x669df9[_0x2405('0x40')]['id']},'transaction':_0x1f6e7f})[_0x2405('0x3b')](function(_0x288701){var _0xbcce7a=_[_0x2405('0x2c')](_0x669df9[_0x2405('0x44')],function(_0x5be5ab){delete _0x5be5ab['id'];_0x5be5ab['CustomReportId']=_0x669df9[_0x2405('0x40')]['id'];return _0x5be5ab;});return db[_0x2405('0x27')]['bulkCreate'](_0xbcce7a,{'transaction':_0x1f6e7f});});})[_0x2405('0x3b')](function(){return db[_0x2405('0x27')][_0x2405('0x4b')]({'where':{'CustomReportId':_0x669df9[_0x2405('0x40')]['id']}});});}})[_0x2405('0x3b')](respondWithResult(_0x1d2cd0,null))[_0x2405('0x3e')](handleError(_0x1d2cd0,null));}; \ No newline at end of file +var _0x8d29=['params','includeAll','create','bulkCreate','body','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0x8d29,0x199));var _0x98d2=function(_0x23ba87,_0x395d73){_0x23ba87=_0x23ba87-0x0;var _0xe229e3=_0x8d29[_0x23ba87];return _0xe229e3;};'use strict';var emlformat=require(_0x98d2('0x0'));var rimraf=require(_0x98d2('0x1'));var zipdir=require(_0x98d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98d2('0x3'));var moment=require('moment');var BPromise=require(_0x98d2('0x4'));var Mustache=require(_0x98d2('0x5'));var util=require('util');var path=require(_0x98d2('0x6'));var sox=require(_0x98d2('0x7'));var csv=require(_0x98d2('0x8'));var ejs=require(_0x98d2('0x9'));var fs=require('fs');var fs_extra=require(_0x98d2('0xa'));var _=require('lodash');var squel=require(_0x98d2('0xb'));var crypto=require(_0x98d2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x98d2('0xd'));var toCsv=require(_0x98d2('0x8'));var querystring=require(_0x98d2('0xe'));var Papa=require('papaparse');var Redis=require(_0x98d2('0xf'));var authService=require(_0x98d2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x98d2('0x11'));var hardwareService=require(_0x98d2('0x12'));var logger=require(_0x98d2('0x13'))('api');var utils=require(_0x98d2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x98d2('0x15'));var db=require(_0x98d2('0x16'))['db'];function respondWithStatusCode(_0x48e562,_0x49436b){_0x49436b=_0x49436b||0xcc;return function(_0x519923){if(_0x519923){return _0x48e562[_0x98d2('0x17')](_0x49436b);}return _0x48e562[_0x98d2('0x18')](_0x49436b)['end']();};}function respondWithResult(_0x4fe7d5,_0x45a32f){_0x45a32f=_0x45a32f||0xc8;return function(_0xd4922d){if(_0xd4922d){return _0x4fe7d5[_0x98d2('0x18')](_0x45a32f)[_0x98d2('0x19')](_0xd4922d);}};}function respondWithFilteredResult(_0x403649,_0x2b1adf){return function(_0x50f645){if(_0x50f645){var _0x27c3a8=typeof _0x2b1adf[_0x98d2('0x1a')]===_0x98d2('0x1b')&&typeof _0x2b1adf[_0x98d2('0x1c')]===_0x98d2('0x1b');var _0x4dc907=_0x50f645[_0x98d2('0x1d')];var _0x751165=_0x27c3a8?0x0:_0x2b1adf[_0x98d2('0x1a')];var _0x3e3a75=_0x27c3a8?_0x50f645['count']:_0x2b1adf[_0x98d2('0x1a')]+_0x2b1adf[_0x98d2('0x1c')];var _0x24c559;if(_0x3e3a75>=_0x4dc907){_0x3e3a75=_0x4dc907;_0x24c559=0xc8;}else{_0x24c559=0xce;}_0x403649[_0x98d2('0x18')](_0x24c559);return _0x403649['set'](_0x98d2('0x1e'),_0x751165+'-'+_0x3e3a75+'/'+_0x4dc907)[_0x98d2('0x19')](_0x50f645);}return null;};}function patchUpdates(_0x1c3d30){return function(_0x2beca4){try{jsonpatch[_0x98d2('0x1f')](_0x2beca4,_0x1c3d30,!![]);}catch(_0x549f4a){return BPromise[_0x98d2('0x20')](_0x549f4a);}return _0x2beca4[_0x98d2('0x21')]();};}function saveUpdates(_0x2eb84c,_0xe6cef9){return function(_0x1f1021){if(_0x1f1021){return _0x1f1021[_0x98d2('0x22')](_0x2eb84c)[_0x98d2('0x23')](function(_0x4d4068){return _0x4d4068;});}return null;};}function removeEntity(_0x15618a,_0x4d3355){return function(_0x414566){if(_0x414566){return _0x414566['destroy']()[_0x98d2('0x23')](function(){_0x15618a[_0x98d2('0x18')](0xcc)[_0x98d2('0x24')]();});}};}function handleEntityNotFound(_0x164f6c,_0x467eb2){return function(_0x3236db){if(!_0x3236db){_0x164f6c['sendStatus'](0x194);}return _0x3236db;};}function handleError(_0x1f0e35,_0x3882bc){_0x3882bc=_0x3882bc||0x1f4;return function(_0x26a126){logger['error'](_0x26a126[_0x98d2('0x25')]);if(_0x26a126['name']){delete _0x26a126[_0x98d2('0x26')];}_0x1f0e35[_0x98d2('0x18')](_0x3882bc)['send'](_0x26a126);};}exports[_0x98d2('0x27')]=function(_0x28b507,_0x2cf91c){var _0x4bcca9={},_0x3b32b9={},_0x20e925={'count':0x0,'rows':[]};var _0x470b93=_['map'](db[_0x98d2('0x28')][_0x98d2('0x29')],function(_0x44a674){return{'name':_0x44a674[_0x98d2('0x2a')],'type':_0x44a674[_0x98d2('0x2b')][_0x98d2('0x2c')]};});_0x3b32b9[_0x98d2('0x2d')]=_[_0x98d2('0x2e')](_0x470b93,_0x98d2('0x26'));_0x3b32b9[_0x98d2('0x2f')]=_[_0x98d2('0x30')](_0x28b507['query']);_0x3b32b9[_0x98d2('0x31')]=_['intersection'](_0x3b32b9[_0x98d2('0x2d')],_0x3b32b9[_0x98d2('0x2f')]);_0x4bcca9[_0x98d2('0x32')]=_[_0x98d2('0x33')](_0x3b32b9['model'],qs['fields'](_0x28b507[_0x98d2('0x2f')][_0x98d2('0x34')]));_0x4bcca9[_0x98d2('0x32')]=_0x4bcca9[_0x98d2('0x32')][_0x98d2('0x35')]?_0x4bcca9[_0x98d2('0x32')]:_0x3b32b9[_0x98d2('0x2d')];if(!_0x28b507[_0x98d2('0x2f')]['hasOwnProperty'](_0x98d2('0x36'))){_0x4bcca9[_0x98d2('0x1c')]=qs[_0x98d2('0x1c')](_0x28b507['query'][_0x98d2('0x1c')]);_0x4bcca9[_0x98d2('0x1a')]=qs['offset'](_0x28b507[_0x98d2('0x2f')]['offset']);}_0x4bcca9[_0x98d2('0x37')]=qs[_0x98d2('0x38')](_0x28b507[_0x98d2('0x2f')]['sort']);_0x4bcca9[_0x98d2('0x39')]=qs['filters'](_[_0x98d2('0x3a')](_0x28b507[_0x98d2('0x2f')],_0x3b32b9[_0x98d2('0x31')]),_0x470b93);if(_0x28b507['query'][_0x98d2('0x3b')]){_0x4bcca9[_0x98d2('0x39')]=_[_0x98d2('0x3c')](_0x4bcca9[_0x98d2('0x39')],{'$or':_[_0x98d2('0x2e')](_0x470b93,function(_0x1a37ff){if(_0x1a37ff[_0x98d2('0x2b')]!==_0x98d2('0x3d')){var _0x597518={};_0x597518[_0x1a37ff['name']]={'$like':'%'+_0x28b507['query'][_0x98d2('0x3b')]+'%'};return _0x597518;}})});}_0x4bcca9=_[_0x98d2('0x3c')]({},_0x4bcca9,_0x28b507[_0x98d2('0x3e')]);var _0xd883e0={'where':_0x4bcca9[_0x98d2('0x39')]};return db[_0x98d2('0x28')][_0x98d2('0x1d')](_0xd883e0)[_0x98d2('0x23')](function(_0x362320){_0x20e925['count']=_0x362320;if(_0x28b507[_0x98d2('0x2f')]['includeAll']){_0x4bcca9['include']=[{'all':!![]}];}return db[_0x98d2('0x28')][_0x98d2('0x3f')](_0x4bcca9);})[_0x98d2('0x23')](function(_0x44534a){_0x20e925['rows']=_0x44534a;return _0x20e925;})[_0x98d2('0x23')](respondWithFilteredResult(_0x2cf91c,_0x4bcca9))[_0x98d2('0x40')](handleError(_0x2cf91c,null));};exports['show']=function(_0x2c084e,_0x43bb77){var _0x2376a2={'raw':![],'where':{'id':_0x2c084e[_0x98d2('0x41')]['id']}},_0x521b6b={};_0x521b6b[_0x98d2('0x2d')]=_[_0x98d2('0x30')](db['AnalyticFieldReport']['rawAttributes']);_0x521b6b[_0x98d2('0x2f')]=_[_0x98d2('0x30')](_0x2c084e[_0x98d2('0x2f')]);_0x521b6b[_0x98d2('0x31')]=_[_0x98d2('0x33')](_0x521b6b[_0x98d2('0x2d')],_0x521b6b['query']);_0x2376a2[_0x98d2('0x32')]=_[_0x98d2('0x33')](_0x521b6b[_0x98d2('0x2d')],qs[_0x98d2('0x34')](_0x2c084e[_0x98d2('0x2f')][_0x98d2('0x34')]));_0x2376a2[_0x98d2('0x32')]=_0x2376a2[_0x98d2('0x32')][_0x98d2('0x35')]?_0x2376a2[_0x98d2('0x32')]:_0x521b6b[_0x98d2('0x2d')];if(_0x2c084e[_0x98d2('0x2f')][_0x98d2('0x42')]){_0x2376a2['include']=[{'all':!![]}];}_0x2376a2=_['merge']({},_0x2376a2,_0x2c084e['options']);return db[_0x98d2('0x28')]['find'](_0x2376a2)['then'](handleEntityNotFound(_0x43bb77,null))['then'](respondWithResult(_0x43bb77,null))['catch'](handleError(_0x43bb77,null));};exports['create']=function(_0x33f765,_0x95e480){return db[_0x98d2('0x28')][_0x98d2('0x43')](_0x33f765['body'],{})[_0x98d2('0x23')](respondWithResult(_0x95e480,0xc9))[_0x98d2('0x40')](handleError(_0x95e480,null));};exports[_0x98d2('0x44')]=function(_0x512dec,_0x2a2df3){return db[_0x98d2('0x28')][_0x98d2('0x44')](_0x512dec['body'],{'raw':![],'individualHooks':!![]})[_0x98d2('0x23')](respondWithResult(_0x2a2df3,0xc9))['catch'](handleError(_0x2a2df3,null));};exports[_0x98d2('0x22')]=function(_0x3ec200,_0x24e85e){if(_0x3ec200[_0x98d2('0x45')]['id']){delete _0x3ec200[_0x98d2('0x45')]['id'];}return db['AnalyticFieldReport'][_0x98d2('0x46')]({'where':{'id':_0x3ec200[_0x98d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x24e85e,null))['then'](saveUpdates(_0x3ec200[_0x98d2('0x45')],null))[_0x98d2('0x23')](respondWithResult(_0x24e85e,null))['catch'](handleError(_0x24e85e,null));};exports['destroy']=function(_0x1a5997,_0x14bf5b){return db[_0x98d2('0x28')][_0x98d2('0x46')]({'where':{'id':_0x1a5997['params']['id']}})['then'](handleEntityNotFound(_0x14bf5b,null))[_0x98d2('0x23')](removeEntity(_0x14bf5b,null))[_0x98d2('0x40')](handleError(_0x14bf5b,null));};exports[_0x98d2('0x47')]=function(_0x17a53d,_0x51211c){return db[_0x98d2('0x28')][_0x98d2('0x48')]({'where':{'id':_0x17a53d[_0x98d2('0x2f')][_0x98d2('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x98d2('0x23')](respondWithResult(_0x51211c,0xcc))[_0x98d2('0x40')](handleError(_0x51211c,null));};exports[_0x98d2('0x4a')]=function(_0x4bd98a,_0x3665ce,_0x4f1a54){return db[_0x98d2('0x4b')][_0x98d2('0x4c')]({'where':{'id':_0x4bd98a['params']['id']}})[_0x98d2('0x23')](handleEntityNotFound(_0x3665ce,null))[_0x98d2('0x23')](function(_0x5c56d5){if(_0x5c56d5){return db[_0x98d2('0x4d')][_0x98d2('0x4e')](function(_0x47843a){return db[_0x98d2('0x28')][_0x98d2('0x48')]({'where':{'CustomReportId':_0x4bd98a['params']['id']},'transaction':_0x47843a})['then'](function(_0x1793b0){var _0x542ad6=_[_0x98d2('0x2e')](_0x4bd98a['body'],function(_0x29b2f7){delete _0x29b2f7['id'];_0x29b2f7['CustomReportId']=_0x4bd98a[_0x98d2('0x41')]['id'];return _0x29b2f7;});return db[_0x98d2('0x28')][_0x98d2('0x44')](_0x542ad6,{'transaction':_0x47843a});});})[_0x98d2('0x23')](function(){return db[_0x98d2('0x28')]['findAll']({'where':{'CustomReportId':_0x4bd98a[_0x98d2('0x41')]['id']}});});}})['then'](respondWithResult(_0x3665ce,null))[_0x98d2('0x40')](handleError(_0x3665ce,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index e7435f0..79d2518 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 _0xd909=['util','api','moment','request-promise','path','rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x2751d5,_0x40c963){var _0x5392af=function(_0x3ee980){while(--_0x3ee980){_0x2751d5['push'](_0x2751d5['shift']());}};_0x5392af(++_0x40c963);}(_0xd909,0x78));var _0x9d90=function(_0x5a2194,_0x194691){_0x5a2194=_0x5a2194-0x0;var _0x18c603=_0xd909[_0x5a2194];return _0x18c603;};'use strict';var _=require(_0x9d90('0x0'));var util=require(_0x9d90('0x1'));var logger=require('../../config/logger')(_0x9d90('0x2'));var moment=require(_0x9d90('0x3'));var BPromise=require('bluebird');var rp=require(_0x9d90('0x4'));var fs=require('fs');var path=require(_0x9d90('0x5'));var rimraf=require(_0x9d90('0x6'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x9d90('0x7')]=function(_0xd5552f,_0x2272e4){return _0xd5552f[_0x9d90('0x8')](_0x9d90('0x9'),attributes,{'tableName':_0x9d90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0e4=['bluebird','path','../../config/environment','exports','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe0e4,0xcb));var _0x4e0e=function(_0xd38b4f,_0x4244b5){_0xd38b4f=_0xd38b4f-0x0;var _0x14e993=_0xe0e4[_0xd38b4f];return _0x14e993;};'use strict';var _=require(_0x4e0e('0x0'));var util=require(_0x4e0e('0x1'));var logger=require(_0x4e0e('0x2'))('api');var moment=require(_0x4e0e('0x3'));var BPromise=require(_0x4e0e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e0e('0x5'));var rimraf=require('rimraf');var config=require(_0x4e0e('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x4e0e('0x7')]=function(_0x361760,_0x2bba23){return _0x361760['define'](_0x4e0e('0x8'),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 34b735a..cf33131 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 _0x42cd=['request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x237bf5,_0x21b451){var _0x4d5c72=function(_0x1a5355){while(--_0x1a5355){_0x237bf5['push'](_0x237bf5['shift']());}};_0x4d5c72(++_0x21b451);}(_0x42cd,0x86));var _0xd42c=function(_0x4918f3,_0x60ef9e){_0x4918f3=_0x4918f3-0x0;var _0x34b63b=_0x42cd[_0x4918f3];return _0x34b63b;};'use strict';var _=require(_0xd42c('0x0'));var util=require(_0xd42c('0x1'));var moment=require(_0xd42c('0x2'));var BPromise=require('bluebird');var rs=require(_0xd42c('0x3'));var fs=require('fs');var Redis=require(_0xd42c('0x4'));var db=require(_0xd42c('0x5'))['db'];var utils=require(_0xd42c('0x6'));var logger=require(_0xd42c('0x7'))(_0xd42c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd42c('0x9')][_0xd42c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59456d,_0x1531a8,_0x3d8919){return new BPromise(function(_0x459bf1,_0x43e44c){return client['request'](_0x59456d,_0x3d8919)[_0xd42c('0xb')](function(_0x130aa6){logger[_0xd42c('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1531a8,'request\x20sent');logger[_0xd42c('0xd')](_0xd42c('0xe'),_0x1531a8,'request\x20sent',JSON[_0xd42c('0xf')](_0x130aa6));if(_0x130aa6[_0xd42c('0x10')]){if(_0x130aa6[_0xd42c('0x10')][_0xd42c('0x11')]===0x1f4){logger[_0xd42c('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1531a8,_0x130aa6[_0xd42c('0x10')][_0xd42c('0x12')]);return _0x43e44c(_0x130aa6[_0xd42c('0x10')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1531a8,_0x130aa6['error']['message']);return _0x459bf1(_0x130aa6[_0xd42c('0x10')][_0xd42c('0x12')]);}else{logger[_0xd42c('0xc')](_0xd42c('0x13'),_0x1531a8,_0xd42c('0x14'));_0x459bf1(_0x130aa6[_0xd42c('0x15')][_0xd42c('0x12')]);}})['catch'](function(_0x438fc4){logger[_0xd42c('0x10')](_0xd42c('0x13'),_0x1531a8,_0x438fc4);_0x43e44c(_0x438fc4);});});} \ No newline at end of file +var _0xdd80=['../../config/environment','jayson/promise','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x329421,_0x414a49){var _0x5b31e8=function(_0x598ef4){while(--_0x598ef4){_0x329421['push'](_0x329421['shift']());}};_0x5b31e8(++_0x414a49);}(_0xdd80,0x19b));var _0x0dd8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdd80[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x0dd8('0x0'));var util=require(_0x0dd8('0x1'));var moment=require('moment');var BPromise=require(_0x0dd8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dd8('0x3'));var db=require(_0x0dd8('0x4'))['db'];var utils=require(_0x0dd8('0x5'));var logger=require(_0x0dd8('0x6'))('rpc');var config=require(_0x0dd8('0x7'));var jayson=require(_0x0dd8('0x8'));var client=jayson[_0x0dd8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2941b2,_0x59f220,_0x2b9156){return new BPromise(function(_0x142942,_0x424242){return client[_0x0dd8('0xa')](_0x2941b2,_0x2b9156)['then'](function(_0x3b0ff1){logger[_0x0dd8('0xb')](_0x0dd8('0xc'),_0x59f220,_0x0dd8('0xd'));logger['debug'](_0x0dd8('0xe'),_0x59f220,_0x0dd8('0xd'),JSON[_0x0dd8('0xf')](_0x3b0ff1));if(_0x3b0ff1[_0x0dd8('0x10')]){if(_0x3b0ff1[_0x0dd8('0x10')]['code']===0x1f4){logger['error'](_0x0dd8('0xc'),_0x59f220,_0x3b0ff1[_0x0dd8('0x10')][_0x0dd8('0x11')]);return _0x424242(_0x3b0ff1[_0x0dd8('0x10')][_0x0dd8('0x11')]);}logger[_0x0dd8('0x10')](_0x0dd8('0xc'),_0x59f220,_0x3b0ff1[_0x0dd8('0x10')][_0x0dd8('0x11')]);return _0x142942(_0x3b0ff1[_0x0dd8('0x10')]['message']);}else{logger[_0x0dd8('0xb')](_0x0dd8('0xc'),_0x59f220,_0x0dd8('0xd'));_0x142942(_0x3b0ff1['result']['message']);}})[_0x0dd8('0x12')](function(_0xfe0600){logger[_0x0dd8('0x10')](_0x0dd8('0xc'),_0x59f220,_0xfe0600);_0x424242(_0xfe0600);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b1392c4..6f6b2a7 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(_0x37389e,_0x57c745){var _0x4466fc=function(_0x1d6af3){while(--_0x1d6af3){_0x37389e['push'](_0x37389e['shift']());}};_0x4466fc(++_0x57c745);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x1e0af6,_0x4f14f0){var _0x324087=function(_0x7d80d6){while(--_0x7d80d6){_0x1e0af6['push'](_0x1e0af6['shift']());}};_0x324087(++_0x4f14f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 bbc61ce..fecd242 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 _0xb62e=['STRING','name','TEXT','sequelize','exports'];(function(_0x15a579,_0x4645b8){var _0x1233a7=function(_0x576b88){while(--_0x576b88){_0x15a579['push'](_0x15a579['shift']());}};_0x1233a7(++_0x4645b8);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'name':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![],'unique':_0xeb62('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xeb62('0x4')]},'description':{'type':Sequelize[_0xeb62('0x2')]}}; \ No newline at end of file +var _0x7dc2=['name','TEXT','STRING'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x27dc('0x0')],'allowNull':![],'unique':_0x27dc('0x1')},'table':{'type':Sequelize[_0x27dc('0x0')]},'metric':{'type':Sequelize[_0x27dc('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ef09baa..de7c03f 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 _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x2cedc2,_0x2dcc2f){var _0x2e5407=function(_0x22224f){while(--_0x22224f){_0x2cedc2['push'](_0x2cedc2['shift']());}};_0x2e5407(++_0x2dcc2f);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x27a6c6,_0x2e19e5){_0x27a6c6=_0x27a6c6-0x0;var _0x11ee54=_0xd6d6[_0x27a6c6];return _0x11ee54;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));}; \ No newline at end of file +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(_0x40f690,_0x137b1f){var _0x180d61=function(_0x2b1e4a){while(--_0x2b1e4a){_0x40f690['push'](_0x40f690['shift']());}};_0x180d61(++_0x137b1f);}(_0x425d,0x1e0));var _0xd425=function(_0x46da41,_0x3ae289){_0x46da41=_0x46da41-0x0;var _0x121015=_0x425d[_0x46da41];return _0x121015;};'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 diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 9aad9ca..cedfa2a 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 _0xbbbd=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x2beb23,_0x1456a4){var _0x3757a3=function(_0x3318b8){while(--_0x3318b8){_0x2beb23['push'](_0x2beb23['shift']());}};_0x3757a3(++_0x1456a4);}(_0xbbbd,0x86));var _0xdbbb=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xbbbd[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var logger=require(_0xdbbb('0x2'))(_0xdbbb('0x3'));var moment=require(_0xdbbb('0x4'));var BPromise=require(_0xdbbb('0x5'));var rp=require(_0xdbbb('0x6'));var fs=require('fs');var path=require(_0xdbbb('0x7'));var rimraf=require(_0xdbbb('0x8'));var config=require(_0xdbbb('0x9'));var attributes=require(_0xdbbb('0xa'));module[_0xdbbb('0xb')]=function(_0x4e9523,_0xa5399d){return _0x4e9523[_0xdbbb('0xc')](_0xdbbb('0xd'),attributes,{'tableName':_0xdbbb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3714=['path','rimraf','../../config/environment','exports','define','analytics_metrics','lodash','util','api','moment','bluebird'];(function(_0x30234d,_0x400704){var _0x280160=function(_0x1cdbe2){while(--_0x1cdbe2){_0x30234d['push'](_0x30234d['shift']());}};_0x280160(++_0x400704);}(_0x3714,0x95));var _0x4371=function(_0x1aee91,_0x6a2982){_0x1aee91=_0x1aee91-0x0;var _0x335f89=_0x3714[_0x1aee91];return _0x335f89;};'use strict';var _=require(_0x4371('0x0'));var util=require(_0x4371('0x1'));var logger=require('../../config/logger')(_0x4371('0x2'));var moment=require(_0x4371('0x3'));var BPromise=require(_0x4371('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4371('0x5'));var rimraf=require(_0x4371('0x6'));var config=require(_0x4371('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x4371('0x8')]=function(_0x5650a7,_0x349031){return _0x5650a7[_0x4371('0x9')]('AnalyticMetric',attributes,{'tableName':_0x4371('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index bf7edeb..071b41b 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 _0x870c=['request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x307d15,_0x489b20){var _0x5cd39e=function(_0x58a7f8){while(--_0x58a7f8){_0x307d15['push'](_0x307d15['shift']());}};_0x5cd39e(++_0x489b20);}(_0x870c,0x11d));var _0xc870=function(_0xf9a939,_0x55f6c1){_0xf9a939=_0xf9a939-0x0;var _0x25c521=_0x870c[_0xf9a939];return _0x25c521;};'use strict';var _=require(_0xc870('0x0'));var util=require('util');var moment=require(_0xc870('0x1'));var BPromise=require(_0xc870('0x2'));var rs=require(_0xc870('0x3'));var fs=require('fs');var Redis=require(_0xc870('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc870('0x5'));var logger=require(_0xc870('0x6'))('rpc');var config=require(_0xc870('0x7'));var jayson=require(_0xc870('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x280a76,_0x418af7,_0x4dcc3f){return new BPromise(function(_0x54192b,_0x1d29ff){return client[_0xc870('0x9')](_0x280a76,_0x4dcc3f)[_0xc870('0xa')](function(_0x330eb4){logger[_0xc870('0xb')](_0xc870('0xc'),_0x418af7,'request\x20sent');logger[_0xc870('0xd')](_0xc870('0xe'),_0x418af7,'request\x20sent',JSON[_0xc870('0xf')](_0x330eb4));if(_0x330eb4[_0xc870('0x10')]){if(_0x330eb4[_0xc870('0x10')][_0xc870('0x11')]===0x1f4){logger['error'](_0xc870('0xc'),_0x418af7,_0x330eb4[_0xc870('0x10')][_0xc870('0x12')]);return _0x1d29ff(_0x330eb4[_0xc870('0x10')]['message']);}logger[_0xc870('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x418af7,_0x330eb4[_0xc870('0x10')][_0xc870('0x12')]);return _0x54192b(_0x330eb4[_0xc870('0x10')][_0xc870('0x12')]);}else{logger[_0xc870('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x418af7,_0xc870('0x13'));_0x54192b(_0x330eb4[_0xc870('0x14')][_0xc870('0x12')]);}})['catch'](function(_0x39124b){logger[_0xc870('0x10')](_0xc870('0xc'),_0x418af7,_0x39124b);_0x1d29ff(_0x39124b);});});} \ No newline at end of file +var _0xb897=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2051dd,_0x149c46){var _0x25770c=function(_0x5801d6){while(--_0x5801d6){_0x2051dd['push'](_0x2051dd['shift']());}};_0x25770c(++_0x149c46);}(_0xb897,0x8b));var _0x7b89=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xb897[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x7b89('0x0'));var util=require(_0x7b89('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b89('0x2'));var fs=require('fs');var Redis=require(_0x7b89('0x3'));var db=require(_0x7b89('0x4'))['db'];var utils=require(_0x7b89('0x5'));var logger=require(_0x7b89('0x6'))(_0x7b89('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b89('0x8'));var client=jayson['client'][_0x7b89('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36e144,_0x16b6b1,_0x703337){return new BPromise(function(_0x45dc8f,_0x548638){return client[_0x7b89('0xa')](_0x36e144,_0x703337)[_0x7b89('0xb')](function(_0x2ee8b4){logger[_0x7b89('0xc')](_0x7b89('0xd'),_0x16b6b1,_0x7b89('0xe'));logger[_0x7b89('0xf')](_0x7b89('0x10'),_0x16b6b1,_0x7b89('0xe'),JSON[_0x7b89('0x11')](_0x2ee8b4));if(_0x2ee8b4[_0x7b89('0x12')]){if(_0x2ee8b4[_0x7b89('0x12')][_0x7b89('0x13')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x16b6b1,_0x2ee8b4[_0x7b89('0x12')]['message']);return _0x548638(_0x2ee8b4['error']['message']);}logger[_0x7b89('0x12')](_0x7b89('0xd'),_0x16b6b1,_0x2ee8b4[_0x7b89('0x12')][_0x7b89('0x14')]);return _0x45dc8f(_0x2ee8b4[_0x7b89('0x12')][_0x7b89('0x14')]);}else{logger[_0x7b89('0xc')](_0x7b89('0xd'),_0x16b6b1,_0x7b89('0xe'));_0x45dc8f(_0x2ee8b4[_0x7b89('0x15')]['message']);}})[_0x7b89('0x16')](function(_0x374ef9){logger[_0x7b89('0x12')](_0x7b89('0xd'),_0x16b6b1,_0x374ef9);_0x548638(_0x374ef9);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d269a33..bb92341 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 _0xb7a7=['isAuthenticated','index','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4f1c8c,_0x20ccb4){var _0x4401af=function(_0x73d78c){while(--_0x73d78c){_0x4f1c8c['push'](_0x4f1c8c['shift']());}};_0x4401af(++_0x20ccb4);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x43f393,_0x59a35c){_0x43f393=_0x43f393-0x0;var _0x2e127b=_0xb7a7[_0x43f393];return _0x2e127b;};'use strict';var multer=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var path=require(_0x7b7a('0x2'));var timeout=require(_0x7b7a('0x3'));var express=require(_0x7b7a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b7a('0x5'));var interaction=require(_0x7b7a('0x6'));var config=require(_0x7b7a('0x7'));var controller=require('./analyticMetric.controller');router[_0x7b7a('0x8')]('/',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xa')]);router[_0x7b7a('0x8')](_0x7b7a('0xb'),auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xc')]);router[_0x7b7a('0xd')]('/',auth[_0x7b7a('0x9')](),controller['create']);router[_0x7b7a('0xe')]('/:id',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xf')]);router[_0x7b7a('0x10')](_0x7b7a('0xb'),auth[_0x7b7a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xad68=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports'];(function(_0x311b3f,_0x2d735a){var _0x5c3b79=function(_0x339e23){while(--_0x339e23){_0x311b3f['push'](_0x311b3f['shift']());}};_0x5c3b79(++_0x2d735a);}(_0xad68,0x100));var _0x8ad6=function(_0x46390e,_0x39d20f){_0x46390e=_0x46390e-0x0;var _0x4db91c=_0xad68[_0x46390e];return _0x4db91c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8ad6('0x0'));var timeout=require(_0x8ad6('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ad6('0x2'));var auth=require(_0x8ad6('0x3'));var interaction=require(_0x8ad6('0x4'));var config=require(_0x8ad6('0x5'));var controller=require(_0x8ad6('0x6'));router[_0x8ad6('0x7')]('/',auth[_0x8ad6('0x8')](),controller['index']);router[_0x8ad6('0x7')](_0x8ad6('0x9'),auth[_0x8ad6('0x8')](),controller[_0x8ad6('0xa')]);router[_0x8ad6('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8ad6('0xc')](_0x8ad6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8ad6('0xd')](_0x8ad6('0x9'),auth[_0x8ad6('0x8')](),controller[_0x8ad6('0xe')]);module[_0x8ad6('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index b5c6826..883546d 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 _0x4dac=['exports','TEXT','sequelize'];(function(_0x57b151,_0x5663d2){var _0x754317=function(_0x342737){while(--_0x342737){_0x57b151['push'](_0x57b151['shift']());}};_0x754317(++_0x5663d2);}(_0x4dac,0x1f4));var _0xc4da=function(_0xdd52b7,_0x4f630f){_0xdd52b7=_0xdd52b7-0x0;var _0x1057c2=_0x4dac[_0xdd52b7];return _0x1057c2;};'use strict';var Sequelize=require(_0xc4da('0x0'));module[_0xc4da('0x1')]={'tree':{'type':Sequelize[_0xc4da('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa65e=['TEXT','sequelize'];(function(_0xdec73b,_0x1790a7){var _0x169f7d=function(_0xf15fd4){while(--_0xf15fd4){_0xdec73b['push'](_0xdec73b['shift']());}};_0x169f7d(++_0x1790a7);}(_0xa65e,0x1df));var _0xea65=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0xa65e[_0x4ca333];return _0x13b2e1;};'use strict';var Sequelize=require(_0xea65('0x0'));module['exports']={'tree':{'type':Sequelize[_0xea65('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a7aa22b..dd4b1d8 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 _0x1a76=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','keys','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x11b58d,_0x555c55){var _0xc2811b=function(_0x396d22){while(--_0x396d22){_0x11b58d['push'](_0x11b58d['shift']());}};_0xc2811b(++_0x555c55);}(_0x1a76,0x185));var _0x61a7=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0x1a76[_0x31e584];return _0x5686d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61a7('0x0'));var zipdir=require(_0x61a7('0x1'));var jsonpatch=require(_0x61a7('0x2'));var rp=require('request-promise');var moment=require(_0x61a7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x61a7('0x4'));var util=require('util');var path=require(_0x61a7('0x5'));var sox=require('sox');var csv=require(_0x61a7('0x6'));var ejs=require(_0x61a7('0x7'));var fs=require('fs');var fs_extra=require(_0x61a7('0x8'));var _=require('lodash');var squel=require(_0x61a7('0x9'));var crypto=require(_0x61a7('0xa'));var jsforce=require(_0x61a7('0xb'));var deskjs=require(_0x61a7('0xc'));var toCsv=require(_0x61a7('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x61a7('0xd'));var qs=require(_0x61a7('0xe'));var as=require(_0x61a7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61a7('0x10'))(_0x61a7('0x11'));var utils=require(_0x61a7('0x12'));var config=require(_0x61a7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x489205,_0x47941b){_0x47941b=_0x47941b||0xcc;return function(_0xa8089e){if(_0xa8089e){return _0x489205[_0x61a7('0x14')](_0x47941b);}return _0x489205['status'](_0x47941b)['end']();};}function respondWithResult(_0x5ad4b8,_0x29dbc3){_0x29dbc3=_0x29dbc3||0xc8;return function(_0x5ae570){if(_0x5ae570){return _0x5ad4b8[_0x61a7('0x15')](_0x29dbc3)[_0x61a7('0x16')](_0x5ae570);}};}function respondWithFilteredResult(_0x4b3b6e,_0x35c2d1){return function(_0x40d419){if(_0x40d419){var _0x57ca4c=typeof _0x35c2d1[_0x61a7('0x17')]===_0x61a7('0x18')&&typeof _0x35c2d1[_0x61a7('0x19')]===_0x61a7('0x18');var _0x105c83=_0x40d419[_0x61a7('0x1a')];var _0x58d36c=_0x57ca4c?0x0:_0x35c2d1[_0x61a7('0x17')];var _0x388382=_0x57ca4c?_0x40d419[_0x61a7('0x1a')]:_0x35c2d1[_0x61a7('0x17')]+_0x35c2d1[_0x61a7('0x19')];var _0x3973c4;if(_0x388382>=_0x105c83){_0x388382=_0x105c83;_0x3973c4=0xc8;}else{_0x3973c4=0xce;}_0x4b3b6e[_0x61a7('0x15')](_0x3973c4);return _0x4b3b6e[_0x61a7('0x1b')](_0x61a7('0x1c'),_0x58d36c+'-'+_0x388382+'/'+_0x105c83)[_0x61a7('0x16')](_0x40d419);}return null;};}function patchUpdates(_0x31f688){return function(_0x172908){try{jsonpatch[_0x61a7('0x1d')](_0x172908,_0x31f688,!![]);}catch(_0x5fb53a){return BPromise[_0x61a7('0x1e')](_0x5fb53a);}return _0x172908[_0x61a7('0x1f')]();};}function saveUpdates(_0x5c53d9,_0x4d7b82){return function(_0x2c65da){if(_0x2c65da){return _0x2c65da[_0x61a7('0x20')](_0x5c53d9)[_0x61a7('0x21')](function(_0x4bfbdb){return _0x4bfbdb;});}return null;};}function removeEntity(_0x333665,_0x1d4f7e){return function(_0x2c12f4){if(_0x2c12f4){return _0x2c12f4[_0x61a7('0x22')]()[_0x61a7('0x21')](function(){_0x333665[_0x61a7('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2241fc,_0x531067){return function(_0x517101){if(!_0x517101){_0x2241fc[_0x61a7('0x14')](0x194);}return _0x517101;};}function handleError(_0x163a9e,_0x2423dd){_0x2423dd=_0x2423dd||0x1f4;return function(_0x2b5d5a){logger['error'](_0x2b5d5a[_0x61a7('0x23')]);if(_0x2b5d5a[_0x61a7('0x24')]){delete _0x2b5d5a['name'];}_0x163a9e[_0x61a7('0x15')](_0x2423dd)[_0x61a7('0x25')](_0x2b5d5a);};}exports['index']=function(_0x3529f1,_0x3ef591){var _0x347d9c={},_0xef0a71={},_0x503e45={'count':0x0,'rows':[]};var _0x1fa098=_[_0x61a7('0x26')](db[_0x61a7('0x27')][_0x61a7('0x28')],function(_0x57bfd2){return{'name':_0x57bfd2[_0x61a7('0x29')],'type':_0x57bfd2[_0x61a7('0x2a')][_0x61a7('0x2b')]};});_0xef0a71['model']=_[_0x61a7('0x26')](_0x1fa098,_0x61a7('0x24'));_0xef0a71[_0x61a7('0x2c')]=_['keys'](_0x3529f1[_0x61a7('0x2c')]);_0xef0a71[_0x61a7('0x2d')]=_[_0x61a7('0x2e')](_0xef0a71[_0x61a7('0x2f')],_0xef0a71[_0x61a7('0x2c')]);_0x347d9c['attributes']=_[_0x61a7('0x2e')](_0xef0a71[_0x61a7('0x2f')],qs['fields'](_0x3529f1['query'][_0x61a7('0x30')]));_0x347d9c[_0x61a7('0x31')]=_0x347d9c[_0x61a7('0x31')][_0x61a7('0x32')]?_0x347d9c[_0x61a7('0x31')]:_0xef0a71[_0x61a7('0x2f')];if(!_0x3529f1[_0x61a7('0x2c')]['hasOwnProperty'](_0x61a7('0x33'))){_0x347d9c['limit']=qs[_0x61a7('0x19')](_0x3529f1[_0x61a7('0x2c')][_0x61a7('0x19')]);_0x347d9c[_0x61a7('0x17')]=qs['offset'](_0x3529f1[_0x61a7('0x2c')][_0x61a7('0x17')]);}_0x347d9c['order']=qs[_0x61a7('0x34')](_0x3529f1[_0x61a7('0x2c')][_0x61a7('0x34')]);_0x347d9c['where']=qs[_0x61a7('0x2d')](_[_0x61a7('0x35')](_0x3529f1[_0x61a7('0x2c')],_0xef0a71[_0x61a7('0x2d')]),_0x1fa098);if(_0x3529f1[_0x61a7('0x2c')][_0x61a7('0x36')]){_0x347d9c[_0x61a7('0x37')]=_[_0x61a7('0x38')](_0x347d9c['where'],{'$or':_['map'](_0x1fa098,function(_0x21c6a9){if(_0x21c6a9['type']!=='VIRTUAL'){var _0xc87abb={};_0xc87abb[_0x21c6a9[_0x61a7('0x24')]]={'$like':'%'+_0x3529f1[_0x61a7('0x2c')][_0x61a7('0x36')]+'%'};return _0xc87abb;}})});}_0x347d9c=_[_0x61a7('0x38')]({},_0x347d9c,_0x3529f1[_0x61a7('0x39')]);var _0x5f2a42={'where':_0x347d9c[_0x61a7('0x37')]};return db[_0x61a7('0x27')][_0x61a7('0x1a')](_0x5f2a42)['then'](function(_0x22791d){_0x503e45['count']=_0x22791d;if(_0x3529f1[_0x61a7('0x2c')][_0x61a7('0x3a')]){_0x347d9c[_0x61a7('0x3b')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x61a7('0x3c')](_0x347d9c);})[_0x61a7('0x21')](function(_0x54bc6d){_0x503e45['rows']=_0x54bc6d;return _0x503e45;})['then'](respondWithFilteredResult(_0x3ef591,_0x347d9c))[_0x61a7('0x3d')](handleError(_0x3ef591,null));};exports[_0x61a7('0x3e')]=function(_0x555572,_0x5b5587){var _0x4b97ab={'raw':!![],'where':{'id':_0x555572[_0x61a7('0x3f')]['id']}},_0x2eb8e1={};_0x2eb8e1[_0x61a7('0x2f')]=_[_0x61a7('0x40')](db[_0x61a7('0x27')][_0x61a7('0x28')]);_0x2eb8e1[_0x61a7('0x2c')]=_[_0x61a7('0x40')](_0x555572[_0x61a7('0x2c')]);_0x2eb8e1[_0x61a7('0x2d')]=_[_0x61a7('0x2e')](_0x2eb8e1[_0x61a7('0x2f')],_0x2eb8e1['query']);_0x4b97ab['attributes']=_[_0x61a7('0x2e')](_0x2eb8e1[_0x61a7('0x2f')],qs[_0x61a7('0x30')](_0x555572[_0x61a7('0x2c')][_0x61a7('0x30')]));_0x4b97ab['attributes']=_0x4b97ab['attributes']['length']?_0x4b97ab[_0x61a7('0x31')]:_0x2eb8e1[_0x61a7('0x2f')];if(_0x555572[_0x61a7('0x2c')][_0x61a7('0x3a')]){_0x4b97ab[_0x61a7('0x3b')]=[{'all':!![]}];}_0x4b97ab=_[_0x61a7('0x38')]({},_0x4b97ab,_0x555572['options']);return db[_0x61a7('0x27')]['find'](_0x4b97ab)[_0x61a7('0x21')](handleEntityNotFound(_0x5b5587,null))['then'](respondWithResult(_0x5b5587,null))[_0x61a7('0x3d')](handleError(_0x5b5587,null));};exports[_0x61a7('0x41')]=function(_0x3d978a,_0x353335){return db[_0x61a7('0x27')]['create'](_0x3d978a[_0x61a7('0x42')],{})[_0x61a7('0x21')](respondWithResult(_0x353335,0xc9))['catch'](handleError(_0x353335,null));};exports[_0x61a7('0x20')]=function(_0x4abbb4,_0x2a8e29){if(_0x4abbb4[_0x61a7('0x42')]['id']){delete _0x4abbb4[_0x61a7('0x42')]['id'];}return db[_0x61a7('0x27')]['find']({'where':{'id':_0x4abbb4['params']['id']}})[_0x61a7('0x21')](handleEntityNotFound(_0x2a8e29,null))['then'](saveUpdates(_0x4abbb4['body'],null))[_0x61a7('0x21')](respondWithResult(_0x2a8e29,null))['catch'](handleError(_0x2a8e29,null));};exports['destroy']=function(_0x4f5a43,_0x41b8b9){return db[_0x61a7('0x27')]['find']({'where':{'id':_0x4f5a43[_0x61a7('0x3f')]['id']}})[_0x61a7('0x21')](handleEntityNotFound(_0x41b8b9,null))['then'](removeEntity(_0x41b8b9,null))['catch'](handleError(_0x41b8b9,null));}; \ No newline at end of file +var _0xd431=['where','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','save','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x4633fd,_0x2e8c16){var _0x1e8d7e=function(_0x3ee904){while(--_0x3ee904){_0x4633fd['push'](_0x4633fd['shift']());}};_0x1e8d7e(++_0x2e8c16);}(_0xd431,0x1c0));var _0x1d43=function(_0x2de0d1,_0x2bb5e2){_0x2de0d1=_0x2de0d1-0x0;var _0x1c1cae=_0xd431[_0x2de0d1];return _0x1c1cae;};'use strict';var emlformat=require(_0x1d43('0x0'));var rimraf=require(_0x1d43('0x1'));var zipdir=require(_0x1d43('0x2'));var jsonpatch=require(_0x1d43('0x3'));var rp=require('request-promise');var moment=require(_0x1d43('0x4'));var BPromise=require(_0x1d43('0x5'));var Mustache=require(_0x1d43('0x6'));var util=require('util');var path=require(_0x1d43('0x7'));var sox=require(_0x1d43('0x8'));var csv=require(_0x1d43('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d43('0xa'));var _=require('lodash');var squel=require(_0x1d43('0xb'));var crypto=require(_0x1d43('0xc'));var jsforce=require(_0x1d43('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d43('0xe'));var Papa=require(_0x1d43('0xf'));var Redis=require('ioredis');var authService=require(_0x1d43('0x10'));var qs=require(_0x1d43('0x11'));var as=require(_0x1d43('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d43('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1d43('0x14'));var licenseUtil=require(_0x1d43('0x15'));var db=require(_0x1d43('0x16'))['db'];function respondWithStatusCode(_0x113afb,_0x5f492a){_0x5f492a=_0x5f492a||0xcc;return function(_0x35beea){if(_0x35beea){return _0x113afb['sendStatus'](_0x5f492a);}return _0x113afb[_0x1d43('0x17')](_0x5f492a)[_0x1d43('0x18')]();};}function respondWithResult(_0x1e5c72,_0x33a77f){_0x33a77f=_0x33a77f||0xc8;return function(_0x4b5653){if(_0x4b5653){return _0x1e5c72['status'](_0x33a77f)[_0x1d43('0x19')](_0x4b5653);}};}function respondWithFilteredResult(_0x12fba3,_0x2c367e){return function(_0x1f4e47){if(_0x1f4e47){var _0x463a37=typeof _0x2c367e['offset']===_0x1d43('0x1a')&&typeof _0x2c367e[_0x1d43('0x1b')]===_0x1d43('0x1a');var _0x49f465=_0x1f4e47[_0x1d43('0x1c')];var _0x3d11fa=_0x463a37?0x0:_0x2c367e[_0x1d43('0x1d')];var _0x30b59f=_0x463a37?_0x1f4e47['count']:_0x2c367e['offset']+_0x2c367e[_0x1d43('0x1b')];var _0xc007d6;if(_0x30b59f>=_0x49f465){_0x30b59f=_0x49f465;_0xc007d6=0xc8;}else{_0xc007d6=0xce;}_0x12fba3[_0x1d43('0x17')](_0xc007d6);return _0x12fba3[_0x1d43('0x1e')]('Content-Range',_0x3d11fa+'-'+_0x30b59f+'/'+_0x49f465)[_0x1d43('0x19')](_0x1f4e47);}return null;};}function patchUpdates(_0xd849bf){return function(_0x1e9060){try{jsonpatch['apply'](_0x1e9060,_0xd849bf,!![]);}catch(_0x41da9c){return BPromise['reject'](_0x41da9c);}return _0x1e9060[_0x1d43('0x1f')]();};}function saveUpdates(_0x205749,_0x46a5ee){return function(_0x31bd7e){if(_0x31bd7e){return _0x31bd7e['update'](_0x205749)[_0x1d43('0x20')](function(_0x4b64b2){return _0x4b64b2;});}return null;};}function removeEntity(_0x54917c,_0x3104f5){return function(_0x5f00c2){if(_0x5f00c2){return _0x5f00c2[_0x1d43('0x21')]()[_0x1d43('0x20')](function(){_0x54917c[_0x1d43('0x17')](0xcc)[_0x1d43('0x18')]();});}};}function handleEntityNotFound(_0x4ffa1e,_0x245282){return function(_0x27b6d4){if(!_0x27b6d4){_0x4ffa1e[_0x1d43('0x22')](0x194);}return _0x27b6d4;};}function handleError(_0x48ffab,_0x22e970){_0x22e970=_0x22e970||0x1f4;return function(_0xd28dd5){logger[_0x1d43('0x23')](_0xd28dd5[_0x1d43('0x24')]);if(_0xd28dd5[_0x1d43('0x25')]){delete _0xd28dd5[_0x1d43('0x25')];}_0x48ffab[_0x1d43('0x17')](_0x22e970)[_0x1d43('0x26')](_0xd28dd5);};}exports[_0x1d43('0x27')]=function(_0x781c65,_0x18eb21){var _0x3fe1a4={},_0x57721b={},_0x2f19a6={'count':0x0,'rows':[]};var _0x4e3456=_[_0x1d43('0x28')](db[_0x1d43('0x29')][_0x1d43('0x2a')],function(_0xe747c6){return{'name':_0xe747c6[_0x1d43('0x2b')],'type':_0xe747c6[_0x1d43('0x2c')][_0x1d43('0x2d')]};});_0x57721b[_0x1d43('0x2e')]=_[_0x1d43('0x28')](_0x4e3456,'name');_0x57721b[_0x1d43('0x2f')]=_[_0x1d43('0x30')](_0x781c65[_0x1d43('0x2f')]);_0x57721b['filters']=_['intersection'](_0x57721b[_0x1d43('0x2e')],_0x57721b['query']);_0x3fe1a4[_0x1d43('0x31')]=_[_0x1d43('0x32')](_0x57721b[_0x1d43('0x2e')],qs[_0x1d43('0x33')](_0x781c65[_0x1d43('0x2f')]['fields']));_0x3fe1a4[_0x1d43('0x31')]=_0x3fe1a4[_0x1d43('0x31')][_0x1d43('0x34')]?_0x3fe1a4[_0x1d43('0x31')]:_0x57721b[_0x1d43('0x2e')];if(!_0x781c65[_0x1d43('0x2f')][_0x1d43('0x35')]('nolimit')){_0x3fe1a4[_0x1d43('0x1b')]=qs[_0x1d43('0x1b')](_0x781c65[_0x1d43('0x2f')]['limit']);_0x3fe1a4['offset']=qs[_0x1d43('0x1d')](_0x781c65[_0x1d43('0x2f')][_0x1d43('0x1d')]);}_0x3fe1a4[_0x1d43('0x36')]=qs[_0x1d43('0x37')](_0x781c65[_0x1d43('0x2f')]['sort']);_0x3fe1a4[_0x1d43('0x38')]=qs['filters'](_['pick'](_0x781c65[_0x1d43('0x2f')],_0x57721b[_0x1d43('0x39')]),_0x4e3456);if(_0x781c65[_0x1d43('0x2f')][_0x1d43('0x3a')]){_0x3fe1a4['where']=_[_0x1d43('0x3b')](_0x3fe1a4[_0x1d43('0x38')],{'$or':_[_0x1d43('0x28')](_0x4e3456,function(_0x1524f6){if(_0x1524f6['type']!==_0x1d43('0x3c')){var _0x4fb11d={};_0x4fb11d[_0x1524f6[_0x1d43('0x25')]]={'$like':'%'+_0x781c65['query'][_0x1d43('0x3a')]+'%'};return _0x4fb11d;}})});}_0x3fe1a4=_['merge']({},_0x3fe1a4,_0x781c65[_0x1d43('0x3d')]);var _0x259b2f={'where':_0x3fe1a4['where']};return db[_0x1d43('0x29')][_0x1d43('0x1c')](_0x259b2f)[_0x1d43('0x20')](function(_0x5ae149){_0x2f19a6[_0x1d43('0x1c')]=_0x5ae149;if(_0x781c65[_0x1d43('0x2f')]['includeAll']){_0x3fe1a4['include']=[{'all':!![]}];}return db[_0x1d43('0x29')][_0x1d43('0x3e')](_0x3fe1a4);})[_0x1d43('0x20')](function(_0x5268f7){_0x2f19a6[_0x1d43('0x3f')]=_0x5268f7;return _0x2f19a6;})[_0x1d43('0x20')](respondWithFilteredResult(_0x18eb21,_0x3fe1a4))[_0x1d43('0x40')](handleError(_0x18eb21,null));};exports[_0x1d43('0x41')]=function(_0x35a033,_0x5ee0f1){var _0x43cb5c={'raw':!![],'where':{'id':_0x35a033[_0x1d43('0x42')]['id']}},_0x46f6ca={};_0x46f6ca['model']=_[_0x1d43('0x30')](db[_0x1d43('0x29')][_0x1d43('0x2a')]);_0x46f6ca[_0x1d43('0x2f')]=_['keys'](_0x35a033[_0x1d43('0x2f')]);_0x46f6ca[_0x1d43('0x39')]=_[_0x1d43('0x32')](_0x46f6ca['model'],_0x46f6ca[_0x1d43('0x2f')]);_0x43cb5c[_0x1d43('0x31')]=_[_0x1d43('0x32')](_0x46f6ca['model'],qs[_0x1d43('0x33')](_0x35a033[_0x1d43('0x2f')][_0x1d43('0x33')]));_0x43cb5c['attributes']=_0x43cb5c[_0x1d43('0x31')][_0x1d43('0x34')]?_0x43cb5c[_0x1d43('0x31')]:_0x46f6ca[_0x1d43('0x2e')];if(_0x35a033[_0x1d43('0x2f')][_0x1d43('0x43')]){_0x43cb5c[_0x1d43('0x44')]=[{'all':!![]}];}_0x43cb5c=_['merge']({},_0x43cb5c,_0x35a033[_0x1d43('0x3d')]);return db[_0x1d43('0x29')][_0x1d43('0x45')](_0x43cb5c)[_0x1d43('0x20')](handleEntityNotFound(_0x5ee0f1,null))[_0x1d43('0x20')](respondWithResult(_0x5ee0f1,null))[_0x1d43('0x40')](handleError(_0x5ee0f1,null));};exports['create']=function(_0x1d0de,_0x5a5eac){return db[_0x1d43('0x29')]['create'](_0x1d0de[_0x1d43('0x46')],{})[_0x1d43('0x20')](respondWithResult(_0x5a5eac,0xc9))[_0x1d43('0x40')](handleError(_0x5a5eac,null));};exports[_0x1d43('0x47')]=function(_0x51ba76,_0x328faf){if(_0x51ba76[_0x1d43('0x46')]['id']){delete _0x51ba76[_0x1d43('0x46')]['id'];}return db[_0x1d43('0x29')]['find']({'where':{'id':_0x51ba76[_0x1d43('0x42')]['id']}})[_0x1d43('0x20')](handleEntityNotFound(_0x328faf,null))[_0x1d43('0x20')](saveUpdates(_0x51ba76[_0x1d43('0x46')],null))[_0x1d43('0x20')](respondWithResult(_0x328faf,null))[_0x1d43('0x40')](handleError(_0x328faf,null));};exports[_0x1d43('0x21')]=function(_0x5ef171,_0x5548da){return db[_0x1d43('0x29')][_0x1d43('0x45')]({'where':{'id':_0x5ef171[_0x1d43('0x42')]['id']}})['then'](handleEntityNotFound(_0x5548da,null))[_0x1d43('0x20')](removeEntity(_0x5548da,null))[_0x1d43('0x40')](handleError(_0x5548da,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 0cec3bc..ff4821a 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 _0x2e45=['exports','define','analytics_report_trees','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x37e6e2,_0x7bdacf){var _0x4b4381=function(_0x3dcf6e){while(--_0x3dcf6e){_0x37e6e2['push'](_0x37e6e2['shift']());}};_0x4b4381(++_0x7bdacf);}(_0x2e45,0x153));var _0x52e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x52e4('0x0'));var util=require('util');var logger=require(_0x52e4('0x1'))(_0x52e4('0x2'));var moment=require(_0x52e4('0x3'));var BPromise=require('bluebird');var rp=require(_0x52e4('0x4'));var fs=require('fs');var path=require(_0x52e4('0x5'));var rimraf=require(_0x52e4('0x6'));var config=require(_0x52e4('0x7'));var attributes=require(_0x52e4('0x8'));module[_0x52e4('0x9')]=function(_0x1af10c,_0x20a866){return _0x1af10c[_0x52e4('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x52e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x727f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x26f518,_0x5a6c2d){var _0x3666d=function(_0x38ef7f){while(--_0x38ef7f){_0x26f518['push'](_0x26f518['shift']());}};_0x3666d(++_0x5a6c2d);}(_0x727f,0x1d4));var _0xf727=function(_0x111fe0,_0x563f9b){_0x111fe0=_0x111fe0-0x0;var _0x2058cf=_0x727f[_0x111fe0];return _0x2058cf;};'use strict';var _=require(_0xf727('0x0'));var util=require(_0xf727('0x1'));var logger=require(_0xf727('0x2'))(_0xf727('0x3'));var moment=require(_0xf727('0x4'));var BPromise=require(_0xf727('0x5'));var rp=require(_0xf727('0x6'));var fs=require('fs');var path=require(_0xf727('0x7'));var rimraf=require(_0xf727('0x8'));var config=require('../../config/environment');var attributes=require(_0xf727('0x9'));module[_0xf727('0xa')]=function(_0xef7b89,_0x16545c){return _0xef7b89[_0xf727('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xf727('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 8c662e6..dc26783 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x630729,_0x30e322){var _0x59b166=function(_0x4d4d76){while(--_0x4d4d76){_0x630729['push'](_0x630729['shift']());}};_0x59b166(++_0x30e322);}(_0x5f2f,0x73));var _0xf5f2=function(_0x188ee8,_0x47c6cc){_0x188ee8=_0x188ee8-0x0;var _0x2567a7=_0x5f2f[_0x188ee8];return _0x2567a7;};'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')]('AnalyticTreeReport,\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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0xfb7bc0,_0x44ef58){var _0x40b7ee=function(_0x13545b){while(--_0x13545b){_0xfb7bc0['push'](_0xfb7bc0['shift']());}};_0x40b7ee(++_0x44ef58);}(_0x1261,0x144));var _0x1126=function(_0x2c1ddd,_0x2a667f){_0x2c1ddd=_0x2c1ddd-0x0;var _0x49fa39=_0x1261[_0x2c1ddd];return _0x49fa39;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index ecd081d..2b7e93b 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 _0x42b8=['post','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0x42b8,0x148));var _0x842b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x42b8[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x842b('0x0'));var util=require(_0x842b('0x1'));var path=require(_0x842b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x842b('0x3')]();var fs_extra=require(_0x842b('0x4'));var auth=require(_0x842b('0x5'));var interaction=require(_0x842b('0x6'));var config=require(_0x842b('0x7'));var controller=require(_0x842b('0x8'));router['get']('/',auth[_0x842b('0x9')](),controller[_0x842b('0xa')]);router[_0x842b('0xb')](_0x842b('0xc'),auth['isAuthenticated'](),controller[_0x842b('0xd')]);router[_0x842b('0xe')]('/',auth[_0x842b('0x9')](),controller['create']);router['put'](_0x842b('0xc'),auth['isAuthenticated'](),controller[_0x842b('0xf')]);router[_0x842b('0x10')](_0x842b('0xc'),auth[_0x842b('0x9')](),controller[_0x842b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7067=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports'];(function(_0x1020e7,_0x3c9021){var _0xa0d26=function(_0x564ce3){while(--_0x564ce3){_0x1020e7['push'](_0x1020e7['shift']());}};_0xa0d26(++_0x3c9021);}(_0x7067,0x165));var _0x7706=function(_0x25468a,_0x50824f){_0x25468a=_0x25468a-0x0;var _0x48e537=_0x7067[_0x25468a];return _0x48e537;};'use strict';var multer=require(_0x7706('0x0'));var util=require('util');var path=require(_0x7706('0x1'));var timeout=require(_0x7706('0x2'));var express=require(_0x7706('0x3'));var router=express[_0x7706('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7706('0x5'));var config=require(_0x7706('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x7706('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7706('0x7')](_0x7706('0x8'),auth[_0x7706('0x9')](),controller[_0x7706('0xa')]);router[_0x7706('0xb')]('/',auth[_0x7706('0x9')](),controller[_0x7706('0xc')]);router['put'](_0x7706('0x8'),auth['isAuthenticated'](),controller[_0x7706('0xd')]);router[_0x7706('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7706('0xf')]);module[_0x7706('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 8ea0d2f..4fa5bfa 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 _0x16e4=['STRING','sequelize','exports'];(function(_0x4112e8,_0x250a21){var _0x3d1c36=function(_0x110409){while(--_0x110409){_0x4112e8['push'](_0x4112e8['shift']());}};_0x3d1c36(++_0x250a21);}(_0x16e4,0x97));var _0x416e=function(_0x2ca053,_0x5bf6f4){_0x2ca053=_0x2ca053-0x0;var _0x42e436=_0x16e4[_0x2ca053];return _0x42e436;};'use strict';var Sequelize=require(_0x416e('0x0'));module[_0x416e('0x1')]={'name':{'type':Sequelize[_0x416e('0x2')]},'basename':{'type':Sequelize[_0x416e('0x2')]},'type':{'type':Sequelize[_0x416e('0x2')]}}; \ No newline at end of file +var _0xac31=['STRING','sequelize','exports'];(function(_0x1d55fb,_0x363aec){var _0x1199c2=function(_0x49c5a2){while(--_0x49c5a2){_0x1d55fb['push'](_0x1d55fb['shift']());}};_0x1199c2(++_0x363aec);}(_0xac31,0xca));var _0x1ac3=function(_0x5b4df3,_0x2f604b){_0x5b4df3=_0x5b4df3-0x0;var _0x317deb=_0xac31[_0x5b4df3];return _0x317deb;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'name':{'type':Sequelize[_0x1ac3('0x2')]},'basename':{'type':Sequelize[_0x1ac3('0x2')]},'type':{'type':Sequelize[_0x1ac3('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f3bd12e..06777d5 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 _0xb4e5=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','type','VIRTUAL','Attachment','includeAll','findAll','catch','show','rawAttributes','include','merge','options','find','get','createdAt','updatedAt','body','omit','create','params','originalname','basename','file','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download'];(function(_0x52daea,_0xa2df7e){var _0x16c531=function(_0x197ecb){while(--_0x197ecb){_0x52daea['push'](_0x52daea['shift']());}};_0x16c531(++_0xa2df7e);}(_0xb4e5,0x178));var _0x5b4e=function(_0x5b5022,_0x15dbb8){_0x5b5022=_0x5b5022-0x0;var _0x404f2d=_0xb4e5[_0x5b5022];return _0x404f2d;};'use strict';var emlformat=require(_0x5b4e('0x0'));var rimraf=require(_0x5b4e('0x1'));var zipdir=require(_0x5b4e('0x2'));var jsonpatch=require(_0x5b4e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b4e('0x4'));var Mustache=require(_0x5b4e('0x5'));var util=require(_0x5b4e('0x6'));var path=require(_0x5b4e('0x7'));var sox=require(_0x5b4e('0x8'));var csv=require('to-csv');var ejs=require(_0x5b4e('0x9'));var fs=require('fs');var fs_extra=require(_0x5b4e('0xa'));var _=require(_0x5b4e('0xb'));var squel=require(_0x5b4e('0xc'));var crypto=require(_0x5b4e('0xd'));var jsforce=require(_0x5b4e('0xe'));var deskjs=require(_0x5b4e('0xf'));var toCsv=require(_0x5b4e('0x10'));var querystring=require('querystring');var Papa=require(_0x5b4e('0x11'));var Redis=require(_0x5b4e('0x12'));var authService=require(_0x5b4e('0x13'));var qs=require(_0x5b4e('0x14'));var as=require(_0x5b4e('0x15'));var hardwareService=require(_0x5b4e('0x16'));var logger=require('../../config/logger')(_0x5b4e('0x17'));var utils=require(_0x5b4e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5b4e('0x19'));var db=require(_0x5b4e('0x1a'))['db'];function respondWithStatusCode(_0x58313c,_0x31f961){_0x31f961=_0x31f961||0xcc;return function(_0xf0e1ab){if(_0xf0e1ab){return _0x58313c[_0x5b4e('0x1b')](_0x31f961);}return _0x58313c[_0x5b4e('0x1c')](_0x31f961)[_0x5b4e('0x1d')]();};}function respondWithResult(_0xa77e26,_0x42e52e){_0x42e52e=_0x42e52e||0xc8;return function(_0x49d1fe){if(_0x49d1fe){return _0xa77e26[_0x5b4e('0x1c')](_0x42e52e)[_0x5b4e('0x1e')](_0x49d1fe);}};}function respondWithFilteredResult(_0xbdd4c9,_0x21a2cf){return function(_0x335c09){if(_0x335c09){var _0x41546c=typeof _0x21a2cf['offset']===_0x5b4e('0x1f')&&typeof _0x21a2cf[_0x5b4e('0x20')]==='undefined';var _0x2b02ef=_0x335c09[_0x5b4e('0x21')];var _0x4269b8=_0x41546c?0x0:_0x21a2cf[_0x5b4e('0x22')];var _0x524be5=_0x41546c?_0x335c09['count']:_0x21a2cf['offset']+_0x21a2cf[_0x5b4e('0x20')];var _0x5a6ea6;if(_0x524be5>=_0x2b02ef){_0x524be5=_0x2b02ef;_0x5a6ea6=0xc8;}else{_0x5a6ea6=0xce;}_0xbdd4c9[_0x5b4e('0x1c')](_0x5a6ea6);return _0xbdd4c9[_0x5b4e('0x23')](_0x5b4e('0x24'),_0x4269b8+'-'+_0x524be5+'/'+_0x2b02ef)[_0x5b4e('0x1e')](_0x335c09);}return null;};}function patchUpdates(_0x14ebdd){return function(_0x1a1310){try{jsonpatch[_0x5b4e('0x25')](_0x1a1310,_0x14ebdd,!![]);}catch(_0x474bfa){return BPromise[_0x5b4e('0x26')](_0x474bfa);}return _0x1a1310[_0x5b4e('0x27')]();};}function saveUpdates(_0x569fe5,_0x2f2bd0){return function(_0x37de99){if(_0x37de99){return _0x37de99[_0x5b4e('0x28')](_0x569fe5)[_0x5b4e('0x29')](function(_0x1a34fb){return _0x1a34fb;});}return null;};}function removeEntity(_0x3706b7,_0x2370c0){return function(_0x6d3ac4){if(_0x6d3ac4){return _0x6d3ac4[_0x5b4e('0x2a')]()[_0x5b4e('0x29')](function(){_0x3706b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c019d,_0x3ea504){return function(_0x25c740){if(!_0x25c740){_0x1c019d['sendStatus'](0x194);}return _0x25c740;};}function handleError(_0xc6b2a6,_0x18ade2){_0x18ade2=_0x18ade2||0x1f4;return function(_0x38b4a3){logger[_0x5b4e('0x2b')](_0x38b4a3['stack']);if(_0x38b4a3[_0x5b4e('0x2c')]){delete _0x38b4a3[_0x5b4e('0x2c')];}_0xc6b2a6['status'](_0x18ade2)[_0x5b4e('0x2d')](_0x38b4a3);};}exports[_0x5b4e('0x2e')]=function(_0xdbd539,_0x2f38cd){var _0x3623bd={},_0x4c5c7a={},_0x2e73c1={'count':0x0,'rows':[]};var _0x3c3d8b=_[_0x5b4e('0x2f')](db['Attachment']['rawAttributes'],function(_0x26a42d){return{'name':_0x26a42d[_0x5b4e('0x30')],'type':_0x26a42d['type'][_0x5b4e('0x31')]};});_0x4c5c7a[_0x5b4e('0x32')]=_[_0x5b4e('0x2f')](_0x3c3d8b,'name');_0x4c5c7a['query']=_[_0x5b4e('0x33')](_0xdbd539[_0x5b4e('0x34')]);_0x4c5c7a[_0x5b4e('0x35')]=_[_0x5b4e('0x36')](_0x4c5c7a[_0x5b4e('0x32')],_0x4c5c7a[_0x5b4e('0x34')]);_0x3623bd[_0x5b4e('0x37')]=_[_0x5b4e('0x36')](_0x4c5c7a['model'],qs[_0x5b4e('0x38')](_0xdbd539[_0x5b4e('0x34')]['fields']));_0x3623bd[_0x5b4e('0x37')]=_0x3623bd[_0x5b4e('0x37')][_0x5b4e('0x39')]?_0x3623bd[_0x5b4e('0x37')]:_0x4c5c7a[_0x5b4e('0x32')];if(!_0xdbd539[_0x5b4e('0x34')][_0x5b4e('0x3a')](_0x5b4e('0x3b'))){_0x3623bd[_0x5b4e('0x20')]=qs[_0x5b4e('0x20')](_0xdbd539['query'][_0x5b4e('0x20')]);_0x3623bd[_0x5b4e('0x22')]=qs[_0x5b4e('0x22')](_0xdbd539['query'][_0x5b4e('0x22')]);}_0x3623bd[_0x5b4e('0x3c')]=qs['sort'](_0xdbd539[_0x5b4e('0x34')]['sort']);_0x3623bd['where']=qs['filters'](_[_0x5b4e('0x3d')](_0xdbd539[_0x5b4e('0x34')],_0x4c5c7a[_0x5b4e('0x35')]),_0x3c3d8b);if(_0xdbd539[_0x5b4e('0x34')]['filter']){_0x3623bd[_0x5b4e('0x3e')]=_['merge'](_0x3623bd[_0x5b4e('0x3e')],{'$or':_[_0x5b4e('0x2f')](_0x3c3d8b,function(_0x5e88d9){if(_0x5e88d9[_0x5b4e('0x3f')]!==_0x5b4e('0x40')){var _0x1592fb={};_0x1592fb[_0x5e88d9['name']]={'$like':'%'+_0xdbd539['query']['filter']+'%'};return _0x1592fb;}})});}_0x3623bd=_['merge']({},_0x3623bd,_0xdbd539['options']);var _0x505760={'where':_0x3623bd[_0x5b4e('0x3e')]};return db[_0x5b4e('0x41')]['count'](_0x505760)[_0x5b4e('0x29')](function(_0x5baeeb){_0x2e73c1[_0x5b4e('0x21')]=_0x5baeeb;if(_0xdbd539['query'][_0x5b4e('0x42')]){_0x3623bd['include']=[{'all':!![]}];}return db['Attachment'][_0x5b4e('0x43')](_0x3623bd);})[_0x5b4e('0x29')](function(_0x131531){_0x2e73c1['rows']=_0x131531;return _0x2e73c1;})[_0x5b4e('0x29')](respondWithFilteredResult(_0x2f38cd,_0x3623bd))[_0x5b4e('0x44')](handleError(_0x2f38cd,null));};exports[_0x5b4e('0x45')]=function(_0x37a862,_0x3c990c){var _0x445df2={'raw':!![],'where':{'id':_0x37a862['params']['id']}},_0x24f233={};_0x24f233[_0x5b4e('0x32')]=_[_0x5b4e('0x33')](db[_0x5b4e('0x41')][_0x5b4e('0x46')]);_0x24f233[_0x5b4e('0x34')]=_[_0x5b4e('0x33')](_0x37a862['query']);_0x24f233[_0x5b4e('0x35')]=_[_0x5b4e('0x36')](_0x24f233[_0x5b4e('0x32')],_0x24f233[_0x5b4e('0x34')]);_0x445df2[_0x5b4e('0x37')]=_['intersection'](_0x24f233[_0x5b4e('0x32')],qs[_0x5b4e('0x38')](_0x37a862[_0x5b4e('0x34')]['fields']));_0x445df2[_0x5b4e('0x37')]=_0x445df2[_0x5b4e('0x37')][_0x5b4e('0x39')]?_0x445df2[_0x5b4e('0x37')]:_0x24f233[_0x5b4e('0x32')];if(_0x37a862['query']['includeAll']){_0x445df2[_0x5b4e('0x47')]=[{'all':!![]}];}_0x445df2=_[_0x5b4e('0x48')]({},_0x445df2,_0x37a862[_0x5b4e('0x49')]);return db[_0x5b4e('0x41')][_0x5b4e('0x4a')](_0x445df2)[_0x5b4e('0x29')](handleEntityNotFound(_0x3c990c,null))[_0x5b4e('0x29')](respondWithResult(_0x3c990c,null))[_0x5b4e('0x44')](handleError(_0x3c990c,null));};exports['clone']=function(_0x23de2e,_0x4b6e21){var _0x4c82c5={'where':{'id':_0x23de2e['params']['id']}},_0x46f420={};_0x46f420[_0x5b4e('0x32')]=_[_0x5b4e('0x33')](db[_0x5b4e('0x41')][_0x5b4e('0x46')]);_0x4c82c5[_0x5b4e('0x37')]=_[_0x5b4e('0x36')](_0x46f420[_0x5b4e('0x32')],qs[_0x5b4e('0x38')](_0x23de2e['query']['fields']));_0x4c82c5[_0x5b4e('0x37')]=_0x4c82c5['attributes'][_0x5b4e('0x39')]?_0x4c82c5[_0x5b4e('0x37')]:_0x46f420[_0x5b4e('0x32')];if(_0x23de2e[_0x5b4e('0x34')]['includeAll']){_0x4c82c5['include']=[{'all':!![]}];}_0x4c82c5=_[_0x5b4e('0x48')]({},_0x4c82c5,_0x23de2e[_0x5b4e('0x49')]);return db[_0x5b4e('0x41')][_0x5b4e('0x4a')](_0x4c82c5)['then'](handleEntityNotFound(_0x4b6e21,null))[_0x5b4e('0x29')](function(_0x37e690){if(_0x37e690){var _0x506510=_0x37e690[_0x5b4e('0x4b')]({'plain':!![]});_0x506510=qs['omit'](_0x506510,['id',_0x5b4e('0x4c'),_0x5b4e('0x4d')]);_0x23de2e[_0x5b4e('0x4e')]=_[_0x5b4e('0x4f')](_0x23de2e['body'],['id',_0x5b4e('0x4c'),'updatedAt']);return db[_0x5b4e('0x41')][_0x5b4e('0x50')](_[_0x5b4e('0x48')](_0x506510,_0x23de2e['body']),{'include':_0x23de2e['query'][_0x5b4e('0x42')]?[{'all':!![]}]:undefined});}})[_0x5b4e('0x29')](respondWithResult(_0x4b6e21,0xc9))[_0x5b4e('0x44')](handleError(_0x4b6e21,null));};exports[_0x5b4e('0x28')]=function(_0x4440cd,_0x421181){if(_0x4440cd[_0x5b4e('0x4e')]['id']){delete _0x4440cd['body']['id'];}return db['Attachment'][_0x5b4e('0x4a')]({'where':{'id':_0x4440cd[_0x5b4e('0x51')]['id']}})[_0x5b4e('0x29')](handleEntityNotFound(_0x421181,null))[_0x5b4e('0x29')](saveUpdates(_0x4440cd[_0x5b4e('0x4e')],null))[_0x5b4e('0x29')](respondWithResult(_0x421181,null))[_0x5b4e('0x44')](handleError(_0x421181,null));};exports[_0x5b4e('0x2a')]=function(_0x37403b,_0x136e31){return db[_0x5b4e('0x41')][_0x5b4e('0x4a')]({'where':{'id':_0x37403b[_0x5b4e('0x51')]['id']}})[_0x5b4e('0x29')](handleEntityNotFound(_0x136e31,null))['then'](removeEntity(_0x136e31,null))['catch'](handleError(_0x136e31,null));};exports[_0x5b4e('0x50')]=function(_0x1ad6d4,_0x9fbdd0,_0xbbb30a){_0x1ad6d4['body'][_0x5b4e('0x2c')]=_0x1ad6d4['file'][_0x5b4e('0x52')];_0x1ad6d4[_0x5b4e('0x4e')][_0x5b4e('0x53')]=_0x1ad6d4[_0x5b4e('0x54')][_0x5b4e('0x55')];_0x1ad6d4['body'][_0x5b4e('0x3f')]=_0x1ad6d4[_0x5b4e('0x54')][_0x5b4e('0x56')];return db[_0x5b4e('0x41')][_0x5b4e('0x50')](_0x1ad6d4[_0x5b4e('0x4e')])[_0x5b4e('0x29')](respondWithResult(_0x9fbdd0,0xc9))[_0x5b4e('0x44')](handleError(_0x9fbdd0,null));};exports['download']=function(_0x14a5d8,_0xed9e63,_0x3ca7fd){return db['Attachment'][_0x5b4e('0x57')]({'where':{'id':_0x14a5d8['params']['id']},'raw':!![]})[_0x5b4e('0x29')](handleEntityNotFound(_0xed9e63,null))[_0x5b4e('0x29')](function(_0x7b379a){if(_0x7b379a){var _0x1250bb=_0x7b379a[_0x5b4e('0x58')]!==null;var _0x2b7514=path[_0x5b4e('0x59')](config[_0x5b4e('0x5a')],_0x5b4e('0x5b'));if(_0x1250bb){_0x2b7514=path[_0x5b4e('0x59')](_0x2b7514,_0x5b4e('0x5c'));}var _0x342249=path[_0x5b4e('0x59')](_0x2b7514,_0x7b379a[_0x5b4e('0x53')]);return _0xed9e63[_0x5b4e('0x5d')](_0x342249);}})[_0x5b4e('0x44')](handleError(_0xed9e63,null));}; \ No newline at end of file +var _0x0a16=['Attachment','rawAttributes','fieldName','type','model','map','keys','filters','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','clone','get','omit','updatedAt','body','update','file','originalname','basename','filename','create','findOne','ChatOfflineMessageId','join','offline-chat/','download','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0a16,0x1d6));var _0x60a1=function(_0x407f78,_0x390898){_0x407f78=_0x407f78-0x0;var _0x2d9102=_0x0a16[_0x407f78];return _0x2d9102;};'use strict';var emlformat=require(_0x60a1('0x0'));var rimraf=require(_0x60a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x60a1('0x2'));var BPromise=require(_0x60a1('0x3'));var Mustache=require(_0x60a1('0x4'));var util=require(_0x60a1('0x5'));var path=require('path');var sox=require(_0x60a1('0x6'));var csv=require(_0x60a1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x60a1('0x8'));var _=require(_0x60a1('0x9'));var squel=require(_0x60a1('0xa'));var crypto=require(_0x60a1('0xb'));var jsforce=require(_0x60a1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x60a1('0x7'));var querystring=require(_0x60a1('0xd'));var Papa=require(_0x60a1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x60a1('0xf'));var hardwareService=require(_0x60a1('0x10'));var logger=require(_0x60a1('0x11'))(_0x60a1('0x12'));var utils=require('../../config/utils');var config=require(_0x60a1('0x13'));var licenseUtil=require(_0x60a1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24399c,_0x3e3b85){_0x3e3b85=_0x3e3b85||0xcc;return function(_0x1f2ac3){if(_0x1f2ac3){return _0x24399c[_0x60a1('0x15')](_0x3e3b85);}return _0x24399c[_0x60a1('0x16')](_0x3e3b85)[_0x60a1('0x17')]();};}function respondWithResult(_0x457ebb,_0x5d9b21){_0x5d9b21=_0x5d9b21||0xc8;return function(_0x2d8f37){if(_0x2d8f37){return _0x457ebb[_0x60a1('0x16')](_0x5d9b21)[_0x60a1('0x18')](_0x2d8f37);}};}function respondWithFilteredResult(_0x44795a,_0x1fe8fe){return function(_0x54393c){if(_0x54393c){var _0xaf6491=typeof _0x1fe8fe[_0x60a1('0x19')]==='undefined'&&typeof _0x1fe8fe[_0x60a1('0x1a')]==='undefined';var _0x5f4e22=_0x54393c['count'];var _0x3cca6a=_0xaf6491?0x0:_0x1fe8fe['offset'];var _0x139ac4=_0xaf6491?_0x54393c[_0x60a1('0x1b')]:_0x1fe8fe[_0x60a1('0x19')]+_0x1fe8fe[_0x60a1('0x1a')];var _0x473dba;if(_0x139ac4>=_0x5f4e22){_0x139ac4=_0x5f4e22;_0x473dba=0xc8;}else{_0x473dba=0xce;}_0x44795a[_0x60a1('0x16')](_0x473dba);return _0x44795a[_0x60a1('0x1c')](_0x60a1('0x1d'),_0x3cca6a+'-'+_0x139ac4+'/'+_0x5f4e22)[_0x60a1('0x18')](_0x54393c);}return null;};}function patchUpdates(_0x2aa16b){return function(_0x4cfbe1){try{jsonpatch[_0x60a1('0x1e')](_0x4cfbe1,_0x2aa16b,!![]);}catch(_0x3ff353){return BPromise[_0x60a1('0x1f')](_0x3ff353);}return _0x4cfbe1[_0x60a1('0x20')]();};}function saveUpdates(_0x297c05,_0x2e8d22){return function(_0x2e0fcd){if(_0x2e0fcd){return _0x2e0fcd['update'](_0x297c05)['then'](function(_0xd3c732){return _0xd3c732;});}return null;};}function removeEntity(_0x54181e,_0x43d9c2){return function(_0x6c6b00){if(_0x6c6b00){return _0x6c6b00[_0x60a1('0x21')]()[_0x60a1('0x22')](function(){_0x54181e[_0x60a1('0x16')](0xcc)[_0x60a1('0x17')]();});}};}function handleEntityNotFound(_0x5a377a,_0x49d322){return function(_0x2000a8){if(!_0x2000a8){_0x5a377a['sendStatus'](0x194);}return _0x2000a8;};}function handleError(_0x3b7452,_0x4acee1){_0x4acee1=_0x4acee1||0x1f4;return function(_0x51418f){logger[_0x60a1('0x23')](_0x51418f[_0x60a1('0x24')]);if(_0x51418f[_0x60a1('0x25')]){delete _0x51418f[_0x60a1('0x25')];}_0x3b7452[_0x60a1('0x16')](_0x4acee1)[_0x60a1('0x26')](_0x51418f);};}exports[_0x60a1('0x27')]=function(_0x7e823e,_0x5de5b5){var _0x37757b={},_0x594e5b={},_0x7cabc8={'count':0x0,'rows':[]};var _0x2c81d5=_['map'](db[_0x60a1('0x28')][_0x60a1('0x29')],function(_0x171e9e){return{'name':_0x171e9e[_0x60a1('0x2a')],'type':_0x171e9e[_0x60a1('0x2b')]['key']};});_0x594e5b[_0x60a1('0x2c')]=_[_0x60a1('0x2d')](_0x2c81d5,_0x60a1('0x25'));_0x594e5b['query']=_[_0x60a1('0x2e')](_0x7e823e['query']);_0x594e5b[_0x60a1('0x2f')]=_['intersection'](_0x594e5b[_0x60a1('0x2c')],_0x594e5b[_0x60a1('0x30')]);_0x37757b[_0x60a1('0x31')]=_['intersection'](_0x594e5b['model'],qs[_0x60a1('0x32')](_0x7e823e[_0x60a1('0x30')]['fields']));_0x37757b[_0x60a1('0x31')]=_0x37757b[_0x60a1('0x31')][_0x60a1('0x33')]?_0x37757b['attributes']:_0x594e5b[_0x60a1('0x2c')];if(!_0x7e823e[_0x60a1('0x30')][_0x60a1('0x34')]('nolimit')){_0x37757b[_0x60a1('0x1a')]=qs[_0x60a1('0x1a')](_0x7e823e[_0x60a1('0x30')][_0x60a1('0x1a')]);_0x37757b['offset']=qs['offset'](_0x7e823e[_0x60a1('0x30')][_0x60a1('0x19')]);}_0x37757b[_0x60a1('0x35')]=qs[_0x60a1('0x36')](_0x7e823e[_0x60a1('0x30')][_0x60a1('0x36')]);_0x37757b[_0x60a1('0x37')]=qs['filters'](_[_0x60a1('0x38')](_0x7e823e[_0x60a1('0x30')],_0x594e5b['filters']),_0x2c81d5);if(_0x7e823e[_0x60a1('0x30')]['filter']){_0x37757b[_0x60a1('0x37')]=_[_0x60a1('0x39')](_0x37757b['where'],{'$or':_[_0x60a1('0x2d')](_0x2c81d5,function(_0x1277ee){if(_0x1277ee['type']!==_0x60a1('0x3a')){var _0xbb7236={};_0xbb7236[_0x1277ee['name']]={'$like':'%'+_0x7e823e[_0x60a1('0x30')]['filter']+'%'};return _0xbb7236;}})});}_0x37757b=_[_0x60a1('0x39')]({},_0x37757b,_0x7e823e['options']);var _0x1c7cff={'where':_0x37757b[_0x60a1('0x37')]};return db[_0x60a1('0x28')][_0x60a1('0x1b')](_0x1c7cff)[_0x60a1('0x22')](function(_0x2405b9){_0x7cabc8['count']=_0x2405b9;if(_0x7e823e[_0x60a1('0x30')]['includeAll']){_0x37757b[_0x60a1('0x3b')]=[{'all':!![]}];}return db['Attachment'][_0x60a1('0x3c')](_0x37757b);})[_0x60a1('0x22')](function(_0x3b9263){_0x7cabc8[_0x60a1('0x3d')]=_0x3b9263;return _0x7cabc8;})['then'](respondWithFilteredResult(_0x5de5b5,_0x37757b))[_0x60a1('0x3e')](handleError(_0x5de5b5,null));};exports[_0x60a1('0x3f')]=function(_0x1a778c,_0x1966de){var _0x543692={'raw':!![],'where':{'id':_0x1a778c[_0x60a1('0x40')]['id']}},_0x332f28={};_0x332f28[_0x60a1('0x2c')]=_['keys'](db[_0x60a1('0x28')]['rawAttributes']);_0x332f28[_0x60a1('0x30')]=_['keys'](_0x1a778c[_0x60a1('0x30')]);_0x332f28[_0x60a1('0x2f')]=_[_0x60a1('0x41')](_0x332f28[_0x60a1('0x2c')],_0x332f28[_0x60a1('0x30')]);_0x543692['attributes']=_[_0x60a1('0x41')](_0x332f28['model'],qs['fields'](_0x1a778c[_0x60a1('0x30')][_0x60a1('0x32')]));_0x543692['attributes']=_0x543692[_0x60a1('0x31')]['length']?_0x543692['attributes']:_0x332f28['model'];if(_0x1a778c[_0x60a1('0x30')][_0x60a1('0x42')]){_0x543692[_0x60a1('0x3b')]=[{'all':!![]}];}_0x543692=_[_0x60a1('0x39')]({},_0x543692,_0x1a778c[_0x60a1('0x43')]);return db[_0x60a1('0x28')][_0x60a1('0x44')](_0x543692)[_0x60a1('0x22')](handleEntityNotFound(_0x1966de,null))[_0x60a1('0x22')](respondWithResult(_0x1966de,null))['catch'](handleError(_0x1966de,null));};exports[_0x60a1('0x45')]=function(_0x5e1c9c,_0x23d1c3){var _0x554479={'where':{'id':_0x5e1c9c[_0x60a1('0x40')]['id']}},_0x2ba599={};_0x2ba599[_0x60a1('0x2c')]=_[_0x60a1('0x2e')](db[_0x60a1('0x28')][_0x60a1('0x29')]);_0x554479[_0x60a1('0x31')]=_[_0x60a1('0x41')](_0x2ba599[_0x60a1('0x2c')],qs['fields'](_0x5e1c9c[_0x60a1('0x30')]['fields']));_0x554479[_0x60a1('0x31')]=_0x554479[_0x60a1('0x31')]['length']?_0x554479['attributes']:_0x2ba599[_0x60a1('0x2c')];if(_0x5e1c9c[_0x60a1('0x30')]['includeAll']){_0x554479[_0x60a1('0x3b')]=[{'all':!![]}];}_0x554479=_[_0x60a1('0x39')]({},_0x554479,_0x5e1c9c['options']);return db['Attachment'][_0x60a1('0x44')](_0x554479)[_0x60a1('0x22')](handleEntityNotFound(_0x23d1c3,null))[_0x60a1('0x22')](function(_0x3796f1){if(_0x3796f1){var _0x5531da=_0x3796f1[_0x60a1('0x46')]({'plain':!![]});_0x5531da=qs[_0x60a1('0x47')](_0x5531da,['id','createdAt',_0x60a1('0x48')]);_0x5e1c9c[_0x60a1('0x49')]=_[_0x60a1('0x47')](_0x5e1c9c[_0x60a1('0x49')],['id','createdAt','updatedAt']);return db['Attachment']['create'](_[_0x60a1('0x39')](_0x5531da,_0x5e1c9c[_0x60a1('0x49')]),{'include':_0x5e1c9c[_0x60a1('0x30')][_0x60a1('0x42')]?[{'all':!![]}]:undefined});}})[_0x60a1('0x22')](respondWithResult(_0x23d1c3,0xc9))[_0x60a1('0x3e')](handleError(_0x23d1c3,null));};exports[_0x60a1('0x4a')]=function(_0x11b5cc,_0x444ee9){if(_0x11b5cc['body']['id']){delete _0x11b5cc[_0x60a1('0x49')]['id'];}return db[_0x60a1('0x28')][_0x60a1('0x44')]({'where':{'id':_0x11b5cc[_0x60a1('0x40')]['id']}})['then'](handleEntityNotFound(_0x444ee9,null))['then'](saveUpdates(_0x11b5cc[_0x60a1('0x49')],null))['then'](respondWithResult(_0x444ee9,null))['catch'](handleError(_0x444ee9,null));};exports[_0x60a1('0x21')]=function(_0x1b6afa,_0x4d82de){return db[_0x60a1('0x28')][_0x60a1('0x44')]({'where':{'id':_0x1b6afa[_0x60a1('0x40')]['id']}})[_0x60a1('0x22')](handleEntityNotFound(_0x4d82de,null))['then'](removeEntity(_0x4d82de,null))[_0x60a1('0x3e')](handleError(_0x4d82de,null));};exports['create']=function(_0x4dcf68,_0x3eff9c,_0x719d73){_0x4dcf68['body'][_0x60a1('0x25')]=_0x4dcf68[_0x60a1('0x4b')][_0x60a1('0x4c')];_0x4dcf68['body'][_0x60a1('0x4d')]=_0x4dcf68[_0x60a1('0x4b')][_0x60a1('0x4e')];_0x4dcf68[_0x60a1('0x49')][_0x60a1('0x2b')]=_0x4dcf68[_0x60a1('0x4b')]['mimetype'];return db[_0x60a1('0x28')][_0x60a1('0x4f')](_0x4dcf68[_0x60a1('0x49')])[_0x60a1('0x22')](respondWithResult(_0x3eff9c,0xc9))['catch'](handleError(_0x3eff9c,null));};exports['download']=function(_0x5b964f,_0x252fe5,_0x1664cc){return db[_0x60a1('0x28')][_0x60a1('0x50')]({'where':{'id':_0x5b964f['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x252fe5,null))[_0x60a1('0x22')](function(_0x48ac33){if(_0x48ac33){var _0x9b97fb=_0x48ac33[_0x60a1('0x51')]!==null;var _0x4eca05=path[_0x60a1('0x52')](config['root'],'server/files/attachments/');if(_0x9b97fb){_0x4eca05=path['join'](_0x4eca05,_0x60a1('0x53'));}var _0x2a39b9=path[_0x60a1('0x52')](_0x4eca05,_0x48ac33['basename']);return _0x252fe5[_0x60a1('0x54')](_0x2a39b9);}})[_0x60a1('0x3e')](handleError(_0x252fe5,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index bc141b3..279c20b 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 _0x9787=['Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x24df34,_0x50aa1a){var _0x3980e8=function(_0x24c43f){while(--_0x24c43f){_0x24df34['push'](_0x24df34['shift']());}};_0x3980e8(++_0x50aa1a);}(_0x9787,0xec));var _0x7978=function(_0x132659,_0x486e0c){_0x132659=_0x132659-0x0;var _0x215fc3=_0x9787[_0x132659];return _0x215fc3;};'use strict';var _=require(_0x7978('0x0'));var util=require(_0x7978('0x1'));var logger=require(_0x7978('0x2'))(_0x7978('0x3'));var moment=require('moment');var BPromise=require(_0x7978('0x4'));var rp=require(_0x7978('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7978('0x6'));var config=require(_0x7978('0x7'));var attributes=require(_0x7978('0x8'));module[_0x7978('0x9')]=function(_0xa397c0,_0x3c4db0){return _0xa397c0[_0x7978('0xa')](_0x7978('0xb'),attributes,{'tableName':_0x7978('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26ef=['attachments','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./attachment.attributes','exports'];(function(_0x307715,_0x5b7fb9){var _0x23744e=function(_0xd9f80a){while(--_0xd9f80a){_0x307715['push'](_0x307715['shift']());}};_0x23744e(++_0x5b7fb9);}(_0x26ef,0x6d));var _0xf26e=function(_0x38301b,_0x473697){_0x38301b=_0x38301b-0x0;var _0x9dc065=_0x26ef[_0x38301b];return _0x9dc065;};'use strict';var _=require(_0xf26e('0x0'));var util=require(_0xf26e('0x1'));var logger=require(_0xf26e('0x2'))('api');var moment=require(_0xf26e('0x3'));var BPromise=require(_0xf26e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf26e('0x5'));var attributes=require(_0xf26e('0x6'));module[_0xf26e('0x7')]=function(_0xf3f967,_0x36c1cd){return _0xf3f967['define']('Attachment',attributes,{'tableName':_0xf26e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index c96e081..d4c10c4 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 _0x684c=['then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateAttachment','Attachment','create','options','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var moment=require('moment');var BPromise=require(_0xc684('0x2'));var rs=require(_0xc684('0x3'));var fs=require('fs');var Redis=require(_0xc684('0x4'));var db=require(_0xc684('0x5'))['db'];var utils=require(_0xc684('0x6'));var logger=require('../../config/logger')(_0xc684('0x7'));var config=require(_0xc684('0x8'));var jayson=require(_0xc684('0x9'));var client=jayson[_0xc684('0xa')][_0xc684('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57a63c,_0x23bd1c,_0x1a96ea){return new BPromise(function(_0x146733,_0xccb771){return client[_0xc684('0xc')](_0x57a63c,_0x1a96ea)[_0xc684('0xd')](function(_0x3b3bc0){logger[_0xc684('0xe')](_0xc684('0xf'),_0x23bd1c,_0xc684('0x10'));logger[_0xc684('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x23bd1c,_0xc684('0x10'),JSON[_0xc684('0x12')](_0x3b3bc0));if(_0x3b3bc0[_0xc684('0x13')]){if(_0x3b3bc0[_0xc684('0x13')][_0xc684('0x14')]===0x1f4){logger[_0xc684('0x13')]('Attachment,\x20%s,\x20%s',_0x23bd1c,_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);return _0xccb771(_0x3b3bc0['error']['message']);}logger[_0xc684('0x13')](_0xc684('0xf'),_0x23bd1c,_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);return _0x146733(_0x3b3bc0[_0xc684('0x13')][_0xc684('0x15')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x23bd1c,_0xc684('0x10'));_0x146733(_0x3b3bc0['result']['message']);}})['catch'](function(_0x47a8eb){logger['error'](_0xc684('0xf'),_0x23bd1c,_0x47a8eb);_0xccb771(_0x47a8eb);});});}exports[_0xc684('0x16')]=function(_0x3b6f5e){var _0x1c1b4a=this;return new Promise(function(_0x1c3af5,_0x4a14a2){return db[_0xc684('0x17')][_0xc684('0x18')](_0x3b6f5e['body'],{'raw':_0x3b6f5e[_0xc684('0x19')]?_0x3b6f5e[_0xc684('0x19')][_0xc684('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x62c4e5){logger[_0xc684('0xe')](_0xc684('0x16'),_0x3b6f5e);logger[_0xc684('0x11')](_0xc684('0x16'),_0x3b6f5e,JSON['stringify'](_0x62c4e5));_0x1c3af5(_0x62c4e5);})[_0xc684('0x1b')](function(_0x39f39a){logger[_0xc684('0x13')]('CreateAttachment',_0x39f39a['message'],_0x3b6f5e);_0x4a14a2(_0x1c1b4a['error'](0x1f4,_0x39f39a[_0xc684('0x15')]));});});}; \ No newline at end of file +var _0x2bdb=['error','code','message','result','CreateAttachment','Attachment','create','options','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x26fc3e,_0x65c964){var _0x5ecdd0=function(_0x14413f){while(--_0x14413f){_0x26fc3e['push'](_0x26fc3e['shift']());}};_0x5ecdd0(++_0x65c964);}(_0x2bdb,0x105));var _0xb2bd=function(_0x3f7650,_0x50cd0a){_0x3f7650=_0x3f7650-0x0;var _0x308e4f=_0x2bdb[_0x3f7650];return _0x308e4f;};'use strict';var _=require(_0xb2bd('0x0'));var util=require('util');var moment=require(_0xb2bd('0x1'));var BPromise=require('bluebird');var rs=require(_0xb2bd('0x2'));var fs=require('fs');var Redis=require(_0xb2bd('0x3'));var db=require(_0xb2bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2bd('0x5'))(_0xb2bd('0x6'));var config=require(_0xb2bd('0x7'));var jayson=require(_0xb2bd('0x8'));var client=jayson[_0xb2bd('0x9')][_0xb2bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bff5b,_0x5bae78,_0x21462b){return new BPromise(function(_0x4d9d3f,_0x181f5a){return client[_0xb2bd('0xb')](_0x3bff5b,_0x21462b)[_0xb2bd('0xc')](function(_0xeaa2b7){logger[_0xb2bd('0xd')](_0xb2bd('0xe'),_0x5bae78,_0xb2bd('0xf'));logger[_0xb2bd('0x10')](_0xb2bd('0x11'),_0x5bae78,'request\x20sent',JSON[_0xb2bd('0x12')](_0xeaa2b7));if(_0xeaa2b7[_0xb2bd('0x13')]){if(_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x14')]===0x1f4){logger[_0xb2bd('0x13')](_0xb2bd('0xe'),_0x5bae78,_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x15')]);return _0x181f5a(_0xeaa2b7['error'][_0xb2bd('0x15')]);}logger['error'](_0xb2bd('0xe'),_0x5bae78,_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x15')]);return _0x4d9d3f(_0xeaa2b7[_0xb2bd('0x13')][_0xb2bd('0x15')]);}else{logger['info'](_0xb2bd('0xe'),_0x5bae78,_0xb2bd('0xf'));_0x4d9d3f(_0xeaa2b7[_0xb2bd('0x16')][_0xb2bd('0x15')]);}})['catch'](function(_0x14950f){logger[_0xb2bd('0x13')]('Attachment,\x20%s,\x20%s',_0x5bae78,_0x14950f);_0x181f5a(_0x14950f);});});}exports[_0xb2bd('0x17')]=function(_0x380089){var _0x387897=this;return new Promise(function(_0x315815,_0x5d848d){return db[_0xb2bd('0x18')][_0xb2bd('0x19')](_0x380089['body'],{'raw':_0x380089[_0xb2bd('0x1a')]?_0x380089[_0xb2bd('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x51c595){logger[_0xb2bd('0xd')]('CreateAttachment',_0x380089);logger[_0xb2bd('0x10')]('CreateAttachment',_0x380089,JSON[_0xb2bd('0x12')](_0x51c595));_0x315815(_0x51c595);})[_0xb2bd('0x1b')](function(_0x505c35){logger[_0xb2bd('0x13')]('CreateAttachment',_0x505c35[_0xb2bd('0x15')],_0x380089);_0x5d848d(_0x387897[_0xb2bd('0x13')](0x1f4,_0x505c35[_0xb2bd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a6728d1..6046c08 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3fa91d,_0x39bf59){var _0x2c65c3=function(_0x1c8ad0){while(--_0x1c8ad0){_0x3fa91d['push'](_0x3fa91d['shift']());}};_0x2c65c3(++_0x39bf59);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52679c,_0x28c965){_0x52679c=_0x52679c-0x0;var _0x2a875d=_0x5f2f[_0x52679c];return _0x2a875d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x3724e2,_0x4cde93){var _0x2e5a1c=function(_0x47faea){while(--_0x47faea){_0x3724e2['push'](_0x3724e2['shift']());}};_0x2e5a1c(++_0x4cde93);}(_0xadb5,0xad));var _0x5adb=function(_0x3ac3bd,_0x5895e8){_0x3ac3bd=_0x3ac3bd-0x0;var _0x1993da=_0xadb5[_0x3ac3bd];return _0x1993da;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 02d7c5a..9728345 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 _0xaa04=['online','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','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','Setting','findOne','adSsoEnabled','blockDuration','password','salt','role','disabled','blockedAt','admin','user','agent','then','name','blocked','add','clearBlockUser','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x10d618,_0x1f1c82){var _0x57d044=function(_0x52c55b){while(--_0x52c55b){_0x10d618['push'](_0x10d618['shift']());}};_0x57d044(++_0x1f1c82);}(_0xaa04,0x69));var _0x4aa0=function(_0x10e8dc,_0x58e92b){_0x10e8dc=_0x10e8dc-0x0;var _0x342374=_0xaa04[_0x10e8dc];return _0x342374;};'use strict';var passport=require(_0x4aa0('0x0'));var LocalStrategy=require(_0x4aa0('0x1'))['Strategy'];var moment=require(_0x4aa0('0x2'));var ActiveDirectory=require(_0x4aa0('0x3'));var BPromise=require(_0x4aa0('0x4'));var util=require(_0x4aa0('0x5'));var db=require(_0x4aa0('0x6'))['db'];var authService=require(_0x4aa0('0x7'));var utils=require(_0x4aa0('0x8'));var config=require(_0x4aa0('0x9'));var logger=require(_0x4aa0('0xa'))(_0x4aa0('0xb'));function isActiveDirectoryConfigured(_0x53f029){var _0x24830a=![];if(typeof _0x53f029[_0x4aa0('0xc')]!==_0x4aa0('0xd')){_0x24830a=_0x53f029[_0x4aa0('0xc')][_0x4aa0('0xe')]&&_0x53f029['activedirectory'][_0x4aa0('0xf')]&&_0x53f029[_0x4aa0('0xc')][_0x4aa0('0x10')];}return _0x24830a;}function adAuthenticate(_0x436b84,_0x2585cb,_0x4e8575){return new BPromise(function(_0x2a35b7,_0x4e1de9){try{var _0x468bb4=new ActiveDirectory(_0x436b84);_0x468bb4[_0x4aa0('0x11')](_0x2585cb,_0x4e8575,function(_0x38547a,_0x4a6cdd){if(_0x38547a){logger[_0x4aa0('0x12')](_0x4aa0('0x13'),_0x2585cb,util[_0x4aa0('0x14')](_0x38547a,{'showHidden':![],'depth':null}));_0x4e1de9(_0x4aa0('0x15'));}else if(!_0x4a6cdd){logger[_0x4aa0('0x12')](_0x4aa0('0x16'),_0x2585cb);_0x4e1de9(_0x4aa0('0x15'));}else{_0x2a35b7(_0x4a6cdd);}});}catch(_0x4ff6df){_0x4e1de9(_0x4ff6df);}});}function ActiveDirectoryAuthenticate(_0x1a0171,_0x2ea35d,_0x517b0b,_0x52b1a4){var _0x5214ac,_0x8c0262;if(!isActiveDirectoryConfigured(config)){logger[_0x4aa0('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2ea35d);return _0x52b1a4(null,![],{'message':_0x4aa0('0x15')});}return db[_0x4aa0('0x17')][_0x4aa0('0x18')]({'where':{'id':0x1},'attributes':[_0x4aa0('0x19'),_0x4aa0('0x1a')],'raw':!![]})['then'](function(_0xde24f1){_0x5214ac=_0xde24f1;if(!_0x5214ac[_0x4aa0('0x19')]){logger[_0x4aa0('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x2ea35d);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x1a0171[_0x4aa0('0x18')]({'attributes':['id','name',_0x4aa0('0x1b'),_0x4aa0('0x1c'),_0x4aa0('0x1d'),_0x4aa0('0x1e'),'blocked',_0x4aa0('0x1f'),'online'],'where':{'name':_0x2ea35d,'role':{'$or':[_0x4aa0('0x20'),_0x4aa0('0x21'),_0x4aa0('0x22')]},'adSsoEnabled':!![]}});})[_0x4aa0('0x23')](function(_0x287cdd){if(!_0x287cdd||_0x287cdd&&_0x287cdd[_0x4aa0('0x24')]!==_0x2ea35d){throw new Error(_0x4aa0('0x15'));}_0x8c0262=_0x287cdd;var _0x195551=_0x8c0262[_0x4aa0('0x24')]+'@'+config['activedirectory'][_0x4aa0('0x10')];return adAuthenticate(config[_0x4aa0('0xc')],_0x195551,_0x517b0b);})[_0x4aa0('0x23')](function(_0x4b4a82){if(_0x8c0262[_0x4aa0('0x1e')]){throw new Error(_0x4aa0('0x15'));}if(_0x5214ac['blockDuration']>0x0){if(_0x8c0262[_0x4aa0('0x25')]){if(moment(_0x8c0262[_0x4aa0('0x1f')])[_0x4aa0('0x26')](_0x5214ac['blockDuration'],'minutes')>moment()){throw new Error(_0x4aa0('0x15'));}return utils[_0x4aa0('0x27')](_0x8c0262,0x0,![],null)[_0x4aa0('0x23')](function(){return utils[_0x4aa0('0x28')](_0x8c0262);})['then'](function(){return _0x52b1a4(null,_0x8c0262);});}else{return utils[_0x4aa0('0x28')](_0x8c0262)[_0x4aa0('0x23')](function(){return _0x52b1a4(null,_0x8c0262);});}}else{return utils[_0x4aa0('0x28')](_0x8c0262)[_0x4aa0('0x23')](function(){return _0x52b1a4(null,_0x8c0262);});}})[_0x4aa0('0x29')](function(_0x2deea3){return _0x52b1a4(null,![],_0x2deea3);});}function handleError(_0x5e717e,_0x121442,_0x440eae){return _0x5e717e['status'](_0x121442||0x1f4)['send']({'message':_0x440eae?_0x440eae[_0x4aa0('0x2a')]||_0x440eae:''});}exports[_0x4aa0('0x2b')]=function(_0x20a9cf,_0x4146c5,_0x218ba0){passport[_0x4aa0('0x11')](_0x4aa0('0x2c'),function(_0x52b594,_0x546abb,_0x43a12d){var _0x315d44=_0x52b594||_0x43a12d;if(_0x315d44){return handleError(_0x4146c5,0x191,_0x315d44);}if(!_0x546abb){return handleError(_0x4146c5,0x194,{'message':_0x4aa0('0x2d')});}else{var _0x38caa8={'payload':{'id':_0x546abb['id'],'role':_0x546abb['role']},'options':{'expiresIn':0x15180}};return authService[_0x4aa0('0x2e')](_0x38caa8)[_0x4aa0('0x23')](function(_0x472039){_0x4146c5[_0x4aa0('0x2f')]({'id':_0x546abb['id'],'token':_0x472039,'statusCall':'','isAlreadyLogged':_0x546abb[_0x4aa0('0x30')]});});}})(_0x20a9cf,_0x4146c5,_0x218ba0);};passport[_0x4aa0('0x31')](_0x4aa0('0x2c'),new LocalStrategy({'usernameField':'name','passwordField':_0x4aa0('0x1b')},function(_0x52ac9f,_0x1e59bc,_0x127e3e){return ActiveDirectoryAuthenticate(db[_0x4aa0('0x32')],_0x52ac9f,_0x1e59bc,_0x127e3e);})); \ No newline at end of file +var _0x2084=['User','passport','Strategy','moment','activedirectory2','util','../../components/auth/service','../../config/logger','activedirectory','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','password','role','disabled','blockedAt','admin','user','agent','name','blocked','add','clearBlockUser','getLicense','catch','message','login','ad-login','online','use'];(function(_0x5bb586,_0x294bd5){var _0x2a8401=function(_0x179ed8){while(--_0x179ed8){_0x5bb586['push'](_0x5bb586['shift']());}};_0x2a8401(++_0x294bd5);}(_0x2084,0x1c4));var _0x4208=function(_0x4890ed,_0x237aa1){_0x4890ed=_0x4890ed-0x0;var _0x622bbc=_0x2084[_0x4890ed];return _0x622bbc;};'use strict';var passport=require(_0x4208('0x0'));var LocalStrategy=require('passport-local')[_0x4208('0x1')];var moment=require(_0x4208('0x2'));var ActiveDirectory=require(_0x4208('0x3'));var BPromise=require('bluebird');var util=require(_0x4208('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x4208('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x4208('0x6'))('api');function isActiveDirectoryConfigured(_0x576391){var _0x25c2ef=![];if(typeof _0x576391['activedirectory']!=='undefined'){_0x25c2ef=_0x576391[_0x4208('0x7')]['baseDN']&&_0x576391['activedirectory'][_0x4208('0x8')]&&_0x576391['activedirectory'][_0x4208('0x9')];}return _0x25c2ef;}function adAuthenticate(_0x1caacc,_0x55eac2,_0x2ca709){return new BPromise(function(_0x1f3940,_0x5e319f){try{var _0x17d568=new ActiveDirectory(_0x1caacc);_0x17d568[_0x4208('0xa')](_0x55eac2,_0x2ca709,function(_0x2a28fb,_0x9fe3c8){if(_0x2a28fb){logger[_0x4208('0xb')](_0x4208('0xc'),_0x55eac2,util[_0x4208('0xd')](_0x2a28fb,{'showHidden':![],'depth':null}));_0x5e319f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x9fe3c8){logger['error'](_0x4208('0xe'),_0x55eac2);_0x5e319f(_0x4208('0xf'));}else{_0x1f3940(_0x9fe3c8);}});}catch(_0x2feb31){_0x5e319f(_0x2feb31);}});}function ActiveDirectoryAuthenticate(_0x580b9e,_0x366719,_0x29f236,_0x1d8237){var _0x2d290c,_0x46851d;if(!isActiveDirectoryConfigured(config)){logger[_0x4208('0xb')](_0x4208('0x10'),_0x366719);return _0x1d8237(null,![],{'message':_0x4208('0xf')});}return db[_0x4208('0x11')][_0x4208('0x12')]({'where':{'id':0x1},'attributes':[_0x4208('0x13'),_0x4208('0x14')],'raw':!![]})[_0x4208('0x15')](function(_0x1a0bb2){_0x2d290c=_0x1a0bb2;if(!_0x2d290c[_0x4208('0x13')]){logger[_0x4208('0xb')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x366719);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x580b9e['findOne']({'attributes':['id','name',_0x4208('0x16'),'salt',_0x4208('0x17'),_0x4208('0x18'),'blocked',_0x4208('0x19'),'online'],'where':{'name':_0x366719,'role':{'$or':[_0x4208('0x1a'),_0x4208('0x1b'),_0x4208('0x1c')]},'adSsoEnabled':!![]}});})['then'](function(_0x52741e){if(!_0x52741e||_0x52741e&&_0x52741e[_0x4208('0x1d')]!==_0x366719){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x46851d=_0x52741e;var _0x369f7c=_0x46851d[_0x4208('0x1d')]+'@'+config[_0x4208('0x7')]['domain'];return adAuthenticate(config['activedirectory'],_0x369f7c,_0x29f236);})[_0x4208('0x15')](function(_0x3c5709){if(_0x46851d[_0x4208('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2d290c[_0x4208('0x14')]>0x0){if(_0x46851d[_0x4208('0x1e')]){if(moment(_0x46851d[_0x4208('0x19')])[_0x4208('0x1f')](_0x2d290c[_0x4208('0x14')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x4208('0x20')](_0x46851d,0x0,![],null)[_0x4208('0x15')](function(){return utils[_0x4208('0x21')](_0x46851d);})[_0x4208('0x15')](function(){return _0x1d8237(null,_0x46851d);});}else{return utils[_0x4208('0x21')](_0x46851d)[_0x4208('0x15')](function(){return _0x1d8237(null,_0x46851d);});}}else{return utils[_0x4208('0x21')](_0x46851d)[_0x4208('0x15')](function(){return _0x1d8237(null,_0x46851d);});}})[_0x4208('0x22')](function(_0x292499){return _0x1d8237(null,![],_0x292499);});}function handleError(_0x1ffd1d,_0x95ae08,_0x2584eb){return _0x1ffd1d['status'](_0x95ae08||0x1f4)['send']({'message':_0x2584eb?_0x2584eb[_0x4208('0x23')]||_0x2584eb:''});}exports[_0x4208('0x24')]=function(_0x104173,_0x160491,_0x5f4ef1){passport[_0x4208('0xa')](_0x4208('0x25'),function(_0x67308a,_0x415070,_0x522ba5){var _0x4a06a8=_0x67308a||_0x522ba5;if(_0x4a06a8){return handleError(_0x160491,0x191,_0x4a06a8);}if(!_0x415070){return handleError(_0x160491,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x23d4cc={'payload':{'id':_0x415070['id'],'role':_0x415070[_0x4208('0x17')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x23d4cc)['then'](function(_0x39a0a3){_0x160491['json']({'id':_0x415070['id'],'token':_0x39a0a3,'statusCall':'','isAlreadyLogged':_0x415070[_0x4208('0x26')]});});}})(_0x104173,_0x160491,_0x5f4ef1);};passport[_0x4208('0x27')]('ad-login',new LocalStrategy({'usernameField':_0x4208('0x1d'),'passwordField':_0x4208('0x16')},function(_0x9ffa46,_0x57aab6,_0x381b8a){return ActiveDirectoryAuthenticate(db[_0x4208('0x28')],_0x9ffa46,_0x57aab6,_0x381b8a);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 39ef9a8..c449a48 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 _0xb627=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb627,0x1a6));var _0x7b62=function(_0x5970da,_0x1604c1){_0x5970da=_0x5970da-0x0;var _0x57eff1=_0xb627[_0x5970da];return _0x57eff1;};'use strict';var express=require(_0x7b62('0x0'));var router=express[_0x7b62('0x1')]();var controller=require(_0x7b62('0x2'));router[_0x7b62('0x3')]('/',controller[_0x7b62('0x4')]);module[_0x7b62('0x5')]=router; \ No newline at end of file +var _0x9ca8=['exports','express','Router','./authActiveDirectory.controller','login'];(function(_0xa676,_0x39f7e0){var _0x487837=function(_0x20a26a){while(--_0x20a26a){_0xa676['push'](_0xa676['shift']());}};_0x487837(++_0x39f7e0);}(_0x9ca8,0x155));var _0x89ca=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x9ca8[_0x59616b];return _0x5c4523;};'use strict';var express=require(_0x89ca('0x0'));var router=express[_0x89ca('0x1')]();var controller=require(_0x89ca('0x2'));router['post']('/',controller[_0x89ca('0x3')]);module[_0x89ca('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index f97cf6c..7a01917 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x5ee0ef,_0x34f2b1){var _0x144aab=function(_0x39f698){while(--_0x39f698){_0x5ee0ef['push'](_0x5ee0ef['shift']());}};_0x144aab(++_0x34f2b1);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x7a54,0x106));var _0x47a5=function(_0x26e40a,_0x41dbc5){_0x26e40a=_0x26e40a-0x0;var _0x91358f=_0x7a54[_0x26e40a];return _0x91358f;};'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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3dacce1..b5ba0eb 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 _0xb475=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x35124c,_0x3503d1){var _0x167893=function(_0x549e7b){while(--_0x549e7b){_0x35124c['push'](_0x35124c['shift']());}};_0x167893(++_0x3503d1);}(_0xb475,0xc7));var _0x5b47=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0xb475[_0x98db33];return _0x5ae63a;};'use strict';var express=require(_0x5b47('0x0'));var passport=require(_0x5b47('0x1'));var router=express[_0x5b47('0x2')]();var controller=require(_0x5b47('0x3'));var userController=require(_0x5b47('0x4'));var authService=require(_0x5b47('0x5'));router[_0x5b47('0x6')]('/',controller[_0x5b47('0x7')]);router[_0x5b47('0x6')](_0x5b47('0x8'),controller[_0x5b47('0x9')],authService[_0x5b47('0xa')],userController[_0x5b47('0x7')],authService[_0x5b47('0xb')]);module[_0x5b47('0xc')]=router; \ No newline at end of file +var _0xa7ac=['../../components/auth/service','get','login','/callback','callback','passport','./authGoogle.controller'];(function(_0x5f1eea,_0x545206){var _0x341bfe=function(_0x1d74e9){while(--_0x1d74e9){_0x5f1eea['push'](_0x5f1eea['shift']());}};_0x341bfe(++_0x545206);}(_0xa7ac,0x14e));var _0xca7a=function(_0x358b86,_0x4ece0f){_0x358b86=_0x358b86-0x0;var _0x5afad9=_0xa7ac[_0x358b86];return _0x5afad9;};'use strict';var express=require('express');var passport=require(_0xca7a('0x0'));var router=express['Router']();var controller=require(_0xca7a('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0xca7a('0x2'));router[_0xca7a('0x3')]('/',controller[_0xca7a('0x4')]);router[_0xca7a('0x3')](_0xca7a('0x5'),controller[_0xca7a('0x6')],authService['isMiddleware'],userController[_0xca7a('0x4')],authService['setTokenCookie']);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 1bc9635..0529d4e 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 _0x6057=['send','Reset\x20Email\x20sent!','reset','find','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','save','status','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','email','MailServerOut','Smtp','CloudProvider','merge','request','SendMail','error','format','stringify','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x596d83,_0x55e139){var _0x4f4186=function(_0x7dca7e){while(--_0x7dca7e){_0x596d83['push'](_0x596d83['shift']());}};_0x4f4186(++_0x55e139);}(_0x6057,0x1c4));var _0x7605=function(_0x2c5340,_0x5c86e5){_0x2c5340=_0x2c5340-0x0;var _0x3c505e=_0x6057[_0x2c5340];return _0x3c505e;};'use strict';var util=require(_0x7605('0x0'));var passport=require(_0x7605('0x1'));var LocalStrategy=require(_0x7605('0x2'))[_0x7605('0x3')];var jayson=require(_0x7605('0x4'));var _=require(_0x7605('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x7605('0x6'))['db'];var authService=require(_0x7605('0x7'));var utils=require(_0x7605('0x8'));var client=jayson[_0x7605('0x9')][_0x7605('0xa')]({'port':0x232b});function localAuthenticate(_0x27d42f,_0x27316b,_0x2c3654,_0x29d619){var _0x5908fe,_0x3be849;return db['Setting'][_0x7605('0xb')]({'where':{'id':0x1},'attributes':[_0x7605('0xc'),_0x7605('0xd')],'raw':!![]})[_0x7605('0xe')](function(_0x27b8b7){_0x5908fe=_0x27b8b7;return _0x27d42f[_0x7605('0xb')]({'attributes':['id',_0x7605('0xf'),'password',_0x7605('0x10'),_0x7605('0x11'),'disabled',_0x7605('0x12'),_0x7605('0x13'),_0x7605('0x14')],'where':{'name':_0x27316b,'role':{'$or':[_0x7605('0x15'),'user',_0x7605('0x16')]}}});})[_0x7605('0xe')](function(_0xf2e93){if(!_0xf2e93||_0xf2e93&&_0xf2e93[_0x7605('0xf')]!==_0x27316b){throw new Error(_0x7605('0x17'));}else{_0x3be849=_0xf2e93;return _0x3be849;}})[_0x7605('0xe')](function(){_0x3be849[_0x7605('0x18')](_0x2c3654,function(_0x3ff1db,_0x2eb03c){var _0x28f84f=_0x3be849['loginAttempts']+0x1;if(_0x3ff1db){return _0x29d619(_0x3ff1db);}else if(!_0x2eb03c){if(_0x3be849[_0x7605('0x19')]){return _0x29d619(null,![],{'message':_0x7605('0x17')});}else if(_0x5908fe[_0x7605('0xc')]>0x0){if(_0x3be849[_0x7605('0x12')]){if(_0x5908fe[_0x7605('0xd')]>0x0){if(moment(_0x3be849[_0x7605('0x13')])[_0x7605('0x1a')](_0x5908fe[_0x7605('0xd')],_0x7605('0x1b'))>moment()){return _0x29d619(null,![],{'message':_0x7605('0x17')});}else{return utils[_0x7605('0x1c')](_0x3be849,_0x28f84f,![],null)['then'](function(){return _0x29d619(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x29d619(null,![],{'message':_0x7605('0x17')});}}else{if(_0x28f84f>=_0x5908fe[_0x7605('0xc')]){return utils[_0x7605('0x1c')](_0x3be849,0x0,!![],moment())[_0x7605('0xe')](function(){return _0x29d619(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x7605('0x1c')](_0x3be849,_0x28f84f,![],null)[_0x7605('0xe')](function(){return _0x29d619(null,![],{'message':_0x7605('0x17')});});}}}else{return _0x29d619(null,![],{'message':_0x7605('0x17')});}}else{if(_0x3be849[_0x7605('0x19')]){return _0x29d619(null,![],{'message':_0x7605('0x17')});}else if(_0x5908fe['allowedLoginAttempts']>0x0){if(_0x3be849[_0x7605('0x12')]){if(_0x5908fe[_0x7605('0xd')]>0x0){if(moment(_0x3be849[_0x7605('0x13')])['add'](_0x5908fe[_0x7605('0xd')],_0x7605('0x1b'))>moment()){return _0x29d619(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3be849,0x0,![],null)['then'](function(){return utils[_0x7605('0x1d')](_0x3be849);})['then'](function(){return _0x29d619(null,_0x3be849);});}}else{return _0x29d619(null,![],{'message':_0x7605('0x17')});}}else{return utils[_0x7605('0x1c')](_0x3be849,0x0,![],null)[_0x7605('0xe')](function(){return utils['getLicense'](_0x3be849);})[_0x7605('0xe')](function(){return _0x29d619(null,_0x3be849);})[_0x7605('0x1e')](function(_0x555dbb){return _0x29d619(null,![],_0x555dbb);});}}else{if(_0x3be849[_0x7605('0x12')]){return _0x29d619(null,![],{'message':_0x7605('0x17')});}else{return utils['getLicense'](_0x3be849)['then'](function(){return _0x29d619(null,_0x3be849);});}}}});})[_0x7605('0x1e')](function(_0x599b8d){return _0x29d619(null,![],_0x599b8d);});}function sendServiceMail(_0x28130e){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x7605('0xf'),_0x7605('0x1f')],'include':[{'model':db[_0x7605('0x20')],'as':_0x7605('0x21'),'include':[{'model':db[_0x7605('0x22')],'as':'CloudProvider'}]}]})[_0x7605('0xe')](function(_0x29e83e){if(!_0x29e83e){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4c88bc=_0x29e83e['getSmtpOptions']();var _0x343a8c={'account':_0x4c88bc,'message':_[_0x7605('0x23')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x29e83e[_0x7605('0xf')],_0x29e83e[_0x7605('0x1f')]||_0x29e83e[_0x7605('0x21')]['user'])},_0x28130e)};return client[_0x7605('0x24')](_0x7605('0x25'),_0x343a8c);})['then'](function(_0x54bb27){if(_0x54bb27[_0x7605('0x26')]){throw new Error(util[_0x7605('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x54bb27[_0x7605('0x26')]['message']||JSON[_0x7605('0x28')](_0x54bb27['error'])));}return!![];});}function handleError(_0x4fa9f9,_0x467460,_0x3f200b){return _0x4fa9f9['status'](_0x467460||0x1f4)['send']({'message':_0x3f200b?_0x3f200b['message']||_0x3f200b:''});}exports['login']=function(_0x31d263,_0x4055f8,_0x30872){passport['authenticate'](_0x7605('0x29'),function(_0x5b6cbb,_0x4182d5,_0x18bab2){var _0x169948=_0x5b6cbb||_0x18bab2;if(_0x169948){return handleError(_0x4055f8,0x191,_0x169948);}if(!_0x4182d5){return handleError(_0x4055f8,0x194,{'message':_0x7605('0x2a')});}else{var _0x3d69cd={'payload':{'id':_0x4182d5['id'],'role':_0x4182d5[_0x7605('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x7605('0x2b')](_0x3d69cd)[_0x7605('0xe')](function(_0x7ce384){_0x4055f8[_0x7605('0x2c')]({'id':_0x4182d5['id'],'token':_0x7ce384,'statusCall':'','isAlreadyLogged':_0x4182d5[_0x7605('0x2d')]});});}})(_0x31d263,_0x4055f8,_0x30872);};exports[_0x7605('0x2e')]=function(_0x4adc5b,_0x202b08){if(!_0x4adc5b[_0x7605('0x2f')][_0x7605('0x1f')]){return handleError(_0x202b08,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xee1c8c=rs[_0x7605('0x30')]();_0x4adc5b[_0x7605('0x2f')][_0x7605('0x1f')]=_0x4adc5b[_0x7605('0x2f')][_0x7605('0x1f')]['trim']()['toLowerCase']();var _0x34bc94;return db['Setting'][_0x7605('0xb')]({'where':{'id':0x1},'attributes':[_0x7605('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x5d3613){_0x34bc94=_0x5d3613;return db[_0x7605('0x31')]['find']({'where':{'email':_0x4adc5b[_0x7605('0x2f')][_0x7605('0x1f')]}});})[_0x7605('0xe')](function(_0x1a8a70){if(!_0x1a8a70){throw new Error(_0x7605('0x32'));}if(_0x1a8a70[_0x7605('0x19')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1a8a70[_0x7605('0x12')]){if(moment(_0x1a8a70['blockedAt'])[_0x7605('0x1a')](_0x34bc94[_0x7605('0xd')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x1a8a70[_0x7605('0x12')]=![];_0x1a8a70['blockedAt']=null;}}_0x1a8a70[_0x7605('0x33')]=_0xee1c8c;_0x1a8a70['resetPasswordExpires']=Date[_0x7605('0x34')]()+0x36ee80;return _0x1a8a70['save']();})['then'](function(){return sendServiceMail({'to':_0x4adc5b['body'][_0x7605('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x7605('0x35')+_0x7605('0x36')+_0x7605('0x37')+_0x4adc5b[_0x7605('0x38')]['host']+_0x7605('0x39')+_0xee1c8c+'\x0a\x0a'+_0x7605('0x3a')});})['then'](function(){_0x202b08['status'](0xc8)[_0x7605('0x3b')]({'message':_0x7605('0x3c')});})['catch'](function(_0x387d1b){return handleError(_0x202b08,0x1f4,_0x387d1b);});};exports[_0x7605('0x3d')]=function(_0x1163a5,_0x2ff33c){return db[_0x7605('0x31')][_0x7605('0x3e')]({'where':{'resetPasswordToken':_0x1163a5['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x7605('0x34')]()}}})['then'](function(_0x2933af){if(!_0x2933af){throw new Error(_0x7605('0x3f'));}return db['Setting'][_0x7605('0xb')]({'attributes':['id',_0x7605('0x40'),_0x7605('0x41'),_0x7605('0x42')]})['then'](function(_0x1a94da){if(_0x1a94da['securePassword'])authService[_0x7605('0x43')](_0x1163a5[_0x7605('0x2f')]['password']);if(!_0x1a94da[_0x7605('0x41')]||!_0x2933af[_0x7605('0x44')])return _0x2933af;authService[_0x7605('0x45')](_0x1163a5['body'][_0x7605('0x46')],_0x2933af[_0x7605('0x44')],_0x1a94da[_0x7605('0x42')]);return _0x2933af;})['then'](function(){_0x2933af[_0x7605('0x46')]=_0x1163a5[_0x7605('0x2f')][_0x7605('0x46')];_0x2933af[_0x7605('0x33')]=null;_0x2933af['resetPasswordExpires']=null;return _0x2933af[_0x7605('0x47')]();});})[_0x7605('0xe')](function(){_0x2ff33c[_0x7605('0x48')](0xc8)[_0x7605('0x3b')]({'message':'Password\x20reset!'});})['catch'](function(_0xe2250a){return handleError(_0x2ff33c,0x1f4,_0xe2250a);});};passport['use'](_0x7605('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0x7605('0x46')},function(_0x22befa,_0x5ef2f3,_0x5087b3){return localAuthenticate(db[_0x7605('0x31')],_0x22befa,_0x5ef2f3,_0x5087b3);})); \ No newline at end of file +var _0x4d2c=['SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','forgot','body','generate','Setting','User','find','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','util','passport','Strategy','lodash','moment','../../mysqldb','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','password','salt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','minutes','clearBlockUser','blockedAt','add','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format'];(function(_0xd16c0,_0x4ff81e){var _0x76efab=function(_0x20f916){while(--_0x20f916){_0xd16c0['push'](_0xd16c0['shift']());}};_0x76efab(++_0x4ff81e);}(_0x4d2c,0x1b3));var _0xc4d2=function(_0x33f073,_0x15c2d7){_0x33f073=_0x33f073-0x0;var _0x330bf0=_0x4d2c[_0x33f073];return _0x330bf0;};'use strict';var util=require(_0xc4d2('0x0'));var passport=require(_0xc4d2('0x1'));var LocalStrategy=require('passport-local')[_0xc4d2('0x2')];var jayson=require('jayson/promise');var _=require(_0xc4d2('0x3'));var rs=require('randomstring');var moment=require(_0xc4d2('0x4'));var db=require(_0xc4d2('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc4d2('0x6'));var client=jayson[_0xc4d2('0x7')][_0xc4d2('0x8')]({'port':0x232b});function localAuthenticate(_0x10de20,_0x1b65bd,_0x271920,_0x2b433b){var _0x55684e,_0x29122c;return db['Setting'][_0xc4d2('0x9')]({'where':{'id':0x1},'attributes':[_0xc4d2('0xa'),_0xc4d2('0xb')],'raw':!![]})[_0xc4d2('0xc')](function(_0x274460){_0x55684e=_0x274460;return _0x10de20[_0xc4d2('0x9')]({'attributes':['id','name',_0xc4d2('0xd'),_0xc4d2('0xe'),'role','disabled','blocked','blockedAt',_0xc4d2('0xf')],'where':{'name':_0x1b65bd,'role':{'$or':[_0xc4d2('0x10'),_0xc4d2('0x11'),_0xc4d2('0x12')]}}});})[_0xc4d2('0xc')](function(_0x4c69fb){if(!_0x4c69fb||_0x4c69fb&&_0x4c69fb[_0xc4d2('0x13')]!==_0x1b65bd){throw new Error(_0xc4d2('0x14'));}else{_0x29122c=_0x4c69fb;return _0x29122c;}})[_0xc4d2('0xc')](function(){_0x29122c[_0xc4d2('0x15')](_0x271920,function(_0x47fe12,_0x4476f5){var _0x5ea059=_0x29122c['loginAttempts']+0x1;if(_0x47fe12){return _0x2b433b(_0x47fe12);}else if(!_0x4476f5){if(_0x29122c[_0xc4d2('0x16')]){return _0x2b433b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x55684e[_0xc4d2('0xa')]>0x0){if(_0x29122c[_0xc4d2('0x17')]){if(_0x55684e[_0xc4d2('0xb')]>0x0){if(moment(_0x29122c['blockedAt'])['add'](_0x55684e[_0xc4d2('0xb')],_0xc4d2('0x18'))>moment()){return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});}else{return utils[_0xc4d2('0x19')](_0x29122c,_0x5ea059,![],null)[_0xc4d2('0xc')](function(){return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});});}}else{return _0x2b433b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5ea059>=_0x55684e[_0xc4d2('0xa')]){return utils[_0xc4d2('0x19')](_0x29122c,0x0,!![],moment())['then'](function(){return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});});}else{return utils[_0xc4d2('0x19')](_0x29122c,_0x5ea059,![],null)['then'](function(){return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});});}}}else{return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});}}else{if(_0x29122c[_0xc4d2('0x16')]){return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});}else if(_0x55684e['allowedLoginAttempts']>0x0){if(_0x29122c[_0xc4d2('0x17')]){if(_0x55684e[_0xc4d2('0xb')]>0x0){if(moment(_0x29122c[_0xc4d2('0x1a')])[_0xc4d2('0x1b')](_0x55684e['blockDuration'],_0xc4d2('0x18'))>moment()){return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});}else{return utils[_0xc4d2('0x19')](_0x29122c,0x0,![],null)['then'](function(){return utils[_0xc4d2('0x1c')](_0x29122c);})[_0xc4d2('0xc')](function(){return _0x2b433b(null,_0x29122c);});}}else{return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});}}else{return utils[_0xc4d2('0x19')](_0x29122c,0x0,![],null)[_0xc4d2('0xc')](function(){return utils['getLicense'](_0x29122c);})[_0xc4d2('0xc')](function(){return _0x2b433b(null,_0x29122c);})[_0xc4d2('0x1d')](function(_0x26d0c0){return _0x2b433b(null,![],_0x26d0c0);});}}else{if(_0x29122c['blocked']){return _0x2b433b(null,![],{'message':_0xc4d2('0x14')});}else{return utils['getLicense'](_0x29122c)[_0xc4d2('0xc')](function(){return _0x2b433b(null,_0x29122c);});}}}});})[_0xc4d2('0x1d')](function(_0x5a7c9f){return _0x2b433b(null,![],_0x5a7c9f);});}function sendServiceMail(_0x25c135){return db[_0xc4d2('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xc4d2('0x13'),_0xc4d2('0x1f')],'include':[{'model':db[_0xc4d2('0x20')],'as':_0xc4d2('0x21'),'include':[{'model':db[_0xc4d2('0x22')],'as':_0xc4d2('0x22')}]}]})[_0xc4d2('0xc')](function(_0xbafcd0){if(!_0xbafcd0){throw new Error(_0xc4d2('0x23'));}var _0x463d67=_0xbafcd0[_0xc4d2('0x24')]();var _0x384231={'account':_0x463d67,'message':_[_0xc4d2('0x25')]({'from':util[_0xc4d2('0x26')]('\x22%s\x22\x20<%s>',_0xbafcd0[_0xc4d2('0x13')],_0xbafcd0[_0xc4d2('0x1f')]||_0xbafcd0[_0xc4d2('0x21')][_0xc4d2('0x11')])},_0x25c135)};return client['request'](_0xc4d2('0x27'),_0x384231);})[_0xc4d2('0xc')](function(_0x36f898){if(_0x36f898[_0xc4d2('0x28')]){throw new Error(util[_0xc4d2('0x26')](_0xc4d2('0x29'),_0x36f898['error'][_0xc4d2('0x2a')]||JSON[_0xc4d2('0x2b')](_0x36f898[_0xc4d2('0x28')])));}return!![];});}function handleError(_0x18efb1,_0x1f7ee2,_0x259222){return _0x18efb1[_0xc4d2('0x2c')](_0x1f7ee2||0x1f4)[_0xc4d2('0x2d')]({'message':_0x259222?_0x259222[_0xc4d2('0x2a')]||_0x259222:''});}exports[_0xc4d2('0x2e')]=function(_0x1c3149,_0xcb1924,_0x1df10d){passport[_0xc4d2('0x15')](_0xc4d2('0x2f'),function(_0x1b9e0d,_0x3928fa,_0x2affb4){var _0x14988e=_0x1b9e0d||_0x2affb4;if(_0x14988e){return handleError(_0xcb1924,0x191,_0x14988e);}if(!_0x3928fa){return handleError(_0xcb1924,0x194,{'message':_0xc4d2('0x30')});}else{var _0x4d4863={'payload':{'id':_0x3928fa['id'],'role':_0x3928fa[_0xc4d2('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0xc4d2('0x32')](_0x4d4863)[_0xc4d2('0xc')](function(_0x3c9e45){_0xcb1924['json']({'id':_0x3928fa['id'],'token':_0x3c9e45,'statusCall':'','isAlreadyLogged':_0x3928fa['online']});});}})(_0x1c3149,_0xcb1924,_0x1df10d);};exports[_0xc4d2('0x33')]=function(_0x2fe118,_0x5a4148){if(!_0x2fe118[_0xc4d2('0x34')]['email']){return handleError(_0x5a4148,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4eca55=rs[_0xc4d2('0x35')]();_0x2fe118[_0xc4d2('0x34')][_0xc4d2('0x1f')]=_0x2fe118[_0xc4d2('0x34')][_0xc4d2('0x1f')]['trim']()['toLowerCase']();var _0x12f28a;return db[_0xc4d2('0x36')][_0xc4d2('0x9')]({'where':{'id':0x1},'attributes':[_0xc4d2('0xa'),_0xc4d2('0xb')],'raw':!![]})[_0xc4d2('0xc')](function(_0x46dd11){_0x12f28a=_0x46dd11;return db[_0xc4d2('0x37')][_0xc4d2('0x38')]({'where':{'email':_0x2fe118['body'][_0xc4d2('0x1f')]}});})[_0xc4d2('0xc')](function(_0x2649f1){if(!_0x2649f1){throw new Error(_0xc4d2('0x39'));}if(_0x2649f1[_0xc4d2('0x16')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2649f1[_0xc4d2('0x17')]){if(moment(_0x2649f1[_0xc4d2('0x1a')])[_0xc4d2('0x1b')](_0x12f28a[_0xc4d2('0xb')],_0xc4d2('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2649f1[_0xc4d2('0x17')]=![];_0x2649f1['blockedAt']=null;}}_0x2649f1['resetPasswordToken']=_0x4eca55;_0x2649f1[_0xc4d2('0x3a')]=Date[_0xc4d2('0x3b')]()+0x36ee80;return _0x2649f1[_0xc4d2('0x3c')]();})[_0xc4d2('0xc')](function(){return sendServiceMail({'to':_0x2fe118[_0xc4d2('0x34')][_0xc4d2('0x1f')],'subject':_0xc4d2('0x3d'),'text':_0xc4d2('0x3e')+_0xc4d2('0x3f')+_0xc4d2('0x40')+_0x2fe118[_0xc4d2('0x41')][_0xc4d2('0x42')]+'/reset/'+_0x4eca55+'\x0a\x0a'+_0xc4d2('0x43')});})[_0xc4d2('0xc')](function(){_0x5a4148[_0xc4d2('0x2c')](0xc8)[_0xc4d2('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0xc4d2('0x1d')](function(_0x4f22dc){return handleError(_0x5a4148,0x1f4,_0x4f22dc);});};exports[_0xc4d2('0x44')]=function(_0x1c89d5,_0x3c3cf5){return db[_0xc4d2('0x37')][_0xc4d2('0x38')]({'where':{'resetPasswordToken':_0x1c89d5[_0xc4d2('0x45')][_0xc4d2('0x46')],'resetPasswordExpires':{'$gt':Date[_0xc4d2('0x3b')]()}}})['then'](function(_0x4b2a84){if(!_0x4b2a84){throw new Error(_0xc4d2('0x47'));}return db[_0xc4d2('0x36')][_0xc4d2('0x9')]({'attributes':['id',_0xc4d2('0x48'),_0xc4d2('0x49'),_0xc4d2('0x4a')]})['then'](function(_0x326541){if(_0x326541[_0xc4d2('0x48')])authService['validatePasswordPattern'](_0x1c89d5[_0xc4d2('0x34')][_0xc4d2('0xd')]);if(!_0x326541[_0xc4d2('0x49')]||!_0x4b2a84[_0xc4d2('0x4b')])return _0x4b2a84;authService[_0xc4d2('0x4c')](_0x1c89d5[_0xc4d2('0x34')][_0xc4d2('0xd')],_0x4b2a84[_0xc4d2('0x4b')],_0x326541[_0xc4d2('0x4a')]);return _0x4b2a84;})[_0xc4d2('0xc')](function(){_0x4b2a84[_0xc4d2('0xd')]=_0x1c89d5[_0xc4d2('0x34')][_0xc4d2('0xd')];_0x4b2a84[_0xc4d2('0x4d')]=null;_0x4b2a84['resetPasswordExpires']=null;return _0x4b2a84['save']();});})[_0xc4d2('0xc')](function(){_0x3c3cf5['status'](0xc8)[_0xc4d2('0x2d')]({'message':_0xc4d2('0x4e')});})[_0xc4d2('0x1d')](function(_0x50f1df){return handleError(_0x3c3cf5,0x1f4,_0x50f1df);});};passport['use'](_0xc4d2('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0xc4d2('0xd')},function(_0x960cc0,_0x21c818,_0x2681a7){return localAuthenticate(db['User'],_0x960cc0,_0x21c818,_0x2681a7);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e3ffd11..0c07745 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 _0x906b=['forgot','/reset/:token','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x1a216d,_0x4be127){var _0x1854a6=function(_0x323414){while(--_0x323414){_0x1a216d['push'](_0x1a216d['shift']());}};_0x1854a6(++_0x4be127);}(_0x906b,0xba));var _0xb906=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x906b[_0x30c649];return _0x3edfb9;};'use strict';var express=require(_0xb906('0x0'));var router=express[_0xb906('0x1')]();var controller=require(_0xb906('0x2'));router[_0xb906('0x3')]('/',controller[_0xb906('0x4')]);router[_0xb906('0x3')](_0xb906('0x5'),controller[_0xb906('0x6')]);router[_0xb906('0x3')](_0xb906('0x7'),controller['reset']);module['exports']=router; \ No newline at end of file +var _0x5b9a=['exports','express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset'];(function(_0x40d1d1,_0x562465){var _0xaf96cf=function(_0x222e86){while(--_0x222e86){_0x40d1d1['push'](_0x40d1d1['shift']());}};_0xaf96cf(++_0x562465);}(_0x5b9a,0xab));var _0xa5b9=function(_0xd3bdf6,_0xbe1ffd){_0xd3bdf6=_0xd3bdf6-0x0;var _0x538c03=_0x5b9a[_0xd3bdf6];return _0x538c03;};'use strict';var express=require(_0xa5b9('0x0'));var router=express[_0xa5b9('0x1')]();var controller=require(_0xa5b9('0x2'));router[_0xa5b9('0x3')]('/',controller[_0xa5b9('0x4')]);router[_0xa5b9('0x3')](_0xa5b9('0x5'),controller[_0xa5b9('0x6')]);router[_0xa5b9('0x3')](_0xa5b9('0x7'),controller[_0xa5b9('0x8')]);module[_0xa5b9('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c961735..b6e75e4 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 _0x3d04=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x44a80f,_0x159447){var _0x3bc114=function(_0x1f8d65){while(--_0x1f8d65){_0x44a80f['push'](_0x44a80f['shift']());}};_0x3bc114(++_0x159447);}(_0x3d04,0x11b));var _0x43d0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3d04[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x43d0('0x0'));module['exports']={'name':{'type':Sequelize[_0x43d0('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x43d0('0x1')]},'description':{'type':Sequelize[_0x43d0('0x1')]},'status':{'type':Sequelize[_0x43d0('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x43d0('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xabda=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x566a0f,_0x44fc7e){var _0x1e2b3f=function(_0x51dcf5){while(--_0x51dcf5){_0x566a0f['push'](_0x566a0f['shift']());}};_0x1e2b3f(++_0x44fc7e);}(_0xabda,0x171));var _0xaabd=function(_0x31659b,_0x3f07a1){_0x31659b=_0x31659b-0x0;var _0x48b140=_0xabda[_0x31659b];return _0x48b140;};'use strict';var Sequelize=require(_0xaabd('0x0'));module['exports']={'name':{'type':Sequelize[_0xaabd('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xaabd('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xaabd('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xaabd('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 8a88580..d043058 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 _0x1392=['Content-Range','json','save','update','then','destroy','end','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','Condition','addConditions','omit','ids','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','eml-format','rimraf','request-promise','bluebird','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set'];(function(_0x1563d4,_0x5d0a91){var _0x4ff945=function(_0xb39c97){while(--_0xb39c97){_0x1563d4['push'](_0x1563d4['shift']());}};_0x4ff945(++_0x5d0a91);}(_0x1392,0xdd));var _0x2139=function(_0x234e1a,_0x500d79){_0x234e1a=_0x234e1a-0x0;var _0x55aad2=_0x1392[_0x234e1a];return _0x55aad2;};'use strict';var emlformat=require(_0x2139('0x0'));var rimraf=require(_0x2139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2139('0x2'));var moment=require('moment');var BPromise=require(_0x2139('0x3'));var Mustache=require('mustache');var util=require(_0x2139('0x4'));var path=require(_0x2139('0x5'));var sox=require(_0x2139('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2139('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2139('0x8'));var jsforce=require(_0x2139('0x9'));var deskjs=require(_0x2139('0xa'));var toCsv=require(_0x2139('0xb'));var querystring=require('querystring');var Papa=require(_0x2139('0xc'));var Redis=require(_0x2139('0xd'));var authService=require(_0x2139('0xe'));var qs=require(_0x2139('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2139('0x10'));var logger=require(_0x2139('0x11'))(_0x2139('0x12'));var utils=require(_0x2139('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2139('0x14'));var db=require(_0x2139('0x15'))['db'];function respondWithStatusCode(_0x4163a9,_0x40aac1){_0x40aac1=_0x40aac1||0xcc;return function(_0x1df1c0){if(_0x1df1c0){return _0x4163a9['sendStatus'](_0x40aac1);}return _0x4163a9[_0x2139('0x16')](_0x40aac1)['end']();};}function respondWithResult(_0x2e7ca3,_0x258d79){_0x258d79=_0x258d79||0xc8;return function(_0x2ec222){if(_0x2ec222){return _0x2e7ca3[_0x2139('0x16')](_0x258d79)['json'](_0x2ec222);}};}function respondWithFilteredResult(_0x5f429b,_0xab0c2f){return function(_0x5c41e3){if(_0x5c41e3){var _0x35356c=typeof _0xab0c2f[_0x2139('0x17')]===_0x2139('0x18')&&typeof _0xab0c2f[_0x2139('0x19')]===_0x2139('0x18');var _0x4f6841=_0x5c41e3[_0x2139('0x1a')];var _0x50bcd9=_0x35356c?0x0:_0xab0c2f[_0x2139('0x17')];var _0x3b5ef2=_0x35356c?_0x5c41e3['count']:_0xab0c2f['offset']+_0xab0c2f[_0x2139('0x19')];var _0x19679e;if(_0x3b5ef2>=_0x4f6841){_0x3b5ef2=_0x4f6841;_0x19679e=0xc8;}else{_0x19679e=0xce;}_0x5f429b[_0x2139('0x16')](_0x19679e);return _0x5f429b[_0x2139('0x1b')](_0x2139('0x1c'),_0x50bcd9+'-'+_0x3b5ef2+'/'+_0x4f6841)[_0x2139('0x1d')](_0x5c41e3);}return null;};}function patchUpdates(_0x18fbf2){return function(_0x49fc4b){try{jsonpatch['apply'](_0x49fc4b,_0x18fbf2,!![]);}catch(_0x5e78c5){return BPromise['reject'](_0x5e78c5);}return _0x49fc4b[_0x2139('0x1e')]();};}function saveUpdates(_0xa0ee96,_0x2e511c){return function(_0x2fb957){if(_0x2fb957){return _0x2fb957[_0x2139('0x1f')](_0xa0ee96)[_0x2139('0x20')](function(_0x7826f4){return _0x7826f4;});}return null;};}function removeEntity(_0xd4b762,_0xdea7cd){return function(_0x4a0a28){if(_0x4a0a28){return _0x4a0a28[_0x2139('0x21')]()[_0x2139('0x20')](function(){_0xd4b762['status'](0xcc)[_0x2139('0x22')]();});}};}function handleEntityNotFound(_0x6a0d86,_0x86cd90){return function(_0x300079){if(!_0x300079){_0x6a0d86['sendStatus'](0x194);}return _0x300079;};}function handleError(_0x563184,_0x4d7eaf){_0x4d7eaf=_0x4d7eaf||0x1f4;return function(_0x4ff15e){logger[_0x2139('0x23')](_0x4ff15e[_0x2139('0x24')]);if(_0x4ff15e['name']){delete _0x4ff15e[_0x2139('0x25')];}_0x563184[_0x2139('0x16')](_0x4d7eaf)[_0x2139('0x26')](_0x4ff15e);};}exports[_0x2139('0x27')]=function(_0x813b87,_0x27306d){var _0x12584d={},_0x23793d={},_0x4e57f1={'count':0x0,'rows':[]};var _0x39d7c1=_['map'](db[_0x2139('0x28')][_0x2139('0x29')],function(_0x440868){return{'name':_0x440868[_0x2139('0x2a')],'type':_0x440868[_0x2139('0x2b')][_0x2139('0x2c')]};});_0x23793d[_0x2139('0x2d')]=_[_0x2139('0x2e')](_0x39d7c1,_0x2139('0x25'));_0x23793d['query']=_['keys'](_0x813b87[_0x2139('0x2f')]);_0x23793d[_0x2139('0x30')]=_[_0x2139('0x31')](_0x23793d['model'],_0x23793d[_0x2139('0x2f')]);_0x12584d['attributes']=_[_0x2139('0x31')](_0x23793d[_0x2139('0x2d')],qs['fields'](_0x813b87[_0x2139('0x2f')][_0x2139('0x32')]));_0x12584d[_0x2139('0x33')]=_0x12584d[_0x2139('0x33')][_0x2139('0x34')]?_0x12584d[_0x2139('0x33')]:_0x23793d[_0x2139('0x2d')];if(!_0x813b87['query']['hasOwnProperty'](_0x2139('0x35'))){_0x12584d['limit']=qs[_0x2139('0x19')](_0x813b87[_0x2139('0x2f')][_0x2139('0x19')]);_0x12584d[_0x2139('0x17')]=qs[_0x2139('0x17')](_0x813b87['query'][_0x2139('0x17')]);}_0x12584d[_0x2139('0x36')]=qs[_0x2139('0x37')](_0x813b87[_0x2139('0x2f')][_0x2139('0x37')]);_0x12584d['where']=qs[_0x2139('0x30')](_[_0x2139('0x38')](_0x813b87['query'],_0x23793d['filters']),_0x39d7c1);if(_0x813b87['query']['filter']){_0x12584d[_0x2139('0x39')]=_[_0x2139('0x3a')](_0x12584d[_0x2139('0x39')],{'$or':_['map'](_0x39d7c1,function(_0x5695e9){if(_0x5695e9[_0x2139('0x2b')]!==_0x2139('0x3b')){var _0x510af1={};_0x510af1[_0x5695e9[_0x2139('0x25')]]={'$like':'%'+_0x813b87['query'][_0x2139('0x3c')]+'%'};return _0x510af1;}})});}_0x12584d=_[_0x2139('0x3a')]({},_0x12584d,_0x813b87[_0x2139('0x3d')]);var _0x136426={'where':_0x12584d[_0x2139('0x39')]};return db['Automation'][_0x2139('0x1a')](_0x136426)[_0x2139('0x20')](function(_0x3ed45d){_0x4e57f1[_0x2139('0x1a')]=_0x3ed45d;if(_0x813b87[_0x2139('0x2f')]['includeAll']){_0x12584d[_0x2139('0x3e')]=[{'all':!![]}];}return db[_0x2139('0x28')][_0x2139('0x3f')](_0x12584d);})[_0x2139('0x20')](function(_0x1a671a){_0x4e57f1[_0x2139('0x40')]=_0x1a671a;return _0x4e57f1;})['then'](respondWithFilteredResult(_0x27306d,_0x12584d))[_0x2139('0x41')](handleError(_0x27306d,null));};exports[_0x2139('0x42')]=function(_0x928376,_0x4a082a){var _0x7de1a6={'raw':![],'where':{'id':_0x928376[_0x2139('0x43')]['id']}},_0x16f100={};_0x16f100[_0x2139('0x2d')]=_[_0x2139('0x44')](db[_0x2139('0x28')]['rawAttributes']);_0x16f100[_0x2139('0x2f')]=_['keys'](_0x928376['query']);_0x16f100[_0x2139('0x30')]=_[_0x2139('0x31')](_0x16f100[_0x2139('0x2d')],_0x16f100[_0x2139('0x2f')]);_0x7de1a6[_0x2139('0x33')]=_['intersection'](_0x16f100[_0x2139('0x2d')],qs['fields'](_0x928376[_0x2139('0x2f')][_0x2139('0x32')]));_0x7de1a6[_0x2139('0x33')]=_0x7de1a6[_0x2139('0x33')]['length']?_0x7de1a6[_0x2139('0x33')]:_0x16f100[_0x2139('0x2d')];if(_0x928376[_0x2139('0x2f')][_0x2139('0x45')]){_0x7de1a6[_0x2139('0x3e')]=[{'all':!![]}];}_0x7de1a6=_[_0x2139('0x3a')]({},_0x7de1a6,_0x928376[_0x2139('0x3d')]);return db['Automation'][_0x2139('0x46')](_0x7de1a6)['then'](handleEntityNotFound(_0x4a082a,null))[_0x2139('0x20')](respondWithResult(_0x4a082a,null))[_0x2139('0x41')](handleError(_0x4a082a,null));};exports[_0x2139('0x47')]=function(_0x2225a4,_0x21f9a2){return db[_0x2139('0x28')]['create'](_0x2225a4['body'],{})[_0x2139('0x20')](respondWithResult(_0x21f9a2,0xc9))['catch'](handleError(_0x21f9a2,null));};exports[_0x2139('0x1f')]=function(_0x4a93de,_0x3acd64){if(_0x4a93de['body']['id']){delete _0x4a93de[_0x2139('0x48')]['id'];}return db['Automation'][_0x2139('0x46')]({'where':{'id':_0x4a93de[_0x2139('0x43')]['id']}})[_0x2139('0x20')](handleEntityNotFound(_0x3acd64,null))[_0x2139('0x20')](saveUpdates(_0x4a93de[_0x2139('0x48')],null))[_0x2139('0x20')](respondWithResult(_0x3acd64,null))['catch'](handleError(_0x3acd64,null));};exports[_0x2139('0x21')]=function(_0x5d5cd4,_0x5d4fff){return db[_0x2139('0x28')]['find']({'where':{'id':_0x5d5cd4[_0x2139('0x43')]['id']}})[_0x2139('0x20')](handleEntityNotFound(_0x5d4fff,null))[_0x2139('0x20')](removeEntity(_0x5d4fff,null))[_0x2139('0x41')](handleError(_0x5d4fff,null));};exports['addConditions']=function(_0x185b77,_0x241757,_0x2f9bd7){return db[_0x2139('0x49')][_0x2139('0x46')]({'where':{'id':_0x185b77[_0x2139('0x43')]['id']}})[_0x2139('0x20')](handleEntityNotFound(_0x241757,null))[_0x2139('0x20')](function(_0x26eff4){if(_0x26eff4){return _0x26eff4[_0x2139('0x4a')](_0x185b77[_0x2139('0x48')]['ids'],_[_0x2139('0x4b')](_0x185b77[_0x2139('0x48')],[_0x2139('0x4c'),'id'])||{});}})[_0x2139('0x20')](respondWithResult(_0x241757,null))[_0x2139('0x41')](handleError(_0x241757,null));};exports[_0x2139('0x4d')]=function(_0x5186bc,_0x357d74,_0x2814a5){var _0x5ea348={};var _0x51f7a9={};var _0x4ab9cc;var _0x37d06d;return db[_0x2139('0x28')][_0x2139('0x4e')]({'where':{'id':_0x5186bc[_0x2139('0x43')]['id']}})[_0x2139('0x20')](handleEntityNotFound(_0x357d74,null))[_0x2139('0x20')](function(_0x59ca68){if(_0x59ca68){_0x4ab9cc=_0x59ca68;_0x51f7a9[_0x2139('0x2d')]=_[_0x2139('0x44')](db[_0x2139('0x49')][_0x2139('0x29')]);_0x51f7a9['query']=_[_0x2139('0x44')](_0x5186bc[_0x2139('0x2f')]);_0x51f7a9['filters']=_[_0x2139('0x31')](_0x51f7a9[_0x2139('0x2d')],_0x51f7a9['query']);_0x5ea348['attributes']=_['intersection'](_0x51f7a9[_0x2139('0x2d')],qs[_0x2139('0x32')](_0x5186bc['query']['fields']));_0x5ea348[_0x2139('0x33')]=_0x5ea348[_0x2139('0x33')][_0x2139('0x34')]?_0x5ea348['attributes']:_0x51f7a9[_0x2139('0x2d')];_0x5ea348['order']=qs[_0x2139('0x37')](_0x5186bc['query'][_0x2139('0x37')]);_0x5ea348[_0x2139('0x39')]=qs['filters'](_['pick'](_0x5186bc[_0x2139('0x2f')],_0x51f7a9[_0x2139('0x30')]));if(_0x5186bc[_0x2139('0x2f')][_0x2139('0x3c')]){_0x5ea348[_0x2139('0x39')]=_['merge'](_0x5ea348[_0x2139('0x39')],{'$or':_[_0x2139('0x2e')](_0x5ea348[_0x2139('0x33')],function(_0x1953c5){var _0x24ca85={};_0x24ca85[_0x1953c5]={'$like':'%'+_0x5186bc[_0x2139('0x2f')][_0x2139('0x3c')]+'%'};return _0x24ca85;})});}_0x5ea348=_['merge']({},_0x5ea348,_0x5186bc[_0x2139('0x3d')]);return _0x4ab9cc[_0x2139('0x4d')](_0x5ea348);}})[_0x2139('0x20')](function(_0x5cf1dd){if(_0x5cf1dd){_0x37d06d=_0x5cf1dd['length'];if(!_0x5186bc[_0x2139('0x2f')]['hasOwnProperty'](_0x2139('0x35'))){_0x5ea348['limit']=qs[_0x2139('0x19')](_0x5186bc[_0x2139('0x2f')][_0x2139('0x19')]);_0x5ea348[_0x2139('0x17')]=qs['offset'](_0x5186bc['query']['offset']);}return _0x4ab9cc[_0x2139('0x4d')](_0x5ea348);}})['then'](function(_0x2cb378){if(_0x2cb378){return _0x2cb378?{'count':_0x37d06d,'rows':_0x2cb378}:null;}})[_0x2139('0x20')](respondWithResult(_0x357d74,null))['catch'](handleError(_0x357d74,null));};exports['addActions']=function(_0x239f17,_0x575ec6,_0x51dc9b){return db['Action'][_0x2139('0x46')]({'where':{'id':_0x239f17[_0x2139('0x43')]['id']}})[_0x2139('0x20')](handleEntityNotFound(_0x575ec6,null))[_0x2139('0x20')](function(_0x53909f){if(_0x53909f){return _0x53909f[_0x2139('0x4f')](_0x239f17[_0x2139('0x48')][_0x2139('0x4c')],_[_0x2139('0x4b')](_0x239f17[_0x2139('0x48')],['ids','id'])||{});}})[_0x2139('0x20')](respondWithResult(_0x575ec6,null))['catch'](handleError(_0x575ec6,null));};exports['getActions']=function(_0x58e1e5,_0x482dcc,_0x4747d6){var _0x2eb774={};var _0x236566={};var _0x240f7b;var _0x35af2c;return db[_0x2139('0x28')]['findOne']({'where':{'id':_0x58e1e5[_0x2139('0x43')]['id']}})[_0x2139('0x20')](handleEntityNotFound(_0x482dcc,null))['then'](function(_0x5a4135){if(_0x5a4135){_0x240f7b=_0x5a4135;_0x236566[_0x2139('0x2d')]=_['keys'](db[_0x2139('0x50')][_0x2139('0x29')]);_0x236566[_0x2139('0x2f')]=_[_0x2139('0x44')](_0x58e1e5['query']);_0x236566[_0x2139('0x30')]=_[_0x2139('0x31')](_0x236566['model'],_0x236566[_0x2139('0x2f')]);_0x2eb774[_0x2139('0x33')]=_[_0x2139('0x31')](_0x236566[_0x2139('0x2d')],qs['fields'](_0x58e1e5[_0x2139('0x2f')][_0x2139('0x32')]));_0x2eb774['attributes']=_0x2eb774['attributes']['length']?_0x2eb774[_0x2139('0x33')]:_0x236566['model'];_0x2eb774[_0x2139('0x36')]=qs['sort'](_0x58e1e5[_0x2139('0x2f')][_0x2139('0x37')]);_0x2eb774[_0x2139('0x39')]=qs[_0x2139('0x30')](_[_0x2139('0x38')](_0x58e1e5['query'],_0x236566[_0x2139('0x30')]));if(_0x58e1e5[_0x2139('0x2f')]['filter']){_0x2eb774['where']=_['merge'](_0x2eb774[_0x2139('0x39')],{'$or':_[_0x2139('0x2e')](_0x2eb774[_0x2139('0x33')],function(_0x79cec6){var _0x2c42df={};_0x2c42df[_0x79cec6]={'$like':'%'+_0x58e1e5[_0x2139('0x2f')][_0x2139('0x3c')]+'%'};return _0x2c42df;})});}_0x2eb774=_['merge']({},_0x2eb774,_0x58e1e5[_0x2139('0x3d')]);return _0x240f7b[_0x2139('0x51')](_0x2eb774);}})[_0x2139('0x20')](function(_0x3b3e96){if(_0x3b3e96){_0x35af2c=_0x3b3e96['length'];if(!_0x58e1e5[_0x2139('0x2f')][_0x2139('0x52')]('nolimit')){_0x2eb774[_0x2139('0x19')]=qs[_0x2139('0x19')](_0x58e1e5['query'][_0x2139('0x19')]);_0x2eb774[_0x2139('0x17')]=qs[_0x2139('0x17')](_0x58e1e5['query'][_0x2139('0x17')]);}return _0x240f7b[_0x2139('0x51')](_0x2eb774);}})[_0x2139('0x20')](function(_0x2807b1){if(_0x2807b1){return _0x2807b1?{'count':_0x35af2c,'rows':_0x2807b1}:null;}})[_0x2139('0x20')](respondWithResult(_0x482dcc,null))['catch'](handleError(_0x482dcc,null));}; \ No newline at end of file +var _0xa201=['destroy','addConditions','Condition','ids','omit','getConditions','findOne','order','pick','addActions','getActions','Action','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','merge','find','create','body'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa201,0x1a1));var _0x1a20=function(_0x533b5f,_0x238373){_0x533b5f=_0x533b5f-0x0;var _0x4b40a3=_0xa201[_0x533b5f];return _0x4b40a3;};'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(_0x1a20('0x0'));var moment=require(_0x1a20('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1a20('0x2'));var util=require(_0x1a20('0x3'));var path=require(_0x1a20('0x4'));var sox=require('sox');var csv=require(_0x1a20('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a20('0x6'));var _=require(_0x1a20('0x7'));var squel=require(_0x1a20('0x8'));var crypto=require(_0x1a20('0x9'));var jsforce=require(_0x1a20('0xa'));var deskjs=require(_0x1a20('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1a20('0xc'));var Papa=require(_0x1a20('0xd'));var Redis=require(_0x1a20('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1a20('0xf'));var as=require(_0x1a20('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a20('0x11'))(_0x1a20('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a20('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b7e31,_0x2394e2){_0x2394e2=_0x2394e2||0xcc;return function(_0x50ffea){if(_0x50ffea){return _0x4b7e31[_0x1a20('0x14')](_0x2394e2);}return _0x4b7e31[_0x1a20('0x15')](_0x2394e2)[_0x1a20('0x16')]();};}function respondWithResult(_0x2771ac,_0x588e2d){_0x588e2d=_0x588e2d||0xc8;return function(_0x3baa65){if(_0x3baa65){return _0x2771ac[_0x1a20('0x15')](_0x588e2d)[_0x1a20('0x17')](_0x3baa65);}};}function respondWithFilteredResult(_0x55dc11,_0x2d1305){return function(_0x4e1142){if(_0x4e1142){var _0x406546=typeof _0x2d1305[_0x1a20('0x18')]==='undefined'&&typeof _0x2d1305['limit']==='undefined';var _0xa10c09=_0x4e1142['count'];var _0x1bf84b=_0x406546?0x0:_0x2d1305[_0x1a20('0x18')];var _0xbf3bb7=_0x406546?_0x4e1142[_0x1a20('0x19')]:_0x2d1305[_0x1a20('0x18')]+_0x2d1305['limit'];var _0xe3df21;if(_0xbf3bb7>=_0xa10c09){_0xbf3bb7=_0xa10c09;_0xe3df21=0xc8;}else{_0xe3df21=0xce;}_0x55dc11[_0x1a20('0x15')](_0xe3df21);return _0x55dc11[_0x1a20('0x1a')](_0x1a20('0x1b'),_0x1bf84b+'-'+_0xbf3bb7+'/'+_0xa10c09)['json'](_0x4e1142);}return null;};}function patchUpdates(_0x49382d){return function(_0x54a29e){try{jsonpatch[_0x1a20('0x1c')](_0x54a29e,_0x49382d,!![]);}catch(_0x5418c9){return BPromise[_0x1a20('0x1d')](_0x5418c9);}return _0x54a29e[_0x1a20('0x1e')]();};}function saveUpdates(_0x109996,_0x3e624f){return function(_0x2304b4){if(_0x2304b4){return _0x2304b4[_0x1a20('0x1f')](_0x109996)[_0x1a20('0x20')](function(_0x3f0918){return _0x3f0918;});}return null;};}function removeEntity(_0x33f833,_0x408ba2){return function(_0xd289b4){if(_0xd289b4){return _0xd289b4['destroy']()[_0x1a20('0x20')](function(){_0x33f833[_0x1a20('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f9850,_0x296dc6){return function(_0x5bcc74){if(!_0x5bcc74){_0x3f9850[_0x1a20('0x14')](0x194);}return _0x5bcc74;};}function handleError(_0x58c20e,_0x551c6e){_0x551c6e=_0x551c6e||0x1f4;return function(_0x5ec700){logger[_0x1a20('0x21')](_0x5ec700[_0x1a20('0x22')]);if(_0x5ec700[_0x1a20('0x23')]){delete _0x5ec700[_0x1a20('0x23')];}_0x58c20e[_0x1a20('0x15')](_0x551c6e)[_0x1a20('0x24')](_0x5ec700);};}exports[_0x1a20('0x25')]=function(_0x55e38f,_0x4de271){var _0x146bc8={},_0x5063aa={},_0x2fe951={'count':0x0,'rows':[]};var _0x1fc8cc=_[_0x1a20('0x26')](db[_0x1a20('0x27')][_0x1a20('0x28')],function(_0x57173b){return{'name':_0x57173b[_0x1a20('0x29')],'type':_0x57173b[_0x1a20('0x2a')][_0x1a20('0x2b')]};});_0x5063aa[_0x1a20('0x2c')]=_[_0x1a20('0x26')](_0x1fc8cc,_0x1a20('0x23'));_0x5063aa[_0x1a20('0x2d')]=_['keys'](_0x55e38f[_0x1a20('0x2d')]);_0x5063aa[_0x1a20('0x2e')]=_[_0x1a20('0x2f')](_0x5063aa[_0x1a20('0x2c')],_0x5063aa[_0x1a20('0x2d')]);_0x146bc8[_0x1a20('0x30')]=_[_0x1a20('0x2f')](_0x5063aa[_0x1a20('0x2c')],qs['fields'](_0x55e38f[_0x1a20('0x2d')][_0x1a20('0x31')]));_0x146bc8[_0x1a20('0x30')]=_0x146bc8[_0x1a20('0x30')][_0x1a20('0x32')]?_0x146bc8[_0x1a20('0x30')]:_0x5063aa[_0x1a20('0x2c')];if(!_0x55e38f[_0x1a20('0x2d')][_0x1a20('0x33')](_0x1a20('0x34'))){_0x146bc8[_0x1a20('0x35')]=qs[_0x1a20('0x35')](_0x55e38f[_0x1a20('0x2d')][_0x1a20('0x35')]);_0x146bc8[_0x1a20('0x18')]=qs[_0x1a20('0x18')](_0x55e38f[_0x1a20('0x2d')]['offset']);}_0x146bc8['order']=qs[_0x1a20('0x36')](_0x55e38f[_0x1a20('0x2d')][_0x1a20('0x36')]);_0x146bc8[_0x1a20('0x37')]=qs['filters'](_['pick'](_0x55e38f[_0x1a20('0x2d')],_0x5063aa[_0x1a20('0x2e')]),_0x1fc8cc);if(_0x55e38f[_0x1a20('0x2d')]['filter']){_0x146bc8['where']=_['merge'](_0x146bc8['where'],{'$or':_[_0x1a20('0x26')](_0x1fc8cc,function(_0x1a5471){if(_0x1a5471[_0x1a20('0x2a')]!==_0x1a20('0x38')){var _0x3967e8={};_0x3967e8[_0x1a5471[_0x1a20('0x23')]]={'$like':'%'+_0x55e38f[_0x1a20('0x2d')][_0x1a20('0x39')]+'%'};return _0x3967e8;}})});}_0x146bc8=_['merge']({},_0x146bc8,_0x55e38f[_0x1a20('0x3a')]);var _0x4f5f83={'where':_0x146bc8['where']};return db['Automation'][_0x1a20('0x19')](_0x4f5f83)[_0x1a20('0x20')](function(_0x3dce22){_0x2fe951[_0x1a20('0x19')]=_0x3dce22;if(_0x55e38f['query']['includeAll']){_0x146bc8[_0x1a20('0x3b')]=[{'all':!![]}];}return db['Automation'][_0x1a20('0x3c')](_0x146bc8);})[_0x1a20('0x20')](function(_0x2e6a02){_0x2fe951[_0x1a20('0x3d')]=_0x2e6a02;return _0x2fe951;})['then'](respondWithFilteredResult(_0x4de271,_0x146bc8))[_0x1a20('0x3e')](handleError(_0x4de271,null));};exports['show']=function(_0x2ae17c,_0x3be8a4){var _0x31e681={'raw':![],'where':{'id':_0x2ae17c[_0x1a20('0x3f')]['id']}},_0x44b27d={};_0x44b27d['model']=_[_0x1a20('0x40')](db[_0x1a20('0x27')][_0x1a20('0x28')]);_0x44b27d[_0x1a20('0x2d')]=_['keys'](_0x2ae17c[_0x1a20('0x2d')]);_0x44b27d[_0x1a20('0x2e')]=_[_0x1a20('0x2f')](_0x44b27d[_0x1a20('0x2c')],_0x44b27d[_0x1a20('0x2d')]);_0x31e681[_0x1a20('0x30')]=_[_0x1a20('0x2f')](_0x44b27d['model'],qs[_0x1a20('0x31')](_0x2ae17c['query']['fields']));_0x31e681[_0x1a20('0x30')]=_0x31e681['attributes'][_0x1a20('0x32')]?_0x31e681['attributes']:_0x44b27d['model'];if(_0x2ae17c[_0x1a20('0x2d')]['includeAll']){_0x31e681[_0x1a20('0x3b')]=[{'all':!![]}];}_0x31e681=_[_0x1a20('0x41')]({},_0x31e681,_0x2ae17c[_0x1a20('0x3a')]);return db[_0x1a20('0x27')][_0x1a20('0x42')](_0x31e681)[_0x1a20('0x20')](handleEntityNotFound(_0x3be8a4,null))[_0x1a20('0x20')](respondWithResult(_0x3be8a4,null))[_0x1a20('0x3e')](handleError(_0x3be8a4,null));};exports[_0x1a20('0x43')]=function(_0x34bdfd,_0x4292cd){return db[_0x1a20('0x27')][_0x1a20('0x43')](_0x34bdfd[_0x1a20('0x44')],{})[_0x1a20('0x20')](respondWithResult(_0x4292cd,0xc9))[_0x1a20('0x3e')](handleError(_0x4292cd,null));};exports['update']=function(_0x5734d5,_0x515f5e){if(_0x5734d5[_0x1a20('0x44')]['id']){delete _0x5734d5[_0x1a20('0x44')]['id'];}return db[_0x1a20('0x27')][_0x1a20('0x42')]({'where':{'id':_0x5734d5['params']['id']}})[_0x1a20('0x20')](handleEntityNotFound(_0x515f5e,null))[_0x1a20('0x20')](saveUpdates(_0x5734d5[_0x1a20('0x44')],null))[_0x1a20('0x20')](respondWithResult(_0x515f5e,null))[_0x1a20('0x3e')](handleError(_0x515f5e,null));};exports[_0x1a20('0x45')]=function(_0x3f558a,_0x5d0537){return db[_0x1a20('0x27')][_0x1a20('0x42')]({'where':{'id':_0x3f558a[_0x1a20('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d0537,null))['then'](removeEntity(_0x5d0537,null))[_0x1a20('0x3e')](handleError(_0x5d0537,null));};exports[_0x1a20('0x46')]=function(_0x726223,_0x6f2fd7,_0x52d02f){return db[_0x1a20('0x47')][_0x1a20('0x42')]({'where':{'id':_0x726223[_0x1a20('0x3f')]['id']}})[_0x1a20('0x20')](handleEntityNotFound(_0x6f2fd7,null))[_0x1a20('0x20')](function(_0x2cb9dd){if(_0x2cb9dd){return _0x2cb9dd['addConditions'](_0x726223[_0x1a20('0x44')][_0x1a20('0x48')],_[_0x1a20('0x49')](_0x726223[_0x1a20('0x44')],['ids','id'])||{});}})['then'](respondWithResult(_0x6f2fd7,null))[_0x1a20('0x3e')](handleError(_0x6f2fd7,null));};exports[_0x1a20('0x4a')]=function(_0x2fb120,_0x589ae4,_0x38ee79){var _0x205830={};var _0x547ef3={};var _0x1dda23;var _0xf79ab6;return db[_0x1a20('0x27')][_0x1a20('0x4b')]({'where':{'id':_0x2fb120[_0x1a20('0x3f')]['id']}})[_0x1a20('0x20')](handleEntityNotFound(_0x589ae4,null))[_0x1a20('0x20')](function(_0x526bd0){if(_0x526bd0){_0x1dda23=_0x526bd0;_0x547ef3['model']=_[_0x1a20('0x40')](db['Condition'][_0x1a20('0x28')]);_0x547ef3['query']=_['keys'](_0x2fb120['query']);_0x547ef3[_0x1a20('0x2e')]=_[_0x1a20('0x2f')](_0x547ef3[_0x1a20('0x2c')],_0x547ef3[_0x1a20('0x2d')]);_0x205830[_0x1a20('0x30')]=_[_0x1a20('0x2f')](_0x547ef3[_0x1a20('0x2c')],qs[_0x1a20('0x31')](_0x2fb120[_0x1a20('0x2d')][_0x1a20('0x31')]));_0x205830[_0x1a20('0x30')]=_0x205830[_0x1a20('0x30')]['length']?_0x205830[_0x1a20('0x30')]:_0x547ef3[_0x1a20('0x2c')];_0x205830[_0x1a20('0x4c')]=qs[_0x1a20('0x36')](_0x2fb120[_0x1a20('0x2d')][_0x1a20('0x36')]);_0x205830[_0x1a20('0x37')]=qs['filters'](_[_0x1a20('0x4d')](_0x2fb120['query'],_0x547ef3[_0x1a20('0x2e')]));if(_0x2fb120[_0x1a20('0x2d')][_0x1a20('0x39')]){_0x205830[_0x1a20('0x37')]=_[_0x1a20('0x41')](_0x205830[_0x1a20('0x37')],{'$or':_[_0x1a20('0x26')](_0x205830['attributes'],function(_0x190bd6){var _0x410141={};_0x410141[_0x190bd6]={'$like':'%'+_0x2fb120['query']['filter']+'%'};return _0x410141;})});}_0x205830=_[_0x1a20('0x41')]({},_0x205830,_0x2fb120[_0x1a20('0x3a')]);return _0x1dda23[_0x1a20('0x4a')](_0x205830);}})[_0x1a20('0x20')](function(_0x119c5e){if(_0x119c5e){_0xf79ab6=_0x119c5e['length'];if(!_0x2fb120[_0x1a20('0x2d')][_0x1a20('0x33')](_0x1a20('0x34'))){_0x205830[_0x1a20('0x35')]=qs['limit'](_0x2fb120[_0x1a20('0x2d')][_0x1a20('0x35')]);_0x205830[_0x1a20('0x18')]=qs['offset'](_0x2fb120[_0x1a20('0x2d')][_0x1a20('0x18')]);}return _0x1dda23[_0x1a20('0x4a')](_0x205830);}})[_0x1a20('0x20')](function(_0x4f6be5){if(_0x4f6be5){return _0x4f6be5?{'count':_0xf79ab6,'rows':_0x4f6be5}:null;}})[_0x1a20('0x20')](respondWithResult(_0x589ae4,null))[_0x1a20('0x3e')](handleError(_0x589ae4,null));};exports['addActions']=function(_0x231f38,_0x3d8912,_0x4ed334){return db['Action'][_0x1a20('0x42')]({'where':{'id':_0x231f38[_0x1a20('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3d8912,null))[_0x1a20('0x20')](function(_0x530dca){if(_0x530dca){return _0x530dca[_0x1a20('0x4e')](_0x231f38[_0x1a20('0x44')]['ids'],_['omit'](_0x231f38[_0x1a20('0x44')],[_0x1a20('0x48'),'id'])||{});}})[_0x1a20('0x20')](respondWithResult(_0x3d8912,null))[_0x1a20('0x3e')](handleError(_0x3d8912,null));};exports[_0x1a20('0x4f')]=function(_0x403563,_0x2488cc,_0x519559){var _0xe8076f={};var _0x3d980b={};var _0x2fead2;var _0x1a007e;return db['Automation'][_0x1a20('0x4b')]({'where':{'id':_0x403563[_0x1a20('0x3f')]['id']}})[_0x1a20('0x20')](handleEntityNotFound(_0x2488cc,null))[_0x1a20('0x20')](function(_0x1d408c){if(_0x1d408c){_0x2fead2=_0x1d408c;_0x3d980b['model']=_[_0x1a20('0x40')](db[_0x1a20('0x50')][_0x1a20('0x28')]);_0x3d980b['query']=_[_0x1a20('0x40')](_0x403563[_0x1a20('0x2d')]);_0x3d980b['filters']=_[_0x1a20('0x2f')](_0x3d980b[_0x1a20('0x2c')],_0x3d980b['query']);_0xe8076f[_0x1a20('0x30')]=_[_0x1a20('0x2f')](_0x3d980b['model'],qs[_0x1a20('0x31')](_0x403563['query'][_0x1a20('0x31')]));_0xe8076f[_0x1a20('0x30')]=_0xe8076f[_0x1a20('0x30')][_0x1a20('0x32')]?_0xe8076f[_0x1a20('0x30')]:_0x3d980b[_0x1a20('0x2c')];_0xe8076f[_0x1a20('0x4c')]=qs['sort'](_0x403563[_0x1a20('0x2d')][_0x1a20('0x36')]);_0xe8076f[_0x1a20('0x37')]=qs['filters'](_['pick'](_0x403563[_0x1a20('0x2d')],_0x3d980b[_0x1a20('0x2e')]));if(_0x403563['query'][_0x1a20('0x39')]){_0xe8076f[_0x1a20('0x37')]=_['merge'](_0xe8076f[_0x1a20('0x37')],{'$or':_[_0x1a20('0x26')](_0xe8076f[_0x1a20('0x30')],function(_0x1e19a1){var _0x502a96={};_0x502a96[_0x1e19a1]={'$like':'%'+_0x403563[_0x1a20('0x2d')][_0x1a20('0x39')]+'%'};return _0x502a96;})});}_0xe8076f=_[_0x1a20('0x41')]({},_0xe8076f,_0x403563[_0x1a20('0x3a')]);return _0x2fead2[_0x1a20('0x4f')](_0xe8076f);}})['then'](function(_0x11ade5){if(_0x11ade5){_0x1a007e=_0x11ade5['length'];if(!_0x403563[_0x1a20('0x2d')][_0x1a20('0x33')](_0x1a20('0x34'))){_0xe8076f[_0x1a20('0x35')]=qs[_0x1a20('0x35')](_0x403563[_0x1a20('0x2d')][_0x1a20('0x35')]);_0xe8076f[_0x1a20('0x18')]=qs[_0x1a20('0x18')](_0x403563[_0x1a20('0x2d')][_0x1a20('0x18')]);}return _0x2fead2[_0x1a20('0x4f')](_0xe8076f);}})[_0x1a20('0x20')](function(_0x308fb2){if(_0x308fb2){return _0x308fb2?{'count':_0x1a007e,'rows':_0x308fb2}:null;}})[_0x1a20('0x20')](respondWithResult(_0x2488cc,null))[_0x1a20('0x3e')](handleError(_0x2488cc,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index bc23b7a..eba4eae 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 _0xb547=['util','api','moment','bluebird','path','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x4822ae,_0x5abf83){var _0x2d7e1e=function(_0x1c679a){while(--_0x1c679a){_0x4822ae['push'](_0x4822ae['shift']());}};_0x2d7e1e(++_0x5abf83);}(_0xb547,0xaa));var _0x7b54=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0xb547[_0x50c492];return _0x3505a8;};'use strict';var _=require('lodash');var util=require(_0x7b54('0x0'));var logger=require('../../config/logger')(_0x7b54('0x1'));var moment=require(_0x7b54('0x2'));var BPromise=require(_0x7b54('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b54('0x4'));var rimraf=require('rimraf');var config=require(_0x7b54('0x5'));var attributes=require(_0x7b54('0x6'));module[_0x7b54('0x7')]=function(_0x64821e,_0x2260ac){return _0x64821e[_0x7b54('0x8')](_0x7b54('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11b3=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','Automation','lodash'];(function(_0x39d38e,_0x3da1f7){var _0x18e737=function(_0x373eef){while(--_0x373eef){_0x39d38e['push'](_0x39d38e['shift']());}};_0x18e737(++_0x3da1f7);}(_0x11b3,0x1e3));var _0x311b=function(_0x41a92c,_0x151201){_0x41a92c=_0x41a92c-0x0;var _0x123f63=_0x11b3[_0x41a92c];return _0x123f63;};'use strict';var _=require(_0x311b('0x0'));var util=require(_0x311b('0x1'));var logger=require(_0x311b('0x2'))(_0x311b('0x3'));var moment=require(_0x311b('0x4'));var BPromise=require(_0x311b('0x5'));var rp=require(_0x311b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x311b('0x7'));var config=require(_0x311b('0x8'));var attributes=require(_0x311b('0x9'));module['exports']=function(_0x42490c,_0x55601a){return _0x42490c['define'](_0x311b('0xa'),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 06516e1..e109ab2 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 _0xf682=['Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info'];(function(_0x4e2456,_0x15fc37){var _0x35a7cc=function(_0x39fb28){while(--_0x39fb28){_0x4e2456['push'](_0x4e2456['shift']());}};_0x35a7cc(++_0x15fc37);}(_0xf682,0x12f));var _0x2f68=function(_0x5d7b06,_0x3cf35d){_0x5d7b06=_0x5d7b06-0x0;var _0x327660=_0xf682[_0x5d7b06];return _0x327660;};'use strict';var _=require(_0x2f68('0x0'));var util=require(_0x2f68('0x1'));var moment=require(_0x2f68('0x2'));var BPromise=require(_0x2f68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f68('0x4'))['db'];var utils=require(_0x2f68('0x5'));var logger=require(_0x2f68('0x6'))(_0x2f68('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f68('0x8'));var client=jayson[_0x2f68('0x9')][_0x2f68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e31,_0x48624e,_0x2523dc){return new BPromise(function(_0x3a4dad,_0x56d93c){return client['request'](_0x3c4e31,_0x2523dc)['then'](function(_0x57a6b0){logger[_0x2f68('0xb')](_0x2f68('0xc'),_0x48624e,_0x2f68('0xd'));logger[_0x2f68('0xe')](_0x2f68('0xf'),_0x48624e,_0x2f68('0xd'),JSON[_0x2f68('0x10')](_0x57a6b0));if(_0x57a6b0[_0x2f68('0x11')]){if(_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x12')]===0x1f4){logger[_0x2f68('0x11')](_0x2f68('0xc'),_0x48624e,_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);return _0x56d93c(_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);}logger['error'](_0x2f68('0xc'),_0x48624e,_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);return _0x3a4dad(_0x57a6b0[_0x2f68('0x11')][_0x2f68('0x13')]);}else{logger[_0x2f68('0xb')](_0x2f68('0xc'),_0x48624e,_0x2f68('0xd'));_0x3a4dad(_0x57a6b0['result'][_0x2f68('0x13')]);}})[_0x2f68('0x14')](function(_0xc2b460){logger['error'](_0x2f68('0xc'),_0x48624e,_0xc2b460);_0x56d93c(_0xc2b460);});});} \ No newline at end of file +var _0xcd6f=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','debug','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x330b1b,_0x4b8fd7){_0x330b1b=_0x330b1b-0x0;var _0x5bb296=_0xcd6f[_0x330b1b];return _0x5bb296;};'use strict';var _=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var moment=require(_0xfcd6('0x2'));var BPromise=require(_0xfcd6('0x3'));var rs=require(_0xfcd6('0x4'));var fs=require('fs');var Redis=require(_0xfcd6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcd6('0x6'));var logger=require(_0xfcd6('0x7'))(_0xfcd6('0x8'));var config=require(_0xfcd6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfcd6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16a180,_0x51329c,_0x135b7e){return new BPromise(function(_0xfc5139,_0x544104){return client[_0xfcd6('0xb')](_0x16a180,_0x135b7e)['then'](function(_0x12dc78){logger['info']('Automation,\x20%s,\x20%s',_0x51329c,'request\x20sent');logger[_0xfcd6('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x51329c,'request\x20sent',JSON[_0xfcd6('0xd')](_0x12dc78));if(_0x12dc78[_0xfcd6('0xe')]){if(_0x12dc78['error'][_0xfcd6('0xf')]===0x1f4){logger[_0xfcd6('0xe')](_0xfcd6('0x10'),_0x51329c,_0x12dc78[_0xfcd6('0xe')][_0xfcd6('0x11')]);return _0x544104(_0x12dc78[_0xfcd6('0xe')][_0xfcd6('0x11')]);}logger[_0xfcd6('0xe')](_0xfcd6('0x10'),_0x51329c,_0x12dc78[_0xfcd6('0xe')][_0xfcd6('0x11')]);return _0xfc5139(_0x12dc78[_0xfcd6('0xe')][_0xfcd6('0x11')]);}else{logger[_0xfcd6('0x12')]('Automation,\x20%s,\x20%s',_0x51329c,'request\x20sent');_0xfc5139(_0x12dc78[_0xfcd6('0x13')][_0xfcd6('0x11')]);}})['catch'](function(_0x29d25d){logger[_0xfcd6('0xe')](_0xfcd6('0x10'),_0x51329c,_0x29d25d);_0x544104(_0x29d25d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0947296..7ec6bab 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 _0x64b0=['create','addActions','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x64b0,0x74));var _0x064b=function(_0x20238a,_0x35f00b){_0x20238a=_0x20238a-0x0;var _0x1c4d9f=_0x64b0[_0x20238a];return _0x1c4d9f;};'use strict';var multer=require(_0x064b('0x0'));var util=require(_0x064b('0x1'));var path=require(_0x064b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x064b('0x3')]();var fs_extra=require(_0x064b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x064b('0x5'));var config=require(_0x064b('0x6'));var controller=require('./automation.controller');router[_0x064b('0x7')]('/',auth[_0x064b('0x8')](),controller['index']);router[_0x064b('0x7')](_0x064b('0x9'),auth[_0x064b('0x8')](),controller[_0x064b('0xa')]);router['get'](_0x064b('0xb'),auth[_0x064b('0x8')](),controller[_0x064b('0xc')]);router[_0x064b('0x7')](_0x064b('0xd'),auth[_0x064b('0x8')](),controller[_0x064b('0xe')]);router[_0x064b('0xf')]('/',auth['isAuthenticated'](),controller[_0x064b('0x10')]);router['post'](_0x064b('0xb'),auth[_0x064b('0x8')](),controller['addConditions']);router[_0x064b('0xf')](_0x064b('0xd'),auth[_0x064b('0x8')](),controller[_0x064b('0x11')]);router[_0x064b('0x12')]('/:id',auth[_0x064b('0x8')](),controller[_0x064b('0x13')]);router['delete'](_0x064b('0x9'),auth[_0x064b('0x8')](),controller[_0x064b('0x14')]);module[_0x064b('0x15')]=router; \ No newline at end of file +var _0xc01b=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','getActions','post','/:id/conditions','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x76fea7,_0x164167){var _0x3183c0=function(_0x1f4a4f){while(--_0x1f4a4f){_0x76fea7['push'](_0x76fea7['shift']());}};_0x3183c0(++_0x164167);}(_0xc01b,0x74));var _0xbc01=function(_0x180671,_0x49a116){_0x180671=_0x180671-0x0;var _0x69fdbd=_0xc01b[_0x180671];return _0x69fdbd;};'use strict';var multer=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var path=require(_0xbc01('0x2'));var timeout=require(_0xbc01('0x3'));var express=require(_0xbc01('0x4'));var router=express[_0xbc01('0x5')]();var fs_extra=require(_0xbc01('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbc01('0x7'));var config=require(_0xbc01('0x8'));var controller=require(_0xbc01('0x9'));router[_0xbc01('0xa')]('/',auth[_0xbc01('0xb')](),controller[_0xbc01('0xc')]);router[_0xbc01('0xa')](_0xbc01('0xd'),auth[_0xbc01('0xb')](),controller[_0xbc01('0xe')]);router[_0xbc01('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xbc01('0xf')]);router[_0xbc01('0xa')](_0xbc01('0x10'),auth[_0xbc01('0xb')](),controller[_0xbc01('0x11')]);router[_0xbc01('0x12')]('/',auth[_0xbc01('0xb')](),controller['create']);router[_0xbc01('0x12')](_0xbc01('0x13'),auth[_0xbc01('0xb')](),controller['addConditions']);router[_0xbc01('0x12')](_0xbc01('0x10'),auth[_0xbc01('0xb')](),controller['addActions']);router['put']('/:id',auth[_0xbc01('0xb')](),controller[_0xbc01('0x14')]);router[_0xbc01('0x15')](_0xbc01('0xd'),auth['isAuthenticated'](),controller[_0xbc01('0x16')]);module[_0xbc01('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 44b0763..e52bb5b 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 _0xb4a1=['#Congestion\x20Retry\x20(min:1,\x20max:999)','#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','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x444e8b,_0x5a4e93){var _0x28d7ae=function(_0xed7e32){while(--_0xed7e32){_0x444e8b['push'](_0x444e8b['shift']());}};_0x28d7ae(++_0x5a4e93);}(_0xb4a1,0x65));var _0x1b4a=function(_0x19103c,_0x4c6c0d){_0x19103c=_0x19103c-0x0;var _0x371d15=_0xb4a1[_0x19103c];return _0x371d15;};'use strict';var Sequelize=require(_0x1b4a('0x0'));module[_0x1b4a('0x1')]={'name':{'type':Sequelize[_0x1b4a('0x2')],'unique':_0x1b4a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1b4a('0x4')](_0x1b4a('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1b4a('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1b4a('0x7')](0x4)[_0x1b4a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1b4a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1b4a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b4a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b4a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1b4a('0x7')](0x5)[_0x1b4a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b4a('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[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'comment':_0x1b4a('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1b4a('0x7')](0x5)[_0x1b4a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b4a('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1b4a('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1b4a('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1b4a('0x4')](_0x1b4a('0x10'),'never',_0x1b4a('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1b4a('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1b4a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1b4a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x1b4a('0x7')](0x9)[_0x1b4a('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1b4a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1b4a('0x7')](0x9)[_0x1b4a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1b4a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1b4a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1b4a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1b4a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1b4a('0x7')](0x9)[_0x1b4a('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1b4a('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1b4a('0x7')](0x9)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1b4a('0x7')](0x5)[_0x1b4a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1b4a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b4a('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1b4a('0x4')](_0x1b4a('0x19'),'ASC'),'defaultValue':_0x1b4a('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b4a('0x1a')},'dialCutDigit':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b4a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b4a('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1b4a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b4a('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b4a('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b4a('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b4a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b4a('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b4a('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1b4a('0x7')](0x5)[_0x1b4a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b4a('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1b4a('0x7')](0x3)[_0x1b4a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b4a('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1b4a('0x7')](0x5)[_0x1b4a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b4a('0x24')}}; \ No newline at end of file +var _0x9a4d=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN'];(function(_0x8fdd3e,_0x301633){var _0x387a00=function(_0x4466da){while(--_0x4466da){_0x8fdd3e['push'](_0x8fdd3e['shift']());}};_0x387a00(++_0x301633);}(_0x9a4d,0xb7));var _0xd9a4=function(_0x2fd111,_0xdcd209){_0x2fd111=_0x2fd111-0x0;var _0x467b0e=_0x9a4d[_0x2fd111];return _0x467b0e;};'use strict';var Sequelize=require(_0xd9a4('0x0'));module[_0xd9a4('0x1')]={'name':{'type':Sequelize[_0xd9a4('0x2')],'unique':_0xd9a4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd9a4('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xd9a4('0x5')},'description':{'type':Sequelize[_0xd9a4('0x2')]},'active':{'type':Sequelize[_0xd9a4('0x6')],'defaultValue':0x0,'comment':_0xd9a4('0x7')},'limitCalls':{'type':Sequelize[_0xd9a4('0x8')](0x4)[_0xd9a4('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd9a4('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd9a4('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9a4('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9a4('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd9a4('0x8')](0x5)[_0xd9a4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9a4('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9a4('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd9a4('0x8')](0x5)[_0xd9a4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9a4('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd9a4('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd9a4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd9a4('0x11')},'dialTimezone':{'type':Sequelize[_0xd9a4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd9a4('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0xd9a4('0x4')](_0xd9a4('0x13'),_0xd9a4('0x14'),_0xd9a4('0x15')),'defaultValue':_0xd9a4('0x13')},'dialAMDActive':{'type':Sequelize[_0xd9a4('0x6')],'defaultValue':0x0,'comment':_0xd9a4('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0xd9a4('0x8')](0x9)[_0xd9a4('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd9a4('0x17')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd9a4('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd9a4('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd9a4('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd9a4('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd9a4('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd9a4('0x8')](0x9)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd9a4('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd9a4('0x8')](0x5)[_0xd9a4('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd9a4('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd9a4('0x8')](0x9)[_0xd9a4('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd9a4('0x4')]('DESC',_0xd9a4('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xd9a4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9a4('0x1d')},'dialCutDigit':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd9a4('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9a4('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd9a4('0x8')](0x5)[_0xd9a4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9a4('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9a4('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9a4('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd9a4('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9a4('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd9a4('0x8')](0x3)[_0xd9a4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd9a4('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd9a4('0x8')](0x5)[_0xd9a4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd9a4('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4dcd3b9..5455305 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 _0x0d98=['CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','field','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','select','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','NOW()','ListId\x20=\x20?','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','IvrCampaigns','error','name','send','index','map','Campaign','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','where','filters','filter','merge','type','options','includeAll','include','findAll','rows','show','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rawAttributes','omit','createdAt','updatedAt','update','findOne','CmHopper','hasOwnProperty','order','sort','CampaignId','CmHopperHistory','pick','getHopperFinals'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0d98,0x149));var _0x80d9=function(_0x32573e,_0x5521d6){_0x32573e=_0x32573e-0x0;var _0x53f3eb=_0x0d98[_0x32573e];return _0x53f3eb;};'use strict';var emlformat=require(_0x80d9('0x0'));var rimraf=require(_0x80d9('0x1'));var zipdir=require(_0x80d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x80d9('0x3'));var Mustache=require(_0x80d9('0x4'));var util=require(_0x80d9('0x5'));var path=require(_0x80d9('0x6'));var sox=require('sox');var csv=require(_0x80d9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x80d9('0x8'));var crypto=require(_0x80d9('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x80d9('0x7'));var querystring=require(_0x80d9('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x80d9('0xb'));var qs=require(_0x80d9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80d9('0xd'));var logger=require(_0x80d9('0xe'))(_0x80d9('0xf'));var utils=require(_0x80d9('0x10'));var config=require(_0x80d9('0x11'));var licenseUtil=require(_0x80d9('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18d8ae,_0x1981ba){_0x1981ba=_0x1981ba||0xcc;return function(_0x5250c6){if(_0x5250c6){return _0x18d8ae[_0x80d9('0x13')](_0x1981ba);}return _0x18d8ae[_0x80d9('0x14')](_0x1981ba)[_0x80d9('0x15')]();};}function respondWithResult(_0x53b0e8,_0xf3a2be){_0xf3a2be=_0xf3a2be||0xc8;return function(_0x4c89a0){if(_0x4c89a0){return _0x53b0e8[_0x80d9('0x14')](_0xf3a2be)[_0x80d9('0x16')](_0x4c89a0);}};}function respondWithFilteredResult(_0x2a5634,_0x1413f7){return function(_0x5b5b81){if(_0x5b5b81){var _0x70370e=typeof _0x1413f7[_0x80d9('0x17')]===_0x80d9('0x18')&&typeof _0x1413f7[_0x80d9('0x19')]===_0x80d9('0x18');var _0x2be823=_0x5b5b81[_0x80d9('0x1a')];var _0x2165c1=_0x70370e?0x0:_0x1413f7[_0x80d9('0x17')];var _0x3b104b=_0x70370e?_0x5b5b81[_0x80d9('0x1a')]:_0x1413f7[_0x80d9('0x17')]+_0x1413f7[_0x80d9('0x19')];var _0xd72ec;if(_0x3b104b>=_0x2be823){_0x3b104b=_0x2be823;_0xd72ec=0xc8;}else{_0xd72ec=0xce;}_0x2a5634[_0x80d9('0x14')](_0xd72ec);return _0x2a5634['set']('Content-Range',_0x2165c1+'-'+_0x3b104b+'/'+_0x2be823)[_0x80d9('0x16')](_0x5b5b81);}return null;};}function patchUpdates(_0x58157d){return function(_0x54f78b){try{jsonpatch[_0x80d9('0x1b')](_0x54f78b,_0x58157d,!![]);}catch(_0x5c2cc2){return BPromise[_0x80d9('0x1c')](_0x5c2cc2);}return _0x54f78b[_0x80d9('0x1d')]();};}function saveUpdates(_0x822bef,_0x3431be){return function(_0x3098b0){if(_0x3098b0){return _0x3098b0['update'](_0x822bef)[_0x80d9('0x1e')](function(_0x585265){return _0x585265;});}return null;};}function removeEntity(_0x2ec3b7,_0x2256b6){return function(_0x6b26d4){if(_0x6b26d4){return _0x6b26d4[_0x80d9('0x1f')]()[_0x80d9('0x1e')](function(){var _0x5b583f=_0x6b26d4[_0x80d9('0x20')]({'plain':!![]});var _0x2d32fa=_0x80d9('0x21');return db['UserProfileResource'][_0x80d9('0x1f')]({'where':{'type':_0x2d32fa,'resourceId':_0x5b583f['id']}})[_0x80d9('0x1e')](function(){return _0x6b26d4;});})[_0x80d9('0x1e')](function(){_0x2ec3b7['status'](0xcc)[_0x80d9('0x15')]();});}};}function handleEntityNotFound(_0x23c9c2,_0x34c17d){return function(_0x9c39aa){if(!_0x9c39aa){_0x23c9c2['sendStatus'](0x194);}return _0x9c39aa;};}function handleError(_0x492b29,_0x475540){_0x475540=_0x475540||0x1f4;return function(_0x104717){logger[_0x80d9('0x22')](_0x104717['stack']);if(_0x104717[_0x80d9('0x23')]){delete _0x104717[_0x80d9('0x23')];}_0x492b29[_0x80d9('0x14')](_0x475540)[_0x80d9('0x24')](_0x104717);};}exports[_0x80d9('0x25')]=function(_0x12870e,_0x2e405d){var _0x30d56b={},_0x30f4c4={},_0x3455d5={'count':0x0,'rows':[]};var _0x3950e2=_[_0x80d9('0x26')](db[_0x80d9('0x27')]['rawAttributes'],function(_0xa07b2c){return{'name':_0xa07b2c[_0x80d9('0x28')],'type':_0xa07b2c['type'][_0x80d9('0x29')]};});_0x30f4c4[_0x80d9('0x2a')]=_[_0x80d9('0x26')](_0x3950e2,_0x80d9('0x23'));_0x30f4c4[_0x80d9('0x2b')]=_[_0x80d9('0x2c')](_0x12870e['query']);_0x30f4c4['filters']=_[_0x80d9('0x2d')](_0x30f4c4[_0x80d9('0x2a')],_0x30f4c4[_0x80d9('0x2b')]);_0x30d56b['attributes']=_[_0x80d9('0x2d')](_0x30f4c4[_0x80d9('0x2a')],qs[_0x80d9('0x2e')](_0x12870e['query'][_0x80d9('0x2e')]));_0x30d56b[_0x80d9('0x2f')]=_0x30d56b[_0x80d9('0x2f')][_0x80d9('0x30')]?_0x30d56b[_0x80d9('0x2f')]:_0x30f4c4['model'];if(!_0x12870e[_0x80d9('0x2b')]['hasOwnProperty'](_0x80d9('0x31'))){_0x30d56b[_0x80d9('0x19')]=qs['limit'](_0x12870e[_0x80d9('0x2b')][_0x80d9('0x19')]);_0x30d56b[_0x80d9('0x17')]=qs[_0x80d9('0x17')](_0x12870e[_0x80d9('0x2b')][_0x80d9('0x17')]);}_0x30d56b['order']=qs['sort'](_0x12870e['query']['sort']);_0x30d56b[_0x80d9('0x32')]=qs[_0x80d9('0x33')](_['pick'](_0x12870e[_0x80d9('0x2b')],_0x30f4c4[_0x80d9('0x33')]),_0x3950e2);if(_0x12870e[_0x80d9('0x2b')][_0x80d9('0x34')]){_0x30d56b['where']=_[_0x80d9('0x35')](_0x30d56b[_0x80d9('0x32')],{'$or':_[_0x80d9('0x26')](_0x3950e2,function(_0x5c2b69){if(_0x5c2b69[_0x80d9('0x36')]!=='VIRTUAL'){var _0x3a250b={};_0x3a250b[_0x5c2b69['name']]={'$like':'%'+_0x12870e[_0x80d9('0x2b')][_0x80d9('0x34')]+'%'};return _0x3a250b;}})});}_0x30d56b=_[_0x80d9('0x35')]({},_0x30d56b,_0x12870e[_0x80d9('0x37')]);var _0x2c8587={'where':_0x30d56b[_0x80d9('0x32')]};return db['Campaign']['count'](_0x2c8587)['then'](function(_0x28d437){_0x3455d5[_0x80d9('0x1a')]=_0x28d437;if(_0x12870e[_0x80d9('0x2b')][_0x80d9('0x38')]){_0x30d56b[_0x80d9('0x39')]=[{'all':!![]}];}return db[_0x80d9('0x27')][_0x80d9('0x3a')](_0x30d56b);})[_0x80d9('0x1e')](function(_0x4fc9e8){_0x3455d5[_0x80d9('0x3b')]=_0x4fc9e8;return _0x3455d5;})[_0x80d9('0x1e')](respondWithFilteredResult(_0x2e405d,_0x30d56b))['catch'](handleError(_0x2e405d,null));};exports[_0x80d9('0x3c')]=function(_0x214b87,_0x2db2a7){var _0x4351a2={'raw':![],'where':{'id':_0x214b87['params']['id']}},_0x3cae58={};_0x3cae58[_0x80d9('0x2a')]=_[_0x80d9('0x2c')](db[_0x80d9('0x27')]['rawAttributes']);_0x3cae58[_0x80d9('0x2b')]=_['keys'](_0x214b87[_0x80d9('0x2b')]);_0x3cae58[_0x80d9('0x33')]=_[_0x80d9('0x2d')](_0x3cae58[_0x80d9('0x2a')],_0x3cae58['query']);_0x4351a2[_0x80d9('0x2f')]=_['intersection'](_0x3cae58[_0x80d9('0x2a')],qs[_0x80d9('0x2e')](_0x214b87[_0x80d9('0x2b')][_0x80d9('0x2e')]));_0x4351a2['attributes']=_0x4351a2[_0x80d9('0x2f')]['length']?_0x4351a2[_0x80d9('0x2f')]:_0x3cae58[_0x80d9('0x2a')];if(_0x214b87['query'][_0x80d9('0x38')]){_0x4351a2[_0x80d9('0x39')]=[{'all':!![]}];}_0x4351a2=_[_0x80d9('0x35')]({},_0x4351a2,_0x214b87[_0x80d9('0x37')]);return db['Campaign'][_0x80d9('0x3d')](_0x4351a2)[_0x80d9('0x1e')](handleEntityNotFound(_0x2db2a7,null))[_0x80d9('0x1e')](respondWithResult(_0x2db2a7,null))[_0x80d9('0x3e')](handleError(_0x2db2a7,null));};exports[_0x80d9('0x3f')]=function(_0x5137b3,_0x4b1777){return db[_0x80d9('0x27')][_0x80d9('0x3f')](_0x5137b3[_0x80d9('0x40')],{})['then'](function(_0x3167b9){var _0x59d282=_0x5137b3['user'][_0x80d9('0x20')]({'plain':!![]});if(!_0x59d282)throw new Error(_0x80d9('0x41'));if(_0x59d282[_0x80d9('0x42')]===_0x80d9('0x43')){var _0x1635fc=_0x3167b9[_0x80d9('0x20')]({'plain':!![]});var _0x488ff5=_0x80d9('0x21');return db[_0x80d9('0x44')][_0x80d9('0x3d')]({'where':{'name':_0x488ff5,'userProfileId':_0x59d282[_0x80d9('0x45')]},'raw':!![]})[_0x80d9('0x1e')](function(_0x2e7a00){if(_0x2e7a00&&_0x2e7a00[_0x80d9('0x46')]===0x0){return db[_0x80d9('0x47')][_0x80d9('0x3f')]({'name':_0x1635fc[_0x80d9('0x23')],'resourceId':_0x1635fc['id'],'type':_0x2e7a00['name'],'sectionId':_0x2e7a00['id']},{})[_0x80d9('0x1e')](function(){return _0x3167b9;});}else{return _0x3167b9;}})[_0x80d9('0x3e')](function(_0x2e3019){logger[_0x80d9('0x22')](_0x80d9('0x48'),_0x2e3019);throw _0x2e3019;});}return _0x3167b9;})[_0x80d9('0x1e')](respondWithResult(_0x4b1777,0xc9))[_0x80d9('0x3e')](handleError(_0x4b1777,null));};exports['clone']=function(_0x5b064c,_0x108e61){var _0x509856={'where':{'id':_0x5b064c[_0x80d9('0x49')]['id']}},_0x33d0c5={};_0x33d0c5['model']=_[_0x80d9('0x2c')](db['Campaign'][_0x80d9('0x4a')]);_0x509856[_0x80d9('0x2f')]=_[_0x80d9('0x2d')](_0x33d0c5[_0x80d9('0x2a')],qs[_0x80d9('0x2e')](_0x5b064c[_0x80d9('0x2b')]['fields']));_0x509856[_0x80d9('0x2f')]=_0x509856[_0x80d9('0x2f')][_0x80d9('0x30')]?_0x509856[_0x80d9('0x2f')]:_0x33d0c5[_0x80d9('0x2a')];if(_0x5b064c[_0x80d9('0x2b')]['includeAll']){_0x509856[_0x80d9('0x39')]=[{'all':!![]}];}_0x509856=_['merge']({},_0x509856,_0x5b064c[_0x80d9('0x37')]);return db['Campaign'][_0x80d9('0x3d')](_0x509856)[_0x80d9('0x1e')](handleEntityNotFound(_0x108e61,null))[_0x80d9('0x1e')](function(_0x33ab60){if(_0x33ab60){var _0x134a88=_0x33ab60['get']({'plain':!![]});_0x134a88=qs[_0x80d9('0x4b')](_0x134a88,['id',_0x80d9('0x4c'),_0x80d9('0x4d')]);_0x5b064c[_0x80d9('0x40')]=_[_0x80d9('0x4b')](_0x5b064c[_0x80d9('0x40')],['id','createdAt',_0x80d9('0x4d')]);return db[_0x80d9('0x27')]['create'](_['merge'](_0x134a88,_0x5b064c[_0x80d9('0x40')]),{'include':_0x5b064c['query'][_0x80d9('0x38')]?[{'all':!![]}]:undefined})[_0x80d9('0x1e')](function(_0x5b55c7){var _0x411814=_0x5b064c[_0x80d9('0x43')][_0x80d9('0x20')]({'plain':!![]});if(!_0x411814)throw new Error(_0x80d9('0x41'));if(_0x411814[_0x80d9('0x42')]===_0x80d9('0x43')){var _0x33c4ff=_0x5b55c7[_0x80d9('0x20')]({'plain':!![]});var _0x1384b9=_0x80d9('0x21');return db[_0x80d9('0x44')][_0x80d9('0x3d')]({'where':{'name':_0x1384b9,'userProfileId':_0x411814[_0x80d9('0x45')]},'raw':!![]})[_0x80d9('0x1e')](function(_0x4668a2){if(_0x4668a2&&_0x4668a2[_0x80d9('0x46')]===0x0){return db[_0x80d9('0x47')][_0x80d9('0x3f')]({'name':_0x33c4ff['name'],'resourceId':_0x33c4ff['id'],'type':_0x4668a2[_0x80d9('0x23')],'sectionId':_0x4668a2['id']},{})[_0x80d9('0x1e')](function(){return _0x5b55c7;});}else{return _0x5b55c7;}})[_0x80d9('0x3e')](function(_0x562b0f){logger[_0x80d9('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x562b0f);throw _0x562b0f;});}return _0x5b55c7;});}})[_0x80d9('0x1e')](respondWithResult(_0x108e61,0xc9))[_0x80d9('0x3e')](handleError(_0x108e61,null));};exports[_0x80d9('0x4e')]=function(_0x2980ee,_0x43e5e6){if(_0x2980ee[_0x80d9('0x40')]['id']){delete _0x2980ee[_0x80d9('0x40')]['id'];}return db['Campaign'][_0x80d9('0x3d')]({'where':{'id':_0x2980ee['params']['id']}})[_0x80d9('0x1e')](handleEntityNotFound(_0x43e5e6,null))[_0x80d9('0x1e')](saveUpdates(_0x2980ee[_0x80d9('0x40')],null))[_0x80d9('0x1e')](respondWithResult(_0x43e5e6,null))[_0x80d9('0x3e')](handleError(_0x43e5e6,null));};exports['destroy']=function(_0x22fc0c,_0x2467fe){return db[_0x80d9('0x27')]['find']({'where':{'id':_0x22fc0c[_0x80d9('0x49')]['id']}})[_0x80d9('0x1e')](handleEntityNotFound(_0x2467fe,null))['then'](removeEntity(_0x2467fe,null))[_0x80d9('0x3e')](handleError(_0x2467fe,null));};exports['getHoppers']=function(_0x392ad6,_0x62b57c,_0x311c16){var _0x2140b1={'raw':!![],'where':{}};var _0x54d70e={};var _0x2cdea5={'count':0x0,'rows':[]};return db[_0x80d9('0x27')][_0x80d9('0x4f')]({'where':{'id':_0x392ad6[_0x80d9('0x49')]['id']}})['then'](handleEntityNotFound(_0x62b57c,null))[_0x80d9('0x1e')](function(_0x52458a){if(_0x52458a){_0x54d70e['model']=_[_0x80d9('0x2c')](db[_0x80d9('0x50')][_0x80d9('0x4a')]);_0x54d70e[_0x80d9('0x2b')]=_[_0x80d9('0x2c')](_0x392ad6[_0x80d9('0x2b')]);_0x54d70e['filters']=_[_0x80d9('0x2d')](_0x54d70e[_0x80d9('0x2a')],_0x54d70e['query']);_0x2140b1[_0x80d9('0x2f')]=_[_0x80d9('0x2d')](_0x54d70e['model'],qs[_0x80d9('0x2e')](_0x392ad6['query'][_0x80d9('0x2e')]));_0x2140b1['attributes']=_0x2140b1[_0x80d9('0x2f')]['length']?_0x2140b1[_0x80d9('0x2f')]:_0x54d70e['model'];if(!_0x392ad6[_0x80d9('0x2b')][_0x80d9('0x51')](_0x80d9('0x31'))){_0x2140b1[_0x80d9('0x19')]=qs[_0x80d9('0x19')](_0x392ad6[_0x80d9('0x2b')][_0x80d9('0x19')]);_0x2140b1[_0x80d9('0x17')]=qs[_0x80d9('0x17')](_0x392ad6[_0x80d9('0x2b')]['offset']);}_0x2140b1[_0x80d9('0x52')]=qs[_0x80d9('0x53')](_0x392ad6[_0x80d9('0x2b')][_0x80d9('0x53')]);_0x2140b1[_0x80d9('0x32')]=qs['filters'](_['pick'](_0x392ad6[_0x80d9('0x2b')],_0x54d70e[_0x80d9('0x33')]));_0x2140b1[_0x80d9('0x32')][_0x80d9('0x54')]=_0x52458a['id'];if(_0x392ad6['query'][_0x80d9('0x34')]){_0x2140b1[_0x80d9('0x32')]=_[_0x80d9('0x35')](_0x2140b1[_0x80d9('0x32')],{'$or':_[_0x80d9('0x26')](_0x2140b1[_0x80d9('0x2f')],function(_0x598ae6){var _0x16291e={};_0x16291e[_0x598ae6]={'$like':'%'+_0x392ad6[_0x80d9('0x2b')][_0x80d9('0x34')]+'%'};return _0x16291e;})});}_0x2140b1=_[_0x80d9('0x35')]({},_0x2140b1,_0x392ad6[_0x80d9('0x37')]);return db[_0x80d9('0x50')][_0x80d9('0x1a')]({'where':_0x2140b1[_0x80d9('0x32')]})[_0x80d9('0x1e')](function(_0x2182f5){_0x2cdea5[_0x80d9('0x1a')]=_0x2182f5;if(_0x392ad6[_0x80d9('0x2b')][_0x80d9('0x38')]){_0x2140b1[_0x80d9('0x39')]=[{'all':!![]}];}return db[_0x80d9('0x50')][_0x80d9('0x3a')](_0x2140b1);})[_0x80d9('0x1e')](function(_0x298166){_0x2cdea5[_0x80d9('0x3b')]=_0x298166;return _0x2cdea5;});}})[_0x80d9('0x1e')](respondWithFilteredResult(_0x62b57c,_0x2140b1))[_0x80d9('0x3e')](handleError(_0x62b57c,null));};exports['getHopperHistories']=function(_0x474212,_0x381671,_0x350e78){var _0x1599d6={'raw':!![],'where':{}};var _0x5c0359={};var _0x3fd17f={'count':0x0,'rows':[]};return db[_0x80d9('0x27')][_0x80d9('0x4f')]({'where':{'id':_0x474212[_0x80d9('0x49')]['id']}})[_0x80d9('0x1e')](handleEntityNotFound(_0x381671,null))[_0x80d9('0x1e')](function(_0x4fea26){if(_0x4fea26){_0x5c0359[_0x80d9('0x2a')]=_['keys'](db[_0x80d9('0x55')][_0x80d9('0x4a')]);_0x5c0359[_0x80d9('0x2b')]=_['keys'](_0x474212[_0x80d9('0x2b')]);_0x5c0359[_0x80d9('0x33')]=_[_0x80d9('0x2d')](_0x5c0359[_0x80d9('0x2a')],_0x5c0359[_0x80d9('0x2b')]);_0x1599d6[_0x80d9('0x2f')]=_[_0x80d9('0x2d')](_0x5c0359['model'],qs[_0x80d9('0x2e')](_0x474212[_0x80d9('0x2b')]['fields']));_0x1599d6[_0x80d9('0x2f')]=_0x1599d6[_0x80d9('0x2f')]['length']?_0x1599d6['attributes']:_0x5c0359[_0x80d9('0x2a')];if(!_0x474212[_0x80d9('0x2b')][_0x80d9('0x51')](_0x80d9('0x31'))){_0x1599d6[_0x80d9('0x19')]=qs[_0x80d9('0x19')](_0x474212[_0x80d9('0x2b')][_0x80d9('0x19')]);_0x1599d6['offset']=qs['offset'](_0x474212[_0x80d9('0x2b')][_0x80d9('0x17')]);}_0x1599d6[_0x80d9('0x52')]=qs[_0x80d9('0x53')](_0x474212['query'][_0x80d9('0x53')]);_0x1599d6['where']=qs[_0x80d9('0x33')](_[_0x80d9('0x56')](_0x474212[_0x80d9('0x2b')],_0x5c0359['filters']));_0x1599d6['where']['CampaignId']=_0x4fea26['id'];if(_0x474212[_0x80d9('0x2b')][_0x80d9('0x34')]){_0x1599d6[_0x80d9('0x32')]=_[_0x80d9('0x35')](_0x1599d6[_0x80d9('0x32')],{'$or':_[_0x80d9('0x26')](_0x1599d6[_0x80d9('0x2f')],function(_0x16ae8a){var _0x3ad1b2={};_0x3ad1b2[_0x16ae8a]={'$like':'%'+_0x474212['query']['filter']+'%'};return _0x3ad1b2;})});}_0x1599d6=_[_0x80d9('0x35')]({},_0x1599d6,_0x474212[_0x80d9('0x37')]);return db[_0x80d9('0x55')][_0x80d9('0x1a')]({'where':_0x1599d6['where']})[_0x80d9('0x1e')](function(_0x1222ba){_0x3fd17f[_0x80d9('0x1a')]=_0x1222ba;if(_0x474212[_0x80d9('0x2b')]['includeAll']){_0x1599d6[_0x80d9('0x39')]=[{'all':!![]}];}return db[_0x80d9('0x55')][_0x80d9('0x3a')](_0x1599d6);})[_0x80d9('0x1e')](function(_0x3b227f){_0x3fd17f[_0x80d9('0x3b')]=_0x3b227f;return _0x3fd17f;});}})[_0x80d9('0x1e')](respondWithFilteredResult(_0x381671,_0x1599d6))[_0x80d9('0x3e')](handleError(_0x381671,null));};exports[_0x80d9('0x57')]=function(_0x310cad,_0x2ecae8,_0xc60b61){var _0x1e4428={'raw':!![],'where':{}};var _0x43e2f4={};var _0x10c213={'count':0x0,'rows':[]};return db[_0x80d9('0x27')][_0x80d9('0x4f')]({'where':{'id':_0x310cad[_0x80d9('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ecae8,null))[_0x80d9('0x1e')](function(_0x45f4f3){if(_0x45f4f3){_0x43e2f4[_0x80d9('0x2a')]=_[_0x80d9('0x2c')](db['CmHopperFinal'][_0x80d9('0x4a')]);_0x43e2f4[_0x80d9('0x2b')]=_['keys'](_0x310cad['query']);_0x43e2f4[_0x80d9('0x33')]=_['intersection'](_0x43e2f4[_0x80d9('0x2a')],_0x43e2f4[_0x80d9('0x2b')]);_0x1e4428[_0x80d9('0x2f')]=_['intersection'](_0x43e2f4[_0x80d9('0x2a')],qs[_0x80d9('0x2e')](_0x310cad[_0x80d9('0x2b')][_0x80d9('0x2e')]));_0x1e4428[_0x80d9('0x2f')]=_0x1e4428['attributes'][_0x80d9('0x30')]?_0x1e4428[_0x80d9('0x2f')]:_0x43e2f4[_0x80d9('0x2a')];if(!_0x310cad[_0x80d9('0x2b')]['hasOwnProperty']('nolimit')){_0x1e4428[_0x80d9('0x19')]=qs[_0x80d9('0x19')](_0x310cad[_0x80d9('0x2b')][_0x80d9('0x19')]);_0x1e4428[_0x80d9('0x17')]=qs['offset'](_0x310cad[_0x80d9('0x2b')][_0x80d9('0x17')]);}_0x1e4428[_0x80d9('0x52')]=qs[_0x80d9('0x53')](_0x310cad[_0x80d9('0x2b')][_0x80d9('0x53')]);_0x1e4428[_0x80d9('0x32')]=qs[_0x80d9('0x33')](_['pick'](_0x310cad[_0x80d9('0x2b')],_0x43e2f4[_0x80d9('0x33')]));_0x1e4428['where'][_0x80d9('0x54')]=_0x45f4f3['id'];if(_0x310cad[_0x80d9('0x2b')][_0x80d9('0x34')]){_0x1e4428[_0x80d9('0x32')]=_['merge'](_0x1e4428[_0x80d9('0x32')],{'$or':_['map'](_0x1e4428['attributes'],function(_0x3eade5){var _0x39eeb7={};_0x39eeb7[_0x3eade5]={'$like':'%'+_0x310cad[_0x80d9('0x2b')]['filter']+'%'};return _0x39eeb7;})});}_0x1e4428=_[_0x80d9('0x35')]({},_0x1e4428,_0x310cad[_0x80d9('0x37')]);return db['CmHopperFinal'][_0x80d9('0x1a')]({'where':_0x1e4428[_0x80d9('0x32')]})[_0x80d9('0x1e')](function(_0x356682){_0x10c213[_0x80d9('0x1a')]=_0x356682;if(_0x310cad[_0x80d9('0x2b')]['includeAll']){_0x1e4428[_0x80d9('0x39')]=[{'all':!![]}];}return db[_0x80d9('0x58')][_0x80d9('0x3a')](_0x1e4428);})['then'](function(_0x2ea845){_0x10c213[_0x80d9('0x3b')]=_0x2ea845;return _0x10c213;});}})[_0x80d9('0x1e')](respondWithFilteredResult(_0x2ecae8,_0x1e4428))[_0x80d9('0x3e')](handleError(_0x2ecae8,null));};exports[_0x80d9('0x59')]=function(_0x3ad7a5,_0x5f5219,_0x3c0e9f){var _0x1ae5ff={'raw':!![],'where':{}};var _0x325bbc={};var _0x3af2d1={'count':0x0,'rows':[]};return db['Campaign'][_0x80d9('0x4f')]({'where':{'id':_0x3ad7a5['params']['id']}})[_0x80d9('0x1e')](handleEntityNotFound(_0x5f5219,null))[_0x80d9('0x1e')](function(_0x168e1c){if(_0x168e1c){_0x325bbc[_0x80d9('0x2a')]=_[_0x80d9('0x2c')](db[_0x80d9('0x5a')][_0x80d9('0x4a')]);_0x325bbc[_0x80d9('0x2b')]=_[_0x80d9('0x2c')](_0x3ad7a5[_0x80d9('0x2b')]);_0x325bbc[_0x80d9('0x33')]=_[_0x80d9('0x2d')](_0x325bbc['model'],_0x325bbc[_0x80d9('0x2b')]);_0x1ae5ff[_0x80d9('0x2f')]=_[_0x80d9('0x2d')](_0x325bbc[_0x80d9('0x2a')],qs[_0x80d9('0x2e')](_0x3ad7a5[_0x80d9('0x2b')][_0x80d9('0x2e')]));_0x1ae5ff['attributes']=_0x1ae5ff[_0x80d9('0x2f')][_0x80d9('0x30')]?_0x1ae5ff[_0x80d9('0x2f')]:_0x325bbc[_0x80d9('0x2a')];if(!_0x3ad7a5[_0x80d9('0x2b')]['hasOwnProperty']('nolimit')){_0x1ae5ff[_0x80d9('0x19')]=qs[_0x80d9('0x19')](_0x3ad7a5[_0x80d9('0x2b')][_0x80d9('0x19')]);_0x1ae5ff['offset']=qs[_0x80d9('0x17')](_0x3ad7a5[_0x80d9('0x2b')][_0x80d9('0x17')]);}_0x1ae5ff[_0x80d9('0x52')]=qs['sort'](_0x3ad7a5[_0x80d9('0x2b')]['sort']);_0x1ae5ff[_0x80d9('0x32')]=qs['filters'](_[_0x80d9('0x56')](_0x3ad7a5[_0x80d9('0x2b')],_0x325bbc[_0x80d9('0x33')]));_0x1ae5ff[_0x80d9('0x32')][_0x80d9('0x54')]=_0x168e1c['id'];if(_0x3ad7a5[_0x80d9('0x2b')][_0x80d9('0x34')]){_0x1ae5ff[_0x80d9('0x32')]=_[_0x80d9('0x35')](_0x1ae5ff[_0x80d9('0x32')],{'$or':_[_0x80d9('0x26')](_0x1ae5ff[_0x80d9('0x2f')],function(_0x49fb9f){var _0x14137d={};_0x14137d[_0x49fb9f]={'$like':'%'+_0x3ad7a5[_0x80d9('0x2b')][_0x80d9('0x34')]+'%'};return _0x14137d;})});}_0x1ae5ff=_[_0x80d9('0x35')]({},_0x1ae5ff,_0x3ad7a5[_0x80d9('0x37')]);return db[_0x80d9('0x5a')][_0x80d9('0x1a')]({'where':_0x1ae5ff[_0x80d9('0x32')]})['then'](function(_0x3cb681){_0x3af2d1['count']=_0x3cb681;if(_0x3ad7a5[_0x80d9('0x2b')][_0x80d9('0x38')]){_0x1ae5ff[_0x80d9('0x39')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1ae5ff);})[_0x80d9('0x1e')](function(_0x59227a){_0x3af2d1[_0x80d9('0x3b')]=_0x59227a;return _0x3af2d1;});}})[_0x80d9('0x1e')](respondWithFilteredResult(_0x5f5219,_0x1ae5ff))['catch'](handleError(_0x5f5219,null));};exports[_0x80d9('0x5b')]=function(_0x475bd3,_0x345acf,_0xd3a3e1){var _0xfffee6={};var _0xeff8ac={};var _0x4b04a7;var _0x893c9f;return db['Campaign'][_0x80d9('0x4f')]({'where':{'id':_0x475bd3['params']['id']}})['then'](handleEntityNotFound(_0x345acf,null))[_0x80d9('0x1e')](function(_0x280620){if(_0x280620){_0x4b04a7=_0x280620;_0xeff8ac[_0x80d9('0x2a')]=_[_0x80d9('0x2c')](db['CmList'][_0x80d9('0x4a')]);_0xeff8ac[_0x80d9('0x2b')]=_[_0x80d9('0x2c')](_0x475bd3[_0x80d9('0x2b')]);_0xeff8ac[_0x80d9('0x33')]=_[_0x80d9('0x2d')](_0xeff8ac[_0x80d9('0x2a')],_0xeff8ac[_0x80d9('0x2b')]);_0xfffee6[_0x80d9('0x2f')]=_[_0x80d9('0x2d')](_0xeff8ac[_0x80d9('0x2a')],qs[_0x80d9('0x2e')](_0x475bd3['query'][_0x80d9('0x2e')]));_0xfffee6[_0x80d9('0x2f')]=_0xfffee6[_0x80d9('0x2f')]['length']?_0xfffee6[_0x80d9('0x2f')]:_0xeff8ac[_0x80d9('0x2a')];_0xfffee6['order']=qs[_0x80d9('0x53')](_0x475bd3['query']['sort']);_0xfffee6[_0x80d9('0x32')]=qs[_0x80d9('0x33')](_[_0x80d9('0x56')](_0x475bd3[_0x80d9('0x2b')],_0xeff8ac[_0x80d9('0x33')]));if(_0x475bd3[_0x80d9('0x2b')][_0x80d9('0x34')]){_0xfffee6[_0x80d9('0x32')]=_[_0x80d9('0x35')](_0xfffee6[_0x80d9('0x32')],{'$or':_[_0x80d9('0x26')](_0xfffee6['attributes'],function(_0x55fea0){var _0x28bee6={};_0x28bee6[_0x55fea0]={'$like':'%'+_0x475bd3[_0x80d9('0x2b')][_0x80d9('0x34')]+'%'};return _0x28bee6;})});}_0xfffee6=_[_0x80d9('0x35')]({},_0xfffee6,_0x475bd3['options']);return _0x4b04a7[_0x80d9('0x5b')](_0xfffee6);}})['then'](function(_0x46b589){if(_0x46b589){_0x893c9f=_0x46b589[_0x80d9('0x30')];if(!_0x475bd3['query'][_0x80d9('0x51')](_0x80d9('0x31'))){_0xfffee6[_0x80d9('0x19')]=qs[_0x80d9('0x19')](_0x475bd3[_0x80d9('0x2b')][_0x80d9('0x19')]);_0xfffee6['offset']=qs[_0x80d9('0x17')](_0x475bd3[_0x80d9('0x2b')][_0x80d9('0x17')]);}return _0x4b04a7[_0x80d9('0x5b')](_0xfffee6);}})[_0x80d9('0x1e')](function(_0xcf09ce){if(_0xcf09ce){return _0xcf09ce?{'count':_0x893c9f,'rows':_0xcf09ce}:null;}})[_0x80d9('0x1e')](respondWithResult(_0x345acf,null))['catch'](handleError(_0x345acf,null));};exports['addLists']=function(_0x2908c6,_0x1234a6,_0x3d22a2){var _0x17039c,_0xe5cc71;var _0x3b9604=[];var _0x55073e=moment()[_0x80d9('0x5c')](_0x80d9('0x5d'));return db[_0x80d9('0x27')]['find']({'where':{'id':_0x2908c6[_0x80d9('0x49')]['id']}})['then'](handleEntityNotFound(_0x1234a6,null))[_0x80d9('0x1e')](function(_0x48056d){if(_0x48056d){_0xe5cc71=_0x48056d;return _0x48056d[_0x80d9('0x5e')](_0x2908c6[_0x80d9('0x40')][_0x80d9('0x5f')],_['omit'](_0x2908c6['body'],['ids','id'])||{});}return null;})[_0x80d9('0x60')](function(_0x53901e){var _0x4ae082;var _0x28fc28;_0x17039c=_0x53901e||[];var _0x19e65e=[];if(_0x53901e){for(var _0x19e700=0x0;_0x19e700<_0x53901e[_0x80d9('0x30')];_0x19e700+=0x1){var _0x325bc1=_0x53901e[_0x19e700]['get']({'plain':!![]});_0xe5cc71[_0x80d9('0x61')]=_0x2908c6[_0x80d9('0x40')][_0x80d9('0x61')]?_0x2908c6[_0x80d9('0x40')][_0x80d9('0x61')]:_0xe5cc71[_0x80d9('0x61')];switch(_0xe5cc71[_0x80d9('0x61')]){case _0x80d9('0x62'):_0x4ae082=squel[_0x80d9('0x63')]()[_0x80d9('0x64')](_0x80d9('0x65'))[_0x80d9('0x66')]([_0x80d9('0x67'),'scheduledAt',_0x80d9('0x68'),'ListId',_0x80d9('0x54'),_0x80d9('0x4c'),_0x80d9('0x4d')],squel['select']()[_0x80d9('0x69')](_0x80d9('0x67'),_0x80d9('0x67'))['field']('NOW()',_0x80d9('0x6a'))[_0x80d9('0x69')]('id',_0x80d9('0x68'))[_0x80d9('0x69')](_0x325bc1['CmListId'][_0x80d9('0x6b')](),'ListId')[_0x80d9('0x69')](_0x2908c6['params']['id'][_0x80d9('0x6b')](),_0x80d9('0x54'))[_0x80d9('0x69')]('\x27'+_0x55073e+'\x27',_0x80d9('0x4c'))[_0x80d9('0x69')]('\x27'+_0x55073e+'\x27','updatedAt')[_0x80d9('0x6c')](_0x80d9('0x6d'))[_0x80d9('0x32')](_0x80d9('0x6e'))[_0x80d9('0x32')]('ListId\x20=\x20?',_0x325bc1[_0x80d9('0x6f')][_0x80d9('0x6b')]())[_0x80d9('0x32')](_0x80d9('0x70'))[_0x80d9('0x32')]('phone\x20NOT\x20IN\x20(?)',squel[_0x80d9('0x71')]()[_0x80d9('0x69')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x80d9('0x72'))[_0x80d9('0x32')]('CampaignId\x20=\x20?',_0x2908c6[_0x80d9('0x49')]['id'][_0x80d9('0x6b')]()))['where'](_0x80d9('0x73'),squel['select']()['field'](_0x80d9('0x74'))[_0x80d9('0x6c')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x2908c6[_0x80d9('0x49')]['id'][_0x80d9('0x6b')]())))[_0x80d9('0x6b')]();break;case _0x80d9('0x75'):_0x4ae082=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x80d9('0x68'),_0x80d9('0x76'),_0x80d9('0x54'),_0x80d9('0x4c'),'updatedAt'],squel[_0x80d9('0x71')]()['field'](_0x80d9('0x67'),'phone')[_0x80d9('0x69')](_0x80d9('0x77'),'scheduledAt')['field']('id','ContactId')[_0x80d9('0x69')](_0x325bc1['CmListId'][_0x80d9('0x6b')](),_0x80d9('0x76'))[_0x80d9('0x69')](_0x2908c6[_0x80d9('0x49')]['id'][_0x80d9('0x6b')](),'CampaignId')[_0x80d9('0x69')]('\x27'+_0x55073e+'\x27',_0x80d9('0x4c'))[_0x80d9('0x69')]('\x27'+_0x55073e+'\x27','updatedAt')[_0x80d9('0x6c')](_0x80d9('0x6d'))[_0x80d9('0x32')](_0x80d9('0x6e'))[_0x80d9('0x32')](_0x80d9('0x78'),_0x325bc1['CmListId'][_0x80d9('0x6b')]())[_0x80d9('0x32')](_0x80d9('0x70'))[_0x80d9('0x32')]('phone\x20NOT\x20IN\x20(?)',squel[_0x80d9('0x71')]()[_0x80d9('0x69')](_0x80d9('0x74'))[_0x80d9('0x6c')](_0x80d9('0x65'))[_0x80d9('0x32')](_0x80d9('0x79'),_0x2908c6[_0x80d9('0x49')]['id'][_0x80d9('0x6b')]())))[_0x80d9('0x6b')]();break;default:_0x4ae082=squel[_0x80d9('0x63')]()[_0x80d9('0x64')](_0x80d9('0x65'))[_0x80d9('0x66')]([_0x80d9('0x67'),'scheduledAt',_0x80d9('0x68'),_0x80d9('0x76'),_0x80d9('0x54'),_0x80d9('0x4c'),'updatedAt'],squel[_0x80d9('0x71')]()[_0x80d9('0x69')](_0x80d9('0x67'),'phone')[_0x80d9('0x69')](_0x80d9('0x77'),'scheduledAt')[_0x80d9('0x69')]('id',_0x80d9('0x68'))[_0x80d9('0x69')](_0x325bc1[_0x80d9('0x6f')][_0x80d9('0x6b')](),_0x80d9('0x76'))[_0x80d9('0x69')](_0x2908c6[_0x80d9('0x49')]['id'][_0x80d9('0x6b')](),_0x80d9('0x54'))[_0x80d9('0x69')]('\x27'+_0x55073e+'\x27',_0x80d9('0x4c'))[_0x80d9('0x69')]('\x27'+_0x55073e+'\x27',_0x80d9('0x4d'))[_0x80d9('0x6c')]('cm_contacts')[_0x80d9('0x32')](_0x80d9('0x6e'))['where'](_0x80d9('0x78'),_0x325bc1[_0x80d9('0x6f')][_0x80d9('0x6b')]())[_0x80d9('0x32')](_0x80d9('0x70')))[_0x80d9('0x6b')]();}_0x28fc28=squel[_0x80d9('0x63')]()[_0x80d9('0x64')](_0x80d9('0x7a'))[_0x80d9('0x66')]([_0x80d9('0x7b'),_0x80d9('0x6a'),_0x80d9('0x67'),_0x80d9('0x7c'),'createdAt',_0x80d9('0x4d')],squel[_0x80d9('0x71')]()[_0x80d9('0x69')]('h.id','id')[_0x80d9('0x69')](_0x80d9('0x77'),_0x80d9('0x6a'))[_0x80d9('0x69')](_0x80d9('0x7d'),_0x80d9('0x67'))[_0x80d9('0x69')](_0x80d9('0x7e'),_0x80d9('0x7c'))['field']('\x27'+_0x55073e+'\x27',_0x80d9('0x4c'))[_0x80d9('0x69')]('\x27'+_0x55073e+'\x27',_0x80d9('0x4d'))[_0x80d9('0x6c')]('cm_contact_has_items','ci')['join']('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x80d9('0x32')](_0x80d9('0x7f'),_0x325bc1['CmListId'][_0x80d9('0x6b')]())[_0x80d9('0x32')](_0x80d9('0x80'),_0x2908c6[_0x80d9('0x49')]['id'][_0x80d9('0x6b')]())[_0x80d9('0x32')](_0x80d9('0x81'),_0x55073e))[_0x80d9('0x6b')]();_0x19e65e['push'](db[_0x80d9('0x82')][_0x80d9('0x2b')](_0x4ae082));_0x3b9604[_0x80d9('0x83')](db[_0x80d9('0x82')][_0x80d9('0x2b')](_0x28fc28));}return BPromise[_0x80d9('0x84')](_0x19e65e);}})[_0x80d9('0x1e')](function(){return BPromise[_0x80d9('0x84')](_0x3b9604);})[_0x80d9('0x1e')](function(){return _0x17039c;})['then'](respondWithResult(_0x1234a6,null))['catch'](handleError(_0x1234a6,null));};exports[_0x80d9('0x85')]=function(_0xc3e7e8,_0x44bb78,_0x3856fa){return db[_0x80d9('0x27')]['find']({'where':{'id':_0xc3e7e8[_0x80d9('0x49')]['id']}})['then'](handleEntityNotFound(_0x44bb78,null))[_0x80d9('0x1e')](function(_0xd543e6){if(_0xd543e6){return _0xd543e6[_0x80d9('0x85')](_0xc3e7e8[_0x80d9('0x2b')][_0x80d9('0x5f')]);}})[_0x80d9('0x1e')](function(_0x4dee34){if(_0x4dee34){return db['CmHopper'][_0x80d9('0x1f')]({'where':{'ListId':_0xc3e7e8[_0x80d9('0x2b')]['ids'],'CampaignId':_0xc3e7e8[_0x80d9('0x49')]['id']}})['then'](function(){return _0x4dee34;});}})[_0x80d9('0x1e')](respondWithStatusCode(_0x44bb78,null))[_0x80d9('0x3e')](handleError(_0x44bb78,null));};exports['getBlackLists']=function(_0x313548,_0x410ae6,_0x11cc53){var _0x2bae68={};var _0x217fc3={};var _0xc55878;var _0x492694;return db[_0x80d9('0x27')]['findOne']({'where':{'id':_0x313548[_0x80d9('0x49')]['id']}})[_0x80d9('0x1e')](handleEntityNotFound(_0x410ae6,null))[_0x80d9('0x1e')](function(_0x1dcc8b){if(_0x1dcc8b){_0xc55878=_0x1dcc8b;_0x217fc3['model']=_[_0x80d9('0x2c')](db[_0x80d9('0x86')][_0x80d9('0x4a')]);_0x217fc3[_0x80d9('0x2b')]=_['keys'](_0x313548[_0x80d9('0x2b')]);_0x217fc3[_0x80d9('0x33')]=_[_0x80d9('0x2d')](_0x217fc3[_0x80d9('0x2a')],_0x217fc3[_0x80d9('0x2b')]);_0x2bae68['attributes']=_[_0x80d9('0x2d')](_0x217fc3[_0x80d9('0x2a')],qs[_0x80d9('0x2e')](_0x313548[_0x80d9('0x2b')][_0x80d9('0x2e')]));_0x2bae68['attributes']=_0x2bae68[_0x80d9('0x2f')][_0x80d9('0x30')]?_0x2bae68[_0x80d9('0x2f')]:_0x217fc3[_0x80d9('0x2a')];_0x2bae68[_0x80d9('0x52')]=qs[_0x80d9('0x53')](_0x313548[_0x80d9('0x2b')][_0x80d9('0x53')]);_0x2bae68[_0x80d9('0x32')]=qs[_0x80d9('0x33')](_[_0x80d9('0x56')](_0x313548[_0x80d9('0x2b')],_0x217fc3[_0x80d9('0x33')]));if(_0x313548[_0x80d9('0x2b')][_0x80d9('0x34')]){_0x2bae68[_0x80d9('0x32')]=_['merge'](_0x2bae68[_0x80d9('0x32')],{'$or':_[_0x80d9('0x26')](_0x2bae68[_0x80d9('0x2f')],function(_0x25f61e){var _0x1df458={};_0x1df458[_0x25f61e]={'$like':'%'+_0x313548[_0x80d9('0x2b')][_0x80d9('0x34')]+'%'};return _0x1df458;})});}_0x2bae68=_['merge']({},_0x2bae68,_0x313548[_0x80d9('0x37')]);return _0xc55878[_0x80d9('0x87')](_0x2bae68);}})['then'](function(_0x369408){if(_0x369408){_0x492694=_0x369408['length'];if(!_0x313548[_0x80d9('0x2b')][_0x80d9('0x51')](_0x80d9('0x31'))){_0x2bae68[_0x80d9('0x19')]=qs[_0x80d9('0x19')](_0x313548[_0x80d9('0x2b')][_0x80d9('0x19')]);_0x2bae68[_0x80d9('0x17')]=qs['offset'](_0x313548[_0x80d9('0x2b')][_0x80d9('0x17')]);}return _0xc55878['getBlackLists'](_0x2bae68);}})[_0x80d9('0x1e')](function(_0xc3967c){if(_0xc3967c){return _0xc3967c?{'count':_0x492694,'rows':_0xc3967c}:null;}})['then'](respondWithResult(_0x410ae6,null))[_0x80d9('0x3e')](handleError(_0x410ae6,null));};exports[_0x80d9('0x88')]=function(_0x1fe4a3,_0x397fa3,_0x54ae6c){var _0x4194eb,_0x197fd0;var _0x5c1ad4=[];var _0x504c88=moment()[_0x80d9('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x80d9('0x27')][_0x80d9('0x3d')]({'where':{'id':_0x1fe4a3[_0x80d9('0x49')]['id']}})[_0x80d9('0x1e')](handleEntityNotFound(_0x397fa3,null))[_0x80d9('0x1e')](function(_0x1b5db4){if(_0x1b5db4){_0x197fd0=_0x1b5db4;return _0x1b5db4[_0x80d9('0x88')](_0x1fe4a3[_0x80d9('0x40')][_0x80d9('0x5f')],_[_0x80d9('0x4b')](_0x1fe4a3[_0x80d9('0x40')],[_0x80d9('0x5f'),'id'])||{});}return null;})[_0x80d9('0x60')](function(_0x1e4221){var _0x590973;var _0x2a64a4;_0x4194eb=_0x1e4221||[];var _0x2ae0df=[];if(_0x1e4221){for(var _0x2ac7bc=0x0;_0x2ac7bc<_0x1e4221[_0x80d9('0x30')];_0x2ac7bc+=0x1){var _0x471462=_0x1e4221[_0x2ac7bc]['get']({'plain':!![]});_0x590973=squel[_0x80d9('0x63')]()['into'](_0x80d9('0x89'))[_0x80d9('0x66')](['phone',_0x80d9('0x68'),_0x80d9('0x76'),'CampaignId',_0x80d9('0x4c'),_0x80d9('0x4d')],squel['select']()[_0x80d9('0x69')]('phone',_0x80d9('0x67'))['field']('id',_0x80d9('0x68'))[_0x80d9('0x69')](_0x471462[_0x80d9('0x6f')]['toString'](),'ListId')[_0x80d9('0x69')](_0x1fe4a3[_0x80d9('0x49')]['id']['toString'](),_0x80d9('0x54'))['field'](_0x80d9('0x77'),_0x80d9('0x4c'))[_0x80d9('0x69')](_0x80d9('0x77'),_0x80d9('0x4d'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x80d9('0x32')](_0x80d9('0x78'),_0x471462[_0x80d9('0x6f')][_0x80d9('0x6b')]())[_0x80d9('0x32')](_0x80d9('0x70')))[_0x80d9('0x6b')]();_0x2ae0df[_0x80d9('0x83')](db['sequelize'][_0x80d9('0x2b')](_0x590973));}return BPromise[_0x80d9('0x84')](_0x2ae0df);}})[_0x80d9('0x1e')](function(){return _0x4194eb;})['then'](respondWithResult(_0x397fa3,null))[_0x80d9('0x3e')](handleError(_0x397fa3,null));};exports[_0x80d9('0x8a')]=function(_0x1e425f,_0xae516d,_0x5b06c6){return db['Campaign'][_0x80d9('0x3d')]({'where':{'id':_0x1e425f[_0x80d9('0x49')]['id']}})[_0x80d9('0x1e')](handleEntityNotFound(_0xae516d,null))[_0x80d9('0x1e')](function(_0x48bbbd){if(_0x48bbbd){return _0x48bbbd['removeBlackLists'](_0x1e425f['query'][_0x80d9('0x5f')]);}})[_0x80d9('0x1e')](function(_0x1be117){if(_0x1be117){return db['CmHopperBlack'][_0x80d9('0x1f')]({'where':{'ListId':_0x1e425f['query'][_0x80d9('0x5f')],'CampaignId':_0x1e425f[_0x80d9('0x49')]['id']}})[_0x80d9('0x1e')](function(){return _0x1be117;});}})['then'](respondWithStatusCode(_0xae516d,null))[_0x80d9('0x3e')](handleError(_0xae516d,null));}; \ No newline at end of file +var _0xb620=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','role','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','nolimit','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','select','phone','field','NOW()','ContactId','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','ListId','cm_contacts','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x5256c6,_0x330008){var _0x253162=function(_0x489ed3){while(--_0x489ed3){_0x5256c6['push'](_0x5256c6['shift']());}};_0x253162(++_0x330008);}(_0xb620,0x118));var _0x0b62=function(_0x53d22c,_0x129398){_0x53d22c=_0x53d22c-0x0;var _0x74e205=_0xb620[_0x53d22c];return _0x74e205;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b62('0x0'));var zipdir=require(_0x0b62('0x1'));var jsonpatch=require(_0x0b62('0x2'));var rp=require(_0x0b62('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0b62('0x4'));var util=require(_0x0b62('0x5'));var path=require(_0x0b62('0x6'));var sox=require(_0x0b62('0x7'));var csv=require('to-csv');var ejs=require(_0x0b62('0x8'));var fs=require('fs');var fs_extra=require(_0x0b62('0x9'));var _=require(_0x0b62('0xa'));var squel=require(_0x0b62('0xb'));var crypto=require(_0x0b62('0xc'));var jsforce=require(_0x0b62('0xd'));var deskjs=require(_0x0b62('0xe'));var toCsv=require(_0x0b62('0xf'));var querystring=require('querystring');var Papa=require(_0x0b62('0x10'));var Redis=require(_0x0b62('0x11'));var authService=require(_0x0b62('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0b62('0x13'));var hardwareService=require(_0x0b62('0x14'));var logger=require(_0x0b62('0x15'))('api');var utils=require(_0x0b62('0x16'));var config=require(_0x0b62('0x17'));var licenseUtil=require(_0x0b62('0x18'));var db=require(_0x0b62('0x19'))['db'];function respondWithStatusCode(_0x53aa3d,_0x30d16b){_0x30d16b=_0x30d16b||0xcc;return function(_0x1d248b){if(_0x1d248b){return _0x53aa3d[_0x0b62('0x1a')](_0x30d16b);}return _0x53aa3d[_0x0b62('0x1b')](_0x30d16b)[_0x0b62('0x1c')]();};}function respondWithResult(_0x3b9778,_0xbe0003){_0xbe0003=_0xbe0003||0xc8;return function(_0x4b8d50){if(_0x4b8d50){return _0x3b9778[_0x0b62('0x1b')](_0xbe0003)[_0x0b62('0x1d')](_0x4b8d50);}};}function respondWithFilteredResult(_0x321fe3,_0x38130d){return function(_0x533088){if(_0x533088){var _0x5cf1cf=typeof _0x38130d[_0x0b62('0x1e')]===_0x0b62('0x1f')&&typeof _0x38130d[_0x0b62('0x20')]===_0x0b62('0x1f');var _0x22272b=_0x533088[_0x0b62('0x21')];var _0x43f430=_0x5cf1cf?0x0:_0x38130d[_0x0b62('0x1e')];var _0x330cb1=_0x5cf1cf?_0x533088[_0x0b62('0x21')]:_0x38130d[_0x0b62('0x1e')]+_0x38130d[_0x0b62('0x20')];var _0x4fa609;if(_0x330cb1>=_0x22272b){_0x330cb1=_0x22272b;_0x4fa609=0xc8;}else{_0x4fa609=0xce;}_0x321fe3['status'](_0x4fa609);return _0x321fe3[_0x0b62('0x22')](_0x0b62('0x23'),_0x43f430+'-'+_0x330cb1+'/'+_0x22272b)[_0x0b62('0x1d')](_0x533088);}return null;};}function patchUpdates(_0xb6c74e){return function(_0x440846){try{jsonpatch['apply'](_0x440846,_0xb6c74e,!![]);}catch(_0x513f8c){return BPromise[_0x0b62('0x24')](_0x513f8c);}return _0x440846['save']();};}function saveUpdates(_0x1b1062,_0x267739){return function(_0x1f2879){if(_0x1f2879){return _0x1f2879[_0x0b62('0x25')](_0x1b1062)[_0x0b62('0x26')](function(_0x40b57e){return _0x40b57e;});}return null;};}function removeEntity(_0x1bb76e,_0x55b42f){return function(_0x4b8c52){if(_0x4b8c52){return _0x4b8c52[_0x0b62('0x27')]()[_0x0b62('0x26')](function(){var _0x46f2c7=_0x4b8c52[_0x0b62('0x28')]({'plain':!![]});var _0x28988c=_0x0b62('0x29');return db[_0x0b62('0x2a')][_0x0b62('0x27')]({'where':{'type':_0x28988c,'resourceId':_0x46f2c7['id']}})[_0x0b62('0x26')](function(){return _0x4b8c52;});})[_0x0b62('0x26')](function(){_0x1bb76e['status'](0xcc)[_0x0b62('0x1c')]();});}};}function handleEntityNotFound(_0x5f12c1,_0x293489){return function(_0x1a8cda){if(!_0x1a8cda){_0x5f12c1[_0x0b62('0x1a')](0x194);}return _0x1a8cda;};}function handleError(_0x180f28,_0x174040){_0x174040=_0x174040||0x1f4;return function(_0x1bdb19){logger[_0x0b62('0x2b')](_0x1bdb19[_0x0b62('0x2c')]);if(_0x1bdb19[_0x0b62('0x2d')]){delete _0x1bdb19[_0x0b62('0x2d')];}_0x180f28[_0x0b62('0x1b')](_0x174040)[_0x0b62('0x2e')](_0x1bdb19);};}exports[_0x0b62('0x2f')]=function(_0x2187d0,_0xc1c296){var _0x3be453={},_0x2a6dd2={},_0x5870c9={'count':0x0,'rows':[]};var _0xf67d50=_['map'](db[_0x0b62('0x30')][_0x0b62('0x31')],function(_0x4376e0){return{'name':_0x4376e0[_0x0b62('0x32')],'type':_0x4376e0[_0x0b62('0x33')][_0x0b62('0x34')]};});_0x2a6dd2[_0x0b62('0x35')]=_[_0x0b62('0x36')](_0xf67d50,_0x0b62('0x2d'));_0x2a6dd2['query']=_['keys'](_0x2187d0['query']);_0x2a6dd2[_0x0b62('0x37')]=_[_0x0b62('0x38')](_0x2a6dd2[_0x0b62('0x35')],_0x2a6dd2[_0x0b62('0x39')]);_0x3be453[_0x0b62('0x3a')]=_['intersection'](_0x2a6dd2[_0x0b62('0x35')],qs['fields'](_0x2187d0['query'][_0x0b62('0x3b')]));_0x3be453[_0x0b62('0x3a')]=_0x3be453[_0x0b62('0x3a')][_0x0b62('0x3c')]?_0x3be453[_0x0b62('0x3a')]:_0x2a6dd2[_0x0b62('0x35')];if(!_0x2187d0[_0x0b62('0x39')]['hasOwnProperty']('nolimit')){_0x3be453['limit']=qs[_0x0b62('0x20')](_0x2187d0[_0x0b62('0x39')][_0x0b62('0x20')]);_0x3be453[_0x0b62('0x1e')]=qs[_0x0b62('0x1e')](_0x2187d0['query'][_0x0b62('0x1e')]);}_0x3be453[_0x0b62('0x3d')]=qs[_0x0b62('0x3e')](_0x2187d0[_0x0b62('0x39')][_0x0b62('0x3e')]);_0x3be453[_0x0b62('0x3f')]=qs['filters'](_[_0x0b62('0x40')](_0x2187d0[_0x0b62('0x39')],_0x2a6dd2[_0x0b62('0x37')]),_0xf67d50);if(_0x2187d0[_0x0b62('0x39')][_0x0b62('0x41')]){_0x3be453[_0x0b62('0x3f')]=_[_0x0b62('0x42')](_0x3be453[_0x0b62('0x3f')],{'$or':_[_0x0b62('0x36')](_0xf67d50,function(_0x246cb8){if(_0x246cb8[_0x0b62('0x33')]!==_0x0b62('0x43')){var _0xfda166={};_0xfda166[_0x246cb8[_0x0b62('0x2d')]]={'$like':'%'+_0x2187d0[_0x0b62('0x39')][_0x0b62('0x41')]+'%'};return _0xfda166;}})});}_0x3be453=_[_0x0b62('0x42')]({},_0x3be453,_0x2187d0[_0x0b62('0x44')]);var _0xa3c1b6={'where':_0x3be453[_0x0b62('0x3f')]};return db[_0x0b62('0x30')][_0x0b62('0x21')](_0xa3c1b6)['then'](function(_0x13ea06){_0x5870c9[_0x0b62('0x21')]=_0x13ea06;if(_0x2187d0[_0x0b62('0x39')][_0x0b62('0x45')]){_0x3be453[_0x0b62('0x46')]=[{'all':!![]}];}return db[_0x0b62('0x30')][_0x0b62('0x47')](_0x3be453);})[_0x0b62('0x26')](function(_0x1cc59a){_0x5870c9[_0x0b62('0x48')]=_0x1cc59a;return _0x5870c9;})[_0x0b62('0x26')](respondWithFilteredResult(_0xc1c296,_0x3be453))[_0x0b62('0x49')](handleError(_0xc1c296,null));};exports[_0x0b62('0x4a')]=function(_0x509a82,_0x5c71b4){var _0x2b9b73={'raw':![],'where':{'id':_0x509a82[_0x0b62('0x4b')]['id']}},_0x581e38={};_0x581e38['model']=_['keys'](db[_0x0b62('0x30')][_0x0b62('0x31')]);_0x581e38[_0x0b62('0x39')]=_[_0x0b62('0x4c')](_0x509a82['query']);_0x581e38[_0x0b62('0x37')]=_[_0x0b62('0x38')](_0x581e38[_0x0b62('0x35')],_0x581e38[_0x0b62('0x39')]);_0x2b9b73[_0x0b62('0x3a')]=_[_0x0b62('0x38')](_0x581e38[_0x0b62('0x35')],qs[_0x0b62('0x3b')](_0x509a82[_0x0b62('0x39')][_0x0b62('0x3b')]));_0x2b9b73[_0x0b62('0x3a')]=_0x2b9b73[_0x0b62('0x3a')][_0x0b62('0x3c')]?_0x2b9b73[_0x0b62('0x3a')]:_0x581e38['model'];if(_0x509a82[_0x0b62('0x39')][_0x0b62('0x45')]){_0x2b9b73[_0x0b62('0x46')]=[{'all':!![]}];}_0x2b9b73=_[_0x0b62('0x42')]({},_0x2b9b73,_0x509a82[_0x0b62('0x44')]);return db[_0x0b62('0x30')]['find'](_0x2b9b73)[_0x0b62('0x26')](handleEntityNotFound(_0x5c71b4,null))['then'](respondWithResult(_0x5c71b4,null))[_0x0b62('0x49')](handleError(_0x5c71b4,null));};exports[_0x0b62('0x4d')]=function(_0x461b9a,_0x2aa766){return db[_0x0b62('0x30')][_0x0b62('0x4d')](_0x461b9a[_0x0b62('0x4e')],{})[_0x0b62('0x26')](function(_0x2aae45){var _0x2471b4=_0x461b9a['user'][_0x0b62('0x28')]({'plain':!![]});if(!_0x2471b4)throw new Error(_0x0b62('0x4f'));if(_0x2471b4['role']==='user'){var _0x222d90=_0x2aae45[_0x0b62('0x28')]({'plain':!![]});var _0x40119b=_0x0b62('0x29');return db[_0x0b62('0x50')][_0x0b62('0x51')]({'where':{'name':_0x40119b,'userProfileId':_0x2471b4[_0x0b62('0x52')]},'raw':!![]})[_0x0b62('0x26')](function(_0x30efd1){if(_0x30efd1&&_0x30efd1[_0x0b62('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x222d90[_0x0b62('0x2d')],'resourceId':_0x222d90['id'],'type':_0x30efd1[_0x0b62('0x2d')],'sectionId':_0x30efd1['id']},{})['then'](function(){return _0x2aae45;});}else{return _0x2aae45;}})[_0x0b62('0x49')](function(_0x521708){logger[_0x0b62('0x2b')](_0x0b62('0x54'),_0x521708);throw _0x521708;});}return _0x2aae45;})['then'](respondWithResult(_0x2aa766,0xc9))['catch'](handleError(_0x2aa766,null));};exports[_0x0b62('0x55')]=function(_0x33a333,_0x477be9){var _0x562040={'where':{'id':_0x33a333['params']['id']}},_0x1905e0={};_0x1905e0[_0x0b62('0x35')]=_[_0x0b62('0x4c')](db[_0x0b62('0x30')][_0x0b62('0x31')]);_0x562040[_0x0b62('0x3a')]=_['intersection'](_0x1905e0['model'],qs[_0x0b62('0x3b')](_0x33a333[_0x0b62('0x39')][_0x0b62('0x3b')]));_0x562040[_0x0b62('0x3a')]=_0x562040[_0x0b62('0x3a')][_0x0b62('0x3c')]?_0x562040[_0x0b62('0x3a')]:_0x1905e0[_0x0b62('0x35')];if(_0x33a333['query'][_0x0b62('0x45')]){_0x562040[_0x0b62('0x46')]=[{'all':!![]}];}_0x562040=_['merge']({},_0x562040,_0x33a333[_0x0b62('0x44')]);return db['Campaign'][_0x0b62('0x51')](_0x562040)[_0x0b62('0x26')](handleEntityNotFound(_0x477be9,null))[_0x0b62('0x26')](function(_0x315643){if(_0x315643){var _0x2110d1=_0x315643[_0x0b62('0x28')]({'plain':!![]});_0x2110d1=qs[_0x0b62('0x56')](_0x2110d1,['id',_0x0b62('0x57'),_0x0b62('0x58')]);_0x33a333[_0x0b62('0x4e')]=_[_0x0b62('0x56')](_0x33a333[_0x0b62('0x4e')],['id',_0x0b62('0x57'),_0x0b62('0x58')]);return db[_0x0b62('0x30')][_0x0b62('0x4d')](_[_0x0b62('0x42')](_0x2110d1,_0x33a333[_0x0b62('0x4e')]),{'include':_0x33a333[_0x0b62('0x39')][_0x0b62('0x45')]?[{'all':!![]}]:undefined})[_0x0b62('0x26')](function(_0x29691e){var _0x2c9406=_0x33a333[_0x0b62('0x59')]['get']({'plain':!![]});if(!_0x2c9406)throw new Error(_0x0b62('0x4f'));if(_0x2c9406[_0x0b62('0x5a')]===_0x0b62('0x59')){var _0xd230fb=_0x29691e[_0x0b62('0x28')]({'plain':!![]});var _0x50c719=_0x0b62('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x50c719,'userProfileId':_0x2c9406[_0x0b62('0x52')]},'raw':!![]})[_0x0b62('0x26')](function(_0x108a25){if(_0x108a25&&_0x108a25['autoAssociation']===0x0){return db[_0x0b62('0x2a')][_0x0b62('0x4d')]({'name':_0xd230fb[_0x0b62('0x2d')],'resourceId':_0xd230fb['id'],'type':_0x108a25[_0x0b62('0x2d')],'sectionId':_0x108a25['id']},{})[_0x0b62('0x26')](function(){return _0x29691e;});}else{return _0x29691e;}})['catch'](function(_0x5854bc){logger[_0x0b62('0x2b')](_0x0b62('0x54'),_0x5854bc);throw _0x5854bc;});}return _0x29691e;});}})[_0x0b62('0x26')](respondWithResult(_0x477be9,0xc9))['catch'](handleError(_0x477be9,null));};exports[_0x0b62('0x25')]=function(_0x1bb566,_0x268d5f){if(_0x1bb566['body']['id']){delete _0x1bb566[_0x0b62('0x4e')]['id'];}return db[_0x0b62('0x30')][_0x0b62('0x51')]({'where':{'id':_0x1bb566[_0x0b62('0x4b')]['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x268d5f,null))[_0x0b62('0x26')](saveUpdates(_0x1bb566[_0x0b62('0x4e')],null))[_0x0b62('0x26')](respondWithResult(_0x268d5f,null))['catch'](handleError(_0x268d5f,null));};exports[_0x0b62('0x27')]=function(_0x44b9b4,_0x208037){return db['Campaign'][_0x0b62('0x51')]({'where':{'id':_0x44b9b4[_0x0b62('0x4b')]['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x208037,null))[_0x0b62('0x26')](removeEntity(_0x208037,null))['catch'](handleError(_0x208037,null));};exports[_0x0b62('0x5b')]=function(_0x396869,_0x39711d,_0x1d9542){var _0x4a9e3f={'raw':!![],'where':{}};var _0x2e7cf9={};var _0x587691={'count':0x0,'rows':[]};return db['Campaign'][_0x0b62('0x5c')]({'where':{'id':_0x396869[_0x0b62('0x4b')]['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x39711d,null))[_0x0b62('0x26')](function(_0x27a583){if(_0x27a583){_0x2e7cf9[_0x0b62('0x35')]=_[_0x0b62('0x4c')](db['CmHopper']['rawAttributes']);_0x2e7cf9['query']=_[_0x0b62('0x4c')](_0x396869[_0x0b62('0x39')]);_0x2e7cf9['filters']=_['intersection'](_0x2e7cf9[_0x0b62('0x35')],_0x2e7cf9[_0x0b62('0x39')]);_0x4a9e3f[_0x0b62('0x3a')]=_[_0x0b62('0x38')](_0x2e7cf9[_0x0b62('0x35')],qs[_0x0b62('0x3b')](_0x396869[_0x0b62('0x39')][_0x0b62('0x3b')]));_0x4a9e3f['attributes']=_0x4a9e3f['attributes'][_0x0b62('0x3c')]?_0x4a9e3f['attributes']:_0x2e7cf9[_0x0b62('0x35')];if(!_0x396869[_0x0b62('0x39')][_0x0b62('0x5d')]('nolimit')){_0x4a9e3f[_0x0b62('0x20')]=qs['limit'](_0x396869['query']['limit']);_0x4a9e3f[_0x0b62('0x1e')]=qs['offset'](_0x396869[_0x0b62('0x39')][_0x0b62('0x1e')]);}_0x4a9e3f[_0x0b62('0x3d')]=qs['sort'](_0x396869['query']['sort']);_0x4a9e3f['where']=qs[_0x0b62('0x37')](_[_0x0b62('0x40')](_0x396869[_0x0b62('0x39')],_0x2e7cf9[_0x0b62('0x37')]));_0x4a9e3f['where'][_0x0b62('0x5e')]=_0x27a583['id'];if(_0x396869['query']['filter']){_0x4a9e3f['where']=_['merge'](_0x4a9e3f[_0x0b62('0x3f')],{'$or':_[_0x0b62('0x36')](_0x4a9e3f['attributes'],function(_0x3f61d1){var _0x4a068f={};_0x4a068f[_0x3f61d1]={'$like':'%'+_0x396869['query'][_0x0b62('0x41')]+'%'};return _0x4a068f;})});}_0x4a9e3f=_['merge']({},_0x4a9e3f,_0x396869[_0x0b62('0x44')]);return db[_0x0b62('0x5f')][_0x0b62('0x21')]({'where':_0x4a9e3f[_0x0b62('0x3f')]})[_0x0b62('0x26')](function(_0x3d0f16){_0x587691[_0x0b62('0x21')]=_0x3d0f16;if(_0x396869[_0x0b62('0x39')][_0x0b62('0x45')]){_0x4a9e3f[_0x0b62('0x46')]=[{'all':!![]}];}return db[_0x0b62('0x5f')][_0x0b62('0x47')](_0x4a9e3f);})[_0x0b62('0x26')](function(_0x227277){_0x587691[_0x0b62('0x48')]=_0x227277;return _0x587691;});}})[_0x0b62('0x26')](respondWithFilteredResult(_0x39711d,_0x4a9e3f))[_0x0b62('0x49')](handleError(_0x39711d,null));};exports[_0x0b62('0x60')]=function(_0x1fe453,_0x59dc58,_0x27b001){var _0x5d89aa={'raw':!![],'where':{}};var _0x41569a={};var _0x40fd0a={'count':0x0,'rows':[]};return db[_0x0b62('0x30')]['findOne']({'where':{'id':_0x1fe453[_0x0b62('0x4b')]['id']}})['then'](handleEntityNotFound(_0x59dc58,null))['then'](function(_0x1e15f0){if(_0x1e15f0){_0x41569a[_0x0b62('0x35')]=_['keys'](db['CmHopperHistory'][_0x0b62('0x31')]);_0x41569a['query']=_[_0x0b62('0x4c')](_0x1fe453[_0x0b62('0x39')]);_0x41569a[_0x0b62('0x37')]=_[_0x0b62('0x38')](_0x41569a['model'],_0x41569a['query']);_0x5d89aa[_0x0b62('0x3a')]=_[_0x0b62('0x38')](_0x41569a[_0x0b62('0x35')],qs[_0x0b62('0x3b')](_0x1fe453['query'][_0x0b62('0x3b')]));_0x5d89aa[_0x0b62('0x3a')]=_0x5d89aa['attributes'][_0x0b62('0x3c')]?_0x5d89aa[_0x0b62('0x3a')]:_0x41569a[_0x0b62('0x35')];if(!_0x1fe453['query'][_0x0b62('0x5d')]('nolimit')){_0x5d89aa[_0x0b62('0x20')]=qs['limit'](_0x1fe453[_0x0b62('0x39')][_0x0b62('0x20')]);_0x5d89aa[_0x0b62('0x1e')]=qs[_0x0b62('0x1e')](_0x1fe453[_0x0b62('0x39')][_0x0b62('0x1e')]);}_0x5d89aa[_0x0b62('0x3d')]=qs['sort'](_0x1fe453[_0x0b62('0x39')][_0x0b62('0x3e')]);_0x5d89aa[_0x0b62('0x3f')]=qs[_0x0b62('0x37')](_[_0x0b62('0x40')](_0x1fe453['query'],_0x41569a['filters']));_0x5d89aa[_0x0b62('0x3f')][_0x0b62('0x5e')]=_0x1e15f0['id'];if(_0x1fe453[_0x0b62('0x39')][_0x0b62('0x41')]){_0x5d89aa['where']=_[_0x0b62('0x42')](_0x5d89aa[_0x0b62('0x3f')],{'$or':_[_0x0b62('0x36')](_0x5d89aa['attributes'],function(_0x3a2487){var _0x3da817={};_0x3da817[_0x3a2487]={'$like':'%'+_0x1fe453[_0x0b62('0x39')][_0x0b62('0x41')]+'%'};return _0x3da817;})});}_0x5d89aa=_[_0x0b62('0x42')]({},_0x5d89aa,_0x1fe453[_0x0b62('0x44')]);return db['CmHopperHistory'][_0x0b62('0x21')]({'where':_0x5d89aa[_0x0b62('0x3f')]})[_0x0b62('0x26')](function(_0x1ca172){_0x40fd0a[_0x0b62('0x21')]=_0x1ca172;if(_0x1fe453[_0x0b62('0x39')][_0x0b62('0x45')]){_0x5d89aa[_0x0b62('0x46')]=[{'all':!![]}];}return db[_0x0b62('0x61')][_0x0b62('0x47')](_0x5d89aa);})[_0x0b62('0x26')](function(_0x520b78){_0x40fd0a[_0x0b62('0x48')]=_0x520b78;return _0x40fd0a;});}})['then'](respondWithFilteredResult(_0x59dc58,_0x5d89aa))['catch'](handleError(_0x59dc58,null));};exports['getHopperFinals']=function(_0x255ebb,_0x370d33,_0x5e30fa){var _0x348700={'raw':!![],'where':{}};var _0x5f308c={};var _0xdc8615={'count':0x0,'rows':[]};return db[_0x0b62('0x30')][_0x0b62('0x5c')]({'where':{'id':_0x255ebb[_0x0b62('0x4b')]['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x370d33,null))[_0x0b62('0x26')](function(_0x3cf7c8){if(_0x3cf7c8){_0x5f308c['model']=_[_0x0b62('0x4c')](db[_0x0b62('0x62')][_0x0b62('0x31')]);_0x5f308c[_0x0b62('0x39')]=_[_0x0b62('0x4c')](_0x255ebb[_0x0b62('0x39')]);_0x5f308c[_0x0b62('0x37')]=_[_0x0b62('0x38')](_0x5f308c[_0x0b62('0x35')],_0x5f308c[_0x0b62('0x39')]);_0x348700['attributes']=_[_0x0b62('0x38')](_0x5f308c[_0x0b62('0x35')],qs['fields'](_0x255ebb['query'][_0x0b62('0x3b')]));_0x348700[_0x0b62('0x3a')]=_0x348700['attributes'][_0x0b62('0x3c')]?_0x348700[_0x0b62('0x3a')]:_0x5f308c[_0x0b62('0x35')];if(!_0x255ebb[_0x0b62('0x39')][_0x0b62('0x5d')]('nolimit')){_0x348700[_0x0b62('0x20')]=qs[_0x0b62('0x20')](_0x255ebb['query'][_0x0b62('0x20')]);_0x348700['offset']=qs[_0x0b62('0x1e')](_0x255ebb[_0x0b62('0x39')][_0x0b62('0x1e')]);}_0x348700['order']=qs[_0x0b62('0x3e')](_0x255ebb[_0x0b62('0x39')][_0x0b62('0x3e')]);_0x348700['where']=qs['filters'](_[_0x0b62('0x40')](_0x255ebb[_0x0b62('0x39')],_0x5f308c[_0x0b62('0x37')]));_0x348700['where'][_0x0b62('0x5e')]=_0x3cf7c8['id'];if(_0x255ebb[_0x0b62('0x39')]['filter']){_0x348700[_0x0b62('0x3f')]=_[_0x0b62('0x42')](_0x348700[_0x0b62('0x3f')],{'$or':_[_0x0b62('0x36')](_0x348700[_0x0b62('0x3a')],function(_0x332de3){var _0xd56c1f={};_0xd56c1f[_0x332de3]={'$like':'%'+_0x255ebb[_0x0b62('0x39')]['filter']+'%'};return _0xd56c1f;})});}_0x348700=_[_0x0b62('0x42')]({},_0x348700,_0x255ebb['options']);return db['CmHopperFinal']['count']({'where':_0x348700[_0x0b62('0x3f')]})[_0x0b62('0x26')](function(_0x1b82e5){_0xdc8615[_0x0b62('0x21')]=_0x1b82e5;if(_0x255ebb[_0x0b62('0x39')]['includeAll']){_0x348700['include']=[{'all':!![]}];}return db[_0x0b62('0x62')][_0x0b62('0x47')](_0x348700);})['then'](function(_0xd30a17){_0xdc8615[_0x0b62('0x48')]=_0xd30a17;return _0xdc8615;});}})[_0x0b62('0x26')](respondWithFilteredResult(_0x370d33,_0x348700))[_0x0b62('0x49')](handleError(_0x370d33,null));};exports['getHopperBlacks']=function(_0x2c4ba4,_0x209e9b,_0x409e7){var _0x2feea4={'raw':!![],'where':{}};var _0x98838={};var _0x443aaf={'count':0x0,'rows':[]};return db[_0x0b62('0x30')]['findOne']({'where':{'id':_0x2c4ba4['params']['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x209e9b,null))[_0x0b62('0x26')](function(_0x53b8ca){if(_0x53b8ca){_0x98838[_0x0b62('0x35')]=_[_0x0b62('0x4c')](db[_0x0b62('0x63')][_0x0b62('0x31')]);_0x98838[_0x0b62('0x39')]=_[_0x0b62('0x4c')](_0x2c4ba4[_0x0b62('0x39')]);_0x98838[_0x0b62('0x37')]=_['intersection'](_0x98838[_0x0b62('0x35')],_0x98838[_0x0b62('0x39')]);_0x2feea4[_0x0b62('0x3a')]=_[_0x0b62('0x38')](_0x98838[_0x0b62('0x35')],qs[_0x0b62('0x3b')](_0x2c4ba4[_0x0b62('0x39')][_0x0b62('0x3b')]));_0x2feea4[_0x0b62('0x3a')]=_0x2feea4['attributes']['length']?_0x2feea4[_0x0b62('0x3a')]:_0x98838['model'];if(!_0x2c4ba4[_0x0b62('0x39')][_0x0b62('0x5d')](_0x0b62('0x64'))){_0x2feea4[_0x0b62('0x20')]=qs[_0x0b62('0x20')](_0x2c4ba4[_0x0b62('0x39')][_0x0b62('0x20')]);_0x2feea4['offset']=qs['offset'](_0x2c4ba4[_0x0b62('0x39')][_0x0b62('0x1e')]);}_0x2feea4[_0x0b62('0x3d')]=qs['sort'](_0x2c4ba4['query']['sort']);_0x2feea4[_0x0b62('0x3f')]=qs[_0x0b62('0x37')](_['pick'](_0x2c4ba4[_0x0b62('0x39')],_0x98838[_0x0b62('0x37')]));_0x2feea4['where'][_0x0b62('0x5e')]=_0x53b8ca['id'];if(_0x2c4ba4[_0x0b62('0x39')][_0x0b62('0x41')]){_0x2feea4[_0x0b62('0x3f')]=_[_0x0b62('0x42')](_0x2feea4['where'],{'$or':_[_0x0b62('0x36')](_0x2feea4[_0x0b62('0x3a')],function(_0x168add){var _0x943044={};_0x943044[_0x168add]={'$like':'%'+_0x2c4ba4[_0x0b62('0x39')][_0x0b62('0x41')]+'%'};return _0x943044;})});}_0x2feea4=_[_0x0b62('0x42')]({},_0x2feea4,_0x2c4ba4['options']);return db[_0x0b62('0x63')][_0x0b62('0x21')]({'where':_0x2feea4[_0x0b62('0x3f')]})['then'](function(_0x5b0544){_0x443aaf[_0x0b62('0x21')]=_0x5b0544;if(_0x2c4ba4['query'][_0x0b62('0x45')]){_0x2feea4[_0x0b62('0x46')]=[{'all':!![]}];}return db[_0x0b62('0x63')][_0x0b62('0x47')](_0x2feea4);})[_0x0b62('0x26')](function(_0x4ef15e){_0x443aaf[_0x0b62('0x48')]=_0x4ef15e;return _0x443aaf;});}})['then'](respondWithFilteredResult(_0x209e9b,_0x2feea4))[_0x0b62('0x49')](handleError(_0x209e9b,null));};exports[_0x0b62('0x65')]=function(_0x4b9bd7,_0x56e772,_0x279bb1){var _0x5e27d7={};var _0x24651a={};var _0xa9af;var _0x1995f1;return db['Campaign'][_0x0b62('0x5c')]({'where':{'id':_0x4b9bd7[_0x0b62('0x4b')]['id']}})['then'](handleEntityNotFound(_0x56e772,null))[_0x0b62('0x26')](function(_0x5a0c71){if(_0x5a0c71){_0xa9af=_0x5a0c71;_0x24651a[_0x0b62('0x35')]=_[_0x0b62('0x4c')](db['CmList'][_0x0b62('0x31')]);_0x24651a['query']=_[_0x0b62('0x4c')](_0x4b9bd7['query']);_0x24651a[_0x0b62('0x37')]=_[_0x0b62('0x38')](_0x24651a['model'],_0x24651a['query']);_0x5e27d7['attributes']=_[_0x0b62('0x38')](_0x24651a[_0x0b62('0x35')],qs[_0x0b62('0x3b')](_0x4b9bd7[_0x0b62('0x39')][_0x0b62('0x3b')]));_0x5e27d7[_0x0b62('0x3a')]=_0x5e27d7[_0x0b62('0x3a')][_0x0b62('0x3c')]?_0x5e27d7[_0x0b62('0x3a')]:_0x24651a[_0x0b62('0x35')];_0x5e27d7['order']=qs['sort'](_0x4b9bd7[_0x0b62('0x39')]['sort']);_0x5e27d7[_0x0b62('0x3f')]=qs[_0x0b62('0x37')](_[_0x0b62('0x40')](_0x4b9bd7[_0x0b62('0x39')],_0x24651a[_0x0b62('0x37')]));if(_0x4b9bd7[_0x0b62('0x39')][_0x0b62('0x41')]){_0x5e27d7[_0x0b62('0x3f')]=_[_0x0b62('0x42')](_0x5e27d7['where'],{'$or':_[_0x0b62('0x36')](_0x5e27d7['attributes'],function(_0x3dcdf4){var _0x4490ad={};_0x4490ad[_0x3dcdf4]={'$like':'%'+_0x4b9bd7[_0x0b62('0x39')]['filter']+'%'};return _0x4490ad;})});}_0x5e27d7=_[_0x0b62('0x42')]({},_0x5e27d7,_0x4b9bd7['options']);return _0xa9af[_0x0b62('0x65')](_0x5e27d7);}})[_0x0b62('0x26')](function(_0x4fd195){if(_0x4fd195){_0x1995f1=_0x4fd195[_0x0b62('0x3c')];if(!_0x4b9bd7[_0x0b62('0x39')][_0x0b62('0x5d')](_0x0b62('0x64'))){_0x5e27d7[_0x0b62('0x20')]=qs[_0x0b62('0x20')](_0x4b9bd7[_0x0b62('0x39')][_0x0b62('0x20')]);_0x5e27d7['offset']=qs[_0x0b62('0x1e')](_0x4b9bd7[_0x0b62('0x39')][_0x0b62('0x1e')]);}return _0xa9af[_0x0b62('0x65')](_0x5e27d7);}})['then'](function(_0x1cd84a){if(_0x1cd84a){return _0x1cd84a?{'count':_0x1995f1,'rows':_0x1cd84a}:null;}})['then'](respondWithResult(_0x56e772,null))[_0x0b62('0x49')](handleError(_0x56e772,null));};exports[_0x0b62('0x66')]=function(_0x57814e,_0x5ae132,_0x5858c3){var _0x4ccd93,_0x44f835;var _0x4c9526=[];var _0x4a89b7=moment()[_0x0b62('0x67')](_0x0b62('0x68'));return db['Campaign'][_0x0b62('0x51')]({'where':{'id':_0x57814e[_0x0b62('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ae132,null))[_0x0b62('0x26')](function(_0x107eea){if(_0x107eea){_0x44f835=_0x107eea;return _0x107eea['addLists'](_0x57814e[_0x0b62('0x4e')][_0x0b62('0x69')],_[_0x0b62('0x56')](_0x57814e[_0x0b62('0x4e')],[_0x0b62('0x69'),'id'])||{});}return null;})['spread'](function(_0x179a4d){var _0x1663d4;var _0x279065;_0x4ccd93=_0x179a4d||[];var _0x59d940=[];if(_0x179a4d){for(var _0x297b67=0x0;_0x297b67<_0x179a4d['length'];_0x297b67+=0x1){var _0x3ff3d5=_0x179a4d[_0x297b67]['get']({'plain':!![]});_0x44f835[_0x0b62('0x6a')]=_0x57814e[_0x0b62('0x4e')][_0x0b62('0x6a')]?_0x57814e[_0x0b62('0x4e')][_0x0b62('0x6a')]:_0x44f835['dialCheckDuplicateType'];switch(_0x44f835['dialCheckDuplicateType']){case'always':_0x1663d4=squel[_0x0b62('0x6b')]()[_0x0b62('0x6c')](_0x0b62('0x6d'))[_0x0b62('0x6e')](['phone',_0x0b62('0x6f'),'ContactId','ListId',_0x0b62('0x5e'),'createdAt',_0x0b62('0x58')],squel[_0x0b62('0x70')]()['field'](_0x0b62('0x71'),_0x0b62('0x71'))[_0x0b62('0x72')](_0x0b62('0x73'),_0x0b62('0x6f'))[_0x0b62('0x72')]('id',_0x0b62('0x74'))[_0x0b62('0x72')](_0x3ff3d5[_0x0b62('0x75')][_0x0b62('0x76')](),'ListId')[_0x0b62('0x72')](_0x57814e[_0x0b62('0x4b')]['id'][_0x0b62('0x76')](),'CampaignId')[_0x0b62('0x72')]('\x27'+_0x4a89b7+'\x27',_0x0b62('0x57'))[_0x0b62('0x72')]('\x27'+_0x4a89b7+'\x27',_0x0b62('0x58'))[_0x0b62('0x77')]('cm_contacts')[_0x0b62('0x3f')](_0x0b62('0x78'))[_0x0b62('0x3f')]('ListId\x20=\x20?',_0x3ff3d5[_0x0b62('0x75')][_0x0b62('0x76')]())[_0x0b62('0x3f')](_0x0b62('0x79'))[_0x0b62('0x3f')](_0x0b62('0x7a'),squel[_0x0b62('0x70')]()[_0x0b62('0x72')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x0b62('0x7b'))[_0x0b62('0x3f')](_0x0b62('0x7c'),_0x57814e[_0x0b62('0x4b')]['id'][_0x0b62('0x76')]()))[_0x0b62('0x3f')](_0x0b62('0x7a'),squel[_0x0b62('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x0b62('0x77')](_0x0b62('0x6d'))['where']('CampaignId\x20=\x20?',_0x57814e['params']['id'][_0x0b62('0x76')]())))[_0x0b62('0x76')]();break;case'onlyIfOpen':_0x1663d4=squel[_0x0b62('0x6b')]()[_0x0b62('0x6c')]('cm_hopper')[_0x0b62('0x6e')]([_0x0b62('0x71'),_0x0b62('0x6f'),_0x0b62('0x74'),_0x0b62('0x7d'),_0x0b62('0x5e'),'createdAt',_0x0b62('0x58')],squel[_0x0b62('0x70')]()[_0x0b62('0x72')]('phone','phone')['field'](_0x0b62('0x73'),'scheduledAt')[_0x0b62('0x72')]('id',_0x0b62('0x74'))[_0x0b62('0x72')](_0x3ff3d5[_0x0b62('0x75')]['toString'](),_0x0b62('0x7d'))[_0x0b62('0x72')](_0x57814e[_0x0b62('0x4b')]['id'][_0x0b62('0x76')](),_0x0b62('0x5e'))[_0x0b62('0x72')]('\x27'+_0x4a89b7+'\x27',_0x0b62('0x57'))['field']('\x27'+_0x4a89b7+'\x27',_0x0b62('0x58'))[_0x0b62('0x77')](_0x0b62('0x7e'))['where'](_0x0b62('0x78'))[_0x0b62('0x3f')](_0x0b62('0x7f'),_0x3ff3d5[_0x0b62('0x75')][_0x0b62('0x76')]())[_0x0b62('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x0b62('0x3f')](_0x0b62('0x7a'),squel[_0x0b62('0x70')]()['field'](_0x0b62('0x80'))['from'](_0x0b62('0x6d'))['where'](_0x0b62('0x7c'),_0x57814e[_0x0b62('0x4b')]['id']['toString']())))[_0x0b62('0x76')]();break;default:_0x1663d4=squel[_0x0b62('0x6b')]()[_0x0b62('0x6c')](_0x0b62('0x6d'))[_0x0b62('0x6e')]([_0x0b62('0x71'),_0x0b62('0x6f'),_0x0b62('0x74'),_0x0b62('0x7d'),_0x0b62('0x5e'),'createdAt',_0x0b62('0x58')],squel[_0x0b62('0x70')]()[_0x0b62('0x72')](_0x0b62('0x71'),_0x0b62('0x71'))[_0x0b62('0x72')](_0x0b62('0x73'),_0x0b62('0x6f'))[_0x0b62('0x72')]('id',_0x0b62('0x74'))[_0x0b62('0x72')](_0x3ff3d5[_0x0b62('0x75')]['toString'](),_0x0b62('0x7d'))[_0x0b62('0x72')](_0x57814e[_0x0b62('0x4b')]['id'][_0x0b62('0x76')](),'CampaignId')[_0x0b62('0x72')]('\x27'+_0x4a89b7+'\x27','createdAt')['field']('\x27'+_0x4a89b7+'\x27',_0x0b62('0x58'))[_0x0b62('0x77')]('cm_contacts')[_0x0b62('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x0b62('0x7f'),_0x3ff3d5['CmListId'][_0x0b62('0x76')]())[_0x0b62('0x3f')](_0x0b62('0x79')))[_0x0b62('0x76')]();}_0x279065=squel['insert']()[_0x0b62('0x6c')]('cm_hopper_additional_phones')['fromQuery']([_0x0b62('0x81'),_0x0b62('0x6f'),_0x0b62('0x71'),_0x0b62('0x82'),'createdAt',_0x0b62('0x58')],squel[_0x0b62('0x70')]()['field'](_0x0b62('0x83'),'id')[_0x0b62('0x72')](_0x0b62('0x73'),_0x0b62('0x6f'))['field'](_0x0b62('0x84'),_0x0b62('0x71'))['field'](_0x0b62('0x85'),'OrderBy')[_0x0b62('0x72')]('\x27'+_0x4a89b7+'\x27','createdAt')[_0x0b62('0x72')]('\x27'+_0x4a89b7+'\x27',_0x0b62('0x58'))['from'](_0x0b62('0x86'),'ci')[_0x0b62('0x87')](_0x0b62('0x6d'),'h',_0x0b62('0x88'))['where'](_0x0b62('0x89'),_0x3ff3d5[_0x0b62('0x75')]['toString']())['where'](_0x0b62('0x8a'),_0x57814e[_0x0b62('0x4b')]['id'][_0x0b62('0x76')]())[_0x0b62('0x3f')]('h.createdAt\x20=\x20?',_0x4a89b7))[_0x0b62('0x76')]();_0x59d940[_0x0b62('0x8b')](db[_0x0b62('0x8c')]['query'](_0x1663d4));_0x4c9526[_0x0b62('0x8b')](db[_0x0b62('0x8c')][_0x0b62('0x39')](_0x279065));}return BPromise[_0x0b62('0x8d')](_0x59d940);}})[_0x0b62('0x26')](function(){return BPromise['all'](_0x4c9526);})[_0x0b62('0x26')](function(){return _0x4ccd93;})[_0x0b62('0x26')](respondWithResult(_0x5ae132,null))[_0x0b62('0x49')](handleError(_0x5ae132,null));};exports[_0x0b62('0x8e')]=function(_0x42b64c,_0x46946e,_0x4cb511){return db[_0x0b62('0x30')][_0x0b62('0x51')]({'where':{'id':_0x42b64c[_0x0b62('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46946e,null))['then'](function(_0x4e717a){if(_0x4e717a){return _0x4e717a['removeLists'](_0x42b64c['query'][_0x0b62('0x69')]);}})[_0x0b62('0x26')](function(_0x538532){if(_0x538532){return db[_0x0b62('0x5f')][_0x0b62('0x27')]({'where':{'ListId':_0x42b64c[_0x0b62('0x39')]['ids'],'CampaignId':_0x42b64c['params']['id']}})[_0x0b62('0x26')](function(){return _0x538532;});}})['then'](respondWithStatusCode(_0x46946e,null))[_0x0b62('0x49')](handleError(_0x46946e,null));};exports['getBlackLists']=function(_0x3a9ff0,_0x3e301f,_0x4d5977){var _0x3c3caa={};var _0x1d8df7={};var _0x3ce777;var _0x19d2a8;return db[_0x0b62('0x30')]['findOne']({'where':{'id':_0x3a9ff0[_0x0b62('0x4b')]['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x3e301f,null))[_0x0b62('0x26')](function(_0x5c4ba1){if(_0x5c4ba1){_0x3ce777=_0x5c4ba1;_0x1d8df7[_0x0b62('0x35')]=_[_0x0b62('0x4c')](db[_0x0b62('0x8f')][_0x0b62('0x31')]);_0x1d8df7[_0x0b62('0x39')]=_['keys'](_0x3a9ff0[_0x0b62('0x39')]);_0x1d8df7[_0x0b62('0x37')]=_[_0x0b62('0x38')](_0x1d8df7['model'],_0x1d8df7['query']);_0x3c3caa[_0x0b62('0x3a')]=_[_0x0b62('0x38')](_0x1d8df7[_0x0b62('0x35')],qs[_0x0b62('0x3b')](_0x3a9ff0[_0x0b62('0x39')][_0x0b62('0x3b')]));_0x3c3caa[_0x0b62('0x3a')]=_0x3c3caa[_0x0b62('0x3a')][_0x0b62('0x3c')]?_0x3c3caa[_0x0b62('0x3a')]:_0x1d8df7[_0x0b62('0x35')];_0x3c3caa[_0x0b62('0x3d')]=qs[_0x0b62('0x3e')](_0x3a9ff0[_0x0b62('0x39')][_0x0b62('0x3e')]);_0x3c3caa[_0x0b62('0x3f')]=qs['filters'](_[_0x0b62('0x40')](_0x3a9ff0['query'],_0x1d8df7[_0x0b62('0x37')]));if(_0x3a9ff0[_0x0b62('0x39')]['filter']){_0x3c3caa['where']=_[_0x0b62('0x42')](_0x3c3caa[_0x0b62('0x3f')],{'$or':_[_0x0b62('0x36')](_0x3c3caa[_0x0b62('0x3a')],function(_0x30bd57){var _0x36cc79={};_0x36cc79[_0x30bd57]={'$like':'%'+_0x3a9ff0[_0x0b62('0x39')][_0x0b62('0x41')]+'%'};return _0x36cc79;})});}_0x3c3caa=_[_0x0b62('0x42')]({},_0x3c3caa,_0x3a9ff0[_0x0b62('0x44')]);return _0x3ce777[_0x0b62('0x90')](_0x3c3caa);}})[_0x0b62('0x26')](function(_0xde7a67){if(_0xde7a67){_0x19d2a8=_0xde7a67[_0x0b62('0x3c')];if(!_0x3a9ff0[_0x0b62('0x39')][_0x0b62('0x5d')](_0x0b62('0x64'))){_0x3c3caa['limit']=qs[_0x0b62('0x20')](_0x3a9ff0[_0x0b62('0x39')]['limit']);_0x3c3caa['offset']=qs[_0x0b62('0x1e')](_0x3a9ff0[_0x0b62('0x39')][_0x0b62('0x1e')]);}return _0x3ce777[_0x0b62('0x90')](_0x3c3caa);}})[_0x0b62('0x26')](function(_0x38a694){if(_0x38a694){return _0x38a694?{'count':_0x19d2a8,'rows':_0x38a694}:null;}})['then'](respondWithResult(_0x3e301f,null))[_0x0b62('0x49')](handleError(_0x3e301f,null));};exports[_0x0b62('0x91')]=function(_0x4962f8,_0x19f1da,_0x3b9bee){var _0x58b98b,_0x3ff16e;var _0x453232=[];var _0x3cd6d2=moment()[_0x0b62('0x67')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0b62('0x30')][_0x0b62('0x51')]({'where':{'id':_0x4962f8[_0x0b62('0x4b')]['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x19f1da,null))[_0x0b62('0x26')](function(_0x2e6a17){if(_0x2e6a17){_0x3ff16e=_0x2e6a17;return _0x2e6a17['addBlackLists'](_0x4962f8[_0x0b62('0x4e')]['ids'],_[_0x0b62('0x56')](_0x4962f8[_0x0b62('0x4e')],['ids','id'])||{});}return null;})[_0x0b62('0x92')](function(_0x15c00f){var _0x1a8b48;var _0x58715d;_0x58b98b=_0x15c00f||[];var _0x4737d0=[];if(_0x15c00f){for(var _0x3338e0=0x0;_0x3338e0<_0x15c00f[_0x0b62('0x3c')];_0x3338e0+=0x1){var _0x4548ce=_0x15c00f[_0x3338e0][_0x0b62('0x28')]({'plain':!![]});_0x1a8b48=squel['insert']()[_0x0b62('0x6c')](_0x0b62('0x93'))[_0x0b62('0x6e')]([_0x0b62('0x71'),_0x0b62('0x74'),_0x0b62('0x7d'),_0x0b62('0x5e'),_0x0b62('0x57'),'updatedAt'],squel[_0x0b62('0x70')]()[_0x0b62('0x72')](_0x0b62('0x71'),_0x0b62('0x71'))[_0x0b62('0x72')]('id','ContactId')[_0x0b62('0x72')](_0x4548ce[_0x0b62('0x75')][_0x0b62('0x76')](),_0x0b62('0x7d'))[_0x0b62('0x72')](_0x4962f8[_0x0b62('0x4b')]['id'][_0x0b62('0x76')](),'CampaignId')[_0x0b62('0x72')](_0x0b62('0x73'),_0x0b62('0x57'))[_0x0b62('0x72')](_0x0b62('0x73'),_0x0b62('0x58'))[_0x0b62('0x77')](_0x0b62('0x7e'))['where']('deletedAt\x20IS\x20NULL')[_0x0b62('0x3f')]('ListId\x20=\x20?',_0x4548ce[_0x0b62('0x75')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0b62('0x76')]();_0x4737d0[_0x0b62('0x8b')](db[_0x0b62('0x8c')][_0x0b62('0x39')](_0x1a8b48));}return BPromise[_0x0b62('0x8d')](_0x4737d0);}})['then'](function(){return _0x58b98b;})[_0x0b62('0x26')](respondWithResult(_0x19f1da,null))[_0x0b62('0x49')](handleError(_0x19f1da,null));};exports['removeBlackLists']=function(_0x1a514c,_0x39f77f,_0x50bb03){return db['Campaign']['find']({'where':{'id':_0x1a514c['params']['id']}})[_0x0b62('0x26')](handleEntityNotFound(_0x39f77f,null))[_0x0b62('0x26')](function(_0x2431d6){if(_0x2431d6){return _0x2431d6[_0x0b62('0x94')](_0x1a514c[_0x0b62('0x39')]['ids']);}})[_0x0b62('0x26')](function(_0x5f008b){if(_0x5f008b){return db['CmHopperBlack'][_0x0b62('0x27')]({'where':{'ListId':_0x1a514c[_0x0b62('0x39')][_0x0b62('0x69')],'CampaignId':_0x1a514c['params']['id']}})[_0x0b62('0x26')](function(){return _0x5f008b;});}})[_0x0b62('0x26')](respondWithStatusCode(_0x39f77f,null))[_0x0b62('0x49')](handleError(_0x39f77f,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 1fe91cc..369dd76 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(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4016d4,_0x491c60){var _0x348a93=function(_0x2fad52){while(--_0x2fad52){_0x4016d4['push'](_0x4016d4['shift']());}};_0x348a93(++_0x491c60);}(_0x7a54,0x106));var _0x47a5=function(_0x1d61e1,_0x4b1227){_0x1d61e1=_0x1d61e1-0x0;var _0x5ba637=_0x7a54[_0x1d61e1];return _0x5ba637;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index c0bfede..ca85195 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 _0xb248=['code','message','catch','GetCampaign','findAll','options','raw','where','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x143005,_0x3e7089){var _0x506819=function(_0xc83cba){while(--_0xc83cba){_0x143005['push'](_0x143005['shift']());}};_0x506819(++_0x3e7089);}(_0xb248,0xc6));var _0x8b24=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xb248[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x8b24('0x0'));var util=require('util');var moment=require(_0x8b24('0x1'));var BPromise=require(_0x8b24('0x2'));var rs=require(_0x8b24('0x3'));var fs=require('fs');var Redis=require(_0x8b24('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b24('0x5'));var logger=require(_0x8b24('0x6'))('rpc');var config=require(_0x8b24('0x7'));var jayson=require(_0x8b24('0x8'));var client=jayson['client'][_0x8b24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4705e0,_0x588ca8,_0x3198a2){return new BPromise(function(_0x51bbad,_0x43b851){return client[_0x8b24('0xa')](_0x4705e0,_0x3198a2)[_0x8b24('0xb')](function(_0x4ad0db){logger[_0x8b24('0xc')](_0x8b24('0xd'),_0x588ca8,_0x8b24('0xe'));logger[_0x8b24('0xf')](_0x8b24('0x10'),_0x588ca8,_0x8b24('0xe'),JSON[_0x8b24('0x11')](_0x4ad0db));if(_0x4ad0db[_0x8b24('0x12')]){if(_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x13')]===0x1f4){logger[_0x8b24('0x12')](_0x8b24('0xd'),_0x588ca8,_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x14')]);return _0x43b851(_0x4ad0db['error']['message']);}logger[_0x8b24('0x12')](_0x8b24('0xd'),_0x588ca8,_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x14')]);return _0x51bbad(_0x4ad0db[_0x8b24('0x12')][_0x8b24('0x14')]);}else{logger[_0x8b24('0xc')](_0x8b24('0xd'),_0x588ca8,'request\x20sent');_0x51bbad(_0x4ad0db['result']['message']);}})[_0x8b24('0x15')](function(_0x523863){logger['error'](_0x8b24('0xd'),_0x588ca8,_0x523863);_0x43b851(_0x523863);});});}exports[_0x8b24('0x16')]=function(_0x527af7){var _0x1bafdf=this;return new Promise(function(_0x5e3c52,_0x3b4805){return db['Campaign'][_0x8b24('0x17')]({'raw':_0x527af7['options']?_0x527af7[_0x8b24('0x18')][_0x8b24('0x19')]===undefined?!![]:![]:!![],'where':_0x527af7[_0x8b24('0x18')]?_0x527af7[_0x8b24('0x18')][_0x8b24('0x1a')]||null:null,'attributes':_0x527af7[_0x8b24('0x18')]?_0x527af7[_0x8b24('0x18')]['attributes']||null:null,'limit':_0x527af7[_0x8b24('0x18')]?_0x527af7[_0x8b24('0x18')]['limit']||null:null,'include':_0x527af7[_0x8b24('0x18')]?_0x527af7[_0x8b24('0x18')][_0x8b24('0x1b')]?_[_0x8b24('0x1c')](_0x527af7[_0x8b24('0x18')][_0x8b24('0x1b')],function(_0x347591){return{'model':db[_0x347591[_0x8b24('0x1d')]],'as':_0x347591['as'],'attributes':_0x347591[_0x8b24('0x1e')],'include':_0x347591[_0x8b24('0x1b')]?_[_0x8b24('0x1c')](_0x347591[_0x8b24('0x1b')],function(_0x2cfb27){return{'model':db[_0x2cfb27[_0x8b24('0x1d')]],'as':_0x2cfb27['as'],'attributes':_0x2cfb27[_0x8b24('0x1e')],'include':_0x2cfb27[_0x8b24('0x1b')]?_[_0x8b24('0x1c')](_0x2cfb27[_0x8b24('0x1b')],function(_0x44ee85){return{'model':db[_0x44ee85[_0x8b24('0x1d')]],'as':_0x44ee85['as'],'attributes':_0x44ee85[_0x8b24('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8b24('0xb')](function(_0x2be377){logger[_0x8b24('0xc')](_0x8b24('0x16'),_0x527af7);logger[_0x8b24('0xf')](_0x8b24('0x16'),_0x527af7,JSON[_0x8b24('0x11')](_0x2be377));_0x5e3c52(_0x2be377);})['catch'](function(_0x36ff89){logger[_0x8b24('0x12')](_0x8b24('0x16'),_0x36ff89[_0x8b24('0x14')],_0x527af7);_0x3b4805(_0x1bafdf[_0x8b24('0x12')](0x1f4,_0x36ff89[_0x8b24('0x14')]));});});}; \ No newline at end of file +var _0xdecb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','findAll','options','raw','where','include','map','attributes','model','stringify','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x380a32,_0x4fcce6){var _0xe604ac=function(_0x2486ad){while(--_0x2486ad){_0x380a32['push'](_0x380a32['shift']());}};_0xe604ac(++_0x4fcce6);}(_0xdecb,0xe2));var _0xbdec=function(_0x42f523,_0x58bfe8){_0x42f523=_0x42f523-0x0;var _0x8f1b27=_0xdecb[_0x42f523];return _0x8f1b27;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var moment=require(_0xbdec('0x1'));var BPromise=require(_0xbdec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdec('0x4'));var logger=require(_0xbdec('0x5'))(_0xbdec('0x6'));var config=require(_0xbdec('0x7'));var jayson=require(_0xbdec('0x8'));var client=jayson[_0xbdec('0x9')][_0xbdec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x532f8e,_0x32d039,_0x22f7d4){return new BPromise(function(_0x2e8942,_0x298770){return client[_0xbdec('0xb')](_0x532f8e,_0x22f7d4)[_0xbdec('0xc')](function(_0x2333f6){logger[_0xbdec('0xd')]('Campaign,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));logger[_0xbdec('0xf')](_0xbdec('0x10'),_0x32d039,_0xbdec('0xe'),JSON['stringify'](_0x2333f6));if(_0x2333f6[_0xbdec('0x11')]){if(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x12')]===0x1f4){logger['error'](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x298770(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x2e8942(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}else{logger[_0xbdec('0xd')]('Campaign,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));_0x2e8942(_0x2333f6[_0xbdec('0x15')][_0xbdec('0x14')]);}})[_0xbdec('0x16')](function(_0x324378){logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x324378);_0x298770(_0x324378);});});}exports[_0xbdec('0x17')]=function(_0x2b9288){var _0x4f7879=this;return new Promise(function(_0x1206b8,_0x5da657){return db['Campaign'][_0xbdec('0x18')]({'raw':_0x2b9288[_0xbdec('0x19')]?_0x2b9288[_0xbdec('0x19')][_0xbdec('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b9288[_0xbdec('0x19')]?_0x2b9288['options'][_0xbdec('0x1b')]||null:null,'attributes':_0x2b9288['options']?_0x2b9288[_0xbdec('0x19')]['attributes']||null:null,'limit':_0x2b9288['options']?_0x2b9288[_0xbdec('0x19')]['limit']||null:null,'include':_0x2b9288[_0xbdec('0x19')]?_0x2b9288['options'][_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x2b9288[_0xbdec('0x19')][_0xbdec('0x1c')],function(_0x1a93e1){return{'model':db[_0x1a93e1['model']],'as':_0x1a93e1['as'],'attributes':_0x1a93e1[_0xbdec('0x1e')],'include':_0x1a93e1[_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x1a93e1[_0xbdec('0x1c')],function(_0x45eb56){return{'model':db[_0x45eb56[_0xbdec('0x1f')]],'as':_0x45eb56['as'],'attributes':_0x45eb56[_0xbdec('0x1e')],'include':_0x45eb56[_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x45eb56['include'],function(_0x5aae12){return{'model':db[_0x5aae12['model']],'as':_0x5aae12['as'],'attributes':_0x5aae12['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdec('0xc')](function(_0x3b67bc){logger[_0xbdec('0xd')](_0xbdec('0x17'),_0x2b9288);logger[_0xbdec('0xf')]('GetCampaign',_0x2b9288,JSON[_0xbdec('0x20')](_0x3b67bc));_0x1206b8(_0x3b67bc);})[_0xbdec('0x16')](function(_0x11c971){logger[_0xbdec('0x11')]('GetCampaign',_0x11c971[_0xbdec('0x14')],_0x2b9288);_0x5da657(_0x4f7879[_0xbdec('0x11')](0x1f4,_0x11c971[_0xbdec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 9dcb25c..b512e94 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 _0x2289=['../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','addLists','/:id/blacklists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3c8d85,_0x5ac779){var _0x537b59=function(_0x227b1d){while(--_0x227b1d){_0x3c8d85['push'](_0x3c8d85['shift']());}};_0x537b59(++_0x5ac779);}(_0x2289,0xc6));var _0x9228=function(_0x5ec334,_0x20923c){_0x5ec334=_0x5ec334-0x0;var _0x311347=_0x2289[_0x5ec334];return _0x311347;};'use strict';var multer=require(_0x9228('0x0'));var util=require(_0x9228('0x1'));var path=require(_0x9228('0x2'));var timeout=require('connect-timeout');var express=require(_0x9228('0x3'));var router=express[_0x9228('0x4')]();var fs_extra=require(_0x9228('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9228('0x6'));var config=require(_0x9228('0x7'));var controller=require(_0x9228('0x8'));router[_0x9228('0x9')]('/',auth[_0x9228('0xa')](),controller[_0x9228('0xb')]);router['get'](_0x9228('0xc'),auth['isAuthenticated'](),controller[_0x9228('0xd')]);router[_0x9228('0x9')](_0x9228('0xe'),auth[_0x9228('0xa')](),controller['getHoppers']);router[_0x9228('0x9')]('/:id/hopper_histories',auth[_0x9228('0xa')](),controller[_0x9228('0xf')]);router[_0x9228('0x9')](_0x9228('0x10'),auth[_0x9228('0xa')](),controller[_0x9228('0x11')]);router[_0x9228('0x9')](_0x9228('0x12'),auth[_0x9228('0xa')](),controller[_0x9228('0x13')]);router[_0x9228('0x9')](_0x9228('0x14'),auth[_0x9228('0xa')](),controller[_0x9228('0x15')]);router[_0x9228('0x9')]('/:id/blacklists',auth[_0x9228('0xa')](),controller[_0x9228('0x16')]);router['post']('/',auth[_0x9228('0xa')](),controller[_0x9228('0x17')]);router[_0x9228('0x18')]('/:id/clone',auth[_0x9228('0xa')](),controller['clone']);router[_0x9228('0x18')](_0x9228('0x14'),auth[_0x9228('0xa')](),controller[_0x9228('0x19')]);router[_0x9228('0x18')](_0x9228('0x1a'),auth['isAuthenticated'](),controller[_0x9228('0x1b')]);router[_0x9228('0x1c')](_0x9228('0xc'),auth[_0x9228('0xa')](),controller[_0x9228('0x1d')]);router[_0x9228('0x1e')](_0x9228('0xc'),auth[_0x9228('0xa')](),controller['destroy']);router[_0x9228('0x1e')](_0x9228('0x14'),auth['isAuthenticated'](),controller[_0x9228('0x1f')]);router['delete'](_0x9228('0x1a'),auth[_0x9228('0xa')](),controller[_0x9228('0x20')]);module[_0x9228('0x21')]=router; \ No newline at end of file +var _0x49a4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','create','clone','/:id/lists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','connect-timeout'];(function(_0x1f486b,_0x17e822){var _0x2c9fd0=function(_0x54a851){while(--_0x54a851){_0x1f486b['push'](_0x1f486b['shift']());}};_0x2c9fd0(++_0x17e822);}(_0x49a4,0x149));var _0x449a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x49a4[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x449a('0x0'));var express=require(_0x449a('0x1'));var router=express[_0x449a('0x2')]();var fs_extra=require(_0x449a('0x3'));var auth=require(_0x449a('0x4'));var interaction=require(_0x449a('0x5'));var config=require(_0x449a('0x6'));var controller=require(_0x449a('0x7'));router[_0x449a('0x8')]('/',auth[_0x449a('0x9')](),controller[_0x449a('0xa')]);router['get']('/:id',auth[_0x449a('0x9')](),controller[_0x449a('0xb')]);router[_0x449a('0x8')](_0x449a('0xc'),auth[_0x449a('0x9')](),controller['getHoppers']);router[_0x449a('0x8')](_0x449a('0xd'),auth['isAuthenticated'](),controller[_0x449a('0xe')]);router[_0x449a('0x8')]('/:id/hopper_finals',auth[_0x449a('0x9')](),controller[_0x449a('0xf')]);router[_0x449a('0x8')](_0x449a('0x10'),auth['isAuthenticated'](),controller[_0x449a('0x11')]);router['get']('/:id/lists',auth[_0x449a('0x9')](),controller[_0x449a('0x12')]);router[_0x449a('0x8')](_0x449a('0x13'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x449a('0x14')]('/',auth[_0x449a('0x9')](),controller[_0x449a('0x15')]);router['post']('/:id/clone',auth[_0x449a('0x9')](),controller[_0x449a('0x16')]);router[_0x449a('0x14')](_0x449a('0x17'),auth[_0x449a('0x9')](),controller['addLists']);router['post'](_0x449a('0x13'),auth[_0x449a('0x9')](),controller[_0x449a('0x18')]);router[_0x449a('0x19')](_0x449a('0x1a'),auth['isAuthenticated'](),controller[_0x449a('0x1b')]);router[_0x449a('0x1c')](_0x449a('0x1a'),auth[_0x449a('0x9')](),controller[_0x449a('0x1d')]);router[_0x449a('0x1c')](_0x449a('0x17'),auth[_0x449a('0x9')](),controller[_0x449a('0x1e')]);router[_0x449a('0x1c')](_0x449a('0x13'),auth[_0x449a('0x9')](),controller[_0x449a('0x1f')]);module[_0x449a('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9cd813a..292fd1e 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 _0x181e=['exports','STRING','TEXT','getDataValue','key','sequelize'];(function(_0x26fdb5,_0x47f4b9){var _0x5bc218=function(_0x24f05f){while(--_0x24f05f){_0x26fdb5['push'](_0x26fdb5['shift']());}};_0x5bc218(++_0x47f4b9);}(_0x181e,0x15b));var _0xe181=function(_0x21c80a,_0x275d41){_0x21c80a=_0x21c80a-0x0;var _0x4a7719=_0x181e[_0x21c80a];return _0x4a7719;};'use strict';var Sequelize=require(_0xe181('0x0'));module[_0xe181('0x1')]={'key':{'type':Sequelize[_0xe181('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe181('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe181('0x4')](_0xe181('0x5'));}}}; \ No newline at end of file +var _0x0925=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0xa0bee2,_0x9d4808){var _0x363d14=function(_0x2ecaba){while(--_0x2ecaba){_0xa0bee2['push'](_0xa0bee2['shift']());}};_0x363d14(++_0x9d4808);}(_0x0925,0x156));var _0x5092=function(_0x23bf66,_0x2f57be){_0x23bf66=_0x23bf66-0x0;var _0xbf7653=_0x0925[_0x23bf66];return _0xbf7653;};'use strict';var Sequelize=require(_0x5092('0x0'));module[_0x5092('0x1')]={'key':{'type':Sequelize[_0x5092('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x5092('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x5092('0x2')]},'name':{'type':Sequelize[_0x5092('0x4')],'get':function(){return this[_0x5092('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9f9ce69..1a430ae 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 _0x21f9=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','CannedAnswers','error','name','index','map','rawAttributes','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','rows','catch','show','params','intersection','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x21f9,0x156));var _0x921f=function(_0x5ad123,_0x5dfcc2){_0x5ad123=_0x5ad123-0x0;var _0x458259=_0x21f9[_0x5ad123];return _0x458259;};'use strict';var emlformat=require(_0x921f('0x0'));var rimraf=require(_0x921f('0x1'));var zipdir=require(_0x921f('0x2'));var jsonpatch=require(_0x921f('0x3'));var rp=require(_0x921f('0x4'));var moment=require('moment');var BPromise=require(_0x921f('0x5'));var Mustache=require('mustache');var util=require(_0x921f('0x6'));var path=require(_0x921f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x921f('0x8'));var fs=require('fs');var fs_extra=require(_0x921f('0x9'));var _=require(_0x921f('0xa'));var squel=require(_0x921f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x921f('0xc'));var toCsv=require(_0x921f('0xd'));var querystring=require(_0x921f('0xe'));var Papa=require(_0x921f('0xf'));var Redis=require(_0x921f('0x10'));var authService=require(_0x921f('0x11'));var qs=require(_0x921f('0x12'));var as=require(_0x921f('0x13'));var hardwareService=require(_0x921f('0x14'));var logger=require('../../config/logger')(_0x921f('0x15'));var utils=require('../../config/utils');var config=require(_0x921f('0x16'));var licenseUtil=require(_0x921f('0x17'));var db=require(_0x921f('0x18'))['db'];function respondWithStatusCode(_0x765a59,_0x32bf36){_0x32bf36=_0x32bf36||0xcc;return function(_0x2709ff){if(_0x2709ff){return _0x765a59['sendStatus'](_0x32bf36);}return _0x765a59[_0x921f('0x19')](_0x32bf36)[_0x921f('0x1a')]();};}function respondWithResult(_0x138bd6,_0x355807){_0x355807=_0x355807||0xc8;return function(_0x24c956){if(_0x24c956){return _0x138bd6[_0x921f('0x19')](_0x355807)[_0x921f('0x1b')](_0x24c956);}};}function respondWithFilteredResult(_0x2c9e4e,_0x4db7fa){return function(_0x4be4bf){if(_0x4be4bf){var _0x96f673=typeof _0x4db7fa[_0x921f('0x1c')]===_0x921f('0x1d')&&typeof _0x4db7fa[_0x921f('0x1e')]===_0x921f('0x1d');var _0x310528=_0x4be4bf[_0x921f('0x1f')];var _0x23187b=_0x96f673?0x0:_0x4db7fa[_0x921f('0x1c')];var _0x56c500=_0x96f673?_0x4be4bf[_0x921f('0x1f')]:_0x4db7fa[_0x921f('0x1c')]+_0x4db7fa[_0x921f('0x1e')];var _0x3f2bd5;if(_0x56c500>=_0x310528){_0x56c500=_0x310528;_0x3f2bd5=0xc8;}else{_0x3f2bd5=0xce;}_0x2c9e4e[_0x921f('0x19')](_0x3f2bd5);return _0x2c9e4e['set'](_0x921f('0x20'),_0x23187b+'-'+_0x56c500+'/'+_0x310528)[_0x921f('0x1b')](_0x4be4bf);}return null;};}function patchUpdates(_0xfed74f){return function(_0x4fd384){try{jsonpatch['apply'](_0x4fd384,_0xfed74f,!![]);}catch(_0x2f326a){return BPromise[_0x921f('0x21')](_0x2f326a);}return _0x4fd384[_0x921f('0x22')]();};}function saveUpdates(_0x4d29dd,_0x3aa93c){return function(_0x24a1c1){if(_0x24a1c1){return _0x24a1c1[_0x921f('0x23')](_0x4d29dd)['then'](function(_0x8c3cf6){return _0x8c3cf6;});}return null;};}function removeEntity(_0xf50289,_0x446202){return function(_0xe663d7){if(_0xe663d7){return _0xe663d7[_0x921f('0x24')]()[_0x921f('0x25')](function(){var _0x170f79=_0xe663d7[_0x921f('0x26')]({'plain':!![]});var _0x493c1a=_0x921f('0x27');return db['UserProfileResource'][_0x921f('0x24')]({'where':{'type':_0x493c1a,'resourceId':_0x170f79['id']}})[_0x921f('0x25')](function(){return _0xe663d7;});})[_0x921f('0x25')](function(){_0xf50289['status'](0xcc)[_0x921f('0x1a')]();});}};}function handleEntityNotFound(_0xce0a4d,_0xd63e9d){return function(_0x3abfc8){if(!_0x3abfc8){_0xce0a4d['sendStatus'](0x194);}return _0x3abfc8;};}function handleError(_0x2dcd4d,_0x502d1f){_0x502d1f=_0x502d1f||0x1f4;return function(_0x14f354){logger[_0x921f('0x28')](_0x14f354['stack']);if(_0x14f354[_0x921f('0x29')]){delete _0x14f354[_0x921f('0x29')];}_0x2dcd4d[_0x921f('0x19')](_0x502d1f)['send'](_0x14f354);};}exports[_0x921f('0x2a')]=function(_0x5399cf,_0x1279dc){var _0x5725aa={},_0x471dad={},_0x504f0a={'count':0x0,'rows':[]};var _0x4c67be=_[_0x921f('0x2b')](db['CannedAnswer'][_0x921f('0x2c')],function(_0x2c95de){return{'name':_0x2c95de['fieldName'],'type':_0x2c95de[_0x921f('0x2d')][_0x921f('0x2e')]};});_0x471dad['model']=_[_0x921f('0x2b')](_0x4c67be,'name');_0x471dad[_0x921f('0x2f')]=_[_0x921f('0x30')](_0x5399cf[_0x921f('0x2f')]);_0x471dad[_0x921f('0x31')]=_['intersection'](_0x471dad[_0x921f('0x32')],_0x471dad[_0x921f('0x2f')]);_0x5725aa['attributes']=_['intersection'](_0x471dad[_0x921f('0x32')],qs[_0x921f('0x33')](_0x5399cf[_0x921f('0x2f')][_0x921f('0x33')]));_0x5725aa[_0x921f('0x34')]=_0x5725aa[_0x921f('0x34')][_0x921f('0x35')]?_0x5725aa['attributes']:_0x471dad[_0x921f('0x32')];if(!_0x5399cf['query'][_0x921f('0x36')](_0x921f('0x37'))){_0x5725aa[_0x921f('0x1e')]=qs['limit'](_0x5399cf[_0x921f('0x2f')][_0x921f('0x1e')]);_0x5725aa[_0x921f('0x1c')]=qs[_0x921f('0x1c')](_0x5399cf['query']['offset']);}_0x5725aa['order']=qs[_0x921f('0x38')](_0x5399cf['query'][_0x921f('0x38')]);_0x5725aa[_0x921f('0x39')]=qs[_0x921f('0x31')](_[_0x921f('0x3a')](_0x5399cf[_0x921f('0x2f')],_0x471dad['filters']),_0x4c67be);if(_0x5399cf['query'][_0x921f('0x3b')]){_0x5725aa['where']=_[_0x921f('0x3c')](_0x5725aa[_0x921f('0x39')],{'$or':[{'key':{'$like':'%'+_0x5399cf[_0x921f('0x2f')][_0x921f('0x3b')]+'%'}},{'value':{'$like':'%'+_0x5399cf[_0x921f('0x2f')][_0x921f('0x3b')]+'%'}}]});}_0x5725aa=_[_0x921f('0x3c')]({},_0x5725aa,_0x5399cf[_0x921f('0x3d')]);var _0x877741={'where':_0x5725aa[_0x921f('0x39')]};return db[_0x921f('0x3e')][_0x921f('0x1f')](_0x877741)['then'](function(_0x423f37){_0x504f0a[_0x921f('0x1f')]=_0x423f37;if(_0x5399cf[_0x921f('0x2f')][_0x921f('0x3f')]){_0x5725aa[_0x921f('0x40')]=[{'all':!![]}];}return db[_0x921f('0x3e')]['findAll'](_0x5725aa);})[_0x921f('0x25')](function(_0x537ec9){_0x504f0a[_0x921f('0x41')]=_0x537ec9;return _0x504f0a;})['then'](respondWithFilteredResult(_0x1279dc,_0x5725aa))[_0x921f('0x42')](handleError(_0x1279dc,null));};exports[_0x921f('0x43')]=function(_0x14778c,_0x1e5ed2){var _0x2f222e={'raw':!![],'where':{'id':_0x14778c[_0x921f('0x44')]['id']}},_0x560efd={};_0x560efd[_0x921f('0x32')]=_[_0x921f('0x30')](db[_0x921f('0x3e')][_0x921f('0x2c')]);_0x560efd['query']=_[_0x921f('0x30')](_0x14778c[_0x921f('0x2f')]);_0x560efd['filters']=_[_0x921f('0x45')](_0x560efd['model'],_0x560efd['query']);_0x2f222e[_0x921f('0x34')]=_[_0x921f('0x45')](_0x560efd[_0x921f('0x32')],qs[_0x921f('0x33')](_0x14778c[_0x921f('0x2f')][_0x921f('0x33')]));_0x2f222e[_0x921f('0x34')]=_0x2f222e[_0x921f('0x34')][_0x921f('0x35')]?_0x2f222e[_0x921f('0x34')]:_0x560efd['model'];if(_0x14778c[_0x921f('0x2f')][_0x921f('0x3f')]){_0x2f222e['include']=[{'all':!![]}];}_0x2f222e=_[_0x921f('0x3c')]({},_0x2f222e,_0x14778c[_0x921f('0x3d')]);return db['CannedAnswer']['find'](_0x2f222e)[_0x921f('0x25')](handleEntityNotFound(_0x1e5ed2,null))[_0x921f('0x25')](respondWithResult(_0x1e5ed2,null))['catch'](handleError(_0x1e5ed2,null));};exports[_0x921f('0x23')]=function(_0xef96fd,_0xdcfa29){if(_0xef96fd[_0x921f('0x46')]['id']){delete _0xef96fd['body']['id'];}return db[_0x921f('0x3e')][_0x921f('0x47')]({'where':{'id':_0xef96fd[_0x921f('0x44')]['id']}})[_0x921f('0x25')](handleEntityNotFound(_0xdcfa29,null))[_0x921f('0x25')](saveUpdates(_0xef96fd[_0x921f('0x46')],null))['then'](respondWithResult(_0xdcfa29,null))[_0x921f('0x42')](handleError(_0xdcfa29,null));};exports[_0x921f('0x24')]=function(_0x3c52d2,_0x4da55c){return db[_0x921f('0x3e')][_0x921f('0x47')]({'where':{'id':_0x3c52d2[_0x921f('0x44')]['id']}})[_0x921f('0x25')](handleEntityNotFound(_0x4da55c,null))['then'](removeEntity(_0x4da55c,null))[_0x921f('0x42')](handleError(_0x4da55c,null));};exports[_0x921f('0x48')]=function(_0x218a87,_0x97b939){var _0x3d0b94={'key':_0x218a87['body'][_0x921f('0x2e')]};if(_0x218a87[_0x921f('0x46')][_0x921f('0x49')]){_0x3d0b94[_0x921f('0x49')]=_0x218a87['body'][_0x921f('0x49')];}else if(_0x218a87['body'][_0x921f('0x4a')]){_0x3d0b94[_0x921f('0x4a')]=_0x218a87['body'][_0x921f('0x4a')];}else if(_0x218a87[_0x921f('0x46')]['OpenchannelAccountId']){_0x3d0b94[_0x921f('0x4b')]=_0x218a87[_0x921f('0x46')][_0x921f('0x4b')];}else if(_0x218a87['body'][_0x921f('0x4c')]){_0x3d0b94[_0x921f('0x4c')]=_0x218a87['body'][_0x921f('0x4c')];}return db[_0x921f('0x3e')][_0x921f('0x47')]({'where':_0x3d0b94})['then'](function(_0x234d21){if(_0x234d21){throw new db[(_0x921f('0x4d'))]['ValidationError'](_0x921f('0x4e'));}return db[_0x921f('0x3e')][_0x921f('0x48')](_0x218a87['body']);})[_0x921f('0x25')](function(_0x4c701c){var _0x12cd86=_0x218a87[_0x921f('0x4f')]['get']({'plain':!![]});if(!_0x12cd86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12cd86[_0x921f('0x50')]===_0x921f('0x4f')){var _0x1e569b=_0x4c701c['get']({'plain':!![]});return db[_0x921f('0x51')][_0x921f('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x12cd86[_0x921f('0x52')]},'raw':!![]})[_0x921f('0x25')](function(_0x37982b){if(_0x37982b&&_0x37982b[_0x921f('0x53')]===0x0){return db[_0x921f('0x54')][_0x921f('0x48')]({'name':_0x1e569b[_0x921f('0x29')],'resourceId':_0x1e569b['id'],'type':_0x37982b[_0x921f('0x29')],'sectionId':_0x37982b['id']},{})[_0x921f('0x25')](function(){return _0x4c701c;});}else{return _0x4c701c;}})[_0x921f('0x42')](function(_0x43be08){logger[_0x921f('0x28')](_0x921f('0x55'),_0x43be08);throw _0x43be08;});}return _0x4c701c;})['then'](respondWithResult(_0x97b939,0xc9))[_0x921f('0x42')](handleError(_0x97b939,null));}; \ No newline at end of file +var _0xdd7d=['sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','CannedAnswer','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xc23a89,_0x25710e){var _0x420c08=function(_0x38957e){while(--_0x38957e){_0xc23a89['push'](_0xc23a89['shift']());}};_0x420c08(++_0x25710e);}(_0xdd7d,0x8e));var _0xddd7=function(_0x45becd,_0x36b127){_0x45becd=_0x45becd-0x0;var _0x9a860f=_0xdd7d[_0x45becd];return _0x9a860f;};'use strict';var emlformat=require(_0xddd7('0x0'));var rimraf=require(_0xddd7('0x1'));var zipdir=require(_0xddd7('0x2'));var jsonpatch=require(_0xddd7('0x3'));var rp=require(_0xddd7('0x4'));var moment=require('moment');var BPromise=require(_0xddd7('0x5'));var Mustache=require(_0xddd7('0x6'));var util=require(_0xddd7('0x7'));var path=require(_0xddd7('0x8'));var sox=require(_0xddd7('0x9'));var csv=require('to-csv');var ejs=require(_0xddd7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddd7('0xb'));var squel=require('squel');var crypto=require(_0xddd7('0xc'));var jsforce=require(_0xddd7('0xd'));var deskjs=require(_0xddd7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddd7('0xf'));var Redis=require(_0xddd7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xddd7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddd7('0x12'));var logger=require(_0xddd7('0x13'))(_0xddd7('0x14'));var utils=require(_0xddd7('0x15'));var config=require(_0xddd7('0x16'));var licenseUtil=require(_0xddd7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43b746,_0x3994b7){_0x3994b7=_0x3994b7||0xcc;return function(_0x10c096){if(_0x10c096){return _0x43b746[_0xddd7('0x18')](_0x3994b7);}return _0x43b746[_0xddd7('0x19')](_0x3994b7)['end']();};}function respondWithResult(_0x592449,_0x49b17e){_0x49b17e=_0x49b17e||0xc8;return function(_0x307b97){if(_0x307b97){return _0x592449[_0xddd7('0x19')](_0x49b17e)[_0xddd7('0x1a')](_0x307b97);}};}function respondWithFilteredResult(_0x308153,_0x40f7e1){return function(_0x169735){if(_0x169735){var _0xa65077=typeof _0x40f7e1['offset']==='undefined'&&typeof _0x40f7e1[_0xddd7('0x1b')]===_0xddd7('0x1c');var _0x348277=_0x169735[_0xddd7('0x1d')];var _0x24cf18=_0xa65077?0x0:_0x40f7e1[_0xddd7('0x1e')];var _0x3be78b=_0xa65077?_0x169735[_0xddd7('0x1d')]:_0x40f7e1[_0xddd7('0x1e')]+_0x40f7e1[_0xddd7('0x1b')];var _0xf01d0b;if(_0x3be78b>=_0x348277){_0x3be78b=_0x348277;_0xf01d0b=0xc8;}else{_0xf01d0b=0xce;}_0x308153[_0xddd7('0x19')](_0xf01d0b);return _0x308153[_0xddd7('0x1f')](_0xddd7('0x20'),_0x24cf18+'-'+_0x3be78b+'/'+_0x348277)[_0xddd7('0x1a')](_0x169735);}return null;};}function patchUpdates(_0x55c8ad){return function(_0x1662a1){try{jsonpatch[_0xddd7('0x21')](_0x1662a1,_0x55c8ad,!![]);}catch(_0x370b2f){return BPromise['reject'](_0x370b2f);}return _0x1662a1[_0xddd7('0x22')]();};}function saveUpdates(_0x4b9ece,_0xa161){return function(_0x3e9a57){if(_0x3e9a57){return _0x3e9a57[_0xddd7('0x23')](_0x4b9ece)['then'](function(_0x3de73d){return _0x3de73d;});}return null;};}function removeEntity(_0x257d4c,_0x13e12a){return function(_0x3ea1e8){if(_0x3ea1e8){return _0x3ea1e8[_0xddd7('0x24')]()[_0xddd7('0x25')](function(){var _0x23a1ef=_0x3ea1e8[_0xddd7('0x26')]({'plain':!![]});var _0x4e4a9c='CannedAnswers';return db[_0xddd7('0x27')][_0xddd7('0x24')]({'where':{'type':_0x4e4a9c,'resourceId':_0x23a1ef['id']}})[_0xddd7('0x25')](function(){return _0x3ea1e8;});})['then'](function(){_0x257d4c[_0xddd7('0x19')](0xcc)[_0xddd7('0x28')]();});}};}function handleEntityNotFound(_0x39c9c8,_0x1a4a5f){return function(_0x2cbede){if(!_0x2cbede){_0x39c9c8[_0xddd7('0x18')](0x194);}return _0x2cbede;};}function handleError(_0x369556,_0x36324b){_0x36324b=_0x36324b||0x1f4;return function(_0x34578d){logger[_0xddd7('0x29')](_0x34578d[_0xddd7('0x2a')]);if(_0x34578d['name']){delete _0x34578d[_0xddd7('0x2b')];}_0x369556[_0xddd7('0x19')](_0x36324b)[_0xddd7('0x2c')](_0x34578d);};}exports[_0xddd7('0x2d')]=function(_0x35c748,_0x54e19b){var _0x332442={},_0x1a5c50={},_0x11be84={'count':0x0,'rows':[]};var _0x466a79=_['map'](db[_0xddd7('0x2e')]['rawAttributes'],function(_0x1d7a4c){return{'name':_0x1d7a4c['fieldName'],'type':_0x1d7a4c[_0xddd7('0x2f')][_0xddd7('0x30')]};});_0x1a5c50[_0xddd7('0x31')]=_[_0xddd7('0x32')](_0x466a79,_0xddd7('0x2b'));_0x1a5c50[_0xddd7('0x33')]=_[_0xddd7('0x34')](_0x35c748[_0xddd7('0x33')]);_0x1a5c50[_0xddd7('0x35')]=_[_0xddd7('0x36')](_0x1a5c50[_0xddd7('0x31')],_0x1a5c50[_0xddd7('0x33')]);_0x332442['attributes']=_[_0xddd7('0x36')](_0x1a5c50[_0xddd7('0x31')],qs['fields'](_0x35c748[_0xddd7('0x33')][_0xddd7('0x37')]));_0x332442[_0xddd7('0x38')]=_0x332442[_0xddd7('0x38')][_0xddd7('0x39')]?_0x332442[_0xddd7('0x38')]:_0x1a5c50[_0xddd7('0x31')];if(!_0x35c748[_0xddd7('0x33')]['hasOwnProperty'](_0xddd7('0x3a'))){_0x332442[_0xddd7('0x1b')]=qs['limit'](_0x35c748[_0xddd7('0x33')][_0xddd7('0x1b')]);_0x332442['offset']=qs['offset'](_0x35c748[_0xddd7('0x33')]['offset']);}_0x332442[_0xddd7('0x3b')]=qs[_0xddd7('0x3c')](_0x35c748[_0xddd7('0x33')][_0xddd7('0x3c')]);_0x332442[_0xddd7('0x3d')]=qs[_0xddd7('0x35')](_[_0xddd7('0x3e')](_0x35c748[_0xddd7('0x33')],_0x1a5c50['filters']),_0x466a79);if(_0x35c748[_0xddd7('0x33')][_0xddd7('0x3f')]){_0x332442['where']=_[_0xddd7('0x40')](_0x332442[_0xddd7('0x3d')],{'$or':[{'key':{'$like':'%'+_0x35c748['query']['filter']+'%'}},{'value':{'$like':'%'+_0x35c748[_0xddd7('0x33')][_0xddd7('0x3f')]+'%'}}]});}_0x332442=_[_0xddd7('0x40')]({},_0x332442,_0x35c748['options']);var _0x25aa42={'where':_0x332442[_0xddd7('0x3d')]};return db['CannedAnswer'][_0xddd7('0x1d')](_0x25aa42)[_0xddd7('0x25')](function(_0x5c3db6){_0x11be84[_0xddd7('0x1d')]=_0x5c3db6;if(_0x35c748[_0xddd7('0x33')][_0xddd7('0x41')]){_0x332442['include']=[{'all':!![]}];}return db[_0xddd7('0x2e')][_0xddd7('0x42')](_0x332442);})[_0xddd7('0x25')](function(_0x97b7f0){_0x11be84['rows']=_0x97b7f0;return _0x11be84;})[_0xddd7('0x25')](respondWithFilteredResult(_0x54e19b,_0x332442))[_0xddd7('0x43')](handleError(_0x54e19b,null));};exports[_0xddd7('0x44')]=function(_0x245e98,_0x2a9828){var _0x3bafdd={'raw':!![],'where':{'id':_0x245e98[_0xddd7('0x45')]['id']}},_0x52b8a4={};_0x52b8a4[_0xddd7('0x31')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x52b8a4[_0xddd7('0x33')]=_[_0xddd7('0x34')](_0x245e98[_0xddd7('0x33')]);_0x52b8a4[_0xddd7('0x35')]=_[_0xddd7('0x36')](_0x52b8a4[_0xddd7('0x31')],_0x52b8a4[_0xddd7('0x33')]);_0x3bafdd[_0xddd7('0x38')]=_[_0xddd7('0x36')](_0x52b8a4['model'],qs[_0xddd7('0x37')](_0x245e98[_0xddd7('0x33')]['fields']));_0x3bafdd['attributes']=_0x3bafdd[_0xddd7('0x38')]['length']?_0x3bafdd['attributes']:_0x52b8a4[_0xddd7('0x31')];if(_0x245e98[_0xddd7('0x33')][_0xddd7('0x41')]){_0x3bafdd[_0xddd7('0x46')]=[{'all':!![]}];}_0x3bafdd=_[_0xddd7('0x40')]({},_0x3bafdd,_0x245e98['options']);return db['CannedAnswer'][_0xddd7('0x47')](_0x3bafdd)[_0xddd7('0x25')](handleEntityNotFound(_0x2a9828,null))['then'](respondWithResult(_0x2a9828,null))['catch'](handleError(_0x2a9828,null));};exports['update']=function(_0x28aa1e,_0x9b7499){if(_0x28aa1e['body']['id']){delete _0x28aa1e[_0xddd7('0x48')]['id'];}return db[_0xddd7('0x2e')][_0xddd7('0x47')]({'where':{'id':_0x28aa1e[_0xddd7('0x45')]['id']}})['then'](handleEntityNotFound(_0x9b7499,null))['then'](saveUpdates(_0x28aa1e[_0xddd7('0x48')],null))[_0xddd7('0x25')](respondWithResult(_0x9b7499,null))[_0xddd7('0x43')](handleError(_0x9b7499,null));};exports[_0xddd7('0x24')]=function(_0x1083b8,_0x33fd8b){return db[_0xddd7('0x2e')]['find']({'where':{'id':_0x1083b8[_0xddd7('0x45')]['id']}})[_0xddd7('0x25')](handleEntityNotFound(_0x33fd8b,null))[_0xddd7('0x25')](removeEntity(_0x33fd8b,null))[_0xddd7('0x43')](handleError(_0x33fd8b,null));};exports[_0xddd7('0x49')]=function(_0x3e250b,_0x56b3a1){var _0x18e29c={'key':_0x3e250b['body']['key']};if(_0x3e250b[_0xddd7('0x48')]['MailAccountId']){_0x18e29c[_0xddd7('0x4a')]=_0x3e250b[_0xddd7('0x48')][_0xddd7('0x4a')];}else if(_0x3e250b[_0xddd7('0x48')]['SmsAccountId']){_0x18e29c[_0xddd7('0x4b')]=_0x3e250b['body']['SmsAccountId'];}else if(_0x3e250b[_0xddd7('0x48')][_0xddd7('0x4c')]){_0x18e29c['OpenchannelAccountId']=_0x3e250b[_0xddd7('0x48')][_0xddd7('0x4c')];}else if(_0x3e250b[_0xddd7('0x48')][_0xddd7('0x4d')]){_0x18e29c[_0xddd7('0x4d')]=_0x3e250b[_0xddd7('0x48')][_0xddd7('0x4d')];}return db['CannedAnswer']['find']({'where':_0x18e29c})['then'](function(_0x54590d){if(_0x54590d){throw new db[(_0xddd7('0x4e'))][(_0xddd7('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xddd7('0x2e')][_0xddd7('0x49')](_0x3e250b[_0xddd7('0x48')]);})[_0xddd7('0x25')](function(_0x4b652a){var _0x5b8ceb=_0x3e250b['user'][_0xddd7('0x26')]({'plain':!![]});if(!_0x5b8ceb)throw new Error(_0xddd7('0x50'));if(_0x5b8ceb[_0xddd7('0x51')]==='user'){var _0x293e40=_0x4b652a['get']({'plain':!![]});return db['UserProfileSection'][_0xddd7('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x5b8ceb['userProfileId']},'raw':!![]})[_0xddd7('0x25')](function(_0xed8c4d){if(_0xed8c4d&&_0xed8c4d['autoAssociation']===0x0){return db[_0xddd7('0x27')][_0xddd7('0x49')]({'name':_0x293e40[_0xddd7('0x2b')],'resourceId':_0x293e40['id'],'type':_0xed8c4d['name'],'sectionId':_0xed8c4d['id']},{})[_0xddd7('0x25')](function(){return _0x4b652a;});}else{return _0x4b652a;}})[_0xddd7('0x43')](function(_0xf67e21){logger[_0xddd7('0x29')](_0xddd7('0x52'),_0xf67e21);throw _0xf67e21;});}return _0x4b652a;})[_0xddd7('0x25')](respondWithResult(_0x56b3a1,0xc9))[_0xddd7('0x43')](handleError(_0x56b3a1,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 7532f96..a12700a 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 _0xbe49=['api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0xbe49,0x1b7));var _0x9be4=function(_0x3fe315,_0x264ed4){_0x3fe315=_0x3fe315-0x0;var _0x2157cc=_0xbe49[_0x3fe315];return _0x2157cc;};'use strict';var _=require(_0x9be4('0x0'));var util=require(_0x9be4('0x1'));var logger=require(_0x9be4('0x2'))(_0x9be4('0x3'));var moment=require(_0x9be4('0x4'));var BPromise=require('bluebird');var rp=require(_0x9be4('0x5'));var fs=require('fs');var path=require(_0x9be4('0x6'));var rimraf=require(_0x9be4('0x7'));var config=require('../../config/environment');var attributes=require(_0x9be4('0x8'));module[_0x9be4('0x9')]=function(_0x1e536a,_0x8d453c){return _0x1e536a[_0x9be4('0xa')](_0x9be4('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9be4('0xc')});}; \ No newline at end of file +var _0x82b0=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x252202,_0x402764){var _0x1fd513=function(_0x4bc102){while(--_0x4bc102){_0x252202['push'](_0x252202['shift']());}};_0x1fd513(++_0x402764);}(_0x82b0,0x1f2));var _0x082b=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x82b0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x082b('0x0'));var util=require(_0x082b('0x1'));var logger=require(_0x082b('0x2'))(_0x082b('0x3'));var moment=require(_0x082b('0x4'));var BPromise=require(_0x082b('0x5'));var rp=require(_0x082b('0x6'));var fs=require('fs');var path=require(_0x082b('0x7'));var rimraf=require('rimraf');var config=require(_0x082b('0x8'));var attributes=require(_0x082b('0x9'));module[_0x082b('0xa')]=function(_0x487fa9,_0x45ddbe){return _0x487fa9['define'](_0x082b('0xb'),attributes,{'tableName':_0x082b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x082b('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index e8ab9d5..2c9ce28 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(_0x152cb6,_0x57999f){var _0x21fd03=function(_0x4ec7c1){while(--_0x4ec7c1){_0x152cb6['push'](_0x152cb6['shift']());}};_0x21fd03(++_0x57999f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x22fdca,_0x2fdd3c){var _0x323075=function(_0x5d881d){while(--_0x5d881d){_0x22fdca['push'](_0x22fdca['shift']());}};_0x323075(++_0x2fdd3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 cba17e6..cc24606 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 _0xaf70=['/:id','post','create','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0xaf70,0x73));var _0x0af7=function(_0x2be97e,_0x13c169){_0x2be97e=_0x2be97e-0x0;var _0x2cfda4=_0xaf70[_0x2be97e];return _0x2cfda4;};'use strict';var multer=require('multer');var util=require(_0x0af7('0x0'));var path=require(_0x0af7('0x1'));var timeout=require('connect-timeout');var express=require(_0x0af7('0x2'));var router=express['Router']();var fs_extra=require(_0x0af7('0x3'));var auth=require(_0x0af7('0x4'));var interaction=require(_0x0af7('0x5'));var config=require(_0x0af7('0x6'));var controller=require(_0x0af7('0x7'));router['get']('/',auth[_0x0af7('0x8')](),controller[_0x0af7('0x9')]);router[_0x0af7('0xa')](_0x0af7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0af7('0xc')]('/',auth[_0x0af7('0x8')](),controller[_0x0af7('0xd')]);router[_0x0af7('0xe')](_0x0af7('0xb'),auth['isAuthenticated'](),controller[_0x0af7('0xf')]);router['delete'](_0x0af7('0xb'),auth[_0x0af7('0x8')](),controller[_0x0af7('0x10')]);module[_0x0af7('0x11')]=router; \ No newline at end of file +var _0xa455=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x591cc4,_0x39bd3c){var _0x1ed7f5=function(_0x653310){while(--_0x653310){_0x591cc4['push'](_0x591cc4['shift']());}};_0x1ed7f5(++_0x39bd3c);}(_0xa455,0x193));var _0x5a45=function(_0x1ad9ed,_0x3cd661){_0x1ad9ed=_0x1ad9ed-0x0;var _0x5a3a4d=_0xa455[_0x1ad9ed];return _0x5a3a4d;};'use strict';var multer=require('multer');var util=require(_0x5a45('0x0'));var path=require(_0x5a45('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a45('0x2'));var router=express[_0x5a45('0x3')]();var fs_extra=require(_0x5a45('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5a45('0x5'));var config=require(_0x5a45('0x6'));var controller=require(_0x5a45('0x7'));router[_0x5a45('0x8')]('/',auth[_0x5a45('0x9')](),controller[_0x5a45('0xa')]);router['get']('/:id',auth[_0x5a45('0x9')](),controller['show']);router[_0x5a45('0xb')]('/',auth[_0x5a45('0x9')](),controller['create']);router[_0x5a45('0xc')]('/:id',auth[_0x5a45('0x9')](),controller[_0x5a45('0xd')]);router[_0x5a45('0xe')]('/:id',auth[_0x5a45('0x9')](),controller[_0x5a45('0xf')]);module[_0x5a45('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index ca23153..cec7227 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 _0xab26=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x157733,_0x3ed3a1){var _0x20be2c=function(_0x3aede4){while(--_0x3aede4){_0x157733['push'](_0x157733['shift']());}};_0x20be2c(++_0x3ed3a1);}(_0xab26,0xd2));var _0x6ab2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xab26[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6ab2('0x0'));module[_0x6ab2('0x1')]={'calldate':{'type':Sequelize[_0x6ab2('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x6ab2('0x3')]},'src':{'type':Sequelize[_0x6ab2('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6ab2('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x6ab2('0x3')]},'lastdata':{'type':Sequelize[_0x6ab2('0x3')]},'duration':{'type':Sequelize[_0x6ab2('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6ab2('0x3')]},'amaflags':{'type':Sequelize[_0x6ab2('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6ab2('0x3')]},'uniqueid':{'type':Sequelize[_0x6ab2('0x3')]},'linkedid':{'type':Sequelize[_0x6ab2('0x3')]},'sequence':{'type':Sequelize[_0x6ab2('0x3')]},'peeraccount':{'type':Sequelize[_0x6ab2('0x3')]},'type':{'type':Sequelize[_0x6ab2('0x3')]},'tag':{'type':Sequelize[_0x6ab2('0x3')]}}; \ No newline at end of file +var _0xd976=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0xad6694,_0x596586){var _0x47fb2d=function(_0x45feba){while(--_0x45feba){_0xad6694['push'](_0xad6694['shift']());}};_0x47fb2d(++_0x596586);}(_0xd976,0x12f));var _0x6d97=function(_0x5b6aad,_0x3d2d66){_0x5b6aad=_0x5b6aad-0x0;var _0x288128=_0xd976[_0x5b6aad];return _0x288128;};'use strict';var Sequelize=require(_0x6d97('0x0'));module[_0x6d97('0x1')]={'calldate':{'type':Sequelize[_0x6d97('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x6d97('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x6d97('0x3')]},'channel':{'type':Sequelize[_0x6d97('0x3')]},'dstchannel':{'type':Sequelize[_0x6d97('0x3')]},'lastapp':{'type':Sequelize[_0x6d97('0x3')]},'lastdata':{'type':Sequelize[_0x6d97('0x3')]},'duration':{'type':Sequelize[_0x6d97('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6d97('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6d97('0x3')]},'amaflags':{'type':Sequelize[_0x6d97('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6d97('0x3')]},'userfield':{'type':Sequelize[_0x6d97('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x6d97('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x6d97('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x6d97('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 1584994..a34d2da 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 _0xf2ca=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x34c2ef,_0x5984d5){var _0x349d58=function(_0x1bff22){while(--_0x1bff22){_0x34c2ef['push'](_0x34c2ef['shift']());}};_0x349d58(++_0x5984d5);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xcb6d2b,_0x1a56ac){_0xcb6d2b=_0xcb6d2b-0x0;var _0x2c3687=_0xf2ca[_0xcb6d2b];return _0x2c3687;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x3c1ae6,_0xe929b5){return function(_0xff396f){if(!_0xff396f){_0x3c1ae6[_0xaf2c('0x18')](0x194);}return _0xff396f;};}function handleError(_0x4a8dd8,_0x29f8b0){_0x29f8b0=_0x29f8b0||0x1f4;return function(_0x2051be){logger[_0xaf2c('0x24')](_0x2051be[_0xaf2c('0x25')]);if(_0x2051be['name']){delete _0x2051be[_0xaf2c('0x26')];}_0x4a8dd8['status'](_0x29f8b0)[_0xaf2c('0x27')](_0x2051be);};}exports[_0xaf2c('0x28')]=function(_0x15466b,_0x5d685a){var _0x2747bb={},_0x2ea490={},_0x3baee2={'count':0x0,'rows':[]};var _0x4a96d2=_[_0xaf2c('0x29')](db[_0xaf2c('0x2a')][_0xaf2c('0x2b')],function(_0x19364e){return{'name':_0x19364e['fieldName'],'type':_0x19364e[_0xaf2c('0x2c')][_0xaf2c('0x2d')]};});_0x2ea490[_0xaf2c('0x2e')]=_['map'](_0x4a96d2,'name');_0x2ea490[_0xaf2c('0x2f')]=_['keys'](_0x15466b[_0xaf2c('0x2f')]);_0x2ea490['filters']=_[_0xaf2c('0x30')](_0x2ea490[_0xaf2c('0x2e')],_0x2ea490['query']);_0x2747bb[_0xaf2c('0x31')]=_[_0xaf2c('0x30')](_0x2ea490['model'],qs[_0xaf2c('0x32')](_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x32')]));_0x2747bb[_0xaf2c('0x31')]=_0x2747bb[_0xaf2c('0x31')][_0xaf2c('0x33')]?_0x2747bb['attributes']:_0x2ea490[_0xaf2c('0x2e')];if(!_0x15466b['query'][_0xaf2c('0x34')]('nolimit')){_0x2747bb[_0xaf2c('0x1e')]=qs['limit'](_0x15466b[_0xaf2c('0x2f')]['limit']);_0x2747bb[_0xaf2c('0x1c')]=qs['offset'](_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x1c')]);}_0x2747bb[_0xaf2c('0x35')]=qs[_0xaf2c('0x36')](_0x15466b[_0xaf2c('0x2f')]['sort']);_0x2747bb['where']=qs[_0xaf2c('0x37')](_[_0xaf2c('0x38')](_0x15466b[_0xaf2c('0x2f')],_0x2ea490[_0xaf2c('0x37')]),_0x4a96d2);if(_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x39')]){_0x2747bb['where']=_[_0xaf2c('0x3a')](_0x2747bb[_0xaf2c('0x3b')],{'$or':_['map'](_0x4a96d2,function(_0x36081a){if(_0x36081a[_0xaf2c('0x2c')]!==_0xaf2c('0x3c')){var _0x71c597={};_0x71c597[_0x36081a[_0xaf2c('0x26')]]={'$like':'%'+_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x39')]+'%'};return _0x71c597;}})});}_0x2747bb=_[_0xaf2c('0x3a')]({},_0x2747bb,_0x15466b[_0xaf2c('0x3d')]);var _0x106eb9={'where':_0x2747bb[_0xaf2c('0x3b')]};return db[_0xaf2c('0x2a')][_0xaf2c('0x3e')](_0x106eb9)['then'](function(_0x54a953){_0x3baee2['count']=_0x54a953;if(_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x3f')]){_0x2747bb[_0xaf2c('0x40')]=[{'all':!![]}];}return db[_0xaf2c('0x2a')][_0xaf2c('0x41')](_0x2747bb);})[_0xaf2c('0x23')](function(_0x51c441){_0x3baee2[_0xaf2c('0x42')]=_0x51c441;return _0x3baee2;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x5d685a,_0x2747bb))[_0xaf2c('0x43')](handleError(_0x5d685a,null));};exports['show']=function(_0x493266,_0x4ac61a){var _0x4f8440={'raw':!![],'where':{'id':_0x493266[_0xaf2c('0x44')]['id']}},_0x181787={};_0x181787[_0xaf2c('0x2e')]=_[_0xaf2c('0x45')](db['Cdr'][_0xaf2c('0x2b')]);_0x181787['query']=_[_0xaf2c('0x45')](_0x493266[_0xaf2c('0x2f')]);_0x181787['filters']=_[_0xaf2c('0x30')](_0x181787['model'],_0x181787[_0xaf2c('0x2f')]);_0x4f8440[_0xaf2c('0x31')]=_[_0xaf2c('0x30')](_0x181787[_0xaf2c('0x2e')],qs[_0xaf2c('0x32')](_0x493266[_0xaf2c('0x2f')][_0xaf2c('0x32')]));_0x4f8440[_0xaf2c('0x31')]=_0x4f8440[_0xaf2c('0x31')]['length']?_0x4f8440['attributes']:_0x181787[_0xaf2c('0x2e')];if(_0x493266['query']['includeAll']){_0x4f8440['include']=[{'all':!![]}];}_0x4f8440=_[_0xaf2c('0x3a')]({},_0x4f8440,_0x493266[_0xaf2c('0x3d')]);return db[_0xaf2c('0x2a')][_0xaf2c('0x46')](_0x4f8440)['then'](handleEntityNotFound(_0x4ac61a,null))[_0xaf2c('0x23')](respondWithResult(_0x4ac61a,null))['catch'](handleError(_0x4ac61a,null));};exports[_0xaf2c('0x47')]=function(_0x5ae138,_0x166c26){return db[_0xaf2c('0x2a')][_0xaf2c('0x47')](_0x5ae138[_0xaf2c('0x48')],{})[_0xaf2c('0x23')](respondWithResult(_0x166c26,0xc9))['catch'](handleError(_0x166c26,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){if(_0x26afee['body']['id']){delete _0x26afee[_0xaf2c('0x48')]['id'];}return db['Cdr'][_0xaf2c('0x46')]({'where':{'id':_0x26afee[_0xaf2c('0x44')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x4b3ca4,null))[_0xaf2c('0x23')](saveUpdates(_0x26afee[_0xaf2c('0x48')],null))[_0xaf2c('0x23')](respondWithResult(_0x4b3ca4,null))[_0xaf2c('0x43')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x4a')]=function(_0x31ccfe,_0x1e72b0){return db[_0xaf2c('0x2a')]['find']({'where':{'id':_0x31ccfe[_0xaf2c('0x44')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x1e72b0,null))['then'](removeEntity(_0x1e72b0,null))['catch'](handleError(_0x1e72b0,null));};exports['describe']=function(_0x7ddca0,_0x1f6907){return db['Cdr'][_0xaf2c('0x4b')]()[_0xaf2c('0x23')](respondWithResult(_0x1f6907,null))[_0xaf2c('0x43')](handleError(_0x1f6907,null));}; \ No newline at end of file +var _0x9b67=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort'];(function(_0x1af78b,_0x216a77){var _0x127c93=function(_0x5a4c26){while(--_0x5a4c26){_0x1af78b['push'](_0x1af78b['shift']());}};_0x127c93(++_0x216a77);}(_0x9b67,0xf6));var _0x79b6=function(_0x4650bb,_0x11cc9e){_0x4650bb=_0x4650bb-0x0;var _0x5585fe=_0x9b67[_0x4650bb];return _0x5585fe;};'use strict';var emlformat=require(_0x79b6('0x0'));var rimraf=require(_0x79b6('0x1'));var zipdir=require(_0x79b6('0x2'));var jsonpatch=require(_0x79b6('0x3'));var rp=require(_0x79b6('0x4'));var moment=require('moment');var BPromise=require(_0x79b6('0x5'));var Mustache=require(_0x79b6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x79b6('0x7'));var csv=require(_0x79b6('0x8'));var ejs=require(_0x79b6('0x9'));var fs=require('fs');var fs_extra=require(_0x79b6('0xa'));var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x8'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var licenseUtil=require(_0x79b6('0x17'));var db=require(_0x79b6('0x18'))['db'];function respondWithStatusCode(_0x526727,_0xc05a77){_0xc05a77=_0xc05a77||0xcc;return function(_0x2df08d){if(_0x2df08d){return _0x526727[_0x79b6('0x19')](_0xc05a77);}return _0x526727[_0x79b6('0x1a')](_0xc05a77)[_0x79b6('0x1b')]();};}function respondWithResult(_0x40478d,_0x19d5b2){_0x19d5b2=_0x19d5b2||0xc8;return function(_0x3ef1fa){if(_0x3ef1fa){return _0x40478d[_0x79b6('0x1a')](_0x19d5b2)[_0x79b6('0x1c')](_0x3ef1fa);}};}function respondWithFilteredResult(_0x2ac966,_0x3563cc){return function(_0x1e8bf1){if(_0x1e8bf1){var _0x4cf491=typeof _0x3563cc[_0x79b6('0x1d')]===_0x79b6('0x1e')&&typeof _0x3563cc[_0x79b6('0x1f')]===_0x79b6('0x1e');var _0x2a8788=_0x1e8bf1[_0x79b6('0x20')];var _0x131bc5=_0x4cf491?0x0:_0x3563cc[_0x79b6('0x1d')];var _0x3ff583=_0x4cf491?_0x1e8bf1[_0x79b6('0x20')]:_0x3563cc[_0x79b6('0x1d')]+_0x3563cc[_0x79b6('0x1f')];var _0x1361f6;if(_0x3ff583>=_0x2a8788){_0x3ff583=_0x2a8788;_0x1361f6=0xc8;}else{_0x1361f6=0xce;}_0x2ac966['status'](_0x1361f6);return _0x2ac966[_0x79b6('0x21')]('Content-Range',_0x131bc5+'-'+_0x3ff583+'/'+_0x2a8788)[_0x79b6('0x1c')](_0x1e8bf1);}return null;};}function patchUpdates(_0x532e65){return function(_0x28b9c2){try{jsonpatch[_0x79b6('0x22')](_0x28b9c2,_0x532e65,!![]);}catch(_0x299bed){return BPromise['reject'](_0x299bed);}return _0x28b9c2[_0x79b6('0x23')]();};}function saveUpdates(_0x30dc0b,_0x53208a){return function(_0x565f86){if(_0x565f86){return _0x565f86[_0x79b6('0x24')](_0x30dc0b)[_0x79b6('0x25')](function(_0x9bd2cc){return _0x9bd2cc;});}return null;};}function removeEntity(_0x268826,_0x3b2a2a){return function(_0x488102){if(_0x488102){return _0x488102[_0x79b6('0x26')]()[_0x79b6('0x25')](function(){_0x268826[_0x79b6('0x1a')](0xcc)[_0x79b6('0x1b')]();});}};}function handleEntityNotFound(_0x4c275d,_0x53c03c){return function(_0x40ef76){if(!_0x40ef76){_0x4c275d[_0x79b6('0x19')](0x194);}return _0x40ef76;};}function handleError(_0x37b01b,_0xc25c99){_0xc25c99=_0xc25c99||0x1f4;return function(_0x4adf15){logger[_0x79b6('0x27')](_0x4adf15['stack']);if(_0x4adf15[_0x79b6('0x28')]){delete _0x4adf15[_0x79b6('0x28')];}_0x37b01b[_0x79b6('0x1a')](_0xc25c99)[_0x79b6('0x29')](_0x4adf15);};}exports['index']=function(_0x1484e5,_0x310832){var _0x53b463={},_0x158221={},_0x2d219c={'count':0x0,'rows':[]};var _0x1b1f2b=_[_0x79b6('0x2a')](db[_0x79b6('0x2b')][_0x79b6('0x2c')],function(_0x53b2f5){return{'name':_0x53b2f5[_0x79b6('0x2d')],'type':_0x53b2f5[_0x79b6('0x2e')][_0x79b6('0x2f')]};});_0x158221[_0x79b6('0x30')]=_[_0x79b6('0x2a')](_0x1b1f2b,_0x79b6('0x28'));_0x158221['query']=_[_0x79b6('0x31')](_0x1484e5[_0x79b6('0x32')]);_0x158221[_0x79b6('0x33')]=_['intersection'](_0x158221['model'],_0x158221[_0x79b6('0x32')]);_0x53b463[_0x79b6('0x34')]=_[_0x79b6('0x35')](_0x158221[_0x79b6('0x30')],qs[_0x79b6('0x36')](_0x1484e5[_0x79b6('0x32')]['fields']));_0x53b463['attributes']=_0x53b463[_0x79b6('0x34')]['length']?_0x53b463[_0x79b6('0x34')]:_0x158221['model'];if(!_0x1484e5[_0x79b6('0x32')][_0x79b6('0x37')]('nolimit')){_0x53b463[_0x79b6('0x1f')]=qs[_0x79b6('0x1f')](_0x1484e5['query'][_0x79b6('0x1f')]);_0x53b463['offset']=qs[_0x79b6('0x1d')](_0x1484e5[_0x79b6('0x32')][_0x79b6('0x1d')]);}_0x53b463[_0x79b6('0x38')]=qs[_0x79b6('0x39')](_0x1484e5[_0x79b6('0x32')][_0x79b6('0x39')]);_0x53b463[_0x79b6('0x3a')]=qs[_0x79b6('0x33')](_[_0x79b6('0x3b')](_0x1484e5['query'],_0x158221['filters']),_0x1b1f2b);if(_0x1484e5['query'][_0x79b6('0x3c')]){_0x53b463[_0x79b6('0x3a')]=_['merge'](_0x53b463[_0x79b6('0x3a')],{'$or':_['map'](_0x1b1f2b,function(_0x179a98){if(_0x179a98[_0x79b6('0x2e')]!==_0x79b6('0x3d')){var _0x53db1d={};_0x53db1d[_0x179a98[_0x79b6('0x28')]]={'$like':'%'+_0x1484e5['query'][_0x79b6('0x3c')]+'%'};return _0x53db1d;}})});}_0x53b463=_[_0x79b6('0x3e')]({},_0x53b463,_0x1484e5[_0x79b6('0x3f')]);var _0x2feeeb={'where':_0x53b463[_0x79b6('0x3a')]};return db['Cdr']['count'](_0x2feeeb)[_0x79b6('0x25')](function(_0x48ae49){_0x2d219c[_0x79b6('0x20')]=_0x48ae49;if(_0x1484e5[_0x79b6('0x32')][_0x79b6('0x40')]){_0x53b463[_0x79b6('0x41')]=[{'all':!![]}];}return db[_0x79b6('0x2b')][_0x79b6('0x42')](_0x53b463);})[_0x79b6('0x25')](function(_0x4a7f90){_0x2d219c[_0x79b6('0x43')]=_0x4a7f90;return _0x2d219c;})[_0x79b6('0x25')](respondWithFilteredResult(_0x310832,_0x53b463))[_0x79b6('0x44')](handleError(_0x310832,null));};exports[_0x79b6('0x45')]=function(_0x568f6b,_0x12ea22){var _0x4f803c={'raw':!![],'where':{'id':_0x568f6b[_0x79b6('0x46')]['id']}},_0x4ba212={};_0x4ba212[_0x79b6('0x30')]=_[_0x79b6('0x31')](db[_0x79b6('0x2b')][_0x79b6('0x2c')]);_0x4ba212[_0x79b6('0x32')]=_[_0x79b6('0x31')](_0x568f6b[_0x79b6('0x32')]);_0x4ba212['filters']=_[_0x79b6('0x35')](_0x4ba212['model'],_0x4ba212['query']);_0x4f803c[_0x79b6('0x34')]=_[_0x79b6('0x35')](_0x4ba212[_0x79b6('0x30')],qs[_0x79b6('0x36')](_0x568f6b[_0x79b6('0x32')][_0x79b6('0x36')]));_0x4f803c[_0x79b6('0x34')]=_0x4f803c[_0x79b6('0x34')][_0x79b6('0x47')]?_0x4f803c['attributes']:_0x4ba212[_0x79b6('0x30')];if(_0x568f6b[_0x79b6('0x32')][_0x79b6('0x40')]){_0x4f803c[_0x79b6('0x41')]=[{'all':!![]}];}_0x4f803c=_[_0x79b6('0x3e')]({},_0x4f803c,_0x568f6b['options']);return db[_0x79b6('0x2b')][_0x79b6('0x48')](_0x4f803c)['then'](handleEntityNotFound(_0x12ea22,null))['then'](respondWithResult(_0x12ea22,null))[_0x79b6('0x44')](handleError(_0x12ea22,null));};exports[_0x79b6('0x49')]=function(_0x247c79,_0xa0c396){return db[_0x79b6('0x2b')][_0x79b6('0x49')](_0x247c79[_0x79b6('0x4a')],{})[_0x79b6('0x25')](respondWithResult(_0xa0c396,0xc9))[_0x79b6('0x44')](handleError(_0xa0c396,null));};exports[_0x79b6('0x24')]=function(_0x15c795,_0x39972b){if(_0x15c795[_0x79b6('0x4a')]['id']){delete _0x15c795[_0x79b6('0x4a')]['id'];}return db[_0x79b6('0x2b')][_0x79b6('0x48')]({'where':{'id':_0x15c795[_0x79b6('0x46')]['id']}})[_0x79b6('0x25')](handleEntityNotFound(_0x39972b,null))[_0x79b6('0x25')](saveUpdates(_0x15c795['body'],null))['then'](respondWithResult(_0x39972b,null))['catch'](handleError(_0x39972b,null));};exports['destroy']=function(_0x56deb2,_0x412c1e){return db[_0x79b6('0x2b')][_0x79b6('0x48')]({'where':{'id':_0x56deb2[_0x79b6('0x46')]['id']}})[_0x79b6('0x25')](handleEntityNotFound(_0x412c1e,null))[_0x79b6('0x25')](removeEntity(_0x412c1e,null))['catch'](handleError(_0x412c1e,null));};exports[_0x79b6('0x4b')]=function(_0xa2ba0e,_0x58232b){return db[_0x79b6('0x2b')]['describe']()[_0x79b6('0x25')](respondWithResult(_0x58232b,null))['catch'](handleError(_0x58232b,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 34b6b5c..c816c53 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x45b43e,_0x19c945){var _0x35e1dc=function(_0x3f5e9b){while(--_0x3f5e9b){_0x45b43e['push'](_0x45b43e['shift']());}};_0x35e1dc(++_0x19c945);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x56d177,_0x2a5bb7){var _0x4fa1bb=function(_0x437442){while(--_0x437442){_0x56d177['push'](_0x56d177['shift']());}};_0x4fa1bb(++_0x2a5bb7);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 8214711..7402806 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 _0x198a=['code','message','info','request\x20sent','result','catch','lodash','moment','rpc','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','stringify','error'];(function(_0x55b7fe,_0x708f94){var _0x2f2cdc=function(_0x43559f){while(--_0x43559f){_0x55b7fe['push'](_0x55b7fe['shift']());}};_0x2f2cdc(++_0x708f94);}(_0x198a,0x1f3));var _0xa198=function(_0x15236c,_0x3d4afe){_0x15236c=_0x15236c-0x0;var _0x418c3c=_0x198a[_0x15236c];return _0x418c3c;};'use strict';var _=require(_0xa198('0x0'));var util=require('util');var moment=require(_0xa198('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('../../config/utils');var logger=require('../../config/logger')(_0xa198('0x2'));var config=require('../../config/environment');var jayson=require(_0xa198('0x3'));var client=jayson[_0xa198('0x4')][_0xa198('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1c7c5d,_0x117b23,_0x6c3396){return new BPromise(function(_0x453a7a,_0x38f0de){return client[_0xa198('0x6')](_0x1c7c5d,_0x6c3396)[_0xa198('0x7')](function(_0x1f19f5){logger['info'](_0xa198('0x8'),_0x117b23,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x117b23,'request\x20sent',JSON[_0xa198('0x9')](_0x1f19f5));if(_0x1f19f5['error']){if(_0x1f19f5[_0xa198('0xa')][_0xa198('0xb')]===0x1f4){logger[_0xa198('0xa')]('Cdr,\x20%s,\x20%s',_0x117b23,_0x1f19f5[_0xa198('0xa')][_0xa198('0xc')]);return _0x38f0de(_0x1f19f5[_0xa198('0xa')][_0xa198('0xc')]);}logger[_0xa198('0xa')](_0xa198('0x8'),_0x117b23,_0x1f19f5[_0xa198('0xa')][_0xa198('0xc')]);return _0x453a7a(_0x1f19f5[_0xa198('0xa')][_0xa198('0xc')]);}else{logger[_0xa198('0xd')](_0xa198('0x8'),_0x117b23,_0xa198('0xe'));_0x453a7a(_0x1f19f5[_0xa198('0xf')][_0xa198('0xc')]);}})[_0xa198('0x10')](function(_0x17b3c0){logger['error'](_0xa198('0x8'),_0x117b23,_0x17b3c0);_0x38f0de(_0x17b3c0);});});} \ No newline at end of file +var _0x0d84=['rpc','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0xeb2e44,_0x4e3805){var _0xb23895=function(_0x3eef0b){while(--_0x3eef0b){_0xeb2e44['push'](_0xeb2e44['shift']());}};_0xb23895(++_0x4e3805);}(_0x0d84,0x1de));var _0x40d8=function(_0x1bf7ab,_0x50be24){_0x1bf7ab=_0x1bf7ab-0x0;var _0x45cbeb=_0x0d84[_0x1bf7ab];return _0x45cbeb;};'use strict';var _=require(_0x40d8('0x0'));var util=require(_0x40d8('0x1'));var moment=require('moment');var BPromise=require(_0x40d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d8('0x3'));var db=require(_0x40d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x40d8('0x5'))(_0x40d8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x40d8('0x7')][_0x40d8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d803d,_0x571d5c,_0x36d808){return new BPromise(function(_0x237836,_0x261b53){return client[_0x40d8('0x9')](_0x5d803d,_0x36d808)[_0x40d8('0xa')](function(_0x38abc7){logger[_0x40d8('0xb')](_0x40d8('0xc'),_0x571d5c,_0x40d8('0xd'));logger[_0x40d8('0xe')](_0x40d8('0xf'),_0x571d5c,'request\x20sent',JSON[_0x40d8('0x10')](_0x38abc7));if(_0x38abc7[_0x40d8('0x11')]){if(_0x38abc7['error'][_0x40d8('0x12')]===0x1f4){logger[_0x40d8('0x11')](_0x40d8('0xc'),_0x571d5c,_0x38abc7[_0x40d8('0x11')]['message']);return _0x261b53(_0x38abc7[_0x40d8('0x11')][_0x40d8('0x13')]);}logger['error'](_0x40d8('0xc'),_0x571d5c,_0x38abc7[_0x40d8('0x11')][_0x40d8('0x13')]);return _0x237836(_0x38abc7['error']['message']);}else{logger[_0x40d8('0xb')](_0x40d8('0xc'),_0x571d5c,_0x40d8('0xd'));_0x237836(_0x38abc7[_0x40d8('0x14')][_0x40d8('0x13')]);}})[_0x40d8('0x15')](function(_0xd257e6){logger['error']('Cdr,\x20%s,\x20%s',_0x571d5c,_0xd257e6);_0x261b53(_0xd257e6);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index b588c53..0458fbd 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2fbbbf,_0x12ea46){var _0x2a9d83=function(_0x1e2ad8){while(--_0x1e2ad8){_0x2fbbbf['push'](_0x2fbbbf['shift']());}};_0x2a9d83(++_0x12ea46);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x58f051,_0xd6b70a){var _0x4d8577=function(_0x3d86b5){while(--_0x3d86b5){_0x58f051['push'](_0x58f051['shift']());}};_0x4d8577(++_0xd6b70a);}(_0xb10b,0x12a));var _0xbb10=function(_0x9647da,_0x1f7117){_0x9647da=_0x9647da-0x0;var _0x25c414=_0xb10b[_0x9647da];return _0x25c414;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 62b2a8d..b19b0b3 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 _0x96da=['INTEGER','noop','TEXT','STRING'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x96da,0x198));var _0xa96d=function(_0x5d35f7,_0x570c67){_0x5d35f7=_0x5d35f7-0x0;var _0x49a993=_0x96da[_0x5d35f7];return _0x49a993;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xa96d('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa96d('0x1')},'appdata':{'type':Sequelize[_0xa96d('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa96d('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb294=['STRING','noop','TEXT','sequelize','exports'];(function(_0x424afa,_0x658e9e){var _0x3b488c=function(_0x378ac9){while(--_0x378ac9){_0x424afa['push'](_0x424afa['shift']());}};_0x3b488c(++_0x658e9e);}(_0xb294,0x1d9));var _0x4b29=function(_0x35c993,_0x5e8fe1){_0x35c993=_0x35c993-0x0;var _0x3824dd=_0xb294[_0x35c993];return _0x3824dd;};'use strict';var Sequelize=require(_0x4b29('0x0'));module[_0x4b29('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4b29('0x2')],'allowNull':![],'defaultValue':_0x4b29('0x3')},'appdata':{'type':Sequelize[_0x4b29('0x4')]()},'description':{'type':Sequelize[_0x4b29('0x2')]},'interval':{'type':Sequelize[_0x4b29('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 6d0d715..402939c 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 _0xd139=['include','find','catch','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','filters','intersection','query','attributes','length','includeAll'];(function(_0x646b70,_0x53d1e8){var _0x3c921a=function(_0x3dbee3){while(--_0x3dbee3){_0x646b70['push'](_0x646b70['shift']());}};_0x3c921a(++_0x53d1e8);}(_0xd139,0x14e));var _0x9d13=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0xd139[_0x216428];return _0x313dd4;};'use strict';var emlformat=require(_0x9d13('0x0'));var rimraf=require(_0x9d13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d13('0x2'));var moment=require(_0x9d13('0x3'));var BPromise=require(_0x9d13('0x4'));var Mustache=require(_0x9d13('0x5'));var util=require(_0x9d13('0x6'));var path=require(_0x9d13('0x7'));var sox=require(_0x9d13('0x8'));var csv=require('to-csv');var ejs=require(_0x9d13('0x9'));var fs=require('fs');var fs_extra=require(_0x9d13('0xa'));var _=require('lodash');var squel=require(_0x9d13('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d13('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d13('0xd'));var Redis=require(_0x9d13('0xe'));var authService=require(_0x9d13('0xf'));var qs=require(_0x9d13('0x10'));var as=require(_0x9d13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d13('0x12'))(_0x9d13('0x13'));var utils=require(_0x9d13('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d13('0x15'))['db'];function respondWithStatusCode(_0x3933d1,_0x39020){_0x39020=_0x39020||0xcc;return function(_0x331fea){if(_0x331fea){return _0x3933d1[_0x9d13('0x16')](_0x39020);}return _0x3933d1['status'](_0x39020)['end']();};}function respondWithResult(_0x37607a,_0x43bf27){_0x43bf27=_0x43bf27||0xc8;return function(_0x2f5442){if(_0x2f5442){return _0x37607a[_0x9d13('0x17')](_0x43bf27)[_0x9d13('0x18')](_0x2f5442);}};}function respondWithFilteredResult(_0x1a2b65,_0x38f368){return function(_0x47bcd3){if(_0x47bcd3){var _0x3acfc1=typeof _0x38f368[_0x9d13('0x19')]===_0x9d13('0x1a')&&typeof _0x38f368[_0x9d13('0x1b')]===_0x9d13('0x1a');var _0x42d5a5=_0x47bcd3[_0x9d13('0x1c')];var _0x10aa89=_0x3acfc1?0x0:_0x38f368[_0x9d13('0x19')];var _0x2acb0b=_0x3acfc1?_0x47bcd3[_0x9d13('0x1c')]:_0x38f368[_0x9d13('0x19')]+_0x38f368[_0x9d13('0x1b')];var _0x4d6b9d;if(_0x2acb0b>=_0x42d5a5){_0x2acb0b=_0x42d5a5;_0x4d6b9d=0xc8;}else{_0x4d6b9d=0xce;}_0x1a2b65[_0x9d13('0x17')](_0x4d6b9d);return _0x1a2b65[_0x9d13('0x1d')](_0x9d13('0x1e'),_0x10aa89+'-'+_0x2acb0b+'/'+_0x42d5a5)[_0x9d13('0x18')](_0x47bcd3);}return null;};}function patchUpdates(_0x4e1425){return function(_0x48ce3d){try{jsonpatch['apply'](_0x48ce3d,_0x4e1425,!![]);}catch(_0x223ea5){return BPromise[_0x9d13('0x1f')](_0x223ea5);}return _0x48ce3d[_0x9d13('0x20')]();};}function saveUpdates(_0x1fefe4,_0x3971e0){return function(_0x3040e7){if(_0x3040e7){return _0x3040e7[_0x9d13('0x21')](_0x1fefe4)[_0x9d13('0x22')](function(_0x5d14c8){return _0x5d14c8;});}return null;};}function removeEntity(_0xb34817,_0xd5a981){return function(_0x22963f){if(_0x22963f){return _0x22963f[_0x9d13('0x23')]()['then'](function(){_0xb34817[_0x9d13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c673,_0xfaf587){return function(_0xe0c57){if(!_0xe0c57){_0x40c673[_0x9d13('0x16')](0x194);}return _0xe0c57;};}function handleError(_0x453536,_0x45a299){_0x45a299=_0x45a299||0x1f4;return function(_0x1c36e5){logger[_0x9d13('0x24')](_0x1c36e5['stack']);if(_0x1c36e5[_0x9d13('0x25')]){delete _0x1c36e5['name'];}_0x453536[_0x9d13('0x17')](_0x45a299)[_0x9d13('0x26')](_0x1c36e5);};}exports[_0x9d13('0x27')]=function(_0x1d9f56,_0x5ebfaf){var _0x23c91f={'raw':!![],'where':{'id':_0x1d9f56[_0x9d13('0x28')]['id']}},_0x441118={};_0x441118[_0x9d13('0x29')]=_[_0x9d13('0x2a')](db[_0x9d13('0x2b')][_0x9d13('0x2c')]);_0x441118['query']=_[_0x9d13('0x2a')](_0x1d9f56['query']);_0x441118[_0x9d13('0x2d')]=_[_0x9d13('0x2e')](_0x441118['model'],_0x441118[_0x9d13('0x2f')]);_0x23c91f[_0x9d13('0x30')]=_['intersection'](_0x441118['model'],qs['fields'](_0x1d9f56[_0x9d13('0x2f')]['fields']));_0x23c91f[_0x9d13('0x30')]=_0x23c91f[_0x9d13('0x30')][_0x9d13('0x31')]?_0x23c91f['attributes']:_0x441118[_0x9d13('0x29')];if(_0x1d9f56[_0x9d13('0x2f')][_0x9d13('0x32')]){_0x23c91f[_0x9d13('0x33')]=[{'all':!![]}];}_0x23c91f=_['merge']({},_0x23c91f,_0x1d9f56['options']);return db[_0x9d13('0x2b')][_0x9d13('0x34')](_0x23c91f)['then'](handleEntityNotFound(_0x5ebfaf,null))[_0x9d13('0x22')](respondWithResult(_0x5ebfaf,null))[_0x9d13('0x35')](handleError(_0x5ebfaf,null));};exports[_0x9d13('0x21')]=function(_0x96da64,_0x7f7a0f){if(_0x96da64[_0x9d13('0x36')]['id']){delete _0x96da64[_0x9d13('0x36')]['id'];}return db['ChatApplication'][_0x9d13('0x34')]({'where':{'id':_0x96da64['params']['id']}})['then'](handleEntityNotFound(_0x7f7a0f,null))['then'](saveUpdates(_0x96da64[_0x9d13('0x36')],null))[_0x9d13('0x22')](respondWithResult(_0x7f7a0f,null))[_0x9d13('0x35')](handleError(_0x7f7a0f,null));};exports[_0x9d13('0x23')]=function(_0x3467eb,_0x4b32d8){return db[_0x9d13('0x2b')][_0x9d13('0x34')]({'where':{'id':_0x3467eb[_0x9d13('0x28')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x4b32d8,null))[_0x9d13('0x22')](removeEntity(_0x4b32d8,null))[_0x9d13('0x35')](handleError(_0x4b32d8,null));}; \ No newline at end of file +var _0xd84c=['limit','count','set','reject','update','then','name','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','body','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x29fd64,_0x2446ad){var _0x2b00b7=function(_0x50d454){while(--_0x50d454){_0x29fd64['push'](_0x29fd64['shift']());}};_0x2b00b7(++_0x2446ad);}(_0xd84c,0x102));var _0xcd84=function(_0x32b2ff,_0x56bbb4){_0x32b2ff=_0x32b2ff-0x0;var _0x5a8842=_0xd84c[_0x32b2ff];return _0x5a8842;};'use strict';var emlformat=require(_0xcd84('0x0'));var rimraf=require(_0xcd84('0x1'));var zipdir=require(_0xcd84('0x2'));var jsonpatch=require(_0xcd84('0x3'));var rp=require(_0xcd84('0x4'));var moment=require(_0xcd84('0x5'));var BPromise=require(_0xcd84('0x6'));var Mustache=require(_0xcd84('0x7'));var util=require(_0xcd84('0x8'));var path=require('path');var sox=require(_0xcd84('0x9'));var csv=require(_0xcd84('0xa'));var ejs=require(_0xcd84('0xb'));var fs=require('fs');var fs_extra=require(_0xcd84('0xc'));var _=require('lodash');var squel=require(_0xcd84('0xd'));var crypto=require(_0xcd84('0xe'));var jsforce=require(_0xcd84('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcd84('0xa'));var querystring=require(_0xcd84('0x10'));var Papa=require(_0xcd84('0x11'));var Redis=require(_0xcd84('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcd84('0x13'));var as=require(_0xcd84('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd84('0x15'))(_0xcd84('0x16'));var utils=require(_0xcd84('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd84('0x18'));var db=require(_0xcd84('0x19'))['db'];function respondWithStatusCode(_0x6fcec,_0x116423){_0x116423=_0x116423||0xcc;return function(_0x4e1291){if(_0x4e1291){return _0x6fcec[_0xcd84('0x1a')](_0x116423);}return _0x6fcec[_0xcd84('0x1b')](_0x116423)[_0xcd84('0x1c')]();};}function respondWithResult(_0x3ccf60,_0x1271b4){_0x1271b4=_0x1271b4||0xc8;return function(_0x100a7b){if(_0x100a7b){return _0x3ccf60[_0xcd84('0x1b')](_0x1271b4)[_0xcd84('0x1d')](_0x100a7b);}};}function respondWithFilteredResult(_0xcc47a6,_0x45a92e){return function(_0x223127){if(_0x223127){var _0x23b116=typeof _0x45a92e[_0xcd84('0x1e')]===_0xcd84('0x1f')&&typeof _0x45a92e[_0xcd84('0x20')]===_0xcd84('0x1f');var _0x30d51c=_0x223127[_0xcd84('0x21')];var _0x4ff790=_0x23b116?0x0:_0x45a92e[_0xcd84('0x1e')];var _0x15099f=_0x23b116?_0x223127['count']:_0x45a92e[_0xcd84('0x1e')]+_0x45a92e[_0xcd84('0x20')];var _0x1ba160;if(_0x15099f>=_0x30d51c){_0x15099f=_0x30d51c;_0x1ba160=0xc8;}else{_0x1ba160=0xce;}_0xcc47a6[_0xcd84('0x1b')](_0x1ba160);return _0xcc47a6[_0xcd84('0x22')]('Content-Range',_0x4ff790+'-'+_0x15099f+'/'+_0x30d51c)[_0xcd84('0x1d')](_0x223127);}return null;};}function patchUpdates(_0x171813){return function(_0x225e15){try{jsonpatch['apply'](_0x225e15,_0x171813,!![]);}catch(_0x48a90e){return BPromise[_0xcd84('0x23')](_0x48a90e);}return _0x225e15['save']();};}function saveUpdates(_0x3a6f30,_0x20b0ce){return function(_0x5cb006){if(_0x5cb006){return _0x5cb006[_0xcd84('0x24')](_0x3a6f30)[_0xcd84('0x25')](function(_0x16b6ea){return _0x16b6ea;});}return null;};}function removeEntity(_0x13996e,_0x14cf35){return function(_0xfc2a17){if(_0xfc2a17){return _0xfc2a17['destroy']()[_0xcd84('0x25')](function(){_0x13996e[_0xcd84('0x1b')](0xcc)[_0xcd84('0x1c')]();});}};}function handleEntityNotFound(_0xbc0595,_0x243368){return function(_0x40d00a){if(!_0x40d00a){_0xbc0595[_0xcd84('0x1a')](0x194);}return _0x40d00a;};}function handleError(_0x5109b9,_0x5d610b){_0x5d610b=_0x5d610b||0x1f4;return function(_0x1967f6){logger['error'](_0x1967f6['stack']);if(_0x1967f6['name']){delete _0x1967f6[_0xcd84('0x26')];}_0x5109b9[_0xcd84('0x1b')](_0x5d610b)['send'](_0x1967f6);};}exports[_0xcd84('0x27')]=function(_0x3691a6,_0x1f75ac){var _0x5661a4={'raw':!![],'where':{'id':_0x3691a6['params']['id']}},_0x33fc4f={};_0x33fc4f[_0xcd84('0x28')]=_[_0xcd84('0x29')](db[_0xcd84('0x2a')][_0xcd84('0x2b')]);_0x33fc4f[_0xcd84('0x2c')]=_[_0xcd84('0x29')](_0x3691a6[_0xcd84('0x2c')]);_0x33fc4f[_0xcd84('0x2d')]=_[_0xcd84('0x2e')](_0x33fc4f[_0xcd84('0x28')],_0x33fc4f[_0xcd84('0x2c')]);_0x5661a4[_0xcd84('0x2f')]=_['intersection'](_0x33fc4f[_0xcd84('0x28')],qs[_0xcd84('0x30')](_0x3691a6[_0xcd84('0x2c')][_0xcd84('0x30')]));_0x5661a4['attributes']=_0x5661a4[_0xcd84('0x2f')][_0xcd84('0x31')]?_0x5661a4[_0xcd84('0x2f')]:_0x33fc4f[_0xcd84('0x28')];if(_0x3691a6[_0xcd84('0x2c')]['includeAll']){_0x5661a4[_0xcd84('0x32')]=[{'all':!![]}];}_0x5661a4=_[_0xcd84('0x33')]({},_0x5661a4,_0x3691a6[_0xcd84('0x34')]);return db[_0xcd84('0x2a')][_0xcd84('0x35')](_0x5661a4)[_0xcd84('0x25')](handleEntityNotFound(_0x1f75ac,null))[_0xcd84('0x25')](respondWithResult(_0x1f75ac,null))['catch'](handleError(_0x1f75ac,null));};exports[_0xcd84('0x24')]=function(_0x2653f9,_0x58acf3){if(_0x2653f9[_0xcd84('0x36')]['id']){delete _0x2653f9['body']['id'];}return db[_0xcd84('0x2a')][_0xcd84('0x35')]({'where':{'id':_0x2653f9[_0xcd84('0x37')]['id']}})[_0xcd84('0x25')](handleEntityNotFound(_0x58acf3,null))[_0xcd84('0x25')](saveUpdates(_0x2653f9[_0xcd84('0x36')],null))[_0xcd84('0x25')](respondWithResult(_0x58acf3,null))[_0xcd84('0x38')](handleError(_0x58acf3,null));};exports[_0xcd84('0x39')]=function(_0x2dd941,_0xec4c9a){return db[_0xcd84('0x2a')][_0xcd84('0x35')]({'where':{'id':_0x2dd941[_0xcd84('0x37')]['id']}})[_0xcd84('0x25')](handleEntityNotFound(_0xec4c9a,null))['then'](removeEntity(_0xec4c9a,null))[_0xcd84('0x38')](handleError(_0xec4c9a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index b907e16..44903e7 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 _0x2783=['rimraf','../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2783,0x1f2));var _0x3278=function(_0x446193,_0x4e37fa){_0x446193=_0x446193-0x0;var _0x504db2=_0x2783[_0x446193];return _0x504db2;};'use strict';var _=require(_0x3278('0x0'));var util=require('util');var logger=require(_0x3278('0x1'))(_0x3278('0x2'));var moment=require(_0x3278('0x3'));var BPromise=require('bluebird');var rp=require(_0x3278('0x4'));var fs=require('fs');var path=require(_0x3278('0x5'));var rimraf=require(_0x3278('0x6'));var config=require(_0x3278('0x7'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x1eedc9,_0x20258c){return _0x1eedc9[_0x3278('0x8')](_0x3278('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3278('0xa'),'collate':_0x3278('0xb')});}; \ No newline at end of file +var _0xefbb=['utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xefbb,0x198));var _0xbefb=function(_0x3eb992,_0x2082eb){_0x3eb992=_0x3eb992-0x0;var _0x5e8934=_0xefbb[_0x3eb992];return _0x5e8934;};'use strict';var _=require(_0xbefb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbefb('0x1'));var moment=require('moment');var BPromise=require(_0xbefb('0x2'));var rp=require(_0xbefb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbefb('0x4'));var attributes=require(_0xbefb('0x5'));module[_0xbefb('0x6')]=function(_0x1395aa,_0x594faa){return _0x1395aa[_0xbefb('0x7')](_0xbefb('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbefb('0x9'),'collate':_0xbefb('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f2ca98f..40583de 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 _0x4f8d=['client','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1bc8f3,_0x2f6380){var _0x1878d3=function(_0x5ff8c2){while(--_0x5ff8c2){_0x1bc8f3['push'](_0x1bc8f3['shift']());}};_0x1878d3(++_0x2f6380);}(_0x4f8d,0x161));var _0xd4f8=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x4f8d[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0xd4f8('0x0'));var util=require(_0xd4f8('0x1'));var moment=require(_0xd4f8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4f8('0x3'))['db'];var utils=require(_0xd4f8('0x4'));var logger=require(_0xd4f8('0x5'))('rpc');var config=require(_0xd4f8('0x6'));var jayson=require(_0xd4f8('0x7'));var client=jayson[_0xd4f8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x280058,_0x220a3b,_0x1743a8){return new BPromise(function(_0xeec0c9,_0x562192){return client[_0xd4f8('0x9')](_0x280058,_0x1743a8)['then'](function(_0x6f460){logger['info'](_0xd4f8('0xa'),_0x220a3b,_0xd4f8('0xb'));logger[_0xd4f8('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x220a3b,'request\x20sent',JSON[_0xd4f8('0xd')](_0x6f460));if(_0x6f460[_0xd4f8('0xe')]){if(_0x6f460[_0xd4f8('0xe')][_0xd4f8('0xf')]===0x1f4){logger[_0xd4f8('0xe')](_0xd4f8('0xa'),_0x220a3b,_0x6f460['error'][_0xd4f8('0x10')]);return _0x562192(_0x6f460['error'][_0xd4f8('0x10')]);}logger[_0xd4f8('0xe')]('ChatApplication,\x20%s,\x20%s',_0x220a3b,_0x6f460[_0xd4f8('0xe')][_0xd4f8('0x10')]);return _0xeec0c9(_0x6f460[_0xd4f8('0xe')]['message']);}else{logger[_0xd4f8('0x11')](_0xd4f8('0xa'),_0x220a3b,_0xd4f8('0xb'));_0xeec0c9(_0x6f460['result'][_0xd4f8('0x10')]);}})[_0xd4f8('0x12')](function(_0x5a543e){logger[_0xd4f8('0xe')](_0xd4f8('0xa'),_0x220a3b,_0x5a543e);_0x562192(_0x5a543e);});});} \ No newline at end of file +var _0xbb4e=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x526d5c,_0xd5645d){var _0x4f9200=function(_0x384800){while(--_0x384800){_0x526d5c['push'](_0x526d5c['shift']());}};_0x4f9200(++_0xd5645d);}(_0xbb4e,0x88));var _0xebb4=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0xbb4e[_0xcd0918];return _0x250704;};'use strict';var _=require(_0xebb4('0x0'));var util=require(_0xebb4('0x1'));var moment=require('moment');var BPromise=require(_0xebb4('0x2'));var rs=require(_0xebb4('0x3'));var fs=require('fs');var Redis=require(_0xebb4('0x4'));var db=require(_0xebb4('0x5'))['db'];var utils=require(_0xebb4('0x6'));var logger=require('../../config/logger')(_0xebb4('0x7'));var config=require(_0xebb4('0x8'));var jayson=require(_0xebb4('0x9'));var client=jayson[_0xebb4('0xa')][_0xebb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0db0,_0x9f41e0,_0x14e00c){return new BPromise(function(_0x269d66,_0x4fcfc9){return client[_0xebb4('0xc')](_0x3b0db0,_0x14e00c)[_0xebb4('0xd')](function(_0x6b84b1){logger[_0xebb4('0xe')](_0xebb4('0xf'),_0x9f41e0,'request\x20sent');logger[_0xebb4('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x9f41e0,'request\x20sent',JSON[_0xebb4('0x11')](_0x6b84b1));if(_0x6b84b1['error']){if(_0x6b84b1[_0xebb4('0x12')][_0xebb4('0x13')]===0x1f4){logger[_0xebb4('0x12')](_0xebb4('0xf'),_0x9f41e0,_0x6b84b1[_0xebb4('0x12')]['message']);return _0x4fcfc9(_0x6b84b1['error']['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x9f41e0,_0x6b84b1[_0xebb4('0x12')][_0xebb4('0x14')]);return _0x269d66(_0x6b84b1[_0xebb4('0x12')][_0xebb4('0x14')]);}else{logger[_0xebb4('0xe')](_0xebb4('0xf'),_0x9f41e0,'request\x20sent');_0x269d66(_0x6b84b1['result'][_0xebb4('0x14')]);}})[_0xebb4('0x15')](function(_0x3874fd){logger[_0xebb4('0x12')](_0xebb4('0xf'),_0x9f41e0,_0x3874fd);_0x4fcfc9(_0x3874fd);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e0af8db..20ea74c 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 _0x73d2=['delete','destroy','exports','multer','path','Router','fs-extra','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x73d2,0xac));var _0x273d=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x73d2[_0x237f8b];return _0x423f94;};'use strict';var multer=require(_0x273d('0x0'));var util=require('util');var path=require(_0x273d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x273d('0x2')]();var fs_extra=require(_0x273d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x273d('0x4'));var controller=require(_0x273d('0x5'));router[_0x273d('0x6')](_0x273d('0x7'),auth['isAuthenticated'](),controller['show']);router['put']('/:id',auth[_0x273d('0x8')](),controller[_0x273d('0x9')]);router[_0x273d('0xa')](_0x273d('0x7'),auth['isAuthenticated'](),controller[_0x273d('0xb')]);module[_0x273d('0xc')]=router; \ No newline at end of file +var _0x23a6=['./chatApplication.controller','show','put','/:id','isAuthenticated','update','destroy','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x55634e,_0x492076){var _0x55175e=function(_0x1b3867){while(--_0x1b3867){_0x55634e['push'](_0x55634e['shift']());}};_0x55175e(++_0x492076);}(_0x23a6,0x1a8));var _0x623a=function(_0xa40fbf,_0x38aeb7){_0xa40fbf=_0xa40fbf-0x0;var _0x5d4a3d=_0x23a6[_0xa40fbf];return _0x5d4a3d;};'use strict';var multer=require('multer');var util=require(_0x623a('0x0'));var path=require('path');var timeout=require(_0x623a('0x1'));var express=require('express');var router=express[_0x623a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x623a('0x3'));var config=require(_0x623a('0x4'));var controller=require(_0x623a('0x5'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x623a('0x6')]);router[_0x623a('0x7')](_0x623a('0x8'),auth[_0x623a('0x9')](),controller[_0x623a('0xa')]);router['delete']('/:id',auth[_0x623a('0x9')](),controller[_0x623a('0xb')]);module[_0x623a('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 7880394..f2d8986 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 _0xcafa=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcafa,0x8f));var _0xacaf=function(_0x4c5765,_0x2dc2fc){_0x4c5765=_0x4c5765-0x0;var _0x396b49=_0xcafa[_0x4c5765];return _0x396b49;};'use strict';var Sequelize=require(_0xacaf('0x0'));module[_0xacaf('0x1')]={'name':{'type':Sequelize[_0xacaf('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7a75=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x7a75,0x18f));var _0x57a7=function(_0x55af95,_0x4c0dd6){_0x55af95=_0x55af95-0x0;var _0x397e00=_0x7a75[_0x55af95];return _0x397e00;};'use strict';var Sequelize=require(_0x57a7('0x0'));module[_0x57a7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x57a7('0x2')]},'write':{'type':Sequelize[_0x57a7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 8eebab5..00a293f 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 _0x314a=['error','stack','name','send','ChatGroup','rawAttributes','type','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','keys','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','params','user','toInteger','addMembers','ids','getMembers','findOne','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x314a,0x144));var _0xa314=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0x314a[_0x16ed87];return _0xc1a1d8;};'use strict';var emlformat=require(_0xa314('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa314('0x1'));var jsonpatch=require(_0xa314('0x2'));var rp=require(_0xa314('0x3'));var moment=require(_0xa314('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa314('0x5'));var sox=require('sox');var csv=require(_0xa314('0x6'));var ejs=require(_0xa314('0x7'));var fs=require('fs');var fs_extra=require(_0xa314('0x8'));var _=require(_0xa314('0x9'));var squel=require(_0xa314('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa314('0x6'));var querystring=require(_0xa314('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa314('0xc'));var as=require(_0xa314('0xd'));var hardwareService=require(_0xa314('0xe'));var logger=require('../../config/logger')(_0xa314('0xf'));var utils=require(_0xa314('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xa314('0x11'));var db=require(_0xa314('0x12'))['db'];config[_0xa314('0x13')]=_[_0xa314('0x14')](config[_0xa314('0x13')],{'host':_0xa314('0x15'),'port':0x18eb});var socket=require(_0xa314('0x16'))(new Redis(config[_0xa314('0x13')]));require(_0xa314('0x17'))[_0xa314('0x18')](socket);function respondWithStatusCode(_0xd07c37,_0x298d25){_0x298d25=_0x298d25||0xcc;return function(_0x2bdb00){if(_0x2bdb00){return _0xd07c37[_0xa314('0x19')](_0x298d25);}return _0xd07c37[_0xa314('0x1a')](_0x298d25)[_0xa314('0x1b')]();};}function respondWithResult(_0x491b0e,_0x42431b){_0x42431b=_0x42431b||0xc8;return function(_0x328772){if(_0x328772){return _0x491b0e[_0xa314('0x1a')](_0x42431b)[_0xa314('0x1c')](_0x328772);}};}function respondWithFilteredResult(_0x22d7d0,_0x101c10){return function(_0x341264){if(_0x341264){var _0x349152=typeof _0x101c10[_0xa314('0x1d')]===_0xa314('0x1e')&&typeof _0x101c10['limit']===_0xa314('0x1e');var _0x465ced=_0x341264[_0xa314('0x1f')];var _0x2a25b4=_0x349152?0x0:_0x101c10[_0xa314('0x1d')];var _0x42dc3e=_0x349152?_0x341264['count']:_0x101c10['offset']+_0x101c10[_0xa314('0x20')];var _0x4506a1;if(_0x42dc3e>=_0x465ced){_0x42dc3e=_0x465ced;_0x4506a1=0xc8;}else{_0x4506a1=0xce;}_0x22d7d0['status'](_0x4506a1);return _0x22d7d0[_0xa314('0x21')](_0xa314('0x22'),_0x2a25b4+'-'+_0x42dc3e+'/'+_0x465ced)[_0xa314('0x1c')](_0x341264);}return null;};}function patchUpdates(_0x453b51){return function(_0x16a927){try{jsonpatch[_0xa314('0x23')](_0x16a927,_0x453b51,!![]);}catch(_0x19b4c8){return BPromise[_0xa314('0x24')](_0x19b4c8);}return _0x16a927['save']();};}function saveUpdates(_0x220284,_0x1f2def){return function(_0x3a3760){if(_0x3a3760){return _0x3a3760[_0xa314('0x25')](_0x220284)[_0xa314('0x26')](function(_0x4073c6){return _0x4073c6;});}return null;};}function removeEntity(_0x2b020f,_0x45ba81){return function(_0x4821e5){if(_0x4821e5){return _0x4821e5[_0xa314('0x27')]()[_0xa314('0x26')](function(){_0x2b020f[_0xa314('0x1a')](0xcc)[_0xa314('0x1b')]();});}};}function handleEntityNotFound(_0x567d97,_0x585e5d){return function(_0x2f9fb1){if(!_0x2f9fb1){_0x567d97[_0xa314('0x19')](0x194);}return _0x2f9fb1;};}function handleError(_0x22e47d,_0x4fdcb8){_0x4fdcb8=_0x4fdcb8||0x1f4;return function(_0xcf1f7c){logger[_0xa314('0x28')](_0xcf1f7c[_0xa314('0x29')]);if(_0xcf1f7c['name']){delete _0xcf1f7c[_0xa314('0x2a')];}_0x22e47d[_0xa314('0x1a')](_0x4fdcb8)[_0xa314('0x2b')](_0xcf1f7c);};}exports['index']=function(_0x1ea7b4,_0x345b50){var _0x176c14={},_0x4874cf={},_0x59b96f={'count':0x0,'rows':[]};var _0x11f909=_['map'](db[_0xa314('0x2c')][_0xa314('0x2d')],function(_0x11cd3c){return{'name':_0x11cd3c['fieldName'],'type':_0x11cd3c[_0xa314('0x2e')]['key']};});_0x4874cf[_0xa314('0x2f')]=_[_0xa314('0x30')](_0x11f909,'name');_0x4874cf['query']=_['keys'](_0x1ea7b4['query']);_0x4874cf['filters']=_[_0xa314('0x31')](_0x4874cf[_0xa314('0x2f')],_0x4874cf[_0xa314('0x32')]);_0x176c14[_0xa314('0x33')]=_[_0xa314('0x31')](_0x4874cf[_0xa314('0x2f')],qs[_0xa314('0x34')](_0x1ea7b4[_0xa314('0x32')][_0xa314('0x34')]));_0x176c14[_0xa314('0x33')]=_0x176c14[_0xa314('0x33')][_0xa314('0x35')]?_0x176c14[_0xa314('0x33')]:_0x4874cf[_0xa314('0x2f')];if(!_0x1ea7b4['query'][_0xa314('0x36')](_0xa314('0x37'))){_0x176c14[_0xa314('0x20')]=qs['limit'](_0x1ea7b4[_0xa314('0x32')]['limit']);_0x176c14[_0xa314('0x1d')]=qs['offset'](_0x1ea7b4[_0xa314('0x32')][_0xa314('0x1d')]);}_0x176c14[_0xa314('0x38')]=qs[_0xa314('0x39')](_0x1ea7b4['query'][_0xa314('0x39')]);_0x176c14[_0xa314('0x3a')]=qs[_0xa314('0x3b')](_[_0xa314('0x3c')](_0x1ea7b4['query'],_0x4874cf[_0xa314('0x3b')]),_0x11f909);if(_0x1ea7b4['query'][_0xa314('0x3d')]){_0x176c14[_0xa314('0x3a')]=_[_0xa314('0x3e')](_0x176c14[_0xa314('0x3a')],{'$or':_[_0xa314('0x30')](_0x11f909,function(_0x9abfa){if(_0x9abfa[_0xa314('0x2e')]!==_0xa314('0x3f')){var _0x56d6de={};_0x56d6de[_0x9abfa[_0xa314('0x2a')]]={'$like':'%'+_0x1ea7b4[_0xa314('0x32')][_0xa314('0x3d')]+'%'};return _0x56d6de;}})});}_0x176c14=_[_0xa314('0x3e')]({},_0x176c14,_0x1ea7b4[_0xa314('0x40')]);var _0x4edc87={'where':_0x176c14[_0xa314('0x3a')]};return db['ChatGroup']['count'](_0x4edc87)['then'](function(_0x13d329){_0x59b96f[_0xa314('0x1f')]=_0x13d329;if(_0x1ea7b4[_0xa314('0x32')]['includeAll']){_0x176c14[_0xa314('0x41')]=[{'all':!![]}];}return db[_0xa314('0x2c')][_0xa314('0x42')](_0x176c14);})['then'](function(_0x102ca2){_0x59b96f[_0xa314('0x43')]=_0x102ca2;return _0x59b96f;})[_0xa314('0x26')](respondWithFilteredResult(_0x345b50,_0x176c14))[_0xa314('0x44')](handleError(_0x345b50,null));};exports['show']=function(_0x8e6b5e,_0x1fb274){var _0x4402b8={'raw':!![],'where':{'id':_0x8e6b5e['params']['id']}},_0x4399c8={};_0x4399c8[_0xa314('0x2f')]=_[_0xa314('0x45')](db['ChatGroup'][_0xa314('0x2d')]);_0x4399c8[_0xa314('0x32')]=_['keys'](_0x8e6b5e[_0xa314('0x32')]);_0x4399c8[_0xa314('0x3b')]=_[_0xa314('0x31')](_0x4399c8[_0xa314('0x2f')],_0x4399c8[_0xa314('0x32')]);_0x4402b8[_0xa314('0x33')]=_[_0xa314('0x31')](_0x4399c8[_0xa314('0x2f')],qs[_0xa314('0x34')](_0x8e6b5e['query'][_0xa314('0x34')]));_0x4402b8[_0xa314('0x33')]=_0x4402b8[_0xa314('0x33')][_0xa314('0x35')]?_0x4402b8['attributes']:_0x4399c8[_0xa314('0x2f')];if(_0x8e6b5e[_0xa314('0x32')][_0xa314('0x46')]){_0x4402b8[_0xa314('0x41')]=[{'all':!![]}];}_0x4402b8=_[_0xa314('0x3e')]({},_0x4402b8,_0x8e6b5e[_0xa314('0x40')]);return db[_0xa314('0x2c')][_0xa314('0x47')](_0x4402b8)[_0xa314('0x26')](handleEntityNotFound(_0x1fb274,null))[_0xa314('0x26')](respondWithResult(_0x1fb274,null))[_0xa314('0x44')](handleError(_0x1fb274,null));};exports[_0xa314('0x48')]=function(_0x2eb65f,_0x3a9178){return db[_0xa314('0x2c')][_0xa314('0x48')](_0x2eb65f[_0xa314('0x49')],{})[_0xa314('0x26')](respondWithResult(_0x3a9178,0xc9))['catch'](handleError(_0x3a9178,null));};exports['update']=function(_0x34553f,_0x2ef3bb){if(_0x34553f[_0xa314('0x49')]['id']){delete _0x34553f[_0xa314('0x49')]['id'];}return db[_0xa314('0x2c')]['find']({'where':{'id':_0x34553f['params']['id']}})['then'](handleEntityNotFound(_0x2ef3bb,null))[_0xa314('0x26')](saveUpdates(_0x34553f[_0xa314('0x49')],null))[_0xa314('0x26')](respondWithResult(_0x2ef3bb,null))['catch'](handleError(_0x2ef3bb,null));};exports[_0xa314('0x27')]=function(_0x2663ea,_0x3fb414){return db[_0xa314('0x2c')][_0xa314('0x47')]({'where':{'id':_0x2663ea['params']['id']}})[_0xa314('0x26')](handleEntityNotFound(_0x3fb414,null))[_0xa314('0x26')](removeEntity(_0x3fb414,null))[_0xa314('0x44')](handleError(_0x3fb414,null));};exports['describe']=function(_0xa2c0d3,_0x2e620c){return db[_0xa314('0x2c')][_0xa314('0x4a')]()[_0xa314('0x26')](respondWithResult(_0x2e620c,null))[_0xa314('0x44')](handleError(_0x2e620c,null));};exports[_0xa314('0x4b')]=function(_0x1f7a8a,_0x4f8c64,_0x5df498){return db[_0xa314('0x4c')][_0xa314('0x1f')]({'where':{'ChatGroupId':_0x1f7a8a[_0xa314('0x4d')]['id'],'ToId':_0x1f7a8a[_0xa314('0x4e')]['id'],'read':![]}})[_0xa314('0x26')](function(_0x57c8ad){return{'id':_[_0xa314('0x4f')](_0x1f7a8a[_0xa314('0x4d')]['id']),'count':_0x57c8ad};})[_0xa314('0x26')](respondWithResult(_0x4f8c64,null))[_0xa314('0x44')](handleError(_0x4f8c64,null));};exports['addMembers']=function(_0x11b0b3,_0x4808e6,_0x34b4f1){return db['ChatGroup'][_0xa314('0x47')]({'where':{'id':_0x11b0b3[_0xa314('0x4d')]['id']}})[_0xa314('0x26')](handleEntityNotFound(_0x4808e6,null))[_0xa314('0x26')](function(_0xeee25a){if(_0xeee25a){return _0xeee25a[_0xa314('0x50')](_0x11b0b3['body']['ids'],_['omit'](_0x11b0b3[_0xa314('0x49')],[_0xa314('0x51'),'id'])||{});}})[_0xa314('0x26')](respondWithResult(_0x4808e6,null))[_0xa314('0x44')](handleError(_0x4808e6,null));};exports[_0xa314('0x52')]=function(_0x55b9bf,_0x7527f1,_0x815501){var _0x17d829={};var _0x317504={};var _0x50bd6f;var _0x183ad3;return db[_0xa314('0x2c')][_0xa314('0x53')]({'where':{'id':_0x55b9bf[_0xa314('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7527f1,null))[_0xa314('0x26')](function(_0x28d627){if(_0x28d627){_0x50bd6f=_0x28d627;_0x317504['model']=_[_0xa314('0x45')](db['User']['rawAttributes']);_0x317504[_0xa314('0x32')]=_[_0xa314('0x45')](_0x55b9bf[_0xa314('0x32')]);_0x317504[_0xa314('0x3b')]=_[_0xa314('0x31')](_0x317504[_0xa314('0x2f')],_0x317504[_0xa314('0x32')]);_0x17d829[_0xa314('0x33')]=_[_0xa314('0x31')](_0x317504['model'],qs[_0xa314('0x34')](_0x55b9bf[_0xa314('0x32')][_0xa314('0x34')]));_0x17d829[_0xa314('0x33')]=_0x17d829['attributes'][_0xa314('0x35')]?_0x17d829[_0xa314('0x33')]:_0x317504[_0xa314('0x2f')];_0x17d829[_0xa314('0x38')]=qs[_0xa314('0x39')](_0x55b9bf[_0xa314('0x32')][_0xa314('0x39')]);_0x17d829[_0xa314('0x3a')]=qs[_0xa314('0x3b')](_[_0xa314('0x3c')](_0x55b9bf[_0xa314('0x32')],_0x317504[_0xa314('0x3b')]));if(_0x55b9bf[_0xa314('0x32')][_0xa314('0x3d')]){_0x17d829[_0xa314('0x3a')]=_['merge'](_0x17d829[_0xa314('0x3a')],{'$or':_['map'](_0x17d829[_0xa314('0x33')],function(_0x5a259f){var _0x588751={};_0x588751[_0x5a259f]={'$like':'%'+_0x55b9bf[_0xa314('0x32')]['filter']+'%'};return _0x588751;})});}_0x17d829=_[_0xa314('0x3e')]({},_0x17d829,_0x55b9bf[_0xa314('0x40')]);return _0x50bd6f[_0xa314('0x52')](_0x17d829);}})[_0xa314('0x26')](function(_0x454961){if(_0x454961){_0x183ad3=_0x454961['length'];if(!_0x55b9bf['query']['hasOwnProperty'](_0xa314('0x37'))){_0x17d829[_0xa314('0x20')]=qs[_0xa314('0x20')](_0x55b9bf[_0xa314('0x32')][_0xa314('0x20')]);_0x17d829['offset']=qs[_0xa314('0x1d')](_0x55b9bf['query']['offset']);}return _0x50bd6f['getMembers'](_0x17d829);}})[_0xa314('0x26')](function(_0x4b56f6){if(_0x4b56f6){return _0x4b56f6?{'count':_0x183ad3,'rows':_0x4b56f6}:null;}})[_0xa314('0x26')](respondWithResult(_0x7527f1,null))[_0xa314('0x44')](handleError(_0x7527f1,null));};exports[_0xa314('0x54')]=function(_0x177e74,_0x3606dc,_0x811a8e){return db[_0xa314('0x2c')]['find']({'where':{'id':_0x177e74['params']['id']}})[_0xa314('0x26')](handleEntityNotFound(_0x3606dc,null))[_0xa314('0x26')](function(_0x17ee27){if(_0x17ee27){return _0x17ee27[_0xa314('0x54')](_0x177e74[_0xa314('0x32')]['ids']);}})[_0xa314('0x26')](respondWithStatusCode(_0x3606dc,null))[_0xa314('0x44')](handleError(_0x3606dc,null));};exports['addMessage']=function(_0xe79c3a,_0x6a80a0,_0xa8100f){if(_0xe79c3a[_0xa314('0x49')]['id']){delete _0xe79c3a['body']['id'];}return db[_0xa314('0x2c')][_0xa314('0x47')]({'where':{'id':_0xe79c3a[_0xa314('0x4d')]['id']}})[_0xa314('0x26')](handleEntityNotFound(_0x6a80a0,null))[_0xa314('0x26')](function(_0x4686bc){if(_0x4686bc){_0xe79c3a[_0xa314('0x49')][_0xa314('0x55')]=_0x4686bc['id'];return db[_0xa314('0x4c')][_0xa314('0x48')](_0xe79c3a['body']);}})['then'](respondWithResult(_0x6a80a0,null))['catch'](handleError(_0x6a80a0,null));};exports[_0xa314('0x56')]=function(_0x433e5f,_0xb6d41d,_0xdd0323){var _0x2cb44f={};var _0x5ba2e6={};var _0x2adbd7;var _0x257c7d;return db['ChatGroup'][_0xa314('0x53')]({'where':{'id':_0x433e5f[_0xa314('0x4d')]['id']}})[_0xa314('0x26')](handleEntityNotFound(_0xb6d41d,null))[_0xa314('0x26')](function(_0x40b945){if(_0x40b945){_0x2adbd7=_0x40b945;_0x5ba2e6['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x5ba2e6['query']=_[_0xa314('0x45')](_0x433e5f[_0xa314('0x32')]);_0x5ba2e6['filters']=_[_0xa314('0x31')](_0x5ba2e6[_0xa314('0x2f')],_0x5ba2e6['query']);_0x2cb44f[_0xa314('0x33')]=_['intersection'](_0x5ba2e6['model'],qs[_0xa314('0x34')](_0x433e5f['query']['fields']));_0x2cb44f[_0xa314('0x33')]=_0x2cb44f['attributes'][_0xa314('0x35')]?_0x2cb44f[_0xa314('0x33')]:_0x5ba2e6['model'];_0x2cb44f['order']=qs[_0xa314('0x39')](_0x433e5f[_0xa314('0x32')][_0xa314('0x39')]);_0x2cb44f[_0xa314('0x3a')]=qs[_0xa314('0x3b')](_[_0xa314('0x3c')](_0x433e5f[_0xa314('0x32')],_0x5ba2e6[_0xa314('0x3b')]));if(_0x433e5f[_0xa314('0x32')][_0xa314('0x3d')]){_0x2cb44f[_0xa314('0x3a')]=_[_0xa314('0x3e')](_0x2cb44f[_0xa314('0x3a')],{'$or':_['map'](_0x2cb44f[_0xa314('0x33')],function(_0x315e07){var _0x4e88ed={};_0x4e88ed[_0x315e07]={'$like':'%'+_0x433e5f[_0xa314('0x32')]['filter']+'%'};return _0x4e88ed;})});}if(_0x433e5f[_0xa314('0x32')]['$gte']){var _0x24049c=_0x433e5f[_0xa314('0x32')][_0xa314('0x57')][_0xa314('0x58')](',');var _0x4022ac={};_0x4022ac[_0x24049c[0x0]]={'$gte':moment(_0x24049c[0x1])[_0xa314('0x59')](_0xa314('0x5a'))};_0x2cb44f[_0xa314('0x3a')]=_[_0xa314('0x3e')](_0x2cb44f[_0xa314('0x3a')],_0x4022ac);}_0x2cb44f=_[_0xa314('0x3e')]({},_0x2cb44f,_0x433e5f[_0xa314('0x40')]);return _0x2adbd7[_0xa314('0x56')](_0x2cb44f);}})[_0xa314('0x26')](function(_0x3c6199){if(_0x3c6199){_0x257c7d=_0x3c6199[_0xa314('0x35')];if(!_0x433e5f[_0xa314('0x32')][_0xa314('0x36')]('nolimit')){_0x2cb44f[_0xa314('0x20')]=qs[_0xa314('0x20')](_0x433e5f[_0xa314('0x32')][_0xa314('0x20')]);_0x2cb44f['offset']=qs['offset'](_0x433e5f[_0xa314('0x32')][_0xa314('0x1d')]);}return _0x2adbd7[_0xa314('0x56')](_0x2cb44f);}})[_0xa314('0x26')](function(_0x337dde){if(_0x337dde){return _0x337dde?{'count':_0x257c7d,'rows':_0x337dde}:null;}})['then'](respondWithResult(_0xb6d41d,null))['catch'](handleError(_0xb6d41d,null));}; \ No newline at end of file +var _0x47ec=['jsforce','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','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','ChatGroup','length','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x1c9950,_0x145363){var _0x4c832f=function(_0x4c162a){while(--_0x4c162a){_0x1c9950['push'](_0x1c9950['shift']());}};_0x4c832f(++_0x145363);}(_0x47ec,0x1ce));var _0xc47e=function(_0x370e25,_0x3bebc8){_0x370e25=_0x370e25-0x0;var _0x171e29=_0x47ec[_0x370e25];return _0x171e29;};'use strict';var emlformat=require(_0xc47e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc47e('0x1'));var jsonpatch=require(_0xc47e('0x2'));var rp=require(_0xc47e('0x3'));var moment=require(_0xc47e('0x4'));var BPromise=require(_0xc47e('0x5'));var Mustache=require(_0xc47e('0x6'));var util=require(_0xc47e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc47e('0x8'));var ejs=require(_0xc47e('0x9'));var fs=require('fs');var fs_extra=require(_0xc47e('0xa'));var _=require('lodash');var squel=require(_0xc47e('0xb'));var crypto=require(_0xc47e('0xc'));var jsforce=require(_0xc47e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc47e('0xe'));var Papa=require(_0xc47e('0xf'));var Redis=require(_0xc47e('0x10'));var authService=require(_0xc47e('0x11'));var qs=require(_0xc47e('0x12'));var as=require(_0xc47e('0x13'));var hardwareService=require(_0xc47e('0x14'));var logger=require(_0xc47e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc47e('0x16'));var licenseUtil=require(_0xc47e('0x17'));var db=require(_0xc47e('0x18'))['db'];config[_0xc47e('0x19')]=_[_0xc47e('0x1a')](config[_0xc47e('0x19')],{'host':_0xc47e('0x1b'),'port':0x18eb});var socket=require(_0xc47e('0x1c'))(new Redis(config[_0xc47e('0x19')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x5bd49f,_0x1148d7){_0x1148d7=_0x1148d7||0xcc;return function(_0x2a84e1){if(_0x2a84e1){return _0x5bd49f[_0xc47e('0x1d')](_0x1148d7);}return _0x5bd49f[_0xc47e('0x1e')](_0x1148d7)['end']();};}function respondWithResult(_0x5e8728,_0x52d3ca){_0x52d3ca=_0x52d3ca||0xc8;return function(_0x144695){if(_0x144695){return _0x5e8728[_0xc47e('0x1e')](_0x52d3ca)[_0xc47e('0x1f')](_0x144695);}};}function respondWithFilteredResult(_0x37831e,_0x392640){return function(_0x361936){if(_0x361936){var _0xda744d=typeof _0x392640[_0xc47e('0x20')]===_0xc47e('0x21')&&typeof _0x392640[_0xc47e('0x22')]===_0xc47e('0x21');var _0x9425fd=_0x361936[_0xc47e('0x23')];var _0x26b0a5=_0xda744d?0x0:_0x392640['offset'];var _0x42fcdc=_0xda744d?_0x361936['count']:_0x392640[_0xc47e('0x20')]+_0x392640['limit'];var _0x84666;if(_0x42fcdc>=_0x9425fd){_0x42fcdc=_0x9425fd;_0x84666=0xc8;}else{_0x84666=0xce;}_0x37831e['status'](_0x84666);return _0x37831e[_0xc47e('0x24')](_0xc47e('0x25'),_0x26b0a5+'-'+_0x42fcdc+'/'+_0x9425fd)['json'](_0x361936);}return null;};}function patchUpdates(_0x30ae17){return function(_0x5d0826){try{jsonpatch[_0xc47e('0x26')](_0x5d0826,_0x30ae17,!![]);}catch(_0x345ce0){return BPromise[_0xc47e('0x27')](_0x345ce0);}return _0x5d0826[_0xc47e('0x28')]();};}function saveUpdates(_0x3b1130,_0x2c94b7){return function(_0x451759){if(_0x451759){return _0x451759[_0xc47e('0x29')](_0x3b1130)['then'](function(_0x443181){return _0x443181;});}return null;};}function removeEntity(_0x129636,_0x545240){return function(_0x39cf2e){if(_0x39cf2e){return _0x39cf2e[_0xc47e('0x2a')]()[_0xc47e('0x2b')](function(){_0x129636[_0xc47e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27dd05,_0xb5ebe0){return function(_0x142fbc){if(!_0x142fbc){_0x27dd05[_0xc47e('0x1d')](0x194);}return _0x142fbc;};}function handleError(_0x39e965,_0x52eafb){_0x52eafb=_0x52eafb||0x1f4;return function(_0x3b6102){logger['error'](_0x3b6102[_0xc47e('0x2c')]);if(_0x3b6102[_0xc47e('0x2d')]){delete _0x3b6102['name'];}_0x39e965['status'](_0x52eafb)['send'](_0x3b6102);};}exports[_0xc47e('0x2e')]=function(_0x126738,_0x3381fb){var _0x3dd495={},_0x34e91a={},_0x4997b7={'count':0x0,'rows':[]};var _0x3ea957=_[_0xc47e('0x2f')](db['ChatGroup'][_0xc47e('0x30')],function(_0x1d0ec9){return{'name':_0x1d0ec9[_0xc47e('0x31')],'type':_0x1d0ec9[_0xc47e('0x32')]['key']};});_0x34e91a['model']=_['map'](_0x3ea957,'name');_0x34e91a[_0xc47e('0x33')]=_['keys'](_0x126738[_0xc47e('0x33')]);_0x34e91a[_0xc47e('0x34')]=_[_0xc47e('0x35')](_0x34e91a[_0xc47e('0x36')],_0x34e91a[_0xc47e('0x33')]);_0x3dd495['attributes']=_['intersection'](_0x34e91a[_0xc47e('0x36')],qs[_0xc47e('0x37')](_0x126738['query'][_0xc47e('0x37')]));_0x3dd495[_0xc47e('0x38')]=_0x3dd495['attributes']['length']?_0x3dd495[_0xc47e('0x38')]:_0x34e91a[_0xc47e('0x36')];if(!_0x126738[_0xc47e('0x33')][_0xc47e('0x39')](_0xc47e('0x3a'))){_0x3dd495['limit']=qs['limit'](_0x126738['query'][_0xc47e('0x22')]);_0x3dd495['offset']=qs[_0xc47e('0x20')](_0x126738[_0xc47e('0x33')][_0xc47e('0x20')]);}_0x3dd495[_0xc47e('0x3b')]=qs[_0xc47e('0x3c')](_0x126738[_0xc47e('0x33')][_0xc47e('0x3c')]);_0x3dd495[_0xc47e('0x3d')]=qs[_0xc47e('0x34')](_[_0xc47e('0x3e')](_0x126738['query'],_0x34e91a[_0xc47e('0x34')]),_0x3ea957);if(_0x126738['query'][_0xc47e('0x3f')]){_0x3dd495['where']=_[_0xc47e('0x40')](_0x3dd495[_0xc47e('0x3d')],{'$or':_[_0xc47e('0x2f')](_0x3ea957,function(_0x43e206){if(_0x43e206['type']!==_0xc47e('0x41')){var _0x23ddc2={};_0x23ddc2[_0x43e206[_0xc47e('0x2d')]]={'$like':'%'+_0x126738[_0xc47e('0x33')][_0xc47e('0x3f')]+'%'};return _0x23ddc2;}})});}_0x3dd495=_[_0xc47e('0x40')]({},_0x3dd495,_0x126738[_0xc47e('0x42')]);var _0x205c66={'where':_0x3dd495[_0xc47e('0x3d')]};return db['ChatGroup'][_0xc47e('0x23')](_0x205c66)[_0xc47e('0x2b')](function(_0x270c17){_0x4997b7[_0xc47e('0x23')]=_0x270c17;if(_0x126738['query']['includeAll']){_0x3dd495[_0xc47e('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0xc47e('0x44')](_0x3dd495);})[_0xc47e('0x2b')](function(_0x26279c){_0x4997b7['rows']=_0x26279c;return _0x4997b7;})[_0xc47e('0x2b')](respondWithFilteredResult(_0x3381fb,_0x3dd495))[_0xc47e('0x45')](handleError(_0x3381fb,null));};exports[_0xc47e('0x46')]=function(_0x1b883d,_0x8eb52b){var _0x13993b={'raw':!![],'where':{'id':_0x1b883d[_0xc47e('0x47')]['id']}},_0x46e571={};_0x46e571['model']=_[_0xc47e('0x48')](db[_0xc47e('0x49')]['rawAttributes']);_0x46e571[_0xc47e('0x33')]=_[_0xc47e('0x48')](_0x1b883d[_0xc47e('0x33')]);_0x46e571[_0xc47e('0x34')]=_[_0xc47e('0x35')](_0x46e571['model'],_0x46e571[_0xc47e('0x33')]);_0x13993b[_0xc47e('0x38')]=_[_0xc47e('0x35')](_0x46e571[_0xc47e('0x36')],qs['fields'](_0x1b883d['query']['fields']));_0x13993b[_0xc47e('0x38')]=_0x13993b[_0xc47e('0x38')][_0xc47e('0x4a')]?_0x13993b['attributes']:_0x46e571[_0xc47e('0x36')];if(_0x1b883d['query']['includeAll']){_0x13993b['include']=[{'all':!![]}];}_0x13993b=_[_0xc47e('0x40')]({},_0x13993b,_0x1b883d[_0xc47e('0x42')]);return db[_0xc47e('0x49')][_0xc47e('0x4b')](_0x13993b)[_0xc47e('0x2b')](handleEntityNotFound(_0x8eb52b,null))[_0xc47e('0x2b')](respondWithResult(_0x8eb52b,null))[_0xc47e('0x45')](handleError(_0x8eb52b,null));};exports[_0xc47e('0x4c')]=function(_0x41160f,_0x45305b){return db[_0xc47e('0x49')][_0xc47e('0x4c')](_0x41160f[_0xc47e('0x4d')],{})[_0xc47e('0x2b')](respondWithResult(_0x45305b,0xc9))['catch'](handleError(_0x45305b,null));};exports[_0xc47e('0x29')]=function(_0x20786a,_0x4a68aa){if(_0x20786a[_0xc47e('0x4d')]['id']){delete _0x20786a['body']['id'];}return db[_0xc47e('0x49')]['find']({'where':{'id':_0x20786a[_0xc47e('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a68aa,null))['then'](saveUpdates(_0x20786a[_0xc47e('0x4d')],null))[_0xc47e('0x2b')](respondWithResult(_0x4a68aa,null))['catch'](handleError(_0x4a68aa,null));};exports[_0xc47e('0x2a')]=function(_0x5701a0,_0x5849af){return db[_0xc47e('0x49')][_0xc47e('0x4b')]({'where':{'id':_0x5701a0[_0xc47e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5849af,null))[_0xc47e('0x2b')](removeEntity(_0x5849af,null))[_0xc47e('0x45')](handleError(_0x5849af,null));};exports[_0xc47e('0x4e')]=function(_0xdaa048,_0x463594){return db[_0xc47e('0x49')][_0xc47e('0x4e')]()[_0xc47e('0x2b')](respondWithResult(_0x463594,null))[_0xc47e('0x45')](handleError(_0x463594,null));};exports[_0xc47e('0x4f')]=function(_0x6c19d4,_0x19995f,_0x436f5f){return db[_0xc47e('0x50')][_0xc47e('0x23')]({'where':{'ChatGroupId':_0x6c19d4[_0xc47e('0x47')]['id'],'ToId':_0x6c19d4['user']['id'],'read':![]}})[_0xc47e('0x2b')](function(_0x40dbe7){return{'id':_[_0xc47e('0x51')](_0x6c19d4[_0xc47e('0x47')]['id']),'count':_0x40dbe7};})[_0xc47e('0x2b')](respondWithResult(_0x19995f,null))[_0xc47e('0x45')](handleError(_0x19995f,null));};exports[_0xc47e('0x52')]=function(_0x16ebc4,_0x573559,_0x56b87d){return db[_0xc47e('0x49')]['find']({'where':{'id':_0x16ebc4[_0xc47e('0x47')]['id']}})['then'](handleEntityNotFound(_0x573559,null))['then'](function(_0x598d7e){if(_0x598d7e){return _0x598d7e['addMembers'](_0x16ebc4['body'][_0xc47e('0x53')],_[_0xc47e('0x54')](_0x16ebc4[_0xc47e('0x4d')],[_0xc47e('0x53'),'id'])||{});}})['then'](respondWithResult(_0x573559,null))['catch'](handleError(_0x573559,null));};exports[_0xc47e('0x55')]=function(_0x225adf,_0xb05dc6,_0x5ee147){var _0x561846={};var _0x2fe1d6={};var _0x568d12;var _0x5a8b56;return db[_0xc47e('0x49')][_0xc47e('0x56')]({'where':{'id':_0x225adf[_0xc47e('0x47')]['id']}})[_0xc47e('0x2b')](handleEntityNotFound(_0xb05dc6,null))[_0xc47e('0x2b')](function(_0x186eaa){if(_0x186eaa){_0x568d12=_0x186eaa;_0x2fe1d6[_0xc47e('0x36')]=_[_0xc47e('0x48')](db[_0xc47e('0x57')][_0xc47e('0x30')]);_0x2fe1d6[_0xc47e('0x33')]=_[_0xc47e('0x48')](_0x225adf[_0xc47e('0x33')]);_0x2fe1d6[_0xc47e('0x34')]=_[_0xc47e('0x35')](_0x2fe1d6['model'],_0x2fe1d6[_0xc47e('0x33')]);_0x561846['attributes']=_['intersection'](_0x2fe1d6['model'],qs[_0xc47e('0x37')](_0x225adf[_0xc47e('0x33')][_0xc47e('0x37')]));_0x561846[_0xc47e('0x38')]=_0x561846['attributes'][_0xc47e('0x4a')]?_0x561846[_0xc47e('0x38')]:_0x2fe1d6[_0xc47e('0x36')];_0x561846[_0xc47e('0x3b')]=qs['sort'](_0x225adf[_0xc47e('0x33')]['sort']);_0x561846[_0xc47e('0x3d')]=qs[_0xc47e('0x34')](_[_0xc47e('0x3e')](_0x225adf[_0xc47e('0x33')],_0x2fe1d6[_0xc47e('0x34')]));if(_0x225adf['query']['filter']){_0x561846['where']=_['merge'](_0x561846[_0xc47e('0x3d')],{'$or':_[_0xc47e('0x2f')](_0x561846[_0xc47e('0x38')],function(_0x1f63a7){var _0x539b63={};_0x539b63[_0x1f63a7]={'$like':'%'+_0x225adf[_0xc47e('0x33')]['filter']+'%'};return _0x539b63;})});}_0x561846=_['merge']({},_0x561846,_0x225adf[_0xc47e('0x42')]);return _0x568d12[_0xc47e('0x55')](_0x561846);}})[_0xc47e('0x2b')](function(_0x4b4509){if(_0x4b4509){_0x5a8b56=_0x4b4509[_0xc47e('0x4a')];if(!_0x225adf[_0xc47e('0x33')][_0xc47e('0x39')](_0xc47e('0x3a'))){_0x561846['limit']=qs[_0xc47e('0x22')](_0x225adf['query'][_0xc47e('0x22')]);_0x561846['offset']=qs[_0xc47e('0x20')](_0x225adf[_0xc47e('0x33')][_0xc47e('0x20')]);}return _0x568d12[_0xc47e('0x55')](_0x561846);}})['then'](function(_0x56bcf5){if(_0x56bcf5){return _0x56bcf5?{'count':_0x5a8b56,'rows':_0x56bcf5}:null;}})[_0xc47e('0x2b')](respondWithResult(_0xb05dc6,null))[_0xc47e('0x45')](handleError(_0xb05dc6,null));};exports[_0xc47e('0x58')]=function(_0x3c71d0,_0x6bd61e,_0x169f5f){return db[_0xc47e('0x49')][_0xc47e('0x4b')]({'where':{'id':_0x3c71d0[_0xc47e('0x47')]['id']}})['then'](handleEntityNotFound(_0x6bd61e,null))['then'](function(_0x4896da){if(_0x4896da){return _0x4896da[_0xc47e('0x58')](_0x3c71d0['query'][_0xc47e('0x53')]);}})['then'](respondWithStatusCode(_0x6bd61e,null))[_0xc47e('0x45')](handleError(_0x6bd61e,null));};exports[_0xc47e('0x59')]=function(_0x30d319,_0x108dea,_0x51a93b){if(_0x30d319[_0xc47e('0x4d')]['id']){delete _0x30d319[_0xc47e('0x4d')]['id'];}return db[_0xc47e('0x49')][_0xc47e('0x4b')]({'where':{'id':_0x30d319[_0xc47e('0x47')]['id']}})[_0xc47e('0x2b')](handleEntityNotFound(_0x108dea,null))[_0xc47e('0x2b')](function(_0x57915b){if(_0x57915b){_0x30d319['body'][_0xc47e('0x5a')]=_0x57915b['id'];return db[_0xc47e('0x50')][_0xc47e('0x4c')](_0x30d319[_0xc47e('0x4d')]);}})[_0xc47e('0x2b')](respondWithResult(_0x108dea,null))[_0xc47e('0x45')](handleError(_0x108dea,null));};exports[_0xc47e('0x5b')]=function(_0x275ba3,_0x47b50e,_0x5632a5){var _0x29bf2c={};var _0x44859c={};var _0x5c3548;var _0x483c18;return db[_0xc47e('0x49')][_0xc47e('0x56')]({'where':{'id':_0x275ba3[_0xc47e('0x47')]['id']}})[_0xc47e('0x2b')](handleEntityNotFound(_0x47b50e,null))['then'](function(_0x11a5f7){if(_0x11a5f7){_0x5c3548=_0x11a5f7;_0x44859c[_0xc47e('0x36')]=_[_0xc47e('0x48')](db[_0xc47e('0x50')][_0xc47e('0x30')]);_0x44859c[_0xc47e('0x33')]=_[_0xc47e('0x48')](_0x275ba3[_0xc47e('0x33')]);_0x44859c[_0xc47e('0x34')]=_[_0xc47e('0x35')](_0x44859c['model'],_0x44859c[_0xc47e('0x33')]);_0x29bf2c[_0xc47e('0x38')]=_[_0xc47e('0x35')](_0x44859c[_0xc47e('0x36')],qs[_0xc47e('0x37')](_0x275ba3[_0xc47e('0x33')]['fields']));_0x29bf2c[_0xc47e('0x38')]=_0x29bf2c[_0xc47e('0x38')][_0xc47e('0x4a')]?_0x29bf2c[_0xc47e('0x38')]:_0x44859c[_0xc47e('0x36')];_0x29bf2c['order']=qs[_0xc47e('0x3c')](_0x275ba3[_0xc47e('0x33')][_0xc47e('0x3c')]);_0x29bf2c[_0xc47e('0x3d')]=qs[_0xc47e('0x34')](_['pick'](_0x275ba3[_0xc47e('0x33')],_0x44859c[_0xc47e('0x34')]));if(_0x275ba3['query'][_0xc47e('0x3f')]){_0x29bf2c[_0xc47e('0x3d')]=_[_0xc47e('0x40')](_0x29bf2c[_0xc47e('0x3d')],{'$or':_[_0xc47e('0x2f')](_0x29bf2c['attributes'],function(_0x53a8d2){var _0x5c86c0={};_0x5c86c0[_0x53a8d2]={'$like':'%'+_0x275ba3[_0xc47e('0x33')][_0xc47e('0x3f')]+'%'};return _0x5c86c0;})});}if(_0x275ba3[_0xc47e('0x33')]['$gte']){var _0x283837=_0x275ba3['query']['$gte'][_0xc47e('0x5c')](',');var _0x23a106={};_0x23a106[_0x283837[0x0]]={'$gte':moment(_0x283837[0x1])[_0xc47e('0x5d')](_0xc47e('0x5e'))};_0x29bf2c[_0xc47e('0x3d')]=_[_0xc47e('0x40')](_0x29bf2c[_0xc47e('0x3d')],_0x23a106);}_0x29bf2c=_['merge']({},_0x29bf2c,_0x275ba3[_0xc47e('0x42')]);return _0x5c3548[_0xc47e('0x5b')](_0x29bf2c);}})[_0xc47e('0x2b')](function(_0x28c522){if(_0x28c522){_0x483c18=_0x28c522['length'];if(!_0x275ba3['query'][_0xc47e('0x39')](_0xc47e('0x3a'))){_0x29bf2c[_0xc47e('0x22')]=qs['limit'](_0x275ba3[_0xc47e('0x33')][_0xc47e('0x22')]);_0x29bf2c[_0xc47e('0x20')]=qs[_0xc47e('0x20')](_0x275ba3['query'][_0xc47e('0x20')]);}return _0x5c3548[_0xc47e('0x5b')](_0x29bf2c);}})['then'](function(_0x479519){if(_0x479519){return _0x479519?{'count':_0x483c18,'rows':_0x479519}:null;}})[_0xc47e('0x2b')](respondWithResult(_0x47b50e,null))[_0xc47e('0x45')](handleError(_0x47b50e,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 201286e..ac4f11f 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 _0x4328=['hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x17e37d,_0x48f61c){var _0x377184=function(_0x230740){while(--_0x230740){_0x17e37d['push'](_0x17e37d['shift']());}};_0x377184(++_0x48f61c);}(_0x4328,0x7b));var _0x8432=function(_0x176c90,_0x3172ef){_0x176c90=_0x176c90-0x0;var _0x45295e=_0x4328[_0x176c90];return _0x45295e;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x8432('0x0'))['db'][_0x8432('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8432('0x2')](0x0);var events={'afterCreate':_0x8432('0x3'),'afterUpdate':_0x8432('0x4'),'afterDestroy':_0x8432('0x5')};function emitEvent(_0x466b5e){return function(_0x5e1fee,_0x141dfd,_0x4703c4){ChatGroupEvents[_0x8432('0x6')](_0x466b5e+':'+_0x5e1fee['id'],_0x5e1fee);ChatGroupEvents[_0x8432('0x6')](_0x466b5e,_0x5e1fee);_0x4703c4(null);};}for(var e in events){if(events[_0x8432('0x7')](e)){var event=events[e];ChatGroup[_0x8432('0x8')](e,emitEvent(event));}}module[_0x8432('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xbabe=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1c7570,_0x1f8397){var _0x292ddd=function(_0x469ccc){while(--_0x469ccc){_0x1c7570['push'](_0x1c7570['shift']());}};_0x292ddd(++_0x1f8397);}(_0xbabe,0x12e));var _0xebab=function(_0x453c87,_0x189ff8){_0x453c87=_0x453c87-0x0;var _0x5a1583=_0xbabe[_0x453c87];return _0x5a1583;};'use strict';var EventEmitter=require(_0xebab('0x0'));var ChatGroup=require(_0xebab('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xebab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xebab('0x3')};function emitEvent(_0x4b62eb){return function(_0x368fab,_0x10634b,_0x5e163f){ChatGroupEvents[_0xebab('0x4')](_0x4b62eb+':'+_0x368fab['id'],_0x368fab);ChatGroupEvents['emit'](_0x4b62eb,_0x368fab);_0x5e163f(null);};}for(var e in events){if(events[_0xebab('0x5')](e)){var event=events[e];ChatGroup[_0xebab('0x6')](e,emitEvent(event));}}module[_0xebab('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 8a2098f..5002122 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 _0x9a67=['rimraf','../../config/environment','exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3ff601,_0x565c8){var _0x168e2f=function(_0x5b0645){while(--_0x5b0645){_0x3ff601['push'](_0x3ff601['shift']());}};_0x168e2f(++_0x565c8);}(_0x9a67,0x1cd));var _0x79a6=function(_0x1b3463,_0x43e1f5){_0x1b3463=_0x1b3463-0x0;var _0x29d544=_0x9a67[_0x1b3463];return _0x29d544;};'use strict';var _=require(_0x79a6('0x0'));var util=require(_0x79a6('0x1'));var logger=require(_0x79a6('0x2'))(_0x79a6('0x3'));var moment=require('moment');var BPromise=require(_0x79a6('0x4'));var rp=require(_0x79a6('0x5'));var fs=require('fs');var path=require(_0x79a6('0x6'));var rimraf=require(_0x79a6('0x7'));var config=require(_0x79a6('0x8'));var attributes=require('./chatGroup.attributes');module[_0x79a6('0x9')]=function(_0x6b768c,_0x2b969e){return _0x6b768c['define'](_0x79a6('0xa'),attributes,{'tableName':_0x79a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ef4=['bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','define','ChatGroup','util','api','moment'];(function(_0x5d2704,_0x199fed){var _0x3512ee=function(_0x46f1e6){while(--_0x46f1e6){_0x5d2704['push'](_0x5d2704['shift']());}};_0x3512ee(++_0x199fed);}(_0x7ef4,0x13d));var _0x47ef=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7ef4[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x47ef('0x0'));var logger=require('../../config/logger')(_0x47ef('0x1'));var moment=require(_0x47ef('0x2'));var BPromise=require(_0x47ef('0x3'));var rp=require(_0x47ef('0x4'));var fs=require('fs');var path=require(_0x47ef('0x5'));var rimraf=require('rimraf');var config=require(_0x47ef('0x6'));var attributes=require(_0x47ef('0x7'));module['exports']=function(_0x4f406c,_0x574361){return _0x4f406c[_0x47ef('0x8')](_0x47ef('0x9'),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 7ad200e..536533a 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 _0x42b0=['error','code','message','result','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x159ae7,_0x539c61){var _0xc57d9d=function(_0x10ad5b){while(--_0x10ad5b){_0x159ae7['push'](_0x159ae7['shift']());}};_0xc57d9d(++_0x539c61);}(_0x42b0,0xbc));var _0x042b=function(_0x277492,_0x199fd1){_0x277492=_0x277492-0x0;var _0x4b8c46=_0x42b0[_0x277492];return _0x4b8c46;};'use strict';var _=require(_0x042b('0x0'));var util=require(_0x042b('0x1'));var moment=require('moment');var BPromise=require(_0x042b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x042b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x042b('0x4'))(_0x042b('0x5'));var config=require(_0x042b('0x6'));var jayson=require(_0x042b('0x7'));var client=jayson[_0x042b('0x8')]['http']({'port':0x232a});config['redis']=_[_0x042b('0x9')](config[_0x042b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x042b('0xa')]));require('./chatGroup.socket')[_0x042b('0xb')](socket);function respondWithRpcPromise(_0x5686b7,_0x3f01e1,_0x2ba4c2){return new BPromise(function(_0x1d2796,_0x25dec5){return client[_0x042b('0xc')](_0x5686b7,_0x2ba4c2)[_0x042b('0xd')](function(_0x1bb764){logger[_0x042b('0xe')](_0x042b('0xf'),_0x3f01e1,_0x042b('0x10'));logger[_0x042b('0x11')](_0x042b('0x12'),_0x3f01e1,_0x042b('0x10'),JSON['stringify'](_0x1bb764));if(_0x1bb764[_0x042b('0x13')]){if(_0x1bb764['error'][_0x042b('0x14')]===0x1f4){logger['error'](_0x042b('0xf'),_0x3f01e1,_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);return _0x25dec5(_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);}logger[_0x042b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3f01e1,_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);return _0x1d2796(_0x1bb764[_0x042b('0x13')][_0x042b('0x15')]);}else{logger[_0x042b('0xe')]('ChatGroup,\x20%s,\x20%s',_0x3f01e1,_0x042b('0x10'));_0x1d2796(_0x1bb764[_0x042b('0x16')]['message']);}})['catch'](function(_0x25063e){logger[_0x042b('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3f01e1,_0x25063e);_0x25dec5(_0x25063e);});});} \ No newline at end of file +var _0x6347=['localhost','socket.io-emitter','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults'];(function(_0x2e35cf,_0x130603){var _0x9ea94=function(_0x5106bf){while(--_0x5106bf){_0x2e35cf['push'](_0x2e35cf['shift']());}};_0x9ea94(++_0x130603);}(_0x6347,0x1c9));var _0x7634=function(_0x4cbf38,_0x1fba7e){_0x4cbf38=_0x4cbf38-0x0;var _0x222d6d=_0x6347[_0x4cbf38];return _0x222d6d;};'use strict';var _=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var moment=require('moment');var BPromise=require(_0x7634('0x2'));var rs=require(_0x7634('0x3'));var fs=require('fs');var Redis=require(_0x7634('0x4'));var db=require(_0x7634('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7634('0x6'))('rpc');var config=require(_0x7634('0x7'));var jayson=require(_0x7634('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7634('0x9')]=_[_0x7634('0xa')](config[_0x7634('0x9')],{'host':_0x7634('0xb'),'port':0x18eb});var socket=require(_0x7634('0xc'))(new Redis(config[_0x7634('0x9')]));require('./chatGroup.socket')[_0x7634('0xd')](socket);function respondWithRpcPromise(_0x58f4c6,_0x5c32ca,_0x558499){return new BPromise(function(_0x2b1bef,_0x3e0a86){return client[_0x7634('0xe')](_0x58f4c6,_0x558499)[_0x7634('0xf')](function(_0x3aac0a){logger['info']('ChatGroup,\x20%s,\x20%s',_0x5c32ca,_0x7634('0x10'));logger[_0x7634('0x11')](_0x7634('0x12'),_0x5c32ca,_0x7634('0x10'),JSON[_0x7634('0x13')](_0x3aac0a));if(_0x3aac0a[_0x7634('0x14')]){if(_0x3aac0a[_0x7634('0x14')][_0x7634('0x15')]===0x1f4){logger['error'](_0x7634('0x16'),_0x5c32ca,_0x3aac0a[_0x7634('0x14')][_0x7634('0x17')]);return _0x3e0a86(_0x3aac0a[_0x7634('0x14')]['message']);}logger[_0x7634('0x14')]('ChatGroup,\x20%s,\x20%s',_0x5c32ca,_0x3aac0a[_0x7634('0x14')][_0x7634('0x17')]);return _0x2b1bef(_0x3aac0a[_0x7634('0x14')][_0x7634('0x17')]);}else{logger[_0x7634('0x18')](_0x7634('0x16'),_0x5c32ca,'request\x20sent');_0x2b1bef(_0x3aac0a[_0x7634('0x19')][_0x7634('0x17')]);}})['catch'](function(_0x3afe25){logger[_0x7634('0x14')]('ChatGroup,\x20%s,\x20%s',_0x5c32ca,_0x3afe25);_0x3e0a86(_0x3afe25);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 1fa1780..df6c666 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 _0xd587=['chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xd587,0x1b9));var _0x7d58=function(_0x16562d,_0x2c6e85){_0x16562d=_0x16562d-0x0;var _0x5a6525=_0xd587[_0x16562d];return _0x5a6525;};'use strict';var ChatGroupEvents=require(_0x7d58('0x0'));var events=[_0x7d58('0x1'),_0x7d58('0x2'),_0x7d58('0x3')];function createListener(_0x4e0e83,_0x508db2){return function(_0x53d22c){_0x508db2[_0x7d58('0x4')](_0x4e0e83,_0x53d22c);};}function removeListener(_0x592dc7,_0x189783){return function(){ChatGroupEvents[_0x7d58('0x5')](_0x592dc7,_0x189783);};}exports[_0x7d58('0x6')]=function(_0x239743){for(var _0x10e6c2=0x0,_0xbc6c19=events['length'];_0x10e6c2<_0xbc6c19;_0x10e6c2++){var _0x118b84=events[_0x10e6c2];var _0x3f6ac1=createListener(_0x7d58('0x7')+_0x118b84,_0x239743);ChatGroupEvents['on'](_0x118b84,_0x3f6ac1);}}; \ No newline at end of file +var _0xeedc=['register','length','chatGroup:','./chatGroup.events','remove','update','removeListener'];(function(_0xef904e,_0x330e3a){var _0x10199d=function(_0x4f3339){while(--_0x4f3339){_0xef904e['push'](_0xef904e['shift']());}};_0x10199d(++_0x330e3a);}(_0xeedc,0xb9));var _0xceed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeedc[_0x2dafbe];return _0x58a45a;};'use strict';var ChatGroupEvents=require(_0xceed('0x0'));var events=['save',_0xceed('0x1'),_0xceed('0x2')];function createListener(_0xeeb6e6,_0x188f5c){return function(_0x514a00){_0x188f5c['emit'](_0xeeb6e6,_0x514a00);};}function removeListener(_0x250efa,_0x3ba38c){return function(){ChatGroupEvents[_0xceed('0x3')](_0x250efa,_0x3ba38c);};}exports[_0xceed('0x4')]=function(_0x6ce910){for(var _0x15571c=0x0,_0x393ba9=events[_0xceed('0x5')];_0x15571c<_0x393ba9;_0x15571c++){var _0x315fee=events[_0x15571c];var _0x148aba=createListener(_0xceed('0x6')+_0x315fee,_0x6ce910);ChatGroupEvents['on'](_0x315fee,_0x148aba);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 40d04c3..e5b5ee8 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 _0x62f8=['post','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages'];(function(_0x150033,_0x54b089){var _0x122b82=function(_0x4142cb){while(--_0x4142cb){_0x150033['push'](_0x150033['shift']());}};_0x122b82(++_0x54b089);}(_0x62f8,0x12b));var _0x862f=function(_0x447d43,_0x67d9fc){_0x447d43=_0x447d43-0x0;var _0x4b032c=_0x62f8[_0x447d43];return _0x4b032c;};'use strict';var multer=require(_0x862f('0x0'));var util=require(_0x862f('0x1'));var path=require('path');var timeout=require(_0x862f('0x2'));var express=require(_0x862f('0x3'));var router=express[_0x862f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x862f('0x5'));var config=require(_0x862f('0x6'));var controller=require(_0x862f('0x7'));router['get']('/',auth[_0x862f('0x8')](),controller[_0x862f('0x9')]);router['get'](_0x862f('0xa'),auth[_0x862f('0x8')](),controller[_0x862f('0xb')]);router[_0x862f('0xc')](_0x862f('0xd'),auth['isAuthenticated'](),controller[_0x862f('0xe')]);router[_0x862f('0xc')](_0x862f('0xf'),auth[_0x862f('0x8')](),controller[_0x862f('0x10')]);router['get'](_0x862f('0x11'),auth[_0x862f('0x8')](),controller['getMembers']);router[_0x862f('0xc')](_0x862f('0x12'),auth['isAuthenticated'](),controller[_0x862f('0x13')]);router[_0x862f('0x14')]('/',auth[_0x862f('0x8')](),controller['create']);router[_0x862f('0x14')](_0x862f('0x11'),auth[_0x862f('0x8')](),controller[_0x862f('0x15')]);router['post'](_0x862f('0x12'),auth[_0x862f('0x8')](),controller[_0x862f('0x16')]);router[_0x862f('0x17')](_0x862f('0xd'),auth[_0x862f('0x8')](),controller[_0x862f('0x18')]);router[_0x862f('0x19')](_0x862f('0xd'),auth['isAuthenticated'](),controller[_0x862f('0x1a')]);router['delete'](_0x862f('0x11'),auth[_0x862f('0x8')](),controller[_0x862f('0x1b')]);module[_0x862f('0x1c')]=router; \ No newline at end of file +var _0x5429=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','delete','removeMembers'];(function(_0x4357de,_0xb6876d){var _0x16bc29=function(_0x1ed393){while(--_0x1ed393){_0x4357de['push'](_0x4357de['shift']());}};_0x16bc29(++_0xb6876d);}(_0x5429,0xa1));var _0x9542=function(_0x5c12ae,_0x29ab56){_0x5c12ae=_0x5c12ae-0x0;var _0x6b60d1=_0x5429[_0x5c12ae];return _0x6b60d1;};'use strict';var multer=require('multer');var util=require(_0x9542('0x0'));var path=require(_0x9542('0x1'));var timeout=require(_0x9542('0x2'));var express=require('express');var router=express[_0x9542('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9542('0x4'));var config=require(_0x9542('0x5'));var controller=require('./chatGroup.controller');router[_0x9542('0x6')]('/',auth[_0x9542('0x7')](),controller[_0x9542('0x8')]);router[_0x9542('0x6')](_0x9542('0x9'),auth[_0x9542('0x7')](),controller['describe']);router[_0x9542('0x6')](_0x9542('0xa'),auth[_0x9542('0x7')](),controller[_0x9542('0xb')]);router[_0x9542('0x6')]('/:id/unread',auth['isAuthenticated'](),controller[_0x9542('0xc')]);router[_0x9542('0x6')](_0x9542('0xd'),auth[_0x9542('0x7')](),controller[_0x9542('0xe')]);router['get'](_0x9542('0xf'),auth[_0x9542('0x7')](),controller[_0x9542('0x10')]);router[_0x9542('0x11')]('/',auth['isAuthenticated'](),controller[_0x9542('0x12')]);router[_0x9542('0x11')](_0x9542('0xd'),auth[_0x9542('0x7')](),controller['addMembers']);router[_0x9542('0x11')]('/:id/messages',auth[_0x9542('0x7')](),controller[_0x9542('0x13')]);router[_0x9542('0x14')](_0x9542('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x9542('0x15')]('/:id',auth[_0x9542('0x7')](),controller['destroy']);router[_0x9542('0x15')]('/:id/members',auth[_0x9542('0x7')](),controller[_0x9542('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index d68b1ba..7e9b6b6 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 _0xd732=['ENUM','out','sequelize','BOOLEAN','star','thumb','TEXT','DATE','STRING'];(function(_0x393fbe,_0x2b7744){var _0x55ea30=function(_0x5dbdc7){while(--_0x5dbdc7){_0x393fbe['push'](_0x393fbe['shift']());}};_0x55ea30(++_0x2b7744);}(_0xd732,0x18e));var _0x2d73=function(_0x2e9898,_0x396bf1){_0x2e9898=_0x2e9898-0x0;var _0x4527ad=_0xd732[_0x2e9898];return _0x4527ad;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2d73('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x2d73('0x2'),_0x2d73('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2d73('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2d73('0x5')]},'disposition':{'type':Sequelize[_0x2d73('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2d73('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2d73('0x6')]},'osName':{'type':Sequelize[_0x2d73('0x6')]},'osVersion':{'type':Sequelize[_0x2d73('0x6')]},'deviceModel':{'type':Sequelize[_0x2d73('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2d73('0x6')]},'referer':{'type':Sequelize[_0x2d73('0x4')]},'customerIp':{'type':Sequelize[_0x2d73('0x6')]},'formData':{'type':Sequelize[_0x2d73('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x2d73('0x5')]},'lastMsgAt':{'type':Sequelize[_0x2d73('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2d73('0x7')]('in',_0x2d73('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2d73('0x6')]},'customerPort':{'type':Sequelize[_0x2d73('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x2d73('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2d73('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xcce8=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','long'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcce8,0x1a5));var _0x8cce=function(_0x256f1b,_0x5e97c6){_0x256f1b=_0x256f1b-0x0;var _0x339576=_0xcce8[_0x256f1b];return _0x339576;};'use strict';var Sequelize=require(_0x8cce('0x0'));module[_0x8cce('0x1')]={'closed':{'type':Sequelize[_0x8cce('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8cce('0x3')]},'ratingType':{'type':Sequelize[_0x8cce('0x4')](_0x8cce('0x5'),_0x8cce('0x6')),'defaultValue':_0x8cce('0x5')},'ratingMessage':{'type':Sequelize[_0x8cce('0x7')]},'pathTranscript':{'type':Sequelize[_0x8cce('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8cce('0x8')]},'disposition':{'type':Sequelize[_0x8cce('0x9')]},'secondDisposition':{'type':Sequelize[_0x8cce('0x9')]},'thirdDisposition':{'type':Sequelize[_0x8cce('0x9')]},'note':{'type':Sequelize[_0x8cce('0x9')]},'browserName':{'type':Sequelize[_0x8cce('0x9')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8cce('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x8cce('0x7')]},'customerIp':{'type':Sequelize[_0x8cce('0x9')]},'formData':{'type':Sequelize['TEXT'](_0x8cce('0xa'))},'read1stAt':{'type':Sequelize[_0x8cce('0x8')]},'lastMsgAt':{'type':Sequelize[_0x8cce('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8cce('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8cce('0x9')]},'customerPort':{'type':Sequelize[_0x8cce('0x9')]},'vidaooSessionId':{'type':Sequelize[_0x8cce('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 84d0c6b..b5a9d2e 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 _0x86d2=['YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerPort','createReadStream','createWriteStream','value','views','downloadInteraction.ejs','createPdfFromHTML','download','err','unlinkSync','zip-dir','request-promise','moment','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','send','render','merge','contact','agent','account','map','ChatInteraction','rawAttributes','type','key','getOptions','user','show','model','keys','query','filters','attributes','intersection','fields','length','include','options','catch','create','body','find','params','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','fullname','email','isNull','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','findOne','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ContactId','UserId','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','includeAll','findAll','getMyMessages','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','files','server','attachments','firstName','lastName','read','Account','Owner','get','N.A.'];(function(_0x474115,_0xce7b8c){var _0x269482=function(_0x54dad8){while(--_0x54dad8){_0x474115['push'](_0x474115['shift']());}};_0x269482(++_0xce7b8c);}(_0x86d2,0x1a4));var _0x286d=function(_0x112c57,_0x531532){_0x112c57=_0x112c57-0x0;var _0x4129e4=_0x86d2[_0x112c57];return _0x4129e4;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x286d('0x0'));var rp=require(_0x286d('0x1'));var moment=require(_0x286d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x286d('0x3'));var util=require(_0x286d('0x4'));var path=require(_0x286d('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x286d('0x6'));var Redis=require(_0x286d('0x7'));var interaction=require(_0x286d('0x8'));var qs=require(_0x286d('0x9'));var pdf=require(_0x286d('0xa'));var logger=require(_0x286d('0xb'))(_0x286d('0xc'));var config=require(_0x286d('0xd'));var db=require(_0x286d('0xe'))['db'];config[_0x286d('0xf')]=_[_0x286d('0x10')](config[_0x286d('0xf')],{'host':_0x286d('0x11'),'port':0x18eb});var socket=require(_0x286d('0x12'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x286d('0x13'));var client=jayson[_0x286d('0x14')]['http']({'port':0x232b});var client9004=jayson['client'][_0x286d('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x1ce779,_0x2262ad,_0x2556e1,_0xd72e7c){return new BPromise(function(_0xf16b57,_0x5b1b22){var _0x239eb2=_0xd72e7c||client;return _0x239eb2[_0x286d('0x16')](_0x1ce779,_0x2556e1)['then'](function(_0x126e80){logger[_0x286d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2262ad,_0x286d('0x18'));logger[_0x286d('0x19')](_0x286d('0x1a'),_0x2262ad,_0x286d('0x18'),JSON[_0x286d('0x1b')](_0x126e80));if(_0x126e80[_0x286d('0x1c')]){if(_0x126e80[_0x286d('0x1c')][_0x286d('0x1d')]===0x1f4){logger[_0x286d('0x1c')](_0x286d('0x1e'),_0x2262ad,_0x126e80['error'][_0x286d('0x1f')]);return _0x5b1b22(_0x126e80[_0x286d('0x1c')]['message']);}logger[_0x286d('0x1c')](_0x286d('0x1e'),_0x2262ad,_0x126e80[_0x286d('0x1c')][_0x286d('0x1f')]);return _0xf16b57(_0x126e80[_0x286d('0x1c')][_0x286d('0x1f')]);}else{logger[_0x286d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2262ad,_0x286d('0x18'));_0xf16b57(_0x126e80[_0x286d('0x20')]['message']);}})['catch'](function(_0x137a83){logger[_0x286d('0x1c')](_0x286d('0x1e'),_0x2262ad,_0x137a83);_0x5b1b22(_0x137a83);});});}function respondWithStatusCode(_0x6f4f3,_0x5cb18c){_0x5cb18c=_0x5cb18c||0xcc;return function(_0x26f656){if(_0x26f656){return _0x6f4f3[_0x286d('0x21')](_0x5cb18c);}return _0x6f4f3[_0x286d('0x22')](_0x5cb18c)[_0x286d('0x23')]();};}function respondWithResult(_0x469db4,_0x186cd9){_0x186cd9=_0x186cd9||0xc8;return function(_0x505fd8){if(_0x505fd8){return _0x469db4[_0x286d('0x22')](_0x186cd9)[_0x286d('0x24')](_0x505fd8);}};}function respondWithFilteredResult(_0x1b255d,_0x2a0ed7){return function(_0x4220fa){if(_0x4220fa){var _0x2e67ee=typeof _0x2a0ed7['offset']===_0x286d('0x25')&&typeof _0x2a0ed7[_0x286d('0x26')]===_0x286d('0x25');var _0x41a454=_0x4220fa[_0x286d('0x27')];var _0x17dd32=_0x2e67ee?0x0:_0x2a0ed7[_0x286d('0x28')];var _0x6c8d06=_0x2e67ee?_0x4220fa[_0x286d('0x27')]:_0x2a0ed7[_0x286d('0x28')]+_0x2a0ed7[_0x286d('0x26')];var _0x1ca241;if(_0x6c8d06>=_0x41a454){_0x6c8d06=_0x41a454;_0x1ca241=0xc8;}else{_0x1ca241=0xce;}_0x1b255d['status'](_0x1ca241);return _0x1b255d[_0x286d('0x29')](_0x286d('0x2a'),_0x17dd32+'-'+_0x6c8d06+'/'+_0x41a454)[_0x286d('0x24')](_0x4220fa);}return null;};}function saveUpdates(_0x152e4d){return function(_0x182bbf){if(_0x182bbf){return _0x182bbf[_0x286d('0x2b')](_0x152e4d)[_0x286d('0x2c')](function(_0x40d9ec){return _0x40d9ec;});}return null;};}function removeEntity(_0x1cef26){return function(_0x56b26d){if(_0x56b26d){return _0x56b26d[_0x286d('0x2d')]()['then'](function(){_0x1cef26[_0x286d('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x585334){return function(_0x4f7530){if(!_0x4f7530){_0x585334['sendStatus'](0x194);}return _0x4f7530;};}function handleError(_0x2aec68,_0x1e668d){_0x1e668d=_0x1e668d||0x1f4;return function(_0x11715e){logger[_0x286d('0x1c')](_0x11715e[_0x286d('0x2e')]);if(_0x11715e[_0x286d('0x2f')]){delete _0x11715e['name'];}_0x2aec68[_0x286d('0x22')](_0x1e668d)[_0x286d('0x30')](_0x11715e);};}function getMustacheRender(_0x3fb0ce,_0x345f75){return Mustache[_0x286d('0x31')](_0x3fb0ce,_[_0x286d('0x32')](_0x345f75['body'],{'contact':_0x345f75[_0x286d('0x33')],'message':_0x345f75[_0x286d('0x1f')],'agent':_0x345f75[_0x286d('0x34')],'interaction':_0x345f75['interaction'],'account':_0x345f75[_0x286d('0x35')]}))||'';}exports['index']=function(_0x5a68b7,_0x611ebb){var _0x54821f={};var _0x2f4878=_[_0x286d('0x36')](db[_0x286d('0x37')][_0x286d('0x38')],function(_0x2a5817){return{'name':_0x2a5817['fieldName'],'type':_0x2a5817[_0x286d('0x39')][_0x286d('0x3a')]};});_0x54821f=qs[_0x286d('0x3b')](_0x2f4878,_0x5a68b7);return interaction['findAll']('chat',_0x5a68b7['query'],_0x5a68b7[_0x286d('0x3c')],_0x54821f,_0x2f4878)[_0x286d('0x2c')](respondWithFilteredResult(_0x611ebb,_0x54821f))['catch'](handleError(_0x611ebb,null));};exports[_0x286d('0x3d')]=function(_0x2a2696,_0x2372cb){var _0x86e9ed={'raw':![],'where':{'id':_0x2a2696['params']['id']}},_0x3dd1d5={};_0x3dd1d5[_0x286d('0x3e')]=_[_0x286d('0x3f')](db[_0x286d('0x37')][_0x286d('0x38')]);_0x3dd1d5[_0x286d('0x40')]=_[_0x286d('0x3f')](_0x2a2696[_0x286d('0x40')]);_0x3dd1d5[_0x286d('0x41')]=_['intersection'](_0x3dd1d5['model'],_0x3dd1d5[_0x286d('0x40')]);_0x86e9ed[_0x286d('0x42')]=_[_0x286d('0x43')](_0x3dd1d5['model'],qs[_0x286d('0x44')](_0x2a2696[_0x286d('0x40')][_0x286d('0x44')]));_0x86e9ed[_0x286d('0x42')]=_0x86e9ed[_0x286d('0x42')][_0x286d('0x45')]?_0x86e9ed[_0x286d('0x42')]:_0x3dd1d5['model'];if(_0x2a2696[_0x286d('0x40')]['includeAll']){_0x86e9ed[_0x286d('0x46')]=[{'all':!![]}];}_0x86e9ed=_[_0x286d('0x32')]({},_0x86e9ed,_0x2a2696[_0x286d('0x47')]);return db[_0x286d('0x37')]['find'](_0x86e9ed)['then'](handleEntityNotFound(_0x2372cb,null))['then'](respondWithResult(_0x2372cb,null))[_0x286d('0x48')](handleError(_0x2372cb,null));};exports[_0x286d('0x49')]=function(_0x43a3cf,_0x51bc31){return db[_0x286d('0x37')][_0x286d('0x49')](_0x43a3cf['body'],{})[_0x286d('0x2c')](respondWithResult(_0x51bc31,0xc9))[_0x286d('0x48')](handleError(_0x51bc31,null));};exports['update']=function(_0x19e035,_0x2bfbf7){if(_0x19e035['body']['id']){delete _0x19e035[_0x286d('0x4a')]['id'];}return db[_0x286d('0x37')][_0x286d('0x4b')]({'where':{'id':_0x19e035[_0x286d('0x4c')]['id']}})[_0x286d('0x2c')](handleEntityNotFound(_0x2bfbf7,null))[_0x286d('0x2c')](saveUpdates(_0x19e035[_0x286d('0x4a')],null))['then'](respondWithResult(_0x2bfbf7,null))[_0x286d('0x48')](handleError(_0x2bfbf7,null));};exports[_0x286d('0x2d')]=function(_0x2b369a,_0x4c7ab1){return db[_0x286d('0x37')][_0x286d('0x4b')]({'where':{'id':_0x2b369a[_0x286d('0x4c')]['id']}})[_0x286d('0x2c')](handleEntityNotFound(_0x4c7ab1,null))[_0x286d('0x2c')](removeEntity(_0x4c7ab1,null))[_0x286d('0x48')](handleError(_0x4c7ab1,null));};exports[_0x286d('0x4d')]=function(_0x223009,_0x3a5112){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x3a5112,null))[_0x286d('0x48')](handleError(_0x3a5112,null));};exports[_0x286d('0x4e')]=function(_0x3c7779,_0x509533){var _0x30b4d5=_0x3c7779[_0x286d('0x4c')]['id'];var _0x434ebc;var _0x2406e3;var _0x5c6787;return db['ChatInteraction']['findOne']({'where':{'id':_0x30b4d5}})['then'](function(_0x204d3e){_0x434ebc=_0x204d3e;return db[_0x286d('0x4f')]['findOne']({'where':{'id':_0x204d3e[_0x286d('0x50')]},'attributes':['id','vidaooApiKey',_0x286d('0x51'),_0x286d('0x52'),'vidaooNote',_0x286d('0x53')],'raw':!![]});})[_0x286d('0x2c')](function(_0x56fae4){if(_0x56fae4&&_0x56fae4[_0x286d('0x54')]&&_0x56fae4[_0x286d('0x51')]){_0x2406e3=_0x56fae4;var _0x466f92={'interaction':{'id':_0x30b4d5},'agent':{'id':_0x3c7779['user']['id'],'name':_0x3c7779[_0x286d('0x3c')][_0x286d('0x2f')],'fullname':_0x3c7779['user'][_0x286d('0x55')],'email':_0x3c7779[_0x286d('0x3c')][_0x286d('0x56')]},'contact':_0x3c7779['body'][_0x286d('0x33')],'account':_0x3c7779[_0x286d('0x4a')][_0x286d('0x35')]};var _0x570a70={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x56fae4[_0x286d('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c7779[_0x286d('0x3c')]['email']],'buttons':null,'topic':_0x2406e3[_0x286d('0x52')],'note':_[_0x286d('0x57')](_0x2406e3['vidaooNote'])?null:getMustacheRender(_0x2406e3['vidaooNote'],_0x466f92),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x286d('0x57')](_0x2406e3[_0x286d('0x53')])){var _0x335f35=getMustacheRender(_0x2406e3[_0x286d('0x53')],_0x466f92);var _0x2a0cec=JSON[_0x286d('0x58')](_0x335f35);_0x570a70['body']['metadata']=_0x2a0cec;}}catch(_0x2f25a1){throw new db[(_0x286d('0x59'))][(_0x286d('0x5a'))](_0x286d('0x5b'));}return rp(_0x570a70);}else{throw new db[(_0x286d('0x59'))][(_0x286d('0x5a'))](_0x286d('0x5c'));}})[_0x286d('0x2c')](function(_0x254aef){_0x5c6787=_0x254aef;if(_0x5c6787['id']){var _0x12067c={'body':_0x5c6787[_0x286d('0x5d')],'ChatWebsiteId':_0x2406e3['id'],'ChatInteractionId':_0x434ebc['id'],'direction':_0x286d('0x5e'),'UserId':_0x3c7779[_0x286d('0x3c')]['id']};return db[_0x286d('0x5f')]['create'](_0x12067c,{});}else{throw new db['Sequelize'][(_0x286d('0x5a'))](_0x286d('0x60'));}})[_0x286d('0x2c')](function(){return _0x434ebc['updateAttributes']({'vidaooSessionId':_0x5c6787['id']});})[_0x286d('0x2c')](respondWithResult(_0x509533,null))[_0x286d('0x48')](handleError(_0x509533,null));};exports[_0x286d('0x61')]=function(_0x50594b,_0x97e2ac){if(_0x50594b['body']['id']){delete _0x50594b[_0x286d('0x4a')]['id'];}return db[_0x286d('0x37')][_0x286d('0x4b')]({'where':{'id':_0x50594b[_0x286d('0x4c')]['id']},'include':[{'model':db[_0x286d('0x62')],'as':_0x286d('0x63')}]})[_0x286d('0x2c')](handleEntityNotFound(_0x97e2ac,null))[_0x286d('0x2c')](saveUpdates(_0x50594b[_0x286d('0x4a')],null))[_0x286d('0x2c')](respondWithResult(_0x97e2ac,null))[_0x286d('0x48')](handleError(_0x97e2ac,null));};exports[_0x286d('0x64')]=function(_0x225c84,_0x3eb1c9){if(_0x225c84['body']['id']){delete _0x225c84[_0x286d('0x4a')]['id'];}return db[_0x286d('0x37')]['find']({'where':{'id':_0x225c84['params']['id']}})[_0x286d('0x2c')](function(_0x46ed84){if(!_0x46ed84){logger[_0x286d('0x1c')](_0x286d('0x65'),_0x286d('0x64'),0x194,_0x286d('0x66'));_0x3eb1c9[_0x286d('0x21')](0x194);}else{if(_0x46ed84['UserId']){throw new db[(_0x286d('0x59'))]['ValidationError'](_0x286d('0x67'));}}return _0x46ed84;})['then'](function(_0xe07078){if(_0xe07078){return _0xe07078[_0x286d('0x2b')]({'closed':_0x225c84[_0x286d('0x4a')][_0x286d('0x68')],'disposition':_0x225c84[_0x286d('0x4a')][_0x286d('0x69')]})['then'](function(_0x377f2e){return _0x377f2e;});}})[_0x286d('0x2c')](function(){return respondWithRpcPromise(_0x286d('0x6a'),'abandon',_0x225c84['body'],client9004);})[_0x286d('0x2c')](respondWithResult(_0x3eb1c9,null))[_0x286d('0x48')](handleError(_0x3eb1c9,null));};exports[_0x286d('0x6b')]=function(_0x1b54bf,_0x4a9507){_0x1b54bf['body']['name']=_0x1b54bf[_0x286d('0x6c')][_0x286d('0x6d')];_0x1b54bf['body']['basename']=_0x1b54bf[_0x286d('0x6c')][_0x286d('0x6e')];_0x1b54bf[_0x286d('0x4a')][_0x286d('0x39')]=_0x1b54bf['file'][_0x286d('0x6f')];return db['Attachment'][_0x286d('0x49')](_0x1b54bf[_0x286d('0x4a')])['then'](respondWithResult(_0x4a9507,0xc9))[_0x286d('0x48')](handleError(_0x4a9507,null));};exports[_0x286d('0x70')]=function(_0x1fc270,_0x363e98){return db['ChatInteraction'][_0x286d('0x71')]({'where':{'id':_0x1fc270['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x363e98,null))[_0x286d('0x2c')](function(_0x49b105){if(_0x49b105){if(_0x49b105['closed']){return _0x363e98[_0x286d('0x22')](0x193)[_0x286d('0x24')]({'status':0x193,'message':_0x286d('0x72')});}return db[_0x286d('0x73')]['findOne']({'where':{'id':_0x1fc270['query'][_0x286d('0x74')]},'raw':!![]})[_0x286d('0x2c')](handleEntityNotFound(_0x363e98,null));}})[_0x286d('0x2c')](function(_0x5da8d1){if(_0x5da8d1){var _0xa2f386=_0x5da8d1[_0x286d('0x75')]!==null;var _0x3ef444=path[_0x286d('0x76')](config[_0x286d('0x77')],_0x286d('0x78'));if(_0xa2f386){_0x3ef444=path[_0x286d('0x76')](_0x3ef444,'offline-chat/');}var _0x2f8ef6=path[_0x286d('0x76')](_0x3ef444,_0x5da8d1[_0x286d('0x79')]);return _0x363e98['download'](_0x2f8ef6);}})[_0x286d('0x48')](handleError(_0x363e98,null));};exports['close']=function(_0xff1908,_0x4fa76e){var _0x5dcae6=null;var _0x2b4664=null;var _0x5a0e89=null;if(_0xff1908[_0x286d('0x4a')]['id']){delete _0xff1908[_0x286d('0x4a')]['id'];}if(_0xff1908['body']['mailTranscript']){_0x5a0e89=path[_0x286d('0x76')](config[_0x286d('0x77')],_0x286d('0x7a'),util[_0x286d('0x7b')](_0x286d('0x7c'),Date['now']()));_0xff1908[_0x286d('0x4a')][_0x286d('0x7d')]=_0x5a0e89;}return db[_0x286d('0x37')][_0x286d('0x4b')]({'where':{'id':_0xff1908[_0x286d('0x4c')]['id']},'include':[{'model':db[_0x286d('0x5f')],'as':_0x286d('0x7e'),'include':[{'model':db[_0x286d('0x7f')],'as':_0x286d('0x7f')}]}]})[_0x286d('0x2c')](handleEntityNotFound(_0x4fa76e,null))[_0x286d('0x2c')](saveUpdates(_0xff1908[_0x286d('0x4a')],null))['then'](function(_0x42433b){if(_0x42433b){_0x5dcae6=_0x42433b;return db['ChatWebsite']['find']({'where':{'id':_0x5dcae6[_0x286d('0x50')]}});}})['then'](function(_0x231429){if(_0x231429){_0x2b4664=_0x231429;return db[_0x286d('0x62')]['find']({'where':{'id':_0x5dcae6[_0x286d('0x80')]}});}})['then'](function(_0x32224e){if(_0x32224e){if(_0x5a0e89){var _0x426f04=null;for(var _0x5ee166=0x1;_0x5ee166<_0x5dcae6['Messages']['length'];++_0x5ee166){_0x426f04=_0x5dcae6[_0x286d('0x7e')][_0x5ee166];var _0x30a0c6=_0x426f04['UserId']?util[_0x286d('0x7b')]('%s%d',_0x2b4664['agentAlias'],_0x426f04[_0x286d('0x81')]):_0x286d('0x82');var _0x66d6ff=_0xff1908[_0x286d('0x4a')][_0x286d('0x83')]||util[_0x286d('0x7b')](_0x286d('0x84'),_0x286d('0x85'),_0x426f04[_0x286d('0x80')]);switch(_0x2b4664[_0x286d('0x86')]){case _0x286d('0x87'):_0x30a0c6=_0x426f04[_0x286d('0x81')]?util[_0x286d('0x7b')](_0x286d('0x84'),_0x2b4664[_0x286d('0x88')],_0x426f04[_0x286d('0x81')]):_0x286d('0x82');break;case'agent_alias':_0x30a0c6=_0x426f04[_0x286d('0x81')]?_0x426f04[_0x286d('0x7f')][_0x286d('0x89')]||_0x426f04[_0x286d('0x7f')]['fullname']:'System';break;case _0x286d('0x8a'):_0x30a0c6=_0x426f04[_0x286d('0x81')]?_0x426f04[_0x286d('0x7f')][_0x286d('0x55')]:'System';break;default:_0x30a0c6=_0x426f04['UserId']?util[_0x286d('0x7b')](_0x286d('0x84'),_0x2b4664[_0x286d('0x88')],_0x426f04['UserId']):_0x286d('0x82');}var _0x23cded=util[_0x286d('0x7b')](_0x286d('0x8b'),moment(_0x426f04[_0x286d('0x8c')])['format'](_0x286d('0x8d')),_0x426f04[_0x286d('0x8e')]==='in'?_0x66d6ff:_0x30a0c6,_0x426f04[_0x286d('0x4a')]);if(!_0x426f04[_0x286d('0x8f')]){fs[_0x286d('0x90')](_0x5a0e89,_0x23cded);}}return db['MailAccount'][_0x286d('0x71')]({'where':{'service':!![]},'include':[{'model':db[_0x286d('0x91')],'as':_0x286d('0x92'),'raw':!![],'include':[{'model':db[_0x286d('0x93')],'as':_0x286d('0x93'),'raw':!![]}]}]});}}})[_0x286d('0x2c')](function(_0x354776){if(!_0x354776||!_0x354776[_0x286d('0x92')]||!_0xff1908[_0x286d('0x4a')])return _0x5dcae6;var _0x1d4145=_0x354776[_0x286d('0x94')]();return respondWithRpcPromise('SendMail',_0x286d('0x95'),{'account':_0x1d4145,'message':{'from':util[_0x286d('0x7b')](_0x286d('0x96'),_0x354776[_0x286d('0x2f')],_0x354776['email']||_0x354776[_0x286d('0x92')][_0x286d('0x3c')]),'to':_0xff1908[_0x286d('0x4a')]['mailTranscript'],'subject':_0x286d('0x97'),'text':util[_0x286d('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xff1908['body']['mailTranscript']),'attachments':[{'path':_0x5a0e89}]}})[_0x286d('0x2c')](function(){return _0x5dcae6;})[_0x286d('0x48')](function(_0x5619b6){logger[_0x286d('0x1c')](_0x5619b6);});})[_0x286d('0x2c')](respondWithStatusCode(_0x4fa76e,0xc8))[_0x286d('0x48')](handleError(_0x4fa76e,null));};exports[_0x286d('0x98')]=function(_0x32a7df,_0x37093b){return db[_0x286d('0x5f')][_0x286d('0x4b')]({'where':{'id':_0x32a7df['params']['id']}})[_0x286d('0x2c')](handleEntityNotFound(_0x37093b,null))[_0x286d('0x2c')](function(_0xdbf39f){if(_0xdbf39f){return _0xdbf39f['addMessage'](_0x32a7df[_0x286d('0x4a')]['ids'],_['omit'](_0x32a7df[_0x286d('0x4a')],[_0x286d('0x99'),'id'])||{});}})[_0x286d('0x2c')](respondWithResult(_0x37093b,null))[_0x286d('0x48')](handleError(_0x37093b,null));};exports['getMessages']=function(_0x58bb0b,_0x2df8f0){var _0x27ff3f={'raw':![],'where':{}};var _0x4550a4={};var _0x37e180={'count':0x0,'rows':[]};return db[_0x286d('0x37')][_0x286d('0x71')]({'where':{'id':_0x58bb0b[_0x286d('0x4c')]['id']}})[_0x286d('0x2c')](handleEntityNotFound(_0x2df8f0,null))[_0x286d('0x2c')](function(_0x42e11e){if(_0x42e11e){_0x4550a4[_0x286d('0x3e')]=_['keys'](db[_0x286d('0x5f')][_0x286d('0x38')]);_0x4550a4[_0x286d('0x40')]=_[_0x286d('0x3f')](_0x58bb0b['query']);_0x4550a4[_0x286d('0x41')]=_['intersection'](_0x4550a4[_0x286d('0x3e')],_0x4550a4['query']);_0x27ff3f[_0x286d('0x42')]=_[_0x286d('0x43')](_0x4550a4['model'],qs[_0x286d('0x44')](_0x58bb0b[_0x286d('0x40')][_0x286d('0x44')]));_0x27ff3f[_0x286d('0x42')]=_0x27ff3f[_0x286d('0x42')]['length']?_0x27ff3f[_0x286d('0x42')]:_0x4550a4[_0x286d('0x3e')];if(!_0x58bb0b[_0x286d('0x40')][_0x286d('0x9a')](_0x286d('0x9b'))){_0x27ff3f[_0x286d('0x26')]=qs[_0x286d('0x26')](_0x58bb0b[_0x286d('0x40')][_0x286d('0x26')]);_0x27ff3f[_0x286d('0x28')]=qs[_0x286d('0x28')](_0x58bb0b[_0x286d('0x40')][_0x286d('0x28')]);}_0x27ff3f[_0x286d('0x9c')]=qs[_0x286d('0x9d')](_0x58bb0b['query']['sort']);_0x27ff3f[_0x286d('0x9e')]=qs[_0x286d('0x41')](_[_0x286d('0x9f')](_0x58bb0b[_0x286d('0x40')],_0x4550a4['filters']));_0x27ff3f[_0x286d('0x9e')][_0x286d('0xa0')]=_0x42e11e['id'];if(_0x58bb0b[_0x286d('0x40')][_0x286d('0xa1')]){_0x27ff3f['where']=_[_0x286d('0x32')](_0x27ff3f[_0x286d('0x9e')],{'$or':_[_0x286d('0x36')](_0x27ff3f['attributes'],function(_0x273969){var _0x47129f={};_0x47129f[_0x273969]={'$like':'%'+_0x58bb0b[_0x286d('0x40')][_0x286d('0xa1')]+'%'};return _0x47129f;})});}if(_0x58bb0b[_0x286d('0x40')][_0x286d('0xa2')]){var _0x1fcc90=_0x58bb0b[_0x286d('0x40')][_0x286d('0xa2')][_0x286d('0xa3')](',');var _0x54f588={};_0x54f588[_0x1fcc90[0x0]]={'$gte':moment(_0x1fcc90[0x1])[_0x286d('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x27ff3f[_0x286d('0x9e')]=_[_0x286d('0x32')](_0x27ff3f[_0x286d('0x9e')],_0x54f588);}_0x27ff3f=_['merge']({},_0x27ff3f,_0x58bb0b[_0x286d('0x47')]);return db[_0x286d('0x5f')]['count']({'where':_0x27ff3f[_0x286d('0x9e')]})[_0x286d('0x2c')](function(_0x519715){_0x37e180[_0x286d('0x27')]=_0x519715;if(_0x58bb0b[_0x286d('0x40')][_0x286d('0xa4')]){_0x27ff3f[_0x286d('0x46')]=[{'all':!![]}];}return db[_0x286d('0x5f')][_0x286d('0xa5')](_0x27ff3f);})[_0x286d('0x2c')](function(_0x17c042){_0x37e180['rows']=_0x17c042;return _0x37e180;});}})[_0x286d('0x2c')](respondWithFilteredResult(_0x2df8f0,_0x27ff3f))[_0x286d('0x48')](handleError(_0x2df8f0,null));};exports[_0x286d('0xa6')]=function(_0x3a1d71,_0x52dc5a){var _0x2dba4f={'where':{}},_0x145cf6={},_0x466988={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x286d('0x71')]({'where':{'id':_0x3a1d71[_0x286d('0x4c')]['id']}})[_0x286d('0x2c')](handleEntityNotFound(_0x52dc5a,null))[_0x286d('0x2c')](function(_0x2e041e){if(_0x2e041e){_0x145cf6['model']=_['keys'](db['ChatMessage'][_0x286d('0x38')]);_0x145cf6['query']=_[_0x286d('0x3f')](_0x3a1d71[_0x286d('0x40')]);_0x145cf6[_0x286d('0x41')]=_[_0x286d('0x43')](_0x145cf6[_0x286d('0x3e')],_0x145cf6['query']);_0x2dba4f[_0x286d('0x42')]=_[_0x286d('0x43')](_0x145cf6['model'],qs[_0x286d('0x44')](_0x3a1d71['query'][_0x286d('0x44')]));_0x2dba4f['attributes']=_0x2dba4f[_0x286d('0x42')][_0x286d('0x45')]?_0x2dba4f['attributes']:_0x145cf6[_0x286d('0x3e')];if(!_0x3a1d71[_0x286d('0x40')]['hasOwnProperty'](_0x286d('0x9b'))){_0x2dba4f[_0x286d('0x26')]=qs['limit'](_0x3a1d71['query'][_0x286d('0x26')]);_0x2dba4f[_0x286d('0x28')]=qs[_0x286d('0x28')](_0x3a1d71[_0x286d('0x40')][_0x286d('0x28')]);}_0x2dba4f[_0x286d('0x9c')]=qs[_0x286d('0x9d')](_0x3a1d71[_0x286d('0x40')][_0x286d('0x9d')]);_0x2dba4f[_0x286d('0x9e')]=qs['filters'](_[_0x286d('0x9f')](_0x3a1d71[_0x286d('0x40')],_0x145cf6[_0x286d('0x41')]));_0x2dba4f[_0x286d('0x9e')][_0x286d('0xa0')]=_0x2e041e['id'];if(_0x3a1d71[_0x286d('0x40')][_0x286d('0xa1')]){_0x2dba4f[_0x286d('0x9e')]=_['merge'](_0x2dba4f[_0x286d('0x9e')],{'$or':_[_0x286d('0x36')](_0x2dba4f['attributes'],function(_0x5e72ad){var _0x11d631={};_0x11d631[_0x5e72ad]={'$like':'%'+_0x3a1d71[_0x286d('0x40')]['filter']+'%'};return _0x11d631;})});}_0x2dba4f['where'][_0x286d('0x8f')]=![];if(_0x3a1d71[_0x286d('0x40')]['id']){_0x2dba4f[_0x286d('0x9e')]['id']={'$gt':_0x3a1d71[_0x286d('0x40')]['id']};}_0x2dba4f=_[_0x286d('0x32')]({},_0x2dba4f,_0x3a1d71['options']);return db[_0x286d('0x5f')][_0x286d('0x27')]({'where':_0x2dba4f[_0x286d('0x9e')]})[_0x286d('0x2c')](function(_0x4fdb55){_0x466988[_0x286d('0x27')]=_0x4fdb55;_0x2dba4f[_0x286d('0x46')]=[];if(_0x3a1d71[_0x286d('0x40')][_0x286d('0xa7')]){_0x2dba4f[_0x286d('0x46')][_0x286d('0xa8')]({'model':db[_0x286d('0x7f')],'as':_0x286d('0x7f'),'attributes':['id',_0x286d('0x55'),_0x286d('0x89')]});}if(_0x3a1d71[_0x286d('0x40')]['includeAll']){_0x2dba4f[_0x286d('0x46')]=[{'all':!![]}];}return db[_0x286d('0x5f')][_0x286d('0xa5')](_0x2dba4f);})[_0x286d('0x2c')](function(_0x333c50){_0x466988[_0x286d('0xa9')]=_0x333c50;return _0x466988;});}})[_0x286d('0x2c')](respondWithFilteredResult(_0x52dc5a,_0x2dba4f))[_0x286d('0x48')](handleError(_0x52dc5a,null));};exports[_0x286d('0xaa')]=function(_0x59c73a,_0x5d4638){return db[_0x286d('0x37')][_0x286d('0x4b')]({'where':{'id':_0x59c73a[_0x286d('0x4c')]['id']}})[_0x286d('0x2c')](handleEntityNotFound(_0x5d4638,null))[_0x286d('0x2c')](function(_0x87dfc5){if(_0x87dfc5){return _0x87dfc5[_0x286d('0xab')](_0x59c73a[_0x286d('0x4a')]['ids'],_['omit'](_0x59c73a[_0x286d('0x4a')],['ids','id'])||{})[_0x286d('0xac')](function(){return db[_0x286d('0xad')][_0x286d('0xa5')]({'attributes':['id',_0x286d('0x2f'),_0x286d('0xae')],'where':{'id':_0x59c73a[_0x286d('0x4a')][_0x286d('0x99')]}});})[_0x286d('0x2c')](function(_0x269ceb){socket[_0x286d('0xaf')]('chatInteractionTags:save',{'id':Number(_0x59c73a['params']['id']),'tags':_0x269ceb||[]});return{'id':Number(_0x59c73a[_0x286d('0x4c')]['id']),'tags':_0x269ceb||[]};});}})[_0x286d('0x2c')](respondWithResult(_0x5d4638,null))[_0x286d('0x48')](handleError(_0x5d4638,null));};exports[_0x286d('0xb0')]=function(_0x3c6b06,_0x9fb1b6){return db[_0x286d('0x37')][_0x286d('0x4b')]({'where':{'id':_0x3c6b06[_0x286d('0x4c')]['id']}})[_0x286d('0x2c')](handleEntityNotFound(_0x9fb1b6,null))[_0x286d('0x2c')](function(_0x237803){if(_0x237803){return _0x237803[_0x286d('0xb0')](_0x3c6b06[_0x286d('0x40')][_0x286d('0x99')]);}})[_0x286d('0x2c')](respondWithStatusCode(_0x9fb1b6,null))[_0x286d('0x48')](handleError(_0x9fb1b6,null));};exports['download']=function(_0x59d356,_0x1015d0){var _0x545786=moment()[_0x286d('0xb1')]()[_0x286d('0xb2')]();var _0x493295=path[_0x286d('0x76')](config['root'],'server',_0x286d('0xb3'),'tmp');var _0x4c88cb=path[_0x286d('0x76')](config[_0x286d('0x77')],_0x286d('0xb4'),_0x286d('0xb3'),_0x286d('0xb5'));var _0x302e78=path['join'](_0x493295,_0x545786);var _0x2bf339=util[_0x286d('0x7b')]('transcript-%d-%s.zip',_0x59d356[_0x286d('0x4c')]['id'],_0x545786);var _0x497bd4=path['join'](_0x493295,_0x2bf339);var _0x5241af=[];_0x5241af[_0x286d('0xa8')]({'model':db['User'],'as':_0x286d('0x7f'),'attributes':['id',_0x286d('0x55')],'raw':!![]});_0x5241af[_0x286d('0xa8')]({'model':db['CmContact'],'as':_0x286d('0x63'),'attributes':['id',_0x286d('0xb6'),_0x286d('0xb7')],'raw':!![]});if(_0x59d356[_0x286d('0x40')]['attachments']){_0x5241af['push']({'model':db[_0x286d('0x73')],'as':'Attachment','raw':!![]});}var _0x39d9df=[{'model':db[_0x286d('0x5f')],'as':_0x286d('0x7e'),'attributes':['id',_0x286d('0x4a'),'createdAt','direction',_0x286d('0x8f'),_0x286d('0xb8')],'include':_0x5241af}];_0x39d9df[_0x286d('0xa8')]({'model':db[_0x286d('0x4f')],'as':_0x286d('0xb9'),'attributes':['id',_0x286d('0x2f')]});_0x39d9df[_0x286d('0xa8')]({'model':db[_0x286d('0x7f')],'as':_0x286d('0xba'),'attributes':['id',_0x286d('0x55')]});return db[_0x286d('0x37')][_0x286d('0x4b')]({'where':{'id':_0x59d356['params']['id']},'include':_0x39d9df})[_0x286d('0x2c')](handleEntityNotFound(_0x1015d0,null))[_0x286d('0x2c')](function(_0x16072){if(_0x16072){var _0x16f3d3=_0x16072[_0x286d('0xbb')]({'plain':!![]});fs['mkdirSync'](_0x302e78);var _0x5ac9f1={'channel':'Chat','account':_0x16f3d3[_0x286d('0xb9')][_0x286d('0x2f')],'agent':_0x16f3d3[_0x286d('0xba')]?_0x16f3d3[_0x286d('0xba')][_0x286d('0x55')]:_0x286d('0xbc'),'createdAt':moment(_0x16f3d3[_0x286d('0x8c')])[_0x286d('0x7b')](_0x286d('0xbd'))[_0x286d('0xb2')](),'closedAt':_0x16f3d3[_0x286d('0x68')]?moment(_0x16f3d3[_0x286d('0xbe')])[_0x286d('0x7b')](_0x286d('0xbd'))[_0x286d('0xb2')]():'','disposition':_0x16f3d3[_0x286d('0x69')],'chatInfo':{'browser':_0x16f3d3[_0x286d('0xbf')],'os':_0x16f3d3['osName'],'referer':_0x16f3d3[_0x286d('0xc0')],'customerIp':_0x16f3d3['customerIp'],'customerPort':_0x16f3d3[_0x286d('0xc1')]?_0x16f3d3[_0x286d('0xc1')]:_0x286d('0xbc')},'messages':_(_0x16f3d3['Messages'])['tail']()[_0x286d('0xa1')]({'secret':![]})[_0x286d('0x36')](function(_0x15f8ca){if(_0x15f8ca[_0x286d('0x73')]){var _0x22efcb=path['join'](_0x4c88cb,_0x15f8ca['Attachment'][_0x286d('0x79')]);if(fs['existsSync'](_0x22efcb)){fs[_0x286d('0xc2')](_0x22efcb)['pipe'](fs[_0x286d('0xc3')](path[_0x286d('0x76')](_0x302e78,_0x15f8ca[_0x286d('0x73')]['basename'])));}}return{'date':moment(_0x15f8ca[_0x286d('0x8c')])[_0x286d('0x7b')](_0x286d('0xbd'))[_0x286d('0xb2')](),'sender':_0x15f8ca['direction']===_0x286d('0x5e')?_0x15f8ca[_0x286d('0x7f')]?_0x15f8ca['User'][_0x286d('0x55')]:_0x286d('0x82'):_0x15f8ca[_0x286d('0x63')][_0x286d('0xb6')]+(_0x15f8ca[_0x286d('0x63')][_0x286d('0xb7')]?'\x20'+_0x15f8ca['Contact'][_0x286d('0xb7')]:''),'body':_0x15f8ca[_0x286d('0x73')]?_0x15f8ca[_0x286d('0x73')]['basename']:_0x15f8ca['body'],'direction':_0x15f8ca[_0x286d('0x8e')]===_0x286d('0x5e')?'A':'C','secret':_0x15f8ca[_0x286d('0x8f')],'read':_0x15f8ca[_0x286d('0xb8')],'attachment':_0x15f8ca[_0x286d('0x73')]};})[_0x286d('0xc4')]()};return ejs['renderFile'](path[_0x286d('0x76')](config['root'],'server',_0x286d('0xc5'),_0x286d('0xc6')),{'interaction':_0x5ac9f1})[_0x286d('0x2c')](function(_0x1d52e4){var _0x397ab2=path[_0x286d('0x76')](_0x302e78,'transcript-'+_0x16f3d3['id']+'-'+_0x545786+'.pdf');var _0x5d54e6={'path':_0x397ab2,'channel':'Chat','interactionId':_0x16f3d3['id']};return pdf[_0x286d('0xc7')](_0x1d52e4,_0x5d54e6);})[_0x286d('0x2c')](function(){return new Promise(function(_0x1b05c5,_0x476835){zipdir(_0x302e78,{'saveTo':_0x497bd4},function(_0x54638e,_0x53a848){if(_0x54638e)return _0x476835(_0x54638e);return _0x1b05c5(_0x53a848);});})['then'](function(){return new BPromise(function(_0x3a3b11,_0x54e947){rimraf(_0x302e78,function(_0x3463c3){if(_0x3463c3)_0x54e947(_0x3463c3);return _0x3a3b11();});});})[_0x286d('0x2c')](function(){return _0x1015d0[_0x286d('0xc8')](_0x497bd4,_0x2bf339,function(_0x8710d6){if(_0x8710d6){logger[_0x286d('0x1c')](_0x286d('0xc9'),_0x8710d6);}else{fs[_0x286d('0xca')](_0x497bd4);}});});});}else{return _0x1015d0['sendStatus'](0xc8);}})[_0x286d('0x48')](handleError(_0x1015d0,null));}; \ No newline at end of file +var _0xb356=['pathTranscript','Messages','User','ChatWebsiteId','format','%s%d','agentAlias','System','customer','ContactId','agentIdentifier','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','order','ChatInteractionId','includeAgent','push','setTags','Tag','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','firstName','lastName','secret','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','tail','pipe','createWriteStream','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','update','destroy','stack','name','render','merge','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','query','user','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','options','create','body','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','isNull','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','find','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','mailTranscript','server/files/chat/upload/','transcript-%s.txt'];(function(_0x5e817d,_0x30abcd){var _0x140b02=function(_0x58df79){while(--_0x58df79){_0x5e817d['push'](_0x5e817d['shift']());}};_0x140b02(++_0x30abcd);}(_0xb356,0x1f4));var _0x6b35=function(_0x454457,_0x17819e){_0x454457=_0x454457-0x0;var _0x1d6f94=_0xb356[_0x454457];return _0x1d6f94;};'use strict';var rimraf=require(_0x6b35('0x0'));var zipdir=require(_0x6b35('0x1'));var rp=require('request-promise');var moment=require(_0x6b35('0x2'));var BPromise=require(_0x6b35('0x3'));var Mustache=require(_0x6b35('0x4'));var util=require(_0x6b35('0x5'));var path=require(_0x6b35('0x6'));var ejs=require(_0x6b35('0x7'));var fs=require('fs');var _=require(_0x6b35('0x8'));var Redis=require(_0x6b35('0x9'));var interaction=require(_0x6b35('0xa'));var qs=require(_0x6b35('0xb'));var pdf=require(_0x6b35('0xc'));var logger=require(_0x6b35('0xd'))(_0x6b35('0xe'));var config=require(_0x6b35('0xf'));var db=require(_0x6b35('0x10'))['db'];config[_0x6b35('0x11')]=_[_0x6b35('0x12')](config[_0x6b35('0x11')],{'host':_0x6b35('0x13'),'port':0x18eb});var socket=require(_0x6b35('0x14'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x6b35('0x15')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6b35('0x16')]['http']({'port':0x232b});var client9004=jayson[_0x6b35('0x16')][_0x6b35('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x455149,_0x437114,_0x48c070,_0x17c904){return new BPromise(function(_0x3429f3,_0x57db38){var _0x1a9fa=_0x17c904||client;return _0x1a9fa[_0x6b35('0x18')](_0x455149,_0x48c070)[_0x6b35('0x19')](function(_0x5b6c24){logger[_0x6b35('0x1a')](_0x6b35('0x1b'),_0x437114,_0x6b35('0x1c'));logger[_0x6b35('0x1d')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x437114,'request\x20sent',JSON[_0x6b35('0x1e')](_0x5b6c24));if(_0x5b6c24[_0x6b35('0x1f')]){if(_0x5b6c24[_0x6b35('0x1f')]['code']===0x1f4){logger[_0x6b35('0x1f')](_0x6b35('0x1b'),_0x437114,_0x5b6c24[_0x6b35('0x1f')][_0x6b35('0x20')]);return _0x57db38(_0x5b6c24['error']['message']);}logger[_0x6b35('0x1f')](_0x6b35('0x1b'),_0x437114,_0x5b6c24['error'][_0x6b35('0x20')]);return _0x3429f3(_0x5b6c24[_0x6b35('0x1f')][_0x6b35('0x20')]);}else{logger[_0x6b35('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x437114,_0x6b35('0x1c'));_0x3429f3(_0x5b6c24[_0x6b35('0x21')][_0x6b35('0x20')]);}})[_0x6b35('0x22')](function(_0x568e61){logger[_0x6b35('0x1f')](_0x6b35('0x1b'),_0x437114,_0x568e61);_0x57db38(_0x568e61);});});}function respondWithStatusCode(_0x4c2084,_0xd1dc7){_0xd1dc7=_0xd1dc7||0xcc;return function(_0x40a7af){if(_0x40a7af){return _0x4c2084[_0x6b35('0x23')](_0xd1dc7);}return _0x4c2084['status'](_0xd1dc7)[_0x6b35('0x24')]();};}function respondWithResult(_0x2efda7,_0x29a200){_0x29a200=_0x29a200||0xc8;return function(_0x269010){if(_0x269010){return _0x2efda7[_0x6b35('0x25')](_0x29a200)[_0x6b35('0x26')](_0x269010);}};}function respondWithFilteredResult(_0x2fcf1e,_0x397195){return function(_0x57d4ff){if(_0x57d4ff){var _0x529a10=typeof _0x397195[_0x6b35('0x27')]==='undefined'&&typeof _0x397195[_0x6b35('0x28')]==='undefined';var _0x54e8fe=_0x57d4ff[_0x6b35('0x29')];var _0x3e7591=_0x529a10?0x0:_0x397195[_0x6b35('0x27')];var _0x233d80=_0x529a10?_0x57d4ff[_0x6b35('0x29')]:_0x397195[_0x6b35('0x27')]+_0x397195[_0x6b35('0x28')];var _0x201f2e;if(_0x233d80>=_0x54e8fe){_0x233d80=_0x54e8fe;_0x201f2e=0xc8;}else{_0x201f2e=0xce;}_0x2fcf1e[_0x6b35('0x25')](_0x201f2e);return _0x2fcf1e[_0x6b35('0x2a')]('Content-Range',_0x3e7591+'-'+_0x233d80+'/'+_0x54e8fe)[_0x6b35('0x26')](_0x57d4ff);}return null;};}function saveUpdates(_0x2198bd){return function(_0x2582af){if(_0x2582af){return _0x2582af[_0x6b35('0x2b')](_0x2198bd)['then'](function(_0x6b1ee6){return _0x6b1ee6;});}return null;};}function removeEntity(_0x4e6128){return function(_0x4cc10f){if(_0x4cc10f){return _0x4cc10f[_0x6b35('0x2c')]()[_0x6b35('0x19')](function(){_0x4e6128['status'](0xcc)[_0x6b35('0x24')]();});}};}function handleEntityNotFound(_0x3203b4){return function(_0xe90254){if(!_0xe90254){_0x3203b4[_0x6b35('0x23')](0x194);}return _0xe90254;};}function handleError(_0x206e34,_0x24fa59){_0x24fa59=_0x24fa59||0x1f4;return function(_0x31aab7){logger[_0x6b35('0x1f')](_0x31aab7[_0x6b35('0x2d')]);if(_0x31aab7['name']){delete _0x31aab7[_0x6b35('0x2e')];}_0x206e34[_0x6b35('0x25')](_0x24fa59)['send'](_0x31aab7);};}function getMustacheRender(_0x36475f,_0x40a114){return Mustache[_0x6b35('0x2f')](_0x36475f,_[_0x6b35('0x30')](_0x40a114['body'],{'contact':_0x40a114[_0x6b35('0x31')],'message':_0x40a114[_0x6b35('0x20')],'agent':_0x40a114['agent'],'interaction':_0x40a114[_0x6b35('0x32')],'account':_0x40a114[_0x6b35('0x33')]}))||'';}exports[_0x6b35('0x34')]=function(_0x2a89f8,_0x904005){var _0x28e9bb={};var _0x2f9999=_[_0x6b35('0x35')](db[_0x6b35('0x36')][_0x6b35('0x37')],function(_0x1aa43c){return{'name':_0x1aa43c[_0x6b35('0x38')],'type':_0x1aa43c[_0x6b35('0x39')][_0x6b35('0x3a')]};});_0x28e9bb=qs[_0x6b35('0x3b')](_0x2f9999,_0x2a89f8);return interaction['findAll']('chat',_0x2a89f8[_0x6b35('0x3c')],_0x2a89f8[_0x6b35('0x3d')],_0x28e9bb,_0x2f9999)[_0x6b35('0x19')](respondWithFilteredResult(_0x904005,_0x28e9bb))[_0x6b35('0x22')](handleError(_0x904005,null));};exports[_0x6b35('0x3e')]=function(_0x284bfb,_0x3bb8ec){var _0x5aded6={'raw':![],'where':{'id':_0x284bfb[_0x6b35('0x3f')]['id']}},_0x1ce006={};_0x1ce006[_0x6b35('0x40')]=_[_0x6b35('0x41')](db[_0x6b35('0x36')][_0x6b35('0x37')]);_0x1ce006[_0x6b35('0x3c')]=_[_0x6b35('0x41')](_0x284bfb['query']);_0x1ce006[_0x6b35('0x42')]=_[_0x6b35('0x43')](_0x1ce006[_0x6b35('0x40')],_0x1ce006['query']);_0x5aded6['attributes']=_[_0x6b35('0x43')](_0x1ce006[_0x6b35('0x40')],qs['fields'](_0x284bfb[_0x6b35('0x3c')][_0x6b35('0x44')]));_0x5aded6['attributes']=_0x5aded6[_0x6b35('0x45')][_0x6b35('0x46')]?_0x5aded6[_0x6b35('0x45')]:_0x1ce006[_0x6b35('0x40')];if(_0x284bfb[_0x6b35('0x3c')][_0x6b35('0x47')]){_0x5aded6[_0x6b35('0x48')]=[{'all':!![]}];}_0x5aded6=_[_0x6b35('0x30')]({},_0x5aded6,_0x284bfb[_0x6b35('0x49')]);return db[_0x6b35('0x36')]['find'](_0x5aded6)[_0x6b35('0x19')](handleEntityNotFound(_0x3bb8ec,null))['then'](respondWithResult(_0x3bb8ec,null))[_0x6b35('0x22')](handleError(_0x3bb8ec,null));};exports[_0x6b35('0x4a')]=function(_0x10b709,_0x18c778){return db[_0x6b35('0x36')][_0x6b35('0x4a')](_0x10b709[_0x6b35('0x4b')],{})[_0x6b35('0x19')](respondWithResult(_0x18c778,0xc9))[_0x6b35('0x22')](handleError(_0x18c778,null));};exports['update']=function(_0x3718ef,_0x418b0f){if(_0x3718ef['body']['id']){delete _0x3718ef[_0x6b35('0x4b')]['id'];}return db[_0x6b35('0x36')]['find']({'where':{'id':_0x3718ef[_0x6b35('0x3f')]['id']}})[_0x6b35('0x19')](handleEntityNotFound(_0x418b0f,null))[_0x6b35('0x19')](saveUpdates(_0x3718ef[_0x6b35('0x4b')],null))[_0x6b35('0x19')](respondWithResult(_0x418b0f,null))[_0x6b35('0x22')](handleError(_0x418b0f,null));};exports[_0x6b35('0x2c')]=function(_0x5cdeba,_0x308718){return db['ChatInteraction']['find']({'where':{'id':_0x5cdeba[_0x6b35('0x3f')]['id']}})[_0x6b35('0x19')](handleEntityNotFound(_0x308718,null))[_0x6b35('0x19')](removeEntity(_0x308718,null))['catch'](handleError(_0x308718,null));};exports[_0x6b35('0x4c')]=function(_0x593fe6,_0x5e55b7){return db[_0x6b35('0x36')][_0x6b35('0x4c')]()[_0x6b35('0x19')](respondWithResult(_0x5e55b7,null))[_0x6b35('0x22')](handleError(_0x5e55b7,null));};exports[_0x6b35('0x4d')]=function(_0x47212c,_0x33b82a){var _0x5a3f5f=_0x47212c[_0x6b35('0x3f')]['id'];var _0x5dc06a;var _0x28aed2;var _0x1bd7dd;return db[_0x6b35('0x36')]['findOne']({'where':{'id':_0x5a3f5f}})[_0x6b35('0x19')](function(_0x260342){_0x5dc06a=_0x260342;return db[_0x6b35('0x4e')][_0x6b35('0x4f')]({'where':{'id':_0x260342['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x6b35('0x50'),_0x6b35('0x51'),_0x6b35('0x52'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x3b6558){if(_0x3b6558&&_0x3b6558['vidaooApiKey']&&_0x3b6558[_0x6b35('0x50')]){_0x28aed2=_0x3b6558;var _0x5c08f0={'interaction':{'id':_0x5a3f5f},'agent':{'id':_0x47212c[_0x6b35('0x3d')]['id'],'name':_0x47212c['user'][_0x6b35('0x2e')],'fullname':_0x47212c[_0x6b35('0x3d')]['fullname'],'email':_0x47212c[_0x6b35('0x3d')][_0x6b35('0x53')]},'contact':_0x47212c[_0x6b35('0x4b')][_0x6b35('0x31')],'account':_0x47212c[_0x6b35('0x4b')]['account']};var _0x5364fc={'rejectUnauthorized':![],'method':'POST','url':_0x6b35('0x54'),'headers':{'X-APIKEY':_0x3b6558[_0x6b35('0x55')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x47212c[_0x6b35('0x3d')][_0x6b35('0x53')]],'buttons':null,'topic':_0x28aed2[_0x6b35('0x51')],'note':_['isNull'](_0x28aed2['vidaooNote'])?null:getMustacheRender(_0x28aed2['vidaooNote'],_0x5c08f0),'metadata':null},'redirect':_0x6b35('0x56'),'json':!![]};try{if(!_[_0x6b35('0x57')](_0x28aed2[_0x6b35('0x58')])){var _0x2f183e=getMustacheRender(_0x28aed2[_0x6b35('0x58')],_0x5c08f0);var _0x18aaef=JSON[_0x6b35('0x59')](_0x2f183e);_0x5364fc[_0x6b35('0x4b')]['metadata']=_0x18aaef;}}catch(_0x4d571d){throw new db[(_0x6b35('0x5a'))][(_0x6b35('0x5b'))](_0x6b35('0x5c'));}return rp(_0x5364fc);}else{throw new db[(_0x6b35('0x5a'))][(_0x6b35('0x5b'))](_0x6b35('0x5d'));}})[_0x6b35('0x19')](function(_0x4c2df8){_0x1bd7dd=_0x4c2df8;if(_0x1bd7dd['id']){var _0x15f2be={'body':_0x1bd7dd[_0x6b35('0x5e')],'ChatWebsiteId':_0x28aed2['id'],'ChatInteractionId':_0x5dc06a['id'],'direction':_0x6b35('0x5f'),'UserId':_0x47212c['user']['id']};return db[_0x6b35('0x60')][_0x6b35('0x4a')](_0x15f2be,{});}else{throw new db[(_0x6b35('0x5a'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x6b35('0x19')](function(){return _0x5dc06a[_0x6b35('0x61')]({'vidaooSessionId':_0x1bd7dd['id']});})[_0x6b35('0x19')](respondWithResult(_0x33b82a,null))['catch'](handleError(_0x33b82a,null));};exports['customUpdate']=function(_0x508189,_0x3a7cac){if(_0x508189[_0x6b35('0x4b')]['id']){delete _0x508189[_0x6b35('0x4b')]['id'];}return db[_0x6b35('0x36')][_0x6b35('0x62')]({'where':{'id':_0x508189[_0x6b35('0x3f')]['id']},'include':[{'model':db[_0x6b35('0x63')],'as':_0x6b35('0x64')}]})[_0x6b35('0x19')](handleEntityNotFound(_0x3a7cac,null))[_0x6b35('0x19')](saveUpdates(_0x508189['body'],null))[_0x6b35('0x19')](respondWithResult(_0x3a7cac,null))[_0x6b35('0x22')](handleError(_0x3a7cac,null));};exports[_0x6b35('0x65')]=function(_0xe81dd,_0x392680){if(_0xe81dd[_0x6b35('0x4b')]['id']){delete _0xe81dd[_0x6b35('0x4b')]['id'];}return db['ChatInteraction'][_0x6b35('0x62')]({'where':{'id':_0xe81dd[_0x6b35('0x3f')]['id']}})[_0x6b35('0x19')](function(_0x188337){if(!_0x188337){logger['error'](_0x6b35('0x66'),_0x6b35('0x65'),0x194,_0x6b35('0x67'));_0x392680['sendStatus'](0x194);}else{if(_0x188337[_0x6b35('0x68')]){throw new db[(_0x6b35('0x5a'))]['ValidationError'](_0x6b35('0x69'));}}return _0x188337;})[_0x6b35('0x19')](function(_0x43a5cc){if(_0x43a5cc){return _0x43a5cc['update']({'closed':_0xe81dd[_0x6b35('0x4b')][_0x6b35('0x6a')],'disposition':_0xe81dd['body'][_0x6b35('0x6b')]})[_0x6b35('0x19')](function(_0x3f9e42){return _0x3f9e42;});}})[_0x6b35('0x19')](function(){return respondWithRpcPromise(_0x6b35('0x6c'),_0x6b35('0x65'),_0xe81dd[_0x6b35('0x4b')],client9004);})['then'](respondWithResult(_0x392680,null))['catch'](handleError(_0x392680,null));};exports[_0x6b35('0x6d')]=function(_0x1e19f0,_0x4acd4c){_0x1e19f0[_0x6b35('0x4b')][_0x6b35('0x2e')]=_0x1e19f0['file'][_0x6b35('0x6e')];_0x1e19f0[_0x6b35('0x4b')][_0x6b35('0x6f')]=_0x1e19f0[_0x6b35('0x70')]['filename'];_0x1e19f0[_0x6b35('0x4b')]['type']=_0x1e19f0[_0x6b35('0x70')][_0x6b35('0x71')];return db[_0x6b35('0x72')][_0x6b35('0x4a')](_0x1e19f0['body'])[_0x6b35('0x19')](respondWithResult(_0x4acd4c,0xc9))['catch'](handleError(_0x4acd4c,null));};exports[_0x6b35('0x73')]=function(_0x54b4a8,_0xe8022c){return db[_0x6b35('0x36')][_0x6b35('0x4f')]({'where':{'id':_0x54b4a8[_0x6b35('0x3f')]['id']},'raw':!![]})[_0x6b35('0x19')](handleEntityNotFound(_0xe8022c,null))[_0x6b35('0x19')](function(_0x4a2f4e){if(_0x4a2f4e){if(_0x4a2f4e[_0x6b35('0x6a')]){return _0xe8022c[_0x6b35('0x25')](0x193)[_0x6b35('0x26')]({'status':0x193,'message':'Unauthorized'});}return db[_0x6b35('0x72')][_0x6b35('0x4f')]({'where':{'id':_0x54b4a8[_0x6b35('0x3c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0xe8022c,null));}})[_0x6b35('0x19')](function(_0x382a4f){if(_0x382a4f){var _0x384e8f=_0x382a4f[_0x6b35('0x74')]!==null;var _0x54dc8c=path[_0x6b35('0x75')](config[_0x6b35('0x76')],_0x6b35('0x77'));if(_0x384e8f){_0x54dc8c=path[_0x6b35('0x75')](_0x54dc8c,_0x6b35('0x78'));}var _0x2cdd5d=path[_0x6b35('0x75')](_0x54dc8c,_0x382a4f['basename']);return _0xe8022c['download'](_0x2cdd5d);}})[_0x6b35('0x22')](handleError(_0xe8022c,null));};exports['close']=function(_0x335f2e,_0x1f8fab){var _0x2e8606=null;var _0x5cb416=null;var _0x586d79=null;if(_0x335f2e[_0x6b35('0x4b')]['id']){delete _0x335f2e[_0x6b35('0x4b')]['id'];}if(_0x335f2e[_0x6b35('0x4b')][_0x6b35('0x79')]){_0x586d79=path[_0x6b35('0x75')](config[_0x6b35('0x76')],_0x6b35('0x7a'),util['format'](_0x6b35('0x7b'),Date['now']()));_0x335f2e['body'][_0x6b35('0x7c')]=_0x586d79;}return db[_0x6b35('0x36')][_0x6b35('0x62')]({'where':{'id':_0x335f2e[_0x6b35('0x3f')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x6b35('0x7d'),'include':[{'model':db[_0x6b35('0x7e')],'as':_0x6b35('0x7e')}]}]})['then'](handleEntityNotFound(_0x1f8fab,null))['then'](saveUpdates(_0x335f2e['body'],null))[_0x6b35('0x19')](function(_0x1cf4ef){if(_0x1cf4ef){_0x2e8606=_0x1cf4ef;return db['ChatWebsite'][_0x6b35('0x62')]({'where':{'id':_0x2e8606[_0x6b35('0x7f')]}});}})[_0x6b35('0x19')](function(_0x21f805){if(_0x21f805){_0x5cb416=_0x21f805;return db['CmContact'][_0x6b35('0x62')]({'where':{'id':_0x2e8606['ContactId']}});}})[_0x6b35('0x19')](function(_0x54ef7e){if(_0x54ef7e){if(_0x586d79){var _0x14c104=null;for(var _0x37f1b2=0x1;_0x37f1b2<_0x2e8606[_0x6b35('0x7d')][_0x6b35('0x46')];++_0x37f1b2){_0x14c104=_0x2e8606[_0x6b35('0x7d')][_0x37f1b2];var _0x35578a=_0x14c104[_0x6b35('0x68')]?util[_0x6b35('0x80')](_0x6b35('0x81'),_0x5cb416[_0x6b35('0x82')],_0x14c104[_0x6b35('0x68')]):_0x6b35('0x83');var _0x2edd09=_0x335f2e[_0x6b35('0x4b')][_0x6b35('0x84')]||util[_0x6b35('0x80')]('%s%d','Visitor',_0x14c104[_0x6b35('0x85')]);switch(_0x5cb416[_0x6b35('0x86')]){case'website_alias':_0x35578a=_0x14c104[_0x6b35('0x68')]?util[_0x6b35('0x80')]('%s%d',_0x5cb416['agentAlias'],_0x14c104[_0x6b35('0x68')]):_0x6b35('0x83');break;case _0x6b35('0x87'):_0x35578a=_0x14c104[_0x6b35('0x68')]?_0x14c104[_0x6b35('0x7e')][_0x6b35('0x88')]||_0x14c104[_0x6b35('0x7e')]['fullname']:_0x6b35('0x83');break;case'agent_fullname':_0x35578a=_0x14c104[_0x6b35('0x68')]?_0x14c104[_0x6b35('0x7e')][_0x6b35('0x89')]:'System';break;default:_0x35578a=_0x14c104[_0x6b35('0x68')]?util[_0x6b35('0x80')](_0x6b35('0x81'),_0x5cb416[_0x6b35('0x82')],_0x14c104[_0x6b35('0x68')]):_0x6b35('0x83');}var _0x5edd35=util[_0x6b35('0x80')](_0x6b35('0x8a'),moment(_0x14c104[_0x6b35('0x8b')])[_0x6b35('0x80')](_0x6b35('0x8c')),_0x14c104[_0x6b35('0x8d')]==='in'?_0x2edd09:_0x35578a,_0x14c104['body']);if(!_0x14c104['secret']){fs[_0x6b35('0x8e')](_0x586d79,_0x5edd35);}}return db[_0x6b35('0x8f')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6b35('0x90')],'as':_0x6b35('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6b35('0x92'),'raw':!![]}]}]});}}})[_0x6b35('0x19')](function(_0x4cf9b2){if(!_0x4cf9b2||!_0x4cf9b2[_0x6b35('0x91')]||!_0x335f2e[_0x6b35('0x4b')])return _0x2e8606;var _0x47e4b7=_0x4cf9b2[_0x6b35('0x93')]();return respondWithRpcPromise('SendMail',_0x6b35('0x94'),{'account':_0x47e4b7,'message':{'from':util[_0x6b35('0x80')](_0x6b35('0x95'),_0x4cf9b2[_0x6b35('0x2e')],_0x4cf9b2['email']||_0x4cf9b2[_0x6b35('0x91')][_0x6b35('0x3d')]),'to':_0x335f2e[_0x6b35('0x4b')][_0x6b35('0x79')],'subject':_0x6b35('0x96'),'text':util[_0x6b35('0x80')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x335f2e['body'][_0x6b35('0x79')]),'attachments':[{'path':_0x586d79}]}})[_0x6b35('0x19')](function(){return _0x2e8606;})[_0x6b35('0x22')](function(_0x568934){logger[_0x6b35('0x1f')](_0x568934);});})['then'](respondWithStatusCode(_0x1f8fab,0xc8))[_0x6b35('0x22')](handleError(_0x1f8fab,null));};exports[_0x6b35('0x97')]=function(_0x3da3f8,_0xaf614){return db[_0x6b35('0x60')][_0x6b35('0x62')]({'where':{'id':_0x3da3f8['params']['id']}})[_0x6b35('0x19')](handleEntityNotFound(_0xaf614,null))[_0x6b35('0x19')](function(_0x572fd4){if(_0x572fd4){return _0x572fd4['addMessage'](_0x3da3f8['body']['ids'],_[_0x6b35('0x98')](_0x3da3f8[_0x6b35('0x4b')],[_0x6b35('0x99'),'id'])||{});}})[_0x6b35('0x19')](respondWithResult(_0xaf614,null))[_0x6b35('0x22')](handleError(_0xaf614,null));};exports[_0x6b35('0x9a')]=function(_0xdecc6f,_0x537f31){var _0x286dc4={'raw':![],'where':{}};var _0x57e941={};var _0x506b73={'count':0x0,'rows':[]};return db[_0x6b35('0x36')][_0x6b35('0x4f')]({'where':{'id':_0xdecc6f['params']['id']}})[_0x6b35('0x19')](handleEntityNotFound(_0x537f31,null))[_0x6b35('0x19')](function(_0x534107){if(_0x534107){_0x57e941[_0x6b35('0x40')]=_[_0x6b35('0x41')](db[_0x6b35('0x60')][_0x6b35('0x37')]);_0x57e941['query']=_[_0x6b35('0x41')](_0xdecc6f['query']);_0x57e941['filters']=_[_0x6b35('0x43')](_0x57e941[_0x6b35('0x40')],_0x57e941[_0x6b35('0x3c')]);_0x286dc4[_0x6b35('0x45')]=_[_0x6b35('0x43')](_0x57e941['model'],qs['fields'](_0xdecc6f[_0x6b35('0x3c')]['fields']));_0x286dc4[_0x6b35('0x45')]=_0x286dc4[_0x6b35('0x45')]['length']?_0x286dc4[_0x6b35('0x45')]:_0x57e941[_0x6b35('0x40')];if(!_0xdecc6f[_0x6b35('0x3c')][_0x6b35('0x9b')](_0x6b35('0x9c'))){_0x286dc4[_0x6b35('0x28')]=qs['limit'](_0xdecc6f[_0x6b35('0x3c')][_0x6b35('0x28')]);_0x286dc4[_0x6b35('0x27')]=qs['offset'](_0xdecc6f[_0x6b35('0x3c')][_0x6b35('0x27')]);}_0x286dc4['order']=qs[_0x6b35('0x9d')](_0xdecc6f[_0x6b35('0x3c')][_0x6b35('0x9d')]);_0x286dc4[_0x6b35('0x9e')]=qs['filters'](_[_0x6b35('0x9f')](_0xdecc6f['query'],_0x57e941[_0x6b35('0x42')]));_0x286dc4['where']['ChatInteractionId']=_0x534107['id'];if(_0xdecc6f[_0x6b35('0x3c')]['filter']){_0x286dc4['where']=_['merge'](_0x286dc4[_0x6b35('0x9e')],{'$or':_[_0x6b35('0x35')](_0x286dc4[_0x6b35('0x45')],function(_0x51a0e9){var _0x2543dd={};_0x2543dd[_0x51a0e9]={'$like':'%'+_0xdecc6f[_0x6b35('0x3c')][_0x6b35('0xa0')]+'%'};return _0x2543dd;})});}if(_0xdecc6f['query'][_0x6b35('0xa1')]){var _0x87af00=_0xdecc6f['query'][_0x6b35('0xa1')][_0x6b35('0xa2')](',');var _0x48f8ea={};_0x48f8ea[_0x87af00[0x0]]={'$gte':moment(_0x87af00[0x1])['format'](_0x6b35('0xa3'))};_0x286dc4[_0x6b35('0x9e')]=_['merge'](_0x286dc4['where'],_0x48f8ea);}_0x286dc4=_['merge']({},_0x286dc4,_0xdecc6f['options']);return db[_0x6b35('0x60')][_0x6b35('0x29')]({'where':_0x286dc4[_0x6b35('0x9e')]})['then'](function(_0x204bc8){_0x506b73['count']=_0x204bc8;if(_0xdecc6f['query'][_0x6b35('0x47')]){_0x286dc4[_0x6b35('0x48')]=[{'all':!![]}];}return db[_0x6b35('0x60')][_0x6b35('0xa4')](_0x286dc4);})[_0x6b35('0x19')](function(_0x28156e){_0x506b73[_0x6b35('0xa5')]=_0x28156e;return _0x506b73;});}})[_0x6b35('0x19')](respondWithFilteredResult(_0x537f31,_0x286dc4))[_0x6b35('0x22')](handleError(_0x537f31,null));};exports[_0x6b35('0xa6')]=function(_0x4b2933,_0x141142){var _0x147343={'where':{}},_0x4d15d8={},_0x5512fe={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x4b2933[_0x6b35('0x3f')]['id']}})[_0x6b35('0x19')](handleEntityNotFound(_0x141142,null))[_0x6b35('0x19')](function(_0x38f327){if(_0x38f327){_0x4d15d8['model']=_['keys'](db[_0x6b35('0x60')][_0x6b35('0x37')]);_0x4d15d8['query']=_['keys'](_0x4b2933[_0x6b35('0x3c')]);_0x4d15d8[_0x6b35('0x42')]=_[_0x6b35('0x43')](_0x4d15d8[_0x6b35('0x40')],_0x4d15d8[_0x6b35('0x3c')]);_0x147343[_0x6b35('0x45')]=_[_0x6b35('0x43')](_0x4d15d8[_0x6b35('0x40')],qs[_0x6b35('0x44')](_0x4b2933['query'][_0x6b35('0x44')]));_0x147343['attributes']=_0x147343[_0x6b35('0x45')][_0x6b35('0x46')]?_0x147343[_0x6b35('0x45')]:_0x4d15d8['model'];if(!_0x4b2933['query'][_0x6b35('0x9b')](_0x6b35('0x9c'))){_0x147343[_0x6b35('0x28')]=qs[_0x6b35('0x28')](_0x4b2933[_0x6b35('0x3c')]['limit']);_0x147343['offset']=qs[_0x6b35('0x27')](_0x4b2933[_0x6b35('0x3c')][_0x6b35('0x27')]);}_0x147343[_0x6b35('0xa7')]=qs[_0x6b35('0x9d')](_0x4b2933[_0x6b35('0x3c')][_0x6b35('0x9d')]);_0x147343['where']=qs['filters'](_[_0x6b35('0x9f')](_0x4b2933[_0x6b35('0x3c')],_0x4d15d8['filters']));_0x147343[_0x6b35('0x9e')][_0x6b35('0xa8')]=_0x38f327['id'];if(_0x4b2933[_0x6b35('0x3c')][_0x6b35('0xa0')]){_0x147343[_0x6b35('0x9e')]=_[_0x6b35('0x30')](_0x147343['where'],{'$or':_[_0x6b35('0x35')](_0x147343[_0x6b35('0x45')],function(_0x515259){var _0x1ee426={};_0x1ee426[_0x515259]={'$like':'%'+_0x4b2933[_0x6b35('0x3c')][_0x6b35('0xa0')]+'%'};return _0x1ee426;})});}_0x147343[_0x6b35('0x9e')]['secret']=![];if(_0x4b2933[_0x6b35('0x3c')]['id']){_0x147343[_0x6b35('0x9e')]['id']={'$gt':_0x4b2933['query']['id']};}_0x147343=_[_0x6b35('0x30')]({},_0x147343,_0x4b2933[_0x6b35('0x49')]);return db[_0x6b35('0x60')][_0x6b35('0x29')]({'where':_0x147343[_0x6b35('0x9e')]})['then'](function(_0xaf52f4){_0x5512fe[_0x6b35('0x29')]=_0xaf52f4;_0x147343[_0x6b35('0x48')]=[];if(_0x4b2933[_0x6b35('0x3c')][_0x6b35('0xa9')]){_0x147343[_0x6b35('0x48')][_0x6b35('0xaa')]({'model':db[_0x6b35('0x7e')],'as':_0x6b35('0x7e'),'attributes':['id',_0x6b35('0x89'),_0x6b35('0x88')]});}if(_0x4b2933['query'][_0x6b35('0x47')]){_0x147343[_0x6b35('0x48')]=[{'all':!![]}];}return db[_0x6b35('0x60')][_0x6b35('0xa4')](_0x147343);})[_0x6b35('0x19')](function(_0x469b2b){_0x5512fe[_0x6b35('0xa5')]=_0x469b2b;return _0x5512fe;});}})[_0x6b35('0x19')](respondWithFilteredResult(_0x141142,_0x147343))['catch'](handleError(_0x141142,null));};exports['addTags']=function(_0x51a5b4,_0x52cb0e){return db[_0x6b35('0x36')]['find']({'where':{'id':_0x51a5b4[_0x6b35('0x3f')]['id']}})[_0x6b35('0x19')](handleEntityNotFound(_0x52cb0e,null))[_0x6b35('0x19')](function(_0xaf6263){if(_0xaf6263){return _0xaf6263[_0x6b35('0xab')](_0x51a5b4['body']['ids'],_['omit'](_0x51a5b4[_0x6b35('0x4b')],['ids','id'])||{})['spread'](function(){return db[_0x6b35('0xac')][_0x6b35('0xa4')]({'attributes':['id',_0x6b35('0x2e'),'color'],'where':{'id':_0x51a5b4[_0x6b35('0x4b')][_0x6b35('0x99')]}});})[_0x6b35('0x19')](function(_0x22fcd5){socket[_0x6b35('0xad')](_0x6b35('0xae'),{'id':Number(_0x51a5b4['params']['id']),'tags':_0x22fcd5||[]});return{'id':Number(_0x51a5b4[_0x6b35('0x3f')]['id']),'tags':_0x22fcd5||[]};});}})[_0x6b35('0x19')](respondWithResult(_0x52cb0e,null))[_0x6b35('0x22')](handleError(_0x52cb0e,null));};exports[_0x6b35('0xaf')]=function(_0x1af2de,_0x10eb7a){return db['ChatInteraction'][_0x6b35('0x62')]({'where':{'id':_0x1af2de[_0x6b35('0x3f')]['id']}})[_0x6b35('0x19')](handleEntityNotFound(_0x10eb7a,null))[_0x6b35('0x19')](function(_0x11d8d2){if(_0x11d8d2){return _0x11d8d2[_0x6b35('0xaf')](_0x1af2de[_0x6b35('0x3c')][_0x6b35('0x99')]);}})[_0x6b35('0x19')](respondWithStatusCode(_0x10eb7a,null))['catch'](handleError(_0x10eb7a,null));};exports[_0x6b35('0xb0')]=function(_0x1dcd4c,_0x1dfc4f){var _0xb15aa6=moment()[_0x6b35('0xb1')]()[_0x6b35('0xb2')]();var _0x63d831=path['join'](config[_0x6b35('0x76')],_0x6b35('0xb3'),_0x6b35('0xb4'),_0x6b35('0xb5'));var _0x30b1c1=path[_0x6b35('0x75')](config[_0x6b35('0x76')],'server',_0x6b35('0xb4'),_0x6b35('0xb6'));var _0x24de9c=path[_0x6b35('0x75')](_0x63d831,_0xb15aa6);var _0x1d6d02=util[_0x6b35('0x80')]('transcript-%d-%s.zip',_0x1dcd4c[_0x6b35('0x3f')]['id'],_0xb15aa6);var _0x172060=path[_0x6b35('0x75')](_0x63d831,_0x1d6d02);var _0x3d4894=[];_0x3d4894[_0x6b35('0xaa')]({'model':db['User'],'as':_0x6b35('0x7e'),'attributes':['id',_0x6b35('0x89')],'raw':!![]});_0x3d4894[_0x6b35('0xaa')]({'model':db['CmContact'],'as':_0x6b35('0x64'),'attributes':['id',_0x6b35('0xb7'),_0x6b35('0xb8')],'raw':!![]});if(_0x1dcd4c[_0x6b35('0x3c')][_0x6b35('0xb6')]){_0x3d4894['push']({'model':db[_0x6b35('0x72')],'as':_0x6b35('0x72'),'raw':!![]});}var _0x508d2c=[{'model':db[_0x6b35('0x60')],'as':_0x6b35('0x7d'),'attributes':['id',_0x6b35('0x4b'),_0x6b35('0x8b'),_0x6b35('0x8d'),_0x6b35('0xb9'),_0x6b35('0xba')],'include':_0x3d4894}];_0x508d2c['push']({'model':db[_0x6b35('0x4e')],'as':_0x6b35('0xbb'),'attributes':['id',_0x6b35('0x2e')]});_0x508d2c['push']({'model':db[_0x6b35('0x7e')],'as':_0x6b35('0xbc'),'attributes':['id',_0x6b35('0x89')]});return db[_0x6b35('0x36')][_0x6b35('0x62')]({'where':{'id':_0x1dcd4c[_0x6b35('0x3f')]['id']},'include':_0x508d2c})[_0x6b35('0x19')](handleEntityNotFound(_0x1dfc4f,null))[_0x6b35('0x19')](function(_0x1b36d7){if(_0x1b36d7){var _0x1fc580=_0x1b36d7[_0x6b35('0xbd')]({'plain':!![]});fs[_0x6b35('0xbe')](_0x24de9c);var _0x224eb5={'channel':_0x6b35('0xbf'),'account':_0x1fc580[_0x6b35('0xbb')][_0x6b35('0x2e')],'agent':_0x1fc580[_0x6b35('0xbc')]?_0x1fc580[_0x6b35('0xbc')][_0x6b35('0x89')]:'N.A.','createdAt':moment(_0x1fc580[_0x6b35('0x8b')])[_0x6b35('0x80')](_0x6b35('0xa3'))[_0x6b35('0xb2')](),'closedAt':_0x1fc580['closed']?moment(_0x1fc580[_0x6b35('0xc0')])[_0x6b35('0x80')](_0x6b35('0xa3'))[_0x6b35('0xb2')]():'','disposition':_0x1fc580[_0x6b35('0x6b')],'chatInfo':{'browser':_0x1fc580[_0x6b35('0xc1')],'os':_0x1fc580[_0x6b35('0xc2')],'referer':_0x1fc580[_0x6b35('0xc3')],'customerIp':_0x1fc580[_0x6b35('0xc4')],'customerPort':_0x1fc580['customerPort']?_0x1fc580['customerPort']:'N.A.'},'messages':_(_0x1fc580[_0x6b35('0x7d')])[_0x6b35('0xc5')]()[_0x6b35('0xa0')]({'secret':![]})['map'](function(_0x103a63){if(_0x103a63[_0x6b35('0x72')]){var _0x369344=path[_0x6b35('0x75')](_0x30b1c1,_0x103a63['Attachment'][_0x6b35('0x6f')]);if(fs['existsSync'](_0x369344)){fs['createReadStream'](_0x369344)[_0x6b35('0xc6')](fs[_0x6b35('0xc7')](path[_0x6b35('0x75')](_0x24de9c,_0x103a63[_0x6b35('0x72')][_0x6b35('0x6f')])));}}return{'date':moment(_0x103a63['createdAt'])[_0x6b35('0x80')](_0x6b35('0xa3'))[_0x6b35('0xb2')](),'sender':_0x103a63[_0x6b35('0x8d')]===_0x6b35('0x5f')?_0x103a63[_0x6b35('0x7e')]?_0x103a63['User'][_0x6b35('0x89')]:_0x6b35('0x83'):_0x103a63[_0x6b35('0x64')][_0x6b35('0xb7')]+(_0x103a63[_0x6b35('0x64')][_0x6b35('0xb8')]?'\x20'+_0x103a63[_0x6b35('0x64')]['lastName']:''),'body':_0x103a63['Attachment']?_0x103a63[_0x6b35('0x72')]['basename']:_0x103a63[_0x6b35('0x4b')],'direction':_0x103a63[_0x6b35('0x8d')]===_0x6b35('0x5f')?'A':'C','secret':_0x103a63[_0x6b35('0xb9')],'read':_0x103a63[_0x6b35('0xba')],'attachment':_0x103a63[_0x6b35('0x72')]};})[_0x6b35('0xc8')]()};return ejs['renderFile'](path[_0x6b35('0x75')](config[_0x6b35('0x76')],_0x6b35('0xb3'),_0x6b35('0xc9'),_0x6b35('0xca')),{'interaction':_0x224eb5})[_0x6b35('0x19')](function(_0x1c3eb9){var _0x5343bb=path[_0x6b35('0x75')](_0x24de9c,_0x6b35('0xcb')+_0x1fc580['id']+'-'+_0xb15aa6+_0x6b35('0xcc'));var _0x1056c7={'path':_0x5343bb,'channel':_0x6b35('0xbf'),'interactionId':_0x1fc580['id']};return pdf[_0x6b35('0xcd')](_0x1c3eb9,_0x1056c7);})[_0x6b35('0x19')](function(){return new Promise(function(_0x1f1671,_0x389dc0){zipdir(_0x24de9c,{'saveTo':_0x172060},function(_0x4ef16c,_0x3477f8){if(_0x4ef16c)return _0x389dc0(_0x4ef16c);return _0x1f1671(_0x3477f8);});})[_0x6b35('0x19')](function(){return new BPromise(function(_0xefb4c3,_0x4a3696){rimraf(_0x24de9c,function(_0x47596c){if(_0x47596c)_0x4a3696(_0x47596c);return _0xefb4c3();});});})[_0x6b35('0x19')](function(){return _0x1dfc4f[_0x6b35('0xb0')](_0x172060,_0x1d6d02,function(_0x1ad576){if(_0x1ad576){logger['error'](_0x6b35('0xce'),_0x1ad576);}else{fs[_0x6b35('0xcf')](_0x172060);}});});});}else{return _0x1dfc4f[_0x6b35('0x23')](0xc8);}})[_0x6b35('0x22')](handleError(_0x1dfc4f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index af84d1e..7f2b224 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 _0x9385=['unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9385,0x1e1));var _0x5938=function(_0x1c0261,_0xbe62af){_0x1c0261=_0x1c0261-0x0;var _0x1f81d0=_0x9385[_0x1c0261];return _0x1f81d0;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x5938('0x0'))['db'][_0x5938('0x1')];var ChatMessage=require(_0x5938('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5938('0x2')](0x0);var events={'afterCreate':_0x5938('0x3'),'afterUpdate':_0x5938('0x4'),'afterDestroy':_0x5938('0x5')};function emitEvent(_0x218722){return function(_0x3bc714,_0x49f8ea,_0x696290){_0x3bc714[_0x5938('0x6')]({'attributes':['id'],'raw':!![]})[_0x5938('0x7')](function(_0x2ad39b){_0x3bc714['setDataValue'](_0x5938('0x8'),_0x2ad39b[_0x5938('0x9')](function(_0x15404f){return{'id':_0x15404f['id']};}));return ChatMessage[_0x5938('0xa')]({'where':{'ChatInteractionId':_0x3bc714['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5938('0x7')](function(_0x4888ef){_0x3bc714[_0x5938('0xb')](_0x5938('0xc'),_0x4888ef[_0x5938('0xd')]);ChatInteractionEvents[_0x5938('0xe')](_0x218722+':'+_0x3bc714['id'],_0x3bc714);ChatInteractionEvents[_0x5938('0xe')](_0x218722,_0x3bc714);_0x696290(null);})['catch'](_0x696290(null));};}for(var e in events){if(events[_0x5938('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x5938('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xafaa=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','save','remove'];(function(_0xe1cce7,_0x183181){var _0x1b9195=function(_0x137eea){while(--_0x137eea){_0xe1cce7['push'](_0xe1cce7['shift']());}};_0x1b9195(++_0x183181);}(_0xafaa,0xc1));var _0xaafa=function(_0x2c8b7a,_0x483fe0){_0x2c8b7a=_0x2c8b7a-0x0;var _0x1c1cf9=_0xafaa[_0x2c8b7a];return _0x1c1cf9;};'use strict';var EventEmitter=require(_0xaafa('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaafa('0x1'),'afterUpdate':'update','afterDestroy':_0xaafa('0x2')};function emitEvent(_0x5afc0a){return function(_0x10d93a,_0xb4f591,_0x7e7752){_0x10d93a['getUsers']({'attributes':['id'],'raw':!![]})[_0xaafa('0x3')](function(_0x5cde8e){_0x10d93a[_0xaafa('0x4')](_0xaafa('0x5'),_0x5cde8e[_0xaafa('0x6')](function(_0x356925){return{'id':_0x356925['id']};}));return ChatMessage[_0xaafa('0x7')]({'where':{'ChatInteractionId':_0x10d93a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x53468b){_0x10d93a['setDataValue'](_0xaafa('0x8'),_0x53468b[_0xaafa('0x9')]);ChatInteractionEvents['emit'](_0x5afc0a+':'+_0x10d93a['id'],_0x10d93a);ChatInteractionEvents[_0xaafa('0xa')](_0x5afc0a,_0x10d93a);_0x7e7752(null);})['catch'](_0x7e7752(null));};}for(var e in events){if(events[_0xaafa('0xb')](e)){var event=events[e];ChatInteraction[_0xaafa('0xc')](e,emitEvent(event));}}module[_0xaafa('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d7ed61d..203392a 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 _0xd743=['../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd6c9ad,_0x2f902d){var _0x553962=function(_0xfbbc8b){while(--_0xfbbc8b){_0xd6c9ad['push'](_0xd6c9ad['shift']());}};_0x553962(++_0x2f902d);}(_0xd743,0x1ac));var _0x3d74=function(_0x1424aa,_0x39ba34){_0x1424aa=_0x1424aa-0x0;var _0x2f5389=_0xd743[_0x1424aa];return _0x2f5389;};'use strict';var _=require(_0x3d74('0x0'));var util=require(_0x3d74('0x1'));var logger=require(_0x3d74('0x2'))(_0x3d74('0x3'));var moment=require(_0x3d74('0x4'));var BPromise=require(_0x3d74('0x5'));var rp=require(_0x3d74('0x6'));var fs=require('fs');var path=require(_0x3d74('0x7'));var rimraf=require(_0x3d74('0x8'));var config=require(_0x3d74('0x9'));var attributes=require('./chatInteraction.attributes');module[_0x3d74('0xa')]=function(_0x20a5d4,_0x4b0d37){return _0x20a5d4[_0x3d74('0xb')](_0x3d74('0xc'),attributes,{'tableName':_0x3d74('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eda64,_0x15936e,_0x2ad130){if(_0x3eda64[_0x3d74('0xe')](_0x3d74('0xf'))){_0x3eda64['closedAt']=moment()[_0x3d74('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2ad130(null,_0x3eda64);}},'charset':_0x3d74('0x11'),'collate':_0x3d74('0x12')});}; \ No newline at end of file +var _0xdc90=['../../config/logger','request-promise','path','../../config/environment','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x30d9b5,_0x39b36d){var _0x4429af=function(_0x5106f9){while(--_0x5106f9){_0x30d9b5['push'](_0x30d9b5['shift']());}};_0x4429af(++_0x39b36d);}(_0xdc90,0x14e));var _0x0dc9=function(_0x16184e,_0xce9b10){_0x16184e=_0x16184e-0x0;var _0x5e8d7a=_0xdc90[_0x16184e];return _0x5e8d7a;};'use strict';var _=require(_0x0dc9('0x0'));var util=require(_0x0dc9('0x1'));var logger=require(_0x0dc9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0dc9('0x3'));var fs=require('fs');var path=require(_0x0dc9('0x4'));var rimraf=require('rimraf');var config=require(_0x0dc9('0x5'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x446886,_0x3e68a2){return _0x446886[_0x0dc9('0x6')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x577b2d,_0x25dc1d,_0x303dd2){if(_0x577b2d[_0x0dc9('0x7')](_0x0dc9('0x8'))){_0x577b2d[_0x0dc9('0x9')]=moment()[_0x0dc9('0xa')](_0x0dc9('0xb'));}_0x303dd2(null,_0x577b2d);}},'charset':_0x0dc9('0xc'),'collate':_0x0dc9('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c50e24d..fb71c77 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 _0x880f=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','addTags','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','request\x20sent'];(function(_0x564917,_0x53da48){var _0x20a72b=function(_0x273ba7){while(--_0x273ba7){_0x564917['push'](_0x564917['shift']());}};_0x20a72b(++_0x53da48);}(_0x880f,0xab));var _0xf880=function(_0x1f46fd,_0x31b40b){_0x1f46fd=_0x1f46fd-0x0;var _0x4886f3=_0x880f[_0x1f46fd];return _0x4886f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf880('0x0'));var rs=require(_0xf880('0x1'));var fs=require('fs');var Redis=require(_0xf880('0x2'));var db=require(_0xf880('0x3'))['db'];var utils=require(_0xf880('0x4'));var logger=require(_0xf880('0x5'))(_0xf880('0x6'));var config=require(_0xf880('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf880('0x8')][_0xf880('0x9')]({'port':0x232a});config[_0xf880('0xa')]=_[_0xf880('0xb')](config['redis'],{'host':_0xf880('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf880('0xa')]));require(_0xf880('0xd'))[_0xf880('0xe')](socket);function respondWithRpcPromise(_0x3818a0,_0x20e387,_0x48235e){return new BPromise(function(_0x92983d,_0x1da431){return client[_0xf880('0xf')](_0x3818a0,_0x48235e)[_0xf880('0x10')](function(_0x2896cd){logger[_0xf880('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x20e387,_0xf880('0x12'));logger[_0xf880('0x13')](_0xf880('0x14'),_0x20e387,_0xf880('0x12'),JSON[_0xf880('0x15')](_0x2896cd));if(_0x2896cd['error']){if(_0x2896cd[_0xf880('0x16')]['code']===0x1f4){logger[_0xf880('0x16')](_0xf880('0x17'),_0x20e387,_0x2896cd[_0xf880('0x16')][_0xf880('0x18')]);return _0x1da431(_0x2896cd[_0xf880('0x16')][_0xf880('0x18')]);}logger[_0xf880('0x16')](_0xf880('0x17'),_0x20e387,_0x2896cd[_0xf880('0x16')][_0xf880('0x18')]);return _0x92983d(_0x2896cd[_0xf880('0x16')][_0xf880('0x18')]);}else{logger[_0xf880('0x11')](_0xf880('0x17'),_0x20e387,'request\x20sent');_0x92983d(_0x2896cd['result'][_0xf880('0x18')]);}})[_0xf880('0x19')](function(_0x3d48a1){logger[_0xf880('0x16')](_0xf880('0x17'),_0x20e387,_0x3d48a1);_0x1da431(_0x3d48a1);});});}exports[_0xf880('0x1a')]=function(_0x4a9d11){var _0x11a369=this;return new Promise(function(_0x1b5075,_0x3b501a){return db[_0xf880('0x1b')][_0xf880('0x1c')](_0x4a9d11[_0xf880('0x1d')],{'raw':_0x4a9d11[_0xf880('0x1e')]?_0x4a9d11[_0xf880('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a9d11[_0xf880('0x1e')]?_0x4a9d11['options'][_0xf880('0x1f')]||null:null,'attributes':_0x4a9d11[_0xf880('0x1e')]?_0x4a9d11[_0xf880('0x1e')][_0xf880('0x20')]||null:null,'limit':_0x4a9d11[_0xf880('0x1e')]?_0x4a9d11[_0xf880('0x1e')]['limit']||null:null})[_0xf880('0x10')](function(_0x5dfcd7){logger[_0xf880('0x11')](_0xf880('0x1a'),_0x4a9d11);logger[_0xf880('0x13')]('UpdateChatInteraction',_0x4a9d11,JSON[_0xf880('0x15')](_0x5dfcd7));_0x1b5075(_0x5dfcd7);})['catch'](function(_0xd6d7eb){logger[_0xf880('0x16')](_0xf880('0x1a'),_0xd6d7eb['message'],_0x4a9d11);_0x3b501a(_0x11a369[_0xf880('0x16')](0x1f4,_0xd6d7eb['message']));});});};exports['AddTagsToChatInteraction']=function(_0x10c244){return new Promise(function(_0x4b61b1,_0x5697f){return db[_0xf880('0x1b')]['find']({'where':_0x10c244[_0xf880('0x1e')]?_0x10c244[_0xf880('0x1e')][_0xf880('0x1f')]||null:null})[_0xf880('0x10')](function(_0x559e66){if(_0x559e66){return _0x559e66[_0xf880('0x21')](_0x10c244[_0xf880('0x1d')][_0xf880('0x22')],_[_0xf880('0x23')](_0x10c244[_0xf880('0x1d')],[_0xf880('0x22'),'id'])||{});}})[_0xf880('0x24')](function(_0x397a50){logger[_0xf880('0x11')](_0xf880('0x25'),_0x10c244);logger[_0xf880('0x13')](_0xf880('0x25'),_0x10c244,JSON['stringify'](_0x397a50));_0x4b61b1(_0x397a50);})[_0xf880('0x19')](function(_0x28ccbb){logger[_0xf880('0x16')]('AddTags',_0x28ccbb['message'],_0x10c244);_0x5697f(_this['error'](0x1f4,_0x28ccbb[_0xf880('0x18')]));});});}; \ No newline at end of file +var _0xecaa=['catch','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','limit'];(function(_0x182d6e,_0x373aaf){var _0x250f67=function(_0x36b2fe){while(--_0x36b2fe){_0x182d6e['push'](_0x182d6e['shift']());}};_0x250f67(++_0x373aaf);}(_0xecaa,0x1cc));var _0xaeca=function(_0x1325e3,_0x84fca){_0x1325e3=_0x1325e3-0x0;var _0x37e2da=_0xecaa[_0x1325e3];return _0x37e2da;};'use strict';var _=require(_0xaeca('0x0'));var util=require(_0xaeca('0x1'));var moment=require(_0xaeca('0x2'));var BPromise=require(_0xaeca('0x3'));var rs=require(_0xaeca('0x4'));var fs=require('fs');var Redis=require(_0xaeca('0x5'));var db=require(_0xaeca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeca('0x7'))(_0xaeca('0x8'));var config=require('../../config/environment');var jayson=require(_0xaeca('0x9'));var client=jayson['client'][_0xaeca('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaeca('0xb')],{'host':_0xaeca('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaeca('0xb')]));require(_0xaeca('0xd'))[_0xaeca('0xe')](socket);function respondWithRpcPromise(_0x12129a,_0xff6ca,_0x16f254){return new BPromise(function(_0xdd12c2,_0x3add76){return client['request'](_0x12129a,_0x16f254)[_0xaeca('0xf')](function(_0x2d919c){logger[_0xaeca('0x10')](_0xaeca('0x11'),_0xff6ca,_0xaeca('0x12'));logger[_0xaeca('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xff6ca,_0xaeca('0x12'),JSON[_0xaeca('0x14')](_0x2d919c));if(_0x2d919c[_0xaeca('0x15')]){if(_0x2d919c[_0xaeca('0x15')][_0xaeca('0x16')]===0x1f4){logger['error'](_0xaeca('0x11'),_0xff6ca,_0x2d919c[_0xaeca('0x15')]['message']);return _0x3add76(_0x2d919c[_0xaeca('0x15')][_0xaeca('0x17')]);}logger['error'](_0xaeca('0x11'),_0xff6ca,_0x2d919c['error']['message']);return _0xdd12c2(_0x2d919c[_0xaeca('0x15')]['message']);}else{logger['info'](_0xaeca('0x11'),_0xff6ca,_0xaeca('0x12'));_0xdd12c2(_0x2d919c[_0xaeca('0x18')]['message']);}})['catch'](function(_0x4ead4f){logger[_0xaeca('0x15')](_0xaeca('0x11'),_0xff6ca,_0x4ead4f);_0x3add76(_0x4ead4f);});});}exports[_0xaeca('0x19')]=function(_0x30b83b){var _0x580168=this;return new Promise(function(_0x83dcb2,_0x32d424){return db[_0xaeca('0x1a')]['update'](_0x30b83b[_0xaeca('0x1b')],{'raw':_0x30b83b[_0xaeca('0x1c')]?_0x30b83b['options'][_0xaeca('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30b83b[_0xaeca('0x1c')]?_0x30b83b[_0xaeca('0x1c')]['where']||null:null,'attributes':_0x30b83b[_0xaeca('0x1c')]?_0x30b83b[_0xaeca('0x1c')][_0xaeca('0x1e')]||null:null,'limit':_0x30b83b[_0xaeca('0x1c')]?_0x30b83b[_0xaeca('0x1c')][_0xaeca('0x1f')]||null:null})['then'](function(_0x209a5a){logger[_0xaeca('0x10')](_0xaeca('0x19'),_0x30b83b);logger[_0xaeca('0x13')](_0xaeca('0x19'),_0x30b83b,JSON['stringify'](_0x209a5a));_0x83dcb2(_0x209a5a);})[_0xaeca('0x20')](function(_0x4d398c){logger[_0xaeca('0x15')](_0xaeca('0x19'),_0x4d398c[_0xaeca('0x17')],_0x30b83b);_0x32d424(_0x580168[_0xaeca('0x15')](0x1f4,_0x4d398c[_0xaeca('0x17')]));});});};exports[_0xaeca('0x21')]=function(_0x12c09a){return new Promise(function(_0x4dd877,_0x4251e5){return db['ChatInteraction'][_0xaeca('0x22')]({'where':_0x12c09a['options']?_0x12c09a[_0xaeca('0x1c')][_0xaeca('0x23')]||null:null})['then'](function(_0x2169dc){if(_0x2169dc){return _0x2169dc[_0xaeca('0x24')](_0x12c09a['body'][_0xaeca('0x25')],_[_0xaeca('0x26')](_0x12c09a[_0xaeca('0x1b')],[_0xaeca('0x25'),'id'])||{});}})[_0xaeca('0x27')](function(_0x466388){logger['info'](_0xaeca('0x28'),_0x12c09a);logger[_0xaeca('0x13')](_0xaeca('0x28'),_0x12c09a,JSON[_0xaeca('0x14')](_0x466388));_0x4dd877(_0x466388);})['catch'](function(_0x2f7c74){logger['error'](_0xaeca('0x28'),_0x2f7c74[_0xaeca('0x17')],_0x12c09a);_0x4251e5(_this['error'](0x1f4,_0x2f7c74[_0xaeca('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c7029a2..d27f468 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 _0xaced=['update','emit','register','length','./chatInteraction.events','save','remove'];(function(_0x19ef3d,_0x37c99a){var _0x3f4bf8=function(_0x10aa61){while(--_0x10aa61){_0x19ef3d['push'](_0x19ef3d['shift']());}};_0x3f4bf8(++_0x37c99a);}(_0xaced,0x18c));var _0xdace=function(_0xab4dda,_0xa71990){_0xab4dda=_0xab4dda-0x0;var _0x8cf442=_0xaced[_0xab4dda];return _0x8cf442;};'use strict';var ChatInteractionEvents=require(_0xdace('0x0'));var events=[_0xdace('0x1'),_0xdace('0x2'),_0xdace('0x3')];function createListener(_0x44b792,_0x58f547){return function(_0x36bfd5){_0x58f547[_0xdace('0x4')](_0x44b792,_0x36bfd5);};}function removeListener(_0x1ba367,_0x46522e){return function(){ChatInteractionEvents['removeListener'](_0x1ba367,_0x46522e);};}exports[_0xdace('0x5')]=function(_0x4d7f80){for(var _0x5f5d92=0x0,_0x198ca1=events[_0xdace('0x6')];_0x5f5d92<_0x198ca1;_0x5f5d92++){var _0x3521d8=events[_0x5f5d92];var _0x199697=createListener('chatInteraction:'+_0x3521d8,_0x4d7f80);ChatInteractionEvents['on'](_0x3521d8,_0x199697);}}; \ No newline at end of file +var _0x584c=['remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x3ea63f,_0x2b5e80){var _0x46b6f8=function(_0x5c583e){while(--_0x5c583e){_0x3ea63f['push'](_0x3ea63f['shift']());}};_0x46b6f8(++_0x2b5e80);}(_0x584c,0xe6));var _0xc584=function(_0xc4e62c,_0x5b226e){_0xc4e62c=_0xc4e62c-0x0;var _0x44c950=_0x584c[_0xc4e62c];return _0x44c950;};'use strict';var ChatInteractionEvents=require(_0xc584('0x0'));var events=[_0xc584('0x1'),_0xc584('0x2'),_0xc584('0x3')];function createListener(_0x559743,_0x5c4d0a){return function(_0x70602f){_0x5c4d0a[_0xc584('0x4')](_0x559743,_0x70602f);};}function removeListener(_0xc75194,_0x57803f){return function(){ChatInteractionEvents[_0xc584('0x5')](_0xc75194,_0x57803f);};}exports[_0xc584('0x6')]=function(_0x2e1a8c){for(var _0x4de069=0x0,_0x3d8bff=events['length'];_0x4de069<_0x3d8bff;_0x4de069++){var _0x5c58e0=events[_0x4de069];var _0x4086f9=createListener(_0xc584('0x7')+_0x5c58e0,_0x2e1a8c);ChatInteractionEvents['on'](_0x5c58e0,_0x4086f9);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 57b74d0..85aa253 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 _0x6cc1=['chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','/:id/close','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cc1,0x96));var _0x16cc=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x6cc1[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x16cc('0x0'));var util=require(_0x16cc('0x1'));var path=require(_0x16cc('0x2'));var timeout=require(_0x16cc('0x3'));var express=require(_0x16cc('0x4'));var router=express[_0x16cc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x16cc('0x6'));var interaction=require(_0x16cc('0x7'));var config=require(_0x16cc('0x8'));var controller=require(_0x16cc('0x9'));router[_0x16cc('0xa')]('/',auth[_0x16cc('0xb')](),controller['index']);router['get']('/describe',auth[_0x16cc('0xb')](),controller[_0x16cc('0xc')]);router[_0x16cc('0xa')]('/:id',auth[_0x16cc('0xd')](),controller[_0x16cc('0xe')]);router['get'](_0x16cc('0xf'),auth[_0x16cc('0xd')](),controller['attachmentDownload']);router[_0x16cc('0xa')](_0x16cc('0x10'),auth[_0x16cc('0xb')](),controller['getMessages']);router[_0x16cc('0xa')](_0x16cc('0x11'),auth[_0x16cc('0xd')](),controller[_0x16cc('0x12')]);router['get'](_0x16cc('0x13'),auth[_0x16cc('0xb')](),controller['download']);router[_0x16cc('0x14')]('/',auth[_0x16cc('0xb')](),controller[_0x16cc('0x15')]);router[_0x16cc('0x14')](_0x16cc('0x16'),auth['isAuthenticated'](),controller[_0x16cc('0x17')]);var upload=multer({'storage':multer[_0x16cc('0x18')]({'destination':function(_0x88c5c6,_0x3caaa6,_0x16ff26){_0x16ff26(null,path[_0x16cc('0x19')](config[_0x16cc('0x1a')],_0x16cc('0x1b')));},'filename':function(_0x59ecbf,_0x2673cf,_0x2a51d2){_0x2a51d2(null,util[_0x16cc('0x1c')]('%s-%s',Date['now'](),_0x2673cf[_0x16cc('0x1d')][_0x16cc('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x16cc('0x14')](_0x16cc('0x1f'),upload['single']('file'),controller[_0x16cc('0x20')]);router[_0x16cc('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x16cc('0x21')]);router[_0x16cc('0x14')](_0x16cc('0x22'),auth['isAuthenticated'](),interaction[_0x16cc('0x23')](_0x16cc('0x24'),'chatinteraction:addtags'),controller[_0x16cc('0x25')]);router[_0x16cc('0x26')](_0x16cc('0x27'),auth[_0x16cc('0xb')](),interaction[_0x16cc('0x23')](_0x16cc('0x24'),_0x16cc('0x28')),controller[_0x16cc('0x29')]);router['put']('/:id/custom_update',controller[_0x16cc('0x2a')]);router[_0x16cc('0x26')](_0x16cc('0x2b'),auth[_0x16cc('0xd')](),controller['abandon']);router['put'](_0x16cc('0x2c'),controller['close']);router[_0x16cc('0x2d')]('/:id',auth[_0x16cc('0xb')](),interaction[_0x16cc('0x23')]('chat',_0x16cc('0x2e')),controller[_0x16cc('0x2f')]);router[_0x16cc('0x2d')]('/:id/tags',auth[_0x16cc('0xb')](),controller[_0x16cc('0x30')]);module['exports']=router; \ No newline at end of file +var _0x539b=['chatinteraction:addtags','put','/:id/custom_update','/:id/abandon','/:id/close','close','destroy','removeTags','exports','multer','util','path','connect-timeout','express','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','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat'];(function(_0x50b5b6,_0x535bf7){var _0x3a3de5=function(_0x4c1495){while(--_0x4c1495){_0x50b5b6['push'](_0x50b5b6['shift']());}};_0x3a3de5(++_0x535bf7);}(_0x539b,0x10d));var _0xb539=function(_0x4abd20,_0x185a89){_0x4abd20=_0x4abd20-0x0;var _0x4ae619=_0x539b[_0x4abd20];return _0x4ae619;};'use strict';var multer=require(_0xb539('0x0'));var util=require(_0xb539('0x1'));var path=require(_0xb539('0x2'));var timeout=require(_0xb539('0x3'));var express=require(_0xb539('0x4'));var router=express['Router']();var fs_extra=require(_0xb539('0x5'));var auth=require(_0xb539('0x6'));var interaction=require(_0xb539('0x7'));var config=require(_0xb539('0x8'));var controller=require(_0xb539('0x9'));router[_0xb539('0xa')]('/',auth[_0xb539('0xb')](),controller[_0xb539('0xc')]);router[_0xb539('0xa')](_0xb539('0xd'),auth[_0xb539('0xb')](),controller[_0xb539('0xe')]);router[_0xb539('0xa')](_0xb539('0xf'),auth[_0xb539('0x10')](),controller[_0xb539('0x11')]);router[_0xb539('0xa')](_0xb539('0x12'),auth[_0xb539('0x10')](),controller[_0xb539('0x13')]);router[_0xb539('0xa')](_0xb539('0x14'),auth['isAuthenticated'](),controller[_0xb539('0x15')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xb539('0x16')]);router[_0xb539('0xa')](_0xb539('0x17'),auth[_0xb539('0xb')](),controller[_0xb539('0x18')]);router[_0xb539('0x19')]('/',auth[_0xb539('0xb')](),controller[_0xb539('0x1a')]);router[_0xb539('0x19')]('/:id/vidaoo',auth[_0xb539('0xb')](),controller[_0xb539('0x1b')]);var upload=multer({'storage':multer[_0xb539('0x1c')]({'destination':function(_0x3354af,_0x5b8db8,_0x3bea06){_0x3bea06(null,path['join'](config[_0xb539('0x1d')],_0xb539('0x1e')));},'filename':function(_0x3cd316,_0xabfd66,_0x105017){_0x105017(null,util[_0xb539('0x1f')]('%s-%s',Date[_0xb539('0x20')](),_0xabfd66[_0xb539('0x21')][_0xb539('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb539('0x19')](_0xb539('0x23'),upload[_0xb539('0x24')](_0xb539('0x25')),controller[_0xb539('0x26')]);router[_0xb539('0x19')]('/:id/messages',auth[_0xb539('0x10')](),controller[_0xb539('0x27')]);router[_0xb539('0x19')](_0xb539('0x28'),auth[_0xb539('0xb')](),interaction[_0xb539('0x29')](_0xb539('0x2a'),_0xb539('0x2b')),controller['addTags']);router['put'](_0xb539('0xf'),auth[_0xb539('0xb')](),interaction[_0xb539('0x29')](_0xb539('0x2a'),'chatinteraction:update'),controller['update']);router[_0xb539('0x2c')](_0xb539('0x2d'),controller['customUpdate']);router[_0xb539('0x2c')](_0xb539('0x2e'),auth[_0xb539('0x10')](),controller['abandon']);router[_0xb539('0x2c')](_0xb539('0x2f'),controller[_0xb539('0x30')]);router['delete'](_0xb539('0xf'),auth['isAuthenticated'](),interaction[_0xb539('0x29')](_0xb539('0x2a'),'chatinteraction:destroy'),controller[_0xb539('0x31')]);router['delete'](_0xb539('0x28'),auth[_0xb539('0xb')](),controller[_0xb539('0x32')]);module[_0xb539('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 9d207e9..b33631e 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 _0x35be=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x3f3bef,_0x5e8866){var _0x142858=function(_0x1fb81e){while(--_0x1fb81e){_0x3f3bef['push'](_0x3f3bef['shift']());}};_0x142858(++_0x5e8866);}(_0x35be,0x114));var _0xe35b=function(_0x5951a7,_0x24e83f){_0x5951a7=_0x5951a7-0x0;var _0x593dcf=_0x35be[_0x5951a7];return _0x593dcf;};'use strict';var Sequelize=require(_0xe35b('0x0'));module[_0xe35b('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe35b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe35b('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe35b('0x4')]}}; \ No newline at end of file +var _0xdfe0=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x46a33a,_0x585230){var _0x3becb0=function(_0x28ed90){while(--_0x28ed90){_0x46a33a['push'](_0x46a33a['shift']());}};_0x3becb0(++_0x585230);}(_0xdfe0,0xba));var _0x0dfe=function(_0x3dd993,_0x19ea80){_0x3dd993=_0x3dd993-0x0;var _0x361430=_0xdfe0[_0x3dd993];return _0x361430;};'use strict';var Sequelize=require('sequelize');module[_0x0dfe('0x0')]={'body':{'type':Sequelize[_0x0dfe('0x1')](_0x0dfe('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0dfe('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0dfe('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 086bb57..a69f837 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 _0x46b3=['zip-dir','fast-json-patch','request-promise','moment','mustache','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','role','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x46b3,0x6a));var _0x346b=function(_0x1f290d,_0x420fae){_0x1f290d=_0x1f290d-0x0;var _0x19fd5d=_0x46b3[_0x1f290d];return _0x19fd5d;};'use strict';var emlformat=require(_0x346b('0x0'));var rimraf=require(_0x346b('0x1'));var zipdir=require(_0x346b('0x2'));var jsonpatch=require(_0x346b('0x3'));var rp=require(_0x346b('0x4'));var moment=require(_0x346b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x346b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x346b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x346b('0x8'));var crypto=require(_0x346b('0x9'));var jsforce=require(_0x346b('0xa'));var deskjs=require(_0x346b('0xb'));var toCsv=require(_0x346b('0xc'));var querystring=require(_0x346b('0xd'));var Papa=require('papaparse');var Redis=require(_0x346b('0xe'));var authService=require(_0x346b('0xf'));var qs=require(_0x346b('0x10'));var as=require(_0x346b('0x11'));var hardwareService=require(_0x346b('0x12'));var logger=require(_0x346b('0x13'))(_0x346b('0x14'));var utils=require(_0x346b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x346b('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x346b('0x17')](config[_0x346b('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x346b('0x19'))[_0x346b('0x1a')](socket);function respondWithStatusCode(_0x30b8ae,_0x63b38d){_0x63b38d=_0x63b38d||0xcc;return function(_0x3055f0){if(_0x3055f0){return _0x30b8ae[_0x346b('0x1b')](_0x63b38d);}return _0x30b8ae[_0x346b('0x1c')](_0x63b38d)[_0x346b('0x1d')]();};}function respondWithResult(_0x453d84,_0x5a5e29){_0x5a5e29=_0x5a5e29||0xc8;return function(_0x4bef59){if(_0x4bef59){return _0x453d84['status'](_0x5a5e29)['json'](_0x4bef59);}};}function respondWithFilteredResult(_0x32ec36,_0x1de936){return function(_0x54a45b){if(_0x54a45b){var _0x1e3e5a=typeof _0x1de936[_0x346b('0x1e')]===_0x346b('0x1f')&&typeof _0x1de936['limit']===_0x346b('0x1f');var _0x1553c9=_0x54a45b['count'];var _0x4c4d6c=_0x1e3e5a?0x0:_0x1de936['offset'];var _0x121d8f=_0x1e3e5a?_0x54a45b[_0x346b('0x20')]:_0x1de936['offset']+_0x1de936[_0x346b('0x21')];var _0x33c026;if(_0x121d8f>=_0x1553c9){_0x121d8f=_0x1553c9;_0x33c026=0xc8;}else{_0x33c026=0xce;}_0x32ec36[_0x346b('0x1c')](_0x33c026);return _0x32ec36[_0x346b('0x22')](_0x346b('0x23'),_0x4c4d6c+'-'+_0x121d8f+'/'+_0x1553c9)[_0x346b('0x24')](_0x54a45b);}return null;};}function patchUpdates(_0x42037f){return function(_0x115912){try{jsonpatch['apply'](_0x115912,_0x42037f,!![]);}catch(_0xc93211){return BPromise[_0x346b('0x25')](_0xc93211);}return _0x115912[_0x346b('0x26')]();};}function saveUpdates(_0x5417a2,_0x1a0765){return function(_0x4d2183){if(_0x4d2183){return _0x4d2183[_0x346b('0x27')](_0x5417a2)['then'](function(_0x2f8351){return _0x2f8351;});}return null;};}function removeEntity(_0x2c4bd5,_0x53db8b){return function(_0x4390f1){if(_0x4390f1){return _0x4390f1[_0x346b('0x28')]()[_0x346b('0x29')](function(){_0x2c4bd5[_0x346b('0x1c')](0xcc)[_0x346b('0x1d')]();});}};}function handleEntityNotFound(_0x331647,_0x8949c3){return function(_0xdd88be){if(!_0xdd88be){_0x331647['sendStatus'](0x194);}return _0xdd88be;};}function handleError(_0x4482a7,_0xb45382){_0xb45382=_0xb45382||0x1f4;return function(_0x4fe84b){logger[_0x346b('0x2a')](_0x4fe84b[_0x346b('0x2b')]);if(_0x4fe84b[_0x346b('0x2c')]){delete _0x4fe84b[_0x346b('0x2c')];}_0x4482a7[_0x346b('0x1c')](_0xb45382)['send'](_0x4fe84b);};}exports['index']=function(_0x46bde3,_0xa489b3){var _0x3bbb42={},_0x104230={},_0x519bf6={'count':0x0,'rows':[]};var _0x364c08=_[_0x346b('0x2d')](db[_0x346b('0x2e')][_0x346b('0x2f')],function(_0x2428c1){return{'name':_0x2428c1[_0x346b('0x30')],'type':_0x2428c1[_0x346b('0x31')][_0x346b('0x32')]};});_0x104230['model']=_['map'](_0x364c08,_0x346b('0x2c'));_0x104230[_0x346b('0x33')]=_['keys'](_0x46bde3[_0x346b('0x33')]);_0x104230['filters']=_[_0x346b('0x34')](_0x104230[_0x346b('0x35')],_0x104230[_0x346b('0x33')]);_0x3bbb42[_0x346b('0x36')]=_['intersection'](_0x104230[_0x346b('0x35')],qs[_0x346b('0x37')](_0x46bde3['query'][_0x346b('0x37')]));_0x3bbb42[_0x346b('0x36')]=_0x3bbb42[_0x346b('0x36')][_0x346b('0x38')]?_0x3bbb42['attributes']:_0x104230[_0x346b('0x35')];if(!_0x46bde3['query'][_0x346b('0x39')](_0x346b('0x3a'))){_0x3bbb42['limit']=qs[_0x346b('0x21')](_0x46bde3['query'][_0x346b('0x21')]);_0x3bbb42[_0x346b('0x1e')]=qs['offset'](_0x46bde3[_0x346b('0x33')][_0x346b('0x1e')]);}_0x3bbb42['order']=qs[_0x346b('0x3b')](_0x46bde3[_0x346b('0x33')][_0x346b('0x3b')]);_0x3bbb42[_0x346b('0x3c')]=qs[_0x346b('0x3d')](_['pick'](_0x46bde3[_0x346b('0x33')],_0x104230[_0x346b('0x3d')]),_0x364c08);if(_0x46bde3['query']['filter']){_0x3bbb42[_0x346b('0x3c')]=_[_0x346b('0x3e')](_0x3bbb42[_0x346b('0x3c')],{'$or':_[_0x346b('0x2d')](_0x364c08,function(_0x21da5f){if(_0x21da5f['type']!==_0x346b('0x3f')){var _0x150c47={};_0x150c47[_0x21da5f[_0x346b('0x2c')]]={'$like':'%'+_0x46bde3[_0x346b('0x33')][_0x346b('0x40')]+'%'};return _0x150c47;}})});}_0x3bbb42=_['merge']({},_0x3bbb42,_0x46bde3['options']);var _0x4e0cb6={'where':_0x3bbb42[_0x346b('0x3c')]};return db['ChatInternalMessage']['count'](_0x4e0cb6)[_0x346b('0x29')](function(_0x4346df){_0x519bf6[_0x346b('0x20')]=_0x4346df;if(_0x46bde3[_0x346b('0x33')][_0x346b('0x41')]){_0x3bbb42[_0x346b('0x42')]=[{'all':!![]}];}return db[_0x346b('0x2e')][_0x346b('0x43')](_0x3bbb42);})[_0x346b('0x29')](function(_0x373a87){_0x519bf6[_0x346b('0x44')]=_0x373a87;return _0x519bf6;})[_0x346b('0x29')](respondWithFilteredResult(_0xa489b3,_0x3bbb42))[_0x346b('0x45')](handleError(_0xa489b3,null));};exports[_0x346b('0x46')]=function(_0x106a53,_0xc74b1f){var _0x22838a={'raw':!![],'where':{'id':_0x106a53['params']['id']}},_0x56d229={};_0x56d229[_0x346b('0x35')]=_[_0x346b('0x47')](db[_0x346b('0x2e')][_0x346b('0x2f')]);_0x56d229[_0x346b('0x33')]=_[_0x346b('0x47')](_0x106a53['query']);_0x56d229[_0x346b('0x3d')]=_[_0x346b('0x34')](_0x56d229['model'],_0x56d229[_0x346b('0x33')]);_0x22838a['attributes']=_[_0x346b('0x34')](_0x56d229[_0x346b('0x35')],qs[_0x346b('0x37')](_0x106a53[_0x346b('0x33')][_0x346b('0x37')]));_0x22838a[_0x346b('0x36')]=_0x22838a[_0x346b('0x36')]['length']?_0x22838a[_0x346b('0x36')]:_0x56d229[_0x346b('0x35')];if(_0x106a53[_0x346b('0x33')][_0x346b('0x41')]){_0x22838a[_0x346b('0x42')]=[{'all':!![]}];}_0x22838a=_[_0x346b('0x3e')]({},_0x22838a,_0x106a53[_0x346b('0x48')]);return db[_0x346b('0x2e')][_0x346b('0x49')](_0x22838a)[_0x346b('0x29')](handleEntityNotFound(_0xc74b1f,null))[_0x346b('0x29')](respondWithResult(_0xc74b1f,null))[_0x346b('0x45')](handleError(_0xc74b1f,null));};exports[_0x346b('0x4a')]=function(_0x176a6b,_0x42ca03){return db[_0x346b('0x2e')][_0x346b('0x4a')](_0x176a6b[_0x346b('0x4b')],{})[_0x346b('0x29')](respondWithResult(_0x42ca03,0xc9))['catch'](handleError(_0x42ca03,null));};exports[_0x346b('0x27')]=function(_0x231451,_0x301611){if(_0x231451['body']['id']){delete _0x231451[_0x346b('0x4b')]['id'];}return db[_0x346b('0x2e')][_0x346b('0x49')]({'where':{'id':_0x231451[_0x346b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x301611,null))['then'](saveUpdates(_0x231451['body'],null))['then'](respondWithResult(_0x301611,null))[_0x346b('0x45')](handleError(_0x301611,null));};exports[_0x346b('0x28')]=function(_0x4824a1,_0x5060e0){return db[_0x346b('0x2e')]['find']({'where':{'id':_0x4824a1[_0x346b('0x4c')]['id']}})[_0x346b('0x29')](handleEntityNotFound(_0x5060e0,null))['then'](removeEntity(_0x5060e0,null))[_0x346b('0x45')](handleError(_0x5060e0,null));};exports['describe']=function(_0x1adfb0,_0x22f935){return db['ChatInternalMessage'][_0x346b('0x4d')]()[_0x346b('0x29')](respondWithResult(_0x22f935,null))[_0x346b('0x45')](handleError(_0x22f935,null));};function wrapUser(_0x11cd5f){return function(_0x5e8b1f){var _0x503644=_0x11cd5f[_0x346b('0x4e')]({'plain':!![]});_0x503644[_0x346b('0x4f')]=[];if(_0x5e8b1f){_0x503644[_0x346b('0x50')]=_0x5e8b1f[_0x346b('0x51')];_0x503644['lastMessage']=_0x5e8b1f;}else{_0x503644[_0x346b('0x50')]=moment(0x0)[_0x346b('0x52')](_0x346b('0x53'));_0x503644[_0x346b('0x54')]={};}return _0x503644;};}exports[_0x346b('0x55')]=function(_0x209202,_0x248b59,_0x34a9e9){var _0x335a49=[];return db['User'][_0x346b('0x43')]({'where':{'role':[_0x346b('0x56'),_0x346b('0x57'),_0x346b('0x58')]},'attributes':['id',_0x346b('0x59'),_0x346b('0x2c'),'role',_0x346b('0x5a'),_0x346b('0x5b'),_0x346b('0x5c'),'lastLoginAt',_0x346b('0x5d'),_0x346b('0x5e')],'order':qs['sort'](_0x346b('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0x346b('0x60'),'attributes':['id',_0x346b('0x2c'),_0x346b('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x47fcd8){if(_0x47fcd8){var _0x448e3e=_0x209202[_0x346b('0x58')]['get']({'plain':!![]});if(!_0x448e3e)throw new Error(_0x346b('0x61'));if(_0x448e3e['role']===_0x346b('0x58')){return db[_0x346b('0x62')][_0x346b('0x49')]({'where':{'name':'Agents','userProfileId':_0x448e3e['userProfileId']},'raw':!![]})['then'](function(_0x50b1a8){if(_0x50b1a8){if(_0x50b1a8[_0x346b('0x63')]===0x0){return db[_0x346b('0x64')][_0x346b('0x43')]({'where':{'sectionId':_0x50b1a8['id']},'raw':!![]})[_0x346b('0x29')](function(_0x1b8c93){var _0x400bf5=[];if(_['isEmpty'](_0x1b8c93)){_0x400bf5=_['filter'](_0x47fcd8,function(_0x155fd0){if(_0x155fd0['role']!==_0x346b('0x56')){return _0x155fd0;}});return _0x400bf5;}else{for(var _0x404165=0x0;_0x404165<_0x47fcd8[_0x346b('0x38')];_0x404165++){var _0x106cd3=_0x47fcd8[_0x404165];if(_0x106cd3[_0x346b('0x65')]===_0x346b('0x56')){var _0x23c124=_[_0x346b('0x49')](_0x1b8c93,function(_0x4b089e){return _0x4b089e[_0x346b('0x66')]===_0x106cd3['id'];});if(_0x23c124)_0x400bf5['push'](_0x106cd3);}else{_0x400bf5[_0x346b('0x67')](_0x106cd3);}}return _0x400bf5;}});}else{return _0x47fcd8;}}else{var _0x202f22=_[_0x346b('0x40')](_0x47fcd8,function(_0x4f26fa){if(_0x4f26fa[_0x346b('0x65')]!==_0x346b('0x56')){return _0x4f26fa;}});return _0x202f22;}});}else{return _0x47fcd8;}}})[_0x346b('0x29')](function(_0x427471){var _0x2966bb=[];if(_0x427471){_0x335a49=_0x427471;for(var _0x488a64=0x0;_0x488a64<_0x427471[_0x346b('0x38')];_0x488a64+=0x1){_0x335a49[_0x488a64][_0x346b('0x4f')]=[];_0x2966bb[_0x346b('0x67')](db[_0x346b('0x2e')][_0x346b('0x49')]({'where':{'FromId':[_0x209202['user']['id'],_0x427471[_0x488a64]['id']],'ToId':[_0x209202[_0x346b('0x58')]['id'],_0x427471[_0x488a64]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x346b('0x68'),_0x346b('0x69'),'read',_0x346b('0x4b')],'order':qs['sort'](_0x346b('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x346b('0x29')](wrapUser(_0x427471[_0x488a64])));}return BPromise[_0x346b('0x6b')](_0x2966bb);}return[];})[_0x346b('0x29')](function(_0x15aa62){return{'rows':_0x15aa62,'count':_0x15aa62[_0x346b('0x38')]};})['then'](respondWithResult(_0x248b59,null))[_0x346b('0x45')](handleError(_0x248b59,null));}; \ No newline at end of file +var _0x64d4=['Agents','userProfileId','autoAssociation','isEmpty','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','ChatInternalMessage','include','findAll','rows','catch','includeAll','find','create','body','params','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x64d4,0xea));var _0x464d=function(_0x528d8c,_0x1f73d7){_0x528d8c=_0x528d8c-0x0;var _0x364048=_0x64d4[_0x528d8c];return _0x364048;};'use strict';var emlformat=require(_0x464d('0x0'));var rimraf=require(_0x464d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x464d('0x2'));var rp=require(_0x464d('0x3'));var moment=require(_0x464d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x464d('0x5'));var path=require(_0x464d('0x6'));var sox=require(_0x464d('0x7'));var csv=require(_0x464d('0x8'));var ejs=require(_0x464d('0x9'));var fs=require('fs');var fs_extra=require(_0x464d('0xa'));var _=require(_0x464d('0xb'));var squel=require(_0x464d('0xc'));var crypto=require('crypto');var jsforce=require(_0x464d('0xd'));var deskjs=require(_0x464d('0xe'));var toCsv=require(_0x464d('0x8'));var querystring=require('querystring');var Papa=require(_0x464d('0xf'));var Redis=require(_0x464d('0x10'));var authService=require(_0x464d('0x11'));var qs=require(_0x464d('0x12'));var as=require(_0x464d('0x13'));var hardwareService=require(_0x464d('0x14'));var logger=require(_0x464d('0x15'))(_0x464d('0x16'));var utils=require(_0x464d('0x17'));var config=require(_0x464d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x464d('0x19'))['db'];config[_0x464d('0x1a')]=_['defaults'](config[_0x464d('0x1a')],{'host':_0x464d('0x1b'),'port':0x18eb});var socket=require(_0x464d('0x1c'))(new Redis(config[_0x464d('0x1a')]));require(_0x464d('0x1d'))['register'](socket);function respondWithStatusCode(_0x172e95,_0x136172){_0x136172=_0x136172||0xcc;return function(_0x1f44a7){if(_0x1f44a7){return _0x172e95[_0x464d('0x1e')](_0x136172);}return _0x172e95[_0x464d('0x1f')](_0x136172)[_0x464d('0x20')]();};}function respondWithResult(_0x2138fa,_0x353969){_0x353969=_0x353969||0xc8;return function(_0x443562){if(_0x443562){return _0x2138fa['status'](_0x353969)['json'](_0x443562);}};}function respondWithFilteredResult(_0xab0d3a,_0x48a974){return function(_0x47ebdb){if(_0x47ebdb){var _0x54aee6=typeof _0x48a974[_0x464d('0x21')]===_0x464d('0x22')&&typeof _0x48a974[_0x464d('0x23')]===_0x464d('0x22');var _0x1d4b19=_0x47ebdb[_0x464d('0x24')];var _0x186e07=_0x54aee6?0x0:_0x48a974[_0x464d('0x21')];var _0x9c98f6=_0x54aee6?_0x47ebdb[_0x464d('0x24')]:_0x48a974[_0x464d('0x21')]+_0x48a974[_0x464d('0x23')];var _0x587879;if(_0x9c98f6>=_0x1d4b19){_0x9c98f6=_0x1d4b19;_0x587879=0xc8;}else{_0x587879=0xce;}_0xab0d3a[_0x464d('0x1f')](_0x587879);return _0xab0d3a[_0x464d('0x25')](_0x464d('0x26'),_0x186e07+'-'+_0x9c98f6+'/'+_0x1d4b19)['json'](_0x47ebdb);}return null;};}function patchUpdates(_0x350cd5){return function(_0x45c365){try{jsonpatch[_0x464d('0x27')](_0x45c365,_0x350cd5,!![]);}catch(_0x1405dd){return BPromise['reject'](_0x1405dd);}return _0x45c365[_0x464d('0x28')]();};}function saveUpdates(_0x29a682,_0x3590e3){return function(_0x234b8a){if(_0x234b8a){return _0x234b8a[_0x464d('0x29')](_0x29a682)[_0x464d('0x2a')](function(_0x25d7ae){return _0x25d7ae;});}return null;};}function removeEntity(_0x47ee2a,_0x2bdc15){return function(_0x368c8d){if(_0x368c8d){return _0x368c8d[_0x464d('0x2b')]()['then'](function(){_0x47ee2a['status'](0xcc)[_0x464d('0x20')]();});}};}function handleEntityNotFound(_0x139330,_0x520f59){return function(_0x581303){if(!_0x581303){_0x139330[_0x464d('0x1e')](0x194);}return _0x581303;};}function handleError(_0x1dc334,_0x1c65e0){_0x1c65e0=_0x1c65e0||0x1f4;return function(_0x547e71){logger['error'](_0x547e71[_0x464d('0x2c')]);if(_0x547e71[_0x464d('0x2d')]){delete _0x547e71[_0x464d('0x2d')];}_0x1dc334[_0x464d('0x1f')](_0x1c65e0)[_0x464d('0x2e')](_0x547e71);};}exports[_0x464d('0x2f')]=function(_0x58a837,_0xffdcc3){var _0x220b32={},_0x4f2fe8={},_0x143f48={'count':0x0,'rows':[]};var _0x573e07=_[_0x464d('0x30')](db['ChatInternalMessage'][_0x464d('0x31')],function(_0x270d94){return{'name':_0x270d94[_0x464d('0x32')],'type':_0x270d94[_0x464d('0x33')]['key']};});_0x4f2fe8[_0x464d('0x34')]=_[_0x464d('0x30')](_0x573e07,_0x464d('0x2d'));_0x4f2fe8['query']=_[_0x464d('0x35')](_0x58a837['query']);_0x4f2fe8[_0x464d('0x36')]=_['intersection'](_0x4f2fe8['model'],_0x4f2fe8[_0x464d('0x37')]);_0x220b32[_0x464d('0x38')]=_[_0x464d('0x39')](_0x4f2fe8[_0x464d('0x34')],qs[_0x464d('0x3a')](_0x58a837['query'][_0x464d('0x3a')]));_0x220b32[_0x464d('0x38')]=_0x220b32[_0x464d('0x38')][_0x464d('0x3b')]?_0x220b32[_0x464d('0x38')]:_0x4f2fe8[_0x464d('0x34')];if(!_0x58a837[_0x464d('0x37')]['hasOwnProperty'](_0x464d('0x3c'))){_0x220b32['limit']=qs[_0x464d('0x23')](_0x58a837[_0x464d('0x37')][_0x464d('0x23')]);_0x220b32['offset']=qs['offset'](_0x58a837['query'][_0x464d('0x21')]);}_0x220b32[_0x464d('0x3d')]=qs[_0x464d('0x3e')](_0x58a837['query'][_0x464d('0x3e')]);_0x220b32[_0x464d('0x3f')]=qs[_0x464d('0x36')](_[_0x464d('0x40')](_0x58a837[_0x464d('0x37')],_0x4f2fe8['filters']),_0x573e07);if(_0x58a837[_0x464d('0x37')][_0x464d('0x41')]){_0x220b32['where']=_[_0x464d('0x42')](_0x220b32[_0x464d('0x3f')],{'$or':_['map'](_0x573e07,function(_0x1a14c7){if(_0x1a14c7[_0x464d('0x33')]!=='VIRTUAL'){var _0x22b6dc={};_0x22b6dc[_0x1a14c7[_0x464d('0x2d')]]={'$like':'%'+_0x58a837['query']['filter']+'%'};return _0x22b6dc;}})});}_0x220b32=_[_0x464d('0x42')]({},_0x220b32,_0x58a837[_0x464d('0x43')]);var _0x4edffc={'where':_0x220b32[_0x464d('0x3f')]};return db[_0x464d('0x44')][_0x464d('0x24')](_0x4edffc)[_0x464d('0x2a')](function(_0x1602ea){_0x143f48[_0x464d('0x24')]=_0x1602ea;if(_0x58a837[_0x464d('0x37')]['includeAll']){_0x220b32[_0x464d('0x45')]=[{'all':!![]}];}return db[_0x464d('0x44')][_0x464d('0x46')](_0x220b32);})['then'](function(_0x58fce3){_0x143f48[_0x464d('0x47')]=_0x58fce3;return _0x143f48;})[_0x464d('0x2a')](respondWithFilteredResult(_0xffdcc3,_0x220b32))[_0x464d('0x48')](handleError(_0xffdcc3,null));};exports['show']=function(_0x5d440d,_0x11420d){var _0x447a97={'raw':!![],'where':{'id':_0x5d440d['params']['id']}},_0x41a4b9={};_0x41a4b9[_0x464d('0x34')]=_['keys'](db[_0x464d('0x44')][_0x464d('0x31')]);_0x41a4b9[_0x464d('0x37')]=_['keys'](_0x5d440d[_0x464d('0x37')]);_0x41a4b9[_0x464d('0x36')]=_[_0x464d('0x39')](_0x41a4b9['model'],_0x41a4b9[_0x464d('0x37')]);_0x447a97[_0x464d('0x38')]=_['intersection'](_0x41a4b9[_0x464d('0x34')],qs[_0x464d('0x3a')](_0x5d440d['query'][_0x464d('0x3a')]));_0x447a97[_0x464d('0x38')]=_0x447a97[_0x464d('0x38')][_0x464d('0x3b')]?_0x447a97[_0x464d('0x38')]:_0x41a4b9[_0x464d('0x34')];if(_0x5d440d[_0x464d('0x37')][_0x464d('0x49')]){_0x447a97['include']=[{'all':!![]}];}_0x447a97=_['merge']({},_0x447a97,_0x5d440d['options']);return db[_0x464d('0x44')][_0x464d('0x4a')](_0x447a97)['then'](handleEntityNotFound(_0x11420d,null))['then'](respondWithResult(_0x11420d,null))['catch'](handleError(_0x11420d,null));};exports['create']=function(_0x268f2b,_0x9b6fb6){return db[_0x464d('0x44')][_0x464d('0x4b')](_0x268f2b[_0x464d('0x4c')],{})['then'](respondWithResult(_0x9b6fb6,0xc9))['catch'](handleError(_0x9b6fb6,null));};exports[_0x464d('0x29')]=function(_0xca436a,_0x50525a){if(_0xca436a[_0x464d('0x4c')]['id']){delete _0xca436a[_0x464d('0x4c')]['id'];}return db[_0x464d('0x44')]['find']({'where':{'id':_0xca436a[_0x464d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x50525a,null))['then'](saveUpdates(_0xca436a['body'],null))['then'](respondWithResult(_0x50525a,null))[_0x464d('0x48')](handleError(_0x50525a,null));};exports['destroy']=function(_0x204986,_0x3dcbee){return db[_0x464d('0x44')][_0x464d('0x4a')]({'where':{'id':_0x204986[_0x464d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dcbee,null))[_0x464d('0x2a')](removeEntity(_0x3dcbee,null))[_0x464d('0x48')](handleError(_0x3dcbee,null));};exports['describe']=function(_0x26dbc0,_0x1ceee5){return db['ChatInternalMessage'][_0x464d('0x4e')]()[_0x464d('0x2a')](respondWithResult(_0x1ceee5,null))[_0x464d('0x48')](handleError(_0x1ceee5,null));};function wrapUser(_0x3f42ad){return function(_0x5a1457){var _0x2c76cd=_0x3f42ad['get']({'plain':!![]});_0x2c76cd[_0x464d('0x4f')]=[];if(_0x5a1457){_0x2c76cd[_0x464d('0x50')]=_0x5a1457[_0x464d('0x51')];_0x2c76cd[_0x464d('0x52')]=_0x5a1457;}else{_0x2c76cd[_0x464d('0x50')]=moment(0x0)[_0x464d('0x53')](_0x464d('0x54'));_0x2c76cd['lastMessage']={};}return _0x2c76cd;};}exports[_0x464d('0x55')]=function(_0x47d3a5,_0x1dca21,_0x2890c4){var _0x4a759d=[];return db[_0x464d('0x56')][_0x464d('0x46')]({'where':{'role':[_0x464d('0x57'),_0x464d('0x58'),_0x464d('0x59')]},'attributes':['id',_0x464d('0x5a'),_0x464d('0x2d'),_0x464d('0x5b'),_0x464d('0x5c'),_0x464d('0x5d'),_0x464d('0x5e'),_0x464d('0x5f'),_0x464d('0x60'),_0x464d('0x61')],'order':qs[_0x464d('0x3e')](_0x464d('0x62')),'include':[{'model':db[_0x464d('0x63')],'as':_0x464d('0x64'),'attributes':['id',_0x464d('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x464d('0x2a')](function(_0x17aa7b){if(_0x17aa7b){var _0xc8a28a=_0x47d3a5[_0x464d('0x59')]['get']({'plain':!![]});if(!_0xc8a28a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc8a28a['role']===_0x464d('0x59')){return db[_0x464d('0x65')][_0x464d('0x4a')]({'where':{'name':_0x464d('0x66'),'userProfileId':_0xc8a28a[_0x464d('0x67')]},'raw':!![]})[_0x464d('0x2a')](function(_0xef54c3){if(_0xef54c3){if(_0xef54c3[_0x464d('0x68')]===0x0){return db['UserProfileResource'][_0x464d('0x46')]({'where':{'sectionId':_0xef54c3['id']},'raw':!![]})[_0x464d('0x2a')](function(_0x4dd829){var _0x2af883=[];if(_[_0x464d('0x69')](_0x4dd829)){_0x2af883=_[_0x464d('0x41')](_0x17aa7b,function(_0x298d74){if(_0x298d74[_0x464d('0x5b')]!==_0x464d('0x57')){return _0x298d74;}});return _0x2af883;}else{for(var _0x58c89c=0x0;_0x58c89c<_0x17aa7b[_0x464d('0x3b')];_0x58c89c++){var _0x26eb5e=_0x17aa7b[_0x58c89c];if(_0x26eb5e[_0x464d('0x5b')]===_0x464d('0x57')){var _0x193b3c=_['find'](_0x4dd829,function(_0x226a66){return _0x226a66['resourceId']===_0x26eb5e['id'];});if(_0x193b3c)_0x2af883[_0x464d('0x6a')](_0x26eb5e);}else{_0x2af883['push'](_0x26eb5e);}}return _0x2af883;}});}else{return _0x17aa7b;}}else{var _0x4025c5=_[_0x464d('0x41')](_0x17aa7b,function(_0x531c9f){if(_0x531c9f[_0x464d('0x5b')]!==_0x464d('0x57')){return _0x531c9f;}});return _0x4025c5;}});}else{return _0x17aa7b;}}})['then'](function(_0x25871c){var _0x232d1f=[];if(_0x25871c){_0x4a759d=_0x25871c;for(var _0x592cc4=0x0;_0x592cc4<_0x25871c['length'];_0x592cc4+=0x1){_0x4a759d[_0x592cc4]['messages']=[];_0x232d1f['push'](db[_0x464d('0x44')][_0x464d('0x4a')]({'where':{'FromId':[_0x47d3a5[_0x464d('0x59')]['id'],_0x25871c[_0x592cc4]['id']],'ToId':[_0x47d3a5['user']['id'],_0x25871c[_0x592cc4]['id']],'ChatGroupId':null},'attributes':['id',_0x464d('0x51'),_0x464d('0x6b'),_0x464d('0x6c'),_0x464d('0x6d'),'body'],'order':qs['sort'](_0x464d('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x464d('0x2a')](wrapUser(_0x25871c[_0x592cc4])));}return BPromise[_0x464d('0x6f')](_0x232d1f);}return[];})['then'](function(_0x42f829){return{'rows':_0x42f829,'count':_0x42f829[_0x464d('0x3b')]};})[_0x464d('0x2a')](respondWithResult(_0x1dca21,null))['catch'](handleError(_0x1dca21,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index e1676a9..914043c 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 _0x7f74=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x7f74,0x126));var _0x47f7=function(_0x408cc5,_0x47f260){_0x408cc5=_0x408cc5-0x0;var _0x29c37a=_0x7f74[_0x408cc5];return _0x29c37a;};'use strict';var EventEmitter=require(_0x47f7('0x0'));var ChatInternalMessage=require(_0x47f7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x47f7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x47f7('0x3')};function emitEvent(_0x48eae9){return function(_0xb7a6ec,_0x2fc4c0,_0x4b09be){ChatInternalMessageEvents['emit'](_0x48eae9+':'+_0xb7a6ec['id'],_0xb7a6ec);ChatInternalMessageEvents[_0x47f7('0x4')](_0x48eae9,_0xb7a6ec);_0x4b09be(null);};}for(var e in events){if(events[_0x47f7('0x5')](e)){var event=events[e];ChatInternalMessage[_0x47f7('0x6')](e,emitEvent(event));}}module[_0x47f7('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x6e8b=['events','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x76f220,_0x3e6f86){var _0x296467=function(_0x4cf17e){while(--_0x4cf17e){_0x76f220['push'](_0x76f220['shift']());}};_0x296467(++_0x3e6f86);}(_0x6e8b,0x156));var _0xb6e8=function(_0x5e913f,_0x265fc0){_0x5e913f=_0x5e913f-0x0;var _0x472cc4=_0x6e8b[_0x5e913f];return _0x472cc4;};'use strict';var EventEmitter=require(_0xb6e8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xb6e8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb6e8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6e8('0x3'),'afterDestroy':_0xb6e8('0x4')};function emitEvent(_0x29bc9e){return function(_0xe1a77b,_0x16be31,_0x416ab4){ChatInternalMessageEvents[_0xb6e8('0x5')](_0x29bc9e+':'+_0xe1a77b['id'],_0xe1a77b);ChatInternalMessageEvents[_0xb6e8('0x5')](_0x29bc9e,_0xe1a77b);_0x416ab4(null);};}for(var e in events){if(events[_0xb6e8('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb6e8('0x7')](e,emitEvent(event));}}module[_0xb6e8('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b445d3c..cebf616 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 _0xba60=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','lodash','api','moment','bluebird'];(function(_0x100ddc,_0x1b833d){var _0x1ace25=function(_0x513d80){while(--_0x513d80){_0x100ddc['push'](_0x100ddc['shift']());}};_0x1ace25(++_0x1b833d);}(_0xba60,0x1d0));var _0x0ba6=function(_0x56c568,_0x5c5a9a){_0x56c568=_0x56c568-0x0;var _0x11116e=_0xba60[_0x56c568];return _0x11116e;};'use strict';var _=require(_0x0ba6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ba6('0x1'));var moment=require(_0x0ba6('0x2'));var BPromise=require(_0x0ba6('0x3'));var rp=require(_0x0ba6('0x4'));var fs=require('fs');var path=require(_0x0ba6('0x5'));var rimraf=require(_0x0ba6('0x6'));var config=require(_0x0ba6('0x7'));var attributes=require(_0x0ba6('0x8'));module[_0x0ba6('0x9')]=function(_0x278904,_0x24a853){return _0x278904[_0x0ba6('0xa')](_0x0ba6('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ba6('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x780b=['moment','request-promise','path','rimraf','../../config/environment','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x41bdb7,_0x2d3c1c){var _0xa1e594=function(_0x4aa014){while(--_0x4aa014){_0x41bdb7['push'](_0x41bdb7['shift']());}};_0xa1e594(++_0x2d3c1c);}(_0x780b,0x15e));var _0xb780=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x780b[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xb780('0x0'));var util=require('util');var logger=require(_0xb780('0x1'))('api');var moment=require(_0xb780('0x2'));var BPromise=require('bluebird');var rp=require(_0xb780('0x3'));var fs=require('fs');var path=require(_0xb780('0x4'));var rimraf=require(_0xb780('0x5'));var config=require(_0xb780('0x6'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x479b02,_0x28c971){return _0x479b02[_0xb780('0x7')]('ChatInternalMessage',attributes,{'tableName':_0xb780('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb780('0x9'),'collate':_0xb780('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 4084efd..8e32feb 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 _0xf37f=['request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x54ef06,_0x4d7a06){var _0x1c387d=function(_0x1ccdc0){while(--_0x1ccdc0){_0x54ef06['push'](_0x54ef06['shift']());}};_0x1c387d(++_0x4d7a06);}(_0xf37f,0x11a));var _0xff37=function(_0x5c62fb,_0x4f913b){_0x5c62fb=_0x5c62fb-0x0;var _0x4a8f34=_0xf37f[_0x5c62fb];return _0x4a8f34;};'use strict';var _=require('lodash');var util=require(_0xff37('0x0'));var moment=require('moment');var BPromise=require(_0xff37('0x1'));var rs=require(_0xff37('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff37('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xff37('0x4'))(_0xff37('0x5'));var config=require('../../config/environment');var jayson=require(_0xff37('0x6'));var client=jayson[_0xff37('0x7')][_0xff37('0x8')]({'port':0x232a});config['redis']=_[_0xff37('0x9')](config[_0xff37('0xa')],{'host':_0xff37('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xff37('0xc'))[_0xff37('0xd')](socket);function respondWithRpcPromise(_0x115deb,_0x2ee7a8,_0x4b64f0){return new BPromise(function(_0x1ed7a9,_0x1235a1){return client[_0xff37('0xe')](_0x115deb,_0x4b64f0)[_0xff37('0xf')](function(_0x4e521f){logger[_0xff37('0x10')](_0xff37('0x11'),_0x2ee7a8,_0xff37('0x12'));logger['debug'](_0xff37('0x13'),_0x2ee7a8,_0xff37('0x12'),JSON[_0xff37('0x14')](_0x4e521f));if(_0x4e521f['error']){if(_0x4e521f[_0xff37('0x15')][_0xff37('0x16')]===0x1f4){logger[_0xff37('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2ee7a8,_0x4e521f[_0xff37('0x15')][_0xff37('0x17')]);return _0x1235a1(_0x4e521f[_0xff37('0x15')][_0xff37('0x17')]);}logger[_0xff37('0x15')](_0xff37('0x11'),_0x2ee7a8,_0x4e521f[_0xff37('0x15')][_0xff37('0x17')]);return _0x1ed7a9(_0x4e521f[_0xff37('0x15')][_0xff37('0x17')]);}else{logger['info'](_0xff37('0x11'),_0x2ee7a8,_0xff37('0x12'));_0x1ed7a9(_0x4e521f['result'][_0xff37('0x17')]);}})[_0xff37('0x18')](function(_0x2683fc){logger['error'](_0xff37('0x11'),_0x2ee7a8,_0x2683fc);_0x1235a1(_0x2683fc);});});} \ No newline at end of file +var _0x8b4f=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x203965,_0x55a9a9){var _0x4ac741=function(_0x1cf2dd){while(--_0x1cf2dd){_0x203965['push'](_0x203965['shift']());}};_0x4ac741(++_0x55a9a9);}(_0x8b4f,0x19d));var _0xf8b4=function(_0x21ccfc,_0x48834e){_0x21ccfc=_0x21ccfc-0x0;var _0x279454=_0x8b4f[_0x21ccfc];return _0x279454;};'use strict';var _=require(_0xf8b4('0x0'));var util=require(_0xf8b4('0x1'));var moment=require('moment');var BPromise=require(_0xf8b4('0x2'));var rs=require(_0xf8b4('0x3'));var fs=require('fs');var Redis=require(_0xf8b4('0x4'));var db=require(_0xf8b4('0x5'))['db'];var utils=require(_0xf8b4('0x6'));var logger=require(_0xf8b4('0x7'))(_0xf8b4('0x8'));var config=require(_0xf8b4('0x9'));var jayson=require(_0xf8b4('0xa'));var client=jayson['client'][_0xf8b4('0xb')]({'port':0x232a});config[_0xf8b4('0xc')]=_[_0xf8b4('0xd')](config['redis'],{'host':_0xf8b4('0xe'),'port':0x18eb});var socket=require(_0xf8b4('0xf'))(new Redis(config[_0xf8b4('0xc')]));require(_0xf8b4('0x10'))[_0xf8b4('0x11')](socket);function respondWithRpcPromise(_0x1d67f3,_0x370355,_0x5c2600){return new BPromise(function(_0x48a903,_0x476b81){return client['request'](_0x1d67f3,_0x5c2600)[_0xf8b4('0x12')](function(_0x2ebe99){logger[_0xf8b4('0x13')](_0xf8b4('0x14'),_0x370355,_0xf8b4('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x370355,_0xf8b4('0x15'),JSON[_0xf8b4('0x16')](_0x2ebe99));if(_0x2ebe99[_0xf8b4('0x17')]){if(_0x2ebe99[_0xf8b4('0x17')][_0xf8b4('0x18')]===0x1f4){logger[_0xf8b4('0x17')](_0xf8b4('0x14'),_0x370355,_0x2ebe99[_0xf8b4('0x17')][_0xf8b4('0x19')]);return _0x476b81(_0x2ebe99[_0xf8b4('0x17')][_0xf8b4('0x19')]);}logger[_0xf8b4('0x17')](_0xf8b4('0x14'),_0x370355,_0x2ebe99[_0xf8b4('0x17')][_0xf8b4('0x19')]);return _0x48a903(_0x2ebe99['error'][_0xf8b4('0x19')]);}else{logger[_0xf8b4('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x370355,_0xf8b4('0x15'));_0x48a903(_0x2ebe99[_0xf8b4('0x1a')]['message']);}})[_0xf8b4('0x1b')](function(_0x1d2ab4){logger[_0xf8b4('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x370355,_0x1d2ab4);_0x476b81(_0x1d2ab4);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index fc679b1..39b81b3 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 _0x8059=['register','length','chatInternalMessage:','save','update','removeListener'];(function(_0x450ccc,_0x4b0501){var _0x34e767=function(_0x134a8a){while(--_0x134a8a){_0x450ccc['push'](_0x450ccc['shift']());}};_0x34e767(++_0x4b0501);}(_0x8059,0x1b3));var _0x9805=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0x8059[_0x1034bb];return _0x453fdb;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x9805('0x0'),'remove',_0x9805('0x1')];function createListener(_0x565b89,_0x4a82a8){return function(_0x5f4efd){_0x4a82a8['emit'](_0x565b89,_0x5f4efd);};}function removeListener(_0x2abb35,_0x5ec3d9){return function(){ChatInternalMessageEvents[_0x9805('0x2')](_0x2abb35,_0x5ec3d9);};}exports[_0x9805('0x3')]=function(_0xec4c68){for(var _0x163bb4=0x0,_0x32e890=events[_0x9805('0x4')];_0x163bb4<_0x32e890;_0x163bb4++){var _0x30b8ce=events[_0x163bb4];var _0x1f80b5=createListener(_0x9805('0x5')+_0x30b8ce,_0xec4c68);ChatInternalMessageEvents['on'](_0x30b8ce,_0x1f80b5);}}; \ No newline at end of file +var _0x80b1=['./chatInternalMessage.events','save','remove','emit','removeListener','length','chatInternalMessage:'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x80b1,0x165));var _0x180b=function(_0x4c7ee1,_0xdd33ba){_0x4c7ee1=_0x4c7ee1-0x0;var _0x3576fb=_0x80b1[_0x4c7ee1];return _0x3576fb;};'use strict';var ChatInternalMessageEvents=require(_0x180b('0x0'));var events=[_0x180b('0x1'),_0x180b('0x2'),'update'];function createListener(_0x1c8510,_0x3834db){return function(_0x24ed0c){_0x3834db[_0x180b('0x3')](_0x1c8510,_0x24ed0c);};}function removeListener(_0x345b44,_0x5e006c){return function(){ChatInternalMessageEvents[_0x180b('0x4')](_0x345b44,_0x5e006c);};}exports['register']=function(_0x4ecfaa){for(var _0x4b4665=0x0,_0x25fd12=events[_0x180b('0x5')];_0x4b4665<_0x25fd12;_0x4b4665++){var _0x35630a=events[_0x4b4665];var _0x2559e7=createListener(_0x180b('0x6')+_0x35630a,_0x4ecfaa);ChatInternalMessageEvents['on'](_0x35630a,_0x2559e7);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index b4c6366..66a8743 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 _0x9702=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/users','getUsers','/:id','create','put','update','delete','destroy','multer','util','path'];(function(_0x4637bb,_0x31b748){var _0x565b74=function(_0x1a5d23){while(--_0x1a5d23){_0x4637bb['push'](_0x4637bb['shift']());}};_0x565b74(++_0x31b748);}(_0x9702,0x1dd));var _0x2970=function(_0x1f4a14,_0x382f12){_0x1f4a14=_0x1f4a14-0x0;var _0x37f00a=_0x9702[_0x1f4a14];return _0x37f00a;};'use strict';var multer=require(_0x2970('0x0'));var util=require(_0x2970('0x1'));var path=require(_0x2970('0x2'));var timeout=require('connect-timeout');var express=require(_0x2970('0x3'));var router=express['Router']();var fs_extra=require(_0x2970('0x4'));var auth=require(_0x2970('0x5'));var interaction=require(_0x2970('0x6'));var config=require(_0x2970('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x2970('0x8')](),controller['index']);router[_0x2970('0x9')](_0x2970('0xa'),auth[_0x2970('0x8')](),controller[_0x2970('0xb')]);router[_0x2970('0x9')](_0x2970('0xc'),auth[_0x2970('0x8')](),controller[_0x2970('0xd')]);router[_0x2970('0x9')](_0x2970('0xe'),auth[_0x2970('0x8')](),controller['show']);router['post']('/',auth[_0x2970('0x8')](),controller[_0x2970('0xf')]);router[_0x2970('0x10')](_0x2970('0xe'),controller[_0x2970('0x11')]);router[_0x2970('0x12')](_0x2970('0xe'),auth[_0x2970('0x8')](),controller[_0x2970('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe0c9=['delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','/describe','describe','isAuthenticated','/:id','show','create','put','update'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xe0c9,0x1ba));var _0x9e0c=function(_0x6aef1c,_0x3b4e6f){_0x6aef1c=_0x6aef1c-0x0;var _0x8b1e21=_0xe0c9[_0x6aef1c];return _0x8b1e21;};'use strict';var multer=require(_0x9e0c('0x0'));var util=require(_0x9e0c('0x1'));var path=require(_0x9e0c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e0c('0x3')]();var fs_extra=require(_0x9e0c('0x4'));var auth=require(_0x9e0c('0x5'));var interaction=require(_0x9e0c('0x6'));var config=require(_0x9e0c('0x7'));var controller=require(_0x9e0c('0x8'));router[_0x9e0c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9e0c('0x9')](_0x9e0c('0xa'),auth['isAuthenticated'](),controller[_0x9e0c('0xb')]);router[_0x9e0c('0x9')]('/users',auth[_0x9e0c('0xc')](),controller['getUsers']);router[_0x9e0c('0x9')](_0x9e0c('0xd'),auth['isAuthenticated'](),controller[_0x9e0c('0xe')]);router['post']('/',auth[_0x9e0c('0xc')](),controller[_0x9e0c('0xf')]);router[_0x9e0c('0x10')](_0x9e0c('0xd'),controller[_0x9e0c('0x11')]);router[_0x9e0c('0x12')]('/:id',auth[_0x9e0c('0xc')](),controller['destroy']);module[_0x9e0c('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 967ac20..001c0ba 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 _0xdc9b=['TEXT','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x3da6f1,_0x50c628){var _0x43e64e=function(_0x28fcbc){while(--_0x28fcbc){_0x3da6f1['push'](_0x3da6f1['shift']());}};_0x43e64e(++_0x50c628);}(_0xdc9b,0x70));var _0xbdc9=function(_0x3259e0,_0x230732){_0x3259e0=_0x3259e0-0x0;var _0x2003e3=_0xdc9b[_0x3259e0];return _0x2003e3;};'use strict';var Sequelize=require(_0xbdc9('0x0'));module[_0xbdc9('0x1')]={'body':{'type':Sequelize[_0xbdc9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbdc9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbdc9('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbdc9('0x2')]}}; \ No newline at end of file +var _0x4cf8=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x4a3e77,_0x564d8c){var _0x210ce7=function(_0x1d63bc){while(--_0x1d63bc){_0x4a3e77['push'](_0x4a3e77['shift']());}};_0x210ce7(++_0x564d8c);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x12a020,_0x85b476){_0x12a020=_0x12a020-0x0;var _0x63cddd=_0x4cf8[_0x12a020];return _0x63cddd;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'body':{'type':Sequelize[_0x84cf('0x2')](_0x84cf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x84cf('0x5')]('in',_0x84cf('0x6')),'defaultValue':_0x84cf('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x84cf('0x7')]},'providerName':{'type':Sequelize[_0x84cf('0x8')]},'providerResponse':{'type':Sequelize[_0x84cf('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 5e231ee..337cd84 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 _0x4a8b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','rows','show','params','rawAttributes','create','body','find','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','sequelize','SELECT','contact','fullname','SIP/%s','channel','accept','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','User','email','interface','motionChannel','event','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x5a74ea,_0x1acb99){var _0x144892=function(_0x13a4ff){while(--_0x13a4ff){_0x5a74ea['push'](_0x5a74ea['shift']());}};_0x144892(++_0x1acb99);}(_0x4a8b,0xd0));var _0xb4a8=function(_0x4110a1,_0x266437){_0x4110a1=_0x4110a1-0x0;var _0x5679a2=_0x4a8b[_0x4110a1];return _0x5679a2;};'use strict';var emlformat=require(_0xb4a8('0x0'));var rimraf=require(_0xb4a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4a8('0x2'));var rp=require('request-promise');var moment=require(_0xb4a8('0x3'));var BPromise=require(_0xb4a8('0x4'));var Mustache=require(_0xb4a8('0x5'));var util=require(_0xb4a8('0x6'));var path=require(_0xb4a8('0x7'));var sox=require(_0xb4a8('0x8'));var csv=require(_0xb4a8('0x9'));var ejs=require(_0xb4a8('0xa'));var fs=require('fs');var fs_extra=require(_0xb4a8('0xb'));var _=require(_0xb4a8('0xc'));var squel=require(_0xb4a8('0xd'));var crypto=require(_0xb4a8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb4a8('0xf'));var toCsv=require(_0xb4a8('0x9'));var querystring=require(_0xb4a8('0x10'));var Papa=require(_0xb4a8('0x11'));var Redis=require(_0xb4a8('0x12'));var authService=require(_0xb4a8('0x13'));var qs=require(_0xb4a8('0x14'));var as=require(_0xb4a8('0x15'));var hardwareService=require(_0xb4a8('0x16'));var logger=require(_0xb4a8('0x17'))(_0xb4a8('0x18'));var utils=require(_0xb4a8('0x19'));var config=require(_0xb4a8('0x1a'));var licenseUtil=require(_0xb4a8('0x1b'));var db=require('../../mysqldb')['db'];config[_0xb4a8('0x1c')]=_[_0xb4a8('0x1d')](config[_0xb4a8('0x1c')],{'host':_0xb4a8('0x1e'),'port':0x18eb});var socket=require(_0xb4a8('0x1f'))(new Redis(config['redis']));require(_0xb4a8('0x20'))[_0xb4a8('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb4a8('0x22')]['http']({'port':0x232c});var client9002=jayson['client'][_0xb4a8('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x8ca89a,_0xd85f6d,_0x1c29ed,_0x1da02f){return new BPromise(function(_0x2878d4,_0x30bb95){var _0x42765d=_0x1da02f||client;return _0x42765d[_0xb4a8('0x24')](_0x8ca89a,_0x1c29ed)[_0xb4a8('0x25')](function(_0x2796d0){logger[_0xb4a8('0x26')]('ChatMessage,\x20%s,\x20%s',_0xd85f6d,'request\x20sent');logger['debug'](_0xb4a8('0x27'),_0xd85f6d,_0xb4a8('0x28'),JSON['stringify'](_0x2796d0));if(_0x2796d0[_0xb4a8('0x29')]){if(_0x2796d0[_0xb4a8('0x29')][_0xb4a8('0x2a')]===0x1f4){logger[_0xb4a8('0x29')](_0xb4a8('0x2b'),_0xd85f6d,_0x2796d0['error'][_0xb4a8('0x2c')]);return _0x30bb95(_0x2796d0['error'][_0xb4a8('0x2c')]);}logger[_0xb4a8('0x29')](_0xb4a8('0x2b'),_0xd85f6d,_0x2796d0['error']['message']);return _0x2878d4(_0x2796d0[_0xb4a8('0x29')]['message']);}else{logger[_0xb4a8('0x26')]('ChatMessage,\x20%s,\x20%s',_0xd85f6d,'request\x20sent');_0x2878d4(_0x2796d0[_0xb4a8('0x2d')][_0xb4a8('0x2c')]);}})[_0xb4a8('0x2e')](function(_0x46cbbb){logger[_0xb4a8('0x29')]('ChatMessage,\x20%s,\x20%s',_0xd85f6d,_0x46cbbb);_0x30bb95(_0x46cbbb);});});}function respondWithStatusCode(_0x1bb592,_0x3e8f03){_0x3e8f03=_0x3e8f03||0xcc;return function(_0x1ebac3){if(_0x1ebac3){return _0x1bb592[_0xb4a8('0x2f')](_0x3e8f03);}return _0x1bb592[_0xb4a8('0x30')](_0x3e8f03)[_0xb4a8('0x31')]();};}function respondWithResult(_0x1caccf,_0x3a2aaf){_0x3a2aaf=_0x3a2aaf||0xc8;return function(_0x7c8281){if(_0x7c8281){return _0x1caccf[_0xb4a8('0x30')](_0x3a2aaf)[_0xb4a8('0x32')](_0x7c8281);}};}function respondWithFilteredResult(_0x361abd,_0x176a87){return function(_0x53d87c){if(_0x53d87c){var _0x38f89c=typeof _0x176a87[_0xb4a8('0x33')]===_0xb4a8('0x34')&&typeof _0x176a87[_0xb4a8('0x35')]==='undefined';var _0x2e8faa=_0x53d87c['count'];var _0x59d2c4=_0x38f89c?0x0:_0x176a87['offset'];var _0x590160=_0x38f89c?_0x53d87c[_0xb4a8('0x36')]:_0x176a87[_0xb4a8('0x33')]+_0x176a87[_0xb4a8('0x35')];var _0x2eeed4;if(_0x590160>=_0x2e8faa){_0x590160=_0x2e8faa;_0x2eeed4=0xc8;}else{_0x2eeed4=0xce;}_0x361abd[_0xb4a8('0x30')](_0x2eeed4);return _0x361abd[_0xb4a8('0x37')](_0xb4a8('0x38'),_0x59d2c4+'-'+_0x590160+'/'+_0x2e8faa)[_0xb4a8('0x32')](_0x53d87c);}return null;};}function patchUpdates(_0x21a98a){return function(_0x592c37){try{jsonpatch[_0xb4a8('0x39')](_0x592c37,_0x21a98a,!![]);}catch(_0x1267a6){return BPromise[_0xb4a8('0x3a')](_0x1267a6);}return _0x592c37[_0xb4a8('0x3b')]();};}function saveUpdates(_0x3ecda8,_0x26b658){return function(_0x539d43){if(_0x539d43){return _0x539d43[_0xb4a8('0x3c')](_0x3ecda8)[_0xb4a8('0x25')](function(_0x12e801){return _0x12e801;});}return null;};}function removeEntity(_0x23fd0b,_0x4cbabe){return function(_0x2f91ec){if(_0x2f91ec){return _0x2f91ec[_0xb4a8('0x3d')]()[_0xb4a8('0x25')](function(){_0x23fd0b['status'](0xcc)[_0xb4a8('0x31')]();});}};}function handleEntityNotFound(_0xfcf82e,_0x896034){return function(_0x318c75){if(!_0x318c75){_0xfcf82e[_0xb4a8('0x2f')](0x194);}return _0x318c75;};}function handleError(_0x893975,_0x1e2288){_0x1e2288=_0x1e2288||0x1f4;return function(_0x5165e5){logger[_0xb4a8('0x29')](_0x5165e5['stack']);if(_0x5165e5[_0xb4a8('0x3e')]){delete _0x5165e5['name'];}_0x893975[_0xb4a8('0x30')](_0x1e2288)[_0xb4a8('0x3f')](_0x5165e5);};}exports[_0xb4a8('0x40')]=function(_0x450915,_0x538b8a){var _0x5eaf7d={},_0x13d737={},_0x5a5d7e={'count':0x0,'rows':[]};var _0x3592ab=_[_0xb4a8('0x41')](db['ChatMessage']['rawAttributes'],function(_0x506f0f){return{'name':_0x506f0f[_0xb4a8('0x42')],'type':_0x506f0f[_0xb4a8('0x43')][_0xb4a8('0x44')]};});_0x13d737[_0xb4a8('0x45')]=_[_0xb4a8('0x41')](_0x3592ab,'name');_0x13d737[_0xb4a8('0x46')]=_[_0xb4a8('0x47')](_0x450915[_0xb4a8('0x46')]);_0x13d737[_0xb4a8('0x48')]=_[_0xb4a8('0x49')](_0x13d737[_0xb4a8('0x45')],_0x13d737[_0xb4a8('0x46')]);_0x5eaf7d[_0xb4a8('0x4a')]=_[_0xb4a8('0x49')](_0x13d737[_0xb4a8('0x45')],qs[_0xb4a8('0x4b')](_0x450915[_0xb4a8('0x46')]['fields']));_0x5eaf7d['attributes']=_0x5eaf7d[_0xb4a8('0x4a')][_0xb4a8('0x4c')]?_0x5eaf7d[_0xb4a8('0x4a')]:_0x13d737['model'];if(!_0x450915[_0xb4a8('0x46')][_0xb4a8('0x4d')](_0xb4a8('0x4e'))){_0x5eaf7d['limit']=qs[_0xb4a8('0x35')](_0x450915[_0xb4a8('0x46')]['limit']);_0x5eaf7d[_0xb4a8('0x33')]=qs[_0xb4a8('0x33')](_0x450915[_0xb4a8('0x46')]['offset']);}_0x5eaf7d[_0xb4a8('0x4f')]=qs[_0xb4a8('0x50')](_0x450915[_0xb4a8('0x46')][_0xb4a8('0x50')]);_0x5eaf7d[_0xb4a8('0x51')]=qs[_0xb4a8('0x48')](_[_0xb4a8('0x52')](_0x450915['query'],_0x13d737[_0xb4a8('0x48')]),_0x3592ab);if(_0x450915['query'][_0xb4a8('0x53')]){_0x5eaf7d[_0xb4a8('0x51')]=_[_0xb4a8('0x54')](_0x5eaf7d[_0xb4a8('0x51')],{'$or':_['map'](_0x3592ab,function(_0x36d591){if(_0x36d591['type']!==_0xb4a8('0x55')){var _0x546f7f={};_0x546f7f[_0x36d591[_0xb4a8('0x3e')]]={'$like':'%'+_0x450915[_0xb4a8('0x46')][_0xb4a8('0x53')]+'%'};return _0x546f7f;}})});}_0x5eaf7d=_[_0xb4a8('0x54')]({},_0x5eaf7d,_0x450915[_0xb4a8('0x56')]);var _0x5ba38d={'where':_0x5eaf7d[_0xb4a8('0x51')]};return db[_0xb4a8('0x57')][_0xb4a8('0x36')](_0x5ba38d)[_0xb4a8('0x25')](function(_0xc96028){_0x5a5d7e[_0xb4a8('0x36')]=_0xc96028;if(_0x450915[_0xb4a8('0x46')][_0xb4a8('0x58')]){_0x5eaf7d[_0xb4a8('0x59')]=[{'all':!![]}];}return db[_0xb4a8('0x57')]['findAll'](_0x5eaf7d);})[_0xb4a8('0x25')](function(_0x1de657){_0x5a5d7e[_0xb4a8('0x5a')]=_0x1de657;return _0x5a5d7e;})[_0xb4a8('0x25')](respondWithFilteredResult(_0x538b8a,_0x5eaf7d))[_0xb4a8('0x2e')](handleError(_0x538b8a,null));};exports[_0xb4a8('0x5b')]=function(_0x319cdf,_0x5afd9d){var _0x22cdc0={'raw':!![],'where':{'id':_0x319cdf[_0xb4a8('0x5c')]['id']}},_0x30ba00={};_0x30ba00[_0xb4a8('0x45')]=_[_0xb4a8('0x47')](db['ChatMessage'][_0xb4a8('0x5d')]);_0x30ba00['query']=_[_0xb4a8('0x47')](_0x319cdf[_0xb4a8('0x46')]);_0x30ba00[_0xb4a8('0x48')]=_['intersection'](_0x30ba00[_0xb4a8('0x45')],_0x30ba00['query']);_0x22cdc0[_0xb4a8('0x4a')]=_[_0xb4a8('0x49')](_0x30ba00['model'],qs[_0xb4a8('0x4b')](_0x319cdf['query'][_0xb4a8('0x4b')]));_0x22cdc0[_0xb4a8('0x4a')]=_0x22cdc0[_0xb4a8('0x4a')][_0xb4a8('0x4c')]?_0x22cdc0[_0xb4a8('0x4a')]:_0x30ba00[_0xb4a8('0x45')];if(_0x319cdf[_0xb4a8('0x46')][_0xb4a8('0x58')]){_0x22cdc0[_0xb4a8('0x59')]=[{'all':!![]}];}_0x22cdc0=_['merge']({},_0x22cdc0,_0x319cdf[_0xb4a8('0x56')]);return db[_0xb4a8('0x57')]['find'](_0x22cdc0)[_0xb4a8('0x25')](handleEntityNotFound(_0x5afd9d,null))['then'](respondWithResult(_0x5afd9d,null))[_0xb4a8('0x2e')](handleError(_0x5afd9d,null));};exports[_0xb4a8('0x5e')]=function(_0x8e7479,_0x51354e){return db[_0xb4a8('0x57')][_0xb4a8('0x5e')](_0x8e7479[_0xb4a8('0x5f')],{})[_0xb4a8('0x25')](respondWithResult(_0x51354e,0xc9))[_0xb4a8('0x2e')](handleError(_0x51354e,null));};exports[_0xb4a8('0x3c')]=function(_0x2d2fed,_0xb6f7cb){if(_0x2d2fed[_0xb4a8('0x5f')]['id']){delete _0x2d2fed[_0xb4a8('0x5f')]['id'];}return db['ChatMessage'][_0xb4a8('0x60')]({'where':{'id':_0x2d2fed[_0xb4a8('0x5c')]['id']}})[_0xb4a8('0x25')](handleEntityNotFound(_0xb6f7cb,null))[_0xb4a8('0x25')](saveUpdates(_0x2d2fed[_0xb4a8('0x5f')],null))['then'](respondWithResult(_0xb6f7cb,null))[_0xb4a8('0x2e')](handleError(_0xb6f7cb,null));};exports['destroy']=function(_0x342418,_0x29f6c0){return db[_0xb4a8('0x57')][_0xb4a8('0x60')]({'where':{'id':_0x342418['params']['id']}})[_0xb4a8('0x25')](handleEntityNotFound(_0x29f6c0,null))[_0xb4a8('0x25')](removeEntity(_0x29f6c0,null))[_0xb4a8('0x2e')](handleError(_0x29f6c0,null));};exports[_0xb4a8('0x61')]=function(_0x259c4d,_0x5f2273){return db[_0xb4a8('0x57')]['describe']()[_0xb4a8('0x25')](respondWithResult(_0x5f2273,null))[_0xb4a8('0x2e')](handleError(_0x5f2273,null));};var interaction_log=require(_0xb4a8('0x17'))(_0xb4a8('0x62'));exports['accept']=function(_0x57811a,_0x76bcb4,_0xb18a13){var _0x56dac1={'agent':{},'channel':_0xb4a8('0x63')};if(_0x57811a['body']['id']){delete _0x57811a[_0xb4a8('0x5f')]['id'];}_0x57811a[_0xb4a8('0x5f')][_0xb4a8('0x64')]=!![];_0x57811a['body'][_0xb4a8('0x65')]=moment()[_0xb4a8('0x66')](_0xb4a8('0x67'));_0x57811a[_0xb4a8('0x5f')]['UserId']=_0x57811a[_0xb4a8('0x5f')][_0xb4a8('0x68')]||_0x57811a['user']['id'];_0x56dac1[_0xb4a8('0x69')]['id']=_0x57811a[_0xb4a8('0x5f')][_0xb4a8('0x68')];return db['ChatMessage'][_0xb4a8('0x60')]({'where':{'id':_0x57811a[_0xb4a8('0x5c')]['id'],'UserId':null}})[_0xb4a8('0x25')](handleEntityNotFound(_0x76bcb4,null))[_0xb4a8('0x25')](saveUpdates(_0x57811a[_0xb4a8('0x5f')],null))[_0xb4a8('0x25')](function(_0x4364b1){if(_0x4364b1){_0x56dac1[_0xb4a8('0x2c')]=_0x4364b1[_0xb4a8('0x6a')]({'plain':!![]});return db['ChatInteraction'][_0xb4a8('0x60')]({'where':{'id':_0x4364b1[_0xb4a8('0x6b')]}});}return null;})[_0xb4a8('0x25')](handleEntityNotFound(_0x76bcb4,null))[_0xb4a8('0x25')](function(_0x4c594a){if(_0x4c594a){return _0x4c594a[_0xb4a8('0x3c')]({'UserId':_0x57811a['body']['UserId'],'read1stAt':_[_0xb4a8('0x6c')](_0x4c594a[_0xb4a8('0x6d')])?moment()[_0xb4a8('0x66')](_0xb4a8('0x67')):undefined});}return null;})['then'](function(_0x53396f){if(_0x53396f){_0x56dac1[_0xb4a8('0x6e')]=_0x53396f[_0xb4a8('0x6a')]({'plain':!![]});interaction_log[_0xb4a8('0x26')](_0xb4a8('0x6f'),_0x57811a[_0xb4a8('0x70')]['id'],_0x57811a[_0xb4a8('0x70')][_0xb4a8('0x3e')],_0x57811a[_0xb4a8('0x70')][_0xb4a8('0x71')],_0x56dac1['interaction']['id'],_0x57811a[_0xb4a8('0x5f')]?JSON['stringify'](_0x57811a[_0xb4a8('0x5f')]):_0xb4a8('0x72'));return respondWithRpcPromise(_0xb4a8('0x73'),_0xb4a8('0x74'),_0x56dac1);}return null;})[_0xb4a8('0x25')](function(_0xc54f92){var _0x5a8dbf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xc54f92['message']['ContactId'];return db[_0xb4a8('0x75')][_0xb4a8('0x46')](_0x5a8dbf,{'type':db['Sequelize']['QueryTypes'][_0xb4a8('0x76')],'raw':!![]})[_0xb4a8('0x25')](function(_0xfdf720){return _0xfdf720;});})[_0xb4a8('0x25')](function(_0x1ed267){if(_0x1ed267){_0x56dac1[_0xb4a8('0x2c')][_0xb4a8('0x77')]=_0x1ed267[0x0];if(!_0x57811a['body'][_0xb4a8('0x68')])return;return db['User'][_0xb4a8('0x60')]({'where':{'id':_0x57811a[_0xb4a8('0x5f')][_0xb4a8('0x68')],'role':_0xb4a8('0x69')},'attributes':['id',_0xb4a8('0x3e'),_0xb4a8('0x78'),'email','internal'],'raw':!![]});}return null;})[_0xb4a8('0x25')](function(_0x14e0d7){if(!_0x14e0d7)return null;_0x56dac1[_0xb4a8('0x2c')][_0xb4a8('0x69')]=_0x14e0d7;return _0x56dac1;})[_0xb4a8('0x25')](function(_0x4e563d){if(_0x4e563d){if(_0x57811a[_0xb4a8('0x5f')]['manual']){_0x56dac1[_0xb4a8('0x2c')]['interface']=util[_0xb4a8('0x66')](_0xb4a8('0x79'),_0x57811a['user'][_0xb4a8('0x3e')]);_0x56dac1['message'][_0xb4a8('0x7a')]=_0x56dac1['channel'];_0x56dac1['message']['motionChannel']=_0x56dac1[_0xb4a8('0x7a')];_0x56dac1[_0xb4a8('0x2c')]['event']=_0xb4a8('0x7b');return respondWithRpcPromise(_0xb4a8('0x7c'),_0xb4a8('0x7c'),{'event':_0xb4a8('0x7d'),'message':_[_0xb4a8('0x54')](_0x56dac1[_0xb4a8('0x2c')],JSON[_0xb4a8('0x7e')](_0x56dac1['interaction'][_0xb4a8('0x7f')]))},client9002)[_0xb4a8('0x25')](function(){return _0x56dac1;});}return _0x56dac1;}return null;})[_0xb4a8('0x25')](respondWithResult(_0x76bcb4,null))[_0xb4a8('0x2e')](handleError(_0x76bcb4,null));};var interaction_log=require(_0xb4a8('0x17'))(_0xb4a8('0x62'));exports[_0xb4a8('0x3a')]=function(_0x241150,_0x1d4972,_0x23edc1){var _0x4cbbff={'agent':{},'channel':'chat'};if(_0x241150['body']['id']){delete _0x241150[_0xb4a8('0x5f')]['id'];}_0x241150[_0xb4a8('0x5f')][_0xb4a8('0x68')]=_0x241150[_0xb4a8('0x5f')]['UserId']||_0x241150[_0xb4a8('0x70')]['id'];_0x4cbbff[_0xb4a8('0x69')]['id']=_0x241150['body'][_0xb4a8('0x68')];return db[_0xb4a8('0x57')]['find']({'where':{'id':_0x241150[_0xb4a8('0x5c')]['id'],'UserId':null}})[_0xb4a8('0x25')](handleEntityNotFound(_0x1d4972,null))[_0xb4a8('0x25')](function(_0x13b79a){if(_0x13b79a){_0x4cbbff[_0xb4a8('0x2c')]=_0x13b79a['get']({'plain':!![]});return db[_0xb4a8('0x80')]['find']({'where':{'id':_0x13b79a['ChatInteractionId']}});}return null;})[_0xb4a8('0x25')](handleEntityNotFound(_0x1d4972,null))[_0xb4a8('0x25')](function(_0x25c67c){if(_0x25c67c){_0x4cbbff[_0xb4a8('0x6e')]=_0x25c67c['get']({'plain':!![]});interaction_log[_0xb4a8('0x26')](_0xb4a8('0x81'),_0x241150['user']['id'],_0x241150[_0xb4a8('0x70')][_0xb4a8('0x3e')],_0x241150[_0xb4a8('0x70')][_0xb4a8('0x71')],_0x4cbbff[_0xb4a8('0x6e')]['id'],_0x241150[_0xb4a8('0x5f')]?JSON['stringify'](_0x241150[_0xb4a8('0x5f')]):_0xb4a8('0x72'));return respondWithRpcPromise(_0xb4a8('0x82'),_0xb4a8('0x83'),_0x4cbbff);}return null;})[_0xb4a8('0x25')](function(_0xf21156){var _0x3c2239=_0xb4a8('0x84')+_0xf21156[_0xb4a8('0x2c')][_0xb4a8('0x85')];return db[_0xb4a8('0x75')][_0xb4a8('0x46')](_0x3c2239,{'type':db[_0xb4a8('0x86')][_0xb4a8('0x87')][_0xb4a8('0x76')],'raw':!![]})[_0xb4a8('0x25')](function(_0x4dfb83){return _0x4dfb83;});})[_0xb4a8('0x25')](function(_0x5f2f43){if(_0x5f2f43){_0x4cbbff['message'][_0xb4a8('0x77')]=_0x5f2f43[0x0];if(!_0x241150[_0xb4a8('0x5f')][_0xb4a8('0x68')])return;return db[_0xb4a8('0x88')][_0xb4a8('0x60')]({'where':{'id':_0x241150['body']['UserId'],'role':'agent'},'attributes':['id',_0xb4a8('0x3e'),_0xb4a8('0x78'),_0xb4a8('0x89'),'internal'],'raw':!![]});}return null;})[_0xb4a8('0x25')](function(_0x2d1019){if(!_0x2d1019)return null;_0x4cbbff['message'][_0xb4a8('0x69')]=_0x2d1019;return _0x4cbbff;})[_0xb4a8('0x25')](function(_0x39df15){if(_0x39df15){_0x39df15[_0xb4a8('0x2c')][_0xb4a8('0x8a')]=util['format'](_0xb4a8('0x79'),_0x241150[_0xb4a8('0x70')][_0xb4a8('0x3e')]);_0x39df15[_0xb4a8('0x2c')][_0xb4a8('0x7a')]=_0x4cbbff[_0xb4a8('0x7a')];_0x39df15[_0xb4a8('0x2c')][_0xb4a8('0x8b')]=_0x4cbbff['channel'];_0x39df15[_0xb4a8('0x2c')][_0xb4a8('0x8c')]='reject';respondWithRpcPromise(_0xb4a8('0x7c'),_0xb4a8('0x7c'),{'event':_0xb4a8('0x8d'),'message':_[_0xb4a8('0x54')](_0x4cbbff[_0xb4a8('0x2c')],JSON[_0xb4a8('0x7e')](_0x4cbbff[_0xb4a8('0x6e')][_0xb4a8('0x7f')]))},client9002);return _0x4cbbff;}return null;})[_0xb4a8('0x25')](respondWithResult(_0x1d4972,null))[_0xb4a8('0x2e')](handleError(_0x1d4972,null));}; \ No newline at end of file +var _0xa875=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','chat-interactions','chat','readAt','format','UserId','user','agent','ChatInteraction','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','../../config/logger','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','email','interface','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis'];(function(_0x2f06b3,_0x12feb6){var _0x270d4d=function(_0x5e3720){while(--_0x5e3720){_0x2f06b3['push'](_0x2f06b3['shift']());}};_0x270d4d(++_0x12feb6);}(_0xa875,0x176));var _0x5a87=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa875[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a87('0x0'));var zipdir=require(_0x5a87('0x1'));var jsonpatch=require(_0x5a87('0x2'));var rp=require(_0x5a87('0x3'));var moment=require(_0x5a87('0x4'));var BPromise=require(_0x5a87('0x5'));var Mustache=require(_0x5a87('0x6'));var util=require(_0x5a87('0x7'));var path=require('path');var sox=require(_0x5a87('0x8'));var csv=require(_0x5a87('0x9'));var ejs=require(_0x5a87('0xa'));var fs=require('fs');var fs_extra=require(_0x5a87('0xb'));var _=require('lodash');var squel=require(_0x5a87('0xc'));var crypto=require('crypto');var jsforce=require(_0x5a87('0xd'));var deskjs=require(_0x5a87('0xe'));var toCsv=require(_0x5a87('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a87('0xf'));var authService=require(_0x5a87('0x10'));var qs=require(_0x5a87('0x11'));var as=require(_0x5a87('0x12'));var hardwareService=require(_0x5a87('0x13'));var logger=require('../../config/logger')(_0x5a87('0x14'));var utils=require(_0x5a87('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5a87('0x16'))['db'];config[_0x5a87('0x17')]=_[_0x5a87('0x18')](config['redis'],{'host':_0x5a87('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a87('0x17')]));require(_0x5a87('0x1a'))['register'](socket);var jayson=require(_0x5a87('0x1b'));var client=jayson['client'][_0x5a87('0x1c')]({'port':0x232c});var client9002=jayson[_0x5a87('0x1d')][_0x5a87('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3f0ff3,_0x31f8f9,_0xd3cb38,_0x577dfd){return new BPromise(function(_0x630da1,_0x4c92c1){var _0x181667=_0x577dfd||client;return _0x181667[_0x5a87('0x1e')](_0x3f0ff3,_0xd3cb38)[_0x5a87('0x1f')](function(_0x3e293e){logger[_0x5a87('0x20')](_0x5a87('0x21'),_0x31f8f9,_0x5a87('0x22'));logger[_0x5a87('0x23')](_0x5a87('0x24'),_0x31f8f9,_0x5a87('0x22'),JSON[_0x5a87('0x25')](_0x3e293e));if(_0x3e293e[_0x5a87('0x26')]){if(_0x3e293e[_0x5a87('0x26')][_0x5a87('0x27')]===0x1f4){logger[_0x5a87('0x26')]('ChatMessage,\x20%s,\x20%s',_0x31f8f9,_0x3e293e[_0x5a87('0x26')][_0x5a87('0x28')]);return _0x4c92c1(_0x3e293e[_0x5a87('0x26')][_0x5a87('0x28')]);}logger[_0x5a87('0x26')]('ChatMessage,\x20%s,\x20%s',_0x31f8f9,_0x3e293e['error'][_0x5a87('0x28')]);return _0x630da1(_0x3e293e[_0x5a87('0x26')][_0x5a87('0x28')]);}else{logger[_0x5a87('0x20')](_0x5a87('0x21'),_0x31f8f9,_0x5a87('0x22'));_0x630da1(_0x3e293e[_0x5a87('0x29')][_0x5a87('0x28')]);}})['catch'](function(_0x4b2e18){logger[_0x5a87('0x26')](_0x5a87('0x21'),_0x31f8f9,_0x4b2e18);_0x4c92c1(_0x4b2e18);});});}function respondWithStatusCode(_0x25af43,_0x112280){_0x112280=_0x112280||0xcc;return function(_0x58ee72){if(_0x58ee72){return _0x25af43[_0x5a87('0x2a')](_0x112280);}return _0x25af43['status'](_0x112280)[_0x5a87('0x2b')]();};}function respondWithResult(_0x9f8906,_0x52e5c1){_0x52e5c1=_0x52e5c1||0xc8;return function(_0x4ed3e1){if(_0x4ed3e1){return _0x9f8906['status'](_0x52e5c1)[_0x5a87('0x2c')](_0x4ed3e1);}};}function respondWithFilteredResult(_0x1ff9a9,_0x1bdd52){return function(_0x3486ee){if(_0x3486ee){var _0x31ef5d=typeof _0x1bdd52[_0x5a87('0x2d')]===_0x5a87('0x2e')&&typeof _0x1bdd52[_0x5a87('0x2f')]==='undefined';var _0x59cda1=_0x3486ee[_0x5a87('0x30')];var _0x4f936a=_0x31ef5d?0x0:_0x1bdd52[_0x5a87('0x2d')];var _0x59850f=_0x31ef5d?_0x3486ee['count']:_0x1bdd52['offset']+_0x1bdd52[_0x5a87('0x2f')];var _0x418ec4;if(_0x59850f>=_0x59cda1){_0x59850f=_0x59cda1;_0x418ec4=0xc8;}else{_0x418ec4=0xce;}_0x1ff9a9[_0x5a87('0x31')](_0x418ec4);return _0x1ff9a9[_0x5a87('0x32')](_0x5a87('0x33'),_0x4f936a+'-'+_0x59850f+'/'+_0x59cda1)[_0x5a87('0x2c')](_0x3486ee);}return null;};}function patchUpdates(_0x37a4d0){return function(_0x566b4e){try{jsonpatch[_0x5a87('0x34')](_0x566b4e,_0x37a4d0,!![]);}catch(_0x31286c){return BPromise['reject'](_0x31286c);}return _0x566b4e['save']();};}function saveUpdates(_0x33b3d2,_0x2461b0){return function(_0x391fd7){if(_0x391fd7){return _0x391fd7[_0x5a87('0x35')](_0x33b3d2)[_0x5a87('0x1f')](function(_0x85d4a1){return _0x85d4a1;});}return null;};}function removeEntity(_0x54c8c5,_0x4938e1){return function(_0x247ec4){if(_0x247ec4){return _0x247ec4[_0x5a87('0x36')]()[_0x5a87('0x1f')](function(){_0x54c8c5['status'](0xcc)[_0x5a87('0x2b')]();});}};}function handleEntityNotFound(_0x2f9f31,_0x14fb41){return function(_0x8aa6e5){if(!_0x8aa6e5){_0x2f9f31[_0x5a87('0x2a')](0x194);}return _0x8aa6e5;};}function handleError(_0x53d521,_0x1c6256){_0x1c6256=_0x1c6256||0x1f4;return function(_0x3c810a){logger['error'](_0x3c810a[_0x5a87('0x37')]);if(_0x3c810a[_0x5a87('0x38')]){delete _0x3c810a[_0x5a87('0x38')];}_0x53d521['status'](_0x1c6256)[_0x5a87('0x39')](_0x3c810a);};}exports[_0x5a87('0x3a')]=function(_0x5676ff,_0x447d01){var _0x502ffb={},_0x32c58e={},_0x55b4fe={'count':0x0,'rows':[]};var _0x29cfdd=_[_0x5a87('0x3b')](db[_0x5a87('0x3c')][_0x5a87('0x3d')],function(_0x1d976d){return{'name':_0x1d976d[_0x5a87('0x3e')],'type':_0x1d976d['type'][_0x5a87('0x3f')]};});_0x32c58e[_0x5a87('0x40')]=_['map'](_0x29cfdd,_0x5a87('0x38'));_0x32c58e[_0x5a87('0x41')]=_[_0x5a87('0x42')](_0x5676ff[_0x5a87('0x41')]);_0x32c58e['filters']=_[_0x5a87('0x43')](_0x32c58e[_0x5a87('0x40')],_0x32c58e['query']);_0x502ffb[_0x5a87('0x44')]=_[_0x5a87('0x43')](_0x32c58e[_0x5a87('0x40')],qs[_0x5a87('0x45')](_0x5676ff[_0x5a87('0x41')]['fields']));_0x502ffb[_0x5a87('0x44')]=_0x502ffb[_0x5a87('0x44')][_0x5a87('0x46')]?_0x502ffb['attributes']:_0x32c58e[_0x5a87('0x40')];if(!_0x5676ff[_0x5a87('0x41')][_0x5a87('0x47')](_0x5a87('0x48'))){_0x502ffb[_0x5a87('0x2f')]=qs[_0x5a87('0x2f')](_0x5676ff[_0x5a87('0x41')][_0x5a87('0x2f')]);_0x502ffb[_0x5a87('0x2d')]=qs[_0x5a87('0x2d')](_0x5676ff['query'][_0x5a87('0x2d')]);}_0x502ffb['order']=qs[_0x5a87('0x49')](_0x5676ff[_0x5a87('0x41')][_0x5a87('0x49')]);_0x502ffb['where']=qs['filters'](_[_0x5a87('0x4a')](_0x5676ff[_0x5a87('0x41')],_0x32c58e[_0x5a87('0x4b')]),_0x29cfdd);if(_0x5676ff[_0x5a87('0x41')][_0x5a87('0x4c')]){_0x502ffb['where']=_[_0x5a87('0x4d')](_0x502ffb[_0x5a87('0x4e')],{'$or':_['map'](_0x29cfdd,function(_0x541895){if(_0x541895['type']!=='VIRTUAL'){var _0x5dbdea={};_0x5dbdea[_0x541895[_0x5a87('0x38')]]={'$like':'%'+_0x5676ff['query'][_0x5a87('0x4c')]+'%'};return _0x5dbdea;}})});}_0x502ffb=_[_0x5a87('0x4d')]({},_0x502ffb,_0x5676ff[_0x5a87('0x4f')]);var _0xaf7203={'where':_0x502ffb[_0x5a87('0x4e')]};return db['ChatMessage']['count'](_0xaf7203)[_0x5a87('0x1f')](function(_0x10c1d1){_0x55b4fe[_0x5a87('0x30')]=_0x10c1d1;if(_0x5676ff['query'][_0x5a87('0x50')]){_0x502ffb[_0x5a87('0x51')]=[{'all':!![]}];}return db[_0x5a87('0x3c')][_0x5a87('0x52')](_0x502ffb);})[_0x5a87('0x1f')](function(_0x1e2b49){_0x55b4fe[_0x5a87('0x53')]=_0x1e2b49;return _0x55b4fe;})[_0x5a87('0x1f')](respondWithFilteredResult(_0x447d01,_0x502ffb))[_0x5a87('0x54')](handleError(_0x447d01,null));};exports[_0x5a87('0x55')]=function(_0x1fbd60,_0x53b0a9){var _0x2b9788={'raw':!![],'where':{'id':_0x1fbd60['params']['id']}},_0x9a035={};_0x9a035[_0x5a87('0x40')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x9a035[_0x5a87('0x41')]=_[_0x5a87('0x42')](_0x1fbd60[_0x5a87('0x41')]);_0x9a035[_0x5a87('0x4b')]=_['intersection'](_0x9a035['model'],_0x9a035['query']);_0x2b9788[_0x5a87('0x44')]=_['intersection'](_0x9a035[_0x5a87('0x40')],qs[_0x5a87('0x45')](_0x1fbd60[_0x5a87('0x41')][_0x5a87('0x45')]));_0x2b9788[_0x5a87('0x44')]=_0x2b9788['attributes'][_0x5a87('0x46')]?_0x2b9788[_0x5a87('0x44')]:_0x9a035[_0x5a87('0x40')];if(_0x1fbd60['query'][_0x5a87('0x50')]){_0x2b9788[_0x5a87('0x51')]=[{'all':!![]}];}_0x2b9788=_[_0x5a87('0x4d')]({},_0x2b9788,_0x1fbd60[_0x5a87('0x4f')]);return db['ChatMessage'][_0x5a87('0x56')](_0x2b9788)[_0x5a87('0x1f')](handleEntityNotFound(_0x53b0a9,null))[_0x5a87('0x1f')](respondWithResult(_0x53b0a9,null))[_0x5a87('0x54')](handleError(_0x53b0a9,null));};exports[_0x5a87('0x57')]=function(_0xca2e20,_0x468733){return db['ChatMessage'][_0x5a87('0x57')](_0xca2e20[_0x5a87('0x58')],{})[_0x5a87('0x1f')](respondWithResult(_0x468733,0xc9))[_0x5a87('0x54')](handleError(_0x468733,null));};exports[_0x5a87('0x35')]=function(_0x1f45bd,_0x253b3d){if(_0x1f45bd[_0x5a87('0x58')]['id']){delete _0x1f45bd[_0x5a87('0x58')]['id'];}return db[_0x5a87('0x3c')][_0x5a87('0x56')]({'where':{'id':_0x1f45bd['params']['id']}})[_0x5a87('0x1f')](handleEntityNotFound(_0x253b3d,null))[_0x5a87('0x1f')](saveUpdates(_0x1f45bd['body'],null))[_0x5a87('0x1f')](respondWithResult(_0x253b3d,null))[_0x5a87('0x54')](handleError(_0x253b3d,null));};exports[_0x5a87('0x36')]=function(_0x40b28c,_0x1fa56d){return db[_0x5a87('0x3c')][_0x5a87('0x56')]({'where':{'id':_0x40b28c[_0x5a87('0x59')]['id']}})[_0x5a87('0x1f')](handleEntityNotFound(_0x1fa56d,null))['then'](removeEntity(_0x1fa56d,null))[_0x5a87('0x54')](handleError(_0x1fa56d,null));};exports[_0x5a87('0x5a')]=function(_0x412aa4,_0x38151a){return db[_0x5a87('0x3c')][_0x5a87('0x5a')]()[_0x5a87('0x1f')](respondWithResult(_0x38151a,null))['catch'](handleError(_0x38151a,null));};var interaction_log=require('../../config/logger')(_0x5a87('0x5b'));exports['accept']=function(_0x2d4658,_0x30c26e,_0x3676a9){var _0x535495={'agent':{},'channel':_0x5a87('0x5c')};if(_0x2d4658[_0x5a87('0x58')]['id']){delete _0x2d4658[_0x5a87('0x58')]['id'];}_0x2d4658['body']['read']=!![];_0x2d4658[_0x5a87('0x58')][_0x5a87('0x5d')]=moment()[_0x5a87('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d4658[_0x5a87('0x58')][_0x5a87('0x5f')]=_0x2d4658[_0x5a87('0x58')]['UserId']||_0x2d4658[_0x5a87('0x60')]['id'];_0x535495[_0x5a87('0x61')]['id']=_0x2d4658[_0x5a87('0x58')]['UserId'];return db[_0x5a87('0x3c')][_0x5a87('0x56')]({'where':{'id':_0x2d4658[_0x5a87('0x59')]['id'],'UserId':null}})[_0x5a87('0x1f')](handleEntityNotFound(_0x30c26e,null))[_0x5a87('0x1f')](saveUpdates(_0x2d4658[_0x5a87('0x58')],null))[_0x5a87('0x1f')](function(_0x501fe3){if(_0x501fe3){_0x535495[_0x5a87('0x28')]=_0x501fe3['get']({'plain':!![]});return db[_0x5a87('0x62')][_0x5a87('0x56')]({'where':{'id':_0x501fe3['ChatInteractionId']}});}return null;})[_0x5a87('0x1f')](handleEntityNotFound(_0x30c26e,null))['then'](function(_0x393e0c){if(_0x393e0c){return _0x393e0c['update']({'UserId':_0x2d4658['body'][_0x5a87('0x5f')],'read1stAt':_['isNil'](_0x393e0c['read1stAt'])?moment()[_0x5a87('0x5e')](_0x5a87('0x63')):undefined});}return null;})[_0x5a87('0x1f')](function(_0x4775cc){if(_0x4775cc){_0x535495[_0x5a87('0x64')]=_0x4775cc[_0x5a87('0x65')]({'plain':!![]});interaction_log[_0x5a87('0x20')](_0x5a87('0x66'),_0x2d4658['user']['id'],_0x2d4658['user'][_0x5a87('0x38')],_0x2d4658['user']['role'],_0x535495[_0x5a87('0x64')]['id'],_0x2d4658[_0x5a87('0x58')]?JSON[_0x5a87('0x25')](_0x2d4658[_0x5a87('0x58')]):_0x5a87('0x67'));return respondWithRpcPromise(_0x5a87('0x68'),'acceptMessage',_0x535495);}return null;})[_0x5a87('0x1f')](function(_0x4bf198){var _0x5830f6=_0x5a87('0x69')+_0x4bf198[_0x5a87('0x28')]['ContactId'];return db[_0x5a87('0x6a')][_0x5a87('0x41')](_0x5830f6,{'type':db[_0x5a87('0x6b')][_0x5a87('0x6c')][_0x5a87('0x6d')],'raw':!![]})[_0x5a87('0x1f')](function(_0x40b885){return _0x40b885;});})[_0x5a87('0x1f')](function(_0x2bd681){if(_0x2bd681){_0x535495[_0x5a87('0x28')][_0x5a87('0x6e')]=_0x2bd681[0x0];if(!_0x2d4658[_0x5a87('0x58')][_0x5a87('0x5f')])return;return db[_0x5a87('0x6f')][_0x5a87('0x56')]({'where':{'id':_0x2d4658[_0x5a87('0x58')][_0x5a87('0x5f')],'role':'agent'},'attributes':['id',_0x5a87('0x38'),_0x5a87('0x70'),'email','internal'],'raw':!![]});}return null;})[_0x5a87('0x1f')](function(_0xd49158){if(!_0xd49158)return null;_0x535495['message'][_0x5a87('0x61')]=_0xd49158;return _0x535495;})[_0x5a87('0x1f')](function(_0x36aa69){if(_0x36aa69){if(_0x2d4658[_0x5a87('0x58')][_0x5a87('0x71')]){_0x535495[_0x5a87('0x28')]['interface']=util['format'](_0x5a87('0x72'),_0x2d4658[_0x5a87('0x60')]['name']);_0x535495[_0x5a87('0x28')][_0x5a87('0x73')]=_0x535495[_0x5a87('0x73')];_0x535495['message'][_0x5a87('0x74')]=_0x535495[_0x5a87('0x73')];_0x535495['message'][_0x5a87('0x75')]=_0x5a87('0x76');return respondWithRpcPromise(_0x5a87('0x77'),_0x5a87('0x77'),{'event':_0x5a87('0x78'),'message':_[_0x5a87('0x4d')](_0x535495['message'],JSON[_0x5a87('0x79')](_0x535495['interaction'][_0x5a87('0x7a')]))},client9002)['then'](function(){return _0x535495;});}return _0x535495;}return null;})[_0x5a87('0x1f')](respondWithResult(_0x30c26e,null))[_0x5a87('0x54')](handleError(_0x30c26e,null));};var interaction_log=require(_0x5a87('0x7b'))('chat-interactions');exports['reject']=function(_0x164666,_0x2e18b6,_0x403ffb){var _0x368100={'agent':{},'channel':_0x5a87('0x5c')};if(_0x164666[_0x5a87('0x58')]['id']){delete _0x164666[_0x5a87('0x58')]['id'];}_0x164666[_0x5a87('0x58')]['UserId']=_0x164666['body']['UserId']||_0x164666[_0x5a87('0x60')]['id'];_0x368100[_0x5a87('0x61')]['id']=_0x164666[_0x5a87('0x58')][_0x5a87('0x5f')];return db[_0x5a87('0x3c')][_0x5a87('0x56')]({'where':{'id':_0x164666[_0x5a87('0x59')]['id'],'UserId':null}})[_0x5a87('0x1f')](handleEntityNotFound(_0x2e18b6,null))[_0x5a87('0x1f')](function(_0x3b50b4){if(_0x3b50b4){_0x368100[_0x5a87('0x28')]=_0x3b50b4['get']({'plain':!![]});return db[_0x5a87('0x62')][_0x5a87('0x56')]({'where':{'id':_0x3b50b4[_0x5a87('0x7c')]}});}return null;})[_0x5a87('0x1f')](handleEntityNotFound(_0x2e18b6,null))[_0x5a87('0x1f')](function(_0x4e97c5){if(_0x4e97c5){_0x368100['interaction']=_0x4e97c5[_0x5a87('0x65')]({'plain':!![]});interaction_log[_0x5a87('0x20')](_0x5a87('0x7d'),_0x164666[_0x5a87('0x60')]['id'],_0x164666[_0x5a87('0x60')]['name'],_0x164666[_0x5a87('0x60')][_0x5a87('0x7e')],_0x368100[_0x5a87('0x64')]['id'],_0x164666['body']?JSON[_0x5a87('0x25')](_0x164666[_0x5a87('0x58')]):_0x5a87('0x67'));return respondWithRpcPromise('RejectMessage',_0x5a87('0x7f'),_0x368100);}return null;})[_0x5a87('0x1f')](function(_0x45996a){var _0xe176da='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45996a[_0x5a87('0x28')]['ContactId'];return db['sequelize']['query'](_0xe176da,{'type':db[_0x5a87('0x6b')][_0x5a87('0x6c')]['SELECT'],'raw':!![]})[_0x5a87('0x1f')](function(_0x4a1afc){return _0x4a1afc;});})['then'](function(_0x4ecebe){if(_0x4ecebe){_0x368100[_0x5a87('0x28')]['contact']=_0x4ecebe[0x0];if(!_0x164666['body'][_0x5a87('0x5f')])return;return db[_0x5a87('0x6f')]['find']({'where':{'id':_0x164666[_0x5a87('0x58')]['UserId'],'role':_0x5a87('0x61')},'attributes':['id','name',_0x5a87('0x70'),_0x5a87('0x80'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2e4ee5){if(!_0x2e4ee5)return null;_0x368100[_0x5a87('0x28')][_0x5a87('0x61')]=_0x2e4ee5;return _0x368100;})['then'](function(_0x374357){if(_0x374357){_0x374357[_0x5a87('0x28')][_0x5a87('0x81')]=util[_0x5a87('0x5e')](_0x5a87('0x72'),_0x164666[_0x5a87('0x60')][_0x5a87('0x38')]);_0x374357[_0x5a87('0x28')][_0x5a87('0x73')]=_0x368100[_0x5a87('0x73')];_0x374357['message'][_0x5a87('0x74')]=_0x368100[_0x5a87('0x73')];_0x374357['message']['event']='reject';respondWithRpcPromise(_0x5a87('0x77'),_0x5a87('0x77'),{'event':'rejectmessage','message':_['merge'](_0x368100[_0x5a87('0x28')],JSON[_0x5a87('0x79')](_0x368100[_0x5a87('0x64')][_0x5a87('0x7a')]))},client9002);return _0x368100;}return null;})[_0x5a87('0x1f')](respondWithResult(_0x2e18b6,null))[_0x5a87('0x54')](handleError(_0x2e18b6,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index bc56863..694ed6a 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 _0xbc66=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0xbc66,0x15e));var _0x6bc6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbc66[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x6bc6('0x0'));var ChatMessage=require(_0x6bc6('0x1'))['db'][_0x6bc6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6bc6('0x3')](0x0);var events={'afterCreate':_0x6bc6('0x4'),'afterUpdate':_0x6bc6('0x5'),'afterDestroy':_0x6bc6('0x6')};function emitEvent(_0x43975e){return function(_0x30b48c,_0x1ab309,_0x2dc228){ChatMessageEvents[_0x6bc6('0x7')](_0x43975e+':'+_0x30b48c['id'],_0x30b48c);ChatMessageEvents[_0x6bc6('0x7')](_0x43975e,_0x30b48c);_0x2dc228(null);};}for(var e in events){if(events[_0x6bc6('0x8')](e)){var event=events[e];ChatMessage[_0x6bc6('0x9')](e,emitEvent(event));}}module[_0x6bc6('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x7369=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatMessage'];(function(_0xc8a62b,_0x4e1b0b){var _0x454c14=function(_0x790b69){while(--_0x790b69){_0xc8a62b['push'](_0xc8a62b['shift']());}};_0x454c14(++_0x4e1b0b);}(_0x7369,0x16e));var _0x9736=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7369[_0x21aec3];return _0x288bbc;};'use strict';var EventEmitter=require(_0x9736('0x0'));var ChatMessage=require(_0x9736('0x1'))['db'][_0x9736('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9736('0x3')](0x0);var events={'afterCreate':_0x9736('0x4'),'afterUpdate':'update','afterDestroy':_0x9736('0x5')};function emitEvent(_0x324e3a){return function(_0x5af004,_0x4bf7e3,_0x5897c1){ChatMessageEvents['emit'](_0x324e3a+':'+_0x5af004['id'],_0x5af004);ChatMessageEvents[_0x9736('0x6')](_0x324e3a,_0x5af004);_0x5897c1(null);};}for(var e in events){if(events[_0x9736('0x7')](e)){var event=events[e];ChatMessage[_0x9736('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 4417c8a..36f06db 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 _0xe73b=['toLowerCase','direction','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','fti_chat_messages','models','get'];(function(_0x587f2a,_0xf47df8){var _0x1c89f2=function(_0x37a261){while(--_0x37a261){_0x587f2a['push'](_0x587f2a['shift']());}};_0x1c89f2(++_0xf47df8);}(_0xe73b,0x12b));var _0xbe73=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0xe73b[_0x3f1861];return _0x7ca70a;};'use strict';var _=require(_0xbe73('0x0'));var util=require('util');var logger=require(_0xbe73('0x1'))(_0xbe73('0x2'));var moment=require('moment');var BPromise=require(_0xbe73('0x3'));var rp=require(_0xbe73('0x4'));var fs=require('fs');var path=require(_0xbe73('0x5'));var rimraf=require(_0xbe73('0x6'));var config=require(_0xbe73('0x7'));var attributes=require(_0xbe73('0x8'));module['exports']=function(_0x3b2784,_0x2afad6){return _0x3b2784['define'](_0xbe73('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xbe73('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x426702,_0x54b4a7,_0x18fb8f){var _0x156010=_0x3b2784[_0xbe73('0xb')];var _0x1103a5=_0x426702[_0xbe73('0xc')]({'plain':!![]});if(_0x1103a5['direction'][_0xbe73('0xd')]()==='in'||_0x1103a5[_0xbe73('0xe')][_0xbe73('0xd')]()==='out'&&!_0x1103a5[_0xbe73('0xf')]&&!_['isNil'](_0x1103a5[_0xbe73('0x10')])){_0x156010[_0xbe73('0x11')][_0xbe73('0x12')]({'where':{'id':_0x1103a5[_0xbe73('0x13')]}})[_0xbe73('0x14')](function(_0x19f341){if(_0x19f341){_0x19f341[_0xbe73('0x15')]({'lastMsgAt':_0x1103a5[_0xbe73('0x16')],'lastMsgDirection':_0x1103a5['direction']['toLowerCase']()});}})['catch'](function(_0x36f78d){console[_0xbe73('0x17')](_0x36f78d);});}_0x18fb8f();}},'charset':_0xbe73('0x18'),'collate':_0xbe73('0x19')});}; \ No newline at end of file +var _0x9cf9=['models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT'];(function(_0x1d5b68,_0x5540ba){var _0x2501c9=function(_0x29021){while(--_0x29021){_0x1d5b68['push'](_0x1d5b68['shift']());}};_0x2501c9(++_0x5540ba);}(_0x9cf9,0x1f3));var _0x99cf=function(_0x215c21,_0x1fc2b9){_0x215c21=_0x215c21-0x0;var _0x3d11c1=_0x9cf9[_0x215c21];return _0x3d11c1;};'use strict';var _=require(_0x99cf('0x0'));var util=require('util');var logger=require(_0x99cf('0x1'))(_0x99cf('0x2'));var moment=require(_0x99cf('0x3'));var BPromise=require(_0x99cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99cf('0x5'));var rimraf=require(_0x99cf('0x6'));var config=require(_0x99cf('0x7'));var attributes=require(_0x99cf('0x8'));module['exports']=function(_0x3558cf,_0x2b2d0d){return _0x3558cf['define'](_0x99cf('0x9'),attributes,{'tableName':_0x99cf('0xa'),'paranoid':![],'indexes':[{'name':_0x99cf('0xb'),'fields':[_0x99cf('0xc')],'type':_0x99cf('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x522f5e,_0x3fb5e5,_0x20c1ba){var _0x22dd2e=_0x3558cf[_0x99cf('0xe')];var _0x3ff1f5=_0x522f5e[_0x99cf('0xf')]({'plain':!![]});if(_0x3ff1f5[_0x99cf('0x10')][_0x99cf('0x11')]()==='in'||_0x3ff1f5[_0x99cf('0x10')][_0x99cf('0x11')]()===_0x99cf('0x12')&&!_0x3ff1f5[_0x99cf('0x13')]&&!_['isNil'](_0x3ff1f5[_0x99cf('0x14')])){_0x22dd2e[_0x99cf('0x15')][_0x99cf('0x16')]({'where':{'id':_0x3ff1f5[_0x99cf('0x17')]}})[_0x99cf('0x18')](function(_0x313d59){if(_0x313d59){_0x313d59['update']({'lastMsgAt':_0x3ff1f5[_0x99cf('0x19')],'lastMsgDirection':_0x3ff1f5[_0x99cf('0x10')][_0x99cf('0x11')]()});}})[_0x99cf('0x1a')](function(_0x517c50){console['error'](_0x517c50);});}_0x20c1ba();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index c77770b..8af7bcd 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 _0x7104=['./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateChatMessage','ChatMessage','body','raw','info','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter'];(function(_0x2dc7ec,_0x2f1f1e){var _0x5c7f6d=function(_0x2fe08a){while(--_0x2fe08a){_0x2dc7ec['push'](_0x2dc7ec['shift']());}};_0x5c7f6d(++_0x2f1f1e);}(_0x7104,0x153));var _0x4710=function(_0x46dfb8,_0x57b422){_0x46dfb8=_0x46dfb8-0x0;var _0xe04c07=_0x7104[_0x46dfb8];return _0xe04c07;};'use strict';var _=require(_0x4710('0x0'));var util=require(_0x4710('0x1'));var moment=require('moment');var BPromise=require(_0x4710('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4710('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4710('0x4'));var logger=require(_0x4710('0x5'))('rpc');var config=require(_0x4710('0x6'));var jayson=require(_0x4710('0x7'));var client=jayson[_0x4710('0x8')]['http']({'port':0x232a});config[_0x4710('0x9')]=_[_0x4710('0xa')](config[_0x4710('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4710('0xb'))(new Redis(config[_0x4710('0x9')]));require(_0x4710('0xc'))[_0x4710('0xd')](socket);function respondWithRpcPromise(_0x383167,_0x56a767,_0x37af0c){return new BPromise(function(_0x55d64a,_0x7f3e0d){return client['request'](_0x383167,_0x37af0c)[_0x4710('0xe')](function(_0x496a16){logger['info'](_0x4710('0xf'),_0x56a767,_0x4710('0x10'));logger[_0x4710('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x56a767,_0x4710('0x10'),JSON['stringify'](_0x496a16));if(_0x496a16['error']){if(_0x496a16[_0x4710('0x12')]['code']===0x1f4){logger['error'](_0x4710('0xf'),_0x56a767,_0x496a16[_0x4710('0x12')][_0x4710('0x13')]);return _0x7f3e0d(_0x496a16['error'][_0x4710('0x13')]);}logger[_0x4710('0x12')](_0x4710('0xf'),_0x56a767,_0x496a16[_0x4710('0x12')][_0x4710('0x13')]);return _0x55d64a(_0x496a16[_0x4710('0x12')]['message']);}else{logger['info'](_0x4710('0xf'),_0x56a767,_0x4710('0x10'));_0x55d64a(_0x496a16[_0x4710('0x14')][_0x4710('0x13')]);}})[_0x4710('0x15')](function(_0x3a95d8){logger['error']('ChatMessage,\x20%s,\x20%s',_0x56a767,_0x3a95d8);_0x7f3e0d(_0x3a95d8);});});}exports[_0x4710('0x16')]=function(_0x531da1){var _0x45f05b=this;return new Promise(function(_0x3e2751,_0x2a31c3){return db[_0x4710('0x17')]['create'](_0x531da1[_0x4710('0x18')],{'raw':_0x531da1['options']?_0x531da1['options'][_0x4710('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x434520){logger[_0x4710('0x1a')](_0x4710('0x16'),_0x531da1);logger['debug'](_0x4710('0x16'),_0x531da1,JSON['stringify'](_0x434520));_0x3e2751(_0x434520);})[_0x4710('0x15')](function(_0x378d40){logger[_0x4710('0x12')](_0x4710('0x16'),_0x378d40[_0x4710('0x13')],_0x531da1);_0x2a31c3(_0x45f05b[_0x4710('0x12')](0x1f4,_0x378d40[_0x4710('0x13')]));});});}; \ No newline at end of file +var _0xb12d=['info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x2a285d,_0x34d30f){var _0x4d8603=function(_0x461c9e){while(--_0x461c9e){_0x2a285d['push'](_0x2a285d['shift']());}};_0x4d8603(++_0x34d30f);}(_0xb12d,0x1f4));var _0xdb12=function(_0x8abd64,_0x539570){_0x8abd64=_0x8abd64-0x0;var _0xd2511e=_0xb12d[_0x8abd64];return _0xd2511e;};'use strict';var _=require(_0xdb12('0x0'));var util=require('util');var moment=require(_0xdb12('0x1'));var BPromise=require(_0xdb12('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb12('0x3'));var db=require(_0xdb12('0x4'))['db'];var utils=require(_0xdb12('0x5'));var logger=require(_0xdb12('0x6'))(_0xdb12('0x7'));var config=require(_0xdb12('0x8'));var jayson=require(_0xdb12('0x9'));var client=jayson[_0xdb12('0xa')][_0xdb12('0xb')]({'port':0x232a});config[_0xdb12('0xc')]=_[_0xdb12('0xd')](config[_0xdb12('0xc')],{'host':_0xdb12('0xe'),'port':0x18eb});var socket=require(_0xdb12('0xf'))(new Redis(config[_0xdb12('0xc')]));require(_0xdb12('0x10'))['register'](socket);function respondWithRpcPromise(_0x152794,_0x4174aa,_0x2facda){return new BPromise(function(_0x22e55c,_0x283656){return client[_0xdb12('0x11')](_0x152794,_0x2facda)['then'](function(_0x312484){logger['info']('ChatMessage,\x20%s,\x20%s',_0x4174aa,_0xdb12('0x12'));logger['debug'](_0xdb12('0x13'),_0x4174aa,_0xdb12('0x12'),JSON[_0xdb12('0x14')](_0x312484));if(_0x312484['error']){if(_0x312484[_0xdb12('0x15')][_0xdb12('0x16')]===0x1f4){logger[_0xdb12('0x15')](_0xdb12('0x17'),_0x4174aa,_0x312484[_0xdb12('0x15')][_0xdb12('0x18')]);return _0x283656(_0x312484[_0xdb12('0x15')][_0xdb12('0x18')]);}logger['error'](_0xdb12('0x17'),_0x4174aa,_0x312484[_0xdb12('0x15')]['message']);return _0x22e55c(_0x312484[_0xdb12('0x15')][_0xdb12('0x18')]);}else{logger[_0xdb12('0x19')](_0xdb12('0x17'),_0x4174aa,_0xdb12('0x12'));_0x22e55c(_0x312484[_0xdb12('0x1a')][_0xdb12('0x18')]);}})[_0xdb12('0x1b')](function(_0x382105){logger['error'](_0xdb12('0x17'),_0x4174aa,_0x382105);_0x283656(_0x382105);});});}exports[_0xdb12('0x1c')]=function(_0x128141){var _0x2320e6=this;return new Promise(function(_0xcff247,_0x1125e1){return db[_0xdb12('0x1d')][_0xdb12('0x1e')](_0x128141[_0xdb12('0x1f')],{'raw':_0x128141['options']?_0x128141[_0xdb12('0x20')][_0xdb12('0x21')]===undefined?!![]:![]:!![]})[_0xdb12('0x22')](function(_0x534598){logger['info'](_0xdb12('0x1c'),_0x128141);logger['debug']('CreateChatMessage',_0x128141,JSON[_0xdb12('0x14')](_0x534598));_0xcff247(_0x534598);})[_0xdb12('0x1b')](function(_0x4c75cc){logger[_0xdb12('0x15')](_0xdb12('0x1c'),_0x4c75cc['message'],_0x128141);_0x1125e1(_0x2320e6[_0xdb12('0x15')](0x1f4,_0x4c75cc[_0xdb12('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 9c4d49a..8204939 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 _0x02a7=['length','chatMessage:','save','emit','removeListener'];(function(_0x319046,_0x5abb64){var _0x2b0bb9=function(_0x4bfca0){while(--_0x4bfca0){_0x319046['push'](_0x319046['shift']());}};_0x2b0bb9(++_0x5abb64);}(_0x02a7,0x7a));var _0x702a=function(_0x196fc9,_0x2d53a6){_0x196fc9=_0x196fc9-0x0;var _0x599c95=_0x02a7[_0x196fc9];return _0x599c95;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x702a('0x0'),'remove','update'];function createListener(_0x30b64d,_0x30573e){return function(_0x325874){_0x30573e[_0x702a('0x1')](_0x30b64d,_0x325874);};}function removeListener(_0x4612ca,_0x1fc26b){return function(){ChatMessageEvents[_0x702a('0x2')](_0x4612ca,_0x1fc26b);};}exports['register']=function(_0x1bcfe5){for(var _0x5b7d8c=0x0,_0x26b25e=events[_0x702a('0x3')];_0x5b7d8c<_0x26b25e;_0x5b7d8c++){var _0x3f2954=events[_0x5b7d8c];var _0x161dee=createListener(_0x702a('0x4')+_0x3f2954,_0x1bcfe5);ChatMessageEvents['on'](_0x3f2954,_0x161dee);}}; \ No newline at end of file +var _0xc3b5=['length','remove','update','emit','register'];(function(_0x58a335,_0x5e006b){var _0x4ebbcd=function(_0x8f505a){while(--_0x8f505a){_0x58a335['push'](_0x58a335['shift']());}};_0x4ebbcd(++_0x5e006b);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x438403,_0x3b6b2f){_0x438403=_0x438403-0x0;var _0x4ddeed=_0xc3b5[_0x438403];return _0x4ddeed;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatMessageEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatMessage:'+_0x420839,_0x6b8a1e);ChatMessageEvents['on'](_0x420839,_0x3892ad);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index df1fbfd..7bac16d 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 _0xd46a=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','show','post','tracked','chat','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x265df3,_0x2f564d){var _0x103448=function(_0xfeef7c){while(--_0xfeef7c){_0x265df3['push'](_0x265df3['shift']());}};_0x103448(++_0x2f564d);}(_0xd46a,0x16c));var _0xad46=function(_0x538ffd,_0x145008){_0x538ffd=_0x538ffd-0x0;var _0x5b5aaa=_0xd46a[_0x538ffd];return _0x5b5aaa;};'use strict';var multer=require(_0xad46('0x0'));var util=require(_0xad46('0x1'));var path=require(_0xad46('0x2'));var timeout=require(_0xad46('0x3'));var express=require('express');var router=express[_0xad46('0x4')]();var fs_extra=require(_0xad46('0x5'));var auth=require(_0xad46('0x6'));var interaction=require(_0xad46('0x7'));var config=require('../../config/environment');var controller=require(_0xad46('0x8'));router[_0xad46('0x9')]('/',auth[_0xad46('0xa')](),controller['index']);router[_0xad46('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xad46('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xad46('0xc')]);router[_0xad46('0xd')]('/',auth['isAuthenticated'](),interaction[_0xad46('0xe')](_0xad46('0xf'),'chatmessage:create'),controller['create']);router[_0xad46('0x10')](_0xad46('0x11'),controller[_0xad46('0x12')]);router[_0xad46('0x10')](_0xad46('0x13'),auth[_0xad46('0xa')](),controller[_0xad46('0x14')]);router[_0xad46('0x10')](_0xad46('0x15'),auth[_0xad46('0xa')](),controller[_0xad46('0x16')]);router[_0xad46('0x17')](_0xad46('0x11'),auth['isAuthenticated'](),controller[_0xad46('0x18')]);module[_0xad46('0x19')]=router; \ No newline at end of file +var _0x7fb4=['express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','post','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path'];(function(_0x13c0da,_0x264266){var _0x33a86c=function(_0x879d08){while(--_0x879d08){_0x13c0da['push'](_0x13c0da['shift']());}};_0x33a86c(++_0x264266);}(_0x7fb4,0xe3));var _0x47fb=function(_0x209140,_0x3214a8){_0x209140=_0x209140-0x0;var _0x58e15a=_0x7fb4[_0x209140];return _0x58e15a;};'use strict';var multer=require(_0x47fb('0x0'));var util=require(_0x47fb('0x1'));var path=require(_0x47fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x47fb('0x3'));var router=express[_0x47fb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47fb('0x5'));var interaction=require(_0x47fb('0x6'));var config=require('../../config/environment');var controller=require(_0x47fb('0x7'));router[_0x47fb('0x8')]('/',auth[_0x47fb('0x9')](),controller['index']);router[_0x47fb('0x8')]('/describe',auth[_0x47fb('0x9')](),controller[_0x47fb('0xa')]);router[_0x47fb('0x8')](_0x47fb('0xb'),auth[_0x47fb('0x9')](),controller['show']);router[_0x47fb('0xc')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x47fb('0xd'),_0x47fb('0xe')),controller[_0x47fb('0xf')]);router[_0x47fb('0x10')](_0x47fb('0xb'),controller[_0x47fb('0x11')]);router[_0x47fb('0x10')](_0x47fb('0x12'),auth['isAuthenticated'](),controller['accept']);router[_0x47fb('0x10')](_0x47fb('0x13'),auth[_0x47fb('0x9')](),controller['reject']);router[_0x47fb('0x14')](_0x47fb('0xb'),auth[_0x47fb('0x9')](),controller[_0x47fb('0x15')]);module[_0x47fb('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 6902788..959c6d4 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x250e30,_0x39b0d2){var _0x4e23fa=function(_0x141a91){while(--_0x141a91){_0x250e30['push'](_0x250e30['shift']());}};_0x4e23fa(++_0x39b0d2);}(_0xdb28,0x106));var _0x8db2=function(_0x1046db,_0x461422){_0x1046db=_0x1046db-0x0;var _0xe4ba7=_0xdb28[_0x1046db];return _0xe4ba7;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x409dc2,_0x420750){var _0x480dd1=function(_0x5bae1d){while(--_0x5bae1d){_0x409dc2['push'](_0x409dc2['shift']());}};_0x480dd1(++_0x420750);}(_0xdb28,0x106));var _0x8db2=function(_0x5afda1,_0x1b4351){_0x5afda1=_0x5afda1-0x0;var _0x40ede5=_0xdb28[_0x5afda1];return _0x40ede5;};'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 a7e4040..ecf68a1 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7a54,0x106));var _0x47a5=function(_0x46676a,_0x44acdf){_0x46676a=_0x46676a-0x0;var _0x45a863=_0x7a54[_0x46676a];return _0x45a863;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _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(_0x2e66ea,_0x3210f9){var _0x2fa9af=function(_0x1136ce){while(--_0x1136ce){_0x2e66ea['push'](_0x2e66ea['shift']());}};_0x2fa9af(++_0x3210f9);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 5be5dde..a7aebbe 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 _0x0599=['update','emit','hook','setMaxListeners','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0599,0x120));var _0x9059=function(_0x3318b3,_0x5451cc){_0x3318b3=_0x3318b3-0x0;var _0x176f6b=_0x0599[_0x3318b3];return _0x176f6b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9059('0x0')](0x0);var events={'afterCreate':_0x9059('0x1'),'afterUpdate':_0x9059('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2c6bfe){return function(_0x1ed49b,_0x57b523,_0x5bc678){ChatOfflineMessageEvents[_0x9059('0x3')](_0x2c6bfe+':'+_0x1ed49b['id'],_0x1ed49b);ChatOfflineMessageEvents[_0x9059('0x3')](_0x2c6bfe,_0x1ed49b);_0x5bc678(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x9059('0x4')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x59fe=['setMaxListeners','remove','emit','exports','../../mysqldb','ChatOfflineMessage'];(function(_0x4e5965,_0x33ef13){var _0x590c3c=function(_0x2a44c1){while(--_0x2a44c1){_0x4e5965['push'](_0x4e5965['shift']());}};_0x590c3c(++_0x33ef13);}(_0x59fe,0x178));var _0xe59f=function(_0x5d9dcb,_0x1ddec7){_0x5d9dcb=_0x5d9dcb-0x0;var _0x551aba=_0x59fe[_0x5d9dcb];return _0x551aba;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xe59f('0x0'))['db'][_0xe59f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe59f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe59f('0x3')};function emitEvent(_0x11559c){return function(_0x33717b,_0x599ed6,_0x36f64d){ChatOfflineMessageEvents[_0xe59f('0x4')](_0x11559c+':'+_0x33717b['id'],_0x33717b);ChatOfflineMessageEvents[_0xe59f('0x4')](_0x11559c,_0x33717b);_0x36f64d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xe59f('0x5')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index e22c69f..8c0cc2d 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 _0xc6ce=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x3b8050,_0x347e45){var _0x3f1abf=function(_0x119d18){while(--_0x119d18){_0x3b8050['push'](_0x3b8050['shift']());}};_0x3f1abf(++_0x347e45);}(_0xc6ce,0x82));var _0xec6c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc6ce[_0x3bf83f];return _0x22c4a9;};'use strict';var attributes=require(_0xec6c('0x0'));module[_0xec6c('0x1')]=function(_0x5256ca){return _0x5256ca[_0xec6c('0x2')](_0xec6c('0x3'),attributes,{'tableName':_0xec6c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec6c('0x5'),'collate':_0xec6c('0x6')});}; \ No newline at end of file +var _0xf14d=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','define'];(function(_0x4c709d,_0x97d657){var _0x36fb31=function(_0x30ceb8){while(--_0x30ceb8){_0x4c709d['push'](_0x4c709d['shift']());}};_0x36fb31(++_0x97d657);}(_0xf14d,0x171));var _0xdf14=function(_0x167440,_0x4747ff){_0x167440=_0x167440-0x0;var _0x3c40e7=_0xf14d[_0x167440];return _0x3c40e7;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x32769b){return _0x32769b[_0xdf14('0x0')](_0xdf14('0x1'),attributes,{'tableName':_0xdf14('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf14('0x3'),'collate':_0xdf14('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3f0e8d7..391bfde 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 _0x96aa=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x6b6e48,_0x5df488){var _0x1409d2=function(_0x470b96){while(--_0x470b96){_0x6b6e48['push'](_0x6b6e48['shift']());}};_0x1409d2(++_0x5df488);}(_0x96aa,0x67));var _0xa96a=function(_0x5e34af,_0x2fec3a){_0x5e34af=_0x5e34af-0x0;var _0x50d1af=_0x96aa[_0x5e34af];return _0x50d1af;};'use strict';var _=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var moment=require('moment');var BPromise=require(_0xa96a('0x2'));var rs=require(_0xa96a('0x3'));var fs=require('fs');var Redis=require(_0xa96a('0x4'));var db=require(_0xa96a('0x5'))['db'];var utils=require(_0xa96a('0x6'));var logger=require('../../config/logger')(_0xa96a('0x7'));var config=require(_0xa96a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa96a('0x9')][_0xa96a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x282c8c,_0x3f391e,_0x44fb9d){return new BPromise(function(_0x3c7329,_0x160c16){return client[_0xa96a('0xb')](_0x282c8c,_0x44fb9d)[_0xa96a('0xc')](function(_0x134f9c){logger[_0xa96a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3f391e,_0xa96a('0xe'));logger['debug'](_0xa96a('0xf'),_0x3f391e,_0xa96a('0xe'),JSON['stringify'](_0x134f9c));if(_0x134f9c[_0xa96a('0x10')]){if(_0x134f9c[_0xa96a('0x10')][_0xa96a('0x11')]===0x1f4){logger[_0xa96a('0x10')](_0xa96a('0x12'),_0x3f391e,_0x134f9c[_0xa96a('0x10')][_0xa96a('0x13')]);return _0x160c16(_0x134f9c[_0xa96a('0x10')][_0xa96a('0x13')]);}logger[_0xa96a('0x10')](_0xa96a('0x12'),_0x3f391e,_0x134f9c[_0xa96a('0x10')]['message']);return _0x3c7329(_0x134f9c['error'][_0xa96a('0x13')]);}else{logger['info'](_0xa96a('0x12'),_0x3f391e,'request\x20sent');_0x3c7329(_0x134f9c[_0xa96a('0x14')][_0xa96a('0x13')]);}})[_0xa96a('0x15')](function(_0x3372f9){logger[_0xa96a('0x10')](_0xa96a('0x12'),_0x3f391e,_0x3372f9);_0x160c16(_0x3372f9);});});} \ No newline at end of file +var _0xbc75=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x45b36c,_0x4efbfe){var _0x1dad2f=function(_0x1532af){while(--_0x1532af){_0x45b36c['push'](_0x45b36c['shift']());}};_0x1dad2f(++_0x4efbfe);}(_0xbc75,0xad));var _0x5bc7=function(_0x88e941,_0x4c927f){_0x88e941=_0x88e941-0x0;var _0x3c84f9=_0xbc75[_0x88e941];return _0x3c84f9;};'use strict';var _=require(_0x5bc7('0x0'));var util=require('util');var moment=require(_0x5bc7('0x1'));var BPromise=require(_0x5bc7('0x2'));var rs=require(_0x5bc7('0x3'));var fs=require('fs');var Redis=require(_0x5bc7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bc7('0x5'))(_0x5bc7('0x6'));var config=require(_0x5bc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5bc7('0x8')][_0x5bc7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e0e40,_0x1acbd5,_0x127b5f){return new BPromise(function(_0x49f11c,_0x4f7df7){return client[_0x5bc7('0xa')](_0x1e0e40,_0x127b5f)[_0x5bc7('0xb')](function(_0x1e2663){logger[_0x5bc7('0xc')](_0x5bc7('0xd'),_0x1acbd5,_0x5bc7('0xe'));logger[_0x5bc7('0xf')](_0x5bc7('0x10'),_0x1acbd5,_0x5bc7('0xe'),JSON[_0x5bc7('0x11')](_0x1e2663));if(_0x1e2663[_0x5bc7('0x12')]){if(_0x1e2663[_0x5bc7('0x12')][_0x5bc7('0x13')]===0x1f4){logger[_0x5bc7('0x12')](_0x5bc7('0xd'),_0x1acbd5,_0x1e2663[_0x5bc7('0x12')][_0x5bc7('0x14')]);return _0x4f7df7(_0x1e2663[_0x5bc7('0x12')]['message']);}logger[_0x5bc7('0x12')](_0x5bc7('0xd'),_0x1acbd5,_0x1e2663[_0x5bc7('0x12')][_0x5bc7('0x14')]);return _0x49f11c(_0x1e2663[_0x5bc7('0x12')][_0x5bc7('0x14')]);}else{logger[_0x5bc7('0xc')](_0x5bc7('0xd'),_0x1acbd5,_0x5bc7('0xe'));_0x49f11c(_0x1e2663[_0x5bc7('0x15')][_0x5bc7('0x14')]);}})['catch'](function(_0x20104c){logger[_0x5bc7('0x12')](_0x5bc7('0xd'),_0x1acbd5,_0x20104c);_0x4f7df7(_0x20104c);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index e847be9..9ce6e98 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 _0x2bdb=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0x2bdb,0x1ce));var _0xb2bd=function(_0x290fb3,_0xee3d4d){_0x290fb3=_0x290fb3-0x0;var _0x3eea81=_0x2bdb[_0x290fb3];return _0x3eea81;};'use strict';var multer=require(_0xb2bd('0x0'));var util=require(_0xb2bd('0x1'));var path=require('path');var timeout=require(_0xb2bd('0x2'));var express=require(_0xb2bd('0x3'));var router=express[_0xb2bd('0x4')]();var fs_extra=require(_0xb2bd('0x5'));var auth=require(_0xb2bd('0x6'));var interaction=require(_0xb2bd('0x7'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xb2bd('0x8')]('/',auth[_0xb2bd('0x9')](),controller[_0xb2bd('0xa')]);router[_0xb2bd('0x8')](_0xb2bd('0xb'),auth[_0xb2bd('0x9')](),controller[_0xb2bd('0xc')]);router[_0xb2bd('0x8')]('/:id',auth[_0xb2bd('0x9')](),controller[_0xb2bd('0xd')]);router[_0xb2bd('0xe')]('/',auth[_0xb2bd('0x9')](),controller[_0xb2bd('0xf')]);router[_0xb2bd('0x10')](_0xb2bd('0x11'),auth['isAuthenticated'](),controller[_0xb2bd('0x12')]);router[_0xb2bd('0x13')](_0xb2bd('0x11'),auth[_0xb2bd('0x9')](),controller[_0xb2bd('0x14')]);module[_0xb2bd('0x15')]=router; \ No newline at end of file +var _0xbe89=['index','/describe','/:id','show','post','create','isAuthenticated','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x2a3417,_0x3b1231){var _0x2cafd0=function(_0x5814cb){while(--_0x5814cb){_0x2a3417['push'](_0x2a3417['shift']());}};_0x2cafd0(++_0x3b1231);}(_0xbe89,0x1ad));var _0x9be8=function(_0x5a2b40,_0x4ade95){_0x5a2b40=_0x5a2b40-0x0;var _0xcf7e26=_0xbe89[_0x5a2b40];return _0xcf7e26;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9be8('0x0'));var express=require(_0x9be8('0x1'));var router=express[_0x9be8('0x2')]();var fs_extra=require(_0x9be8('0x3'));var auth=require(_0x9be8('0x4'));var interaction=require(_0x9be8('0x5'));var config=require(_0x9be8('0x6'));var controller=require(_0x9be8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9be8('0x8')]);router['get'](_0x9be8('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9be8('0xa'),auth['isAuthenticated'](),controller[_0x9be8('0xb')]);router[_0x9be8('0xc')]('/',auth['isAuthenticated'](),controller[_0x9be8('0xd')]);router['put'](_0x9be8('0xa'),auth[_0x9be8('0xe')](),controller[_0x9be8('0xf')]);router[_0x9be8('0x10')]('/:id',auth[_0x9be8('0xe')](),controller[_0x9be8('0x11')]);module[_0x9be8('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 5be99fd..f2a1947 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 _0xb841=['sequelize','exports','STRING','mouseOver'];(function(_0x34ec7e,_0x50ec2b){var _0x1b6338=function(_0x10a6cd){while(--_0x10a6cd){_0x34ec7e['push'](_0x34ec7e['shift']());}};_0x1b6338(++_0x50ec2b);}(_0xb841,0x104));var _0x1b84=function(_0x48b208,_0x4f43dc){_0x48b208=_0x48b208-0x0;var _0x13b759=_0xb841[_0x48b208];return _0x13b759;};'use strict';var Sequelize=require(_0x1b84('0x0'));module[_0x1b84('0x1')]={'name':{'type':Sequelize[_0x1b84('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1b84('0x3'),'timeout'),'defaultValue':_0x1b84('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x94d9=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x48a98d,_0x8e63cc){var _0x224d50=function(_0x53b045){while(--_0x53b045){_0x48a98d['push'](_0x48a98d['shift']());}};_0x224d50(++_0x8e63cc);}(_0x94d9,0xc4));var _0x994d=function(_0x1dc703,_0x2692de){_0x1dc703=_0x1dc703-0x0;var _0x15634a=_0x94d9[_0x1dc703];return _0x15634a;};'use strict';var Sequelize=require(_0x994d('0x0'));module[_0x994d('0x1')]={'name':{'type':Sequelize[_0x994d('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x994d('0x3'),_0x994d('0x4')),'defaultValue':_0x994d('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x994d('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 2423371..1d88a35 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 _0xb2b5=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','destroy','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x353d8a,_0x3204ce){var _0x480431=function(_0x34a84c){while(--_0x34a84c){_0x353d8a['push'](_0x353d8a['shift']());}};_0x480431(++_0x3204ce);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xb2b5[_0x4d613c];return _0x301fe3;};'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(_0x5b2b('0x0'));var moment=require(_0x5b2b('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5b2b('0x2'));var path=require(_0x5b2b('0x3'));var sox=require(_0x5b2b('0x4'));var csv=require(_0x5b2b('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b2b('0x6'));var _=require(_0x5b2b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b2b('0x8'));var deskjs=require(_0x5b2b('0x9'));var toCsv=require(_0x5b2b('0x5'));var querystring=require(_0x5b2b('0xa'));var Papa=require(_0x5b2b('0xb'));var Redis=require(_0x5b2b('0xc'));var authService=require(_0x5b2b('0xd'));var qs=require(_0x5b2b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b2b('0xf'));var logger=require(_0x5b2b('0x10'))('api');var utils=require(_0x5b2b('0x11'));var config=require(_0x5b2b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b2b('0x13'))['db'];function respondWithStatusCode(_0x1a339a,_0xfe1936){_0xfe1936=_0xfe1936||0xcc;return function(_0x12f1f8){if(_0x12f1f8){return _0x1a339a[_0x5b2b('0x14')](_0xfe1936);}return _0x1a339a[_0x5b2b('0x15')](_0xfe1936)[_0x5b2b('0x16')]();};}function respondWithResult(_0x4bfe97,_0x30e9a3){_0x30e9a3=_0x30e9a3||0xc8;return function(_0x4fa243){if(_0x4fa243){return _0x4bfe97[_0x5b2b('0x15')](_0x30e9a3)[_0x5b2b('0x17')](_0x4fa243);}};}function respondWithFilteredResult(_0x3f5236,_0x2611a3){return function(_0x4ff4ba){if(_0x4ff4ba){var _0x310060=typeof _0x2611a3['offset']===_0x5b2b('0x18')&&typeof _0x2611a3['limit']==='undefined';var _0x44be6d=_0x4ff4ba[_0x5b2b('0x19')];var _0x5b6645=_0x310060?0x0:_0x2611a3[_0x5b2b('0x1a')];var _0x2db9ee=_0x310060?_0x4ff4ba[_0x5b2b('0x19')]:_0x2611a3[_0x5b2b('0x1a')]+_0x2611a3[_0x5b2b('0x1b')];var _0x47bb1b;if(_0x2db9ee>=_0x44be6d){_0x2db9ee=_0x44be6d;_0x47bb1b=0xc8;}else{_0x47bb1b=0xce;}_0x3f5236[_0x5b2b('0x15')](_0x47bb1b);return _0x3f5236[_0x5b2b('0x1c')](_0x5b2b('0x1d'),_0x5b6645+'-'+_0x2db9ee+'/'+_0x44be6d)[_0x5b2b('0x17')](_0x4ff4ba);}return null;};}function patchUpdates(_0x1b994d){return function(_0x42f0ed){try{jsonpatch[_0x5b2b('0x1e')](_0x42f0ed,_0x1b994d,!![]);}catch(_0x208c1f){return BPromise[_0x5b2b('0x1f')](_0x208c1f);}return _0x42f0ed[_0x5b2b('0x20')]();};}function saveUpdates(_0x34c624,_0xa8ebd5){return function(_0x2de273){if(_0x2de273){return _0x2de273[_0x5b2b('0x21')](_0x34c624)['then'](function(_0x5e0add){return _0x5e0add;});}return null;};}function removeEntity(_0xfdaeed,_0x58e346){return function(_0x3a530f){if(_0x3a530f){return _0x3a530f['destroy']()[_0x5b2b('0x22')](function(){_0xfdaeed[_0x5b2b('0x15')](0xcc)[_0x5b2b('0x16')]();});}};}function handleEntityNotFound(_0x37cbd8,_0x33a88c){return function(_0x564c21){if(!_0x564c21){_0x37cbd8[_0x5b2b('0x14')](0x194);}return _0x564c21;};}function handleError(_0x3e97dc,_0x55b05c){_0x55b05c=_0x55b05c||0x1f4;return function(_0x3fd917){logger[_0x5b2b('0x23')](_0x3fd917['stack']);if(_0x3fd917[_0x5b2b('0x24')]){delete _0x3fd917[_0x5b2b('0x24')];}_0x3e97dc[_0x5b2b('0x15')](_0x55b05c)[_0x5b2b('0x25')](_0x3fd917);};}exports[_0x5b2b('0x26')]=function(_0x94d866,_0x57284a){var _0x2c80be={'raw':!![],'where':{'id':_0x94d866[_0x5b2b('0x27')]['id']}},_0x42b46c={};_0x42b46c[_0x5b2b('0x28')]=_[_0x5b2b('0x29')](db['ChatProactiveAction'][_0x5b2b('0x2a')]);_0x42b46c[_0x5b2b('0x2b')]=_[_0x5b2b('0x29')](_0x94d866[_0x5b2b('0x2b')]);_0x42b46c[_0x5b2b('0x2c')]=_[_0x5b2b('0x2d')](_0x42b46c['model'],_0x42b46c[_0x5b2b('0x2b')]);_0x2c80be[_0x5b2b('0x2e')]=_[_0x5b2b('0x2d')](_0x42b46c[_0x5b2b('0x28')],qs[_0x5b2b('0x2f')](_0x94d866[_0x5b2b('0x2b')][_0x5b2b('0x2f')]));_0x2c80be[_0x5b2b('0x2e')]=_0x2c80be[_0x5b2b('0x2e')][_0x5b2b('0x30')]?_0x2c80be['attributes']:_0x42b46c[_0x5b2b('0x28')];if(_0x94d866[_0x5b2b('0x2b')][_0x5b2b('0x31')]){_0x2c80be[_0x5b2b('0x32')]=[{'all':!![]}];}_0x2c80be=_[_0x5b2b('0x33')]({},_0x2c80be,_0x94d866[_0x5b2b('0x34')]);return db[_0x5b2b('0x35')][_0x5b2b('0x36')](_0x2c80be)[_0x5b2b('0x22')](handleEntityNotFound(_0x57284a,null))['then'](respondWithResult(_0x57284a,null))[_0x5b2b('0x37')](handleError(_0x57284a,null));};exports[_0x5b2b('0x38')]=function(_0x1f6b2f,_0xf0bed){return db['ChatProactiveAction']['create'](_0x1f6b2f[_0x5b2b('0x39')],{})['then'](respondWithResult(_0xf0bed,0xc9))[_0x5b2b('0x37')](handleError(_0xf0bed,null));};exports[_0x5b2b('0x21')]=function(_0x176eb4,_0x461515){if(_0x176eb4['body']['id']){delete _0x176eb4[_0x5b2b('0x39')]['id'];}return db[_0x5b2b('0x35')][_0x5b2b('0x36')]({'where':{'id':_0x176eb4[_0x5b2b('0x27')]['id']}})[_0x5b2b('0x22')](handleEntityNotFound(_0x461515,null))[_0x5b2b('0x22')](saveUpdates(_0x176eb4[_0x5b2b('0x39')],null))['then'](respondWithResult(_0x461515,null))['catch'](handleError(_0x461515,null));};exports[_0x5b2b('0x3a')]=function(_0xb4ad96,_0x4a97e0){return db[_0x5b2b('0x35')][_0x5b2b('0x36')]({'where':{'id':_0xb4ad96['params']['id']}})['then'](handleEntityNotFound(_0x4a97e0,null))['then'](removeEntity(_0x4a97e0,null))[_0x5b2b('0x37')](handleError(_0x4a97e0,null));}; \ No newline at end of file +var _0x871e=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','eml-format','zip-dir'];(function(_0x168d1f,_0x38d2f2){var _0x5945e8=function(_0x506968){while(--_0x506968){_0x168d1f['push'](_0x168d1f['shift']());}};_0x5945e8(++_0x38d2f2);}(_0x871e,0x1b0));var _0xe871=function(_0x1ff1aa,_0x11ef13){_0x1ff1aa=_0x1ff1aa-0x0;var _0x56c390=_0x871e[_0x1ff1aa];return _0x56c390;};'use strict';var emlformat=require(_0xe871('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe871('0x1'));var jsonpatch=require(_0xe871('0x2'));var rp=require(_0xe871('0x3'));var moment=require(_0xe871('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe871('0x5'));var util=require(_0xe871('0x6'));var path=require(_0xe871('0x7'));var sox=require(_0xe871('0x8'));var csv=require(_0xe871('0x9'));var ejs=require(_0xe871('0xa'));var fs=require('fs');var fs_extra=require(_0xe871('0xb'));var _=require(_0xe871('0xc'));var squel=require(_0xe871('0xd'));var crypto=require(_0xe871('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe871('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe871('0x10'));var Redis=require(_0xe871('0x11'));var authService=require(_0xe871('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe871('0x13'));var hardwareService=require(_0xe871('0x14'));var logger=require(_0xe871('0x15'))(_0xe871('0x16'));var utils=require(_0xe871('0x17'));var config=require(_0xe871('0x18'));var licenseUtil=require(_0xe871('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x240326,_0xadc7ff){_0xadc7ff=_0xadc7ff||0xcc;return function(_0x7462bb){if(_0x7462bb){return _0x240326[_0xe871('0x1a')](_0xadc7ff);}return _0x240326[_0xe871('0x1b')](_0xadc7ff)[_0xe871('0x1c')]();};}function respondWithResult(_0x631913,_0x3f560a){_0x3f560a=_0x3f560a||0xc8;return function(_0x2e1c95){if(_0x2e1c95){return _0x631913['status'](_0x3f560a)[_0xe871('0x1d')](_0x2e1c95);}};}function respondWithFilteredResult(_0x48ebad,_0x4f7aec){return function(_0x2a5557){if(_0x2a5557){var _0x18e9ef=typeof _0x4f7aec[_0xe871('0x1e')]===_0xe871('0x1f')&&typeof _0x4f7aec[_0xe871('0x20')]===_0xe871('0x1f');var _0x415937=_0x2a5557[_0xe871('0x21')];var _0x11ad56=_0x18e9ef?0x0:_0x4f7aec['offset'];var _0x31319f=_0x18e9ef?_0x2a5557['count']:_0x4f7aec[_0xe871('0x1e')]+_0x4f7aec[_0xe871('0x20')];var _0x48eb94;if(_0x31319f>=_0x415937){_0x31319f=_0x415937;_0x48eb94=0xc8;}else{_0x48eb94=0xce;}_0x48ebad[_0xe871('0x1b')](_0x48eb94);return _0x48ebad[_0xe871('0x22')](_0xe871('0x23'),_0x11ad56+'-'+_0x31319f+'/'+_0x415937)[_0xe871('0x1d')](_0x2a5557);}return null;};}function patchUpdates(_0x3289af){return function(_0x328066){try{jsonpatch[_0xe871('0x24')](_0x328066,_0x3289af,!![]);}catch(_0x1a316d){return BPromise[_0xe871('0x25')](_0x1a316d);}return _0x328066[_0xe871('0x26')]();};}function saveUpdates(_0x162228,_0x45c8b0){return function(_0x3e6d9b){if(_0x3e6d9b){return _0x3e6d9b[_0xe871('0x27')](_0x162228)[_0xe871('0x28')](function(_0x301a18){return _0x301a18;});}return null;};}function removeEntity(_0x2007a7,_0x45ca0d){return function(_0x3ec683){if(_0x3ec683){return _0x3ec683[_0xe871('0x29')]()[_0xe871('0x28')](function(){_0x2007a7[_0xe871('0x1b')](0xcc)[_0xe871('0x1c')]();});}};}function handleEntityNotFound(_0x416589,_0x18799f){return function(_0x2b9fc5){if(!_0x2b9fc5){_0x416589['sendStatus'](0x194);}return _0x2b9fc5;};}function handleError(_0x4e94f3,_0x49d794){_0x49d794=_0x49d794||0x1f4;return function(_0x469b45){logger[_0xe871('0x2a')](_0x469b45[_0xe871('0x2b')]);if(_0x469b45[_0xe871('0x2c')]){delete _0x469b45['name'];}_0x4e94f3[_0xe871('0x1b')](_0x49d794)['send'](_0x469b45);};}exports['show']=function(_0x50ac1e,_0x3708f6){var _0xa4cbdb={'raw':!![],'where':{'id':_0x50ac1e[_0xe871('0x2d')]['id']}},_0x2bfab3={};_0x2bfab3[_0xe871('0x2e')]=_[_0xe871('0x2f')](db[_0xe871('0x30')][_0xe871('0x31')]);_0x2bfab3[_0xe871('0x32')]=_[_0xe871('0x2f')](_0x50ac1e[_0xe871('0x32')]);_0x2bfab3['filters']=_['intersection'](_0x2bfab3['model'],_0x2bfab3[_0xe871('0x32')]);_0xa4cbdb['attributes']=_[_0xe871('0x33')](_0x2bfab3['model'],qs['fields'](_0x50ac1e[_0xe871('0x32')][_0xe871('0x34')]));_0xa4cbdb[_0xe871('0x35')]=_0xa4cbdb[_0xe871('0x35')][_0xe871('0x36')]?_0xa4cbdb[_0xe871('0x35')]:_0x2bfab3[_0xe871('0x2e')];if(_0x50ac1e[_0xe871('0x32')][_0xe871('0x37')]){_0xa4cbdb['include']=[{'all':!![]}];}_0xa4cbdb=_[_0xe871('0x38')]({},_0xa4cbdb,_0x50ac1e[_0xe871('0x39')]);return db[_0xe871('0x30')][_0xe871('0x3a')](_0xa4cbdb)[_0xe871('0x28')](handleEntityNotFound(_0x3708f6,null))[_0xe871('0x28')](respondWithResult(_0x3708f6,null))[_0xe871('0x3b')](handleError(_0x3708f6,null));};exports['create']=function(_0xf6572b,_0x2971bc){return db[_0xe871('0x30')][_0xe871('0x3c')](_0xf6572b[_0xe871('0x3d')],{})[_0xe871('0x28')](respondWithResult(_0x2971bc,0xc9))[_0xe871('0x3b')](handleError(_0x2971bc,null));};exports[_0xe871('0x27')]=function(_0x468e12,_0x505fce){if(_0x468e12[_0xe871('0x3d')]['id']){delete _0x468e12['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x468e12['params']['id']}})['then'](handleEntityNotFound(_0x505fce,null))['then'](saveUpdates(_0x468e12[_0xe871('0x3d')],null))['then'](respondWithResult(_0x505fce,null))[_0xe871('0x3b')](handleError(_0x505fce,null));};exports[_0xe871('0x29')]=function(_0x56143f,_0x5034b2){return db['ChatProactiveAction'][_0xe871('0x3a')]({'where':{'id':_0x56143f[_0xe871('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5034b2,null))[_0xe871('0x28')](removeEntity(_0x5034b2,null))[_0xe871('0x3b')](handleError(_0x5034b2,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index be1a5f2..e0a0847 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 _0xbe1e=['exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./chatProactiveAction.attributes'];(function(_0x3195a3,_0x80b2ae){var _0x1d265d=function(_0x197e9e){while(--_0x197e9e){_0x3195a3['push'](_0x3195a3['shift']());}};_0x1d265d(++_0x80b2ae);}(_0xbe1e,0xca));var _0xebe1=function(_0x49f522,_0x3c7ae7){_0x49f522=_0x49f522-0x0;var _0x47a27f=_0xbe1e[_0x49f522];return _0x47a27f;};'use strict';var _=require(_0xebe1('0x0'));var util=require('util');var logger=require(_0xebe1('0x1'))(_0xebe1('0x2'));var moment=require(_0xebe1('0x3'));var BPromise=require(_0xebe1('0x4'));var rp=require(_0xebe1('0x5'));var fs=require('fs');var path=require(_0xebe1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xebe1('0x7'));module[_0xebe1('0x8')]=function(_0x5ad974,_0x339d88){return _0x5ad974[_0xebe1('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7323=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7323,0x9a));var _0x3732=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x7323[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0x3732('0x0'));var util=require(_0x3732('0x1'));var logger=require(_0x3732('0x2'))(_0x3732('0x3'));var moment=require(_0x3732('0x4'));var BPromise=require(_0x3732('0x5'));var rp=require(_0x3732('0x6'));var fs=require('fs');var path=require(_0x3732('0x7'));var rimraf=require(_0x3732('0x8'));var config=require('../../config/environment');var attributes=require(_0x3732('0x9'));module[_0x3732('0xa')]=function(_0x3e299e,_0x139659){return _0x3e299e[_0x3732('0xb')](_0x3732('0xc'),attributes,{'tableName':_0x3732('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 388eb73..9b4f972 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 _0x41bc=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x287948,_0xc32766){var _0x1a2dfc=function(_0x3ce0fb){while(--_0x3ce0fb){_0x287948['push'](_0x287948['shift']());}};_0x1a2dfc(++_0xc32766);}(_0x41bc,0xa8));var _0xc41b=function(_0x239c8d,_0x20c2af){_0x239c8d=_0x239c8d-0x0;var _0x38fd01=_0x41bc[_0x239c8d];return _0x38fd01;};'use strict';var _=require(_0xc41b('0x0'));var util=require(_0xc41b('0x1'));var moment=require(_0xc41b('0x2'));var BPromise=require(_0xc41b('0x3'));var rs=require(_0xc41b('0x4'));var fs=require('fs');var Redis=require(_0xc41b('0x5'));var db=require(_0xc41b('0x6'))['db'];var utils=require(_0xc41b('0x7'));var logger=require(_0xc41b('0x8'))('rpc');var config=require(_0xc41b('0x9'));var jayson=require(_0xc41b('0xa'));var client=jayson[_0xc41b('0xb')][_0xc41b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a7e08,_0x586bc1,_0x410e87){return new BPromise(function(_0x52153c,_0x14a047){return client[_0xc41b('0xd')](_0x5a7e08,_0x410e87)[_0xc41b('0xe')](function(_0x544645){logger[_0xc41b('0xf')](_0xc41b('0x10'),_0x586bc1,_0xc41b('0x11'));logger[_0xc41b('0x12')](_0xc41b('0x13'),_0x586bc1,'request\x20sent',JSON['stringify'](_0x544645));if(_0x544645[_0xc41b('0x14')]){if(_0x544645[_0xc41b('0x14')][_0xc41b('0x15')]===0x1f4){logger[_0xc41b('0x14')](_0xc41b('0x10'),_0x586bc1,_0x544645['error']['message']);return _0x14a047(_0x544645[_0xc41b('0x14')][_0xc41b('0x16')]);}logger[_0xc41b('0x14')](_0xc41b('0x10'),_0x586bc1,_0x544645[_0xc41b('0x14')]['message']);return _0x52153c(_0x544645[_0xc41b('0x14')][_0xc41b('0x16')]);}else{logger[_0xc41b('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x586bc1,_0xc41b('0x11'));_0x52153c(_0x544645['result'][_0xc41b('0x16')]);}})[_0xc41b('0x17')](function(_0x59167c){logger[_0xc41b('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x586bc1,_0x59167c);_0x14a047(_0x59167c);});});} \ No newline at end of file +var _0xf096=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x4f33cb,_0x46c73d){var _0x2b2dbd=function(_0x2e4abf){while(--_0x2e4abf){_0x4f33cb['push'](_0x4f33cb['shift']());}};_0x2b2dbd(++_0x46c73d);}(_0xf096,0x1a1));var _0x6f09=function(_0x428e3b,_0x1525fa){_0x428e3b=_0x428e3b-0x0;var _0x38a1c7=_0xf096[_0x428e3b];return _0x38a1c7;};'use strict';var _=require('lodash');var util=require(_0x6f09('0x0'));var moment=require(_0x6f09('0x1'));var BPromise=require(_0x6f09('0x2'));var rs=require(_0x6f09('0x3'));var fs=require('fs');var Redis=require(_0x6f09('0x4'));var db=require(_0x6f09('0x5'))['db'];var utils=require(_0x6f09('0x6'));var logger=require(_0x6f09('0x7'))(_0x6f09('0x8'));var config=require('../../config/environment');var jayson=require(_0x6f09('0x9'));var client=jayson['client'][_0x6f09('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x276c2c,_0x325bb9,_0x46e38a){return new BPromise(function(_0x3b2687,_0x5ab22a){return client[_0x6f09('0xb')](_0x276c2c,_0x46e38a)['then'](function(_0x3691fa){logger[_0x6f09('0xc')](_0x6f09('0xd'),_0x325bb9,_0x6f09('0xe'));logger['debug'](_0x6f09('0xf'),_0x325bb9,_0x6f09('0xe'),JSON[_0x6f09('0x10')](_0x3691fa));if(_0x3691fa[_0x6f09('0x11')]){if(_0x3691fa[_0x6f09('0x11')][_0x6f09('0x12')]===0x1f4){logger[_0x6f09('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x325bb9,_0x3691fa['error'][_0x6f09('0x13')]);return _0x5ab22a(_0x3691fa[_0x6f09('0x11')]['message']);}logger[_0x6f09('0x11')](_0x6f09('0xd'),_0x325bb9,_0x3691fa[_0x6f09('0x11')]['message']);return _0x3b2687(_0x3691fa[_0x6f09('0x11')][_0x6f09('0x13')]);}else{logger['info'](_0x6f09('0xd'),_0x325bb9,_0x6f09('0xe'));_0x3b2687(_0x3691fa[_0x6f09('0x14')][_0x6f09('0x13')]);}})[_0x6f09('0x15')](function(_0x395e8b){logger[_0x6f09('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x325bb9,_0x395e8b);_0x5ab22a(_0x395e8b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index c4e1d1c..8a63909 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x5c1a8e,_0x316c57){var _0x5ea5bd=function(_0x1d23ac){while(--_0x1d23ac){_0x5c1a8e['push'](_0x5c1a8e['shift']());}};_0x5ea5bd(++_0x316c57);}(_0x33c5,0xe6));var _0x533c=function(_0x512980,_0x401e50){_0x512980=_0x512980-0x0;var _0x571f0a=_0x33c5[_0x512980];return _0x571f0a;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9957=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/',auth['isAuthenticated'](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 4714f77..4e8a38f 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 _0xc41b=['exports','STRING','name','INTEGER','roundrobin','sequelize'];(function(_0x376b5b,_0x6ec7b2){var _0xf605dc=function(_0x12da97){while(--_0x12da97){_0x376b5b['push'](_0x376b5b['shift']());}};_0xf605dc(++_0x6ec7b2);}(_0xc41b,0x1bb));var _0xbc41=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc41b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xbc41('0x0'));module[_0xbc41('0x1')]={'name':{'type':Sequelize[_0xbc41('0x2')],'unique':_0xbc41('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbc41('0x2')]},'timeout':{'type':Sequelize[_0xbc41('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xbc41('0x5'))}}; \ No newline at end of file +var _0xf523=['name','ENUM','roundrobin','sequelize','exports','STRING'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xf523,0x11d));var _0x3f52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf523[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3f52('0x0'));module[_0x3f52('0x1')]={'name':{'type':Sequelize[_0x3f52('0x2')],'unique':_0x3f52('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3f52('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3f52('0x4')]('rrmemory','beepall',_0x3f52('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index c51fcca..8e0689f 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 _0x29d2=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatQueue.socket','register','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserChatQueue','nolimit','User','UserId','chatPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','addTeams','online','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','compact','value','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5825c4,_0x30a289){var _0x5c1b2d=function(_0x2d9777){while(--_0x2d9777){_0x5825c4['push'](_0x5825c4['shift']());}};_0x5c1b2d(++_0x30a289);}(_0x29d2,0x1a7));var _0x229d=function(_0x119f19,_0x3475a2){_0x119f19=_0x119f19-0x0;var _0x540a8d=_0x29d2[_0x119f19];return _0x540a8d;};'use strict';var emlformat=require(_0x229d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x229d('0x1'));var jsonpatch=require(_0x229d('0x2'));var rp=require(_0x229d('0x3'));var moment=require(_0x229d('0x4'));var BPromise=require(_0x229d('0x5'));var Mustache=require(_0x229d('0x6'));var util=require(_0x229d('0x7'));var path=require(_0x229d('0x8'));var sox=require(_0x229d('0x9'));var csv=require(_0x229d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x229d('0xb'));var squel=require(_0x229d('0xc'));var crypto=require(_0x229d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x229d('0xa'));var querystring=require('querystring');var Papa=require(_0x229d('0xe'));var Redis=require(_0x229d('0xf'));var authService=require(_0x229d('0x10'));var qs=require(_0x229d('0x11'));var as=require(_0x229d('0x12'));var hardwareService=require(_0x229d('0x13'));var logger=require(_0x229d('0x14'))(_0x229d('0x15'));var utils=require(_0x229d('0x16'));var config=require(_0x229d('0x17'));var licenseUtil=require(_0x229d('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x229d('0x19')],{'host':_0x229d('0x1a'),'port':0x18eb});var socket=require(_0x229d('0x1b'))(new Redis(config[_0x229d('0x19')]));require(_0x229d('0x1c'))[_0x229d('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x229d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5d15fb,_0x584426,_0x692052,_0x13a5a3){return new BPromise(function(_0x1bb8ad,_0x233b62){var _0x467f89=_0x13a5a3||client;return _0x467f89['request'](_0x5d15fb,_0x692052)[_0x229d('0x1f')](function(_0x15290f){logger[_0x229d('0x20')](_0x229d('0x21'),_0x584426,_0x229d('0x22'));logger['debug'](_0x229d('0x23'),_0x584426,_0x229d('0x22'),JSON[_0x229d('0x24')](_0x15290f));if(_0x15290f[_0x229d('0x25')]){if(_0x15290f[_0x229d('0x25')][_0x229d('0x26')]===0x1f4){logger['error'](_0x229d('0x21'),_0x584426,_0x15290f['error'][_0x229d('0x27')]);return _0x233b62(_0x15290f[_0x229d('0x25')][_0x229d('0x27')]);}logger[_0x229d('0x25')](_0x229d('0x21'),_0x584426,_0x15290f[_0x229d('0x25')][_0x229d('0x27')]);return _0x1bb8ad(_0x15290f[_0x229d('0x25')]['message']);}else{logger[_0x229d('0x20')](_0x229d('0x21'),_0x584426,_0x229d('0x22'));_0x1bb8ad(_0x15290f[_0x229d('0x28')][_0x229d('0x27')]);}})[_0x229d('0x29')](function(_0x41d162){logger['error'](_0x229d('0x21'),_0x584426,_0x41d162);_0x233b62(_0x41d162);});});}function respondWithStatusCode(_0x2c7bc4,_0xe78aba){_0xe78aba=_0xe78aba||0xcc;return function(_0x29d49d){if(_0x29d49d){return _0x2c7bc4[_0x229d('0x2a')](_0xe78aba);}return _0x2c7bc4[_0x229d('0x2b')](_0xe78aba)[_0x229d('0x2c')]();};}function respondWithResult(_0x1f5ce1,_0x5327fd){_0x5327fd=_0x5327fd||0xc8;return function(_0x4776fe){if(_0x4776fe){return _0x1f5ce1[_0x229d('0x2b')](_0x5327fd)[_0x229d('0x2d')](_0x4776fe);}};}function respondWithFilteredResult(_0x3b201a,_0x184136){return function(_0x5970f7){if(_0x5970f7){var _0x1af37e=typeof _0x184136[_0x229d('0x2e')]===_0x229d('0x2f')&&typeof _0x184136[_0x229d('0x30')]===_0x229d('0x2f');var _0x37199d=_0x5970f7['count'];var _0x3f66a2=_0x1af37e?0x0:_0x184136[_0x229d('0x2e')];var _0x188c05=_0x1af37e?_0x5970f7[_0x229d('0x31')]:_0x184136[_0x229d('0x2e')]+_0x184136[_0x229d('0x30')];var _0xbe6f45;if(_0x188c05>=_0x37199d){_0x188c05=_0x37199d;_0xbe6f45=0xc8;}else{_0xbe6f45=0xce;}_0x3b201a['status'](_0xbe6f45);return _0x3b201a[_0x229d('0x32')](_0x229d('0x33'),_0x3f66a2+'-'+_0x188c05+'/'+_0x37199d)[_0x229d('0x2d')](_0x5970f7);}return null;};}function patchUpdates(_0x1aa92e){return function(_0x33a83f){try{jsonpatch['apply'](_0x33a83f,_0x1aa92e,!![]);}catch(_0xe261f8){return BPromise[_0x229d('0x34')](_0xe261f8);}return _0x33a83f[_0x229d('0x35')]();};}function saveUpdates(_0x5f0de5,_0x28b2b5){return function(_0xa53ccc){if(_0xa53ccc){return _0xa53ccc[_0x229d('0x36')](_0x5f0de5)[_0x229d('0x1f')](function(_0x22ce40){return _0x22ce40;});}return null;};}function removeEntity(_0x1f716c,_0xd67f63){return function(_0xbd334f){if(_0xbd334f){return _0xbd334f[_0x229d('0x37')]()[_0x229d('0x1f')](function(){var _0x4d72b5=_0xbd334f[_0x229d('0x38')]({'plain':!![]});var _0x587f99=_0x229d('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x587f99,'resourceId':_0x4d72b5['id']}})['then'](function(){return _0xbd334f;});})[_0x229d('0x1f')](function(){_0x1f716c[_0x229d('0x2b')](0xcc)[_0x229d('0x2c')]();});}};}function handleEntityNotFound(_0x4926f0,_0x87b32){return function(_0x295a6c){if(!_0x295a6c){_0x4926f0['sendStatus'](0x194);}return _0x295a6c;};}function handleError(_0x5112ad,_0x1b73b1){_0x1b73b1=_0x1b73b1||0x1f4;return function(_0x331ea7){logger[_0x229d('0x25')](_0x331ea7['stack']);if(_0x331ea7[_0x229d('0x3a')]){delete _0x331ea7[_0x229d('0x3a')];}_0x5112ad[_0x229d('0x2b')](_0x1b73b1)[_0x229d('0x3b')](_0x331ea7);};}exports['index']=function(_0x5369b1,_0x7a22ed){var _0xbe13e3={},_0x326057={},_0x112432={'count':0x0,'rows':[]};var _0x30503b=_[_0x229d('0x3c')](db[_0x229d('0x3d')][_0x229d('0x3e')],function(_0x7d183b){return{'name':_0x7d183b[_0x229d('0x3f')],'type':_0x7d183b[_0x229d('0x40')][_0x229d('0x41')]};});_0x326057[_0x229d('0x42')]=_['map'](_0x30503b,_0x229d('0x3a'));_0x326057[_0x229d('0x43')]=_[_0x229d('0x44')](_0x5369b1[_0x229d('0x43')]);_0x326057[_0x229d('0x45')]=_[_0x229d('0x46')](_0x326057[_0x229d('0x42')],_0x326057[_0x229d('0x43')]);_0xbe13e3['attributes']=_['intersection'](_0x326057[_0x229d('0x42')],qs[_0x229d('0x47')](_0x5369b1[_0x229d('0x43')][_0x229d('0x47')]));_0xbe13e3['attributes']=_0xbe13e3[_0x229d('0x48')]['length']?_0xbe13e3[_0x229d('0x48')]:_0x326057[_0x229d('0x42')];if(!_0x5369b1['query'][_0x229d('0x49')]('nolimit')){_0xbe13e3[_0x229d('0x30')]=qs[_0x229d('0x30')](_0x5369b1[_0x229d('0x43')][_0x229d('0x30')]);_0xbe13e3[_0x229d('0x2e')]=qs[_0x229d('0x2e')](_0x5369b1['query']['offset']);}_0xbe13e3[_0x229d('0x4a')]=qs[_0x229d('0x4b')](_0x5369b1['query'][_0x229d('0x4b')]);_0xbe13e3[_0x229d('0x4c')]=qs[_0x229d('0x45')](_[_0x229d('0x4d')](_0x5369b1[_0x229d('0x43')],_0x326057[_0x229d('0x45')]),_0x30503b);if(_0x5369b1[_0x229d('0x43')][_0x229d('0x4e')]){_0xbe13e3[_0x229d('0x4c')]=_[_0x229d('0x4f')](_0xbe13e3[_0x229d('0x4c')],{'$or':_[_0x229d('0x3c')](_0x30503b,function(_0x44f17f){if(_0x44f17f[_0x229d('0x40')]!==_0x229d('0x50')){var _0x4db17e={};_0x4db17e[_0x44f17f[_0x229d('0x3a')]]={'$like':'%'+_0x5369b1[_0x229d('0x43')][_0x229d('0x4e')]+'%'};return _0x4db17e;}})});}_0xbe13e3=_[_0x229d('0x4f')]({},_0xbe13e3,_0x5369b1['options']);var _0x4146c5={'where':_0xbe13e3[_0x229d('0x4c')]};return db[_0x229d('0x3d')][_0x229d('0x31')](_0x4146c5)[_0x229d('0x1f')](function(_0x4ffe76){_0x112432[_0x229d('0x31')]=_0x4ffe76;if(_0x5369b1[_0x229d('0x43')][_0x229d('0x51')]){_0xbe13e3[_0x229d('0x52')]=[{'all':!![]}];}return db[_0x229d('0x3d')][_0x229d('0x53')](_0xbe13e3);})[_0x229d('0x1f')](function(_0x4fd339){_0x112432[_0x229d('0x54')]=_0x4fd339;return _0x112432;})[_0x229d('0x1f')](respondWithFilteredResult(_0x7a22ed,_0xbe13e3))[_0x229d('0x29')](handleError(_0x7a22ed,null));};exports['show']=function(_0x379351,_0x1d5257){var _0x5d74b7={'raw':!![],'where':{'id':_0x379351['params']['id']}},_0x17cc15={};_0x17cc15['model']=_[_0x229d('0x44')](db[_0x229d('0x3d')][_0x229d('0x3e')]);_0x17cc15[_0x229d('0x43')]=_[_0x229d('0x44')](_0x379351[_0x229d('0x43')]);_0x17cc15[_0x229d('0x45')]=_[_0x229d('0x46')](_0x17cc15['model'],_0x17cc15[_0x229d('0x43')]);_0x5d74b7[_0x229d('0x48')]=_[_0x229d('0x46')](_0x17cc15[_0x229d('0x42')],qs[_0x229d('0x47')](_0x379351['query']['fields']));_0x5d74b7[_0x229d('0x48')]=_0x5d74b7[_0x229d('0x48')][_0x229d('0x55')]?_0x5d74b7['attributes']:_0x17cc15[_0x229d('0x42')];if(_0x379351['query'][_0x229d('0x51')]){_0x5d74b7['include']=[{'all':!![]}];}_0x5d74b7=_['merge']({},_0x5d74b7,_0x379351[_0x229d('0x56')]);return db['ChatQueue'][_0x229d('0x57')](_0x5d74b7)['then'](handleEntityNotFound(_0x1d5257,null))[_0x229d('0x1f')](respondWithResult(_0x1d5257,null))[_0x229d('0x29')](handleError(_0x1d5257,null));};exports[_0x229d('0x58')]=function(_0x2bc1f8,_0x4e6443){return db[_0x229d('0x3d')]['create'](_0x2bc1f8['body'],{})[_0x229d('0x1f')](function(_0x49aa6d){var _0x31df41=_0x2bc1f8[_0x229d('0x59')][_0x229d('0x38')]({'plain':!![]});if(!_0x31df41)throw new Error(_0x229d('0x5a'));if(_0x31df41[_0x229d('0x5b')]===_0x229d('0x59')){var _0x302f65=_0x49aa6d[_0x229d('0x38')]({'plain':!![]});var _0x552ff4=_0x229d('0x39');return db[_0x229d('0x5c')]['find']({'where':{'name':_0x552ff4,'userProfileId':_0x31df41[_0x229d('0x5d')]},'raw':!![]})['then'](function(_0x1dc42b){if(_0x1dc42b&&_0x1dc42b[_0x229d('0x5e')]===0x0){return db[_0x229d('0x5f')][_0x229d('0x58')]({'name':_0x302f65[_0x229d('0x3a')],'resourceId':_0x302f65['id'],'type':_0x1dc42b[_0x229d('0x3a')],'sectionId':_0x1dc42b['id']},{})[_0x229d('0x1f')](function(){return _0x49aa6d;});}else{return _0x49aa6d;}})['catch'](function(_0x4aab5e){logger[_0x229d('0x25')](_0x229d('0x60'),_0x4aab5e);throw _0x4aab5e;});}return _0x49aa6d;})[_0x229d('0x1f')](respondWithResult(_0x4e6443,0xc9))['catch'](handleError(_0x4e6443,null));};exports[_0x229d('0x36')]=function(_0x5a66e4,_0x40fd7c){if(_0x5a66e4[_0x229d('0x61')]['id']){delete _0x5a66e4[_0x229d('0x61')]['id'];}return db[_0x229d('0x3d')][_0x229d('0x57')]({'where':{'id':_0x5a66e4[_0x229d('0x62')]['id']}})[_0x229d('0x1f')](handleEntityNotFound(_0x40fd7c,null))[_0x229d('0x1f')](saveUpdates(_0x5a66e4['body'],null))[_0x229d('0x1f')](respondWithResult(_0x40fd7c,null))[_0x229d('0x29')](handleError(_0x40fd7c,null));};exports[_0x229d('0x37')]=function(_0x48b936,_0x56499d){return db[_0x229d('0x3d')][_0x229d('0x57')]({'where':{'id':_0x48b936['params']['id']}})['then'](handleEntityNotFound(_0x56499d,null))[_0x229d('0x1f')](removeEntity(_0x56499d,null))[_0x229d('0x29')](handleError(_0x56499d,null));};exports[_0x229d('0x63')]=function(_0x5809a2,_0x4f0a80){return db[_0x229d('0x3d')][_0x229d('0x63')]()['then'](respondWithResult(_0x4f0a80,null))['catch'](handleError(_0x4f0a80,null));};exports['getMembers']=function(_0x742bde,_0x2bf0a9,_0x35812d){var _0x25d28f={'raw':!![],'where':{}},_0x475004={},_0x267fb5;return db[_0x229d('0x3d')][_0x229d('0x64')]({'where':{'id':_0x742bde[_0x229d('0x62')]['id']}})[_0x229d('0x1f')](handleEntityNotFound(_0x2bf0a9,null))[_0x229d('0x1f')](function(_0xa236a7){if(_0xa236a7){_0x267fb5=_0xa236a7[_0x229d('0x38')]({'plain':!![]});_0x475004[_0x229d('0x42')]=_['keys'](db[_0x229d('0x65')][_0x229d('0x3e')]);_0x475004[_0x229d('0x43')]=_[_0x229d('0x44')](_0x742bde[_0x229d('0x43')]);_0x475004[_0x229d('0x45')]=_[_0x229d('0x46')](_0x475004[_0x229d('0x42')],_0x475004[_0x229d('0x43')]);_0x25d28f['attributes']=_[_0x229d('0x46')](_0x475004[_0x229d('0x42')],qs[_0x229d('0x47')](_0x742bde[_0x229d('0x43')]['fields']));_0x25d28f[_0x229d('0x48')]=_0x25d28f[_0x229d('0x48')][_0x229d('0x55')]?_0x25d28f[_0x229d('0x48')]:_0x475004['model'];if(!_0x742bde[_0x229d('0x43')]['hasOwnProperty'](_0x229d('0x66'))){_0x25d28f[_0x229d('0x30')]=qs[_0x229d('0x30')](_0x742bde[_0x229d('0x43')][_0x229d('0x30')]);_0x25d28f[_0x229d('0x2e')]=qs[_0x229d('0x2e')](_0x742bde[_0x229d('0x43')][_0x229d('0x2e')]);}_0x25d28f['order']=qs[_0x229d('0x4b')](_0x742bde[_0x229d('0x43')][_0x229d('0x4b')]);_0x25d28f[_0x229d('0x4c')]=qs[_0x229d('0x45')](_[_0x229d('0x4d')](_0x742bde['query'],_0x475004[_0x229d('0x45')]));_0x25d28f[_0x229d('0x4c')]['ChatQueueId']=_0xa236a7['id'];if(_0x742bde[_0x229d('0x43')][_0x229d('0x4e')]){_0x25d28f[_0x229d('0x4c')]=_['merge'](_0x25d28f[_0x229d('0x4c')],{'$or':_[_0x229d('0x3c')](_0x25d28f[_0x229d('0x48')],function(_0x1c5d82){var _0xab2133={};_0xab2133[_0x1c5d82]={'$like':'%'+_0x742bde['query'][_0x229d('0x4e')]+'%'};return _0xab2133;})});}_0x25d28f=_[_0x229d('0x4f')]({},_0x25d28f,_0x742bde['options']);return db[_0x229d('0x65')][_0x229d('0x53')](_0x25d28f);}})[_0x229d('0x1f')](function(_0x808a0b){if(_0x808a0b){return db[_0x229d('0x67')]['findAndCountAll']({'where':{'id':_[_0x229d('0x3c')](_0x808a0b,_0x229d('0x68')),'role':'agent'},'attributes':['id',_0x229d('0x3a'),_0x229d('0x69'),_0x229d('0x6a'),'createdAt']});}})[_0x229d('0x1f')](function(_0x40b48b){if(_0x40b48b){return{'count':_0x40b48b[_0x229d('0x31')],'rows':_['map'](_0x40b48b[_0x229d('0x54')],function(_0x33b31a){return{'membername':_0x33b31a[_0x229d('0x3a')],'UserId':_0x33b31a['id'],'queue_name':_0x267fb5[_0x229d('0x3a')],'ChatQueueId':_0x267fb5['id'],'interface':util['format'](_0x229d('0x6b'),_0x229d('0x6c'),_0x33b31a[_0x229d('0x3a')]),'penalty':0x0,'paused':_0x33b31a[_0x229d('0x69')],'createdAt':_0x33b31a[_0x229d('0x6d')],'updatedAt':_0x33b31a[_0x229d('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x229d('0x1f')](respondWithFilteredResult(_0x2bf0a9,_0x25d28f))[_0x229d('0x29')](handleError(_0x2bf0a9,null));};exports[_0x229d('0x6e')]=function(_0x585dbe,_0x3fc6de,_0x4b1ccb){var _0x6f0be1={};var _0x5808ad={};var _0x4d2d49;var _0x2237b5;return db[_0x229d('0x3d')][_0x229d('0x64')]({'where':{'id':_0x585dbe['params']['id']}})[_0x229d('0x1f')](handleEntityNotFound(_0x3fc6de,null))[_0x229d('0x1f')](function(_0x389e60){if(_0x389e60){_0x4d2d49=_0x389e60;_0x5808ad['model']=_['keys'](db[_0x229d('0x6f')][_0x229d('0x3e')]);_0x5808ad['query']=_[_0x229d('0x44')](_0x585dbe[_0x229d('0x43')]);_0x5808ad[_0x229d('0x45')]=_[_0x229d('0x46')](_0x5808ad['model'],_0x5808ad['query']);_0x6f0be1[_0x229d('0x48')]=_[_0x229d('0x46')](_0x5808ad['model'],qs[_0x229d('0x47')](_0x585dbe[_0x229d('0x43')][_0x229d('0x47')]));_0x6f0be1[_0x229d('0x48')]=_0x6f0be1['attributes'][_0x229d('0x55')]?_0x6f0be1[_0x229d('0x48')]:_0x5808ad['model'];_0x6f0be1['order']=qs[_0x229d('0x4b')](_0x585dbe['query']['sort']);_0x6f0be1[_0x229d('0x4c')]=qs[_0x229d('0x45')](_[_0x229d('0x4d')](_0x585dbe[_0x229d('0x43')],_0x5808ad[_0x229d('0x45')]));if(_0x585dbe[_0x229d('0x43')]['filter']){_0x6f0be1[_0x229d('0x4c')]=_[_0x229d('0x4f')](_0x6f0be1[_0x229d('0x4c')],{'$or':_[_0x229d('0x3c')](_0x6f0be1['attributes'],function(_0x45f5bb){var _0x4de4e4={};_0x4de4e4[_0x45f5bb]={'$like':'%'+_0x585dbe['query']['filter']+'%'};return _0x4de4e4;})});}_0x6f0be1=_[_0x229d('0x4f')]({},_0x6f0be1,_0x585dbe[_0x229d('0x56')]);return _0x4d2d49['getTeams'](_0x6f0be1);}})[_0x229d('0x1f')](function(_0x2b8989){if(_0x2b8989){_0x2237b5=_0x2b8989['length'];if(!_0x585dbe[_0x229d('0x43')][_0x229d('0x49')](_0x229d('0x66'))){_0x6f0be1['limit']=qs[_0x229d('0x30')](_0x585dbe['query'][_0x229d('0x30')]);_0x6f0be1[_0x229d('0x2e')]=qs[_0x229d('0x2e')](_0x585dbe[_0x229d('0x43')]['offset']);}return _0x4d2d49[_0x229d('0x6e')](_0x6f0be1);}})[_0x229d('0x1f')](function(_0x342fda){if(_0x342fda){return _0x342fda?{'count':_0x2237b5,'rows':_0x342fda}:null;}})['then'](respondWithResult(_0x3fc6de,null))[_0x229d('0x29')](handleError(_0x3fc6de,null));};exports[_0x229d('0x70')]=function(_0x4bf481,_0x49cb70,_0x51a270){var _0x4314a0=_0x4bf481[_0x229d('0x61')]['ids'];return db[_0x229d('0x6f')][_0x229d('0x53')]({'where':{'id':_0x4314a0},'attributes':['id'],'include':[{'model':db[_0x229d('0x67')],'as':'Agents','attributes':['id',_0x229d('0x3a'),_0x229d('0x71'),_0x229d('0x72'),_0x229d('0x73')],'raw':!![]}]})[_0x229d('0x1f')](function(_0x4c319a){if(_0x4c319a){var _0x15114b=_['flatMap'](_0x4c319a,function(_0x539302){var _0x523d69=_0x539302['get']({'plain':!![]});return _0x523d69[_0x229d('0x74')];});return db[_0x229d('0x3d')][_0x229d('0x57')]({'where':{'id':_0x4bf481[_0x229d('0x62')]['id']}})[_0x229d('0x1f')](function(_0x10142d){return db[_0x229d('0x75')][_0x229d('0x76')](function(_0xf4e40f){return _0x10142d[_0x229d('0x70')](_0x4314a0,{'transaction':_0xf4e40f})[_0x229d('0x1f')](function(){return BPromise[_0x229d('0x77')](_0x15114b,function(_0xd52d9f){return db[_0x229d('0x65')][_0x229d('0x78')]({'where':{'UserId':_0xd52d9f['id'],'ChatQueueId':_0x4bf481['params']['id']},'transaction':_0xf4e40f});});})[_0x229d('0x1f')](function(){_0x15114b['forEach'](function(_0x525c39){socket[_0x229d('0x79')](_0x229d('0x7a'),{'UserId':_0x525c39['id'],'ChatQueueId':_0x10142d['id']});});});});});}})['then'](respondWithStatusCode(_0x49cb70,null))[_0x229d('0x29')](handleError(_0x49cb70,null));};exports['removeTeams']=function(_0x567de0,_0x38aadc,_0x58fb99){return db[_0x229d('0x6f')][_0x229d('0x53')]({'where':{'id':_0x567de0[_0x229d('0x43')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x229d('0x74'),'attributes':['id'],'raw':!![]}]})[_0x229d('0x1f')](handleEntityNotFound(_0x38aadc,null))['then'](function(_0x2723e6){var _0xaceea5=_[_0x229d('0x3c')](_0x2723e6,'id');var _0x537fe0=[];var _0x5a1e44=[];var _0x412016=squel[_0x229d('0x7b')]();_0x412016[_0x229d('0x7c')](_0x229d('0x7d'))[_0x229d('0x7e')](_0x229d('0x7f'),'tq')['join'](_0x229d('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x229d('0x4c')](_0x229d('0x81'),_0x567de0[_0x229d('0x62')]['id']);for(var _0x506ff6=0x0;_0x506ff6<_0x2723e6[_0x229d('0x55')];_0x506ff6+=0x1){let _0x43b284=_0x2723e6[_0x506ff6];for(var _0x3a05ca=0x0;_0x3a05ca<_0x43b284[_0x229d('0x74')][_0x229d('0x55')];_0x3a05ca+=0x1){let _0x23eec5=_0x43b284[_0x229d('0x74')][_0x3a05ca];var _0x4b7cfd=_0x412016['clone']();_0x4b7cfd[_0x229d('0x4c')](_0x229d('0x82'),_0x23eec5['id']);_0x5a1e44[_0x229d('0x83')](db['sequelize'][_0x229d('0x43')](_0x4b7cfd[_0x229d('0x84')](),{'type':db['sequelize']['QueryTypes'][_0x229d('0x85')]})[_0x229d('0x1f')](function(_0x2188d2){if(_0x2188d2[_0x229d('0x55')]===0x1){return _0x23eec5['id'];}else{var _0x3e6f05=_['every'](_[_0x229d('0x3c')](_0x2188d2,_0x229d('0x86')),function(_0x393a54){return _['includes'](_0xaceea5,_0x393a54);});if(_0x3e6f05){return _0x23eec5['id'];}}}));}}return BPromise[_0x229d('0x87')](_0x5a1e44)[_0x229d('0x1f')](function(_0x3593fd){_0x537fe0=_(_0x537fe0)['union'](_0x3593fd)[_0x229d('0x88')]()[_0x229d('0x89')]();return db[_0x229d('0x3d')][_0x229d('0x57')]({'where':{'id':_0x567de0[_0x229d('0x62')]['id']}})[_0x229d('0x1f')](function(_0x471dbf){return db[_0x229d('0x75')][_0x229d('0x76')](function(_0x5528cf){return _0x471dbf['removeTeams'](_0x567de0[_0x229d('0x43')][_0x229d('0x8a')],{'transaction':_0x5528cf})[_0x229d('0x1f')](function(){if(!_[_0x229d('0x8b')](_0x537fe0)){return _0x471dbf[_0x229d('0x8c')](_0x537fe0,{'transaction':_0x5528cf});}})['then'](function(){_0x537fe0['forEach'](function(_0x41acd8){socket['emit'](_0x229d('0x8d'),{'UserId':_0x41acd8,'ChatQueueId':_0x471dbf['id']});});});});});});})[_0x229d('0x1f')](respondWithStatusCode(_0x38aadc,null))[_0x229d('0x29')](handleError(_0x38aadc,null));};exports[_0x229d('0x8e')]=function(_0x17d653,_0x4f2b12,_0x12865b){return db[_0x229d('0x3d')][_0x229d('0x57')]({'where':{'id':_0x17d653[_0x229d('0x62')]['id']}})['then'](handleEntityNotFound(_0x4f2b12,null))[_0x229d('0x1f')](function(_0x5a5e88){if(_0x5a5e88){return _0x5a5e88['addAgents'](_0x17d653[_0x229d('0x61')][_0x229d('0x8a')],_[_0x229d('0x8f')](_0x17d653[_0x229d('0x61')],[_0x229d('0x8a'),'id'])||{})[_0x229d('0x90')](function(_0x45a5af){for(var _0x41ae66=0x0;_0x41ae66<_0x17d653[_0x229d('0x61')][_0x229d('0x8a')][_0x229d('0x55')];_0x41ae66+=0x1){socket[_0x229d('0x79')](_0x229d('0x7a'),{'UserId':Number(_0x17d653[_0x229d('0x61')][_0x229d('0x8a')][_0x41ae66]),'ChatQueueId':Number(_0x17d653[_0x229d('0x62')]['id'])});}return _0x45a5af;});}})['then'](respondWithResult(_0x4f2b12,null))[_0x229d('0x29')](handleError(_0x4f2b12,null));};exports[_0x229d('0x8c')]=function(_0xbb545e,_0xec8964,_0x52bc2a){return db['ChatQueue'][_0x229d('0x57')]({'where':{'id':_0xbb545e['params']['id']}})[_0x229d('0x1f')](handleEntityNotFound(_0xec8964,null))[_0x229d('0x1f')](function(_0x2818e0){if(_0x2818e0){return _0x2818e0['removeAgents'](_0xbb545e[_0x229d('0x43')]['ids'])[_0x229d('0x1f')](function(){if(_[_0x229d('0x91')](_0xbb545e['query'][_0x229d('0x8a')])){for(var _0x527f3c=0x0;_0x527f3c<_0xbb545e[_0x229d('0x43')][_0x229d('0x8a')][_0x229d('0x55')];_0x527f3c+=0x1){socket[_0x229d('0x79')](_0x229d('0x8d'),{'UserId':Number(_0xbb545e[_0x229d('0x43')]['ids'][_0x527f3c]),'ChatQueueId':Number(_0xbb545e['params']['id'])});}}else{socket['emit'](_0x229d('0x8d'),{'UserId':Number(_0xbb545e[_0x229d('0x43')][_0x229d('0x8a')]),'ChatQueueId':Number(_0xbb545e[_0x229d('0x62')]['id'])});}});}})[_0x229d('0x1f')](respondWithStatusCode(_0xec8964,null))[_0x229d('0x29')](handleError(_0xec8964,null));};exports[_0x229d('0x92')]=function(_0x1a3893,_0x293299,_0x227171){var _0x5a2d6e={};var _0x18968d={};var _0x7367de;var _0x353f12;return db[_0x229d('0x3d')]['findOne']({'where':{'id':_0x1a3893[_0x229d('0x62')]['id']}})[_0x229d('0x1f')](handleEntityNotFound(_0x293299,null))['then'](function(_0x50693d){if(_0x50693d){_0x7367de=_0x50693d;_0x18968d[_0x229d('0x42')]=_[_0x229d('0x44')](db[_0x229d('0x67')][_0x229d('0x3e')]);_0x18968d[_0x229d('0x43')]=_[_0x229d('0x44')](_0x1a3893[_0x229d('0x43')]);_0x18968d[_0x229d('0x45')]=_[_0x229d('0x46')](_0x18968d[_0x229d('0x42')],_0x18968d[_0x229d('0x43')]);_0x5a2d6e['attributes']=_['intersection'](_0x18968d[_0x229d('0x42')],qs[_0x229d('0x47')](_0x1a3893[_0x229d('0x43')][_0x229d('0x47')]));_0x5a2d6e[_0x229d('0x48')]=_0x5a2d6e[_0x229d('0x48')][_0x229d('0x55')]?_0x5a2d6e['attributes']:_0x18968d['model'];_0x5a2d6e['order']=qs[_0x229d('0x4b')](_0x1a3893[_0x229d('0x43')][_0x229d('0x4b')]);_0x5a2d6e[_0x229d('0x4c')]=qs[_0x229d('0x45')](_[_0x229d('0x4d')](_0x1a3893[_0x229d('0x43')],_0x18968d[_0x229d('0x45')]));if(_0x1a3893[_0x229d('0x43')]['filter']){_0x5a2d6e[_0x229d('0x4c')]=_[_0x229d('0x4f')](_0x5a2d6e[_0x229d('0x4c')],{'$or':_[_0x229d('0x3c')](_0x5a2d6e[_0x229d('0x48')],function(_0x274df8){var _0x1e5ba8={};_0x1e5ba8[_0x274df8]={'$like':'%'+_0x1a3893[_0x229d('0x43')][_0x229d('0x4e')]+'%'};return _0x1e5ba8;})});}_0x5a2d6e=_[_0x229d('0x4f')]({},_0x5a2d6e,_0x1a3893[_0x229d('0x56')]);return _0x7367de[_0x229d('0x92')](_0x5a2d6e);}})[_0x229d('0x1f')](function(_0x397fe0){if(_0x397fe0){_0x353f12=_0x397fe0[_0x229d('0x55')];if(!_0x1a3893['query'][_0x229d('0x49')](_0x229d('0x66'))){_0x5a2d6e[_0x229d('0x30')]=qs['limit'](_0x1a3893[_0x229d('0x43')][_0x229d('0x30')]);_0x5a2d6e[_0x229d('0x2e')]=qs[_0x229d('0x2e')](_0x1a3893[_0x229d('0x43')][_0x229d('0x2e')]);}return _0x7367de['getAgents'](_0x5a2d6e);}})[_0x229d('0x1f')](function(_0x2fa12f){if(_0x2fa12f){return _0x2fa12f?{'count':_0x353f12,'rows':_0x2fa12f}:null;}})[_0x229d('0x1f')](respondWithResult(_0x293299,null))[_0x229d('0x29')](handleError(_0x293299,null));}; \ No newline at end of file +var _0xf3d1=['SIP','Team','getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','emit','userChatQueue:save','removeTeams','findAll','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','apply','save','update','destroy','get','stack','name','send','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','ChatQueue','rows','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','map','User','UserId','updatedAt','createdAt','format','%s/%s'];(function(_0xf12861,_0x6013c8){var _0x50be22=function(_0x421775){while(--_0x421775){_0xf12861['push'](_0xf12861['shift']());}};_0x50be22(++_0x6013c8);}(_0xf3d1,0x155));var _0x1f3d=function(_0x307f9c,_0x13fcb6){_0x307f9c=_0x307f9c-0x0;var _0x3cd355=_0xf3d1[_0x307f9c];return _0x3cd355;};'use strict';var emlformat=require(_0x1f3d('0x0'));var rimraf=require(_0x1f3d('0x1'));var zipdir=require(_0x1f3d('0x2'));var jsonpatch=require(_0x1f3d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f3d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1f3d('0x5'));var sox=require(_0x1f3d('0x6'));var csv=require('to-csv');var ejs=require(_0x1f3d('0x7'));var fs=require('fs');var fs_extra=require(_0x1f3d('0x8'));var _=require(_0x1f3d('0x9'));var squel=require(_0x1f3d('0xa'));var crypto=require(_0x1f3d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1f3d('0xc'));var toCsv=require(_0x1f3d('0xd'));var querystring=require(_0x1f3d('0xe'));var Papa=require(_0x1f3d('0xf'));var Redis=require('ioredis');var authService=require(_0x1f3d('0x10'));var qs=require(_0x1f3d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f3d('0x12'));var logger=require(_0x1f3d('0x13'))(_0x1f3d('0x14'));var utils=require(_0x1f3d('0x15'));var config=require(_0x1f3d('0x16'));var licenseUtil=require(_0x1f3d('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x1f3d('0x18'),'port':0x18eb});var socket=require(_0x1f3d('0x19'))(new Redis(config[_0x1f3d('0x1a')]));require(_0x1f3d('0x1b'))[_0x1f3d('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1f3d('0x1d')][_0x1f3d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x45810d,_0x21eb5e,_0x293264,_0x29ce1d){return new BPromise(function(_0x32125f,_0x2015df){var _0x48d426=_0x29ce1d||client;return _0x48d426[_0x1f3d('0x1f')](_0x45810d,_0x293264)[_0x1f3d('0x20')](function(_0xfd8a47){logger[_0x1f3d('0x21')](_0x1f3d('0x22'),_0x21eb5e,_0x1f3d('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x21eb5e,_0x1f3d('0x23'),JSON['stringify'](_0xfd8a47));if(_0xfd8a47[_0x1f3d('0x24')]){if(_0xfd8a47['error'][_0x1f3d('0x25')]===0x1f4){logger[_0x1f3d('0x24')](_0x1f3d('0x22'),_0x21eb5e,_0xfd8a47[_0x1f3d('0x24')][_0x1f3d('0x26')]);return _0x2015df(_0xfd8a47[_0x1f3d('0x24')][_0x1f3d('0x26')]);}logger[_0x1f3d('0x24')]('ChatQueue,\x20%s,\x20%s',_0x21eb5e,_0xfd8a47[_0x1f3d('0x24')][_0x1f3d('0x26')]);return _0x32125f(_0xfd8a47[_0x1f3d('0x24')][_0x1f3d('0x26')]);}else{logger[_0x1f3d('0x21')](_0x1f3d('0x22'),_0x21eb5e,_0x1f3d('0x23'));_0x32125f(_0xfd8a47[_0x1f3d('0x27')][_0x1f3d('0x26')]);}})[_0x1f3d('0x28')](function(_0x5678ae){logger[_0x1f3d('0x24')](_0x1f3d('0x22'),_0x21eb5e,_0x5678ae);_0x2015df(_0x5678ae);});});}function respondWithStatusCode(_0x447d0a,_0x5b6a5e){_0x5b6a5e=_0x5b6a5e||0xcc;return function(_0x5ba6fb){if(_0x5ba6fb){return _0x447d0a[_0x1f3d('0x29')](_0x5b6a5e);}return _0x447d0a[_0x1f3d('0x2a')](_0x5b6a5e)[_0x1f3d('0x2b')]();};}function respondWithResult(_0x17ba8b,_0x24f95e){_0x24f95e=_0x24f95e||0xc8;return function(_0x48f16c){if(_0x48f16c){return _0x17ba8b[_0x1f3d('0x2a')](_0x24f95e)[_0x1f3d('0x2c')](_0x48f16c);}};}function respondWithFilteredResult(_0x39c1bb,_0x1b7e32){return function(_0x3fd7d9){if(_0x3fd7d9){var _0x4d39dd=typeof _0x1b7e32[_0x1f3d('0x2d')]===_0x1f3d('0x2e')&&typeof _0x1b7e32['limit']===_0x1f3d('0x2e');var _0x530f6f=_0x3fd7d9['count'];var _0x595619=_0x4d39dd?0x0:_0x1b7e32[_0x1f3d('0x2d')];var _0x52b450=_0x4d39dd?_0x3fd7d9['count']:_0x1b7e32[_0x1f3d('0x2d')]+_0x1b7e32[_0x1f3d('0x2f')];var _0x175cd7;if(_0x52b450>=_0x530f6f){_0x52b450=_0x530f6f;_0x175cd7=0xc8;}else{_0x175cd7=0xce;}_0x39c1bb[_0x1f3d('0x2a')](_0x175cd7);return _0x39c1bb['set']('Content-Range',_0x595619+'-'+_0x52b450+'/'+_0x530f6f)['json'](_0x3fd7d9);}return null;};}function patchUpdates(_0x2df199){return function(_0x32283){try{jsonpatch[_0x1f3d('0x30')](_0x32283,_0x2df199,!![]);}catch(_0x3360d4){return BPromise['reject'](_0x3360d4);}return _0x32283[_0x1f3d('0x31')]();};}function saveUpdates(_0x28d252,_0x3356f1){return function(_0x4651f3){if(_0x4651f3){return _0x4651f3[_0x1f3d('0x32')](_0x28d252)[_0x1f3d('0x20')](function(_0x323a30){return _0x323a30;});}return null;};}function removeEntity(_0x5e744e,_0x1cd2f9){return function(_0x199d03){if(_0x199d03){return _0x199d03[_0x1f3d('0x33')]()['then'](function(){var _0xf4a48d=_0x199d03[_0x1f3d('0x34')]({'plain':!![]});var _0x1e93ac='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x1e93ac,'resourceId':_0xf4a48d['id']}})[_0x1f3d('0x20')](function(){return _0x199d03;});})[_0x1f3d('0x20')](function(){_0x5e744e['status'](0xcc)[_0x1f3d('0x2b')]();});}};}function handleEntityNotFound(_0x161982,_0x4c9982){return function(_0x32ffe){if(!_0x32ffe){_0x161982[_0x1f3d('0x29')](0x194);}return _0x32ffe;};}function handleError(_0x332a35,_0x1690be){_0x1690be=_0x1690be||0x1f4;return function(_0x10e433){logger['error'](_0x10e433[_0x1f3d('0x35')]);if(_0x10e433[_0x1f3d('0x36')]){delete _0x10e433[_0x1f3d('0x36')];}_0x332a35[_0x1f3d('0x2a')](_0x1690be)[_0x1f3d('0x37')](_0x10e433);};}exports['index']=function(_0x39e9b0,_0x29b32a){var _0x45a667={},_0x7ce346={},_0x3096fe={'count':0x0,'rows':[]};var _0x236778=_['map'](db['ChatQueue'][_0x1f3d('0x38')],function(_0x28dbcb){return{'name':_0x28dbcb['fieldName'],'type':_0x28dbcb[_0x1f3d('0x39')][_0x1f3d('0x3a')]};});_0x7ce346[_0x1f3d('0x3b')]=_['map'](_0x236778,'name');_0x7ce346[_0x1f3d('0x3c')]=_[_0x1f3d('0x3d')](_0x39e9b0[_0x1f3d('0x3c')]);_0x7ce346[_0x1f3d('0x3e')]=_[_0x1f3d('0x3f')](_0x7ce346[_0x1f3d('0x3b')],_0x7ce346[_0x1f3d('0x3c')]);_0x45a667[_0x1f3d('0x40')]=_['intersection'](_0x7ce346[_0x1f3d('0x3b')],qs['fields'](_0x39e9b0[_0x1f3d('0x3c')][_0x1f3d('0x41')]));_0x45a667['attributes']=_0x45a667['attributes'][_0x1f3d('0x42')]?_0x45a667[_0x1f3d('0x40')]:_0x7ce346[_0x1f3d('0x3b')];if(!_0x39e9b0['query'][_0x1f3d('0x43')](_0x1f3d('0x44'))){_0x45a667[_0x1f3d('0x2f')]=qs[_0x1f3d('0x2f')](_0x39e9b0[_0x1f3d('0x3c')][_0x1f3d('0x2f')]);_0x45a667[_0x1f3d('0x2d')]=qs['offset'](_0x39e9b0[_0x1f3d('0x3c')][_0x1f3d('0x2d')]);}_0x45a667[_0x1f3d('0x45')]=qs[_0x1f3d('0x46')](_0x39e9b0[_0x1f3d('0x3c')][_0x1f3d('0x46')]);_0x45a667[_0x1f3d('0x47')]=qs[_0x1f3d('0x3e')](_[_0x1f3d('0x48')](_0x39e9b0[_0x1f3d('0x3c')],_0x7ce346[_0x1f3d('0x3e')]),_0x236778);if(_0x39e9b0['query'][_0x1f3d('0x49')]){_0x45a667['where']=_[_0x1f3d('0x4a')](_0x45a667[_0x1f3d('0x47')],{'$or':_['map'](_0x236778,function(_0x141d7c){if(_0x141d7c[_0x1f3d('0x39')]!=='VIRTUAL'){var _0x2412af={};_0x2412af[_0x141d7c['name']]={'$like':'%'+_0x39e9b0['query']['filter']+'%'};return _0x2412af;}})});}_0x45a667=_[_0x1f3d('0x4a')]({},_0x45a667,_0x39e9b0[_0x1f3d('0x4b')]);var _0xdd5e90={'where':_0x45a667[_0x1f3d('0x47')]};return db['ChatQueue'][_0x1f3d('0x4c')](_0xdd5e90)[_0x1f3d('0x20')](function(_0x54ecf6){_0x3096fe['count']=_0x54ecf6;if(_0x39e9b0['query'][_0x1f3d('0x4d')]){_0x45a667[_0x1f3d('0x4e')]=[{'all':!![]}];}return db[_0x1f3d('0x4f')]['findAll'](_0x45a667);})[_0x1f3d('0x20')](function(_0x49d7f0){_0x3096fe[_0x1f3d('0x50')]=_0x49d7f0;return _0x3096fe;})[_0x1f3d('0x20')](respondWithFilteredResult(_0x29b32a,_0x45a667))[_0x1f3d('0x28')](handleError(_0x29b32a,null));};exports[_0x1f3d('0x51')]=function(_0x3ee8b6,_0x2fd16c){var _0x4ae77c={'raw':!![],'where':{'id':_0x3ee8b6[_0x1f3d('0x52')]['id']}},_0x144107={};_0x144107[_0x1f3d('0x3b')]=_[_0x1f3d('0x3d')](db['ChatQueue'][_0x1f3d('0x38')]);_0x144107[_0x1f3d('0x3c')]=_[_0x1f3d('0x3d')](_0x3ee8b6[_0x1f3d('0x3c')]);_0x144107[_0x1f3d('0x3e')]=_[_0x1f3d('0x3f')](_0x144107[_0x1f3d('0x3b')],_0x144107['query']);_0x4ae77c[_0x1f3d('0x40')]=_[_0x1f3d('0x3f')](_0x144107[_0x1f3d('0x3b')],qs['fields'](_0x3ee8b6['query'][_0x1f3d('0x41')]));_0x4ae77c['attributes']=_0x4ae77c['attributes'][_0x1f3d('0x42')]?_0x4ae77c[_0x1f3d('0x40')]:_0x144107['model'];if(_0x3ee8b6[_0x1f3d('0x3c')][_0x1f3d('0x4d')]){_0x4ae77c['include']=[{'all':!![]}];}_0x4ae77c=_[_0x1f3d('0x4a')]({},_0x4ae77c,_0x3ee8b6[_0x1f3d('0x4b')]);return db['ChatQueue'][_0x1f3d('0x53')](_0x4ae77c)[_0x1f3d('0x20')](handleEntityNotFound(_0x2fd16c,null))['then'](respondWithResult(_0x2fd16c,null))['catch'](handleError(_0x2fd16c,null));};exports['create']=function(_0x168545,_0x37d0dc){return db[_0x1f3d('0x4f')]['create'](_0x168545[_0x1f3d('0x54')],{})[_0x1f3d('0x20')](function(_0xd1b2ce){var _0x5db7e4=_0x168545['user'][_0x1f3d('0x34')]({'plain':!![]});if(!_0x5db7e4)throw new Error(_0x1f3d('0x55'));if(_0x5db7e4['role']===_0x1f3d('0x56')){var _0x52e243=_0xd1b2ce[_0x1f3d('0x34')]({'plain':!![]});var _0x3b7859=_0x1f3d('0x57');return db[_0x1f3d('0x58')][_0x1f3d('0x53')]({'where':{'name':_0x3b7859,'userProfileId':_0x5db7e4[_0x1f3d('0x59')]},'raw':!![]})['then'](function(_0x145609){if(_0x145609&&_0x145609[_0x1f3d('0x5a')]===0x0){return db[_0x1f3d('0x5b')][_0x1f3d('0x5c')]({'name':_0x52e243[_0x1f3d('0x36')],'resourceId':_0x52e243['id'],'type':_0x145609['name'],'sectionId':_0x145609['id']},{})[_0x1f3d('0x20')](function(){return _0xd1b2ce;});}else{return _0xd1b2ce;}})['catch'](function(_0x542fa4){logger[_0x1f3d('0x24')](_0x1f3d('0x5d'),_0x542fa4);throw _0x542fa4;});}return _0xd1b2ce;})[_0x1f3d('0x20')](respondWithResult(_0x37d0dc,0xc9))['catch'](handleError(_0x37d0dc,null));};exports[_0x1f3d('0x32')]=function(_0x14be99,_0x4afe79){if(_0x14be99[_0x1f3d('0x54')]['id']){delete _0x14be99['body']['id'];}return db['ChatQueue'][_0x1f3d('0x53')]({'where':{'id':_0x14be99[_0x1f3d('0x52')]['id']}})[_0x1f3d('0x20')](handleEntityNotFound(_0x4afe79,null))[_0x1f3d('0x20')](saveUpdates(_0x14be99['body'],null))[_0x1f3d('0x20')](respondWithResult(_0x4afe79,null))['catch'](handleError(_0x4afe79,null));};exports[_0x1f3d('0x33')]=function(_0x3e51d0,_0x1384b8){return db[_0x1f3d('0x4f')][_0x1f3d('0x53')]({'where':{'id':_0x3e51d0[_0x1f3d('0x52')]['id']}})[_0x1f3d('0x20')](handleEntityNotFound(_0x1384b8,null))[_0x1f3d('0x20')](removeEntity(_0x1384b8,null))['catch'](handleError(_0x1384b8,null));};exports[_0x1f3d('0x5e')]=function(_0x35b429,_0x35e5c2){return db[_0x1f3d('0x4f')][_0x1f3d('0x5e')]()['then'](respondWithResult(_0x35e5c2,null))[_0x1f3d('0x28')](handleError(_0x35e5c2,null));};exports[_0x1f3d('0x5f')]=function(_0x3aa95f,_0x1efc9c,_0x5516fb){var _0xe1de9e={'raw':!![],'where':{}},_0x414a95={},_0x5341c4;return db[_0x1f3d('0x4f')][_0x1f3d('0x60')]({'where':{'id':_0x3aa95f[_0x1f3d('0x52')]['id']}})['then'](handleEntityNotFound(_0x1efc9c,null))[_0x1f3d('0x20')](function(_0xff589d){if(_0xff589d){_0x5341c4=_0xff589d[_0x1f3d('0x34')]({'plain':!![]});_0x414a95['model']=_[_0x1f3d('0x3d')](db[_0x1f3d('0x61')][_0x1f3d('0x38')]);_0x414a95[_0x1f3d('0x3c')]=_[_0x1f3d('0x3d')](_0x3aa95f['query']);_0x414a95[_0x1f3d('0x3e')]=_['intersection'](_0x414a95[_0x1f3d('0x3b')],_0x414a95[_0x1f3d('0x3c')]);_0xe1de9e['attributes']=_['intersection'](_0x414a95[_0x1f3d('0x3b')],qs['fields'](_0x3aa95f[_0x1f3d('0x3c')][_0x1f3d('0x41')]));_0xe1de9e['attributes']=_0xe1de9e[_0x1f3d('0x40')]['length']?_0xe1de9e['attributes']:_0x414a95[_0x1f3d('0x3b')];if(!_0x3aa95f[_0x1f3d('0x3c')]['hasOwnProperty'](_0x1f3d('0x44'))){_0xe1de9e[_0x1f3d('0x2f')]=qs['limit'](_0x3aa95f['query']['limit']);_0xe1de9e['offset']=qs[_0x1f3d('0x2d')](_0x3aa95f['query'][_0x1f3d('0x2d')]);}_0xe1de9e[_0x1f3d('0x45')]=qs['sort'](_0x3aa95f[_0x1f3d('0x3c')]['sort']);_0xe1de9e[_0x1f3d('0x47')]=qs[_0x1f3d('0x3e')](_[_0x1f3d('0x48')](_0x3aa95f['query'],_0x414a95[_0x1f3d('0x3e')]));_0xe1de9e[_0x1f3d('0x47')][_0x1f3d('0x62')]=_0xff589d['id'];if(_0x3aa95f[_0x1f3d('0x3c')]['filter']){_0xe1de9e[_0x1f3d('0x47')]=_['merge'](_0xe1de9e[_0x1f3d('0x47')],{'$or':_[_0x1f3d('0x63')](_0xe1de9e[_0x1f3d('0x40')],function(_0x34b1d2){var _0x3180c8={};_0x3180c8[_0x34b1d2]={'$like':'%'+_0x3aa95f[_0x1f3d('0x3c')][_0x1f3d('0x49')]+'%'};return _0x3180c8;})});}_0xe1de9e=_[_0x1f3d('0x4a')]({},_0xe1de9e,_0x3aa95f[_0x1f3d('0x4b')]);return db[_0x1f3d('0x61')]['findAll'](_0xe1de9e);}})['then'](function(_0x3056e7){if(_0x3056e7){return db[_0x1f3d('0x64')]['findAndCountAll']({'where':{'id':_['map'](_0x3056e7,_0x1f3d('0x65')),'role':'agent'},'attributes':['id',_0x1f3d('0x36'),'chatPause',_0x1f3d('0x66'),_0x1f3d('0x67')]});}})[_0x1f3d('0x20')](function(_0x4c7dd8){if(_0x4c7dd8){return{'count':_0x4c7dd8['count'],'rows':_[_0x1f3d('0x63')](_0x4c7dd8[_0x1f3d('0x50')],function(_0x383335){return{'membername':_0x383335['name'],'UserId':_0x383335['id'],'queue_name':_0x5341c4['name'],'ChatQueueId':_0x5341c4['id'],'interface':util[_0x1f3d('0x68')](_0x1f3d('0x69'),_0x1f3d('0x6a'),_0x383335['name']),'penalty':0x0,'paused':_0x383335['chatPause'],'createdAt':_0x383335[_0x1f3d('0x67')],'updatedAt':_0x383335[_0x1f3d('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1efc9c,_0xe1de9e))[_0x1f3d('0x28')](handleError(_0x1efc9c,null));};exports['getTeams']=function(_0x10e00b,_0x4a9abb,_0x5b7c24){var _0x51a877={};var _0x2f6fb8={};var _0x1013eb;var _0x2184e5;return db[_0x1f3d('0x4f')]['findOne']({'where':{'id':_0x10e00b['params']['id']}})[_0x1f3d('0x20')](handleEntityNotFound(_0x4a9abb,null))['then'](function(_0x23dea2){if(_0x23dea2){_0x1013eb=_0x23dea2;_0x2f6fb8[_0x1f3d('0x3b')]=_[_0x1f3d('0x3d')](db[_0x1f3d('0x6b')]['rawAttributes']);_0x2f6fb8['query']=_[_0x1f3d('0x3d')](_0x10e00b[_0x1f3d('0x3c')]);_0x2f6fb8[_0x1f3d('0x3e')]=_[_0x1f3d('0x3f')](_0x2f6fb8[_0x1f3d('0x3b')],_0x2f6fb8[_0x1f3d('0x3c')]);_0x51a877[_0x1f3d('0x40')]=_[_0x1f3d('0x3f')](_0x2f6fb8[_0x1f3d('0x3b')],qs[_0x1f3d('0x41')](_0x10e00b['query']['fields']));_0x51a877[_0x1f3d('0x40')]=_0x51a877[_0x1f3d('0x40')][_0x1f3d('0x42')]?_0x51a877[_0x1f3d('0x40')]:_0x2f6fb8[_0x1f3d('0x3b')];_0x51a877[_0x1f3d('0x45')]=qs[_0x1f3d('0x46')](_0x10e00b[_0x1f3d('0x3c')][_0x1f3d('0x46')]);_0x51a877['where']=qs[_0x1f3d('0x3e')](_['pick'](_0x10e00b[_0x1f3d('0x3c')],_0x2f6fb8[_0x1f3d('0x3e')]));if(_0x10e00b[_0x1f3d('0x3c')][_0x1f3d('0x49')]){_0x51a877[_0x1f3d('0x47')]=_[_0x1f3d('0x4a')](_0x51a877[_0x1f3d('0x47')],{'$or':_[_0x1f3d('0x63')](_0x51a877['attributes'],function(_0x76ef0a){var _0x4a99af={};_0x4a99af[_0x76ef0a]={'$like':'%'+_0x10e00b[_0x1f3d('0x3c')][_0x1f3d('0x49')]+'%'};return _0x4a99af;})});}_0x51a877=_[_0x1f3d('0x4a')]({},_0x51a877,_0x10e00b['options']);return _0x1013eb[_0x1f3d('0x6c')](_0x51a877);}})[_0x1f3d('0x20')](function(_0x1fcbe2){if(_0x1fcbe2){_0x2184e5=_0x1fcbe2[_0x1f3d('0x42')];if(!_0x10e00b[_0x1f3d('0x3c')]['hasOwnProperty'](_0x1f3d('0x44'))){_0x51a877[_0x1f3d('0x2f')]=qs['limit'](_0x10e00b[_0x1f3d('0x3c')][_0x1f3d('0x2f')]);_0x51a877['offset']=qs['offset'](_0x10e00b[_0x1f3d('0x3c')][_0x1f3d('0x2d')]);}return _0x1013eb[_0x1f3d('0x6c')](_0x51a877);}})[_0x1f3d('0x20')](function(_0x1e905b){if(_0x1e905b){return _0x1e905b?{'count':_0x2184e5,'rows':_0x1e905b}:null;}})['then'](respondWithResult(_0x4a9abb,null))[_0x1f3d('0x28')](handleError(_0x4a9abb,null));};exports[_0x1f3d('0x6d')]=function(_0x37e09c,_0x16c6fc,_0x1b345e){var _0x28a8ce=_0x37e09c[_0x1f3d('0x54')][_0x1f3d('0x6e')];return db[_0x1f3d('0x6b')]['findAll']({'where':{'id':_0x28a8ce},'attributes':['id'],'include':[{'model':db[_0x1f3d('0x64')],'as':_0x1f3d('0x6f'),'attributes':['id','name','online',_0x1f3d('0x70'),_0x1f3d('0x71')],'raw':!![]}]})['then'](function(_0x3fde60){if(_0x3fde60){var _0x58010b=_[_0x1f3d('0x72')](_0x3fde60,function(_0xefe3f3){var _0x5bc789=_0xefe3f3[_0x1f3d('0x34')]({'plain':!![]});return _0x5bc789[_0x1f3d('0x6f')];});return db['ChatQueue'][_0x1f3d('0x53')]({'where':{'id':_0x37e09c[_0x1f3d('0x52')]['id']}})[_0x1f3d('0x20')](function(_0x2d00c6){return db[_0x1f3d('0x73')]['transaction'](function(_0x5e8852){return _0x2d00c6['addTeams'](_0x28a8ce,{'transaction':_0x5e8852})[_0x1f3d('0x20')](function(){return BPromise['each'](_0x58010b,function(_0x7aef86){return db[_0x1f3d('0x61')][_0x1f3d('0x74')]({'where':{'UserId':_0x7aef86['id'],'ChatQueueId':_0x37e09c[_0x1f3d('0x52')]['id']},'transaction':_0x5e8852});});})['then'](function(){_0x58010b['forEach'](function(_0x27470d){socket[_0x1f3d('0x75')](_0x1f3d('0x76'),{'UserId':_0x27470d['id'],'ChatQueueId':_0x2d00c6['id']});});});});});}})[_0x1f3d('0x20')](respondWithStatusCode(_0x16c6fc,null))[_0x1f3d('0x28')](handleError(_0x16c6fc,null));};exports[_0x1f3d('0x77')]=function(_0xeed6b2,_0x3a5051,_0x4a9895){return db[_0x1f3d('0x6b')][_0x1f3d('0x78')]({'where':{'id':_0xeed6b2[_0x1f3d('0x3c')][_0x1f3d('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x1f3d('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1f3d('0x20')](handleEntityNotFound(_0x3a5051,null))[_0x1f3d('0x20')](function(_0x240d5e){var _0x102ee6=_[_0x1f3d('0x63')](_0x240d5e,'id');var _0x327dc3=[];var _0x4ebc15=[];var _0x365546=squel['select']();_0x365546['field'](_0x1f3d('0x79'))[_0x1f3d('0x7a')](_0x1f3d('0x7b'),'tq')[_0x1f3d('0x7c')](_0x1f3d('0x7d'),'ut',_0x1f3d('0x7e'))[_0x1f3d('0x47')](_0x1f3d('0x7f'),_0xeed6b2[_0x1f3d('0x52')]['id']);for(var _0x1d9952=0x0;_0x1d9952<_0x240d5e[_0x1f3d('0x42')];_0x1d9952+=0x1){let _0x1fb8cd=_0x240d5e[_0x1d9952];for(var _0x3ddcc3=0x0;_0x3ddcc3<_0x1fb8cd[_0x1f3d('0x6f')][_0x1f3d('0x42')];_0x3ddcc3+=0x1){let _0x82aeea=_0x1fb8cd[_0x1f3d('0x6f')][_0x3ddcc3];var _0x250a75=_0x365546[_0x1f3d('0x80')]();_0x250a75['where'](_0x1f3d('0x81'),_0x82aeea['id']);_0x4ebc15[_0x1f3d('0x82')](db[_0x1f3d('0x73')][_0x1f3d('0x3c')](_0x250a75[_0x1f3d('0x83')](),{'type':db[_0x1f3d('0x73')]['QueryTypes'][_0x1f3d('0x84')]})[_0x1f3d('0x20')](function(_0x57820e){if(_0x57820e[_0x1f3d('0x42')]===0x1){return _0x82aeea['id'];}else{var _0x2c83eb=_[_0x1f3d('0x85')](_['map'](_0x57820e,_0x1f3d('0x86')),function(_0x58ff75){return _[_0x1f3d('0x87')](_0x102ee6,_0x58ff75);});if(_0x2c83eb){return _0x82aeea['id'];}}}));}}return BPromise[_0x1f3d('0x88')](_0x4ebc15)['then'](function(_0x4e61f7){_0x327dc3=_(_0x327dc3)[_0x1f3d('0x89')](_0x4e61f7)['compact']()[_0x1f3d('0x8a')]();return db[_0x1f3d('0x4f')][_0x1f3d('0x53')]({'where':{'id':_0xeed6b2[_0x1f3d('0x52')]['id']}})[_0x1f3d('0x20')](function(_0x5d8c78){return db[_0x1f3d('0x73')][_0x1f3d('0x8b')](function(_0x55cbb6){return _0x5d8c78['removeTeams'](_0xeed6b2[_0x1f3d('0x3c')][_0x1f3d('0x6e')],{'transaction':_0x55cbb6})['then'](function(){if(!_[_0x1f3d('0x8c')](_0x327dc3)){return _0x5d8c78[_0x1f3d('0x8d')](_0x327dc3,{'transaction':_0x55cbb6});}})[_0x1f3d('0x20')](function(){_0x327dc3[_0x1f3d('0x8e')](function(_0x20fc38){socket['emit'](_0x1f3d('0x8f'),{'UserId':_0x20fc38,'ChatQueueId':_0x5d8c78['id']});});});});});});})[_0x1f3d('0x20')](respondWithStatusCode(_0x3a5051,null))[_0x1f3d('0x28')](handleError(_0x3a5051,null));};exports['addAgents']=function(_0x5d1fe8,_0x36f80f,_0x35560c){return db[_0x1f3d('0x4f')][_0x1f3d('0x53')]({'where':{'id':_0x5d1fe8['params']['id']}})[_0x1f3d('0x20')](handleEntityNotFound(_0x36f80f,null))[_0x1f3d('0x20')](function(_0x216a29){if(_0x216a29){return _0x216a29[_0x1f3d('0x90')](_0x5d1fe8['body'][_0x1f3d('0x6e')],_[_0x1f3d('0x91')](_0x5d1fe8[_0x1f3d('0x54')],[_0x1f3d('0x6e'),'id'])||{})[_0x1f3d('0x92')](function(_0x1bc649){for(var _0x147a33=0x0;_0x147a33<_0x5d1fe8['body']['ids'][_0x1f3d('0x42')];_0x147a33+=0x1){socket[_0x1f3d('0x75')]('userChatQueue:save',{'UserId':Number(_0x5d1fe8['body'][_0x1f3d('0x6e')][_0x147a33]),'ChatQueueId':Number(_0x5d1fe8[_0x1f3d('0x52')]['id'])});}return _0x1bc649;});}})['then'](respondWithResult(_0x36f80f,null))[_0x1f3d('0x28')](handleError(_0x36f80f,null));};exports[_0x1f3d('0x8d')]=function(_0x59b821,_0x2dbfb2,_0x172381){return db[_0x1f3d('0x4f')][_0x1f3d('0x53')]({'where':{'id':_0x59b821[_0x1f3d('0x52')]['id']}})[_0x1f3d('0x20')](handleEntityNotFound(_0x2dbfb2,null))[_0x1f3d('0x20')](function(_0x5937f3){if(_0x5937f3){return _0x5937f3[_0x1f3d('0x8d')](_0x59b821[_0x1f3d('0x3c')]['ids'])[_0x1f3d('0x20')](function(){if(_[_0x1f3d('0x93')](_0x59b821[_0x1f3d('0x3c')]['ids'])){for(var _0x556f95=0x0;_0x556f95<_0x59b821[_0x1f3d('0x3c')]['ids']['length'];_0x556f95+=0x1){socket[_0x1f3d('0x75')](_0x1f3d('0x8f'),{'UserId':Number(_0x59b821[_0x1f3d('0x3c')][_0x1f3d('0x6e')][_0x556f95]),'ChatQueueId':Number(_0x59b821[_0x1f3d('0x52')]['id'])});}}else{socket['emit'](_0x1f3d('0x8f'),{'UserId':Number(_0x59b821[_0x1f3d('0x3c')]['ids']),'ChatQueueId':Number(_0x59b821[_0x1f3d('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x2dbfb2,null))[_0x1f3d('0x28')](handleError(_0x2dbfb2,null));};exports[_0x1f3d('0x94')]=function(_0x4ab759,_0x3cb22f,_0x4adc5c){var _0x388ac5={};var _0x383620={};var _0x5ec0f6;var _0x3c9388;return db[_0x1f3d('0x4f')]['findOne']({'where':{'id':_0x4ab759[_0x1f3d('0x52')]['id']}})[_0x1f3d('0x20')](handleEntityNotFound(_0x3cb22f,null))['then'](function(_0x34cd2e){if(_0x34cd2e){_0x5ec0f6=_0x34cd2e;_0x383620['model']=_[_0x1f3d('0x3d')](db[_0x1f3d('0x64')][_0x1f3d('0x38')]);_0x383620[_0x1f3d('0x3c')]=_['keys'](_0x4ab759[_0x1f3d('0x3c')]);_0x383620[_0x1f3d('0x3e')]=_[_0x1f3d('0x3f')](_0x383620[_0x1f3d('0x3b')],_0x383620['query']);_0x388ac5['attributes']=_[_0x1f3d('0x3f')](_0x383620[_0x1f3d('0x3b')],qs[_0x1f3d('0x41')](_0x4ab759[_0x1f3d('0x3c')][_0x1f3d('0x41')]));_0x388ac5[_0x1f3d('0x40')]=_0x388ac5[_0x1f3d('0x40')][_0x1f3d('0x42')]?_0x388ac5[_0x1f3d('0x40')]:_0x383620[_0x1f3d('0x3b')];_0x388ac5['order']=qs['sort'](_0x4ab759['query'][_0x1f3d('0x46')]);_0x388ac5[_0x1f3d('0x47')]=qs[_0x1f3d('0x3e')](_[_0x1f3d('0x48')](_0x4ab759[_0x1f3d('0x3c')],_0x383620[_0x1f3d('0x3e')]));if(_0x4ab759[_0x1f3d('0x3c')]['filter']){_0x388ac5[_0x1f3d('0x47')]=_[_0x1f3d('0x4a')](_0x388ac5[_0x1f3d('0x47')],{'$or':_[_0x1f3d('0x63')](_0x388ac5[_0x1f3d('0x40')],function(_0x4a7308){var _0x349db8={};_0x349db8[_0x4a7308]={'$like':'%'+_0x4ab759['query'][_0x1f3d('0x49')]+'%'};return _0x349db8;})});}_0x388ac5=_[_0x1f3d('0x4a')]({},_0x388ac5,_0x4ab759[_0x1f3d('0x4b')]);return _0x5ec0f6[_0x1f3d('0x94')](_0x388ac5);}})['then'](function(_0x1a2574){if(_0x1a2574){_0x3c9388=_0x1a2574[_0x1f3d('0x42')];if(!_0x4ab759[_0x1f3d('0x3c')]['hasOwnProperty'](_0x1f3d('0x44'))){_0x388ac5['limit']=qs[_0x1f3d('0x2f')](_0x4ab759[_0x1f3d('0x3c')][_0x1f3d('0x2f')]);_0x388ac5['offset']=qs[_0x1f3d('0x2d')](_0x4ab759['query'][_0x1f3d('0x2d')]);}return _0x5ec0f6[_0x1f3d('0x94')](_0x388ac5);}})[_0x1f3d('0x20')](function(_0x230ec5){if(_0x230ec5){return _0x230ec5?{'count':_0x3c9388,'rows':_0x230ec5}:null;}})['then'](respondWithResult(_0x3cb22f,null))[_0x1f3d('0x28')](handleError(_0x3cb22f,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 1de9ead..782fe6a 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 _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners'];(function(_0x3a26ed,_0x23bedd){var _0x21ac4f=function(_0x3b7341){while(--_0x3b7341){_0x3a26ed['push'](_0x3a26ed['shift']());}};_0x21ac4f(++_0x23bedd);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x49c4('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){ChatQueueEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);ChatQueueEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];ChatQueue[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x3151=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x318054,_0x516efd){var _0x19a6ae=function(_0x4a35f2){while(--_0x4a35f2){_0x318054['push'](_0x318054['shift']());}};_0x19a6ae(++_0x516efd);}(_0x3151,0x75));var _0x1315=function(_0x1b56f6,_0x367e78){_0x1b56f6=_0x1b56f6-0x0;var _0x1397f=_0x3151[_0x1b56f6];return _0x1397f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x1315('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1315('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1315('0x2'),'afterDestroy':_0x1315('0x3')};function emitEvent(_0x496172){return function(_0x4d8b47,_0x8f47d,_0x40376f){ChatQueueEvents[_0x1315('0x4')](_0x496172+':'+_0x4d8b47['id'],_0x4d8b47);ChatQueueEvents[_0x1315('0x4')](_0x496172,_0x4d8b47);_0x40376f(null);};}for(var e in events){if(events[_0x1315('0x5')](e)){var event=events[e];ChatQueue[_0x1315('0x6')](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 6ecb0e3..85db0f1 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 _0x0a16=['request-promise','path','rimraf','../../config/environment','exports','define','lodash','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a16,0x16e));var _0x60a1=function(_0x149478,_0x380771){_0x149478=_0x149478-0x0;var _0x2bcd4d=_0x0a16[_0x149478];return _0x2bcd4d;};'use strict';var _=require(_0x60a1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x60a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x60a1('0x2'));var fs=require('fs');var path=require(_0x60a1('0x3'));var rimraf=require(_0x60a1('0x4'));var config=require(_0x60a1('0x5'));var attributes=require('./chatQueue.attributes');module[_0x60a1('0x6')]=function(_0x3eb637,_0x3c2155){return _0x3eb637[_0x60a1('0x7')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a8b=['chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','ChatQueue'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x8a8b,0x177));var _0xb8a8=function(_0x3078f9,_0x5b9e57){_0x3078f9=_0x3078f9-0x0;var _0x202813=_0x8a8b[_0x3078f9];return _0x202813;};'use strict';var _=require(_0xb8a8('0x0'));var util=require(_0xb8a8('0x1'));var logger=require(_0xb8a8('0x2'))(_0xb8a8('0x3'));var moment=require(_0xb8a8('0x4'));var BPromise=require(_0xb8a8('0x5'));var rp=require(_0xb8a8('0x6'));var fs=require('fs');var path=require(_0xb8a8('0x7'));var rimraf=require(_0xb8a8('0x8'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module['exports']=function(_0x11e672,_0x5dccff){return _0x11e672['define'](_0xb8a8('0x9'),attributes,{'tableName':_0xb8a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 03cf539..c53723e 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 _0x23f2=['ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','raw','limit','include','model','attributes','map','debug','catch','find','where','ShowChatQueue','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x23f2,0x1a2));var _0x223f=function(_0xe66169,_0x298776){_0xe66169=_0xe66169-0x0;var _0x20b70e=_0x23f2[_0xe66169];return _0x20b70e;};'use strict';var _=require(_0x223f('0x0'));var util=require(_0x223f('0x1'));var moment=require(_0x223f('0x2'));var BPromise=require('bluebird');var rs=require(_0x223f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x223f('0x4'));var logger=require('../../config/logger')(_0x223f('0x5'));var config=require(_0x223f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x223f('0x7')][_0x223f('0x8')]({'port':0x232a});config[_0x223f('0x9')]=_[_0x223f('0xa')](config[_0x223f('0x9')],{'host':_0x223f('0xb'),'port':0x18eb});var socket=require(_0x223f('0xc'))(new Redis(config['redis']));require(_0x223f('0xd'))[_0x223f('0xe')](socket);function respondWithRpcPromise(_0x5ae7e2,_0x139eae,_0x312109){return new BPromise(function(_0x1f0296,_0x323507){return client[_0x223f('0xf')](_0x5ae7e2,_0x312109)[_0x223f('0x10')](function(_0x17ce52){logger[_0x223f('0x11')]('ChatQueue,\x20%s,\x20%s',_0x139eae,_0x223f('0x12'));logger['debug'](_0x223f('0x13'),_0x139eae,_0x223f('0x12'),JSON[_0x223f('0x14')](_0x17ce52));if(_0x17ce52['error']){if(_0x17ce52[_0x223f('0x15')]['code']===0x1f4){logger[_0x223f('0x15')](_0x223f('0x16'),_0x139eae,_0x17ce52[_0x223f('0x15')][_0x223f('0x17')]);return _0x323507(_0x17ce52[_0x223f('0x15')][_0x223f('0x17')]);}logger[_0x223f('0x15')](_0x223f('0x16'),_0x139eae,_0x17ce52[_0x223f('0x15')][_0x223f('0x17')]);return _0x1f0296(_0x17ce52[_0x223f('0x15')][_0x223f('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x139eae,'request\x20sent');_0x1f0296(_0x17ce52[_0x223f('0x18')][_0x223f('0x17')]);}})['catch'](function(_0xf84fab){logger[_0x223f('0x15')]('ChatQueue,\x20%s,\x20%s',_0x139eae,_0xf84fab);_0x323507(_0xf84fab);});});}exports[_0x223f('0x19')]=function(_0x5198fb){var _0x51ec08=this;return new Promise(function(_0x1afac0,_0xb03ed0){return db[_0x223f('0x1a')][_0x223f('0x1b')]({'raw':_0x5198fb[_0x223f('0x1c')]?_0x5198fb[_0x223f('0x1c')][_0x223f('0x1d')]===undefined?!![]:![]:!![],'where':_0x5198fb[_0x223f('0x1c')]?_0x5198fb['options']['where']||null:null,'attributes':_0x5198fb[_0x223f('0x1c')]?_0x5198fb[_0x223f('0x1c')]['attributes']||null:null,'limit':_0x5198fb[_0x223f('0x1c')]?_0x5198fb[_0x223f('0x1c')][_0x223f('0x1e')]||null:null,'include':_0x5198fb[_0x223f('0x1c')]?_0x5198fb['options'][_0x223f('0x1f')]?_['map'](_0x5198fb[_0x223f('0x1c')]['include'],function(_0x5f5d10){return{'model':db[_0x5f5d10[_0x223f('0x20')]],'as':_0x5f5d10['as'],'attributes':_0x5f5d10[_0x223f('0x21')],'include':_0x5f5d10['include']?_[_0x223f('0x22')](_0x5f5d10[_0x223f('0x1f')],function(_0x250d61){return{'model':db[_0x250d61[_0x223f('0x20')]],'as':_0x250d61['as'],'attributes':_0x250d61[_0x223f('0x21')],'include':_0x250d61[_0x223f('0x1f')]?_[_0x223f('0x22')](_0x250d61[_0x223f('0x1f')],function(_0x335a89){return{'model':db[_0x335a89[_0x223f('0x20')]],'as':_0x335a89['as'],'attributes':_0x335a89[_0x223f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31fdfd){logger['info'](_0x223f('0x19'),_0x5198fb);logger[_0x223f('0x23')](_0x223f('0x19'),_0x5198fb,JSON[_0x223f('0x14')](_0x31fdfd));_0x1afac0(_0x31fdfd);})[_0x223f('0x24')](function(_0x12e7d7){logger[_0x223f('0x15')](_0x223f('0x19'),_0x12e7d7[_0x223f('0x17')],_0x5198fb);_0xb03ed0(_0x51ec08['error'](0x1f4,_0x12e7d7[_0x223f('0x17')]));});});};exports['ShowChatQueue']=function(_0x3aace3){var _0x336f38=this;return new Promise(function(_0x4de292,_0x40cd21){return db[_0x223f('0x1a')][_0x223f('0x25')]({'raw':_0x3aace3[_0x223f('0x1c')]?_0x3aace3[_0x223f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3aace3[_0x223f('0x1c')]?_0x3aace3[_0x223f('0x1c')][_0x223f('0x26')]||null:null,'attributes':_0x3aace3[_0x223f('0x1c')]?_0x3aace3[_0x223f('0x1c')][_0x223f('0x21')]||null:null,'include':_0x3aace3[_0x223f('0x1c')]?_0x3aace3['options']['include']?_['map'](_0x3aace3[_0x223f('0x1c')]['include'],function(_0x3158b5){return{'model':db[_0x3158b5[_0x223f('0x20')]],'as':_0x3158b5['as'],'attributes':_0x3158b5['attributes'],'include':_0x3158b5[_0x223f('0x1f')]?_[_0x223f('0x22')](_0x3158b5['include'],function(_0x3f5f30){return{'model':db[_0x3f5f30[_0x223f('0x20')]],'as':_0x3f5f30['as'],'attributes':_0x3f5f30[_0x223f('0x21')],'include':_0x3f5f30[_0x223f('0x1f')]?_[_0x223f('0x22')](_0x3f5f30['include'],function(_0x2dedcb){return{'model':db[_0x2dedcb[_0x223f('0x20')]],'as':_0x2dedcb['as'],'attributes':_0x2dedcb['attributes']};}):[]};}):[]};}):[]:[]})[_0x223f('0x10')](function(_0x365ceb){logger[_0x223f('0x11')](_0x223f('0x27'),_0x3aace3);logger[_0x223f('0x23')](_0x223f('0x27'),_0x3aace3,JSON['stringify'](_0x365ceb));_0x4de292(_0x365ceb);})[_0x223f('0x24')](function(_0x542617){logger[_0x223f('0x15')](_0x223f('0x27'),_0x542617[_0x223f('0x17')],_0x3aace3);_0x40cd21(_0x336f38[_0x223f('0x15')](0x1f4,_0x542617[_0x223f('0x17')]));});});}; \ No newline at end of file +var _0xb67f=['http','redis','socket.io-emitter','./chatQueue.socket','then','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','info','ShowChatQueue','find','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4b0503,_0x2e7fb8){var _0x1d621f=function(_0x1e3d69){while(--_0x1e3d69){_0x4b0503['push'](_0x4b0503['shift']());}};_0x1d621f(++_0x2e7fb8);}(_0xb67f,0x12d));var _0xfb67=function(_0x1756c4,_0x35f0d5){_0x1756c4=_0x1756c4-0x0;var _0x523a3b=_0xb67f[_0x1756c4];return _0x523a3b;};'use strict';var _=require('lodash');var util=require(_0xfb67('0x0'));var moment=require(_0xfb67('0x1'));var BPromise=require(_0xfb67('0x2'));var rs=require(_0xfb67('0x3'));var fs=require('fs');var Redis=require(_0xfb67('0x4'));var db=require(_0xfb67('0x5'))['db'];var utils=require(_0xfb67('0x6'));var logger=require(_0xfb67('0x7'))('rpc');var config=require(_0xfb67('0x8'));var jayson=require(_0xfb67('0x9'));var client=jayson[_0xfb67('0xa')][_0xfb67('0xb')]({'port':0x232a});config[_0xfb67('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb67('0xd'))(new Redis(config[_0xfb67('0xc')]));require(_0xfb67('0xe'))['register'](socket);function respondWithRpcPromise(_0x112ce0,_0x3dc49f,_0x2551ca){return new BPromise(function(_0x58a7e4,_0x46c062){return client['request'](_0x112ce0,_0x2551ca)[_0xfb67('0xf')](function(_0x45ae65){logger['info']('ChatQueue,\x20%s,\x20%s',_0x3dc49f,_0xfb67('0x10'));logger['debug'](_0xfb67('0x11'),_0x3dc49f,_0xfb67('0x10'),JSON[_0xfb67('0x12')](_0x45ae65));if(_0x45ae65[_0xfb67('0x13')]){if(_0x45ae65[_0xfb67('0x13')][_0xfb67('0x14')]===0x1f4){logger[_0xfb67('0x13')](_0xfb67('0x15'),_0x3dc49f,_0x45ae65[_0xfb67('0x13')][_0xfb67('0x16')]);return _0x46c062(_0x45ae65[_0xfb67('0x13')]['message']);}logger[_0xfb67('0x13')]('ChatQueue,\x20%s,\x20%s',_0x3dc49f,_0x45ae65[_0xfb67('0x13')]['message']);return _0x58a7e4(_0x45ae65[_0xfb67('0x13')][_0xfb67('0x16')]);}else{logger['info'](_0xfb67('0x15'),_0x3dc49f,_0xfb67('0x10'));_0x58a7e4(_0x45ae65[_0xfb67('0x17')][_0xfb67('0x16')]);}})[_0xfb67('0x18')](function(_0x5049a3){logger[_0xfb67('0x13')](_0xfb67('0x15'),_0x3dc49f,_0x5049a3);_0x46c062(_0x5049a3);});});}exports[_0xfb67('0x19')]=function(_0x41ec6f){var _0x18c9bf=this;return new Promise(function(_0x3a01e2,_0x111e09){return db[_0xfb67('0x1a')]['findAll']({'raw':_0x41ec6f[_0xfb67('0x1b')]?_0x41ec6f[_0xfb67('0x1b')][_0xfb67('0x1c')]===undefined?!![]:![]:!![],'where':_0x41ec6f[_0xfb67('0x1b')]?_0x41ec6f[_0xfb67('0x1b')][_0xfb67('0x1d')]||null:null,'attributes':_0x41ec6f[_0xfb67('0x1b')]?_0x41ec6f[_0xfb67('0x1b')][_0xfb67('0x1e')]||null:null,'limit':_0x41ec6f[_0xfb67('0x1b')]?_0x41ec6f[_0xfb67('0x1b')][_0xfb67('0x1f')]||null:null,'include':_0x41ec6f[_0xfb67('0x1b')]?_0x41ec6f[_0xfb67('0x1b')][_0xfb67('0x20')]?_[_0xfb67('0x21')](_0x41ec6f[_0xfb67('0x1b')]['include'],function(_0x1f483a){return{'model':db[_0x1f483a[_0xfb67('0x22')]],'as':_0x1f483a['as'],'attributes':_0x1f483a[_0xfb67('0x1e')],'include':_0x1f483a[_0xfb67('0x20')]?_['map'](_0x1f483a[_0xfb67('0x20')],function(_0x14c898){return{'model':db[_0x14c898[_0xfb67('0x22')]],'as':_0x14c898['as'],'attributes':_0x14c898['attributes'],'include':_0x14c898[_0xfb67('0x20')]?_['map'](_0x14c898[_0xfb67('0x20')],function(_0x532b6d){return{'model':db[_0x532b6d[_0xfb67('0x22')]],'as':_0x532b6d['as'],'attributes':_0x532b6d[_0xfb67('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47fa2e){logger[_0xfb67('0x23')](_0xfb67('0x19'),_0x41ec6f);logger['debug']('GetChatQueue',_0x41ec6f,JSON[_0xfb67('0x12')](_0x47fa2e));_0x3a01e2(_0x47fa2e);})[_0xfb67('0x18')](function(_0x8e3aab){logger[_0xfb67('0x13')](_0xfb67('0x19'),_0x8e3aab['message'],_0x41ec6f);_0x111e09(_0x18c9bf[_0xfb67('0x13')](0x1f4,_0x8e3aab[_0xfb67('0x16')]));});});};exports[_0xfb67('0x24')]=function(_0x476acb){var _0x24771f=this;return new Promise(function(_0x38ede1,_0x265c38){return db['ChatQueue'][_0xfb67('0x25')]({'raw':_0x476acb['options']?_0x476acb[_0xfb67('0x1b')][_0xfb67('0x1c')]===undefined?!![]:![]:!![],'where':_0x476acb[_0xfb67('0x1b')]?_0x476acb['options']['where']||null:null,'attributes':_0x476acb['options']?_0x476acb[_0xfb67('0x1b')][_0xfb67('0x1e')]||null:null,'include':_0x476acb['options']?_0x476acb[_0xfb67('0x1b')][_0xfb67('0x20')]?_['map'](_0x476acb[_0xfb67('0x1b')]['include'],function(_0x4b409e){return{'model':db[_0x4b409e[_0xfb67('0x22')]],'as':_0x4b409e['as'],'attributes':_0x4b409e[_0xfb67('0x1e')],'include':_0x4b409e[_0xfb67('0x20')]?_[_0xfb67('0x21')](_0x4b409e[_0xfb67('0x20')],function(_0x2cfd01){return{'model':db[_0x2cfd01[_0xfb67('0x22')]],'as':_0x2cfd01['as'],'attributes':_0x2cfd01[_0xfb67('0x1e')],'include':_0x2cfd01[_0xfb67('0x20')]?_['map'](_0x2cfd01['include'],function(_0x3cdc0c){return{'model':db[_0x3cdc0c[_0xfb67('0x22')]],'as':_0x3cdc0c['as'],'attributes':_0x3cdc0c[_0xfb67('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfb67('0xf')](function(_0x3622e9){logger[_0xfb67('0x23')]('ShowChatQueue',_0x476acb);logger[_0xfb67('0x26')](_0xfb67('0x24'),_0x476acb,JSON[_0xfb67('0x12')](_0x3622e9));_0x38ede1(_0x3622e9);})[_0xfb67('0x18')](function(_0xe75e84){logger['error']('ShowChatQueue',_0xe75e84[_0xfb67('0x16')],_0x476acb);_0x265c38(_0x24771f['error'](0x1f4,_0xe75e84[_0xfb67('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 4f94958..a8ac7b3 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 _0xbec5=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xbec5,0xe5));var _0x5bec=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0xbec5[_0xb3b452];return _0x238983;};'use strict';var ChatQueueEvents=require(_0x5bec('0x0'));var events=[_0x5bec('0x1'),'remove',_0x5bec('0x2')];function createListener(_0x38c81a,_0x276b9e){return function(_0x3859a1){_0x276b9e[_0x5bec('0x3')](_0x38c81a,_0x3859a1);};}function removeListener(_0x4ee982,_0x1f8933){return function(){ChatQueueEvents[_0x5bec('0x4')](_0x4ee982,_0x1f8933);};}exports[_0x5bec('0x5')]=function(_0x4aaac6){for(var _0x3ed67a=0x0,_0x28a427=events[_0x5bec('0x6')];_0x3ed67a<_0x28a427;_0x3ed67a++){var _0x406e65=events[_0x3ed67a];var _0x43d96e=createListener(_0x5bec('0x7')+_0x406e65,_0x4aaac6);ChatQueueEvents['on'](_0x406e65,_0x43d96e);}}; \ No newline at end of file +var _0x17ba=['register','length','chatQueue:','./chatQueue.events','save','update','emit','removeListener'];(function(_0x1f8404,_0x568b74){var _0xcf0be1=function(_0x14b3c4){while(--_0x14b3c4){_0x1f8404['push'](_0x1f8404['shift']());}};_0xcf0be1(++_0x568b74);}(_0x17ba,0xab));var _0xa17b=function(_0x4c2619,_0x243a37){_0x4c2619=_0x4c2619-0x0;var _0x5d0375=_0x17ba[_0x4c2619];return _0x5d0375;};'use strict';var ChatQueueEvents=require(_0xa17b('0x0'));var events=[_0xa17b('0x1'),'remove',_0xa17b('0x2')];function createListener(_0x4563da,_0x2806ac){return function(_0x3c60e5){_0x2806ac[_0xa17b('0x3')](_0x4563da,_0x3c60e5);};}function removeListener(_0x38c13c,_0x11d7b7){return function(){ChatQueueEvents[_0xa17b('0x4')](_0x38c13c,_0x11d7b7);};}exports[_0xa17b('0x5')]=function(_0x3cced2){for(var _0xf72ed4=0x0,_0x2e3d43=events[_0xa17b('0x6')];_0xf72ed4<_0x2e3d43;_0xf72ed4++){var _0x57f9cd=events[_0xf72ed4];var _0x2ca4d3=createListener(_0xa17b('0x7')+_0x57f9cd,_0x3cced2);ChatQueueEvents['on'](_0x57f9cd,_0x2ca4d3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 755a95f..005b716 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4d256a,_0x2328cb){var _0xc4df35=function(_0x156223){while(--_0x156223){_0x4d256a['push'](_0x4d256a['shift']());}};_0xc4df35(++_0x2328cb);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x19d3d7,_0x207af5){var _0x2cd869=function(_0x55a399){while(--_0x55a399){_0x19d3d7['push'](_0x19d3d7['shift']());}};_0x2cd869(++_0x207af5);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 3d93e30..5a586d6 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 _0x3e22=['sequelize','STRING','DATE','moment'];(function(_0x14f2ce,_0x22f9c0){var _0x58db9f=function(_0x2f65f3){while(--_0x2f65f3){_0x14f2ce['push'](_0x14f2ce['shift']());}};_0x58db9f(++_0x22f9c0);}(_0x3e22,0x11b));var _0x23e2=function(_0x3f0b90,_0x4182eb){_0x3f0b90=_0x3f0b90-0x0;var _0x85d358=_0x3e22[_0x3f0b90];return _0x85d358;};'use strict';var moment=require(_0x23e2('0x0'));var Sequelize=require(_0x23e2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x23e2('0x2')]},'joinAt':{'type':Sequelize[_0x23e2('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x23e2('0x3')]},'exitAt':{'type':Sequelize[_0x23e2('0x3')]},'reason':{'type':Sequelize[_0x23e2('0x2')]}}; \ No newline at end of file +var _0xdf07=['STRING','DATE','moment','sequelize','exports'];(function(_0x2767b9,_0x5daa78){var _0x4eab0f=function(_0x271be7){while(--_0x271be7){_0x2767b9['push'](_0x2767b9['shift']());}};_0x4eab0f(++_0x5daa78);}(_0xdf07,0x174));var _0x7df0=function(_0x10ec84,_0x42bd9b){_0x10ec84=_0x10ec84-0x0;var _0x1d7e51=_0xdf07[_0x10ec84];return _0x1d7e51;};'use strict';var moment=require(_0x7df0('0x0'));var Sequelize=require(_0x7df0('0x1'));module[_0x7df0('0x2')]={'uniqueid':{'type':Sequelize[_0x7df0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7df0('0x3')]},'joinAt':{'type':Sequelize[_0x7df0('0x4')]},'leaveAt':{'type':Sequelize[_0x7df0('0x4')]},'acceptAt':{'type':Sequelize[_0x7df0('0x4')]},'exitAt':{'type':Sequelize[_0x7df0('0x4')]},'reason':{'type':Sequelize[_0x7df0('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 4d04672..dca499e 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 _0xdc59=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','ChatQueueReport','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','moment'];(function(_0x825493,_0x294554){var _0x71d950=function(_0x34d654){while(--_0x34d654){_0x825493['push'](_0x825493['shift']());}};_0x71d950(++_0x294554);}(_0xdc59,0x12c));var _0x9dc5=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xdc59[_0x2ed8f3];return _0x525a55;};'use strict';var emlformat=require(_0x9dc5('0x0'));var rimraf=require(_0x9dc5('0x1'));var zipdir=require(_0x9dc5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9dc5('0x3'));var BPromise=require(_0x9dc5('0x4'));var Mustache=require(_0x9dc5('0x5'));var util=require(_0x9dc5('0x6'));var path=require(_0x9dc5('0x7'));var sox=require(_0x9dc5('0x8'));var csv=require(_0x9dc5('0x9'));var ejs=require(_0x9dc5('0xa'));var fs=require('fs');var fs_extra=require(_0x9dc5('0xb'));var _=require('lodash');var squel=require(_0x9dc5('0xc'));var crypto=require(_0x9dc5('0xd'));var jsforce=require(_0x9dc5('0xe'));var deskjs=require(_0x9dc5('0xf'));var toCsv=require(_0x9dc5('0x9'));var querystring=require(_0x9dc5('0x10'));var Papa=require(_0x9dc5('0x11'));var Redis=require(_0x9dc5('0x12'));var authService=require(_0x9dc5('0x13'));var qs=require(_0x9dc5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dc5('0x15'));var logger=require(_0x9dc5('0x16'))(_0x9dc5('0x17'));var utils=require(_0x9dc5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9dc5('0x19'));var db=require(_0x9dc5('0x1a'))['db'];function respondWithStatusCode(_0x36d236,_0x5612dc){_0x5612dc=_0x5612dc||0xcc;return function(_0x11427e){if(_0x11427e){return _0x36d236[_0x9dc5('0x1b')](_0x5612dc);}return _0x36d236[_0x9dc5('0x1c')](_0x5612dc)[_0x9dc5('0x1d')]();};}function respondWithResult(_0x312fe2,_0x239a0d){_0x239a0d=_0x239a0d||0xc8;return function(_0x786239){if(_0x786239){return _0x312fe2[_0x9dc5('0x1c')](_0x239a0d)[_0x9dc5('0x1e')](_0x786239);}};}function respondWithFilteredResult(_0x45912d,_0x4ac27c){return function(_0x26302e){if(_0x26302e){var _0x5ebe8b=typeof _0x4ac27c[_0x9dc5('0x1f')]===_0x9dc5('0x20')&&typeof _0x4ac27c['limit']===_0x9dc5('0x20');var _0x2f195a=_0x26302e[_0x9dc5('0x21')];var _0x16fca8=_0x5ebe8b?0x0:_0x4ac27c['offset'];var _0x4493c7=_0x5ebe8b?_0x26302e[_0x9dc5('0x21')]:_0x4ac27c[_0x9dc5('0x1f')]+_0x4ac27c[_0x9dc5('0x22')];var _0x4100e7;if(_0x4493c7>=_0x2f195a){_0x4493c7=_0x2f195a;_0x4100e7=0xc8;}else{_0x4100e7=0xce;}_0x45912d['status'](_0x4100e7);return _0x45912d[_0x9dc5('0x23')](_0x9dc5('0x24'),_0x16fca8+'-'+_0x4493c7+'/'+_0x2f195a)[_0x9dc5('0x1e')](_0x26302e);}return null;};}function patchUpdates(_0x4e6388){return function(_0x4ada0c){try{jsonpatch[_0x9dc5('0x25')](_0x4ada0c,_0x4e6388,!![]);}catch(_0x5e2da8){return BPromise[_0x9dc5('0x26')](_0x5e2da8);}return _0x4ada0c['save']();};}function saveUpdates(_0x191c88,_0x5c8956){return function(_0x100ae7){if(_0x100ae7){return _0x100ae7['update'](_0x191c88)[_0x9dc5('0x27')](function(_0x1c3726){return _0x1c3726;});}return null;};}function removeEntity(_0x255bff,_0x4ddea4){return function(_0x184d78){if(_0x184d78){return _0x184d78[_0x9dc5('0x28')]()[_0x9dc5('0x27')](function(){_0x255bff[_0x9dc5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ba5d2,_0xdeab68){return function(_0xf6da02){if(!_0xf6da02){_0x4ba5d2[_0x9dc5('0x1b')](0x194);}return _0xf6da02;};}function handleError(_0x21e4fb,_0x5ea9b4){_0x5ea9b4=_0x5ea9b4||0x1f4;return function(_0x59a0bf){logger[_0x9dc5('0x29')](_0x59a0bf[_0x9dc5('0x2a')]);if(_0x59a0bf['name']){delete _0x59a0bf[_0x9dc5('0x2b')];}_0x21e4fb[_0x9dc5('0x1c')](_0x5ea9b4)[_0x9dc5('0x2c')](_0x59a0bf);};}exports['index']=function(_0x4777f0,_0x311dfc){var _0x4630e2={},_0x3fadbf={},_0x3659a6={'count':0x0,'rows':[]};var _0x2d73e5=_['map'](db[_0x9dc5('0x2d')][_0x9dc5('0x2e')],function(_0x21b243){return{'name':_0x21b243[_0x9dc5('0x2f')],'type':_0x21b243[_0x9dc5('0x30')]['key']};});_0x3fadbf['model']=_[_0x9dc5('0x31')](_0x2d73e5,_0x9dc5('0x2b'));_0x3fadbf['query']=_[_0x9dc5('0x32')](_0x4777f0[_0x9dc5('0x33')]);_0x3fadbf[_0x9dc5('0x34')]=_[_0x9dc5('0x35')](_0x3fadbf[_0x9dc5('0x36')],_0x3fadbf[_0x9dc5('0x33')]);_0x4630e2[_0x9dc5('0x37')]=_[_0x9dc5('0x35')](_0x3fadbf[_0x9dc5('0x36')],qs['fields'](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x38')]));_0x4630e2[_0x9dc5('0x37')]=_0x4630e2[_0x9dc5('0x37')][_0x9dc5('0x39')]?_0x4630e2[_0x9dc5('0x37')]:_0x3fadbf['model'];if(!_0x4777f0[_0x9dc5('0x33')]['hasOwnProperty'](_0x9dc5('0x3a'))){_0x4630e2['limit']=qs[_0x9dc5('0x22')](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x22')]);_0x4630e2[_0x9dc5('0x1f')]=qs[_0x9dc5('0x1f')](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x1f')]);}_0x4630e2[_0x9dc5('0x3b')]=qs[_0x9dc5('0x3c')](_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x3c')]);_0x4630e2['where']=qs[_0x9dc5('0x34')](_['pick'](_0x4777f0[_0x9dc5('0x33')],_0x3fadbf[_0x9dc5('0x34')]),_0x2d73e5);if(_0x4777f0[_0x9dc5('0x33')]['filter']){_0x4630e2[_0x9dc5('0x3d')]=_[_0x9dc5('0x3e')](_0x4630e2[_0x9dc5('0x3d')],{'$or':_['map'](_0x2d73e5,function(_0x1781a7){if(_0x1781a7[_0x9dc5('0x30')]!==_0x9dc5('0x3f')){var _0x3f097e={};_0x3f097e[_0x1781a7['name']]={'$like':'%'+_0x4777f0[_0x9dc5('0x33')][_0x9dc5('0x40')]+'%'};return _0x3f097e;}})});}_0x4630e2=_[_0x9dc5('0x3e')]({},_0x4630e2,_0x4777f0[_0x9dc5('0x41')]);var _0x594b5e={'where':_0x4630e2[_0x9dc5('0x3d')]};return db['ChatQueueReport'][_0x9dc5('0x21')](_0x594b5e)[_0x9dc5('0x27')](function(_0x222662){_0x3659a6[_0x9dc5('0x21')]=_0x222662;if(_0x4777f0['query']['includeAll']){_0x4630e2['include']=[{'all':!![]}];}return db[_0x9dc5('0x2d')][_0x9dc5('0x42')](_0x4630e2);})[_0x9dc5('0x27')](function(_0x1a9162){_0x3659a6['rows']=_0x1a9162;return _0x3659a6;})[_0x9dc5('0x27')](respondWithFilteredResult(_0x311dfc,_0x4630e2))[_0x9dc5('0x43')](handleError(_0x311dfc,null));};exports[_0x9dc5('0x44')]=function(_0x30ef89,_0x1781fa){var _0x4a7262={'raw':!![],'where':{'id':_0x30ef89[_0x9dc5('0x45')]['id']}},_0x5d2fe7={};_0x5d2fe7['model']=_[_0x9dc5('0x32')](db[_0x9dc5('0x2d')]['rawAttributes']);_0x5d2fe7[_0x9dc5('0x33')]=_[_0x9dc5('0x32')](_0x30ef89[_0x9dc5('0x33')]);_0x5d2fe7[_0x9dc5('0x34')]=_[_0x9dc5('0x35')](_0x5d2fe7[_0x9dc5('0x36')],_0x5d2fe7[_0x9dc5('0x33')]);_0x4a7262[_0x9dc5('0x37')]=_[_0x9dc5('0x35')](_0x5d2fe7['model'],qs[_0x9dc5('0x38')](_0x30ef89[_0x9dc5('0x33')]['fields']));_0x4a7262['attributes']=_0x4a7262[_0x9dc5('0x37')]['length']?_0x4a7262['attributes']:_0x5d2fe7[_0x9dc5('0x36')];if(_0x30ef89[_0x9dc5('0x33')][_0x9dc5('0x46')]){_0x4a7262[_0x9dc5('0x47')]=[{'all':!![]}];}_0x4a7262=_['merge']({},_0x4a7262,_0x30ef89[_0x9dc5('0x41')]);return db['ChatQueueReport'][_0x9dc5('0x48')](_0x4a7262)[_0x9dc5('0x27')](handleEntityNotFound(_0x1781fa,null))[_0x9dc5('0x27')](respondWithResult(_0x1781fa,null))['catch'](handleError(_0x1781fa,null));};exports['create']=function(_0x44f8a3,_0x26d54e){return db[_0x9dc5('0x2d')][_0x9dc5('0x49')](_0x44f8a3['body'],{})[_0x9dc5('0x27')](respondWithResult(_0x26d54e,0xc9))[_0x9dc5('0x43')](handleError(_0x26d54e,null));};exports['update']=function(_0x5ca7e8,_0x188338){if(_0x5ca7e8[_0x9dc5('0x4a')]['id']){delete _0x5ca7e8[_0x9dc5('0x4a')]['id'];}return db[_0x9dc5('0x2d')][_0x9dc5('0x48')]({'where':{'id':_0x5ca7e8[_0x9dc5('0x45')]['id']}})['then'](handleEntityNotFound(_0x188338,null))[_0x9dc5('0x27')](saveUpdates(_0x5ca7e8[_0x9dc5('0x4a')],null))['then'](respondWithResult(_0x188338,null))[_0x9dc5('0x43')](handleError(_0x188338,null));};exports[_0x9dc5('0x28')]=function(_0x3d6260,_0x3ac2f2){return db['ChatQueueReport'][_0x9dc5('0x48')]({'where':{'id':_0x3d6260[_0x9dc5('0x45')]['id']}})[_0x9dc5('0x27')](handleEntityNotFound(_0x3ac2f2,null))[_0x9dc5('0x27')](removeEntity(_0x3ac2f2,null))[_0x9dc5('0x43')](handleError(_0x3ac2f2,null));};exports[_0x9dc5('0x4b')]=function(_0x23f6cc,_0x171e33){return db[_0x9dc5('0x2d')]['describe']()[_0x9dc5('0x27')](respondWithResult(_0x171e33,null))[_0x9dc5('0x43')](handleError(_0x171e33,null));}; \ No newline at end of file +var _0xd47f=['nolimit','order','sort','pick','where','type','merge','options','includeAll','ChatQueueReport','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x12699c,_0xf9dd49){var _0x54360e=function(_0xa4d495){while(--_0xa4d495){_0x12699c['push'](_0x12699c['shift']());}};_0x54360e(++_0xf9dd49);}(_0xd47f,0x1bd));var _0xfd47=function(_0x26cf77,_0x183d5c){_0x26cf77=_0x26cf77-0x0;var _0x58b93f=_0xd47f[_0x26cf77];return _0x58b93f;};'use strict';var emlformat=require(_0xfd47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd47('0x1'));var jsonpatch=require(_0xfd47('0x2'));var rp=require(_0xfd47('0x3'));var moment=require(_0xfd47('0x4'));var BPromise=require(_0xfd47('0x5'));var Mustache=require(_0xfd47('0x6'));var util=require(_0xfd47('0x7'));var path=require(_0xfd47('0x8'));var sox=require(_0xfd47('0x9'));var csv=require(_0xfd47('0xa'));var ejs=require(_0xfd47('0xb'));var fs=require('fs');var fs_extra=require(_0xfd47('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfd47('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd47('0xe'));var Papa=require(_0xfd47('0xf'));var Redis=require(_0xfd47('0x10'));var authService=require(_0xfd47('0x11'));var qs=require(_0xfd47('0x12'));var as=require(_0xfd47('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd47('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd47('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b01ce,_0x4a1e0c){_0x4a1e0c=_0x4a1e0c||0xcc;return function(_0x1bf3ab){if(_0x1bf3ab){return _0x4b01ce['sendStatus'](_0x4a1e0c);}return _0x4b01ce[_0xfd47('0x16')](_0x4a1e0c)[_0xfd47('0x17')]();};}function respondWithResult(_0x3ada2a,_0x49c00a){_0x49c00a=_0x49c00a||0xc8;return function(_0x1cd77f){if(_0x1cd77f){return _0x3ada2a[_0xfd47('0x16')](_0x49c00a)[_0xfd47('0x18')](_0x1cd77f);}};}function respondWithFilteredResult(_0x24873a,_0x584fe1){return function(_0x791937){if(_0x791937){var _0x1011a3=typeof _0x584fe1[_0xfd47('0x19')]==='undefined'&&typeof _0x584fe1['limit']===_0xfd47('0x1a');var _0xf8e74b=_0x791937[_0xfd47('0x1b')];var _0xf1bbb=_0x1011a3?0x0:_0x584fe1[_0xfd47('0x19')];var _0x4d2d27=_0x1011a3?_0x791937[_0xfd47('0x1b')]:_0x584fe1[_0xfd47('0x19')]+_0x584fe1[_0xfd47('0x1c')];var _0x231106;if(_0x4d2d27>=_0xf8e74b){_0x4d2d27=_0xf8e74b;_0x231106=0xc8;}else{_0x231106=0xce;}_0x24873a[_0xfd47('0x16')](_0x231106);return _0x24873a[_0xfd47('0x1d')]('Content-Range',_0xf1bbb+'-'+_0x4d2d27+'/'+_0xf8e74b)[_0xfd47('0x18')](_0x791937);}return null;};}function patchUpdates(_0x59239c){return function(_0x411680){try{jsonpatch[_0xfd47('0x1e')](_0x411680,_0x59239c,!![]);}catch(_0x4153f6){return BPromise[_0xfd47('0x1f')](_0x4153f6);}return _0x411680['save']();};}function saveUpdates(_0x45e681,_0x29a2dd){return function(_0x943c8a){if(_0x943c8a){return _0x943c8a[_0xfd47('0x20')](_0x45e681)['then'](function(_0x511dbd){return _0x511dbd;});}return null;};}function removeEntity(_0x285f2a,_0xc06999){return function(_0x4395ba){if(_0x4395ba){return _0x4395ba[_0xfd47('0x21')]()[_0xfd47('0x22')](function(){_0x285f2a['status'](0xcc)[_0xfd47('0x17')]();});}};}function handleEntityNotFound(_0x5ca823,_0x48ec3a){return function(_0x26e5fa){if(!_0x26e5fa){_0x5ca823[_0xfd47('0x23')](0x194);}return _0x26e5fa;};}function handleError(_0x2d319a,_0x1905df){_0x1905df=_0x1905df||0x1f4;return function(_0xcce2e3){logger[_0xfd47('0x24')](_0xcce2e3['stack']);if(_0xcce2e3[_0xfd47('0x25')]){delete _0xcce2e3[_0xfd47('0x25')];}_0x2d319a[_0xfd47('0x16')](_0x1905df)[_0xfd47('0x26')](_0xcce2e3);};}exports[_0xfd47('0x27')]=function(_0x4c9a78,_0x120c38){var _0x46c3f8={},_0x3dfd47={},_0x332f6f={'count':0x0,'rows':[]};var _0x1500e9=_[_0xfd47('0x28')](db['ChatQueueReport'][_0xfd47('0x29')],function(_0x3d415b){return{'name':_0x3d415b[_0xfd47('0x2a')],'type':_0x3d415b['type'][_0xfd47('0x2b')]};});_0x3dfd47['model']=_[_0xfd47('0x28')](_0x1500e9,'name');_0x3dfd47[_0xfd47('0x2c')]=_[_0xfd47('0x2d')](_0x4c9a78['query']);_0x3dfd47[_0xfd47('0x2e')]=_[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x30')],_0x3dfd47[_0xfd47('0x2c')]);_0x46c3f8[_0xfd47('0x31')]=_[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x30')],qs['fields'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x32')]));_0x46c3f8['attributes']=_0x46c3f8[_0xfd47('0x31')][_0xfd47('0x33')]?_0x46c3f8[_0xfd47('0x31')]:_0x3dfd47['model'];if(!_0x4c9a78[_0xfd47('0x2c')]['hasOwnProperty'](_0xfd47('0x34'))){_0x46c3f8[_0xfd47('0x1c')]=qs['limit'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x1c')]);_0x46c3f8[_0xfd47('0x19')]=qs['offset'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x19')]);}_0x46c3f8[_0xfd47('0x35')]=qs['sort'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x36')]);_0x46c3f8['where']=qs[_0xfd47('0x2e')](_[_0xfd47('0x37')](_0x4c9a78['query'],_0x3dfd47['filters']),_0x1500e9);if(_0x4c9a78[_0xfd47('0x2c')]['filter']){_0x46c3f8[_0xfd47('0x38')]=_['merge'](_0x46c3f8[_0xfd47('0x38')],{'$or':_[_0xfd47('0x28')](_0x1500e9,function(_0x4b81ab){if(_0x4b81ab[_0xfd47('0x39')]!=='VIRTUAL'){var _0x5db418={};_0x5db418[_0x4b81ab['name']]={'$like':'%'+_0x4c9a78[_0xfd47('0x2c')]['filter']+'%'};return _0x5db418;}})});}_0x46c3f8=_[_0xfd47('0x3a')]({},_0x46c3f8,_0x4c9a78[_0xfd47('0x3b')]);var _0x2c70a8={'where':_0x46c3f8['where']};return db['ChatQueueReport']['count'](_0x2c70a8)[_0xfd47('0x22')](function(_0x420ce0){_0x332f6f[_0xfd47('0x1b')]=_0x420ce0;if(_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x3c')]){_0x46c3f8['include']=[{'all':!![]}];}return db[_0xfd47('0x3d')][_0xfd47('0x3e')](_0x46c3f8);})[_0xfd47('0x22')](function(_0x22d967){_0x332f6f[_0xfd47('0x3f')]=_0x22d967;return _0x332f6f;})[_0xfd47('0x22')](respondWithFilteredResult(_0x120c38,_0x46c3f8))[_0xfd47('0x40')](handleError(_0x120c38,null));};exports[_0xfd47('0x41')]=function(_0x3aff8f,_0x4158dc){var _0x3c4b7c={'raw':!![],'where':{'id':_0x3aff8f['params']['id']}},_0x11e823={};_0x11e823[_0xfd47('0x30')]=_[_0xfd47('0x2d')](db[_0xfd47('0x3d')][_0xfd47('0x29')]);_0x11e823[_0xfd47('0x2c')]=_[_0xfd47('0x2d')](_0x3aff8f['query']);_0x11e823[_0xfd47('0x2e')]=_[_0xfd47('0x2f')](_0x11e823[_0xfd47('0x30')],_0x11e823['query']);_0x3c4b7c[_0xfd47('0x31')]=_[_0xfd47('0x2f')](_0x11e823[_0xfd47('0x30')],qs[_0xfd47('0x32')](_0x3aff8f[_0xfd47('0x2c')][_0xfd47('0x32')]));_0x3c4b7c[_0xfd47('0x31')]=_0x3c4b7c['attributes'][_0xfd47('0x33')]?_0x3c4b7c[_0xfd47('0x31')]:_0x11e823[_0xfd47('0x30')];if(_0x3aff8f['query'][_0xfd47('0x3c')]){_0x3c4b7c['include']=[{'all':!![]}];}_0x3c4b7c=_[_0xfd47('0x3a')]({},_0x3c4b7c,_0x3aff8f[_0xfd47('0x3b')]);return db['ChatQueueReport'][_0xfd47('0x42')](_0x3c4b7c)[_0xfd47('0x22')](handleEntityNotFound(_0x4158dc,null))[_0xfd47('0x22')](respondWithResult(_0x4158dc,null))[_0xfd47('0x40')](handleError(_0x4158dc,null));};exports['create']=function(_0x9adf23,_0x50e41a){return db['ChatQueueReport'][_0xfd47('0x43')](_0x9adf23[_0xfd47('0x44')],{})['then'](respondWithResult(_0x50e41a,0xc9))[_0xfd47('0x40')](handleError(_0x50e41a,null));};exports[_0xfd47('0x20')]=function(_0x48a995,_0x45ed3f){if(_0x48a995[_0xfd47('0x44')]['id']){delete _0x48a995[_0xfd47('0x44')]['id'];}return db[_0xfd47('0x3d')][_0xfd47('0x42')]({'where':{'id':_0x48a995['params']['id']}})[_0xfd47('0x22')](handleEntityNotFound(_0x45ed3f,null))[_0xfd47('0x22')](saveUpdates(_0x48a995[_0xfd47('0x44')],null))['then'](respondWithResult(_0x45ed3f,null))['catch'](handleError(_0x45ed3f,null));};exports[_0xfd47('0x21')]=function(_0x44df07,_0x56fa32){return db[_0xfd47('0x3d')][_0xfd47('0x42')]({'where':{'id':_0x44df07[_0xfd47('0x45')]['id']}})[_0xfd47('0x22')](handleEntityNotFound(_0x56fa32,null))['then'](removeEntity(_0x56fa32,null))[_0xfd47('0x40')](handleError(_0x56fa32,null));};exports[_0xfd47('0x46')]=function(_0x1bd4ba,_0x5c9bd0){return db[_0xfd47('0x3d')][_0xfd47('0x46')]()['then'](respondWithResult(_0x5c9bd0,null))[_0xfd47('0x40')](handleError(_0x5c9bd0,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 117895f..6b4c456 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2aafcd,_0x529761){var _0xb30ead=function(_0x1f7bee){while(--_0x1f7bee){_0x2aafcd['push'](_0x2aafcd['shift']());}};_0xb30ead(++_0x529761);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x4961f6,_0x56da8b){var _0x44f5ef=function(_0x5b6af3){while(--_0x5b6af3){_0x4961f6['push'](_0x4961f6['shift']());}};_0x44f5ef(++_0x56da8b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 2a10b77..3c2e6fe 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 _0x8409=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','options','raw','UpdateChatQueueReport','ChatQueueReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x1ef5c1,_0x7aa599){var _0x107895=function(_0x1b6049){while(--_0x1b6049){_0x1ef5c1['push'](_0x1ef5c1['shift']());}};_0x107895(++_0x7aa599);}(_0x8409,0x91));var _0x9840=function(_0x5af9ba,_0x30adfb){_0x5af9ba=_0x5af9ba-0x0;var _0x488c7c=_0x8409[_0x5af9ba];return _0x488c7c;};'use strict';var _=require(_0x9840('0x0'));var util=require(_0x9840('0x1'));var moment=require(_0x9840('0x2'));var BPromise=require(_0x9840('0x3'));var rs=require(_0x9840('0x4'));var fs=require('fs');var Redis=require(_0x9840('0x5'));var db=require(_0x9840('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9840('0x7'))('rpc');var config=require(_0x9840('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9840('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e514f,_0x3652c5,_0xa3195f){return new BPromise(function(_0x1a23a1,_0x2815a0){return client['request'](_0x3e514f,_0xa3195f)[_0x9840('0xa')](function(_0x4933e9){logger[_0x9840('0xb')](_0x9840('0xc'),_0x3652c5,_0x9840('0xd'));logger[_0x9840('0xe')](_0x9840('0xf'),_0x3652c5,'request\x20sent',JSON[_0x9840('0x10')](_0x4933e9));if(_0x4933e9[_0x9840('0x11')]){if(_0x4933e9[_0x9840('0x11')][_0x9840('0x12')]===0x1f4){logger[_0x9840('0x11')](_0x9840('0xc'),_0x3652c5,_0x4933e9['error'][_0x9840('0x13')]);return _0x2815a0(_0x4933e9[_0x9840('0x11')]['message']);}logger['error'](_0x9840('0xc'),_0x3652c5,_0x4933e9['error'][_0x9840('0x13')]);return _0x1a23a1(_0x4933e9[_0x9840('0x11')][_0x9840('0x13')]);}else{logger[_0x9840('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3652c5,_0x9840('0xd'));_0x1a23a1(_0x4933e9[_0x9840('0x14')][_0x9840('0x13')]);}})[_0x9840('0x15')](function(_0xa00dd){logger[_0x9840('0x11')](_0x9840('0xc'),_0x3652c5,_0xa00dd);_0x2815a0(_0xa00dd);});});}exports[_0x9840('0x16')]=function(_0x1f01fc){var _0x95a8ec=this;return new Promise(function(_0x59a76c,_0x3c3339){return db['ChatQueueReport'][_0x9840('0x17')](_0x1f01fc['body'],{'raw':_0x1f01fc[_0x9840('0x18')]?_0x1f01fc[_0x9840('0x18')][_0x9840('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1e0817){logger[_0x9840('0xb')](_0x9840('0x16'),_0x1f01fc);logger[_0x9840('0xe')](_0x9840('0x16'),_0x1f01fc,JSON[_0x9840('0x10')](_0x1e0817));_0x59a76c(_0x1e0817);})[_0x9840('0x15')](function(_0xf20247){logger[_0x9840('0x11')](_0x9840('0x16'),_0xf20247[_0x9840('0x13')],_0x1f01fc);_0x3c3339(_0x95a8ec[_0x9840('0x11')](0x1f4,_0xf20247['message']));});});};exports[_0x9840('0x1a')]=function(_0x62f165){var _0xe6431d=this;return new Promise(function(_0x4cded2,_0x443bc0){return db[_0x9840('0x1b')][_0x9840('0x1c')](_0x62f165[_0x9840('0x1d')],{'raw':_0x62f165[_0x9840('0x18')]?_0x62f165[_0x9840('0x18')][_0x9840('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x62f165['options']?_0x62f165['options'][_0x9840('0x1e')]||null:null,'attributes':_0x62f165[_0x9840('0x18')]?_0x62f165[_0x9840('0x18')]['attributes']||null:null,'limit':_0x62f165[_0x9840('0x18')]?_0x62f165[_0x9840('0x18')]['limit']||null:null})[_0x9840('0xa')](function(_0x532dec){logger['info'](_0x9840('0x1a'),_0x62f165);logger[_0x9840('0xe')](_0x9840('0x1a'),_0x62f165,JSON[_0x9840('0x10')](_0x532dec));_0x4cded2(_0x532dec);})[_0x9840('0x15')](function(_0x2d6a82){logger[_0x9840('0x11')](_0x9840('0x1a'),_0x2d6a82[_0x9840('0x13')],_0x62f165);_0x443bc0(_0xe6431d[_0x9840('0x11')](0x1f4,_0x2d6a82['message']));});});}; \ No newline at end of file +var _0xc719=['info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4148f7,_0x54a2b6){var _0xb2d2f9=function(_0x56fed2){while(--_0x56fed2){_0x4148f7['push'](_0x4148f7['shift']());}};_0xb2d2f9(++_0x54a2b6);}(_0xc719,0x1d2));var _0x9c71=function(_0x32c98a,_0x5e6eb0){_0x32c98a=_0x32c98a-0x0;var _0x1796d3=_0xc719[_0x32c98a];return _0x1796d3;};'use strict';var _=require(_0x9c71('0x0'));var util=require(_0x9c71('0x1'));var moment=require(_0x9c71('0x2'));var BPromise=require(_0x9c71('0x3'));var rs=require(_0x9c71('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c71('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c71('0x6'))(_0x9c71('0x7'));var config=require(_0x9c71('0x8'));var jayson=require(_0x9c71('0x9'));var client=jayson[_0x9c71('0xa')][_0x9c71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x413519,_0x162af5,_0x55a82e){return new BPromise(function(_0x1c27d2,_0x2f212e){return client[_0x9c71('0xc')](_0x413519,_0x55a82e)[_0x9c71('0xd')](function(_0x37bc17){logger[_0x9c71('0xe')](_0x9c71('0xf'),_0x162af5,_0x9c71('0x10'));logger[_0x9c71('0x11')](_0x9c71('0x12'),_0x162af5,_0x9c71('0x10'),JSON[_0x9c71('0x13')](_0x37bc17));if(_0x37bc17['error']){if(_0x37bc17['error'][_0x9c71('0x14')]===0x1f4){logger['error'](_0x9c71('0xf'),_0x162af5,_0x37bc17['error'][_0x9c71('0x15')]);return _0x2f212e(_0x37bc17[_0x9c71('0x16')][_0x9c71('0x15')]);}logger['error'](_0x9c71('0xf'),_0x162af5,_0x37bc17[_0x9c71('0x16')][_0x9c71('0x15')]);return _0x1c27d2(_0x37bc17['error']['message']);}else{logger[_0x9c71('0xe')](_0x9c71('0xf'),_0x162af5,'request\x20sent');_0x1c27d2(_0x37bc17['result']['message']);}})[_0x9c71('0x17')](function(_0x588f14){logger[_0x9c71('0x16')](_0x9c71('0xf'),_0x162af5,_0x588f14);_0x2f212e(_0x588f14);});});}exports['CreateChatQueueReport']=function(_0x3941b9){var _0x287f35=this;return new Promise(function(_0x550bc1,_0x3a1020){return db[_0x9c71('0x18')][_0x9c71('0x19')](_0x3941b9[_0x9c71('0x1a')],{'raw':_0x3941b9[_0x9c71('0x1b')]?_0x3941b9[_0x9c71('0x1b')][_0x9c71('0x1c')]===undefined?!![]:![]:!![]})[_0x9c71('0xd')](function(_0x2a50f4){logger[_0x9c71('0xe')](_0x9c71('0x1d'),_0x3941b9);logger[_0x9c71('0x11')](_0x9c71('0x1d'),_0x3941b9,JSON[_0x9c71('0x13')](_0x2a50f4));_0x550bc1(_0x2a50f4);})['catch'](function(_0x5bdddb){logger[_0x9c71('0x16')]('CreateChatQueueReport',_0x5bdddb[_0x9c71('0x15')],_0x3941b9);_0x3a1020(_0x287f35[_0x9c71('0x16')](0x1f4,_0x5bdddb['message']));});});};exports[_0x9c71('0x1e')]=function(_0x23b8c1){var _0xb5ef9b=this;return new Promise(function(_0x414cbc,_0x377b99){return db[_0x9c71('0x18')]['update'](_0x23b8c1[_0x9c71('0x1a')],{'raw':_0x23b8c1[_0x9c71('0x1b')]?_0x23b8c1[_0x9c71('0x1b')][_0x9c71('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b8c1[_0x9c71('0x1b')]?_0x23b8c1['options']['where']||null:null,'attributes':_0x23b8c1[_0x9c71('0x1b')]?_0x23b8c1[_0x9c71('0x1b')][_0x9c71('0x1f')]||null:null,'limit':_0x23b8c1[_0x9c71('0x1b')]?_0x23b8c1[_0x9c71('0x1b')]['limit']||null:null})[_0x9c71('0xd')](function(_0x3d9e6b){logger[_0x9c71('0xe')](_0x9c71('0x1e'),_0x23b8c1);logger[_0x9c71('0x11')](_0x9c71('0x1e'),_0x23b8c1,JSON['stringify'](_0x3d9e6b));_0x414cbc(_0x3d9e6b);})['catch'](function(_0x18a51a){logger[_0x9c71('0x16')](_0x9c71('0x1e'),_0x18a51a[_0x9c71('0x15')],_0x23b8c1);_0x377b99(_0xb5ef9b['error'](0x1f4,_0x18a51a[_0x9c71('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 1deb3ee..fae5019 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 _0xbcc7=['/:id','show','post','create','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x3a371f,_0x57372e){var _0xe7266c=function(_0x76ca95){while(--_0x76ca95){_0x3a371f['push'](_0x3a371f['shift']());}};_0xe7266c(++_0x57372e);}(_0xbcc7,0x191));var _0x7bcc=function(_0x54fdd9,_0x22e5f7){_0x54fdd9=_0x54fdd9-0x0;var _0x473ab5=_0xbcc7[_0x54fdd9];return _0x473ab5;};'use strict';var multer=require(_0x7bcc('0x0'));var util=require(_0x7bcc('0x1'));var path=require(_0x7bcc('0x2'));var timeout=require(_0x7bcc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7bcc('0x4'));var auth=require(_0x7bcc('0x5'));var interaction=require(_0x7bcc('0x6'));var config=require(_0x7bcc('0x7'));var controller=require(_0x7bcc('0x8'));router[_0x7bcc('0x9')]('/',auth[_0x7bcc('0xa')](),controller['index']);router['get'](_0x7bcc('0xb'),auth['isAuthenticated'](),controller[_0x7bcc('0xc')]);router[_0x7bcc('0x9')](_0x7bcc('0xd'),auth['isAuthenticated'](),controller[_0x7bcc('0xe')]);router[_0x7bcc('0xf')]('/',auth[_0x7bcc('0xa')](),controller[_0x7bcc('0x10')]);router['put'](_0x7bcc('0xd'),auth[_0x7bcc('0xa')](),controller['update']);router['delete'](_0x7bcc('0xd'),auth[_0x7bcc('0xa')](),controller['destroy']);module[_0x7bcc('0x11')]=router; \ No newline at end of file +var _0x206d=['../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x206d,0x1f3));var _0xd206=function(_0x107c0f,_0x2b48cd){_0x107c0f=_0x107c0f-0x0;var _0x1da96e=_0x206d[_0x107c0f];return _0x1da96e;};'use strict';var multer=require(_0xd206('0x0'));var util=require(_0xd206('0x1'));var path=require(_0xd206('0x2'));var timeout=require(_0xd206('0x3'));var express=require('express');var router=express[_0xd206('0x4')]();var fs_extra=require(_0xd206('0x5'));var auth=require(_0xd206('0x6'));var interaction=require(_0xd206('0x7'));var config=require('../../config/environment');var controller=require(_0xd206('0x8'));router[_0xd206('0x9')]('/',auth[_0xd206('0xa')](),controller[_0xd206('0xb')]);router['get'](_0xd206('0xc'),auth[_0xd206('0xa')](),controller[_0xd206('0xd')]);router['get'](_0xd206('0xe'),auth['isAuthenticated'](),controller[_0xd206('0xf')]);router[_0xd206('0x10')]('/',auth['isAuthenticated'](),controller[_0xd206('0x11')]);router[_0xd206('0x12')](_0xd206('0xe'),auth[_0xd206('0xa')](),controller[_0xd206('0x13')]);router['delete'](_0xd206('0xe'),auth[_0xd206('0xa')](),controller[_0xd206('0x14')]);module[_0xd206('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 78ef5ea..d954ca0 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2199f7,_0x4f6410){var _0x6efa6a=function(_0x1d2362){while(--_0x1d2362){_0x2199f7['push'](_0x2199f7['shift']());}};_0x6efa6a(++_0x4f6410);}(_0x008c,0x188));var _0xc008=function(_0x4965d1,_0xb546d4){_0x4965d1=_0x4965d1-0x0;var _0x59e849=_0x008c[_0x4965d1];return _0x59e849;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4a4c78,_0x13d5b7){var _0xd58f32=function(_0x32cc8e){while(--_0x32cc8e){_0x4a4c78['push'](_0x4a4c78['shift']());}};_0xd58f32(++_0x13d5b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1f3268d..f971171 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 _0x8d5e=['fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','then','includeAll','include','rows','catch','show','params','rawAttributes','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','error','name','map','ChatTransferReport'];(function(_0x7a2b45,_0x2cea48){var _0x3e8374=function(_0x335388){while(--_0x335388){_0x7a2b45['push'](_0x7a2b45['shift']());}};_0x3e8374(++_0x2cea48);}(_0x8d5e,0x69));var _0xe8d5=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x8d5e[_0x50007c];return _0x5c1ec7;};'use strict';var emlformat=require(_0xe8d5('0x0'));var rimraf=require(_0xe8d5('0x1'));var zipdir=require(_0xe8d5('0x2'));var jsonpatch=require(_0xe8d5('0x3'));var rp=require(_0xe8d5('0x4'));var moment=require('moment');var BPromise=require(_0xe8d5('0x5'));var Mustache=require(_0xe8d5('0x6'));var util=require(_0xe8d5('0x7'));var path=require(_0xe8d5('0x8'));var sox=require(_0xe8d5('0x9'));var csv=require(_0xe8d5('0xa'));var ejs=require(_0xe8d5('0xb'));var fs=require('fs');var fs_extra=require(_0xe8d5('0xc'));var _=require('lodash');var squel=require(_0xe8d5('0xd'));var crypto=require(_0xe8d5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe8d5('0xf'));var toCsv=require(_0xe8d5('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe8d5('0x10'));var authService=require(_0xe8d5('0x11'));var qs=require(_0xe8d5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe8d5('0x13'));var logger=require(_0xe8d5('0x14'))(_0xe8d5('0x15'));var utils=require(_0xe8d5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe8d5('0x17'))['db'];function respondWithStatusCode(_0x2c49d5,_0x26e78a){_0x26e78a=_0x26e78a||0xcc;return function(_0x4554f3){if(_0x4554f3){return _0x2c49d5[_0xe8d5('0x18')](_0x26e78a);}return _0x2c49d5['status'](_0x26e78a)[_0xe8d5('0x19')]();};}function respondWithResult(_0x3abf77,_0x48fa7b){_0x48fa7b=_0x48fa7b||0xc8;return function(_0x5d15d0){if(_0x5d15d0){return _0x3abf77[_0xe8d5('0x1a')](_0x48fa7b)['json'](_0x5d15d0);}};}function respondWithFilteredResult(_0x51d8e7,_0x1798ba){return function(_0x53de5e){if(_0x53de5e){var _0x2e56e7=typeof _0x1798ba[_0xe8d5('0x1b')]==='undefined'&&typeof _0x1798ba['limit']===_0xe8d5('0x1c');var _0x19e9ee=_0x53de5e[_0xe8d5('0x1d')];var _0x6b7882=_0x2e56e7?0x0:_0x1798ba[_0xe8d5('0x1b')];var _0x1dead7=_0x2e56e7?_0x53de5e[_0xe8d5('0x1d')]:_0x1798ba[_0xe8d5('0x1b')]+_0x1798ba[_0xe8d5('0x1e')];var _0x660307;if(_0x1dead7>=_0x19e9ee){_0x1dead7=_0x19e9ee;_0x660307=0xc8;}else{_0x660307=0xce;}_0x51d8e7['status'](_0x660307);return _0x51d8e7[_0xe8d5('0x1f')](_0xe8d5('0x20'),_0x6b7882+'-'+_0x1dead7+'/'+_0x19e9ee)['json'](_0x53de5e);}return null;};}function patchUpdates(_0x379292){return function(_0x1bdfb7){try{jsonpatch[_0xe8d5('0x21')](_0x1bdfb7,_0x379292,!![]);}catch(_0x4428ad){return BPromise['reject'](_0x4428ad);}return _0x1bdfb7[_0xe8d5('0x22')]();};}function saveUpdates(_0x24d47b,_0x4268d3){return function(_0x59eb9c){if(_0x59eb9c){return _0x59eb9c[_0xe8d5('0x23')](_0x24d47b)['then'](function(_0x7a84d3){return _0x7a84d3;});}return null;};}function removeEntity(_0x2bd0d8,_0x31c1e9){return function(_0x3f835e){if(_0x3f835e){return _0x3f835e[_0xe8d5('0x24')]()['then'](function(){_0x2bd0d8[_0xe8d5('0x1a')](0xcc)[_0xe8d5('0x19')]();});}};}function handleEntityNotFound(_0x461560,_0x215b84){return function(_0x4e4a59){if(!_0x4e4a59){_0x461560[_0xe8d5('0x18')](0x194);}return _0x4e4a59;};}function handleError(_0x552649,_0x5e8d24){_0x5e8d24=_0x5e8d24||0x1f4;return function(_0x3a386f){logger[_0xe8d5('0x25')](_0x3a386f['stack']);if(_0x3a386f[_0xe8d5('0x26')]){delete _0x3a386f[_0xe8d5('0x26')];}_0x552649[_0xe8d5('0x1a')](_0x5e8d24)['send'](_0x3a386f);};}exports['index']=function(_0x2d8927,_0x29e107){var _0x22c59c={},_0x43f9ec={},_0x46eea3={'count':0x0,'rows':[]};var _0x5857e5=_[_0xe8d5('0x27')](db[_0xe8d5('0x28')]['rawAttributes'],function(_0x159437){return{'name':_0x159437[_0xe8d5('0x29')],'type':_0x159437['type'][_0xe8d5('0x2a')]};});_0x43f9ec[_0xe8d5('0x2b')]=_[_0xe8d5('0x27')](_0x5857e5,_0xe8d5('0x26'));_0x43f9ec[_0xe8d5('0x2c')]=_[_0xe8d5('0x2d')](_0x2d8927[_0xe8d5('0x2c')]);_0x43f9ec['filters']=_[_0xe8d5('0x2e')](_0x43f9ec['model'],_0x43f9ec[_0xe8d5('0x2c')]);_0x22c59c[_0xe8d5('0x2f')]=_[_0xe8d5('0x2e')](_0x43f9ec[_0xe8d5('0x2b')],qs[_0xe8d5('0x30')](_0x2d8927[_0xe8d5('0x2c')][_0xe8d5('0x30')]));_0x22c59c['attributes']=_0x22c59c[_0xe8d5('0x2f')][_0xe8d5('0x31')]?_0x22c59c[_0xe8d5('0x2f')]:_0x43f9ec['model'];if(!_0x2d8927[_0xe8d5('0x2c')][_0xe8d5('0x32')](_0xe8d5('0x33'))){_0x22c59c[_0xe8d5('0x1e')]=qs['limit'](_0x2d8927[_0xe8d5('0x2c')][_0xe8d5('0x1e')]);_0x22c59c[_0xe8d5('0x1b')]=qs[_0xe8d5('0x1b')](_0x2d8927[_0xe8d5('0x2c')]['offset']);}_0x22c59c[_0xe8d5('0x34')]=qs[_0xe8d5('0x35')](_0x2d8927['query'][_0xe8d5('0x35')]);_0x22c59c[_0xe8d5('0x36')]=qs[_0xe8d5('0x37')](_[_0xe8d5('0x38')](_0x2d8927[_0xe8d5('0x2c')],_0x43f9ec[_0xe8d5('0x37')]),_0x5857e5);if(_0x2d8927[_0xe8d5('0x2c')][_0xe8d5('0x39')]){_0x22c59c[_0xe8d5('0x36')]=_[_0xe8d5('0x3a')](_0x22c59c['where'],{'$or':_['map'](_0x5857e5,function(_0x34f1a1){if(_0x34f1a1[_0xe8d5('0x3b')]!==_0xe8d5('0x3c')){var _0x3a174b={};_0x3a174b[_0x34f1a1[_0xe8d5('0x26')]]={'$like':'%'+_0x2d8927[_0xe8d5('0x2c')]['filter']+'%'};return _0x3a174b;}})});}_0x22c59c=_[_0xe8d5('0x3a')]({},_0x22c59c,_0x2d8927['options']);var _0x1f5741={'where':_0x22c59c[_0xe8d5('0x36')]};return db['ChatTransferReport'][_0xe8d5('0x1d')](_0x1f5741)[_0xe8d5('0x3d')](function(_0x311f45){_0x46eea3[_0xe8d5('0x1d')]=_0x311f45;if(_0x2d8927[_0xe8d5('0x2c')][_0xe8d5('0x3e')]){_0x22c59c[_0xe8d5('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x22c59c);})[_0xe8d5('0x3d')](function(_0x1eb89e){_0x46eea3[_0xe8d5('0x40')]=_0x1eb89e;return _0x46eea3;})[_0xe8d5('0x3d')](respondWithFilteredResult(_0x29e107,_0x22c59c))[_0xe8d5('0x41')](handleError(_0x29e107,null));};exports[_0xe8d5('0x42')]=function(_0x522f5c,_0x150dd4){var _0x4e4218={'raw':!![],'where':{'id':_0x522f5c[_0xe8d5('0x43')]['id']}},_0x135836={};_0x135836['model']=_[_0xe8d5('0x2d')](db[_0xe8d5('0x28')][_0xe8d5('0x44')]);_0x135836['query']=_[_0xe8d5('0x2d')](_0x522f5c['query']);_0x135836[_0xe8d5('0x37')]=_[_0xe8d5('0x2e')](_0x135836[_0xe8d5('0x2b')],_0x135836[_0xe8d5('0x2c')]);_0x4e4218['attributes']=_[_0xe8d5('0x2e')](_0x135836[_0xe8d5('0x2b')],qs[_0xe8d5('0x30')](_0x522f5c['query'][_0xe8d5('0x30')]));_0x4e4218[_0xe8d5('0x2f')]=_0x4e4218[_0xe8d5('0x2f')][_0xe8d5('0x31')]?_0x4e4218[_0xe8d5('0x2f')]:_0x135836[_0xe8d5('0x2b')];if(_0x522f5c[_0xe8d5('0x2c')]['includeAll']){_0x4e4218[_0xe8d5('0x3f')]=[{'all':!![]}];}_0x4e4218=_[_0xe8d5('0x3a')]({},_0x4e4218,_0x522f5c[_0xe8d5('0x45')]);return db[_0xe8d5('0x28')][_0xe8d5('0x46')](_0x4e4218)['then'](handleEntityNotFound(_0x150dd4,null))[_0xe8d5('0x3d')](respondWithResult(_0x150dd4,null))[_0xe8d5('0x41')](handleError(_0x150dd4,null));};exports['create']=function(_0x23cbc6,_0x46c331){return db['ChatTransferReport']['create'](_0x23cbc6[_0xe8d5('0x47')],{})['then'](respondWithResult(_0x46c331,0xc9))['catch'](handleError(_0x46c331,null));};exports[_0xe8d5('0x23')]=function(_0xa2adb4,_0x4022d9){if(_0xa2adb4[_0xe8d5('0x47')]['id']){delete _0xa2adb4[_0xe8d5('0x47')]['id'];}return db[_0xe8d5('0x28')]['find']({'where':{'id':_0xa2adb4[_0xe8d5('0x43')]['id']}})[_0xe8d5('0x3d')](handleEntityNotFound(_0x4022d9,null))[_0xe8d5('0x3d')](saveUpdates(_0xa2adb4['body'],null))[_0xe8d5('0x3d')](respondWithResult(_0x4022d9,null))[_0xe8d5('0x41')](handleError(_0x4022d9,null));};exports[_0xe8d5('0x24')]=function(_0x18bcb4,_0x493c42){return db[_0xe8d5('0x28')][_0xe8d5('0x46')]({'where':{'id':_0x18bcb4['params']['id']}})[_0xe8d5('0x3d')](handleEntityNotFound(_0x493c42,null))['then'](removeEntity(_0x493c42,null))[_0xe8d5('0x41')](handleError(_0x493c42,null));};exports[_0xe8d5('0x48')]=function(_0x3bbe33,_0x5c8c82){return db[_0xe8d5('0x28')][_0xe8d5('0x48')]()['then'](respondWithResult(_0x5c8c82,null))['catch'](handleError(_0x5c8c82,null));}; \ No newline at end of file +var _0xcd75=['../../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','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','filter','merge','type','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x5e7460,_0x4e2dc5){var _0x103c66=function(_0x21af46){while(--_0x21af46){_0x5e7460['push'](_0x5e7460['shift']());}};_0x103c66(++_0x4e2dc5);}(_0xcd75,0x120));var _0x5cd7=function(_0x47b633,_0x2b81e8){_0x47b633=_0x47b633-0x0;var _0x449d0f=_0xcd75[_0x47b633];return _0x449d0f;};'use strict';var emlformat=require(_0x5cd7('0x0'));var rimraf=require(_0x5cd7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cd7('0x2'));var rp=require(_0x5cd7('0x3'));var moment=require('moment');var BPromise=require(_0x5cd7('0x4'));var Mustache=require(_0x5cd7('0x5'));var util=require(_0x5cd7('0x6'));var path=require('path');var sox=require(_0x5cd7('0x7'));var csv=require(_0x5cd7('0x8'));var ejs=require(_0x5cd7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cd7('0xa'));var squel=require(_0x5cd7('0xb'));var crypto=require(_0x5cd7('0xc'));var jsforce=require(_0x5cd7('0xd'));var deskjs=require(_0x5cd7('0xe'));var toCsv=require(_0x5cd7('0x8'));var querystring=require('querystring');var Papa=require(_0x5cd7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5cd7('0x10'));var as=require(_0x5cd7('0x11'));var hardwareService=require(_0x5cd7('0x12'));var logger=require(_0x5cd7('0x13'))(_0x5cd7('0x14'));var utils=require(_0x5cd7('0x15'));var config=require(_0x5cd7('0x16'));var licenseUtil=require(_0x5cd7('0x17'));var db=require(_0x5cd7('0x18'))['db'];function respondWithStatusCode(_0xde4e95,_0x4b9c39){_0x4b9c39=_0x4b9c39||0xcc;return function(_0x84df3f){if(_0x84df3f){return _0xde4e95[_0x5cd7('0x19')](_0x4b9c39);}return _0xde4e95[_0x5cd7('0x1a')](_0x4b9c39)[_0x5cd7('0x1b')]();};}function respondWithResult(_0x43a4b2,_0x353d07){_0x353d07=_0x353d07||0xc8;return function(_0x416ded){if(_0x416ded){return _0x43a4b2['status'](_0x353d07)[_0x5cd7('0x1c')](_0x416ded);}};}function respondWithFilteredResult(_0x2a8259,_0x5a1516){return function(_0x5c987c){if(_0x5c987c){var _0x451a4a=typeof _0x5a1516[_0x5cd7('0x1d')]==='undefined'&&typeof _0x5a1516[_0x5cd7('0x1e')]===_0x5cd7('0x1f');var _0x541ef7=_0x5c987c[_0x5cd7('0x20')];var _0x499cad=_0x451a4a?0x0:_0x5a1516[_0x5cd7('0x1d')];var _0x42d938=_0x451a4a?_0x5c987c[_0x5cd7('0x20')]:_0x5a1516['offset']+_0x5a1516['limit'];var _0x5b92d6;if(_0x42d938>=_0x541ef7){_0x42d938=_0x541ef7;_0x5b92d6=0xc8;}else{_0x5b92d6=0xce;}_0x2a8259[_0x5cd7('0x1a')](_0x5b92d6);return _0x2a8259[_0x5cd7('0x21')](_0x5cd7('0x22'),_0x499cad+'-'+_0x42d938+'/'+_0x541ef7)[_0x5cd7('0x1c')](_0x5c987c);}return null;};}function patchUpdates(_0x2d8bd5){return function(_0x1032cf){try{jsonpatch[_0x5cd7('0x23')](_0x1032cf,_0x2d8bd5,!![]);}catch(_0x4619af){return BPromise[_0x5cd7('0x24')](_0x4619af);}return _0x1032cf[_0x5cd7('0x25')]();};}function saveUpdates(_0x39e3dd,_0x82c843){return function(_0x5518a2){if(_0x5518a2){return _0x5518a2[_0x5cd7('0x26')](_0x39e3dd)[_0x5cd7('0x27')](function(_0x464d6b){return _0x464d6b;});}return null;};}function removeEntity(_0x46cc20,_0x53b799){return function(_0xbf16fa){if(_0xbf16fa){return _0xbf16fa[_0x5cd7('0x28')]()[_0x5cd7('0x27')](function(){_0x46cc20['status'](0xcc)[_0x5cd7('0x1b')]();});}};}function handleEntityNotFound(_0x30542e,_0x4e7c85){return function(_0x29b5c6){if(!_0x29b5c6){_0x30542e[_0x5cd7('0x19')](0x194);}return _0x29b5c6;};}function handleError(_0x442209,_0x5a885b){_0x5a885b=_0x5a885b||0x1f4;return function(_0x10127b){logger[_0x5cd7('0x29')](_0x10127b[_0x5cd7('0x2a')]);if(_0x10127b[_0x5cd7('0x2b')]){delete _0x10127b['name'];}_0x442209[_0x5cd7('0x1a')](_0x5a885b)[_0x5cd7('0x2c')](_0x10127b);};}exports[_0x5cd7('0x2d')]=function(_0xa17fbc,_0x1e9f16){var _0x36d21c={},_0x5622ef={},_0x5026e2={'count':0x0,'rows':[]};var _0x38f624=_[_0x5cd7('0x2e')](db[_0x5cd7('0x2f')][_0x5cd7('0x30')],function(_0x530992){return{'name':_0x530992[_0x5cd7('0x31')],'type':_0x530992['type'][_0x5cd7('0x32')]};});_0x5622ef[_0x5cd7('0x33')]=_[_0x5cd7('0x2e')](_0x38f624,_0x5cd7('0x2b'));_0x5622ef[_0x5cd7('0x34')]=_[_0x5cd7('0x35')](_0xa17fbc['query']);_0x5622ef['filters']=_[_0x5cd7('0x36')](_0x5622ef[_0x5cd7('0x33')],_0x5622ef[_0x5cd7('0x34')]);_0x36d21c[_0x5cd7('0x37')]=_['intersection'](_0x5622ef['model'],qs['fields'](_0xa17fbc[_0x5cd7('0x34')][_0x5cd7('0x38')]));_0x36d21c[_0x5cd7('0x37')]=_0x36d21c['attributes'][_0x5cd7('0x39')]?_0x36d21c['attributes']:_0x5622ef['model'];if(!_0xa17fbc[_0x5cd7('0x34')][_0x5cd7('0x3a')](_0x5cd7('0x3b'))){_0x36d21c[_0x5cd7('0x1e')]=qs[_0x5cd7('0x1e')](_0xa17fbc['query'][_0x5cd7('0x1e')]);_0x36d21c[_0x5cd7('0x1d')]=qs[_0x5cd7('0x1d')](_0xa17fbc[_0x5cd7('0x34')]['offset']);}_0x36d21c[_0x5cd7('0x3c')]=qs['sort'](_0xa17fbc[_0x5cd7('0x34')]['sort']);_0x36d21c['where']=qs[_0x5cd7('0x3d')](_['pick'](_0xa17fbc[_0x5cd7('0x34')],_0x5622ef[_0x5cd7('0x3d')]),_0x38f624);if(_0xa17fbc[_0x5cd7('0x34')][_0x5cd7('0x3e')]){_0x36d21c['where']=_[_0x5cd7('0x3f')](_0x36d21c['where'],{'$or':_[_0x5cd7('0x2e')](_0x38f624,function(_0x369d66){if(_0x369d66[_0x5cd7('0x40')]!=='VIRTUAL'){var _0x486cf7={};_0x486cf7[_0x369d66['name']]={'$like':'%'+_0xa17fbc[_0x5cd7('0x34')][_0x5cd7('0x3e')]+'%'};return _0x486cf7;}})});}_0x36d21c=_[_0x5cd7('0x3f')]({},_0x36d21c,_0xa17fbc[_0x5cd7('0x41')]);var _0x35d1e1={'where':_0x36d21c['where']};return db[_0x5cd7('0x2f')][_0x5cd7('0x20')](_0x35d1e1)[_0x5cd7('0x27')](function(_0x4eeaa4){_0x5026e2['count']=_0x4eeaa4;if(_0xa17fbc[_0x5cd7('0x34')][_0x5cd7('0x42')]){_0x36d21c[_0x5cd7('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x5cd7('0x44')](_0x36d21c);})[_0x5cd7('0x27')](function(_0x27d0f9){_0x5026e2['rows']=_0x27d0f9;return _0x5026e2;})[_0x5cd7('0x27')](respondWithFilteredResult(_0x1e9f16,_0x36d21c))['catch'](handleError(_0x1e9f16,null));};exports[_0x5cd7('0x45')]=function(_0xe8808c,_0x3e1dd2){var _0x451a6a={'raw':!![],'where':{'id':_0xe8808c[_0x5cd7('0x46')]['id']}},_0x422979={};_0x422979['model']=_[_0x5cd7('0x35')](db['ChatTransferReport'][_0x5cd7('0x30')]);_0x422979[_0x5cd7('0x34')]=_[_0x5cd7('0x35')](_0xe8808c[_0x5cd7('0x34')]);_0x422979[_0x5cd7('0x3d')]=_[_0x5cd7('0x36')](_0x422979[_0x5cd7('0x33')],_0x422979['query']);_0x451a6a[_0x5cd7('0x37')]=_[_0x5cd7('0x36')](_0x422979[_0x5cd7('0x33')],qs[_0x5cd7('0x38')](_0xe8808c['query'][_0x5cd7('0x38')]));_0x451a6a[_0x5cd7('0x37')]=_0x451a6a[_0x5cd7('0x37')][_0x5cd7('0x39')]?_0x451a6a[_0x5cd7('0x37')]:_0x422979[_0x5cd7('0x33')];if(_0xe8808c['query'][_0x5cd7('0x42')]){_0x451a6a[_0x5cd7('0x43')]=[{'all':!![]}];}_0x451a6a=_[_0x5cd7('0x3f')]({},_0x451a6a,_0xe8808c[_0x5cd7('0x41')]);return db[_0x5cd7('0x2f')][_0x5cd7('0x47')](_0x451a6a)[_0x5cd7('0x27')](handleEntityNotFound(_0x3e1dd2,null))[_0x5cd7('0x27')](respondWithResult(_0x3e1dd2,null))[_0x5cd7('0x48')](handleError(_0x3e1dd2,null));};exports[_0x5cd7('0x49')]=function(_0x3bb834,_0x55b52a){return db[_0x5cd7('0x2f')][_0x5cd7('0x49')](_0x3bb834['body'],{})['then'](respondWithResult(_0x55b52a,0xc9))['catch'](handleError(_0x55b52a,null));};exports[_0x5cd7('0x26')]=function(_0x5f2631,_0x5a8c17){if(_0x5f2631[_0x5cd7('0x4a')]['id']){delete _0x5f2631['body']['id'];}return db[_0x5cd7('0x2f')][_0x5cd7('0x47')]({'where':{'id':_0x5f2631[_0x5cd7('0x46')]['id']}})[_0x5cd7('0x27')](handleEntityNotFound(_0x5a8c17,null))[_0x5cd7('0x27')](saveUpdates(_0x5f2631['body'],null))['then'](respondWithResult(_0x5a8c17,null))[_0x5cd7('0x48')](handleError(_0x5a8c17,null));};exports[_0x5cd7('0x28')]=function(_0xcc7ff0,_0x4fb3f6){return db[_0x5cd7('0x2f')][_0x5cd7('0x47')]({'where':{'id':_0xcc7ff0[_0x5cd7('0x46')]['id']}})[_0x5cd7('0x27')](handleEntityNotFound(_0x4fb3f6,null))[_0x5cd7('0x27')](removeEntity(_0x4fb3f6,null))[_0x5cd7('0x48')](handleError(_0x4fb3f6,null));};exports[_0x5cd7('0x4b')]=function(_0x176726,_0x24dca4){return db[_0x5cd7('0x2f')][_0x5cd7('0x4b')]()['then'](respondWithResult(_0x24dca4,null))[_0x5cd7('0x48')](handleError(_0x24dca4,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 67e3d7c..02ac403 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 _0x8093=['bluebird','request-promise','path','rimraf','../../config/environment','exports','uniqueid','lodash','../../config/logger','moment'];(function(_0x6ab427,_0x29624b){var _0x56c53d=function(_0x17d833){while(--_0x17d833){_0x6ab427['push'](_0x6ab427['shift']());}};_0x56c53d(++_0x29624b);}(_0x8093,0xed));var _0x3809=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0x8093[_0x50148e];return _0x446e9d;};'use strict';var _=require(_0x3809('0x0'));var util=require('util');var logger=require(_0x3809('0x1'))('api');var moment=require(_0x3809('0x2'));var BPromise=require(_0x3809('0x3'));var rp=require(_0x3809('0x4'));var fs=require('fs');var path=require(_0x3809('0x5'));var rimraf=require(_0x3809('0x6'));var config=require(_0x3809('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x3809('0x8')]=function(_0x5e8219,_0x52f46f){return _0x5e8219['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x3809('0x9'),'fields':[_0x3809('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a9c=['moment','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger'];(function(_0x474682,_0x5be70a){var _0x318cea=function(_0x33458d){while(--_0x33458d){_0x474682['push'](_0x474682['shift']());}};_0x318cea(++_0x5be70a);}(_0x9a9c,0x1cc));var _0xc9a9=function(_0x3306d8,_0x11d42a){_0x3306d8=_0x3306d8-0x0;var _0x39e559=_0x9a9c[_0x3306d8];return _0x39e559;};'use strict';var _=require(_0xc9a9('0x0'));var util=require('util');var logger=require(_0xc9a9('0x1'))('api');var moment=require(_0xc9a9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc9a9('0x3'));var config=require(_0xc9a9('0x4'));var attributes=require(_0xc9a9('0x5'));module[_0xc9a9('0x6')]=function(_0x2b129b,_0x28762e){return _0x2b129b[_0xc9a9('0x7')](_0xc9a9('0x8'),attributes,{'tableName':_0xc9a9('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc9a9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index f8f4542..cd3d5fd 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 _0x44a9=['debug','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x42fce6,_0x32523d){var _0x2f6395=function(_0x459310){while(--_0x459310){_0x42fce6['push'](_0x42fce6['shift']());}};_0x2f6395(++_0x32523d);}(_0x44a9,0xbe));var _0x944a=function(_0x41a6de,_0x1c329d){_0x41a6de=_0x41a6de-0x0;var _0xd6e28=_0x44a9[_0x41a6de];return _0xd6e28;};'use strict';var _=require(_0x944a('0x0'));var util=require(_0x944a('0x1'));var moment=require(_0x944a('0x2'));var BPromise=require(_0x944a('0x3'));var rs=require(_0x944a('0x4'));var fs=require('fs');var Redis=require(_0x944a('0x5'));var db=require(_0x944a('0x6'))['db'];var utils=require(_0x944a('0x7'));var logger=require(_0x944a('0x8'))(_0x944a('0x9'));var config=require(_0x944a('0xa'));var jayson=require(_0x944a('0xb'));var client=jayson[_0x944a('0xc')][_0x944a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x29bc31,_0x17fb69,_0x15921e){return new BPromise(function(_0xff2577,_0x10c423){return client['request'](_0x29bc31,_0x15921e)[_0x944a('0xe')](function(_0x2250d3){logger[_0x944a('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x17fb69,_0x944a('0x10'));logger[_0x944a('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x17fb69,_0x944a('0x10'),JSON[_0x944a('0x12')](_0x2250d3));if(_0x2250d3[_0x944a('0x13')]){if(_0x2250d3[_0x944a('0x13')][_0x944a('0x14')]===0x1f4){logger[_0x944a('0x13')](_0x944a('0x15'),_0x17fb69,_0x2250d3[_0x944a('0x13')][_0x944a('0x16')]);return _0x10c423(_0x2250d3[_0x944a('0x13')][_0x944a('0x16')]);}logger[_0x944a('0x13')](_0x944a('0x15'),_0x17fb69,_0x2250d3[_0x944a('0x13')][_0x944a('0x16')]);return _0xff2577(_0x2250d3[_0x944a('0x13')][_0x944a('0x16')]);}else{logger[_0x944a('0xf')](_0x944a('0x15'),_0x17fb69,_0x944a('0x10'));_0xff2577(_0x2250d3['result'][_0x944a('0x16')]);}})['catch'](function(_0x3eb5d6){logger[_0x944a('0x13')](_0x944a('0x15'),_0x17fb69,_0x3eb5d6);_0x10c423(_0x3eb5d6);});});} \ No newline at end of file +var _0x5e95=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x5c77a2,_0x210516){var _0x2ca643=function(_0x169006){while(--_0x169006){_0x5c77a2['push'](_0x5c77a2['shift']());}};_0x2ca643(++_0x210516);}(_0x5e95,0x69));var _0x55e9=function(_0x5d76a8,_0x4c85f2){_0x5d76a8=_0x5d76a8-0x0;var _0x181a39=_0x5e95[_0x5d76a8];return _0x181a39;};'use strict';var _=require(_0x55e9('0x0'));var util=require(_0x55e9('0x1'));var moment=require(_0x55e9('0x2'));var BPromise=require(_0x55e9('0x3'));var rs=require(_0x55e9('0x4'));var fs=require('fs');var Redis=require(_0x55e9('0x5'));var db=require(_0x55e9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x55e9('0x7'))(_0x55e9('0x8'));var config=require('../../config/environment');var jayson=require(_0x55e9('0x9'));var client=jayson[_0x55e9('0xa')][_0x55e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d858e,_0x210a29,_0x3fbd7a){return new BPromise(function(_0x3f4038,_0x2c44da){return client[_0x55e9('0xc')](_0x3d858e,_0x3fbd7a)[_0x55e9('0xd')](function(_0x1d06d4){logger[_0x55e9('0xe')](_0x55e9('0xf'),_0x210a29,_0x55e9('0x10'));logger[_0x55e9('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x210a29,_0x55e9('0x10'),JSON['stringify'](_0x1d06d4));if(_0x1d06d4[_0x55e9('0x12')]){if(_0x1d06d4[_0x55e9('0x12')][_0x55e9('0x13')]===0x1f4){logger[_0x55e9('0x12')](_0x55e9('0xf'),_0x210a29,_0x1d06d4[_0x55e9('0x12')]['message']);return _0x2c44da(_0x1d06d4[_0x55e9('0x12')]['message']);}logger['error'](_0x55e9('0xf'),_0x210a29,_0x1d06d4[_0x55e9('0x12')][_0x55e9('0x14')]);return _0x3f4038(_0x1d06d4['error'][_0x55e9('0x14')]);}else{logger[_0x55e9('0xe')](_0x55e9('0xf'),_0x210a29,_0x55e9('0x10'));_0x3f4038(_0x1d06d4['result'][_0x55e9('0x14')]);}})['catch'](function(_0x4fcada){logger[_0x55e9('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x210a29,_0x4fcada);_0x2c44da(_0x4fcada);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index a3b1d8b..e5be4e0 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 _0xabfb=['isAuthenticated','/describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xabfb,0x12f));var _0xbabf=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0xabfb[_0x212bf5];return _0xfcad21;};'use strict';var multer=require(_0xbabf('0x0'));var util=require(_0xbabf('0x1'));var path=require(_0xbabf('0x2'));var timeout=require(_0xbabf('0x3'));var express=require(_0xbabf('0x4'));var router=express[_0xbabf('0x5')]();var fs_extra=require(_0xbabf('0x6'));var auth=require(_0xbabf('0x7'));var interaction=require(_0xbabf('0x8'));var config=require(_0xbabf('0x9'));var controller=require(_0xbabf('0xa'));router[_0xbabf('0xb')]('/',auth[_0xbabf('0xc')](),controller['index']);router[_0xbabf('0xb')](_0xbabf('0xd'),auth[_0xbabf('0xc')](),controller['describe']);router[_0xbabf('0xb')](_0xbabf('0xe'),auth[_0xbabf('0xc')](),controller[_0xbabf('0xf')]);router['post']('/',auth[_0xbabf('0xc')](),controller[_0xbabf('0x10')]);router[_0xbabf('0x11')](_0xbabf('0xe'),auth[_0xbabf('0xc')](),controller['update']);router[_0xbabf('0x12')](_0xbabf('0xe'),auth[_0xbabf('0xc')](),controller[_0xbabf('0x13')]);module[_0xbabf('0x14')]=router; \ No newline at end of file +var _0x14e5=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','Router','../../config/environment'];(function(_0x557fe7,_0x4ceb59){var _0x1a4cb1=function(_0x1133a7){while(--_0x1133a7){_0x557fe7['push'](_0x557fe7['shift']());}};_0x1a4cb1(++_0x4ceb59);}(_0x14e5,0x9c));var _0x514e=function(_0x2caf3a,_0x1d65d6){_0x2caf3a=_0x2caf3a-0x0;var _0x34f044=_0x14e5[_0x2caf3a];return _0x34f044;};'use strict';var multer=require(_0x514e('0x0'));var util=require(_0x514e('0x1'));var path=require(_0x514e('0x2'));var timeout=require(_0x514e('0x3'));var express=require('express');var router=express[_0x514e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x514e('0x5'));var controller=require(_0x514e('0x6'));router[_0x514e('0x7')]('/',auth[_0x514e('0x8')](),controller[_0x514e('0x9')]);router[_0x514e('0x7')](_0x514e('0xa'),auth['isAuthenticated'](),controller[_0x514e('0xb')]);router['get'](_0x514e('0xc'),auth[_0x514e('0x8')](),controller[_0x514e('0xd')]);router[_0x514e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x514e('0xf')](_0x514e('0xc'),auth[_0x514e('0x8')](),controller[_0x514e('0x10')]);router['delete'](_0x514e('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x514e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index edd40fe..9073017 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 _0x0713=['offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','alternate','#fafafa','System','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}}','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x3071('0x0')]={'name':{'type':Sequelize[_0x3071('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'unique':_0x3071('0x2')},'description':{'type':Sequelize[_0x3071('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x3')},'mapKeyOffline':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x3')},'key':{'type':Sequelize[_0x3071('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x4')},'customerAlias':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3071('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3071('0x1')]},'animation':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3071('0x9')]('rounded',_0x3071('0xa')),'defaultValue':_0x3071('0xb')},'header_online':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0xc')},'start_chat_button':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0xe')},'download_transcript':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3071('0xf')]},'closingQuestion':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x12')},'noteTitle':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x14')},'closingMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x15')},'closingMessageButton':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0xd')},'skipMessageButton':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x16')},'conditionAgreement':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3071('0x9')]('star',_0x3071('0x17')),'defaultValue':_0x3071('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3071('0xf')],'defaultValue':function(){return JSON[_0x3071('0x19')]({'items':[{'type':_0x3071('0x1a'),'variable':null,'config':{'placeholder':_0x3071('0x1b'),'type':_0x3071('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x3071('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x3071('0x3'),'type':_0x3071('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3071('0x1d')](_0x3071('0x1e'))?JSON[_0x3071('0x1f')](this[_0x3071('0x1d')](_0x3071('0x1e'))):{};},'set':function(_0x1de5fb){return this['setDataValue'](_0x3071('0x1e'),JSON[_0x3071('0x19')](_0x1de5fb));}},'offlineForm':{'type':Sequelize[_0x3071('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3071('0x1a'),'props':{'title':_0x3071('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x3071('0x3'),'type':_0x3071('0x3')},'variable':null},{'type':_0x3071('0x20'),'config':{'placeholder':_0x3071('0x21')},'props':{'title':_0x3071('0x21'),'helpText':_0x3071('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x3071('0x1d')](_0x3071('0x23'))?JSON[_0x3071('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x9e26d1){return this[_0x3071('0x24')](_0x3071('0x23'),JSON[_0x3071('0x19')](_0x9e26d1));}},'token':{'type':Sequelize[_0x3071('0x1')],'defaultValue':function(){return rs[_0x3071('0x25')]();}},'autoclose':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3071('0x1')]},'waitingTitle':{'type':Sequelize[_0x3071('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x29')},'skipUnmanaged':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x16')},'sendUnmanaged':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3071('0x1')]},'notificationTemplate':{'type':Sequelize[_0x3071('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3071('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3071('0x1')],'defaultValue':_0x3071('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3071('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2b')},'verticalAlignment':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2c')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2d')},'defaultTitle':{'type':Sequelize[_0x3071('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3071('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3071('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3071('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3071('0x2f')},'systemAvatar':{'type':Sequelize[_0x3071('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3071('0x7')],'comment':_0x3071('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x3071('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x53ed25){if(!_0x53ed25)this[_0x3071('0x24')](_0x3071('0x31'),null);this[_0x3071('0x24')](_0x3071('0x32'),_0x53ed25);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3071('0x1')]},'vidaooTopic':{'type':Sequelize[_0x3071('0x1')],'allowNull':![],'defaultValue':_0x3071('0x33')},'vidaooNote':{'type':Sequelize[_0x3071('0x1')],'defaultValue':function(){return _0x3071('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x3071('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3071('0xf')]}}; \ No newline at end of file +var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x55d764,_0x4e515e){var _0x424a2f=function(_0x51df68){while(--_0x51df68){_0x55d764['push'](_0x55d764['shift']());}};_0x424a2f(++_0x4e515e);}(_0x9f62,0x154));var _0x29f6=function(_0x400d25,_0x1a37cd){_0x400d25=_0x400d25-0x0;var _0x513682=_0x9f62[_0x400d25];return _0x513682;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index b76c20e..00644fc 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 _0xb208=['orderBy','applications','priority','asc','Contacts','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','MailAccount','spread','readFileSync','utf8','render','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','User','Owner','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','getProactiveActions','../../config/license/util','increment','Intervals','all','some','remote','x-real-ip','remoteAddress','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','IntervalId','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','Contact','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','Disposition','findOne','order','include','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','ChatApplication','account','Applications'];(function(_0x56dd58,_0xb1287d){var _0x103e75=function(_0x369507){while(--_0x369507){_0x56dd58['push'](_0x56dd58['shift']());}};_0x103e75(++_0xb1287d);}(_0xb208,0x8e));var _0x8b20=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb208[_0x138adb];return _0x1b27f2;};'use strict';var BPromise=require(_0x8b20('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0x8b20('0x1'));var fs=require('fs');var fs_extra=require(_0x8b20('0x2'));var _=require(_0x8b20('0x3'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x8b20('0x4'));var logger=require(_0x8b20('0x5'))(_0x8b20('0x6'));var config=require(_0x8b20('0x7'));var db=require('../../mysqldb')['db'];config[_0x8b20('0x8')]=_[_0x8b20('0x9')](config[_0x8b20('0x8')],{'host':_0x8b20('0xa'),'port':0x18eb});var socket=require(_0x8b20('0xb'))(new Redis(config[_0x8b20('0x8')]));require(_0x8b20('0xc'))[_0x8b20('0xd')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x8b20('0xe')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x8b20('0xe')][_0x8b20('0xf')]({'port':0x232b});var client9001=jayson[_0x8b20('0xe')]['http']({'port':0x2329});function respondWithRpcPromise(_0x16df97,_0x123acf,_0x1a52fa,_0x109ddc){return new BPromise(function(_0x1917c9,_0x25ac09){var _0x23ca76=_0x109ddc||client;return _0x23ca76[_0x8b20('0x10')](_0x16df97,_0x1a52fa)[_0x8b20('0x11')](function(_0x4c6958){logger[_0x8b20('0x12')](_0x8b20('0x13'),_0x123acf,_0x8b20('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x123acf,'request\x20sent',JSON[_0x8b20('0x15')](_0x4c6958));if(_0x4c6958[_0x8b20('0x16')]){if(_0x4c6958[_0x8b20('0x16')][_0x8b20('0x17')]===0x1f4){logger[_0x8b20('0x16')](_0x8b20('0x13'),_0x123acf,_0x4c6958['error'][_0x8b20('0x18')]);return _0x25ac09(_0x4c6958[_0x8b20('0x16')][_0x8b20('0x18')]);}logger[_0x8b20('0x16')](_0x8b20('0x13'),_0x123acf,_0x4c6958['error'][_0x8b20('0x18')]);return _0x1917c9(_0x4c6958[_0x8b20('0x16')][_0x8b20('0x18')]);}else{logger['info'](_0x8b20('0x13'),_0x123acf,_0x8b20('0x14'));_0x1917c9(_0x4c6958[_0x8b20('0x19')][_0x8b20('0x18')]);}})[_0x8b20('0x1a')](function(_0xf8c04){logger[_0x8b20('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x123acf,_0xf8c04);_0x25ac09(_0xf8c04);});});}function respondWithStatusCode(_0x229c93,_0x234e23){_0x234e23=_0x234e23||0xcc;return function(_0x5283dc){if(_0x5283dc){return _0x229c93[_0x8b20('0x1b')](_0x234e23);}return _0x229c93[_0x8b20('0x1c')](_0x234e23)['end']();};}function respondWithResult(_0x7b593f,_0x32c16f){_0x32c16f=_0x32c16f||0xc8;return function(_0x5de866){if(_0x5de866){return _0x7b593f[_0x8b20('0x1c')](_0x32c16f)[_0x8b20('0x1d')](_0x5de866);}};}function respondWithFilteredResult(_0x27c7b2,_0x4d8d4d){return function(_0x1c3eba){if(_0x1c3eba){var _0x1801b3=typeof _0x4d8d4d[_0x8b20('0x1e')]==='undefined'&&typeof _0x4d8d4d[_0x8b20('0x1f')]===_0x8b20('0x20');var _0x2e83c3=_0x1c3eba[_0x8b20('0x21')];var _0x1a45b7=_0x1801b3?0x0:_0x4d8d4d[_0x8b20('0x1e')];var _0x41c802=_0x1801b3?_0x1c3eba[_0x8b20('0x21')]:_0x4d8d4d[_0x8b20('0x1e')]+_0x4d8d4d['limit'];var _0x4b71f2;if(_0x41c802>=_0x2e83c3){_0x41c802=_0x2e83c3;_0x4b71f2=0xc8;}else{_0x4b71f2=0xce;}_0x27c7b2[_0x8b20('0x1c')](_0x4b71f2);return _0x27c7b2['set'](_0x8b20('0x22'),_0x1a45b7+'-'+_0x41c802+'/'+_0x2e83c3)[_0x8b20('0x1d')](_0x1c3eba);}return null;};}function saveUpdates(_0x38757d){return function(_0x2b3775){if(_0x2b3775){return _0x2b3775['update'](_0x38757d)[_0x8b20('0x11')](function(_0x2637da){return _0x2637da;});}return null;};}function removeEntity(_0x3972e8){return function(_0x46c941){if(_0x46c941){return _0x46c941[_0x8b20('0x23')]()[_0x8b20('0x11')](function(){var _0x396795=_0x46c941[_0x8b20('0x24')]({'plain':!![]});var _0x141837=_0x8b20('0x25');return db[_0x8b20('0x26')][_0x8b20('0x23')]({'where':{'type':_0x141837,'resourceId':_0x396795['id']}})['then'](function(){return _0x46c941;});})['then'](function(){_0x3972e8['status'](0xcc)[_0x8b20('0x27')]();});}};}function handleEntityNotFound(_0x6796cc){return function(_0x2ac755){if(!_0x2ac755){_0x6796cc[_0x8b20('0x1b')](0x194);}return _0x2ac755;};}function handleError(_0x1844ec,_0x39d0da){_0x39d0da=_0x39d0da||0x1f4;return function(_0x584032){logger[_0x8b20('0x16')](_0x584032[_0x8b20('0x28')]);if(_0x584032['name']){delete _0x584032[_0x8b20('0x29')];}_0x1844ec[_0x8b20('0x1c')](_0x39d0da)[_0x8b20('0x2a')](_0x584032);};}exports[_0x8b20('0x2b')]=function(_0x173ef7,_0x52c707){var _0x9aa2ba={'include':[{'model':db[_0x8b20('0x2c')],'as':_0x8b20('0x2d')}]},_0x11c7c6={},_0x307990={'count':0x0,'rows':[]};var _0x3a3022=_[_0x8b20('0x2e')](db[_0x8b20('0x2f')][_0x8b20('0x30')],function(_0x424a56){return{'name':_0x424a56[_0x8b20('0x31')],'type':_0x424a56[_0x8b20('0x32')][_0x8b20('0x33')]};});_0x11c7c6[_0x8b20('0x34')]=_[_0x8b20('0x2e')](_0x3a3022,'name');_0x11c7c6['query']=_[_0x8b20('0x35')](_0x173ef7[_0x8b20('0x36')]);_0x11c7c6[_0x8b20('0x37')]=_[_0x8b20('0x38')](_0x11c7c6[_0x8b20('0x34')],_0x11c7c6[_0x8b20('0x36')]);_0x9aa2ba['attributes']=_[_0x8b20('0x38')](_0x11c7c6[_0x8b20('0x34')],qs[_0x8b20('0x39')](_0x173ef7['query'][_0x8b20('0x39')]));_0x9aa2ba[_0x8b20('0x3a')]=_0x9aa2ba[_0x8b20('0x3a')]['length']?_0x9aa2ba[_0x8b20('0x3a')]:_0x11c7c6[_0x8b20('0x34')];if(!_0x173ef7[_0x8b20('0x36')][_0x8b20('0x3b')](_0x8b20('0x3c'))){_0x9aa2ba['limit']=qs['limit'](_0x173ef7[_0x8b20('0x36')][_0x8b20('0x1f')]);_0x9aa2ba[_0x8b20('0x1e')]=qs['offset'](_0x173ef7['query'][_0x8b20('0x1e')]);}_0x9aa2ba['order']=qs['sort'](_0x173ef7[_0x8b20('0x36')][_0x8b20('0x3d')]);_0x9aa2ba[_0x8b20('0x3e')]=qs['filters'](_[_0x8b20('0x3f')](_0x173ef7[_0x8b20('0x36')],_0x11c7c6[_0x8b20('0x37')]),_0x3a3022);if(_0x173ef7['query'][_0x8b20('0x40')]){_0x9aa2ba[_0x8b20('0x3e')]=_[_0x8b20('0x41')](_0x9aa2ba[_0x8b20('0x3e')],{'$or':_['map'](_0x3a3022,function(_0x2690dc){if(_0x2690dc[_0x8b20('0x32')]!==_0x8b20('0x42')){var _0x53b068={};_0x53b068[_0x2690dc[_0x8b20('0x29')]]={'$like':'%'+_0x173ef7[_0x8b20('0x36')][_0x8b20('0x40')]+'%'};return _0x53b068;}})});}_0x9aa2ba=_['merge']({},_0x9aa2ba,_0x173ef7[_0x8b20('0x43')]);var _0x3775bb={'where':_0x9aa2ba[_0x8b20('0x3e')]};return db[_0x8b20('0x2f')]['count'](_0x3775bb)[_0x8b20('0x11')](function(_0x5aff33){_0x307990[_0x8b20('0x21')]=_0x5aff33;if(_0x173ef7[_0x8b20('0x36')][_0x8b20('0x44')]){_0x9aa2ba['include']=[{'all':!![]}];}return db[_0x8b20('0x2f')][_0x8b20('0x45')](_0x9aa2ba);})[_0x8b20('0x11')](function(_0x5ebfad){_0x307990['rows']=_0x5ebfad;return _0x307990;})['then'](respondWithFilteredResult(_0x52c707,_0x9aa2ba))[_0x8b20('0x1a')](handleError(_0x52c707,null));};exports[_0x8b20('0x46')]=function(_0x5c48e4,_0x28fcbe){var _0xccb3a8={'raw':![],'where':{'id':_0x5c48e4[_0x8b20('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0x8b20('0x2d')}]},_0x5ac4b4={};_0x5ac4b4[_0x8b20('0x34')]=_[_0x8b20('0x35')](db['ChatWebsite'][_0x8b20('0x30')]);_0x5ac4b4[_0x8b20('0x36')]=_[_0x8b20('0x35')](_0x5c48e4[_0x8b20('0x36')]);_0x5ac4b4['filters']=_[_0x8b20('0x38')](_0x5ac4b4[_0x8b20('0x34')],_0x5ac4b4[_0x8b20('0x36')]);_0xccb3a8[_0x8b20('0x3a')]=_[_0x8b20('0x38')](_0x5ac4b4[_0x8b20('0x34')],qs['fields'](_0x5c48e4['query']['fields']));_0xccb3a8[_0x8b20('0x3a')]=_0xccb3a8[_0x8b20('0x3a')][_0x8b20('0x48')]?_0xccb3a8[_0x8b20('0x3a')]:_0x5ac4b4[_0x8b20('0x34')];if(_0x5c48e4['query'][_0x8b20('0x44')]){_0xccb3a8['include']=[{'all':!![]}];}_0xccb3a8=_[_0x8b20('0x41')]({},_0xccb3a8,_0x5c48e4['options']);return db[_0x8b20('0x2f')]['find'](_0xccb3a8)[_0x8b20('0x11')](handleEntityNotFound(_0x28fcbe,null))[_0x8b20('0x11')](respondWithResult(_0x28fcbe,null))[_0x8b20('0x1a')](handleError(_0x28fcbe,null));};exports[_0x8b20('0x49')]=function(_0x21aae6,_0x26a283){return db[_0x8b20('0x2f')][_0x8b20('0x49')](_0x21aae6[_0x8b20('0x4a')],{})[_0x8b20('0x11')](function(_0x41431d){var _0x19a79f=_0x21aae6[_0x8b20('0x4b')][_0x8b20('0x24')]({'plain':!![]});if(!_0x19a79f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a79f[_0x8b20('0x4c')]===_0x8b20('0x4b')){var _0x1608b9=_0x41431d['get']({'plain':!![]});var _0x48fa7e=_0x8b20('0x25');return db[_0x8b20('0x4d')][_0x8b20('0x4e')]({'where':{'name':_0x48fa7e,'userProfileId':_0x19a79f[_0x8b20('0x4f')]},'raw':!![]})[_0x8b20('0x11')](function(_0x59fe5e){if(_0x59fe5e&&_0x59fe5e[_0x8b20('0x50')]===0x0){return db[_0x8b20('0x26')]['create']({'name':_0x1608b9[_0x8b20('0x29')],'resourceId':_0x1608b9['id'],'type':_0x59fe5e[_0x8b20('0x29')],'sectionId':_0x59fe5e['id']},{})[_0x8b20('0x11')](function(){return _0x41431d;});}else{return _0x41431d;}})[_0x8b20('0x1a')](function(_0x100bb0){logger[_0x8b20('0x16')](_0x8b20('0x51'),_0x100bb0);throw _0x100bb0;});}return _0x41431d;})[_0x8b20('0x11')](respondWithResult(_0x26a283,0xc9))['catch'](handleError(_0x26a283,null));};exports[_0x8b20('0x52')]=function(_0x280fc7,_0x5cfc90){if(_0x280fc7[_0x8b20('0x4a')]['id']){delete _0x280fc7[_0x8b20('0x4a')]['id'];}return db[_0x8b20('0x2f')][_0x8b20('0x4e')]({'where':{'id':_0x280fc7[_0x8b20('0x47')]['id']},'include':[{'model':db[_0x8b20('0x2c')],'as':_0x8b20('0x2d')}]})[_0x8b20('0x11')](handleEntityNotFound(_0x5cfc90,null))[_0x8b20('0x11')](saveUpdates(_0x280fc7[_0x8b20('0x4a')],null))[_0x8b20('0x11')](respondWithResult(_0x5cfc90,null))[_0x8b20('0x1a')](handleError(_0x5cfc90,null));};exports[_0x8b20('0x23')]=function(_0x4d7204,_0x4618ea){return db[_0x8b20('0x2f')][_0x8b20('0x4e')]({'where':{'id':_0x4d7204['params']['id']}})['then'](handleEntityNotFound(_0x4618ea,null))[_0x8b20('0x11')](removeEntity(_0x4618ea,null))[_0x8b20('0x1a')](handleError(_0x4618ea,null));};exports[_0x8b20('0x53')]=function(_0x3a7c4e,_0x2c7a7c){return db[_0x8b20('0x2f')][_0x8b20('0x53')]()[_0x8b20('0x11')](respondWithResult(_0x2c7a7c,null))[_0x8b20('0x1a')](handleError(_0x2c7a7c,null));};exports['addDisposition']=function(_0x35eed4,_0x33c9e3){if(_0x35eed4[_0x8b20('0x4a')]['id']){delete _0x35eed4['body']['id'];}return db[_0x8b20('0x2f')][_0x8b20('0x4e')]({'where':{'id':_0x35eed4['params']['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x33c9e3,null))['then'](function(_0x3ac579){if(_0x3ac579){_0x35eed4['body'][_0x8b20('0x54')]=_0x3ac579['id'];return db[_0x8b20('0x55')][_0x8b20('0x49')](_0x35eed4[_0x8b20('0x4a')]);}})[_0x8b20('0x11')](respondWithResult(_0x33c9e3,null))[_0x8b20('0x1a')](handleError(_0x33c9e3,null));};exports['getDispositions']=function(_0x302b89,_0x2f515f){var _0x1a7541={'raw':![],'where':{}};var _0x36c16d={};var _0x146fd8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8b20('0x56')]({'where':{'id':_0x302b89[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x2f515f,null))[_0x8b20('0x11')](function(_0x5b66b6){if(_0x5b66b6){_0x36c16d[_0x8b20('0x34')]=_[_0x8b20('0x35')](db[_0x8b20('0x55')][_0x8b20('0x30')]);_0x36c16d['query']=_['keys'](_0x302b89[_0x8b20('0x36')]);_0x36c16d[_0x8b20('0x37')]=_['intersection'](_0x36c16d['model'],_0x36c16d[_0x8b20('0x36')]);_0x1a7541['attributes']=_['intersection'](_0x36c16d[_0x8b20('0x34')],qs[_0x8b20('0x39')](_0x302b89['query'][_0x8b20('0x39')]));_0x1a7541[_0x8b20('0x3a')]=_0x1a7541[_0x8b20('0x3a')]['length']?_0x1a7541[_0x8b20('0x3a')]:_0x36c16d[_0x8b20('0x34')];if(!_0x302b89[_0x8b20('0x36')][_0x8b20('0x3b')](_0x8b20('0x3c'))){_0x1a7541['limit']=qs['limit'](_0x302b89[_0x8b20('0x36')][_0x8b20('0x1f')]);_0x1a7541['offset']=qs[_0x8b20('0x1e')](_0x302b89[_0x8b20('0x36')][_0x8b20('0x1e')]);}_0x1a7541[_0x8b20('0x57')]=qs[_0x8b20('0x3d')](_0x302b89[_0x8b20('0x36')]['sort']);_0x1a7541[_0x8b20('0x3e')]=qs[_0x8b20('0x37')](_[_0x8b20('0x3f')](_0x302b89[_0x8b20('0x36')],_0x36c16d['filters']));_0x1a7541[_0x8b20('0x3e')][_0x8b20('0x54')]=_0x5b66b6['id'];if(_0x302b89[_0x8b20('0x36')][_0x8b20('0x40')]){_0x1a7541[_0x8b20('0x3e')]=_[_0x8b20('0x41')](_0x1a7541[_0x8b20('0x3e')],{'$or':_['map'](_0x1a7541[_0x8b20('0x3a')],function(_0x583cbe){var _0x184dd8={};_0x184dd8[_0x583cbe]={'$like':'%'+_0x302b89['query']['filter']+'%'};return _0x184dd8;})});}_0x1a7541=_['merge']({},_0x1a7541,_0x302b89[_0x8b20('0x43')]);return db[_0x8b20('0x55')]['count']({'where':_0x1a7541['where']})[_0x8b20('0x11')](function(_0x5efa11){_0x146fd8[_0x8b20('0x21')]=_0x5efa11;if(_0x302b89[_0x8b20('0x36')]['includeAll']){_0x1a7541[_0x8b20('0x58')]=[{'all':!![]}];}return db[_0x8b20('0x55')]['findAll'](_0x1a7541);})[_0x8b20('0x11')](function(_0x522e48){_0x146fd8[_0x8b20('0x59')]=_0x522e48;return _0x146fd8;});}})[_0x8b20('0x11')](respondWithFilteredResult(_0x2f515f,_0x1a7541))['catch'](handleError(_0x2f515f,null));};exports[_0x8b20('0x5a')]=function(_0x12f75b,_0x2f9dcb){return db['ChatWebsite'][_0x8b20('0x4e')]({'where':{'id':_0x12f75b[_0x8b20('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f9dcb,null))[_0x8b20('0x11')](function(_0x737e73){if(_0x737e73){return _0x737e73[_0x8b20('0x5a')](_0x12f75b[_0x8b20('0x36')][_0x8b20('0x5b')]);}})[_0x8b20('0x11')](respondWithStatusCode(_0x2f9dcb,null))[_0x8b20('0x1a')](handleError(_0x2f9dcb,null));};exports['addAnswer']=function(_0x46ee62,_0x1b6df2){if(_0x46ee62[_0x8b20('0x4a')]['id']){delete _0x46ee62[_0x8b20('0x4a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x46ee62[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x1b6df2,null))[_0x8b20('0x11')](function(_0x5a1334){if(_0x5a1334){_0x46ee62[_0x8b20('0x4a')]['ChatWebsiteId']=_0x5a1334['id'];return db[_0x8b20('0x5c')][_0x8b20('0x49')](_0x46ee62['body']);}})[_0x8b20('0x11')](respondWithResult(_0x1b6df2,null))['catch'](handleError(_0x1b6df2,null));};exports[_0x8b20('0x5d')]=function(_0x4516f4,_0x5a55b8){var _0x4d0c3d={'raw':![],'where':{}};var _0x185b6f={};var _0x2c9370={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8b20('0x56')]({'where':{'id':_0x4516f4['params']['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x5a55b8,null))[_0x8b20('0x11')](function(_0x5980af){if(_0x5980af){_0x185b6f[_0x8b20('0x34')]=_['keys'](db[_0x8b20('0x5c')][_0x8b20('0x30')]);_0x185b6f[_0x8b20('0x36')]=_['keys'](_0x4516f4[_0x8b20('0x36')]);_0x185b6f[_0x8b20('0x37')]=_[_0x8b20('0x38')](_0x185b6f[_0x8b20('0x34')],_0x185b6f[_0x8b20('0x36')]);_0x4d0c3d[_0x8b20('0x3a')]=_[_0x8b20('0x38')](_0x185b6f[_0x8b20('0x34')],qs[_0x8b20('0x39')](_0x4516f4['query'][_0x8b20('0x39')]));_0x4d0c3d['attributes']=_0x4d0c3d[_0x8b20('0x3a')][_0x8b20('0x48')]?_0x4d0c3d['attributes']:_0x185b6f[_0x8b20('0x34')];if(!_0x4516f4[_0x8b20('0x36')]['hasOwnProperty'](_0x8b20('0x3c'))){_0x4d0c3d[_0x8b20('0x1f')]=qs['limit'](_0x4516f4['query'][_0x8b20('0x1f')]);_0x4d0c3d[_0x8b20('0x1e')]=qs[_0x8b20('0x1e')](_0x4516f4['query'][_0x8b20('0x1e')]);}_0x4d0c3d['order']=qs[_0x8b20('0x3d')](_0x4516f4[_0x8b20('0x36')]['sort']);_0x4d0c3d[_0x8b20('0x3e')]=qs['filters'](_[_0x8b20('0x3f')](_0x4516f4['query'],_0x185b6f[_0x8b20('0x37')]));_0x4d0c3d['where'][_0x8b20('0x54')]=_0x5980af['id'];if(_0x4516f4[_0x8b20('0x36')][_0x8b20('0x40')]){_0x4d0c3d[_0x8b20('0x3e')]=_[_0x8b20('0x41')](_0x4d0c3d[_0x8b20('0x3e')],{'$or':_[_0x8b20('0x2e')](_0x4d0c3d[_0x8b20('0x3a')],function(_0x21c7e1){var _0x1ae1eb={};_0x1ae1eb[_0x21c7e1]={'$like':'%'+_0x4516f4[_0x8b20('0x36')]['filter']+'%'};return _0x1ae1eb;})});}_0x4d0c3d=_['merge']({},_0x4d0c3d,_0x4516f4['options']);return db[_0x8b20('0x5c')][_0x8b20('0x21')]({'where':_0x4d0c3d[_0x8b20('0x3e')]})[_0x8b20('0x11')](function(_0x378b21){_0x2c9370[_0x8b20('0x21')]=_0x378b21;if(_0x4516f4[_0x8b20('0x36')]['includeAll']){_0x4d0c3d[_0x8b20('0x58')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4d0c3d);})[_0x8b20('0x11')](function(_0xc1eb20){_0x2c9370[_0x8b20('0x59')]=_0xc1eb20;return _0x2c9370;});}})['then'](respondWithFilteredResult(_0x5a55b8,_0x4d0c3d))[_0x8b20('0x1a')](handleError(_0x5a55b8,null));};exports[_0x8b20('0x5e')]=function(_0x5eff5e,_0x4103b8){return db[_0x8b20('0x2f')][_0x8b20('0x4e')]({'where':{'id':_0x5eff5e[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x4103b8,null))[_0x8b20('0x11')](function(_0x1c3067){if(_0x1c3067){return _0x1c3067[_0x8b20('0x5e')](_0x5eff5e[_0x8b20('0x36')][_0x8b20('0x5b')]);}})[_0x8b20('0x11')](respondWithStatusCode(_0x4103b8,null))['catch'](handleError(_0x4103b8,null));};exports[_0x8b20('0x5f')]=function(_0xbcc531,_0x202cc5){_0xbcc531[_0x8b20('0x4a')][_0x8b20('0x60')]=_0xbcc531[_0x8b20('0x61')]['filename'];return db[_0x8b20('0x2f')]['find']({'where':{'id':_0xbcc531[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x202cc5,null))[_0x8b20('0x11')](saveUpdates(_0xbcc531[_0x8b20('0x4a')],null))[_0x8b20('0x11')](respondWithResult(_0x202cc5,null))[_0x8b20('0x1a')](handleError(_0x202cc5,null));};exports[_0x8b20('0x62')]=function(_0x45e56b,_0x3eb61b){_0x45e56b[_0x8b20('0x4a')][_0x8b20('0x63')]=_0x45e56b[_0x8b20('0x61')][_0x8b20('0x64')];return db['ChatWebsite'][_0x8b20('0x4e')]({'where':{'id':_0x45e56b[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x3eb61b,null))[_0x8b20('0x11')](saveUpdates(_0x45e56b['body'],null))['then'](respondWithResult(_0x3eb61b,null))['catch'](handleError(_0x3eb61b,null));};exports[_0x8b20('0x65')]=function(_0x4f9221,_0xdd7d91){_0x4f9221[_0x8b20('0x4a')]['customerAvatar']=_0x4f9221[_0x8b20('0x61')][_0x8b20('0x64')];return db['ChatWebsite'][_0x8b20('0x4e')]({'where':{'id':_0x4f9221[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0xdd7d91,null))[_0x8b20('0x11')](saveUpdates(_0x4f9221[_0x8b20('0x4a')],null))[_0x8b20('0x11')](respondWithResult(_0xdd7d91,null))[_0x8b20('0x1a')](handleError(_0xdd7d91,null));};exports[_0x8b20('0x66')]=function(_0x1db650,_0x415990){_0x1db650[_0x8b20('0x4a')][_0x8b20('0x67')]=_0x1db650[_0x8b20('0x61')][_0x8b20('0x64')];return db[_0x8b20('0x2f')]['find']({'where':{'id':_0x1db650[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x415990,null))['then'](saveUpdates(_0x1db650[_0x8b20('0x4a')],null))[_0x8b20('0x11')](respondWithResult(_0x415990,null))['catch'](handleError(_0x415990,null));};exports[_0x8b20('0x68')]=function(_0x526def,_0x5777c0){var _0x30ee94=path[_0x8b20('0x69')](config[_0x8b20('0x6a')],_0x8b20('0x6b'));var _0xb814cd={'where':{'id':_0x526def['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xa03f83=![];return require('../../config/license/util')[_0x8b20('0x6c')]()[_0x8b20('0x11')](function(_0x41f32e){if(_0x41f32e){_0xa03f83=_0x41f32e[_0x8b20('0x6d')];}})[_0x8b20('0x11')](function(){return db[_0x8b20('0x2f')][_0x8b20('0x4e')](_0xb814cd);})[_0x8b20('0x11')](handleEntityNotFound(_0x5777c0,null))[_0x8b20('0x11')](function(_0x4cad80){if(_0x4cad80){if(!_[_0x8b20('0x6e')](_0x4cad80[_0x8b20('0x60')])){if(fs[_0x8b20('0x6f')](path[_0x8b20('0x69')](config[_0x8b20('0x6a')],_0x8b20('0x70'),_0x4cad80[_0x8b20('0x60')]))&&_0xa03f83){_0x30ee94=path['join'](config[_0x8b20('0x6a')],_0x8b20('0x70'),_0x4cad80[_0x8b20('0x60')]);}}return _0x5777c0[_0x8b20('0x71')](_0x30ee94);}})[_0x8b20('0x1a')](handleError(_0x5777c0,null));};exports[_0x8b20('0x72')]=function(_0xb05b76,_0x1a5d29){var _0x40e2d3=path['join'](config['root'],_0x8b20('0x73'));var _0x4e177c={'where':{'id':_0xb05b76[_0x8b20('0x47')]['id']},'attributes':['id',_0x8b20('0x63')],'raw':!![]};return db[_0x8b20('0x2f')][_0x8b20('0x4e')](_0x4e177c)[_0x8b20('0x11')](handleEntityNotFound(_0x1a5d29,null))[_0x8b20('0x11')](function(_0x3794dc){if(_0x3794dc){if(!_[_0x8b20('0x6e')](_0x3794dc['agentAvatar'])){if(fs[_0x8b20('0x6f')](path[_0x8b20('0x69')](config[_0x8b20('0x6a')],_0x8b20('0x74'),_0x3794dc[_0x8b20('0x63')]))){_0x40e2d3=path['join'](config[_0x8b20('0x6a')],_0x8b20('0x74'),_0x3794dc[_0x8b20('0x63')]);}}return _0x1a5d29['download'](_0x40e2d3);}})[_0x8b20('0x1a')](handleError(_0x1a5d29,null));};exports[_0x8b20('0x75')]=function(_0x27e6d2,_0x1e9a71){var _0x541b60=path['join'](config[_0x8b20('0x6a')],_0x8b20('0x76'));var _0x3648e5={'where':{'id':_0x27e6d2[_0x8b20('0x47')]['id']},'attributes':['id',_0x8b20('0x77'),_0x8b20('0x78')],'raw':!![]};return db[_0x8b20('0x2f')]['find'](_0x3648e5)[_0x8b20('0x11')](handleEntityNotFound(_0x1e9a71,null))[_0x8b20('0x11')](function(_0x26894d){if(_0x26894d){if(!_[_0x8b20('0x6e')](_0x26894d['customerAvatar'])){if(fs[_0x8b20('0x6f')](path[_0x8b20('0x69')](config['root'],'server/files/images/avatars/',_0x26894d[_0x8b20('0x77')]))&&_0x26894d[_0x8b20('0x78')]){_0x541b60=path[_0x8b20('0x69')](config[_0x8b20('0x6a')],_0x8b20('0x74'),_0x26894d[_0x8b20('0x77')]);}}return _0x1e9a71[_0x8b20('0x71')](_0x541b60);}})[_0x8b20('0x1a')](handleError(_0x1e9a71,null));};exports['getSystemAvatar']=function(_0x5c07b2,_0xe28fc){var _0x113ea6=path['join'](config['root'],_0x8b20('0x79'));var _0x396ca7={'where':{'id':_0x5c07b2['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x8b20('0x4e')](_0x396ca7)['then'](handleEntityNotFound(_0xe28fc,null))[_0x8b20('0x11')](function(_0x111849){if(_0x111849){if(!_[_0x8b20('0x6e')](_0x111849['systemAvatar'])){if(fs['existsSync'](path[_0x8b20('0x69')](config['root'],'server/files/images/avatars/',_0x111849['systemAvatar']))){_0x113ea6=path[_0x8b20('0x69')](config[_0x8b20('0x6a')],_0x8b20('0x74'),_0x111849[_0x8b20('0x67')]);}}return _0xe28fc[_0x8b20('0x71')](_0x113ea6);}})[_0x8b20('0x1a')](handleError(_0xe28fc,null));};exports['notify']=function(_0x54c20f,_0x1c6cc9){var _0x372800=require(_0x8b20('0x7a'));var _0x2f7a37=new _0x372800();var _0x254864=_0x2f7a37[_0x8b20('0x7b')](_0x54c20f[_0x8b20('0x7c')][_0x8b20('0x7d')])[_0x8b20('0x7e')]();var _0x361912={'body':_0x54c20f[_0x8b20('0x4a')],'channel':_0x8b20('0x7f')};var _0x364da5=[];var _0x23d3c6=[];var _0x7ff704={};var _0x560c5c=![];return db[_0x8b20('0x80')][_0x8b20('0x53')]()[_0x8b20('0x11')](function(_0x13c57e){if(!_0x13c57e){throw new db['Sequelize'][(_0x8b20('0x81'))]('no\x20available\x20attributes');}_0x364da5=_[_0x8b20('0x82')](_[_0x8b20('0x35')](_0x13c57e),[_0x8b20('0x83'),_0x8b20('0x84')]);_0x23d3c6=_[_0x8b20('0x82')](_[_0x8b20('0x35')](_0x13c57e),[_0x8b20('0x83'),_0x8b20('0x84'),_0x8b20('0x85'),'ListId']);if(_0x54c20f[_0x8b20('0x4a')]['id']){delete _0x54c20f[_0x8b20('0x4a')]['id'];}if(_[_0x8b20('0x6e')](_0x54c20f[_0x8b20('0x4a')]['from'])){throw new db[(_0x8b20('0x86'))][(_0x8b20('0x81'))](_0x8b20('0x87'));}if(_['isNil'](_0x54c20f['body'][_0x8b20('0x4a')])||_0x54c20f[_0x8b20('0x4a')][_0x8b20('0x4a')]===''){throw new db[(_0x8b20('0x86'))][(_0x8b20('0x81'))](_0x8b20('0x88'));}if(_[_0x8b20('0x6e')](_0x54c20f[_0x8b20('0x4a')][_0x8b20('0x89')])){throw new db['Sequelize']['ValidationError'](_0x8b20('0x8a')+_0x23d3c6);}if(!_[_0x8b20('0x8b')](_0x23d3c6,_0x54c20f[_0x8b20('0x4a')]['mapKey'])){throw new db['Sequelize'][(_0x8b20('0x81'))](_0x8b20('0x8c')+_0x23d3c6);}_0x7ff704[_0x54c20f[_0x8b20('0x4a')][_0x8b20('0x89')]]=_0x54c20f[_0x8b20('0x4a')][_0x8b20('0x8d')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x54c20f[_0x8b20('0x47')]['id']},'include':[{'model':db[_0x8b20('0x8e')],'as':_0x8b20('0x8f'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x7ff704,'limit':0x1,'order':[[_0x8b20('0x84'),_0x8b20('0x90')]]}]},{'model':db[_0x8b20('0x91')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1c6cc9,null))['then'](function(_0x5663cc){if(_0x5663cc&&_0x5663cc[_0x8b20('0x8f')]){_0x361912[_0x8b20('0x92')]=_0x5663cc;_0x361912['applications']=_0x5663cc[_0x8b20('0x93')];_0x361912['list']=_0x5663cc[_0x8b20('0x8f')];_0x361912['applications']=_[_0x8b20('0x94')](_0x361912[_0x8b20('0x95')],[_0x8b20('0x96')],[_0x8b20('0x97')]);if(_0x361912['account']['Applications']){delete _0x361912[_0x8b20('0x92')][_0x8b20('0x93')];}if(_0x361912[_0x8b20('0x92')][_0x8b20('0x8f')]&&_0x361912['account'][_0x8b20('0x8f')][_0x8b20('0x98')]['length']){return _0x361912[_0x8b20('0x92')][_0x8b20('0x8f')][_0x8b20('0x98')][0x0];}var _0x127004=_[_0x8b20('0x9')](_0x54c20f[_0x8b20('0x4a')],{'firstName':_0x54c20f[_0x8b20('0x4a')]['from'],'ListId':_0x5663cc[_0x8b20('0x99')]});_0x127004[_0x54c20f[_0x8b20('0x4a')][_0x8b20('0x89')]]=_0x54c20f[_0x8b20('0x4a')]['from'];return db[_0x8b20('0x80')][_0x8b20('0x49')](_0x127004,{'fields':_0x364da5,'raw':!![]});}})[_0x8b20('0x11')](handleEntityNotFound(_0x1c6cc9,null))['then'](function(_0x5b50de){_0x361912[_0x8b20('0x9a')]=_0x5b50de;var _0x2e99dc=_0x54c20f['body'][_0x8b20('0x9b')];if(_0x54c20f[_0x8b20('0x7c')][_0x8b20('0x9c')]){_0x2e99dc=_0x54c20f[_0x8b20('0x7c')][_0x8b20('0x9c')];}else if(_0x54c20f[_0x8b20('0x7c')][_0x8b20('0x9d')]){_0x2e99dc=_[_0x8b20('0x9e')](_0x54c20f['headers']['x-forwarded-for'][_0x8b20('0x9f')](','));}if(_0x5b50de){var _0x8a04cc={'ContactId':_0x5b50de['id'],'ChatWebsiteId':_0x54c20f[_0x8b20('0x47')]['id'],'from':(_0x5b50de[_0x8b20('0xa0')]||'')+'\x20'+(_0x5b50de[_0x8b20('0xa1')]||''),'customerIp':_0x2e99dc,'customerPort':_0x54c20f[_0x8b20('0x7c')][_0x8b20('0xa2')]?_0x54c20f['headers'][_0x8b20('0xa2')]:null,'referer':_0x54c20f['body'][_0x8b20('0xa3')],'browserName':_0x254864[_0x8b20('0xa4')]['name']&&_0x254864['browser'][_0x8b20('0xa5')]?util[_0x8b20('0xa6')]('%s\x20%s',_0x254864['browser'][_0x8b20('0x29')],_0x254864['browser'][_0x8b20('0xa5')]):'unknown','browserVersion':_0x254864['browser']['version']||'unknown','osName':util['format'](_0x8b20('0xa7'),_0x254864['os'][_0x8b20('0x29')],_0x254864['os']['version']),'osVersion':_0x254864['os'][_0x8b20('0xa5')],'deviceModel':_0x254864['device'][_0x8b20('0x34')]&&_0x254864[_0x8b20('0xa8')][_0x8b20('0xa9')]?util['format'](_0x8b20('0xaa'),_0x254864[_0x8b20('0xa8')][_0x8b20('0x34')],_0x254864[_0x8b20('0xa8')][_0x8b20('0xa9')],_0x254864[_0x8b20('0xa8')][_0x8b20('0x32')]):null,'deviceVendor':_0x254864[_0x8b20('0xa8')][_0x8b20('0xa9')],'deviceType':_0x254864[_0x8b20('0xa8')][_0x8b20('0x32')],'formData':JSON['stringify'](_0x54c20f[_0x8b20('0x4a')])};var _0x5657b0={'ChatWebsiteId':_0x54c20f[_0x8b20('0x47')]['id'],'closed':![]};if(_0x54c20f[_0x8b20('0x4a')]['threadId']){_0x5657b0[_0x8b20('0xab')]=_0x54c20f[_0x8b20('0x4a')][_0x8b20('0xab')];return db[_0x8b20('0xac')][_0x8b20('0x4e')]({'where':_0x5657b0})[_0x8b20('0x11')](function(_0x2eb8a5){if(_0x2eb8a5){return[_0x2eb8a5,![]];}_0x8a04cc[_0x8b20('0xab')]=_0x54c20f['body'][_0x8b20('0xab')];_0x8a04cc[_0x8b20('0xad')]=_0x54c20f[_0x8b20('0x4a')][_0x8b20('0xad')];return db['ChatInteraction'][_0x8b20('0x49')](_0x8a04cc)[_0x8b20('0x11')](function(_0x50be75){return[_0x50be75,!![]];});});}_0x5657b0[_0x8b20('0xae')]=_0x5b50de['id'];if(_0x54c20f['body'][_0x8b20('0xaf')]&&_0x54c20f[_0x8b20('0x4a')][_0x8b20('0xaf')]['id']){_0x5657b0['id']=_0x54c20f['body'][_0x8b20('0xaf')]['id'];return db['ChatInteraction'][_0x8b20('0x4e')]({'where':_0x5657b0})[_0x8b20('0x11')](function(_0x49001b){if(_0x49001b){return[_0x49001b,![]];}return db[_0x8b20('0xac')][_0x8b20('0x49')](_0x8a04cc)['then'](function(_0x109e1d){return[_0x109e1d,!![]];});});}return db[_0x8b20('0xac')][_0x8b20('0x49')](_0x8a04cc)['then'](function(_0x21a01a){return[_0x21a01a,!![]];});}})['spread'](function(_0x5e81d8,_0x4ca66c){if(_0x5e81d8){_0x560c5c=_0x4ca66c;if(!_0x4ca66c){var _0x5c4a06={'from':(_0x361912[_0x8b20('0x9a')][_0x8b20('0xa0')]||'')+'\x20'+(_0x361912[_0x8b20('0x9a')][_0x8b20('0xa1')]||'')};if(_0x54c20f[_0x8b20('0x4a')][_0x8b20('0xab')]&&_0x54c20f[_0x8b20('0x4a')]['messageId']&&_0x54c20f[_0x8b20('0x4a')]['threadId']!=_0x54c20f['body'][_0x8b20('0xb0')]){_0x5c4a06[_0x8b20('0xab')]=_0x54c20f['body'][_0x8b20('0xb0')];}return _0x5e81d8[_0x8b20('0x52')](_0x5c4a06);}else{return _0x5e81d8;}}})[_0x8b20('0x11')](function(_0x138591){_0x361912[_0x8b20('0xaf')]=_0x138591['get']({'plain':!![]});_0x361912[_0x8b20('0xaf')][_0x8b20('0xb1')]=_0x560c5c;if(_0x361912[_0x8b20('0xaf')][_0x8b20('0xb1')]){if(_0x361912[_0x8b20('0x92')][_0x8b20('0xb2')]){_0x361912[_0x8b20('0x95')][_0x8b20('0xb3')]({'id':0x0,'priority':_0x361912[_0x8b20('0x95')][_0x8b20('0x48')]+0x1,'app':_0x8b20('0xb4'),'appdata':_0x8b20('0xb5'),'interval':_0x8b20('0xb6')});}}return db[_0x8b20('0xb7')][_0x8b20('0x49')]({'body':_0x54c20f['body']['body'],'ChatWebsiteId':_0x54c20f[_0x8b20('0x47')]['id'],'ChatInteractionId':_0x138591['id'],'direction':'in','ContactId':_0x361912[_0x8b20('0x9a')]['id'],'AttachmentId':_0x54c20f['body']['AttachmentId']});})['then'](function(_0x15fa8e){_0x361912[_0x8b20('0x18')]=_0x15fa8e;if(_0x361912[_0x8b20('0xaf')][_0x8b20('0xb8')]){return db['User']['find']({'attributes':['id',_0x8b20('0x29')],'where':{'id':_0x361912['interaction'][_0x8b20('0xb8')]}})['then'](function(_0x81ded9){if(_0x81ded9){_0x361912['applications'][_0x8b20('0xb9')]({'id':0x0,'priority':0x0,'app':_0x8b20('0xba'),'appdata':_0x81ded9[_0x8b20('0x29')]+','+(_0x361912[_0x8b20('0x92')][_0x8b20('0xbb')]||0xa),'interval':'*,*,*,*'});_0x361912[_0x8b20('0xbc')]=!![];}return respondWithRpcPromise(_0x8b20('0xbd'),'startRouting',_0x361912);});}return respondWithRpcPromise(_0x8b20('0xbd'),_0x8b20('0xbe'),_0x361912);})[_0x8b20('0x11')](function(_0x347a1b){respondWithRpcPromise(_0x8b20('0xbf'),_0x8b20('0xbf'),{'event':_0x8b20('0xc0'),'message':_0x347a1b},client9002);return _0x347a1b;})[_0x8b20('0x11')](respondWithResult(_0x1c6cc9,null))[_0x8b20('0x1a')](handleError(_0x1c6cc9,null));};exports[_0x8b20('0xc1')]=function(_0x228cd8,_0x191f14){var _0x314059,_0x421d53,_0x22c2d7;var _0x156ef9=[];var _0x1b5e7e={};var _0x1f14c5=_0x228cd8[_0x8b20('0xc2')]||[];var _0x444063=[];var _0x30e6f7;return db[_0x8b20('0x80')]['describe']()['then'](function(_0x29d5c2){if(!_0x29d5c2){throw new db['Sequelize'][(_0x8b20('0x81'))]('no\x20available\x20attributes');}_0x156ef9=_[_0x8b20('0x82')](_['keys'](_0x29d5c2),[_0x8b20('0x83'),_0x8b20('0x84'),_0x8b20('0x85'),_0x8b20('0x99')]);if(_0x228cd8[_0x8b20('0x4a')]['id']){delete _0x228cd8['body']['id'];}if(_[_0x8b20('0x6e')](_0x228cd8['body']['from'])){throw _0x191f14[_0x8b20('0x1c')](0x1f4)['send'](new db[(_0x8b20('0x86'))][(_0x8b20('0x81'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x228cd8[_0x8b20('0x4a')][_0x8b20('0x4a')])||_0x228cd8[_0x8b20('0x4a')]['body']===''){throw _0x191f14[_0x8b20('0x1c')](0x1f4)[_0x8b20('0x2a')](new db[(_0x8b20('0x86'))][(_0x8b20('0x81'))](_0x8b20('0x88')));}if(_[_0x8b20('0x6e')](_0x228cd8[_0x8b20('0x4a')][_0x8b20('0xc3')])){throw _0x191f14['status'](0x1f4)[_0x8b20('0x2a')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x156ef9));}if(!_[_0x8b20('0x8b')](_0x156ef9,_0x228cd8[_0x8b20('0x4a')][_0x8b20('0xc3')])){throw _0x191f14[_0x8b20('0x1c')](0x1f4)[_0x8b20('0x2a')](new db[(_0x8b20('0x86'))][(_0x8b20('0x81'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x156ef9));}_0x1b5e7e[_0x228cd8[_0x8b20('0x4a')][_0x8b20('0xc3')]]=_0x228cd8[_0x8b20('0x4a')][_0x8b20('0x8d')];})[_0x8b20('0x11')](function(){return db[_0x8b20('0x2f')][_0x8b20('0x4e')]({'where':{'id':_0x228cd8[_0x8b20('0x47')]['id']},'include':[{'model':db[_0x8b20('0x8e')],'as':_0x8b20('0x8f')},{'model':db[_0x8b20('0xc4')],'as':_0x8b20('0xc4')}]});})[_0x8b20('0x11')](handleEntityNotFound(_0x191f14,null))['then'](function(_0x48e4ac){if(_0x48e4ac&&_0x48e4ac[_0x8b20('0x8f')]){_0x421d53=_0x48e4ac;var _0x4e2d56=_[_0x8b20('0x9')](_0x228cd8[_0x8b20('0x4a')],{'firstName':_0x228cd8['body'][_0x8b20('0x8d')],'phone':_0x228cd8[_0x8b20('0x4a')]['from'],'ListId':_0x48e4ac['ListId']});_0x4e2d56[_0x228cd8[_0x8b20('0x4a')]['mapKeyOffline']]=_0x228cd8[_0x8b20('0x4a')][_0x8b20('0x8d')];return db[_0x8b20('0x80')]['findOrCreate']({'where':_0x1b5e7e,'defaults':_0x4e2d56});}})[_0x8b20('0xc5')](function(_0x40e69b){if(_0x40e69b){_0x22c2d7=_0x40e69b;var _0x4b2d59=fs[_0x8b20('0xc6')](path['join'](config[_0x8b20('0x6a')],'server/files/templates/chatOfflineMessage.ejs'),_0x8b20('0xc7'));var _0x2bc4d0=ejs[_0x8b20('0xc8')](_0x4b2d59,{'body':_['toPairs'](_0x228cd8[_0x8b20('0x4a')]['body']),'bodyTitle':_0x421d53['offlineMessageBody']});return db[_0x8b20('0xc9')]['create']({'body':_0x2bc4d0,'plainBody':htmlToText['fromString'](_0x2bc4d0),'ContactId':_0x40e69b['id'],'ChatWebsiteId':_0x421d53['id']});}})[_0x8b20('0x11')](function(_0x49cfff){_0x30e6f7=_0x49cfff;if(_0x1f14c5[_0x8b20('0x48')]){var _0x15983c=_0x1f14c5[_0x8b20('0x2e')](function(_0x3d9690){return{'name':_0x3d9690['originalname'],'basename':_0x3d9690[_0x8b20('0x64')],'type':_0x3d9690[_0x8b20('0xca')],'ChatOfflineMessageId':_0x49cfff['id']};});_0x444063=_0x15983c[_0x8b20('0x2e')](_0x19e8a3=>{var _0x48d78f={'filename':_0x19e8a3['name'],'path':path[_0x8b20('0x69')](config['root'],_0x8b20('0xcb'),_0x8b20('0xc2'),_0x8b20('0xcc'),_0x8b20('0xcd'),_0x19e8a3[_0x8b20('0xce')])};return _0x48d78f;});if(!_0x421d53[_0x8b20('0xcf')]){return db[_0x8b20('0xd0')][_0x8b20('0xd1')](function(_0x4bda89){return db[_0x8b20('0xd2')][_0x8b20('0xd3')](_0x15983c,{'transaction':_0x4bda89});});}}})[_0x8b20('0x11')](function(){if(_0x30e6f7){_0x314059=_0x30e6f7;return db[_0x8b20('0xc4')][_0x8b20('0x56')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8b20('0xd4'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8b20('0xd5'),'raw':!![]}]}]});}})['then'](function(_0x3685ef){if(_0x3685ef&&_0x3685ef[_0x8b20('0xd4')]&&_0x421d53[_0x8b20('0xd6')]&&_0x421d53[_0x8b20('0xd7')]){var _0x5d5cf2=_0x3685ef[_0x8b20('0xd8')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5d5cf2,'message':{'from':util[_0x8b20('0xa6')](_0x8b20('0xd9'),_0x3685ef[_0x8b20('0x29')],_0x3685ef[_0x8b20('0xda')]||_0x3685ef[_0x8b20('0xd4')]['user']),'to':_0x421d53[_0x8b20('0xd7')],'subject':_0x421d53[_0x8b20('0xdb')],'html':_0x314059[_0x8b20('0x4a')],'attachments':_0x444063}},client9003)[_0x8b20('0x11')](function(){return _0x314059;})[_0x8b20('0x1a')](function(_0x39acea){logger[_0x8b20('0x16')](_0x39acea);});}})['then'](function(){if(_0x421d53&&_0x421d53[_0x8b20('0xcf')]&&_0x421d53[_0x8b20('0xdc')]){var _0x4088b6=[];if(_0x1f14c5['length']){_0x4088b6=_0x1f14c5[_0x8b20('0x2e')](function(_0x147591){return{'name':_0x147591[_0x8b20('0xdd')],'basename':_0x147591[_0x8b20('0x64')],'type':_0x147591[_0x8b20('0xca')],'ChatOfflineMessageId':_0x30e6f7['id']};});}var _0x5c1c0e;if(!_[_0x8b20('0x6e')](_0x421d53['subjectOffline'])){var _0x14166a=_[_0x8b20('0x2e')](_0x228cd8[_0x8b20('0x4a')],function(_0x2e9bd5){return _0x2e9bd5;});var _0xa74436=_['toPairsIn'](_0x14166a)[0x0];var _0x2a0146=_[_0x8b20('0xde')](_0xa74436,function(_0x3fd145){return _0x3fd145;});_0x5c1c0e=_0x2a0146[0x1][_0x421d53[_0x8b20('0xdf')]];}var _0x2c8e35={'from':_0x22c2d7[_0x8b20('0xda')],'firstName':_0x22c2d7[_0x8b20('0xa0')],'lastName':_0x22c2d7[_0x8b20('0xa1')],'mapKey':_0x8b20('0xda'),'message':{'from':_0x22c2d7['email'],'to':_0x421d53[_0x8b20('0xc4')][_0x8b20('0xda')],'cc':'','subject':_['isNil'](_0x5c1c0e)?_0x421d53['offlineMessageSubject']:_0x5c1c0e,'messageId':'','sentAt':new Date(),'attach':_0x4088b6['length'],'attachments':_0x4088b6,'originChannel':_0x8b20('0xe0'),'ChatWebsiteId':_0x421d53['id'],'ChatOfflineMessageId':_0x314059['id'],'originTo':_0x421d53[_0x8b20('0xc4')][_0x8b20('0xda')]},'body':_0x314059['body']};var _0x2f270f={'account':{'id':_0x421d53[_0x8b20('0xdc')]},'body':_0x2c8e35,'log':_0x8b20('0xe1')};return respondWithRpcPromise(_0x8b20('0xe1'),_0x8b20('0xe2'),_0x2f270f,client9001)[_0x8b20('0x11')](function(){return _0x314059;})[_0x8b20('0x1a')](function(_0x40cd95){logger[_0x8b20('0x16')](_0x40cd95);});}return;})[_0x8b20('0x11')](function(){if(_0x314059){return _0x314059;}})[_0x8b20('0x11')](respondWithResult(_0x191f14,null))[_0x8b20('0x1a')](function(_0x212a44){logger[_0x8b20('0x16')]('catch',_0x212a44);for(var _0x571d66 of _0x1f14c5){var _0x29a048=path[_0x8b20('0x69')](config['root'],_0x8b20('0xcb'),_0x8b20('0xc2'),_0x8b20('0xcc'),'offline-chat',_0x571d66['filename']);fs_extra['remove'](_0x29a048)[_0x8b20('0x1a')](function(_0x5e1c76){logger[_0x8b20('0x16')](_0x8b20('0xe3'),_0x29a048,_0x5e1c76);});}});};exports['addInteraction']=function(_0x33bde0,_0x36f4ea){return db[_0x8b20('0xac')][_0x8b20('0x4e')]({'where':{'id':_0x33bde0['params']['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x36f4ea,null))[_0x8b20('0x11')](function(_0x3c80f9){if(_0x3c80f9){return _0x3c80f9[_0x8b20('0xe4')](_0x33bde0[_0x8b20('0x4a')][_0x8b20('0x5b')],_[_0x8b20('0xe5')](_0x33bde0[_0x8b20('0x4a')],[_0x8b20('0x5b'),'id'])||{});}})[_0x8b20('0x11')](respondWithResult(_0x36f4ea,null))[_0x8b20('0x1a')](handleError(_0x36f4ea,null));};exports['getInteractions']=function(_0x463c92,_0x1c00f6){var _0x4d94c4={'raw':![],'where':{}};var _0x1bd341={};var _0x21ce38={'count':0x0,'rows':[]};return db[_0x8b20('0x2f')][_0x8b20('0x56')]({'where':{'id':_0x463c92[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x1c00f6,null))[_0x8b20('0x11')](function(_0xd1c8d5){if(_0xd1c8d5){_0x1bd341[_0x8b20('0x34')]=_[_0x8b20('0x35')](db['ChatInteraction'][_0x8b20('0x30')]);_0x1bd341['query']=_[_0x8b20('0x35')](_0x463c92[_0x8b20('0x36')]);_0x1bd341['filters']=_[_0x8b20('0x38')](_0x1bd341[_0x8b20('0x34')],_0x1bd341[_0x8b20('0x36')]);_0x4d94c4[_0x8b20('0x3a')]=_[_0x8b20('0x38')](_0x1bd341['model'],qs[_0x8b20('0x39')](_0x463c92[_0x8b20('0x36')][_0x8b20('0x39')]));_0x4d94c4['attributes']=_0x4d94c4[_0x8b20('0x3a')][_0x8b20('0x48')]?_0x4d94c4[_0x8b20('0x3a')]:_0x1bd341[_0x8b20('0x34')];if(!_0x463c92[_0x8b20('0x36')][_0x8b20('0x3b')](_0x8b20('0x3c'))){_0x4d94c4[_0x8b20('0x1f')]=qs[_0x8b20('0x1f')](_0x463c92['query']['limit']);_0x4d94c4[_0x8b20('0x1e')]=qs[_0x8b20('0x1e')](_0x463c92[_0x8b20('0x36')]['offset']);}_0x4d94c4[_0x8b20('0x57')]=qs[_0x8b20('0x3d')](_0x463c92['query'][_0x8b20('0x3d')]);_0x4d94c4[_0x8b20('0x3e')]=qs['filters'](_['pick'](_0x463c92[_0x8b20('0x36')],_0x1bd341['filters']));_0x4d94c4['where']['ChatWebsiteId']=_0xd1c8d5['id'];if(_0x463c92['query'][_0x8b20('0x40')]){_0x4d94c4[_0x8b20('0x3e')]=_[_0x8b20('0x41')](_0x4d94c4[_0x8b20('0x3e')],{'$or':_[_0x8b20('0x2e')](_0x4d94c4['attributes'],function(_0x2516f6){var _0x19ee60={};_0x19ee60[_0x2516f6]={'$like':'%'+_0x463c92['query'][_0x8b20('0x40')]+'%'};return _0x19ee60;})});}_0x4d94c4=_[_0x8b20('0x41')]({},_0x4d94c4,_0x463c92['options']);return db[_0x8b20('0xac')][_0x8b20('0x21')]({'where':_0x4d94c4[_0x8b20('0x3e')]})[_0x8b20('0x11')](function(_0x28929b){_0x21ce38[_0x8b20('0x21')]=_0x28929b;if(_0x463c92['query'][_0x8b20('0x44')]){_0x4d94c4[_0x8b20('0x58')]=[{'model':db[_0x8b20('0x80')],'as':'Contact','required':![]},{'model':db[_0x8b20('0xe6')],'as':_0x8b20('0xe7'),'attributes':[_0x8b20('0x29'),'fullname',_0x8b20('0xe8')],'required':![]},{'model':db[_0x8b20('0xe9')],'as':_0x8b20('0xea'),'attributes':['id',_0x8b20('0x29'),_0x8b20('0xeb')],'where':_0x463c92[_0x8b20('0x36')][_0x8b20('0xec')]?{'id':_0x463c92[_0x8b20('0x36')][_0x8b20('0xec')]}:undefined,'required':_0x463c92[_0x8b20('0x36')]['tag']?!![]:![]}];}return db[_0x8b20('0xac')]['findAll'](_0x4d94c4);})[_0x8b20('0x11')](function(_0x33798a){_0x21ce38[_0x8b20('0x59')]=_0x33798a;return _0x21ce38;});}})['then'](respondWithFilteredResult(_0x1c00f6,_0x4d94c4))[_0x8b20('0x1a')](handleError(_0x1c00f6,null));};function iftimePromise(_0x1139e6,_0x4f630c){return respondWithRpcPromise(_0x8b20('0xed'),'getSnippet',{'command':_0x4f630c['timezone']?util[_0x8b20('0xa6')](_0x8b20('0xee'),_0x1139e6[_0x8b20('0xef')],_0x4f630c[_0x8b20('0xf0')]):util[_0x8b20('0xa6')](_0x8b20('0xf1'),_0x1139e6['interval'])},client9002)[_0x8b20('0x11')](function(_0x1caf6f){var _0x328119=_0x1caf6f&&_0x1caf6f[_0x8b20('0xf2')](_0x8b20('0xf3'))>=0x0?!![]:![];logger[_0x8b20('0x12')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4f630c['id'],_0x1139e6['id'],_0x1139e6[_0x8b20('0xef')],_0x328119?_0x8b20('0xf4'):_0x8b20('0xf5'),_0x4f630c[_0x8b20('0xf0')]?_0x4f630c[_0x8b20('0xf0')]:_0x8b20('0xf6'));return _0x328119;})[_0x8b20('0x1a')](function(_0xf72771){logger[_0x8b20('0x16')](_0x8b20('0xf7'),_0x4f630c['id'],_0x1139e6['id'],_0x1139e6['interval'],util[_0x8b20('0xf8')](_0xf72771,{'showHidden':![],'depth':null}),_0x4f630c[_0x8b20('0xf0')]?_0x4f630c[_0x8b20('0xf0')]:_0x8b20('0xf6'));return![];});}exports[_0x8b20('0xf9')]=function(_0xbe2c8a,_0x3434e9){var _0x2b83e9=0x0;var _0x5e8f14=0x0;var _0xe7f0e4=![];var _0x28cf7b;var _0x154366;return db['ChatWebsite'][_0x8b20('0x4e')]({'where':{'id':_0xbe2c8a[_0x8b20('0x47')]['id']},'include':[{'model':db[_0x8b20('0xfa')],'as':_0x8b20('0xfa'),'include':[{'model':db[_0x8b20('0xfa')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3434e9,null))[_0x8b20('0x11')](function(_0x4d8237){if(_0x4d8237){_0x28cf7b=_0x4d8237;return _0x4d8237[_0x8b20('0xfb')]({'raw':!![]});}})[_0x8b20('0x11')](function(_0x37f030){if(_0x28cf7b){if(_0x37f030){_0x154366=_0x37f030;}}return require(_0x8b20('0xfc'))['getLicense']();})[_0x8b20('0x11')](function(_0x2b222a){if(_0x2b222a){_0x5e8f14=_0x2b222a['virtual'];_0xe7f0e4=_0x2b222a[_0x8b20('0x6d')];}})['then'](function(){return db['ChatInteraction'][_0x8b20('0x21')]({'where':{'closed':![]}});})[_0x8b20('0x11')](function(_0x1b252e){_0x2b83e9=_0x1b252e;if(_0x5e8f14&&_0x1b252e>_0x5e8f14){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0x5aef5a){if(_0x5aef5a){_0x5aef5a[_0x8b20('0xfd')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x28cf7b[_0x8b20('0xfa')]&&_0x28cf7b['Interval'][_0x8b20('0xfe')]){var _0x4860f2=[];for(var _0x419af1=0x0;_0x419af1<_0x28cf7b[_0x8b20('0xfa')][_0x8b20('0xfe')][_0x8b20('0x48')];_0x419af1++){var _0x1deae1=_0x28cf7b[_0x8b20('0xfa')][_0x8b20('0xfe')][_0x419af1][_0x8b20('0x24')]({'plain':!![]});_0x4860f2['push'](iftimePromise(_0x1deae1,_0x28cf7b));}return BPromise[_0x8b20('0xff')](_0x4860f2)['then'](function(_0xd238aa){return _[_0x8b20('0x100')](_0xd238aa);});}else{return!![];}})[_0x8b20('0x11')](function(_0x5d23c2){var _0x30a4a8=fs[_0x8b20('0xc6')](path[_0x8b20('0x69')](config['root'],'server/files/chat/iframe.ejs'),_0x8b20('0xc7'));var _0x398d41={'remote':_0x28cf7b[_0x8b20('0x101')],'query':querystring[_0x8b20('0x15')](_['merge'](_0x28cf7b[_0x8b20('0x24')]({'plain':!![]}),{'customerIp':_0xbe2c8a[_0x8b20('0x7c')][_0x8b20('0x9d')]||_0xbe2c8a[_0x8b20('0x7c')][_0x8b20('0x102')]||_0xbe2c8a['connection'][_0x8b20('0x103')]||_0xbe2c8a['ip'],'referer':_0xbe2c8a[_0x8b20('0x7c')][_0x8b20('0xa3')],'openedInteractions':_0x2b83e9,'maxInteractions':_0x5e8f14,'virtual':_0xe7f0e4[_0x8b20('0x104')],'online':_0x5d23c2,'custom':_0xe7f0e4}))['replace'](/'/g,'\x5c\x27')};_0x3434e9[_0x8b20('0x2a')](ejs[_0x8b20('0xc8')](Mustache[_0x8b20('0xc8')](_0x30a4a8,_0x398d41),{'proactiveActions':_0x154366,'alignment':_0x28cf7b[_0x8b20('0x105')],'verticalAlignment':_0x28cf7b[_0x8b20('0x106')],'div_color':_0x28cf7b[_0x8b20('0xeb')],'labelText':_0x28cf7b[_0x8b20('0x107')],'text_color':_0x28cf7b[_0x8b20('0x108')],'text_button_color':_0x28cf7b[_0x8b20('0x109')],'button_color':_0x28cf7b['color_button'],'background_color':_0x28cf7b[_0x8b20('0x10a')],'hideWhenOffline':_0x28cf7b['hideWhenOffline'],'interval':_0x28cf7b[_0x8b20('0x10b')]}));})[_0x8b20('0x1a')](handleError(_0x3434e9,null));};exports['addApplications']=function(_0x194e2e,_0x53ccf5){var _0x4609e9=_0x194e2e[_0x8b20('0x47')]['id'];var _0x1efaf9=_0x194e2e['body'];var _0x583ec1=0xc8;var _0x17c62f=null;return db[_0x8b20('0xd0')]['transaction']({'isolationLevel':db[_0x8b20('0xd0')][_0x8b20('0x10c')][_0x8b20('0x10d')]['READ_COMMITTED']},function(_0x5dbc5b){return db[_0x8b20('0x2f')][_0x8b20('0x56')]({'where':{'id':_0x4609e9},'transaction':_0x5dbc5b})[_0x8b20('0x11')](function(_0x355603){if(_0x355603){return db[_0x8b20('0x91')][_0x8b20('0x23')]({'where':{'ChatWebsiteId':_0x4609e9},'transaction':_0x5dbc5b})[_0x8b20('0x11')](function(){var _0x35b4a7=_['map'](_0x1efaf9,function(_0x5ac24f){_0x5ac24f[_0x8b20('0x54')]=_0x4609e9;return _0x5ac24f;});return db[_0x8b20('0x91')][_0x8b20('0xd3')](_0x35b4a7,{'transaction':_0x5dbc5b});});}else{_0x583ec1=0x194;_0x17c62f=[];}});})['then'](function(){if(_0x583ec1!==0x194){return db['ChatApplication'][_0x8b20('0x10e')]({'where':{'ChatWebsiteId':_0x4609e9},'order':'priority'})['then'](function(_0x1e057b){_0x17c62f=_0x1e057b;});}})[_0x8b20('0x1a')](function(_0x1775a2){_0x583ec1=0x1f4;logger['error'](_0x1775a2['stack']);if(_0x1775a2[_0x8b20('0x29')]){delete _0x1775a2[_0x8b20('0x29')];}_0x17c62f=_0x1775a2;})[_0x8b20('0x10f')](function(){if(_0x17c62f===null){_0x53ccf5[_0x8b20('0x1b')](_0x583ec1);}else{if(_0x583ec1===0x1f4){_0x53ccf5['status'](_0x583ec1)[_0x8b20('0x2a')](_0x17c62f);}else{_0x53ccf5[_0x8b20('0x1c')](_0x583ec1)[_0x8b20('0x1d')](_0x17c62f);}}});};exports[_0x8b20('0x110')]=function(_0x25096b,_0x281b01){var _0x18640a={};var _0x4302ca={};var _0xa80392;var _0x344048;return db[_0x8b20('0x2f')][_0x8b20('0x56')]({'where':{'id':_0x25096b[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x281b01,null))[_0x8b20('0x11')](function(_0x36f205){if(_0x36f205){_0xa80392=_0x36f205;_0x4302ca[_0x8b20('0x34')]=_[_0x8b20('0x35')](db[_0x8b20('0x91')][_0x8b20('0x30')]);_0x4302ca['query']=_['keys'](_0x25096b[_0x8b20('0x36')]);_0x4302ca['filters']=_[_0x8b20('0x38')](_0x4302ca['model'],_0x4302ca['query']);_0x18640a[_0x8b20('0x3a')]=_[_0x8b20('0x38')](_0x4302ca[_0x8b20('0x34')],qs[_0x8b20('0x39')](_0x25096b[_0x8b20('0x36')][_0x8b20('0x39')]));_0x18640a[_0x8b20('0x3a')]=_0x18640a[_0x8b20('0x3a')][_0x8b20('0x48')]?_0x18640a['attributes']:_0x4302ca[_0x8b20('0x34')];_0x18640a[_0x8b20('0x57')]=qs[_0x8b20('0x3d')](_0x25096b[_0x8b20('0x36')]['sort']);_0x18640a[_0x8b20('0x3e')]=qs[_0x8b20('0x37')](_[_0x8b20('0x3f')](_0x25096b[_0x8b20('0x36')],_0x4302ca[_0x8b20('0x37')]));if(_0x25096b[_0x8b20('0x36')][_0x8b20('0x40')]){_0x18640a[_0x8b20('0x3e')]=_['merge'](_0x18640a['where'],{'$or':_[_0x8b20('0x2e')](_0x18640a[_0x8b20('0x3a')],function(_0x5ac408){var _0x27a001={};_0x27a001[_0x5ac408]={'$like':'%'+_0x25096b[_0x8b20('0x36')][_0x8b20('0x40')]+'%'};return _0x27a001;})});}_0x18640a=_['merge']({},_0x18640a,_0x25096b['options']);return _0xa80392[_0x8b20('0x110')](_0x18640a);}})[_0x8b20('0x11')](function(_0x502cdd){if(_0x502cdd){_0x344048=_0x502cdd[_0x8b20('0x48')];if(!_0x25096b[_0x8b20('0x36')][_0x8b20('0x3b')]('nolimit')){_0x18640a[_0x8b20('0x1f')]=qs[_0x8b20('0x1f')](_0x25096b['query'][_0x8b20('0x1f')]);_0x18640a['offset']=qs[_0x8b20('0x1e')](_0x25096b['query'][_0x8b20('0x1e')]);}return _0xa80392[_0x8b20('0x110')](_0x18640a);}})[_0x8b20('0x11')](function(_0x330fe9){if(_0x330fe9){return _0x330fe9?{'count':_0x344048,'rows':_0x330fe9}:null;}})['then'](respondWithResult(_0x281b01,null))[_0x8b20('0x1a')](handleError(_0x281b01,null));};exports[_0x8b20('0x111')]=function(_0x16d340,_0x5ec120){return db[_0x8b20('0x112')][_0x8b20('0x4e')]({'where':{'id':_0x16d340['params']['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x5ec120,null))['then'](function(_0x3d9e27){if(_0x3d9e27){return _0x3d9e27['addProactiveActions'](_0x16d340[_0x8b20('0x4a')][_0x8b20('0x5b')],_[_0x8b20('0xe5')](_0x16d340[_0x8b20('0x4a')],[_0x8b20('0x5b'),'id'])||{});}})[_0x8b20('0x11')](respondWithResult(_0x5ec120,null))[_0x8b20('0x1a')](handleError(_0x5ec120,null));};exports['getProactiveActions']=function(_0x46cebf,_0xd49c9e){var _0xdba6c7={};var _0x156423={};var _0x46b1c8;var _0x4baae7;return db[_0x8b20('0x2f')][_0x8b20('0x56')]({'where':{'id':_0x46cebf['params']['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0xd49c9e,null))[_0x8b20('0x11')](function(_0x1e1a20){if(_0x1e1a20){_0x46b1c8=_0x1e1a20;_0x156423[_0x8b20('0x34')]=_[_0x8b20('0x35')](db[_0x8b20('0x113')][_0x8b20('0x30')]);_0x156423['query']=_[_0x8b20('0x35')](_0x46cebf[_0x8b20('0x36')]);_0x156423[_0x8b20('0x37')]=_['intersection'](_0x156423[_0x8b20('0x34')],_0x156423['query']);_0xdba6c7[_0x8b20('0x3a')]=_[_0x8b20('0x38')](_0x156423[_0x8b20('0x34')],qs['fields'](_0x46cebf[_0x8b20('0x36')][_0x8b20('0x39')]));_0xdba6c7[_0x8b20('0x3a')]=_0xdba6c7[_0x8b20('0x3a')][_0x8b20('0x48')]?_0xdba6c7[_0x8b20('0x3a')]:_0x156423[_0x8b20('0x34')];_0xdba6c7['order']=qs[_0x8b20('0x3d')](_0x46cebf['query'][_0x8b20('0x3d')]);_0xdba6c7[_0x8b20('0x3e')]=qs[_0x8b20('0x37')](_['pick'](_0x46cebf[_0x8b20('0x36')],_0x156423[_0x8b20('0x37')]));if(_0x46cebf[_0x8b20('0x36')][_0x8b20('0x40')]){_0xdba6c7['where']=_[_0x8b20('0x41')](_0xdba6c7[_0x8b20('0x3e')],{'$or':_[_0x8b20('0x2e')](_0xdba6c7[_0x8b20('0x3a')],function(_0x3c6675){var _0x260cda={};_0x260cda[_0x3c6675]={'$like':'%'+_0x46cebf[_0x8b20('0x36')][_0x8b20('0x40')]+'%'};return _0x260cda;})});}_0xdba6c7=_['merge']({},_0xdba6c7,_0x46cebf[_0x8b20('0x43')]);return _0x46b1c8['getProactiveActions'](_0xdba6c7);}})[_0x8b20('0x11')](function(_0x34807b){if(_0x34807b){_0x4baae7=_0x34807b['length'];if(!_0x46cebf[_0x8b20('0x36')][_0x8b20('0x3b')](_0x8b20('0x3c'))){_0xdba6c7[_0x8b20('0x1f')]=qs[_0x8b20('0x1f')](_0x46cebf[_0x8b20('0x36')][_0x8b20('0x1f')]);_0xdba6c7[_0x8b20('0x1e')]=qs[_0x8b20('0x1e')](_0x46cebf['query'][_0x8b20('0x1e')]);}return _0x46b1c8['getProactiveActions'](_0xdba6c7);}})[_0x8b20('0x11')](function(_0x535d1c){if(_0x535d1c){return _0x535d1c?{'count':_0x4baae7,'rows':_0x535d1c}:null;}})[_0x8b20('0x11')](respondWithResult(_0xd49c9e,null))[_0x8b20('0x1a')](handleError(_0xd49c9e,null));};exports['getFields']=function(_0x4f9d21,_0x36db49){var _0x2d44af=_0x4f9d21['query']['online']===_0x8b20('0x114')?_0x8b20('0x115'):_0x8b20('0x116');return db['ChatWebsite'][_0x8b20('0x4e')]({'attributes':['id',_0x2d44af],'where':{'id':_0x4f9d21[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x36db49,null))[_0x8b20('0x11')](function(_0xe49c50){if(_0xe49c50){var _0x2b2f74=_0xe49c50[_0x2d44af];var _0x5ed448=_0x2b2f74&&_0x2b2f74[_0x8b20('0x117')]?_0x2b2f74[_0x8b20('0x117')]:[];_0x36db49[_0x8b20('0x2a')]({'fromKey':_['isNil'](_0x2b2f74[_0x8b20('0x118')])?undefined:_0x2b2f74[_0x8b20('0x118')],'count':_0x5ed448['length'],'rows':_0x5ed448});}})['catch'](handleError(_0x36db49,null));};exports['getOfflineMessages']=function(_0x1f5e88,_0x1f1015){var _0x119e88={'raw':![],'where':{}};var _0x73cdc3={};var _0x3972cb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8b20('0x56')]({'where':{'id':_0x1f5e88[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x1f1015,null))['then'](function(_0x48635b){if(_0x48635b){_0x73cdc3[_0x8b20('0x34')]=_[_0x8b20('0x35')](db[_0x8b20('0xc9')][_0x8b20('0x30')]);_0x73cdc3[_0x8b20('0x36')]=_[_0x8b20('0x35')](_0x1f5e88[_0x8b20('0x36')]);_0x73cdc3['filters']=_[_0x8b20('0x38')](_0x73cdc3[_0x8b20('0x34')],_0x73cdc3[_0x8b20('0x36')]);_0x119e88[_0x8b20('0x3a')]=_[_0x8b20('0x38')](_0x73cdc3[_0x8b20('0x34')],qs['fields'](_0x1f5e88[_0x8b20('0x36')][_0x8b20('0x39')]));_0x119e88[_0x8b20('0x3a')]=_0x119e88['attributes'][_0x8b20('0x48')]?_0x119e88[_0x8b20('0x3a')]:_0x73cdc3['model'];if(!_0x1f5e88[_0x8b20('0x36')]['hasOwnProperty'](_0x8b20('0x3c'))){_0x119e88[_0x8b20('0x1f')]=qs[_0x8b20('0x1f')](_0x1f5e88[_0x8b20('0x36')][_0x8b20('0x1f')]);_0x119e88[_0x8b20('0x1e')]=qs[_0x8b20('0x1e')](_0x1f5e88[_0x8b20('0x36')][_0x8b20('0x1e')]);}_0x119e88[_0x8b20('0x57')]=qs[_0x8b20('0x3d')](_0x1f5e88[_0x8b20('0x36')][_0x8b20('0x3d')]);_0x119e88[_0x8b20('0x3e')]=qs[_0x8b20('0x37')](_[_0x8b20('0x3f')](_0x1f5e88[_0x8b20('0x36')],_0x73cdc3['filters']));_0x119e88[_0x8b20('0x3e')][_0x8b20('0x54')]=_0x48635b['id'];if(_0x1f5e88[_0x8b20('0x36')][_0x8b20('0x40')]){_0x119e88[_0x8b20('0x3e')]=_[_0x8b20('0x41')](_0x119e88['where'],{'$or':_['map'](_0x119e88[_0x8b20('0x3a')],function(_0x115355){var _0xf59143={};_0xf59143[_0x115355]={'$like':'%'+_0x1f5e88[_0x8b20('0x36')][_0x8b20('0x40')]+'%'};return _0xf59143;})});}_0x119e88=_[_0x8b20('0x41')]({},_0x119e88,_0x1f5e88['options']);return db[_0x8b20('0xc9')][_0x8b20('0x21')]({'where':_0x119e88[_0x8b20('0x3e')]})[_0x8b20('0x11')](function(_0x3c71a4){_0x3972cb['count']=_0x3c71a4;if(_0x1f5e88[_0x8b20('0x36')][_0x8b20('0x44')]){_0x119e88[_0x8b20('0x58')]=[{'all':!![]}];}else{_0x119e88[_0x8b20('0x58')]=[{'model':db[_0x8b20('0x80')],'as':_0x8b20('0x119'),'required':![]},{'model':db[_0x8b20('0xd2')],'as':_0x8b20('0x11a'),'required':![]}];}return db[_0x8b20('0xc9')][_0x8b20('0x45')](_0x119e88);})['then'](function(_0x94afa0){_0x3972cb['rows']=_0x94afa0;return _0x3972cb;});}})[_0x8b20('0x11')](respondWithFilteredResult(_0x1f1015,_0x119e88))[_0x8b20('0x1a')](handleError(_0x1f1015,null));};exports[_0x8b20('0x11b')]=function(_0x36dfc6,_0x3390ea){return db[_0x8b20('0x2f')][_0x8b20('0x4e')]({'where':{'id':_0x36dfc6['params']['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x3390ea,null))[_0x8b20('0x11')](function(_0x168773){if(_0x168773){return _0x168773[_0x8b20('0x11b')](_0x36dfc6['body'][_0x8b20('0x5b')],_['omit'](_0x36dfc6[_0x8b20('0x4a')],['ids','id'])||{})[_0x8b20('0xc5')](function(_0x1438bb){for(var _0x9e8dc5=0x0;_0x9e8dc5<_0x36dfc6[_0x8b20('0x4a')][_0x8b20('0x5b')][_0x8b20('0x48')];_0x9e8dc5+=0x1){socket['emit'](_0x8b20('0x11c'),{'UserId':Number(_0x36dfc6[_0x8b20('0x4a')]['ids'][_0x9e8dc5]),'ChatWebsiteId':Number(_0x36dfc6[_0x8b20('0x47')]['id'])});}return _0x1438bb;});}})[_0x8b20('0x11')](respondWithResult(_0x3390ea,null))[_0x8b20('0x1a')](handleError(_0x3390ea,null));};exports[_0x8b20('0x11d')]=function(_0x263cd4,_0x2245f1){return db['ChatWebsite'][_0x8b20('0x4e')]({'where':{'id':_0x263cd4['params']['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x2245f1,null))[_0x8b20('0x11')](function(_0x104940){if(_0x104940){return _0x104940[_0x8b20('0x11d')](_0x263cd4['query'][_0x8b20('0x5b')])[_0x8b20('0x11')](function(){if(_[_0x8b20('0x11e')](_0x263cd4['query'][_0x8b20('0x5b')])){for(var _0x248a4b=0x0;_0x248a4b<_0x263cd4[_0x8b20('0x36')][_0x8b20('0x5b')]['length'];_0x248a4b+=0x1){socket[_0x8b20('0x11f')](_0x8b20('0x120'),{'UserId':Number(_0x263cd4[_0x8b20('0x36')][_0x8b20('0x5b')][_0x248a4b]),'ChatWebsiteId':Number(_0x263cd4['params']['id'])});}}else{socket[_0x8b20('0x11f')](_0x8b20('0x120'),{'UserId':Number(_0x263cd4[_0x8b20('0x36')][_0x8b20('0x5b')]),'ChatWebsiteId':Number(_0x263cd4[_0x8b20('0x47')]['id'])});}});}})[_0x8b20('0x11')](respondWithStatusCode(_0x2245f1,null))[_0x8b20('0x1a')](handleError(_0x2245f1,null));};exports[_0x8b20('0x121')]=function(_0x1c1e3c,_0x1f92b2){var _0xe46e9f={};var _0x5de451={};var _0x38f0f4;var _0x1e7252;return db[_0x8b20('0x2f')]['findOne']({'where':{'id':_0x1c1e3c[_0x8b20('0x47')]['id']}})[_0x8b20('0x11')](handleEntityNotFound(_0x1f92b2,null))[_0x8b20('0x11')](function(_0x49f35c){if(_0x49f35c){_0x38f0f4=_0x49f35c;_0x5de451[_0x8b20('0x34')]=_[_0x8b20('0x35')](db[_0x8b20('0xe6')]['rawAttributes']);_0x5de451[_0x8b20('0x36')]=_['keys'](_0x1c1e3c['query']);_0x5de451[_0x8b20('0x37')]=_['intersection'](_0x5de451[_0x8b20('0x34')],_0x5de451[_0x8b20('0x36')]);_0xe46e9f[_0x8b20('0x3a')]=_['intersection'](_0x5de451[_0x8b20('0x34')],qs[_0x8b20('0x39')](_0x1c1e3c['query']['fields']));_0xe46e9f[_0x8b20('0x3a')]=_0xe46e9f[_0x8b20('0x3a')][_0x8b20('0x48')]?_0xe46e9f[_0x8b20('0x3a')]:_0x5de451['model'];_0xe46e9f[_0x8b20('0x57')]=qs[_0x8b20('0x3d')](_0x1c1e3c['query'][_0x8b20('0x3d')]);_0xe46e9f[_0x8b20('0x3e')]=qs[_0x8b20('0x37')](_['pick'](_0x1c1e3c[_0x8b20('0x36')],_0x5de451['filters']));if(_0x1c1e3c[_0x8b20('0x36')][_0x8b20('0x40')]){_0xe46e9f['where']=_[_0x8b20('0x41')](_0xe46e9f['where'],{'$or':_[_0x8b20('0x2e')](_0xe46e9f[_0x8b20('0x3a')],function(_0x556bca){var _0x41198a={};_0x41198a[_0x556bca]={'$like':'%'+_0x1c1e3c['query']['filter']+'%'};return _0x41198a;})});}_0xe46e9f=_[_0x8b20('0x41')]({},_0xe46e9f,_0x1c1e3c[_0x8b20('0x43')]);return _0x38f0f4['getAgents'](_0xe46e9f);}})[_0x8b20('0x11')](function(_0x55f76b){if(_0x55f76b){_0x1e7252=_0x55f76b[_0x8b20('0x48')];if(!_0x1c1e3c[_0x8b20('0x36')]['hasOwnProperty']('nolimit')){_0xe46e9f[_0x8b20('0x1f')]=qs['limit'](_0x1c1e3c[_0x8b20('0x36')][_0x8b20('0x1f')]);_0xe46e9f['offset']=qs[_0x8b20('0x1e')](_0x1c1e3c[_0x8b20('0x36')]['offset']);}return _0x38f0f4[_0x8b20('0x121')](_0xe46e9f);}})[_0x8b20('0x11')](function(_0x3698df){if(_0x3698df){return _0x3698df?{'count':_0x1e7252,'rows':_0x3698df}:null;}})['then'](respondWithResult(_0x1f92b2,null))[_0x8b20('0x1a')](handleError(_0x1f92b2,null));}; \ No newline at end of file +var _0x4926=['interaction','ChatInteraction','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','server','offline-chat','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','sendMail','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','nolimit','Owner','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','timezone','indexOf','true','interval','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','x-real-ip','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','sendStatus','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','mustache','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','update','destroy','ChatWebsites','UserProfileResource','stack','send','index','Pause','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','filter','options','where','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','includeAll','ChatWebsite','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','showCustomerAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','ChatApplication','Applications','List','account','applications','list','orderBy','asc','contact','customerIp','x-forwarded-for','split','lastName','x-real-port','referer','browser','format','unknown','version','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl'];(function(_0x2af8a6,_0xc25936){var _0x2f00e6=function(_0x3e124b){while(--_0x3e124b){_0x2af8a6['push'](_0x2af8a6['shift']());}};_0x2f00e6(++_0xc25936);}(_0x4926,0x194));var _0x6492=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0x4926[_0x57b236];return _0x4feb29;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x6492('0x0'));var util=require(_0x6492('0x1'));var path=require(_0x6492('0x2'));var ejs=require(_0x6492('0x3'));var fs=require('fs');var fs_extra=require(_0x6492('0x4'));var _=require(_0x6492('0x5'));var querystring=require('querystring');var Redis=require(_0x6492('0x6'));var qs=require(_0x6492('0x7'));var logger=require(_0x6492('0x8'))(_0x6492('0x9'));var config=require(_0x6492('0xa'));var db=require(_0x6492('0xb'))['db'];config[_0x6492('0xc')]=_[_0x6492('0xd')](config[_0x6492('0xc')],{'host':_0x6492('0xe'),'port':0x18eb});var socket=require(_0x6492('0xf'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0x6492('0x10'));var jayson=require(_0x6492('0x11'));var client=jayson[_0x6492('0x12')]['http']({'port':0x232c});var client9002=jayson[_0x6492('0x12')]['http']({'port':0x232a});var client9003=jayson[_0x6492('0x12')][_0x6492('0x13')]({'port':0x232b});var client9001=jayson[_0x6492('0x12')][_0x6492('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x29aa35,_0x49014d,_0x4e7fcb,_0x4d2d09){return new BPromise(function(_0x3bbd8a,_0x39e31b){var _0x57e6ac=_0x4d2d09||client;return _0x57e6ac[_0x6492('0x14')](_0x29aa35,_0x4e7fcb)[_0x6492('0x15')](function(_0x55aa24){logger[_0x6492('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x49014d,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x49014d,_0x6492('0x17'),JSON['stringify'](_0x55aa24));if(_0x55aa24[_0x6492('0x18')]){if(_0x55aa24[_0x6492('0x18')][_0x6492('0x19')]===0x1f4){logger['error'](_0x6492('0x1a'),_0x49014d,_0x55aa24['error'][_0x6492('0x1b')]);return _0x39e31b(_0x55aa24[_0x6492('0x18')][_0x6492('0x1b')]);}logger[_0x6492('0x18')](_0x6492('0x1a'),_0x49014d,_0x55aa24[_0x6492('0x18')][_0x6492('0x1b')]);return _0x3bbd8a(_0x55aa24[_0x6492('0x18')][_0x6492('0x1b')]);}else{logger[_0x6492('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x49014d,_0x6492('0x17'));_0x3bbd8a(_0x55aa24[_0x6492('0x1c')][_0x6492('0x1b')]);}})[_0x6492('0x1d')](function(_0x4bb85c){logger[_0x6492('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x49014d,_0x4bb85c);_0x39e31b(_0x4bb85c);});});}function respondWithStatusCode(_0x26946b,_0x512f90){_0x512f90=_0x512f90||0xcc;return function(_0x546567){if(_0x546567){return _0x26946b['sendStatus'](_0x512f90);}return _0x26946b[_0x6492('0x1e')](_0x512f90)[_0x6492('0x1f')]();};}function respondWithResult(_0x38e4b4,_0x5ae31d){_0x5ae31d=_0x5ae31d||0xc8;return function(_0x56fe18){if(_0x56fe18){return _0x38e4b4[_0x6492('0x1e')](_0x5ae31d)[_0x6492('0x20')](_0x56fe18);}};}function respondWithFilteredResult(_0x96f483,_0x1fc83c){return function(_0x5e99f6){if(_0x5e99f6){var _0x23ebf0=typeof _0x1fc83c[_0x6492('0x21')]===_0x6492('0x22')&&typeof _0x1fc83c[_0x6492('0x23')]==='undefined';var _0x21adba=_0x5e99f6['count'];var _0x5aea40=_0x23ebf0?0x0:_0x1fc83c[_0x6492('0x21')];var _0x167f3f=_0x23ebf0?_0x5e99f6[_0x6492('0x24')]:_0x1fc83c['offset']+_0x1fc83c[_0x6492('0x23')];var _0x3a4b38;if(_0x167f3f>=_0x21adba){_0x167f3f=_0x21adba;_0x3a4b38=0xc8;}else{_0x3a4b38=0xce;}_0x96f483[_0x6492('0x1e')](_0x3a4b38);return _0x96f483[_0x6492('0x25')]('Content-Range',_0x5aea40+'-'+_0x167f3f+'/'+_0x21adba)[_0x6492('0x20')](_0x5e99f6);}return null;};}function saveUpdates(_0x4951ea){return function(_0xde21ef){if(_0xde21ef){return _0xde21ef[_0x6492('0x26')](_0x4951ea)[_0x6492('0x15')](function(_0x535b1a){return _0x535b1a;});}return null;};}function removeEntity(_0x2da56b){return function(_0x211559){if(_0x211559){return _0x211559[_0x6492('0x27')]()[_0x6492('0x15')](function(){var _0x119515=_0x211559['get']({'plain':!![]});var _0x122e3a=_0x6492('0x28');return db[_0x6492('0x29')][_0x6492('0x27')]({'where':{'type':_0x122e3a,'resourceId':_0x119515['id']}})[_0x6492('0x15')](function(){return _0x211559;});})['then'](function(){_0x2da56b['status'](0xcc)[_0x6492('0x1f')]();});}};}function handleEntityNotFound(_0x316d6c){return function(_0x5372d6){if(!_0x5372d6){_0x316d6c['sendStatus'](0x194);}return _0x5372d6;};}function handleError(_0x48f254,_0x3836c4){_0x3836c4=_0x3836c4||0x1f4;return function(_0x14e090){logger[_0x6492('0x18')](_0x14e090[_0x6492('0x2a')]);if(_0x14e090['name']){delete _0x14e090['name'];}_0x48f254[_0x6492('0x1e')](_0x3836c4)[_0x6492('0x2b')](_0x14e090);};}exports[_0x6492('0x2c')]=function(_0x3ff4c2,_0x2e569a){var _0x29ce53={'include':[{'model':db[_0x6492('0x2d')],'as':'mandatoryDispositionPause'}]},_0x559e9b={},_0x4dd916={'count':0x0,'rows':[]};var _0x24ca67=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x3c988e){return{'name':_0x3c988e[_0x6492('0x2e')],'type':_0x3c988e[_0x6492('0x2f')][_0x6492('0x30')]};});_0x559e9b[_0x6492('0x31')]=_[_0x6492('0x32')](_0x24ca67,_0x6492('0x33'));_0x559e9b['query']=_[_0x6492('0x34')](_0x3ff4c2[_0x6492('0x35')]);_0x559e9b[_0x6492('0x36')]=_[_0x6492('0x37')](_0x559e9b[_0x6492('0x31')],_0x559e9b['query']);_0x29ce53[_0x6492('0x38')]=_[_0x6492('0x37')](_0x559e9b[_0x6492('0x31')],qs[_0x6492('0x39')](_0x3ff4c2[_0x6492('0x35')][_0x6492('0x39')]));_0x29ce53[_0x6492('0x38')]=_0x29ce53[_0x6492('0x38')][_0x6492('0x3a')]?_0x29ce53[_0x6492('0x38')]:_0x559e9b['model'];if(!_0x3ff4c2[_0x6492('0x35')][_0x6492('0x3b')]('nolimit')){_0x29ce53['limit']=qs[_0x6492('0x23')](_0x3ff4c2[_0x6492('0x35')][_0x6492('0x23')]);_0x29ce53[_0x6492('0x21')]=qs[_0x6492('0x21')](_0x3ff4c2['query']['offset']);}_0x29ce53[_0x6492('0x3c')]=qs[_0x6492('0x3d')](_0x3ff4c2[_0x6492('0x35')][_0x6492('0x3d')]);_0x29ce53['where']=qs['filters'](_[_0x6492('0x3e')](_0x3ff4c2['query'],_0x559e9b[_0x6492('0x36')]),_0x24ca67);if(_0x3ff4c2[_0x6492('0x35')]['filter']){_0x29ce53['where']=_[_0x6492('0x3f')](_0x29ce53['where'],{'$or':_['map'](_0x24ca67,function(_0xbe24d2){if(_0xbe24d2[_0x6492('0x2f')]!==_0x6492('0x40')){var _0x3460c4={};_0x3460c4[_0xbe24d2[_0x6492('0x33')]]={'$like':'%'+_0x3ff4c2[_0x6492('0x35')][_0x6492('0x41')]+'%'};return _0x3460c4;}})});}_0x29ce53=_['merge']({},_0x29ce53,_0x3ff4c2[_0x6492('0x42')]);var _0xab595d={'where':_0x29ce53[_0x6492('0x43')]};return db['ChatWebsite'][_0x6492('0x24')](_0xab595d)['then'](function(_0x3e21ca){_0x4dd916[_0x6492('0x24')]=_0x3e21ca;if(_0x3ff4c2[_0x6492('0x35')]['includeAll']){_0x29ce53[_0x6492('0x44')]=[{'all':!![]}];}return db['ChatWebsite'][_0x6492('0x45')](_0x29ce53);})[_0x6492('0x15')](function(_0xa65d10){_0x4dd916[_0x6492('0x46')]=_0xa65d10;return _0x4dd916;})[_0x6492('0x15')](respondWithFilteredResult(_0x2e569a,_0x29ce53))[_0x6492('0x1d')](handleError(_0x2e569a,null));};exports[_0x6492('0x47')]=function(_0x340e02,_0x2493c2){var _0x283ad2={'raw':![],'where':{'id':_0x340e02[_0x6492('0x48')]['id']},'include':[{'model':db[_0x6492('0x2d')],'as':_0x6492('0x49')}]},_0x402b1b={};_0x402b1b['model']=_[_0x6492('0x34')](db['ChatWebsite'][_0x6492('0x4a')]);_0x402b1b[_0x6492('0x35')]=_['keys'](_0x340e02[_0x6492('0x35')]);_0x402b1b[_0x6492('0x36')]=_[_0x6492('0x37')](_0x402b1b[_0x6492('0x31')],_0x402b1b[_0x6492('0x35')]);_0x283ad2['attributes']=_[_0x6492('0x37')](_0x402b1b[_0x6492('0x31')],qs[_0x6492('0x39')](_0x340e02[_0x6492('0x35')][_0x6492('0x39')]));_0x283ad2[_0x6492('0x38')]=_0x283ad2['attributes'][_0x6492('0x3a')]?_0x283ad2[_0x6492('0x38')]:_0x402b1b[_0x6492('0x31')];if(_0x340e02[_0x6492('0x35')][_0x6492('0x4b')]){_0x283ad2[_0x6492('0x44')]=[{'all':!![]}];}_0x283ad2=_[_0x6492('0x3f')]({},_0x283ad2,_0x340e02[_0x6492('0x42')]);return db[_0x6492('0x4c')][_0x6492('0x4d')](_0x283ad2)['then'](handleEntityNotFound(_0x2493c2,null))[_0x6492('0x15')](respondWithResult(_0x2493c2,null))[_0x6492('0x1d')](handleError(_0x2493c2,null));};exports[_0x6492('0x4e')]=function(_0x160ac8,_0x3ef1ff){return db[_0x6492('0x4c')][_0x6492('0x4e')](_0x160ac8[_0x6492('0x4f')],{})[_0x6492('0x15')](function(_0x1efbda){var _0xbc840=_0x160ac8[_0x6492('0x50')][_0x6492('0x51')]({'plain':!![]});if(!_0xbc840)throw new Error(_0x6492('0x52'));if(_0xbc840['role']===_0x6492('0x50')){var _0x15c1d9=_0x1efbda[_0x6492('0x51')]({'plain':!![]});var _0x584d88='ChatWebsites';return db['UserProfileSection'][_0x6492('0x4d')]({'where':{'name':_0x584d88,'userProfileId':_0xbc840['userProfileId']},'raw':!![]})[_0x6492('0x15')](function(_0x2cb8d6){if(_0x2cb8d6&&_0x2cb8d6[_0x6492('0x53')]===0x0){return db[_0x6492('0x29')]['create']({'name':_0x15c1d9[_0x6492('0x33')],'resourceId':_0x15c1d9['id'],'type':_0x2cb8d6['name'],'sectionId':_0x2cb8d6['id']},{})[_0x6492('0x15')](function(){return _0x1efbda;});}else{return _0x1efbda;}})['catch'](function(_0x28a4e0){logger[_0x6492('0x18')](_0x6492('0x54'),_0x28a4e0);throw _0x28a4e0;});}return _0x1efbda;})[_0x6492('0x15')](respondWithResult(_0x3ef1ff,0xc9))[_0x6492('0x1d')](handleError(_0x3ef1ff,null));};exports['update']=function(_0x5abffa,_0x472831){if(_0x5abffa['body']['id']){delete _0x5abffa['body']['id'];}return db[_0x6492('0x4c')]['find']({'where':{'id':_0x5abffa[_0x6492('0x48')]['id']},'include':[{'model':db[_0x6492('0x2d')],'as':_0x6492('0x49')}]})['then'](handleEntityNotFound(_0x472831,null))[_0x6492('0x15')](saveUpdates(_0x5abffa[_0x6492('0x4f')],null))['then'](respondWithResult(_0x472831,null))['catch'](handleError(_0x472831,null));};exports[_0x6492('0x27')]=function(_0x1a5dca,_0x1a2ca2){return db[_0x6492('0x4c')][_0x6492('0x4d')]({'where':{'id':_0x1a5dca['params']['id']}})['then'](handleEntityNotFound(_0x1a2ca2,null))[_0x6492('0x15')](removeEntity(_0x1a2ca2,null))[_0x6492('0x1d')](handleError(_0x1a2ca2,null));};exports[_0x6492('0x55')]=function(_0x1dd32b,_0x1bd065){return db['ChatWebsite'][_0x6492('0x55')]()[_0x6492('0x15')](respondWithResult(_0x1bd065,null))[_0x6492('0x1d')](handleError(_0x1bd065,null));};exports['addDisposition']=function(_0x316cad,_0x5e2b6d){if(_0x316cad['body']['id']){delete _0x316cad[_0x6492('0x4f')]['id'];}return db['ChatWebsite'][_0x6492('0x4d')]({'where':{'id':_0x316cad[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x5e2b6d,null))[_0x6492('0x15')](function(_0xcbf495){if(_0xcbf495){_0x316cad[_0x6492('0x4f')][_0x6492('0x56')]=_0xcbf495['id'];return db[_0x6492('0x57')]['create'](_0x316cad['body']);}})[_0x6492('0x15')](respondWithResult(_0x5e2b6d,null))[_0x6492('0x1d')](handleError(_0x5e2b6d,null));};exports[_0x6492('0x58')]=function(_0x41c602,_0x57c9c9){var _0x2b44d8={'raw':![],'where':{}};var _0x4b76a7={};var _0x5486fe={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6492('0x59')]({'where':{'id':_0x41c602[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x57c9c9,null))['then'](function(_0x15554f){if(_0x15554f){_0x4b76a7[_0x6492('0x31')]=_['keys'](db[_0x6492('0x57')]['rawAttributes']);_0x4b76a7[_0x6492('0x35')]=_[_0x6492('0x34')](_0x41c602[_0x6492('0x35')]);_0x4b76a7[_0x6492('0x36')]=_[_0x6492('0x37')](_0x4b76a7[_0x6492('0x31')],_0x4b76a7[_0x6492('0x35')]);_0x2b44d8[_0x6492('0x38')]=_[_0x6492('0x37')](_0x4b76a7[_0x6492('0x31')],qs[_0x6492('0x39')](_0x41c602['query'][_0x6492('0x39')]));_0x2b44d8['attributes']=_0x2b44d8[_0x6492('0x38')][_0x6492('0x3a')]?_0x2b44d8[_0x6492('0x38')]:_0x4b76a7[_0x6492('0x31')];if(!_0x41c602['query'][_0x6492('0x3b')]('nolimit')){_0x2b44d8[_0x6492('0x23')]=qs[_0x6492('0x23')](_0x41c602[_0x6492('0x35')][_0x6492('0x23')]);_0x2b44d8['offset']=qs['offset'](_0x41c602['query'][_0x6492('0x21')]);}_0x2b44d8[_0x6492('0x3c')]=qs[_0x6492('0x3d')](_0x41c602[_0x6492('0x35')][_0x6492('0x3d')]);_0x2b44d8[_0x6492('0x43')]=qs['filters'](_[_0x6492('0x3e')](_0x41c602[_0x6492('0x35')],_0x4b76a7[_0x6492('0x36')]));_0x2b44d8[_0x6492('0x43')]['ChatWebsiteId']=_0x15554f['id'];if(_0x41c602[_0x6492('0x35')][_0x6492('0x41')]){_0x2b44d8[_0x6492('0x43')]=_[_0x6492('0x3f')](_0x2b44d8[_0x6492('0x43')],{'$or':_[_0x6492('0x32')](_0x2b44d8[_0x6492('0x38')],function(_0x2fa9ab){var _0x37c85e={};_0x37c85e[_0x2fa9ab]={'$like':'%'+_0x41c602[_0x6492('0x35')][_0x6492('0x41')]+'%'};return _0x37c85e;})});}_0x2b44d8=_[_0x6492('0x3f')]({},_0x2b44d8,_0x41c602['options']);return db[_0x6492('0x57')][_0x6492('0x24')]({'where':_0x2b44d8[_0x6492('0x43')]})[_0x6492('0x15')](function(_0xc10c4a){_0x5486fe['count']=_0xc10c4a;if(_0x41c602[_0x6492('0x35')][_0x6492('0x4b')]){_0x2b44d8[_0x6492('0x44')]=[{'all':!![]}];}return db[_0x6492('0x57')][_0x6492('0x45')](_0x2b44d8);})[_0x6492('0x15')](function(_0x503421){_0x5486fe[_0x6492('0x46')]=_0x503421;return _0x5486fe;});}})[_0x6492('0x15')](respondWithFilteredResult(_0x57c9c9,_0x2b44d8))['catch'](handleError(_0x57c9c9,null));};exports[_0x6492('0x5a')]=function(_0x35901f,_0x25809d){return db[_0x6492('0x4c')]['find']({'where':{'id':_0x35901f[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x25809d,null))['then'](function(_0x4ac27a){if(_0x4ac27a){return _0x4ac27a['removeDispositions'](_0x35901f[_0x6492('0x35')]['ids']);}})[_0x6492('0x15')](respondWithStatusCode(_0x25809d,null))[_0x6492('0x1d')](handleError(_0x25809d,null));};exports['addAnswer']=function(_0x148772,_0xcc07a3){if(_0x148772[_0x6492('0x4f')]['id']){delete _0x148772[_0x6492('0x4f')]['id'];}return db[_0x6492('0x4c')]['find']({'where':{'id':_0x148772['params']['id']}})[_0x6492('0x15')](handleEntityNotFound(_0xcc07a3,null))[_0x6492('0x15')](function(_0x33e722){if(_0x33e722){_0x148772['body'][_0x6492('0x56')]=_0x33e722['id'];return db[_0x6492('0x5b')][_0x6492('0x4e')](_0x148772[_0x6492('0x4f')]);}})[_0x6492('0x15')](respondWithResult(_0xcc07a3,null))['catch'](handleError(_0xcc07a3,null));};exports[_0x6492('0x5c')]=function(_0x1abf16,_0xb5e588){var _0x119f7d={'raw':![],'where':{}};var _0x3b7b1d={};var _0x1059e1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6492('0x59')]({'where':{'id':_0x1abf16[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0xb5e588,null))[_0x6492('0x15')](function(_0x4a3a10){if(_0x4a3a10){_0x3b7b1d[_0x6492('0x31')]=_[_0x6492('0x34')](db[_0x6492('0x5b')][_0x6492('0x4a')]);_0x3b7b1d[_0x6492('0x35')]=_['keys'](_0x1abf16['query']);_0x3b7b1d[_0x6492('0x36')]=_['intersection'](_0x3b7b1d['model'],_0x3b7b1d[_0x6492('0x35')]);_0x119f7d[_0x6492('0x38')]=_[_0x6492('0x37')](_0x3b7b1d[_0x6492('0x31')],qs[_0x6492('0x39')](_0x1abf16['query'][_0x6492('0x39')]));_0x119f7d[_0x6492('0x38')]=_0x119f7d['attributes'][_0x6492('0x3a')]?_0x119f7d['attributes']:_0x3b7b1d[_0x6492('0x31')];if(!_0x1abf16[_0x6492('0x35')]['hasOwnProperty']('nolimit')){_0x119f7d[_0x6492('0x23')]=qs[_0x6492('0x23')](_0x1abf16[_0x6492('0x35')]['limit']);_0x119f7d[_0x6492('0x21')]=qs[_0x6492('0x21')](_0x1abf16[_0x6492('0x35')][_0x6492('0x21')]);}_0x119f7d['order']=qs[_0x6492('0x3d')](_0x1abf16['query'][_0x6492('0x3d')]);_0x119f7d[_0x6492('0x43')]=qs[_0x6492('0x36')](_[_0x6492('0x3e')](_0x1abf16['query'],_0x3b7b1d[_0x6492('0x36')]));_0x119f7d[_0x6492('0x43')][_0x6492('0x56')]=_0x4a3a10['id'];if(_0x1abf16['query'][_0x6492('0x41')]){_0x119f7d[_0x6492('0x43')]=_['merge'](_0x119f7d['where'],{'$or':_['map'](_0x119f7d[_0x6492('0x38')],function(_0x45c8cc){var _0x49272d={};_0x49272d[_0x45c8cc]={'$like':'%'+_0x1abf16[_0x6492('0x35')][_0x6492('0x41')]+'%'};return _0x49272d;})});}_0x119f7d=_[_0x6492('0x3f')]({},_0x119f7d,_0x1abf16[_0x6492('0x42')]);return db[_0x6492('0x5b')][_0x6492('0x24')]({'where':_0x119f7d[_0x6492('0x43')]})['then'](function(_0x37dbc2){_0x1059e1['count']=_0x37dbc2;if(_0x1abf16['query'][_0x6492('0x4b')]){_0x119f7d[_0x6492('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6492('0x45')](_0x119f7d);})[_0x6492('0x15')](function(_0x266fd3){_0x1059e1[_0x6492('0x46')]=_0x266fd3;return _0x1059e1;});}})[_0x6492('0x15')](respondWithFilteredResult(_0xb5e588,_0x119f7d))[_0x6492('0x1d')](handleError(_0xb5e588,null));};exports[_0x6492('0x5d')]=function(_0x393614,_0x3df07e){return db[_0x6492('0x4c')]['find']({'where':{'id':_0x393614[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x3df07e,null))[_0x6492('0x15')](function(_0x1dc284){if(_0x1dc284){return _0x1dc284['removeAnswers'](_0x393614['query'][_0x6492('0x5e')]);}})[_0x6492('0x15')](respondWithStatusCode(_0x3df07e,null))[_0x6492('0x1d')](handleError(_0x3df07e,null));};exports['addLogo']=function(_0x5808bd,_0x53fec4){_0x5808bd['body']['sitepic']=_0x5808bd[_0x6492('0x5f')][_0x6492('0x60')];return db['ChatWebsite']['find']({'where':{'id':_0x5808bd[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x53fec4,null))[_0x6492('0x15')](saveUpdates(_0x5808bd['body'],null))[_0x6492('0x15')](respondWithResult(_0x53fec4,null))[_0x6492('0x1d')](handleError(_0x53fec4,null));};exports[_0x6492('0x61')]=function(_0x287657,_0x53d749){_0x287657[_0x6492('0x4f')][_0x6492('0x62')]=_0x287657[_0x6492('0x5f')][_0x6492('0x60')];return db[_0x6492('0x4c')]['find']({'where':{'id':_0x287657['params']['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x53d749,null))[_0x6492('0x15')](saveUpdates(_0x287657[_0x6492('0x4f')],null))[_0x6492('0x15')](respondWithResult(_0x53d749,null))[_0x6492('0x1d')](handleError(_0x53d749,null));};exports[_0x6492('0x63')]=function(_0x4ef7e3,_0x153c85){_0x4ef7e3[_0x6492('0x4f')][_0x6492('0x64')]=_0x4ef7e3[_0x6492('0x5f')][_0x6492('0x60')];return db[_0x6492('0x4c')]['find']({'where':{'id':_0x4ef7e3[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x153c85,null))[_0x6492('0x15')](saveUpdates(_0x4ef7e3['body'],null))[_0x6492('0x15')](respondWithResult(_0x153c85,null))[_0x6492('0x1d')](handleError(_0x153c85,null));};exports[_0x6492('0x65')]=function(_0x34d5de,_0x1f8854){_0x34d5de['body'][_0x6492('0x66')]=_0x34d5de[_0x6492('0x5f')][_0x6492('0x60')];return db[_0x6492('0x4c')][_0x6492('0x4d')]({'where':{'id':_0x34d5de[_0x6492('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f8854,null))['then'](saveUpdates(_0x34d5de['body'],null))[_0x6492('0x15')](respondWithResult(_0x1f8854,null))['catch'](handleError(_0x1f8854,null));};exports[_0x6492('0x67')]=function(_0x445921,_0x1e8dd6){var _0x942a61=path[_0x6492('0x68')](config[_0x6492('0x69')],'server/files/images/logos/default_logo.svg');var _0x58c1be={'where':{'id':_0x445921[_0x6492('0x48')]['id']},'attributes':['id',_0x6492('0x6a')],'raw':!![]};var _0xaf5e3=![];return require(_0x6492('0x6b'))[_0x6492('0x6c')]()[_0x6492('0x15')](function(_0x3e5d45){if(_0x3e5d45){_0xaf5e3=_0x3e5d45[_0x6492('0x6d')];}})[_0x6492('0x15')](function(){return db['ChatWebsite'][_0x6492('0x4d')](_0x58c1be);})[_0x6492('0x15')](handleEntityNotFound(_0x1e8dd6,null))['then'](function(_0x514705){if(_0x514705){if(!_['isNil'](_0x514705[_0x6492('0x6a')])){if(fs[_0x6492('0x6e')](path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0x6f'),_0x514705[_0x6492('0x6a')]))&&_0xaf5e3){_0x942a61=path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0x6f'),_0x514705[_0x6492('0x6a')]);}}return _0x1e8dd6[_0x6492('0x70')](_0x942a61);}})[_0x6492('0x1d')](handleError(_0x1e8dd6,null));};exports['getAvatar']=function(_0x222ea9,_0x4d1baf){var _0xd31e6b=path['join'](config['root'],_0x6492('0x71'));var _0x487c56={'where':{'id':_0x222ea9['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6492('0x4c')][_0x6492('0x4d')](_0x487c56)[_0x6492('0x15')](handleEntityNotFound(_0x4d1baf,null))[_0x6492('0x15')](function(_0x5e84eb){if(_0x5e84eb){if(!_[_0x6492('0x72')](_0x5e84eb[_0x6492('0x62')])){if(fs[_0x6492('0x6e')](path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0x73'),_0x5e84eb[_0x6492('0x62')]))){_0xd31e6b=path[_0x6492('0x68')](config[_0x6492('0x69')],'server/files/images/avatars/',_0x5e84eb[_0x6492('0x62')]);}}return _0x4d1baf['download'](_0xd31e6b);}})[_0x6492('0x1d')](handleError(_0x4d1baf,null));};exports['getCustomerAvatar']=function(_0x12e293,_0x2ffc51){var _0xa863c=path[_0x6492('0x68')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x4eaf7f={'where':{'id':_0x12e293[_0x6492('0x48')]['id']},'attributes':['id',_0x6492('0x64'),_0x6492('0x74')],'raw':!![]};return db[_0x6492('0x4c')][_0x6492('0x4d')](_0x4eaf7f)['then'](handleEntityNotFound(_0x2ffc51,null))[_0x6492('0x15')](function(_0x358dc5){if(_0x358dc5){if(!_[_0x6492('0x72')](_0x358dc5[_0x6492('0x64')])){if(fs[_0x6492('0x6e')](path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0x73'),_0x358dc5[_0x6492('0x64')]))&&_0x358dc5[_0x6492('0x74')]){_0xa863c=path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0x73'),_0x358dc5[_0x6492('0x64')]);}}return _0x2ffc51[_0x6492('0x70')](_0xa863c);}})[_0x6492('0x1d')](handleError(_0x2ffc51,null));};exports['getSystemAvatar']=function(_0x5548f0,_0x2376ee){var _0x31be49=path[_0x6492('0x68')](config[_0x6492('0x69')],'server/files/images/avatars/system_avatar.png');var _0x1d9db9={'where':{'id':_0x5548f0['params']['id']},'attributes':['id',_0x6492('0x66')],'raw':!![]};return db[_0x6492('0x4c')][_0x6492('0x4d')](_0x1d9db9)[_0x6492('0x15')](handleEntityNotFound(_0x2376ee,null))[_0x6492('0x15')](function(_0x40f88d){if(_0x40f88d){if(!_['isNil'](_0x40f88d[_0x6492('0x66')])){if(fs[_0x6492('0x6e')](path[_0x6492('0x68')](config[_0x6492('0x69')],'server/files/images/avatars/',_0x40f88d[_0x6492('0x66')]))){_0x31be49=path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0x73'),_0x40f88d[_0x6492('0x66')]);}}return _0x2376ee['download'](_0x31be49);}})[_0x6492('0x1d')](handleError(_0x2376ee,null));};exports['notify']=function(_0x23b339,_0x1375fa){var _0x5e7f2d=require(_0x6492('0x75'));var _0x449e6c=new _0x5e7f2d();var _0x15e0d3=_0x449e6c[_0x6492('0x76')](_0x23b339[_0x6492('0x77')][_0x6492('0x78')])[_0x6492('0x79')]();var _0x230969={'body':_0x23b339[_0x6492('0x4f')],'channel':_0x6492('0x7a')};var _0x49f7a6=[];var _0x14c4c4=[];var _0xf7b43b={};var _0x10b38a=![];return db[_0x6492('0x7b')][_0x6492('0x55')]()[_0x6492('0x15')](function(_0x3a0483){if(!_0x3a0483){throw new db[(_0x6492('0x7c'))]['ValidationError'](_0x6492('0x7d'));}_0x49f7a6=_[_0x6492('0x7e')](_[_0x6492('0x34')](_0x3a0483),[_0x6492('0x7f'),_0x6492('0x80')]);_0x14c4c4=_[_0x6492('0x7e')](_[_0x6492('0x34')](_0x3a0483),['createdAt',_0x6492('0x80'),_0x6492('0x81'),_0x6492('0x82')]);if(_0x23b339[_0x6492('0x4f')]['id']){delete _0x23b339['body']['id'];}if(_[_0x6492('0x72')](_0x23b339['body'][_0x6492('0x83')])){throw new db[(_0x6492('0x7c'))][(_0x6492('0x84'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x23b339[_0x6492('0x4f')]['body'])||_0x23b339[_0x6492('0x4f')][_0x6492('0x4f')]===''){throw new db[(_0x6492('0x7c'))][(_0x6492('0x84'))](_0x6492('0x85'));}if(_[_0x6492('0x72')](_0x23b339[_0x6492('0x4f')][_0x6492('0x86')])){throw new db[(_0x6492('0x7c'))]['ValidationError'](_0x6492('0x87')+_0x14c4c4);}if(!_[_0x6492('0x88')](_0x14c4c4,_0x23b339[_0x6492('0x4f')]['mapKey'])){throw new db[(_0x6492('0x7c'))][(_0x6492('0x84'))](_0x6492('0x89')+_0x14c4c4);}_0xf7b43b[_0x23b339[_0x6492('0x4f')][_0x6492('0x86')]]=_0x23b339['body'][_0x6492('0x83')];})[_0x6492('0x15')](function(){return db[_0x6492('0x4c')]['find']({'where':{'id':_0x23b339[_0x6492('0x48')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6492('0x7b')],'as':_0x6492('0x8a'),'where':_0xf7b43b,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x6492('0x8b')],'as':_0x6492('0x8c')}]});})['then'](handleEntityNotFound(_0x1375fa,null))[_0x6492('0x15')](function(_0x11677e){if(_0x11677e&&_0x11677e[_0x6492('0x8d')]){_0x230969[_0x6492('0x8e')]=_0x11677e;_0x230969[_0x6492('0x8f')]=_0x11677e[_0x6492('0x8c')];_0x230969[_0x6492('0x90')]=_0x11677e[_0x6492('0x8d')];_0x230969['applications']=_[_0x6492('0x91')](_0x230969[_0x6492('0x8f')],['priority'],[_0x6492('0x92')]);if(_0x230969['account']['Applications']){delete _0x230969[_0x6492('0x8e')][_0x6492('0x8c')];}if(_0x230969[_0x6492('0x8e')][_0x6492('0x8d')]&&_0x230969[_0x6492('0x8e')][_0x6492('0x8d')][_0x6492('0x8a')]['length']){return _0x230969[_0x6492('0x8e')][_0x6492('0x8d')][_0x6492('0x8a')][0x0];}var _0x3152ca=_[_0x6492('0xd')](_0x23b339[_0x6492('0x4f')],{'firstName':_0x23b339[_0x6492('0x4f')][_0x6492('0x83')],'ListId':_0x11677e[_0x6492('0x82')]});_0x3152ca[_0x23b339[_0x6492('0x4f')][_0x6492('0x86')]]=_0x23b339['body']['from'];return db[_0x6492('0x7b')][_0x6492('0x4e')](_0x3152ca,{'fields':_0x49f7a6,'raw':!![]});}})[_0x6492('0x15')](handleEntityNotFound(_0x1375fa,null))[_0x6492('0x15')](function(_0x178a6a){_0x230969[_0x6492('0x93')]=_0x178a6a;var _0x56c636=_0x23b339['body'][_0x6492('0x94')];if(_0x23b339[_0x6492('0x77')]['cf-connecting-ip']){_0x56c636=_0x23b339[_0x6492('0x77')]['cf-connecting-ip'];}else if(_0x23b339[_0x6492('0x77')][_0x6492('0x95')]){_0x56c636=_['first'](_0x23b339[_0x6492('0x77')][_0x6492('0x95')][_0x6492('0x96')](','));}if(_0x178a6a){var _0xeab205={'ContactId':_0x178a6a['id'],'ChatWebsiteId':_0x23b339['params']['id'],'from':(_0x178a6a['firstName']||'')+'\x20'+(_0x178a6a[_0x6492('0x97')]||''),'customerIp':_0x56c636,'customerPort':_0x23b339['headers'][_0x6492('0x98')]?_0x23b339['headers']['x-real-port']:null,'referer':_0x23b339[_0x6492('0x4f')][_0x6492('0x99')],'browserName':_0x15e0d3[_0x6492('0x9a')][_0x6492('0x33')]&&_0x15e0d3[_0x6492('0x9a')]['version']?util[_0x6492('0x9b')]('%s\x20%s',_0x15e0d3[_0x6492('0x9a')]['name'],_0x15e0d3[_0x6492('0x9a')]['version']):_0x6492('0x9c'),'browserVersion':_0x15e0d3[_0x6492('0x9a')][_0x6492('0x9d')]||_0x6492('0x9c'),'osName':util[_0x6492('0x9b')]('%s\x20%s',_0x15e0d3['os'][_0x6492('0x33')],_0x15e0d3['os'][_0x6492('0x9d')]),'osVersion':_0x15e0d3['os']['version'],'deviceModel':_0x15e0d3[_0x6492('0x9e')][_0x6492('0x31')]&&_0x15e0d3[_0x6492('0x9e')][_0x6492('0x9f')]?util[_0x6492('0x9b')](_0x6492('0xa0'),_0x15e0d3[_0x6492('0x9e')][_0x6492('0x31')],_0x15e0d3[_0x6492('0x9e')][_0x6492('0x9f')],_0x15e0d3['device'][_0x6492('0x2f')]):null,'deviceVendor':_0x15e0d3[_0x6492('0x9e')]['vendor'],'deviceType':_0x15e0d3['device'][_0x6492('0x2f')],'formData':JSON[_0x6492('0xa1')](_0x23b339[_0x6492('0x4f')])};var _0x566f43={'ChatWebsiteId':_0x23b339[_0x6492('0x48')]['id'],'closed':![]};if(_0x23b339['body'][_0x6492('0xa2')]){_0x566f43[_0x6492('0xa2')]=_0x23b339[_0x6492('0x4f')]['threadId'];return db['ChatInteraction'][_0x6492('0x4d')]({'where':_0x566f43})[_0x6492('0x15')](function(_0x318708){if(_0x318708){return[_0x318708,![]];}_0xeab205[_0x6492('0xa2')]=_0x23b339[_0x6492('0x4f')][_0x6492('0xa2')];_0xeab205[_0x6492('0xa3')]=_0x23b339[_0x6492('0x4f')][_0x6492('0xa3')];return db['ChatInteraction']['create'](_0xeab205)['then'](function(_0x3c4ec8){return[_0x3c4ec8,!![]];});});}_0x566f43['ContactId']=_0x178a6a['id'];if(_0x23b339['body'][_0x6492('0xa4')]&&_0x23b339[_0x6492('0x4f')][_0x6492('0xa4')]['id']){_0x566f43['id']=_0x23b339[_0x6492('0x4f')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x566f43})['then'](function(_0x167701){if(_0x167701){return[_0x167701,![]];}return db[_0x6492('0xa5')][_0x6492('0x4e')](_0xeab205)['then'](function(_0x2be56a){return[_0x2be56a,!![]];});});}return db[_0x6492('0xa5')]['create'](_0xeab205)['then'](function(_0x2c67d0){return[_0x2c67d0,!![]];});}})['spread'](function(_0x5203f1,_0x2ae8cb){if(_0x5203f1){_0x10b38a=_0x2ae8cb;if(!_0x2ae8cb){var _0x408d74={'from':(_0x230969['contact'][_0x6492('0xa6')]||'')+'\x20'+(_0x230969[_0x6492('0x93')][_0x6492('0x97')]||'')};if(_0x23b339['body'][_0x6492('0xa2')]&&_0x23b339[_0x6492('0x4f')][_0x6492('0xa7')]&&_0x23b339[_0x6492('0x4f')][_0x6492('0xa2')]!=_0x23b339[_0x6492('0x4f')]['messageId']){_0x408d74[_0x6492('0xa2')]=_0x23b339[_0x6492('0x4f')]['messageId'];}return _0x5203f1[_0x6492('0x26')](_0x408d74);}else{return _0x5203f1;}}})[_0x6492('0x15')](function(_0x546d68){_0x230969['interaction']=_0x546d68[_0x6492('0x51')]({'plain':!![]});_0x230969[_0x6492('0xa4')][_0x6492('0xa8')]=_0x10b38a;if(_0x230969[_0x6492('0xa4')][_0x6492('0xa8')]){if(_0x230969[_0x6492('0x8e')][_0x6492('0xa9')]){_0x230969[_0x6492('0x8f')][_0x6492('0xaa')]({'id':0x0,'priority':_0x230969[_0x6492('0x8f')]['length']+0x1,'app':'close','appdata':_0x6492('0xab'),'interval':_0x6492('0xac')});}}return db['ChatMessage']['create']({'body':_0x23b339['body'][_0x6492('0x4f')],'ChatWebsiteId':_0x23b339[_0x6492('0x48')]['id'],'ChatInteractionId':_0x546d68['id'],'direction':'in','ContactId':_0x230969[_0x6492('0x93')]['id'],'AttachmentId':_0x23b339['body'][_0x6492('0xad')]});})[_0x6492('0x15')](function(_0x2f2f7b){_0x230969[_0x6492('0x1b')]=_0x2f2f7b;if(_0x230969['interaction'][_0x6492('0xae')]){return db[_0x6492('0xaf')][_0x6492('0x4d')]({'attributes':['id','name'],'where':{'id':_0x230969[_0x6492('0xa4')][_0x6492('0xae')]}})['then'](function(_0x6196a3){if(_0x6196a3){_0x230969[_0x6492('0x8f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6492('0xb0'),'appdata':_0x6196a3['name']+','+(_0x230969[_0x6492('0x8e')][_0x6492('0xb1')]||0xa),'interval':'*,*,*,*'});_0x230969[_0x6492('0xb2')]=!![];}return respondWithRpcPromise(_0x6492('0xb3'),_0x6492('0xb4'),_0x230969);});}return respondWithRpcPromise(_0x6492('0xb3'),_0x6492('0xb4'),_0x230969);})[_0x6492('0x15')](function(_0x54cc6c){respondWithRpcPromise(_0x6492('0xb5'),_0x6492('0xb5'),{'event':'notify','message':_0x54cc6c},client9002);return _0x54cc6c;})[_0x6492('0x15')](respondWithResult(_0x1375fa,null))['catch'](handleError(_0x1375fa,null));};exports[_0x6492('0xb6')]=function(_0x321a8d,_0x3b7b69){var _0x5d55dd,_0x1b6d9b,_0xfa1717;var _0x4b11f1=[];var _0x10395d={};var _0xa32586=_0x321a8d[_0x6492('0xb7')]||[];var _0x8351c=[];var _0x31dc93;return db[_0x6492('0x7b')][_0x6492('0x55')]()[_0x6492('0x15')](function(_0x5e8523){if(!_0x5e8523){throw new db['Sequelize'][(_0x6492('0x84'))](_0x6492('0x7d'));}_0x4b11f1=_[_0x6492('0x7e')](_[_0x6492('0x34')](_0x5e8523),['createdAt',_0x6492('0x80'),_0x6492('0x81'),_0x6492('0x82')]);if(_0x321a8d[_0x6492('0x4f')]['id']){delete _0x321a8d['body']['id'];}if(_[_0x6492('0x72')](_0x321a8d[_0x6492('0x4f')][_0x6492('0x83')])){throw _0x3b7b69[_0x6492('0x1e')](0x1f4)['send'](new db['Sequelize'][(_0x6492('0x84'))]('from\x20is\x20mandatory'));}if(_[_0x6492('0x72')](_0x321a8d[_0x6492('0x4f')][_0x6492('0x4f')])||_0x321a8d['body'][_0x6492('0x4f')]===''){throw _0x3b7b69[_0x6492('0x1e')](0x1f4)[_0x6492('0x2b')](new db['Sequelize'][(_0x6492('0x84'))](_0x6492('0x85')));}if(_['isNil'](_0x321a8d[_0x6492('0x4f')][_0x6492('0xb8')])){throw _0x3b7b69[_0x6492('0x1e')](0x1f4)['send'](new db[(_0x6492('0x7c'))][(_0x6492('0x84'))](_0x6492('0xb9')+_0x4b11f1));}if(!_['includes'](_0x4b11f1,_0x321a8d[_0x6492('0x4f')]['mapKeyOffline'])){throw _0x3b7b69[_0x6492('0x1e')](0x1f4)['send'](new db[(_0x6492('0x7c'))][(_0x6492('0x84'))](_0x6492('0xba')+_0x4b11f1));}_0x10395d[_0x321a8d[_0x6492('0x4f')][_0x6492('0xb8')]]=_0x321a8d[_0x6492('0x4f')][_0x6492('0x83')];})[_0x6492('0x15')](function(){return db['ChatWebsite'][_0x6492('0x4d')]({'where':{'id':_0x321a8d[_0x6492('0x48')]['id']},'include':[{'model':db['CmList'],'as':_0x6492('0x8d')},{'model':db[_0x6492('0xbb')],'as':_0x6492('0xbb')}]});})[_0x6492('0x15')](handleEntityNotFound(_0x3b7b69,null))[_0x6492('0x15')](function(_0x568694){if(_0x568694&&_0x568694[_0x6492('0x8d')]){_0x1b6d9b=_0x568694;var _0x2dd456=_[_0x6492('0xd')](_0x321a8d['body'],{'firstName':_0x321a8d[_0x6492('0x4f')][_0x6492('0x83')],'phone':_0x321a8d[_0x6492('0x4f')][_0x6492('0x83')],'ListId':_0x568694['ListId']});_0x2dd456[_0x321a8d[_0x6492('0x4f')][_0x6492('0xb8')]]=_0x321a8d[_0x6492('0x4f')][_0x6492('0x83')];return db[_0x6492('0x7b')][_0x6492('0xbc')]({'where':_0x10395d,'defaults':_0x2dd456});}})[_0x6492('0xbd')](function(_0x13cbf5){if(_0x13cbf5){_0xfa1717=_0x13cbf5;var _0x14e12b=fs[_0x6492('0xbe')](path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0xbf')),_0x6492('0xc0'));var _0x372ec5=ejs[_0x6492('0xc1')](_0x14e12b,{'body':_['toPairs'](_0x321a8d[_0x6492('0x4f')]['body']),'bodyTitle':_0x1b6d9b[_0x6492('0xc2')]});return db['ChatOfflineMessage'][_0x6492('0x4e')]({'body':_0x372ec5,'plainBody':htmlToText[_0x6492('0xc3')](_0x372ec5),'ContactId':_0x13cbf5['id'],'ChatWebsiteId':_0x1b6d9b['id']});}})['then'](function(_0x38db7a){_0x31dc93=_0x38db7a;if(_0xa32586[_0x6492('0x3a')]){var _0x28af96=_0xa32586['map'](function(_0x1bbaaf){return{'name':_0x1bbaaf[_0x6492('0xc4')],'basename':_0x1bbaaf[_0x6492('0x60')],'type':_0x1bbaaf[_0x6492('0xc5')],'ChatOfflineMessageId':_0x38db7a['id']};});_0x8351c=_0x28af96[_0x6492('0x32')](_0x58c0b5=>{var _0x211944={'filename':_0x58c0b5[_0x6492('0x33')],'path':path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0xc6'),_0x6492('0xb7'),'attachments',_0x6492('0xc7'),_0x58c0b5['basename'])};return _0x211944;});if(!_0x1b6d9b[_0x6492('0xc8')]){return db[_0x6492('0xc9')][_0x6492('0xca')](function(_0x2e044d){return db['Attachment'][_0x6492('0xcb')](_0x28af96,{'transaction':_0x2e044d});});}}})['then'](function(){if(_0x31dc93){_0x5d55dd=_0x31dc93;return db['MailAccount'][_0x6492('0x59')]({'where':{'service':!![]},'include':[{'model':db[_0x6492('0xcc')],'as':_0x6492('0xcd'),'raw':!![],'include':[{'model':db[_0x6492('0xce')],'as':_0x6492('0xce'),'raw':!![]}]}]});}})[_0x6492('0x15')](function(_0x4d8154){if(_0x4d8154&&_0x4d8154[_0x6492('0xcd')]&&_0x1b6d9b['forwardOffline']&&_0x1b6d9b['forwardOfflineAddress']){var _0x44f789=_0x4d8154['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x6492('0xcf'),{'account':_0x44f789,'message':{'from':util[_0x6492('0x9b')]('\x22%s\x22\x20<%s>',_0x4d8154[_0x6492('0x33')],_0x4d8154[_0x6492('0xd0')]||_0x4d8154['Smtp'][_0x6492('0x50')]),'to':_0x1b6d9b[_0x6492('0xd1')],'subject':_0x1b6d9b[_0x6492('0xd2')],'html':_0x5d55dd[_0x6492('0x4f')],'attachments':_0x8351c}},client9003)['then'](function(){return _0x5d55dd;})[_0x6492('0x1d')](function(_0x57c495){logger[_0x6492('0x18')](_0x57c495);});}})[_0x6492('0x15')](function(){if(_0x1b6d9b&&_0x1b6d9b['openNewInteraction']&&_0x1b6d9b[_0x6492('0xd3')]){var _0x2dd78f=[];if(_0xa32586[_0x6492('0x3a')]){_0x2dd78f=_0xa32586[_0x6492('0x32')](function(_0x5bcff3){return{'name':_0x5bcff3[_0x6492('0xc4')],'basename':_0x5bcff3[_0x6492('0x60')],'type':_0x5bcff3[_0x6492('0xc5')],'ChatOfflineMessageId':_0x31dc93['id']};});}var _0x24b489;if(!_[_0x6492('0x72')](_0x1b6d9b[_0x6492('0xd4')])){var _0x2a6664=_[_0x6492('0x32')](_0x321a8d['body'],function(_0x5c54cb){return _0x5c54cb;});var _0xf4d755=_['toPairsIn'](_0x2a6664)[0x0];var _0x278798=_['mapValues'](_0xf4d755,function(_0x24a8a5){return _0x24a8a5;});_0x24b489=_0x278798[0x1][_0x1b6d9b['subjectOffline']];}var _0x1004cc={'from':_0xfa1717[_0x6492('0xd0')],'firstName':_0xfa1717['firstName'],'lastName':_0xfa1717['lastName'],'mapKey':_0x6492('0xd0'),'message':{'from':_0xfa1717[_0x6492('0xd0')],'to':_0x1b6d9b[_0x6492('0xbb')][_0x6492('0xd0')],'cc':'','subject':_[_0x6492('0x72')](_0x24b489)?_0x1b6d9b[_0x6492('0xd2')]:_0x24b489,'messageId':'','sentAt':new Date(),'attach':_0x2dd78f['length'],'attachments':_0x2dd78f,'originChannel':_0x6492('0xd5'),'ChatWebsiteId':_0x1b6d9b['id'],'ChatOfflineMessageId':_0x5d55dd['id'],'originTo':_0x1b6d9b[_0x6492('0xbb')][_0x6492('0xd0')]},'body':_0x5d55dd[_0x6492('0x4f')]};var _0x253737={'account':{'id':_0x1b6d9b[_0x6492('0xd3')]},'body':_0x1004cc,'log':_0x6492('0xd6')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x253737,client9001)[_0x6492('0x15')](function(){return _0x5d55dd;})[_0x6492('0x1d')](function(_0x266a89){logger['error'](_0x266a89);});}return;})[_0x6492('0x15')](function(){if(_0x5d55dd){return _0x5d55dd;}})['then'](respondWithResult(_0x3b7b69,null))[_0x6492('0x1d')](function(_0x53a72e){logger[_0x6492('0x18')](_0x6492('0x1d'),_0x53a72e);for(var _0x33b541 of _0xa32586){var _0x50c5c9=path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0xc6'),_0x6492('0xb7'),_0x6492('0xd7'),_0x6492('0xc7'),_0x33b541[_0x6492('0x60')]);fs_extra[_0x6492('0xd8')](_0x50c5c9)[_0x6492('0x1d')](function(_0x4b75d0){logger[_0x6492('0x18')](_0x6492('0xd9'),_0x50c5c9,_0x4b75d0);});}});};exports[_0x6492('0xda')]=function(_0x54d48d,_0x5211cf){return db[_0x6492('0xa5')][_0x6492('0x4d')]({'where':{'id':_0x54d48d[_0x6492('0x48')]['id']}})['then'](handleEntityNotFound(_0x5211cf,null))[_0x6492('0x15')](function(_0x21e125){if(_0x21e125){return _0x21e125[_0x6492('0xda')](_0x54d48d['body'][_0x6492('0x5e')],_['omit'](_0x54d48d[_0x6492('0x4f')],[_0x6492('0x5e'),'id'])||{});}})[_0x6492('0x15')](respondWithResult(_0x5211cf,null))['catch'](handleError(_0x5211cf,null));};exports[_0x6492('0xdb')]=function(_0x2bbfa1,_0x5558ef){var _0x46be48={'raw':![],'where':{}};var _0x448afd={};var _0x4e2895={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2bbfa1[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x5558ef,null))[_0x6492('0x15')](function(_0xda212c){if(_0xda212c){_0x448afd[_0x6492('0x31')]=_[_0x6492('0x34')](db[_0x6492('0xa5')][_0x6492('0x4a')]);_0x448afd['query']=_[_0x6492('0x34')](_0x2bbfa1[_0x6492('0x35')]);_0x448afd[_0x6492('0x36')]=_['intersection'](_0x448afd[_0x6492('0x31')],_0x448afd[_0x6492('0x35')]);_0x46be48[_0x6492('0x38')]=_[_0x6492('0x37')](_0x448afd[_0x6492('0x31')],qs[_0x6492('0x39')](_0x2bbfa1[_0x6492('0x35')]['fields']));_0x46be48[_0x6492('0x38')]=_0x46be48[_0x6492('0x38')][_0x6492('0x3a')]?_0x46be48[_0x6492('0x38')]:_0x448afd[_0x6492('0x31')];if(!_0x2bbfa1[_0x6492('0x35')][_0x6492('0x3b')](_0x6492('0xdc'))){_0x46be48[_0x6492('0x23')]=qs['limit'](_0x2bbfa1[_0x6492('0x35')][_0x6492('0x23')]);_0x46be48['offset']=qs[_0x6492('0x21')](_0x2bbfa1[_0x6492('0x35')][_0x6492('0x21')]);}_0x46be48[_0x6492('0x3c')]=qs['sort'](_0x2bbfa1['query'][_0x6492('0x3d')]);_0x46be48['where']=qs[_0x6492('0x36')](_[_0x6492('0x3e')](_0x2bbfa1[_0x6492('0x35')],_0x448afd['filters']));_0x46be48['where'][_0x6492('0x56')]=_0xda212c['id'];if(_0x2bbfa1[_0x6492('0x35')][_0x6492('0x41')]){_0x46be48[_0x6492('0x43')]=_[_0x6492('0x3f')](_0x46be48['where'],{'$or':_[_0x6492('0x32')](_0x46be48[_0x6492('0x38')],function(_0x427285){var _0x2183cd={};_0x2183cd[_0x427285]={'$like':'%'+_0x2bbfa1[_0x6492('0x35')][_0x6492('0x41')]+'%'};return _0x2183cd;})});}_0x46be48=_[_0x6492('0x3f')]({},_0x46be48,_0x2bbfa1[_0x6492('0x42')]);return db[_0x6492('0xa5')][_0x6492('0x24')]({'where':_0x46be48[_0x6492('0x43')]})[_0x6492('0x15')](function(_0x208561){_0x4e2895[_0x6492('0x24')]=_0x208561;if(_0x2bbfa1['query']['includeAll']){_0x46be48[_0x6492('0x44')]=[{'model':db[_0x6492('0x7b')],'as':'Contact','required':![]},{'model':db[_0x6492('0xaf')],'as':_0x6492('0xdd'),'attributes':[_0x6492('0x33'),'fullname',_0x6492('0xde')],'required':![]},{'model':db['Tag'],'as':_0x6492('0xdf'),'attributes':['id','name',_0x6492('0xe0')],'where':_0x2bbfa1['query'][_0x6492('0xe1')]?{'id':_0x2bbfa1['query'][_0x6492('0xe1')]}:undefined,'required':_0x2bbfa1[_0x6492('0x35')][_0x6492('0xe1')]?!![]:![]}];}return db[_0x6492('0xa5')]['findAll'](_0x46be48);})['then'](function(_0x9ad920){_0x4e2895[_0x6492('0x46')]=_0x9ad920;return _0x4e2895;});}})[_0x6492('0x15')](respondWithFilteredResult(_0x5558ef,_0x46be48))[_0x6492('0x1d')](handleError(_0x5558ef,null));};function iftimePromise(_0x33210d,_0x408d85){return respondWithRpcPromise(_0x6492('0xe2'),_0x6492('0xe3'),{'command':_0x408d85['timezone']?util[_0x6492('0x9b')](_0x6492('0xe4'),_0x33210d['interval'],_0x408d85[_0x6492('0xe5')]):util['format']('iftime\x20%s',_0x33210d['interval'])},client9002)[_0x6492('0x15')](function(_0x2756eb){var _0x3aee63=_0x2756eb&&_0x2756eb[_0x6492('0xe6')](_0x6492('0xe7'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x408d85['id'],_0x33210d['id'],_0x33210d[_0x6492('0xe8')],_0x3aee63?_0x6492('0xe9'):_0x6492('0xea'),_0x408d85[_0x6492('0xe5')]?_0x408d85['timezone']:_0x6492('0xeb'));return _0x3aee63;})[_0x6492('0x1d')](function(_0x33dbf1){logger[_0x6492('0x18')](_0x6492('0xec'),_0x408d85['id'],_0x33210d['id'],_0x33210d[_0x6492('0xe8')],util[_0x6492('0xed')](_0x33dbf1,{'showHidden':![],'depth':null}),_0x408d85[_0x6492('0xe5')]?_0x408d85[_0x6492('0xe5')]:_0x6492('0xeb'));return![];});}exports['getSnippet']=function(_0x14a145,_0x4f2b8d){var _0x41f700=0x0;var _0x1c3cd2=0x0;var _0x1a0c84=![];var _0x200b68;var _0x3d87d8;return db[_0x6492('0x4c')]['find']({'where':{'id':_0x14a145[_0x6492('0x48')]['id']},'include':[{'model':db['Interval'],'as':_0x6492('0xee'),'include':[{'model':db[_0x6492('0xee')],'as':_0x6492('0xef'),'attributes':['id',_0x6492('0xe8')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4f2b8d,null))[_0x6492('0x15')](function(_0x1a2556){if(_0x1a2556){_0x200b68=_0x1a2556;return _0x1a2556['getProactiveActions']({'raw':!![]});}})['then'](function(_0x33af0c){if(_0x200b68){if(_0x33af0c){_0x3d87d8=_0x33af0c;}}return require(_0x6492('0x6b'))[_0x6492('0x6c')]();})['then'](function(_0x56301b){if(_0x56301b){_0x1c3cd2=_0x56301b[_0x6492('0xf0')];_0x1a0c84=_0x56301b[_0x6492('0x6d')];}})[_0x6492('0x15')](function(){return db[_0x6492('0xa5')]['count']({'where':{'closed':![]}});})[_0x6492('0x15')](function(_0x433ef7){_0x41f700=_0x433ef7;if(_0x1c3cd2&&_0x433ef7>_0x1c3cd2){return db[_0x6492('0xf1')][_0x6492('0x59')]({'where':{'id':0x1}})[_0x6492('0x15')](function(_0x22b12b){if(_0x22b12b){_0x22b12b[_0x6492('0xf2')](_0x6492('0xf3'));}});}})['then'](function(){if(_0x200b68[_0x6492('0xee')]&&_0x200b68['Interval']['Intervals']){var _0x1262c5=[];for(var _0xd82e3e=0x0;_0xd82e3e<_0x200b68[_0x6492('0xee')][_0x6492('0xef')][_0x6492('0x3a')];_0xd82e3e++){var _0x55ce63=_0x200b68[_0x6492('0xee')][_0x6492('0xef')][_0xd82e3e][_0x6492('0x51')]({'plain':!![]});_0x1262c5['push'](iftimePromise(_0x55ce63,_0x200b68));}return BPromise[_0x6492('0xf4')](_0x1262c5)[_0x6492('0x15')](function(_0x526d7e){return _[_0x6492('0xf5')](_0x526d7e);});}else{return!![];}})[_0x6492('0x15')](function(_0x1ba7d9){var _0x106f75=fs[_0x6492('0xbe')](path[_0x6492('0x68')](config[_0x6492('0x69')],_0x6492('0xf6')),_0x6492('0xc0'));var _0x5a438a={'remote':_0x200b68['remote'],'query':querystring['stringify'](_[_0x6492('0x3f')](_0x200b68['get']({'plain':!![]}),{'customerIp':_0x14a145[_0x6492('0x77')]['x-forwarded-for']||_0x14a145[_0x6492('0x77')][_0x6492('0xf7')]||_0x14a145['connection']['remoteAddress']||_0x14a145['ip'],'referer':_0x14a145['headers'][_0x6492('0x99')],'openedInteractions':_0x41f700,'maxInteractions':_0x1c3cd2,'virtual':_0x1a0c84[_0x6492('0xf0')],'online':_0x1ba7d9,'custom':_0x1a0c84}))[_0x6492('0xf8')](/'/g,'\x5c\x27')};_0x4f2b8d['send'](ejs[_0x6492('0xc1')](Mustache['render'](_0x106f75,_0x5a438a),{'proactiveActions':_0x3d87d8,'alignment':_0x200b68[_0x6492('0xf9')],'verticalAlignment':_0x200b68[_0x6492('0xfa')],'div_color':_0x200b68['color'],'labelText':_0x200b68[_0x6492('0xfb')],'text_color':_0x200b68[_0x6492('0xfc')],'text_button_color':_0x200b68[_0x6492('0xfd')],'button_color':_0x200b68['color_button'],'background_color':_0x200b68['backgroundColor'],'hideWhenOffline':_0x200b68[_0x6492('0xfe')],'interval':_0x200b68[_0x6492('0xff')]}));})[_0x6492('0x1d')](handleError(_0x4f2b8d,null));};exports[_0x6492('0x100')]=function(_0x4e7711,_0x5d8c53){var _0x2a534d=_0x4e7711[_0x6492('0x48')]['id'];var _0xee8324=_0x4e7711[_0x6492('0x4f')];var _0x8b8aea=0xc8;var _0x3c92b2=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x6492('0xc9')]['Transaction'][_0x6492('0x101')][_0x6492('0x102')]},function(_0xc096b5){return db[_0x6492('0x4c')][_0x6492('0x59')]({'where':{'id':_0x2a534d},'transaction':_0xc096b5})[_0x6492('0x15')](function(_0x6168e0){if(_0x6168e0){return db[_0x6492('0x8b')][_0x6492('0x27')]({'where':{'ChatWebsiteId':_0x2a534d},'transaction':_0xc096b5})[_0x6492('0x15')](function(){var _0x429ddc=_['map'](_0xee8324,function(_0x16a940){_0x16a940['ChatWebsiteId']=_0x2a534d;return _0x16a940;});return db['ChatApplication'][_0x6492('0xcb')](_0x429ddc,{'transaction':_0xc096b5});});}else{_0x8b8aea=0x194;_0x3c92b2=[];}});})['then'](function(){if(_0x8b8aea!==0x194){return db['ChatApplication'][_0x6492('0x103')]({'where':{'ChatWebsiteId':_0x2a534d},'order':_0x6492('0x104')})[_0x6492('0x15')](function(_0xb3cd5e){_0x3c92b2=_0xb3cd5e;});}})[_0x6492('0x1d')](function(_0x112108){_0x8b8aea=0x1f4;logger[_0x6492('0x18')](_0x112108[_0x6492('0x2a')]);if(_0x112108[_0x6492('0x33')]){delete _0x112108['name'];}_0x3c92b2=_0x112108;})[_0x6492('0x105')](function(){if(_0x3c92b2===null){_0x5d8c53[_0x6492('0x106')](_0x8b8aea);}else{if(_0x8b8aea===0x1f4){_0x5d8c53[_0x6492('0x1e')](_0x8b8aea)['send'](_0x3c92b2);}else{_0x5d8c53[_0x6492('0x1e')](_0x8b8aea)[_0x6492('0x20')](_0x3c92b2);}}});};exports[_0x6492('0x107')]=function(_0x34a0bc,_0x107221){var _0x4d136a={};var _0x34ad88={};var _0x59403e;var _0x363127;return db[_0x6492('0x4c')][_0x6492('0x59')]({'where':{'id':_0x34a0bc['params']['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x107221,null))[_0x6492('0x15')](function(_0x280574){if(_0x280574){_0x59403e=_0x280574;_0x34ad88['model']=_[_0x6492('0x34')](db['ChatApplication'][_0x6492('0x4a')]);_0x34ad88['query']=_[_0x6492('0x34')](_0x34a0bc[_0x6492('0x35')]);_0x34ad88[_0x6492('0x36')]=_['intersection'](_0x34ad88[_0x6492('0x31')],_0x34ad88[_0x6492('0x35')]);_0x4d136a[_0x6492('0x38')]=_[_0x6492('0x37')](_0x34ad88[_0x6492('0x31')],qs[_0x6492('0x39')](_0x34a0bc['query']['fields']));_0x4d136a[_0x6492('0x38')]=_0x4d136a[_0x6492('0x38')][_0x6492('0x3a')]?_0x4d136a[_0x6492('0x38')]:_0x34ad88[_0x6492('0x31')];_0x4d136a[_0x6492('0x3c')]=qs[_0x6492('0x3d')](_0x34a0bc[_0x6492('0x35')]['sort']);_0x4d136a[_0x6492('0x43')]=qs[_0x6492('0x36')](_[_0x6492('0x3e')](_0x34a0bc[_0x6492('0x35')],_0x34ad88[_0x6492('0x36')]));if(_0x34a0bc['query'][_0x6492('0x41')]){_0x4d136a[_0x6492('0x43')]=_[_0x6492('0x3f')](_0x4d136a[_0x6492('0x43')],{'$or':_[_0x6492('0x32')](_0x4d136a[_0x6492('0x38')],function(_0x4190a){var _0x2e94cf={};_0x2e94cf[_0x4190a]={'$like':'%'+_0x34a0bc[_0x6492('0x35')][_0x6492('0x41')]+'%'};return _0x2e94cf;})});}_0x4d136a=_[_0x6492('0x3f')]({},_0x4d136a,_0x34a0bc['options']);return _0x59403e[_0x6492('0x107')](_0x4d136a);}})[_0x6492('0x15')](function(_0x4f53bb){if(_0x4f53bb){_0x363127=_0x4f53bb[_0x6492('0x3a')];if(!_0x34a0bc['query'][_0x6492('0x3b')](_0x6492('0xdc'))){_0x4d136a[_0x6492('0x23')]=qs['limit'](_0x34a0bc[_0x6492('0x35')][_0x6492('0x23')]);_0x4d136a[_0x6492('0x21')]=qs[_0x6492('0x21')](_0x34a0bc[_0x6492('0x35')][_0x6492('0x21')]);}return _0x59403e[_0x6492('0x107')](_0x4d136a);}})[_0x6492('0x15')](function(_0x57e8f9){if(_0x57e8f9){return _0x57e8f9?{'count':_0x363127,'rows':_0x57e8f9}:null;}})[_0x6492('0x15')](respondWithResult(_0x107221,null))['catch'](handleError(_0x107221,null));};exports[_0x6492('0x108')]=function(_0x3a6279,_0x53abd0){return db[_0x6492('0x109')][_0x6492('0x4d')]({'where':{'id':_0x3a6279[_0x6492('0x48')]['id']}})['then'](handleEntityNotFound(_0x53abd0,null))[_0x6492('0x15')](function(_0x4acf01){if(_0x4acf01){return _0x4acf01['addProactiveActions'](_0x3a6279[_0x6492('0x4f')][_0x6492('0x5e')],_[_0x6492('0x10a')](_0x3a6279[_0x6492('0x4f')],[_0x6492('0x5e'),'id'])||{});}})[_0x6492('0x15')](respondWithResult(_0x53abd0,null))[_0x6492('0x1d')](handleError(_0x53abd0,null));};exports[_0x6492('0x10b')]=function(_0x6522cf,_0x5102d3){var _0x1f697f={};var _0x381db6={};var _0x434c82;var _0x1f7d7c;return db['ChatWebsite']['findOne']({'where':{'id':_0x6522cf[_0x6492('0x48')]['id']}})['then'](handleEntityNotFound(_0x5102d3,null))[_0x6492('0x15')](function(_0x18145e){if(_0x18145e){_0x434c82=_0x18145e;_0x381db6[_0x6492('0x31')]=_[_0x6492('0x34')](db['ChatProactiveAction'][_0x6492('0x4a')]);_0x381db6['query']=_[_0x6492('0x34')](_0x6522cf[_0x6492('0x35')]);_0x381db6[_0x6492('0x36')]=_[_0x6492('0x37')](_0x381db6[_0x6492('0x31')],_0x381db6[_0x6492('0x35')]);_0x1f697f['attributes']=_[_0x6492('0x37')](_0x381db6['model'],qs[_0x6492('0x39')](_0x6522cf[_0x6492('0x35')][_0x6492('0x39')]));_0x1f697f['attributes']=_0x1f697f[_0x6492('0x38')][_0x6492('0x3a')]?_0x1f697f['attributes']:_0x381db6[_0x6492('0x31')];_0x1f697f[_0x6492('0x3c')]=qs['sort'](_0x6522cf[_0x6492('0x35')][_0x6492('0x3d')]);_0x1f697f[_0x6492('0x43')]=qs[_0x6492('0x36')](_[_0x6492('0x3e')](_0x6522cf[_0x6492('0x35')],_0x381db6[_0x6492('0x36')]));if(_0x6522cf['query']['filter']){_0x1f697f[_0x6492('0x43')]=_['merge'](_0x1f697f['where'],{'$or':_[_0x6492('0x32')](_0x1f697f[_0x6492('0x38')],function(_0x3884e1){var _0x155a22={};_0x155a22[_0x3884e1]={'$like':'%'+_0x6522cf[_0x6492('0x35')]['filter']+'%'};return _0x155a22;})});}_0x1f697f=_[_0x6492('0x3f')]({},_0x1f697f,_0x6522cf[_0x6492('0x42')]);return _0x434c82[_0x6492('0x10b')](_0x1f697f);}})[_0x6492('0x15')](function(_0x228a1a){if(_0x228a1a){_0x1f7d7c=_0x228a1a[_0x6492('0x3a')];if(!_0x6522cf['query']['hasOwnProperty'](_0x6492('0xdc'))){_0x1f697f[_0x6492('0x23')]=qs['limit'](_0x6522cf[_0x6492('0x35')][_0x6492('0x23')]);_0x1f697f[_0x6492('0x21')]=qs[_0x6492('0x21')](_0x6522cf[_0x6492('0x35')][_0x6492('0x21')]);}return _0x434c82['getProactiveActions'](_0x1f697f);}})[_0x6492('0x15')](function(_0x31a4bf){if(_0x31a4bf){return _0x31a4bf?{'count':_0x1f7d7c,'rows':_0x31a4bf}:null;}})['then'](respondWithResult(_0x5102d3,null))[_0x6492('0x1d')](handleError(_0x5102d3,null));};exports['getFields']=function(_0x20c730,_0x140393){var _0x4ca3e1=_0x20c730[_0x6492('0x35')][_0x6492('0x10c')]==='false'?_0x6492('0x10d'):_0x6492('0x10e');return db['ChatWebsite'][_0x6492('0x4d')]({'attributes':['id',_0x4ca3e1],'where':{'id':_0x20c730['params']['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x140393,null))[_0x6492('0x15')](function(_0x53380e){if(_0x53380e){var _0x1789df=_0x53380e[_0x4ca3e1];var _0x9c79d1=_0x1789df&&_0x1789df[_0x6492('0x10f')]?_0x1789df[_0x6492('0x10f')]:[];_0x140393['send']({'fromKey':_['isNil'](_0x1789df[_0x6492('0x110')])?undefined:_0x1789df[_0x6492('0x110')],'count':_0x9c79d1[_0x6492('0x3a')],'rows':_0x9c79d1});}})[_0x6492('0x1d')](handleError(_0x140393,null));};exports[_0x6492('0x111')]=function(_0x244e97,_0xae6e53){var _0xd806a0={'raw':![],'where':{}};var _0x5a2cb4={};var _0x22df18={'count':0x0,'rows':[]};return db[_0x6492('0x4c')][_0x6492('0x59')]({'where':{'id':_0x244e97[_0x6492('0x48')]['id']}})['then'](handleEntityNotFound(_0xae6e53,null))['then'](function(_0x399c4b){if(_0x399c4b){_0x5a2cb4[_0x6492('0x31')]=_[_0x6492('0x34')](db[_0x6492('0x112')][_0x6492('0x4a')]);_0x5a2cb4[_0x6492('0x35')]=_[_0x6492('0x34')](_0x244e97[_0x6492('0x35')]);_0x5a2cb4[_0x6492('0x36')]=_[_0x6492('0x37')](_0x5a2cb4[_0x6492('0x31')],_0x5a2cb4[_0x6492('0x35')]);_0xd806a0[_0x6492('0x38')]=_['intersection'](_0x5a2cb4[_0x6492('0x31')],qs[_0x6492('0x39')](_0x244e97[_0x6492('0x35')]['fields']));_0xd806a0[_0x6492('0x38')]=_0xd806a0['attributes'][_0x6492('0x3a')]?_0xd806a0[_0x6492('0x38')]:_0x5a2cb4['model'];if(!_0x244e97['query']['hasOwnProperty']('nolimit')){_0xd806a0[_0x6492('0x23')]=qs[_0x6492('0x23')](_0x244e97[_0x6492('0x35')][_0x6492('0x23')]);_0xd806a0[_0x6492('0x21')]=qs[_0x6492('0x21')](_0x244e97[_0x6492('0x35')][_0x6492('0x21')]);}_0xd806a0[_0x6492('0x3c')]=qs[_0x6492('0x3d')](_0x244e97[_0x6492('0x35')][_0x6492('0x3d')]);_0xd806a0[_0x6492('0x43')]=qs[_0x6492('0x36')](_['pick'](_0x244e97['query'],_0x5a2cb4[_0x6492('0x36')]));_0xd806a0[_0x6492('0x43')][_0x6492('0x56')]=_0x399c4b['id'];if(_0x244e97[_0x6492('0x35')][_0x6492('0x41')]){_0xd806a0[_0x6492('0x43')]=_[_0x6492('0x3f')](_0xd806a0[_0x6492('0x43')],{'$or':_['map'](_0xd806a0[_0x6492('0x38')],function(_0x29fe57){var _0x4c23f9={};_0x4c23f9[_0x29fe57]={'$like':'%'+_0x244e97[_0x6492('0x35')][_0x6492('0x41')]+'%'};return _0x4c23f9;})});}_0xd806a0=_[_0x6492('0x3f')]({},_0xd806a0,_0x244e97['options']);return db['ChatOfflineMessage'][_0x6492('0x24')]({'where':_0xd806a0[_0x6492('0x43')]})[_0x6492('0x15')](function(_0x54665d){_0x22df18[_0x6492('0x24')]=_0x54665d;if(_0x244e97['query'][_0x6492('0x4b')]){_0xd806a0[_0x6492('0x44')]=[{'all':!![]}];}else{_0xd806a0[_0x6492('0x44')]=[{'model':db['CmContact'],'as':_0x6492('0x113'),'required':![]},{'model':db[_0x6492('0x114')],'as':_0x6492('0x115'),'required':![]}];}return db[_0x6492('0x112')]['findAll'](_0xd806a0);})[_0x6492('0x15')](function(_0x2c36f4){_0x22df18[_0x6492('0x46')]=_0x2c36f4;return _0x22df18;});}})[_0x6492('0x15')](respondWithFilteredResult(_0xae6e53,_0xd806a0))[_0x6492('0x1d')](handleError(_0xae6e53,null));};exports[_0x6492('0x116')]=function(_0x52f927,_0x1c9255){return db[_0x6492('0x4c')]['find']({'where':{'id':_0x52f927[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x1c9255,null))[_0x6492('0x15')](function(_0x49cc9e){if(_0x49cc9e){return _0x49cc9e[_0x6492('0x116')](_0x52f927[_0x6492('0x4f')][_0x6492('0x5e')],_[_0x6492('0x10a')](_0x52f927[_0x6492('0x4f')],[_0x6492('0x5e'),'id'])||{})['spread'](function(_0x5d5f30){for(var _0x2ff847=0x0;_0x2ff847<_0x52f927[_0x6492('0x4f')][_0x6492('0x5e')][_0x6492('0x3a')];_0x2ff847+=0x1){socket[_0x6492('0x117')](_0x6492('0x118'),{'UserId':Number(_0x52f927[_0x6492('0x4f')][_0x6492('0x5e')][_0x2ff847]),'ChatWebsiteId':Number(_0x52f927[_0x6492('0x48')]['id'])});}return _0x5d5f30;});}})['then'](respondWithResult(_0x1c9255,null))['catch'](handleError(_0x1c9255,null));};exports['removeAgents']=function(_0xa4fd6f,_0x363f56){return db[_0x6492('0x4c')][_0x6492('0x4d')]({'where':{'id':_0xa4fd6f[_0x6492('0x48')]['id']}})[_0x6492('0x15')](handleEntityNotFound(_0x363f56,null))[_0x6492('0x15')](function(_0x9762bd){if(_0x9762bd){return _0x9762bd[_0x6492('0x119')](_0xa4fd6f[_0x6492('0x35')]['ids'])[_0x6492('0x15')](function(){if(_[_0x6492('0x11a')](_0xa4fd6f[_0x6492('0x35')][_0x6492('0x5e')])){for(var _0x828fc3=0x0;_0x828fc3<_0xa4fd6f[_0x6492('0x35')][_0x6492('0x5e')]['length'];_0x828fc3+=0x1){socket[_0x6492('0x117')]('userChatWebsite:remove',{'UserId':Number(_0xa4fd6f['query']['ids'][_0x828fc3]),'ChatWebsiteId':Number(_0xa4fd6f[_0x6492('0x48')]['id'])});}}else{socket[_0x6492('0x117')]('userChatWebsite:remove',{'UserId':Number(_0xa4fd6f[_0x6492('0x35')][_0x6492('0x5e')]),'ChatWebsiteId':Number(_0xa4fd6f[_0x6492('0x48')]['id'])});}});}})[_0x6492('0x15')](respondWithStatusCode(_0x363f56,null))[_0x6492('0x1d')](handleError(_0x363f56,null));};exports[_0x6492('0x11b')]=function(_0x2b2f2e,_0x390258){var _0x4b05da={};var _0x1fdb05={};var _0x2cbb8b;var _0x2375af;return db['ChatWebsite']['findOne']({'where':{'id':_0x2b2f2e[_0x6492('0x48')]['id']}})['then'](handleEntityNotFound(_0x390258,null))[_0x6492('0x15')](function(_0x4c920f){if(_0x4c920f){_0x2cbb8b=_0x4c920f;_0x1fdb05['model']=_['keys'](db['User']['rawAttributes']);_0x1fdb05[_0x6492('0x35')]=_[_0x6492('0x34')](_0x2b2f2e['query']);_0x1fdb05['filters']=_[_0x6492('0x37')](_0x1fdb05['model'],_0x1fdb05['query']);_0x4b05da[_0x6492('0x38')]=_[_0x6492('0x37')](_0x1fdb05[_0x6492('0x31')],qs[_0x6492('0x39')](_0x2b2f2e['query'][_0x6492('0x39')]));_0x4b05da[_0x6492('0x38')]=_0x4b05da[_0x6492('0x38')][_0x6492('0x3a')]?_0x4b05da[_0x6492('0x38')]:_0x1fdb05['model'];_0x4b05da[_0x6492('0x3c')]=qs[_0x6492('0x3d')](_0x2b2f2e[_0x6492('0x35')][_0x6492('0x3d')]);_0x4b05da[_0x6492('0x43')]=qs[_0x6492('0x36')](_[_0x6492('0x3e')](_0x2b2f2e[_0x6492('0x35')],_0x1fdb05['filters']));if(_0x2b2f2e['query'][_0x6492('0x41')]){_0x4b05da[_0x6492('0x43')]=_[_0x6492('0x3f')](_0x4b05da[_0x6492('0x43')],{'$or':_[_0x6492('0x32')](_0x4b05da['attributes'],function(_0x2704a8){var _0xa78ee2={};_0xa78ee2[_0x2704a8]={'$like':'%'+_0x2b2f2e[_0x6492('0x35')][_0x6492('0x41')]+'%'};return _0xa78ee2;})});}_0x4b05da=_[_0x6492('0x3f')]({},_0x4b05da,_0x2b2f2e[_0x6492('0x42')]);return _0x2cbb8b['getAgents'](_0x4b05da);}})[_0x6492('0x15')](function(_0x2f117a){if(_0x2f117a){_0x2375af=_0x2f117a[_0x6492('0x3a')];if(!_0x2b2f2e['query'][_0x6492('0x3b')](_0x6492('0xdc'))){_0x4b05da[_0x6492('0x23')]=qs[_0x6492('0x23')](_0x2b2f2e[_0x6492('0x35')][_0x6492('0x23')]);_0x4b05da[_0x6492('0x21')]=qs[_0x6492('0x21')](_0x2b2f2e[_0x6492('0x35')]['offset']);}return _0x2cbb8b[_0x6492('0x11b')](_0x4b05da);}})['then'](function(_0x17f2c3){if(_0x17f2c3){return _0x17f2c3?{'count':_0x2375af,'rows':_0x17f2c3}:null;}})[_0x6492('0x15')](respondWithResult(_0x390258,null))[_0x6492('0x1d')](handleError(_0x390258,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 5e71386..0768e9c 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 _0x4006=['../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hook','exports'];(function(_0x21e162,_0x7ccc2d){var _0x1e9290=function(_0x33edad){while(--_0x33edad){_0x21e162['push'](_0x21e162['shift']());}};_0x1e9290(++_0x7ccc2d);}(_0x4006,0x1c7));var _0x6400=function(_0x31d0e8,_0x5dfdac){_0x31d0e8=_0x31d0e8-0x0;var _0x3ab44c=_0x4006[_0x31d0e8];return _0x3ab44c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x6400('0x0'))['db'][_0x6400('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6400('0x2')](0x0);var events={'afterCreate':_0x6400('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xee0578){return function(_0x4b0418,_0xd858df,_0x59fba5){ChatWebsiteEvents['emit'](_0xee0578+':'+_0x4b0418['id'],_0x4b0418);ChatWebsiteEvents[_0x6400('0x4')](_0xee0578,_0x4b0418);_0x59fba5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x6400('0x5')](e,emitEvent(event));}}module[_0x6400('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x425d=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xd15e92,_0x1d4947){var _0x163a3c=function(_0x4cf719){while(--_0x4cf719){_0xd15e92['push'](_0xd15e92['shift']());}};_0x163a3c(++_0x1d4947);}(_0x425d,0x1e0));var _0xd425=function(_0xba6f5,_0x3c7d08){_0xba6f5=_0xba6f5-0x0;var _0x334f46=_0x425d[_0xba6f5];return _0x334f46;};'use strict';var EventEmitter=require(_0xd425('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xd425('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd425('0x2')](0x0);var events={'afterCreate':_0xd425('0x3'),'afterUpdate':_0xd425('0x4'),'afterDestroy':_0xd425('0x5')};function emitEvent(_0x44ba48){return function(_0x47043f,_0x596be7,_0x2987c5){ChatWebsiteEvents[_0xd425('0x6')](_0x44ba48+':'+_0x47043f['id'],_0x47043f);ChatWebsiteEvents[_0xd425('0x6')](_0x44ba48,_0x47043f);_0x2987c5(null);};}for(var e in events){if(events[_0xd425('0x7')](e)){var event=events[e];ChatWebsite[_0xd425('0x8')](e,emitEvent(event));}}module[_0xd425('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 0685e9b..8031c2e 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 _0x3228=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','lodash'];(function(_0xe10daf,_0x4fc3a8){var _0x27106b=function(_0x51a30e){while(--_0x51a30e){_0xe10daf['push'](_0xe10daf['shift']());}};_0x27106b(++_0x4fc3a8);}(_0x3228,0xef));var _0x8322=function(_0x3909f1,_0x3539d1){_0x3909f1=_0x3909f1-0x0;var _0x1084a5=_0x3228[_0x3909f1];return _0x1084a5;};'use strict';var _=require(_0x8322('0x0'));var util=require(_0x8322('0x1'));var logger=require(_0x8322('0x2'))(_0x8322('0x3'));var moment=require('moment');var BPromise=require(_0x8322('0x4'));var rp=require(_0x8322('0x5'));var fs=require('fs');var path=require(_0x8322('0x6'));var rimraf=require(_0x8322('0x7'));var config=require(_0x8322('0x8'));var attributes=require(_0x8322('0x9'));module[_0x8322('0xa')]=function(_0x291d83,_0x80c930){return _0x291d83['define'](_0x8322('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70fd=['../../config/environment','ChatWebsite','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x70fd,0xb6));var _0xd70f=function(_0x169639,_0x146136){_0x169639=_0x169639-0x0;var _0x277351=_0x70fd[_0x169639];return _0x277351;};'use strict';var _=require(_0xd70f('0x0'));var util=require(_0xd70f('0x1'));var logger=require(_0xd70f('0x2'))(_0xd70f('0x3'));var moment=require(_0xd70f('0x4'));var BPromise=require('bluebird');var rp=require(_0xd70f('0x5'));var fs=require('fs');var path=require(_0xd70f('0x6'));var rimraf=require(_0xd70f('0x7'));var config=require(_0xd70f('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x41eec4,_0x1063d4){return _0x41eec4['define'](_0xd70f('0x9'),attributes,{'tableName':'chat_websites','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 6841237..6e90a82 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 _0xbc3a=['ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','localhost','./chatWebsite.socket','register','then','info'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0xbc3a,0x167));var _0xabc3=function(_0x3e2030,_0x246751){_0x3e2030=_0x3e2030-0x0;var _0x30ddc1=_0xbc3a[_0x3e2030];return _0x30ddc1;};'use strict';var _=require(_0xabc3('0x0'));var util=require(_0xabc3('0x1'));var moment=require(_0xabc3('0x2'));var BPromise=require(_0xabc3('0x3'));var rs=require(_0xabc3('0x4'));var fs=require('fs');var Redis=require(_0xabc3('0x5'));var db=require(_0xabc3('0x6'))['db'];var utils=require(_0xabc3('0x7'));var logger=require(_0xabc3('0x8'))('rpc');var config=require(_0xabc3('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xabc3('0xa')]=_['defaults'](config[_0xabc3('0xa')],{'host':_0xabc3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabc3('0xa')]));require(_0xabc3('0xc'))[_0xabc3('0xd')](socket);function respondWithRpcPromise(_0xe86b51,_0x505ba5,_0x45e4ee){return new BPromise(function(_0x58c969,_0x43c443){return client['request'](_0xe86b51,_0x45e4ee)[_0xabc3('0xe')](function(_0x5ec5cd){logger[_0xabc3('0xf')](_0xabc3('0x10'),_0x505ba5,'request\x20sent');logger[_0xabc3('0x11')](_0xabc3('0x12'),_0x505ba5,_0xabc3('0x13'),JSON[_0xabc3('0x14')](_0x5ec5cd));if(_0x5ec5cd[_0xabc3('0x15')]){if(_0x5ec5cd[_0xabc3('0x15')][_0xabc3('0x16')]===0x1f4){logger['error'](_0xabc3('0x10'),_0x505ba5,_0x5ec5cd[_0xabc3('0x15')][_0xabc3('0x17')]);return _0x43c443(_0x5ec5cd[_0xabc3('0x15')][_0xabc3('0x17')]);}logger['error'](_0xabc3('0x10'),_0x505ba5,_0x5ec5cd[_0xabc3('0x15')][_0xabc3('0x17')]);return _0x58c969(_0x5ec5cd[_0xabc3('0x15')][_0xabc3('0x17')]);}else{logger[_0xabc3('0xf')](_0xabc3('0x10'),_0x505ba5,'request\x20sent');_0x58c969(_0x5ec5cd['result'][_0xabc3('0x17')]);}})[_0xabc3('0x18')](function(_0x2328e9){logger[_0xabc3('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x505ba5,_0x2328e9);_0x43c443(_0x2328e9);});});} \ No newline at end of file +var _0x885f=['socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost'];(function(_0x2c32de,_0x138844){var _0x1ad47e=function(_0xdcc172){while(--_0xdcc172){_0x2c32de['push'](_0x2c32de['shift']());}};_0x1ad47e(++_0x138844);}(_0x885f,0x112));var _0xf885=function(_0x57ec1a,_0x2b7624){_0x57ec1a=_0x57ec1a-0x0;var _0x2159ad=_0x885f[_0x57ec1a];return _0x2159ad;};'use strict';var _=require(_0xf885('0x0'));var util=require('util');var moment=require(_0xf885('0x1'));var BPromise=require('bluebird');var rs=require(_0xf885('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf885('0x3'))['db'];var utils=require(_0xf885('0x4'));var logger=require(_0xf885('0x5'))(_0xf885('0x6'));var config=require(_0xf885('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf885('0x8')]({'port':0x232a});config[_0xf885('0x9')]=_[_0xf885('0xa')](config['redis'],{'host':_0xf885('0xb'),'port':0x18eb});var socket=require(_0xf885('0xc'))(new Redis(config[_0xf885('0x9')]));require(_0xf885('0xd'))[_0xf885('0xe')](socket);function respondWithRpcPromise(_0x3f7d1e,_0x2f66fa,_0xdc0a71){return new BPromise(function(_0x218f79,_0x4838e1){return client[_0xf885('0xf')](_0x3f7d1e,_0xdc0a71)['then'](function(_0x3a38e8){logger[_0xf885('0x10')](_0xf885('0x11'),_0x2f66fa,_0xf885('0x12'));logger[_0xf885('0x13')](_0xf885('0x14'),_0x2f66fa,'request\x20sent',JSON[_0xf885('0x15')](_0x3a38e8));if(_0x3a38e8[_0xf885('0x16')]){if(_0x3a38e8[_0xf885('0x16')][_0xf885('0x17')]===0x1f4){logger[_0xf885('0x16')](_0xf885('0x11'),_0x2f66fa,_0x3a38e8['error'][_0xf885('0x18')]);return _0x4838e1(_0x3a38e8[_0xf885('0x16')][_0xf885('0x18')]);}logger[_0xf885('0x16')](_0xf885('0x11'),_0x2f66fa,_0x3a38e8[_0xf885('0x16')][_0xf885('0x18')]);return _0x218f79(_0x3a38e8[_0xf885('0x16')]['message']);}else{logger[_0xf885('0x10')](_0xf885('0x11'),_0x2f66fa,'request\x20sent');_0x218f79(_0x3a38e8[_0xf885('0x19')][_0xf885('0x18')]);}})['catch'](function(_0x1c9093){logger[_0xf885('0x16')](_0xf885('0x11'),_0x2f66fa,_0x1c9093);_0x4838e1(_0x1c9093);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 08d2cfb..49d07ec 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 _0x00a1=['update','emit','removeListener','register','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00a1,0x135));var _0x100a=function(_0x49abfc,_0x42e9a4){_0x49abfc=_0x49abfc-0x0;var _0x5d0c7d=_0x00a1[_0x49abfc];return _0x5d0c7d;};'use strict';var ChatWebsiteEvents=require(_0x100a('0x0'));var events=[_0x100a('0x1'),_0x100a('0x2'),_0x100a('0x3')];function createListener(_0x10bbae,_0x3aec30){return function(_0x5096a8){_0x3aec30[_0x100a('0x4')](_0x10bbae,_0x5096a8);};}function removeListener(_0x565258,_0x24d67b){return function(){ChatWebsiteEvents[_0x100a('0x5')](_0x565258,_0x24d67b);};}exports[_0x100a('0x6')]=function(_0x56a6c5){for(var _0x5c7993=0x0,_0x4ddd4f=events['length'];_0x5c7993<_0x4ddd4f;_0x5c7993++){var _0x3dcc11=events[_0x5c7993];var _0x2fe4b9=createListener(_0x100a('0x7')+_0x3dcc11,_0x56a6c5);ChatWebsiteEvents['on'](_0x3dcc11,_0x2fe4b9);}}; \ No newline at end of file +var _0xef22=['remove','update','emit','register','length','chatWebsite:','save'];(function(_0x109770,_0x3bbe1d){var _0x2843fe=function(_0x22bf4a){while(--_0x22bf4a){_0x109770['push'](_0x109770['shift']());}};_0x2843fe(++_0x3bbe1d);}(_0xef22,0xae));var _0x2ef2=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xef22[_0x31cb5f];return _0x586042;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x2ef2('0x0'),_0x2ef2('0x1'),_0x2ef2('0x2')];function createListener(_0x3891f9,_0x21c193){return function(_0x16037f){_0x21c193[_0x2ef2('0x3')](_0x3891f9,_0x16037f);};}function removeListener(_0x5f36fe,_0x189cf6){return function(){ChatWebsiteEvents['removeListener'](_0x5f36fe,_0x189cf6);};}exports[_0x2ef2('0x4')]=function(_0x2f2045){for(var _0x4127e9=0x0,_0x43367b=events[_0x2ef2('0x5')];_0x4127e9<_0x43367b;_0x4127e9++){var _0xdf58b7=events[_0x4127e9];var _0x4d0e3b=createListener(_0x2ef2('0x6')+_0xdf58b7,_0x2f2045);ChatWebsiteEvents['on'](_0xdf58b7,_0x4d0e3b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 78b10a8..64dbc40 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 _0xe318=['get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','create','post','addDisposition','diskStorage','join','root','format','%s-%s','now','originalname','single','server/files/images/avatars/','addAvatar','/:id/customer_avatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','extname','replace','/:id/offline','offline','addInteraction','addApplications','put','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller'];(function(_0x508c0e,_0x537a56){var _0x11848c=function(_0x1b76e6){while(--_0x1b76e6){_0x508c0e['push'](_0x508c0e['shift']());}};_0x11848c(++_0x537a56);}(_0xe318,0x19b));var _0x8e31=function(_0x27502f,_0x3f6b82){_0x27502f=_0x27502f-0x0;var _0xc74f09=_0xe318[_0x27502f];return _0xc74f09;};'use strict';var multer=require('multer');var util=require(_0x8e31('0x0'));var path=require(_0x8e31('0x1'));var timeout=require(_0x8e31('0x2'));var express=require(_0x8e31('0x3'));var router=express['Router']();var fs_extra=require(_0x8e31('0x4'));var auth=require(_0x8e31('0x5'));var interaction=require(_0x8e31('0x6'));var config=require(_0x8e31('0x7'));var controller=require(_0x8e31('0x8'));router[_0x8e31('0x9')]('/',auth[_0x8e31('0xa')](),controller[_0x8e31('0xb')]);router[_0x8e31('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8e31('0xc'),auth[_0x8e31('0xa')](),controller[_0x8e31('0xd')]);router['get'](_0x8e31('0xe'),auth[_0x8e31('0xa')](),controller[_0x8e31('0xf')]);router[_0x8e31('0x9')](_0x8e31('0x10'),auth['isAuthenticated'](),controller[_0x8e31('0x11')]);router[_0x8e31('0x9')](_0x8e31('0x12'),controller[_0x8e31('0x13')]);router[_0x8e31('0x9')](_0x8e31('0x14'),controller[_0x8e31('0x15')]);router['get']('/:id/customer_avatar',controller[_0x8e31('0x16')]);router['get'](_0x8e31('0x17'),controller[_0x8e31('0x18')]);router[_0x8e31('0x9')](_0x8e31('0x19'),auth[_0x8e31('0xa')](),controller[_0x8e31('0x1a')]);router[_0x8e31('0x9')](_0x8e31('0x1b'),controller[_0x8e31('0x1c')]);router[_0x8e31('0x9')](_0x8e31('0x1d'),auth[_0x8e31('0xa')](),controller[_0x8e31('0x1e')]);router[_0x8e31('0x9')](_0x8e31('0x1f'),auth[_0x8e31('0xa')](),controller[_0x8e31('0x20')]);router[_0x8e31('0x9')](_0x8e31('0x21'),controller[_0x8e31('0x22')]);router[_0x8e31('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x8e31('0x23')]);router[_0x8e31('0x9')](_0x8e31('0x24'),auth[_0x8e31('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x8e31('0x25')]);router[_0x8e31('0x26')](_0x8e31('0xe'),auth['isAuthenticated'](),controller[_0x8e31('0x27')]);router[_0x8e31('0x26')](_0x8e31('0x10'),auth[_0x8e31('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x8e31('0x28')]({'destination':function(_0x331077,_0x30b5bc,_0x487cd8){_0x487cd8(null,path[_0x8e31('0x29')](config[_0x8e31('0x2a')],'server/files/images/logos/'));},'filename':function(_0x4ffa3a,_0x52ce38,_0x275768){_0x275768(null,util[_0x8e31('0x2b')](_0x8e31('0x2c'),Date[_0x8e31('0x2d')](),_0x52ce38[_0x8e31('0x2e')]));}})});router[_0x8e31('0x26')]('/:id/logo',upload[_0x8e31('0x2f')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x8e31('0x28')]({'destination':function(_0xc904e9,_0x5235ce,_0x27364b){_0x27364b(null,path[_0x8e31('0x29')](config[_0x8e31('0x2a')],_0x8e31('0x30')));},'filename':function(_0x23709a,_0xd5299e,_0x599beb){_0x599beb(null,util[_0x8e31('0x2b')]('%s-%s',Date['now'](),_0xd5299e['originalname']));}})});router[_0x8e31('0x26')]('/:id/avatar',upload['single']('file'),controller[_0x8e31('0x31')]);var upload=multer({'storage':multer[_0x8e31('0x28')]({'destination':function(_0x32cd74,_0x45f202,_0x124962){_0x124962(null,path[_0x8e31('0x29')](config[_0x8e31('0x2a')],_0x8e31('0x30')));},'filename':function(_0x595744,_0x1e3d7d,_0x29cc49){_0x29cc49(null,util[_0x8e31('0x2b')](_0x8e31('0x2c'),Date[_0x8e31('0x2d')](),_0x1e3d7d[_0x8e31('0x2e')]));}})});router[_0x8e31('0x26')](_0x8e31('0x32'),upload['single'](_0x8e31('0x33')),controller[_0x8e31('0x34')]);var upload=multer({'storage':multer[_0x8e31('0x28')]({'destination':function(_0x40d2ee,_0x4a900f,_0x3e06e8){_0x3e06e8(null,path[_0x8e31('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2ace4e,_0x400fda,_0x4f883b){_0x4f883b(null,util[_0x8e31('0x2b')](_0x8e31('0x2c'),Date[_0x8e31('0x2d')](),_0x400fda[_0x8e31('0x2e')]));}})});router[_0x8e31('0x26')](_0x8e31('0x17'),upload['single'](_0x8e31('0x33')),controller[_0x8e31('0x35')]);router['post'](_0x8e31('0x36'),controller[_0x8e31('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x8e31('0x28')]({'destination':function(_0x4d43c7,_0x4af943,_0x2b11ad){const _0x2ac5ba=path['join'](config[_0x8e31('0x2a')],_0x8e31('0x38'),_0x8e31('0x39'),_0x8e31('0x3a'));fs_extra['ensureDir'](_0x2ac5ba,function(){_0x2b11ad(null,_0x2ac5ba);});},'filename':function(_0x24d30c,_0x5dfc33,_0x3e1740){const _0x585288=_0x5dfc33[_0x8e31('0x2e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x34c74d=path[_0x8e31('0x3b')](_0x585288);const _0x3495a8=Date[_0x8e31('0x2d')]()+'-'+_0x585288[_0x8e31('0x3c')](_0x34c74d,'')+_0x34c74d;_0x3e1740(null,_0x3495a8);}})});router['post'](_0x8e31('0x3d'),offlineUploadMulter['any'](),controller[_0x8e31('0x3e')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x8e31('0x3f')]);router[_0x8e31('0x26')](_0x8e31('0x1d'),auth[_0x8e31('0xa')](),controller[_0x8e31('0x40')]);router[_0x8e31('0x26')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x8e31('0xa')](),controller['addAgents']);router[_0x8e31('0x41')](_0x8e31('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8e31('0x42')](_0x8e31('0xc'),auth[_0x8e31('0xa')](),controller[_0x8e31('0x43')]);router[_0x8e31('0x42')](_0x8e31('0xe'),auth[_0x8e31('0xa')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x8e31('0xa')](),controller['removeAnswers']);router['delete'](_0x8e31('0x24'),auth[_0x8e31('0xa')](),controller[_0x8e31('0x44')]);module[_0x8e31('0x45')]=router; \ No newline at end of file +var _0xabc8=['removeDispositions','removeAnswers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','delete','destroy'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xabc8,0x1b3));var _0x8abc=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0xabc8[_0x2c0ded];return _0x4473e5;};'use strict';var multer=require(_0x8abc('0x0'));var util=require(_0x8abc('0x1'));var path=require(_0x8abc('0x2'));var timeout=require('connect-timeout');var express=require(_0x8abc('0x3'));var router=express[_0x8abc('0x4')]();var fs_extra=require(_0x8abc('0x5'));var auth=require(_0x8abc('0x6'));var interaction=require(_0x8abc('0x7'));var config=require('../../config/environment');var controller=require(_0x8abc('0x8'));router[_0x8abc('0x9')]('/',auth[_0x8abc('0xa')](),controller['index']);router['get'](_0x8abc('0xb'),auth['isAuthenticated'](),controller[_0x8abc('0xc')]);router[_0x8abc('0x9')](_0x8abc('0xd'),auth[_0x8abc('0xa')](),controller[_0x8abc('0xe')]);router[_0x8abc('0x9')]('/:id/dispositions',auth[_0x8abc('0xa')](),controller[_0x8abc('0xf')]);router[_0x8abc('0x9')](_0x8abc('0x10'),auth[_0x8abc('0xa')](),controller[_0x8abc('0x11')]);router[_0x8abc('0x9')](_0x8abc('0x12'),controller[_0x8abc('0x13')]);router[_0x8abc('0x9')](_0x8abc('0x14'),controller[_0x8abc('0x15')]);router[_0x8abc('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x8abc('0x9')]('/:id/system_avatar',controller['getSystemAvatar']);router['get'](_0x8abc('0x16'),auth[_0x8abc('0xa')](),controller['getInteractions']);router[_0x8abc('0x9')](_0x8abc('0x17'),controller['getSnippet']);router['get'](_0x8abc('0x18'),auth[_0x8abc('0xa')](),controller[_0x8abc('0x19')]);router[_0x8abc('0x9')](_0x8abc('0x1a'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x8abc('0x9')](_0x8abc('0x1b'),controller[_0x8abc('0x1c')]);router['get']('/:id/offline_messages',auth[_0x8abc('0xa')](),controller[_0x8abc('0x1d')]);router[_0x8abc('0x9')](_0x8abc('0x1e'),auth['isAuthenticated'](),controller[_0x8abc('0x1f')]);router[_0x8abc('0x20')]('/',auth[_0x8abc('0xa')](),controller['create']);router[_0x8abc('0x20')](_0x8abc('0x21'),auth[_0x8abc('0xa')](),controller[_0x8abc('0x22')]);router[_0x8abc('0x20')](_0x8abc('0x10'),auth[_0x8abc('0xa')](),controller[_0x8abc('0x23')]);var upload=multer({'storage':multer[_0x8abc('0x24')]({'destination':function(_0x2a86a2,_0x2c736b,_0xd7e05f){_0xd7e05f(null,path['join'](config[_0x8abc('0x25')],_0x8abc('0x26')));},'filename':function(_0x3a641e,_0xc68861,_0x4a2706){_0x4a2706(null,util[_0x8abc('0x27')](_0x8abc('0x28'),Date[_0x8abc('0x29')](),_0xc68861[_0x8abc('0x2a')]));}})});router[_0x8abc('0x20')](_0x8abc('0x12'),upload[_0x8abc('0x2b')](_0x8abc('0x2c')),controller[_0x8abc('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x40fb49,_0x53633d,_0x58168d){_0x58168d(null,path[_0x8abc('0x2e')](config[_0x8abc('0x25')],'server/files/images/avatars/'));},'filename':function(_0x29879d,_0x25c7af,_0x2b1747){_0x2b1747(null,util[_0x8abc('0x27')](_0x8abc('0x28'),Date[_0x8abc('0x29')](),_0x25c7af[_0x8abc('0x2a')]));}})});router[_0x8abc('0x20')](_0x8abc('0x14'),upload['single'](_0x8abc('0x2c')),controller[_0x8abc('0x2f')]);var upload=multer({'storage':multer[_0x8abc('0x24')]({'destination':function(_0x429cb5,_0x529647,_0x2ea8bc){_0x2ea8bc(null,path[_0x8abc('0x2e')](config['root'],_0x8abc('0x30')));},'filename':function(_0x208703,_0x19774c,_0x2282a0){_0x2282a0(null,util[_0x8abc('0x27')](_0x8abc('0x28'),Date[_0x8abc('0x29')](),_0x19774c['originalname']));}})});router[_0x8abc('0x20')](_0x8abc('0x31'),upload[_0x8abc('0x2b')]('file'),controller[_0x8abc('0x32')]);var upload=multer({'storage':multer[_0x8abc('0x24')]({'destination':function(_0x103fd6,_0x4598cc,_0x171386){_0x171386(null,path['join'](config[_0x8abc('0x25')],_0x8abc('0x30')));},'filename':function(_0xef01ca,_0x160061,_0x50f78c){_0x50f78c(null,util[_0x8abc('0x27')](_0x8abc('0x28'),Date[_0x8abc('0x29')](),_0x160061[_0x8abc('0x2a')]));}})});router[_0x8abc('0x20')](_0x8abc('0x33'),upload[_0x8abc('0x2b')]('file'),controller['addSystemAvatar']);router[_0x8abc('0x20')](_0x8abc('0x34'),controller[_0x8abc('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x8abc('0x24')]({'destination':function(_0x1a2861,_0x5344af,_0x56fad2){const _0x4a98ed=path[_0x8abc('0x2e')](config[_0x8abc('0x25')],_0x8abc('0x36'),_0x8abc('0x37'),_0x8abc('0x38'));fs_extra[_0x8abc('0x39')](_0x4a98ed,function(){_0x56fad2(null,_0x4a98ed);});},'filename':function(_0x35f226,_0xb0facf,_0x426742){const _0x2c177a=_0xb0facf[_0x8abc('0x2a')][_0x8abc('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4945e6=path[_0x8abc('0x3b')](_0x2c177a);const _0x14b948=Date[_0x8abc('0x29')]()+'-'+_0x2c177a[_0x8abc('0x3a')](_0x4945e6,'')+_0x4945e6;_0x426742(null,_0x14b948);}})});router[_0x8abc('0x20')](_0x8abc('0x3c'),offlineUploadMulter[_0x8abc('0x3d')](),controller[_0x8abc('0x3e')]);router['post'](_0x8abc('0x16'),auth[_0x8abc('0xa')](),controller[_0x8abc('0x3f')]);router[_0x8abc('0x20')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x8abc('0x20')](_0x8abc('0x1a'),auth['isAuthenticated'](),controller[_0x8abc('0x40')]);router[_0x8abc('0x20')](_0x8abc('0x1e'),auth['isAuthenticated'](),controller[_0x8abc('0x41')]);router[_0x8abc('0x42')](_0x8abc('0xd'),auth[_0x8abc('0xa')](),controller['update']);router[_0x8abc('0x43')](_0x8abc('0xd'),auth[_0x8abc('0xa')](),controller[_0x8abc('0x44')]);router[_0x8abc('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8abc('0x45')]);router[_0x8abc('0x43')]('/:id/canned_answers',auth[_0x8abc('0xa')](),controller[_0x8abc('0x46')]);router[_0x8abc('0x43')]('/:id/users',auth[_0x8abc('0xa')](),controller['removeAgents']);module[_0x8abc('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 8c5bd5b..07b8722 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 _0x377c=['production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','Router','env'];(function(_0x1ff63f,_0x186732){var _0x16e7af=function(_0x4f9b8f){while(--_0x4f9b8f){_0x1ff63f['push'](_0x1ff63f['shift']());}};_0x16e7af(++_0x186732);}(_0x377c,0xb0));var _0xc377=function(_0x53b54f,_0x9d441f){_0x53b54f=_0x53b54f-0x0;var _0x260f03=_0x377c[_0x53b54f];return _0x260f03;};var beaverLogger=require(_0xc377('0x0'));var express=require(_0xc377('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0xc377('0x2')]();var isProduction=config[_0xc377('0x3')]===_0xc377('0x4')||![];function clientSideLogs(_0x57905e,_0x2fbdb8,_0x6af38a){var _0xc9b959=_0x57905e['app'][_0xc377('0x5')](_0xc377('0x6'));if(!_0xc9b959){throw new Error(_0xc377('0x7'));}return beaverLogger[_0xc377('0x8')]({'uri':_0xc377('0x9'),'logger':_0xc9b959,'enableCors':!isProduction})(_0x57905e,_0x2fbdb8,_0x6af38a);}router[_0xc377('0xa')](auth['isAuthenticated'](),clientSideLogs);module[_0xc377('0xb')]=router; \ No newline at end of file +var _0xadc6=['../components/auth/service','../config/environment','Router','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xadc6,0x15c));var _0x6adc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xadc6[_0x2d7f0e];return _0x110b07;};var beaverLogger=require(_0x6adc('0x0'));var express=require(_0x6adc('0x1'));var auth=require(_0x6adc('0x2'));var config=require(_0x6adc('0x3'));var router=express[_0x6adc('0x4')]();var isProduction=config['env']===_0x6adc('0x5')||![];function clientSideLogs(_0x417d40,_0xf7cef9,_0x2d7533){var _0x4026dc=_0x417d40[_0x6adc('0x6')]['get'](_0x6adc('0x7'));if(!_0x4026dc){throw new Error(_0x6adc('0x8'));}return beaverLogger[_0x6adc('0x9')]({'uri':_0x6adc('0xa'),'logger':_0x4026dc,'enableCors':!isProduction})(_0x417d40,_0xf7cef9,_0x2d7533);}router[_0x6adc('0xb')](auth[_0x6adc('0xc')](),clientSideLogs);module[_0x6adc('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 9db59f4..e4baf38 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 _0x4c3d=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','Google','MicrosoftAzure','ENUM'];(function(_0x4e0026,_0x2b52b6){var _0x3f8ee7=function(_0x31d891){while(--_0x31d891){_0x4e0026['push'](_0x4e0026['shift']());}};_0x3f8ee7(++_0x2b52b6);}(_0x4c3d,0x166));var _0xd4c3=function(_0x4d4a98,_0x55d80b){_0x4d4a98=_0x4d4a98-0x0;var _0x50ba72=_0x4c3d[_0x4d4a98];return _0x50ba72;};'use strict';var Sequelize=require(_0xd4c3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd4c3('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xd4c3('0x2'),_0xd4c3('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd4c3('0x4')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xd4c3('0x1')],'comment':_0xd4c3('0x5')},'data2':{'type':Sequelize[_0xd4c3('0x1')],'comment':_0xd4c3('0x6')},'data3':{'type':Sequelize[_0xd4c3('0x1')],'comment':_0xd4c3('0x7')},'data4':{'type':Sequelize[_0xd4c3('0x1')],'comment':_0xd4c3('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xd4c3('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xd4c3('0x9')],'comment':_0xd4c3('0xa')}}; \ No newline at end of file +var _0x572d=['exports','STRING','ENUM','AmazonAWS','Google','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x572d,0x10d));var _0xd572=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x572d[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0xd572('0x0'));module[_0xd572('0x1')]={'name':{'type':Sequelize[_0xd572('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd572('0x3')](_0xd572('0x4'),_0xd572('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd572('0x6'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xd572('0x7')},'data2':{'type':Sequelize[_0xd572('0x2')],'comment':_0xd572('0x8')},'data3':{'type':Sequelize[_0xd572('0x2')],'comment':_0xd572('0x9')},'data4':{'type':Sequelize[_0xd572('0x2')],'comment':_0xd572('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xd572('0xb')},'data6':{'type':Sequelize[_0xd572('0xc')],'comment':_0xd572('0xd')},'data7':{'type':Sequelize[_0xd572('0xc')],'comment':_0xd572('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index bb2c20a..9f4692c 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 _0x1746=['lodash','../../components/parsers/qs','../../config/environment','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','service','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify'];(function(_0x1e340c,_0x4aba92){var _0x7f79e0=function(_0x19af00){while(--_0x19af00){_0x1e340c['push'](_0x1e340c['shift']());}};_0x7f79e0(++_0x4aba92);}(_0x1746,0x190));var _0x6174=function(_0x1a8b2c,_0x200c12){_0x1a8b2c=_0x1a8b2c-0x0;var _0x6dda1d=_0x1746[_0x1a8b2c];return _0x6dda1d;};'use strict';var _=require(_0x6174('0x0'));var Redis=require('ioredis');var qs=require(_0x6174('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x6174('0x2'));var logger=require('../../config/logger')(_0x6174('0x3'));var db=require('../../mysqldb')['db'];var oauth=require(_0x6174('0x4'));config[_0x6174('0x5')]=_[_0x6174('0x6')](config[_0x6174('0x5')],{'host':_0x6174('0x7'),'port':0x18eb});var socket=require(_0x6174('0x8'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x220912,_0x483ed9){_0x483ed9=_0x483ed9||0xcc;return function(_0x344035){if(_0x344035){return _0x220912['sendStatus'](_0x483ed9);}return _0x220912[_0x6174('0x9')](_0x483ed9)[_0x6174('0xa')]();};}function respondWithResult(_0xf03657,_0x33a61d){_0x33a61d=_0x33a61d||0xc8;return function(_0x7ec2fc){if(_0x7ec2fc){return _0xf03657[_0x6174('0x9')](_0x33a61d)[_0x6174('0xb')](_0x7ec2fc);}};}function respondWithFilteredResult(_0x365cdf,_0x5429cb){return function(_0x55ab50){if(_0x55ab50){var _0x1ee06f=typeof _0x5429cb[_0x6174('0xc')]===_0x6174('0xd')&&typeof _0x5429cb[_0x6174('0xe')]==='undefined';var _0x3d97e8=_0x55ab50['count'];var _0x14c251=_0x1ee06f?0x0:_0x5429cb[_0x6174('0xc')];var _0x646898=_0x1ee06f?_0x55ab50[_0x6174('0xf')]:_0x5429cb[_0x6174('0xc')]+_0x5429cb[_0x6174('0xe')];var _0x3e760a;if(_0x646898>=_0x3d97e8){_0x646898=_0x3d97e8;_0x3e760a=0xc8;}else{_0x3e760a=0xce;}_0x365cdf[_0x6174('0x9')](_0x3e760a);return _0x365cdf[_0x6174('0x10')](_0x6174('0x11'),_0x14c251+'-'+_0x646898+'/'+_0x3d97e8)[_0x6174('0xb')](_0x55ab50);}return null;};}function saveUpdates(_0xfe347e){return function(_0x3fc50b){if(_0x3fc50b){return _0x3fc50b['update'](_0xfe347e)[_0x6174('0x12')](function(_0x423764){return _0x423764;});}return null;};}function removeEntity(_0x17688d){return function(_0x200b49){if(_0x200b49){return _0x200b49[_0x6174('0x13')]()[_0x6174('0x12')](function(){_0x17688d[_0x6174('0x9')](0xcc)[_0x6174('0xa')]();});}};}function handleEntityNotFound(_0x23a929){return function(_0x18e033){if(!_0x18e033){_0x23a929[_0x6174('0x14')](0x194);}return _0x18e033;};}function handleError(_0x519280,_0x1f34ca){_0x1f34ca=_0x1f34ca||0x1f4;return function(_0xa73539){logger[_0x6174('0x15')](_0xa73539[_0x6174('0x16')]);if(_0xa73539['name']){delete _0xa73539[_0x6174('0x17')];}_0x519280[_0x6174('0x9')](_0x1f34ca)[_0x6174('0x18')](_0xa73539);};}function maskClientSecret(_0x5215bf){return _['padEnd'](_0x5215bf[_0x6174('0x19')](0x0,0x3),0x14,'*');}exports[_0x6174('0x1a')]=function(_0x3fed1d,_0x255324){var _0x367ae1={},_0x3e80a4={},_0x5a7153={'count':0x0,'rows':[]};var _0xd1638=_[_0x6174('0x1b')](db[_0x6174('0x1c')][_0x6174('0x1d')],function(_0x402b66){return{'name':_0x402b66[_0x6174('0x1e')],'type':_0x402b66[_0x6174('0x1f')][_0x6174('0x20')]};});_0x3e80a4[_0x6174('0x21')]=_[_0x6174('0x1b')](_0xd1638,_0x6174('0x17'));_0x3e80a4[_0x6174('0x22')]=_[_0x6174('0x23')](_0x3fed1d[_0x6174('0x22')]);_0x3e80a4[_0x6174('0x24')]=_[_0x6174('0x25')](_0x3e80a4[_0x6174('0x21')],_0x3e80a4[_0x6174('0x22')]);_0x367ae1[_0x6174('0x26')]=_[_0x6174('0x25')](_0x3e80a4['model'],qs[_0x6174('0x27')](_0x3fed1d[_0x6174('0x22')][_0x6174('0x27')]));_0x367ae1[_0x6174('0x26')]=_0x367ae1[_0x6174('0x26')][_0x6174('0x28')]?_0x367ae1[_0x6174('0x26')]:_0x3e80a4[_0x6174('0x21')];if(!_0x3fed1d[_0x6174('0x22')][_0x6174('0x29')](_0x6174('0x2a'))){_0x367ae1[_0x6174('0xe')]=qs['limit'](_0x3fed1d[_0x6174('0x22')][_0x6174('0xe')]);_0x367ae1[_0x6174('0xc')]=qs['offset'](_0x3fed1d[_0x6174('0x22')]['offset']);}_0x367ae1[_0x6174('0x2b')]=qs['sort'](_0x3fed1d[_0x6174('0x22')][_0x6174('0x2c')]);_0x367ae1['where']=qs[_0x6174('0x24')](_[_0x6174('0x2d')](_0x3fed1d[_0x6174('0x22')],_0x3e80a4[_0x6174('0x24')]),_0xd1638);if(_0x3fed1d[_0x6174('0x22')][_0x6174('0x2e')]){_0x367ae1[_0x6174('0x2f')]=_[_0x6174('0x30')](_0x367ae1[_0x6174('0x2f')],{'$or':_[_0x6174('0x1b')](_0xd1638,function(_0x4117bb){if(_0x4117bb['type']!==_0x6174('0x31')){var _0x4b0870={};_0x4b0870[_0x4117bb['name']]={'$like':'%'+_0x3fed1d[_0x6174('0x22')][_0x6174('0x2e')]+'%'};return _0x4b0870;}})});}_0x367ae1=_['merge']({},_0x367ae1,_0x3fed1d[_0x6174('0x32')]);var _0x1e1018={'where':_0x367ae1[_0x6174('0x2f')]};return db[_0x6174('0x1c')][_0x6174('0xf')](_0x1e1018)[_0x6174('0x12')](function(_0x40aa65){_0x5a7153[_0x6174('0xf')]=_0x40aa65;if(_0x3fed1d[_0x6174('0x22')][_0x6174('0x33')]){_0x367ae1[_0x6174('0x34')]=[{'all':!![]}];}return db[_0x6174('0x1c')]['findAll'](_0x367ae1);})[_0x6174('0x12')](function(_0x1a5643){_0x5a7153[_0x6174('0x35')]=_[_0x6174('0x1b')](_0x1a5643,function(_0x3f1366){if(_0x3f1366['service']===_0x6174('0x36')){var _0x2e4e33=encryptor[_0x6174('0x37')](_0x3f1366[_0x6174('0x38')]);_0x3f1366['data3']=maskClientSecret(_0x2e4e33);}return _0x3f1366;});return _0x5a7153;})[_0x6174('0x12')](respondWithFilteredResult(_0x255324,_0x367ae1))[_0x6174('0x39')](handleError(_0x255324,null));};exports[_0x6174('0x3a')]=function(_0x1079d9,_0x2e4b18){var _0x5c2fc2={'raw':!![],'where':{'id':_0x1079d9[_0x6174('0x3b')]['id']}},_0x589a71={};_0x589a71[_0x6174('0x21')]=_[_0x6174('0x23')](db[_0x6174('0x1c')]['rawAttributes']);_0x589a71[_0x6174('0x22')]=_[_0x6174('0x23')](_0x1079d9[_0x6174('0x22')]);_0x589a71[_0x6174('0x24')]=_[_0x6174('0x25')](_0x589a71['model'],_0x589a71[_0x6174('0x22')]);_0x5c2fc2['attributes']=_[_0x6174('0x25')](_0x589a71['model'],qs[_0x6174('0x27')](_0x1079d9['query'][_0x6174('0x27')]));_0x5c2fc2[_0x6174('0x26')]=_0x5c2fc2['attributes'][_0x6174('0x28')]?_0x5c2fc2[_0x6174('0x26')]:_0x589a71[_0x6174('0x21')];if(_0x1079d9['query']['includeAll']){_0x5c2fc2[_0x6174('0x34')]=[{'all':!![]}];}_0x5c2fc2=_[_0x6174('0x30')]({},_0x5c2fc2,_0x1079d9[_0x6174('0x32')]);return db['CloudProvider'][_0x6174('0x3c')](_0x5c2fc2)[_0x6174('0x12')](handleEntityNotFound(_0x2e4b18,null))[_0x6174('0x12')](function(_0x39c50e){if(_0x39c50e['service']===_0x6174('0x36')){var _0x43e648=encryptor[_0x6174('0x37')](_0x39c50e[_0x6174('0x38')]);_0x39c50e[_0x6174('0x38')]=maskClientSecret(_0x43e648);}return _0x39c50e;})[_0x6174('0x12')](respondWithResult(_0x2e4b18,null))['catch'](handleError(_0x2e4b18,null));};exports[_0x6174('0x3d')]=function(_0x378091,_0x3a50db){if(!_0x378091[_0x6174('0x3e')]['name'])throw new Error(_0x6174('0x3f'));if(!_0x378091['body']['service'])throw new Error(_0x6174('0x40'));var _0x4a0e01=db[_0x6174('0x1c')][_0x6174('0x1d')][_0x6174('0x41')][_0x6174('0x42')];if(!_0x4a0e01[_0x6174('0x43')](_0x378091[_0x6174('0x3e')][_0x6174('0x41')]))throw new Error(_0x6174('0x44')+_0x4a0e01[_0x6174('0x45')](',\x20'));if(_0x378091[_0x6174('0x3e')][_0x6174('0x41')]===_0x6174('0x36')&&_0x378091[_0x6174('0x3e')]['data3']){_0x378091[_0x6174('0x3e')][_0x6174('0x38')]=encryptor[_0x6174('0x46')](_0x378091[_0x6174('0x3e')][_0x6174('0x38')]);}return db[_0x6174('0x1c')]['create'](_0x378091[_0x6174('0x3e')],{})[_0x6174('0x12')](respondWithResult(_0x3a50db,0xc9))['catch'](handleError(_0x3a50db,null));};exports[_0x6174('0x47')]=function(_0x42e9fc,_0x1d98bc){if(_0x42e9fc[_0x6174('0x3e')]['id']){delete _0x42e9fc[_0x6174('0x3e')]['id'];}return db['CloudProvider'][_0x6174('0x3c')]({'where':{'id':_0x42e9fc[_0x6174('0x3b')]['id']}})[_0x6174('0x12')](handleEntityNotFound(_0x1d98bc,null))[_0x6174('0x12')](function(_0x510074){if(_0x510074[_0x6174('0x41')]===_0x6174('0x36')&&_0x42e9fc['body']['data3']){_0x42e9fc[_0x6174('0x3e')][_0x6174('0x38')]=encryptor['encryptString'](_0x42e9fc[_0x6174('0x3e')][_0x6174('0x38')]);}return _0x510074;})[_0x6174('0x12')](saveUpdates(_0x42e9fc[_0x6174('0x3e')],null))['then'](respondWithResult(_0x1d98bc,null))[_0x6174('0x39')](handleError(_0x1d98bc,null));};exports[_0x6174('0x13')]=function(_0x360488,_0x3ca751){return db[_0x6174('0x1c')][_0x6174('0x3c')]({'where':{'id':_0x360488[_0x6174('0x3b')]['id']}})[_0x6174('0x12')](handleEntityNotFound(_0x3ca751,null))[_0x6174('0x12')](removeEntity(_0x3ca751,null))['catch'](handleError(_0x3ca751,null));};exports[_0x6174('0x48')]=function(_0x44041d,_0x2ccfaa){return db['CloudProvider'][_0x6174('0x49')]({'where':{'id':_0x44041d['params']['id']},'raw':!![]})[_0x6174('0x12')](function(_0x34fb5){if(!_0x34fb5)return _0x2ccfaa[_0x6174('0x14')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x34fb5,_0x44041d[_0x6174('0x4a')]['id'])};})[_0x6174('0x12')](respondWithResult(_0x2ccfaa,null))[_0x6174('0x39')](handleError(_0x2ccfaa,null));};exports[_0x6174('0x4b')]=function(_0x50d988,_0x19c071){var _0x1a792d=_0x50d988[_0x6174('0x3e')];var _0x2d000f;var _0x5dc577;if(_0x1a792d[_0x6174('0x15')])throw _0x1a792d;redis[_0x6174('0x4c')](_0x1a792d[_0x6174('0x4d')])[_0x6174('0x12')](function(_0xfd1efd){if(!_0xfd1efd)throw new Error(_0x6174('0x4e'));_0x2d000f=JSON[_0x6174('0x4f')](_0xfd1efd);var _0x504800=Buffer['from'](_0x1a792d[_0x6174('0x4d')],_0x6174('0x50'))[_0x6174('0x51')](_0x6174('0x52'));_0x5dc577=JSON['parse'](_0x504800);if(!oauth[_0x6174('0x53')](_0x1a792d[_0x6174('0x54')],_0x2d000f[_0x6174('0x55')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x6174('0x56')](_0x1a792d[_0x6174('0x4d')]);return oauth[_0x6174('0x57')](_0x1a792d[_0x6174('0x58')],_0x2d000f);})[_0x6174('0x12')](function(_0x11d6cd){_0x2d000f[_0x6174('0x59')]=_0x11d6cd[_0x6174('0x5a')];_0x2d000f[_0x6174('0x5b')]=_0x11d6cd[_0x6174('0x5c')];return db['CloudProvider']['update']({'data5':_0x2d000f[_0x6174('0x59')],'data6':_0x2d000f[_0x6174('0x5b')]},{'where':{'id':_0x2d000f['id']}});})[_0x6174('0x12')](function(){oauth[_0x6174('0x5d')](_0x2d000f);socket[_0x6174('0x5e')](_0x6174('0x5f'),{'id':_0x5dc577['id']});return;})[_0x6174('0x12')](respondWithStatusCode(_0x19c071,null))[_0x6174('0x39')](function(_0x37e803){if(_0x5dc577){socket[_0x6174('0x5e')](_0x6174('0x60'),{'id':_0x5dc577['id']});}if(!_0x2d000f){logger[_0x6174('0x15')](_0x6174('0x61'),_0x37e803);return _0x19c071[_0x6174('0x9')](0x1f4)[_0x6174('0x18')](_0x37e803[_0x6174('0x62')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x2d000f['id'],JSON[_0x6174('0x63')](_0x37e803));});}; \ No newline at end of file +var _0x51b8=['error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','params','fields','length','find','catch','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','localhost','sendStatus','status','json','offset','undefined','limit','count','set','update','then','end'];(function(_0x24f362,_0x5c3b9d){var _0x1382bc=function(_0x338c88){while(--_0x338c88){_0x24f362['push'](_0x24f362['shift']());}};_0x1382bc(++_0x5c3b9d);}(_0x51b8,0xa5));var _0x851b=function(_0x50286e,_0x43d532){_0x50286e=_0x50286e-0x0;var _0x222c88=_0x51b8[_0x50286e];return _0x222c88;};'use strict';var _=require(_0x851b('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x851b('0x1'));var config=require(_0x851b('0x2'));var logger=require(_0x851b('0x3'))('api');var db=require(_0x851b('0x4'))['db'];var oauth=require(_0x851b('0x5'));config[_0x851b('0x6')]=_['defaults'](config['redis'],{'host':_0x851b('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x851b('0x6')]);function respondWithStatusCode(_0x369975,_0x12bb46){_0x12bb46=_0x12bb46||0xcc;return function(_0x21cf06){if(_0x21cf06){return _0x369975[_0x851b('0x8')](_0x12bb46);}return _0x369975[_0x851b('0x9')](_0x12bb46)['end']();};}function respondWithResult(_0xf419a4,_0x515bd8){_0x515bd8=_0x515bd8||0xc8;return function(_0x529be9){if(_0x529be9){return _0xf419a4['status'](_0x515bd8)[_0x851b('0xa')](_0x529be9);}};}function respondWithFilteredResult(_0x2b6d71,_0x49cfc8){return function(_0x2e7bf1){if(_0x2e7bf1){var _0x6e1e6b=typeof _0x49cfc8[_0x851b('0xb')]===_0x851b('0xc')&&typeof _0x49cfc8[_0x851b('0xd')]===_0x851b('0xc');var _0x1f8b04=_0x2e7bf1[_0x851b('0xe')];var _0x49d9b7=_0x6e1e6b?0x0:_0x49cfc8['offset'];var _0x5b54cb=_0x6e1e6b?_0x2e7bf1[_0x851b('0xe')]:_0x49cfc8['offset']+_0x49cfc8[_0x851b('0xd')];var _0x321131;if(_0x5b54cb>=_0x1f8b04){_0x5b54cb=_0x1f8b04;_0x321131=0xc8;}else{_0x321131=0xce;}_0x2b6d71['status'](_0x321131);return _0x2b6d71[_0x851b('0xf')]('Content-Range',_0x49d9b7+'-'+_0x5b54cb+'/'+_0x1f8b04)[_0x851b('0xa')](_0x2e7bf1);}return null;};}function saveUpdates(_0x216cb2){return function(_0x5917da){if(_0x5917da){return _0x5917da[_0x851b('0x10')](_0x216cb2)[_0x851b('0x11')](function(_0xd0fcc){return _0xd0fcc;});}return null;};}function removeEntity(_0x24ca9f){return function(_0x2ee2d6){if(_0x2ee2d6){return _0x2ee2d6['destroy']()[_0x851b('0x11')](function(){_0x24ca9f[_0x851b('0x9')](0xcc)[_0x851b('0x12')]();});}};}function handleEntityNotFound(_0x1e6a17){return function(_0x30df9e){if(!_0x30df9e){_0x1e6a17[_0x851b('0x8')](0x194);}return _0x30df9e;};}function handleError(_0x11661f,_0x40c3e4){_0x40c3e4=_0x40c3e4||0x1f4;return function(_0x3dd194){logger[_0x851b('0x13')](_0x3dd194[_0x851b('0x14')]);if(_0x3dd194[_0x851b('0x15')]){delete _0x3dd194['name'];}_0x11661f[_0x851b('0x9')](_0x40c3e4)[_0x851b('0x16')](_0x3dd194);};}function maskClientSecret(_0x2d1817){return _[_0x851b('0x17')](_0x2d1817[_0x851b('0x18')](0x0,0x3),0x14,'*');}exports[_0x851b('0x19')]=function(_0xf965f5,_0x2e14b9){var _0xc32ac6={},_0x15ef20={},_0x28df05={'count':0x0,'rows':[]};var _0x3048fd=_[_0x851b('0x1a')](db[_0x851b('0x1b')][_0x851b('0x1c')],function(_0xc83e64){return{'name':_0xc83e64[_0x851b('0x1d')],'type':_0xc83e64[_0x851b('0x1e')]['key']};});_0x15ef20[_0x851b('0x1f')]=_['map'](_0x3048fd,_0x851b('0x15'));_0x15ef20[_0x851b('0x20')]=_[_0x851b('0x21')](_0xf965f5[_0x851b('0x20')]);_0x15ef20[_0x851b('0x22')]=_[_0x851b('0x23')](_0x15ef20[_0x851b('0x1f')],_0x15ef20[_0x851b('0x20')]);_0xc32ac6[_0x851b('0x24')]=_['intersection'](_0x15ef20['model'],qs['fields'](_0xf965f5['query']['fields']));_0xc32ac6[_0x851b('0x24')]=_0xc32ac6[_0x851b('0x24')]['length']?_0xc32ac6[_0x851b('0x24')]:_0x15ef20[_0x851b('0x1f')];if(!_0xf965f5[_0x851b('0x20')][_0x851b('0x25')](_0x851b('0x26'))){_0xc32ac6[_0x851b('0xd')]=qs[_0x851b('0xd')](_0xf965f5[_0x851b('0x20')][_0x851b('0xd')]);_0xc32ac6['offset']=qs[_0x851b('0xb')](_0xf965f5[_0x851b('0x20')][_0x851b('0xb')]);}_0xc32ac6['order']=qs[_0x851b('0x27')](_0xf965f5[_0x851b('0x20')][_0x851b('0x27')]);_0xc32ac6['where']=qs[_0x851b('0x22')](_[_0x851b('0x28')](_0xf965f5[_0x851b('0x20')],_0x15ef20[_0x851b('0x22')]),_0x3048fd);if(_0xf965f5[_0x851b('0x20')]['filter']){_0xc32ac6[_0x851b('0x29')]=_[_0x851b('0x2a')](_0xc32ac6[_0x851b('0x29')],{'$or':_['map'](_0x3048fd,function(_0x7bf68a){if(_0x7bf68a['type']!==_0x851b('0x2b')){var _0x548963={};_0x548963[_0x7bf68a[_0x851b('0x15')]]={'$like':'%'+_0xf965f5[_0x851b('0x20')][_0x851b('0x2c')]+'%'};return _0x548963;}})});}_0xc32ac6=_['merge']({},_0xc32ac6,_0xf965f5[_0x851b('0x2d')]);var _0xa670a1={'where':_0xc32ac6[_0x851b('0x29')]};return db['CloudProvider'][_0x851b('0xe')](_0xa670a1)[_0x851b('0x11')](function(_0x2fbc6f){_0x28df05[_0x851b('0xe')]=_0x2fbc6f;if(_0xf965f5[_0x851b('0x20')][_0x851b('0x2e')]){_0xc32ac6[_0x851b('0x2f')]=[{'all':!![]}];}return db[_0x851b('0x1b')][_0x851b('0x30')](_0xc32ac6);})[_0x851b('0x11')](function(_0x109092){_0x28df05[_0x851b('0x31')]=_[_0x851b('0x1a')](_0x109092,function(_0x3eded6){if(_0x3eded6[_0x851b('0x32')]===_0x851b('0x33')){var _0x59c743=encryptor[_0x851b('0x34')](_0x3eded6['data3']);_0x3eded6[_0x851b('0x35')]=maskClientSecret(_0x59c743);}return _0x3eded6;});return _0x28df05;})[_0x851b('0x11')](respondWithFilteredResult(_0x2e14b9,_0xc32ac6))['catch'](handleError(_0x2e14b9,null));};exports['show']=function(_0x9b8835,_0x5d9350){var _0x54994c={'raw':!![],'where':{'id':_0x9b8835[_0x851b('0x36')]['id']}},_0x242607={};_0x242607['model']=_['keys'](db[_0x851b('0x1b')][_0x851b('0x1c')]);_0x242607[_0x851b('0x20')]=_[_0x851b('0x21')](_0x9b8835['query']);_0x242607[_0x851b('0x22')]=_[_0x851b('0x23')](_0x242607[_0x851b('0x1f')],_0x242607[_0x851b('0x20')]);_0x54994c['attributes']=_[_0x851b('0x23')](_0x242607[_0x851b('0x1f')],qs[_0x851b('0x37')](_0x9b8835[_0x851b('0x20')][_0x851b('0x37')]));_0x54994c[_0x851b('0x24')]=_0x54994c[_0x851b('0x24')][_0x851b('0x38')]?_0x54994c[_0x851b('0x24')]:_0x242607[_0x851b('0x1f')];if(_0x9b8835['query'][_0x851b('0x2e')]){_0x54994c[_0x851b('0x2f')]=[{'all':!![]}];}_0x54994c=_[_0x851b('0x2a')]({},_0x54994c,_0x9b8835['options']);return db[_0x851b('0x1b')][_0x851b('0x39')](_0x54994c)[_0x851b('0x11')](handleEntityNotFound(_0x5d9350,null))['then'](function(_0x389d4c){if(_0x389d4c['service']===_0x851b('0x33')){var _0x38e5c6=encryptor[_0x851b('0x34')](_0x389d4c['data3']);_0x389d4c[_0x851b('0x35')]=maskClientSecret(_0x38e5c6);}return _0x389d4c;})['then'](respondWithResult(_0x5d9350,null))[_0x851b('0x3a')](handleError(_0x5d9350,null));};exports[_0x851b('0x3b')]=function(_0x1c027d,_0x1ac60f){if(!_0x1c027d['body'][_0x851b('0x15')])throw new Error(_0x851b('0x3c'));if(!_0x1c027d[_0x851b('0x3d')][_0x851b('0x32')])throw new Error(_0x851b('0x3e'));var _0x5c6917=db[_0x851b('0x1b')][_0x851b('0x1c')][_0x851b('0x32')][_0x851b('0x3f')];if(!_0x5c6917['includes'](_0x1c027d[_0x851b('0x3d')][_0x851b('0x32')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5c6917[_0x851b('0x40')](',\x20'));if(_0x1c027d['body']['service']===_0x851b('0x33')&&_0x1c027d[_0x851b('0x3d')][_0x851b('0x35')]){_0x1c027d[_0x851b('0x3d')][_0x851b('0x35')]=encryptor[_0x851b('0x41')](_0x1c027d[_0x851b('0x3d')]['data3']);}return db[_0x851b('0x1b')]['create'](_0x1c027d[_0x851b('0x3d')],{})[_0x851b('0x11')](respondWithResult(_0x1ac60f,0xc9))[_0x851b('0x3a')](handleError(_0x1ac60f,null));};exports['update']=function(_0xcbb4c0,_0x1c1a68){if(_0xcbb4c0[_0x851b('0x3d')]['id']){delete _0xcbb4c0[_0x851b('0x3d')]['id'];}return db[_0x851b('0x1b')]['find']({'where':{'id':_0xcbb4c0[_0x851b('0x36')]['id']}})[_0x851b('0x11')](handleEntityNotFound(_0x1c1a68,null))[_0x851b('0x11')](function(_0x2d9f8d){if(_0x2d9f8d['service']==='MicrosoftAzure'&&_0xcbb4c0[_0x851b('0x3d')][_0x851b('0x35')]){_0xcbb4c0[_0x851b('0x3d')][_0x851b('0x35')]=encryptor['encryptString'](_0xcbb4c0['body'][_0x851b('0x35')]);}return _0x2d9f8d;})[_0x851b('0x11')](saveUpdates(_0xcbb4c0['body'],null))[_0x851b('0x11')](respondWithResult(_0x1c1a68,null))[_0x851b('0x3a')](handleError(_0x1c1a68,null));};exports['destroy']=function(_0x3c5b32,_0x4eba08){return db[_0x851b('0x1b')][_0x851b('0x39')]({'where':{'id':_0x3c5b32[_0x851b('0x36')]['id']}})['then'](handleEntityNotFound(_0x4eba08,null))[_0x851b('0x11')](removeEntity(_0x4eba08,null))['catch'](handleError(_0x4eba08,null));};exports[_0x851b('0x42')]=function(_0x436fdb,_0x5eebaf){return db[_0x851b('0x1b')]['findOne']({'where':{'id':_0x436fdb[_0x851b('0x36')]['id']},'raw':!![]})['then'](function(_0x1b5b44){if(!_0x1b5b44)return _0x5eebaf['sendStatus'](0x194);return{'url':oauth[_0x851b('0x43')](_0x1b5b44,_0x436fdb[_0x851b('0x44')]['id'])};})['then'](respondWithResult(_0x5eebaf,null))[_0x851b('0x3a')](handleError(_0x5eebaf,null));};exports['oauth2MicrosoftCallback']=function(_0x4936,_0x44e2c2){var _0x1c96e7=_0x4936[_0x851b('0x3d')];var _0x2cb49b;var _0x21afe1;if(_0x1c96e7[_0x851b('0x13')])throw _0x1c96e7;redis[_0x851b('0x45')](_0x1c96e7[_0x851b('0x46')])[_0x851b('0x11')](function(_0x33bdd3){if(!_0x33bdd3)throw new Error(_0x851b('0x47'));_0x2cb49b=JSON[_0x851b('0x48')](_0x33bdd3);var _0x126a35=Buffer['from'](_0x1c96e7[_0x851b('0x46')],_0x851b('0x49'))[_0x851b('0x4a')](_0x851b('0x4b'));_0x21afe1=JSON['parse'](_0x126a35);if(!oauth['isValidIdToken'](_0x1c96e7[_0x851b('0x4c')],_0x2cb49b[_0x851b('0x4d')]))throw new Error(_0x851b('0x4e'));redis[_0x851b('0x4f')](_0x1c96e7[_0x851b('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1c96e7['code'],_0x2cb49b);})[_0x851b('0x11')](function(_0x3fcb12){_0x2cb49b[_0x851b('0x50')]=_0x3fcb12[_0x851b('0x51')];_0x2cb49b[_0x851b('0x52')]=_0x3fcb12[_0x851b('0x53')];return db[_0x851b('0x1b')]['update']({'data5':_0x2cb49b[_0x851b('0x50')],'data6':_0x2cb49b[_0x851b('0x52')]},{'where':{'id':_0x2cb49b['id']}});})[_0x851b('0x11')](function(){oauth[_0x851b('0x54')](_0x2cb49b);socket[_0x851b('0x55')](_0x851b('0x56'),{'id':_0x21afe1['id']});return;})[_0x851b('0x11')](respondWithStatusCode(_0x44e2c2,null))[_0x851b('0x3a')](function(_0x3c779d){if(_0x21afe1){socket['emit'](_0x851b('0x57'),{'id':_0x21afe1['id']});}if(!_0x2cb49b){logger[_0x851b('0x13')](_0x851b('0x58'),_0x3c779d);return _0x44e2c2[_0x851b('0x9')](0x1f4)[_0x851b('0x16')](_0x3c779d[_0x851b('0x59')]);}logger['error'](_0x851b('0x5a'),_0x2cb49b['id'],JSON[_0x851b('0x5b')](_0x3c779d));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 82d01a3..c6fadab 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 _0x7993=['util','api','moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','cloud_providers','lodash'];(function(_0x5d1371,_0x229b41){var _0x147ec3=function(_0x2ef373){while(--_0x2ef373){_0x5d1371['push'](_0x5d1371['shift']());}};_0x147ec3(++_0x229b41);}(_0x7993,0x1b7));var _0x3799=function(_0x2ad3cc,_0x5201e2){_0x2ad3cc=_0x2ad3cc-0x0;var _0x472a69=_0x7993[_0x2ad3cc];return _0x472a69;};'use strict';var _=require(_0x3799('0x0'));var util=require(_0x3799('0x1'));var logger=require('../../config/logger')(_0x3799('0x2'));var moment=require(_0x3799('0x3'));var BPromise=require('bluebird');var rp=require(_0x3799('0x4'));var fs=require('fs');var path=require(_0x3799('0x5'));var rimraf=require(_0x3799('0x6'));var config=require('../../config/environment');var attributes=require(_0x3799('0x7'));module[_0x3799('0x8')]=function(_0x2acc4b,_0xefe373){return _0x2acc4b[_0x3799('0x9')]('CloudProvider',attributes,{'tableName':_0x3799('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7aa=['path','rimraf','./cloudProvider.attributes','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x7a4b07,_0x4a9952){var _0x4d61ec=function(_0x2fd661){while(--_0x2fd661){_0x7a4b07['push'](_0x7a4b07['shift']());}};_0x4d61ec(++_0x4a9952);}(_0xe7aa,0x1d7));var _0xae7a=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xe7aa[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xae7a('0x0'));var util=require('util');var logger=require(_0xae7a('0x1'))(_0xae7a('0x2'));var moment=require(_0xae7a('0x3'));var BPromise=require(_0xae7a('0x4'));var rp=require(_0xae7a('0x5'));var fs=require('fs');var path=require(_0xae7a('0x6'));var rimraf=require(_0xae7a('0x7'));var config=require('../../config/environment');var attributes=require(_0xae7a('0x8'));module['exports']=function(_0x3ae5ca,_0x300d91){return _0x3ae5ca['define']('CloudProvider',attributes,{'tableName':'cloud_providers','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 c1cbacf..5846eb4 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 _0x6818=['profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','id_token','toString','base64','hex','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','oauth2/','set','stringify','decode','payload','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','data4','POST','{TENANT_ID}','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid'];(function(_0x198d2a,_0x510eb7){var _0xfda34d=function(_0x581078){while(--_0x581078){_0x198d2a['push'](_0x198d2a['shift']());}};_0xfda34d(++_0x510eb7);}(_0x6818,0x1c9));var _0x8681=function(_0x3a7979,_0x98d6ee){_0x3a7979=_0x3a7979-0x0;var _0xfde93a=_0x6818[_0x3a7979];return _0xfde93a;};'use strict';var _=require(_0x8681('0x0'));var crypto=require(_0x8681('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x8681('0x2'));var Redis=require(_0x8681('0x3'));var rp=require(_0x8681('0x4'));var util=require(_0x8681('0x5'));var encryptor=require(_0x8681('0x6'));var config=require(_0x8681('0x7'));var logger=require(_0x8681('0x8'))(_0x8681('0x9'));var schedule=require(_0x8681('0xa'));var db=require(_0x8681('0xb'))['db'];config[_0x8681('0xc')]=_[_0x8681('0xd')](config[_0x8681('0xc')],{'host':_0x8681('0xe'),'port':0x18eb});var redis=new Redis(config[_0x8681('0xc')]);var MICROSOFT_AUTH_URL=_0x8681('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8681('0x10'),_0x8681('0x11'),_0x8681('0x12'),_0x8681('0x13'),_0x8681('0x14'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x8681('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2ce14e){var _0x35e429=_[_0x8681('0x16')](AZURE_AUTH_SCOPES[_0x2ce14e[_0x8681('0x17')]]);if(_0x2ce14e['type']===_0x8681('0x18'))_0x35e429[_0x8681('0x19')](_0x2ce14e[_0x8681('0x1a')]+_0x8681('0x1b'));return _0x35e429[_0x8681('0x1c')]('\x20');}function getAccessTokenScope(_0x455758){if(_0x455758['type']===_0x8681('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x455758[_0x8681('0x17')]==='Dynamics365')return _0x455758[_0x8681('0x1a')]+_0x8681('0x1b');}function generateMicrosoftAuthorizationUrl(_0x274448,_0x243d2d){var _0x331179=MICROSOFT_AUTH_URL[_0x8681('0x1e')]('{TENANT_ID}',_0x274448[_0x8681('0x1f')]);var _0x2120e0=['code',_0x8681('0x20')];var _0x4be764=Buffer['from'](JSON['stringify']({'id':_0x243d2d}))[_0x8681('0x21')](_0x8681('0x22'));var _0x5f5a8a=crypto['randomBytes'](0x10)['toString'](_0x8681('0x23'));var _0x37504c=getAuthorizationScopes(_0x274448);var _0x496d38=[{'key':'client_id','value':_0x274448[_0x8681('0x24')]},{'key':_0x8681('0x25'),'value':encodeURIComponent(_0x2120e0['join']('\x20'))},{'key':_0x8681('0x26'),'value':_0x274448['data4']},{'key':_0x8681('0x27'),'value':_0x8681('0x28')},{'key':_0x8681('0x29'),'value':encodeURIComponent(_0x37504c)},{'key':_0x8681('0x2a'),'value':_0x4be764},{'key':_0x8681('0x2b'),'value':_0x5f5a8a},{'key':_0x8681('0x2c'),'value':_0x8681('0x2d')}];var _0x52a531=_0x331179+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8681('0x16')](_0x496d38,function(_0x243fa8){return _0x243fa8[_0x8681('0x2e')]+'='+_0x243fa8['value'];})[_0x8681('0x1c')]('&');_0x274448['oauth2Claims']={'issuer':_0x331179[_0x8681('0x1e')](_0x8681('0x2f'),''),'audience':_0x274448[_0x8681('0x24')],'state':_0x4be764,'nonce':_0x5f5a8a};redis[_0x8681('0x30')](_0x4be764,JSON[_0x8681('0x31')](_0x274448));return _0x52a531;}function isValidIdToken(_0x36b555,_0x298ecd){try{var _0x2cdcc7=jwt[_0x8681('0x32')](_0x36b555,{'complete':!![]});var _0x3248a6=_0x2cdcc7[_0x8681('0x33')];if(_0x3248a6['iss']!==_0x298ecd['issuer'])return![];if(_0x3248a6['aud']!==_0x298ecd[_0x8681('0x34')])return![];if(_0x3248a6[_0x8681('0x2b')]!==_0x298ecd[_0x8681('0x2b')])return![];if(moment()[_0x8681('0x35')](moment[_0x8681('0x36')](_0x3248a6[_0x8681('0x37')])))return![];return!![];}catch(_0x5f0a62){throw _0x5f0a62;}}function refreshOauth2MicrosoftAccessToken(_0x3e40b6){return Promise[_0x8681('0x38')]()[_0x8681('0x39')](function(){if(_0x3e40b6[_0x8681('0x3a')])return _0x3e40b6;return db[_0x8681('0x3b')][_0x8681('0x3c')]({'where':{'id':_0x3e40b6['id']},'raw':!![]});})[_0x8681('0x39')](function(_0x2841c3){var _0x12510d={'grant_type':_0x8681('0x3d'),'refresh_token':_0x2841c3[_0x8681('0x3e')],'scope':getAccessTokenScope(_0x2841c3),'redirect_uri':_0x2841c3[_0x8681('0x3f')],'client_id':_0x2841c3[_0x8681('0x24')],'client_secret':encryptor['decryptString'](_0x2841c3[_0x8681('0x3a')])};var _0x3e6245={'method':_0x8681('0x40'),'uri':MICROSOFT_AUTH_URL[_0x8681('0x1e')](_0x8681('0x41'),_0x2841c3[_0x8681('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12510d,'json':!![]};return rp(_0x3e6245);})[_0x8681('0x39')](function(_0x5a8aef){_0x3e40b6[_0x8681('0x42')]=_0x5a8aef[_0x8681('0x43')];_0x3e40b6[_0x8681('0x3e')]=_0x5a8aef[_0x8681('0x3d')];return db[_0x8681('0x3b')]['update']({'data5':_0x3e40b6[_0x8681('0x42')],'data6':_0x3e40b6['data6']},{'where':{'id':_0x3e40b6['id']}});})[_0x8681('0x39')](function(){return _0x3e40b6;})[_0x8681('0x44')](function(_0x25f380){logger[_0x8681('0x45')](_0x8681('0x46'),_0x3e40b6['id'],_0x25f380);});}function getOauth2MicrosoftAccessToken(_0x5616a5,_0x572df9){var _0xa8b9dd={'grant_type':_0x8681('0x47'),'code':_0x5616a5,'scope':getAccessTokenScope(_0x572df9),'redirect_uri':_0x572df9[_0x8681('0x3f')],'client_id':_0x572df9[_0x8681('0x24')],'client_secret':encryptor[_0x8681('0x48')](_0x572df9[_0x8681('0x3a')])};var _0x1a61fa={'method':_0x8681('0x40'),'uri':MICROSOFT_AUTH_URL[_0x8681('0x1e')](_0x8681('0x41'),_0x572df9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xa8b9dd,'json':!![]};return rp(_0x1a61fa);}function startRefreshInterval(_0x2aaf0b){var _0x1e80c2=schedule[_0x8681('0x49')];if(_0x1e80c2[_0x2aaf0b['id']])clearInterval(_0x1e80c2[_0x2aaf0b['id']]);_0x1e80c2[_0x2aaf0b['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x2aaf0b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x1e80c2;}function startAllRefreshIntervals(){return db[_0x8681('0x3b')][_0x8681('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8681('0x39')](function(_0x25d535){var _0x461c=_0x25d535['map'](function(_0x53e46d){return refreshOauth2MicrosoftAccessToken(_0x53e46d)[_0x8681('0x39')](function(_0x3b0bb6){startRefreshInterval(_0x3b0bb6);});});return Promise[_0x8681('0x4b')](_0x461c);})[_0x8681('0x44')](function(_0x5b8e65){var _0x3f054c=_0x5b8e65?util[_0x8681('0x4c')](_0x5b8e65,{'showHidden':![],'depth':null}):'';logger[_0x8681('0x45')](_0x8681('0x4d'),_0x3f054c);});}module[_0x8681('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xc9b8=['jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','data7','/.default','join','replace','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','redirect_uri','data4','response_mode','state','nonce','prompt','key','value','oauth2Claims','oauth2/','data1','decode','payload','issuer','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc9b8,0x1c1));var _0x8c9b=function(_0x5edf7e,_0x50b407){_0x5edf7e=_0x5edf7e-0x0;var _0x1817f8=_0xc9b8[_0x5edf7e];return _0x1817f8;};'use strict';var _=require(_0x8c9b('0x0'));var crypto=require('crypto');var jwt=require(_0x8c9b('0x1'));var moment=require(_0x8c9b('0x2'));var Redis=require(_0x8c9b('0x3'));var rp=require(_0x8c9b('0x4'));var util=require(_0x8c9b('0x5'));var encryptor=require(_0x8c9b('0x6'));var config=require(_0x8c9b('0x7'));var logger=require(_0x8c9b('0x8'))(_0x8c9b('0x9'));var schedule=require(_0x8c9b('0xa'));var db=require('../../mysqldb')['db'];config[_0x8c9b('0xb')]=_[_0x8c9b('0xc')](config['redis'],{'host':_0x8c9b('0xd'),'port':0x18eb});var redis=new Redis(config[_0x8c9b('0xb')]);var MICROSOFT_AUTH_URL=_0x8c9b('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8c9b('0xf'),_0x8c9b('0x10'),'email',_0x8c9b('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x8c9b('0x12')],'Dynamics365':[_0x8c9b('0xf'),_0x8c9b('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x8c9b('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xa587d1){var _0x2d5d=_[_0x8c9b('0x14')](AZURE_AUTH_SCOPES[_0xa587d1[_0x8c9b('0x15')]]);if(_0xa587d1[_0x8c9b('0x15')]===_0x8c9b('0x16'))_0x2d5d[_0x8c9b('0x17')](_0xa587d1[_0x8c9b('0x18')]+_0x8c9b('0x19'));return _0x2d5d[_0x8c9b('0x1a')]('\x20');}function getAccessTokenScope(_0x4b5cdc){if(_0x4b5cdc['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x4b5cdc[_0x8c9b('0x15')]===_0x8c9b('0x16'))return _0x4b5cdc[_0x8c9b('0x18')]+_0x8c9b('0x19');}function generateMicrosoftAuthorizationUrl(_0x25d163,_0x58ce2a){var _0x2dfc05=MICROSOFT_AUTH_URL[_0x8c9b('0x1b')]('{TENANT_ID}',_0x25d163[_0x8c9b('0x1c')]);var _0x569dcf=[_0x8c9b('0x1d'),_0x8c9b('0x1e')];var _0x598417=Buffer['from'](JSON[_0x8c9b('0x1f')]({'id':_0x58ce2a}))[_0x8c9b('0x20')](_0x8c9b('0x21'));var _0x2d11e1=crypto[_0x8c9b('0x22')](0x10)['toString'](_0x8c9b('0x23'));var _0x13303f=getAuthorizationScopes(_0x25d163);var _0x6677ef=[{'key':_0x8c9b('0x24'),'value':_0x25d163['data1']},{'key':'response_type','value':encodeURIComponent(_0x569dcf['join']('\x20'))},{'key':_0x8c9b('0x25'),'value':_0x25d163[_0x8c9b('0x26')]},{'key':_0x8c9b('0x27'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x13303f)},{'key':_0x8c9b('0x28'),'value':_0x598417},{'key':_0x8c9b('0x29'),'value':_0x2d11e1},{'key':_0x8c9b('0x2a'),'value':'login'}];var _0x594019=_0x2dfc05+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8c9b('0x14')](_0x6677ef,function(_0x3a9dc6){return _0x3a9dc6[_0x8c9b('0x2b')]+'='+_0x3a9dc6[_0x8c9b('0x2c')];})[_0x8c9b('0x1a')]('&');_0x25d163[_0x8c9b('0x2d')]={'issuer':_0x2dfc05[_0x8c9b('0x1b')](_0x8c9b('0x2e'),''),'audience':_0x25d163[_0x8c9b('0x2f')],'state':_0x598417,'nonce':_0x2d11e1};redis['set'](_0x598417,JSON['stringify'](_0x25d163));return _0x594019;}function isValidIdToken(_0x24c3aa,_0x4f75f6){try{var _0x1e5038=jwt[_0x8c9b('0x30')](_0x24c3aa,{'complete':!![]});var _0x3a13a0=_0x1e5038[_0x8c9b('0x31')];if(_0x3a13a0['iss']!==_0x4f75f6[_0x8c9b('0x32')])return![];if(_0x3a13a0['aud']!==_0x4f75f6[_0x8c9b('0x33')])return![];if(_0x3a13a0[_0x8c9b('0x29')]!==_0x4f75f6['nonce'])return![];if(moment()['isAfter'](moment[_0x8c9b('0x34')](_0x3a13a0[_0x8c9b('0x35')])))return![];return!![];}catch(_0x5dca7f){throw _0x5dca7f;}}function refreshOauth2MicrosoftAccessToken(_0x513d4e){return Promise[_0x8c9b('0x36')]()[_0x8c9b('0x37')](function(){if(_0x513d4e[_0x8c9b('0x38')])return _0x513d4e;return db[_0x8c9b('0x39')][_0x8c9b('0x3a')]({'where':{'id':_0x513d4e['id']},'raw':!![]});})[_0x8c9b('0x37')](function(_0x1da461){var _0xa19b90={'grant_type':_0x8c9b('0x3b'),'refresh_token':_0x1da461[_0x8c9b('0x3c')],'scope':getAccessTokenScope(_0x1da461),'redirect_uri':_0x1da461[_0x8c9b('0x26')],'client_id':_0x1da461[_0x8c9b('0x2f')],'client_secret':encryptor[_0x8c9b('0x3d')](_0x1da461[_0x8c9b('0x38')])};var _0x4ee5fb={'method':_0x8c9b('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x8c9b('0x1b')](_0x8c9b('0x3f'),_0x1da461['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xa19b90,'json':!![]};return rp(_0x4ee5fb);})[_0x8c9b('0x37')](function(_0x54d450){_0x513d4e['data5']=_0x54d450[_0x8c9b('0x40')];_0x513d4e['data6']=_0x54d450[_0x8c9b('0x3b')];return db['CloudProvider']['update']({'data5':_0x513d4e['data5'],'data6':_0x513d4e[_0x8c9b('0x3c')]},{'where':{'id':_0x513d4e['id']}});})[_0x8c9b('0x37')](function(){return _0x513d4e;})['catch'](function(_0x5d3c7a){logger[_0x8c9b('0x41')](_0x8c9b('0x42'),_0x513d4e['id'],_0x5d3c7a);});}function getOauth2MicrosoftAccessToken(_0x5515af,_0x54f850){var _0x22ac7a={'grant_type':_0x8c9b('0x43'),'code':_0x5515af,'scope':getAccessTokenScope(_0x54f850),'redirect_uri':_0x54f850[_0x8c9b('0x26')],'client_id':_0x54f850[_0x8c9b('0x2f')],'client_secret':encryptor[_0x8c9b('0x3d')](_0x54f850[_0x8c9b('0x38')])};var _0x253ddd={'method':_0x8c9b('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x8c9b('0x1b')](_0x8c9b('0x3f'),_0x54f850['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x22ac7a,'json':!![]};return rp(_0x253ddd);}function startRefreshInterval(_0xd5bad9){var _0x736990=schedule[_0x8c9b('0x44')];if(_0x736990[_0xd5bad9['id']])clearInterval(_0x736990[_0xd5bad9['id']]);_0x736990[_0xd5bad9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8c9b('0x45')](this,{'id':_0xd5bad9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8c9b('0x44')]=_0x736990;}function startAllRefreshIntervals(){return db[_0x8c9b('0x39')][_0x8c9b('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8c9b('0x37')](function(_0x2237a5){var _0x136b05=_0x2237a5['map'](function(_0x15343d){return refreshOauth2MicrosoftAccessToken(_0x15343d)[_0x8c9b('0x37')](function(_0x205953){startRefreshInterval(_0x205953);});});return Promise[_0x8c9b('0x47')](_0x136b05);})[_0x8c9b('0x48')](function(_0x47672f){var _0x503dfe=_0x47672f?util['inspect'](_0x47672f,{'showHidden':![],'depth':null}):'';logger[_0x8c9b('0x41')](_0x8c9b('0x49'),_0x503dfe);});}module[_0x8c9b('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 45b5a0c..2ba2a6d 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 _0x5ae9=['client','http','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x44d7b8,_0x5ed249){var _0x31fb41=function(_0x28ae86){while(--_0x28ae86){_0x44d7b8['push'](_0x44d7b8['shift']());}};_0x31fb41(++_0x5ed249);}(_0x5ae9,0x19b));var _0x95ae=function(_0x10f0a5,_0x42ecec){_0x10f0a5=_0x10f0a5-0x0;var _0x1849cb=_0x5ae9[_0x10f0a5];return _0x1849cb;};'use strict';var _=require(_0x95ae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x95ae('0x1'));var rs=require(_0x95ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95ae('0x3'))['db'];var utils=require(_0x95ae('0x4'));var logger=require('../../config/logger')(_0x95ae('0x5'));var config=require('../../config/environment');var jayson=require(_0x95ae('0x6'));var client=jayson[_0x95ae('0x7')][_0x95ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xec2c41,_0x3c4cda,_0x4df142){return new BPromise(function(_0x588bab,_0x19ba28){return client[_0x95ae('0x9')](_0xec2c41,_0x4df142)[_0x95ae('0xa')](function(_0x25b2ec){logger['info']('CloudProvider,\x20%s,\x20%s',_0x3c4cda,_0x95ae('0xb'));logger[_0x95ae('0xc')](_0x95ae('0xd'),_0x3c4cda,_0x95ae('0xb'),JSON['stringify'](_0x25b2ec));if(_0x25b2ec['error']){if(_0x25b2ec[_0x95ae('0xe')]['code']===0x1f4){logger[_0x95ae('0xe')](_0x95ae('0xf'),_0x3c4cda,_0x25b2ec['error'][_0x95ae('0x10')]);return _0x19ba28(_0x25b2ec[_0x95ae('0xe')][_0x95ae('0x10')]);}logger['error'](_0x95ae('0xf'),_0x3c4cda,_0x25b2ec[_0x95ae('0xe')][_0x95ae('0x10')]);return _0x588bab(_0x25b2ec['error'][_0x95ae('0x10')]);}else{logger['info'](_0x95ae('0xf'),_0x3c4cda,'request\x20sent');_0x588bab(_0x25b2ec[_0x95ae('0x11')][_0x95ae('0x10')]);}})[_0x95ae('0x12')](function(_0x11e960){logger[_0x95ae('0xe')](_0x95ae('0xf'),_0x3c4cda,_0x11e960);_0x19ba28(_0x11e960);});});} \ No newline at end of file +var _0xd0da=['jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4cbdb7,_0x1b82f6){var _0x4ecb18=function(_0x48271f){while(--_0x48271f){_0x4cbdb7['push'](_0x4cbdb7['shift']());}};_0x4ecb18(++_0x1b82f6);}(_0xd0da,0x1b1));var _0xad0d=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0xd0da[_0x2f3ecd];return _0xffdc44;};'use strict';var _=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var moment=require(_0xad0d('0x2'));var BPromise=require(_0xad0d('0x3'));var rs=require(_0xad0d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad0d('0x5'))['db'];var utils=require(_0xad0d('0x6'));var logger=require(_0xad0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad0d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc14f42,_0xa95863,_0xcc6f55){return new BPromise(function(_0xc7e517,_0x5b99a9){return client[_0xad0d('0x9')](_0xc14f42,_0xcc6f55)[_0xad0d('0xa')](function(_0x40e717){logger[_0xad0d('0xb')](_0xad0d('0xc'),_0xa95863,_0xad0d('0xd'));logger[_0xad0d('0xe')](_0xad0d('0xf'),_0xa95863,_0xad0d('0xd'),JSON[_0xad0d('0x10')](_0x40e717));if(_0x40e717[_0xad0d('0x11')]){if(_0x40e717[_0xad0d('0x11')][_0xad0d('0x12')]===0x1f4){logger['error'](_0xad0d('0xc'),_0xa95863,_0x40e717[_0xad0d('0x11')]['message']);return _0x5b99a9(_0x40e717[_0xad0d('0x11')][_0xad0d('0x13')]);}logger['error'](_0xad0d('0xc'),_0xa95863,_0x40e717[_0xad0d('0x11')]['message']);return _0xc7e517(_0x40e717[_0xad0d('0x11')][_0xad0d('0x13')]);}else{logger['info'](_0xad0d('0xc'),_0xa95863,'request\x20sent');_0xc7e517(_0x40e717['result'][_0xad0d('0x13')]);}})[_0xad0d('0x14')](function(_0x1cde0d){logger['error'](_0xad0d('0xc'),_0xa95863,_0x1cde0d);_0x5b99a9(_0x1cde0d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7fcd7c5..a09760e 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0x1261,0x144));var _0x1126=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x1261[_0x45783c];return _0x1161da;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x462f72,_0x4fd2d8){var _0x2ed8ef=function(_0x5e7f4a){while(--_0x5e7f4a){_0x462f72['push'](_0x462f72['shift']());}};_0x2ed8ef(++_0x4fd2d8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index f9869c9..ef18612 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 _0x7c74=['exports','name','STRING','sequelize'];(function(_0x207ae9,_0xdeb7bf){var _0x52375e=function(_0x43336b){while(--_0x43336b){_0x207ae9['push'](_0x207ae9['shift']());}};_0x52375e(++_0xdeb7bf);}(_0x7c74,0x11f));var _0x47c7=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x7c74[_0x2f4c1c];return _0x25e0f2;};'use strict';var Sequelize=require(_0x47c7('0x0'));module[_0x47c7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x47c7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x47c7('0x3')]},'companyId':{'type':Sequelize[_0x47c7('0x3')]},'website':{'type':Sequelize[_0x47c7('0x3')]},'phone':{'type':Sequelize[_0x47c7('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x47c7('0x3')]},'postalCode':{'type':Sequelize[_0x47c7('0x3')]},'city':{'type':Sequelize[_0x47c7('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x47c7('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x47c7('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x47c7('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa921=['name','sequelize','exports','STRING'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xa921,0x14d));var _0x1a92=function(_0x55145d,_0x36ebea){_0x55145d=_0x55145d-0x0;var _0x486390=_0xa921[_0x55145d];return _0x486390;};'use strict';var Sequelize=require(_0x1a92('0x0'));module[_0x1a92('0x1')]={'name':{'type':Sequelize[_0x1a92('0x2')],'unique':_0x1a92('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1a92('0x2')]},'companyId':{'type':Sequelize[_0x1a92('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1a92('0x2')]},'fax':{'type':Sequelize[_0x1a92('0x2')]},'type':{'type':Sequelize[_0x1a92('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1a92('0x2')]},'city':{'type':Sequelize[_0x1a92('0x2')]},'country':{'type':Sequelize[_0x1a92('0x2')]},'email':{'type':Sequelize[_0x1a92('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x1a92('0x2')]},'sPostalCode':{'type':Sequelize[_0x1a92('0x2')]},'sCity':{'type':Sequelize[_0x1a92('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a92('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index f720fc8..e3b0885 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 _0xbc3b=['rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','ids','omit','getContacts','findOne','CmContact','rawAttributes','order','map','nolimit','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','model','keys','query','intersection','attributes','fields','sort','where','filters','pick','filter','merge','options','CmCompany'];(function(_0x5d98f3,_0x1e2d8d){var _0x3deb48=function(_0x5c1191){while(--_0x5c1191){_0x5d98f3['push'](_0x5d98f3['shift']());}};_0x3deb48(++_0x1e2d8d);}(_0xbc3b,0x166));var _0xbbc3=function(_0x56ee15,_0x1effd1){_0x56ee15=_0x56ee15-0x0;var _0x94991f=_0xbc3b[_0x56ee15];return _0x94991f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbc3('0x0'));var zipdir=require(_0xbbc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbc3('0x2'));var moment=require('moment');var BPromise=require(_0xbbc3('0x3'));var Mustache=require(_0xbbc3('0x4'));var util=require(_0xbbc3('0x5'));var path=require(_0xbbc3('0x6'));var sox=require('sox');var csv=require(_0xbbc3('0x7'));var ejs=require(_0xbbc3('0x8'));var fs=require('fs');var fs_extra=require(_0xbbc3('0x9'));var _=require(_0xbbc3('0xa'));var squel=require('squel');var crypto=require(_0xbbc3('0xb'));var jsforce=require(_0xbbc3('0xc'));var deskjs=require(_0xbbc3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbbc3('0xe'));var Papa=require(_0xbbc3('0xf'));var Redis=require(_0xbbc3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbbc3('0x11'));var hardwareService=require(_0xbbc3('0x12'));var logger=require(_0xbbc3('0x13'))('api');var utils=require(_0xbbc3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ce742,_0x3e0579){_0x3e0579=_0x3e0579||0xcc;return function(_0x43ec6f){if(_0x43ec6f){return _0x4ce742[_0xbbc3('0x15')](_0x3e0579);}return _0x4ce742[_0xbbc3('0x16')](_0x3e0579)[_0xbbc3('0x17')]();};}function respondWithResult(_0x923863,_0x3b6bbd){_0x3b6bbd=_0x3b6bbd||0xc8;return function(_0x46b17d){if(_0x46b17d){return _0x923863[_0xbbc3('0x16')](_0x3b6bbd)[_0xbbc3('0x18')](_0x46b17d);}};}function respondWithFilteredResult(_0x3f04ed,_0x2a0c42){return function(_0x2c67de){if(_0x2c67de){var _0x2e26bb=typeof _0x2a0c42[_0xbbc3('0x19')]===_0xbbc3('0x1a')&&typeof _0x2a0c42[_0xbbc3('0x1b')]===_0xbbc3('0x1a');var _0xfc18bc=_0x2c67de[_0xbbc3('0x1c')];var _0x10a608=_0x2e26bb?0x0:_0x2a0c42[_0xbbc3('0x19')];var _0x35c474=_0x2e26bb?_0x2c67de[_0xbbc3('0x1c')]:_0x2a0c42['offset']+_0x2a0c42[_0xbbc3('0x1b')];var _0x4f8ca6;if(_0x35c474>=_0xfc18bc){_0x35c474=_0xfc18bc;_0x4f8ca6=0xc8;}else{_0x4f8ca6=0xce;}_0x3f04ed[_0xbbc3('0x16')](_0x4f8ca6);return _0x3f04ed[_0xbbc3('0x1d')](_0xbbc3('0x1e'),_0x10a608+'-'+_0x35c474+'/'+_0xfc18bc)[_0xbbc3('0x18')](_0x2c67de);}return null;};}function patchUpdates(_0x156624){return function(_0x1c3d5c){try{jsonpatch[_0xbbc3('0x1f')](_0x1c3d5c,_0x156624,!![]);}catch(_0x2b95a4){return BPromise[_0xbbc3('0x20')](_0x2b95a4);}return _0x1c3d5c[_0xbbc3('0x21')]();};}function saveUpdates(_0x1af7b6,_0x5d5942){return function(_0x3e3567){if(_0x3e3567){return _0x3e3567[_0xbbc3('0x22')](_0x1af7b6)[_0xbbc3('0x23')](function(_0x497048){return _0x497048;});}return null;};}function removeEntity(_0x399696,_0x2df0c6){return function(_0x4555ca){if(_0x4555ca){return _0x4555ca[_0xbbc3('0x24')]()[_0xbbc3('0x23')](function(){var _0x4a3bd6=_0x4555ca[_0xbbc3('0x25')]({'plain':!![]});var _0x43aa4f='Companies';return db[_0xbbc3('0x26')][_0xbbc3('0x24')]({'where':{'type':_0x43aa4f,'resourceId':_0x4a3bd6['id']}})[_0xbbc3('0x23')](function(){return _0x4555ca;});})['then'](function(){_0x399696[_0xbbc3('0x16')](0xcc)[_0xbbc3('0x17')]();});}};}function handleEntityNotFound(_0xe2f99b,_0x279d73){return function(_0x396fdb){if(!_0x396fdb){_0xe2f99b['sendStatus'](0x194);}return _0x396fdb;};}function handleError(_0x29948b,_0x410863){_0x410863=_0x410863||0x1f4;return function(_0x1affcc){logger[_0xbbc3('0x27')](_0x1affcc[_0xbbc3('0x28')]);if(_0x1affcc[_0xbbc3('0x29')]){delete _0x1affcc[_0xbbc3('0x29')];}_0x29948b[_0xbbc3('0x16')](_0x410863)['send'](_0x1affcc);};}exports[_0xbbc3('0x2a')]=function(_0x46acad,_0x2b6bf6){var _0x49a751={},_0xd4b4aa={},_0x21985e={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xbbc3('0x23')](function(_0x4c7083){_0xd4b4aa[_0xbbc3('0x2b')]=_[_0xbbc3('0x2c')](_0x4c7083);_0xd4b4aa[_0xbbc3('0x2d')]=_['keys'](_0x46acad[_0xbbc3('0x2d')]);_0xd4b4aa['filters']=_[_0xbbc3('0x2e')](_0xd4b4aa[_0xbbc3('0x2b')],_0xd4b4aa['query']);_0x49a751[_0xbbc3('0x2f')]=_['intersection'](_0xd4b4aa[_0xbbc3('0x2b')],qs[_0xbbc3('0x30')](_0x46acad[_0xbbc3('0x2d')][_0xbbc3('0x30')]));_0x49a751[_0xbbc3('0x2f')]=_0x49a751[_0xbbc3('0x2f')]['length']?_0x49a751[_0xbbc3('0x2f')]:_0xd4b4aa['model'];if(!_0x46acad[_0xbbc3('0x2d')]['hasOwnProperty']('nolimit')){_0x49a751['limit']=qs[_0xbbc3('0x1b')](_0x46acad[_0xbbc3('0x2d')][_0xbbc3('0x1b')]);_0x49a751[_0xbbc3('0x19')]=qs[_0xbbc3('0x19')](_0x46acad[_0xbbc3('0x2d')][_0xbbc3('0x19')]);}_0x49a751['order']=qs[_0xbbc3('0x31')](_0x46acad[_0xbbc3('0x2d')][_0xbbc3('0x31')]);_0x49a751[_0xbbc3('0x32')]=qs[_0xbbc3('0x33')](_[_0xbbc3('0x34')](_0x46acad[_0xbbc3('0x2d')],_0xd4b4aa[_0xbbc3('0x33')]),_0x4c7083);if(_0x46acad[_0xbbc3('0x2d')][_0xbbc3('0x35')]){_0x49a751['where']=_[_0xbbc3('0x36')](_0x49a751[_0xbbc3('0x32')],{'$or':_['map'](_0x49a751[_0xbbc3('0x2f')],function(_0x29f764){var _0x22e8ca={};_0x22e8ca[_0x29f764]={'$like':'%'+_0x46acad[_0xbbc3('0x2d')][_0xbbc3('0x35')]+'%'};return _0x22e8ca;})});}_0x49a751=_[_0xbbc3('0x36')]({},_0x49a751,_0x46acad[_0xbbc3('0x37')]);var _0x2304d8={'where':_0x49a751[_0xbbc3('0x32')]};return db[_0xbbc3('0x38')]['count'](_0x2304d8)[_0xbbc3('0x23')](function(_0x3dd18f){_0x21985e[_0xbbc3('0x1c')]=_0x3dd18f;if(_0x46acad[_0xbbc3('0x2d')]['includeAll']){_0x49a751['include']=[{'all':!![]}];}return db[_0xbbc3('0x38')]['findAll'](_0x49a751);})[_0xbbc3('0x23')](function(_0x415b5e){_0x21985e[_0xbbc3('0x39')]=_0x415b5e;return _0x21985e;})[_0xbbc3('0x23')](respondWithFilteredResult(_0x2b6bf6,_0x49a751))[_0xbbc3('0x3a')](handleError(_0x2b6bf6,null));})[_0xbbc3('0x3a')](handleError(_0x2b6bf6,null));};exports[_0xbbc3('0x3b')]=function(_0x57b98b,_0x1d1900){var _0x3f5e67={'raw':![],'where':{'id':_0x57b98b[_0xbbc3('0x3c')]['id']}},_0x57fcc9={};_0x57fcc9[_0xbbc3('0x2b')]=_[_0xbbc3('0x2c')](db[_0xbbc3('0x38')]['rawAttributes']);_0x57fcc9[_0xbbc3('0x2d')]=_['keys'](_0x57b98b[_0xbbc3('0x2d')]);_0x57fcc9[_0xbbc3('0x33')]=_[_0xbbc3('0x2e')](_0x57fcc9[_0xbbc3('0x2b')],_0x57fcc9[_0xbbc3('0x2d')]);_0x3f5e67['attributes']=_[_0xbbc3('0x2e')](_0x57fcc9[_0xbbc3('0x2b')],qs['fields'](_0x57b98b[_0xbbc3('0x2d')][_0xbbc3('0x30')]));_0x3f5e67[_0xbbc3('0x2f')]=_0x3f5e67[_0xbbc3('0x2f')][_0xbbc3('0x3d')]?_0x3f5e67[_0xbbc3('0x2f')]:_0x57fcc9[_0xbbc3('0x2b')];if(_0x57b98b[_0xbbc3('0x2d')]['includeAll']){_0x3f5e67['include']=[{'all':!![]}];}_0x3f5e67=_[_0xbbc3('0x36')]({},_0x3f5e67,_0x57b98b[_0xbbc3('0x37')]);return db['CmCompany'][_0xbbc3('0x3e')](_0x3f5e67)['then'](handleEntityNotFound(_0x1d1900,null))[_0xbbc3('0x23')](respondWithResult(_0x1d1900,null))[_0xbbc3('0x3a')](handleError(_0x1d1900,null));};exports['create']=function(_0x489555,_0x1dc768){return db[_0xbbc3('0x38')][_0xbbc3('0x3f')](_0x489555[_0xbbc3('0x40')],{})[_0xbbc3('0x23')](function(_0x11be59){var _0x2cd5ce=_0x489555[_0xbbc3('0x41')][_0xbbc3('0x25')]({'plain':!![]});if(!_0x2cd5ce)throw new Error(_0xbbc3('0x42'));if(_0x2cd5ce[_0xbbc3('0x43')]===_0xbbc3('0x41')){var _0x38acd7=_0x11be59[_0xbbc3('0x25')]({'plain':!![]});var _0x28c21b=_0xbbc3('0x44');return db['UserProfileSection'][_0xbbc3('0x3e')]({'where':{'name':_0x28c21b,'userProfileId':_0x2cd5ce[_0xbbc3('0x45')]},'raw':!![]})[_0xbbc3('0x23')](function(_0x26fe95){if(_0x26fe95&&_0x26fe95[_0xbbc3('0x46')]===0x0){return db[_0xbbc3('0x26')][_0xbbc3('0x3f')]({'name':_0x38acd7[_0xbbc3('0x29')],'resourceId':_0x38acd7['id'],'type':_0x26fe95[_0xbbc3('0x29')],'sectionId':_0x26fe95['id']},{})[_0xbbc3('0x23')](function(){return _0x11be59;});}else{return _0x11be59;}})[_0xbbc3('0x3a')](function(_0x27a504){logger[_0xbbc3('0x27')](_0xbbc3('0x47'),_0x27a504);throw _0x27a504;});}return _0x11be59;})['then'](respondWithResult(_0x1dc768,0xc9))[_0xbbc3('0x3a')](handleError(_0x1dc768,null));};exports[_0xbbc3('0x22')]=function(_0x25f1a9,_0x5ecbd3){if(_0x25f1a9['body']['id']){delete _0x25f1a9[_0xbbc3('0x40')]['id'];}return db[_0xbbc3('0x38')][_0xbbc3('0x3e')]({'where':{'id':_0x25f1a9['params']['id']}})[_0xbbc3('0x23')](handleEntityNotFound(_0x5ecbd3,null))[_0xbbc3('0x23')](saveUpdates(_0x25f1a9['body'],null))[_0xbbc3('0x23')](respondWithResult(_0x5ecbd3,null))[_0xbbc3('0x3a')](handleError(_0x5ecbd3,null));};exports['destroy']=function(_0x451c80,_0x1acd18){return db[_0xbbc3('0x38')][_0xbbc3('0x3e')]({'where':{'id':_0x451c80['params']['id']}})[_0xbbc3('0x23')](handleEntityNotFound(_0x1acd18,null))[_0xbbc3('0x23')](removeEntity(_0x1acd18,null))[_0xbbc3('0x3a')](handleError(_0x1acd18,null));};exports['describe']=function(_0x3091b0,_0x4dfb39){return db[_0xbbc3('0x38')][_0xbbc3('0x48')]()[_0xbbc3('0x23')](respondWithResult(_0x4dfb39,null))[_0xbbc3('0x3a')](handleError(_0x4dfb39,null));};exports[_0xbbc3('0x49')]=function(_0x1d6a72,_0x504005,_0x1b579b){return db['CmContact']['find']({'where':{'id':_0x1d6a72['params']['id']}})[_0xbbc3('0x23')](handleEntityNotFound(_0x504005,null))[_0xbbc3('0x23')](function(_0x4e31a5){if(_0x4e31a5){return _0x4e31a5[_0xbbc3('0x49')](_0x1d6a72[_0xbbc3('0x40')][_0xbbc3('0x4a')],_[_0xbbc3('0x4b')](_0x1d6a72[_0xbbc3('0x40')],[_0xbbc3('0x4a'),'id'])||{});}})[_0xbbc3('0x23')](respondWithResult(_0x504005,null))['catch'](handleError(_0x504005,null));};exports[_0xbbc3('0x4c')]=function(_0x49a110,_0x18359b,_0x4c2444){var _0x2c99ea={};var _0x32d1ea={};var _0x3e593e;var _0x208330;return db['CmCompany'][_0xbbc3('0x4d')]({'where':{'id':_0x49a110[_0xbbc3('0x3c')]['id']}})['then'](handleEntityNotFound(_0x18359b,null))[_0xbbc3('0x23')](function(_0x4f0148){if(_0x4f0148){_0x3e593e=_0x4f0148;_0x32d1ea[_0xbbc3('0x2b')]=_['keys'](db[_0xbbc3('0x4e')][_0xbbc3('0x4f')]);_0x32d1ea[_0xbbc3('0x2d')]=_[_0xbbc3('0x2c')](_0x49a110[_0xbbc3('0x2d')]);_0x32d1ea[_0xbbc3('0x33')]=_[_0xbbc3('0x2e')](_0x32d1ea['model'],_0x32d1ea[_0xbbc3('0x2d')]);_0x2c99ea[_0xbbc3('0x2f')]=_[_0xbbc3('0x2e')](_0x32d1ea[_0xbbc3('0x2b')],qs[_0xbbc3('0x30')](_0x49a110[_0xbbc3('0x2d')]['fields']));_0x2c99ea[_0xbbc3('0x2f')]=_0x2c99ea[_0xbbc3('0x2f')][_0xbbc3('0x3d')]?_0x2c99ea[_0xbbc3('0x2f')]:_0x32d1ea[_0xbbc3('0x2b')];_0x2c99ea[_0xbbc3('0x50')]=qs[_0xbbc3('0x31')](_0x49a110[_0xbbc3('0x2d')][_0xbbc3('0x31')]);_0x2c99ea[_0xbbc3('0x32')]=qs[_0xbbc3('0x33')](_[_0xbbc3('0x34')](_0x49a110[_0xbbc3('0x2d')],_0x32d1ea[_0xbbc3('0x33')]));if(_0x49a110[_0xbbc3('0x2d')][_0xbbc3('0x35')]){_0x2c99ea[_0xbbc3('0x32')]=_[_0xbbc3('0x36')](_0x2c99ea[_0xbbc3('0x32')],{'$or':_[_0xbbc3('0x51')](_0x2c99ea[_0xbbc3('0x2f')],function(_0x26c38b){var _0x298846={};_0x298846[_0x26c38b]={'$like':'%'+_0x49a110['query'][_0xbbc3('0x35')]+'%'};return _0x298846;})});}_0x2c99ea=_['merge']({},_0x2c99ea,_0x49a110[_0xbbc3('0x37')]);return _0x3e593e[_0xbbc3('0x4c')](_0x2c99ea);}})[_0xbbc3('0x23')](function(_0x6d4287){if(_0x6d4287){_0x208330=_0x6d4287[_0xbbc3('0x3d')];if(!_0x49a110[_0xbbc3('0x2d')]['hasOwnProperty'](_0xbbc3('0x52'))){_0x2c99ea[_0xbbc3('0x1b')]=qs[_0xbbc3('0x1b')](_0x49a110[_0xbbc3('0x2d')][_0xbbc3('0x1b')]);_0x2c99ea[_0xbbc3('0x19')]=qs[_0xbbc3('0x19')](_0x49a110[_0xbbc3('0x2d')][_0xbbc3('0x19')]);}return _0x3e593e[_0xbbc3('0x4c')](_0x2c99ea);}})[_0xbbc3('0x23')](function(_0x303b08){if(_0x303b08){return _0x303b08?{'count':_0x208330,'rows':_0x303b08}:null;}})[_0xbbc3('0x23')](respondWithResult(_0x18359b,null))[_0xbbc3('0x3a')](handleError(_0x18359b,null));}; \ No newline at end of file +var _0x6a29=['Companies','UserProfileResource','then','error','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','body','user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','omit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','apply','save','update','destroy','get'];(function(_0x393d83,_0xc7dbd9){var _0x512585=function(_0x46ff01){while(--_0x46ff01){_0x393d83['push'](_0x393d83['shift']());}};_0x512585(++_0xc7dbd9);}(_0x6a29,0x11e));var _0x96a2=function(_0x4b3faf,_0x12046e){_0x4b3faf=_0x4b3faf-0x0;var _0x51c6ef=_0x6a29[_0x4b3faf];return _0x51c6ef;};'use strict';var emlformat=require(_0x96a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96a2('0x1'));var jsonpatch=require(_0x96a2('0x2'));var rp=require(_0x96a2('0x3'));var moment=require('moment');var BPromise=require(_0x96a2('0x4'));var Mustache=require(_0x96a2('0x5'));var util=require(_0x96a2('0x6'));var path=require('path');var sox=require(_0x96a2('0x7'));var csv=require(_0x96a2('0x8'));var ejs=require(_0x96a2('0x9'));var fs=require('fs');var fs_extra=require(_0x96a2('0xa'));var _=require(_0x96a2('0xb'));var squel=require(_0x96a2('0xc'));var crypto=require(_0x96a2('0xd'));var jsforce=require(_0x96a2('0xe'));var deskjs=require(_0x96a2('0xf'));var toCsv=require(_0x96a2('0x8'));var querystring=require(_0x96a2('0x10'));var Papa=require(_0x96a2('0x11'));var Redis=require('ioredis');var authService=require(_0x96a2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x96a2('0x13'));var hardwareService=require(_0x96a2('0x14'));var logger=require(_0x96a2('0x15'))(_0x96a2('0x16'));var utils=require('../../config/utils');var config=require(_0x96a2('0x17'));var licenseUtil=require(_0x96a2('0x18'));var db=require(_0x96a2('0x19'))['db'];function respondWithStatusCode(_0x33f981,_0x33215b){_0x33215b=_0x33215b||0xcc;return function(_0x1b6d16){if(_0x1b6d16){return _0x33f981[_0x96a2('0x1a')](_0x33215b);}return _0x33f981[_0x96a2('0x1b')](_0x33215b)[_0x96a2('0x1c')]();};}function respondWithResult(_0x135b94,_0x2af5fd){_0x2af5fd=_0x2af5fd||0xc8;return function(_0x1bb2cf){if(_0x1bb2cf){return _0x135b94[_0x96a2('0x1b')](_0x2af5fd)['json'](_0x1bb2cf);}};}function respondWithFilteredResult(_0x43476c,_0x29c0ef){return function(_0x381253){if(_0x381253){var _0xcc9dde=typeof _0x29c0ef['offset']==='undefined'&&typeof _0x29c0ef[_0x96a2('0x1d')]===_0x96a2('0x1e');var _0x22c3aa=_0x381253[_0x96a2('0x1f')];var _0x52c8c5=_0xcc9dde?0x0:_0x29c0ef[_0x96a2('0x20')];var _0x54d657=_0xcc9dde?_0x381253[_0x96a2('0x1f')]:_0x29c0ef[_0x96a2('0x20')]+_0x29c0ef[_0x96a2('0x1d')];var _0x358c39;if(_0x54d657>=_0x22c3aa){_0x54d657=_0x22c3aa;_0x358c39=0xc8;}else{_0x358c39=0xce;}_0x43476c[_0x96a2('0x1b')](_0x358c39);return _0x43476c['set']('Content-Range',_0x52c8c5+'-'+_0x54d657+'/'+_0x22c3aa)['json'](_0x381253);}return null;};}function patchUpdates(_0x520a28){return function(_0x3b018b){try{jsonpatch[_0x96a2('0x21')](_0x3b018b,_0x520a28,!![]);}catch(_0x49680a){return BPromise['reject'](_0x49680a);}return _0x3b018b[_0x96a2('0x22')]();};}function saveUpdates(_0x25aa4c,_0x288ad1){return function(_0x7ec761){if(_0x7ec761){return _0x7ec761[_0x96a2('0x23')](_0x25aa4c)['then'](function(_0x309e19){return _0x309e19;});}return null;};}function removeEntity(_0x2e7abb,_0x1d7dc8){return function(_0x3d882c){if(_0x3d882c){return _0x3d882c[_0x96a2('0x24')]()['then'](function(){var _0x47f8b6=_0x3d882c[_0x96a2('0x25')]({'plain':!![]});var _0x50fd8c=_0x96a2('0x26');return db[_0x96a2('0x27')][_0x96a2('0x24')]({'where':{'type':_0x50fd8c,'resourceId':_0x47f8b6['id']}})[_0x96a2('0x28')](function(){return _0x3d882c;});})[_0x96a2('0x28')](function(){_0x2e7abb[_0x96a2('0x1b')](0xcc)[_0x96a2('0x1c')]();});}};}function handleEntityNotFound(_0x286392,_0x50daf7){return function(_0x5c8c60){if(!_0x5c8c60){_0x286392[_0x96a2('0x1a')](0x194);}return _0x5c8c60;};}function handleError(_0x4819ea,_0x53b581){_0x53b581=_0x53b581||0x1f4;return function(_0x3a62cc){logger[_0x96a2('0x29')](_0x3a62cc[_0x96a2('0x2a')]);if(_0x3a62cc[_0x96a2('0x2b')]){delete _0x3a62cc[_0x96a2('0x2b')];}_0x4819ea['status'](_0x53b581)[_0x96a2('0x2c')](_0x3a62cc);};}exports['index']=function(_0x122100,_0x28e11d){var _0xaaa022={},_0x11a099={},_0x407037={'count':0x0,'rows':[]};return db[_0x96a2('0x2d')][_0x96a2('0x2e')]()['then'](function(_0x1db8bb){_0x11a099[_0x96a2('0x2f')]=_[_0x96a2('0x30')](_0x1db8bb);_0x11a099[_0x96a2('0x31')]=_[_0x96a2('0x30')](_0x122100['query']);_0x11a099[_0x96a2('0x32')]=_['intersection'](_0x11a099[_0x96a2('0x2f')],_0x11a099[_0x96a2('0x31')]);_0xaaa022['attributes']=_[_0x96a2('0x33')](_0x11a099['model'],qs[_0x96a2('0x34')](_0x122100[_0x96a2('0x31')][_0x96a2('0x34')]));_0xaaa022[_0x96a2('0x35')]=_0xaaa022[_0x96a2('0x35')]['length']?_0xaaa022[_0x96a2('0x35')]:_0x11a099['model'];if(!_0x122100[_0x96a2('0x31')][_0x96a2('0x36')](_0x96a2('0x37'))){_0xaaa022[_0x96a2('0x1d')]=qs[_0x96a2('0x1d')](_0x122100[_0x96a2('0x31')][_0x96a2('0x1d')]);_0xaaa022[_0x96a2('0x20')]=qs[_0x96a2('0x20')](_0x122100[_0x96a2('0x31')]['offset']);}_0xaaa022[_0x96a2('0x38')]=qs[_0x96a2('0x39')](_0x122100[_0x96a2('0x31')]['sort']);_0xaaa022[_0x96a2('0x3a')]=qs[_0x96a2('0x32')](_[_0x96a2('0x3b')](_0x122100[_0x96a2('0x31')],_0x11a099[_0x96a2('0x32')]),_0x1db8bb);if(_0x122100[_0x96a2('0x31')][_0x96a2('0x3c')]){_0xaaa022[_0x96a2('0x3a')]=_[_0x96a2('0x3d')](_0xaaa022[_0x96a2('0x3a')],{'$or':_[_0x96a2('0x3e')](_0xaaa022[_0x96a2('0x35')],function(_0x4857c4){var _0x4196dd={};_0x4196dd[_0x4857c4]={'$like':'%'+_0x122100['query'][_0x96a2('0x3c')]+'%'};return _0x4196dd;})});}_0xaaa022=_[_0x96a2('0x3d')]({},_0xaaa022,_0x122100[_0x96a2('0x3f')]);var _0x427e6b={'where':_0xaaa022['where']};return db[_0x96a2('0x2d')][_0x96a2('0x1f')](_0x427e6b)[_0x96a2('0x28')](function(_0x205770){_0x407037[_0x96a2('0x1f')]=_0x205770;if(_0x122100['query'][_0x96a2('0x40')]){_0xaaa022[_0x96a2('0x41')]=[{'all':!![]}];}return db[_0x96a2('0x2d')][_0x96a2('0x42')](_0xaaa022);})['then'](function(_0x2c8975){_0x407037[_0x96a2('0x43')]=_0x2c8975;return _0x407037;})['then'](respondWithFilteredResult(_0x28e11d,_0xaaa022))[_0x96a2('0x44')](handleError(_0x28e11d,null));})[_0x96a2('0x44')](handleError(_0x28e11d,null));};exports['show']=function(_0x7145f5,_0x53bb16){var _0x16b4aa={'raw':![],'where':{'id':_0x7145f5[_0x96a2('0x45')]['id']}},_0x28beeb={};_0x28beeb[_0x96a2('0x2f')]=_[_0x96a2('0x30')](db[_0x96a2('0x2d')][_0x96a2('0x46')]);_0x28beeb[_0x96a2('0x31')]=_[_0x96a2('0x30')](_0x7145f5['query']);_0x28beeb[_0x96a2('0x32')]=_[_0x96a2('0x33')](_0x28beeb[_0x96a2('0x2f')],_0x28beeb[_0x96a2('0x31')]);_0x16b4aa['attributes']=_[_0x96a2('0x33')](_0x28beeb[_0x96a2('0x2f')],qs['fields'](_0x7145f5[_0x96a2('0x31')][_0x96a2('0x34')]));_0x16b4aa[_0x96a2('0x35')]=_0x16b4aa[_0x96a2('0x35')][_0x96a2('0x47')]?_0x16b4aa['attributes']:_0x28beeb['model'];if(_0x7145f5[_0x96a2('0x31')][_0x96a2('0x40')]){_0x16b4aa[_0x96a2('0x41')]=[{'all':!![]}];}_0x16b4aa=_[_0x96a2('0x3d')]({},_0x16b4aa,_0x7145f5[_0x96a2('0x3f')]);return db[_0x96a2('0x2d')][_0x96a2('0x48')](_0x16b4aa)[_0x96a2('0x28')](handleEntityNotFound(_0x53bb16,null))['then'](respondWithResult(_0x53bb16,null))['catch'](handleError(_0x53bb16,null));};exports['create']=function(_0x76a0d4,_0x2992df){return db[_0x96a2('0x2d')]['create'](_0x76a0d4[_0x96a2('0x49')],{})[_0x96a2('0x28')](function(_0x156ff1){var _0x15747e=_0x76a0d4[_0x96a2('0x4a')][_0x96a2('0x25')]({'plain':!![]});if(!_0x15747e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15747e[_0x96a2('0x4b')]===_0x96a2('0x4a')){var _0x2ce169=_0x156ff1[_0x96a2('0x25')]({'plain':!![]});var _0x2d5121=_0x96a2('0x26');return db['UserProfileSection'][_0x96a2('0x48')]({'where':{'name':_0x2d5121,'userProfileId':_0x15747e['userProfileId']},'raw':!![]})[_0x96a2('0x28')](function(_0x22677f){if(_0x22677f&&_0x22677f[_0x96a2('0x4c')]===0x0){return db[_0x96a2('0x27')][_0x96a2('0x4d')]({'name':_0x2ce169[_0x96a2('0x2b')],'resourceId':_0x2ce169['id'],'type':_0x22677f[_0x96a2('0x2b')],'sectionId':_0x22677f['id']},{})[_0x96a2('0x28')](function(){return _0x156ff1;});}else{return _0x156ff1;}})['catch'](function(_0x461a60){logger['error'](_0x96a2('0x4e'),_0x461a60);throw _0x461a60;});}return _0x156ff1;})[_0x96a2('0x28')](respondWithResult(_0x2992df,0xc9))[_0x96a2('0x44')](handleError(_0x2992df,null));};exports[_0x96a2('0x23')]=function(_0x390f8a,_0x2e310e){if(_0x390f8a[_0x96a2('0x49')]['id']){delete _0x390f8a[_0x96a2('0x49')]['id'];}return db[_0x96a2('0x2d')]['find']({'where':{'id':_0x390f8a[_0x96a2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e310e,null))[_0x96a2('0x28')](saveUpdates(_0x390f8a[_0x96a2('0x49')],null))[_0x96a2('0x28')](respondWithResult(_0x2e310e,null))[_0x96a2('0x44')](handleError(_0x2e310e,null));};exports[_0x96a2('0x24')]=function(_0x152aa4,_0xbeb753){return db['CmCompany'][_0x96a2('0x48')]({'where':{'id':_0x152aa4[_0x96a2('0x45')]['id']}})['then'](handleEntityNotFound(_0xbeb753,null))[_0x96a2('0x28')](removeEntity(_0xbeb753,null))[_0x96a2('0x44')](handleError(_0xbeb753,null));};exports[_0x96a2('0x2e')]=function(_0x1d1c6d,_0x56c0a4){return db['CmCompany'][_0x96a2('0x2e')]()[_0x96a2('0x28')](respondWithResult(_0x56c0a4,null))['catch'](handleError(_0x56c0a4,null));};exports['addContacts']=function(_0x34dbde,_0x3aaddc,_0x398d13){return db[_0x96a2('0x4f')][_0x96a2('0x48')]({'where':{'id':_0x34dbde[_0x96a2('0x45')]['id']}})[_0x96a2('0x28')](handleEntityNotFound(_0x3aaddc,null))[_0x96a2('0x28')](function(_0x362667){if(_0x362667){return _0x362667['addContacts'](_0x34dbde[_0x96a2('0x49')]['ids'],_[_0x96a2('0x50')](_0x34dbde[_0x96a2('0x49')],['ids','id'])||{});}})[_0x96a2('0x28')](respondWithResult(_0x3aaddc,null))['catch'](handleError(_0x3aaddc,null));};exports['getContacts']=function(_0x304d68,_0x5ab53a,_0x5c95f8){var _0xb71a79={};var _0xf7e3aa={};var _0x3f8342;var _0x5ed373;return db['CmCompany']['findOne']({'where':{'id':_0x304d68[_0x96a2('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ab53a,null))[_0x96a2('0x28')](function(_0x4c7ea5){if(_0x4c7ea5){_0x3f8342=_0x4c7ea5;_0xf7e3aa[_0x96a2('0x2f')]=_[_0x96a2('0x30')](db[_0x96a2('0x4f')][_0x96a2('0x46')]);_0xf7e3aa[_0x96a2('0x31')]=_['keys'](_0x304d68[_0x96a2('0x31')]);_0xf7e3aa[_0x96a2('0x32')]=_[_0x96a2('0x33')](_0xf7e3aa[_0x96a2('0x2f')],_0xf7e3aa[_0x96a2('0x31')]);_0xb71a79[_0x96a2('0x35')]=_[_0x96a2('0x33')](_0xf7e3aa[_0x96a2('0x2f')],qs['fields'](_0x304d68[_0x96a2('0x31')]['fields']));_0xb71a79[_0x96a2('0x35')]=_0xb71a79[_0x96a2('0x35')][_0x96a2('0x47')]?_0xb71a79[_0x96a2('0x35')]:_0xf7e3aa[_0x96a2('0x2f')];_0xb71a79['order']=qs[_0x96a2('0x39')](_0x304d68[_0x96a2('0x31')][_0x96a2('0x39')]);_0xb71a79[_0x96a2('0x3a')]=qs[_0x96a2('0x32')](_['pick'](_0x304d68[_0x96a2('0x31')],_0xf7e3aa[_0x96a2('0x32')]));if(_0x304d68[_0x96a2('0x31')][_0x96a2('0x3c')]){_0xb71a79['where']=_[_0x96a2('0x3d')](_0xb71a79['where'],{'$or':_[_0x96a2('0x3e')](_0xb71a79[_0x96a2('0x35')],function(_0x603d5c){var _0x199829={};_0x199829[_0x603d5c]={'$like':'%'+_0x304d68[_0x96a2('0x31')][_0x96a2('0x3c')]+'%'};return _0x199829;})});}_0xb71a79=_[_0x96a2('0x3d')]({},_0xb71a79,_0x304d68[_0x96a2('0x3f')]);return _0x3f8342['getContacts'](_0xb71a79);}})['then'](function(_0x59255d){if(_0x59255d){_0x5ed373=_0x59255d[_0x96a2('0x47')];if(!_0x304d68['query'][_0x96a2('0x36')](_0x96a2('0x37'))){_0xb71a79[_0x96a2('0x1d')]=qs[_0x96a2('0x1d')](_0x304d68['query'][_0x96a2('0x1d')]);_0xb71a79[_0x96a2('0x20')]=qs[_0x96a2('0x20')](_0x304d68[_0x96a2('0x31')][_0x96a2('0x20')]);}return _0x3f8342['getContacts'](_0xb71a79);}})[_0x96a2('0x28')](function(_0x52f1cd){if(_0x52f1cd){return _0x52f1cd?{'count':_0x5ed373,'rows':_0x52f1cd}:null;}})[_0x96a2('0x28')](respondWithResult(_0x5ab53a,null))[_0x96a2('0x44')](handleError(_0x5ab53a,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 813927d..558cb09 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 _0x3807=['../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3807,0x13d));var _0x7380=function(_0x4f11d8,_0x5e1351){_0x4f11d8=_0x4f11d8-0x0;var _0x4f2f58=_0x3807[_0x4f11d8];return _0x4f2f58;};'use strict';var _=require(_0x7380('0x0'));var util=require(_0x7380('0x1'));var logger=require('../../config/logger')(_0x7380('0x2'));var moment=require(_0x7380('0x3'));var BPromise=require(_0x7380('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7380('0x5'));var rimraf=require(_0x7380('0x6'));var config=require(_0x7380('0x7'));var attributes=require(_0x7380('0x8'));module['exports']=function(_0x354b9a,_0x49d180){return _0x354b9a[_0x7380('0x9')](_0x7380('0xa'),attributes,{'tableName':_0x7380('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7cd=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0xe7cd,0x99));var _0xde7c=function(_0x34ad6e,_0x46c774){_0x34ad6e=_0x34ad6e-0x0;var _0x4ecb52=_0xe7cd[_0x34ad6e];return _0x4ecb52;};'use strict';var _=require(_0xde7c('0x0'));var util=require(_0xde7c('0x1'));var logger=require(_0xde7c('0x2'))(_0xde7c('0x3'));var moment=require(_0xde7c('0x4'));var BPromise=require(_0xde7c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde7c('0x6'));var rimraf=require(_0xde7c('0x7'));var config=require(_0xde7c('0x8'));var attributes=require(_0xde7c('0x9'));module[_0xde7c('0xa')]=function(_0x7a62b8,_0x1bc38a){return _0x7a62b8[_0xde7c('0xb')](_0xde7c('0xc'),attributes,{'tableName':_0xde7c('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 3c9c83f..e92f875 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 _0x54a8=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util'];(function(_0x466ee3,_0x4864bc){var _0x40e34f=function(_0x3febfe){while(--_0x3febfe){_0x466ee3['push'](_0x466ee3['shift']());}};_0x40e34f(++_0x4864bc);}(_0x54a8,0x8a));var _0x854a=function(_0x314454,_0x58c3a7){_0x314454=_0x314454-0x0;var _0x1f8aac=_0x54a8[_0x314454];return _0x1f8aac;};'use strict';var _=require(_0x854a('0x0'));var util=require(_0x854a('0x1'));var moment=require(_0x854a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x854a('0x3'));var db=require(_0x854a('0x4'))['db'];var utils=require(_0x854a('0x5'));var logger=require(_0x854a('0x6'))(_0x854a('0x7'));var config=require('../../config/environment');var jayson=require(_0x854a('0x8'));var client=jayson[_0x854a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x309d01,_0x160d84,_0x34e4d0){return new BPromise(function(_0x5de2bf,_0x44dea9){return client['request'](_0x309d01,_0x34e4d0)[_0x854a('0xa')](function(_0x3eaaea){logger['info']('CmCompany,\x20%s,\x20%s',_0x160d84,'request\x20sent');logger[_0x854a('0xb')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x160d84,'request\x20sent',JSON[_0x854a('0xc')](_0x3eaaea));if(_0x3eaaea['error']){if(_0x3eaaea[_0x854a('0xd')][_0x854a('0xe')]===0x1f4){logger[_0x854a('0xd')]('CmCompany,\x20%s,\x20%s',_0x160d84,_0x3eaaea[_0x854a('0xd')][_0x854a('0xf')]);return _0x44dea9(_0x3eaaea[_0x854a('0xd')][_0x854a('0xf')]);}logger[_0x854a('0xd')](_0x854a('0x10'),_0x160d84,_0x3eaaea[_0x854a('0xd')][_0x854a('0xf')]);return _0x5de2bf(_0x3eaaea[_0x854a('0xd')]['message']);}else{logger['info'](_0x854a('0x10'),_0x160d84,_0x854a('0x11'));_0x5de2bf(_0x3eaaea[_0x854a('0x12')]['message']);}})[_0x854a('0x13')](function(_0x34824d){logger['error'](_0x854a('0x10'),_0x160d84,_0x34824d);_0x44dea9(_0x34824d);});});} \ No newline at end of file +var _0xc2d1=['jayson/promise','client','http','info','CmCompany,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x229971,_0x3961f7){var _0x1d5266=function(_0x599286){while(--_0x599286){_0x229971['push'](_0x229971['shift']());}};_0x1d5266(++_0x3961f7);}(_0xc2d1,0x1e6));var _0x1c2d=function(_0x4f7497,_0x1f8d70){_0x4f7497=_0x4f7497-0x0;var _0xce9b1=_0xc2d1[_0x4f7497];return _0xce9b1;};'use strict';var _=require('lodash');var util=require(_0x1c2d('0x0'));var moment=require(_0x1c2d('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c2d('0x2'));var fs=require('fs');var Redis=require(_0x1c2d('0x3'));var db=require(_0x1c2d('0x4'))['db'];var utils=require(_0x1c2d('0x5'));var logger=require('../../config/logger')(_0x1c2d('0x6'));var config=require(_0x1c2d('0x7'));var jayson=require(_0x1c2d('0x8'));var client=jayson[_0x1c2d('0x9')][_0x1c2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x556cd9,_0x5d01fe,_0x1e1345){return new BPromise(function(_0x400094,_0x1999dd){return client['request'](_0x556cd9,_0x1e1345)['then'](function(_0x13910f){logger[_0x1c2d('0xb')](_0x1c2d('0xc'),_0x5d01fe,'request\x20sent');logger[_0x1c2d('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5d01fe,_0x1c2d('0xe'),JSON['stringify'](_0x13910f));if(_0x13910f[_0x1c2d('0xf')]){if(_0x13910f['error']['code']===0x1f4){logger[_0x1c2d('0xf')](_0x1c2d('0xc'),_0x5d01fe,_0x13910f[_0x1c2d('0xf')][_0x1c2d('0x10')]);return _0x1999dd(_0x13910f[_0x1c2d('0xf')][_0x1c2d('0x10')]);}logger[_0x1c2d('0xf')](_0x1c2d('0xc'),_0x5d01fe,_0x13910f[_0x1c2d('0xf')]['message']);return _0x400094(_0x13910f['error'][_0x1c2d('0x10')]);}else{logger[_0x1c2d('0xb')](_0x1c2d('0xc'),_0x5d01fe,_0x1c2d('0xe'));_0x400094(_0x13910f[_0x1c2d('0x11')][_0x1c2d('0x10')]);}})[_0x1c2d('0x12')](function(_0xae7f17){logger[_0x1c2d('0xf')](_0x1c2d('0xc'),_0x5d01fe,_0xae7f17);_0x1999dd(_0xae7f17);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 76d552b..237ff2e 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 _0x0076=['/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','delete','destroy','multer','util','express','Router','fs-extra','./cmCompany.controller','get','isAuthenticated'];(function(_0x32be62,_0x22e6fd){var _0x1a37e9=function(_0x35a9c1){while(--_0x35a9c1){_0x32be62['push'](_0x32be62['shift']());}};_0x1a37e9(++_0x22e6fd);}(_0x0076,0xe8));var _0x6007=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x0076[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0x6007('0x0'));var util=require(_0x6007('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6007('0x2'));var router=express[_0x6007('0x3')]();var fs_extra=require(_0x6007('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6007('0x5'));router[_0x6007('0x6')]('/',auth[_0x6007('0x7')](),controller['index']);router['get'](_0x6007('0x8'),auth['isAuthenticated'](),controller[_0x6007('0x9')]);router['get'](_0x6007('0xa'),auth['isAuthenticated'](),controller[_0x6007('0xb')]);router[_0x6007('0x6')]('/:id/contacts',auth[_0x6007('0x7')](),controller[_0x6007('0xc')]);router[_0x6007('0xd')]('/',auth[_0x6007('0x7')](),controller[_0x6007('0xe')]);router[_0x6007('0xd')](_0x6007('0xf'),auth[_0x6007('0x7')](),controller[_0x6007('0x10')]);router[_0x6007('0x11')](_0x6007('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6007('0x12')](_0x6007('0xa'),auth[_0x6007('0x7')](),controller[_0x6007('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb89f=['/describe','describe','show','/:id/contacts','post','addContacts','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index'];(function(_0x2df1ab,_0x19994c){var _0x4beeac=function(_0x3a8c35){while(--_0x3a8c35){_0x2df1ab['push'](_0x2df1ab['shift']());}};_0x4beeac(++_0x19994c);}(_0xb89f,0xdc));var _0xfb89=function(_0x248ecc,_0x473a71){_0x248ecc=_0x248ecc-0x0;var _0x404db4=_0xb89f[_0x248ecc];return _0x404db4;};'use strict';var multer=require(_0xfb89('0x0'));var util=require(_0xfb89('0x1'));var path=require('path');var timeout=require(_0xfb89('0x2'));var express=require('express');var router=express[_0xfb89('0x3')]();var fs_extra=require(_0xfb89('0x4'));var auth=require(_0xfb89('0x5'));var interaction=require(_0xfb89('0x6'));var config=require('../../config/environment');var controller=require(_0xfb89('0x7'));router[_0xfb89('0x8')]('/',auth[_0xfb89('0x9')](),controller[_0xfb89('0xa')]);router[_0xfb89('0x8')](_0xfb89('0xb'),auth[_0xfb89('0x9')](),controller[_0xfb89('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xfb89('0xd')]);router[_0xfb89('0x8')](_0xfb89('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0xfb89('0xf')]('/',auth[_0xfb89('0x9')](),controller['create']);router[_0xfb89('0xf')](_0xfb89('0xe'),auth[_0xfb89('0x9')](),controller[_0xfb89('0x10')]);router['put']('/:id',auth[_0xfb89('0x9')](),controller['update']);router[_0xfb89('0x11')](_0xfb89('0x12'),auth['isAuthenticated'](),controller[_0xfb89('0x13')]);module[_0xfb89('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index df837f6..b1cf95b 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 _0x9861=['INTEGER','DATE','lodash','exports','STRING'];(function(_0x310dd2,_0x29e72a){var _0x2d8598=function(_0x39a0d0){while(--_0x39a0d0){_0x310dd2['push'](_0x310dd2['shift']());}};_0x2d8598(++_0x29e72a);}(_0x9861,0x1ab));var _0x1986=function(_0x3ba24e,_0x1efb5f){_0x3ba24e=_0x3ba24e-0x0;var _0xa1e6be=_0x9861[_0x3ba24e];return _0xa1e6be;};'use strict';var _=require(_0x1986('0x0'));var Sequelize=require('sequelize');module[_0x1986('0x1')]={'firstName':{'type':Sequelize[_0x1986('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1986('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1986('0x2')]},'city':{'type':Sequelize[_0x1986('0x2')]},'country':{'type':Sequelize[_0x1986('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1986('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1986('0x2')]},'mobile':{'type':Sequelize[_0x1986('0x2')]},'fax':{'type':Sequelize[_0x1986('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x1986('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x1986('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x1986('0x2')]},'telegram':{'type':Sequelize[_0x1986('0x2')]},'UserId':{'type':Sequelize[_0x1986('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x1986('0x2')]},'priority':{'type':Sequelize[_0x1986('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1986('0x4')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x1986('0x2')]},'utcOffset':{'type':Sequelize[_0x1986('0x3')]}}; \ No newline at end of file +var _0x81af=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x2a98e3,_0x488997){var _0x370a71=function(_0x3b71cb){while(--_0x3b71cb){_0x2a98e3['push'](_0x2a98e3['shift']());}};_0x370a71(++_0x488997);}(_0x81af,0x1af));var _0xf81a=function(_0x205b52,_0x94a0cb){_0x205b52=_0x205b52-0x0;var _0x23068b=_0x81af[_0x205b52];return _0x23068b;};'use strict';var _=require(_0xf81a('0x0'));var Sequelize=require(_0xf81a('0x1'));module[_0xf81a('0x2')]={'firstName':{'type':Sequelize[_0xf81a('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf81a('0x3')]},'street':{'type':Sequelize[_0xf81a('0x3')]},'postalCode':{'type':Sequelize[_0xf81a('0x3')]},'city':{'type':Sequelize[_0xf81a('0x3')]},'country':{'type':Sequelize[_0xf81a('0x3')]},'dateOfBirth':{'type':Sequelize[_0xf81a('0x3')]},'description':{'type':Sequelize[_0xf81a('0x4')]},'phone':{'type':Sequelize[_0xf81a('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf81a('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xf81a('0x3')]},'fb_data':{'type':Sequelize[_0xf81a('0x3')]},'twitter':{'type':Sequelize[_0xf81a('0x3')]},'skype':{'type':Sequelize[_0xf81a('0x3')]},'teams':{'type':Sequelize[_0xf81a('0x3')]},'viber':{'type':Sequelize[_0xf81a('0x3')]},'line':{'type':Sequelize[_0xf81a('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xf81a('0x3')]},'UserId':{'type':Sequelize[_0xf81a('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf81a('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf81a('0x7')],'defaultValue':Sequelize[_0xf81a('0x8')]},'dialTimezone':{'type':Sequelize[_0xf81a('0x3')]},'utcOffset':{'type':Sequelize[_0xf81a('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 58b88e2..c8762fb 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index e267680..2dfbc6d 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedbf=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57f6ba,_0x124af4){var _0xdc8d5b=function(_0x3e8000){while(--_0x3e8000){_0x57f6ba['push'](_0x57f6ba['shift']());}};_0xdc8d5b(++_0x124af4);}(_0xedbf,0x1ce));var _0xfedb=function(_0x422994,_0x99047b){_0x422994=_0x422994-0x0;var _0x43ad8f=_0xedbf[_0x422994];return _0x43ad8f;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xfedb('0x0')](0x0);var events={'afterCreate':_0xfedb('0x1'),'afterUpdate':_0xfedb('0x2'),'afterDestroy':_0xfedb('0x3')};function emitEvent(_0x1f82d1){return function(_0x22eab8,_0x196eed,_0xa69b79){CmContactEvents[_0xfedb('0x4')](_0x1f82d1+':'+_0x22eab8['id'],_0x22eab8);CmContactEvents[_0xfedb('0x4')](_0x1f82d1,_0x22eab8);_0xa69b79(null);};}for(var e in events){if(events[_0xfedb('0x5')](e)){var event=events[e];CmContact[_0xfedb('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x6291=['emit','hook','exports','events','../../mysqldb','save','remove'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x6291,0x18b));var _0x1629=function(_0x4c4d07,_0x48512b){_0x4c4d07=_0x4c4d07-0x0;var _0x278851=_0x6291[_0x4c4d07];return _0x278851;};'use strict';var EventEmitter=require(_0x1629('0x0'));var CmContact=require(_0x1629('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1629('0x2'),'afterUpdate':'update','afterDestroy':_0x1629('0x3')};function emitEvent(_0x5918e6){return function(_0x3694e7,_0x367021,_0x2bc2b1){CmContactEvents[_0x1629('0x4')](_0x5918e6+':'+_0x3694e7['id'],_0x3694e7);CmContactEvents[_0x1629('0x4')](_0x5918e6,_0x3694e7);_0x2bc2b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x1629('0x5')](e,emitEvent(event));}}module[_0x1629('0x6')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index d123f07..bd075df 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33af=['api','request-promise','path','rimraf','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','mobile','fax','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','timezones','utcOffset','minutes','then','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','Campaign','ret','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','findAll','cmContact,\x20%s,\x20%s','message','BlackLists','CmHopperBlack','List\x20not\x20found','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util'];(function(_0x5812af,_0x51e708){var _0x137dc0=function(_0x1023f3){while(--_0x1023f3){_0x5812af['push'](_0x5812af['shift']());}};_0x137dc0(++_0x51e708);}(_0x33af,0x87));var _0xf33a=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x33af[_0x4eec9b];return _0x2e3849;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf33a('0x2'));var fs=require('fs');var path=require(_0xf33a('0x3'));var rimraf=require(_0xf33a('0x4'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0xf33a('0x5'));module[_0xf33a('0x6')]=function(_0x81fa27,_0x1f3375){return _0x81fa27[_0xf33a('0x7')](_0xf33a('0x8'),attributes,{'tableName':_0xf33a('0x9'),'paranoid':!![],'indexes':[{'name':_0xf33a('0xa'),'fields':[_0xf33a('0xa')]},{'name':'fti_cm_contacts','fields':[_0xf33a('0xb'),'lastName','phone',_0xf33a('0xc'),_0xf33a('0xd'),'email'],'type':_0xf33a('0xe')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xf33a('0xf'),'hooks':{'afterCreate':function(_0x4554da,_0x2fb02e,_0x2bedb6){var _0x5c5783=_0x81fa27[_0xf33a('0x10')];var _0x58d74e=_0x4554da[_0xf33a('0x11')]({'plain':!![]});function _0x507912(){return function(_0x174655){logger[_0xf33a('0x12')](_0xf33a('0x13'),_0xf33a('0x14'),util[_0xf33a('0x15')](_0x174655,{'showHidden':![],'depth':null}));};}function _0x1a96e1(_0x393bc1,_0x38fb6d){var _0xe3f888=_0x38fb6d['scheduledat']?_0x38fb6d[_0xf33a('0x16')]:moment()[_0xf33a('0x17')](_0xf33a('0x18'));return new BPromise(function(_0x5d9768,_0x1e317){if(_[_0xf33a('0x19')](_0x38fb6d[_0xf33a('0x1a')])){_0x5d9768({'ret':_0xe3f888});}else{_0x5c5783[_0xf33a('0x1b')][_0xf33a('0x1c')]({'where':{'id':_0x393bc1['id']}})['then'](function(_0x183b0c){if(!_[_0xf33a('0x19')](_0x183b0c)){var _0x20af6d=_0x183b0c[_0xf33a('0x1a')];if(!_['isNil'](_0x20af6d)){var _0x4c390a=shared[_0xf33a('0x1d')];var _0x3ad1b3=_0x4c390a[_0x20af6d];var _0x4ebc67=_0x4c390a[_0x38fb6d['dialTimezone']];if(!_[_0xf33a('0x19')](_0x3ad1b3)&&!_[_0xf33a('0x19')](_0x4ebc67)){var _0x2229fd=_0x3ad1b3[_0xf33a('0x1e')]-_0x4ebc67[_0xf33a('0x1e')];_0xe3f888=_0x38fb6d[_0xf33a('0x16')]?_0x38fb6d[_0xf33a('0x16')]:moment();var _0x5b440d=moment(_0xe3f888)['add'](_0x2229fd,_0xf33a('0x1f'));_0x5d9768({'ret':_0x5b440d[_0xf33a('0x17')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x5d9768({'ret':_0xe3f888});}else _0x5d9768({'ret':_0xe3f888});}else{_0x5d9768({'ret':_0xe3f888});}});}});return 0xa;}var _0x5cecc7=function(_0x5e19b6){return new BPromise(function(_0x4d4c4e,_0x4fe1fc){_0x1a96e1(_0x5e19b6,_0x58d74e)[_0xf33a('0x20')](function(_0x48ce89){_0x58d74e[_0xf33a('0x16')]=_0x48ce89['ret'];_0x5c5783[_0xf33a('0x21')][_0xf33a('0x1c')]({'where':{'phone':_0x58d74e[_0xf33a('0xa')],'VoiceQueueId':_0x5e19b6['id']}})[_0xf33a('0x20')](function(_0x4647fd){if(!_[_0xf33a('0x19')](_0x4647fd)){throw new Error(_0xf33a('0x22')+_0x58d74e[_0xf33a('0xa')]+_0xf33a('0x23')+_0x5e19b6['id']);}return _0x5c5783['CmHopper'][_0xf33a('0x24')]({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e[_0xf33a('0x25')],'priority':_0x58d74e[_0xf33a('0x26')]?_0x58d74e[_0xf33a('0x26')]:0x2,'scheduledat':_0x58d74e[_0xf33a('0x16')]?_0x58d74e[_0xf33a('0x16')]:moment()['format'](_0xf33a('0x18')),'callback':_0x58d74e[_0xf33a('0x27')]?!![]:![],'callbackuniqueid':_0x58d74e[_0xf33a('0x27')]?_0x58d74e[_0xf33a('0x27')]:undefined,'callbackat':_0x58d74e['callbackUniqueid']?moment()[_0xf33a('0x17')](_0xf33a('0x18')):undefined,'VoiceQueueId':_0x5e19b6['id']});})['catch'](function(_0x290b43){_0x4fe1fc(_0x290b43);});});});};var _0x26e31a=function(_0x15c1ea){return new BPromise(function(_0x2a5078,_0x32b666){_0x1a96e1(_0x15c1ea,_0x58d74e)[_0xf33a('0x20')](function(_0x191552){_0x58d74e[_0xf33a('0x16')]=_0x191552['ret'];_0x5c5783['CmHopper'][_0xf33a('0x1c')]({'where':{'phone':_0x58d74e[_0xf33a('0xa')],'VoiceQueueId':_0x15c1ea['id']}})[_0xf33a('0x20')](function(_0x125a04){if(!_[_0xf33a('0x19')](_0x125a04)){throw new Error(_0xf33a('0x22')+_0x58d74e[_0xf33a('0xa')]+_0xf33a('0x28')+_0x15c1ea['id']);}return _0x5c5783[_0xf33a('0x29')][_0xf33a('0x1c')]({'where':{'calleridnum':_0x58d74e[_0xf33a('0xa')],'VoiceQueueId':_0x15c1ea['id']}});})[_0xf33a('0x20')](function(_0x7f6e7a){if(!_[_0xf33a('0x19')](_0x7f6e7a)){throw new Error(_0xf33a('0x2a')+_0x58d74e[_0xf33a('0xa')]+_0xf33a('0x2b')+_0x15c1ea['id']);}return _0x5c5783[_0xf33a('0x21')][_0xf33a('0x24')]({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e['ListId'],'priority':_0x58d74e[_0xf33a('0x26')]?_0x58d74e[_0xf33a('0x26')]:0x2,'scheduledat':_0x58d74e['scheduledat']?_0x58d74e[_0xf33a('0x16')]:moment()[_0xf33a('0x17')](_0xf33a('0x18')),'callback':_0x58d74e[_0xf33a('0x27')]?!![]:![],'callbackuniqueid':_0x58d74e[_0xf33a('0x27')]?_0x58d74e[_0xf33a('0x27')]:undefined,'callbackat':_0x58d74e[_0xf33a('0x27')]?moment()[_0xf33a('0x17')](_0xf33a('0x18')):undefined,'VoiceQueueId':_0x15c1ea['id']});})[_0xf33a('0x2c')](function(_0x1a3a93){_0x32b666(_0x1a3a93);});});});};function _0x47e369(){return function(_0x691896){logger['error'](_0xf33a('0x13'),_0xf33a('0x14'),util[_0xf33a('0x15')](_0x691896,{'showHidden':![],'depth':null}));};}function _0x335296(_0x4a3ed7,_0x5871d7){var _0x22b861=_0x5871d7[_0xf33a('0x16')]?_0x5871d7[_0xf33a('0x16')]:moment()[_0xf33a('0x17')](_0xf33a('0x18'));return new BPromise(function(_0x288cf6,_0x40603a){if(_[_0xf33a('0x19')](_0x5871d7['dialTimezone'])){_0x288cf6({'ret':_0x22b861});}else{_0x5c5783[_0xf33a('0x2d')][_0xf33a('0x1c')]({'where':{'id':_0x4a3ed7['id']}})[_0xf33a('0x20')](function(_0x5f0489){if(!_[_0xf33a('0x19')](_0x5f0489)){var _0x5dd385=_0x5f0489['dialTimezone'];if(!_[_0xf33a('0x19')](_0x5dd385)){var _0x2a16c7=shared[_0xf33a('0x1d')];var _0x38dc0d=_0x2a16c7[_0x5dd385];var _0x3b33f4=_0x2a16c7[_0x5871d7[_0xf33a('0x1a')]];if(!_['isNil'](_0x38dc0d)&&!_[_0xf33a('0x19')](_0x3b33f4)){var _0x46e1eb=_0x38dc0d[_0xf33a('0x1e')]-_0x3b33f4[_0xf33a('0x1e')];_0x22b861=_0x5871d7['scheduledat']?_0x5871d7[_0xf33a('0x16')]:moment();var _0x21fc97=moment(_0x22b861)['add'](_0x46e1eb,_0xf33a('0x1f'));_0x288cf6({'ret':_0x21fc97['format'](_0xf33a('0x18'))});}else _0x288cf6({'ret':_0x22b861});}else _0x288cf6({'ret':_0x22b861});}else{_0x288cf6({'ret':_0x22b861});}});}});return 0xa;}var _0x540134=function(_0x549d5a){return new BPromise(function(_0x1f21ff,_0x20a3bf){_0x335296(_0x549d5a,_0x58d74e)['then'](function(_0x893d80){_0x58d74e['scheduledat']=_0x893d80[_0xf33a('0x2e')];_0x5c5783[_0xf33a('0x21')][_0xf33a('0x1c')]({'where':{'phone':_0x58d74e[_0xf33a('0xa')],'CampaignId':_0x549d5a['id']}})['then'](function(_0x53fe64){if(!_[_0xf33a('0x19')](_0x53fe64)){throw new Error(_0xf33a('0x22')+_0x58d74e[_0xf33a('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x549d5a['id']);}return _0x5c5783['CmHopper']['create']({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e[_0xf33a('0x25')],'priority':_0x58d74e['priority']?_0x58d74e['priority']:0x2,'scheduledat':_0x58d74e[_0xf33a('0x16')]?_0x58d74e[_0xf33a('0x16')]:moment()[_0xf33a('0x17')](_0xf33a('0x18')),'callback':_0x58d74e[_0xf33a('0x27')]?!![]:![],'callbackuniqueid':_0x58d74e[_0xf33a('0x27')]?_0x58d74e[_0xf33a('0x27')]:undefined,'callbackat':_0x58d74e['callbackUniqueid']?moment()[_0xf33a('0x17')](_0xf33a('0x18')):undefined,'CampaignId':_0x549d5a['id']});})[_0xf33a('0x2c')](function(_0x451d38){_0x20a3bf(_0x451d38);});});});};var _0x53051a=function(_0x4e5fcf){return new BPromise(function(_0x2c0904,_0x51e15d){_0x335296(_0x4e5fcf,_0x58d74e)[_0xf33a('0x20')](function(_0x3d5c40){_0x58d74e[_0xf33a('0x16')]=_0x3d5c40[_0xf33a('0x2e')];_0x5c5783[_0xf33a('0x21')]['findOne']({'where':{'phone':_0x58d74e[_0xf33a('0xa')],'CampaignId':_0x4e5fcf['id']}})[_0xf33a('0x20')](function(_0x26584f){if(!_[_0xf33a('0x19')](_0x26584f)){throw new Error(_0xf33a('0x22')+_0x58d74e[_0xf33a('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4e5fcf['id']);}return _0x5c5783[_0xf33a('0x29')]['findOne']({'where':{'calleridnum':_0x58d74e['phone'],'CampaignId':_0x4e5fcf['id']}});})[_0xf33a('0x20')](function(_0x5bab6c){if(!_['isNil'](_0x5bab6c)){throw new Error(_0xf33a('0x2a')+_0x58d74e['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x4e5fcf['id']);}return _0x5c5783[_0xf33a('0x21')][_0xf33a('0x24')]({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e[_0xf33a('0x25')],'priority':_0x58d74e[_0xf33a('0x26')]?_0x58d74e[_0xf33a('0x26')]:0x2,'scheduledat':_0x58d74e[_0xf33a('0x16')]?_0x58d74e['scheduledat']:moment()[_0xf33a('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x58d74e[_0xf33a('0x27')]?!![]:![],'callbackuniqueid':_0x58d74e[_0xf33a('0x27')]?_0x58d74e[_0xf33a('0x27')]:undefined,'callbackat':_0x58d74e[_0xf33a('0x27')]?moment()[_0xf33a('0x17')](_0xf33a('0x18')):undefined,'CampaignId':_0x4e5fcf['id']});})[_0xf33a('0x2c')](function(_0x53763c){_0x51e15d(_0x53763c);});});});};if(_0x58d74e[_0xf33a('0x25')]){_0x5c5783[_0xf33a('0x1b')]['findAll']({'where':{'type':_0xf33a('0x2f')},'attributes':['id',_0xf33a('0x30'),'dialTimezone'],'include':[{'model':_0x5c5783[_0xf33a('0x31')],'as':_0xf33a('0x32'),'where':{'id':_0x58d74e['ListId']}}]})[_0xf33a('0x20')](function(_0x4e2767){if(_0x4e2767){var _0x1bc010=[];for(var _0x157a61=0x0,_0x58ae9b;_0x157a61<_0x4e2767[_0xf33a('0x33')];_0x157a61+=0x1){_0x58ae9b=_0x4e2767[_0x157a61][_0xf33a('0x11')]({'plain':!![]});switch(_0x58ae9b[_0xf33a('0x30')]){case _0xf33a('0x34'):_0x26e31a(_0x58ae9b)['catch'](_0x507912());break;case _0xf33a('0x35'):_0x5cecc7(_0x58ae9b)[_0xf33a('0x2c')](_0x507912());break;default:_0x335296(_0x58ae9b,_0x58d74e)[_0xf33a('0x20')](function(_0x6461a7){_0x58d74e[_0xf33a('0x16')]=_0x6461a7[_0xf33a('0x2e')];_0x5c5783[_0xf33a('0x21')]['create']({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e[_0xf33a('0x25')],'scheduledat':_0x58d74e[_0xf33a('0x16')]?_0x58d74e[_0xf33a('0x16')]:moment()[_0xf33a('0x17')](_0xf33a('0x18')),'priority':_0x58d74e[_0xf33a('0x26')]?_0x58d74e[_0xf33a('0x26')]:0x2,'callback':_0x58d74e[_0xf33a('0x27')]?!![]:![],'callbackuniqueid':_0x58d74e[_0xf33a('0x27')]?_0x58d74e[_0xf33a('0x27')]:undefined,'callbackat':_0x58d74e[_0xf33a('0x27')]?moment()[_0xf33a('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x58ae9b['id']})[_0xf33a('0x2c')](_0x507912());});}}}})[_0xf33a('0x20')](function(){return _0x5c5783[_0xf33a('0x1b')][_0xf33a('0x36')]({'where':{'type':_0xf33a('0x2f')},'attributes':['id'],'include':[{'model':_0x5c5783[_0xf33a('0x31')],'as':'BlackLists','where':{'id':_0x58d74e[_0xf33a('0x25')]}}]})[_0xf33a('0x20')](function(_0x447f3a){if(_0x447f3a){var _0x182017=[];for(var _0xd03d10=0x0,_0xb43d52;_0xd03d10<_0x447f3a[_0xf33a('0x33')];_0xd03d10+=0x1){_0xb43d52=_0x447f3a[_0xd03d10][_0xf33a('0x11')]({'plain':!![]});_0x5c5783['CmHopperBlack'][_0xf33a('0x24')]({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e['ListId'],'VoiceQueueId':_0xb43d52['id']})[_0xf33a('0x2c')](function(_0x36e2c2){logger['error'](_0xf33a('0x37'),_0xf33a('0x14'),_0x36e2c2[_0xf33a('0x38')]);});}}});})[_0xf33a('0x20')](function(){return _0x5c5783[_0xf33a('0x2d')]['findAll']({'attributes':['id',_0xf33a('0x30'),_0xf33a('0x1a')],'include':[{'model':_0x5c5783['CmList'],'as':_0xf33a('0x32'),'where':{'id':_0x58d74e[_0xf33a('0x25')]}}]})[_0xf33a('0x20')](function(_0x189e01){if(_0x189e01){var _0xbb675d=[];for(var _0x3603da=0x0,_0x245290;_0x3603da<_0x189e01[_0xf33a('0x33')];_0x3603da+=0x1){_0x245290=_0x189e01[_0x3603da][_0xf33a('0x11')]({'plain':!![]});switch(_0x245290[_0xf33a('0x30')]){case'always':_0x53051a(_0x245290)[_0xf33a('0x2c')](_0x47e369());break;case _0xf33a('0x35'):_0x540134(_0x245290)['catch'](_0x47e369());break;default:_0x5c5783[_0xf33a('0x21')][_0xf33a('0x24')]({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e[_0xf33a('0x25')],'scheduledat':_0x58d74e[_0xf33a('0x16')]?_0x58d74e[_0xf33a('0x16')]:moment()[_0xf33a('0x17')](_0xf33a('0x18')),'priority':_0x58d74e[_0xf33a('0x26')]?_0x58d74e[_0xf33a('0x26')]:0x2,'callback':_0x58d74e[_0xf33a('0x27')]?!![]:![],'callbackuniqueid':_0x58d74e[_0xf33a('0x27')]?_0x58d74e['callbackUniqueid']:undefined,'callbackat':_0x58d74e[_0xf33a('0x27')]?moment()[_0xf33a('0x17')](_0xf33a('0x18')):undefined,'CampaignId':_0x245290['id']})[_0xf33a('0x2c')](_0x47e369());}}}});})[_0xf33a('0x20')](function(){return _0x5c5783[_0xf33a('0x2d')][_0xf33a('0x36')]({'attributes':['id'],'include':[{'model':_0x5c5783['CmList'],'as':_0xf33a('0x39'),'where':{'id':_0x58d74e['ListId']}}]})['then'](function(_0x1688c3){if(_0x1688c3){var _0x29b1f9=[];for(var _0x2ee48b=0x0,_0x166dae;_0x2ee48b<_0x1688c3[_0xf33a('0x33')];_0x2ee48b+=0x1){_0x166dae=_0x1688c3[_0x2ee48b][_0xf33a('0x11')]({'plain':!![]});_0x5c5783[_0xf33a('0x3a')][_0xf33a('0x24')]({'phone':_0x58d74e[_0xf33a('0xa')],'ContactId':_0x58d74e['id'],'ListId':_0x58d74e[_0xf33a('0x25')],'CampaignId':_0x166dae['id']})[_0xf33a('0x2c')](function(_0x420ff0){logger[_0xf33a('0x12')](_0xf33a('0x37'),_0xf33a('0x14'),_0x420ff0[_0xf33a('0x38')]);});}}});})[_0xf33a('0x20')](function(){_0x2bedb6();})[_0xf33a('0x2c')](function(_0x3efb6e){logger[_0xf33a('0x12')]('cmContact,\x20%s,\x20%s',_0xf33a('0x14'),_0x3efb6e[_0xf33a('0x38')]);_0x2bedb6(_0x3efb6e);});}else{_0x2bedb6(new Error(_0xf33a('0x3b')));}},'afterDestroy':function(_0x486835,_0x4bd57a,_0x55cdf7){var _0x16d3ee=_0x81fa27[_0xf33a('0x10')];var _0x4c8ce1=_0x486835[_0xf33a('0x11')]({'plain':!![]});return _0x16d3ee[_0xf33a('0x21')][_0xf33a('0x36')]({'raw':!![],'where':{'ListId':_0x4c8ce1[_0xf33a('0x25')],'ContactId':_0x4c8ce1['id']}})[_0xf33a('0x20')](function(_0x1b7d44){if(!_['isEmpty'](_0x1b7d44)){var _0x30634e=[];for(var _0x316330=0x0;_0x316330<_0x1b7d44[_0xf33a('0x33')];_0x316330+=0x1){var _0x3306cf=_0x16d3ee['CmHopper'][_0xf33a('0x3c')]({'where':{'ListId':_0x1b7d44[_0x316330]['ListId'],'ContactId':_0x1b7d44[_0x316330][_0xf33a('0x3d')],'VoiceQueueId':_0x1b7d44[_0x316330][_0xf33a('0x3e')],'CampaignId':_0x1b7d44[_0x316330][_0xf33a('0x3f')]}});_0x30634e[_0xf33a('0x40')](_0x3306cf);}return BPromise['all'](_0x30634e);}})['then'](function(_0x4386e7){logger[_0xf33a('0x41')](_0xf33a('0x42'),util[_0xf33a('0x15')](_0x4386e7,{'showHidden':![],'depth':null}));_0x55cdf7();})[_0xf33a('0x2c')](function(_0x23e8fa){logger['error'](_0xf33a('0x43'),util[_0xf33a('0x15')](_0x23e8fa,{'showHidden':![],'depth':null}));_0x55cdf7(_0x23e8fa);});}}});}; \ No newline at end of file +var _0xd09b=['message','cmContact,\x20%s,\x20%s','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','then','timezones','dialTimezone','utcOffset','add','minutes','ret','CmHopper','findOne','create','ListId','priority','callbackUniqueid','cmContact,\x20afterCreate\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','onlyIfOpen','BlackLists','CmHopperBlack'];(function(_0x238c67,_0x4c409e){var _0x51d179=function(_0x24ab46){while(--_0x24ab46){_0x238c67['push'](_0x238c67['shift']());}};_0x51d179(++_0x4c409e);}(_0xd09b,0xee));var _0xbd09=function(_0xe81b9e,_0x731125){_0xe81b9e=_0xe81b9e-0x0;var _0x12ca0b=_0xd09b[_0xe81b9e];return _0x12ca0b;};'use strict';var _=require(_0xbd09('0x0'));var util=require(_0xbd09('0x1'));var logger=require(_0xbd09('0x2'))(_0xbd09('0x3'));var moment=require(_0xbd09('0x4'));var BPromise=require(_0xbd09('0x5'));var rp=require(_0xbd09('0x6'));var fs=require('fs');var path=require(_0xbd09('0x7'));var rimraf=require(_0xbd09('0x8'));var config=require(_0xbd09('0x9'));var shared=require(_0xbd09('0xa'));var attributes=require(_0xbd09('0xb'));module['exports']=function(_0x52e3ce,_0x25127b){return _0x52e3ce[_0xbd09('0xc')](_0xbd09('0xd'),attributes,{'tableName':_0xbd09('0xe'),'paranoid':!![],'indexes':[{'name':_0xbd09('0xf'),'fields':[_0xbd09('0xf')]},{'name':_0xbd09('0x10'),'fields':[_0xbd09('0x11'),_0xbd09('0x12'),_0xbd09('0xf'),_0xbd09('0x13'),_0xbd09('0x14'),_0xbd09('0x15')],'type':_0xbd09('0x16')}],'timestamps':!![],'charset':_0xbd09('0x17'),'collate':_0xbd09('0x18'),'hooks':{'afterCreate':function(_0x1ad257,_0x8e7d86,_0x3ac625){var _0x9006c6=_0x52e3ce[_0xbd09('0x19')];var _0x78389b=_0x1ad257[_0xbd09('0x1a')]({'plain':!![]});function _0x460710(){return function(_0x1279e4){logger[_0xbd09('0x1b')](_0xbd09('0x1c'),_0xbd09('0x1d'),util['inspect'](_0x1279e4,{'showHidden':![],'depth':null}));};}function _0x563820(_0x88af2d,_0x5c18e2){var _0x1766c3=_0x5c18e2[_0xbd09('0x1e')]?_0x5c18e2[_0xbd09('0x1e')]:moment()[_0xbd09('0x1f')](_0xbd09('0x20'));return new BPromise(function(_0x536260,_0x9e0f88){if(_[_0xbd09('0x21')](_0x5c18e2['dialTimezone'])){_0x536260({'ret':_0x1766c3});}else{_0x9006c6[_0xbd09('0x22')]['findOne']({'where':{'id':_0x88af2d['id']}})[_0xbd09('0x23')](function(_0x2b334c){if(!_[_0xbd09('0x21')](_0x2b334c)){var _0x26ff2e=_0x2b334c['dialTimezone'];if(!_['isNil'](_0x26ff2e)){var _0x20aef9=shared[_0xbd09('0x24')];var _0x4509ef=_0x20aef9[_0x26ff2e];var _0x3cdb1f=_0x20aef9[_0x5c18e2[_0xbd09('0x25')]];if(!_[_0xbd09('0x21')](_0x4509ef)&&!_[_0xbd09('0x21')](_0x3cdb1f)){var _0x59bc06=_0x4509ef[_0xbd09('0x26')]-_0x3cdb1f[_0xbd09('0x26')];_0x1766c3=_0x5c18e2[_0xbd09('0x1e')]?_0x5c18e2[_0xbd09('0x1e')]:moment();var _0x2e9d6d=moment(_0x1766c3)[_0xbd09('0x27')](_0x59bc06,_0xbd09('0x28'));_0x536260({'ret':_0x2e9d6d[_0xbd09('0x1f')](_0xbd09('0x20'))});}else _0x536260({'ret':_0x1766c3});}else _0x536260({'ret':_0x1766c3});}else{_0x536260({'ret':_0x1766c3});}});}});return 0xa;}var _0x1bc609=function(_0x286980){return new BPromise(function(_0x192591,_0x8b51af){_0x563820(_0x286980,_0x78389b)[_0xbd09('0x23')](function(_0x343546){_0x78389b[_0xbd09('0x1e')]=_0x343546[_0xbd09('0x29')];_0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2b')]({'where':{'phone':_0x78389b['phone'],'VoiceQueueId':_0x286980['id']}})['then'](function(_0x243e37){if(!_[_0xbd09('0x21')](_0x243e37)){throw new Error('cmContact,\x20afterCreate\x20'+_0x78389b[_0xbd09('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x286980['id']);}return _0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2c')]({'phone':_0x78389b[_0xbd09('0xf')],'ContactId':_0x78389b['id'],'ListId':_0x78389b[_0xbd09('0x2d')],'priority':_0x78389b[_0xbd09('0x2e')]?_0x78389b[_0xbd09('0x2e')]:0x2,'scheduledat':_0x78389b[_0xbd09('0x1e')]?_0x78389b[_0xbd09('0x1e')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x78389b[_0xbd09('0x2f')]?!![]:![],'callbackuniqueid':_0x78389b[_0xbd09('0x2f')]?_0x78389b[_0xbd09('0x2f')]:undefined,'callbackat':_0x78389b[_0xbd09('0x2f')]?moment()[_0xbd09('0x1f')](_0xbd09('0x20')):undefined,'VoiceQueueId':_0x286980['id']});})['catch'](function(_0x1f8148){_0x8b51af(_0x1f8148);});});});};var _0x415212=function(_0x4d3622){return new BPromise(function(_0x1c4d4b,_0x58df8f){_0x563820(_0x4d3622,_0x78389b)[_0xbd09('0x23')](function(_0x4609dd){_0x78389b[_0xbd09('0x1e')]=_0x4609dd['ret'];_0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2b')]({'where':{'phone':_0x78389b[_0xbd09('0xf')],'VoiceQueueId':_0x4d3622['id']}})['then'](function(_0x40c1a0){if(!_[_0xbd09('0x21')](_0x40c1a0)){throw new Error(_0xbd09('0x30')+_0x78389b['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4d3622['id']);}return _0x9006c6['CmHopperFinal'][_0xbd09('0x2b')]({'where':{'calleridnum':_0x78389b[_0xbd09('0xf')],'VoiceQueueId':_0x4d3622['id']}});})[_0xbd09('0x23')](function(_0x5d8e60){if(!_[_0xbd09('0x21')](_0x5d8e60)){throw new Error(_0xbd09('0x31')+_0x78389b['phone']+_0xbd09('0x32')+_0x4d3622['id']);}return _0x9006c6['CmHopper'][_0xbd09('0x2c')]({'phone':_0x78389b[_0xbd09('0xf')],'ContactId':_0x78389b['id'],'ListId':_0x78389b[_0xbd09('0x2d')],'priority':_0x78389b[_0xbd09('0x2e')]?_0x78389b[_0xbd09('0x2e')]:0x2,'scheduledat':_0x78389b['scheduledat']?_0x78389b[_0xbd09('0x1e')]:moment()[_0xbd09('0x1f')](_0xbd09('0x20')),'callback':_0x78389b[_0xbd09('0x2f')]?!![]:![],'callbackuniqueid':_0x78389b['callbackUniqueid']?_0x78389b[_0xbd09('0x2f')]:undefined,'callbackat':_0x78389b['callbackUniqueid']?moment()[_0xbd09('0x1f')](_0xbd09('0x20')):undefined,'VoiceQueueId':_0x4d3622['id']});})[_0xbd09('0x33')](function(_0x3024){_0x58df8f(_0x3024);});});});};function _0x49e959(){return function(_0x5d9a94){logger[_0xbd09('0x1b')]('cmContact',_0xbd09('0x1d'),util[_0xbd09('0x34')](_0x5d9a94,{'showHidden':![],'depth':null}));};}function _0x3c53ff(_0x1d1ee9,_0x1650c9){var _0x4ac7e8=_0x1650c9[_0xbd09('0x1e')]?_0x1650c9[_0xbd09('0x1e')]:moment()['format'](_0xbd09('0x20'));return new BPromise(function(_0x21374c,_0x303cec){if(_[_0xbd09('0x21')](_0x1650c9[_0xbd09('0x25')])){_0x21374c({'ret':_0x4ac7e8});}else{_0x9006c6[_0xbd09('0x35')][_0xbd09('0x2b')]({'where':{'id':_0x1d1ee9['id']}})[_0xbd09('0x23')](function(_0x409261){if(!_['isNil'](_0x409261)){var _0x4b35a8=_0x409261['dialTimezone'];if(!_[_0xbd09('0x21')](_0x4b35a8)){var _0x132eee=shared[_0xbd09('0x24')];var _0xd0e6b0=_0x132eee[_0x4b35a8];var _0x28b441=_0x132eee[_0x1650c9[_0xbd09('0x25')]];if(!_['isNil'](_0xd0e6b0)&&!_[_0xbd09('0x21')](_0x28b441)){var _0x174dd9=_0xd0e6b0['utcOffset']-_0x28b441[_0xbd09('0x26')];_0x4ac7e8=_0x1650c9[_0xbd09('0x1e')]?_0x1650c9[_0xbd09('0x1e')]:moment();var _0x394772=moment(_0x4ac7e8)[_0xbd09('0x27')](_0x174dd9,_0xbd09('0x28'));_0x21374c({'ret':_0x394772[_0xbd09('0x1f')](_0xbd09('0x20'))});}else _0x21374c({'ret':_0x4ac7e8});}else _0x21374c({'ret':_0x4ac7e8});}else{_0x21374c({'ret':_0x4ac7e8});}});}});return 0xa;}var _0x194e7e=function(_0x3ab4a4){return new BPromise(function(_0x22d543,_0x449573){_0x3c53ff(_0x3ab4a4,_0x78389b)['then'](function(_0x5422f5){_0x78389b[_0xbd09('0x1e')]=_0x5422f5[_0xbd09('0x29')];_0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2b')]({'where':{'phone':_0x78389b['phone'],'CampaignId':_0x3ab4a4['id']}})[_0xbd09('0x23')](function(_0x534ed5){if(!_['isNil'](_0x534ed5)){throw new Error(_0xbd09('0x30')+_0x78389b['phone']+_0xbd09('0x36')+_0x3ab4a4['id']);}return _0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2c')]({'phone':_0x78389b['phone'],'ContactId':_0x78389b['id'],'ListId':_0x78389b[_0xbd09('0x2d')],'priority':_0x78389b[_0xbd09('0x2e')]?_0x78389b['priority']:0x2,'scheduledat':_0x78389b['scheduledat']?_0x78389b[_0xbd09('0x1e')]:moment()[_0xbd09('0x1f')](_0xbd09('0x20')),'callback':_0x78389b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x78389b['callbackUniqueid']?_0x78389b[_0xbd09('0x2f')]:undefined,'callbackat':_0x78389b[_0xbd09('0x2f')]?moment()[_0xbd09('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3ab4a4['id']});})[_0xbd09('0x33')](function(_0x57ef11){_0x449573(_0x57ef11);});});});};var _0x5b0f39=function(_0x495a43){return new BPromise(function(_0x1764ee,_0x1ed895){_0x3c53ff(_0x495a43,_0x78389b)[_0xbd09('0x23')](function(_0x9643f1){_0x78389b[_0xbd09('0x1e')]=_0x9643f1['ret'];_0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2b')]({'where':{'phone':_0x78389b[_0xbd09('0xf')],'CampaignId':_0x495a43['id']}})['then'](function(_0x34061c){if(!_[_0xbd09('0x21')](_0x34061c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x78389b[_0xbd09('0xf')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x495a43['id']);}return _0x9006c6[_0xbd09('0x37')][_0xbd09('0x2b')]({'where':{'calleridnum':_0x78389b[_0xbd09('0xf')],'CampaignId':_0x495a43['id']}});})[_0xbd09('0x23')](function(_0x31d1cc){if(!_[_0xbd09('0x21')](_0x31d1cc)){throw new Error(_0xbd09('0x31')+_0x78389b[_0xbd09('0xf')]+_0xbd09('0x38')+_0x495a43['id']);}return _0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2c')]({'phone':_0x78389b['phone'],'ContactId':_0x78389b['id'],'ListId':_0x78389b[_0xbd09('0x2d')],'priority':_0x78389b[_0xbd09('0x2e')]?_0x78389b['priority']:0x2,'scheduledat':_0x78389b[_0xbd09('0x1e')]?_0x78389b[_0xbd09('0x1e')]:moment()[_0xbd09('0x1f')](_0xbd09('0x20')),'callback':_0x78389b[_0xbd09('0x2f')]?!![]:![],'callbackuniqueid':_0x78389b['callbackUniqueid']?_0x78389b[_0xbd09('0x2f')]:undefined,'callbackat':_0x78389b[_0xbd09('0x2f')]?moment()['format'](_0xbd09('0x20')):undefined,'CampaignId':_0x495a43['id']});})[_0xbd09('0x33')](function(_0x5fa904){_0x1ed895(_0x5fa904);});});});};if(_0x78389b[_0xbd09('0x2d')]){_0x9006c6[_0xbd09('0x22')][_0xbd09('0x39')]({'where':{'type':_0xbd09('0x3a')},'attributes':['id',_0xbd09('0x3b'),_0xbd09('0x25')],'include':[{'model':_0x9006c6[_0xbd09('0x3c')],'as':_0xbd09('0x3d'),'where':{'id':_0x78389b[_0xbd09('0x2d')]}}]})[_0xbd09('0x23')](function(_0x200c26){if(_0x200c26){var _0x5c0ffe=[];for(var _0x340da5=0x0,_0x3b9479;_0x340da5<_0x200c26[_0xbd09('0x3e')];_0x340da5+=0x1){_0x3b9479=_0x200c26[_0x340da5][_0xbd09('0x1a')]({'plain':!![]});switch(_0x3b9479['dialCheckDuplicateType']){case'always':_0x415212(_0x3b9479)['catch'](_0x460710());break;case _0xbd09('0x3f'):_0x1bc609(_0x3b9479)[_0xbd09('0x33')](_0x460710());break;default:_0x3c53ff(_0x3b9479,_0x78389b)[_0xbd09('0x23')](function(_0x41df47){_0x78389b[_0xbd09('0x1e')]=_0x41df47['ret'];_0x9006c6['CmHopper'][_0xbd09('0x2c')]({'phone':_0x78389b[_0xbd09('0xf')],'ContactId':_0x78389b['id'],'ListId':_0x78389b['ListId'],'scheduledat':_0x78389b['scheduledat']?_0x78389b['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x78389b[_0xbd09('0x2e')]?_0x78389b[_0xbd09('0x2e')]:0x2,'callback':_0x78389b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x78389b[_0xbd09('0x2f')]?_0x78389b[_0xbd09('0x2f')]:undefined,'callbackat':_0x78389b['callbackUniqueid']?moment()[_0xbd09('0x1f')](_0xbd09('0x20')):undefined,'VoiceQueueId':_0x3b9479['id']})[_0xbd09('0x33')](_0x460710());});}}}})[_0xbd09('0x23')](function(){return _0x9006c6['VoiceQueue']['findAll']({'where':{'type':_0xbd09('0x3a')},'attributes':['id'],'include':[{'model':_0x9006c6[_0xbd09('0x3c')],'as':_0xbd09('0x40'),'where':{'id':_0x78389b[_0xbd09('0x2d')]}}]})[_0xbd09('0x23')](function(_0x2892ad){if(_0x2892ad){var _0x3b4e01=[];for(var _0x3bfb29=0x0,_0x483889;_0x3bfb29<_0x2892ad[_0xbd09('0x3e')];_0x3bfb29+=0x1){_0x483889=_0x2892ad[_0x3bfb29][_0xbd09('0x1a')]({'plain':!![]});_0x9006c6[_0xbd09('0x41')]['create']({'phone':_0x78389b[_0xbd09('0xf')],'ContactId':_0x78389b['id'],'ListId':_0x78389b[_0xbd09('0x2d')],'VoiceQueueId':_0x483889['id']})[_0xbd09('0x33')](function(_0x5a4f36){logger[_0xbd09('0x1b')]('cmContact,\x20%s,\x20%s','afterCreate',_0x5a4f36[_0xbd09('0x42')]);});}}});})[_0xbd09('0x23')](function(){return _0x9006c6[_0xbd09('0x35')][_0xbd09('0x39')]({'attributes':['id',_0xbd09('0x3b'),_0xbd09('0x25')],'include':[{'model':_0x9006c6['CmList'],'as':_0xbd09('0x3d'),'where':{'id':_0x78389b['ListId']}}]})[_0xbd09('0x23')](function(_0x3ee864){if(_0x3ee864){var _0x8a0622=[];for(var _0x82b437=0x0,_0xe9a13a;_0x82b437<_0x3ee864[_0xbd09('0x3e')];_0x82b437+=0x1){_0xe9a13a=_0x3ee864[_0x82b437][_0xbd09('0x1a')]({'plain':!![]});switch(_0xe9a13a['dialCheckDuplicateType']){case'always':_0x5b0f39(_0xe9a13a)[_0xbd09('0x33')](_0x49e959());break;case _0xbd09('0x3f'):_0x194e7e(_0xe9a13a)[_0xbd09('0x33')](_0x49e959());break;default:_0x9006c6[_0xbd09('0x2a')][_0xbd09('0x2c')]({'phone':_0x78389b[_0xbd09('0xf')],'ContactId':_0x78389b['id'],'ListId':_0x78389b[_0xbd09('0x2d')],'scheduledat':_0x78389b[_0xbd09('0x1e')]?_0x78389b[_0xbd09('0x1e')]:moment()[_0xbd09('0x1f')](_0xbd09('0x20')),'priority':_0x78389b[_0xbd09('0x2e')]?_0x78389b[_0xbd09('0x2e')]:0x2,'callback':_0x78389b[_0xbd09('0x2f')]?!![]:![],'callbackuniqueid':_0x78389b[_0xbd09('0x2f')]?_0x78389b['callbackUniqueid']:undefined,'callbackat':_0x78389b[_0xbd09('0x2f')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xe9a13a['id']})[_0xbd09('0x33')](_0x49e959());}}}});})[_0xbd09('0x23')](function(){return _0x9006c6[_0xbd09('0x35')][_0xbd09('0x39')]({'attributes':['id'],'include':[{'model':_0x9006c6[_0xbd09('0x3c')],'as':_0xbd09('0x40'),'where':{'id':_0x78389b[_0xbd09('0x2d')]}}]})[_0xbd09('0x23')](function(_0x595377){if(_0x595377){var _0x3443e3=[];for(var _0x515bf3=0x0,_0x2ffed4;_0x515bf3<_0x595377['length'];_0x515bf3+=0x1){_0x2ffed4=_0x595377[_0x515bf3][_0xbd09('0x1a')]({'plain':!![]});_0x9006c6['CmHopperBlack'][_0xbd09('0x2c')]({'phone':_0x78389b[_0xbd09('0xf')],'ContactId':_0x78389b['id'],'ListId':_0x78389b['ListId'],'CampaignId':_0x2ffed4['id']})[_0xbd09('0x33')](function(_0x41705d){logger['error'](_0xbd09('0x43'),_0xbd09('0x1d'),_0x41705d[_0xbd09('0x42')]);});}}});})[_0xbd09('0x23')](function(){_0x3ac625();})[_0xbd09('0x33')](function(_0x32a790){logger['error']('cmContact,\x20%s,\x20%s',_0xbd09('0x1d'),_0x32a790['message']);_0x3ac625(_0x32a790);});}else{_0x3ac625(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x390cf9,_0x165e3c,_0x1291f5){var _0x237fd0=_0x52e3ce[_0xbd09('0x19')];var _0x382c14=_0x390cf9[_0xbd09('0x1a')]({'plain':!![]});return _0x237fd0[_0xbd09('0x2a')]['findAll']({'raw':!![],'where':{'ListId':_0x382c14['ListId'],'ContactId':_0x382c14['id']}})[_0xbd09('0x23')](function(_0x578a67){if(!_[_0xbd09('0x44')](_0x578a67)){var _0x1fbf4a=[];for(var _0x3ababb=0x0;_0x3ababb<_0x578a67[_0xbd09('0x3e')];_0x3ababb+=0x1){var _0x470280=_0x237fd0['CmHopper'][_0xbd09('0x45')]({'where':{'ListId':_0x578a67[_0x3ababb][_0xbd09('0x2d')],'ContactId':_0x578a67[_0x3ababb]['ContactId'],'VoiceQueueId':_0x578a67[_0x3ababb][_0xbd09('0x46')],'CampaignId':_0x578a67[_0x3ababb][_0xbd09('0x47')]}});_0x1fbf4a[_0xbd09('0x48')](_0x470280);}return BPromise[_0xbd09('0x49')](_0x1fbf4a);}})[_0xbd09('0x23')](function(_0x4131c6){logger[_0xbd09('0x4a')]('[CmContact][afterDestroy][Succesfull]',util[_0xbd09('0x34')](_0x4131c6,{'showHidden':![],'depth':null}));_0x1291f5();})[_0xbd09('0x33')](function(_0x309037){logger['error'](_0xbd09('0x4b'),util[_0xbd09('0x34')](_0x309037,{'showHidden':![],'depth':null}));_0x1291f5(_0x309037);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 66d5f15..57ce213 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_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 BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0xfbbaea,_0x1f1f4d){var _0x535d36=function(_0x1f88e5){while(--_0x1f88e5){_0xfbbaea['push'](_0xfbbaea['shift']());}};_0x535d36(++_0x1f1f4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index acf2265..ad04e70 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdb5=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x53e07a,_0x852bb){var _0xf2dd06=function(_0x497079){while(--_0x497079){_0x53e07a['push'](_0x53e07a['shift']());}};_0xf2dd06(++_0x852bb);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xfdb5[_0x25d386];return _0x857f4a;};'use strict';var Sequelize=require(_0x5fdb('0x0'));module[_0x5fdb('0x1')]={'CmContactId':{'type':Sequelize[_0x5fdb('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x5fdb('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x5fdb('0x3')],'defaultValue':_0x5fdb('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x7d86=['STRING','PHONE','sequelize','INTEGER'];(function(_0x50920f,_0x365a54){var _0x2d86f5=function(_0x16a307){while(--_0x16a307){_0x50920f['push'](_0x50920f['shift']());}};_0x2d86f5(++_0x365a54);}(_0x7d86,0x86));var _0x67d8=function(_0x2e75d8,_0x3d701d){_0x2e75d8=_0x2e75d8-0x0;var _0x10b98b=_0x7d86[_0x2e75d8];return _0x10b98b;};'use strict';var Sequelize=require(_0x67d8('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x67d8('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x67d8('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x67d8('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x67d8('0x2')],'defaultValue':_0x67d8('0x3')},'OrderBy':{'type':Sequelize[_0x67d8('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x67d8('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 38a2616..a1ec59a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8de=['count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','CmContactHasItem','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x5ca44a,_0x4865c9){var _0x9372b9=function(_0x1301ea){while(--_0x1301ea){_0x5ca44a['push'](_0x5ca44a['shift']());}};_0x9372b9(++_0x4865c9);}(_0xd8de,0x8c));var _0xed8d=function(_0x14c243,_0x541819){_0x14c243=_0x14c243-0x0;var _0x9d2f6a=_0xd8de[_0x14c243];return _0x9d2f6a;};'use strict';var emlformat=require(_0xed8d('0x0'));var rimraf=require(_0xed8d('0x1'));var zipdir=require(_0xed8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed8d('0x3'));var moment=require(_0xed8d('0x4'));var BPromise=require(_0xed8d('0x5'));var Mustache=require(_0xed8d('0x6'));var util=require(_0xed8d('0x7'));var path=require(_0xed8d('0x8'));var sox=require(_0xed8d('0x9'));var csv=require(_0xed8d('0xa'));var ejs=require(_0xed8d('0xb'));var fs=require('fs');var fs_extra=require(_0xed8d('0xc'));var _=require(_0xed8d('0xd'));var squel=require(_0xed8d('0xe'));var crypto=require(_0xed8d('0xf'));var jsforce=require(_0xed8d('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed8d('0x11'));var Papa=require(_0xed8d('0x12'));var Redis=require(_0xed8d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xed8d('0x14'));var as=require(_0xed8d('0x15'));var hardwareService=require(_0xed8d('0x16'));var logger=require(_0xed8d('0x17'))('api');var utils=require(_0xed8d('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed8d('0x19'))['db'];function respondWithStatusCode(_0x339519,_0xf8e816){_0xf8e816=_0xf8e816||0xcc;return function(_0x55bbb5){if(_0x55bbb5){return _0x339519[_0xed8d('0x1a')](_0xf8e816);}return _0x339519[_0xed8d('0x1b')](_0xf8e816)[_0xed8d('0x1c')]();};}function respondWithResult(_0x59237a,_0x1490e4){_0x1490e4=_0x1490e4||0xc8;return function(_0x12734a){if(_0x12734a){return _0x59237a['status'](_0x1490e4)[_0xed8d('0x1d')](_0x12734a);}};}function respondWithFilteredResult(_0x89eefb,_0x17921d){return function(_0x20c2a4){if(_0x20c2a4){var _0x368ad8=typeof _0x17921d[_0xed8d('0x1e')]==='undefined'&&typeof _0x17921d['limit']===_0xed8d('0x1f');var _0x12d206=_0x20c2a4[_0xed8d('0x20')];var _0x3ce124=_0x368ad8?0x0:_0x17921d[_0xed8d('0x1e')];var _0x3d850c=_0x368ad8?_0x20c2a4['count']:_0x17921d['offset']+_0x17921d[_0xed8d('0x21')];var _0x165e17;if(_0x3d850c>=_0x12d206){_0x3d850c=_0x12d206;_0x165e17=0xc8;}else{_0x165e17=0xce;}_0x89eefb[_0xed8d('0x1b')](_0x165e17);return _0x89eefb[_0xed8d('0x22')](_0xed8d('0x23'),_0x3ce124+'-'+_0x3d850c+'/'+_0x12d206)[_0xed8d('0x1d')](_0x20c2a4);}return null;};}function patchUpdates(_0xd277af){return function(_0x4dc047){try{jsonpatch[_0xed8d('0x24')](_0x4dc047,_0xd277af,!![]);}catch(_0x3972d8){return BPromise[_0xed8d('0x25')](_0x3972d8);}return _0x4dc047[_0xed8d('0x26')]();};}function saveUpdates(_0x4f5ed7,_0x32e18f){return function(_0x597673){if(_0x597673){return _0x597673[_0xed8d('0x27')](_0x4f5ed7)[_0xed8d('0x28')](function(_0x1f725f){return _0x1f725f;});}return null;};}function removeEntity(_0x4b2c85,_0x30cb3a){return function(_0x94b055){if(_0x94b055){return _0x94b055[_0xed8d('0x29')]()[_0xed8d('0x28')](function(){var _0x26afe8=_0x94b055[_0xed8d('0x2a')]({'plain':!![]});var _0x43da17='CmContactHasItems';return db['UserProfileResource']['destroy']({'where':{'type':_0x43da17,'resourceId':_0x26afe8['id']}})[_0xed8d('0x28')](function(){return _0x94b055;});})[_0xed8d('0x28')](function(){_0x4b2c85[_0xed8d('0x1b')](0xcc)[_0xed8d('0x1c')]();});}};}function handleEntityNotFound(_0x3c79bf,_0x570930){return function(_0x260bf2){if(!_0x260bf2){_0x3c79bf[_0xed8d('0x1a')](0x194);}return _0x260bf2;};}function handleError(_0x1c346a,_0x22f382){_0x22f382=_0x22f382||0x1f4;return function(_0x330e75){logger['error'](_0x330e75[_0xed8d('0x2b')]);if(_0x330e75['name']){delete _0x330e75[_0xed8d('0x2c')];}_0x1c346a[_0xed8d('0x1b')](_0x22f382)[_0xed8d('0x2d')](_0x330e75);};}exports[_0xed8d('0x2e')]=function(_0x1f0031,_0x5047a9){var _0x2a874e={},_0xe631fd={},_0x34bcb5={'count':0x0,'rows':[]};var _0xdb13fe=_[_0xed8d('0x2f')](db['CmContactHasItem'][_0xed8d('0x30')],function(_0x59a80f){return{'name':_0x59a80f[_0xed8d('0x31')],'type':_0x59a80f[_0xed8d('0x32')][_0xed8d('0x33')]};});_0xe631fd[_0xed8d('0x34')]=_[_0xed8d('0x2f')](_0xdb13fe,_0xed8d('0x2c'));_0xe631fd[_0xed8d('0x35')]=_['keys'](_0x1f0031[_0xed8d('0x35')]);_0xe631fd['filters']=_[_0xed8d('0x36')](_0xe631fd[_0xed8d('0x34')],_0xe631fd[_0xed8d('0x35')]);_0x2a874e[_0xed8d('0x37')]=_['intersection'](_0xe631fd[_0xed8d('0x34')],qs[_0xed8d('0x38')](_0x1f0031['query'][_0xed8d('0x38')]));_0x2a874e['attributes']=_0x2a874e[_0xed8d('0x37')]['length']?_0x2a874e[_0xed8d('0x37')]:_0xe631fd[_0xed8d('0x34')];if(!_0x1f0031[_0xed8d('0x35')][_0xed8d('0x39')](_0xed8d('0x3a'))){_0x2a874e[_0xed8d('0x21')]=qs[_0xed8d('0x21')](_0x1f0031[_0xed8d('0x35')][_0xed8d('0x21')]);_0x2a874e[_0xed8d('0x1e')]=qs[_0xed8d('0x1e')](_0x1f0031[_0xed8d('0x35')]['offset']);}_0x2a874e[_0xed8d('0x3b')]=qs[_0xed8d('0x3c')](_0x1f0031[_0xed8d('0x35')][_0xed8d('0x3c')]);_0x2a874e[_0xed8d('0x3d')]=qs[_0xed8d('0x3e')](_[_0xed8d('0x3f')](_0x1f0031[_0xed8d('0x35')],_0xe631fd[_0xed8d('0x3e')]),_0xdb13fe);if(_0x1f0031[_0xed8d('0x35')][_0xed8d('0x40')]){_0x2a874e[_0xed8d('0x3d')]=_[_0xed8d('0x41')](_0x2a874e[_0xed8d('0x3d')],{'$or':_[_0xed8d('0x2f')](_0xdb13fe,function(_0x1a9221){if(_0x1a9221[_0xed8d('0x32')]!=='VIRTUAL'){var _0x4fe01a={};_0x4fe01a[_0x1a9221['name']]={'$like':'%'+_0x1f0031[_0xed8d('0x35')][_0xed8d('0x40')]+'%'};return _0x4fe01a;}})});}_0x2a874e=_[_0xed8d('0x41')]({},_0x2a874e,_0x1f0031[_0xed8d('0x42')]);var _0x104807={'where':_0x2a874e[_0xed8d('0x3d')]};return db['CmContactHasItem']['count'](_0x104807)['then'](function(_0x312a11){_0x34bcb5[_0xed8d('0x20')]=_0x312a11;if(_0x1f0031[_0xed8d('0x35')][_0xed8d('0x43')]){_0x2a874e['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0xed8d('0x44')](_0x2a874e);})[_0xed8d('0x28')](function(_0x133aae){_0x34bcb5[_0xed8d('0x45')]=_0x133aae;return _0x34bcb5;})['then'](respondWithFilteredResult(_0x5047a9,_0x2a874e))['catch'](handleError(_0x5047a9,null));};exports[_0xed8d('0x46')]=function(_0x49965b,_0x25589f){var _0xd408be={'raw':!![],'where':{'id':_0x49965b[_0xed8d('0x47')]['id']}},_0x34b2f6={};_0x34b2f6[_0xed8d('0x34')]=_['keys'](db[_0xed8d('0x48')][_0xed8d('0x30')]);_0x34b2f6['query']=_['keys'](_0x49965b[_0xed8d('0x35')]);_0x34b2f6[_0xed8d('0x3e')]=_[_0xed8d('0x36')](_0x34b2f6[_0xed8d('0x34')],_0x34b2f6['query']);_0xd408be[_0xed8d('0x37')]=_[_0xed8d('0x36')](_0x34b2f6['model'],qs['fields'](_0x49965b[_0xed8d('0x35')][_0xed8d('0x38')]));_0xd408be['attributes']=_0xd408be['attributes'][_0xed8d('0x49')]?_0xd408be['attributes']:_0x34b2f6[_0xed8d('0x34')];if(_0x49965b[_0xed8d('0x35')][_0xed8d('0x43')]){_0xd408be['include']=[{'all':!![]}];}_0xd408be=_[_0xed8d('0x41')]({},_0xd408be,_0x49965b[_0xed8d('0x42')]);return db[_0xed8d('0x48')][_0xed8d('0x4a')](_0xd408be)[_0xed8d('0x28')](handleEntityNotFound(_0x25589f,null))[_0xed8d('0x28')](respondWithResult(_0x25589f,null))['catch'](handleError(_0x25589f,null));};exports[_0xed8d('0x4b')]=function(_0x22c83e,_0x3e9acc){return db['CmContactHasItem']['create'](_0x22c83e[_0xed8d('0x4c')],{})[_0xed8d('0x28')](function(_0x2a5b14){var _0x81dbc4=_0x22c83e[_0xed8d('0x4d')][_0xed8d('0x2a')]({'plain':!![]});if(!_0x81dbc4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x81dbc4[_0xed8d('0x4e')]===_0xed8d('0x4d')){var _0x1a9cb1=_0x2a5b14[_0xed8d('0x2a')]({'plain':!![]});var _0x44479d='CmContactHasItems';return db[_0xed8d('0x4f')][_0xed8d('0x4a')]({'where':{'name':_0x44479d,'userProfileId':_0x81dbc4[_0xed8d('0x50')]},'raw':!![]})[_0xed8d('0x28')](function(_0x2ead82){if(_0x2ead82&&_0x2ead82[_0xed8d('0x51')]===0x0){return db[_0xed8d('0x52')]['create']({'name':_0x1a9cb1[_0xed8d('0x2c')],'resourceId':_0x1a9cb1['id'],'type':_0x2ead82[_0xed8d('0x2c')],'sectionId':_0x2ead82['id']},{})[_0xed8d('0x28')](function(){return _0x2a5b14;});}else{return _0x2a5b14;}})[_0xed8d('0x53')](function(_0xc5f50b){logger[_0xed8d('0x54')](_0xed8d('0x55'),_0xc5f50b);throw _0xc5f50b;});}return _0x2a5b14;})['then'](respondWithResult(_0x3e9acc,0xc9))[_0xed8d('0x53')](handleError(_0x3e9acc,null));};exports['update']=function(_0x46e195,_0x1e9f2f){if(_0x46e195['body']['id']){delete _0x46e195[_0xed8d('0x4c')]['id'];}return db[_0xed8d('0x48')]['find']({'where':{'id':_0x46e195[_0xed8d('0x47')]['id']}})[_0xed8d('0x28')](handleEntityNotFound(_0x1e9f2f,null))[_0xed8d('0x28')](saveUpdates(_0x46e195['body'],null))[_0xed8d('0x28')](respondWithResult(_0x1e9f2f,null))[_0xed8d('0x53')](handleError(_0x1e9f2f,null));};exports[_0xed8d('0x29')]=function(_0x44891d,_0x46115c){return db['CmContactHasItem'][_0xed8d('0x4a')]({'where':{'id':_0x44891d[_0xed8d('0x47')]['id']}})[_0xed8d('0x28')](handleEntityNotFound(_0x46115c,null))['then'](removeEntity(_0x46115c,null))[_0xed8d('0x53')](handleError(_0x46115c,null));}; \ No newline at end of file +var _0xa1a7=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','count','set','apply','update','then','destroy','get','CmContactHasItems','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','CmContactHasItem','includeAll','include','rows','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','eml-format','rimraf','zip-dir'];(function(_0x1926ae,_0x434bab){var _0x1fb9ad=function(_0x12d0fa){while(--_0x12d0fa){_0x1926ae['push'](_0x1926ae['shift']());}};_0x1fb9ad(++_0x434bab);}(_0xa1a7,0xa3));var _0x7a1a=function(_0xbc13e1,_0x14d88b){_0xbc13e1=_0xbc13e1-0x0;var _0xa87f5a=_0xa1a7[_0xbc13e1];return _0xa87f5a;};'use strict';var emlformat=require(_0x7a1a('0x0'));var rimraf=require(_0x7a1a('0x1'));var zipdir=require(_0x7a1a('0x2'));var jsonpatch=require(_0x7a1a('0x3'));var rp=require(_0x7a1a('0x4'));var moment=require(_0x7a1a('0x5'));var BPromise=require(_0x7a1a('0x6'));var Mustache=require(_0x7a1a('0x7'));var util=require(_0x7a1a('0x8'));var path=require(_0x7a1a('0x9'));var sox=require(_0x7a1a('0xa'));var csv=require(_0x7a1a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7a1a('0xc'));var squel=require(_0x7a1a('0xd'));var crypto=require(_0x7a1a('0xe'));var jsforce=require(_0x7a1a('0xf'));var deskjs=require(_0x7a1a('0x10'));var toCsv=require(_0x7a1a('0xb'));var querystring=require(_0x7a1a('0x11'));var Papa=require('papaparse');var Redis=require(_0x7a1a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7a1a('0x13'));var as=require(_0x7a1a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a1a('0x15'))('api');var utils=require(_0x7a1a('0x16'));var config=require(_0x7a1a('0x17'));var licenseUtil=require(_0x7a1a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d800c,_0x4bce76){_0x4bce76=_0x4bce76||0xcc;return function(_0x41fdd2){if(_0x41fdd2){return _0x4d800c['sendStatus'](_0x4bce76);}return _0x4d800c[_0x7a1a('0x19')](_0x4bce76)[_0x7a1a('0x1a')]();};}function respondWithResult(_0x5ee0b4,_0xbca934){_0xbca934=_0xbca934||0xc8;return function(_0x7449b1){if(_0x7449b1){return _0x5ee0b4['status'](_0xbca934)[_0x7a1a('0x1b')](_0x7449b1);}};}function respondWithFilteredResult(_0x2ae7fd,_0x5f3df6){return function(_0x4b76a5){if(_0x4b76a5){var _0x3215be=typeof _0x5f3df6['offset']===_0x7a1a('0x1c')&&typeof _0x5f3df6[_0x7a1a('0x1d')]===_0x7a1a('0x1c');var _0x2df98a=_0x4b76a5['count'];var _0x26be60=_0x3215be?0x0:_0x5f3df6[_0x7a1a('0x1e')];var _0x1e48ee=_0x3215be?_0x4b76a5[_0x7a1a('0x1f')]:_0x5f3df6[_0x7a1a('0x1e')]+_0x5f3df6[_0x7a1a('0x1d')];var _0x52352f;if(_0x1e48ee>=_0x2df98a){_0x1e48ee=_0x2df98a;_0x52352f=0xc8;}else{_0x52352f=0xce;}_0x2ae7fd[_0x7a1a('0x19')](_0x52352f);return _0x2ae7fd[_0x7a1a('0x20')]('Content-Range',_0x26be60+'-'+_0x1e48ee+'/'+_0x2df98a)[_0x7a1a('0x1b')](_0x4b76a5);}return null;};}function patchUpdates(_0x3c4a97){return function(_0xade7c6){try{jsonpatch[_0x7a1a('0x21')](_0xade7c6,_0x3c4a97,!![]);}catch(_0x23f238){return BPromise['reject'](_0x23f238);}return _0xade7c6['save']();};}function saveUpdates(_0x3df654,_0x4fec20){return function(_0x369a1f){if(_0x369a1f){return _0x369a1f[_0x7a1a('0x22')](_0x3df654)[_0x7a1a('0x23')](function(_0x4a737a){return _0x4a737a;});}return null;};}function removeEntity(_0xf8184,_0x31f048){return function(_0x8e2656){if(_0x8e2656){return _0x8e2656[_0x7a1a('0x24')]()[_0x7a1a('0x23')](function(){var _0x4437f2=_0x8e2656[_0x7a1a('0x25')]({'plain':!![]});var _0x80e84b=_0x7a1a('0x26');return db[_0x7a1a('0x27')]['destroy']({'where':{'type':_0x80e84b,'resourceId':_0x4437f2['id']}})['then'](function(){return _0x8e2656;});})['then'](function(){_0xf8184[_0x7a1a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2035f3,_0x5079e6){return function(_0x5bc1ff){if(!_0x5bc1ff){_0x2035f3[_0x7a1a('0x28')](0x194);}return _0x5bc1ff;};}function handleError(_0x518747,_0x51c2ad){_0x51c2ad=_0x51c2ad||0x1f4;return function(_0x254b17){logger['error'](_0x254b17[_0x7a1a('0x29')]);if(_0x254b17[_0x7a1a('0x2a')]){delete _0x254b17[_0x7a1a('0x2a')];}_0x518747[_0x7a1a('0x19')](_0x51c2ad)[_0x7a1a('0x2b')](_0x254b17);};}exports[_0x7a1a('0x2c')]=function(_0x3deaac,_0x26086f){var _0x44318e={},_0x4f94ee={},_0x2f61e0={'count':0x0,'rows':[]};var _0x45ac91=_[_0x7a1a('0x2d')](db['CmContactHasItem'][_0x7a1a('0x2e')],function(_0xfee567){return{'name':_0xfee567[_0x7a1a('0x2f')],'type':_0xfee567[_0x7a1a('0x30')][_0x7a1a('0x31')]};});_0x4f94ee[_0x7a1a('0x32')]=_[_0x7a1a('0x2d')](_0x45ac91,_0x7a1a('0x2a'));_0x4f94ee[_0x7a1a('0x33')]=_[_0x7a1a('0x34')](_0x3deaac['query']);_0x4f94ee[_0x7a1a('0x35')]=_['intersection'](_0x4f94ee[_0x7a1a('0x32')],_0x4f94ee[_0x7a1a('0x33')]);_0x44318e['attributes']=_[_0x7a1a('0x36')](_0x4f94ee[_0x7a1a('0x32')],qs[_0x7a1a('0x37')](_0x3deaac[_0x7a1a('0x33')][_0x7a1a('0x37')]));_0x44318e['attributes']=_0x44318e[_0x7a1a('0x38')][_0x7a1a('0x39')]?_0x44318e[_0x7a1a('0x38')]:_0x4f94ee['model'];if(!_0x3deaac[_0x7a1a('0x33')]['hasOwnProperty']('nolimit')){_0x44318e[_0x7a1a('0x1d')]=qs['limit'](_0x3deaac[_0x7a1a('0x33')][_0x7a1a('0x1d')]);_0x44318e[_0x7a1a('0x1e')]=qs[_0x7a1a('0x1e')](_0x3deaac[_0x7a1a('0x33')][_0x7a1a('0x1e')]);}_0x44318e[_0x7a1a('0x3a')]=qs['sort'](_0x3deaac[_0x7a1a('0x33')][_0x7a1a('0x3b')]);_0x44318e[_0x7a1a('0x3c')]=qs[_0x7a1a('0x35')](_[_0x7a1a('0x3d')](_0x3deaac[_0x7a1a('0x33')],_0x4f94ee['filters']),_0x45ac91);if(_0x3deaac['query'][_0x7a1a('0x3e')]){_0x44318e[_0x7a1a('0x3c')]=_[_0x7a1a('0x3f')](_0x44318e[_0x7a1a('0x3c')],{'$or':_['map'](_0x45ac91,function(_0x2a1ffc){if(_0x2a1ffc[_0x7a1a('0x30')]!==_0x7a1a('0x40')){var _0x46ea90={};_0x46ea90[_0x2a1ffc['name']]={'$like':'%'+_0x3deaac['query'][_0x7a1a('0x3e')]+'%'};return _0x46ea90;}})});}_0x44318e=_[_0x7a1a('0x3f')]({},_0x44318e,_0x3deaac[_0x7a1a('0x41')]);var _0x5d92b1={'where':_0x44318e[_0x7a1a('0x3c')]};return db[_0x7a1a('0x42')][_0x7a1a('0x1f')](_0x5d92b1)[_0x7a1a('0x23')](function(_0x1d9cf0){_0x2f61e0[_0x7a1a('0x1f')]=_0x1d9cf0;if(_0x3deaac[_0x7a1a('0x33')][_0x7a1a('0x43')]){_0x44318e[_0x7a1a('0x44')]=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x44318e);})[_0x7a1a('0x23')](function(_0x6774ba){_0x2f61e0[_0x7a1a('0x45')]=_0x6774ba;return _0x2f61e0;})[_0x7a1a('0x23')](respondWithFilteredResult(_0x26086f,_0x44318e))['catch'](handleError(_0x26086f,null));};exports[_0x7a1a('0x46')]=function(_0x9056ff,_0x5ba1ee){var _0x11f7e4={'raw':!![],'where':{'id':_0x9056ff[_0x7a1a('0x47')]['id']}},_0x3766fb={};_0x3766fb[_0x7a1a('0x32')]=_['keys'](db[_0x7a1a('0x42')][_0x7a1a('0x2e')]);_0x3766fb[_0x7a1a('0x33')]=_[_0x7a1a('0x34')](_0x9056ff['query']);_0x3766fb[_0x7a1a('0x35')]=_[_0x7a1a('0x36')](_0x3766fb['model'],_0x3766fb[_0x7a1a('0x33')]);_0x11f7e4[_0x7a1a('0x38')]=_['intersection'](_0x3766fb['model'],qs['fields'](_0x9056ff['query'][_0x7a1a('0x37')]));_0x11f7e4[_0x7a1a('0x38')]=_0x11f7e4[_0x7a1a('0x38')][_0x7a1a('0x39')]?_0x11f7e4[_0x7a1a('0x38')]:_0x3766fb[_0x7a1a('0x32')];if(_0x9056ff[_0x7a1a('0x33')]['includeAll']){_0x11f7e4[_0x7a1a('0x44')]=[{'all':!![]}];}_0x11f7e4=_[_0x7a1a('0x3f')]({},_0x11f7e4,_0x9056ff['options']);return db[_0x7a1a('0x42')]['find'](_0x11f7e4)[_0x7a1a('0x23')](handleEntityNotFound(_0x5ba1ee,null))[_0x7a1a('0x23')](respondWithResult(_0x5ba1ee,null))['catch'](handleError(_0x5ba1ee,null));};exports[_0x7a1a('0x48')]=function(_0x1d3679,_0x46fdba){return db['CmContactHasItem'][_0x7a1a('0x48')](_0x1d3679['body'],{})[_0x7a1a('0x23')](function(_0x24ca96){var _0x17c6a0=_0x1d3679[_0x7a1a('0x49')][_0x7a1a('0x25')]({'plain':!![]});if(!_0x17c6a0)throw new Error(_0x7a1a('0x4a'));if(_0x17c6a0[_0x7a1a('0x4b')]===_0x7a1a('0x49')){var _0x28cc7a=_0x24ca96['get']({'plain':!![]});var _0x491d01='CmContactHasItems';return db[_0x7a1a('0x4c')][_0x7a1a('0x4d')]({'where':{'name':_0x491d01,'userProfileId':_0x17c6a0['userProfileId']},'raw':!![]})['then'](function(_0x5c33aa){if(_0x5c33aa&&_0x5c33aa[_0x7a1a('0x4e')]===0x0){return db[_0x7a1a('0x27')]['create']({'name':_0x28cc7a['name'],'resourceId':_0x28cc7a['id'],'type':_0x5c33aa[_0x7a1a('0x2a')],'sectionId':_0x5c33aa['id']},{})[_0x7a1a('0x23')](function(){return _0x24ca96;});}else{return _0x24ca96;}})['catch'](function(_0x5df316){logger[_0x7a1a('0x4f')](_0x7a1a('0x50'),_0x5df316);throw _0x5df316;});}return _0x24ca96;})['then'](respondWithResult(_0x46fdba,0xc9))[_0x7a1a('0x51')](handleError(_0x46fdba,null));};exports[_0x7a1a('0x22')]=function(_0x1289bb,_0x4046dd){if(_0x1289bb[_0x7a1a('0x52')]['id']){delete _0x1289bb[_0x7a1a('0x52')]['id'];}return db[_0x7a1a('0x42')][_0x7a1a('0x4d')]({'where':{'id':_0x1289bb['params']['id']}})[_0x7a1a('0x23')](handleEntityNotFound(_0x4046dd,null))[_0x7a1a('0x23')](saveUpdates(_0x1289bb[_0x7a1a('0x52')],null))['then'](respondWithResult(_0x4046dd,null))[_0x7a1a('0x51')](handleError(_0x4046dd,null));};exports[_0x7a1a('0x24')]=function(_0x1adb4e,_0x2eefd3){return db[_0x7a1a('0x42')][_0x7a1a('0x4d')]({'where':{'id':_0x1adb4e[_0x7a1a('0x47')]['id']}})[_0x7a1a('0x23')](handleEntityNotFound(_0x2eefd3,null))[_0x7a1a('0x23')](removeEntity(_0x2eefd3,null))['catch'](handleError(_0x2eefd3,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 82f3d3e..3bd0e7d 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfbf=['bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','cm_contact_has_items','util','../../config/logger','api','moment'];(function(_0x42f3a5,_0x3a4470){var _0x1a7d74=function(_0x43cc36){while(--_0x43cc36){_0x42f3a5['push'](_0x42f3a5['shift']());}};_0x1a7d74(++_0x3a4470);}(_0xcfbf,0x1b4));var _0xfcfb=function(_0x4c9ac4,_0x5920bf){_0x4c9ac4=_0x4c9ac4-0x0;var _0x5bc51d=_0xcfbf[_0x4c9ac4];return _0x5bc51d;};'use strict';var _=require('lodash');var util=require(_0xfcfb('0x0'));var logger=require(_0xfcfb('0x1'))(_0xfcfb('0x2'));var moment=require(_0xfcfb('0x3'));var BPromise=require(_0xfcfb('0x4'));var rp=require(_0xfcfb('0x5'));var fs=require('fs');var path=require(_0xfcfb('0x6'));var rimraf=require(_0xfcfb('0x7'));var config=require('../../config/environment');var attributes=require(_0xfcfb('0x8'));module[_0xfcfb('0x9')]=function(_0x1f4ebe,_0x40830d){return _0x1f4ebe['define']('CmContactHasItem',attributes,{'tableName':_0xfcfb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89e5=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util'];(function(_0x5406af,_0x482ea2){var _0x22fc23=function(_0x1f5834){while(--_0x1f5834){_0x5406af['push'](_0x5406af['shift']());}};_0x22fc23(++_0x482ea2);}(_0x89e5,0x186));var _0x589e=function(_0x104553,_0x56093e){_0x104553=_0x104553-0x0;var _0x58ca1e=_0x89e5[_0x104553];return _0x58ca1e;};'use strict';var _=require(_0x589e('0x0'));var util=require(_0x589e('0x1'));var logger=require(_0x589e('0x2'))(_0x589e('0x3'));var moment=require(_0x589e('0x4'));var BPromise=require(_0x589e('0x5'));var rp=require(_0x589e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x589e('0x7'));var config=require(_0x589e('0x8'));var attributes=require(_0x589e('0x9'));module[_0x589e('0xa')]=function(_0x5e6ca3,_0x5dbf7c){return _0x5e6ca3[_0x589e('0xb')](_0x589e('0xc'),attributes,{'tableName':_0x589e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 24230ff..6bba500 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c7b=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19acd8,_0x4ecedb){var _0x1b41c=function(_0x10acf3){while(--_0x10acf3){_0x19acd8['push'](_0x19acd8['shift']());}};_0x1b41c(++_0x4ecedb);}(_0x9c7b,0x74));var _0xb9c7=function(_0x375a12,_0x3617f8){_0x375a12=_0x375a12-0x0;var _0x61187e=_0x9c7b[_0x375a12];return _0x61187e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb9c7('0x0'));var BPromise=require(_0xb9c7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9c7('0x2'));var db=require(_0xb9c7('0x3'))['db'];var utils=require(_0xb9c7('0x4'));var logger=require(_0xb9c7('0x5'))('rpc');var config=require(_0xb9c7('0x6'));var jayson=require(_0xb9c7('0x7'));var client=jayson[_0xb9c7('0x8')][_0xb9c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4352f6,_0xcd8c93,_0x2750d6){return new BPromise(function(_0xfa2f8d,_0x2b0fe4){return client[_0xb9c7('0xa')](_0x4352f6,_0x2750d6)[_0xb9c7('0xb')](function(_0x325324){logger[_0xb9c7('0xc')](_0xb9c7('0xd'),_0xcd8c93,_0xb9c7('0xe'));logger[_0xb9c7('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0xcd8c93,_0xb9c7('0xe'),JSON[_0xb9c7('0x10')](_0x325324));if(_0x325324[_0xb9c7('0x11')]){if(_0x325324[_0xb9c7('0x11')][_0xb9c7('0x12')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0xcd8c93,_0x325324[_0xb9c7('0x11')]['message']);return _0x2b0fe4(_0x325324[_0xb9c7('0x11')]['message']);}logger['error'](_0xb9c7('0xd'),_0xcd8c93,_0x325324[_0xb9c7('0x11')][_0xb9c7('0x13')]);return _0xfa2f8d(_0x325324[_0xb9c7('0x11')]['message']);}else{logger[_0xb9c7('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0xcd8c93,_0xb9c7('0xe'));_0xfa2f8d(_0x325324[_0xb9c7('0x14')][_0xb9c7('0x13')]);}})[_0xb9c7('0x15')](function(_0x20fcfd){logger['error'](_0xb9c7('0xd'),_0xcd8c93,_0x20fcfd);_0x2b0fe4(_0x20fcfd);});});} \ No newline at end of file +var _0x45e5=['code','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3e15af,_0x977fdf){var _0x4aa375=function(_0x466c35){while(--_0x466c35){_0x3e15af['push'](_0x3e15af['shift']());}};_0x4aa375(++_0x977fdf);}(_0x45e5,0x96));var _0x545e=function(_0x56f739,_0x241b89){_0x56f739=_0x56f739-0x0;var _0x107b49=_0x45e5[_0x56f739];return _0x107b49;};'use strict';var _=require('lodash');var util=require(_0x545e('0x0'));var moment=require(_0x545e('0x1'));var BPromise=require('bluebird');var rs=require(_0x545e('0x2'));var fs=require('fs');var Redis=require(_0x545e('0x3'));var db=require(_0x545e('0x4'))['db'];var utils=require(_0x545e('0x5'));var logger=require(_0x545e('0x6'))('rpc');var config=require(_0x545e('0x7'));var jayson=require(_0x545e('0x8'));var client=jayson[_0x545e('0x9')][_0x545e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ca440,_0x38b051,_0x31f126){return new BPromise(function(_0x51faf7,_0x4563d2){return client[_0x545e('0xb')](_0x5ca440,_0x31f126)[_0x545e('0xc')](function(_0x1239e3){logger['info'](_0x545e('0xd'),_0x38b051,'request\x20sent');logger[_0x545e('0xe')](_0x545e('0xf'),_0x38b051,_0x545e('0x10'),JSON[_0x545e('0x11')](_0x1239e3));if(_0x1239e3['error']){if(_0x1239e3['error'][_0x545e('0x12')]===0x1f4){logger[_0x545e('0x13')](_0x545e('0xd'),_0x38b051,_0x1239e3['error'][_0x545e('0x14')]);return _0x4563d2(_0x1239e3[_0x545e('0x13')]['message']);}logger[_0x545e('0x13')](_0x545e('0xd'),_0x38b051,_0x1239e3[_0x545e('0x13')]['message']);return _0x51faf7(_0x1239e3['error']['message']);}else{logger[_0x545e('0x15')]('CmContactHasItem,\x20%s,\x20%s',_0x38b051,'request\x20sent');_0x51faf7(_0x1239e3[_0x545e('0x16')][_0x545e('0x14')]);}})[_0x545e('0x17')](function(_0x299e41){logger[_0x545e('0x13')](_0x545e('0xd'),_0x38b051,_0x299e41);_0x4563d2(_0x299e41);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index cbba90e..e5dd6de 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9bf=['post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x169bc1,_0x4dd004){var _0x4ac893=function(_0x5a109b){while(--_0x5a109b){_0x169bc1['push'](_0x169bc1['shift']());}};_0x4ac893(++_0x4dd004);}(_0xa9bf,0x8d));var _0xfa9b=function(_0x2f452c,_0x45498e){_0x2f452c=_0x2f452c-0x0;var _0x5130ff=_0xa9bf[_0x2f452c];return _0x5130ff;};'use strict';var multer=require(_0xfa9b('0x0'));var util=require('util');var path=require(_0xfa9b('0x1'));var timeout=require(_0xfa9b('0x2'));var express=require(_0xfa9b('0x3'));var router=express[_0xfa9b('0x4')]();var fs_extra=require(_0xfa9b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfa9b('0x6'));var controller=require('./cmContactHasItem.controller');router[_0xfa9b('0x7')]('/',auth[_0xfa9b('0x8')](),controller[_0xfa9b('0x9')]);router['get'](_0xfa9b('0xa'),auth['isAuthenticated'](),controller[_0xfa9b('0xb')]);router[_0xfa9b('0xc')]('/',auth[_0xfa9b('0x8')](),controller[_0xfa9b('0xd')]);router['put']('/:id',auth[_0xfa9b('0x8')](),controller[_0xfa9b('0xe')]);router['delete']('/:id',auth[_0xfa9b('0x8')](),controller[_0xfa9b('0xf')]);module[_0xfa9b('0x10')]=router; \ No newline at end of file +var _0xf665=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x685cab,_0x1179e6){var _0x4c62de=function(_0x29908a){while(--_0x29908a){_0x685cab['push'](_0x685cab['shift']());}};_0x4c62de(++_0x1179e6);}(_0xf665,0xeb));var _0x5f66=function(_0x2eddb9,_0x41e214){_0x2eddb9=_0x2eddb9-0x0;var _0x541be9=_0xf665[_0x2eddb9];return _0x541be9;};'use strict';var multer=require(_0x5f66('0x0'));var util=require(_0x5f66('0x1'));var path=require(_0x5f66('0x2'));var timeout=require(_0x5f66('0x3'));var express=require(_0x5f66('0x4'));var router=express[_0x5f66('0x5')]();var fs_extra=require(_0x5f66('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5f66('0x7'));var config=require(_0x5f66('0x8'));var controller=require('./cmContactHasItem.controller');router[_0x5f66('0x9')]('/',auth[_0x5f66('0xa')](),controller[_0x5f66('0xb')]);router['get'](_0x5f66('0xc'),auth[_0x5f66('0xa')](),controller[_0x5f66('0xd')]);router[_0x5f66('0xe')]('/',auth[_0x5f66('0xa')](),controller[_0x5f66('0xf')]);router['put'](_0x5f66('0xc'),auth[_0x5f66('0xa')](),controller[_0x5f66('0x10')]);router[_0x5f66('0x11')](_0x5f66('0xc'),auth[_0x5f66('0xa')](),controller[_0x5f66('0x12')]);module[_0x5f66('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 6f78956..6b27a0e 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 _0x98b0=['isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','select','values'];(function(_0x59ad1e,_0x3faa34){var _0x58ed31=function(_0x16808e){while(--_0x16808e){_0x59ad1e['push'](_0x59ad1e['shift']());}};_0x58ed31(++_0x3faa34);}(_0x98b0,0x104));var _0x098b=function(_0x5906a5,_0x48af0a){_0x5906a5=_0x5906a5-0x0;var _0x1b9a31=_0x98b0[_0x5906a5];return _0x1b9a31;};'use strict';var Sequelize=require(_0x098b('0x0'));var _=require(_0x098b('0x1'));module['exports']={'name':{'type':Sequelize[_0x098b('0x2')],'get':function(_0x44f168){return this[_0x098b('0x3')](_0x098b('0x4'));}},'alias':{'type':Sequelize[_0x098b('0x5')],'allowNull':![],'set':function(_0xc7d815){this[_0x098b('0x6')](_0x098b('0x4'),_0xc7d815?_0xc7d815:this[_0x098b('0x3')](_0x098b('0x7')));}},'type':{'type':Sequelize[_0x098b('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x098b('0x8')),'get':function(){if(this[_0x098b('0x3')](_0x098b('0x9'))===_0x098b('0xa')){return JSON['parse'](this[_0x098b('0x3')]('values'));}else{return this['getDataValue'](_0x098b('0xb'));}},'set':function(_0x32a53e){if(Array[_0x098b('0xc')](_0x32a53e)){this[_0x098b('0x6')](_0x098b('0xb'),JSON[_0x098b('0xd')](_0x32a53e));}else{this[_0x098b('0x6')]('values',_0x32a53e);}}},'required':{'type':Sequelize[_0x098b('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x098b('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x098b('0xf')](_0x098b('0x10'))}}; \ No newline at end of file +var _0x1cae=['STRING','TEXT','long','type','select','parse','values','isArray','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name'];(function(_0x4d9d1e,_0x3c2d20){var _0x1b9d54=function(_0x373c21){while(--_0x373c21){_0x4d9d1e['push'](_0x4d9d1e['shift']());}};_0x1b9d54(++_0x3c2d20);}(_0x1cae,0x107));var _0xe1ca=function(_0x2871b3,_0x52849d){_0x2871b3=_0x2871b3-0x0;var _0xd6858e=_0x1cae[_0x2871b3];return _0xd6858e;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe1ca('0x0'));module[_0xe1ca('0x1')]={'name':{'type':Sequelize[_0xe1ca('0x2')],'get':function(_0x54005e){return this[_0xe1ca('0x3')](_0xe1ca('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x535c20){this[_0xe1ca('0x5')](_0xe1ca('0x4'),_0x535c20?_0x535c20:this[_0xe1ca('0x3')](_0xe1ca('0x6')));}},'type':{'type':Sequelize[_0xe1ca('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xe1ca('0x8')](_0xe1ca('0x9')),'get':function(){if(this['getDataValue'](_0xe1ca('0xa'))===_0xe1ca('0xb')){return JSON[_0xe1ca('0xc')](this[_0xe1ca('0x3')]('values'));}else{return this[_0xe1ca('0x3')](_0xe1ca('0xd'));}},'set':function(_0x24268){if(Array[_0xe1ca('0xe')](_0x24268)){this[_0xe1ca('0x5')](_0xe1ca('0xd'),JSON['stringify'](_0x24268));}else{this[_0xe1ca('0x5')](_0xe1ca('0xd'),_0x24268);}}},'required':{'type':Sequelize[_0xe1ca('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe1ca('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe1ca('0x10')](_0xe1ca('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index cfb1dbe..675face 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 _0x50f9=['count','offset','set','Content-Range','json','apply','reject','save','then','destroy','name','index','map','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','query','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','keys','intersection','length','find','body','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x50f9,0xeb));var _0x950f=function(_0x173880,_0x338a23){_0x173880=_0x173880-0x0;var _0x2d3b5a=_0x50f9[_0x173880];return _0x2d3b5a;};'use strict';var emlformat=require(_0x950f('0x0'));var rimraf=require(_0x950f('0x1'));var zipdir=require(_0x950f('0x2'));var jsonpatch=require(_0x950f('0x3'));var rp=require(_0x950f('0x4'));var moment=require(_0x950f('0x5'));var BPromise=require(_0x950f('0x6'));var Mustache=require(_0x950f('0x7'));var util=require(_0x950f('0x8'));var path=require('path');var sox=require(_0x950f('0x9'));var csv=require(_0x950f('0xa'));var ejs=require(_0x950f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x950f('0xc'));var squel=require(_0x950f('0xd'));var crypto=require(_0x950f('0xe'));var jsforce=require(_0x950f('0xf'));var deskjs=require(_0x950f('0x10'));var toCsv=require(_0x950f('0xa'));var querystring=require('querystring');var Papa=require(_0x950f('0x11'));var Redis=require(_0x950f('0x12'));var authService=require(_0x950f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x950f('0x14'));var hardwareService=require(_0x950f('0x15'));var logger=require(_0x950f('0x16'))(_0x950f('0x17'));var utils=require(_0x950f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x950f('0x19'));var db=require(_0x950f('0x1a'))['db'];function respondWithStatusCode(_0x3f4458,_0x791014){_0x791014=_0x791014||0xcc;return function(_0x13ef49){if(_0x13ef49){return _0x3f4458[_0x950f('0x1b')](_0x791014);}return _0x3f4458[_0x950f('0x1c')](_0x791014)[_0x950f('0x1d')]();};}function respondWithResult(_0x4bf842,_0x2697ea){_0x2697ea=_0x2697ea||0xc8;return function(_0x406d63){if(_0x406d63){return _0x4bf842[_0x950f('0x1c')](_0x2697ea)['json'](_0x406d63);}};}function respondWithFilteredResult(_0x19de2a,_0x3cd4e5){return function(_0xfbd053){if(_0xfbd053){var _0x50dee3=typeof _0x3cd4e5['offset']===_0x950f('0x1e')&&typeof _0x3cd4e5[_0x950f('0x1f')]===_0x950f('0x1e');var _0x5566b2=_0xfbd053[_0x950f('0x20')];var _0xb211ad=_0x50dee3?0x0:_0x3cd4e5[_0x950f('0x21')];var _0x3acd2d=_0x50dee3?_0xfbd053[_0x950f('0x20')]:_0x3cd4e5[_0x950f('0x21')]+_0x3cd4e5[_0x950f('0x1f')];var _0x24850d;if(_0x3acd2d>=_0x5566b2){_0x3acd2d=_0x5566b2;_0x24850d=0xc8;}else{_0x24850d=0xce;}_0x19de2a[_0x950f('0x1c')](_0x24850d);return _0x19de2a[_0x950f('0x22')](_0x950f('0x23'),_0xb211ad+'-'+_0x3acd2d+'/'+_0x5566b2)[_0x950f('0x24')](_0xfbd053);}return null;};}function patchUpdates(_0x28dc3e){return function(_0x3fc40b){try{jsonpatch[_0x950f('0x25')](_0x3fc40b,_0x28dc3e,!![]);}catch(_0x3a5770){return BPromise[_0x950f('0x26')](_0x3a5770);}return _0x3fc40b[_0x950f('0x27')]();};}function saveUpdates(_0x2226c4,_0x50ad7a){return function(_0x3d7326){if(_0x3d7326){return _0x3d7326['update'](_0x2226c4)[_0x950f('0x28')](function(_0x88e3fe){return _0x88e3fe;});}return null;};}function removeEntity(_0x29671b,_0x47bad4){return function(_0x15c876){if(_0x15c876){return _0x15c876[_0x950f('0x29')]()[_0x950f('0x28')](function(){_0x29671b[_0x950f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271d81,_0x3ecbed){return function(_0x461550){if(!_0x461550){_0x271d81[_0x950f('0x1b')](0x194);}return _0x461550;};}function handleError(_0x1153e9,_0x1f4a65){_0x1f4a65=_0x1f4a65||0x1f4;return function(_0x48153b){logger['error'](_0x48153b['stack']);if(_0x48153b[_0x950f('0x2a')]){delete _0x48153b['name'];}_0x1153e9[_0x950f('0x1c')](_0x1f4a65)['send'](_0x48153b);};}exports[_0x950f('0x2b')]=function(_0x2e9cc7,_0x4a1130){var _0x3b3187={},_0x1c3ecb={},_0x5891cc={'count':0x0,'rows':[]};var _0x3ff710=_[_0x950f('0x2c')](db[_0x950f('0x2d')][_0x950f('0x2e')],function(_0x149cd6){return{'name':_0x149cd6[_0x950f('0x2f')],'type':_0x149cd6['type'][_0x950f('0x30')]};});_0x1c3ecb[_0x950f('0x31')]=_[_0x950f('0x32')](_[_0x950f('0x2c')](_0x3ff710,'name'),[_0x950f('0x2a')]);_0x1c3ecb[_0x950f('0x33')]=_['keys'](_0x2e9cc7[_0x950f('0x33')]);_0x1c3ecb[_0x950f('0x34')]=_['intersection'](_0x1c3ecb['model'],_0x1c3ecb[_0x950f('0x33')]);_0x3b3187[_0x950f('0x35')]=_['intersection'](_0x1c3ecb[_0x950f('0x31')],qs[_0x950f('0x36')](_0x2e9cc7[_0x950f('0x33')]['fields']));_0x3b3187[_0x950f('0x35')]=_0x3b3187[_0x950f('0x35')]['length']?_0x3b3187[_0x950f('0x35')]:_0x1c3ecb['model'];if(!_0x2e9cc7[_0x950f('0x33')]['hasOwnProperty'](_0x950f('0x37'))){_0x3b3187[_0x950f('0x1f')]=qs[_0x950f('0x1f')](_0x2e9cc7[_0x950f('0x33')][_0x950f('0x1f')]);_0x3b3187[_0x950f('0x21')]=qs[_0x950f('0x21')](_0x2e9cc7['query'][_0x950f('0x21')]);}_0x3b3187[_0x950f('0x38')]=qs[_0x950f('0x39')](_0x2e9cc7[_0x950f('0x33')]['sort']);_0x3b3187[_0x950f('0x3a')]=qs[_0x950f('0x34')](_[_0x950f('0x3b')](_0x2e9cc7['query'],_0x1c3ecb[_0x950f('0x34')]),_0x3ff710);if(_0x2e9cc7['query'][_0x950f('0x3c')]){_0x3b3187[_0x950f('0x3a')]=_[_0x950f('0x3d')](_0x3b3187[_0x950f('0x3a')],{'$or':_[_0x950f('0x2c')](_0x3ff710,function(_0x45eef0){if(_0x45eef0[_0x950f('0x3e')]!==_0x950f('0x3f')){var _0x2da6cb={};_0x2da6cb[_0x45eef0[_0x950f('0x2a')]]={'$like':'%'+_0x2e9cc7[_0x950f('0x33')][_0x950f('0x3c')]+'%'};return _0x2da6cb;}})});}_0x3b3187=_[_0x950f('0x3d')]({},_0x3b3187,_0x2e9cc7[_0x950f('0x40')]);var _0x3e654b={'where':_0x3b3187[_0x950f('0x3a')]};return db[_0x950f('0x2d')]['count'](_0x3e654b)[_0x950f('0x28')](function(_0x13990c){_0x5891cc[_0x950f('0x20')]=_0x13990c;if(_0x2e9cc7['query'][_0x950f('0x41')]){_0x3b3187[_0x950f('0x42')]=[{'all':!![]}];}return db[_0x950f('0x2d')]['findAll'](_0x3b3187);})['then'](function(_0x31ae31){_0x5891cc['rows']=_0x31ae31;return _0x5891cc;})[_0x950f('0x28')](respondWithFilteredResult(_0x4a1130,_0x3b3187))[_0x950f('0x43')](handleError(_0x4a1130,null));};exports[_0x950f('0x44')]=function(_0x44d117,_0x384b83){var _0x1d1227={'raw':!![],'where':{'id':_0x44d117[_0x950f('0x45')]['id']}},_0x4d4287={};_0x4d4287[_0x950f('0x31')]=_[_0x950f('0x46')](db['CmCustomField'][_0x950f('0x2e')]);_0x4d4287[_0x950f('0x33')]=_['keys'](_0x44d117[_0x950f('0x33')]);_0x4d4287[_0x950f('0x34')]=_['intersection'](_0x4d4287[_0x950f('0x31')],_0x4d4287[_0x950f('0x33')]);_0x1d1227['attributes']=_[_0x950f('0x47')](_0x4d4287[_0x950f('0x31')],qs['fields'](_0x44d117[_0x950f('0x33')]['fields']));_0x1d1227[_0x950f('0x35')]=_0x1d1227[_0x950f('0x35')][_0x950f('0x48')]?_0x1d1227['attributes']:_0x4d4287[_0x950f('0x31')];if(_0x44d117['query'][_0x950f('0x41')]){_0x1d1227['include']=[{'all':!![]}];}_0x1d1227=_[_0x950f('0x3d')]({},_0x1d1227,_0x44d117[_0x950f('0x40')]);return db[_0x950f('0x2d')][_0x950f('0x49')](_0x1d1227)['then'](handleEntityNotFound(_0x384b83,null))[_0x950f('0x28')](respondWithResult(_0x384b83,null))[_0x950f('0x43')](handleError(_0x384b83,null));};exports['update']=function(_0x96f350,_0x523d5b){if(_0x96f350[_0x950f('0x4a')]['id']){delete _0x96f350[_0x950f('0x4a')]['id'];}return db[_0x950f('0x2d')][_0x950f('0x49')]({'where':{'id':_0x96f350[_0x950f('0x45')]['id']}})[_0x950f('0x28')](handleEntityNotFound(_0x523d5b,null))[_0x950f('0x28')](saveUpdates(_0x96f350[_0x950f('0x4a')],null))['then'](respondWithResult(_0x523d5b,null))[_0x950f('0x43')](handleError(_0x523d5b,null));};exports[_0x950f('0x29')]=function(_0x15cf32,_0x4009dc){return db['CmCustomField'][_0x950f('0x49')]({'where':{'id':_0x15cf32[_0x950f('0x45')]['id']}})[_0x950f('0x28')](handleEntityNotFound(_0x4009dc,null))[_0x950f('0x28')](removeEntity(_0x4009dc,null))[_0x950f('0x43')](handleError(_0x4009dc,null));};exports['create']=function(_0x11c19e,_0x16e97d){var _0x1b5cbc;return db[_0x950f('0x4b')][_0x950f('0x4c')](function(_0x44330a){return db[_0x950f('0x2d')]['create'](_0x11c19e[_0x950f('0x4a')],{'transaction':_0x44330a})[_0x950f('0x28')](function(_0x197a33){_0x1b5cbc=_0x197a33;var _0x32f9ae={'type':db[_0x950f('0x4d')][_0x950f('0x4e')],'transaction':_0x44330a};switch(_0x11c19e[_0x950f('0x4a')]['type']){case _0x950f('0x4f'):_0x32f9ae[_0x950f('0x3e')]=db[_0x950f('0x4d')][_0x950f('0x4e')];break;case _0x950f('0x50'):_0x32f9ae[_0x950f('0x3e')]=db[_0x950f('0x4d')][_0x950f('0x51')];break;case _0x950f('0x52'):_0x32f9ae[_0x950f('0x3e')]=db[_0x950f('0x4d')][_0x950f('0x53')];_0x32f9ae[_0x950f('0x54')]=![];break;default:}return db[_0x950f('0x4b')]['queryInterface'][_0x950f('0x55')](_0x950f('0x56'),util[_0x950f('0x57')](_0x950f('0x58'),_0x1b5cbc['id']),_0x32f9ae);})[_0x950f('0x28')](function(){return _0x1b5cbc;});})[_0x950f('0x28')](respondWithResult(_0x16e97d,0xc9))[_0x950f('0x43')](handleError(_0x16e97d,null));}; \ No newline at end of file +var _0x1621=['update','body','sequelize','create','TEXT','type','text','number','Sequelize','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','map','CmCustomField','rawAttributes','fieldName','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0x1621,0x66));var _0x1162=function(_0x55e659,_0x233aa4){_0x55e659=_0x55e659-0x0;var _0xca08c7=_0x1621[_0x55e659];return _0xca08c7;};'use strict';var emlformat=require(_0x1162('0x0'));var rimraf=require(_0x1162('0x1'));var zipdir=require(_0x1162('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1162('0x3'));var moment=require(_0x1162('0x4'));var BPromise=require(_0x1162('0x5'));var Mustache=require(_0x1162('0x6'));var util=require(_0x1162('0x7'));var path=require(_0x1162('0x8'));var sox=require(_0x1162('0x9'));var csv=require(_0x1162('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1162('0xb'));var _=require(_0x1162('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1162('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1162('0xe'));var Papa=require('papaparse');var Redis=require(_0x1162('0xf'));var authService=require(_0x1162('0x10'));var qs=require(_0x1162('0x11'));var as=require(_0x1162('0x12'));var hardwareService=require(_0x1162('0x13'));var logger=require(_0x1162('0x14'))(_0x1162('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1162('0x16'));var db=require(_0x1162('0x17'))['db'];function respondWithStatusCode(_0x564ae4,_0x5011a5){_0x5011a5=_0x5011a5||0xcc;return function(_0x99ab3b){if(_0x99ab3b){return _0x564ae4['sendStatus'](_0x5011a5);}return _0x564ae4['status'](_0x5011a5)[_0x1162('0x18')]();};}function respondWithResult(_0xc70fa3,_0x5d9088){_0x5d9088=_0x5d9088||0xc8;return function(_0x1fc0d3){if(_0x1fc0d3){return _0xc70fa3[_0x1162('0x19')](_0x5d9088)['json'](_0x1fc0d3);}};}function respondWithFilteredResult(_0x342096,_0x2459e7){return function(_0x44a9dc){if(_0x44a9dc){var _0x112c66=typeof _0x2459e7[_0x1162('0x1a')]==='undefined'&&typeof _0x2459e7['limit']===_0x1162('0x1b');var _0x10d4da=_0x44a9dc['count'];var _0x3c808d=_0x112c66?0x0:_0x2459e7['offset'];var _0x32032b=_0x112c66?_0x44a9dc[_0x1162('0x1c')]:_0x2459e7[_0x1162('0x1a')]+_0x2459e7[_0x1162('0x1d')];var _0x441913;if(_0x32032b>=_0x10d4da){_0x32032b=_0x10d4da;_0x441913=0xc8;}else{_0x441913=0xce;}_0x342096[_0x1162('0x19')](_0x441913);return _0x342096[_0x1162('0x1e')]('Content-Range',_0x3c808d+'-'+_0x32032b+'/'+_0x10d4da)[_0x1162('0x1f')](_0x44a9dc);}return null;};}function patchUpdates(_0x14d4d3){return function(_0x3e7ae9){try{jsonpatch[_0x1162('0x20')](_0x3e7ae9,_0x14d4d3,!![]);}catch(_0x4497c2){return BPromise[_0x1162('0x21')](_0x4497c2);}return _0x3e7ae9[_0x1162('0x22')]();};}function saveUpdates(_0x527fb5,_0x59397e){return function(_0x188687){if(_0x188687){return _0x188687['update'](_0x527fb5)[_0x1162('0x23')](function(_0x49ce00){return _0x49ce00;});}return null;};}function removeEntity(_0x4ea9b5,_0x3053ba){return function(_0x1633e9){if(_0x1633e9){return _0x1633e9[_0x1162('0x24')]()[_0x1162('0x23')](function(){_0x4ea9b5['status'](0xcc)[_0x1162('0x18')]();});}};}function handleEntityNotFound(_0x115d46,_0x3d7b8e){return function(_0x58777e){if(!_0x58777e){_0x115d46[_0x1162('0x25')](0x194);}return _0x58777e;};}function handleError(_0xc19df4,_0x5ed8f5){_0x5ed8f5=_0x5ed8f5||0x1f4;return function(_0x3df281){logger['error'](_0x3df281[_0x1162('0x26')]);if(_0x3df281[_0x1162('0x27')]){delete _0x3df281[_0x1162('0x27')];}_0xc19df4['status'](_0x5ed8f5)[_0x1162('0x28')](_0x3df281);};}exports['index']=function(_0x8c3bba,_0x1d090b){var _0x6f87e9={},_0x5bf9f8={},_0x3d47f7={'count':0x0,'rows':[]};var _0x1075df=_[_0x1162('0x29')](db[_0x1162('0x2a')][_0x1162('0x2b')],function(_0x14d2ca){return{'name':_0x14d2ca[_0x1162('0x2c')],'type':_0x14d2ca['type'][_0x1162('0x2d')]};});_0x5bf9f8['model']=_[_0x1162('0x2e')](_[_0x1162('0x29')](_0x1075df,_0x1162('0x27')),[_0x1162('0x27')]);_0x5bf9f8[_0x1162('0x2f')]=_[_0x1162('0x30')](_0x8c3bba[_0x1162('0x2f')]);_0x5bf9f8[_0x1162('0x31')]=_[_0x1162('0x32')](_0x5bf9f8[_0x1162('0x33')],_0x5bf9f8['query']);_0x6f87e9[_0x1162('0x34')]=_[_0x1162('0x32')](_0x5bf9f8['model'],qs[_0x1162('0x35')](_0x8c3bba[_0x1162('0x2f')][_0x1162('0x35')]));_0x6f87e9[_0x1162('0x34')]=_0x6f87e9['attributes'][_0x1162('0x36')]?_0x6f87e9[_0x1162('0x34')]:_0x5bf9f8['model'];if(!_0x8c3bba[_0x1162('0x2f')][_0x1162('0x37')](_0x1162('0x38'))){_0x6f87e9[_0x1162('0x1d')]=qs['limit'](_0x8c3bba[_0x1162('0x2f')]['limit']);_0x6f87e9[_0x1162('0x1a')]=qs[_0x1162('0x1a')](_0x8c3bba['query'][_0x1162('0x1a')]);}_0x6f87e9[_0x1162('0x39')]=qs[_0x1162('0x3a')](_0x8c3bba[_0x1162('0x2f')]['sort']);_0x6f87e9[_0x1162('0x3b')]=qs[_0x1162('0x31')](_['pick'](_0x8c3bba['query'],_0x5bf9f8['filters']),_0x1075df);if(_0x8c3bba[_0x1162('0x2f')]['filter']){_0x6f87e9[_0x1162('0x3b')]=_[_0x1162('0x3c')](_0x6f87e9[_0x1162('0x3b')],{'$or':_[_0x1162('0x29')](_0x1075df,function(_0x53bceb){if(_0x53bceb['type']!==_0x1162('0x3d')){var _0x58f936={};_0x58f936[_0x53bceb[_0x1162('0x27')]]={'$like':'%'+_0x8c3bba[_0x1162('0x2f')]['filter']+'%'};return _0x58f936;}})});}_0x6f87e9=_['merge']({},_0x6f87e9,_0x8c3bba['options']);var _0xf1da04={'where':_0x6f87e9[_0x1162('0x3b')]};return db[_0x1162('0x2a')][_0x1162('0x1c')](_0xf1da04)[_0x1162('0x23')](function(_0x5add22){_0x3d47f7[_0x1162('0x1c')]=_0x5add22;if(_0x8c3bba[_0x1162('0x2f')][_0x1162('0x3e')]){_0x6f87e9[_0x1162('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x1162('0x40')](_0x6f87e9);})[_0x1162('0x23')](function(_0x5d1433){_0x3d47f7['rows']=_0x5d1433;return _0x3d47f7;})[_0x1162('0x23')](respondWithFilteredResult(_0x1d090b,_0x6f87e9))[_0x1162('0x41')](handleError(_0x1d090b,null));};exports[_0x1162('0x42')]=function(_0x29a418,_0x594d7a){var _0x50d2e5={'raw':!![],'where':{'id':_0x29a418[_0x1162('0x43')]['id']}},_0x509a98={};_0x509a98['model']=_[_0x1162('0x30')](db[_0x1162('0x2a')][_0x1162('0x2b')]);_0x509a98[_0x1162('0x2f')]=_[_0x1162('0x30')](_0x29a418[_0x1162('0x2f')]);_0x509a98['filters']=_['intersection'](_0x509a98[_0x1162('0x33')],_0x509a98[_0x1162('0x2f')]);_0x50d2e5[_0x1162('0x34')]=_[_0x1162('0x32')](_0x509a98[_0x1162('0x33')],qs[_0x1162('0x35')](_0x29a418['query']['fields']));_0x50d2e5[_0x1162('0x34')]=_0x50d2e5[_0x1162('0x34')][_0x1162('0x36')]?_0x50d2e5['attributes']:_0x509a98[_0x1162('0x33')];if(_0x29a418[_0x1162('0x2f')][_0x1162('0x3e')]){_0x50d2e5[_0x1162('0x3f')]=[{'all':!![]}];}_0x50d2e5=_['merge']({},_0x50d2e5,_0x29a418[_0x1162('0x44')]);return db[_0x1162('0x2a')][_0x1162('0x45')](_0x50d2e5)[_0x1162('0x23')](handleEntityNotFound(_0x594d7a,null))[_0x1162('0x23')](respondWithResult(_0x594d7a,null))[_0x1162('0x41')](handleError(_0x594d7a,null));};exports[_0x1162('0x46')]=function(_0xe5d486,_0x3b52d8){if(_0xe5d486[_0x1162('0x47')]['id']){delete _0xe5d486[_0x1162('0x47')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0xe5d486[_0x1162('0x43')]['id']}})[_0x1162('0x23')](handleEntityNotFound(_0x3b52d8,null))[_0x1162('0x23')](saveUpdates(_0xe5d486[_0x1162('0x47')],null))['then'](respondWithResult(_0x3b52d8,null))[_0x1162('0x41')](handleError(_0x3b52d8,null));};exports[_0x1162('0x24')]=function(_0x157835,_0x2e20e6){return db['CmCustomField'][_0x1162('0x45')]({'where':{'id':_0x157835['params']['id']}})[_0x1162('0x23')](handleEntityNotFound(_0x2e20e6,null))[_0x1162('0x23')](removeEntity(_0x2e20e6,null))[_0x1162('0x41')](handleError(_0x2e20e6,null));};exports['create']=function(_0x4629be,_0x57c5c2){var _0x194664;return db[_0x1162('0x48')]['transaction'](function(_0x42ec56){return db[_0x1162('0x2a')][_0x1162('0x49')](_0x4629be[_0x1162('0x47')],{'transaction':_0x42ec56})[_0x1162('0x23')](function(_0x308998){_0x194664=_0x308998;var _0x395e43={'type':db['Sequelize'][_0x1162('0x4a')],'transaction':_0x42ec56};switch(_0x4629be['body'][_0x1162('0x4b')]){case _0x1162('0x4c'):_0x395e43[_0x1162('0x4b')]=db['Sequelize'][_0x1162('0x4a')];break;case _0x1162('0x4d'):_0x395e43[_0x1162('0x4b')]=db[_0x1162('0x4e')]['INTEGER'];break;case'switch':_0x395e43[_0x1162('0x4b')]=db[_0x1162('0x4e')][_0x1162('0x4f')];_0x395e43[_0x1162('0x50')]=![];break;default:}return db['sequelize'][_0x1162('0x51')][_0x1162('0x52')](_0x1162('0x53'),util[_0x1162('0x54')](_0x1162('0x55'),_0x194664['id']),_0x395e43);})[_0x1162('0x23')](function(){return _0x194664;});})[_0x1162('0x23')](respondWithResult(_0x57c5c2,0xc9))[_0x1162('0x41')](handleError(_0x57c5c2,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 739582b..4933bc5 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 _0x04f6=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','cm_custom_fields'];(function(_0x4e4452,_0x5bd6e6){var _0x1ab883=function(_0x22f71d){while(--_0x22f71d){_0x4e4452['push'](_0x4e4452['shift']());}};_0x1ab883(++_0x5bd6e6);}(_0x04f6,0xaa));var _0x604f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x04f6[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x604f('0x0'));var util=require(_0x604f('0x1'));var logger=require('../../config/logger')(_0x604f('0x2'));var moment=require(_0x604f('0x3'));var BPromise=require('bluebird');var rp=require(_0x604f('0x4'));var fs=require('fs');var path=require(_0x604f('0x5'));var rimraf=require(_0x604f('0x6'));var config=require(_0x604f('0x7'));var attributes=require('./cmCustomField.attributes');module[_0x604f('0x8')]=function(_0x1811ec,_0x5f048b){return _0x1811ec['define']('CmCustomField',attributes,{'tableName':_0x604f('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05b7=['./cmCustomField.attributes','exports','define','CmCustomField','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3e5129,_0x4e43d0){var _0x52d6ed=function(_0x22c0a3){while(--_0x22c0a3){_0x3e5129['push'](_0x3e5129['shift']());}};_0x52d6ed(++_0x4e43d0);}(_0x05b7,0x13a));var _0x705b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x05b7[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require(_0x705b('0x0'));var logger=require(_0x705b('0x1'))('api');var moment=require(_0x705b('0x2'));var BPromise=require(_0x705b('0x3'));var rp=require(_0x705b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x705b('0x5'));var config=require('../../config/environment');var attributes=require(_0x705b('0x6'));module[_0x705b('0x7')]=function(_0x2bcf72,_0x2c3939){return _0x2bcf72[_0x705b('0x8')](_0x705b('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 1d9b01a..a733f7f 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 _0xb5b9=['request','info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x3d71ba,_0x49a38b){var _0x5e0ed0=function(_0x4d0bfb){while(--_0x4d0bfb){_0x3d71ba['push'](_0x3d71ba['shift']());}};_0x5e0ed0(++_0x49a38b);}(_0xb5b9,0x19a));var _0x9b5b=function(_0x2055d1,_0x47d031){_0x2055d1=_0x2055d1-0x0;var _0x5bf250=_0xb5b9[_0x2055d1];return _0x5bf250;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9b5b('0x0'));var rs=require(_0x9b5b('0x1'));var fs=require('fs');var Redis=require(_0x9b5b('0x2'));var db=require(_0x9b5b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b5b('0x4'))('rpc');var config=require(_0x9b5b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9b5b('0x6')][_0x9b5b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x388267,_0x17d2bb,_0x2b47e1){return new BPromise(function(_0x259b37,_0x2eda21){return client[_0x9b5b('0x8')](_0x388267,_0x2b47e1)['then'](function(_0xb7e5f3){logger[_0x9b5b('0x9')]('CmCustomField,\x20%s,\x20%s',_0x17d2bb,'request\x20sent');logger[_0x9b5b('0xa')](_0x9b5b('0xb'),_0x17d2bb,_0x9b5b('0xc'),JSON[_0x9b5b('0xd')](_0xb7e5f3));if(_0xb7e5f3[_0x9b5b('0xe')]){if(_0xb7e5f3[_0x9b5b('0xe')][_0x9b5b('0xf')]===0x1f4){logger[_0x9b5b('0xe')](_0x9b5b('0x10'),_0x17d2bb,_0xb7e5f3[_0x9b5b('0xe')][_0x9b5b('0x11')]);return _0x2eda21(_0xb7e5f3['error'][_0x9b5b('0x11')]);}logger[_0x9b5b('0xe')]('CmCustomField,\x20%s,\x20%s',_0x17d2bb,_0xb7e5f3['error'][_0x9b5b('0x11')]);return _0x259b37(_0xb7e5f3[_0x9b5b('0xe')][_0x9b5b('0x11')]);}else{logger[_0x9b5b('0x9')](_0x9b5b('0x10'),_0x17d2bb,_0x9b5b('0xc'));_0x259b37(_0xb7e5f3['result'][_0x9b5b('0x11')]);}})[_0x9b5b('0x12')](function(_0x3f927e){logger[_0x9b5b('0xe')]('CmCustomField,\x20%s,\x20%s',_0x17d2bb,_0x3f927e);_0x2eda21(_0x3f927e);});});} \ No newline at end of file +var _0xa52d=['client','request','CmCustomField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3cba1d,_0x2825ae){var _0x5f192b=function(_0x32ff5d){while(--_0x32ff5d){_0x3cba1d['push'](_0x3cba1d['shift']());}};_0x5f192b(++_0x2825ae);}(_0xa52d,0x14a));var _0xda52=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xa52d[_0x16629d];return _0x56ccee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xda52('0x0'));var BPromise=require(_0xda52('0x1'));var rs=require(_0xda52('0x2'));var fs=require('fs');var Redis=require(_0xda52('0x3'));var db=require(_0xda52('0x4'))['db'];var utils=require(_0xda52('0x5'));var logger=require(_0xda52('0x6'))(_0xda52('0x7'));var config=require(_0xda52('0x8'));var jayson=require(_0xda52('0x9'));var client=jayson[_0xda52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c3621,_0xe31e7e,_0x380bcf){return new BPromise(function(_0xf8f3ad,_0x429c1c){return client[_0xda52('0xb')](_0x1c3621,_0x380bcf)['then'](function(_0x376730){logger['info'](_0xda52('0xc'),_0xe31e7e,_0xda52('0xd'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0xe31e7e,_0xda52('0xd'),JSON[_0xda52('0xe')](_0x376730));if(_0x376730['error']){if(_0x376730[_0xda52('0xf')][_0xda52('0x10')]===0x1f4){logger[_0xda52('0xf')](_0xda52('0xc'),_0xe31e7e,_0x376730['error'][_0xda52('0x11')]);return _0x429c1c(_0x376730[_0xda52('0xf')][_0xda52('0x11')]);}logger[_0xda52('0xf')](_0xda52('0xc'),_0xe31e7e,_0x376730[_0xda52('0xf')][_0xda52('0x11')]);return _0xf8f3ad(_0x376730[_0xda52('0xf')]['message']);}else{logger[_0xda52('0x12')](_0xda52('0xc'),_0xe31e7e,'request\x20sent');_0xf8f3ad(_0x376730[_0xda52('0x13')][_0xda52('0x11')]);}})['catch'](function(_0x40fa2c){logger['error'](_0xda52('0xc'),_0xe31e7e,_0x40fa2c);_0x429c1c(_0x40fa2c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e2d8fc2..f197b2a 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 _0x58f4=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1b2819,_0x4daf00){var _0x2feef1=function(_0x1cd6e8){while(--_0x1cd6e8){_0x1b2819['push'](_0x1b2819['shift']());}};_0x2feef1(++_0x4daf00);}(_0x58f4,0x1b2));var _0x458f=function(_0x216836,_0x1843f1){_0x216836=_0x216836-0x0;var _0x33bd23=_0x58f4[_0x216836];return _0x33bd23;};'use strict';var multer=require('multer');var util=require(_0x458f('0x0'));var path=require(_0x458f('0x1'));var timeout=require(_0x458f('0x2'));var express=require(_0x458f('0x3'));var router=express[_0x458f('0x4')]();var fs_extra=require(_0x458f('0x5'));var auth=require(_0x458f('0x6'));var interaction=require(_0x458f('0x7'));var config=require(_0x458f('0x8'));var controller=require(_0x458f('0x9'));router[_0x458f('0xa')]('/',auth[_0x458f('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x458f('0xc')]);router[_0x458f('0xd')]('/',auth['isAuthenticated'](),controller[_0x458f('0xe')]);router[_0x458f('0xf')](_0x458f('0x10'),auth[_0x458f('0xb')](),controller[_0x458f('0x11')]);router[_0x458f('0x12')](_0x458f('0x10'),auth['isAuthenticated'](),controller[_0x458f('0x13')]);module[_0x458f('0x14')]=router; \ No newline at end of file +var _0xf8b2=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCustomField.controller','get'];(function(_0x49fa3f,_0x1b2060){var _0x45c4a9=function(_0xea643){while(--_0xea643){_0x49fa3f['push'](_0x49fa3f['shift']());}};_0x45c4a9(++_0x1b2060);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x49da2b,_0x334638){_0x49da2b=_0x49da2b-0x0;var _0x596f12=_0xf8b2[_0x49da2b];return _0x596f12;};'use strict';var multer=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var path=require(_0x2f8b('0x2'));var timeout=require(_0x2f8b('0x3'));var express=require(_0x2f8b('0x4'));var router=express[_0x2f8b('0x5')]();var fs_extra=require(_0x2f8b('0x6'));var auth=require(_0x2f8b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f8b('0x8'));router[_0x2f8b('0x9')]('/',auth[_0x2f8b('0xa')](),controller[_0x2f8b('0xb')]);router[_0x2f8b('0x9')](_0x2f8b('0xc'),auth[_0x2f8b('0xa')](),controller[_0x2f8b('0xd')]);router[_0x2f8b('0xe')]('/',auth['isAuthenticated'](),controller[_0x2f8b('0xf')]);router[_0x2f8b('0x10')](_0x2f8b('0xc'),auth['isAuthenticated'](),controller[_0x2f8b('0x11')]);router[_0x2f8b('0x12')](_0x2f8b('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2f8b('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 08e106a..b62c7c6 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 _0x43cb=['contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED'];(function(_0x8fa90e,_0x4ee79e){var _0xfe1542=function(_0x4ae257){while(--_0x4ae257){_0x8fa90e['push'](_0x8fa90e['shift']());}};_0xfe1542(++_0x4ee79e);}(_0x43cb,0x7f));var _0xb43c=function(_0x9d9558,_0x35c6fc){_0x9d9558=_0x9d9558-0x0;var _0x3f2690=_0x43cb[_0x9d9558];return _0x3f2690;};'use strict';var moment=require(_0xb43c('0x0'));var Sequelize=require('sequelize');module[_0xb43c('0x1')]={'phone':{'type':Sequelize[_0xb43c('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xb43c('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb43c('0x4')],'defaultValue':moment()[_0xb43c('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb43c('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb43c('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb43c('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb43c('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb43c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xb43c('0x6')](0x2)[_0xb43c('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb43c('0x6')],'unique':_0xb43c('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xb43c('0x6')],'unique':_0xb43c('0x8')},'CampaignId':{'type':Sequelize[_0xb43c('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb43c('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb43c('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb43c('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb43c('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb43c('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb43c('0x2')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x60f5=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x60f5,0x1a8));var _0x560f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x60f5[_0x3bf83f];return _0x22c4a9;};'use strict';var moment=require(_0x560f('0x0'));var Sequelize=require(_0x560f('0x1'));module['exports']={'phone':{'type':Sequelize[_0x560f('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x560f('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x560f('0x4')],'defaultValue':moment()[_0x560f('0x5')](_0x560f('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x560f('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x560f('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x560f('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x560f('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x560f('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x560f('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x560f('0x9')},'ListId':{'type':Sequelize[_0x560f('0x7')],'unique':_0x560f('0x9')},'UserId':{'type':Sequelize[_0x560f('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x560f('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x560f('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x560f('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x560f('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x560f('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x560f('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x560f('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x560f('0x4')],'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 6284b73..cab66a7 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 _0x06f4=['CmHopperFinal','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','length','sequelize','transaction','direction','prev','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','Contact','Company','CmList','List','VoiceQueue','Queue','dialActive','LOCK','CmCompany','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','timezones','push','utcOffset','getTimezone','moment','lodash','../../config/logger','api','status','json','offset','undefined','limit','count','set','update','then','sendStatus','error','name','index','map','CmHopper','fieldName','key','query','intersection','model','concat','$and','$or','$gt','$gte','$lt','$eq','$between','$notBetween','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','find','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally'];(function(_0x5610de,_0x17f07a){var _0x9a3887=function(_0x4837a7){while(--_0x4837a7){_0x5610de['push'](_0x5610de['shift']());}};_0x9a3887(++_0x17f07a);}(_0x06f4,0x136));var _0x406f=function(_0x4f9690,_0x4cf1e0){_0x4f9690=_0x4f9690-0x0;var _0x2f39a3=_0x06f4[_0x4f9690];return _0x2f39a3;};'use strict';var moment=require(_0x406f('0x0'));var _=require(_0x406f('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x406f('0x2'))(_0x406f('0x3'));var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0x3a4ff0,_0x5ed32f){_0x5ed32f=_0x5ed32f||0xc8;return function(_0x32abfd){if(_0x32abfd){return _0x3a4ff0[_0x406f('0x4')](_0x5ed32f)[_0x406f('0x5')](_0x32abfd);}};}function respondWithFilteredResult(_0x32b2bd,_0x59821c){return function(_0x1d2886){if(_0x1d2886){var _0x5bec4f=typeof _0x59821c[_0x406f('0x6')]===_0x406f('0x7')&&typeof _0x59821c[_0x406f('0x8')]==='undefined';var _0x407936=_0x1d2886['count'];var _0x5b46bf=_0x5bec4f?0x0:_0x59821c[_0x406f('0x6')];var _0x56edc2=_0x5bec4f?_0x1d2886[_0x406f('0x9')]:_0x59821c['offset']+_0x59821c[_0x406f('0x8')];var _0x5af7cd;if(_0x56edc2>=_0x407936){_0x56edc2=_0x407936;_0x5af7cd=0xc8;}else{_0x5af7cd=0xce;}_0x32b2bd[_0x406f('0x4')](_0x5af7cd);return _0x32b2bd[_0x406f('0xa')]('Content-Range',_0x5b46bf+'-'+_0x56edc2+'/'+_0x407936)[_0x406f('0x5')](_0x1d2886);}return null;};}function saveUpdates(_0x380382,_0x451592){return function(_0x163de4){if(_0x163de4){return _0x163de4[_0x406f('0xb')](_0x380382)[_0x406f('0xc')](function(_0x29aef9){return _0x29aef9;});}return null;};}function handleEntityNotFound(_0xcc1d6,_0x4522b2){return function(_0x5045e8){if(!_0x5045e8){_0xcc1d6[_0x406f('0xd')](0x194);}return _0x5045e8;};}function handleError(_0x489445,_0x1bf795){_0x1bf795=_0x1bf795||0x1f4;return function(_0x28fda6){logger[_0x406f('0xe')](_0x28fda6['stack']);if(_0x28fda6[_0x406f('0xf')]){delete _0x28fda6[_0x406f('0xf')];}_0x489445['status'](_0x1bf795)['send'](_0x28fda6);};}exports[_0x406f('0x10')]=function(_0x4357e3,_0x509bae){var _0x2e4409={},_0x57d93a={},_0xe186fb={'count':0x0,'rows':[]};var _0x3ad3fe=_[_0x406f('0x11')](db[_0x406f('0x12')]['rawAttributes'],function(_0x492c68){return{'name':_0x492c68[_0x406f('0x13')],'type':_0x492c68['type'][_0x406f('0x14')]};});_0x57d93a['model']=_[_0x406f('0x11')](_0x3ad3fe,_0x406f('0xf'));_0x57d93a[_0x406f('0x15')]=_['keys'](_0x4357e3['query']);_0x57d93a['filters']=_[_0x406f('0x16')](_0x57d93a[_0x406f('0x17')],_0x57d93a[_0x406f('0x15')]);_0x57d93a['filters']=_[_0x406f('0x18')](_0x57d93a['filters'],[_0x406f('0x19'),_0x406f('0x1a'),_0x406f('0x1b'),_0x406f('0x1c'),_0x406f('0x1d'),'$lte','$ne',_0x406f('0x1e'),'$not',_0x406f('0x1f'),_0x406f('0x20'),'$in','$notIn',_0x406f('0x21'),'$notLike',_0x406f('0x22'),_0x406f('0x23'),_0x406f('0x21'),_0x406f('0x24'),_0x406f('0x25'),_0x406f('0x26'),_0x406f('0x27')]);_0x2e4409[_0x406f('0x28')]=_['intersection'](_0x57d93a['model'],qs[_0x406f('0x29')](_0x4357e3[_0x406f('0x15')][_0x406f('0x29')]));_0x2e4409[_0x406f('0x28')]=_0x2e4409['attributes']['length']?_0x2e4409[_0x406f('0x28')]:_0x57d93a[_0x406f('0x17')];if(!_0x4357e3['query']['hasOwnProperty'](_0x406f('0x2a'))){_0x2e4409[_0x406f('0x8')]=qs[_0x406f('0x8')](_0x4357e3[_0x406f('0x15')][_0x406f('0x8')]);_0x2e4409[_0x406f('0x6')]=qs[_0x406f('0x6')](_0x4357e3[_0x406f('0x15')][_0x406f('0x6')]);}_0x2e4409[_0x406f('0x2b')]=qs[_0x406f('0x2c')](_0x4357e3[_0x406f('0x15')][_0x406f('0x2c')]);_0x2e4409['where']=qs[_0x406f('0x2d')](_[_0x406f('0x2e')](_0x4357e3[_0x406f('0x15')],_0x57d93a[_0x406f('0x2d')]),_0x3ad3fe);if(_0x4357e3[_0x406f('0x15')][_0x406f('0x2f')]){_0x2e4409[_0x406f('0x30')]=_[_0x406f('0x31')](_0x2e4409[_0x406f('0x30')],{'$or':_[_0x406f('0x11')](_0x3ad3fe,function(_0x52b465){if(_0x52b465[_0x406f('0x32')]!==_0x406f('0x33')){var _0x36a17a={};_0x36a17a[_0x52b465[_0x406f('0xf')]]={'$like':'%'+_0x4357e3[_0x406f('0x15')][_0x406f('0x2f')]+'%'};return _0x36a17a;}})});}_0x2e4409=_['merge']({},_0x2e4409,_0x4357e3['options']);var _0x44c63a={'where':_0x2e4409[_0x406f('0x30')]};return db['CmHopper'][_0x406f('0x9')](_0x44c63a)['then'](function(_0x43fb4f){_0xe186fb[_0x406f('0x9')]=_0x43fb4f;if(_0x4357e3[_0x406f('0x15')]['includeAll']){_0x2e4409[_0x406f('0x34')]=[{'all':!![]}];}return db[_0x406f('0x12')][_0x406f('0x35')](_0x2e4409);})[_0x406f('0xc')](function(_0x224e9d){_0xe186fb[_0x406f('0x36')]=_0x224e9d;return _0xe186fb;})[_0x406f('0xc')](respondWithFilteredResult(_0x509bae,_0x2e4409))[_0x406f('0x37')](handleError(_0x509bae,null));};exports[_0x406f('0x38')]=function(_0x14c27f,_0x17f217){var _0x37c4d2={'raw':!![],'where':{'id':_0x14c27f[_0x406f('0x39')]['id']}},_0x279e9e={};_0x279e9e[_0x406f('0x17')]=_['keys'](db['CmHopper']['rawAttributes']);_0x279e9e[_0x406f('0x15')]=_[_0x406f('0x3a')](_0x14c27f[_0x406f('0x15')]);_0x279e9e['filters']=_[_0x406f('0x16')](_0x279e9e[_0x406f('0x17')],_0x279e9e[_0x406f('0x15')]);_0x37c4d2[_0x406f('0x28')]=_[_0x406f('0x16')](_0x279e9e[_0x406f('0x17')],qs['fields'](_0x14c27f[_0x406f('0x15')][_0x406f('0x29')]));_0x37c4d2['attributes']=_0x37c4d2[_0x406f('0x28')]['length']?_0x37c4d2['attributes']:_0x279e9e[_0x406f('0x17')];if(_0x14c27f[_0x406f('0x15')][_0x406f('0x3b')]){_0x37c4d2[_0x406f('0x34')]=[{'all':!![]}];}_0x37c4d2=_[_0x406f('0x31')]({},_0x37c4d2,_0x14c27f[_0x406f('0x3c')]);return db['CmHopper']['find'](_0x37c4d2)[_0x406f('0xc')](handleEntityNotFound(_0x17f217,null))[_0x406f('0xc')](respondWithResult(_0x17f217,null))[_0x406f('0x37')](handleError(_0x17f217,null));};exports[_0x406f('0x3d')]=function(_0x453289,_0x2b226e){return db[_0x406f('0x12')]['create'](_0x453289[_0x406f('0x3e')],{})[_0x406f('0xc')](respondWithResult(_0x2b226e,0xc9))[_0x406f('0x37')](handleError(_0x2b226e,null));};exports[_0x406f('0xb')]=function(_0x792ac9,_0x17c499){if(_0x792ac9[_0x406f('0x3e')]['id']){delete _0x792ac9[_0x406f('0x3e')]['id'];}return db[_0x406f('0x12')][_0x406f('0x3f')]({'where':{'id':_0x792ac9[_0x406f('0x39')]['id']}})['then'](handleEntityNotFound(_0x17c499,null))[_0x406f('0xc')](saveUpdates(_0x792ac9[_0x406f('0x3e')],null))['then'](respondWithResult(_0x17c499,null))['catch'](handleError(_0x17c499,null));};exports[_0x406f('0x40')]=function(_0x3eb55b,_0x2a13c3){return db[_0x406f('0x12')]['describe']()[_0x406f('0xc')](respondWithResult(_0x2a13c3,null))['catch'](handleError(_0x2a13c3,null));};exports[_0x406f('0x41')]=function(_0x351d2f,_0x5b1143){var _0x5a91dd;var _0x1bdb59=_0x351d2f[_0x406f('0x39')]['id'];return db[_0x406f('0x12')][_0x406f('0x3f')]({'where':{'id':_0x351d2f['params']['id']}})[_0x406f('0xc')](handleEntityNotFound(_0x5b1143,null))[_0x406f('0xc')](function(_0x8ef14b){if(_0x8ef14b){return _0x8ef14b[_0x406f('0x41')]()['then'](function(_0x5d4041){return _0x5d4041;});}})[_0x406f('0xc')](function(_0x244fcf){_0x5a91dd=_0x244fcf;if(_0x244fcf){if(_0x244fcf[_0x406f('0x42')]||_0x244fcf[_0x406f('0x43')]){return db[_0x244fcf[_0x406f('0x42')]?'VoiceQueue':_0x406f('0x44')][_0x406f('0x3f')]({'where':{'id':_0x244fcf['VoiceQueueId']?_0x244fcf['VoiceQueueId']:_0x244fcf[_0x406f('0x43')]},'attributes':['id',_0x406f('0xf')],'raw':!![]});}}})[_0x406f('0xc')](function(_0x4b0b19){var _0x1a99b9={};if(_0x4b0b19){_[_0x406f('0x31')](_0x1a99b9,_[_0x406f('0x45')](_0x5a91dd[_0x406f('0x46')],[_0x406f('0x47'),_0x406f('0x48'),'id']));_0x1a99b9[_0x406f('0x49')]=0x15;_0x1a99b9[_0x406f('0x4a')]=_0x406f('0x4b');_0x1a99b9['campaign']=_0x4b0b19['name'];_0x1a99b9[_0x406f('0x4c')]=_0x351d2f[_0x406f('0x4d')][_0x406f('0xf')];_0x1a99b9[_0x406f('0x4e')]=_0x351d2f[_0x406f('0x4d')]['id'];_0x1a99b9[_0x406f('0x4b')]=!![];_0x1a99b9[_0x406f('0x4f')]=moment()[_0x406f('0x50')](_0x406f('0x51'));_0x1a99b9[_0x406f('0x52')]=_0x5a91dd['phone'];_0x1a99b9['campaigntype']=_0x5a91dd[_0x406f('0x42')]?_0x406f('0x53'):_0x406f('0x54');return db[_0x406f('0x55')][_0x406f('0x3f')]({'where':{'id':_0x1a99b9[_0x406f('0x56')]},'attributes':['firstName',_0x406f('0x57')]})[_0x406f('0xc')](function(_0x39f7f6){if(!_[_0x406f('0x58')](_0x5b1143)&&!_[_0x406f('0x58')](_0x39f7f6[_0x406f('0x59')])){_0x1a99b9[_0x406f('0x5a')]=_0x39f7f6[_0x406f('0x59')];if(!_[_0x406f('0x58')](_0x39f7f6[_0x406f('0x57')])){_0x1a99b9['calleridname']+='\x20'+_0x39f7f6[_0x406f('0x57')];}}})[_0x406f('0x5b')](function(){return db[_0x406f('0x5c')]['create'](_0x1a99b9);});}})[_0x406f('0xc')](function(_0x538517){return db['CmHopperAdditionalPhone'][_0x406f('0x41')]({'where':{'CmHopperId':_0x1bdb59}});})[_0x406f('0xc')](function(){return _0x5b1143['status'](0xcc)[_0x406f('0x5d')]();})['catch'](handleError(_0x5b1143,null));};exports[_0x406f('0x5e')]=function(_0x4a4bf8,_0x2c3881){var _0x48bca4=[];return db[_0x406f('0x55')][_0x406f('0x40')]()['then'](function(_0x5dd1e8){_0x48bca4=_[_0x406f('0x3a')](_0x5dd1e8);return _0x4a4bf8[_0x406f('0x4d')][_0x406f('0x5f')]({'where':{'type':_0x406f('0x60'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x406f('0x61'),_0x406f('0x62')],'raw':!![]});})[_0x406f('0xc')](function(_0x41839a){if(_0x41839a&&_0x41839a[_0x406f('0x63')]){return db[_0x406f('0x64')][_0x406f('0x65')](function(_0x5c1a91){var _0x44297b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x406f('0x51'))},'VoiceQueueId':{'$in':_[_0x406f('0x11')](_0x41839a,'id')},'$or':[{'UserId':null},{'UserId':_0x4a4bf8[_0x406f('0x4d')]['id']}]};var _0x55cac0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x41839a)[_0x406f('0x2f')]([_0x406f('0x62'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x4a4bf8[_0x406f('0x4d')]['id']}]};var _0x468e2b={'$or':[_0x44297b,_0x55cac0]};var _0x4a150b=[];if(_0x4a4bf8['body']['direction']&&_0x4a4bf8[_0x406f('0x3e')][_0x406f('0x66')]===_0x406f('0x67')){if(!_['isEmpty'](_0x4a4bf8['body'][_0x406f('0x68')])){_0x468e2b['id']={'$in':_0x4a4bf8[_0x406f('0x3e')][_0x406f('0x68')]};}_0x4a150b=[[_0x406f('0x69'),_0x406f('0x6a')],['scheduledAt',_0x41839a[0x0][_0x406f('0x61')]===_0x406f('0x6a')?_0x406f('0x6b'):_0x406f('0x6a')],db[_0x406f('0x64')][_0x406f('0x6c')](_0x406f('0x6d')),['id',_0x406f('0x6b')]];}else{if(!_[_0x406f('0x6e')](_0x4a4bf8[_0x406f('0x3e')][_0x406f('0x68')])){_0x468e2b['id']={'$notIn':_0x4a4bf8[_0x406f('0x3e')][_0x406f('0x68')]};}_0x4a150b=[[_0x406f('0x69'),_0x406f('0x6b')],[_0x406f('0x6f'),_0x41839a[0x0][_0x406f('0x61')]],db['sequelize'][_0x406f('0x6c')](_0x406f('0x70')),['id',_0x406f('0x6a')]];}return db['CmHopper'][_0x406f('0x71')]({'attributes':['id',_0x406f('0x72'),'phone',_0x406f('0x73')],'where':_0x468e2b,'order':_0x4a150b,'transaction':_0x5c1a91,'lock':_0x5c1a91['LOCK']['UPDATE'],'include':[{'model':db[_0x406f('0x55')],'as':_0x406f('0x74'),'attributes':_0x48bca4,'include':[{'model':db['CmCompany'],'as':_0x406f('0x75'),'attributes':['id','name']}]},{'model':db[_0x406f('0x76')],'as':_0x406f('0x77'),'attributes':['id',_0x406f('0xf')]},{'model':db[_0x406f('0x78')],'as':_0x406f('0x79'),'attributes':['id',_0x406f('0xf'),_0x406f('0x7a')]}]})[_0x406f('0xc')](function(_0x3e9e31){if(_0x3e9e31){return _0x3e9e31['update']({'UserId':_0x4a4bf8[_0x406f('0x4d')]['id']},{'transaction':_0x5c1a91});}});});}})['then'](handleEntityNotFound(_0x2c3881,null))[_0x406f('0xc')](respondWithResult(_0x2c3881,null))['catch'](handleError(_0x2c3881,null));};exports['getPreviewRecall']=function(_0x519cd9,_0x14ce45,_0x3f0e29){var _0x2bb105=[];var _0x156fa5=_0x519cd9[_0x406f('0x39')]['id'];var _0x552db1=_0x519cd9['user']['id'];return db['CmContact'][_0x406f('0x40')]()['then'](function(_0x31212a){_0x2bb105=_[_0x406f('0x3a')](_0x31212a);return db[_0x406f('0x64')][_0x406f('0x65')](function(_0x238912){const _0x1b2e3c={'id':_0x156fa5};return db['CmHopper']['findOne']({'attributes':['id',_0x406f('0x72'),_0x406f('0x73')],'where':_0x1b2e3c,'transaction':_0x238912,'lock':_0x238912[_0x406f('0x7b')]['UPDATE'],'include':[{'model':db[_0x406f('0x55')],'as':_0x406f('0x74'),'attributes':_0x2bb105,'include':[{'model':db[_0x406f('0x7c')],'as':_0x406f('0x75'),'attributes':['id',_0x406f('0xf')]}]},{'model':db['CmList'],'as':_0x406f('0x77'),'attributes':['id',_0x406f('0xf')]},{'model':db[_0x406f('0x78')],'as':_0x406f('0x79'),'attributes':['id',_0x406f('0xf'),_0x406f('0x7a')]}]})[_0x406f('0xc')](function(_0x23ae6b){if(_0x23ae6b){return _0x23ae6b['update']({'UserId':_0x552db1},{'transaction':_0x238912});}});});})['then'](handleEntityNotFound(_0x14ce45,null))['then'](respondWithResult(_0x14ce45,null))[_0x406f('0x37')](handleError(_0x14ce45,null));};exports['getOpenContacts']=function(_0x5ec137,_0x2c032b){return _0x5ec137[_0x406f('0x4d')][_0x406f('0x5f')]({'where':{'type':_0x406f('0x60'),'dialActive':!![],'dialMethod':_0x406f('0x7d')},'attributes':['id'],'raw':!![]})['then'](function(_0x58206a){if(_0x58206a&&_0x58206a[_0x406f('0x63')]){return db[_0x406f('0x12')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x406f('0x50')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x406f('0x11')](_0x58206a,'id')},'$or':[{'UserId':null},{'UserId':_0x5ec137[_0x406f('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x110072){if(!_[_0x406f('0x58')](_0x110072)&&_[_0x406f('0x7e')](_0x110072)){return _0x2c032b[_0x406f('0x4')](0xc8)[_0x406f('0x5')]({'contacts':_0x110072});}else{logger[_0x406f('0xe')](_0x406f('0x7f'),_0x406f('0x80'),0x194,_0x406f('0x81'));_0x2c032b[_0x406f('0xd')](0x194);}})[_0x406f('0x37')](handleError(_0x2c032b,null));};exports['getTimezones']=function(_0x35968c,_0x16791a){var _0x169662=shared[_0x406f('0x82')];var _0x2bf211=[];_[_0x406f('0x11')](_0x169662,function(_0x115736){_0x2bf211[_0x406f('0x83')]({'id':_0x115736[_0x406f('0xf')],'name':_0x115736['name'],'utcOffset':_0x115736[_0x406f('0x84')]});});return _0x16791a[_0x406f('0x4')](0xc8)['json']({'tz':_0x2bf211});};exports[_0x406f('0x85')]=function(_0x2213b4,_0x39fe38){var _0x42a297=shared[_0x406f('0x82')];var _0x2178ac={};if(!_['isNil'](_0x42a297[_0x2213b4[_0x406f('0x3e')]['id']]))_0x2178ac=_0x42a297[_0x2213b4[_0x406f('0x3e')]['id']];return _0x39fe38['status'](0xc8)[_0x406f('0x5')](_0x2178ac);}; \ No newline at end of file +var _0xa9b1=['finally','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','dialPreviewAutoRecallMe','direction','prev','isEmpty','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','hopperIds','literal','findOne','recallme','UPDATE','Contact','CmCompany','List','Queue','dialActive','getPreviewRecall','scheduledat','LOCK','Company','CmList','getOpenContacts','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','Content-Range','update','sendStatus','stack','name','status','send','index','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','intersection','concat','$or','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$like','$overlap','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname'];(function(_0x179b6f,_0x5874b7){var _0x3d913b=function(_0x2ae22a){while(--_0x2ae22a){_0x179b6f['push'](_0x179b6f['shift']());}};_0x3d913b(++_0x5874b7);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x1a9b('0x0'));var logger=require(_0x1a9b('0x1'))(_0x1a9b('0x2'));var shared=require(_0x1a9b('0x3'));var db=require(_0x1a9b('0x4'))['db'];function respondWithResult(_0x10c90c,_0x52f55f){_0x52f55f=_0x52f55f||0xc8;return function(_0x57b453){if(_0x57b453){return _0x10c90c['status'](_0x52f55f)[_0x1a9b('0x5')](_0x57b453);}};}function respondWithFilteredResult(_0x15861d,_0x1a78b6){return function(_0xc55657){if(_0xc55657){var _0x32cff5=typeof _0x1a78b6[_0x1a9b('0x6')]===_0x1a9b('0x7')&&typeof _0x1a78b6[_0x1a9b('0x8')]===_0x1a9b('0x7');var _0xec5160=_0xc55657[_0x1a9b('0x9')];var _0x57659a=_0x32cff5?0x0:_0x1a78b6['offset'];var _0x4e1aef=_0x32cff5?_0xc55657[_0x1a9b('0x9')]:_0x1a78b6[_0x1a9b('0x6')]+_0x1a78b6[_0x1a9b('0x8')];var _0x5ad5e4;if(_0x4e1aef>=_0xec5160){_0x4e1aef=_0xec5160;_0x5ad5e4=0xc8;}else{_0x5ad5e4=0xce;}_0x15861d['status'](_0x5ad5e4);return _0x15861d['set'](_0x1a9b('0xa'),_0x57659a+'-'+_0x4e1aef+'/'+_0xec5160)[_0x1a9b('0x5')](_0xc55657);}return null;};}function saveUpdates(_0x2c75cf,_0x11bf7e){return function(_0x2c3170){if(_0x2c3170){return _0x2c3170[_0x1a9b('0xb')](_0x2c75cf)['then'](function(_0x3c1ba4){return _0x3c1ba4;});}return null;};}function handleEntityNotFound(_0x34f082,_0x245883){return function(_0x53c725){if(!_0x53c725){_0x34f082[_0x1a9b('0xc')](0x194);}return _0x53c725;};}function handleError(_0x38145b,_0x55a00d){_0x55a00d=_0x55a00d||0x1f4;return function(_0x2a7d72){logger['error'](_0x2a7d72[_0x1a9b('0xd')]);if(_0x2a7d72[_0x1a9b('0xe')]){delete _0x2a7d72[_0x1a9b('0xe')];}_0x38145b[_0x1a9b('0xf')](_0x55a00d)[_0x1a9b('0x10')](_0x2a7d72);};}exports[_0x1a9b('0x11')]=function(_0x37057a,_0x205a0d){var _0x10acc3={},_0x1281c2={},_0x53ea09={'count':0x0,'rows':[]};var _0x13be9a=_[_0x1a9b('0x12')](db[_0x1a9b('0x13')][_0x1a9b('0x14')],function(_0x5687fc){return{'name':_0x5687fc[_0x1a9b('0x15')],'type':_0x5687fc[_0x1a9b('0x16')]['key']};});_0x1281c2[_0x1a9b('0x17')]=_[_0x1a9b('0x12')](_0x13be9a,_0x1a9b('0xe'));_0x1281c2[_0x1a9b('0x18')]=_[_0x1a9b('0x19')](_0x37057a['query']);_0x1281c2[_0x1a9b('0x1a')]=_[_0x1a9b('0x1b')](_0x1281c2[_0x1a9b('0x17')],_0x1281c2[_0x1a9b('0x18')]);_0x1281c2[_0x1a9b('0x1a')]=_[_0x1a9b('0x1c')](_0x1281c2[_0x1a9b('0x1a')],['$and',_0x1a9b('0x1d'),'$gt',_0x1a9b('0x1e'),_0x1a9b('0x1f'),_0x1a9b('0x20'),'$ne',_0x1a9b('0x21'),_0x1a9b('0x22'),_0x1a9b('0x23'),_0x1a9b('0x24'),_0x1a9b('0x25'),_0x1a9b('0x26'),'$like',_0x1a9b('0x27'),_0x1a9b('0x28'),'$notILike',_0x1a9b('0x29'),_0x1a9b('0x2a'),'$contains','$contained',_0x1a9b('0x2b')]);_0x10acc3[_0x1a9b('0x2c')]=_['intersection'](_0x1281c2[_0x1a9b('0x17')],qs[_0x1a9b('0x2d')](_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x2d')]));_0x10acc3[_0x1a9b('0x2c')]=_0x10acc3[_0x1a9b('0x2c')][_0x1a9b('0x2e')]?_0x10acc3['attributes']:_0x1281c2[_0x1a9b('0x17')];if(!_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x2f')](_0x1a9b('0x30'))){_0x10acc3[_0x1a9b('0x8')]=qs[_0x1a9b('0x8')](_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x8')]);_0x10acc3[_0x1a9b('0x6')]=qs[_0x1a9b('0x6')](_0x37057a[_0x1a9b('0x18')]['offset']);}_0x10acc3['order']=qs[_0x1a9b('0x31')](_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x31')]);_0x10acc3['where']=qs[_0x1a9b('0x1a')](_['pick'](_0x37057a[_0x1a9b('0x18')],_0x1281c2['filters']),_0x13be9a);if(_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x32')]){_0x10acc3['where']=_[_0x1a9b('0x33')](_0x10acc3['where'],{'$or':_[_0x1a9b('0x12')](_0x13be9a,function(_0x34c457){if(_0x34c457[_0x1a9b('0x16')]!==_0x1a9b('0x34')){var _0x5ccdfe={};_0x5ccdfe[_0x34c457[_0x1a9b('0xe')]]={'$like':'%'+_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x32')]+'%'};return _0x5ccdfe;}})});}_0x10acc3=_['merge']({},_0x10acc3,_0x37057a[_0x1a9b('0x35')]);var _0x5be8b9={'where':_0x10acc3['where']};return db[_0x1a9b('0x13')][_0x1a9b('0x9')](_0x5be8b9)[_0x1a9b('0x36')](function(_0x42f540){_0x53ea09[_0x1a9b('0x9')]=_0x42f540;if(_0x37057a[_0x1a9b('0x18')][_0x1a9b('0x37')]){_0x10acc3['include']=[{'all':!![]}];}return db[_0x1a9b('0x13')][_0x1a9b('0x38')](_0x10acc3);})[_0x1a9b('0x36')](function(_0x55d8de){_0x53ea09[_0x1a9b('0x39')]=_0x55d8de;return _0x53ea09;})[_0x1a9b('0x36')](respondWithFilteredResult(_0x205a0d,_0x10acc3))[_0x1a9b('0x3a')](handleError(_0x205a0d,null));};exports[_0x1a9b('0x3b')]=function(_0x5d6213,_0x58d5b6){var _0x10e80f={'raw':!![],'where':{'id':_0x5d6213[_0x1a9b('0x3c')]['id']}},_0x45e50f={};_0x45e50f['model']=_['keys'](db[_0x1a9b('0x13')][_0x1a9b('0x14')]);_0x45e50f[_0x1a9b('0x18')]=_[_0x1a9b('0x19')](_0x5d6213[_0x1a9b('0x18')]);_0x45e50f[_0x1a9b('0x1a')]=_[_0x1a9b('0x1b')](_0x45e50f['model'],_0x45e50f[_0x1a9b('0x18')]);_0x10e80f[_0x1a9b('0x2c')]=_[_0x1a9b('0x1b')](_0x45e50f[_0x1a9b('0x17')],qs[_0x1a9b('0x2d')](_0x5d6213[_0x1a9b('0x18')][_0x1a9b('0x2d')]));_0x10e80f[_0x1a9b('0x2c')]=_0x10e80f[_0x1a9b('0x2c')][_0x1a9b('0x2e')]?_0x10e80f[_0x1a9b('0x2c')]:_0x45e50f[_0x1a9b('0x17')];if(_0x5d6213[_0x1a9b('0x18')][_0x1a9b('0x37')]){_0x10e80f[_0x1a9b('0x3d')]=[{'all':!![]}];}_0x10e80f=_[_0x1a9b('0x33')]({},_0x10e80f,_0x5d6213['options']);return db[_0x1a9b('0x13')][_0x1a9b('0x3e')](_0x10e80f)['then'](handleEntityNotFound(_0x58d5b6,null))[_0x1a9b('0x36')](respondWithResult(_0x58d5b6,null))['catch'](handleError(_0x58d5b6,null));};exports['create']=function(_0x2311eb,_0x30f5b5){return db[_0x1a9b('0x13')][_0x1a9b('0x3f')](_0x2311eb[_0x1a9b('0x40')],{})[_0x1a9b('0x36')](respondWithResult(_0x30f5b5,0xc9))[_0x1a9b('0x3a')](handleError(_0x30f5b5,null));};exports['update']=function(_0x1e63ac,_0x3595fa){if(_0x1e63ac[_0x1a9b('0x40')]['id']){delete _0x1e63ac[_0x1a9b('0x40')]['id'];}return db['CmHopper'][_0x1a9b('0x3e')]({'where':{'id':_0x1e63ac[_0x1a9b('0x3c')]['id']}})[_0x1a9b('0x36')](handleEntityNotFound(_0x3595fa,null))[_0x1a9b('0x36')](saveUpdates(_0x1e63ac['body'],null))[_0x1a9b('0x36')](respondWithResult(_0x3595fa,null))[_0x1a9b('0x3a')](handleError(_0x3595fa,null));};exports[_0x1a9b('0x41')]=function(_0x1e93df,_0x38c609){return db['CmHopper']['describe']()[_0x1a9b('0x36')](respondWithResult(_0x38c609,null))[_0x1a9b('0x3a')](handleError(_0x38c609,null));};exports['destroy']=function(_0x52b06e,_0x252140){var _0x369156;var _0xb09b40=_0x52b06e['params']['id'];return db[_0x1a9b('0x13')][_0x1a9b('0x3e')]({'where':{'id':_0x52b06e[_0x1a9b('0x3c')]['id']}})[_0x1a9b('0x36')](handleEntityNotFound(_0x252140,null))[_0x1a9b('0x36')](function(_0x15cd36){if(_0x15cd36){return _0x15cd36[_0x1a9b('0x42')]()['then'](function(_0x54b9ac){return _0x54b9ac;});}})['then'](function(_0x4d4f86){_0x369156=_0x4d4f86;if(_0x4d4f86){if(_0x4d4f86[_0x1a9b('0x43')]||_0x4d4f86[_0x1a9b('0x44')]){return db[_0x4d4f86[_0x1a9b('0x43')]?_0x1a9b('0x45'):'Campaign'][_0x1a9b('0x3e')]({'where':{'id':_0x4d4f86[_0x1a9b('0x43')]?_0x4d4f86[_0x1a9b('0x43')]:_0x4d4f86[_0x1a9b('0x44')]},'attributes':['id',_0x1a9b('0xe')],'raw':!![]});}}})[_0x1a9b('0x36')](function(_0xedb034){var _0x38eeac={};if(_0xedb034){_[_0x1a9b('0x33')](_0x38eeac,_[_0x1a9b('0x46')](_0x369156[_0x1a9b('0x47')],[_0x1a9b('0x48'),_0x1a9b('0x49'),'id']));_0x38eeac[_0x1a9b('0x4a')]=0x15;_0x38eeac[_0x1a9b('0x4b')]=_0x1a9b('0x4c');_0x38eeac[_0x1a9b('0x4d')]=_0xedb034[_0x1a9b('0xe')];_0x38eeac[_0x1a9b('0x4e')]=_0x52b06e[_0x1a9b('0x4f')][_0x1a9b('0xe')];_0x38eeac['UserId']=_0x52b06e['user']['id'];_0x38eeac[_0x1a9b('0x4c')]=!![];_0x38eeac[_0x1a9b('0x50')]=moment()[_0x1a9b('0x51')](_0x1a9b('0x52'));_0x38eeac['calleridnum']=_0x369156[_0x1a9b('0x53')];_0x38eeac['campaigntype']=_0x369156[_0x1a9b('0x43')]?_0x1a9b('0x54'):_0x1a9b('0x55');return db[_0x1a9b('0x56')][_0x1a9b('0x3e')]({'where':{'id':_0x38eeac[_0x1a9b('0x57')]},'attributes':[_0x1a9b('0x58'),_0x1a9b('0x59')]})[_0x1a9b('0x36')](function(_0x403dd9){if(!_[_0x1a9b('0x5a')](_0x252140)&&!_[_0x1a9b('0x5a')](_0x403dd9[_0x1a9b('0x58')])){_0x38eeac[_0x1a9b('0x5b')]=_0x403dd9[_0x1a9b('0x58')];if(!_[_0x1a9b('0x5a')](_0x403dd9[_0x1a9b('0x59')])){_0x38eeac[_0x1a9b('0x5b')]+='\x20'+_0x403dd9['lastName'];}}})[_0x1a9b('0x5c')](function(){return db[_0x1a9b('0x5d')][_0x1a9b('0x3f')](_0x38eeac);});}})[_0x1a9b('0x36')](function(_0x492f16){return db['CmHopperAdditionalPhone'][_0x1a9b('0x42')]({'where':{'CmHopperId':_0xb09b40}});})[_0x1a9b('0x36')](function(){return _0x252140[_0x1a9b('0xf')](0xcc)[_0x1a9b('0x5e')]();})[_0x1a9b('0x3a')](handleError(_0x252140,null));};exports[_0x1a9b('0x5f')]=function(_0x6c5881,_0x17bd17){var _0x4723df=[];return db[_0x1a9b('0x56')][_0x1a9b('0x41')]()[_0x1a9b('0x36')](function(_0x48e3dd){_0x4723df=_[_0x1a9b('0x19')](_0x48e3dd);return _0x6c5881[_0x1a9b('0x4f')][_0x1a9b('0x60')]({'where':{'type':_0x1a9b('0x61'),'dialActive':!![],'dialMethod':_0x1a9b('0x62')},'attributes':['id',_0x1a9b('0x63'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x1a9b('0x36')](function(_0x43261a){if(_0x43261a&&_0x43261a[_0x1a9b('0x2e')]){return db['sequelize'][_0x1a9b('0x64')](function(_0x1dcac3){var _0x546f17={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1a9b('0x51')](_0x1a9b('0x52'))},'VoiceQueueId':{'$in':_[_0x1a9b('0x12')](_0x43261a,'id')},'$or':[{'UserId':null},{'UserId':_0x6c5881[_0x1a9b('0x4f')]['id']}]};var _0x2e49bd={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x43261a)[_0x1a9b('0x32')]([_0x1a9b('0x65'),0x0])[_0x1a9b('0x12')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x6c5881['user']['id']}]};var _0x3186f1={'$or':[_0x546f17,_0x2e49bd]};var _0x2eff0b=[];if(_0x6c5881[_0x1a9b('0x40')][_0x1a9b('0x66')]&&_0x6c5881['body'][_0x1a9b('0x66')]===_0x1a9b('0x67')){if(!_[_0x1a9b('0x68')](_0x6c5881['body']['hopperIds'])){_0x3186f1['id']={'$in':_0x6c5881[_0x1a9b('0x40')]['hopperIds']};}_0x2eff0b=[['priority',_0x1a9b('0x69')],[_0x1a9b('0x6a'),_0x43261a[0x0][_0x1a9b('0x63')]==='ASC'?_0x1a9b('0x6b'):_0x1a9b('0x69')],db[_0x1a9b('0x6c')]['literal'](_0x1a9b('0x6d')),['id','DESC']];}else{if(!_['isEmpty'](_0x6c5881[_0x1a9b('0x40')][_0x1a9b('0x6e')])){_0x3186f1['id']={'$notIn':_0x6c5881[_0x1a9b('0x40')][_0x1a9b('0x6e')]};}_0x2eff0b=[['priority','DESC'],[_0x1a9b('0x6a'),_0x43261a[0x0][_0x1a9b('0x63')]],db[_0x1a9b('0x6c')][_0x1a9b('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x1a9b('0x69')]];}return db[_0x1a9b('0x13')][_0x1a9b('0x70')]({'attributes':['id','scheduledat',_0x1a9b('0x53'),_0x1a9b('0x71')],'where':_0x3186f1,'order':_0x2eff0b,'transaction':_0x1dcac3,'lock':_0x1dcac3['LOCK'][_0x1a9b('0x72')],'include':[{'model':db[_0x1a9b('0x56')],'as':_0x1a9b('0x73'),'attributes':_0x4723df,'include':[{'model':db[_0x1a9b('0x74')],'as':'Company','attributes':['id',_0x1a9b('0xe')]}]},{'model':db['CmList'],'as':_0x1a9b('0x75'),'attributes':['id',_0x1a9b('0xe')]},{'model':db['VoiceQueue'],'as':_0x1a9b('0x76'),'attributes':['id',_0x1a9b('0xe'),_0x1a9b('0x77')]}]})['then'](function(_0x3b9fc8){if(_0x3b9fc8){return _0x3b9fc8['update']({'UserId':_0x6c5881['user']['id']},{'transaction':_0x1dcac3});}});});}})['then'](handleEntityNotFound(_0x17bd17,null))[_0x1a9b('0x36')](respondWithResult(_0x17bd17,null))[_0x1a9b('0x3a')](handleError(_0x17bd17,null));};exports[_0x1a9b('0x78')]=function(_0x18ef58,_0xab4227,_0x2c1920){var _0x43928e=[];var _0x362d29=_0x18ef58[_0x1a9b('0x3c')]['id'];var _0x5ef94f=_0x18ef58[_0x1a9b('0x4f')]['id'];return db['CmContact'][_0x1a9b('0x41')]()[_0x1a9b('0x36')](function(_0x42402e){_0x43928e=_[_0x1a9b('0x19')](_0x42402e);return db[_0x1a9b('0x6c')][_0x1a9b('0x64')](function(_0x3fb0d0){const _0x3de959={'id':_0x362d29};return db[_0x1a9b('0x13')][_0x1a9b('0x70')]({'attributes':['id',_0x1a9b('0x79'),_0x1a9b('0x71')],'where':_0x3de959,'transaction':_0x3fb0d0,'lock':_0x3fb0d0[_0x1a9b('0x7a')][_0x1a9b('0x72')],'include':[{'model':db['CmContact'],'as':_0x1a9b('0x73'),'attributes':_0x43928e,'include':[{'model':db['CmCompany'],'as':_0x1a9b('0x7b'),'attributes':['id',_0x1a9b('0xe')]}]},{'model':db[_0x1a9b('0x7c')],'as':_0x1a9b('0x75'),'attributes':['id',_0x1a9b('0xe')]},{'model':db['VoiceQueue'],'as':_0x1a9b('0x76'),'attributes':['id','name','dialActive']}]})[_0x1a9b('0x36')](function(_0x2a066f){if(_0x2a066f){return _0x2a066f[_0x1a9b('0xb')]({'UserId':_0x5ef94f},{'transaction':_0x3fb0d0});}});});})[_0x1a9b('0x36')](handleEntityNotFound(_0xab4227,null))[_0x1a9b('0x36')](respondWithResult(_0xab4227,null))['catch'](handleError(_0xab4227,null));};exports[_0x1a9b('0x7d')]=function(_0x58a334,_0x438da7){return _0x58a334[_0x1a9b('0x4f')][_0x1a9b('0x60')]({'where':{'type':_0x1a9b('0x61'),'dialActive':!![],'dialMethod':_0x1a9b('0x62')},'attributes':['id'],'raw':!![]})['then'](function(_0x3d0325){if(_0x3d0325&&_0x3d0325[_0x1a9b('0x2e')]){return db['CmHopper'][_0x1a9b('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1a9b('0x51')](_0x1a9b('0x52'))},'VoiceQueueId':{'$in':_[_0x1a9b('0x12')](_0x3d0325,'id')},'$or':[{'UserId':null},{'UserId':_0x58a334['user']['id']}]}});}return 0x0;})['then'](function(_0x16457b){if(!_[_0x1a9b('0x5a')](_0x16457b)&&_['isNumber'](_0x16457b)){return _0x438da7[_0x1a9b('0xf')](0xc8)[_0x1a9b('0x5')]({'contacts':_0x16457b});}else{logger[_0x1a9b('0x7e')](_0x1a9b('0x7f'),'getOpenContacts',0x194,_0x1a9b('0x80'));_0x438da7['sendStatus'](0x194);}})['catch'](handleError(_0x438da7,null));};exports[_0x1a9b('0x81')]=function(_0x2ecaa8,_0x1e5f1c){var _0x18b3a2=shared[_0x1a9b('0x82')];var _0x5c6e01=[];_[_0x1a9b('0x12')](_0x18b3a2,function(_0x17f4b7){_0x5c6e01[_0x1a9b('0x83')]({'id':_0x17f4b7[_0x1a9b('0xe')],'name':_0x17f4b7[_0x1a9b('0xe')],'utcOffset':_0x17f4b7[_0x1a9b('0x84')]});});return _0x1e5f1c[_0x1a9b('0xf')](0xc8)['json']({'tz':_0x5c6e01});};exports['getTimezone']=function(_0x6817a7,_0x4ff768){var _0x22682b=shared[_0x1a9b('0x82')];var _0x7e442b={};if(!_[_0x1a9b('0x5a')](_0x22682b[_0x6817a7[_0x1a9b('0x40')]['id']]))_0x7e442b=_0x22682b[_0x6817a7[_0x1a9b('0x40')]['id']];return _0x4ff768[_0x1a9b('0xf')](0xc8)[_0x1a9b('0x5')](_0x7e442b);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 1ecaa50..0fbc2dc 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 _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2d64fc,_0x42b2a7){var _0x2c8556=function(_0x4b29da){while(--_0x4b29da){_0x2d64fc['push'](_0x2d64fc['shift']());}};_0x2c8556(++_0x42b2a7);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x27a25a,_0x55b269){_0x27a25a=_0x27a25a-0x0;var _0x19141b=_0xbd51[_0x27a25a];return _0x19141b;};'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':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0x1c8a5d,_0x8773fd){var _0x27de58=function(_0xee26e0){while(--_0xee26e0){_0x1c8a5d['push'](_0x1c8a5d['shift']());}};_0x27de58(++_0x8773fd);}(_0x5fc3,0xa8));var _0x35fc=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x5fc3[_0xcf4569];return _0x7fef;};'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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 70a5301..ee0fca1 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 _0xa5aa=['request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowCmHopper','find','CreateCmHopper','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','update','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','describe','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','List','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s'];(function(_0x4152d4,_0x2e97ea){var _0x124818=function(_0x578b05){while(--_0x578b05){_0x4152d4['push'](_0x4152d4['shift']());}};_0x124818(++_0x2e97ea);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x55a286,_0x44a6ec){_0x55a286=_0x55a286-0x0;var _0x790e14=_0xa5aa[_0x55a286];return _0x790e14;};'use strict';var _=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var moment=require('moment');var BPromise=require(_0xaa5a('0x2'));var db=require(_0xaa5a('0x3'))['db'];var logger=require(_0xaa5a('0x4'))(_0xaa5a('0x5'));var jayson=require(_0xaa5a('0x6'));var client=jayson[_0xaa5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4321e6,_0x1c4007,_0x46c8cc){return new BPromise(function(_0x561d19,_0x5ca487){return client[_0xaa5a('0x8')](_0x4321e6,_0x46c8cc)[_0xaa5a('0x9')](function(_0x4daa9a){logger[_0xaa5a('0xa')](_0xaa5a('0xb'),_0x1c4007,_0xaa5a('0xc'));logger['debug'](_0xaa5a('0xd'),_0x1c4007,_0xaa5a('0xc'),JSON[_0xaa5a('0xe')](_0x4daa9a));if(_0x4daa9a[_0xaa5a('0xf')]){if(_0x4daa9a[_0xaa5a('0xf')][_0xaa5a('0x10')]===0x1f4){logger['error'](_0xaa5a('0xb'),_0x1c4007,_0x4daa9a[_0xaa5a('0xf')][_0xaa5a('0x11')]);return _0x5ca487(_0x4daa9a[_0xaa5a('0xf')][_0xaa5a('0x11')]);}logger[_0xaa5a('0xf')](_0xaa5a('0xb'),_0x1c4007,_0x4daa9a[_0xaa5a('0xf')][_0xaa5a('0x11')]);return _0x561d19(_0x4daa9a[_0xaa5a('0xf')][_0xaa5a('0x11')]);}else{logger[_0xaa5a('0xa')]('CmHopper,\x20%s,\x20%s',_0x1c4007,_0xaa5a('0xc'));_0x561d19(_0x4daa9a[_0xaa5a('0x12')][_0xaa5a('0x11')]);}})['catch'](function(_0x29ce43){logger[_0xaa5a('0xf')](_0xaa5a('0xb'),_0x1c4007,_0x29ce43);_0x5ca487(_0x29ce43);});});}exports[_0xaa5a('0x13')]=function(_0x8e1dde){var _0x420d96=this;return new Promise(function(_0x1b3eba,_0x1c7320){return db[_0xaa5a('0x14')][_0xaa5a('0x15')]({'raw':_0x8e1dde[_0xaa5a('0x16')]?_0x8e1dde[_0xaa5a('0x16')][_0xaa5a('0x17')]===undefined?!![]:![]:!![],'where':_0x8e1dde[_0xaa5a('0x16')]?_0x8e1dde[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'attributes':_0x8e1dde[_0xaa5a('0x16')]?_0x8e1dde['options'][_0xaa5a('0x19')]||null:null,'limit':_0x8e1dde[_0xaa5a('0x16')]?_0x8e1dde[_0xaa5a('0x16')][_0xaa5a('0x1a')]||null:null,'include':_0x8e1dde['options']?_0x8e1dde[_0xaa5a('0x16')][_0xaa5a('0x1b')]?_[_0xaa5a('0x1c')](_0x8e1dde[_0xaa5a('0x16')][_0xaa5a('0x1b')],function(_0x3b6083){return{'model':db[_0x3b6083[_0xaa5a('0x1d')]],'as':_0x3b6083['as'],'attributes':_0x3b6083[_0xaa5a('0x19')],'include':_0x3b6083[_0xaa5a('0x1b')]?_['map'](_0x3b6083[_0xaa5a('0x1b')],function(_0x4c9035){return{'model':db[_0x4c9035[_0xaa5a('0x1d')]],'as':_0x4c9035['as'],'attributes':_0x4c9035[_0xaa5a('0x19')],'include':_0x4c9035[_0xaa5a('0x1b')]?_[_0xaa5a('0x1c')](_0x4c9035[_0xaa5a('0x1b')],function(_0x47cdcf){return{'model':db[_0x47cdcf[_0xaa5a('0x1d')]],'as':_0x47cdcf['as'],'attributes':_0x47cdcf[_0xaa5a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46e035){logger['info'](_0xaa5a('0x13'),_0x8e1dde);logger[_0xaa5a('0x1e')](_0xaa5a('0x13'),_0x8e1dde,JSON[_0xaa5a('0xe')](_0x46e035));_0x1b3eba(_0x46e035);})[_0xaa5a('0x1f')](function(_0x10208d){logger['error'](_0xaa5a('0x13'),_0x10208d[_0xaa5a('0x11')],_0x8e1dde);_0x1c7320(_0x420d96['error'](0x1f4,_0x10208d[_0xaa5a('0x11')]));});});};exports[_0xaa5a('0x20')]=function(_0x4f471b){var _0x287cc6=this;return new Promise(function(_0x453a46,_0x186413){return db[_0xaa5a('0x14')][_0xaa5a('0x21')]({'raw':_0x4f471b[_0xaa5a('0x16')]?_0x4f471b['options'][_0xaa5a('0x17')]===undefined?!![]:![]:!![],'where':_0x4f471b[_0xaa5a('0x16')]?_0x4f471b[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'attributes':_0x4f471b['options']?_0x4f471b['options'][_0xaa5a('0x19')]||null:null,'include':_0x4f471b[_0xaa5a('0x16')]?_0x4f471b['options'][_0xaa5a('0x1b')]?_['map'](_0x4f471b['options'][_0xaa5a('0x1b')],function(_0x176f2a){return{'model':db[_0x176f2a[_0xaa5a('0x1d')]],'as':_0x176f2a['as'],'attributes':_0x176f2a[_0xaa5a('0x19')],'include':_0x176f2a[_0xaa5a('0x1b')]?_[_0xaa5a('0x1c')](_0x176f2a[_0xaa5a('0x1b')],function(_0x5632aa){return{'model':db[_0x5632aa[_0xaa5a('0x1d')]],'as':_0x5632aa['as'],'attributes':_0x5632aa[_0xaa5a('0x19')],'include':_0x5632aa[_0xaa5a('0x1b')]?_['map'](_0x5632aa[_0xaa5a('0x1b')],function(_0x5314c5){return{'model':db[_0x5314c5[_0xaa5a('0x1d')]],'as':_0x5314c5['as'],'attributes':_0x5314c5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x368a6d){logger[_0xaa5a('0xa')](_0xaa5a('0x20'),_0x4f471b);logger[_0xaa5a('0x1e')](_0xaa5a('0x20'),_0x4f471b,JSON[_0xaa5a('0xe')](_0x368a6d));_0x453a46(_0x368a6d);})[_0xaa5a('0x1f')](function(_0x37e24c){logger['error']('ShowCmHopper',_0x37e24c['message'],_0x4f471b);_0x186413(_0x287cc6[_0xaa5a('0xf')](0x1f4,_0x37e24c[_0xaa5a('0x11')]));});});};exports[_0xaa5a('0x22')]=function(_0x456ed4){var _0xfb988b=this;return new Promise(function(_0x4d4d47,_0x518a22){return db['CmHopper']['create'](_0x456ed4[_0xaa5a('0x23')],{'raw':_0x456ed4['options']?_0x456ed4['options']['raw']===undefined?!![]:![]:!![]})[_0xaa5a('0x9')](function(_0x11042d){logger[_0xaa5a('0xa')]('CreateCmHopper',_0x456ed4);logger[_0xaa5a('0x1e')](_0xaa5a('0x22'),_0x456ed4,JSON[_0xaa5a('0xe')](_0x11042d));_0x4d4d47(_0x11042d);})[_0xaa5a('0x1f')](function(_0x20132a){logger['error'](_0xaa5a('0x22'),_0x20132a[_0xaa5a('0x11')],_0x456ed4);_0x518a22(_0xfb988b[_0xaa5a('0xf')](0x1f4,_0x20132a[_0xaa5a('0x11')]));});});};exports[_0xaa5a('0x24')]=function(_0x3f0760){var _0x1bdaa5=this;return new Promise(function(_0x26afd3,_0x7adbf6){return db['CmHopper']['update'](_0x3f0760['body'],{'raw':_0x3f0760['options']?_0x3f0760[_0xaa5a('0x16')][_0xaa5a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f0760[_0xaa5a('0x16')]?_0x3f0760[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'attributes':_0x3f0760[_0xaa5a('0x16')]?_0x3f0760[_0xaa5a('0x16')][_0xaa5a('0x19')]||null:null,'limit':_0x3f0760[_0xaa5a('0x16')]?_0x3f0760[_0xaa5a('0x16')]['limit']||null:null})[_0xaa5a('0x9')](function(_0xfcbf00){logger[_0xaa5a('0xa')](_0xaa5a('0x24'),_0x3f0760);logger[_0xaa5a('0xa')](_0xaa5a('0x25'),JSON[_0xaa5a('0xe')](_0x3f0760['options'][_0xaa5a('0x18')]),_0x3f0760[_0xaa5a('0x23')][_0xaa5a('0x26')]);logger[_0xaa5a('0x1e')](_0xaa5a('0x24'),_0x3f0760,JSON[_0xaa5a('0xe')](_0xfcbf00));_0x26afd3(_0xfcbf00);})[_0xaa5a('0x1f')](function(_0x3c2931){logger[_0xaa5a('0xf')]('UpdateCmHopper',_0x3c2931['message'],_0x3f0760);_0x7adbf6(_0x1bdaa5[_0xaa5a('0xf')](0x1f4,_0x3c2931[_0xaa5a('0x11')]));});});};exports[_0xaa5a('0x27')]=function(_0xd8337d){var _0x1f4996=this;return new Promise(function(_0x2990d8,_0x3bb555){return db['CmHopper'][_0xaa5a('0x28')]({'where':_0xd8337d[_0xaa5a('0x16')]?_0xd8337d[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null})[_0xaa5a('0x9')](function(_0x52d126){logger['info']('DestroyCmHopper',_0xd8337d);logger['debug'](_0xaa5a('0x27'),_0xd8337d,JSON[_0xaa5a('0xe')](_0x52d126));_0x2990d8(_0x52d126);})[_0xaa5a('0x1f')](function(_0x217337){logger[_0xaa5a('0xf')](_0xaa5a('0x27'),_0x217337[_0xaa5a('0x11')],_0xd8337d);_0x3bb555(_0x1f4996[_0xaa5a('0xf')](0x1f4,_0x217337[_0xaa5a('0x11')]));});});};exports[_0xaa5a('0x29')]=function(_0x328f9b){var _0x9cdffb=this;return new Promise(function(_0x7181d4,_0xe34b19){return db[_0xaa5a('0x2a')]['describe']()['then'](function(_0x4b1d3d){return db[_0xaa5a('0x2b')][_0xaa5a('0x2c')](function(_0x3564f0){return db[_0xaa5a('0x14')][_0xaa5a('0x15')]({'where':_0x328f9b[_0xaa5a('0x16')]?_0x328f9b[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'attributes':_0x328f9b[_0xaa5a('0x16')]?_0x328f9b[_0xaa5a('0x16')][_0xaa5a('0x19')]||null:null,'limit':_0x328f9b[_0xaa5a('0x16')]?_0x328f9b[_0xaa5a('0x16')][_0xaa5a('0x1a')]||null:null,'order':_0x328f9b[_0xaa5a('0x16')]?_0x328f9b['options'][_0xaa5a('0x2d')]||null:null,'transaction':_0x3564f0,'lock':_0x3564f0[_0xaa5a('0x2e')][_0xaa5a('0x2f')],'include':[{'model':db[_0xaa5a('0x2a')],'as':_0xaa5a('0x30'),'attributes':_[_0xaa5a('0x31')](_0x4b1d3d)},{'model':db[_0xaa5a('0x32')],'as':_0xaa5a('0x33'),'attributes':['id',_0xaa5a('0x34'),_0xaa5a('0x35')]}]})[_0xaa5a('0x9')](function(_0x13cf1e){var _0x11ffc3=[];var _0x168c64=[];for(var _0x43f5b6=0x0;_0x43f5b6<_0x13cf1e[_0xaa5a('0x36')];_0x43f5b6+=0x1){var _0x19d46e=_0x13cf1e[_0x43f5b6][_0xaa5a('0x37')];if(_0x19d46e===null){_0x11ffc3['push'](_0x13cf1e[_0x43f5b6][_0xaa5a('0x38')](_0x328f9b[_0xaa5a('0x23')],{'transaction':_0x3564f0}));}else if(!_0x168c64[_0xaa5a('0x39')](_0x19d46e)){_0x168c64['push'](_0x19d46e);_0x11ffc3[_0xaa5a('0x3a')](_0x13cf1e[_0x43f5b6][_0xaa5a('0x38')](_0x328f9b[_0xaa5a('0x23')],{'transaction':_0x3564f0}));}}return BPromise[_0xaa5a('0x3b')](_0x11ffc3);});})[_0xaa5a('0x9')](function(_0x93d9b){logger[_0xaa5a('0xa')]('GetContactDialer',_0x328f9b);if(_0x93d9b[_0xaa5a('0x36')]>0x0){logger[_0xaa5a('0xa')](_0xaa5a('0x3c'),_0x93d9b[0x0][_0xaa5a('0x3d')]['id'],_0x93d9b[0x0][_0xaa5a('0x3d')][_0xaa5a('0x3e')],_0x93d9b[0x0]['dataValues'][_0xaa5a('0x26')]);}logger['debug'](_0xaa5a('0x29'),_0x328f9b,JSON['stringify'](_0x93d9b));_0x7181d4(_0x93d9b);})['catch'](function(_0x3dc49c){logger[_0xaa5a('0xf')](_0xaa5a('0x29'),_0x3dc49c[_0xaa5a('0x11')],_0x328f9b);_0xe34b19(_0x9cdffb[_0xaa5a('0xf')](0x1f4,_0x3dc49c[_0xaa5a('0x11')]));});});});};exports[_0xaa5a('0x3f')]=function(_0x44c35c){var _0x43f190=this;return new Promise(function(_0xd54c3c,_0x5b8c7c){return db[_0xaa5a('0x2b')][_0xaa5a('0x2c')](function(_0x11ed0d){return db[_0xaa5a('0x40')][_0xaa5a('0x41')](_0x44c35c[_0xaa5a('0x23')],{'raw':_0x44c35c['options']?_0x44c35c[_0xaa5a('0x16')][_0xaa5a('0x17')]===undefined?!![]:![]:!![],'transaction':_0x11ed0d})[_0xaa5a('0x9')](function(){logger[_0xaa5a('0xa')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xaa5a('0xe')](_0x44c35c[_0xaa5a('0x16')]['where']),_0x44c35c[_0xaa5a('0x16')]['where'][_0xaa5a('0x26')]);return db[_0xaa5a('0x14')][_0xaa5a('0x28')]({'where':_0x44c35c[_0xaa5a('0x16')]?_0x44c35c[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'transaction':_0x11ed0d});});})[_0xaa5a('0x9')](function(_0x4a001e){logger[_0xaa5a('0xa')](_0xaa5a('0x3f'),_0x44c35c);logger[_0xaa5a('0x1e')]('MoveContactManagedDialer',_0x44c35c,JSON[_0xaa5a('0xe')](_0x4a001e));_0xd54c3c(_0x4a001e);})[_0xaa5a('0x1f')](function(_0xcadc5b){logger[_0xaa5a('0xf')](_0xaa5a('0x3f'),_0xcadc5b[_0xaa5a('0x11')],_0x44c35c);_0x5b8c7c(_0x43f190[_0xaa5a('0xf')](0x1f4,_0xcadc5b[_0xaa5a('0x11')]));});});};exports['CountReScheduled']=function(_0x50d421){var _0x290384=this;return new Promise(function(_0x587e39,_0x50e404){return db[_0xaa5a('0x14')][_0xaa5a('0x15')]({'raw':_0x50d421[_0xaa5a('0x16')]?_0x50d421[_0xaa5a('0x16')][_0xaa5a('0x17')]===undefined?!![]:![]:!![],'where':_0x50d421[_0xaa5a('0x16')]?_0x50d421[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'attributes':[[db[_0xaa5a('0x2b')]['fn']('COUNT',db[_0xaa5a('0x2b')]['fn']('IF',db[_0xaa5a('0x2b')][_0xaa5a('0x42')](_0xaa5a('0x43')+util[_0xaa5a('0x44')](_0xaa5a('0x45'),moment()[_0xaa5a('0x44')](_0xaa5a('0x46')))+_0xaa5a('0x47')))),'contactsRescheduled']]})[_0xaa5a('0x9')](function(_0x3138bb){logger[_0xaa5a('0xa')](_0xaa5a('0x48'),_0x50d421);logger[_0xaa5a('0x1e')](_0xaa5a('0x48'),_0x50d421,JSON['stringify'](_0x3138bb));_0x587e39(_0x3138bb);})[_0xaa5a('0x1f')](function(_0x3cde0f){logger['error'](_0xaa5a('0x48'),_0x3cde0f['message'],_0x50d421);_0x50e404(_0x290384[_0xaa5a('0xf')](0x1f4,_0x3cde0f[_0xaa5a('0x11')]));});});};exports[_0xaa5a('0x49')]=function(_0x4583a0){var _0x4a11ab=this;return new Promise(function(_0x2867d4,_0x19658d){return db[_0xaa5a('0x2a')]['describe']()['then'](function(_0x598644){return db[_0xaa5a('0x2b')][_0xaa5a('0x2c')](function(_0x2aa399){return db['CmHopper'][_0xaa5a('0x15')]({'where':_0x4583a0[_0xaa5a('0x16')]?_0x4583a0[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'attributes':_0x4583a0['options']?_0x4583a0[_0xaa5a('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x4583a0[_0xaa5a('0x16')]?_0x4583a0[_0xaa5a('0x16')]['order']||null:null,'group':db[_0xaa5a('0x14')]['UserId'],'transaction':_0x2aa399,'lock':_0x2aa399[_0xaa5a('0x2e')][_0xaa5a('0x2f')],'include':_0x4583a0[_0xaa5a('0x16')]?_0x4583a0[_0xaa5a('0x16')][_0xaa5a('0x1b')]?_[_0xaa5a('0x1c')](_0x4583a0['options'][_0xaa5a('0x1b')],function(_0x20b250){return{'model':db[_0x20b250[_0xaa5a('0x1d')]],'as':_0x20b250['as'],'attributes':_0x20b250[_0xaa5a('0x19')],'include':_0x20b250['include']?_[_0xaa5a('0x1c')](_0x20b250['include'],function(_0x2e99f6){return{'model':db[_0x2e99f6[_0xaa5a('0x1d')]],'as':_0x2e99f6['as'],'attributes':_0x2e99f6['attributes'],'include':_0x2e99f6[_0xaa5a('0x1b')]?_[_0xaa5a('0x1c')](_0x2e99f6[_0xaa5a('0x1b')],function(_0x368dd1){return{'model':db[_0x368dd1[_0xaa5a('0x1d')]],'as':_0x368dd1['as'],'attributes':_0x368dd1['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa5a('0x9')](function(_0x322e8b){var _0x11145a=[];for(var _0x3d4fd5=0x0;_0x3d4fd5<_0x322e8b['length'];_0x3d4fd5+=0x1){_0x11145a[_0xaa5a('0x3a')](_0x322e8b[_0x3d4fd5][_0xaa5a('0x38')](_0x4583a0[_0xaa5a('0x23')],{'transaction':_0x2aa399}));}return BPromise[_0xaa5a('0x3b')](_0x11145a);});})[_0xaa5a('0x9')](function(_0x50f030){logger[_0xaa5a('0xa')]('GetContactRecallMe',_0x4583a0);logger[_0xaa5a('0x1e')](_0xaa5a('0x49'),_0x4583a0,JSON[_0xaa5a('0xe')](_0x50f030));_0x2867d4(_0x50f030);})[_0xaa5a('0x1f')](function(_0xc18ba9){logger[_0xaa5a('0xf')](_0xaa5a('0x49'),_0xc18ba9[_0xaa5a('0x11')],_0x4583a0);_0x19658d(_0x4a11ab[_0xaa5a('0xf')](0x1f4,_0xc18ba9[_0xaa5a('0x11')]));});});});};exports[_0xaa5a('0x4a')]=function(_0x41e143){var _0x1ad885=this;return new Promise(function(_0x22c6b1,_0x8857c2){db[_0xaa5a('0x2a')][_0xaa5a('0x4b')]()['then'](function(_0x200418){return db[_0xaa5a('0x14')]['findAll']({'raw':_0x41e143[_0xaa5a('0x16')]?_0x41e143[_0xaa5a('0x16')][_0xaa5a('0x17')]===undefined?!![]:![]:!![],'where':_0x41e143[_0xaa5a('0x16')]?_0x41e143[_0xaa5a('0x16')][_0xaa5a('0x18')]||null:null,'attributes':_0x41e143['options']?_0x41e143[_0xaa5a('0x16')][_0xaa5a('0x19')]||null:null,'limit':_0x41e143[_0xaa5a('0x16')]?_0x41e143[_0xaa5a('0x16')][_0xaa5a('0x1a')]||null:null,'include':_0x41e143[_0xaa5a('0x16')]?_0x41e143[_0xaa5a('0x16')][_0xaa5a('0x1b')]?_[_0xaa5a('0x1c')](_0x41e143['options'][_0xaa5a('0x1b')],function(_0x3b518f){return{'model':db[_0x3b518f['model']],'as':_0x3b518f['as'],'attributes':_0x3b518f['as']===_0xaa5a('0x30')?_[_0xaa5a('0x31')](_0x200418):_0x3b518f[_0xaa5a('0x19')],'include':_0x3b518f['include']?_['map'](_0x3b518f[_0xaa5a('0x1b')],function(_0x5c6388){return{'model':db[_0x5c6388[_0xaa5a('0x1d')]],'as':_0x5c6388['as'],'attributes':_0x5c6388[_0xaa5a('0x19')],'include':_0x5c6388['include']?_['map'](_0x5c6388['include'],function(_0x522483){return{'model':db[_0x522483['model']],'as':_0x522483['as'],'attributes':_0x522483[_0xaa5a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a1b34){logger[_0xaa5a('0xa')](_0xaa5a('0x13'),_0x41e143);logger[_0xaa5a('0x1e')](_0xaa5a('0x13'),_0x41e143,JSON[_0xaa5a('0xe')](_0x4a1b34));_0x22c6b1(_0x4a1b34);})[_0xaa5a('0x1f')](function(_0x2e5bd5){logger[_0xaa5a('0xf')](_0xaa5a('0x13'),_0x2e5bd5[_0xaa5a('0x11')],_0x41e143);_0x8857c2(_0x1ad885[_0xaa5a('0xf')](0x1f4,_0x2e5bd5[_0xaa5a('0x11')]));});});});};exports['GetContactByPhone']=function(_0x11816f){var _0xca8ceb=this;return new Promise(function(_0x34bd0d,_0x357c6c){return db['CmContact'][_0xaa5a('0x4c')]({'raw':!![],'where':{'phone':_0x11816f[_0xaa5a('0x16')]['where'][_0xaa5a('0x4d')]},'attributes':['id',_0xaa5a('0x4e')],'order':[['id','DESC']]})['then'](function(_0x188b42){logger[_0xaa5a('0xa')](_0xaa5a('0x4f'),_0x11816f);logger[_0xaa5a('0x1e')]('getContactByPhone',_0x11816f,JSON[_0xaa5a('0xe')](_0x188b42));_0x34bd0d(_0x188b42);})[_0xaa5a('0x1f')](function(_0xefce03){logger[_0xaa5a('0xf')]('getContactByPhone',_0xefce03[_0xaa5a('0x11')],_0x11816f);_0x357c6c(_0xca8ceb[_0xaa5a('0xf')](0x1f4,_0xefce03['message']));});});};exports[_0xaa5a('0x50')]=function(_0x45ac64){var _0x1a0623=this;return new Promise(function(_0x53007e,_0x19d8e0){return db[_0xaa5a('0x2b')][_0xaa5a('0x2c')](function(_0x2298ba){return db['CmHopper'][_0xaa5a('0x38')](_0x45ac64[_0xaa5a('0x23')],{'where':{},'transaction':_0x2298ba})[_0xaa5a('0x9')](function(_0x5bb56e){logger[_0xaa5a('0xa')](_0xaa5a('0x50'),_0x45ac64);logger[_0xaa5a('0x1e')](_0xaa5a('0x50'),_0x45ac64,JSON['stringify'](_0x5bb56e));_0x53007e(_0x5bb56e);})[_0xaa5a('0x1f')](function(_0x589d6b){logger[_0xaa5a('0xf')](_0xaa5a('0x50'),_0x589d6b[_0xaa5a('0x11')],_0x45ac64);_0x19d8e0(_0x1a0623[_0xaa5a('0xf')](0x1f4,_0x589d6b[_0xaa5a('0x11')]));});});});};exports[_0xaa5a('0x51')]=function(_0x3e67d8){var _0x48df41=this;var _0x587366=_0x3e67d8[_0xaa5a('0x23')]['where'][_0xaa5a('0x52')];var _0xf2386c=_0x3e67d8[_0xaa5a('0x23')]['where'][_0xaa5a('0x53')];var _0x59984f=_0x3e67d8[_0xaa5a('0x23')][_0xaa5a('0x18')][_0xaa5a('0x54')];return new Promise(function(_0x765daf,_0x2ff10d){return db[_0xaa5a('0x14')][_0xaa5a('0x15')]({'where':{'voiceQueueId':{'$in':_0x587366},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0xaa5a('0x55')+_0xf2386c+'\x20MINUTE'),'$gt':db['sequelize'][_0xaa5a('0x42')](_0xaa5a('0x56'))}},'UserId':{'$in':_0x59984f}},'include':[{'model':db[_0xaa5a('0x2a')],'as':_0xaa5a('0x30')},{'model':db[_0xaa5a('0x32')],'as':'Agent','attributes':['id','name',_0xaa5a('0x35')]},{'model':db['CmList'],'as':_0xaa5a('0x57')}]})['then'](function(_0x4ec25c){if(_0x4ec25c[_0xaa5a('0x36')]>0x0){return db[_0xaa5a('0x2b')][_0xaa5a('0x2c')](function(_0x21eda0){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0xaa5a('0x2b')][_0xaa5a('0x42')](_0xaa5a('0x56'))},{'where':{'id':{'$in':_[_0xaa5a('0x1c')](_0x4ec25c,'id')}},'transaction':_0x21eda0})[_0xaa5a('0x9')](function(){_0x765daf(_0x4ec25c);})['catch'](function(_0x1f3db3){logger[_0xaa5a('0xf')]('CmHopperHandlePreviewRecallNotifications',_0x1f3db3['message'],_0x3e67d8);_0x2ff10d(_0x48df41['error'](0x1f4,_0x1f3db3['message']));});})['catch'](function(_0x3e585a){logger[_0xaa5a('0xf')](_0xaa5a('0x51'),_0x3e585a[_0xaa5a('0x11')],_0x3e67d8);_0x2ff10d(_0x48df41[_0xaa5a('0xf')](0x1f4,_0x3e585a[_0xaa5a('0x11')]));});}else{_0x765daf(_0x4ec25c);}});});}; \ No newline at end of file +var _0x46db=['push','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','active','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','\x22%s\x22','contactsRescheduled','GetContactRecallMe','all','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','CmList','List','lodash','util','moment','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','CmHopper,\x20%s,\x20%s','result','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','map','model','catch','ShowCmHopper','find','where','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','UserId'];(function(_0x56d06a,_0x360aa0){var _0x1b48a4=function(_0x173fdb){while(--_0x173fdb){_0x56d06a['push'](_0x56d06a['shift']());}};_0x1b48a4(++_0x360aa0);}(_0x46db,0x1da));var _0xb46d=function(_0xcc7460,_0xf96693){_0xcc7460=_0xcc7460-0x0;var _0x24cb1b=_0x46db[_0xcc7460];return _0x24cb1b;};'use strict';var _=require(_0xb46d('0x0'));var util=require(_0xb46d('0x1'));var moment=require(_0xb46d('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xb46d('0x3'))(_0xb46d('0x4'));var jayson=require(_0xb46d('0x5'));var client=jayson[_0xb46d('0x6')][_0xb46d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x367342,_0x4aabf9,_0x5acc3b){return new BPromise(function(_0xb8a6f4,_0x306563){return client[_0xb46d('0x8')](_0x367342,_0x5acc3b)[_0xb46d('0x9')](function(_0x6818cc){logger[_0xb46d('0xa')]('CmHopper,\x20%s,\x20%s',_0x4aabf9,_0xb46d('0xb'));logger[_0xb46d('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4aabf9,'request\x20sent',JSON[_0xb46d('0xd')](_0x6818cc));if(_0x6818cc[_0xb46d('0xe')]){if(_0x6818cc['error'][_0xb46d('0xf')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x4aabf9,_0x6818cc['error'][_0xb46d('0x10')]);return _0x306563(_0x6818cc['error'][_0xb46d('0x10')]);}logger[_0xb46d('0xe')](_0xb46d('0x11'),_0x4aabf9,_0x6818cc[_0xb46d('0xe')]['message']);return _0xb8a6f4(_0x6818cc[_0xb46d('0xe')][_0xb46d('0x10')]);}else{logger[_0xb46d('0xa')](_0xb46d('0x11'),_0x4aabf9,'request\x20sent');_0xb8a6f4(_0x6818cc[_0xb46d('0x12')]['message']);}})['catch'](function(_0x479e61){logger[_0xb46d('0xe')]('CmHopper,\x20%s,\x20%s',_0x4aabf9,_0x479e61);_0x306563(_0x479e61);});});}exports[_0xb46d('0x13')]=function(_0x2841de){var _0xe5254=this;return new Promise(function(_0x52e076,_0x376b42){return db[_0xb46d('0x14')][_0xb46d('0x15')]({'raw':_0x2841de[_0xb46d('0x16')]?_0x2841de['options'][_0xb46d('0x17')]===undefined?!![]:![]:!![],'where':_0x2841de[_0xb46d('0x16')]?_0x2841de[_0xb46d('0x16')]['where']||null:null,'attributes':_0x2841de['options']?_0x2841de[_0xb46d('0x16')][_0xb46d('0x18')]||null:null,'limit':_0x2841de[_0xb46d('0x16')]?_0x2841de[_0xb46d('0x16')][_0xb46d('0x19')]||null:null,'include':_0x2841de[_0xb46d('0x16')]?_0x2841de['options'][_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x2841de[_0xb46d('0x16')][_0xb46d('0x1a')],function(_0xd751ca){return{'model':db[_0xd751ca[_0xb46d('0x1c')]],'as':_0xd751ca['as'],'attributes':_0xd751ca[_0xb46d('0x18')],'include':_0xd751ca['include']?_[_0xb46d('0x1b')](_0xd751ca[_0xb46d('0x1a')],function(_0x5aba64){return{'model':db[_0x5aba64[_0xb46d('0x1c')]],'as':_0x5aba64['as'],'attributes':_0x5aba64[_0xb46d('0x18')],'include':_0x5aba64[_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x5aba64[_0xb46d('0x1a')],function(_0x259ad3){return{'model':db[_0x259ad3[_0xb46d('0x1c')]],'as':_0x259ad3['as'],'attributes':_0x259ad3[_0xb46d('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb46d('0x9')](function(_0x5355e5){logger[_0xb46d('0xa')](_0xb46d('0x13'),_0x2841de);logger[_0xb46d('0xc')](_0xb46d('0x13'),_0x2841de,JSON[_0xb46d('0xd')](_0x5355e5));_0x52e076(_0x5355e5);})[_0xb46d('0x1d')](function(_0x3eb1a3){logger['error'](_0xb46d('0x13'),_0x3eb1a3[_0xb46d('0x10')],_0x2841de);_0x376b42(_0xe5254[_0xb46d('0xe')](0x1f4,_0x3eb1a3[_0xb46d('0x10')]));});});};exports[_0xb46d('0x1e')]=function(_0x25a9a9){var _0x3ffbed=this;return new Promise(function(_0xedd0d5,_0x5569cf){return db['CmHopper'][_0xb46d('0x1f')]({'raw':_0x25a9a9['options']?_0x25a9a9[_0xb46d('0x16')][_0xb46d('0x17')]===undefined?!![]:![]:!![],'where':_0x25a9a9['options']?_0x25a9a9[_0xb46d('0x16')][_0xb46d('0x20')]||null:null,'attributes':_0x25a9a9[_0xb46d('0x16')]?_0x25a9a9[_0xb46d('0x16')][_0xb46d('0x18')]||null:null,'include':_0x25a9a9['options']?_0x25a9a9[_0xb46d('0x16')][_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x25a9a9['options'][_0xb46d('0x1a')],function(_0x12e0da){return{'model':db[_0x12e0da['model']],'as':_0x12e0da['as'],'attributes':_0x12e0da[_0xb46d('0x18')],'include':_0x12e0da[_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x12e0da[_0xb46d('0x1a')],function(_0x163474){return{'model':db[_0x163474[_0xb46d('0x1c')]],'as':_0x163474['as'],'attributes':_0x163474['attributes'],'include':_0x163474[_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x163474[_0xb46d('0x1a')],function(_0x4e47fc){return{'model':db[_0x4e47fc[_0xb46d('0x1c')]],'as':_0x4e47fc['as'],'attributes':_0x4e47fc[_0xb46d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x168ff7){logger[_0xb46d('0xa')](_0xb46d('0x1e'),_0x25a9a9);logger['debug']('ShowCmHopper',_0x25a9a9,JSON[_0xb46d('0xd')](_0x168ff7));_0xedd0d5(_0x168ff7);})[_0xb46d('0x1d')](function(_0x5d5dfa){logger['error'](_0xb46d('0x1e'),_0x5d5dfa[_0xb46d('0x10')],_0x25a9a9);_0x5569cf(_0x3ffbed[_0xb46d('0xe')](0x1f4,_0x5d5dfa[_0xb46d('0x10')]));});});};exports['CreateCmHopper']=function(_0x276f7c){var _0x3511d2=this;return new Promise(function(_0xce5cf1,_0x4d8688){return db['CmHopper'][_0xb46d('0x21')](_0x276f7c[_0xb46d('0x22')],{'raw':_0x276f7c['options']?_0x276f7c['options'][_0xb46d('0x17')]===undefined?!![]:![]:!![]})[_0xb46d('0x9')](function(_0x385a41){logger[_0xb46d('0xa')](_0xb46d('0x23'),_0x276f7c);logger['debug']('CreateCmHopper',_0x276f7c,JSON[_0xb46d('0xd')](_0x385a41));_0xce5cf1(_0x385a41);})[_0xb46d('0x1d')](function(_0x5e0044){logger['error'](_0xb46d('0x23'),_0x5e0044[_0xb46d('0x10')],_0x276f7c);_0x4d8688(_0x3511d2[_0xb46d('0xe')](0x1f4,_0x5e0044[_0xb46d('0x10')]));});});};exports[_0xb46d('0x24')]=function(_0x180dec){var _0x12b234=this;return new Promise(function(_0x19ab91,_0x3cb6bf){return db[_0xb46d('0x14')][_0xb46d('0x25')](_0x180dec[_0xb46d('0x22')],{'raw':_0x180dec[_0xb46d('0x16')]?_0x180dec[_0xb46d('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x180dec[_0xb46d('0x16')]?_0x180dec[_0xb46d('0x16')][_0xb46d('0x20')]||null:null,'attributes':_0x180dec['options']?_0x180dec['options'][_0xb46d('0x18')]||null:null,'limit':_0x180dec['options']?_0x180dec[_0xb46d('0x16')][_0xb46d('0x19')]||null:null})[_0xb46d('0x9')](function(_0x306257){logger[_0xb46d('0xa')](_0xb46d('0x24'),_0x180dec);logger['info'](_0xb46d('0x26'),JSON['stringify'](_0x180dec['options'][_0xb46d('0x20')]),_0x180dec['body']['active']);logger[_0xb46d('0xc')](_0xb46d('0x24'),_0x180dec,JSON[_0xb46d('0xd')](_0x306257));_0x19ab91(_0x306257);})[_0xb46d('0x1d')](function(_0x2d3e34){logger[_0xb46d('0xe')](_0xb46d('0x24'),_0x2d3e34[_0xb46d('0x10')],_0x180dec);_0x3cb6bf(_0x12b234[_0xb46d('0xe')](0x1f4,_0x2d3e34[_0xb46d('0x10')]));});});};exports[_0xb46d('0x27')]=function(_0x5ce653){var _0x2ce0ac=this;return new Promise(function(_0x15478e,_0x4447c4){return db['CmHopper'][_0xb46d('0x28')]({'where':_0x5ce653[_0xb46d('0x16')]?_0x5ce653[_0xb46d('0x16')][_0xb46d('0x20')]||null:null})[_0xb46d('0x9')](function(_0x3bdd8a){logger[_0xb46d('0xa')](_0xb46d('0x27'),_0x5ce653);logger[_0xb46d('0xc')](_0xb46d('0x27'),_0x5ce653,JSON['stringify'](_0x3bdd8a));_0x15478e(_0x3bdd8a);})['catch'](function(_0x58a101){logger[_0xb46d('0xe')](_0xb46d('0x27'),_0x58a101[_0xb46d('0x10')],_0x5ce653);_0x4447c4(_0x2ce0ac['error'](0x1f4,_0x58a101[_0xb46d('0x10')]));});});};exports[_0xb46d('0x29')]=function(_0x65dd62){var _0x5698cd=this;return new Promise(function(_0x282904,_0x491c23){return db[_0xb46d('0x2a')][_0xb46d('0x2b')]()[_0xb46d('0x9')](function(_0x556532){return db[_0xb46d('0x2c')]['transaction'](function(_0x145b9a){return db[_0xb46d('0x14')]['findAll']({'where':_0x65dd62[_0xb46d('0x16')]?_0x65dd62['options'][_0xb46d('0x20')]||null:null,'attributes':_0x65dd62[_0xb46d('0x16')]?_0x65dd62['options'][_0xb46d('0x18')]||null:null,'limit':_0x65dd62[_0xb46d('0x16')]?_0x65dd62[_0xb46d('0x16')][_0xb46d('0x19')]||null:null,'order':_0x65dd62[_0xb46d('0x16')]?_0x65dd62[_0xb46d('0x16')][_0xb46d('0x2d')]||null:null,'transaction':_0x145b9a,'lock':_0x145b9a[_0xb46d('0x2e')][_0xb46d('0x2f')],'include':[{'model':db['CmContact'],'as':_0xb46d('0x30'),'attributes':_[_0xb46d('0x31')](_0x556532)},{'model':db[_0xb46d('0x32')],'as':_0xb46d('0x33'),'attributes':['id','name',_0xb46d('0x34')]}]})[_0xb46d('0x9')](function(_0x4c49d1){var _0x5ebfa0=[];var _0x155b21=[];for(var _0xd1852c=0x0;_0xd1852c<_0x4c49d1['length'];_0xd1852c+=0x1){var _0x28098b=_0x4c49d1[_0xd1852c][_0xb46d('0x35')];if(_0x28098b===null){_0x5ebfa0[_0xb46d('0x36')](_0x4c49d1[_0xd1852c][_0xb46d('0x25')](_0x65dd62[_0xb46d('0x22')],{'transaction':_0x145b9a}));}else if(!_0x155b21['includes'](_0x28098b)){_0x155b21[_0xb46d('0x36')](_0x28098b);_0x5ebfa0[_0xb46d('0x36')](_0x4c49d1[_0xd1852c]['update'](_0x65dd62[_0xb46d('0x22')],{'transaction':_0x145b9a}));}}return BPromise['all'](_0x5ebfa0);});})['then'](function(_0x315ef0){logger['info'](_0xb46d('0x29'),_0x65dd62);if(_0x315ef0[_0xb46d('0x37')]>0x0){logger['info'](_0xb46d('0x38'),_0x315ef0[0x0][_0xb46d('0x39')]['id'],_0x315ef0[0x0][_0xb46d('0x39')]['ContactId'],_0x315ef0[0x0]['dataValues'][_0xb46d('0x3a')]);}logger[_0xb46d('0xc')](_0xb46d('0x29'),_0x65dd62,JSON[_0xb46d('0xd')](_0x315ef0));_0x282904(_0x315ef0);})['catch'](function(_0x2a63d5){logger[_0xb46d('0xe')](_0xb46d('0x29'),_0x2a63d5[_0xb46d('0x10')],_0x65dd62);_0x491c23(_0x5698cd[_0xb46d('0xe')](0x1f4,_0x2a63d5[_0xb46d('0x10')]));});});});};exports[_0xb46d('0x3b')]=function(_0x4b82a8){var _0x5c7af7=this;return new Promise(function(_0x31828d,_0x42b5c6){return db['sequelize'][_0xb46d('0x3c')](function(_0xdfaf5d){return db[_0xb46d('0x3d')]['create'](_0x4b82a8[_0xb46d('0x22')],{'raw':_0x4b82a8[_0xb46d('0x16')]?_0x4b82a8[_0xb46d('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0xdfaf5d})[_0xb46d('0x9')](function(){logger['info'](_0xb46d('0x3e'),JSON[_0xb46d('0xd')](_0x4b82a8[_0xb46d('0x16')][_0xb46d('0x20')]),_0x4b82a8[_0xb46d('0x16')][_0xb46d('0x20')][_0xb46d('0x3a')]);return db[_0xb46d('0x14')][_0xb46d('0x28')]({'where':_0x4b82a8[_0xb46d('0x16')]?_0x4b82a8[_0xb46d('0x16')][_0xb46d('0x20')]||null:null,'transaction':_0xdfaf5d});});})['then'](function(_0x5a96f9){logger['info'](_0xb46d('0x3b'),_0x4b82a8);logger['debug'](_0xb46d('0x3b'),_0x4b82a8,JSON[_0xb46d('0xd')](_0x5a96f9));_0x31828d(_0x5a96f9);})['catch'](function(_0x3b2417){logger[_0xb46d('0xe')](_0xb46d('0x3b'),_0x3b2417['message'],_0x4b82a8);_0x42b5c6(_0x5c7af7['error'](0x1f4,_0x3b2417[_0xb46d('0x10')]));});});};exports[_0xb46d('0x3f')]=function(_0x48de5a){var _0x22ccd0=this;return new Promise(function(_0x47fe47,_0x29fa23){return db[_0xb46d('0x14')][_0xb46d('0x15')]({'raw':_0x48de5a[_0xb46d('0x16')]?_0x48de5a['options'][_0xb46d('0x17')]===undefined?!![]:![]:!![],'where':_0x48de5a[_0xb46d('0x16')]?_0x48de5a[_0xb46d('0x16')][_0xb46d('0x20')]||null:null,'attributes':[[db[_0xb46d('0x2c')]['fn'](_0xb46d('0x40'),db[_0xb46d('0x2c')]['fn']('IF',db[_0xb46d('0x2c')][_0xb46d('0x41')]('`scheduledat`\x20>=\x20'+util[_0xb46d('0x42')](_0xb46d('0x43'),moment()[_0xb46d('0x42')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0xb46d('0x44')]]})[_0xb46d('0x9')](function(_0x594bc1){logger[_0xb46d('0xa')]('CountReScheduled',_0x48de5a);logger['debug'](_0xb46d('0x3f'),_0x48de5a,JSON[_0xb46d('0xd')](_0x594bc1));_0x47fe47(_0x594bc1);})['catch'](function(_0x5af9f3){logger[_0xb46d('0xe')](_0xb46d('0x3f'),_0x5af9f3[_0xb46d('0x10')],_0x48de5a);_0x29fa23(_0x22ccd0[_0xb46d('0xe')](0x1f4,_0x5af9f3[_0xb46d('0x10')]));});});};exports[_0xb46d('0x45')]=function(_0x147eef){var _0x129ffb=this;return new Promise(function(_0x11203e,_0x286858){return db[_0xb46d('0x2a')][_0xb46d('0x2b')]()[_0xb46d('0x9')](function(_0x988692){return db[_0xb46d('0x2c')][_0xb46d('0x3c')](function(_0x34eff8){return db['CmHopper'][_0xb46d('0x15')]({'where':_0x147eef['options']?_0x147eef[_0xb46d('0x16')]['where']||null:null,'attributes':_0x147eef['options']?_0x147eef[_0xb46d('0x16')][_0xb46d('0x18')]||null:null,'limit':0x1,'order':_0x147eef[_0xb46d('0x16')]?_0x147eef[_0xb46d('0x16')][_0xb46d('0x2d')]||null:null,'group':db[_0xb46d('0x14')][_0xb46d('0x35')],'transaction':_0x34eff8,'lock':_0x34eff8['LOCK'][_0xb46d('0x2f')],'include':_0x147eef[_0xb46d('0x16')]?_0x147eef[_0xb46d('0x16')][_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x147eef[_0xb46d('0x16')][_0xb46d('0x1a')],function(_0x4b0aa5){return{'model':db[_0x4b0aa5[_0xb46d('0x1c')]],'as':_0x4b0aa5['as'],'attributes':_0x4b0aa5[_0xb46d('0x18')],'include':_0x4b0aa5[_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x4b0aa5[_0xb46d('0x1a')],function(_0x3ed4dc){return{'model':db[_0x3ed4dc[_0xb46d('0x1c')]],'as':_0x3ed4dc['as'],'attributes':_0x3ed4dc['attributes'],'include':_0x3ed4dc['include']?_[_0xb46d('0x1b')](_0x3ed4dc[_0xb46d('0x1a')],function(_0x592022){return{'model':db[_0x592022[_0xb46d('0x1c')]],'as':_0x592022['as'],'attributes':_0x592022['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d9360){var _0x2df298=[];for(var _0x5536bc=0x0;_0x5536bc<_0x1d9360[_0xb46d('0x37')];_0x5536bc+=0x1){_0x2df298[_0xb46d('0x36')](_0x1d9360[_0x5536bc][_0xb46d('0x25')](_0x147eef[_0xb46d('0x22')],{'transaction':_0x34eff8}));}return BPromise[_0xb46d('0x46')](_0x2df298);});})[_0xb46d('0x9')](function(_0x3bdacd){logger[_0xb46d('0xa')](_0xb46d('0x45'),_0x147eef);logger[_0xb46d('0xc')](_0xb46d('0x45'),_0x147eef,JSON[_0xb46d('0xd')](_0x3bdacd));_0x11203e(_0x3bdacd);})['catch'](function(_0x3b340e){logger[_0xb46d('0xe')](_0xb46d('0x45'),_0x3b340e[_0xb46d('0x10')],_0x147eef);_0x286858(_0x129ffb['error'](0x1f4,_0x3b340e[_0xb46d('0x10')]));});});});};exports[_0xb46d('0x47')]=function(_0x15f793){var _0x4c7bc7=this;return new Promise(function(_0x5c0991,_0x84f893){db[_0xb46d('0x2a')][_0xb46d('0x2b')]()[_0xb46d('0x9')](function(_0x71b391){return db[_0xb46d('0x14')][_0xb46d('0x15')]({'raw':_0x15f793[_0xb46d('0x16')]?_0x15f793['options'][_0xb46d('0x17')]===undefined?!![]:![]:!![],'where':_0x15f793['options']?_0x15f793[_0xb46d('0x16')][_0xb46d('0x20')]||null:null,'attributes':_0x15f793[_0xb46d('0x16')]?_0x15f793[_0xb46d('0x16')]['attributes']||null:null,'limit':_0x15f793[_0xb46d('0x16')]?_0x15f793[_0xb46d('0x16')][_0xb46d('0x19')]||null:null,'include':_0x15f793[_0xb46d('0x16')]?_0x15f793[_0xb46d('0x16')][_0xb46d('0x1a')]?_['map'](_0x15f793[_0xb46d('0x16')][_0xb46d('0x1a')],function(_0x327e79){return{'model':db[_0x327e79[_0xb46d('0x1c')]],'as':_0x327e79['as'],'attributes':_0x327e79['as']===_0xb46d('0x30')?_[_0xb46d('0x31')](_0x71b391):_0x327e79[_0xb46d('0x18')],'include':_0x327e79[_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x327e79[_0xb46d('0x1a')],function(_0x12cfd4){return{'model':db[_0x12cfd4[_0xb46d('0x1c')]],'as':_0x12cfd4['as'],'attributes':_0x12cfd4[_0xb46d('0x18')],'include':_0x12cfd4[_0xb46d('0x1a')]?_[_0xb46d('0x1b')](_0x12cfd4[_0xb46d('0x1a')],function(_0x24552e){return{'model':db[_0x24552e[_0xb46d('0x1c')]],'as':_0x24552e['as'],'attributes':_0x24552e[_0xb46d('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb46d('0x9')](function(_0x534dd5){logger['info']('GetCmHopper',_0x15f793);logger[_0xb46d('0xc')](_0xb46d('0x13'),_0x15f793,JSON['stringify'](_0x534dd5));_0x5c0991(_0x534dd5);})[_0xb46d('0x1d')](function(_0x5ac517){logger[_0xb46d('0xe')](_0xb46d('0x13'),_0x5ac517['message'],_0x15f793);_0x84f893(_0x4c7bc7['error'](0x1f4,_0x5ac517[_0xb46d('0x10')]));});});});};exports[_0xb46d('0x48')]=function(_0x3a54f0){var _0x4e860d=this;return new Promise(function(_0x24700e,_0x289a93){return db[_0xb46d('0x2a')][_0xb46d('0x49')]({'raw':!![],'where':{'phone':_0x3a54f0[_0xb46d('0x16')]['where'][_0xb46d('0x4a')]},'attributes':['id',_0xb46d('0x4b')],'order':[['id',_0xb46d('0x4c')]]})['then'](function(_0x33890e){logger['info'](_0xb46d('0x4d'),_0x3a54f0);logger[_0xb46d('0xc')](_0xb46d('0x4d'),_0x3a54f0,JSON[_0xb46d('0xd')](_0x33890e));_0x24700e(_0x33890e);})[_0xb46d('0x1d')](function(_0x399c60){logger[_0xb46d('0xe')](_0xb46d('0x4d'),_0x399c60[_0xb46d('0x10')],_0x3a54f0);_0x289a93(_0x4e860d[_0xb46d('0xe')](0x1f4,_0x399c60[_0xb46d('0x10')]));});});};exports[_0xb46d('0x4e')]=function(_0x382d1a){var _0x4f01ab=this;return new Promise(function(_0x40c489,_0x5dd4ea){return db[_0xb46d('0x2c')]['transaction'](function(_0x4bf6eb){return db['CmHopper'][_0xb46d('0x25')](_0x382d1a[_0xb46d('0x22')],{'where':{},'transaction':_0x4bf6eb})[_0xb46d('0x9')](function(_0x32015d){logger[_0xb46d('0xa')](_0xb46d('0x4e'),_0x382d1a);logger[_0xb46d('0xc')](_0xb46d('0x4e'),_0x382d1a,JSON[_0xb46d('0xd')](_0x32015d));_0x40c489(_0x32015d);})[_0xb46d('0x1d')](function(_0x39d372){logger[_0xb46d('0xe')](_0xb46d('0x4e'),_0x39d372[_0xb46d('0x10')],_0x382d1a);_0x5dd4ea(_0x4f01ab[_0xb46d('0xe')](0x1f4,_0x39d372['message']));});});});};exports[_0xb46d('0x4f')]=function(_0x24189d){var _0x479809=this;var _0x1302ed=_0x24189d[_0xb46d('0x22')][_0xb46d('0x20')][_0xb46d('0x50')];var _0x471bb8=_0x24189d[_0xb46d('0x22')][_0xb46d('0x20')]['interval'];var _0x253a9=_0x24189d[_0xb46d('0x22')][_0xb46d('0x20')][_0xb46d('0x51')];return new Promise(function(_0x1c0b07,_0x519c62){return db[_0xb46d('0x14')][_0xb46d('0x15')]({'where':{'voiceQueueId':{'$in':_0x1302ed},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb46d('0x2c')][_0xb46d('0x41')](_0xb46d('0x52')+_0x471bb8+_0xb46d('0x53')),'$gt':db[_0xb46d('0x2c')][_0xb46d('0x41')](_0xb46d('0x54'))}},'UserId':{'$in':_0x253a9}},'include':[{'model':db[_0xb46d('0x2a')],'as':_0xb46d('0x30')},{'model':db['User'],'as':_0xb46d('0x33'),'attributes':['id',_0xb46d('0x55'),_0xb46d('0x34')]},{'model':db[_0xb46d('0x56')],'as':_0xb46d('0x57')}]})['then'](function(_0x41902d){if(_0x41902d['length']>0x0){return db['sequelize']['transaction'](function(_0x38d04b){return db[_0xb46d('0x14')][_0xb46d('0x25')]({'recallmeNotifiedDate':db['sequelize'][_0xb46d('0x41')]('NOW()')},{'where':{'id':{'$in':_[_0xb46d('0x1b')](_0x41902d,'id')}},'transaction':_0x38d04b})[_0xb46d('0x9')](function(){_0x1c0b07(_0x41902d);})[_0xb46d('0x1d')](function(_0x1448a7){logger[_0xb46d('0xe')]('CmHopperHandlePreviewRecallNotifications',_0x1448a7[_0xb46d('0x10')],_0x24189d);_0x519c62(_0x479809['error'](0x1f4,_0x1448a7[_0xb46d('0x10')]));});})[_0xb46d('0x1d')](function(_0x3585d5){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x3585d5[_0xb46d('0x10')],_0x24189d);_0x519c62(_0x479809[_0xb46d('0xe')](0x1f4,_0x3585d5[_0xb46d('0x10')]));});}else{_0x1c0b07(_0x41902d);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8a7f0cc..9c66132 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 _0x5774=['create','/preview','/timezone','put','update','delete','exports','express','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','getPreviewRecall','post'];(function(_0x183f53,_0x4e7018){var _0xeb2b92=function(_0x5d1dd4){while(--_0x5d1dd4){_0x183f53['push'](_0x183f53['shift']());}};_0xeb2b92(++_0x4e7018);}(_0x5774,0xf9));var _0x4577=function(_0x35f6d9,_0x4dba0a){_0x35f6d9=_0x35f6d9-0x0;var _0x77cfe5=_0x5774[_0x35f6d9];return _0x77cfe5;};'use strict';var express=require(_0x4577('0x0'));var router=express['Router']();var auth=require(_0x4577('0x1'));var controller=require(_0x4577('0x2'));router[_0x4577('0x3')]('/',auth[_0x4577('0x4')](),controller[_0x4577('0x5')]);router['get']('/describe',auth[_0x4577('0x4')](),controller[_0x4577('0x6')]);router[_0x4577('0x3')](_0x4577('0x7'),auth[_0x4577('0x4')](),controller[_0x4577('0x8')]);router['get'](_0x4577('0x9'),auth[_0x4577('0x4')](),controller[_0x4577('0xa')]);router[_0x4577('0x3')](_0x4577('0xb'),auth['isAuthenticated'](),controller[_0x4577('0xc')]);router[_0x4577('0x3')]('/:id/previewrecall',auth[_0x4577('0x4')](),controller[_0x4577('0xd')]);router[_0x4577('0xe')]('/',auth[_0x4577('0x4')](),controller[_0x4577('0xf')]);router[_0x4577('0xe')](_0x4577('0x10'),auth[_0x4577('0x4')](),controller['getPreview']);router[_0x4577('0xe')](_0x4577('0x11'),auth[_0x4577('0x4')](),controller['getTimezone']);router[_0x4577('0x12')](_0x4577('0xb'),auth[_0x4577('0x4')](),controller[_0x4577('0x13')]);router[_0x4577('0x14')](_0x4577('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4577('0x15')]=router; \ No newline at end of file +var _0x591a=['../../components/auth/service','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router'];(function(_0x5441c8,_0x3c7f77){var _0x159a87=function(_0x53710c){while(--_0x53710c){_0x5441c8['push'](_0x5441c8['shift']());}};_0x159a87(++_0x3c7f77);}(_0x591a,0xee));var _0xa591=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0x591a[_0x28c939];return _0x527fe9;};'use strict';var express=require(_0xa591('0x0'));var router=express[_0xa591('0x1')]();var auth=require(_0xa591('0x2'));var controller=require('./cmHopper.controller');router[_0xa591('0x3')]('/',auth[_0xa591('0x4')](),controller[_0xa591('0x5')]);router[_0xa591('0x3')]('/describe',auth[_0xa591('0x4')](),controller[_0xa591('0x6')]);router[_0xa591('0x3')](_0xa591('0x7'),auth[_0xa591('0x4')](),controller[_0xa591('0x8')]);router[_0xa591('0x3')](_0xa591('0x9'),auth['isAuthenticated'](),controller[_0xa591('0xa')]);router[_0xa591('0x3')](_0xa591('0xb'),auth[_0xa591('0x4')](),controller['show']);router[_0xa591('0x3')]('/:id/previewrecall',auth['isAuthenticated'](),controller[_0xa591('0xc')]);router[_0xa591('0xd')]('/',auth['isAuthenticated'](),controller[_0xa591('0xe')]);router[_0xa591('0xd')](_0xa591('0xf'),auth['isAuthenticated'](),controller[_0xa591('0x10')]);router[_0xa591('0xd')](_0xa591('0x11'),auth[_0xa591('0x4')](),controller[_0xa591('0x12')]);router[_0xa591('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa591('0x14')]);router[_0xa591('0x15')](_0xa591('0xb'),auth[_0xa591('0x4')](),controller[_0xa591('0x16')]);module[_0xa591('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index f1abf7f..6ea410d 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c51=['sequelize','exports','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x5b1e5a,_0x2a806b){var _0x28ed22=function(_0x1b99d1){while(--_0x1b99d1){_0x5b1e5a['push'](_0x5b1e5a['shift']());}};_0x28ed22(++_0x2a806b);}(_0x0c51,0xf4));var _0x10c5=function(_0x41b022,_0x29c6c5){_0x41b022=_0x41b022-0x0;var _0x20fe55=_0x0c51[_0x41b022];return _0x20fe55;};'use strict';var moment=require(_0x10c5('0x0'));var Sequelize=require(_0x10c5('0x1'));module[_0x10c5('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x10c5('0x4')],'defaultValue':moment()[_0x10c5('0x5')](_0x10c5('0x6'))},'countbusyretry':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x10c5('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3ab6=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3ab6,0x1a6));var _0x63ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab6[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x63ab('0x0'));module[_0x63ab('0x1')]={'CmHopperId':{'type':Sequelize[_0x63ab('0x2')]},'phone':{'type':Sequelize[_0x63ab('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x63ab('0x4')],'defaultValue':moment()[_0x63ab('0x5')](_0x63ab('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x63ab('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x63ab('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x63ab('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x63ab('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x63ab('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 0f7982f..1b11b83 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f8e=['../../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','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','CmHopperAdditionalPhone','fieldName','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','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis'];(function(_0x1a3474,_0x24fb50){var _0x35d9d1=function(_0x29476c){while(--_0x29476c){_0x1a3474['push'](_0x1a3474['shift']());}};_0x35d9d1(++_0x24fb50);}(_0x2f8e,0x1ee));var _0xe2f8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2f8e[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xe2f8('0x0'));var rimraf=require(_0xe2f8('0x1'));var zipdir=require(_0xe2f8('0x2'));var jsonpatch=require(_0xe2f8('0x3'));var rp=require(_0xe2f8('0x4'));var moment=require('moment');var BPromise=require(_0xe2f8('0x5'));var Mustache=require(_0xe2f8('0x6'));var util=require('util');var path=require(_0xe2f8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe2f8('0x8'));var fs=require('fs');var fs_extra=require(_0xe2f8('0x9'));var _=require(_0xe2f8('0xa'));var squel=require(_0xe2f8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe2f8('0xc'));var querystring=require(_0xe2f8('0xd'));var Papa=require(_0xe2f8('0xe'));var Redis=require(_0xe2f8('0xf'));var authService=require(_0xe2f8('0x10'));var qs=require(_0xe2f8('0x11'));var as=require(_0xe2f8('0x12'));var hardwareService=require(_0xe2f8('0x13'));var logger=require(_0xe2f8('0x14'))('api');var utils=require(_0xe2f8('0x15'));var config=require(_0xe2f8('0x16'));var licenseUtil=require(_0xe2f8('0x17'));var db=require(_0xe2f8('0x18'))['db'];function respondWithStatusCode(_0x50a10b,_0x54a57b){_0x54a57b=_0x54a57b||0xcc;return function(_0x95dd8b){if(_0x95dd8b){return _0x50a10b[_0xe2f8('0x19')](_0x54a57b);}return _0x50a10b['status'](_0x54a57b)[_0xe2f8('0x1a')]();};}function respondWithResult(_0x2eabae,_0xd891d2){_0xd891d2=_0xd891d2||0xc8;return function(_0x3c7b37){if(_0x3c7b37){return _0x2eabae[_0xe2f8('0x1b')](_0xd891d2)['json'](_0x3c7b37);}};}function respondWithFilteredResult(_0x9c5771,_0x5beb68){return function(_0xb3b783){if(_0xb3b783){var _0x224b0c=typeof _0x5beb68[_0xe2f8('0x1c')]===_0xe2f8('0x1d')&&typeof _0x5beb68[_0xe2f8('0x1e')]===_0xe2f8('0x1d');var _0xfd8001=_0xb3b783['count'];var _0x4a3e7c=_0x224b0c?0x0:_0x5beb68[_0xe2f8('0x1c')];var _0x2f6054=_0x224b0c?_0xb3b783[_0xe2f8('0x1f')]:_0x5beb68[_0xe2f8('0x1c')]+_0x5beb68[_0xe2f8('0x1e')];var _0x54c27f;if(_0x2f6054>=_0xfd8001){_0x2f6054=_0xfd8001;_0x54c27f=0xc8;}else{_0x54c27f=0xce;}_0x9c5771['status'](_0x54c27f);return _0x9c5771['set'](_0xe2f8('0x20'),_0x4a3e7c+'-'+_0x2f6054+'/'+_0xfd8001)['json'](_0xb3b783);}return null;};}function patchUpdates(_0x4f7f8e){return function(_0x1fcfc0){try{jsonpatch[_0xe2f8('0x21')](_0x1fcfc0,_0x4f7f8e,!![]);}catch(_0x30829d){return BPromise[_0xe2f8('0x22')](_0x30829d);}return _0x1fcfc0[_0xe2f8('0x23')]();};}function saveUpdates(_0x2a816a,_0x8afbd6){return function(_0x3dd25d){if(_0x3dd25d){return _0x3dd25d[_0xe2f8('0x24')](_0x2a816a)[_0xe2f8('0x25')](function(_0x4baf8c){return _0x4baf8c;});}return null;};}function removeEntity(_0x19310e,_0x324ef2){return function(_0x2886d5){if(_0x2886d5){return _0x2886d5[_0xe2f8('0x26')]()[_0xe2f8('0x25')](function(){var _0x4f75b4=_0x2886d5[_0xe2f8('0x27')]({'plain':!![]});var _0x1b163c=_0xe2f8('0x28');return db[_0xe2f8('0x29')][_0xe2f8('0x26')]({'where':{'type':_0x1b163c,'resourceId':_0x4f75b4['id']}})[_0xe2f8('0x25')](function(){return _0x2886d5;});})[_0xe2f8('0x25')](function(){_0x19310e[_0xe2f8('0x1b')](0xcc)[_0xe2f8('0x1a')]();});}};}function handleEntityNotFound(_0x251e28,_0x27a555){return function(_0x2a2073){if(!_0x2a2073){_0x251e28['sendStatus'](0x194);}return _0x2a2073;};}function handleError(_0x2574fa,_0x3d8622){_0x3d8622=_0x3d8622||0x1f4;return function(_0x588d01){logger[_0xe2f8('0x2a')](_0x588d01[_0xe2f8('0x2b')]);if(_0x588d01[_0xe2f8('0x2c')]){delete _0x588d01[_0xe2f8('0x2c')];}_0x2574fa['status'](_0x3d8622)[_0xe2f8('0x2d')](_0x588d01);};}exports[_0xe2f8('0x2e')]=function(_0x101363,_0x320045){var _0x16f9b6={},_0x41a2f9={},_0x40c711={'count':0x0,'rows':[]};var _0x4cc3cd=_[_0xe2f8('0x2f')](db[_0xe2f8('0x30')]['rawAttributes'],function(_0x969b55){return{'name':_0x969b55[_0xe2f8('0x31')],'type':_0x969b55[_0xe2f8('0x32')][_0xe2f8('0x33')]};});_0x41a2f9[_0xe2f8('0x34')]=_['map'](_0x4cc3cd,'name');_0x41a2f9[_0xe2f8('0x35')]=_[_0xe2f8('0x36')](_0x101363['query']);_0x41a2f9[_0xe2f8('0x37')]=_[_0xe2f8('0x38')](_0x41a2f9[_0xe2f8('0x34')],_0x41a2f9['query']);_0x16f9b6[_0xe2f8('0x39')]=_[_0xe2f8('0x38')](_0x41a2f9[_0xe2f8('0x34')],qs[_0xe2f8('0x3a')](_0x101363[_0xe2f8('0x35')][_0xe2f8('0x3a')]));_0x16f9b6['attributes']=_0x16f9b6[_0xe2f8('0x39')]['length']?_0x16f9b6['attributes']:_0x41a2f9[_0xe2f8('0x34')];if(!_0x101363[_0xe2f8('0x35')][_0xe2f8('0x3b')](_0xe2f8('0x3c'))){_0x16f9b6[_0xe2f8('0x1e')]=qs['limit'](_0x101363['query'][_0xe2f8('0x1e')]);_0x16f9b6[_0xe2f8('0x1c')]=qs[_0xe2f8('0x1c')](_0x101363[_0xe2f8('0x35')]['offset']);}_0x16f9b6[_0xe2f8('0x3d')]=qs[_0xe2f8('0x3e')](_0x101363['query'][_0xe2f8('0x3e')]);_0x16f9b6[_0xe2f8('0x3f')]=qs['filters'](_[_0xe2f8('0x40')](_0x101363[_0xe2f8('0x35')],_0x41a2f9[_0xe2f8('0x37')]),_0x4cc3cd);if(_0x101363[_0xe2f8('0x35')][_0xe2f8('0x41')]){_0x16f9b6[_0xe2f8('0x3f')]=_[_0xe2f8('0x42')](_0x16f9b6[_0xe2f8('0x3f')],{'$or':_[_0xe2f8('0x2f')](_0x4cc3cd,function(_0x3efea2){if(_0x3efea2['type']!==_0xe2f8('0x43')){var _0x2c7e98={};_0x2c7e98[_0x3efea2[_0xe2f8('0x2c')]]={'$like':'%'+_0x101363[_0xe2f8('0x35')][_0xe2f8('0x41')]+'%'};return _0x2c7e98;}})});}_0x16f9b6=_[_0xe2f8('0x42')]({},_0x16f9b6,_0x101363[_0xe2f8('0x44')]);var _0x48f394={'where':_0x16f9b6['where']};return db['CmHopperAdditionalPhone']['count'](_0x48f394)[_0xe2f8('0x25')](function(_0x55a731){_0x40c711[_0xe2f8('0x1f')]=_0x55a731;if(_0x101363[_0xe2f8('0x35')]['includeAll']){_0x16f9b6['include']=[{'all':!![]}];}return db[_0xe2f8('0x30')][_0xe2f8('0x45')](_0x16f9b6);})[_0xe2f8('0x25')](function(_0x2be9b6){_0x40c711[_0xe2f8('0x46')]=_0x2be9b6;return _0x40c711;})['then'](respondWithFilteredResult(_0x320045,_0x16f9b6))[_0xe2f8('0x47')](handleError(_0x320045,null));};exports[_0xe2f8('0x48')]=function(_0xdce214,_0x59ec36){var _0x2d1d7c={'raw':!![],'where':{'id':_0xdce214[_0xe2f8('0x49')]['id']}},_0x4fc5d5={};_0x4fc5d5[_0xe2f8('0x34')]=_['keys'](db['CmHopperAdditionalPhone'][_0xe2f8('0x4a')]);_0x4fc5d5['query']=_[_0xe2f8('0x36')](_0xdce214[_0xe2f8('0x35')]);_0x4fc5d5['filters']=_[_0xe2f8('0x38')](_0x4fc5d5['model'],_0x4fc5d5['query']);_0x2d1d7c[_0xe2f8('0x39')]=_[_0xe2f8('0x38')](_0x4fc5d5['model'],qs['fields'](_0xdce214['query'][_0xe2f8('0x3a')]));_0x2d1d7c[_0xe2f8('0x39')]=_0x2d1d7c[_0xe2f8('0x39')][_0xe2f8('0x4b')]?_0x2d1d7c[_0xe2f8('0x39')]:_0x4fc5d5[_0xe2f8('0x34')];if(_0xdce214[_0xe2f8('0x35')]['includeAll']){_0x2d1d7c['include']=[{'all':!![]}];}_0x2d1d7c=_['merge']({},_0x2d1d7c,_0xdce214[_0xe2f8('0x44')]);return db[_0xe2f8('0x30')][_0xe2f8('0x4c')](_0x2d1d7c)['then'](handleEntityNotFound(_0x59ec36,null))[_0xe2f8('0x25')](respondWithResult(_0x59ec36,null))['catch'](handleError(_0x59ec36,null));};exports['create']=function(_0x2c0f6f,_0x489cb3){return db[_0xe2f8('0x30')]['create'](_0x2c0f6f[_0xe2f8('0x4d')],{})['then'](function(_0x2776bd){var _0x23ec65=_0x2c0f6f[_0xe2f8('0x4e')][_0xe2f8('0x27')]({'plain':!![]});if(!_0x23ec65)throw new Error(_0xe2f8('0x4f'));if(_0x23ec65[_0xe2f8('0x50')]===_0xe2f8('0x4e')){var _0x27eee6=_0x2776bd[_0xe2f8('0x27')]({'plain':!![]});var _0x373d29=_0xe2f8('0x28');return db[_0xe2f8('0x51')][_0xe2f8('0x4c')]({'where':{'name':_0x373d29,'userProfileId':_0x23ec65['userProfileId']},'raw':!![]})[_0xe2f8('0x25')](function(_0xb9222f){if(_0xb9222f&&_0xb9222f[_0xe2f8('0x52')]===0x0){return db['UserProfileResource'][_0xe2f8('0x53')]({'name':_0x27eee6['name'],'resourceId':_0x27eee6['id'],'type':_0xb9222f[_0xe2f8('0x2c')],'sectionId':_0xb9222f['id']},{})[_0xe2f8('0x25')](function(){return _0x2776bd;});}else{return _0x2776bd;}})[_0xe2f8('0x47')](function(_0x39d021){logger[_0xe2f8('0x2a')](_0xe2f8('0x54'),_0x39d021);throw _0x39d021;});}return _0x2776bd;})['then'](respondWithResult(_0x489cb3,0xc9))['catch'](handleError(_0x489cb3,null));};exports[_0xe2f8('0x24')]=function(_0x1dce1c,_0xe418fa){if(_0x1dce1c['body']['id']){delete _0x1dce1c[_0xe2f8('0x4d')]['id'];}return db[_0xe2f8('0x30')][_0xe2f8('0x4c')]({'where':{'id':_0x1dce1c[_0xe2f8('0x49')]['id']}})['then'](handleEntityNotFound(_0xe418fa,null))['then'](saveUpdates(_0x1dce1c[_0xe2f8('0x4d')],null))[_0xe2f8('0x25')](respondWithResult(_0xe418fa,null))['catch'](handleError(_0xe418fa,null));};exports[_0xe2f8('0x26')]=function(_0x30472b,_0x4a31f1){return db[_0xe2f8('0x30')][_0xe2f8('0x4c')]({'where':{'id':_0x30472b['params']['id']}})[_0xe2f8('0x25')](handleEntityNotFound(_0x4a31f1,null))[_0xe2f8('0x25')](removeEntity(_0x4a31f1,null))[_0xe2f8('0x47')](handleError(_0x4a31f1,null));}; \ No newline at end of file +var _0xe7a8=['to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CmHopperAdditionalPhones','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0xe7a8,0x198));var _0x8e7a=function(_0xedf622,_0x5a854d){_0xedf622=_0xedf622-0x0;var _0x245b71=_0xe7a8[_0xedf622];return _0x245b71;};'use strict';var emlformat=require(_0x8e7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e7a('0x1'));var jsonpatch=require(_0x8e7a('0x2'));var rp=require(_0x8e7a('0x3'));var moment=require(_0x8e7a('0x4'));var BPromise=require(_0x8e7a('0x5'));var Mustache=require(_0x8e7a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8e7a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e7a('0x8'));var squel=require(_0x8e7a('0x9'));var crypto=require('crypto');var jsforce=require(_0x8e7a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8e7a('0x7'));var querystring=require(_0x8e7a('0xb'));var Papa=require(_0x8e7a('0xc'));var Redis=require(_0x8e7a('0xd'));var authService=require(_0x8e7a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8e7a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e7a('0x10'))(_0x8e7a('0x11'));var utils=require('../../config/utils');var config=require(_0x8e7a('0x12'));var licenseUtil=require(_0x8e7a('0x13'));var db=require(_0x8e7a('0x14'))['db'];function respondWithStatusCode(_0x15ff0f,_0x57b533){_0x57b533=_0x57b533||0xcc;return function(_0x412389){if(_0x412389){return _0x15ff0f['sendStatus'](_0x57b533);}return _0x15ff0f['status'](_0x57b533)[_0x8e7a('0x15')]();};}function respondWithResult(_0x4a2952,_0x38f249){_0x38f249=_0x38f249||0xc8;return function(_0x30bdba){if(_0x30bdba){return _0x4a2952[_0x8e7a('0x16')](_0x38f249)[_0x8e7a('0x17')](_0x30bdba);}};}function respondWithFilteredResult(_0x3c8eba,_0x1e2c37){return function(_0x24f31c){if(_0x24f31c){var _0x2a4a9b=typeof _0x1e2c37[_0x8e7a('0x18')]===_0x8e7a('0x19')&&typeof _0x1e2c37[_0x8e7a('0x1a')]===_0x8e7a('0x19');var _0x51d7ef=_0x24f31c[_0x8e7a('0x1b')];var _0x31fbf6=_0x2a4a9b?0x0:_0x1e2c37[_0x8e7a('0x18')];var _0x4bcbc3=_0x2a4a9b?_0x24f31c['count']:_0x1e2c37[_0x8e7a('0x18')]+_0x1e2c37[_0x8e7a('0x1a')];var _0x446e11;if(_0x4bcbc3>=_0x51d7ef){_0x4bcbc3=_0x51d7ef;_0x446e11=0xc8;}else{_0x446e11=0xce;}_0x3c8eba[_0x8e7a('0x16')](_0x446e11);return _0x3c8eba[_0x8e7a('0x1c')](_0x8e7a('0x1d'),_0x31fbf6+'-'+_0x4bcbc3+'/'+_0x51d7ef)[_0x8e7a('0x17')](_0x24f31c);}return null;};}function patchUpdates(_0x151b01){return function(_0x24d95d){try{jsonpatch[_0x8e7a('0x1e')](_0x24d95d,_0x151b01,!![]);}catch(_0x50ac5f){return BPromise[_0x8e7a('0x1f')](_0x50ac5f);}return _0x24d95d[_0x8e7a('0x20')]();};}function saveUpdates(_0x4fee62,_0x612cc3){return function(_0x5598d7){if(_0x5598d7){return _0x5598d7[_0x8e7a('0x21')](_0x4fee62)[_0x8e7a('0x22')](function(_0x4bc8f7){return _0x4bc8f7;});}return null;};}function removeEntity(_0x186c2c,_0xed08a){return function(_0x333587){if(_0x333587){return _0x333587[_0x8e7a('0x23')]()[_0x8e7a('0x22')](function(){var _0x425ddf=_0x333587[_0x8e7a('0x24')]({'plain':!![]});var _0x4238cb='CmHopperAdditionalPhones';return db[_0x8e7a('0x25')][_0x8e7a('0x23')]({'where':{'type':_0x4238cb,'resourceId':_0x425ddf['id']}})[_0x8e7a('0x22')](function(){return _0x333587;});})[_0x8e7a('0x22')](function(){_0x186c2c[_0x8e7a('0x16')](0xcc)[_0x8e7a('0x15')]();});}};}function handleEntityNotFound(_0x112f18,_0x42b3fa){return function(_0x4bedbc){if(!_0x4bedbc){_0x112f18[_0x8e7a('0x26')](0x194);}return _0x4bedbc;};}function handleError(_0x5f153a,_0x52ffed){_0x52ffed=_0x52ffed||0x1f4;return function(_0x3b4550){logger['error'](_0x3b4550[_0x8e7a('0x27')]);if(_0x3b4550[_0x8e7a('0x28')]){delete _0x3b4550[_0x8e7a('0x28')];}_0x5f153a[_0x8e7a('0x16')](_0x52ffed)[_0x8e7a('0x29')](_0x3b4550);};}exports[_0x8e7a('0x2a')]=function(_0x392e6e,_0x1764cb){var _0x2156c0={},_0x42e53e={},_0xe8b9fe={'count':0x0,'rows':[]};var _0x3d77d9=_[_0x8e7a('0x2b')](db[_0x8e7a('0x2c')][_0x8e7a('0x2d')],function(_0x4e269d){return{'name':_0x4e269d[_0x8e7a('0x2e')],'type':_0x4e269d['type'][_0x8e7a('0x2f')]};});_0x42e53e[_0x8e7a('0x30')]=_['map'](_0x3d77d9,'name');_0x42e53e[_0x8e7a('0x31')]=_[_0x8e7a('0x32')](_0x392e6e[_0x8e7a('0x31')]);_0x42e53e[_0x8e7a('0x33')]=_['intersection'](_0x42e53e[_0x8e7a('0x30')],_0x42e53e[_0x8e7a('0x31')]);_0x2156c0[_0x8e7a('0x34')]=_[_0x8e7a('0x35')](_0x42e53e[_0x8e7a('0x30')],qs[_0x8e7a('0x36')](_0x392e6e[_0x8e7a('0x31')]['fields']));_0x2156c0['attributes']=_0x2156c0[_0x8e7a('0x34')][_0x8e7a('0x37')]?_0x2156c0[_0x8e7a('0x34')]:_0x42e53e[_0x8e7a('0x30')];if(!_0x392e6e[_0x8e7a('0x31')]['hasOwnProperty'](_0x8e7a('0x38'))){_0x2156c0[_0x8e7a('0x1a')]=qs[_0x8e7a('0x1a')](_0x392e6e[_0x8e7a('0x31')][_0x8e7a('0x1a')]);_0x2156c0[_0x8e7a('0x18')]=qs[_0x8e7a('0x18')](_0x392e6e[_0x8e7a('0x31')][_0x8e7a('0x18')]);}_0x2156c0[_0x8e7a('0x39')]=qs[_0x8e7a('0x3a')](_0x392e6e['query'][_0x8e7a('0x3a')]);_0x2156c0[_0x8e7a('0x3b')]=qs[_0x8e7a('0x33')](_[_0x8e7a('0x3c')](_0x392e6e[_0x8e7a('0x31')],_0x42e53e['filters']),_0x3d77d9);if(_0x392e6e[_0x8e7a('0x31')][_0x8e7a('0x3d')]){_0x2156c0[_0x8e7a('0x3b')]=_[_0x8e7a('0x3e')](_0x2156c0[_0x8e7a('0x3b')],{'$or':_[_0x8e7a('0x2b')](_0x3d77d9,function(_0x384144){if(_0x384144[_0x8e7a('0x3f')]!=='VIRTUAL'){var _0x425c24={};_0x425c24[_0x384144[_0x8e7a('0x28')]]={'$like':'%'+_0x392e6e[_0x8e7a('0x31')][_0x8e7a('0x3d')]+'%'};return _0x425c24;}})});}_0x2156c0=_[_0x8e7a('0x3e')]({},_0x2156c0,_0x392e6e['options']);var _0x2de804={'where':_0x2156c0[_0x8e7a('0x3b')]};return db[_0x8e7a('0x2c')][_0x8e7a('0x1b')](_0x2de804)[_0x8e7a('0x22')](function(_0x433070){_0xe8b9fe[_0x8e7a('0x1b')]=_0x433070;if(_0x392e6e[_0x8e7a('0x31')][_0x8e7a('0x40')]){_0x2156c0[_0x8e7a('0x41')]=[{'all':!![]}];}return db[_0x8e7a('0x2c')][_0x8e7a('0x42')](_0x2156c0);})[_0x8e7a('0x22')](function(_0x32ac27){_0xe8b9fe[_0x8e7a('0x43')]=_0x32ac27;return _0xe8b9fe;})['then'](respondWithFilteredResult(_0x1764cb,_0x2156c0))[_0x8e7a('0x44')](handleError(_0x1764cb,null));};exports[_0x8e7a('0x45')]=function(_0x3040fe,_0x72782){var _0x5669e0={'raw':!![],'where':{'id':_0x3040fe[_0x8e7a('0x46')]['id']}},_0x2d25eb={};_0x2d25eb[_0x8e7a('0x30')]=_[_0x8e7a('0x32')](db['CmHopperAdditionalPhone'][_0x8e7a('0x2d')]);_0x2d25eb[_0x8e7a('0x31')]=_['keys'](_0x3040fe[_0x8e7a('0x31')]);_0x2d25eb[_0x8e7a('0x33')]=_[_0x8e7a('0x35')](_0x2d25eb[_0x8e7a('0x30')],_0x2d25eb[_0x8e7a('0x31')]);_0x5669e0[_0x8e7a('0x34')]=_[_0x8e7a('0x35')](_0x2d25eb[_0x8e7a('0x30')],qs[_0x8e7a('0x36')](_0x3040fe[_0x8e7a('0x31')][_0x8e7a('0x36')]));_0x5669e0[_0x8e7a('0x34')]=_0x5669e0['attributes'][_0x8e7a('0x37')]?_0x5669e0['attributes']:_0x2d25eb[_0x8e7a('0x30')];if(_0x3040fe[_0x8e7a('0x31')][_0x8e7a('0x40')]){_0x5669e0['include']=[{'all':!![]}];}_0x5669e0=_['merge']({},_0x5669e0,_0x3040fe[_0x8e7a('0x47')]);return db[_0x8e7a('0x2c')][_0x8e7a('0x48')](_0x5669e0)[_0x8e7a('0x22')](handleEntityNotFound(_0x72782,null))[_0x8e7a('0x22')](respondWithResult(_0x72782,null))[_0x8e7a('0x44')](handleError(_0x72782,null));};exports[_0x8e7a('0x49')]=function(_0x5387fa,_0x44fc07){return db[_0x8e7a('0x2c')][_0x8e7a('0x49')](_0x5387fa[_0x8e7a('0x4a')],{})[_0x8e7a('0x22')](function(_0x1db1d6){var _0x4999c1=_0x5387fa['user'][_0x8e7a('0x24')]({'plain':!![]});if(!_0x4999c1)throw new Error(_0x8e7a('0x4b'));if(_0x4999c1[_0x8e7a('0x4c')]===_0x8e7a('0x4d')){var _0x2b3f45=_0x1db1d6['get']({'plain':!![]});var _0x3c5c99=_0x8e7a('0x4e');return db[_0x8e7a('0x4f')][_0x8e7a('0x48')]({'where':{'name':_0x3c5c99,'userProfileId':_0x4999c1['userProfileId']},'raw':!![]})['then'](function(_0x5bf1f3){if(_0x5bf1f3&&_0x5bf1f3[_0x8e7a('0x50')]===0x0){return db[_0x8e7a('0x25')][_0x8e7a('0x49')]({'name':_0x2b3f45[_0x8e7a('0x28')],'resourceId':_0x2b3f45['id'],'type':_0x5bf1f3[_0x8e7a('0x28')],'sectionId':_0x5bf1f3['id']},{})[_0x8e7a('0x22')](function(){return _0x1db1d6;});}else{return _0x1db1d6;}})[_0x8e7a('0x44')](function(_0x394dac){logger[_0x8e7a('0x51')](_0x8e7a('0x52'),_0x394dac);throw _0x394dac;});}return _0x1db1d6;})[_0x8e7a('0x22')](respondWithResult(_0x44fc07,0xc9))[_0x8e7a('0x44')](handleError(_0x44fc07,null));};exports[_0x8e7a('0x21')]=function(_0x1d210c,_0x2aefe1){if(_0x1d210c['body']['id']){delete _0x1d210c[_0x8e7a('0x4a')]['id'];}return db[_0x8e7a('0x2c')][_0x8e7a('0x48')]({'where':{'id':_0x1d210c[_0x8e7a('0x46')]['id']}})[_0x8e7a('0x22')](handleEntityNotFound(_0x2aefe1,null))[_0x8e7a('0x22')](saveUpdates(_0x1d210c[_0x8e7a('0x4a')],null))['then'](respondWithResult(_0x2aefe1,null))[_0x8e7a('0x44')](handleError(_0x2aefe1,null));};exports[_0x8e7a('0x23')]=function(_0x2ae7ad,_0x3644ac){return db[_0x8e7a('0x2c')][_0x8e7a('0x48')]({'where':{'id':_0x2ae7ad[_0x8e7a('0x46')]['id']}})[_0x8e7a('0x22')](handleEntityNotFound(_0x3644ac,null))['then'](removeEntity(_0x3644ac,null))['catch'](handleError(_0x3644ac,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index d87b246..68c6b0b 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe953=['CmHopperAdditionalPhone','cm_hopper_additional_phones','bluebird','request-promise','rimraf','./cmHopperAdditionalPhone.attributes','define'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xe953,0x1d0));var _0x3e95=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xe953[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3e95('0x0'));var rp=require(_0x3e95('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e95('0x2'));var config=require('../../config/environment');var attributes=require(_0x3e95('0x3'));module['exports']=function(_0x30637c,_0x3faa2b){return _0x30637c[_0x3e95('0x4')](_0x3e95('0x5'),attributes,{'tableName':_0x3e95('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccaf=['../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x51448f,_0x51c208){var _0x16cc33=function(_0x300443){while(--_0x300443){_0x51448f['push'](_0x51448f['shift']());}};_0x16cc33(++_0x51c208);}(_0xccaf,0x139));var _0xfcca=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0xccaf[_0x4ac48d];return _0x7537af;};'use strict';var _=require(_0xfcca('0x0'));var util=require(_0xfcca('0x1'));var logger=require(_0xfcca('0x2'))(_0xfcca('0x3'));var moment=require(_0xfcca('0x4'));var BPromise=require(_0xfcca('0x5'));var rp=require(_0xfcca('0x6'));var fs=require('fs');var path=require(_0xfcca('0x7'));var rimraf=require(_0xfcca('0x8'));var config=require(_0xfcca('0x9'));var attributes=require(_0xfcca('0xa'));module['exports']=function(_0x4cc124,_0x8d99a9){return _0x4cc124[_0xfcca('0xb')](_0xfcca('0xc'),attributes,{'tableName':_0xfcca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 9cae5d7..5428879 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x645c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','VerifyAdditionalPhones','body','ContactId','ListId','VoiceQueueId','CampaignId','then','findOne','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countabandonedretry','countagentrejectretry','SwapAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util'];(function(_0x1144c8,_0x454242){var _0xa4c112=function(_0x3cab65){while(--_0x3cab65){_0x1144c8['push'](_0x1144c8['shift']());}};_0xa4c112(++_0x454242);}(_0x645c,0x1d6));var _0xc645=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x645c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc645('0x0'));var util=require(_0xc645('0x1'));var moment=require(_0xc645('0x2'));var BPromise=require(_0xc645('0x3'));var rs=require(_0xc645('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc645('0x5'))['db'];var utils=require(_0xc645('0x6'));var logger=require('../../config/logger')(_0xc645('0x7'));var config=require(_0xc645('0x8'));var jayson=require(_0xc645('0x9'));var client=jayson[_0xc645('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc73f,_0x243f06,_0x3ec5fc){return new BPromise(function(_0x3e8f02,_0x23dba4){return client['request'](_0x3cc73f,_0x3ec5fc)['then'](function(_0xda0ca7){logger['info'](_0xc645('0xb'),_0x243f06,'request\x20sent');logger[_0xc645('0xc')](_0xc645('0xd'),_0x243f06,'request\x20sent',JSON[_0xc645('0xe')](_0xda0ca7));if(_0xda0ca7[_0xc645('0xf')]){if(_0xda0ca7[_0xc645('0xf')][_0xc645('0x10')]===0x1f4){logger[_0xc645('0xf')](_0xc645('0xb'),_0x243f06,_0xda0ca7[_0xc645('0xf')][_0xc645('0x11')]);return _0x23dba4(_0xda0ca7[_0xc645('0xf')]['message']);}logger['error'](_0xc645('0xb'),_0x243f06,_0xda0ca7[_0xc645('0xf')][_0xc645('0x11')]);return _0x3e8f02(_0xda0ca7['error'][_0xc645('0x11')]);}else{logger[_0xc645('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x243f06,_0xc645('0x13'));_0x3e8f02(_0xda0ca7[_0xc645('0x14')][_0xc645('0x11')]);}})[_0xc645('0x15')](function(_0x2df6dc){logger[_0xc645('0xf')](_0xc645('0xb'),_0x243f06,_0x2df6dc);_0x23dba4(_0x2df6dc);});});}exports[_0xc645('0x16')]=function(_0x505057){var _0x53c89c=this;return new Promise(function(_0x2aa2f9,_0x478cfe){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x505057[_0xc645('0x17')][_0xc645('0x18')],'ListId':_0x505057[_0xc645('0x17')][_0xc645('0x19')],'VoiceQueueId':_0x505057[_0xc645('0x17')][_0xc645('0x1a')]===undefined?null:_0x505057['body'][_0xc645('0x1a')],'CampaignId':_0x505057[_0xc645('0x17')][_0xc645('0x1b')]===undefined?null:_0x505057[_0xc645('0x17')][_0xc645('0x1b')]}})[_0xc645('0x1c')](function(_0x1af4cb){if(_0x1af4cb!=null){return db['CmHopperAdditionalPhone'][_0xc645('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x1af4cb['id'],'OrderBy':{'$gt':_0x1af4cb[_0xc645('0x1e')]}},'order':[[_0xc645('0x1e'),_0xc645('0x1f')]]})[_0xc645('0x1c')](function(_0x7fd9cf){var _0x496903=0x0;if(_0x7fd9cf){if(_0x7fd9cf[_0xc645('0x20')]+_0x7fd9cf[_0xc645('0x21')]+_0x7fd9cf[_0xc645('0x22')]+_0x7fd9cf[_0xc645('0x23')]+_0x7fd9cf[_0xc645('0x24')]+_0x7fd9cf['countabandonedretry']+_0x7fd9cf[_0xc645('0x25')]+_0x7fd9cf['countagentrejectretry']<_0x505057[_0xc645('0x26')][_0xc645('0x27')])_0x496903=0x1;_0x2aa2f9({'additional':_0x496903});}else{return db[_0xc645('0x28')][_0xc645('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x1af4cb['id']},'order':[['OrderBy',_0xc645('0x1f')]]})[_0xc645('0x1c')](function(_0xb09321){var _0x40efd1=0x0;if(_0xb09321){if(_0xb09321[_0xc645('0x20')]+_0xb09321[_0xc645('0x21')]+_0xb09321['countnoanswerretry']+_0xb09321[_0xc645('0x23')]+_0xb09321[_0xc645('0x24')]+_0xb09321[_0xc645('0x29')]+_0xb09321['countmachineretry']+_0xb09321[_0xc645('0x2a')]<_0x505057[_0xc645('0x26')]['dialGlobalMaxRetry'])_0x40efd1=0x1;_0x2aa2f9({'additional':_0x40efd1});}else{_0x2aa2f9({'additional':0x0});}})[_0xc645('0x15')](function(_0x219ec1){logger[_0xc645('0xf')]('VerifyAdditionalPhones',_0x219ec1[_0xc645('0x11')]);_0x478cfe(_0x53c89c['error'](0x1f4,_0x219ec1['message']));});}})[_0xc645('0x15')](function(_0x4496c3){logger[_0xc645('0xf')](_0xc645('0x16'),_0x4496c3[_0xc645('0x11')]);_0x478cfe(_0x53c89c[_0xc645('0xf')](0x1f4,_0x4496c3[_0xc645('0x11')]));});}else _0x2aa2f9({'additional':0x0});});});};exports[_0xc645('0x2b')]=function(_0x3441ca){var _0x4cb3f4=this;return new Promise(function(_0x5b05b4,_0x193a31){return db[_0xc645('0x2c')][_0xc645('0x1d')]({'raw':!![],'where':{'ContactId':_0x3441ca[_0xc645('0x17')][_0xc645('0x18')],'ListId':_0x3441ca[_0xc645('0x17')][_0xc645('0x19')],'VoiceQueueId':_0x3441ca[_0xc645('0x17')][_0xc645('0x1a')]===undefined?null:_0x3441ca[_0xc645('0x17')][_0xc645('0x1a')],'CampaignId':_0x3441ca['body'][_0xc645('0x1b')]===undefined?null:_0x3441ca[_0xc645('0x17')][_0xc645('0x1b')]}})['then'](function(_0x347ed2){if(_0x347ed2!=null){return db[_0xc645('0x28')][_0xc645('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x347ed2['id'],'OrderBy':{'$gte':_0x347ed2[_0xc645('0x1e')]}},'order':[[_0xc645('0x1e'),_0xc645('0x1f')]]})[_0xc645('0x1c')](function(_0x5c6fee){if(_0x5c6fee)return activateAdditionalPhone(_0x347ed2,_0x3441ca[_0xc645('0x17')],_0x5c6fee,_0x3441ca[_0xc645('0x2d')],_0x3441ca[_0xc645('0x2e')])['then'](function(_0x4c59fb){_0x5b05b4(_0x4c59fb);});else{return db[_0xc645('0x28')][_0xc645('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x347ed2['id']},'order':[['OrderBy',_0xc645('0x1f')]]})['then'](function(_0x53515a){if(_0x53515a)return activateAdditionalPhone(_0x347ed2,_0x3441ca[_0xc645('0x17')],_0x53515a,_0x3441ca[_0xc645('0x2d')],_0x3441ca[_0xc645('0x2e')])[_0xc645('0x1c')](function(_0x256144){_0x5b05b4(_0x256144);});else{_0x5b05b4({'id':_0x347ed2['id'],'phone':''});}})[_0xc645('0x15')](function(_0x558e7c){logger[_0xc645('0xf')](_0xc645('0x16'),_0x558e7c[_0xc645('0x11')]);_0x193a31(_0x4cb3f4['error'](0x1f4,_0x558e7c['message']));});}})[_0xc645('0x15')](function(_0x5e4aea){logger[_0xc645('0xf')](_0xc645('0x16'),_0x5e4aea[_0xc645('0x11')]);_0x193a31(_0x4cb3f4[_0xc645('0xf')](0x1f4,_0x5e4aea[_0xc645('0x11')]));});}else _0x5b05b4(0x1);});});};function activateAdditionalPhone(_0x335dd2,_0x1d1734,_0x49e8cc,_0x17a59d,_0x5d9341){return new Promise(function(_0x476a20,_0x5b09d8){var _0x127b00;if(_[_0xc645('0x2f')](_0x49e8cc['scheduledat'])){_0x49e8cc[_0xc645('0x30')]=moment();}if(moment()>moment(_0x49e8cc['scheduledat'])){_0x127b00=moment()[_0xc645('0x31')](_0x5d9341||0x3,_0xc645('0x32'));}else{if(_0x49e8cc['OrderBy']==0x0){_0x127b00=moment(_0x49e8cc[_0xc645('0x30')]);}else{_0x127b00=moment()['add'](_0x5d9341||0x3,_0xc645('0x32'));}}if(_[_0xc645('0x2f')](_0x127b00)){_0x127b00=moment()['add'](_0x5d9341||0x3,'minutes');}var _0x5cb1ab={'phone':_0x335dd2[_0xc645('0x33')],'active':0x0,'OrderBy':_[_0xc645('0x2f')](_0x335dd2['OrderBy'])?0x0:_0x335dd2['OrderBy'],'scheduledat':moment()[_0xc645('0x31')](_0x17a59d||0x1,_0xc645('0x32')),'countbusyretry':_0x1d1734[_0xc645('0x20')],'countcongestionretry':_0x1d1734['countcongestionretry'],'countnoanswerretry':_0x1d1734[_0xc645('0x22')],'countnosuchnumberretry':_0x1d1734[_0xc645('0x23')],'countdropretry':_0x1d1734[_0xc645('0x24')],'countabandonedretry':_0x1d1734['countabandonedretry'],'countmachineretry':_0x1d1734['countmachineretry'],'countagentrejectretry':_0x1d1734[_0xc645('0x2a')],'createdAt':_0x1d1734[_0xc645('0x34')],'updatedAt':_0x1d1734['updatedAt']};var _0x2eea9b={'CmHopperId':_0x335dd2['id'],'phone':_0x49e8cc[_0xc645('0x33')],'active':0x0,'OrderBy':_[_0xc645('0x2f')](_0x49e8cc[_0xc645('0x1e')])?0x0:_0x49e8cc[_0xc645('0x1e')],'scheduledat':_0x127b00,'countbusyretry':_0x49e8cc[_0xc645('0x20')],'countcongestionretry':_0x49e8cc[_0xc645('0x21')],'countnoanswerretry':_0x49e8cc[_0xc645('0x22')],'countnosuchnumberretry':_0x49e8cc[_0xc645('0x23')],'countdropretry':_0x49e8cc[_0xc645('0x24')],'countabandonedretry':_0x49e8cc[_0xc645('0x29')],'countmachineretry':_0x49e8cc['countmachineretry'],'countagentrejectretry':_0x49e8cc[_0xc645('0x2a')],'createdAt':_0x49e8cc[_0xc645('0x34')],'updatedAt':_0x49e8cc[_0xc645('0x35')]};return db[_0xc645('0x36')][_0xc645('0x37')](function(_0x2a581a){return db[_0xc645('0x28')]['update'](_0x5cb1ab,{'where':{'id':_0x49e8cc['id']}},{'transaction':_0x2a581a})['then'](function(){return db[_0xc645('0x2c')][_0xc645('0x38')](_0x2eea9b,{'where':{'id':_0x335dd2['id']}},{'transaction':_0x2a581a});});})[_0xc645('0x1c')](function(_0x6729da){_0x476a20({'id':_0x335dd2['id'],'phone':_0x49e8cc['phone']});})[_0xc645('0x15')](function(_0xc034bd){logger[_0xc645('0xf')](_0xc645('0x39'),_0xc034bd[_0xc645('0x11')]);_0x5b09d8({'error':_0xc034bd[_0xc645('0x11')]});});});}exports[_0xc645('0x3a')]=function(_0x2537d3){var _0x119c09=this;return new Promise(function(_0x11e888,_0x2d7133){return db[_0xc645('0x2c')]['update'](_0x2537d3[_0xc645('0x17')]['field'],{'where':{'id':_0x2537d3[_0xc645('0x17')]['id']}})[_0xc645('0x1c')](function(_0x2ab667){_0x11e888(_0x2ab667);})[_0xc645('0x15')](function(_0x346f4e){logger[_0xc645('0xf')](_0xc645('0x3a'),_0x346f4e[_0xc645('0x11')]);_0x2d7133(_0x119c09[_0xc645('0xf')](0x1f4,_0x346f4e[_0xc645('0x11')]));});});}; \ No newline at end of file +var _0x30cc=['duration','waitTime','VerifyAdditionalPhones','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','catch','SwapAdditionalPhones'];(function(_0x419ba6,_0x3ee6ae){var _0x27c7bb=function(_0x3f5b27){while(--_0x3f5b27){_0x419ba6['push'](_0x419ba6['shift']());}};_0x27c7bb(++_0x3ee6ae);}(_0x30cc,0x81));var _0xc30c=function(_0x5e3a45,_0x45f0c5){_0x5e3a45=_0x5e3a45-0x0;var _0x13419f=_0x30cc[_0x5e3a45];return _0x13419f;};'use strict';var _=require(_0xc30c('0x0'));var util=require(_0xc30c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc30c('0x2'));var fs=require('fs');var Redis=require(_0xc30c('0x3'));var db=require(_0xc30c('0x4'))['db'];var utils=require(_0xc30c('0x5'));var logger=require('../../config/logger')(_0xc30c('0x6'));var config=require(_0xc30c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc30c('0x8')][_0xc30c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cabcd,_0x3548fe,_0x5e5742){return new BPromise(function(_0x1f66a8,_0x385c6d){return client['request'](_0x5cabcd,_0x5e5742)[_0xc30c('0xa')](function(_0x51fdf3){logger[_0xc30c('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3548fe,_0xc30c('0xc'));logger[_0xc30c('0xd')](_0xc30c('0xe'),_0x3548fe,_0xc30c('0xc'),JSON[_0xc30c('0xf')](_0x51fdf3));if(_0x51fdf3[_0xc30c('0x10')]){if(_0x51fdf3[_0xc30c('0x10')]['code']===0x1f4){logger['error'](_0xc30c('0x11'),_0x3548fe,_0x51fdf3['error']['message']);return _0x385c6d(_0x51fdf3[_0xc30c('0x10')]['message']);}logger[_0xc30c('0x10')](_0xc30c('0x11'),_0x3548fe,_0x51fdf3[_0xc30c('0x10')][_0xc30c('0x12')]);return _0x1f66a8(_0x51fdf3[_0xc30c('0x10')][_0xc30c('0x12')]);}else{logger[_0xc30c('0xb')](_0xc30c('0x11'),_0x3548fe,'request\x20sent');_0x1f66a8(_0x51fdf3[_0xc30c('0x13')][_0xc30c('0x12')]);}})['catch'](function(_0x1bf916){logger[_0xc30c('0x10')](_0xc30c('0x11'),_0x3548fe,_0x1bf916);_0x385c6d(_0x1bf916);});});}exports['VerifyAdditionalPhones']=function(_0x15ebfb){var _0x766828=this;return new Promise(function(_0x3cf07e,_0x28ec87){return db[_0xc30c('0x14')][_0xc30c('0x15')]({'raw':!![],'where':{'ContactId':_0x15ebfb[_0xc30c('0x16')][_0xc30c('0x17')],'ListId':_0x15ebfb[_0xc30c('0x16')][_0xc30c('0x18')],'VoiceQueueId':_0x15ebfb['body']['VoiceQueueId']===undefined?null:_0x15ebfb['body'][_0xc30c('0x19')],'CampaignId':_0x15ebfb[_0xc30c('0x16')][_0xc30c('0x1a')]===undefined?null:_0x15ebfb[_0xc30c('0x16')]['CampaignId']}})[_0xc30c('0xa')](function(_0x591432){if(_0x591432!=null){return db[_0xc30c('0x1b')][_0xc30c('0x15')]({'raw':!![],'where':{'CmHopperId':_0x591432['id'],'OrderBy':{'$gt':_0x591432[_0xc30c('0x1c')]}},'order':[['OrderBy',_0xc30c('0x1d')]]})[_0xc30c('0xa')](function(_0xbec371){var _0x46145f=0x0;if(_0xbec371){if(_0xbec371[_0xc30c('0x1e')]+_0xbec371[_0xc30c('0x1f')]+_0xbec371[_0xc30c('0x20')]+_0xbec371[_0xc30c('0x21')]+_0xbec371[_0xc30c('0x22')]+_0xbec371[_0xc30c('0x23')]+_0xbec371[_0xc30c('0x24')]+_0xbec371[_0xc30c('0x25')]<_0x15ebfb[_0xc30c('0x26')][_0xc30c('0x27')])_0x46145f=0x1;_0x3cf07e({'additional':_0x46145f});}else{return db['CmHopperAdditionalPhone'][_0xc30c('0x15')]({'raw':!![],'where':{'CmHopperId':_0x591432['id']},'order':[['OrderBy',_0xc30c('0x1d')]]})[_0xc30c('0xa')](function(_0x3d6a75){var _0x4a4c2c=0x0;if(_0x3d6a75){if(_0x3d6a75[_0xc30c('0x1e')]+_0x3d6a75[_0xc30c('0x1f')]+_0x3d6a75[_0xc30c('0x20')]+_0x3d6a75[_0xc30c('0x21')]+_0x3d6a75[_0xc30c('0x22')]+_0x3d6a75['countabandonedretry']+_0x3d6a75['countmachineretry']+_0x3d6a75[_0xc30c('0x25')]<_0x15ebfb[_0xc30c('0x26')][_0xc30c('0x27')])_0x4a4c2c=0x1;_0x3cf07e({'additional':_0x4a4c2c});}else{_0x3cf07e({'additional':0x0});}})[_0xc30c('0x28')](function(_0x26e94c){logger[_0xc30c('0x10')]('VerifyAdditionalPhones',_0x26e94c[_0xc30c('0x12')]);_0x28ec87(_0x766828[_0xc30c('0x10')](0x1f4,_0x26e94c[_0xc30c('0x12')]));});}})[_0xc30c('0x28')](function(_0x5838cb){logger['error']('VerifyAdditionalPhones',_0x5838cb['message']);_0x28ec87(_0x766828[_0xc30c('0x10')](0x1f4,_0x5838cb[_0xc30c('0x12')]));});}else _0x3cf07e({'additional':0x0});});});};exports[_0xc30c('0x29')]=function(_0x3a9694){var _0x130720=this;return new Promise(function(_0x2ddff5,_0x53008f){return db[_0xc30c('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0x3a9694[_0xc30c('0x16')]['ContactId'],'ListId':_0x3a9694['body']['ListId'],'VoiceQueueId':_0x3a9694[_0xc30c('0x16')][_0xc30c('0x19')]===undefined?null:_0x3a9694[_0xc30c('0x16')]['VoiceQueueId'],'CampaignId':_0x3a9694[_0xc30c('0x16')][_0xc30c('0x1a')]===undefined?null:_0x3a9694[_0xc30c('0x16')][_0xc30c('0x1a')]}})[_0xc30c('0xa')](function(_0x285999){if(_0x285999!=null){return db[_0xc30c('0x1b')][_0xc30c('0x15')]({'raw':!![],'where':{'CmHopperId':_0x285999['id'],'OrderBy':{'$gte':_0x285999['OrderBy']}},'order':[['OrderBy',_0xc30c('0x1d')]]})['then'](function(_0x23d1a3){if(_0x23d1a3)return activateAdditionalPhone(_0x285999,_0x3a9694[_0xc30c('0x16')],_0x23d1a3,_0x3a9694[_0xc30c('0x2a')],_0x3a9694[_0xc30c('0x2b')])[_0xc30c('0xa')](function(_0x2d728d){_0x2ddff5(_0x2d728d);});else{return db['CmHopperAdditionalPhone'][_0xc30c('0x15')]({'raw':!![],'where':{'CmHopperId':_0x285999['id']},'order':[[_0xc30c('0x1c'),_0xc30c('0x1d')]]})['then'](function(_0x2f76d8){if(_0x2f76d8)return activateAdditionalPhone(_0x285999,_0x3a9694['body'],_0x2f76d8,_0x3a9694['duration'],_0x3a9694[_0xc30c('0x2b')])[_0xc30c('0xa')](function(_0x4a13ab){_0x2ddff5(_0x4a13ab);});else{_0x2ddff5({'id':_0x285999['id'],'phone':''});}})['catch'](function(_0x3db021){logger[_0xc30c('0x10')]('VerifyAdditionalPhones',_0x3db021[_0xc30c('0x12')]);_0x53008f(_0x130720[_0xc30c('0x10')](0x1f4,_0x3db021[_0xc30c('0x12')]));});}})[_0xc30c('0x28')](function(_0x393f83){logger[_0xc30c('0x10')](_0xc30c('0x2c'),_0x393f83[_0xc30c('0x12')]);_0x53008f(_0x130720['error'](0x1f4,_0x393f83['message']));});}else _0x2ddff5(0x1);});});};function activateAdditionalPhone(_0x1db900,_0x1b0f90,_0x2381f2,_0x2bf63a,_0x55e4df){return new Promise(function(_0x913d7d,_0x2c0aaf){var _0x24c990;if(_[_0xc30c('0x2d')](_0x2381f2[_0xc30c('0x2e')])){_0x2381f2['scheduledat']=moment();}if(moment()>moment(_0x2381f2['scheduledat'])){_0x24c990=moment()[_0xc30c('0x2f')](_0x55e4df||0x3,_0xc30c('0x30'));}else{if(_0x2381f2[_0xc30c('0x1c')]==0x0){_0x24c990=moment(_0x2381f2['scheduledat']);}else{_0x24c990=moment()['add'](_0x55e4df||0x3,_0xc30c('0x30'));}}if(_[_0xc30c('0x2d')](_0x24c990)){_0x24c990=moment()[_0xc30c('0x2f')](_0x55e4df||0x3,'minutes');}var _0x36cb4d={'phone':_0x1db900[_0xc30c('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x1db900[_0xc30c('0x1c')])?0x0:_0x1db900[_0xc30c('0x1c')],'scheduledat':moment()['add'](_0x2bf63a||0x1,'minutes'),'countbusyretry':_0x1b0f90[_0xc30c('0x1e')],'countcongestionretry':_0x1b0f90['countcongestionretry'],'countnoanswerretry':_0x1b0f90[_0xc30c('0x20')],'countnosuchnumberretry':_0x1b0f90[_0xc30c('0x21')],'countdropretry':_0x1b0f90[_0xc30c('0x22')],'countabandonedretry':_0x1b0f90['countabandonedretry'],'countmachineretry':_0x1b0f90[_0xc30c('0x24')],'countagentrejectretry':_0x1b0f90[_0xc30c('0x25')],'createdAt':_0x1b0f90[_0xc30c('0x32')],'updatedAt':_0x1b0f90[_0xc30c('0x33')]};var _0x3dfc4b={'CmHopperId':_0x1db900['id'],'phone':_0x2381f2[_0xc30c('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x2381f2['OrderBy'])?0x0:_0x2381f2[_0xc30c('0x1c')],'scheduledat':_0x24c990,'countbusyretry':_0x2381f2[_0xc30c('0x1e')],'countcongestionretry':_0x2381f2[_0xc30c('0x1f')],'countnoanswerretry':_0x2381f2['countnoanswerretry'],'countnosuchnumberretry':_0x2381f2[_0xc30c('0x21')],'countdropretry':_0x2381f2['countdropretry'],'countabandonedretry':_0x2381f2[_0xc30c('0x23')],'countmachineretry':_0x2381f2[_0xc30c('0x24')],'countagentrejectretry':_0x2381f2[_0xc30c('0x25')],'createdAt':_0x2381f2['createdAt'],'updatedAt':_0x2381f2[_0xc30c('0x33')]};return db['sequelize'][_0xc30c('0x34')](function(_0x1996d4){return db[_0xc30c('0x1b')][_0xc30c('0x35')](_0x36cb4d,{'where':{'id':_0x2381f2['id']}},{'transaction':_0x1996d4})[_0xc30c('0xa')](function(){return db[_0xc30c('0x14')][_0xc30c('0x35')](_0x3dfc4b,{'where':{'id':_0x1db900['id']}},{'transaction':_0x1996d4});});})[_0xc30c('0xa')](function(_0x282888){_0x913d7d({'id':_0x1db900['id'],'phone':_0x2381f2[_0xc30c('0x31')]});})[_0xc30c('0x28')](function(_0x506fb2){logger[_0xc30c('0x10')](_0xc30c('0x36'),_0x506fb2['message']);_0x2c0aaf({'error':_0x506fb2[_0xc30c('0x12')]});});});}exports[_0xc30c('0x37')]=function(_0x3fcc32){var _0x23afca=this;return new Promise(function(_0x114a86,_0x15be8b){return db[_0xc30c('0x14')][_0xc30c('0x35')](_0x3fcc32[_0xc30c('0x16')][_0xc30c('0x38')],{'where':{'id':_0x3fcc32['body']['id']}})[_0xc30c('0xa')](function(_0x48a9d9){_0x114a86(_0x48a9d9);})[_0xc30c('0x28')](function(_0x1770c1){logger[_0xc30c('0x10')](_0xc30c('0x37'),_0x1770c1[_0xc30c('0x12')]);_0x15be8b(_0x23afca['error'](0x1f4,_0x1770c1['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 694095c..a505665 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['create','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c00,0xea));var _0x05c0=function(_0x4d525c,_0x277dac){_0x4d525c=_0x4d525c-0x0;var _0x3f0655=_0x5c00[_0x4d525c];return _0x3f0655;};'use strict';var multer=require('multer');var util=require(_0x05c0('0x0'));var path=require(_0x05c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x2'));var router=express['Router']();var fs_extra=require(_0x05c0('0x3'));var auth=require(_0x05c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x05c0('0x5'));var controller=require(_0x05c0('0x6'));router['get']('/',auth[_0x05c0('0x7')](),controller[_0x05c0('0x8')]);router[_0x05c0('0x9')](_0x05c0('0xa'),auth[_0x05c0('0x7')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth[_0x05c0('0x7')](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xa'),auth['isAuthenticated'](),controller[_0x05c0('0xf')]);router[_0x05c0('0x10')](_0x05c0('0xa'),auth[_0x05c0('0x7')](),controller[_0x05c0('0x11')]);module[_0x05c0('0x12')]=router; \ No newline at end of file +var _0x08d9=['./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x08d9,0x1a2));var _0x908d=function(_0x204237,_0x127e78){_0x204237=_0x204237-0x0;var _0x4bc6c6=_0x08d9[_0x204237];return _0x4bc6c6;};'use strict';var multer=require(_0x908d('0x0'));var util=require(_0x908d('0x1'));var path=require(_0x908d('0x2'));var timeout=require(_0x908d('0x3'));var express=require('express');var router=express[_0x908d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x908d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x908d('0x6'));var controller=require(_0x908d('0x7'));router[_0x908d('0x8')]('/',auth['isAuthenticated'](),controller[_0x908d('0x9')]);router[_0x908d('0x8')](_0x908d('0xa'),auth[_0x908d('0xb')](),controller['show']);router[_0x908d('0xc')]('/',auth['isAuthenticated'](),controller[_0x908d('0xd')]);router[_0x908d('0xe')]('/:id',auth[_0x908d('0xb')](),controller[_0x908d('0xf')]);router[_0x908d('0x10')](_0x908d('0xa'),auth[_0x908d('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index fe55c17..13c34be 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 _0xc949=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x10155a,_0x35953){var _0xdcd4e4=function(_0x187881){while(--_0x187881){_0x10155a['push'](_0x10155a['shift']());}};_0xdcd4e4(++_0x35953);}(_0xc949,0x181));var _0x9c94=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xc949[_0x40ac5e];return _0x2839d6;};'use strict';var moment=require(_0x9c94('0x0'));var Sequelize=require('sequelize');module[_0x9c94('0x1')]={'phone':{'type':Sequelize[_0x9c94('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9c94('0x3')],'unique':_0x9c94('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x9c94('0x4')},'VoiceQueueId':{'type':Sequelize[_0x9c94('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x2cd0=['INTEGER','contactListQueue','moment','sequelize'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x2cd0,0x8a));var _0x02cd=function(_0x53b7ca,_0x7b041d){_0x53b7ca=_0x53b7ca-0x0;var _0x4a64bd=_0x2cd0[_0x53b7ca];return _0x4a64bd;};'use strict';var moment=require(_0x02cd('0x0'));var Sequelize=require(_0x02cd('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x02cd('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x02cd('0x3')},'VoiceQueueId':{'type':Sequelize[_0x02cd('0x2')],'unique':_0x02cd('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index d389aa4..34dffce 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 _0xf161=['order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','catch','show','merge','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xf161,0xa2));var _0x1f16=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xf161[_0x313c96];return _0x522f53;};'use strict';var emlformat=require(_0x1f16('0x0'));var rimraf=require(_0x1f16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f16('0x2'));var rp=require('request-promise');var moment=require(_0x1f16('0x3'));var BPromise=require(_0x1f16('0x4'));var Mustache=require('mustache');var util=require(_0x1f16('0x5'));var path=require(_0x1f16('0x6'));var sox=require('sox');var csv=require(_0x1f16('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f16('0x8'));var _=require('lodash');var squel=require(_0x1f16('0x9'));var crypto=require(_0x1f16('0xa'));var jsforce=require(_0x1f16('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f16('0xc'));var authService=require(_0x1f16('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f16('0xe'));var logger=require(_0x1f16('0xf'))(_0x1f16('0x10'));var utils=require(_0x1f16('0x11'));var config=require(_0x1f16('0x12'));var licenseUtil=require(_0x1f16('0x13'));var db=require(_0x1f16('0x14'))['db'];function respondWithStatusCode(_0x5a460e,_0x195042){_0x195042=_0x195042||0xcc;return function(_0x352cd9){if(_0x352cd9){return _0x5a460e[_0x1f16('0x15')](_0x195042);}return _0x5a460e['status'](_0x195042)[_0x1f16('0x16')]();};}function respondWithResult(_0x38a72c,_0x17f867){_0x17f867=_0x17f867||0xc8;return function(_0x4fefe2){if(_0x4fefe2){return _0x38a72c[_0x1f16('0x17')](_0x17f867)[_0x1f16('0x18')](_0x4fefe2);}};}function respondWithFilteredResult(_0x155a6e,_0x12daab){return function(_0x3da885){if(_0x3da885){var _0x30f2e2=typeof _0x12daab[_0x1f16('0x19')]===_0x1f16('0x1a')&&typeof _0x12daab[_0x1f16('0x1b')]===_0x1f16('0x1a');var _0x56a332=_0x3da885['count'];var _0x9d1d1=_0x30f2e2?0x0:_0x12daab[_0x1f16('0x19')];var _0x535fbf=_0x30f2e2?_0x3da885[_0x1f16('0x1c')]:_0x12daab[_0x1f16('0x19')]+_0x12daab[_0x1f16('0x1b')];var _0x13678e;if(_0x535fbf>=_0x56a332){_0x535fbf=_0x56a332;_0x13678e=0xc8;}else{_0x13678e=0xce;}_0x155a6e[_0x1f16('0x17')](_0x13678e);return _0x155a6e[_0x1f16('0x1d')](_0x1f16('0x1e'),_0x9d1d1+'-'+_0x535fbf+'/'+_0x56a332)[_0x1f16('0x18')](_0x3da885);}return null;};}function patchUpdates(_0xa32933){return function(_0x55b7fd){try{jsonpatch[_0x1f16('0x1f')](_0x55b7fd,_0xa32933,!![]);}catch(_0x40e458){return BPromise[_0x1f16('0x20')](_0x40e458);}return _0x55b7fd[_0x1f16('0x21')]();};}function saveUpdates(_0x7779ef,_0x5eb583){return function(_0x371765){if(_0x371765){return _0x371765[_0x1f16('0x22')](_0x7779ef)[_0x1f16('0x23')](function(_0x32905b){return _0x32905b;});}return null;};}function removeEntity(_0x12807f,_0x2bc215){return function(_0xa27fc5){if(_0xa27fc5){return _0xa27fc5[_0x1f16('0x24')]()['then'](function(){_0x12807f[_0x1f16('0x17')](0xcc)[_0x1f16('0x16')]();});}};}function handleEntityNotFound(_0x598d85,_0x26545c){return function(_0x3edcea){if(!_0x3edcea){_0x598d85[_0x1f16('0x15')](0x194);}return _0x3edcea;};}function handleError(_0x428d84,_0x34fda6){_0x34fda6=_0x34fda6||0x1f4;return function(_0x32fe14){logger[_0x1f16('0x25')](_0x32fe14[_0x1f16('0x26')]);if(_0x32fe14['name']){delete _0x32fe14['name'];}_0x428d84[_0x1f16('0x17')](_0x34fda6)[_0x1f16('0x27')](_0x32fe14);};}exports[_0x1f16('0x28')]=function(_0xefd066,_0x2db7c0){var _0x218f13={},_0x527fba={},_0x5a82b2={'count':0x0,'rows':[]};var _0x497d7c=_['map'](db[_0x1f16('0x29')][_0x1f16('0x2a')],function(_0x3cbaf0){return{'name':_0x3cbaf0[_0x1f16('0x2b')],'type':_0x3cbaf0[_0x1f16('0x2c')][_0x1f16('0x2d')]};});_0x527fba['model']=_[_0x1f16('0x2e')](_0x497d7c,_0x1f16('0x2f'));_0x527fba[_0x1f16('0x30')]=_[_0x1f16('0x31')](_0xefd066[_0x1f16('0x30')]);_0x527fba[_0x1f16('0x32')]=_[_0x1f16('0x33')](_0x527fba[_0x1f16('0x34')],_0x527fba[_0x1f16('0x30')]);_0x218f13[_0x1f16('0x35')]=_[_0x1f16('0x33')](_0x527fba[_0x1f16('0x34')],qs[_0x1f16('0x36')](_0xefd066[_0x1f16('0x30')][_0x1f16('0x36')]));_0x218f13[_0x1f16('0x35')]=_0x218f13[_0x1f16('0x35')][_0x1f16('0x37')]?_0x218f13['attributes']:_0x527fba[_0x1f16('0x34')];if(!_0xefd066['query']['hasOwnProperty'](_0x1f16('0x38'))){_0x218f13[_0x1f16('0x1b')]=qs[_0x1f16('0x1b')](_0xefd066['query']['limit']);_0x218f13[_0x1f16('0x19')]=qs[_0x1f16('0x19')](_0xefd066['query'][_0x1f16('0x19')]);}_0x218f13[_0x1f16('0x39')]=qs[_0x1f16('0x3a')](_0xefd066['query'][_0x1f16('0x3a')]);_0x218f13['where']=qs[_0x1f16('0x32')](_[_0x1f16('0x3b')](_0xefd066[_0x1f16('0x30')],_0x527fba[_0x1f16('0x32')]),_0x497d7c);if(_0xefd066[_0x1f16('0x30')][_0x1f16('0x3c')]){_0x218f13[_0x1f16('0x3d')]=_['merge'](_0x218f13[_0x1f16('0x3d')],{'$or':_['map'](_0x497d7c,function(_0x291d58){if(_0x291d58['type']!==_0x1f16('0x3e')){var _0x17f662={};_0x17f662[_0x291d58[_0x1f16('0x2f')]]={'$like':'%'+_0xefd066['query'][_0x1f16('0x3c')]+'%'};return _0x17f662;}})});}_0x218f13=_['merge']({},_0x218f13,_0xefd066[_0x1f16('0x3f')]);var _0xeb080e={'where':_0x218f13[_0x1f16('0x3d')]};return db[_0x1f16('0x29')][_0x1f16('0x1c')](_0xeb080e)['then'](function(_0x583d37){_0x5a82b2[_0x1f16('0x1c')]=_0x583d37;if(_0xefd066['query'][_0x1f16('0x40')]){_0x218f13[_0x1f16('0x41')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x218f13);})[_0x1f16('0x23')](function(_0x3da7c5){_0x5a82b2[_0x1f16('0x42')]=_0x3da7c5;return _0x5a82b2;})[_0x1f16('0x23')](respondWithFilteredResult(_0x2db7c0,_0x218f13))[_0x1f16('0x43')](handleError(_0x2db7c0,null));};exports[_0x1f16('0x44')]=function(_0x57b084,_0x32d35f){var _0x4a9288={'raw':!![],'where':{'id':_0x57b084['params']['id']}},_0x1a8ac3={};_0x1a8ac3[_0x1f16('0x34')]=_[_0x1f16('0x31')](db[_0x1f16('0x29')][_0x1f16('0x2a')]);_0x1a8ac3[_0x1f16('0x30')]=_[_0x1f16('0x31')](_0x57b084[_0x1f16('0x30')]);_0x1a8ac3['filters']=_['intersection'](_0x1a8ac3['model'],_0x1a8ac3[_0x1f16('0x30')]);_0x4a9288['attributes']=_[_0x1f16('0x33')](_0x1a8ac3[_0x1f16('0x34')],qs[_0x1f16('0x36')](_0x57b084['query'][_0x1f16('0x36')]));_0x4a9288['attributes']=_0x4a9288[_0x1f16('0x35')][_0x1f16('0x37')]?_0x4a9288[_0x1f16('0x35')]:_0x1a8ac3['model'];if(_0x57b084[_0x1f16('0x30')][_0x1f16('0x40')]){_0x4a9288[_0x1f16('0x41')]=[{'all':!![]}];}_0x4a9288=_[_0x1f16('0x45')]({},_0x4a9288,_0x57b084[_0x1f16('0x3f')]);return db['CmHopperBlack'][_0x1f16('0x46')](_0x4a9288)['then'](handleEntityNotFound(_0x32d35f,null))[_0x1f16('0x23')](respondWithResult(_0x32d35f,null))['catch'](handleError(_0x32d35f,null));};exports[_0x1f16('0x22')]=function(_0x3d758b,_0x36c897){if(_0x3d758b['body']['id']){delete _0x3d758b['body']['id'];}return db[_0x1f16('0x29')][_0x1f16('0x46')]({'where':{'id':_0x3d758b[_0x1f16('0x47')]['id']}})[_0x1f16('0x23')](handleEntityNotFound(_0x36c897,null))[_0x1f16('0x23')](saveUpdates(_0x3d758b['body'],null))[_0x1f16('0x23')](respondWithResult(_0x36c897,null))['catch'](handleError(_0x36c897,null));};exports[_0x1f16('0x24')]=function(_0x4ea193,_0x25ad31){return db[_0x1f16('0x29')][_0x1f16('0x46')]({'where':{'id':_0x4ea193[_0x1f16('0x47')]['id']}})[_0x1f16('0x23')](handleEntityNotFound(_0x25ad31,null))['then'](removeEntity(_0x25ad31,null))[_0x1f16('0x43')](handleError(_0x25ad31,null));};exports[_0x1f16('0x48')]=function(_0xbc7c67,_0x22feb0){return db[_0x1f16('0x29')]['describe']()['then'](respondWithResult(_0x22feb0,null))['catch'](handleError(_0x22feb0,null));}; \ No newline at end of file +var _0xaa55=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','CmHopperBlack','includeAll','include','rows','catch','show','options','body','params','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x456b57,_0x58691a){var _0x18f49f=function(_0x1dc195){while(--_0x1dc195){_0x456b57['push'](_0x456b57['shift']());}};_0x18f49f(++_0x58691a);}(_0xaa55,0x183));var _0x5aa5=function(_0x1eba7f,_0x398359){_0x1eba7f=_0x1eba7f-0x0;var _0x5eeae6=_0xaa55[_0x1eba7f];return _0x5eeae6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5aa5('0x0'));var zipdir=require(_0x5aa5('0x1'));var jsonpatch=require(_0x5aa5('0x2'));var rp=require(_0x5aa5('0x3'));var moment=require(_0x5aa5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5aa5('0x5'));var path=require(_0x5aa5('0x6'));var sox=require('sox');var csv=require(_0x5aa5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5aa5('0x8'));var _=require(_0x5aa5('0x9'));var squel=require('squel');var crypto=require(_0x5aa5('0xa'));var jsforce=require(_0x5aa5('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5aa5('0xc'));var Papa=require(_0x5aa5('0xd'));var Redis=require(_0x5aa5('0xe'));var authService=require(_0x5aa5('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5aa5('0x10'));var logger=require(_0x5aa5('0x11'))(_0x5aa5('0x12'));var utils=require(_0x5aa5('0x13'));var config=require(_0x5aa5('0x14'));var licenseUtil=require(_0x5aa5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19f7ba,_0x299a26){_0x299a26=_0x299a26||0xcc;return function(_0xe45e59){if(_0xe45e59){return _0x19f7ba['sendStatus'](_0x299a26);}return _0x19f7ba[_0x5aa5('0x16')](_0x299a26)[_0x5aa5('0x17')]();};}function respondWithResult(_0x277edd,_0x3f6379){_0x3f6379=_0x3f6379||0xc8;return function(_0x420f23){if(_0x420f23){return _0x277edd[_0x5aa5('0x16')](_0x3f6379)[_0x5aa5('0x18')](_0x420f23);}};}function respondWithFilteredResult(_0x559a99,_0x18a904){return function(_0xd97eb6){if(_0xd97eb6){var _0xb79ffb=typeof _0x18a904['offset']==='undefined'&&typeof _0x18a904[_0x5aa5('0x19')]===_0x5aa5('0x1a');var _0x2c5175=_0xd97eb6['count'];var _0x57ad53=_0xb79ffb?0x0:_0x18a904[_0x5aa5('0x1b')];var _0x3cecad=_0xb79ffb?_0xd97eb6[_0x5aa5('0x1c')]:_0x18a904[_0x5aa5('0x1b')]+_0x18a904[_0x5aa5('0x19')];var _0x1e31c7;if(_0x3cecad>=_0x2c5175){_0x3cecad=_0x2c5175;_0x1e31c7=0xc8;}else{_0x1e31c7=0xce;}_0x559a99[_0x5aa5('0x16')](_0x1e31c7);return _0x559a99[_0x5aa5('0x1d')](_0x5aa5('0x1e'),_0x57ad53+'-'+_0x3cecad+'/'+_0x2c5175)[_0x5aa5('0x18')](_0xd97eb6);}return null;};}function patchUpdates(_0x547553){return function(_0x31509d){try{jsonpatch['apply'](_0x31509d,_0x547553,!![]);}catch(_0x1010ea){return BPromise[_0x5aa5('0x1f')](_0x1010ea);}return _0x31509d[_0x5aa5('0x20')]();};}function saveUpdates(_0x55e941,_0x2dfd7d){return function(_0x96503a){if(_0x96503a){return _0x96503a[_0x5aa5('0x21')](_0x55e941)[_0x5aa5('0x22')](function(_0x4a3ab4){return _0x4a3ab4;});}return null;};}function removeEntity(_0x5242b5,_0x44e436){return function(_0x460877){if(_0x460877){return _0x460877[_0x5aa5('0x23')]()[_0x5aa5('0x22')](function(){_0x5242b5['status'](0xcc)[_0x5aa5('0x17')]();});}};}function handleEntityNotFound(_0x3b4ba5,_0x2c2a76){return function(_0x4f910d){if(!_0x4f910d){_0x3b4ba5[_0x5aa5('0x24')](0x194);}return _0x4f910d;};}function handleError(_0x1df82b,_0xf9bce1){_0xf9bce1=_0xf9bce1||0x1f4;return function(_0xc9404c){logger[_0x5aa5('0x25')](_0xc9404c['stack']);if(_0xc9404c[_0x5aa5('0x26')]){delete _0xc9404c[_0x5aa5('0x26')];}_0x1df82b[_0x5aa5('0x16')](_0xf9bce1)[_0x5aa5('0x27')](_0xc9404c);};}exports['index']=function(_0x9ecf9a,_0x4a9fde){var _0xb417cb={},_0x1ebc6a={},_0x4d3894={'count':0x0,'rows':[]};var _0xd06645=_[_0x5aa5('0x28')](db['CmHopperBlack'][_0x5aa5('0x29')],function(_0x4106f3){return{'name':_0x4106f3[_0x5aa5('0x2a')],'type':_0x4106f3[_0x5aa5('0x2b')][_0x5aa5('0x2c')]};});_0x1ebc6a[_0x5aa5('0x2d')]=_[_0x5aa5('0x28')](_0xd06645,'name');_0x1ebc6a[_0x5aa5('0x2e')]=_[_0x5aa5('0x2f')](_0x9ecf9a[_0x5aa5('0x2e')]);_0x1ebc6a[_0x5aa5('0x30')]=_[_0x5aa5('0x31')](_0x1ebc6a['model'],_0x1ebc6a[_0x5aa5('0x2e')]);_0xb417cb[_0x5aa5('0x32')]=_[_0x5aa5('0x31')](_0x1ebc6a['model'],qs[_0x5aa5('0x33')](_0x9ecf9a[_0x5aa5('0x2e')][_0x5aa5('0x33')]));_0xb417cb[_0x5aa5('0x32')]=_0xb417cb['attributes'][_0x5aa5('0x34')]?_0xb417cb['attributes']:_0x1ebc6a[_0x5aa5('0x2d')];if(!_0x9ecf9a['query'][_0x5aa5('0x35')](_0x5aa5('0x36'))){_0xb417cb['limit']=qs[_0x5aa5('0x19')](_0x9ecf9a[_0x5aa5('0x2e')][_0x5aa5('0x19')]);_0xb417cb['offset']=qs[_0x5aa5('0x1b')](_0x9ecf9a[_0x5aa5('0x2e')][_0x5aa5('0x1b')]);}_0xb417cb[_0x5aa5('0x37')]=qs[_0x5aa5('0x38')](_0x9ecf9a[_0x5aa5('0x2e')][_0x5aa5('0x38')]);_0xb417cb[_0x5aa5('0x39')]=qs['filters'](_[_0x5aa5('0x3a')](_0x9ecf9a['query'],_0x1ebc6a[_0x5aa5('0x30')]),_0xd06645);if(_0x9ecf9a[_0x5aa5('0x2e')]['filter']){_0xb417cb[_0x5aa5('0x39')]=_[_0x5aa5('0x3b')](_0xb417cb[_0x5aa5('0x39')],{'$or':_[_0x5aa5('0x28')](_0xd06645,function(_0x40011d){if(_0x40011d['type']!==_0x5aa5('0x3c')){var _0x287410={};_0x287410[_0x40011d[_0x5aa5('0x26')]]={'$like':'%'+_0x9ecf9a[_0x5aa5('0x2e')][_0x5aa5('0x3d')]+'%'};return _0x287410;}})});}_0xb417cb=_[_0x5aa5('0x3b')]({},_0xb417cb,_0x9ecf9a['options']);var _0x40c98e={'where':_0xb417cb['where']};return db[_0x5aa5('0x3e')][_0x5aa5('0x1c')](_0x40c98e)['then'](function(_0x475f54){_0x4d3894['count']=_0x475f54;if(_0x9ecf9a[_0x5aa5('0x2e')][_0x5aa5('0x3f')]){_0xb417cb[_0x5aa5('0x40')]=[{'all':!![]}];}return db[_0x5aa5('0x3e')]['findAll'](_0xb417cb);})[_0x5aa5('0x22')](function(_0xe0939d){_0x4d3894[_0x5aa5('0x41')]=_0xe0939d;return _0x4d3894;})['then'](respondWithFilteredResult(_0x4a9fde,_0xb417cb))[_0x5aa5('0x42')](handleError(_0x4a9fde,null));};exports[_0x5aa5('0x43')]=function(_0x1a02fb,_0x30c6dd){var _0x2a9f40={'raw':!![],'where':{'id':_0x1a02fb['params']['id']}},_0x2878d3={};_0x2878d3[_0x5aa5('0x2d')]=_['keys'](db[_0x5aa5('0x3e')]['rawAttributes']);_0x2878d3[_0x5aa5('0x2e')]=_['keys'](_0x1a02fb[_0x5aa5('0x2e')]);_0x2878d3[_0x5aa5('0x30')]=_[_0x5aa5('0x31')](_0x2878d3[_0x5aa5('0x2d')],_0x2878d3[_0x5aa5('0x2e')]);_0x2a9f40[_0x5aa5('0x32')]=_[_0x5aa5('0x31')](_0x2878d3[_0x5aa5('0x2d')],qs[_0x5aa5('0x33')](_0x1a02fb[_0x5aa5('0x2e')][_0x5aa5('0x33')]));_0x2a9f40[_0x5aa5('0x32')]=_0x2a9f40[_0x5aa5('0x32')]['length']?_0x2a9f40[_0x5aa5('0x32')]:_0x2878d3[_0x5aa5('0x2d')];if(_0x1a02fb[_0x5aa5('0x2e')][_0x5aa5('0x3f')]){_0x2a9f40[_0x5aa5('0x40')]=[{'all':!![]}];}_0x2a9f40=_[_0x5aa5('0x3b')]({},_0x2a9f40,_0x1a02fb[_0x5aa5('0x44')]);return db['CmHopperBlack']['find'](_0x2a9f40)['then'](handleEntityNotFound(_0x30c6dd,null))[_0x5aa5('0x22')](respondWithResult(_0x30c6dd,null))[_0x5aa5('0x42')](handleError(_0x30c6dd,null));};exports['update']=function(_0x3fed11,_0x54a1d9){if(_0x3fed11['body']['id']){delete _0x3fed11[_0x5aa5('0x45')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x3fed11[_0x5aa5('0x46')]['id']}})[_0x5aa5('0x22')](handleEntityNotFound(_0x54a1d9,null))['then'](saveUpdates(_0x3fed11['body'],null))[_0x5aa5('0x22')](respondWithResult(_0x54a1d9,null))[_0x5aa5('0x42')](handleError(_0x54a1d9,null));};exports[_0x5aa5('0x23')]=function(_0x1f3c36,_0x5d364b){return db[_0x5aa5('0x3e')][_0x5aa5('0x47')]({'where':{'id':_0x1f3c36[_0x5aa5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d364b,null))[_0x5aa5('0x22')](removeEntity(_0x5d364b,null))[_0x5aa5('0x42')](handleError(_0x5d364b,null));};exports['describe']=function(_0x119374,_0x465265){return db[_0x5aa5('0x3e')][_0x5aa5('0x48')]()[_0x5aa5('0x22')](respondWithResult(_0x465265,null))[_0x5aa5('0x42')](handleError(_0x465265,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index f759be5..56d8006 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 _0x45d9=['api','moment','bluebird','path','rimraf','exports','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x4b7bcf,_0x4c93f5){var _0x5e1f67=function(_0xb00f94){while(--_0xb00f94){_0x4b7bcf['push'](_0x4b7bcf['shift']());}};_0x5e1f67(++_0x4c93f5);}(_0x45d9,0x1b5));var _0x945d=function(_0x4d69a7,_0x34fd04){_0x4d69a7=_0x4d69a7-0x0;var _0xab2905=_0x45d9[_0x4d69a7];return _0xab2905;};'use strict';var _=require(_0x945d('0x0'));var util=require(_0x945d('0x1'));var logger=require(_0x945d('0x2'))(_0x945d('0x3'));var moment=require(_0x945d('0x4'));var BPromise=require(_0x945d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x945d('0x6'));var rimraf=require(_0x945d('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x945d('0x8')]=function(_0x5b4b80,_0x5d7259){return _0x5b4b80['define']('CmHopperBlack',attributes,{'tableName':_0x945d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd8e=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e3d4b,_0x42fce8){var _0x54e31f=function(_0xfb9594){while(--_0xfb9594){_0x2e3d4b['push'](_0x2e3d4b['shift']());}};_0x54e31f(++_0x42fce8);}(_0xcd8e,0x6f));var _0xecd8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcd8e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xecd8('0x0'));var util=require(_0xecd8('0x1'));var logger=require(_0xecd8('0x2'))(_0xecd8('0x3'));var moment=require(_0xecd8('0x4'));var BPromise=require(_0xecd8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xecd8('0x6'));var config=require(_0xecd8('0x7'));var attributes=require(_0xecd8('0x8'));module[_0xecd8('0x9')]=function(_0x1b34d3,_0x454f9f){return _0x1b34d3[_0xecd8('0xa')](_0xecd8('0xb'),attributes,{'tableName':_0xecd8('0xc'),'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 fb3bd4b..7bf073e 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 _0x70fd=['attributes','include','map','model','stringify','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where'];(function(_0x3f3a8c,_0x248e77){var _0x1ce315=function(_0x2bd1f6){while(--_0x2bd1f6){_0x3f3a8c['push'](_0x3f3a8c['shift']());}};_0x1ce315(++_0x248e77);}(_0x70fd,0xee));var _0xd70f=function(_0x391bce,_0x4dcec1){_0x391bce=_0x391bce-0x0;var _0x14075b=_0x70fd[_0x391bce];return _0x14075b;};'use strict';var _=require(_0xd70f('0x0'));var util=require('util');var moment=require(_0xd70f('0x1'));var BPromise=require(_0xd70f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd70f('0x3'));var db=require(_0xd70f('0x4'))['db'];var utils=require(_0xd70f('0x5'));var logger=require(_0xd70f('0x6'))(_0xd70f('0x7'));var config=require(_0xd70f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd70f('0x9')][_0xd70f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x592f99,_0xa45017,_0x4d3ade){return new BPromise(function(_0x41dd6e,_0x32524d){return client[_0xd70f('0xb')](_0x592f99,_0x4d3ade)[_0xd70f('0xc')](function(_0xa9ff60){logger[_0xd70f('0xd')](_0xd70f('0xe'),_0xa45017,'request\x20sent');logger[_0xd70f('0xf')](_0xd70f('0x10'),_0xa45017,_0xd70f('0x11'),JSON['stringify'](_0xa9ff60));if(_0xa9ff60[_0xd70f('0x12')]){if(_0xa9ff60[_0xd70f('0x12')][_0xd70f('0x13')]===0x1f4){logger[_0xd70f('0x12')](_0xd70f('0xe'),_0xa45017,_0xa9ff60['error']['message']);return _0x32524d(_0xa9ff60['error']['message']);}logger[_0xd70f('0x12')](_0xd70f('0xe'),_0xa45017,_0xa9ff60[_0xd70f('0x12')][_0xd70f('0x14')]);return _0x41dd6e(_0xa9ff60[_0xd70f('0x12')][_0xd70f('0x14')]);}else{logger[_0xd70f('0xd')](_0xd70f('0xe'),_0xa45017,_0xd70f('0x11'));_0x41dd6e(_0xa9ff60[_0xd70f('0x15')]['message']);}})[_0xd70f('0x16')](function(_0x34686d){logger['error'](_0xd70f('0xe'),_0xa45017,_0x34686d);_0x32524d(_0x34686d);});});}exports[_0xd70f('0x17')]=function(_0x396e33){var _0x56ef76=this;return new Promise(function(_0xb336f5,_0x1fb719){return db['CmHopperBlack'][_0xd70f('0x18')]({'raw':_0x396e33[_0xd70f('0x19')]?_0x396e33[_0xd70f('0x19')][_0xd70f('0x1a')]===undefined?!![]:![]:!![],'where':_0x396e33[_0xd70f('0x19')]?_0x396e33['options'][_0xd70f('0x1b')]||null:null,'attributes':_0x396e33[_0xd70f('0x19')]?_0x396e33[_0xd70f('0x19')][_0xd70f('0x1c')]||null:null,'limit':_0x396e33[_0xd70f('0x19')]?_0x396e33[_0xd70f('0x19')]['limit']||null:null,'include':_0x396e33[_0xd70f('0x19')]?_0x396e33[_0xd70f('0x19')][_0xd70f('0x1d')]?_[_0xd70f('0x1e')](_0x396e33[_0xd70f('0x19')][_0xd70f('0x1d')],function(_0x4dd934){return{'model':db[_0x4dd934['model']],'as':_0x4dd934['as'],'attributes':_0x4dd934[_0xd70f('0x1c')],'include':_0x4dd934[_0xd70f('0x1d')]?_['map'](_0x4dd934['include'],function(_0x93c690){return{'model':db[_0x93c690['model']],'as':_0x93c690['as'],'attributes':_0x93c690['attributes'],'include':_0x93c690[_0xd70f('0x1d')]?_['map'](_0x93c690['include'],function(_0x54c88f){return{'model':db[_0x54c88f[_0xd70f('0x1f')]],'as':_0x54c88f['as'],'attributes':_0x54c88f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x450f9c){logger['info'](_0xd70f('0x17'),_0x396e33);logger[_0xd70f('0xf')]('GetCmHopperBlack',_0x396e33,JSON[_0xd70f('0x20')](_0x450f9c));_0xb336f5(_0x450f9c);})[_0xd70f('0x16')](function(_0x321613){logger['error'](_0xd70f('0x17'),_0x321613[_0xd70f('0x14')],_0x396e33);_0x1fb719(_0x56ef76['error'](0x1f4,_0x321613[_0xd70f('0x14')]));});});};exports[_0xd70f('0x21')]=function(_0x29febf){var _0xa74833=this;return new Promise(function(_0x5741d6,_0x4ffa1b){return db[_0xd70f('0x22')][_0xd70f('0x23')](_0x29febf[_0xd70f('0x24')],{'raw':_0x29febf['options']?_0x29febf[_0xd70f('0x19')][_0xd70f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29febf[_0xd70f('0x19')]?_0x29febf[_0xd70f('0x19')][_0xd70f('0x1b')]||null:null,'attributes':_0x29febf['options']?_0x29febf[_0xd70f('0x19')]['attributes']||null:null,'limit':_0x29febf[_0xd70f('0x19')]?_0x29febf[_0xd70f('0x19')]['limit']||null:null})[_0xd70f('0xc')](function(_0x5a007d){logger[_0xd70f('0xd')]('UpdateCmHopperBlack',_0x29febf);logger[_0xd70f('0xf')]('UpdateCmHopperBlack',_0x29febf,JSON[_0xd70f('0x20')](_0x5a007d));_0x5741d6(_0x5a007d);})[_0xd70f('0x16')](function(_0x4ba7fa){logger[_0xd70f('0x12')](_0xd70f('0x21'),_0x4ba7fa[_0xd70f('0x14')],_0x29febf);_0x4ffa1b(_0xa74833['error'](0x1f4,_0x4ba7fa['message']));});});};exports[_0xd70f('0x25')]=function(_0x3b07ef){var _0x3627e8=this;return new Promise(function(_0x512ff5,_0x105364){return db[_0xd70f('0x22')]['destroy']({'where':_0x3b07ef[_0xd70f('0x19')]?_0x3b07ef[_0xd70f('0x19')][_0xd70f('0x1b')]||null:null})[_0xd70f('0xc')](function(_0x191667){logger[_0xd70f('0xd')]('DestroyCmHopperBlack',_0x3b07ef);logger[_0xd70f('0xf')](_0xd70f('0x25'),_0x3b07ef,JSON['stringify'](_0x191667));_0x512ff5(_0x191667);})[_0xd70f('0x16')](function(_0x1f9b07){logger[_0xd70f('0x12')](_0xd70f('0x25'),_0x1f9b07[_0xd70f('0x14')],_0x3b07ef);_0x105364(_0x3627e8[_0xd70f('0x12')](0x1f4,_0x1f9b07[_0xd70f('0x14')]));});});}; \ No newline at end of file +var _0x348e=['http','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','info','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','body','stringify','DestroyCmHopperBlack','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x5bcecd,_0x5d2462){var _0x1fd45e=function(_0x9327a7){while(--_0x9327a7){_0x5bcecd['push'](_0x5bcecd['shift']());}};_0x1fd45e(++_0x5d2462);}(_0x348e,0xd0));var _0xe348=function(_0x3ea221,_0x49ed8a){_0x3ea221=_0x3ea221-0x0;var _0x4c7d4d=_0x348e[_0x3ea221];return _0x4c7d4d;};'use strict';var _=require('lodash');var util=require(_0xe348('0x0'));var moment=require('moment');var BPromise=require(_0xe348('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe348('0x2'));var db=require(_0xe348('0x3'))['db'];var utils=require(_0xe348('0x4'));var logger=require('../../config/logger')(_0xe348('0x5'));var config=require(_0xe348('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe348('0x7')][_0xe348('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47d4f6,_0x482be1,_0x7be464){return new BPromise(function(_0x4b6b1b,_0x5cb615){return client['request'](_0x47d4f6,_0x7be464)[_0xe348('0x9')](function(_0x382997){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x482be1,_0xe348('0xa'));logger[_0xe348('0xb')](_0xe348('0xc'),_0x482be1,_0xe348('0xa'),JSON['stringify'](_0x382997));if(_0x382997[_0xe348('0xd')]){if(_0x382997['error'][_0xe348('0xe')]===0x1f4){logger[_0xe348('0xd')](_0xe348('0xf'),_0x482be1,_0x382997['error'][_0xe348('0x10')]);return _0x5cb615(_0x382997[_0xe348('0xd')][_0xe348('0x10')]);}logger[_0xe348('0xd')](_0xe348('0xf'),_0x482be1,_0x382997[_0xe348('0xd')][_0xe348('0x10')]);return _0x4b6b1b(_0x382997[_0xe348('0xd')][_0xe348('0x10')]);}else{logger[_0xe348('0x11')](_0xe348('0xf'),_0x482be1,_0xe348('0xa'));_0x4b6b1b(_0x382997[_0xe348('0x12')][_0xe348('0x10')]);}})[_0xe348('0x13')](function(_0x1d8741){logger[_0xe348('0xd')](_0xe348('0xf'),_0x482be1,_0x1d8741);_0x5cb615(_0x1d8741);});});}exports[_0xe348('0x14')]=function(_0x4502dc){var _0x3cbab0=this;return new Promise(function(_0x25529c,_0x3ffa8e){return db['CmHopperBlack'][_0xe348('0x15')]({'raw':_0x4502dc['options']?_0x4502dc[_0xe348('0x16')][_0xe348('0x17')]===undefined?!![]:![]:!![],'where':_0x4502dc[_0xe348('0x16')]?_0x4502dc[_0xe348('0x16')][_0xe348('0x18')]||null:null,'attributes':_0x4502dc['options']?_0x4502dc['options'][_0xe348('0x19')]||null:null,'limit':_0x4502dc['options']?_0x4502dc[_0xe348('0x16')][_0xe348('0x1a')]||null:null,'include':_0x4502dc[_0xe348('0x16')]?_0x4502dc[_0xe348('0x16')][_0xe348('0x1b')]?_[_0xe348('0x1c')](_0x4502dc[_0xe348('0x16')][_0xe348('0x1b')],function(_0x2b94ea){return{'model':db[_0x2b94ea[_0xe348('0x1d')]],'as':_0x2b94ea['as'],'attributes':_0x2b94ea[_0xe348('0x19')],'include':_0x2b94ea[_0xe348('0x1b')]?_[_0xe348('0x1c')](_0x2b94ea[_0xe348('0x1b')],function(_0x4e8303){return{'model':db[_0x4e8303[_0xe348('0x1d')]],'as':_0x4e8303['as'],'attributes':_0x4e8303[_0xe348('0x19')],'include':_0x4e8303['include']?_[_0xe348('0x1c')](_0x4e8303['include'],function(_0xa412dd){return{'model':db[_0xa412dd['model']],'as':_0xa412dd['as'],'attributes':_0xa412dd[_0xe348('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe348('0x9')](function(_0x20ac00){logger['info']('GetCmHopperBlack',_0x4502dc);logger[_0xe348('0xb')](_0xe348('0x14'),_0x4502dc,JSON['stringify'](_0x20ac00));_0x25529c(_0x20ac00);})[_0xe348('0x13')](function(_0x32d0ea){logger[_0xe348('0xd')](_0xe348('0x14'),_0x32d0ea[_0xe348('0x10')],_0x4502dc);_0x3ffa8e(_0x3cbab0[_0xe348('0xd')](0x1f4,_0x32d0ea[_0xe348('0x10')]));});});};exports[_0xe348('0x1e')]=function(_0xee201e){var _0x135ae9=this;return new Promise(function(_0x6af608,_0x5412f8){return db[_0xe348('0x1f')][_0xe348('0x20')](_0xee201e[_0xe348('0x21')],{'raw':_0xee201e[_0xe348('0x16')]?_0xee201e['options'][_0xe348('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xee201e[_0xe348('0x16')]?_0xee201e['options'][_0xe348('0x18')]||null:null,'attributes':_0xee201e[_0xe348('0x16')]?_0xee201e[_0xe348('0x16')][_0xe348('0x19')]||null:null,'limit':_0xee201e[_0xe348('0x16')]?_0xee201e[_0xe348('0x16')][_0xe348('0x1a')]||null:null})[_0xe348('0x9')](function(_0x346db5){logger[_0xe348('0x11')](_0xe348('0x1e'),_0xee201e);logger[_0xe348('0xb')](_0xe348('0x1e'),_0xee201e,JSON[_0xe348('0x22')](_0x346db5));_0x6af608(_0x346db5);})[_0xe348('0x13')](function(_0x1555e2){logger[_0xe348('0xd')](_0xe348('0x1e'),_0x1555e2[_0xe348('0x10')],_0xee201e);_0x5412f8(_0x135ae9[_0xe348('0xd')](0x1f4,_0x1555e2['message']));});});};exports[_0xe348('0x23')]=function(_0x3aad3a){var _0xb36db9=this;return new Promise(function(_0x55fabe,_0x39df62){return db[_0xe348('0x1f')]['destroy']({'where':_0x3aad3a[_0xe348('0x16')]?_0x3aad3a[_0xe348('0x16')]['where']||null:null})['then'](function(_0x3b779e){logger[_0xe348('0x11')](_0xe348('0x23'),_0x3aad3a);logger[_0xe348('0xb')]('DestroyCmHopperBlack',_0x3aad3a,JSON[_0xe348('0x22')](_0x3b779e));_0x55fabe(_0x3b779e);})[_0xe348('0x13')](function(_0x3ac7d4){logger[_0xe348('0xd')](_0xe348('0x23'),_0x3ac7d4['message'],_0x3aad3a);_0x39df62(_0xb36db9[_0xe348('0xd')](0x1f4,_0x3ac7d4[_0xe348('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index a7448b0..bba3b14 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 _0x1db9=['isAuthenticated','describe','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x1d6d56,_0x556cbb){var _0x1350d7=function(_0x7b46f8){while(--_0x7b46f8){_0x1d6d56['push'](_0x1d6d56['shift']());}};_0x1350d7(++_0x556cbb);}(_0x1db9,0x176));var _0x91db=function(_0x2b5534,_0x4386ee){_0x2b5534=_0x2b5534-0x0;var _0x15be40=_0x1db9[_0x2b5534];return _0x15be40;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0xc')](_0x91db('0xd'),auth[_0x91db('0xa')](),controller['update']);router[_0x91db('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91db('0xf')]=router; \ No newline at end of file +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(_0x7ff556,_0x5b6f32){var _0x4bdd08=function(_0x8857c9){while(--_0x8857c9){_0x7ff556['push'](_0x7ff556['shift']());}};_0x4bdd08(++_0x5b6f32);}(_0xafb9,0x68));var _0x9afb=function(_0x2a8452,_0x144e5d){_0x2a8452=_0x2a8452-0x0;var _0x7610e5=_0xafb9[_0x2a8452];return _0x7610e5;};'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 diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 976e971..5e1ec4b 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 _0x0d5d=['getDataValue','endtime','setDataValue','diff','BOOLEAN','moment','INTEGER','STRING','DATE'];(function(_0x2eadbe,_0x3aa115){var _0x249dee=function(_0x4b892b){while(--_0x4b892b){_0x2eadbe['push'](_0x2eadbe['shift']());}};_0x249dee(++_0x3aa115);}(_0x0d5d,0x125));var _0xd0d5=function(_0x4d334e,_0x5a0114){_0x4d334e=_0x4d334e-0x0;var _0xc542e4=_0x0d5d[_0x4d334e];return _0xc542e4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd0d5('0x0'));module['exports']={'state':{'type':Sequelize[_0xd0d5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd0d5('0x2')]},'scheduledat':{'type':Sequelize[_0xd0d5('0x3')]},'countbusyretry':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd0d5('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xd0d5('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd0d5('0x2')]},'starttime':{'type':Sequelize[_0xd0d5('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xd0d5('0x3')]},'endtime':{'type':Sequelize[_0xd0d5('0x3')]},'ringtime':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd0d5('0x2')]},'campaign':{'type':Sequelize[_0xd0d5('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd0d5('0x2')]},'reason':{'type':Sequelize[_0xd0d5('0x2')]},'disposition':{'type':Sequelize[_0xd0d5('0x2')]},'secondDisposition':{'type':Sequelize[_0xd0d5('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xd0d5('0x3')],'set':function(_0x2b6008){var _0x3de9a7=this[_0xd0d5('0x4')](_0xd0d5('0x5'));if(_0x3de9a7&&_0x2b6008){this[_0xd0d5('0x6')]('followuptime',moment(_0x2b6008)[_0xd0d5('0x7')](moment(_0x3de9a7),'seconds'));}}},'amd':{'type':Sequelize[_0xd0d5('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd0d5('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd0d5('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xd0d5('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd0d5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd0d5('0x3')]},'recallme':{'type':Sequelize[_0xd0d5('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd0d5('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd0d5('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9b6b=['sequelize','moment','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds','BOOLEAN'];(function(_0x53417c,_0x126dee){var _0x49407d=function(_0x1b1737){while(--_0x1b1737){_0x53417c['push'](_0x53417c['shift']());}};_0x49407d(++_0x126dee);}(_0x9b6b,0x155));var _0xb9b6=function(_0x736340,_0x496c55){_0x736340=_0x736340-0x0;var _0x1f5d2a=_0x9b6b[_0x736340];return _0x1f5d2a;};'use strict';var Sequelize=require(_0xb9b6('0x0'));var moment=require(_0xb9b6('0x1'));module['exports']={'state':{'type':Sequelize[_0xb9b6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb9b6('0x3')]},'scheduledat':{'type':Sequelize[_0xb9b6('0x4')]},'countbusyretry':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb9b6('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb9b6('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb9b6('0x3')]},'starttime':{'type':Sequelize[_0xb9b6('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb9b6('0x4')]},'droptime':{'type':Sequelize[_0xb9b6('0x4')]},'endtime':{'type':Sequelize[_0xb9b6('0x4')]},'ringtime':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb9b6('0x3')]},'campaign':{'type':Sequelize[_0xb9b6('0x3')]},'campaigntype':{'type':Sequelize[_0xb9b6('0x3')]},'membername':{'type':Sequelize[_0xb9b6('0x3')]},'reason':{'type':Sequelize[_0xb9b6('0x3')]},'disposition':{'type':Sequelize[_0xb9b6('0x3')]},'secondDisposition':{'type':Sequelize[_0xb9b6('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb9b6('0x3')]},'dispositionat':{'type':Sequelize[_0xb9b6('0x4')],'set':function(_0x5455bc){var _0xed321e=this[_0xb9b6('0x5')]('endtime');if(_0xed321e&&_0x5455bc){this[_0xb9b6('0x6')](_0xb9b6('0x7'),moment(_0x5455bc)[_0xb9b6('0x8')](moment(_0xed321e),_0xb9b6('0x9')));}}},'amd':{'type':Sequelize[_0xb9b6('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb9b6('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb9b6('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb9b6('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb9b6('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xb9b6('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xb9b6('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb9b6('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb9b6('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb9b6('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 5ad0ebf..22c0b1b 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 _0xf61e=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','describe','update','body','uniqueid','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','fromQuery','ContactId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','findOne','eml-format'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xf61e,0x191));var _0xef61=function(_0x1ebedb,_0x575538){_0x1ebedb=_0x1ebedb-0x0;var _0x4825c8=_0xf61e[_0x1ebedb];return _0x4825c8;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['CmHopperFinal']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')]()['then'](respondWithResult(_0x47b09d,null))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x13d0f8,_0x2904e0){if(_0x13d0f8[_0xef61('0x4a')][_0xef61('0x4b')]){delete _0x13d0f8[_0xef61('0x4a')]['uniqueid'];}return db[_0xef61('0x30')]['find']({'where':{'uniqueid':_0x13d0f8[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x2904e0,null))[_0xef61('0x28')](saveUpdates(_0x13d0f8[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x2904e0,null))[_0xef61('0x45')](handleError(_0x2904e0,null));};exports[_0xef61('0x4d')]=function(_0x1565c7,_0x264877,_0x4af2f3){return db[_0xef61('0x30')][_0xef61('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x1565c7['params']['id']},'attributes':[[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xef61('0x53')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x55')))),_0xef61('0x56')],[db['sequelize']['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db['sequelize']['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})[_0xef61('0x28')](handleEntityNotFound(_0x264877,null))[_0xef61('0x28')](respondWithResult(_0x264877,null))[_0xef61('0x45')](handleError(_0x264877,null));};exports[_0xef61('0x5d')]=function(_0x5507ee,_0x15a8c5,_0x4b26e6){return db['CmHopperFinal'][_0xef61('0x44')]({'raw':![],'where':{'CampaignId':_0x5507ee[_0xef61('0x4c')]['id']},'attributes':[[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5e')))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x5f')))),'busyContacts'],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x60')))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xef61('0x56')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})['then'](handleEntityNotFound(_0x15a8c5,null))[_0xef61('0x28')](respondWithResult(_0x15a8c5,null))[_0xef61('0x45')](handleError(_0x15a8c5,null));};exports[_0xef61('0x61')]=function(_0x5ab4fe,_0x38117b,_0x346752){return db['VoiceQueue'][_0xef61('0x47')]({'where':{'id':_0x5ab4fe[_0xef61('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38117b,null))[_0xef61('0x28')](function(_0x54777a){var _0xe62ec2;if(_0x54777a){_0xe62ec2=squel[_0xef61('0x62')]()['into'](_0xef61('0x63'))['fromQuery']([_0xef61('0x64'),_0xef61('0x65'),'ContactId','ListId',_0xef61('0x66'),_0xef61('0x67'),_0xef61('0x68')],squel[_0xef61('0x69')]()[_0xef61('0x6a')]('ANY_VALUE(calleridnum)',_0xef61('0x64'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),'ContactId')[_0xef61('0x6a')]('ANY_VALUE(ListId)',_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x6e'),_0xef61('0x66'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x68'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5ab4fe['body'][_0xef61('0x73')]['toString']())['where'](_0xef61('0x74'))['where'](_0xef61('0x75'),squel['select']()['field'](_0xef61('0x64'))[_0xef61('0x6f')]('cm_hopper')[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]()))[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')]('calleridnum')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x76'),_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')]('ContactId'))[_0xef61('0x71')]();return db['sequelize'][_0xef61('0x34')](_0xe62ec2);}return[];})[_0xef61('0x28')](respondWithResult(_0x38117b,null))['catch'](handleError(_0x38117b,null));};exports[_0xef61('0x79')]=function(_0x5b86e4,_0x52f7c5,_0x465fb5){return db[_0xef61('0x7a')]['find']({'where':{'id':_0x5b86e4[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x52f7c5,null))['then'](function(_0x352633){var _0x2cb8a8;if(_0x352633){_0x2cb8a8=squel['insert']()[_0xef61('0x7b')]('cm_hopper')[_0xef61('0x7c')]([_0xef61('0x64'),_0xef61('0x65'),_0xef61('0x7d'),'ListId',_0xef61('0x7e'),_0xef61('0x67'),_0xef61('0x68')],squel['select']()[_0xef61('0x6a')](_0xef61('0x7f'),'phone')['field'](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),_0xef61('0x7d'))[_0xef61('0x6a')](_0xef61('0x80'),_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x81'),_0xef61('0x7e'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),'updatedAt')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x82'),_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5b86e4[_0xef61('0x4a')][_0xef61('0x73')][_0xef61('0x71')]())[_0xef61('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')](_0xef61('0x64'))[_0xef61('0x6f')](_0xef61('0x63'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id']['toString']()))[_0xef61('0x3d')](_0xef61('0x75'),squel[_0xef61('0x69')]()[_0xef61('0x6a')](_0xef61('0x83'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')](_0xef61('0x7d')))[_0xef61('0x71')]();return db[_0xef61('0x4f')][_0xef61('0x34')](_0x2cb8a8);}return[];})['then'](respondWithResult(_0x52f7c5,null))[_0xef61('0x45')](handleError(_0x52f7c5,null));};exports[_0xef61('0x84')]=function(_0x22006a,_0x317c4a,_0x5d8ee9){return db['CmHopper'][_0xef61('0x85')]({'where':{'VoiceQueueId':_0x22006a[_0xef61('0x4a')][_0xef61('0x66')],'CampaignId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7e')],'ContactId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7d')]}})['then'](handleEntityNotFound(_0x317c4a,null))[_0xef61('0x28')](function(_0x660c71){if(_0x660c71){return _0x660c71;}return null;})[_0xef61('0x28')](respondWithResult(_0x317c4a,null))[_0xef61('0x45')](handleError(_0x317c4a,null));}; \ No newline at end of file +var _0xdb28=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','CmHopperFinal','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','insert','into','cm_hopper','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ListId','CampaignId','ANY_VALUE(CampaignId)','state','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf'];(function(_0x3b4aae,_0xb5b81){var _0x1fd070=function(_0x20559e){while(--_0x20559e){_0x3b4aae['push'](_0x3b4aae['shift']());}};_0x1fd070(++_0xb5b81);}(_0xdb28,0x106));var _0x8db2=function(_0x4ad10a,_0x115e6a){_0x4ad10a=_0x4ad10a-0x0;var _0x4cb0be=_0xdb28[_0x4ad10a];return _0x4cb0be;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['describe']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')]()['then'](respondWithResult(_0x2ada52,null))['catch'](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x2e46d4,_0x164020){if(_0x2e46d4['body']['uniqueid']){delete _0x2e46d4['body'][_0x8db2('0x4a')];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'uniqueid':_0x2e46d4[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x164020,null))[_0x8db2('0x24')](saveUpdates(_0x2e46d4[_0x8db2('0x4b')],null))['then'](respondWithResult(_0x164020,null))['catch'](handleError(_0x164020,null));};exports[_0x8db2('0x4c')]=function(_0x18c6ef,_0x2908e4,_0x2f0bd0){return db[_0x8db2('0x2b')][_0x8db2('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x18c6ef[_0x8db2('0x44')]['id']},'attributes':[[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x50')))),_0x8db2('0x51')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x52')))),_0x8db2('0x53')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x54')))),_0x8db2('0x55')],[db['sequelize']['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x56')))),_0x8db2('0x57')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8db2('0x58')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x59')))),_0x8db2('0x5a')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x5b')))),_0x8db2('0x5c')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x5d')))),_0x8db2('0x5e')]]})['then'](handleEntityNotFound(_0x2908e4,null))[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x42')](handleError(_0x2908e4,null));};exports[_0x8db2('0x5f')]=function(_0xc27a7e,_0x349db0,_0x53b2dc){return db[_0x8db2('0x2b')][_0x8db2('0x40')]({'raw':![],'where':{'CampaignId':_0xc27a7e[_0x8db2('0x44')]['id']},'attributes':[[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x50')))),_0x8db2('0x51')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x52')))),_0x8db2('0x53')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db['sequelize'][_0x8db2('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x8db2('0x55')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x8db2('0x57')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x60')))),_0x8db2('0x58')],[db['sequelize']['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x59')))),_0x8db2('0x5a')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x8db2('0x4f')](_0x8db2('0x5b')))),_0x8db2('0x5c')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x8db2('0x4f')](_0x8db2('0x5d')))),'answeringMachine']]})[_0x8db2('0x24')](handleEntityNotFound(_0x349db0,null))[_0x8db2('0x24')](respondWithResult(_0x349db0,null))[_0x8db2('0x42')](handleError(_0x349db0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x26523b,_0x291375,_0x2cf731){return db['VoiceQueue'][_0x8db2('0x48')]({'where':{'id':_0x26523b[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x291375,null))[_0x8db2('0x24')](function(_0x3a0946){var _0x5923b3;if(_0x3a0946){_0x5923b3=squel[_0x8db2('0x61')]()[_0x8db2('0x62')](_0x8db2('0x63'))['fromQuery'](['phone',_0x8db2('0x64'),_0x8db2('0x65'),'ListId',_0x8db2('0x66'),_0x8db2('0x67'),_0x8db2('0x68')],squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x6b'),_0x8db2('0x6c'))[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x64'))[_0x8db2('0x6a')](_0x8db2('0x6e'),_0x8db2('0x65'))['field'](_0x8db2('0x6f'),'ListId')[_0x8db2('0x6a')](_0x8db2('0x70'),'VoiceQueueId')[_0x8db2('0x6a')](_0x8db2('0x6d'),'createdAt')[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x68'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())['where']('state\x20=\x20?',_0x26523b[_0x8db2('0x4b')]['state'][_0x8db2('0x74')]())[_0x8db2('0x3b')](_0x8db2('0x75'))['where'](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')]('phone')[_0x8db2('0x71')](_0x8db2('0x63'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b['params']['id'][_0x8db2('0x74')]()))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x77'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b[_0x8db2('0x44')]['id']['toString']())[_0x8db2('0x3b')](_0x8db2('0x78')))[_0x8db2('0x79')]('ContactId'))['toString']();return db['sequelize'][_0x8db2('0x30')](_0x5923b3);}return[];})[_0x8db2('0x24')](respondWithResult(_0x291375,null))[_0x8db2('0x42')](handleError(_0x291375,null));};exports[_0x8db2('0x7a')]=function(_0x2ad024,_0x313918,_0x339d09){return db[_0x8db2('0x7b')][_0x8db2('0x48')]({'where':{'id':_0x2ad024[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x313918,null))['then'](function(_0x360a06){var _0xa2e293;if(_0x360a06){_0xa2e293=squel[_0x8db2('0x61')]()[_0x8db2('0x62')]('cm_hopper')['fromQuery']([_0x8db2('0x6c'),_0x8db2('0x64'),'ContactId',_0x8db2('0x7c'),_0x8db2('0x7d'),_0x8db2('0x67'),'updatedAt'],squel['select']()['field'](_0x8db2('0x6b'),_0x8db2('0x6c'))[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x64'))['field'](_0x8db2('0x6e'),'ContactId')[_0x8db2('0x6a')](_0x8db2('0x6f'),_0x8db2('0x7c'))[_0x8db2('0x6a')](_0x8db2('0x7e'),'CampaignId')['field'](_0x8db2('0x6d'),'createdAt')[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x68'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')]('CampaignId\x20=\x20?',_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())[_0x8db2('0x3b')]('state\x20=\x20?',_0x2ad024[_0x8db2('0x4b')][_0x8db2('0x7f')]['toString']())[_0x8db2('0x3b')](_0x8db2('0x75'))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x6c'))[_0x8db2('0x71')](_0x8db2('0x63'))['where'](_0x8db2('0x80'),_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]()))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x77'))[_0x8db2('0x71')](_0x8db2('0x72'))['where'](_0x8db2('0x80'),_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())[_0x8db2('0x3b')]('state\x20=\x204'))[_0x8db2('0x79')](_0x8db2('0x65')))[_0x8db2('0x74')]();return db['sequelize']['query'](_0xa2e293);}return[];})[_0x8db2('0x24')](respondWithResult(_0x313918,null))[_0x8db2('0x42')](handleError(_0x313918,null));};exports[_0x8db2('0x81')]=function(_0xc83913,_0x4f9ce4,_0xaa2661){return db[_0x8db2('0x82')][_0x8db2('0x83')]({'where':{'VoiceQueueId':_0xc83913[_0x8db2('0x4b')]['VoiceQueueId'],'CampaignId':_0xc83913[_0x8db2('0x4b')][_0x8db2('0x7d')],'ContactId':_0xc83913[_0x8db2('0x4b')]['ContactId']}})['then'](handleEntityNotFound(_0x4f9ce4,null))['then'](function(_0x1ba097){if(_0x1ba097){return _0x1ba097;}return null;})[_0x8db2('0x24')](respondWithResult(_0x4f9ce4,null))[_0x8db2('0x42')](handleError(_0x4f9ce4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index b23b7d0..f4e1122 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 _0x87ad=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x41612b,_0x1a548a){var _0x552d61=function(_0x5186f2){while(--_0x5186f2){_0x41612b['push'](_0x41612b['shift']());}};_0x552d61(++_0x1a548a);}(_0x87ad,0x187));var _0xd87a=function(_0x1da3e6,_0x58068f){_0x1da3e6=_0x1da3e6-0x0;var _0xcf120b=_0x87ad[_0x1da3e6];return _0xcf120b;};'use strict';var _=require(_0xd87a('0x0'));var util=require(_0xd87a('0x1'));var logger=require(_0xd87a('0x2'))(_0xd87a('0x3'));var moment=require(_0xd87a('0x4'));var BPromise=require(_0xd87a('0x5'));var rp=require(_0xd87a('0x6'));var fs=require('fs');var path=require(_0xd87a('0x7'));var rimraf=require('rimraf');var config=require(_0xd87a('0x8'));var attributes=require(_0xd87a('0x9'));module[_0xd87a('0xa')]=function(_0x263ddd,_0x3bab03){return _0x263ddd['define'](_0xd87a('0xb'),attributes,{'tableName':_0xd87a('0xc'),'paranoid':![],'indexes':[{'name':_0xd87a('0xd'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xd87a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7055=['CmHopperFinal','calleridnum','uniqueid','lodash','util','api','request-promise','path','../../config/environment','define'];(function(_0x655079,_0x326f5b){var _0x2f8d8a=function(_0x1d4a36){while(--_0x1d4a36){_0x655079['push'](_0x655079['shift']());}};_0x2f8d8a(++_0x326f5b);}(_0x7055,0x189));var _0x5705=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0x7055[_0x2e6dee];return _0x47706;};'use strict';var _=require(_0x5705('0x0'));var util=require(_0x5705('0x1'));var logger=require('../../config/logger')(_0x5705('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5705('0x3'));var fs=require('fs');var path=require(_0x5705('0x4'));var rimraf=require('rimraf');var config=require(_0x5705('0x5'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x4d0b52,_0x1f1b40){return _0x4d0b52[_0x5705('0x6')](_0x5705('0x7'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x5705('0x8'),'fields':[_0x5705('0x8')]},{'name':_0x5705('0x9'),'fields':[_0x5705('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 7c67c98..3711b3d 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x1b6075,_0x45ba39){var _0x305647=function(_0x24f450){while(--_0x24f450){_0x1b6075['push'](_0x1b6075['shift']());}};_0x305647(++_0x45ba39);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d247c,_0x3dff9e){_0x4d247c=_0x4d247c-0x0;var _0x42c60c=_0xb10b[_0x4d247c];return _0x42c60c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x575feb,_0x4b5c4e){var _0x484eb8=function(_0x1a8830){while(--_0x1a8830){_0x575feb['push'](_0x575feb['shift']());}};_0x484eb8(++_0x4b5c4e);}(_0xb10b,0x12a));var _0xbb10=function(_0x3431fb,_0x8bf9e1){_0x3431fb=_0x3431fb-0x0;var _0x9c6a02=_0xb10b[_0x3431fb];return _0x9c6a02;};'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 d8aa77a..b605cb7 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 _0x10b2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer','util','connect-timeout','express'];(function(_0x4bacf3,_0xd58ad8){var _0x39213b=function(_0x3f0c0e){while(--_0x3f0c0e){_0x4bacf3['push'](_0x4bacf3['shift']());}};_0x39213b(++_0xd58ad8);}(_0x10b2,0x1be));var _0x210b=function(_0x3f3ec4,_0x2744a3){_0x3f3ec4=_0x3f3ec4-0x0;var _0x2525d0=_0x10b2[_0x3f3ec4];return _0x2525d0;};'use strict';var multer=require(_0x210b('0x0'));var util=require(_0x210b('0x1'));var path=require('path');var timeout=require(_0x210b('0x2'));var express=require(_0x210b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x210b('0x4'));var interaction=require(_0x210b('0x5'));var config=require(_0x210b('0x6'));var controller=require(_0x210b('0x7'));router[_0x210b('0x8')]('/',auth[_0x210b('0x9')](),controller['index']);router[_0x210b('0x8')]('/describe',auth[_0x210b('0x9')](),controller['describe']);router[_0x210b('0x8')](_0x210b('0xa'),auth[_0x210b('0x9')](),controller[_0x210b('0xb')]);router[_0x210b('0x8')](_0x210b('0xc'),auth[_0x210b('0x9')](),controller[_0x210b('0xd')]);router[_0x210b('0x8')](_0x210b('0xe'),auth[_0x210b('0x9')](),controller[_0x210b('0xf')]);router['post'](_0x210b('0x10'),auth['isAuthenticated'](),controller[_0x210b('0x11')]);router[_0x210b('0x12')](_0x210b('0x13'),auth[_0x210b('0x9')](),controller[_0x210b('0x14')]);router['post'](_0x210b('0x15'),auth[_0x210b('0x9')](),controller[_0x210b('0x16')]);router[_0x210b('0x17')]('/:id',auth[_0x210b('0x9')](),controller['update']);module[_0x210b('0x18')]=router; \ No newline at end of file +var _0x4815=['/voice/campaign/moveContacts/:id','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x387fe4,_0x186656){var _0x43c1c1=function(_0x19ab90){while(--_0x19ab90){_0x387fe4['push'](_0x387fe4['shift']());}};_0x43c1c1(++_0x186656);}(_0x4815,0xff));var _0x5481=function(_0x14caae,_0x4a885c){_0x14caae=_0x14caae-0x0;var _0x388b27=_0x4815[_0x14caae];return _0x388b27;};'use strict';var multer=require(_0x5481('0x0'));var util=require(_0x5481('0x1'));var path=require(_0x5481('0x2'));var timeout=require(_0x5481('0x3'));var express=require(_0x5481('0x4'));var router=express[_0x5481('0x5')]();var fs_extra=require(_0x5481('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5481('0x7'));var controller=require(_0x5481('0x8'));router[_0x5481('0x9')]('/',auth[_0x5481('0xa')](),controller[_0x5481('0xb')]);router[_0x5481('0x9')](_0x5481('0xc'),auth[_0x5481('0xa')](),controller[_0x5481('0xd')]);router[_0x5481('0x9')](_0x5481('0xe'),auth[_0x5481('0xa')](),controller[_0x5481('0xf')]);router[_0x5481('0x9')](_0x5481('0x10'),auth[_0x5481('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x5481('0x11'),auth[_0x5481('0xa')](),controller[_0x5481('0x12')]);router[_0x5481('0x13')]('/voice/queue/moveContacts/:id',auth[_0x5481('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x5481('0x13')](_0x5481('0x14'),auth[_0x5481('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x5481('0x13')]('/checkContactHopper',auth[_0x5481('0xa')](),controller[_0x5481('0x15')]);router[_0x5481('0x16')](_0x5481('0xe'),auth[_0x5481('0xa')](),controller[_0x5481('0x17')]);module[_0x5481('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b18a36b..60d7145 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 _0x1568=['STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2a7b2d,_0x4ef7ca){var _0x606a57=function(_0x3badd4){while(--_0x3badd4){_0x2a7b2d['push'](_0x2a7b2d['shift']());}};_0x606a57(++_0x4ef7ca);}(_0x1568,0xc8));var _0x8156=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1568[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8156('0x0')]},'scheduledat':{'type':Sequelize[_0x8156('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8156('0x0')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x8156('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8156('0x0')]},'starttime':{'type':Sequelize[_0x8156('0x1')]},'responsetime':{'type':Sequelize[_0x8156('0x1')]},'answertime':{'type':Sequelize[_0x8156('0x1')]},'droptime':{'type':Sequelize[_0x8156('0x1')]},'endtime':{'type':Sequelize[_0x8156('0x1')]},'ringtime':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8156('0x0')]},'campaign':{'type':Sequelize[_0x8156('0x0')]},'campaigntype':{'type':Sequelize[_0x8156('0x0')]},'membername':{'type':Sequelize[_0x8156('0x0')]},'reason':{'type':Sequelize[_0x8156('0x0')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8156('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x8156('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8156('0x1')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x8156('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8156('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x60d6=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x60d6,0x10a));var _0x660d=function(_0x37d1f0,_0x5e1939){_0x37d1f0=_0x37d1f0-0x0;var _0x75bc7c=_0x60d6[_0x37d1f0];return _0x75bc7c;};'use strict';var Sequelize=require('sequelize');module[_0x660d('0x0')]={'state':{'type':Sequelize[_0x660d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x660d('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x660d('0x2')]},'originatecalleridname':{'type':Sequelize[_0x660d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x660d('0x2')]},'starttime':{'type':Sequelize[_0x660d('0x3')]},'responsetime':{'type':Sequelize[_0x660d('0x3')]},'answertime':{'type':Sequelize[_0x660d('0x3')]},'droptime':{'type':Sequelize[_0x660d('0x3')]},'endtime':{'type':Sequelize[_0x660d('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x660d('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x660d('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x660d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x660d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x660d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x660d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x660d('0x3')]},'edited':{'type':Sequelize[_0x660d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x660d('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x660d('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3e358e8..16e47c8 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 _0xf690=['Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','describe','uniqueid','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xf690,0xd4));var _0x0f69=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xf690[_0x265aa2];return _0x447a3a;};'use strict';var emlformat=require(_0x0f69('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f69('0x1'));var rp=require(_0x0f69('0x2'));var moment=require(_0x0f69('0x3'));var BPromise=require(_0x0f69('0x4'));var Mustache=require(_0x0f69('0x5'));var util=require(_0x0f69('0x6'));var path=require(_0x0f69('0x7'));var sox=require('sox');var csv=require(_0x0f69('0x8'));var ejs=require(_0x0f69('0x9'));var fs=require('fs');var fs_extra=require(_0x0f69('0xa'));var _=require('lodash');var squel=require(_0x0f69('0xb'));var crypto=require(_0x0f69('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0f69('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0f69('0xe'));var Papa=require(_0x0f69('0xf'));var Redis=require(_0x0f69('0x10'));var authService=require(_0x0f69('0x11'));var qs=require(_0x0f69('0x12'));var as=require(_0x0f69('0x13'));var hardwareService=require(_0x0f69('0x14'));var logger=require(_0x0f69('0x15'))(_0x0f69('0x16'));var utils=require(_0x0f69('0x17'));var config=require(_0x0f69('0x18'));var licenseUtil=require(_0x0f69('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f5cd9,_0x40f3cc){_0x40f3cc=_0x40f3cc||0xcc;return function(_0x20d5b2){if(_0x20d5b2){return _0x4f5cd9[_0x0f69('0x1a')](_0x40f3cc);}return _0x4f5cd9[_0x0f69('0x1b')](_0x40f3cc)[_0x0f69('0x1c')]();};}function respondWithResult(_0x598263,_0x4b5478){_0x4b5478=_0x4b5478||0xc8;return function(_0x2a101f){if(_0x2a101f){return _0x598263[_0x0f69('0x1b')](_0x4b5478)['json'](_0x2a101f);}};}function respondWithFilteredResult(_0x520067,_0x5e7836){return function(_0x42bae9){if(_0x42bae9){var _0x309be5=typeof _0x5e7836[_0x0f69('0x1d')]===_0x0f69('0x1e')&&typeof _0x5e7836['limit']==='undefined';var _0xbb3990=_0x42bae9[_0x0f69('0x1f')];var _0x1ecde0=_0x309be5?0x0:_0x5e7836[_0x0f69('0x1d')];var _0x54de41=_0x309be5?_0x42bae9[_0x0f69('0x1f')]:_0x5e7836[_0x0f69('0x1d')]+_0x5e7836[_0x0f69('0x20')];var _0x48990c;if(_0x54de41>=_0xbb3990){_0x54de41=_0xbb3990;_0x48990c=0xc8;}else{_0x48990c=0xce;}_0x520067['status'](_0x48990c);return _0x520067[_0x0f69('0x21')](_0x0f69('0x22'),_0x1ecde0+'-'+_0x54de41+'/'+_0xbb3990)[_0x0f69('0x23')](_0x42bae9);}return null;};}function patchUpdates(_0x55c54a){return function(_0x52e1cd){try{jsonpatch[_0x0f69('0x24')](_0x52e1cd,_0x55c54a,!![]);}catch(_0x231dd5){return BPromise[_0x0f69('0x25')](_0x231dd5);}return _0x52e1cd[_0x0f69('0x26')]();};}function saveUpdates(_0x4603cb,_0xbb4104){return function(_0x162efa){if(_0x162efa){return _0x162efa[_0x0f69('0x27')](_0x4603cb)[_0x0f69('0x28')](function(_0x2f3944){return _0x2f3944;});}return null;};}function removeEntity(_0x53a3ba,_0x2d7f42){return function(_0x29c750){if(_0x29c750){return _0x29c750[_0x0f69('0x29')]()[_0x0f69('0x28')](function(){_0x53a3ba[_0x0f69('0x1b')](0xcc)[_0x0f69('0x1c')]();});}};}function handleEntityNotFound(_0x2e669d,_0x2b1ae5){return function(_0x2fd475){if(!_0x2fd475){_0x2e669d[_0x0f69('0x1a')](0x194);}return _0x2fd475;};}function handleError(_0xf0f617,_0x14c5bb){_0x14c5bb=_0x14c5bb||0x1f4;return function(_0x53b36a){logger[_0x0f69('0x2a')](_0x53b36a[_0x0f69('0x2b')]);if(_0x53b36a[_0x0f69('0x2c')]){delete _0x53b36a[_0x0f69('0x2c')];}_0xf0f617[_0x0f69('0x1b')](_0x14c5bb)[_0x0f69('0x2d')](_0x53b36a);};}exports[_0x0f69('0x2e')]=function(_0xd1b73e,_0x427340){var _0xcf0238={},_0x176c6e={},_0xa3838={'count':0x0,'rows':[]};var _0x46644d=_[_0x0f69('0x2f')](db[_0x0f69('0x30')][_0x0f69('0x31')],function(_0x18887a){return{'name':_0x18887a[_0x0f69('0x32')],'type':_0x18887a['type'][_0x0f69('0x33')]};});_0x176c6e[_0x0f69('0x34')]=_[_0x0f69('0x2f')](_0x46644d,'name');_0x176c6e[_0x0f69('0x35')]=_[_0x0f69('0x36')](_0xd1b73e[_0x0f69('0x35')]);_0x176c6e['filters']=_[_0x0f69('0x37')](_0x176c6e[_0x0f69('0x34')],_0x176c6e[_0x0f69('0x35')]);_0xcf0238[_0x0f69('0x38')]=_[_0x0f69('0x37')](_0x176c6e['model'],qs['fields'](_0xd1b73e['query'][_0x0f69('0x39')]));_0xcf0238[_0x0f69('0x38')]=_0xcf0238[_0x0f69('0x38')]['length']?_0xcf0238[_0x0f69('0x38')]:_0x176c6e[_0x0f69('0x34')];if(!_0xd1b73e[_0x0f69('0x35')][_0x0f69('0x3a')](_0x0f69('0x3b'))){_0xcf0238[_0x0f69('0x20')]=qs['limit'](_0xd1b73e[_0x0f69('0x35')][_0x0f69('0x20')]);_0xcf0238['offset']=qs[_0x0f69('0x1d')](_0xd1b73e[_0x0f69('0x35')][_0x0f69('0x1d')]);}_0xcf0238[_0x0f69('0x3c')]=qs[_0x0f69('0x3d')](_0xd1b73e[_0x0f69('0x35')][_0x0f69('0x3d')]);_0xcf0238[_0x0f69('0x3e')]=qs[_0x0f69('0x3f')](_[_0x0f69('0x40')](_0xd1b73e[_0x0f69('0x35')],_0x176c6e['filters']),_0x46644d);if(_0xd1b73e[_0x0f69('0x35')]['filter']){_0xcf0238[_0x0f69('0x3e')]=_[_0x0f69('0x41')](_0xcf0238[_0x0f69('0x3e')],{'$or':_[_0x0f69('0x2f')](_0x46644d,function(_0x27d558){if(_0x27d558[_0x0f69('0x42')]!==_0x0f69('0x43')){var _0x143c14={};_0x143c14[_0x27d558['name']]={'$like':'%'+_0xd1b73e[_0x0f69('0x35')]['filter']+'%'};return _0x143c14;}})});}_0xcf0238=_[_0x0f69('0x41')]({},_0xcf0238,_0xd1b73e[_0x0f69('0x44')]);var _0x4d4a15={'where':_0xcf0238['where']};return db[_0x0f69('0x30')][_0x0f69('0x1f')](_0x4d4a15)['then'](function(_0x1d884e){_0xa3838[_0x0f69('0x1f')]=_0x1d884e;if(_0xd1b73e[_0x0f69('0x35')][_0x0f69('0x45')]){_0xcf0238[_0x0f69('0x46')]=[{'all':!![]}];}return db[_0x0f69('0x30')][_0x0f69('0x47')](_0xcf0238);})[_0x0f69('0x28')](function(_0x558c6b){_0xa3838[_0x0f69('0x48')]=_0x558c6b;return _0xa3838;})[_0x0f69('0x28')](respondWithFilteredResult(_0x427340,_0xcf0238))[_0x0f69('0x49')](handleError(_0x427340,null));};exports[_0x0f69('0x4a')]=function(_0x2767b0,_0x207cc0){var _0x4b8a23={'raw':!![],'where':{'id':_0x2767b0['params']['id']}},_0x37043e={};_0x37043e['model']=_[_0x0f69('0x36')](db['CmHopperHistory'][_0x0f69('0x31')]);_0x37043e[_0x0f69('0x35')]=_[_0x0f69('0x36')](_0x2767b0[_0x0f69('0x35')]);_0x37043e['filters']=_[_0x0f69('0x37')](_0x37043e['model'],_0x37043e['query']);_0x4b8a23['attributes']=_['intersection'](_0x37043e[_0x0f69('0x34')],qs[_0x0f69('0x39')](_0x2767b0['query'][_0x0f69('0x39')]));_0x4b8a23[_0x0f69('0x38')]=_0x4b8a23['attributes'][_0x0f69('0x4b')]?_0x4b8a23[_0x0f69('0x38')]:_0x37043e[_0x0f69('0x34')];if(_0x2767b0[_0x0f69('0x35')]['includeAll']){_0x4b8a23[_0x0f69('0x46')]=[{'all':!![]}];}_0x4b8a23=_[_0x0f69('0x41')]({},_0x4b8a23,_0x2767b0['options']);return db['CmHopperHistory'][_0x0f69('0x4c')](_0x4b8a23)[_0x0f69('0x28')](handleEntityNotFound(_0x207cc0,null))['then'](respondWithResult(_0x207cc0,null))[_0x0f69('0x49')](handleError(_0x207cc0,null));};exports[_0x0f69('0x4d')]=function(_0x40c0cf,_0x59b9db){return db[_0x0f69('0x30')][_0x0f69('0x4d')](_0x40c0cf[_0x0f69('0x4e')],{})['then'](respondWithResult(_0x59b9db,0xc9))['catch'](handleError(_0x59b9db,null));};exports[_0x0f69('0x4f')]=function(_0xc55c7e,_0x2a8e3c){return db[_0x0f69('0x30')][_0x0f69('0x4f')]()[_0x0f69('0x28')](respondWithResult(_0x2a8e3c,null))[_0x0f69('0x49')](handleError(_0x2a8e3c,null));};exports[_0x0f69('0x27')]=function(_0x3d4d46,_0x50c039){if(_0x3d4d46[_0x0f69('0x4e')][_0x0f69('0x50')]){delete _0x3d4d46[_0x0f69('0x4e')][_0x0f69('0x50')];}return db[_0x0f69('0x30')][_0x0f69('0x4c')]({'where':{'uniqueid':_0x3d4d46[_0x0f69('0x51')]['id']}})[_0x0f69('0x28')](handleEntityNotFound(_0x50c039,null))['then'](saveUpdates(_0x3d4d46['body'],null))[_0x0f69('0x28')](respondWithResult(_0x50c039,null))['catch'](handleError(_0x50c039,null));}; \ No newline at end of file +var _0xc6cf=['create','body','describe','uniqueid','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','catch','show','rawAttributes','fields','find'];(function(_0x20807d,_0x214365){var _0x8a3f1c=function(_0x302b7f){while(--_0x302b7f){_0x20807d['push'](_0x20807d['shift']());}};_0x8a3f1c(++_0x214365);}(_0xc6cf,0xf1));var _0xfc6c=function(_0x122fdb,_0x6a23e){_0x122fdb=_0x122fdb-0x0;var _0x3917c4=_0xc6cf[_0x122fdb];return _0x3917c4;};'use strict';var emlformat=require(_0xfc6c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc6c('0x1'));var rp=require(_0xfc6c('0x2'));var moment=require('moment');var BPromise=require(_0xfc6c('0x3'));var Mustache=require(_0xfc6c('0x4'));var util=require(_0xfc6c('0x5'));var path=require(_0xfc6c('0x6'));var sox=require(_0xfc6c('0x7'));var csv=require('to-csv');var ejs=require(_0xfc6c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc6c('0x9'));var squel=require('squel');var crypto=require(_0xfc6c('0xa'));var jsforce=require(_0xfc6c('0xb'));var deskjs=require(_0xfc6c('0xc'));var toCsv=require(_0xfc6c('0xd'));var querystring=require(_0xfc6c('0xe'));var Papa=require(_0xfc6c('0xf'));var Redis=require(_0xfc6c('0x10'));var authService=require(_0xfc6c('0x11'));var qs=require(_0xfc6c('0x12'));var as=require(_0xfc6c('0x13'));var hardwareService=require(_0xfc6c('0x14'));var logger=require(_0xfc6c('0x15'))(_0xfc6c('0x16'));var utils=require(_0xfc6c('0x17'));var config=require(_0xfc6c('0x18'));var licenseUtil=require(_0xfc6c('0x19'));var db=require(_0xfc6c('0x1a'))['db'];function respondWithStatusCode(_0x24e195,_0x25b45c){_0x25b45c=_0x25b45c||0xcc;return function(_0x28b654){if(_0x28b654){return _0x24e195[_0xfc6c('0x1b')](_0x25b45c);}return _0x24e195[_0xfc6c('0x1c')](_0x25b45c)[_0xfc6c('0x1d')]();};}function respondWithResult(_0x2f8a76,_0x27d0c6){_0x27d0c6=_0x27d0c6||0xc8;return function(_0x5d7dc8){if(_0x5d7dc8){return _0x2f8a76[_0xfc6c('0x1c')](_0x27d0c6)[_0xfc6c('0x1e')](_0x5d7dc8);}};}function respondWithFilteredResult(_0x35ca21,_0x174b6d){return function(_0x1280d6){if(_0x1280d6){var _0x52faf6=typeof _0x174b6d[_0xfc6c('0x1f')]===_0xfc6c('0x20')&&typeof _0x174b6d[_0xfc6c('0x21')]===_0xfc6c('0x20');var _0x45ffd0=_0x1280d6[_0xfc6c('0x22')];var _0x431ef2=_0x52faf6?0x0:_0x174b6d['offset'];var _0x4f3ea2=_0x52faf6?_0x1280d6[_0xfc6c('0x22')]:_0x174b6d[_0xfc6c('0x1f')]+_0x174b6d['limit'];var _0x2b99cb;if(_0x4f3ea2>=_0x45ffd0){_0x4f3ea2=_0x45ffd0;_0x2b99cb=0xc8;}else{_0x2b99cb=0xce;}_0x35ca21[_0xfc6c('0x1c')](_0x2b99cb);return _0x35ca21[_0xfc6c('0x23')](_0xfc6c('0x24'),_0x431ef2+'-'+_0x4f3ea2+'/'+_0x45ffd0)[_0xfc6c('0x1e')](_0x1280d6);}return null;};}function patchUpdates(_0x1c3ac9){return function(_0x3307c1){try{jsonpatch[_0xfc6c('0x25')](_0x3307c1,_0x1c3ac9,!![]);}catch(_0x15781e){return BPromise[_0xfc6c('0x26')](_0x15781e);}return _0x3307c1['save']();};}function saveUpdates(_0x3be534,_0x4afb26){return function(_0x503479){if(_0x503479){return _0x503479[_0xfc6c('0x27')](_0x3be534)[_0xfc6c('0x28')](function(_0x30ff77){return _0x30ff77;});}return null;};}function removeEntity(_0x44f6c7,_0x25957b){return function(_0x3bb480){if(_0x3bb480){return _0x3bb480[_0xfc6c('0x29')]()['then'](function(){_0x44f6c7[_0xfc6c('0x1c')](0xcc)[_0xfc6c('0x1d')]();});}};}function handleEntityNotFound(_0x5c0d0a,_0x57e3b4){return function(_0x255f92){if(!_0x255f92){_0x5c0d0a[_0xfc6c('0x1b')](0x194);}return _0x255f92;};}function handleError(_0x159629,_0x55e528){_0x55e528=_0x55e528||0x1f4;return function(_0x3c1e9b){logger[_0xfc6c('0x2a')](_0x3c1e9b[_0xfc6c('0x2b')]);if(_0x3c1e9b[_0xfc6c('0x2c')]){delete _0x3c1e9b[_0xfc6c('0x2c')];}_0x159629['status'](_0x55e528)[_0xfc6c('0x2d')](_0x3c1e9b);};}exports[_0xfc6c('0x2e')]=function(_0x58f7fb,_0x95f8da){var _0x5e76a3={},_0xe7b236={},_0x39e4f0={'count':0x0,'rows':[]};var _0x27d236=_[_0xfc6c('0x2f')](db[_0xfc6c('0x30')]['rawAttributes'],function(_0x1e0b5b){return{'name':_0x1e0b5b[_0xfc6c('0x31')],'type':_0x1e0b5b[_0xfc6c('0x32')][_0xfc6c('0x33')]};});_0xe7b236[_0xfc6c('0x34')]=_[_0xfc6c('0x2f')](_0x27d236,'name');_0xe7b236[_0xfc6c('0x35')]=_[_0xfc6c('0x36')](_0x58f7fb[_0xfc6c('0x35')]);_0xe7b236[_0xfc6c('0x37')]=_[_0xfc6c('0x38')](_0xe7b236['model'],_0xe7b236[_0xfc6c('0x35')]);_0x5e76a3[_0xfc6c('0x39')]=_[_0xfc6c('0x38')](_0xe7b236[_0xfc6c('0x34')],qs['fields'](_0x58f7fb[_0xfc6c('0x35')]['fields']));_0x5e76a3[_0xfc6c('0x39')]=_0x5e76a3[_0xfc6c('0x39')][_0xfc6c('0x3a')]?_0x5e76a3[_0xfc6c('0x39')]:_0xe7b236['model'];if(!_0x58f7fb[_0xfc6c('0x35')]['hasOwnProperty'](_0xfc6c('0x3b'))){_0x5e76a3['limit']=qs[_0xfc6c('0x21')](_0x58f7fb[_0xfc6c('0x35')][_0xfc6c('0x21')]);_0x5e76a3[_0xfc6c('0x1f')]=qs['offset'](_0x58f7fb[_0xfc6c('0x35')][_0xfc6c('0x1f')]);}_0x5e76a3[_0xfc6c('0x3c')]=qs[_0xfc6c('0x3d')](_0x58f7fb[_0xfc6c('0x35')][_0xfc6c('0x3d')]);_0x5e76a3['where']=qs[_0xfc6c('0x37')](_['pick'](_0x58f7fb[_0xfc6c('0x35')],_0xe7b236['filters']),_0x27d236);if(_0x58f7fb[_0xfc6c('0x35')][_0xfc6c('0x3e')]){_0x5e76a3['where']=_[_0xfc6c('0x3f')](_0x5e76a3['where'],{'$or':_[_0xfc6c('0x2f')](_0x27d236,function(_0x22488e){if(_0x22488e[_0xfc6c('0x32')]!==_0xfc6c('0x40')){var _0x3992a0={};_0x3992a0[_0x22488e[_0xfc6c('0x2c')]]={'$like':'%'+_0x58f7fb['query'][_0xfc6c('0x3e')]+'%'};return _0x3992a0;}})});}_0x5e76a3=_['merge']({},_0x5e76a3,_0x58f7fb[_0xfc6c('0x41')]);var _0x40ff11={'where':_0x5e76a3[_0xfc6c('0x42')]};return db['CmHopperHistory'][_0xfc6c('0x22')](_0x40ff11)['then'](function(_0xaf009d){_0x39e4f0['count']=_0xaf009d;if(_0x58f7fb['query'][_0xfc6c('0x43')]){_0x5e76a3[_0xfc6c('0x44')]=[{'all':!![]}];}return db[_0xfc6c('0x30')][_0xfc6c('0x45')](_0x5e76a3);})[_0xfc6c('0x28')](function(_0x206689){_0x39e4f0['rows']=_0x206689;return _0x39e4f0;})[_0xfc6c('0x28')](respondWithFilteredResult(_0x95f8da,_0x5e76a3))[_0xfc6c('0x46')](handleError(_0x95f8da,null));};exports[_0xfc6c('0x47')]=function(_0x5296dc,_0x1d625c){var _0x149a91={'raw':!![],'where':{'id':_0x5296dc['params']['id']}},_0x16f05d={};_0x16f05d[_0xfc6c('0x34')]=_[_0xfc6c('0x36')](db[_0xfc6c('0x30')][_0xfc6c('0x48')]);_0x16f05d[_0xfc6c('0x35')]=_[_0xfc6c('0x36')](_0x5296dc[_0xfc6c('0x35')]);_0x16f05d[_0xfc6c('0x37')]=_['intersection'](_0x16f05d[_0xfc6c('0x34')],_0x16f05d[_0xfc6c('0x35')]);_0x149a91[_0xfc6c('0x39')]=_['intersection'](_0x16f05d[_0xfc6c('0x34')],qs[_0xfc6c('0x49')](_0x5296dc[_0xfc6c('0x35')]['fields']));_0x149a91['attributes']=_0x149a91['attributes'][_0xfc6c('0x3a')]?_0x149a91['attributes']:_0x16f05d[_0xfc6c('0x34')];if(_0x5296dc['query'][_0xfc6c('0x43')]){_0x149a91[_0xfc6c('0x44')]=[{'all':!![]}];}_0x149a91=_[_0xfc6c('0x3f')]({},_0x149a91,_0x5296dc['options']);return db[_0xfc6c('0x30')][_0xfc6c('0x4a')](_0x149a91)['then'](handleEntityNotFound(_0x1d625c,null))[_0xfc6c('0x28')](respondWithResult(_0x1d625c,null))['catch'](handleError(_0x1d625c,null));};exports[_0xfc6c('0x4b')]=function(_0x12e9a8,_0x2ec98d){return db['CmHopperHistory'][_0xfc6c('0x4b')](_0x12e9a8[_0xfc6c('0x4c')],{})[_0xfc6c('0x28')](respondWithResult(_0x2ec98d,0xc9))['catch'](handleError(_0x2ec98d,null));};exports['describe']=function(_0x73ce16,_0x40ac38){return db[_0xfc6c('0x30')][_0xfc6c('0x4d')]()['then'](respondWithResult(_0x40ac38,null))[_0xfc6c('0x46')](handleError(_0x40ac38,null));};exports['update']=function(_0x37d769,_0x45c8ca){if(_0x37d769[_0xfc6c('0x4c')]['uniqueid']){delete _0x37d769[_0xfc6c('0x4c')][_0xfc6c('0x4e')];}return db[_0xfc6c('0x30')][_0xfc6c('0x4a')]({'where':{'uniqueid':_0x37d769['params']['id']}})[_0xfc6c('0x28')](handleEntityNotFound(_0x45c8ca,null))[_0xfc6c('0x28')](saveUpdates(_0x37d769['body'],null))[_0xfc6c('0x28')](respondWithResult(_0x45c8ca,null))['catch'](handleError(_0x45c8ca,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7384747..154a87d 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 _0xd481=['cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperHistory'];(function(_0x305888,_0x351146){var _0xaf4aa7=function(_0x29c535){while(--_0x29c535){_0x305888['push'](_0x305888['shift']());}};_0xaf4aa7(++_0x351146);}(_0xd481,0x1e4));var _0x1d48=function(_0x170308,_0x4d8c09){_0x170308=_0x170308-0x0;var _0x35e439=_0xd481[_0x170308];return _0x35e439;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var logger=require(_0x1d48('0x1'))(_0x1d48('0x2'));var moment=require('moment');var BPromise=require(_0x1d48('0x3'));var rp=require(_0x1d48('0x4'));var fs=require('fs');var path=require(_0x1d48('0x5'));var rimraf=require('rimraf');var config=require(_0x1d48('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x1d48('0x7')]=function(_0x2a4830,_0x5a0c28){return _0x2a4830[_0x1d48('0x8')](_0x1d48('0x9'),attributes,{'tableName':_0x1d48('0xa'),'paranoid':![],'indexes':[{'name':_0x1d48('0xb'),'fields':[_0x1d48('0xb')]},{'name':_0x1d48('0xc'),'fields':[_0x1d48('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4808=['exports','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./cmHopperHistory.attributes'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0x4808,0x160));var _0x8480=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4808[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x8480('0x0'));var util=require(_0x8480('0x1'));var logger=require(_0x8480('0x2'))('api');var moment=require(_0x8480('0x3'));var BPromise=require('bluebird');var rp=require(_0x8480('0x4'));var fs=require('fs');var path=require(_0x8480('0x5'));var rimraf=require(_0x8480('0x6'));var config=require('../../config/environment');var attributes=require(_0x8480('0x7'));module[_0x8480('0x8')]=function(_0x59f549,_0x211def){return _0x59f549['define'](_0x8480('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x8480('0xa'),'fields':[_0x8480('0xa')]},{'name':_0x8480('0xb'),'fields':[_0x8480('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index cb757e6..f1b4f0a 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 _0xe62a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperHistory','body','options','AvgHandleTime','CmHopperHistory','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','findAll','campaign','ivrAnswerCallsDay','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe62a,0x143));var _0xae62=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe62a[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xae62('0x0'));var util=require(_0xae62('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae62('0x2'));var db=require(_0xae62('0x3'))['db'];var utils=require(_0xae62('0x4'));var logger=require(_0xae62('0x5'))(_0xae62('0x6'));var config=require(_0xae62('0x7'));var jayson=require(_0xae62('0x8'));var client=jayson[_0xae62('0x9')][_0xae62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x362244,_0x2ef966,_0x2a8d24){return new BPromise(function(_0x891ab3,_0x1b9f67){return client[_0xae62('0xb')](_0x362244,_0x2a8d24)[_0xae62('0xc')](function(_0x17e9e2){logger[_0xae62('0xd')](_0xae62('0xe'),_0x2ef966,_0xae62('0xf'));logger[_0xae62('0x10')](_0xae62('0x11'),_0x2ef966,_0xae62('0xf'),JSON[_0xae62('0x12')](_0x17e9e2));if(_0x17e9e2[_0xae62('0x13')]){if(_0x17e9e2[_0xae62('0x13')]['code']===0x1f4){logger[_0xae62('0x13')](_0xae62('0xe'),_0x2ef966,_0x17e9e2[_0xae62('0x13')][_0xae62('0x14')]);return _0x1b9f67(_0x17e9e2[_0xae62('0x13')]['message']);}logger['error'](_0xae62('0xe'),_0x2ef966,_0x17e9e2[_0xae62('0x13')][_0xae62('0x14')]);return _0x891ab3(_0x17e9e2['error'][_0xae62('0x14')]);}else{logger[_0xae62('0xd')](_0xae62('0xe'),_0x2ef966,_0xae62('0xf'));_0x891ab3(_0x17e9e2[_0xae62('0x15')]['message']);}})[_0xae62('0x16')](function(_0x50d730){logger[_0xae62('0x13')](_0xae62('0xe'),_0x2ef966,_0x50d730);_0x1b9f67(_0x50d730);});});}exports[_0xae62('0x17')]=function(_0x2c7899){var _0x538f5b=this;return new Promise(function(_0x731b4c,_0x204e7b){return db['CmHopperHistory']['create'](_0x2c7899[_0xae62('0x18')],{'raw':_0x2c7899[_0xae62('0x19')]?_0x2c7899[_0xae62('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xae62('0xc')](function(_0x1df85b){logger[_0xae62('0xd')]('CreateCmHopperHistory',_0x2c7899);logger[_0xae62('0x10')](_0xae62('0x17'),_0x2c7899,JSON[_0xae62('0x12')](_0x1df85b));_0x731b4c(_0x1df85b);})[_0xae62('0x16')](function(_0x511529){logger[_0xae62('0x13')]('CreateCmHopperHistory',_0x511529[_0xae62('0x14')],_0x2c7899);_0x204e7b(_0x538f5b[_0xae62('0x13')](0x1f4,_0x511529[_0xae62('0x14')]));});});};exports[_0xae62('0x1a')]=function(_0x37880e){var _0x43e4f3=this;return new Promise(function(_0x16301e,_0x2cb7b0){return db[_0xae62('0x1b')]['findAll']({'raw':_0x37880e[_0xae62('0x19')]?_0x37880e[_0xae62('0x19')][_0xae62('0x1c')]===undefined?!![]:![]:!![],'where':_0x37880e['options']?_0x37880e[_0xae62('0x19')][_0xae62('0x1d')]||null:null,'attributes':[[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')][_0xae62('0x20')]('id')),_0xae62('0x21')],[db[_0xae62('0x1e')]['fn']('COUNT',db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x23')))),_0xae62('0x24')],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0xae62('0x25')],[db[_0xae62('0x1e')]['fn']('COUNT',db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')]['literal'](_0xae62('0x26')))),_0xae62('0x27')],[db[_0xae62('0x1e')]['fn'](_0xae62('0x28'),db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0xae62('0x1e')]['fn']('AVG',db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0xae62('0xc')](function(_0xc013e1){logger[_0xae62('0xd')]('AvgHandleTime',_0x37880e);logger[_0xae62('0x10')](_0xae62('0x1a'),_0x37880e,JSON[_0xae62('0x12')](_0xc013e1));_0x16301e(_0xc013e1);})[_0xae62('0x16')](function(_0x6b67eb){logger['error'](_0xae62('0x1a'),_0x6b67eb[_0xae62('0x14')],_0x37880e);_0x2cb7b0(_0x43e4f3[_0xae62('0x13')](0x1f4,_0x6b67eb[_0xae62('0x14')]));});});};exports[_0xae62('0x2a')]=function(_0x683c7c){var _0x33861e=this;return new Promise(function(_0x547dd1,_0x2b430e){return db[_0xae62('0x1b')]['findAll']({'raw':_0x683c7c[_0xae62('0x19')]?_0x683c7c[_0xae62('0x19')][_0xae62('0x1c')]===undefined?!![]:![]:!![],'where':_0x683c7c['options']?_0x683c7c[_0xae62('0x19')][_0xae62('0x1d')]||null:null,'attributes':[['campaign',_0xae62('0x2b')],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')]['literal'](_0xae62('0x2c')))),_0xae62('0x2d')],[db[_0xae62('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0xae62('0x1e')]['fn']('COUNT',db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xae62('0x2f')],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x30')))),'outboundBusyCallsDay'],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db['sequelize'][_0xae62('0x22')](_0xae62('0x31')))),_0xae62('0x32')],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xae62('0x33')],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xae62('0x34')))),_0xae62('0x35')],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db['sequelize'][_0xae62('0x22')](_0xae62('0x36')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db['sequelize'][_0xae62('0x22')](_0xae62('0x37')))),'outboundOriginateFailureCallsDay'],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db['sequelize']['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x38')))),_0xae62('0x39')],[db['sequelize']['fn']('COUNT',db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x3a')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db['sequelize'][_0xae62('0x22')](_0xae62('0x3b')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x3c')))),'outboundReCallsDay']],'group':['campaign']})[_0xae62('0xc')](function(_0x542393){logger[_0xae62('0xd')](_0xae62('0x2a'),_0x683c7c);logger['debug']('GetVoiceQueueHopperHistory',_0x683c7c,JSON[_0xae62('0x12')](_0x542393));_0x547dd1(_0x542393);})[_0xae62('0x16')](function(_0x1fa4c1){logger[_0xae62('0x13')](_0xae62('0x2a'),_0x1fa4c1[_0xae62('0x14')],_0x683c7c);_0x2b430e(_0x33861e['error'](0x1f4,_0x1fa4c1[_0xae62('0x14')]));});});};exports[_0xae62('0x3d')]=function(_0x226660){var _0x4832ac=this;return new Promise(function(_0x2591fb,_0x1ba512){return db[_0xae62('0x1b')][_0xae62('0x3e')]({'raw':_0x226660[_0xae62('0x19')]?_0x226660['options'][_0xae62('0x1c')]===undefined?!![]:![]:!![],'where':_0x226660['options']?_0x226660[_0xae62('0x19')][_0xae62('0x1d')]||null:null,'attributes':[[_0xae62('0x3f'),_0xae62('0x2b')],[db['sequelize']['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')][_0xae62('0x20')]('id')),'ivrTotalCallsDays'],[db[_0xae62('0x1e')]['fn'](_0xae62('0x1f'),db[_0xae62('0x1e')]['fn']('IF',db[_0xae62('0x1e')][_0xae62('0x22')](_0xae62('0x23')))),_0xae62('0x40')]],'group':[_0xae62('0x3f')]})[_0xae62('0xc')](function(_0x3827c7){logger[_0xae62('0xd')]('GetCampaignHopperHistory',_0x226660);logger[_0xae62('0x10')](_0xae62('0x3d'),_0x226660,JSON[_0xae62('0x12')](_0x3827c7));_0x2591fb(_0x3827c7);})[_0xae62('0x16')](function(_0x5b8e6d){logger[_0xae62('0x13')]('GetCampaignHopperHistory',_0x5b8e6d[_0xae62('0x14')],_0x226660);_0x1ba512(_0x4832ac[_0xae62('0x13')](0x1f4,_0x5b8e6d[_0xae62('0x14')]));});});}; \ No newline at end of file +var _0x7be9=['info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','AvgHandleTime','findAll','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x4f0c2c,_0x353d6e){var _0x27669a=function(_0x3f331b){while(--_0x3f331b){_0x4f0c2c['push'](_0x4f0c2c['shift']());}};_0x27669a(++_0x353d6e);}(_0x7be9,0xff));var _0x97be=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x7be9[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var util=require(_0x97be('0x0'));var moment=require(_0x97be('0x1'));var BPromise=require(_0x97be('0x2'));var rs=require(_0x97be('0x3'));var fs=require('fs');var Redis=require(_0x97be('0x4'));var db=require(_0x97be('0x5'))['db'];var utils=require(_0x97be('0x6'));var logger=require(_0x97be('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x97be('0x8'));var client=jayson[_0x97be('0x9')][_0x97be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e8223,_0x402a1a,_0x449149){return new BPromise(function(_0x47674a,_0x5876d4){return client[_0x97be('0xb')](_0x4e8223,_0x449149)[_0x97be('0xc')](function(_0x15b177){logger[_0x97be('0xd')](_0x97be('0xe'),_0x402a1a,_0x97be('0xf'));logger[_0x97be('0x10')](_0x97be('0x11'),_0x402a1a,'request\x20sent',JSON[_0x97be('0x12')](_0x15b177));if(_0x15b177[_0x97be('0x13')]){if(_0x15b177[_0x97be('0x13')][_0x97be('0x14')]===0x1f4){logger[_0x97be('0x13')](_0x97be('0xe'),_0x402a1a,_0x15b177['error'][_0x97be('0x15')]);return _0x5876d4(_0x15b177[_0x97be('0x13')][_0x97be('0x15')]);}logger['error'](_0x97be('0xe'),_0x402a1a,_0x15b177['error'][_0x97be('0x15')]);return _0x47674a(_0x15b177['error']['message']);}else{logger[_0x97be('0xd')](_0x97be('0xe'),_0x402a1a,_0x97be('0xf'));_0x47674a(_0x15b177[_0x97be('0x16')]['message']);}})[_0x97be('0x17')](function(_0x23b329){logger[_0x97be('0x13')](_0x97be('0xe'),_0x402a1a,_0x23b329);_0x5876d4(_0x23b329);});});}exports[_0x97be('0x18')]=function(_0xd9c537){var _0x326ed3=this;return new Promise(function(_0x2f01f8,_0x206d18){return db[_0x97be('0x19')][_0x97be('0x1a')](_0xd9c537['body'],{'raw':_0xd9c537[_0x97be('0x1b')]?_0xd9c537['options'][_0x97be('0x1c')]===undefined?!![]:![]:!![]})[_0x97be('0xc')](function(_0x6a9ba9){logger[_0x97be('0xd')]('CreateCmHopperHistory',_0xd9c537);logger[_0x97be('0x10')](_0x97be('0x18'),_0xd9c537,JSON[_0x97be('0x12')](_0x6a9ba9));_0x2f01f8(_0x6a9ba9);})[_0x97be('0x17')](function(_0x567b26){logger['error'](_0x97be('0x18'),_0x567b26[_0x97be('0x15')],_0xd9c537);_0x206d18(_0x326ed3[_0x97be('0x13')](0x1f4,_0x567b26['message']));});});};exports[_0x97be('0x1d')]=function(_0x349e28){var _0x49faba=this;return new Promise(function(_0x51f1f1,_0x11cce7){return db[_0x97be('0x19')][_0x97be('0x1e')]({'raw':_0x349e28[_0x97be('0x1b')]?_0x349e28[_0x97be('0x1b')][_0x97be('0x1c')]===undefined?!![]:![]:!![],'where':_0x349e28['options']?_0x349e28['options']['where']||null:null,'attributes':[[db[_0x97be('0x1f')]['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['col']('id')),_0x97be('0x21')],[db[_0x97be('0x1f')]['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')](_0x97be('0x23')))),_0x97be('0x24')],[db['sequelize']['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db['sequelize'][_0x97be('0x22')](_0x97be('0x25')))),_0x97be('0x26')],[db[_0x97be('0x1f')]['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x97be('0x27')],[db[_0x97be('0x1f')]['fn'](_0x97be('0x28'),db[_0x97be('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn']('AVG',db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')](_0x97be('0x29')))),_0x97be('0x2a')]]})[_0x97be('0xc')](function(_0x19d990){logger['info']('AvgHandleTime',_0x349e28);logger['debug'](_0x97be('0x1d'),_0x349e28,JSON['stringify'](_0x19d990));_0x51f1f1(_0x19d990);})[_0x97be('0x17')](function(_0x5db437){logger['error'](_0x97be('0x1d'),_0x5db437[_0x97be('0x15')],_0x349e28);_0x11cce7(_0x49faba['error'](0x1f4,_0x5db437[_0x97be('0x15')]));});});};exports[_0x97be('0x2b')]=function(_0x247273){var _0x16c5ff=this;return new Promise(function(_0x4dc5c3,_0x346f4a){return db[_0x97be('0x19')][_0x97be('0x1e')]({'raw':_0x247273[_0x97be('0x1b')]?_0x247273[_0x97be('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x247273[_0x97be('0x1b')]?_0x247273[_0x97be('0x1b')]['where']||null:null,'attributes':[['campaign',_0x97be('0x2c')],[db[_0x97be('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')](_0x97be('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x97be('0x1f')]['fn']('COUNT',db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')]['literal'](_0x97be('0x2e')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')]['literal'](_0x97be('0x23')))),_0x97be('0x2f')],[db[_0x97be('0x1f')]['fn']('COUNT',db[_0x97be('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x97be('0x30')))),_0x97be('0x31')],[db['sequelize']['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')](_0x97be('0x32')))),'outboundCongestionCallsDay'],[db[_0x97be('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x97be('0x33')],[db[_0x97be('0x1f')]['fn'](_0x97be('0x20'),db['sequelize']['fn']('IF',db[_0x97be('0x1f')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x97be('0x34')],[db[_0x97be('0x1f')]['fn']('COUNT',db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')](_0x97be('0x35')))),_0x97be('0x36')],[db['sequelize']['fn']('COUNT',db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x97be('0x37')],[db[_0x97be('0x1f')]['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db['sequelize'][_0x97be('0x22')](_0x97be('0x38')))),_0x97be('0x39')],[db[_0x97be('0x1f')]['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x97be('0x3a')],[db[_0x97be('0x1f')]['fn'](_0x97be('0x20'),db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x97be('0x3b')],[db[_0x97be('0x1f')]['fn']('COUNT',db[_0x97be('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x97be('0x3c')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')](_0x97be('0x3d')))),'outboundReCallsDay']],'group':[_0x97be('0x3e')]})[_0x97be('0xc')](function(_0x1c0816){logger['info']('GetVoiceQueueHopperHistory',_0x247273);logger['debug'](_0x97be('0x2b'),_0x247273,JSON[_0x97be('0x12')](_0x1c0816));_0x4dc5c3(_0x1c0816);})['catch'](function(_0x1b9f0f){logger[_0x97be('0x13')](_0x97be('0x2b'),_0x1b9f0f[_0x97be('0x15')],_0x247273);_0x346f4a(_0x16c5ff[_0x97be('0x13')](0x1f4,_0x1b9f0f['message']));});});};exports[_0x97be('0x3f')]=function(_0x50beeb){var _0x39c2a0=this;return new Promise(function(_0x2e079a,_0x188684){return db[_0x97be('0x19')][_0x97be('0x1e')]({'raw':_0x50beeb[_0x97be('0x1b')]?_0x50beeb['options'][_0x97be('0x1c')]===undefined?!![]:![]:!![],'where':_0x50beeb[_0x97be('0x1b')]?_0x50beeb[_0x97be('0x1b')]['where']||null:null,'attributes':[[_0x97be('0x3e'),_0x97be('0x2c')],[db['sequelize']['fn'](_0x97be('0x20'),db[_0x97be('0x1f')][_0x97be('0x40')]('id')),_0x97be('0x41')],[db[_0x97be('0x1f')]['fn']('COUNT',db[_0x97be('0x1f')]['fn']('IF',db[_0x97be('0x1f')][_0x97be('0x22')](_0x97be('0x23')))),_0x97be('0x42')]],'group':[_0x97be('0x3e')]})[_0x97be('0xc')](function(_0x12eb7b){logger[_0x97be('0xd')](_0x97be('0x3f'),_0x50beeb);logger[_0x97be('0x10')]('GetCampaignHopperHistory',_0x50beeb,JSON[_0x97be('0x12')](_0x12eb7b));_0x2e079a(_0x12eb7b);})['catch'](function(_0x4704ba){logger['error']('GetCampaignHopperHistory',_0x4704ba[_0x97be('0x15')],_0x50beeb);_0x188684(_0x39c2a0['error'](0x1f4,_0x4704ba['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index d90da16..e3229cd 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 _0xfddd=['get','/:id','post','create','put','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','/describe','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfddd,0x1d6));var _0xdfdd=function(_0x94ab23,_0x3a4204){_0x94ab23=_0x94ab23-0x0;var _0x528e18=_0xfddd[_0x94ab23];return _0x528e18;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdfdd('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdfdd('0x1')]();var fs_extra=require(_0xdfdd('0x2'));var auth=require(_0xdfdd('0x3'));var interaction=require(_0xdfdd('0x4'));var config=require(_0xdfdd('0x5'));var controller=require(_0xdfdd('0x6'));router['get']('/',auth[_0xdfdd('0x7')](),controller['index']);router['get'](_0xdfdd('0x8'),auth[_0xdfdd('0x7')](),controller[_0xdfdd('0x9')]);router[_0xdfdd('0xa')](_0xdfdd('0xb'),auth[_0xdfdd('0x7')](),controller['show']);router[_0xdfdd('0xc')]('/',auth[_0xdfdd('0x7')](),controller[_0xdfdd('0xd')]);router[_0xdfdd('0xe')](_0xdfdd('0xb'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x535e=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','describe','post','create','put','update','exports','multer'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0x535e,0x13a));var _0xe535=function(_0x424663,_0xfa30f0){_0x424663=_0x424663-0x0;var _0x35b493=_0x535e[_0x424663];return _0x35b493;};'use strict';var multer=require(_0xe535('0x0'));var util=require(_0xe535('0x1'));var path=require(_0xe535('0x2'));var timeout=require('connect-timeout');var express=require(_0xe535('0x3'));var router=express['Router']();var fs_extra=require(_0xe535('0x4'));var auth=require(_0xe535('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe535('0x6'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0xe535('0x7')](),controller['index']);router[_0xe535('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe535('0x9')]);router[_0xe535('0x8')]('/:id',auth[_0xe535('0x7')](),controller['show']);router[_0xe535('0xa')]('/',auth[_0xe535('0x7')](),controller[_0xe535('0xb')]);router[_0xe535('0xc')]('/:id',auth[_0xe535('0x7')](),controller[_0xe535('0xd')]);module[_0xe535('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 648d35b..edcba75 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 _0x86dd=['name','STRING','exports'];(function(_0x3198a8,_0x49a00a){var _0x1e1400=function(_0x1a2755){while(--_0x1a2755){_0x3198a8['push'](_0x3198a8['shift']());}};_0x1e1400(++_0x49a00a);}(_0x86dd,0x1ee));var _0xd86d=function(_0x56913d,_0x265b20){_0x56913d=_0x56913d-0x0;var _0x1df7b4=_0x86dd[_0x56913d];return _0x1df7b4;};'use strict';var Sequelize=require('sequelize');module[_0xd86d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd86d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd86d('0x2')]},'dialPrefix':{'type':Sequelize[_0xd86d('0x2')]}}; \ No newline at end of file +var _0x562d=['sequelize','exports','STRING'];(function(_0x3aeee3,_0x7d1c0d){var _0x258db8=function(_0x16991e){while(--_0x16991e){_0x3aeee3['push'](_0x3aeee3['shift']());}};_0x258db8(++_0x7d1c0d);}(_0x562d,0xe1));var _0xd562=function(_0x522c1a,_0x1299ed){_0x522c1a=_0x522c1a-0x0;var _0x5807ee=_0x562d[_0x522c1a];return _0x5807ee;};'use strict';var Sequelize=require(_0xd562('0x0'));module[_0xd562('0x1')]={'name':{'type':Sequelize[_0xd562('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xd562('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 18cc96d..0d96514 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 _0xf038=['c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','item','from','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','description_additionalPhone_','toString','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','number','switch','BOOLEAN','defaultValue','queryInterface','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','Lists','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','map','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ListId','Disposition','getDispositions','findOne','pick','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','nolimit','raw','ContactItemType','OrderBy','select','cm_contacts'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xf038,0x16d));var _0x8f03=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf038[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0x8f03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f03('0x1'));var jsonpatch=require(_0x8f03('0x2'));var rp=require('request-promise');var moment=require(_0x8f03('0x3'));var BPromise=require(_0x8f03('0x4'));var Mustache=require(_0x8f03('0x5'));var util=require(_0x8f03('0x6'));var path=require(_0x8f03('0x7'));var sox=require('sox');var csv=require(_0x8f03('0x8'));var ejs=require(_0x8f03('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f03('0xa'));var squel=require(_0x8f03('0xb'));var crypto=require(_0x8f03('0xc'));var jsforce=require(_0x8f03('0xd'));var deskjs=require(_0x8f03('0xe'));var toCsv=require(_0x8f03('0x8'));var querystring=require(_0x8f03('0xf'));var Papa=require(_0x8f03('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8f03('0x11'));var as=require(_0x8f03('0x12'));var hardwareService=require(_0x8f03('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8f03('0x14'));var licenseUtil=require(_0x8f03('0x15'));var db=require(_0x8f03('0x16'))['db'];var csv_results;config[_0x8f03('0x17')]=_[_0x8f03('0x18')](config[_0x8f03('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8f03('0x19'))(new Redis(config[_0x8f03('0x17')]));require(_0x8f03('0x1a'))[_0x8f03('0x1b')](socket);function respondWithStatusCode(_0x22135a,_0x336903){_0x336903=_0x336903||0xcc;return function(_0x275cda){if(_0x275cda){return _0x22135a[_0x8f03('0x1c')](_0x336903);}return _0x22135a[_0x8f03('0x1d')](_0x336903)[_0x8f03('0x1e')]();};}function respondWithResult(_0x579021,_0x278013){_0x278013=_0x278013||0xc8;return function(_0x5e6957){if(_0x5e6957){return _0x579021[_0x8f03('0x1d')](_0x278013)[_0x8f03('0x1f')](_0x5e6957);}};}function respondWithFilteredResult(_0x4dec45,_0x3e5706){return function(_0x85393){if(_0x85393){var _0x322d33=typeof _0x3e5706[_0x8f03('0x20')]===_0x8f03('0x21')&&typeof _0x3e5706[_0x8f03('0x22')]==='undefined';var _0xa0d3e3=_0x85393['count'];var _0x1f22ea=_0x322d33?0x0:_0x3e5706[_0x8f03('0x20')];var _0x391210=_0x322d33?_0x85393[_0x8f03('0x23')]:_0x3e5706['offset']+_0x3e5706[_0x8f03('0x22')];var _0x4ec9d7;if(_0x391210>=_0xa0d3e3){_0x391210=_0xa0d3e3;_0x4ec9d7=0xc8;}else{_0x4ec9d7=0xce;}_0x4dec45[_0x8f03('0x1d')](_0x4ec9d7);return _0x4dec45[_0x8f03('0x24')](_0x8f03('0x25'),_0x1f22ea+'-'+_0x391210+'/'+_0xa0d3e3)['json'](_0x85393);}return null;};}function patchUpdates(_0x4e8d9a){return function(_0x2154b4){try{jsonpatch['apply'](_0x2154b4,_0x4e8d9a,!![]);}catch(_0x1b159d){return BPromise['reject'](_0x1b159d);}return _0x2154b4['save']();};}function saveUpdates(_0x4afa5d,_0x2c0e5d){return function(_0x3687b4){if(_0x3687b4){return _0x3687b4['update'](_0x4afa5d)['then'](function(_0x2819f9){return _0x2819f9;});}return null;};}function removeEntity(_0x38e58a,_0x4ac582){return function(_0x553a50){if(_0x553a50){return _0x553a50[_0x8f03('0x26')]()[_0x8f03('0x27')](function(){var _0x12bb78=_0x553a50[_0x8f03('0x28')]({'plain':!![]});var _0x185508=_0x8f03('0x29');return db[_0x8f03('0x2a')][_0x8f03('0x26')]({'where':{'type':_0x185508,'resourceId':_0x12bb78['id']}})[_0x8f03('0x27')](function(){return _0x553a50;});})['then'](function(){_0x38e58a[_0x8f03('0x1d')](0xcc)[_0x8f03('0x1e')]();});}};}function handleEntityNotFound(_0x4c65e1,_0x1a5888){return function(_0x348079){if(!_0x348079){_0x4c65e1['sendStatus'](0x194);}return _0x348079;};}function handleError(_0x2e3ab5,_0x35b0b1){_0x35b0b1=_0x35b0b1||0x1f4;return function(_0x1375c7){logger[_0x8f03('0x2b')](_0x1375c7[_0x8f03('0x2c')]);if(_0x1375c7[_0x8f03('0x2d')]){delete _0x1375c7[_0x8f03('0x2d')];}_0x2e3ab5[_0x8f03('0x1d')](_0x35b0b1)[_0x8f03('0x2e')](_0x1375c7);};}exports[_0x8f03('0x2f')]=function(_0x34e998,_0x5d5912){var _0x43772={},_0x3205a1={},_0x25902e={'count':0x0,'rows':[]};var _0x1bb8d6=_['map'](db[_0x8f03('0x30')][_0x8f03('0x31')],function(_0x56e87c){return{'name':_0x56e87c[_0x8f03('0x32')],'type':_0x56e87c[_0x8f03('0x33')]['key']};});_0x3205a1['model']=_[_0x8f03('0x34')](_0x1bb8d6,_0x8f03('0x2d'));_0x3205a1[_0x8f03('0x35')]=_['keys'](_0x34e998[_0x8f03('0x35')]);_0x3205a1['filters']=_[_0x8f03('0x36')](_0x3205a1[_0x8f03('0x37')],_0x3205a1[_0x8f03('0x35')]);_0x43772[_0x8f03('0x38')]=_['intersection'](_0x3205a1[_0x8f03('0x37')],qs['fields'](_0x34e998[_0x8f03('0x35')][_0x8f03('0x39')]));_0x43772[_0x8f03('0x38')]=_0x43772['attributes'][_0x8f03('0x3a')]?_0x43772[_0x8f03('0x38')]:_0x3205a1['model'];if(!_0x34e998[_0x8f03('0x35')][_0x8f03('0x3b')]('nolimit')){_0x43772['limit']=qs[_0x8f03('0x22')](_0x34e998[_0x8f03('0x35')][_0x8f03('0x22')]);_0x43772[_0x8f03('0x20')]=qs[_0x8f03('0x20')](_0x34e998['query'][_0x8f03('0x20')]);}_0x43772[_0x8f03('0x3c')]=qs[_0x8f03('0x3d')](_0x34e998['query'][_0x8f03('0x3d')]);_0x43772[_0x8f03('0x3e')]=qs[_0x8f03('0x3f')](_['pick'](_0x34e998[_0x8f03('0x35')],_0x3205a1[_0x8f03('0x3f')]),_0x1bb8d6);if(_0x34e998['query'][_0x8f03('0x40')]){_0x43772[_0x8f03('0x3e')]=_[_0x8f03('0x41')](_0x43772[_0x8f03('0x3e')],{'$or':_['map'](_0x1bb8d6,function(_0x1beb7c){if(_0x1beb7c[_0x8f03('0x33')]!=='VIRTUAL'){var _0x1701f3={};_0x1701f3[_0x1beb7c[_0x8f03('0x2d')]]={'$like':'%'+_0x34e998[_0x8f03('0x35')][_0x8f03('0x40')]+'%'};return _0x1701f3;}})});}_0x43772=_[_0x8f03('0x41')]({},_0x43772,_0x34e998[_0x8f03('0x42')]);var _0x4636fa={'where':_0x43772[_0x8f03('0x3e')]};return db[_0x8f03('0x30')][_0x8f03('0x23')](_0x4636fa)[_0x8f03('0x27')](function(_0x464356){_0x25902e[_0x8f03('0x23')]=_0x464356;if(_0x34e998[_0x8f03('0x35')][_0x8f03('0x43')]){_0x43772[_0x8f03('0x44')]=[{'all':!![]}];}return db[_0x8f03('0x30')][_0x8f03('0x45')](_0x43772);})[_0x8f03('0x27')](function(_0x52f077){_0x25902e['rows']=_0x52f077;return _0x25902e;})['then'](respondWithFilteredResult(_0x5d5912,_0x43772))[_0x8f03('0x46')](handleError(_0x5d5912,null));};exports['show']=function(_0x2a02dc,_0x248c64){var _0x47a89f={'raw':![],'where':{'id':_0x2a02dc[_0x8f03('0x47')]['id']}},_0x5599a5={};_0x5599a5[_0x8f03('0x37')]=_[_0x8f03('0x48')](db[_0x8f03('0x30')]['rawAttributes']);_0x5599a5[_0x8f03('0x35')]=_[_0x8f03('0x48')](_0x2a02dc[_0x8f03('0x35')]);_0x5599a5[_0x8f03('0x3f')]=_[_0x8f03('0x36')](_0x5599a5[_0x8f03('0x37')],_0x5599a5[_0x8f03('0x35')]);_0x47a89f[_0x8f03('0x38')]=_[_0x8f03('0x36')](_0x5599a5[_0x8f03('0x37')],qs['fields'](_0x2a02dc['query'][_0x8f03('0x39')]));_0x47a89f[_0x8f03('0x38')]=_0x47a89f[_0x8f03('0x38')][_0x8f03('0x3a')]?_0x47a89f['attributes']:_0x5599a5[_0x8f03('0x37')];if(_0x2a02dc['query']['includeAll']){_0x47a89f['include']=[{'all':!![]}];}_0x47a89f=_[_0x8f03('0x41')]({},_0x47a89f,_0x2a02dc[_0x8f03('0x42')]);return db[_0x8f03('0x30')][_0x8f03('0x49')](_0x47a89f)[_0x8f03('0x27')](handleEntityNotFound(_0x248c64,null))[_0x8f03('0x27')](respondWithResult(_0x248c64,null))[_0x8f03('0x46')](handleError(_0x248c64,null));};exports[_0x8f03('0x4a')]=function(_0x403825,_0x9d1830){return db['CmList'][_0x8f03('0x4a')](_0x403825[_0x8f03('0x4b')],{})['then'](function(_0x53987c){var _0x5e4513=_0x403825['user'][_0x8f03('0x28')]({'plain':!![]});if(!_0x5e4513)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e4513[_0x8f03('0x4c')]===_0x8f03('0x4d')){var _0x4682c3=_0x53987c[_0x8f03('0x28')]({'plain':!![]});var _0x26a648=_0x8f03('0x29');return db[_0x8f03('0x4e')][_0x8f03('0x49')]({'where':{'name':_0x26a648,'userProfileId':_0x5e4513['userProfileId']},'raw':!![]})[_0x8f03('0x27')](function(_0x5694d7){if(_0x5694d7&&_0x5694d7[_0x8f03('0x4f')]===0x0){return db['UserProfileResource'][_0x8f03('0x4a')]({'name':_0x4682c3['name'],'resourceId':_0x4682c3['id'],'type':_0x5694d7[_0x8f03('0x2d')],'sectionId':_0x5694d7['id']},{})[_0x8f03('0x27')](function(){return _0x53987c;});}else{return _0x53987c;}})[_0x8f03('0x46')](function(_0x13a9b3){logger['error'](_0x8f03('0x50'),_0x13a9b3);throw _0x13a9b3;});}return _0x53987c;})['then'](respondWithResult(_0x9d1830,0xc9))['catch'](handleError(_0x9d1830,null));};exports[_0x8f03('0x51')]=function(_0x585228,_0x58ceff){if(_0x585228[_0x8f03('0x4b')]['id']){delete _0x585228[_0x8f03('0x4b')]['id'];}return db[_0x8f03('0x30')][_0x8f03('0x49')]({'where':{'id':_0x585228[_0x8f03('0x47')]['id']}})['then'](handleEntityNotFound(_0x58ceff,null))[_0x8f03('0x27')](saveUpdates(_0x585228[_0x8f03('0x4b')],null))['then'](respondWithResult(_0x58ceff,null))['catch'](handleError(_0x58ceff,null));};exports['destroy']=function(_0x18b32b,_0x49b395){return db[_0x8f03('0x30')][_0x8f03('0x49')]({'where':{'id':_0x18b32b['params']['id']}})['then'](handleEntityNotFound(_0x49b395,null))[_0x8f03('0x27')](removeEntity(_0x49b395,null))[_0x8f03('0x46')](handleError(_0x49b395,null));};exports[_0x8f03('0x52')]=function(_0x5352c0,_0x550050){return db[_0x8f03('0x30')]['describe']()[_0x8f03('0x27')](respondWithResult(_0x550050,null))[_0x8f03('0x46')](handleError(_0x550050,null));};exports['addDisposition']=function(_0x41c0e2,_0xf98593,_0x4b3430){if(_0x41c0e2[_0x8f03('0x4b')]['id']){delete _0x41c0e2[_0x8f03('0x4b')]['id'];}return db['CmList'][_0x8f03('0x49')]({'where':{'id':_0x41c0e2['params']['id']}})['then'](handleEntityNotFound(_0xf98593,null))[_0x8f03('0x27')](function(_0x5bcedb){if(_0x5bcedb){_0x41c0e2[_0x8f03('0x4b')][_0x8f03('0x53')]=_0x5bcedb['id'];return db[_0x8f03('0x54')][_0x8f03('0x4a')](_0x41c0e2[_0x8f03('0x4b')]);}})[_0x8f03('0x27')](respondWithResult(_0xf98593,null))[_0x8f03('0x46')](handleError(_0xf98593,null));};exports[_0x8f03('0x55')]=function(_0x3f0b77,_0x35da9d,_0x37c956){var _0x1ff83b={'raw':![],'where':{}};var _0x5cf299={};var _0x180859={'count':0x0,'rows':[]};return db[_0x8f03('0x30')][_0x8f03('0x56')]({'where':{'id':_0x3f0b77[_0x8f03('0x47')]['id']}})[_0x8f03('0x27')](handleEntityNotFound(_0x35da9d,null))[_0x8f03('0x27')](function(_0x2cc760){if(_0x2cc760){_0x5cf299[_0x8f03('0x37')]=_[_0x8f03('0x48')](db[_0x8f03('0x54')][_0x8f03('0x31')]);_0x5cf299[_0x8f03('0x35')]=_[_0x8f03('0x48')](_0x3f0b77[_0x8f03('0x35')]);_0x5cf299['filters']=_[_0x8f03('0x36')](_0x5cf299[_0x8f03('0x37')],_0x5cf299[_0x8f03('0x35')]);_0x1ff83b['attributes']=_[_0x8f03('0x36')](_0x5cf299[_0x8f03('0x37')],qs[_0x8f03('0x39')](_0x3f0b77[_0x8f03('0x35')][_0x8f03('0x39')]));_0x1ff83b[_0x8f03('0x38')]=_0x1ff83b[_0x8f03('0x38')][_0x8f03('0x3a')]?_0x1ff83b[_0x8f03('0x38')]:_0x5cf299[_0x8f03('0x37')];if(!_0x3f0b77[_0x8f03('0x35')]['hasOwnProperty']('nolimit')){_0x1ff83b[_0x8f03('0x22')]=qs[_0x8f03('0x22')](_0x3f0b77[_0x8f03('0x35')][_0x8f03('0x22')]);_0x1ff83b[_0x8f03('0x20')]=qs[_0x8f03('0x20')](_0x3f0b77[_0x8f03('0x35')][_0x8f03('0x20')]);}_0x1ff83b[_0x8f03('0x3c')]=qs[_0x8f03('0x3d')](_0x3f0b77['query']['sort']);_0x1ff83b[_0x8f03('0x3e')]=qs[_0x8f03('0x3f')](_[_0x8f03('0x57')](_0x3f0b77['query'],_0x5cf299[_0x8f03('0x3f')]));_0x1ff83b[_0x8f03('0x3e')][_0x8f03('0x53')]=_0x2cc760['id'];if(_0x3f0b77[_0x8f03('0x35')]['filter']){_0x1ff83b[_0x8f03('0x3e')]=_[_0x8f03('0x41')](_0x1ff83b['where'],{'$or':_[_0x8f03('0x34')](_0x1ff83b['attributes'],function(_0xfefe85){var _0x2b9209={};_0x2b9209[_0xfefe85]={'$like':'%'+_0x3f0b77[_0x8f03('0x35')][_0x8f03('0x40')]+'%'};return _0x2b9209;})});}_0x1ff83b=_[_0x8f03('0x41')]({},_0x1ff83b,_0x3f0b77[_0x8f03('0x42')]);return db['Disposition']['count']({'where':_0x1ff83b['where']})[_0x8f03('0x27')](function(_0x512267){_0x180859[_0x8f03('0x23')]=_0x512267;if(_0x3f0b77[_0x8f03('0x35')][_0x8f03('0x43')]){_0x1ff83b['include']=[{'all':!![]}];}return db[_0x8f03('0x54')]['findAll'](_0x1ff83b);})[_0x8f03('0x27')](function(_0xf33474){_0x180859[_0x8f03('0x58')]=_0xf33474;return _0x180859;});}})[_0x8f03('0x27')](respondWithFilteredResult(_0x35da9d,_0x1ff83b))[_0x8f03('0x46')](handleError(_0x35da9d,null));};exports[_0x8f03('0x59')]=function(_0x5d7ad6,_0x118b6e,_0x326502){return db[_0x8f03('0x30')][_0x8f03('0x49')]({'where':{'id':_0x5d7ad6['params']['id']}})[_0x8f03('0x27')](handleEntityNotFound(_0x118b6e,null))[_0x8f03('0x27')](function(_0x1bb95c){if(_0x1bb95c){return _0x1bb95c[_0x8f03('0x59')](_0x5d7ad6[_0x8f03('0x35')][_0x8f03('0x5a')]);}})[_0x8f03('0x27')](respondWithStatusCode(_0x118b6e,null))[_0x8f03('0x46')](handleError(_0x118b6e,null));};exports[_0x8f03('0x5b')]=function(_0x1ccf3d,_0x2e673f,_0x4914cb){return db[_0x8f03('0x30')]['find']({'where':{'id':_0x1ccf3d[_0x8f03('0x47')]['id']}})[_0x8f03('0x27')](handleEntityNotFound(_0x2e673f,null))[_0x8f03('0x27')](function(_0x30ef03){if(_0x30ef03){var _0x4f2508=[];var _0x1a3276={'success':[],'errors':[]};return db[_0x8f03('0x5c')]['describe']()[_0x8f03('0x27')](function(_0x27ad1f){if(_0x1ccf3d[_0x8f03('0x4b')][_0x8f03('0x5d')]&&_[_0x8f03('0x5e')](_0x1ccf3d[_0x8f03('0x4b')]['tags'])){if(_0x1ccf3d[_0x8f03('0x4b')][_0x8f03('0x5d')]['length']){_0x1ccf3d['body'][_0x8f03('0x5d')]=_0x1ccf3d[_0x8f03('0x4b')][_0x8f03('0x5d')][_0x8f03('0x5f')](';')+';';}else{_0x1ccf3d['body']['tags']=null;}}else{_0x1ccf3d[_0x8f03('0x4b')][_0x8f03('0x5d')]=null;}if(_0x1ccf3d[_0x8f03('0x4b')]&&_[_0x8f03('0x5e')](_0x1ccf3d[_0x8f03('0x4b')])){for(var _0x3a12a0=0x0;_0x3a12a0<_0x1ccf3d[_0x8f03('0x4b')]['length'];_0x3a12a0+=0x1){_0x1ccf3d[_0x8f03('0x4b')][_0x3a12a0]['ListId']=_0x1ccf3d[_0x8f03('0x47')]['id'];_0x4f2508['push'](_0x1ccf3d[_0x8f03('0x4b')][_0x3a12a0]);}return BPromise[_0x8f03('0x60')](_0x4f2508,function(_0x3a12c7){return db[_0x8f03('0x5c')][_0x8f03('0x4a')](_[_0x8f03('0x61')](_0x3a12c7,[_0x8f03('0x5a'),'id'])||{},{'fields':_['keys'](_0x27ad1f),'raw':!![]})[_0x8f03('0x27')](function(_0x5e79ad){_0x1a3276[_0x8f03('0x62')][_0x8f03('0x63')](_0x5e79ad[_0x8f03('0x64')]);})[_0x8f03('0x46')](function(_0x55e2be){_0x1a3276[_0x8f03('0x65')][_0x8f03('0x63')]({'data':_0x3a12c7,'error':_0x55e2be[_0x8f03('0x66')]});});})[_0x8f03('0x27')](function(_0x28796a){return _0x1a3276;})['catch'](function(_0x53acd2){return _0x53acd2;});}else{_0x2e673f[_0x8f03('0x1d')](0x190)[_0x8f03('0x1f')]({'message':_0x8f03('0x67')});}});}})[_0x8f03('0x27')](respondWithResult(_0x2e673f,null))[_0x8f03('0x46')](handleError(_0x2e673f,null));};exports[_0x8f03('0x68')]=function(_0x1c2c60,_0x52aaaa,_0x2d18b2){var _0x448a24;return db[_0x8f03('0x30')][_0x8f03('0x49')]({'where':{'id':_0x1c2c60['params']['id']},'include':[{'model':db[_0x8f03('0x69')],'as':_0x8f03('0x6a')}]})[_0x8f03('0x27')](handleEntityNotFound(_0x52aaaa,null))[_0x8f03('0x27')](function(_0xee257c){if(_0xee257c){_0x448a24=_0xee257c;return db[_0x8f03('0x5c')][_0x8f03('0x31')];}})['then'](function(_0x1b5468){if(_0x1b5468){var _0x241a53={};var _0x2e1eb3={};_0x2e1eb3[_0x8f03('0x37')]=_[_0x8f03('0x6b')](_[_0x8f03('0x48')](_0x1b5468),_[_0x8f03('0x34')](_0x448a24[_0x8f03('0x6a')],function(_0x278073){return util[_0x8f03('0x6c')]('cf_%d',_0x278073['id']);}));_0x2e1eb3[_0x8f03('0x35')]=_['keys'](_0x1c2c60[_0x8f03('0x35')]);_0x2e1eb3[_0x8f03('0x3f')]=_[_0x8f03('0x36')](_0x2e1eb3[_0x8f03('0x37')],_0x2e1eb3[_0x8f03('0x35')]);_0x241a53[_0x8f03('0x38')]=_[_0x8f03('0x36')](_0x2e1eb3[_0x8f03('0x37')],qs[_0x8f03('0x39')](_0x1c2c60['query'][_0x8f03('0x39')]));_0x241a53[_0x8f03('0x38')]=_0x241a53[_0x8f03('0x38')][_0x8f03('0x3a')]?_0x241a53[_0x8f03('0x38')]:_0x2e1eb3['model'];if(!_0x1c2c60[_0x8f03('0x35')][_0x8f03('0x3b')](_0x8f03('0x6d'))){_0x241a53['limit']=qs[_0x8f03('0x22')](_0x1c2c60[_0x8f03('0x35')][_0x8f03('0x22')]);_0x241a53[_0x8f03('0x20')]=qs[_0x8f03('0x20')](_0x1c2c60[_0x8f03('0x35')][_0x8f03('0x20')]);}_0x241a53[_0x8f03('0x3c')]=qs['sort'](_0x1c2c60['query'][_0x8f03('0x3d')]);_0x241a53['where']=qs['filters'](_[_0x8f03('0x57')](_0x1c2c60[_0x8f03('0x35')],_0x2e1eb3['filters']));_0x241a53[_0x8f03('0x6e')]=!![];if(_0x1c2c60['query'][_0x8f03('0x40')]){_0x241a53[_0x8f03('0x3e')]=_['merge'](_0x241a53[_0x8f03('0x3e')],{'$or':_['map'](_0x241a53[_0x8f03('0x38')],function(_0x2db63c){var _0x32e468={};_0x32e468[_0x2db63c]={'$like':'%'+_0x1c2c60['query'][_0x8f03('0x40')]+'%'};return _0x32e468;})});}_0x241a53=_[_0x8f03('0x41')]({},_0x241a53,_0x1c2c60[_0x8f03('0x42')]);return _0x448a24[_0x8f03('0x68')](_0x241a53);}})['then'](respondWithResult(_0x52aaaa,null))[_0x8f03('0x46')](handleError(_0x52aaaa,null));};exports['getContactsCsv']=function(_0x48e4e4,_0x4da16e,_0x3bb800){var _0xec78cb;var _0x5c25e8;var _0x4683cf;var _0x48c829=_0x48e4e4['params']['id'];csv_results=[];return db[_0x8f03('0x6f')][_0x8f03('0x45')]({'attributes':['id','name'],'raw':!![],'order':[_0x8f03('0x70')]})[_0x8f03('0x27')](function(_0x39457b){_0xec78cb=_0x39457b;var _0x365f7d=_[_0x8f03('0x48')](db[_0x8f03('0x5c')][_0x8f03('0x31')]);return db[_0x8f03('0x69')]['findAll']({'raw':!![],'attributes':['id','alias']})['then'](function(_0x5c58c5){_0x5c25e8=_0x5c58c5;var _0x520a93=squel[_0x8f03('0x71')]()[_0x8f03('0x39')](_0x365f7d)['from'](_0x8f03('0x72'),'c')['where']('c.ListId\x20=\x20?',_0x48c829)['where'](_0x8f03('0x73'))[_0x8f03('0x74')]();for(var _0x4f5f91=0x0;_0x4f5f91<_0x5c25e8[_0x8f03('0x3a')];_0x4f5f91++){_0x520a93[_0x8f03('0x75')](_0x8f03('0x76')+_0x5c25e8[_0x4f5f91]['id'],_0x8f03('0x77')+_0x5c25e8[_0x4f5f91][_0x8f03('0x78')]);}for(var _0x4f5f91=0x0;_0x4f5f91<_0xec78cb[_0x8f03('0x3a')];_0x4f5f91++){_0x520a93['field'](squel['select']()[_0x8f03('0x75')](_0x8f03('0x79'))[_0x8f03('0x7a')]('cm_contact_has_items')[_0x8f03('0x3e')](_0x8f03('0x7b'),_0xec78cb[_0x4f5f91]['id'])['where'](_0x8f03('0x7c')),_0x8f03('0x7d')+_0xec78cb[_0x4f5f91]['name']);_0x520a93[_0x8f03('0x75')](squel[_0x8f03('0x71')]()['field'](_0x8f03('0x7e'))['from'](_0x8f03('0x7f'))[_0x8f03('0x3e')](_0x8f03('0x7b'),_0xec78cb[_0x4f5f91]['id'])[_0x8f03('0x3e')]('CmContactId\x20=\x20c.id'),_0x8f03('0x80')+_0xec78cb[_0x4f5f91][_0x8f03('0x2d')]);}var _0xbf20c0=[];_0xbf20c0[_0x8f03('0x63')](_0x520a93[_0x8f03('0x81')]());BPromise['each'](_0xbf20c0,handleQuery)[_0x8f03('0x27')](function(_0x540a0c){handleQuery(_0x520a93[_0x8f03('0x81')]());var _0x3c78ac=csv_results[0x0];if(!_[_0x8f03('0x82')](_0x3c78ac)){var _0x478e7d=toCsv(_0x3c78ac);var _0x4d3230=Date[_0x8f03('0x83')]();fs[_0x8f03('0x84')](util[_0x8f03('0x6c')]('/tmp/list_%d_%s.csv',_0x48c829,_0x4d3230),_0x478e7d);_0x4da16e[_0x8f03('0x85')](_0x8f03('0x86'),_0x8f03('0x87')+util['format']('list_%d_%s.csv',_0x48c829,_0x4d3230));_0x4da16e[_0x8f03('0x85')](_0x8f03('0x88'),_0x8f03('0x89'));return _0x4da16e[_0x8f03('0x8a')](util['format'](_0x8f03('0x8b'),_0x48c829,_0x4d3230));}else{return _0x4da16e[_0x8f03('0x1c')](0xcc);}});});});};exports[_0x8f03('0x8c')]=function(_0x32d197,_0x76b2a2,_0x55b7d7){var _0x291970;delete _0x32d197[_0x8f03('0x4b')]['id'];return db[_0x8f03('0x30')][_0x8f03('0x56')]({'where':{'id':_0x32d197[_0x8f03('0x47')]['id']}})['then'](handleEntityNotFound(_0x76b2a2,null))[_0x8f03('0x27')](function(_0x47154c){if(_0x47154c){return db[_0x8f03('0x8d')][_0x8f03('0x8e')](function(_0x3bc731){return db[_0x8f03('0x69')]['create'](_0x32d197[_0x8f03('0x4b')],{'transaction':_0x3bc731})[_0x8f03('0x27')](function(_0x461fde){_0x291970=_0x461fde;return _0x47154c[_0x8f03('0x8f')](_0x461fde,{'transaction':_0x3bc731});})['then'](function(){var _0x46ba80={'type':db[_0x8f03('0x90')]['TEXT'],'transaction':_0x3bc731};switch(_0x32d197[_0x8f03('0x4b')][_0x8f03('0x33')]){case'text':_0x46ba80['type']=db[_0x8f03('0x90')]['TEXT'];break;case _0x8f03('0x91'):_0x46ba80[_0x8f03('0x33')]=db['Sequelize']['INTEGER'];break;case _0x8f03('0x92'):_0x46ba80[_0x8f03('0x33')]=db[_0x8f03('0x90')][_0x8f03('0x93')];_0x46ba80[_0x8f03('0x94')]=![];break;default:}return db[_0x8f03('0x8d')][_0x8f03('0x95')]['addColumn'](_0x8f03('0x72'),util[_0x8f03('0x6c')]('cf_%s',_0x291970['id']),_0x46ba80);})[_0x8f03('0x27')](function(){return _0x291970;});});}})[_0x8f03('0x27')](respondWithResult(_0x76b2a2,null))[_0x8f03('0x46')](handleError(_0x76b2a2,null));};exports[_0x8f03('0x96')]=function(_0x77c218,_0x16bbe0,_0x5c67b4){var _0xf83ce6={};var _0x3586d9={};var _0xcb31a9;var _0x1e4ecd;return db[_0x8f03('0x30')][_0x8f03('0x56')]({'where':{'id':_0x77c218[_0x8f03('0x47')]['id']}})[_0x8f03('0x27')](handleEntityNotFound(_0x16bbe0,null))[_0x8f03('0x27')](function(_0x38bde8){if(_0x38bde8){_0xcb31a9=_0x38bde8;_0x3586d9[_0x8f03('0x37')]=_['keys'](db[_0x8f03('0x69')][_0x8f03('0x31')]);_0x3586d9['query']=_['keys'](_0x77c218['query']);_0x3586d9[_0x8f03('0x3f')]=_[_0x8f03('0x36')](_0x3586d9[_0x8f03('0x37')],_0x3586d9[_0x8f03('0x35')]);_0xf83ce6[_0x8f03('0x38')]=_[_0x8f03('0x36')](_0x3586d9['model'],qs[_0x8f03('0x39')](_0x77c218['query']['fields']));_0xf83ce6[_0x8f03('0x38')]=_0xf83ce6[_0x8f03('0x38')]['length']?_0xf83ce6[_0x8f03('0x38')]:_0x3586d9[_0x8f03('0x37')];_0xf83ce6[_0x8f03('0x3c')]=qs[_0x8f03('0x3d')](_0x77c218[_0x8f03('0x35')][_0x8f03('0x3d')]);_0xf83ce6[_0x8f03('0x3e')]=qs[_0x8f03('0x3f')](_[_0x8f03('0x57')](_0x77c218[_0x8f03('0x35')],_0x3586d9[_0x8f03('0x3f')]));_0xf83ce6[_0x8f03('0x3e')]=_[_0x8f03('0x41')](_0xf83ce6[_0x8f03('0x3e')],{'$or':[{'ListId':_0x38bde8['id']},{'ListId':null}]});if(_0x77c218['query'][_0x8f03('0x40')]){_0xf83ce6[_0x8f03('0x3e')]=_['merge'](_0xf83ce6[_0x8f03('0x3e')],{'$or':_[_0x8f03('0x34')](_0xf83ce6[_0x8f03('0x38')],function(_0x116934){var _0x50a9f9={};_0x50a9f9[_0x116934]={'$like':'%'+_0x77c218[_0x8f03('0x35')][_0x8f03('0x40')]+'%'};return _0x50a9f9;})});}_0xf83ce6=_['merge']({},_0xf83ce6,_0x77c218[_0x8f03('0x42')]);return db[_0x8f03('0x69')]['findAndCountAll'](_0xf83ce6);}})[_0x8f03('0x27')](respondWithResult(_0x16bbe0,null))[_0x8f03('0x46')](handleError(_0x16bbe0,null));};exports[_0x8f03('0x97')]=function(_0x47c8a9,_0x36e81c){return db[_0x8f03('0x69')][_0x8f03('0x98')]({'where':{'ListId':null}})[_0x8f03('0x27')](handleEntityNotFound(_0x36e81c,null))['then'](function(_0x7fd8e2){return _0x7fd8e2;})['then'](respondWithResult(_0x36e81c,null))['catch'](handleError(_0x36e81c,null));};exports[_0x8f03('0x99')]=function(_0x49f140,_0x412a87,_0xf4e1e5){return db[_0x8f03('0x30')][_0x8f03('0x49')]({'where':{'id':_0x49f140[_0x8f03('0x47')]['id']}})[_0x8f03('0x27')](handleEntityNotFound(_0x412a87,null))[_0x8f03('0x27')](function(_0x15c25d){if(_0x15c25d){return _0x15c25d[_0x8f03('0x99')](_0x49f140[_0x8f03('0x4b')][_0x8f03('0x5a')],_['omit'](_0x49f140[_0x8f03('0x4b')],[_0x8f03('0x5a'),'id'])||{})[_0x8f03('0x9a')](function(_0x2cceba){for(var _0x165b91=0x0;_0x165b91<_0x49f140[_0x8f03('0x4b')]['ids'][_0x8f03('0x3a')];_0x165b91+=0x1){socket[_0x8f03('0x9b')](_0x8f03('0x9c'),{'UserId':Number(_0x49f140[_0x8f03('0x4b')][_0x8f03('0x5a')][_0x165b91]),'CmListId':Number(_0x49f140[_0x8f03('0x47')]['id'])});}return _0x2cceba;});}})['then'](respondWithResult(_0x412a87,null))['catch'](handleError(_0x412a87,null));};exports[_0x8f03('0x9d')]=function(_0x23937f,_0x2ab963,_0x3e4caa){return db[_0x8f03('0x30')][_0x8f03('0x49')]({'where':{'id':_0x23937f['params']['id']}})['then'](handleEntityNotFound(_0x2ab963,null))[_0x8f03('0x27')](function(_0x1e6ef5){if(_0x1e6ef5){return _0x1e6ef5[_0x8f03('0x9d')](_0x23937f['query'][_0x8f03('0x5a')])[_0x8f03('0x27')](function(){if(_[_0x8f03('0x5e')](_0x23937f[_0x8f03('0x35')][_0x8f03('0x5a')])){for(var _0x29b899=0x0;_0x29b899<_0x23937f[_0x8f03('0x35')][_0x8f03('0x5a')][_0x8f03('0x3a')];_0x29b899+=0x1){socket['emit'](_0x8f03('0x9e'),{'UserId':Number(_0x23937f[_0x8f03('0x35')][_0x8f03('0x5a')][_0x29b899]),'CmListId':Number(_0x23937f[_0x8f03('0x47')]['id'])});}}else{socket[_0x8f03('0x9b')](_0x8f03('0x9e'),{'UserId':Number(_0x23937f[_0x8f03('0x35')][_0x8f03('0x5a')]),'CmListId':Number(_0x23937f[_0x8f03('0x47')]['id'])});}});}})[_0x8f03('0x27')](respondWithStatusCode(_0x2ab963,null))[_0x8f03('0x46')](handleError(_0x2ab963,null));};exports[_0x8f03('0x9f')]=function(_0x3f2f51,_0x15560b,_0x38e79e){var _0x4f0451={};var _0xae69a3={};var _0x727b67;var _0xf4f441;return db['CmList'][_0x8f03('0x56')]({'where':{'id':_0x3f2f51['params']['id']}})['then'](handleEntityNotFound(_0x15560b,null))[_0x8f03('0x27')](function(_0x4670c0){if(_0x4670c0){_0x727b67=_0x4670c0;_0xae69a3[_0x8f03('0x37')]=_[_0x8f03('0x48')](db['User']['rawAttributes']);_0xae69a3['query']=_[_0x8f03('0x48')](_0x3f2f51[_0x8f03('0x35')]);_0xae69a3[_0x8f03('0x3f')]=_['intersection'](_0xae69a3[_0x8f03('0x37')],_0xae69a3[_0x8f03('0x35')]);_0x4f0451[_0x8f03('0x38')]=_['intersection'](_0xae69a3[_0x8f03('0x37')],qs[_0x8f03('0x39')](_0x3f2f51[_0x8f03('0x35')][_0x8f03('0x39')]));_0x4f0451['attributes']=_0x4f0451[_0x8f03('0x38')][_0x8f03('0x3a')]?_0x4f0451[_0x8f03('0x38')]:_0xae69a3['model'];_0x4f0451[_0x8f03('0x3c')]=qs[_0x8f03('0x3d')](_0x3f2f51[_0x8f03('0x35')][_0x8f03('0x3d')]);_0x4f0451['where']=qs[_0x8f03('0x3f')](_[_0x8f03('0x57')](_0x3f2f51[_0x8f03('0x35')],_0xae69a3[_0x8f03('0x3f')]));if(_0x3f2f51[_0x8f03('0x35')][_0x8f03('0x40')]){_0x4f0451[_0x8f03('0x3e')]=_[_0x8f03('0x41')](_0x4f0451[_0x8f03('0x3e')],{'$or':_['map'](_0x4f0451[_0x8f03('0x38')],function(_0x1c1ee8){var _0x1a4cf7={};_0x1a4cf7[_0x1c1ee8]={'$like':'%'+_0x3f2f51[_0x8f03('0x35')][_0x8f03('0x40')]+'%'};return _0x1a4cf7;})});}_0x4f0451=_[_0x8f03('0x41')]({},_0x4f0451,_0x3f2f51[_0x8f03('0x42')]);return _0x727b67[_0x8f03('0x9f')](_0x4f0451);}})[_0x8f03('0x27')](function(_0x3b2685){if(_0x3b2685){_0xf4f441=_0x3b2685[_0x8f03('0x3a')];if(!_0x3f2f51[_0x8f03('0x35')]['hasOwnProperty'](_0x8f03('0x6d'))){_0x4f0451[_0x8f03('0x22')]=qs[_0x8f03('0x22')](_0x3f2f51['query']['limit']);_0x4f0451['offset']=qs[_0x8f03('0x20')](_0x3f2f51[_0x8f03('0x35')]['offset']);}return _0x727b67[_0x8f03('0x9f')](_0x4f0451);}})[_0x8f03('0x27')](function(_0x164207){if(_0x164207){return _0x164207?{'count':_0xf4f441,'rows':_0x164207}:null;}})[_0x8f03('0x27')](respondWithResult(_0x15560b,null))['catch'](handleError(_0x15560b,null));};function handleQuery(_0x12e84b){logger['info'](_0x12e84b);return db[_0x8f03('0x8d')]['query'](_0x12e84b)['spread'](function(_0x4b30c5){csv_results[_0x8f03('0x63')](_0x4b30c5);})['catch'](function(_0x2aad6b){logger[_0x8f03('0x2b')](_0x2aad6b[_0x8f03('0x66')]);});} \ No newline at end of file +var _0x27d8=['additionalPhone_','description','description_additionalPhone_','toString','each','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','download','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','then','UserProfileResource','sendStatus','error','stack','name','index','CmList','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','user','get','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','findOne','nolimit','ListId','Disposition','findAll','removeDispositions','ids','CmContact','tags','isArray','push','omit','success','message','getContacts','CustomFields','concat','format','cf_%d','raw','getContactsCsv','CmCustomField','alias','select','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id'];(function(_0x421970,_0x181bc5){var _0x1d885e=function(_0x16afb4){while(--_0x16afb4){_0x421970['push'](_0x421970['shift']());}};_0x1d885e(++_0x181bc5);}(_0x27d8,0x154));var _0x827d=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0x27d8[_0x90a39a];return _0x2b62f7;};'use strict';var emlformat=require(_0x827d('0x0'));var rimraf=require(_0x827d('0x1'));var zipdir=require(_0x827d('0x2'));var jsonpatch=require(_0x827d('0x3'));var rp=require(_0x827d('0x4'));var moment=require('moment');var BPromise=require(_0x827d('0x5'));var Mustache=require('mustache');var util=require(_0x827d('0x6'));var path=require(_0x827d('0x7'));var sox=require(_0x827d('0x8'));var csv=require(_0x827d('0x9'));var ejs=require(_0x827d('0xa'));var fs=require('fs');var fs_extra=require(_0x827d('0xb'));var _=require(_0x827d('0xc'));var squel=require(_0x827d('0xd'));var crypto=require(_0x827d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x827d('0xf'));var toCsv=require(_0x827d('0x9'));var querystring=require('querystring');var Papa=require(_0x827d('0x10'));var Redis=require(_0x827d('0x11'));var authService=require(_0x827d('0x12'));var qs=require(_0x827d('0x13'));var as=require(_0x827d('0x14'));var hardwareService=require(_0x827d('0x15'));var logger=require(_0x827d('0x16'))(_0x827d('0x17'));var utils=require(_0x827d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x827d('0x19'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x827d('0x1a')]=_[_0x827d('0x1b')](config[_0x827d('0x1a')],{'host':_0x827d('0x1c'),'port':0x18eb});var socket=require(_0x827d('0x1d'))(new Redis(config[_0x827d('0x1a')]));require(_0x827d('0x1e'))[_0x827d('0x1f')](socket);function respondWithStatusCode(_0x593d4a,_0x4bd0e9){_0x4bd0e9=_0x4bd0e9||0xcc;return function(_0xe6f06e){if(_0xe6f06e){return _0x593d4a['sendStatus'](_0x4bd0e9);}return _0x593d4a[_0x827d('0x20')](_0x4bd0e9)[_0x827d('0x21')]();};}function respondWithResult(_0x96fe2f,_0x29b7d1){_0x29b7d1=_0x29b7d1||0xc8;return function(_0x3f9fe6){if(_0x3f9fe6){return _0x96fe2f[_0x827d('0x20')](_0x29b7d1)['json'](_0x3f9fe6);}};}function respondWithFilteredResult(_0x48b477,_0x1a9578){return function(_0xbccb4a){if(_0xbccb4a){var _0x1cca72=typeof _0x1a9578['offset']===_0x827d('0x22')&&typeof _0x1a9578[_0x827d('0x23')]==='undefined';var _0x51399e=_0xbccb4a[_0x827d('0x24')];var _0x159179=_0x1cca72?0x0:_0x1a9578[_0x827d('0x25')];var _0x1ffcbd=_0x1cca72?_0xbccb4a[_0x827d('0x24')]:_0x1a9578[_0x827d('0x25')]+_0x1a9578['limit'];var _0x199d0f;if(_0x1ffcbd>=_0x51399e){_0x1ffcbd=_0x51399e;_0x199d0f=0xc8;}else{_0x199d0f=0xce;}_0x48b477[_0x827d('0x20')](_0x199d0f);return _0x48b477[_0x827d('0x26')](_0x827d('0x27'),_0x159179+'-'+_0x1ffcbd+'/'+_0x51399e)[_0x827d('0x28')](_0xbccb4a);}return null;};}function patchUpdates(_0x37c5be){return function(_0x37e3ec){try{jsonpatch['apply'](_0x37e3ec,_0x37c5be,!![]);}catch(_0x5326ec){return BPromise[_0x827d('0x29')](_0x5326ec);}return _0x37e3ec[_0x827d('0x2a')]();};}function saveUpdates(_0x6b0d0b,_0x3fea32){return function(_0x10835d){if(_0x10835d){return _0x10835d[_0x827d('0x2b')](_0x6b0d0b)['then'](function(_0xafd988){return _0xafd988;});}return null;};}function removeEntity(_0x4ff3ea,_0x471005){return function(_0x225815){if(_0x225815){return _0x225815[_0x827d('0x2c')]()[_0x827d('0x2d')](function(){var _0x5eceee=_0x225815['get']({'plain':!![]});var _0x30b9b4='Lists';return db[_0x827d('0x2e')]['destroy']({'where':{'type':_0x30b9b4,'resourceId':_0x5eceee['id']}})[_0x827d('0x2d')](function(){return _0x225815;});})[_0x827d('0x2d')](function(){_0x4ff3ea[_0x827d('0x20')](0xcc)[_0x827d('0x21')]();});}};}function handleEntityNotFound(_0x283327,_0x4f03a2){return function(_0xfffd67){if(!_0xfffd67){_0x283327[_0x827d('0x2f')](0x194);}return _0xfffd67;};}function handleError(_0x8a5aa,_0x50530c){_0x50530c=_0x50530c||0x1f4;return function(_0x2880aa){logger[_0x827d('0x30')](_0x2880aa[_0x827d('0x31')]);if(_0x2880aa[_0x827d('0x32')]){delete _0x2880aa[_0x827d('0x32')];}_0x8a5aa[_0x827d('0x20')](_0x50530c)['send'](_0x2880aa);};}exports[_0x827d('0x33')]=function(_0x4822b0,_0x1adc1e){var _0x5970e6={},_0x19f073={},_0xadb3a2={'count':0x0,'rows':[]};var _0x1b2c32=_['map'](db[_0x827d('0x34')][_0x827d('0x35')],function(_0x42766f){return{'name':_0x42766f[_0x827d('0x36')],'type':_0x42766f[_0x827d('0x37')]['key']};});_0x19f073[_0x827d('0x38')]=_[_0x827d('0x39')](_0x1b2c32,_0x827d('0x32'));_0x19f073[_0x827d('0x3a')]=_[_0x827d('0x3b')](_0x4822b0['query']);_0x19f073[_0x827d('0x3c')]=_[_0x827d('0x3d')](_0x19f073[_0x827d('0x38')],_0x19f073[_0x827d('0x3a')]);_0x5970e6[_0x827d('0x3e')]=_[_0x827d('0x3d')](_0x19f073[_0x827d('0x38')],qs[_0x827d('0x3f')](_0x4822b0[_0x827d('0x3a')]['fields']));_0x5970e6[_0x827d('0x3e')]=_0x5970e6[_0x827d('0x3e')]['length']?_0x5970e6[_0x827d('0x3e')]:_0x19f073[_0x827d('0x38')];if(!_0x4822b0[_0x827d('0x3a')][_0x827d('0x40')]('nolimit')){_0x5970e6[_0x827d('0x23')]=qs[_0x827d('0x23')](_0x4822b0['query'][_0x827d('0x23')]);_0x5970e6[_0x827d('0x25')]=qs[_0x827d('0x25')](_0x4822b0[_0x827d('0x3a')]['offset']);}_0x5970e6[_0x827d('0x41')]=qs[_0x827d('0x42')](_0x4822b0[_0x827d('0x3a')][_0x827d('0x42')]);_0x5970e6[_0x827d('0x43')]=qs[_0x827d('0x3c')](_[_0x827d('0x44')](_0x4822b0[_0x827d('0x3a')],_0x19f073['filters']),_0x1b2c32);if(_0x4822b0[_0x827d('0x3a')]['filter']){_0x5970e6[_0x827d('0x43')]=_[_0x827d('0x45')](_0x5970e6['where'],{'$or':_[_0x827d('0x39')](_0x1b2c32,function(_0x464863){if(_0x464863[_0x827d('0x37')]!==_0x827d('0x46')){var _0x5cfc19={};_0x5cfc19[_0x464863['name']]={'$like':'%'+_0x4822b0[_0x827d('0x3a')][_0x827d('0x47')]+'%'};return _0x5cfc19;}})});}_0x5970e6=_[_0x827d('0x45')]({},_0x5970e6,_0x4822b0[_0x827d('0x48')]);var _0xe8cd34={'where':_0x5970e6[_0x827d('0x43')]};return db[_0x827d('0x34')][_0x827d('0x24')](_0xe8cd34)['then'](function(_0x5a5cb8){_0xadb3a2['count']=_0x5a5cb8;if(_0x4822b0[_0x827d('0x3a')][_0x827d('0x49')]){_0x5970e6[_0x827d('0x4a')]=[{'all':!![]}];}return db[_0x827d('0x34')]['findAll'](_0x5970e6);})[_0x827d('0x2d')](function(_0x90bc11){_0xadb3a2[_0x827d('0x4b')]=_0x90bc11;return _0xadb3a2;})[_0x827d('0x2d')](respondWithFilteredResult(_0x1adc1e,_0x5970e6))[_0x827d('0x4c')](handleError(_0x1adc1e,null));};exports[_0x827d('0x4d')]=function(_0x49be42,_0x37bde1){var _0x249c99={'raw':![],'where':{'id':_0x49be42[_0x827d('0x4e')]['id']}},_0x20fd04={};_0x20fd04['model']=_['keys'](db['CmList']['rawAttributes']);_0x20fd04[_0x827d('0x3a')]=_[_0x827d('0x3b')](_0x49be42[_0x827d('0x3a')]);_0x20fd04[_0x827d('0x3c')]=_[_0x827d('0x3d')](_0x20fd04[_0x827d('0x38')],_0x20fd04['query']);_0x249c99['attributes']=_['intersection'](_0x20fd04[_0x827d('0x38')],qs[_0x827d('0x3f')](_0x49be42[_0x827d('0x3a')]['fields']));_0x249c99[_0x827d('0x3e')]=_0x249c99[_0x827d('0x3e')][_0x827d('0x4f')]?_0x249c99[_0x827d('0x3e')]:_0x20fd04[_0x827d('0x38')];if(_0x49be42[_0x827d('0x3a')]['includeAll']){_0x249c99[_0x827d('0x4a')]=[{'all':!![]}];}_0x249c99=_[_0x827d('0x45')]({},_0x249c99,_0x49be42[_0x827d('0x48')]);return db['CmList'][_0x827d('0x50')](_0x249c99)['then'](handleEntityNotFound(_0x37bde1,null))['then'](respondWithResult(_0x37bde1,null))['catch'](handleError(_0x37bde1,null));};exports['create']=function(_0x11d44a,_0x197d4a){return db[_0x827d('0x34')]['create'](_0x11d44a['body'],{})[_0x827d('0x2d')](function(_0x295ceb){var _0x47c3cb=_0x11d44a[_0x827d('0x51')][_0x827d('0x52')]({'plain':!![]});if(!_0x47c3cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c3cb['role']===_0x827d('0x51')){var _0x2a1482=_0x295ceb['get']({'plain':!![]});var _0xea5415='Lists';return db['UserProfileSection'][_0x827d('0x50')]({'where':{'name':_0xea5415,'userProfileId':_0x47c3cb[_0x827d('0x53')]},'raw':!![]})['then'](function(_0x1dca51){if(_0x1dca51&&_0x1dca51[_0x827d('0x54')]===0x0){return db[_0x827d('0x2e')][_0x827d('0x55')]({'name':_0x2a1482[_0x827d('0x32')],'resourceId':_0x2a1482['id'],'type':_0x1dca51['name'],'sectionId':_0x1dca51['id']},{})[_0x827d('0x2d')](function(){return _0x295ceb;});}else{return _0x295ceb;}})[_0x827d('0x4c')](function(_0xd6e725){logger[_0x827d('0x30')](_0x827d('0x56'),_0xd6e725);throw _0xd6e725;});}return _0x295ceb;})['then'](respondWithResult(_0x197d4a,0xc9))['catch'](handleError(_0x197d4a,null));};exports['update']=function(_0x45f11a,_0x18fd79){if(_0x45f11a['body']['id']){delete _0x45f11a[_0x827d('0x57')]['id'];}return db[_0x827d('0x34')][_0x827d('0x50')]({'where':{'id':_0x45f11a[_0x827d('0x4e')]['id']}})[_0x827d('0x2d')](handleEntityNotFound(_0x18fd79,null))['then'](saveUpdates(_0x45f11a[_0x827d('0x57')],null))[_0x827d('0x2d')](respondWithResult(_0x18fd79,null))['catch'](handleError(_0x18fd79,null));};exports[_0x827d('0x2c')]=function(_0x32f569,_0x5580ac){return db[_0x827d('0x34')][_0x827d('0x50')]({'where':{'id':_0x32f569[_0x827d('0x4e')]['id']}})[_0x827d('0x2d')](handleEntityNotFound(_0x5580ac,null))['then'](removeEntity(_0x5580ac,null))['catch'](handleError(_0x5580ac,null));};exports[_0x827d('0x58')]=function(_0x3f4cf9,_0x2e1d85){return db[_0x827d('0x34')]['describe']()['then'](respondWithResult(_0x2e1d85,null))['catch'](handleError(_0x2e1d85,null));};exports[_0x827d('0x59')]=function(_0xa9ff0c,_0x4d45c4,_0x5ee261){if(_0xa9ff0c[_0x827d('0x57')]['id']){delete _0xa9ff0c[_0x827d('0x57')]['id'];}return db[_0x827d('0x34')][_0x827d('0x50')]({'where':{'id':_0xa9ff0c[_0x827d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d45c4,null))[_0x827d('0x2d')](function(_0x11503f){if(_0x11503f){_0xa9ff0c[_0x827d('0x57')]['ListId']=_0x11503f['id'];return db['Disposition']['create'](_0xa9ff0c[_0x827d('0x57')]);}})['then'](respondWithResult(_0x4d45c4,null))['catch'](handleError(_0x4d45c4,null));};exports['getDispositions']=function(_0x2bcd62,_0x5b1ce7,_0x576459){var _0x538944={'raw':![],'where':{}};var _0x4855b4={};var _0x32313a={'count':0x0,'rows':[]};return db[_0x827d('0x34')][_0x827d('0x5a')]({'where':{'id':_0x2bcd62[_0x827d('0x4e')]['id']}})[_0x827d('0x2d')](handleEntityNotFound(_0x5b1ce7,null))[_0x827d('0x2d')](function(_0xcb36d8){if(_0xcb36d8){_0x4855b4[_0x827d('0x38')]=_['keys'](db['Disposition'][_0x827d('0x35')]);_0x4855b4[_0x827d('0x3a')]=_['keys'](_0x2bcd62[_0x827d('0x3a')]);_0x4855b4[_0x827d('0x3c')]=_[_0x827d('0x3d')](_0x4855b4['model'],_0x4855b4[_0x827d('0x3a')]);_0x538944[_0x827d('0x3e')]=_[_0x827d('0x3d')](_0x4855b4['model'],qs[_0x827d('0x3f')](_0x2bcd62[_0x827d('0x3a')][_0x827d('0x3f')]));_0x538944[_0x827d('0x3e')]=_0x538944[_0x827d('0x3e')]['length']?_0x538944[_0x827d('0x3e')]:_0x4855b4[_0x827d('0x38')];if(!_0x2bcd62[_0x827d('0x3a')][_0x827d('0x40')](_0x827d('0x5b'))){_0x538944[_0x827d('0x23')]=qs[_0x827d('0x23')](_0x2bcd62['query'][_0x827d('0x23')]);_0x538944[_0x827d('0x25')]=qs['offset'](_0x2bcd62[_0x827d('0x3a')]['offset']);}_0x538944[_0x827d('0x41')]=qs[_0x827d('0x42')](_0x2bcd62[_0x827d('0x3a')]['sort']);_0x538944[_0x827d('0x43')]=qs[_0x827d('0x3c')](_[_0x827d('0x44')](_0x2bcd62[_0x827d('0x3a')],_0x4855b4['filters']));_0x538944[_0x827d('0x43')][_0x827d('0x5c')]=_0xcb36d8['id'];if(_0x2bcd62[_0x827d('0x3a')][_0x827d('0x47')]){_0x538944['where']=_[_0x827d('0x45')](_0x538944['where'],{'$or':_[_0x827d('0x39')](_0x538944[_0x827d('0x3e')],function(_0x120ead){var _0x41c377={};_0x41c377[_0x120ead]={'$like':'%'+_0x2bcd62[_0x827d('0x3a')]['filter']+'%'};return _0x41c377;})});}_0x538944=_['merge']({},_0x538944,_0x2bcd62['options']);return db[_0x827d('0x5d')][_0x827d('0x24')]({'where':_0x538944['where']})[_0x827d('0x2d')](function(_0x24cd9b){_0x32313a[_0x827d('0x24')]=_0x24cd9b;if(_0x2bcd62[_0x827d('0x3a')][_0x827d('0x49')]){_0x538944[_0x827d('0x4a')]=[{'all':!![]}];}return db[_0x827d('0x5d')][_0x827d('0x5e')](_0x538944);})[_0x827d('0x2d')](function(_0x397edc){_0x32313a['rows']=_0x397edc;return _0x32313a;});}})[_0x827d('0x2d')](respondWithFilteredResult(_0x5b1ce7,_0x538944))['catch'](handleError(_0x5b1ce7,null));};exports[_0x827d('0x5f')]=function(_0x143eb5,_0x20bca9,_0x4de550){return db[_0x827d('0x34')]['find']({'where':{'id':_0x143eb5[_0x827d('0x4e')]['id']}})[_0x827d('0x2d')](handleEntityNotFound(_0x20bca9,null))['then'](function(_0x3ce2ba){if(_0x3ce2ba){return _0x3ce2ba[_0x827d('0x5f')](_0x143eb5[_0x827d('0x3a')][_0x827d('0x60')]);}})[_0x827d('0x2d')](respondWithStatusCode(_0x20bca9,null))['catch'](handleError(_0x20bca9,null));};exports['addContacts']=function(_0x28b82d,_0xbb838c,_0x118ab3){return db[_0x827d('0x34')][_0x827d('0x50')]({'where':{'id':_0x28b82d['params']['id']}})['then'](handleEntityNotFound(_0xbb838c,null))[_0x827d('0x2d')](function(_0x2f3ca3){if(_0x2f3ca3){var _0xc497f3=[];var _0x16f30b={'success':[],'errors':[]};return db[_0x827d('0x61')]['describe']()['then'](function(_0x469b8a){if(_0x28b82d[_0x827d('0x57')][_0x827d('0x62')]&&_[_0x827d('0x63')](_0x28b82d[_0x827d('0x57')][_0x827d('0x62')])){if(_0x28b82d['body']['tags'][_0x827d('0x4f')]){_0x28b82d[_0x827d('0x57')][_0x827d('0x62')]=_0x28b82d['body'][_0x827d('0x62')]['join'](';')+';';}else{_0x28b82d['body'][_0x827d('0x62')]=null;}}else{_0x28b82d[_0x827d('0x57')][_0x827d('0x62')]=null;}if(_0x28b82d[_0x827d('0x57')]&&_[_0x827d('0x63')](_0x28b82d[_0x827d('0x57')])){for(var _0x3fc38a=0x0;_0x3fc38a<_0x28b82d['body']['length'];_0x3fc38a+=0x1){_0x28b82d['body'][_0x3fc38a][_0x827d('0x5c')]=_0x28b82d[_0x827d('0x4e')]['id'];_0xc497f3[_0x827d('0x64')](_0x28b82d[_0x827d('0x57')][_0x3fc38a]);}return BPromise['each'](_0xc497f3,function(_0x4a718a){return db[_0x827d('0x61')]['create'](_[_0x827d('0x65')](_0x4a718a,['ids','id'])||{},{'fields':_[_0x827d('0x3b')](_0x469b8a),'raw':!![]})[_0x827d('0x2d')](function(_0x7d6122){_0x16f30b[_0x827d('0x66')][_0x827d('0x64')](_0x7d6122['dataValues']);})['catch'](function(_0x3d5fa0){_0x16f30b['errors'][_0x827d('0x64')]({'data':_0x4a718a,'error':_0x3d5fa0[_0x827d('0x67')]});});})[_0x827d('0x2d')](function(_0x53dda5){return _0x16f30b;})[_0x827d('0x4c')](function(_0x3763d4){return _0x3763d4;});}else{_0xbb838c['status'](0x190)[_0x827d('0x28')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x827d('0x2d')](respondWithResult(_0xbb838c,null))[_0x827d('0x4c')](handleError(_0xbb838c,null));};exports[_0x827d('0x68')]=function(_0x5ac690,_0x4b7643,_0x259736){var _0x5f35c6;return db['CmList'][_0x827d('0x50')]({'where':{'id':_0x5ac690[_0x827d('0x4e')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x827d('0x69')}]})[_0x827d('0x2d')](handleEntityNotFound(_0x4b7643,null))['then'](function(_0x239511){if(_0x239511){_0x5f35c6=_0x239511;return db[_0x827d('0x61')][_0x827d('0x35')];}})[_0x827d('0x2d')](function(_0x289735){if(_0x289735){var _0x3aab24={};var _0x4d6c80={};_0x4d6c80[_0x827d('0x38')]=_[_0x827d('0x6a')](_[_0x827d('0x3b')](_0x289735),_[_0x827d('0x39')](_0x5f35c6[_0x827d('0x69')],function(_0x49f339){return util[_0x827d('0x6b')](_0x827d('0x6c'),_0x49f339['id']);}));_0x4d6c80[_0x827d('0x3a')]=_[_0x827d('0x3b')](_0x5ac690[_0x827d('0x3a')]);_0x4d6c80[_0x827d('0x3c')]=_[_0x827d('0x3d')](_0x4d6c80['model'],_0x4d6c80[_0x827d('0x3a')]);_0x3aab24['attributes']=_[_0x827d('0x3d')](_0x4d6c80[_0x827d('0x38')],qs[_0x827d('0x3f')](_0x5ac690[_0x827d('0x3a')][_0x827d('0x3f')]));_0x3aab24[_0x827d('0x3e')]=_0x3aab24[_0x827d('0x3e')][_0x827d('0x4f')]?_0x3aab24[_0x827d('0x3e')]:_0x4d6c80[_0x827d('0x38')];if(!_0x5ac690[_0x827d('0x3a')][_0x827d('0x40')]('nolimit')){_0x3aab24[_0x827d('0x23')]=qs[_0x827d('0x23')](_0x5ac690[_0x827d('0x3a')]['limit']);_0x3aab24[_0x827d('0x25')]=qs[_0x827d('0x25')](_0x5ac690[_0x827d('0x3a')][_0x827d('0x25')]);}_0x3aab24[_0x827d('0x41')]=qs['sort'](_0x5ac690[_0x827d('0x3a')][_0x827d('0x42')]);_0x3aab24[_0x827d('0x43')]=qs['filters'](_[_0x827d('0x44')](_0x5ac690[_0x827d('0x3a')],_0x4d6c80[_0x827d('0x3c')]));_0x3aab24[_0x827d('0x6d')]=!![];if(_0x5ac690[_0x827d('0x3a')]['filter']){_0x3aab24['where']=_[_0x827d('0x45')](_0x3aab24[_0x827d('0x43')],{'$or':_[_0x827d('0x39')](_0x3aab24[_0x827d('0x3e')],function(_0x4bd434){var _0xf4178={};_0xf4178[_0x4bd434]={'$like':'%'+_0x5ac690['query'][_0x827d('0x47')]+'%'};return _0xf4178;})});}_0x3aab24=_[_0x827d('0x45')]({},_0x3aab24,_0x5ac690[_0x827d('0x48')]);return _0x5f35c6[_0x827d('0x68')](_0x3aab24);}})['then'](respondWithResult(_0x4b7643,null))[_0x827d('0x4c')](handleError(_0x4b7643,null));};exports[_0x827d('0x6e')]=function(_0x3de4a3,_0x1c445e,_0x474df5){var _0x1da395;var _0x49ec0f;var _0x341ced;var _0x1c7b6f=_0x3de4a3['params']['id'];csv_results=[];return db['ContactItemType'][_0x827d('0x5e')]({'attributes':['id',_0x827d('0x32')],'raw':!![],'order':['OrderBy']})[_0x827d('0x2d')](function(_0x460692){_0x1da395=_0x460692;var _0x3464cf=_[_0x827d('0x3b')](db[_0x827d('0x61')][_0x827d('0x35')]);return db[_0x827d('0x6f')]['findAll']({'raw':!![],'attributes':['id',_0x827d('0x70')]})[_0x827d('0x2d')](function(_0x14be68){_0x49ec0f=_0x14be68;var _0x4127ab=squel[_0x827d('0x71')]()[_0x827d('0x3f')](_0x3464cf)[_0x827d('0x72')](_0x827d('0x73'),'c')[_0x827d('0x43')](_0x827d('0x74'),_0x1c7b6f)[_0x827d('0x43')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x5ea35b=0x0;_0x5ea35b<_0x49ec0f[_0x827d('0x4f')];_0x5ea35b++){_0x4127ab[_0x827d('0x75')](_0x827d('0x76')+_0x49ec0f[_0x5ea35b]['id'],'customField_'+_0x49ec0f[_0x5ea35b][_0x827d('0x70')]);}for(var _0x5ea35b=0x0;_0x5ea35b<_0x1da395['length'];_0x5ea35b++){_0x4127ab[_0x827d('0x75')](squel['select']()[_0x827d('0x75')]('item')[_0x827d('0x72')](_0x827d('0x77'))['where'](_0x827d('0x78'),_0x1da395[_0x5ea35b]['id'])[_0x827d('0x43')](_0x827d('0x79')),_0x827d('0x7a')+_0x1da395[_0x5ea35b][_0x827d('0x32')]);_0x4127ab['field'](squel[_0x827d('0x71')]()[_0x827d('0x75')](_0x827d('0x7b'))[_0x827d('0x72')](_0x827d('0x77'))[_0x827d('0x43')](_0x827d('0x78'),_0x1da395[_0x5ea35b]['id'])[_0x827d('0x43')](_0x827d('0x79')),_0x827d('0x7c')+_0x1da395[_0x5ea35b][_0x827d('0x32')]);}var _0x419a6e=[];_0x419a6e['push'](_0x4127ab[_0x827d('0x7d')]());BPromise[_0x827d('0x7e')](_0x419a6e,handleQuery)[_0x827d('0x2d')](function(_0x16b9fe){handleQuery(_0x4127ab[_0x827d('0x7d')]());var _0x451a97=csv_results[0x0];if(!_['isEmpty'](_0x451a97)){var _0x28bac9=toCsv(_0x451a97);var _0x1e32c6=Date['now']();fs[_0x827d('0x7f')](util[_0x827d('0x6b')]('/tmp/list_%d_%s.csv',_0x1c7b6f,_0x1e32c6),_0x28bac9);_0x1c445e[_0x827d('0x80')]('Content-disposition',_0x827d('0x81')+util['format'](_0x827d('0x82'),_0x1c7b6f,_0x1e32c6));_0x1c445e[_0x827d('0x80')]('Content-type','text/csv');return _0x1c445e[_0x827d('0x83')](util[_0x827d('0x6b')]('/tmp/list_%d_%s.csv',_0x1c7b6f,_0x1e32c6));}else{return _0x1c445e[_0x827d('0x2f')](0xcc);}});});});};exports['addCustomField']=function(_0x5a38ae,_0x55e44e,_0x5ad348){var _0x41ed12;delete _0x5a38ae['body']['id'];return db[_0x827d('0x34')][_0x827d('0x5a')]({'where':{'id':_0x5a38ae['params']['id']}})[_0x827d('0x2d')](handleEntityNotFound(_0x55e44e,null))[_0x827d('0x2d')](function(_0x3aedac){if(_0x3aedac){return db[_0x827d('0x84')]['transaction'](function(_0x4a8c30){return db[_0x827d('0x6f')][_0x827d('0x55')](_0x5a38ae[_0x827d('0x57')],{'transaction':_0x4a8c30})['then'](function(_0x50a082){_0x41ed12=_0x50a082;return _0x3aedac[_0x827d('0x85')](_0x50a082,{'transaction':_0x4a8c30});})[_0x827d('0x2d')](function(){var _0x5773b1={'type':db[_0x827d('0x86')][_0x827d('0x87')],'transaction':_0x4a8c30};switch(_0x5a38ae['body']['type']){case _0x827d('0x88'):_0x5773b1['type']=db[_0x827d('0x86')][_0x827d('0x87')];break;case _0x827d('0x89'):_0x5773b1[_0x827d('0x37')]=db[_0x827d('0x86')][_0x827d('0x8a')];break;case'switch':_0x5773b1[_0x827d('0x37')]=db['Sequelize'][_0x827d('0x8b')];_0x5773b1[_0x827d('0x8c')]=![];break;default:}return db[_0x827d('0x84')][_0x827d('0x8d')][_0x827d('0x8e')](_0x827d('0x73'),util['format'](_0x827d('0x8f'),_0x41ed12['id']),_0x5773b1);})[_0x827d('0x2d')](function(){return _0x41ed12;});});}})[_0x827d('0x2d')](respondWithResult(_0x55e44e,null))['catch'](handleError(_0x55e44e,null));};exports[_0x827d('0x90')]=function(_0x5141b2,_0x4e743a,_0x52ade3){var _0x1793f0={};var _0x49f20b={};var _0xc8c091;var _0x171845;return db['CmList'][_0x827d('0x5a')]({'where':{'id':_0x5141b2[_0x827d('0x4e')]['id']}})[_0x827d('0x2d')](handleEntityNotFound(_0x4e743a,null))[_0x827d('0x2d')](function(_0x46099b){if(_0x46099b){_0xc8c091=_0x46099b;_0x49f20b[_0x827d('0x38')]=_['keys'](db[_0x827d('0x6f')][_0x827d('0x35')]);_0x49f20b[_0x827d('0x3a')]=_['keys'](_0x5141b2[_0x827d('0x3a')]);_0x49f20b['filters']=_[_0x827d('0x3d')](_0x49f20b[_0x827d('0x38')],_0x49f20b['query']);_0x1793f0[_0x827d('0x3e')]=_[_0x827d('0x3d')](_0x49f20b['model'],qs['fields'](_0x5141b2['query'][_0x827d('0x3f')]));_0x1793f0[_0x827d('0x3e')]=_0x1793f0[_0x827d('0x3e')][_0x827d('0x4f')]?_0x1793f0[_0x827d('0x3e')]:_0x49f20b[_0x827d('0x38')];_0x1793f0[_0x827d('0x41')]=qs[_0x827d('0x42')](_0x5141b2[_0x827d('0x3a')][_0x827d('0x42')]);_0x1793f0[_0x827d('0x43')]=qs[_0x827d('0x3c')](_[_0x827d('0x44')](_0x5141b2['query'],_0x49f20b[_0x827d('0x3c')]));_0x1793f0['where']=_[_0x827d('0x45')](_0x1793f0[_0x827d('0x43')],{'$or':[{'ListId':_0x46099b['id']},{'ListId':null}]});if(_0x5141b2[_0x827d('0x3a')][_0x827d('0x47')]){_0x1793f0[_0x827d('0x43')]=_[_0x827d('0x45')](_0x1793f0[_0x827d('0x43')],{'$or':_['map'](_0x1793f0['attributes'],function(_0x1da4d5){var _0x5e55be={};_0x5e55be[_0x1da4d5]={'$like':'%'+_0x5141b2[_0x827d('0x3a')][_0x827d('0x47')]+'%'};return _0x5e55be;})});}_0x1793f0=_[_0x827d('0x45')]({},_0x1793f0,_0x5141b2[_0x827d('0x48')]);return db[_0x827d('0x6f')][_0x827d('0x91')](_0x1793f0);}})[_0x827d('0x2d')](respondWithResult(_0x4e743a,null))[_0x827d('0x4c')](handleError(_0x4e743a,null));};exports[_0x827d('0x92')]=function(_0x2bd29a,_0x596fe8){return db[_0x827d('0x6f')]['findAndCountAll']({'where':{'ListId':null}})[_0x827d('0x2d')](handleEntityNotFound(_0x596fe8,null))[_0x827d('0x2d')](function(_0x446805){return _0x446805;})[_0x827d('0x2d')](respondWithResult(_0x596fe8,null))[_0x827d('0x4c')](handleError(_0x596fe8,null));};exports[_0x827d('0x93')]=function(_0x3b510b,_0x48ff75,_0x4a3fb9){return db['CmList'][_0x827d('0x50')]({'where':{'id':_0x3b510b[_0x827d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48ff75,null))[_0x827d('0x2d')](function(_0x3b5c4f){if(_0x3b5c4f){return _0x3b5c4f['addAgents'](_0x3b510b[_0x827d('0x57')]['ids'],_['omit'](_0x3b510b['body'],[_0x827d('0x60'),'id'])||{})[_0x827d('0x94')](function(_0xd56513){for(var _0x1d2c7f=0x0;_0x1d2c7f<_0x3b510b['body'][_0x827d('0x60')][_0x827d('0x4f')];_0x1d2c7f+=0x1){socket[_0x827d('0x95')](_0x827d('0x96'),{'UserId':Number(_0x3b510b[_0x827d('0x57')]['ids'][_0x1d2c7f]),'CmListId':Number(_0x3b510b[_0x827d('0x4e')]['id'])});}return _0xd56513;});}})[_0x827d('0x2d')](respondWithResult(_0x48ff75,null))[_0x827d('0x4c')](handleError(_0x48ff75,null));};exports['removeAgents']=function(_0x1f38f1,_0x26de1d,_0x50f30a){return db[_0x827d('0x34')]['find']({'where':{'id':_0x1f38f1[_0x827d('0x4e')]['id']}})[_0x827d('0x2d')](handleEntityNotFound(_0x26de1d,null))['then'](function(_0x576bb7){if(_0x576bb7){return _0x576bb7[_0x827d('0x97')](_0x1f38f1[_0x827d('0x3a')][_0x827d('0x60')])[_0x827d('0x2d')](function(){if(_['isArray'](_0x1f38f1['query'][_0x827d('0x60')])){for(var _0x18294e=0x0;_0x18294e<_0x1f38f1[_0x827d('0x3a')]['ids'][_0x827d('0x4f')];_0x18294e+=0x1){socket[_0x827d('0x95')](_0x827d('0x98'),{'UserId':Number(_0x1f38f1[_0x827d('0x3a')]['ids'][_0x18294e]),'CmListId':Number(_0x1f38f1[_0x827d('0x4e')]['id'])});}}else{socket[_0x827d('0x95')](_0x827d('0x98'),{'UserId':Number(_0x1f38f1[_0x827d('0x3a')][_0x827d('0x60')]),'CmListId':Number(_0x1f38f1[_0x827d('0x4e')]['id'])});}});}})[_0x827d('0x2d')](respondWithStatusCode(_0x26de1d,null))[_0x827d('0x4c')](handleError(_0x26de1d,null));};exports[_0x827d('0x99')]=function(_0x53a7cd,_0x5a22de,_0x25b892){var _0x2cda41={};var _0x2181d1={};var _0x2dc065;var _0x53e31e;return db[_0x827d('0x34')][_0x827d('0x5a')]({'where':{'id':_0x53a7cd[_0x827d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a22de,null))[_0x827d('0x2d')](function(_0x4db8cf){if(_0x4db8cf){_0x2dc065=_0x4db8cf;_0x2181d1[_0x827d('0x38')]=_[_0x827d('0x3b')](db['User']['rawAttributes']);_0x2181d1[_0x827d('0x3a')]=_[_0x827d('0x3b')](_0x53a7cd[_0x827d('0x3a')]);_0x2181d1[_0x827d('0x3c')]=_[_0x827d('0x3d')](_0x2181d1[_0x827d('0x38')],_0x2181d1[_0x827d('0x3a')]);_0x2cda41['attributes']=_[_0x827d('0x3d')](_0x2181d1[_0x827d('0x38')],qs[_0x827d('0x3f')](_0x53a7cd['query'][_0x827d('0x3f')]));_0x2cda41[_0x827d('0x3e')]=_0x2cda41[_0x827d('0x3e')]['length']?_0x2cda41['attributes']:_0x2181d1[_0x827d('0x38')];_0x2cda41[_0x827d('0x41')]=qs[_0x827d('0x42')](_0x53a7cd[_0x827d('0x3a')][_0x827d('0x42')]);_0x2cda41[_0x827d('0x43')]=qs[_0x827d('0x3c')](_[_0x827d('0x44')](_0x53a7cd[_0x827d('0x3a')],_0x2181d1[_0x827d('0x3c')]));if(_0x53a7cd['query'][_0x827d('0x47')]){_0x2cda41[_0x827d('0x43')]=_['merge'](_0x2cda41[_0x827d('0x43')],{'$or':_[_0x827d('0x39')](_0x2cda41[_0x827d('0x3e')],function(_0xdb460d){var _0x27f378={};_0x27f378[_0xdb460d]={'$like':'%'+_0x53a7cd[_0x827d('0x3a')][_0x827d('0x47')]+'%'};return _0x27f378;})});}_0x2cda41=_['merge']({},_0x2cda41,_0x53a7cd[_0x827d('0x48')]);return _0x2dc065[_0x827d('0x99')](_0x2cda41);}})[_0x827d('0x2d')](function(_0x1503fd){if(_0x1503fd){_0x53e31e=_0x1503fd['length'];if(!_0x53a7cd[_0x827d('0x3a')][_0x827d('0x40')](_0x827d('0x5b'))){_0x2cda41[_0x827d('0x23')]=qs[_0x827d('0x23')](_0x53a7cd['query']['limit']);_0x2cda41[_0x827d('0x25')]=qs[_0x827d('0x25')](_0x53a7cd[_0x827d('0x3a')]['offset']);}return _0x2dc065[_0x827d('0x99')](_0x2cda41);}})['then'](function(_0x3fb3b3){if(_0x3fb3b3){return _0x3fb3b3?{'count':_0x53e31e,'rows':_0x3fb3b3}:null;}})[_0x827d('0x2d')](respondWithResult(_0x5a22de,null))[_0x827d('0x4c')](handleError(_0x5a22de,null));};function handleQuery(_0x325588){logger['info'](_0x325588);return db[_0x827d('0x84')][_0x827d('0x3a')](_0x325588)[_0x827d('0x94')](function(_0x1032fd){csv_results['push'](_0x1032fd);})[_0x827d('0x4c')](function(_0x720525){logger[_0x827d('0x30')](_0x720525['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index dcd0e7b..d8c5a92 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe14b,0x93));var _0xbe14=function(_0x429f82,_0x211f75){_0x429f82=_0x429f82-0x0;var _0x4d82bb=_0xe14b[_0x429f82];return _0x4d82bb;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x55ca,0x126));var _0xa55c=function(_0x360ec,_0x585d47){_0x360ec=_0x360ec-0x0;var _0xf03953=_0x55ca[_0x360ec];return _0xf03953;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index bfba8bc..1494f64 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 _0x41bb=['bluebird','request-promise','path','rimraf','./cmList.attributes','exports','cm_lists','lodash','util','api'];(function(_0xfb2554,_0x380ad4){var _0x1edf88=function(_0x43b4fa){while(--_0x43b4fa){_0xfb2554['push'](_0xfb2554['shift']());}};_0x1edf88(++_0x380ad4);}(_0x41bb,0xc5));var _0xb41b=function(_0x42c440,_0x28ee66){_0x42c440=_0x42c440-0x0;var _0x4a9172=_0x41bb[_0x42c440];return _0x4a9172;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var moment=require('moment');var BPromise=require(_0xb41b('0x3'));var rp=require(_0xb41b('0x4'));var fs=require('fs');var path=require(_0xb41b('0x5'));var rimraf=require(_0xb41b('0x6'));var config=require('../../config/environment');var attributes=require(_0xb41b('0x7'));module[_0xb41b('0x8')]=function(_0x2dbaa3,_0x50bc62){return _0x2dbaa3['define']('CmList',attributes,{'tableName':_0xb41b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['exports','define','CmList','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x54f7c9,_0x4fa9f4){var _0x2de6de=function(_0x2e5061){while(--_0x2e5061){_0x54f7c9['push'](_0x54f7c9['shift']());}};_0x2de6de(++_0x4fa9f4);}(_0x702d,0x147));var _0xd702=function(_0xef9a8b,_0x4207a9){_0xef9a8b=_0xef9a8b-0x0;var _0xe40153=_0x702d[_0xef9a8b];return _0xe40153;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./cmList.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index f1a6cd0..f90e43c 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 _0x01ec=['jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x01ec,0x12c));var _0xc01e=function(_0x575b4d,_0x4b77bf){_0x575b4d=_0x575b4d-0x0;var _0x51ecef=_0x01ec[_0x575b4d];return _0x51ecef;};'use strict';var _=require(_0xc01e('0x0'));var util=require(_0xc01e('0x1'));var moment=require(_0xc01e('0x2'));var BPromise=require(_0xc01e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc01e('0x4'))['db'];var utils=require(_0xc01e('0x5'));var logger=require(_0xc01e('0x6'))('rpc');var config=require(_0xc01e('0x7'));var jayson=require(_0xc01e('0x8'));var client=jayson[_0xc01e('0x9')][_0xc01e('0xa')]({'port':0x232a});config[_0xc01e('0xb')]=_[_0xc01e('0xc')](config[_0xc01e('0xb')],{'host':_0xc01e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc01e('0xe'))[_0xc01e('0xf')](socket);function respondWithRpcPromise(_0x568623,_0x756257,_0xa8c244){return new BPromise(function(_0xcbc1c7,_0x221ede){return client[_0xc01e('0x10')](_0x568623,_0xa8c244)[_0xc01e('0x11')](function(_0x2683d5){logger[_0xc01e('0x12')](_0xc01e('0x13'),_0x756257,'request\x20sent');logger[_0xc01e('0x14')](_0xc01e('0x15'),_0x756257,_0xc01e('0x16'),JSON[_0xc01e('0x17')](_0x2683d5));if(_0x2683d5['error']){if(_0x2683d5[_0xc01e('0x18')][_0xc01e('0x19')]===0x1f4){logger[_0xc01e('0x18')](_0xc01e('0x13'),_0x756257,_0x2683d5['error'][_0xc01e('0x1a')]);return _0x221ede(_0x2683d5['error'][_0xc01e('0x1a')]);}logger[_0xc01e('0x18')]('CmList,\x20%s,\x20%s',_0x756257,_0x2683d5[_0xc01e('0x18')][_0xc01e('0x1a')]);return _0xcbc1c7(_0x2683d5[_0xc01e('0x18')][_0xc01e('0x1a')]);}else{logger[_0xc01e('0x12')](_0xc01e('0x13'),_0x756257,_0xc01e('0x16'));_0xcbc1c7(_0x2683d5[_0xc01e('0x1b')][_0xc01e('0x1a')]);}})['catch'](function(_0x146180){logger[_0xc01e('0x18')](_0xc01e('0x13'),_0x756257,_0x146180);_0x221ede(_0x146180);});});} \ No newline at end of file +var _0x77b7=['localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x77b7,0x1e1));var _0x777b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x77b7[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x777b('0x0'));var util=require(_0x777b('0x1'));var moment=require(_0x777b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x777b('0x3'));var db=require(_0x777b('0x4'))['db'];var utils=require(_0x777b('0x5'));var logger=require(_0x777b('0x6'))('rpc');var config=require(_0x777b('0x7'));var jayson=require(_0x777b('0x8'));var client=jayson[_0x777b('0x9')][_0x777b('0xa')]({'port':0x232a});config[_0x777b('0xb')]=_[_0x777b('0xc')](config['redis'],{'host':_0x777b('0xd'),'port':0x18eb});var socket=require(_0x777b('0xe'))(new Redis(config['redis']));require(_0x777b('0xf'))[_0x777b('0x10')](socket);function respondWithRpcPromise(_0x38fae8,_0xae33a7,_0x5bdbf8){return new BPromise(function(_0x1b05a8,_0x2a0a4a){return client[_0x777b('0x11')](_0x38fae8,_0x5bdbf8)['then'](function(_0x5d7f34){logger[_0x777b('0x12')](_0x777b('0x13'),_0xae33a7,_0x777b('0x14'));logger[_0x777b('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0xae33a7,_0x777b('0x14'),JSON['stringify'](_0x5d7f34));if(_0x5d7f34[_0x777b('0x16')]){if(_0x5d7f34[_0x777b('0x16')]['code']===0x1f4){logger['error'](_0x777b('0x13'),_0xae33a7,_0x5d7f34['error']['message']);return _0x2a0a4a(_0x5d7f34[_0x777b('0x16')][_0x777b('0x17')]);}logger[_0x777b('0x16')]('CmList,\x20%s,\x20%s',_0xae33a7,_0x5d7f34[_0x777b('0x16')][_0x777b('0x17')]);return _0x1b05a8(_0x5d7f34['error'][_0x777b('0x17')]);}else{logger[_0x777b('0x12')]('CmList,\x20%s,\x20%s',_0xae33a7,'request\x20sent');_0x1b05a8(_0x5d7f34[_0x777b('0x18')]['message']);}})[_0x777b('0x19')](function(_0x57c7eb){logger[_0x777b('0x16')](_0x777b('0x13'),_0xae33a7,_0x57c7eb);_0x2a0a4a(_0x57c7eb);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 18e8973..299f201 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 _0x5dd6=['emit','register','length','cmList:','./cmList.events','save','remove','update'];(function(_0x1c7c2f,_0x2c0a88){var _0x311c00=function(_0x3d924d){while(--_0x3d924d){_0x1c7c2f['push'](_0x1c7c2f['shift']());}};_0x311c00(++_0x2c0a88);}(_0x5dd6,0x16c));var _0x65dd=function(_0x598c1e,_0x395e6e){_0x598c1e=_0x598c1e-0x0;var _0x487a43=_0x5dd6[_0x598c1e];return _0x487a43;};'use strict';var CmListEvents=require(_0x65dd('0x0'));var events=[_0x65dd('0x1'),_0x65dd('0x2'),_0x65dd('0x3')];function createListener(_0x4ac319,_0x5eb2c2){return function(_0x3e76ea){_0x5eb2c2[_0x65dd('0x4')](_0x4ac319,_0x3e76ea);};}function removeListener(_0x4d7240,_0x1ba508){return function(){CmListEvents['removeListener'](_0x4d7240,_0x1ba508);};}exports[_0x65dd('0x5')]=function(_0x5a2975){for(var _0x409abd=0x0,_0x190d7b=events[_0x65dd('0x6')];_0x409abd<_0x190d7b;_0x409abd++){var _0x3e1652=events[_0x409abd];var _0x204abe=createListener(_0x65dd('0x7')+_0x3e1652,_0x5a2975);CmListEvents['on'](_0x3e1652,_0x204abe);}}; \ No newline at end of file +var _0x9f72=['removeListener','length','cmList:','./cmList.events','save','remove','update'];(function(_0x3b469c,_0x2ec5e9){var _0x27fd19=function(_0x1d1ac7){while(--_0x1d1ac7){_0x3b469c['push'](_0x3b469c['shift']());}};_0x27fd19(++_0x2ec5e9);}(_0x9f72,0x114));var _0x29f7=function(_0x1d2ac3,_0x1ce3f3){_0x1d2ac3=_0x1d2ac3-0x0;var _0x288a5b=_0x9f72[_0x1d2ac3];return _0x288a5b;};'use strict';var CmListEvents=require(_0x29f7('0x0'));var events=[_0x29f7('0x1'),_0x29f7('0x2'),_0x29f7('0x3')];function createListener(_0x3233f1,_0x34812b){return function(_0x49bc04){_0x34812b['emit'](_0x3233f1,_0x49bc04);};}function removeListener(_0x141b78,_0x3bd2aa){return function(){CmListEvents[_0x29f7('0x4')](_0x141b78,_0x3bd2aa);};}exports['register']=function(_0x4ae5e0){for(var _0x4c0537=0x0,_0x41399d=events[_0x29f7('0x5')];_0x4c0537<_0x41399d;_0x4c0537++){var _0xc52148=events[_0x4c0537];var _0x44e83e=createListener(_0x29f7('0x6')+_0xc52148,_0x4ae5e0);CmListEvents['on'](_0xc52148,_0x44e83e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index a12da24..1d82c47 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 _0x0184=['/:id/contacts','addContacts','/:id/users','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','create','post','/:id/dispositions','addDisposition'];(function(_0x10ff20,_0x5598c1){var _0x2e2682=function(_0x5ce6a0){while(--_0x5ce6a0){_0x10ff20['push'](_0x10ff20['shift']());}};_0x2e2682(++_0x5598c1);}(_0x0184,0x14e));var _0x4018=function(_0x4f3e33,_0x5704a8){_0x4f3e33=_0x4f3e33-0x0;var _0x1a070c=_0x0184[_0x4f3e33];return _0x1a070c;};'use strict';var multer=require(_0x4018('0x0'));var util=require(_0x4018('0x1'));var path=require(_0x4018('0x2'));var timeout=require(_0x4018('0x3'));var express=require('express');var router=express[_0x4018('0x4')]();var fs_extra=require(_0x4018('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4018('0x6'));var config=require(_0x4018('0x7'));var controller=require(_0x4018('0x8'));router[_0x4018('0x9')]('/',auth[_0x4018('0xa')](),controller['index']);router['get']('/describe',auth[_0x4018('0xa')](),controller[_0x4018('0xb')]);router['get'](_0x4018('0xc'),auth[_0x4018('0xa')](),controller[_0x4018('0xd')]);router['get'](_0x4018('0xe'),auth[_0x4018('0xa')](),controller[_0x4018('0xf')]);router['get']('/:id/dispositions',auth[_0x4018('0xa')](),controller[_0x4018('0x10')]);router[_0x4018('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x4018('0x11')]);router[_0x4018('0x9')](_0x4018('0x12'),auth[_0x4018('0xa')](),controller[_0x4018('0x13')]);router['get'](_0x4018('0x14'),auth[_0x4018('0xa')](),controller[_0x4018('0x15')]);router[_0x4018('0x9')]('/:id/users',auth[_0x4018('0xa')](),controller['getAgents']);router['post']('/',auth[_0x4018('0xa')](),controller[_0x4018('0x16')]);router[_0x4018('0x17')](_0x4018('0x18'),auth[_0x4018('0xa')](),controller[_0x4018('0x19')]);router[_0x4018('0x17')](_0x4018('0x1a'),auth['isAuthenticated'](),controller[_0x4018('0x1b')]);router[_0x4018('0x17')](_0x4018('0x14'),auth[_0x4018('0xa')](),controller['addCustomField']);router[_0x4018('0x17')](_0x4018('0x1c'),auth[_0x4018('0xa')](),controller[_0x4018('0x1d')]);router[_0x4018('0x1e')](_0x4018('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4018('0xe'),auth['isAuthenticated'](),controller[_0x4018('0x1f')]);router[_0x4018('0x20')](_0x4018('0x18'),auth[_0x4018('0xa')](),controller[_0x4018('0x21')]);router['delete'](_0x4018('0x1c'),auth[_0x4018('0xa')](),controller[_0x4018('0x22')]);module[_0x4018('0x23')]=router; \ No newline at end of file +var _0x0844=['/:id/fields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','./cmList.controller','get','index','isAuthenticated','describe','/global_fields','getGlobalCustomFields','show','getDispositions','/:id/contacts','getContactsCsv'];(function(_0x5a2a75,_0xe3a29e){var _0x4109c3=function(_0x5b77f8){while(--_0x5b77f8){_0x5a2a75['push'](_0x5a2a75['shift']());}};_0x4109c3(++_0xe3a29e);}(_0x0844,0xc1));var _0x4084=function(_0x1fbee9,_0x14387b){_0x1fbee9=_0x1fbee9-0x0;var _0x24b2df=_0x0844[_0x1fbee9];return _0x24b2df;};'use strict';var multer=require(_0x4084('0x0'));var util=require(_0x4084('0x1'));var path=require(_0x4084('0x2'));var timeout=require(_0x4084('0x3'));var express=require(_0x4084('0x4'));var router=express['Router']();var fs_extra=require(_0x4084('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4084('0x6'));router[_0x4084('0x7')]('/',auth['isAuthenticated'](),controller[_0x4084('0x8')]);router[_0x4084('0x7')]('/describe',auth[_0x4084('0x9')](),controller[_0x4084('0xa')]);router[_0x4084('0x7')](_0x4084('0xb'),auth[_0x4084('0x9')](),controller[_0x4084('0xc')]);router[_0x4084('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4084('0xd')]);router['get']('/:id/dispositions',auth[_0x4084('0x9')](),controller[_0x4084('0xe')]);router['get'](_0x4084('0xf'),auth[_0x4084('0x9')](),controller['getContacts']);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x4084('0x10')]);router['get'](_0x4084('0x11'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x4084('0x7')](_0x4084('0x12'),auth[_0x4084('0x9')](),controller[_0x4084('0x13')]);router[_0x4084('0x14')]('/',auth[_0x4084('0x9')](),controller[_0x4084('0x15')]);router[_0x4084('0x14')](_0x4084('0x16'),auth[_0x4084('0x9')](),controller[_0x4084('0x17')]);router['post']('/:id/contacts',auth[_0x4084('0x9')](),controller[_0x4084('0x18')]);router[_0x4084('0x14')](_0x4084('0x11'),auth['isAuthenticated'](),controller[_0x4084('0x19')]);router[_0x4084('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x4084('0x1a')]);router[_0x4084('0x1b')](_0x4084('0x1c'),auth['isAuthenticated'](),controller[_0x4084('0x1d')]);router['delete']('/:id',auth[_0x4084('0x9')](),controller[_0x4084('0x1e')]);router[_0x4084('0x1f')](_0x4084('0x16'),auth[_0x4084('0x9')](),controller[_0x4084('0x20')]);router[_0x4084('0x1f')](_0x4084('0x12'),auth[_0x4084('0x9')](),controller[_0x4084('0x21')]);module[_0x4084('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index cabd7f9..bc80cbf 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 _0x9bae=['STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x2f5b30,_0x1b0a55){var _0x1d756b=function(_0x5afbc4){while(--_0x5afbc4){_0x2f5b30['push'](_0x2f5b30['shift']());}};_0x1d756b(++_0x1b0a55);}(_0x9bae,0x83));var _0xe9ba=function(_0x49bb21,_0x1ee069){_0x49bb21=_0x49bb21-0x0;var _0x140777=_0x9bae[_0x49bb21];return _0x140777;};'use strict';var Sequelize=require(_0xe9ba('0x0'));module[_0xe9ba('0x1')]={'name':{'type':Sequelize[_0xe9ba('0x2')],'get':function(_0x136ec0){return this[_0xe9ba('0x3')]('field');}},'field':{'type':Sequelize[_0xe9ba('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xe9ba('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xe9ba('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xd556=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x1b6c0c,_0x51ef20){var _0x178991=function(_0x3b6f64){while(--_0x3b6f64){_0x1b6c0c['push'](_0x1b6c0c['shift']());}};_0x178991(++_0x51ef20);}(_0xd556,0x104));var _0x6d55=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xd556[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0x6d55('0x0'));module[_0x6d55('0x1')]={'name':{'type':Sequelize[_0x6d55('0x2')],'get':function(_0x145a8b){return this[_0x6d55('0x3')](_0x6d55('0x4'));}},'field':{'type':Sequelize[_0x6d55('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x6d55('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x6d55('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 3116f7d..da7e0b6 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x41197d,_0x3ab512){var _0x525997=function(_0x8bbfec){while(--_0x8bbfec){_0x41197d['push'](_0x41197d['shift']());}};_0x525997(++_0x3ab512);}(_0x7a54,0x106));var _0x47a5=function(_0x163953,_0x573247){_0x163953=_0x163953-0x0;var _0x1ecf0c=_0x7a54[_0x163953];return _0x1ecf0c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x6040ca,_0x451a31){var _0x16c219=function(_0x17761d){while(--_0x17761d){_0x6040ca['push'](_0x6040ca['shift']());}};_0x16c219(++_0x451a31);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 722cc72..b91e6b5 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 _0x5ad0=['./condition.attributes','define','Condition','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1b31d0,_0x5b6aa2){var _0x209c6d=function(_0x45415e){while(--_0x45415e){_0x1b31d0['push'](_0x1b31d0['shift']());}};_0x209c6d(++_0x5b6aa2);}(_0x5ad0,0x1c6));var _0x05ad=function(_0x441964,_0x3070ae){_0x441964=_0x441964-0x0;var _0x4211f0=_0x5ad0[_0x441964];return _0x4211f0;};'use strict';var _=require(_0x05ad('0x0'));var util=require(_0x05ad('0x1'));var logger=require(_0x05ad('0x2'))(_0x05ad('0x3'));var moment=require(_0x05ad('0x4'));var BPromise=require(_0x05ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05ad('0x6'));var rimraf=require(_0x05ad('0x7'));var config=require('../../config/environment');var attributes=require(_0x05ad('0x8'));module['exports']=function(_0x43b3da,_0x35609b){return _0x43b3da[_0x05ad('0x9')](_0x05ad('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e68=['../../config/environment','./condition.attributes','define','Condition','tools_conditions','util','../../config/logger','api','rimraf'];(function(_0x46f551,_0x245e75){var _0x3b0469=function(_0x583a8a){while(--_0x583a8a){_0x46f551['push'](_0x46f551['shift']());}};_0x3b0469(++_0x245e75);}(_0x7e68,0x140));var _0x87e6=function(_0x3867e2,_0xa34a00){_0x3867e2=_0x3867e2-0x0;var _0x5799a4=_0x7e68[_0x3867e2];return _0x5799a4;};'use strict';var _=require('lodash');var util=require(_0x87e6('0x0'));var logger=require(_0x87e6('0x1'))(_0x87e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x87e6('0x3'));var config=require(_0x87e6('0x4'));var attributes=require(_0x87e6('0x5'));module['exports']=function(_0x21fc1a,_0x165623){return _0x21fc1a[_0x87e6('0x6')](_0x87e6('0x7'),attributes,{'tableName':_0x87e6('0x8'),'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 d95d22f..d59c544 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 _0xffd8=['http','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffd8,0x1c2));var _0x8ffd=function(_0x637c21,_0x2101e7){_0x637c21=_0x637c21-0x0;var _0x2c9af4=_0xffd8[_0x637c21];return _0x2c9af4;};'use strict';var _=require(_0x8ffd('0x0'));var util=require(_0x8ffd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ffd('0x2'));var fs=require('fs');var Redis=require(_0x8ffd('0x3'));var db=require(_0x8ffd('0x4'))['db'];var utils=require(_0x8ffd('0x5'));var logger=require(_0x8ffd('0x6'))(_0x8ffd('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ffd('0x8'));var client=jayson[_0x8ffd('0x9')][_0x8ffd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28bb36,_0x3c5280,_0x302ad0){return new BPromise(function(_0x421eb7,_0x1514c0){return client['request'](_0x28bb36,_0x302ad0)['then'](function(_0x373aaa){logger['info'](_0x8ffd('0xb'),_0x3c5280,_0x8ffd('0xc'));logger[_0x8ffd('0xd')](_0x8ffd('0xe'),_0x3c5280,_0x8ffd('0xc'),JSON[_0x8ffd('0xf')](_0x373aaa));if(_0x373aaa[_0x8ffd('0x10')]){if(_0x373aaa[_0x8ffd('0x10')][_0x8ffd('0x11')]===0x1f4){logger[_0x8ffd('0x10')](_0x8ffd('0xb'),_0x3c5280,_0x373aaa[_0x8ffd('0x10')][_0x8ffd('0x12')]);return _0x1514c0(_0x373aaa[_0x8ffd('0x10')]['message']);}logger[_0x8ffd('0x10')](_0x8ffd('0xb'),_0x3c5280,_0x373aaa[_0x8ffd('0x10')]['message']);return _0x421eb7(_0x373aaa[_0x8ffd('0x10')][_0x8ffd('0x12')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x3c5280,'request\x20sent');_0x421eb7(_0x373aaa['result'][_0x8ffd('0x12')]);}})[_0x8ffd('0x13')](function(_0x418ce6){logger[_0x8ffd('0x10')](_0x8ffd('0xb'),_0x3c5280,_0x418ce6);_0x1514c0(_0x418ce6);});});} \ No newline at end of file +var _0x91e9=['stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x91e9,0x137));var _0x991e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x91e9[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x991e('0x0'));var moment=require(_0x991e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x991e('0x2'))['db'];var utils=require(_0x991e('0x3'));var logger=require(_0x991e('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x991e('0x5'));var client=jayson['client'][_0x991e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x348e40,_0x2ca5dc,_0x566c59){return new BPromise(function(_0x4ad6cc,_0x3a6209){return client[_0x991e('0x7')](_0x348e40,_0x566c59)['then'](function(_0x18532e){logger[_0x991e('0x8')](_0x991e('0x9'),_0x2ca5dc,'request\x20sent');logger[_0x991e('0xa')](_0x991e('0xb'),_0x2ca5dc,_0x991e('0xc'),JSON[_0x991e('0xd')](_0x18532e));if(_0x18532e[_0x991e('0xe')]){if(_0x18532e['error']['code']===0x1f4){logger[_0x991e('0xe')](_0x991e('0x9'),_0x2ca5dc,_0x18532e[_0x991e('0xe')][_0x991e('0xf')]);return _0x3a6209(_0x18532e['error'][_0x991e('0xf')]);}logger[_0x991e('0xe')](_0x991e('0x9'),_0x2ca5dc,_0x18532e[_0x991e('0xe')][_0x991e('0xf')]);return _0x4ad6cc(_0x18532e['error']['message']);}else{logger[_0x991e('0x8')](_0x991e('0x9'),_0x2ca5dc,_0x991e('0xc'));_0x4ad6cc(_0x18532e[_0x991e('0x10')][_0x991e('0xf')]);}})[_0x991e('0x11')](function(_0x2b4abd){logger[_0x991e('0xe')](_0x991e('0x9'),_0x2ca5dc,_0x2b4abd);_0x3a6209(_0x2b4abd);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 14f3aa7..0791991 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 _0xb49b=['../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','util','connect-timeout','express','fs-extra'];(function(_0x57ca46,_0x1be44f){var _0x5380c3=function(_0x48e91f){while(--_0x48e91f){_0x57ca46['push'](_0x57ca46['shift']());}};_0x5380c3(++_0x1be44f);}(_0xb49b,0x194));var _0xbb49=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb49b[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xbb49('0x0'));var path=require('path');var timeout=require(_0xbb49('0x1'));var express=require(_0xbb49('0x2'));var router=express['Router']();var fs_extra=require(_0xbb49('0x3'));var auth=require(_0xbb49('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb49('0x5'));var controller=require(_0xbb49('0x6'));router[_0xbb49('0x7')](_0xbb49('0x8'),auth[_0xbb49('0x9')](),controller[_0xbb49('0xa')]);router[_0xbb49('0xb')](_0xbb49('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf677=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra'];(function(_0x484582,_0x12ed25){var _0x170fe5=function(_0x5ac472){while(--_0x5ac472){_0x484582['push'](_0x484582['shift']());}};_0x170fe5(++_0x12ed25);}(_0xf677,0xfb));var _0x7f67=function(_0x2a87ed,_0x748986){_0x2a87ed=_0x2a87ed-0x0;var _0xc951c2=_0xf677[_0x2a87ed];return _0xc951c2;};'use strict';var multer=require('multer');var util=require(_0x7f67('0x0'));var path=require('path');var timeout=require(_0x7f67('0x1'));var express=require('express');var router=express[_0x7f67('0x2')]();var fs_extra=require(_0x7f67('0x3'));var auth=require(_0x7f67('0x4'));var interaction=require(_0x7f67('0x5'));var config=require(_0x7f67('0x6'));var controller=require(_0x7f67('0x7'));router[_0x7f67('0x8')](_0x7f67('0x9'),auth[_0x7f67('0xa')](),controller[_0x7f67('0xb')]);router[_0x7f67('0xc')](_0x7f67('0x9'),auth[_0x7f67('0xa')](),controller[_0x7f67('0xd')]);module[_0x7f67('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 0cff2ed..0095114 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd770=['STRING','name','exports'];(function(_0x2404ac,_0x2c71c6){var _0x3a9cdd=function(_0x22a03b){while(--_0x22a03b){_0x2404ac['push'](_0x2404ac['shift']());}};_0x3a9cdd(++_0x2c71c6);}(_0xd770,0x1e5));var _0x0d77=function(_0x5dabf4,_0x1357e9){_0x5dabf4=_0x5dabf4-0x0;var _0x49535d=_0xd770[_0x5dabf4];return _0x49535d;};'use strict';var Sequelize=require('sequelize');module[_0x0d77('0x0')]={'name':{'type':Sequelize[_0x0d77('0x1')],'allowNull':![],'unique':_0x0d77('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0d77('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x73f1=['sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73f1,0xc4));var _0x173f=function(_0x88970f,_0x38f495){_0x88970f=_0x88970f-0x0;var _0x57d015=_0x73f1[_0x88970f];return _0x57d015;};'use strict';var Sequelize=require(_0x173f('0x0'));module[_0x173f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 1f39995..496324a 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe820=['name','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ContactItemType','includeAll','include','findAll','params','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','CmContactHasItem','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','save','update','then','destroy','get','ContactItemTypes','stack'];(function(_0x12a020,_0x85b476){var _0x63cddd=function(_0x13bff5){while(--_0x13bff5){_0x12a020['push'](_0x12a020['shift']());}};_0x63cddd(++_0x85b476);}(_0xe820,0xd2));var _0x0e82=function(_0x2dc1be,_0x155c69){_0x2dc1be=_0x2dc1be-0x0;var _0x62d6b3=_0xe820[_0x2dc1be];return _0x62d6b3;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];function respondWithStatusCode(_0x21c40b,_0x1da28a){_0x1da28a=_0x1da28a||0xcc;return function(_0x166dc2){if(_0x166dc2){return _0x21c40b[_0x0e82('0x18')](_0x1da28a);}return _0x21c40b['status'](_0x1da28a)[_0x0e82('0x19')]();};}function respondWithResult(_0x5c161c,_0x48d99b){_0x48d99b=_0x48d99b||0xc8;return function(_0x1e4ddb){if(_0x1e4ddb){return _0x5c161c['status'](_0x48d99b)['json'](_0x1e4ddb);}};}function respondWithFilteredResult(_0x5a2d28,_0x3298c7){return function(_0x4d1aa0){if(_0x4d1aa0){var _0x585b9b=typeof _0x3298c7[_0x0e82('0x1a')]==='undefined'&&typeof _0x3298c7[_0x0e82('0x1b')]===_0x0e82('0x1c');var _0x233c6d=_0x4d1aa0[_0x0e82('0x1d')];var _0x53622b=_0x585b9b?0x0:_0x3298c7[_0x0e82('0x1a')];var _0x310aac=_0x585b9b?_0x4d1aa0[_0x0e82('0x1d')]:_0x3298c7[_0x0e82('0x1a')]+_0x3298c7[_0x0e82('0x1b')];var _0x1230e6;if(_0x310aac>=_0x233c6d){_0x310aac=_0x233c6d;_0x1230e6=0xc8;}else{_0x1230e6=0xce;}_0x5a2d28[_0x0e82('0x1e')](_0x1230e6);return _0x5a2d28[_0x0e82('0x1f')](_0x0e82('0x20'),_0x53622b+'-'+_0x310aac+'/'+_0x233c6d)[_0x0e82('0x21')](_0x4d1aa0);}return null;};}function patchUpdates(_0x5903c){return function(_0x493280){try{jsonpatch['apply'](_0x493280,_0x5903c,!![]);}catch(_0x294696){return BPromise[_0x0e82('0x22')](_0x294696);}return _0x493280[_0x0e82('0x23')]();};}function saveUpdates(_0xb0a31,_0xd48046){return function(_0x1bdad4){if(_0x1bdad4){return _0x1bdad4[_0x0e82('0x24')](_0xb0a31)[_0x0e82('0x25')](function(_0x56b3ad){return _0x56b3ad;});}return null;};}function removeEntity(_0x1b71b4,_0x13f023){return function(_0x3d6c28){if(_0x3d6c28){return _0x3d6c28[_0x0e82('0x26')]()['then'](function(){var _0xee85dd=_0x3d6c28[_0x0e82('0x27')]({'plain':!![]});var _0x7a9399=_0x0e82('0x28');return db['UserProfileResource'][_0x0e82('0x26')]({'where':{'type':_0x7a9399,'resourceId':_0xee85dd['id']}})['then'](function(){return _0x3d6c28;});})['then'](function(){_0x1b71b4[_0x0e82('0x1e')](0xcc)[_0x0e82('0x19')]();});}};}function handleEntityNotFound(_0x4c5fc1,_0x19b96d){return function(_0xe3c530){if(!_0xe3c530){_0x4c5fc1[_0x0e82('0x18')](0x194);}return _0xe3c530;};}function handleError(_0x5ca9e3,_0x93d2f1){_0x93d2f1=_0x93d2f1||0x1f4;return function(_0x25fa4e){logger['error'](_0x25fa4e[_0x0e82('0x29')]);if(_0x25fa4e['name']){delete _0x25fa4e[_0x0e82('0x2a')];}_0x5ca9e3[_0x0e82('0x1e')](_0x93d2f1)['send'](_0x25fa4e);};}exports[_0x0e82('0x2b')]=function(_0x268af5,_0x661718){var _0x4d74d0={},_0x50adb7={},_0x2dc021={'count':0x0,'rows':[]};var _0x4a8c43=_[_0x0e82('0x2c')](db['ContactItemType'][_0x0e82('0x2d')],function(_0x264022){return{'name':_0x264022[_0x0e82('0x2e')],'type':_0x264022['type'][_0x0e82('0x2f')]};});_0x50adb7['model']=_[_0x0e82('0x2c')](_0x4a8c43,_0x0e82('0x2a'));_0x50adb7[_0x0e82('0x30')]=_[_0x0e82('0x31')](_0x268af5[_0x0e82('0x30')]);_0x50adb7[_0x0e82('0x32')]=_['intersection'](_0x50adb7[_0x0e82('0x33')],_0x50adb7[_0x0e82('0x30')]);_0x4d74d0[_0x0e82('0x34')]=_[_0x0e82('0x35')](_0x50adb7[_0x0e82('0x33')],qs[_0x0e82('0x36')](_0x268af5[_0x0e82('0x30')][_0x0e82('0x36')]));_0x4d74d0[_0x0e82('0x34')]=_0x4d74d0[_0x0e82('0x34')][_0x0e82('0x37')]?_0x4d74d0[_0x0e82('0x34')]:_0x50adb7[_0x0e82('0x33')];if(!_0x268af5[_0x0e82('0x30')][_0x0e82('0x38')]('nolimit')){_0x4d74d0[_0x0e82('0x1b')]=qs[_0x0e82('0x1b')](_0x268af5[_0x0e82('0x30')][_0x0e82('0x1b')]);_0x4d74d0['offset']=qs[_0x0e82('0x1a')](_0x268af5[_0x0e82('0x30')]['offset']);}_0x4d74d0[_0x0e82('0x39')]=qs['sort'](_0x268af5['query'][_0x0e82('0x3a')]);_0x4d74d0[_0x0e82('0x3b')]=qs[_0x0e82('0x32')](_[_0x0e82('0x3c')](_0x268af5[_0x0e82('0x30')],_0x50adb7[_0x0e82('0x32')]),_0x4a8c43);if(_0x268af5[_0x0e82('0x30')]['filter']){_0x4d74d0['where']=_[_0x0e82('0x3d')](_0x4d74d0[_0x0e82('0x3b')],{'$or':_[_0x0e82('0x2c')](_0x4a8c43,function(_0x135c1b){if(_0x135c1b[_0x0e82('0x3e')]!==_0x0e82('0x3f')){var _0x2abed6={};_0x2abed6[_0x135c1b[_0x0e82('0x2a')]]={'$like':'%'+_0x268af5['query'][_0x0e82('0x40')]+'%'};return _0x2abed6;}})});}_0x4d74d0=_[_0x0e82('0x3d')]({},_0x4d74d0,_0x268af5[_0x0e82('0x41')]);var _0x417389={'where':_0x4d74d0[_0x0e82('0x3b')]};return db[_0x0e82('0x42')][_0x0e82('0x1d')](_0x417389)['then'](function(_0x311cb8){_0x2dc021[_0x0e82('0x1d')]=_0x311cb8;if(_0x268af5[_0x0e82('0x30')][_0x0e82('0x43')]){_0x4d74d0[_0x0e82('0x44')]=[{'all':!![]}];}return db[_0x0e82('0x42')][_0x0e82('0x45')](_0x4d74d0);})['then'](function(_0x581764){_0x2dc021['rows']=_0x581764;return _0x2dc021;})['then'](respondWithFilteredResult(_0x661718,_0x4d74d0))['catch'](handleError(_0x661718,null));};exports['show']=function(_0x651c76,_0x182333){var _0x3d37e8={'raw':!![],'where':{'id':_0x651c76[_0x0e82('0x46')]['id']}},_0x199495={};_0x199495[_0x0e82('0x33')]=_[_0x0e82('0x31')](db[_0x0e82('0x42')]['rawAttributes']);_0x199495['query']=_[_0x0e82('0x31')](_0x651c76[_0x0e82('0x30')]);_0x199495[_0x0e82('0x32')]=_[_0x0e82('0x35')](_0x199495[_0x0e82('0x33')],_0x199495[_0x0e82('0x30')]);_0x3d37e8[_0x0e82('0x34')]=_[_0x0e82('0x35')](_0x199495['model'],qs[_0x0e82('0x36')](_0x651c76['query'][_0x0e82('0x36')]));_0x3d37e8['attributes']=_0x3d37e8[_0x0e82('0x34')]['length']?_0x3d37e8[_0x0e82('0x34')]:_0x199495[_0x0e82('0x33')];if(_0x651c76[_0x0e82('0x30')]['includeAll']){_0x3d37e8['include']=[{'all':!![]}];}_0x3d37e8=_[_0x0e82('0x3d')]({},_0x3d37e8,_0x651c76[_0x0e82('0x41')]);return db[_0x0e82('0x42')]['find'](_0x3d37e8)[_0x0e82('0x25')](handleEntityNotFound(_0x182333,null))['then'](respondWithResult(_0x182333,null))[_0x0e82('0x47')](handleError(_0x182333,null));};exports[_0x0e82('0x48')]=function(_0x162890,_0x64406e){return db[_0x0e82('0x42')][_0x0e82('0x48')](_0x162890[_0x0e82('0x49')],{})[_0x0e82('0x25')](function(_0x1bd904){var _0x287abc=_0x162890[_0x0e82('0x4a')][_0x0e82('0x27')]({'plain':!![]});if(!_0x287abc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x287abc[_0x0e82('0x4b')]===_0x0e82('0x4a')){var _0x576726=_0x1bd904[_0x0e82('0x27')]({'plain':!![]});var _0x5f4fbc='ContactItemTypes';return db[_0x0e82('0x4c')]['find']({'where':{'name':_0x5f4fbc,'userProfileId':_0x287abc[_0x0e82('0x4d')]},'raw':!![]})[_0x0e82('0x25')](function(_0x1ed324){if(_0x1ed324&&_0x1ed324[_0x0e82('0x4e')]===0x0){return db[_0x0e82('0x4f')]['create']({'name':_0x576726[_0x0e82('0x2a')],'resourceId':_0x576726['id'],'type':_0x1ed324['name'],'sectionId':_0x1ed324['id']},{})[_0x0e82('0x25')](function(){return _0x1bd904;});}else{return _0x1bd904;}})[_0x0e82('0x47')](function(_0x42c4a7){logger[_0x0e82('0x50')](_0x0e82('0x51'),_0x42c4a7);throw _0x42c4a7;});}return _0x1bd904;})['then'](respondWithResult(_0x64406e,0xc9))[_0x0e82('0x47')](handleError(_0x64406e,null));};exports[_0x0e82('0x24')]=function(_0x183808,_0x4546bd){if(_0x183808[_0x0e82('0x49')]['id']){delete _0x183808['body']['id'];}return db[_0x0e82('0x42')][_0x0e82('0x52')]({'where':{'id':_0x183808[_0x0e82('0x46')]['id']}})[_0x0e82('0x25')](handleEntityNotFound(_0x4546bd,null))[_0x0e82('0x25')](saveUpdates(_0x183808[_0x0e82('0x49')],null))[_0x0e82('0x25')](respondWithResult(_0x4546bd,null))[_0x0e82('0x47')](handleError(_0x4546bd,null));};exports[_0x0e82('0x26')]=function(_0x2852d4,_0x4cc3fd){return db['ContactItemType']['find']({'where':{'id':_0x2852d4[_0x0e82('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cc3fd,null))[_0x0e82('0x25')](db[_0x0e82('0x53')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2852d4['params']['id']}}))[_0x0e82('0x25')](removeEntity(_0x4cc3fd,null))[_0x0e82('0x47')](handleError(_0x4cc3fd,null));}; \ No newline at end of file +var _0xd943=['nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','stack','index','ContactItemType','rawAttributes','fieldName','key','map','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0xd943,0x15d));var _0x3d94=function(_0xf002c2,_0x1bea5b){_0xf002c2=_0xf002c2-0x0;var _0x2c5a00=_0xd943[_0xf002c2];return _0x2c5a00;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){var _0x18f58c=_0x295493[_0x3d94('0x24')]({'plain':!![]});var _0x192839=_0x3d94('0x25');return db[_0x3d94('0x26')][_0x3d94('0x23')]({'where':{'type':_0x192839,'resourceId':_0x18f58c['id']}})['then'](function(){return _0x295493;});})[_0x3d94('0x22')](function(){_0x395133['status'](0xcc)[_0x3d94('0x27')]();});}};}function handleEntityNotFound(_0x1d0a7a,_0xc2885){return function(_0x439173){if(!_0x439173){_0x1d0a7a[_0x3d94('0x16')](0x194);}return _0x439173;};}function handleError(_0x82b568,_0x401857){_0x401857=_0x401857||0x1f4;return function(_0x47d6ab){logger['error'](_0x47d6ab[_0x3d94('0x28')]);if(_0x47d6ab['name']){delete _0x47d6ab['name'];}_0x82b568[_0x3d94('0x17')](_0x401857)['send'](_0x47d6ab);};}exports[_0x3d94('0x29')]=function(_0xef9644,_0x32403a){var _0x4cef9c={},_0x2a07b4={},_0x4c1237={'count':0x0,'rows':[]};var _0x3d4994=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x29b1ff){return{'name':_0x29b1ff[_0x3d94('0x2c')],'type':_0x29b1ff['type'][_0x3d94('0x2d')]};});_0x2a07b4['model']=_[_0x3d94('0x2e')](_0x3d4994,_0x3d94('0x2f'));_0x2a07b4['query']=_['keys'](_0xef9644[_0x3d94('0x30')]);_0x2a07b4[_0x3d94('0x31')]=_[_0x3d94('0x32')](_0x2a07b4['model'],_0x2a07b4[_0x3d94('0x30')]);_0x4cef9c[_0x3d94('0x33')]=_['intersection'](_0x2a07b4[_0x3d94('0x34')],qs[_0x3d94('0x35')](_0xef9644[_0x3d94('0x30')][_0x3d94('0x35')]));_0x4cef9c[_0x3d94('0x33')]=_0x4cef9c['attributes'][_0x3d94('0x36')]?_0x4cef9c[_0x3d94('0x33')]:_0x2a07b4[_0x3d94('0x34')];if(!_0xef9644[_0x3d94('0x30')][_0x3d94('0x37')](_0x3d94('0x38'))){_0x4cef9c['limit']=qs['limit'](_0xef9644[_0x3d94('0x30')][_0x3d94('0x1b')]);_0x4cef9c[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0xef9644[_0x3d94('0x30')][_0x3d94('0x19')]);}_0x4cef9c[_0x3d94('0x39')]=qs[_0x3d94('0x3a')](_0xef9644[_0x3d94('0x30')][_0x3d94('0x3a')]);_0x4cef9c['where']=qs[_0x3d94('0x31')](_[_0x3d94('0x3b')](_0xef9644[_0x3d94('0x30')],_0x2a07b4[_0x3d94('0x31')]),_0x3d4994);if(_0xef9644['query'][_0x3d94('0x3c')]){_0x4cef9c[_0x3d94('0x3d')]=_[_0x3d94('0x3e')](_0x4cef9c[_0x3d94('0x3d')],{'$or':_[_0x3d94('0x2e')](_0x3d4994,function(_0x4b5a1a){if(_0x4b5a1a[_0x3d94('0x3f')]!==_0x3d94('0x40')){var _0x1d3d41={};_0x1d3d41[_0x4b5a1a['name']]={'$like':'%'+_0xef9644['query']['filter']+'%'};return _0x1d3d41;}})});}_0x4cef9c=_['merge']({},_0x4cef9c,_0xef9644[_0x3d94('0x41')]);var _0x22f52c={'where':_0x4cef9c[_0x3d94('0x3d')]};return db[_0x3d94('0x2a')][_0x3d94('0x1c')](_0x22f52c)[_0x3d94('0x22')](function(_0x3a3898){_0x4c1237['count']=_0x3a3898;if(_0xef9644['query'][_0x3d94('0x42')]){_0x4cef9c[_0x3d94('0x43')]=[{'all':!![]}];}return db['ContactItemType'][_0x3d94('0x44')](_0x4cef9c);})['then'](function(_0x1361fb){_0x4c1237[_0x3d94('0x45')]=_0x1361fb;return _0x4c1237;})[_0x3d94('0x22')](respondWithFilteredResult(_0x32403a,_0x4cef9c))[_0x3d94('0x46')](handleError(_0x32403a,null));};exports[_0x3d94('0x47')]=function(_0x5a9263,_0x3e0da8){var _0x168771={'raw':!![],'where':{'id':_0x5a9263['params']['id']}},_0x18a70c={};_0x18a70c[_0x3d94('0x34')]=_['keys'](db['ContactItemType'][_0x3d94('0x2b')]);_0x18a70c[_0x3d94('0x30')]=_[_0x3d94('0x48')](_0x5a9263[_0x3d94('0x30')]);_0x18a70c['filters']=_[_0x3d94('0x32')](_0x18a70c['model'],_0x18a70c[_0x3d94('0x30')]);_0x168771[_0x3d94('0x33')]=_[_0x3d94('0x32')](_0x18a70c[_0x3d94('0x34')],qs[_0x3d94('0x35')](_0x5a9263[_0x3d94('0x30')][_0x3d94('0x35')]));_0x168771['attributes']=_0x168771[_0x3d94('0x33')][_0x3d94('0x36')]?_0x168771['attributes']:_0x18a70c['model'];if(_0x5a9263[_0x3d94('0x30')][_0x3d94('0x42')]){_0x168771['include']=[{'all':!![]}];}_0x168771=_[_0x3d94('0x3e')]({},_0x168771,_0x5a9263[_0x3d94('0x41')]);return db[_0x3d94('0x2a')][_0x3d94('0x49')](_0x168771)[_0x3d94('0x22')](handleEntityNotFound(_0x3e0da8,null))[_0x3d94('0x22')](respondWithResult(_0x3e0da8,null))[_0x3d94('0x46')](handleError(_0x3e0da8,null));};exports[_0x3d94('0x4a')]=function(_0x60279f,_0x2429bc){return db[_0x3d94('0x2a')][_0x3d94('0x4a')](_0x60279f[_0x3d94('0x4b')],{})[_0x3d94('0x22')](function(_0xbe50d0){var _0x49209b=_0x60279f[_0x3d94('0x4c')][_0x3d94('0x24')]({'plain':!![]});if(!_0x49209b)throw new Error(_0x3d94('0x4d'));if(_0x49209b[_0x3d94('0x4e')]===_0x3d94('0x4c')){var _0x3ce0be=_0xbe50d0[_0x3d94('0x24')]({'plain':!![]});var _0x33db0a=_0x3d94('0x25');return db['UserProfileSection'][_0x3d94('0x49')]({'where':{'name':_0x33db0a,'userProfileId':_0x49209b['userProfileId']},'raw':!![]})[_0x3d94('0x22')](function(_0x3a7eb0){if(_0x3a7eb0&&_0x3a7eb0['autoAssociation']===0x0){return db[_0x3d94('0x26')]['create']({'name':_0x3ce0be['name'],'resourceId':_0x3ce0be['id'],'type':_0x3a7eb0[_0x3d94('0x2f')],'sectionId':_0x3a7eb0['id']},{})['then'](function(){return _0xbe50d0;});}else{return _0xbe50d0;}})[_0x3d94('0x46')](function(_0x132e0b){logger['error'](_0x3d94('0x4f'),_0x132e0b);throw _0x132e0b;});}return _0xbe50d0;})['then'](respondWithResult(_0x2429bc,0xc9))['catch'](handleError(_0x2429bc,null));};exports[_0x3d94('0x21')]=function(_0x1fb53e,_0xa9f159){if(_0x1fb53e[_0x3d94('0x4b')]['id']){delete _0x1fb53e[_0x3d94('0x4b')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x49')]({'where':{'id':_0x1fb53e[_0x3d94('0x50')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0xa9f159,null))['then'](saveUpdates(_0x1fb53e[_0x3d94('0x4b')],null))[_0x3d94('0x22')](respondWithResult(_0xa9f159,null))[_0x3d94('0x46')](handleError(_0xa9f159,null));};exports[_0x3d94('0x23')]=function(_0xe7d1dc,_0x3e1992){return db[_0x3d94('0x2a')][_0x3d94('0x49')]({'where':{'id':_0xe7d1dc[_0x3d94('0x50')]['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x3e1992,null))[_0x3d94('0x22')](db['CmContactHasItem'][_0x3d94('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0xe7d1dc['params']['id']}}))[_0x3d94('0x22')](removeEntity(_0x3e1992,null))[_0x3d94('0x46')](handleError(_0x3e1992,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index fbc327b..592dc02 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7967=['../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1e2f72,_0x4ecd3d){var _0x2f00a8=function(_0xf1ee63){while(--_0xf1ee63){_0x1e2f72['push'](_0x1e2f72['shift']());}};_0x2f00a8(++_0x4ecd3d);}(_0x7967,0x12c));var _0x7796=function(_0x46deaa,_0x4fb640){_0x46deaa=_0x46deaa-0x0;var _0x22fa12=_0x7967[_0x46deaa];return _0x22fa12;};'use strict';var _=require(_0x7796('0x0'));var util=require(_0x7796('0x1'));var logger=require(_0x7796('0x2'))(_0x7796('0x3'));var moment=require(_0x7796('0x4'));var BPromise=require(_0x7796('0x5'));var rp=require(_0x7796('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7796('0x7'));var config=require(_0x7796('0x8'));var attributes=require(_0x7796('0x9'));module[_0x7796('0xa')]=function(_0x30f9ae,_0xcebb41){return _0x30f9ae[_0x7796('0xb')](_0x7796('0xc'),attributes,{'tableName':_0x7796('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce05=['api','moment','bluebird','request-promise','path','rimraf','./contactItemType.attributes','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger'];(function(_0x2d9b17,_0x18086d){var _0x2ce63b=function(_0x4ea69e){while(--_0x4ea69e){_0x2d9b17['push'](_0x2d9b17['shift']());}};_0x2ce63b(++_0x18086d);}(_0xce05,0x8c));var _0x5ce0=function(_0x55603d,_0x508036){_0x55603d=_0x55603d-0x0;var _0x2da470=_0xce05[_0x55603d];return _0x2da470;};'use strict';var _=require(_0x5ce0('0x0'));var util=require(_0x5ce0('0x1'));var logger=require(_0x5ce0('0x2'))(_0x5ce0('0x3'));var moment=require(_0x5ce0('0x4'));var BPromise=require(_0x5ce0('0x5'));var rp=require(_0x5ce0('0x6'));var fs=require('fs');var path=require(_0x5ce0('0x7'));var rimraf=require(_0x5ce0('0x8'));var config=require('../../config/environment');var attributes=require(_0x5ce0('0x9'));module['exports']=function(_0x1ff44c,_0x3fb322){return _0x1ff44c[_0x5ce0('0xa')](_0x5ce0('0xb'),attributes,{'tableName':_0x5ce0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 9c459fe..c2d7563 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf410=['../../config/environment','jayson/promise','client','request','info','debug','request\x20sent','stringify','error','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xf410,0x14d));var _0x0f41=function(_0x295bf2,_0x1f4dce){_0x295bf2=_0x295bf2-0x0;var _0x3e78ca=_0xf410[_0x295bf2];return _0x3e78ca;};'use strict';var _=require(_0x0f41('0x0'));var util=require(_0x0f41('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f41('0x2'));var fs=require('fs');var Redis=require(_0x0f41('0x3'));var db=require(_0x0f41('0x4'))['db'];var utils=require(_0x0f41('0x5'));var logger=require('../../config/logger')(_0x0f41('0x6'));var config=require(_0x0f41('0x7'));var jayson=require(_0x0f41('0x8'));var client=jayson[_0x0f41('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d2e6,_0x2a72f4,_0x100f49){return new BPromise(function(_0x2b06b0,_0x437d47){return client[_0x0f41('0xa')](_0x53d2e6,_0x100f49)['then'](function(_0x57f6ec){logger[_0x0f41('0xb')]('ContactItemType,\x20%s,\x20%s',_0x2a72f4,'request\x20sent');logger[_0x0f41('0xc')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x2a72f4,_0x0f41('0xd'),JSON[_0x0f41('0xe')](_0x57f6ec));if(_0x57f6ec['error']){if(_0x57f6ec[_0x0f41('0xf')]['code']===0x1f4){logger[_0x0f41('0xf')](_0x0f41('0x10'),_0x2a72f4,_0x57f6ec['error'][_0x0f41('0x11')]);return _0x437d47(_0x57f6ec['error'][_0x0f41('0x11')]);}logger['error'](_0x0f41('0x10'),_0x2a72f4,_0x57f6ec[_0x0f41('0xf')][_0x0f41('0x11')]);return _0x2b06b0(_0x57f6ec[_0x0f41('0xf')][_0x0f41('0x11')]);}else{logger['info'](_0x0f41('0x10'),_0x2a72f4,_0x0f41('0xd'));_0x2b06b0(_0x57f6ec[_0x0f41('0x12')][_0x0f41('0x11')]);}})[_0x0f41('0x13')](function(_0x5c3ec8){logger[_0x0f41('0xf')]('ContactItemType,\x20%s,\x20%s',_0x2a72f4,_0x5c3ec8);_0x437d47(_0x5c3ec8);});});} \ No newline at end of file +var _0xb13f=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','ContactItemType,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x49d9ea,_0x37196c){var _0x2d7960=function(_0x3c242e){while(--_0x3c242e){_0x49d9ea['push'](_0x49d9ea['shift']());}};_0x2d7960(++_0x37196c);}(_0xb13f,0x1de));var _0xfb13=function(_0x4da6de,_0x912bf4){_0x4da6de=_0x4da6de-0x0;var _0x4d5e76=_0xb13f[_0x4da6de];return _0x4d5e76;};'use strict';var _=require(_0xfb13('0x0'));var util=require(_0xfb13('0x1'));var moment=require('moment');var BPromise=require(_0xfb13('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb13('0x3'));var db=require(_0xfb13('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb13('0x5'))('rpc');var config=require(_0xfb13('0x6'));var jayson=require(_0xfb13('0x7'));var client=jayson[_0xfb13('0x8')][_0xfb13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x227dc0,_0xbad653,_0x2d3890){return new BPromise(function(_0x3472ed,_0x79e42){return client[_0xfb13('0xa')](_0x227dc0,_0x2d3890)[_0xfb13('0xb')](function(_0x4e4877){logger[_0xfb13('0xc')]('ContactItemType,\x20%s,\x20%s',_0xbad653,_0xfb13('0xd'));logger['debug'](_0xfb13('0xe'),_0xbad653,_0xfb13('0xd'),JSON['stringify'](_0x4e4877));if(_0x4e4877[_0xfb13('0xf')]){if(_0x4e4877['error'][_0xfb13('0x10')]===0x1f4){logger['error'](_0xfb13('0x11'),_0xbad653,_0x4e4877['error'][_0xfb13('0x12')]);return _0x79e42(_0x4e4877[_0xfb13('0xf')][_0xfb13('0x12')]);}logger['error'](_0xfb13('0x11'),_0xbad653,_0x4e4877[_0xfb13('0xf')]['message']);return _0x3472ed(_0x4e4877[_0xfb13('0xf')][_0xfb13('0x12')]);}else{logger[_0xfb13('0xc')]('ContactItemType,\x20%s,\x20%s',_0xbad653,_0xfb13('0xd'));_0x3472ed(_0x4e4877['result'][_0xfb13('0x12')]);}})[_0xfb13('0x13')](function(_0x97d5c0){logger[_0xfb13('0xf')](_0xfb13('0x11'),_0xbad653,_0x97d5c0);_0x79e42(_0x97d5c0);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index f17ff88..e308470 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2caa=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x25f356,_0x1589b2){var _0x377bd9=function(_0x3303e0){while(--_0x3303e0){_0x25f356['push'](_0x25f356['shift']());}};_0x377bd9(++_0x1589b2);}(_0x2caa,0x1da));var _0xa2ca=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x2caa[_0x2f71f6];return _0x2b23ea;};'use strict';var multer=require(_0xa2ca('0x0'));var util=require(_0xa2ca('0x1'));var path=require(_0xa2ca('0x2'));var timeout=require(_0xa2ca('0x3'));var express=require(_0xa2ca('0x4'));var router=express[_0xa2ca('0x5')]();var fs_extra=require(_0xa2ca('0x6'));var auth=require(_0xa2ca('0x7'));var interaction=require(_0xa2ca('0x8'));var config=require(_0xa2ca('0x9'));var controller=require(_0xa2ca('0xa'));router[_0xa2ca('0xb')]('/',auth[_0xa2ca('0xc')](),controller[_0xa2ca('0xd')]);router[_0xa2ca('0xb')]('/:id',auth[_0xa2ca('0xc')](),controller['show']);router[_0xa2ca('0xe')]('/',auth[_0xa2ca('0xc')](),controller['create']);router[_0xa2ca('0xf')](_0xa2ca('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xa2ca('0x11')](_0xa2ca('0x10'),auth[_0xa2ca('0xc')](),controller[_0xa2ca('0x12')]);module[_0xa2ca('0x13')]=router; \ No newline at end of file +var _0x2ef1=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x231a42,_0x39f4db){var _0x3c2a56=function(_0x58002f){while(--_0x58002f){_0x231a42['push'](_0x231a42['shift']());}};_0x3c2a56(++_0x39f4db);}(_0x2ef1,0x7c));var _0x12ef=function(_0x12d1b9,_0x3aaf9c){_0x12d1b9=_0x12d1b9-0x0;var _0x9e3d84=_0x2ef1[_0x12d1b9];return _0x9e3d84;};'use strict';var multer=require(_0x12ef('0x0'));var util=require(_0x12ef('0x1'));var path=require(_0x12ef('0x2'));var timeout=require(_0x12ef('0x3'));var express=require(_0x12ef('0x4'));var router=express['Router']();var fs_extra=require(_0x12ef('0x5'));var auth=require(_0x12ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12ef('0x7'));var controller=require(_0x12ef('0x8'));router['get']('/',auth[_0x12ef('0x9')](),controller[_0x12ef('0xa')]);router[_0x12ef('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x12ef('0xc')]);router[_0x12ef('0xd')]('/',auth['isAuthenticated'](),controller[_0x12ef('0xe')]);router[_0x12ef('0xf')](_0x12ef('0x10'),auth[_0x12ef('0x9')](),controller[_0x12ef('0x11')]);router[_0x12ef('0x12')](_0x12ef('0x10'),auth['isAuthenticated'](),controller[_0x12ef('0x13')]);module[_0x12ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 76e85b8..8be209f 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 _0xb7e7=['STRING','sequelize'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb7e7[_0x34843e];return _0x598f7f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index f9de55a..f3fb672 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 _0x89e1=['catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','role','UserProfileResource','iframe','attrUrl','attrs','custom','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','voice','attrOpenchannelAccounts','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','localhost','./dashboard.socket','register','sendStatus','end','json','offset','undefined','limit','status','Content-Range','apply','reject','save','then','CustomDashboards','destroy','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x89e1,0xa8));var _0x189e=function(_0x4f5500,_0x35f20e){_0x4f5500=_0x4f5500-0x0;var _0x58f354=_0x89e1[_0x4f5500];return _0x58f354;};'use strict';var emlformat=require(_0x189e('0x0'));var rimraf=require(_0x189e('0x1'));var zipdir=require(_0x189e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x189e('0x3'));var moment=require('moment');var BPromise=require(_0x189e('0x4'));var Mustache=require(_0x189e('0x5'));var util=require('util');var path=require(_0x189e('0x6'));var sox=require(_0x189e('0x7'));var csv=require(_0x189e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x189e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x189e('0xa'));var deskjs=require(_0x189e('0xb'));var toCsv=require(_0x189e('0x8'));var querystring=require(_0x189e('0xc'));var Papa=require(_0x189e('0xd'));var Redis=require(_0x189e('0xe'));var authService=require(_0x189e('0xf'));var qs=require(_0x189e('0x10'));var as=require(_0x189e('0x11'));var hardwareService=require(_0x189e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x189e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x189e('0x14'))['db'];config[_0x189e('0x15')]=_['defaults'](config[_0x189e('0x15')],{'host':_0x189e('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x189e('0x17'))[_0x189e('0x18')](socket);function respondWithStatusCode(_0x5f4ebb,_0x53b6c5){_0x53b6c5=_0x53b6c5||0xcc;return function(_0x39c966){if(_0x39c966){return _0x5f4ebb[_0x189e('0x19')](_0x53b6c5);}return _0x5f4ebb['status'](_0x53b6c5)[_0x189e('0x1a')]();};}function respondWithResult(_0x106127,_0xb482ac){_0xb482ac=_0xb482ac||0xc8;return function(_0x1dc250){if(_0x1dc250){return _0x106127['status'](_0xb482ac)[_0x189e('0x1b')](_0x1dc250);}};}function respondWithFilteredResult(_0x1a508e,_0xaaf27d){return function(_0x59ce35){if(_0x59ce35){var _0x3c2786=typeof _0xaaf27d[_0x189e('0x1c')]===_0x189e('0x1d')&&typeof _0xaaf27d[_0x189e('0x1e')]==='undefined';var _0x43e895=_0x59ce35['count'];var _0x5ebc39=_0x3c2786?0x0:_0xaaf27d[_0x189e('0x1c')];var _0x301f31=_0x3c2786?_0x59ce35['count']:_0xaaf27d[_0x189e('0x1c')]+_0xaaf27d[_0x189e('0x1e')];var _0x589114;if(_0x301f31>=_0x43e895){_0x301f31=_0x43e895;_0x589114=0xc8;}else{_0x589114=0xce;}_0x1a508e[_0x189e('0x1f')](_0x589114);return _0x1a508e['set'](_0x189e('0x20'),_0x5ebc39+'-'+_0x301f31+'/'+_0x43e895)[_0x189e('0x1b')](_0x59ce35);}return null;};}function patchUpdates(_0x23e605){return function(_0x4f3ac7){try{jsonpatch[_0x189e('0x21')](_0x4f3ac7,_0x23e605,!![]);}catch(_0x1435ec){return BPromise[_0x189e('0x22')](_0x1435ec);}return _0x4f3ac7[_0x189e('0x23')]();};}function saveUpdates(_0x284965,_0x27c51f){return function(_0x578214){if(_0x578214){return _0x578214['update'](_0x284965)[_0x189e('0x24')](function(_0x2b0981){return _0x2b0981;});}return null;};}function removeEntity(_0x3ee0bc,_0x29c4bb){return function(_0xa8fd2d){if(_0xa8fd2d){return _0xa8fd2d['destroy']()[_0x189e('0x24')](function(){var _0x7e6c8e=_0xa8fd2d['get']({'plain':!![]});var _0xfb206b=_0x189e('0x25');return db['UserProfileResource'][_0x189e('0x26')]({'where':{'type':_0xfb206b,'resourceId':_0x7e6c8e['id']}})[_0x189e('0x24')](function(){return _0xa8fd2d;});})[_0x189e('0x24')](function(){_0x3ee0bc[_0x189e('0x1f')](0xcc)[_0x189e('0x1a')]();});}};}function handleEntityNotFound(_0x4c256a,_0x46df46){return function(_0x2230fe){if(!_0x2230fe){_0x4c256a[_0x189e('0x19')](0x194);}return _0x2230fe;};}function handleError(_0xef4937,_0x3a5432){_0x3a5432=_0x3a5432||0x1f4;return function(_0x56d9c8){logger['error'](_0x56d9c8[_0x189e('0x27')]);if(_0x56d9c8[_0x189e('0x28')]){delete _0x56d9c8[_0x189e('0x28')];}_0xef4937['status'](_0x3a5432)[_0x189e('0x29')](_0x56d9c8);};}exports[_0x189e('0x2a')]=function(_0x433fde,_0x328ec3){var _0x1f7f08={},_0x4fa4c5={},_0x46380f={'count':0x0,'rows':[]};var _0x41af68=_[_0x189e('0x2b')](db[_0x189e('0x2c')][_0x189e('0x2d')],function(_0x5b8bff){return{'name':_0x5b8bff[_0x189e('0x2e')],'type':_0x5b8bff[_0x189e('0x2f')][_0x189e('0x30')]};});_0x4fa4c5[_0x189e('0x31')]=_[_0x189e('0x2b')](_0x41af68,'name');_0x4fa4c5[_0x189e('0x32')]=_[_0x189e('0x33')](_0x433fde[_0x189e('0x32')]);_0x4fa4c5[_0x189e('0x34')]=_['intersection'](_0x4fa4c5[_0x189e('0x31')],_0x4fa4c5['query']);_0x1f7f08[_0x189e('0x35')]=_[_0x189e('0x36')](_0x4fa4c5[_0x189e('0x31')],qs[_0x189e('0x37')](_0x433fde['query'][_0x189e('0x37')]));_0x1f7f08[_0x189e('0x35')]=_0x1f7f08[_0x189e('0x35')][_0x189e('0x38')]?_0x1f7f08[_0x189e('0x35')]:_0x4fa4c5['model'];if(!_0x433fde['query'][_0x189e('0x39')](_0x189e('0x3a'))){_0x1f7f08[_0x189e('0x1e')]=qs['limit'](_0x433fde[_0x189e('0x32')][_0x189e('0x1e')]);_0x1f7f08['offset']=qs[_0x189e('0x1c')](_0x433fde['query'][_0x189e('0x1c')]);}_0x1f7f08[_0x189e('0x3b')]=qs[_0x189e('0x3c')](_0x433fde[_0x189e('0x32')][_0x189e('0x3c')]);_0x1f7f08[_0x189e('0x3d')]=qs[_0x189e('0x34')](_[_0x189e('0x3e')](_0x433fde[_0x189e('0x32')],_0x4fa4c5[_0x189e('0x34')]),_0x41af68);if(_0x433fde[_0x189e('0x32')][_0x189e('0x3f')]){_0x1f7f08[_0x189e('0x3d')]=_[_0x189e('0x40')](_0x1f7f08['where'],{'$or':_['map'](_0x41af68,function(_0x30b713){if(_0x30b713[_0x189e('0x2f')]!==_0x189e('0x41')){var _0x39d929={};_0x39d929[_0x30b713[_0x189e('0x28')]]={'$like':'%'+_0x433fde[_0x189e('0x32')]['filter']+'%'};return _0x39d929;}})});}_0x1f7f08=_[_0x189e('0x40')]({},_0x1f7f08,_0x433fde[_0x189e('0x42')]);var _0xa96bc9={'where':_0x1f7f08['where']};return db[_0x189e('0x2c')][_0x189e('0x43')](_0xa96bc9)[_0x189e('0x24')](function(_0x318e53){_0x46380f[_0x189e('0x43')]=_0x318e53;if(_0x433fde[_0x189e('0x32')][_0x189e('0x44')]){_0x1f7f08['include']=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x1f7f08);})[_0x189e('0x24')](function(_0x289646){_0x46380f[_0x189e('0x45')]=_0x289646;return _0x46380f;})[_0x189e('0x24')](respondWithFilteredResult(_0x328ec3,_0x1f7f08))['catch'](handleError(_0x328ec3,null));};exports[_0x189e('0x46')]=function(_0x532000,_0x123489){var _0x17f203={'raw':![],'where':{'id':_0x532000[_0x189e('0x47')]['id']}},_0xe02b2={};_0xe02b2['model']=_[_0x189e('0x33')](db['Dashboard'][_0x189e('0x2d')]);_0xe02b2[_0x189e('0x32')]=_['keys'](_0x532000['query']);_0xe02b2[_0x189e('0x34')]=_[_0x189e('0x36')](_0xe02b2[_0x189e('0x31')],_0xe02b2[_0x189e('0x32')]);_0x17f203[_0x189e('0x35')]=_['intersection'](_0xe02b2[_0x189e('0x31')],qs['fields'](_0x532000[_0x189e('0x32')][_0x189e('0x37')]));_0x17f203[_0x189e('0x35')]=_0x17f203[_0x189e('0x35')][_0x189e('0x38')]?_0x17f203['attributes']:_0xe02b2['model'];if(_0x532000[_0x189e('0x32')][_0x189e('0x44')]){_0x17f203[_0x189e('0x48')]=[{'all':!![]}];}_0x17f203=_[_0x189e('0x40')]({},_0x17f203,_0x532000[_0x189e('0x42')]);return db[_0x189e('0x2c')][_0x189e('0x49')](_0x17f203)[_0x189e('0x24')](handleEntityNotFound(_0x123489,null))['then'](respondWithResult(_0x123489,null))['catch'](handleError(_0x123489,null));};exports[_0x189e('0x4a')]=function(_0x58ae32,_0x4257d8){return db[_0x189e('0x2c')][_0x189e('0x4a')](_0x58ae32[_0x189e('0x4b')],{})[_0x189e('0x24')](function(_0x4f28e1){var _0x5a574c=_0x58ae32[_0x189e('0x4c')][_0x189e('0x4d')]({'plain':!![]});if(!_0x5a574c)throw new Error(_0x189e('0x4e'));if(_0x5a574c['role']===_0x189e('0x4c')){var _0x503e3a=_0x4f28e1['get']({'plain':!![]});var _0x1a1fdd=_0x189e('0x25');return db[_0x189e('0x4f')][_0x189e('0x49')]({'where':{'name':_0x1a1fdd,'userProfileId':_0x5a574c[_0x189e('0x50')]},'raw':!![]})[_0x189e('0x24')](function(_0x16afb8){if(_0x16afb8&&_0x16afb8[_0x189e('0x51')]===0x0){return db['UserProfileResource'][_0x189e('0x4a')]({'name':_0x503e3a[_0x189e('0x28')],'resourceId':_0x503e3a['id'],'type':_0x16afb8[_0x189e('0x28')],'sectionId':_0x16afb8['id']},{})[_0x189e('0x24')](function(){return _0x4f28e1;});}else{return _0x4f28e1;}})[_0x189e('0x52')](function(_0x5749d0){logger[_0x189e('0x53')](_0x189e('0x54'),_0x5749d0);throw _0x5749d0;});}return _0x4f28e1;})[_0x189e('0x24')](respondWithResult(_0x4257d8,0xc9))[_0x189e('0x52')](handleError(_0x4257d8,null));};exports[_0x189e('0x55')]=function(_0x1f262f,_0x287271){var _0x4401e5={'where':{'id':_0x1f262f[_0x189e('0x47')]['id']}},_0x1a7e3b={};_0x1a7e3b[_0x189e('0x31')]=_[_0x189e('0x33')](db[_0x189e('0x2c')][_0x189e('0x2d')]);_0x4401e5[_0x189e('0x35')]=_[_0x189e('0x36')](_0x1a7e3b[_0x189e('0x31')],qs[_0x189e('0x37')](_0x1f262f['query'][_0x189e('0x37')]));_0x4401e5[_0x189e('0x35')]=_0x4401e5[_0x189e('0x35')][_0x189e('0x38')]?_0x4401e5[_0x189e('0x35')]:_0x1a7e3b['model'];if(_0x1f262f[_0x189e('0x32')][_0x189e('0x44')]){_0x4401e5[_0x189e('0x48')]=[{'all':!![]}];}_0x4401e5=_[_0x189e('0x40')]({},_0x4401e5,_0x1f262f[_0x189e('0x42')]);return db[_0x189e('0x2c')]['find'](_0x4401e5)[_0x189e('0x24')](handleEntityNotFound(_0x287271,null))[_0x189e('0x24')](function(_0x234d13){if(_0x234d13){var _0x53c579=_0x234d13[_0x189e('0x4d')]({'plain':!![]});_0x53c579=qs['omit'](_0x53c579,['id',_0x189e('0x56'),_0x189e('0x57')]);_0x1f262f[_0x189e('0x4b')]=_[_0x189e('0x58')](_0x1f262f[_0x189e('0x4b')],['id','createdAt','updatedAt']);return db[_0x189e('0x2c')][_0x189e('0x4a')](_[_0x189e('0x40')](_0x53c579,_0x1f262f[_0x189e('0x4b')]),{'include':_0x1f262f[_0x189e('0x32')][_0x189e('0x44')]?[{'all':!![]}]:undefined})[_0x189e('0x24')](function(_0x103740){var _0x16c39b=_0x1f262f['user'][_0x189e('0x4d')]({'plain':!![]});if(!_0x16c39b)throw new Error(_0x189e('0x4e'));if(_0x16c39b[_0x189e('0x59')]===_0x189e('0x4c')){var _0x188a75=_0x103740[_0x189e('0x4d')]({'plain':!![]});var _0xe7307=_0x189e('0x25');return db[_0x189e('0x4f')][_0x189e('0x49')]({'where':{'name':_0xe7307,'userProfileId':_0x16c39b[_0x189e('0x50')]},'raw':!![]})[_0x189e('0x24')](function(_0x327a00){if(_0x327a00&&_0x327a00['autoAssociation']===0x0){return db[_0x189e('0x5a')][_0x189e('0x4a')]({'name':_0x188a75['name'],'resourceId':_0x188a75['id'],'type':_0x327a00[_0x189e('0x28')],'sectionId':_0x327a00['id']},{})['then'](function(){return _0x103740;});}else{return _0x103740;}})['catch'](function(_0x495961){logger['error'](_0x189e('0x54'),_0x495961);throw _0x495961;});}return _0x103740;});}})['then'](respondWithResult(_0x287271,0xc9))[_0x189e('0x52')](handleError(_0x287271,null));};exports['update']=function(_0x5d84d4,_0x15dcd6){if(_0x5d84d4[_0x189e('0x4b')]['id']){delete _0x5d84d4[_0x189e('0x4b')]['id'];}return db[_0x189e('0x2c')][_0x189e('0x49')]({'where':{'id':_0x5d84d4['params']['id']}})['then'](handleEntityNotFound(_0x15dcd6,null))[_0x189e('0x24')](saveUpdates(_0x5d84d4[_0x189e('0x4b')],null))[_0x189e('0x24')](respondWithResult(_0x15dcd6,null))['catch'](handleError(_0x15dcd6,null));};exports[_0x189e('0x26')]=function(_0x1e0e3e,_0x18838b){return db[_0x189e('0x2c')]['find']({'where':{'id':_0x1e0e3e[_0x189e('0x47')]['id']}})[_0x189e('0x24')](handleEntityNotFound(_0x18838b,null))[_0x189e('0x24')](removeEntity(_0x18838b,null))[_0x189e('0x52')](handleError(_0x18838b,null));};function widgetAttributes(_0x463938){try{switch(_0x463938[_0x189e('0x2f')]){case _0x189e('0x5b'):return[{'name':_0x189e('0x5c'),'value':_0x463938[_0x189e('0x5c')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x0]?_0x463938['attrs'][0x0]['value']:undefined)||'https://'}];case _0x189e('0x5e'):return[{'name':_0x189e('0x5f'),'value':_0x463938['attrPath']||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x0]?_0x463938['attrs'][0x0][_0x189e('0x60')]:undefined)||''}];case'clock':return[{'name':_0x189e('0x61'),'value':_0x463938[_0x189e('0x61')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x0]?_0x463938[_0x189e('0x5d')][0x0][_0x189e('0x60')]:undefined)||_0x189e('0x62')},{'name':_0x189e('0x63'),'value':_0x463938[_0x189e('0x63')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x1]?_0x463938[_0x189e('0x5d')][0x1][_0x189e('0x60')]:undefined)||_0x189e('0x64')},{'name':_0x189e('0x65'),'value':_0x463938['attrFontSize']||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x2]?_0x463938['attrs'][0x2][_0x189e('0x60')]:undefined)||0xc}];case _0x189e('0x66'):return[{'name':_0x189e('0x67'),'value':_0x463938[_0x189e('0x67')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x0]?_0x463938['attrs'][0x0]['value']:undefined)||_0x189e('0x68')},{'name':_0x189e('0x69'),'value':_0x463938[_0x189e('0x69')]||(_0x463938[_0x189e('0x5d')]&&_0x463938['attrs'][0x1]?_0x463938[_0x189e('0x5d')][0x1][_0x189e('0x60')]:undefined)||[]},{'name':_0x189e('0x65'),'value':_0x463938[_0x189e('0x65')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x2]?_0x463938[_0x189e('0x5d')][0x2]['value']:undefined)||0x14},{'name':_0x189e('0x6a'),'value':_0x463938[_0x189e('0x6a')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x3]?_0x463938[_0x189e('0x5d')][0x3][_0x189e('0x60')]:undefined)||'voice'},{'name':_0x189e('0x6b'),'value':_0x463938[_0x189e('0x6b')]||(_0x463938['attrs']&&_0x463938[_0x189e('0x5d')][0x4]?_0x463938['attrs'][0x4]['value']:undefined)||''},{'name':_0x189e('0x6c'),'value':_0x463938[_0x189e('0x6c')]||(_0x463938[_0x189e('0x5d')]&&_0x463938['attrs'][0x5]?_0x463938['attrs'][0x5][_0x189e('0x60')]:undefined)||''},{'name':_0x189e('0x6d'),'value':_0x463938[_0x189e('0x6d')]||(_0x463938[_0x189e('0x5d')]&&_0x463938['attrs'][0x6]?_0x463938[_0x189e('0x5d')][0x6][_0x189e('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x463938['attrOpenchannelAccounts']||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x7]?_0x463938[_0x189e('0x5d')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x463938[_0x189e('0x6e')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x8]?_0x463938[_0x189e('0x5d')][0x8]['value']:undefined)||''},{'name':_0x189e('0x6f'),'value':_0x463938[_0x189e('0x6f')]||(_0x463938[_0x189e('0x5d')]&&_0x463938['attrs'][0x9]?_0x463938[_0x189e('0x5d')][0x9][_0x189e('0x60')]:undefined)||''}];case'multibar-chart':case _0x189e('0x70'):return[{'name':_0x189e('0x71'),'value':_0x463938[_0x189e('0x71')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x0]?_0x463938[_0x189e('0x5d')][0x0][_0x189e('0x60')]:undefined)||_0x189e('0x68')},{'name':_0x189e('0x72'),'value':_0x463938[_0x189e('0x72')]||(_0x463938['attrs']&&_0x463938[_0x189e('0x5d')][0x1]?_0x463938[_0x189e('0x5d')][0x1][_0x189e('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0x463938['attrSerie3']||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x2]?_0x463938[_0x189e('0x5d')][0x2][_0x189e('0x60')]:undefined)||null},{'name':_0x189e('0x69'),'value':_0x463938['attrVoiceQueues']||(_0x463938[_0x189e('0x5d')]&&_0x463938['attrs'][0x3]?_0x463938[_0x189e('0x5d')][0x3]['value']:undefined)||[]},{'name':_0x189e('0x6a'),'value':_0x463938['attrChannel']||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x4]?_0x463938[_0x189e('0x5d')][0x4][_0x189e('0x60')]:undefined)||_0x189e('0x73')},{'name':'attrEmailAccounts','value':_0x463938[_0x189e('0x6b')]||(_0x463938['attrs']&&_0x463938[_0x189e('0x5d')][0x5]?_0x463938[_0x189e('0x5d')][0x5][_0x189e('0x60')]:undefined)||''},{'name':_0x189e('0x6c'),'value':_0x463938[_0x189e('0x6c')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x6]?_0x463938[_0x189e('0x5d')][0x6][_0x189e('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x463938[_0x189e('0x6d')]||(_0x463938[_0x189e('0x5d')]&&_0x463938['attrs'][0x7]?_0x463938[_0x189e('0x5d')][0x7]['value']:undefined)||''},{'name':_0x189e('0x74'),'value':_0x463938[_0x189e('0x74')]||(_0x463938[_0x189e('0x5d')]&&_0x463938['attrs'][0x8]?_0x463938[_0x189e('0x5d')][0x8][_0x189e('0x60')]:undefined)||''},{'name':_0x189e('0x6e'),'value':_0x463938['attrWhatsappAccounts']||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x9]?_0x463938[_0x189e('0x5d')][0x9]['value']:undefined)||''},{'name':_0x189e('0x6f'),'value':_0x463938[_0x189e('0x6f')]||(_0x463938['attrs']&&_0x463938[_0x189e('0x5d')][0xa]?_0x463938[_0x189e('0x5d')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x189e('0x75'),'type':_0x463938['reportType']||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x0]?_0x463938[_0x189e('0x5d')][0x0][_0x189e('0x2f')]:undefined)||null,'value':_0x463938[_0x189e('0x75')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x0]?_0x463938['attrs'][0x0]['value']:undefined)||null},{'name':_0x189e('0x76'),'value':_0x463938[_0x189e('0x76')]||(_0x463938[_0x189e('0x5d')]&&_0x463938[_0x189e('0x5d')][0x1]?_0x463938[_0x189e('0x5d')][0x1][_0x189e('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x377e0d){logger['error'](_0x189e('0x77'),JSON[_0x189e('0x78')](_0x377e0d));return[];}}exports['addItem']=function(_0xe382d8,_0xade81,_0x775b7d){if(_0xe382d8[_0x189e('0x4b')]['id']){delete _0xe382d8[_0x189e('0x4b')]['id'];}return db['Dashboard'][_0x189e('0x49')]({'where':{'id':_0xe382d8[_0x189e('0x47')]['id']}})['then'](handleEntityNotFound(_0xade81,null))['then'](function(_0x2a0bf3){if(_0x2a0bf3){_0xe382d8[_0x189e('0x4b')][_0x189e('0x79')]=_0x2a0bf3['id'];_0xe382d8[_0x189e('0x4b')][_0x189e('0x5d')]=widgetAttributes(_0xe382d8[_0x189e('0x4b')]);return db[_0x189e('0x7a')][_0x189e('0x4a')](_0xe382d8[_0x189e('0x4b')]);}})[_0x189e('0x24')](respondWithResult(_0xade81,null))[_0x189e('0x52')](handleError(_0xade81,null));};exports['getItems']=function(_0x193a06,_0x3c92c6,_0x15f8e9){var _0x48f6fc={};var _0x23012f={};var _0x1485f0;var _0x3b4775;return db[_0x189e('0x2c')][_0x189e('0x7b')]({'where':{'id':_0x193a06[_0x189e('0x47')]['id']}})[_0x189e('0x24')](handleEntityNotFound(_0x3c92c6,null))[_0x189e('0x24')](function(_0xefa9dc){if(_0xefa9dc){_0x1485f0=_0xefa9dc;_0x23012f[_0x189e('0x31')]=_['keys'](db['DashboardItem'][_0x189e('0x2d')]);_0x23012f['query']=_[_0x189e('0x33')](_0x193a06[_0x189e('0x32')]);_0x23012f[_0x189e('0x34')]=_[_0x189e('0x36')](_0x23012f[_0x189e('0x31')],_0x23012f[_0x189e('0x32')]);_0x48f6fc[_0x189e('0x35')]=_['intersection'](_0x23012f[_0x189e('0x31')],qs[_0x189e('0x37')](_0x193a06[_0x189e('0x32')][_0x189e('0x37')]));_0x48f6fc[_0x189e('0x35')]=_0x48f6fc['attributes']['length']?_0x48f6fc[_0x189e('0x35')]:_0x23012f[_0x189e('0x31')];_0x48f6fc[_0x189e('0x3b')]=qs['sort'](_0x193a06['query']['sort']);_0x48f6fc[_0x189e('0x3d')]=qs[_0x189e('0x34')](_[_0x189e('0x3e')](_0x193a06['query'],_0x23012f[_0x189e('0x34')]));if(_0x193a06[_0x189e('0x32')]['filter']){_0x48f6fc[_0x189e('0x3d')]=_[_0x189e('0x40')](_0x48f6fc[_0x189e('0x3d')],{'$or':_[_0x189e('0x2b')](_0x48f6fc['attributes'],function(_0x491369){var _0x536428={};_0x536428[_0x491369]={'$like':'%'+_0x193a06['query']['filter']+'%'};return _0x536428;})});}_0x48f6fc=_[_0x189e('0x40')]({},_0x48f6fc,_0x193a06['options']);return _0x1485f0[_0x189e('0x7c')](_0x48f6fc);}})[_0x189e('0x24')](function(_0x571c87){if(_0x571c87){_0x3b4775=_0x571c87[_0x189e('0x38')];if(!_0x193a06[_0x189e('0x32')][_0x189e('0x39')](_0x189e('0x3a'))){_0x48f6fc[_0x189e('0x1e')]=qs[_0x189e('0x1e')](_0x193a06[_0x189e('0x32')][_0x189e('0x1e')]);_0x48f6fc[_0x189e('0x1c')]=qs['offset'](_0x193a06[_0x189e('0x32')]['offset']);}return _0x1485f0['getItems'](_0x48f6fc);}})[_0x189e('0x24')](function(_0x54a2f9){if(_0x54a2f9){return _0x54a2f9?{'count':_0x3b4775,'rows':_0x54a2f9}:null;}})[_0x189e('0x24')](respondWithResult(_0x3c92c6,null))[_0x189e('0x52')](handleError(_0x3c92c6,null));}; \ No newline at end of file +var _0x398d=['query','keys','attributes','intersection','fields','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','Dashboard','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','includeAll','omit','updatedAt','createdAt','destroy','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrFaxAccounts','web-report','attrReport','attrRefresh','stringify','addItem','getItems','findOne','DashboardItem','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','rawAttributes','type','key','model','map'];(function(_0x1dd253,_0x588717){var _0x3e6d16=function(_0x4606e6){while(--_0x4606e6){_0x1dd253['push'](_0x1dd253['shift']());}};_0x3e6d16(++_0x588717);}(_0x398d,0x151));var _0xd398=function(_0x788caa,_0x920a0c){_0x788caa=_0x788caa-0x0;var _0x90ce0f=_0x398d[_0x788caa];return _0x90ce0f;};'use strict';var emlformat=require(_0xd398('0x0'));var rimraf=require(_0xd398('0x1'));var zipdir=require(_0xd398('0x2'));var jsonpatch=require(_0xd398('0x3'));var rp=require('request-promise');var moment=require(_0xd398('0x4'));var BPromise=require(_0xd398('0x5'));var Mustache=require(_0xd398('0x6'));var util=require(_0xd398('0x7'));var path=require(_0xd398('0x8'));var sox=require(_0xd398('0x9'));var csv=require(_0xd398('0xa'));var ejs=require(_0xd398('0xb'));var fs=require('fs');var fs_extra=require(_0xd398('0xc'));var _=require('lodash');var squel=require(_0xd398('0xd'));var crypto=require('crypto');var jsforce=require(_0xd398('0xe'));var deskjs=require(_0xd398('0xf'));var toCsv=require(_0xd398('0xa'));var querystring=require(_0xd398('0x10'));var Papa=require(_0xd398('0x11'));var Redis=require('ioredis');var authService=require(_0xd398('0x12'));var qs=require(_0xd398('0x13'));var as=require(_0xd398('0x14'));var hardwareService=require(_0xd398('0x15'));var logger=require(_0xd398('0x16'))(_0xd398('0x17'));var utils=require(_0xd398('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd398('0x19'));var db=require('../../mysqldb')['db'];config[_0xd398('0x1a')]=_['defaults'](config[_0xd398('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xd398('0x1b'))(new Redis(config[_0xd398('0x1a')]));require(_0xd398('0x1c'))[_0xd398('0x1d')](socket);function respondWithStatusCode(_0x5612a3,_0x58010e){_0x58010e=_0x58010e||0xcc;return function(_0x3af0b8){if(_0x3af0b8){return _0x5612a3[_0xd398('0x1e')](_0x58010e);}return _0x5612a3[_0xd398('0x1f')](_0x58010e)[_0xd398('0x20')]();};}function respondWithResult(_0x529c12,_0x16a2b4){_0x16a2b4=_0x16a2b4||0xc8;return function(_0x25bb8a){if(_0x25bb8a){return _0x529c12['status'](_0x16a2b4)[_0xd398('0x21')](_0x25bb8a);}};}function respondWithFilteredResult(_0x47c74e,_0x4be15b){return function(_0x47209e){if(_0x47209e){var _0x4c38d1=typeof _0x4be15b[_0xd398('0x22')]===_0xd398('0x23')&&typeof _0x4be15b[_0xd398('0x24')]===_0xd398('0x23');var _0x4d5def=_0x47209e[_0xd398('0x25')];var _0xdf7ae0=_0x4c38d1?0x0:_0x4be15b[_0xd398('0x22')];var _0x5f2326=_0x4c38d1?_0x47209e[_0xd398('0x25')]:_0x4be15b['offset']+_0x4be15b[_0xd398('0x24')];var _0x4fb0e6;if(_0x5f2326>=_0x4d5def){_0x5f2326=_0x4d5def;_0x4fb0e6=0xc8;}else{_0x4fb0e6=0xce;}_0x47c74e[_0xd398('0x1f')](_0x4fb0e6);return _0x47c74e['set'](_0xd398('0x26'),_0xdf7ae0+'-'+_0x5f2326+'/'+_0x4d5def)['json'](_0x47209e);}return null;};}function patchUpdates(_0x53dc10){return function(_0x17bed3){try{jsonpatch['apply'](_0x17bed3,_0x53dc10,!![]);}catch(_0x3b4529){return BPromise[_0xd398('0x27')](_0x3b4529);}return _0x17bed3[_0xd398('0x28')]();};}function saveUpdates(_0x20824e,_0x48707b){return function(_0x3e6334){if(_0x3e6334){return _0x3e6334[_0xd398('0x29')](_0x20824e)[_0xd398('0x2a')](function(_0x39b6ce){return _0x39b6ce;});}return null;};}function removeEntity(_0x27c2cd,_0x596163){return function(_0x194434){if(_0x194434){return _0x194434['destroy']()[_0xd398('0x2a')](function(){var _0x4fd85c=_0x194434[_0xd398('0x2b')]({'plain':!![]});var _0x27883a=_0xd398('0x2c');return db[_0xd398('0x2d')]['destroy']({'where':{'type':_0x27883a,'resourceId':_0x4fd85c['id']}})['then'](function(){return _0x194434;});})[_0xd398('0x2a')](function(){_0x27c2cd[_0xd398('0x1f')](0xcc)[_0xd398('0x20')]();});}};}function handleEntityNotFound(_0x205090,_0xe5e82){return function(_0x2d8636){if(!_0x2d8636){_0x205090[_0xd398('0x1e')](0x194);}return _0x2d8636;};}function handleError(_0x173271,_0x29bc90){_0x29bc90=_0x29bc90||0x1f4;return function(_0x1e219e){logger[_0xd398('0x2e')](_0x1e219e[_0xd398('0x2f')]);if(_0x1e219e[_0xd398('0x30')]){delete _0x1e219e[_0xd398('0x30')];}_0x173271['status'](_0x29bc90)[_0xd398('0x31')](_0x1e219e);};}exports[_0xd398('0x32')]=function(_0x4474e5,_0x419ba3){var _0xd326b7={},_0x4f7d7c={},_0x5b0a4a={'count':0x0,'rows':[]};var _0x3524f3=_['map'](db['Dashboard'][_0xd398('0x33')],function(_0x3549cc){return{'name':_0x3549cc['fieldName'],'type':_0x3549cc[_0xd398('0x34')][_0xd398('0x35')]};});_0x4f7d7c[_0xd398('0x36')]=_[_0xd398('0x37')](_0x3524f3,_0xd398('0x30'));_0x4f7d7c[_0xd398('0x38')]=_[_0xd398('0x39')](_0x4474e5[_0xd398('0x38')]);_0x4f7d7c['filters']=_['intersection'](_0x4f7d7c[_0xd398('0x36')],_0x4f7d7c['query']);_0xd326b7[_0xd398('0x3a')]=_[_0xd398('0x3b')](_0x4f7d7c[_0xd398('0x36')],qs['fields'](_0x4474e5[_0xd398('0x38')][_0xd398('0x3c')]));_0xd326b7[_0xd398('0x3a')]=_0xd326b7['attributes']['length']?_0xd326b7[_0xd398('0x3a')]:_0x4f7d7c[_0xd398('0x36')];if(!_0x4474e5[_0xd398('0x38')]['hasOwnProperty']('nolimit')){_0xd326b7[_0xd398('0x24')]=qs[_0xd398('0x24')](_0x4474e5[_0xd398('0x38')][_0xd398('0x24')]);_0xd326b7[_0xd398('0x22')]=qs['offset'](_0x4474e5[_0xd398('0x38')]['offset']);}_0xd326b7[_0xd398('0x3d')]=qs['sort'](_0x4474e5[_0xd398('0x38')][_0xd398('0x3e')]);_0xd326b7['where']=qs[_0xd398('0x3f')](_[_0xd398('0x40')](_0x4474e5['query'],_0x4f7d7c[_0xd398('0x3f')]),_0x3524f3);if(_0x4474e5[_0xd398('0x38')][_0xd398('0x41')]){_0xd326b7[_0xd398('0x42')]=_['merge'](_0xd326b7[_0xd398('0x42')],{'$or':_[_0xd398('0x37')](_0x3524f3,function(_0x466b99){if(_0x466b99[_0xd398('0x34')]!==_0xd398('0x43')){var _0x54dde8={};_0x54dde8[_0x466b99[_0xd398('0x30')]]={'$like':'%'+_0x4474e5['query'][_0xd398('0x41')]+'%'};return _0x54dde8;}})});}_0xd326b7=_[_0xd398('0x44')]({},_0xd326b7,_0x4474e5[_0xd398('0x45')]);var _0x453ca5={'where':_0xd326b7['where']};return db['Dashboard'][_0xd398('0x25')](_0x453ca5)['then'](function(_0x1833e3){_0x5b0a4a['count']=_0x1833e3;if(_0x4474e5[_0xd398('0x38')]['includeAll']){_0xd326b7[_0xd398('0x46')]=[{'all':!![]}];}return db[_0xd398('0x47')][_0xd398('0x48')](_0xd326b7);})[_0xd398('0x2a')](function(_0x52a16e){_0x5b0a4a[_0xd398('0x49')]=_0x52a16e;return _0x5b0a4a;})['then'](respondWithFilteredResult(_0x419ba3,_0xd326b7))[_0xd398('0x4a')](handleError(_0x419ba3,null));};exports[_0xd398('0x4b')]=function(_0x28288c,_0x96b7fd){var _0x119f18={'raw':![],'where':{'id':_0x28288c['params']['id']}},_0x1c1c9e={};_0x1c1c9e[_0xd398('0x36')]=_['keys'](db[_0xd398('0x47')][_0xd398('0x33')]);_0x1c1c9e['query']=_[_0xd398('0x39')](_0x28288c[_0xd398('0x38')]);_0x1c1c9e[_0xd398('0x3f')]=_[_0xd398('0x3b')](_0x1c1c9e['model'],_0x1c1c9e[_0xd398('0x38')]);_0x119f18[_0xd398('0x3a')]=_['intersection'](_0x1c1c9e['model'],qs['fields'](_0x28288c[_0xd398('0x38')][_0xd398('0x3c')]));_0x119f18[_0xd398('0x3a')]=_0x119f18[_0xd398('0x3a')][_0xd398('0x4c')]?_0x119f18[_0xd398('0x3a')]:_0x1c1c9e['model'];if(_0x28288c[_0xd398('0x38')]['includeAll']){_0x119f18[_0xd398('0x46')]=[{'all':!![]}];}_0x119f18=_[_0xd398('0x44')]({},_0x119f18,_0x28288c[_0xd398('0x45')]);return db['Dashboard'][_0xd398('0x4d')](_0x119f18)[_0xd398('0x2a')](handleEntityNotFound(_0x96b7fd,null))['then'](respondWithResult(_0x96b7fd,null))[_0xd398('0x4a')](handleError(_0x96b7fd,null));};exports[_0xd398('0x4e')]=function(_0x4efb25,_0x39420f){return db['Dashboard'][_0xd398('0x4e')](_0x4efb25[_0xd398('0x4f')],{})['then'](function(_0x5bf24b){var _0x1b02c6=_0x4efb25[_0xd398('0x50')][_0xd398('0x2b')]({'plain':!![]});if(!_0x1b02c6)throw new Error(_0xd398('0x51'));if(_0x1b02c6[_0xd398('0x52')]===_0xd398('0x50')){var _0xdfbb95=_0x5bf24b[_0xd398('0x2b')]({'plain':!![]});var _0x39cdbb=_0xd398('0x2c');return db[_0xd398('0x53')]['find']({'where':{'name':_0x39cdbb,'userProfileId':_0x1b02c6[_0xd398('0x54')]},'raw':!![]})['then'](function(_0x487ecc){if(_0x487ecc&&_0x487ecc[_0xd398('0x55')]===0x0){return db[_0xd398('0x2d')]['create']({'name':_0xdfbb95[_0xd398('0x30')],'resourceId':_0xdfbb95['id'],'type':_0x487ecc[_0xd398('0x30')],'sectionId':_0x487ecc['id']},{})['then'](function(){return _0x5bf24b;});}else{return _0x5bf24b;}})[_0xd398('0x4a')](function(_0x3e0d61){logger[_0xd398('0x2e')](_0xd398('0x56'),_0x3e0d61);throw _0x3e0d61;});}return _0x5bf24b;})['then'](respondWithResult(_0x39420f,0xc9))[_0xd398('0x4a')](handleError(_0x39420f,null));};exports[_0xd398('0x57')]=function(_0x18f5d2,_0x4d8364){var _0xb794cd={'where':{'id':_0x18f5d2[_0xd398('0x58')]['id']}},_0x3c9202={};_0x3c9202[_0xd398('0x36')]=_[_0xd398('0x39')](db['Dashboard']['rawAttributes']);_0xb794cd[_0xd398('0x3a')]=_['intersection'](_0x3c9202[_0xd398('0x36')],qs[_0xd398('0x3c')](_0x18f5d2[_0xd398('0x38')][_0xd398('0x3c')]));_0xb794cd[_0xd398('0x3a')]=_0xb794cd[_0xd398('0x3a')][_0xd398('0x4c')]?_0xb794cd[_0xd398('0x3a')]:_0x3c9202[_0xd398('0x36')];if(_0x18f5d2[_0xd398('0x38')][_0xd398('0x59')]){_0xb794cd['include']=[{'all':!![]}];}_0xb794cd=_['merge']({},_0xb794cd,_0x18f5d2[_0xd398('0x45')]);return db['Dashboard'][_0xd398('0x4d')](_0xb794cd)[_0xd398('0x2a')](handleEntityNotFound(_0x4d8364,null))['then'](function(_0x3b87ef){if(_0x3b87ef){var _0x4a5143=_0x3b87ef[_0xd398('0x2b')]({'plain':!![]});_0x4a5143=qs[_0xd398('0x5a')](_0x4a5143,['id','createdAt',_0xd398('0x5b')]);_0x18f5d2[_0xd398('0x4f')]=_['omit'](_0x18f5d2[_0xd398('0x4f')],['id',_0xd398('0x5c'),_0xd398('0x5b')]);return db[_0xd398('0x47')][_0xd398('0x4e')](_['merge'](_0x4a5143,_0x18f5d2[_0xd398('0x4f')]),{'include':_0x18f5d2[_0xd398('0x38')][_0xd398('0x59')]?[{'all':!![]}]:undefined})['then'](function(_0xe4dfe){var _0xf788a3=_0x18f5d2[_0xd398('0x50')][_0xd398('0x2b')]({'plain':!![]});if(!_0xf788a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf788a3[_0xd398('0x52')]===_0xd398('0x50')){var _0x8a1d82=_0xe4dfe[_0xd398('0x2b')]({'plain':!![]});var _0x5bd389=_0xd398('0x2c');return db[_0xd398('0x53')]['find']({'where':{'name':_0x5bd389,'userProfileId':_0xf788a3[_0xd398('0x54')]},'raw':!![]})['then'](function(_0x209ee3){if(_0x209ee3&&_0x209ee3['autoAssociation']===0x0){return db['UserProfileResource'][_0xd398('0x4e')]({'name':_0x8a1d82[_0xd398('0x30')],'resourceId':_0x8a1d82['id'],'type':_0x209ee3['name'],'sectionId':_0x209ee3['id']},{})[_0xd398('0x2a')](function(){return _0xe4dfe;});}else{return _0xe4dfe;}})[_0xd398('0x4a')](function(_0x4a0b28){logger[_0xd398('0x2e')](_0xd398('0x56'),_0x4a0b28);throw _0x4a0b28;});}return _0xe4dfe;});}})[_0xd398('0x2a')](respondWithResult(_0x4d8364,0xc9))[_0xd398('0x4a')](handleError(_0x4d8364,null));};exports['update']=function(_0x3c90bd,_0xf4c5c2){if(_0x3c90bd[_0xd398('0x4f')]['id']){delete _0x3c90bd[_0xd398('0x4f')]['id'];}return db['Dashboard'][_0xd398('0x4d')]({'where':{'id':_0x3c90bd[_0xd398('0x58')]['id']}})[_0xd398('0x2a')](handleEntityNotFound(_0xf4c5c2,null))[_0xd398('0x2a')](saveUpdates(_0x3c90bd[_0xd398('0x4f')],null))[_0xd398('0x2a')](respondWithResult(_0xf4c5c2,null))[_0xd398('0x4a')](handleError(_0xf4c5c2,null));};exports[_0xd398('0x5d')]=function(_0x2e82d0,_0x347cde){return db[_0xd398('0x47')]['find']({'where':{'id':_0x2e82d0[_0xd398('0x58')]['id']}})[_0xd398('0x2a')](handleEntityNotFound(_0x347cde,null))[_0xd398('0x2a')](removeEntity(_0x347cde,null))[_0xd398('0x4a')](handleError(_0x347cde,null));};function widgetAttributes(_0x51a18b){try{switch(_0x51a18b['type']){case _0xd398('0x5e'):return[{'name':_0xd398('0x5f'),'value':_0x51a18b[_0xd398('0x5f')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b['attrs'][0x0]?_0x51a18b[_0xd398('0x60')][0x0][_0xd398('0x61')]:undefined)||_0xd398('0x62')}];case _0xd398('0x63'):return[{'name':_0xd398('0x64'),'value':_0x51a18b[_0xd398('0x64')]||(_0x51a18b['attrs']&&_0x51a18b[_0xd398('0x60')][0x0]?_0x51a18b[_0xd398('0x60')][0x0]['value']:undefined)||''}];case _0xd398('0x65'):return[{'name':_0xd398('0x66'),'value':_0x51a18b[_0xd398('0x66')]||(_0x51a18b['attrs']&&_0x51a18b[_0xd398('0x60')][0x0]?_0x51a18b[_0xd398('0x60')][0x0][_0xd398('0x61')]:undefined)||'HH:mm:ss'},{'name':_0xd398('0x67'),'value':_0x51a18b['attrTimezone']||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x1]?_0x51a18b[_0xd398('0x60')][0x1][_0xd398('0x61')]:undefined)||'0.00'},{'name':_0xd398('0x68'),'value':_0x51a18b[_0xd398('0x68')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b['attrs'][0x2]?_0x51a18b[_0xd398('0x60')][0x2]['value']:undefined)||0xc}];case _0xd398('0x69'):return[{'name':'attrMetric','value':_0x51a18b[_0xd398('0x6a')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x0]?_0x51a18b['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x51a18b[_0xd398('0x6b')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x1]?_0x51a18b[_0xd398('0x60')][0x1][_0xd398('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0x51a18b[_0xd398('0x68')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x2]?_0x51a18b[_0xd398('0x60')][0x2][_0xd398('0x61')]:undefined)||0x14},{'name':_0xd398('0x6c'),'value':_0x51a18b[_0xd398('0x6c')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x3]?_0x51a18b[_0xd398('0x60')][0x3][_0xd398('0x61')]:undefined)||_0xd398('0x6d')},{'name':_0xd398('0x6e'),'value':_0x51a18b[_0xd398('0x6e')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x4]?_0x51a18b[_0xd398('0x60')][0x4][_0xd398('0x61')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x51a18b['attrFaxAccounts']||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x5]?_0x51a18b[_0xd398('0x60')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x51a18b[_0xd398('0x6f')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b['attrs'][0x6]?_0x51a18b[_0xd398('0x60')][0x6][_0xd398('0x61')]:undefined)||''},{'name':_0xd398('0x70'),'value':_0x51a18b[_0xd398('0x70')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b['attrs'][0x7]?_0x51a18b[_0xd398('0x60')][0x7][_0xd398('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x51a18b[_0xd398('0x71')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x8]?_0x51a18b[_0xd398('0x60')][0x8]['value']:undefined)||''},{'name':_0xd398('0x72'),'value':_0x51a18b[_0xd398('0x72')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x9]?_0x51a18b[_0xd398('0x60')][0x9][_0xd398('0x61')]:undefined)||''}];case'multibar-chart':case _0xd398('0x73'):return[{'name':_0xd398('0x74'),'value':_0x51a18b[_0xd398('0x74')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x0]?_0x51a18b[_0xd398('0x60')][0x0][_0xd398('0x61')]:undefined)||_0xd398('0x75')},{'name':_0xd398('0x76'),'value':_0x51a18b[_0xd398('0x76')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b['attrs'][0x1]?_0x51a18b['attrs'][0x1][_0xd398('0x61')]:undefined)||null},{'name':_0xd398('0x77'),'value':_0x51a18b['attrSerie3']||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x2]?_0x51a18b[_0xd398('0x60')][0x2][_0xd398('0x61')]:undefined)||null},{'name':_0xd398('0x6b'),'value':_0x51a18b['attrVoiceQueues']||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x3]?_0x51a18b['attrs'][0x3][_0xd398('0x61')]:undefined)||[]},{'name':_0xd398('0x6c'),'value':_0x51a18b[_0xd398('0x6c')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x4]?_0x51a18b['attrs'][0x4][_0xd398('0x61')]:undefined)||_0xd398('0x6d')},{'name':'attrEmailAccounts','value':_0x51a18b[_0xd398('0x6e')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x5]?_0x51a18b[_0xd398('0x60')][0x5][_0xd398('0x61')]:undefined)||''},{'name':_0xd398('0x78'),'value':_0x51a18b[_0xd398('0x78')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b['attrs'][0x6]?_0x51a18b['attrs'][0x6]['value']:undefined)||''},{'name':_0xd398('0x6f'),'value':_0x51a18b[_0xd398('0x6f')]||(_0x51a18b['attrs']&&_0x51a18b[_0xd398('0x60')][0x7]?_0x51a18b[_0xd398('0x60')][0x7][_0xd398('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x51a18b[_0xd398('0x70')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x8]?_0x51a18b[_0xd398('0x60')][0x8][_0xd398('0x61')]:undefined)||''},{'name':_0xd398('0x71'),'value':_0x51a18b[_0xd398('0x71')]||(_0x51a18b['attrs']&&_0x51a18b['attrs'][0x9]?_0x51a18b[_0xd398('0x60')][0x9][_0xd398('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0x51a18b['attrChatWebsites']||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0xa]?_0x51a18b['attrs'][0xa][_0xd398('0x61')]:undefined)||''}];case _0xd398('0x79'):return[{'name':_0xd398('0x7a'),'type':_0x51a18b['reportType']||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x0]?_0x51a18b[_0xd398('0x60')][0x0][_0xd398('0x34')]:undefined)||null,'value':_0x51a18b[_0xd398('0x7a')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b['attrs'][0x0]?_0x51a18b[_0xd398('0x60')][0x0][_0xd398('0x61')]:undefined)||null},{'name':_0xd398('0x7b'),'value':_0x51a18b[_0xd398('0x7b')]||(_0x51a18b[_0xd398('0x60')]&&_0x51a18b[_0xd398('0x60')][0x1]?_0x51a18b[_0xd398('0x60')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3a675c){logger['error']('widgetAttributes:\x20%s',JSON[_0xd398('0x7c')](_0x3a675c));return[];}}exports[_0xd398('0x7d')]=function(_0x459ff4,_0x2857aa,_0x7bc316){if(_0x459ff4[_0xd398('0x4f')]['id']){delete _0x459ff4[_0xd398('0x4f')]['id'];}return db['Dashboard'][_0xd398('0x4d')]({'where':{'id':_0x459ff4['params']['id']}})[_0xd398('0x2a')](handleEntityNotFound(_0x2857aa,null))['then'](function(_0x389585){if(_0x389585){_0x459ff4[_0xd398('0x4f')]['DashboardId']=_0x389585['id'];_0x459ff4['body'][_0xd398('0x60')]=widgetAttributes(_0x459ff4[_0xd398('0x4f')]);return db['DashboardItem']['create'](_0x459ff4[_0xd398('0x4f')]);}})[_0xd398('0x2a')](respondWithResult(_0x2857aa,null))['catch'](handleError(_0x2857aa,null));};exports[_0xd398('0x7e')]=function(_0x17f4c9,_0x40e58e,_0x285737){var _0x3511a0={};var _0x489616={};var _0x259375;var _0x33a0a7;return db[_0xd398('0x47')][_0xd398('0x7f')]({'where':{'id':_0x17f4c9[_0xd398('0x58')]['id']}})[_0xd398('0x2a')](handleEntityNotFound(_0x40e58e,null))[_0xd398('0x2a')](function(_0x328efc){if(_0x328efc){_0x259375=_0x328efc;_0x489616[_0xd398('0x36')]=_[_0xd398('0x39')](db[_0xd398('0x80')][_0xd398('0x33')]);_0x489616['query']=_[_0xd398('0x39')](_0x17f4c9[_0xd398('0x38')]);_0x489616['filters']=_[_0xd398('0x3b')](_0x489616[_0xd398('0x36')],_0x489616['query']);_0x3511a0[_0xd398('0x3a')]=_[_0xd398('0x3b')](_0x489616[_0xd398('0x36')],qs[_0xd398('0x3c')](_0x17f4c9[_0xd398('0x38')][_0xd398('0x3c')]));_0x3511a0['attributes']=_0x3511a0[_0xd398('0x3a')][_0xd398('0x4c')]?_0x3511a0[_0xd398('0x3a')]:_0x489616[_0xd398('0x36')];_0x3511a0[_0xd398('0x3d')]=qs['sort'](_0x17f4c9[_0xd398('0x38')][_0xd398('0x3e')]);_0x3511a0[_0xd398('0x42')]=qs[_0xd398('0x3f')](_['pick'](_0x17f4c9[_0xd398('0x38')],_0x489616['filters']));if(_0x17f4c9['query'][_0xd398('0x41')]){_0x3511a0[_0xd398('0x42')]=_[_0xd398('0x44')](_0x3511a0[_0xd398('0x42')],{'$or':_['map'](_0x3511a0['attributes'],function(_0x1016e1){var _0x8fe96b={};_0x8fe96b[_0x1016e1]={'$like':'%'+_0x17f4c9[_0xd398('0x38')]['filter']+'%'};return _0x8fe96b;})});}_0x3511a0=_['merge']({},_0x3511a0,_0x17f4c9[_0xd398('0x45')]);return _0x259375['getItems'](_0x3511a0);}})[_0xd398('0x2a')](function(_0x41b7df){if(_0x41b7df){_0x33a0a7=_0x41b7df[_0xd398('0x4c')];if(!_0x17f4c9[_0xd398('0x38')][_0xd398('0x81')](_0xd398('0x82'))){_0x3511a0['limit']=qs[_0xd398('0x24')](_0x17f4c9['query'][_0xd398('0x24')]);_0x3511a0['offset']=qs[_0xd398('0x22')](_0x17f4c9[_0xd398('0x38')][_0xd398('0x22')]);}return _0x259375[_0xd398('0x7e')](_0x3511a0);}})[_0xd398('0x2a')](function(_0x4cbcc8){if(_0x4cbcc8){return _0x4cbcc8?{'count':_0x33a0a7,'rows':_0x4cbcc8}:null;}})[_0xd398('0x2a')](respondWithResult(_0x40e58e,null))[_0xd398('0x4a')](handleError(_0x40e58e,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index b0a13c4..413a822 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 _0x4c6f=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x30f9c9,_0x44c642){var _0x4da319=function(_0x2e8525){while(--_0x2e8525){_0x30f9c9['push'](_0x30f9c9['shift']());}};_0x4da319(++_0x44c642);}(_0x4c6f,0x7e));var _0xf4c6=function(_0x3806e6,_0x2f55d1){_0x3806e6=_0x3806e6-0x0;var _0x43aea8=_0x4c6f[_0x3806e6];return _0x43aea8;};'use strict';var EventEmitter=require(_0xf4c6('0x0'));var Dashboard=require(_0xf4c6('0x1'))['db'][_0xf4c6('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf4c6('0x3')](0x0);var events={'afterCreate':_0xf4c6('0x4'),'afterUpdate':'update','afterDestroy':_0xf4c6('0x5')};function emitEvent(_0x29e12c){return function(_0x5dd5a8,_0x3e077c,_0x31f9c4){DashboardEvents[_0xf4c6('0x6')](_0x29e12c+':'+_0x5dd5a8['id'],_0x5dd5a8);DashboardEvents[_0xf4c6('0x6')](_0x29e12c,_0x5dd5a8);_0x31f9c4(null);};}for(var e in events){if(events[_0xf4c6('0x7')](e)){var event=events[e];Dashboard[_0xf4c6('0x8')](e,emitEvent(event));}}module[_0xf4c6('0x9')]=DashboardEvents; \ No newline at end of file +var _0x16a6=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x529f36,_0x6b4496){var _0x64d301=function(_0x5a1399){while(--_0x5a1399){_0x529f36['push'](_0x529f36['shift']());}};_0x64d301(++_0x6b4496);}(_0x16a6,0x15c));var _0x616a=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x16a6[_0x34e752];return _0x7c6347;};'use strict';var EventEmitter=require(_0x616a('0x0'));var Dashboard=require(_0x616a('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x616a('0x2')](0x0);var events={'afterCreate':_0x616a('0x3'),'afterUpdate':_0x616a('0x4'),'afterDestroy':_0x616a('0x5')};function emitEvent(_0x43e20b){return function(_0x13cbc6,_0x59fc7e,_0x41fbfa){DashboardEvents[_0x616a('0x6')](_0x43e20b+':'+_0x13cbc6['id'],_0x13cbc6);DashboardEvents['emit'](_0x43e20b,_0x13cbc6);_0x41fbfa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x616a('0x7')](e,emitEvent(event));}}module[_0x616a('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 6a6b83b..0fdcc58 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 _0x976f=['define','Dashboard','dashboards','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x12bf1f,_0x339a57){var _0x5418e9=function(_0x31446f){while(--_0x31446f){_0x12bf1f['push'](_0x12bf1f['shift']());}};_0x5418e9(++_0x339a57);}(_0x976f,0x121));var _0xf976=function(_0xfbaf14,_0x5f4cc1){_0xfbaf14=_0xfbaf14-0x0;var _0x5e00ca=_0x976f[_0xfbaf14];return _0x5e00ca;};'use strict';var _=require(_0xf976('0x0'));var util=require(_0xf976('0x1'));var logger=require(_0xf976('0x2'))(_0xf976('0x3'));var moment=require('moment');var BPromise=require(_0xf976('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf976('0x5'));var rimraf=require('rimraf');var config=require(_0xf976('0x6'));var attributes=require('./dashboard.attributes');module[_0xf976('0x7')]=function(_0x56572e,_0x532465){return _0x56572e[_0xf976('0x8')](_0xf976('0x9'),attributes,{'tableName':_0xf976('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x183f=['define','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x183f,0x1c9));var _0xf183=function(_0x59dad6,_0x19ed68){_0x59dad6=_0x59dad6-0x0;var _0x4a94ef=_0x183f[_0x59dad6];return _0x4a94ef;};'use strict';var _=require(_0xf183('0x0'));var util=require(_0xf183('0x1'));var logger=require(_0xf183('0x2'))(_0xf183('0x3'));var moment=require(_0xf183('0x4'));var BPromise=require(_0xf183('0x5'));var rp=require(_0xf183('0x6'));var fs=require('fs');var path=require(_0xf183('0x7'));var rimraf=require(_0xf183('0x8'));var config=require(_0xf183('0x9'));var attributes=require(_0xf183('0xa'));module['exports']=function(_0x341dd6,_0x5f1cdc){return _0x341dd6[_0xf183('0xb')]('Dashboard',attributes,{'tableName':_0xf183('0xc'),'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 a84f5f6..7cd0a68 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 _0xb7d8=['request','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7d8,0x122));var _0x8b7d=function(_0x55509e,_0x125eb4){_0x55509e=_0x55509e-0x0;var _0xf37686=_0xb7d8[_0x55509e];return _0xf37686;};'use strict';var _=require(_0x8b7d('0x0'));var util=require(_0x8b7d('0x1'));var moment=require(_0x8b7d('0x2'));var BPromise=require(_0x8b7d('0x3'));var rs=require(_0x8b7d('0x4'));var fs=require('fs');var Redis=require(_0x8b7d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b7d('0x6'));var logger=require(_0x8b7d('0x7'))(_0x8b7d('0x8'));var config=require(_0x8b7d('0x9'));var jayson=require(_0x8b7d('0xa'));var client=jayson[_0x8b7d('0xb')]['http']({'port':0x232a});config['redis']=_[_0x8b7d('0xc')](config[_0x8b7d('0xd')],{'host':_0x8b7d('0xe'),'port':0x18eb});var socket=require(_0x8b7d('0xf'))(new Redis(config[_0x8b7d('0xd')]));require(_0x8b7d('0x10'))[_0x8b7d('0x11')](socket);function respondWithRpcPromise(_0x5dfedb,_0x96c66a,_0x393adb){return new BPromise(function(_0x2205e4,_0x23bdb6){return client[_0x8b7d('0x12')](_0x5dfedb,_0x393adb)[_0x8b7d('0x13')](function(_0x2646e0){logger['info'](_0x8b7d('0x14'),_0x96c66a,_0x8b7d('0x15'));logger['debug'](_0x8b7d('0x16'),_0x96c66a,'request\x20sent',JSON['stringify'](_0x2646e0));if(_0x2646e0['error']){if(_0x2646e0[_0x8b7d('0x17')]['code']===0x1f4){logger['error'](_0x8b7d('0x14'),_0x96c66a,_0x2646e0[_0x8b7d('0x17')]['message']);return _0x23bdb6(_0x2646e0[_0x8b7d('0x17')][_0x8b7d('0x18')]);}logger[_0x8b7d('0x17')]('Dashboard,\x20%s,\x20%s',_0x96c66a,_0x2646e0[_0x8b7d('0x17')][_0x8b7d('0x18')]);return _0x2205e4(_0x2646e0[_0x8b7d('0x17')][_0x8b7d('0x18')]);}else{logger[_0x8b7d('0x19')](_0x8b7d('0x14'),_0x96c66a,_0x8b7d('0x15'));_0x2205e4(_0x2646e0[_0x8b7d('0x1a')][_0x8b7d('0x18')]);}})[_0x8b7d('0x1b')](function(_0x1ccc18){logger['error'](_0x8b7d('0x14'),_0x96c66a,_0x1ccc18);_0x23bdb6(_0x1ccc18);});});} \ No newline at end of file +var _0x0ad8=['debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Dashboard,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','then','info'];(function(_0x523924,_0x143357){var _0x2bdae8=function(_0x440612){while(--_0x440612){_0x523924['push'](_0x523924['shift']());}};_0x2bdae8(++_0x143357);}(_0x0ad8,0x1cb));var _0x80ad=function(_0x1df43c,_0x5f10c7){_0x1df43c=_0x1df43c-0x0;var _0x2f26a2=_0x0ad8[_0x1df43c];return _0x2f26a2;};'use strict';var _=require(_0x80ad('0x0'));var util=require('util');var moment=require(_0x80ad('0x1'));var BPromise=require(_0x80ad('0x2'));var rs=require(_0x80ad('0x3'));var fs=require('fs');var Redis=require(_0x80ad('0x4'));var db=require(_0x80ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x80ad('0x6'))('rpc');var config=require(_0x80ad('0x7'));var jayson=require(_0x80ad('0x8'));var client=jayson['client'][_0x80ad('0x9')]({'port':0x232a});config[_0x80ad('0xa')]=_[_0x80ad('0xb')](config['redis'],{'host':_0x80ad('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80ad('0xa')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x1fd4f7,_0x3ec04a,_0x3a7495){return new BPromise(function(_0xe7fdfe,_0x45b449){return client[_0x80ad('0xd')](_0x1fd4f7,_0x3a7495)[_0x80ad('0xe')](function(_0x1b4edb){logger[_0x80ad('0xf')]('Dashboard,\x20%s,\x20%s',_0x3ec04a,'request\x20sent');logger[_0x80ad('0x10')](_0x80ad('0x11'),_0x3ec04a,_0x80ad('0x12'),JSON['stringify'](_0x1b4edb));if(_0x1b4edb[_0x80ad('0x13')]){if(_0x1b4edb[_0x80ad('0x13')][_0x80ad('0x14')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x3ec04a,_0x1b4edb[_0x80ad('0x13')][_0x80ad('0x15')]);return _0x45b449(_0x1b4edb[_0x80ad('0x13')]['message']);}logger[_0x80ad('0x13')](_0x80ad('0x16'),_0x3ec04a,_0x1b4edb['error'][_0x80ad('0x15')]);return _0xe7fdfe(_0x1b4edb[_0x80ad('0x13')][_0x80ad('0x15')]);}else{logger[_0x80ad('0xf')](_0x80ad('0x16'),_0x3ec04a,_0x80ad('0x12'));_0xe7fdfe(_0x1b4edb[_0x80ad('0x17')][_0x80ad('0x15')]);}})[_0x80ad('0x18')](function(_0x2ef75e){logger[_0x80ad('0x13')](_0x80ad('0x16'),_0x3ec04a,_0x2ef75e);_0x45b449(_0x2ef75e);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index a4f7cc7..a968dae 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 _0xfa3f=['dashboard:','./dashboard.events','remove','update','emit','removeListener','length'];(function(_0x1374bd,_0xb36574){var _0x3c0f54=function(_0x6caa10){while(--_0x6caa10){_0x1374bd['push'](_0x1374bd['shift']());}};_0x3c0f54(++_0xb36574);}(_0xfa3f,0xbe));var _0xffa3=function(_0x265e2c,_0x344ab3){_0x265e2c=_0x265e2c-0x0;var _0x2428a7=_0xfa3f[_0x265e2c];return _0x2428a7;};'use strict';var DashboardEvents=require(_0xffa3('0x0'));var events=['save',_0xffa3('0x1'),_0xffa3('0x2')];function createListener(_0x4a1fd0,_0x23b953){return function(_0x2f53f7){_0x23b953[_0xffa3('0x3')](_0x4a1fd0,_0x2f53f7);};}function removeListener(_0x38347b,_0x26b577){return function(){DashboardEvents[_0xffa3('0x4')](_0x38347b,_0x26b577);};}exports['register']=function(_0x995894){for(var _0x26b238=0x0,_0x2d0c90=events[_0xffa3('0x5')];_0x26b238<_0x2d0c90;_0x26b238++){var _0x9faa51=events[_0x26b238];var _0x254480=createListener(_0xffa3('0x6')+_0x9faa51,_0x995894);DashboardEvents['on'](_0x9faa51,_0x254480);}}; \ No newline at end of file +var _0x50e1=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x50e1,0x1f1));var _0x150e=function(_0x386bb9,_0x42e7d9){_0x386bb9=_0x386bb9-0x0;var _0x1649d9=_0x50e1[_0x386bb9];return _0x1649d9;};'use strict';var DashboardEvents=require(_0x150e('0x0'));var events=[_0x150e('0x1'),_0x150e('0x2'),_0x150e('0x3')];function createListener(_0x11d706,_0x342a1f){return function(_0x5166c7){_0x342a1f[_0x150e('0x4')](_0x11d706,_0x5166c7);};}function removeListener(_0x85f955,_0x10fa7f){return function(){DashboardEvents[_0x150e('0x5')](_0x85f955,_0x10fa7f);};}exports[_0x150e('0x6')]=function(_0x501a4b){for(var _0x3c9db8=0x0,_0x2e438a=events['length'];_0x3c9db8<_0x2e438a;_0x3c9db8++){var _0x590a02=events[_0x3c9db8];var _0x3417db=createListener(_0x150e('0x7')+_0x590a02,_0x501a4b);DashboardEvents['on'](_0x590a02,_0x3417db);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 959e37d..391d85e 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 _0xb508=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update'];(function(_0x5700f5,_0x635a0b){var _0x2c0241=function(_0x3a6a71){while(--_0x3a6a71){_0x5700f5['push'](_0x5700f5['shift']());}};_0x2c0241(++_0x635a0b);}(_0xb508,0x183));var _0x8b50=function(_0x9a0499,_0x16fd2a){_0x9a0499=_0x9a0499-0x0;var _0x3cfb8a=_0xb508[_0x9a0499];return _0x3cfb8a;};'use strict';var multer=require(_0x8b50('0x0'));var util=require(_0x8b50('0x1'));var path=require(_0x8b50('0x2'));var timeout=require('connect-timeout');var express=require(_0x8b50('0x3'));var router=express[_0x8b50('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b50('0x5'));var interaction=require(_0x8b50('0x6'));var config=require(_0x8b50('0x7'));var controller=require(_0x8b50('0x8'));router[_0x8b50('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8b50('0x9')](_0x8b50('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8b50('0x9')]('/:id/items',auth[_0x8b50('0xb')](),controller[_0x8b50('0xc')]);router[_0x8b50('0xd')]('/',auth[_0x8b50('0xb')](),controller[_0x8b50('0xe')]);router[_0x8b50('0xd')](_0x8b50('0xf'),auth[_0x8b50('0xb')](),controller[_0x8b50('0x10')]);router[_0x8b50('0xd')](_0x8b50('0x11'),auth[_0x8b50('0xb')](),controller[_0x8b50('0x12')]);router[_0x8b50('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8b50('0x14')]);router[_0x8b50('0x15')](_0x8b50('0xa'),auth[_0x8b50('0xb')](),controller[_0x8b50('0x16')]);module[_0x8b50('0x17')]=router; \ No newline at end of file +var _0xcdf8=['../../config/environment','./dashboard.controller','get','index','isAuthenticated','show','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1ad20e,_0x335b78){var _0x2c6954=function(_0x5aef44){while(--_0x5aef44){_0x1ad20e['push'](_0x1ad20e['shift']());}};_0x2c6954(++_0x335b78);}(_0xcdf8,0x1bb));var _0x8cdf=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xcdf8[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require('multer');var util=require(_0x8cdf('0x0'));var path=require(_0x8cdf('0x1'));var timeout=require(_0x8cdf('0x2'));var express=require(_0x8cdf('0x3'));var router=express[_0x8cdf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8cdf('0x5'));var interaction=require(_0x8cdf('0x6'));var config=require(_0x8cdf('0x7'));var controller=require(_0x8cdf('0x8'));router[_0x8cdf('0x9')]('/',auth['isAuthenticated'](),controller[_0x8cdf('0xa')]);router['get']('/:id',auth[_0x8cdf('0xb')](),controller[_0x8cdf('0xc')]);router[_0x8cdf('0x9')]('/:id/items',auth['isAuthenticated'](),controller['getItems']);router[_0x8cdf('0xd')]('/',auth[_0x8cdf('0xb')](),controller[_0x8cdf('0xe')]);router[_0x8cdf('0xd')](_0x8cdf('0xf'),auth[_0x8cdf('0xb')](),controller[_0x8cdf('0x10')]);router[_0x8cdf('0xd')](_0x8cdf('0x11'),auth[_0x8cdf('0xb')](),controller[_0x8cdf('0x12')]);router[_0x8cdf('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8cdf('0x14')]);router[_0x8cdf('0x15')](_0x8cdf('0x16'),auth[_0x8cdf('0xb')](),controller[_0x8cdf('0x17')]);module[_0x8cdf('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 3ec9739..827f491 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 _0x2bd8=['TEXT','long','parse','attrs','stringify','setDataValue','INTEGER','sequelize','lodash','exports','STRING'];(function(_0x29341a,_0x1c5359){var _0x3225f1=function(_0x4f295b){while(--_0x4f295b){_0x29341a['push'](_0x29341a['shift']());}};_0x3225f1(++_0x1c5359);}(_0x2bd8,0x130));var _0x82bd=function(_0x1a34c7,_0x30a5c9){_0x1a34c7=_0x1a34c7-0x0;var _0x598aea=_0x2bd8[_0x1a34c7];return _0x598aea;};'use strict';var Sequelize=require(_0x82bd('0x0'));var squel=require('squel');var _=require(_0x82bd('0x1'));module[_0x82bd('0x2')]={'title':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x82bd('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x82bd('0x4')](_0x82bd('0x5')),'get':function(){try{return JSON[_0x82bd('0x6')](this['getDataValue'](_0x82bd('0x7')));}catch(_0x2e1a98){return[];}},'set':function(_0x3bf810){try{this['setDataValue'](_0x82bd('0x7'),JSON[_0x82bd('0x8')](_0x3bf810));}catch(_0x226f60){this[_0x82bd('0x9')]('attrs',JSON[_0x82bd('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x82bd('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x82bd('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x1b090f,_0x15f64a){var _0x37d911=function(_0x17e11e){while(--_0x17e11e){_0x1b090f['push'](_0x1b090f['shift']());}};_0x37d911(++_0x15f64a);}(_0x2ef3,0xba));var _0x32ef=function(_0x24937a,_0x124245){_0x24937a=_0x24937a-0x0;var _0x15679a=_0x2ef3[_0x24937a];return _0x15679a;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'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 48879e6..bd5c85b 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 _0x292c=['attrRefresh','error','widgetAttributes:\x20%s','stringify','body','create','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','redis','localhost','socket.io-emitter','./dashboardItem.socket','status','json','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','sendStatus','name','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','catch','find','params','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','reportType','attrReport'];(function(_0x1ebc4b,_0xef6d40){var _0x394c4f=function(_0x1e4289){while(--_0x1e4289){_0x1ebc4b['push'](_0x1ebc4b['shift']());}};_0x394c4f(++_0xef6d40);}(_0x292c,0x66));var _0xc292=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x292c[_0x2f2360];return _0x1cc8d3;};'use strict';var emlformat=require(_0xc292('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc292('0x1'));var jsonpatch=require(_0xc292('0x2'));var rp=require(_0xc292('0x3'));var moment=require(_0xc292('0x4'));var BPromise=require(_0xc292('0x5'));var Mustache=require('mustache');var util=require(_0xc292('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc292('0x7'));var ejs=require(_0xc292('0x8'));var fs=require('fs');var fs_extra=require(_0xc292('0x9'));var _=require(_0xc292('0xa'));var squel=require(_0xc292('0xb'));var crypto=require(_0xc292('0xc'));var jsforce=require(_0xc292('0xd'));var deskjs=require(_0xc292('0xe'));var toCsv=require(_0xc292('0x7'));var querystring=require(_0xc292('0xf'));var Papa=require('papaparse');var Redis=require(_0xc292('0x10'));var authService=require(_0xc292('0x11'));var qs=require(_0xc292('0x12'));var as=require(_0xc292('0x13'));var hardwareService=require(_0xc292('0x14'));var logger=require('../../config/logger')(_0xc292('0x15'));var utils=require(_0xc292('0x16'));var config=require(_0xc292('0x17'));var licenseUtil=require(_0xc292('0x18'));var db=require(_0xc292('0x19'))['db'];config[_0xc292('0x1a')]=_['defaults'](config[_0xc292('0x1a')],{'host':_0xc292('0x1b'),'port':0x18eb});var socket=require(_0xc292('0x1c'))(new Redis(config[_0xc292('0x1a')]));require(_0xc292('0x1d'))['register'](socket);function respondWithStatusCode(_0x56417e,_0x402c9b){_0x402c9b=_0x402c9b||0xcc;return function(_0x3d03b6){if(_0x3d03b6){return _0x56417e['sendStatus'](_0x402c9b);}return _0x56417e[_0xc292('0x1e')](_0x402c9b)['end']();};}function respondWithResult(_0x5e765a,_0x3f762b){_0x3f762b=_0x3f762b||0xc8;return function(_0x5bde28){if(_0x5bde28){return _0x5e765a[_0xc292('0x1e')](_0x3f762b)[_0xc292('0x1f')](_0x5bde28);}};}function respondWithFilteredResult(_0x18b73b,_0x5c2de4){return function(_0x43128f){if(_0x43128f){var _0x5b3d01=typeof _0x5c2de4['offset']===_0xc292('0x20')&&typeof _0x5c2de4[_0xc292('0x21')]==='undefined';var _0x2a74af=_0x43128f[_0xc292('0x22')];var _0x314f3b=_0x5b3d01?0x0:_0x5c2de4['offset'];var _0x4b7c83=_0x5b3d01?_0x43128f[_0xc292('0x22')]:_0x5c2de4[_0xc292('0x23')]+_0x5c2de4[_0xc292('0x21')];var _0x2493ac;if(_0x4b7c83>=_0x2a74af){_0x4b7c83=_0x2a74af;_0x2493ac=0xc8;}else{_0x2493ac=0xce;}_0x18b73b[_0xc292('0x1e')](_0x2493ac);return _0x18b73b[_0xc292('0x24')](_0xc292('0x25'),_0x314f3b+'-'+_0x4b7c83+'/'+_0x2a74af)[_0xc292('0x1f')](_0x43128f);}return null;};}function patchUpdates(_0x3e638b){return function(_0x51e142){try{jsonpatch['apply'](_0x51e142,_0x3e638b,!![]);}catch(_0x2a1750){return BPromise[_0xc292('0x26')](_0x2a1750);}return _0x51e142['save']();};}function saveUpdates(_0x190aae,_0x7c33dd){return function(_0x351907){if(_0x351907){return _0x351907['update'](_0x190aae)[_0xc292('0x27')](function(_0x342d73){return _0x342d73;});}return null;};}function removeEntity(_0x53040d,_0x4eb30e){return function(_0x46066d){if(_0x46066d){return _0x46066d[_0xc292('0x28')]()['then'](function(){_0x53040d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3933c6,_0x10b77e){return function(_0x49b9fd){if(!_0x49b9fd){_0x3933c6[_0xc292('0x29')](0x194);}return _0x49b9fd;};}function handleError(_0x51a56e,_0x212eb7){_0x212eb7=_0x212eb7||0x1f4;return function(_0x20452e){logger['error'](_0x20452e['stack']);if(_0x20452e[_0xc292('0x2a')]){delete _0x20452e[_0xc292('0x2a')];}_0x51a56e['status'](_0x212eb7)['send'](_0x20452e);};}exports[_0xc292('0x2b')]=function(_0x47e88a,_0x3142d8){var _0xe8a56e={'raw':![],'where':{'id':_0x47e88a['params']['id']}},_0x2f7735={};_0x2f7735[_0xc292('0x2c')]=_[_0xc292('0x2d')](db[_0xc292('0x2e')][_0xc292('0x2f')]);_0x2f7735[_0xc292('0x30')]=_['keys'](_0x47e88a[_0xc292('0x30')]);_0x2f7735[_0xc292('0x31')]=_[_0xc292('0x32')](_0x2f7735[_0xc292('0x2c')],_0x2f7735['query']);_0xe8a56e['attributes']=_[_0xc292('0x32')](_0x2f7735[_0xc292('0x2c')],qs[_0xc292('0x33')](_0x47e88a[_0xc292('0x30')][_0xc292('0x33')]));_0xe8a56e[_0xc292('0x34')]=_0xe8a56e['attributes']['length']?_0xe8a56e[_0xc292('0x34')]:_0x2f7735[_0xc292('0x2c')];if(_0x47e88a['query'][_0xc292('0x35')]){_0xe8a56e[_0xc292('0x36')]=[{'all':!![]}];}_0xe8a56e=_[_0xc292('0x37')]({},_0xe8a56e,_0x47e88a[_0xc292('0x38')]);return db[_0xc292('0x2e')]['find'](_0xe8a56e)[_0xc292('0x27')](handleEntityNotFound(_0x3142d8,null))[_0xc292('0x27')](respondWithResult(_0x3142d8,null))[_0xc292('0x39')](handleError(_0x3142d8,null));};exports[_0xc292('0x28')]=function(_0x1f0d2c,_0x132b42){return db['DashboardItem'][_0xc292('0x3a')]({'where':{'id':_0x1f0d2c[_0xc292('0x3b')]['id']}})[_0xc292('0x27')](handleEntityNotFound(_0x132b42,null))[_0xc292('0x27')](removeEntity(_0x132b42,null))[_0xc292('0x39')](handleError(_0x132b42,null));};function widgetAttributes(_0x5e97c1){try{switch(_0x5e97c1[_0xc292('0x3c')]){case _0xc292('0x3d'):return[{'name':_0xc292('0x3e'),'value':_0x5e97c1[_0xc292('0x3e')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1['attrs'][0x0]?_0x5e97c1['attrs'][0x0][_0xc292('0x40')]:undefined)||_0xc292('0x41')}];case'custom':return[{'name':_0xc292('0x42'),'value':_0x5e97c1[_0xc292('0x42')]||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x0]?_0x5e97c1[_0xc292('0x3f')][0x0]['value']:undefined)||''}];case _0xc292('0x43'):return[{'name':_0xc292('0x44'),'value':_0x5e97c1[_0xc292('0x44')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x0]?_0x5e97c1[_0xc292('0x3f')][0x0]['value']:undefined)||_0xc292('0x45')},{'name':_0xc292('0x46'),'value':_0x5e97c1[_0xc292('0x46')]||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x1]?_0x5e97c1['attrs'][0x1]['value']:undefined)||_0xc292('0x47')},{'name':_0xc292('0x48'),'value':_0x5e97c1[_0xc292('0x48')]||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x2]?_0x5e97c1['attrs'][0x2][_0xc292('0x40')]:undefined)||0xc}];case _0xc292('0x49'):return[{'name':_0xc292('0x4a'),'value':_0x5e97c1['attrMetric']||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x0]?_0x5e97c1[_0xc292('0x3f')][0x0]['value']:undefined)||'total'},{'name':_0xc292('0x4b'),'value':_0x5e97c1[_0xc292('0x4b')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1['attrs'][0x1]?_0x5e97c1[_0xc292('0x3f')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x5e97c1[_0xc292('0x48')]||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x2]?_0x5e97c1['attrs'][0x2][_0xc292('0x40')]:undefined)||0x14},{'name':_0xc292('0x4c'),'value':_0x5e97c1[_0xc292('0x4c')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x3]?_0x5e97c1[_0xc292('0x3f')][0x3]['value']:undefined)||_0xc292('0x4d')},{'name':_0xc292('0x4e'),'value':_0x5e97c1['attrEmailAccounts']||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x4]?_0x5e97c1[_0xc292('0x3f')][0x4][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x4f'),'value':_0x5e97c1[_0xc292('0x4f')]||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x5]?_0x5e97c1[_0xc292('0x3f')][0x5][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x50'),'value':_0x5e97c1[_0xc292('0x50')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x6]?_0x5e97c1[_0xc292('0x3f')][0x6][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x51'),'value':_0x5e97c1[_0xc292('0x51')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x7]?_0x5e97c1[_0xc292('0x3f')][0x7][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x52'),'value':_0x5e97c1['attrWhatsappAccounts']||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x8]?_0x5e97c1[_0xc292('0x3f')][0x8][_0xc292('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5e97c1[_0xc292('0x53')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x9]?_0x5e97c1[_0xc292('0x3f')][0x9][_0xc292('0x40')]:undefined)||''}];case'multibar-chart':case _0xc292('0x54'):return[{'name':'attrSerie1','value':_0x5e97c1[_0xc292('0x55')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x0]?_0x5e97c1[_0xc292('0x3f')][0x0][_0xc292('0x40')]:undefined)||_0xc292('0x56')},{'name':'attrSerie2','value':_0x5e97c1[_0xc292('0x57')]||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x1]?_0x5e97c1[_0xc292('0x3f')][0x1][_0xc292('0x40')]:undefined)||null},{'name':'attrSerie3','value':_0x5e97c1['attrSerie3']||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x2]?_0x5e97c1['attrs'][0x2]['value']:undefined)||null},{'name':_0xc292('0x4b'),'value':_0x5e97c1[_0xc292('0x4b')]||(_0x5e97c1['attrs']&&_0x5e97c1[_0xc292('0x3f')][0x3]?_0x5e97c1['attrs'][0x3][_0xc292('0x40')]:undefined)||[]},{'name':_0xc292('0x4c'),'value':_0x5e97c1[_0xc292('0x4c')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x4]?_0x5e97c1['attrs'][0x4]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x5e97c1['attrEmailAccounts']||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x5]?_0x5e97c1['attrs'][0x5][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x4f'),'value':_0x5e97c1[_0xc292('0x4f')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x6]?_0x5e97c1[_0xc292('0x3f')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x5e97c1[_0xc292('0x50')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1['attrs'][0x7]?_0x5e97c1[_0xc292('0x3f')][0x7][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x51'),'value':_0x5e97c1[_0xc292('0x51')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x8]?_0x5e97c1[_0xc292('0x3f')][0x8][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x52'),'value':_0x5e97c1['attrWhatsappAccounts']||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x9]?_0x5e97c1[_0xc292('0x3f')][0x9][_0xc292('0x40')]:undefined)||''},{'name':_0xc292('0x53'),'value':_0x5e97c1[_0xc292('0x53')]||(_0x5e97c1['attrs']&&_0x5e97c1['attrs'][0xa]?_0x5e97c1[_0xc292('0x3f')][0xa][_0xc292('0x40')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x5e97c1[_0xc292('0x58')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1['attrs'][0x0]?_0x5e97c1[_0xc292('0x3f')][0x0][_0xc292('0x3c')]:undefined)||null,'value':_0x5e97c1[_0xc292('0x59')]||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x0]?_0x5e97c1[_0xc292('0x3f')][0x0][_0xc292('0x40')]:undefined)||null},{'name':_0xc292('0x5a'),'value':_0x5e97c1['attrRefresh']||(_0x5e97c1[_0xc292('0x3f')]&&_0x5e97c1[_0xc292('0x3f')][0x1]?_0x5e97c1[_0xc292('0x3f')][0x1][_0xc292('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x444f5c){logger[_0xc292('0x5b')](_0xc292('0x5c'),JSON[_0xc292('0x5d')](_0x444f5c));return[];}}exports['create']=function(_0x5c8654,_0x73fe31){if(_0x5c8654[_0xc292('0x5e')]){_0x5c8654[_0xc292('0x5e')][_0xc292('0x3f')]=widgetAttributes(_0x5c8654['body']);}return db[_0xc292('0x2e')][_0xc292('0x5f')](_0x5c8654[_0xc292('0x5e')],{})[_0xc292('0x27')](respondWithResult(_0x73fe31,0xc9))[_0xc292('0x39')](handleError(_0x73fe31,null));};exports['update']=function(_0x8a8678,_0xa6ec10){if(_0x8a8678[_0xc292('0x5e')]['id']){delete _0x8a8678[_0xc292('0x5e')]['id'];}_0x8a8678[_0xc292('0x5e')][_0xc292('0x3f')]=widgetAttributes(_0x8a8678[_0xc292('0x5e')]);return db['DashboardItem'][_0xc292('0x3a')]({'where':{'id':_0x8a8678[_0xc292('0x3b')]['id']}})[_0xc292('0x27')](handleEntityNotFound(_0xa6ec10,null))['then'](saveUpdates(_0x8a8678[_0xc292('0x5e')],null))[_0xc292('0x27')](respondWithResult(_0xa6ec10,null))[_0xc292('0x39')](handleError(_0xa6ec10,null));}; \ No newline at end of file +var _0x018c=['attrOpenchannelAccounts','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3'];(function(_0x35e04e,_0x2cc788){var _0x14de9e=function(_0x4f784b){while(--_0x4f784b){_0x35e04e['push'](_0x35e04e['shift']());}};_0x14de9e(++_0x2cc788);}(_0x018c,0xda));var _0xc018=function(_0x2c6bc8,_0x2b5f79){_0x2c6bc8=_0x2c6bc8-0x0;var _0x59007e=_0x018c[_0x2c6bc8];return _0x59007e;};'use strict';var emlformat=require(_0xc018('0x0'));var rimraf=require(_0xc018('0x1'));var zipdir=require(_0xc018('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc018('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc018('0x4'));var util=require(_0xc018('0x5'));var path=require(_0xc018('0x6'));var sox=require(_0xc018('0x7'));var csv=require('to-csv');var ejs=require(_0xc018('0x8'));var fs=require('fs');var fs_extra=require(_0xc018('0x9'));var _=require(_0xc018('0xa'));var squel=require(_0xc018('0xb'));var crypto=require(_0xc018('0xc'));var jsforce=require(_0xc018('0xd'));var deskjs=require(_0xc018('0xe'));var toCsv=require(_0xc018('0xf'));var querystring=require(_0xc018('0x10'));var Papa=require(_0xc018('0x11'));var Redis=require(_0xc018('0x12'));var authService=require(_0xc018('0x13'));var qs=require(_0xc018('0x14'));var as=require(_0xc018('0x15'));var hardwareService=require(_0xc018('0x16'));var logger=require(_0xc018('0x17'))(_0xc018('0x18'));var utils=require(_0xc018('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc018('0x1a'));var db=require('../../mysqldb')['db'];config[_0xc018('0x1b')]=_[_0xc018('0x1c')](config[_0xc018('0x1b')],{'host':_0xc018('0x1d'),'port':0x18eb});var socket=require(_0xc018('0x1e'))(new Redis(config[_0xc018('0x1b')]));require(_0xc018('0x1f'))[_0xc018('0x20')](socket);function respondWithStatusCode(_0x316d7f,_0x380bbd){_0x380bbd=_0x380bbd||0xcc;return function(_0x30d6cb){if(_0x30d6cb){return _0x316d7f['sendStatus'](_0x380bbd);}return _0x316d7f[_0xc018('0x21')](_0x380bbd)[_0xc018('0x22')]();};}function respondWithResult(_0x21b840,_0x3a07f8){_0x3a07f8=_0x3a07f8||0xc8;return function(_0x70a0fd){if(_0x70a0fd){return _0x21b840[_0xc018('0x21')](_0x3a07f8)[_0xc018('0x23')](_0x70a0fd);}};}function respondWithFilteredResult(_0x2a157d,_0x550652){return function(_0x5f2c11){if(_0x5f2c11){var _0xe5f2fe=typeof _0x550652['offset']===_0xc018('0x24')&&typeof _0x550652[_0xc018('0x25')]===_0xc018('0x24');var _0x4a7380=_0x5f2c11[_0xc018('0x26')];var _0x24ee89=_0xe5f2fe?0x0:_0x550652[_0xc018('0x27')];var _0x580abf=_0xe5f2fe?_0x5f2c11[_0xc018('0x26')]:_0x550652[_0xc018('0x27')]+_0x550652[_0xc018('0x25')];var _0x428a57;if(_0x580abf>=_0x4a7380){_0x580abf=_0x4a7380;_0x428a57=0xc8;}else{_0x428a57=0xce;}_0x2a157d[_0xc018('0x21')](_0x428a57);return _0x2a157d[_0xc018('0x28')](_0xc018('0x29'),_0x24ee89+'-'+_0x580abf+'/'+_0x4a7380)[_0xc018('0x23')](_0x5f2c11);}return null;};}function patchUpdates(_0x991e64){return function(_0x2576b8){try{jsonpatch[_0xc018('0x2a')](_0x2576b8,_0x991e64,!![]);}catch(_0x117346){return BPromise[_0xc018('0x2b')](_0x117346);}return _0x2576b8[_0xc018('0x2c')]();};}function saveUpdates(_0x41b7da,_0x208521){return function(_0x37e6d4){if(_0x37e6d4){return _0x37e6d4[_0xc018('0x2d')](_0x41b7da)[_0xc018('0x2e')](function(_0x68871){return _0x68871;});}return null;};}function removeEntity(_0x5bb786,_0x365eb2){return function(_0x83a279){if(_0x83a279){return _0x83a279[_0xc018('0x2f')]()[_0xc018('0x2e')](function(){_0x5bb786['status'](0xcc)[_0xc018('0x22')]();});}};}function handleEntityNotFound(_0x46fd6a,_0x2dc832){return function(_0x509bc0){if(!_0x509bc0){_0x46fd6a['sendStatus'](0x194);}return _0x509bc0;};}function handleError(_0x35c356,_0x1457e1){_0x1457e1=_0x1457e1||0x1f4;return function(_0x4aa577){logger['error'](_0x4aa577[_0xc018('0x30')]);if(_0x4aa577[_0xc018('0x31')]){delete _0x4aa577[_0xc018('0x31')];}_0x35c356['status'](_0x1457e1)[_0xc018('0x32')](_0x4aa577);};}exports[_0xc018('0x33')]=function(_0x11c53e,_0x2e8fcd){var _0x34ea58={'raw':![],'where':{'id':_0x11c53e[_0xc018('0x34')]['id']}},_0x34fdf4={};_0x34fdf4[_0xc018('0x35')]=_[_0xc018('0x36')](db[_0xc018('0x37')][_0xc018('0x38')]);_0x34fdf4[_0xc018('0x39')]=_[_0xc018('0x36')](_0x11c53e[_0xc018('0x39')]);_0x34fdf4['filters']=_[_0xc018('0x3a')](_0x34fdf4[_0xc018('0x35')],_0x34fdf4[_0xc018('0x39')]);_0x34ea58[_0xc018('0x3b')]=_[_0xc018('0x3a')](_0x34fdf4[_0xc018('0x35')],qs[_0xc018('0x3c')](_0x11c53e[_0xc018('0x39')][_0xc018('0x3c')]));_0x34ea58[_0xc018('0x3b')]=_0x34ea58[_0xc018('0x3b')][_0xc018('0x3d')]?_0x34ea58[_0xc018('0x3b')]:_0x34fdf4[_0xc018('0x35')];if(_0x11c53e['query'][_0xc018('0x3e')]){_0x34ea58[_0xc018('0x3f')]=[{'all':!![]}];}_0x34ea58=_[_0xc018('0x40')]({},_0x34ea58,_0x11c53e[_0xc018('0x41')]);return db[_0xc018('0x37')][_0xc018('0x42')](_0x34ea58)[_0xc018('0x2e')](handleEntityNotFound(_0x2e8fcd,null))[_0xc018('0x2e')](respondWithResult(_0x2e8fcd,null))[_0xc018('0x43')](handleError(_0x2e8fcd,null));};exports[_0xc018('0x2f')]=function(_0x44388e,_0x43e09d){return db['DashboardItem'][_0xc018('0x42')]({'where':{'id':_0x44388e[_0xc018('0x34')]['id']}})[_0xc018('0x2e')](handleEntityNotFound(_0x43e09d,null))[_0xc018('0x2e')](removeEntity(_0x43e09d,null))[_0xc018('0x43')](handleError(_0x43e09d,null));};function widgetAttributes(_0x1c16bb){try{switch(_0x1c16bb[_0xc018('0x44')]){case _0xc018('0x45'):return[{'name':_0xc018('0x46'),'value':_0x1c16bb[_0xc018('0x46')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x0]?_0x1c16bb[_0xc018('0x47')][0x0][_0xc018('0x48')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x1c16bb[_0xc018('0x49')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x0]?_0x1c16bb['attrs'][0x0][_0xc018('0x48')]:undefined)||''}];case _0xc018('0x4a'):return[{'name':_0xc018('0x4b'),'value':_0x1c16bb['attrHourFormat']||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x0]?_0x1c16bb['attrs'][0x0][_0xc018('0x48')]:undefined)||'HH:mm:ss'},{'name':_0xc018('0x4c'),'value':_0x1c16bb[_0xc018('0x4c')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x1]?_0x1c16bb[_0xc018('0x47')][0x1][_0xc018('0x48')]:undefined)||_0xc018('0x4d')},{'name':_0xc018('0x4e'),'value':_0x1c16bb['attrFontSize']||(_0x1c16bb['attrs']&&_0x1c16bb[_0xc018('0x47')][0x2]?_0x1c16bb[_0xc018('0x47')][0x2][_0xc018('0x48')]:undefined)||0xc}];case'counter':return[{'name':_0xc018('0x4f'),'value':_0x1c16bb[_0xc018('0x4f')]||(_0x1c16bb['attrs']&&_0x1c16bb[_0xc018('0x47')][0x0]?_0x1c16bb[_0xc018('0x47')][0x0][_0xc018('0x48')]:undefined)||_0xc018('0x50')},{'name':_0xc018('0x51'),'value':_0x1c16bb[_0xc018('0x51')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb['attrs'][0x1]?_0x1c16bb['attrs'][0x1][_0xc018('0x48')]:undefined)||[]},{'name':_0xc018('0x4e'),'value':_0x1c16bb['attrFontSize']||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x2]?_0x1c16bb[_0xc018('0x47')][0x2]['value']:undefined)||0x14},{'name':_0xc018('0x52'),'value':_0x1c16bb[_0xc018('0x52')]||(_0x1c16bb['attrs']&&_0x1c16bb[_0xc018('0x47')][0x3]?_0x1c16bb[_0xc018('0x47')][0x3][_0xc018('0x48')]:undefined)||_0xc018('0x53')},{'name':_0xc018('0x54'),'value':_0x1c16bb[_0xc018('0x54')]||(_0x1c16bb['attrs']&&_0x1c16bb[_0xc018('0x47')][0x4]?_0x1c16bb[_0xc018('0x47')][0x4][_0xc018('0x48')]:undefined)||''},{'name':_0xc018('0x55'),'value':_0x1c16bb['attrFaxAccounts']||(_0x1c16bb['attrs']&&_0x1c16bb['attrs'][0x5]?_0x1c16bb['attrs'][0x5]['value']:undefined)||''},{'name':_0xc018('0x56'),'value':_0x1c16bb[_0xc018('0x56')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x6]?_0x1c16bb[_0xc018('0x47')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1c16bb['attrOpenchannelAccounts']||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x7]?_0x1c16bb[_0xc018('0x47')][0x7][_0xc018('0x48')]:undefined)||''},{'name':_0xc018('0x57'),'value':_0x1c16bb['attrWhatsappAccounts']||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x8]?_0x1c16bb[_0xc018('0x47')][0x8][_0xc018('0x48')]:undefined)||''},{'name':_0xc018('0x58'),'value':_0x1c16bb[_0xc018('0x58')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x9]?_0x1c16bb['attrs'][0x9]['value']:undefined)||''}];case _0xc018('0x59'):case _0xc018('0x5a'):return[{'name':_0xc018('0x5b'),'value':_0x1c16bb[_0xc018('0x5b')]||(_0x1c16bb['attrs']&&_0x1c16bb['attrs'][0x0]?_0x1c16bb[_0xc018('0x47')][0x0][_0xc018('0x48')]:undefined)||_0xc018('0x50')},{'name':_0xc018('0x5c'),'value':_0x1c16bb['attrSerie2']||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x1]?_0x1c16bb[_0xc018('0x47')][0x1][_0xc018('0x48')]:undefined)||null},{'name':'attrSerie3','value':_0x1c16bb[_0xc018('0x5d')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x2]?_0x1c16bb[_0xc018('0x47')][0x2][_0xc018('0x48')]:undefined)||null},{'name':_0xc018('0x51'),'value':_0x1c16bb[_0xc018('0x51')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb['attrs'][0x3]?_0x1c16bb[_0xc018('0x47')][0x3]['value']:undefined)||[]},{'name':_0xc018('0x52'),'value':_0x1c16bb[_0xc018('0x52')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x4]?_0x1c16bb[_0xc018('0x47')][0x4][_0xc018('0x48')]:undefined)||_0xc018('0x53')},{'name':_0xc018('0x54'),'value':_0x1c16bb['attrEmailAccounts']||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x5]?_0x1c16bb[_0xc018('0x47')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x1c16bb[_0xc018('0x55')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x6]?_0x1c16bb[_0xc018('0x47')][0x6][_0xc018('0x48')]:undefined)||''},{'name':_0xc018('0x56'),'value':_0x1c16bb[_0xc018('0x56')]||(_0x1c16bb['attrs']&&_0x1c16bb[_0xc018('0x47')][0x7]?_0x1c16bb['attrs'][0x7][_0xc018('0x48')]:undefined)||''},{'name':_0xc018('0x5e'),'value':_0x1c16bb[_0xc018('0x5e')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x8]?_0x1c16bb[_0xc018('0x47')][0x8][_0xc018('0x48')]:undefined)||''},{'name':_0xc018('0x57'),'value':_0x1c16bb[_0xc018('0x57')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb['attrs'][0x9]?_0x1c16bb['attrs'][0x9]['value']:undefined)||''},{'name':_0xc018('0x58'),'value':_0x1c16bb[_0xc018('0x58')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0xa]?_0x1c16bb[_0xc018('0x47')][0xa][_0xc018('0x48')]:undefined)||''}];case _0xc018('0x5f'):return[{'name':_0xc018('0x60'),'type':_0x1c16bb[_0xc018('0x61')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x0]?_0x1c16bb[_0xc018('0x47')][0x0][_0xc018('0x44')]:undefined)||null,'value':_0x1c16bb[_0xc018('0x60')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x0]?_0x1c16bb['attrs'][0x0][_0xc018('0x48')]:undefined)||null},{'name':_0xc018('0x62'),'value':_0x1c16bb[_0xc018('0x62')]||(_0x1c16bb[_0xc018('0x47')]&&_0x1c16bb[_0xc018('0x47')][0x1]?_0x1c16bb[_0xc018('0x47')][0x1][_0xc018('0x48')]:undefined)||0x0}];default:return[];}}catch(_0x5567a5){logger[_0xc018('0x63')](_0xc018('0x64'),JSON[_0xc018('0x65')](_0x5567a5));return[];}}exports[_0xc018('0x66')]=function(_0x17514c,_0xf98923){if(_0x17514c['body']){_0x17514c[_0xc018('0x67')]['attrs']=widgetAttributes(_0x17514c[_0xc018('0x67')]);}return db['DashboardItem']['create'](_0x17514c[_0xc018('0x67')],{})['then'](respondWithResult(_0xf98923,0xc9))[_0xc018('0x43')](handleError(_0xf98923,null));};exports['update']=function(_0x173c03,_0x3a8ed0){if(_0x173c03[_0xc018('0x67')]['id']){delete _0x173c03[_0xc018('0x67')]['id'];}_0x173c03[_0xc018('0x67')]['attrs']=widgetAttributes(_0x173c03['body']);return db[_0xc018('0x37')][_0xc018('0x42')]({'where':{'id':_0x173c03[_0xc018('0x34')]['id']}})[_0xc018('0x2e')](handleEntityNotFound(_0x3a8ed0,null))[_0xc018('0x2e')](saveUpdates(_0x173c03['body'],null))['then'](respondWithResult(_0x3a8ed0,null))[_0xc018('0x43')](handleError(_0x3a8ed0,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f63424d..5fb3c0c 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 _0x07be=['DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x517e33,_0x380066){var _0x232bff=function(_0x10e7cd){while(--_0x10e7cd){_0x517e33['push'](_0x517e33['shift']());}};_0x232bff(++_0x380066);}(_0x07be,0x8a));var _0xe07b=function(_0x4bfb09,_0x1d2020){_0x4bfb09=_0x4bfb09-0x0;var _0x548184=_0x07be[_0x4bfb09];return _0x548184;};'use strict';var EventEmitter=require(_0xe07b('0x0'));var DashboardItem=require(_0xe07b('0x1'))['db'][_0xe07b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xe07b('0x3')](0x0);var events={'afterCreate':_0xe07b('0x4'),'afterUpdate':_0xe07b('0x5'),'afterDestroy':_0xe07b('0x6')};function emitEvent(_0x3e5963){return function(_0x5d41ba,_0x2aaa05,_0x361b82){DashboardItemEvents[_0xe07b('0x7')](_0x3e5963+':'+_0x5d41ba['id'],_0x5d41ba);DashboardItemEvents[_0xe07b('0x7')](_0x3e5963,_0x5d41ba);_0x361b82(null);};}for(var e in events){if(events[_0xe07b('0x8')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xe07b('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x9d9a=['emit','hasOwnProperty','exports','events','DashboardItem','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d9a,0x15b));var _0xa9d9=function(_0x40a51a,_0x51f669){_0x40a51a=_0x40a51a-0x0;var _0x7d69f0=_0x9d9a[_0x40a51a];return _0x7d69f0;};'use strict';var EventEmitter=require(_0xa9d9('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xa9d9('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa9d9('0x2'),'afterUpdate':_0xa9d9('0x3'),'afterDestroy':_0xa9d9('0x4')};function emitEvent(_0x41d1e9){return function(_0x355bb9,_0x5cc201,_0x1a7264){DashboardItemEvents[_0xa9d9('0x5')](_0x41d1e9+':'+_0x355bb9['id'],_0x355bb9);DashboardItemEvents[_0xa9d9('0x5')](_0x41d1e9,_0x355bb9);_0x1a7264(null);};}for(var e in events){if(events[_0xa9d9('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xa9d9('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 36258de..1ec818a 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 _0x663c=['path','rimraf','../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x185d97,_0x369d31){var _0x4aa479=function(_0xedd6f5){while(--_0xedd6f5){_0x185d97['push'](_0x185d97['shift']());}};_0x4aa479(++_0x369d31);}(_0x663c,0x1ef));var _0xc663=function(_0x2e767e,_0x591c30){_0x2e767e=_0x2e767e-0x0;var _0x539d6c=_0x663c[_0x2e767e];return _0x539d6c;};'use strict';var _=require(_0xc663('0x0'));var util=require('util');var logger=require(_0xc663('0x1'))(_0xc663('0x2'));var moment=require(_0xc663('0x3'));var BPromise=require(_0xc663('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc663('0x5'));var rimraf=require(_0xc663('0x6'));var config=require(_0xc663('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xc663('0x8')]=function(_0x38113a,_0x107b1c){return _0x38113a[_0xc663('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd3a=['DashboardItem','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','define'];(function(_0x5941f8,_0x4aee3e){var _0xb94b96=function(_0x16ae07){while(--_0x16ae07){_0x5941f8['push'](_0x5941f8['shift']());}};_0xb94b96(++_0x4aee3e);}(_0xfd3a,0xb1));var _0xafd3=function(_0x2acb77,_0x272b50){_0x2acb77=_0x2acb77-0x0;var _0x11c4ad=_0xfd3a[_0x2acb77];return _0x11c4ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xafd3('0x0'))('api');var moment=require('moment');var BPromise=require(_0xafd3('0x1'));var rp=require(_0xafd3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafd3('0x3'));var config=require(_0xafd3('0x4'));var attributes=require(_0xafd3('0x5'));module['exports']=function(_0x1f9fd9,_0xbe660e){return _0x1f9fd9[_0xafd3('0x6')](_0xafd3('0x7'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 5b8319e..e03e142 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 _0x580c=['http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','request\x20sent','error','DashboardItem,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise'];(function(_0x50b295,_0x420eaf){var _0x230324=function(_0x2c015d){while(--_0x2c015d){_0x50b295['push'](_0x50b295['shift']());}};_0x230324(++_0x420eaf);}(_0x580c,0x133));var _0xc580=function(_0x263b70,_0xf43e00){_0x263b70=_0x263b70-0x0;var _0x14bbd1=_0x580c[_0x263b70];return _0x14bbd1;};'use strict';var _=require(_0xc580('0x0'));var util=require(_0xc580('0x1'));var moment=require(_0xc580('0x2'));var BPromise=require(_0xc580('0x3'));var rs=require(_0xc580('0x4'));var fs=require('fs');var Redis=require(_0xc580('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc580('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc580('0x7'));var client=jayson['client'][_0xc580('0x8')]({'port':0x232a});config[_0xc580('0x9')]=_[_0xc580('0xa')](config['redis'],{'host':_0xc580('0xb'),'port':0x18eb});var socket=require(_0xc580('0xc'))(new Redis(config[_0xc580('0x9')]));require(_0xc580('0xd'))[_0xc580('0xe')](socket);function respondWithRpcPromise(_0x59eb56,_0x5a377a,_0x4ed709){return new BPromise(function(_0x4dd87d,_0x4fec65){return client['request'](_0x59eb56,_0x4ed709)[_0xc580('0xf')](function(_0x522216){logger[_0xc580('0x10')]('DashboardItem,\x20%s,\x20%s',_0x5a377a,'request\x20sent');logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5a377a,_0xc580('0x11'),JSON['stringify'](_0x522216));if(_0x522216['error']){if(_0x522216[_0xc580('0x12')]['code']===0x1f4){logger['error'](_0xc580('0x13'),_0x5a377a,_0x522216['error'][_0xc580('0x14')]);return _0x4fec65(_0x522216['error'][_0xc580('0x14')]);}logger['error'](_0xc580('0x13'),_0x5a377a,_0x522216[_0xc580('0x12')][_0xc580('0x14')]);return _0x4dd87d(_0x522216[_0xc580('0x12')]['message']);}else{logger['info'](_0xc580('0x13'),_0x5a377a,_0xc580('0x11'));_0x4dd87d(_0x522216['result']['message']);}})['catch'](function(_0x70afab){logger[_0xc580('0x12')](_0xc580('0x13'),_0x5a377a,_0x70afab);_0x4fec65(_0x70afab);});});} \ No newline at end of file +var _0x6e9b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4d8e42,_0x2a0161){var _0x84aa76=function(_0x5750da){while(--_0x5750da){_0x4d8e42['push'](_0x4d8e42['shift']());}};_0x84aa76(++_0x2a0161);}(_0x6e9b,0x1a2));var _0xb6e9=function(_0x26a439,_0x4dd1a5){_0x26a439=_0x26a439-0x0;var _0x1efab3=_0x6e9b[_0x26a439];return _0x1efab3;};'use strict';var _=require(_0xb6e9('0x0'));var util=require(_0xb6e9('0x1'));var moment=require('moment');var BPromise=require(_0xb6e9('0x2'));var rs=require(_0xb6e9('0x3'));var fs=require('fs');var Redis=require(_0xb6e9('0x4'));var db=require(_0xb6e9('0x5'))['db'];var utils=require(_0xb6e9('0x6'));var logger=require(_0xb6e9('0x7'))(_0xb6e9('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6e9('0x9'));var client=jayson[_0xb6e9('0xa')][_0xb6e9('0xb')]({'port':0x232a});config[_0xb6e9('0xc')]=_[_0xb6e9('0xd')](config[_0xb6e9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6e9('0xc')]));require(_0xb6e9('0xe'))['register'](socket);function respondWithRpcPromise(_0x410c99,_0x2f9afa,_0x1d92b0){return new BPromise(function(_0x3c8c1a,_0xa13de2){return client[_0xb6e9('0xf')](_0x410c99,_0x1d92b0)[_0xb6e9('0x10')](function(_0x1232bc){logger[_0xb6e9('0x11')](_0xb6e9('0x12'),_0x2f9afa,_0xb6e9('0x13'));logger[_0xb6e9('0x14')](_0xb6e9('0x15'),_0x2f9afa,'request\x20sent',JSON[_0xb6e9('0x16')](_0x1232bc));if(_0x1232bc[_0xb6e9('0x17')]){if(_0x1232bc[_0xb6e9('0x17')][_0xb6e9('0x18')]===0x1f4){logger[_0xb6e9('0x17')](_0xb6e9('0x12'),_0x2f9afa,_0x1232bc[_0xb6e9('0x17')][_0xb6e9('0x19')]);return _0xa13de2(_0x1232bc[_0xb6e9('0x17')][_0xb6e9('0x19')]);}logger[_0xb6e9('0x17')](_0xb6e9('0x12'),_0x2f9afa,_0x1232bc[_0xb6e9('0x17')][_0xb6e9('0x19')]);return _0x3c8c1a(_0x1232bc[_0xb6e9('0x17')][_0xb6e9('0x19')]);}else{logger[_0xb6e9('0x11')](_0xb6e9('0x12'),_0x2f9afa,_0xb6e9('0x13'));_0x3c8c1a(_0x1232bc[_0xb6e9('0x1a')][_0xb6e9('0x19')]);}})[_0xb6e9('0x1b')](function(_0x1ef5f4){logger['error'](_0xb6e9('0x12'),_0x2f9afa,_0x1ef5f4);_0xa13de2(_0x1ef5f4);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7a5a09a..af40df1 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 _0xb331=['save','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x2e9e5e,_0x39b7b6){var _0x534e41=function(_0x1aa1f0){while(--_0x1aa1f0){_0x2e9e5e['push'](_0x2e9e5e['shift']());}};_0x534e41(++_0x39b7b6);}(_0xb331,0xd9));var _0x1b33=function(_0x44cc4a,_0x1330cb){_0x44cc4a=_0x44cc4a-0x0;var _0x391c1a=_0xb331[_0x44cc4a];return _0x391c1a;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x1b33('0x0'),'remove',_0x1b33('0x1')];function createListener(_0x2785ed,_0x18b8b9){return function(_0x2549ff){_0x18b8b9[_0x1b33('0x2')](_0x2785ed,_0x2549ff);};}function removeListener(_0x5736f8,_0x2b6282){return function(){DashboardItemEvents[_0x1b33('0x3')](_0x5736f8,_0x2b6282);};}exports[_0x1b33('0x4')]=function(_0x5257f8){for(var _0x3d0a2e=0x0,_0x444c7a=events[_0x1b33('0x5')];_0x3d0a2e<_0x444c7a;_0x3d0a2e++){var _0x1c91d3=events[_0x3d0a2e];var _0x476abb=createListener(_0x1b33('0x6')+_0x1c91d3,_0x5257f8);DashboardItemEvents['on'](_0x1c91d3,_0x476abb);}}; \ No newline at end of file +var _0x59a2=['update','register','length','dashboardItem:','remove'];(function(_0x19a4b6,_0x5b2ffd){var _0xde82b4=function(_0x180341){while(--_0x180341){_0x19a4b6['push'](_0x19a4b6['shift']());}};_0xde82b4(++_0x5b2ffd);}(_0x59a2,0x77));var _0x259a=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0x59a2[_0x38c0b2];return _0x283c00;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x259a('0x0'),_0x259a('0x1')];function createListener(_0x89f6d,_0x564e45){return function(_0x2a1d29){_0x564e45['emit'](_0x89f6d,_0x2a1d29);};}function removeListener(_0x242b91,_0x5c4828){return function(){DashboardItemEvents['removeListener'](_0x242b91,_0x5c4828);};}exports[_0x259a('0x2')]=function(_0x254efd){for(var _0x4bf40e=0x0,_0xeb865b=events[_0x259a('0x3')];_0x4bf40e<_0xeb865b;_0x4bf40e++){var _0x9c0a7c=events[_0x4bf40e];var _0x5c63e4=createListener(_0x259a('0x4')+_0x9c0a7c,_0x254efd);DashboardItemEvents['on'](_0x9c0a7c,_0x5c63e4);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5067df3..520dcee 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 _0x79f4=['post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show'];(function(_0x458172,_0x15c780){var _0x14aba1=function(_0x3976a7){while(--_0x3976a7){_0x458172['push'](_0x458172['shift']());}};_0x14aba1(++_0x15c780);}(_0x79f4,0x149));var _0x479f=function(_0x237d48,_0x132009){_0x237d48=_0x237d48-0x0;var _0x445b9c=_0x79f4[_0x237d48];return _0x445b9c;};'use strict';var multer=require(_0x479f('0x0'));var util=require('util');var path=require(_0x479f('0x1'));var timeout=require(_0x479f('0x2'));var express=require(_0x479f('0x3'));var router=express[_0x479f('0x4')]();var fs_extra=require(_0x479f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x479f('0x6'));var config=require(_0x479f('0x7'));var controller=require('./dashboardItem.controller');router['get'](_0x479f('0x8'),auth[_0x479f('0x9')](),controller[_0x479f('0xa')]);router[_0x479f('0xb')]('/',auth[_0x479f('0x9')](),controller[_0x479f('0xc')]);router['put']('/:id',auth[_0x479f('0x9')](),controller[_0x479f('0xd')]);router[_0x479f('0xe')]('/:id',auth[_0x479f('0x9')](),controller[_0x479f('0xf')]);module[_0x479f('0x10')]=router; \ No newline at end of file +var _0xabed=['../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x592ca6,_0x211b08){var _0x6c71c3=function(_0x316a33){while(--_0x316a33){_0x592ca6['push'](_0x592ca6['shift']());}};_0x6c71c3(++_0x211b08);}(_0xabed,0x118));var _0xdabe=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0xabed[_0x3ec1da];return _0x472358;};'use strict';var multer=require(_0xdabe('0x0'));var util=require(_0xdabe('0x1'));var path=require(_0xdabe('0x2'));var timeout=require(_0xdabe('0x3'));var express=require('express');var router=express[_0xdabe('0x4')]();var fs_extra=require(_0xdabe('0x5'));var auth=require(_0xdabe('0x6'));var interaction=require(_0xdabe('0x7'));var config=require(_0xdabe('0x8'));var controller=require(_0xdabe('0x9'));router[_0xdabe('0xa')](_0xdabe('0xb'),auth[_0xdabe('0xc')](),controller['show']);router[_0xdabe('0xd')]('/',auth[_0xdabe('0xc')](),controller['create']);router[_0xdabe('0xe')](_0xdabe('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xdabe('0xf')](_0xdabe('0xb'),auth[_0xdabe('0xc')](),controller[_0xdabe('0x10')]);module[_0xdabe('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 547a073..b29b0f9 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 _0xd20c=['third','exports','STRING','second'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xd20c,0x1e9));var _0xcd20=function(_0x3b79db,_0x584735){_0x3b79db=_0x3b79db-0x0;var _0x229695=_0xd20c[_0x3b79db];return _0x229695;};'use strict';var Sequelize=require('sequelize');module[_0xcd20('0x0')]={'name':{'type':Sequelize[_0xcd20('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0xcd20('0x2'),_0xcd20('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xcd20('0x1')]}}; \ No newline at end of file +var _0x0754=['sequelize','STRING','ENUM','first','second'];(function(_0x246f80,_0x595249){var _0x2491be=function(_0x11d7a4){while(--_0x11d7a4){_0x246f80['push'](_0x246f80['shift']());}};_0x2491be(++_0x595249);}(_0x0754,0x109));var _0x4075=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x0754[_0x22377a];return _0x36f105;};'use strict';var Sequelize=require(_0x4075('0x0'));module['exports']={'name':{'type':Sequelize[_0x4075('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x4075('0x2')](_0x4075('0x3'),_0x4075('0x4'),'third'),'allowNull':![],'defaultValue':_0x4075('0x3')},'description':{'type':Sequelize[_0x4075('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 0909a36..e048bdd 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 _0xdbcd=['desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','Dispositions','UserProfileResource','then','stack','name','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','util','path','fs-extra'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdbcd,0x1ba));var _0xddbc=function(_0x2f33a4,_0x2faae){_0x2f33a4=_0x2f33a4-0x0;var _0x368c71=_0xdbcd[_0x2f33a4];return _0x368c71;};'use strict';var emlformat=require(_0xddbc('0x0'));var rimraf=require(_0xddbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xddbc('0x2'));var moment=require(_0xddbc('0x3'));var BPromise=require(_0xddbc('0x4'));var Mustache=require('mustache');var util=require(_0xddbc('0x5'));var path=require(_0xddbc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddbc('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xddbc('0x8'));var toCsv=require(_0xddbc('0x9'));var querystring=require(_0xddbc('0xa'));var Papa=require(_0xddbc('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xddbc('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddbc('0xd'));var logger=require('../../config/logger')(_0xddbc('0xe'));var utils=require(_0xddbc('0xf'));var config=require(_0xddbc('0x10'));var licenseUtil=require(_0xddbc('0x11'));var db=require(_0xddbc('0x12'))['db'];function respondWithStatusCode(_0x3fb6bb,_0x2e0a84){_0x2e0a84=_0x2e0a84||0xcc;return function(_0x4754ca){if(_0x4754ca){return _0x3fb6bb[_0xddbc('0x13')](_0x2e0a84);}return _0x3fb6bb[_0xddbc('0x14')](_0x2e0a84)[_0xddbc('0x15')]();};}function respondWithResult(_0x36bb31,_0x55f959){_0x55f959=_0x55f959||0xc8;return function(_0x57c81f){if(_0x57c81f){return _0x36bb31[_0xddbc('0x14')](_0x55f959)[_0xddbc('0x16')](_0x57c81f);}};}function respondWithFilteredResult(_0x4ecb2e,_0x5c1d50){return function(_0x464f3d){if(_0x464f3d){var _0x2d4a9b=typeof _0x5c1d50[_0xddbc('0x17')]===_0xddbc('0x18')&&typeof _0x5c1d50['limit']==='undefined';var _0x356afe=_0x464f3d[_0xddbc('0x19')];var _0x5d0a34=_0x2d4a9b?0x0:_0x5c1d50['offset'];var _0x4cf7ea=_0x2d4a9b?_0x464f3d[_0xddbc('0x19')]:_0x5c1d50['offset']+_0x5c1d50[_0xddbc('0x1a')];var _0xedd271;if(_0x4cf7ea>=_0x356afe){_0x4cf7ea=_0x356afe;_0xedd271=0xc8;}else{_0xedd271=0xce;}_0x4ecb2e[_0xddbc('0x14')](_0xedd271);return _0x4ecb2e[_0xddbc('0x1b')](_0xddbc('0x1c'),_0x5d0a34+'-'+_0x4cf7ea+'/'+_0x356afe)[_0xddbc('0x16')](_0x464f3d);}return null;};}function patchUpdates(_0x500048){return function(_0x3bcded){try{jsonpatch['apply'](_0x3bcded,_0x500048,!![]);}catch(_0x52426a){return BPromise[_0xddbc('0x1d')](_0x52426a);}return _0x3bcded['save']();};}function saveUpdates(_0xd31251,_0x155f53){return function(_0x1cac88){if(_0x1cac88){return _0x1cac88[_0xddbc('0x1e')](_0xd31251)['then'](function(_0x1e677a){return _0x1e677a;});}return null;};}function removeEntity(_0x1fac5d,_0x1d0dfc){return function(_0x1d44a7){if(_0x1d44a7){return _0x1d44a7[_0xddbc('0x1f')]()['then'](function(){var _0x4bccd1=_0x1d44a7['get']({'plain':!![]});var _0x302120=_0xddbc('0x20');return db[_0xddbc('0x21')][_0xddbc('0x1f')]({'where':{'type':_0x302120,'resourceId':_0x4bccd1['id']}})[_0xddbc('0x22')](function(){return _0x1d44a7;});})[_0xddbc('0x22')](function(){_0x1fac5d[_0xddbc('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7e0b,_0x136f64){return function(_0x12bf5b){if(!_0x12bf5b){_0x2a7e0b[_0xddbc('0x13')](0x194);}return _0x12bf5b;};}function handleError(_0x3b1f06,_0xb4f6f5){_0xb4f6f5=_0xb4f6f5||0x1f4;return function(_0x16a720){logger['error'](_0x16a720[_0xddbc('0x23')]);if(_0x16a720[_0xddbc('0x24')]){delete _0x16a720[_0xddbc('0x24')];}_0x3b1f06[_0xddbc('0x14')](_0xb4f6f5)['send'](_0x16a720);};}exports[_0xddbc('0x25')]=function(_0x56042c,_0x49cc11){var _0x95a9c6={},_0x4d6329={},_0x19d2f0={'count':0x0,'rows':[]};var _0x2e261e=_[_0xddbc('0x26')](db[_0xddbc('0x27')][_0xddbc('0x28')],function(_0x58c10a){return{'name':_0x58c10a[_0xddbc('0x29')],'type':_0x58c10a['type'][_0xddbc('0x2a')]};});_0x4d6329[_0xddbc('0x2b')]=_[_0xddbc('0x26')](_0x2e261e,_0xddbc('0x24'));_0x4d6329[_0xddbc('0x2c')]=_[_0xddbc('0x2d')](_0x56042c[_0xddbc('0x2c')]);_0x4d6329[_0xddbc('0x2e')]=_['intersection'](_0x4d6329[_0xddbc('0x2b')],_0x4d6329[_0xddbc('0x2c')]);_0x95a9c6[_0xddbc('0x2f')]=_['intersection'](_0x4d6329[_0xddbc('0x2b')],qs['fields'](_0x56042c[_0xddbc('0x2c')][_0xddbc('0x30')]));_0x95a9c6['attributes']=_0x95a9c6[_0xddbc('0x2f')]['length']?_0x95a9c6[_0xddbc('0x2f')]:_0x4d6329['model'];if(!_0x56042c['query'][_0xddbc('0x31')]('nolimit')){_0x95a9c6['limit']=qs[_0xddbc('0x1a')](_0x56042c[_0xddbc('0x2c')][_0xddbc('0x1a')]);_0x95a9c6['offset']=qs['offset'](_0x56042c[_0xddbc('0x2c')]['offset']);}_0x95a9c6[_0xddbc('0x32')]=qs[_0xddbc('0x33')](_0x56042c[_0xddbc('0x2c')][_0xddbc('0x33')]);_0x95a9c6[_0xddbc('0x34')]=qs[_0xddbc('0x2e')](_[_0xddbc('0x35')](_0x56042c[_0xddbc('0x2c')],_0x4d6329[_0xddbc('0x2e')]),_0x2e261e);if(_0x56042c[_0xddbc('0x2c')][_0xddbc('0x36')]){_0x95a9c6[_0xddbc('0x34')]=_[_0xddbc('0x37')](_0x95a9c6[_0xddbc('0x34')],{'$or':_['map'](_0x2e261e,function(_0x71896c){if(_0x71896c[_0xddbc('0x38')]!==_0xddbc('0x39')){var _0x3a49bc={};_0x3a49bc[_0x71896c[_0xddbc('0x24')]]={'$like':'%'+_0x56042c['query']['filter']+'%'};return _0x3a49bc;}})});}_0x95a9c6=_[_0xddbc('0x37')]({},_0x95a9c6,_0x56042c[_0xddbc('0x3a')]);var _0x468089={'where':_0x95a9c6[_0xddbc('0x34')]};return db['Disposition'][_0xddbc('0x19')](_0x468089)[_0xddbc('0x22')](function(_0x1d88e7){_0x19d2f0[_0xddbc('0x19')]=_0x1d88e7;if(_0x56042c[_0xddbc('0x2c')][_0xddbc('0x3b')]){_0x95a9c6[_0xddbc('0x3c')]=[{'all':!![]}];}return db[_0xddbc('0x27')]['findAll'](_0x95a9c6);})[_0xddbc('0x22')](function(_0xad04fc){_0x19d2f0['rows']=_0xad04fc;return _0x19d2f0;})['then'](respondWithFilteredResult(_0x49cc11,_0x95a9c6))[_0xddbc('0x3d')](handleError(_0x49cc11,null));};exports[_0xddbc('0x3e')]=function(_0x949bb7,_0x462c93){var _0x4409eb={'raw':!![],'where':{'id':_0x949bb7[_0xddbc('0x3f')]['id']}},_0x575c18={};_0x575c18['model']=_[_0xddbc('0x2d')](db[_0xddbc('0x27')]['rawAttributes']);_0x575c18[_0xddbc('0x2c')]=_[_0xddbc('0x2d')](_0x949bb7[_0xddbc('0x2c')]);_0x575c18['filters']=_['intersection'](_0x575c18['model'],_0x575c18[_0xddbc('0x2c')]);_0x4409eb['attributes']=_['intersection'](_0x575c18['model'],qs[_0xddbc('0x30')](_0x949bb7[_0xddbc('0x2c')][_0xddbc('0x30')]));_0x4409eb[_0xddbc('0x2f')]=_0x4409eb[_0xddbc('0x2f')][_0xddbc('0x40')]?_0x4409eb[_0xddbc('0x2f')]:_0x575c18[_0xddbc('0x2b')];if(_0x949bb7[_0xddbc('0x2c')]['includeAll']){_0x4409eb[_0xddbc('0x3c')]=[{'all':!![]}];}_0x4409eb=_[_0xddbc('0x37')]({},_0x4409eb,_0x949bb7[_0xddbc('0x3a')]);return db[_0xddbc('0x27')]['find'](_0x4409eb)[_0xddbc('0x22')](handleEntityNotFound(_0x462c93,null))[_0xddbc('0x22')](respondWithResult(_0x462c93,null))[_0xddbc('0x3d')](handleError(_0x462c93,null));};exports['create']=function(_0x2115ea,_0x1fa0bd){return db[_0xddbc('0x27')][_0xddbc('0x41')](_0x2115ea[_0xddbc('0x42')],{})['then'](function(_0x2a5f36){var _0x286284=_0x2115ea[_0xddbc('0x43')]['get']({'plain':!![]});if(!_0x286284)throw new Error(_0xddbc('0x44'));if(_0x286284[_0xddbc('0x45')]===_0xddbc('0x43')){var _0x3cc229=_0x2a5f36[_0xddbc('0x46')]({'plain':!![]});var _0x2fb977='Dispositions';return db['UserProfileSection'][_0xddbc('0x47')]({'where':{'name':_0x2fb977,'userProfileId':_0x286284['userProfileId']},'raw':!![]})[_0xddbc('0x22')](function(_0x3c3e40){if(_0x3c3e40&&_0x3c3e40[_0xddbc('0x48')]===0x0){return db[_0xddbc('0x21')]['create']({'name':_0x3cc229[_0xddbc('0x24')],'resourceId':_0x3cc229['id'],'type':_0x3c3e40[_0xddbc('0x24')],'sectionId':_0x3c3e40['id']},{})[_0xddbc('0x22')](function(){return _0x2a5f36;});}else{return _0x2a5f36;}})[_0xddbc('0x3d')](function(_0x51e262){logger[_0xddbc('0x49')](_0xddbc('0x4a'),_0x51e262);throw _0x51e262;});}return _0x2a5f36;})[_0xddbc('0x22')](respondWithResult(_0x1fa0bd,0xc9))[_0xddbc('0x3d')](handleError(_0x1fa0bd,null));};exports[_0xddbc('0x1e')]=function(_0x1ca700,_0x1c59c6){if(_0x1ca700['body']['id']){delete _0x1ca700[_0xddbc('0x42')]['id'];}return db[_0xddbc('0x27')][_0xddbc('0x47')]({'where':{'id':_0x1ca700[_0xddbc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1c59c6,null))[_0xddbc('0x22')](saveUpdates(_0x1ca700[_0xddbc('0x42')],null))['then'](respondWithResult(_0x1c59c6,null))[_0xddbc('0x3d')](handleError(_0x1c59c6,null));};exports[_0xddbc('0x1f')]=function(_0xb1279b,_0x1cbd25){return db[_0xddbc('0x27')][_0xddbc('0x47')]({'where':{'id':_0xb1279b['params']['id']}})[_0xddbc('0x22')](handleEntityNotFound(_0x1cbd25,null))[_0xddbc('0x22')](removeEntity(_0x1cbd25,null))['catch'](handleError(_0x1cbd25,null));}; \ No newline at end of file +var _0xec47=['query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xec47,0x170));var _0x7ec4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xec47[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x7ec4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7ec4('0x1'));var rp=require(_0x7ec4('0x2'));var moment=require(_0x7ec4('0x3'));var BPromise=require(_0x7ec4('0x4'));var Mustache=require(_0x7ec4('0x5'));var util=require(_0x7ec4('0x6'));var path=require(_0x7ec4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ec4('0x8'));var _=require(_0x7ec4('0x9'));var squel=require(_0x7ec4('0xa'));var crypto=require(_0x7ec4('0xb'));var jsforce=require(_0x7ec4('0xc'));var deskjs=require(_0x7ec4('0xd'));var toCsv=require(_0x7ec4('0xe'));var querystring=require(_0x7ec4('0xf'));var Papa=require('papaparse');var Redis=require(_0x7ec4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7ec4('0x11'));var as=require(_0x7ec4('0x12'));var hardwareService=require(_0x7ec4('0x13'));var logger=require(_0x7ec4('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7ec4('0x15'));var licenseUtil=require(_0x7ec4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e92b2,_0x328630){_0x328630=_0x328630||0xcc;return function(_0x286b34){if(_0x286b34){return _0x4e92b2[_0x7ec4('0x17')](_0x328630);}return _0x4e92b2[_0x7ec4('0x18')](_0x328630)[_0x7ec4('0x19')]();};}function respondWithResult(_0x1e6c99,_0x3a6265){_0x3a6265=_0x3a6265||0xc8;return function(_0x340e4f){if(_0x340e4f){return _0x1e6c99[_0x7ec4('0x18')](_0x3a6265)['json'](_0x340e4f);}};}function respondWithFilteredResult(_0x4f78a2,_0x564460){return function(_0x2595af){if(_0x2595af){var _0x384ebd=typeof _0x564460[_0x7ec4('0x1a')]===_0x7ec4('0x1b')&&typeof _0x564460[_0x7ec4('0x1c')]===_0x7ec4('0x1b');var _0x39af60=_0x2595af[_0x7ec4('0x1d')];var _0x38d57b=_0x384ebd?0x0:_0x564460[_0x7ec4('0x1a')];var _0x396373=_0x384ebd?_0x2595af[_0x7ec4('0x1d')]:_0x564460[_0x7ec4('0x1a')]+_0x564460[_0x7ec4('0x1c')];var _0x1cca40;if(_0x396373>=_0x39af60){_0x396373=_0x39af60;_0x1cca40=0xc8;}else{_0x1cca40=0xce;}_0x4f78a2[_0x7ec4('0x18')](_0x1cca40);return _0x4f78a2[_0x7ec4('0x1e')](_0x7ec4('0x1f'),_0x38d57b+'-'+_0x396373+'/'+_0x39af60)['json'](_0x2595af);}return null;};}function patchUpdates(_0x4505a6){return function(_0x39a25d){try{jsonpatch[_0x7ec4('0x20')](_0x39a25d,_0x4505a6,!![]);}catch(_0x10c1cb){return BPromise[_0x7ec4('0x21')](_0x10c1cb);}return _0x39a25d[_0x7ec4('0x22')]();};}function saveUpdates(_0x8b2270,_0x25a763){return function(_0x5e884b){if(_0x5e884b){return _0x5e884b[_0x7ec4('0x23')](_0x8b2270)['then'](function(_0x2dfd87){return _0x2dfd87;});}return null;};}function removeEntity(_0x14874d,_0x382b96){return function(_0x24caa9){if(_0x24caa9){return _0x24caa9['destroy']()[_0x7ec4('0x24')](function(){var _0x5f2aa9=_0x24caa9[_0x7ec4('0x25')]({'plain':!![]});var _0x5d4034=_0x7ec4('0x26');return db[_0x7ec4('0x27')][_0x7ec4('0x28')]({'where':{'type':_0x5d4034,'resourceId':_0x5f2aa9['id']}})[_0x7ec4('0x24')](function(){return _0x24caa9;});})[_0x7ec4('0x24')](function(){_0x14874d['status'](0xcc)[_0x7ec4('0x19')]();});}};}function handleEntityNotFound(_0x455b5f,_0x1e91b0){return function(_0x492c11){if(!_0x492c11){_0x455b5f['sendStatus'](0x194);}return _0x492c11;};}function handleError(_0x16d548,_0x21716f){_0x21716f=_0x21716f||0x1f4;return function(_0x844112){logger[_0x7ec4('0x29')](_0x844112['stack']);if(_0x844112[_0x7ec4('0x2a')]){delete _0x844112['name'];}_0x16d548[_0x7ec4('0x18')](_0x21716f)[_0x7ec4('0x2b')](_0x844112);};}exports[_0x7ec4('0x2c')]=function(_0x925b0d,_0x23fe6f){var _0x4d805d={},_0x196f77={},_0x556151={'count':0x0,'rows':[]};var _0x215d6=_[_0x7ec4('0x2d')](db[_0x7ec4('0x2e')][_0x7ec4('0x2f')],function(_0x396055){return{'name':_0x396055[_0x7ec4('0x30')],'type':_0x396055[_0x7ec4('0x31')][_0x7ec4('0x32')]};});_0x196f77[_0x7ec4('0x33')]=_[_0x7ec4('0x2d')](_0x215d6,'name');_0x196f77[_0x7ec4('0x34')]=_[_0x7ec4('0x35')](_0x925b0d[_0x7ec4('0x34')]);_0x196f77['filters']=_['intersection'](_0x196f77['model'],_0x196f77[_0x7ec4('0x34')]);_0x4d805d[_0x7ec4('0x36')]=_[_0x7ec4('0x37')](_0x196f77['model'],qs['fields'](_0x925b0d[_0x7ec4('0x34')][_0x7ec4('0x38')]));_0x4d805d[_0x7ec4('0x36')]=_0x4d805d['attributes']['length']?_0x4d805d['attributes']:_0x196f77[_0x7ec4('0x33')];if(!_0x925b0d[_0x7ec4('0x34')][_0x7ec4('0x39')](_0x7ec4('0x3a'))){_0x4d805d['limit']=qs[_0x7ec4('0x1c')](_0x925b0d[_0x7ec4('0x34')][_0x7ec4('0x1c')]);_0x4d805d[_0x7ec4('0x1a')]=qs[_0x7ec4('0x1a')](_0x925b0d[_0x7ec4('0x34')][_0x7ec4('0x1a')]);}_0x4d805d['order']=qs['sort'](_0x925b0d['query'][_0x7ec4('0x3b')]);_0x4d805d['where']=qs[_0x7ec4('0x3c')](_[_0x7ec4('0x3d')](_0x925b0d[_0x7ec4('0x34')],_0x196f77[_0x7ec4('0x3c')]),_0x215d6);if(_0x925b0d[_0x7ec4('0x34')][_0x7ec4('0x3e')]){_0x4d805d[_0x7ec4('0x3f')]=_[_0x7ec4('0x40')](_0x4d805d[_0x7ec4('0x3f')],{'$or':_['map'](_0x215d6,function(_0x56ea9f){if(_0x56ea9f[_0x7ec4('0x31')]!==_0x7ec4('0x41')){var _0x1bc576={};_0x1bc576[_0x56ea9f['name']]={'$like':'%'+_0x925b0d[_0x7ec4('0x34')]['filter']+'%'};return _0x1bc576;}})});}_0x4d805d=_[_0x7ec4('0x40')]({},_0x4d805d,_0x925b0d[_0x7ec4('0x42')]);var _0xcbab1={'where':_0x4d805d['where']};return db['Disposition'][_0x7ec4('0x1d')](_0xcbab1)[_0x7ec4('0x24')](function(_0x4517f1){_0x556151[_0x7ec4('0x1d')]=_0x4517f1;if(_0x925b0d['query'][_0x7ec4('0x43')]){_0x4d805d[_0x7ec4('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x7ec4('0x45')](_0x4d805d);})['then'](function(_0x5c0849){_0x556151[_0x7ec4('0x46')]=_0x5c0849;return _0x556151;})[_0x7ec4('0x24')](respondWithFilteredResult(_0x23fe6f,_0x4d805d))['catch'](handleError(_0x23fe6f,null));};exports[_0x7ec4('0x47')]=function(_0x1987f9,_0x3c8114){var _0x46040d={'raw':!![],'where':{'id':_0x1987f9['params']['id']}},_0xbe9e7={};_0xbe9e7[_0x7ec4('0x33')]=_[_0x7ec4('0x35')](db[_0x7ec4('0x2e')]['rawAttributes']);_0xbe9e7[_0x7ec4('0x34')]=_[_0x7ec4('0x35')](_0x1987f9[_0x7ec4('0x34')]);_0xbe9e7[_0x7ec4('0x3c')]=_[_0x7ec4('0x37')](_0xbe9e7[_0x7ec4('0x33')],_0xbe9e7['query']);_0x46040d[_0x7ec4('0x36')]=_['intersection'](_0xbe9e7['model'],qs[_0x7ec4('0x38')](_0x1987f9[_0x7ec4('0x34')][_0x7ec4('0x38')]));_0x46040d[_0x7ec4('0x36')]=_0x46040d[_0x7ec4('0x36')]['length']?_0x46040d[_0x7ec4('0x36')]:_0xbe9e7[_0x7ec4('0x33')];if(_0x1987f9['query']['includeAll']){_0x46040d[_0x7ec4('0x44')]=[{'all':!![]}];}_0x46040d=_['merge']({},_0x46040d,_0x1987f9[_0x7ec4('0x42')]);return db[_0x7ec4('0x2e')][_0x7ec4('0x48')](_0x46040d)[_0x7ec4('0x24')](handleEntityNotFound(_0x3c8114,null))['then'](respondWithResult(_0x3c8114,null))['catch'](handleError(_0x3c8114,null));};exports[_0x7ec4('0x49')]=function(_0x1510ce,_0xca138d){return db[_0x7ec4('0x2e')][_0x7ec4('0x49')](_0x1510ce['body'],{})['then'](function(_0x41f464){var _0x1eff5e=_0x1510ce[_0x7ec4('0x4a')]['get']({'plain':!![]});if(!_0x1eff5e)throw new Error(_0x7ec4('0x4b'));if(_0x1eff5e[_0x7ec4('0x4c')]===_0x7ec4('0x4a')){var _0x5a8581=_0x41f464[_0x7ec4('0x25')]({'plain':!![]});var _0x333105=_0x7ec4('0x26');return db[_0x7ec4('0x4d')][_0x7ec4('0x48')]({'where':{'name':_0x333105,'userProfileId':_0x1eff5e[_0x7ec4('0x4e')]},'raw':!![]})[_0x7ec4('0x24')](function(_0x39a737){if(_0x39a737&&_0x39a737[_0x7ec4('0x4f')]===0x0){return db[_0x7ec4('0x27')]['create']({'name':_0x5a8581[_0x7ec4('0x2a')],'resourceId':_0x5a8581['id'],'type':_0x39a737[_0x7ec4('0x2a')],'sectionId':_0x39a737['id']},{})[_0x7ec4('0x24')](function(){return _0x41f464;});}else{return _0x41f464;}})[_0x7ec4('0x50')](function(_0x73ddc4){logger['error'](_0x7ec4('0x51'),_0x73ddc4);throw _0x73ddc4;});}return _0x41f464;})[_0x7ec4('0x24')](respondWithResult(_0xca138d,0xc9))[_0x7ec4('0x50')](handleError(_0xca138d,null));};exports['update']=function(_0x1c9705,_0x3139e7){if(_0x1c9705['body']['id']){delete _0x1c9705[_0x7ec4('0x52')]['id'];}return db['Disposition']['find']({'where':{'id':_0x1c9705[_0x7ec4('0x53')]['id']}})[_0x7ec4('0x24')](handleEntityNotFound(_0x3139e7,null))[_0x7ec4('0x24')](saveUpdates(_0x1c9705[_0x7ec4('0x52')],null))[_0x7ec4('0x24')](respondWithResult(_0x3139e7,null))['catch'](handleError(_0x3139e7,null));};exports[_0x7ec4('0x28')]=function(_0x357c99,_0x534f5f){return db[_0x7ec4('0x2e')]['find']({'where':{'id':_0x357c99[_0x7ec4('0x53')]['id']}})[_0x7ec4('0x24')](handleEntityNotFound(_0x534f5f,null))[_0x7ec4('0x24')](removeEntity(_0x534f5f,null))[_0x7ec4('0x50')](handleError(_0x534f5f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 487cf1c..b02f754 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 _0x41b5=['name','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','WhatsappAccountId','lodash','../../config/logger','api','moment','rimraf','exports','define','Disposition','tools_dispositions','name_voice'];(function(_0x4101b8,_0x3d3289){var _0x35bf0d=function(_0x3fdf2f){while(--_0x3fdf2f){_0x4101b8['push'](_0x4101b8['shift']());}};_0x35bf0d(++_0x3d3289);}(_0x41b5,0x14a));var _0x541b=function(_0x1be9d3,_0x195b00){_0x1be9d3=_0x1be9d3-0x0;var _0x1d0aaa=_0x41b5[_0x1be9d3];return _0x1d0aaa;};'use strict';var _=require(_0x541b('0x0'));var util=require('util');var logger=require(_0x541b('0x1'))(_0x541b('0x2'));var moment=require(_0x541b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x541b('0x4'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x541b('0x5')]=function(_0x5ee482,_0x1f0322){return _0x5ee482[_0x541b('0x6')](_0x541b('0x7'),attributes,{'tableName':_0x541b('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x541b('0x9'),'fields':[_0x541b('0xa'),'ListId']},{'unique':!![],'name':_0x541b('0xb'),'fields':['name',_0x541b('0xc')]},{'unique':!![],'name':_0x541b('0xd'),'fields':[_0x541b('0xa'),_0x541b('0xe')]},{'unique':!![],'name':'name_sms','fields':['name',_0x541b('0xf')]},{'unique':!![],'name':_0x541b('0x10'),'fields':[_0x541b('0xa'),_0x541b('0x11')]},{'unique':!![],'name':_0x541b('0x12'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x541b('0xa'),_0x541b('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b84=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash'];(function(_0x49226a,_0x35a205){var _0x335689=function(_0xcbae1e){while(--_0xcbae1e){_0x49226a['push'](_0x49226a['shift']());}};_0x335689(++_0x35a205);}(_0x6b84,0xce));var _0x46b8=function(_0x288138,_0x41a7c9){_0x288138=_0x288138-0x0;var _0x2779c3=_0x6b84[_0x288138];return _0x2779c3;};'use strict';var _=require(_0x46b8('0x0'));var util=require(_0x46b8('0x1'));var logger=require('../../config/logger')(_0x46b8('0x2'));var moment=require(_0x46b8('0x3'));var BPromise=require(_0x46b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46b8('0x5'));var rimraf=require(_0x46b8('0x6'));var config=require(_0x46b8('0x7'));var attributes=require('./disposition.attributes');module[_0x46b8('0x8')]=function(_0x5087e3,_0x5eb4ae){return _0x5087e3[_0x46b8('0x9')](_0x46b8('0xa'),attributes,{'tableName':_0x46b8('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x46b8('0xc'),'fields':[_0x46b8('0xd'),_0x46b8('0xe')]},{'unique':!![],'name':_0x46b8('0xf'),'fields':[_0x46b8('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x46b8('0x10'),'fields':[_0x46b8('0xd'),_0x46b8('0x11')]},{'unique':!![],'name':_0x46b8('0x12'),'fields':[_0x46b8('0xd'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x46b8('0xd'),_0x46b8('0x13')]},{'unique':!![],'name':_0x46b8('0x14'),'fields':[_0x46b8('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x46b8('0x15'),'fields':[_0x46b8('0xd'),_0x46b8('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index eee093e..a5b6bea 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(_0x1ad1cd,_0x3fb069){var _0x3c7b2a=function(_0x462bb6){while(--_0x462bb6){_0x1ad1cd['push'](_0x1ad1cd['shift']());}};_0x3c7b2a(++_0x3fb069);}(_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(_0x49e7fc,_0x313029){var _0x3ab2c7=function(_0x247006){while(--_0x247006){_0x49e7fc['push'](_0x49e7fc['shift']());}};_0x3ab2c7(++_0x313029);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 69cc896..b80ef85 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 _0xb660=['../../components/auth/service','../../config/environment','./disposition.controller','get','/:id','isAuthenticated','show','create','update','destroy','path','connect-timeout','Router'];(function(_0x34c4fe,_0x43e8d3){var _0x9440b0=function(_0x473b23){while(--_0x473b23){_0x34c4fe['push'](_0x34c4fe['shift']());}};_0x9440b0(++_0x43e8d3);}(_0xb660,0x15c));var _0x0b66=function(_0x5ac1f0,_0x557b2c){_0x5ac1f0=_0x5ac1f0-0x0;var _0x3b98a6=_0xb660[_0x5ac1f0];return _0x3b98a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b66('0x0'));var timeout=require(_0x0b66('0x1'));var express=require('express');var router=express[_0x0b66('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0b66('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0b66('0x4'));var controller=require(_0x0b66('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0b66('0x6')](_0x0b66('0x7'),auth[_0x0b66('0x8')](),controller[_0x0b66('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0b66('0xa')]);router['put'](_0x0b66('0x7'),auth['isAuthenticated'](),controller[_0x0b66('0xb')]);router['delete'](_0x0b66('0x7'),auth[_0x0b66('0x8')](),controller[_0x0b66('0xc')]);module['exports']=router; \ No newline at end of file +var _0x1bff=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xa85056,_0x416826){var _0x23eddd=function(_0x241fe3){while(--_0x241fe3){_0xa85056['push'](_0xa85056['shift']());}};_0x23eddd(++_0x416826);}(_0x1bff,0x1bb));var _0xf1bf=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0x1bff[_0xaf25ae];return _0x49732d;};'use strict';var multer=require(_0xf1bf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf1bf('0x1'));var router=express['Router']();var fs_extra=require(_0xf1bf('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xf1bf('0x3'));var config=require(_0xf1bf('0x4'));var controller=require('./disposition.controller');router[_0xf1bf('0x5')]('/',auth[_0xf1bf('0x6')](),controller[_0xf1bf('0x7')]);router[_0xf1bf('0x5')](_0xf1bf('0x8'),auth[_0xf1bf('0x6')](),controller[_0xf1bf('0x9')]);router[_0xf1bf('0xa')]('/',auth[_0xf1bf('0x6')](),controller[_0xf1bf('0xb')]);router[_0xf1bf('0xc')](_0xf1bf('0x8'),auth[_0xf1bf('0x6')](),controller[_0xf1bf('0xd')]);router[_0xf1bf('0xe')]('/:id',auth[_0xf1bf('0x6')](),controller['destroy']);module[_0xf1bf('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 3fba890..aca4311 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 _0xb1e9=['localstationid','2400','4800','9600','12000','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0xb1e9,0x133));var _0x9b1e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb1e9[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x9b1e('0x0'));module['exports']={'name':{'type':Sequelize[_0x9b1e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9b1e('0x1')]},'ecm':{'type':Sequelize[_0x9b1e('0x2')](_0x9b1e('0x3'),'no'),'defaultValue':_0x9b1e('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x9b1e('0x4')},'localstationid':{'type':Sequelize[_0x9b1e('0x1')],'unique':_0x9b1e('0x5')},'minrate':{'type':Sequelize[_0x9b1e('0x2')](_0x9b1e('0x6'),_0x9b1e('0x7'),'7200',_0x9b1e('0x8'),_0x9b1e('0x9'),_0x9b1e('0xa')),'defaultValue':_0x9b1e('0x7')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x9b1e('0x7'),_0x9b1e('0xb'),_0x9b1e('0x8'),_0x9b1e('0x9'),'14400'),'defaultValue':_0x9b1e('0xa')},'modem':{'type':Sequelize[_0x9b1e('0x1')],'defaultValue':_0x9b1e('0xc')},'gateway':{'type':Sequelize[_0x9b1e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9b1e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9b1e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x9b1e('0xe'),_0x9b1e('0xf'),_0x9b1e('0x10'),_0x9b1e('0x11')),'defaultValue':_0x9b1e('0xe')},'key':{'type':Sequelize[_0x9b1e('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9b1e('0x12');}},'notificationSound':{'type':Sequelize[_0x9b1e('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9b1e('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9b1e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9b1e('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9b1e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9b1e('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9b1e('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x9b1e('0x13')],'defaultValue':![],'comment':_0x9b1e('0x15'),'set':function(_0x476adc){if(!_0x476adc)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9b1e('0x16')](_0x9b1e('0x17'),_0x476adc);}}}; \ No newline at end of file +var _0x0a21=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','12000','14400','4800','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING'];(function(_0x3246a6,_0x2a685a){var _0x1df64d=function(_0x4868ad){while(--_0x4868ad){_0x3246a6['push'](_0x3246a6['shift']());}};_0x1df64d(++_0x2a685a);}(_0x0a21,0x9f));var _0x10a2=function(_0x34d2b8,_0x6fb2df){_0x34d2b8=_0x34d2b8-0x0;var _0x785817=_0x0a21[_0x34d2b8];return _0x785817;};'use strict';var Sequelize=require('sequelize');module[_0x10a2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x10a2('0x1')]},'ecm':{'type':Sequelize[_0x10a2('0x2')]('yes','no'),'defaultValue':_0x10a2('0x3')},'headerinfo':{'type':Sequelize[_0x10a2('0x1')],'defaultValue':_0x10a2('0x4')},'localstationid':{'type':Sequelize[_0x10a2('0x1')],'unique':_0x10a2('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x10a2('0x6'),'4800',_0x10a2('0x7'),'9600',_0x10a2('0x8'),_0x10a2('0x9')),'defaultValue':_0x10a2('0xa')},'maxrate':{'type':Sequelize[_0x10a2('0x2')]('2400','4800',_0x10a2('0x7'),'9600','12000','14400'),'defaultValue':_0x10a2('0x9')},'modem':{'type':Sequelize[_0x10a2('0x1')],'defaultValue':_0x10a2('0xb')},'gateway':{'type':Sequelize[_0x10a2('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x10a2('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x10a2('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x10a2('0x2')]('SIP',_0x10a2('0xd'),_0x10a2('0xe'),_0x10a2('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x10a2('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x10a2('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x10a2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x10a2('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x10a2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x10a2('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x10a2('0x11')],'defaultValue':![],'comment':_0x10a2('0x13'),'set':function(_0x35b1e6){if(!_0x35b1e6)this['setDataValue'](_0x10a2('0x14'),null);this[_0x10a2('0x15')](_0x10a2('0x16'),_0x35b1e6);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 0e2b39e..d88b667 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 _0x4c12=['removeAgents','userFaxAccount:remove','getAgents','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','filter','merge','where','options','FaxAccount','includeAll','rows','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','Disposition','intersection','nolimit','pick','include','findAll','removeDispositions','ids','addAnswer','FaxAccountId','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','appdata','push','Answer','Set','gateway','faxdetect','minrate','/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','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','send','CmList','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','ListId','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save'];(function(_0x19e887,_0x374103){var _0x137b50=function(_0x54de66){while(--_0x54de66){_0x19e887['push'](_0x19e887['shift']());}};_0x137b50(++_0x374103);}(_0x4c12,0x179));var _0x24c1=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x4c12[_0x35007a];return _0x574f68;};'use strict';var emlformat=require(_0x24c1('0x0'));var rimraf=require(_0x24c1('0x1'));var zipdir=require(_0x24c1('0x2'));var jsonpatch=require(_0x24c1('0x3'));var rp=require(_0x24c1('0x4'));var moment=require(_0x24c1('0x5'));var BPromise=require(_0x24c1('0x6'));var Mustache=require(_0x24c1('0x7'));var util=require(_0x24c1('0x8'));var path=require(_0x24c1('0x9'));var sox=require(_0x24c1('0xa'));var csv=require(_0x24c1('0xb'));var ejs=require(_0x24c1('0xc'));var fs=require('fs');var fs_extra=require(_0x24c1('0xd'));var _=require(_0x24c1('0xe'));var squel=require(_0x24c1('0xf'));var crypto=require('crypto');var jsforce=require(_0x24c1('0x10'));var deskjs=require(_0x24c1('0x11'));var toCsv=require(_0x24c1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x24c1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x24c1('0x13'));var as=require(_0x24c1('0x14'));var hardwareService=require(_0x24c1('0x15'));var logger=require(_0x24c1('0x16'))('api');var utils=require(_0x24c1('0x17'));var config=require(_0x24c1('0x18'));var licenseUtil=require(_0x24c1('0x19'));var db=require(_0x24c1('0x1a'))['db'];config[_0x24c1('0x1b')]=_[_0x24c1('0x1c')](config[_0x24c1('0x1b')],{'host':_0x24c1('0x1d'),'port':0x18eb});var socket=require(_0x24c1('0x1e'))(new Redis(config[_0x24c1('0x1b')]));require(_0x24c1('0x1f'))[_0x24c1('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x24c1('0x21')][_0x24c1('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x24c1('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5c3158,_0x25129a,_0x2fad61,_0x4131a1){return new BPromise(function(_0x36f13e,_0xfd3acb){var _0x2a7eea=_0x4131a1||client;return _0x2a7eea['request'](_0x5c3158,_0x2fad61)[_0x24c1('0x23')](function(_0x2d0804){logger[_0x24c1('0x24')](_0x24c1('0x25'),_0x25129a,_0x24c1('0x26'));logger['debug'](_0x24c1('0x27'),_0x25129a,_0x24c1('0x26'),JSON['stringify'](_0x2d0804));if(_0x2d0804['error']){if(_0x2d0804[_0x24c1('0x28')][_0x24c1('0x29')]===0x1f4){logger[_0x24c1('0x28')](_0x24c1('0x25'),_0x25129a,_0x2d0804[_0x24c1('0x28')][_0x24c1('0x2a')]);return _0xfd3acb(_0x2d0804['error'][_0x24c1('0x2a')]);}logger[_0x24c1('0x28')](_0x24c1('0x25'),_0x25129a,_0x2d0804[_0x24c1('0x28')][_0x24c1('0x2a')]);return _0x36f13e(_0x2d0804[_0x24c1('0x28')][_0x24c1('0x2a')]);}else{logger[_0x24c1('0x24')](_0x24c1('0x25'),_0x25129a,'request\x20sent');_0x36f13e(_0x2d0804['result'][_0x24c1('0x2a')]);}})['catch'](function(_0x2a0dd6){logger[_0x24c1('0x28')](_0x24c1('0x25'),_0x25129a,_0x2a0dd6);_0xfd3acb(_0x2a0dd6);});});}function respondWithStatusCode(_0x320c23,_0x171592){_0x171592=_0x171592||0xcc;return function(_0x332e2a){if(_0x332e2a){return _0x320c23[_0x24c1('0x2b')](_0x171592);}return _0x320c23[_0x24c1('0x2c')](_0x171592)[_0x24c1('0x2d')]();};}function respondWithResult(_0x3d8382,_0x2e77d5){_0x2e77d5=_0x2e77d5||0xc8;return function(_0x26bd6c){if(_0x26bd6c){return _0x3d8382[_0x24c1('0x2c')](_0x2e77d5)[_0x24c1('0x2e')](_0x26bd6c);}};}function respondWithFilteredResult(_0x3b725d,_0x5ceec0){return function(_0x4daca0){if(_0x4daca0){var _0x1e9109=typeof _0x5ceec0[_0x24c1('0x2f')]==='undefined'&&typeof _0x5ceec0['limit']===_0x24c1('0x30');var _0x34e252=_0x4daca0['count'];var _0x21f5b5=_0x1e9109?0x0:_0x5ceec0[_0x24c1('0x2f')];var _0x52d476=_0x1e9109?_0x4daca0[_0x24c1('0x31')]:_0x5ceec0[_0x24c1('0x2f')]+_0x5ceec0['limit'];var _0x559497;if(_0x52d476>=_0x34e252){_0x52d476=_0x34e252;_0x559497=0xc8;}else{_0x559497=0xce;}_0x3b725d[_0x24c1('0x2c')](_0x559497);return _0x3b725d[_0x24c1('0x32')](_0x24c1('0x33'),_0x21f5b5+'-'+_0x52d476+'/'+_0x34e252)[_0x24c1('0x2e')](_0x4daca0);}return null;};}function patchUpdates(_0x10b298){return function(_0x2db9bc){try{jsonpatch['apply'](_0x2db9bc,_0x10b298,!![]);}catch(_0xfb317c){return BPromise[_0x24c1('0x34')](_0xfb317c);}return _0x2db9bc[_0x24c1('0x35')]();};}function saveUpdates(_0x1bcdf7,_0x37c8df){return function(_0x1c3b44){if(_0x1c3b44){return _0x1c3b44[_0x24c1('0x36')](_0x1bcdf7)['then'](function(_0x43b049){return _0x43b049;});}return null;};}function removeEntity(_0x32eba7,_0xd9c647){return function(_0x101265){if(_0x101265){return _0x101265[_0x24c1('0x37')]()['then'](function(){var _0x415d46=_0x101265[_0x24c1('0x38')]({'plain':!![]});var _0x1f52c2=_0x24c1('0x39');return db[_0x24c1('0x3a')]['destroy']({'where':{'type':_0x1f52c2,'resourceId':_0x415d46['id']}})[_0x24c1('0x23')](function(){return _0x101265;});})['then'](function(){_0x32eba7[_0x24c1('0x2c')](0xcc)[_0x24c1('0x2d')]();});}};}function handleEntityNotFound(_0x127c18,_0x6694ab){return function(_0x13504c){if(!_0x13504c){_0x127c18[_0x24c1('0x2b')](0x194);}return _0x13504c;};}function handleError(_0x872bf0,_0x5741e5){_0x5741e5=_0x5741e5||0x1f4;return function(_0xe9a29d){logger[_0x24c1('0x28')](_0xe9a29d[_0x24c1('0x3b')]);if(_0xe9a29d['name']){delete _0xe9a29d[_0x24c1('0x3c')];}_0x872bf0[_0x24c1('0x2c')](_0x5741e5)['send'](_0xe9a29d);};}exports['index']=function(_0x17ad19,_0x1ed9a2){var _0x592102={'include':[{'model':db[_0x24c1('0x3d')],'as':_0x24c1('0x3e')}]},_0x49528f={},_0x57125b={'count':0x0,'rows':[]};var _0x36a0fc=_[_0x24c1('0x3f')](db['FaxAccount']['rawAttributes'],function(_0xc4e83d){return{'name':_0xc4e83d['fieldName'],'type':_0xc4e83d[_0x24c1('0x40')][_0x24c1('0x41')]};});_0x49528f[_0x24c1('0x42')]=_['map'](_0x36a0fc,'name');_0x49528f[_0x24c1('0x43')]=_[_0x24c1('0x44')](_0x17ad19[_0x24c1('0x43')]);_0x49528f['filters']=_['intersection'](_0x49528f[_0x24c1('0x42')],_0x49528f['query']);_0x592102[_0x24c1('0x45')]=_['intersection'](_0x49528f['model'],qs[_0x24c1('0x46')](_0x17ad19[_0x24c1('0x43')][_0x24c1('0x46')]));_0x592102[_0x24c1('0x45')]=_0x592102[_0x24c1('0x45')][_0x24c1('0x47')]?_0x592102[_0x24c1('0x45')]:_0x49528f[_0x24c1('0x42')];if(!_0x17ad19[_0x24c1('0x43')][_0x24c1('0x48')]('nolimit')){_0x592102[_0x24c1('0x49')]=qs[_0x24c1('0x49')](_0x17ad19[_0x24c1('0x43')][_0x24c1('0x49')]);_0x592102['offset']=qs[_0x24c1('0x2f')](_0x17ad19[_0x24c1('0x43')]['offset']);}_0x592102[_0x24c1('0x4a')]=qs[_0x24c1('0x4b')](_0x17ad19[_0x24c1('0x43')][_0x24c1('0x4b')]);_0x592102['where']=qs[_0x24c1('0x4c')](_['pick'](_0x17ad19[_0x24c1('0x43')],_0x49528f['filters']),_0x36a0fc);if(_0x17ad19['query'][_0x24c1('0x4d')]){_0x592102['where']=_[_0x24c1('0x4e')](_0x592102[_0x24c1('0x4f')],{'$or':_['map'](_0x36a0fc,function(_0x2d51e4){if(_0x2d51e4[_0x24c1('0x40')]!=='VIRTUAL'){var _0x479373={};_0x479373[_0x2d51e4[_0x24c1('0x3c')]]={'$like':'%'+_0x17ad19[_0x24c1('0x43')]['filter']+'%'};return _0x479373;}})});}_0x592102=_['merge']({},_0x592102,_0x17ad19[_0x24c1('0x50')]);var _0x10a527={'where':_0x592102['where']};return db[_0x24c1('0x51')]['count'](_0x10a527)['then'](function(_0x4da6d6){_0x57125b[_0x24c1('0x31')]=_0x4da6d6;if(_0x17ad19[_0x24c1('0x43')][_0x24c1('0x52')]){_0x592102['include']=[{'all':!![]}];}return db[_0x24c1('0x51')]['findAll'](_0x592102);})[_0x24c1('0x23')](function(_0x164305){_0x57125b[_0x24c1('0x53')]=_0x164305;return _0x57125b;})[_0x24c1('0x23')](respondWithFilteredResult(_0x1ed9a2,_0x592102))['catch'](handleError(_0x1ed9a2,null));};exports['show']=function(_0x5e3197,_0x39423a){var _0x44ae2e={'raw':![],'where':{'id':_0x5e3197['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x145c98={};_0x145c98[_0x24c1('0x42')]=_[_0x24c1('0x44')](db[_0x24c1('0x51')][_0x24c1('0x54')]);_0x145c98[_0x24c1('0x43')]=_[_0x24c1('0x44')](_0x5e3197['query']);_0x145c98[_0x24c1('0x4c')]=_['intersection'](_0x145c98[_0x24c1('0x42')],_0x145c98[_0x24c1('0x43')]);_0x44ae2e['attributes']=_['intersection'](_0x145c98[_0x24c1('0x42')],qs[_0x24c1('0x46')](_0x5e3197[_0x24c1('0x43')][_0x24c1('0x46')]));_0x44ae2e['attributes']=_0x44ae2e[_0x24c1('0x45')][_0x24c1('0x47')]?_0x44ae2e[_0x24c1('0x45')]:_0x145c98[_0x24c1('0x42')];if(_0x5e3197[_0x24c1('0x43')][_0x24c1('0x52')]){_0x44ae2e['include']=[{'all':!![]}];}_0x44ae2e=_[_0x24c1('0x4e')]({},_0x44ae2e,_0x5e3197[_0x24c1('0x50')]);return db[_0x24c1('0x51')][_0x24c1('0x55')](_0x44ae2e)[_0x24c1('0x23')](handleEntityNotFound(_0x39423a,null))[_0x24c1('0x23')](respondWithResult(_0x39423a,null))['catch'](handleError(_0x39423a,null));};exports[_0x24c1('0x56')]=function(_0x11c2da,_0x23dc96){return db[_0x24c1('0x51')][_0x24c1('0x56')](_0x11c2da['body'],{})[_0x24c1('0x23')](function(_0x231d98){var _0xea6ec3=_0x11c2da['user'][_0x24c1('0x38')]({'plain':!![]});if(!_0xea6ec3)throw new Error(_0x24c1('0x57'));if(_0xea6ec3[_0x24c1('0x58')]===_0x24c1('0x59')){var _0x22e378=_0x231d98[_0x24c1('0x38')]({'plain':!![]});var _0x193f3b=_0x24c1('0x39');return db[_0x24c1('0x5a')][_0x24c1('0x55')]({'where':{'name':_0x193f3b,'userProfileId':_0xea6ec3['userProfileId']},'raw':!![]})['then'](function(_0x3e68ca){if(_0x3e68ca&&_0x3e68ca[_0x24c1('0x5b')]===0x0){return db[_0x24c1('0x3a')][_0x24c1('0x56')]({'name':_0x22e378['name'],'resourceId':_0x22e378['id'],'type':_0x3e68ca[_0x24c1('0x3c')],'sectionId':_0x3e68ca['id']},{})[_0x24c1('0x23')](function(){return _0x231d98;});}else{return _0x231d98;}})[_0x24c1('0x5c')](function(_0x8a9052){logger[_0x24c1('0x28')](_0x24c1('0x5d'),_0x8a9052);throw _0x8a9052;});}return _0x231d98;})[_0x24c1('0x23')](respondWithResult(_0x23dc96,0xc9))['catch'](handleError(_0x23dc96,null));};exports['update']=function(_0x4d9e2c,_0x1f209b){if(_0x4d9e2c[_0x24c1('0x5e')]['id']){delete _0x4d9e2c[_0x24c1('0x5e')]['id'];}return db[_0x24c1('0x51')][_0x24c1('0x55')]({'where':{'id':_0x4d9e2c[_0x24c1('0x5f')]['id']},'include':[{'model':db[_0x24c1('0x3d')],'as':_0x24c1('0x3e')}]})['then'](handleEntityNotFound(_0x1f209b,null))[_0x24c1('0x23')](saveUpdates(_0x4d9e2c['body'],null))[_0x24c1('0x23')](respondWithResult(_0x1f209b,null))[_0x24c1('0x5c')](handleError(_0x1f209b,null));};exports['destroy']=function(_0x1e49c6,_0x6cc2a0){return db[_0x24c1('0x51')][_0x24c1('0x55')]({'where':{'id':_0x1e49c6['params']['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x6cc2a0,null))[_0x24c1('0x23')](removeEntity(_0x6cc2a0,null))[_0x24c1('0x5c')](handleError(_0x6cc2a0,null));};exports[_0x24c1('0x60')]=function(_0x39cee2,_0x32d247){return db[_0x24c1('0x51')]['describe']()[_0x24c1('0x23')](respondWithResult(_0x32d247,null))[_0x24c1('0x5c')](handleError(_0x32d247,null));};exports['addDisposition']=function(_0x378649,_0x131e4a,_0x532d42){if(_0x378649['body']['id']){delete _0x378649['body']['id'];}return db[_0x24c1('0x51')][_0x24c1('0x55')]({'where':{'id':_0x378649[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x131e4a,null))['then'](function(_0x5865ca){if(_0x5865ca){_0x378649[_0x24c1('0x5e')]['FaxAccountId']=_0x5865ca['id'];return db['Disposition'][_0x24c1('0x56')](_0x378649[_0x24c1('0x5e')]);}})[_0x24c1('0x23')](respondWithResult(_0x131e4a,null))[_0x24c1('0x5c')](handleError(_0x131e4a,null));};exports['getDispositions']=function(_0x32ed10,_0x11d57a,_0x2e1b7f){var _0xf149ac={'raw':![],'where':{}};var _0xcf3fd4={};var _0xd03dc9={'count':0x0,'rows':[]};return db[_0x24c1('0x51')][_0x24c1('0x61')]({'where':{'id':_0x32ed10[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x11d57a,null))[_0x24c1('0x23')](function(_0x55b329){if(_0x55b329){_0xcf3fd4[_0x24c1('0x42')]=_['keys'](db[_0x24c1('0x62')][_0x24c1('0x54')]);_0xcf3fd4[_0x24c1('0x43')]=_[_0x24c1('0x44')](_0x32ed10[_0x24c1('0x43')]);_0xcf3fd4['filters']=_[_0x24c1('0x63')](_0xcf3fd4[_0x24c1('0x42')],_0xcf3fd4[_0x24c1('0x43')]);_0xf149ac[_0x24c1('0x45')]=_[_0x24c1('0x63')](_0xcf3fd4[_0x24c1('0x42')],qs[_0x24c1('0x46')](_0x32ed10[_0x24c1('0x43')][_0x24c1('0x46')]));_0xf149ac[_0x24c1('0x45')]=_0xf149ac[_0x24c1('0x45')][_0x24c1('0x47')]?_0xf149ac[_0x24c1('0x45')]:_0xcf3fd4[_0x24c1('0x42')];if(!_0x32ed10[_0x24c1('0x43')]['hasOwnProperty'](_0x24c1('0x64'))){_0xf149ac[_0x24c1('0x49')]=qs['limit'](_0x32ed10[_0x24c1('0x43')][_0x24c1('0x49')]);_0xf149ac[_0x24c1('0x2f')]=qs[_0x24c1('0x2f')](_0x32ed10[_0x24c1('0x43')]['offset']);}_0xf149ac[_0x24c1('0x4a')]=qs[_0x24c1('0x4b')](_0x32ed10[_0x24c1('0x43')]['sort']);_0xf149ac[_0x24c1('0x4f')]=qs[_0x24c1('0x4c')](_[_0x24c1('0x65')](_0x32ed10[_0x24c1('0x43')],_0xcf3fd4[_0x24c1('0x4c')]));_0xf149ac[_0x24c1('0x4f')]['FaxAccountId']=_0x55b329['id'];if(_0x32ed10[_0x24c1('0x43')][_0x24c1('0x4d')]){_0xf149ac[_0x24c1('0x4f')]=_[_0x24c1('0x4e')](_0xf149ac['where'],{'$or':_[_0x24c1('0x3f')](_0xf149ac[_0x24c1('0x45')],function(_0x40eb9a){var _0x46030c={};_0x46030c[_0x40eb9a]={'$like':'%'+_0x32ed10[_0x24c1('0x43')][_0x24c1('0x4d')]+'%'};return _0x46030c;})});}_0xf149ac=_[_0x24c1('0x4e')]({},_0xf149ac,_0x32ed10[_0x24c1('0x50')]);return db['Disposition'][_0x24c1('0x31')]({'where':_0xf149ac['where']})[_0x24c1('0x23')](function(_0x3ba350){_0xd03dc9[_0x24c1('0x31')]=_0x3ba350;if(_0x32ed10[_0x24c1('0x43')]['includeAll']){_0xf149ac[_0x24c1('0x66')]=[{'all':!![]}];}return db[_0x24c1('0x62')][_0x24c1('0x67')](_0xf149ac);})[_0x24c1('0x23')](function(_0x204b28){_0xd03dc9['rows']=_0x204b28;return _0xd03dc9;});}})['then'](respondWithFilteredResult(_0x11d57a,_0xf149ac))[_0x24c1('0x5c')](handleError(_0x11d57a,null));};exports[_0x24c1('0x68')]=function(_0x1f7de7,_0x1a4074,_0x3c1f4a){return db[_0x24c1('0x51')][_0x24c1('0x55')]({'where':{'id':_0x1f7de7[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x1a4074,null))[_0x24c1('0x23')](function(_0xde752d){if(_0xde752d){return _0xde752d['removeDispositions'](_0x1f7de7[_0x24c1('0x43')][_0x24c1('0x69')]);}})[_0x24c1('0x23')](respondWithStatusCode(_0x1a4074,null))['catch'](handleError(_0x1a4074,null));};exports[_0x24c1('0x6a')]=function(_0x3c013f,_0x53c42e,_0x151f55){if(_0x3c013f['body']['id']){delete _0x3c013f[_0x24c1('0x5e')]['id'];}return db[_0x24c1('0x51')][_0x24c1('0x55')]({'where':{'id':_0x3c013f[_0x24c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x53c42e,null))[_0x24c1('0x23')](function(_0x5731fa){if(_0x5731fa){_0x3c013f[_0x24c1('0x5e')][_0x24c1('0x6b')]=_0x5731fa['id'];return db[_0x24c1('0x6c')]['create'](_0x3c013f[_0x24c1('0x5e')]);}})[_0x24c1('0x23')](respondWithResult(_0x53c42e,null))[_0x24c1('0x5c')](handleError(_0x53c42e,null));};exports[_0x24c1('0x6d')]=function(_0x1da858,_0x190005,_0x12ec40){var _0x87b2e3={'raw':![],'where':{}};var _0x1890c4={};var _0x393ecc={'count':0x0,'rows':[]};return db['FaxAccount'][_0x24c1('0x61')]({'where':{'id':_0x1da858[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x190005,null))[_0x24c1('0x23')](function(_0x27bf5c){if(_0x27bf5c){_0x1890c4[_0x24c1('0x42')]=_[_0x24c1('0x44')](db[_0x24c1('0x6c')][_0x24c1('0x54')]);_0x1890c4[_0x24c1('0x43')]=_['keys'](_0x1da858['query']);_0x1890c4['filters']=_[_0x24c1('0x63')](_0x1890c4[_0x24c1('0x42')],_0x1890c4[_0x24c1('0x43')]);_0x87b2e3['attributes']=_[_0x24c1('0x63')](_0x1890c4[_0x24c1('0x42')],qs[_0x24c1('0x46')](_0x1da858['query']['fields']));_0x87b2e3[_0x24c1('0x45')]=_0x87b2e3[_0x24c1('0x45')][_0x24c1('0x47')]?_0x87b2e3[_0x24c1('0x45')]:_0x1890c4[_0x24c1('0x42')];if(!_0x1da858[_0x24c1('0x43')][_0x24c1('0x48')](_0x24c1('0x64'))){_0x87b2e3[_0x24c1('0x49')]=qs[_0x24c1('0x49')](_0x1da858['query']['limit']);_0x87b2e3[_0x24c1('0x2f')]=qs[_0x24c1('0x2f')](_0x1da858['query'][_0x24c1('0x2f')]);}_0x87b2e3['order']=qs[_0x24c1('0x4b')](_0x1da858[_0x24c1('0x43')][_0x24c1('0x4b')]);_0x87b2e3[_0x24c1('0x4f')]=qs[_0x24c1('0x4c')](_[_0x24c1('0x65')](_0x1da858[_0x24c1('0x43')],_0x1890c4[_0x24c1('0x4c')]));_0x87b2e3['where'][_0x24c1('0x6b')]=_0x27bf5c['id'];if(_0x1da858[_0x24c1('0x43')][_0x24c1('0x4d')]){_0x87b2e3[_0x24c1('0x4f')]=_[_0x24c1('0x4e')](_0x87b2e3[_0x24c1('0x4f')],{'$or':_[_0x24c1('0x3f')](_0x87b2e3[_0x24c1('0x45')],function(_0x17a8ac){var _0x283cca={};_0x283cca[_0x17a8ac]={'$like':'%'+_0x1da858['query'][_0x24c1('0x4d')]+'%'};return _0x283cca;})});}_0x87b2e3=_[_0x24c1('0x4e')]({},_0x87b2e3,_0x1da858[_0x24c1('0x50')]);return db[_0x24c1('0x6c')]['count']({'where':_0x87b2e3['where']})[_0x24c1('0x23')](function(_0x54c9d8){_0x393ecc[_0x24c1('0x31')]=_0x54c9d8;if(_0x1da858[_0x24c1('0x43')]['includeAll']){_0x87b2e3[_0x24c1('0x66')]=[{'all':!![]}];}return db['CannedAnswer'][_0x24c1('0x67')](_0x87b2e3);})[_0x24c1('0x23')](function(_0x236cbb){_0x393ecc[_0x24c1('0x53')]=_0x236cbb;return _0x393ecc;});}})[_0x24c1('0x23')](respondWithFilteredResult(_0x190005,_0x87b2e3))[_0x24c1('0x5c')](handleError(_0x190005,null));};exports[_0x24c1('0x6e')]=function(_0x4e66f8,_0x4c0c67,_0x52ee89){return db[_0x24c1('0x51')]['find']({'where':{'id':_0x4e66f8[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x4c0c67,null))[_0x24c1('0x23')](function(_0x63b974){if(_0x63b974){return _0x63b974['removeAnswers'](_0x4e66f8[_0x24c1('0x43')][_0x24c1('0x69')]);}})[_0x24c1('0x23')](respondWithStatusCode(_0x4c0c67,null))[_0x24c1('0x5c')](handleError(_0x4c0c67,null));};exports[_0x24c1('0x6f')]=function(_0x20b08f,_0x2af526,_0xe588f1){return db[_0x24c1('0x70')][_0x24c1('0x55')]({'where':{'id':_0x20b08f[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x2af526,null))[_0x24c1('0x23')](function(_0x230bca){if(_0x230bca){return _0x230bca[_0x24c1('0x6f')](_0x20b08f[_0x24c1('0x5e')][_0x24c1('0x69')],_[_0x24c1('0x71')](_0x20b08f[_0x24c1('0x5e')],[_0x24c1('0x69'),'id'])||{});}})[_0x24c1('0x23')](respondWithResult(_0x2af526,null))['catch'](handleError(_0x2af526,null));};exports[_0x24c1('0x72')]=function(_0x297cb7,_0x4202eb,_0x353e98){var _0x18dbeb={'raw':![],'where':{}};var _0x5499b4={};var _0x582001={'count':0x0,'rows':[]};return db[_0x24c1('0x51')][_0x24c1('0x61')]({'where':{'id':_0x297cb7[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x4202eb,null))[_0x24c1('0x23')](function(_0x5467fa){if(_0x5467fa){_0x5499b4['model']=_[_0x24c1('0x44')](db[_0x24c1('0x70')][_0x24c1('0x54')]);_0x5499b4[_0x24c1('0x43')]=_['keys'](_0x297cb7[_0x24c1('0x43')]);_0x5499b4[_0x24c1('0x4c')]=_[_0x24c1('0x63')](_0x5499b4['model'],_0x5499b4['query']);_0x18dbeb[_0x24c1('0x45')]=_[_0x24c1('0x63')](_0x5499b4[_0x24c1('0x42')],qs[_0x24c1('0x46')](_0x297cb7[_0x24c1('0x43')][_0x24c1('0x46')]));_0x18dbeb[_0x24c1('0x45')]=_0x18dbeb[_0x24c1('0x45')][_0x24c1('0x47')]?_0x18dbeb[_0x24c1('0x45')]:_0x5499b4[_0x24c1('0x42')];if(!_0x297cb7[_0x24c1('0x43')]['hasOwnProperty']('nolimit')){_0x18dbeb[_0x24c1('0x49')]=qs[_0x24c1('0x49')](_0x297cb7[_0x24c1('0x43')][_0x24c1('0x49')]);_0x18dbeb[_0x24c1('0x2f')]=qs[_0x24c1('0x2f')](_0x297cb7[_0x24c1('0x43')][_0x24c1('0x2f')]);}_0x18dbeb[_0x24c1('0x4a')]=qs['sort'](_0x297cb7['query'][_0x24c1('0x4b')]);_0x18dbeb[_0x24c1('0x4f')]=qs[_0x24c1('0x4c')](_[_0x24c1('0x65')](_0x297cb7[_0x24c1('0x43')],_0x5499b4[_0x24c1('0x4c')]));_0x18dbeb[_0x24c1('0x4f')][_0x24c1('0x6b')]=_0x5467fa['id'];if(_0x297cb7[_0x24c1('0x43')][_0x24c1('0x4d')]){_0x18dbeb[_0x24c1('0x4f')]=_['merge'](_0x18dbeb[_0x24c1('0x4f')],{'$or':_['map'](_0x18dbeb['attributes'],function(_0x212c50){var _0x43765c={};_0x43765c[_0x212c50]={'$like':'%'+_0x297cb7[_0x24c1('0x43')][_0x24c1('0x4d')]+'%'};return _0x43765c;})});}_0x18dbeb=_['merge']({},_0x18dbeb,_0x297cb7[_0x24c1('0x50')]);return db[_0x24c1('0x70')][_0x24c1('0x31')]({'where':_0x18dbeb['where']})[_0x24c1('0x23')](function(_0x2f51ba){_0x582001[_0x24c1('0x31')]=_0x2f51ba;if(_0x297cb7[_0x24c1('0x43')][_0x24c1('0x52')]){_0x18dbeb[_0x24c1('0x66')]=[{'model':db[_0x24c1('0x73')],'as':_0x24c1('0x74'),'required':![]},{'model':db[_0x24c1('0x75')],'as':_0x24c1('0x76'),'attributes':[_0x24c1('0x3c'),_0x24c1('0x77'),'internal'],'required':![]},{'model':db[_0x24c1('0x78')],'as':_0x24c1('0x79'),'attributes':['id','name',_0x24c1('0x7a')],'where':_0x297cb7[_0x24c1('0x43')][_0x24c1('0x7b')]?{'id':_0x297cb7[_0x24c1('0x43')][_0x24c1('0x7b')]}:undefined,'required':_0x297cb7[_0x24c1('0x43')][_0x24c1('0x7b')]?!![]:![]}];}return db[_0x24c1('0x70')][_0x24c1('0x67')](_0x18dbeb);})[_0x24c1('0x23')](function(_0x26399b){_0x582001[_0x24c1('0x53')]=_0x26399b;return _0x582001;});}})[_0x24c1('0x23')](respondWithFilteredResult(_0x4202eb,_0x18dbeb))[_0x24c1('0x5c')](handleError(_0x4202eb,null));};exports['addApplications']=function(_0xa2796d,_0x55a454){var _0x49c494=_0xa2796d['params']['id'];var _0x408ff8=_0xa2796d[_0x24c1('0x5e')];var _0x1a2ff5=0xc8;var _0x195151=null;return db['sequelize'][_0x24c1('0x7c')]({'isolationLevel':db['sequelize']['Transaction'][_0x24c1('0x7d')][_0x24c1('0x7e')]},function(_0xd922ee){return db[_0x24c1('0x51')][_0x24c1('0x61')]({'where':{'id':_0x49c494},'transaction':_0xd922ee})[_0x24c1('0x23')](function(_0x19c641){if(_0x19c641){return db[_0x24c1('0x7f')][_0x24c1('0x37')]({'where':{'FaxAccountId':_0x49c494},'transaction':_0xd922ee})[_0x24c1('0x23')](function(){var _0x267e1c=_[_0x24c1('0x3f')](_0x408ff8,function(_0x40a9f2){_0x40a9f2[_0x24c1('0x6b')]=_0x49c494;return _0x40a9f2;});return db['FaxApplication'][_0x24c1('0x80')](_0x267e1c,{'transaction':_0xd922ee});});}else{_0x1a2ff5=0x194;_0x195151=[];}});})[_0x24c1('0x23')](function(){if(_0x1a2ff5!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x49c494},'order':_0x24c1('0x81')})[_0x24c1('0x23')](function(_0x466036){_0x195151=_0x466036;});}})[_0x24c1('0x5c')](function(_0xb93e9){_0x1a2ff5=0x1f4;logger['error'](_0xb93e9[_0x24c1('0x3b')]);if(_0xb93e9[_0x24c1('0x3c')]){delete _0xb93e9[_0x24c1('0x3c')];}_0x195151=_0xb93e9;})['finally'](function(){if(_0x195151===null){_0x55a454[_0x24c1('0x2b')](_0x1a2ff5);}else{if(_0x1a2ff5===0x1f4){_0x55a454[_0x24c1('0x2c')](_0x1a2ff5)['send'](_0x195151);}else{_0x55a454[_0x24c1('0x2c')](_0x1a2ff5)[_0x24c1('0x2e')](_0x195151);}}});};exports[_0x24c1('0x82')]=function(_0x4176e0,_0x1e69c3,_0x545fe9){var _0x312818={};var _0xbcd9bc={};var _0x55ccff;var _0x529456;return db[_0x24c1('0x51')][_0x24c1('0x61')]({'where':{'id':_0x4176e0['params']['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x1e69c3,null))['then'](function(_0x199dd7){if(_0x199dd7){_0x55ccff=_0x199dd7;_0xbcd9bc[_0x24c1('0x42')]=_[_0x24c1('0x44')](db[_0x24c1('0x7f')][_0x24c1('0x54')]);_0xbcd9bc[_0x24c1('0x43')]=_['keys'](_0x4176e0[_0x24c1('0x43')]);_0xbcd9bc['filters']=_[_0x24c1('0x63')](_0xbcd9bc[_0x24c1('0x42')],_0xbcd9bc[_0x24c1('0x43')]);_0x312818['attributes']=_[_0x24c1('0x63')](_0xbcd9bc[_0x24c1('0x42')],qs[_0x24c1('0x46')](_0x4176e0[_0x24c1('0x43')]['fields']));_0x312818[_0x24c1('0x45')]=_0x312818[_0x24c1('0x45')][_0x24c1('0x47')]?_0x312818[_0x24c1('0x45')]:_0xbcd9bc[_0x24c1('0x42')];_0x312818['order']=qs[_0x24c1('0x4b')](_0x4176e0[_0x24c1('0x43')][_0x24c1('0x4b')]);_0x312818[_0x24c1('0x4f')]=qs[_0x24c1('0x4c')](_['pick'](_0x4176e0[_0x24c1('0x43')],_0xbcd9bc[_0x24c1('0x4c')]));if(_0x4176e0[_0x24c1('0x43')]['filter']){_0x312818['where']=_['merge'](_0x312818[_0x24c1('0x4f')],{'$or':_[_0x24c1('0x3f')](_0x312818[_0x24c1('0x45')],function(_0x51bb9b){var _0x47bc9e={};_0x47bc9e[_0x51bb9b]={'$like':'%'+_0x4176e0[_0x24c1('0x43')]['filter']+'%'};return _0x47bc9e;})});}_0x312818=_['merge']({},_0x312818,_0x4176e0[_0x24c1('0x50')]);return _0x55ccff[_0x24c1('0x82')](_0x312818);}})[_0x24c1('0x23')](function(_0xbda0ee){if(_0xbda0ee){_0x529456=_0xbda0ee[_0x24c1('0x47')];if(!_0x4176e0[_0x24c1('0x43')][_0x24c1('0x48')](_0x24c1('0x64'))){_0x312818[_0x24c1('0x49')]=qs['limit'](_0x4176e0[_0x24c1('0x43')][_0x24c1('0x49')]);_0x312818[_0x24c1('0x2f')]=qs[_0x24c1('0x2f')](_0x4176e0[_0x24c1('0x43')][_0x24c1('0x2f')]);}return _0x55ccff[_0x24c1('0x82')](_0x312818);}})[_0x24c1('0x23')](function(_0x4e244a){if(_0x4e244a){return _0x4e244a?{'count':_0x529456,'rows':_0x4e244a}:null;}})[_0x24c1('0x23')](respondWithResult(_0x1e69c3,null))[_0x24c1('0x5c')](handleError(_0x1e69c3,null));};function Extension(_0x1ba3a6,_0x1b377e,_0x39dbee,_0x565396){this[_0x24c1('0x83')]=_0x24c1('0x84');this[_0x24c1('0x85')]=_0x1ba3a6[_0x24c1('0x86')];this[_0x24c1('0x87')]=_0x565396;this[_0x24c1('0x40')]='system';this[_0x24c1('0x88')]='Fax\x20Extension';this[_0x24c1('0x6b')]=_0x1ba3a6['id'];this[_0x24c1('0x81')]=_0x1b377e;this[_0x24c1('0x89')]=_0x39dbee;}function createExtensionsReciveFax(_0x90bc9b){var _0x26d837=0x1;var _0x4149c0=[];_0x4149c0[_0x24c1('0x8a')](new Extension(_0x90bc9b,_0x26d837,'',_0x24c1('0x8b')));_0x26d837+=0x1;_0x4149c0[_0x24c1('0x8a')](new Extension(_0x90bc9b,_0x26d837,'CDR(type)=inbound-fax',_0x24c1('0x8c')));_0x26d837+=0x1;for(var _0x57abbc in _0x90bc9b){if(_0x90bc9b[_0x24c1('0x48')](_0x57abbc)&&(_0x57abbc==='ecm'||_0x57abbc==='localstationid'||_0x57abbc===_0x24c1('0x8d')||_0x57abbc===_0x24c1('0x8e')||_0x57abbc==='headerinfo'||_0x57abbc==='maxrate'||_0x57abbc===_0x24c1('0x8f')||_0x57abbc==='modem'||_0x57abbc==='t38timeout')){_0x4149c0['push'](new Extension(_0x90bc9b,_0x26d837,'FAXOPT('+_0x57abbc+')='+_0x90bc9b[_0x57abbc],_0x24c1('0x8c')));_0x26d837+=0x1;}}_0x4149c0[_0x24c1('0x8a')](new Extension(_0x90bc9b,_0x26d837,'6','Wait'));_0x26d837+=0x1;_0x4149c0[_0x24c1('0x8a')](new Extension(_0x90bc9b,_0x26d837,_0x24c1('0x90'),_0x24c1('0x91')));_0x26d837=0x0;return _0x4149c0;}exports[_0x24c1('0x92')]=function(_0x34c591,_0x24c910,_0x52ee09){var _0x3fcca9;return db['sequelize'][_0x24c1('0x7c')](function(_0x5d7204){return db[_0x24c1('0x51')][_0x24c1('0x56')](_0x34c591[_0x24c1('0x5e')],{'transaction':_0x5d7204})[_0x24c1('0x23')](function(_0x30a878){_0x3fcca9=_0x30a878[_0x24c1('0x38')]({'plain':!![]});return db[_0x24c1('0x93')]['bulkCreate'](createExtensionsReciveFax(_0x3fcca9),{'transaction':_0x5d7204});});})[_0x24c1('0x23')](function(){return _0x3fcca9;})[_0x24c1('0x23')](respondWithResult(_0x24c910,null))['catch'](handleError(_0x24c910,null));};exports['updateAccountApplications']=function(_0x5300e0,_0x56a04d,_0x37750f){var _0x2f34ea;return db['sequelize'][_0x24c1('0x7c')](function(_0x393c8c){return db[_0x24c1('0x51')]['update'](_0x5300e0[_0x24c1('0x5e')],{'where':{'id':_0x5300e0['body']['id']},'transaction':_0x393c8c})['then'](function(_0x30304d){return db['VoiceExtension'][_0x24c1('0x37')]({'where':{'FaxAccountId':_0x5300e0[_0x24c1('0x5e')]['id']},'transaction':_0x393c8c})[_0x24c1('0x23')](function(_0x4ae480){return db[_0x24c1('0x93')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x5300e0['body'],['tech',_0x24c1('0x41'),_0x24c1('0x94'),_0x24c1('0x95'),_0x24c1('0x96'),'ListId'])),{'transaction':_0x393c8c});});});})[_0x24c1('0x23')](function(){return db[_0x24c1('0x51')][_0x24c1('0x97')](_0x5300e0['body']['id']);})[_0x24c1('0x23')](respondWithResult(_0x56a04d,null))[_0x24c1('0x5c')](handleError(_0x56a04d,null));};exports[_0x24c1('0x98')]=function(_0x5304d4,_0x4e31dc,_0x26263b){var _0x3acba3={'raw':!![],'where':{}};var _0x2eb197={};var _0x621dc7={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5304d4[_0x24c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4e31dc,null))[_0x24c1('0x23')](function(_0x509057){if(_0x509057){_0x2eb197[_0x24c1('0x42')]=_[_0x24c1('0x44')](db[_0x24c1('0x99')][_0x24c1('0x54')]);_0x2eb197[_0x24c1('0x43')]=_[_0x24c1('0x44')](_0x5304d4[_0x24c1('0x43')]);_0x2eb197[_0x24c1('0x4c')]=_[_0x24c1('0x63')](_0x2eb197['model'],_0x2eb197['query']);_0x3acba3[_0x24c1('0x45')]=_[_0x24c1('0x63')](_0x2eb197[_0x24c1('0x42')],qs[_0x24c1('0x46')](_0x5304d4['query'][_0x24c1('0x46')]));_0x3acba3['attributes']=_0x3acba3[_0x24c1('0x45')][_0x24c1('0x47')]?_0x3acba3[_0x24c1('0x45')]:_0x2eb197[_0x24c1('0x42')];if(!_0x5304d4['query']['hasOwnProperty'](_0x24c1('0x64'))){_0x3acba3[_0x24c1('0x49')]=qs[_0x24c1('0x49')](_0x5304d4[_0x24c1('0x43')][_0x24c1('0x49')]);_0x3acba3[_0x24c1('0x2f')]=qs[_0x24c1('0x2f')](_0x5304d4[_0x24c1('0x43')][_0x24c1('0x2f')]);}_0x3acba3[_0x24c1('0x4a')]=qs['sort'](_0x5304d4[_0x24c1('0x43')][_0x24c1('0x4b')]);_0x3acba3['where']=qs[_0x24c1('0x4c')](_[_0x24c1('0x65')](_0x5304d4[_0x24c1('0x43')],_0x2eb197[_0x24c1('0x4c')]));_0x3acba3[_0x24c1('0x4f')]['FaxAccountId']=_0x509057['id'];if(_0x5304d4['query'][_0x24c1('0x4d')]){_0x3acba3[_0x24c1('0x4f')]=_[_0x24c1('0x4e')](_0x3acba3[_0x24c1('0x4f')],{'$or':_['map'](_0x3acba3[_0x24c1('0x45')],function(_0x1dcc1f){var _0x5ed9e8={};_0x5ed9e8[_0x1dcc1f]={'$like':'%'+_0x5304d4['query'][_0x24c1('0x4d')]+'%'};return _0x5ed9e8;})});}if(_0x5304d4[_0x24c1('0x43')]['$gte']){var _0x28f80b=_0x5304d4[_0x24c1('0x43')][_0x24c1('0x9a')][_0x24c1('0x9b')](',');var _0x1a161a={};_0x1a161a[_0x28f80b[0x0]]={'$gte':moment(_0x28f80b[0x1])[_0x24c1('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3acba3['where']=_[_0x24c1('0x4e')](_0x3acba3[_0x24c1('0x4f')],_0x1a161a);}_0x3acba3=_[_0x24c1('0x4e')]({},_0x3acba3,_0x5304d4['options']);return db[_0x24c1('0x99')][_0x24c1('0x31')]({'where':_0x3acba3[_0x24c1('0x4f')]})[_0x24c1('0x23')](function(_0x582842){_0x621dc7['count']=_0x582842;if(_0x5304d4[_0x24c1('0x43')]['includeAll']){_0x3acba3['include']=[{'all':!![]}];}return db[_0x24c1('0x99')][_0x24c1('0x67')](_0x3acba3);})[_0x24c1('0x23')](function(_0x369494){_0x621dc7[_0x24c1('0x53')]=_0x369494;return _0x621dc7;});}})[_0x24c1('0x23')](respondWithFilteredResult(_0x4e31dc,_0x3acba3))['catch'](handleError(_0x4e31dc,null));};exports[_0x24c1('0x9d')]=function(_0x25e905,_0x331dd7,_0x9a4787){var _0x4c9efb,_0x8690e7={},_0x4dc035;if(_0x25e905[_0x24c1('0x5e')]['to']){_0x4dc035=_0x25e905['body']['to'][0x0];}return db[_0x24c1('0x51')][_0x24c1('0x55')]({'where':{'id':_0x25e905['params']['id']},'include':[{'model':db[_0x24c1('0x9e')],'as':'List','include':[{'model':db['CmContact'],'as':_0x24c1('0x9f'),'where':{'fax':_0x4dc035},'limit':0x1,'order':[[_0x24c1('0x95'),_0x24c1('0xa0')]]}]}]})['then'](handleEntityNotFound(_0x331dd7,null))[_0x24c1('0x23')](function(_0x5891b3){_0x4c9efb=_0x5891b3;if(_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')]&&_0x25e905[_0x24c1('0x5e')]['attachments']['length']){for(var _0x14f5fb=0x0;_0x14f5fb<_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][_0x24c1('0x47')];_0x14f5fb+=0x1){_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][_0x14f5fb]={'filename':_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][_0x14f5fb]['name'],'id':_0x25e905['body']['attachments'][_0x14f5fb]['id'],'path':path['join'](config[_0x24c1('0xa2')],_0x24c1('0xa3'),_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][_0x14f5fb]['basename'])};}}return respondWithRpcPromise(_0x24c1('0xa4'),_0x24c1('0xa4'),{'FaxAccountId':_[_0x24c1('0xa5')](_0x25e905[_0x24c1('0x5f')]['id'])?undefined:_0x25e905['params']['id'],'path':_[_0x24c1('0xa5')](_0x25e905['body'][_0x24c1('0xa1')][0x0][_0x24c1('0x9')])?undefined:_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][0x0][_0x24c1('0x9')],'fax':_[_0x24c1('0xa5')](_0x25e905[_0x24c1('0x5e')]['to'][0x0])?undefined:_0x25e905['body']['to'][0x0]},client9002);})[_0x24c1('0x23')](function(){if(_0x4c9efb){if(_[_0x24c1('0xa5')](_0x25e905['body'][_0x24c1('0xa6')])){_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa6')]=util[_0x24c1('0x9c')](_0x24c1('0xa7'),_0x4c9efb[_0x24c1('0x3c')],_0x4c9efb[_0x24c1('0xa8')]);}if(_0x4c9efb[_0x24c1('0xa9')]){if(_0x4c9efb['List']['Contacts'][_0x24c1('0x47')]){return _0x4c9efb[_0x24c1('0xa9')][_0x24c1('0x9f')][0x0];}else{return db[_0x24c1('0x73')][_0x24c1('0x56')](_[_0x24c1('0x1c')](_0x25e905[_0x24c1('0x5e')],{'firstName':_0x25e905[_0x24c1('0x5e')]['to'][0x0],'phone':_0x25e905[_0x24c1('0x5e')]['to'][0x0],'fax':_0x25e905['body']['to'][0x0],'ListId':_0x4c9efb[_0x24c1('0xaa')]}));}}else{throw new Error(_0x24c1('0xab'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x24c1('0x23')](function(_0xebf08){if(_0xebf08){return db[_0x24c1('0x70')][_0x24c1('0x55')]({'where':{'ContactId':_0xebf08['id'],'closed':![],'FaxAccountId':_0x4c9efb['id']}})['then'](function(_0x2b80bf){if(_0x2b80bf){return[_0x2b80bf,![]];}return db[_0x24c1('0x70')]['create']({'UserId':_0x25e905[_0x24c1('0x59')]['id'],'ContactId':_0xebf08['id'],'FaxAccountId':_0x4c9efb['id'],'fax':_0x25e905[_0x24c1('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x24c1('0x4e')](_0x25e905['body'],{'read':![],'body':_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][0x0][_0x24c1('0xac')],'FaxAccountId':_0x4c9efb['id'],'UserId':_0x25e905[_0x24c1('0x59')]['id'],'ContactId':_0xebf08['id'],'AttachmentId':_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][0x0]['id']})]},{'include':[{'model':db[_0x24c1('0x99')],'as':_0x24c1('0xad')}]})[_0x24c1('0x23')](function(_0xa961e0){return[_0xa961e0,!![]];});});}else{throw new Error(_0x24c1('0xae'));}})[_0x24c1('0xaf')](function(_0x5da02b,_0x16ed18){if(_0x16ed18){return _0x5da02b;}return db['FaxMessage'][_0x24c1('0x56')]({'direction':_0x24c1('0xb0'),'read':![],'body':_0x25e905['body']['attachments'][0x0]['filename'],'FaxAccountId':_0x4c9efb['id'],'FaxInteractionId':_0x5da02b['id'],'UserId':_0x25e905[_0x24c1('0x59')]['id'],'ContactId':_0x5da02b[_0x24c1('0xb1')],'AttachmentId':_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][0x0]['id']})['then'](function(_0x371462){_0x5da02b[_0x24c1('0xb2')][_0x24c1('0xad')]=[];_0x5da02b[_0x24c1('0xb2')][_0x24c1('0xad')][_0x24c1('0x8a')](_0x371462['dataValues']);return _0x5da02b;});})[_0x24c1('0x23')](function(_0x30d01d){respondWithRpcPromise(_0x24c1('0xb3'),_0x24c1('0xb3'),{'FaxAccountId':_[_0x24c1('0xa5')](_0x25e905['params']['id'])?undefined:_0x25e905['params']['id'],'path':_[_0x24c1('0xa5')](_0x25e905[_0x24c1('0x5e')]['attachments'][0x0]['path'])?undefined:_0x25e905[_0x24c1('0x5e')][_0x24c1('0xa1')][0x0]['path'],'fax':_[_0x24c1('0xa5')](_0x25e905['body']['to'][0x0])?undefined:_0x25e905[_0x24c1('0x5e')]['to'][0x0],'AttachmentId':_0x25e905[_0x24c1('0x5e')]['attachments'][0x0]['id']},client9002)['then'](function(_0x1dcd30){logger[_0x24c1('0x24')]('SendFaxRpc,\x20%s',_0x1dcd30);})[_0x24c1('0x5c')](function(_0x36a943){logger[_0x24c1('0x24')](_0x24c1('0xb4'),_0x36a943);});return _0x30d01d;})[_0x24c1('0x23')](respondWithResult(_0x331dd7,null))['catch'](handleError(_0x331dd7,null));};exports[_0x24c1('0xb5')]=function(_0x237034,_0x5c1960,_0x1b29c2){return db['FaxAccount'][_0x24c1('0x55')]({'where':{'id':_0x237034[_0x24c1('0x5f')]['id']}})[_0x24c1('0x23')](handleEntityNotFound(_0x5c1960,null))[_0x24c1('0x23')](function(_0x1b3cc2){if(_0x1b3cc2){return _0x1b3cc2[_0x24c1('0xb5')](_0x237034[_0x24c1('0x5e')][_0x24c1('0x69')],_[_0x24c1('0x71')](_0x237034[_0x24c1('0x5e')],['ids','id'])||{})[_0x24c1('0xaf')](function(_0x19858b){for(var _0x5bae8d=0x0;_0x5bae8d<_0x237034['body'][_0x24c1('0x69')][_0x24c1('0x47')];_0x5bae8d+=0x1){socket[_0x24c1('0xb6')](_0x24c1('0xb7'),{'UserId':Number(_0x237034[_0x24c1('0x5e')][_0x24c1('0x69')][_0x5bae8d]),'FaxAccountId':Number(_0x237034[_0x24c1('0x5f')]['id'])});}return _0x19858b;});}})[_0x24c1('0x23')](respondWithResult(_0x5c1960,null))[_0x24c1('0x5c')](handleError(_0x5c1960,null));};exports[_0x24c1('0xb8')]=function(_0x53a21c,_0x1c04e3,_0x82ff72){return db['FaxAccount']['find']({'where':{'id':_0x53a21c[_0x24c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1c04e3,null))[_0x24c1('0x23')](function(_0x4b23c3){if(_0x4b23c3){return _0x4b23c3[_0x24c1('0xb8')](_0x53a21c[_0x24c1('0x43')][_0x24c1('0x69')])['then'](function(){if(_['isArray'](_0x53a21c[_0x24c1('0x43')]['ids'])){for(var _0x3b1487=0x0;_0x3b1487<_0x53a21c[_0x24c1('0x43')][_0x24c1('0x69')][_0x24c1('0x47')];_0x3b1487+=0x1){socket[_0x24c1('0xb6')]('userFaxAccount:remove',{'UserId':Number(_0x53a21c[_0x24c1('0x43')]['ids'][_0x3b1487]),'FaxAccountId':Number(_0x53a21c[_0x24c1('0x5f')]['id'])});}}else{socket['emit'](_0x24c1('0xb9'),{'UserId':Number(_0x53a21c[_0x24c1('0x43')]['ids']),'FaxAccountId':Number(_0x53a21c[_0x24c1('0x5f')]['id'])});}});}})[_0x24c1('0x23')](respondWithStatusCode(_0x1c04e3,null))[_0x24c1('0x5c')](handleError(_0x1c04e3,null));};exports[_0x24c1('0xba')]=function(_0x4170ea,_0x6b952d,_0x145e65){var _0x580be2={};var _0x2d4ce1={};var _0x186877;var _0x5b9e26;return db['FaxAccount'][_0x24c1('0x61')]({'where':{'id':_0x4170ea[_0x24c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x6b952d,null))[_0x24c1('0x23')](function(_0x153d32){if(_0x153d32){_0x186877=_0x153d32;_0x2d4ce1['model']=_[_0x24c1('0x44')](db[_0x24c1('0x75')][_0x24c1('0x54')]);_0x2d4ce1['query']=_[_0x24c1('0x44')](_0x4170ea[_0x24c1('0x43')]);_0x2d4ce1[_0x24c1('0x4c')]=_['intersection'](_0x2d4ce1[_0x24c1('0x42')],_0x2d4ce1[_0x24c1('0x43')]);_0x580be2[_0x24c1('0x45')]=_[_0x24c1('0x63')](_0x2d4ce1['model'],qs[_0x24c1('0x46')](_0x4170ea['query'][_0x24c1('0x46')]));_0x580be2[_0x24c1('0x45')]=_0x580be2[_0x24c1('0x45')][_0x24c1('0x47')]?_0x580be2[_0x24c1('0x45')]:_0x2d4ce1[_0x24c1('0x42')];_0x580be2[_0x24c1('0x4a')]=qs[_0x24c1('0x4b')](_0x4170ea[_0x24c1('0x43')][_0x24c1('0x4b')]);_0x580be2[_0x24c1('0x4f')]=qs['filters'](_['pick'](_0x4170ea[_0x24c1('0x43')],_0x2d4ce1['filters']));if(_0x4170ea[_0x24c1('0x43')][_0x24c1('0x4d')]){_0x580be2[_0x24c1('0x4f')]=_[_0x24c1('0x4e')](_0x580be2[_0x24c1('0x4f')],{'$or':_[_0x24c1('0x3f')](_0x580be2['attributes'],function(_0x517bd5){var _0x5f2fc9={};_0x5f2fc9[_0x517bd5]={'$like':'%'+_0x4170ea['query']['filter']+'%'};return _0x5f2fc9;})});}_0x580be2=_['merge']({},_0x580be2,_0x4170ea[_0x24c1('0x50')]);return _0x186877[_0x24c1('0xba')](_0x580be2);}})[_0x24c1('0x23')](function(_0x1008e0){if(_0x1008e0){_0x5b9e26=_0x1008e0[_0x24c1('0x47')];if(!_0x4170ea[_0x24c1('0x43')][_0x24c1('0x48')](_0x24c1('0x64'))){_0x580be2[_0x24c1('0x49')]=qs['limit'](_0x4170ea[_0x24c1('0x43')][_0x24c1('0x49')]);_0x580be2[_0x24c1('0x2f')]=qs[_0x24c1('0x2f')](_0x4170ea[_0x24c1('0x43')][_0x24c1('0x2f')]);}return _0x186877[_0x24c1('0xba')](_0x580be2);}})[_0x24c1('0x23')](function(_0x28a288){if(_0x28a288){return _0x28a288?{'count':_0x5b9e26,'rows':_0x28a288}:null;}})[_0x24c1('0x23')](respondWithResult(_0x6b952d,null))[_0x24c1('0x5c')](handleError(_0x6b952d,null));}; \ No newline at end of file +var _0xe4fc=['app','system','description','Fax\x20Extension','priority','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','bulkCreate','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','ListId','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','get','FaxAccounts','stack','name','send','mandatoryDispositionPause','map','FaxAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','Pause','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','hasOwnProperty','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll','finally','getApplications','context','from-voip-provider','localstationid'];(function(_0x4f7cc3,_0x5db362){var _0x441cd0=function(_0x4f335b){while(--_0x4f335b){_0x4f7cc3['push'](_0x4f7cc3['shift']());}};_0x441cd0(++_0x5db362);}(_0xe4fc,0x102));var _0xce4f=function(_0x4de1c3,_0xbe77b9){_0x4de1c3=_0x4de1c3-0x0;var _0x26acfe=_0xe4fc[_0x4de1c3];return _0x26acfe;};'use strict';var emlformat=require(_0xce4f('0x0'));var rimraf=require(_0xce4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce4f('0x2'));var moment=require(_0xce4f('0x3'));var BPromise=require(_0xce4f('0x4'));var Mustache=require('mustache');var util=require(_0xce4f('0x5'));var path=require('path');var sox=require(_0xce4f('0x6'));var csv=require(_0xce4f('0x7'));var ejs=require(_0xce4f('0x8'));var fs=require('fs');var fs_extra=require(_0xce4f('0x9'));var _=require('lodash');var squel=require(_0xce4f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xce4f('0xb'));var Papa=require(_0xce4f('0xc'));var Redis=require(_0xce4f('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xce4f('0xe'));var hardwareService=require(_0xce4f('0xf'));var logger=require(_0xce4f('0x10'))(_0xce4f('0x11'));var utils=require('../../config/utils');var config=require(_0xce4f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xce4f('0x13'))['db'];config[_0xce4f('0x14')]=_['defaults'](config[_0xce4f('0x14')],{'host':_0xce4f('0x15'),'port':0x18eb});var socket=require(_0xce4f('0x16'))(new Redis(config[_0xce4f('0x14')]));require(_0xce4f('0x17'))['register'](socket);var jayson=require(_0xce4f('0x18'));var client=jayson[_0xce4f('0x19')][_0xce4f('0x1a')]({'port':0x232c});var client9002=jayson[_0xce4f('0x19')][_0xce4f('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3ec228,_0x42f995,_0x13a420,_0x1dc1d3){return new BPromise(function(_0x460da6,_0x20e3ef){var _0x58897d=_0x1dc1d3||client;return _0x58897d[_0xce4f('0x1b')](_0x3ec228,_0x13a420)[_0xce4f('0x1c')](function(_0x5a8f1d){logger[_0xce4f('0x1d')](_0xce4f('0x1e'),_0x42f995,_0xce4f('0x1f'));logger[_0xce4f('0x20')](_0xce4f('0x21'),_0x42f995,_0xce4f('0x1f'),JSON['stringify'](_0x5a8f1d));if(_0x5a8f1d['error']){if(_0x5a8f1d[_0xce4f('0x22')][_0xce4f('0x23')]===0x1f4){logger[_0xce4f('0x22')](_0xce4f('0x1e'),_0x42f995,_0x5a8f1d[_0xce4f('0x22')][_0xce4f('0x24')]);return _0x20e3ef(_0x5a8f1d[_0xce4f('0x22')][_0xce4f('0x24')]);}logger[_0xce4f('0x22')]('FaxAccount,\x20%s,\x20%s',_0x42f995,_0x5a8f1d[_0xce4f('0x22')][_0xce4f('0x24')]);return _0x460da6(_0x5a8f1d[_0xce4f('0x22')][_0xce4f('0x24')]);}else{logger[_0xce4f('0x1d')]('FaxAccount,\x20%s,\x20%s',_0x42f995,_0xce4f('0x1f'));_0x460da6(_0x5a8f1d['result'][_0xce4f('0x24')]);}})[_0xce4f('0x25')](function(_0x4f11df){logger[_0xce4f('0x22')](_0xce4f('0x1e'),_0x42f995,_0x4f11df);_0x20e3ef(_0x4f11df);});});}function respondWithStatusCode(_0x5d7f3a,_0xec49c1){_0xec49c1=_0xec49c1||0xcc;return function(_0x1d9493){if(_0x1d9493){return _0x5d7f3a['sendStatus'](_0xec49c1);}return _0x5d7f3a[_0xce4f('0x26')](_0xec49c1)[_0xce4f('0x27')]();};}function respondWithResult(_0x21d1db,_0x2a6423){_0x2a6423=_0x2a6423||0xc8;return function(_0x31fc88){if(_0x31fc88){return _0x21d1db[_0xce4f('0x26')](_0x2a6423)[_0xce4f('0x28')](_0x31fc88);}};}function respondWithFilteredResult(_0x492eb7,_0x382dec){return function(_0xced00e){if(_0xced00e){var _0x47435f=typeof _0x382dec[_0xce4f('0x29')]===_0xce4f('0x2a')&&typeof _0x382dec['limit']===_0xce4f('0x2a');var _0x2e2c5a=_0xced00e[_0xce4f('0x2b')];var _0x4f18f3=_0x47435f?0x0:_0x382dec[_0xce4f('0x29')];var _0x241509=_0x47435f?_0xced00e[_0xce4f('0x2b')]:_0x382dec[_0xce4f('0x29')]+_0x382dec[_0xce4f('0x2c')];var _0xaf757e;if(_0x241509>=_0x2e2c5a){_0x241509=_0x2e2c5a;_0xaf757e=0xc8;}else{_0xaf757e=0xce;}_0x492eb7['status'](_0xaf757e);return _0x492eb7[_0xce4f('0x2d')](_0xce4f('0x2e'),_0x4f18f3+'-'+_0x241509+'/'+_0x2e2c5a)[_0xce4f('0x28')](_0xced00e);}return null;};}function patchUpdates(_0x132517){return function(_0x4494ea){try{jsonpatch['apply'](_0x4494ea,_0x132517,!![]);}catch(_0x17a5e7){return BPromise[_0xce4f('0x2f')](_0x17a5e7);}return _0x4494ea[_0xce4f('0x30')]();};}function saveUpdates(_0x282d84,_0x38363a){return function(_0x3dda44){if(_0x3dda44){return _0x3dda44[_0xce4f('0x31')](_0x282d84)[_0xce4f('0x1c')](function(_0x173663){return _0x173663;});}return null;};}function removeEntity(_0x3a2e9c,_0x2714ae){return function(_0x16692f){if(_0x16692f){return _0x16692f[_0xce4f('0x32')]()[_0xce4f('0x1c')](function(){var _0x309c99=_0x16692f[_0xce4f('0x33')]({'plain':!![]});var _0x26e448=_0xce4f('0x34');return db['UserProfileResource']['destroy']({'where':{'type':_0x26e448,'resourceId':_0x309c99['id']}})['then'](function(){return _0x16692f;});})[_0xce4f('0x1c')](function(){_0x3a2e9c[_0xce4f('0x26')](0xcc)[_0xce4f('0x27')]();});}};}function handleEntityNotFound(_0x585b4c,_0x191583){return function(_0xf0e7b8){if(!_0xf0e7b8){_0x585b4c['sendStatus'](0x194);}return _0xf0e7b8;};}function handleError(_0x4f1baf,_0x1664fe){_0x1664fe=_0x1664fe||0x1f4;return function(_0x2b2268){logger[_0xce4f('0x22')](_0x2b2268[_0xce4f('0x35')]);if(_0x2b2268['name']){delete _0x2b2268[_0xce4f('0x36')];}_0x4f1baf[_0xce4f('0x26')](_0x1664fe)[_0xce4f('0x37')](_0x2b2268);};}exports['index']=function(_0x110ebd,_0x9858b1){var _0x568f50={'include':[{'model':db['Pause'],'as':_0xce4f('0x38')}]},_0x446bc3={},_0x25c3be={'count':0x0,'rows':[]};var _0x4987ca=_[_0xce4f('0x39')](db[_0xce4f('0x3a')]['rawAttributes'],function(_0x1645c6){return{'name':_0x1645c6[_0xce4f('0x3b')],'type':_0x1645c6[_0xce4f('0x3c')]['key']};});_0x446bc3[_0xce4f('0x3d')]=_[_0xce4f('0x39')](_0x4987ca,_0xce4f('0x36'));_0x446bc3[_0xce4f('0x3e')]=_[_0xce4f('0x3f')](_0x110ebd[_0xce4f('0x3e')]);_0x446bc3[_0xce4f('0x40')]=_[_0xce4f('0x41')](_0x446bc3[_0xce4f('0x3d')],_0x446bc3[_0xce4f('0x3e')]);_0x568f50[_0xce4f('0x42')]=_[_0xce4f('0x41')](_0x446bc3['model'],qs[_0xce4f('0x43')](_0x110ebd[_0xce4f('0x3e')]['fields']));_0x568f50[_0xce4f('0x42')]=_0x568f50[_0xce4f('0x42')]['length']?_0x568f50[_0xce4f('0x42')]:_0x446bc3['model'];if(!_0x110ebd[_0xce4f('0x3e')]['hasOwnProperty'](_0xce4f('0x44'))){_0x568f50[_0xce4f('0x2c')]=qs[_0xce4f('0x2c')](_0x110ebd[_0xce4f('0x3e')][_0xce4f('0x2c')]);_0x568f50[_0xce4f('0x29')]=qs[_0xce4f('0x29')](_0x110ebd[_0xce4f('0x3e')][_0xce4f('0x29')]);}_0x568f50[_0xce4f('0x45')]=qs[_0xce4f('0x46')](_0x110ebd['query']['sort']);_0x568f50[_0xce4f('0x47')]=qs[_0xce4f('0x40')](_[_0xce4f('0x48')](_0x110ebd[_0xce4f('0x3e')],_0x446bc3['filters']),_0x4987ca);if(_0x110ebd[_0xce4f('0x3e')][_0xce4f('0x49')]){_0x568f50['where']=_[_0xce4f('0x4a')](_0x568f50[_0xce4f('0x47')],{'$or':_[_0xce4f('0x39')](_0x4987ca,function(_0x20b1fa){if(_0x20b1fa[_0xce4f('0x3c')]!==_0xce4f('0x4b')){var _0x37ba82={};_0x37ba82[_0x20b1fa[_0xce4f('0x36')]]={'$like':'%'+_0x110ebd[_0xce4f('0x3e')][_0xce4f('0x49')]+'%'};return _0x37ba82;}})});}_0x568f50=_[_0xce4f('0x4a')]({},_0x568f50,_0x110ebd['options']);var _0x3c7595={'where':_0x568f50[_0xce4f('0x47')]};return db[_0xce4f('0x3a')][_0xce4f('0x2b')](_0x3c7595)['then'](function(_0x3d1c3e){_0x25c3be['count']=_0x3d1c3e;if(_0x110ebd[_0xce4f('0x3e')][_0xce4f('0x4c')]){_0x568f50[_0xce4f('0x4d')]=[{'all':!![]}];}return db[_0xce4f('0x3a')][_0xce4f('0x4e')](_0x568f50);})[_0xce4f('0x1c')](function(_0x291e5e){_0x25c3be[_0xce4f('0x4f')]=_0x291e5e;return _0x25c3be;})['then'](respondWithFilteredResult(_0x9858b1,_0x568f50))[_0xce4f('0x25')](handleError(_0x9858b1,null));};exports[_0xce4f('0x50')]=function(_0x58b34c,_0x231705){var _0x29e1e8={'raw':![],'where':{'id':_0x58b34c[_0xce4f('0x51')]['id']},'include':[{'model':db[_0xce4f('0x52')],'as':_0xce4f('0x38')}]},_0x1771d2={};_0x1771d2[_0xce4f('0x3d')]=_[_0xce4f('0x3f')](db[_0xce4f('0x3a')][_0xce4f('0x53')]);_0x1771d2[_0xce4f('0x3e')]=_[_0xce4f('0x3f')](_0x58b34c['query']);_0x1771d2['filters']=_[_0xce4f('0x41')](_0x1771d2[_0xce4f('0x3d')],_0x1771d2['query']);_0x29e1e8[_0xce4f('0x42')]=_[_0xce4f('0x41')](_0x1771d2[_0xce4f('0x3d')],qs[_0xce4f('0x43')](_0x58b34c['query']['fields']));_0x29e1e8[_0xce4f('0x42')]=_0x29e1e8[_0xce4f('0x42')]['length']?_0x29e1e8['attributes']:_0x1771d2[_0xce4f('0x3d')];if(_0x58b34c[_0xce4f('0x3e')][_0xce4f('0x4c')]){_0x29e1e8[_0xce4f('0x4d')]=[{'all':!![]}];}_0x29e1e8=_[_0xce4f('0x4a')]({},_0x29e1e8,_0x58b34c['options']);return db[_0xce4f('0x3a')][_0xce4f('0x54')](_0x29e1e8)[_0xce4f('0x1c')](handleEntityNotFound(_0x231705,null))['then'](respondWithResult(_0x231705,null))[_0xce4f('0x25')](handleError(_0x231705,null));};exports['create']=function(_0x50478e,_0x3864b0){return db[_0xce4f('0x3a')][_0xce4f('0x55')](_0x50478e[_0xce4f('0x56')],{})[_0xce4f('0x1c')](function(_0x55179e){var _0x12051f=_0x50478e[_0xce4f('0x57')][_0xce4f('0x33')]({'plain':!![]});if(!_0x12051f)throw new Error(_0xce4f('0x58'));if(_0x12051f[_0xce4f('0x59')]==='user'){var _0x52d453=_0x55179e['get']({'plain':!![]});var _0x31ea2f='FaxAccounts';return db[_0xce4f('0x5a')][_0xce4f('0x54')]({'where':{'name':_0x31ea2f,'userProfileId':_0x12051f[_0xce4f('0x5b')]},'raw':!![]})[_0xce4f('0x1c')](function(_0x2b6a61){if(_0x2b6a61&&_0x2b6a61[_0xce4f('0x5c')]===0x0){return db[_0xce4f('0x5d')][_0xce4f('0x55')]({'name':_0x52d453[_0xce4f('0x36')],'resourceId':_0x52d453['id'],'type':_0x2b6a61[_0xce4f('0x36')],'sectionId':_0x2b6a61['id']},{})[_0xce4f('0x1c')](function(){return _0x55179e;});}else{return _0x55179e;}})[_0xce4f('0x25')](function(_0x33e255){logger[_0xce4f('0x22')](_0xce4f('0x5e'),_0x33e255);throw _0x33e255;});}return _0x55179e;})[_0xce4f('0x1c')](respondWithResult(_0x3864b0,0xc9))[_0xce4f('0x25')](handleError(_0x3864b0,null));};exports[_0xce4f('0x31')]=function(_0x5ecc28,_0x1f517e){if(_0x5ecc28[_0xce4f('0x56')]['id']){delete _0x5ecc28['body']['id'];}return db[_0xce4f('0x3a')]['find']({'where':{'id':_0x5ecc28[_0xce4f('0x51')]['id']},'include':[{'model':db[_0xce4f('0x52')],'as':_0xce4f('0x38')}]})[_0xce4f('0x1c')](handleEntityNotFound(_0x1f517e,null))[_0xce4f('0x1c')](saveUpdates(_0x5ecc28[_0xce4f('0x56')],null))[_0xce4f('0x1c')](respondWithResult(_0x1f517e,null))[_0xce4f('0x25')](handleError(_0x1f517e,null));};exports['destroy']=function(_0xbf7c64,_0x617426){return db[_0xce4f('0x3a')]['find']({'where':{'id':_0xbf7c64[_0xce4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x617426,null))[_0xce4f('0x1c')](removeEntity(_0x617426,null))['catch'](handleError(_0x617426,null));};exports['describe']=function(_0x33fe5e,_0x5b93fe){return db[_0xce4f('0x3a')]['describe']()[_0xce4f('0x1c')](respondWithResult(_0x5b93fe,null))[_0xce4f('0x25')](handleError(_0x5b93fe,null));};exports[_0xce4f('0x5f')]=function(_0x5922d4,_0x5d3650,_0x4f51ad){if(_0x5922d4[_0xce4f('0x56')]['id']){delete _0x5922d4[_0xce4f('0x56')]['id'];}return db[_0xce4f('0x3a')][_0xce4f('0x54')]({'where':{'id':_0x5922d4['params']['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x5d3650,null))[_0xce4f('0x1c')](function(_0x692698){if(_0x692698){_0x5922d4[_0xce4f('0x56')][_0xce4f('0x60')]=_0x692698['id'];return db[_0xce4f('0x61')][_0xce4f('0x55')](_0x5922d4['body']);}})[_0xce4f('0x1c')](respondWithResult(_0x5d3650,null))[_0xce4f('0x25')](handleError(_0x5d3650,null));};exports[_0xce4f('0x62')]=function(_0x36e855,_0x5e5593,_0x51c622){var _0x3c4c83={'raw':![],'where':{}};var _0x5aa0c9={};var _0x302e6e={'count':0x0,'rows':[]};return db[_0xce4f('0x3a')][_0xce4f('0x63')]({'where':{'id':_0x36e855[_0xce4f('0x51')]['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x5e5593,null))[_0xce4f('0x1c')](function(_0x487f41){if(_0x487f41){_0x5aa0c9[_0xce4f('0x3d')]=_[_0xce4f('0x3f')](db[_0xce4f('0x61')]['rawAttributes']);_0x5aa0c9[_0xce4f('0x3e')]=_[_0xce4f('0x3f')](_0x36e855[_0xce4f('0x3e')]);_0x5aa0c9[_0xce4f('0x40')]=_[_0xce4f('0x41')](_0x5aa0c9[_0xce4f('0x3d')],_0x5aa0c9['query']);_0x3c4c83[_0xce4f('0x42')]=_[_0xce4f('0x41')](_0x5aa0c9['model'],qs[_0xce4f('0x43')](_0x36e855[_0xce4f('0x3e')][_0xce4f('0x43')]));_0x3c4c83[_0xce4f('0x42')]=_0x3c4c83[_0xce4f('0x42')]['length']?_0x3c4c83[_0xce4f('0x42')]:_0x5aa0c9[_0xce4f('0x3d')];if(!_0x36e855[_0xce4f('0x3e')]['hasOwnProperty'](_0xce4f('0x44'))){_0x3c4c83[_0xce4f('0x2c')]=qs['limit'](_0x36e855[_0xce4f('0x3e')][_0xce4f('0x2c')]);_0x3c4c83[_0xce4f('0x29')]=qs['offset'](_0x36e855[_0xce4f('0x3e')][_0xce4f('0x29')]);}_0x3c4c83[_0xce4f('0x45')]=qs[_0xce4f('0x46')](_0x36e855['query'][_0xce4f('0x46')]);_0x3c4c83[_0xce4f('0x47')]=qs[_0xce4f('0x40')](_[_0xce4f('0x48')](_0x36e855[_0xce4f('0x3e')],_0x5aa0c9[_0xce4f('0x40')]));_0x3c4c83[_0xce4f('0x47')][_0xce4f('0x60')]=_0x487f41['id'];if(_0x36e855['query'][_0xce4f('0x49')]){_0x3c4c83[_0xce4f('0x47')]=_[_0xce4f('0x4a')](_0x3c4c83[_0xce4f('0x47')],{'$or':_[_0xce4f('0x39')](_0x3c4c83['attributes'],function(_0xc3ead1){var _0x208f17={};_0x208f17[_0xc3ead1]={'$like':'%'+_0x36e855[_0xce4f('0x3e')]['filter']+'%'};return _0x208f17;})});}_0x3c4c83=_['merge']({},_0x3c4c83,_0x36e855[_0xce4f('0x64')]);return db['Disposition'][_0xce4f('0x2b')]({'where':_0x3c4c83[_0xce4f('0x47')]})[_0xce4f('0x1c')](function(_0x20faa0){_0x302e6e['count']=_0x20faa0;if(_0x36e855[_0xce4f('0x3e')][_0xce4f('0x4c')]){_0x3c4c83[_0xce4f('0x4d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3c4c83);})[_0xce4f('0x1c')](function(_0x18ae31){_0x302e6e[_0xce4f('0x4f')]=_0x18ae31;return _0x302e6e;});}})[_0xce4f('0x1c')](respondWithFilteredResult(_0x5e5593,_0x3c4c83))[_0xce4f('0x25')](handleError(_0x5e5593,null));};exports[_0xce4f('0x65')]=function(_0x26b1b6,_0x394fe0,_0x8d806a){return db[_0xce4f('0x3a')][_0xce4f('0x54')]({'where':{'id':_0x26b1b6[_0xce4f('0x51')]['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x394fe0,null))[_0xce4f('0x1c')](function(_0x12b64a){if(_0x12b64a){return _0x12b64a[_0xce4f('0x65')](_0x26b1b6['query'][_0xce4f('0x66')]);}})['then'](respondWithStatusCode(_0x394fe0,null))['catch'](handleError(_0x394fe0,null));};exports[_0xce4f('0x67')]=function(_0x404390,_0x51a2ed,_0x5e8ef6){if(_0x404390[_0xce4f('0x56')]['id']){delete _0x404390['body']['id'];}return db['FaxAccount'][_0xce4f('0x54')]({'where':{'id':_0x404390[_0xce4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x51a2ed,null))[_0xce4f('0x1c')](function(_0x56b458){if(_0x56b458){_0x404390[_0xce4f('0x56')][_0xce4f('0x60')]=_0x56b458['id'];return db[_0xce4f('0x68')][_0xce4f('0x55')](_0x404390[_0xce4f('0x56')]);}})[_0xce4f('0x1c')](respondWithResult(_0x51a2ed,null))[_0xce4f('0x25')](handleError(_0x51a2ed,null));};exports[_0xce4f('0x69')]=function(_0x6e6e3b,_0x39c158,_0x2684bf){var _0x2b7f4d={'raw':![],'where':{}};var _0x30948b={};var _0xe3f609={'count':0x0,'rows':[]};return db[_0xce4f('0x3a')][_0xce4f('0x63')]({'where':{'id':_0x6e6e3b[_0xce4f('0x51')]['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x39c158,null))[_0xce4f('0x1c')](function(_0x2d6592){if(_0x2d6592){_0x30948b[_0xce4f('0x3d')]=_[_0xce4f('0x3f')](db[_0xce4f('0x68')][_0xce4f('0x53')]);_0x30948b['query']=_[_0xce4f('0x3f')](_0x6e6e3b[_0xce4f('0x3e')]);_0x30948b[_0xce4f('0x40')]=_[_0xce4f('0x41')](_0x30948b[_0xce4f('0x3d')],_0x30948b['query']);_0x2b7f4d[_0xce4f('0x42')]=_[_0xce4f('0x41')](_0x30948b['model'],qs[_0xce4f('0x43')](_0x6e6e3b[_0xce4f('0x3e')][_0xce4f('0x43')]));_0x2b7f4d[_0xce4f('0x42')]=_0x2b7f4d[_0xce4f('0x42')][_0xce4f('0x6a')]?_0x2b7f4d[_0xce4f('0x42')]:_0x30948b['model'];if(!_0x6e6e3b['query'][_0xce4f('0x6b')](_0xce4f('0x44'))){_0x2b7f4d['limit']=qs[_0xce4f('0x2c')](_0x6e6e3b[_0xce4f('0x3e')][_0xce4f('0x2c')]);_0x2b7f4d['offset']=qs[_0xce4f('0x29')](_0x6e6e3b[_0xce4f('0x3e')][_0xce4f('0x29')]);}_0x2b7f4d[_0xce4f('0x45')]=qs[_0xce4f('0x46')](_0x6e6e3b[_0xce4f('0x3e')][_0xce4f('0x46')]);_0x2b7f4d['where']=qs['filters'](_['pick'](_0x6e6e3b[_0xce4f('0x3e')],_0x30948b['filters']));_0x2b7f4d[_0xce4f('0x47')][_0xce4f('0x60')]=_0x2d6592['id'];if(_0x6e6e3b[_0xce4f('0x3e')][_0xce4f('0x49')]){_0x2b7f4d[_0xce4f('0x47')]=_['merge'](_0x2b7f4d[_0xce4f('0x47')],{'$or':_[_0xce4f('0x39')](_0x2b7f4d[_0xce4f('0x42')],function(_0x3621d1){var _0x44d332={};_0x44d332[_0x3621d1]={'$like':'%'+_0x6e6e3b[_0xce4f('0x3e')][_0xce4f('0x49')]+'%'};return _0x44d332;})});}_0x2b7f4d=_['merge']({},_0x2b7f4d,_0x6e6e3b[_0xce4f('0x64')]);return db[_0xce4f('0x68')][_0xce4f('0x2b')]({'where':_0x2b7f4d[_0xce4f('0x47')]})[_0xce4f('0x1c')](function(_0x26ffe7){_0xe3f609[_0xce4f('0x2b')]=_0x26ffe7;if(_0x6e6e3b[_0xce4f('0x3e')][_0xce4f('0x4c')]){_0x2b7f4d[_0xce4f('0x4d')]=[{'all':!![]}];}return db[_0xce4f('0x68')][_0xce4f('0x4e')](_0x2b7f4d);})['then'](function(_0x3a18b8){_0xe3f609['rows']=_0x3a18b8;return _0xe3f609;});}})[_0xce4f('0x1c')](respondWithFilteredResult(_0x39c158,_0x2b7f4d))[_0xce4f('0x25')](handleError(_0x39c158,null));};exports[_0xce4f('0x6c')]=function(_0x30bf9d,_0x341124,_0x2f3170){return db[_0xce4f('0x3a')][_0xce4f('0x54')]({'where':{'id':_0x30bf9d[_0xce4f('0x51')]['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x341124,null))[_0xce4f('0x1c')](function(_0x1bf22f){if(_0x1bf22f){return _0x1bf22f[_0xce4f('0x6c')](_0x30bf9d[_0xce4f('0x3e')][_0xce4f('0x66')]);}})[_0xce4f('0x1c')](respondWithStatusCode(_0x341124,null))['catch'](handleError(_0x341124,null));};exports[_0xce4f('0x6d')]=function(_0x33c2f4,_0x41f81d,_0x421fe7){return db[_0xce4f('0x6e')]['find']({'where':{'id':_0x33c2f4[_0xce4f('0x51')]['id']}})['then'](handleEntityNotFound(_0x41f81d,null))[_0xce4f('0x1c')](function(_0x2f1f85){if(_0x2f1f85){return _0x2f1f85[_0xce4f('0x6d')](_0x33c2f4['body'][_0xce4f('0x66')],_[_0xce4f('0x6f')](_0x33c2f4[_0xce4f('0x56')],[_0xce4f('0x66'),'id'])||{});}})[_0xce4f('0x1c')](respondWithResult(_0x41f81d,null))[_0xce4f('0x25')](handleError(_0x41f81d,null));};exports[_0xce4f('0x70')]=function(_0x163ea5,_0x1aaeb3,_0x30b889){var _0x536e89={'raw':![],'where':{}};var _0x1d9307={};var _0x455d63={'count':0x0,'rows':[]};return db[_0xce4f('0x3a')]['findOne']({'where':{'id':_0x163ea5['params']['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x1aaeb3,null))[_0xce4f('0x1c')](function(_0x2a5fa1){if(_0x2a5fa1){_0x1d9307[_0xce4f('0x3d')]=_['keys'](db['FaxInteraction'][_0xce4f('0x53')]);_0x1d9307[_0xce4f('0x3e')]=_[_0xce4f('0x3f')](_0x163ea5['query']);_0x1d9307['filters']=_[_0xce4f('0x41')](_0x1d9307[_0xce4f('0x3d')],_0x1d9307[_0xce4f('0x3e')]);_0x536e89[_0xce4f('0x42')]=_['intersection'](_0x1d9307['model'],qs['fields'](_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x43')]));_0x536e89['attributes']=_0x536e89[_0xce4f('0x42')][_0xce4f('0x6a')]?_0x536e89[_0xce4f('0x42')]:_0x1d9307[_0xce4f('0x3d')];if(!_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x6b')]('nolimit')){_0x536e89[_0xce4f('0x2c')]=qs[_0xce4f('0x2c')](_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x2c')]);_0x536e89[_0xce4f('0x29')]=qs[_0xce4f('0x29')](_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x29')]);}_0x536e89[_0xce4f('0x45')]=qs['sort'](_0x163ea5['query'][_0xce4f('0x46')]);_0x536e89['where']=qs[_0xce4f('0x40')](_['pick'](_0x163ea5[_0xce4f('0x3e')],_0x1d9307[_0xce4f('0x40')]));_0x536e89['where']['FaxAccountId']=_0x2a5fa1['id'];if(_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x49')]){_0x536e89[_0xce4f('0x47')]=_[_0xce4f('0x4a')](_0x536e89[_0xce4f('0x47')],{'$or':_[_0xce4f('0x39')](_0x536e89[_0xce4f('0x42')],function(_0x37512a){var _0x2c167f={};_0x2c167f[_0x37512a]={'$like':'%'+_0x163ea5[_0xce4f('0x3e')]['filter']+'%'};return _0x2c167f;})});}_0x536e89=_['merge']({},_0x536e89,_0x163ea5['options']);return db[_0xce4f('0x6e')][_0xce4f('0x2b')]({'where':_0x536e89[_0xce4f('0x47')]})[_0xce4f('0x1c')](function(_0x5deae5){_0x455d63[_0xce4f('0x2b')]=_0x5deae5;if(_0x163ea5['query'][_0xce4f('0x4c')]){_0x536e89['include']=[{'model':db[_0xce4f('0x71')],'as':_0xce4f('0x72'),'required':![]},{'model':db[_0xce4f('0x73')],'as':'Owner','attributes':['name',_0xce4f('0x74'),_0xce4f('0x75')],'required':![]},{'model':db[_0xce4f('0x76')],'as':'Tags','attributes':['id',_0xce4f('0x36'),_0xce4f('0x77')],'where':_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x78')]?{'id':_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x78')]}:undefined,'required':_0x163ea5[_0xce4f('0x3e')][_0xce4f('0x78')]?!![]:![]}];}return db[_0xce4f('0x6e')]['findAll'](_0x536e89);})[_0xce4f('0x1c')](function(_0x1d78f8){_0x455d63['rows']=_0x1d78f8;return _0x455d63;});}})[_0xce4f('0x1c')](respondWithFilteredResult(_0x1aaeb3,_0x536e89))[_0xce4f('0x25')](handleError(_0x1aaeb3,null));};exports[_0xce4f('0x79')]=function(_0x55e82c,_0x248879){var _0x46b9cc=_0x55e82c['params']['id'];var _0xf48d61=_0x55e82c[_0xce4f('0x56')];var _0x396ecc=0xc8;var _0x5656=null;return db[_0xce4f('0x7a')]['transaction']({'isolationLevel':db['sequelize'][_0xce4f('0x7b')][_0xce4f('0x7c')]['READ_COMMITTED']},function(_0x1f5ba6){return db['FaxAccount'][_0xce4f('0x63')]({'where':{'id':_0x46b9cc},'transaction':_0x1f5ba6})['then'](function(_0x89a67d){if(_0x89a67d){return db[_0xce4f('0x7d')]['destroy']({'where':{'FaxAccountId':_0x46b9cc},'transaction':_0x1f5ba6})[_0xce4f('0x1c')](function(){var _0x30a4d3=_['map'](_0xf48d61,function(_0x40ac9b){_0x40ac9b['FaxAccountId']=_0x46b9cc;return _0x40ac9b;});return db[_0xce4f('0x7d')]['bulkCreate'](_0x30a4d3,{'transaction':_0x1f5ba6});});}else{_0x396ecc=0x194;_0x5656=[];}});})[_0xce4f('0x1c')](function(){if(_0x396ecc!==0x194){return db['FaxApplication'][_0xce4f('0x7e')]({'where':{'FaxAccountId':_0x46b9cc},'order':'priority'})[_0xce4f('0x1c')](function(_0x2892ac){_0x5656=_0x2892ac;});}})[_0xce4f('0x25')](function(_0x579abe){_0x396ecc=0x1f4;logger[_0xce4f('0x22')](_0x579abe['stack']);if(_0x579abe[_0xce4f('0x36')]){delete _0x579abe['name'];}_0x5656=_0x579abe;})[_0xce4f('0x7f')](function(){if(_0x5656===null){_0x248879['sendStatus'](_0x396ecc);}else{if(_0x396ecc===0x1f4){_0x248879[_0xce4f('0x26')](_0x396ecc)['send'](_0x5656);}else{_0x248879[_0xce4f('0x26')](_0x396ecc)['json'](_0x5656);}}});};exports['getApplications']=function(_0xd6afd7,_0xa3575f,_0x3b1158){var _0x5815d3={};var _0x3a9486={};var _0x14a7fa;var _0x72e2f1;return db[_0xce4f('0x3a')][_0xce4f('0x63')]({'where':{'id':_0xd6afd7['params']['id']}})['then'](handleEntityNotFound(_0xa3575f,null))[_0xce4f('0x1c')](function(_0x34dd33){if(_0x34dd33){_0x14a7fa=_0x34dd33;_0x3a9486[_0xce4f('0x3d')]=_[_0xce4f('0x3f')](db[_0xce4f('0x7d')][_0xce4f('0x53')]);_0x3a9486['query']=_[_0xce4f('0x3f')](_0xd6afd7[_0xce4f('0x3e')]);_0x3a9486[_0xce4f('0x40')]=_[_0xce4f('0x41')](_0x3a9486[_0xce4f('0x3d')],_0x3a9486['query']);_0x5815d3[_0xce4f('0x42')]=_[_0xce4f('0x41')](_0x3a9486[_0xce4f('0x3d')],qs['fields'](_0xd6afd7['query'][_0xce4f('0x43')]));_0x5815d3['attributes']=_0x5815d3[_0xce4f('0x42')][_0xce4f('0x6a')]?_0x5815d3[_0xce4f('0x42')]:_0x3a9486[_0xce4f('0x3d')];_0x5815d3[_0xce4f('0x45')]=qs['sort'](_0xd6afd7[_0xce4f('0x3e')][_0xce4f('0x46')]);_0x5815d3[_0xce4f('0x47')]=qs[_0xce4f('0x40')](_[_0xce4f('0x48')](_0xd6afd7['query'],_0x3a9486[_0xce4f('0x40')]));if(_0xd6afd7[_0xce4f('0x3e')][_0xce4f('0x49')]){_0x5815d3[_0xce4f('0x47')]=_[_0xce4f('0x4a')](_0x5815d3[_0xce4f('0x47')],{'$or':_[_0xce4f('0x39')](_0x5815d3[_0xce4f('0x42')],function(_0x264530){var _0x29a98b={};_0x29a98b[_0x264530]={'$like':'%'+_0xd6afd7[_0xce4f('0x3e')][_0xce4f('0x49')]+'%'};return _0x29a98b;})});}_0x5815d3=_[_0xce4f('0x4a')]({},_0x5815d3,_0xd6afd7[_0xce4f('0x64')]);return _0x14a7fa[_0xce4f('0x80')](_0x5815d3);}})[_0xce4f('0x1c')](function(_0x371df2){if(_0x371df2){_0x72e2f1=_0x371df2[_0xce4f('0x6a')];if(!_0xd6afd7[_0xce4f('0x3e')][_0xce4f('0x6b')](_0xce4f('0x44'))){_0x5815d3[_0xce4f('0x2c')]=qs[_0xce4f('0x2c')](_0xd6afd7[_0xce4f('0x3e')][_0xce4f('0x2c')]);_0x5815d3[_0xce4f('0x29')]=qs[_0xce4f('0x29')](_0xd6afd7[_0xce4f('0x3e')][_0xce4f('0x29')]);}return _0x14a7fa[_0xce4f('0x80')](_0x5815d3);}})[_0xce4f('0x1c')](function(_0x346c06){if(_0x346c06){return _0x346c06?{'count':_0x72e2f1,'rows':_0x346c06}:null;}})[_0xce4f('0x1c')](respondWithResult(_0xa3575f,null))[_0xce4f('0x25')](handleError(_0xa3575f,null));};function Extension(_0x49ce7b,_0x174764,_0x220d8f,_0x6a97cd){this[_0xce4f('0x81')]=_0xce4f('0x82');this['exten']=_0x49ce7b[_0xce4f('0x83')];this[_0xce4f('0x84')]=_0x6a97cd;this['type']=_0xce4f('0x85');this[_0xce4f('0x86')]=_0xce4f('0x87');this[_0xce4f('0x60')]=_0x49ce7b['id'];this[_0xce4f('0x88')]=_0x174764;this[_0xce4f('0x89')]=_0x220d8f;}function createExtensionsReciveFax(_0x4800b1){var _0x45c354=0x1;var _0x4f0f6a=[];_0x4f0f6a[_0xce4f('0x8a')](new Extension(_0x4800b1,_0x45c354,'',_0xce4f('0x8b')));_0x45c354+=0x1;_0x4f0f6a['push'](new Extension(_0x4800b1,_0x45c354,'CDR(type)=inbound-fax',_0xce4f('0x8c')));_0x45c354+=0x1;for(var _0x1a932b in _0x4800b1){if(_0x4800b1[_0xce4f('0x6b')](_0x1a932b)&&(_0x1a932b===_0xce4f('0x8d')||_0x1a932b===_0xce4f('0x83')||_0x1a932b===_0xce4f('0x8e')||_0x1a932b===_0xce4f('0x8f')||_0x1a932b===_0xce4f('0x90')||_0x1a932b===_0xce4f('0x91')||_0x1a932b===_0xce4f('0x92')||_0x1a932b===_0xce4f('0x93')||_0x1a932b==='t38timeout')){_0x4f0f6a[_0xce4f('0x8a')](new Extension(_0x4800b1,_0x45c354,_0xce4f('0x94')+_0x1a932b+')='+_0x4800b1[_0x1a932b],_0xce4f('0x8c')));_0x45c354+=0x1;}}_0x4f0f6a[_0xce4f('0x8a')](new Extension(_0x4800b1,_0x45c354,'6',_0xce4f('0x95')));_0x45c354+=0x1;_0x4f0f6a[_0xce4f('0x8a')](new Extension(_0x4800b1,_0x45c354,_0xce4f('0x96'),_0xce4f('0x97')));_0x45c354=0x0;return _0x4f0f6a;}exports[_0xce4f('0x98')]=function(_0x295a54,_0x151336,_0x73ff3a){var _0x3ceedf;return db[_0xce4f('0x7a')][_0xce4f('0x99')](function(_0x147af3){return db[_0xce4f('0x3a')]['create'](_0x295a54[_0xce4f('0x56')],{'transaction':_0x147af3})[_0xce4f('0x1c')](function(_0x2a963d){_0x3ceedf=_0x2a963d['get']({'plain':!![]});return db['VoiceExtension'][_0xce4f('0x9a')](createExtensionsReciveFax(_0x3ceedf),{'transaction':_0x147af3});});})[_0xce4f('0x1c')](function(){return _0x3ceedf;})[_0xce4f('0x1c')](respondWithResult(_0x151336,null))[_0xce4f('0x25')](handleError(_0x151336,null));};exports[_0xce4f('0x9b')]=function(_0xc93c66,_0x276686,_0x15c202){var _0x1f6b10;return db[_0xce4f('0x7a')][_0xce4f('0x99')](function(_0x18709f){return db[_0xce4f('0x3a')]['update'](_0xc93c66['body'],{'where':{'id':_0xc93c66[_0xce4f('0x56')]['id']},'transaction':_0x18709f})['then'](function(_0x1a2ad0){return db[_0xce4f('0x9c')]['destroy']({'where':{'FaxAccountId':_0xc93c66[_0xce4f('0x56')]['id']},'transaction':_0x18709f})[_0xce4f('0x1c')](function(_0x20d7f7){return db['VoiceExtension'][_0xce4f('0x9a')](createExtensionsReciveFax(_[_0xce4f('0x6f')](_0xc93c66['body'],[_0xce4f('0x9d'),'key',_0xce4f('0x9e'),_0xce4f('0x9f'),'TrunkId','ListId'])),{'transaction':_0x18709f});});});})['then'](function(){return db['FaxAccount']['findById'](_0xc93c66['body']['id']);})[_0xce4f('0x1c')](respondWithResult(_0x276686,null))['catch'](handleError(_0x276686,null));};exports[_0xce4f('0xa0')]=function(_0x5bd003,_0x5707d9,_0x132146){var _0x22d6a2={'raw':!![],'where':{}};var _0xcbbd8f={};var _0x1c88e4={'count':0x0,'rows':[]};return db[_0xce4f('0x3a')]['findOne']({'where':{'id':_0x5bd003['params']['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x5707d9,null))[_0xce4f('0x1c')](function(_0x4fc8f9){if(_0x4fc8f9){_0xcbbd8f[_0xce4f('0x3d')]=_[_0xce4f('0x3f')](db[_0xce4f('0xa1')]['rawAttributes']);_0xcbbd8f['query']=_['keys'](_0x5bd003[_0xce4f('0x3e')]);_0xcbbd8f[_0xce4f('0x40')]=_['intersection'](_0xcbbd8f[_0xce4f('0x3d')],_0xcbbd8f[_0xce4f('0x3e')]);_0x22d6a2[_0xce4f('0x42')]=_[_0xce4f('0x41')](_0xcbbd8f['model'],qs['fields'](_0x5bd003[_0xce4f('0x3e')][_0xce4f('0x43')]));_0x22d6a2[_0xce4f('0x42')]=_0x22d6a2[_0xce4f('0x42')][_0xce4f('0x6a')]?_0x22d6a2['attributes']:_0xcbbd8f['model'];if(!_0x5bd003[_0xce4f('0x3e')][_0xce4f('0x6b')](_0xce4f('0x44'))){_0x22d6a2[_0xce4f('0x2c')]=qs['limit'](_0x5bd003[_0xce4f('0x3e')][_0xce4f('0x2c')]);_0x22d6a2[_0xce4f('0x29')]=qs[_0xce4f('0x29')](_0x5bd003[_0xce4f('0x3e')][_0xce4f('0x29')]);}_0x22d6a2[_0xce4f('0x45')]=qs[_0xce4f('0x46')](_0x5bd003[_0xce4f('0x3e')][_0xce4f('0x46')]);_0x22d6a2['where']=qs['filters'](_['pick'](_0x5bd003[_0xce4f('0x3e')],_0xcbbd8f[_0xce4f('0x40')]));_0x22d6a2[_0xce4f('0x47')][_0xce4f('0x60')]=_0x4fc8f9['id'];if(_0x5bd003['query'][_0xce4f('0x49')]){_0x22d6a2[_0xce4f('0x47')]=_[_0xce4f('0x4a')](_0x22d6a2[_0xce4f('0x47')],{'$or':_['map'](_0x22d6a2[_0xce4f('0x42')],function(_0x355b0b){var _0x3ae061={};_0x3ae061[_0x355b0b]={'$like':'%'+_0x5bd003[_0xce4f('0x3e')][_0xce4f('0x49')]+'%'};return _0x3ae061;})});}if(_0x5bd003['query'][_0xce4f('0xa2')]){var _0x20c8f6=_0x5bd003[_0xce4f('0x3e')][_0xce4f('0xa2')][_0xce4f('0xa3')](',');var _0x4adae1={};_0x4adae1[_0x20c8f6[0x0]]={'$gte':moment(_0x20c8f6[0x1])[_0xce4f('0xa4')](_0xce4f('0xa5'))};_0x22d6a2['where']=_[_0xce4f('0x4a')](_0x22d6a2[_0xce4f('0x47')],_0x4adae1);}_0x22d6a2=_['merge']({},_0x22d6a2,_0x5bd003['options']);return db[_0xce4f('0xa1')]['count']({'where':_0x22d6a2['where']})[_0xce4f('0x1c')](function(_0x523acd){_0x1c88e4[_0xce4f('0x2b')]=_0x523acd;if(_0x5bd003[_0xce4f('0x3e')][_0xce4f('0x4c')]){_0x22d6a2[_0xce4f('0x4d')]=[{'all':!![]}];}return db[_0xce4f('0xa1')][_0xce4f('0x4e')](_0x22d6a2);})[_0xce4f('0x1c')](function(_0x5390bc){_0x1c88e4[_0xce4f('0x4f')]=_0x5390bc;return _0x1c88e4;});}})['then'](respondWithFilteredResult(_0x5707d9,_0x22d6a2))[_0xce4f('0x25')](handleError(_0x5707d9,null));};exports[_0xce4f('0x37')]=function(_0x5b0257,_0x5ba05b,_0x904705){var _0x509b45,_0x5ac6ec={},_0x3a7091;if(_0x5b0257[_0xce4f('0x56')]['to']){_0x3a7091=_0x5b0257[_0xce4f('0x56')]['to'][0x0];}return db[_0xce4f('0x3a')]['find']({'where':{'id':_0x5b0257[_0xce4f('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0xce4f('0xa6'),'include':[{'model':db['CmContact'],'as':_0xce4f('0xa7'),'where':{'fax':_0x3a7091},'limit':0x1,'order':[[_0xce4f('0x9f'),'DESC']]}]}]})[_0xce4f('0x1c')](handleEntityNotFound(_0x5ba05b,null))[_0xce4f('0x1c')](function(_0x33f973){_0x509b45=_0x33f973;if(_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')]&&_0x5b0257['body'][_0xce4f('0xa8')]['length']){for(var _0x4c6ad7=0x0;_0x4c6ad7<_0x5b0257['body']['attachments'][_0xce4f('0x6a')];_0x4c6ad7+=0x1){_0x5b0257[_0xce4f('0x56')]['attachments'][_0x4c6ad7]={'filename':_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')][_0x4c6ad7]['name'],'id':_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')][_0x4c6ad7]['id'],'path':path[_0xce4f('0xa9')](config[_0xce4f('0xaa')],'server/files/attachments',_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')][_0x4c6ad7][_0xce4f('0xab')])};}}return respondWithRpcPromise(_0xce4f('0xac'),'CheckAfterSend',{'FaxAccountId':_[_0xce4f('0xad')](_0x5b0257[_0xce4f('0x51')]['id'])?undefined:_0x5b0257[_0xce4f('0x51')]['id'],'path':_[_0xce4f('0xad')](_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')][0x0][_0xce4f('0xae')])?undefined:_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')][0x0]['path'],'fax':_['isNil'](_0x5b0257['body']['to'][0x0])?undefined:_0x5b0257[_0xce4f('0x56')]['to'][0x0]},client9002);})[_0xce4f('0x1c')](function(){if(_0x509b45){if(_[_0xce4f('0xad')](_0x5b0257[_0xce4f('0x56')][_0xce4f('0xaf')])){_0x5b0257[_0xce4f('0x56')][_0xce4f('0xaf')]=util[_0xce4f('0xa4')](_0xce4f('0xb0'),_0x509b45[_0xce4f('0x36')],_0x509b45['fax']);}if(_0x509b45['List']){if(_0x509b45[_0xce4f('0xa6')][_0xce4f('0xa7')][_0xce4f('0x6a')]){return _0x509b45[_0xce4f('0xa6')][_0xce4f('0xa7')][0x0];}else{return db['CmContact'][_0xce4f('0x55')](_['defaults'](_0x5b0257[_0xce4f('0x56')],{'firstName':_0x5b0257[_0xce4f('0x56')]['to'][0x0],'phone':_0x5b0257['body']['to'][0x0],'fax':_0x5b0257[_0xce4f('0x56')]['to'][0x0],'ListId':_0x509b45[_0xce4f('0xb1')]}));}}else{throw new Error(_0xce4f('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xce4f('0x1c')](function(_0x1847e4){if(_0x1847e4){return db[_0xce4f('0x6e')]['find']({'where':{'ContactId':_0x1847e4['id'],'closed':![],'FaxAccountId':_0x509b45['id']}})[_0xce4f('0x1c')](function(_0x15f279){if(_0x15f279){return[_0x15f279,![]];}return db[_0xce4f('0x6e')][_0xce4f('0x55')]({'UserId':_0x5b0257[_0xce4f('0x57')]['id'],'ContactId':_0x1847e4['id'],'FaxAccountId':_0x509b45['id'],'fax':_0x5b0257[_0xce4f('0x56')]['to'][0x0],'firstMsgDirection':_0xce4f('0xb3'),'Messages':[_[_0xce4f('0x4a')](_0x5b0257[_0xce4f('0x56')],{'read':![],'body':_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')][0x0][_0xce4f('0xb4')],'FaxAccountId':_0x509b45['id'],'UserId':_0x5b0257['user']['id'],'ContactId':_0x1847e4['id'],'AttachmentId':_0x5b0257['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xce4f('0xa1')],'as':_0xce4f('0xb5')}]})[_0xce4f('0x1c')](function(_0x58741e){return[_0x58741e,!![]];});});}else{throw new Error(_0xce4f('0xb6'));}})[_0xce4f('0xb7')](function(_0x46a950,_0x190ec8){if(_0x190ec8){return _0x46a950;}return db[_0xce4f('0xa1')][_0xce4f('0x55')]({'direction':_0xce4f('0xb3'),'read':![],'body':_0x5b0257[_0xce4f('0x56')][_0xce4f('0xa8')][0x0][_0xce4f('0xb4')],'FaxAccountId':_0x509b45['id'],'FaxInteractionId':_0x46a950['id'],'UserId':_0x5b0257['user']['id'],'ContactId':_0x46a950[_0xce4f('0xb8')],'AttachmentId':_0x5b0257['body'][_0xce4f('0xa8')][0x0]['id']})[_0xce4f('0x1c')](function(_0x57a63f){_0x46a950[_0xce4f('0xb9')][_0xce4f('0xb5')]=[];_0x46a950[_0xce4f('0xb9')][_0xce4f('0xb5')][_0xce4f('0x8a')](_0x57a63f[_0xce4f('0xb9')]);return _0x46a950;});})[_0xce4f('0x1c')](function(_0x551a78){respondWithRpcPromise(_0xce4f('0xba'),_0xce4f('0xba'),{'FaxAccountId':_[_0xce4f('0xad')](_0x5b0257[_0xce4f('0x51')]['id'])?undefined:_0x5b0257['params']['id'],'path':_[_0xce4f('0xad')](_0x5b0257['body']['attachments'][0x0][_0xce4f('0xae')])?undefined:_0x5b0257['body'][_0xce4f('0xa8')][0x0]['path'],'fax':_[_0xce4f('0xad')](_0x5b0257[_0xce4f('0x56')]['to'][0x0])?undefined:_0x5b0257['body']['to'][0x0],'AttachmentId':_0x5b0257[_0xce4f('0x56')]['attachments'][0x0]['id']},client9002)[_0xce4f('0x1c')](function(_0x166409){logger['info']('SendFaxRpc,\x20%s',_0x166409);})[_0xce4f('0x25')](function(_0x4bc046){logger[_0xce4f('0x1d')](_0xce4f('0xbb'),_0x4bc046);});return _0x551a78;})[_0xce4f('0x1c')](respondWithResult(_0x5ba05b,null))['catch'](handleError(_0x5ba05b,null));};exports[_0xce4f('0xbc')]=function(_0x3010fa,_0x13a087,_0x1edf10){return db['FaxAccount'][_0xce4f('0x54')]({'where':{'id':_0x3010fa['params']['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x13a087,null))[_0xce4f('0x1c')](function(_0xba9528){if(_0xba9528){return _0xba9528['addAgents'](_0x3010fa[_0xce4f('0x56')][_0xce4f('0x66')],_[_0xce4f('0x6f')](_0x3010fa[_0xce4f('0x56')],[_0xce4f('0x66'),'id'])||{})['spread'](function(_0x1d307a){for(var _0x433a05=0x0;_0x433a05<_0x3010fa['body'][_0xce4f('0x66')][_0xce4f('0x6a')];_0x433a05+=0x1){socket['emit'](_0xce4f('0xbd'),{'UserId':Number(_0x3010fa[_0xce4f('0x56')][_0xce4f('0x66')][_0x433a05]),'FaxAccountId':Number(_0x3010fa['params']['id'])});}return _0x1d307a;});}})[_0xce4f('0x1c')](respondWithResult(_0x13a087,null))[_0xce4f('0x25')](handleError(_0x13a087,null));};exports['removeAgents']=function(_0x5222dd,_0x239bb0,_0x12b535){return db['FaxAccount'][_0xce4f('0x54')]({'where':{'id':_0x5222dd[_0xce4f('0x51')]['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x239bb0,null))[_0xce4f('0x1c')](function(_0x371c56){if(_0x371c56){return _0x371c56[_0xce4f('0xbe')](_0x5222dd[_0xce4f('0x3e')]['ids'])['then'](function(){if(_[_0xce4f('0xbf')](_0x5222dd[_0xce4f('0x3e')]['ids'])){for(var _0x50771d=0x0;_0x50771d<_0x5222dd[_0xce4f('0x3e')][_0xce4f('0x66')][_0xce4f('0x6a')];_0x50771d+=0x1){socket[_0xce4f('0xc0')](_0xce4f('0xc1'),{'UserId':Number(_0x5222dd[_0xce4f('0x3e')][_0xce4f('0x66')][_0x50771d]),'FaxAccountId':Number(_0x5222dd['params']['id'])});}}else{socket[_0xce4f('0xc0')](_0xce4f('0xc1'),{'UserId':Number(_0x5222dd[_0xce4f('0x3e')][_0xce4f('0x66')]),'FaxAccountId':Number(_0x5222dd['params']['id'])});}});}})[_0xce4f('0x1c')](respondWithStatusCode(_0x239bb0,null))[_0xce4f('0x25')](handleError(_0x239bb0,null));};exports[_0xce4f('0xc2')]=function(_0x5339c3,_0x3462a7,_0x1aa7f8){var _0x44085c={};var _0x5201a5={};var _0x34df9f;var _0x24b344;return db[_0xce4f('0x3a')][_0xce4f('0x63')]({'where':{'id':_0x5339c3[_0xce4f('0x51')]['id']}})[_0xce4f('0x1c')](handleEntityNotFound(_0x3462a7,null))[_0xce4f('0x1c')](function(_0x10733d){if(_0x10733d){_0x34df9f=_0x10733d;_0x5201a5[_0xce4f('0x3d')]=_[_0xce4f('0x3f')](db[_0xce4f('0x73')][_0xce4f('0x53')]);_0x5201a5[_0xce4f('0x3e')]=_['keys'](_0x5339c3[_0xce4f('0x3e')]);_0x5201a5[_0xce4f('0x40')]=_[_0xce4f('0x41')](_0x5201a5[_0xce4f('0x3d')],_0x5201a5[_0xce4f('0x3e')]);_0x44085c[_0xce4f('0x42')]=_[_0xce4f('0x41')](_0x5201a5[_0xce4f('0x3d')],qs[_0xce4f('0x43')](_0x5339c3['query'][_0xce4f('0x43')]));_0x44085c[_0xce4f('0x42')]=_0x44085c[_0xce4f('0x42')][_0xce4f('0x6a')]?_0x44085c[_0xce4f('0x42')]:_0x5201a5[_0xce4f('0x3d')];_0x44085c[_0xce4f('0x45')]=qs[_0xce4f('0x46')](_0x5339c3['query']['sort']);_0x44085c[_0xce4f('0x47')]=qs[_0xce4f('0x40')](_[_0xce4f('0x48')](_0x5339c3[_0xce4f('0x3e')],_0x5201a5[_0xce4f('0x40')]));if(_0x5339c3['query'][_0xce4f('0x49')]){_0x44085c[_0xce4f('0x47')]=_[_0xce4f('0x4a')](_0x44085c[_0xce4f('0x47')],{'$or':_[_0xce4f('0x39')](_0x44085c['attributes'],function(_0x364122){var _0x926e35={};_0x926e35[_0x364122]={'$like':'%'+_0x5339c3[_0xce4f('0x3e')]['filter']+'%'};return _0x926e35;})});}_0x44085c=_[_0xce4f('0x4a')]({},_0x44085c,_0x5339c3[_0xce4f('0x64')]);return _0x34df9f[_0xce4f('0xc2')](_0x44085c);}})[_0xce4f('0x1c')](function(_0x59ac7f){if(_0x59ac7f){_0x24b344=_0x59ac7f[_0xce4f('0x6a')];if(!_0x5339c3[_0xce4f('0x3e')][_0xce4f('0x6b')](_0xce4f('0x44'))){_0x44085c[_0xce4f('0x2c')]=qs[_0xce4f('0x2c')](_0x5339c3[_0xce4f('0x3e')][_0xce4f('0x2c')]);_0x44085c['offset']=qs[_0xce4f('0x29')](_0x5339c3['query'][_0xce4f('0x29')]);}return _0x34df9f['getAgents'](_0x44085c);}})[_0xce4f('0x1c')](function(_0x3f1a5c){if(_0x3f1a5c){return _0x3f1a5c?{'count':_0x24b344,'rows':_0x3f1a5c}:null;}})[_0xce4f('0x1c')](respondWithResult(_0x3462a7,null))[_0xce4f('0x25')](handleError(_0x3462a7,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5e95268..3bb6205 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 _0xb5d4=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x1e6911,_0x2c997c){var _0x27c35f=function(_0x2b8115){while(--_0x2b8115){_0x1e6911['push'](_0x1e6911['shift']());}};_0x27c35f(++_0x2c997c);}(_0xb5d4,0xcc));var _0x4b5d=function(_0x2001d4,_0x3011b9){_0x2001d4=_0x2001d4-0x0;var _0x9396e9=_0xb5d4[_0x2001d4];return _0x9396e9;};'use strict';var EventEmitter=require(_0x4b5d('0x0'));var FaxAccount=require(_0x4b5d('0x1'))['db'][_0x4b5d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4b5d('0x3')](0x0);var events={'afterCreate':_0x4b5d('0x4'),'afterUpdate':_0x4b5d('0x5'),'afterDestroy':_0x4b5d('0x6')};function emitEvent(_0x5d0ef2){return function(_0xaa360d,_0x40cf8f,_0x3a1009){FaxAccountEvents[_0x4b5d('0x7')](_0x5d0ef2+':'+_0xaa360d['id'],_0xaa360d);FaxAccountEvents[_0x4b5d('0x7')](_0x5d0ef2,_0xaa360d);_0x3a1009(null);};}for(var e in events){if(events[_0x4b5d('0x8')](e)){var event=events[e];FaxAccount[_0x4b5d('0x9')](e,emitEvent(event));}}module[_0x4b5d('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0x598d=['FaxAccount','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0x598d,0xe0));var _0xd598=function(_0x31ede1,_0x317b4e){_0x31ede1=_0x31ede1-0x0;var _0x25d7ee=_0x598d[_0x31ede1];return _0x25d7ee;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xd598('0x0'))['db'][_0xd598('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd598('0x2'),'afterUpdate':_0xd598('0x3'),'afterDestroy':_0xd598('0x4')};function emitEvent(_0x33d5f4){return function(_0x10f1b7,_0xf9c65d,_0x579c76){FaxAccountEvents['emit'](_0x33d5f4+':'+_0x10f1b7['id'],_0x10f1b7);FaxAccountEvents[_0xd598('0x5')](_0x33d5f4,_0x10f1b7);_0x579c76(null);};}for(var e in events){if(events[_0xd598('0x6')](e)){var event=events[e];FaxAccount[_0xd598('0x7')](e,emitEvent(event));}}module[_0xd598('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 5e5f2a7..e03af68 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 _0x2466=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxAccount','fax_accounts','lodash'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x2466,0xbf));var _0x6246=function(_0xab1cb9,_0x342baf){_0xab1cb9=_0xab1cb9-0x0;var _0x21ac70=_0x2466[_0xab1cb9];return _0x21ac70;};'use strict';var _=require(_0x6246('0x0'));var util=require(_0x6246('0x1'));var logger=require(_0x6246('0x2'))(_0x6246('0x3'));var moment=require('moment');var BPromise=require(_0x6246('0x4'));var rp=require(_0x6246('0x5'));var fs=require('fs');var path=require(_0x6246('0x6'));var rimraf=require(_0x6246('0x7'));var config=require(_0x6246('0x8'));var attributes=require('./faxAccount.attributes');module[_0x6246('0x9')]=function(_0x4b8bde,_0x5dc031){return _0x4b8bde['define'](_0x6246('0xa'),attributes,{'tableName':_0x6246('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0ae=['bluebird','request-promise','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment'];(function(_0xbb0eb4,_0x5380c6){var _0x483a5b=function(_0x78c5dc){while(--_0x78c5dc){_0xbb0eb4['push'](_0xbb0eb4['shift']());}};_0x483a5b(++_0x5380c6);}(_0xd0ae,0x140));var _0xed0a=function(_0x561c0e,_0x25a94f){_0x561c0e=_0x561c0e-0x0;var _0x563f8f=_0xd0ae[_0x561c0e];return _0x563f8f;};'use strict';var _=require(_0xed0a('0x0'));var util=require(_0xed0a('0x1'));var logger=require(_0xed0a('0x2'))('api');var moment=require(_0xed0a('0x3'));var BPromise=require(_0xed0a('0x4'));var rp=require(_0xed0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed0a('0x6'));var config=require('../../config/environment');var attributes=require(_0xed0a('0x7'));module[_0xed0a('0x8')]=function(_0x1daf15,_0x2fa76e){return _0x1daf15[_0xed0a('0x9')](_0xed0a('0xa'),attributes,{'tableName':_0xed0a('0xb'),'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 7840b1b..31f206c 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 _0xb016=['FaxAccount,\x20%s,\x20%s','catch','GetFaxAccount','FaxAccount','findAll','options','raw','limit','include','map','model','attributes','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','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','find','account','CmList','CmContact','Contacts','DESC','FaxApplication','List','get','applications','Applications','list','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','agent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','./faxAccount.socket','register','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x1ee534,_0x30abef){var _0x5704a6=function(_0x23dc62){while(--_0x23dc62){_0x1ee534['push'](_0x1ee534['shift']());}};_0x5704a6(++_0x30abef);}(_0xb016,0x1a3));var _0x6b01=function(_0x3824d2,_0x282d4f){_0x3824d2=_0x3824d2-0x0;var _0x5afb0d=_0xb016[_0x3824d2];return _0x5afb0d;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require(_0x6b01('0x2'));var BPromise=require(_0x6b01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b01('0x4'));var db=require(_0x6b01('0x5'))['db'];var utils=require(_0x6b01('0x6'));var logger=require(_0x6b01('0x7'))(_0x6b01('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6b01('0x9')]['http']({'port':0x232c});config[_0x6b01('0xa')]=_[_0x6b01('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b01('0xa')]));require(_0x6b01('0xc'))[_0x6b01('0xd')](socket);function respondWithRpcPromise(_0x4276a2,_0x5f4360,_0x434215){return new BPromise(function(_0x5030d7,_0x1c1034){return client[_0x6b01('0xe')](_0x4276a2,_0x434215)[_0x6b01('0xf')](function(_0x151a59){logger[_0x6b01('0x10')]('FaxAccount,\x20%s,\x20%s',_0x5f4360,_0x6b01('0x11'));logger['debug'](_0x6b01('0x12'),_0x5f4360,_0x6b01('0x11'),JSON['stringify'](_0x151a59));if(_0x151a59[_0x6b01('0x13')]){if(_0x151a59[_0x6b01('0x13')]['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5f4360,_0x151a59['error'][_0x6b01('0x14')]);return _0x1c1034(_0x151a59[_0x6b01('0x13')][_0x6b01('0x14')]);}logger[_0x6b01('0x13')](_0x6b01('0x15'),_0x5f4360,_0x151a59[_0x6b01('0x13')][_0x6b01('0x14')]);return _0x5030d7(_0x151a59['error'][_0x6b01('0x14')]);}else{logger[_0x6b01('0x10')](_0x6b01('0x15'),_0x5f4360,_0x6b01('0x11'));_0x5030d7(_0x151a59['result'][_0x6b01('0x14')]);}})[_0x6b01('0x16')](function(_0x67d749){logger['error'](_0x6b01('0x15'),_0x5f4360,_0x67d749);_0x1c1034(_0x67d749);});});}exports[_0x6b01('0x17')]=function(_0x39c13c){var _0x494f10=this;return new Promise(function(_0x2132ef,_0x205bf6){return db[_0x6b01('0x18')][_0x6b01('0x19')]({'raw':_0x39c13c[_0x6b01('0x1a')]?_0x39c13c[_0x6b01('0x1a')][_0x6b01('0x1b')]===undefined?!![]:![]:!![],'where':_0x39c13c['options']?_0x39c13c['options']['where']||null:null,'attributes':_0x39c13c[_0x6b01('0x1a')]?_0x39c13c['options']['attributes']||null:null,'limit':_0x39c13c[_0x6b01('0x1a')]?_0x39c13c[_0x6b01('0x1a')][_0x6b01('0x1c')]||null:null,'include':_0x39c13c[_0x6b01('0x1a')]?_0x39c13c[_0x6b01('0x1a')][_0x6b01('0x1d')]?_[_0x6b01('0x1e')](_0x39c13c['options'][_0x6b01('0x1d')],function(_0x264b4b){return{'model':db[_0x264b4b[_0x6b01('0x1f')]],'as':_0x264b4b['as'],'attributes':_0x264b4b['attributes'],'include':_0x264b4b[_0x6b01('0x1d')]?_[_0x6b01('0x1e')](_0x264b4b[_0x6b01('0x1d')],function(_0x412208){return{'model':db[_0x412208[_0x6b01('0x1f')]],'as':_0x412208['as'],'attributes':_0x412208[_0x6b01('0x20')],'include':_0x412208[_0x6b01('0x1d')]?_['map'](_0x412208[_0x6b01('0x1d')],function(_0x2176df){return{'model':db[_0x2176df[_0x6b01('0x1f')]],'as':_0x2176df['as'],'attributes':_0x2176df[_0x6b01('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6b01('0xf')](function(_0x435bb5){logger[_0x6b01('0x10')](_0x6b01('0x17'),_0x39c13c);logger['debug'](_0x6b01('0x17'),_0x39c13c,JSON['stringify'](_0x435bb5));_0x2132ef(_0x435bb5);})[_0x6b01('0x16')](function(_0xe2b4f1){logger['error'](_0x6b01('0x17'),_0xe2b4f1[_0x6b01('0x14')],_0x39c13c);_0x205bf6(_0x494f10['error'](0x1f4,_0xe2b4f1['message']));});});};exports[_0x6b01('0x21')]=function(_0x2311fd,_0x4aacc6,_0x17ddd8){var _0x481145=this;return new Promise(function(_0x3ddd7b,_0x133cc9){var _0xe3bf68={'body':_0x2311fd[_0x6b01('0x22')],'channel':_0x6b01('0x23')};var _0x257267=[];var _0x34b36d=[];var _0x370fd1={};return db['CmContact'][_0x6b01('0x24')]()['then'](function(_0x333aa5){if(!_0x333aa5){throw new db[(_0x6b01('0x25'))][(_0x6b01('0x26'))](_0x6b01('0x27'));}_0x257267=_[_0x6b01('0x28')](_[_0x6b01('0x29')](_0x333aa5),[_0x6b01('0x2a'),_0x6b01('0x2b')]);_0x34b36d=_['difference'](_[_0x6b01('0x29')](_0x333aa5),['createdAt','updatedAt','CompanyId',_0x6b01('0x2c')]);if(_0x2311fd[_0x6b01('0x22')]['id']){delete _0x2311fd[_0x6b01('0x22')]['id'];}if(_[_0x6b01('0x2d')](_0x2311fd['body'][_0x6b01('0x2e')])){throw new db[(_0x6b01('0x25'))]['ValidationError'](_0x6b01('0x2f'));}if(_[_0x6b01('0x2d')](_0x2311fd[_0x6b01('0x22')]['body'])||_0x2311fd[_0x6b01('0x22')]['body']===''){throw new db[(_0x6b01('0x25'))]['ValidationError'](_0x6b01('0x30'));}if(_[_0x6b01('0x2d')](_0x2311fd[_0x6b01('0x22')][_0x6b01('0x31')])){throw new db[(_0x6b01('0x25'))][(_0x6b01('0x26'))](_0x6b01('0x32')+_0x34b36d);}if(!_[_0x6b01('0x33')](_0x34b36d,_0x2311fd[_0x6b01('0x22')]['mapKey'])){throw new db['Sequelize'][(_0x6b01('0x26'))](_0x6b01('0x34')+_0x34b36d);}_0x370fd1[_0x2311fd[_0x6b01('0x22')][_0x6b01('0x31')]]=_0x2311fd[_0x6b01('0x22')][_0x6b01('0x2e')];})['then'](function(){return db['FaxAccount'][_0x6b01('0x35')]({'where':{'id':_0x2311fd[_0x6b01('0x36')]['id']},'include':[{'model':db[_0x6b01('0x37')],'as':'List','include':[{'model':db[_0x6b01('0x38')],'as':_0x6b01('0x39'),'where':_0x370fd1,'limit':0x1,'order':[['updatedAt',_0x6b01('0x3a')]]}]},{'model':db[_0x6b01('0x3b')],'as':'Applications'}]});})[_0x6b01('0xf')](function(_0x1c0839){if(_0x1c0839&&_0x1c0839[_0x6b01('0x3c')]){var _0x137c0d=_0x1c0839[_0x6b01('0x3d')]({'plain':!![]});_0xe3bf68['account']=_0x137c0d;_0xe3bf68[_0x6b01('0x3e')]=_0x137c0d[_0x6b01('0x3f')];_0xe3bf68[_0x6b01('0x40')]=_0x137c0d[_0x6b01('0x3c')];_0xe3bf68[_0x6b01('0x3e')]=_[_0x6b01('0x41')](_0xe3bf68['applications'],[_0x6b01('0x42')],[_0x6b01('0x43')]);if(_0xe3bf68[_0x6b01('0x36')]['Applications']){delete _0xe3bf68[_0x6b01('0x36')][_0x6b01('0x3f')];}if(_0xe3bf68[_0x6b01('0x36')]['List']&&_0xe3bf68['account'][_0x6b01('0x3c')][_0x6b01('0x39')][_0x6b01('0x44')]){return _0xe3bf68[_0x6b01('0x36')][_0x6b01('0x3c')][_0x6b01('0x39')][0x0];}var _0x5b374d=_[_0x6b01('0xb')](_0x2311fd['body'],{'firstName':_0x2311fd[_0x6b01('0x22')]['from'],'ListId':_0x137c0d[_0x6b01('0x2c')]});_0x5b374d[_0x2311fd[_0x6b01('0x22')][_0x6b01('0x31')]]=_0x2311fd[_0x6b01('0x22')]['from'];return db['CmContact'][_0x6b01('0x45')](_0x5b374d,{'fields':_0x257267,'raw':!![]});}})['then'](function(_0xbf5817){_0xe3bf68[_0x6b01('0x46')]=_0xbf5817;if(_0xbf5817){var _0x5ebc33={'ContactId':_0xbf5817['id'],'FaxAccountId':_0x2311fd[_0x6b01('0x36')]['id'],'fax':_0xbf5817[_0x6b01('0x23')]};return db[_0x6b01('0x47')][_0x6b01('0x35')]({'where':{'ContactId':_0xbf5817['id'],'closed':![],'FaxAccountId':_0x2311fd[_0x6b01('0x36')]['id']}})[_0x6b01('0xf')](function(_0xde202c){if(_0xde202c){return[_0xde202c,![]];}return db[_0x6b01('0x47')][_0x6b01('0x45')](_0x5ebc33)[_0x6b01('0xf')](function(_0x5c7500){return[_0x5c7500,!![]];});});}else{throw new Error(_0x6b01('0x48'));}})[_0x6b01('0x49')](function(_0x5f1539,_0xb0002){var _0x4f78f6=_0x5f1539[_0x6b01('0x3d')]({'plain':!![]});if(_0xb0002){if(_0xe3bf68['account'][_0x6b01('0x4a')]){_0xe3bf68[_0x6b01('0x3e')][_0x6b01('0x4b')]({'id':0x0,'priority':_0xe3bf68[_0x6b01('0x3e')][_0x6b01('0x44')]+0x1,'app':'close','appdata':_0x6b01('0x4c'),'interval':_0x6b01('0x4d')});}_0x4f78f6[_0x6b01('0x4e')]=!![];}else{_0x4f78f6[_0x6b01('0x4e')]=![];}_0xe3bf68[_0x6b01('0x4f')]=_0x4f78f6;return db[_0x6b01('0x50')]['create']({'body':_0x2311fd[_0x6b01('0x22')][_0x6b01('0x22')],'FaxAccountId':_0x2311fd[_0x6b01('0x36')]['id'],'FaxInteractionId':_0x5f1539['id'],'direction':'in','ContactId':_0x5f1539[_0x6b01('0x51')],'AttachmentId':_0x2311fd[_0x6b01('0x22')]['AttachmentId']});})[_0x6b01('0xf')](function(_0x2f2c6d){_0xe3bf68['message']=_0x2f2c6d;if(_0xe3bf68[_0x6b01('0x4f')][_0x6b01('0x52')]){return db[_0x6b01('0x53')][_0x6b01('0x35')]({'attributes':['id',_0x6b01('0x54')],'where':{'id':_0xe3bf68[_0x6b01('0x4f')][_0x6b01('0x52')]}})[_0x6b01('0xf')](function(_0xcc2ad1){if(_0xcc2ad1){_0xe3bf68[_0x6b01('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6b01('0x55'),'appdata':_0xcc2ad1[_0x6b01('0x54')]+','+(_0xe3bf68['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6b01('0x56'),_0x6b01('0x57'),_0xe3bf68);});}return respondWithRpcPromise(_0x6b01('0x56'),_0x6b01('0x57'),_0xe3bf68);})[_0x6b01('0xf')](function(_0x2b58d7){_0x3ddd7b(_0x2b58d7);})['catch'](function(_0x528fe9){_0x133cc9(_0x481145['error'](0x1f4,_0x528fe9['message']));});});}; \ No newline at end of file +var _0x9ba2=['CompanyId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','DESC','FaxApplication','Applications','applications','list','asc','Contacts','length','ListId','contact','FaxInteraction','create','Contact\x20not\x20found','get','autoclose','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x9ba2,0x1e4));var _0x29ba=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9ba2[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x29ba('0x0'));var moment=require(_0x29ba('0x1'));var BPromise=require(_0x29ba('0x2'));var rs=require(_0x29ba('0x3'));var fs=require('fs');var Redis=require(_0x29ba('0x4'));var db=require(_0x29ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x29ba('0x6'))(_0x29ba('0x7'));var config=require('../../config/environment');var jayson=require(_0x29ba('0x8'));var client=jayson[_0x29ba('0x9')][_0x29ba('0xa')]({'port':0x232c});config['redis']=_[_0x29ba('0xb')](config[_0x29ba('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x29ba('0xd'))(new Redis(config[_0x29ba('0xc')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x35d006,_0x5dbe38,_0x4da9f0){return new BPromise(function(_0x3349c1,_0x1162a1){return client[_0x29ba('0xe')](_0x35d006,_0x4da9f0)['then'](function(_0x5daa4e){logger[_0x29ba('0xf')]('FaxAccount,\x20%s,\x20%s',_0x5dbe38,_0x29ba('0x10'));logger[_0x29ba('0x11')](_0x29ba('0x12'),_0x5dbe38,_0x29ba('0x10'),JSON[_0x29ba('0x13')](_0x5daa4e));if(_0x5daa4e[_0x29ba('0x14')]){if(_0x5daa4e[_0x29ba('0x14')][_0x29ba('0x15')]===0x1f4){logger[_0x29ba('0x14')]('FaxAccount,\x20%s,\x20%s',_0x5dbe38,_0x5daa4e[_0x29ba('0x14')][_0x29ba('0x16')]);return _0x1162a1(_0x5daa4e['error'][_0x29ba('0x16')]);}logger[_0x29ba('0x14')](_0x29ba('0x17'),_0x5dbe38,_0x5daa4e['error'][_0x29ba('0x16')]);return _0x3349c1(_0x5daa4e[_0x29ba('0x14')][_0x29ba('0x16')]);}else{logger[_0x29ba('0xf')](_0x29ba('0x17'),_0x5dbe38,_0x29ba('0x10'));_0x3349c1(_0x5daa4e[_0x29ba('0x18')][_0x29ba('0x16')]);}})[_0x29ba('0x19')](function(_0x529474){logger[_0x29ba('0x14')]('FaxAccount,\x20%s,\x20%s',_0x5dbe38,_0x529474);_0x1162a1(_0x529474);});});}exports[_0x29ba('0x1a')]=function(_0x1d9b5e){var _0x8a2e3e=this;return new Promise(function(_0x1e13f3,_0x5b84c0){return db[_0x29ba('0x1b')][_0x29ba('0x1c')]({'raw':_0x1d9b5e[_0x29ba('0x1d')]?_0x1d9b5e[_0x29ba('0x1d')][_0x29ba('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d9b5e['options']?_0x1d9b5e[_0x29ba('0x1d')][_0x29ba('0x1f')]||null:null,'attributes':_0x1d9b5e['options']?_0x1d9b5e[_0x29ba('0x1d')][_0x29ba('0x20')]||null:null,'limit':_0x1d9b5e[_0x29ba('0x1d')]?_0x1d9b5e[_0x29ba('0x1d')][_0x29ba('0x21')]||null:null,'include':_0x1d9b5e['options']?_0x1d9b5e[_0x29ba('0x1d')]['include']?_[_0x29ba('0x22')](_0x1d9b5e['options'][_0x29ba('0x23')],function(_0xf265dc){return{'model':db[_0xf265dc[_0x29ba('0x24')]],'as':_0xf265dc['as'],'attributes':_0xf265dc['attributes'],'include':_0xf265dc['include']?_[_0x29ba('0x22')](_0xf265dc[_0x29ba('0x23')],function(_0x8e4d9a){return{'model':db[_0x8e4d9a['model']],'as':_0x8e4d9a['as'],'attributes':_0x8e4d9a['attributes'],'include':_0x8e4d9a[_0x29ba('0x23')]?_[_0x29ba('0x22')](_0x8e4d9a[_0x29ba('0x23')],function(_0x53177a){return{'model':db[_0x53177a[_0x29ba('0x24')]],'as':_0x53177a['as'],'attributes':_0x53177a[_0x29ba('0x20')]};}):[]};}):[]};}):[]:[]})[_0x29ba('0x25')](function(_0x169dae){logger[_0x29ba('0xf')](_0x29ba('0x1a'),_0x1d9b5e);logger[_0x29ba('0x11')]('GetFaxAccount',_0x1d9b5e,JSON['stringify'](_0x169dae));_0x1e13f3(_0x169dae);})[_0x29ba('0x19')](function(_0x216db2){logger[_0x29ba('0x14')](_0x29ba('0x1a'),_0x216db2['message'],_0x1d9b5e);_0x5b84c0(_0x8a2e3e[_0x29ba('0x14')](0x1f4,_0x216db2['message']));});});};exports[_0x29ba('0x26')]=function(_0x59d993,_0x59c41b,_0x540b42){var _0x40aaea=this;return new Promise(function(_0x2d5a9b,_0x317200){var _0x12e5be={'body':_0x59d993[_0x29ba('0x27')],'channel':_0x29ba('0x28')};var _0x2defc8=[];var _0x4c7295=[];var _0x12fed9={};return db[_0x29ba('0x29')][_0x29ba('0x2a')]()[_0x29ba('0x25')](function(_0xf9ff1a){if(!_0xf9ff1a){throw new db[(_0x29ba('0x2b'))][(_0x29ba('0x2c'))](_0x29ba('0x2d'));}_0x2defc8=_[_0x29ba('0x2e')](_[_0x29ba('0x2f')](_0xf9ff1a),['createdAt','updatedAt']);_0x4c7295=_[_0x29ba('0x2e')](_[_0x29ba('0x2f')](_0xf9ff1a),[_0x29ba('0x30'),_0x29ba('0x31'),_0x29ba('0x32'),'ListId']);if(_0x59d993['body']['id']){delete _0x59d993[_0x29ba('0x27')]['id'];}if(_[_0x29ba('0x33')](_0x59d993['body']['from'])){throw new db[(_0x29ba('0x2b'))][(_0x29ba('0x2c'))](_0x29ba('0x34'));}if(_[_0x29ba('0x33')](_0x59d993[_0x29ba('0x27')][_0x29ba('0x27')])||_0x59d993[_0x29ba('0x27')][_0x29ba('0x27')]===''){throw new db[(_0x29ba('0x2b'))][(_0x29ba('0x2c'))](_0x29ba('0x35'));}if(_[_0x29ba('0x33')](_0x59d993['body'][_0x29ba('0x36')])){throw new db[(_0x29ba('0x2b'))][(_0x29ba('0x2c'))](_0x29ba('0x37')+_0x4c7295);}if(!_['includes'](_0x4c7295,_0x59d993[_0x29ba('0x27')][_0x29ba('0x36')])){throw new db[(_0x29ba('0x2b'))][(_0x29ba('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c7295);}_0x12fed9[_0x59d993['body'][_0x29ba('0x36')]]=_0x59d993['body'][_0x29ba('0x38')];})[_0x29ba('0x25')](function(){return db[_0x29ba('0x1b')][_0x29ba('0x39')]({'where':{'id':_0x59d993[_0x29ba('0x3a')]['id']},'include':[{'model':db[_0x29ba('0x3b')],'as':_0x29ba('0x3c'),'include':[{'model':db[_0x29ba('0x29')],'as':'Contacts','where':_0x12fed9,'limit':0x1,'order':[[_0x29ba('0x31'),_0x29ba('0x3d')]]}]},{'model':db[_0x29ba('0x3e')],'as':_0x29ba('0x3f')}]});})['then'](function(_0x4b0ff7){if(_0x4b0ff7&&_0x4b0ff7[_0x29ba('0x3c')]){var _0x4a4ea5=_0x4b0ff7['get']({'plain':!![]});_0x12e5be[_0x29ba('0x3a')]=_0x4a4ea5;_0x12e5be[_0x29ba('0x40')]=_0x4a4ea5[_0x29ba('0x3f')];_0x12e5be[_0x29ba('0x41')]=_0x4a4ea5[_0x29ba('0x3c')];_0x12e5be[_0x29ba('0x40')]=_['orderBy'](_0x12e5be[_0x29ba('0x40')],['priority'],[_0x29ba('0x42')]);if(_0x12e5be['account'][_0x29ba('0x3f')]){delete _0x12e5be['account'][_0x29ba('0x3f')];}if(_0x12e5be['account'][_0x29ba('0x3c')]&&_0x12e5be['account'][_0x29ba('0x3c')][_0x29ba('0x43')][_0x29ba('0x44')]){return _0x12e5be[_0x29ba('0x3a')][_0x29ba('0x3c')]['Contacts'][0x0];}var _0x29970c=_[_0x29ba('0xb')](_0x59d993['body'],{'firstName':_0x59d993[_0x29ba('0x27')][_0x29ba('0x38')],'ListId':_0x4a4ea5[_0x29ba('0x45')]});_0x29970c[_0x59d993[_0x29ba('0x27')][_0x29ba('0x36')]]=_0x59d993['body'][_0x29ba('0x38')];return db[_0x29ba('0x29')]['create'](_0x29970c,{'fields':_0x2defc8,'raw':!![]});}})[_0x29ba('0x25')](function(_0x83fd56){_0x12e5be[_0x29ba('0x46')]=_0x83fd56;if(_0x83fd56){var _0x482dbe={'ContactId':_0x83fd56['id'],'FaxAccountId':_0x59d993[_0x29ba('0x3a')]['id'],'fax':_0x83fd56[_0x29ba('0x28')]};return db[_0x29ba('0x47')][_0x29ba('0x39')]({'where':{'ContactId':_0x83fd56['id'],'closed':![],'FaxAccountId':_0x59d993['account']['id']}})['then'](function(_0x8daf61){if(_0x8daf61){return[_0x8daf61,![]];}return db['FaxInteraction'][_0x29ba('0x48')](_0x482dbe)[_0x29ba('0x25')](function(_0x2947bd){return[_0x2947bd,!![]];});});}else{throw new Error(_0x29ba('0x49'));}})['spread'](function(_0x43156f,_0x981637){var _0x3153c3=_0x43156f[_0x29ba('0x4a')]({'plain':!![]});if(_0x981637){if(_0x12e5be[_0x29ba('0x3a')][_0x29ba('0x4b')]){_0x12e5be[_0x29ba('0x40')]['push']({'id':0x0,'priority':_0x12e5be['applications'][_0x29ba('0x44')]+0x1,'app':_0x29ba('0x4c'),'appdata':_0x29ba('0x4d'),'interval':'*,*,*,*'});}_0x3153c3[_0x29ba('0x4e')]=!![];}else{_0x3153c3['created']=![];}_0x12e5be[_0x29ba('0x4f')]=_0x3153c3;return db[_0x29ba('0x50')]['create']({'body':_0x59d993[_0x29ba('0x27')]['body'],'FaxAccountId':_0x59d993[_0x29ba('0x3a')]['id'],'FaxInteractionId':_0x43156f['id'],'direction':'in','ContactId':_0x43156f[_0x29ba('0x51')],'AttachmentId':_0x59d993[_0x29ba('0x27')][_0x29ba('0x52')]});})[_0x29ba('0x25')](function(_0x4789f7){_0x12e5be['message']=_0x4789f7;if(_0x12e5be[_0x29ba('0x4f')]['UserId']){return db['User']['find']({'attributes':['id',_0x29ba('0x53')],'where':{'id':_0x12e5be['interaction'][_0x29ba('0x54')]}})['then'](function(_0x7f4058){if(_0x7f4058){_0x12e5be[_0x29ba('0x40')][_0x29ba('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x7f4058[_0x29ba('0x53')]+','+(_0x12e5be['account'][_0x29ba('0x56')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x29ba('0x57'),_0x29ba('0x58'),_0x12e5be);});}return respondWithRpcPromise(_0x29ba('0x57'),_0x29ba('0x58'),_0x12e5be);})[_0x29ba('0x25')](function(_0x16280e){_0x2d5a9b(_0x16280e);})[_0x29ba('0x19')](function(_0x542f1c){_0x317200(_0x40aaea[_0x29ba('0x14')](0x1f4,_0x542f1c[_0x29ba('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index fabfdbe..aded1ec 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 _0x0f9a=['removeListener','register','length','./faxAccount.events','update'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x0f9a,0x15c));var _0xa0f9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0f9a[_0x2dafbe];return _0x58a45a;};'use strict';var FaxAccountEvents=require(_0xa0f9('0x0'));var events=['save','remove',_0xa0f9('0x1')];function createListener(_0x116952,_0x2dd830){return function(_0x412605){_0x2dd830['emit'](_0x116952,_0x412605);};}function removeListener(_0x5a7198,_0x15c858){return function(){FaxAccountEvents[_0xa0f9('0x2')](_0x5a7198,_0x15c858);};}exports[_0xa0f9('0x3')]=function(_0x162f4f){for(var _0x52d5de=0x0,_0x1e5133=events[_0xa0f9('0x4')];_0x52d5de<_0x1e5133;_0x52d5de++){var _0x56d315=events[_0x52d5de];var _0x1aeded=createListener('faxAccount:'+_0x56d315,_0x162f4f);FaxAccountEvents['on'](_0x56d315,_0x1aeded);}}; \ No newline at end of file +var _0x9ca4=['update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x4abab9,_0xde21a4){var _0x374eba=function(_0x3659f7){while(--_0x3659f7){_0x4abab9['push'](_0x4abab9['shift']());}};_0x374eba(++_0xde21a4);}(_0x9ca4,0xf9));var _0x49ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ca4[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0x49ca('0x0'));var events=[_0x49ca('0x1'),_0x49ca('0x2'),_0x49ca('0x3')];function createListener(_0x41bad5,_0x1862aa){return function(_0x10b17e){_0x1862aa[_0x49ca('0x4')](_0x41bad5,_0x10b17e);};}function removeListener(_0x2fd88c,_0x59a512){return function(){FaxAccountEvents[_0x49ca('0x5')](_0x2fd88c,_0x59a512);};}exports[_0x49ca('0x6')]=function(_0x51c50c){for(var _0x400924=0x0,_0x4b79d1=events[_0x49ca('0x7')];_0x400924<_0x4b79d1;_0x400924++){var _0x2399ca=events[_0x400924];var _0x20bd24=createListener(_0x49ca('0x8')+_0x2399ca,_0x51c50c);FaxAccountEvents['on'](_0x2399ca,_0x20bd24);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index dd3ef09..874712e 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(_0x1d570a,_0xdabdba){var _0x3a0b6f=function(_0x95137c){while(--_0x95137c){_0x1d570a['push'](_0x1d570a['shift']());}};_0x3a0b6f(++_0xdabdba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x4a7665,_0x5c9c90){var _0x1f4a48=function(_0x2b4680){while(--_0x2b4680){_0x4a7665['push'](_0x4a7665['shift']());}};_0x1f4a48(++_0x5c9c90);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 1cec07f..9fea2cc 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 _0x5fcb=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x32f75b,_0x16cde7){var _0x26f5c7=function(_0x2f80b8){while(--_0x2f80b8){_0x32f75b['push'](_0x32f75b['shift']());}};_0x26f5c7(++_0x16cde7);}(_0x5fcb,0x19b));var _0xb5fc=function(_0x361337,_0x2a0f78){_0x361337=_0x361337-0x0;var _0x55470f=_0x5fcb[_0x361337];return _0x55470f;};'use strict';var Sequelize=require('sequelize');module[_0xb5fc('0x0')]={'priority':{'type':Sequelize[_0xb5fc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb5fc('0x2')],'allowNull':![],'defaultValue':_0xb5fc('0x3')},'appdata':{'type':Sequelize[_0xb5fc('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb5fc('0x2')],'defaultValue':_0xb5fc('0x5')}}; \ No newline at end of file +var _0xf2ec=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0xaacc0,_0x4d631d){var _0x2f1809=function(_0x43cf00){while(--_0x43cf00){_0xaacc0['push'](_0xaacc0['shift']());}};_0x2f1809(++_0x4d631d);}(_0xf2ec,0x72));var _0xcf2e=function(_0x51bdd6,_0x170668){_0x51bdd6=_0x51bdd6-0x0;var _0x1a6989=_0xf2ec[_0x51bdd6];return _0x1a6989;};'use strict';var Sequelize=require(_0xcf2e('0x0'));module[_0xcf2e('0x1')]={'priority':{'type':Sequelize[_0xcf2e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcf2e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcf2e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcf2e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 81dd601..931f7b2 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 _0xca97=['sort','where','pick','filter','merge','VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x12bc95,_0x4306ed){var _0x4a5f1a=function(_0x164641){while(--_0x164641){_0x12bc95['push'](_0x12bc95['shift']());}};_0x4a5f1a(++_0x4306ed);}(_0xca97,0x132));var _0x7ca9=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xca97[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x7ca9('0x0'));var rimraf=require(_0x7ca9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ca9('0x2'));var rp=require(_0x7ca9('0x3'));var moment=require(_0x7ca9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7ca9('0x5'));var util=require(_0x7ca9('0x6'));var path=require(_0x7ca9('0x7'));var sox=require(_0x7ca9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ca9('0x9'));var _=require(_0x7ca9('0xa'));var squel=require(_0x7ca9('0xb'));var crypto=require(_0x7ca9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7ca9('0xd'));var toCsv=require(_0x7ca9('0xe'));var querystring=require('querystring');var Papa=require(_0x7ca9('0xf'));var Redis=require(_0x7ca9('0x10'));var authService=require(_0x7ca9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ca9('0x12'));var logger=require('../../config/logger')(_0x7ca9('0x13'));var utils=require(_0x7ca9('0x14'));var config=require(_0x7ca9('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x947290,_0x431e3a){_0x431e3a=_0x431e3a||0xcc;return function(_0x292fef){if(_0x292fef){return _0x947290[_0x7ca9('0x16')](_0x431e3a);}return _0x947290[_0x7ca9('0x17')](_0x431e3a)[_0x7ca9('0x18')]();};}function respondWithResult(_0x382023,_0x198a07){_0x198a07=_0x198a07||0xc8;return function(_0xc430f1){if(_0xc430f1){return _0x382023['status'](_0x198a07)['json'](_0xc430f1);}};}function respondWithFilteredResult(_0x472cb1,_0x1d5f27){return function(_0x22ed87){if(_0x22ed87){var _0x4a2db6=typeof _0x1d5f27[_0x7ca9('0x19')]===_0x7ca9('0x1a')&&typeof _0x1d5f27[_0x7ca9('0x1b')]==='undefined';var _0x10e64d=_0x22ed87[_0x7ca9('0x1c')];var _0x5c2679=_0x4a2db6?0x0:_0x1d5f27[_0x7ca9('0x19')];var _0x38c41f=_0x4a2db6?_0x22ed87[_0x7ca9('0x1c')]:_0x1d5f27[_0x7ca9('0x19')]+_0x1d5f27[_0x7ca9('0x1b')];var _0x19fb80;if(_0x38c41f>=_0x10e64d){_0x38c41f=_0x10e64d;_0x19fb80=0xc8;}else{_0x19fb80=0xce;}_0x472cb1[_0x7ca9('0x17')](_0x19fb80);return _0x472cb1[_0x7ca9('0x1d')](_0x7ca9('0x1e'),_0x5c2679+'-'+_0x38c41f+'/'+_0x10e64d)[_0x7ca9('0x1f')](_0x22ed87);}return null;};}function patchUpdates(_0x4d41b4){return function(_0x32657a){try{jsonpatch['apply'](_0x32657a,_0x4d41b4,!![]);}catch(_0x471670){return BPromise['reject'](_0x471670);}return _0x32657a['save']();};}function saveUpdates(_0x47dbe3,_0xa8a7b4){return function(_0x579eae){if(_0x579eae){return _0x579eae[_0x7ca9('0x20')](_0x47dbe3)[_0x7ca9('0x21')](function(_0x2227bd){return _0x2227bd;});}return null;};}function removeEntity(_0x5bb275,_0x50bd66){return function(_0x24507a){if(_0x24507a){return _0x24507a[_0x7ca9('0x22')]()[_0x7ca9('0x21')](function(){_0x5bb275[_0x7ca9('0x17')](0xcc)[_0x7ca9('0x18')]();});}};}function handleEntityNotFound(_0x6b148b,_0x20e09e){return function(_0x19e6c1){if(!_0x19e6c1){_0x6b148b[_0x7ca9('0x16')](0x194);}return _0x19e6c1;};}function handleError(_0x42bb50,_0x564658){_0x564658=_0x564658||0x1f4;return function(_0x32179a){logger[_0x7ca9('0x23')](_0x32179a[_0x7ca9('0x24')]);if(_0x32179a[_0x7ca9('0x25')]){delete _0x32179a['name'];}_0x42bb50[_0x7ca9('0x17')](_0x564658)[_0x7ca9('0x26')](_0x32179a);};}exports[_0x7ca9('0x27')]=function(_0x5aad64,_0x2226f3){var _0x53cdd9={},_0x19ee99={},_0x2678ea={'count':0x0,'rows':[]};var _0x41e1ed=_[_0x7ca9('0x28')](db['FaxApplication'][_0x7ca9('0x29')],function(_0x346d19){return{'name':_0x346d19[_0x7ca9('0x2a')],'type':_0x346d19[_0x7ca9('0x2b')]['key']};});_0x19ee99[_0x7ca9('0x2c')]=_[_0x7ca9('0x28')](_0x41e1ed,_0x7ca9('0x25'));_0x19ee99[_0x7ca9('0x2d')]=_[_0x7ca9('0x2e')](_0x5aad64[_0x7ca9('0x2d')]);_0x19ee99[_0x7ca9('0x2f')]=_[_0x7ca9('0x30')](_0x19ee99[_0x7ca9('0x2c')],_0x19ee99[_0x7ca9('0x2d')]);_0x53cdd9[_0x7ca9('0x31')]=_[_0x7ca9('0x30')](_0x19ee99[_0x7ca9('0x2c')],qs[_0x7ca9('0x32')](_0x5aad64[_0x7ca9('0x2d')][_0x7ca9('0x32')]));_0x53cdd9[_0x7ca9('0x31')]=_0x53cdd9[_0x7ca9('0x31')]['length']?_0x53cdd9['attributes']:_0x19ee99['model'];if(!_0x5aad64[_0x7ca9('0x2d')][_0x7ca9('0x33')](_0x7ca9('0x34'))){_0x53cdd9[_0x7ca9('0x1b')]=qs[_0x7ca9('0x1b')](_0x5aad64[_0x7ca9('0x2d')][_0x7ca9('0x1b')]);_0x53cdd9['offset']=qs[_0x7ca9('0x19')](_0x5aad64[_0x7ca9('0x2d')][_0x7ca9('0x19')]);}_0x53cdd9[_0x7ca9('0x35')]=qs['sort'](_0x5aad64[_0x7ca9('0x2d')][_0x7ca9('0x36')]);_0x53cdd9[_0x7ca9('0x37')]=qs[_0x7ca9('0x2f')](_[_0x7ca9('0x38')](_0x5aad64[_0x7ca9('0x2d')],_0x19ee99['filters']),_0x41e1ed);if(_0x5aad64['query'][_0x7ca9('0x39')]){_0x53cdd9[_0x7ca9('0x37')]=_[_0x7ca9('0x3a')](_0x53cdd9[_0x7ca9('0x37')],{'$or':_[_0x7ca9('0x28')](_0x41e1ed,function(_0x1494b1){if(_0x1494b1[_0x7ca9('0x2b')]!==_0x7ca9('0x3b')){var _0x58ad42={};_0x58ad42[_0x1494b1[_0x7ca9('0x25')]]={'$like':'%'+_0x5aad64[_0x7ca9('0x2d')][_0x7ca9('0x39')]+'%'};return _0x58ad42;}})});}_0x53cdd9=_['merge']({},_0x53cdd9,_0x5aad64[_0x7ca9('0x3c')]);var _0x184337={'where':_0x53cdd9['where']};return db[_0x7ca9('0x3d')][_0x7ca9('0x1c')](_0x184337)[_0x7ca9('0x21')](function(_0x5ebf3f){_0x2678ea[_0x7ca9('0x1c')]=_0x5ebf3f;if(_0x5aad64[_0x7ca9('0x2d')][_0x7ca9('0x3e')]){_0x53cdd9[_0x7ca9('0x3f')]=[{'all':!![]}];}return db[_0x7ca9('0x3d')][_0x7ca9('0x40')](_0x53cdd9);})[_0x7ca9('0x21')](function(_0x2c9d82){_0x2678ea[_0x7ca9('0x41')]=_0x2c9d82;return _0x2678ea;})[_0x7ca9('0x21')](respondWithFilteredResult(_0x2226f3,_0x53cdd9))[_0x7ca9('0x42')](handleError(_0x2226f3,null));};exports[_0x7ca9('0x43')]=function(_0x35da8f,_0x20254c){var _0x13c0f4={'raw':!![],'where':{'id':_0x35da8f[_0x7ca9('0x44')]['id']}},_0x19937e={};_0x19937e[_0x7ca9('0x2c')]=_[_0x7ca9('0x2e')](db[_0x7ca9('0x3d')][_0x7ca9('0x29')]);_0x19937e['query']=_[_0x7ca9('0x2e')](_0x35da8f[_0x7ca9('0x2d')]);_0x19937e[_0x7ca9('0x2f')]=_[_0x7ca9('0x30')](_0x19937e['model'],_0x19937e[_0x7ca9('0x2d')]);_0x13c0f4[_0x7ca9('0x31')]=_[_0x7ca9('0x30')](_0x19937e[_0x7ca9('0x2c')],qs[_0x7ca9('0x32')](_0x35da8f[_0x7ca9('0x2d')][_0x7ca9('0x32')]));_0x13c0f4[_0x7ca9('0x31')]=_0x13c0f4[_0x7ca9('0x31')]['length']?_0x13c0f4[_0x7ca9('0x31')]:_0x19937e[_0x7ca9('0x2c')];if(_0x35da8f[_0x7ca9('0x2d')]['includeAll']){_0x13c0f4[_0x7ca9('0x3f')]=[{'all':!![]}];}_0x13c0f4=_[_0x7ca9('0x3a')]({},_0x13c0f4,_0x35da8f[_0x7ca9('0x3c')]);return db['FaxApplication'][_0x7ca9('0x45')](_0x13c0f4)[_0x7ca9('0x21')](handleEntityNotFound(_0x20254c,null))['then'](respondWithResult(_0x20254c,null))['catch'](handleError(_0x20254c,null));};exports['create']=function(_0x41f772,_0x37fcbf){return db['FaxApplication'][_0x7ca9('0x46')](_0x41f772[_0x7ca9('0x47')],{})['then'](respondWithResult(_0x37fcbf,0xc9))[_0x7ca9('0x42')](handleError(_0x37fcbf,null));};exports['update']=function(_0x114534,_0x307151){if(_0x114534[_0x7ca9('0x47')]['id']){delete _0x114534['body']['id'];}return db[_0x7ca9('0x3d')]['find']({'where':{'id':_0x114534['params']['id']}})[_0x7ca9('0x21')](handleEntityNotFound(_0x307151,null))[_0x7ca9('0x21')](saveUpdates(_0x114534[_0x7ca9('0x47')],null))[_0x7ca9('0x21')](respondWithResult(_0x307151,null))['catch'](handleError(_0x307151,null));};exports[_0x7ca9('0x22')]=function(_0x27eb9d,_0x549394){return db[_0x7ca9('0x3d')][_0x7ca9('0x45')]({'where':{'id':_0x27eb9d[_0x7ca9('0x44')]['id']}})[_0x7ca9('0x21')](handleEntityNotFound(_0x549394,null))['then'](removeEntity(_0x549394,null))[_0x7ca9('0x42')](handleError(_0x549394,null));}; \ No newline at end of file +var _0x953f=['FaxApplication','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','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/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','map'];(function(_0x56c9a3,_0x99bbd4){var _0x542120=function(_0x752603){while(--_0x752603){_0x56c9a3['push'](_0x56c9a3['shift']());}};_0x542120(++_0x99bbd4);}(_0x953f,0xbb));var _0xf953=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x953f[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xf953('0x0'));var rimraf=require(_0xf953('0x1'));var zipdir=require(_0xf953('0x2'));var jsonpatch=require(_0xf953('0x3'));var rp=require('request-promise');var moment=require(_0xf953('0x4'));var BPromise=require(_0xf953('0x5'));var Mustache=require(_0xf953('0x6'));var util=require(_0xf953('0x7'));var path=require('path');var sox=require(_0xf953('0x8'));var csv=require(_0xf953('0x9'));var ejs=require(_0xf953('0xa'));var fs=require('fs');var fs_extra=require(_0xf953('0xb'));var _=require(_0xf953('0xc'));var squel=require(_0xf953('0xd'));var crypto=require('crypto');var jsforce=require(_0xf953('0xe'));var deskjs=require(_0xf953('0xf'));var toCsv=require(_0xf953('0x9'));var querystring=require(_0xf953('0x10'));var Papa=require(_0xf953('0x11'));var Redis=require(_0xf953('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf953('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf953('0x14'));var logger=require(_0xf953('0x15'))('api');var utils=require(_0xf953('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf953('0x17'));var db=require(_0xf953('0x18'))['db'];function respondWithStatusCode(_0x514b3b,_0x1d1aca){_0x1d1aca=_0x1d1aca||0xcc;return function(_0xcb80c0){if(_0xcb80c0){return _0x514b3b[_0xf953('0x19')](_0x1d1aca);}return _0x514b3b[_0xf953('0x1a')](_0x1d1aca)['end']();};}function respondWithResult(_0x549de7,_0x53762){_0x53762=_0x53762||0xc8;return function(_0x1637d2){if(_0x1637d2){return _0x549de7[_0xf953('0x1a')](_0x53762)[_0xf953('0x1b')](_0x1637d2);}};}function respondWithFilteredResult(_0x1f2036,_0x331798){return function(_0x1e9112){if(_0x1e9112){var _0x166651=typeof _0x331798[_0xf953('0x1c')]===_0xf953('0x1d')&&typeof _0x331798[_0xf953('0x1e')]==='undefined';var _0x4a59c1=_0x1e9112['count'];var _0x3e5965=_0x166651?0x0:_0x331798[_0xf953('0x1c')];var _0x14d4e7=_0x166651?_0x1e9112['count']:_0x331798[_0xf953('0x1c')]+_0x331798[_0xf953('0x1e')];var _0x4d6a66;if(_0x14d4e7>=_0x4a59c1){_0x14d4e7=_0x4a59c1;_0x4d6a66=0xc8;}else{_0x4d6a66=0xce;}_0x1f2036[_0xf953('0x1a')](_0x4d6a66);return _0x1f2036[_0xf953('0x1f')]('Content-Range',_0x3e5965+'-'+_0x14d4e7+'/'+_0x4a59c1)['json'](_0x1e9112);}return null;};}function patchUpdates(_0x57e14a){return function(_0x5cb661){try{jsonpatch[_0xf953('0x20')](_0x5cb661,_0x57e14a,!![]);}catch(_0xa9d7ce){return BPromise[_0xf953('0x21')](_0xa9d7ce);}return _0x5cb661['save']();};}function saveUpdates(_0x3bb360,_0x27c05e){return function(_0x51e02d){if(_0x51e02d){return _0x51e02d[_0xf953('0x22')](_0x3bb360)[_0xf953('0x23')](function(_0x35fd7b){return _0x35fd7b;});}return null;};}function removeEntity(_0x471507,_0x2f3d50){return function(_0x37f0b4){if(_0x37f0b4){return _0x37f0b4[_0xf953('0x24')]()[_0xf953('0x23')](function(){_0x471507[_0xf953('0x1a')](0xcc)[_0xf953('0x25')]();});}};}function handleEntityNotFound(_0x5f3afe,_0x446eab){return function(_0x325440){if(!_0x325440){_0x5f3afe[_0xf953('0x19')](0x194);}return _0x325440;};}function handleError(_0x1bbd61,_0x541c6c){_0x541c6c=_0x541c6c||0x1f4;return function(_0x2775f2){logger[_0xf953('0x26')](_0x2775f2[_0xf953('0x27')]);if(_0x2775f2[_0xf953('0x28')]){delete _0x2775f2[_0xf953('0x28')];}_0x1bbd61[_0xf953('0x1a')](_0x541c6c)[_0xf953('0x29')](_0x2775f2);};}exports[_0xf953('0x2a')]=function(_0x2204c6,_0x2f210e){var _0x2bbcfc={},_0x52a1c5={},_0x4ec4a2={'count':0x0,'rows':[]};var _0x4c07e1=_[_0xf953('0x2b')](db[_0xf953('0x2c')]['rawAttributes'],function(_0x15d9f9){return{'name':_0x15d9f9[_0xf953('0x2d')],'type':_0x15d9f9[_0xf953('0x2e')][_0xf953('0x2f')]};});_0x52a1c5[_0xf953('0x30')]=_['map'](_0x4c07e1,_0xf953('0x28'));_0x52a1c5[_0xf953('0x31')]=_[_0xf953('0x32')](_0x2204c6[_0xf953('0x31')]);_0x52a1c5[_0xf953('0x33')]=_['intersection'](_0x52a1c5['model'],_0x52a1c5[_0xf953('0x31')]);_0x2bbcfc[_0xf953('0x34')]=_[_0xf953('0x35')](_0x52a1c5[_0xf953('0x30')],qs[_0xf953('0x36')](_0x2204c6[_0xf953('0x31')][_0xf953('0x36')]));_0x2bbcfc['attributes']=_0x2bbcfc[_0xf953('0x34')]['length']?_0x2bbcfc[_0xf953('0x34')]:_0x52a1c5['model'];if(!_0x2204c6[_0xf953('0x31')][_0xf953('0x37')](_0xf953('0x38'))){_0x2bbcfc['limit']=qs[_0xf953('0x1e')](_0x2204c6[_0xf953('0x31')][_0xf953('0x1e')]);_0x2bbcfc[_0xf953('0x1c')]=qs[_0xf953('0x1c')](_0x2204c6[_0xf953('0x31')][_0xf953('0x1c')]);}_0x2bbcfc[_0xf953('0x39')]=qs[_0xf953('0x3a')](_0x2204c6[_0xf953('0x31')][_0xf953('0x3a')]);_0x2bbcfc[_0xf953('0x3b')]=qs[_0xf953('0x33')](_[_0xf953('0x3c')](_0x2204c6['query'],_0x52a1c5[_0xf953('0x33')]),_0x4c07e1);if(_0x2204c6[_0xf953('0x31')]['filter']){_0x2bbcfc[_0xf953('0x3b')]=_['merge'](_0x2bbcfc['where'],{'$or':_['map'](_0x4c07e1,function(_0x139c97){if(_0x139c97[_0xf953('0x2e')]!==_0xf953('0x3d')){var _0x24ac0e={};_0x24ac0e[_0x139c97['name']]={'$like':'%'+_0x2204c6[_0xf953('0x31')][_0xf953('0x3e')]+'%'};return _0x24ac0e;}})});}_0x2bbcfc=_[_0xf953('0x3f')]({},_0x2bbcfc,_0x2204c6[_0xf953('0x40')]);var _0x4d7b8a={'where':_0x2bbcfc[_0xf953('0x3b')]};return db[_0xf953('0x2c')][_0xf953('0x41')](_0x4d7b8a)['then'](function(_0x4de97f){_0x4ec4a2['count']=_0x4de97f;if(_0x2204c6[_0xf953('0x31')]['includeAll']){_0x2bbcfc[_0xf953('0x42')]=[{'all':!![]}];}return db[_0xf953('0x2c')][_0xf953('0x43')](_0x2bbcfc);})[_0xf953('0x23')](function(_0x5be0df){_0x4ec4a2[_0xf953('0x44')]=_0x5be0df;return _0x4ec4a2;})[_0xf953('0x23')](respondWithFilteredResult(_0x2f210e,_0x2bbcfc))[_0xf953('0x45')](handleError(_0x2f210e,null));};exports[_0xf953('0x46')]=function(_0x2ec378,_0x27ac3f){var _0x1d3de3={'raw':!![],'where':{'id':_0x2ec378['params']['id']}},_0x3a21e4={};_0x3a21e4[_0xf953('0x30')]=_[_0xf953('0x32')](db[_0xf953('0x2c')][_0xf953('0x47')]);_0x3a21e4[_0xf953('0x31')]=_[_0xf953('0x32')](_0x2ec378[_0xf953('0x31')]);_0x3a21e4['filters']=_[_0xf953('0x35')](_0x3a21e4['model'],_0x3a21e4[_0xf953('0x31')]);_0x1d3de3[_0xf953('0x34')]=_[_0xf953('0x35')](_0x3a21e4[_0xf953('0x30')],qs[_0xf953('0x36')](_0x2ec378['query'][_0xf953('0x36')]));_0x1d3de3[_0xf953('0x34')]=_0x1d3de3[_0xf953('0x34')][_0xf953('0x48')]?_0x1d3de3['attributes']:_0x3a21e4[_0xf953('0x30')];if(_0x2ec378['query']['includeAll']){_0x1d3de3[_0xf953('0x42')]=[{'all':!![]}];}_0x1d3de3=_['merge']({},_0x1d3de3,_0x2ec378[_0xf953('0x40')]);return db[_0xf953('0x2c')][_0xf953('0x49')](_0x1d3de3)[_0xf953('0x23')](handleEntityNotFound(_0x27ac3f,null))[_0xf953('0x23')](respondWithResult(_0x27ac3f,null))[_0xf953('0x45')](handleError(_0x27ac3f,null));};exports['create']=function(_0x257fc4,_0x4c6076){return db[_0xf953('0x2c')][_0xf953('0x4a')](_0x257fc4[_0xf953('0x4b')],{})[_0xf953('0x23')](respondWithResult(_0x4c6076,0xc9))[_0xf953('0x45')](handleError(_0x4c6076,null));};exports[_0xf953('0x22')]=function(_0x6471b4,_0x5a2585){if(_0x6471b4[_0xf953('0x4b')]['id']){delete _0x6471b4['body']['id'];}return db[_0xf953('0x2c')][_0xf953('0x49')]({'where':{'id':_0x6471b4[_0xf953('0x4c')]['id']}})[_0xf953('0x23')](handleEntityNotFound(_0x5a2585,null))[_0xf953('0x23')](saveUpdates(_0x6471b4[_0xf953('0x4b')],null))['then'](respondWithResult(_0x5a2585,null))[_0xf953('0x45')](handleError(_0x5a2585,null));};exports[_0xf953('0x24')]=function(_0x434e44,_0x5c4b5b){return db[_0xf953('0x2c')][_0xf953('0x49')]({'where':{'id':_0x434e44['params']['id']}})[_0xf953('0x23')](handleEntityNotFound(_0x5c4b5b,null))[_0xf953('0x23')](removeEntity(_0x5c4b5b,null))[_0xf953('0x45')](handleError(_0x5c4b5b,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8fb8bd0..46dd609 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 _0x3daf=['api','moment','request-promise','path','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3daf,0x10f));var _0xf3da=function(_0x15cc58,_0x549bae){_0x15cc58=_0x15cc58-0x0;var _0x69ec17=_0x3daf[_0x15cc58];return _0x69ec17;};'use strict';var _=require('lodash');var util=require(_0xf3da('0x0'));var logger=require(_0xf3da('0x1'))(_0xf3da('0x2'));var moment=require(_0xf3da('0x3'));var BPromise=require('bluebird');var rp=require(_0xf3da('0x4'));var fs=require('fs');var path=require(_0xf3da('0x5'));var rimraf=require('rimraf');var config=require(_0xf3da('0x6'));var attributes=require(_0xf3da('0x7'));module[_0xf3da('0x8')]=function(_0x359db0,_0x28914a){return _0x359db0['define'](_0xf3da('0x9'),attributes,{'tableName':_0xf3da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf3da('0xb'),'collate':_0xf3da('0xc')});}; \ No newline at end of file +var _0x883e=['moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x31f1cd,_0x354da4){var _0x4ad2cb=function(_0x433790){while(--_0x433790){_0x31f1cd['push'](_0x31f1cd['shift']());}};_0x4ad2cb(++_0x354da4);}(_0x883e,0x17e));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe883('0x1'));var moment=require(_0xe883('0x2'));var BPromise=require(_0xe883('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe883('0x4'));var rimraf=require(_0xe883('0x5'));var config=require(_0xe883('0x6'));var attributes=require(_0xe883('0x7'));module['exports']=function(_0x5e6c84,_0x5ea0e8){return _0x5e6c84[_0xe883('0x8')](_0xe883('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe883('0xa'),'collate':_0xe883('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 4113de5..4a16612 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 _0xd9c8=['info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x5244e0,_0x350ee3){var _0x48a6e3=function(_0x462de2){while(--_0x462de2){_0x5244e0['push'](_0x5244e0['shift']());}};_0x48a6e3(++_0x350ee3);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd9c8[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var moment=require('moment');var BPromise=require(_0x8d9c('0x2'));var rs=require(_0x8d9c('0x3'));var fs=require('fs');var Redis=require(_0x8d9c('0x4'));var db=require(_0x8d9c('0x5'))['db'];var utils=require(_0x8d9c('0x6'));var logger=require(_0x8d9c('0x7'))(_0x8d9c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8d9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ebb5a,_0x475edd,_0x49c96f){return new BPromise(function(_0x3790f6,_0x3de357){return client[_0x8d9c('0xa')](_0x1ebb5a,_0x49c96f)[_0x8d9c('0xb')](function(_0x2db4b3){logger[_0x8d9c('0xc')](_0x8d9c('0xd'),_0x475edd,_0x8d9c('0xe'));logger['debug'](_0x8d9c('0xf'),_0x475edd,'request\x20sent',JSON[_0x8d9c('0x10')](_0x2db4b3));if(_0x2db4b3['error']){if(_0x2db4b3[_0x8d9c('0x11')]['code']===0x1f4){logger['error'](_0x8d9c('0xd'),_0x475edd,_0x2db4b3['error'][_0x8d9c('0x12')]);return _0x3de357(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);return _0x3790f6(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}else{logger[_0x8d9c('0xc')]('FaxApplication,\x20%s,\x20%s',_0x475edd,_0x8d9c('0xe'));_0x3790f6(_0x2db4b3[_0x8d9c('0x13')][_0x8d9c('0x12')]);}})[_0x8d9c('0x14')](function(_0x1a071d){logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x1a071d);_0x3de357(_0x1a071d);});});}exports[_0x8d9c('0x15')]=function(_0x1ed27d){var _0x44896d=this;return new Promise(function(_0x48fffd,_0x105952){return db[_0x8d9c('0x16')]['update'](_0x1ed27d[_0x8d9c('0x17')],{'raw':_0x1ed27d[_0x8d9c('0x18')]?_0x1ed27d['options'][_0x8d9c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed27d[_0x8d9c('0x18')]?_0x1ed27d[_0x8d9c('0x18')][_0x8d9c('0x1a')]||null:null,'attributes':_0x1ed27d['options']?_0x1ed27d[_0x8d9c('0x18')][_0x8d9c('0x1b')]||null:null,'limit':_0x1ed27d['options']?_0x1ed27d['options'][_0x8d9c('0x1c')]||null:null})[_0x8d9c('0xb')](function(_0x1c2fe9){logger[_0x8d9c('0xc')](_0x8d9c('0x15'),_0x1ed27d);logger[_0x8d9c('0x1d')](_0x8d9c('0x15'),_0x1ed27d,JSON['stringify'](_0x1c2fe9));_0x48fffd(_0x1c2fe9);})[_0x8d9c('0x14')](function(_0x49f4f0){logger[_0x8d9c('0x11')](_0x8d9c('0x15'),_0x49f4f0[_0x8d9c('0x12')],_0x1ed27d);_0x105952(_0x44896d[_0x8d9c('0x11')](0x1f4,_0x49f4f0[_0x8d9c('0x12')]));});});}; \ No newline at end of file +var _0x7eea=['stringify','error','code','message','catch','UpdateFaxApplication','body','options','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x57b955,_0x434048){var _0x3366f7=function(_0x4f7c9c){while(--_0x4f7c9c){_0x57b955['push'](_0x57b955['shift']());}};_0x3366f7(++_0x434048);}(_0x7eea,0x7e));var _0xa7ee=function(_0xcf4af6,_0x180a75){_0xcf4af6=_0xcf4af6-0x0;var _0x2e64bc=_0x7eea[_0xcf4af6];return _0x2e64bc;};'use strict';var _=require(_0xa7ee('0x0'));var util=require(_0xa7ee('0x1'));var moment=require(_0xa7ee('0x2'));var BPromise=require(_0xa7ee('0x3'));var rs=require(_0xa7ee('0x4'));var fs=require('fs');var Redis=require(_0xa7ee('0x5'));var db=require(_0xa7ee('0x6'))['db'];var utils=require(_0xa7ee('0x7'));var logger=require(_0xa7ee('0x8'))(_0xa7ee('0x9'));var config=require(_0xa7ee('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa7ee('0xb')][_0xa7ee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35d130,_0x4f69e6,_0x55adc4){return new BPromise(function(_0x3c18e5,_0x7ec50a){return client['request'](_0x35d130,_0x55adc4)[_0xa7ee('0xd')](function(_0x54206a){logger[_0xa7ee('0xe')](_0xa7ee('0xf'),_0x4f69e6,_0xa7ee('0x10'));logger[_0xa7ee('0x11')](_0xa7ee('0x12'),_0x4f69e6,_0xa7ee('0x10'),JSON[_0xa7ee('0x13')](_0x54206a));if(_0x54206a[_0xa7ee('0x14')]){if(_0x54206a[_0xa7ee('0x14')][_0xa7ee('0x15')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x4f69e6,_0x54206a[_0xa7ee('0x14')][_0xa7ee('0x16')]);return _0x7ec50a(_0x54206a[_0xa7ee('0x14')][_0xa7ee('0x16')]);}logger[_0xa7ee('0x14')](_0xa7ee('0xf'),_0x4f69e6,_0x54206a['error'][_0xa7ee('0x16')]);return _0x3c18e5(_0x54206a[_0xa7ee('0x14')][_0xa7ee('0x16')]);}else{logger[_0xa7ee('0xe')]('FaxApplication,\x20%s,\x20%s',_0x4f69e6,_0xa7ee('0x10'));_0x3c18e5(_0x54206a['result'][_0xa7ee('0x16')]);}})[_0xa7ee('0x17')](function(_0x5a9a12){logger[_0xa7ee('0x14')](_0xa7ee('0xf'),_0x4f69e6,_0x5a9a12);_0x7ec50a(_0x5a9a12);});});}exports[_0xa7ee('0x18')]=function(_0x3ac695){var _0xe53d07=this;return new Promise(function(_0x1c7206,_0x2e7f72){return db['FaxApplication']['update'](_0x3ac695[_0xa7ee('0x19')],{'raw':_0x3ac695['options']?_0x3ac695[_0xa7ee('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ac695[_0xa7ee('0x1a')]?_0x3ac695[_0xa7ee('0x1a')]['where']||null:null,'attributes':_0x3ac695[_0xa7ee('0x1a')]?_0x3ac695[_0xa7ee('0x1a')][_0xa7ee('0x1b')]||null:null,'limit':_0x3ac695[_0xa7ee('0x1a')]?_0x3ac695[_0xa7ee('0x1a')][_0xa7ee('0x1c')]||null:null})[_0xa7ee('0xd')](function(_0x4dd1b6){logger[_0xa7ee('0xe')](_0xa7ee('0x18'),_0x3ac695);logger['debug'](_0xa7ee('0x18'),_0x3ac695,JSON['stringify'](_0x4dd1b6));_0x1c7206(_0x4dd1b6);})[_0xa7ee('0x17')](function(_0x5ce2e8){logger[_0xa7ee('0x14')](_0xa7ee('0x18'),_0x5ce2e8[_0xa7ee('0x16')],_0x3ac695);_0x2e7f72(_0xe53d07[_0xa7ee('0x14')](0x1f4,_0x5ce2e8[_0xa7ee('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 5b03134..ea0e88b 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x3dc2d8,_0x1a87c2){var _0x4a319c=function(_0x385dcc){while(--_0x385dcc){_0x3dc2d8['push'](_0x3dc2d8['shift']());}};_0x4a319c(++_0x1a87c2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0xacb1ad,_0x539401){var _0x3d48bc=function(_0x37b8d3){while(--_0x37b8d3){_0xacb1ad['push'](_0xacb1ad['shift']());}};_0x3d48bc(++_0x539401);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 7d53a95..e0db502 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 _0x0000=['DATE','STRING','out','ENUM','exports'];(function(_0x114975,_0x27f9f8){var _0x2d0424=function(_0x261a6e){while(--_0x261a6e){_0x114975['push'](_0x114975['shift']());}};_0x2d0424(++_0x27f9f8);}(_0x0000,0x17b));var _0x0000=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0000[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0000('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0000('0x1')]},'disposition':{'type':Sequelize[_0x0000('0x2')]},'secondDisposition':{'type':Sequelize[_0x0000('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0000('0x2')]},'read1stAt':{'type':Sequelize[_0x0000('0x1')]},'fax':{'type':Sequelize[_0x0000('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0000('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0000('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x0000('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x45fd=['DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x5241b5,_0x179305){var _0x47500b=function(_0xe11dc2){while(--_0xe11dc2){_0x5241b5['push'](_0x5241b5['shift']());}};_0x47500b(++_0x179305);}(_0x45fd,0xac));var _0xd45f=function(_0xba1350,_0x15cdba){_0xba1350=_0xba1350-0x0;var _0x251d54=_0x45fd[_0xba1350];return _0x251d54;};'use strict';var Sequelize=require(_0xd45f('0x0'));module[_0xd45f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd45f('0x2')]},'disposition':{'type':Sequelize[_0xd45f('0x3')]},'secondDisposition':{'type':Sequelize[_0xd45f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd45f('0x3')]},'read1stAt':{'type':Sequelize[_0xd45f('0x2')]},'fax':{'type':Sequelize[_0xd45f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd45f('0x4')]('in',_0xd45f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd45f('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd45f('0x5')),'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 ec4ba91..7e72dd5 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 _0xcb46=['Content-Range','json','then','destroy','end','error','stack','name','send','index','map','FaxInteraction','getOptions','findAll','fax','query','show','params','model','keys','rawAttributes','filters','intersection','fields','attributes','includeAll','include','merge','find','catch','create','body','addMessage','FaxMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','color','emit','faxInteractionTags:save','download','unix','join','root','tmp','server','files','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','err','rimraf','zip-dir','moment','bluebird','util','lodash','../../components/interaction/service','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset','undefined','limit','count'];(function(_0x41887d,_0x591f1d){var _0x141e52=function(_0x2bb156){while(--_0x2bb156){_0x41887d['push'](_0x41887d['shift']());}};_0x141e52(++_0x591f1d);}(_0xcb46,0xa9));var _0x6cb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb46[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x6cb4('0x0'));var zipdir=require(_0x6cb4('0x1'));var moment=require(_0x6cb4('0x2'));var BPromise=require(_0x6cb4('0x3'));var util=require(_0x6cb4('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x6cb4('0x5'));var Redis=require('ioredis');var interaction=require(_0x6cb4('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x6cb4('0x7'))('api');var config=require(_0x6cb4('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6cb4('0x9')](config[_0x6cb4('0xa')],{'host':_0x6cb4('0xb'),'port':0x18eb});var socket=require(_0x6cb4('0xc'))(new Redis(config[_0x6cb4('0xa')]));require(_0x6cb4('0xd'))[_0x6cb4('0xe')](socket);function respondWithStatusCode(_0x30c829,_0x5a4dab){_0x5a4dab=_0x5a4dab||0xcc;return function(_0x3d3da3){if(_0x3d3da3){return _0x30c829[_0x6cb4('0xf')](_0x5a4dab);}return _0x30c829['status'](_0x5a4dab)['end']();};}function respondWithResult(_0x472fec,_0x174515){_0x174515=_0x174515||0xc8;return function(_0x51b422){if(_0x51b422){return _0x472fec[_0x6cb4('0x10')](_0x174515)['json'](_0x51b422);}};}function respondWithFilteredResult(_0x24e8db,_0x14e21b){return function(_0x5a037d){if(_0x5a037d){var _0x4786b9=typeof _0x14e21b[_0x6cb4('0x11')]===_0x6cb4('0x12')&&typeof _0x14e21b[_0x6cb4('0x13')]==='undefined';var _0x306565=_0x5a037d[_0x6cb4('0x14')];var _0xa765eb=_0x4786b9?0x0:_0x14e21b[_0x6cb4('0x11')];var _0x551abd=_0x4786b9?_0x5a037d[_0x6cb4('0x14')]:_0x14e21b[_0x6cb4('0x11')]+_0x14e21b[_0x6cb4('0x13')];var _0x24d0ce;if(_0x551abd>=_0x306565){_0x551abd=_0x306565;_0x24d0ce=0xc8;}else{_0x24d0ce=0xce;}_0x24e8db[_0x6cb4('0x10')](_0x24d0ce);return _0x24e8db['set'](_0x6cb4('0x15'),_0xa765eb+'-'+_0x551abd+'/'+_0x306565)[_0x6cb4('0x16')](_0x5a037d);}return null;};}function saveUpdates(_0x2b90e7){return function(_0x5be352){if(_0x5be352){return _0x5be352['update'](_0x2b90e7)[_0x6cb4('0x17')](function(_0x354d9d){return _0x354d9d;});}return null;};}function removeEntity(_0x36566b){return function(_0x595f2){if(_0x595f2){return _0x595f2[_0x6cb4('0x18')]()[_0x6cb4('0x17')](function(){_0x36566b[_0x6cb4('0x10')](0xcc)[_0x6cb4('0x19')]();});}};}function handleEntityNotFound(_0x3870ba){return function(_0xaa3c87){if(!_0xaa3c87){_0x3870ba[_0x6cb4('0xf')](0x194);}return _0xaa3c87;};}function handleError(_0x222fa4,_0x1bcfd4){_0x1bcfd4=_0x1bcfd4||0x1f4;return function(_0x5e2d1a){logger[_0x6cb4('0x1a')](_0x5e2d1a[_0x6cb4('0x1b')]);if(_0x5e2d1a[_0x6cb4('0x1c')]){delete _0x5e2d1a[_0x6cb4('0x1c')];}_0x222fa4['status'](_0x1bcfd4)[_0x6cb4('0x1d')](_0x5e2d1a);};}exports[_0x6cb4('0x1e')]=function(_0x59089b,_0xeede91){var _0x579875={};var _0xa87fc0=_[_0x6cb4('0x1f')](db[_0x6cb4('0x20')]['rawAttributes'],function(_0x2f3c23){return{'name':_0x2f3c23['fieldName'],'type':_0x2f3c23['type']['key']};});_0x579875=qs[_0x6cb4('0x21')](_0xa87fc0,_0x59089b);return interaction[_0x6cb4('0x22')](_0x6cb4('0x23'),_0x59089b[_0x6cb4('0x24')],_0x59089b['user'],_0x579875,_0xa87fc0)[_0x6cb4('0x17')](respondWithFilteredResult(_0xeede91,_0x579875))['catch'](handleError(_0xeede91,null));};exports[_0x6cb4('0x25')]=function(_0xfc42d4,_0x22e590){var _0x536e81={'raw':![],'where':{'id':_0xfc42d4[_0x6cb4('0x26')]['id']}},_0x1e9a23={};_0x1e9a23[_0x6cb4('0x27')]=_[_0x6cb4('0x28')](db[_0x6cb4('0x20')][_0x6cb4('0x29')]);_0x1e9a23[_0x6cb4('0x24')]=_[_0x6cb4('0x28')](_0xfc42d4['query']);_0x1e9a23[_0x6cb4('0x2a')]=_[_0x6cb4('0x2b')](_0x1e9a23['model'],_0x1e9a23['query']);_0x536e81['attributes']=_[_0x6cb4('0x2b')](_0x1e9a23[_0x6cb4('0x27')],qs['fields'](_0xfc42d4[_0x6cb4('0x24')][_0x6cb4('0x2c')]));_0x536e81[_0x6cb4('0x2d')]=_0x536e81[_0x6cb4('0x2d')]['length']?_0x536e81['attributes']:_0x1e9a23[_0x6cb4('0x27')];if(_0xfc42d4[_0x6cb4('0x24')][_0x6cb4('0x2e')]){_0x536e81[_0x6cb4('0x2f')]=[{'all':!![]}];}_0x536e81=_[_0x6cb4('0x30')]({},_0x536e81,_0xfc42d4['options']);return db[_0x6cb4('0x20')][_0x6cb4('0x31')](_0x536e81)['then'](handleEntityNotFound(_0x22e590,null))[_0x6cb4('0x17')](respondWithResult(_0x22e590,null))[_0x6cb4('0x32')](handleError(_0x22e590,null));};exports[_0x6cb4('0x33')]=function(_0x40da7b,_0x38d128){return db[_0x6cb4('0x20')][_0x6cb4('0x33')](_0x40da7b[_0x6cb4('0x34')],{})[_0x6cb4('0x17')](respondWithResult(_0x38d128,0xc9))[_0x6cb4('0x32')](handleError(_0x38d128,null));};exports['update']=function(_0x57e420,_0x38a9f9){if(_0x57e420['body']['id']){delete _0x57e420[_0x6cb4('0x34')]['id'];}return db['FaxInteraction'][_0x6cb4('0x31')]({'where':{'id':_0x57e420[_0x6cb4('0x26')]['id']}})['then'](handleEntityNotFound(_0x38a9f9,null))[_0x6cb4('0x17')](saveUpdates(_0x57e420['body'],null))[_0x6cb4('0x17')](respondWithResult(_0x38a9f9,null))[_0x6cb4('0x32')](handleError(_0x38a9f9,null));};exports[_0x6cb4('0x18')]=function(_0x136527,_0x33c9cb){return db[_0x6cb4('0x20')][_0x6cb4('0x31')]({'where':{'id':_0x136527[_0x6cb4('0x26')]['id']}})[_0x6cb4('0x17')](handleEntityNotFound(_0x33c9cb,null))['then'](removeEntity(_0x33c9cb,null))[_0x6cb4('0x32')](handleError(_0x33c9cb,null));};exports['describe']=function(_0x574d42,_0x3fd32b){return db['FaxInteraction']['describe']()[_0x6cb4('0x17')](respondWithResult(_0x3fd32b,null))['catch'](handleError(_0x3fd32b,null));};exports[_0x6cb4('0x35')]=function(_0x2bf380,_0x1741a4){return db[_0x6cb4('0x36')][_0x6cb4('0x31')]({'where':{'id':_0x2bf380[_0x6cb4('0x26')]['id']}})[_0x6cb4('0x17')](handleEntityNotFound(_0x1741a4,null))[_0x6cb4('0x17')](function(_0x37a1b7){if(_0x37a1b7){return _0x37a1b7[_0x6cb4('0x35')](_0x2bf380[_0x6cb4('0x34')][_0x6cb4('0x37')],_[_0x6cb4('0x38')](_0x2bf380[_0x6cb4('0x34')],['ids','id'])||{});}})[_0x6cb4('0x17')](respondWithResult(_0x1741a4,null))[_0x6cb4('0x32')](handleError(_0x1741a4,null));};exports[_0x6cb4('0x39')]=function(_0x1612ed,_0x50700c){var _0x170729={'raw':![],'where':{}};var _0x1b558d={};var _0x4942da={'count':0x0,'rows':[]};return db[_0x6cb4('0x20')]['findOne']({'where':{'id':_0x1612ed['params']['id']}})[_0x6cb4('0x17')](handleEntityNotFound(_0x50700c,null))[_0x6cb4('0x17')](function(_0x5a5e7b){if(_0x5a5e7b){_0x1b558d['model']=_[_0x6cb4('0x28')](db[_0x6cb4('0x36')][_0x6cb4('0x29')]);_0x1b558d[_0x6cb4('0x24')]=_[_0x6cb4('0x28')](_0x1612ed['query']);_0x1b558d[_0x6cb4('0x2a')]=_[_0x6cb4('0x2b')](_0x1b558d['model'],_0x1b558d[_0x6cb4('0x24')]);_0x170729['attributes']=_[_0x6cb4('0x2b')](_0x1b558d[_0x6cb4('0x27')],qs[_0x6cb4('0x2c')](_0x1612ed[_0x6cb4('0x24')]['fields']));_0x170729[_0x6cb4('0x2d')]=_0x170729[_0x6cb4('0x2d')][_0x6cb4('0x3a')]?_0x170729[_0x6cb4('0x2d')]:_0x1b558d[_0x6cb4('0x27')];if(!_0x1612ed[_0x6cb4('0x24')][_0x6cb4('0x3b')](_0x6cb4('0x3c'))){_0x170729[_0x6cb4('0x13')]=qs[_0x6cb4('0x13')](_0x1612ed[_0x6cb4('0x24')]['limit']);_0x170729[_0x6cb4('0x11')]=qs[_0x6cb4('0x11')](_0x1612ed[_0x6cb4('0x24')][_0x6cb4('0x11')]);}_0x170729['order']=qs['sort'](_0x1612ed[_0x6cb4('0x24')][_0x6cb4('0x3d')]);_0x170729[_0x6cb4('0x3e')]=qs['filters'](_['pick'](_0x1612ed[_0x6cb4('0x24')],_0x1b558d[_0x6cb4('0x2a')]));_0x170729[_0x6cb4('0x3e')][_0x6cb4('0x3f')]=_0x5a5e7b['id'];if(_0x1612ed[_0x6cb4('0x24')][_0x6cb4('0x40')]){_0x170729[_0x6cb4('0x3e')]=_[_0x6cb4('0x30')](_0x170729[_0x6cb4('0x3e')],{'$or':_['map'](_0x170729[_0x6cb4('0x2d')],function(_0xd6e219){var _0x15488e={};_0x15488e[_0xd6e219]={'$like':'%'+_0x1612ed['query'][_0x6cb4('0x40')]+'%'};return _0x15488e;})});}if(_0x1612ed[_0x6cb4('0x24')][_0x6cb4('0x41')]){var _0x1fde64=_0x1612ed[_0x6cb4('0x24')]['$gte'][_0x6cb4('0x42')](',');var _0x12afbd={};_0x12afbd[_0x1fde64[0x0]]={'$gte':moment(_0x1fde64[0x1])[_0x6cb4('0x43')](_0x6cb4('0x44'))};_0x170729[_0x6cb4('0x3e')]=_[_0x6cb4('0x30')](_0x170729['where'],_0x12afbd);}_0x170729=_[_0x6cb4('0x30')]({},_0x170729,_0x1612ed['options']);return db[_0x6cb4('0x36')][_0x6cb4('0x14')]({'where':_0x170729[_0x6cb4('0x3e')]})[_0x6cb4('0x17')](function(_0x74d6d5){_0x4942da[_0x6cb4('0x14')]=_0x74d6d5;if(_0x1612ed['query'][_0x6cb4('0x2e')]){_0x170729[_0x6cb4('0x2f')]=[{'all':!![]}];}return db[_0x6cb4('0x36')][_0x6cb4('0x22')](_0x170729);})[_0x6cb4('0x17')](function(_0x514950){_0x4942da['rows']=_0x514950;return _0x4942da;});}})[_0x6cb4('0x17')](respondWithFilteredResult(_0x50700c,_0x170729))[_0x6cb4('0x32')](handleError(_0x50700c,null));};exports[_0x6cb4('0x45')]=function(_0x41ed40,_0x258327){return db[_0x6cb4('0x20')][_0x6cb4('0x31')]({'where':{'id':_0x41ed40[_0x6cb4('0x26')]['id']}})[_0x6cb4('0x17')](handleEntityNotFound(_0x258327,null))[_0x6cb4('0x17')](function(_0x24fd93){if(_0x24fd93){return _0x24fd93['setTags'](_0x41ed40['body'][_0x6cb4('0x37')],_[_0x6cb4('0x38')](_0x41ed40[_0x6cb4('0x34')],[_0x6cb4('0x37'),'id'])||{})[_0x6cb4('0x46')](function(){return db['Tag'][_0x6cb4('0x22')]({'attributes':['id',_0x6cb4('0x1c'),_0x6cb4('0x47')],'where':{'id':_0x41ed40['body'][_0x6cb4('0x37')]}});})[_0x6cb4('0x17')](function(_0x237138){socket[_0x6cb4('0x48')](_0x6cb4('0x49'),{'id':Number(_0x41ed40['params']['id']),'tags':_0x237138||[]});return{'id':Number(_0x41ed40[_0x6cb4('0x26')]['id']),'tags':_0x237138||[]};});}})[_0x6cb4('0x17')](respondWithResult(_0x258327,null))[_0x6cb4('0x32')](handleError(_0x258327,null));};exports['removeTags']=function(_0x598e90,_0x3e2cf1){return db[_0x6cb4('0x20')][_0x6cb4('0x31')]({'where':{'id':_0x598e90[_0x6cb4('0x26')]['id']}})[_0x6cb4('0x17')](handleEntityNotFound(_0x3e2cf1,null))[_0x6cb4('0x17')](function(_0x5a2cba){if(_0x5a2cba){return _0x5a2cba['removeTags'](_0x598e90['query'][_0x6cb4('0x37')]);}})[_0x6cb4('0x17')](respondWithStatusCode(_0x3e2cf1,null))[_0x6cb4('0x32')](handleError(_0x3e2cf1,null));};exports[_0x6cb4('0x4a')]=function(_0x2b432a,_0x354095){var _0x1259f1=moment()[_0x6cb4('0x4b')]()['toString']();var _0x3263ba=path[_0x6cb4('0x4c')](config[_0x6cb4('0x4d')],'server','files',_0x6cb4('0x4e'));var _0x15e13f=path[_0x6cb4('0x4c')](config[_0x6cb4('0x4d')],_0x6cb4('0x4f'),_0x6cb4('0x50'),'attachments');var _0x4d7f52=path['join'](_0x3263ba,_0x1259f1);var _0x3ce9a3=util[_0x6cb4('0x43')](_0x6cb4('0x51'),_0x2b432a[_0x6cb4('0x26')]['id'],_0x1259f1);var _0x357163=path[_0x6cb4('0x4c')](_0x3263ba,_0x3ce9a3);var _0x3845b2=[];_0x3845b2[_0x6cb4('0x52')]({'model':db[_0x6cb4('0x53')],'as':'Attachment','raw':!![]});var _0x459429=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x6cb4('0x34'),_0x6cb4('0x54')],'include':_0x3845b2}];return db[_0x6cb4('0x20')]['find']({'where':{'id':_0x2b432a[_0x6cb4('0x26')]['id']},'include':_0x459429})['then'](handleEntityNotFound(_0x354095,null))[_0x6cb4('0x17')](function(_0x49d56b){if(_0x49d56b&&_0x49d56b[_0x6cb4('0x55')]){var _0x3838ad=_0x49d56b[_0x6cb4('0x56')]({'plain':!![]});fs[_0x6cb4('0x57')](_0x4d7f52);for(var _0x29d255=0x0;_0x29d255<_0x3838ad[_0x6cb4('0x55')][_0x6cb4('0x3a')];_0x29d255++){var _0x170506=_0x3838ad['Messages'][_0x29d255][_0x6cb4('0x53')];if(_0x170506){var _0x4628b8=path[_0x6cb4('0x4c')](_0x15e13f,_0x170506[_0x6cb4('0x58')]);if(fs['existsSync'](_0x4628b8)){fs[_0x6cb4('0x59')](_0x4628b8)[_0x6cb4('0x5a')](fs[_0x6cb4('0x5b')](path[_0x6cb4('0x4c')](_0x4d7f52,_0x170506['basename'])));}}}return BPromise[_0x6cb4('0x5c')]()[_0x6cb4('0x17')](function(){return new BPromise(function(_0x102be4,_0x49ef78){zipdir(_0x4d7f52,{'saveTo':_0x357163},function(_0x9bdde6,_0x10db91){if(_0x9bdde6)return _0x49ef78(_0x9bdde6);return _0x102be4(_0x10db91);});})[_0x6cb4('0x17')](function(){return new BPromise(function(_0x399db9,_0x428899){rimraf(_0x4d7f52,function(_0x9c64e3){if(_0x9c64e3)_0x428899(_0x9c64e3);return _0x399db9();});});})[_0x6cb4('0x17')](function(){return _0x354095[_0x6cb4('0x4a')](_0x357163,_0x3ce9a3,function(_0x1bb752){if(_0x1bb752){console[_0x6cb4('0x5d')](_0x6cb4('0x5e'),_0x1bb752);}else{fs['unlinkSync'](_0x357163);}});});});}else{return _0x354095[_0x6cb4('0xf')](0xc8);}})['catch'](handleError(_0x354095,null));}; \ No newline at end of file +var _0xe6bc=['mkdirSync','existsSync','createReadStream','pipe','basename','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','then','destroy','end','stack','name','send','index','fieldName','type','key','findAll','fax','query','user','catch','keys','FaxInteraction','intersection','model','attributes','fields','includeAll','include','merge','create','body','update','find','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','rawAttributes','filters','length','nolimit','order','sort','where','pick','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','omit','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','push','Attachment','Messages','createdAt','get'];(function(_0x3851b8,_0x39c673){var _0x316205=function(_0x33eeb0){while(--_0x33eeb0){_0x3851b8['push'](_0x3851b8['shift']());}};_0x316205(++_0x39c673);}(_0xe6bc,0x144));var _0xce6b=function(_0x6eab88,_0x197c24){_0x6eab88=_0x6eab88-0x0;var _0x46be95=_0xe6bc[_0x6eab88];return _0x46be95;};'use strict';var rimraf=require(_0xce6b('0x0'));var zipdir=require(_0xce6b('0x1'));var moment=require(_0xce6b('0x2'));var BPromise=require(_0xce6b('0x3'));var util=require(_0xce6b('0x4'));var path=require(_0xce6b('0x5'));var fs=require('fs');var _=require(_0xce6b('0x6'));var Redis=require(_0xce6b('0x7'));var interaction=require(_0xce6b('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xce6b('0x9'))(_0xce6b('0xa'));var config=require(_0xce6b('0xb'));var db=require('../../mysqldb')['db'];config[_0xce6b('0xc')]=_[_0xce6b('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xce6b('0xe'))(new Redis(config[_0xce6b('0xc')]));require(_0xce6b('0xf'))[_0xce6b('0x10')](socket);function respondWithStatusCode(_0x2cd6d7,_0xb65a19){_0xb65a19=_0xb65a19||0xcc;return function(_0x5afdb0){if(_0x5afdb0){return _0x2cd6d7[_0xce6b('0x11')](_0xb65a19);}return _0x2cd6d7[_0xce6b('0x12')](_0xb65a19)['end']();};}function respondWithResult(_0x514532,_0x226cc8){_0x226cc8=_0x226cc8||0xc8;return function(_0x294ad9){if(_0x294ad9){return _0x514532[_0xce6b('0x12')](_0x226cc8)[_0xce6b('0x13')](_0x294ad9);}};}function respondWithFilteredResult(_0x2b5d7e,_0x3d0289){return function(_0x41f8ea){if(_0x41f8ea){var _0x14e525=typeof _0x3d0289['offset']===_0xce6b('0x14')&&typeof _0x3d0289[_0xce6b('0x15')]===_0xce6b('0x14');var _0x4fe0c5=_0x41f8ea['count'];var _0x116c6c=_0x14e525?0x0:_0x3d0289[_0xce6b('0x16')];var _0x509091=_0x14e525?_0x41f8ea[_0xce6b('0x17')]:_0x3d0289[_0xce6b('0x16')]+_0x3d0289['limit'];var _0x4abf09;if(_0x509091>=_0x4fe0c5){_0x509091=_0x4fe0c5;_0x4abf09=0xc8;}else{_0x4abf09=0xce;}_0x2b5d7e[_0xce6b('0x12')](_0x4abf09);return _0x2b5d7e[_0xce6b('0x18')](_0xce6b('0x19'),_0x116c6c+'-'+_0x509091+'/'+_0x4fe0c5)['json'](_0x41f8ea);}return null;};}function saveUpdates(_0x2bb7b2){return function(_0x12dd4d){if(_0x12dd4d){return _0x12dd4d['update'](_0x2bb7b2)[_0xce6b('0x1a')](function(_0x3d1dc3){return _0x3d1dc3;});}return null;};}function removeEntity(_0x3c2991){return function(_0x56dcd4){if(_0x56dcd4){return _0x56dcd4[_0xce6b('0x1b')]()[_0xce6b('0x1a')](function(){_0x3c2991[_0xce6b('0x12')](0xcc)[_0xce6b('0x1c')]();});}};}function handleEntityNotFound(_0x3ce561){return function(_0x295756){if(!_0x295756){_0x3ce561['sendStatus'](0x194);}return _0x295756;};}function handleError(_0x3419e8,_0x59a0bb){_0x59a0bb=_0x59a0bb||0x1f4;return function(_0x27143d){logger['error'](_0x27143d[_0xce6b('0x1d')]);if(_0x27143d[_0xce6b('0x1e')]){delete _0x27143d[_0xce6b('0x1e')];}_0x3419e8[_0xce6b('0x12')](_0x59a0bb)[_0xce6b('0x1f')](_0x27143d);};}exports[_0xce6b('0x20')]=function(_0x57c072,_0x5b9c65){var _0x1421f1={};var _0x26edf5=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x1ea774){return{'name':_0x1ea774[_0xce6b('0x21')],'type':_0x1ea774[_0xce6b('0x22')][_0xce6b('0x23')]};});_0x1421f1=qs['getOptions'](_0x26edf5,_0x57c072);return interaction[_0xce6b('0x24')](_0xce6b('0x25'),_0x57c072[_0xce6b('0x26')],_0x57c072[_0xce6b('0x27')],_0x1421f1,_0x26edf5)[_0xce6b('0x1a')](respondWithFilteredResult(_0x5b9c65,_0x1421f1))[_0xce6b('0x28')](handleError(_0x5b9c65,null));};exports['show']=function(_0x87e28a,_0x385dbd){var _0x202fd2={'raw':![],'where':{'id':_0x87e28a['params']['id']}},_0x51876f={};_0x51876f['model']=_[_0xce6b('0x29')](db[_0xce6b('0x2a')]['rawAttributes']);_0x51876f['query']=_[_0xce6b('0x29')](_0x87e28a[_0xce6b('0x26')]);_0x51876f['filters']=_[_0xce6b('0x2b')](_0x51876f[_0xce6b('0x2c')],_0x51876f[_0xce6b('0x26')]);_0x202fd2[_0xce6b('0x2d')]=_[_0xce6b('0x2b')](_0x51876f[_0xce6b('0x2c')],qs[_0xce6b('0x2e')](_0x87e28a[_0xce6b('0x26')][_0xce6b('0x2e')]));_0x202fd2['attributes']=_0x202fd2['attributes']['length']?_0x202fd2[_0xce6b('0x2d')]:_0x51876f[_0xce6b('0x2c')];if(_0x87e28a[_0xce6b('0x26')][_0xce6b('0x2f')]){_0x202fd2[_0xce6b('0x30')]=[{'all':!![]}];}_0x202fd2=_[_0xce6b('0x31')]({},_0x202fd2,_0x87e28a['options']);return db['FaxInteraction']['find'](_0x202fd2)[_0xce6b('0x1a')](handleEntityNotFound(_0x385dbd,null))[_0xce6b('0x1a')](respondWithResult(_0x385dbd,null))[_0xce6b('0x28')](handleError(_0x385dbd,null));};exports[_0xce6b('0x32')]=function(_0x59f07b,_0x148a57){return db['FaxInteraction']['create'](_0x59f07b[_0xce6b('0x33')],{})[_0xce6b('0x1a')](respondWithResult(_0x148a57,0xc9))[_0xce6b('0x28')](handleError(_0x148a57,null));};exports[_0xce6b('0x34')]=function(_0x27d0ed,_0x553f23){if(_0x27d0ed['body']['id']){delete _0x27d0ed[_0xce6b('0x33')]['id'];}return db[_0xce6b('0x2a')][_0xce6b('0x35')]({'where':{'id':_0x27d0ed[_0xce6b('0x36')]['id']}})[_0xce6b('0x1a')](handleEntityNotFound(_0x553f23,null))['then'](saveUpdates(_0x27d0ed[_0xce6b('0x33')],null))[_0xce6b('0x1a')](respondWithResult(_0x553f23,null))[_0xce6b('0x28')](handleError(_0x553f23,null));};exports[_0xce6b('0x1b')]=function(_0x374674,_0x12ab51){return db[_0xce6b('0x2a')]['find']({'where':{'id':_0x374674[_0xce6b('0x36')]['id']}})[_0xce6b('0x1a')](handleEntityNotFound(_0x12ab51,null))['then'](removeEntity(_0x12ab51,null))[_0xce6b('0x28')](handleError(_0x12ab51,null));};exports['describe']=function(_0x2f5269,_0x19c426){return db[_0xce6b('0x2a')][_0xce6b('0x37')]()['then'](respondWithResult(_0x19c426,null))['catch'](handleError(_0x19c426,null));};exports[_0xce6b('0x38')]=function(_0x374380,_0x3f07ad){return db[_0xce6b('0x39')][_0xce6b('0x35')]({'where':{'id':_0x374380['params']['id']}})[_0xce6b('0x1a')](handleEntityNotFound(_0x3f07ad,null))['then'](function(_0x5db5ce){if(_0x5db5ce){return _0x5db5ce[_0xce6b('0x38')](_0x374380['body'][_0xce6b('0x3a')],_['omit'](_0x374380['body'],[_0xce6b('0x3a'),'id'])||{});}})[_0xce6b('0x1a')](respondWithResult(_0x3f07ad,null))[_0xce6b('0x28')](handleError(_0x3f07ad,null));};exports[_0xce6b('0x3b')]=function(_0x267594,_0x5d2e19){var _0x18d806={'raw':![],'where':{}};var _0x38d34f={};var _0x3ea462={'count':0x0,'rows':[]};return db[_0xce6b('0x2a')][_0xce6b('0x3c')]({'where':{'id':_0x267594[_0xce6b('0x36')]['id']}})[_0xce6b('0x1a')](handleEntityNotFound(_0x5d2e19,null))['then'](function(_0xe50989){if(_0xe50989){_0x38d34f['model']=_[_0xce6b('0x29')](db['FaxMessage'][_0xce6b('0x3d')]);_0x38d34f['query']=_[_0xce6b('0x29')](_0x267594[_0xce6b('0x26')]);_0x38d34f[_0xce6b('0x3e')]=_[_0xce6b('0x2b')](_0x38d34f[_0xce6b('0x2c')],_0x38d34f[_0xce6b('0x26')]);_0x18d806[_0xce6b('0x2d')]=_[_0xce6b('0x2b')](_0x38d34f[_0xce6b('0x2c')],qs[_0xce6b('0x2e')](_0x267594['query'][_0xce6b('0x2e')]));_0x18d806[_0xce6b('0x2d')]=_0x18d806[_0xce6b('0x2d')][_0xce6b('0x3f')]?_0x18d806[_0xce6b('0x2d')]:_0x38d34f[_0xce6b('0x2c')];if(!_0x267594['query']['hasOwnProperty'](_0xce6b('0x40'))){_0x18d806[_0xce6b('0x15')]=qs['limit'](_0x267594[_0xce6b('0x26')][_0xce6b('0x15')]);_0x18d806['offset']=qs['offset'](_0x267594[_0xce6b('0x26')][_0xce6b('0x16')]);}_0x18d806[_0xce6b('0x41')]=qs[_0xce6b('0x42')](_0x267594[_0xce6b('0x26')][_0xce6b('0x42')]);_0x18d806[_0xce6b('0x43')]=qs[_0xce6b('0x3e')](_[_0xce6b('0x44')](_0x267594[_0xce6b('0x26')],_0x38d34f[_0xce6b('0x3e')]));_0x18d806[_0xce6b('0x43')]['FaxInteractionId']=_0xe50989['id'];if(_0x267594[_0xce6b('0x26')]['filter']){_0x18d806['where']=_['merge'](_0x18d806[_0xce6b('0x43')],{'$or':_[_0xce6b('0x45')](_0x18d806[_0xce6b('0x2d')],function(_0x1bdda9){var _0x1442e0={};_0x1442e0[_0x1bdda9]={'$like':'%'+_0x267594[_0xce6b('0x26')]['filter']+'%'};return _0x1442e0;})});}if(_0x267594[_0xce6b('0x26')]['$gte']){var _0x43f42e=_0x267594['query'][_0xce6b('0x46')][_0xce6b('0x47')](',');var _0x75571c={};_0x75571c[_0x43f42e[0x0]]={'$gte':moment(_0x43f42e[0x1])[_0xce6b('0x48')](_0xce6b('0x49'))};_0x18d806[_0xce6b('0x43')]=_[_0xce6b('0x31')](_0x18d806[_0xce6b('0x43')],_0x75571c);}_0x18d806=_[_0xce6b('0x31')]({},_0x18d806,_0x267594[_0xce6b('0x4a')]);return db[_0xce6b('0x39')][_0xce6b('0x17')]({'where':_0x18d806[_0xce6b('0x43')]})['then'](function(_0xf367d0){_0x3ea462['count']=_0xf367d0;if(_0x267594[_0xce6b('0x26')]['includeAll']){_0x18d806[_0xce6b('0x30')]=[{'all':!![]}];}return db[_0xce6b('0x39')]['findAll'](_0x18d806);})[_0xce6b('0x1a')](function(_0x2424bc){_0x3ea462['rows']=_0x2424bc;return _0x3ea462;});}})[_0xce6b('0x1a')](respondWithFilteredResult(_0x5d2e19,_0x18d806))[_0xce6b('0x28')](handleError(_0x5d2e19,null));};exports[_0xce6b('0x4b')]=function(_0x19607d,_0x33e133){return db[_0xce6b('0x2a')][_0xce6b('0x35')]({'where':{'id':_0x19607d['params']['id']}})[_0xce6b('0x1a')](handleEntityNotFound(_0x33e133,null))[_0xce6b('0x1a')](function(_0x2958bf){if(_0x2958bf){return _0x2958bf[_0xce6b('0x4c')](_0x19607d[_0xce6b('0x33')][_0xce6b('0x3a')],_[_0xce6b('0x4d')](_0x19607d[_0xce6b('0x33')],[_0xce6b('0x3a'),'id'])||{})[_0xce6b('0x4e')](function(){return db['Tag'][_0xce6b('0x24')]({'attributes':['id',_0xce6b('0x1e'),_0xce6b('0x4f')],'where':{'id':_0x19607d[_0xce6b('0x33')][_0xce6b('0x3a')]}});})['then'](function(_0x4a32b3){socket[_0xce6b('0x50')](_0xce6b('0x51'),{'id':Number(_0x19607d[_0xce6b('0x36')]['id']),'tags':_0x4a32b3||[]});return{'id':Number(_0x19607d[_0xce6b('0x36')]['id']),'tags':_0x4a32b3||[]};});}})[_0xce6b('0x1a')](respondWithResult(_0x33e133,null))['catch'](handleError(_0x33e133,null));};exports[_0xce6b('0x52')]=function(_0x448a58,_0x1b004b){return db[_0xce6b('0x2a')][_0xce6b('0x35')]({'where':{'id':_0x448a58[_0xce6b('0x36')]['id']}})['then'](handleEntityNotFound(_0x1b004b,null))[_0xce6b('0x1a')](function(_0x5c5619){if(_0x5c5619){return _0x5c5619[_0xce6b('0x52')](_0x448a58[_0xce6b('0x26')][_0xce6b('0x3a')]);}})[_0xce6b('0x1a')](respondWithStatusCode(_0x1b004b,null))[_0xce6b('0x28')](handleError(_0x1b004b,null));};exports[_0xce6b('0x53')]=function(_0x3774ce,_0x12d933){var _0x3962da=moment()[_0xce6b('0x54')]()[_0xce6b('0x55')]();var _0x2e1d0a=path[_0xce6b('0x56')](config[_0xce6b('0x57')],_0xce6b('0x58'),_0xce6b('0x59'),'tmp');var _0x490912=path[_0xce6b('0x56')](config[_0xce6b('0x57')],_0xce6b('0x58'),_0xce6b('0x59'),_0xce6b('0x5a'));var _0xb9d2c2=path[_0xce6b('0x56')](_0x2e1d0a,_0x3962da);var _0x336111=util[_0xce6b('0x48')]('transcript-%d-%s.zip',_0x3774ce[_0xce6b('0x36')]['id'],_0x3962da);var _0x485801=path[_0xce6b('0x56')](_0x2e1d0a,_0x336111);var _0x2eede8=[];_0x2eede8[_0xce6b('0x5b')]({'model':db[_0xce6b('0x5c')],'as':_0xce6b('0x5c'),'raw':!![]});var _0x2674ac=[{'model':db[_0xce6b('0x39')],'as':_0xce6b('0x5d'),'attributes':['id',_0xce6b('0x33'),_0xce6b('0x5e')],'include':_0x2eede8}];return db[_0xce6b('0x2a')][_0xce6b('0x35')]({'where':{'id':_0x3774ce[_0xce6b('0x36')]['id']},'include':_0x2674ac})[_0xce6b('0x1a')](handleEntityNotFound(_0x12d933,null))['then'](function(_0x37c7d9){if(_0x37c7d9&&_0x37c7d9['Messages']){var _0x2e79fc=_0x37c7d9[_0xce6b('0x5f')]({'plain':!![]});fs[_0xce6b('0x60')](_0xb9d2c2);for(var _0x115a5e=0x0;_0x115a5e<_0x2e79fc[_0xce6b('0x5d')]['length'];_0x115a5e++){var _0x37d28f=_0x2e79fc[_0xce6b('0x5d')][_0x115a5e]['Attachment'];if(_0x37d28f){var _0x4c881e=path[_0xce6b('0x56')](_0x490912,_0x37d28f['basename']);if(fs[_0xce6b('0x61')](_0x4c881e)){fs[_0xce6b('0x62')](_0x4c881e)[_0xce6b('0x63')](fs['createWriteStream'](path[_0xce6b('0x56')](_0xb9d2c2,_0x37d28f[_0xce6b('0x64')])));}}}return BPromise[_0xce6b('0x65')]()['then'](function(){return new BPromise(function(_0x310b4f,_0x3fc949){zipdir(_0xb9d2c2,{'saveTo':_0x485801},function(_0x152b9a,_0x49aecb){if(_0x152b9a)return _0x3fc949(_0x152b9a);return _0x310b4f(_0x49aecb);});})['then'](function(){return new BPromise(function(_0xeb9036,_0xd1261b){rimraf(_0xb9d2c2,function(_0x690866){if(_0x690866)_0xd1261b(_0x690866);return _0xeb9036();});});})[_0xce6b('0x1a')](function(){return _0x12d933[_0xce6b('0x53')](_0x485801,_0x336111,function(_0x2824f7){if(_0x2824f7){console[_0xce6b('0x66')](_0xce6b('0x67'),_0x2824f7);}else{fs[_0xce6b('0x68')](_0x485801);}});});});}else{return _0x12d933[_0xce6b('0x11')](0xc8);}})['catch'](handleError(_0x12d933,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 13dbbe5..56bcda7 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 _0x7a6c=['../../mysqldb','FaxMessage','setMaxListeners','save','update','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a6c,0xf0));var _0xc7a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a6c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xc7a6('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0xc7a6('0x0'))['db'][_0xc7a6('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc7a6('0x2')](0x0);var events={'afterCreate':_0xc7a6('0x3'),'afterUpdate':_0xc7a6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d1266){return function(_0x5360b1,_0x4ebe0f,_0x14a164){_0x5360b1['getUsers']({'attributes':['id'],'raw':!![]})[_0xc7a6('0x5')](function(_0x185ea2){_0x5360b1[_0xc7a6('0x6')](_0xc7a6('0x7'),_0x185ea2[_0xc7a6('0x8')](function(_0x56a583){return{'id':_0x56a583['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5360b1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc7a6('0x5')](function(_0x57e43a){_0x5360b1[_0xc7a6('0x6')](_0xc7a6('0x9'),_0x57e43a[_0xc7a6('0xa')]);FaxInteractionEvents[_0xc7a6('0xb')](_0x3d1266+':'+_0x5360b1['id'],_0x5360b1);FaxInteractionEvents[_0xc7a6('0xb')](_0x3d1266,_0x5360b1);_0x14a164(null);})[_0xc7a6('0xc')](_0x14a164(null));};}for(var e in events){if(events[_0xc7a6('0xd')](e)){var event=events[e];FaxInteraction[_0xc7a6('0xe')](e,emitEvent(event));}}module[_0xc7a6('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x07ca=['then','setDataValue','emit','exports','events','FaxInteraction','FaxMessage','update','remove','getUsers'];(function(_0x36347f,_0x3541c3){var _0x3ebf7e=function(_0x32987f){while(--_0x32987f){_0x36347f['push'](_0x36347f['shift']());}};_0x3ebf7e(++_0x3541c3);}(_0x07ca,0xf4));var _0xa07c=function(_0x1394a2,_0x533264){_0x1394a2=_0x1394a2-0x0;var _0x31dcd1=_0x07ca[_0x1394a2];return _0x31dcd1;};'use strict';var EventEmitter=require(_0xa07c('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xa07c('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xa07c('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa07c('0x3'),'afterDestroy':_0xa07c('0x4')};function emitEvent(_0xef6e66){return function(_0x1e9255,_0x522f81,_0xe9c901){_0x1e9255[_0xa07c('0x5')]({'attributes':['id'],'raw':!![]})[_0xa07c('0x6')](function(_0x5c3819){_0x1e9255[_0xa07c('0x7')]('Users',_0x5c3819['map'](function(_0x57b160){return{'id':_0x57b160['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1e9255['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa07c('0x6')](function(_0x150f83){_0x1e9255[_0xa07c('0x7')]('unreadMessages',_0x150f83['length']);FaxInteractionEvents[_0xa07c('0x8')](_0xef6e66+':'+_0x1e9255['id'],_0x1e9255);FaxInteractionEvents[_0xa07c('0x8')](_0xef6e66,_0x1e9255);_0xe9c901(null);})['catch'](_0xe9c901(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xa07c('0x9')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 19c956c..9c99d76 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 _0x6e9b=['moment','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x23b022,_0x4bcbf8){var _0x132019=function(_0x431f86){while(--_0x431f86){_0x23b022['push'](_0x23b022['shift']());}};_0x132019(++_0x4bcbf8);}(_0x6e9b,0xea));var _0xb6e9=function(_0x14d4bb,_0x6714f6){_0x14d4bb=_0x14d4bb-0x0;var _0x3c3892=_0x6e9b[_0x14d4bb];return _0x3c3892;};'use strict';var _=require(_0xb6e9('0x0'));var util=require(_0xb6e9('0x1'));var logger=require(_0xb6e9('0x2'))(_0xb6e9('0x3'));var moment=require(_0xb6e9('0x4'));var BPromise=require('bluebird');var rp=require(_0xb6e9('0x5'));var fs=require('fs');var path=require(_0xb6e9('0x6'));var rimraf=require(_0xb6e9('0x7'));var config=require('../../config/environment');var attributes=require(_0xb6e9('0x8'));module[_0xb6e9('0x9')]=function(_0x2bdfb8,_0x6b0286){return _0x2bdfb8[_0xb6e9('0xa')](_0xb6e9('0xb'),attributes,{'tableName':_0xb6e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5967ba,_0x20ba2a,_0x178923){if(_0x5967ba[_0xb6e9('0xd')](_0xb6e9('0xe'))){_0x5967ba[_0xb6e9('0xf')]=moment()['format'](_0xb6e9('0x10'));}_0x178923(null,_0x5967ba);}}});}; \ No newline at end of file +var _0xd28f=['../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','bluebird','path','rimraf'];(function(_0x332344,_0x421595){var _0x31b996=function(_0x29e216){while(--_0x29e216){_0x332344['push'](_0x332344['shift']());}};_0x31b996(++_0x421595);}(_0xd28f,0x134));var _0xfd28=function(_0x5d0b46,_0x4f38cb){_0x5d0b46=_0x5d0b46-0x0;var _0x4f7482=_0xd28f[_0x5d0b46];return _0x4f7482;};'use strict';var _=require('lodash');var util=require(_0xfd28('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfd28('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd28('0x2'));var rimraf=require(_0xfd28('0x3'));var config=require(_0xfd28('0x4'));var attributes=require(_0xfd28('0x5'));module['exports']=function(_0x2738a,_0x272b78){return _0x2738a[_0xfd28('0x6')](_0xfd28('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x516315,_0x3b7c06,_0x2b62b0){if(_0x516315[_0xfd28('0x8')](_0xfd28('0x9'))){_0x516315[_0xfd28('0xa')]=moment()['format'](_0xfd28('0xb'));}_0x2b62b0(null,_0x516315);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index bd2f24d..43eb0c8 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 _0xc5a2=['attributes','limit','then','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','catch','UpdateFaxInteraction','update','options','raw','where'];(function(_0x47a3b3,_0x1e4a09){var _0x48c025=function(_0xa9b624){while(--_0xa9b624){_0x47a3b3['push'](_0x47a3b3['shift']());}};_0x48c025(++_0x1e4a09);}(_0xc5a2,0x149));var _0x2c5a=function(_0x179d55,_0x40b561){_0x179d55=_0x179d55-0x0;var _0x269794=_0xc5a2[_0x179d55];return _0x269794;};'use strict';var _=require(_0x2c5a('0x0'));var util=require('util');var moment=require(_0x2c5a('0x1'));var BPromise=require(_0x2c5a('0x2'));var rs=require(_0x2c5a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c5a('0x4'))['db'];var utils=require(_0x2c5a('0x5'));var logger=require('../../config/logger')(_0x2c5a('0x6'));var config=require(_0x2c5a('0x7'));var jayson=require(_0x2c5a('0x8'));var client=jayson[_0x2c5a('0x9')][_0x2c5a('0xa')]({'port':0x232a});config[_0x2c5a('0xb')]=_[_0x2c5a('0xc')](config[_0x2c5a('0xb')],{'host':_0x2c5a('0xd'),'port':0x18eb});var socket=require(_0x2c5a('0xe'))(new Redis(config[_0x2c5a('0xb')]));require('./faxInteraction.socket')[_0x2c5a('0xf')](socket);function respondWithRpcPromise(_0x33bef0,_0x301744,_0x58b8d0){return new BPromise(function(_0x4c0d25,_0x13274b){return client[_0x2c5a('0x10')](_0x33bef0,_0x58b8d0)['then'](function(_0x239a13){logger[_0x2c5a('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x301744,_0x2c5a('0x12'));logger[_0x2c5a('0x13')](_0x2c5a('0x14'),_0x301744,'request\x20sent',JSON[_0x2c5a('0x15')](_0x239a13));if(_0x239a13[_0x2c5a('0x16')]){if(_0x239a13['error']['code']===0x1f4){logger['error'](_0x2c5a('0x17'),_0x301744,_0x239a13[_0x2c5a('0x16')][_0x2c5a('0x18')]);return _0x13274b(_0x239a13[_0x2c5a('0x16')][_0x2c5a('0x18')]);}logger[_0x2c5a('0x16')](_0x2c5a('0x17'),_0x301744,_0x239a13[_0x2c5a('0x16')][_0x2c5a('0x18')]);return _0x4c0d25(_0x239a13[_0x2c5a('0x16')]['message']);}else{logger[_0x2c5a('0x11')](_0x2c5a('0x17'),_0x301744,'request\x20sent');_0x4c0d25(_0x239a13['result'][_0x2c5a('0x18')]);}})[_0x2c5a('0x19')](function(_0x1a901d){logger[_0x2c5a('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x301744,_0x1a901d);_0x13274b(_0x1a901d);});});}exports[_0x2c5a('0x1a')]=function(_0x5ca5de){var _0x324882=this;return new Promise(function(_0x472146,_0x1fde55){return db['FaxInteraction'][_0x2c5a('0x1b')](_0x5ca5de['body'],{'raw':_0x5ca5de['options']?_0x5ca5de[_0x2c5a('0x1c')][_0x2c5a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ca5de[_0x2c5a('0x1c')]?_0x5ca5de[_0x2c5a('0x1c')][_0x2c5a('0x1e')]||null:null,'attributes':_0x5ca5de[_0x2c5a('0x1c')]?_0x5ca5de[_0x2c5a('0x1c')][_0x2c5a('0x1f')]||null:null,'limit':_0x5ca5de[_0x2c5a('0x1c')]?_0x5ca5de['options'][_0x2c5a('0x20')]||null:null})[_0x2c5a('0x21')](function(_0x58a3af){logger[_0x2c5a('0x11')](_0x2c5a('0x1a'),_0x5ca5de);logger[_0x2c5a('0x13')]('UpdateFaxInteraction',_0x5ca5de,JSON['stringify'](_0x58a3af));_0x472146(_0x58a3af);})[_0x2c5a('0x19')](function(_0x7ec12f){logger[_0x2c5a('0x16')](_0x2c5a('0x1a'),_0x7ec12f['message'],_0x5ca5de);_0x1fde55(_0x324882[_0x2c5a('0x16')](0x1f4,_0x7ec12f[_0x2c5a('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x5c1deb){return new Promise(function(_0x1497f8,_0x384585){return db['FaxInteraction']['find']({'where':_0x5c1deb[_0x2c5a('0x1c')]?_0x5c1deb[_0x2c5a('0x1c')]['where']||null:null})[_0x2c5a('0x21')](function(_0x4b473c){if(_0x4b473c){return _0x4b473c[_0x2c5a('0x22')](_0x5c1deb[_0x2c5a('0x23')][_0x2c5a('0x24')],_[_0x2c5a('0x25')](_0x5c1deb[_0x2c5a('0x23')],['ids','id'])||{});}})[_0x2c5a('0x26')](function(_0x12dfdc){logger[_0x2c5a('0x11')]('AddTags',_0x5c1deb);logger[_0x2c5a('0x13')](_0x2c5a('0x27'),_0x5c1deb,JSON['stringify'](_0x12dfdc));_0x1497f8(_0x12dfdc);})[_0x2c5a('0x19')](function(_0x1107f9){logger[_0x2c5a('0x16')](_0x2c5a('0x27'),_0x1107f9['message'],_0x5c1deb);_0x384585(_this[_0x2c5a('0x16')](0x1f4,_0x1107f9[_0x2c5a('0x18')]));});});}; \ No newline at end of file +var _0xc665=['../../config/environment','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToFaxInteraction','find','omit','ids','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5b3aef,_0x1a585b){var _0x22f747=function(_0x4dd135){while(--_0x4dd135){_0x5b3aef['push'](_0x5b3aef['shift']());}};_0x22f747(++_0x1a585b);}(_0xc665,0x17f));var _0x5c66=function(_0x197755,_0x2827fa){_0x197755=_0x197755-0x0;var _0x4f5e0d=_0xc665[_0x197755];return _0x4f5e0d;};'use strict';var _=require(_0x5c66('0x0'));var util=require(_0x5c66('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c66('0x2'));var db=require(_0x5c66('0x3'))['db'];var utils=require(_0x5c66('0x4'));var logger=require(_0x5c66('0x5'))(_0x5c66('0x6'));var config=require(_0x5c66('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5c66('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5c66('0x9')],{'host':_0x5c66('0xa'),'port':0x18eb});var socket=require(_0x5c66('0xb'))(new Redis(config[_0x5c66('0x9')]));require(_0x5c66('0xc'))['register'](socket);function respondWithRpcPromise(_0x1e546e,_0xd7495,_0x430137){return new BPromise(function(_0x15d325,_0x4489de){return client[_0x5c66('0xd')](_0x1e546e,_0x430137)['then'](function(_0x3d3ada){logger[_0x5c66('0xe')](_0x5c66('0xf'),_0xd7495,_0x5c66('0x10'));logger[_0x5c66('0x11')](_0x5c66('0x12'),_0xd7495,_0x5c66('0x10'),JSON[_0x5c66('0x13')](_0x3d3ada));if(_0x3d3ada['error']){if(_0x3d3ada['error']['code']===0x1f4){logger[_0x5c66('0x14')]('FaxInteraction,\x20%s,\x20%s',_0xd7495,_0x3d3ada[_0x5c66('0x14')][_0x5c66('0x15')]);return _0x4489de(_0x3d3ada[_0x5c66('0x14')][_0x5c66('0x15')]);}logger['error'](_0x5c66('0xf'),_0xd7495,_0x3d3ada[_0x5c66('0x14')][_0x5c66('0x15')]);return _0x15d325(_0x3d3ada[_0x5c66('0x14')][_0x5c66('0x15')]);}else{logger[_0x5c66('0xe')](_0x5c66('0xf'),_0xd7495,'request\x20sent');_0x15d325(_0x3d3ada[_0x5c66('0x16')]['message']);}})[_0x5c66('0x17')](function(_0x2dcea2){logger['error'](_0x5c66('0xf'),_0xd7495,_0x2dcea2);_0x4489de(_0x2dcea2);});});}exports[_0x5c66('0x18')]=function(_0x2453d2){var _0x48b1d5=this;return new Promise(function(_0x2b234d,_0x2aa3a4){return db[_0x5c66('0x19')][_0x5c66('0x1a')](_0x2453d2[_0x5c66('0x1b')],{'raw':_0x2453d2[_0x5c66('0x1c')]?_0x2453d2[_0x5c66('0x1c')][_0x5c66('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2453d2[_0x5c66('0x1c')]?_0x2453d2['options'][_0x5c66('0x1e')]||null:null,'attributes':_0x2453d2[_0x5c66('0x1c')]?_0x2453d2[_0x5c66('0x1c')][_0x5c66('0x1f')]||null:null,'limit':_0x2453d2[_0x5c66('0x1c')]?_0x2453d2[_0x5c66('0x1c')][_0x5c66('0x20')]||null:null})[_0x5c66('0x21')](function(_0x95c4ee){logger[_0x5c66('0xe')](_0x5c66('0x18'),_0x2453d2);logger[_0x5c66('0x11')](_0x5c66('0x18'),_0x2453d2,JSON[_0x5c66('0x13')](_0x95c4ee));_0x2b234d(_0x95c4ee);})[_0x5c66('0x17')](function(_0x2ccadf){logger[_0x5c66('0x14')]('UpdateFaxInteraction',_0x2ccadf['message'],_0x2453d2);_0x2aa3a4(_0x48b1d5[_0x5c66('0x14')](0x1f4,_0x2ccadf[_0x5c66('0x15')]));});});};exports[_0x5c66('0x22')]=function(_0x44e144){return new Promise(function(_0x3e7ff2,_0x39b638){return db[_0x5c66('0x19')][_0x5c66('0x23')]({'where':_0x44e144[_0x5c66('0x1c')]?_0x44e144['options'][_0x5c66('0x1e')]||null:null})[_0x5c66('0x21')](function(_0x3e6417){if(_0x3e6417){return _0x3e6417['addTags'](_0x44e144[_0x5c66('0x1b')]['ids'],_[_0x5c66('0x24')](_0x44e144[_0x5c66('0x1b')],[_0x5c66('0x25'),'id'])||{});}})['spread'](function(_0x1c9ef1){logger[_0x5c66('0xe')]('AddTags',_0x44e144);logger['debug'](_0x5c66('0x26'),_0x44e144,JSON[_0x5c66('0x13')](_0x1c9ef1));_0x3e7ff2(_0x1c9ef1);})[_0x5c66('0x17')](function(_0x4bd7f0){logger[_0x5c66('0x14')](_0x5c66('0x26'),_0x4bd7f0[_0x5c66('0x15')],_0x44e144);_0x39b638(_this[_0x5c66('0x14')](0x1f4,_0x4bd7f0[_0x5c66('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 770567a..24c49a8 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 _0x216f=['emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x216f,0x15b));var _0xf216=function(_0x32356b,_0x1cc27e){_0x32356b=_0x32356b-0x0;var _0x58161e=_0x216f[_0x32356b];return _0x58161e;};'use strict';var FaxInteractionEvents=require(_0xf216('0x0'));var events=[_0xf216('0x1'),_0xf216('0x2'),_0xf216('0x3')];function createListener(_0x139733,_0xc9a472){return function(_0x4df1e2){_0xc9a472[_0xf216('0x4')](_0x139733,_0x4df1e2);};}function removeListener(_0x526067,_0x591b02){return function(){FaxInteractionEvents[_0xf216('0x5')](_0x526067,_0x591b02);};}exports[_0xf216('0x6')]=function(_0x46cf6d){for(var _0x53305b=0x0,_0x326b6c=events[_0xf216('0x7')];_0x53305b<_0x326b6c;_0x53305b++){var _0x5eb614=events[_0x53305b];var _0x5e18c9=createListener(_0xf216('0x8')+_0x5eb614,_0x46cf6d);FaxInteractionEvents['on'](_0x5eb614,_0x5e18c9);}}; \ No newline at end of file +var _0x3360=['length','faxInteraction:','save','remove','update','emit','removeListener','register'];(function(_0xa28e77,_0x46d059){var _0x1e4824=function(_0x3c272b){while(--_0x3c272b){_0xa28e77['push'](_0xa28e77['shift']());}};_0x1e4824(++_0x46d059);}(_0x3360,0x122));var _0x0336=function(_0x4d022d,_0x4eaba1){_0x4d022d=_0x4d022d-0x0;var _0x3d9cd0=_0x3360[_0x4d022d];return _0x3d9cd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x0336('0x0'),_0x0336('0x1'),_0x0336('0x2')];function createListener(_0xf3773e,_0x3bf0e9){return function(_0x586961){_0x3bf0e9[_0x0336('0x3')](_0xf3773e,_0x586961);};}function removeListener(_0x172470,_0x37d9ae){return function(){FaxInteractionEvents[_0x0336('0x4')](_0x172470,_0x37d9ae);};}exports[_0x0336('0x5')]=function(_0x38a7d3){for(var _0x5c0d2a=0x0,_0x2757d2=events[_0x0336('0x6')];_0x5c0d2a<_0x2757d2;_0x5c0d2a++){var _0x1aa0c1=events[_0x5c0d2a];var _0x87c297=createListener(_0x0336('0x7')+_0x1aa0c1,_0x38a7d3);FaxInteractionEvents['on'](_0x1aa0c1,_0x87c297);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index a34b0b8..c71669c 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 _0x5deb=['/:id/tags','faxinteraction:addtags','addTags','put','update','delete','tracked','faxinteraction:destroy','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x2ed020,_0x4f8bf4){var _0x54ef12=function(_0x42cdcd){while(--_0x42cdcd){_0x2ed020['push'](_0x2ed020['shift']());}};_0x54ef12(++_0x4f8bf4);}(_0x5deb,0x82));var _0xb5de=function(_0x413b13,_0x4a25de){_0x413b13=_0x413b13-0x0;var _0x1cad2e=_0x5deb[_0x413b13];return _0x1cad2e;};'use strict';var multer=require(_0xb5de('0x0'));var util=require(_0xb5de('0x1'));var path=require('path');var timeout=require(_0xb5de('0x2'));var express=require('express');var router=express[_0xb5de('0x3')]();var fs_extra=require(_0xb5de('0x4'));var auth=require(_0xb5de('0x5'));var interaction=require(_0xb5de('0x6'));var config=require(_0xb5de('0x7'));var controller=require('./faxInteraction.controller');router[_0xb5de('0x8')]('/',auth[_0xb5de('0x9')](),controller[_0xb5de('0xa')]);router[_0xb5de('0x8')](_0xb5de('0xb'),auth['isAuthenticated'](),controller[_0xb5de('0xc')]);router[_0xb5de('0x8')](_0xb5de('0xd'),auth[_0xb5de('0x9')](),controller['show']);router[_0xb5de('0x8')](_0xb5de('0xe'),auth[_0xb5de('0x9')](),controller[_0xb5de('0xf')]);router['get'](_0xb5de('0x10'),auth[_0xb5de('0x9')](),controller[_0xb5de('0x11')]);router[_0xb5de('0x12')]('/',auth[_0xb5de('0x9')](),controller[_0xb5de('0x13')]);router[_0xb5de('0x12')](_0xb5de('0xe'),auth['isAuthenticated'](),controller['addMessage']);router[_0xb5de('0x12')](_0xb5de('0x14'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xb5de('0x15')),controller[_0xb5de('0x16')]);router[_0xb5de('0x17')](_0xb5de('0xd'),auth[_0xb5de('0x9')](),interaction['tracked']('fax','faxinteraction:update'),controller[_0xb5de('0x18')]);router[_0xb5de('0x19')](_0xb5de('0xd'),auth[_0xb5de('0x9')](),interaction[_0xb5de('0x1a')]('fax',_0xb5de('0x1b')),controller['destroy']);router[_0xb5de('0x19')](_0xb5de('0x14'),auth['isAuthenticated'](),controller[_0xb5de('0x1c')]);module[_0xb5de('0x1d')]=router; \ No newline at end of file +var _0x4536=['removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy'];(function(_0x1728fb,_0x4e8a13){var _0x38392b=function(_0x19e5b1){while(--_0x19e5b1){_0x1728fb['push'](_0x1728fb['shift']());}};_0x38392b(++_0x4e8a13);}(_0x4536,0xe9));var _0x6453=function(_0x34218c,_0x473c97){_0x34218c=_0x34218c-0x0;var _0x100583=_0x4536[_0x34218c];return _0x100583;};'use strict';var multer=require(_0x6453('0x0'));var util=require(_0x6453('0x1'));var path=require(_0x6453('0x2'));var timeout=require(_0x6453('0x3'));var express=require('express');var router=express[_0x6453('0x4')]();var fs_extra=require(_0x6453('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6453('0x6'));var config=require(_0x6453('0x7'));var controller=require(_0x6453('0x8'));router['get']('/',auth[_0x6453('0x9')](),controller[_0x6453('0xa')]);router['get'](_0x6453('0xb'),auth[_0x6453('0x9')](),controller['describe']);router[_0x6453('0xc')](_0x6453('0xd'),auth[_0x6453('0x9')](),controller[_0x6453('0xe')]);router[_0x6453('0xc')](_0x6453('0xf'),auth['isAuthenticated'](),controller[_0x6453('0x10')]);router[_0x6453('0xc')]('/:id/download',auth['isAuthenticated'](),controller[_0x6453('0x11')]);router[_0x6453('0x12')]('/',auth[_0x6453('0x9')](),controller[_0x6453('0x13')]);router[_0x6453('0x12')]('/:id/messages',auth[_0x6453('0x9')](),controller[_0x6453('0x14')]);router[_0x6453('0x12')](_0x6453('0x15'),auth[_0x6453('0x9')](),interaction[_0x6453('0x16')]('fax','faxinteraction:addtags'),controller[_0x6453('0x17')]);router[_0x6453('0x18')](_0x6453('0xd'),auth[_0x6453('0x9')](),interaction[_0x6453('0x16')](_0x6453('0x19'),_0x6453('0x1a')),controller[_0x6453('0x1b')]);router[_0x6453('0x1c')]('/:id',auth[_0x6453('0x9')](),interaction[_0x6453('0x16')](_0x6453('0x19'),_0x6453('0x1d')),controller[_0x6453('0x1e')]);router[_0x6453('0x1c')](_0x6453('0x15'),auth['isAuthenticated'](),controller[_0x6453('0x1f')]);module[_0x6453('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index e8c4373..fd8c86b 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 _0x861c=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x336b88,_0x4be3ff){var _0x16149d=function(_0x506044){while(--_0x506044){_0x336b88['push'](_0x336b88['shift']());}};_0x16149d(++_0x4be3ff);}(_0x861c,0xdb));var _0xc861=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x861c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc861('0x0'));module[_0xc861('0x1')]={'body':{'type':Sequelize[_0xc861('0x2')](_0xc861('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc861('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc861('0x5')]('in',_0xc861('0x6')),'defaultValue':_0xc861('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xc861('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xc861('0x7')]}}; \ No newline at end of file +var _0xcb99=['TEXT','ENUM','out','DATE','sequelize'];(function(_0x1a0722,_0xa92168){var _0x2bfbd2=function(_0x3a1806){while(--_0x3a1806){_0x1a0722['push'](_0x1a0722['shift']());}};_0x2bfbd2(++_0xa92168);}(_0xcb99,0x8b));var _0x9cb9=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0xcb99[_0x459b74];return _0x46cb16;};'use strict';var Sequelize=require(_0x9cb9('0x0'));module['exports']={'body':{'type':Sequelize[_0x9cb9('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9cb9('0x2')]('in',_0x9cb9('0x3')),'defaultValue':_0x9cb9('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x9cb9('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 036a449..5d7a1b1 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 _0x0fba=['channel','motionChannel','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','fullname','SIP/%s','event','rejectmessage','CmContact','findOne','isNil','Attachment','SendFax','FaxAccountId','basename','join','root','files','attachments','download','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','findAll','rows','show','params','body','find','describe','fax-interactions','fax','read','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface'];(function(_0xa9c40,_0x422ca6){var _0x1cacc6=function(_0x42fb7c){while(--_0x42fb7c){_0xa9c40['push'](_0xa9c40['shift']());}};_0x1cacc6(++_0x422ca6);}(_0x0fba,0x1ca));var _0xa0fb=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x0fba[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0xa0fb('0x0'));var rimraf=require(_0xa0fb('0x1'));var zipdir=require(_0xa0fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa0fb('0x3'));var BPromise=require(_0xa0fb('0x4'));var Mustache=require('mustache');var util=require(_0xa0fb('0x5'));var path=require(_0xa0fb('0x6'));var sox=require('sox');var csv=require(_0xa0fb('0x7'));var ejs=require(_0xa0fb('0x8'));var fs=require('fs');var fs_extra=require(_0xa0fb('0x9'));var _=require(_0xa0fb('0xa'));var squel=require(_0xa0fb('0xb'));var crypto=require(_0xa0fb('0xc'));var jsforce=require(_0xa0fb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa0fb('0xe'));var Papa=require(_0xa0fb('0xf'));var Redis=require('ioredis');var authService=require(_0xa0fb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa0fb('0x11'));var hardwareService=require(_0xa0fb('0x12'));var logger=require(_0xa0fb('0x13'))('api');var utils=require(_0xa0fb('0x14'));var config=require(_0xa0fb('0x15'));var licenseUtil=require(_0xa0fb('0x16'));var db=require(_0xa0fb('0x17'))['db'];config[_0xa0fb('0x18')]=_[_0xa0fb('0x19')](config[_0xa0fb('0x18')],{'host':_0xa0fb('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0fb('0x18')]));require(_0xa0fb('0x1b'))[_0xa0fb('0x1c')](socket);var jayson=require(_0xa0fb('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xa0fb('0x1e')][_0xa0fb('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x13c331,_0x474593,_0x1cf3f8,_0xc73ff1){return new BPromise(function(_0x5306af,_0x1ffd9a){var _0x4b452c=_0xc73ff1||client;return _0x4b452c[_0xa0fb('0x20')](_0x13c331,_0x1cf3f8)[_0xa0fb('0x21')](function(_0x14a0a1){logger[_0xa0fb('0x22')](_0xa0fb('0x23'),_0x474593,_0xa0fb('0x24'));logger[_0xa0fb('0x25')](_0xa0fb('0x26'),_0x474593,_0xa0fb('0x24'),JSON[_0xa0fb('0x27')](_0x14a0a1));if(_0x14a0a1[_0xa0fb('0x28')]){if(_0x14a0a1[_0xa0fb('0x28')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x474593,_0x14a0a1[_0xa0fb('0x28')][_0xa0fb('0x29')]);return _0x1ffd9a(_0x14a0a1[_0xa0fb('0x28')][_0xa0fb('0x29')]);}logger[_0xa0fb('0x28')]('FaxMessage,\x20%s,\x20%s',_0x474593,_0x14a0a1[_0xa0fb('0x28')][_0xa0fb('0x29')]);return _0x5306af(_0x14a0a1['error'][_0xa0fb('0x29')]);}else{logger[_0xa0fb('0x22')](_0xa0fb('0x23'),_0x474593,'request\x20sent');_0x5306af(_0x14a0a1[_0xa0fb('0x2a')][_0xa0fb('0x29')]);}})[_0xa0fb('0x2b')](function(_0x5312cf){logger[_0xa0fb('0x28')]('FaxMessage,\x20%s,\x20%s',_0x474593,_0x5312cf);_0x1ffd9a(_0x5312cf);});});}function respondWithStatusCode(_0x163a9c,_0x3a2527){_0x3a2527=_0x3a2527||0xcc;return function(_0x445302){if(_0x445302){return _0x163a9c['sendStatus'](_0x3a2527);}return _0x163a9c[_0xa0fb('0x2c')](_0x3a2527)[_0xa0fb('0x2d')]();};}function respondWithResult(_0x5ae77d,_0x1322af){_0x1322af=_0x1322af||0xc8;return function(_0x5c6b53){if(_0x5c6b53){return _0x5ae77d[_0xa0fb('0x2c')](_0x1322af)['json'](_0x5c6b53);}};}function respondWithFilteredResult(_0x23a0d6,_0x1a3d39){return function(_0x55d00a){if(_0x55d00a){var _0x5503b6=typeof _0x1a3d39['offset']===_0xa0fb('0x2e')&&typeof _0x1a3d39[_0xa0fb('0x2f')]===_0xa0fb('0x2e');var _0x3f4db0=_0x55d00a[_0xa0fb('0x30')];var _0xc987af=_0x5503b6?0x0:_0x1a3d39[_0xa0fb('0x31')];var _0xc39f4b=_0x5503b6?_0x55d00a['count']:_0x1a3d39['offset']+_0x1a3d39[_0xa0fb('0x2f')];var _0xb79969;if(_0xc39f4b>=_0x3f4db0){_0xc39f4b=_0x3f4db0;_0xb79969=0xc8;}else{_0xb79969=0xce;}_0x23a0d6[_0xa0fb('0x2c')](_0xb79969);return _0x23a0d6['set'](_0xa0fb('0x32'),_0xc987af+'-'+_0xc39f4b+'/'+_0x3f4db0)[_0xa0fb('0x33')](_0x55d00a);}return null;};}function patchUpdates(_0xf05bf0){return function(_0x8a4589){try{jsonpatch[_0xa0fb('0x34')](_0x8a4589,_0xf05bf0,!![]);}catch(_0x52b361){return BPromise[_0xa0fb('0x35')](_0x52b361);}return _0x8a4589[_0xa0fb('0x36')]();};}function saveUpdates(_0x99c4cf,_0x1c27ba){return function(_0x2f149a){if(_0x2f149a){return _0x2f149a[_0xa0fb('0x37')](_0x99c4cf)['then'](function(_0x2e3c29){return _0x2e3c29;});}return null;};}function removeEntity(_0x43fd62,_0x2517ff){return function(_0x39322a){if(_0x39322a){return _0x39322a[_0xa0fb('0x38')]()[_0xa0fb('0x21')](function(){_0x43fd62[_0xa0fb('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17783e,_0x346c5a){return function(_0x41e8eb){if(!_0x41e8eb){_0x17783e[_0xa0fb('0x39')](0x194);}return _0x41e8eb;};}function handleError(_0x57a7fe,_0x2cdd2e){_0x2cdd2e=_0x2cdd2e||0x1f4;return function(_0x563baf){logger[_0xa0fb('0x28')](_0x563baf['stack']);if(_0x563baf['name']){delete _0x563baf[_0xa0fb('0x3a')];}_0x57a7fe[_0xa0fb('0x2c')](_0x2cdd2e)[_0xa0fb('0x3b')](_0x563baf);};}exports[_0xa0fb('0x3c')]=function(_0x109364,_0x5a7a3d){var _0x2dd96f={},_0x1ee063={},_0xac9973={'count':0x0,'rows':[]};var _0x2406b3=_[_0xa0fb('0x3d')](db['FaxMessage'][_0xa0fb('0x3e')],function(_0x360363){return{'name':_0x360363[_0xa0fb('0x3f')],'type':_0x360363[_0xa0fb('0x40')][_0xa0fb('0x41')]};});_0x1ee063[_0xa0fb('0x42')]=_[_0xa0fb('0x3d')](_0x2406b3,_0xa0fb('0x3a'));_0x1ee063[_0xa0fb('0x43')]=_[_0xa0fb('0x44')](_0x109364['query']);_0x1ee063[_0xa0fb('0x45')]=_[_0xa0fb('0x46')](_0x1ee063['model'],_0x1ee063[_0xa0fb('0x43')]);_0x2dd96f[_0xa0fb('0x47')]=_[_0xa0fb('0x46')](_0x1ee063[_0xa0fb('0x42')],qs[_0xa0fb('0x48')](_0x109364[_0xa0fb('0x43')][_0xa0fb('0x48')]));_0x2dd96f[_0xa0fb('0x47')]=_0x2dd96f[_0xa0fb('0x47')][_0xa0fb('0x49')]?_0x2dd96f[_0xa0fb('0x47')]:_0x1ee063[_0xa0fb('0x42')];if(!_0x109364[_0xa0fb('0x43')][_0xa0fb('0x4a')](_0xa0fb('0x4b'))){_0x2dd96f[_0xa0fb('0x2f')]=qs[_0xa0fb('0x2f')](_0x109364[_0xa0fb('0x43')][_0xa0fb('0x2f')]);_0x2dd96f[_0xa0fb('0x31')]=qs[_0xa0fb('0x31')](_0x109364[_0xa0fb('0x43')][_0xa0fb('0x31')]);}_0x2dd96f[_0xa0fb('0x4c')]=qs[_0xa0fb('0x4d')](_0x109364[_0xa0fb('0x43')][_0xa0fb('0x4d')]);_0x2dd96f[_0xa0fb('0x4e')]=qs['filters'](_[_0xa0fb('0x4f')](_0x109364['query'],_0x1ee063[_0xa0fb('0x45')]),_0x2406b3);if(_0x109364[_0xa0fb('0x43')][_0xa0fb('0x50')]){_0x2dd96f[_0xa0fb('0x4e')]=_[_0xa0fb('0x51')](_0x2dd96f[_0xa0fb('0x4e')],{'$or':_[_0xa0fb('0x3d')](_0x2406b3,function(_0x3c22a0){if(_0x3c22a0[_0xa0fb('0x40')]!==_0xa0fb('0x52')){var _0x3327d8={};_0x3327d8[_0x3c22a0[_0xa0fb('0x3a')]]={'$like':'%'+_0x109364[_0xa0fb('0x43')][_0xa0fb('0x50')]+'%'};return _0x3327d8;}})});}_0x2dd96f=_[_0xa0fb('0x51')]({},_0x2dd96f,_0x109364[_0xa0fb('0x53')]);var _0x3a2e7b={'where':_0x2dd96f['where']};return db[_0xa0fb('0x54')][_0xa0fb('0x30')](_0x3a2e7b)[_0xa0fb('0x21')](function(_0x119b3c){_0xac9973[_0xa0fb('0x30')]=_0x119b3c;if(_0x109364[_0xa0fb('0x43')][_0xa0fb('0x55')]){_0x2dd96f[_0xa0fb('0x56')]=[{'all':!![]}];}return db['FaxMessage'][_0xa0fb('0x57')](_0x2dd96f);})['then'](function(_0x27468a){_0xac9973[_0xa0fb('0x58')]=_0x27468a;return _0xac9973;})['then'](respondWithFilteredResult(_0x5a7a3d,_0x2dd96f))[_0xa0fb('0x2b')](handleError(_0x5a7a3d,null));};exports[_0xa0fb('0x59')]=function(_0x344e55,_0x377c24){var _0x3af4ee={'raw':!![],'where':{'id':_0x344e55[_0xa0fb('0x5a')]['id']}},_0x32c1d3={};_0x32c1d3[_0xa0fb('0x42')]=_[_0xa0fb('0x44')](db[_0xa0fb('0x54')][_0xa0fb('0x3e')]);_0x32c1d3[_0xa0fb('0x43')]=_[_0xa0fb('0x44')](_0x344e55[_0xa0fb('0x43')]);_0x32c1d3[_0xa0fb('0x45')]=_[_0xa0fb('0x46')](_0x32c1d3[_0xa0fb('0x42')],_0x32c1d3[_0xa0fb('0x43')]);_0x3af4ee[_0xa0fb('0x47')]=_['intersection'](_0x32c1d3[_0xa0fb('0x42')],qs[_0xa0fb('0x48')](_0x344e55[_0xa0fb('0x43')][_0xa0fb('0x48')]));_0x3af4ee[_0xa0fb('0x47')]=_0x3af4ee[_0xa0fb('0x47')]['length']?_0x3af4ee[_0xa0fb('0x47')]:_0x32c1d3[_0xa0fb('0x42')];if(_0x344e55[_0xa0fb('0x43')][_0xa0fb('0x55')]){_0x3af4ee[_0xa0fb('0x56')]=[{'all':!![]}];}_0x3af4ee=_[_0xa0fb('0x51')]({},_0x3af4ee,_0x344e55[_0xa0fb('0x53')]);return db['FaxMessage']['find'](_0x3af4ee)[_0xa0fb('0x21')](handleEntityNotFound(_0x377c24,null))[_0xa0fb('0x21')](respondWithResult(_0x377c24,null))['catch'](handleError(_0x377c24,null));};exports[_0xa0fb('0x37')]=function(_0x5d4538,_0x525c39){if(_0x5d4538[_0xa0fb('0x5b')]['id']){delete _0x5d4538['body']['id'];}return db[_0xa0fb('0x54')][_0xa0fb('0x5c')]({'where':{'id':_0x5d4538['params']['id']}})[_0xa0fb('0x21')](handleEntityNotFound(_0x525c39,null))[_0xa0fb('0x21')](saveUpdates(_0x5d4538[_0xa0fb('0x5b')],null))[_0xa0fb('0x21')](respondWithResult(_0x525c39,null))[_0xa0fb('0x2b')](handleError(_0x525c39,null));};exports[_0xa0fb('0x38')]=function(_0x73d4ae,_0x4067c7){return db['FaxMessage'][_0xa0fb('0x5c')]({'where':{'id':_0x73d4ae['params']['id']}})[_0xa0fb('0x21')](handleEntityNotFound(_0x4067c7,null))[_0xa0fb('0x21')](removeEntity(_0x4067c7,null))[_0xa0fb('0x2b')](handleError(_0x4067c7,null));};exports['describe']=function(_0x29f582,_0x76cd92){return db[_0xa0fb('0x54')][_0xa0fb('0x5d')]()[_0xa0fb('0x21')](respondWithResult(_0x76cd92,null))[_0xa0fb('0x2b')](handleError(_0x76cd92,null));};var interaction_log=require(_0xa0fb('0x13'))(_0xa0fb('0x5e'));exports['accept']=function(_0x37673b,_0x13c535,_0x185729){var _0x4461fe={'agent':{},'channel':_0xa0fb('0x5f')};if(_0x37673b[_0xa0fb('0x5b')]['id']){delete _0x37673b[_0xa0fb('0x5b')]['id'];}_0x37673b[_0xa0fb('0x5b')][_0xa0fb('0x60')]=!![];_0x37673b[_0xa0fb('0x5b')][_0xa0fb('0x61')]=moment()[_0xa0fb('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x37673b[_0xa0fb('0x5b')][_0xa0fb('0x63')]=_0x37673b[_0xa0fb('0x5b')][_0xa0fb('0x63')]||_0x37673b[_0xa0fb('0x64')]['id'];_0x4461fe[_0xa0fb('0x65')]['id']=_0x37673b[_0xa0fb('0x5b')][_0xa0fb('0x63')];return db['FaxMessage'][_0xa0fb('0x5c')]({'where':{'id':_0x37673b[_0xa0fb('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13c535,null))[_0xa0fb('0x21')](saveUpdates(_0x37673b[_0xa0fb('0x5b')],null))[_0xa0fb('0x21')](function(_0x76ea71){if(_0x76ea71){_0x4461fe[_0xa0fb('0x29')]=_0x76ea71[_0xa0fb('0x66')]({'plain':!![]});return db[_0xa0fb('0x67')]['find']({'where':{'id':_0x76ea71[_0xa0fb('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x13c535,null))[_0xa0fb('0x21')](function(_0x231839){if(_0x231839){return _0x231839['update']({'UserId':_0x37673b[_0xa0fb('0x5b')][_0xa0fb('0x63')],'read1stAt':_['isNil'](_0x231839[_0xa0fb('0x69')])?moment()[_0xa0fb('0x62')](_0xa0fb('0x6a')):undefined});}return null;})[_0xa0fb('0x21')](function(_0x4be68e){if(_0x4be68e){_0x4461fe[_0xa0fb('0x6b')]=_0x4be68e[_0xa0fb('0x66')]({'plain':!![]});interaction_log[_0xa0fb('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x37673b[_0xa0fb('0x64')]['id'],_0x37673b['user'][_0xa0fb('0x3a')],_0x37673b[_0xa0fb('0x64')][_0xa0fb('0x6c')],_0x4461fe[_0xa0fb('0x6b')]['id'],_0x37673b[_0xa0fb('0x5b')]?JSON[_0xa0fb('0x27')](_0x37673b[_0xa0fb('0x5b')]):_0xa0fb('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4461fe);}return null;})[_0xa0fb('0x21')](function(_0x3a8a4e){var _0x41435f=_0xa0fb('0x6e')+_0x3a8a4e[_0xa0fb('0x29')][_0xa0fb('0x6f')];return db[_0xa0fb('0x70')][_0xa0fb('0x43')](_0x41435f,{'type':db[_0xa0fb('0x71')][_0xa0fb('0x72')][_0xa0fb('0x73')],'raw':!![]})[_0xa0fb('0x21')](function(_0x4e36fa){return _0x4e36fa;});})[_0xa0fb('0x21')](function(_0x207650){if(_0x207650){_0x4461fe[_0xa0fb('0x29')][_0xa0fb('0x74')]=_0x207650[0x0];if(!_0x37673b[_0xa0fb('0x5b')][_0xa0fb('0x63')])return;return db[_0xa0fb('0x75')]['find']({'where':{'id':_0x37673b[_0xa0fb('0x5b')]['UserId'],'role':_0xa0fb('0x65')},'attributes':['id',_0xa0fb('0x3a'),'fullname',_0xa0fb('0x76'),_0xa0fb('0x77')],'raw':!![]});}return null;})['then'](function(_0x15f67f){if(!_0x15f67f)return null;_0x4461fe[_0xa0fb('0x29')][_0xa0fb('0x65')]=_0x15f67f;return _0x4461fe;})['then'](function(_0x2d4d44){if(_0x2d4d44){if(_0x37673b['body'][_0xa0fb('0x78')]){_0x4461fe[_0xa0fb('0x29')][_0xa0fb('0x79')]=util['format']('SIP/%s',_0x37673b[_0xa0fb('0x64')][_0xa0fb('0x3a')]);_0x4461fe[_0xa0fb('0x29')][_0xa0fb('0x7a')]=_0x4461fe['channel'];_0x4461fe[_0xa0fb('0x29')][_0xa0fb('0x7b')]=_0x4461fe[_0xa0fb('0x7a')];_0x4461fe['message']['event']=_0xa0fb('0x7c');return respondWithRpcPromise(_0xa0fb('0x7d'),_0xa0fb('0x7d'),{'event':_0xa0fb('0x7e'),'message':_0x4461fe[_0xa0fb('0x29')]},client9002)[_0xa0fb('0x21')](function(){return _0x4461fe;});}return _0x4461fe;}return null;})[_0xa0fb('0x21')](respondWithResult(_0x13c535,null))[_0xa0fb('0x2b')](handleError(_0x13c535,null));};var interaction_log=require(_0xa0fb('0x13'))('fax-interactions');exports[_0xa0fb('0x35')]=function(_0x5e7f58,_0x3ab201,_0x3c339e){var _0x9fced8={'agent':{},'channel':_0xa0fb('0x5f')};if(_0x5e7f58['body']['id']){delete _0x5e7f58['body']['id'];}_0x5e7f58[_0xa0fb('0x5b')]['UserId']=_0x5e7f58[_0xa0fb('0x5b')][_0xa0fb('0x63')]||_0x5e7f58['user']['id'];_0x9fced8[_0xa0fb('0x65')]['id']=_0x5e7f58[_0xa0fb('0x5b')][_0xa0fb('0x63')];return db['FaxMessage'][_0xa0fb('0x5c')]({'where':{'id':_0x5e7f58[_0xa0fb('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ab201,null))[_0xa0fb('0x21')](function(_0x5a95e2){if(_0x5a95e2){_0x9fced8[_0xa0fb('0x29')]=_0x5a95e2['get']({'plain':!![]});return db[_0xa0fb('0x67')][_0xa0fb('0x5c')]({'where':{'id':_0x5a95e2[_0xa0fb('0x68')]}});}return null;})[_0xa0fb('0x21')](handleEntityNotFound(_0x3ab201,null))['then'](function(_0x590979){if(_0x590979){_0x9fced8['interaction']=_0x590979[_0xa0fb('0x66')]({'plain':!![]});interaction_log['info'](_0xa0fb('0x7f'),_0x5e7f58[_0xa0fb('0x64')]['id'],_0x5e7f58[_0xa0fb('0x64')][_0xa0fb('0x3a')],_0x5e7f58[_0xa0fb('0x64')]['role'],_0x9fced8['interaction']['id'],_0x5e7f58[_0xa0fb('0x5b')]?JSON[_0xa0fb('0x27')](_0x5e7f58[_0xa0fb('0x5b')]):_0xa0fb('0x6d'));return respondWithRpcPromise(_0xa0fb('0x80'),'rejectMessage',_0x9fced8);}return null;})[_0xa0fb('0x21')](function(_0x3776e0){var _0x3ffc3e=_0xa0fb('0x6e')+_0x3776e0['message'][_0xa0fb('0x6f')];return db[_0xa0fb('0x70')][_0xa0fb('0x43')](_0x3ffc3e,{'type':db['Sequelize'][_0xa0fb('0x72')][_0xa0fb('0x73')],'raw':!![]})[_0xa0fb('0x21')](function(_0x2b5c9a){return _0x2b5c9a;});})[_0xa0fb('0x21')](function(_0x35f5cf){if(_0x35f5cf){_0x9fced8[_0xa0fb('0x29')]['contact']=_0x35f5cf[0x0];if(!_0x5e7f58['body'][_0xa0fb('0x63')])return;return db['User'][_0xa0fb('0x5c')]({'where':{'id':_0x5e7f58[_0xa0fb('0x5b')]['UserId'],'role':_0xa0fb('0x65')},'attributes':['id',_0xa0fb('0x3a'),_0xa0fb('0x81'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x45898f){if(!_0x45898f)return null;_0x9fced8[_0xa0fb('0x29')][_0xa0fb('0x65')]=_0x45898f;return _0x9fced8;})[_0xa0fb('0x21')](function(_0x2f889b){if(_0x2f889b){_0x2f889b[_0xa0fb('0x29')][_0xa0fb('0x79')]=util[_0xa0fb('0x62')](_0xa0fb('0x82'),_0x5e7f58[_0xa0fb('0x64')][_0xa0fb('0x3a')]);_0x2f889b[_0xa0fb('0x29')][_0xa0fb('0x7a')]=_0x9fced8['channel'];_0x2f889b[_0xa0fb('0x29')][_0xa0fb('0x7b')]=_0x9fced8[_0xa0fb('0x7a')];_0x2f889b['message'][_0xa0fb('0x83')]=_0xa0fb('0x35');respondWithRpcPromise(_0xa0fb('0x7d'),_0xa0fb('0x7d'),{'event':_0xa0fb('0x84'),'message':_0x2f889b[_0xa0fb('0x29')]},client9002);return _0x9fced8;}return null;})['then'](respondWithResult(_0x3ab201,null))['catch'](handleError(_0x3ab201,null));};exports['create']=function(_0x31afcf,_0x2c5cc4){var _0x2b5772;return db[_0xa0fb('0x54')]['create'](_0x31afcf[_0xa0fb('0x5b')],{})['then'](function(_0x10fd41){_0x2b5772=_0x10fd41;return db[_0xa0fb('0x85')][_0xa0fb('0x86')]({'where':{'id':_0x2b5772[_0xa0fb('0x6f')]}});})[_0xa0fb('0x21')](function(_0x15d49f){if(_[_0xa0fb('0x87')](_0x15d49f)){return;}else{_0x2b5772[_0xa0fb('0x5f')]=_0x15d49f[_0xa0fb('0x5f')];return db[_0xa0fb('0x88')]['findOne']({'where':{'id':_0x2b5772['AttachmentId']}});}})[_0xa0fb('0x21')](function(_0x52a9fd){return respondWithRpcPromise('SendFax',_0xa0fb('0x89'),{'FaxAccountId':_[_0xa0fb('0x87')](_0x31afcf['body'])?undefined:_0x31afcf['body'][_0xa0fb('0x8a')],'path':_[_0xa0fb('0x87')](_0x52a9fd)?undefined:util[_0xa0fb('0x62')]('/var/opt/motion2/server/files/attachments/%s',_0x52a9fd[_0xa0fb('0x8b')]),'fax':_[_0xa0fb('0x87')](_0x2b5772[_0xa0fb('0x5f')])?undefined:_0x2b5772[_0xa0fb('0x5f')],'AttachmentId':_0x2b5772['AttachmentId']},client9002);})[_0xa0fb('0x21')](respondWithResult(_0x2c5cc4,0xc9))[_0xa0fb('0x2b')](handleError(_0x2c5cc4,null));};exports['download']=function(_0xea47b6,_0x5cc6c4){var _0x2fb65c=path[_0xa0fb('0x8c')](config[_0xa0fb('0x8d')],'server',_0xa0fb('0x8e'),_0xa0fb('0x8f'));return db[_0xa0fb('0x54')][_0xa0fb('0x5c')]({'where':{'id':_0xea47b6[_0xa0fb('0x5a')]['id']},'include':[{'model':db[_0xa0fb('0x88')],'as':_0xa0fb('0x88')}]})[_0xa0fb('0x21')](handleEntityNotFound(_0x5cc6c4,null))[_0xa0fb('0x21')](function(_0x5703dc){if(_0x5703dc){return _0x5cc6c4[_0xa0fb('0x90')](path[_0xa0fb('0x8c')](_0x2fb65c,_0x5703dc[_0xa0fb('0x88')][_0xa0fb('0x8b')]));}})[_0xa0fb('0x2b')](handleError(_0x5cc6c4,null));}; \ No newline at end of file +var _0x063e=['attachments','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','stack','name','map','FaxMessage','fieldName','type','key','query','keys','filters','attributes','model','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','rawAttributes','intersection','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','email','interface','motionChannel','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files'];(function(_0x347045,_0x3936c0){var _0xd5268f=function(_0x458c90){while(--_0x458c90){_0x347045['push'](_0x347045['shift']());}};_0xd5268f(++_0x3936c0);}(_0x063e,0x1b7));var _0xe063=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x063e[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe063('0x0'));var zipdir=require(_0xe063('0x1'));var jsonpatch=require(_0xe063('0x2'));var rp=require('request-promise');var moment=require(_0xe063('0x3'));var BPromise=require(_0xe063('0x4'));var Mustache=require(_0xe063('0x5'));var util=require('util');var path=require(_0xe063('0x6'));var sox=require(_0xe063('0x7'));var csv=require(_0xe063('0x8'));var ejs=require(_0xe063('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe063('0xa'));var squel=require(_0xe063('0xb'));var crypto=require(_0xe063('0xc'));var jsforce=require(_0xe063('0xd'));var deskjs=require(_0xe063('0xe'));var toCsv=require(_0xe063('0x8'));var querystring=require(_0xe063('0xf'));var Papa=require(_0xe063('0x10'));var Redis=require(_0xe063('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe063('0x12'));var as=require(_0xe063('0x13'));var hardwareService=require(_0xe063('0x14'));var logger=require(_0xe063('0x15'))('api');var utils=require(_0xe063('0x16'));var config=require(_0xe063('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe063('0x18')]=_[_0xe063('0x19')](config[_0xe063('0x18')],{'host':_0xe063('0x1a'),'port':0x18eb});var socket=require(_0xe063('0x1b'))(new Redis(config['redis']));require(_0xe063('0x1c'))[_0xe063('0x1d')](socket);var jayson=require(_0xe063('0x1e'));var client=jayson['client'][_0xe063('0x1f')]({'port':0x232c});var client9002=jayson[_0xe063('0x20')][_0xe063('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x355b7b,_0x34e871,_0x131913,_0x57c172){return new BPromise(function(_0x3060ff,_0x577e96){var _0x3f5f01=_0x57c172||client;return _0x3f5f01[_0xe063('0x21')](_0x355b7b,_0x131913)[_0xe063('0x22')](function(_0x3509e1){logger[_0xe063('0x23')](_0xe063('0x24'),_0x34e871,_0xe063('0x25'));logger[_0xe063('0x26')](_0xe063('0x27'),_0x34e871,'request\x20sent',JSON[_0xe063('0x28')](_0x3509e1));if(_0x3509e1[_0xe063('0x29')]){if(_0x3509e1[_0xe063('0x29')][_0xe063('0x2a')]===0x1f4){logger[_0xe063('0x29')]('FaxMessage,\x20%s,\x20%s',_0x34e871,_0x3509e1[_0xe063('0x29')][_0xe063('0x2b')]);return _0x577e96(_0x3509e1[_0xe063('0x29')][_0xe063('0x2b')]);}logger[_0xe063('0x29')](_0xe063('0x24'),_0x34e871,_0x3509e1[_0xe063('0x29')][_0xe063('0x2b')]);return _0x3060ff(_0x3509e1[_0xe063('0x29')][_0xe063('0x2b')]);}else{logger[_0xe063('0x23')](_0xe063('0x24'),_0x34e871,_0xe063('0x25'));_0x3060ff(_0x3509e1[_0xe063('0x2c')][_0xe063('0x2b')]);}})[_0xe063('0x2d')](function(_0x516a5c){logger['error'](_0xe063('0x24'),_0x34e871,_0x516a5c);_0x577e96(_0x516a5c);});});}function respondWithStatusCode(_0x157256,_0x9ba4f2){_0x9ba4f2=_0x9ba4f2||0xcc;return function(_0x5617ae){if(_0x5617ae){return _0x157256[_0xe063('0x2e')](_0x9ba4f2);}return _0x157256[_0xe063('0x2f')](_0x9ba4f2)[_0xe063('0x30')]();};}function respondWithResult(_0x1ef00e,_0x836712){_0x836712=_0x836712||0xc8;return function(_0x50922e){if(_0x50922e){return _0x1ef00e['status'](_0x836712)[_0xe063('0x31')](_0x50922e);}};}function respondWithFilteredResult(_0x1bf2fb,_0x24bc5d){return function(_0x50f7af){if(_0x50f7af){var _0x2af8ce=typeof _0x24bc5d[_0xe063('0x32')]===_0xe063('0x33')&&typeof _0x24bc5d['limit']==='undefined';var _0x228a9f=_0x50f7af[_0xe063('0x34')];var _0x54a58f=_0x2af8ce?0x0:_0x24bc5d[_0xe063('0x32')];var _0x265706=_0x2af8ce?_0x50f7af[_0xe063('0x34')]:_0x24bc5d[_0xe063('0x32')]+_0x24bc5d['limit'];var _0x483c2e;if(_0x265706>=_0x228a9f){_0x265706=_0x228a9f;_0x483c2e=0xc8;}else{_0x483c2e=0xce;}_0x1bf2fb[_0xe063('0x2f')](_0x483c2e);return _0x1bf2fb[_0xe063('0x35')](_0xe063('0x36'),_0x54a58f+'-'+_0x265706+'/'+_0x228a9f)[_0xe063('0x31')](_0x50f7af);}return null;};}function patchUpdates(_0x442741){return function(_0x5a7a47){try{jsonpatch[_0xe063('0x37')](_0x5a7a47,_0x442741,!![]);}catch(_0x5985b6){return BPromise[_0xe063('0x38')](_0x5985b6);}return _0x5a7a47['save']();};}function saveUpdates(_0x46fd6f,_0x38c561){return function(_0x9f875a){if(_0x9f875a){return _0x9f875a[_0xe063('0x39')](_0x46fd6f)[_0xe063('0x22')](function(_0x1864e3){return _0x1864e3;});}return null;};}function removeEntity(_0x599005,_0x32355d){return function(_0x10bc46){if(_0x10bc46){return _0x10bc46[_0xe063('0x3a')]()[_0xe063('0x22')](function(){_0x599005[_0xe063('0x2f')](0xcc)[_0xe063('0x30')]();});}};}function handleEntityNotFound(_0x23fc78,_0x1386c2){return function(_0x113451){if(!_0x113451){_0x23fc78['sendStatus'](0x194);}return _0x113451;};}function handleError(_0x50f56a,_0x4e5c3e){_0x4e5c3e=_0x4e5c3e||0x1f4;return function(_0x860dea){logger[_0xe063('0x29')](_0x860dea[_0xe063('0x3b')]);if(_0x860dea[_0xe063('0x3c')]){delete _0x860dea[_0xe063('0x3c')];}_0x50f56a[_0xe063('0x2f')](_0x4e5c3e)['send'](_0x860dea);};}exports['index']=function(_0x458090,_0x5356f3){var _0x50b420={},_0x393b60={},_0x4cee52={'count':0x0,'rows':[]};var _0x4bde31=_[_0xe063('0x3d')](db[_0xe063('0x3e')]['rawAttributes'],function(_0x1188f3){return{'name':_0x1188f3[_0xe063('0x3f')],'type':_0x1188f3[_0xe063('0x40')][_0xe063('0x41')]};});_0x393b60['model']=_[_0xe063('0x3d')](_0x4bde31,_0xe063('0x3c'));_0x393b60[_0xe063('0x42')]=_[_0xe063('0x43')](_0x458090[_0xe063('0x42')]);_0x393b60[_0xe063('0x44')]=_['intersection'](_0x393b60['model'],_0x393b60['query']);_0x50b420[_0xe063('0x45')]=_['intersection'](_0x393b60[_0xe063('0x46')],qs[_0xe063('0x47')](_0x458090[_0xe063('0x42')][_0xe063('0x47')]));_0x50b420[_0xe063('0x45')]=_0x50b420[_0xe063('0x45')][_0xe063('0x48')]?_0x50b420['attributes']:_0x393b60[_0xe063('0x46')];if(!_0x458090['query']['hasOwnProperty'](_0xe063('0x49'))){_0x50b420[_0xe063('0x4a')]=qs[_0xe063('0x4a')](_0x458090[_0xe063('0x42')][_0xe063('0x4a')]);_0x50b420[_0xe063('0x32')]=qs[_0xe063('0x32')](_0x458090[_0xe063('0x42')][_0xe063('0x32')]);}_0x50b420[_0xe063('0x4b')]=qs['sort'](_0x458090[_0xe063('0x42')][_0xe063('0x4c')]);_0x50b420[_0xe063('0x4d')]=qs[_0xe063('0x44')](_[_0xe063('0x4e')](_0x458090[_0xe063('0x42')],_0x393b60['filters']),_0x4bde31);if(_0x458090[_0xe063('0x42')][_0xe063('0x4f')]){_0x50b420['where']=_['merge'](_0x50b420[_0xe063('0x4d')],{'$or':_[_0xe063('0x3d')](_0x4bde31,function(_0x18365e){if(_0x18365e[_0xe063('0x40')]!==_0xe063('0x50')){var _0x51f0ac={};_0x51f0ac[_0x18365e[_0xe063('0x3c')]]={'$like':'%'+_0x458090[_0xe063('0x42')][_0xe063('0x4f')]+'%'};return _0x51f0ac;}})});}_0x50b420=_[_0xe063('0x51')]({},_0x50b420,_0x458090[_0xe063('0x52')]);var _0x41e6fc={'where':_0x50b420[_0xe063('0x4d')]};return db[_0xe063('0x3e')][_0xe063('0x34')](_0x41e6fc)['then'](function(_0x5f25f7){_0x4cee52[_0xe063('0x34')]=_0x5f25f7;if(_0x458090[_0xe063('0x42')]['includeAll']){_0x50b420[_0xe063('0x53')]=[{'all':!![]}];}return db[_0xe063('0x3e')][_0xe063('0x54')](_0x50b420);})[_0xe063('0x22')](function(_0x3e8c8a){_0x4cee52[_0xe063('0x55')]=_0x3e8c8a;return _0x4cee52;})[_0xe063('0x22')](respondWithFilteredResult(_0x5356f3,_0x50b420))[_0xe063('0x2d')](handleError(_0x5356f3,null));};exports[_0xe063('0x56')]=function(_0x1ab30f,_0x1c6ec1){var _0x18fc26={'raw':!![],'where':{'id':_0x1ab30f[_0xe063('0x57')]['id']}},_0x2b3450={};_0x2b3450[_0xe063('0x46')]=_[_0xe063('0x43')](db[_0xe063('0x3e')][_0xe063('0x58')]);_0x2b3450['query']=_[_0xe063('0x43')](_0x1ab30f['query']);_0x2b3450[_0xe063('0x44')]=_[_0xe063('0x59')](_0x2b3450['model'],_0x2b3450[_0xe063('0x42')]);_0x18fc26[_0xe063('0x45')]=_['intersection'](_0x2b3450[_0xe063('0x46')],qs['fields'](_0x1ab30f[_0xe063('0x42')][_0xe063('0x47')]));_0x18fc26['attributes']=_0x18fc26[_0xe063('0x45')][_0xe063('0x48')]?_0x18fc26['attributes']:_0x2b3450[_0xe063('0x46')];if(_0x1ab30f[_0xe063('0x42')]['includeAll']){_0x18fc26[_0xe063('0x53')]=[{'all':!![]}];}_0x18fc26=_[_0xe063('0x51')]({},_0x18fc26,_0x1ab30f[_0xe063('0x52')]);return db[_0xe063('0x3e')][_0xe063('0x5a')](_0x18fc26)[_0xe063('0x22')](handleEntityNotFound(_0x1c6ec1,null))[_0xe063('0x22')](respondWithResult(_0x1c6ec1,null))[_0xe063('0x2d')](handleError(_0x1c6ec1,null));};exports[_0xe063('0x39')]=function(_0x59497e,_0x2e3472){if(_0x59497e['body']['id']){delete _0x59497e[_0xe063('0x5b')]['id'];}return db['FaxMessage'][_0xe063('0x5a')]({'where':{'id':_0x59497e[_0xe063('0x57')]['id']}})[_0xe063('0x22')](handleEntityNotFound(_0x2e3472,null))[_0xe063('0x22')](saveUpdates(_0x59497e['body'],null))['then'](respondWithResult(_0x2e3472,null))[_0xe063('0x2d')](handleError(_0x2e3472,null));};exports['destroy']=function(_0xfe7c28,_0x18faf5){return db[_0xe063('0x3e')][_0xe063('0x5a')]({'where':{'id':_0xfe7c28[_0xe063('0x57')]['id']}})[_0xe063('0x22')](handleEntityNotFound(_0x18faf5,null))[_0xe063('0x22')](removeEntity(_0x18faf5,null))[_0xe063('0x2d')](handleError(_0x18faf5,null));};exports[_0xe063('0x5c')]=function(_0x4a4cb5,_0x418eb0){return db[_0xe063('0x3e')][_0xe063('0x5c')]()[_0xe063('0x22')](respondWithResult(_0x418eb0,null))['catch'](handleError(_0x418eb0,null));};var interaction_log=require(_0xe063('0x15'))(_0xe063('0x5d'));exports[_0xe063('0x5e')]=function(_0x3840e7,_0x3630de,_0x572374){var _0x39dd7f={'agent':{},'channel':_0xe063('0x5f')};if(_0x3840e7[_0xe063('0x5b')]['id']){delete _0x3840e7['body']['id'];}_0x3840e7['body'][_0xe063('0x60')]=!![];_0x3840e7[_0xe063('0x5b')][_0xe063('0x61')]=moment()[_0xe063('0x62')](_0xe063('0x63'));_0x3840e7[_0xe063('0x5b')][_0xe063('0x64')]=_0x3840e7[_0xe063('0x5b')]['UserId']||_0x3840e7[_0xe063('0x65')]['id'];_0x39dd7f[_0xe063('0x66')]['id']=_0x3840e7['body'][_0xe063('0x64')];return db['FaxMessage'][_0xe063('0x5a')]({'where':{'id':_0x3840e7[_0xe063('0x57')]['id'],'UserId':null}})[_0xe063('0x22')](handleEntityNotFound(_0x3630de,null))[_0xe063('0x22')](saveUpdates(_0x3840e7['body'],null))['then'](function(_0x318434){if(_0x318434){_0x39dd7f[_0xe063('0x2b')]=_0x318434[_0xe063('0x67')]({'plain':!![]});return db[_0xe063('0x68')][_0xe063('0x5a')]({'where':{'id':_0x318434[_0xe063('0x69')]}});}return null;})[_0xe063('0x22')](handleEntityNotFound(_0x3630de,null))[_0xe063('0x22')](function(_0x12be3d){if(_0x12be3d){return _0x12be3d[_0xe063('0x39')]({'UserId':_0x3840e7['body'][_0xe063('0x64')],'read1stAt':_[_0xe063('0x6a')](_0x12be3d['read1stAt'])?moment()[_0xe063('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe063('0x22')](function(_0x51a04c){if(_0x51a04c){_0x39dd7f[_0xe063('0x6b')]=_0x51a04c[_0xe063('0x67')]({'plain':!![]});interaction_log[_0xe063('0x23')](_0xe063('0x6c'),_0x3840e7[_0xe063('0x65')]['id'],_0x3840e7[_0xe063('0x65')][_0xe063('0x3c')],_0x3840e7[_0xe063('0x65')][_0xe063('0x6d')],_0x39dd7f[_0xe063('0x6b')]['id'],_0x3840e7['body']?JSON[_0xe063('0x28')](_0x3840e7[_0xe063('0x5b')]):_0xe063('0x6e'));return respondWithRpcPromise('AcceptMessage',_0xe063('0x6f'),_0x39dd7f);}return null;})[_0xe063('0x22')](function(_0x1d4202){var _0x45d67b=_0xe063('0x70')+_0x1d4202[_0xe063('0x2b')][_0xe063('0x71')];return db[_0xe063('0x72')][_0xe063('0x42')](_0x45d67b,{'type':db[_0xe063('0x73')][_0xe063('0x74')][_0xe063('0x75')],'raw':!![]})[_0xe063('0x22')](function(_0xb8e4db){return _0xb8e4db;});})[_0xe063('0x22')](function(_0x4ea312){if(_0x4ea312){_0x39dd7f[_0xe063('0x2b')][_0xe063('0x76')]=_0x4ea312[0x0];if(!_0x3840e7[_0xe063('0x5b')][_0xe063('0x64')])return;return db['User'][_0xe063('0x5a')]({'where':{'id':_0x3840e7[_0xe063('0x5b')][_0xe063('0x64')],'role':_0xe063('0x66')},'attributes':['id',_0xe063('0x3c'),_0xe063('0x77'),'email',_0xe063('0x78')],'raw':!![]});}return null;})[_0xe063('0x22')](function(_0x46ae65){if(!_0x46ae65)return null;_0x39dd7f['message'][_0xe063('0x66')]=_0x46ae65;return _0x39dd7f;})['then'](function(_0x541b41){if(_0x541b41){if(_0x3840e7['body'][_0xe063('0x79')]){_0x39dd7f['message']['interface']=util[_0xe063('0x62')]('SIP/%s',_0x3840e7[_0xe063('0x65')][_0xe063('0x3c')]);_0x39dd7f[_0xe063('0x2b')][_0xe063('0x7a')]=_0x39dd7f['channel'];_0x39dd7f[_0xe063('0x2b')]['motionChannel']=_0x39dd7f['channel'];_0x39dd7f['message'][_0xe063('0x7b')]=_0xe063('0x5e');return respondWithRpcPromise(_0xe063('0x7c'),_0xe063('0x7c'),{'event':_0xe063('0x7d'),'message':_0x39dd7f[_0xe063('0x2b')]},client9002)['then'](function(){return _0x39dd7f;});}return _0x39dd7f;}return null;})[_0xe063('0x22')](respondWithResult(_0x3630de,null))[_0xe063('0x2d')](handleError(_0x3630de,null));};var interaction_log=require(_0xe063('0x15'))(_0xe063('0x5d'));exports['reject']=function(_0x1d4de3,_0x1dddc8,_0x2134da){var _0x155a3d={'agent':{},'channel':'fax'};if(_0x1d4de3[_0xe063('0x5b')]['id']){delete _0x1d4de3['body']['id'];}_0x1d4de3[_0xe063('0x5b')][_0xe063('0x64')]=_0x1d4de3[_0xe063('0x5b')]['UserId']||_0x1d4de3[_0xe063('0x65')]['id'];_0x155a3d['agent']['id']=_0x1d4de3[_0xe063('0x5b')]['UserId'];return db[_0xe063('0x3e')][_0xe063('0x5a')]({'where':{'id':_0x1d4de3['params']['id'],'UserId':null}})[_0xe063('0x22')](handleEntityNotFound(_0x1dddc8,null))[_0xe063('0x22')](function(_0x3158a4){if(_0x3158a4){_0x155a3d[_0xe063('0x2b')]=_0x3158a4['get']({'plain':!![]});return db[_0xe063('0x68')][_0xe063('0x5a')]({'where':{'id':_0x3158a4[_0xe063('0x69')]}});}return null;})[_0xe063('0x22')](handleEntityNotFound(_0x1dddc8,null))[_0xe063('0x22')](function(_0x19af31){if(_0x19af31){_0x155a3d[_0xe063('0x6b')]=_0x19af31[_0xe063('0x67')]({'plain':!![]});interaction_log[_0xe063('0x23')](_0xe063('0x7e'),_0x1d4de3['user']['id'],_0x1d4de3[_0xe063('0x65')][_0xe063('0x3c')],_0x1d4de3[_0xe063('0x65')][_0xe063('0x6d')],_0x155a3d[_0xe063('0x6b')]['id'],_0x1d4de3['body']?JSON[_0xe063('0x28')](_0x1d4de3[_0xe063('0x5b')]):_0xe063('0x6e'));return respondWithRpcPromise(_0xe063('0x7f'),'rejectMessage',_0x155a3d);}return null;})[_0xe063('0x22')](function(_0x7c213a){var _0x516933=_0xe063('0x70')+_0x7c213a[_0xe063('0x2b')][_0xe063('0x71')];return db[_0xe063('0x72')]['query'](_0x516933,{'type':db[_0xe063('0x73')][_0xe063('0x74')]['SELECT'],'raw':!![]})[_0xe063('0x22')](function(_0x307404){return _0x307404;});})[_0xe063('0x22')](function(_0x2465cb){if(_0x2465cb){_0x155a3d[_0xe063('0x2b')][_0xe063('0x76')]=_0x2465cb[0x0];if(!_0x1d4de3['body'][_0xe063('0x64')])return;return db[_0xe063('0x80')][_0xe063('0x5a')]({'where':{'id':_0x1d4de3[_0xe063('0x5b')][_0xe063('0x64')],'role':'agent'},'attributes':['id',_0xe063('0x3c'),'fullname',_0xe063('0x81'),'internal'],'raw':!![]});}return null;})[_0xe063('0x22')](function(_0x36052d){if(!_0x36052d)return null;_0x155a3d[_0xe063('0x2b')][_0xe063('0x66')]=_0x36052d;return _0x155a3d;})[_0xe063('0x22')](function(_0x3674a8){if(_0x3674a8){_0x3674a8['message'][_0xe063('0x82')]=util[_0xe063('0x62')]('SIP/%s',_0x1d4de3[_0xe063('0x65')][_0xe063('0x3c')]);_0x3674a8[_0xe063('0x2b')][_0xe063('0x7a')]=_0x155a3d['channel'];_0x3674a8['message'][_0xe063('0x83')]=_0x155a3d['channel'];_0x3674a8[_0xe063('0x2b')][_0xe063('0x7b')]=_0xe063('0x38');respondWithRpcPromise('EventManager',_0xe063('0x7c'),{'event':_0xe063('0x84'),'message':_0x3674a8['message']},client9002);return _0x155a3d;}return null;})[_0xe063('0x22')](respondWithResult(_0x1dddc8,null))[_0xe063('0x2d')](handleError(_0x1dddc8,null));};exports[_0xe063('0x85')]=function(_0x3fcfd9,_0x4f9a53){var _0x481594;return db[_0xe063('0x3e')][_0xe063('0x85')](_0x3fcfd9['body'],{})[_0xe063('0x22')](function(_0x32ef9a){_0x481594=_0x32ef9a;return db['CmContact'][_0xe063('0x86')]({'where':{'id':_0x481594[_0xe063('0x71')]}});})[_0xe063('0x22')](function(_0x1e917d){if(_['isNil'](_0x1e917d)){return;}else{_0x481594[_0xe063('0x5f')]=_0x1e917d[_0xe063('0x5f')];return db[_0xe063('0x87')][_0xe063('0x86')]({'where':{'id':_0x481594[_0xe063('0x88')]}});}})[_0xe063('0x22')](function(_0x2358e8){return respondWithRpcPromise(_0xe063('0x89'),_0xe063('0x89'),{'FaxAccountId':_[_0xe063('0x6a')](_0x3fcfd9[_0xe063('0x5b')])?undefined:_0x3fcfd9[_0xe063('0x5b')][_0xe063('0x8a')],'path':_[_0xe063('0x6a')](_0x2358e8)?undefined:util['format'](_0xe063('0x8b'),_0x2358e8[_0xe063('0x8c')]),'fax':_['isNil'](_0x481594[_0xe063('0x5f')])?undefined:_0x481594['fax'],'AttachmentId':_0x481594[_0xe063('0x88')]},client9002);})[_0xe063('0x22')](respondWithResult(_0x4f9a53,0xc9))[_0xe063('0x2d')](handleError(_0x4f9a53,null));};exports[_0xe063('0x8d')]=function(_0x2b7384,_0x1d3535){var _0x24294a=path[_0xe063('0x8e')](config[_0xe063('0x8f')],'server',_0xe063('0x90'),_0xe063('0x91'));return db['FaxMessage'][_0xe063('0x5a')]({'where':{'id':_0x2b7384[_0xe063('0x57')]['id']},'include':[{'model':db[_0xe063('0x87')],'as':_0xe063('0x87')}]})[_0xe063('0x22')](handleEntityNotFound(_0x1d3535,null))['then'](function(_0x5566a3){if(_0x5566a3){return _0x1d3535[_0xe063('0x8d')](path[_0xe063('0x8e')](_0x24294a,_0x5566a3['Attachment'][_0xe063('0x8c')]));}})['catch'](handleError(_0x1d3535,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index a118e57..6f0a462 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 _0x1059=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x3d96c7,_0x25955e){var _0x44adce=function(_0x25fd9e){while(--_0x25fd9e){_0x3d96c7['push'](_0x3d96c7['shift']());}};_0x44adce(++_0x25955e);}(_0x1059,0x176));var _0x9105=function(_0x1b2e43,_0x27fce4){_0x1b2e43=_0x1b2e43-0x0;var _0x3bc61a=_0x1059[_0x1b2e43];return _0x3bc61a;};'use strict';var EventEmitter=require(_0x9105('0x0'));var FaxMessage=require(_0x9105('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9105('0x2')](0x0);var events={'afterCreate':_0x9105('0x3'),'afterUpdate':_0x9105('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3565b3){return function(_0x59b3db,_0x44878b,_0x219176){FaxMessageEvents['emit'](_0x3565b3+':'+_0x59b3db['id'],_0x59b3db);FaxMessageEvents[_0x9105('0x5')](_0x3565b3,_0x59b3db);_0x219176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x9105('0x6')](e,emitEvent(event));}}module[_0x9105('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x13f5=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x13f5,0xc3));var _0x513f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f5[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x513f('0x0'));var FaxMessage=require(_0x513f('0x1'))['db'][_0x513f('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x513f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x513f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c30ef){return function(_0xd61dcf,_0x10ae9e,_0x3a9531){FaxMessageEvents[_0x513f('0x5')](_0x5c30ef+':'+_0xd61dcf['id'],_0xd61dcf);FaxMessageEvents[_0x513f('0x5')](_0x5c30ef,_0xd61dcf);_0x3a9531(null);};}for(var e in events){if(events[_0x513f('0x6')](e)){var event=events[e];FaxMessage[_0x513f('0x7')](e,emitEvent(event));}}module[_0x513f('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 6c8162f..7b637e5 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 _0x8b2e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','models','get','toLowerCase','out','secret','isNil','FaxInteraction','findOne','then','update','createdAt','direction','error','utf8mb4','util'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x8b2e,0xf2));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe8b2('0x0'));var logger=require(_0xe8b2('0x1'))('api');var moment=require(_0xe8b2('0x2'));var BPromise=require(_0xe8b2('0x3'));var rp=require(_0xe8b2('0x4'));var fs=require('fs');var path=require(_0xe8b2('0x5'));var rimraf=require(_0xe8b2('0x6'));var config=require(_0xe8b2('0x7'));var attributes=require(_0xe8b2('0x8'));module[_0xe8b2('0x9')]=function(_0x26adf8,_0x48ed0f){return _0x26adf8[_0xe8b2('0xa')]('FaxMessage',attributes,{'tableName':_0xe8b2('0xb'),'paranoid':![],'indexes':[{'name':_0xe8b2('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c0cbf,_0x433f28,_0x23e5f2){var _0x35fa76=_0x26adf8[_0xe8b2('0xd')];var _0x183431=_0x4c0cbf[_0xe8b2('0xe')]({'plain':!![]});if(_0x183431['direction'][_0xe8b2('0xf')]()==='in'||_0x183431['direction'][_0xe8b2('0xf')]()===_0xe8b2('0x10')&&!_0x183431[_0xe8b2('0x11')]&&!_[_0xe8b2('0x12')](_0x183431['UserId'])){_0x35fa76[_0xe8b2('0x13')][_0xe8b2('0x14')]({'where':{'id':_0x183431['FaxInteractionId']}})[_0xe8b2('0x15')](function(_0x329b74){if(_0x329b74){_0x329b74[_0xe8b2('0x16')]({'lastMsgAt':_0x183431[_0xe8b2('0x17')],'lastMsgDirection':_0x183431[_0xe8b2('0x18')][_0xe8b2('0xf')]()});}})['catch'](function(_0x2cd6a5){console[_0xe8b2('0x19')](_0x2cd6a5);});}_0x23e5f2();}},'charset':_0xe8b2('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb4dc=['bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb4dc,0x92));var _0xcb4d=function(_0x24c24e,_0x1649a0){_0x24c24e=_0x24c24e-0x0;var _0x2b0732=_0xb4dc[_0x24c24e];return _0x2b0732;};'use strict';var _=require('lodash');var util=require(_0xcb4d('0x0'));var logger=require(_0xcb4d('0x1'))(_0xcb4d('0x2'));var moment=require(_0xcb4d('0x3'));var BPromise=require(_0xcb4d('0x4'));var rp=require(_0xcb4d('0x5'));var fs=require('fs');var path=require(_0xcb4d('0x6'));var rimraf=require(_0xcb4d('0x7'));var config=require(_0xcb4d('0x8'));var attributes=require(_0xcb4d('0x9'));module[_0xcb4d('0xa')]=function(_0x144fe5,_0x2181cd){return _0x144fe5['define']('FaxMessage',attributes,{'tableName':_0xcb4d('0xb'),'paranoid':![],'indexes':[{'name':_0xcb4d('0xc'),'fields':[_0xcb4d('0xd')],'type':_0xcb4d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b3ad0,_0x3c91ea,_0x2eab79){var _0x44fad2=_0x144fe5[_0xcb4d('0xf')];var _0x1ff8b7=_0x2b3ad0[_0xcb4d('0x10')]({'plain':!![]});if(_0x1ff8b7[_0xcb4d('0x11')]['toLowerCase']()==='in'||_0x1ff8b7[_0xcb4d('0x11')][_0xcb4d('0x12')]()===_0xcb4d('0x13')&&!_0x1ff8b7[_0xcb4d('0x14')]&&!_[_0xcb4d('0x15')](_0x1ff8b7[_0xcb4d('0x16')])){_0x44fad2[_0xcb4d('0x17')]['findOne']({'where':{'id':_0x1ff8b7[_0xcb4d('0x18')]}})[_0xcb4d('0x19')](function(_0x41d656){if(_0x41d656){_0x41d656[_0xcb4d('0x1a')]({'lastMsgAt':_0x1ff8b7[_0xcb4d('0x1b')],'lastMsgDirection':_0x1ff8b7[_0xcb4d('0x11')]['toLowerCase']()});}})['catch'](function(_0x571db3){console['error'](_0x571db3);});}_0x2eab79();}},'charset':_0xcb4d('0x1c'),'collate':_0xcb4d('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 93993a8..3ff2e44 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 _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x425d,0x1e0));var _0xd425=function(_0x5724e6,_0xa6ee67){_0x5724e6=_0x5724e6-0x0;var _0x4ccb15=_0x425d[_0x5724e6];return _0x4ccb15;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});config[_0xd425('0xc')]=_[_0xd425('0xd')](config['redis'],{'host':_0xd425('0xe'),'port':0x18eb});var socket=require(_0xd425('0xf'))(new Redis(config[_0xd425('0xc')]));require(_0xd425('0x10'))[_0xd425('0x11')](socket);function respondWithRpcPromise(_0x2beb20,_0x30111e,_0x1969ba){return new BPromise(function(_0x3a7a01,_0x35a7f4){return client[_0xd425('0x12')](_0x2beb20,_0x1969ba)[_0xd425('0x13')](function(_0x26f6d2){logger[_0xd425('0x14')](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));logger[_0xd425('0x17')](_0xd425('0x18'),_0x30111e,_0xd425('0x16'),JSON[_0xd425('0x19')](_0x26f6d2));if(_0x26f6d2['error']){if(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1b')]===0x1f4){logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x35a7f4(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x3a7a01(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}else{logger['info'](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));_0x3a7a01(_0x26f6d2[_0xd425('0x1d')][_0xd425('0x1c')]);}})['catch'](function(_0x58a0c1){logger['error']('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x58a0c1);_0x35a7f4(_0x58a0c1);});});}exports[_0xd425('0x1e')]=function(_0xb92870){var _0x3c98db=this;return new Promise(function(_0x5e797a,_0x355af0){return db[_0xd425('0x1f')]['create'](_0xb92870[_0xd425('0x20')],{'raw':_0xb92870[_0xd425('0x21')]?_0xb92870[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![]})[_0xd425('0x13')](function(_0xb240c4){logger[_0xd425('0x14')](_0xd425('0x1e'),_0xb92870);logger[_0xd425('0x17')](_0xd425('0x1e'),_0xb92870,JSON[_0xd425('0x19')](_0xb240c4));_0x5e797a(_0xb240c4);})[_0xd425('0x23')](function(_0x47f44a){logger[_0xd425('0x1a')](_0xd425('0x1e'),_0x47f44a[_0xd425('0x1c')],_0xb92870);_0x355af0(_0x3c98db[_0xd425('0x1a')](0x1f4,_0x47f44a[_0xd425('0x1c')]));});});};exports[_0xd425('0x24')]=function(_0x3c3402){var _0x577e4b=this;return new Promise(function(_0x12f951,_0x177de2){return db[_0xd425('0x1f')]['update'](_0x3c3402[_0xd425('0x20')],{'raw':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x25')]||null:null,'attributes':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x26')]||null:null,'limit':_0x3c3402['options']?_0x3c3402[_0xd425('0x21')][_0xd425('0x27')]||null:null})[_0xd425('0x13')](function(_0x3695dd){logger[_0xd425('0x14')](_0xd425('0x24'),_0x3c3402);logger[_0xd425('0x17')](_0xd425('0x24'),_0x3c3402,JSON[_0xd425('0x19')](_0x3695dd));_0x12f951(_0x3695dd);})[_0xd425('0x23')](function(_0x3583b0){logger['error'](_0xd425('0x24'),_0x3583b0[_0xd425('0x1c')],_0x3c3402);_0x177de2(_0x577e4b[_0xd425('0x1a')](0x1f4,_0x3583b0[_0xd425('0x1c')]));});});}; \ No newline at end of file +var _0x2dae=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','CreateFaxMessage','FaxMessage','create','body','options','debug','UpdateFaxMessage','update','raw','attributes'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x2dae,0xc3));var _0xe2da=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x2dae[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});config[_0xe2da('0xb')]=_[_0xe2da('0xc')](config[_0xe2da('0xb')],{'host':_0xe2da('0xd'),'port':0x18eb});var socket=require(_0xe2da('0xe'))(new Redis(config[_0xe2da('0xb')]));require(_0xe2da('0xf'))[_0xe2da('0x10')](socket);function respondWithRpcPromise(_0x5a2fc5,_0x52e650,_0x3baaa8){return new BPromise(function(_0x104fb3,_0x17086c){return client[_0xe2da('0x11')](_0x5a2fc5,_0x3baaa8)[_0xe2da('0x12')](function(_0x1a29b9){logger[_0xe2da('0x13')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0xe2da('0x14'));logger['debug'](_0xe2da('0x15'),_0x52e650,_0xe2da('0x14'),JSON[_0xe2da('0x16')](_0x1a29b9));if(_0x1a29b9[_0xe2da('0x17')]){if(_0x1a29b9[_0xe2da('0x17')][_0xe2da('0x18')]===0x1f4){logger[_0xe2da('0x17')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0x1a29b9[_0xe2da('0x17')]['message']);return _0x17086c(_0x1a29b9['error'][_0xe2da('0x19')]);}logger[_0xe2da('0x17')](_0xe2da('0x1a'),_0x52e650,_0x1a29b9['error'][_0xe2da('0x19')]);return _0x104fb3(_0x1a29b9[_0xe2da('0x17')][_0xe2da('0x19')]);}else{logger[_0xe2da('0x13')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0xe2da('0x14'));_0x104fb3(_0x1a29b9[_0xe2da('0x1b')][_0xe2da('0x19')]);}})[_0xe2da('0x1c')](function(_0x329ffe){logger['error'](_0xe2da('0x1a'),_0x52e650,_0x329ffe);_0x17086c(_0x329ffe);});});}exports[_0xe2da('0x1d')]=function(_0x538d96){var _0x1a9324=this;return new Promise(function(_0x254b37,_0x332193){return db[_0xe2da('0x1e')][_0xe2da('0x1f')](_0x538d96[_0xe2da('0x20')],{'raw':_0x538d96['options']?_0x538d96[_0xe2da('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xe2da('0x12')](function(_0x191d38){logger[_0xe2da('0x13')](_0xe2da('0x1d'),_0x538d96);logger[_0xe2da('0x22')](_0xe2da('0x1d'),_0x538d96,JSON[_0xe2da('0x16')](_0x191d38));_0x254b37(_0x191d38);})[_0xe2da('0x1c')](function(_0x5a08d6){logger[_0xe2da('0x17')](_0xe2da('0x1d'),_0x5a08d6[_0xe2da('0x19')],_0x538d96);_0x332193(_0x1a9324[_0xe2da('0x17')](0x1f4,_0x5a08d6[_0xe2da('0x19')]));});});};exports[_0xe2da('0x23')]=function(_0x124d93){var _0x56c37e=this;return new Promise(function(_0x2adc49,_0x3e23d7){return db[_0xe2da('0x1e')][_0xe2da('0x24')](_0x124d93[_0xe2da('0x20')],{'raw':_0x124d93[_0xe2da('0x21')]?_0x124d93[_0xe2da('0x21')][_0xe2da('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x124d93['options']?_0x124d93['options']['where']||null:null,'attributes':_0x124d93[_0xe2da('0x21')]?_0x124d93[_0xe2da('0x21')][_0xe2da('0x26')]||null:null,'limit':_0x124d93[_0xe2da('0x21')]?_0x124d93['options']['limit']||null:null})[_0xe2da('0x12')](function(_0x1ec8ca){logger[_0xe2da('0x13')](_0xe2da('0x23'),_0x124d93);logger[_0xe2da('0x22')](_0xe2da('0x23'),_0x124d93,JSON[_0xe2da('0x16')](_0x1ec8ca));_0x2adc49(_0x1ec8ca);})[_0xe2da('0x1c')](function(_0x461610){logger['error']('UpdateFaxMessage',_0x461610[_0xe2da('0x19')],_0x124d93);_0x3e23d7(_0x56c37e[_0xe2da('0x17')](0x1f4,_0x461610[_0xe2da('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 9f608c1..6182d55 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 _0xc28a=['length','faxMessage:','./faxMessage.events','save','update','removeListener'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xc28a,0x1ac));var _0xac28=function(_0x1dabc8,_0x20a333){_0x1dabc8=_0x1dabc8-0x0;var _0x76ea38=_0xc28a[_0x1dabc8];return _0x76ea38;};'use strict';var FaxMessageEvents=require(_0xac28('0x0'));var events=[_0xac28('0x1'),'remove',_0xac28('0x2')];function createListener(_0xd067b6,_0x3c2751){return function(_0x1eadfe){_0x3c2751['emit'](_0xd067b6,_0x1eadfe);};}function removeListener(_0x5fce13,_0x40eed3){return function(){FaxMessageEvents[_0xac28('0x3')](_0x5fce13,_0x40eed3);};}exports['register']=function(_0x4db540){for(var _0x3bfc33=0x0,_0x50f3b9=events[_0xac28('0x4')];_0x3bfc33<_0x50f3b9;_0x3bfc33++){var _0x20e65c=events[_0x3bfc33];var _0x25b9ed=createListener(_0xac28('0x5')+_0x20e65c,_0x4db540);FaxMessageEvents['on'](_0x20e65c,_0x25b9ed);}}; \ No newline at end of file +var _0x6ed3=['register','length','faxMessage:','save','remove','update'];(function(_0x3ea595,_0x1d7146){var _0x4ce5de=function(_0x400df2){while(--_0x400df2){_0x3ea595['push'](_0x3ea595['shift']());}};_0x4ce5de(++_0x1d7146);}(_0x6ed3,0x11d));var _0x36ed=function(_0x2d2498,_0x26426d){_0x2d2498=_0x2d2498-0x0;var _0x447a5b=_0x6ed3[_0x2d2498];return _0x447a5b;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x36ed('0x0'),_0x36ed('0x1'),_0x36ed('0x2')];function createListener(_0x29d1f7,_0x256471){return function(_0x49117d){_0x256471['emit'](_0x29d1f7,_0x49117d);};}function removeListener(_0x28a0f1,_0x483578){return function(){FaxMessageEvents['removeListener'](_0x28a0f1,_0x483578);};}exports[_0x36ed('0x3')]=function(_0x37a719){for(var _0x22bdc5=0x0,_0x2e9a38=events[_0x36ed('0x4')];_0x22bdc5<_0x2e9a38;_0x22bdc5++){var _0x4dadd4=events[_0x22bdc5];var _0x278942=createListener(_0x36ed('0x5')+_0x4dadd4,_0x37a719);FaxMessageEvents['on'](_0x4dadd4,_0x278942);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4d0b2be..1c1c827 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 _0xb9a7=['faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','tracked'];(function(_0x2fc1c0,_0x263616){var _0x5c2ee3=function(_0x460ea7){while(--_0x460ea7){_0x2fc1c0['push'](_0x2fc1c0['shift']());}};_0x5c2ee3(++_0x263616);}(_0xb9a7,0x112));var _0x7b9a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xb9a7[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7b9a('0x2'));var interaction=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));var controller=require(_0x7b9a('0x5'));router[_0x7b9a('0x6')]('/',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x8')]);router[_0x7b9a('0x6')](_0x7b9a('0x9'),auth[_0x7b9a('0x7')](),controller['describe']);router[_0x7b9a('0x6')](_0x7b9a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7b9a('0xb'),auth[_0x7b9a('0x7')](),controller['download']);router[_0x7b9a('0xc')]('/',auth['isAuthenticated'](),interaction[_0x7b9a('0xd')]('fax',_0x7b9a('0xe')),controller[_0x7b9a('0xf')]);router[_0x7b9a('0x10')]('/:id',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x11')]);router['put'](_0x7b9a('0x12'),auth[_0x7b9a('0x7')](),controller['accept']);router[_0x7b9a('0x10')](_0x7b9a('0x13'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x14')]);router[_0x7b9a('0x15')](_0x7b9a('0xa'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x16')]);module[_0x7b9a('0x17')]=router; \ No newline at end of file +var _0xae60=['/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','update','/:id/accept'];(function(_0x3c0793,_0x440b5b){var _0x21513d=function(_0xc61277){while(--_0xc61277){_0x3c0793['push'](_0x3c0793['shift']());}};_0x21513d(++_0x440b5b);}(_0xae60,0x1c7));var _0x0ae6=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xae60[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var path=require(_0x0ae6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var fs_extra=require(_0x0ae6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var controller=require('./faxMessage.controller');router[_0x0ae6('0x8')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xa')]);router[_0x0ae6('0x8')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0x8')]('/:id',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xd')]);router[_0x0ae6('0x8')](_0x0ae6('0xe'),auth['isAuthenticated'](),controller[_0x0ae6('0xf')]);router[_0x0ae6('0x10')]('/',auth[_0x0ae6('0x9')](),interaction[_0x0ae6('0x11')](_0x0ae6('0x12'),_0x0ae6('0x13')),controller[_0x0ae6('0x14')]);router[_0x0ae6('0x15')](_0x0ae6('0x16'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x17')]);router[_0x0ae6('0x15')](_0x0ae6('0x18'),auth[_0x0ae6('0x9')](),controller['accept']);router[_0x0ae6('0x15')](_0x0ae6('0x19'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1a')]);router[_0x0ae6('0x1b')](_0x0ae6('0x16'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1c')]);module[_0x0ae6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 869695e..3975061 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 _0x0149=['exports','STRING','name','INTEGER','ENUM','rrmemory','sequelize'];(function(_0x567943,_0x4991f4){var _0x5cfd0e=function(_0x26f78c){while(--_0x26f78c){_0x567943['push'](_0x567943['shift']());}};_0x5cfd0e(++_0x4991f4);}(_0x0149,0x92));var _0x9014=function(_0x5d8c4a,_0x4e1c53){_0x5d8c4a=_0x5d8c4a-0x0;var _0x4e28b5=_0x0149[_0x5d8c4a];return _0x4e28b5;};'use strict';var Sequelize=require(_0x9014('0x0'));module[_0x9014('0x1')]={'name':{'type':Sequelize[_0x9014('0x2')],'unique':_0x9014('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9014('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9014('0x5')](_0x9014('0x6'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2168=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x2e13f7,_0x24b85d){var _0xa4ed19=function(_0x4144aa){while(--_0x4144aa){_0x2e13f7['push'](_0x2e13f7['shift']());}};_0xa4ed19(++_0x24b85d);}(_0x2168,0x112));var _0x8216=function(_0x1cd1b6,_0x23d8ab){_0x1cd1b6=_0x1cd1b6-0x0;var _0x1573ce=_0x2168[_0x1cd1b6];return _0x1573ce;};'use strict';var Sequelize=require(_0x8216('0x0'));module[_0x8216('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8216('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8216('0x3')]},'timeout':{'type':Sequelize[_0x8216('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8216('0x5')](_0x8216('0x6'),_0x8216('0x7'),_0x8216('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8216('0x4')],'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 734e1e2..f5f45d7 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 _0x51b3=['name','send','FaxQueue','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','includeAll','include','findAll','rows','catch','params','options','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserFaxQueue','nolimit','FaxQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','faxPause','order','filter','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','userFaxQueue:save','User','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','FaxQueues','UserProfileResource','sendStatus','error','stack'];(function(_0x37be00,_0x45514d){var _0x12b45f=function(_0x400632){while(--_0x400632){_0x37be00['push'](_0x37be00['shift']());}};_0x12b45f(++_0x45514d);}(_0x51b3,0x170));var _0x351b=function(_0x563ae3,_0x1df974){_0x563ae3=_0x563ae3-0x0;var _0x1138cc=_0x51b3[_0x563ae3];return _0x1138cc;};'use strict';var emlformat=require(_0x351b('0x0'));var rimraf=require(_0x351b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x351b('0x2'));var moment=require(_0x351b('0x3'));var BPromise=require(_0x351b('0x4'));var Mustache=require('mustache');var util=require(_0x351b('0x5'));var path=require('path');var sox=require(_0x351b('0x6'));var csv=require(_0x351b('0x7'));var ejs=require(_0x351b('0x8'));var fs=require('fs');var fs_extra=require(_0x351b('0x9'));var _=require(_0x351b('0xa'));var squel=require(_0x351b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x351b('0xc'));var toCsv=require(_0x351b('0x7'));var querystring=require(_0x351b('0xd'));var Papa=require(_0x351b('0xe'));var Redis=require(_0x351b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x351b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x351b('0x11'));var logger=require(_0x351b('0x12'))('api');var utils=require(_0x351b('0x13'));var config=require(_0x351b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x351b('0x15'))['db'];config[_0x351b('0x16')]=_[_0x351b('0x17')](config[_0x351b('0x16')],{'host':_0x351b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x351b('0x16')]));require(_0x351b('0x19'))[_0x351b('0x1a')](socket);function respondWithStatusCode(_0x35a92d,_0x53b684){_0x53b684=_0x53b684||0xcc;return function(_0x5913c8){if(_0x5913c8){return _0x35a92d['sendStatus'](_0x53b684);}return _0x35a92d[_0x351b('0x1b')](_0x53b684)[_0x351b('0x1c')]();};}function respondWithResult(_0x2e0585,_0x32273c){_0x32273c=_0x32273c||0xc8;return function(_0x5ad9de){if(_0x5ad9de){return _0x2e0585[_0x351b('0x1b')](_0x32273c)[_0x351b('0x1d')](_0x5ad9de);}};}function respondWithFilteredResult(_0xbdaa82,_0x17f9db){return function(_0x508567){if(_0x508567){var _0xcc95f1=typeof _0x17f9db[_0x351b('0x1e')]===_0x351b('0x1f')&&typeof _0x17f9db[_0x351b('0x20')]===_0x351b('0x1f');var _0x507bb5=_0x508567['count'];var _0x53c745=_0xcc95f1?0x0:_0x17f9db[_0x351b('0x1e')];var _0x5291ad=_0xcc95f1?_0x508567[_0x351b('0x21')]:_0x17f9db[_0x351b('0x1e')]+_0x17f9db['limit'];var _0x58f495;if(_0x5291ad>=_0x507bb5){_0x5291ad=_0x507bb5;_0x58f495=0xc8;}else{_0x58f495=0xce;}_0xbdaa82[_0x351b('0x1b')](_0x58f495);return _0xbdaa82[_0x351b('0x22')](_0x351b('0x23'),_0x53c745+'-'+_0x5291ad+'/'+_0x507bb5)[_0x351b('0x1d')](_0x508567);}return null;};}function patchUpdates(_0xa8434){return function(_0x2bb7cd){try{jsonpatch[_0x351b('0x24')](_0x2bb7cd,_0xa8434,!![]);}catch(_0x4d90eb){return BPromise[_0x351b('0x25')](_0x4d90eb);}return _0x2bb7cd['save']();};}function saveUpdates(_0x368575,_0x13ac78){return function(_0x583656){if(_0x583656){return _0x583656[_0x351b('0x26')](_0x368575)[_0x351b('0x27')](function(_0x442182){return _0x442182;});}return null;};}function removeEntity(_0x3714c8,_0x2b9812){return function(_0x352090){if(_0x352090){return _0x352090[_0x351b('0x28')]()[_0x351b('0x27')](function(){var _0x269310=_0x352090['get']({'plain':!![]});var _0x13cbdf=_0x351b('0x29');return db[_0x351b('0x2a')][_0x351b('0x28')]({'where':{'type':_0x13cbdf,'resourceId':_0x269310['id']}})[_0x351b('0x27')](function(){return _0x352090;});})[_0x351b('0x27')](function(){_0x3714c8[_0x351b('0x1b')](0xcc)[_0x351b('0x1c')]();});}};}function handleEntityNotFound(_0x4bb97b,_0x33a582){return function(_0x3eae43){if(!_0x3eae43){_0x4bb97b[_0x351b('0x2b')](0x194);}return _0x3eae43;};}function handleError(_0xab083f,_0x49bde2){_0x49bde2=_0x49bde2||0x1f4;return function(_0x410c49){logger[_0x351b('0x2c')](_0x410c49[_0x351b('0x2d')]);if(_0x410c49[_0x351b('0x2e')]){delete _0x410c49[_0x351b('0x2e')];}_0xab083f[_0x351b('0x1b')](_0x49bde2)[_0x351b('0x2f')](_0x410c49);};}exports['index']=function(_0x1f3b03,_0x4ee833){var _0x55783b={},_0xa8c4e7={},_0x972ef3={'count':0x0,'rows':[]};var _0x4ed683=_['map'](db[_0x351b('0x30')][_0x351b('0x31')],function(_0x1b0c38){return{'name':_0x1b0c38[_0x351b('0x32')],'type':_0x1b0c38[_0x351b('0x33')]['key']};});_0xa8c4e7[_0x351b('0x34')]=_[_0x351b('0x35')](_0x4ed683,_0x351b('0x2e'));_0xa8c4e7['query']=_[_0x351b('0x36')](_0x1f3b03[_0x351b('0x37')]);_0xa8c4e7[_0x351b('0x38')]=_[_0x351b('0x39')](_0xa8c4e7[_0x351b('0x34')],_0xa8c4e7['query']);_0x55783b['attributes']=_['intersection'](_0xa8c4e7[_0x351b('0x34')],qs['fields'](_0x1f3b03[_0x351b('0x37')][_0x351b('0x3a')]));_0x55783b[_0x351b('0x3b')]=_0x55783b['attributes'][_0x351b('0x3c')]?_0x55783b[_0x351b('0x3b')]:_0xa8c4e7[_0x351b('0x34')];if(!_0x1f3b03[_0x351b('0x37')][_0x351b('0x3d')]('nolimit')){_0x55783b['limit']=qs[_0x351b('0x20')](_0x1f3b03[_0x351b('0x37')][_0x351b('0x20')]);_0x55783b['offset']=qs['offset'](_0x1f3b03[_0x351b('0x37')][_0x351b('0x1e')]);}_0x55783b['order']=qs[_0x351b('0x3e')](_0x1f3b03[_0x351b('0x37')][_0x351b('0x3e')]);_0x55783b[_0x351b('0x3f')]=qs[_0x351b('0x38')](_[_0x351b('0x40')](_0x1f3b03[_0x351b('0x37')],_0xa8c4e7[_0x351b('0x38')]),_0x4ed683);if(_0x1f3b03[_0x351b('0x37')]['filter']){_0x55783b[_0x351b('0x3f')]=_[_0x351b('0x41')](_0x55783b[_0x351b('0x3f')],{'$or':_[_0x351b('0x35')](_0x4ed683,function(_0x3ad255){if(_0x3ad255['type']!=='VIRTUAL'){var _0x7c7b9b={};_0x7c7b9b[_0x3ad255[_0x351b('0x2e')]]={'$like':'%'+_0x1f3b03[_0x351b('0x37')]['filter']+'%'};return _0x7c7b9b;}})});}_0x55783b=_[_0x351b('0x41')]({},_0x55783b,_0x1f3b03['options']);var _0x1c2019={'where':_0x55783b[_0x351b('0x3f')]};return db[_0x351b('0x30')][_0x351b('0x21')](_0x1c2019)[_0x351b('0x27')](function(_0x2746d0){_0x972ef3['count']=_0x2746d0;if(_0x1f3b03[_0x351b('0x37')][_0x351b('0x42')]){_0x55783b[_0x351b('0x43')]=[{'all':!![]}];}return db[_0x351b('0x30')][_0x351b('0x44')](_0x55783b);})[_0x351b('0x27')](function(_0x1dd351){_0x972ef3[_0x351b('0x45')]=_0x1dd351;return _0x972ef3;})['then'](respondWithFilteredResult(_0x4ee833,_0x55783b))[_0x351b('0x46')](handleError(_0x4ee833,null));};exports['show']=function(_0x465a90,_0x449ebf){var _0x4ac406={'raw':!![],'where':{'id':_0x465a90[_0x351b('0x47')]['id']}},_0xbd1577={};_0xbd1577[_0x351b('0x34')]=_[_0x351b('0x36')](db[_0x351b('0x30')]['rawAttributes']);_0xbd1577[_0x351b('0x37')]=_[_0x351b('0x36')](_0x465a90[_0x351b('0x37')]);_0xbd1577[_0x351b('0x38')]=_[_0x351b('0x39')](_0xbd1577[_0x351b('0x34')],_0xbd1577[_0x351b('0x37')]);_0x4ac406[_0x351b('0x3b')]=_[_0x351b('0x39')](_0xbd1577['model'],qs[_0x351b('0x3a')](_0x465a90['query']['fields']));_0x4ac406[_0x351b('0x3b')]=_0x4ac406[_0x351b('0x3b')]['length']?_0x4ac406[_0x351b('0x3b')]:_0xbd1577[_0x351b('0x34')];if(_0x465a90[_0x351b('0x37')][_0x351b('0x42')]){_0x4ac406['include']=[{'all':!![]}];}_0x4ac406=_[_0x351b('0x41')]({},_0x4ac406,_0x465a90[_0x351b('0x48')]);return db[_0x351b('0x30')][_0x351b('0x49')](_0x4ac406)[_0x351b('0x27')](handleEntityNotFound(_0x449ebf,null))[_0x351b('0x27')](respondWithResult(_0x449ebf,null))[_0x351b('0x46')](handleError(_0x449ebf,null));};exports[_0x351b('0x4a')]=function(_0xa4b705,_0x26638c){return db[_0x351b('0x30')][_0x351b('0x4a')](_0xa4b705['body'],{})[_0x351b('0x27')](function(_0x5cee39){var _0xec4617=_0xa4b705[_0x351b('0x4b')][_0x351b('0x4c')]({'plain':!![]});if(!_0xec4617)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xec4617[_0x351b('0x4d')]===_0x351b('0x4b')){var _0x2b42d3=_0x5cee39['get']({'plain':!![]});var _0x1642ad=_0x351b('0x29');return db[_0x351b('0x4e')][_0x351b('0x49')]({'where':{'name':_0x1642ad,'userProfileId':_0xec4617[_0x351b('0x4f')]},'raw':!![]})['then'](function(_0x5f3c68){if(_0x5f3c68&&_0x5f3c68[_0x351b('0x50')]===0x0){return db[_0x351b('0x2a')]['create']({'name':_0x2b42d3['name'],'resourceId':_0x2b42d3['id'],'type':_0x5f3c68[_0x351b('0x2e')],'sectionId':_0x5f3c68['id']},{})[_0x351b('0x27')](function(){return _0x5cee39;});}else{return _0x5cee39;}})[_0x351b('0x46')](function(_0x313ab3){logger[_0x351b('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x313ab3);throw _0x313ab3;});}return _0x5cee39;})[_0x351b('0x27')](respondWithResult(_0x26638c,0xc9))[_0x351b('0x46')](handleError(_0x26638c,null));};exports[_0x351b('0x26')]=function(_0x4d2838,_0x48a8b3){if(_0x4d2838[_0x351b('0x51')]['id']){delete _0x4d2838[_0x351b('0x51')]['id'];}return db['FaxQueue'][_0x351b('0x49')]({'where':{'id':_0x4d2838['params']['id']}})[_0x351b('0x27')](handleEntityNotFound(_0x48a8b3,null))[_0x351b('0x27')](saveUpdates(_0x4d2838[_0x351b('0x51')],null))[_0x351b('0x27')](respondWithResult(_0x48a8b3,null))[_0x351b('0x46')](handleError(_0x48a8b3,null));};exports[_0x351b('0x28')]=function(_0x2b73bf,_0x4362a6){return db[_0x351b('0x30')][_0x351b('0x49')]({'where':{'id':_0x2b73bf['params']['id']}})[_0x351b('0x27')](handleEntityNotFound(_0x4362a6,null))[_0x351b('0x27')](removeEntity(_0x4362a6,null))[_0x351b('0x46')](handleError(_0x4362a6,null));};exports[_0x351b('0x52')]=function(_0x8829a0,_0x21e3ea){return db[_0x351b('0x30')][_0x351b('0x52')]()[_0x351b('0x27')](respondWithResult(_0x21e3ea,null))['catch'](handleError(_0x21e3ea,null));};exports[_0x351b('0x53')]=function(_0x2d1335,_0x52b11f,_0xdf90d5){var _0x52348e={'raw':!![],'where':{}},_0x449b3a={},_0xa97c1b;return db['FaxQueue'][_0x351b('0x54')]({'where':{'id':_0x2d1335['params']['id']}})[_0x351b('0x27')](handleEntityNotFound(_0x52b11f,null))[_0x351b('0x27')](function(_0x243635){if(_0x243635){_0xa97c1b=_0x243635['get']({'plain':!![]});_0x449b3a[_0x351b('0x34')]=_[_0x351b('0x36')](db[_0x351b('0x55')][_0x351b('0x31')]);_0x449b3a[_0x351b('0x37')]=_[_0x351b('0x36')](_0x2d1335[_0x351b('0x37')]);_0x449b3a[_0x351b('0x38')]=_['intersection'](_0x449b3a['model'],_0x449b3a['query']);_0x52348e['attributes']=_[_0x351b('0x39')](_0x449b3a[_0x351b('0x34')],qs[_0x351b('0x3a')](_0x2d1335[_0x351b('0x37')]['fields']));_0x52348e[_0x351b('0x3b')]=_0x52348e[_0x351b('0x3b')][_0x351b('0x3c')]?_0x52348e['attributes']:_0x449b3a[_0x351b('0x34')];if(!_0x2d1335[_0x351b('0x37')]['hasOwnProperty'](_0x351b('0x56'))){_0x52348e[_0x351b('0x20')]=qs[_0x351b('0x20')](_0x2d1335[_0x351b('0x37')][_0x351b('0x20')]);_0x52348e[_0x351b('0x1e')]=qs[_0x351b('0x1e')](_0x2d1335[_0x351b('0x37')][_0x351b('0x1e')]);}_0x52348e['order']=qs[_0x351b('0x3e')](_0x2d1335[_0x351b('0x37')][_0x351b('0x3e')]);_0x52348e[_0x351b('0x3f')]=qs[_0x351b('0x38')](_[_0x351b('0x40')](_0x2d1335[_0x351b('0x37')],_0x449b3a['filters']));_0x52348e[_0x351b('0x3f')][_0x351b('0x57')]=_0x243635['id'];if(_0x2d1335[_0x351b('0x37')]['filter']){_0x52348e[_0x351b('0x3f')]=_[_0x351b('0x41')](_0x52348e[_0x351b('0x3f')],{'$or':_['map'](_0x52348e[_0x351b('0x3b')],function(_0x241203){var _0x367338={};_0x367338[_0x241203]={'$like':'%'+_0x2d1335[_0x351b('0x37')]['filter']+'%'};return _0x367338;})});}_0x52348e=_['merge']({},_0x52348e,_0x2d1335[_0x351b('0x48')]);return db[_0x351b('0x55')][_0x351b('0x44')](_0x52348e);}})[_0x351b('0x27')](function(_0x13d1ad){if(_0x13d1ad){return db['User'][_0x351b('0x58')]({'where':{'id':_[_0x351b('0x35')](_0x13d1ad,_0x351b('0x59')),'role':_0x351b('0x5a')},'attributes':['id','name','faxPause',_0x351b('0x5b'),_0x351b('0x5c')]});}})[_0x351b('0x27')](function(_0x1adee6){if(_0x1adee6){return{'count':_0x1adee6['count'],'rows':_['map'](_0x1adee6['rows'],function(_0x443adb){return{'membername':_0x443adb['name'],'UserId':_0x443adb['id'],'queue_name':_0xa97c1b[_0x351b('0x2e')],'FaxQueueId':_0xa97c1b['id'],'interface':util[_0x351b('0x5d')](_0x351b('0x5e'),'SIP',_0x443adb[_0x351b('0x2e')]),'penalty':0x0,'paused':_0x443adb[_0x351b('0x5f')],'createdAt':_0x443adb[_0x351b('0x5c')],'updatedAt':_0x443adb[_0x351b('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x351b('0x27')](respondWithFilteredResult(_0x52b11f,_0x52348e))[_0x351b('0x46')](handleError(_0x52b11f,null));};exports['getTeams']=function(_0x40f8ec,_0x2b91b2,_0x3d0894){var _0x59bda6={};var _0x163bb2={};var _0xf87b6d;var _0x285e4c;return db['FaxQueue'][_0x351b('0x54')]({'where':{'id':_0x40f8ec[_0x351b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b91b2,null))[_0x351b('0x27')](function(_0x201800){if(_0x201800){_0xf87b6d=_0x201800;_0x163bb2[_0x351b('0x34')]=_[_0x351b('0x36')](db['Team']['rawAttributes']);_0x163bb2['query']=_[_0x351b('0x36')](_0x40f8ec[_0x351b('0x37')]);_0x163bb2[_0x351b('0x38')]=_[_0x351b('0x39')](_0x163bb2[_0x351b('0x34')],_0x163bb2[_0x351b('0x37')]);_0x59bda6['attributes']=_[_0x351b('0x39')](_0x163bb2[_0x351b('0x34')],qs[_0x351b('0x3a')](_0x40f8ec[_0x351b('0x37')][_0x351b('0x3a')]));_0x59bda6['attributes']=_0x59bda6[_0x351b('0x3b')]['length']?_0x59bda6[_0x351b('0x3b')]:_0x163bb2[_0x351b('0x34')];_0x59bda6[_0x351b('0x60')]=qs[_0x351b('0x3e')](_0x40f8ec[_0x351b('0x37')][_0x351b('0x3e')]);_0x59bda6[_0x351b('0x3f')]=qs['filters'](_[_0x351b('0x40')](_0x40f8ec[_0x351b('0x37')],_0x163bb2[_0x351b('0x38')]));if(_0x40f8ec[_0x351b('0x37')][_0x351b('0x61')]){_0x59bda6[_0x351b('0x3f')]=_['merge'](_0x59bda6[_0x351b('0x3f')],{'$or':_['map'](_0x59bda6['attributes'],function(_0x3628eb){var _0x4edda8={};_0x4edda8[_0x3628eb]={'$like':'%'+_0x40f8ec['query'][_0x351b('0x61')]+'%'};return _0x4edda8;})});}_0x59bda6=_['merge']({},_0x59bda6,_0x40f8ec[_0x351b('0x48')]);return _0xf87b6d[_0x351b('0x62')](_0x59bda6);}})[_0x351b('0x27')](function(_0x246e91){if(_0x246e91){_0x285e4c=_0x246e91[_0x351b('0x3c')];if(!_0x40f8ec['query'][_0x351b('0x3d')](_0x351b('0x56'))){_0x59bda6[_0x351b('0x20')]=qs[_0x351b('0x20')](_0x40f8ec['query'][_0x351b('0x20')]);_0x59bda6[_0x351b('0x1e')]=qs['offset'](_0x40f8ec[_0x351b('0x37')][_0x351b('0x1e')]);}return _0xf87b6d[_0x351b('0x62')](_0x59bda6);}})[_0x351b('0x27')](function(_0x240b9d){if(_0x240b9d){return _0x240b9d?{'count':_0x285e4c,'rows':_0x240b9d}:null;}})['then'](respondWithResult(_0x2b91b2,null))['catch'](handleError(_0x2b91b2,null));};exports[_0x351b('0x63')]=function(_0xd71934,_0x2cacc1,_0x2a20ae){var _0x132d1b=_0xd71934[_0x351b('0x51')][_0x351b('0x64')];return db[_0x351b('0x65')][_0x351b('0x44')]({'where':{'id':_0x132d1b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x351b('0x66'),'attributes':['id','name',_0x351b('0x67'),'voicePause',_0x351b('0x68')],'raw':!![]}]})[_0x351b('0x27')](function(_0xcb081){if(_0xcb081){var _0x40e8cf=_[_0x351b('0x69')](_0xcb081,function(_0x5c73cd){var _0x779841=_0x5c73cd[_0x351b('0x4c')]({'plain':!![]});return _0x779841[_0x351b('0x66')];});return db[_0x351b('0x30')]['find']({'where':{'id':_0xd71934[_0x351b('0x47')]['id']}})[_0x351b('0x27')](function(_0x5aac04){return db[_0x351b('0x6a')][_0x351b('0x6b')](function(_0x28e582){return _0x5aac04['addTeams'](_0x132d1b,{'transaction':_0x28e582})[_0x351b('0x27')](function(){return BPromise[_0x351b('0x6c')](_0x40e8cf,function(_0x53b94f){return db[_0x351b('0x55')]['findOrCreate']({'where':{'UserId':_0x53b94f['id'],'FaxQueueId':_0xd71934[_0x351b('0x47')]['id']},'transaction':_0x28e582});});})[_0x351b('0x27')](function(){_0x40e8cf[_0x351b('0x6d')](function(_0x43685d){socket['emit'](_0x351b('0x6e'),{'UserId':_0x43685d['id'],'FaxQueueId':_0x5aac04['id']});});});});});}})[_0x351b('0x27')](respondWithStatusCode(_0x2cacc1,null))[_0x351b('0x46')](handleError(_0x2cacc1,null));};exports['removeTeams']=function(_0x1ded23,_0x4a695d,_0x45d6ee){return db[_0x351b('0x65')][_0x351b('0x44')]({'where':{'id':_0x1ded23[_0x351b('0x37')][_0x351b('0x64')]},'attributes':['id'],'include':[{'model':db[_0x351b('0x6f')],'as':_0x351b('0x66'),'attributes':['id'],'raw':!![]}]})[_0x351b('0x27')](handleEntityNotFound(_0x4a695d,null))[_0x351b('0x27')](function(_0x4ba9c2){var _0x2c0658=_[_0x351b('0x35')](_0x4ba9c2,'id');var _0x291f5f=[];var _0xb971bc=[];var _0x1f8f6b=squel[_0x351b('0x70')]();_0x1f8f6b[_0x351b('0x71')](_0x351b('0x72'))['from']('team_has_fax_queues','tq')[_0x351b('0x73')](_0x351b('0x74'),'ut',_0x351b('0x75'))[_0x351b('0x3f')](_0x351b('0x76'),_0x1ded23[_0x351b('0x47')]['id']);for(var _0x1845f4=0x0;_0x1845f4<_0x4ba9c2['length'];_0x1845f4+=0x1){let _0x1ba4e5=_0x4ba9c2[_0x1845f4];for(var _0x5e7a5d=0x0;_0x5e7a5d<_0x1ba4e5[_0x351b('0x66')][_0x351b('0x3c')];_0x5e7a5d+=0x1){let _0x453f52=_0x1ba4e5[_0x351b('0x66')][_0x5e7a5d];var _0x2f0f61=_0x1f8f6b['clone']();_0x2f0f61['where'](_0x351b('0x77'),_0x453f52['id']);_0xb971bc[_0x351b('0x78')](db[_0x351b('0x6a')][_0x351b('0x37')](_0x2f0f61[_0x351b('0x79')](),{'type':db[_0x351b('0x6a')][_0x351b('0x7a')][_0x351b('0x7b')]})[_0x351b('0x27')](function(_0x29502d){if(_0x29502d[_0x351b('0x3c')]===0x1){return _0x453f52['id'];}else{var _0x212d17=_[_0x351b('0x7c')](_[_0x351b('0x35')](_0x29502d,'TeamId'),function(_0x396b2a){return _[_0x351b('0x7d')](_0x2c0658,_0x396b2a);});if(_0x212d17){return _0x453f52['id'];}}}));}}return BPromise['all'](_0xb971bc)['then'](function(_0x3c74be){_0x291f5f=_(_0x291f5f)[_0x351b('0x7e')](_0x3c74be)[_0x351b('0x7f')]()[_0x351b('0x80')]();return db[_0x351b('0x30')]['find']({'where':{'id':_0x1ded23[_0x351b('0x47')]['id']}})[_0x351b('0x27')](function(_0x5d56c2){return db[_0x351b('0x6a')][_0x351b('0x6b')](function(_0x17ccfe){return _0x5d56c2['removeTeams'](_0x1ded23['query'][_0x351b('0x64')],{'transaction':_0x17ccfe})['then'](function(){if(!_[_0x351b('0x81')](_0x291f5f)){return _0x5d56c2[_0x351b('0x82')](_0x291f5f,{'transaction':_0x17ccfe});}})[_0x351b('0x27')](function(){_0x291f5f[_0x351b('0x6d')](function(_0x571356){socket[_0x351b('0x83')](_0x351b('0x84'),{'UserId':_0x571356,'FaxQueueId':_0x5d56c2['id']});});});});});});})[_0x351b('0x27')](respondWithStatusCode(_0x4a695d,null))[_0x351b('0x46')](handleError(_0x4a695d,null));};exports[_0x351b('0x85')]=function(_0xaf45f8,_0x168e96,_0x5309e0){return db['FaxQueue']['find']({'where':{'id':_0xaf45f8[_0x351b('0x47')]['id']}})[_0x351b('0x27')](handleEntityNotFound(_0x168e96,null))[_0x351b('0x27')](function(_0x4d1dba){if(_0x4d1dba){return _0x4d1dba[_0x351b('0x85')](_0xaf45f8['body'][_0x351b('0x64')],_[_0x351b('0x86')](_0xaf45f8[_0x351b('0x51')],[_0x351b('0x64'),'id'])||{})[_0x351b('0x87')](function(_0x2fbde6){for(var _0x54868d=0x0;_0x54868d<_0xaf45f8[_0x351b('0x51')][_0x351b('0x64')]['length'];_0x54868d+=0x1){socket[_0x351b('0x83')](_0x351b('0x6e'),{'UserId':Number(_0xaf45f8[_0x351b('0x51')]['ids'][_0x54868d]),'FaxQueueId':Number(_0xaf45f8[_0x351b('0x47')]['id'])});}return _0x2fbde6;});}})[_0x351b('0x27')](respondWithResult(_0x168e96,null))[_0x351b('0x46')](handleError(_0x168e96,null));};exports['removeAgents']=function(_0x49e11e,_0x129cf1,_0x44f814){return db[_0x351b('0x30')][_0x351b('0x49')]({'where':{'id':_0x49e11e[_0x351b('0x47')]['id']}})['then'](handleEntityNotFound(_0x129cf1,null))[_0x351b('0x27')](function(_0x53c81d){if(_0x53c81d){return _0x53c81d[_0x351b('0x82')](_0x49e11e['query'][_0x351b('0x64')])[_0x351b('0x27')](function(){if(_[_0x351b('0x88')](_0x49e11e[_0x351b('0x37')][_0x351b('0x64')])){for(var _0x5b6581=0x0;_0x5b6581<_0x49e11e[_0x351b('0x37')][_0x351b('0x64')]['length'];_0x5b6581+=0x1){socket[_0x351b('0x83')]('userFaxQueue:remove',{'UserId':Number(_0x49e11e[_0x351b('0x37')][_0x351b('0x64')][_0x5b6581]),'FaxQueueId':Number(_0x49e11e[_0x351b('0x47')]['id'])});}}else{socket[_0x351b('0x83')](_0x351b('0x84'),{'UserId':Number(_0x49e11e[_0x351b('0x37')][_0x351b('0x64')]),'FaxQueueId':Number(_0x49e11e[_0x351b('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x129cf1,null))[_0x351b('0x46')](handleError(_0x129cf1,null));};exports[_0x351b('0x89')]=function(_0x14f7de,_0x39e234,_0x244b9c){var _0xafc11b={};var _0x39fd43={};var _0x2b0f21;var _0x10b1f8;return db[_0x351b('0x30')][_0x351b('0x54')]({'where':{'id':_0x14f7de['params']['id']}})[_0x351b('0x27')](handleEntityNotFound(_0x39e234,null))[_0x351b('0x27')](function(_0x5b75c0){if(_0x5b75c0){_0x2b0f21=_0x5b75c0;_0x39fd43[_0x351b('0x34')]=_[_0x351b('0x36')](db[_0x351b('0x6f')]['rawAttributes']);_0x39fd43[_0x351b('0x37')]=_[_0x351b('0x36')](_0x14f7de[_0x351b('0x37')]);_0x39fd43[_0x351b('0x38')]=_[_0x351b('0x39')](_0x39fd43[_0x351b('0x34')],_0x39fd43[_0x351b('0x37')]);_0xafc11b['attributes']=_[_0x351b('0x39')](_0x39fd43[_0x351b('0x34')],qs[_0x351b('0x3a')](_0x14f7de[_0x351b('0x37')][_0x351b('0x3a')]));_0xafc11b['attributes']=_0xafc11b['attributes']['length']?_0xafc11b[_0x351b('0x3b')]:_0x39fd43[_0x351b('0x34')];_0xafc11b['order']=qs[_0x351b('0x3e')](_0x14f7de[_0x351b('0x37')][_0x351b('0x3e')]);_0xafc11b[_0x351b('0x3f')]=qs[_0x351b('0x38')](_[_0x351b('0x40')](_0x14f7de['query'],_0x39fd43[_0x351b('0x38')]));if(_0x14f7de[_0x351b('0x37')]['filter']){_0xafc11b[_0x351b('0x3f')]=_[_0x351b('0x41')](_0xafc11b[_0x351b('0x3f')],{'$or':_[_0x351b('0x35')](_0xafc11b[_0x351b('0x3b')],function(_0x4400b8){var _0x572ff8={};_0x572ff8[_0x4400b8]={'$like':'%'+_0x14f7de[_0x351b('0x37')][_0x351b('0x61')]+'%'};return _0x572ff8;})});}_0xafc11b=_[_0x351b('0x41')]({},_0xafc11b,_0x14f7de[_0x351b('0x48')]);return _0x2b0f21[_0x351b('0x89')](_0xafc11b);}})[_0x351b('0x27')](function(_0x2ebc06){if(_0x2ebc06){_0x10b1f8=_0x2ebc06['length'];if(!_0x14f7de[_0x351b('0x37')][_0x351b('0x3d')](_0x351b('0x56'))){_0xafc11b[_0x351b('0x20')]=qs[_0x351b('0x20')](_0x14f7de[_0x351b('0x37')][_0x351b('0x20')]);_0xafc11b[_0x351b('0x1e')]=qs[_0x351b('0x1e')](_0x14f7de[_0x351b('0x37')][_0x351b('0x1e')]);}return _0x2b0f21['getAgents'](_0xafc11b);}})['then'](function(_0x3a1b6b){if(_0x3a1b6b){return _0x3a1b6b?{'count':_0x10b1f8,'rows':_0x3a1b6b}:null;}})['then'](respondWithResult(_0x39e234,null))[_0x351b('0x46')](handleError(_0x39e234,null));}; \ No newline at end of file +var _0x8dd3=['User','faxPause','format','SIP','createdAt','updatedAt','getTeams','nolimit','addTeams','Team','online','interface','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','Agents','field','join','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','get','FaxQueues','error','stack','name','index','map','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','includeAll','findAll','rows','params','rawAttributes','fields','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','describe','getMembers','findOne','UserFaxQueue','FaxQueueId'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8dd3,0x1a9));var _0x38dd=function(_0x5b4b6d,_0x48fee8){_0x5b4b6d=_0x5b4b6d-0x0;var _0x31329a=_0x8dd3[_0x5b4b6d];return _0x31329a;};'use strict';var emlformat=require(_0x38dd('0x0'));var rimraf=require(_0x38dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38dd('0x2'));var rp=require(_0x38dd('0x3'));var moment=require(_0x38dd('0x4'));var BPromise=require(_0x38dd('0x5'));var Mustache=require(_0x38dd('0x6'));var util=require(_0x38dd('0x7'));var path=require(_0x38dd('0x8'));var sox=require(_0x38dd('0x9'));var csv=require(_0x38dd('0xa'));var ejs=require(_0x38dd('0xb'));var fs=require('fs');var fs_extra=require(_0x38dd('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x38dd('0xd'));var deskjs=require(_0x38dd('0xe'));var toCsv=require(_0x38dd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x38dd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x38dd('0x10'));var hardwareService=require(_0x38dd('0x11'));var logger=require('../../config/logger')(_0x38dd('0x12'));var utils=require('../../config/utils');var config=require(_0x38dd('0x13'));var licenseUtil=require(_0x38dd('0x14'));var db=require('../../mysqldb')['db'];config[_0x38dd('0x15')]=_['defaults'](config[_0x38dd('0x15')],{'host':_0x38dd('0x16'),'port':0x18eb});var socket=require(_0x38dd('0x17'))(new Redis(config[_0x38dd('0x15')]));require(_0x38dd('0x18'))[_0x38dd('0x19')](socket);function respondWithStatusCode(_0x152d09,_0x1f5d48){_0x1f5d48=_0x1f5d48||0xcc;return function(_0x20d870){if(_0x20d870){return _0x152d09[_0x38dd('0x1a')](_0x1f5d48);}return _0x152d09[_0x38dd('0x1b')](_0x1f5d48)['end']();};}function respondWithResult(_0x1b4541,_0x5339e2){_0x5339e2=_0x5339e2||0xc8;return function(_0x49c9b7){if(_0x49c9b7){return _0x1b4541[_0x38dd('0x1b')](_0x5339e2)['json'](_0x49c9b7);}};}function respondWithFilteredResult(_0x417994,_0xfa042d){return function(_0x3da025){if(_0x3da025){var _0x169ad1=typeof _0xfa042d[_0x38dd('0x1c')]==='undefined'&&typeof _0xfa042d[_0x38dd('0x1d')]===_0x38dd('0x1e');var _0x582bce=_0x3da025[_0x38dd('0x1f')];var _0x2a5fca=_0x169ad1?0x0:_0xfa042d[_0x38dd('0x1c')];var _0x3b3399=_0x169ad1?_0x3da025['count']:_0xfa042d[_0x38dd('0x1c')]+_0xfa042d[_0x38dd('0x1d')];var _0x22a1d0;if(_0x3b3399>=_0x582bce){_0x3b3399=_0x582bce;_0x22a1d0=0xc8;}else{_0x22a1d0=0xce;}_0x417994[_0x38dd('0x1b')](_0x22a1d0);return _0x417994[_0x38dd('0x20')](_0x38dd('0x21'),_0x2a5fca+'-'+_0x3b3399+'/'+_0x582bce)[_0x38dd('0x22')](_0x3da025);}return null;};}function patchUpdates(_0x35301d){return function(_0x19f5c9){try{jsonpatch['apply'](_0x19f5c9,_0x35301d,!![]);}catch(_0x36650c){return BPromise[_0x38dd('0x23')](_0x36650c);}return _0x19f5c9['save']();};}function saveUpdates(_0x9dfc8f,_0x5c4692){return function(_0x3a53db){if(_0x3a53db){return _0x3a53db[_0x38dd('0x24')](_0x9dfc8f)[_0x38dd('0x25')](function(_0x12160e){return _0x12160e;});}return null;};}function removeEntity(_0x26ffa8,_0x5129c7){return function(_0x2f0602){if(_0x2f0602){return _0x2f0602[_0x38dd('0x26')]()[_0x38dd('0x25')](function(){var _0x15133e=_0x2f0602[_0x38dd('0x27')]({'plain':!![]});var _0x1af37a=_0x38dd('0x28');return db['UserProfileResource'][_0x38dd('0x26')]({'where':{'type':_0x1af37a,'resourceId':_0x15133e['id']}})[_0x38dd('0x25')](function(){return _0x2f0602;});})[_0x38dd('0x25')](function(){_0x26ffa8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5762,_0xe48f41){return function(_0x54688b){if(!_0x54688b){_0x2b5762['sendStatus'](0x194);}return _0x54688b;};}function handleError(_0x15b78a,_0x371a64){_0x371a64=_0x371a64||0x1f4;return function(_0x24c8d5){logger[_0x38dd('0x29')](_0x24c8d5[_0x38dd('0x2a')]);if(_0x24c8d5['name']){delete _0x24c8d5[_0x38dd('0x2b')];}_0x15b78a[_0x38dd('0x1b')](_0x371a64)['send'](_0x24c8d5);};}exports[_0x38dd('0x2c')]=function(_0x408736,_0x58fb5b){var _0x138c08={},_0x5d3eb8={},_0x108fcf={'count':0x0,'rows':[]};var _0x3ab91c=_[_0x38dd('0x2d')](db['FaxQueue']['rawAttributes'],function(_0x39a371){return{'name':_0x39a371[_0x38dd('0x2e')],'type':_0x39a371[_0x38dd('0x2f')]['key']};});_0x5d3eb8[_0x38dd('0x30')]=_[_0x38dd('0x2d')](_0x3ab91c,_0x38dd('0x2b'));_0x5d3eb8[_0x38dd('0x31')]=_[_0x38dd('0x32')](_0x408736[_0x38dd('0x31')]);_0x5d3eb8[_0x38dd('0x33')]=_['intersection'](_0x5d3eb8[_0x38dd('0x30')],_0x5d3eb8[_0x38dd('0x31')]);_0x138c08[_0x38dd('0x34')]=_[_0x38dd('0x35')](_0x5d3eb8[_0x38dd('0x30')],qs['fields'](_0x408736[_0x38dd('0x31')]['fields']));_0x138c08[_0x38dd('0x34')]=_0x138c08['attributes'][_0x38dd('0x36')]?_0x138c08['attributes']:_0x5d3eb8[_0x38dd('0x30')];if(!_0x408736[_0x38dd('0x31')][_0x38dd('0x37')]('nolimit')){_0x138c08[_0x38dd('0x1d')]=qs[_0x38dd('0x1d')](_0x408736[_0x38dd('0x31')][_0x38dd('0x1d')]);_0x138c08['offset']=qs[_0x38dd('0x1c')](_0x408736[_0x38dd('0x31')][_0x38dd('0x1c')]);}_0x138c08[_0x38dd('0x38')]=qs[_0x38dd('0x39')](_0x408736['query'][_0x38dd('0x39')]);_0x138c08[_0x38dd('0x3a')]=qs[_0x38dd('0x33')](_[_0x38dd('0x3b')](_0x408736['query'],_0x5d3eb8[_0x38dd('0x33')]),_0x3ab91c);if(_0x408736[_0x38dd('0x31')][_0x38dd('0x3c')]){_0x138c08[_0x38dd('0x3a')]=_[_0x38dd('0x3d')](_0x138c08['where'],{'$or':_[_0x38dd('0x2d')](_0x3ab91c,function(_0x2a7b6d){if(_0x2a7b6d[_0x38dd('0x2f')]!==_0x38dd('0x3e')){var _0x70dfc6={};_0x70dfc6[_0x2a7b6d['name']]={'$like':'%'+_0x408736['query'][_0x38dd('0x3c')]+'%'};return _0x70dfc6;}})});}_0x138c08=_[_0x38dd('0x3d')]({},_0x138c08,_0x408736[_0x38dd('0x3f')]);var _0x4fa3fa={'where':_0x138c08[_0x38dd('0x3a')]};return db[_0x38dd('0x40')][_0x38dd('0x1f')](_0x4fa3fa)[_0x38dd('0x25')](function(_0x462ae5){_0x108fcf[_0x38dd('0x1f')]=_0x462ae5;if(_0x408736['query'][_0x38dd('0x41')]){_0x138c08['include']=[{'all':!![]}];}return db['FaxQueue'][_0x38dd('0x42')](_0x138c08);})[_0x38dd('0x25')](function(_0x541cc8){_0x108fcf[_0x38dd('0x43')]=_0x541cc8;return _0x108fcf;})[_0x38dd('0x25')](respondWithFilteredResult(_0x58fb5b,_0x138c08))['catch'](handleError(_0x58fb5b,null));};exports['show']=function(_0x350e61,_0x1c76a2){var _0x3940ce={'raw':!![],'where':{'id':_0x350e61[_0x38dd('0x44')]['id']}},_0x2e75fc={};_0x2e75fc[_0x38dd('0x30')]=_[_0x38dd('0x32')](db['FaxQueue'][_0x38dd('0x45')]);_0x2e75fc['query']=_[_0x38dd('0x32')](_0x350e61['query']);_0x2e75fc[_0x38dd('0x33')]=_[_0x38dd('0x35')](_0x2e75fc['model'],_0x2e75fc[_0x38dd('0x31')]);_0x3940ce[_0x38dd('0x34')]=_[_0x38dd('0x35')](_0x2e75fc[_0x38dd('0x30')],qs[_0x38dd('0x46')](_0x350e61['query'][_0x38dd('0x46')]));_0x3940ce[_0x38dd('0x34')]=_0x3940ce[_0x38dd('0x34')]['length']?_0x3940ce[_0x38dd('0x34')]:_0x2e75fc[_0x38dd('0x30')];if(_0x350e61[_0x38dd('0x31')][_0x38dd('0x41')]){_0x3940ce[_0x38dd('0x47')]=[{'all':!![]}];}_0x3940ce=_[_0x38dd('0x3d')]({},_0x3940ce,_0x350e61[_0x38dd('0x3f')]);return db[_0x38dd('0x40')]['find'](_0x3940ce)[_0x38dd('0x25')](handleEntityNotFound(_0x1c76a2,null))[_0x38dd('0x25')](respondWithResult(_0x1c76a2,null))['catch'](handleError(_0x1c76a2,null));};exports['create']=function(_0x5596f1,_0x2ea910){return db[_0x38dd('0x40')][_0x38dd('0x48')](_0x5596f1[_0x38dd('0x49')],{})[_0x38dd('0x25')](function(_0x1db88c){var _0x5a26b6=_0x5596f1[_0x38dd('0x4a')][_0x38dd('0x27')]({'plain':!![]});if(!_0x5a26b6)throw new Error(_0x38dd('0x4b'));if(_0x5a26b6['role']===_0x38dd('0x4a')){var _0x2d849c=_0x1db88c['get']({'plain':!![]});var _0x22ab46=_0x38dd('0x28');return db[_0x38dd('0x4c')][_0x38dd('0x4d')]({'where':{'name':_0x22ab46,'userProfileId':_0x5a26b6[_0x38dd('0x4e')]},'raw':!![]})[_0x38dd('0x25')](function(_0x5bdc6c){if(_0x5bdc6c&&_0x5bdc6c[_0x38dd('0x4f')]===0x0){return db[_0x38dd('0x50')][_0x38dd('0x48')]({'name':_0x2d849c[_0x38dd('0x2b')],'resourceId':_0x2d849c['id'],'type':_0x5bdc6c[_0x38dd('0x2b')],'sectionId':_0x5bdc6c['id']},{})[_0x38dd('0x25')](function(){return _0x1db88c;});}else{return _0x1db88c;}})[_0x38dd('0x51')](function(_0x547607){logger[_0x38dd('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x547607);throw _0x547607;});}return _0x1db88c;})[_0x38dd('0x25')](respondWithResult(_0x2ea910,0xc9))[_0x38dd('0x51')](handleError(_0x2ea910,null));};exports[_0x38dd('0x24')]=function(_0x3b7cae,_0x157533){if(_0x3b7cae[_0x38dd('0x49')]['id']){delete _0x3b7cae[_0x38dd('0x49')]['id'];}return db[_0x38dd('0x40')][_0x38dd('0x4d')]({'where':{'id':_0x3b7cae['params']['id']}})[_0x38dd('0x25')](handleEntityNotFound(_0x157533,null))[_0x38dd('0x25')](saveUpdates(_0x3b7cae[_0x38dd('0x49')],null))[_0x38dd('0x25')](respondWithResult(_0x157533,null))[_0x38dd('0x51')](handleError(_0x157533,null));};exports['destroy']=function(_0x123c21,_0x51d2ad){return db[_0x38dd('0x40')][_0x38dd('0x4d')]({'where':{'id':_0x123c21[_0x38dd('0x44')]['id']}})[_0x38dd('0x25')](handleEntityNotFound(_0x51d2ad,null))[_0x38dd('0x25')](removeEntity(_0x51d2ad,null))[_0x38dd('0x51')](handleError(_0x51d2ad,null));};exports[_0x38dd('0x52')]=function(_0x2985a3,_0x7703f1){return db[_0x38dd('0x40')][_0x38dd('0x52')]()['then'](respondWithResult(_0x7703f1,null))[_0x38dd('0x51')](handleError(_0x7703f1,null));};exports[_0x38dd('0x53')]=function(_0x23440a,_0x5b4b5d,_0x4c8944){var _0x2962c8={'raw':!![],'where':{}},_0x194e7b={},_0x60ae3;return db[_0x38dd('0x40')][_0x38dd('0x54')]({'where':{'id':_0x23440a[_0x38dd('0x44')]['id']}})[_0x38dd('0x25')](handleEntityNotFound(_0x5b4b5d,null))['then'](function(_0x11410f){if(_0x11410f){_0x60ae3=_0x11410f[_0x38dd('0x27')]({'plain':!![]});_0x194e7b['model']=_[_0x38dd('0x32')](db[_0x38dd('0x55')][_0x38dd('0x45')]);_0x194e7b[_0x38dd('0x31')]=_['keys'](_0x23440a[_0x38dd('0x31')]);_0x194e7b[_0x38dd('0x33')]=_[_0x38dd('0x35')](_0x194e7b[_0x38dd('0x30')],_0x194e7b[_0x38dd('0x31')]);_0x2962c8[_0x38dd('0x34')]=_[_0x38dd('0x35')](_0x194e7b[_0x38dd('0x30')],qs[_0x38dd('0x46')](_0x23440a[_0x38dd('0x31')][_0x38dd('0x46')]));_0x2962c8['attributes']=_0x2962c8['attributes']['length']?_0x2962c8[_0x38dd('0x34')]:_0x194e7b[_0x38dd('0x30')];if(!_0x23440a['query'][_0x38dd('0x37')]('nolimit')){_0x2962c8[_0x38dd('0x1d')]=qs[_0x38dd('0x1d')](_0x23440a['query'][_0x38dd('0x1d')]);_0x2962c8[_0x38dd('0x1c')]=qs[_0x38dd('0x1c')](_0x23440a[_0x38dd('0x31')][_0x38dd('0x1c')]);}_0x2962c8['order']=qs['sort'](_0x23440a['query'][_0x38dd('0x39')]);_0x2962c8[_0x38dd('0x3a')]=qs[_0x38dd('0x33')](_['pick'](_0x23440a[_0x38dd('0x31')],_0x194e7b['filters']));_0x2962c8['where'][_0x38dd('0x56')]=_0x11410f['id'];if(_0x23440a['query'][_0x38dd('0x3c')]){_0x2962c8['where']=_['merge'](_0x2962c8[_0x38dd('0x3a')],{'$or':_[_0x38dd('0x2d')](_0x2962c8[_0x38dd('0x34')],function(_0x4e57c2){var _0x34b9a3={};_0x34b9a3[_0x4e57c2]={'$like':'%'+_0x23440a['query'][_0x38dd('0x3c')]+'%'};return _0x34b9a3;})});}_0x2962c8=_[_0x38dd('0x3d')]({},_0x2962c8,_0x23440a[_0x38dd('0x3f')]);return db['UserFaxQueue'][_0x38dd('0x42')](_0x2962c8);}})[_0x38dd('0x25')](function(_0x1cf847){if(_0x1cf847){return db[_0x38dd('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x1cf847,'UserId'),'role':'agent'},'attributes':['id',_0x38dd('0x2b'),_0x38dd('0x58'),'updatedAt','createdAt']});}})['then'](function(_0x37a409){if(_0x37a409){return{'count':_0x37a409[_0x38dd('0x1f')],'rows':_[_0x38dd('0x2d')](_0x37a409['rows'],function(_0x4f91d7){return{'membername':_0x4f91d7['name'],'UserId':_0x4f91d7['id'],'queue_name':_0x60ae3['name'],'FaxQueueId':_0x60ae3['id'],'interface':util[_0x38dd('0x59')]('%s/%s',_0x38dd('0x5a'),_0x4f91d7[_0x38dd('0x2b')]),'penalty':0x0,'paused':_0x4f91d7[_0x38dd('0x58')],'createdAt':_0x4f91d7[_0x38dd('0x5b')],'updatedAt':_0x4f91d7[_0x38dd('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5b4b5d,_0x2962c8))[_0x38dd('0x51')](handleError(_0x5b4b5d,null));};exports[_0x38dd('0x5d')]=function(_0x5941e5,_0xdd3ce2,_0x26e228){var _0x3ac8b3={};var _0x1321ea={};var _0xbcb4ff;var _0x26f10e;return db[_0x38dd('0x40')][_0x38dd('0x54')]({'where':{'id':_0x5941e5[_0x38dd('0x44')]['id']}})[_0x38dd('0x25')](handleEntityNotFound(_0xdd3ce2,null))[_0x38dd('0x25')](function(_0x13a7a8){if(_0x13a7a8){_0xbcb4ff=_0x13a7a8;_0x1321ea['model']=_[_0x38dd('0x32')](db['Team'][_0x38dd('0x45')]);_0x1321ea[_0x38dd('0x31')]=_[_0x38dd('0x32')](_0x5941e5[_0x38dd('0x31')]);_0x1321ea[_0x38dd('0x33')]=_[_0x38dd('0x35')](_0x1321ea[_0x38dd('0x30')],_0x1321ea[_0x38dd('0x31')]);_0x3ac8b3[_0x38dd('0x34')]=_[_0x38dd('0x35')](_0x1321ea[_0x38dd('0x30')],qs[_0x38dd('0x46')](_0x5941e5[_0x38dd('0x31')][_0x38dd('0x46')]));_0x3ac8b3['attributes']=_0x3ac8b3[_0x38dd('0x34')]['length']?_0x3ac8b3[_0x38dd('0x34')]:_0x1321ea[_0x38dd('0x30')];_0x3ac8b3['order']=qs['sort'](_0x5941e5['query'][_0x38dd('0x39')]);_0x3ac8b3[_0x38dd('0x3a')]=qs['filters'](_[_0x38dd('0x3b')](_0x5941e5[_0x38dd('0x31')],_0x1321ea['filters']));if(_0x5941e5[_0x38dd('0x31')][_0x38dd('0x3c')]){_0x3ac8b3['where']=_[_0x38dd('0x3d')](_0x3ac8b3[_0x38dd('0x3a')],{'$or':_[_0x38dd('0x2d')](_0x3ac8b3[_0x38dd('0x34')],function(_0x51d1f4){var _0x4a5511={};_0x4a5511[_0x51d1f4]={'$like':'%'+_0x5941e5['query'][_0x38dd('0x3c')]+'%'};return _0x4a5511;})});}_0x3ac8b3=_[_0x38dd('0x3d')]({},_0x3ac8b3,_0x5941e5[_0x38dd('0x3f')]);return _0xbcb4ff[_0x38dd('0x5d')](_0x3ac8b3);}})[_0x38dd('0x25')](function(_0x59c3c4){if(_0x59c3c4){_0x26f10e=_0x59c3c4['length'];if(!_0x5941e5['query'][_0x38dd('0x37')](_0x38dd('0x5e'))){_0x3ac8b3[_0x38dd('0x1d')]=qs[_0x38dd('0x1d')](_0x5941e5[_0x38dd('0x31')][_0x38dd('0x1d')]);_0x3ac8b3[_0x38dd('0x1c')]=qs[_0x38dd('0x1c')](_0x5941e5[_0x38dd('0x31')][_0x38dd('0x1c')]);}return _0xbcb4ff[_0x38dd('0x5d')](_0x3ac8b3);}})[_0x38dd('0x25')](function(_0x1a52f4){if(_0x1a52f4){return _0x1a52f4?{'count':_0x26f10e,'rows':_0x1a52f4}:null;}})[_0x38dd('0x25')](respondWithResult(_0xdd3ce2,null))[_0x38dd('0x51')](handleError(_0xdd3ce2,null));};exports[_0x38dd('0x5f')]=function(_0x3402d6,_0x38b4d9,_0x5c66c6){var _0x3f4967=_0x3402d6[_0x38dd('0x49')]['ids'];return db[_0x38dd('0x60')][_0x38dd('0x42')]({'where':{'id':_0x3f4967},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x38dd('0x61'),'voicePause',_0x38dd('0x62')],'raw':!![]}]})[_0x38dd('0x25')](function(_0x5897a1){if(_0x5897a1){var _0x3c175d=_['flatMap'](_0x5897a1,function(_0x344d8e){var _0x4d49b8=_0x344d8e[_0x38dd('0x27')]({'plain':!![]});return _0x4d49b8['Agents'];});return db[_0x38dd('0x40')][_0x38dd('0x4d')]({'where':{'id':_0x3402d6[_0x38dd('0x44')]['id']}})[_0x38dd('0x25')](function(_0x2ab0d9){return db['sequelize'][_0x38dd('0x63')](function(_0x14f95f){return _0x2ab0d9[_0x38dd('0x5f')](_0x3f4967,{'transaction':_0x14f95f})[_0x38dd('0x25')](function(){return BPromise[_0x38dd('0x64')](_0x3c175d,function(_0x26b71d){return db[_0x38dd('0x55')][_0x38dd('0x65')]({'where':{'UserId':_0x26b71d['id'],'FaxQueueId':_0x3402d6['params']['id']},'transaction':_0x14f95f});});})[_0x38dd('0x25')](function(){_0x3c175d[_0x38dd('0x66')](function(_0x466fd4){socket[_0x38dd('0x67')]('userFaxQueue:save',{'UserId':_0x466fd4['id'],'FaxQueueId':_0x2ab0d9['id']});});});});});}})[_0x38dd('0x25')](respondWithStatusCode(_0x38b4d9,null))['catch'](handleError(_0x38b4d9,null));};exports[_0x38dd('0x68')]=function(_0x40578e,_0x36cd1e,_0x21b36f){return db[_0x38dd('0x60')][_0x38dd('0x42')]({'where':{'id':_0x40578e[_0x38dd('0x31')][_0x38dd('0x69')]},'attributes':['id'],'include':[{'model':db[_0x38dd('0x57')],'as':_0x38dd('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x38dd('0x25')](handleEntityNotFound(_0x36cd1e,null))[_0x38dd('0x25')](function(_0x5bdb6d){var _0x58c8be=_['map'](_0x5bdb6d,'id');var _0x3b7ca5=[];var _0xbe28d1=[];var _0x4f0e22=squel['select']();_0x4f0e22[_0x38dd('0x6b')]('tq.TeamId')['from']('team_has_fax_queues','tq')[_0x38dd('0x6c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x38dd('0x3a')](_0x38dd('0x6d'),_0x40578e['params']['id']);for(var _0xd902fb=0x0;_0xd902fb<_0x5bdb6d['length'];_0xd902fb+=0x1){let _0x334de5=_0x5bdb6d[_0xd902fb];for(var _0x3905d0=0x0;_0x3905d0<_0x334de5[_0x38dd('0x6a')][_0x38dd('0x36')];_0x3905d0+=0x1){let _0x36c8f7=_0x334de5[_0x38dd('0x6a')][_0x3905d0];var _0x3b2167=_0x4f0e22[_0x38dd('0x6e')]();_0x3b2167[_0x38dd('0x3a')]('ut.UserId\x20=\x20?',_0x36c8f7['id']);_0xbe28d1[_0x38dd('0x6f')](db[_0x38dd('0x70')]['query'](_0x3b2167[_0x38dd('0x71')](),{'type':db[_0x38dd('0x70')][_0x38dd('0x72')][_0x38dd('0x73')]})[_0x38dd('0x25')](function(_0x3128d5){if(_0x3128d5[_0x38dd('0x36')]===0x1){return _0x36c8f7['id'];}else{var _0x2c3f53=_['every'](_[_0x38dd('0x2d')](_0x3128d5,_0x38dd('0x74')),function(_0xf1fa12){return _[_0x38dd('0x75')](_0x58c8be,_0xf1fa12);});if(_0x2c3f53){return _0x36c8f7['id'];}}}));}}return BPromise['all'](_0xbe28d1)[_0x38dd('0x25')](function(_0x9a762e){_0x3b7ca5=_(_0x3b7ca5)[_0x38dd('0x76')](_0x9a762e)[_0x38dd('0x77')]()['value']();return db[_0x38dd('0x40')][_0x38dd('0x4d')]({'where':{'id':_0x40578e[_0x38dd('0x44')]['id']}})[_0x38dd('0x25')](function(_0x40f33a){return db['sequelize'][_0x38dd('0x63')](function(_0x1c61df){return _0x40f33a['removeTeams'](_0x40578e[_0x38dd('0x31')][_0x38dd('0x69')],{'transaction':_0x1c61df})[_0x38dd('0x25')](function(){if(!_[_0x38dd('0x78')](_0x3b7ca5)){return _0x40f33a[_0x38dd('0x79')](_0x3b7ca5,{'transaction':_0x1c61df});}})[_0x38dd('0x25')](function(){_0x3b7ca5[_0x38dd('0x66')](function(_0x3c7a97){socket[_0x38dd('0x67')](_0x38dd('0x7a'),{'UserId':_0x3c7a97,'FaxQueueId':_0x40f33a['id']});});});});});});})[_0x38dd('0x25')](respondWithStatusCode(_0x36cd1e,null))[_0x38dd('0x51')](handleError(_0x36cd1e,null));};exports[_0x38dd('0x7b')]=function(_0x1021e3,_0x3c2a4b,_0x1a6877){return db[_0x38dd('0x40')]['find']({'where':{'id':_0x1021e3[_0x38dd('0x44')]['id']}})[_0x38dd('0x25')](handleEntityNotFound(_0x3c2a4b,null))[_0x38dd('0x25')](function(_0x196f24){if(_0x196f24){return _0x196f24['addAgents'](_0x1021e3[_0x38dd('0x49')][_0x38dd('0x69')],_[_0x38dd('0x7c')](_0x1021e3[_0x38dd('0x49')],[_0x38dd('0x69'),'id'])||{})[_0x38dd('0x7d')](function(_0x533133){for(var _0x4ee627=0x0;_0x4ee627<_0x1021e3[_0x38dd('0x49')][_0x38dd('0x69')][_0x38dd('0x36')];_0x4ee627+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x1021e3[_0x38dd('0x49')][_0x38dd('0x69')][_0x4ee627]),'FaxQueueId':Number(_0x1021e3['params']['id'])});}return _0x533133;});}})[_0x38dd('0x25')](respondWithResult(_0x3c2a4b,null))[_0x38dd('0x51')](handleError(_0x3c2a4b,null));};exports['removeAgents']=function(_0x3a34eb,_0x5748e0,_0x1254b8){return db[_0x38dd('0x40')][_0x38dd('0x4d')]({'where':{'id':_0x3a34eb[_0x38dd('0x44')]['id']}})[_0x38dd('0x25')](handleEntityNotFound(_0x5748e0,null))[_0x38dd('0x25')](function(_0x2ea9fb){if(_0x2ea9fb){return _0x2ea9fb[_0x38dd('0x79')](_0x3a34eb[_0x38dd('0x31')][_0x38dd('0x69')])['then'](function(){if(_[_0x38dd('0x7e')](_0x3a34eb[_0x38dd('0x31')][_0x38dd('0x69')])){for(var _0x24891a=0x0;_0x24891a<_0x3a34eb[_0x38dd('0x31')][_0x38dd('0x69')][_0x38dd('0x36')];_0x24891a+=0x1){socket[_0x38dd('0x67')](_0x38dd('0x7a'),{'UserId':Number(_0x3a34eb[_0x38dd('0x31')][_0x38dd('0x69')][_0x24891a]),'FaxQueueId':Number(_0x3a34eb[_0x38dd('0x44')]['id'])});}}else{socket[_0x38dd('0x67')](_0x38dd('0x7a'),{'UserId':Number(_0x3a34eb[_0x38dd('0x31')][_0x38dd('0x69')]),'FaxQueueId':Number(_0x3a34eb[_0x38dd('0x44')]['id'])});}});}})[_0x38dd('0x25')](respondWithStatusCode(_0x5748e0,null))[_0x38dd('0x51')](handleError(_0x5748e0,null));};exports[_0x38dd('0x7f')]=function(_0x4d309e,_0x19cc35,_0x47473d){var _0x139418={};var _0x63b9ee={};var _0x2d63fa;var _0x26385d;return db[_0x38dd('0x40')]['findOne']({'where':{'id':_0x4d309e[_0x38dd('0x44')]['id']}})['then'](handleEntityNotFound(_0x19cc35,null))[_0x38dd('0x25')](function(_0x5cde7b){if(_0x5cde7b){_0x2d63fa=_0x5cde7b;_0x63b9ee[_0x38dd('0x30')]=_[_0x38dd('0x32')](db[_0x38dd('0x57')][_0x38dd('0x45')]);_0x63b9ee[_0x38dd('0x31')]=_[_0x38dd('0x32')](_0x4d309e[_0x38dd('0x31')]);_0x63b9ee[_0x38dd('0x33')]=_[_0x38dd('0x35')](_0x63b9ee[_0x38dd('0x30')],_0x63b9ee['query']);_0x139418['attributes']=_[_0x38dd('0x35')](_0x63b9ee[_0x38dd('0x30')],qs[_0x38dd('0x46')](_0x4d309e[_0x38dd('0x31')][_0x38dd('0x46')]));_0x139418[_0x38dd('0x34')]=_0x139418[_0x38dd('0x34')]['length']?_0x139418[_0x38dd('0x34')]:_0x63b9ee[_0x38dd('0x30')];_0x139418['order']=qs[_0x38dd('0x39')](_0x4d309e[_0x38dd('0x31')][_0x38dd('0x39')]);_0x139418[_0x38dd('0x3a')]=qs['filters'](_[_0x38dd('0x3b')](_0x4d309e[_0x38dd('0x31')],_0x63b9ee[_0x38dd('0x33')]));if(_0x4d309e[_0x38dd('0x31')]['filter']){_0x139418[_0x38dd('0x3a')]=_[_0x38dd('0x3d')](_0x139418[_0x38dd('0x3a')],{'$or':_['map'](_0x139418[_0x38dd('0x34')],function(_0x200da7){var _0x49142f={};_0x49142f[_0x200da7]={'$like':'%'+_0x4d309e['query'][_0x38dd('0x3c')]+'%'};return _0x49142f;})});}_0x139418=_[_0x38dd('0x3d')]({},_0x139418,_0x4d309e[_0x38dd('0x3f')]);return _0x2d63fa[_0x38dd('0x7f')](_0x139418);}})[_0x38dd('0x25')](function(_0x1f85af){if(_0x1f85af){_0x26385d=_0x1f85af[_0x38dd('0x36')];if(!_0x4d309e['query'][_0x38dd('0x37')](_0x38dd('0x5e'))){_0x139418[_0x38dd('0x1d')]=qs[_0x38dd('0x1d')](_0x4d309e[_0x38dd('0x31')][_0x38dd('0x1d')]);_0x139418[_0x38dd('0x1c')]=qs[_0x38dd('0x1c')](_0x4d309e[_0x38dd('0x31')][_0x38dd('0x1c')]);}return _0x2d63fa['getAgents'](_0x139418);}})[_0x38dd('0x25')](function(_0xecf41e){if(_0xecf41e){return _0xecf41e?{'count':_0x26385d,'rows':_0xecf41e}:null;}})[_0x38dd('0x25')](respondWithResult(_0x19cc35,null))[_0x38dd('0x51')](handleError(_0x19cc35,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 34f54fa..c6617e3 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 _0x3636=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue'];(function(_0x3bf36d,_0x271147){var _0x1dd0f3=function(_0x3a8204){while(--_0x3a8204){_0x3bf36d['push'](_0x3bf36d['shift']());}};_0x1dd0f3(++_0x271147);}(_0x3636,0x9d));var _0x6363=function(_0x69fc27,_0x13cb80){_0x69fc27=_0x69fc27-0x0;var _0x30c074=_0x3636[_0x69fc27];return _0x30c074;};'use strict';var EventEmitter=require(_0x6363('0x0'));var FaxQueue=require(_0x6363('0x1'))['db'][_0x6363('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6363('0x3'),'afterUpdate':_0x6363('0x4'),'afterDestroy':_0x6363('0x5')};function emitEvent(_0x366431){return function(_0x50fb03,_0xbbb193,_0x2f4585){FaxQueueEvents[_0x6363('0x6')](_0x366431+':'+_0x50fb03['id'],_0x50fb03);FaxQueueEvents[_0x6363('0x6')](_0x366431,_0x50fb03);_0x2f4585(null);};}for(var e in events){if(events[_0x6363('0x7')](e)){var event=events[e];FaxQueue[_0x6363('0x8')](e,emitEvent(event));}}module[_0x6363('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x91d8=['hook','exports','events','../../mysqldb','FaxQueue','save','remove','emit','hasOwnProperty'];(function(_0x25ea64,_0x1e7d23){var _0x5aa283=function(_0x21b199){while(--_0x21b199){_0x25ea64['push'](_0x25ea64['shift']());}};_0x5aa283(++_0x1e7d23);}(_0x91d8,0xf5));var _0x891d=function(_0x548412,_0x3d753c){_0x548412=_0x548412-0x0;var _0x43497f=_0x91d8[_0x548412];return _0x43497f;};'use strict';var EventEmitter=require(_0x891d('0x0'));var FaxQueue=require(_0x891d('0x1'))['db'][_0x891d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x891d('0x3'),'afterUpdate':'update','afterDestroy':_0x891d('0x4')};function emitEvent(_0xa7957f){return function(_0x276a90,_0x4dcc44,_0x59afc4){FaxQueueEvents[_0x891d('0x5')](_0xa7957f+':'+_0x276a90['id'],_0x276a90);FaxQueueEvents['emit'](_0xa7957f,_0x276a90);_0x59afc4(null);};}for(var e in events){if(events[_0x891d('0x6')](e)){var event=events[e];FaxQueue[_0x891d('0x7')](e,emitEvent(event));}}module[_0x891d('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 3bca332..40ce52d 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 _0xf095=['exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0xf095,0x17e));var _0x5f09=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0xf095[_0x3932eb];return _0x5316e5;};'use strict';var _=require(_0x5f09('0x0'));var util=require(_0x5f09('0x1'));var logger=require(_0x5f09('0x2'))(_0x5f09('0x3'));var moment=require('moment');var BPromise=require(_0x5f09('0x4'));var rp=require(_0x5f09('0x5'));var fs=require('fs');var path=require(_0x5f09('0x6'));var rimraf=require(_0x5f09('0x7'));var config=require(_0x5f09('0x8'));var attributes=require(_0x5f09('0x9'));module[_0x5f09('0xa')]=function(_0x419057,_0x5f4dcf){return _0x419057[_0x5f09('0xb')](_0x5f09('0xc'),attributes,{'tableName':_0x5f09('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbb6=['fax_queues','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','define','FaxQueue'];(function(_0x2668a3,_0x2876d8){var _0x4f6dca=function(_0x44a87a){while(--_0x44a87a){_0x2668a3['push'](_0x2668a3['shift']());}};_0x4f6dca(++_0x2876d8);}(_0xdbb6,0xdd));var _0x6dbb=function(_0x4892c2,_0x58bff9){_0x4892c2=_0x4892c2-0x0;var _0x27aab5=_0xdbb6[_0x4892c2];return _0x27aab5;};'use strict';var _=require('lodash');var util=require(_0x6dbb('0x0'));var logger=require(_0x6dbb('0x1'))('api');var moment=require(_0x6dbb('0x2'));var BPromise=require(_0x6dbb('0x3'));var rp=require(_0x6dbb('0x4'));var fs=require('fs');var path=require(_0x6dbb('0x5'));var rimraf=require('rimraf');var config=require(_0x6dbb('0x6'));var attributes=require(_0x6dbb('0x7'));module['exports']=function(_0x4d7dbe,_0x57aa74){return _0x4d7dbe[_0x6dbb('0x8')](_0x6dbb('0x9'),attributes,{'tableName':_0x6dbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 980a4e0..5d110fa 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 _0x1cb6=['socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','GetFaxQueue','debug','stringify','catch','ShowFaxQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost'];(function(_0x216a49,_0x56bb7d){var _0x53c185=function(_0x35f017){while(--_0x35f017){_0x216a49['push'](_0x216a49['shift']());}};_0x53c185(++_0x56bb7d);}(_0x1cb6,0x99));var _0x61cb=function(_0x5edbb7,_0x1b10a5){_0x5edbb7=_0x5edbb7-0x0;var _0x23f2cd=_0x1cb6[_0x5edbb7];return _0x23f2cd;};'use strict';var _=require(_0x61cb('0x0'));var util=require(_0x61cb('0x1'));var moment=require('moment');var BPromise=require(_0x61cb('0x2'));var rs=require(_0x61cb('0x3'));var fs=require('fs');var Redis=require(_0x61cb('0x4'));var db=require(_0x61cb('0x5'))['db'];var utils=require(_0x61cb('0x6'));var logger=require(_0x61cb('0x7'))(_0x61cb('0x8'));var config=require(_0x61cb('0x9'));var jayson=require(_0x61cb('0xa'));var client=jayson['client'][_0x61cb('0xb')]({'port':0x232a});config['redis']=_[_0x61cb('0xc')](config[_0x61cb('0xd')],{'host':_0x61cb('0xe'),'port':0x18eb});var socket=require(_0x61cb('0xf'))(new Redis(config[_0x61cb('0xd')]));require(_0x61cb('0x10'))[_0x61cb('0x11')](socket);function respondWithRpcPromise(_0x5004e0,_0x4b2428,_0x33d0d0){return new BPromise(function(_0x20cf23,_0x236771){return client['request'](_0x5004e0,_0x33d0d0)[_0x61cb('0x12')](function(_0x5ddf54){logger['info'](_0x61cb('0x13'),_0x4b2428,_0x61cb('0x14'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x4b2428,_0x61cb('0x14'),JSON['stringify'](_0x5ddf54));if(_0x5ddf54[_0x61cb('0x15')]){if(_0x5ddf54[_0x61cb('0x15')][_0x61cb('0x16')]===0x1f4){logger[_0x61cb('0x15')](_0x61cb('0x13'),_0x4b2428,_0x5ddf54[_0x61cb('0x15')][_0x61cb('0x17')]);return _0x236771(_0x5ddf54[_0x61cb('0x15')][_0x61cb('0x17')]);}logger[_0x61cb('0x15')](_0x61cb('0x13'),_0x4b2428,_0x5ddf54[_0x61cb('0x15')][_0x61cb('0x17')]);return _0x20cf23(_0x5ddf54[_0x61cb('0x15')][_0x61cb('0x17')]);}else{logger['info'](_0x61cb('0x13'),_0x4b2428,_0x61cb('0x14'));_0x20cf23(_0x5ddf54[_0x61cb('0x18')][_0x61cb('0x17')]);}})['catch'](function(_0x2dced0){logger['error'](_0x61cb('0x13'),_0x4b2428,_0x2dced0);_0x236771(_0x2dced0);});});}exports['GetFaxQueue']=function(_0x2dd0a0){var _0x1c0017=this;return new Promise(function(_0x418322,_0x5bab49){return db[_0x61cb('0x19')][_0x61cb('0x1a')]({'raw':_0x2dd0a0[_0x61cb('0x1b')]?_0x2dd0a0[_0x61cb('0x1b')][_0x61cb('0x1c')]===undefined?!![]:![]:!![],'where':_0x2dd0a0['options']?_0x2dd0a0[_0x61cb('0x1b')][_0x61cb('0x1d')]||null:null,'attributes':_0x2dd0a0[_0x61cb('0x1b')]?_0x2dd0a0[_0x61cb('0x1b')][_0x61cb('0x1e')]||null:null,'limit':_0x2dd0a0[_0x61cb('0x1b')]?_0x2dd0a0[_0x61cb('0x1b')][_0x61cb('0x1f')]||null:null,'include':_0x2dd0a0[_0x61cb('0x1b')]?_0x2dd0a0['options'][_0x61cb('0x20')]?_[_0x61cb('0x21')](_0x2dd0a0[_0x61cb('0x1b')][_0x61cb('0x20')],function(_0x2cab71){return{'model':db[_0x2cab71['model']],'as':_0x2cab71['as'],'attributes':_0x2cab71[_0x61cb('0x1e')],'include':_0x2cab71[_0x61cb('0x20')]?_['map'](_0x2cab71[_0x61cb('0x20')],function(_0x135462){return{'model':db[_0x135462[_0x61cb('0x22')]],'as':_0x135462['as'],'attributes':_0x135462[_0x61cb('0x1e')],'include':_0x135462[_0x61cb('0x20')]?_[_0x61cb('0x21')](_0x135462['include'],function(_0x3c3004){return{'model':db[_0x3c3004[_0x61cb('0x22')]],'as':_0x3c3004['as'],'attributes':_0x3c3004[_0x61cb('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbebe21){logger[_0x61cb('0x23')](_0x61cb('0x24'),_0x2dd0a0);logger[_0x61cb('0x25')](_0x61cb('0x24'),_0x2dd0a0,JSON[_0x61cb('0x26')](_0xbebe21));_0x418322(_0xbebe21);})[_0x61cb('0x27')](function(_0x49b3e9){logger[_0x61cb('0x15')](_0x61cb('0x24'),_0x49b3e9['message'],_0x2dd0a0);_0x5bab49(_0x1c0017[_0x61cb('0x15')](0x1f4,_0x49b3e9['message']));});});};exports[_0x61cb('0x28')]=function(_0x2db031){var _0x5741f9=this;return new Promise(function(_0x4be4e5,_0x1e44c7){return db[_0x61cb('0x19')][_0x61cb('0x29')]({'raw':_0x2db031[_0x61cb('0x1b')]?_0x2db031[_0x61cb('0x1b')][_0x61cb('0x1c')]===undefined?!![]:![]:!![],'where':_0x2db031[_0x61cb('0x1b')]?_0x2db031[_0x61cb('0x1b')][_0x61cb('0x1d')]||null:null,'attributes':_0x2db031[_0x61cb('0x1b')]?_0x2db031[_0x61cb('0x1b')]['attributes']||null:null,'include':_0x2db031['options']?_0x2db031[_0x61cb('0x1b')][_0x61cb('0x20')]?_[_0x61cb('0x21')](_0x2db031['options']['include'],function(_0xde45ff){return{'model':db[_0xde45ff[_0x61cb('0x22')]],'as':_0xde45ff['as'],'attributes':_0xde45ff[_0x61cb('0x1e')],'include':_0xde45ff[_0x61cb('0x20')]?_[_0x61cb('0x21')](_0xde45ff[_0x61cb('0x20')],function(_0x4b7dc4){return{'model':db[_0x4b7dc4[_0x61cb('0x22')]],'as':_0x4b7dc4['as'],'attributes':_0x4b7dc4[_0x61cb('0x1e')],'include':_0x4b7dc4[_0x61cb('0x20')]?_[_0x61cb('0x21')](_0x4b7dc4[_0x61cb('0x20')],function(_0x43645a){return{'model':db[_0x43645a[_0x61cb('0x22')]],'as':_0x43645a['as'],'attributes':_0x43645a[_0x61cb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x61cb('0x12')](function(_0x599212){logger['info'](_0x61cb('0x28'),_0x2db031);logger[_0x61cb('0x25')](_0x61cb('0x28'),_0x2db031,JSON[_0x61cb('0x26')](_0x599212));_0x4be4e5(_0x599212);})[_0x61cb('0x27')](function(_0x41a902){logger['error'](_0x61cb('0x28'),_0x41a902[_0x61cb('0x17')],_0x2db031);_0x1e44c7(_0x5741f9[_0x61cb('0x15')](0x1f4,_0x41a902[_0x61cb('0x17')]));});});}; \ No newline at end of file +var _0xd67e=['then','ShowFaxQueue','find','util','moment','ioredis','../../mysqldb','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxQueue','options','where','attributes','limit','include','map','model'];(function(_0x11c17c,_0x345842){var _0x2c72b5=function(_0x11e1db){while(--_0x11e1db){_0x11c17c['push'](_0x11c17c['shift']());}};_0x2c72b5(++_0x345842);}(_0xd67e,0xc9));var _0xed67=function(_0x43405f,_0x55a8a3){_0x43405f=_0x43405f-0x0;var _0x28075c=_0xd67e[_0x43405f];return _0x28075c;};'use strict';var _=require('lodash');var util=require(_0xed67('0x0'));var moment=require(_0xed67('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed67('0x2'));var db=require(_0xed67('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xed67('0x4'));var client=jayson['client'][_0xed67('0x5')]({'port':0x232a});config[_0xed67('0x6')]=_[_0xed67('0x7')](config[_0xed67('0x6')],{'host':_0xed67('0x8'),'port':0x18eb});var socket=require(_0xed67('0x9'))(new Redis(config[_0xed67('0x6')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x35259d,_0x4644b3,_0xba9dae){return new BPromise(function(_0x1d82d5,_0x3f9000){return client[_0xed67('0xa')](_0x35259d,_0xba9dae)['then'](function(_0x470fdb){logger['info'](_0xed67('0xb'),_0x4644b3,_0xed67('0xc'));logger[_0xed67('0xd')](_0xed67('0xe'),_0x4644b3,'request\x20sent',JSON[_0xed67('0xf')](_0x470fdb));if(_0x470fdb[_0xed67('0x10')]){if(_0x470fdb['error'][_0xed67('0x11')]===0x1f4){logger[_0xed67('0x10')](_0xed67('0xb'),_0x4644b3,_0x470fdb[_0xed67('0x10')]['message']);return _0x3f9000(_0x470fdb[_0xed67('0x10')][_0xed67('0x12')]);}logger['error'](_0xed67('0xb'),_0x4644b3,_0x470fdb[_0xed67('0x10')][_0xed67('0x12')]);return _0x1d82d5(_0x470fdb[_0xed67('0x10')]['message']);}else{logger[_0xed67('0x13')]('FaxQueue,\x20%s,\x20%s',_0x4644b3,_0xed67('0xc'));_0x1d82d5(_0x470fdb[_0xed67('0x14')][_0xed67('0x12')]);}})[_0xed67('0x15')](function(_0x2fe7f7){logger[_0xed67('0x10')](_0xed67('0xb'),_0x4644b3,_0x2fe7f7);_0x3f9000(_0x2fe7f7);});});}exports[_0xed67('0x16')]=function(_0x3b33a){var _0x511146=this;return new Promise(function(_0x262d89,_0x4bfeea){return db['FaxQueue']['findAll']({'raw':_0x3b33a[_0xed67('0x17')]?_0x3b33a[_0xed67('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3b33a[_0xed67('0x17')]?_0x3b33a[_0xed67('0x17')][_0xed67('0x18')]||null:null,'attributes':_0x3b33a[_0xed67('0x17')]?_0x3b33a[_0xed67('0x17')][_0xed67('0x19')]||null:null,'limit':_0x3b33a['options']?_0x3b33a[_0xed67('0x17')][_0xed67('0x1a')]||null:null,'include':_0x3b33a[_0xed67('0x17')]?_0x3b33a['options'][_0xed67('0x1b')]?_[_0xed67('0x1c')](_0x3b33a[_0xed67('0x17')][_0xed67('0x1b')],function(_0x5d338c){return{'model':db[_0x5d338c[_0xed67('0x1d')]],'as':_0x5d338c['as'],'attributes':_0x5d338c[_0xed67('0x19')],'include':_0x5d338c['include']?_[_0xed67('0x1c')](_0x5d338c[_0xed67('0x1b')],function(_0x39e8e6){return{'model':db[_0x39e8e6['model']],'as':_0x39e8e6['as'],'attributes':_0x39e8e6[_0xed67('0x19')],'include':_0x39e8e6[_0xed67('0x1b')]?_['map'](_0x39e8e6[_0xed67('0x1b')],function(_0x143388){return{'model':db[_0x143388[_0xed67('0x1d')]],'as':_0x143388['as'],'attributes':_0x143388[_0xed67('0x19')]};}):[]};}):[]};}):[]:[]})[_0xed67('0x1e')](function(_0x545137){logger[_0xed67('0x13')](_0xed67('0x16'),_0x3b33a);logger[_0xed67('0xd')](_0xed67('0x16'),_0x3b33a,JSON[_0xed67('0xf')](_0x545137));_0x262d89(_0x545137);})[_0xed67('0x15')](function(_0x54dd5a){logger[_0xed67('0x10')](_0xed67('0x16'),_0x54dd5a[_0xed67('0x12')],_0x3b33a);_0x4bfeea(_0x511146[_0xed67('0x10')](0x1f4,_0x54dd5a[_0xed67('0x12')]));});});};exports[_0xed67('0x1f')]=function(_0x17f9d2){var _0x1f84fb=this;return new Promise(function(_0x3f715f,_0x2dd631){return db['FaxQueue'][_0xed67('0x20')]({'raw':_0x17f9d2[_0xed67('0x17')]?_0x17f9d2[_0xed67('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x17f9d2[_0xed67('0x17')]?_0x17f9d2['options'][_0xed67('0x18')]||null:null,'attributes':_0x17f9d2[_0xed67('0x17')]?_0x17f9d2[_0xed67('0x17')][_0xed67('0x19')]||null:null,'include':_0x17f9d2[_0xed67('0x17')]?_0x17f9d2[_0xed67('0x17')][_0xed67('0x1b')]?_[_0xed67('0x1c')](_0x17f9d2['options'][_0xed67('0x1b')],function(_0x2775fc){return{'model':db[_0x2775fc[_0xed67('0x1d')]],'as':_0x2775fc['as'],'attributes':_0x2775fc[_0xed67('0x19')],'include':_0x2775fc[_0xed67('0x1b')]?_[_0xed67('0x1c')](_0x2775fc['include'],function(_0x5b2adf){return{'model':db[_0x5b2adf[_0xed67('0x1d')]],'as':_0x5b2adf['as'],'attributes':_0x5b2adf[_0xed67('0x19')],'include':_0x5b2adf['include']?_[_0xed67('0x1c')](_0x5b2adf[_0xed67('0x1b')],function(_0x22815d){return{'model':db[_0x22815d[_0xed67('0x1d')]],'as':_0x22815d['as'],'attributes':_0x22815d[_0xed67('0x19')]};}):[]};}):[]};}):[]:[]})[_0xed67('0x1e')](function(_0x48c3c3){logger[_0xed67('0x13')](_0xed67('0x1f'),_0x17f9d2);logger['debug'](_0xed67('0x1f'),_0x17f9d2,JSON['stringify'](_0x48c3c3));_0x3f715f(_0x48c3c3);})['catch'](function(_0x2b6e9e){logger['error'](_0xed67('0x1f'),_0x2b6e9e[_0xed67('0x12')],_0x17f9d2);_0x2dd631(_0x1f84fb[_0xed67('0x10')](0x1f4,_0x2b6e9e[_0xed67('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index d0eb992..4ed4da7 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 _0x6240=['save','remove','removeListener','register','faxQueue:','./faxQueue.events'];(function(_0x34b217,_0x2df3bb){var _0x4a59d0=function(_0x2d9136){while(--_0x2d9136){_0x34b217['push'](_0x34b217['shift']());}};_0x4a59d0(++_0x2df3bb);}(_0x6240,0xb3));var _0x0624=function(_0x58c374,_0x10c704){_0x58c374=_0x58c374-0x0;var _0x23d893=_0x6240[_0x58c374];return _0x23d893;};'use strict';var FaxQueueEvents=require(_0x0624('0x0'));var events=[_0x0624('0x1'),_0x0624('0x2'),'update'];function createListener(_0x246448,_0x246ba6){return function(_0x25625d){_0x246ba6['emit'](_0x246448,_0x25625d);};}function removeListener(_0x8c457b,_0x48cf9b){return function(){FaxQueueEvents[_0x0624('0x3')](_0x8c457b,_0x48cf9b);};}exports[_0x0624('0x4')]=function(_0x5da7ef){for(var _0x4efa99=0x0,_0x2f7949=events['length'];_0x4efa99<_0x2f7949;_0x4efa99++){var _0x18daa6=events[_0x4efa99];var _0x5942ef=createListener(_0x0624('0x5')+_0x18daa6,_0x5da7ef);FaxQueueEvents['on'](_0x18daa6,_0x5942ef);}}; \ No newline at end of file +var _0xc44c=['save','remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x18350a,_0x105fe4){var _0x33050e=function(_0x460c3f){while(--_0x460c3f){_0x18350a['push'](_0x18350a['shift']());}};_0x33050e(++_0x105fe4);}(_0xc44c,0xfb));var _0xcc44=function(_0x5bc1e8,_0x26ac75){_0x5bc1e8=_0x5bc1e8-0x0;var _0xb24517=_0xc44c[_0x5bc1e8];return _0xb24517;};'use strict';var FaxQueueEvents=require(_0xcc44('0x0'));var events=[_0xcc44('0x1'),_0xcc44('0x2'),_0xcc44('0x3')];function createListener(_0xd99277,_0x55459b){return function(_0xf30df1){_0x55459b[_0xcc44('0x4')](_0xd99277,_0xf30df1);};}function removeListener(_0x210e20,_0x1f1bce){return function(){FaxQueueEvents[_0xcc44('0x5')](_0x210e20,_0x1f1bce);};}exports[_0xcc44('0x6')]=function(_0x583bd0){for(var _0x3a770f=0x0,_0x35ce89=events[_0xcc44('0x7')];_0x3a770f<_0x35ce89;_0x3a770f++){var _0x49482a=events[_0x3a770f];var _0x2dba09=createListener(_0xcc44('0x8')+_0x49482a,_0x583bd0);FaxQueueEvents['on'](_0x49482a,_0x2dba09);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 1c9665d..f2fa6ca 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 _0xd046=['util','path','connect-timeout','Router','../../components/interaction/service','./faxQueue.controller','index','get','describe','show','/:id/members','/:id/teams','isAuthenticated','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeAgents','exports'];(function(_0x1a4afd,_0x1a5792){var _0x543f75=function(_0x5965c7){while(--_0x5965c7){_0x1a4afd['push'](_0x1a4afd['shift']());}};_0x543f75(++_0x1a5792);}(_0xd046,0x129));var _0x6d04=function(_0xfbdcac,_0x184089){_0xfbdcac=_0xfbdcac-0x0;var _0x432c0d=_0xd046[_0xfbdcac];return _0x432c0d;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['get'](_0x6d04('0xa'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x6d04('0xb'),auth[_0x6d04('0xc')](),controller[_0x6d04('0xd')]);router[_0x6d04('0x7')]('/:id/users',auth[_0x6d04('0xc')](),controller[_0x6d04('0xe')]);router[_0x6d04('0xf')]('/',auth[_0x6d04('0xc')](),controller[_0x6d04('0x10')]);router[_0x6d04('0xf')](_0x6d04('0xb'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x11')]);router[_0x6d04('0xf')](_0x6d04('0x12'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x13')]);router[_0x6d04('0x14')](_0x6d04('0x15'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x16')]);router[_0x6d04('0x17')](_0x6d04('0x15'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x18')]);router[_0x6d04('0x17')](_0x6d04('0xb'),auth[_0x6d04('0xc')](),controller['removeTeams']);router[_0x6d04('0x17')](_0x6d04('0x12'),auth[_0x6d04('0xc')](),controller[_0x6d04('0x19')]);module[_0x6d04('0x1a')]=router; \ No newline at end of file +var _0x11e5=['update','destroy','removeTeams','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11e5,0x8b));var _0x511e=function(_0x353c53,_0x2102c0){_0x353c53=_0x353c53-0x0;var _0x2c55da=_0x11e5[_0x353c53];return _0x2c55da;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var fs_extra=require(_0x511e('0x4'));var auth=require(_0x511e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x511e('0x6'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0x511e('0x7')](),controller[_0x511e('0x8')]);router[_0x511e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x511e('0xa')]);router[_0x511e('0x9')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0xc')]);router[_0x511e('0x9')](_0x511e('0xd'),auth[_0x511e('0x7')](),controller[_0x511e('0xe')]);router[_0x511e('0x9')](_0x511e('0xf'),auth['isAuthenticated'](),controller[_0x511e('0x10')]);router['get']('/:id/users',auth[_0x511e('0x7')](),controller[_0x511e('0x11')]);router[_0x511e('0x12')]('/',auth[_0x511e('0x7')](),controller[_0x511e('0x13')]);router[_0x511e('0x12')]('/:id/teams',auth[_0x511e('0x7')](),controller[_0x511e('0x14')]);router['post'](_0x511e('0x15'),auth[_0x511e('0x7')](),controller['addAgents']);router[_0x511e('0x16')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0x17')]);router['delete'](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0x18')]);router['delete'](_0x511e('0xf'),auth['isAuthenticated'](),controller[_0x511e('0x19')]);router['delete']('/:id/users',auth[_0x511e('0x7')](),controller['removeAgents']);module[_0x511e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 8de8cce..089ea61 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 _0xfb82=['exports','STRING','DATE','moment','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb82,0x17f));var _0x2fb8=function(_0x39f77f,_0x1ad772){_0x39f77f=_0x39f77f-0x0;var _0x4cb661=_0xfb82[_0x39f77f];return _0x4cb661;};'use strict';var moment=require(_0x2fb8('0x0'));var Sequelize=require(_0x2fb8('0x1'));module[_0x2fb8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2fb8('0x3')]},'joinAt':{'type':Sequelize[_0x2fb8('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2fb8('0x4')]},'exitAt':{'type':Sequelize[_0x2fb8('0x4')]},'reason':{'type':Sequelize[_0x2fb8('0x3')]}}; \ No newline at end of file +var _0x7a73=['DATE','moment','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a73,0x65));var _0x37a7=function(_0x38c128,_0x1459fe){_0x38c128=_0x38c128-0x0;var _0x4df2d5=_0x7a73[_0x38c128];return _0x4df2d5;};'use strict';var moment=require(_0x37a7('0x0'));var Sequelize=require(_0x37a7('0x1'));module[_0x37a7('0x2')]={'uniqueid':{'type':Sequelize[_0x37a7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x37a7('0x3')]},'joinAt':{'type':Sequelize[_0x37a7('0x4')]},'leaveAt':{'type':Sequelize[_0x37a7('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'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 ed15c72..7a75469 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 _0xd547=['reject','save','update','then','error','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range'];(function(_0x45b190,_0x6297da){var _0x46234d=function(_0x41f5ad){while(--_0x41f5ad){_0x45b190['push'](_0x45b190['shift']());}};_0x46234d(++_0x6297da);}(_0xd547,0x1c1));var _0x7d54=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xd547[_0x489b87];return _0x1823b6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d54('0x0'));var jsonpatch=require(_0x7d54('0x1'));var rp=require(_0x7d54('0x2'));var moment=require(_0x7d54('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d54('0x4'));var path=require('path');var sox=require(_0x7d54('0x5'));var csv=require('to-csv');var ejs=require(_0x7d54('0x6'));var fs=require('fs');var fs_extra=require(_0x7d54('0x7'));var _=require(_0x7d54('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7d54('0x9'));var toCsv=require(_0x7d54('0xa'));var querystring=require('querystring');var Papa=require(_0x7d54('0xb'));var Redis=require('ioredis');var authService=require(_0x7d54('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x7d54('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d54('0xe'))(_0x7d54('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7d54('0x10'))['db'];function respondWithStatusCode(_0x3e8072,_0x428430){_0x428430=_0x428430||0xcc;return function(_0x4be6c5){if(_0x4be6c5){return _0x3e8072[_0x7d54('0x11')](_0x428430);}return _0x3e8072['status'](_0x428430)[_0x7d54('0x12')]();};}function respondWithResult(_0x5e46ee,_0x11c94a){_0x11c94a=_0x11c94a||0xc8;return function(_0x43718a){if(_0x43718a){return _0x5e46ee['status'](_0x11c94a)[_0x7d54('0x13')](_0x43718a);}};}function respondWithFilteredResult(_0x208b3c,_0x25b69c){return function(_0x5a6bec){if(_0x5a6bec){var _0x2b1b0f=typeof _0x25b69c[_0x7d54('0x14')]===_0x7d54('0x15')&&typeof _0x25b69c[_0x7d54('0x16')]===_0x7d54('0x15');var _0x22f27c=_0x5a6bec['count'];var _0x81971b=_0x2b1b0f?0x0:_0x25b69c[_0x7d54('0x14')];var _0x57e789=_0x2b1b0f?_0x5a6bec[_0x7d54('0x17')]:_0x25b69c['offset']+_0x25b69c['limit'];var _0x46a719;if(_0x57e789>=_0x22f27c){_0x57e789=_0x22f27c;_0x46a719=0xc8;}else{_0x46a719=0xce;}_0x208b3c[_0x7d54('0x18')](_0x46a719);return _0x208b3c[_0x7d54('0x19')](_0x7d54('0x1a'),_0x81971b+'-'+_0x57e789+'/'+_0x22f27c)['json'](_0x5a6bec);}return null;};}function patchUpdates(_0x23ea55){return function(_0x2b0770){try{jsonpatch['apply'](_0x2b0770,_0x23ea55,!![]);}catch(_0x22718f){return BPromise[_0x7d54('0x1b')](_0x22718f);}return _0x2b0770[_0x7d54('0x1c')]();};}function saveUpdates(_0x6cc88b,_0x715a4e){return function(_0x4fe2cb){if(_0x4fe2cb){return _0x4fe2cb[_0x7d54('0x1d')](_0x6cc88b)['then'](function(_0x589f93){return _0x589f93;});}return null;};}function removeEntity(_0x5e0c4b,_0x2967b0){return function(_0x299f6e){if(_0x299f6e){return _0x299f6e['destroy']()[_0x7d54('0x1e')](function(){_0x5e0c4b[_0x7d54('0x18')](0xcc)[_0x7d54('0x12')]();});}};}function handleEntityNotFound(_0x19520a,_0x3b611f){return function(_0x6d0375){if(!_0x6d0375){_0x19520a[_0x7d54('0x11')](0x194);}return _0x6d0375;};}function handleError(_0x372f14,_0x509b8f){_0x509b8f=_0x509b8f||0x1f4;return function(_0x2818b6){logger[_0x7d54('0x1f')](_0x2818b6['stack']);if(_0x2818b6['name']){delete _0x2818b6['name'];}_0x372f14['status'](_0x509b8f)[_0x7d54('0x20')](_0x2818b6);};}exports[_0x7d54('0x21')]=function(_0x57e2ce,_0x32df83){var _0x252017={},_0x4a8488={},_0x472032={'count':0x0,'rows':[]};var _0x425a47=_[_0x7d54('0x22')](db[_0x7d54('0x23')][_0x7d54('0x24')],function(_0x2f1052){return{'name':_0x2f1052[_0x7d54('0x25')],'type':_0x2f1052[_0x7d54('0x26')]['key']};});_0x4a8488[_0x7d54('0x27')]=_['map'](_0x425a47,'name');_0x4a8488[_0x7d54('0x28')]=_[_0x7d54('0x29')](_0x57e2ce['query']);_0x4a8488[_0x7d54('0x2a')]=_[_0x7d54('0x2b')](_0x4a8488[_0x7d54('0x27')],_0x4a8488[_0x7d54('0x28')]);_0x252017[_0x7d54('0x2c')]=_[_0x7d54('0x2b')](_0x4a8488[_0x7d54('0x27')],qs['fields'](_0x57e2ce[_0x7d54('0x28')][_0x7d54('0x2d')]));_0x252017['attributes']=_0x252017[_0x7d54('0x2c')][_0x7d54('0x2e')]?_0x252017[_0x7d54('0x2c')]:_0x4a8488['model'];if(!_0x57e2ce[_0x7d54('0x28')][_0x7d54('0x2f')](_0x7d54('0x30'))){_0x252017[_0x7d54('0x16')]=qs[_0x7d54('0x16')](_0x57e2ce['query'][_0x7d54('0x16')]);_0x252017[_0x7d54('0x14')]=qs['offset'](_0x57e2ce[_0x7d54('0x28')][_0x7d54('0x14')]);}_0x252017[_0x7d54('0x31')]=qs[_0x7d54('0x32')](_0x57e2ce[_0x7d54('0x28')][_0x7d54('0x32')]);_0x252017[_0x7d54('0x33')]=qs[_0x7d54('0x2a')](_[_0x7d54('0x34')](_0x57e2ce[_0x7d54('0x28')],_0x4a8488[_0x7d54('0x2a')]),_0x425a47);if(_0x57e2ce[_0x7d54('0x28')]['filter']){_0x252017['where']=_[_0x7d54('0x35')](_0x252017[_0x7d54('0x33')],{'$or':_[_0x7d54('0x22')](_0x425a47,function(_0x624b65){if(_0x624b65['type']!=='VIRTUAL'){var _0x114531={};_0x114531[_0x624b65['name']]={'$like':'%'+_0x57e2ce[_0x7d54('0x28')][_0x7d54('0x36')]+'%'};return _0x114531;}})});}_0x252017=_['merge']({},_0x252017,_0x57e2ce['options']);var _0x20c2ed={'where':_0x252017[_0x7d54('0x33')]};return db['FaxQueueReport'][_0x7d54('0x17')](_0x20c2ed)[_0x7d54('0x1e')](function(_0x5adae8){_0x472032['count']=_0x5adae8;if(_0x57e2ce[_0x7d54('0x28')][_0x7d54('0x37')]){_0x252017[_0x7d54('0x38')]=[{'all':!![]}];}return db[_0x7d54('0x23')][_0x7d54('0x39')](_0x252017);})[_0x7d54('0x1e')](function(_0x17f951){_0x472032[_0x7d54('0x3a')]=_0x17f951;return _0x472032;})[_0x7d54('0x1e')](respondWithFilteredResult(_0x32df83,_0x252017))[_0x7d54('0x3b')](handleError(_0x32df83,null));};exports[_0x7d54('0x3c')]=function(_0x543096,_0x536946){var _0x395b0d={'raw':!![],'where':{'id':_0x543096[_0x7d54('0x3d')]['id']}},_0xd8cefd={};_0xd8cefd[_0x7d54('0x27')]=_[_0x7d54('0x29')](db[_0x7d54('0x23')][_0x7d54('0x24')]);_0xd8cefd['query']=_[_0x7d54('0x29')](_0x543096['query']);_0xd8cefd['filters']=_[_0x7d54('0x2b')](_0xd8cefd[_0x7d54('0x27')],_0xd8cefd[_0x7d54('0x28')]);_0x395b0d[_0x7d54('0x2c')]=_[_0x7d54('0x2b')](_0xd8cefd['model'],qs[_0x7d54('0x2d')](_0x543096[_0x7d54('0x28')]['fields']));_0x395b0d[_0x7d54('0x2c')]=_0x395b0d[_0x7d54('0x2c')][_0x7d54('0x2e')]?_0x395b0d[_0x7d54('0x2c')]:_0xd8cefd[_0x7d54('0x27')];if(_0x543096[_0x7d54('0x28')]['includeAll']){_0x395b0d[_0x7d54('0x38')]=[{'all':!![]}];}_0x395b0d=_[_0x7d54('0x35')]({},_0x395b0d,_0x543096[_0x7d54('0x3e')]);return db[_0x7d54('0x23')][_0x7d54('0x3f')](_0x395b0d)[_0x7d54('0x1e')](handleEntityNotFound(_0x536946,null))[_0x7d54('0x1e')](respondWithResult(_0x536946,null))['catch'](handleError(_0x536946,null));};exports[_0x7d54('0x40')]=function(_0x2ea2d0,_0x2cf5f0){return db[_0x7d54('0x23')][_0x7d54('0x40')](_0x2ea2d0['body'],{})[_0x7d54('0x1e')](respondWithResult(_0x2cf5f0,0xc9))['catch'](handleError(_0x2cf5f0,null));};exports[_0x7d54('0x1d')]=function(_0x560b42,_0x5b6449){if(_0x560b42[_0x7d54('0x41')]['id']){delete _0x560b42['body']['id'];}return db['FaxQueueReport'][_0x7d54('0x3f')]({'where':{'id':_0x560b42[_0x7d54('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5b6449,null))[_0x7d54('0x1e')](saveUpdates(_0x560b42[_0x7d54('0x41')],null))[_0x7d54('0x1e')](respondWithResult(_0x5b6449,null))['catch'](handleError(_0x5b6449,null));};exports[_0x7d54('0x42')]=function(_0x57bb14,_0x16e23f){return db[_0x7d54('0x23')][_0x7d54('0x3f')]({'where':{'id':_0x57bb14[_0x7d54('0x3d')]['id']}})['then'](handleEntityNotFound(_0x16e23f,null))['then'](removeEntity(_0x16e23f,null))[_0x7d54('0x3b')](handleError(_0x16e23f,null));};exports[_0x7d54('0x43')]=function(_0x7503c1,_0x3c61e5){return db[_0x7d54('0x23')]['describe']()[_0x7d54('0x1e')](respondWithResult(_0x3c61e5,null))[_0x7d54('0x3b')](handleError(_0x3c61e5,null));}; \ No newline at end of file +var _0xf296=['create','body','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find'];(function(_0x384ba5,_0x737c09){var _0x487f6f=function(_0x21cb5e){while(--_0x21cb5e){_0x384ba5['push'](_0x384ba5['shift']());}};_0x487f6f(++_0x737c09);}(_0xf296,0x94));var _0x6f29=function(_0x3ba537,_0x56b969){_0x3ba537=_0x3ba537-0x0;var _0x585c1a=_0xf296[_0x3ba537];return _0x585c1a;};'use strict';var emlformat=require(_0x6f29('0x0'));var rimraf=require(_0x6f29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f29('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6f29('0x3'));var Mustache=require(_0x6f29('0x4'));var util=require('util');var path=require(_0x6f29('0x5'));var sox=require(_0x6f29('0x6'));var csv=require(_0x6f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f29('0x8'));var _=require(_0x6f29('0x9'));var squel=require('squel');var crypto=require(_0x6f29('0xa'));var jsforce=require(_0x6f29('0xb'));var deskjs=require(_0x6f29('0xc'));var toCsv=require(_0x6f29('0x7'));var querystring=require(_0x6f29('0xd'));var Papa=require(_0x6f29('0xe'));var Redis=require(_0x6f29('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6f29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6f29('0x11'));var utils=require('../../config/utils');var config=require(_0x6f29('0x12'));var licenseUtil=require(_0x6f29('0x13'));var db=require(_0x6f29('0x14'))['db'];function respondWithStatusCode(_0x56e2a4,_0x1ce6a2){_0x1ce6a2=_0x1ce6a2||0xcc;return function(_0x3cec2a){if(_0x3cec2a){return _0x56e2a4[_0x6f29('0x15')](_0x1ce6a2);}return _0x56e2a4[_0x6f29('0x16')](_0x1ce6a2)[_0x6f29('0x17')]();};}function respondWithResult(_0x4b9304,_0x429604){_0x429604=_0x429604||0xc8;return function(_0x115d08){if(_0x115d08){return _0x4b9304[_0x6f29('0x16')](_0x429604)['json'](_0x115d08);}};}function respondWithFilteredResult(_0x3602e4,_0x50e0d6){return function(_0x3959e4){if(_0x3959e4){var _0x2907e4=typeof _0x50e0d6[_0x6f29('0x18')]===_0x6f29('0x19')&&typeof _0x50e0d6['limit']==='undefined';var _0x28995e=_0x3959e4[_0x6f29('0x1a')];var _0x5b524d=_0x2907e4?0x0:_0x50e0d6['offset'];var _0x30e10f=_0x2907e4?_0x3959e4[_0x6f29('0x1a')]:_0x50e0d6[_0x6f29('0x18')]+_0x50e0d6[_0x6f29('0x1b')];var _0x29b580;if(_0x30e10f>=_0x28995e){_0x30e10f=_0x28995e;_0x29b580=0xc8;}else{_0x29b580=0xce;}_0x3602e4['status'](_0x29b580);return _0x3602e4[_0x6f29('0x1c')](_0x6f29('0x1d'),_0x5b524d+'-'+_0x30e10f+'/'+_0x28995e)[_0x6f29('0x1e')](_0x3959e4);}return null;};}function patchUpdates(_0x33afa3){return function(_0x1f7c53){try{jsonpatch[_0x6f29('0x1f')](_0x1f7c53,_0x33afa3,!![]);}catch(_0x56ca2d){return BPromise['reject'](_0x56ca2d);}return _0x1f7c53[_0x6f29('0x20')]();};}function saveUpdates(_0x430dc8,_0xf7309){return function(_0x4924ca){if(_0x4924ca){return _0x4924ca[_0x6f29('0x21')](_0x430dc8)[_0x6f29('0x22')](function(_0x1ae43e){return _0x1ae43e;});}return null;};}function removeEntity(_0x3e9977,_0x16eaa9){return function(_0x9d7eda){if(_0x9d7eda){return _0x9d7eda['destroy']()[_0x6f29('0x22')](function(){_0x3e9977[_0x6f29('0x16')](0xcc)[_0x6f29('0x17')]();});}};}function handleEntityNotFound(_0x54c05b,_0x5883e3){return function(_0x4fa5f9){if(!_0x4fa5f9){_0x54c05b[_0x6f29('0x15')](0x194);}return _0x4fa5f9;};}function handleError(_0x2593ba,_0x1b0ff7){_0x1b0ff7=_0x1b0ff7||0x1f4;return function(_0x301406){logger[_0x6f29('0x23')](_0x301406[_0x6f29('0x24')]);if(_0x301406[_0x6f29('0x25')]){delete _0x301406[_0x6f29('0x25')];}_0x2593ba['status'](_0x1b0ff7)[_0x6f29('0x26')](_0x301406);};}exports[_0x6f29('0x27')]=function(_0x4ceaea,_0x18f379){var _0x8e0348={},_0x3c6d71={},_0x305367={'count':0x0,'rows':[]};var _0x315116=_['map'](db[_0x6f29('0x28')][_0x6f29('0x29')],function(_0x5b57a3){return{'name':_0x5b57a3[_0x6f29('0x2a')],'type':_0x5b57a3[_0x6f29('0x2b')]['key']};});_0x3c6d71[_0x6f29('0x2c')]=_['map'](_0x315116,_0x6f29('0x25'));_0x3c6d71[_0x6f29('0x2d')]=_[_0x6f29('0x2e')](_0x4ceaea['query']);_0x3c6d71[_0x6f29('0x2f')]=_[_0x6f29('0x30')](_0x3c6d71[_0x6f29('0x2c')],_0x3c6d71['query']);_0x8e0348[_0x6f29('0x31')]=_[_0x6f29('0x30')](_0x3c6d71['model'],qs[_0x6f29('0x32')](_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x32')]));_0x8e0348[_0x6f29('0x31')]=_0x8e0348[_0x6f29('0x31')][_0x6f29('0x33')]?_0x8e0348[_0x6f29('0x31')]:_0x3c6d71[_0x6f29('0x2c')];if(!_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x34')]('nolimit')){_0x8e0348['limit']=qs[_0x6f29('0x1b')](_0x4ceaea['query'][_0x6f29('0x1b')]);_0x8e0348[_0x6f29('0x18')]=qs[_0x6f29('0x18')](_0x4ceaea['query'][_0x6f29('0x18')]);}_0x8e0348[_0x6f29('0x35')]=qs['sort'](_0x4ceaea[_0x6f29('0x2d')]['sort']);_0x8e0348[_0x6f29('0x36')]=qs[_0x6f29('0x2f')](_[_0x6f29('0x37')](_0x4ceaea['query'],_0x3c6d71[_0x6f29('0x2f')]),_0x315116);if(_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x38')]){_0x8e0348[_0x6f29('0x36')]=_[_0x6f29('0x39')](_0x8e0348[_0x6f29('0x36')],{'$or':_[_0x6f29('0x3a')](_0x315116,function(_0x2ebc0a){if(_0x2ebc0a[_0x6f29('0x2b')]!==_0x6f29('0x3b')){var _0x314004={};_0x314004[_0x2ebc0a[_0x6f29('0x25')]]={'$like':'%'+_0x4ceaea[_0x6f29('0x2d')]['filter']+'%'};return _0x314004;}})});}_0x8e0348=_['merge']({},_0x8e0348,_0x4ceaea[_0x6f29('0x3c')]);var _0x319ed2={'where':_0x8e0348[_0x6f29('0x36')]};return db[_0x6f29('0x28')][_0x6f29('0x1a')](_0x319ed2)[_0x6f29('0x22')](function(_0x1c3ed6){_0x305367['count']=_0x1c3ed6;if(_0x4ceaea[_0x6f29('0x2d')][_0x6f29('0x3d')]){_0x8e0348['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x6f29('0x3e')](_0x8e0348);})['then'](function(_0x35e4c2){_0x305367[_0x6f29('0x3f')]=_0x35e4c2;return _0x305367;})[_0x6f29('0x22')](respondWithFilteredResult(_0x18f379,_0x8e0348))[_0x6f29('0x40')](handleError(_0x18f379,null));};exports['show']=function(_0x4eb78d,_0x320b64){var _0x12ab79={'raw':!![],'where':{'id':_0x4eb78d[_0x6f29('0x41')]['id']}},_0x41d214={};_0x41d214[_0x6f29('0x2c')]=_[_0x6f29('0x2e')](db['FaxQueueReport'][_0x6f29('0x29')]);_0x41d214[_0x6f29('0x2d')]=_['keys'](_0x4eb78d[_0x6f29('0x2d')]);_0x41d214[_0x6f29('0x2f')]=_[_0x6f29('0x30')](_0x41d214[_0x6f29('0x2c')],_0x41d214[_0x6f29('0x2d')]);_0x12ab79[_0x6f29('0x31')]=_[_0x6f29('0x30')](_0x41d214[_0x6f29('0x2c')],qs[_0x6f29('0x32')](_0x4eb78d[_0x6f29('0x2d')][_0x6f29('0x32')]));_0x12ab79[_0x6f29('0x31')]=_0x12ab79[_0x6f29('0x31')][_0x6f29('0x33')]?_0x12ab79['attributes']:_0x41d214[_0x6f29('0x2c')];if(_0x4eb78d[_0x6f29('0x2d')]['includeAll']){_0x12ab79[_0x6f29('0x42')]=[{'all':!![]}];}_0x12ab79=_[_0x6f29('0x39')]({},_0x12ab79,_0x4eb78d[_0x6f29('0x3c')]);return db['FaxQueueReport'][_0x6f29('0x43')](_0x12ab79)[_0x6f29('0x22')](handleEntityNotFound(_0x320b64,null))['then'](respondWithResult(_0x320b64,null))[_0x6f29('0x40')](handleError(_0x320b64,null));};exports[_0x6f29('0x44')]=function(_0x2c97e7,_0x9e10e){return db[_0x6f29('0x28')][_0x6f29('0x44')](_0x2c97e7[_0x6f29('0x45')],{})[_0x6f29('0x22')](respondWithResult(_0x9e10e,0xc9))['catch'](handleError(_0x9e10e,null));};exports[_0x6f29('0x21')]=function(_0x27d36f,_0x1042c9){if(_0x27d36f[_0x6f29('0x45')]['id']){delete _0x27d36f[_0x6f29('0x45')]['id'];}return db['FaxQueueReport'][_0x6f29('0x43')]({'where':{'id':_0x27d36f[_0x6f29('0x41')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x1042c9,null))[_0x6f29('0x22')](saveUpdates(_0x27d36f['body'],null))[_0x6f29('0x22')](respondWithResult(_0x1042c9,null))[_0x6f29('0x40')](handleError(_0x1042c9,null));};exports[_0x6f29('0x46')]=function(_0x341f64,_0x58f431){return db[_0x6f29('0x28')][_0x6f29('0x43')]({'where':{'id':_0x341f64[_0x6f29('0x41')]['id']}})[_0x6f29('0x22')](handleEntityNotFound(_0x58f431,null))['then'](removeEntity(_0x58f431,null))['catch'](handleError(_0x58f431,null));};exports[_0x6f29('0x47')]=function(_0x117ffb,_0x436fb4){return db[_0x6f29('0x28')][_0x6f29('0x47')]()[_0x6f29('0x22')](respondWithResult(_0x436fb4,null))[_0x6f29('0x40')](handleError(_0x436fb4,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e897f91..ff8e451 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x2331b0,_0x3da5e5){var _0x30de1c=function(_0x395204){while(--_0x395204){_0x2331b0['push'](_0x2331b0['shift']());}};_0x30de1c(++_0x3da5e5);}(_0x5fab,0x177));var _0xb5fa=function(_0x51e51e,_0x1d852d){_0x51e51e=_0x51e51e-0x0;var _0x5ce929=_0x5fab[_0x51e51e];return _0x5ce929;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x5e0a9d,_0x263004){var _0x2f1b19=function(_0x2d7f1b){while(--_0x2d7f1b){_0x5e0a9d['push'](_0x5e0a9d['shift']());}};_0x2f1b19(++_0x263004);}(_0x1261,0x144));var _0x1126=function(_0x244f5d,_0x3c98c6){_0x244f5d=_0x244f5d-0x0;var _0x1a3886=_0x1261[_0x244f5d];return _0x1a3886;};'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')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 0b7d9f4..1f86cf9 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 _0x9a12=['catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','update','attributes','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x328f79,_0x53cac6){var _0x50cd90=function(_0x578c06){while(--_0x578c06){_0x328f79['push'](_0x328f79['shift']());}};_0x50cd90(++_0x53cac6);}(_0x9a12,0xbf));var _0x29a1=function(_0x4366c6,_0x5c1210){_0x4366c6=_0x4366c6-0x0;var _0x4a16c0=_0x9a12[_0x4366c6];return _0x4a16c0;};'use strict';var _=require(_0x29a1('0x0'));var util=require(_0x29a1('0x1'));var moment=require('moment');var BPromise=require(_0x29a1('0x2'));var rs=require(_0x29a1('0x3'));var fs=require('fs');var Redis=require(_0x29a1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x29a1('0x5'));var logger=require('../../config/logger')(_0x29a1('0x6'));var config=require(_0x29a1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ceefd,_0x2daa49,_0x29af2b){return new BPromise(function(_0x5ab034,_0x34c10e){return client[_0x29a1('0x8')](_0x2ceefd,_0x29af2b)[_0x29a1('0x9')](function(_0x7a5137){logger[_0x29a1('0xa')](_0x29a1('0xb'),_0x2daa49,_0x29a1('0xc'));logger[_0x29a1('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2daa49,_0x29a1('0xc'),JSON[_0x29a1('0xe')](_0x7a5137));if(_0x7a5137[_0x29a1('0xf')]){if(_0x7a5137[_0x29a1('0xf')][_0x29a1('0x10')]===0x1f4){logger[_0x29a1('0xf')](_0x29a1('0xb'),_0x2daa49,_0x7a5137[_0x29a1('0xf')][_0x29a1('0x11')]);return _0x34c10e(_0x7a5137[_0x29a1('0xf')][_0x29a1('0x11')]);}logger[_0x29a1('0xf')](_0x29a1('0xb'),_0x2daa49,_0x7a5137['error'][_0x29a1('0x11')]);return _0x5ab034(_0x7a5137['error'][_0x29a1('0x11')]);}else{logger[_0x29a1('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x2daa49,_0x29a1('0xc'));_0x5ab034(_0x7a5137[_0x29a1('0x12')][_0x29a1('0x11')]);}})[_0x29a1('0x13')](function(_0x1665d6){logger[_0x29a1('0xf')](_0x29a1('0xb'),_0x2daa49,_0x1665d6);_0x34c10e(_0x1665d6);});});}exports['CreateFaxQueueReport']=function(_0x29c58c){var _0x59a1c3=this;return new Promise(function(_0x3b52d6,_0x549f76){return db[_0x29a1('0x14')][_0x29a1('0x15')](_0x29c58c[_0x29a1('0x16')],{'raw':_0x29c58c[_0x29a1('0x17')]?_0x29c58c['options'][_0x29a1('0x18')]===undefined?!![]:![]:!![]})[_0x29a1('0x9')](function(_0x21b520){logger[_0x29a1('0xa')](_0x29a1('0x19'),_0x29c58c);logger[_0x29a1('0xd')](_0x29a1('0x19'),_0x29c58c,JSON[_0x29a1('0xe')](_0x21b520));_0x3b52d6(_0x21b520);})['catch'](function(_0x58fd62){logger[_0x29a1('0xf')](_0x29a1('0x19'),_0x58fd62[_0x29a1('0x11')],_0x29c58c);_0x549f76(_0x59a1c3[_0x29a1('0xf')](0x1f4,_0x58fd62[_0x29a1('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x53f2d0){var _0x4811ea=this;return new Promise(function(_0x146bdb,_0xa2bc08){return db[_0x29a1('0x14')][_0x29a1('0x1a')](_0x53f2d0[_0x29a1('0x16')],{'raw':_0x53f2d0['options']?_0x53f2d0['options'][_0x29a1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53f2d0[_0x29a1('0x17')]?_0x53f2d0[_0x29a1('0x17')]['where']||null:null,'attributes':_0x53f2d0['options']?_0x53f2d0[_0x29a1('0x17')][_0x29a1('0x1b')]||null:null,'limit':_0x53f2d0[_0x29a1('0x17')]?_0x53f2d0[_0x29a1('0x17')][_0x29a1('0x1c')]||null:null})[_0x29a1('0x9')](function(_0x366c22){logger['info']('UpdateFaxQueueReport',_0x53f2d0);logger[_0x29a1('0xd')]('UpdateFaxQueueReport',_0x53f2d0,JSON[_0x29a1('0xe')](_0x366c22));_0x146bdb(_0x366c22);})[_0x29a1('0x13')](function(_0xdee96e){logger['error'](_0x29a1('0x1d'),_0xdee96e[_0x29a1('0x11')],_0x53f2d0);_0xa2bc08(_0x4811ea[_0x29a1('0xf')](0x1f4,_0xdee96e[_0x29a1('0x11')]));});});}; \ No newline at end of file +var _0x7b28=['FaxQueueReport','create','options','raw','CreateFaxQueueReport','debug','update','limit','UpdateFaxQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch'];(function(_0x52aff0,_0x362c31){var _0x309139=function(_0x5227f9){while(--_0x5227f9){_0x52aff0['push'](_0x52aff0['shift']());}};_0x309139(++_0x362c31);}(_0x7b28,0x169));var _0x87b2=function(_0x41db93,_0x20a773){_0x41db93=_0x41db93-0x0;var _0x3f0e73=_0x7b28[_0x41db93];return _0x3f0e73;};'use strict';var _=require('lodash');var util=require(_0x87b2('0x0'));var moment=require(_0x87b2('0x1'));var BPromise=require(_0x87b2('0x2'));var rs=require(_0x87b2('0x3'));var fs=require('fs');var Redis=require(_0x87b2('0x4'));var db=require(_0x87b2('0x5'))['db'];var utils=require(_0x87b2('0x6'));var logger=require(_0x87b2('0x7'))('rpc');var config=require(_0x87b2('0x8'));var jayson=require(_0x87b2('0x9'));var client=jayson['client'][_0x87b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36971a,_0x3aea9a,_0x3dff2c){return new BPromise(function(_0x227705,_0x1728dd){return client[_0x87b2('0xb')](_0x36971a,_0x3dff2c)[_0x87b2('0xc')](function(_0x43b2d7){logger['info'](_0x87b2('0xd'),_0x3aea9a,_0x87b2('0xe'));logger['debug'](_0x87b2('0xf'),_0x3aea9a,_0x87b2('0xe'),JSON[_0x87b2('0x10')](_0x43b2d7));if(_0x43b2d7['error']){if(_0x43b2d7['error'][_0x87b2('0x11')]===0x1f4){logger[_0x87b2('0x12')](_0x87b2('0xd'),_0x3aea9a,_0x43b2d7[_0x87b2('0x12')]['message']);return _0x1728dd(_0x43b2d7['error'][_0x87b2('0x13')]);}logger['error'](_0x87b2('0xd'),_0x3aea9a,_0x43b2d7[_0x87b2('0x12')][_0x87b2('0x13')]);return _0x227705(_0x43b2d7[_0x87b2('0x12')]['message']);}else{logger[_0x87b2('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x3aea9a,_0x87b2('0xe'));_0x227705(_0x43b2d7[_0x87b2('0x15')]['message']);}})[_0x87b2('0x16')](function(_0x2029a9){logger['error'](_0x87b2('0xd'),_0x3aea9a,_0x2029a9);_0x1728dd(_0x2029a9);});});}exports['CreateFaxQueueReport']=function(_0x509fbe){var _0x3b2c50=this;return new Promise(function(_0x27591c,_0x59a203){return db[_0x87b2('0x17')][_0x87b2('0x18')](_0x509fbe['body'],{'raw':_0x509fbe[_0x87b2('0x19')]?_0x509fbe[_0x87b2('0x19')][_0x87b2('0x1a')]===undefined?!![]:![]:!![]})[_0x87b2('0xc')](function(_0x31761e){logger[_0x87b2('0x14')](_0x87b2('0x1b'),_0x509fbe);logger[_0x87b2('0x1c')](_0x87b2('0x1b'),_0x509fbe,JSON[_0x87b2('0x10')](_0x31761e));_0x27591c(_0x31761e);})[_0x87b2('0x16')](function(_0x28f7cd){logger['error'](_0x87b2('0x1b'),_0x28f7cd[_0x87b2('0x13')],_0x509fbe);_0x59a203(_0x3b2c50['error'](0x1f4,_0x28f7cd['message']));});});};exports['UpdateFaxQueueReport']=function(_0x43b644){var _0xafb444=this;return new Promise(function(_0x2e8747,_0x493d85){return db[_0x87b2('0x17')][_0x87b2('0x1d')](_0x43b644['body'],{'raw':_0x43b644[_0x87b2('0x19')]?_0x43b644[_0x87b2('0x19')][_0x87b2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43b644[_0x87b2('0x19')]?_0x43b644[_0x87b2('0x19')]['where']||null:null,'attributes':_0x43b644['options']?_0x43b644['options']['attributes']||null:null,'limit':_0x43b644[_0x87b2('0x19')]?_0x43b644[_0x87b2('0x19')][_0x87b2('0x1e')]||null:null})['then'](function(_0x21d5db){logger[_0x87b2('0x14')]('UpdateFaxQueueReport',_0x43b644);logger[_0x87b2('0x1c')](_0x87b2('0x1f'),_0x43b644,JSON[_0x87b2('0x10')](_0x21d5db));_0x2e8747(_0x21d5db);})[_0x87b2('0x16')](function(_0x407491){logger['error']('UpdateFaxQueueReport',_0x407491['message'],_0x43b644);_0x493d85(_0xafb444[_0x87b2('0x12')](0x1f4,_0x407491['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 43f510c..80ca54c 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 _0xb0d1=['create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post'];(function(_0xf8cb3f,_0x1d4ee7){var _0x361595=function(_0x2552e1){while(--_0x2552e1){_0xf8cb3f['push'](_0xf8cb3f['shift']());}};_0x361595(++_0x1d4ee7);}(_0xb0d1,0x1e6));var _0x1b0d=function(_0x5d14a3,_0x1ffa79){_0x5d14a3=_0x5d14a3-0x0;var _0x5b983f=_0xb0d1[_0x5d14a3];return _0x5b983f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b0d('0x0'));var timeout=require(_0x1b0d('0x1'));var express=require(_0x1b0d('0x2'));var router=express[_0x1b0d('0x3')]();var fs_extra=require(_0x1b0d('0x4'));var auth=require(_0x1b0d('0x5'));var interaction=require(_0x1b0d('0x6'));var config=require(_0x1b0d('0x7'));var controller=require('./faxQueueReport.controller');router[_0x1b0d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1b0d('0x8')]('/describe',auth[_0x1b0d('0x9')](),controller[_0x1b0d('0xa')]);router['get'](_0x1b0d('0xb'),auth['isAuthenticated'](),controller[_0x1b0d('0xc')]);router[_0x1b0d('0xd')]('/',auth['isAuthenticated'](),controller[_0x1b0d('0xe')]);router[_0x1b0d('0xf')](_0x1b0d('0xb'),auth['isAuthenticated'](),controller[_0x1b0d('0x10')]);router[_0x1b0d('0x11')]('/:id',auth[_0x1b0d('0x9')](),controller[_0x1b0d('0x12')]);module[_0x1b0d('0x13')]=router; \ No newline at end of file +var _0x6ba7=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x45154c,_0x1eca31){var _0x2513bc=function(_0x35a79b){while(--_0x35a79b){_0x45154c['push'](_0x45154c['shift']());}};_0x2513bc(++_0x1eca31);}(_0x6ba7,0x1a6));var _0x76ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ba7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x76ba('0x0'));var util=require(_0x76ba('0x1'));var path=require(_0x76ba('0x2'));var timeout=require(_0x76ba('0x3'));var express=require(_0x76ba('0x4'));var router=express[_0x76ba('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x76ba('0x6'));var controller=require(_0x76ba('0x7'));router[_0x76ba('0x8')]('/',auth[_0x76ba('0x9')](),controller['index']);router[_0x76ba('0x8')](_0x76ba('0xa'),auth[_0x76ba('0x9')](),controller['describe']);router['get'](_0x76ba('0xb'),auth[_0x76ba('0x9')](),controller[_0x76ba('0xc')]);router[_0x76ba('0xd')]('/',auth[_0x76ba('0x9')](),controller[_0x76ba('0xe')]);router[_0x76ba('0xf')]('/:id',auth[_0x76ba('0x9')](),controller[_0x76ba('0x10')]);router['delete'](_0x76ba('0xb'),auth['isAuthenticated'](),controller[_0x76ba('0x11')]);module[_0x76ba('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index e532f3f..4309605 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3ea97b,_0x216df0){_0x3ea97b=_0x3ea97b-0x0;var _0x44ec1f=_0x9bde[_0x3ea97b];return _0x44ec1f;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x20bda7,_0x10eae7){var _0x26907b=function(_0x457a5d){while(--_0x457a5d){_0x20bda7['push'](_0x20bda7['shift']());}};_0x26907b(++_0x10eae7);}(_0x70e0,0x17b));var _0x070e=function(_0x5b8467,_0x50d8f0){_0x5b8467=_0x5b8467-0x0;var _0x19b568=_0x70e0[_0x5b8467];return _0x19b568;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 80f9796..adeb6f7 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 _0x3961=['destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x5b87ce,_0x20b7f6){var _0x597aa7=function(_0x295004){while(--_0x295004){_0x5b87ce['push'](_0x5b87ce['shift']());}};_0x597aa7(++_0x20b7f6);}(_0x3961,0x18e));var _0x1396=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0x3961[_0x2d3a4d];return _0x3a94a3;};'use strict';var emlformat=require(_0x1396('0x0'));var rimraf=require(_0x1396('0x1'));var zipdir=require(_0x1396('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1396('0x3'));var moment=require(_0x1396('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1396('0x5'));var util=require(_0x1396('0x6'));var path=require(_0x1396('0x7'));var sox=require(_0x1396('0x8'));var csv=require('to-csv');var ejs=require(_0x1396('0x9'));var fs=require('fs');var fs_extra=require(_0x1396('0xa'));var _=require(_0x1396('0xb'));var squel=require(_0x1396('0xc'));var crypto=require('crypto');var jsforce=require(_0x1396('0xd'));var deskjs=require(_0x1396('0xe'));var toCsv=require(_0x1396('0xf'));var querystring=require(_0x1396('0x10'));var Papa=require(_0x1396('0x11'));var Redis=require(_0x1396('0x12'));var authService=require(_0x1396('0x13'));var qs=require(_0x1396('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1396('0x15'));var logger=require('../../config/logger')(_0x1396('0x16'));var utils=require('../../config/utils');var config=require(_0x1396('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1396('0x18'))['db'];function respondWithStatusCode(_0x401318,_0x4288a0){_0x4288a0=_0x4288a0||0xcc;return function(_0xe3de2d){if(_0xe3de2d){return _0x401318[_0x1396('0x19')](_0x4288a0);}return _0x401318[_0x1396('0x1a')](_0x4288a0)[_0x1396('0x1b')]();};}function respondWithResult(_0x585dde,_0x2a52d1){_0x2a52d1=_0x2a52d1||0xc8;return function(_0x1d8845){if(_0x1d8845){return _0x585dde[_0x1396('0x1a')](_0x2a52d1)[_0x1396('0x1c')](_0x1d8845);}};}function respondWithFilteredResult(_0x3436b3,_0xb8c0d7){return function(_0x4ba73c){if(_0x4ba73c){var _0x2b607b=typeof _0xb8c0d7[_0x1396('0x1d')]===_0x1396('0x1e')&&typeof _0xb8c0d7[_0x1396('0x1f')]===_0x1396('0x1e');var _0x154140=_0x4ba73c[_0x1396('0x20')];var _0x2357e6=_0x2b607b?0x0:_0xb8c0d7[_0x1396('0x1d')];var _0x3bcc09=_0x2b607b?_0x4ba73c[_0x1396('0x20')]:_0xb8c0d7[_0x1396('0x1d')]+_0xb8c0d7[_0x1396('0x1f')];var _0x48851e;if(_0x3bcc09>=_0x154140){_0x3bcc09=_0x154140;_0x48851e=0xc8;}else{_0x48851e=0xce;}_0x3436b3[_0x1396('0x1a')](_0x48851e);return _0x3436b3[_0x1396('0x21')](_0x1396('0x22'),_0x2357e6+'-'+_0x3bcc09+'/'+_0x154140)[_0x1396('0x1c')](_0x4ba73c);}return null;};}function patchUpdates(_0x13da78){return function(_0x1eac3a){try{jsonpatch[_0x1396('0x23')](_0x1eac3a,_0x13da78,!![]);}catch(_0x1fc123){return BPromise[_0x1396('0x24')](_0x1fc123);}return _0x1eac3a[_0x1396('0x25')]();};}function saveUpdates(_0x52cfbc,_0x2cce1f){return function(_0x493481){if(_0x493481){return _0x493481[_0x1396('0x26')](_0x52cfbc)[_0x1396('0x27')](function(_0x406422){return _0x406422;});}return null;};}function removeEntity(_0x31ab67,_0x1c2e51){return function(_0x590b75){if(_0x590b75){return _0x590b75[_0x1396('0x28')]()['then'](function(){_0x31ab67[_0x1396('0x1a')](0xcc)[_0x1396('0x1b')]();});}};}function handleEntityNotFound(_0x188e4f,_0x10ef13){return function(_0x24b197){if(!_0x24b197){_0x188e4f[_0x1396('0x19')](0x194);}return _0x24b197;};}function handleError(_0x4e0072,_0x1a58c7){_0x1a58c7=_0x1a58c7||0x1f4;return function(_0x32e5c5){logger[_0x1396('0x29')](_0x32e5c5[_0x1396('0x2a')]);if(_0x32e5c5['name']){delete _0x32e5c5[_0x1396('0x2b')];}_0x4e0072[_0x1396('0x1a')](_0x1a58c7)[_0x1396('0x2c')](_0x32e5c5);};}exports[_0x1396('0x2d')]=function(_0x2313ec,_0x1e8092){var _0x5e40c3={},_0x18cb5c={},_0x51fe24={'count':0x0,'rows':[]};var _0x3d2d86=_[_0x1396('0x2e')](db[_0x1396('0x2f')][_0x1396('0x30')],function(_0x147623){return{'name':_0x147623[_0x1396('0x31')],'type':_0x147623[_0x1396('0x32')]['key']};});_0x18cb5c['model']=_['map'](_0x3d2d86,_0x1396('0x2b'));_0x18cb5c['query']=_['keys'](_0x2313ec[_0x1396('0x33')]);_0x18cb5c['filters']=_[_0x1396('0x34')](_0x18cb5c[_0x1396('0x35')],_0x18cb5c[_0x1396('0x33')]);_0x5e40c3[_0x1396('0x36')]=_[_0x1396('0x34')](_0x18cb5c[_0x1396('0x35')],qs[_0x1396('0x37')](_0x2313ec[_0x1396('0x33')][_0x1396('0x37')]));_0x5e40c3[_0x1396('0x36')]=_0x5e40c3[_0x1396('0x36')][_0x1396('0x38')]?_0x5e40c3[_0x1396('0x36')]:_0x18cb5c[_0x1396('0x35')];if(!_0x2313ec[_0x1396('0x33')][_0x1396('0x39')]('nolimit')){_0x5e40c3[_0x1396('0x1f')]=qs[_0x1396('0x1f')](_0x2313ec[_0x1396('0x33')][_0x1396('0x1f')]);_0x5e40c3[_0x1396('0x1d')]=qs[_0x1396('0x1d')](_0x2313ec['query'][_0x1396('0x1d')]);}_0x5e40c3[_0x1396('0x3a')]=qs[_0x1396('0x3b')](_0x2313ec['query'][_0x1396('0x3b')]);_0x5e40c3[_0x1396('0x3c')]=qs['filters'](_['pick'](_0x2313ec[_0x1396('0x33')],_0x18cb5c[_0x1396('0x3d')]),_0x3d2d86);if(_0x2313ec[_0x1396('0x33')][_0x1396('0x3e')]){_0x5e40c3['where']=_[_0x1396('0x3f')](_0x5e40c3[_0x1396('0x3c')],{'$or':_[_0x1396('0x2e')](_0x3d2d86,function(_0x49039e){if(_0x49039e['type']!=='VIRTUAL'){var _0x8acf5={};_0x8acf5[_0x49039e[_0x1396('0x2b')]]={'$like':'%'+_0x2313ec[_0x1396('0x33')][_0x1396('0x3e')]+'%'};return _0x8acf5;}})});}_0x5e40c3=_[_0x1396('0x3f')]({},_0x5e40c3,_0x2313ec[_0x1396('0x40')]);var _0x4d82db={'where':_0x5e40c3[_0x1396('0x3c')]};return db[_0x1396('0x2f')]['count'](_0x4d82db)['then'](function(_0x10a3c8){_0x51fe24[_0x1396('0x20')]=_0x10a3c8;if(_0x2313ec['query'][_0x1396('0x41')]){_0x5e40c3['include']=[{'all':!![]}];}return db[_0x1396('0x2f')][_0x1396('0x42')](_0x5e40c3);})['then'](function(_0xe329e2){_0x51fe24[_0x1396('0x43')]=_0xe329e2;return _0x51fe24;})[_0x1396('0x27')](respondWithFilteredResult(_0x1e8092,_0x5e40c3))[_0x1396('0x44')](handleError(_0x1e8092,null));};exports['show']=function(_0x498fa9,_0x5c8636){var _0x9120f7={'raw':!![],'where':{'id':_0x498fa9[_0x1396('0x45')]['id']}},_0x680593={};_0x680593[_0x1396('0x35')]=_['keys'](db[_0x1396('0x2f')]['rawAttributes']);_0x680593[_0x1396('0x33')]=_['keys'](_0x498fa9[_0x1396('0x33')]);_0x680593[_0x1396('0x3d')]=_[_0x1396('0x34')](_0x680593[_0x1396('0x35')],_0x680593[_0x1396('0x33')]);_0x9120f7['attributes']=_[_0x1396('0x34')](_0x680593[_0x1396('0x35')],qs[_0x1396('0x37')](_0x498fa9[_0x1396('0x33')][_0x1396('0x37')]));_0x9120f7['attributes']=_0x9120f7['attributes'][_0x1396('0x38')]?_0x9120f7[_0x1396('0x36')]:_0x680593[_0x1396('0x35')];if(_0x498fa9[_0x1396('0x33')][_0x1396('0x41')]){_0x9120f7['include']=[{'all':!![]}];}_0x9120f7=_[_0x1396('0x3f')]({},_0x9120f7,_0x498fa9[_0x1396('0x40')]);return db['FaxTransferReport']['find'](_0x9120f7)['then'](handleEntityNotFound(_0x5c8636,null))[_0x1396('0x27')](respondWithResult(_0x5c8636,null))[_0x1396('0x44')](handleError(_0x5c8636,null));};exports[_0x1396('0x46')]=function(_0x44568b,_0x7e33a){return db['FaxTransferReport'][_0x1396('0x46')](_0x44568b[_0x1396('0x47')],{})[_0x1396('0x27')](respondWithResult(_0x7e33a,0xc9))['catch'](handleError(_0x7e33a,null));};exports[_0x1396('0x26')]=function(_0x482234,_0x5c6b62){if(_0x482234['body']['id']){delete _0x482234[_0x1396('0x47')]['id'];}return db[_0x1396('0x2f')]['find']({'where':{'id':_0x482234[_0x1396('0x45')]['id']}})[_0x1396('0x27')](handleEntityNotFound(_0x5c6b62,null))['then'](saveUpdates(_0x482234[_0x1396('0x47')],null))['then'](respondWithResult(_0x5c6b62,null))[_0x1396('0x44')](handleError(_0x5c6b62,null));};exports[_0x1396('0x28')]=function(_0xd5088b,_0x50d131){return db[_0x1396('0x2f')]['find']({'where':{'id':_0xd5088b[_0x1396('0x45')]['id']}})['then'](handleEntityNotFound(_0x50d131,null))['then'](removeEntity(_0x50d131,null))['catch'](handleError(_0x50d131,null));};exports[_0x1396('0x48')]=function(_0x4830c6,_0x35bbb2){return db[_0x1396('0x2f')][_0x1396('0x48')]()[_0x1396('0x27')](respondWithResult(_0x35bbb2,null))[_0x1396('0x44')](handleError(_0x35bbb2,null));}; \ No newline at end of file +var _0xc97c=['intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','FaxTransferReport','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters'];(function(_0x372314,_0x32a6e3){var _0x3b9716=function(_0x1edaaa){while(--_0x1edaaa){_0x372314['push'](_0x372314['shift']());}};_0x3b9716(++_0x32a6e3);}(_0xc97c,0xae));var _0xcc97=function(_0x138cec,_0x3cf8c9){_0x138cec=_0x138cec-0x0;var _0x1515f0=_0xc97c[_0x138cec];return _0x1515f0;};'use strict';var emlformat=require(_0xcc97('0x0'));var rimraf=require(_0xcc97('0x1'));var zipdir=require(_0xcc97('0x2'));var jsonpatch=require(_0xcc97('0x3'));var rp=require(_0xcc97('0x4'));var moment=require(_0xcc97('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcc97('0x6'));var util=require(_0xcc97('0x7'));var path=require(_0xcc97('0x8'));var sox=require(_0xcc97('0x9'));var csv=require(_0xcc97('0xa'));var ejs=require(_0xcc97('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc97('0xc'));var squel=require(_0xcc97('0xd'));var crypto=require(_0xcc97('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcc97('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcc97('0x10'));var Papa=require(_0xcc97('0x11'));var Redis=require('ioredis');var authService=require(_0xcc97('0x12'));var qs=require(_0xcc97('0x13'));var as=require(_0xcc97('0x14'));var hardwareService=require(_0xcc97('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcc97('0x16'));var config=require(_0xcc97('0x17'));var licenseUtil=require(_0xcc97('0x18'));var db=require(_0xcc97('0x19'))['db'];function respondWithStatusCode(_0x65b200,_0x3a1cd3){_0x3a1cd3=_0x3a1cd3||0xcc;return function(_0x1938dd){if(_0x1938dd){return _0x65b200[_0xcc97('0x1a')](_0x3a1cd3);}return _0x65b200[_0xcc97('0x1b')](_0x3a1cd3)['end']();};}function respondWithResult(_0x166a97,_0x20fcdb){_0x20fcdb=_0x20fcdb||0xc8;return function(_0x35d0d5){if(_0x35d0d5){return _0x166a97[_0xcc97('0x1b')](_0x20fcdb)[_0xcc97('0x1c')](_0x35d0d5);}};}function respondWithFilteredResult(_0x490082,_0x30662e){return function(_0x252d0d){if(_0x252d0d){var _0x330cac=typeof _0x30662e['offset']===_0xcc97('0x1d')&&typeof _0x30662e[_0xcc97('0x1e')]===_0xcc97('0x1d');var _0x2fe32f=_0x252d0d[_0xcc97('0x1f')];var _0x22decc=_0x330cac?0x0:_0x30662e[_0xcc97('0x20')];var _0x1be244=_0x330cac?_0x252d0d['count']:_0x30662e['offset']+_0x30662e['limit'];var _0xc99b6a;if(_0x1be244>=_0x2fe32f){_0x1be244=_0x2fe32f;_0xc99b6a=0xc8;}else{_0xc99b6a=0xce;}_0x490082[_0xcc97('0x1b')](_0xc99b6a);return _0x490082[_0xcc97('0x21')]('Content-Range',_0x22decc+'-'+_0x1be244+'/'+_0x2fe32f)[_0xcc97('0x1c')](_0x252d0d);}return null;};}function patchUpdates(_0x43240f){return function(_0x597945){try{jsonpatch['apply'](_0x597945,_0x43240f,!![]);}catch(_0x4dc6a4){return BPromise['reject'](_0x4dc6a4);}return _0x597945[_0xcc97('0x22')]();};}function saveUpdates(_0x4208e1,_0x4a39da){return function(_0x581bdd){if(_0x581bdd){return _0x581bdd[_0xcc97('0x23')](_0x4208e1)[_0xcc97('0x24')](function(_0x4b023e){return _0x4b023e;});}return null;};}function removeEntity(_0x50d56d,_0x13ecda){return function(_0x40b2be){if(_0x40b2be){return _0x40b2be[_0xcc97('0x25')]()[_0xcc97('0x24')](function(){_0x50d56d[_0xcc97('0x1b')](0xcc)[_0xcc97('0x26')]();});}};}function handleEntityNotFound(_0x45ae21,_0x49b41b){return function(_0x54f964){if(!_0x54f964){_0x45ae21[_0xcc97('0x1a')](0x194);}return _0x54f964;};}function handleError(_0x457a31,_0x1059dc){_0x1059dc=_0x1059dc||0x1f4;return function(_0x2f5584){logger[_0xcc97('0x27')](_0x2f5584[_0xcc97('0x28')]);if(_0x2f5584[_0xcc97('0x29')]){delete _0x2f5584[_0xcc97('0x29')];}_0x457a31[_0xcc97('0x1b')](_0x1059dc)[_0xcc97('0x2a')](_0x2f5584);};}exports[_0xcc97('0x2b')]=function(_0x241aca,_0x15c678){var _0x7ae6ba={},_0x4e856e={},_0x4eaccf={'count':0x0,'rows':[]};var _0x564699=_[_0xcc97('0x2c')](db['FaxTransferReport'][_0xcc97('0x2d')],function(_0x41bdf7){return{'name':_0x41bdf7['fieldName'],'type':_0x41bdf7['type'][_0xcc97('0x2e')]};});_0x4e856e[_0xcc97('0x2f')]=_[_0xcc97('0x2c')](_0x564699,_0xcc97('0x29'));_0x4e856e[_0xcc97('0x30')]=_[_0xcc97('0x31')](_0x241aca[_0xcc97('0x30')]);_0x4e856e[_0xcc97('0x32')]=_[_0xcc97('0x33')](_0x4e856e[_0xcc97('0x2f')],_0x4e856e[_0xcc97('0x30')]);_0x7ae6ba[_0xcc97('0x34')]=_[_0xcc97('0x33')](_0x4e856e[_0xcc97('0x2f')],qs['fields'](_0x241aca['query']['fields']));_0x7ae6ba[_0xcc97('0x34')]=_0x7ae6ba[_0xcc97('0x34')]['length']?_0x7ae6ba[_0xcc97('0x34')]:_0x4e856e[_0xcc97('0x2f')];if(!_0x241aca[_0xcc97('0x30')][_0xcc97('0x35')](_0xcc97('0x36'))){_0x7ae6ba[_0xcc97('0x1e')]=qs[_0xcc97('0x1e')](_0x241aca[_0xcc97('0x30')][_0xcc97('0x1e')]);_0x7ae6ba[_0xcc97('0x20')]=qs['offset'](_0x241aca[_0xcc97('0x30')][_0xcc97('0x20')]);}_0x7ae6ba['order']=qs[_0xcc97('0x37')](_0x241aca[_0xcc97('0x30')]['sort']);_0x7ae6ba[_0xcc97('0x38')]=qs[_0xcc97('0x32')](_[_0xcc97('0x39')](_0x241aca[_0xcc97('0x30')],_0x4e856e[_0xcc97('0x32')]),_0x564699);if(_0x241aca[_0xcc97('0x30')][_0xcc97('0x3a')]){_0x7ae6ba['where']=_['merge'](_0x7ae6ba['where'],{'$or':_[_0xcc97('0x2c')](_0x564699,function(_0x5a5a82){if(_0x5a5a82[_0xcc97('0x3b')]!==_0xcc97('0x3c')){var _0x55052d={};_0x55052d[_0x5a5a82[_0xcc97('0x29')]]={'$like':'%'+_0x241aca[_0xcc97('0x30')][_0xcc97('0x3a')]+'%'};return _0x55052d;}})});}_0x7ae6ba=_[_0xcc97('0x3d')]({},_0x7ae6ba,_0x241aca[_0xcc97('0x3e')]);var _0x38ba79={'where':_0x7ae6ba[_0xcc97('0x38')]};return db[_0xcc97('0x3f')][_0xcc97('0x1f')](_0x38ba79)[_0xcc97('0x24')](function(_0x1b6a58){_0x4eaccf[_0xcc97('0x1f')]=_0x1b6a58;if(_0x241aca[_0xcc97('0x30')]['includeAll']){_0x7ae6ba[_0xcc97('0x40')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xcc97('0x41')](_0x7ae6ba);})[_0xcc97('0x24')](function(_0x2fdc51){_0x4eaccf[_0xcc97('0x42')]=_0x2fdc51;return _0x4eaccf;})['then'](respondWithFilteredResult(_0x15c678,_0x7ae6ba))[_0xcc97('0x43')](handleError(_0x15c678,null));};exports[_0xcc97('0x44')]=function(_0x5bd91d,_0x5935e6){var _0x14d825={'raw':!![],'where':{'id':_0x5bd91d['params']['id']}},_0x40c1cb={};_0x40c1cb[_0xcc97('0x2f')]=_[_0xcc97('0x31')](db[_0xcc97('0x3f')][_0xcc97('0x2d')]);_0x40c1cb[_0xcc97('0x30')]=_[_0xcc97('0x31')](_0x5bd91d[_0xcc97('0x30')]);_0x40c1cb['filters']=_[_0xcc97('0x33')](_0x40c1cb[_0xcc97('0x2f')],_0x40c1cb[_0xcc97('0x30')]);_0x14d825[_0xcc97('0x34')]=_[_0xcc97('0x33')](_0x40c1cb[_0xcc97('0x2f')],qs['fields'](_0x5bd91d[_0xcc97('0x30')]['fields']));_0x14d825[_0xcc97('0x34')]=_0x14d825[_0xcc97('0x34')]['length']?_0x14d825[_0xcc97('0x34')]:_0x40c1cb['model'];if(_0x5bd91d[_0xcc97('0x30')][_0xcc97('0x45')]){_0x14d825[_0xcc97('0x40')]=[{'all':!![]}];}_0x14d825=_[_0xcc97('0x3d')]({},_0x14d825,_0x5bd91d[_0xcc97('0x3e')]);return db['FaxTransferReport'][_0xcc97('0x46')](_0x14d825)[_0xcc97('0x24')](handleEntityNotFound(_0x5935e6,null))[_0xcc97('0x24')](respondWithResult(_0x5935e6,null))[_0xcc97('0x43')](handleError(_0x5935e6,null));};exports[_0xcc97('0x47')]=function(_0x210766,_0x1ce261){return db['FaxTransferReport'][_0xcc97('0x47')](_0x210766['body'],{})[_0xcc97('0x24')](respondWithResult(_0x1ce261,0xc9))[_0xcc97('0x43')](handleError(_0x1ce261,null));};exports[_0xcc97('0x23')]=function(_0x4680d6,_0x5a190e){if(_0x4680d6[_0xcc97('0x48')]['id']){delete _0x4680d6[_0xcc97('0x48')]['id'];}return db[_0xcc97('0x3f')][_0xcc97('0x46')]({'where':{'id':_0x4680d6[_0xcc97('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a190e,null))[_0xcc97('0x24')](saveUpdates(_0x4680d6[_0xcc97('0x48')],null))[_0xcc97('0x24')](respondWithResult(_0x5a190e,null))['catch'](handleError(_0x5a190e,null));};exports['destroy']=function(_0x26b62c,_0x392ee2){return db[_0xcc97('0x3f')][_0xcc97('0x46')]({'where':{'id':_0x26b62c['params']['id']}})[_0xcc97('0x24')](handleEntityNotFound(_0x392ee2,null))[_0xcc97('0x24')](removeEntity(_0x392ee2,null))[_0xcc97('0x43')](handleError(_0x392ee2,null));};exports[_0xcc97('0x4a')]=function(_0x61cc94,_0x111df1){return db[_0xcc97('0x3f')][_0xcc97('0x4a')]()[_0xcc97('0x24')](respondWithResult(_0x111df1,null))[_0xcc97('0x43')](handleError(_0x111df1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 6a46df3..3be6cf3 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 _0x6df7=['./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x33dffc,_0x5d2bf5){var _0x27db7f=function(_0x482a59){while(--_0x482a59){_0x33dffc['push'](_0x33dffc['shift']());}};_0x27db7f(++_0x5d2bf5);}(_0x6df7,0x72));var _0x76df=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6df7[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x76df('0x0'));var util=require('util');var logger=require(_0x76df('0x1'))(_0x76df('0x2'));var moment=require('moment');var BPromise=require(_0x76df('0x3'));var rp=require(_0x76df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76df('0x5'));var config=require(_0x76df('0x6'));var attributes=require(_0x76df('0x7'));module['exports']=function(_0x247223,_0x4750a0){return _0x247223[_0x76df('0x8')]('FaxTransferReport',attributes,{'tableName':_0x76df('0x9'),'paranoid':![],'indexes':[{'name':_0x76df('0xa'),'fields':[_0x76df('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4959=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger'];(function(_0x1c19dd,_0x39dbcc){var _0x2c2f5f=function(_0xd987f8){while(--_0xd987f8){_0x1c19dd['push'](_0x1c19dd['shift']());}};_0x2c2f5f(++_0x39dbcc);}(_0x4959,0x9b));var _0x9495=function(_0x190e37,_0x919aac){_0x190e37=_0x190e37-0x0;var _0x2460cb=_0x4959[_0x190e37];return _0x2460cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9495('0x0'))(_0x9495('0x1'));var moment=require(_0x9495('0x2'));var BPromise=require('bluebird');var rp=require(_0x9495('0x3'));var fs=require('fs');var path=require(_0x9495('0x4'));var rimraf=require(_0x9495('0x5'));var config=require(_0x9495('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x9495('0x7')]=function(_0x2225a0,_0x2c716d){return _0x2225a0[_0x9495('0x8')](_0x9495('0x9'),attributes,{'tableName':_0x9495('0xa'),'paranoid':![],'indexes':[{'name':_0x9495('0xb'),'fields':[_0x9495('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index c61de48..59b626b 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 _0x264e=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x296db4,_0x3244dc){var _0x44e41c=function(_0x3c2119){while(--_0x3c2119){_0x296db4['push'](_0x296db4['shift']());}};_0x44e41c(++_0x3244dc);}(_0x264e,0x19b));var _0xe264=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x264e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe264('0x0'));var util=require(_0xe264('0x1'));var moment=require(_0xe264('0x2'));var BPromise=require(_0xe264('0x3'));var rs=require(_0xe264('0x4'));var fs=require('fs');var Redis=require(_0xe264('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe264('0x6'));var logger=require(_0xe264('0x7'))(_0xe264('0x8'));var config=require('../../config/environment');var jayson=require(_0xe264('0x9'));var client=jayson[_0xe264('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x357f39,_0x56dc82,_0x5c7b29){return new BPromise(function(_0x9b477,_0x20f4ab){return client[_0xe264('0xb')](_0x357f39,_0x5c7b29)[_0xe264('0xc')](function(_0x47ce4a){logger[_0xe264('0xd')](_0xe264('0xe'),_0x56dc82,_0xe264('0xf'));logger[_0xe264('0x10')](_0xe264('0x11'),_0x56dc82,_0xe264('0xf'),JSON['stringify'](_0x47ce4a));if(_0x47ce4a[_0xe264('0x12')]){if(_0x47ce4a[_0xe264('0x12')][_0xe264('0x13')]===0x1f4){logger['error'](_0xe264('0xe'),_0x56dc82,_0x47ce4a[_0xe264('0x12')][_0xe264('0x14')]);return _0x20f4ab(_0x47ce4a[_0xe264('0x12')]['message']);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x56dc82,_0x47ce4a[_0xe264('0x12')][_0xe264('0x14')]);return _0x9b477(_0x47ce4a[_0xe264('0x12')][_0xe264('0x14')]);}else{logger[_0xe264('0xd')](_0xe264('0xe'),_0x56dc82,_0xe264('0xf'));_0x9b477(_0x47ce4a[_0xe264('0x15')][_0xe264('0x14')]);}})[_0xe264('0x16')](function(_0x545da8){logger[_0xe264('0x12')](_0xe264('0xe'),_0x56dc82,_0x545da8);_0x20f4ab(_0x545da8);});});} \ No newline at end of file +var _0x47b5=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3f4216,_0x566173){var _0x569a93=function(_0x46e035){while(--_0x46e035){_0x3f4216['push'](_0x3f4216['shift']());}};_0x569a93(++_0x566173);}(_0x47b5,0x84));var _0x547b=function(_0x46978d,_0x537c09){_0x46978d=_0x46978d-0x0;var _0x4a6a6f=_0x47b5[_0x46978d];return _0x4a6a6f;};'use strict';var _=require(_0x547b('0x0'));var util=require(_0x547b('0x1'));var moment=require(_0x547b('0x2'));var BPromise=require(_0x547b('0x3'));var rs=require(_0x547b('0x4'));var fs=require('fs');var Redis=require(_0x547b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x547b('0x6'))(_0x547b('0x7'));var config=require(_0x547b('0x8'));var jayson=require(_0x547b('0x9'));var client=jayson[_0x547b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3734,_0x207730,_0x49481f){return new BPromise(function(_0x449432,_0x19c523){return client['request'](_0x5f3734,_0x49481f)['then'](function(_0x4c31a4){logger[_0x547b('0xb')](_0x547b('0xc'),_0x207730,'request\x20sent');logger[_0x547b('0xd')](_0x547b('0xe'),_0x207730,_0x547b('0xf'),JSON[_0x547b('0x10')](_0x4c31a4));if(_0x4c31a4[_0x547b('0x11')]){if(_0x4c31a4[_0x547b('0x11')][_0x547b('0x12')]===0x1f4){logger[_0x547b('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x207730,_0x4c31a4['error'][_0x547b('0x13')]);return _0x19c523(_0x4c31a4[_0x547b('0x11')][_0x547b('0x13')]);}logger[_0x547b('0x11')](_0x547b('0xc'),_0x207730,_0x4c31a4[_0x547b('0x11')][_0x547b('0x13')]);return _0x449432(_0x4c31a4[_0x547b('0x11')][_0x547b('0x13')]);}else{logger[_0x547b('0xb')](_0x547b('0xc'),_0x207730,_0x547b('0xf'));_0x449432(_0x4c31a4[_0x547b('0x14')][_0x547b('0x13')]);}})[_0x547b('0x15')](function(_0x35de61){logger[_0x547b('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x207730,_0x35de61);_0x19c523(_0x35de61);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 9123e17..8cba88b 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 _0x938a=['create','put','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0xfb1a1e,_0x93ee21){var _0x11736f=function(_0x41476c){while(--_0x41476c){_0xfb1a1e['push'](_0xfb1a1e['shift']());}};_0x11736f(++_0x93ee21);}(_0x938a,0x9c));var _0xa938=function(_0x17e88d,_0x4eb953){_0x17e88d=_0x17e88d-0x0;var _0x44ce6b=_0x938a[_0x17e88d];return _0x44ce6b;};'use strict';var multer=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var path=require('path');var timeout=require(_0xa938('0x2'));var express=require(_0xa938('0x3'));var router=express['Router']();var fs_extra=require(_0xa938('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa938('0x5'));var config=require(_0xa938('0x6'));var controller=require(_0xa938('0x7'));router[_0xa938('0x8')]('/',auth[_0xa938('0x9')](),controller[_0xa938('0xa')]);router[_0xa938('0x8')](_0xa938('0xb'),auth[_0xa938('0x9')](),controller[_0xa938('0xc')]);router[_0xa938('0x8')](_0xa938('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa938('0xe')]('/',auth[_0xa938('0x9')](),controller[_0xa938('0xf')]);router[_0xa938('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa938('0x11')]);router['delete']('/:id',auth[_0xa938('0x9')](),controller[_0xa938('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe60b=['../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xe60b,0x1de));var _0xbe60=function(_0x1911d0,_0x220afb){_0x1911d0=_0x1911d0-0x0;var _0x10af12=_0xe60b[_0x1911d0];return _0x10af12;};'use strict';var multer=require(_0xbe60('0x0'));var util=require('util');var path=require(_0xbe60('0x1'));var timeout=require('connect-timeout');var express=require(_0xbe60('0x2'));var router=express['Router']();var fs_extra=require(_0xbe60('0x3'));var auth=require(_0xbe60('0x4'));var interaction=require(_0xbe60('0x5'));var config=require('../../config/environment');var controller=require(_0xbe60('0x6'));router[_0xbe60('0x7')]('/',auth[_0xbe60('0x8')](),controller[_0xbe60('0x9')]);router[_0xbe60('0x7')](_0xbe60('0xa'),auth[_0xbe60('0x8')](),controller[_0xbe60('0xb')]);router['get'](_0xbe60('0xc'),auth[_0xbe60('0x8')](),controller[_0xbe60('0xd')]);router[_0xbe60('0xe')]('/',auth[_0xbe60('0x8')](),controller[_0xbe60('0xf')]);router[_0xbe60('0x10')]('/:id',auth[_0xbe60('0x8')](),controller[_0xbe60('0x11')]);router[_0xbe60('0x12')](_0xbe60('0xc'),auth[_0xbe60('0x8')](),controller[_0xbe60('0x13')]);module[_0xbe60('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 81f03a9..e94f390 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 _0xf945=['/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations'];(function(_0x34940d,_0x5eabf7){var _0xd411dc=function(_0x4a35a5){while(--_0x4a35a5){_0x34940d['push'](_0x34940d['shift']());}};_0xd411dc(++_0x5eabf7);}(_0xf945,0x14b));var _0x5f94=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf945[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x5f94('0x0'));var util=require(_0x5f94('0x1'));var path=require('path');var timeout=require(_0x5f94('0x2'));var express=require(_0x5f94('0x3'));var router=express['Router']();var fs_extra=require(_0x5f94('0x4'));var auth=require(_0x5f94('0x5'));var interaction=require(_0x5f94('0x6'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x5f94('0x7')](),controller[_0x5f94('0x8')]);router[_0x5f94('0x9')](_0x5f94('0xa'),auth[_0x5f94('0x7')](),controller[_0x5f94('0xb')]);router[_0x5f94('0x9')](_0x5f94('0xc'),auth['isAuthenticated'](),controller[_0x5f94('0xd')]);router['get'](_0x5f94('0xe'),auth[_0x5f94('0x7')](),controller[_0x5f94('0xf')]);router[_0x5f94('0x10')]('/',auth['isAuthenticated'](),controller[_0x5f94('0x11')]);router[_0x5f94('0x10')](_0x5f94('0xc'),auth['isAuthenticated'](),controller[_0x5f94('0x12')]);router['put'](_0x5f94('0xa'),auth[_0x5f94('0x7')](),controller[_0x5f94('0x13')]);router[_0x5f94('0x14')](_0x5f94('0xa'),auth[_0x5f94('0x7')](),controller[_0x5f94('0x15')]);module[_0x5f94('0x16')]=router; \ No newline at end of file +var _0x22b6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','multer','util','path'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x22b6,0x174));var _0x622b=function(_0x418c43,_0xc9bc24){_0x418c43=_0x418c43-0x0;var _0x5d8c1c=_0x22b6[_0x418c43];return _0x5d8c1c;};'use strict';var multer=require(_0x622b('0x0'));var util=require(_0x622b('0x1'));var path=require(_0x622b('0x2'));var timeout=require(_0x622b('0x3'));var express=require(_0x622b('0x4'));var router=express[_0x622b('0x5')]();var fs_extra=require(_0x622b('0x6'));var auth=require(_0x622b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x622b('0x8'));var controller=require(_0x622b('0x9'));router[_0x622b('0xa')]('/',auth['isAuthenticated'](),controller[_0x622b('0xb')]);router[_0x622b('0xa')](_0x622b('0xc'),auth[_0x622b('0xd')](),controller[_0x622b('0xe')]);router['get'](_0x622b('0xf'),auth['isAuthenticated'](),controller[_0x622b('0x10')]);router[_0x622b('0xa')](_0x622b('0x11'),auth[_0x622b('0xd')](),controller[_0x622b('0x12')]);router['post']('/',auth[_0x622b('0xd')](),controller[_0x622b('0x13')]);router[_0x622b('0x14')]('/:id/configurations',auth[_0x622b('0xd')](),controller[_0x622b('0x15')]);router['put'](_0x622b('0xc'),auth[_0x622b('0xd')](),controller[_0x622b('0x16')]);router[_0x622b('0x17')](_0x622b('0xc'),auth[_0x622b('0xd')](),controller[_0x622b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 7206da7..5ae9ab0 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 _0x519a=['STRING','ENUM','basic','integrationTab','newTab','exports'];(function(_0x2814f7,_0x341c19){var _0x274a7f=function(_0x35a589){while(--_0x35a589){_0x2814f7['push'](_0x2814f7['shift']());}};_0x274a7f(++_0x341c19);}(_0x519a,0x1bb));var _0xa519=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0x519a[_0x142020];return _0x40da8f;};'use strict';var Sequelize=require('sequelize');module[_0xa519('0x0')]={'name':{'type':Sequelize[_0xa519('0x1')]},'description':{'type':Sequelize[_0xa519('0x1')]},'username':{'type':Sequelize[_0xa519('0x1')]},'remoteUri':{'type':Sequelize[_0xa519('0x1')]},'authType':{'type':Sequelize[_0xa519('0x2')]('basic'),'defaultValue':_0xa519('0x3')},'password':{'type':Sequelize[_0xa519('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xa519('0x1')]},'serverUrl':{'type':Sequelize[_0xa519('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa519('0x2')](_0xa519('0x4'),_0xa519('0x5')),'defaultValue':_0xa519('0x4')}}; \ No newline at end of file +var _0x907f=['basic','newTab','sequelize','STRING','ENUM'];(function(_0xe56e7c,_0x2d3a7d){var _0x1bf94f=function(_0x161cd5){while(--_0x161cd5){_0xe56e7c['push'](_0xe56e7c['shift']());}};_0x1bf94f(++_0x2d3a7d);}(_0x907f,0x197));var _0xf907=function(_0x5bf2e6,_0x54759b){_0x5bf2e6=_0x5bf2e6-0x0;var _0x5dcc44=_0x907f[_0x5bf2e6];return _0x5dcc44;};'use strict';var Sequelize=require(_0xf907('0x0'));module['exports']={'name':{'type':Sequelize[_0xf907('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf907('0x1')]},'authType':{'type':Sequelize[_0xf907('0x2')](_0xf907('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xf907('0x1')]},'consumerKey':{'type':Sequelize[_0xf907('0x1')]},'consumerSecret':{'type':Sequelize[_0xf907('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xf907('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf907('0x2')]('integrationTab',_0xf907('0x4')),'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 a16248c..4283047 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 _0x858a=['error','stack','name','send','fieldName','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskAccount','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','label','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','sendStatus'];(function(_0x2c50a6,_0x2a9854){var _0x3e6556=function(_0x3ad784){while(--_0x3ad784){_0x2c50a6['push'](_0x2c50a6['shift']());}};_0x3e6556(++_0x2a9854);}(_0x858a,0x133));var _0xa858=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x858a[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xa858('0x0'));var rimraf=require(_0xa858('0x1'));var zipdir=require(_0xa858('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa858('0x3'));var moment=require(_0xa858('0x4'));var BPromise=require(_0xa858('0x5'));var Mustache=require('mustache');var util=require(_0xa858('0x6'));var path=require(_0xa858('0x7'));var sox=require(_0xa858('0x8'));var csv=require(_0xa858('0x9'));var ejs=require(_0xa858('0xa'));var fs=require('fs');var fs_extra=require(_0xa858('0xb'));var _=require('lodash');var squel=require(_0xa858('0xc'));var crypto=require(_0xa858('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa858('0xe'));var toCsv=require(_0xa858('0x9'));var querystring=require(_0xa858('0xf'));var Papa=require('papaparse');var Redis=require(_0xa858('0x10'));var authService=require(_0xa858('0x11'));var qs=require(_0xa858('0x12'));var as=require(_0xa858('0x13'));var hardwareService=require(_0xa858('0x14'));var logger=require(_0xa858('0x15'))(_0xa858('0x16'));var utils=require(_0xa858('0x17'));var config=require(_0xa858('0x18'));var licenseUtil=require(_0xa858('0x19'));var db=require(_0xa858('0x1a'))['db'];var integrations=require(_0xa858('0x1b'));function respondWithStatusCode(_0x4c7f40,_0x57d05c){_0x57d05c=_0x57d05c||0xcc;return function(_0x19a1b4){if(_0x19a1b4){return _0x4c7f40['sendStatus'](_0x57d05c);}return _0x4c7f40[_0xa858('0x1c')](_0x57d05c)['end']();};}function respondWithResult(_0x309541,_0x38330c){_0x38330c=_0x38330c||0xc8;return function(_0x173a1a){if(_0x173a1a){return _0x309541[_0xa858('0x1c')](_0x38330c)[_0xa858('0x1d')](_0x173a1a);}};}function respondWithFilteredResult(_0x5cf13c,_0x45826c){return function(_0x57a856){if(_0x57a856){var _0x40bcb5=typeof _0x45826c[_0xa858('0x1e')]===_0xa858('0x1f')&&typeof _0x45826c[_0xa858('0x20')]===_0xa858('0x1f');var _0x550df0=_0x57a856[_0xa858('0x21')];var _0x21f13e=_0x40bcb5?0x0:_0x45826c[_0xa858('0x1e')];var _0x5116c9=_0x40bcb5?_0x57a856[_0xa858('0x21')]:_0x45826c[_0xa858('0x1e')]+_0x45826c[_0xa858('0x20')];var _0x7ea431;if(_0x5116c9>=_0x550df0){_0x5116c9=_0x550df0;_0x7ea431=0xc8;}else{_0x7ea431=0xce;}_0x5cf13c[_0xa858('0x1c')](_0x7ea431);return _0x5cf13c[_0xa858('0x22')]('Content-Range',_0x21f13e+'-'+_0x5116c9+'/'+_0x550df0)[_0xa858('0x1d')](_0x57a856);}return null;};}function patchUpdates(_0x160648){return function(_0x2cbacb){try{jsonpatch[_0xa858('0x23')](_0x2cbacb,_0x160648,!![]);}catch(_0x3b1689){return BPromise['reject'](_0x3b1689);}return _0x2cbacb[_0xa858('0x24')]();};}function saveUpdates(_0x485021,_0x2f6a0c){return function(_0x1d37b7){if(_0x1d37b7){return _0x1d37b7[_0xa858('0x25')](_0x485021)[_0xa858('0x26')](function(_0x2bca24){return _0x2bca24;});}return null;};}function removeEntity(_0x54b24e,_0x2a8e56){return function(_0x5c041e){if(_0x5c041e){return _0x5c041e['destroy']()[_0xa858('0x26')](function(){_0x54b24e[_0xa858('0x1c')](0xcc)[_0xa858('0x27')]();});}};}function handleEntityNotFound(_0x3343d3,_0x4417ee){return function(_0x1e06c1){if(!_0x1e06c1){_0x3343d3[_0xa858('0x28')](0x194);}return _0x1e06c1;};}function handleError(_0x47fc4b,_0x523abb){_0x523abb=_0x523abb||0x1f4;return function(_0x248364){logger[_0xa858('0x29')](_0x248364[_0xa858('0x2a')]);if(_0x248364[_0xa858('0x2b')]){delete _0x248364[_0xa858('0x2b')];}_0x47fc4b['status'](_0x523abb)[_0xa858('0x2c')](_0x248364);};}exports['index']=function(_0x559444,_0x7e0565){var _0x117df1={},_0x47512f={},_0x160284={'count':0x0,'rows':[]};var _0x3c150d=_['map'](db['DeskAccount']['rawAttributes'],function(_0x5033ad){return{'name':_0x5033ad[_0xa858('0x2d')],'type':_0x5033ad[_0xa858('0x2e')]['key']};});_0x47512f[_0xa858('0x2f')]=_[_0xa858('0x30')](_0x3c150d,_0xa858('0x2b'));_0x47512f['query']=_['keys'](_0x559444['query']);_0x47512f[_0xa858('0x31')]=_[_0xa858('0x32')](_0x47512f[_0xa858('0x2f')],_0x47512f[_0xa858('0x33')]);_0x117df1[_0xa858('0x34')]=_[_0xa858('0x32')](_0x47512f[_0xa858('0x2f')],qs[_0xa858('0x35')](_0x559444[_0xa858('0x33')][_0xa858('0x35')]));_0x117df1[_0xa858('0x34')]=_0x117df1[_0xa858('0x34')][_0xa858('0x36')]?_0x117df1[_0xa858('0x34')]:_0x47512f[_0xa858('0x2f')];if(!_0x559444[_0xa858('0x33')][_0xa858('0x37')](_0xa858('0x38'))){_0x117df1[_0xa858('0x20')]=qs[_0xa858('0x20')](_0x559444[_0xa858('0x33')][_0xa858('0x20')]);_0x117df1[_0xa858('0x1e')]=qs[_0xa858('0x1e')](_0x559444[_0xa858('0x33')][_0xa858('0x1e')]);}_0x117df1[_0xa858('0x39')]=qs[_0xa858('0x3a')](_0x559444[_0xa858('0x33')]['sort']);_0x117df1[_0xa858('0x3b')]=qs[_0xa858('0x31')](_[_0xa858('0x3c')](_0x559444[_0xa858('0x33')],_0x47512f[_0xa858('0x31')]),_0x3c150d);if(_0x559444['query'][_0xa858('0x3d')]){_0x117df1[_0xa858('0x3b')]=_[_0xa858('0x3e')](_0x117df1[_0xa858('0x3b')],{'$or':_[_0xa858('0x30')](_0x3c150d,function(_0x366cfa){if(_0x366cfa['type']!==_0xa858('0x3f')){var _0x38fd10={};_0x38fd10[_0x366cfa[_0xa858('0x2b')]]={'$like':'%'+_0x559444[_0xa858('0x33')]['filter']+'%'};return _0x38fd10;}})});}_0x117df1=_[_0xa858('0x3e')]({},_0x117df1,_0x559444[_0xa858('0x40')]);var _0xb543c1={'where':_0x117df1[_0xa858('0x3b')]};return db[_0xa858('0x41')][_0xa858('0x21')](_0xb543c1)[_0xa858('0x26')](function(_0x478b5e){_0x160284['count']=_0x478b5e;if(_0x559444[_0xa858('0x33')][_0xa858('0x42')]){_0x117df1[_0xa858('0x43')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x117df1);})[_0xa858('0x26')](function(_0x305600){_0x160284[_0xa858('0x44')]=_0x305600;return _0x160284;})[_0xa858('0x26')](respondWithFilteredResult(_0x7e0565,_0x117df1))[_0xa858('0x45')](handleError(_0x7e0565,null));};exports['show']=function(_0x3db209,_0xd1894e){var _0x5d28aa={'raw':![],'where':{'id':_0x3db209[_0xa858('0x46')]['id']}},_0x14afba={};_0x14afba[_0xa858('0x2f')]=_[_0xa858('0x47')](db['DeskAccount'][_0xa858('0x48')]);_0x14afba[_0xa858('0x33')]=_[_0xa858('0x47')](_0x3db209['query']);_0x14afba[_0xa858('0x31')]=_['intersection'](_0x14afba[_0xa858('0x2f')],_0x14afba['query']);_0x5d28aa[_0xa858('0x34')]=_[_0xa858('0x32')](_0x14afba[_0xa858('0x2f')],qs[_0xa858('0x35')](_0x3db209[_0xa858('0x33')][_0xa858('0x35')]));_0x5d28aa[_0xa858('0x34')]=_0x5d28aa[_0xa858('0x34')][_0xa858('0x36')]?_0x5d28aa[_0xa858('0x34')]:_0x14afba[_0xa858('0x2f')];if(_0x3db209[_0xa858('0x33')][_0xa858('0x42')]){_0x5d28aa[_0xa858('0x43')]=[{'all':!![]}];}_0x5d28aa=_[_0xa858('0x3e')]({},_0x5d28aa,_0x3db209[_0xa858('0x40')]);return db[_0xa858('0x41')][_0xa858('0x49')](_0x5d28aa)[_0xa858('0x26')](handleEntityNotFound(_0xd1894e,null))['then'](respondWithResult(_0xd1894e,null))[_0xa858('0x45')](handleError(_0xd1894e,null));};exports[_0xa858('0x4a')]=function(_0x5c63b1,_0x12805f){return db[_0xa858('0x41')][_0xa858('0x4a')](_0x5c63b1[_0xa858('0x4b')],{})[_0xa858('0x26')](respondWithResult(_0x12805f,0xc9))[_0xa858('0x45')](handleError(_0x12805f,null));};exports[_0xa858('0x25')]=function(_0x101917,_0x3421f7){if(_0x101917['body']['id']){delete _0x101917[_0xa858('0x4b')]['id'];}return db[_0xa858('0x41')][_0xa858('0x49')]({'where':{'id':_0x101917[_0xa858('0x46')]['id']}})[_0xa858('0x26')](handleEntityNotFound(_0x3421f7,null))[_0xa858('0x26')](saveUpdates(_0x101917['body'],null))[_0xa858('0x26')](respondWithResult(_0x3421f7,null))[_0xa858('0x45')](handleError(_0x3421f7,null));};exports[_0xa858('0x4c')]=function(_0x1a83b,_0x409ed5){return db['DeskAccount'][_0xa858('0x49')]({'where':{'id':_0x1a83b[_0xa858('0x46')]['id']}})[_0xa858('0x26')](handleEntityNotFound(_0x409ed5,null))[_0xa858('0x26')](removeEntity(_0x409ed5,null))[_0xa858('0x45')](handleError(_0x409ed5,null));};exports[_0xa858('0x4d')]=function(_0x2cf7f7,_0x30493c,_0x2bd412){var _0x473de8={};var _0x2169e1={};var _0x3d1e61;var _0x400fc3;return db[_0xa858('0x41')][_0xa858('0x4e')]({'where':{'id':_0x2cf7f7['params']['id']}})[_0xa858('0x26')](handleEntityNotFound(_0x30493c,null))[_0xa858('0x26')](function(_0x1e874b){if(_0x1e874b){_0x3d1e61=_0x1e874b;_0x2169e1[_0xa858('0x2f')]=_[_0xa858('0x47')](db[_0xa858('0x4f')][_0xa858('0x48')]);_0x2169e1[_0xa858('0x33')]=_[_0xa858('0x47')](_0x2cf7f7['query']);_0x2169e1['filters']=_['intersection'](_0x2169e1[_0xa858('0x2f')],_0x2169e1[_0xa858('0x33')]);_0x473de8[_0xa858('0x34')]=_[_0xa858('0x32')](_0x2169e1[_0xa858('0x2f')],qs[_0xa858('0x35')](_0x2cf7f7[_0xa858('0x33')][_0xa858('0x35')]));_0x473de8['attributes']=_0x473de8[_0xa858('0x34')][_0xa858('0x36')]?_0x473de8[_0xa858('0x34')]:_0x2169e1[_0xa858('0x2f')];_0x473de8[_0xa858('0x39')]=qs['sort'](_0x2cf7f7[_0xa858('0x33')][_0xa858('0x3a')]);_0x473de8[_0xa858('0x3b')]=qs['filters'](_['pick'](_0x2cf7f7[_0xa858('0x33')],_0x2169e1[_0xa858('0x31')]));if(_0x2cf7f7[_0xa858('0x33')][_0xa858('0x3d')]){_0x473de8[_0xa858('0x3b')]=_[_0xa858('0x3e')](_0x473de8[_0xa858('0x3b')],{'$or':_[_0xa858('0x30')](_0x473de8[_0xa858('0x34')],function(_0x24b08a){var _0x4317c8={};_0x4317c8[_0x24b08a]={'$like':'%'+_0x2cf7f7['query'][_0xa858('0x3d')]+'%'};return _0x4317c8;})});}_0x473de8=_[_0xa858('0x3e')]({},_0x473de8,_0x2cf7f7[_0xa858('0x40')]);return _0x3d1e61[_0xa858('0x4d')](_0x473de8);}})[_0xa858('0x26')](function(_0x59e222){if(_0x59e222){_0x400fc3=_0x59e222[_0xa858('0x36')];if(!_0x2cf7f7[_0xa858('0x33')][_0xa858('0x37')](_0xa858('0x38'))){_0x473de8[_0xa858('0x20')]=qs[_0xa858('0x20')](_0x2cf7f7[_0xa858('0x33')][_0xa858('0x20')]);_0x473de8[_0xa858('0x1e')]=qs[_0xa858('0x1e')](_0x2cf7f7['query'][_0xa858('0x1e')]);}return _0x3d1e61[_0xa858('0x4d')](_0x473de8);}})[_0xa858('0x26')](function(_0xd4c0fc){if(_0xd4c0fc){return _0xd4c0fc?{'count':_0x400fc3,'rows':_0xd4c0fc}:null;}})[_0xa858('0x26')](respondWithResult(_0x30493c,null))[_0xa858('0x45')](handleError(_0x30493c,null));};exports[_0xa858('0x50')]=function(_0x6d754c,_0x1d5c25,_0x40cbe4){if(_0x6d754c['body']['id']){delete _0x6d754c['body']['id'];}return db[_0xa858('0x41')][_0xa858('0x4e')]({'where':{'id':_0x6d754c['params']['id']}})[_0xa858('0x26')](handleEntityNotFound(_0x1d5c25,null))['then'](function(_0x53aa6b){if(_0x53aa6b){_0x6d754c[_0xa858('0x4b')][_0xa858('0x51')]=_0x53aa6b['id'];_0x6d754c['body'][_0xa858('0x52')]=integrations[_0xa858('0x53')](_0x6d754c[_0xa858('0x4b')][_0xa858('0x54')],_0x6d754c['body']['type']);_0x6d754c[_0xa858('0x4b')][_0xa858('0x55')]=integrations[_0xa858('0x56')](_0x6d754c[_0xa858('0x4b')]['channel'],_0x6d754c[_0xa858('0x4b')]['type']);return db[_0xa858('0x4f')][_0xa858('0x4a')](_0x6d754c[_0xa858('0x4b')],{'include':[{'model':db[_0xa858('0x57')],'as':'Subjects'},{'model':db[_0xa858('0x57')],'as':_0xa858('0x55')}]});}return null;})['then'](respondWithResult(_0x1d5c25,null))['catch'](handleError(_0x1d5c25,null));};exports[_0xa858('0x58')]=function(_0x124681,_0x48f0c8,_0x579d47){var _0x567055=[{'name':_0xa858('0x59'),'label':_0xa858('0x59'),'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 _0x8953d8='';return db['DeskAccount'][_0xa858('0x4e')]({'where':{'id':_0x124681[_0xa858('0x46')]['id']},'attributes':['id',_0xa858('0x5a'),_0xa858('0x5b'),_0xa858('0x5c'),_0xa858('0x5d'),_0xa858('0x5e'),_0xa858('0x5f'),_0xa858('0x60'),_0xa858('0x61')]})['then'](handleEntityNotFound(_0x48f0c8,null))[_0xa858('0x26')](function(_0x2a27db){if(_0x2a27db){_0x8953d8=_0x2a27db[_0xa858('0x5a')];var _0x5caf8c=_0x8953d8[_0xa858('0x62')](-0x1);if(_0x5caf8c==='/'){_0x8953d8=_0x8953d8['substring'](0x0,_0x8953d8[_0xa858('0x63')](_0x5caf8c));}var _0x461682={'method':'GET','uri':util[_0xa858('0x64')](_0xa858('0x65'),_0x8953d8),'headers':{'Content-Type':_0xa858('0x66'),'Accept':_0xa858('0x66')},'json':!![]};if(_0x2a27db['authType']===_0xa858('0x67')){_0x461682[_0xa858('0x68')][_0xa858('0x69')]=util['format'](_0xa858('0x6a'),new Buffer(util['format'](_0xa858('0x6b'),_0x2a27db[_0xa858('0x5c')],_0x2a27db[_0xa858('0x5d')]))[_0xa858('0x6c')](_0xa858('0x6d')));}return rp(_0x461682)[_0xa858('0x26')](function(_0xe6d52f){return _0x567055['concat'](_[_0xa858('0x30')](_0xe6d52f[_0xa858('0x6e')]['entries'],function(_0x33c4ec){return{'id':_0x33c4ec['name'],'name':_0x33c4ec[_0xa858('0x2b')],'type':_0x33c4ec[_0xa858('0x2e')],'active':_0x33c4ec['active'],'label':_0x33c4ec[_0xa858('0x6f')],'custom':!![]};}));});}})[_0xa858('0x26')](function(_0x42292e){return{'count':_0x42292e[_0xa858('0x36')],'rows':_0x42292e};})[_0xa858('0x26')](respondWithResult(_0x48f0c8,null))[_0xa858('0x45')](function(_0x39a1f3){var _0x11282b=_0x124681['query']['test']?0x1f4:_0x39a1f3['statusCode']||0x1f4;logger[_0xa858('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xa858('0x58'),_0x11282b,JSON[_0xa858('0x70')](_0x39a1f3));delete _0x39a1f3['name'];if(_0x11282b===0x191){_0x11282b=0x190;}_0x48f0c8[_0xa858('0x1c')](_0x11282b)[_0xa858('0x2c')](_0x124681['query'][_0xa858('0x71')]?{'message':_0xa858('0x72'),'statusCode':_0x39a1f3[_0xa858('0x73')]}:_0x39a1f3);});}; \ No newline at end of file +var _0xc4c8=['statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','crypto','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','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','end','error','stack','name','send','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','getFields','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Basic\x20%s','%s:%s','base64','concat','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0xc4c8,0xdd));var _0x8c4c=function(_0x3566cc,_0x33d93d){_0x3566cc=_0x3566cc-0x0;var _0x569937=_0xc4c8[_0x3566cc];return _0x569937;};'use strict';var emlformat=require(_0x8c4c('0x0'));var rimraf=require(_0x8c4c('0x1'));var zipdir=require(_0x8c4c('0x2'));var jsonpatch=require(_0x8c4c('0x3'));var rp=require(_0x8c4c('0x4'));var moment=require(_0x8c4c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8c4c('0x6'));var sox=require('sox');var csv=require(_0x8c4c('0x7'));var ejs=require(_0x8c4c('0x8'));var fs=require('fs');var fs_extra=require(_0x8c4c('0x9'));var _=require(_0x8c4c('0xa'));var squel=require('squel');var crypto=require(_0x8c4c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8c4c('0xc'));var toCsv=require(_0x8c4c('0x7'));var querystring=require(_0x8c4c('0xd'));var Papa=require('papaparse');var Redis=require(_0x8c4c('0xe'));var authService=require(_0x8c4c('0xf'));var qs=require(_0x8c4c('0x10'));var as=require(_0x8c4c('0x11'));var hardwareService=require(_0x8c4c('0x12'));var logger=require(_0x8c4c('0x13'))('api');var utils=require(_0x8c4c('0x14'));var config=require(_0x8c4c('0x15'));var licenseUtil=require(_0x8c4c('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8c4c('0x17'));function respondWithStatusCode(_0x166db8,_0x5935de){_0x5935de=_0x5935de||0xcc;return function(_0x4272d4){if(_0x4272d4){return _0x166db8[_0x8c4c('0x18')](_0x5935de);}return _0x166db8[_0x8c4c('0x19')](_0x5935de)['end']();};}function respondWithResult(_0x58d5bd,_0x56d36e){_0x56d36e=_0x56d36e||0xc8;return function(_0x40cbfc){if(_0x40cbfc){return _0x58d5bd['status'](_0x56d36e)[_0x8c4c('0x1a')](_0x40cbfc);}};}function respondWithFilteredResult(_0x16cef7,_0xce8f3e){return function(_0x31ab7b){if(_0x31ab7b){var _0x3575fb=typeof _0xce8f3e[_0x8c4c('0x1b')]==='undefined'&&typeof _0xce8f3e[_0x8c4c('0x1c')]===_0x8c4c('0x1d');var _0x58da9c=_0x31ab7b[_0x8c4c('0x1e')];var _0x115f52=_0x3575fb?0x0:_0xce8f3e[_0x8c4c('0x1b')];var _0x5c9c58=_0x3575fb?_0x31ab7b['count']:_0xce8f3e[_0x8c4c('0x1b')]+_0xce8f3e[_0x8c4c('0x1c')];var _0x2cccaa;if(_0x5c9c58>=_0x58da9c){_0x5c9c58=_0x58da9c;_0x2cccaa=0xc8;}else{_0x2cccaa=0xce;}_0x16cef7[_0x8c4c('0x19')](_0x2cccaa);return _0x16cef7[_0x8c4c('0x1f')](_0x8c4c('0x20'),_0x115f52+'-'+_0x5c9c58+'/'+_0x58da9c)[_0x8c4c('0x1a')](_0x31ab7b);}return null;};}function patchUpdates(_0x97a4cd){return function(_0xb1376d){try{jsonpatch[_0x8c4c('0x21')](_0xb1376d,_0x97a4cd,!![]);}catch(_0x377b05){return BPromise['reject'](_0x377b05);}return _0xb1376d[_0x8c4c('0x22')]();};}function saveUpdates(_0xa01428,_0x31c8e3){return function(_0x320899){if(_0x320899){return _0x320899['update'](_0xa01428)[_0x8c4c('0x23')](function(_0x5c9c77){return _0x5c9c77;});}return null;};}function removeEntity(_0x5aba77,_0x3a9745){return function(_0x182dd0){if(_0x182dd0){return _0x182dd0['destroy']()['then'](function(){_0x5aba77[_0x8c4c('0x19')](0xcc)[_0x8c4c('0x24')]();});}};}function handleEntityNotFound(_0x94bd28,_0x45f88c){return function(_0x3eecc4){if(!_0x3eecc4){_0x94bd28[_0x8c4c('0x18')](0x194);}return _0x3eecc4;};}function handleError(_0x1c5e43,_0x10b021){_0x10b021=_0x10b021||0x1f4;return function(_0x507ab1){logger[_0x8c4c('0x25')](_0x507ab1[_0x8c4c('0x26')]);if(_0x507ab1[_0x8c4c('0x27')]){delete _0x507ab1['name'];}_0x1c5e43['status'](_0x10b021)[_0x8c4c('0x28')](_0x507ab1);};}exports['index']=function(_0x40fec2,_0x469f5a){var _0x1345d8={},_0xca81d={},_0x5b7adf={'count':0x0,'rows':[]};var _0x46ae6a=_['map'](db[_0x8c4c('0x29')][_0x8c4c('0x2a')],function(_0x5d4ed0){return{'name':_0x5d4ed0[_0x8c4c('0x2b')],'type':_0x5d4ed0[_0x8c4c('0x2c')][_0x8c4c('0x2d')]};});_0xca81d[_0x8c4c('0x2e')]=_[_0x8c4c('0x2f')](_0x46ae6a,_0x8c4c('0x27'));_0xca81d[_0x8c4c('0x30')]=_['keys'](_0x40fec2[_0x8c4c('0x30')]);_0xca81d[_0x8c4c('0x31')]=_[_0x8c4c('0x32')](_0xca81d[_0x8c4c('0x2e')],_0xca81d[_0x8c4c('0x30')]);_0x1345d8['attributes']=_[_0x8c4c('0x32')](_0xca81d[_0x8c4c('0x2e')],qs[_0x8c4c('0x33')](_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x33')]));_0x1345d8[_0x8c4c('0x34')]=_0x1345d8[_0x8c4c('0x34')][_0x8c4c('0x35')]?_0x1345d8['attributes']:_0xca81d[_0x8c4c('0x2e')];if(!_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x36')](_0x8c4c('0x37'))){_0x1345d8[_0x8c4c('0x1c')]=qs[_0x8c4c('0x1c')](_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x1c')]);_0x1345d8[_0x8c4c('0x1b')]=qs[_0x8c4c('0x1b')](_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x1b')]);}_0x1345d8[_0x8c4c('0x38')]=qs[_0x8c4c('0x39')](_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x39')]);_0x1345d8[_0x8c4c('0x3a')]=qs['filters'](_[_0x8c4c('0x3b')](_0x40fec2[_0x8c4c('0x30')],_0xca81d[_0x8c4c('0x31')]),_0x46ae6a);if(_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x3c')]){_0x1345d8[_0x8c4c('0x3a')]=_['merge'](_0x1345d8[_0x8c4c('0x3a')],{'$or':_['map'](_0x46ae6a,function(_0x27aa00){if(_0x27aa00[_0x8c4c('0x2c')]!=='VIRTUAL'){var _0x37b740={};_0x37b740[_0x27aa00['name']]={'$like':'%'+_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x3c')]+'%'};return _0x37b740;}})});}_0x1345d8=_[_0x8c4c('0x3d')]({},_0x1345d8,_0x40fec2[_0x8c4c('0x3e')]);var _0x5a89e2={'where':_0x1345d8[_0x8c4c('0x3a')]};return db[_0x8c4c('0x29')]['count'](_0x5a89e2)['then'](function(_0x434879){_0x5b7adf['count']=_0x434879;if(_0x40fec2[_0x8c4c('0x30')][_0x8c4c('0x3f')]){_0x1345d8[_0x8c4c('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0x8c4c('0x41')](_0x1345d8);})['then'](function(_0x4101d9){_0x5b7adf[_0x8c4c('0x42')]=_0x4101d9;return _0x5b7adf;})[_0x8c4c('0x23')](respondWithFilteredResult(_0x469f5a,_0x1345d8))['catch'](handleError(_0x469f5a,null));};exports['show']=function(_0xda22b8,_0x59fc0d){var _0x1300a0={'raw':![],'where':{'id':_0xda22b8[_0x8c4c('0x43')]['id']}},_0x16575a={};_0x16575a[_0x8c4c('0x2e')]=_['keys'](db[_0x8c4c('0x29')][_0x8c4c('0x2a')]);_0x16575a[_0x8c4c('0x30')]=_[_0x8c4c('0x44')](_0xda22b8['query']);_0x16575a[_0x8c4c('0x31')]=_[_0x8c4c('0x32')](_0x16575a['model'],_0x16575a['query']);_0x1300a0['attributes']=_[_0x8c4c('0x32')](_0x16575a[_0x8c4c('0x2e')],qs['fields'](_0xda22b8[_0x8c4c('0x30')][_0x8c4c('0x33')]));_0x1300a0[_0x8c4c('0x34')]=_0x1300a0[_0x8c4c('0x34')][_0x8c4c('0x35')]?_0x1300a0[_0x8c4c('0x34')]:_0x16575a['model'];if(_0xda22b8[_0x8c4c('0x30')][_0x8c4c('0x3f')]){_0x1300a0[_0x8c4c('0x40')]=[{'all':!![]}];}_0x1300a0=_['merge']({},_0x1300a0,_0xda22b8['options']);return db[_0x8c4c('0x29')][_0x8c4c('0x45')](_0x1300a0)[_0x8c4c('0x23')](handleEntityNotFound(_0x59fc0d,null))[_0x8c4c('0x23')](respondWithResult(_0x59fc0d,null))[_0x8c4c('0x46')](handleError(_0x59fc0d,null));};exports['create']=function(_0x86ae56,_0x39f8bd){return db['DeskAccount'][_0x8c4c('0x47')](_0x86ae56[_0x8c4c('0x48')],{})[_0x8c4c('0x23')](respondWithResult(_0x39f8bd,0xc9))[_0x8c4c('0x46')](handleError(_0x39f8bd,null));};exports['update']=function(_0xb6e51b,_0x5dcd90){if(_0xb6e51b[_0x8c4c('0x48')]['id']){delete _0xb6e51b[_0x8c4c('0x48')]['id'];}return db[_0x8c4c('0x29')][_0x8c4c('0x45')]({'where':{'id':_0xb6e51b[_0x8c4c('0x43')]['id']}})[_0x8c4c('0x23')](handleEntityNotFound(_0x5dcd90,null))['then'](saveUpdates(_0xb6e51b[_0x8c4c('0x48')],null))[_0x8c4c('0x23')](respondWithResult(_0x5dcd90,null))[_0x8c4c('0x46')](handleError(_0x5dcd90,null));};exports['destroy']=function(_0x236cde,_0x2bc439){return db[_0x8c4c('0x29')][_0x8c4c('0x45')]({'where':{'id':_0x236cde[_0x8c4c('0x43')]['id']}})[_0x8c4c('0x23')](handleEntityNotFound(_0x2bc439,null))[_0x8c4c('0x23')](removeEntity(_0x2bc439,null))['catch'](handleError(_0x2bc439,null));};exports[_0x8c4c('0x49')]=function(_0x51932e,_0x45f4ef,_0x45ef7e){var _0x194eda={};var _0x5eb6b0={};var _0x4462b1;var _0x444ea5;return db[_0x8c4c('0x29')][_0x8c4c('0x4a')]({'where':{'id':_0x51932e[_0x8c4c('0x43')]['id']}})[_0x8c4c('0x23')](handleEntityNotFound(_0x45f4ef,null))[_0x8c4c('0x23')](function(_0x9a67a2){if(_0x9a67a2){_0x4462b1=_0x9a67a2;_0x5eb6b0[_0x8c4c('0x2e')]=_[_0x8c4c('0x44')](db[_0x8c4c('0x4b')][_0x8c4c('0x2a')]);_0x5eb6b0[_0x8c4c('0x30')]=_['keys'](_0x51932e[_0x8c4c('0x30')]);_0x5eb6b0[_0x8c4c('0x31')]=_[_0x8c4c('0x32')](_0x5eb6b0['model'],_0x5eb6b0['query']);_0x194eda[_0x8c4c('0x34')]=_['intersection'](_0x5eb6b0[_0x8c4c('0x2e')],qs['fields'](_0x51932e[_0x8c4c('0x30')][_0x8c4c('0x33')]));_0x194eda[_0x8c4c('0x34')]=_0x194eda[_0x8c4c('0x34')][_0x8c4c('0x35')]?_0x194eda[_0x8c4c('0x34')]:_0x5eb6b0[_0x8c4c('0x2e')];_0x194eda[_0x8c4c('0x38')]=qs[_0x8c4c('0x39')](_0x51932e[_0x8c4c('0x30')][_0x8c4c('0x39')]);_0x194eda['where']=qs[_0x8c4c('0x31')](_[_0x8c4c('0x3b')](_0x51932e['query'],_0x5eb6b0['filters']));if(_0x51932e[_0x8c4c('0x30')]['filter']){_0x194eda[_0x8c4c('0x3a')]=_[_0x8c4c('0x3d')](_0x194eda[_0x8c4c('0x3a')],{'$or':_['map'](_0x194eda[_0x8c4c('0x34')],function(_0x52cd84){var _0x509f59={};_0x509f59[_0x52cd84]={'$like':'%'+_0x51932e['query'][_0x8c4c('0x3c')]+'%'};return _0x509f59;})});}_0x194eda=_[_0x8c4c('0x3d')]({},_0x194eda,_0x51932e[_0x8c4c('0x3e')]);return _0x4462b1['getConfigurations'](_0x194eda);}})[_0x8c4c('0x23')](function(_0x4e4e66){if(_0x4e4e66){_0x444ea5=_0x4e4e66[_0x8c4c('0x35')];if(!_0x51932e[_0x8c4c('0x30')][_0x8c4c('0x36')](_0x8c4c('0x37'))){_0x194eda[_0x8c4c('0x1c')]=qs[_0x8c4c('0x1c')](_0x51932e[_0x8c4c('0x30')][_0x8c4c('0x1c')]);_0x194eda[_0x8c4c('0x1b')]=qs['offset'](_0x51932e[_0x8c4c('0x30')][_0x8c4c('0x1b')]);}return _0x4462b1[_0x8c4c('0x49')](_0x194eda);}})[_0x8c4c('0x23')](function(_0x1779af){if(_0x1779af){return _0x1779af?{'count':_0x444ea5,'rows':_0x1779af}:null;}})[_0x8c4c('0x23')](respondWithResult(_0x45f4ef,null))[_0x8c4c('0x46')](handleError(_0x45f4ef,null));};exports[_0x8c4c('0x4c')]=function(_0x89a838,_0x2b3615,_0x36af28){if(_0x89a838[_0x8c4c('0x48')]['id']){delete _0x89a838['body']['id'];}return db[_0x8c4c('0x29')][_0x8c4c('0x4a')]({'where':{'id':_0x89a838[_0x8c4c('0x43')]['id']}})[_0x8c4c('0x23')](handleEntityNotFound(_0x2b3615,null))['then'](function(_0x56f258){if(_0x56f258){_0x89a838[_0x8c4c('0x48')][_0x8c4c('0x4d')]=_0x56f258['id'];_0x89a838[_0x8c4c('0x48')][_0x8c4c('0x4e')]=integrations[_0x8c4c('0x4f')](_0x89a838['body'][_0x8c4c('0x50')],_0x89a838[_0x8c4c('0x48')][_0x8c4c('0x2c')]);_0x89a838[_0x8c4c('0x48')]['Descriptions']=integrations[_0x8c4c('0x51')](_0x89a838[_0x8c4c('0x48')]['channel'],_0x89a838[_0x8c4c('0x48')]['type']);return db[_0x8c4c('0x4b')][_0x8c4c('0x47')](_0x89a838[_0x8c4c('0x48')],{'include':[{'model':db[_0x8c4c('0x52')],'as':_0x8c4c('0x4e')},{'model':db[_0x8c4c('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2b3615,null))['catch'](handleError(_0x2b3615,null));};exports[_0x8c4c('0x53')]=function(_0x290822,_0x4f17ae,_0x3f82e9){var _0x35a2f2=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3abc2f='';return db[_0x8c4c('0x29')][_0x8c4c('0x4a')]({'where':{'id':_0x290822[_0x8c4c('0x43')]['id']},'attributes':['id','remoteUri',_0x8c4c('0x54'),_0x8c4c('0x55'),_0x8c4c('0x56'),_0x8c4c('0x57'),'consumerSecret',_0x8c4c('0x58'),_0x8c4c('0x59')]})[_0x8c4c('0x23')](handleEntityNotFound(_0x4f17ae,null))[_0x8c4c('0x23')](function(_0x533fa5){if(_0x533fa5){_0x3abc2f=_0x533fa5[_0x8c4c('0x5a')];var _0x2664ad=_0x3abc2f[_0x8c4c('0x5b')](-0x1);if(_0x2664ad==='/'){_0x3abc2f=_0x3abc2f['substring'](0x0,_0x3abc2f[_0x8c4c('0x5c')](_0x2664ad));}var _0x2d6866={'method':_0x8c4c('0x5d'),'uri':util[_0x8c4c('0x5e')](_0x8c4c('0x5f'),_0x3abc2f),'headers':{'Content-Type':_0x8c4c('0x60'),'Accept':_0x8c4c('0x60')},'json':!![]};if(_0x533fa5[_0x8c4c('0x54')]==='basic'){_0x2d6866[_0x8c4c('0x61')]['Authorization']=util[_0x8c4c('0x5e')](_0x8c4c('0x62'),new Buffer(util['format'](_0x8c4c('0x63'),_0x533fa5[_0x8c4c('0x55')],_0x533fa5[_0x8c4c('0x56')]))['toString'](_0x8c4c('0x64')));}return rp(_0x2d6866)[_0x8c4c('0x23')](function(_0x166955){return _0x35a2f2[_0x8c4c('0x65')](_[_0x8c4c('0x2f')](_0x166955['_embedded'][_0x8c4c('0x66')],function(_0x3f0736){return{'id':_0x3f0736[_0x8c4c('0x27')],'name':_0x3f0736[_0x8c4c('0x27')],'type':_0x3f0736[_0x8c4c('0x2c')],'active':_0x3f0736[_0x8c4c('0x67')],'label':_0x3f0736[_0x8c4c('0x68')],'custom':!![]};}));});}})[_0x8c4c('0x23')](function(_0x34f657){return{'count':_0x34f657[_0x8c4c('0x35')],'rows':_0x34f657};})[_0x8c4c('0x23')](respondWithResult(_0x4f17ae,null))[_0x8c4c('0x46')](function(_0xe9a0eb){var _0x46dce3=_0x290822['query'][_0x8c4c('0x69')]?0x1f4:_0xe9a0eb['statusCode']||0x1f4;logger[_0x8c4c('0x25')](_0x8c4c('0x6a'),_0x8c4c('0x53'),_0x46dce3,JSON[_0x8c4c('0x6b')](_0xe9a0eb));delete _0xe9a0eb['name'];if(_0x46dce3===0x191){_0x46dce3=0x190;}_0x4f17ae[_0x8c4c('0x19')](_0x46dce3)[_0x8c4c('0x28')](_0x290822[_0x8c4c('0x30')][_0x8c4c('0x69')]?{'message':_0x8c4c('0x6c'),'statusCode':_0xe9a0eb[_0x8c4c('0x6d')]}:_0xe9a0eb);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3655f46..db9e973 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 _0x8703=['int_desk_accounts','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x43ee98,_0x567741){var _0x2d7e32=function(_0x1f26f2){while(--_0x1f26f2){_0x43ee98['push'](_0x43ee98['shift']());}};_0x2d7e32(++_0x567741);}(_0x8703,0x1c4));var _0x3870=function(_0x475a09,_0xa223bb){_0x475a09=_0x475a09-0x0;var _0x37e46b=_0x8703[_0x475a09];return _0x37e46b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3870('0x0'))(_0x3870('0x1'));var moment=require(_0x3870('0x2'));var BPromise=require(_0x3870('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3870('0x4'));var rimraf=require(_0x3870('0x5'));var config=require(_0x3870('0x6'));var attributes=require(_0x3870('0x7'));var integrations=require(_0x3870('0x8'));module['exports']=function(_0x5630a9,_0x34cde2){return _0x5630a9[_0x3870('0x9')]('DeskAccount',attributes,{'tableName':_0x3870('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2161=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1f9b53,_0x5ccd61){var _0x3c747e=function(_0x31ce47){while(--_0x31ce47){_0x1f9b53['push'](_0x1f9b53['shift']());}};_0x3c747e(++_0x5ccd61);}(_0x2161,0x107));var _0x1216=function(_0x2a12c1,_0x20dd3d){_0x2a12c1=_0x2a12c1-0x0;var _0xd296c4=_0x2161[_0x2a12c1];return _0xd296c4;};'use strict';var _=require(_0x1216('0x0'));var util=require(_0x1216('0x1'));var logger=require(_0x1216('0x2'))('api');var moment=require(_0x1216('0x3'));var BPromise=require(_0x1216('0x4'));var rp=require(_0x1216('0x5'));var fs=require('fs');var path=require(_0x1216('0x6'));var rimraf=require(_0x1216('0x7'));var config=require(_0x1216('0x8'));var attributes=require(_0x1216('0x9'));var integrations=require(_0x1216('0xa'));module[_0x1216('0xb')]=function(_0xcb491,_0xb53540){return _0xcb491[_0x1216('0xc')](_0x1216('0xd'),attributes,{'tableName':_0x1216('0xe'),'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 7be0618..bd3f18c 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 _0x7407=['where','attributes','limit','include','model','map','raw','then','ShowDeskAccount','debug','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options'];(function(_0x1f0028,_0x26a4b4){var _0x2d4df2=function(_0xaf83b){while(--_0xaf83b){_0x1f0028['push'](_0x1f0028['shift']());}};_0x2d4df2(++_0x26a4b4);}(_0x7407,0xff));var _0x7740=function(_0x1a1aa4,_0x26b097){_0x1a1aa4=_0x1a1aa4-0x0;var _0x19411f=_0x7407[_0x1a1aa4];return _0x19411f;};'use strict';var _=require(_0x7740('0x0'));var util=require(_0x7740('0x1'));var moment=require(_0x7740('0x2'));var BPromise=require('bluebird');var rs=require(_0x7740('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7740('0x4'));var logger=require(_0x7740('0x5'))('rpc');var config=require(_0x7740('0x6'));var jayson=require(_0x7740('0x7'));var client=jayson[_0x7740('0x8')][_0x7740('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17570e,_0xab49ad,_0x3bf327){return new BPromise(function(_0x399a83,_0x4a3fed){return client[_0x7740('0xa')](_0x17570e,_0x3bf327)['then'](function(_0x591ae4){logger[_0x7740('0xb')](_0x7740('0xc'),_0xab49ad,_0x7740('0xd'));logger['debug'](_0x7740('0xe'),_0xab49ad,_0x7740('0xd'),JSON[_0x7740('0xf')](_0x591ae4));if(_0x591ae4['error']){if(_0x591ae4[_0x7740('0x10')][_0x7740('0x11')]===0x1f4){logger[_0x7740('0x10')]('DeskAccount,\x20%s,\x20%s',_0xab49ad,_0x591ae4[_0x7740('0x10')][_0x7740('0x12')]);return _0x4a3fed(_0x591ae4[_0x7740('0x10')]['message']);}logger[_0x7740('0x10')]('DeskAccount,\x20%s,\x20%s',_0xab49ad,_0x591ae4['error'][_0x7740('0x12')]);return _0x399a83(_0x591ae4[_0x7740('0x10')][_0x7740('0x12')]);}else{logger['info'](_0x7740('0xc'),_0xab49ad,_0x7740('0xd'));_0x399a83(_0x591ae4[_0x7740('0x13')]['message']);}})[_0x7740('0x14')](function(_0x1708c8){logger[_0x7740('0x10')](_0x7740('0xc'),_0xab49ad,_0x1708c8);_0x4a3fed(_0x1708c8);});});}exports[_0x7740('0x15')]=function(_0x506714){var _0x5d706a=this;return new Promise(function(_0x4ed4c4,_0x76f2df){return db[_0x7740('0x16')][_0x7740('0x17')]({'raw':_0x506714[_0x7740('0x18')]?_0x506714[_0x7740('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x506714['options']?_0x506714['options'][_0x7740('0x19')]||null:null,'attributes':_0x506714['options']?_0x506714['options'][_0x7740('0x1a')]||null:null,'limit':_0x506714['options']?_0x506714[_0x7740('0x18')][_0x7740('0x1b')]||null:null,'include':_0x506714[_0x7740('0x18')]?_0x506714[_0x7740('0x18')][_0x7740('0x1c')]?_['map'](_0x506714[_0x7740('0x18')][_0x7740('0x1c')],function(_0x13b090){return{'model':db[_0x13b090[_0x7740('0x1d')]],'as':_0x13b090['as'],'attributes':_0x13b090[_0x7740('0x1a')],'include':_0x13b090['include']?_['map'](_0x13b090['include'],function(_0x2ba360){return{'model':db[_0x2ba360[_0x7740('0x1d')]],'as':_0x2ba360['as'],'attributes':_0x2ba360[_0x7740('0x1a')],'include':_0x2ba360[_0x7740('0x1c')]?_[_0x7740('0x1e')](_0x2ba360[_0x7740('0x1c')],function(_0x89cb76){return{'model':db[_0x89cb76[_0x7740('0x1d')]],'as':_0x89cb76['as'],'attributes':_0x89cb76[_0x7740('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x547517){logger[_0x7740('0xb')](_0x7740('0x15'),_0x506714);logger['debug'](_0x7740('0x15'),_0x506714,JSON[_0x7740('0xf')](_0x547517));_0x4ed4c4(_0x547517);})[_0x7740('0x14')](function(_0x3c08cb){logger[_0x7740('0x10')](_0x7740('0x15'),_0x3c08cb[_0x7740('0x12')],_0x506714);_0x76f2df(_0x5d706a[_0x7740('0x10')](0x1f4,_0x3c08cb['message']));});});};exports['ShowDeskAccount']=function(_0x486c63){var _0x1fef2d=this;return new Promise(function(_0x36f617,_0x3ecf16){return db[_0x7740('0x16')]['find']({'raw':_0x486c63[_0x7740('0x18')]?_0x486c63[_0x7740('0x18')][_0x7740('0x1f')]===undefined?!![]:![]:!![],'where':_0x486c63[_0x7740('0x18')]?_0x486c63[_0x7740('0x18')][_0x7740('0x19')]||null:null,'attributes':_0x486c63[_0x7740('0x18')]?_0x486c63[_0x7740('0x18')][_0x7740('0x1a')]||null:null,'include':_0x486c63[_0x7740('0x18')]?_0x486c63[_0x7740('0x18')][_0x7740('0x1c')]?_[_0x7740('0x1e')](_0x486c63['options'][_0x7740('0x1c')],function(_0x396f45){return{'model':db[_0x396f45['model']],'as':_0x396f45['as'],'attributes':_0x396f45[_0x7740('0x1a')],'include':_0x396f45[_0x7740('0x1c')]?_[_0x7740('0x1e')](_0x396f45[_0x7740('0x1c')],function(_0x2ab20e){return{'model':db[_0x2ab20e['model']],'as':_0x2ab20e['as'],'attributes':_0x2ab20e[_0x7740('0x1a')],'include':_0x2ab20e[_0x7740('0x1c')]?_[_0x7740('0x1e')](_0x2ab20e[_0x7740('0x1c')],function(_0x3935e2){return{'model':db[_0x3935e2[_0x7740('0x1d')]],'as':_0x3935e2['as'],'attributes':_0x3935e2[_0x7740('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7740('0x20')](function(_0x229662){logger['info'](_0x7740('0x21'),_0x486c63);logger[_0x7740('0x22')]('ShowDeskAccount',_0x486c63,JSON[_0x7740('0xf')](_0x229662));_0x36f617(_0x229662);})['catch'](function(_0x570d27){logger[_0x7740('0x10')](_0x7740('0x21'),_0x570d27[_0x7740('0x12')],_0x486c63);_0x3ecf16(_0x1fef2d['error'](0x1f4,_0x570d27['message']));});});}; \ No newline at end of file +var _0x64c2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','then','debug','ShowDeskAccount','find','util','moment'];(function(_0x321530,_0xb86b47){var _0x4d3ed4=function(_0x5a5bad){while(--_0x5a5bad){_0x321530['push'](_0x321530['shift']());}};_0x4d3ed4(++_0xb86b47);}(_0x64c2,0x1cc));var _0x264c=function(_0x142810,_0x2a3e34){_0x142810=_0x142810-0x0;var _0x5719f9=_0x64c2[_0x142810];return _0x5719f9;};'use strict';var _=require('lodash');var util=require(_0x264c('0x0'));var moment=require(_0x264c('0x1'));var BPromise=require(_0x264c('0x2'));var rs=require(_0x264c('0x3'));var fs=require('fs');var Redis=require(_0x264c('0x4'));var db=require(_0x264c('0x5'))['db'];var utils=require(_0x264c('0x6'));var logger=require('../../config/logger')(_0x264c('0x7'));var config=require(_0x264c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x170071,_0x1f5a92,_0x5529b7){return new BPromise(function(_0x39a210,_0x50a777){return client[_0x264c('0x9')](_0x170071,_0x5529b7)['then'](function(_0xe2d891){logger[_0x264c('0xa')](_0x264c('0xb'),_0x1f5a92,'request\x20sent');logger['debug'](_0x264c('0xc'),_0x1f5a92,_0x264c('0xd'),JSON[_0x264c('0xe')](_0xe2d891));if(_0xe2d891[_0x264c('0xf')]){if(_0xe2d891[_0x264c('0xf')]['code']===0x1f4){logger['error'](_0x264c('0xb'),_0x1f5a92,_0xe2d891['error'][_0x264c('0x10')]);return _0x50a777(_0xe2d891['error'][_0x264c('0x10')]);}logger[_0x264c('0xf')](_0x264c('0xb'),_0x1f5a92,_0xe2d891[_0x264c('0xf')]['message']);return _0x39a210(_0xe2d891[_0x264c('0xf')][_0x264c('0x10')]);}else{logger[_0x264c('0xa')](_0x264c('0xb'),_0x1f5a92,'request\x20sent');_0x39a210(_0xe2d891[_0x264c('0x11')]['message']);}})[_0x264c('0x12')](function(_0x349074){logger[_0x264c('0xf')](_0x264c('0xb'),_0x1f5a92,_0x349074);_0x50a777(_0x349074);});});}exports[_0x264c('0x13')]=function(_0x3b44ee){var _0x423a80=this;return new Promise(function(_0x22737c,_0x2a15d2){return db[_0x264c('0x14')]['findAll']({'raw':_0x3b44ee[_0x264c('0x15')]?_0x3b44ee[_0x264c('0x15')][_0x264c('0x16')]===undefined?!![]:![]:!![],'where':_0x3b44ee[_0x264c('0x15')]?_0x3b44ee[_0x264c('0x15')][_0x264c('0x17')]||null:null,'attributes':_0x3b44ee['options']?_0x3b44ee[_0x264c('0x15')][_0x264c('0x18')]||null:null,'limit':_0x3b44ee['options']?_0x3b44ee[_0x264c('0x15')][_0x264c('0x19')]||null:null,'include':_0x3b44ee[_0x264c('0x15')]?_0x3b44ee[_0x264c('0x15')][_0x264c('0x1a')]?_[_0x264c('0x1b')](_0x3b44ee[_0x264c('0x15')][_0x264c('0x1a')],function(_0x44e4d6){return{'model':db[_0x44e4d6['model']],'as':_0x44e4d6['as'],'attributes':_0x44e4d6[_0x264c('0x18')],'include':_0x44e4d6[_0x264c('0x1a')]?_[_0x264c('0x1b')](_0x44e4d6['include'],function(_0x5b5a88){return{'model':db[_0x5b5a88['model']],'as':_0x5b5a88['as'],'attributes':_0x5b5a88[_0x264c('0x18')],'include':_0x5b5a88[_0x264c('0x1a')]?_[_0x264c('0x1b')](_0x5b5a88[_0x264c('0x1a')],function(_0x584534){return{'model':db[_0x584534[_0x264c('0x1c')]],'as':_0x584534['as'],'attributes':_0x584534[_0x264c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x264c('0x1d')](function(_0x3d4dc9){logger['info'](_0x264c('0x13'),_0x3b44ee);logger[_0x264c('0x1e')](_0x264c('0x13'),_0x3b44ee,JSON[_0x264c('0xe')](_0x3d4dc9));_0x22737c(_0x3d4dc9);})['catch'](function(_0x514c36){logger[_0x264c('0xf')](_0x264c('0x13'),_0x514c36['message'],_0x3b44ee);_0x2a15d2(_0x423a80[_0x264c('0xf')](0x1f4,_0x514c36[_0x264c('0x10')]));});});};exports[_0x264c('0x1f')]=function(_0x4af420){var _0x3c5410=this;return new Promise(function(_0x1b7ef5,_0x505af2){return db[_0x264c('0x14')][_0x264c('0x20')]({'raw':_0x4af420[_0x264c('0x15')]?_0x4af420[_0x264c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4af420[_0x264c('0x15')]?_0x4af420[_0x264c('0x15')][_0x264c('0x17')]||null:null,'attributes':_0x4af420[_0x264c('0x15')]?_0x4af420['options'][_0x264c('0x18')]||null:null,'include':_0x4af420[_0x264c('0x15')]?_0x4af420[_0x264c('0x15')][_0x264c('0x1a')]?_['map'](_0x4af420['options'][_0x264c('0x1a')],function(_0x2dfb39){return{'model':db[_0x2dfb39[_0x264c('0x1c')]],'as':_0x2dfb39['as'],'attributes':_0x2dfb39['attributes'],'include':_0x2dfb39[_0x264c('0x1a')]?_[_0x264c('0x1b')](_0x2dfb39[_0x264c('0x1a')],function(_0x4f21d6){return{'model':db[_0x4f21d6['model']],'as':_0x4f21d6['as'],'attributes':_0x4f21d6[_0x264c('0x18')],'include':_0x4f21d6[_0x264c('0x1a')]?_[_0x264c('0x1b')](_0x4f21d6[_0x264c('0x1a')],function(_0x1d298f){return{'model':db[_0x1d298f[_0x264c('0x1c')]],'as':_0x1d298f['as'],'attributes':_0x1d298f[_0x264c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x264c('0x1d')](function(_0x37664d){logger[_0x264c('0xa')]('ShowDeskAccount',_0x4af420);logger[_0x264c('0x1e')](_0x264c('0x1f'),_0x4af420,JSON[_0x264c('0xe')](_0x37664d));_0x1b7ef5(_0x37664d);})[_0x264c('0x12')](function(_0x21f564){logger['error'](_0x264c('0x1f'),_0x21f564['message'],_0x4af420);_0x505af2(_0x3c5410[_0x264c('0xf')](0x1f4,_0x21f564[_0x264c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 35a724a..fde8c1e 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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x54c880,_0x1581a9){var _0x11b181=function(_0x4f8b16){while(--_0x4f8b16){_0x54c880['push'](_0x54c880['shift']());}};_0x11b181(++_0x1581a9);}(_0x008c,0x188));var _0xc008=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x008c[_0x3299d1];return _0x44356e;};'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')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);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('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x55ca,0x126));var _0xa55c=function(_0x16c7d4,_0x1fd6a5){_0x16c7d4=_0x16c7d4-0x0;var _0x54c042=_0x55ca[_0x16c7d4];return _0x54c042;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index fb88e7d..176c565 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 _0x2e64=['sequelize','exports','STRING'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x2e64,0x84));var _0x42e6=function(_0x929110,_0x38a409){_0x929110=_0x929110-0x0;var _0x101622=_0x2e64[_0x929110];return _0x101622;};'use strict';var Sequelize=require(_0x42e6('0x0'));module[_0x42e6('0x1')]={'name':{'type':Sequelize[_0x42e6('0x2')]},'description':{'type':Sequelize[_0x42e6('0x2')]}}; \ No newline at end of file +var _0xbf0f=['sequelize','exports','STRING'];(function(_0x37a416,_0x14ee6a){var _0x47959e=function(_0x57aa93){while(--_0x57aa93){_0x37a416['push'](_0x37a416['shift']());}};_0x47959e(++_0x14ee6a);}(_0xbf0f,0xe4));var _0xfbf0=function(_0x16aaef,_0x410651){_0x16aaef=_0x16aaef-0x0;var _0x1c82ef=_0xbf0f[_0x16aaef];return _0x1c82ef;};'use strict';var Sequelize=require(_0xfbf0('0x0'));module[_0xfbf0('0x1')]={'name':{'type':Sequelize[_0xfbf0('0x2')]},'description':{'type':Sequelize[_0xfbf0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index ae6fb72..936eb95 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 _0x7eb2=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','DeskConfiguration','includeAll','include','findAll','rows','params','keys','length','options','find','create','body','catch','findOne','DeskField','order','hasOwnProperty','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7eb2,0xef));var _0x27eb=function(_0x2500cb,_0x25d297){_0x2500cb=_0x2500cb-0x0;var _0x54d11e=_0x7eb2[_0x2500cb];return _0x54d11e;};'use strict';var emlformat=require(_0x27eb('0x0'));var rimraf=require(_0x27eb('0x1'));var zipdir=require(_0x27eb('0x2'));var jsonpatch=require(_0x27eb('0x3'));var rp=require(_0x27eb('0x4'));var moment=require(_0x27eb('0x5'));var BPromise=require(_0x27eb('0x6'));var Mustache=require(_0x27eb('0x7'));var util=require(_0x27eb('0x8'));var path=require(_0x27eb('0x9'));var sox=require(_0x27eb('0xa'));var csv=require(_0x27eb('0xb'));var ejs=require(_0x27eb('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27eb('0xd'));var squel=require(_0x27eb('0xe'));var crypto=require(_0x27eb('0xf'));var jsforce=require(_0x27eb('0x10'));var deskjs=require(_0x27eb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x27eb('0x12'));var Papa=require(_0x27eb('0x13'));var Redis=require(_0x27eb('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x27eb('0x15'));var as=require(_0x27eb('0x16'));var hardwareService=require(_0x27eb('0x17'));var logger=require('../../config/logger')(_0x27eb('0x18'));var utils=require(_0x27eb('0x19'));var config=require(_0x27eb('0x1a'));var licenseUtil=require(_0x27eb('0x1b'));var db=require(_0x27eb('0x1c'))['db'];function respondWithStatusCode(_0x2c1b19,_0x1284b7){_0x1284b7=_0x1284b7||0xcc;return function(_0x45688e){if(_0x45688e){return _0x2c1b19['sendStatus'](_0x1284b7);}return _0x2c1b19[_0x27eb('0x1d')](_0x1284b7)[_0x27eb('0x1e')]();};}function respondWithResult(_0x18e8ba,_0x58706f){_0x58706f=_0x58706f||0xc8;return function(_0x485398){if(_0x485398){return _0x18e8ba[_0x27eb('0x1d')](_0x58706f)['json'](_0x485398);}};}function respondWithFilteredResult(_0x69feb0,_0x496cf5){return function(_0x1f8e8a){if(_0x1f8e8a){var _0x1297a4=typeof _0x496cf5[_0x27eb('0x1f')]===_0x27eb('0x20')&&typeof _0x496cf5[_0x27eb('0x21')]===_0x27eb('0x20');var _0x559953=_0x1f8e8a['count'];var _0x4851de=_0x1297a4?0x0:_0x496cf5[_0x27eb('0x1f')];var _0x2e0dc0=_0x1297a4?_0x1f8e8a[_0x27eb('0x22')]:_0x496cf5['offset']+_0x496cf5[_0x27eb('0x21')];var _0x1f5190;if(_0x2e0dc0>=_0x559953){_0x2e0dc0=_0x559953;_0x1f5190=0xc8;}else{_0x1f5190=0xce;}_0x69feb0['status'](_0x1f5190);return _0x69feb0[_0x27eb('0x23')](_0x27eb('0x24'),_0x4851de+'-'+_0x2e0dc0+'/'+_0x559953)[_0x27eb('0x25')](_0x1f8e8a);}return null;};}function patchUpdates(_0x324ec7){return function(_0x18aff2){try{jsonpatch[_0x27eb('0x26')](_0x18aff2,_0x324ec7,!![]);}catch(_0x2c3fc4){return BPromise[_0x27eb('0x27')](_0x2c3fc4);}return _0x18aff2[_0x27eb('0x28')]();};}function saveUpdates(_0x28f532,_0x150188){return function(_0x422de7){if(_0x422de7){return _0x422de7[_0x27eb('0x29')](_0x28f532)[_0x27eb('0x2a')](function(_0x5566bf){return _0x5566bf;});}return null;};}function removeEntity(_0x54f352,_0x302669){return function(_0x5c6b5f){if(_0x5c6b5f){return _0x5c6b5f[_0x27eb('0x2b')]()[_0x27eb('0x2a')](function(){_0x54f352['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x383b6b,_0x557f65){return function(_0xdc54f2){if(!_0xdc54f2){_0x383b6b[_0x27eb('0x2c')](0x194);}return _0xdc54f2;};}function handleError(_0x586c34,_0x2bae37){_0x2bae37=_0x2bae37||0x1f4;return function(_0x13509f){logger['error'](_0x13509f[_0x27eb('0x2d')]);if(_0x13509f['name']){delete _0x13509f[_0x27eb('0x2e')];}_0x586c34[_0x27eb('0x1d')](_0x2bae37)[_0x27eb('0x2f')](_0x13509f);};}exports[_0x27eb('0x30')]=function(_0xec3d3c,_0x31e67d){var _0x20bec5={},_0x1cd91a={},_0x47e36d={'count':0x0,'rows':[]};var _0x41adee=_[_0x27eb('0x31')](db['DeskConfiguration'][_0x27eb('0x32')],function(_0x51b72e){return{'name':_0x51b72e[_0x27eb('0x33')],'type':_0x51b72e['type'][_0x27eb('0x34')]};});_0x1cd91a[_0x27eb('0x35')]=_['map'](_0x41adee,'name');_0x1cd91a['query']=_['keys'](_0xec3d3c['query']);_0x1cd91a[_0x27eb('0x36')]=_[_0x27eb('0x37')](_0x1cd91a[_0x27eb('0x35')],_0x1cd91a[_0x27eb('0x38')]);_0x20bec5[_0x27eb('0x39')]=_['intersection'](_0x1cd91a['model'],qs[_0x27eb('0x3a')](_0xec3d3c[_0x27eb('0x38')][_0x27eb('0x3a')]));_0x20bec5[_0x27eb('0x39')]=_0x20bec5[_0x27eb('0x39')]['length']?_0x20bec5['attributes']:_0x1cd91a[_0x27eb('0x35')];if(!_0xec3d3c[_0x27eb('0x38')]['hasOwnProperty'](_0x27eb('0x3b'))){_0x20bec5[_0x27eb('0x21')]=qs[_0x27eb('0x21')](_0xec3d3c['query']['limit']);_0x20bec5[_0x27eb('0x1f')]=qs[_0x27eb('0x1f')](_0xec3d3c[_0x27eb('0x38')][_0x27eb('0x1f')]);}_0x20bec5['order']=qs[_0x27eb('0x3c')](_0xec3d3c[_0x27eb('0x38')]['sort']);_0x20bec5[_0x27eb('0x3d')]=qs[_0x27eb('0x36')](_[_0x27eb('0x3e')](_0xec3d3c[_0x27eb('0x38')],_0x1cd91a[_0x27eb('0x36')]),_0x41adee);if(_0xec3d3c['query'][_0x27eb('0x3f')]){_0x20bec5[_0x27eb('0x3d')]=_['merge'](_0x20bec5[_0x27eb('0x3d')],{'$or':_[_0x27eb('0x31')](_0x41adee,function(_0x4cf6c9){if(_0x4cf6c9[_0x27eb('0x40')]!==_0x27eb('0x41')){var _0x456ee2={};_0x456ee2[_0x4cf6c9[_0x27eb('0x2e')]]={'$like':'%'+_0xec3d3c[_0x27eb('0x38')][_0x27eb('0x3f')]+'%'};return _0x456ee2;}})});}_0x20bec5=_[_0x27eb('0x42')]({},_0x20bec5,_0xec3d3c['options']);var _0x30aa60={'where':_0x20bec5['where']};return db[_0x27eb('0x43')][_0x27eb('0x22')](_0x30aa60)['then'](function(_0x480dce){_0x47e36d['count']=_0x480dce;if(_0xec3d3c[_0x27eb('0x38')][_0x27eb('0x44')]){_0x20bec5[_0x27eb('0x45')]=[{'all':!![]}];}return db[_0x27eb('0x43')][_0x27eb('0x46')](_0x20bec5);})[_0x27eb('0x2a')](function(_0xa813d6){_0x47e36d[_0x27eb('0x47')]=_0xa813d6;return _0x47e36d;})[_0x27eb('0x2a')](respondWithFilteredResult(_0x31e67d,_0x20bec5))['catch'](handleError(_0x31e67d,null));};exports['show']=function(_0x3225cf,_0x3a1837){var _0x1508f8={'raw':![],'where':{'id':_0x3225cf[_0x27eb('0x48')]['id']}},_0x49b93c={};_0x49b93c[_0x27eb('0x35')]=_['keys'](db['DeskConfiguration'][_0x27eb('0x32')]);_0x49b93c[_0x27eb('0x38')]=_[_0x27eb('0x49')](_0x3225cf['query']);_0x49b93c[_0x27eb('0x36')]=_[_0x27eb('0x37')](_0x49b93c[_0x27eb('0x35')],_0x49b93c[_0x27eb('0x38')]);_0x1508f8[_0x27eb('0x39')]=_[_0x27eb('0x37')](_0x49b93c[_0x27eb('0x35')],qs[_0x27eb('0x3a')](_0x3225cf['query'][_0x27eb('0x3a')]));_0x1508f8[_0x27eb('0x39')]=_0x1508f8[_0x27eb('0x39')][_0x27eb('0x4a')]?_0x1508f8['attributes']:_0x49b93c['model'];if(_0x3225cf[_0x27eb('0x38')][_0x27eb('0x44')]){_0x1508f8[_0x27eb('0x45')]=[{'all':!![]}];}_0x1508f8=_[_0x27eb('0x42')]({},_0x1508f8,_0x3225cf[_0x27eb('0x4b')]);return db['DeskConfiguration'][_0x27eb('0x4c')](_0x1508f8)[_0x27eb('0x2a')](handleEntityNotFound(_0x3a1837,null))[_0x27eb('0x2a')](respondWithResult(_0x3a1837,null))['catch'](handleError(_0x3a1837,null));};exports[_0x27eb('0x4d')]=function(_0x17a339,_0x45a9a9){return db[_0x27eb('0x43')][_0x27eb('0x4d')](_0x17a339[_0x27eb('0x4e')],{})['then'](respondWithResult(_0x45a9a9,0xc9))[_0x27eb('0x4f')](handleError(_0x45a9a9,null));};exports[_0x27eb('0x29')]=function(_0x1cd084,_0x1c0d32){if(_0x1cd084[_0x27eb('0x4e')]['id']){delete _0x1cd084[_0x27eb('0x4e')]['id'];}return db[_0x27eb('0x43')][_0x27eb('0x4c')]({'where':{'id':_0x1cd084[_0x27eb('0x48')]['id']}})[_0x27eb('0x2a')](handleEntityNotFound(_0x1c0d32,null))['then'](saveUpdates(_0x1cd084[_0x27eb('0x4e')],null))[_0x27eb('0x2a')](respondWithResult(_0x1c0d32,null))[_0x27eb('0x4f')](handleError(_0x1c0d32,null));};exports['destroy']=function(_0x3b4464,_0x20a5ad){return db['DeskConfiguration'][_0x27eb('0x4c')]({'where':{'id':_0x3b4464[_0x27eb('0x48')]['id']}})[_0x27eb('0x2a')](handleEntityNotFound(_0x20a5ad,null))[_0x27eb('0x2a')](removeEntity(_0x20a5ad,null))['catch'](handleError(_0x20a5ad,null));};exports['getFields']=function(_0x20716c,_0x45d774,_0x498ee7){var _0x65fef3={};var _0x11583f={};var _0xd8a9f;var _0x5783e8;return db[_0x27eb('0x43')][_0x27eb('0x50')]({'where':{'id':_0x20716c[_0x27eb('0x48')]['id']}})['then'](handleEntityNotFound(_0x45d774,null))[_0x27eb('0x2a')](function(_0x404191){if(_0x404191){_0xd8a9f=_0x404191;_0x11583f[_0x27eb('0x35')]=_['keys'](db[_0x27eb('0x51')][_0x27eb('0x32')]);_0x11583f[_0x27eb('0x38')]=_[_0x27eb('0x49')](_0x20716c[_0x27eb('0x38')]);_0x11583f[_0x27eb('0x36')]=_[_0x27eb('0x37')](_0x11583f['model'],_0x11583f[_0x27eb('0x38')]);_0x65fef3[_0x27eb('0x39')]=_['intersection'](_0x11583f[_0x27eb('0x35')],qs['fields'](_0x20716c['query'][_0x27eb('0x3a')]));_0x65fef3['attributes']=_0x65fef3[_0x27eb('0x39')]['length']?_0x65fef3[_0x27eb('0x39')]:_0x11583f[_0x27eb('0x35')];_0x65fef3[_0x27eb('0x52')]=qs['sort'](_0x20716c[_0x27eb('0x38')]['sort']);_0x65fef3[_0x27eb('0x3d')]=qs[_0x27eb('0x36')](_[_0x27eb('0x3e')](_0x20716c[_0x27eb('0x38')],_0x11583f[_0x27eb('0x36')]));if(_0x20716c[_0x27eb('0x38')][_0x27eb('0x3f')]){_0x65fef3[_0x27eb('0x3d')]=_[_0x27eb('0x42')](_0x65fef3[_0x27eb('0x3d')],{'$or':_[_0x27eb('0x31')](_0x65fef3['attributes'],function(_0x300953){var _0x316648={};_0x316648[_0x300953]={'$like':'%'+_0x20716c[_0x27eb('0x38')][_0x27eb('0x3f')]+'%'};return _0x316648;})});}_0x65fef3=_[_0x27eb('0x42')]({},_0x65fef3,_0x20716c[_0x27eb('0x4b')]);return _0xd8a9f['getFields'](_0x65fef3);}})[_0x27eb('0x2a')](function(_0x1117f0){if(_0x1117f0){_0x5783e8=_0x1117f0[_0x27eb('0x4a')];if(!_0x20716c[_0x27eb('0x38')][_0x27eb('0x53')]('nolimit')){_0x65fef3[_0x27eb('0x21')]=qs['limit'](_0x20716c[_0x27eb('0x38')][_0x27eb('0x21')]);_0x65fef3[_0x27eb('0x1f')]=qs[_0x27eb('0x1f')](_0x20716c[_0x27eb('0x38')][_0x27eb('0x1f')]);}return _0xd8a9f[_0x27eb('0x54')](_0x65fef3);}})[_0x27eb('0x2a')](function(_0xf2449c){if(_0xf2449c){return _0xf2449c?{'count':_0x5783e8,'rows':_0xf2449c}:null;}})[_0x27eb('0x2a')](respondWithResult(_0x45d774,null))['catch'](handleError(_0x45d774,null));};exports[_0x27eb('0x55')]=function(_0x27ee39,_0x3097f9,_0x120e78){var _0x2b2955={};var _0x231e7d={};var _0x1bac1f;var _0x212951;return db[_0x27eb('0x43')][_0x27eb('0x50')]({'where':{'id':_0x27ee39[_0x27eb('0x48')]['id']}})[_0x27eb('0x2a')](handleEntityNotFound(_0x3097f9,null))[_0x27eb('0x2a')](function(_0x148f53){if(_0x148f53){_0x1bac1f=_0x148f53;_0x231e7d['model']=_[_0x27eb('0x49')](db[_0x27eb('0x51')][_0x27eb('0x32')]);_0x231e7d[_0x27eb('0x38')]=_[_0x27eb('0x49')](_0x27ee39[_0x27eb('0x38')]);_0x231e7d[_0x27eb('0x36')]=_[_0x27eb('0x37')](_0x231e7d[_0x27eb('0x35')],_0x231e7d[_0x27eb('0x38')]);_0x2b2955[_0x27eb('0x39')]=_['intersection'](_0x231e7d[_0x27eb('0x35')],qs[_0x27eb('0x3a')](_0x27ee39[_0x27eb('0x38')][_0x27eb('0x3a')]));_0x2b2955[_0x27eb('0x39')]=_0x2b2955[_0x27eb('0x39')][_0x27eb('0x4a')]?_0x2b2955[_0x27eb('0x39')]:_0x231e7d['model'];_0x2b2955['order']=qs[_0x27eb('0x3c')](_0x27ee39[_0x27eb('0x38')][_0x27eb('0x3c')]);_0x2b2955['where']=qs['filters'](_[_0x27eb('0x3e')](_0x27ee39['query'],_0x231e7d['filters']));if(_0x27ee39[_0x27eb('0x38')]['filter']){_0x2b2955[_0x27eb('0x3d')]=_['merge'](_0x2b2955['where'],{'$or':_[_0x27eb('0x31')](_0x2b2955[_0x27eb('0x39')],function(_0x3fa22b){var _0x6107fd={};_0x6107fd[_0x3fa22b]={'$like':'%'+_0x27ee39['query'][_0x27eb('0x3f')]+'%'};return _0x6107fd;})});}_0x2b2955=_['merge']({},_0x2b2955,_0x27ee39[_0x27eb('0x4b')]);return _0x1bac1f[_0x27eb('0x55')](_0x2b2955);}})[_0x27eb('0x2a')](function(_0x1b6610){if(_0x1b6610){_0x212951=_0x1b6610[_0x27eb('0x4a')];if(!_0x27ee39[_0x27eb('0x38')][_0x27eb('0x53')](_0x27eb('0x3b'))){_0x2b2955[_0x27eb('0x21')]=qs['limit'](_0x27ee39[_0x27eb('0x38')][_0x27eb('0x21')]);_0x2b2955[_0x27eb('0x1f')]=qs[_0x27eb('0x1f')](_0x27ee39[_0x27eb('0x38')]['offset']);}return _0x1bac1f['getSubjects'](_0x2b2955);}})['then'](function(_0x1d3675){if(_0x1d3675){return _0x1d3675?{'count':_0x212951,'rows':_0x1d3675}:null;}})['then'](respondWithResult(_0x3097f9,null))[_0x27eb('0x4f')](handleError(_0x3097f9,null));};exports[_0x27eb('0x56')]=function(_0x21eb59,_0x4ae5c8,_0x353f91){var _0x134d11={};var _0x41c704={};var _0x4afa8e;var _0x42f846;return db[_0x27eb('0x43')][_0x27eb('0x50')]({'where':{'id':_0x21eb59[_0x27eb('0x48')]['id']}})[_0x27eb('0x2a')](handleEntityNotFound(_0x4ae5c8,null))[_0x27eb('0x2a')](function(_0x44b687){if(_0x44b687){_0x4afa8e=_0x44b687;_0x41c704[_0x27eb('0x35')]=_[_0x27eb('0x49')](db[_0x27eb('0x51')]['rawAttributes']);_0x41c704[_0x27eb('0x38')]=_[_0x27eb('0x49')](_0x21eb59[_0x27eb('0x38')]);_0x41c704[_0x27eb('0x36')]=_[_0x27eb('0x37')](_0x41c704['model'],_0x41c704[_0x27eb('0x38')]);_0x134d11[_0x27eb('0x39')]=_['intersection'](_0x41c704[_0x27eb('0x35')],qs[_0x27eb('0x3a')](_0x21eb59[_0x27eb('0x38')][_0x27eb('0x3a')]));_0x134d11[_0x27eb('0x39')]=_0x134d11[_0x27eb('0x39')][_0x27eb('0x4a')]?_0x134d11[_0x27eb('0x39')]:_0x41c704['model'];_0x134d11['order']=qs['sort'](_0x21eb59[_0x27eb('0x38')][_0x27eb('0x3c')]);_0x134d11[_0x27eb('0x3d')]=qs[_0x27eb('0x36')](_['pick'](_0x21eb59[_0x27eb('0x38')],_0x41c704[_0x27eb('0x36')]));if(_0x21eb59[_0x27eb('0x38')][_0x27eb('0x3f')]){_0x134d11[_0x27eb('0x3d')]=_[_0x27eb('0x42')](_0x134d11[_0x27eb('0x3d')],{'$or':_['map'](_0x134d11['attributes'],function(_0x486718){var _0x598a9c={};_0x598a9c[_0x486718]={'$like':'%'+_0x21eb59[_0x27eb('0x38')]['filter']+'%'};return _0x598a9c;})});}_0x134d11=_['merge']({},_0x134d11,_0x21eb59['options']);return _0x4afa8e[_0x27eb('0x56')](_0x134d11);}})[_0x27eb('0x2a')](function(_0x7936c0){if(_0x7936c0){_0x42f846=_0x7936c0[_0x27eb('0x4a')];if(!_0x21eb59[_0x27eb('0x38')][_0x27eb('0x53')](_0x27eb('0x3b'))){_0x134d11['limit']=qs[_0x27eb('0x21')](_0x21eb59[_0x27eb('0x38')][_0x27eb('0x21')]);_0x134d11[_0x27eb('0x1f')]=qs[_0x27eb('0x1f')](_0x21eb59[_0x27eb('0x38')][_0x27eb('0x1f')]);}return _0x4afa8e['getDescriptions'](_0x134d11);}})[_0x27eb('0x2a')](function(_0x2e90eb){if(_0x2e90eb){return _0x2e90eb?{'count':_0x42f846,'rows':_0x2e90eb}:null;}})['then'](respondWithResult(_0x4ae5c8,null))[_0x27eb('0x4f')](handleError(_0x4ae5c8,null));};exports[_0x27eb('0x57')]=function(_0x3e13b1,_0x15dfd9,_0x3f83b6){var _0x52488e={};var _0x238dee={};var _0xac8d04;var _0x5d271d;return db[_0x27eb('0x43')][_0x27eb('0x50')]({'where':{'id':_0x3e13b1[_0x27eb('0x48')]['id']}})[_0x27eb('0x2a')](handleEntityNotFound(_0x15dfd9,null))['then'](function(_0x5307ec){if(_0x5307ec){_0xac8d04=_0x5307ec;_0x238dee[_0x27eb('0x35')]=_['keys'](db[_0x27eb('0x58')][_0x27eb('0x32')]);_0x238dee[_0x27eb('0x38')]=_[_0x27eb('0x49')](_0x3e13b1['query']);_0x238dee[_0x27eb('0x36')]=_[_0x27eb('0x37')](_0x238dee[_0x27eb('0x35')],_0x238dee[_0x27eb('0x38')]);_0x52488e['attributes']=_[_0x27eb('0x37')](_0x238dee[_0x27eb('0x35')],qs[_0x27eb('0x3a')](_0x3e13b1[_0x27eb('0x38')][_0x27eb('0x3a')]));_0x52488e[_0x27eb('0x39')]=_0x52488e[_0x27eb('0x39')][_0x27eb('0x4a')]?_0x52488e['attributes']:_0x238dee[_0x27eb('0x35')];_0x52488e['order']=qs[_0x27eb('0x3c')](_0x3e13b1[_0x27eb('0x38')][_0x27eb('0x3c')]);_0x52488e[_0x27eb('0x3d')]=qs[_0x27eb('0x36')](_[_0x27eb('0x3e')](_0x3e13b1['query'],_0x238dee['filters']));if(_0x3e13b1[_0x27eb('0x38')][_0x27eb('0x3f')]){_0x52488e['where']=_[_0x27eb('0x42')](_0x52488e[_0x27eb('0x3d')],{'$or':_['map'](_0x52488e[_0x27eb('0x39')],function(_0x299ec0){var _0x4d2142={};_0x4d2142[_0x299ec0]={'$like':'%'+_0x3e13b1[_0x27eb('0x38')][_0x27eb('0x3f')]+'%'};return _0x4d2142;})});}_0x52488e=_['merge']({},_0x52488e,_0x3e13b1['options']);return _0xac8d04[_0x27eb('0x57')](_0x52488e);}})[_0x27eb('0x2a')](function(_0x18cda8){if(_0x18cda8){_0x5d271d=_0x18cda8[_0x27eb('0x4a')];if(!_0x3e13b1['query'][_0x27eb('0x53')](_0x27eb('0x3b'))){_0x52488e[_0x27eb('0x21')]=qs[_0x27eb('0x21')](_0x3e13b1[_0x27eb('0x38')]['limit']);_0x52488e['offset']=qs[_0x27eb('0x1f')](_0x3e13b1['query'][_0x27eb('0x1f')]);}return _0xac8d04[_0x27eb('0x57')](_0x52488e);}})[_0x27eb('0x2a')](function(_0xd7e870){if(_0xd7e870){return _0xd7e870?{'count':_0x5d271d,'rows':_0xd7e870}:null;}})[_0x27eb('0x2a')](respondWithResult(_0x15dfd9,null))['catch'](handleError(_0x15dfd9,null));};exports['setTags']=function(_0x324361,_0x3e17dc,_0x3ae882){if(_0x324361[_0x27eb('0x4e')]['id']){delete _0x324361['body']['id'];}return db['DeskConfiguration'][_0x27eb('0x50')]({'where':{'id':_0x324361['params']['id']}})[_0x27eb('0x2a')](handleEntityNotFound(_0x3e17dc,null))[_0x27eb('0x2a')](function(_0x525e61){if(_0x525e61){return _0x525e61[_0x27eb('0x59')](_0x324361[_0x27eb('0x4e')]['ids']||[]);}return null;})[_0x27eb('0x2a')](respondWithResult(_0x3e17dc,null))['catch'](handleError(_0x3e17dc,null));}; \ No newline at end of file +var _0x9cb7=['nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','include','DeskConfiguration','findAll','rows','catch','show','params','includeAll','options','create','body','find','getFields','findOne','DeskField','hasOwnProperty'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x9cb7,0xb2));var _0x79cb=function(_0x19b48a,_0x4beffe){_0x19b48a=_0x19b48a-0x0;var _0x4ab1cd=_0x9cb7[_0x19b48a];return _0x4ab1cd;};'use strict';var emlformat=require(_0x79cb('0x0'));var rimraf=require(_0x79cb('0x1'));var zipdir=require(_0x79cb('0x2'));var jsonpatch=require(_0x79cb('0x3'));var rp=require(_0x79cb('0x4'));var moment=require(_0x79cb('0x5'));var BPromise=require(_0x79cb('0x6'));var Mustache=require(_0x79cb('0x7'));var util=require('util');var path=require(_0x79cb('0x8'));var sox=require('sox');var csv=require(_0x79cb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79cb('0xa'));var _=require(_0x79cb('0xb'));var squel=require(_0x79cb('0xc'));var crypto=require(_0x79cb('0xd'));var jsforce=require(_0x79cb('0xe'));var deskjs=require(_0x79cb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x79cb('0x10'));var Papa=require(_0x79cb('0x11'));var Redis=require(_0x79cb('0x12'));var authService=require(_0x79cb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x79cb('0x14'));var hardwareService=require(_0x79cb('0x15'));var logger=require('../../config/logger')(_0x79cb('0x16'));var utils=require(_0x79cb('0x17'));var config=require(_0x79cb('0x18'));var licenseUtil=require(_0x79cb('0x19'));var db=require(_0x79cb('0x1a'))['db'];function respondWithStatusCode(_0xdd3160,_0x2afed0){_0x2afed0=_0x2afed0||0xcc;return function(_0x5a937f){if(_0x5a937f){return _0xdd3160[_0x79cb('0x1b')](_0x2afed0);}return _0xdd3160[_0x79cb('0x1c')](_0x2afed0)['end']();};}function respondWithResult(_0xf0852c,_0x158280){_0x158280=_0x158280||0xc8;return function(_0x4a5c00){if(_0x4a5c00){return _0xf0852c[_0x79cb('0x1c')](_0x158280)[_0x79cb('0x1d')](_0x4a5c00);}};}function respondWithFilteredResult(_0x136e23,_0x929ab1){return function(_0x4ad9fc){if(_0x4ad9fc){var _0x20c894=typeof _0x929ab1['offset']===_0x79cb('0x1e')&&typeof _0x929ab1['limit']===_0x79cb('0x1e');var _0x5b8fd7=_0x4ad9fc[_0x79cb('0x1f')];var _0x5e29df=_0x20c894?0x0:_0x929ab1[_0x79cb('0x20')];var _0x3cd65f=_0x20c894?_0x4ad9fc[_0x79cb('0x1f')]:_0x929ab1['offset']+_0x929ab1[_0x79cb('0x21')];var _0x372e3c;if(_0x3cd65f>=_0x5b8fd7){_0x3cd65f=_0x5b8fd7;_0x372e3c=0xc8;}else{_0x372e3c=0xce;}_0x136e23[_0x79cb('0x1c')](_0x372e3c);return _0x136e23[_0x79cb('0x22')]('Content-Range',_0x5e29df+'-'+_0x3cd65f+'/'+_0x5b8fd7)[_0x79cb('0x1d')](_0x4ad9fc);}return null;};}function patchUpdates(_0x3ed71d){return function(_0x1304e7){try{jsonpatch[_0x79cb('0x23')](_0x1304e7,_0x3ed71d,!![]);}catch(_0x4b4c8f){return BPromise[_0x79cb('0x24')](_0x4b4c8f);}return _0x1304e7[_0x79cb('0x25')]();};}function saveUpdates(_0x2457b8,_0xcad5c9){return function(_0x5b60ae){if(_0x5b60ae){return _0x5b60ae[_0x79cb('0x26')](_0x2457b8)[_0x79cb('0x27')](function(_0x179f18){return _0x179f18;});}return null;};}function removeEntity(_0x514b67,_0x51771e){return function(_0x3f642c){if(_0x3f642c){return _0x3f642c[_0x79cb('0x28')]()[_0x79cb('0x27')](function(){_0x514b67['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2b8e,_0x5bc46f){return function(_0x153f29){if(!_0x153f29){_0x3a2b8e[_0x79cb('0x1b')](0x194);}return _0x153f29;};}function handleError(_0x40e473,_0x11ebeb){_0x11ebeb=_0x11ebeb||0x1f4;return function(_0x7a9e9d){logger[_0x79cb('0x29')](_0x7a9e9d['stack']);if(_0x7a9e9d['name']){delete _0x7a9e9d[_0x79cb('0x2a')];}_0x40e473[_0x79cb('0x1c')](_0x11ebeb)[_0x79cb('0x2b')](_0x7a9e9d);};}exports[_0x79cb('0x2c')]=function(_0x57faeb,_0xea9008){var _0x1c5421={},_0x3efbd7={},_0x3d3172={'count':0x0,'rows':[]};var _0x6ca94e=_[_0x79cb('0x2d')](db['DeskConfiguration'][_0x79cb('0x2e')],function(_0x2d2fdf){return{'name':_0x2d2fdf[_0x79cb('0x2f')],'type':_0x2d2fdf[_0x79cb('0x30')][_0x79cb('0x31')]};});_0x3efbd7[_0x79cb('0x32')]=_['map'](_0x6ca94e,'name');_0x3efbd7[_0x79cb('0x33')]=_[_0x79cb('0x34')](_0x57faeb[_0x79cb('0x33')]);_0x3efbd7[_0x79cb('0x35')]=_[_0x79cb('0x36')](_0x3efbd7[_0x79cb('0x32')],_0x3efbd7[_0x79cb('0x33')]);_0x1c5421['attributes']=_[_0x79cb('0x36')](_0x3efbd7[_0x79cb('0x32')],qs[_0x79cb('0x37')](_0x57faeb[_0x79cb('0x33')]['fields']));_0x1c5421[_0x79cb('0x38')]=_0x1c5421[_0x79cb('0x38')][_0x79cb('0x39')]?_0x1c5421['attributes']:_0x3efbd7[_0x79cb('0x32')];if(!_0x57faeb[_0x79cb('0x33')]['hasOwnProperty']('nolimit')){_0x1c5421[_0x79cb('0x21')]=qs[_0x79cb('0x21')](_0x57faeb[_0x79cb('0x33')][_0x79cb('0x21')]);_0x1c5421[_0x79cb('0x20')]=qs[_0x79cb('0x20')](_0x57faeb['query'][_0x79cb('0x20')]);}_0x1c5421[_0x79cb('0x3a')]=qs[_0x79cb('0x3b')](_0x57faeb[_0x79cb('0x33')][_0x79cb('0x3b')]);_0x1c5421[_0x79cb('0x3c')]=qs[_0x79cb('0x35')](_[_0x79cb('0x3d')](_0x57faeb[_0x79cb('0x33')],_0x3efbd7['filters']),_0x6ca94e);if(_0x57faeb[_0x79cb('0x33')][_0x79cb('0x3e')]){_0x1c5421[_0x79cb('0x3c')]=_[_0x79cb('0x3f')](_0x1c5421['where'],{'$or':_[_0x79cb('0x2d')](_0x6ca94e,function(_0x50fd34){if(_0x50fd34['type']!=='VIRTUAL'){var _0x13522f={};_0x13522f[_0x50fd34[_0x79cb('0x2a')]]={'$like':'%'+_0x57faeb[_0x79cb('0x33')][_0x79cb('0x3e')]+'%'};return _0x13522f;}})});}_0x1c5421=_[_0x79cb('0x3f')]({},_0x1c5421,_0x57faeb['options']);var _0x507d22={'where':_0x1c5421[_0x79cb('0x3c')]};return db['DeskConfiguration']['count'](_0x507d22)[_0x79cb('0x27')](function(_0x354caf){_0x3d3172['count']=_0x354caf;if(_0x57faeb[_0x79cb('0x33')]['includeAll']){_0x1c5421[_0x79cb('0x40')]=[{'all':!![]}];}return db[_0x79cb('0x41')][_0x79cb('0x42')](_0x1c5421);})[_0x79cb('0x27')](function(_0x413c53){_0x3d3172[_0x79cb('0x43')]=_0x413c53;return _0x3d3172;})[_0x79cb('0x27')](respondWithFilteredResult(_0xea9008,_0x1c5421))[_0x79cb('0x44')](handleError(_0xea9008,null));};exports[_0x79cb('0x45')]=function(_0x5c45b1,_0x2a2c3a){var _0x4452a9={'raw':![],'where':{'id':_0x5c45b1[_0x79cb('0x46')]['id']}},_0x23f1b7={};_0x23f1b7[_0x79cb('0x32')]=_[_0x79cb('0x34')](db[_0x79cb('0x41')]['rawAttributes']);_0x23f1b7['query']=_[_0x79cb('0x34')](_0x5c45b1['query']);_0x23f1b7[_0x79cb('0x35')]=_[_0x79cb('0x36')](_0x23f1b7['model'],_0x23f1b7[_0x79cb('0x33')]);_0x4452a9['attributes']=_[_0x79cb('0x36')](_0x23f1b7[_0x79cb('0x32')],qs['fields'](_0x5c45b1['query'][_0x79cb('0x37')]));_0x4452a9['attributes']=_0x4452a9['attributes'][_0x79cb('0x39')]?_0x4452a9['attributes']:_0x23f1b7['model'];if(_0x5c45b1[_0x79cb('0x33')][_0x79cb('0x47')]){_0x4452a9[_0x79cb('0x40')]=[{'all':!![]}];}_0x4452a9=_[_0x79cb('0x3f')]({},_0x4452a9,_0x5c45b1[_0x79cb('0x48')]);return db[_0x79cb('0x41')]['find'](_0x4452a9)[_0x79cb('0x27')](handleEntityNotFound(_0x2a2c3a,null))['then'](respondWithResult(_0x2a2c3a,null))[_0x79cb('0x44')](handleError(_0x2a2c3a,null));};exports[_0x79cb('0x49')]=function(_0x3531d5,_0x27a8be){return db['DeskConfiguration']['create'](_0x3531d5[_0x79cb('0x4a')],{})[_0x79cb('0x27')](respondWithResult(_0x27a8be,0xc9))[_0x79cb('0x44')](handleError(_0x27a8be,null));};exports[_0x79cb('0x26')]=function(_0x2b2c30,_0x58085a){if(_0x2b2c30[_0x79cb('0x4a')]['id']){delete _0x2b2c30[_0x79cb('0x4a')]['id'];}return db[_0x79cb('0x41')][_0x79cb('0x4b')]({'where':{'id':_0x2b2c30[_0x79cb('0x46')]['id']}})[_0x79cb('0x27')](handleEntityNotFound(_0x58085a,null))[_0x79cb('0x27')](saveUpdates(_0x2b2c30['body'],null))[_0x79cb('0x27')](respondWithResult(_0x58085a,null))['catch'](handleError(_0x58085a,null));};exports[_0x79cb('0x28')]=function(_0x3b260d,_0x5d8ffd){return db[_0x79cb('0x41')][_0x79cb('0x4b')]({'where':{'id':_0x3b260d['params']['id']}})[_0x79cb('0x27')](handleEntityNotFound(_0x5d8ffd,null))['then'](removeEntity(_0x5d8ffd,null))[_0x79cb('0x44')](handleError(_0x5d8ffd,null));};exports[_0x79cb('0x4c')]=function(_0x2d13fc,_0x52bbb6,_0x1b6c32){var _0x277d74={};var _0x14f263={};var _0x1ed1d7;var _0x3bd1db;return db[_0x79cb('0x41')][_0x79cb('0x4d')]({'where':{'id':_0x2d13fc['params']['id']}})[_0x79cb('0x27')](handleEntityNotFound(_0x52bbb6,null))[_0x79cb('0x27')](function(_0x3def6e){if(_0x3def6e){_0x1ed1d7=_0x3def6e;_0x14f263[_0x79cb('0x32')]=_[_0x79cb('0x34')](db[_0x79cb('0x4e')][_0x79cb('0x2e')]);_0x14f263[_0x79cb('0x33')]=_[_0x79cb('0x34')](_0x2d13fc['query']);_0x14f263[_0x79cb('0x35')]=_[_0x79cb('0x36')](_0x14f263[_0x79cb('0x32')],_0x14f263[_0x79cb('0x33')]);_0x277d74[_0x79cb('0x38')]=_['intersection'](_0x14f263[_0x79cb('0x32')],qs[_0x79cb('0x37')](_0x2d13fc['query'][_0x79cb('0x37')]));_0x277d74[_0x79cb('0x38')]=_0x277d74['attributes'][_0x79cb('0x39')]?_0x277d74['attributes']:_0x14f263['model'];_0x277d74[_0x79cb('0x3a')]=qs[_0x79cb('0x3b')](_0x2d13fc['query'][_0x79cb('0x3b')]);_0x277d74[_0x79cb('0x3c')]=qs[_0x79cb('0x35')](_[_0x79cb('0x3d')](_0x2d13fc[_0x79cb('0x33')],_0x14f263[_0x79cb('0x35')]));if(_0x2d13fc['query']['filter']){_0x277d74[_0x79cb('0x3c')]=_[_0x79cb('0x3f')](_0x277d74[_0x79cb('0x3c')],{'$or':_['map'](_0x277d74['attributes'],function(_0x8214cc){var _0x427407={};_0x427407[_0x8214cc]={'$like':'%'+_0x2d13fc[_0x79cb('0x33')][_0x79cb('0x3e')]+'%'};return _0x427407;})});}_0x277d74=_[_0x79cb('0x3f')]({},_0x277d74,_0x2d13fc['options']);return _0x1ed1d7[_0x79cb('0x4c')](_0x277d74);}})['then'](function(_0x5cdc60){if(_0x5cdc60){_0x3bd1db=_0x5cdc60['length'];if(!_0x2d13fc[_0x79cb('0x33')][_0x79cb('0x4f')](_0x79cb('0x50'))){_0x277d74[_0x79cb('0x21')]=qs['limit'](_0x2d13fc[_0x79cb('0x33')][_0x79cb('0x21')]);_0x277d74[_0x79cb('0x20')]=qs[_0x79cb('0x20')](_0x2d13fc[_0x79cb('0x33')]['offset']);}return _0x1ed1d7[_0x79cb('0x4c')](_0x277d74);}})[_0x79cb('0x27')](function(_0x2bd2cd){if(_0x2bd2cd){return _0x2bd2cd?{'count':_0x3bd1db,'rows':_0x2bd2cd}:null;}})[_0x79cb('0x27')](respondWithResult(_0x52bbb6,null))['catch'](handleError(_0x52bbb6,null));};exports[_0x79cb('0x51')]=function(_0x4a54e5,_0x4ede78,_0x13be9c){var _0x3fb6d8={};var _0x279fe3={};var _0x2b3282;var _0x258acc;return db[_0x79cb('0x41')][_0x79cb('0x4d')]({'where':{'id':_0x4a54e5[_0x79cb('0x46')]['id']}})[_0x79cb('0x27')](handleEntityNotFound(_0x4ede78,null))[_0x79cb('0x27')](function(_0x19e708){if(_0x19e708){_0x2b3282=_0x19e708;_0x279fe3[_0x79cb('0x32')]=_[_0x79cb('0x34')](db[_0x79cb('0x4e')]['rawAttributes']);_0x279fe3['query']=_['keys'](_0x4a54e5[_0x79cb('0x33')]);_0x279fe3[_0x79cb('0x35')]=_['intersection'](_0x279fe3[_0x79cb('0x32')],_0x279fe3[_0x79cb('0x33')]);_0x3fb6d8['attributes']=_[_0x79cb('0x36')](_0x279fe3[_0x79cb('0x32')],qs['fields'](_0x4a54e5[_0x79cb('0x33')][_0x79cb('0x37')]));_0x3fb6d8['attributes']=_0x3fb6d8[_0x79cb('0x38')][_0x79cb('0x39')]?_0x3fb6d8[_0x79cb('0x38')]:_0x279fe3[_0x79cb('0x32')];_0x3fb6d8['order']=qs['sort'](_0x4a54e5[_0x79cb('0x33')][_0x79cb('0x3b')]);_0x3fb6d8[_0x79cb('0x3c')]=qs[_0x79cb('0x35')](_['pick'](_0x4a54e5[_0x79cb('0x33')],_0x279fe3[_0x79cb('0x35')]));if(_0x4a54e5['query'][_0x79cb('0x3e')]){_0x3fb6d8['where']=_[_0x79cb('0x3f')](_0x3fb6d8[_0x79cb('0x3c')],{'$or':_[_0x79cb('0x2d')](_0x3fb6d8[_0x79cb('0x38')],function(_0x29ed05){var _0x220eb0={};_0x220eb0[_0x29ed05]={'$like':'%'+_0x4a54e5[_0x79cb('0x33')][_0x79cb('0x3e')]+'%'};return _0x220eb0;})});}_0x3fb6d8=_['merge']({},_0x3fb6d8,_0x4a54e5[_0x79cb('0x48')]);return _0x2b3282[_0x79cb('0x51')](_0x3fb6d8);}})['then'](function(_0x299861){if(_0x299861){_0x258acc=_0x299861['length'];if(!_0x4a54e5['query'][_0x79cb('0x4f')]('nolimit')){_0x3fb6d8[_0x79cb('0x21')]=qs[_0x79cb('0x21')](_0x4a54e5[_0x79cb('0x33')]['limit']);_0x3fb6d8[_0x79cb('0x20')]=qs[_0x79cb('0x20')](_0x4a54e5[_0x79cb('0x33')][_0x79cb('0x20')]);}return _0x2b3282[_0x79cb('0x51')](_0x3fb6d8);}})['then'](function(_0x42a771){if(_0x42a771){return _0x42a771?{'count':_0x258acc,'rows':_0x42a771}:null;}})['then'](respondWithResult(_0x4ede78,null))['catch'](handleError(_0x4ede78,null));};exports['getDescriptions']=function(_0x16f9c2,_0x122242,_0x49c91a){var _0x48f4fe={};var _0x252238={};var _0x5ae114;var _0x332a5f;return db[_0x79cb('0x41')][_0x79cb('0x4d')]({'where':{'id':_0x16f9c2[_0x79cb('0x46')]['id']}})['then'](handleEntityNotFound(_0x122242,null))[_0x79cb('0x27')](function(_0x29382b){if(_0x29382b){_0x5ae114=_0x29382b;_0x252238['model']=_[_0x79cb('0x34')](db[_0x79cb('0x4e')][_0x79cb('0x2e')]);_0x252238[_0x79cb('0x33')]=_[_0x79cb('0x34')](_0x16f9c2[_0x79cb('0x33')]);_0x252238[_0x79cb('0x35')]=_[_0x79cb('0x36')](_0x252238['model'],_0x252238['query']);_0x48f4fe['attributes']=_['intersection'](_0x252238['model'],qs[_0x79cb('0x37')](_0x16f9c2[_0x79cb('0x33')][_0x79cb('0x37')]));_0x48f4fe[_0x79cb('0x38')]=_0x48f4fe[_0x79cb('0x38')][_0x79cb('0x39')]?_0x48f4fe['attributes']:_0x252238[_0x79cb('0x32')];_0x48f4fe[_0x79cb('0x3a')]=qs[_0x79cb('0x3b')](_0x16f9c2['query']['sort']);_0x48f4fe['where']=qs[_0x79cb('0x35')](_['pick'](_0x16f9c2[_0x79cb('0x33')],_0x252238['filters']));if(_0x16f9c2['query'][_0x79cb('0x3e')]){_0x48f4fe[_0x79cb('0x3c')]=_[_0x79cb('0x3f')](_0x48f4fe['where'],{'$or':_['map'](_0x48f4fe[_0x79cb('0x38')],function(_0x51bd2f){var _0x3cfc96={};_0x3cfc96[_0x51bd2f]={'$like':'%'+_0x16f9c2['query'][_0x79cb('0x3e')]+'%'};return _0x3cfc96;})});}_0x48f4fe=_[_0x79cb('0x3f')]({},_0x48f4fe,_0x16f9c2[_0x79cb('0x48')]);return _0x5ae114[_0x79cb('0x52')](_0x48f4fe);}})[_0x79cb('0x27')](function(_0x5133c6){if(_0x5133c6){_0x332a5f=_0x5133c6['length'];if(!_0x16f9c2[_0x79cb('0x33')][_0x79cb('0x4f')](_0x79cb('0x50'))){_0x48f4fe['limit']=qs[_0x79cb('0x21')](_0x16f9c2[_0x79cb('0x33')][_0x79cb('0x21')]);_0x48f4fe['offset']=qs[_0x79cb('0x20')](_0x16f9c2[_0x79cb('0x33')][_0x79cb('0x20')]);}return _0x5ae114[_0x79cb('0x52')](_0x48f4fe);}})[_0x79cb('0x27')](function(_0x256919){if(_0x256919){return _0x256919?{'count':_0x332a5f,'rows':_0x256919}:null;}})['then'](respondWithResult(_0x122242,null))[_0x79cb('0x44')](handleError(_0x122242,null));};exports[_0x79cb('0x53')]=function(_0x95be3a,_0x46cf41,_0x408ce7){var _0xeb4897={};var _0x182a89={};var _0x1325fa;var _0x84b046;return db[_0x79cb('0x41')][_0x79cb('0x4d')]({'where':{'id':_0x95be3a[_0x79cb('0x46')]['id']}})[_0x79cb('0x27')](handleEntityNotFound(_0x46cf41,null))['then'](function(_0x258a29){if(_0x258a29){_0x1325fa=_0x258a29;_0x182a89[_0x79cb('0x32')]=_[_0x79cb('0x34')](db[_0x79cb('0x54')][_0x79cb('0x2e')]);_0x182a89[_0x79cb('0x33')]=_[_0x79cb('0x34')](_0x95be3a[_0x79cb('0x33')]);_0x182a89[_0x79cb('0x35')]=_[_0x79cb('0x36')](_0x182a89[_0x79cb('0x32')],_0x182a89[_0x79cb('0x33')]);_0xeb4897['attributes']=_[_0x79cb('0x36')](_0x182a89[_0x79cb('0x32')],qs['fields'](_0x95be3a[_0x79cb('0x33')][_0x79cb('0x37')]));_0xeb4897[_0x79cb('0x38')]=_0xeb4897[_0x79cb('0x38')][_0x79cb('0x39')]?_0xeb4897[_0x79cb('0x38')]:_0x182a89[_0x79cb('0x32')];_0xeb4897['order']=qs['sort'](_0x95be3a['query']['sort']);_0xeb4897[_0x79cb('0x3c')]=qs[_0x79cb('0x35')](_[_0x79cb('0x3d')](_0x95be3a['query'],_0x182a89[_0x79cb('0x35')]));if(_0x95be3a[_0x79cb('0x33')][_0x79cb('0x3e')]){_0xeb4897[_0x79cb('0x3c')]=_[_0x79cb('0x3f')](_0xeb4897['where'],{'$or':_[_0x79cb('0x2d')](_0xeb4897[_0x79cb('0x38')],function(_0x47a9c6){var _0x51379e={};_0x51379e[_0x47a9c6]={'$like':'%'+_0x95be3a[_0x79cb('0x33')][_0x79cb('0x3e')]+'%'};return _0x51379e;})});}_0xeb4897=_[_0x79cb('0x3f')]({},_0xeb4897,_0x95be3a[_0x79cb('0x48')]);return _0x1325fa['getTags'](_0xeb4897);}})['then'](function(_0x3256c1){if(_0x3256c1){_0x84b046=_0x3256c1[_0x79cb('0x39')];if(!_0x95be3a[_0x79cb('0x33')][_0x79cb('0x4f')](_0x79cb('0x50'))){_0xeb4897[_0x79cb('0x21')]=qs[_0x79cb('0x21')](_0x95be3a[_0x79cb('0x33')][_0x79cb('0x21')]);_0xeb4897[_0x79cb('0x20')]=qs[_0x79cb('0x20')](_0x95be3a[_0x79cb('0x33')]['offset']);}return _0x1325fa['getTags'](_0xeb4897);}})[_0x79cb('0x27')](function(_0x2de14c){if(_0x2de14c){return _0x2de14c?{'count':_0x84b046,'rows':_0x2de14c}:null;}})[_0x79cb('0x27')](respondWithResult(_0x46cf41,null))['catch'](handleError(_0x46cf41,null));};exports[_0x79cb('0x55')]=function(_0x3529bc,_0x242cce,_0x523426){if(_0x3529bc[_0x79cb('0x4a')]['id']){delete _0x3529bc['body']['id'];}return db[_0x79cb('0x41')]['findOne']({'where':{'id':_0x3529bc[_0x79cb('0x46')]['id']}})[_0x79cb('0x27')](handleEntityNotFound(_0x242cce,null))[_0x79cb('0x27')](function(_0x2d7247){if(_0x2d7247){return _0x2d7247[_0x79cb('0x55')](_0x3529bc[_0x79cb('0x4a')]['ids']||[]);}return null;})['then'](respondWithResult(_0x242cce,null))['catch'](handleError(_0x242cce,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 1ead1fc..82d308d 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 _0x1d17=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x1d17,0x123));var _0x71d1=function(_0x41628e,_0x5248c4){_0x41628e=_0x41628e-0x0;var _0x2c19a0=_0x1d17[_0x41628e];return _0x2c19a0;};'use strict';var _=require(_0x71d1('0x0'));var util=require(_0x71d1('0x1'));var logger=require(_0x71d1('0x2'))(_0x71d1('0x3'));var moment=require(_0x71d1('0x4'));var BPromise=require(_0x71d1('0x5'));var rp=require(_0x71d1('0x6'));var fs=require('fs');var path=require(_0x71d1('0x7'));var rimraf=require(_0x71d1('0x8'));var config=require(_0x71d1('0x9'));var attributes=require(_0x71d1('0xa'));module[_0x71d1('0xb')]=function(_0x56293d,_0x53149a){return _0x56293d['define'](_0x71d1('0xc'),attributes,{'tableName':_0x71d1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d40=['bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1ab3d0,_0x1acd46){var _0x4d507d=function(_0x2998ac){while(--_0x2998ac){_0x1ab3d0['push'](_0x1ab3d0['shift']());}};_0x4d507d(++_0x1acd46);}(_0x4d40,0xb1));var _0x04d4=function(_0x4e90f0,_0x3b7e3c){_0x4e90f0=_0x4e90f0-0x0;var _0x1a2cee=_0x4d40[_0x4e90f0];return _0x1a2cee;};'use strict';var _=require(_0x04d4('0x0'));var util=require(_0x04d4('0x1'));var logger=require(_0x04d4('0x2'))(_0x04d4('0x3'));var moment=require(_0x04d4('0x4'));var BPromise=require(_0x04d4('0x5'));var rp=require(_0x04d4('0x6'));var fs=require('fs');var path=require(_0x04d4('0x7'));var rimraf=require('rimraf');var config=require(_0x04d4('0x8'));var attributes=require(_0x04d4('0x9'));module[_0x04d4('0xa')]=function(_0x4445f7,_0xdb3e98){return _0x4445f7[_0x04d4('0xb')]('DeskConfiguration',attributes,{'tableName':_0x04d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 9161f45..545d32a 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 _0xd5f9=['../../config/environment','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x57a041,_0x4cc53a){var _0x2acacd=function(_0x451b1a){while(--_0x451b1a){_0x57a041['push'](_0x57a041['shift']());}};_0x2acacd(++_0x4cc53a);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0xd5f9[_0x5c72ee];return _0x231876;};'use strict';var _=require(_0x9d5f('0x0'));var util=require(_0x9d5f('0x1'));var moment=require(_0x9d5f('0x2'));var BPromise=require(_0x9d5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d5f('0x4'));var db=require(_0x9d5f('0x5'))['db'];var utils=require(_0x9d5f('0x6'));var logger=require(_0x9d5f('0x7'))(_0x9d5f('0x8'));var config=require(_0x9d5f('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dca4b,_0x2e1c4e,_0x4ac60a){return new BPromise(function(_0x402a35,_0x255389){return client['request'](_0x1dca4b,_0x4ac60a)[_0x9d5f('0xa')](function(_0x241166){logger['info'](_0x9d5f('0xb'),_0x2e1c4e,'request\x20sent');logger[_0x9d5f('0xc')](_0x9d5f('0xd'),_0x2e1c4e,_0x9d5f('0xe'),JSON[_0x9d5f('0xf')](_0x241166));if(_0x241166[_0x9d5f('0x10')]){if(_0x241166['error'][_0x9d5f('0x11')]===0x1f4){logger[_0x9d5f('0x10')](_0x9d5f('0xb'),_0x2e1c4e,_0x241166[_0x9d5f('0x10')][_0x9d5f('0x12')]);return _0x255389(_0x241166[_0x9d5f('0x10')][_0x9d5f('0x12')]);}logger[_0x9d5f('0x10')](_0x9d5f('0xb'),_0x2e1c4e,_0x241166['error']['message']);return _0x402a35(_0x241166['error']['message']);}else{logger[_0x9d5f('0x13')](_0x9d5f('0xb'),_0x2e1c4e,'request\x20sent');_0x402a35(_0x241166[_0x9d5f('0x14')][_0x9d5f('0x12')]);}})[_0x9d5f('0x15')](function(_0x3a9220){logger[_0x9d5f('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x2e1c4e,_0x3a9220);_0x255389(_0x3a9220);});});} \ No newline at end of file +var _0x6478=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46416c,_0x5232be){var _0x4f8410=function(_0x53258b){while(--_0x53258b){_0x46416c['push'](_0x46416c['shift']());}};_0x4f8410(++_0x5232be);}(_0x6478,0x1e7));var _0x8647=function(_0x492269,_0x1a50a9){_0x492269=_0x492269-0x0;var _0x134a8c=_0x6478[_0x492269];return _0x134a8c;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var moment=require(_0x8647('0x2'));var BPromise=require(_0x8647('0x3'));var rs=require(_0x8647('0x4'));var fs=require('fs');var Redis=require(_0x8647('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8647('0x6'));var logger=require(_0x8647('0x7'))(_0x8647('0x8'));var config=require(_0x8647('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8647('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ef3f8,_0x172a25,_0x41aaea){return new BPromise(function(_0x3abf85,_0x8768d6){return client[_0x8647('0xb')](_0x5ef3f8,_0x41aaea)[_0x8647('0xc')](function(_0x430976){logger[_0x8647('0xd')](_0x8647('0xe'),_0x172a25,_0x8647('0xf'));logger[_0x8647('0x10')](_0x8647('0x11'),_0x172a25,_0x8647('0xf'),JSON[_0x8647('0x12')](_0x430976));if(_0x430976[_0x8647('0x13')]){if(_0x430976[_0x8647('0x13')][_0x8647('0x14')]===0x1f4){logger['error'](_0x8647('0xe'),_0x172a25,_0x430976['error'][_0x8647('0x15')]);return _0x8768d6(_0x430976[_0x8647('0x13')][_0x8647('0x15')]);}logger[_0x8647('0x13')](_0x8647('0xe'),_0x172a25,_0x430976['error'][_0x8647('0x15')]);return _0x3abf85(_0x430976[_0x8647('0x13')][_0x8647('0x15')]);}else{logger[_0x8647('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x172a25,'request\x20sent');_0x3abf85(_0x430976[_0x8647('0x16')][_0x8647('0x15')]);}})[_0x8647('0x17')](function(_0x390d4d){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x172a25,_0x390d4d);_0x8768d6(_0x390d4d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7fba7ee..69e49a8 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 _0xe2c5=['delete','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','put'];(function(_0xc252d7,_0x1090fe){var _0x1ea9d6=function(_0x3d4a53){while(--_0x3d4a53){_0xc252d7['push'](_0xc252d7['shift']());}};_0x1ea9d6(++_0x1090fe);}(_0xe2c5,0xd3));var _0x5e2c=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xe2c5[_0x154940];return _0x401409;};'use strict';var multer=require('multer');var util=require(_0x5e2c('0x0'));var path=require(_0x5e2c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5e2c('0x2'));var auth=require(_0x5e2c('0x3'));var interaction=require(_0x5e2c('0x4'));var config=require(_0x5e2c('0x5'));var controller=require(_0x5e2c('0x6'));router[_0x5e2c('0x7')]('/',auth[_0x5e2c('0x8')](),controller[_0x5e2c('0x9')]);router[_0x5e2c('0x7')](_0x5e2c('0xa'),auth[_0x5e2c('0x8')](),controller['show']);router[_0x5e2c('0xb')]('/',auth[_0x5e2c('0x8')](),controller['create']);router[_0x5e2c('0xc')](_0x5e2c('0xa'),auth[_0x5e2c('0x8')](),controller['update']);router[_0x5e2c('0xd')](_0x5e2c('0xa'),auth[_0x5e2c('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4530=['post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x549759,_0x434e30){var _0x288cf8=function(_0x1eb882){while(--_0x1eb882){_0x549759['push'](_0x549759['shift']());}};_0x288cf8(++_0x434e30);}(_0x4530,0x1e9));var _0x0453=function(_0x35863a,_0x5bb200){_0x35863a=_0x35863a-0x0;var _0xca8af8=_0x4530[_0x35863a];return _0xca8af8;};'use strict';var multer=require('multer');var util=require(_0x0453('0x0'));var path=require(_0x0453('0x1'));var timeout=require(_0x0453('0x2'));var express=require(_0x0453('0x3'));var router=express[_0x0453('0x4')]();var fs_extra=require(_0x0453('0x5'));var auth=require(_0x0453('0x6'));var interaction=require(_0x0453('0x7'));var config=require(_0x0453('0x8'));var controller=require(_0x0453('0x9'));router[_0x0453('0xa')]('/',auth['isAuthenticated'](),controller[_0x0453('0xb')]);router[_0x0453('0xa')](_0x0453('0xc'),auth[_0x0453('0xd')](),controller[_0x0453('0xe')]);router[_0x0453('0xf')]('/',auth[_0x0453('0xd')](),controller[_0x0453('0x10')]);router[_0x0453('0x11')](_0x0453('0xc'),auth[_0x0453('0xd')](),controller['update']);router[_0x0453('0x12')](_0x0453('0xc'),auth['isAuthenticated'](),controller[_0x0453('0x13')]);module[_0x0453('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 094026a..cf575f8 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 _0xf969=['keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf969,0xa7));var _0x9f96=function(_0x270463,_0x126ca0){_0x270463=_0x270463-0x0;var _0x4e024f=_0xf969[_0x270463];return _0x4e024f;};'use strict';var Sequelize=require(_0x9f96('0x0'));module[_0x9f96('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9f96('0x2'),_0x9f96('0x3'),'customVariable',_0x9f96('0x4'),_0x9f96('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9f96('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9f96('0x7')](_0x9f96('0x2'),_0x9f96('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9f96('0x6')]},'idField':{'type':Sequelize[_0x9f96('0x6')]},'nameField':{'type':Sequelize[_0x9f96('0x6')]},'customField':{'type':Sequelize[_0x9f96('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8805=['picklist','STRING','ENUM','string','variable','customVariable'];(function(_0x348aca,_0x26d747){var _0x26b7d3=function(_0x5a5b33){while(--_0x5a5b33){_0x348aca['push'](_0x348aca['shift']());}};_0x26b7d3(++_0x26d747);}(_0x8805,0xb6));var _0x5880=function(_0x254744,_0x219e6b){_0x254744=_0x254744-0x0;var _0x2a6a96=_0x8805[_0x254744];return _0x2a6a96;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5880('0x0')](_0x5880('0x1'),_0x5880('0x2'),_0x5880('0x3'),'keyValue',_0x5880('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5880('0x5')]},'key':{'type':Sequelize[_0x5880('0x5')]},'keyType':{'type':Sequelize[_0x5880('0x0')](_0x5880('0x1'),_0x5880('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x5880('0x5')]},'idField':{'type':Sequelize[_0x5880('0x5')]},'nameField':{'type':Sequelize[_0x5880('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5880('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index eff990d..ca47d27 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 _0x090a=['rows','catch','show','params','includeAll','find','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include'];(function(_0x5d33f8,_0x4d078a){var _0x381196=function(_0x5299cc){while(--_0x5299cc){_0x5d33f8['push'](_0x5d33f8['shift']());}};_0x381196(++_0x4d078a);}(_0x090a,0x133));var _0xa090=function(_0x17837c,_0x112c17){_0x17837c=_0x17837c-0x0;var _0x287ea5=_0x090a[_0x17837c];return _0x287ea5;};'use strict';var emlformat=require(_0xa090('0x0'));var rimraf=require(_0xa090('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa090('0x2'));var rp=require(_0xa090('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa090('0x4'));var util=require('util');var path=require(_0xa090('0x5'));var sox=require(_0xa090('0x6'));var csv=require(_0xa090('0x7'));var ejs=require(_0xa090('0x8'));var fs=require('fs');var fs_extra=require(_0xa090('0x9'));var _=require(_0xa090('0xa'));var squel=require(_0xa090('0xb'));var crypto=require(_0xa090('0xc'));var jsforce=require(_0xa090('0xd'));var deskjs=require(_0xa090('0xe'));var toCsv=require(_0xa090('0x7'));var querystring=require(_0xa090('0xf'));var Papa=require(_0xa090('0x10'));var Redis=require(_0xa090('0x11'));var authService=require(_0xa090('0x12'));var qs=require(_0xa090('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa090('0x14'));var logger=require('../../config/logger')(_0xa090('0x15'));var utils=require(_0xa090('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa090('0x17'));var db=require(_0xa090('0x18'))['db'];function respondWithStatusCode(_0x46164a,_0x337aad){_0x337aad=_0x337aad||0xcc;return function(_0x168827){if(_0x168827){return _0x46164a[_0xa090('0x19')](_0x337aad);}return _0x46164a['status'](_0x337aad)[_0xa090('0x1a')]();};}function respondWithResult(_0x26d9c7,_0x1407d3){_0x1407d3=_0x1407d3||0xc8;return function(_0x25601e){if(_0x25601e){return _0x26d9c7[_0xa090('0x1b')](_0x1407d3)[_0xa090('0x1c')](_0x25601e);}};}function respondWithFilteredResult(_0xe1f5c9,_0x297e21){return function(_0x1a7314){if(_0x1a7314){var _0x48c5b2=typeof _0x297e21['offset']===_0xa090('0x1d')&&typeof _0x297e21[_0xa090('0x1e')]===_0xa090('0x1d');var _0xd3983=_0x1a7314['count'];var _0x2ad993=_0x48c5b2?0x0:_0x297e21[_0xa090('0x1f')];var _0x19aaf5=_0x48c5b2?_0x1a7314[_0xa090('0x20')]:_0x297e21['offset']+_0x297e21['limit'];var _0x36afd8;if(_0x19aaf5>=_0xd3983){_0x19aaf5=_0xd3983;_0x36afd8=0xc8;}else{_0x36afd8=0xce;}_0xe1f5c9[_0xa090('0x1b')](_0x36afd8);return _0xe1f5c9[_0xa090('0x21')](_0xa090('0x22'),_0x2ad993+'-'+_0x19aaf5+'/'+_0xd3983)[_0xa090('0x1c')](_0x1a7314);}return null;};}function patchUpdates(_0x5e0036){return function(_0x479a66){try{jsonpatch[_0xa090('0x23')](_0x479a66,_0x5e0036,!![]);}catch(_0x553d64){return BPromise['reject'](_0x553d64);}return _0x479a66[_0xa090('0x24')]();};}function saveUpdates(_0x39983b,_0x2f68c6){return function(_0x17693f){if(_0x17693f){return _0x17693f[_0xa090('0x25')](_0x39983b)[_0xa090('0x26')](function(_0x474b6b){return _0x474b6b;});}return null;};}function removeEntity(_0xc60bfd,_0x2f587d){return function(_0x210ae3){if(_0x210ae3){return _0x210ae3[_0xa090('0x27')]()[_0xa090('0x26')](function(){_0xc60bfd[_0xa090('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a954,_0xfd6cf0){return function(_0x34e50a){if(!_0x34e50a){_0x55a954[_0xa090('0x19')](0x194);}return _0x34e50a;};}function handleError(_0x3f8af2,_0x365f35){_0x365f35=_0x365f35||0x1f4;return function(_0x452734){logger[_0xa090('0x28')](_0x452734[_0xa090('0x29')]);if(_0x452734[_0xa090('0x2a')]){delete _0x452734[_0xa090('0x2a')];}_0x3f8af2[_0xa090('0x1b')](_0x365f35)[_0xa090('0x2b')](_0x452734);};}exports[_0xa090('0x2c')]=function(_0x2f36da,_0x512f0d){var _0xae6cc1={},_0x3e69f8={},_0x23286f={'count':0x0,'rows':[]};var _0x2e18d6=_[_0xa090('0x2d')](db[_0xa090('0x2e')][_0xa090('0x2f')],function(_0x1c21c8){return{'name':_0x1c21c8[_0xa090('0x30')],'type':_0x1c21c8[_0xa090('0x31')]['key']};});_0x3e69f8['model']=_[_0xa090('0x2d')](_0x2e18d6,_0xa090('0x2a'));_0x3e69f8[_0xa090('0x32')]=_[_0xa090('0x33')](_0x2f36da[_0xa090('0x32')]);_0x3e69f8[_0xa090('0x34')]=_[_0xa090('0x35')](_0x3e69f8[_0xa090('0x36')],_0x3e69f8[_0xa090('0x32')]);_0xae6cc1[_0xa090('0x37')]=_[_0xa090('0x35')](_0x3e69f8[_0xa090('0x36')],qs[_0xa090('0x38')](_0x2f36da['query'][_0xa090('0x38')]));_0xae6cc1['attributes']=_0xae6cc1[_0xa090('0x37')][_0xa090('0x39')]?_0xae6cc1[_0xa090('0x37')]:_0x3e69f8['model'];if(!_0x2f36da[_0xa090('0x32')]['hasOwnProperty'](_0xa090('0x3a'))){_0xae6cc1['limit']=qs['limit'](_0x2f36da[_0xa090('0x32')][_0xa090('0x1e')]);_0xae6cc1[_0xa090('0x1f')]=qs['offset'](_0x2f36da[_0xa090('0x32')]['offset']);}_0xae6cc1[_0xa090('0x3b')]=qs[_0xa090('0x3c')](_0x2f36da[_0xa090('0x32')][_0xa090('0x3c')]);_0xae6cc1[_0xa090('0x3d')]=qs[_0xa090('0x34')](_[_0xa090('0x3e')](_0x2f36da[_0xa090('0x32')],_0x3e69f8[_0xa090('0x34')]),_0x2e18d6);if(_0x2f36da[_0xa090('0x32')][_0xa090('0x3f')]){_0xae6cc1[_0xa090('0x3d')]=_[_0xa090('0x40')](_0xae6cc1['where'],{'$or':_[_0xa090('0x2d')](_0x2e18d6,function(_0x33a41d){if(_0x33a41d[_0xa090('0x31')]!==_0xa090('0x41')){var _0x4cb5cc={};_0x4cb5cc[_0x33a41d['name']]={'$like':'%'+_0x2f36da[_0xa090('0x32')][_0xa090('0x3f')]+'%'};return _0x4cb5cc;}})});}_0xae6cc1=_['merge']({},_0xae6cc1,_0x2f36da[_0xa090('0x42')]);var _0xd6908e={'where':_0xae6cc1[_0xa090('0x3d')]};return db['DeskField']['count'](_0xd6908e)[_0xa090('0x26')](function(_0x3f43f2){_0x23286f[_0xa090('0x20')]=_0x3f43f2;if(_0x2f36da[_0xa090('0x32')]['includeAll']){_0xae6cc1[_0xa090('0x43')]=[{'all':!![]}];}return db[_0xa090('0x2e')]['findAll'](_0xae6cc1);})[_0xa090('0x26')](function(_0x2032ea){_0x23286f[_0xa090('0x44')]=_0x2032ea;return _0x23286f;})['then'](respondWithFilteredResult(_0x512f0d,_0xae6cc1))[_0xa090('0x45')](handleError(_0x512f0d,null));};exports[_0xa090('0x46')]=function(_0x49f658,_0x38afa6){var _0x19f357={'raw':!![],'where':{'id':_0x49f658[_0xa090('0x47')]['id']}},_0x3abc8b={};_0x3abc8b[_0xa090('0x36')]=_[_0xa090('0x33')](db[_0xa090('0x2e')]['rawAttributes']);_0x3abc8b['query']=_[_0xa090('0x33')](_0x49f658[_0xa090('0x32')]);_0x3abc8b[_0xa090('0x34')]=_[_0xa090('0x35')](_0x3abc8b[_0xa090('0x36')],_0x3abc8b['query']);_0x19f357[_0xa090('0x37')]=_[_0xa090('0x35')](_0x3abc8b[_0xa090('0x36')],qs['fields'](_0x49f658[_0xa090('0x32')][_0xa090('0x38')]));_0x19f357[_0xa090('0x37')]=_0x19f357[_0xa090('0x37')][_0xa090('0x39')]?_0x19f357['attributes']:_0x3abc8b[_0xa090('0x36')];if(_0x49f658[_0xa090('0x32')][_0xa090('0x48')]){_0x19f357[_0xa090('0x43')]=[{'all':!![]}];}_0x19f357=_[_0xa090('0x40')]({},_0x19f357,_0x49f658[_0xa090('0x42')]);return db[_0xa090('0x2e')][_0xa090('0x49')](_0x19f357)[_0xa090('0x26')](handleEntityNotFound(_0x38afa6,null))['then'](respondWithResult(_0x38afa6,null))[_0xa090('0x45')](handleError(_0x38afa6,null));};exports['create']=function(_0x1bba33,_0x190450){return db[_0xa090('0x2e')]['create'](_0x1bba33[_0xa090('0x4a')],{})[_0xa090('0x26')](respondWithResult(_0x190450,0xc9))[_0xa090('0x45')](handleError(_0x190450,null));};exports[_0xa090('0x25')]=function(_0x549210,_0x3c8358){if(_0x549210[_0xa090('0x4a')]['id']){delete _0x549210[_0xa090('0x4a')]['id'];}return db[_0xa090('0x2e')]['find']({'where':{'id':_0x549210[_0xa090('0x47')]['id']}})[_0xa090('0x26')](handleEntityNotFound(_0x3c8358,null))[_0xa090('0x26')](saveUpdates(_0x549210['body'],null))[_0xa090('0x26')](respondWithResult(_0x3c8358,null))[_0xa090('0x45')](handleError(_0x3c8358,null));};exports[_0xa090('0x27')]=function(_0x2eddeb,_0x2fcd34){return db[_0xa090('0x2e')]['find']({'where':{'id':_0x2eddeb[_0xa090('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fcd34,null))[_0xa090('0x26')](removeEntity(_0x2fcd34,null))['catch'](handleError(_0x2fcd34,null));}; \ No newline at end of file +var _0xcb04=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','DeskField','includeAll','findAll','rows','show','params','include','find','create','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x58e23,_0x36bb4f){var _0xadfdaa=function(_0x1ff5e4){while(--_0x1ff5e4){_0x58e23['push'](_0x58e23['shift']());}};_0xadfdaa(++_0x36bb4f);}(_0xcb04,0x9a));var _0x4cb0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcb04[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4cb0('0x0'));var rimraf=require(_0x4cb0('0x1'));var zipdir=require(_0x4cb0('0x2'));var jsonpatch=require(_0x4cb0('0x3'));var rp=require(_0x4cb0('0x4'));var moment=require(_0x4cb0('0x5'));var BPromise=require(_0x4cb0('0x6'));var Mustache=require(_0x4cb0('0x7'));var util=require(_0x4cb0('0x8'));var path=require(_0x4cb0('0x9'));var sox=require('sox');var csv=require(_0x4cb0('0xa'));var ejs=require(_0x4cb0('0xb'));var fs=require('fs');var fs_extra=require(_0x4cb0('0xc'));var _=require(_0x4cb0('0xd'));var squel=require(_0x4cb0('0xe'));var crypto=require(_0x4cb0('0xf'));var jsforce=require(_0x4cb0('0x10'));var deskjs=require(_0x4cb0('0x11'));var toCsv=require(_0x4cb0('0xa'));var querystring=require(_0x4cb0('0x12'));var Papa=require(_0x4cb0('0x13'));var Redis=require(_0x4cb0('0x14'));var authService=require(_0x4cb0('0x15'));var qs=require(_0x4cb0('0x16'));var as=require(_0x4cb0('0x17'));var hardwareService=require(_0x4cb0('0x18'));var logger=require(_0x4cb0('0x19'))(_0x4cb0('0x1a'));var utils=require('../../config/utils');var config=require(_0x4cb0('0x1b'));var licenseUtil=require(_0x4cb0('0x1c'));var db=require(_0x4cb0('0x1d'))['db'];function respondWithStatusCode(_0x15fab9,_0x5cad20){_0x5cad20=_0x5cad20||0xcc;return function(_0x14157f){if(_0x14157f){return _0x15fab9[_0x4cb0('0x1e')](_0x5cad20);}return _0x15fab9[_0x4cb0('0x1f')](_0x5cad20)[_0x4cb0('0x20')]();};}function respondWithResult(_0x3cb5b1,_0x2d9f4f){_0x2d9f4f=_0x2d9f4f||0xc8;return function(_0x2738aa){if(_0x2738aa){return _0x3cb5b1[_0x4cb0('0x1f')](_0x2d9f4f)[_0x4cb0('0x21')](_0x2738aa);}};}function respondWithFilteredResult(_0x52e8f2,_0x2b8969){return function(_0x150d4f){if(_0x150d4f){var _0x1317e9=typeof _0x2b8969[_0x4cb0('0x22')]==='undefined'&&typeof _0x2b8969['limit']===_0x4cb0('0x23');var _0x33f7ef=_0x150d4f[_0x4cb0('0x24')];var _0x91d3b=_0x1317e9?0x0:_0x2b8969[_0x4cb0('0x22')];var _0x2a3a34=_0x1317e9?_0x150d4f[_0x4cb0('0x24')]:_0x2b8969['offset']+_0x2b8969['limit'];var _0x30ba5a;if(_0x2a3a34>=_0x33f7ef){_0x2a3a34=_0x33f7ef;_0x30ba5a=0xc8;}else{_0x30ba5a=0xce;}_0x52e8f2['status'](_0x30ba5a);return _0x52e8f2['set'](_0x4cb0('0x25'),_0x91d3b+'-'+_0x2a3a34+'/'+_0x33f7ef)[_0x4cb0('0x21')](_0x150d4f);}return null;};}function patchUpdates(_0x4981a8){return function(_0x398659){try{jsonpatch[_0x4cb0('0x26')](_0x398659,_0x4981a8,!![]);}catch(_0x2def01){return BPromise['reject'](_0x2def01);}return _0x398659[_0x4cb0('0x27')]();};}function saveUpdates(_0x4ba67d,_0xfeb873){return function(_0x3196e0){if(_0x3196e0){return _0x3196e0[_0x4cb0('0x28')](_0x4ba67d)[_0x4cb0('0x29')](function(_0x4f12e6){return _0x4f12e6;});}return null;};}function removeEntity(_0x1e4190,_0xa1fd65){return function(_0x53fdd3){if(_0x53fdd3){return _0x53fdd3['destroy']()[_0x4cb0('0x29')](function(){_0x1e4190[_0x4cb0('0x1f')](0xcc)[_0x4cb0('0x20')]();});}};}function handleEntityNotFound(_0x188623,_0x325745){return function(_0x3710eb){if(!_0x3710eb){_0x188623[_0x4cb0('0x1e')](0x194);}return _0x3710eb;};}function handleError(_0x1b1f8f,_0x3b466c){_0x3b466c=_0x3b466c||0x1f4;return function(_0x3e28c0){logger[_0x4cb0('0x2a')](_0x3e28c0[_0x4cb0('0x2b')]);if(_0x3e28c0['name']){delete _0x3e28c0[_0x4cb0('0x2c')];}_0x1b1f8f[_0x4cb0('0x1f')](_0x3b466c)[_0x4cb0('0x2d')](_0x3e28c0);};}exports[_0x4cb0('0x2e')]=function(_0x25a25d,_0x5333c3){var _0x3f1bf2={},_0x4ba17a={},_0x1294ff={'count':0x0,'rows':[]};var _0x119bbb=_[_0x4cb0('0x2f')](db['DeskField'][_0x4cb0('0x30')],function(_0xf1bdc1){return{'name':_0xf1bdc1[_0x4cb0('0x31')],'type':_0xf1bdc1[_0x4cb0('0x32')]['key']};});_0x4ba17a[_0x4cb0('0x33')]=_['map'](_0x119bbb,'name');_0x4ba17a[_0x4cb0('0x34')]=_[_0x4cb0('0x35')](_0x25a25d['query']);_0x4ba17a[_0x4cb0('0x36')]=_['intersection'](_0x4ba17a[_0x4cb0('0x33')],_0x4ba17a[_0x4cb0('0x34')]);_0x3f1bf2[_0x4cb0('0x37')]=_[_0x4cb0('0x38')](_0x4ba17a['model'],qs[_0x4cb0('0x39')](_0x25a25d[_0x4cb0('0x34')][_0x4cb0('0x39')]));_0x3f1bf2[_0x4cb0('0x37')]=_0x3f1bf2[_0x4cb0('0x37')][_0x4cb0('0x3a')]?_0x3f1bf2[_0x4cb0('0x37')]:_0x4ba17a['model'];if(!_0x25a25d[_0x4cb0('0x34')][_0x4cb0('0x3b')](_0x4cb0('0x3c'))){_0x3f1bf2[_0x4cb0('0x3d')]=qs['limit'](_0x25a25d['query'][_0x4cb0('0x3d')]);_0x3f1bf2['offset']=qs[_0x4cb0('0x22')](_0x25a25d[_0x4cb0('0x34')]['offset']);}_0x3f1bf2[_0x4cb0('0x3e')]=qs['sort'](_0x25a25d[_0x4cb0('0x34')][_0x4cb0('0x3f')]);_0x3f1bf2[_0x4cb0('0x40')]=qs[_0x4cb0('0x36')](_['pick'](_0x25a25d[_0x4cb0('0x34')],_0x4ba17a[_0x4cb0('0x36')]),_0x119bbb);if(_0x25a25d[_0x4cb0('0x34')][_0x4cb0('0x41')]){_0x3f1bf2[_0x4cb0('0x40')]=_[_0x4cb0('0x42')](_0x3f1bf2[_0x4cb0('0x40')],{'$or':_[_0x4cb0('0x2f')](_0x119bbb,function(_0x2674e2){if(_0x2674e2[_0x4cb0('0x32')]!=='VIRTUAL'){var _0x55459d={};_0x55459d[_0x2674e2[_0x4cb0('0x2c')]]={'$like':'%'+_0x25a25d['query'][_0x4cb0('0x41')]+'%'};return _0x55459d;}})});}_0x3f1bf2=_[_0x4cb0('0x42')]({},_0x3f1bf2,_0x25a25d[_0x4cb0('0x43')]);var _0x47c17a={'where':_0x3f1bf2[_0x4cb0('0x40')]};return db[_0x4cb0('0x44')][_0x4cb0('0x24')](_0x47c17a)['then'](function(_0x77bbe){_0x1294ff[_0x4cb0('0x24')]=_0x77bbe;if(_0x25a25d[_0x4cb0('0x34')][_0x4cb0('0x45')]){_0x3f1bf2['include']=[{'all':!![]}];}return db[_0x4cb0('0x44')][_0x4cb0('0x46')](_0x3f1bf2);})[_0x4cb0('0x29')](function(_0x350be0){_0x1294ff[_0x4cb0('0x47')]=_0x350be0;return _0x1294ff;})['then'](respondWithFilteredResult(_0x5333c3,_0x3f1bf2))['catch'](handleError(_0x5333c3,null));};exports[_0x4cb0('0x48')]=function(_0x2aac43,_0xcee280){var _0x48b4d1={'raw':!![],'where':{'id':_0x2aac43[_0x4cb0('0x49')]['id']}},_0x5c0423={};_0x5c0423[_0x4cb0('0x33')]=_[_0x4cb0('0x35')](db[_0x4cb0('0x44')]['rawAttributes']);_0x5c0423[_0x4cb0('0x34')]=_[_0x4cb0('0x35')](_0x2aac43[_0x4cb0('0x34')]);_0x5c0423[_0x4cb0('0x36')]=_[_0x4cb0('0x38')](_0x5c0423[_0x4cb0('0x33')],_0x5c0423[_0x4cb0('0x34')]);_0x48b4d1['attributes']=_['intersection'](_0x5c0423[_0x4cb0('0x33')],qs[_0x4cb0('0x39')](_0x2aac43[_0x4cb0('0x34')]['fields']));_0x48b4d1[_0x4cb0('0x37')]=_0x48b4d1['attributes']['length']?_0x48b4d1['attributes']:_0x5c0423[_0x4cb0('0x33')];if(_0x2aac43[_0x4cb0('0x34')][_0x4cb0('0x45')]){_0x48b4d1[_0x4cb0('0x4a')]=[{'all':!![]}];}_0x48b4d1=_[_0x4cb0('0x42')]({},_0x48b4d1,_0x2aac43[_0x4cb0('0x43')]);return db['DeskField'][_0x4cb0('0x4b')](_0x48b4d1)[_0x4cb0('0x29')](handleEntityNotFound(_0xcee280,null))[_0x4cb0('0x29')](respondWithResult(_0xcee280,null))['catch'](handleError(_0xcee280,null));};exports[_0x4cb0('0x4c')]=function(_0x588b51,_0x35ba36){return db[_0x4cb0('0x44')]['create'](_0x588b51[_0x4cb0('0x4d')],{})[_0x4cb0('0x29')](respondWithResult(_0x35ba36,0xc9))[_0x4cb0('0x4e')](handleError(_0x35ba36,null));};exports[_0x4cb0('0x28')]=function(_0x1e9baa,_0x2c3ad9){if(_0x1e9baa['body']['id']){delete _0x1e9baa[_0x4cb0('0x4d')]['id'];}return db[_0x4cb0('0x44')]['find']({'where':{'id':_0x1e9baa[_0x4cb0('0x49')]['id']}})[_0x4cb0('0x29')](handleEntityNotFound(_0x2c3ad9,null))[_0x4cb0('0x29')](saveUpdates(_0x1e9baa[_0x4cb0('0x4d')],null))['then'](respondWithResult(_0x2c3ad9,null))['catch'](handleError(_0x2c3ad9,null));};exports[_0x4cb0('0x4f')]=function(_0x553522,_0x11da23){return db[_0x4cb0('0x44')][_0x4cb0('0x4b')]({'where':{'id':_0x553522['params']['id']}})[_0x4cb0('0x29')](handleEntityNotFound(_0x11da23,null))[_0x4cb0('0x29')](removeEntity(_0x11da23,null))[_0x4cb0('0x4e')](handleError(_0x11da23,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 03429b0..2b89ed2 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 _0x2e04=['moment','bluebird','request-promise','rimraf','./intDeskField.attributes','define','DeskField','desk_unique_index','idField','FieldId','util','api'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x2e04,0xca));var _0x42e0=function(_0x45f837,_0xbfd023){_0x45f837=_0x45f837-0x0;var _0x88652c=_0x2e04[_0x45f837];return _0x88652c;};'use strict';var _=require('lodash');var util=require(_0x42e0('0x0'));var logger=require('../../config/logger')(_0x42e0('0x1'));var moment=require(_0x42e0('0x2'));var BPromise=require(_0x42e0('0x3'));var rp=require(_0x42e0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x42e0('0x6'));module['exports']=function(_0x124641,_0x135753){return _0x124641[_0x42e0('0x7')](_0x42e0('0x8'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x42e0('0x9'),'fields':[_0x42e0('0xa'),_0x42e0('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe6a9=['define','DeskField','desk_unique_index','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x1886cd,_0x4f72c3){var _0x54fd0e=function(_0x26d528){while(--_0x26d528){_0x1886cd['push'](_0x1886cd['shift']());}};_0x54fd0e(++_0x4f72c3);}(_0xe6a9,0x122));var _0x9e6a=function(_0x2f27d1,_0x32caa6){_0x2f27d1=_0x2f27d1-0x0;var _0x55a830=_0xe6a9[_0x2f27d1];return _0x55a830;};'use strict';var _=require('lodash');var util=require(_0x9e6a('0x0'));var logger=require(_0x9e6a('0x1'))(_0x9e6a('0x2'));var moment=require(_0x9e6a('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e6a('0x4'));var fs=require('fs');var path=require(_0x9e6a('0x5'));var rimraf=require(_0x9e6a('0x6'));var config=require(_0x9e6a('0x7'));var attributes=require(_0x9e6a('0x8'));module['exports']=function(_0x4bd1f0,_0x1666e1){return _0x4bd1f0[_0x9e6a('0x9')](_0x9e6a('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x9e6a('0xb'),'fields':['idField',_0x9e6a('0xc')],'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 744417f..5e9a44d 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 _0x1145=['client','then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x6211d0,_0x159eaa){var _0x217ada=function(_0x5493e2){while(--_0x5493e2){_0x6211d0['push'](_0x6211d0['shift']());}};_0x217ada(++_0x159eaa);}(_0x1145,0xbf));var _0x5114=function(_0x123a18,_0x2fceea){_0x123a18=_0x123a18-0x0;var _0x333fc2=_0x1145[_0x123a18];return _0x333fc2;};'use strict';var _=require(_0x5114('0x0'));var util=require(_0x5114('0x1'));var moment=require(_0x5114('0x2'));var BPromise=require(_0x5114('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5114('0x4'));var db=require(_0x5114('0x5'))['db'];var utils=require(_0x5114('0x6'));var logger=require('../../config/logger')(_0x5114('0x7'));var config=require('../../config/environment');var jayson=require(_0x5114('0x8'));var client=jayson[_0x5114('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cefa5,_0x98021c,_0x272e67){return new BPromise(function(_0x1bf5e4,_0x3ffbda){return client['request'](_0x3cefa5,_0x272e67)[_0x5114('0xa')](function(_0x4c5543){logger['info'](_0x5114('0xb'),_0x98021c,_0x5114('0xc'));logger['debug'](_0x5114('0xd'),_0x98021c,'request\x20sent',JSON[_0x5114('0xe')](_0x4c5543));if(_0x4c5543[_0x5114('0xf')]){if(_0x4c5543[_0x5114('0xf')][_0x5114('0x10')]===0x1f4){logger[_0x5114('0xf')](_0x5114('0xb'),_0x98021c,_0x4c5543[_0x5114('0xf')]['message']);return _0x3ffbda(_0x4c5543[_0x5114('0xf')][_0x5114('0x11')]);}logger['error'](_0x5114('0xb'),_0x98021c,_0x4c5543['error'][_0x5114('0x11')]);return _0x1bf5e4(_0x4c5543[_0x5114('0xf')][_0x5114('0x11')]);}else{logger['info'](_0x5114('0xb'),_0x98021c,_0x5114('0xc'));_0x1bf5e4(_0x4c5543[_0x5114('0x12')][_0x5114('0x11')]);}})[_0x5114('0x13')](function(_0x348ce1){logger['error']('DeskField,\x20%s,\x20%s',_0x98021c,_0x348ce1);_0x3ffbda(_0x348ce1);});});} \ No newline at end of file +var _0x30f1=['rpc','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa04ffe,_0x40e010){var _0x324b57=function(_0x5817f4){while(--_0x5817f4){_0xa04ffe['push'](_0xa04ffe['shift']());}};_0x324b57(++_0x40e010);}(_0x30f1,0xf1));var _0x130f=function(_0x2dfbfc,_0x2c6670){_0x2dfbfc=_0x2dfbfc-0x0;var _0x104282=_0x30f1[_0x2dfbfc];return _0x104282;};'use strict';var _=require(_0x130f('0x0'));var util=require(_0x130f('0x1'));var moment=require(_0x130f('0x2'));var BPromise=require(_0x130f('0x3'));var rs=require(_0x130f('0x4'));var fs=require('fs');var Redis=require(_0x130f('0x5'));var db=require(_0x130f('0x6'))['db'];var utils=require(_0x130f('0x7'));var logger=require(_0x130f('0x8'))(_0x130f('0x9'));var config=require(_0x130f('0xa'));var jayson=require(_0x130f('0xb'));var client=jayson[_0x130f('0xc')][_0x130f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d1ae8,_0x4bcdc4,_0x46e680){return new BPromise(function(_0xe620b1,_0x433a80){return client[_0x130f('0xe')](_0x1d1ae8,_0x46e680)[_0x130f('0xf')](function(_0x6195a9){logger['info'](_0x130f('0x10'),_0x4bcdc4,_0x130f('0x11'));logger[_0x130f('0x12')](_0x130f('0x13'),_0x4bcdc4,_0x130f('0x11'),JSON[_0x130f('0x14')](_0x6195a9));if(_0x6195a9['error']){if(_0x6195a9[_0x130f('0x15')]['code']===0x1f4){logger[_0x130f('0x15')](_0x130f('0x10'),_0x4bcdc4,_0x6195a9['error'][_0x130f('0x16')]);return _0x433a80(_0x6195a9[_0x130f('0x15')][_0x130f('0x16')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x4bcdc4,_0x6195a9['error'][_0x130f('0x16')]);return _0xe620b1(_0x6195a9[_0x130f('0x15')][_0x130f('0x16')]);}else{logger['info'](_0x130f('0x10'),_0x4bcdc4,_0x130f('0x11'));_0xe620b1(_0x6195a9[_0x130f('0x17')]['message']);}})[_0x130f('0x18')](function(_0x28de98){logger['error'](_0x130f('0x10'),_0x4bcdc4,_0x28de98);_0x433a80(_0x28de98);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a21cc3f..ac12702 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 _0x14d7=['addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x4ab411,_0x1cb1ad){var _0x47959f=function(_0x40e04f){while(--_0x40e04f){_0x4ab411['push'](_0x4ab411['shift']());}};_0x47959f(++_0x1cb1ad);}(_0x14d7,0x164));var _0x714d=function(_0x3485f8,_0x1b66cf){_0x3485f8=_0x3485f8-0x0;var _0x1fbba7=_0x14d7[_0x3485f8];return _0x1fbba7;};'use strict';var multer=require(_0x714d('0x0'));var util=require(_0x714d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x714d('0x2'));var router=express[_0x714d('0x3')]();var fs_extra=require(_0x714d('0x4'));var auth=require(_0x714d('0x5'));var interaction=require(_0x714d('0x6'));var config=require(_0x714d('0x7'));var controller=require(_0x714d('0x8'));router[_0x714d('0x9')]('/',auth[_0x714d('0xa')](),controller['index']);router[_0x714d('0x9')](_0x714d('0xb'),auth['isAuthenticated'](),controller[_0x714d('0xc')]);router[_0x714d('0x9')](_0x714d('0xd'),auth['isAuthenticated'](),controller[_0x714d('0xe')]);router[_0x714d('0x9')](_0x714d('0xf'),auth[_0x714d('0xa')](),controller[_0x714d('0x10')]);router[_0x714d('0x11')]('/',auth[_0x714d('0xa')](),controller[_0x714d('0x12')]);router[_0x714d('0x11')](_0x714d('0xd'),auth[_0x714d('0xa')](),controller[_0x714d('0x13')]);router[_0x714d('0x14')](_0x714d('0xb'),auth[_0x714d('0xa')](),controller[_0x714d('0x15')]);router[_0x714d('0x16')](_0x714d('0xb'),auth[_0x714d('0xa')](),controller[_0x714d('0x17')]);module[_0x714d('0x18')]=router; \ No newline at end of file +var _0xaed8=['addConfiguration','put','/:id','update','delete','destroy','exports','multer','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create'];(function(_0x1d010b,_0x1fb422){var _0x5a8f08=function(_0x351ae6){while(--_0x351ae6){_0x1d010b['push'](_0x1d010b['shift']());}};_0x5a8f08(++_0x1fb422);}(_0xaed8,0xe3));var _0x8aed=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0xaed8[_0x421e36];return _0x20b3e3;};'use strict';var multer=require(_0x8aed('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8aed('0x1'));var router=express['Router']();var fs_extra=require(_0x8aed('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8aed('0x3'));var config=require(_0x8aed('0x4'));var controller=require(_0x8aed('0x5'));router[_0x8aed('0x6')]('/',auth[_0x8aed('0x7')](),controller['index']);router[_0x8aed('0x6')]('/:id',auth[_0x8aed('0x7')](),controller[_0x8aed('0x8')]);router['get'](_0x8aed('0x9'),auth[_0x8aed('0x7')](),controller['getConfigurations']);router['get'](_0x8aed('0xa'),auth[_0x8aed('0x7')](),controller[_0x8aed('0xb')]);router['post']('/',auth[_0x8aed('0x7')](),controller[_0x8aed('0xc')]);router['post'](_0x8aed('0x9'),auth[_0x8aed('0x7')](),controller[_0x8aed('0xd')]);router[_0x8aed('0xe')](_0x8aed('0xf'),auth[_0x8aed('0x7')](),controller[_0x8aed('0x10')]);router[_0x8aed('0x11')]('/:id',auth[_0x8aed('0x7')](),controller[_0x8aed('0x12')]);module[_0x8aed('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 70520ce..065b39b 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 _0x4989=['BOOLEAN','sequelize','STRING'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0x4989,0x79));var _0x9498=function(_0x5712cc,_0x5db7dd){_0x5712cc=_0x5712cc-0x0;var _0x15561a=_0x4989[_0x5712cc];return _0x15561a;};'use strict';var Sequelize=require(_0x9498('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9498('0x1')]},'password':{'type':Sequelize[_0x9498('0x1')]},'remoteUri':{'type':Sequelize[_0x9498('0x1')]},'tenantId':{'type':Sequelize[_0x9498('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9498('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x9498('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4300=['STRING','BOOLEAN','sequelize'];(function(_0x1be812,_0x2012ba){var _0x25e259=function(_0x2cd140){while(--_0x2cd140){_0x1be812['push'](_0x1be812['shift']());}};_0x25e259(++_0x2012ba);}(_0x4300,0x1a6));var _0x0430=function(_0x23c19c,_0x59a671){_0x23c19c=_0x23c19c-0x0;var _0x1de5a5=_0x4300[_0x23c19c];return _0x1de5a5;};'use strict';var Sequelize=require(_0x0430('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0430('0x1')]},'tenantId':{'type':Sequelize[_0x0430('0x1')]},'clientId':{'type':Sequelize[_0x0430('0x1')]},'clientSecret':{'type':Sequelize[_0x0430('0x1')]},'serverUrl':{'type':Sequelize[_0x0430('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x0430('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 6dace98..091710b 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 _0x0601=['getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','getFields','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','username','remoteUri','modernAuthentication','CloudProvider','data5','data7','access_token','POST','tenantId','clientId','password','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Account','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel'];(function(_0x22eb43,_0x7ddf72){var _0x159bc4=function(_0x570721){while(--_0x570721){_0x22eb43['push'](_0x22eb43['shift']());}};_0x159bc4(++_0x7ddf72);}(_0x0601,0x140));var _0x1060=function(_0x44ded7,_0x3ba04a){_0x44ded7=_0x44ded7-0x0;var _0xec38c6=_0x0601[_0x44ded7];return _0xec38c6;};'use strict';var rp=require('request-promise');var util=require(_0x1060('0x0'));var _=require('lodash');var qs=require(_0x1060('0x1'));var logger=require(_0x1060('0x2'))('api');var db=require(_0x1060('0x3'))['db'];var integrations=require(_0x1060('0x4'));function respondWithResult(_0x813daf,_0x25f840){_0x25f840=_0x25f840||0xc8;return function(_0x491b1d){if(_0x491b1d){return _0x813daf[_0x1060('0x5')](_0x25f840)[_0x1060('0x6')](_0x491b1d);}};}function respondWithFilteredResult(_0x854de8,_0x4678ef){return function(_0x317d1d){if(_0x317d1d){var _0x51ee24=typeof _0x4678ef[_0x1060('0x7')]===_0x1060('0x8')&&typeof _0x4678ef['limit']===_0x1060('0x8');var _0x412dfe=_0x317d1d[_0x1060('0x9')];var _0x740d28=_0x51ee24?0x0:_0x4678ef[_0x1060('0x7')];var _0x4f5813=_0x51ee24?_0x317d1d[_0x1060('0x9')]:_0x4678ef[_0x1060('0x7')]+_0x4678ef[_0x1060('0xa')];var _0x16bfcb;if(_0x4f5813>=_0x412dfe){_0x4f5813=_0x412dfe;_0x16bfcb=0xc8;}else{_0x16bfcb=0xce;}_0x854de8['status'](_0x16bfcb);return _0x854de8[_0x1060('0xb')](_0x1060('0xc'),_0x740d28+'-'+_0x4f5813+'/'+_0x412dfe)[_0x1060('0x6')](_0x317d1d);}return null;};}function saveUpdates(_0x305dc3){return function(_0x2d00b6){if(_0x2d00b6){return _0x2d00b6['update'](_0x305dc3)[_0x1060('0xd')](function(_0x305b1b){return _0x305b1b;});}return null;};}function removeEntity(_0x1ba003){return function(_0x306d1c){if(_0x306d1c){return _0x306d1c[_0x1060('0xe')]()['then'](function(){_0x1ba003[_0x1060('0x5')](0xcc)[_0x1060('0xf')]();});}};}function handleEntityNotFound(_0x2b77df){return function(_0x3a23c7){if(!_0x3a23c7){_0x2b77df[_0x1060('0x10')](0x194);}return _0x3a23c7;};}function handleError(_0x57e53c,_0x47a9ed){_0x47a9ed=_0x47a9ed||0x1f4;return function(_0x241e0f){logger[_0x1060('0x11')](_0x241e0f[_0x1060('0x12')]);if(_0x241e0f[_0x1060('0x13')]){delete _0x241e0f[_0x1060('0x13')];}_0x57e53c[_0x1060('0x5')](_0x47a9ed)[_0x1060('0x14')](_0x241e0f);};}exports['index']=function(_0x1e481e,_0x78d41f){var _0x55b016={},_0x1869fa={},_0x3de47b={'count':0x0,'rows':[]};var _0x237045=_[_0x1060('0x15')](db['Dynamics365Account'][_0x1060('0x16')],function(_0x18c46b){return{'name':_0x18c46b[_0x1060('0x17')],'type':_0x18c46b[_0x1060('0x18')]['key']};});_0x1869fa[_0x1060('0x19')]=_[_0x1060('0x15')](_0x237045,'name');_0x1869fa[_0x1060('0x1a')]=_['keys'](_0x1e481e[_0x1060('0x1a')]);_0x1869fa[_0x1060('0x1b')]=_[_0x1060('0x1c')](_0x1869fa['model'],_0x1869fa[_0x1060('0x1a')]);_0x55b016[_0x1060('0x1d')]=_[_0x1060('0x1c')](_0x1869fa[_0x1060('0x19')],qs['fields'](_0x1e481e[_0x1060('0x1a')]['fields']));_0x55b016['attributes']=_0x55b016[_0x1060('0x1d')][_0x1060('0x1e')]?_0x55b016[_0x1060('0x1d')]:_0x1869fa[_0x1060('0x19')];if(!_0x1e481e[_0x1060('0x1a')]['hasOwnProperty'](_0x1060('0x1f'))){_0x55b016['limit']=qs[_0x1060('0xa')](_0x1e481e['query']['limit']);_0x55b016[_0x1060('0x7')]=qs[_0x1060('0x7')](_0x1e481e['query']['offset']);}_0x55b016['order']=qs[_0x1060('0x20')](_0x1e481e[_0x1060('0x1a')][_0x1060('0x20')]);_0x55b016['where']=qs[_0x1060('0x1b')](_[_0x1060('0x21')](_0x1e481e['query'],_0x1869fa[_0x1060('0x1b')]),_0x237045);if(_0x1e481e['query'][_0x1060('0x22')]){_0x55b016[_0x1060('0x23')]=_[_0x1060('0x24')](_0x55b016['where'],{'$or':_[_0x1060('0x15')](_0x237045,function(_0x2f5049){if(_0x2f5049['type']!==_0x1060('0x25')){var _0x1df6bd={};_0x1df6bd[_0x2f5049[_0x1060('0x13')]]={'$like':'%'+_0x1e481e[_0x1060('0x1a')][_0x1060('0x22')]+'%'};return _0x1df6bd;}})});}_0x55b016=_['merge']({},_0x55b016,_0x1e481e[_0x1060('0x26')]);var _0x2ae300={'where':_0x55b016[_0x1060('0x23')]};return db[_0x1060('0x27')][_0x1060('0x9')](_0x2ae300)[_0x1060('0xd')](function(_0x324557){_0x3de47b[_0x1060('0x9')]=_0x324557;if(_0x1e481e['query']['includeAll']){_0x55b016[_0x1060('0x28')]=[{'all':!![]}];}return db[_0x1060('0x27')][_0x1060('0x29')](_0x55b016);})[_0x1060('0xd')](function(_0x48ea51){_0x3de47b[_0x1060('0x2a')]=_0x48ea51;return _0x3de47b;})['then'](respondWithFilteredResult(_0x78d41f,_0x55b016))[_0x1060('0x2b')](handleError(_0x78d41f,null));};exports[_0x1060('0x2c')]=function(_0x3d0667,_0x5bb4d2){var _0x33c1fc={'raw':![],'where':{'id':_0x3d0667[_0x1060('0x2d')]['id']}},_0xf3e903={};_0xf3e903[_0x1060('0x19')]=_[_0x1060('0x2e')](db[_0x1060('0x27')]['rawAttributes']);_0xf3e903[_0x1060('0x1a')]=_['keys'](_0x3d0667[_0x1060('0x1a')]);_0xf3e903[_0x1060('0x1b')]=_['intersection'](_0xf3e903[_0x1060('0x19')],_0xf3e903[_0x1060('0x1a')]);_0x33c1fc[_0x1060('0x1d')]=_[_0x1060('0x1c')](_0xf3e903[_0x1060('0x19')],qs[_0x1060('0x2f')](_0x3d0667[_0x1060('0x1a')]['fields']));_0x33c1fc[_0x1060('0x1d')]=_0x33c1fc[_0x1060('0x1d')][_0x1060('0x1e')]?_0x33c1fc[_0x1060('0x1d')]:_0xf3e903['model'];if(_0x3d0667[_0x1060('0x1a')][_0x1060('0x30')]){_0x33c1fc[_0x1060('0x28')]=[{'all':!![]}];}_0x33c1fc=_[_0x1060('0x24')]({},_0x33c1fc,_0x3d0667['options']);return db[_0x1060('0x27')][_0x1060('0x31')](_0x33c1fc)[_0x1060('0xd')](handleEntityNotFound(_0x5bb4d2,null))[_0x1060('0xd')](respondWithResult(_0x5bb4d2,null))[_0x1060('0x2b')](handleError(_0x5bb4d2,null));};exports['create']=function(_0x98a7e8,_0x11d8b2){return db['Dynamics365Account'][_0x1060('0x32')](_0x98a7e8[_0x1060('0x33')],{})[_0x1060('0xd')](respondWithResult(_0x11d8b2,0xc9))[_0x1060('0x2b')](handleError(_0x11d8b2,null));};exports['update']=function(_0x3244a6,_0x59e479){if(_0x3244a6[_0x1060('0x33')]['id']){delete _0x3244a6[_0x1060('0x33')]['id'];}return db[_0x1060('0x27')][_0x1060('0x31')]({'where':{'id':_0x3244a6[_0x1060('0x2d')]['id']}})['then'](handleEntityNotFound(_0x59e479,null))[_0x1060('0xd')](saveUpdates(_0x3244a6[_0x1060('0x33')],null))[_0x1060('0xd')](respondWithResult(_0x59e479,null))['catch'](handleError(_0x59e479,null));};exports[_0x1060('0xe')]=function(_0xcbf34d,_0x37e015){return db[_0x1060('0x27')][_0x1060('0x31')]({'where':{'id':_0xcbf34d[_0x1060('0x2d')]['id']}})['then'](handleEntityNotFound(_0x37e015,null))[_0x1060('0xd')](removeEntity(_0x37e015,null))[_0x1060('0x2b')](handleError(_0x37e015,null));};exports[_0x1060('0x34')]=function(_0x494261,_0x2a647a){var _0x3137d7={};var _0x586e0c={};var _0x1e4ea4;var _0x17c478;return db[_0x1060('0x27')][_0x1060('0x35')]({'where':{'id':_0x494261[_0x1060('0x2d')]['id']}})[_0x1060('0xd')](handleEntityNotFound(_0x2a647a,null))[_0x1060('0xd')](function(_0x44dc82){if(_0x44dc82){_0x1e4ea4=_0x44dc82;_0x586e0c[_0x1060('0x19')]=_[_0x1060('0x2e')](db[_0x1060('0x36')]['rawAttributes']);_0x586e0c[_0x1060('0x1a')]=_['keys'](_0x494261['query']);_0x586e0c['filters']=_[_0x1060('0x1c')](_0x586e0c[_0x1060('0x19')],_0x586e0c[_0x1060('0x1a')]);_0x3137d7['attributes']=_[_0x1060('0x1c')](_0x586e0c[_0x1060('0x19')],qs[_0x1060('0x2f')](_0x494261[_0x1060('0x1a')][_0x1060('0x2f')]));_0x3137d7[_0x1060('0x1d')]=_0x3137d7[_0x1060('0x1d')][_0x1060('0x1e')]?_0x3137d7[_0x1060('0x1d')]:_0x586e0c['model'];_0x3137d7['order']=qs[_0x1060('0x20')](_0x494261[_0x1060('0x1a')][_0x1060('0x20')]);_0x3137d7[_0x1060('0x23')]=qs[_0x1060('0x1b')](_['pick'](_0x494261[_0x1060('0x1a')],_0x586e0c[_0x1060('0x1b')]));if(_0x494261[_0x1060('0x1a')][_0x1060('0x22')]){_0x3137d7[_0x1060('0x23')]=_[_0x1060('0x24')](_0x3137d7[_0x1060('0x23')],{'$or':_[_0x1060('0x15')](_0x3137d7['attributes'],function(_0x1dab23){var _0x27e8a1={};_0x27e8a1[_0x1dab23]={'$like':'%'+_0x494261[_0x1060('0x1a')][_0x1060('0x22')]+'%'};return _0x27e8a1;})});}_0x3137d7=_[_0x1060('0x24')]({},_0x3137d7,_0x494261[_0x1060('0x26')]);return _0x1e4ea4[_0x1060('0x34')](_0x3137d7);}})[_0x1060('0xd')](function(_0x22648b){if(_0x22648b){_0x17c478=_0x22648b[_0x1060('0x1e')];if(!_0x494261[_0x1060('0x1a')]['hasOwnProperty'](_0x1060('0x1f'))){_0x3137d7[_0x1060('0xa')]=qs[_0x1060('0xa')](_0x494261[_0x1060('0x1a')][_0x1060('0xa')]);_0x3137d7[_0x1060('0x7')]=qs[_0x1060('0x7')](_0x494261['query'][_0x1060('0x7')]);}return _0x1e4ea4['getConfigurations'](_0x3137d7);}})['then'](function(_0x321273){if(_0x321273){return _0x321273?{'count':_0x17c478,'rows':_0x321273}:null;}})[_0x1060('0xd')](respondWithResult(_0x2a647a,null))['catch'](handleError(_0x2a647a,null));};exports[_0x1060('0x37')]=function(_0xbd3886,_0x5a6aaa){if(_0xbd3886[_0x1060('0x33')]['id']){delete _0xbd3886[_0x1060('0x33')]['id'];}return db[_0x1060('0x27')][_0x1060('0x35')]({'where':{'id':_0xbd3886[_0x1060('0x2d')]['id']}})[_0x1060('0xd')](handleEntityNotFound(_0x5a6aaa,null))[_0x1060('0xd')](function(_0x5d3436){if(_0x5d3436){_0xbd3886[_0x1060('0x33')][_0x1060('0x38')]=_0x5d3436['id'];_0xbd3886[_0x1060('0x33')][_0x1060('0x39')]=integrations[_0x1060('0x3a')](_0xbd3886[_0x1060('0x33')][_0x1060('0x3b')],_0xbd3886[_0x1060('0x33')][_0x1060('0x18')]);_0xbd3886[_0x1060('0x33')]['Descriptions']=integrations[_0x1060('0x3c')](_0xbd3886[_0x1060('0x33')][_0x1060('0x3b')],_0xbd3886['body'][_0x1060('0x18')]);return db[_0x1060('0x36')][_0x1060('0x32')](_0xbd3886['body'],{'include':[{'model':db[_0x1060('0x3d')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x1060('0x3e')}]});}return null;})[_0x1060('0xd')](respondWithResult(_0x5a6aaa,null))[_0x1060('0x2b')](handleError(_0x5a6aaa,null));};function sanitizeRemoteUri(_0x36a320){var _0x547a07=_0x36a320[_0x1060('0x3f')](-0x1);if(_0x547a07==='/')return _0x36a320[_0x1060('0x40')](0x0,_0x36a320[_0x1060('0x41')](_0x547a07));return _0x36a320;}function getWebApiUrl(_0x4cd75d){return util[_0x1060('0x42')]('%s/api/data/v9.0/',_0x4cd75d);}exports[_0x1060('0x43')]=function(_0x1da699,_0x5c4883){var _0x470fe5=_0x1da699[_0x1060('0x1a')]['ticketType'];var _0x4a1beb=_0x470fe5===_0x1060('0x44')?_0x1060('0x45'):_0x1060('0x46');var _0x1ddd82='';var _0x47dd00='';var _0x2f17c4='';var _0x28bc3d='';var _0x54a76e='';var _0x2ccbdc='';var _0x142072='';var _0x1a15fe='';var _0x284170=[_0x1060('0x47'),_0x1060('0x48'),'customerid',_0x1060('0x49'),_0x1060('0x4a'),_0x1060('0x4b'),_0x1060('0x4c'),_0x1060('0x4d'),_0x1060('0x4e'),_0x1060('0x4f')];var _0x581fff=['accountidname',_0x1060('0x50'),_0x1060('0x51'),_0x1060('0x52'),'contactidname','contactidyominame',_0x1060('0x53'),_0x1060('0x54'),_0x1060('0x55'),'createdbyexternalpartyyominame',_0x1060('0x56'),_0x1060('0x57'),_0x1060('0x58'),_0x1060('0x59'),'createdonbehalfbyyominame',_0x1060('0x5a'),_0x1060('0x5b'),_0x1060('0x5c'),_0x1060('0x5d'),_0x1060('0x5e'),'entityimage_timestamp',_0x1060('0x5f'),_0x1060('0x60'),_0x1060('0x61'),'firstresponsebykpiidname','followupby',_0x1060('0x62'),_0x1060('0x63'),_0x1060('0x64'),_0x1060('0x65'),_0x1060('0x66'),_0x1060('0x67'),_0x1060('0x68'),_0x1060('0x69'),_0x1060('0x6a'),_0x1060('0x6b'),_0x1060('0x6c'),_0x1060('0x6d'),_0x1060('0x6e'),_0x1060('0x6f'),_0x1060('0x70'),_0x1060('0x71'),_0x1060('0x72'),_0x1060('0x73'),_0x1060('0x74'),_0x1060('0x75'),_0x1060('0x76'),'primarycontactidname',_0x1060('0x77'),'prioritycodename',_0x1060('0x78'),_0x1060('0x79'),_0x1060('0x7a'),_0x1060('0x7b'),'responseby','responsiblecontactidname',_0x1060('0x7c'),'sentimentvalue',_0x1060('0x7d'),_0x1060('0x7e'),_0x1060('0x7f'),_0x1060('0x80'),_0x1060('0x81'),'subjectidname',_0x1060('0x82'),_0x1060('0x83'),'transactioncurrencyidname',_0x1060('0x84'),_0x1060('0x85'),_0x1060('0x86')];var _0x154664=_0x284170['concat'](_0x581fff);return db[_0x1060('0x27')]['findOne']({'where':{'id':_0x1da699[_0x1060('0x2d')]['id']},'attributes':['id',_0x1060('0x87'),'password',_0x1060('0x88'),'tenantId','clientId','clientSecret',_0x1060('0x89')],'include':[{'model':db['CloudProvider'],'as':_0x1060('0x8a'),'attributes':['id',_0x1060('0x8b'),_0x1060('0x8c')]}]})[_0x1060('0xd')](handleEntityNotFound(_0x5c4883,null))[_0x1060('0xd')](function(_0x399513){if(_0x399513){if(_0x399513[_0x1060('0x89')]){_0x399513[_0x1060('0x8d')]=_0x399513[_0x1060('0x8a')][_0x1060('0x8b')];_0x1a15fe=sanitizeRemoteUri(_0x399513[_0x1060('0x8a')][_0x1060('0x8c')]);_0x142072=getWebApiUrl(_0x1a15fe);return _0x399513;}_0x1a15fe=sanitizeRemoteUri(_0x399513[_0x1060('0x88')]);_0x142072=getWebApiUrl(_0x1a15fe);var _0x2b53f2={'method':_0x1060('0x8e'),'uri':'https://login.microsoftonline.com/'+_0x399513[_0x1060('0x8f')]+'/oauth2/token','form':{'client_id':_0x399513[_0x1060('0x90')],'resource':_0x1a15fe,'username':_0x399513['username'],'password':_0x399513[_0x1060('0x91')],'grant_type':_0x1060('0x91'),'client_secret':_0x399513[_0x1060('0x92')]},'json':!![]};return rp(_0x2b53f2);}})[_0x1060('0xd')](function(_0x19fba7){_0x2ccbdc=_0x19fba7['access_token'];var _0x257e78={'method':_0x1060('0x93'),'uri':encodeURI(_0x142072+_0x1060('0x94')+_0x4a1beb+'\x27'),'headers':{'Authorization':_0x1060('0x95')+_0x2ccbdc,'If-None-Match':null,'OData-Version':_0x1060('0x96')},'json':!![]};return rp(_0x257e78);})[_0x1060('0xd')](function(_0x14811b){var _0x58110b=_0x14811b['value'][0x0];var _0xd244bf=_0x58110b[_0x1060('0x97')];var _0x45c308={'method':_0x1060('0x93'),'uri':_0x142072+_0x1060('0x98')+_0xd244bf+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x1060('0x95')+_0x2ccbdc,'If-None-Match':null,'OData-Version':_0x1060('0x96')},'json':!![]};return rp(_0x45c308);})[_0x1060('0xd')](function(_0x591e71){_0x1ddd82=_0x591e71;_0x47dd00=_0x1ddd82[_0x1060('0x99')];_0x47dd00=_[_0x1060('0x9a')](_0x47dd00,function(_0x19f301){return!_0x154664[_0x1060('0x9b')](_0x19f301[_0x1060('0x9c')]);});var _0x2d2438=[];var _0x2daa74=[];_0x47dd00[_0x1060('0x9d')](function(_0x2da9a2){if(_0x2da9a2['@odata.type']){var _0x332e67=_0x2da9a2[_0x1060('0x9e')][_0x1060('0x40')](_0x2da9a2['@odata.type'][_0x1060('0x41')]('.')+0x1);if(_0x332e67===_0x1060('0x9f')){_0x2d2438['push'](getSelectList(_0x142072,_0x470fe5,_0x2daa74,_0x1ddd82[_0x1060('0x97')],_0x2da9a2['MetadataId'],_0x2ccbdc));}}});return Promise[_0x1060('0xa0')](_0x2d2438);})[_0x1060('0xd')](function(_0xdb1823){_0x2f17c4=_0xdb1823[0x0];var _0x50661f=[];var _0x328522=[];_0x47dd00[_0x1060('0x9d')](function(_0x4a80da){if(!_['isNil'](_0x4a80da[_0x1060('0x9e')])){var _0x461b2c=_0x4a80da['@odata.type']['substring'](_0x4a80da[_0x1060('0x9e')][_0x1060('0x41')]('.')+0x1);if(_0x461b2c===_0x1060('0xa1')){_0x50661f[_0x1060('0xa2')](getBooleanList(_0x142072,_0x470fe5,_0x328522,_0x1ddd82[_0x1060('0x97')],_0x4a80da[_0x1060('0x97')],_0x2ccbdc));}}});return Promise[_0x1060('0xa0')](_0x50661f);})[_0x1060('0xd')](function(_0x1741ae){_0x28bc3d=_0x1741ae[0x0];var _0x29c657=[];var _0x121e94=[];_0x47dd00[_0x1060('0x9d')](function(_0x4bcd37){if(_0x4bcd37[_0x1060('0x9e')]){var _0xe4117f=_0x4bcd37[_0x1060('0x9e')][_0x1060('0x40')](_0x4bcd37[_0x1060('0x9e')][_0x1060('0x41')]('.')+0x1);if(_0xe4117f===_0x1060('0xa3')||_0xe4117f==='DoubleAttributeMetadata'||_0xe4117f===_0x1060('0xa4')||_0xe4117f===_0x1060('0xa5')||_0xe4117f===_0x1060('0xa6')||_0xe4117f===_0x1060('0xa7')||_0xe4117f===_0x1060('0xa8')||_0xe4117f===_0x1060('0xa9')||_0xe4117f===_0x1060('0xaa')||_0xe4117f===_0x1060('0xab')){_0x29c657[_0x1060('0xa2')](getInputList(_0x142072,_0x470fe5,_0xe4117f,_0x121e94,_0x1ddd82[_0x1060('0x97')],_0x4bcd37['MetadataId'],_0x2ccbdc));}}});return Promise[_0x1060('0xa0')](_0x29c657);})[_0x1060('0xd')](function(_0x42a5a7){_0x54a76e=_0x42a5a7[0x0];var _0x1e356d=_0x2f17c4[_0x1060('0xac')](_0x28bc3d)[_0x1060('0xac')](_0x54a76e);var _0x3c297c={'count':_0x1e356d[_0x1060('0x1e')],'rows':_0x1e356d};return _0x3c297c;})[_0x1060('0xd')](respondWithResult(_0x5c4883,null))[_0x1060('0x2b')](function(_0x3171e5){var _0x531d6a=_0x1da699[_0x1060('0x1a')]['test']?0x1f4:_0x3171e5['statusCode']||0x1f4;logger[_0x1060('0x11')](_0x3171e5['stack']);delete _0x3171e5['name'];if(_0x531d6a===0x191){_0x531d6a=0x190;}_0x5c4883[_0x1060('0x5')](_0x531d6a)['send'](_0x1da699[_0x1060('0x1a')][_0x1060('0xad')]?{'message':_0x1060('0xae'),'statusCode':_0x3171e5['statusCode']}:_0x3171e5);});};function getSelectList(_0x58934b,_0x201719,_0x13d5e1,_0x3ab895,_0x1aa2cb,_0x1e161f){var _0x3791a0={'method':'GET','uri':_0x58934b+_0x1060('0x98')+_0x3ab895+_0x1060('0xaf')+_0x1aa2cb+_0x1060('0xb0')+_0x1060('0xb1'),'headers':{'Authorization':_0x1060('0x95')+_0x1e161f,'If-None-Match':null,'OData-Version':_0x1060('0x96')},'json':!![]};return rp(_0x3791a0)['then'](function(_0x4670d4){var _0x448a44=[];var _0x32be08=_0x4670d4[_0x1060('0xb2')][_0x1060('0xb3')];_0x32be08[_0x1060('0x9d')](function(_0x4366b8){_0x448a44[_0x1060('0xa2')]({'name':_0x4366b8['Label'][_0x1060('0xb4')][_0x1060('0xb5')],'value':String(_0x4366b8[_0x1060('0xb6')])});});var _0x43e9d7={'id':_0x201719+'_'+_0x4670d4[_0x1060('0x9c')],'name':_0x4670d4['DisplayName'][_0x1060('0xb4')][_0x1060('0xb5')],'custom':![],'options':_0x448a44};_0x13d5e1[_0x1060('0xa2')](_0x43e9d7);return _0x13d5e1;});}function getBooleanList(_0x505cc1,_0x36c057,_0x16d802,_0x4e4f44,_0x488dc5,_0x572f28){var _0x334bcb={'method':_0x1060('0x93'),'uri':_0x505cc1+_0x1060('0x98')+_0x4e4f44+_0x1060('0xaf')+_0x488dc5+_0x1060('0xb7'),'headers':{'Authorization':_0x1060('0x95')+_0x572f28,'If-None-Match':null,'OData-Version':_0x1060('0x96')},'json':!![]};return rp(_0x334bcb)[_0x1060('0xd')](function(_0x316b67){var _0x4533d7=[];_0x4533d7['push']({'name':_0x316b67[_0x1060('0xb2')]['TrueOption'][_0x1060('0xb5')][_0x1060('0xb4')]['Label'],'value':_0x1060('0xb8')},{'name':_0x316b67['OptionSet'][_0x1060('0xb9')][_0x1060('0xb5')][_0x1060('0xb4')][_0x1060('0xb5')],'value':_0x1060('0xba')});var _0x47283d={'id':_0x36c057+'_'+_0x316b67[_0x1060('0x9c')],'name':_0x316b67[_0x1060('0xbb')][_0x1060('0xb4')][_0x1060('0xb5')],'custom':![],'options':_0x4533d7};_0x16d802[_0x1060('0xa2')](_0x47283d);return _0x16d802;});}function getInputList(_0x54c8e3,_0x205bc3,_0x47d08d,_0x36257f,_0x50f8f4,_0x4ca00f,_0x2ae9dc){var _0x501eb9={'method':_0x1060('0x93'),'uri':_0x54c8e3+_0x1060('0x98')+_0x50f8f4+_0x1060('0xaf')+_0x4ca00f+_0x1060('0xbc')+_0x47d08d+_0x1060('0xbd'),'headers':{'Authorization':_0x1060('0x95')+_0x2ae9dc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x501eb9)[_0x1060('0xd')](function(_0x403b17){var _0x7c61bd={'id':_0x205bc3+'_'+_0x403b17['LogicalName'],'name':_0x403b17[_0x1060('0xbb')][_0x1060('0xb4')]?_0x403b17[_0x1060('0xbb')][_0x1060('0xb4')][_0x1060('0xb5')]:_0x403b17[_0x1060('0x9c')],'custom':![],'options':[]};_0x36257f[_0x1060('0xa2')](_0x7c61bd);return _0x36257f;});} \ No newline at end of file +var _0x025c=['incident','PhoneCall','description','customerid','ownerid','phonenumber','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','/oauth2/token','password','access_token','GET','Bearer\x20','4.0','MetadataId','EntityDefinitions(','Attributes','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','where','filter','merge','options','include','findAll','catch','show','params','Dynamics365Account','includeAll','find','create','body','getConfigurations','findOne','order','sort','pick','addConfiguration','AccountId','Subjects','getSubjects','Dynamics365Configuration','Dynamics365Field','Descriptions','slice','substring','format','%s/api/data/v9.0/','getFields','ticketType'];(function(_0x102215,_0x4dd67b){var _0x48f78f=function(_0x1374f6){while(--_0x1374f6){_0x102215['push'](_0x102215['shift']());}};_0x48f78f(++_0x4dd67b);}(_0x025c,0x128));var _0xc025=function(_0x8d47cd,_0x324320){_0x8d47cd=_0x8d47cd-0x0;var _0x28e6e1=_0x025c[_0x8d47cd];return _0x28e6e1;};'use strict';var rp=require(_0xc025('0x0'));var util=require(_0xc025('0x1'));var _=require(_0xc025('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xc025('0x3'))(_0xc025('0x4'));var db=require(_0xc025('0x5'))['db'];var integrations=require(_0xc025('0x6'));function respondWithResult(_0x2fa1ee,_0x5122f3){_0x5122f3=_0x5122f3||0xc8;return function(_0x110723){if(_0x110723){return _0x2fa1ee['status'](_0x5122f3)[_0xc025('0x7')](_0x110723);}};}function respondWithFilteredResult(_0x144396,_0x168c34){return function(_0x4af096){if(_0x4af096){var _0x343852=typeof _0x168c34[_0xc025('0x8')]===_0xc025('0x9')&&typeof _0x168c34[_0xc025('0xa')]===_0xc025('0x9');var _0x13d4ca=_0x4af096[_0xc025('0xb')];var _0x19ac89=_0x343852?0x0:_0x168c34[_0xc025('0x8')];var _0x2c7870=_0x343852?_0x4af096[_0xc025('0xb')]:_0x168c34[_0xc025('0x8')]+_0x168c34[_0xc025('0xa')];var _0x397080;if(_0x2c7870>=_0x13d4ca){_0x2c7870=_0x13d4ca;_0x397080=0xc8;}else{_0x397080=0xce;}_0x144396[_0xc025('0xc')](_0x397080);return _0x144396[_0xc025('0xd')](_0xc025('0xe'),_0x19ac89+'-'+_0x2c7870+'/'+_0x13d4ca)[_0xc025('0x7')](_0x4af096);}return null;};}function saveUpdates(_0x29cfa2){return function(_0xd54c49){if(_0xd54c49){return _0xd54c49[_0xc025('0xf')](_0x29cfa2)[_0xc025('0x10')](function(_0x13ef3f){return _0x13ef3f;});}return null;};}function removeEntity(_0x4e26b8){return function(_0x2d0348){if(_0x2d0348){return _0x2d0348[_0xc025('0x11')]()[_0xc025('0x10')](function(){_0x4e26b8[_0xc025('0xc')](0xcc)[_0xc025('0x12')]();});}};}function handleEntityNotFound(_0x46319e){return function(_0x5badc1){if(!_0x5badc1){_0x46319e[_0xc025('0x13')](0x194);}return _0x5badc1;};}function handleError(_0x860b05,_0x4737b7){_0x4737b7=_0x4737b7||0x1f4;return function(_0x155770){logger[_0xc025('0x14')](_0x155770[_0xc025('0x15')]);if(_0x155770['name']){delete _0x155770[_0xc025('0x16')];}_0x860b05['status'](_0x4737b7)['send'](_0x155770);};}exports[_0xc025('0x17')]=function(_0x383072,_0x2bfb32){var _0x3d9017={},_0x1cd830={},_0x3979f1={'count':0x0,'rows':[]};var _0x309284=_[_0xc025('0x18')](db['Dynamics365Account'][_0xc025('0x19')],function(_0x5704a3){return{'name':_0x5704a3[_0xc025('0x1a')],'type':_0x5704a3[_0xc025('0x1b')]['key']};});_0x1cd830['model']=_['map'](_0x309284,_0xc025('0x16'));_0x1cd830['query']=_[_0xc025('0x1c')](_0x383072['query']);_0x1cd830[_0xc025('0x1d')]=_[_0xc025('0x1e')](_0x1cd830[_0xc025('0x1f')],_0x1cd830[_0xc025('0x20')]);_0x3d9017['attributes']=_['intersection'](_0x1cd830[_0xc025('0x1f')],qs['fields'](_0x383072[_0xc025('0x20')][_0xc025('0x21')]));_0x3d9017[_0xc025('0x22')]=_0x3d9017['attributes'][_0xc025('0x23')]?_0x3d9017[_0xc025('0x22')]:_0x1cd830[_0xc025('0x1f')];if(!_0x383072[_0xc025('0x20')][_0xc025('0x24')](_0xc025('0x25'))){_0x3d9017[_0xc025('0xa')]=qs[_0xc025('0xa')](_0x383072['query'][_0xc025('0xa')]);_0x3d9017[_0xc025('0x8')]=qs[_0xc025('0x8')](_0x383072[_0xc025('0x20')][_0xc025('0x8')]);}_0x3d9017['order']=qs['sort'](_0x383072['query']['sort']);_0x3d9017[_0xc025('0x26')]=qs['filters'](_['pick'](_0x383072[_0xc025('0x20')],_0x1cd830['filters']),_0x309284);if(_0x383072[_0xc025('0x20')][_0xc025('0x27')]){_0x3d9017['where']=_[_0xc025('0x28')](_0x3d9017['where'],{'$or':_[_0xc025('0x18')](_0x309284,function(_0x1894c2){if(_0x1894c2[_0xc025('0x1b')]!=='VIRTUAL'){var _0x4d83cc={};_0x4d83cc[_0x1894c2[_0xc025('0x16')]]={'$like':'%'+_0x383072['query'][_0xc025('0x27')]+'%'};return _0x4d83cc;}})});}_0x3d9017=_[_0xc025('0x28')]({},_0x3d9017,_0x383072[_0xc025('0x29')]);var _0x2d8eb7={'where':_0x3d9017[_0xc025('0x26')]};return db['Dynamics365Account'][_0xc025('0xb')](_0x2d8eb7)['then'](function(_0x5814e7){_0x3979f1[_0xc025('0xb')]=_0x5814e7;if(_0x383072[_0xc025('0x20')]['includeAll']){_0x3d9017[_0xc025('0x2a')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xc025('0x2b')](_0x3d9017);})[_0xc025('0x10')](function(_0x7855f1){_0x3979f1['rows']=_0x7855f1;return _0x3979f1;})['then'](respondWithFilteredResult(_0x2bfb32,_0x3d9017))[_0xc025('0x2c')](handleError(_0x2bfb32,null));};exports[_0xc025('0x2d')]=function(_0x55f3fc,_0x4980fe){var _0x85a850={'raw':![],'where':{'id':_0x55f3fc[_0xc025('0x2e')]['id']}},_0x2d03c4={};_0x2d03c4[_0xc025('0x1f')]=_[_0xc025('0x1c')](db[_0xc025('0x2f')]['rawAttributes']);_0x2d03c4[_0xc025('0x20')]=_[_0xc025('0x1c')](_0x55f3fc[_0xc025('0x20')]);_0x2d03c4[_0xc025('0x1d')]=_[_0xc025('0x1e')](_0x2d03c4[_0xc025('0x1f')],_0x2d03c4[_0xc025('0x20')]);_0x85a850[_0xc025('0x22')]=_['intersection'](_0x2d03c4['model'],qs[_0xc025('0x21')](_0x55f3fc[_0xc025('0x20')][_0xc025('0x21')]));_0x85a850['attributes']=_0x85a850[_0xc025('0x22')][_0xc025('0x23')]?_0x85a850[_0xc025('0x22')]:_0x2d03c4[_0xc025('0x1f')];if(_0x55f3fc['query'][_0xc025('0x30')]){_0x85a850[_0xc025('0x2a')]=[{'all':!![]}];}_0x85a850=_['merge']({},_0x85a850,_0x55f3fc[_0xc025('0x29')]);return db[_0xc025('0x2f')][_0xc025('0x31')](_0x85a850)[_0xc025('0x10')](handleEntityNotFound(_0x4980fe,null))[_0xc025('0x10')](respondWithResult(_0x4980fe,null))[_0xc025('0x2c')](handleError(_0x4980fe,null));};exports['create']=function(_0x173d39,_0xc2e509){return db['Dynamics365Account'][_0xc025('0x32')](_0x173d39[_0xc025('0x33')],{})[_0xc025('0x10')](respondWithResult(_0xc2e509,0xc9))['catch'](handleError(_0xc2e509,null));};exports[_0xc025('0xf')]=function(_0x571432,_0x54c78c){if(_0x571432[_0xc025('0x33')]['id']){delete _0x571432[_0xc025('0x33')]['id'];}return db[_0xc025('0x2f')][_0xc025('0x31')]({'where':{'id':_0x571432[_0xc025('0x2e')]['id']}})['then'](handleEntityNotFound(_0x54c78c,null))['then'](saveUpdates(_0x571432['body'],null))[_0xc025('0x10')](respondWithResult(_0x54c78c,null))['catch'](handleError(_0x54c78c,null));};exports[_0xc025('0x11')]=function(_0x1cd3fe,_0x55e80f){return db[_0xc025('0x2f')]['find']({'where':{'id':_0x1cd3fe[_0xc025('0x2e')]['id']}})[_0xc025('0x10')](handleEntityNotFound(_0x55e80f,null))[_0xc025('0x10')](removeEntity(_0x55e80f,null))[_0xc025('0x2c')](handleError(_0x55e80f,null));};exports[_0xc025('0x34')]=function(_0x723013,_0x463c84){var _0x4645c0={};var _0x25cf7f={};var _0x18d421;var _0x2b393d;return db['Dynamics365Account'][_0xc025('0x35')]({'where':{'id':_0x723013[_0xc025('0x2e')]['id']}})[_0xc025('0x10')](handleEntityNotFound(_0x463c84,null))[_0xc025('0x10')](function(_0x26cbfa){if(_0x26cbfa){_0x18d421=_0x26cbfa;_0x25cf7f[_0xc025('0x1f')]=_[_0xc025('0x1c')](db['Dynamics365Configuration'][_0xc025('0x19')]);_0x25cf7f[_0xc025('0x20')]=_[_0xc025('0x1c')](_0x723013[_0xc025('0x20')]);_0x25cf7f[_0xc025('0x1d')]=_[_0xc025('0x1e')](_0x25cf7f[_0xc025('0x1f')],_0x25cf7f[_0xc025('0x20')]);_0x4645c0['attributes']=_[_0xc025('0x1e')](_0x25cf7f[_0xc025('0x1f')],qs[_0xc025('0x21')](_0x723013['query'][_0xc025('0x21')]));_0x4645c0[_0xc025('0x22')]=_0x4645c0[_0xc025('0x22')]['length']?_0x4645c0[_0xc025('0x22')]:_0x25cf7f[_0xc025('0x1f')];_0x4645c0[_0xc025('0x36')]=qs[_0xc025('0x37')](_0x723013['query']['sort']);_0x4645c0[_0xc025('0x26')]=qs[_0xc025('0x1d')](_[_0xc025('0x38')](_0x723013[_0xc025('0x20')],_0x25cf7f[_0xc025('0x1d')]));if(_0x723013[_0xc025('0x20')][_0xc025('0x27')]){_0x4645c0[_0xc025('0x26')]=_[_0xc025('0x28')](_0x4645c0[_0xc025('0x26')],{'$or':_[_0xc025('0x18')](_0x4645c0['attributes'],function(_0x504001){var _0x54444b={};_0x54444b[_0x504001]={'$like':'%'+_0x723013[_0xc025('0x20')][_0xc025('0x27')]+'%'};return _0x54444b;})});}_0x4645c0=_[_0xc025('0x28')]({},_0x4645c0,_0x723013[_0xc025('0x29')]);return _0x18d421[_0xc025('0x34')](_0x4645c0);}})[_0xc025('0x10')](function(_0x2f3086){if(_0x2f3086){_0x2b393d=_0x2f3086[_0xc025('0x23')];if(!_0x723013['query'][_0xc025('0x24')](_0xc025('0x25'))){_0x4645c0[_0xc025('0xa')]=qs['limit'](_0x723013['query'][_0xc025('0xa')]);_0x4645c0[_0xc025('0x8')]=qs[_0xc025('0x8')](_0x723013['query'][_0xc025('0x8')]);}return _0x18d421[_0xc025('0x34')](_0x4645c0);}})['then'](function(_0x5a216b){if(_0x5a216b){return _0x5a216b?{'count':_0x2b393d,'rows':_0x5a216b}:null;}})['then'](respondWithResult(_0x463c84,null))[_0xc025('0x2c')](handleError(_0x463c84,null));};exports[_0xc025('0x39')]=function(_0x3071c1,_0xe78b8a){if(_0x3071c1['body']['id']){delete _0x3071c1['body']['id'];}return db[_0xc025('0x2f')][_0xc025('0x35')]({'where':{'id':_0x3071c1[_0xc025('0x2e')]['id']}})[_0xc025('0x10')](handleEntityNotFound(_0xe78b8a,null))[_0xc025('0x10')](function(_0xdf02f3){if(_0xdf02f3){_0x3071c1[_0xc025('0x33')][_0xc025('0x3a')]=_0xdf02f3['id'];_0x3071c1[_0xc025('0x33')][_0xc025('0x3b')]=integrations[_0xc025('0x3c')](_0x3071c1['body']['channel'],_0x3071c1['body']['type']);_0x3071c1[_0xc025('0x33')]['Descriptions']=integrations['getDescriptions'](_0x3071c1['body']['channel'],_0x3071c1['body']['type']);return db[_0xc025('0x3d')][_0xc025('0x32')](_0x3071c1[_0xc025('0x33')],{'include':[{'model':db[_0xc025('0x3e')],'as':_0xc025('0x3b')},{'model':db[_0xc025('0x3e')],'as':_0xc025('0x3f')}]});}return null;})[_0xc025('0x10')](respondWithResult(_0xe78b8a,null))[_0xc025('0x2c')](handleError(_0xe78b8a,null));};function sanitizeRemoteUri(_0x58ef6c){var _0x550377=_0x58ef6c[_0xc025('0x40')](-0x1);if(_0x550377==='/')return _0x58ef6c[_0xc025('0x41')](0x0,_0x58ef6c['lastIndexOf'](_0x550377));return _0x58ef6c;}function getWebApiUrl(_0x4b2c13){return util[_0xc025('0x42')](_0xc025('0x43'),_0x4b2c13);}exports[_0xc025('0x44')]=function(_0x33f307,_0xda9ffc){var _0x2dd2d5=_0x33f307[_0xc025('0x20')][_0xc025('0x45')];var _0x32bd74=_0x2dd2d5===_0xc025('0x46')?'Incident':_0xc025('0x47');var _0x2ef72b='';var _0x326bdd='';var _0x217b91='';var _0x1f6338='';var _0x34630f='';var _0x34ce7c='';var _0x14f9d2='';var _0x56a381='';var _0x12e8da=['title',_0xc025('0x48'),_0xc025('0x49'),_0xc025('0x4a'),'caseorigincode','subject',_0xc025('0x4b'),'regardingobjectid','directioncode',_0xc025('0x4c')];var _0x45589f=[_0xc025('0x4d'),'accountidyominame','actualserviceunits',_0xc025('0x4e'),_0xc025('0x4f'),_0xc025('0x50'),_0xc025('0x51'),'contractidname',_0xc025('0x52'),_0xc025('0x53'),'createdbyname',_0xc025('0x54'),_0xc025('0x55'),_0xc025('0x56'),_0xc025('0x57'),'customeridname',_0xc025('0x58'),'customeridyominame',_0xc025('0x59'),_0xc025('0x5a'),_0xc025('0x5b'),_0xc025('0x5c'),_0xc025('0x5d'),_0xc025('0x5e'),_0xc025('0x5f'),_0xc025('0x60'),'importsequencenumber',_0xc025('0x61'),_0xc025('0x62'),_0xc025('0x63'),_0xc025('0x64'),_0xc025('0x65'),_0xc025('0x66'),_0xc025('0x67'),_0xc025('0x68'),'modifiedon',_0xc025('0x69'),_0xc025('0x6a'),_0xc025('0x6b'),'msdyn_iotalertname',_0xc025('0x6c'),_0xc025('0x6d'),_0xc025('0x6e'),_0xc025('0x6f'),_0xc025('0x70'),_0xc025('0x71'),'parentcaseidname',_0xc025('0x72'),_0xc025('0x73'),_0xc025('0x74'),'productidname',_0xc025('0x75'),_0xc025('0x76'),_0xc025('0x77'),'responseby',_0xc025('0x78'),'responsiblecontactidyominame',_0xc025('0x79'),'slainvokedidname',_0xc025('0x7a'),_0xc025('0x7b'),'statecode','statuscode',_0xc025('0x7c'),_0xc025('0x7d'),_0xc025('0x7e'),'transactioncurrencyidname',_0xc025('0x7f'),_0xc025('0x80'),_0xc025('0x81')];var _0x956114=_0x12e8da[_0xc025('0x82')](_0x45589f);return db[_0xc025('0x2f')][_0xc025('0x35')]({'where':{'id':_0x33f307['params']['id']},'attributes':['id',_0xc025('0x83'),'password',_0xc025('0x84'),_0xc025('0x85'),_0xc025('0x86'),_0xc025('0x87'),_0xc025('0x88')],'include':[{'model':db[_0xc025('0x89')],'as':_0xc025('0x89'),'attributes':['id',_0xc025('0x8a'),_0xc025('0x8b')]}]})[_0xc025('0x10')](handleEntityNotFound(_0xda9ffc,null))[_0xc025('0x10')](function(_0x359421){if(_0x359421){if(_0x359421[_0xc025('0x88')]){_0x359421['access_token']=_0x359421[_0xc025('0x89')]['data5'];_0x56a381=sanitizeRemoteUri(_0x359421[_0xc025('0x89')]['data7']);_0x14f9d2=getWebApiUrl(_0x56a381);return _0x359421;}_0x56a381=sanitizeRemoteUri(_0x359421[_0xc025('0x84')]);_0x14f9d2=getWebApiUrl(_0x56a381);var _0x589aa4={'method':_0xc025('0x8c'),'uri':'https://login.microsoftonline.com/'+_0x359421[_0xc025('0x85')]+_0xc025('0x8d'),'form':{'client_id':_0x359421['clientId'],'resource':_0x56a381,'username':_0x359421[_0xc025('0x83')],'password':_0x359421[_0xc025('0x8e')],'grant_type':_0xc025('0x8e'),'client_secret':_0x359421['clientSecret']},'json':!![]};return rp(_0x589aa4);}})[_0xc025('0x10')](function(_0x6eb2d1){_0x34ce7c=_0x6eb2d1[_0xc025('0x8f')];var _0x2f782f={'method':_0xc025('0x90'),'uri':encodeURI(_0x14f9d2+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x32bd74+'\x27'),'headers':{'Authorization':_0xc025('0x91')+_0x34ce7c,'If-None-Match':null,'OData-Version':_0xc025('0x92')},'json':!![]};return rp(_0x2f782f);})['then'](function(_0x35b264){var _0x522601=_0x35b264['value'][0x0];var _0x55f6e1=_0x522601[_0xc025('0x93')];var _0x22e672={'method':_0xc025('0x90'),'uri':_0x14f9d2+_0xc025('0x94')+_0x55f6e1+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x34ce7c,'If-None-Match':null,'OData-Version':_0xc025('0x92')},'json':!![]};return rp(_0x22e672);})[_0xc025('0x10')](function(_0x38e9d1){_0x2ef72b=_0x38e9d1;_0x326bdd=_0x2ef72b[_0xc025('0x95')];_0x326bdd=_['remove'](_0x326bdd,function(_0x4585d4){return!_0x956114[_0xc025('0x96')](_0x4585d4['LogicalName']);});var _0x31ac0f=[];var _0x4e01c5=[];_0x326bdd[_0xc025('0x97')](function(_0x50e144){if(_0x50e144['@odata.type']){var _0x1b0b29=_0x50e144[_0xc025('0x98')][_0xc025('0x41')](_0x50e144['@odata.type'][_0xc025('0x99')]('.')+0x1);if(_0x1b0b29===_0xc025('0x9a')){_0x31ac0f[_0xc025('0x9b')](getSelectList(_0x14f9d2,_0x2dd2d5,_0x4e01c5,_0x2ef72b[_0xc025('0x93')],_0x50e144[_0xc025('0x93')],_0x34ce7c));}}});return Promise['all'](_0x31ac0f);})[_0xc025('0x10')](function(_0x281428){_0x217b91=_0x281428[0x0];var _0x26934a=[];var _0x40a2a4=[];_0x326bdd[_0xc025('0x97')](function(_0x2bceb6){if(!_[_0xc025('0x9c')](_0x2bceb6[_0xc025('0x98')])){var _0x4556b2=_0x2bceb6[_0xc025('0x98')][_0xc025('0x41')](_0x2bceb6[_0xc025('0x98')][_0xc025('0x99')]('.')+0x1);if(_0x4556b2===_0xc025('0x9d')){_0x26934a[_0xc025('0x9b')](getBooleanList(_0x14f9d2,_0x2dd2d5,_0x40a2a4,_0x2ef72b[_0xc025('0x93')],_0x2bceb6[_0xc025('0x93')],_0x34ce7c));}}});return Promise['all'](_0x26934a);})[_0xc025('0x10')](function(_0x243d30){_0x1f6338=_0x243d30[0x0];var _0xecd9f7=[];var _0x53ed1d=[];_0x326bdd[_0xc025('0x97')](function(_0x2f47b4){if(_0x2f47b4['@odata.type']){var _0x274f28=_0x2f47b4[_0xc025('0x98')][_0xc025('0x41')](_0x2f47b4['@odata.type'][_0xc025('0x99')]('.')+0x1);if(_0x274f28==='StringAttributeMetadata'||_0x274f28===_0xc025('0x9e')||_0x274f28===_0xc025('0x9f')||_0x274f28===_0xc025('0xa0')||_0x274f28==='MemoAttributeMetadata'||_0x274f28===_0xc025('0xa1')||_0x274f28===_0xc025('0xa2')||_0x274f28===_0xc025('0xa3')||_0x274f28===_0xc025('0xa4')||_0x274f28===_0xc025('0xa5')){_0xecd9f7['push'](getInputList(_0x14f9d2,_0x2dd2d5,_0x274f28,_0x53ed1d,_0x2ef72b[_0xc025('0x93')],_0x2f47b4[_0xc025('0x93')],_0x34ce7c));}}});return Promise[_0xc025('0xa6')](_0xecd9f7);})['then'](function(_0x4c1168){_0x34630f=_0x4c1168[0x0];var _0x112552=_0x217b91[_0xc025('0x82')](_0x1f6338)[_0xc025('0x82')](_0x34630f);var _0x767db9={'count':_0x112552[_0xc025('0x23')],'rows':_0x112552};return _0x767db9;})['then'](respondWithResult(_0xda9ffc,null))[_0xc025('0x2c')](function(_0x501990){var _0x157e02=_0x33f307[_0xc025('0x20')][_0xc025('0xa7')]?0x1f4:_0x501990[_0xc025('0xa8')]||0x1f4;logger[_0xc025('0x14')](_0x501990['stack']);delete _0x501990[_0xc025('0x16')];if(_0x157e02===0x191){_0x157e02=0x190;}_0xda9ffc[_0xc025('0xc')](_0x157e02)['send'](_0x33f307['query'][_0xc025('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x501990[_0xc025('0xa8')]}:_0x501990);});};function getSelectList(_0x1c5375,_0x1995b5,_0x4f22d6,_0x47d9f0,_0x2164fc,_0x4f3bb0){var _0x1956c4={'method':_0xc025('0x90'),'uri':_0x1c5375+_0xc025('0x94')+_0x47d9f0+_0xc025('0xa9')+_0x2164fc+_0xc025('0xaa')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xc025('0x91')+_0x4f3bb0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1956c4)[_0xc025('0x10')](function(_0x28a21a){var _0x20708c=[];var _0x84b327=_0x28a21a[_0xc025('0xab')][_0xc025('0xac')];_0x84b327[_0xc025('0x97')](function(_0x48bc8d){_0x20708c[_0xc025('0x9b')]({'name':_0x48bc8d[_0xc025('0xad')][_0xc025('0xae')][_0xc025('0xad')],'value':String(_0x48bc8d['Value'])});});var _0x5bd3df={'id':_0x1995b5+'_'+_0x28a21a[_0xc025('0xaf')],'name':_0x28a21a[_0xc025('0xb0')][_0xc025('0xae')]['Label'],'custom':![],'options':_0x20708c};_0x4f22d6[_0xc025('0x9b')](_0x5bd3df);return _0x4f22d6;});}function getBooleanList(_0x3192ca,_0x2f1e21,_0x20f763,_0x5abbee,_0x29938a,_0x4f71de){var _0x1e8780={'method':'GET','uri':_0x3192ca+'EntityDefinitions('+_0x5abbee+_0xc025('0xa9')+_0x29938a+_0xc025('0xb1'),'headers':{'Authorization':_0xc025('0x91')+_0x4f71de,'If-None-Match':null,'OData-Version':_0xc025('0x92')},'json':!![]};return rp(_0x1e8780)[_0xc025('0x10')](function(_0x23e86d){var _0x1cb896=[];_0x1cb896[_0xc025('0x9b')]({'name':_0x23e86d[_0xc025('0xab')][_0xc025('0xb2')][_0xc025('0xad')]['UserLocalizedLabel'][_0xc025('0xad')],'value':_0xc025('0xb3')},{'name':_0x23e86d[_0xc025('0xab')][_0xc025('0xb4')][_0xc025('0xad')][_0xc025('0xae')]['Label'],'value':_0xc025('0xb5')});var _0x3ef45e={'id':_0x2f1e21+'_'+_0x23e86d['LogicalName'],'name':_0x23e86d[_0xc025('0xb0')]['UserLocalizedLabel'][_0xc025('0xad')],'custom':![],'options':_0x1cb896};_0x20f763[_0xc025('0x9b')](_0x3ef45e);return _0x20f763;});}function getInputList(_0x4e2696,_0x42fe39,_0x4ba755,_0x36c34e,_0x57426f,_0x5e975f,_0x524a35){var _0x158217={'method':_0xc025('0x90'),'uri':_0x4e2696+_0xc025('0x94')+_0x57426f+_0xc025('0xa9')+_0x5e975f+_0xc025('0xb6')+_0x4ba755+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x524a35,'If-None-Match':null,'OData-Version':_0xc025('0x92')},'json':!![]};return rp(_0x158217)['then'](function(_0x2694cd){var _0x515c9d={'id':_0x42fe39+'_'+_0x2694cd[_0xc025('0xaf')],'name':_0x2694cd[_0xc025('0xb0')][_0xc025('0xae')]?_0x2694cd[_0xc025('0xb0')][_0xc025('0xae')][_0xc025('0xad')]:_0x2694cd[_0xc025('0xaf')],'custom':![],'options':[]};_0x36c34e['push'](_0x515c9d);return _0x36c34e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 3c2948c..c6f2d07 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x2fc584,_0x1605e5){var _0x454d69=function(_0xb621cb){while(--_0xb621cb){_0x2fc584['push'](_0x2fc584['shift']());}};_0x454d69(++_0x1605e5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x6c32db,_0x184975){var _0x4f1808=function(_0x59b60d){while(--_0x59b60d){_0x6c32db['push'](_0x6c32db['shift']());}};_0x4f1808(++_0x184975);}(_0xe706,0xa3));var _0x6e70=function(_0x2904a8,_0x73180){_0x2904a8=_0x2904a8-0x0;var _0x4aae50=_0xe706[_0x2904a8];return _0x4aae50;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 16d5713..61adc92 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 _0x7948=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','include','map','model','catch','ShowDynamics365Account','lodash','util','randomstring'];(function(_0x2e64c0,_0x6fefb1){var _0x713ea8=function(_0x5c2b44){while(--_0x5c2b44){_0x2e64c0['push'](_0x2e64c0['shift']());}};_0x713ea8(++_0x6fefb1);}(_0x7948,0x1af));var _0x8794=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x7948[_0x15ea09];return _0x3e9c78;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8794('0x2'));var fs=require('fs');var Redis=require(_0x8794('0x3'));var db=require(_0x8794('0x4'))['db'];var utils=require(_0x8794('0x5'));var logger=require('../../config/logger')(_0x8794('0x6'));var config=require(_0x8794('0x7'));var jayson=require(_0x8794('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c945b,_0x3b5374,_0x5b170b){return new BPromise(function(_0x14705d,_0x26daba){return client['request'](_0x4c945b,_0x5b170b)[_0x8794('0x9')](function(_0x57c4cc){logger[_0x8794('0xa')](_0x8794('0xb'),_0x3b5374,_0x8794('0xc'));logger[_0x8794('0xd')](_0x8794('0xe'),_0x3b5374,'request\x20sent',JSON[_0x8794('0xf')](_0x57c4cc));if(_0x57c4cc[_0x8794('0x10')]){if(_0x57c4cc[_0x8794('0x10')]['code']===0x1f4){logger['error'](_0x8794('0xb'),_0x3b5374,_0x57c4cc[_0x8794('0x10')][_0x8794('0x11')]);return _0x26daba(_0x57c4cc['error'][_0x8794('0x11')]);}logger['error'](_0x8794('0xb'),_0x3b5374,_0x57c4cc[_0x8794('0x10')][_0x8794('0x11')]);return _0x14705d(_0x57c4cc[_0x8794('0x10')][_0x8794('0x11')]);}else{logger[_0x8794('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x3b5374,_0x8794('0xc'));_0x14705d(_0x57c4cc[_0x8794('0x12')][_0x8794('0x11')]);}})['catch'](function(_0x4c48d8){logger[_0x8794('0x10')](_0x8794('0xb'),_0x3b5374,_0x4c48d8);_0x26daba(_0x4c48d8);});});}exports[_0x8794('0x13')]=function(_0x395a2b){var _0x483cd7=this;return new Promise(function(_0x15b73a,_0x323663){return db[_0x8794('0x14')]['findAll']({'raw':_0x395a2b['options']?_0x395a2b[_0x8794('0x15')][_0x8794('0x16')]===undefined?!![]:![]:!![],'where':_0x395a2b[_0x8794('0x15')]?_0x395a2b['options'][_0x8794('0x17')]||null:null,'attributes':_0x395a2b[_0x8794('0x15')]?_0x395a2b[_0x8794('0x15')][_0x8794('0x18')]||null:null,'limit':_0x395a2b['options']?_0x395a2b[_0x8794('0x15')][_0x8794('0x19')]||null:null,'include':_0x395a2b[_0x8794('0x15')]?_0x395a2b[_0x8794('0x15')][_0x8794('0x1a')]?_[_0x8794('0x1b')](_0x395a2b['options'][_0x8794('0x1a')],function(_0x5f3bd6){return{'model':db[_0x5f3bd6[_0x8794('0x1c')]],'as':_0x5f3bd6['as'],'attributes':_0x5f3bd6['attributes'],'include':_0x5f3bd6[_0x8794('0x1a')]?_[_0x8794('0x1b')](_0x5f3bd6[_0x8794('0x1a')],function(_0x21086a){return{'model':db[_0x21086a[_0x8794('0x1c')]],'as':_0x21086a['as'],'attributes':_0x21086a['attributes'],'include':_0x21086a[_0x8794('0x1a')]?_[_0x8794('0x1b')](_0x21086a[_0x8794('0x1a')],function(_0x5158a){return{'model':db[_0x5158a[_0x8794('0x1c')]],'as':_0x5158a['as'],'attributes':_0x5158a[_0x8794('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8794('0x9')](function(_0x2c0226){logger[_0x8794('0xa')](_0x8794('0x13'),_0x395a2b);logger[_0x8794('0xd')]('GetDynamics365Account',_0x395a2b,JSON[_0x8794('0xf')](_0x2c0226));_0x15b73a(_0x2c0226);})[_0x8794('0x1d')](function(_0x42b583){logger[_0x8794('0x10')](_0x8794('0x13'),_0x42b583[_0x8794('0x11')],_0x395a2b);_0x323663(_0x483cd7[_0x8794('0x10')](0x1f4,_0x42b583[_0x8794('0x11')]));});});};exports[_0x8794('0x1e')]=function(_0x2ab1bd){var _0x22ab1a=this;return new Promise(function(_0x505fc0,_0xf564ce){return db[_0x8794('0x14')]['find']({'raw':_0x2ab1bd['options']?_0x2ab1bd['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ab1bd[_0x8794('0x15')]?_0x2ab1bd[_0x8794('0x15')]['where']||null:null,'attributes':_0x2ab1bd[_0x8794('0x15')]?_0x2ab1bd[_0x8794('0x15')][_0x8794('0x18')]||null:null,'include':_0x2ab1bd[_0x8794('0x15')]?_0x2ab1bd[_0x8794('0x15')]['include']?_[_0x8794('0x1b')](_0x2ab1bd[_0x8794('0x15')][_0x8794('0x1a')],function(_0x5af302){return{'model':db[_0x5af302[_0x8794('0x1c')]],'as':_0x5af302['as'],'attributes':_0x5af302[_0x8794('0x18')],'include':_0x5af302[_0x8794('0x1a')]?_[_0x8794('0x1b')](_0x5af302[_0x8794('0x1a')],function(_0x724bd){return{'model':db[_0x724bd[_0x8794('0x1c')]],'as':_0x724bd['as'],'attributes':_0x724bd[_0x8794('0x18')],'include':_0x724bd[_0x8794('0x1a')]?_[_0x8794('0x1b')](_0x724bd[_0x8794('0x1a')],function(_0x1b8003){return{'model':db[_0x1b8003[_0x8794('0x1c')]],'as':_0x1b8003['as'],'attributes':_0x1b8003[_0x8794('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8794('0x9')](function(_0x492765){logger['info']('ShowDynamics365Account',_0x2ab1bd);logger['debug']('ShowDynamics365Account',_0x2ab1bd,JSON['stringify'](_0x492765));_0x505fc0(_0x492765);})[_0x8794('0x1d')](function(_0x3938d9){logger[_0x8794('0x10')](_0x8794('0x1e'),_0x3938d9['message'],_0x2ab1bd);_0xf564ce(_0x22ab1a[_0x8794('0x10')](0x1f4,_0x3938d9['message']));});});}; \ No newline at end of file +var _0xec96=['stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','findAll','options','where','attributes','limit','include','map','model','info','ShowDynamics365Account','Dynamics365Account','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xec96,0x17d));var _0x6ec9=function(_0x9fae9a,_0x4d6c3e){_0x9fae9a=_0x9fae9a-0x0;var _0x56723e=_0xec96[_0x9fae9a];return _0x56723e;};'use strict';var _=require(_0x6ec9('0x0'));var util=require('util');var moment=require(_0x6ec9('0x1'));var BPromise=require(_0x6ec9('0x2'));var rs=require(_0x6ec9('0x3'));var fs=require('fs');var Redis=require(_0x6ec9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ec9('0x5'));var logger=require(_0x6ec9('0x6'))(_0x6ec9('0x7'));var config=require(_0x6ec9('0x8'));var jayson=require(_0x6ec9('0x9'));var client=jayson['client'][_0x6ec9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1da3dc,_0x29156a,_0x4ce087){return new BPromise(function(_0xb4a5bb,_0x3955f4){return client['request'](_0x1da3dc,_0x4ce087)[_0x6ec9('0xb')](function(_0x4bf895){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x29156a,'request\x20sent');logger[_0x6ec9('0xc')](_0x6ec9('0xd'),_0x29156a,_0x6ec9('0xe'),JSON[_0x6ec9('0xf')](_0x4bf895));if(_0x4bf895[_0x6ec9('0x10')]){if(_0x4bf895[_0x6ec9('0x10')][_0x6ec9('0x11')]===0x1f4){logger[_0x6ec9('0x10')](_0x6ec9('0x12'),_0x29156a,_0x4bf895[_0x6ec9('0x10')][_0x6ec9('0x13')]);return _0x3955f4(_0x4bf895['error'][_0x6ec9('0x13')]);}logger[_0x6ec9('0x10')](_0x6ec9('0x12'),_0x29156a,_0x4bf895[_0x6ec9('0x10')]['message']);return _0xb4a5bb(_0x4bf895[_0x6ec9('0x10')]['message']);}else{logger['info'](_0x6ec9('0x12'),_0x29156a,_0x6ec9('0xe'));_0xb4a5bb(_0x4bf895[_0x6ec9('0x14')][_0x6ec9('0x13')]);}})[_0x6ec9('0x15')](function(_0x3e697b){logger[_0x6ec9('0x10')](_0x6ec9('0x12'),_0x29156a,_0x3e697b);_0x3955f4(_0x3e697b);});});}exports[_0x6ec9('0x16')]=function(_0x17dffe){var _0x4f67bd=this;return new Promise(function(_0x4bb486,_0x27ac86){return db['Dynamics365Account'][_0x6ec9('0x17')]({'raw':_0x17dffe[_0x6ec9('0x18')]?_0x17dffe[_0x6ec9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x17dffe[_0x6ec9('0x18')]?_0x17dffe[_0x6ec9('0x18')][_0x6ec9('0x19')]||null:null,'attributes':_0x17dffe['options']?_0x17dffe[_0x6ec9('0x18')][_0x6ec9('0x1a')]||null:null,'limit':_0x17dffe[_0x6ec9('0x18')]?_0x17dffe[_0x6ec9('0x18')][_0x6ec9('0x1b')]||null:null,'include':_0x17dffe[_0x6ec9('0x18')]?_0x17dffe['options'][_0x6ec9('0x1c')]?_[_0x6ec9('0x1d')](_0x17dffe['options']['include'],function(_0x2234cf){return{'model':db[_0x2234cf[_0x6ec9('0x1e')]],'as':_0x2234cf['as'],'attributes':_0x2234cf[_0x6ec9('0x1a')],'include':_0x2234cf[_0x6ec9('0x1c')]?_[_0x6ec9('0x1d')](_0x2234cf['include'],function(_0x520006){return{'model':db[_0x520006[_0x6ec9('0x1e')]],'as':_0x520006['as'],'attributes':_0x520006['attributes'],'include':_0x520006[_0x6ec9('0x1c')]?_['map'](_0x520006['include'],function(_0x359c65){return{'model':db[_0x359c65[_0x6ec9('0x1e')]],'as':_0x359c65['as'],'attributes':_0x359c65[_0x6ec9('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x81ad05){logger[_0x6ec9('0x1f')]('GetDynamics365Account',_0x17dffe);logger['debug']('GetDynamics365Account',_0x17dffe,JSON['stringify'](_0x81ad05));_0x4bb486(_0x81ad05);})['catch'](function(_0x15519c){logger[_0x6ec9('0x10')]('GetDynamics365Account',_0x15519c[_0x6ec9('0x13')],_0x17dffe);_0x27ac86(_0x4f67bd[_0x6ec9('0x10')](0x1f4,_0x15519c['message']));});});};exports[_0x6ec9('0x20')]=function(_0x24293e){var _0x17cd83=this;return new Promise(function(_0x5d7db8,_0x6b2b8d){return db[_0x6ec9('0x21')][_0x6ec9('0x22')]({'raw':_0x24293e[_0x6ec9('0x18')]?_0x24293e[_0x6ec9('0x18')][_0x6ec9('0x23')]===undefined?!![]:![]:!![],'where':_0x24293e[_0x6ec9('0x18')]?_0x24293e['options']['where']||null:null,'attributes':_0x24293e['options']?_0x24293e[_0x6ec9('0x18')][_0x6ec9('0x1a')]||null:null,'include':_0x24293e[_0x6ec9('0x18')]?_0x24293e['options'][_0x6ec9('0x1c')]?_[_0x6ec9('0x1d')](_0x24293e['options'][_0x6ec9('0x1c')],function(_0x357e1c){return{'model':db[_0x357e1c[_0x6ec9('0x1e')]],'as':_0x357e1c['as'],'attributes':_0x357e1c[_0x6ec9('0x1a')],'include':_0x357e1c['include']?_[_0x6ec9('0x1d')](_0x357e1c[_0x6ec9('0x1c')],function(_0xb53963){return{'model':db[_0xb53963[_0x6ec9('0x1e')]],'as':_0xb53963['as'],'attributes':_0xb53963[_0x6ec9('0x1a')],'include':_0xb53963['include']?_[_0x6ec9('0x1d')](_0xb53963[_0x6ec9('0x1c')],function(_0x30cc45){return{'model':db[_0x30cc45[_0x6ec9('0x1e')]],'as':_0x30cc45['as'],'attributes':_0x30cc45['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ec9('0xb')](function(_0x1d12bd){logger[_0x6ec9('0x1f')](_0x6ec9('0x20'),_0x24293e);logger[_0x6ec9('0xc')](_0x6ec9('0x20'),_0x24293e,JSON[_0x6ec9('0xf')](_0x1d12bd));_0x5d7db8(_0x1d12bd);})[_0x6ec9('0x15')](function(_0x2ce18b){logger['error'](_0x6ec9('0x20'),_0x2ce18b[_0x6ec9('0x13')],_0x24293e);_0x6b2b8d(_0x17cd83[_0x6ec9('0x10')](0x1f4,_0x2ce18b[_0x6ec9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 69a787a..b94bd08 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 _0xaa10=['getFields','getSubjects','getDescriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xaa10,0x1ac));var _0x0aa1=function(_0x1a5644,_0x5b573b){_0x1a5644=_0x1a5644-0x0;var _0x510d62=_0xaa10[_0x1a5644];return _0x510d62;};'use strict';var multer=require(_0x0aa1('0x0'));var util=require(_0x0aa1('0x1'));var path=require(_0x0aa1('0x2'));var timeout=require(_0x0aa1('0x3'));var express=require(_0x0aa1('0x4'));var router=express['Router']();var fs_extra=require(_0x0aa1('0x5'));var auth=require(_0x0aa1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0aa1('0x7'));var controller=require(_0x0aa1('0x8'));router['get']('/',auth[_0x0aa1('0x9')](),controller[_0x0aa1('0xa')]);router[_0x0aa1('0xb')](_0x0aa1('0xc'),auth[_0x0aa1('0x9')](),controller['show']);router[_0x0aa1('0xb')]('/:id/fields',auth[_0x0aa1('0x9')](),controller[_0x0aa1('0xd')]);router[_0x0aa1('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x0aa1('0xe')]);router[_0x0aa1('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x0aa1('0xf')]);router[_0x0aa1('0x10')]('/',auth[_0x0aa1('0x9')](),controller[_0x0aa1('0x11')]);router['put'](_0x0aa1('0xc'),auth[_0x0aa1('0x9')](),controller[_0x0aa1('0x12')]);router[_0x0aa1('0x13')](_0x0aa1('0xc'),auth['isAuthenticated'](),controller[_0x0aa1('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8109=['../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x8109,0xa9));var _0x9810=function(_0x1b66f5,_0x52a6fa){_0x1b66f5=_0x1b66f5-0x0;var _0x11ebd3=_0x8109[_0x1b66f5];return _0x11ebd3;};'use strict';var multer=require(_0x9810('0x0'));var util=require('util');var path=require(_0x9810('0x1'));var timeout=require(_0x9810('0x2'));var express=require('express');var router=express[_0x9810('0x3')]();var fs_extra=require(_0x9810('0x4'));var auth=require(_0x9810('0x5'));var interaction=require(_0x9810('0x6'));var config=require(_0x9810('0x7'));var controller=require(_0x9810('0x8'));router[_0x9810('0x9')]('/',auth[_0x9810('0xa')](),controller[_0x9810('0xb')]);router[_0x9810('0x9')](_0x9810('0xc'),auth['isAuthenticated'](),controller[_0x9810('0xd')]);router[_0x9810('0x9')](_0x9810('0xe'),auth[_0x9810('0xa')](),controller[_0x9810('0xf')]);router['get'](_0x9810('0x10'),auth[_0x9810('0xa')](),controller[_0x9810('0x11')]);router['get'](_0x9810('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x9810('0x13')]('/',auth[_0x9810('0xa')](),controller[_0x9810('0x14')]);router[_0x9810('0x15')](_0x9810('0xc'),auth[_0x9810('0xa')](),controller['update']);router[_0x9810('0x16')](_0x9810('0xc'),auth[_0x9810('0xa')](),controller[_0x9810('0x17')]);module[_0x9810('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 6fa7960..a6c4508 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 _0x3319=['exports','STRING','ENUM','phonecall','incident','contact','nothing','BOOLEAN','sequelize'];(function(_0x5b1f1a,_0xa51314){var _0x2ef2d7=function(_0x1b829e){while(--_0x1b829e){_0x5b1f1a['push'](_0x5b1f1a['shift']());}};_0x2ef2d7(++_0xa51314);}(_0x3319,0xd7));var _0x9331=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x3319[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0x9331('0x0'));module[_0x9331('0x1')]={'name':{'type':Sequelize[_0x9331('0x2')]},'description':{'type':Sequelize[_0x9331('0x2')]},'ticketType':{'type':Sequelize[_0x9331('0x3')]('incident',_0x9331('0x4')),'defaultValue':_0x9331('0x5')},'moduleCreate':{'type':Sequelize[_0x9331('0x3')](_0x9331('0x6'),_0x9331('0x7')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9331('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x9331('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5ae4=['nothing','sequelize','exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x422b48,_0xf131fb){var _0x4a6f67=function(_0x13309e){while(--_0x13309e){_0x422b48['push'](_0x422b48['shift']());}};_0x4a6f67(++_0xf131fb);}(_0x5ae4,0x1a9));var _0x45ae=function(_0x57a86a,_0x35db0a){_0x57a86a=_0x57a86a-0x0;var _0x2ac44e=_0x5ae4[_0x57a86a];return _0x2ac44e;};'use strict';var Sequelize=require(_0x45ae('0x0'));module[_0x45ae('0x1')]={'name':{'type':Sequelize[_0x45ae('0x2')]},'description':{'type':Sequelize[_0x45ae('0x2')]},'ticketType':{'type':Sequelize[_0x45ae('0x3')](_0x45ae('0x4'),_0x45ae('0x5')),'defaultValue':_0x45ae('0x4')},'moduleCreate':{'type':Sequelize[_0x45ae('0x3')](_0x45ae('0x6'),_0x45ae('0x7')),'defaultValue':_0x45ae('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x45ae('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index be25c63..dcbe4e4 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 _0xb7d3=['util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','update','then','end','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','keys','fields','length','include','find','create','body','params','destroy','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird'];(function(_0x3496e0,_0x5dd5f8){var _0x5cb9e4=function(_0x42f0d7){while(--_0x42f0d7){_0x3496e0['push'](_0x3496e0['shift']());}};_0x5cb9e4(++_0x5dd5f8);}(_0xb7d3,0x9e));var _0x3b7d=function(_0x1d20ba,_0x5425bf){_0x1d20ba=_0x1d20ba-0x0;var _0x347f2a=_0xb7d3[_0x1d20ba];return _0x347f2a;};'use strict';var emlformat=require(_0x3b7d('0x0'));var rimraf=require(_0x3b7d('0x1'));var zipdir=require(_0x3b7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3b7d('0x3'));var Mustache=require('mustache');var util=require(_0x3b7d('0x4'));var path=require(_0x3b7d('0x5'));var sox=require(_0x3b7d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b7d('0x7'));var _=require(_0x3b7d('0x8'));var squel=require(_0x3b7d('0x9'));var crypto=require('crypto');var jsforce=require(_0x3b7d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3b7d('0xb'));var querystring=require(_0x3b7d('0xc'));var Papa=require(_0x3b7d('0xd'));var Redis=require(_0x3b7d('0xe'));var authService=require(_0x3b7d('0xf'));var qs=require(_0x3b7d('0x10'));var as=require(_0x3b7d('0x11'));var hardwareService=require(_0x3b7d('0x12'));var logger=require(_0x3b7d('0x13'))(_0x3b7d('0x14'));var utils=require(_0x3b7d('0x15'));var config=require(_0x3b7d('0x16'));var licenseUtil=require(_0x3b7d('0x17'));var db=require(_0x3b7d('0x18'))['db'];function respondWithStatusCode(_0x4200f3,_0x45edf5){_0x45edf5=_0x45edf5||0xcc;return function(_0x284922){if(_0x284922){return _0x4200f3[_0x3b7d('0x19')](_0x45edf5);}return _0x4200f3['status'](_0x45edf5)['end']();};}function respondWithResult(_0x57296c,_0x2982cb){_0x2982cb=_0x2982cb||0xc8;return function(_0x46cba4){if(_0x46cba4){return _0x57296c[_0x3b7d('0x1a')](_0x2982cb)[_0x3b7d('0x1b')](_0x46cba4);}};}function respondWithFilteredResult(_0x8db3d1,_0x1cd1ac){return function(_0xca50ad){if(_0xca50ad){var _0x8e8db1=typeof _0x1cd1ac['offset']===_0x3b7d('0x1c')&&typeof _0x1cd1ac[_0x3b7d('0x1d')]==='undefined';var _0x33d661=_0xca50ad[_0x3b7d('0x1e')];var _0x439a7b=_0x8e8db1?0x0:_0x1cd1ac[_0x3b7d('0x1f')];var _0x5591f3=_0x8e8db1?_0xca50ad[_0x3b7d('0x1e')]:_0x1cd1ac[_0x3b7d('0x1f')]+_0x1cd1ac[_0x3b7d('0x1d')];var _0x41b0d0;if(_0x5591f3>=_0x33d661){_0x5591f3=_0x33d661;_0x41b0d0=0xc8;}else{_0x41b0d0=0xce;}_0x8db3d1[_0x3b7d('0x1a')](_0x41b0d0);return _0x8db3d1['set'](_0x3b7d('0x20'),_0x439a7b+'-'+_0x5591f3+'/'+_0x33d661)[_0x3b7d('0x1b')](_0xca50ad);}return null;};}function patchUpdates(_0x558290){return function(_0x5bf99c){try{jsonpatch[_0x3b7d('0x21')](_0x5bf99c,_0x558290,!![]);}catch(_0x44c504){return BPromise['reject'](_0x44c504);}return _0x5bf99c['save']();};}function saveUpdates(_0x2af491,_0x91c9d0){return function(_0x8fb5ae){if(_0x8fb5ae){return _0x8fb5ae[_0x3b7d('0x22')](_0x2af491)['then'](function(_0x52e4af){return _0x52e4af;});}return null;};}function removeEntity(_0x5a8324,_0x3d9742){return function(_0x586272){if(_0x586272){return _0x586272['destroy']()[_0x3b7d('0x23')](function(){_0x5a8324[_0x3b7d('0x1a')](0xcc)[_0x3b7d('0x24')]();});}};}function handleEntityNotFound(_0x5d5e11,_0x8f4971){return function(_0x2784a7){if(!_0x2784a7){_0x5d5e11[_0x3b7d('0x19')](0x194);}return _0x2784a7;};}function handleError(_0xec6c92,_0x41145b){_0x41145b=_0x41145b||0x1f4;return function(_0x3cd9ef){logger[_0x3b7d('0x25')](_0x3cd9ef[_0x3b7d('0x26')]);if(_0x3cd9ef[_0x3b7d('0x27')]){delete _0x3cd9ef[_0x3b7d('0x27')];}_0xec6c92[_0x3b7d('0x1a')](_0x41145b)[_0x3b7d('0x28')](_0x3cd9ef);};}exports[_0x3b7d('0x29')]=function(_0x7ed826,_0x415b63){var _0x5c09cd={},_0x2b5289={},_0x3c9c99={'count':0x0,'rows':[]};var _0x50bfe9=_[_0x3b7d('0x2a')](db[_0x3b7d('0x2b')][_0x3b7d('0x2c')],function(_0x54fb05){return{'name':_0x54fb05[_0x3b7d('0x2d')],'type':_0x54fb05[_0x3b7d('0x2e')][_0x3b7d('0x2f')]};});_0x2b5289[_0x3b7d('0x30')]=_['map'](_0x50bfe9,_0x3b7d('0x27'));_0x2b5289[_0x3b7d('0x31')]=_['keys'](_0x7ed826[_0x3b7d('0x31')]);_0x2b5289[_0x3b7d('0x32')]=_[_0x3b7d('0x33')](_0x2b5289[_0x3b7d('0x30')],_0x2b5289[_0x3b7d('0x31')]);_0x5c09cd[_0x3b7d('0x34')]=_[_0x3b7d('0x33')](_0x2b5289['model'],qs['fields'](_0x7ed826[_0x3b7d('0x31')]['fields']));_0x5c09cd['attributes']=_0x5c09cd['attributes']['length']?_0x5c09cd['attributes']:_0x2b5289[_0x3b7d('0x30')];if(!_0x7ed826[_0x3b7d('0x31')]['hasOwnProperty'](_0x3b7d('0x35'))){_0x5c09cd['limit']=qs[_0x3b7d('0x1d')](_0x7ed826['query'][_0x3b7d('0x1d')]);_0x5c09cd[_0x3b7d('0x1f')]=qs['offset'](_0x7ed826['query'][_0x3b7d('0x1f')]);}_0x5c09cd[_0x3b7d('0x36')]=qs[_0x3b7d('0x37')](_0x7ed826[_0x3b7d('0x31')][_0x3b7d('0x37')]);_0x5c09cd[_0x3b7d('0x38')]=qs[_0x3b7d('0x32')](_[_0x3b7d('0x39')](_0x7ed826[_0x3b7d('0x31')],_0x2b5289[_0x3b7d('0x32')]),_0x50bfe9);if(_0x7ed826['query'][_0x3b7d('0x3a')]){_0x5c09cd['where']=_[_0x3b7d('0x3b')](_0x5c09cd[_0x3b7d('0x38')],{'$or':_['map'](_0x50bfe9,function(_0x40238c){if(_0x40238c[_0x3b7d('0x2e')]!==_0x3b7d('0x3c')){var _0x1ffffa={};_0x1ffffa[_0x40238c['name']]={'$like':'%'+_0x7ed826[_0x3b7d('0x31')][_0x3b7d('0x3a')]+'%'};return _0x1ffffa;}})});}_0x5c09cd=_[_0x3b7d('0x3b')]({},_0x5c09cd,_0x7ed826[_0x3b7d('0x3d')]);var _0x1b4f6c={'where':_0x5c09cd[_0x3b7d('0x38')]};return db['Dynamics365Configuration']['count'](_0x1b4f6c)[_0x3b7d('0x23')](function(_0xdfffe0){_0x3c9c99['count']=_0xdfffe0;if(_0x7ed826[_0x3b7d('0x31')][_0x3b7d('0x3e')]){_0x5c09cd['include']=[{'all':!![]}];}return db[_0x3b7d('0x2b')][_0x3b7d('0x3f')](_0x5c09cd);})['then'](function(_0x4c955a){_0x3c9c99['rows']=_0x4c955a;return _0x3c9c99;})[_0x3b7d('0x23')](respondWithFilteredResult(_0x415b63,_0x5c09cd))[_0x3b7d('0x40')](handleError(_0x415b63,null));};exports[_0x3b7d('0x41')]=function(_0x5c6dc5,_0x5af338){var _0x5c1b2b={'raw':![],'where':{'id':_0x5c6dc5['params']['id']}},_0x3baf9d={};_0x3baf9d[_0x3b7d('0x30')]=_[_0x3b7d('0x42')](db[_0x3b7d('0x2b')]['rawAttributes']);_0x3baf9d[_0x3b7d('0x31')]=_['keys'](_0x5c6dc5[_0x3b7d('0x31')]);_0x3baf9d[_0x3b7d('0x32')]=_[_0x3b7d('0x33')](_0x3baf9d[_0x3b7d('0x30')],_0x3baf9d[_0x3b7d('0x31')]);_0x5c1b2b[_0x3b7d('0x34')]=_[_0x3b7d('0x33')](_0x3baf9d['model'],qs[_0x3b7d('0x43')](_0x5c6dc5[_0x3b7d('0x31')][_0x3b7d('0x43')]));_0x5c1b2b['attributes']=_0x5c1b2b[_0x3b7d('0x34')][_0x3b7d('0x44')]?_0x5c1b2b[_0x3b7d('0x34')]:_0x3baf9d[_0x3b7d('0x30')];if(_0x5c6dc5[_0x3b7d('0x31')][_0x3b7d('0x3e')]){_0x5c1b2b[_0x3b7d('0x45')]=[{'all':!![]}];}_0x5c1b2b=_['merge']({},_0x5c1b2b,_0x5c6dc5[_0x3b7d('0x3d')]);return db[_0x3b7d('0x2b')][_0x3b7d('0x46')](_0x5c1b2b)[_0x3b7d('0x23')](handleEntityNotFound(_0x5af338,null))[_0x3b7d('0x23')](respondWithResult(_0x5af338,null))[_0x3b7d('0x40')](handleError(_0x5af338,null));};exports[_0x3b7d('0x47')]=function(_0x18e25e,_0x386761){return db[_0x3b7d('0x2b')]['create'](_0x18e25e['body'],{})[_0x3b7d('0x23')](respondWithResult(_0x386761,0xc9))[_0x3b7d('0x40')](handleError(_0x386761,null));};exports[_0x3b7d('0x22')]=function(_0x407427,_0x19f426){if(_0x407427[_0x3b7d('0x48')]['id']){delete _0x407427[_0x3b7d('0x48')]['id'];}return db[_0x3b7d('0x2b')][_0x3b7d('0x46')]({'where':{'id':_0x407427[_0x3b7d('0x49')]['id']}})[_0x3b7d('0x23')](handleEntityNotFound(_0x19f426,null))[_0x3b7d('0x23')](saveUpdates(_0x407427['body'],null))[_0x3b7d('0x23')](respondWithResult(_0x19f426,null))[_0x3b7d('0x40')](handleError(_0x19f426,null));};exports[_0x3b7d('0x4a')]=function(_0x22fa26,_0xae9dc9){return db[_0x3b7d('0x2b')][_0x3b7d('0x46')]({'where':{'id':_0x22fa26[_0x3b7d('0x49')]['id']}})['then'](handleEntityNotFound(_0xae9dc9,null))[_0x3b7d('0x23')](removeEntity(_0xae9dc9,null))[_0x3b7d('0x40')](handleError(_0xae9dc9,null));};exports[_0x3b7d('0x4b')]=function(_0x558ac4,_0x302104,_0x8d13e){var _0x5f3b68={};var _0x460bd7={};var _0x3a5f8b;var _0x476d57;return db['Dynamics365Configuration'][_0x3b7d('0x4c')]({'where':{'id':_0x558ac4['params']['id']}})['then'](handleEntityNotFound(_0x302104,null))[_0x3b7d('0x23')](function(_0x15db4b){if(_0x15db4b){_0x3a5f8b=_0x15db4b;_0x460bd7[_0x3b7d('0x30')]=_['keys'](db[_0x3b7d('0x4d')]['rawAttributes']);_0x460bd7[_0x3b7d('0x31')]=_[_0x3b7d('0x42')](_0x558ac4['query']);_0x460bd7['filters']=_[_0x3b7d('0x33')](_0x460bd7['model'],_0x460bd7['query']);_0x5f3b68[_0x3b7d('0x34')]=_['intersection'](_0x460bd7[_0x3b7d('0x30')],qs[_0x3b7d('0x43')](_0x558ac4['query'][_0x3b7d('0x43')]));_0x5f3b68[_0x3b7d('0x34')]=_0x5f3b68[_0x3b7d('0x34')][_0x3b7d('0x44')]?_0x5f3b68[_0x3b7d('0x34')]:_0x460bd7[_0x3b7d('0x30')];_0x5f3b68['order']=qs[_0x3b7d('0x37')](_0x558ac4['query'][_0x3b7d('0x37')]);_0x5f3b68['where']=qs[_0x3b7d('0x32')](_['pick'](_0x558ac4[_0x3b7d('0x31')],_0x460bd7[_0x3b7d('0x32')]));if(_0x558ac4[_0x3b7d('0x31')][_0x3b7d('0x3a')]){_0x5f3b68['where']=_[_0x3b7d('0x3b')](_0x5f3b68[_0x3b7d('0x38')],{'$or':_[_0x3b7d('0x2a')](_0x5f3b68[_0x3b7d('0x34')],function(_0x442456){var _0x4cf928={};_0x4cf928[_0x442456]={'$like':'%'+_0x558ac4[_0x3b7d('0x31')][_0x3b7d('0x3a')]+'%'};return _0x4cf928;})});}_0x5f3b68=_[_0x3b7d('0x3b')]({},_0x5f3b68,_0x558ac4[_0x3b7d('0x3d')]);return _0x3a5f8b[_0x3b7d('0x4b')](_0x5f3b68);}})['then'](function(_0x1e3e16){if(_0x1e3e16){_0x476d57=_0x1e3e16[_0x3b7d('0x44')];if(!_0x558ac4[_0x3b7d('0x31')]['hasOwnProperty']('nolimit')){_0x5f3b68[_0x3b7d('0x1d')]=qs[_0x3b7d('0x1d')](_0x558ac4['query'][_0x3b7d('0x1d')]);_0x5f3b68[_0x3b7d('0x1f')]=qs[_0x3b7d('0x1f')](_0x558ac4[_0x3b7d('0x31')]['offset']);}return _0x3a5f8b[_0x3b7d('0x4b')](_0x5f3b68);}})[_0x3b7d('0x23')](function(_0x30c3f4){if(_0x30c3f4){return _0x30c3f4?{'count':_0x476d57,'rows':_0x30c3f4}:null;}})[_0x3b7d('0x23')](respondWithResult(_0x302104,null))[_0x3b7d('0x40')](handleError(_0x302104,null));};exports['getSubjects']=function(_0x15f751,_0x2395b7,_0x5740de){var _0x2ed37f={};var _0x4f60e3={};var _0x5967f5;var _0x794e3f;return db[_0x3b7d('0x2b')]['findOne']({'where':{'id':_0x15f751[_0x3b7d('0x49')]['id']}})[_0x3b7d('0x23')](handleEntityNotFound(_0x2395b7,null))[_0x3b7d('0x23')](function(_0x449ed8){if(_0x449ed8){_0x5967f5=_0x449ed8;_0x4f60e3['model']=_[_0x3b7d('0x42')](db['Dynamics365Field'][_0x3b7d('0x2c')]);_0x4f60e3[_0x3b7d('0x31')]=_[_0x3b7d('0x42')](_0x15f751[_0x3b7d('0x31')]);_0x4f60e3[_0x3b7d('0x32')]=_[_0x3b7d('0x33')](_0x4f60e3[_0x3b7d('0x30')],_0x4f60e3['query']);_0x2ed37f[_0x3b7d('0x34')]=_[_0x3b7d('0x33')](_0x4f60e3[_0x3b7d('0x30')],qs[_0x3b7d('0x43')](_0x15f751[_0x3b7d('0x31')][_0x3b7d('0x43')]));_0x2ed37f[_0x3b7d('0x34')]=_0x2ed37f[_0x3b7d('0x34')][_0x3b7d('0x44')]?_0x2ed37f['attributes']:_0x4f60e3['model'];_0x2ed37f['order']=qs[_0x3b7d('0x37')](_0x15f751['query']['sort']);_0x2ed37f[_0x3b7d('0x38')]=qs[_0x3b7d('0x32')](_[_0x3b7d('0x39')](_0x15f751[_0x3b7d('0x31')],_0x4f60e3[_0x3b7d('0x32')]));if(_0x15f751[_0x3b7d('0x31')]['filter']){_0x2ed37f[_0x3b7d('0x38')]=_[_0x3b7d('0x3b')](_0x2ed37f[_0x3b7d('0x38')],{'$or':_[_0x3b7d('0x2a')](_0x2ed37f[_0x3b7d('0x34')],function(_0x1d82aa){var _0x185b83={};_0x185b83[_0x1d82aa]={'$like':'%'+_0x15f751[_0x3b7d('0x31')]['filter']+'%'};return _0x185b83;})});}_0x2ed37f=_['merge']({},_0x2ed37f,_0x15f751[_0x3b7d('0x3d')]);return _0x5967f5['getSubjects'](_0x2ed37f);}})[_0x3b7d('0x23')](function(_0x64a255){if(_0x64a255){_0x794e3f=_0x64a255['length'];if(!_0x15f751[_0x3b7d('0x31')][_0x3b7d('0x4e')](_0x3b7d('0x35'))){_0x2ed37f[_0x3b7d('0x1d')]=qs['limit'](_0x15f751[_0x3b7d('0x31')][_0x3b7d('0x1d')]);_0x2ed37f[_0x3b7d('0x1f')]=qs[_0x3b7d('0x1f')](_0x15f751[_0x3b7d('0x31')][_0x3b7d('0x1f')]);}return _0x5967f5[_0x3b7d('0x4f')](_0x2ed37f);}})[_0x3b7d('0x23')](function(_0x4612e9){if(_0x4612e9){return _0x4612e9?{'count':_0x794e3f,'rows':_0x4612e9}:null;}})[_0x3b7d('0x23')](respondWithResult(_0x2395b7,null))[_0x3b7d('0x40')](handleError(_0x2395b7,null));};exports[_0x3b7d('0x50')]=function(_0x550530,_0x2806dd,_0x8cc1d3){var _0x2dc6ee={};var _0x2f84eb={};var _0x298c2a;var _0x4a2a40;return db[_0x3b7d('0x2b')]['findOne']({'where':{'id':_0x550530[_0x3b7d('0x49')]['id']}})[_0x3b7d('0x23')](handleEntityNotFound(_0x2806dd,null))['then'](function(_0x4bfe66){if(_0x4bfe66){_0x298c2a=_0x4bfe66;_0x2f84eb[_0x3b7d('0x30')]=_['keys'](db[_0x3b7d('0x4d')][_0x3b7d('0x2c')]);_0x2f84eb[_0x3b7d('0x31')]=_[_0x3b7d('0x42')](_0x550530[_0x3b7d('0x31')]);_0x2f84eb['filters']=_[_0x3b7d('0x33')](_0x2f84eb[_0x3b7d('0x30')],_0x2f84eb[_0x3b7d('0x31')]);_0x2dc6ee[_0x3b7d('0x34')]=_['intersection'](_0x2f84eb['model'],qs[_0x3b7d('0x43')](_0x550530[_0x3b7d('0x31')][_0x3b7d('0x43')]));_0x2dc6ee[_0x3b7d('0x34')]=_0x2dc6ee['attributes'][_0x3b7d('0x44')]?_0x2dc6ee[_0x3b7d('0x34')]:_0x2f84eb[_0x3b7d('0x30')];_0x2dc6ee['order']=qs['sort'](_0x550530['query']['sort']);_0x2dc6ee['where']=qs[_0x3b7d('0x32')](_[_0x3b7d('0x39')](_0x550530['query'],_0x2f84eb['filters']));if(_0x550530[_0x3b7d('0x31')][_0x3b7d('0x3a')]){_0x2dc6ee[_0x3b7d('0x38')]=_[_0x3b7d('0x3b')](_0x2dc6ee[_0x3b7d('0x38')],{'$or':_[_0x3b7d('0x2a')](_0x2dc6ee[_0x3b7d('0x34')],function(_0x1069d2){var _0x13a97e={};_0x13a97e[_0x1069d2]={'$like':'%'+_0x550530['query'][_0x3b7d('0x3a')]+'%'};return _0x13a97e;})});}_0x2dc6ee=_[_0x3b7d('0x3b')]({},_0x2dc6ee,_0x550530[_0x3b7d('0x3d')]);return _0x298c2a['getDescriptions'](_0x2dc6ee);}})['then'](function(_0x13ee6b){if(_0x13ee6b){_0x4a2a40=_0x13ee6b[_0x3b7d('0x44')];if(!_0x550530[_0x3b7d('0x31')]['hasOwnProperty'](_0x3b7d('0x35'))){_0x2dc6ee['limit']=qs[_0x3b7d('0x1d')](_0x550530['query'][_0x3b7d('0x1d')]);_0x2dc6ee['offset']=qs['offset'](_0x550530[_0x3b7d('0x31')][_0x3b7d('0x1f')]);}return _0x298c2a[_0x3b7d('0x50')](_0x2dc6ee);}})[_0x3b7d('0x23')](function(_0x161031){if(_0x161031){return _0x161031?{'count':_0x4a2a40,'rows':_0x161031}:null;}})['then'](respondWithResult(_0x2806dd,null))[_0x3b7d('0x40')](handleError(_0x2806dd,null));}; \ No newline at end of file +var _0x1e4e=['VIRTUAL','name','filter','merge','options','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','destroy','getFields','Dynamics365Field','order','getSubjects','hasOwnProperty','nolimit','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','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','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','send','type','key','map','query','filters','intersection','model','attributes','fields','length','sort','pick','where'];(function(_0x34edd4,_0xeb47c5){var _0x4109dd=function(_0x3056f6){while(--_0x3056f6){_0x34edd4['push'](_0x34edd4['shift']());}};_0x4109dd(++_0xeb47c5);}(_0x1e4e,0x162));var _0xe1e4=function(_0x80b98c,_0x47c535){_0x80b98c=_0x80b98c-0x0;var _0x2e13ea=_0x1e4e[_0x80b98c];return _0x2e13ea;};'use strict';var emlformat=require(_0xe1e4('0x0'));var rimraf=require(_0xe1e4('0x1'));var zipdir=require(_0xe1e4('0x2'));var jsonpatch=require(_0xe1e4('0x3'));var rp=require(_0xe1e4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe1e4('0x5'));var util=require(_0xe1e4('0x6'));var path=require(_0xe1e4('0x7'));var sox=require(_0xe1e4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe1e4('0x9'));var crypto=require(_0xe1e4('0xa'));var jsforce=require(_0xe1e4('0xb'));var deskjs=require(_0xe1e4('0xc'));var toCsv=require(_0xe1e4('0xd'));var querystring=require(_0xe1e4('0xe'));var Papa=require(_0xe1e4('0xf'));var Redis=require(_0xe1e4('0x10'));var authService=require(_0xe1e4('0x11'));var qs=require(_0xe1e4('0x12'));var as=require(_0xe1e4('0x13'));var hardwareService=require(_0xe1e4('0x14'));var logger=require('../../config/logger')(_0xe1e4('0x15'));var utils=require(_0xe1e4('0x16'));var config=require(_0xe1e4('0x17'));var licenseUtil=require(_0xe1e4('0x18'));var db=require(_0xe1e4('0x19'))['db'];function respondWithStatusCode(_0x14bfdc,_0x20936f){_0x20936f=_0x20936f||0xcc;return function(_0x554d1f){if(_0x554d1f){return _0x14bfdc[_0xe1e4('0x1a')](_0x20936f);}return _0x14bfdc[_0xe1e4('0x1b')](_0x20936f)[_0xe1e4('0x1c')]();};}function respondWithResult(_0xe3d93d,_0x3bd381){_0x3bd381=_0x3bd381||0xc8;return function(_0x2b5ac7){if(_0x2b5ac7){return _0xe3d93d['status'](_0x3bd381)[_0xe1e4('0x1d')](_0x2b5ac7);}};}function respondWithFilteredResult(_0x306dd2,_0x1fee81){return function(_0x317497){if(_0x317497){var _0x4cfba4=typeof _0x1fee81[_0xe1e4('0x1e')]===_0xe1e4('0x1f')&&typeof _0x1fee81[_0xe1e4('0x20')]===_0xe1e4('0x1f');var _0x1398c2=_0x317497['count'];var _0x226730=_0x4cfba4?0x0:_0x1fee81[_0xe1e4('0x1e')];var _0x229ee5=_0x4cfba4?_0x317497[_0xe1e4('0x21')]:_0x1fee81[_0xe1e4('0x1e')]+_0x1fee81[_0xe1e4('0x20')];var _0x5b2708;if(_0x229ee5>=_0x1398c2){_0x229ee5=_0x1398c2;_0x5b2708=0xc8;}else{_0x5b2708=0xce;}_0x306dd2[_0xe1e4('0x1b')](_0x5b2708);return _0x306dd2[_0xe1e4('0x22')](_0xe1e4('0x23'),_0x226730+'-'+_0x229ee5+'/'+_0x1398c2)[_0xe1e4('0x1d')](_0x317497);}return null;};}function patchUpdates(_0x5b37a1){return function(_0x501112){try{jsonpatch[_0xe1e4('0x24')](_0x501112,_0x5b37a1,!![]);}catch(_0x597968){return BPromise[_0xe1e4('0x25')](_0x597968);}return _0x501112['save']();};}function saveUpdates(_0x357eff,_0x5d5476){return function(_0x52a748){if(_0x52a748){return _0x52a748[_0xe1e4('0x26')](_0x357eff)['then'](function(_0x15e869){return _0x15e869;});}return null;};}function removeEntity(_0x617c,_0x979fbd){return function(_0x538543){if(_0x538543){return _0x538543['destroy']()[_0xe1e4('0x27')](function(){_0x617c[_0xe1e4('0x1b')](0xcc)[_0xe1e4('0x1c')]();});}};}function handleEntityNotFound(_0x2c30d1,_0x589906){return function(_0xcc25b){if(!_0xcc25b){_0x2c30d1[_0xe1e4('0x1a')](0x194);}return _0xcc25b;};}function handleError(_0x1d5de7,_0x1ac40b){_0x1ac40b=_0x1ac40b||0x1f4;return function(_0x5292fe){logger[_0xe1e4('0x28')](_0x5292fe[_0xe1e4('0x29')]);if(_0x5292fe['name']){delete _0x5292fe['name'];}_0x1d5de7[_0xe1e4('0x1b')](_0x1ac40b)[_0xe1e4('0x2a')](_0x5292fe);};}exports['index']=function(_0xcb747b,_0x132fc3){var _0x1d49f3={},_0x11debf={},_0x4775fc={'count':0x0,'rows':[]};var _0x112a62=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x15b837){return{'name':_0x15b837['fieldName'],'type':_0x15b837[_0xe1e4('0x2b')][_0xe1e4('0x2c')]};});_0x11debf['model']=_[_0xe1e4('0x2d')](_0x112a62,'name');_0x11debf['query']=_['keys'](_0xcb747b[_0xe1e4('0x2e')]);_0x11debf[_0xe1e4('0x2f')]=_[_0xe1e4('0x30')](_0x11debf[_0xe1e4('0x31')],_0x11debf[_0xe1e4('0x2e')]);_0x1d49f3[_0xe1e4('0x32')]=_[_0xe1e4('0x30')](_0x11debf[_0xe1e4('0x31')],qs['fields'](_0xcb747b[_0xe1e4('0x2e')][_0xe1e4('0x33')]));_0x1d49f3[_0xe1e4('0x32')]=_0x1d49f3[_0xe1e4('0x32')][_0xe1e4('0x34')]?_0x1d49f3['attributes']:_0x11debf[_0xe1e4('0x31')];if(!_0xcb747b[_0xe1e4('0x2e')]['hasOwnProperty']('nolimit')){_0x1d49f3[_0xe1e4('0x20')]=qs['limit'](_0xcb747b[_0xe1e4('0x2e')]['limit']);_0x1d49f3['offset']=qs[_0xe1e4('0x1e')](_0xcb747b['query'][_0xe1e4('0x1e')]);}_0x1d49f3['order']=qs['sort'](_0xcb747b[_0xe1e4('0x2e')][_0xe1e4('0x35')]);_0x1d49f3['where']=qs['filters'](_[_0xe1e4('0x36')](_0xcb747b['query'],_0x11debf[_0xe1e4('0x2f')]),_0x112a62);if(_0xcb747b[_0xe1e4('0x2e')]['filter']){_0x1d49f3[_0xe1e4('0x37')]=_['merge'](_0x1d49f3[_0xe1e4('0x37')],{'$or':_[_0xe1e4('0x2d')](_0x112a62,function(_0x394114){if(_0x394114[_0xe1e4('0x2b')]!==_0xe1e4('0x38')){var _0x400965={};_0x400965[_0x394114[_0xe1e4('0x39')]]={'$like':'%'+_0xcb747b['query'][_0xe1e4('0x3a')]+'%'};return _0x400965;}})});}_0x1d49f3=_[_0xe1e4('0x3b')]({},_0x1d49f3,_0xcb747b[_0xe1e4('0x3c')]);var _0x1ba140={'where':_0x1d49f3[_0xe1e4('0x37')]};return db[_0xe1e4('0x3d')][_0xe1e4('0x21')](_0x1ba140)[_0xe1e4('0x27')](function(_0x55354a){_0x4775fc[_0xe1e4('0x21')]=_0x55354a;if(_0xcb747b[_0xe1e4('0x2e')][_0xe1e4('0x3e')]){_0x1d49f3['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xe1e4('0x3f')](_0x1d49f3);})['then'](function(_0x46c9ce){_0x4775fc[_0xe1e4('0x40')]=_0x46c9ce;return _0x4775fc;})[_0xe1e4('0x27')](respondWithFilteredResult(_0x132fc3,_0x1d49f3))[_0xe1e4('0x41')](handleError(_0x132fc3,null));};exports[_0xe1e4('0x42')]=function(_0x223bc9,_0x115f00){var _0x2f4475={'raw':![],'where':{'id':_0x223bc9[_0xe1e4('0x43')]['id']}},_0x1e8b81={};_0x1e8b81[_0xe1e4('0x31')]=_[_0xe1e4('0x44')](db[_0xe1e4('0x3d')][_0xe1e4('0x45')]);_0x1e8b81['query']=_[_0xe1e4('0x44')](_0x223bc9[_0xe1e4('0x2e')]);_0x1e8b81[_0xe1e4('0x2f')]=_[_0xe1e4('0x30')](_0x1e8b81[_0xe1e4('0x31')],_0x1e8b81[_0xe1e4('0x2e')]);_0x2f4475['attributes']=_[_0xe1e4('0x30')](_0x1e8b81[_0xe1e4('0x31')],qs[_0xe1e4('0x33')](_0x223bc9[_0xe1e4('0x2e')][_0xe1e4('0x33')]));_0x2f4475['attributes']=_0x2f4475[_0xe1e4('0x32')]['length']?_0x2f4475[_0xe1e4('0x32')]:_0x1e8b81['model'];if(_0x223bc9[_0xe1e4('0x2e')]['includeAll']){_0x2f4475[_0xe1e4('0x46')]=[{'all':!![]}];}_0x2f4475=_['merge']({},_0x2f4475,_0x223bc9[_0xe1e4('0x3c')]);return db[_0xe1e4('0x3d')]['find'](_0x2f4475)['then'](handleEntityNotFound(_0x115f00,null))['then'](respondWithResult(_0x115f00,null))[_0xe1e4('0x41')](handleError(_0x115f00,null));};exports[_0xe1e4('0x47')]=function(_0x4d4a6e,_0x5c6d30){return db[_0xe1e4('0x3d')]['create'](_0x4d4a6e['body'],{})[_0xe1e4('0x27')](respondWithResult(_0x5c6d30,0xc9))[_0xe1e4('0x41')](handleError(_0x5c6d30,null));};exports[_0xe1e4('0x26')]=function(_0x2e263b,_0x2ddd09){if(_0x2e263b[_0xe1e4('0x48')]['id']){delete _0x2e263b[_0xe1e4('0x48')]['id'];}return db[_0xe1e4('0x3d')]['find']({'where':{'id':_0x2e263b[_0xe1e4('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ddd09,null))[_0xe1e4('0x27')](saveUpdates(_0x2e263b[_0xe1e4('0x48')],null))[_0xe1e4('0x27')](respondWithResult(_0x2ddd09,null))[_0xe1e4('0x41')](handleError(_0x2ddd09,null));};exports[_0xe1e4('0x49')]=function(_0x29baa0,_0x5c8805){return db[_0xe1e4('0x3d')]['find']({'where':{'id':_0x29baa0['params']['id']}})[_0xe1e4('0x27')](handleEntityNotFound(_0x5c8805,null))['then'](removeEntity(_0x5c8805,null))[_0xe1e4('0x41')](handleError(_0x5c8805,null));};exports[_0xe1e4('0x4a')]=function(_0x2077f9,_0x1877b3,_0x5f4709){var _0x1a1b29={};var _0x4f4711={};var _0x5dfac4;var _0x1a254b;return db[_0xe1e4('0x3d')]['findOne']({'where':{'id':_0x2077f9[_0xe1e4('0x43')]['id']}})[_0xe1e4('0x27')](handleEntityNotFound(_0x1877b3,null))[_0xe1e4('0x27')](function(_0xc3c02){if(_0xc3c02){_0x5dfac4=_0xc3c02;_0x4f4711[_0xe1e4('0x31')]=_['keys'](db[_0xe1e4('0x4b')][_0xe1e4('0x45')]);_0x4f4711[_0xe1e4('0x2e')]=_[_0xe1e4('0x44')](_0x2077f9[_0xe1e4('0x2e')]);_0x4f4711[_0xe1e4('0x2f')]=_[_0xe1e4('0x30')](_0x4f4711[_0xe1e4('0x31')],_0x4f4711['query']);_0x1a1b29['attributes']=_[_0xe1e4('0x30')](_0x4f4711['model'],qs[_0xe1e4('0x33')](_0x2077f9[_0xe1e4('0x2e')][_0xe1e4('0x33')]));_0x1a1b29[_0xe1e4('0x32')]=_0x1a1b29[_0xe1e4('0x32')][_0xe1e4('0x34')]?_0x1a1b29[_0xe1e4('0x32')]:_0x4f4711[_0xe1e4('0x31')];_0x1a1b29[_0xe1e4('0x4c')]=qs[_0xe1e4('0x35')](_0x2077f9[_0xe1e4('0x2e')]['sort']);_0x1a1b29[_0xe1e4('0x37')]=qs[_0xe1e4('0x2f')](_[_0xe1e4('0x36')](_0x2077f9[_0xe1e4('0x2e')],_0x4f4711['filters']));if(_0x2077f9[_0xe1e4('0x2e')]['filter']){_0x1a1b29[_0xe1e4('0x37')]=_[_0xe1e4('0x3b')](_0x1a1b29[_0xe1e4('0x37')],{'$or':_[_0xe1e4('0x2d')](_0x1a1b29[_0xe1e4('0x32')],function(_0xd5d203){var _0x580234={};_0x580234[_0xd5d203]={'$like':'%'+_0x2077f9[_0xe1e4('0x2e')]['filter']+'%'};return _0x580234;})});}_0x1a1b29=_[_0xe1e4('0x3b')]({},_0x1a1b29,_0x2077f9[_0xe1e4('0x3c')]);return _0x5dfac4[_0xe1e4('0x4a')](_0x1a1b29);}})[_0xe1e4('0x27')](function(_0x8f96e4){if(_0x8f96e4){_0x1a254b=_0x8f96e4['length'];if(!_0x2077f9['query']['hasOwnProperty']('nolimit')){_0x1a1b29[_0xe1e4('0x20')]=qs[_0xe1e4('0x20')](_0x2077f9[_0xe1e4('0x2e')][_0xe1e4('0x20')]);_0x1a1b29[_0xe1e4('0x1e')]=qs[_0xe1e4('0x1e')](_0x2077f9[_0xe1e4('0x2e')][_0xe1e4('0x1e')]);}return _0x5dfac4[_0xe1e4('0x4a')](_0x1a1b29);}})[_0xe1e4('0x27')](function(_0x3bef50){if(_0x3bef50){return _0x3bef50?{'count':_0x1a254b,'rows':_0x3bef50}:null;}})[_0xe1e4('0x27')](respondWithResult(_0x1877b3,null))[_0xe1e4('0x41')](handleError(_0x1877b3,null));};exports[_0xe1e4('0x4d')]=function(_0x2fc2cf,_0xbe9c67,_0x40edcf){var _0xa11c54={};var _0xac55e={};var _0x4db0e5;var _0x52ca62;return db[_0xe1e4('0x3d')]['findOne']({'where':{'id':_0x2fc2cf[_0xe1e4('0x43')]['id']}})['then'](handleEntityNotFound(_0xbe9c67,null))[_0xe1e4('0x27')](function(_0x55035e){if(_0x55035e){_0x4db0e5=_0x55035e;_0xac55e['model']=_[_0xe1e4('0x44')](db['Dynamics365Field'][_0xe1e4('0x45')]);_0xac55e['query']=_['keys'](_0x2fc2cf[_0xe1e4('0x2e')]);_0xac55e[_0xe1e4('0x2f')]=_[_0xe1e4('0x30')](_0xac55e['model'],_0xac55e['query']);_0xa11c54[_0xe1e4('0x32')]=_[_0xe1e4('0x30')](_0xac55e[_0xe1e4('0x31')],qs[_0xe1e4('0x33')](_0x2fc2cf[_0xe1e4('0x2e')][_0xe1e4('0x33')]));_0xa11c54[_0xe1e4('0x32')]=_0xa11c54['attributes'][_0xe1e4('0x34')]?_0xa11c54[_0xe1e4('0x32')]:_0xac55e[_0xe1e4('0x31')];_0xa11c54[_0xe1e4('0x4c')]=qs[_0xe1e4('0x35')](_0x2fc2cf[_0xe1e4('0x2e')][_0xe1e4('0x35')]);_0xa11c54['where']=qs[_0xe1e4('0x2f')](_['pick'](_0x2fc2cf[_0xe1e4('0x2e')],_0xac55e[_0xe1e4('0x2f')]));if(_0x2fc2cf[_0xe1e4('0x2e')][_0xe1e4('0x3a')]){_0xa11c54['where']=_['merge'](_0xa11c54[_0xe1e4('0x37')],{'$or':_[_0xe1e4('0x2d')](_0xa11c54['attributes'],function(_0x5bf52f){var _0x5a3d6c={};_0x5a3d6c[_0x5bf52f]={'$like':'%'+_0x2fc2cf[_0xe1e4('0x2e')][_0xe1e4('0x3a')]+'%'};return _0x5a3d6c;})});}_0xa11c54=_['merge']({},_0xa11c54,_0x2fc2cf[_0xe1e4('0x3c')]);return _0x4db0e5[_0xe1e4('0x4d')](_0xa11c54);}})[_0xe1e4('0x27')](function(_0x5493d6){if(_0x5493d6){_0x52ca62=_0x5493d6[_0xe1e4('0x34')];if(!_0x2fc2cf[_0xe1e4('0x2e')][_0xe1e4('0x4e')](_0xe1e4('0x4f'))){_0xa11c54[_0xe1e4('0x20')]=qs[_0xe1e4('0x20')](_0x2fc2cf[_0xe1e4('0x2e')]['limit']);_0xa11c54[_0xe1e4('0x1e')]=qs[_0xe1e4('0x1e')](_0x2fc2cf[_0xe1e4('0x2e')][_0xe1e4('0x1e')]);}return _0x4db0e5['getSubjects'](_0xa11c54);}})['then'](function(_0x27a686){if(_0x27a686){return _0x27a686?{'count':_0x52ca62,'rows':_0x27a686}:null;}})[_0xe1e4('0x27')](respondWithResult(_0xbe9c67,null))[_0xe1e4('0x41')](handleError(_0xbe9c67,null));};exports[_0xe1e4('0x50')]=function(_0x1bacf2,_0x4b266e,_0x17b6c6){var _0x1a7b89={};var _0x39c836={};var _0x41ac7c;var _0x2305ee;return db[_0xe1e4('0x3d')][_0xe1e4('0x51')]({'where':{'id':_0x1bacf2[_0xe1e4('0x43')]['id']}})[_0xe1e4('0x27')](handleEntityNotFound(_0x4b266e,null))['then'](function(_0x339131){if(_0x339131){_0x41ac7c=_0x339131;_0x39c836[_0xe1e4('0x31')]=_['keys'](db['Dynamics365Field'][_0xe1e4('0x45')]);_0x39c836['query']=_[_0xe1e4('0x44')](_0x1bacf2['query']);_0x39c836[_0xe1e4('0x2f')]=_[_0xe1e4('0x30')](_0x39c836[_0xe1e4('0x31')],_0x39c836[_0xe1e4('0x2e')]);_0x1a7b89[_0xe1e4('0x32')]=_[_0xe1e4('0x30')](_0x39c836[_0xe1e4('0x31')],qs[_0xe1e4('0x33')](_0x1bacf2[_0xe1e4('0x2e')]['fields']));_0x1a7b89[_0xe1e4('0x32')]=_0x1a7b89[_0xe1e4('0x32')][_0xe1e4('0x34')]?_0x1a7b89['attributes']:_0x39c836[_0xe1e4('0x31')];_0x1a7b89[_0xe1e4('0x4c')]=qs[_0xe1e4('0x35')](_0x1bacf2['query'][_0xe1e4('0x35')]);_0x1a7b89[_0xe1e4('0x37')]=qs[_0xe1e4('0x2f')](_['pick'](_0x1bacf2[_0xe1e4('0x2e')],_0x39c836[_0xe1e4('0x2f')]));if(_0x1bacf2['query'][_0xe1e4('0x3a')]){_0x1a7b89[_0xe1e4('0x37')]=_[_0xe1e4('0x3b')](_0x1a7b89[_0xe1e4('0x37')],{'$or':_[_0xe1e4('0x2d')](_0x1a7b89[_0xe1e4('0x32')],function(_0x3592d0){var _0x515a50={};_0x515a50[_0x3592d0]={'$like':'%'+_0x1bacf2[_0xe1e4('0x2e')][_0xe1e4('0x3a')]+'%'};return _0x515a50;})});}_0x1a7b89=_['merge']({},_0x1a7b89,_0x1bacf2['options']);return _0x41ac7c[_0xe1e4('0x50')](_0x1a7b89);}})[_0xe1e4('0x27')](function(_0x4aea87){if(_0x4aea87){_0x2305ee=_0x4aea87['length'];if(!_0x1bacf2[_0xe1e4('0x2e')][_0xe1e4('0x4e')](_0xe1e4('0x4f'))){_0x1a7b89[_0xe1e4('0x20')]=qs['limit'](_0x1bacf2[_0xe1e4('0x2e')][_0xe1e4('0x20')]);_0x1a7b89[_0xe1e4('0x1e')]=qs[_0xe1e4('0x1e')](_0x1bacf2[_0xe1e4('0x2e')][_0xe1e4('0x1e')]);}return _0x41ac7c['getDescriptions'](_0x1a7b89);}})[_0xe1e4('0x27')](function(_0x59040d){if(_0x59040d){return _0x59040d?{'count':_0x2305ee,'rows':_0x59040d}:null;}})[_0xe1e4('0x27')](respondWithResult(_0x4b266e,null))['catch'](handleError(_0x4b266e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index a62e4b2..c9f7cdf 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 _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x531c3b,_0x524110){var _0x353493=function(_0x22f472){while(--_0x22f472){_0x531c3b['push'](_0x531c3b['shift']());}};_0x353493(++_0x524110);}(_0x84ab,0x12f));var _0xb84a=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x84ab[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0xef8b9c,_0x1a4667){var _0x538186=function(_0x210925){while(--_0x210925){_0xef8b9c['push'](_0xef8b9c['shift']());}};_0x538186(++_0x1a4667);}(_0x3e74,0x175));var _0x43e7=function(_0x1583c4,_0x17fd43){_0x1583c4=_0x1583c4-0x0;var _0x1b24ce=_0x3e74[_0x1583c4];return _0x1b24ce;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 26737f6..ab0d917 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 _0xd314=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x580119,_0x53da1c){var _0x54c385=function(_0x2b62d7){while(--_0x2b62d7){_0x580119['push'](_0x580119['shift']());}};_0x54c385(++_0x53da1c);}(_0xd314,0x151));var _0x4d31=function(_0x4b479c,_0x251edb){_0x4b479c=_0x4b479c-0x0;var _0x5eca41=_0xd314[_0x4b479c];return _0x5eca41;};'use strict';var _=require(_0x4d31('0x0'));var util=require(_0x4d31('0x1'));var moment=require(_0x4d31('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d31('0x3'));var db=require(_0x4d31('0x4'))['db'];var utils=require(_0x4d31('0x5'));var logger=require(_0x4d31('0x6'))(_0x4d31('0x7'));var config=require('../../config/environment');var jayson=require(_0x4d31('0x8'));var client=jayson['client'][_0x4d31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22d3ee,_0x58b92c,_0x4c3c0a){return new BPromise(function(_0x1f0e16,_0x2ae80c){return client[_0x4d31('0xa')](_0x22d3ee,_0x4c3c0a)['then'](function(_0x197964){logger[_0x4d31('0xb')](_0x4d31('0xc'),_0x58b92c,'request\x20sent');logger['debug'](_0x4d31('0xd'),_0x58b92c,'request\x20sent',JSON[_0x4d31('0xe')](_0x197964));if(_0x197964['error']){if(_0x197964[_0x4d31('0xf')]['code']===0x1f4){logger[_0x4d31('0xf')](_0x4d31('0xc'),_0x58b92c,_0x197964['error'][_0x4d31('0x10')]);return _0x2ae80c(_0x197964[_0x4d31('0xf')]['message']);}logger[_0x4d31('0xf')](_0x4d31('0xc'),_0x58b92c,_0x197964[_0x4d31('0xf')][_0x4d31('0x10')]);return _0x1f0e16(_0x197964[_0x4d31('0xf')][_0x4d31('0x10')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x58b92c,_0x4d31('0x11'));_0x1f0e16(_0x197964[_0x4d31('0x12')][_0x4d31('0x10')]);}})[_0x4d31('0x13')](function(_0x4f13ff){logger[_0x4d31('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x58b92c,_0x4f13ff);_0x2ae80c(_0x4f13ff);});});} \ No newline at end of file +var _0x67a0=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67a0,0x161));var _0x067a=function(_0xdab747,_0xac1c63){_0xdab747=_0xdab747-0x0;var _0x35f572=_0x67a0[_0xdab747];return _0x35f572;};'use strict';var _=require(_0x067a('0x0'));var util=require(_0x067a('0x1'));var moment=require(_0x067a('0x2'));var BPromise=require(_0x067a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x067a('0x4'));var db=require(_0x067a('0x5'))['db'];var utils=require(_0x067a('0x6'));var logger=require(_0x067a('0x7'))(_0x067a('0x8'));var config=require(_0x067a('0x9'));var jayson=require(_0x067a('0xa'));var client=jayson[_0x067a('0xb')][_0x067a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33e841,_0x18ee30,_0x6c8e11){return new BPromise(function(_0x12d495,_0x2d57f9){return client[_0x067a('0xd')](_0x33e841,_0x6c8e11)['then'](function(_0x3f6941){logger[_0x067a('0xe')](_0x067a('0xf'),_0x18ee30,_0x067a('0x10'));logger[_0x067a('0x11')](_0x067a('0x12'),_0x18ee30,_0x067a('0x10'),JSON[_0x067a('0x13')](_0x3f6941));if(_0x3f6941['error']){if(_0x3f6941[_0x067a('0x14')][_0x067a('0x15')]===0x1f4){logger[_0x067a('0x14')](_0x067a('0xf'),_0x18ee30,_0x3f6941[_0x067a('0x14')][_0x067a('0x16')]);return _0x2d57f9(_0x3f6941[_0x067a('0x14')][_0x067a('0x16')]);}logger[_0x067a('0x14')](_0x067a('0xf'),_0x18ee30,_0x3f6941['error'][_0x067a('0x16')]);return _0x12d495(_0x3f6941['error']['message']);}else{logger[_0x067a('0xe')](_0x067a('0xf'),_0x18ee30,_0x067a('0x10'));_0x12d495(_0x3f6941[_0x067a('0x17')]['message']);}})[_0x067a('0x18')](function(_0x2613ae){logger[_0x067a('0x14')](_0x067a('0xf'),_0x18ee30,_0x2613ae);_0x2d57f9(_0x2613ae);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4396911..e727fa8 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 _0xb042=['Router','fs-extra','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','path','express'];(function(_0x286fd6,_0x201d80){var _0x5e3426=function(_0x2fc4b8){while(--_0x2fc4b8){_0x286fd6['push'](_0x286fd6['shift']());}};_0x5e3426(++_0x201d80);}(_0xb042,0xed));var _0x2b04=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xb042[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x2b04('0x0'));var util=require('util');var path=require(_0x2b04('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b04('0x2'));var router=express[_0x2b04('0x3')]();var fs_extra=require(_0x2b04('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2b04('0x5'));router[_0x2b04('0x6')]('/',auth[_0x2b04('0x7')](),controller[_0x2b04('0x8')]);router['get'](_0x2b04('0x9'),auth[_0x2b04('0x7')](),controller['show']);router[_0x2b04('0xa')]('/',auth[_0x2b04('0x7')](),controller[_0x2b04('0xb')]);router[_0x2b04('0xc')](_0x2b04('0x9'),auth[_0x2b04('0x7')](),controller[_0x2b04('0xd')]);router['delete'](_0x2b04('0x9'),auth[_0x2b04('0x7')](),controller[_0x2b04('0xe')]);module[_0x2b04('0xf')]=router; \ No newline at end of file +var _0xa661=['isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x1cb711,_0x3bd53e){var _0xa5c01d=function(_0x55878a){while(--_0x55878a){_0x1cb711['push'](_0x1cb711['shift']());}};_0xa5c01d(++_0x3bd53e);}(_0xa661,0x68));var _0x1a66=function(_0x5a28ed,_0x2bcf10){_0x5a28ed=_0x5a28ed-0x0;var _0x4d4f6a=_0xa661[_0x5a28ed];return _0x4d4f6a;};'use strict';var multer=require(_0x1a66('0x0'));var util=require('util');var path=require(_0x1a66('0x1'));var timeout=require(_0x1a66('0x2'));var express=require(_0x1a66('0x3'));var router=express[_0x1a66('0x4')]();var fs_extra=require(_0x1a66('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1a66('0x6'));var config=require(_0x1a66('0x7'));var controller=require(_0x1a66('0x8'));router[_0x1a66('0x9')]('/',auth[_0x1a66('0xa')](),controller['index']);router[_0x1a66('0x9')]('/:id',auth[_0x1a66('0xa')](),controller[_0x1a66('0xb')]);router[_0x1a66('0xc')]('/',auth[_0x1a66('0xa')](),controller['create']);router[_0x1a66('0xd')](_0x1a66('0xe'),auth['isAuthenticated'](),controller[_0x1a66('0xf')]);router[_0x1a66('0x10')](_0x1a66('0xe'),auth[_0x1a66('0xa')](),controller[_0x1a66('0x11')]);module[_0x1a66('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 1c1dc86..95ddaf4 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 _0x3d59=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x415f25,_0x16e364){var _0x6e5d60=function(_0x5aabc9){while(--_0x5aabc9){_0x415f25['push'](_0x415f25['shift']());}};_0x6e5d60(++_0x16e364);}(_0x3d59,0xc5));var _0x93d5=function(_0x1315ad,_0x4cc7ec){_0x1315ad=_0x1315ad-0x0;var _0x34befa=_0x3d59[_0x1315ad];return _0x34befa;};'use strict';var Sequelize=require(_0x93d5('0x0'));module[_0x93d5('0x1')]={'type':{'type':Sequelize[_0x93d5('0x2')](_0x93d5('0x3'),_0x93d5('0x4'),_0x93d5('0x5'),_0x93d5('0x6'),_0x93d5('0x7')),'defaultValue':_0x93d5('0x3')},'content':{'type':Sequelize[_0x93d5('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x93d5('0x3'),_0x93d5('0x4'),_0x93d5('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x93d5('0x8')]},'nameField':{'type':Sequelize[_0x93d5('0x8')]},'customField':{'type':Sequelize[_0x93d5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x93d5('0x8')]}}; \ No newline at end of file +var _0xb892=['picklist','STRING','ENUM','BOOLEAN','string','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb892,0x193));var _0x2b89=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xb892[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x2b89('0x0'),_0x2b89('0x1'),_0x2b89('0x2'),'keyValue',_0x2b89('0x3')),'defaultValue':_0x2b89('0x0')},'content':{'type':Sequelize[_0x2b89('0x4')]},'key':{'type':Sequelize[_0x2b89('0x4')]},'keyType':{'type':Sequelize[_0x2b89('0x5')]('string',_0x2b89('0x1'),_0x2b89('0x2'))},'keyContent':{'type':Sequelize[_0x2b89('0x4')]},'idField':{'type':Sequelize[_0x2b89('0x4')]},'nameField':{'type':Sequelize[_0x2b89('0x4')]},'customField':{'type':Sequelize[_0x2b89('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b89('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index a2969f4..4c7aa16 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 _0xe60a=['undefined','count','Content-Range','update','then','destroy','name','send','index','map','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','Dynamics365Field','includeAll','include','rows','catch','show','params','options','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x55d7c6,_0xa19cdd){var _0x455b4d=function(_0x1d2e2c){while(--_0x1d2e2c){_0x55d7c6['push'](_0x55d7c6['shift']());}};_0x455b4d(++_0xa19cdd);}(_0xe60a,0x6d));var _0xae60=function(_0x5cb537,_0x22d0a4){_0x5cb537=_0x5cb537-0x0;var _0x26cd80=_0xe60a[_0x5cb537];return _0x26cd80;};'use strict';var emlformat=require(_0xae60('0x0'));var rimraf=require(_0xae60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xae60('0x2'));var moment=require(_0xae60('0x3'));var BPromise=require(_0xae60('0x4'));var Mustache=require(_0xae60('0x5'));var util=require(_0xae60('0x6'));var path=require(_0xae60('0x7'));var sox=require(_0xae60('0x8'));var csv=require(_0xae60('0x9'));var ejs=require(_0xae60('0xa'));var fs=require('fs');var fs_extra=require(_0xae60('0xb'));var _=require(_0xae60('0xc'));var squel=require(_0xae60('0xd'));var crypto=require(_0xae60('0xe'));var jsforce=require(_0xae60('0xf'));var deskjs=require(_0xae60('0x10'));var toCsv=require(_0xae60('0x9'));var querystring=require(_0xae60('0x11'));var Papa=require(_0xae60('0x12'));var Redis=require('ioredis');var authService=require(_0xae60('0x13'));var qs=require(_0xae60('0x14'));var as=require(_0xae60('0x15'));var hardwareService=require(_0xae60('0x16'));var logger=require(_0xae60('0x17'))(_0xae60('0x18'));var utils=require(_0xae60('0x19'));var config=require(_0xae60('0x1a'));var licenseUtil=require(_0xae60('0x1b'));var db=require(_0xae60('0x1c'))['db'];function respondWithStatusCode(_0x2cec95,_0x46b87e){_0x46b87e=_0x46b87e||0xcc;return function(_0x464bf3){if(_0x464bf3){return _0x2cec95[_0xae60('0x1d')](_0x46b87e);}return _0x2cec95[_0xae60('0x1e')](_0x46b87e)[_0xae60('0x1f')]();};}function respondWithResult(_0x198fc0,_0xfbd3d6){_0xfbd3d6=_0xfbd3d6||0xc8;return function(_0x38d07b){if(_0x38d07b){return _0x198fc0[_0xae60('0x1e')](_0xfbd3d6)[_0xae60('0x20')](_0x38d07b);}};}function respondWithFilteredResult(_0x4d3ebb,_0x1c8799){return function(_0x5944a2){if(_0x5944a2){var _0x23702e=typeof _0x1c8799[_0xae60('0x21')]==='undefined'&&typeof _0x1c8799[_0xae60('0x22')]===_0xae60('0x23');var _0x2adfb9=_0x5944a2[_0xae60('0x24')];var _0x498e6b=_0x23702e?0x0:_0x1c8799['offset'];var _0xf6c82f=_0x23702e?_0x5944a2[_0xae60('0x24')]:_0x1c8799[_0xae60('0x21')]+_0x1c8799['limit'];var _0x13f869;if(_0xf6c82f>=_0x2adfb9){_0xf6c82f=_0x2adfb9;_0x13f869=0xc8;}else{_0x13f869=0xce;}_0x4d3ebb['status'](_0x13f869);return _0x4d3ebb['set'](_0xae60('0x25'),_0x498e6b+'-'+_0xf6c82f+'/'+_0x2adfb9)['json'](_0x5944a2);}return null;};}function patchUpdates(_0x466860){return function(_0xe85fdd){try{jsonpatch['apply'](_0xe85fdd,_0x466860,!![]);}catch(_0x2836d4){return BPromise['reject'](_0x2836d4);}return _0xe85fdd['save']();};}function saveUpdates(_0x3b4c94,_0x2d23eb){return function(_0x18168e){if(_0x18168e){return _0x18168e[_0xae60('0x26')](_0x3b4c94)[_0xae60('0x27')](function(_0x375f82){return _0x375f82;});}return null;};}function removeEntity(_0x58b48f,_0x16159d){return function(_0x475c16){if(_0x475c16){return _0x475c16[_0xae60('0x28')]()[_0xae60('0x27')](function(){_0x58b48f['status'](0xcc)[_0xae60('0x1f')]();});}};}function handleEntityNotFound(_0x164622,_0x2c74ca){return function(_0x1dd601){if(!_0x1dd601){_0x164622[_0xae60('0x1d')](0x194);}return _0x1dd601;};}function handleError(_0x5934a9,_0xb9bfc7){_0xb9bfc7=_0xb9bfc7||0x1f4;return function(_0x20d603){logger['error'](_0x20d603['stack']);if(_0x20d603[_0xae60('0x29')]){delete _0x20d603[_0xae60('0x29')];}_0x5934a9['status'](_0xb9bfc7)[_0xae60('0x2a')](_0x20d603);};}exports[_0xae60('0x2b')]=function(_0x350920,_0x2ef015){var _0x3fdd0b={},_0x117fea={},_0x26f4a4={'count':0x0,'rows':[]};var _0xfc0d75=_[_0xae60('0x2c')](db['Dynamics365Field'][_0xae60('0x2d')],function(_0x3c1b21){return{'name':_0x3c1b21['fieldName'],'type':_0x3c1b21[_0xae60('0x2e')]['key']};});_0x117fea[_0xae60('0x2f')]=_[_0xae60('0x2c')](_0xfc0d75,_0xae60('0x29'));_0x117fea['query']=_[_0xae60('0x30')](_0x350920[_0xae60('0x31')]);_0x117fea[_0xae60('0x32')]=_['intersection'](_0x117fea[_0xae60('0x2f')],_0x117fea[_0xae60('0x31')]);_0x3fdd0b[_0xae60('0x33')]=_[_0xae60('0x34')](_0x117fea['model'],qs[_0xae60('0x35')](_0x350920['query'][_0xae60('0x35')]));_0x3fdd0b[_0xae60('0x33')]=_0x3fdd0b[_0xae60('0x33')][_0xae60('0x36')]?_0x3fdd0b[_0xae60('0x33')]:_0x117fea[_0xae60('0x2f')];if(!_0x350920[_0xae60('0x31')]['hasOwnProperty']('nolimit')){_0x3fdd0b[_0xae60('0x22')]=qs[_0xae60('0x22')](_0x350920[_0xae60('0x31')][_0xae60('0x22')]);_0x3fdd0b['offset']=qs['offset'](_0x350920[_0xae60('0x31')]['offset']);}_0x3fdd0b['order']=qs[_0xae60('0x37')](_0x350920[_0xae60('0x31')]['sort']);_0x3fdd0b[_0xae60('0x38')]=qs[_0xae60('0x32')](_[_0xae60('0x39')](_0x350920[_0xae60('0x31')],_0x117fea[_0xae60('0x32')]),_0xfc0d75);if(_0x350920[_0xae60('0x31')][_0xae60('0x3a')]){_0x3fdd0b['where']=_[_0xae60('0x3b')](_0x3fdd0b[_0xae60('0x38')],{'$or':_[_0xae60('0x2c')](_0xfc0d75,function(_0x45bf27){if(_0x45bf27[_0xae60('0x2e')]!==_0xae60('0x3c')){var _0x12e1f2={};_0x12e1f2[_0x45bf27[_0xae60('0x29')]]={'$like':'%'+_0x350920[_0xae60('0x31')][_0xae60('0x3a')]+'%'};return _0x12e1f2;}})});}_0x3fdd0b=_['merge']({},_0x3fdd0b,_0x350920['options']);var _0x547007={'where':_0x3fdd0b[_0xae60('0x38')]};return db[_0xae60('0x3d')][_0xae60('0x24')](_0x547007)['then'](function(_0xa4cfef){_0x26f4a4[_0xae60('0x24')]=_0xa4cfef;if(_0x350920[_0xae60('0x31')][_0xae60('0x3e')]){_0x3fdd0b[_0xae60('0x3f')]=[{'all':!![]}];}return db[_0xae60('0x3d')]['findAll'](_0x3fdd0b);})[_0xae60('0x27')](function(_0xc9a849){_0x26f4a4[_0xae60('0x40')]=_0xc9a849;return _0x26f4a4;})['then'](respondWithFilteredResult(_0x2ef015,_0x3fdd0b))[_0xae60('0x41')](handleError(_0x2ef015,null));};exports[_0xae60('0x42')]=function(_0x2b3ff6,_0x2cb795){var _0xc3ded1={'raw':!![],'where':{'id':_0x2b3ff6[_0xae60('0x43')]['id']}},_0x2677d7={};_0x2677d7['model']=_['keys'](db[_0xae60('0x3d')]['rawAttributes']);_0x2677d7[_0xae60('0x31')]=_[_0xae60('0x30')](_0x2b3ff6[_0xae60('0x31')]);_0x2677d7['filters']=_['intersection'](_0x2677d7[_0xae60('0x2f')],_0x2677d7[_0xae60('0x31')]);_0xc3ded1[_0xae60('0x33')]=_[_0xae60('0x34')](_0x2677d7[_0xae60('0x2f')],qs[_0xae60('0x35')](_0x2b3ff6[_0xae60('0x31')]['fields']));_0xc3ded1[_0xae60('0x33')]=_0xc3ded1[_0xae60('0x33')][_0xae60('0x36')]?_0xc3ded1[_0xae60('0x33')]:_0x2677d7[_0xae60('0x2f')];if(_0x2b3ff6['query'][_0xae60('0x3e')]){_0xc3ded1[_0xae60('0x3f')]=[{'all':!![]}];}_0xc3ded1=_['merge']({},_0xc3ded1,_0x2b3ff6[_0xae60('0x44')]);return db[_0xae60('0x3d')][_0xae60('0x45')](_0xc3ded1)[_0xae60('0x27')](handleEntityNotFound(_0x2cb795,null))[_0xae60('0x27')](respondWithResult(_0x2cb795,null))[_0xae60('0x41')](handleError(_0x2cb795,null));};exports[_0xae60('0x46')]=function(_0x3bfbad,_0x5e5d26){return db['Dynamics365Field']['create'](_0x3bfbad[_0xae60('0x47')],{})[_0xae60('0x27')](respondWithResult(_0x5e5d26,0xc9))[_0xae60('0x41')](handleError(_0x5e5d26,null));};exports[_0xae60('0x26')]=function(_0x2e6398,_0xc05fc8){if(_0x2e6398[_0xae60('0x47')]['id']){delete _0x2e6398[_0xae60('0x47')]['id'];}return db[_0xae60('0x3d')]['find']({'where':{'id':_0x2e6398[_0xae60('0x43')]['id']}})[_0xae60('0x27')](handleEntityNotFound(_0xc05fc8,null))[_0xae60('0x27')](saveUpdates(_0x2e6398[_0xae60('0x47')],null))[_0xae60('0x27')](respondWithResult(_0xc05fc8,null))['catch'](handleError(_0xc05fc8,null));};exports[_0xae60('0x28')]=function(_0x23a684,_0x4ed4f9){return db[_0xae60('0x3d')]['find']({'where':{'id':_0x23a684[_0xae60('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ed4f9,null))['then'](removeEntity(_0x4ed4f9,null))[_0xae60('0x41')](handleError(_0x4ed4f9,null));}; \ No newline at end of file +var _0x4949=['api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Dynamics365Field','includeAll','findAll','rows','catch','show','params','include','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4d7676,_0x487a9a){var _0x19ceaf=function(_0x3a9ab0){while(--_0x3a9ab0){_0x4d7676['push'](_0x4d7676['shift']());}};_0x19ceaf(++_0x487a9a);}(_0x4949,0xc7));var _0x9494=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4949[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9494('0x0'));var zipdir=require(_0x9494('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9494('0x2'));var moment=require(_0x9494('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9494('0x4'));var util=require(_0x9494('0x5'));var path=require(_0x9494('0x6'));var sox=require('sox');var csv=require(_0x9494('0x7'));var ejs=require(_0x9494('0x8'));var fs=require('fs');var fs_extra=require(_0x9494('0x9'));var _=require(_0x9494('0xa'));var squel=require(_0x9494('0xb'));var crypto=require(_0x9494('0xc'));var jsforce=require(_0x9494('0xd'));var deskjs=require(_0x9494('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9494('0xf'));var Papa=require(_0x9494('0x10'));var Redis=require('ioredis');var authService=require(_0x9494('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9494('0x12'));var hardwareService=require(_0x9494('0x13'));var logger=require('../../config/logger')(_0x9494('0x14'));var utils=require(_0x9494('0x15'));var config=require(_0x9494('0x16'));var licenseUtil=require(_0x9494('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x201974,_0x191ddc){_0x191ddc=_0x191ddc||0xcc;return function(_0x4372d1){if(_0x4372d1){return _0x201974['sendStatus'](_0x191ddc);}return _0x201974[_0x9494('0x18')](_0x191ddc)[_0x9494('0x19')]();};}function respondWithResult(_0xb7ffd,_0x2443a5){_0x2443a5=_0x2443a5||0xc8;return function(_0x4a0bfd){if(_0x4a0bfd){return _0xb7ffd[_0x9494('0x18')](_0x2443a5)[_0x9494('0x1a')](_0x4a0bfd);}};}function respondWithFilteredResult(_0x1814da,_0x9413d1){return function(_0x36dc99){if(_0x36dc99){var _0x37cda0=typeof _0x9413d1[_0x9494('0x1b')]===_0x9494('0x1c')&&typeof _0x9413d1[_0x9494('0x1d')]===_0x9494('0x1c');var _0x7f5b49=_0x36dc99[_0x9494('0x1e')];var _0x121cc0=_0x37cda0?0x0:_0x9413d1['offset'];var _0x1808b4=_0x37cda0?_0x36dc99[_0x9494('0x1e')]:_0x9413d1[_0x9494('0x1b')]+_0x9413d1[_0x9494('0x1d')];var _0x30721b;if(_0x1808b4>=_0x7f5b49){_0x1808b4=_0x7f5b49;_0x30721b=0xc8;}else{_0x30721b=0xce;}_0x1814da[_0x9494('0x18')](_0x30721b);return _0x1814da['set']('Content-Range',_0x121cc0+'-'+_0x1808b4+'/'+_0x7f5b49)[_0x9494('0x1a')](_0x36dc99);}return null;};}function patchUpdates(_0x21ac08){return function(_0x2c13dc){try{jsonpatch[_0x9494('0x1f')](_0x2c13dc,_0x21ac08,!![]);}catch(_0x20f90e){return BPromise[_0x9494('0x20')](_0x20f90e);}return _0x2c13dc[_0x9494('0x21')]();};}function saveUpdates(_0x156ab0,_0x532507){return function(_0x3fb143){if(_0x3fb143){return _0x3fb143[_0x9494('0x22')](_0x156ab0)[_0x9494('0x23')](function(_0x4c7123){return _0x4c7123;});}return null;};}function removeEntity(_0x45523e,_0x3459ae){return function(_0x397275){if(_0x397275){return _0x397275[_0x9494('0x24')]()['then'](function(){_0x45523e['status'](0xcc)[_0x9494('0x19')]();});}};}function handleEntityNotFound(_0x48a52a,_0x348d49){return function(_0x59ab9b){if(!_0x59ab9b){_0x48a52a[_0x9494('0x25')](0x194);}return _0x59ab9b;};}function handleError(_0x50a6b1,_0x597e41){_0x597e41=_0x597e41||0x1f4;return function(_0x3f674c){logger[_0x9494('0x26')](_0x3f674c[_0x9494('0x27')]);if(_0x3f674c['name']){delete _0x3f674c[_0x9494('0x28')];}_0x50a6b1[_0x9494('0x18')](_0x597e41)[_0x9494('0x29')](_0x3f674c);};}exports[_0x9494('0x2a')]=function(_0x308d8c,_0x593534){var _0x33dee2={},_0x3f963e={},_0x516210={'count':0x0,'rows':[]};var _0x6ae438=_[_0x9494('0x2b')](db['Dynamics365Field'][_0x9494('0x2c')],function(_0x12ad08){return{'name':_0x12ad08['fieldName'],'type':_0x12ad08['type'][_0x9494('0x2d')]};});_0x3f963e[_0x9494('0x2e')]=_[_0x9494('0x2b')](_0x6ae438,_0x9494('0x28'));_0x3f963e[_0x9494('0x2f')]=_[_0x9494('0x30')](_0x308d8c[_0x9494('0x2f')]);_0x3f963e[_0x9494('0x31')]=_['intersection'](_0x3f963e[_0x9494('0x2e')],_0x3f963e[_0x9494('0x2f')]);_0x33dee2[_0x9494('0x32')]=_[_0x9494('0x33')](_0x3f963e['model'],qs[_0x9494('0x34')](_0x308d8c[_0x9494('0x2f')][_0x9494('0x34')]));_0x33dee2[_0x9494('0x32')]=_0x33dee2[_0x9494('0x32')]['length']?_0x33dee2[_0x9494('0x32')]:_0x3f963e['model'];if(!_0x308d8c[_0x9494('0x2f')][_0x9494('0x35')](_0x9494('0x36'))){_0x33dee2[_0x9494('0x1d')]=qs[_0x9494('0x1d')](_0x308d8c[_0x9494('0x2f')][_0x9494('0x1d')]);_0x33dee2[_0x9494('0x1b')]=qs[_0x9494('0x1b')](_0x308d8c[_0x9494('0x2f')][_0x9494('0x1b')]);}_0x33dee2['order']=qs[_0x9494('0x37')](_0x308d8c[_0x9494('0x2f')][_0x9494('0x37')]);_0x33dee2[_0x9494('0x38')]=qs[_0x9494('0x31')](_[_0x9494('0x39')](_0x308d8c[_0x9494('0x2f')],_0x3f963e[_0x9494('0x31')]),_0x6ae438);if(_0x308d8c[_0x9494('0x2f')]['filter']){_0x33dee2[_0x9494('0x38')]=_[_0x9494('0x3a')](_0x33dee2['where'],{'$or':_['map'](_0x6ae438,function(_0x80dcba){if(_0x80dcba['type']!==_0x9494('0x3b')){var _0x243872={};_0x243872[_0x80dcba[_0x9494('0x28')]]={'$like':'%'+_0x308d8c['query'][_0x9494('0x3c')]+'%'};return _0x243872;}})});}_0x33dee2=_[_0x9494('0x3a')]({},_0x33dee2,_0x308d8c[_0x9494('0x3d')]);var _0x47e7be={'where':_0x33dee2[_0x9494('0x38')]};return db[_0x9494('0x3e')][_0x9494('0x1e')](_0x47e7be)['then'](function(_0x251d6a){_0x516210[_0x9494('0x1e')]=_0x251d6a;if(_0x308d8c[_0x9494('0x2f')][_0x9494('0x3f')]){_0x33dee2['include']=[{'all':!![]}];}return db[_0x9494('0x3e')][_0x9494('0x40')](_0x33dee2);})[_0x9494('0x23')](function(_0x3449a4){_0x516210[_0x9494('0x41')]=_0x3449a4;return _0x516210;})[_0x9494('0x23')](respondWithFilteredResult(_0x593534,_0x33dee2))[_0x9494('0x42')](handleError(_0x593534,null));};exports[_0x9494('0x43')]=function(_0x4e417b,_0x118652){var _0x5cbaaa={'raw':!![],'where':{'id':_0x4e417b[_0x9494('0x44')]['id']}},_0x31cd6c={};_0x31cd6c[_0x9494('0x2e')]=_[_0x9494('0x30')](db['Dynamics365Field'][_0x9494('0x2c')]);_0x31cd6c[_0x9494('0x2f')]=_['keys'](_0x4e417b['query']);_0x31cd6c['filters']=_['intersection'](_0x31cd6c[_0x9494('0x2e')],_0x31cd6c[_0x9494('0x2f')]);_0x5cbaaa[_0x9494('0x32')]=_[_0x9494('0x33')](_0x31cd6c[_0x9494('0x2e')],qs[_0x9494('0x34')](_0x4e417b[_0x9494('0x2f')]['fields']));_0x5cbaaa['attributes']=_0x5cbaaa[_0x9494('0x32')]['length']?_0x5cbaaa[_0x9494('0x32')]:_0x31cd6c[_0x9494('0x2e')];if(_0x4e417b[_0x9494('0x2f')][_0x9494('0x3f')]){_0x5cbaaa[_0x9494('0x45')]=[{'all':!![]}];}_0x5cbaaa=_['merge']({},_0x5cbaaa,_0x4e417b[_0x9494('0x3d')]);return db[_0x9494('0x3e')][_0x9494('0x46')](_0x5cbaaa)[_0x9494('0x23')](handleEntityNotFound(_0x118652,null))[_0x9494('0x23')](respondWithResult(_0x118652,null))[_0x9494('0x42')](handleError(_0x118652,null));};exports[_0x9494('0x47')]=function(_0x4526ff,_0x4c2e46){return db[_0x9494('0x3e')][_0x9494('0x47')](_0x4526ff[_0x9494('0x48')],{})['then'](respondWithResult(_0x4c2e46,0xc9))[_0x9494('0x42')](handleError(_0x4c2e46,null));};exports[_0x9494('0x22')]=function(_0x447ae5,_0x5a8929){if(_0x447ae5['body']['id']){delete _0x447ae5[_0x9494('0x48')]['id'];}return db[_0x9494('0x3e')]['find']({'where':{'id':_0x447ae5[_0x9494('0x44')]['id']}})[_0x9494('0x23')](handleEntityNotFound(_0x5a8929,null))[_0x9494('0x23')](saveUpdates(_0x447ae5[_0x9494('0x48')],null))[_0x9494('0x23')](respondWithResult(_0x5a8929,null))['catch'](handleError(_0x5a8929,null));};exports[_0x9494('0x24')]=function(_0x5942dc,_0x5bd19a){return db['Dynamics365Field'][_0x9494('0x46')]({'where':{'id':_0x5942dc['params']['id']}})[_0x9494('0x23')](handleEntityNotFound(_0x5bd19a,null))['then'](removeEntity(_0x5bd19a,null))[_0x9494('0x42')](handleError(_0x5bd19a,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 5b7917c..9207bff 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 _0x48bb=['../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5073d4,_0x5e0f0c){var _0x188668=function(_0x2a38a0){while(--_0x2a38a0){_0x5073d4['push'](_0x5073d4['shift']());}};_0x188668(++_0x5e0f0c);}(_0x48bb,0xcc));var _0xb48b=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x48bb[_0x382c73];return _0x1dd0bf;};'use strict';var _=require('lodash');var util=require(_0xb48b('0x0'));var logger=require(_0xb48b('0x1'))(_0xb48b('0x2'));var moment=require(_0xb48b('0x3'));var BPromise=require(_0xb48b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb48b('0x5'));var rimraf=require('rimraf');var config=require(_0xb48b('0x6'));var attributes=require(_0xb48b('0x7'));module['exports']=function(_0x5a546d,_0x5848fc){return _0x5a546d[_0xb48b('0x8')](_0xb48b('0x9'),attributes,{'tableName':_0xb48b('0xa'),'paranoid':![],'indexes':[{'name':_0xb48b('0xb'),'fields':[_0xb48b('0xc'),_0xb48b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f3=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x4653f2,_0x21dbcd){var _0x404e19=function(_0x5b7899){while(--_0x5b7899){_0x4653f2['push'](_0x4653f2['shift']());}};_0x404e19(++_0x21dbcd);}(_0xb3f3,0x112));var _0x3b3f=function(_0x3407ee,_0xb2e716){_0x3407ee=_0x3407ee-0x0;var _0x1b0b35=_0xb3f3[_0x3407ee];return _0x1b0b35;};'use strict';var _=require(_0x3b3f('0x0'));var util=require('util');var logger=require(_0x3b3f('0x1'))(_0x3b3f('0x2'));var moment=require(_0x3b3f('0x3'));var BPromise=require(_0x3b3f('0x4'));var rp=require(_0x3b3f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b3f('0x6'));var config=require(_0x3b3f('0x7'));var attributes=require(_0x3b3f('0x8'));module['exports']=function(_0x23b433,_0x24ae19){return _0x23b433[_0x3b3f('0x9')]('Dynamics365Field',attributes,{'tableName':_0x3b3f('0xa'),'paranoid':![],'indexes':[{'name':_0x3b3f('0xb'),'fields':['idField',_0x3b3f('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 88eac18..84c508b 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 _0x9716=['jayson/promise','client','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4e1d91,_0x30df75){var _0x281766=function(_0x3d27ef){while(--_0x3d27ef){_0x4e1d91['push'](_0x4e1d91['shift']());}};_0x281766(++_0x30df75);}(_0x9716,0x1f2));var _0x6971=function(_0x17eb9d,_0x95861a){_0x17eb9d=_0x17eb9d-0x0;var _0x53a1e0=_0x9716[_0x17eb9d];return _0x53a1e0;};'use strict';var _=require('lodash');var util=require(_0x6971('0x0'));var moment=require(_0x6971('0x1'));var BPromise=require(_0x6971('0x2'));var rs=require(_0x6971('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6971('0x4'))['db'];var utils=require(_0x6971('0x5'));var logger=require(_0x6971('0x6'))('rpc');var config=require(_0x6971('0x7'));var jayson=require(_0x6971('0x8'));var client=jayson[_0x6971('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45870d,_0x507a17,_0x301b5c){return new BPromise(function(_0x1eb408,_0x433d41){return client[_0x6971('0xa')](_0x45870d,_0x301b5c)[_0x6971('0xb')](function(_0x5b09db){logger['info'](_0x6971('0xc'),_0x507a17,_0x6971('0xd'));logger[_0x6971('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x507a17,_0x6971('0xd'),JSON[_0x6971('0xf')](_0x5b09db));if(_0x5b09db[_0x6971('0x10')]){if(_0x5b09db['error'][_0x6971('0x11')]===0x1f4){logger[_0x6971('0x10')](_0x6971('0xc'),_0x507a17,_0x5b09db[_0x6971('0x10')][_0x6971('0x12')]);return _0x433d41(_0x5b09db['error']['message']);}logger[_0x6971('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x507a17,_0x5b09db[_0x6971('0x10')][_0x6971('0x12')]);return _0x1eb408(_0x5b09db[_0x6971('0x10')]['message']);}else{logger[_0x6971('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x507a17,_0x6971('0xd'));_0x1eb408(_0x5b09db[_0x6971('0x14')]['message']);}})[_0x6971('0x15')](function(_0x1c89b0){logger[_0x6971('0x10')](_0x6971('0xc'),_0x507a17,_0x1c89b0);_0x433d41(_0x1c89b0);});});} \ No newline at end of file +var _0x63d6=['Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x49e155,_0x37a0c3){var _0x2490e8=function(_0x3f0613){while(--_0x3f0613){_0x49e155['push'](_0x49e155['shift']());}};_0x2490e8(++_0x37a0c3);}(_0x63d6,0x17b));var _0x663d=function(_0x4dcdc0,_0x4f72e6){_0x4dcdc0=_0x4dcdc0-0x0;var _0x3d9aa3=_0x63d6[_0x4dcdc0];return _0x3d9aa3;};'use strict';var _=require(_0x663d('0x0'));var util=require('util');var moment=require(_0x663d('0x1'));var BPromise=require(_0x663d('0x2'));var rs=require(_0x663d('0x3'));var fs=require('fs');var Redis=require(_0x663d('0x4'));var db=require(_0x663d('0x5'))['db'];var utils=require(_0x663d('0x6'));var logger=require(_0x663d('0x7'))(_0x663d('0x8'));var config=require(_0x663d('0x9'));var jayson=require(_0x663d('0xa'));var client=jayson[_0x663d('0xb')][_0x663d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e1223,_0x29b051,_0x4211c9){return new BPromise(function(_0x17f251,_0x5c3de3){return client[_0x663d('0xd')](_0x5e1223,_0x4211c9)['then'](function(_0x343d99){logger[_0x663d('0xe')](_0x663d('0xf'),_0x29b051,_0x663d('0x10'));logger['debug'](_0x663d('0x11'),_0x29b051,_0x663d('0x10'),JSON['stringify'](_0x343d99));if(_0x343d99[_0x663d('0x12')]){if(_0x343d99[_0x663d('0x12')][_0x663d('0x13')]===0x1f4){logger['error'](_0x663d('0xf'),_0x29b051,_0x343d99[_0x663d('0x12')]['message']);return _0x5c3de3(_0x343d99['error'][_0x663d('0x14')]);}logger[_0x663d('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x29b051,_0x343d99['error'][_0x663d('0x14')]);return _0x17f251(_0x343d99[_0x663d('0x12')][_0x663d('0x14')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x29b051,_0x663d('0x10'));_0x17f251(_0x343d99['result']['message']);}})[_0x663d('0x15')](function(_0x221073){logger['error'](_0x663d('0xf'),_0x29b051,_0x221073);_0x5c3de3(_0x221073);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index e7e9bfa..b09a512 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 _0xd5b7=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0xd5b7,0x136));var _0x7d5b=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xd5b7[_0x1d1963];return _0x3f58bb;};'use strict';var multer=require(_0x7d5b('0x0'));var util=require('util');var path=require(_0x7d5b('0x1'));var timeout=require(_0x7d5b('0x2'));var express=require(_0x7d5b('0x3'));var router=express['Router']();var fs_extra=require(_0x7d5b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7d5b('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0x7d5b('0x6')]('/',auth[_0x7d5b('0x7')](),controller[_0x7d5b('0x8')]);router['get'](_0x7d5b('0x9'),auth[_0x7d5b('0x7')](),controller[_0x7d5b('0xa')]);router[_0x7d5b('0x6')](_0x7d5b('0xb'),auth[_0x7d5b('0x7')](),controller['getConfigurations']);router[_0x7d5b('0x6')](_0x7d5b('0xc'),auth[_0x7d5b('0x7')](),controller['getFields']);router[_0x7d5b('0xd')]('/',auth[_0x7d5b('0x7')](),controller[_0x7d5b('0xe')]);router[_0x7d5b('0xd')](_0x7d5b('0xb'),auth[_0x7d5b('0x7')](),controller[_0x7d5b('0xf')]);router[_0x7d5b('0x10')](_0x7d5b('0x9'),auth[_0x7d5b('0x7')](),controller[_0x7d5b('0x11')]);router[_0x7d5b('0x12')](_0x7d5b('0x9'),auth[_0x7d5b('0x7')](),controller[_0x7d5b('0x13')]);module[_0x7d5b('0x14')]=router; \ No newline at end of file +var _0xb67a=['connect-timeout','Router','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','update','delete','destroy','exports','multer','path'];(function(_0x1bba1a,_0xdb4f8b){var _0x4ed799=function(_0x2d523f){while(--_0x2d523f){_0x1bba1a['push'](_0x1bba1a['shift']());}};_0x4ed799(++_0xdb4f8b);}(_0xb67a,0x7c));var _0xab67=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0xb67a[_0x152678];return _0x311a9;};'use strict';var multer=require(_0xab67('0x0'));var util=require('util');var path=require(_0xab67('0x1'));var timeout=require(_0xab67('0x2'));var express=require('express');var router=express[_0xab67('0x3')]();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(_0xab67('0x4'));router[_0xab67('0x5')]('/',auth[_0xab67('0x6')](),controller['index']);router[_0xab67('0x5')](_0xab67('0x7'),auth[_0xab67('0x6')](),controller[_0xab67('0x8')]);router['get'](_0xab67('0x9'),auth[_0xab67('0x6')](),controller[_0xab67('0xa')]);router[_0xab67('0x5')](_0xab67('0xb'),auth[_0xab67('0x6')](),controller[_0xab67('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xab67('0xd')]);router['put'](_0xab67('0x7'),auth[_0xab67('0x6')](),controller[_0xab67('0xe')]);router[_0xab67('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xab67('0x10')]);module[_0xab67('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0138dde..6866a67 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 _0x32b6=['remoteUri','sequelize','exports','STRING'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x32b6,0x1d1));var _0x632b=function(_0x4cf0b6,_0x4ef247){_0x4cf0b6=_0x4cf0b6-0x0;var _0x5f43ef=_0x32b6[_0x4cf0b6];return _0x5f43ef;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x632b('0x2')]},'username':{'type':Sequelize[_0x632b('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x632b('0x2')],'unique':_0x632b('0x3')},'serverUrl':{'type':Sequelize[_0x632b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1bb401,_0x402f3a){var _0x4ac035=function(_0x981f80){while(--_0x981f80){_0x1bb401['push'](_0x1bb401['shift']());}};_0x4ac035(++_0x402f3a);}(_0xd943,0x15d));var _0x3d94=function(_0x3961c4,_0x5335ba){_0x3961c4=_0x3961c4-0x0;var _0x227226=_0xd943[_0x3961c4];return _0x227226;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 8545540..15dad87 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 _0x7b37=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','offset','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','length','options','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','order','hasOwnProperty','addConfiguration','getSubjects','channel','getDescriptions','Subjects','Descriptions','getFields','remoteUri','substring','GET','api/v2/ticket_fields','format','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0x7b37,0xd9));var _0x77b3=function(_0xfb8e9c,_0x4bfaec){_0xfb8e9c=_0xfb8e9c-0x0;var _0x432968=_0x7b37[_0xfb8e9c];return _0x432968;};'use strict';var emlformat=require(_0x77b3('0x0'));var rimraf=require(_0x77b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77b3('0x2'));var rp=require(_0x77b3('0x3'));var moment=require('moment');var BPromise=require(_0x77b3('0x4'));var Mustache=require('mustache');var util=require(_0x77b3('0x5'));var path=require(_0x77b3('0x6'));var sox=require(_0x77b3('0x7'));var csv=require('to-csv');var ejs=require(_0x77b3('0x8'));var fs=require('fs');var fs_extra=require(_0x77b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x77b3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x77b3('0xb'));var toCsv=require(_0x77b3('0xc'));var querystring=require('querystring');var Papa=require(_0x77b3('0xd'));var Redis=require(_0x77b3('0xe'));var authService=require(_0x77b3('0xf'));var qs=require(_0x77b3('0x10'));var as=require(_0x77b3('0x11'));var hardwareService=require(_0x77b3('0x12'));var logger=require(_0x77b3('0x13'))(_0x77b3('0x14'));var utils=require(_0x77b3('0x15'));var config=require(_0x77b3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x77b3('0x17'))['db'];var integrations=require(_0x77b3('0x18'));function respondWithStatusCode(_0x804b7,_0x16692f){_0x16692f=_0x16692f||0xcc;return function(_0x3ee308){if(_0x3ee308){return _0x804b7[_0x77b3('0x19')](_0x16692f);}return _0x804b7[_0x77b3('0x1a')](_0x16692f)[_0x77b3('0x1b')]();};}function respondWithResult(_0x9bdb6d,_0x28a47d){_0x28a47d=_0x28a47d||0xc8;return function(_0x34b73d){if(_0x34b73d){return _0x9bdb6d[_0x77b3('0x1a')](_0x28a47d)['json'](_0x34b73d);}};}function respondWithFilteredResult(_0x2fc377,_0x471afa){return function(_0x1c995c){if(_0x1c995c){var _0x442bb8=typeof _0x471afa['offset']===_0x77b3('0x1c')&&typeof _0x471afa['limit']==='undefined';var _0x902ba7=_0x1c995c[_0x77b3('0x1d')];var _0x16e1fd=_0x442bb8?0x0:_0x471afa[_0x77b3('0x1e')];var _0x52d3ea=_0x442bb8?_0x1c995c[_0x77b3('0x1d')]:_0x471afa['offset']+_0x471afa['limit'];var _0xb3d794;if(_0x52d3ea>=_0x902ba7){_0x52d3ea=_0x902ba7;_0xb3d794=0xc8;}else{_0xb3d794=0xce;}_0x2fc377[_0x77b3('0x1a')](_0xb3d794);return _0x2fc377[_0x77b3('0x1f')]('Content-Range',_0x16e1fd+'-'+_0x52d3ea+'/'+_0x902ba7)[_0x77b3('0x20')](_0x1c995c);}return null;};}function patchUpdates(_0x2c545a){return function(_0x9f5f36){try{jsonpatch[_0x77b3('0x21')](_0x9f5f36,_0x2c545a,!![]);}catch(_0x34366c){return BPromise[_0x77b3('0x22')](_0x34366c);}return _0x9f5f36[_0x77b3('0x23')]();};}function saveUpdates(_0x17d739,_0x3e3eea){return function(_0x29e5ce){if(_0x29e5ce){return _0x29e5ce['update'](_0x17d739)[_0x77b3('0x24')](function(_0x5d7ec8){return _0x5d7ec8;});}return null;};}function removeEntity(_0x233886,_0x54dcd7){return function(_0x297e68){if(_0x297e68){return _0x297e68[_0x77b3('0x25')]()[_0x77b3('0x24')](function(){_0x233886[_0x77b3('0x1a')](0xcc)[_0x77b3('0x1b')]();});}};}function handleEntityNotFound(_0x5799c3,_0x575d28){return function(_0x390b56){if(!_0x390b56){_0x5799c3[_0x77b3('0x19')](0x194);}return _0x390b56;};}function handleError(_0x25dc3a,_0x49155b){_0x49155b=_0x49155b||0x1f4;return function(_0x20becf){logger[_0x77b3('0x26')](_0x20becf[_0x77b3('0x27')]);if(_0x20becf[_0x77b3('0x28')]){delete _0x20becf[_0x77b3('0x28')];}_0x25dc3a[_0x77b3('0x1a')](_0x49155b)['send'](_0x20becf);};}exports[_0x77b3('0x29')]=function(_0xc7ecfe,_0x5a8d78){var _0x5e8d7a={},_0x376bcf={},_0x460813={'count':0x0,'rows':[]};var _0x197858=_[_0x77b3('0x2a')](db[_0x77b3('0x2b')][_0x77b3('0x2c')],function(_0x3ff4ea){return{'name':_0x3ff4ea[_0x77b3('0x2d')],'type':_0x3ff4ea[_0x77b3('0x2e')][_0x77b3('0x2f')]};});_0x376bcf['model']=_['map'](_0x197858,_0x77b3('0x28'));_0x376bcf[_0x77b3('0x30')]=_['keys'](_0xc7ecfe[_0x77b3('0x30')]);_0x376bcf[_0x77b3('0x31')]=_[_0x77b3('0x32')](_0x376bcf[_0x77b3('0x33')],_0x376bcf['query']);_0x5e8d7a[_0x77b3('0x34')]=_[_0x77b3('0x32')](_0x376bcf[_0x77b3('0x33')],qs[_0x77b3('0x35')](_0xc7ecfe[_0x77b3('0x30')][_0x77b3('0x35')]));_0x5e8d7a[_0x77b3('0x34')]=_0x5e8d7a['attributes']['length']?_0x5e8d7a[_0x77b3('0x34')]:_0x376bcf['model'];if(!_0xc7ecfe['query']['hasOwnProperty'](_0x77b3('0x36'))){_0x5e8d7a[_0x77b3('0x37')]=qs[_0x77b3('0x37')](_0xc7ecfe[_0x77b3('0x30')]['limit']);_0x5e8d7a[_0x77b3('0x1e')]=qs[_0x77b3('0x1e')](_0xc7ecfe[_0x77b3('0x30')][_0x77b3('0x1e')]);}_0x5e8d7a['order']=qs[_0x77b3('0x38')](_0xc7ecfe[_0x77b3('0x30')]['sort']);_0x5e8d7a['where']=qs[_0x77b3('0x31')](_[_0x77b3('0x39')](_0xc7ecfe['query'],_0x376bcf[_0x77b3('0x31')]),_0x197858);if(_0xc7ecfe['query'][_0x77b3('0x3a')]){_0x5e8d7a[_0x77b3('0x3b')]=_[_0x77b3('0x3c')](_0x5e8d7a['where'],{'$or':_[_0x77b3('0x2a')](_0x197858,function(_0x5547c6){if(_0x5547c6[_0x77b3('0x2e')]!==_0x77b3('0x3d')){var _0x4cd1e7={};_0x4cd1e7[_0x5547c6[_0x77b3('0x28')]]={'$like':'%'+_0xc7ecfe[_0x77b3('0x30')]['filter']+'%'};return _0x4cd1e7;}})});}_0x5e8d7a=_[_0x77b3('0x3c')]({},_0x5e8d7a,_0xc7ecfe['options']);var _0x257c30={'where':_0x5e8d7a[_0x77b3('0x3b')]};return db[_0x77b3('0x2b')][_0x77b3('0x1d')](_0x257c30)[_0x77b3('0x24')](function(_0x47085f){_0x460813['count']=_0x47085f;if(_0xc7ecfe[_0x77b3('0x30')][_0x77b3('0x3e')]){_0x5e8d7a[_0x77b3('0x3f')]=[{'all':!![]}];}return db[_0x77b3('0x2b')][_0x77b3('0x40')](_0x5e8d7a);})[_0x77b3('0x24')](function(_0x4a6571){_0x460813[_0x77b3('0x41')]=_0x4a6571;return _0x460813;})[_0x77b3('0x24')](respondWithFilteredResult(_0x5a8d78,_0x5e8d7a))[_0x77b3('0x42')](handleError(_0x5a8d78,null));};exports['show']=function(_0xed63ae,_0x48a5c3){var _0x11774f={'raw':![],'where':{'id':_0xed63ae[_0x77b3('0x43')]['id']}},_0x5d0faa={};_0x5d0faa[_0x77b3('0x33')]=_[_0x77b3('0x44')](db[_0x77b3('0x2b')]['rawAttributes']);_0x5d0faa[_0x77b3('0x30')]=_[_0x77b3('0x44')](_0xed63ae[_0x77b3('0x30')]);_0x5d0faa[_0x77b3('0x31')]=_['intersection'](_0x5d0faa[_0x77b3('0x33')],_0x5d0faa['query']);_0x11774f['attributes']=_[_0x77b3('0x32')](_0x5d0faa[_0x77b3('0x33')],qs[_0x77b3('0x35')](_0xed63ae[_0x77b3('0x30')][_0x77b3('0x35')]));_0x11774f[_0x77b3('0x34')]=_0x11774f[_0x77b3('0x34')][_0x77b3('0x45')]?_0x11774f['attributes']:_0x5d0faa[_0x77b3('0x33')];if(_0xed63ae[_0x77b3('0x30')][_0x77b3('0x3e')]){_0x11774f['include']=[{'all':!![]}];}_0x11774f=_[_0x77b3('0x3c')]({},_0x11774f,_0xed63ae[_0x77b3('0x46')]);return db[_0x77b3('0x2b')][_0x77b3('0x47')](_0x11774f)[_0x77b3('0x24')](handleEntityNotFound(_0x48a5c3,null))[_0x77b3('0x24')](respondWithResult(_0x48a5c3,null))[_0x77b3('0x42')](handleError(_0x48a5c3,null));};exports[_0x77b3('0x48')]=function(_0x2d74d7,_0x498817){return db[_0x77b3('0x2b')][_0x77b3('0x48')](_0x2d74d7[_0x77b3('0x49')],{})[_0x77b3('0x24')](respondWithResult(_0x498817,0xc9))[_0x77b3('0x42')](handleError(_0x498817,null));};exports[_0x77b3('0x4a')]=function(_0x52a6ea,_0x23b55b){if(_0x52a6ea[_0x77b3('0x49')]['id']){delete _0x52a6ea[_0x77b3('0x49')]['id'];}return db[_0x77b3('0x2b')][_0x77b3('0x47')]({'where':{'id':_0x52a6ea[_0x77b3('0x43')]['id']}})[_0x77b3('0x24')](handleEntityNotFound(_0x23b55b,null))[_0x77b3('0x24')](saveUpdates(_0x52a6ea['body'],null))[_0x77b3('0x24')](respondWithResult(_0x23b55b,null))[_0x77b3('0x42')](handleError(_0x23b55b,null));};exports[_0x77b3('0x25')]=function(_0x1ea478,_0x3e20ee){return db[_0x77b3('0x2b')][_0x77b3('0x47')]({'where':{'id':_0x1ea478[_0x77b3('0x43')]['id']}})[_0x77b3('0x24')](handleEntityNotFound(_0x3e20ee,null))[_0x77b3('0x24')](removeEntity(_0x3e20ee,null))[_0x77b3('0x42')](handleError(_0x3e20ee,null));};exports[_0x77b3('0x4b')]=function(_0x188dbf,_0x1f0481,_0x29108b){var _0x1dcad7={};var _0x592947={};var _0x5db561;var _0x142aff;return db[_0x77b3('0x2b')][_0x77b3('0x4c')]({'where':{'id':_0x188dbf[_0x77b3('0x43')]['id']}})[_0x77b3('0x24')](handleEntityNotFound(_0x1f0481,null))[_0x77b3('0x24')](function(_0x5e3af0){if(_0x5e3af0){_0x5db561=_0x5e3af0;_0x592947[_0x77b3('0x33')]=_[_0x77b3('0x44')](db[_0x77b3('0x4d')]['rawAttributes']);_0x592947[_0x77b3('0x30')]=_[_0x77b3('0x44')](_0x188dbf[_0x77b3('0x30')]);_0x592947[_0x77b3('0x31')]=_[_0x77b3('0x32')](_0x592947['model'],_0x592947[_0x77b3('0x30')]);_0x1dcad7[_0x77b3('0x34')]=_[_0x77b3('0x32')](_0x592947[_0x77b3('0x33')],qs[_0x77b3('0x35')](_0x188dbf[_0x77b3('0x30')][_0x77b3('0x35')]));_0x1dcad7[_0x77b3('0x34')]=_0x1dcad7[_0x77b3('0x34')][_0x77b3('0x45')]?_0x1dcad7[_0x77b3('0x34')]:_0x592947[_0x77b3('0x33')];_0x1dcad7[_0x77b3('0x4e')]=qs[_0x77b3('0x38')](_0x188dbf['query']['sort']);_0x1dcad7[_0x77b3('0x3b')]=qs[_0x77b3('0x31')](_[_0x77b3('0x39')](_0x188dbf[_0x77b3('0x30')],_0x592947[_0x77b3('0x31')]));if(_0x188dbf['query'][_0x77b3('0x3a')]){_0x1dcad7['where']=_[_0x77b3('0x3c')](_0x1dcad7['where'],{'$or':_[_0x77b3('0x2a')](_0x1dcad7[_0x77b3('0x34')],function(_0x73f8f8){var _0x1b5729={};_0x1b5729[_0x73f8f8]={'$like':'%'+_0x188dbf[_0x77b3('0x30')][_0x77b3('0x3a')]+'%'};return _0x1b5729;})});}_0x1dcad7=_[_0x77b3('0x3c')]({},_0x1dcad7,_0x188dbf[_0x77b3('0x46')]);return _0x5db561[_0x77b3('0x4b')](_0x1dcad7);}})['then'](function(_0x4f4c97){if(_0x4f4c97){_0x142aff=_0x4f4c97[_0x77b3('0x45')];if(!_0x188dbf[_0x77b3('0x30')][_0x77b3('0x4f')]('nolimit')){_0x1dcad7[_0x77b3('0x37')]=qs[_0x77b3('0x37')](_0x188dbf[_0x77b3('0x30')]['limit']);_0x1dcad7[_0x77b3('0x1e')]=qs['offset'](_0x188dbf[_0x77b3('0x30')][_0x77b3('0x1e')]);}return _0x5db561['getConfigurations'](_0x1dcad7);}})[_0x77b3('0x24')](function(_0x4b177d){if(_0x4b177d){return _0x4b177d?{'count':_0x142aff,'rows':_0x4b177d}:null;}})[_0x77b3('0x24')](respondWithResult(_0x1f0481,null))[_0x77b3('0x42')](handleError(_0x1f0481,null));};exports[_0x77b3('0x50')]=function(_0x13c226,_0x311457,_0x23aa24){if(_0x13c226['body']['id']){delete _0x13c226[_0x77b3('0x49')]['id'];}return db[_0x77b3('0x2b')][_0x77b3('0x4c')]({'where':{'id':_0x13c226[_0x77b3('0x43')]['id']}})['then'](handleEntityNotFound(_0x311457,null))['then'](function(_0x1ef64c){if(_0x1ef64c){_0x13c226['body']['AccountId']=_0x1ef64c['id'];_0x13c226[_0x77b3('0x49')]['Subjects']=integrations[_0x77b3('0x51')](_0x13c226['body'][_0x77b3('0x52')],_0x13c226[_0x77b3('0x49')][_0x77b3('0x2e')]);_0x13c226[_0x77b3('0x49')]['Descriptions']=integrations[_0x77b3('0x53')](_0x13c226[_0x77b3('0x49')][_0x77b3('0x52')],_0x13c226[_0x77b3('0x49')][_0x77b3('0x2e')]);return db[_0x77b3('0x4d')][_0x77b3('0x48')](_0x13c226['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x77b3('0x54')},{'model':db['FreshdeskField'],'as':_0x77b3('0x55')}]});}return null;})['then'](respondWithResult(_0x311457,null))[_0x77b3('0x42')](handleError(_0x311457,null));};exports[_0x77b3('0x56')]=function(_0x338f06,_0x4bd321,_0x477a1c){var _0x30bbb0='';return db[_0x77b3('0x2b')][_0x77b3('0x4c')]({'where':{'id':_0x338f06[_0x77b3('0x43')]['id']},'attributes':['id',_0x77b3('0x57'),'apiKey']})[_0x77b3('0x24')](handleEntityNotFound(_0x4bd321,null))[_0x77b3('0x24')](function(_0x5dd9d0){if(_0x5dd9d0){_0x30bbb0=_0x5dd9d0['remoteUri'];var _0x490957=_0x30bbb0['slice'](-0x1);if(_0x490957==='/'){_0x30bbb0=_0x30bbb0[_0x77b3('0x58')](0x0,_0x30bbb0['lastIndexOf'](_0x490957));}return rp({'method':_0x77b3('0x59'),'uri':util['format']('%s/%s',_0x30bbb0,_0x77b3('0x5a')),'headers':{'Authorization':util[_0x77b3('0x5b')](_0x77b3('0x5c'),new Buffer(util[_0x77b3('0x5b')]('%s:X',_0x5dd9d0[_0x77b3('0x5d')]))[_0x77b3('0x5e')](_0x77b3('0x5f')))},'json':!![]});}})[_0x77b3('0x24')](function(_0xfa35c5){if(_0xfa35c5){var _0x66314b=[_0x77b3('0x60'),_0x77b3('0x61'),_0x77b3('0x62'),_0x77b3('0x63'),_0x77b3('0x1a'),_0x77b3('0x64'),_0x77b3('0x65'),_0x77b3('0x66'),_0x77b3('0x67'),_0x77b3('0x65'),'company'];_['remove'](_0xfa35c5,function(_0x1020d6){return _0x66314b['includes'](_0x1020d6['name'])||!_0x1020d6[_0x77b3('0x68')]&&_0x1020d6[_0x77b3('0x2e')]!==_0x77b3('0x69')&&_0x1020d6[_0x77b3('0x2e')]!==_0x77b3('0x6a');});return{'count':_0xfa35c5[_0x77b3('0x45')],'rows':_[_0x77b3('0x2a')](_0xfa35c5,function(_0x573bc2){return{'id':_0x573bc2[_0x77b3('0x28')],'name':_0x573bc2[_0x77b3('0x6b')],'custom':!_0x573bc2[_0x77b3('0x68')],'options':_0x573bc2[_0x77b3('0x6c')]?_['map'](_0x573bc2[_0x77b3('0x6c')],function(_0x3a9285){return{'name':_[_0x77b3('0x6d')](_0x3a9285),'value':_0x3a9285};}):[]};})};}})[_0x77b3('0x24')](respondWithResult(_0x4bd321,null))['catch'](function(_0x365500){var _0x259b0c=_0x338f06[_0x77b3('0x30')][_0x77b3('0x6e')]?0x1f4:_0x365500[_0x77b3('0x6f')]||0x1f4;logger[_0x77b3('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x77b3('0x56'),_0x259b0c,JSON[_0x77b3('0x70')](_0x365500));delete _0x365500[_0x77b3('0x28')];if(_0x259b0c===0x191){_0x259b0c=0x190;}_0x4bd321[_0x77b3('0x1a')](_0x259b0c)[_0x77b3('0x71')](_0x338f06[_0x77b3('0x30')]['test']?{'message':_0x77b3('0x72'),'statusCode':_0x365500[_0x77b3('0x6f')]}:_0x365500);});}; \ No newline at end of file +var _0xf972=['AccountId','Subjects','channel','type','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','%s:X','toString','base64','requester','subject','agent','priority','group','ticket_type','company','remove','includes','default','custom_text','statusCode','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','set','apply','reject','update','then','destroy','end','error','stack','send','index','FreshdeskAccount','fieldName','key','map','name','query','keys','filters','intersection','model','fields','attributes','length','limit','order','sort','pick','filter','merge','where','options','includeAll','include','rows','catch','params','rawAttributes','find','body','getConfigurations','findOne','hasOwnProperty','nolimit','addConfiguration'];(function(_0x11229d,_0x27bb96){var _0x5e921a=function(_0x3d1f8b){while(--_0x3d1f8b){_0x11229d['push'](_0x11229d['shift']());}};_0x5e921a(++_0x27bb96);}(_0xf972,0x171));var _0x2f97=function(_0xd3d360,_0x3f9f3d){_0xd3d360=_0xd3d360-0x0;var _0x14b446=_0xf972[_0xd3d360];return _0x14b446;};'use strict';var emlformat=require(_0x2f97('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f97('0x1'));var jsonpatch=require(_0x2f97('0x2'));var rp=require(_0x2f97('0x3'));var moment=require('moment');var BPromise=require(_0x2f97('0x4'));var Mustache=require(_0x2f97('0x5'));var util=require('util');var path=require(_0x2f97('0x6'));var sox=require(_0x2f97('0x7'));var csv=require(_0x2f97('0x8'));var ejs=require(_0x2f97('0x9'));var fs=require('fs');var fs_extra=require(_0x2f97('0xa'));var _=require(_0x2f97('0xb'));var squel=require(_0x2f97('0xc'));var crypto=require(_0x2f97('0xd'));var jsforce=require(_0x2f97('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f97('0xf'));var Papa=require(_0x2f97('0x10'));var Redis=require(_0x2f97('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2f97('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f97('0x13'))(_0x2f97('0x14'));var utils=require(_0x2f97('0x15'));var config=require(_0x2f97('0x16'));var licenseUtil=require(_0x2f97('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2f97('0x18'));function respondWithStatusCode(_0x2c3c6b,_0x417c8f){_0x417c8f=_0x417c8f||0xcc;return function(_0x277cf1){if(_0x277cf1){return _0x2c3c6b[_0x2f97('0x19')](_0x417c8f);}return _0x2c3c6b[_0x2f97('0x1a')](_0x417c8f)['end']();};}function respondWithResult(_0x5559b8,_0x317314){_0x317314=_0x317314||0xc8;return function(_0x37c2ed){if(_0x37c2ed){return _0x5559b8[_0x2f97('0x1a')](_0x317314)['json'](_0x37c2ed);}};}function respondWithFilteredResult(_0x1de2b7,_0x17df46){return function(_0x2ffb8b){if(_0x2ffb8b){var _0x43bfd9=typeof _0x17df46[_0x2f97('0x1b')]===_0x2f97('0x1c')&&typeof _0x17df46['limit']===_0x2f97('0x1c');var _0x3dd773=_0x2ffb8b[_0x2f97('0x1d')];var _0x4f6bb1=_0x43bfd9?0x0:_0x17df46['offset'];var _0x52d36e=_0x43bfd9?_0x2ffb8b[_0x2f97('0x1d')]:_0x17df46[_0x2f97('0x1b')]+_0x17df46['limit'];var _0x1db3af;if(_0x52d36e>=_0x3dd773){_0x52d36e=_0x3dd773;_0x1db3af=0xc8;}else{_0x1db3af=0xce;}_0x1de2b7['status'](_0x1db3af);return _0x1de2b7[_0x2f97('0x1e')]('Content-Range',_0x4f6bb1+'-'+_0x52d36e+'/'+_0x3dd773)['json'](_0x2ffb8b);}return null;};}function patchUpdates(_0x29e4a4){return function(_0x1fe500){try{jsonpatch[_0x2f97('0x1f')](_0x1fe500,_0x29e4a4,!![]);}catch(_0x5aebf0){return BPromise[_0x2f97('0x20')](_0x5aebf0);}return _0x1fe500['save']();};}function saveUpdates(_0x39a332,_0x55cef3){return function(_0x239a92){if(_0x239a92){return _0x239a92[_0x2f97('0x21')](_0x39a332)[_0x2f97('0x22')](function(_0x58941a){return _0x58941a;});}return null;};}function removeEntity(_0x5ac20c,_0x10c1c1){return function(_0x20a1d1){if(_0x20a1d1){return _0x20a1d1[_0x2f97('0x23')]()[_0x2f97('0x22')](function(){_0x5ac20c[_0x2f97('0x1a')](0xcc)[_0x2f97('0x24')]();});}};}function handleEntityNotFound(_0x1bad85,_0x21d9d0){return function(_0x2fb36c){if(!_0x2fb36c){_0x1bad85[_0x2f97('0x19')](0x194);}return _0x2fb36c;};}function handleError(_0x1c08d5,_0x4a037d){_0x4a037d=_0x4a037d||0x1f4;return function(_0x3e098b){logger[_0x2f97('0x25')](_0x3e098b[_0x2f97('0x26')]);if(_0x3e098b['name']){delete _0x3e098b['name'];}_0x1c08d5['status'](_0x4a037d)[_0x2f97('0x27')](_0x3e098b);};}exports[_0x2f97('0x28')]=function(_0xa136bf,_0x56cb81){var _0x480e26={},_0x590161={},_0x592baf={'count':0x0,'rows':[]};var _0x21a306=_['map'](db[_0x2f97('0x29')]['rawAttributes'],function(_0x3f4ac8){return{'name':_0x3f4ac8[_0x2f97('0x2a')],'type':_0x3f4ac8['type'][_0x2f97('0x2b')]};});_0x590161['model']=_[_0x2f97('0x2c')](_0x21a306,_0x2f97('0x2d'));_0x590161[_0x2f97('0x2e')]=_[_0x2f97('0x2f')](_0xa136bf['query']);_0x590161[_0x2f97('0x30')]=_[_0x2f97('0x31')](_0x590161['model'],_0x590161[_0x2f97('0x2e')]);_0x480e26['attributes']=_['intersection'](_0x590161[_0x2f97('0x32')],qs[_0x2f97('0x33')](_0xa136bf[_0x2f97('0x2e')][_0x2f97('0x33')]));_0x480e26['attributes']=_0x480e26[_0x2f97('0x34')][_0x2f97('0x35')]?_0x480e26[_0x2f97('0x34')]:_0x590161[_0x2f97('0x32')];if(!_0xa136bf[_0x2f97('0x2e')]['hasOwnProperty']('nolimit')){_0x480e26[_0x2f97('0x36')]=qs[_0x2f97('0x36')](_0xa136bf[_0x2f97('0x2e')][_0x2f97('0x36')]);_0x480e26[_0x2f97('0x1b')]=qs[_0x2f97('0x1b')](_0xa136bf[_0x2f97('0x2e')][_0x2f97('0x1b')]);}_0x480e26[_0x2f97('0x37')]=qs['sort'](_0xa136bf[_0x2f97('0x2e')][_0x2f97('0x38')]);_0x480e26['where']=qs[_0x2f97('0x30')](_[_0x2f97('0x39')](_0xa136bf[_0x2f97('0x2e')],_0x590161[_0x2f97('0x30')]),_0x21a306);if(_0xa136bf[_0x2f97('0x2e')][_0x2f97('0x3a')]){_0x480e26['where']=_[_0x2f97('0x3b')](_0x480e26[_0x2f97('0x3c')],{'$or':_[_0x2f97('0x2c')](_0x21a306,function(_0x5f1e7e){if(_0x5f1e7e['type']!=='VIRTUAL'){var _0x1abad9={};_0x1abad9[_0x5f1e7e[_0x2f97('0x2d')]]={'$like':'%'+_0xa136bf['query'][_0x2f97('0x3a')]+'%'};return _0x1abad9;}})});}_0x480e26=_[_0x2f97('0x3b')]({},_0x480e26,_0xa136bf[_0x2f97('0x3d')]);var _0x59792c={'where':_0x480e26[_0x2f97('0x3c')]};return db[_0x2f97('0x29')][_0x2f97('0x1d')](_0x59792c)[_0x2f97('0x22')](function(_0x539018){_0x592baf['count']=_0x539018;if(_0xa136bf[_0x2f97('0x2e')][_0x2f97('0x3e')]){_0x480e26[_0x2f97('0x3f')]=[{'all':!![]}];}return db[_0x2f97('0x29')]['findAll'](_0x480e26);})[_0x2f97('0x22')](function(_0x1c828e){_0x592baf[_0x2f97('0x40')]=_0x1c828e;return _0x592baf;})['then'](respondWithFilteredResult(_0x56cb81,_0x480e26))[_0x2f97('0x41')](handleError(_0x56cb81,null));};exports['show']=function(_0x386963,_0x390ae2){var _0xae4436={'raw':![],'where':{'id':_0x386963[_0x2f97('0x42')]['id']}},_0x4dadad={};_0x4dadad[_0x2f97('0x32')]=_['keys'](db[_0x2f97('0x29')][_0x2f97('0x43')]);_0x4dadad[_0x2f97('0x2e')]=_[_0x2f97('0x2f')](_0x386963[_0x2f97('0x2e')]);_0x4dadad[_0x2f97('0x30')]=_['intersection'](_0x4dadad[_0x2f97('0x32')],_0x4dadad[_0x2f97('0x2e')]);_0xae4436['attributes']=_[_0x2f97('0x31')](_0x4dadad[_0x2f97('0x32')],qs[_0x2f97('0x33')](_0x386963[_0x2f97('0x2e')][_0x2f97('0x33')]));_0xae4436[_0x2f97('0x34')]=_0xae4436['attributes'][_0x2f97('0x35')]?_0xae4436['attributes']:_0x4dadad[_0x2f97('0x32')];if(_0x386963['query'][_0x2f97('0x3e')]){_0xae4436[_0x2f97('0x3f')]=[{'all':!![]}];}_0xae4436=_[_0x2f97('0x3b')]({},_0xae4436,_0x386963[_0x2f97('0x3d')]);return db['FreshdeskAccount'][_0x2f97('0x44')](_0xae4436)[_0x2f97('0x22')](handleEntityNotFound(_0x390ae2,null))['then'](respondWithResult(_0x390ae2,null))['catch'](handleError(_0x390ae2,null));};exports['create']=function(_0x4a1417,_0x22e616){return db[_0x2f97('0x29')]['create'](_0x4a1417['body'],{})['then'](respondWithResult(_0x22e616,0xc9))[_0x2f97('0x41')](handleError(_0x22e616,null));};exports[_0x2f97('0x21')]=function(_0x3f861c,_0x5637c1){if(_0x3f861c[_0x2f97('0x45')]['id']){delete _0x3f861c[_0x2f97('0x45')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x3f861c[_0x2f97('0x42')]['id']}})['then'](handleEntityNotFound(_0x5637c1,null))['then'](saveUpdates(_0x3f861c['body'],null))['then'](respondWithResult(_0x5637c1,null))[_0x2f97('0x41')](handleError(_0x5637c1,null));};exports[_0x2f97('0x23')]=function(_0x8b24b5,_0x4131af){return db[_0x2f97('0x29')]['find']({'where':{'id':_0x8b24b5['params']['id']}})['then'](handleEntityNotFound(_0x4131af,null))[_0x2f97('0x22')](removeEntity(_0x4131af,null))[_0x2f97('0x41')](handleError(_0x4131af,null));};exports[_0x2f97('0x46')]=function(_0x224bcd,_0x457ef3,_0x3db1b6){var _0x6daec5={};var _0x7d3c3c={};var _0x1806f2;var _0x54c2a4;return db[_0x2f97('0x29')][_0x2f97('0x47')]({'where':{'id':_0x224bcd[_0x2f97('0x42')]['id']}})[_0x2f97('0x22')](handleEntityNotFound(_0x457ef3,null))[_0x2f97('0x22')](function(_0xf4c50e){if(_0xf4c50e){_0x1806f2=_0xf4c50e;_0x7d3c3c[_0x2f97('0x32')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x7d3c3c[_0x2f97('0x2e')]=_[_0x2f97('0x2f')](_0x224bcd[_0x2f97('0x2e')]);_0x7d3c3c['filters']=_[_0x2f97('0x31')](_0x7d3c3c[_0x2f97('0x32')],_0x7d3c3c[_0x2f97('0x2e')]);_0x6daec5[_0x2f97('0x34')]=_[_0x2f97('0x31')](_0x7d3c3c[_0x2f97('0x32')],qs[_0x2f97('0x33')](_0x224bcd['query'][_0x2f97('0x33')]));_0x6daec5[_0x2f97('0x34')]=_0x6daec5[_0x2f97('0x34')][_0x2f97('0x35')]?_0x6daec5[_0x2f97('0x34')]:_0x7d3c3c[_0x2f97('0x32')];_0x6daec5[_0x2f97('0x37')]=qs[_0x2f97('0x38')](_0x224bcd['query']['sort']);_0x6daec5['where']=qs[_0x2f97('0x30')](_[_0x2f97('0x39')](_0x224bcd[_0x2f97('0x2e')],_0x7d3c3c[_0x2f97('0x30')]));if(_0x224bcd[_0x2f97('0x2e')][_0x2f97('0x3a')]){_0x6daec5[_0x2f97('0x3c')]=_[_0x2f97('0x3b')](_0x6daec5['where'],{'$or':_[_0x2f97('0x2c')](_0x6daec5['attributes'],function(_0x14e8ae){var _0xd6abdd={};_0xd6abdd[_0x14e8ae]={'$like':'%'+_0x224bcd['query']['filter']+'%'};return _0xd6abdd;})});}_0x6daec5=_[_0x2f97('0x3b')]({},_0x6daec5,_0x224bcd[_0x2f97('0x3d')]);return _0x1806f2[_0x2f97('0x46')](_0x6daec5);}})[_0x2f97('0x22')](function(_0x584617){if(_0x584617){_0x54c2a4=_0x584617[_0x2f97('0x35')];if(!_0x224bcd[_0x2f97('0x2e')][_0x2f97('0x48')](_0x2f97('0x49'))){_0x6daec5[_0x2f97('0x36')]=qs[_0x2f97('0x36')](_0x224bcd[_0x2f97('0x2e')][_0x2f97('0x36')]);_0x6daec5['offset']=qs[_0x2f97('0x1b')](_0x224bcd[_0x2f97('0x2e')]['offset']);}return _0x1806f2['getConfigurations'](_0x6daec5);}})['then'](function(_0x1d5fce){if(_0x1d5fce){return _0x1d5fce?{'count':_0x54c2a4,'rows':_0x1d5fce}:null;}})['then'](respondWithResult(_0x457ef3,null))['catch'](handleError(_0x457ef3,null));};exports[_0x2f97('0x4a')]=function(_0x460228,_0x95e156,_0x541481){if(_0x460228[_0x2f97('0x45')]['id']){delete _0x460228['body']['id'];}return db[_0x2f97('0x29')]['findOne']({'where':{'id':_0x460228[_0x2f97('0x42')]['id']}})[_0x2f97('0x22')](handleEntityNotFound(_0x95e156,null))[_0x2f97('0x22')](function(_0x3fe423){if(_0x3fe423){_0x460228['body'][_0x2f97('0x4b')]=_0x3fe423['id'];_0x460228['body'][_0x2f97('0x4c')]=integrations['getSubjects'](_0x460228['body'][_0x2f97('0x4d')],_0x460228[_0x2f97('0x45')][_0x2f97('0x4e')]);_0x460228[_0x2f97('0x45')][_0x2f97('0x4f')]=integrations[_0x2f97('0x50')](_0x460228['body'][_0x2f97('0x4d')],_0x460228['body'][_0x2f97('0x4e')]);return db[_0x2f97('0x51')]['create'](_0x460228['body'],{'include':[{'model':db[_0x2f97('0x52')],'as':_0x2f97('0x4c')},{'model':db[_0x2f97('0x52')],'as':_0x2f97('0x4f')}]});}return null;})[_0x2f97('0x22')](respondWithResult(_0x95e156,null))[_0x2f97('0x41')](handleError(_0x95e156,null));};exports[_0x2f97('0x53')]=function(_0x133009,_0x4bb3d2,_0x487ebe){var _0x5da7e5='';return db['FreshdeskAccount'][_0x2f97('0x47')]({'where':{'id':_0x133009['params']['id']},'attributes':['id',_0x2f97('0x54'),_0x2f97('0x55')]})['then'](handleEntityNotFound(_0x4bb3d2,null))[_0x2f97('0x22')](function(_0x2e29a3){if(_0x2e29a3){_0x5da7e5=_0x2e29a3[_0x2f97('0x54')];var _0x3a27a2=_0x5da7e5[_0x2f97('0x56')](-0x1);if(_0x3a27a2==='/'){_0x5da7e5=_0x5da7e5[_0x2f97('0x57')](0x0,_0x5da7e5[_0x2f97('0x58')](_0x3a27a2));}return rp({'method':_0x2f97('0x59'),'uri':util['format'](_0x2f97('0x5a'),_0x5da7e5,_0x2f97('0x5b')),'headers':{'Authorization':util[_0x2f97('0x5c')]('Basic\x20%s',new Buffer(util[_0x2f97('0x5c')](_0x2f97('0x5d'),_0x2e29a3['apiKey']))[_0x2f97('0x5e')](_0x2f97('0x5f')))},'json':!![]});}})[_0x2f97('0x22')](function(_0x3f34fe){if(_0x3f34fe){var _0x5bc007=[_0x2f97('0x60'),_0x2f97('0x61'),_0x2f97('0x62'),'description',_0x2f97('0x1a'),_0x2f97('0x63'),_0x2f97('0x64'),'source',_0x2f97('0x65'),_0x2f97('0x64'),_0x2f97('0x66')];_[_0x2f97('0x67')](_0x3f34fe,function(_0x2ff8d7){return _0x5bc007[_0x2f97('0x68')](_0x2ff8d7[_0x2f97('0x2d')])||!_0x2ff8d7[_0x2f97('0x69')]&&_0x2ff8d7['type']!==_0x2f97('0x6a')&&_0x2ff8d7[_0x2f97('0x4e')]!=='custom_dropdown';});return{'count':_0x3f34fe[_0x2f97('0x35')],'rows':_['map'](_0x3f34fe,function(_0x3c0c8b){return{'id':_0x3c0c8b[_0x2f97('0x2d')],'name':_0x3c0c8b['label'],'custom':!_0x3c0c8b['default'],'options':_0x3c0c8b['choices']?_['map'](_0x3c0c8b['choices'],function(_0x475723){return{'name':_['capitalize'](_0x475723),'value':_0x475723};}):[]};})};}})[_0x2f97('0x22')](respondWithResult(_0x4bb3d2,null))['catch'](function(_0x16931b){var _0xfde4ed=_0x133009['query']['test']?0x1f4:_0x16931b[_0x2f97('0x6b')]||0x1f4;logger[_0x2f97('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x2f97('0x53'),_0xfde4ed,JSON[_0x2f97('0x6c')](_0x16931b));delete _0x16931b[_0x2f97('0x2d')];if(_0xfde4ed===0x191){_0xfde4ed=0x190;}_0x4bb3d2[_0x2f97('0x1a')](_0xfde4ed)['send'](_0x133009['query'][_0x2f97('0x6d')]?{'message':_0x2f97('0x6e'),'statusCode':_0x16931b[_0x2f97('0x6b')]}:_0x16931b);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5bdef9b..766c507 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 _0xa6d7=['moment','request-promise','path','rimraf','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api'];(function(_0x1793be,_0x154787){var _0x1cdd5a=function(_0x3c7b89){while(--_0x3c7b89){_0x1793be['push'](_0x1793be['shift']());}};_0x1cdd5a(++_0x154787);}(_0xa6d7,0x194));var _0x7a6d=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa6d7[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x7a6d('0x0'));var util=require('util');var logger=require(_0x7a6d('0x1'))(_0x7a6d('0x2'));var moment=require(_0x7a6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a6d('0x4'));var fs=require('fs');var path=require(_0x7a6d('0x5'));var rimraf=require(_0x7a6d('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a6d('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x385de2,_0x57a2d2){return _0x385de2[_0x7a6d('0x8')](_0x7a6d('0x9'),attributes,{'tableName':_0x7a6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4586=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x4586,0x1c5));var _0x6458=function(_0x5ce268,_0x1835b6){_0x5ce268=_0x5ce268-0x0;var _0x28c96a=_0x4586[_0x5ce268];return _0x28c96a;};'use strict';var _=require(_0x6458('0x0'));var util=require(_0x6458('0x1'));var logger=require(_0x6458('0x2'))(_0x6458('0x3'));var moment=require('moment');var BPromise=require(_0x6458('0x4'));var rp=require(_0x6458('0x5'));var fs=require('fs');var path=require(_0x6458('0x6'));var rimraf=require(_0x6458('0x7'));var config=require(_0x6458('0x8'));var attributes=require(_0x6458('0x9'));var integrations=require(_0x6458('0xa'));module[_0x6458('0xb')]=function(_0x2fe036,_0x11ea5f){return _0x2fe036[_0x6458('0xc')](_0x6458('0xd'),attributes,{'tableName':_0x6458('0xe'),'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 e774357..9c93d01 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 _0x4ad9=['include','attributes','debug','ShowFreshdeskAccount','find','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','map'];(function(_0x3b9253,_0x2bf54a){var _0x148e9b=function(_0x126ea9){while(--_0x126ea9){_0x3b9253['push'](_0x3b9253['shift']());}};_0x148e9b(++_0x2bf54a);}(_0x4ad9,0xde));var _0x94ad=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4ad9[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x94ad('0x0'));var moment=require(_0x94ad('0x1'));var BPromise=require('bluebird');var rs=require(_0x94ad('0x2'));var fs=require('fs');var Redis=require(_0x94ad('0x3'));var db=require(_0x94ad('0x4'))['db'];var utils=require(_0x94ad('0x5'));var logger=require(_0x94ad('0x6'))(_0x94ad('0x7'));var config=require(_0x94ad('0x8'));var jayson=require(_0x94ad('0x9'));var client=jayson[_0x94ad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac5b9,_0x4e7751,_0x6f9b9b){return new BPromise(function(_0x67284d,_0xacee3d){return client[_0x94ad('0xb')](_0x2ac5b9,_0x6f9b9b)[_0x94ad('0xc')](function(_0x164b87){logger[_0x94ad('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x4e7751,'request\x20sent');logger['debug'](_0x94ad('0xe'),_0x4e7751,_0x94ad('0xf'),JSON[_0x94ad('0x10')](_0x164b87));if(_0x164b87['error']){if(_0x164b87['error'][_0x94ad('0x11')]===0x1f4){logger[_0x94ad('0x12')](_0x94ad('0x13'),_0x4e7751,_0x164b87['error'][_0x94ad('0x14')]);return _0xacee3d(_0x164b87[_0x94ad('0x12')][_0x94ad('0x14')]);}logger['error'](_0x94ad('0x13'),_0x4e7751,_0x164b87['error'][_0x94ad('0x14')]);return _0x67284d(_0x164b87[_0x94ad('0x12')][_0x94ad('0x14')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x4e7751,'request\x20sent');_0x67284d(_0x164b87[_0x94ad('0x15')]['message']);}})[_0x94ad('0x16')](function(_0x2bbce1){logger[_0x94ad('0x12')](_0x94ad('0x13'),_0x4e7751,_0x2bbce1);_0xacee3d(_0x2bbce1);});});}exports[_0x94ad('0x17')]=function(_0x520d99){var _0x490887=this;return new Promise(function(_0x1989ae,_0x26b6d0){return db[_0x94ad('0x18')][_0x94ad('0x19')]({'raw':_0x520d99[_0x94ad('0x1a')]?_0x520d99['options'][_0x94ad('0x1b')]===undefined?!![]:![]:!![],'where':_0x520d99[_0x94ad('0x1a')]?_0x520d99[_0x94ad('0x1a')][_0x94ad('0x1c')]||null:null,'attributes':_0x520d99[_0x94ad('0x1a')]?_0x520d99[_0x94ad('0x1a')]['attributes']||null:null,'limit':_0x520d99[_0x94ad('0x1a')]?_0x520d99['options']['limit']||null:null,'include':_0x520d99[_0x94ad('0x1a')]?_0x520d99[_0x94ad('0x1a')]['include']?_[_0x94ad('0x1d')](_0x520d99['options'][_0x94ad('0x1e')],function(_0x13c626){return{'model':db[_0x13c626['model']],'as':_0x13c626['as'],'attributes':_0x13c626[_0x94ad('0x1f')],'include':_0x13c626[_0x94ad('0x1e')]?_['map'](_0x13c626[_0x94ad('0x1e')],function(_0x1890ac){return{'model':db[_0x1890ac['model']],'as':_0x1890ac['as'],'attributes':_0x1890ac[_0x94ad('0x1f')],'include':_0x1890ac[_0x94ad('0x1e')]?_[_0x94ad('0x1d')](_0x1890ac['include'],function(_0x2d955d){return{'model':db[_0x2d955d['model']],'as':_0x2d955d['as'],'attributes':_0x2d955d[_0x94ad('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a1e98){logger[_0x94ad('0xd')]('GetFreshdeskAccount',_0x520d99);logger[_0x94ad('0x20')](_0x94ad('0x17'),_0x520d99,JSON[_0x94ad('0x10')](_0x5a1e98));_0x1989ae(_0x5a1e98);})[_0x94ad('0x16')](function(_0x1fdcff){logger[_0x94ad('0x12')]('GetFreshdeskAccount',_0x1fdcff[_0x94ad('0x14')],_0x520d99);_0x26b6d0(_0x490887[_0x94ad('0x12')](0x1f4,_0x1fdcff[_0x94ad('0x14')]));});});};exports[_0x94ad('0x21')]=function(_0x1a4654){var _0x4aa1c6=this;return new Promise(function(_0x5de2d9,_0x187cee){return db[_0x94ad('0x18')][_0x94ad('0x22')]({'raw':_0x1a4654[_0x94ad('0x1a')]?_0x1a4654[_0x94ad('0x1a')][_0x94ad('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a4654[_0x94ad('0x1a')]?_0x1a4654[_0x94ad('0x1a')][_0x94ad('0x1c')]||null:null,'attributes':_0x1a4654[_0x94ad('0x1a')]?_0x1a4654[_0x94ad('0x1a')][_0x94ad('0x1f')]||null:null,'include':_0x1a4654[_0x94ad('0x1a')]?_0x1a4654[_0x94ad('0x1a')]['include']?_[_0x94ad('0x1d')](_0x1a4654['options'][_0x94ad('0x1e')],function(_0x3680f0){return{'model':db[_0x3680f0[_0x94ad('0x23')]],'as':_0x3680f0['as'],'attributes':_0x3680f0['attributes'],'include':_0x3680f0['include']?_['map'](_0x3680f0[_0x94ad('0x1e')],function(_0x135b86){return{'model':db[_0x135b86[_0x94ad('0x23')]],'as':_0x135b86['as'],'attributes':_0x135b86[_0x94ad('0x1f')],'include':_0x135b86[_0x94ad('0x1e')]?_[_0x94ad('0x1d')](_0x135b86[_0x94ad('0x1e')],function(_0xf607c6){return{'model':db[_0xf607c6[_0x94ad('0x23')]],'as':_0xf607c6['as'],'attributes':_0xf607c6[_0x94ad('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x320767){logger[_0x94ad('0xd')](_0x94ad('0x21'),_0x1a4654);logger[_0x94ad('0x20')](_0x94ad('0x21'),_0x1a4654,JSON[_0x94ad('0x10')](_0x320767));_0x5de2d9(_0x320767);})['catch'](function(_0x86d8f0){logger[_0x94ad('0x12')](_0x94ad('0x21'),_0x86d8f0[_0x94ad('0x14')],_0x1a4654);_0x187cee(_0x4aa1c6[_0x94ad('0x12')](0x1f4,_0x86d8f0[_0x94ad('0x14')]));});});}; \ No newline at end of file +var _0x22fd=['ioredis','../../mysqldb','../../config/utils','jayson/promise','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','map','include','model','debug','catch','ShowFreshdeskAccount','find','lodash','moment'];(function(_0x3855f4,_0x16073b){var _0x3d4e63=function(_0x2dd743){while(--_0x2dd743){_0x3855f4['push'](_0x3855f4['shift']());}};_0x3d4e63(++_0x16073b);}(_0x22fd,0x166));var _0xd22f=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x22fd[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0xd22f('0x0'));var util=require('util');var moment=require(_0xd22f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd22f('0x2'));var db=require(_0xd22f('0x3'))['db'];var utils=require(_0xd22f('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd22f('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22e3e9,_0x4a3516,_0x3c21be){return new BPromise(function(_0x2cf2fc,_0x37dab4){return client[_0xd22f('0x6')](_0x22e3e9,_0x3c21be)[_0xd22f('0x7')](function(_0x4a8565){logger[_0xd22f('0x8')](_0xd22f('0x9'),_0x4a3516,_0xd22f('0xa'));logger['debug'](_0xd22f('0xb'),_0x4a3516,_0xd22f('0xa'),JSON[_0xd22f('0xc')](_0x4a8565));if(_0x4a8565[_0xd22f('0xd')]){if(_0x4a8565['error']['code']===0x1f4){logger[_0xd22f('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x4a3516,_0x4a8565[_0xd22f('0xd')]['message']);return _0x37dab4(_0x4a8565[_0xd22f('0xd')][_0xd22f('0xe')]);}logger[_0xd22f('0xd')](_0xd22f('0x9'),_0x4a3516,_0x4a8565['error']['message']);return _0x2cf2fc(_0x4a8565['error'][_0xd22f('0xe')]);}else{logger['info'](_0xd22f('0x9'),_0x4a3516,'request\x20sent');_0x2cf2fc(_0x4a8565[_0xd22f('0xf')]['message']);}})['catch'](function(_0x59629d){logger[_0xd22f('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x4a3516,_0x59629d);_0x37dab4(_0x59629d);});});}exports[_0xd22f('0x10')]=function(_0x2f238f){var _0x224dc0=this;return new Promise(function(_0xc86cff,_0x3e1cec){return db[_0xd22f('0x11')][_0xd22f('0x12')]({'raw':_0x2f238f['options']?_0x2f238f[_0xd22f('0x13')][_0xd22f('0x14')]===undefined?!![]:![]:!![],'where':_0x2f238f[_0xd22f('0x13')]?_0x2f238f[_0xd22f('0x13')][_0xd22f('0x15')]||null:null,'attributes':_0x2f238f[_0xd22f('0x13')]?_0x2f238f['options'][_0xd22f('0x16')]||null:null,'limit':_0x2f238f[_0xd22f('0x13')]?_0x2f238f['options']['limit']||null:null,'include':_0x2f238f[_0xd22f('0x13')]?_0x2f238f[_0xd22f('0x13')]['include']?_[_0xd22f('0x17')](_0x2f238f[_0xd22f('0x13')][_0xd22f('0x18')],function(_0x20bd97){return{'model':db[_0x20bd97[_0xd22f('0x19')]],'as':_0x20bd97['as'],'attributes':_0x20bd97[_0xd22f('0x16')],'include':_0x20bd97[_0xd22f('0x18')]?_[_0xd22f('0x17')](_0x20bd97['include'],function(_0xee3fc6){return{'model':db[_0xee3fc6[_0xd22f('0x19')]],'as':_0xee3fc6['as'],'attributes':_0xee3fc6[_0xd22f('0x16')],'include':_0xee3fc6[_0xd22f('0x18')]?_[_0xd22f('0x17')](_0xee3fc6['include'],function(_0x13044f){return{'model':db[_0x13044f[_0xd22f('0x19')]],'as':_0x13044f['as'],'attributes':_0x13044f[_0xd22f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd22f('0x7')](function(_0x3dc5bd){logger[_0xd22f('0x8')]('GetFreshdeskAccount',_0x2f238f);logger[_0xd22f('0x1a')](_0xd22f('0x10'),_0x2f238f,JSON[_0xd22f('0xc')](_0x3dc5bd));_0xc86cff(_0x3dc5bd);})[_0xd22f('0x1b')](function(_0x5abe68){logger[_0xd22f('0xd')](_0xd22f('0x10'),_0x5abe68[_0xd22f('0xe')],_0x2f238f);_0x3e1cec(_0x224dc0[_0xd22f('0xd')](0x1f4,_0x5abe68['message']));});});};exports[_0xd22f('0x1c')]=function(_0x90083c){var _0x3ddf58=this;return new Promise(function(_0x3b5c36,_0x37862f){return db['FreshdeskAccount'][_0xd22f('0x1d')]({'raw':_0x90083c[_0xd22f('0x13')]?_0x90083c['options'][_0xd22f('0x14')]===undefined?!![]:![]:!![],'where':_0x90083c[_0xd22f('0x13')]?_0x90083c[_0xd22f('0x13')][_0xd22f('0x15')]||null:null,'attributes':_0x90083c[_0xd22f('0x13')]?_0x90083c[_0xd22f('0x13')][_0xd22f('0x16')]||null:null,'include':_0x90083c[_0xd22f('0x13')]?_0x90083c[_0xd22f('0x13')][_0xd22f('0x18')]?_[_0xd22f('0x17')](_0x90083c[_0xd22f('0x13')][_0xd22f('0x18')],function(_0x53fd2d){return{'model':db[_0x53fd2d[_0xd22f('0x19')]],'as':_0x53fd2d['as'],'attributes':_0x53fd2d[_0xd22f('0x16')],'include':_0x53fd2d[_0xd22f('0x18')]?_[_0xd22f('0x17')](_0x53fd2d[_0xd22f('0x18')],function(_0x40fec8){return{'model':db[_0x40fec8[_0xd22f('0x19')]],'as':_0x40fec8['as'],'attributes':_0x40fec8[_0xd22f('0x16')],'include':_0x40fec8[_0xd22f('0x18')]?_[_0xd22f('0x17')](_0x40fec8['include'],function(_0x5652b8){return{'model':db[_0x5652b8[_0xd22f('0x19')]],'as':_0x5652b8['as'],'attributes':_0x5652b8[_0xd22f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd22f('0x7')](function(_0x58c64a){logger[_0xd22f('0x8')]('ShowFreshdeskAccount',_0x90083c);logger[_0xd22f('0x1a')](_0xd22f('0x1c'),_0x90083c,JSON['stringify'](_0x58c64a));_0x3b5c36(_0x58c64a);})[_0xd22f('0x1b')](function(_0x278d06){logger[_0xd22f('0xd')](_0xd22f('0x1c'),_0x278d06[_0xd22f('0xe')],_0x90083c);_0x37862f(_0x3ddf58[_0xd22f('0xd')](0x1f4,_0x278d06[_0xd22f('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d97255d..a1338db 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 _0x602a=['./intFreshdeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4f9840,_0x4abf7a){var _0x57c060=function(_0x5c3252){while(--_0x5c3252){_0x4f9840['push'](_0x4f9840['shift']());}};_0x57c060(++_0x4abf7a);}(_0x602a,0xc9));var _0xa602=function(_0x45371c,_0x5899b0){_0x45371c=_0x45371c-0x0;var _0x393479=_0x602a[_0x45371c];return _0x393479;};'use strict';var multer=require(_0xa602('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa602('0x1'));var express=require(_0xa602('0x2'));var router=express[_0xa602('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa602('0x4'));var config=require(_0xa602('0x5'));var controller=require(_0xa602('0x6'));router[_0xa602('0x7')]('/',auth[_0xa602('0x8')](),controller['index']);router['get']('/:id',auth[_0xa602('0x8')](),controller[_0xa602('0x9')]);router['get'](_0xa602('0xa'),auth['isAuthenticated'](),controller[_0xa602('0xb')]);router[_0xa602('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xa602('0xc')]);router[_0xa602('0x7')]('/:id/descriptions',auth[_0xa602('0x8')](),controller[_0xa602('0xd')]);router[_0xa602('0x7')](_0xa602('0xe'),auth[_0xa602('0x8')](),controller[_0xa602('0xf')]);router[_0xa602('0x10')]('/',auth[_0xa602('0x8')](),controller['create']);router['post'](_0xa602('0xe'),auth[_0xa602('0x8')](),controller[_0xa602('0x11')]);router[_0xa602('0x12')](_0xa602('0x13'),auth[_0xa602('0x8')](),controller[_0xa602('0x14')]);router[_0xa602('0x15')]('/:id',auth[_0xa602('0x8')](),controller['destroy']);module[_0xa602('0x16')]=router; \ No newline at end of file +var _0x119b=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x1f57d0,_0x1391c4){var _0x362865=function(_0x3df337){while(--_0x3df337){_0x1f57d0['push'](_0x1f57d0['shift']());}};_0x362865(++_0x1391c4);}(_0x119b,0xba));var _0xb119=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x119b[_0x2f9467];return _0x39894c;};'use strict';var multer=require(_0xb119('0x0'));var util=require(_0xb119('0x1'));var path=require('path');var timeout=require(_0xb119('0x2'));var express=require(_0xb119('0x3'));var router=express[_0xb119('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb119('0x5'));var config=require(_0xb119('0x6'));var controller=require(_0xb119('0x7'));router[_0xb119('0x8')]('/',auth[_0xb119('0x9')](),controller[_0xb119('0xa')]);router[_0xb119('0x8')](_0xb119('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb119('0xc'),auth[_0xb119('0x9')](),controller[_0xb119('0xd')]);router[_0xb119('0x8')](_0xb119('0xe'),auth[_0xb119('0x9')](),controller[_0xb119('0xf')]);router['get'](_0xb119('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0xb119('0x11'),auth['isAuthenticated'](),controller[_0xb119('0x12')]);router[_0xb119('0x13')]('/',auth[_0xb119('0x9')](),controller[_0xb119('0x14')]);router[_0xb119('0x13')](_0xb119('0x11'),auth[_0xb119('0x9')](),controller[_0xb119('0x15')]);router['put'](_0xb119('0xb'),auth['isAuthenticated'](),controller[_0xb119('0x16')]);router[_0xb119('0x17')](_0xb119('0xb'),auth['isAuthenticated'](),controller[_0xb119('0x18')]);module[_0xb119('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 cd748cf..999fd45 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 _0x58c3=['exports','STRING'];(function(_0x3c08ea,_0x419b25){var _0x4b6e51=function(_0x4e53b3){while(--_0x4e53b3){_0x3c08ea['push'](_0x3c08ea['shift']());}};_0x4b6e51(++_0x419b25);}(_0x58c3,0xc6));var _0x358c=function(_0x5ca6b7,_0x1a4f32){_0x5ca6b7=_0x5ca6b7-0x0;var _0x2d7743=_0x58c3[_0x5ca6b7];return _0x2d7743;};'use strict';var Sequelize=require('sequelize');module[_0x358c('0x0')]={'name':{'type':Sequelize[_0x358c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6077=['exports','STRING'];(function(_0x5bb3c4,_0x3e34af){var _0x18c357=function(_0x2f82ac){while(--_0x2f82ac){_0x5bb3c4['push'](_0x5bb3c4['shift']());}};_0x18c357(++_0x3e34af);}(_0x6077,0x112));var _0x7607=function(_0x134652,_0x3e8462){_0x134652=_0x134652-0x0;var _0x3148f5=_0x6077[_0x134652];return _0x3148f5;};'use strict';var Sequelize=require('sequelize');module[_0x7607('0x0')]={'name':{'type':Sequelize[_0x7607('0x1')]},'description':{'type':Sequelize[_0x7607('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 05bbd2d..470fe2d 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 _0xfd3d=['map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','FreshdeskConfiguration','count','include','findAll','rows','catch','show','includeAll','find','create','body','params','getFields','FreshdeskField','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','pick','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send'];(function(_0xb2e7ca,_0x339b91){var _0x1b10f9=function(_0xf49cd5){while(--_0xf49cd5){_0xb2e7ca['push'](_0xb2e7ca['shift']());}};_0x1b10f9(++_0x339b91);}(_0xfd3d,0xd4));var _0xdfd3=function(_0x2f37d9,_0x506cce){_0x2f37d9=_0x2f37d9-0x0;var _0x470d49=_0xfd3d[_0x2f37d9];return _0x470d49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfd3('0x0'));var zipdir=require(_0xdfd3('0x1'));var jsonpatch=require(_0xdfd3('0x2'));var rp=require(_0xdfd3('0x3'));var moment=require(_0xdfd3('0x4'));var BPromise=require(_0xdfd3('0x5'));var Mustache=require('mustache');var util=require(_0xdfd3('0x6'));var path=require('path');var sox=require(_0xdfd3('0x7'));var csv=require(_0xdfd3('0x8'));var ejs=require(_0xdfd3('0x9'));var fs=require('fs');var fs_extra=require(_0xdfd3('0xa'));var _=require(_0xdfd3('0xb'));var squel=require('squel');var crypto=require(_0xdfd3('0xc'));var jsforce=require(_0xdfd3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdfd3('0xe'));var Papa=require(_0xdfd3('0xf'));var Redis=require(_0xdfd3('0x10'));var authService=require(_0xdfd3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfd3('0x12'));var logger=require(_0xdfd3('0x13'))(_0xdfd3('0x14'));var utils=require(_0xdfd3('0x15'));var config=require(_0xdfd3('0x16'));var licenseUtil=require(_0xdfd3('0x17'));var db=require(_0xdfd3('0x18'))['db'];function respondWithStatusCode(_0x5f3b1d,_0x4f7af2){_0x4f7af2=_0x4f7af2||0xcc;return function(_0xc37c0f){if(_0xc37c0f){return _0x5f3b1d[_0xdfd3('0x19')](_0x4f7af2);}return _0x5f3b1d[_0xdfd3('0x1a')](_0x4f7af2)['end']();};}function respondWithResult(_0x20c7d8,_0x1228e9){_0x1228e9=_0x1228e9||0xc8;return function(_0x1d98ad){if(_0x1d98ad){return _0x20c7d8[_0xdfd3('0x1a')](_0x1228e9)[_0xdfd3('0x1b')](_0x1d98ad);}};}function respondWithFilteredResult(_0x5a8198,_0x3a1e44){return function(_0x41e3a2){if(_0x41e3a2){var _0x5a17d9=typeof _0x3a1e44[_0xdfd3('0x1c')]===_0xdfd3('0x1d')&&typeof _0x3a1e44[_0xdfd3('0x1e')]==='undefined';var _0x5138ed=_0x41e3a2['count'];var _0x2d1085=_0x5a17d9?0x0:_0x3a1e44[_0xdfd3('0x1c')];var _0x13413a=_0x5a17d9?_0x41e3a2['count']:_0x3a1e44[_0xdfd3('0x1c')]+_0x3a1e44[_0xdfd3('0x1e')];var _0xe30727;if(_0x13413a>=_0x5138ed){_0x13413a=_0x5138ed;_0xe30727=0xc8;}else{_0xe30727=0xce;}_0x5a8198['status'](_0xe30727);return _0x5a8198[_0xdfd3('0x1f')](_0xdfd3('0x20'),_0x2d1085+'-'+_0x13413a+'/'+_0x5138ed)[_0xdfd3('0x1b')](_0x41e3a2);}return null;};}function patchUpdates(_0x1e5d79){return function(_0x690fe1){try{jsonpatch['apply'](_0x690fe1,_0x1e5d79,!![]);}catch(_0x4e5987){return BPromise[_0xdfd3('0x21')](_0x4e5987);}return _0x690fe1[_0xdfd3('0x22')]();};}function saveUpdates(_0x3b24e6,_0x202f83){return function(_0x3e129a){if(_0x3e129a){return _0x3e129a[_0xdfd3('0x23')](_0x3b24e6)['then'](function(_0x191777){return _0x191777;});}return null;};}function removeEntity(_0x5c7f78,_0x2b274d){return function(_0x5a5c08){if(_0x5a5c08){return _0x5a5c08[_0xdfd3('0x24')]()[_0xdfd3('0x25')](function(){_0x5c7f78[_0xdfd3('0x1a')](0xcc)[_0xdfd3('0x26')]();});}};}function handleEntityNotFound(_0x3184ab,_0x20db51){return function(_0x517ed6){if(!_0x517ed6){_0x3184ab[_0xdfd3('0x19')](0x194);}return _0x517ed6;};}function handleError(_0x253405,_0x2a7670){_0x2a7670=_0x2a7670||0x1f4;return function(_0x168242){logger[_0xdfd3('0x27')](_0x168242[_0xdfd3('0x28')]);if(_0x168242['name']){delete _0x168242[_0xdfd3('0x29')];}_0x253405[_0xdfd3('0x1a')](_0x2a7670)[_0xdfd3('0x2a')](_0x168242);};}exports['index']=function(_0x47e185,_0x47340b){var _0xe3f5a={},_0x4d11e5={},_0x10e4fd={'count':0x0,'rows':[]};var _0x596c01=_[_0xdfd3('0x2b')](db['FreshdeskConfiguration'][_0xdfd3('0x2c')],function(_0x55eddc){return{'name':_0x55eddc[_0xdfd3('0x2d')],'type':_0x55eddc[_0xdfd3('0x2e')]['key']};});_0x4d11e5[_0xdfd3('0x2f')]=_[_0xdfd3('0x2b')](_0x596c01,'name');_0x4d11e5[_0xdfd3('0x30')]=_[_0xdfd3('0x31')](_0x47e185[_0xdfd3('0x30')]);_0x4d11e5[_0xdfd3('0x32')]=_[_0xdfd3('0x33')](_0x4d11e5[_0xdfd3('0x2f')],_0x4d11e5[_0xdfd3('0x30')]);_0xe3f5a[_0xdfd3('0x34')]=_[_0xdfd3('0x33')](_0x4d11e5[_0xdfd3('0x2f')],qs[_0xdfd3('0x35')](_0x47e185['query'][_0xdfd3('0x35')]));_0xe3f5a[_0xdfd3('0x34')]=_0xe3f5a['attributes'][_0xdfd3('0x36')]?_0xe3f5a['attributes']:_0x4d11e5['model'];if(!_0x47e185[_0xdfd3('0x30')]['hasOwnProperty']('nolimit')){_0xe3f5a[_0xdfd3('0x1e')]=qs[_0xdfd3('0x1e')](_0x47e185[_0xdfd3('0x30')][_0xdfd3('0x1e')]);_0xe3f5a[_0xdfd3('0x1c')]=qs['offset'](_0x47e185[_0xdfd3('0x30')][_0xdfd3('0x1c')]);}_0xe3f5a[_0xdfd3('0x37')]=qs[_0xdfd3('0x38')](_0x47e185[_0xdfd3('0x30')][_0xdfd3('0x38')]);_0xe3f5a[_0xdfd3('0x39')]=qs['filters'](_['pick'](_0x47e185['query'],_0x4d11e5['filters']),_0x596c01);if(_0x47e185['query'][_0xdfd3('0x3a')]){_0xe3f5a[_0xdfd3('0x39')]=_[_0xdfd3('0x3b')](_0xe3f5a[_0xdfd3('0x39')],{'$or':_[_0xdfd3('0x2b')](_0x596c01,function(_0x17f769){if(_0x17f769[_0xdfd3('0x2e')]!=='VIRTUAL'){var _0x25e3ae={};_0x25e3ae[_0x17f769['name']]={'$like':'%'+_0x47e185[_0xdfd3('0x30')][_0xdfd3('0x3a')]+'%'};return _0x25e3ae;}})});}_0xe3f5a=_[_0xdfd3('0x3b')]({},_0xe3f5a,_0x47e185[_0xdfd3('0x3c')]);var _0x581078={'where':_0xe3f5a['where']};return db[_0xdfd3('0x3d')][_0xdfd3('0x3e')](_0x581078)[_0xdfd3('0x25')](function(_0x370e20){_0x10e4fd[_0xdfd3('0x3e')]=_0x370e20;if(_0x47e185[_0xdfd3('0x30')]['includeAll']){_0xe3f5a[_0xdfd3('0x3f')]=[{'all':!![]}];}return db[_0xdfd3('0x3d')][_0xdfd3('0x40')](_0xe3f5a);})[_0xdfd3('0x25')](function(_0x18a50b){_0x10e4fd[_0xdfd3('0x41')]=_0x18a50b;return _0x10e4fd;})[_0xdfd3('0x25')](respondWithFilteredResult(_0x47340b,_0xe3f5a))[_0xdfd3('0x42')](handleError(_0x47340b,null));};exports[_0xdfd3('0x43')]=function(_0x55f59d,_0x1bc1f8){var _0xc8411f={'raw':![],'where':{'id':_0x55f59d['params']['id']}},_0x4fc145={};_0x4fc145['model']=_[_0xdfd3('0x31')](db['FreshdeskConfiguration'][_0xdfd3('0x2c')]);_0x4fc145['query']=_['keys'](_0x55f59d[_0xdfd3('0x30')]);_0x4fc145[_0xdfd3('0x32')]=_['intersection'](_0x4fc145[_0xdfd3('0x2f')],_0x4fc145['query']);_0xc8411f['attributes']=_[_0xdfd3('0x33')](_0x4fc145['model'],qs[_0xdfd3('0x35')](_0x55f59d[_0xdfd3('0x30')][_0xdfd3('0x35')]));_0xc8411f[_0xdfd3('0x34')]=_0xc8411f[_0xdfd3('0x34')][_0xdfd3('0x36')]?_0xc8411f[_0xdfd3('0x34')]:_0x4fc145[_0xdfd3('0x2f')];if(_0x55f59d[_0xdfd3('0x30')][_0xdfd3('0x44')]){_0xc8411f[_0xdfd3('0x3f')]=[{'all':!![]}];}_0xc8411f=_[_0xdfd3('0x3b')]({},_0xc8411f,_0x55f59d[_0xdfd3('0x3c')]);return db[_0xdfd3('0x3d')][_0xdfd3('0x45')](_0xc8411f)[_0xdfd3('0x25')](handleEntityNotFound(_0x1bc1f8,null))['then'](respondWithResult(_0x1bc1f8,null))[_0xdfd3('0x42')](handleError(_0x1bc1f8,null));};exports[_0xdfd3('0x46')]=function(_0xe2774b,_0x235d1f){return db['FreshdeskConfiguration'][_0xdfd3('0x46')](_0xe2774b[_0xdfd3('0x47')],{})['then'](respondWithResult(_0x235d1f,0xc9))['catch'](handleError(_0x235d1f,null));};exports['update']=function(_0x5a4fcf,_0x1859db){if(_0x5a4fcf['body']['id']){delete _0x5a4fcf['body']['id'];}return db[_0xdfd3('0x3d')][_0xdfd3('0x45')]({'where':{'id':_0x5a4fcf[_0xdfd3('0x48')]['id']}})[_0xdfd3('0x25')](handleEntityNotFound(_0x1859db,null))[_0xdfd3('0x25')](saveUpdates(_0x5a4fcf[_0xdfd3('0x47')],null))['then'](respondWithResult(_0x1859db,null))[_0xdfd3('0x42')](handleError(_0x1859db,null));};exports[_0xdfd3('0x24')]=function(_0x3d481d,_0x115351){return db[_0xdfd3('0x3d')][_0xdfd3('0x45')]({'where':{'id':_0x3d481d[_0xdfd3('0x48')]['id']}})['then'](handleEntityNotFound(_0x115351,null))['then'](removeEntity(_0x115351,null))[_0xdfd3('0x42')](handleError(_0x115351,null));};exports[_0xdfd3('0x49')]=function(_0x52f97a,_0x181ac3,_0x47c691){var _0x1cb04a={};var _0x5d7e46={};var _0x336935;var _0x15e476;return db[_0xdfd3('0x3d')]['findOne']({'where':{'id':_0x52f97a[_0xdfd3('0x48')]['id']}})[_0xdfd3('0x25')](handleEntityNotFound(_0x181ac3,null))[_0xdfd3('0x25')](function(_0x276c4a){if(_0x276c4a){_0x336935=_0x276c4a;_0x5d7e46[_0xdfd3('0x2f')]=_[_0xdfd3('0x31')](db[_0xdfd3('0x4a')][_0xdfd3('0x2c')]);_0x5d7e46[_0xdfd3('0x30')]=_['keys'](_0x52f97a[_0xdfd3('0x30')]);_0x5d7e46[_0xdfd3('0x32')]=_['intersection'](_0x5d7e46[_0xdfd3('0x2f')],_0x5d7e46['query']);_0x1cb04a[_0xdfd3('0x34')]=_['intersection'](_0x5d7e46[_0xdfd3('0x2f')],qs[_0xdfd3('0x35')](_0x52f97a['query']['fields']));_0x1cb04a['attributes']=_0x1cb04a[_0xdfd3('0x34')][_0xdfd3('0x36')]?_0x1cb04a['attributes']:_0x5d7e46['model'];_0x1cb04a[_0xdfd3('0x37')]=qs[_0xdfd3('0x38')](_0x52f97a[_0xdfd3('0x30')][_0xdfd3('0x38')]);_0x1cb04a['where']=qs[_0xdfd3('0x32')](_['pick'](_0x52f97a[_0xdfd3('0x30')],_0x5d7e46['filters']));if(_0x52f97a[_0xdfd3('0x30')][_0xdfd3('0x3a')]){_0x1cb04a[_0xdfd3('0x39')]=_[_0xdfd3('0x3b')](_0x1cb04a['where'],{'$or':_[_0xdfd3('0x2b')](_0x1cb04a[_0xdfd3('0x34')],function(_0x3d13f4){var _0x4ad046={};_0x4ad046[_0x3d13f4]={'$like':'%'+_0x52f97a['query']['filter']+'%'};return _0x4ad046;})});}_0x1cb04a=_[_0xdfd3('0x3b')]({},_0x1cb04a,_0x52f97a['options']);return _0x336935[_0xdfd3('0x49')](_0x1cb04a);}})[_0xdfd3('0x25')](function(_0x1b0243){if(_0x1b0243){_0x15e476=_0x1b0243['length'];if(!_0x52f97a[_0xdfd3('0x30')][_0xdfd3('0x4b')](_0xdfd3('0x4c'))){_0x1cb04a['limit']=qs[_0xdfd3('0x1e')](_0x52f97a[_0xdfd3('0x30')][_0xdfd3('0x1e')]);_0x1cb04a[_0xdfd3('0x1c')]=qs[_0xdfd3('0x1c')](_0x52f97a['query'][_0xdfd3('0x1c')]);}return _0x336935[_0xdfd3('0x49')](_0x1cb04a);}})[_0xdfd3('0x25')](function(_0x755358){if(_0x755358){return _0x755358?{'count':_0x15e476,'rows':_0x755358}:null;}})[_0xdfd3('0x25')](respondWithResult(_0x181ac3,null))[_0xdfd3('0x42')](handleError(_0x181ac3,null));};exports[_0xdfd3('0x4d')]=function(_0x1a4456,_0x4bb423,_0x6cab7f){var _0x5e5b09={};var _0x25b948={};var _0x4bfc8f;var _0x2dff97;return db[_0xdfd3('0x3d')][_0xdfd3('0x4e')]({'where':{'id':_0x1a4456[_0xdfd3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4bb423,null))[_0xdfd3('0x25')](function(_0x5c9388){if(_0x5c9388){_0x4bfc8f=_0x5c9388;_0x25b948['model']=_[_0xdfd3('0x31')](db['FreshdeskField'][_0xdfd3('0x2c')]);_0x25b948[_0xdfd3('0x30')]=_['keys'](_0x1a4456[_0xdfd3('0x30')]);_0x25b948[_0xdfd3('0x32')]=_[_0xdfd3('0x33')](_0x25b948[_0xdfd3('0x2f')],_0x25b948[_0xdfd3('0x30')]);_0x5e5b09[_0xdfd3('0x34')]=_[_0xdfd3('0x33')](_0x25b948[_0xdfd3('0x2f')],qs[_0xdfd3('0x35')](_0x1a4456[_0xdfd3('0x30')]['fields']));_0x5e5b09[_0xdfd3('0x34')]=_0x5e5b09[_0xdfd3('0x34')][_0xdfd3('0x36')]?_0x5e5b09[_0xdfd3('0x34')]:_0x25b948[_0xdfd3('0x2f')];_0x5e5b09[_0xdfd3('0x37')]=qs[_0xdfd3('0x38')](_0x1a4456[_0xdfd3('0x30')][_0xdfd3('0x38')]);_0x5e5b09[_0xdfd3('0x39')]=qs[_0xdfd3('0x32')](_['pick'](_0x1a4456['query'],_0x25b948['filters']));if(_0x1a4456['query'][_0xdfd3('0x3a')]){_0x5e5b09[_0xdfd3('0x39')]=_['merge'](_0x5e5b09[_0xdfd3('0x39')],{'$or':_['map'](_0x5e5b09[_0xdfd3('0x34')],function(_0x523808){var _0x333189={};_0x333189[_0x523808]={'$like':'%'+_0x1a4456[_0xdfd3('0x30')][_0xdfd3('0x3a')]+'%'};return _0x333189;})});}_0x5e5b09=_[_0xdfd3('0x3b')]({},_0x5e5b09,_0x1a4456[_0xdfd3('0x3c')]);return _0x4bfc8f[_0xdfd3('0x4d')](_0x5e5b09);}})['then'](function(_0x2f7fdb){if(_0x2f7fdb){_0x2dff97=_0x2f7fdb[_0xdfd3('0x36')];if(!_0x1a4456[_0xdfd3('0x30')][_0xdfd3('0x4b')](_0xdfd3('0x4c'))){_0x5e5b09['limit']=qs[_0xdfd3('0x1e')](_0x1a4456[_0xdfd3('0x30')][_0xdfd3('0x1e')]);_0x5e5b09[_0xdfd3('0x1c')]=qs['offset'](_0x1a4456[_0xdfd3('0x30')][_0xdfd3('0x1c')]);}return _0x4bfc8f[_0xdfd3('0x4d')](_0x5e5b09);}})[_0xdfd3('0x25')](function(_0x46f466){if(_0x46f466){return _0x46f466?{'count':_0x2dff97,'rows':_0x46f466}:null;}})['then'](respondWithResult(_0x4bb423,null))[_0xdfd3('0x42')](handleError(_0x4bb423,null));};exports[_0xdfd3('0x4f')]=function(_0xf363ba,_0x33e031,_0x546b07){var _0x1a62a1={};var _0x102592={};var _0x150c4b;var _0x2ca16d;return db[_0xdfd3('0x3d')][_0xdfd3('0x4e')]({'where':{'id':_0xf363ba[_0xdfd3('0x48')]['id']}})['then'](handleEntityNotFound(_0x33e031,null))[_0xdfd3('0x25')](function(_0x148596){if(_0x148596){_0x150c4b=_0x148596;_0x102592[_0xdfd3('0x2f')]=_['keys'](db[_0xdfd3('0x4a')]['rawAttributes']);_0x102592[_0xdfd3('0x30')]=_['keys'](_0xf363ba[_0xdfd3('0x30')]);_0x102592['filters']=_[_0xdfd3('0x33')](_0x102592[_0xdfd3('0x2f')],_0x102592['query']);_0x1a62a1[_0xdfd3('0x34')]=_[_0xdfd3('0x33')](_0x102592[_0xdfd3('0x2f')],qs['fields'](_0xf363ba[_0xdfd3('0x30')][_0xdfd3('0x35')]));_0x1a62a1[_0xdfd3('0x34')]=_0x1a62a1[_0xdfd3('0x34')][_0xdfd3('0x36')]?_0x1a62a1[_0xdfd3('0x34')]:_0x102592['model'];_0x1a62a1['order']=qs[_0xdfd3('0x38')](_0xf363ba['query'][_0xdfd3('0x38')]);_0x1a62a1['where']=qs[_0xdfd3('0x32')](_[_0xdfd3('0x50')](_0xf363ba[_0xdfd3('0x30')],_0x102592[_0xdfd3('0x32')]));if(_0xf363ba[_0xdfd3('0x30')][_0xdfd3('0x3a')]){_0x1a62a1[_0xdfd3('0x39')]=_['merge'](_0x1a62a1[_0xdfd3('0x39')],{'$or':_[_0xdfd3('0x2b')](_0x1a62a1[_0xdfd3('0x34')],function(_0x649c8a){var _0xe104ed={};_0xe104ed[_0x649c8a]={'$like':'%'+_0xf363ba[_0xdfd3('0x30')][_0xdfd3('0x3a')]+'%'};return _0xe104ed;})});}_0x1a62a1=_[_0xdfd3('0x3b')]({},_0x1a62a1,_0xf363ba[_0xdfd3('0x3c')]);return _0x150c4b[_0xdfd3('0x4f')](_0x1a62a1);}})[_0xdfd3('0x25')](function(_0x229eaf){if(_0x229eaf){_0x2ca16d=_0x229eaf[_0xdfd3('0x36')];if(!_0xf363ba[_0xdfd3('0x30')][_0xdfd3('0x4b')](_0xdfd3('0x4c'))){_0x1a62a1['limit']=qs[_0xdfd3('0x1e')](_0xf363ba[_0xdfd3('0x30')]['limit']);_0x1a62a1['offset']=qs[_0xdfd3('0x1c')](_0xf363ba[_0xdfd3('0x30')][_0xdfd3('0x1c')]);}return _0x150c4b[_0xdfd3('0x4f')](_0x1a62a1);}})[_0xdfd3('0x25')](function(_0x22320a){if(_0x22320a){return _0x22320a?{'count':_0x2ca16d,'rows':_0x22320a}:null;}})[_0xdfd3('0x25')](respondWithResult(_0x33e031,null))[_0xdfd3('0x42')](handleError(_0x33e031,null));};exports[_0xdfd3('0x51')]=function(_0x35356f,_0xbae07c,_0x1711f4){var _0x561ea0={};var _0x6b5fb2={};var _0x58216c;var _0x27347;return db[_0xdfd3('0x3d')][_0xdfd3('0x4e')]({'where':{'id':_0x35356f[_0xdfd3('0x48')]['id']}})[_0xdfd3('0x25')](handleEntityNotFound(_0xbae07c,null))[_0xdfd3('0x25')](function(_0x2ee1d1){if(_0x2ee1d1){_0x58216c=_0x2ee1d1;_0x6b5fb2[_0xdfd3('0x2f')]=_[_0xdfd3('0x31')](db[_0xdfd3('0x52')][_0xdfd3('0x2c')]);_0x6b5fb2['query']=_[_0xdfd3('0x31')](_0x35356f[_0xdfd3('0x30')]);_0x6b5fb2[_0xdfd3('0x32')]=_[_0xdfd3('0x33')](_0x6b5fb2[_0xdfd3('0x2f')],_0x6b5fb2[_0xdfd3('0x30')]);_0x561ea0[_0xdfd3('0x34')]=_[_0xdfd3('0x33')](_0x6b5fb2[_0xdfd3('0x2f')],qs[_0xdfd3('0x35')](_0x35356f[_0xdfd3('0x30')][_0xdfd3('0x35')]));_0x561ea0[_0xdfd3('0x34')]=_0x561ea0[_0xdfd3('0x34')][_0xdfd3('0x36')]?_0x561ea0[_0xdfd3('0x34')]:_0x6b5fb2[_0xdfd3('0x2f')];_0x561ea0['order']=qs[_0xdfd3('0x38')](_0x35356f[_0xdfd3('0x30')][_0xdfd3('0x38')]);_0x561ea0[_0xdfd3('0x39')]=qs[_0xdfd3('0x32')](_[_0xdfd3('0x50')](_0x35356f[_0xdfd3('0x30')],_0x6b5fb2[_0xdfd3('0x32')]));if(_0x35356f[_0xdfd3('0x30')][_0xdfd3('0x3a')]){_0x561ea0['where']=_[_0xdfd3('0x3b')](_0x561ea0[_0xdfd3('0x39')],{'$or':_[_0xdfd3('0x2b')](_0x561ea0[_0xdfd3('0x34')],function(_0x2137f5){var _0x3f00eb={};_0x3f00eb[_0x2137f5]={'$like':'%'+_0x35356f[_0xdfd3('0x30')][_0xdfd3('0x3a')]+'%'};return _0x3f00eb;})});}_0x561ea0=_['merge']({},_0x561ea0,_0x35356f[_0xdfd3('0x3c')]);return _0x58216c[_0xdfd3('0x51')](_0x561ea0);}})[_0xdfd3('0x25')](function(_0xb0e010){if(_0xb0e010){_0x27347=_0xb0e010[_0xdfd3('0x36')];if(!_0x35356f['query'][_0xdfd3('0x4b')](_0xdfd3('0x4c'))){_0x561ea0['limit']=qs['limit'](_0x35356f[_0xdfd3('0x30')][_0xdfd3('0x1e')]);_0x561ea0[_0xdfd3('0x1c')]=qs[_0xdfd3('0x1c')](_0x35356f[_0xdfd3('0x30')][_0xdfd3('0x1c')]);}return _0x58216c[_0xdfd3('0x51')](_0x561ea0);}})[_0xdfd3('0x25')](function(_0x5c39fe){if(_0x5c39fe){return _0x5c39fe?{'count':_0x27347,'rows':_0x5c39fe}:null;}})[_0xdfd3('0x25')](respondWithResult(_0xbae07c,null))['catch'](handleError(_0xbae07c,null));};exports[_0xdfd3('0x53')]=function(_0xf17ae5,_0x1aeae1,_0x90884c){if(_0xf17ae5['body']['id']){delete _0xf17ae5[_0xdfd3('0x47')]['id'];}return db[_0xdfd3('0x3d')][_0xdfd3('0x4e')]({'where':{'id':_0xf17ae5[_0xdfd3('0x48')]['id']}})['then'](handleEntityNotFound(_0x1aeae1,null))[_0xdfd3('0x25')](function(_0x41beeb){if(_0x41beeb){return _0x41beeb[_0xdfd3('0x53')](_0xf17ae5[_0xdfd3('0x47')][_0xdfd3('0x54')]||[]);}return null;})[_0xdfd3('0x25')](respondWithResult(_0x1aeae1,null))[_0xdfd3('0x42')](handleError(_0x1aeae1,null));}; \ No newline at end of file +var _0xebc4=['findOne','getSubjects','FreshdeskField','options','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','FreshdeskConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','find','create','body','params','getFields'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xebc4,0xaf));var _0x4ebc=function(_0x33207c,_0x5a6cc0){_0x33207c=_0x33207c-0x0;var _0x44e76e=_0xebc4[_0x33207c];return _0x44e76e;};'use strict';var emlformat=require(_0x4ebc('0x0'));var rimraf=require(_0x4ebc('0x1'));var zipdir=require(_0x4ebc('0x2'));var jsonpatch=require(_0x4ebc('0x3'));var rp=require(_0x4ebc('0x4'));var moment=require(_0x4ebc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4ebc('0x6'));var util=require(_0x4ebc('0x7'));var path=require(_0x4ebc('0x8'));var sox=require(_0x4ebc('0x9'));var csv=require(_0x4ebc('0xa'));var ejs=require(_0x4ebc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ebc('0xc'));var squel=require('squel');var crypto=require(_0x4ebc('0xd'));var jsforce=require(_0x4ebc('0xe'));var deskjs=require(_0x4ebc('0xf'));var toCsv=require(_0x4ebc('0xa'));var querystring=require(_0x4ebc('0x10'));var Papa=require(_0x4ebc('0x11'));var Redis=require('ioredis');var authService=require(_0x4ebc('0x12'));var qs=require(_0x4ebc('0x13'));var as=require(_0x4ebc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ebc('0x15'))(_0x4ebc('0x16'));var utils=require(_0x4ebc('0x17'));var config=require(_0x4ebc('0x18'));var licenseUtil=require(_0x4ebc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12e75c,_0x1ea6ef){_0x1ea6ef=_0x1ea6ef||0xcc;return function(_0x341ccf){if(_0x341ccf){return _0x12e75c['sendStatus'](_0x1ea6ef);}return _0x12e75c['status'](_0x1ea6ef)[_0x4ebc('0x1a')]();};}function respondWithResult(_0x4be561,_0x2cb239){_0x2cb239=_0x2cb239||0xc8;return function(_0x1c9316){if(_0x1c9316){return _0x4be561[_0x4ebc('0x1b')](_0x2cb239)[_0x4ebc('0x1c')](_0x1c9316);}};}function respondWithFilteredResult(_0xf401c9,_0x4c4441){return function(_0x32777a){if(_0x32777a){var _0x2f961b=typeof _0x4c4441['offset']===_0x4ebc('0x1d')&&typeof _0x4c4441[_0x4ebc('0x1e')]===_0x4ebc('0x1d');var _0x1250da=_0x32777a['count'];var _0x24b486=_0x2f961b?0x0:_0x4c4441[_0x4ebc('0x1f')];var _0x30c6ad=_0x2f961b?_0x32777a[_0x4ebc('0x20')]:_0x4c4441[_0x4ebc('0x1f')]+_0x4c4441[_0x4ebc('0x1e')];var _0x4d40b0;if(_0x30c6ad>=_0x1250da){_0x30c6ad=_0x1250da;_0x4d40b0=0xc8;}else{_0x4d40b0=0xce;}_0xf401c9[_0x4ebc('0x1b')](_0x4d40b0);return _0xf401c9[_0x4ebc('0x21')]('Content-Range',_0x24b486+'-'+_0x30c6ad+'/'+_0x1250da)[_0x4ebc('0x1c')](_0x32777a);}return null;};}function patchUpdates(_0x4324fc){return function(_0xd95626){try{jsonpatch[_0x4ebc('0x22')](_0xd95626,_0x4324fc,!![]);}catch(_0x1b9940){return BPromise[_0x4ebc('0x23')](_0x1b9940);}return _0xd95626[_0x4ebc('0x24')]();};}function saveUpdates(_0xbfee69,_0x1cf72a){return function(_0x4c6fad){if(_0x4c6fad){return _0x4c6fad[_0x4ebc('0x25')](_0xbfee69)[_0x4ebc('0x26')](function(_0x518c0e){return _0x518c0e;});}return null;};}function removeEntity(_0x327d34,_0x50117d){return function(_0xe0227){if(_0xe0227){return _0xe0227[_0x4ebc('0x27')]()[_0x4ebc('0x26')](function(){_0x327d34['status'](0xcc)[_0x4ebc('0x1a')]();});}};}function handleEntityNotFound(_0xc63856,_0x4f6554){return function(_0x4942d7){if(!_0x4942d7){_0xc63856[_0x4ebc('0x28')](0x194);}return _0x4942d7;};}function handleError(_0x3f07a3,_0x932daa){_0x932daa=_0x932daa||0x1f4;return function(_0x21d1ea){logger[_0x4ebc('0x29')](_0x21d1ea['stack']);if(_0x21d1ea[_0x4ebc('0x2a')]){delete _0x21d1ea[_0x4ebc('0x2a')];}_0x3f07a3[_0x4ebc('0x1b')](_0x932daa)[_0x4ebc('0x2b')](_0x21d1ea);};}exports['index']=function(_0x2ae013,_0x542b77){var _0x476d34={},_0x138f6e={},_0x519e87={'count':0x0,'rows':[]};var _0x4b9d6d=_[_0x4ebc('0x2c')](db[_0x4ebc('0x2d')][_0x4ebc('0x2e')],function(_0x24baf5){return{'name':_0x24baf5['fieldName'],'type':_0x24baf5[_0x4ebc('0x2f')]['key']};});_0x138f6e[_0x4ebc('0x30')]=_[_0x4ebc('0x2c')](_0x4b9d6d,_0x4ebc('0x2a'));_0x138f6e[_0x4ebc('0x31')]=_[_0x4ebc('0x32')](_0x2ae013[_0x4ebc('0x31')]);_0x138f6e[_0x4ebc('0x33')]=_[_0x4ebc('0x34')](_0x138f6e[_0x4ebc('0x30')],_0x138f6e[_0x4ebc('0x31')]);_0x476d34[_0x4ebc('0x35')]=_[_0x4ebc('0x34')](_0x138f6e[_0x4ebc('0x30')],qs[_0x4ebc('0x36')](_0x2ae013['query'][_0x4ebc('0x36')]));_0x476d34[_0x4ebc('0x35')]=_0x476d34[_0x4ebc('0x35')][_0x4ebc('0x37')]?_0x476d34['attributes']:_0x138f6e['model'];if(!_0x2ae013['query'][_0x4ebc('0x38')](_0x4ebc('0x39'))){_0x476d34[_0x4ebc('0x1e')]=qs[_0x4ebc('0x1e')](_0x2ae013['query']['limit']);_0x476d34[_0x4ebc('0x1f')]=qs[_0x4ebc('0x1f')](_0x2ae013['query'][_0x4ebc('0x1f')]);}_0x476d34[_0x4ebc('0x3a')]=qs[_0x4ebc('0x3b')](_0x2ae013['query'][_0x4ebc('0x3b')]);_0x476d34[_0x4ebc('0x3c')]=qs[_0x4ebc('0x33')](_[_0x4ebc('0x3d')](_0x2ae013[_0x4ebc('0x31')],_0x138f6e[_0x4ebc('0x33')]),_0x4b9d6d);if(_0x2ae013[_0x4ebc('0x31')][_0x4ebc('0x3e')]){_0x476d34[_0x4ebc('0x3c')]=_[_0x4ebc('0x3f')](_0x476d34[_0x4ebc('0x3c')],{'$or':_[_0x4ebc('0x2c')](_0x4b9d6d,function(_0x50e359){if(_0x50e359[_0x4ebc('0x2f')]!==_0x4ebc('0x40')){var _0x2ffab7={};_0x2ffab7[_0x50e359[_0x4ebc('0x2a')]]={'$like':'%'+_0x2ae013[_0x4ebc('0x31')][_0x4ebc('0x3e')]+'%'};return _0x2ffab7;}})});}_0x476d34=_['merge']({},_0x476d34,_0x2ae013['options']);var _0x2121e7={'where':_0x476d34[_0x4ebc('0x3c')]};return db[_0x4ebc('0x2d')]['count'](_0x2121e7)[_0x4ebc('0x26')](function(_0x2062e8){_0x519e87['count']=_0x2062e8;if(_0x2ae013[_0x4ebc('0x31')][_0x4ebc('0x41')]){_0x476d34[_0x4ebc('0x42')]=[{'all':!![]}];}return db[_0x4ebc('0x2d')]['findAll'](_0x476d34);})[_0x4ebc('0x26')](function(_0x59a0ee){_0x519e87[_0x4ebc('0x43')]=_0x59a0ee;return _0x519e87;})['then'](respondWithFilteredResult(_0x542b77,_0x476d34))[_0x4ebc('0x44')](handleError(_0x542b77,null));};exports['show']=function(_0x3e1e9d,_0x504885){var _0x52c158={'raw':![],'where':{'id':_0x3e1e9d['params']['id']}},_0x5349f3={};_0x5349f3[_0x4ebc('0x30')]=_[_0x4ebc('0x32')](db[_0x4ebc('0x2d')]['rawAttributes']);_0x5349f3[_0x4ebc('0x31')]=_[_0x4ebc('0x32')](_0x3e1e9d[_0x4ebc('0x31')]);_0x5349f3[_0x4ebc('0x33')]=_[_0x4ebc('0x34')](_0x5349f3[_0x4ebc('0x30')],_0x5349f3['query']);_0x52c158[_0x4ebc('0x35')]=_[_0x4ebc('0x34')](_0x5349f3['model'],qs[_0x4ebc('0x36')](_0x3e1e9d['query'][_0x4ebc('0x36')]));_0x52c158[_0x4ebc('0x35')]=_0x52c158[_0x4ebc('0x35')][_0x4ebc('0x37')]?_0x52c158['attributes']:_0x5349f3[_0x4ebc('0x30')];if(_0x3e1e9d[_0x4ebc('0x31')][_0x4ebc('0x41')]){_0x52c158[_0x4ebc('0x42')]=[{'all':!![]}];}_0x52c158=_['merge']({},_0x52c158,_0x3e1e9d['options']);return db[_0x4ebc('0x2d')][_0x4ebc('0x45')](_0x52c158)[_0x4ebc('0x26')](handleEntityNotFound(_0x504885,null))[_0x4ebc('0x26')](respondWithResult(_0x504885,null))[_0x4ebc('0x44')](handleError(_0x504885,null));};exports[_0x4ebc('0x46')]=function(_0x7ea2b1,_0x3fd0a0){return db['FreshdeskConfiguration'][_0x4ebc('0x46')](_0x7ea2b1[_0x4ebc('0x47')],{})[_0x4ebc('0x26')](respondWithResult(_0x3fd0a0,0xc9))[_0x4ebc('0x44')](handleError(_0x3fd0a0,null));};exports['update']=function(_0x30f283,_0x1442a0){if(_0x30f283[_0x4ebc('0x47')]['id']){delete _0x30f283['body']['id'];}return db[_0x4ebc('0x2d')][_0x4ebc('0x45')]({'where':{'id':_0x30f283['params']['id']}})[_0x4ebc('0x26')](handleEntityNotFound(_0x1442a0,null))['then'](saveUpdates(_0x30f283[_0x4ebc('0x47')],null))[_0x4ebc('0x26')](respondWithResult(_0x1442a0,null))['catch'](handleError(_0x1442a0,null));};exports['destroy']=function(_0x6021e0,_0x420d90){return db[_0x4ebc('0x2d')][_0x4ebc('0x45')]({'where':{'id':_0x6021e0[_0x4ebc('0x48')]['id']}})['then'](handleEntityNotFound(_0x420d90,null))['then'](removeEntity(_0x420d90,null))[_0x4ebc('0x44')](handleError(_0x420d90,null));};exports[_0x4ebc('0x49')]=function(_0x252b98,_0x3e1171,_0x4ee9a0){var _0xabc89c={};var _0x57ce6c={};var _0x4350ad;var _0x4e581a;return db[_0x4ebc('0x2d')][_0x4ebc('0x4a')]({'where':{'id':_0x252b98[_0x4ebc('0x48')]['id']}})[_0x4ebc('0x26')](handleEntityNotFound(_0x3e1171,null))[_0x4ebc('0x26')](function(_0x27fcca){if(_0x27fcca){_0x4350ad=_0x27fcca;_0x57ce6c['model']=_[_0x4ebc('0x32')](db['FreshdeskField'][_0x4ebc('0x2e')]);_0x57ce6c[_0x4ebc('0x31')]=_[_0x4ebc('0x32')](_0x252b98[_0x4ebc('0x31')]);_0x57ce6c['filters']=_[_0x4ebc('0x34')](_0x57ce6c['model'],_0x57ce6c[_0x4ebc('0x31')]);_0xabc89c['attributes']=_[_0x4ebc('0x34')](_0x57ce6c[_0x4ebc('0x30')],qs[_0x4ebc('0x36')](_0x252b98[_0x4ebc('0x31')][_0x4ebc('0x36')]));_0xabc89c[_0x4ebc('0x35')]=_0xabc89c[_0x4ebc('0x35')]['length']?_0xabc89c[_0x4ebc('0x35')]:_0x57ce6c[_0x4ebc('0x30')];_0xabc89c[_0x4ebc('0x3a')]=qs[_0x4ebc('0x3b')](_0x252b98[_0x4ebc('0x31')]['sort']);_0xabc89c['where']=qs['filters'](_[_0x4ebc('0x3d')](_0x252b98[_0x4ebc('0x31')],_0x57ce6c[_0x4ebc('0x33')]));if(_0x252b98[_0x4ebc('0x31')][_0x4ebc('0x3e')]){_0xabc89c['where']=_[_0x4ebc('0x3f')](_0xabc89c['where'],{'$or':_[_0x4ebc('0x2c')](_0xabc89c[_0x4ebc('0x35')],function(_0x4ad203){var _0x50e785={};_0x50e785[_0x4ad203]={'$like':'%'+_0x252b98[_0x4ebc('0x31')][_0x4ebc('0x3e')]+'%'};return _0x50e785;})});}_0xabc89c=_[_0x4ebc('0x3f')]({},_0xabc89c,_0x252b98['options']);return _0x4350ad[_0x4ebc('0x49')](_0xabc89c);}})['then'](function(_0x563d86){if(_0x563d86){_0x4e581a=_0x563d86[_0x4ebc('0x37')];if(!_0x252b98[_0x4ebc('0x31')][_0x4ebc('0x38')](_0x4ebc('0x39'))){_0xabc89c['limit']=qs[_0x4ebc('0x1e')](_0x252b98[_0x4ebc('0x31')][_0x4ebc('0x1e')]);_0xabc89c['offset']=qs[_0x4ebc('0x1f')](_0x252b98[_0x4ebc('0x31')][_0x4ebc('0x1f')]);}return _0x4350ad[_0x4ebc('0x49')](_0xabc89c);}})[_0x4ebc('0x26')](function(_0x2e8e63){if(_0x2e8e63){return _0x2e8e63?{'count':_0x4e581a,'rows':_0x2e8e63}:null;}})[_0x4ebc('0x26')](respondWithResult(_0x3e1171,null))[_0x4ebc('0x44')](handleError(_0x3e1171,null));};exports[_0x4ebc('0x4b')]=function(_0x28ca77,_0x539334,_0x571e91){var _0x5b843f={};var _0x20edb3={};var _0xecea6a;var _0x487e40;return db[_0x4ebc('0x2d')]['findOne']({'where':{'id':_0x28ca77['params']['id']}})[_0x4ebc('0x26')](handleEntityNotFound(_0x539334,null))[_0x4ebc('0x26')](function(_0x22301e){if(_0x22301e){_0xecea6a=_0x22301e;_0x20edb3[_0x4ebc('0x30')]=_[_0x4ebc('0x32')](db[_0x4ebc('0x4c')][_0x4ebc('0x2e')]);_0x20edb3[_0x4ebc('0x31')]=_[_0x4ebc('0x32')](_0x28ca77['query']);_0x20edb3[_0x4ebc('0x33')]=_[_0x4ebc('0x34')](_0x20edb3['model'],_0x20edb3[_0x4ebc('0x31')]);_0x5b843f[_0x4ebc('0x35')]=_[_0x4ebc('0x34')](_0x20edb3[_0x4ebc('0x30')],qs[_0x4ebc('0x36')](_0x28ca77[_0x4ebc('0x31')][_0x4ebc('0x36')]));_0x5b843f['attributes']=_0x5b843f[_0x4ebc('0x35')][_0x4ebc('0x37')]?_0x5b843f[_0x4ebc('0x35')]:_0x20edb3[_0x4ebc('0x30')];_0x5b843f['order']=qs[_0x4ebc('0x3b')](_0x28ca77[_0x4ebc('0x31')][_0x4ebc('0x3b')]);_0x5b843f[_0x4ebc('0x3c')]=qs['filters'](_[_0x4ebc('0x3d')](_0x28ca77[_0x4ebc('0x31')],_0x20edb3[_0x4ebc('0x33')]));if(_0x28ca77[_0x4ebc('0x31')][_0x4ebc('0x3e')]){_0x5b843f[_0x4ebc('0x3c')]=_['merge'](_0x5b843f[_0x4ebc('0x3c')],{'$or':_[_0x4ebc('0x2c')](_0x5b843f['attributes'],function(_0x106c2f){var _0x21188d={};_0x21188d[_0x106c2f]={'$like':'%'+_0x28ca77[_0x4ebc('0x31')][_0x4ebc('0x3e')]+'%'};return _0x21188d;})});}_0x5b843f=_['merge']({},_0x5b843f,_0x28ca77['options']);return _0xecea6a[_0x4ebc('0x4b')](_0x5b843f);}})['then'](function(_0x3806a3){if(_0x3806a3){_0x487e40=_0x3806a3[_0x4ebc('0x37')];if(!_0x28ca77[_0x4ebc('0x31')][_0x4ebc('0x38')](_0x4ebc('0x39'))){_0x5b843f[_0x4ebc('0x1e')]=qs[_0x4ebc('0x1e')](_0x28ca77['query'][_0x4ebc('0x1e')]);_0x5b843f['offset']=qs[_0x4ebc('0x1f')](_0x28ca77[_0x4ebc('0x31')][_0x4ebc('0x1f')]);}return _0xecea6a['getSubjects'](_0x5b843f);}})[_0x4ebc('0x26')](function(_0x533445){if(_0x533445){return _0x533445?{'count':_0x487e40,'rows':_0x533445}:null;}})[_0x4ebc('0x26')](respondWithResult(_0x539334,null))[_0x4ebc('0x44')](handleError(_0x539334,null));};exports['getDescriptions']=function(_0x13c94f,_0x31399f,_0x2825dd){var _0x177a68={};var _0x4d6b7c={};var _0x3908a3;var _0x2e4d6e;return db[_0x4ebc('0x2d')][_0x4ebc('0x4a')]({'where':{'id':_0x13c94f[_0x4ebc('0x48')]['id']}})[_0x4ebc('0x26')](handleEntityNotFound(_0x31399f,null))['then'](function(_0x139746){if(_0x139746){_0x3908a3=_0x139746;_0x4d6b7c['model']=_[_0x4ebc('0x32')](db[_0x4ebc('0x4c')][_0x4ebc('0x2e')]);_0x4d6b7c['query']=_['keys'](_0x13c94f['query']);_0x4d6b7c[_0x4ebc('0x33')]=_['intersection'](_0x4d6b7c[_0x4ebc('0x30')],_0x4d6b7c[_0x4ebc('0x31')]);_0x177a68[_0x4ebc('0x35')]=_[_0x4ebc('0x34')](_0x4d6b7c[_0x4ebc('0x30')],qs[_0x4ebc('0x36')](_0x13c94f[_0x4ebc('0x31')]['fields']));_0x177a68[_0x4ebc('0x35')]=_0x177a68[_0x4ebc('0x35')][_0x4ebc('0x37')]?_0x177a68[_0x4ebc('0x35')]:_0x4d6b7c[_0x4ebc('0x30')];_0x177a68[_0x4ebc('0x3a')]=qs[_0x4ebc('0x3b')](_0x13c94f[_0x4ebc('0x31')][_0x4ebc('0x3b')]);_0x177a68['where']=qs[_0x4ebc('0x33')](_['pick'](_0x13c94f[_0x4ebc('0x31')],_0x4d6b7c[_0x4ebc('0x33')]));if(_0x13c94f[_0x4ebc('0x31')][_0x4ebc('0x3e')]){_0x177a68[_0x4ebc('0x3c')]=_['merge'](_0x177a68[_0x4ebc('0x3c')],{'$or':_['map'](_0x177a68['attributes'],function(_0x5e982d){var _0x10eb5a={};_0x10eb5a[_0x5e982d]={'$like':'%'+_0x13c94f[_0x4ebc('0x31')]['filter']+'%'};return _0x10eb5a;})});}_0x177a68=_[_0x4ebc('0x3f')]({},_0x177a68,_0x13c94f[_0x4ebc('0x4d')]);return _0x3908a3[_0x4ebc('0x4e')](_0x177a68);}})[_0x4ebc('0x26')](function(_0xb120f3){if(_0xb120f3){_0x2e4d6e=_0xb120f3[_0x4ebc('0x37')];if(!_0x13c94f['query'][_0x4ebc('0x38')]('nolimit')){_0x177a68[_0x4ebc('0x1e')]=qs[_0x4ebc('0x1e')](_0x13c94f[_0x4ebc('0x31')][_0x4ebc('0x1e')]);_0x177a68[_0x4ebc('0x1f')]=qs[_0x4ebc('0x1f')](_0x13c94f[_0x4ebc('0x31')][_0x4ebc('0x1f')]);}return _0x3908a3['getDescriptions'](_0x177a68);}})['then'](function(_0x5d30eb){if(_0x5d30eb){return _0x5d30eb?{'count':_0x2e4d6e,'rows':_0x5d30eb}:null;}})[_0x4ebc('0x26')](respondWithResult(_0x31399f,null))[_0x4ebc('0x44')](handleError(_0x31399f,null));};exports['getTags']=function(_0x15cf90,_0x4790e6,_0x2b9837){var _0x591235={};var _0x137414={};var _0x150066;var _0x26686c;return db[_0x4ebc('0x2d')][_0x4ebc('0x4a')]({'where':{'id':_0x15cf90['params']['id']}})['then'](handleEntityNotFound(_0x4790e6,null))[_0x4ebc('0x26')](function(_0x4a9ee8){if(_0x4a9ee8){_0x150066=_0x4a9ee8;_0x137414[_0x4ebc('0x30')]=_[_0x4ebc('0x32')](db[_0x4ebc('0x4f')][_0x4ebc('0x2e')]);_0x137414[_0x4ebc('0x31')]=_[_0x4ebc('0x32')](_0x15cf90['query']);_0x137414[_0x4ebc('0x33')]=_[_0x4ebc('0x34')](_0x137414[_0x4ebc('0x30')],_0x137414['query']);_0x591235[_0x4ebc('0x35')]=_['intersection'](_0x137414[_0x4ebc('0x30')],qs[_0x4ebc('0x36')](_0x15cf90[_0x4ebc('0x31')][_0x4ebc('0x36')]));_0x591235['attributes']=_0x591235[_0x4ebc('0x35')][_0x4ebc('0x37')]?_0x591235['attributes']:_0x137414[_0x4ebc('0x30')];_0x591235[_0x4ebc('0x3a')]=qs[_0x4ebc('0x3b')](_0x15cf90[_0x4ebc('0x31')][_0x4ebc('0x3b')]);_0x591235['where']=qs[_0x4ebc('0x33')](_['pick'](_0x15cf90['query'],_0x137414['filters']));if(_0x15cf90['query'][_0x4ebc('0x3e')]){_0x591235[_0x4ebc('0x3c')]=_[_0x4ebc('0x3f')](_0x591235[_0x4ebc('0x3c')],{'$or':_[_0x4ebc('0x2c')](_0x591235[_0x4ebc('0x35')],function(_0x3df964){var _0x35964f={};_0x35964f[_0x3df964]={'$like':'%'+_0x15cf90['query'][_0x4ebc('0x3e')]+'%'};return _0x35964f;})});}_0x591235=_[_0x4ebc('0x3f')]({},_0x591235,_0x15cf90[_0x4ebc('0x4d')]);return _0x150066[_0x4ebc('0x50')](_0x591235);}})[_0x4ebc('0x26')](function(_0x14f693){if(_0x14f693){_0x26686c=_0x14f693[_0x4ebc('0x37')];if(!_0x15cf90['query'][_0x4ebc('0x38')](_0x4ebc('0x39'))){_0x591235[_0x4ebc('0x1e')]=qs[_0x4ebc('0x1e')](_0x15cf90[_0x4ebc('0x31')][_0x4ebc('0x1e')]);_0x591235[_0x4ebc('0x1f')]=qs[_0x4ebc('0x1f')](_0x15cf90[_0x4ebc('0x31')][_0x4ebc('0x1f')]);}return _0x150066[_0x4ebc('0x50')](_0x591235);}})[_0x4ebc('0x26')](function(_0x4d3de4){if(_0x4d3de4){return _0x4d3de4?{'count':_0x26686c,'rows':_0x4d3de4}:null;}})[_0x4ebc('0x26')](respondWithResult(_0x4790e6,null))['catch'](handleError(_0x4790e6,null));};exports[_0x4ebc('0x51')]=function(_0x32403c,_0xc0f37d,_0x5ee36a){if(_0x32403c[_0x4ebc('0x47')]['id']){delete _0x32403c[_0x4ebc('0x47')]['id'];}return db[_0x4ebc('0x2d')]['findOne']({'where':{'id':_0x32403c[_0x4ebc('0x48')]['id']}})[_0x4ebc('0x26')](handleEntityNotFound(_0xc0f37d,null))[_0x4ebc('0x26')](function(_0x23959a){if(_0x23959a){return _0x23959a[_0x4ebc('0x51')](_0x32403c[_0x4ebc('0x47')][_0x4ebc('0x52')]||[]);}return null;})[_0x4ebc('0x26')](respondWithResult(_0xc0f37d,null))[_0x4ebc('0x44')](handleError(_0xc0f37d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1bb989d..5dd765e 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 _0x1dd7=['FreshdeskConfiguration','lodash','api','moment','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x251db6,_0x447de6){var _0x1f98df=function(_0x2d47e4){while(--_0x2d47e4){_0x251db6['push'](_0x251db6['shift']());}};_0x1f98df(++_0x447de6);}(_0x1dd7,0x79));var _0x71dd=function(_0x5400b,_0x55943a){_0x5400b=_0x5400b-0x0;var _0x36a39b=_0x1dd7[_0x5400b];return _0x36a39b;};'use strict';var _=require(_0x71dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x71dd('0x1'));var moment=require(_0x71dd('0x2'));var BPromise=require(_0x71dd('0x3'));var rp=require(_0x71dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71dd('0x5'));var config=require('../../config/environment');var attributes=require(_0x71dd('0x6'));module[_0x71dd('0x7')]=function(_0x33390a,_0x1d9c42){return _0x33390a[_0x71dd('0x8')](_0x71dd('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1770=['moment','bluebird','request-promise','./intFreshdeskConfiguration.attributes','exports','int_freshdesk_configurations','util','../../config/logger','api'];(function(_0x21f47b,_0x370dfd){var _0x51bed6=function(_0x12abe4){while(--_0x12abe4){_0x21f47b['push'](_0x21f47b['shift']());}};_0x51bed6(++_0x370dfd);}(_0x1770,0x1d1));var _0x0177=function(_0x60aa5e,_0x4ffcc6){_0x60aa5e=_0x60aa5e-0x0;var _0xc5062c=_0x1770[_0x60aa5e];return _0xc5062c;};'use strict';var _=require('lodash');var util=require(_0x0177('0x0'));var logger=require(_0x0177('0x1'))(_0x0177('0x2'));var moment=require(_0x0177('0x3'));var BPromise=require(_0x0177('0x4'));var rp=require(_0x0177('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0177('0x6'));module[_0x0177('0x7')]=function(_0x4f3156,_0x44f198){return _0x4f3156['define']('FreshdeskConfiguration',attributes,{'tableName':_0x0177('0x8'),'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 ea60df3..656f40d 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 _0xf434=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util'];(function(_0x500578,_0x5dc525){var _0x43d72b=function(_0x1facab){while(--_0x1facab){_0x500578['push'](_0x500578['shift']());}};_0x43d72b(++_0x5dc525);}(_0xf434,0x139));var _0x4f43=function(_0x41f5c0,_0x52b6a0){_0x41f5c0=_0x41f5c0-0x0;var _0x5e9fe7=_0xf434[_0x41f5c0];return _0x5e9fe7;};'use strict';var _=require(_0x4f43('0x0'));var util=require(_0x4f43('0x1'));var moment=require(_0x4f43('0x2'));var BPromise=require(_0x4f43('0x3'));var rs=require(_0x4f43('0x4'));var fs=require('fs');var Redis=require(_0x4f43('0x5'));var db=require(_0x4f43('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f43('0x7'));var config=require(_0x4f43('0x8'));var jayson=require(_0x4f43('0x9'));var client=jayson['client'][_0x4f43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27feb6,_0x2240e6,_0x209042){return new BPromise(function(_0x2b9ea8,_0x838f93){return client[_0x4f43('0xb')](_0x27feb6,_0x209042)['then'](function(_0x356b7e){logger[_0x4f43('0xc')](_0x4f43('0xd'),_0x2240e6,'request\x20sent');logger['debug'](_0x4f43('0xe'),_0x2240e6,'request\x20sent',JSON[_0x4f43('0xf')](_0x356b7e));if(_0x356b7e['error']){if(_0x356b7e[_0x4f43('0x10')][_0x4f43('0x11')]===0x1f4){logger[_0x4f43('0x10')](_0x4f43('0xd'),_0x2240e6,_0x356b7e[_0x4f43('0x10')]['message']);return _0x838f93(_0x356b7e[_0x4f43('0x10')][_0x4f43('0x12')]);}logger['error'](_0x4f43('0xd'),_0x2240e6,_0x356b7e[_0x4f43('0x10')][_0x4f43('0x12')]);return _0x2b9ea8(_0x356b7e['error'][_0x4f43('0x12')]);}else{logger['info'](_0x4f43('0xd'),_0x2240e6,_0x4f43('0x13'));_0x2b9ea8(_0x356b7e[_0x4f43('0x14')][_0x4f43('0x12')]);}})['catch'](function(_0x527d87){logger[_0x4f43('0x10')](_0x4f43('0xd'),_0x2240e6,_0x527d87);_0x838f93(_0x527d87);});});} \ No newline at end of file +var _0x39b6=['message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x39b6,0xf4));var _0x639b=function(_0x462e40,_0x6d9fff){_0x462e40=_0x462e40-0x0;var _0x38f6ff=_0x39b6[_0x462e40];return _0x38f6ff;};'use strict';var _=require(_0x639b('0x0'));var util=require(_0x639b('0x1'));var moment=require(_0x639b('0x2'));var BPromise=require('bluebird');var rs=require(_0x639b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x639b('0x4'))['db'];var utils=require(_0x639b('0x5'));var logger=require('../../config/logger')(_0x639b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x639b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3144d0,_0x716833,_0x20b78b){return new BPromise(function(_0x19568f,_0x504661){return client['request'](_0x3144d0,_0x20b78b)[_0x639b('0x8')](function(_0x290e58){logger['info'](_0x639b('0x9'),_0x716833,_0x639b('0xa'));logger[_0x639b('0xb')](_0x639b('0xc'),_0x716833,_0x639b('0xa'),JSON[_0x639b('0xd')](_0x290e58));if(_0x290e58['error']){if(_0x290e58['error'][_0x639b('0xe')]===0x1f4){logger[_0x639b('0xf')](_0x639b('0x9'),_0x716833,_0x290e58['error']['message']);return _0x504661(_0x290e58[_0x639b('0xf')]['message']);}logger[_0x639b('0xf')](_0x639b('0x9'),_0x716833,_0x290e58[_0x639b('0xf')][_0x639b('0x10')]);return _0x19568f(_0x290e58[_0x639b('0xf')][_0x639b('0x10')]);}else{logger[_0x639b('0x11')](_0x639b('0x9'),_0x716833,_0x639b('0xa'));_0x19568f(_0x290e58[_0x639b('0x12')][_0x639b('0x10')]);}})[_0x639b('0x13')](function(_0xe728fd){logger['error'](_0x639b('0x9'),_0x716833,_0xe728fd);_0x504661(_0xe728fd);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0037bc4..54cab25 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 _0xc1f0=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0xc1f0,0x109));var _0x0c1f=function(_0x154489,_0x543e90){_0x154489=_0x154489-0x0;var _0x16a870=_0xc1f0[_0x154489];return _0x16a870;};'use strict';var multer=require(_0x0c1f('0x0'));var util=require(_0x0c1f('0x1'));var path=require(_0x0c1f('0x2'));var timeout=require(_0x0c1f('0x3'));var express=require(_0x0c1f('0x4'));var router=express[_0x0c1f('0x5')]();var fs_extra=require(_0x0c1f('0x6'));var auth=require(_0x0c1f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c1f('0x8'));router[_0x0c1f('0x9')]('/',auth[_0x0c1f('0xa')](),controller[_0x0c1f('0xb')]);router['get'](_0x0c1f('0xc'),auth[_0x0c1f('0xa')](),controller[_0x0c1f('0xd')]);router[_0x0c1f('0xe')]('/',auth[_0x0c1f('0xa')](),controller[_0x0c1f('0xf')]);router[_0x0c1f('0x10')](_0x0c1f('0xc'),auth['isAuthenticated'](),controller[_0x0c1f('0x11')]);router['delete'](_0x0c1f('0xc'),auth[_0x0c1f('0xa')](),controller[_0x0c1f('0x12')]);module[_0x0c1f('0x13')]=router; \ No newline at end of file +var _0x06cf=['destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','index','isAuthenticated','post','create','put','/:id','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06cf,0x6e));var _0xf06c=function(_0x55b9f9,_0x1c1467){_0x55b9f9=_0x55b9f9-0x0;var _0xf92b79=_0x06cf[_0x55b9f9];return _0xf92b79;};'use strict';var multer=require('multer');var util=require(_0xf06c('0x0'));var path=require(_0xf06c('0x1'));var timeout=require('connect-timeout');var express=require(_0xf06c('0x2'));var router=express[_0xf06c('0x3')]();var fs_extra=require(_0xf06c('0x4'));var auth=require(_0xf06c('0x5'));var interaction=require(_0xf06c('0x6'));var config=require('../../config/environment');var controller=require(_0xf06c('0x7'));router[_0xf06c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf06c('0x9')]);router[_0xf06c('0x8')]('/:id',auth[_0xf06c('0xa')](),controller['show']);router[_0xf06c('0xb')]('/',auth['isAuthenticated'](),controller[_0xf06c('0xc')]);router[_0xf06c('0xd')](_0xf06c('0xe'),auth[_0xf06c('0xa')](),controller['update']);router[_0xf06c('0xf')](_0xf06c('0xe'),auth[_0xf06c('0xa')](),controller[_0xf06c('0x10')]);module[_0xf06c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 0e05a9c..880ac59 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 _0x00a6=['BOOLEAN','sequelize','exports','ENUM','string','variable','STRING','customVariable'];(function(_0x333f4c,_0x35618f){var _0x16905c=function(_0x5dcb5b){while(--_0x5dcb5b){_0x333f4c['push'](_0x333f4c['shift']());}};_0x16905c(++_0x35618f);}(_0x00a6,0x1d1));var _0x600a=function(_0x5a7c25,_0x1e545e){_0x5a7c25=_0x5a7c25-0x0;var _0x1d9eca=_0x00a6[_0x5a7c25];return _0x1d9eca;};'use strict';var Sequelize=require(_0x600a('0x0'));module[_0x600a('0x1')]={'type':{'type':Sequelize[_0x600a('0x2')](_0x600a('0x3'),_0x600a('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0x600a('0x3')},'content':{'type':Sequelize[_0x600a('0x5')]},'key':{'type':Sequelize[_0x600a('0x5')]},'keyType':{'type':Sequelize[_0x600a('0x2')](_0x600a('0x3'),_0x600a('0x4'),_0x600a('0x6'))},'keyContent':{'type':Sequelize[_0x600a('0x5')]},'idField':{'type':Sequelize[_0x600a('0x5')]},'nameField':{'type':Sequelize[_0x600a('0x5')]},'customField':{'type':Sequelize[_0x600a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x600a('0x5')]}}; \ No newline at end of file +var _0x2e73=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x2c05a6,_0x2d1199){var _0x13b89b=function(_0x1320a9){while(--_0x1320a9){_0x2c05a6['push'](_0x2c05a6['shift']());}};_0x13b89b(++_0x2d1199);}(_0x2e73,0x16b));var _0x32e7=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x2e73[_0x31c19c];return _0x1a87f7;};'use strict';var Sequelize=require('sequelize');module[_0x32e7('0x0')]={'type':{'type':Sequelize[_0x32e7('0x1')](_0x32e7('0x2'),_0x32e7('0x3'),_0x32e7('0x4'),_0x32e7('0x5'),_0x32e7('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x32e7('0x7')]},'key':{'type':Sequelize[_0x32e7('0x7')]},'keyType':{'type':Sequelize[_0x32e7('0x1')](_0x32e7('0x2'),_0x32e7('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x32e7('0x7')]},'nameField':{'type':Sequelize[_0x32e7('0x7')]},'customField':{'type':Sequelize[_0x32e7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32e7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index a1da80b..e9c566a 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 _0x2dae=['undefined','limit','offset','count','Content-Range','json','apply','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','FreshdeskField','includeAll','include','findAll','rows','catch','params','keys','merge','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x5540b1,_0x59f197){var _0x2f464e=function(_0x758f9){while(--_0x758f9){_0x5540b1['push'](_0x5540b1['shift']());}};_0x2f464e(++_0x59f197);}(_0x2dae,0xc3));var _0xe2da=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x2dae[_0x247fa1];return _0x244f35;};'use strict';var emlformat=require(_0xe2da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2da('0x1'));var jsonpatch=require(_0xe2da('0x2'));var rp=require(_0xe2da('0x3'));var moment=require(_0xe2da('0x4'));var BPromise=require(_0xe2da('0x5'));var Mustache=require('mustache');var util=require(_0xe2da('0x6'));var path=require(_0xe2da('0x7'));var sox=require(_0xe2da('0x8'));var csv=require(_0xe2da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2da('0xa'));var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x9'));var querystring=require(_0xe2da('0x10'));var Papa=require(_0xe2da('0x11'));var Redis=require('ioredis');var authService=require(_0xe2da('0x12'));var qs=require(_0xe2da('0x13'));var as=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2da('0x1a'))['db'];function respondWithStatusCode(_0x5200b1,_0x4377c6){_0x4377c6=_0x4377c6||0xcc;return function(_0x245ad7){if(_0x245ad7){return _0x5200b1[_0xe2da('0x1b')](_0x4377c6);}return _0x5200b1[_0xe2da('0x1c')](_0x4377c6)[_0xe2da('0x1d')]();};}function respondWithResult(_0x5660b5,_0x295a86){_0x295a86=_0x295a86||0xc8;return function(_0x48584b){if(_0x48584b){return _0x5660b5[_0xe2da('0x1c')](_0x295a86)['json'](_0x48584b);}};}function respondWithFilteredResult(_0x586b27,_0x403d1c){return function(_0x3dfc52){if(_0x3dfc52){var _0x33f919=typeof _0x403d1c['offset']===_0xe2da('0x1e')&&typeof _0x403d1c[_0xe2da('0x1f')]===_0xe2da('0x1e');var _0x33568f=_0x3dfc52['count'];var _0x45bb92=_0x33f919?0x0:_0x403d1c[_0xe2da('0x20')];var _0x417363=_0x33f919?_0x3dfc52[_0xe2da('0x21')]:_0x403d1c[_0xe2da('0x20')]+_0x403d1c['limit'];var _0x56eeb1;if(_0x417363>=_0x33568f){_0x417363=_0x33568f;_0x56eeb1=0xc8;}else{_0x56eeb1=0xce;}_0x586b27[_0xe2da('0x1c')](_0x56eeb1);return _0x586b27['set'](_0xe2da('0x22'),_0x45bb92+'-'+_0x417363+'/'+_0x33568f)[_0xe2da('0x23')](_0x3dfc52);}return null;};}function patchUpdates(_0x332193){return function(_0x203d36){try{jsonpatch[_0xe2da('0x24')](_0x203d36,_0x332193,!![]);}catch(_0x3e22de){return BPromise['reject'](_0x3e22de);}return _0x203d36[_0xe2da('0x25')]();};}function saveUpdates(_0x53cc4e,_0x30efdc){return function(_0x191d38){if(_0x191d38){return _0x191d38[_0xe2da('0x26')](_0x53cc4e)[_0xe2da('0x27')](function(_0x30dea4){return _0x30dea4;});}return null;};}function removeEntity(_0x1e45e9,_0x38f2c4){return function(_0x221e98){if(_0x221e98){return _0x221e98['destroy']()[_0xe2da('0x27')](function(){_0x1e45e9[_0xe2da('0x1c')](0xcc)[_0xe2da('0x1d')]();});}};}function handleEntityNotFound(_0x14704d,_0x3778dc){return function(_0x230fb8){if(!_0x230fb8){_0x14704d[_0xe2da('0x1b')](0x194);}return _0x230fb8;};}function handleError(_0x56c37e,_0x2adc49){_0x2adc49=_0x2adc49||0x1f4;return function(_0x3e23d7){logger[_0xe2da('0x28')](_0x3e23d7[_0xe2da('0x29')]);if(_0x3e23d7[_0xe2da('0x2a')]){delete _0x3e23d7[_0xe2da('0x2a')];}_0x56c37e[_0xe2da('0x1c')](_0x2adc49)[_0xe2da('0x2b')](_0x3e23d7);};}exports['index']=function(_0x487a7c,_0x5e259a){var _0x3c4845={},_0x8c91db={},_0x4146ad={'count':0x0,'rows':[]};var _0x1ab91a=_['map'](db['FreshdeskField'][_0xe2da('0x2c')],function(_0x1ec8ca){return{'name':_0x1ec8ca[_0xe2da('0x2d')],'type':_0x1ec8ca[_0xe2da('0x2e')][_0xe2da('0x2f')]};});_0x8c91db[_0xe2da('0x30')]=_[_0xe2da('0x31')](_0x1ab91a,_0xe2da('0x2a'));_0x8c91db[_0xe2da('0x32')]=_['keys'](_0x487a7c['query']);_0x8c91db[_0xe2da('0x33')]=_[_0xe2da('0x34')](_0x8c91db[_0xe2da('0x30')],_0x8c91db[_0xe2da('0x32')]);_0x3c4845[_0xe2da('0x35')]=_[_0xe2da('0x34')](_0x8c91db[_0xe2da('0x30')],qs[_0xe2da('0x36')](_0x487a7c[_0xe2da('0x32')][_0xe2da('0x36')]));_0x3c4845[_0xe2da('0x35')]=_0x3c4845[_0xe2da('0x35')][_0xe2da('0x37')]?_0x3c4845[_0xe2da('0x35')]:_0x8c91db[_0xe2da('0x30')];if(!_0x487a7c[_0xe2da('0x32')][_0xe2da('0x38')](_0xe2da('0x39'))){_0x3c4845['limit']=qs[_0xe2da('0x1f')](_0x487a7c[_0xe2da('0x32')][_0xe2da('0x1f')]);_0x3c4845['offset']=qs[_0xe2da('0x20')](_0x487a7c[_0xe2da('0x32')][_0xe2da('0x20')]);}_0x3c4845['order']=qs['sort'](_0x487a7c[_0xe2da('0x32')][_0xe2da('0x3a')]);_0x3c4845['where']=qs[_0xe2da('0x33')](_[_0xe2da('0x3b')](_0x487a7c[_0xe2da('0x32')],_0x8c91db[_0xe2da('0x33')]),_0x1ab91a);if(_0x487a7c[_0xe2da('0x32')]['filter']){_0x3c4845[_0xe2da('0x3c')]=_['merge'](_0x3c4845['where'],{'$or':_[_0xe2da('0x31')](_0x1ab91a,function(_0x561afb){if(_0x561afb[_0xe2da('0x2e')]!==_0xe2da('0x3d')){var _0x54d8a3={};_0x54d8a3[_0x561afb[_0xe2da('0x2a')]]={'$like':'%'+_0x487a7c[_0xe2da('0x32')]['filter']+'%'};return _0x54d8a3;}})});}_0x3c4845=_['merge']({},_0x3c4845,_0x487a7c['options']);var _0x2d9c0a={'where':_0x3c4845[_0xe2da('0x3c')]};return db[_0xe2da('0x3e')][_0xe2da('0x21')](_0x2d9c0a)[_0xe2da('0x27')](function(_0xdf6ea6){_0x4146ad[_0xe2da('0x21')]=_0xdf6ea6;if(_0x487a7c['query'][_0xe2da('0x3f')]){_0x3c4845[_0xe2da('0x40')]=[{'all':!![]}];}return db[_0xe2da('0x3e')][_0xe2da('0x41')](_0x3c4845);})[_0xe2da('0x27')](function(_0x5a1550){_0x4146ad[_0xe2da('0x42')]=_0x5a1550;return _0x4146ad;})[_0xe2da('0x27')](respondWithFilteredResult(_0x5e259a,_0x3c4845))[_0xe2da('0x43')](handleError(_0x5e259a,null));};exports['show']=function(_0x24d748,_0x279f67){var _0x1529f4={'raw':!![],'where':{'id':_0x24d748[_0xe2da('0x44')]['id']}},_0x4096c5={};_0x4096c5[_0xe2da('0x30')]=_[_0xe2da('0x45')](db[_0xe2da('0x3e')]['rawAttributes']);_0x4096c5[_0xe2da('0x32')]=_[_0xe2da('0x45')](_0x24d748[_0xe2da('0x32')]);_0x4096c5[_0xe2da('0x33')]=_[_0xe2da('0x34')](_0x4096c5['model'],_0x4096c5[_0xe2da('0x32')]);_0x1529f4[_0xe2da('0x35')]=_[_0xe2da('0x34')](_0x4096c5[_0xe2da('0x30')],qs[_0xe2da('0x36')](_0x24d748[_0xe2da('0x32')][_0xe2da('0x36')]));_0x1529f4['attributes']=_0x1529f4[_0xe2da('0x35')]['length']?_0x1529f4[_0xe2da('0x35')]:_0x4096c5[_0xe2da('0x30')];if(_0x24d748[_0xe2da('0x32')]['includeAll']){_0x1529f4[_0xe2da('0x40')]=[{'all':!![]}];}_0x1529f4=_[_0xe2da('0x46')]({},_0x1529f4,_0x24d748['options']);return db[_0xe2da('0x3e')][_0xe2da('0x47')](_0x1529f4)[_0xe2da('0x27')](handleEntityNotFound(_0x279f67,null))['then'](respondWithResult(_0x279f67,null))[_0xe2da('0x43')](handleError(_0x279f67,null));};exports['create']=function(_0x4e9444,_0x16a393){return db['FreshdeskField'][_0xe2da('0x48')](_0x4e9444[_0xe2da('0x49')],{})['then'](respondWithResult(_0x16a393,0xc9))[_0xe2da('0x43')](handleError(_0x16a393,null));};exports[_0xe2da('0x26')]=function(_0x482547,_0x4a6d80){if(_0x482547[_0xe2da('0x49')]['id']){delete _0x482547['body']['id'];}return db[_0xe2da('0x3e')][_0xe2da('0x47')]({'where':{'id':_0x482547[_0xe2da('0x44')]['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x4a6d80,null))[_0xe2da('0x27')](saveUpdates(_0x482547[_0xe2da('0x49')],null))[_0xe2da('0x27')](respondWithResult(_0x4a6d80,null))[_0xe2da('0x43')](handleError(_0x4a6d80,null));};exports[_0xe2da('0x4a')]=function(_0x515f9b,_0x3ce9a8){return db[_0xe2da('0x3e')][_0xe2da('0x47')]({'where':{'id':_0x515f9b['params']['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x3ce9a8,null))[_0xe2da('0x27')](removeEntity(_0x3ce9a8,null))[_0xe2da('0x43')](handleError(_0x3ce9a8,null));}; \ No newline at end of file +var _0x16d2=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','merge','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x440fb5,_0x3ef1d5){var _0x5b340a=function(_0x34aedf){while(--_0x34aedf){_0x440fb5['push'](_0x440fb5['shift']());}};_0x5b340a(++_0x3ef1d5);}(_0x16d2,0x123));var _0x216d=function(_0x2703b4,_0x327991){_0x2703b4=_0x2703b4-0x0;var _0x394cdf=_0x16d2[_0x2703b4];return _0x394cdf;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x5998a1,_0x4ec8a7){return function(_0x56460f){if(!_0x56460f){_0x5998a1['sendStatus'](0x194);}return _0x56460f;};}function handleError(_0x5eb444,_0x32f240){_0x32f240=_0x32f240||0x1f4;return function(_0x470d8a){logger[_0x216d('0x28')](_0x470d8a[_0x216d('0x29')]);if(_0x470d8a[_0x216d('0x2a')]){delete _0x470d8a['name'];}_0x5eb444['status'](_0x32f240)[_0x216d('0x2b')](_0x470d8a);};}exports['index']=function(_0x23d1c3,_0x42abbe){var _0x10f7c6={},_0x20bc16={},_0x307f2b={'count':0x0,'rows':[]};var _0x12bcab=_[_0x216d('0x2c')](db[_0x216d('0x2d')][_0x216d('0x2e')],function(_0x28f56a){return{'name':_0x28f56a[_0x216d('0x2f')],'type':_0x28f56a[_0x216d('0x30')][_0x216d('0x31')]};});_0x20bc16['model']=_[_0x216d('0x2c')](_0x12bcab,_0x216d('0x2a'));_0x20bc16[_0x216d('0x32')]=_['keys'](_0x23d1c3[_0x216d('0x32')]);_0x20bc16[_0x216d('0x33')]=_[_0x216d('0x34')](_0x20bc16[_0x216d('0x35')],_0x20bc16['query']);_0x10f7c6[_0x216d('0x36')]=_[_0x216d('0x34')](_0x20bc16[_0x216d('0x35')],qs[_0x216d('0x37')](_0x23d1c3[_0x216d('0x32')][_0x216d('0x37')]));_0x10f7c6[_0x216d('0x36')]=_0x10f7c6[_0x216d('0x36')][_0x216d('0x38')]?_0x10f7c6[_0x216d('0x36')]:_0x20bc16[_0x216d('0x35')];if(!_0x23d1c3['query'][_0x216d('0x39')](_0x216d('0x3a'))){_0x10f7c6[_0x216d('0x21')]=qs['limit'](_0x23d1c3[_0x216d('0x32')][_0x216d('0x21')]);_0x10f7c6['offset']=qs[_0x216d('0x1f')](_0x23d1c3['query']['offset']);}_0x10f7c6[_0x216d('0x3b')]=qs[_0x216d('0x3c')](_0x23d1c3[_0x216d('0x32')][_0x216d('0x3c')]);_0x10f7c6['where']=qs['filters'](_['pick'](_0x23d1c3[_0x216d('0x32')],_0x20bc16[_0x216d('0x33')]),_0x12bcab);if(_0x23d1c3['query'][_0x216d('0x3d')]){_0x10f7c6[_0x216d('0x3e')]=_['merge'](_0x10f7c6[_0x216d('0x3e')],{'$or':_[_0x216d('0x2c')](_0x12bcab,function(_0x2476a0){if(_0x2476a0[_0x216d('0x30')]!==_0x216d('0x3f')){var _0x2e857e={};_0x2e857e[_0x2476a0[_0x216d('0x2a')]]={'$like':'%'+_0x23d1c3[_0x216d('0x32')]['filter']+'%'};return _0x2e857e;}})});}_0x10f7c6=_['merge']({},_0x10f7c6,_0x23d1c3[_0x216d('0x40')]);var _0x2be24f={'where':_0x10f7c6['where']};return db[_0x216d('0x2d')][_0x216d('0x22')](_0x2be24f)[_0x216d('0x27')](function(_0x47f796){_0x307f2b[_0x216d('0x22')]=_0x47f796;if(_0x23d1c3[_0x216d('0x32')][_0x216d('0x41')]){_0x10f7c6[_0x216d('0x42')]=[{'all':!![]}];}return db['FreshdeskField'][_0x216d('0x43')](_0x10f7c6);})[_0x216d('0x27')](function(_0x5665d7){_0x307f2b[_0x216d('0x44')]=_0x5665d7;return _0x307f2b;})[_0x216d('0x27')](respondWithFilteredResult(_0x42abbe,_0x10f7c6))['catch'](handleError(_0x42abbe,null));};exports['show']=function(_0x330ec8,_0x440bc9){var _0x3c491e={'raw':!![],'where':{'id':_0x330ec8[_0x216d('0x45')]['id']}},_0x498efe={};_0x498efe['model']=_['keys'](db[_0x216d('0x2d')][_0x216d('0x2e')]);_0x498efe[_0x216d('0x32')]=_['keys'](_0x330ec8[_0x216d('0x32')]);_0x498efe['filters']=_[_0x216d('0x34')](_0x498efe[_0x216d('0x35')],_0x498efe[_0x216d('0x32')]);_0x3c491e['attributes']=_[_0x216d('0x34')](_0x498efe[_0x216d('0x35')],qs[_0x216d('0x37')](_0x330ec8[_0x216d('0x32')]['fields']));_0x3c491e['attributes']=_0x3c491e['attributes'][_0x216d('0x38')]?_0x3c491e[_0x216d('0x36')]:_0x498efe[_0x216d('0x35')];if(_0x330ec8[_0x216d('0x32')][_0x216d('0x41')]){_0x3c491e[_0x216d('0x42')]=[{'all':!![]}];}_0x3c491e=_[_0x216d('0x46')]({},_0x3c491e,_0x330ec8[_0x216d('0x40')]);return db['FreshdeskField'][_0x216d('0x47')](_0x3c491e)[_0x216d('0x27')](handleEntityNotFound(_0x440bc9,null))[_0x216d('0x27')](respondWithResult(_0x440bc9,null))[_0x216d('0x48')](handleError(_0x440bc9,null));};exports['create']=function(_0x31b8a1,_0x542e1b){return db[_0x216d('0x2d')][_0x216d('0x49')](_0x31b8a1[_0x216d('0x4a')],{})['then'](respondWithResult(_0x542e1b,0xc9))['catch'](handleError(_0x542e1b,null));};exports[_0x216d('0x4b')]=function(_0x32d499,_0x3932a3){if(_0x32d499[_0x216d('0x4a')]['id']){delete _0x32d499[_0x216d('0x4a')]['id'];}return db[_0x216d('0x2d')]['find']({'where':{'id':_0x32d499['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x3932a3,null))['then'](saveUpdates(_0x32d499[_0x216d('0x4a')],null))[_0x216d('0x27')](respondWithResult(_0x3932a3,null))['catch'](handleError(_0x3932a3,null));};exports['destroy']=function(_0x5f37e3,_0x4bac14){return db[_0x216d('0x2d')][_0x216d('0x47')]({'where':{'id':_0x5f37e3[_0x216d('0x45')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4bac14,null))[_0x216d('0x27')](removeEntity(_0x4bac14,null))[_0x216d('0x48')](handleError(_0x4bac14,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d02dbac..d081081 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 _0x93fa=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x29bf96,_0xd75d49){var _0x373574=function(_0x3467f7){while(--_0x3467f7){_0x29bf96['push'](_0x29bf96['shift']());}};_0x373574(++_0xd75d49);}(_0x93fa,0x17b));var _0xa93f=function(_0x14f456,_0x3b6bb7){_0x14f456=_0x14f456-0x0;var _0x444e80=_0x93fa[_0x14f456];return _0x444e80;};'use strict';var _=require(_0xa93f('0x0'));var util=require('util');var logger=require(_0xa93f('0x1'))(_0xa93f('0x2'));var moment=require(_0xa93f('0x3'));var BPromise=require(_0xa93f('0x4'));var rp=require(_0xa93f('0x5'));var fs=require('fs');var path=require(_0xa93f('0x6'));var rimraf=require(_0xa93f('0x7'));var config=require(_0xa93f('0x8'));var attributes=require(_0xa93f('0x9'));module[_0xa93f('0xa')]=function(_0x88310e,_0x22f08b){return _0x88310e[_0xa93f('0xb')](_0xa93f('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xa93f('0xd'),'fields':[_0xa93f('0xe'),_0xa93f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde0e=['freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','int_freshdesk_fields'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xde0e,0x145));var _0xede0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde0e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xede0('0x0'));var util=require(_0xede0('0x1'));var logger=require(_0xede0('0x2'))(_0xede0('0x3'));var moment=require(_0xede0('0x4'));var BPromise=require(_0xede0('0x5'));var rp=require(_0xede0('0x6'));var fs=require('fs');var path=require(_0xede0('0x7'));var rimraf=require(_0xede0('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x246d99,_0x3a145b){return _0x246d99[_0xede0('0x9')]('FreshdeskField',attributes,{'tableName':_0xede0('0xa'),'paranoid':![],'indexes':[{'name':_0xede0('0xb'),'fields':[_0xede0('0xc'),_0xede0('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 64e2631..33effd3 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 _0xf286=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x3aa07a,_0x126fc4){var _0x86c058=function(_0x67d2f4){while(--_0x67d2f4){_0x3aa07a['push'](_0x3aa07a['shift']());}};_0x86c058(++_0x126fc4);}(_0xf286,0x166));var _0x6f28=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0xf286[_0x4c9380];return _0x49a523;};'use strict';var _=require(_0x6f28('0x0'));var util=require(_0x6f28('0x1'));var moment=require(_0x6f28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f28('0x3'));var db=require(_0x6f28('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f28('0x5'))(_0x6f28('0x6'));var config=require(_0x6f28('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f28('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1b53,_0x4c7e54,_0x14254a){return new BPromise(function(_0x569af2,_0x46e751){return client['request'](_0x5d1b53,_0x14254a)[_0x6f28('0x9')](function(_0x26aa91){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x4c7e54,_0x6f28('0xa'));logger[_0x6f28('0xb')](_0x6f28('0xc'),_0x4c7e54,_0x6f28('0xa'),JSON[_0x6f28('0xd')](_0x26aa91));if(_0x26aa91[_0x6f28('0xe')]){if(_0x26aa91[_0x6f28('0xe')]['code']===0x1f4){logger[_0x6f28('0xe')](_0x6f28('0xf'),_0x4c7e54,_0x26aa91[_0x6f28('0xe')]['message']);return _0x46e751(_0x26aa91[_0x6f28('0xe')]['message']);}logger[_0x6f28('0xe')](_0x6f28('0xf'),_0x4c7e54,_0x26aa91['error']['message']);return _0x569af2(_0x26aa91['error'][_0x6f28('0x10')]);}else{logger[_0x6f28('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x4c7e54,_0x6f28('0xa'));_0x569af2(_0x26aa91[_0x6f28('0x12')][_0x6f28('0x10')]);}})[_0x6f28('0x13')](function(_0x21a6e6){logger[_0x6f28('0xe')](_0x6f28('0xf'),_0x4c7e54,_0x21a6e6);_0x46e751(_0x21a6e6);});});} \ No newline at end of file +var _0x437d=['request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x392ec2,_0x4e9f85){var _0x16e517=function(_0x379e8b){while(--_0x379e8b){_0x392ec2['push'](_0x392ec2['shift']());}};_0x16e517(++_0x4e9f85);}(_0x437d,0x14e));var _0xd437=function(_0x653035,_0x3c0b7f){_0x653035=_0x653035-0x0;var _0x28fd60=_0x437d[_0x653035];return _0x28fd60;};'use strict';var _=require(_0xd437('0x0'));var util=require(_0xd437('0x1'));var moment=require(_0xd437('0x2'));var BPromise=require(_0xd437('0x3'));var rs=require(_0xd437('0x4'));var fs=require('fs');var Redis=require(_0xd437('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd437('0x6'));var logger=require(_0xd437('0x7'))('rpc');var config=require(_0xd437('0x8'));var jayson=require(_0xd437('0x9'));var client=jayson[_0xd437('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59d7f6,_0x5752c7,_0x7f26b7){return new BPromise(function(_0xac7f5f,_0x286910){return client[_0xd437('0xb')](_0x59d7f6,_0x7f26b7)[_0xd437('0xc')](function(_0x5ac26c){logger[_0xd437('0xd')](_0xd437('0xe'),_0x5752c7,_0xd437('0xf'));logger[_0xd437('0x10')](_0xd437('0x11'),_0x5752c7,_0xd437('0xf'),JSON[_0xd437('0x12')](_0x5ac26c));if(_0x5ac26c[_0xd437('0x13')]){if(_0x5ac26c[_0xd437('0x13')]['code']===0x1f4){logger[_0xd437('0x13')](_0xd437('0xe'),_0x5752c7,_0x5ac26c[_0xd437('0x13')][_0xd437('0x14')]);return _0x286910(_0x5ac26c[_0xd437('0x13')][_0xd437('0x14')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5752c7,_0x5ac26c[_0xd437('0x13')]['message']);return _0xac7f5f(_0x5ac26c[_0xd437('0x13')][_0xd437('0x14')]);}else{logger[_0xd437('0xd')](_0xd437('0xe'),_0x5752c7,'request\x20sent');_0xac7f5f(_0x5ac26c[_0xd437('0x15')][_0xd437('0x14')]);}})[_0xd437('0x16')](function(_0x396621){logger[_0xd437('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x5752c7,_0x396621);_0x286910(_0x396621);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2326596..f674f55 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 _0xeffd=['/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xeffd,0x6b));var _0xdeff=function(_0xbdd64b,_0x5af901){_0xbdd64b=_0xbdd64b-0x0;var _0x14fdf4=_0xeffd[_0xbdd64b];return _0x14fdf4;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id/configurations',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/fields',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0x12')]);router[_0xdeff('0x11')](_0xdeff('0x13'),auth[_0xdeff('0xb')](),controller['addConfiguration']);router[_0xdeff('0x14')](_0xdeff('0xd'),auth['isAuthenticated'](),controller[_0xdeff('0x15')]);router['delete']('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0x16')]);module[_0xdeff('0x17')]=router; \ No newline at end of file +var _0x1339=['/:id/configurations','getConfigurations','/:id/fields','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x239930,_0x131820){var _0x222041=function(_0x462046){while(--_0x462046){_0x239930['push'](_0x239930['shift']());}};_0x222041(++_0x131820);}(_0x1339,0x1ed));var _0x9133=function(_0x4f8624,_0x3f7675){_0x4f8624=_0x4f8624-0x0;var _0x42d1d5=_0x1339[_0x4f8624];return _0x42d1d5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0x8')](_0x9133('0xf'),auth[_0x9133('0x9')](),controller['getFields']);router[_0x9133('0x10')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x10')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['addConfiguration']);router[_0x9133('0x12')](_0x9133('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9133('0x13')]('/:id',auth[_0x9133('0x9')](),controller[_0x9133('0x14')]);module[_0x9133('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index e327a0f..b2e8e72 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 _0x32b6=['remoteUri','sequelize','exports','STRING'];(function(_0x5c72ee,_0x5a8bf8){var _0x231876=function(_0x955276){while(--_0x955276){_0x5c72ee['push'](_0x5c72ee['shift']());}};_0x231876(++_0x5a8bf8);}(_0x32b6,0x1d1));var _0x632b=function(_0x38375c,_0x4e158e){_0x38375c=_0x38375c-0x0;var _0x383ba1=_0x32b6[_0x38375c];return _0x383ba1;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x632b('0x2')]},'username':{'type':Sequelize[_0x632b('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x632b('0x2')],'unique':_0x632b('0x3')},'serverUrl':{'type':Sequelize[_0x632b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x32f4=['sequelize','exports','STRING','username','remoteUri'];(function(_0x37ce45,_0xda6746){var _0x17d5f7=function(_0x559ab7){while(--_0x559ab7){_0x37ce45['push'](_0x37ce45['shift']());}};_0x17d5f7(++_0xda6746);}(_0x32f4,0x154));var _0x432f=function(_0xa2cf68,_0x4b698e){_0xa2cf68=_0xa2cf68-0x0;var _0x1a1ea9=_0x32f4[_0xa2cf68];return _0x1a1ea9;};'use strict';var Sequelize=require(_0x432f('0x0'));module[_0x432f('0x1')]={'name':{'type':Sequelize[_0x432f('0x2')]},'description':{'type':Sequelize[_0x432f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x432f('0x3')},'apiKey':{'type':Sequelize[_0x432f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x432f('0x4')},'serverUrl':{'type':Sequelize[_0x432f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index e68ff03..0be5dd8 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 _0xd8b3=['%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','crypto','jsforce','to-csv','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','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','end','error','stack','name','index','map','FreshsalesAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','show','params','catch','create','update','body','find','getConfigurations','findOne','FreshsalesConfiguration','order','options','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','remoteUri','apiKey','slice','lastIndexOf','GET','format'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd8b3,0x6e));var _0x3d8b=function(_0x412dd8,_0x355780){_0x412dd8=_0x412dd8-0x0;var _0x47b96=_0xd8b3[_0x412dd8];return _0x47b96;};'use strict';var emlformat=require(_0x3d8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d8b('0x1'));var jsonpatch=require(_0x3d8b('0x2'));var rp=require(_0x3d8b('0x3'));var moment=require('moment');var BPromise=require(_0x3d8b('0x4'));var Mustache=require(_0x3d8b('0x5'));var util=require('util');var path=require(_0x3d8b('0x6'));var sox=require(_0x3d8b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d8b('0x8'));var squel=require('squel');var crypto=require(_0x3d8b('0x9'));var jsforce=require(_0x3d8b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3d8b('0xb'));var querystring=require('querystring');var Papa=require(_0x3d8b('0xc'));var Redis=require('ioredis');var authService=require(_0x3d8b('0xd'));var qs=require(_0x3d8b('0xe'));var as=require(_0x3d8b('0xf'));var hardwareService=require(_0x3d8b('0x10'));var logger=require(_0x3d8b('0x11'))(_0x3d8b('0x12'));var utils=require(_0x3d8b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3d8b('0x14'));var db=require(_0x3d8b('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d2f28,_0x22e284){_0x22e284=_0x22e284||0xcc;return function(_0x204c56){if(_0x204c56){return _0x2d2f28[_0x3d8b('0x16')](_0x22e284);}return _0x2d2f28[_0x3d8b('0x17')](_0x22e284)['end']();};}function respondWithResult(_0x23a539,_0xe04bf4){_0xe04bf4=_0xe04bf4||0xc8;return function(_0x2014a6){if(_0x2014a6){return _0x23a539[_0x3d8b('0x17')](_0xe04bf4)[_0x3d8b('0x18')](_0x2014a6);}};}function respondWithFilteredResult(_0x2734a4,_0x496a5f){return function(_0x5aa40e){if(_0x5aa40e){var _0x3458bf=typeof _0x496a5f[_0x3d8b('0x19')]===_0x3d8b('0x1a')&&typeof _0x496a5f[_0x3d8b('0x1b')]===_0x3d8b('0x1a');var _0x4f0582=_0x5aa40e[_0x3d8b('0x1c')];var _0x197868=_0x3458bf?0x0:_0x496a5f[_0x3d8b('0x19')];var _0x4b55d5=_0x3458bf?_0x5aa40e[_0x3d8b('0x1c')]:_0x496a5f['offset']+_0x496a5f[_0x3d8b('0x1b')];var _0x59d6c9;if(_0x4b55d5>=_0x4f0582){_0x4b55d5=_0x4f0582;_0x59d6c9=0xc8;}else{_0x59d6c9=0xce;}_0x2734a4[_0x3d8b('0x17')](_0x59d6c9);return _0x2734a4[_0x3d8b('0x1d')](_0x3d8b('0x1e'),_0x197868+'-'+_0x4b55d5+'/'+_0x4f0582)[_0x3d8b('0x18')](_0x5aa40e);}return null;};}function patchUpdates(_0x44eecf){return function(_0x4c0688){try{jsonpatch[_0x3d8b('0x1f')](_0x4c0688,_0x44eecf,!![]);}catch(_0x350ca5){return BPromise['reject'](_0x350ca5);}return _0x4c0688[_0x3d8b('0x20')]();};}function saveUpdates(_0x1bb33d,_0x5ec78f){return function(_0x4bacee){if(_0x4bacee){return _0x4bacee['update'](_0x1bb33d)['then'](function(_0x3205ad){return _0x3205ad;});}return null;};}function removeEntity(_0x3bc231,_0x3e22b4){return function(_0x56c35e){if(_0x56c35e){return _0x56c35e[_0x3d8b('0x21')]()[_0x3d8b('0x22')](function(){_0x3bc231[_0x3d8b('0x17')](0xcc)[_0x3d8b('0x23')]();});}};}function handleEntityNotFound(_0x5b3a00,_0xd62aad){return function(_0x1dd65a){if(!_0x1dd65a){_0x5b3a00[_0x3d8b('0x16')](0x194);}return _0x1dd65a;};}function handleError(_0x39258c,_0x50700d){_0x50700d=_0x50700d||0x1f4;return function(_0x1db5c0){logger[_0x3d8b('0x24')](_0x1db5c0[_0x3d8b('0x25')]);if(_0x1db5c0[_0x3d8b('0x26')]){delete _0x1db5c0[_0x3d8b('0x26')];}_0x39258c['status'](_0x50700d)['send'](_0x1db5c0);};}exports[_0x3d8b('0x27')]=function(_0x5bfb70,_0x53afce){var _0x10fbfd={},_0xa556d1={},_0x4f62b0={'count':0x0,'rows':[]};var _0x1b44a0=_[_0x3d8b('0x28')](db[_0x3d8b('0x29')]['rawAttributes'],function(_0x42fb16){return{'name':_0x42fb16[_0x3d8b('0x2a')],'type':_0x42fb16['type'][_0x3d8b('0x2b')]};});_0xa556d1[_0x3d8b('0x2c')]=_[_0x3d8b('0x28')](_0x1b44a0,_0x3d8b('0x26'));_0xa556d1[_0x3d8b('0x2d')]=_[_0x3d8b('0x2e')](_0x5bfb70['query']);_0xa556d1[_0x3d8b('0x2f')]=_[_0x3d8b('0x30')](_0xa556d1[_0x3d8b('0x2c')],_0xa556d1[_0x3d8b('0x2d')]);_0x10fbfd[_0x3d8b('0x31')]=_['intersection'](_0xa556d1[_0x3d8b('0x2c')],qs[_0x3d8b('0x32')](_0x5bfb70[_0x3d8b('0x2d')]['fields']));_0x10fbfd[_0x3d8b('0x31')]=_0x10fbfd[_0x3d8b('0x31')][_0x3d8b('0x33')]?_0x10fbfd[_0x3d8b('0x31')]:_0xa556d1[_0x3d8b('0x2c')];if(!_0x5bfb70[_0x3d8b('0x2d')]['hasOwnProperty'](_0x3d8b('0x34'))){_0x10fbfd[_0x3d8b('0x1b')]=qs['limit'](_0x5bfb70['query'][_0x3d8b('0x1b')]);_0x10fbfd[_0x3d8b('0x19')]=qs[_0x3d8b('0x19')](_0x5bfb70[_0x3d8b('0x2d')][_0x3d8b('0x19')]);}_0x10fbfd['order']=qs['sort'](_0x5bfb70[_0x3d8b('0x2d')][_0x3d8b('0x35')]);_0x10fbfd[_0x3d8b('0x36')]=qs[_0x3d8b('0x2f')](_[_0x3d8b('0x37')](_0x5bfb70[_0x3d8b('0x2d')],_0xa556d1[_0x3d8b('0x2f')]),_0x1b44a0);if(_0x5bfb70[_0x3d8b('0x2d')][_0x3d8b('0x38')]){_0x10fbfd[_0x3d8b('0x36')]=_[_0x3d8b('0x39')](_0x10fbfd[_0x3d8b('0x36')],{'$or':_[_0x3d8b('0x28')](_0x1b44a0,function(_0x31b988){if(_0x31b988[_0x3d8b('0x3a')]!==_0x3d8b('0x3b')){var _0x42c279={};_0x42c279[_0x31b988[_0x3d8b('0x26')]]={'$like':'%'+_0x5bfb70[_0x3d8b('0x2d')]['filter']+'%'};return _0x42c279;}})});}_0x10fbfd=_[_0x3d8b('0x39')]({},_0x10fbfd,_0x5bfb70['options']);var _0x5cef3e={'where':_0x10fbfd[_0x3d8b('0x36')]};return db[_0x3d8b('0x29')][_0x3d8b('0x1c')](_0x5cef3e)[_0x3d8b('0x22')](function(_0xba2c9b){_0x4f62b0[_0x3d8b('0x1c')]=_0xba2c9b;if(_0x5bfb70[_0x3d8b('0x2d')]['includeAll']){_0x10fbfd[_0x3d8b('0x3c')]=[{'all':!![]}];}return db[_0x3d8b('0x29')][_0x3d8b('0x3d')](_0x10fbfd);})[_0x3d8b('0x22')](function(_0x4b62e2){_0x4f62b0['rows']=_0x4b62e2;return _0x4f62b0;})[_0x3d8b('0x22')](respondWithFilteredResult(_0x53afce,_0x10fbfd))['catch'](handleError(_0x53afce,null));};exports[_0x3d8b('0x3e')]=function(_0x429ef4,_0x14d6ff){var _0x1bc523={'raw':![],'where':{'id':_0x429ef4[_0x3d8b('0x3f')]['id']}},_0x35972f={};_0x35972f[_0x3d8b('0x2c')]=_['keys'](db[_0x3d8b('0x29')]['rawAttributes']);_0x35972f[_0x3d8b('0x2d')]=_[_0x3d8b('0x2e')](_0x429ef4[_0x3d8b('0x2d')]);_0x35972f[_0x3d8b('0x2f')]=_[_0x3d8b('0x30')](_0x35972f['model'],_0x35972f[_0x3d8b('0x2d')]);_0x1bc523[_0x3d8b('0x31')]=_[_0x3d8b('0x30')](_0x35972f[_0x3d8b('0x2c')],qs[_0x3d8b('0x32')](_0x429ef4['query'][_0x3d8b('0x32')]));_0x1bc523['attributes']=_0x1bc523['attributes'][_0x3d8b('0x33')]?_0x1bc523[_0x3d8b('0x31')]:_0x35972f['model'];if(_0x429ef4[_0x3d8b('0x2d')]['includeAll']){_0x1bc523[_0x3d8b('0x3c')]=[{'all':!![]}];}_0x1bc523=_[_0x3d8b('0x39')]({},_0x1bc523,_0x429ef4['options']);return db[_0x3d8b('0x29')]['find'](_0x1bc523)['then'](handleEntityNotFound(_0x14d6ff,null))[_0x3d8b('0x22')](respondWithResult(_0x14d6ff,null))[_0x3d8b('0x40')](handleError(_0x14d6ff,null));};exports['create']=function(_0x5de29c,_0x43a149){return db['FreshsalesAccount'][_0x3d8b('0x41')](_0x5de29c['body'],{})[_0x3d8b('0x22')](respondWithResult(_0x43a149,0xc9))['catch'](handleError(_0x43a149,null));};exports[_0x3d8b('0x42')]=function(_0x2ff157,_0x25ed8e){if(_0x2ff157[_0x3d8b('0x43')]['id']){delete _0x2ff157[_0x3d8b('0x43')]['id'];}return db[_0x3d8b('0x29')][_0x3d8b('0x44')]({'where':{'id':_0x2ff157[_0x3d8b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x25ed8e,null))['then'](saveUpdates(_0x2ff157['body'],null))[_0x3d8b('0x22')](respondWithResult(_0x25ed8e,null))[_0x3d8b('0x40')](handleError(_0x25ed8e,null));};exports[_0x3d8b('0x21')]=function(_0x42f35b,_0x82e1d7){return db['FreshsalesAccount'][_0x3d8b('0x44')]({'where':{'id':_0x42f35b[_0x3d8b('0x3f')]['id']}})[_0x3d8b('0x22')](handleEntityNotFound(_0x82e1d7,null))[_0x3d8b('0x22')](removeEntity(_0x82e1d7,null))[_0x3d8b('0x40')](handleError(_0x82e1d7,null));};exports[_0x3d8b('0x45')]=function(_0x5a7f92,_0x2fa2f9,_0x4dc4ae){var _0x549e4b={};var _0x434147={};var _0x2daeb7;var _0x58e3d7;return db[_0x3d8b('0x29')][_0x3d8b('0x46')]({'where':{'id':_0x5a7f92[_0x3d8b('0x3f')]['id']}})[_0x3d8b('0x22')](handleEntityNotFound(_0x2fa2f9,null))[_0x3d8b('0x22')](function(_0x316f25){if(_0x316f25){_0x2daeb7=_0x316f25;_0x434147[_0x3d8b('0x2c')]=_[_0x3d8b('0x2e')](db[_0x3d8b('0x47')]['rawAttributes']);_0x434147['query']=_[_0x3d8b('0x2e')](_0x5a7f92[_0x3d8b('0x2d')]);_0x434147[_0x3d8b('0x2f')]=_[_0x3d8b('0x30')](_0x434147['model'],_0x434147[_0x3d8b('0x2d')]);_0x549e4b[_0x3d8b('0x31')]=_['intersection'](_0x434147[_0x3d8b('0x2c')],qs[_0x3d8b('0x32')](_0x5a7f92[_0x3d8b('0x2d')]['fields']));_0x549e4b[_0x3d8b('0x31')]=_0x549e4b[_0x3d8b('0x31')][_0x3d8b('0x33')]?_0x549e4b[_0x3d8b('0x31')]:_0x434147[_0x3d8b('0x2c')];_0x549e4b[_0x3d8b('0x48')]=qs[_0x3d8b('0x35')](_0x5a7f92[_0x3d8b('0x2d')][_0x3d8b('0x35')]);_0x549e4b[_0x3d8b('0x36')]=qs[_0x3d8b('0x2f')](_[_0x3d8b('0x37')](_0x5a7f92[_0x3d8b('0x2d')],_0x434147['filters']));if(_0x5a7f92[_0x3d8b('0x2d')]['filter']){_0x549e4b[_0x3d8b('0x36')]=_[_0x3d8b('0x39')](_0x549e4b[_0x3d8b('0x36')],{'$or':_[_0x3d8b('0x28')](_0x549e4b[_0x3d8b('0x31')],function(_0x67f32a){var _0xc44d0f={};_0xc44d0f[_0x67f32a]={'$like':'%'+_0x5a7f92[_0x3d8b('0x2d')][_0x3d8b('0x38')]+'%'};return _0xc44d0f;})});}_0x549e4b=_[_0x3d8b('0x39')]({},_0x549e4b,_0x5a7f92[_0x3d8b('0x49')]);return _0x2daeb7[_0x3d8b('0x45')](_0x549e4b);}})['then'](function(_0x21837b){if(_0x21837b){_0x58e3d7=_0x21837b[_0x3d8b('0x33')];if(!_0x5a7f92[_0x3d8b('0x2d')][_0x3d8b('0x4a')]('nolimit')){_0x549e4b[_0x3d8b('0x1b')]=qs[_0x3d8b('0x1b')](_0x5a7f92['query'][_0x3d8b('0x1b')]);_0x549e4b[_0x3d8b('0x19')]=qs['offset'](_0x5a7f92[_0x3d8b('0x2d')][_0x3d8b('0x19')]);}return _0x2daeb7[_0x3d8b('0x45')](_0x549e4b);}})[_0x3d8b('0x22')](function(_0x3009b2){if(_0x3009b2){return _0x3009b2?{'count':_0x58e3d7,'rows':_0x3009b2}:null;}})[_0x3d8b('0x22')](respondWithResult(_0x2fa2f9,null))[_0x3d8b('0x40')](handleError(_0x2fa2f9,null));};exports[_0x3d8b('0x4b')]=function(_0x655343,_0x2a35af,_0x2f0920){if(_0x655343[_0x3d8b('0x43')]['id']){delete _0x655343[_0x3d8b('0x43')]['id'];}return db['FreshsalesAccount'][_0x3d8b('0x46')]({'where':{'id':_0x655343['params']['id']}})[_0x3d8b('0x22')](handleEntityNotFound(_0x2a35af,null))[_0x3d8b('0x22')](function(_0x58a7df){if(_0x58a7df){_0x655343[_0x3d8b('0x43')][_0x3d8b('0x4c')]=_0x58a7df['id'];_0x655343[_0x3d8b('0x43')][_0x3d8b('0x4d')]=integrations[_0x3d8b('0x4e')](_0x655343['body'][_0x3d8b('0x4f')],_0x655343[_0x3d8b('0x43')][_0x3d8b('0x3a')]);_0x655343[_0x3d8b('0x43')][_0x3d8b('0x50')]=integrations[_0x3d8b('0x51')](_0x655343[_0x3d8b('0x43')][_0x3d8b('0x4f')],_0x655343[_0x3d8b('0x43')]['type']);return db['FreshsalesConfiguration'][_0x3d8b('0x41')](_0x655343[_0x3d8b('0x43')],{'include':[{'model':db[_0x3d8b('0x52')],'as':_0x3d8b('0x4d')},{'model':db[_0x3d8b('0x52')],'as':_0x3d8b('0x50')}]});}return null;})[_0x3d8b('0x22')](respondWithResult(_0x2a35af,null))[_0x3d8b('0x40')](handleError(_0x2a35af,null));};exports['getFields']=function(_0x2de5e2,_0x599342,_0x5ba617){var _0x3fbfec='';var _0x326801='';return db[_0x3d8b('0x29')]['findOne']({'where':{'id':_0x2de5e2[_0x3d8b('0x3f')]['id']},'attributes':['id',_0x3d8b('0x53'),_0x3d8b('0x54'),_0x3d8b('0x55')]})[_0x3d8b('0x22')](handleEntityNotFound(_0x599342,null))['then'](function(_0x547085){if(_0x547085){_0x326801=_0x547085['username'];_0x3fbfec=_0x547085[_0x3d8b('0x54')];var _0x75939b=_0x547085['remoteUri'][_0x3d8b('0x56')](-0x1);if(_0x75939b==='/'){_0x3fbfec=_0x3fbfec['substring'](0x0,_0x3fbfec[_0x3d8b('0x57')](_0x75939b));}return rp({'method':_0x3d8b('0x58'),'uri':util[_0x3d8b('0x59')](_0x3d8b('0x5a'),_0x3fbfec,'/api/selector/owners'),'headers':{'Authorization':_0x3d8b('0x5b')+_0x547085[_0x3d8b('0x55')]},'json':!![]});}})[_0x3d8b('0x22')](function(_0xfe80ef){if(_0xfe80ef){var _0x46b05c=_0xfe80ef[_0x3d8b('0x5c')];var _0x51b804=![];var _0x32ed71=null;for(_0x32ed71=0x0;_0x32ed71<_0x46b05c[_0x3d8b('0x33')];_0x32ed71++){if(_0x46b05c[_0x32ed71][_0x3d8b('0x5d')]===_0x326801){_0x51b804=!![];}}if(_0x51b804){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3d8b('0x5e')});}}})['then'](respondWithResult(_0x599342,null))[_0x3d8b('0x40')](function(_0x47f493){var _0x7c4ad8=_0x2de5e2['query'][_0x3d8b('0x5f')]?0x1f4:_0x47f493[_0x3d8b('0x60')]||0x1f4;logger[_0x3d8b('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x3d8b('0x61'),_0x7c4ad8,JSON['stringify'](_0x47f493));delete _0x47f493[_0x3d8b('0x26')];if(_0x7c4ad8===0x191){_0x7c4ad8=0x190;}_0x599342['status'](_0x7c4ad8)[_0x3d8b('0x62')](_0x2de5e2[_0x3d8b('0x2d')][_0x3d8b('0x5f')]?{'message':_0x3d8b('0x63'),'statusCode':_0x47f493['statusCode']}:_0x47f493);});}; \ No newline at end of file +var _0xd59b=['../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','catch','create','body','getConfigurations','findOne','FreshsalesConfiguration','sort','addConfiguration','AccountId','Subjects','channel','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','substring','format','%s%s','email','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3d5b01,_0x3ef025){var _0x5d986d=function(_0xcefa43){while(--_0xcefa43){_0x3d5b01['push'](_0x3d5b01['shift']());}};_0x5d986d(++_0x3ef025);}(_0xd59b,0x176));var _0xbd59=function(_0x2ad422,_0x452fed){_0x2ad422=_0x2ad422-0x0;var _0x51f8ed=_0xd59b[_0x2ad422];return _0x51f8ed;};'use strict';var emlformat=require(_0xbd59('0x0'));var rimraf=require(_0xbd59('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd59('0x2'));var rp=require(_0xbd59('0x3'));var moment=require(_0xbd59('0x4'));var BPromise=require(_0xbd59('0x5'));var Mustache=require(_0xbd59('0x6'));var util=require(_0xbd59('0x7'));var path=require(_0xbd59('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbd59('0x9'));var fs=require('fs');var fs_extra=require(_0xbd59('0xa'));var _=require(_0xbd59('0xb'));var squel=require(_0xbd59('0xc'));var crypto=require(_0xbd59('0xd'));var jsforce=require(_0xbd59('0xe'));var deskjs=require(_0xbd59('0xf'));var toCsv=require(_0xbd59('0x10'));var querystring=require(_0xbd59('0x11'));var Papa=require(_0xbd59('0x12'));var Redis=require('ioredis');var authService=require(_0xbd59('0x13'));var qs=require(_0xbd59('0x14'));var as=require(_0xbd59('0x15'));var hardwareService=require(_0xbd59('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xbd59('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbd59('0x18'));var db=require(_0xbd59('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xeb3687,_0x34003e){_0x34003e=_0x34003e||0xcc;return function(_0x264030){if(_0x264030){return _0xeb3687[_0xbd59('0x1a')](_0x34003e);}return _0xeb3687[_0xbd59('0x1b')](_0x34003e)[_0xbd59('0x1c')]();};}function respondWithResult(_0x795977,_0x1eee53){_0x1eee53=_0x1eee53||0xc8;return function(_0x497408){if(_0x497408){return _0x795977[_0xbd59('0x1b')](_0x1eee53)[_0xbd59('0x1d')](_0x497408);}};}function respondWithFilteredResult(_0x5097c2,_0x36d969){return function(_0x402474){if(_0x402474){var _0x373afc=typeof _0x36d969[_0xbd59('0x1e')]===_0xbd59('0x1f')&&typeof _0x36d969['limit']===_0xbd59('0x1f');var _0x3d2d26=_0x402474[_0xbd59('0x20')];var _0x1141bb=_0x373afc?0x0:_0x36d969[_0xbd59('0x1e')];var _0x624db1=_0x373afc?_0x402474['count']:_0x36d969['offset']+_0x36d969[_0xbd59('0x21')];var _0x14cb08;if(_0x624db1>=_0x3d2d26){_0x624db1=_0x3d2d26;_0x14cb08=0xc8;}else{_0x14cb08=0xce;}_0x5097c2[_0xbd59('0x1b')](_0x14cb08);return _0x5097c2[_0xbd59('0x22')](_0xbd59('0x23'),_0x1141bb+'-'+_0x624db1+'/'+_0x3d2d26)[_0xbd59('0x1d')](_0x402474);}return null;};}function patchUpdates(_0xddecc8){return function(_0x3b9065){try{jsonpatch[_0xbd59('0x24')](_0x3b9065,_0xddecc8,!![]);}catch(_0x4022f3){return BPromise['reject'](_0x4022f3);}return _0x3b9065[_0xbd59('0x25')]();};}function saveUpdates(_0x22ebf1,_0x3c7da3){return function(_0x169ff4){if(_0x169ff4){return _0x169ff4[_0xbd59('0x26')](_0x22ebf1)[_0xbd59('0x27')](function(_0x4abf96){return _0x4abf96;});}return null;};}function removeEntity(_0x28f9b8,_0x18bc2b){return function(_0x347796){if(_0x347796){return _0x347796[_0xbd59('0x28')]()[_0xbd59('0x27')](function(){_0x28f9b8['status'](0xcc)[_0xbd59('0x1c')]();});}};}function handleEntityNotFound(_0x24182e,_0x8c02){return function(_0x3c0898){if(!_0x3c0898){_0x24182e['sendStatus'](0x194);}return _0x3c0898;};}function handleError(_0x3be3b3,_0x4f999d){_0x4f999d=_0x4f999d||0x1f4;return function(_0x1bf898){logger[_0xbd59('0x29')](_0x1bf898[_0xbd59('0x2a')]);if(_0x1bf898[_0xbd59('0x2b')]){delete _0x1bf898[_0xbd59('0x2b')];}_0x3be3b3[_0xbd59('0x1b')](_0x4f999d)[_0xbd59('0x2c')](_0x1bf898);};}exports[_0xbd59('0x2d')]=function(_0x2d6715,_0x26b5c8){var _0x133bee={},_0x3e8ab8={},_0x58cb7b={'count':0x0,'rows':[]};var _0x548fd1=_[_0xbd59('0x2e')](db[_0xbd59('0x2f')]['rawAttributes'],function(_0x2aa6bb){return{'name':_0x2aa6bb[_0xbd59('0x30')],'type':_0x2aa6bb[_0xbd59('0x31')][_0xbd59('0x32')]};});_0x3e8ab8[_0xbd59('0x33')]=_[_0xbd59('0x2e')](_0x548fd1,_0xbd59('0x2b'));_0x3e8ab8['query']=_[_0xbd59('0x34')](_0x2d6715[_0xbd59('0x35')]);_0x3e8ab8[_0xbd59('0x36')]=_['intersection'](_0x3e8ab8[_0xbd59('0x33')],_0x3e8ab8[_0xbd59('0x35')]);_0x133bee[_0xbd59('0x37')]=_[_0xbd59('0x38')](_0x3e8ab8[_0xbd59('0x33')],qs[_0xbd59('0x39')](_0x2d6715['query'][_0xbd59('0x39')]));_0x133bee[_0xbd59('0x37')]=_0x133bee[_0xbd59('0x37')][_0xbd59('0x3a')]?_0x133bee[_0xbd59('0x37')]:_0x3e8ab8['model'];if(!_0x2d6715[_0xbd59('0x35')][_0xbd59('0x3b')](_0xbd59('0x3c'))){_0x133bee[_0xbd59('0x21')]=qs[_0xbd59('0x21')](_0x2d6715[_0xbd59('0x35')][_0xbd59('0x21')]);_0x133bee['offset']=qs[_0xbd59('0x1e')](_0x2d6715[_0xbd59('0x35')][_0xbd59('0x1e')]);}_0x133bee[_0xbd59('0x3d')]=qs['sort'](_0x2d6715[_0xbd59('0x35')]['sort']);_0x133bee[_0xbd59('0x3e')]=qs[_0xbd59('0x36')](_[_0xbd59('0x3f')](_0x2d6715[_0xbd59('0x35')],_0x3e8ab8['filters']),_0x548fd1);if(_0x2d6715[_0xbd59('0x35')][_0xbd59('0x40')]){_0x133bee[_0xbd59('0x3e')]=_[_0xbd59('0x41')](_0x133bee[_0xbd59('0x3e')],{'$or':_[_0xbd59('0x2e')](_0x548fd1,function(_0x864957){if(_0x864957[_0xbd59('0x31')]!==_0xbd59('0x42')){var _0x18e0e7={};_0x18e0e7[_0x864957[_0xbd59('0x2b')]]={'$like':'%'+_0x2d6715[_0xbd59('0x35')][_0xbd59('0x40')]+'%'};return _0x18e0e7;}})});}_0x133bee=_[_0xbd59('0x41')]({},_0x133bee,_0x2d6715[_0xbd59('0x43')]);var _0x4e2716={'where':_0x133bee[_0xbd59('0x3e')]};return db['FreshsalesAccount'][_0xbd59('0x20')](_0x4e2716)[_0xbd59('0x27')](function(_0x153915){_0x58cb7b[_0xbd59('0x20')]=_0x153915;if(_0x2d6715[_0xbd59('0x35')][_0xbd59('0x44')]){_0x133bee[_0xbd59('0x45')]=[{'all':!![]}];}return db[_0xbd59('0x2f')]['findAll'](_0x133bee);})['then'](function(_0x188178){_0x58cb7b['rows']=_0x188178;return _0x58cb7b;})['then'](respondWithFilteredResult(_0x26b5c8,_0x133bee))['catch'](handleError(_0x26b5c8,null));};exports[_0xbd59('0x46')]=function(_0x4dd947,_0x346d61){var _0x3986cf={'raw':![],'where':{'id':_0x4dd947[_0xbd59('0x47')]['id']}},_0xaa4c09={};_0xaa4c09['model']=_[_0xbd59('0x34')](db[_0xbd59('0x2f')][_0xbd59('0x48')]);_0xaa4c09[_0xbd59('0x35')]=_[_0xbd59('0x34')](_0x4dd947[_0xbd59('0x35')]);_0xaa4c09['filters']=_[_0xbd59('0x38')](_0xaa4c09[_0xbd59('0x33')],_0xaa4c09[_0xbd59('0x35')]);_0x3986cf[_0xbd59('0x37')]=_['intersection'](_0xaa4c09['model'],qs[_0xbd59('0x39')](_0x4dd947[_0xbd59('0x35')][_0xbd59('0x39')]));_0x3986cf[_0xbd59('0x37')]=_0x3986cf[_0xbd59('0x37')][_0xbd59('0x3a')]?_0x3986cf[_0xbd59('0x37')]:_0xaa4c09['model'];if(_0x4dd947[_0xbd59('0x35')]['includeAll']){_0x3986cf['include']=[{'all':!![]}];}_0x3986cf=_['merge']({},_0x3986cf,_0x4dd947[_0xbd59('0x43')]);return db[_0xbd59('0x2f')][_0xbd59('0x49')](_0x3986cf)[_0xbd59('0x27')](handleEntityNotFound(_0x346d61,null))['then'](respondWithResult(_0x346d61,null))[_0xbd59('0x4a')](handleError(_0x346d61,null));};exports[_0xbd59('0x4b')]=function(_0x560026,_0x20b2c6){return db['FreshsalesAccount'][_0xbd59('0x4b')](_0x560026['body'],{})[_0xbd59('0x27')](respondWithResult(_0x20b2c6,0xc9))[_0xbd59('0x4a')](handleError(_0x20b2c6,null));};exports[_0xbd59('0x26')]=function(_0x212eee,_0x13fb37){if(_0x212eee[_0xbd59('0x4c')]['id']){delete _0x212eee[_0xbd59('0x4c')]['id'];}return db[_0xbd59('0x2f')]['find']({'where':{'id':_0x212eee[_0xbd59('0x47')]['id']}})[_0xbd59('0x27')](handleEntityNotFound(_0x13fb37,null))[_0xbd59('0x27')](saveUpdates(_0x212eee[_0xbd59('0x4c')],null))[_0xbd59('0x27')](respondWithResult(_0x13fb37,null))[_0xbd59('0x4a')](handleError(_0x13fb37,null));};exports[_0xbd59('0x28')]=function(_0x2d54c1,_0x2da218){return db['FreshsalesAccount'][_0xbd59('0x49')]({'where':{'id':_0x2d54c1[_0xbd59('0x47')]['id']}})['then'](handleEntityNotFound(_0x2da218,null))[_0xbd59('0x27')](removeEntity(_0x2da218,null))[_0xbd59('0x4a')](handleError(_0x2da218,null));};exports[_0xbd59('0x4d')]=function(_0x1ea3b4,_0x5a5916,_0x4bc032){var _0x391e17={};var _0x1660cd={};var _0x5349a6;var _0x4f788a;return db[_0xbd59('0x2f')][_0xbd59('0x4e')]({'where':{'id':_0x1ea3b4['params']['id']}})['then'](handleEntityNotFound(_0x5a5916,null))[_0xbd59('0x27')](function(_0x226ee7){if(_0x226ee7){_0x5349a6=_0x226ee7;_0x1660cd[_0xbd59('0x33')]=_[_0xbd59('0x34')](db[_0xbd59('0x4f')][_0xbd59('0x48')]);_0x1660cd[_0xbd59('0x35')]=_[_0xbd59('0x34')](_0x1ea3b4['query']);_0x1660cd[_0xbd59('0x36')]=_[_0xbd59('0x38')](_0x1660cd[_0xbd59('0x33')],_0x1660cd[_0xbd59('0x35')]);_0x391e17[_0xbd59('0x37')]=_[_0xbd59('0x38')](_0x1660cd[_0xbd59('0x33')],qs[_0xbd59('0x39')](_0x1ea3b4[_0xbd59('0x35')]['fields']));_0x391e17[_0xbd59('0x37')]=_0x391e17[_0xbd59('0x37')]['length']?_0x391e17[_0xbd59('0x37')]:_0x1660cd[_0xbd59('0x33')];_0x391e17[_0xbd59('0x3d')]=qs[_0xbd59('0x50')](_0x1ea3b4[_0xbd59('0x35')][_0xbd59('0x50')]);_0x391e17[_0xbd59('0x3e')]=qs[_0xbd59('0x36')](_[_0xbd59('0x3f')](_0x1ea3b4[_0xbd59('0x35')],_0x1660cd[_0xbd59('0x36')]));if(_0x1ea3b4[_0xbd59('0x35')][_0xbd59('0x40')]){_0x391e17[_0xbd59('0x3e')]=_[_0xbd59('0x41')](_0x391e17[_0xbd59('0x3e')],{'$or':_[_0xbd59('0x2e')](_0x391e17[_0xbd59('0x37')],function(_0x1c7816){var _0x3a0775={};_0x3a0775[_0x1c7816]={'$like':'%'+_0x1ea3b4['query'][_0xbd59('0x40')]+'%'};return _0x3a0775;})});}_0x391e17=_['merge']({},_0x391e17,_0x1ea3b4[_0xbd59('0x43')]);return _0x5349a6[_0xbd59('0x4d')](_0x391e17);}})[_0xbd59('0x27')](function(_0x5d83d2){if(_0x5d83d2){_0x4f788a=_0x5d83d2[_0xbd59('0x3a')];if(!_0x1ea3b4[_0xbd59('0x35')][_0xbd59('0x3b')](_0xbd59('0x3c'))){_0x391e17[_0xbd59('0x21')]=qs[_0xbd59('0x21')](_0x1ea3b4['query'][_0xbd59('0x21')]);_0x391e17[_0xbd59('0x1e')]=qs['offset'](_0x1ea3b4[_0xbd59('0x35')][_0xbd59('0x1e')]);}return _0x5349a6['getConfigurations'](_0x391e17);}})[_0xbd59('0x27')](function(_0x2fe52c){if(_0x2fe52c){return _0x2fe52c?{'count':_0x4f788a,'rows':_0x2fe52c}:null;}})['then'](respondWithResult(_0x5a5916,null))[_0xbd59('0x4a')](handleError(_0x5a5916,null));};exports[_0xbd59('0x51')]=function(_0x398aaf,_0x2dbe51,_0x4f51a4){if(_0x398aaf['body']['id']){delete _0x398aaf[_0xbd59('0x4c')]['id'];}return db[_0xbd59('0x2f')]['findOne']({'where':{'id':_0x398aaf['params']['id']}})[_0xbd59('0x27')](handleEntityNotFound(_0x2dbe51,null))[_0xbd59('0x27')](function(_0xf8a08){if(_0xf8a08){_0x398aaf[_0xbd59('0x4c')][_0xbd59('0x52')]=_0xf8a08['id'];_0x398aaf['body'][_0xbd59('0x53')]=integrations['getSubjects'](_0x398aaf[_0xbd59('0x4c')]['channel'],_0x398aaf['body'][_0xbd59('0x31')]);_0x398aaf[_0xbd59('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x398aaf['body'][_0xbd59('0x54')],_0x398aaf['body'][_0xbd59('0x31')]);return db[_0xbd59('0x4f')][_0xbd59('0x4b')](_0x398aaf[_0xbd59('0x4c')],{'include':[{'model':db[_0xbd59('0x55')],'as':'Subjects'},{'model':db[_0xbd59('0x55')],'as':_0xbd59('0x56')}]});}return null;})['then'](respondWithResult(_0x2dbe51,null))[_0xbd59('0x4a')](handleError(_0x2dbe51,null));};exports[_0xbd59('0x57')]=function(_0x1aff21,_0x1fe8a9,_0x4cec39){var _0x4eae3e='';var _0x52d7d4='';return db[_0xbd59('0x2f')][_0xbd59('0x4e')]({'where':{'id':_0x1aff21[_0xbd59('0x47')]['id']},'attributes':['id',_0xbd59('0x58'),_0xbd59('0x59'),_0xbd59('0x5a')]})['then'](handleEntityNotFound(_0x1fe8a9,null))[_0xbd59('0x27')](function(_0x471a93){if(_0x471a93){_0x52d7d4=_0x471a93[_0xbd59('0x58')];_0x4eae3e=_0x471a93['remoteUri'];var _0x93d11e=_0x471a93[_0xbd59('0x59')]['slice'](-0x1);if(_0x93d11e==='/'){_0x4eae3e=_0x4eae3e[_0xbd59('0x5b')](0x0,_0x4eae3e['lastIndexOf'](_0x93d11e));}return rp({'method':'GET','uri':util[_0xbd59('0x5c')](_0xbd59('0x5d'),_0x4eae3e,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x471a93['apiKey']},'json':!![]});}})['then'](function(_0x5521b4){if(_0x5521b4){var _0x530b41=_0x5521b4['users'];var _0x31fd96=![];var _0x934782=null;for(_0x934782=0x0;_0x934782<_0x530b41[_0xbd59('0x3a')];_0x934782++){if(_0x530b41[_0x934782][_0xbd59('0x5e')]===_0x52d7d4){_0x31fd96=!![];}}if(_0x31fd96){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xbd59('0x27')](respondWithResult(_0x1fe8a9,null))[_0xbd59('0x4a')](function(_0x17eb41){var _0x18476f=_0x1aff21[_0xbd59('0x35')][_0xbd59('0x5f')]?0x1f4:_0x17eb41[_0xbd59('0x60')]||0x1f4;logger[_0xbd59('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd59('0x57'),_0x18476f,JSON[_0xbd59('0x61')](_0x17eb41));delete _0x17eb41[_0xbd59('0x2b')];if(_0x18476f===0x191){_0x18476f=0x190;}_0x1fe8a9[_0xbd59('0x1b')](_0x18476f)[_0xbd59('0x2c')](_0x1aff21[_0xbd59('0x35')]['test']?{'message':_0xbd59('0x62'),'statusCode':_0x17eb41[_0xbd59('0x60')]}:_0x17eb41);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0df2a4e..75ae894 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 _0x3f8a=['exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x305a27,_0x2d6e50){_0x305a27=_0x305a27-0x0;var _0x3f3819=_0x3f8a[_0x305a27];return _0x3f3819;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbff5=['FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','define'];(function(_0x4817c3,_0x55abdb){var _0x2ca09e=function(_0x1f330d){while(--_0x1f330d){_0x4817c3['push'](_0x4817c3['shift']());}};_0x2ca09e(++_0x55abdb);}(_0xbff5,0x1bc));var _0x5bff=function(_0x265f4f,_0x45a89a){_0x265f4f=_0x265f4f-0x0;var _0x179776=_0xbff5[_0x265f4f];return _0x179776;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var rp=require(_0x5bff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bff('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x5bff('0x8'));module[_0x5bff('0x9')]=function(_0x151add,_0xa54c57){return _0x151add[_0x5bff('0xa')](_0x5bff('0xb'),attributes,{'tableName':_0x5bff('0xc'),'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 f47191c..266d8e6 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 _0x6a95=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','include','map','model','then','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x55f47b,_0x58b84b){var _0x163c2e=function(_0x1662b6){while(--_0x1662b6){_0x55f47b['push'](_0x55f47b['shift']());}};_0x163c2e(++_0x58b84b);}(_0x6a95,0x1db));var _0x56a9=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x6a95[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var BPromise=require(_0x56a9('0x3'));var rs=require(_0x56a9('0x4'));var fs=require('fs');var Redis=require(_0x56a9('0x5'));var db=require(_0x56a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x56a9('0x7'));var config=require(_0x56a9('0x8'));var jayson=require(_0x56a9('0x9'));var client=jayson[_0x56a9('0xa')][_0x56a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x365093,_0xd8aa7c,_0x5d3e80){return new BPromise(function(_0x5f0dcb,_0x3ac626){return client[_0x56a9('0xc')](_0x365093,_0x5d3e80)['then'](function(_0xe4b98c){logger[_0x56a9('0xd')](_0x56a9('0xe'),_0xd8aa7c,_0x56a9('0xf'));logger[_0x56a9('0x10')](_0x56a9('0x11'),_0xd8aa7c,_0x56a9('0xf'),JSON[_0x56a9('0x12')](_0xe4b98c));if(_0xe4b98c[_0x56a9('0x13')]){if(_0xe4b98c['error'][_0x56a9('0x14')]===0x1f4){logger['error'](_0x56a9('0xe'),_0xd8aa7c,_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x3ac626(_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);}logger[_0x56a9('0x13')](_0x56a9('0xe'),_0xd8aa7c,_0xe4b98c[_0x56a9('0x13')][_0x56a9('0x15')]);return _0x5f0dcb(_0xe4b98c['error']['message']);}else{logger[_0x56a9('0xd')](_0x56a9('0xe'),_0xd8aa7c,_0x56a9('0xf'));_0x5f0dcb(_0xe4b98c[_0x56a9('0x16')]['message']);}})[_0x56a9('0x17')](function(_0x4853a3){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0xd8aa7c,_0x4853a3);_0x3ac626(_0x4853a3);});});}exports[_0x56a9('0x18')]=function(_0x576bdf){var _0x59c0ec=this;return new Promise(function(_0x105fe5,_0x459a87){return db[_0x56a9('0x19')][_0x56a9('0x1a')]({'raw':_0x576bdf[_0x56a9('0x1b')]?_0x576bdf[_0x56a9('0x1b')][_0x56a9('0x1c')]===undefined?!![]:![]:!![],'where':_0x576bdf[_0x56a9('0x1b')]?_0x576bdf[_0x56a9('0x1b')]['where']||null:null,'attributes':_0x576bdf['options']?_0x576bdf[_0x56a9('0x1b')][_0x56a9('0x1d')]||null:null,'limit':_0x576bdf[_0x56a9('0x1b')]?_0x576bdf[_0x56a9('0x1b')]['limit']||null:null,'include':_0x576bdf[_0x56a9('0x1b')]?_0x576bdf[_0x56a9('0x1b')][_0x56a9('0x1e')]?_[_0x56a9('0x1f')](_0x576bdf['options'][_0x56a9('0x1e')],function(_0x32839b){return{'model':db[_0x32839b[_0x56a9('0x20')]],'as':_0x32839b['as'],'attributes':_0x32839b[_0x56a9('0x1d')],'include':_0x32839b[_0x56a9('0x1e')]?_['map'](_0x32839b[_0x56a9('0x1e')],function(_0x217bda){return{'model':db[_0x217bda[_0x56a9('0x20')]],'as':_0x217bda['as'],'attributes':_0x217bda['attributes'],'include':_0x217bda[_0x56a9('0x1e')]?_['map'](_0x217bda[_0x56a9('0x1e')],function(_0x8d41d6){return{'model':db[_0x8d41d6[_0x56a9('0x20')]],'as':_0x8d41d6['as'],'attributes':_0x8d41d6[_0x56a9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x56a9('0x21')](function(_0x1afe8a){logger[_0x56a9('0xd')](_0x56a9('0x18'),_0x576bdf);logger['debug'](_0x56a9('0x18'),_0x576bdf,JSON[_0x56a9('0x12')](_0x1afe8a));_0x105fe5(_0x1afe8a);})['catch'](function(_0x4441ce){logger['error']('GetFreshsalesAccount',_0x4441ce[_0x56a9('0x15')],_0x576bdf);_0x459a87(_0x59c0ec['error'](0x1f4,_0x4441ce[_0x56a9('0x15')]));});});};exports[_0x56a9('0x22')]=function(_0x2fbd5d){var _0x2c1c3d=this;return new Promise(function(_0x5879db,_0x332707){return db[_0x56a9('0x19')][_0x56a9('0x23')]({'raw':_0x2fbd5d[_0x56a9('0x1b')]?_0x2fbd5d[_0x56a9('0x1b')][_0x56a9('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fbd5d[_0x56a9('0x1b')]?_0x2fbd5d[_0x56a9('0x1b')][_0x56a9('0x24')]||null:null,'attributes':_0x2fbd5d[_0x56a9('0x1b')]?_0x2fbd5d[_0x56a9('0x1b')][_0x56a9('0x1d')]||null:null,'include':_0x2fbd5d['options']?_0x2fbd5d[_0x56a9('0x1b')][_0x56a9('0x1e')]?_[_0x56a9('0x1f')](_0x2fbd5d['options'][_0x56a9('0x1e')],function(_0x51ce05){return{'model':db[_0x51ce05['model']],'as':_0x51ce05['as'],'attributes':_0x51ce05['attributes'],'include':_0x51ce05[_0x56a9('0x1e')]?_[_0x56a9('0x1f')](_0x51ce05['include'],function(_0x5473cb){return{'model':db[_0x5473cb[_0x56a9('0x20')]],'as':_0x5473cb['as'],'attributes':_0x5473cb[_0x56a9('0x1d')],'include':_0x5473cb[_0x56a9('0x1e')]?_[_0x56a9('0x1f')](_0x5473cb[_0x56a9('0x1e')],function(_0x239601){return{'model':db[_0x239601[_0x56a9('0x20')]],'as':_0x239601['as'],'attributes':_0x239601[_0x56a9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x56a9('0x21')](function(_0x189f13){logger['info']('ShowFreshsalesAccount',_0x2fbd5d);logger['debug']('ShowFreshsalesAccount',_0x2fbd5d,JSON[_0x56a9('0x12')](_0x189f13));_0x5879db(_0x189f13);})[_0x56a9('0x17')](function(_0x55b295){logger[_0x56a9('0x13')](_0x56a9('0x22'),_0x55b295[_0x56a9('0x15')],_0x2fbd5d);_0x332707(_0x2c1c3d[_0x56a9('0x13')](0x1f4,_0x55b295[_0x56a9('0x15')]));});});}; \ No newline at end of file +var _0x2a07=['GetFreshsalesAccount','debug','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes'];(function(_0x251b66,_0x4216ed){var _0x5f172c=function(_0x5dec68){while(--_0x5dec68){_0x251b66['push'](_0x251b66['shift']());}};_0x5f172c(++_0x4216ed);}(_0x2a07,0x74));var _0x72a0=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x2a07[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}exports['GetFreshsalesAccount']=function(_0x100d8f){var _0x42e9ec=this;return new Promise(function(_0x131b73,_0x5b63c8){return db[_0x72a0('0x17')][_0x72a0('0x18')]({'raw':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1a')]||null:null,'attributes':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['attributes']||null:null,'limit':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1b')]||null:null,'include':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x3022b0){return{'model':db[_0x3022b0[_0x72a0('0x1e')]],'as':_0x3022b0['as'],'attributes':_0x3022b0['attributes'],'include':_0x3022b0['include']?_[_0x72a0('0x1d')](_0x3022b0[_0x72a0('0x1c')],function(_0x123df4){return{'model':db[_0x123df4[_0x72a0('0x1e')]],'as':_0x123df4['as'],'attributes':_0x123df4[_0x72a0('0x1f')],'include':_0x123df4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x123df4[_0x72a0('0x1c')],function(_0xee99e2){return{'model':db[_0xee99e2[_0x72a0('0x1e')]],'as':_0xee99e2['as'],'attributes':_0xee99e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x553641){logger[_0x72a0('0x15')](_0x72a0('0x20'),_0x100d8f);logger[_0x72a0('0x21')](_0x72a0('0x20'),_0x100d8f,JSON[_0x72a0('0x12')](_0x553641));_0x131b73(_0x553641);})[_0x72a0('0x16')](function(_0x23c96a){logger[_0x72a0('0x13')]('GetFreshsalesAccount',_0x23c96a[_0x72a0('0x14')],_0x100d8f);_0x5b63c8(_0x42e9ec[_0x72a0('0x13')](0x1f4,_0x23c96a[_0x72a0('0x14')]));});});};exports[_0x72a0('0x22')]=function(_0x13c04){var _0x19e783=this;return new Promise(function(_0x3a5e54,_0x592401){return db[_0x72a0('0x17')][_0x72a0('0x23')]({'raw':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x24')]===undefined?!![]:![]:!![],'where':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1a')]||null:null,'attributes':_0x13c04['options']?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1f')]||null:null,'include':_0x13c04[_0x72a0('0x19')]?_0x13c04['options'][_0x72a0('0x1c')]?_['map'](_0x13c04[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x1d02c4){return{'model':db[_0x1d02c4[_0x72a0('0x1e')]],'as':_0x1d02c4['as'],'attributes':_0x1d02c4[_0x72a0('0x1f')],'include':_0x1d02c4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x1d02c4[_0x72a0('0x1c')],function(_0x154c1e){return{'model':db[_0x154c1e[_0x72a0('0x1e')]],'as':_0x154c1e['as'],'attributes':_0x154c1e[_0x72a0('0x1f')],'include':_0x154c1e[_0x72a0('0x1c')]?_['map'](_0x154c1e[_0x72a0('0x1c')],function(_0x5eb8f1){return{'model':db[_0x5eb8f1[_0x72a0('0x1e')]],'as':_0x5eb8f1['as'],'attributes':_0x5eb8f1[_0x72a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x1a9597){logger[_0x72a0('0x15')](_0x72a0('0x22'),_0x13c04);logger[_0x72a0('0x21')](_0x72a0('0x22'),_0x13c04,JSON[_0x72a0('0x12')](_0x1a9597));_0x3a5e54(_0x1a9597);})['catch'](function(_0x4a973a){logger[_0x72a0('0x13')](_0x72a0('0x22'),_0x4a973a[_0x72a0('0x14')],_0x13c04);_0x592401(_0x19e783[_0x72a0('0x13')](0x1f4,_0x4a973a[_0x72a0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 86c6f5f..f1dd634 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 _0x64e7=['/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','getSubjects','/:id/descriptions'];(function(_0x537825,_0x14ebc9){var _0x4e35fa=function(_0x3ed011){while(--_0x3ed011){_0x537825['push'](_0x537825['shift']());}};_0x4e35fa(++_0x14ebc9);}(_0x64e7,0x1e9));var _0x764e=function(_0x5d4ef9,_0x3ac367){_0x5d4ef9=_0x5d4ef9-0x0;var _0x21d43d=_0x64e7[_0x5d4ef9];return _0x21d43d;};'use strict';var multer=require(_0x764e('0x0'));var util=require('util');var path=require(_0x764e('0x1'));var timeout=require(_0x764e('0x2'));var express=require(_0x764e('0x3'));var router=express[_0x764e('0x4')]();var fs_extra=require(_0x764e('0x5'));var auth=require(_0x764e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x764e('0x7'));var controller=require(_0x764e('0x8'));router[_0x764e('0x9')]('/',auth['isAuthenticated'](),controller[_0x764e('0xa')]);router[_0x764e('0x9')](_0x764e('0xb'),auth[_0x764e('0xc')](),controller['show']);router[_0x764e('0x9')]('/:id/subjects',auth[_0x764e('0xc')](),controller[_0x764e('0xd')]);router[_0x764e('0x9')](_0x764e('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x764e('0x9')](_0x764e('0xf'),auth[_0x764e('0xc')](),controller[_0x764e('0x10')]);router[_0x764e('0x11')]('/',auth[_0x764e('0xc')](),controller[_0x764e('0x12')]);router[_0x764e('0x13')]('/:id',auth[_0x764e('0xc')](),controller[_0x764e('0x14')]);router[_0x764e('0x15')](_0x764e('0xb'),auth[_0x764e('0xc')](),controller[_0x764e('0x16')]);module[_0x764e('0x17')]=router; \ No newline at end of file +var _0xfe59=['/:id/descriptions','/:id/fields','getFields','post','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','getSubjects'];(function(_0x5d7d31,_0x4be66c){var _0x3a8511=function(_0x2af5d4){while(--_0x2af5d4){_0x5d7d31['push'](_0x5d7d31['shift']());}};_0x3a8511(++_0x4be66c);}(_0xfe59,0xcf));var _0x9fe5=function(_0x235770,_0x2c512b){_0x235770=_0x235770-0x0;var _0x26682e=_0xfe59[_0x235770];return _0x26682e;};'use strict';var multer=require('multer');var util=require(_0x9fe5('0x0'));var path=require('path');var timeout=require(_0x9fe5('0x1'));var express=require('express');var router=express[_0x9fe5('0x2')]();var fs_extra=require(_0x9fe5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9fe5('0x4'));var config=require(_0x9fe5('0x5'));var controller=require(_0x9fe5('0x6'));router[_0x9fe5('0x7')]('/',auth['isAuthenticated'](),controller[_0x9fe5('0x8')]);router[_0x9fe5('0x7')](_0x9fe5('0x9'),auth[_0x9fe5('0xa')](),controller[_0x9fe5('0xb')]);router['get']('/:id/subjects',auth[_0x9fe5('0xa')](),controller[_0x9fe5('0xc')]);router[_0x9fe5('0x7')](_0x9fe5('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x9fe5('0x7')](_0x9fe5('0xe'),auth[_0x9fe5('0xa')](),controller[_0x9fe5('0xf')]);router[_0x9fe5('0x10')]('/',auth[_0x9fe5('0xa')](),controller['create']);router['put'](_0x9fe5('0x9'),auth[_0x9fe5('0xa')](),controller[_0x9fe5('0x11')]);router[_0x9fe5('0x12')](_0x9fe5('0x9'),auth[_0x9fe5('0xa')](),controller[_0x9fe5('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 3189b6c..cc5cc4e 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 _0x0ebc=['sequelize','STRING'];(function(_0x78df4a,_0x133438){var _0x57a8f7=function(_0x48ea5f){while(--_0x48ea5f){_0x78df4a['push'](_0x78df4a['shift']());}};_0x57a8f7(++_0x133438);}(_0x0ebc,0x154));var _0xc0eb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0ebc[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xc0eb('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0eb('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5b64=['sequelize','exports','STRING'];(function(_0x5751f4,_0x1eea60){var _0x4dc45a=function(_0x526ef9){while(--_0x526ef9){_0x5751f4['push'](_0x5751f4['shift']());}};_0x4dc45a(++_0x1eea60);}(_0x5b64,0x129));var _0x45b6=function(_0x43a51a,_0x20b663){_0x43a51a=_0x43a51a-0x0;var _0x425a39=_0x5b64[_0x43a51a];return _0x425a39;};'use strict';var Sequelize=require(_0x45b6('0x0'));module[_0x45b6('0x1')]={'name':{'type':Sequelize[_0x45b6('0x2')]},'description':{'type':Sequelize[_0x45b6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 1b7e230..d286e49 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 _0x661e=['end','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','getSubjects','findOne','getDescriptions','FreshsalesField','getFields','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then'];(function(_0x7af0ef,_0x13dec7){var _0x53e4cd=function(_0x243c23){while(--_0x243c23){_0x7af0ef['push'](_0x7af0ef['shift']());}};_0x53e4cd(++_0x13dec7);}(_0x661e,0x7d));var _0xe661=function(_0x4fd4e2,_0x2f552f){_0x4fd4e2=_0x4fd4e2-0x0;var _0x365ddf=_0x661e[_0x4fd4e2];return _0x365ddf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe661('0x0'));var zipdir=require(_0xe661('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe661('0x2'));var BPromise=require(_0xe661('0x3'));var Mustache=require(_0xe661('0x4'));var util=require(_0xe661('0x5'));var path=require(_0xe661('0x6'));var sox=require(_0xe661('0x7'));var csv=require(_0xe661('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe661('0x9'));var squel=require(_0xe661('0xa'));var crypto=require(_0xe661('0xb'));var jsforce=require(_0xe661('0xc'));var deskjs=require(_0xe661('0xd'));var toCsv=require(_0xe661('0x8'));var querystring=require(_0xe661('0xe'));var Papa=require(_0xe661('0xf'));var Redis=require(_0xe661('0x10'));var authService=require(_0xe661('0x11'));var qs=require(_0xe661('0x12'));var as=require(_0xe661('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe661('0x14'))('api');var utils=require(_0xe661('0x15'));var config=require(_0xe661('0x16'));var licenseUtil=require(_0xe661('0x17'));var db=require(_0xe661('0x18'))['db'];function respondWithStatusCode(_0x586aa1,_0x109dea){_0x109dea=_0x109dea||0xcc;return function(_0x474b8c){if(_0x474b8c){return _0x586aa1[_0xe661('0x19')](_0x109dea);}return _0x586aa1['status'](_0x109dea)['end']();};}function respondWithResult(_0x5ce728,_0x4c97f5){_0x4c97f5=_0x4c97f5||0xc8;return function(_0x2fe8f4){if(_0x2fe8f4){return _0x5ce728[_0xe661('0x1a')](_0x4c97f5)[_0xe661('0x1b')](_0x2fe8f4);}};}function respondWithFilteredResult(_0x4afe3a,_0x321083){return function(_0x1791c2){if(_0x1791c2){var _0x517424=typeof _0x321083[_0xe661('0x1c')]===_0xe661('0x1d')&&typeof _0x321083[_0xe661('0x1e')]===_0xe661('0x1d');var _0x124fa0=_0x1791c2[_0xe661('0x1f')];var _0x2f7ef6=_0x517424?0x0:_0x321083['offset'];var _0x3fc927=_0x517424?_0x1791c2['count']:_0x321083[_0xe661('0x1c')]+_0x321083['limit'];var _0xe0990b;if(_0x3fc927>=_0x124fa0){_0x3fc927=_0x124fa0;_0xe0990b=0xc8;}else{_0xe0990b=0xce;}_0x4afe3a[_0xe661('0x1a')](_0xe0990b);return _0x4afe3a['set'](_0xe661('0x20'),_0x2f7ef6+'-'+_0x3fc927+'/'+_0x124fa0)[_0xe661('0x1b')](_0x1791c2);}return null;};}function patchUpdates(_0x3724cf){return function(_0x379cd2){try{jsonpatch[_0xe661('0x21')](_0x379cd2,_0x3724cf,!![]);}catch(_0x5bd00a){return BPromise[_0xe661('0x22')](_0x5bd00a);}return _0x379cd2['save']();};}function saveUpdates(_0x5cefad,_0x102ddc){return function(_0x97c0eb){if(_0x97c0eb){return _0x97c0eb[_0xe661('0x23')](_0x5cefad)['then'](function(_0x518f43){return _0x518f43;});}return null;};}function removeEntity(_0x4e3d11,_0x319619){return function(_0x27f071){if(_0x27f071){return _0x27f071['destroy']()[_0xe661('0x24')](function(){_0x4e3d11[_0xe661('0x1a')](0xcc)[_0xe661('0x25')]();});}};}function handleEntityNotFound(_0x274ab8,_0x1b0d29){return function(_0x54e6be){if(!_0x54e6be){_0x274ab8[_0xe661('0x19')](0x194);}return _0x54e6be;};}function handleError(_0x11a646,_0x4c4e78){_0x4c4e78=_0x4c4e78||0x1f4;return function(_0x333717){logger[_0xe661('0x26')](_0x333717[_0xe661('0x27')]);if(_0x333717[_0xe661('0x28')]){delete _0x333717[_0xe661('0x28')];}_0x11a646[_0xe661('0x1a')](_0x4c4e78)[_0xe661('0x29')](_0x333717);};}exports[_0xe661('0x2a')]=function(_0x578743,_0x38d765){var _0x1624cb={},_0x1fcd15={},_0x52eb09={'count':0x0,'rows':[]};var _0x35add3=_['map'](db[_0xe661('0x2b')][_0xe661('0x2c')],function(_0x2a0d21){return{'name':_0x2a0d21[_0xe661('0x2d')],'type':_0x2a0d21[_0xe661('0x2e')]['key']};});_0x1fcd15[_0xe661('0x2f')]=_['map'](_0x35add3,'name');_0x1fcd15[_0xe661('0x30')]=_[_0xe661('0x31')](_0x578743[_0xe661('0x30')]);_0x1fcd15[_0xe661('0x32')]=_[_0xe661('0x33')](_0x1fcd15[_0xe661('0x2f')],_0x1fcd15[_0xe661('0x30')]);_0x1624cb[_0xe661('0x34')]=_['intersection'](_0x1fcd15[_0xe661('0x2f')],qs['fields'](_0x578743[_0xe661('0x30')][_0xe661('0x35')]));_0x1624cb[_0xe661('0x34')]=_0x1624cb['attributes'][_0xe661('0x36')]?_0x1624cb['attributes']:_0x1fcd15[_0xe661('0x2f')];if(!_0x578743[_0xe661('0x30')][_0xe661('0x37')](_0xe661('0x38'))){_0x1624cb['limit']=qs['limit'](_0x578743[_0xe661('0x30')][_0xe661('0x1e')]);_0x1624cb[_0xe661('0x1c')]=qs['offset'](_0x578743[_0xe661('0x30')][_0xe661('0x1c')]);}_0x1624cb[_0xe661('0x39')]=qs[_0xe661('0x3a')](_0x578743['query'][_0xe661('0x3a')]);_0x1624cb['where']=qs[_0xe661('0x32')](_[_0xe661('0x3b')](_0x578743[_0xe661('0x30')],_0x1fcd15['filters']),_0x35add3);if(_0x578743[_0xe661('0x30')][_0xe661('0x3c')]){_0x1624cb[_0xe661('0x3d')]=_[_0xe661('0x3e')](_0x1624cb[_0xe661('0x3d')],{'$or':_[_0xe661('0x3f')](_0x35add3,function(_0x321268){if(_0x321268[_0xe661('0x2e')]!==_0xe661('0x40')){var _0xeea18f={};_0xeea18f[_0x321268['name']]={'$like':'%'+_0x578743[_0xe661('0x30')]['filter']+'%'};return _0xeea18f;}})});}_0x1624cb=_[_0xe661('0x3e')]({},_0x1624cb,_0x578743['options']);var _0x578a3d={'where':_0x1624cb['where']};return db[_0xe661('0x2b')][_0xe661('0x1f')](_0x578a3d)[_0xe661('0x24')](function(_0x510b9d){_0x52eb09[_0xe661('0x1f')]=_0x510b9d;if(_0x578743['query'][_0xe661('0x41')]){_0x1624cb['include']=[{'all':!![]}];}return db[_0xe661('0x2b')][_0xe661('0x42')](_0x1624cb);})[_0xe661('0x24')](function(_0x3fdf5f){_0x52eb09[_0xe661('0x43')]=_0x3fdf5f;return _0x52eb09;})[_0xe661('0x24')](respondWithFilteredResult(_0x38d765,_0x1624cb))['catch'](handleError(_0x38d765,null));};exports[_0xe661('0x44')]=function(_0x2b949d,_0x37b082){var _0x1642d1={'raw':![],'where':{'id':_0x2b949d[_0xe661('0x45')]['id']}},_0x7908e={};_0x7908e[_0xe661('0x2f')]=_['keys'](db['FreshsalesConfiguration'][_0xe661('0x2c')]);_0x7908e['query']=_['keys'](_0x2b949d['query']);_0x7908e[_0xe661('0x32')]=_['intersection'](_0x7908e[_0xe661('0x2f')],_0x7908e['query']);_0x1642d1[_0xe661('0x34')]=_[_0xe661('0x33')](_0x7908e['model'],qs[_0xe661('0x35')](_0x2b949d[_0xe661('0x30')][_0xe661('0x35')]));_0x1642d1['attributes']=_0x1642d1[_0xe661('0x34')]['length']?_0x1642d1['attributes']:_0x7908e[_0xe661('0x2f')];if(_0x2b949d['query'][_0xe661('0x41')]){_0x1642d1[_0xe661('0x46')]=[{'all':!![]}];}_0x1642d1=_[_0xe661('0x3e')]({},_0x1642d1,_0x2b949d[_0xe661('0x47')]);return db[_0xe661('0x2b')][_0xe661('0x48')](_0x1642d1)[_0xe661('0x24')](handleEntityNotFound(_0x37b082,null))['then'](respondWithResult(_0x37b082,null))[_0xe661('0x49')](handleError(_0x37b082,null));};exports['create']=function(_0x53e4f3,_0x1c9dae){return db['FreshsalesConfiguration'][_0xe661('0x4a')](_0x53e4f3[_0xe661('0x4b')],{})[_0xe661('0x24')](respondWithResult(_0x1c9dae,0xc9))['catch'](handleError(_0x1c9dae,null));};exports[_0xe661('0x23')]=function(_0x80bb4a,_0x355a7e){if(_0x80bb4a[_0xe661('0x4b')]['id']){delete _0x80bb4a[_0xe661('0x4b')]['id'];}return db[_0xe661('0x2b')]['find']({'where':{'id':_0x80bb4a['params']['id']}})[_0xe661('0x24')](handleEntityNotFound(_0x355a7e,null))[_0xe661('0x24')](saveUpdates(_0x80bb4a['body'],null))['then'](respondWithResult(_0x355a7e,null))[_0xe661('0x49')](handleError(_0x355a7e,null));};exports['destroy']=function(_0xc58cb3,_0x3db679){return db[_0xe661('0x2b')][_0xe661('0x48')]({'where':{'id':_0xc58cb3[_0xe661('0x45')]['id']}})[_0xe661('0x24')](handleEntityNotFound(_0x3db679,null))['then'](removeEntity(_0x3db679,null))['catch'](handleError(_0x3db679,null));};exports[_0xe661('0x4c')]=function(_0x5d4c4f,_0x1c770a,_0x14eee8){var _0x2ae4ff={};var _0x5574e2={};var _0x55c84e;var _0x492533;return db[_0xe661('0x2b')][_0xe661('0x4d')]({'where':{'id':_0x5d4c4f[_0xe661('0x45')]['id']}})[_0xe661('0x24')](handleEntityNotFound(_0x1c770a,null))[_0xe661('0x24')](function(_0x13e465){if(_0x13e465){_0x55c84e=_0x13e465;_0x5574e2[_0xe661('0x2f')]=_[_0xe661('0x31')](db['FreshsalesField'][_0xe661('0x2c')]);_0x5574e2[_0xe661('0x30')]=_[_0xe661('0x31')](_0x5d4c4f[_0xe661('0x30')]);_0x5574e2[_0xe661('0x32')]=_[_0xe661('0x33')](_0x5574e2[_0xe661('0x2f')],_0x5574e2['query']);_0x2ae4ff[_0xe661('0x34')]=_['intersection'](_0x5574e2[_0xe661('0x2f')],qs[_0xe661('0x35')](_0x5d4c4f[_0xe661('0x30')][_0xe661('0x35')]));_0x2ae4ff[_0xe661('0x34')]=_0x2ae4ff[_0xe661('0x34')][_0xe661('0x36')]?_0x2ae4ff[_0xe661('0x34')]:_0x5574e2[_0xe661('0x2f')];_0x2ae4ff['order']=qs[_0xe661('0x3a')](_0x5d4c4f[_0xe661('0x30')][_0xe661('0x3a')]);_0x2ae4ff['where']=qs['filters'](_[_0xe661('0x3b')](_0x5d4c4f['query'],_0x5574e2[_0xe661('0x32')]));if(_0x5d4c4f['query'][_0xe661('0x3c')]){_0x2ae4ff[_0xe661('0x3d')]=_['merge'](_0x2ae4ff['where'],{'$or':_[_0xe661('0x3f')](_0x2ae4ff[_0xe661('0x34')],function(_0x25be48){var _0x25f9aa={};_0x25f9aa[_0x25be48]={'$like':'%'+_0x5d4c4f[_0xe661('0x30')][_0xe661('0x3c')]+'%'};return _0x25f9aa;})});}_0x2ae4ff=_[_0xe661('0x3e')]({},_0x2ae4ff,_0x5d4c4f[_0xe661('0x47')]);return _0x55c84e['getSubjects'](_0x2ae4ff);}})[_0xe661('0x24')](function(_0x1510a3){if(_0x1510a3){_0x492533=_0x1510a3['length'];if(!_0x5d4c4f['query'][_0xe661('0x37')](_0xe661('0x38'))){_0x2ae4ff[_0xe661('0x1e')]=qs['limit'](_0x5d4c4f[_0xe661('0x30')][_0xe661('0x1e')]);_0x2ae4ff[_0xe661('0x1c')]=qs[_0xe661('0x1c')](_0x5d4c4f[_0xe661('0x30')]['offset']);}return _0x55c84e[_0xe661('0x4c')](_0x2ae4ff);}})[_0xe661('0x24')](function(_0x22f8d8){if(_0x22f8d8){return _0x22f8d8?{'count':_0x492533,'rows':_0x22f8d8}:null;}})['then'](respondWithResult(_0x1c770a,null))['catch'](handleError(_0x1c770a,null));};exports[_0xe661('0x4e')]=function(_0x210158,_0x4d4de6,_0x37e484){var _0x1443de={};var _0x314b78={};var _0x3894fc;var _0xf18686;return db[_0xe661('0x2b')]['findOne']({'where':{'id':_0x210158['params']['id']}})['then'](handleEntityNotFound(_0x4d4de6,null))[_0xe661('0x24')](function(_0x387a99){if(_0x387a99){_0x3894fc=_0x387a99;_0x314b78['model']=_[_0xe661('0x31')](db[_0xe661('0x4f')][_0xe661('0x2c')]);_0x314b78[_0xe661('0x30')]=_[_0xe661('0x31')](_0x210158[_0xe661('0x30')]);_0x314b78[_0xe661('0x32')]=_['intersection'](_0x314b78['model'],_0x314b78[_0xe661('0x30')]);_0x1443de['attributes']=_['intersection'](_0x314b78[_0xe661('0x2f')],qs[_0xe661('0x35')](_0x210158[_0xe661('0x30')][_0xe661('0x35')]));_0x1443de[_0xe661('0x34')]=_0x1443de[_0xe661('0x34')][_0xe661('0x36')]?_0x1443de[_0xe661('0x34')]:_0x314b78[_0xe661('0x2f')];_0x1443de[_0xe661('0x39')]=qs[_0xe661('0x3a')](_0x210158['query'][_0xe661('0x3a')]);_0x1443de[_0xe661('0x3d')]=qs['filters'](_[_0xe661('0x3b')](_0x210158[_0xe661('0x30')],_0x314b78[_0xe661('0x32')]));if(_0x210158['query'][_0xe661('0x3c')]){_0x1443de[_0xe661('0x3d')]=_['merge'](_0x1443de[_0xe661('0x3d')],{'$or':_[_0xe661('0x3f')](_0x1443de['attributes'],function(_0x3ded5a){var _0x41159b={};_0x41159b[_0x3ded5a]={'$like':'%'+_0x210158['query'][_0xe661('0x3c')]+'%'};return _0x41159b;})});}_0x1443de=_[_0xe661('0x3e')]({},_0x1443de,_0x210158[_0xe661('0x47')]);return _0x3894fc[_0xe661('0x4e')](_0x1443de);}})['then'](function(_0x193fb5){if(_0x193fb5){_0xf18686=_0x193fb5['length'];if(!_0x210158['query'][_0xe661('0x37')](_0xe661('0x38'))){_0x1443de[_0xe661('0x1e')]=qs[_0xe661('0x1e')](_0x210158[_0xe661('0x30')][_0xe661('0x1e')]);_0x1443de[_0xe661('0x1c')]=qs['offset'](_0x210158['query']['offset']);}return _0x3894fc[_0xe661('0x4e')](_0x1443de);}})[_0xe661('0x24')](function(_0x2116ce){if(_0x2116ce){return _0x2116ce?{'count':_0xf18686,'rows':_0x2116ce}:null;}})['then'](respondWithResult(_0x4d4de6,null))[_0xe661('0x49')](handleError(_0x4d4de6,null));};exports[_0xe661('0x50')]=function(_0x522e60,_0x381a37,_0x2d1516){var _0x1c318f={};var _0x17c30c={};var _0x11fd3d;var _0xb7bba8;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x522e60[_0xe661('0x45')]['id']}})[_0xe661('0x24')](handleEntityNotFound(_0x381a37,null))['then'](function(_0x4cd518){if(_0x4cd518){_0x11fd3d=_0x4cd518;_0x17c30c[_0xe661('0x2f')]=_[_0xe661('0x31')](db[_0xe661('0x4f')][_0xe661('0x2c')]);_0x17c30c[_0xe661('0x30')]=_[_0xe661('0x31')](_0x522e60['query']);_0x17c30c[_0xe661('0x32')]=_[_0xe661('0x33')](_0x17c30c[_0xe661('0x2f')],_0x17c30c[_0xe661('0x30')]);_0x1c318f[_0xe661('0x34')]=_[_0xe661('0x33')](_0x17c30c[_0xe661('0x2f')],qs[_0xe661('0x35')](_0x522e60[_0xe661('0x30')][_0xe661('0x35')]));_0x1c318f[_0xe661('0x34')]=_0x1c318f[_0xe661('0x34')]['length']?_0x1c318f[_0xe661('0x34')]:_0x17c30c[_0xe661('0x2f')];_0x1c318f[_0xe661('0x39')]=qs[_0xe661('0x3a')](_0x522e60[_0xe661('0x30')][_0xe661('0x3a')]);_0x1c318f[_0xe661('0x3d')]=qs[_0xe661('0x32')](_[_0xe661('0x3b')](_0x522e60[_0xe661('0x30')],_0x17c30c[_0xe661('0x32')]));if(_0x522e60[_0xe661('0x30')][_0xe661('0x3c')]){_0x1c318f[_0xe661('0x3d')]=_['merge'](_0x1c318f[_0xe661('0x3d')],{'$or':_[_0xe661('0x3f')](_0x1c318f[_0xe661('0x34')],function(_0x1616d2){var _0x16466b={};_0x16466b[_0x1616d2]={'$like':'%'+_0x522e60[_0xe661('0x30')][_0xe661('0x3c')]+'%'};return _0x16466b;})});}_0x1c318f=_['merge']({},_0x1c318f,_0x522e60[_0xe661('0x47')]);return _0x11fd3d[_0xe661('0x50')](_0x1c318f);}})[_0xe661('0x24')](function(_0x6ad7ac){if(_0x6ad7ac){_0xb7bba8=_0x6ad7ac['length'];if(!_0x522e60[_0xe661('0x30')][_0xe661('0x37')]('nolimit')){_0x1c318f['limit']=qs[_0xe661('0x1e')](_0x522e60[_0xe661('0x30')]['limit']);_0x1c318f['offset']=qs[_0xe661('0x1c')](_0x522e60['query']['offset']);}return _0x11fd3d['getFields'](_0x1c318f);}})[_0xe661('0x24')](function(_0x13f71a){if(_0x13f71a){return _0x13f71a?{'count':_0xb7bba8,'rows':_0x13f71a}:null;}})[_0xe661('0x24')](respondWithResult(_0x381a37,null))[_0xe661('0x49')](handleError(_0x381a37,null));}; \ No newline at end of file +var _0xb0b0=['catch','params','include','find','create','body','getSubjects','order','getDescriptions','getFields','nolimit','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','name','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x4fb85e,_0xac488){var _0x384928=function(_0x117579){while(--_0x117579){_0x4fb85e['push'](_0x4fb85e['shift']());}};_0x384928(++_0xac488);}(_0xb0b0,0x196));var _0x0b0b=function(_0x3893e4,_0x5a091c){_0x3893e4=_0x3893e4-0x0;var _0x5a56c3=_0xb0b0[_0x3893e4];return _0x5a56c3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0b0b('0x0'));var jsonpatch=require(_0x0b0b('0x1'));var rp=require(_0x0b0b('0x2'));var moment=require(_0x0b0b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0b0b('0x4'));var util=require(_0x0b0b('0x5'));var path=require(_0x0b0b('0x6'));var sox=require('sox');var csv=require(_0x0b0b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b0b('0x8'));var _=require(_0x0b0b('0x9'));var squel=require(_0x0b0b('0xa'));var crypto=require(_0x0b0b('0xb'));var jsforce=require(_0x0b0b('0xc'));var deskjs=require(_0x0b0b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b0b('0xe'));var Papa=require(_0x0b0b('0xf'));var Redis=require(_0x0b0b('0x10'));var authService=require(_0x0b0b('0x11'));var qs=require(_0x0b0b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b0b('0x13'))(_0x0b0b('0x14'));var utils=require(_0x0b0b('0x15'));var config=require(_0x0b0b('0x16'));var licenseUtil=require(_0x0b0b('0x17'));var db=require(_0x0b0b('0x18'))['db'];function respondWithStatusCode(_0x28b5b0,_0x14ddb6){_0x14ddb6=_0x14ddb6||0xcc;return function(_0x4ba9ce){if(_0x4ba9ce){return _0x28b5b0['sendStatus'](_0x14ddb6);}return _0x28b5b0[_0x0b0b('0x19')](_0x14ddb6)[_0x0b0b('0x1a')]();};}function respondWithResult(_0x47885a,_0x5a1594){_0x5a1594=_0x5a1594||0xc8;return function(_0x1006e9){if(_0x1006e9){return _0x47885a[_0x0b0b('0x19')](_0x5a1594)[_0x0b0b('0x1b')](_0x1006e9);}};}function respondWithFilteredResult(_0x14c2b5,_0x5d4b0c){return function(_0x4a2fab){if(_0x4a2fab){var _0x33b749=typeof _0x5d4b0c[_0x0b0b('0x1c')]==='undefined'&&typeof _0x5d4b0c[_0x0b0b('0x1d')]==='undefined';var _0x5d5c3b=_0x4a2fab[_0x0b0b('0x1e')];var _0x287a17=_0x33b749?0x0:_0x5d4b0c[_0x0b0b('0x1c')];var _0x1503a2=_0x33b749?_0x4a2fab[_0x0b0b('0x1e')]:_0x5d4b0c[_0x0b0b('0x1c')]+_0x5d4b0c[_0x0b0b('0x1d')];var _0x5b2876;if(_0x1503a2>=_0x5d5c3b){_0x1503a2=_0x5d5c3b;_0x5b2876=0xc8;}else{_0x5b2876=0xce;}_0x14c2b5['status'](_0x5b2876);return _0x14c2b5[_0x0b0b('0x1f')](_0x0b0b('0x20'),_0x287a17+'-'+_0x1503a2+'/'+_0x5d5c3b)['json'](_0x4a2fab);}return null;};}function patchUpdates(_0x1bb627){return function(_0x151002){try{jsonpatch[_0x0b0b('0x21')](_0x151002,_0x1bb627,!![]);}catch(_0x355df0){return BPromise[_0x0b0b('0x22')](_0x355df0);}return _0x151002[_0x0b0b('0x23')]();};}function saveUpdates(_0x1e445f,_0x53391d){return function(_0x4fcba6){if(_0x4fcba6){return _0x4fcba6[_0x0b0b('0x24')](_0x1e445f)[_0x0b0b('0x25')](function(_0x1edf75){return _0x1edf75;});}return null;};}function removeEntity(_0x4adcda,_0x31c938){return function(_0x313323){if(_0x313323){return _0x313323[_0x0b0b('0x26')]()[_0x0b0b('0x25')](function(){_0x4adcda[_0x0b0b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e964e,_0x33377b){return function(_0x319615){if(!_0x319615){_0x3e964e[_0x0b0b('0x27')](0x194);}return _0x319615;};}function handleError(_0x27c9f2,_0x904bf4){_0x904bf4=_0x904bf4||0x1f4;return function(_0x43a828){logger['error'](_0x43a828[_0x0b0b('0x28')]);if(_0x43a828['name']){delete _0x43a828['name'];}_0x27c9f2[_0x0b0b('0x19')](_0x904bf4)[_0x0b0b('0x29')](_0x43a828);};}exports[_0x0b0b('0x2a')]=function(_0x3f6c03,_0x1051b7){var _0x132ba1={},_0x591e28={},_0x1c730a={'count':0x0,'rows':[]};var _0x3f993f=_[_0x0b0b('0x2b')](db[_0x0b0b('0x2c')][_0x0b0b('0x2d')],function(_0x22413b){return{'name':_0x22413b[_0x0b0b('0x2e')],'type':_0x22413b[_0x0b0b('0x2f')][_0x0b0b('0x30')]};});_0x591e28[_0x0b0b('0x31')]=_[_0x0b0b('0x2b')](_0x3f993f,_0x0b0b('0x32'));_0x591e28['query']=_[_0x0b0b('0x33')](_0x3f6c03['query']);_0x591e28[_0x0b0b('0x34')]=_['intersection'](_0x591e28[_0x0b0b('0x31')],_0x591e28[_0x0b0b('0x35')]);_0x132ba1['attributes']=_[_0x0b0b('0x36')](_0x591e28[_0x0b0b('0x31')],qs['fields'](_0x3f6c03[_0x0b0b('0x35')][_0x0b0b('0x37')]));_0x132ba1[_0x0b0b('0x38')]=_0x132ba1[_0x0b0b('0x38')][_0x0b0b('0x39')]?_0x132ba1['attributes']:_0x591e28['model'];if(!_0x3f6c03[_0x0b0b('0x35')][_0x0b0b('0x3a')]('nolimit')){_0x132ba1['limit']=qs[_0x0b0b('0x1d')](_0x3f6c03['query'][_0x0b0b('0x1d')]);_0x132ba1[_0x0b0b('0x1c')]=qs[_0x0b0b('0x1c')](_0x3f6c03[_0x0b0b('0x35')]['offset']);}_0x132ba1['order']=qs[_0x0b0b('0x3b')](_0x3f6c03[_0x0b0b('0x35')][_0x0b0b('0x3b')]);_0x132ba1[_0x0b0b('0x3c')]=qs[_0x0b0b('0x34')](_[_0x0b0b('0x3d')](_0x3f6c03[_0x0b0b('0x35')],_0x591e28[_0x0b0b('0x34')]),_0x3f993f);if(_0x3f6c03[_0x0b0b('0x35')][_0x0b0b('0x3e')]){_0x132ba1['where']=_[_0x0b0b('0x3f')](_0x132ba1[_0x0b0b('0x3c')],{'$or':_[_0x0b0b('0x2b')](_0x3f993f,function(_0x3db80e){if(_0x3db80e['type']!==_0x0b0b('0x40')){var _0x4c132c={};_0x4c132c[_0x3db80e[_0x0b0b('0x32')]]={'$like':'%'+_0x3f6c03[_0x0b0b('0x35')][_0x0b0b('0x3e')]+'%'};return _0x4c132c;}})});}_0x132ba1=_[_0x0b0b('0x3f')]({},_0x132ba1,_0x3f6c03[_0x0b0b('0x41')]);var _0x9c9907={'where':_0x132ba1[_0x0b0b('0x3c')]};return db['FreshsalesConfiguration']['count'](_0x9c9907)[_0x0b0b('0x25')](function(_0x6ef838){_0x1c730a[_0x0b0b('0x1e')]=_0x6ef838;if(_0x3f6c03['query'][_0x0b0b('0x42')]){_0x132ba1['include']=[{'all':!![]}];}return db[_0x0b0b('0x2c')][_0x0b0b('0x43')](_0x132ba1);})['then'](function(_0x485a42){_0x1c730a['rows']=_0x485a42;return _0x1c730a;})[_0x0b0b('0x25')](respondWithFilteredResult(_0x1051b7,_0x132ba1))[_0x0b0b('0x44')](handleError(_0x1051b7,null));};exports['show']=function(_0x38980b,_0x1d6afa){var _0x5a35bc={'raw':![],'where':{'id':_0x38980b[_0x0b0b('0x45')]['id']}},_0x21e640={};_0x21e640[_0x0b0b('0x31')]=_[_0x0b0b('0x33')](db[_0x0b0b('0x2c')]['rawAttributes']);_0x21e640[_0x0b0b('0x35')]=_['keys'](_0x38980b['query']);_0x21e640[_0x0b0b('0x34')]=_['intersection'](_0x21e640[_0x0b0b('0x31')],_0x21e640['query']);_0x5a35bc[_0x0b0b('0x38')]=_['intersection'](_0x21e640[_0x0b0b('0x31')],qs[_0x0b0b('0x37')](_0x38980b[_0x0b0b('0x35')][_0x0b0b('0x37')]));_0x5a35bc[_0x0b0b('0x38')]=_0x5a35bc[_0x0b0b('0x38')]['length']?_0x5a35bc[_0x0b0b('0x38')]:_0x21e640[_0x0b0b('0x31')];if(_0x38980b[_0x0b0b('0x35')]['includeAll']){_0x5a35bc[_0x0b0b('0x46')]=[{'all':!![]}];}_0x5a35bc=_[_0x0b0b('0x3f')]({},_0x5a35bc,_0x38980b['options']);return db['FreshsalesConfiguration'][_0x0b0b('0x47')](_0x5a35bc)['then'](handleEntityNotFound(_0x1d6afa,null))[_0x0b0b('0x25')](respondWithResult(_0x1d6afa,null))[_0x0b0b('0x44')](handleError(_0x1d6afa,null));};exports[_0x0b0b('0x48')]=function(_0x41ecdd,_0x347972){return db['FreshsalesConfiguration'][_0x0b0b('0x48')](_0x41ecdd[_0x0b0b('0x49')],{})[_0x0b0b('0x25')](respondWithResult(_0x347972,0xc9))[_0x0b0b('0x44')](handleError(_0x347972,null));};exports[_0x0b0b('0x24')]=function(_0x799496,_0x2dfa05){if(_0x799496['body']['id']){delete _0x799496[_0x0b0b('0x49')]['id'];}return db[_0x0b0b('0x2c')]['find']({'where':{'id':_0x799496[_0x0b0b('0x45')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x2dfa05,null))[_0x0b0b('0x25')](saveUpdates(_0x799496[_0x0b0b('0x49')],null))[_0x0b0b('0x25')](respondWithResult(_0x2dfa05,null))[_0x0b0b('0x44')](handleError(_0x2dfa05,null));};exports['destroy']=function(_0x412416,_0x9b05b6){return db[_0x0b0b('0x2c')][_0x0b0b('0x47')]({'where':{'id':_0x412416[_0x0b0b('0x45')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x9b05b6,null))[_0x0b0b('0x25')](removeEntity(_0x9b05b6,null))[_0x0b0b('0x44')](handleError(_0x9b05b6,null));};exports[_0x0b0b('0x4a')]=function(_0x479250,_0x276d64,_0x33d3d7){var _0x5b9537={};var _0x344aa5={};var _0x51aad1;var _0x18a8fe;return db[_0x0b0b('0x2c')]['findOne']({'where':{'id':_0x479250[_0x0b0b('0x45')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x276d64,null))['then'](function(_0x595459){if(_0x595459){_0x51aad1=_0x595459;_0x344aa5[_0x0b0b('0x31')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x344aa5['query']=_[_0x0b0b('0x33')](_0x479250[_0x0b0b('0x35')]);_0x344aa5[_0x0b0b('0x34')]=_[_0x0b0b('0x36')](_0x344aa5[_0x0b0b('0x31')],_0x344aa5['query']);_0x5b9537['attributes']=_['intersection'](_0x344aa5[_0x0b0b('0x31')],qs[_0x0b0b('0x37')](_0x479250['query']['fields']));_0x5b9537[_0x0b0b('0x38')]=_0x5b9537[_0x0b0b('0x38')][_0x0b0b('0x39')]?_0x5b9537[_0x0b0b('0x38')]:_0x344aa5[_0x0b0b('0x31')];_0x5b9537[_0x0b0b('0x4b')]=qs['sort'](_0x479250[_0x0b0b('0x35')][_0x0b0b('0x3b')]);_0x5b9537[_0x0b0b('0x3c')]=qs[_0x0b0b('0x34')](_[_0x0b0b('0x3d')](_0x479250[_0x0b0b('0x35')],_0x344aa5[_0x0b0b('0x34')]));if(_0x479250[_0x0b0b('0x35')]['filter']){_0x5b9537[_0x0b0b('0x3c')]=_[_0x0b0b('0x3f')](_0x5b9537['where'],{'$or':_[_0x0b0b('0x2b')](_0x5b9537[_0x0b0b('0x38')],function(_0x20f48d){var _0x2f2f88={};_0x2f2f88[_0x20f48d]={'$like':'%'+_0x479250['query']['filter']+'%'};return _0x2f2f88;})});}_0x5b9537=_[_0x0b0b('0x3f')]({},_0x5b9537,_0x479250[_0x0b0b('0x41')]);return _0x51aad1[_0x0b0b('0x4a')](_0x5b9537);}})[_0x0b0b('0x25')](function(_0x216cb4){if(_0x216cb4){_0x18a8fe=_0x216cb4[_0x0b0b('0x39')];if(!_0x479250['query']['hasOwnProperty']('nolimit')){_0x5b9537[_0x0b0b('0x1d')]=qs[_0x0b0b('0x1d')](_0x479250[_0x0b0b('0x35')]['limit']);_0x5b9537['offset']=qs[_0x0b0b('0x1c')](_0x479250[_0x0b0b('0x35')][_0x0b0b('0x1c')]);}return _0x51aad1[_0x0b0b('0x4a')](_0x5b9537);}})[_0x0b0b('0x25')](function(_0x5b9b51){if(_0x5b9b51){return _0x5b9b51?{'count':_0x18a8fe,'rows':_0x5b9b51}:null;}})[_0x0b0b('0x25')](respondWithResult(_0x276d64,null))[_0x0b0b('0x44')](handleError(_0x276d64,null));};exports[_0x0b0b('0x4c')]=function(_0x12acfc,_0x22262b,_0x4f7c54){var _0x5b8d85={};var _0x43a4f8={};var _0xc0f166;var _0xce738d;return db[_0x0b0b('0x2c')]['findOne']({'where':{'id':_0x12acfc['params']['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x22262b,null))['then'](function(_0x4b4969){if(_0x4b4969){_0xc0f166=_0x4b4969;_0x43a4f8[_0x0b0b('0x31')]=_['keys'](db['FreshsalesField'][_0x0b0b('0x2d')]);_0x43a4f8[_0x0b0b('0x35')]=_[_0x0b0b('0x33')](_0x12acfc[_0x0b0b('0x35')]);_0x43a4f8[_0x0b0b('0x34')]=_['intersection'](_0x43a4f8[_0x0b0b('0x31')],_0x43a4f8['query']);_0x5b8d85[_0x0b0b('0x38')]=_[_0x0b0b('0x36')](_0x43a4f8[_0x0b0b('0x31')],qs[_0x0b0b('0x37')](_0x12acfc[_0x0b0b('0x35')][_0x0b0b('0x37')]));_0x5b8d85['attributes']=_0x5b8d85[_0x0b0b('0x38')]['length']?_0x5b8d85[_0x0b0b('0x38')]:_0x43a4f8[_0x0b0b('0x31')];_0x5b8d85[_0x0b0b('0x4b')]=qs['sort'](_0x12acfc[_0x0b0b('0x35')][_0x0b0b('0x3b')]);_0x5b8d85[_0x0b0b('0x3c')]=qs[_0x0b0b('0x34')](_[_0x0b0b('0x3d')](_0x12acfc['query'],_0x43a4f8['filters']));if(_0x12acfc[_0x0b0b('0x35')][_0x0b0b('0x3e')]){_0x5b8d85[_0x0b0b('0x3c')]=_[_0x0b0b('0x3f')](_0x5b8d85['where'],{'$or':_[_0x0b0b('0x2b')](_0x5b8d85[_0x0b0b('0x38')],function(_0x2dbc1f){var _0x5db796={};_0x5db796[_0x2dbc1f]={'$like':'%'+_0x12acfc['query'][_0x0b0b('0x3e')]+'%'};return _0x5db796;})});}_0x5b8d85=_[_0x0b0b('0x3f')]({},_0x5b8d85,_0x12acfc['options']);return _0xc0f166[_0x0b0b('0x4c')](_0x5b8d85);}})[_0x0b0b('0x25')](function(_0x350027){if(_0x350027){_0xce738d=_0x350027[_0x0b0b('0x39')];if(!_0x12acfc[_0x0b0b('0x35')][_0x0b0b('0x3a')]('nolimit')){_0x5b8d85['limit']=qs[_0x0b0b('0x1d')](_0x12acfc[_0x0b0b('0x35')][_0x0b0b('0x1d')]);_0x5b8d85[_0x0b0b('0x1c')]=qs['offset'](_0x12acfc[_0x0b0b('0x35')][_0x0b0b('0x1c')]);}return _0xc0f166['getDescriptions'](_0x5b8d85);}})['then'](function(_0x2cff56){if(_0x2cff56){return _0x2cff56?{'count':_0xce738d,'rows':_0x2cff56}:null;}})['then'](respondWithResult(_0x22262b,null))[_0x0b0b('0x44')](handleError(_0x22262b,null));};exports[_0x0b0b('0x4d')]=function(_0x58e2d8,_0x507286,_0x42a075){var _0x1c6c88={};var _0x27565b={};var _0x1309af;var _0x2028c7;return db[_0x0b0b('0x2c')]['findOne']({'where':{'id':_0x58e2d8[_0x0b0b('0x45')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x507286,null))[_0x0b0b('0x25')](function(_0xc3ea70){if(_0xc3ea70){_0x1309af=_0xc3ea70;_0x27565b[_0x0b0b('0x31')]=_[_0x0b0b('0x33')](db['FreshsalesField'][_0x0b0b('0x2d')]);_0x27565b[_0x0b0b('0x35')]=_[_0x0b0b('0x33')](_0x58e2d8['query']);_0x27565b[_0x0b0b('0x34')]=_[_0x0b0b('0x36')](_0x27565b[_0x0b0b('0x31')],_0x27565b[_0x0b0b('0x35')]);_0x1c6c88['attributes']=_['intersection'](_0x27565b[_0x0b0b('0x31')],qs[_0x0b0b('0x37')](_0x58e2d8[_0x0b0b('0x35')]['fields']));_0x1c6c88[_0x0b0b('0x38')]=_0x1c6c88[_0x0b0b('0x38')][_0x0b0b('0x39')]?_0x1c6c88['attributes']:_0x27565b[_0x0b0b('0x31')];_0x1c6c88[_0x0b0b('0x4b')]=qs[_0x0b0b('0x3b')](_0x58e2d8[_0x0b0b('0x35')]['sort']);_0x1c6c88[_0x0b0b('0x3c')]=qs[_0x0b0b('0x34')](_[_0x0b0b('0x3d')](_0x58e2d8['query'],_0x27565b['filters']));if(_0x58e2d8['query'][_0x0b0b('0x3e')]){_0x1c6c88[_0x0b0b('0x3c')]=_[_0x0b0b('0x3f')](_0x1c6c88[_0x0b0b('0x3c')],{'$or':_[_0x0b0b('0x2b')](_0x1c6c88[_0x0b0b('0x38')],function(_0xab38aa){var _0x5acb54={};_0x5acb54[_0xab38aa]={'$like':'%'+_0x58e2d8['query'][_0x0b0b('0x3e')]+'%'};return _0x5acb54;})});}_0x1c6c88=_[_0x0b0b('0x3f')]({},_0x1c6c88,_0x58e2d8[_0x0b0b('0x41')]);return _0x1309af['getFields'](_0x1c6c88);}})[_0x0b0b('0x25')](function(_0x5e651b){if(_0x5e651b){_0x2028c7=_0x5e651b[_0x0b0b('0x39')];if(!_0x58e2d8[_0x0b0b('0x35')][_0x0b0b('0x3a')](_0x0b0b('0x4e'))){_0x1c6c88[_0x0b0b('0x1d')]=qs[_0x0b0b('0x1d')](_0x58e2d8['query'][_0x0b0b('0x1d')]);_0x1c6c88[_0x0b0b('0x1c')]=qs[_0x0b0b('0x1c')](_0x58e2d8[_0x0b0b('0x35')][_0x0b0b('0x1c')]);}return _0x1309af[_0x0b0b('0x4d')](_0x1c6c88);}})[_0x0b0b('0x25')](function(_0x58a41d){if(_0x58a41d){return _0x58a41d?{'count':_0x2028c7,'rows':_0x58a41d}:null;}})['then'](respondWithResult(_0x507286,null))[_0x0b0b('0x44')](handleError(_0x507286,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index d1d5e2a..6d37647 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 _0x637e=['rimraf','../../config/environment','exports','define','FreshsalesConfiguration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x363c5d,_0x4ac556){var _0x3e4017=function(_0x58e415){while(--_0x58e415){_0x363c5d['push'](_0x363c5d['shift']());}};_0x3e4017(++_0x4ac556);}(_0x637e,0x118));var _0xe637=function(_0xc9ebb2,_0x8a1c4e){_0xc9ebb2=_0xc9ebb2-0x0;var _0x47aa5d=_0x637e[_0xc9ebb2];return _0x47aa5d;};'use strict';var _=require('lodash');var util=require(_0xe637('0x0'));var logger=require(_0xe637('0x1'))(_0xe637('0x2'));var moment=require(_0xe637('0x3'));var BPromise=require(_0xe637('0x4'));var rp=require(_0xe637('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe637('0x6'));var config=require(_0xe637('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xe637('0x8')]=function(_0x1ac64a,_0x1c7d8c){return _0x1ac64a[_0xe637('0x9')](_0xe637('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c27=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','request-promise'];(function(_0x498549,_0x184ee8){var _0x2b8521=function(_0xf78b2c){while(--_0xf78b2c){_0x498549['push'](_0x498549['shift']());}};_0x2b8521(++_0x184ee8);}(_0x2c27,0x1cf));var _0x72c2=function(_0xf6bdb4,_0x35f312){_0xf6bdb4=_0xf6bdb4-0x0;var _0x1e8566=_0x2c27[_0xf6bdb4];return _0x1e8566;};'use strict';var _=require(_0x72c2('0x0'));var util=require('util');var logger=require(_0x72c2('0x1'))(_0x72c2('0x2'));var moment=require(_0x72c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x72c2('0x4'));var fs=require('fs');var path=require(_0x72c2('0x5'));var rimraf=require(_0x72c2('0x6'));var config=require(_0x72c2('0x7'));var attributes=require(_0x72c2('0x8'));module[_0x72c2('0x9')]=function(_0x17c28e,_0x3dbaaf){return _0x17c28e[_0x72c2('0xa')](_0x72c2('0xb'),attributes,{'tableName':_0x72c2('0xc'),'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 87a62c3..56cd039 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 _0x03ce=['message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x03ce,0xea));var _0xe03c=function(_0x274939,_0x2a2cb8){_0x274939=_0x274939-0x0;var _0x28478e=_0x03ce[_0x274939];return _0x28478e;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var moment=require(_0xe03c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe03c('0x3'))['db'];var utils=require(_0xe03c('0x4'));var logger=require(_0xe03c('0x5'))(_0xe03c('0x6'));var config=require(_0xe03c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe03c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e9cd0,_0x35d58c,_0x38540d){return new BPromise(function(_0x507840,_0x37568b){return client[_0xe03c('0x9')](_0x3e9cd0,_0x38540d)[_0xe03c('0xa')](function(_0x164f90){logger[_0xe03c('0xb')](_0xe03c('0xc'),_0x35d58c,_0xe03c('0xd'));logger[_0xe03c('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x35d58c,_0xe03c('0xd'),JSON[_0xe03c('0xf')](_0x164f90));if(_0x164f90[_0xe03c('0x10')]){if(_0x164f90[_0xe03c('0x10')][_0xe03c('0x11')]===0x1f4){logger['error'](_0xe03c('0xc'),_0x35d58c,_0x164f90[_0xe03c('0x10')]['message']);return _0x37568b(_0x164f90[_0xe03c('0x10')][_0xe03c('0x12')]);}logger['error'](_0xe03c('0xc'),_0x35d58c,_0x164f90['error']['message']);return _0x507840(_0x164f90[_0xe03c('0x10')][_0xe03c('0x12')]);}else{logger[_0xe03c('0xb')](_0xe03c('0xc'),_0x35d58c,_0xe03c('0xd'));_0x507840(_0x164f90[_0xe03c('0x13')][_0xe03c('0x12')]);}})[_0xe03c('0x14')](function(_0x2a4669){logger[_0xe03c('0x10')](_0xe03c('0xc'),_0x35d58c,_0x2a4669);_0x37568b(_0x2a4669);});});} \ No newline at end of file +var _0xb429=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x10b1fc,_0x51d0f4){var _0x41be20=function(_0xc3ca22){while(--_0xc3ca22){_0x10b1fc['push'](_0x10b1fc['shift']());}};_0x41be20(++_0x51d0f4);}(_0xb429,0x1a0));var _0x9b42=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xb429[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x9b42('0x0'));var util=require(_0x9b42('0x1'));var moment=require(_0x9b42('0x2'));var BPromise=require(_0x9b42('0x3'));var rs=require(_0x9b42('0x4'));var fs=require('fs');var Redis=require(_0x9b42('0x5'));var db=require(_0x9b42('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b42('0x7'))(_0x9b42('0x8'));var config=require(_0x9b42('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b42('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4525b3,_0x389f0c,_0x58453c){return new BPromise(function(_0x52da50,_0x161ead){return client[_0x9b42('0xb')](_0x4525b3,_0x58453c)[_0x9b42('0xc')](function(_0x502166){logger[_0x9b42('0xd')](_0x9b42('0xe'),_0x389f0c,_0x9b42('0xf'));logger[_0x9b42('0x10')](_0x9b42('0x11'),_0x389f0c,'request\x20sent',JSON[_0x9b42('0x12')](_0x502166));if(_0x502166['error']){if(_0x502166[_0x9b42('0x13')][_0x9b42('0x14')]===0x1f4){logger[_0x9b42('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x389f0c,_0x502166[_0x9b42('0x13')]['message']);return _0x161ead(_0x502166['error'][_0x9b42('0x15')]);}logger['error'](_0x9b42('0xe'),_0x389f0c,_0x502166['error']['message']);return _0x52da50(_0x502166[_0x9b42('0x13')][_0x9b42('0x15')]);}else{logger[_0x9b42('0xd')](_0x9b42('0xe'),_0x389f0c,_0x9b42('0xf'));_0x52da50(_0x502166['result'][_0x9b42('0x15')]);}})[_0x9b42('0x16')](function(_0x48bf12){logger[_0x9b42('0x13')](_0x9b42('0xe'),_0x389f0c,_0x48bf12);_0x161ead(_0x48bf12);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 2ed09b3..b46a95a 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 _0x4fdc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','util','connect-timeout','express','Router'];(function(_0x40df5f,_0x8fd59f){var _0x1573f1=function(_0x57b8b8){while(--_0x57b8b8){_0x40df5f['push'](_0x40df5f['shift']());}};_0x1573f1(++_0x8fd59f);}(_0x4fdc,0x84));var _0xc4fd=function(_0xbe7cd6,_0x13e918){_0xbe7cd6=_0xbe7cd6-0x0;var _0x18a8d3=_0x4fdc[_0xbe7cd6];return _0x18a8d3;};'use strict';var multer=require('multer');var util=require(_0xc4fd('0x0'));var path=require('path');var timeout=require(_0xc4fd('0x1'));var express=require(_0xc4fd('0x2'));var router=express[_0xc4fd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc4fd('0x4'));var interaction=require(_0xc4fd('0x5'));var config=require(_0xc4fd('0x6'));var controller=require(_0xc4fd('0x7'));router[_0xc4fd('0x8')]('/',auth[_0xc4fd('0x9')](),controller[_0xc4fd('0xa')]);router['get'](_0xc4fd('0xb'),auth[_0xc4fd('0x9')](),controller['show']);router[_0xc4fd('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc4fd('0xd')](_0xc4fd('0xb'),auth[_0xc4fd('0x9')](),controller[_0xc4fd('0xe')]);router[_0xc4fd('0xf')](_0xc4fd('0xb'),auth[_0xc4fd('0x9')](),controller[_0xc4fd('0x10')]);module['exports']=router; \ No newline at end of file +var _0xdadd=['multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x4ecbaf,_0x2c1e70){var _0xe2e141=function(_0x51d03e){while(--_0x51d03e){_0x4ecbaf['push'](_0x4ecbaf['shift']());}};_0xe2e141(++_0x2c1e70);}(_0xdadd,0x1c8));var _0xddad=function(_0x45c957,_0x1762a2){_0x45c957=_0x45c957-0x0;var _0x455a3b=_0xdadd[_0x45c957];return _0x455a3b;};'use strict';var multer=require(_0xddad('0x0'));var util=require('util');var path=require(_0xddad('0x1'));var timeout=require('connect-timeout');var express=require(_0xddad('0x2'));var router=express[_0xddad('0x3')]();var fs_extra=require(_0xddad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xddad('0x5'));var config=require(_0xddad('0x6'));var controller=require(_0xddad('0x7'));router[_0xddad('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xddad('0x8')](_0xddad('0x9'),auth['isAuthenticated'](),controller[_0xddad('0xa')]);router[_0xddad('0xb')]('/',auth[_0xddad('0xc')](),controller[_0xddad('0xd')]);router[_0xddad('0xe')](_0xddad('0x9'),auth[_0xddad('0xc')](),controller[_0xddad('0xf')]);router[_0xddad('0x10')]('/:id',auth[_0xddad('0xc')](),controller[_0xddad('0x11')]);module[_0xddad('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 28bd70b..679b5c1 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 _0x151e=['sequelize','exports','ENUM','string','variable','keyValue','STRING','BOOLEAN'];(function(_0x55c3f2,_0x58c0f1){var _0x27a823=function(_0x434bb6){while(--_0x434bb6){_0x55c3f2['push'](_0x55c3f2['shift']());}};_0x27a823(++_0x58c0f1);}(_0x151e,0x1e8));var _0xe151=function(_0x40cdfa,_0x1cf634){_0x40cdfa=_0x40cdfa-0x0;var _0x2c5e4d=_0x151e[_0x40cdfa];return _0x2c5e4d;};'use strict';var Sequelize=require(_0xe151('0x0'));module[_0xe151('0x1')]={'type':{'type':Sequelize[_0xe151('0x2')](_0xe151('0x3'),_0xe151('0x4'),'customVariable',_0xe151('0x5'),'picklist'),'defaultValue':_0xe151('0x3')},'content':{'type':Sequelize[_0xe151('0x6')]},'key':{'type':Sequelize[_0xe151('0x6')]},'keyType':{'type':Sequelize[_0xe151('0x2')](_0xe151('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xe151('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe151('0x6')]},'customField':{'type':Sequelize[_0xe151('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe151('0x6')]}}; \ No newline at end of file +var _0x5006=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5006,0x166));var _0x6500=function(_0x2b0218,_0x2337a4){_0x2b0218=_0x2b0218-0x0;var _0x1edbf3=_0x5006[_0x2b0218];return _0x1edbf3;};'use strict';var Sequelize=require(_0x6500('0x0'));module[_0x6500('0x1')]={'type':{'type':Sequelize[_0x6500('0x2')](_0x6500('0x3'),_0x6500('0x4'),_0x6500('0x5'),_0x6500('0x6'),_0x6500('0x7')),'defaultValue':_0x6500('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6500('0x8')]},'keyType':{'type':Sequelize[_0x6500('0x2')](_0x6500('0x3'),_0x6500('0x4'),_0x6500('0x5'))},'keyContent':{'type':Sequelize[_0x6500('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6500('0x8')]},'customField':{'type':Sequelize[_0x6500('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6500('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 6355d5e..793b320 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 _0x2566=['path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','reject','update','then','error','stack','name','map','FreshsalesField','rawAttributes','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','intersection','options','create','body','find','destroy','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2566,0x149));var _0x6256=function(_0x4d2bcd,_0x4ef60a){_0x4d2bcd=_0x4d2bcd-0x0;var _0x47b321=_0x2566[_0x4d2bcd];return _0x47b321;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6256('0x0'));var jsonpatch=require(_0x6256('0x1'));var rp=require('request-promise');var moment=require(_0x6256('0x2'));var BPromise=require(_0x6256('0x3'));var Mustache=require(_0x6256('0x4'));var util=require(_0x6256('0x5'));var path=require(_0x6256('0x6'));var sox=require(_0x6256('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6256('0x8'));var _=require(_0x6256('0x9'));var squel=require(_0x6256('0xa'));var crypto=require(_0x6256('0xb'));var jsforce=require(_0x6256('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6256('0xd'));var querystring=require('querystring');var Papa=require(_0x6256('0xe'));var Redis=require(_0x6256('0xf'));var authService=require(_0x6256('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6256('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6256('0x12'));var config=require(_0x6256('0x13'));var licenseUtil=require(_0x6256('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51b5bf,_0x354668){_0x354668=_0x354668||0xcc;return function(_0x383a94){if(_0x383a94){return _0x51b5bf[_0x6256('0x15')](_0x354668);}return _0x51b5bf['status'](_0x354668)[_0x6256('0x16')]();};}function respondWithResult(_0x24add5,_0x3e4615){_0x3e4615=_0x3e4615||0xc8;return function(_0x474941){if(_0x474941){return _0x24add5['status'](_0x3e4615)[_0x6256('0x17')](_0x474941);}};}function respondWithFilteredResult(_0x1a90fd,_0x343f0f){return function(_0x91d150){if(_0x91d150){var _0x1d25f6=typeof _0x343f0f[_0x6256('0x18')]==='undefined'&&typeof _0x343f0f[_0x6256('0x19')]===_0x6256('0x1a');var _0x4981f9=_0x91d150[_0x6256('0x1b')];var _0x16a572=_0x1d25f6?0x0:_0x343f0f[_0x6256('0x18')];var _0xa5fa48=_0x1d25f6?_0x91d150[_0x6256('0x1b')]:_0x343f0f[_0x6256('0x18')]+_0x343f0f[_0x6256('0x19')];var _0x32ec8c;if(_0xa5fa48>=_0x4981f9){_0xa5fa48=_0x4981f9;_0x32ec8c=0xc8;}else{_0x32ec8c=0xce;}_0x1a90fd[_0x6256('0x1c')](_0x32ec8c);return _0x1a90fd[_0x6256('0x1d')]('Content-Range',_0x16a572+'-'+_0xa5fa48+'/'+_0x4981f9)[_0x6256('0x17')](_0x91d150);}return null;};}function patchUpdates(_0x275e90){return function(_0x52f1c6){try{jsonpatch['apply'](_0x52f1c6,_0x275e90,!![]);}catch(_0x511f1f){return BPromise[_0x6256('0x1e')](_0x511f1f);}return _0x52f1c6['save']();};}function saveUpdates(_0x5f595a,_0x3ed712){return function(_0x341fe9){if(_0x341fe9){return _0x341fe9[_0x6256('0x1f')](_0x5f595a)['then'](function(_0x51886c){return _0x51886c;});}return null;};}function removeEntity(_0x1119e6,_0x5631a4){return function(_0x1efafe){if(_0x1efafe){return _0x1efafe['destroy']()[_0x6256('0x20')](function(){_0x1119e6[_0x6256('0x1c')](0xcc)[_0x6256('0x16')]();});}};}function handleEntityNotFound(_0x493fd3,_0x32626f){return function(_0x126652){if(!_0x126652){_0x493fd3[_0x6256('0x15')](0x194);}return _0x126652;};}function handleError(_0x3eb2da,_0x5d751c){_0x5d751c=_0x5d751c||0x1f4;return function(_0x4ef067){logger[_0x6256('0x21')](_0x4ef067[_0x6256('0x22')]);if(_0x4ef067[_0x6256('0x23')]){delete _0x4ef067[_0x6256('0x23')];}_0x3eb2da[_0x6256('0x1c')](_0x5d751c)['send'](_0x4ef067);};}exports['index']=function(_0x3de849,_0x1f52fd){var _0x267733={},_0x103dee={},_0x231386={'count':0x0,'rows':[]};var _0x5e49f8=_[_0x6256('0x24')](db[_0x6256('0x25')][_0x6256('0x26')],function(_0x55548a){return{'name':_0x55548a['fieldName'],'type':_0x55548a[_0x6256('0x27')]['key']};});_0x103dee[_0x6256('0x28')]=_[_0x6256('0x24')](_0x5e49f8,_0x6256('0x23'));_0x103dee[_0x6256('0x29')]=_['keys'](_0x3de849[_0x6256('0x29')]);_0x103dee[_0x6256('0x2a')]=_['intersection'](_0x103dee['model'],_0x103dee['query']);_0x267733[_0x6256('0x2b')]=_['intersection'](_0x103dee[_0x6256('0x28')],qs[_0x6256('0x2c')](_0x3de849[_0x6256('0x29')][_0x6256('0x2c')]));_0x267733[_0x6256('0x2b')]=_0x267733[_0x6256('0x2b')][_0x6256('0x2d')]?_0x267733[_0x6256('0x2b')]:_0x103dee[_0x6256('0x28')];if(!_0x3de849[_0x6256('0x29')][_0x6256('0x2e')](_0x6256('0x2f'))){_0x267733['limit']=qs['limit'](_0x3de849[_0x6256('0x29')]['limit']);_0x267733[_0x6256('0x18')]=qs[_0x6256('0x18')](_0x3de849[_0x6256('0x29')][_0x6256('0x18')]);}_0x267733[_0x6256('0x30')]=qs[_0x6256('0x31')](_0x3de849[_0x6256('0x29')][_0x6256('0x31')]);_0x267733['where']=qs[_0x6256('0x2a')](_['pick'](_0x3de849['query'],_0x103dee['filters']),_0x5e49f8);if(_0x3de849['query'][_0x6256('0x32')]){_0x267733['where']=_[_0x6256('0x33')](_0x267733[_0x6256('0x34')],{'$or':_['map'](_0x5e49f8,function(_0x34c24d){if(_0x34c24d[_0x6256('0x27')]!==_0x6256('0x35')){var _0x541a63={};_0x541a63[_0x34c24d[_0x6256('0x23')]]={'$like':'%'+_0x3de849[_0x6256('0x29')][_0x6256('0x32')]+'%'};return _0x541a63;}})});}_0x267733=_['merge']({},_0x267733,_0x3de849['options']);var _0x3ce966={'where':_0x267733['where']};return db[_0x6256('0x25')]['count'](_0x3ce966)['then'](function(_0x31bb44){_0x231386[_0x6256('0x1b')]=_0x31bb44;if(_0x3de849[_0x6256('0x29')][_0x6256('0x36')]){_0x267733[_0x6256('0x37')]=[{'all':!![]}];}return db[_0x6256('0x25')][_0x6256('0x38')](_0x267733);})[_0x6256('0x20')](function(_0x3e6883){_0x231386['rows']=_0x3e6883;return _0x231386;})[_0x6256('0x20')](respondWithFilteredResult(_0x1f52fd,_0x267733))[_0x6256('0x39')](handleError(_0x1f52fd,null));};exports[_0x6256('0x3a')]=function(_0x33faa5,_0x27c204){var _0x3c49df={'raw':!![],'where':{'id':_0x33faa5[_0x6256('0x3b')]['id']}},_0x416f41={};_0x416f41[_0x6256('0x28')]=_[_0x6256('0x3c')](db['FreshsalesField'][_0x6256('0x26')]);_0x416f41[_0x6256('0x29')]=_[_0x6256('0x3c')](_0x33faa5['query']);_0x416f41['filters']=_['intersection'](_0x416f41[_0x6256('0x28')],_0x416f41[_0x6256('0x29')]);_0x3c49df['attributes']=_[_0x6256('0x3d')](_0x416f41[_0x6256('0x28')],qs[_0x6256('0x2c')](_0x33faa5[_0x6256('0x29')]['fields']));_0x3c49df[_0x6256('0x2b')]=_0x3c49df[_0x6256('0x2b')][_0x6256('0x2d')]?_0x3c49df[_0x6256('0x2b')]:_0x416f41[_0x6256('0x28')];if(_0x33faa5[_0x6256('0x29')][_0x6256('0x36')]){_0x3c49df[_0x6256('0x37')]=[{'all':!![]}];}_0x3c49df=_[_0x6256('0x33')]({},_0x3c49df,_0x33faa5[_0x6256('0x3e')]);return db[_0x6256('0x25')]['find'](_0x3c49df)['then'](handleEntityNotFound(_0x27c204,null))[_0x6256('0x20')](respondWithResult(_0x27c204,null))[_0x6256('0x39')](handleError(_0x27c204,null));};exports['create']=function(_0x33ed9a,_0x444490){return db[_0x6256('0x25')][_0x6256('0x3f')](_0x33ed9a['body'],{})[_0x6256('0x20')](respondWithResult(_0x444490,0xc9))[_0x6256('0x39')](handleError(_0x444490,null));};exports[_0x6256('0x1f')]=function(_0x477088,_0x392692){if(_0x477088[_0x6256('0x40')]['id']){delete _0x477088['body']['id'];}return db[_0x6256('0x25')][_0x6256('0x41')]({'where':{'id':_0x477088[_0x6256('0x3b')]['id']}})[_0x6256('0x20')](handleEntityNotFound(_0x392692,null))[_0x6256('0x20')](saveUpdates(_0x477088[_0x6256('0x40')],null))[_0x6256('0x20')](respondWithResult(_0x392692,null))[_0x6256('0x39')](handleError(_0x392692,null));};exports[_0x6256('0x42')]=function(_0x40e2d6,_0x486bca){return db[_0x6256('0x25')][_0x6256('0x41')]({'where':{'id':_0x40e2d6[_0x6256('0x3b')]['id']}})[_0x6256('0x20')](handleEntityNotFound(_0x486bca,null))[_0x6256('0x20')](removeEntity(_0x486bca,null))[_0x6256('0x39')](handleError(_0x486bca,null));}; \ No newline at end of file +var _0x6e52=['catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','index','map','FreshsalesField','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','rows','show','params','length','include'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6e52,0x1bb));var _0x26e5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e52[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26e5('0x0'));var rimraf=require(_0x26e5('0x1'));var zipdir=require(_0x26e5('0x2'));var jsonpatch=require(_0x26e5('0x3'));var rp=require('request-promise');var moment=require(_0x26e5('0x4'));var BPromise=require(_0x26e5('0x5'));var Mustache=require('mustache');var util=require(_0x26e5('0x6'));var path=require(_0x26e5('0x7'));var sox=require('sox');var csv=require(_0x26e5('0x8'));var ejs=require(_0x26e5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x26e5('0xa'));var crypto=require('crypto');var jsforce=require(_0x26e5('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x26e5('0xc'));var Papa=require(_0x26e5('0xd'));var Redis=require('ioredis');var authService=require(_0x26e5('0xe'));var qs=require(_0x26e5('0xf'));var as=require(_0x26e5('0x10'));var hardwareService=require(_0x26e5('0x11'));var logger=require(_0x26e5('0x12'))(_0x26e5('0x13'));var utils=require(_0x26e5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x26e5('0x15'));var db=require(_0x26e5('0x16'))['db'];function respondWithStatusCode(_0xcc73e6,_0x2178ec){_0x2178ec=_0x2178ec||0xcc;return function(_0x42d81b){if(_0x42d81b){return _0xcc73e6['sendStatus'](_0x2178ec);}return _0xcc73e6['status'](_0x2178ec)[_0x26e5('0x17')]();};}function respondWithResult(_0x3b0690,_0x5bad6a){_0x5bad6a=_0x5bad6a||0xc8;return function(_0x3e7f53){if(_0x3e7f53){return _0x3b0690[_0x26e5('0x18')](_0x5bad6a)['json'](_0x3e7f53);}};}function respondWithFilteredResult(_0x210db7,_0x38ba70){return function(_0x3c9d11){if(_0x3c9d11){var _0x3ea5a1=typeof _0x38ba70[_0x26e5('0x19')]===_0x26e5('0x1a')&&typeof _0x38ba70[_0x26e5('0x1b')]===_0x26e5('0x1a');var _0x5b58dd=_0x3c9d11['count'];var _0x32815b=_0x3ea5a1?0x0:_0x38ba70[_0x26e5('0x19')];var _0x4cdb3e=_0x3ea5a1?_0x3c9d11[_0x26e5('0x1c')]:_0x38ba70['offset']+_0x38ba70[_0x26e5('0x1b')];var _0x1452f9;if(_0x4cdb3e>=_0x5b58dd){_0x4cdb3e=_0x5b58dd;_0x1452f9=0xc8;}else{_0x1452f9=0xce;}_0x210db7[_0x26e5('0x18')](_0x1452f9);return _0x210db7[_0x26e5('0x1d')](_0x26e5('0x1e'),_0x32815b+'-'+_0x4cdb3e+'/'+_0x5b58dd)['json'](_0x3c9d11);}return null;};}function patchUpdates(_0x4ff63a){return function(_0x271eb9){try{jsonpatch['apply'](_0x271eb9,_0x4ff63a,!![]);}catch(_0xdcbf0b){return BPromise[_0x26e5('0x1f')](_0xdcbf0b);}return _0x271eb9[_0x26e5('0x20')]();};}function saveUpdates(_0x5d03d3,_0x5cc9a0){return function(_0x4452b6){if(_0x4452b6){return _0x4452b6['update'](_0x5d03d3)[_0x26e5('0x21')](function(_0x19c464){return _0x19c464;});}return null;};}function removeEntity(_0x530b6a,_0x4a79e3){return function(_0x5150a9){if(_0x5150a9){return _0x5150a9[_0x26e5('0x22')]()['then'](function(){_0x530b6a[_0x26e5('0x18')](0xcc)[_0x26e5('0x17')]();});}};}function handleEntityNotFound(_0x2af9e7,_0x312a97){return function(_0x1e1d14){if(!_0x1e1d14){_0x2af9e7[_0x26e5('0x23')](0x194);}return _0x1e1d14;};}function handleError(_0x2ad1a1,_0x2baec9){_0x2baec9=_0x2baec9||0x1f4;return function(_0x1b9fcd){logger[_0x26e5('0x24')](_0x1b9fcd['stack']);if(_0x1b9fcd[_0x26e5('0x25')]){delete _0x1b9fcd[_0x26e5('0x25')];}_0x2ad1a1['status'](_0x2baec9)['send'](_0x1b9fcd);};}exports[_0x26e5('0x26')]=function(_0x31d974,_0xcc1088){var _0x5d665c={},_0xbada89={},_0xf119f3={'count':0x0,'rows':[]};var _0x5a2d30=_[_0x26e5('0x27')](db[_0x26e5('0x28')][_0x26e5('0x29')],function(_0x41a432){return{'name':_0x41a432[_0x26e5('0x2a')],'type':_0x41a432['type'][_0x26e5('0x2b')]};});_0xbada89['model']=_[_0x26e5('0x27')](_0x5a2d30,'name');_0xbada89['query']=_[_0x26e5('0x2c')](_0x31d974[_0x26e5('0x2d')]);_0xbada89[_0x26e5('0x2e')]=_[_0x26e5('0x2f')](_0xbada89[_0x26e5('0x30')],_0xbada89['query']);_0x5d665c['attributes']=_[_0x26e5('0x2f')](_0xbada89[_0x26e5('0x30')],qs[_0x26e5('0x31')](_0x31d974[_0x26e5('0x2d')][_0x26e5('0x31')]));_0x5d665c[_0x26e5('0x32')]=_0x5d665c[_0x26e5('0x32')]['length']?_0x5d665c[_0x26e5('0x32')]:_0xbada89[_0x26e5('0x30')];if(!_0x31d974[_0x26e5('0x2d')][_0x26e5('0x33')](_0x26e5('0x34'))){_0x5d665c[_0x26e5('0x1b')]=qs[_0x26e5('0x1b')](_0x31d974['query'][_0x26e5('0x1b')]);_0x5d665c[_0x26e5('0x19')]=qs[_0x26e5('0x19')](_0x31d974[_0x26e5('0x2d')][_0x26e5('0x19')]);}_0x5d665c[_0x26e5('0x35')]=qs['sort'](_0x31d974[_0x26e5('0x2d')][_0x26e5('0x36')]);_0x5d665c[_0x26e5('0x37')]=qs[_0x26e5('0x2e')](_[_0x26e5('0x38')](_0x31d974[_0x26e5('0x2d')],_0xbada89['filters']),_0x5a2d30);if(_0x31d974[_0x26e5('0x2d')][_0x26e5('0x39')]){_0x5d665c[_0x26e5('0x37')]=_['merge'](_0x5d665c['where'],{'$or':_[_0x26e5('0x27')](_0x5a2d30,function(_0x59e909){if(_0x59e909[_0x26e5('0x3a')]!==_0x26e5('0x3b')){var _0x4daafb={};_0x4daafb[_0x59e909[_0x26e5('0x25')]]={'$like':'%'+_0x31d974['query']['filter']+'%'};return _0x4daafb;}})});}_0x5d665c=_[_0x26e5('0x3c')]({},_0x5d665c,_0x31d974[_0x26e5('0x3d')]);var _0x37d342={'where':_0x5d665c[_0x26e5('0x37')]};return db[_0x26e5('0x28')][_0x26e5('0x1c')](_0x37d342)[_0x26e5('0x21')](function(_0x24b3a8){_0xf119f3[_0x26e5('0x1c')]=_0x24b3a8;if(_0x31d974[_0x26e5('0x2d')][_0x26e5('0x3e')]){_0x5d665c['include']=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x5d665c);})['then'](function(_0x2cd71d){_0xf119f3[_0x26e5('0x3f')]=_0x2cd71d;return _0xf119f3;})[_0x26e5('0x21')](respondWithFilteredResult(_0xcc1088,_0x5d665c))['catch'](handleError(_0xcc1088,null));};exports[_0x26e5('0x40')]=function(_0x2a8a09,_0x5f2348){var _0xc6bf74={'raw':!![],'where':{'id':_0x2a8a09[_0x26e5('0x41')]['id']}},_0x28a8a8={};_0x28a8a8[_0x26e5('0x30')]=_[_0x26e5('0x2c')](db[_0x26e5('0x28')][_0x26e5('0x29')]);_0x28a8a8[_0x26e5('0x2d')]=_[_0x26e5('0x2c')](_0x2a8a09['query']);_0x28a8a8[_0x26e5('0x2e')]=_[_0x26e5('0x2f')](_0x28a8a8[_0x26e5('0x30')],_0x28a8a8[_0x26e5('0x2d')]);_0xc6bf74[_0x26e5('0x32')]=_[_0x26e5('0x2f')](_0x28a8a8[_0x26e5('0x30')],qs[_0x26e5('0x31')](_0x2a8a09['query'][_0x26e5('0x31')]));_0xc6bf74[_0x26e5('0x32')]=_0xc6bf74[_0x26e5('0x32')][_0x26e5('0x42')]?_0xc6bf74[_0x26e5('0x32')]:_0x28a8a8['model'];if(_0x2a8a09[_0x26e5('0x2d')][_0x26e5('0x3e')]){_0xc6bf74[_0x26e5('0x43')]=[{'all':!![]}];}_0xc6bf74=_[_0x26e5('0x3c')]({},_0xc6bf74,_0x2a8a09[_0x26e5('0x3d')]);return db[_0x26e5('0x28')]['find'](_0xc6bf74)[_0x26e5('0x21')](handleEntityNotFound(_0x5f2348,null))['then'](respondWithResult(_0x5f2348,null))[_0x26e5('0x44')](handleError(_0x5f2348,null));};exports['create']=function(_0x6f3a77,_0x360bad){return db['FreshsalesField'][_0x26e5('0x45')](_0x6f3a77[_0x26e5('0x46')],{})['then'](respondWithResult(_0x360bad,0xc9))[_0x26e5('0x44')](handleError(_0x360bad,null));};exports[_0x26e5('0x47')]=function(_0x556aa9,_0x5a8ff9){if(_0x556aa9['body']['id']){delete _0x556aa9[_0x26e5('0x46')]['id'];}return db[_0x26e5('0x28')][_0x26e5('0x48')]({'where':{'id':_0x556aa9[_0x26e5('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a8ff9,null))['then'](saveUpdates(_0x556aa9[_0x26e5('0x46')],null))[_0x26e5('0x21')](respondWithResult(_0x5a8ff9,null))[_0x26e5('0x44')](handleError(_0x5a8ff9,null));};exports[_0x26e5('0x22')]=function(_0x270b8e,_0x4a0a22){return db[_0x26e5('0x28')]['find']({'where':{'id':_0x270b8e['params']['id']}})[_0x26e5('0x21')](handleEntityNotFound(_0x4a0a22,null))[_0x26e5('0x21')](removeEntity(_0x4a0a22,null))[_0x26e5('0x44')](handleError(_0x4a0a22,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 724d593..4c87fb3 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 _0xdaa8=['../../config/logger','api','./intFreshsalesField.attributes','exports','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util'];(function(_0x364b49,_0x15df87){var _0x1b1967=function(_0x47895c){while(--_0x47895c){_0x364b49['push'](_0x364b49['shift']());}};_0x1b1967(++_0x15df87);}(_0xdaa8,0xe4));var _0x8daa=function(_0x1c8e2f,_0x110c11){_0x1c8e2f=_0x1c8e2f-0x0;var _0xf46ab6=_0xdaa8[_0x1c8e2f];return _0xf46ab6;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var logger=require(_0x8daa('0x2'))(_0x8daa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8daa('0x4'));module[_0x8daa('0x5')]=function(_0x46f753,_0x4d2392){return _0x46f753['define'](_0x8daa('0x6'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x8daa('0x7'),'fields':[_0x8daa('0x8'),_0x8daa('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4c=['bluebird','path','rimraf','../../config/environment','exports','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f4c,0x113));var _0xc8f4=function(_0x867c5e,_0x21f568){_0x867c5e=_0x867c5e-0x0;var _0x38c628=_0x8f4c[_0x867c5e];return _0x38c628;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./intFreshsalesField.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xc'),_0xc8f4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 2686361..0861e96 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 _0x1967=['then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x1967,0x173));var _0x7196=function(_0x5318c5,_0x4b369a){_0x5318c5=_0x5318c5-0x0;var _0x23d450=_0x1967[_0x5318c5];return _0x23d450;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4f89fa,_0x39546d){var _0x338542=function(_0x4cfe9d){while(--_0x4cfe9d){_0x4f89fa['push'](_0x4f89fa['shift']());}};_0x338542(++_0x39546d);}(_0x5d58,0x187));var _0x85d5=function(_0x2703bd,_0x4093ad){_0x2703bd=_0x2703bd-0x0;var _0x140866=_0x5d58[_0x2703bd];return _0x140866;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index feb94bb..c5c907f 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(_0x5d3bff,_0x17c010){var _0x3181cf=function(_0x16c780){while(--_0x16c780){_0x5d3bff['push'](_0x5d3bff['shift']());}};_0x3181cf(++_0x17c010);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x19c48d,_0x5d71e8){var _0x45ad43=function(_0xc6e9a4){while(--_0xc6e9a4){_0x19c48d['push'](_0x19c48d['shift']());}};_0x45ad43(++_0x5d71e8);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index b2631b0..f41da69 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 _0xae59=['ENUM','integrationTab','newTab','sequelize','STRING','username'];(function(_0x12e044,_0xc0b469){var _0x3f50d5=function(_0x14dfb6){while(--_0x14dfb6){_0x12e044['push'](_0x12e044['shift']());}};_0x3f50d5(++_0xc0b469);}(_0xae59,0x8d));var _0x9ae5=function(_0x2f0175,_0x2eda1c){_0x2f0175=_0x2f0175-0x0;var _0x51c18f=_0xae59[_0x2f0175];return _0x51c18f;};'use strict';var Sequelize=require(_0x9ae5('0x0'));module['exports']={'name':{'type':Sequelize[_0x9ae5('0x1')]},'description':{'type':Sequelize[_0x9ae5('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x9ae5('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9ae5('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x9ae5('0x1')]},'securityToken':{'type':Sequelize[_0x9ae5('0x1')]},'serverUrl':{'type':Sequelize[_0x9ae5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9ae5('0x3')](_0x9ae5('0x4'),_0x9ae5('0x5')),'defaultValue':_0x9ae5('0x4')}}; \ No newline at end of file +var _0x2678=['ENUM','integrationTab','newTab','exports','STRING'];(function(_0x146050,_0x24a4d8){var _0x179a48=function(_0xb524b1){while(--_0xb524b1){_0x146050['push'](_0x146050['shift']());}};_0x179a48(++_0x24a4d8);}(_0x2678,0x1bb));var _0x8267=function(_0x1be584,_0xcb595){_0x1be584=_0x1be584-0x0;var _0x5c60d2=_0x2678[_0x1be584];return _0x5c60d2;};'use strict';var Sequelize=require('sequelize');module[_0x8267('0x0')]={'name':{'type':Sequelize[_0x8267('0x1')]},'description':{'type':Sequelize[_0x8267('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8267('0x1')]},'clientId':{'type':Sequelize[_0x8267('0x1')]},'clientSecret':{'type':Sequelize[_0x8267('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x8267('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8267('0x2')](_0x8267('0x3'),_0x8267('0x4')),'defaultValue':_0x8267('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 7699c27..0dbe6a3 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 _0x3c56=['update','then','destroy','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','SalesforceAccount','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','length','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Task','remoteUri','clientId','username','password','slice','substring','Connection','clientSecret','login','securityToken','isNil','ticketType','sobject','OwnerId','ActivityDate','IsRecurrence','Subject','int','boolean','email','textarea','remove','includes','picklistValues','label','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','test','Wrong\x20credentials','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','reject','save'];(function(_0x2bf7d4,_0x28a4e3){var _0x44a011=function(_0x49a1e6){while(--_0x49a1e6){_0x2bf7d4['push'](_0x2bf7d4['shift']());}};_0x44a011(++_0x28a4e3);}(_0x3c56,0x12e));var _0x63c5=function(_0x528585,_0x13507b){_0x528585=_0x528585-0x0;var _0x4badf7=_0x3c56[_0x528585];return _0x4badf7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63c5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x63c5('0x1'));var BPromise=require(_0x63c5('0x2'));var Mustache=require(_0x63c5('0x3'));var util=require(_0x63c5('0x4'));var path=require(_0x63c5('0x5'));var sox=require(_0x63c5('0x6'));var csv=require(_0x63c5('0x7'));var ejs=require(_0x63c5('0x8'));var fs=require('fs');var fs_extra=require(_0x63c5('0x9'));var _=require(_0x63c5('0xa'));var squel=require(_0x63c5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x63c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x63c5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x63c5('0xe'));var qs=require(_0x63c5('0xf'));var as=require(_0x63c5('0x10'));var hardwareService=require(_0x63c5('0x11'));var logger=require('../../config/logger')(_0x63c5('0x12'));var utils=require(_0x63c5('0x13'));var config=require(_0x63c5('0x14'));var licenseUtil=require(_0x63c5('0x15'));var db=require(_0x63c5('0x16'))['db'];var integrations=require(_0x63c5('0x17'));function respondWithStatusCode(_0xc614d1,_0x36c474){_0x36c474=_0x36c474||0xcc;return function(_0x2e7ac5){if(_0x2e7ac5){return _0xc614d1[_0x63c5('0x18')](_0x36c474);}return _0xc614d1[_0x63c5('0x19')](_0x36c474)[_0x63c5('0x1a')]();};}function respondWithResult(_0x2dbe32,_0x145a37){_0x145a37=_0x145a37||0xc8;return function(_0x2cc47e){if(_0x2cc47e){return _0x2dbe32[_0x63c5('0x19')](_0x145a37)['json'](_0x2cc47e);}};}function respondWithFilteredResult(_0x164b1d,_0x49f71d){return function(_0x56f9ba){if(_0x56f9ba){var _0x517cf1=typeof _0x49f71d[_0x63c5('0x1b')]===_0x63c5('0x1c')&&typeof _0x49f71d[_0x63c5('0x1d')]==='undefined';var _0x4f4de5=_0x56f9ba[_0x63c5('0x1e')];var _0x31254f=_0x517cf1?0x0:_0x49f71d[_0x63c5('0x1b')];var _0x256085=_0x517cf1?_0x56f9ba[_0x63c5('0x1e')]:_0x49f71d[_0x63c5('0x1b')]+_0x49f71d[_0x63c5('0x1d')];var _0x310cfd;if(_0x256085>=_0x4f4de5){_0x256085=_0x4f4de5;_0x310cfd=0xc8;}else{_0x310cfd=0xce;}_0x164b1d[_0x63c5('0x19')](_0x310cfd);return _0x164b1d['set']('Content-Range',_0x31254f+'-'+_0x256085+'/'+_0x4f4de5)[_0x63c5('0x1f')](_0x56f9ba);}return null;};}function patchUpdates(_0x16de25){return function(_0x36657c){try{jsonpatch['apply'](_0x36657c,_0x16de25,!![]);}catch(_0x3160d6){return BPromise[_0x63c5('0x20')](_0x3160d6);}return _0x36657c[_0x63c5('0x21')]();};}function saveUpdates(_0x5002d2,_0x421efb){return function(_0x5892ed){if(_0x5892ed){return _0x5892ed[_0x63c5('0x22')](_0x5002d2)[_0x63c5('0x23')](function(_0x4f3466){return _0x4f3466;});}return null;};}function removeEntity(_0x3850fe,_0x8db77e){return function(_0x36431d){if(_0x36431d){return _0x36431d[_0x63c5('0x24')]()['then'](function(){_0x3850fe[_0x63c5('0x19')](0xcc)[_0x63c5('0x1a')]();});}};}function handleEntityNotFound(_0x310e29,_0x3e8908){return function(_0x41034f){if(!_0x41034f){_0x310e29[_0x63c5('0x18')](0x194);}return _0x41034f;};}function handleError(_0x38f959,_0x1351c2){_0x1351c2=_0x1351c2||0x1f4;return function(_0xcb1725){logger['error'](_0xcb1725['stack']);if(_0xcb1725[_0x63c5('0x25')]){delete _0xcb1725[_0x63c5('0x25')];}_0x38f959['status'](_0x1351c2)['send'](_0xcb1725);};}exports[_0x63c5('0x26')]=function(_0x4658ff,_0xb6ac7d){var _0xf0d56a={},_0x88965={},_0x537722={'count':0x0,'rows':[]};var _0x826cf4=_[_0x63c5('0x27')](db['SalesforceAccount'][_0x63c5('0x28')],function(_0x47ef54){return{'name':_0x47ef54['fieldName'],'type':_0x47ef54[_0x63c5('0x29')][_0x63c5('0x2a')]};});_0x88965[_0x63c5('0x2b')]=_[_0x63c5('0x27')](_0x826cf4,_0x63c5('0x25'));_0x88965[_0x63c5('0x2c')]=_[_0x63c5('0x2d')](_0x4658ff[_0x63c5('0x2c')]);_0x88965[_0x63c5('0x2e')]=_['intersection'](_0x88965[_0x63c5('0x2b')],_0x88965['query']);_0xf0d56a['attributes']=_[_0x63c5('0x2f')](_0x88965[_0x63c5('0x2b')],qs[_0x63c5('0x30')](_0x4658ff['query'][_0x63c5('0x30')]));_0xf0d56a[_0x63c5('0x31')]=_0xf0d56a[_0x63c5('0x31')]['length']?_0xf0d56a[_0x63c5('0x31')]:_0x88965[_0x63c5('0x2b')];if(!_0x4658ff[_0x63c5('0x2c')][_0x63c5('0x32')](_0x63c5('0x33'))){_0xf0d56a[_0x63c5('0x1d')]=qs[_0x63c5('0x1d')](_0x4658ff[_0x63c5('0x2c')][_0x63c5('0x1d')]);_0xf0d56a[_0x63c5('0x1b')]=qs['offset'](_0x4658ff[_0x63c5('0x2c')][_0x63c5('0x1b')]);}_0xf0d56a[_0x63c5('0x34')]=qs[_0x63c5('0x35')](_0x4658ff[_0x63c5('0x2c')][_0x63c5('0x35')]);_0xf0d56a[_0x63c5('0x36')]=qs[_0x63c5('0x2e')](_['pick'](_0x4658ff[_0x63c5('0x2c')],_0x88965[_0x63c5('0x2e')]),_0x826cf4);if(_0x4658ff[_0x63c5('0x2c')]['filter']){_0xf0d56a[_0x63c5('0x36')]=_[_0x63c5('0x37')](_0xf0d56a[_0x63c5('0x36')],{'$or':_[_0x63c5('0x27')](_0x826cf4,function(_0x353e30){if(_0x353e30[_0x63c5('0x29')]!==_0x63c5('0x38')){var _0xfe525f={};_0xfe525f[_0x353e30[_0x63c5('0x25')]]={'$like':'%'+_0x4658ff[_0x63c5('0x2c')][_0x63c5('0x39')]+'%'};return _0xfe525f;}})});}_0xf0d56a=_[_0x63c5('0x37')]({},_0xf0d56a,_0x4658ff['options']);var _0x36aee1={'where':_0xf0d56a['where']};return db[_0x63c5('0x3a')][_0x63c5('0x1e')](_0x36aee1)['then'](function(_0x2aa4c4){_0x537722[_0x63c5('0x1e')]=_0x2aa4c4;if(_0x4658ff[_0x63c5('0x2c')][_0x63c5('0x3b')]){_0xf0d56a[_0x63c5('0x3c')]=[{'all':!![]}];}return db[_0x63c5('0x3a')]['findAll'](_0xf0d56a);})[_0x63c5('0x23')](function(_0x9516be){_0x537722[_0x63c5('0x3d')]=_0x9516be;return _0x537722;})[_0x63c5('0x23')](respondWithFilteredResult(_0xb6ac7d,_0xf0d56a))[_0x63c5('0x3e')](handleError(_0xb6ac7d,null));};exports[_0x63c5('0x3f')]=function(_0x3cd9da,_0x4c3da9){var _0x4050a0={'raw':![],'where':{'id':_0x3cd9da[_0x63c5('0x40')]['id']}},_0x5c5d5f={};_0x5c5d5f[_0x63c5('0x2b')]=_[_0x63c5('0x2d')](db[_0x63c5('0x3a')][_0x63c5('0x28')]);_0x5c5d5f['query']=_[_0x63c5('0x2d')](_0x3cd9da[_0x63c5('0x2c')]);_0x5c5d5f[_0x63c5('0x2e')]=_[_0x63c5('0x2f')](_0x5c5d5f[_0x63c5('0x2b')],_0x5c5d5f[_0x63c5('0x2c')]);_0x4050a0[_0x63c5('0x31')]=_[_0x63c5('0x2f')](_0x5c5d5f[_0x63c5('0x2b')],qs[_0x63c5('0x30')](_0x3cd9da[_0x63c5('0x2c')]['fields']));_0x4050a0[_0x63c5('0x31')]=_0x4050a0[_0x63c5('0x31')]['length']?_0x4050a0[_0x63c5('0x31')]:_0x5c5d5f[_0x63c5('0x2b')];if(_0x3cd9da['query'][_0x63c5('0x3b')]){_0x4050a0[_0x63c5('0x3c')]=[{'all':!![]}];}_0x4050a0=_[_0x63c5('0x37')]({},_0x4050a0,_0x3cd9da['options']);return db[_0x63c5('0x3a')][_0x63c5('0x41')](_0x4050a0)[_0x63c5('0x23')](handleEntityNotFound(_0x4c3da9,null))[_0x63c5('0x23')](respondWithResult(_0x4c3da9,null))[_0x63c5('0x3e')](handleError(_0x4c3da9,null));};exports[_0x63c5('0x42')]=function(_0x28996d,_0x51c88c){return db[_0x63c5('0x3a')][_0x63c5('0x42')](_0x28996d[_0x63c5('0x43')],{})[_0x63c5('0x23')](respondWithResult(_0x51c88c,0xc9))[_0x63c5('0x3e')](handleError(_0x51c88c,null));};exports[_0x63c5('0x22')]=function(_0x41098c,_0x1349f9){if(_0x41098c['body']['id']){delete _0x41098c[_0x63c5('0x43')]['id'];}return db[_0x63c5('0x3a')][_0x63c5('0x41')]({'where':{'id':_0x41098c[_0x63c5('0x40')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x1349f9,null))[_0x63c5('0x23')](saveUpdates(_0x41098c['body'],null))[_0x63c5('0x23')](respondWithResult(_0x1349f9,null))[_0x63c5('0x3e')](handleError(_0x1349f9,null));};exports[_0x63c5('0x24')]=function(_0x1dfea9,_0x3a9931){return db[_0x63c5('0x3a')]['find']({'where':{'id':_0x1dfea9[_0x63c5('0x40')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x3a9931,null))['then'](removeEntity(_0x3a9931,null))['catch'](handleError(_0x3a9931,null));};exports[_0x63c5('0x44')]=function(_0x5843ee,_0x376f0f,_0x369f84){var _0x326706={};var _0x572b09={};var _0x1ea56f;var _0x53ea0b;return db['SalesforceAccount'][_0x63c5('0x45')]({'where':{'id':_0x5843ee[_0x63c5('0x40')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x376f0f,null))[_0x63c5('0x23')](function(_0xfc8390){if(_0xfc8390){_0x1ea56f=_0xfc8390;_0x572b09[_0x63c5('0x2b')]=_[_0x63c5('0x2d')](db['SalesforceConfiguration']['rawAttributes']);_0x572b09[_0x63c5('0x2c')]=_[_0x63c5('0x2d')](_0x5843ee['query']);_0x572b09[_0x63c5('0x2e')]=_['intersection'](_0x572b09[_0x63c5('0x2b')],_0x572b09['query']);_0x326706[_0x63c5('0x31')]=_[_0x63c5('0x2f')](_0x572b09['model'],qs[_0x63c5('0x30')](_0x5843ee[_0x63c5('0x2c')][_0x63c5('0x30')]));_0x326706[_0x63c5('0x31')]=_0x326706[_0x63c5('0x31')]['length']?_0x326706[_0x63c5('0x31')]:_0x572b09[_0x63c5('0x2b')];_0x326706['order']=qs[_0x63c5('0x35')](_0x5843ee[_0x63c5('0x2c')]['sort']);_0x326706['where']=qs[_0x63c5('0x2e')](_['pick'](_0x5843ee['query'],_0x572b09[_0x63c5('0x2e')]));if(_0x5843ee[_0x63c5('0x2c')]['filter']){_0x326706[_0x63c5('0x36')]=_[_0x63c5('0x37')](_0x326706['where'],{'$or':_[_0x63c5('0x27')](_0x326706[_0x63c5('0x31')],function(_0x18e766){var _0x4b9fe0={};_0x4b9fe0[_0x18e766]={'$like':'%'+_0x5843ee[_0x63c5('0x2c')][_0x63c5('0x39')]+'%'};return _0x4b9fe0;})});}_0x326706=_[_0x63c5('0x37')]({},_0x326706,_0x5843ee['options']);return _0x1ea56f[_0x63c5('0x44')](_0x326706);}})['then'](function(_0x35afb2){if(_0x35afb2){_0x53ea0b=_0x35afb2[_0x63c5('0x46')];if(!_0x5843ee[_0x63c5('0x2c')][_0x63c5('0x32')](_0x63c5('0x33'))){_0x326706[_0x63c5('0x1d')]=qs[_0x63c5('0x1d')](_0x5843ee['query'][_0x63c5('0x1d')]);_0x326706[_0x63c5('0x1b')]=qs[_0x63c5('0x1b')](_0x5843ee[_0x63c5('0x2c')][_0x63c5('0x1b')]);}return _0x1ea56f[_0x63c5('0x44')](_0x326706);}})[_0x63c5('0x23')](function(_0x404bbf){if(_0x404bbf){return _0x404bbf?{'count':_0x53ea0b,'rows':_0x404bbf}:null;}})[_0x63c5('0x23')](respondWithResult(_0x376f0f,null))[_0x63c5('0x3e')](handleError(_0x376f0f,null));};exports['addConfiguration']=function(_0x1892d3,_0x5ac7e9,_0x3fb6db){if(_0x1892d3[_0x63c5('0x43')]['id']){delete _0x1892d3[_0x63c5('0x43')]['id'];}return db[_0x63c5('0x3a')][_0x63c5('0x45')]({'where':{'id':_0x1892d3[_0x63c5('0x40')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x5ac7e9,null))[_0x63c5('0x23')](function(_0x5ca966){if(_0x5ca966){_0x1892d3[_0x63c5('0x43')][_0x63c5('0x47')]=_0x5ca966['id'];_0x1892d3[_0x63c5('0x43')][_0x63c5('0x48')]=integrations['getSubjects'](_0x1892d3[_0x63c5('0x43')][_0x63c5('0x49')],_0x1892d3['body'][_0x63c5('0x29')]);_0x1892d3[_0x63c5('0x43')][_0x63c5('0x4a')]=integrations[_0x63c5('0x4b')](_0x1892d3[_0x63c5('0x43')][_0x63c5('0x49')],_0x1892d3[_0x63c5('0x43')][_0x63c5('0x29')]);return db[_0x63c5('0x4c')][_0x63c5('0x42')](_0x1892d3['body'],{'include':[{'model':db[_0x63c5('0x4d')],'as':_0x63c5('0x48')},{'model':db[_0x63c5('0x4d')],'as':_0x63c5('0x4a')}]});}return null;})[_0x63c5('0x23')](respondWithResult(_0x5ac7e9,null))[_0x63c5('0x3e')](handleError(_0x5ac7e9,null));};exports['getFields']=function(_0x1bd0c4,_0x4b84e4,_0x6e7a2f){var _0x26821c;var _0xf0b00c='';var _0x49a00a=_0x63c5('0x4e');return db[_0x63c5('0x3a')]['findOne']({'where':{'id':_0x1bd0c4[_0x63c5('0x40')]['id']},'attributes':['id',_0x63c5('0x4f'),_0x63c5('0x50'),'clientSecret',_0x63c5('0x51'),_0x63c5('0x52'),'securityToken']})[_0x63c5('0x23')](handleEntityNotFound(_0x4b84e4,null))[_0x63c5('0x23')](function(_0x3a6140){if(_0x3a6140){_0xf0b00c=_0x3a6140[_0x63c5('0x4f')];var _0x8ee5bd=_0xf0b00c[_0x63c5('0x53')](-0x1);if(_0x8ee5bd==='/'){_0xf0b00c=_0xf0b00c[_0x63c5('0x54')](0x0,_0xf0b00c['lastIndexOf'](_0x8ee5bd));}_0x26821c=new jsforce[(_0x63c5('0x55'))]({'oauth2':{'loginUrl':_0xf0b00c,'clientId':_0x3a6140['clientId'],'clientSecret':_0x3a6140[_0x63c5('0x56')]}});return _0x26821c[_0x63c5('0x57')](_0x3a6140['username'],_0x3a6140[_0x63c5('0x52')]['concat'](_0x3a6140[_0x63c5('0x58')]));}})[_0x63c5('0x23')](function(_0x30a106){if(_0x30a106){if(!_[_0x63c5('0x59')](_0x1bd0c4[_0x63c5('0x2c')][_0x63c5('0x5a')])){_0x49a00a=_0x1bd0c4[_0x63c5('0x2c')][_0x63c5('0x5a')];}return _0x26821c[_0x63c5('0x5b')](_0x49a00a)['describe']();}})[_0x63c5('0x23')](function(_0x40a418){var _0x59e94b=[_0x63c5('0x5c'),_0x63c5('0x5d'),'IsReminderSet',_0x63c5('0x5e'),_0x63c5('0x5f'),'Description'];var _0x1c386c=['string',_0x63c5('0x60'),'picklist',_0x63c5('0x61'),_0x63c5('0x62'),_0x63c5('0x63'),'phone'];if(_0x40a418){_[_0x63c5('0x64')](_0x40a418['fields'],function(_0x435f2c){return _0x59e94b[_0x63c5('0x65')](_0x435f2c[_0x63c5('0x25')])||!_0x1c386c[_0x63c5('0x65')](_0x435f2c['type']);});return{'count':_0x40a418[_0x63c5('0x30')]['length'],'rows':_[_0x63c5('0x27')](_0x40a418[_0x63c5('0x30')],function(_0x42aa13){return{'id':_0x42aa13['name'],'name':_0x42aa13['label'],'custom':_0x42aa13['custom'],'options':_0x42aa13[_0x63c5('0x66')][_0x63c5('0x46')]>0x0?_[_0x63c5('0x27')](_0x42aa13[_0x63c5('0x66')],function(_0x526656){return{'name':_0x526656[_0x63c5('0x67')],'value':_0x526656['value']};}):_0x42aa13['type']==_0x63c5('0x61')?[{'name':'True','value':'true'},{'name':_0x63c5('0x68'),'value':_0x63c5('0x69')}]:[]};})};}})[_0x63c5('0x23')](respondWithResult(_0x4b84e4,null))['catch'](function(_0x335677){var _0x10c4e1=_0x1bd0c4[_0x63c5('0x2c')]['test']?0x1f4:_0x335677[_0x63c5('0x6a')]||0x1f4;logger['error'](_0x63c5('0x6b'),_0x63c5('0x6c'),_0x10c4e1,JSON['stringify'](_0x335677));delete _0x335677['name'];if(_0x10c4e1===0x191){_0x10c4e1=0x190;}_0x4b84e4[_0x63c5('0x19')](_0x10c4e1)[_0x63c5('0x6d')](_0x1bd0c4[_0x63c5('0x2c')][_0x63c5('0x6e')]?{'message':_0x63c5('0x6f'),'statusCode':_0x335677[_0x63c5('0x6a')]}:_0x335677);});}; \ No newline at end of file +var _0xa366=['getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','login','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','string','int','boolean','remove','includes','label','picklistValues','True','true','False','false','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','util','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','then','stack','name','send','index','SalesforceAccount','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','length','options','find','catch','create','body','params','destroy','findOne','getConfigurations','addConfiguration','AccountId','Subjects'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0xa366,0x17c));var _0x6a36=function(_0x100416,_0x510655){_0x100416=_0x100416-0x0;var _0x160ab2=_0xa366[_0x100416];return _0x160ab2;};'use strict';var emlformat=require(_0x6a36('0x0'));var rimraf=require(_0x6a36('0x1'));var zipdir=require(_0x6a36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6a36('0x3'));var path=require(_0x6a36('0x4'));var sox=require('sox');var csv=require(_0x6a36('0x5'));var ejs=require(_0x6a36('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a36('0x7'));var squel=require('squel');var crypto=require(_0x6a36('0x8'));var jsforce=require(_0x6a36('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6a36('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6a36('0xb'));var as=require(_0x6a36('0xc'));var hardwareService=require(_0x6a36('0xd'));var logger=require(_0x6a36('0xe'))(_0x6a36('0xf'));var utils=require('../../config/utils');var config=require(_0x6a36('0x10'));var licenseUtil=require(_0x6a36('0x11'));var db=require(_0x6a36('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3322a2,_0x5ccd18){_0x5ccd18=_0x5ccd18||0xcc;return function(_0x24e539){if(_0x24e539){return _0x3322a2[_0x6a36('0x13')](_0x5ccd18);}return _0x3322a2[_0x6a36('0x14')](_0x5ccd18)[_0x6a36('0x15')]();};}function respondWithResult(_0xb83b47,_0x2feb8c){_0x2feb8c=_0x2feb8c||0xc8;return function(_0x488edf){if(_0x488edf){return _0xb83b47[_0x6a36('0x14')](_0x2feb8c)[_0x6a36('0x16')](_0x488edf);}};}function respondWithFilteredResult(_0x59d3ac,_0x1577a9){return function(_0x2f12f3){if(_0x2f12f3){var _0x2ec0e3=typeof _0x1577a9[_0x6a36('0x17')]===_0x6a36('0x18')&&typeof _0x1577a9['limit']===_0x6a36('0x18');var _0x441779=_0x2f12f3['count'];var _0x527161=_0x2ec0e3?0x0:_0x1577a9['offset'];var _0x42e818=_0x2ec0e3?_0x2f12f3[_0x6a36('0x19')]:_0x1577a9[_0x6a36('0x17')]+_0x1577a9[_0x6a36('0x1a')];var _0x1def33;if(_0x42e818>=_0x441779){_0x42e818=_0x441779;_0x1def33=0xc8;}else{_0x1def33=0xce;}_0x59d3ac['status'](_0x1def33);return _0x59d3ac['set']('Content-Range',_0x527161+'-'+_0x42e818+'/'+_0x441779)[_0x6a36('0x16')](_0x2f12f3);}return null;};}function patchUpdates(_0x5c1249){return function(_0x33d2d5){try{jsonpatch[_0x6a36('0x1b')](_0x33d2d5,_0x5c1249,!![]);}catch(_0x333cd7){return BPromise['reject'](_0x333cd7);}return _0x33d2d5[_0x6a36('0x1c')]();};}function saveUpdates(_0x1c15eb,_0x12c6b4){return function(_0x440a65){if(_0x440a65){return _0x440a65[_0x6a36('0x1d')](_0x1c15eb)[_0x6a36('0x1e')](function(_0x2a715d){return _0x2a715d;});}return null;};}function removeEntity(_0x1459c6,_0x24d8fd){return function(_0x56732e){if(_0x56732e){return _0x56732e['destroy']()['then'](function(){_0x1459c6[_0x6a36('0x14')](0xcc)[_0x6a36('0x15')]();});}};}function handleEntityNotFound(_0x3dd203,_0x5c2679){return function(_0x53d432){if(!_0x53d432){_0x3dd203['sendStatus'](0x194);}return _0x53d432;};}function handleError(_0x4d5333,_0x1a02c2){_0x1a02c2=_0x1a02c2||0x1f4;return function(_0x52069d){logger['error'](_0x52069d[_0x6a36('0x1f')]);if(_0x52069d[_0x6a36('0x20')]){delete _0x52069d[_0x6a36('0x20')];}_0x4d5333['status'](_0x1a02c2)[_0x6a36('0x21')](_0x52069d);};}exports[_0x6a36('0x22')]=function(_0x4802a0,_0x50fafe){var _0x3a2b55={},_0x1ed071={},_0x473ca0={'count':0x0,'rows':[]};var _0x3c28cf=_['map'](db[_0x6a36('0x23')][_0x6a36('0x24')],function(_0x48da13){return{'name':_0x48da13['fieldName'],'type':_0x48da13['type'][_0x6a36('0x25')]};});_0x1ed071['model']=_[_0x6a36('0x26')](_0x3c28cf,_0x6a36('0x20'));_0x1ed071[_0x6a36('0x27')]=_[_0x6a36('0x28')](_0x4802a0[_0x6a36('0x27')]);_0x1ed071[_0x6a36('0x29')]=_[_0x6a36('0x2a')](_0x1ed071[_0x6a36('0x2b')],_0x1ed071['query']);_0x3a2b55[_0x6a36('0x2c')]=_[_0x6a36('0x2a')](_0x1ed071[_0x6a36('0x2b')],qs[_0x6a36('0x2d')](_0x4802a0[_0x6a36('0x27')][_0x6a36('0x2d')]));_0x3a2b55['attributes']=_0x3a2b55['attributes']['length']?_0x3a2b55[_0x6a36('0x2c')]:_0x1ed071[_0x6a36('0x2b')];if(!_0x4802a0[_0x6a36('0x27')][_0x6a36('0x2e')](_0x6a36('0x2f'))){_0x3a2b55['limit']=qs[_0x6a36('0x1a')](_0x4802a0['query'][_0x6a36('0x1a')]);_0x3a2b55[_0x6a36('0x17')]=qs[_0x6a36('0x17')](_0x4802a0[_0x6a36('0x27')][_0x6a36('0x17')]);}_0x3a2b55[_0x6a36('0x30')]=qs[_0x6a36('0x31')](_0x4802a0[_0x6a36('0x27')][_0x6a36('0x31')]);_0x3a2b55[_0x6a36('0x32')]=qs[_0x6a36('0x29')](_[_0x6a36('0x33')](_0x4802a0['query'],_0x1ed071[_0x6a36('0x29')]),_0x3c28cf);if(_0x4802a0[_0x6a36('0x27')][_0x6a36('0x34')]){_0x3a2b55[_0x6a36('0x32')]=_[_0x6a36('0x35')](_0x3a2b55[_0x6a36('0x32')],{'$or':_[_0x6a36('0x26')](_0x3c28cf,function(_0x1565e0){if(_0x1565e0[_0x6a36('0x36')]!=='VIRTUAL'){var _0x5b1942={};_0x5b1942[_0x1565e0[_0x6a36('0x20')]]={'$like':'%'+_0x4802a0['query'][_0x6a36('0x34')]+'%'};return _0x5b1942;}})});}_0x3a2b55=_[_0x6a36('0x35')]({},_0x3a2b55,_0x4802a0['options']);var _0x701271={'where':_0x3a2b55[_0x6a36('0x32')]};return db[_0x6a36('0x23')]['count'](_0x701271)[_0x6a36('0x1e')](function(_0x4772b0){_0x473ca0[_0x6a36('0x19')]=_0x4772b0;if(_0x4802a0[_0x6a36('0x27')][_0x6a36('0x37')]){_0x3a2b55[_0x6a36('0x38')]=[{'all':!![]}];}return db[_0x6a36('0x23')][_0x6a36('0x39')](_0x3a2b55);})[_0x6a36('0x1e')](function(_0x92c050){_0x473ca0[_0x6a36('0x3a')]=_0x92c050;return _0x473ca0;})[_0x6a36('0x1e')](respondWithFilteredResult(_0x50fafe,_0x3a2b55))['catch'](handleError(_0x50fafe,null));};exports['show']=function(_0xa45af5,_0x1b44f4){var _0x334572={'raw':![],'where':{'id':_0xa45af5['params']['id']}},_0x4f93f8={};_0x4f93f8['model']=_[_0x6a36('0x28')](db[_0x6a36('0x23')][_0x6a36('0x24')]);_0x4f93f8[_0x6a36('0x27')]=_[_0x6a36('0x28')](_0xa45af5[_0x6a36('0x27')]);_0x4f93f8[_0x6a36('0x29')]=_[_0x6a36('0x2a')](_0x4f93f8[_0x6a36('0x2b')],_0x4f93f8['query']);_0x334572[_0x6a36('0x2c')]=_[_0x6a36('0x2a')](_0x4f93f8[_0x6a36('0x2b')],qs[_0x6a36('0x2d')](_0xa45af5[_0x6a36('0x27')][_0x6a36('0x2d')]));_0x334572[_0x6a36('0x2c')]=_0x334572[_0x6a36('0x2c')][_0x6a36('0x3b')]?_0x334572['attributes']:_0x4f93f8[_0x6a36('0x2b')];if(_0xa45af5['query'][_0x6a36('0x37')]){_0x334572[_0x6a36('0x38')]=[{'all':!![]}];}_0x334572=_[_0x6a36('0x35')]({},_0x334572,_0xa45af5[_0x6a36('0x3c')]);return db[_0x6a36('0x23')][_0x6a36('0x3d')](_0x334572)[_0x6a36('0x1e')](handleEntityNotFound(_0x1b44f4,null))[_0x6a36('0x1e')](respondWithResult(_0x1b44f4,null))[_0x6a36('0x3e')](handleError(_0x1b44f4,null));};exports['create']=function(_0xfd41e,_0x153fb5){return db[_0x6a36('0x23')][_0x6a36('0x3f')](_0xfd41e[_0x6a36('0x40')],{})[_0x6a36('0x1e')](respondWithResult(_0x153fb5,0xc9))[_0x6a36('0x3e')](handleError(_0x153fb5,null));};exports[_0x6a36('0x1d')]=function(_0x13f9cb,_0x4d524b){if(_0x13f9cb['body']['id']){delete _0x13f9cb[_0x6a36('0x40')]['id'];}return db[_0x6a36('0x23')][_0x6a36('0x3d')]({'where':{'id':_0x13f9cb[_0x6a36('0x41')]['id']}})[_0x6a36('0x1e')](handleEntityNotFound(_0x4d524b,null))['then'](saveUpdates(_0x13f9cb['body'],null))[_0x6a36('0x1e')](respondWithResult(_0x4d524b,null))[_0x6a36('0x3e')](handleError(_0x4d524b,null));};exports[_0x6a36('0x42')]=function(_0x1316b2,_0x1d5335){return db[_0x6a36('0x23')][_0x6a36('0x3d')]({'where':{'id':_0x1316b2[_0x6a36('0x41')]['id']}})[_0x6a36('0x1e')](handleEntityNotFound(_0x1d5335,null))['then'](removeEntity(_0x1d5335,null))[_0x6a36('0x3e')](handleError(_0x1d5335,null));};exports['getConfigurations']=function(_0xd18b1b,_0x4bb093,_0x3063ad){var _0x325a85={};var _0x31f68b={};var _0x376ead;var _0x28501c;return db[_0x6a36('0x23')][_0x6a36('0x43')]({'where':{'id':_0xd18b1b[_0x6a36('0x41')]['id']}})[_0x6a36('0x1e')](handleEntityNotFound(_0x4bb093,null))['then'](function(_0xc4d2ca){if(_0xc4d2ca){_0x376ead=_0xc4d2ca;_0x31f68b['model']=_[_0x6a36('0x28')](db['SalesforceConfiguration'][_0x6a36('0x24')]);_0x31f68b[_0x6a36('0x27')]=_['keys'](_0xd18b1b[_0x6a36('0x27')]);_0x31f68b[_0x6a36('0x29')]=_[_0x6a36('0x2a')](_0x31f68b[_0x6a36('0x2b')],_0x31f68b[_0x6a36('0x27')]);_0x325a85[_0x6a36('0x2c')]=_[_0x6a36('0x2a')](_0x31f68b[_0x6a36('0x2b')],qs[_0x6a36('0x2d')](_0xd18b1b[_0x6a36('0x27')][_0x6a36('0x2d')]));_0x325a85['attributes']=_0x325a85[_0x6a36('0x2c')][_0x6a36('0x3b')]?_0x325a85[_0x6a36('0x2c')]:_0x31f68b[_0x6a36('0x2b')];_0x325a85[_0x6a36('0x30')]=qs[_0x6a36('0x31')](_0xd18b1b['query'][_0x6a36('0x31')]);_0x325a85[_0x6a36('0x32')]=qs[_0x6a36('0x29')](_['pick'](_0xd18b1b[_0x6a36('0x27')],_0x31f68b[_0x6a36('0x29')]));if(_0xd18b1b[_0x6a36('0x27')]['filter']){_0x325a85['where']=_[_0x6a36('0x35')](_0x325a85[_0x6a36('0x32')],{'$or':_['map'](_0x325a85[_0x6a36('0x2c')],function(_0x2774c4){var _0x4302ef={};_0x4302ef[_0x2774c4]={'$like':'%'+_0xd18b1b[_0x6a36('0x27')][_0x6a36('0x34')]+'%'};return _0x4302ef;})});}_0x325a85=_[_0x6a36('0x35')]({},_0x325a85,_0xd18b1b['options']);return _0x376ead[_0x6a36('0x44')](_0x325a85);}})[_0x6a36('0x1e')](function(_0xaab5de){if(_0xaab5de){_0x28501c=_0xaab5de['length'];if(!_0xd18b1b[_0x6a36('0x27')]['hasOwnProperty']('nolimit')){_0x325a85[_0x6a36('0x1a')]=qs['limit'](_0xd18b1b[_0x6a36('0x27')][_0x6a36('0x1a')]);_0x325a85[_0x6a36('0x17')]=qs[_0x6a36('0x17')](_0xd18b1b[_0x6a36('0x27')][_0x6a36('0x17')]);}return _0x376ead['getConfigurations'](_0x325a85);}})[_0x6a36('0x1e')](function(_0x4650f3){if(_0x4650f3){return _0x4650f3?{'count':_0x28501c,'rows':_0x4650f3}:null;}})[_0x6a36('0x1e')](respondWithResult(_0x4bb093,null))['catch'](handleError(_0x4bb093,null));};exports[_0x6a36('0x45')]=function(_0x286f5d,_0x39bf27,_0x4deb87){if(_0x286f5d[_0x6a36('0x40')]['id']){delete _0x286f5d['body']['id'];}return db[_0x6a36('0x23')][_0x6a36('0x43')]({'where':{'id':_0x286f5d[_0x6a36('0x41')]['id']}})[_0x6a36('0x1e')](handleEntityNotFound(_0x39bf27,null))[_0x6a36('0x1e')](function(_0x2b76a3){if(_0x2b76a3){_0x286f5d[_0x6a36('0x40')][_0x6a36('0x46')]=_0x2b76a3['id'];_0x286f5d[_0x6a36('0x40')][_0x6a36('0x47')]=integrations[_0x6a36('0x48')](_0x286f5d['body'][_0x6a36('0x49')],_0x286f5d[_0x6a36('0x40')][_0x6a36('0x36')]);_0x286f5d[_0x6a36('0x40')][_0x6a36('0x4a')]=integrations[_0x6a36('0x4b')](_0x286f5d[_0x6a36('0x40')][_0x6a36('0x49')],_0x286f5d[_0x6a36('0x40')][_0x6a36('0x36')]);return db[_0x6a36('0x4c')][_0x6a36('0x3f')](_0x286f5d['body'],{'include':[{'model':db[_0x6a36('0x4d')],'as':_0x6a36('0x47')},{'model':db[_0x6a36('0x4d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x39bf27,null))[_0x6a36('0x3e')](handleError(_0x39bf27,null));};exports[_0x6a36('0x4e')]=function(_0x5bc2d0,_0x5b6507,_0x3601fc){var _0x17b825;var _0x3532a0='';var _0x29b103=_0x6a36('0x4f');return db[_0x6a36('0x23')][_0x6a36('0x43')]({'where':{'id':_0x5bc2d0['params']['id']},'attributes':['id',_0x6a36('0x50'),_0x6a36('0x51'),'clientSecret',_0x6a36('0x52'),_0x6a36('0x53'),_0x6a36('0x54')]})[_0x6a36('0x1e')](handleEntityNotFound(_0x5b6507,null))[_0x6a36('0x1e')](function(_0x40fc1e){if(_0x40fc1e){_0x3532a0=_0x40fc1e[_0x6a36('0x50')];var _0x385114=_0x3532a0[_0x6a36('0x55')](-0x1);if(_0x385114==='/'){_0x3532a0=_0x3532a0[_0x6a36('0x56')](0x0,_0x3532a0[_0x6a36('0x57')](_0x385114));}_0x17b825=new jsforce[(_0x6a36('0x58'))]({'oauth2':{'loginUrl':_0x3532a0,'clientId':_0x40fc1e[_0x6a36('0x51')],'clientSecret':_0x40fc1e[_0x6a36('0x59')]}});return _0x17b825[_0x6a36('0x5a')](_0x40fc1e[_0x6a36('0x52')],_0x40fc1e[_0x6a36('0x53')]['concat'](_0x40fc1e[_0x6a36('0x54')]));}})[_0x6a36('0x1e')](function(_0x27880e){if(_0x27880e){if(!_['isNil'](_0x5bc2d0['query'][_0x6a36('0x5b')])){_0x29b103=_0x5bc2d0[_0x6a36('0x27')][_0x6a36('0x5b')];}return _0x17b825['sobject'](_0x29b103)[_0x6a36('0x5c')]();}})[_0x6a36('0x1e')](function(_0xbfc228){var _0x14b419=[_0x6a36('0x5d'),_0x6a36('0x5e'),_0x6a36('0x5f'),_0x6a36('0x60'),'Subject','Description'];var _0x4f0450=[_0x6a36('0x61'),_0x6a36('0x62'),'picklist',_0x6a36('0x63'),'email','textarea','phone'];if(_0xbfc228){_[_0x6a36('0x64')](_0xbfc228[_0x6a36('0x2d')],function(_0x10e4d2){return _0x14b419[_0x6a36('0x65')](_0x10e4d2['name'])||!_0x4f0450[_0x6a36('0x65')](_0x10e4d2[_0x6a36('0x36')]);});return{'count':_0xbfc228[_0x6a36('0x2d')][_0x6a36('0x3b')],'rows':_[_0x6a36('0x26')](_0xbfc228[_0x6a36('0x2d')],function(_0x5f2608){return{'id':_0x5f2608[_0x6a36('0x20')],'name':_0x5f2608[_0x6a36('0x66')],'custom':_0x5f2608['custom'],'options':_0x5f2608[_0x6a36('0x67')][_0x6a36('0x3b')]>0x0?_['map'](_0x5f2608[_0x6a36('0x67')],function(_0x2d7850){return{'name':_0x2d7850[_0x6a36('0x66')],'value':_0x2d7850['value']};}):_0x5f2608['type']==_0x6a36('0x63')?[{'name':_0x6a36('0x68'),'value':_0x6a36('0x69')},{'name':_0x6a36('0x6a'),'value':_0x6a36('0x6b')}]:[]};})};}})[_0x6a36('0x1e')](respondWithResult(_0x5b6507,null))['catch'](function(_0x382b3a){var _0xc12637=_0x5bc2d0['query'][_0x6a36('0x6c')]?0x1f4:_0x382b3a[_0x6a36('0x6d')]||0x1f4;logger[_0x6a36('0x6e')]('getFields,\x20%s,\x20%s,\x20%s',_0x6a36('0x4e'),_0xc12637,JSON[_0x6a36('0x6f')](_0x382b3a));delete _0x382b3a['name'];if(_0xc12637===0x191){_0xc12637=0x190;}_0x5b6507['status'](_0xc12637)[_0x6a36('0x21')](_0x5bc2d0[_0x6a36('0x27')]['test']?{'message':_0x6a36('0x70'),'statusCode':_0x382b3a[_0x6a36('0x6d')]}:_0x382b3a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index f142d1e..1d559fe 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 _0x6594=['rimraf','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','moment','bluebird','request-promise','path'];(function(_0x2f02a5,_0x405e87){var _0x25ff27=function(_0x45e429){while(--_0x45e429){_0x2f02a5['push'](_0x2f02a5['shift']());}};_0x25ff27(++_0x405e87);}(_0x6594,0xcb));var _0x4659=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x6594[_0x115d5b];return _0x6cfc50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4659('0x0'));var BPromise=require(_0x4659('0x1'));var rp=require(_0x4659('0x2'));var fs=require('fs');var path=require(_0x4659('0x3'));var rimraf=require(_0x4659('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x4659('0x5'));module[_0x4659('0x6')]=function(_0x246729,_0x45d2e8){return _0x246729['define'](_0x4659('0x7'),attributes,{'tableName':_0x4659('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fa9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts'];(function(_0x58d033,_0x3701a8){var _0x48862a=function(_0x597136){while(--_0x597136){_0x58d033['push'](_0x58d033['shift']());}};_0x48862a(++_0x3701a8);}(_0x9fa9,0x1c7));var _0x99fa=function(_0x369b70,_0x9e7e09){_0x369b70=_0x369b70-0x0;var _0x2d37e8=_0x9fa9[_0x369b70];return _0x2d37e8;};'use strict';var _=require(_0x99fa('0x0'));var util=require(_0x99fa('0x1'));var logger=require(_0x99fa('0x2'))(_0x99fa('0x3'));var moment=require(_0x99fa('0x4'));var BPromise=require(_0x99fa('0x5'));var rp=require(_0x99fa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x99fa('0x7'));var attributes=require(_0x99fa('0x8'));var integrations=require(_0x99fa('0x9'));module[_0x99fa('0xa')]=function(_0x5cd263,_0x585cff){return _0x5cd263['define'](_0x99fa('0xb'),attributes,{'tableName':_0x99fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 15f1e26..478f7bf 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 _0x186e=['stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x44b523,_0x14507b){var _0x591685=function(_0x3a1ec7){while(--_0x3a1ec7){_0x44b523['push'](_0x44b523['shift']());}};_0x591685(++_0x14507b);}(_0x186e,0xbc));var _0xe186=function(_0x4d15b8,_0x2e4240){_0x4d15b8=_0x4d15b8-0x0;var _0x533737=_0x186e[_0x4d15b8];return _0x533737;};'use strict';var _=require(_0xe186('0x0'));var util=require(_0xe186('0x1'));var moment=require(_0xe186('0x2'));var BPromise=require(_0xe186('0x3'));var rs=require(_0xe186('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe186('0x5'))['db'];var utils=require(_0xe186('0x6'));var logger=require(_0xe186('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe186('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb019ee,_0x195952,_0x41e9b2){return new BPromise(function(_0x12bca6,_0x27b263){return client[_0xe186('0x9')](_0xb019ee,_0x41e9b2)[_0xe186('0xa')](function(_0x33c190){logger[_0xe186('0xb')](_0xe186('0xc'),_0x195952,_0xe186('0xd'));logger[_0xe186('0xe')](_0xe186('0xf'),_0x195952,_0xe186('0xd'),JSON[_0xe186('0x10')](_0x33c190));if(_0x33c190[_0xe186('0x11')]){if(_0x33c190[_0xe186('0x11')]['code']===0x1f4){logger[_0xe186('0x11')](_0xe186('0xc'),_0x195952,_0x33c190[_0xe186('0x11')][_0xe186('0x12')]);return _0x27b263(_0x33c190[_0xe186('0x11')][_0xe186('0x12')]);}logger[_0xe186('0x11')](_0xe186('0xc'),_0x195952,_0x33c190[_0xe186('0x11')]['message']);return _0x12bca6(_0x33c190['error'][_0xe186('0x12')]);}else{logger['info'](_0xe186('0xc'),_0x195952,_0xe186('0xd'));_0x12bca6(_0x33c190[_0xe186('0x13')]['message']);}})[_0xe186('0x14')](function(_0x1889bb){logger['error'](_0xe186('0xc'),_0x195952,_0x1889bb);_0x27b263(_0x1889bb);});});}exports[_0xe186('0x15')]=function(_0x50e5ed){var _0x55caa1=this;return new Promise(function(_0x2572eb,_0x439891){return db[_0xe186('0x16')][_0xe186('0x17')]({'raw':_0x50e5ed[_0xe186('0x18')]?_0x50e5ed[_0xe186('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x50e5ed[_0xe186('0x18')]?_0x50e5ed[_0xe186('0x18')][_0xe186('0x19')]||null:null,'attributes':_0x50e5ed[_0xe186('0x18')]?_0x50e5ed['options'][_0xe186('0x1a')]||null:null,'limit':_0x50e5ed[_0xe186('0x18')]?_0x50e5ed['options'][_0xe186('0x1b')]||null:null,'include':_0x50e5ed[_0xe186('0x18')]?_0x50e5ed[_0xe186('0x18')][_0xe186('0x1c')]?_[_0xe186('0x1d')](_0x50e5ed[_0xe186('0x18')][_0xe186('0x1c')],function(_0x3280af){return{'model':db[_0x3280af[_0xe186('0x1e')]],'as':_0x3280af['as'],'attributes':_0x3280af[_0xe186('0x1a')],'include':_0x3280af[_0xe186('0x1c')]?_[_0xe186('0x1d')](_0x3280af[_0xe186('0x1c')],function(_0x452e6f){return{'model':db[_0x452e6f[_0xe186('0x1e')]],'as':_0x452e6f['as'],'attributes':_0x452e6f['attributes'],'include':_0x452e6f['include']?_[_0xe186('0x1d')](_0x452e6f['include'],function(_0x32b281){return{'model':db[_0x32b281[_0xe186('0x1e')]],'as':_0x32b281['as'],'attributes':_0x32b281[_0xe186('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe186('0xa')](function(_0x59db02){logger[_0xe186('0xb')](_0xe186('0x15'),_0x50e5ed);logger[_0xe186('0xe')](_0xe186('0x15'),_0x50e5ed,JSON['stringify'](_0x59db02));_0x2572eb(_0x59db02);})[_0xe186('0x14')](function(_0x95481f){logger['error'](_0xe186('0x15'),_0x95481f[_0xe186('0x12')],_0x50e5ed);_0x439891(_0x55caa1['error'](0x1f4,_0x95481f[_0xe186('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x19c887){var _0x441af3=this;return new Promise(function(_0x22abac,_0x43dfd0){return db[_0xe186('0x16')][_0xe186('0x1f')]({'raw':_0x19c887[_0xe186('0x18')]?_0x19c887[_0xe186('0x18')][_0xe186('0x20')]===undefined?!![]:![]:!![],'where':_0x19c887['options']?_0x19c887['options'][_0xe186('0x19')]||null:null,'attributes':_0x19c887[_0xe186('0x18')]?_0x19c887[_0xe186('0x18')][_0xe186('0x1a')]||null:null,'include':_0x19c887[_0xe186('0x18')]?_0x19c887[_0xe186('0x18')][_0xe186('0x1c')]?_[_0xe186('0x1d')](_0x19c887[_0xe186('0x18')][_0xe186('0x1c')],function(_0x22b47d){return{'model':db[_0x22b47d[_0xe186('0x1e')]],'as':_0x22b47d['as'],'attributes':_0x22b47d[_0xe186('0x1a')],'include':_0x22b47d[_0xe186('0x1c')]?_['map'](_0x22b47d[_0xe186('0x1c')],function(_0x51fc6d){return{'model':db[_0x51fc6d['model']],'as':_0x51fc6d['as'],'attributes':_0x51fc6d[_0xe186('0x1a')],'include':_0x51fc6d[_0xe186('0x1c')]?_[_0xe186('0x1d')](_0x51fc6d[_0xe186('0x1c')],function(_0x5d3745){return{'model':db[_0x5d3745[_0xe186('0x1e')]],'as':_0x5d3745['as'],'attributes':_0x5d3745[_0xe186('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x226d3d){logger['info'](_0xe186('0x21'),_0x19c887);logger[_0xe186('0xe')](_0xe186('0x21'),_0x19c887,JSON[_0xe186('0x10')](_0x226d3d));_0x22abac(_0x226d3d);})[_0xe186('0x14')](function(_0x1aff3f){logger['error']('ShowSalesforceAccount',_0x1aff3f[_0xe186('0x12')],_0x19c887);_0x43dfd0(_0x441af3[_0xe186('0x11')](0x1f4,_0x1aff3f['message']));});});}; \ No newline at end of file +var _0x4b8b=['options','raw','where','attributes','include','map','model','debug','catch','ShowSalesforceAccount','SalesforceAccount','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount'];(function(_0x5d00ab,_0x3eb79d){var _0x1aeba5=function(_0x4da5c1){while(--_0x4da5c1){_0x5d00ab['push'](_0x5d00ab['shift']());}};_0x1aeba5(++_0x3eb79d);}(_0x4b8b,0x16a));var _0xb4b8=function(_0x102243,_0x2b4dde){_0x102243=_0x102243-0x0;var _0x1d302c=_0x4b8b[_0x102243];return _0x1d302c;};'use strict';var _=require(_0xb4b8('0x0'));var util=require(_0xb4b8('0x1'));var moment=require(_0xb4b8('0x2'));var BPromise=require(_0xb4b8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4b8('0x4'))['db'];var utils=require(_0xb4b8('0x5'));var logger=require('../../config/logger')(_0xb4b8('0x6'));var config=require(_0xb4b8('0x7'));var jayson=require(_0xb4b8('0x8'));var client=jayson[_0xb4b8('0x9')][_0xb4b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x101b8f,_0x33d218,_0x1f607b){return new BPromise(function(_0x2e0e26,_0x8dff27){return client[_0xb4b8('0xb')](_0x101b8f,_0x1f607b)[_0xb4b8('0xc')](function(_0x34d86e){logger[_0xb4b8('0xd')](_0xb4b8('0xe'),_0x33d218,_0xb4b8('0xf'));logger['debug'](_0xb4b8('0x10'),_0x33d218,'request\x20sent',JSON[_0xb4b8('0x11')](_0x34d86e));if(_0x34d86e['error']){if(_0x34d86e[_0xb4b8('0x12')][_0xb4b8('0x13')]===0x1f4){logger[_0xb4b8('0x12')](_0xb4b8('0xe'),_0x33d218,_0x34d86e[_0xb4b8('0x12')]['message']);return _0x8dff27(_0x34d86e[_0xb4b8('0x12')][_0xb4b8('0x14')]);}logger[_0xb4b8('0x12')](_0xb4b8('0xe'),_0x33d218,_0x34d86e[_0xb4b8('0x12')][_0xb4b8('0x14')]);return _0x2e0e26(_0x34d86e[_0xb4b8('0x12')][_0xb4b8('0x14')]);}else{logger[_0xb4b8('0xd')](_0xb4b8('0xe'),_0x33d218,_0xb4b8('0xf'));_0x2e0e26(_0x34d86e[_0xb4b8('0x15')][_0xb4b8('0x14')]);}})['catch'](function(_0x10c7b9){logger[_0xb4b8('0x12')](_0xb4b8('0xe'),_0x33d218,_0x10c7b9);_0x8dff27(_0x10c7b9);});});}exports[_0xb4b8('0x16')]=function(_0x9f0e2){var _0x40026e=this;return new Promise(function(_0x3fbd11,_0x5d79b5){return db['SalesforceAccount']['findAll']({'raw':_0x9f0e2[_0xb4b8('0x17')]?_0x9f0e2['options'][_0xb4b8('0x18')]===undefined?!![]:![]:!![],'where':_0x9f0e2[_0xb4b8('0x17')]?_0x9f0e2[_0xb4b8('0x17')][_0xb4b8('0x19')]||null:null,'attributes':_0x9f0e2['options']?_0x9f0e2[_0xb4b8('0x17')][_0xb4b8('0x1a')]||null:null,'limit':_0x9f0e2[_0xb4b8('0x17')]?_0x9f0e2[_0xb4b8('0x17')]['limit']||null:null,'include':_0x9f0e2[_0xb4b8('0x17')]?_0x9f0e2[_0xb4b8('0x17')][_0xb4b8('0x1b')]?_[_0xb4b8('0x1c')](_0x9f0e2[_0xb4b8('0x17')][_0xb4b8('0x1b')],function(_0x137322){return{'model':db[_0x137322[_0xb4b8('0x1d')]],'as':_0x137322['as'],'attributes':_0x137322[_0xb4b8('0x1a')],'include':_0x137322['include']?_[_0xb4b8('0x1c')](_0x137322['include'],function(_0xf8083d){return{'model':db[_0xf8083d[_0xb4b8('0x1d')]],'as':_0xf8083d['as'],'attributes':_0xf8083d['attributes'],'include':_0xf8083d[_0xb4b8('0x1b')]?_['map'](_0xf8083d[_0xb4b8('0x1b')],function(_0x199b11){return{'model':db[_0x199b11[_0xb4b8('0x1d')]],'as':_0x199b11['as'],'attributes':_0x199b11['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4b8('0xc')](function(_0x1bfcd1){logger['info'](_0xb4b8('0x16'),_0x9f0e2);logger[_0xb4b8('0x1e')](_0xb4b8('0x16'),_0x9f0e2,JSON[_0xb4b8('0x11')](_0x1bfcd1));_0x3fbd11(_0x1bfcd1);})[_0xb4b8('0x1f')](function(_0x3362c7){logger[_0xb4b8('0x12')]('GetSalesforceAccount',_0x3362c7[_0xb4b8('0x14')],_0x9f0e2);_0x5d79b5(_0x40026e['error'](0x1f4,_0x3362c7[_0xb4b8('0x14')]));});});};exports[_0xb4b8('0x20')]=function(_0x4e7d21){var _0xa5c2a7=this;return new Promise(function(_0x43d67d,_0x77818e){return db[_0xb4b8('0x21')][_0xb4b8('0x22')]({'raw':_0x4e7d21[_0xb4b8('0x17')]?_0x4e7d21[_0xb4b8('0x17')][_0xb4b8('0x18')]===undefined?!![]:![]:!![],'where':_0x4e7d21[_0xb4b8('0x17')]?_0x4e7d21[_0xb4b8('0x17')][_0xb4b8('0x19')]||null:null,'attributes':_0x4e7d21['options']?_0x4e7d21[_0xb4b8('0x17')]['attributes']||null:null,'include':_0x4e7d21[_0xb4b8('0x17')]?_0x4e7d21['options'][_0xb4b8('0x1b')]?_['map'](_0x4e7d21[_0xb4b8('0x17')][_0xb4b8('0x1b')],function(_0x2db83b){return{'model':db[_0x2db83b[_0xb4b8('0x1d')]],'as':_0x2db83b['as'],'attributes':_0x2db83b[_0xb4b8('0x1a')],'include':_0x2db83b[_0xb4b8('0x1b')]?_[_0xb4b8('0x1c')](_0x2db83b[_0xb4b8('0x1b')],function(_0x570a10){return{'model':db[_0x570a10[_0xb4b8('0x1d')]],'as':_0x570a10['as'],'attributes':_0x570a10[_0xb4b8('0x1a')],'include':_0x570a10[_0xb4b8('0x1b')]?_['map'](_0x570a10[_0xb4b8('0x1b')],function(_0xd72ce2){return{'model':db[_0xd72ce2['model']],'as':_0xd72ce2['as'],'attributes':_0xd72ce2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45d21c){logger[_0xb4b8('0xd')]('ShowSalesforceAccount',_0x4e7d21);logger[_0xb4b8('0x1e')]('ShowSalesforceAccount',_0x4e7d21,JSON[_0xb4b8('0x11')](_0x45d21c));_0x43d67d(_0x45d21c);})[_0xb4b8('0x1f')](function(_0x3adebe){logger[_0xb4b8('0x12')](_0xb4b8('0x20'),_0x3adebe[_0xb4b8('0x14')],_0x4e7d21);_0x77818e(_0xa5c2a7['error'](0x1f4,_0x3adebe[_0xb4b8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 41f999f..b2dabad 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x17e04c,_0x3a5e98){var _0x47eaa0=function(_0x10acf4){while(--_0x10acf4){_0x17e04c['push'](_0x17e04c['shift']());}};_0x47eaa0(++_0x3a5e98);}(_0xadb5,0xad));var _0x5adb=function(_0x4dcc7d,_0x204a75){_0x4dcc7d=_0x4dcc7d-0x0;var _0x3d773a=_0xadb5[_0x4dcc7d];return _0x3d773a;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x108a8b,_0xcee8f3){var _0x58fa0e=function(_0x4c1c51){while(--_0x4c1c51){_0x108a8b['push'](_0x108a8b['shift']());}};_0x58fa0e(++_0xcee8f3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 148abc6..1604504 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 _0xb2d6=['account','contact_lead','nothing','exports','STRING','ENUM','Task','contact','lead','account_contact_lead'];(function(_0x5a23a0,_0x557398){var _0x21e371=function(_0x28a973){while(--_0x28a973){_0x5a23a0['push'](_0x5a23a0['shift']());}};_0x21e371(++_0x557398);}(_0xb2d6,0x19d));var _0x6b2d=function(_0x3de79f,_0x32b799){_0x3de79f=_0x3de79f-0x0;var _0x14ae3d=_0xb2d6[_0x3de79f];return _0x14ae3d;};'use strict';var Sequelize=require('sequelize');module[_0x6b2d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6b2d('0x1')]},'ticketType':{'type':Sequelize[_0x6b2d('0x2')](_0x6b2d('0x3'),'Case'),'defaultValue':_0x6b2d('0x3')},'moduleSearch':{'type':Sequelize[_0x6b2d('0x2')]('contact_lead',_0x6b2d('0x4'),_0x6b2d('0x5'),_0x6b2d('0x6'),_0x6b2d('0x7')),'defaultValue':_0x6b2d('0x8')},'moduleCreate':{'type':Sequelize[_0x6b2d('0x2')](_0x6b2d('0x9'),_0x6b2d('0x4'),_0x6b2d('0x5'),_0x6b2d('0x7')),'defaultValue':_0x6b2d('0x5')},'leadId':{'type':Sequelize[_0x6b2d('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x6b2d('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x6b2d('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x6b2d('0x1')]}}; \ No newline at end of file +var _0xbb03=['sequelize','STRING','ENUM','Task','Case','contact_lead','account','nothing','contact','lead'];(function(_0x2fde15,_0x58ada5){var _0x472868=function(_0x149815){while(--_0x149815){_0x2fde15['push'](_0x2fde15['shift']());}};_0x472868(++_0x58ada5);}(_0xbb03,0x12c));var _0x3bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb03[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3bb0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3bb0('0x1')]},'ticketType':{'type':Sequelize[_0x3bb0('0x2')](_0x3bb0('0x3'),_0x3bb0('0x4')),'defaultValue':_0x3bb0('0x3')},'moduleSearch':{'type':Sequelize[_0x3bb0('0x2')](_0x3bb0('0x5'),'contact','lead','account_contact_lead',_0x3bb0('0x6')),'defaultValue':_0x3bb0('0x5')},'moduleCreate':{'type':Sequelize[_0x3bb0('0x2')](_0x3bb0('0x7'),_0x3bb0('0x8'),_0x3bb0('0x9'),_0x3bb0('0x6')),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x3bb0('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x3bb0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1373f1b..1f40ea7 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 _0x3a29=['getFields','nolimit','findOne','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','find','create','body','update','destroy','SalesforceField'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x3a29,0x101));var _0x93a2=function(_0x156019,_0x4c9ff9){_0x156019=_0x156019-0x0;var _0x3c37f3=_0x3a29[_0x156019];return _0x3c37f3;};'use strict';var emlformat=require(_0x93a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x93a2('0x1'));var rp=require(_0x93a2('0x2'));var moment=require(_0x93a2('0x3'));var BPromise=require(_0x93a2('0x4'));var Mustache=require(_0x93a2('0x5'));var util=require('util');var path=require(_0x93a2('0x6'));var sox=require(_0x93a2('0x7'));var csv=require(_0x93a2('0x8'));var ejs=require(_0x93a2('0x9'));var fs=require('fs');var fs_extra=require(_0x93a2('0xa'));var _=require(_0x93a2('0xb'));var squel=require(_0x93a2('0xc'));var crypto=require(_0x93a2('0xd'));var jsforce=require(_0x93a2('0xe'));var deskjs=require(_0x93a2('0xf'));var toCsv=require(_0x93a2('0x8'));var querystring=require(_0x93a2('0x10'));var Papa=require(_0x93a2('0x11'));var Redis=require('ioredis');var authService=require(_0x93a2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x93a2('0x13'));var hardwareService=require(_0x93a2('0x14'));var logger=require(_0x93a2('0x15'))(_0x93a2('0x16'));var utils=require('../../config/utils');var config=require(_0x93a2('0x17'));var licenseUtil=require(_0x93a2('0x18'));var db=require(_0x93a2('0x19'))['db'];function respondWithStatusCode(_0x48c6c1,_0x44b69a){_0x44b69a=_0x44b69a||0xcc;return function(_0x359db9){if(_0x359db9){return _0x48c6c1[_0x93a2('0x1a')](_0x44b69a);}return _0x48c6c1[_0x93a2('0x1b')](_0x44b69a)['end']();};}function respondWithResult(_0x32f7df,_0x1c7234){_0x1c7234=_0x1c7234||0xc8;return function(_0x27739){if(_0x27739){return _0x32f7df['status'](_0x1c7234)[_0x93a2('0x1c')](_0x27739);}};}function respondWithFilteredResult(_0x225e55,_0x233904){return function(_0x58be03){if(_0x58be03){var _0x5d3244=typeof _0x233904[_0x93a2('0x1d')]===_0x93a2('0x1e')&&typeof _0x233904[_0x93a2('0x1f')]===_0x93a2('0x1e');var _0xa8e69c=_0x58be03['count'];var _0x58b6e9=_0x5d3244?0x0:_0x233904[_0x93a2('0x1d')];var _0x10d8a4=_0x5d3244?_0x58be03[_0x93a2('0x20')]:_0x233904['offset']+_0x233904['limit'];var _0x3e5f10;if(_0x10d8a4>=_0xa8e69c){_0x10d8a4=_0xa8e69c;_0x3e5f10=0xc8;}else{_0x3e5f10=0xce;}_0x225e55[_0x93a2('0x1b')](_0x3e5f10);return _0x225e55[_0x93a2('0x21')](_0x93a2('0x22'),_0x58b6e9+'-'+_0x10d8a4+'/'+_0xa8e69c)['json'](_0x58be03);}return null;};}function patchUpdates(_0x51f884){return function(_0x41a561){try{jsonpatch[_0x93a2('0x23')](_0x41a561,_0x51f884,!![]);}catch(_0x59d496){return BPromise[_0x93a2('0x24')](_0x59d496);}return _0x41a561[_0x93a2('0x25')]();};}function saveUpdates(_0x5b0003,_0x4edd64){return function(_0x20d75c){if(_0x20d75c){return _0x20d75c['update'](_0x5b0003)[_0x93a2('0x26')](function(_0x42e543){return _0x42e543;});}return null;};}function removeEntity(_0x312f51,_0x4e77c2){return function(_0x334ea3){if(_0x334ea3){return _0x334ea3['destroy']()['then'](function(){_0x312f51['status'](0xcc)[_0x93a2('0x27')]();});}};}function handleEntityNotFound(_0x33d319,_0x1a6cf6){return function(_0x44d68c){if(!_0x44d68c){_0x33d319[_0x93a2('0x1a')](0x194);}return _0x44d68c;};}function handleError(_0x2b2017,_0xa14f78){_0xa14f78=_0xa14f78||0x1f4;return function(_0x33cb63){logger[_0x93a2('0x28')](_0x33cb63['stack']);if(_0x33cb63[_0x93a2('0x29')]){delete _0x33cb63[_0x93a2('0x29')];}_0x2b2017['status'](_0xa14f78)[_0x93a2('0x2a')](_0x33cb63);};}exports[_0x93a2('0x2b')]=function(_0x33341e,_0x249972){var _0x267d8a={},_0x10a799={},_0x1dd8e7={'count':0x0,'rows':[]};var _0x5d6db2=_[_0x93a2('0x2c')](db[_0x93a2('0x2d')][_0x93a2('0x2e')],function(_0x40944d){return{'name':_0x40944d[_0x93a2('0x2f')],'type':_0x40944d[_0x93a2('0x30')][_0x93a2('0x31')]};});_0x10a799[_0x93a2('0x32')]=_['map'](_0x5d6db2,_0x93a2('0x29'));_0x10a799[_0x93a2('0x33')]=_['keys'](_0x33341e['query']);_0x10a799[_0x93a2('0x34')]=_[_0x93a2('0x35')](_0x10a799[_0x93a2('0x32')],_0x10a799[_0x93a2('0x33')]);_0x267d8a[_0x93a2('0x36')]=_[_0x93a2('0x35')](_0x10a799['model'],qs[_0x93a2('0x37')](_0x33341e[_0x93a2('0x33')]['fields']));_0x267d8a[_0x93a2('0x36')]=_0x267d8a[_0x93a2('0x36')][_0x93a2('0x38')]?_0x267d8a['attributes']:_0x10a799[_0x93a2('0x32')];if(!_0x33341e[_0x93a2('0x33')][_0x93a2('0x39')]('nolimit')){_0x267d8a[_0x93a2('0x1f')]=qs['limit'](_0x33341e[_0x93a2('0x33')][_0x93a2('0x1f')]);_0x267d8a[_0x93a2('0x1d')]=qs[_0x93a2('0x1d')](_0x33341e[_0x93a2('0x33')]['offset']);}_0x267d8a[_0x93a2('0x3a')]=qs[_0x93a2('0x3b')](_0x33341e['query'][_0x93a2('0x3b')]);_0x267d8a[_0x93a2('0x3c')]=qs[_0x93a2('0x34')](_[_0x93a2('0x3d')](_0x33341e[_0x93a2('0x33')],_0x10a799[_0x93a2('0x34')]),_0x5d6db2);if(_0x33341e[_0x93a2('0x33')][_0x93a2('0x3e')]){_0x267d8a['where']=_[_0x93a2('0x3f')](_0x267d8a[_0x93a2('0x3c')],{'$or':_['map'](_0x5d6db2,function(_0x14668c){if(_0x14668c[_0x93a2('0x30')]!==_0x93a2('0x40')){var _0x601c37={};_0x601c37[_0x14668c[_0x93a2('0x29')]]={'$like':'%'+_0x33341e[_0x93a2('0x33')][_0x93a2('0x3e')]+'%'};return _0x601c37;}})});}_0x267d8a=_['merge']({},_0x267d8a,_0x33341e[_0x93a2('0x41')]);var _0x4ddf3b={'where':_0x267d8a[_0x93a2('0x3c')]};return db[_0x93a2('0x2d')][_0x93a2('0x20')](_0x4ddf3b)[_0x93a2('0x26')](function(_0x1df16d){_0x1dd8e7[_0x93a2('0x20')]=_0x1df16d;if(_0x33341e[_0x93a2('0x33')]['includeAll']){_0x267d8a['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x93a2('0x42')](_0x267d8a);})[_0x93a2('0x26')](function(_0x4c55dc){_0x1dd8e7[_0x93a2('0x43')]=_0x4c55dc;return _0x1dd8e7;})[_0x93a2('0x26')](respondWithFilteredResult(_0x249972,_0x267d8a))[_0x93a2('0x44')](handleError(_0x249972,null));};exports[_0x93a2('0x45')]=function(_0xa96d00,_0xc2cbe0){var _0x230033={'raw':![],'where':{'id':_0xa96d00[_0x93a2('0x46')]['id']}},_0x1b414c={};_0x1b414c[_0x93a2('0x32')]=_[_0x93a2('0x47')](db['SalesforceConfiguration']['rawAttributes']);_0x1b414c[_0x93a2('0x33')]=_[_0x93a2('0x47')](_0xa96d00['query']);_0x1b414c[_0x93a2('0x34')]=_[_0x93a2('0x35')](_0x1b414c[_0x93a2('0x32')],_0x1b414c[_0x93a2('0x33')]);_0x230033[_0x93a2('0x36')]=_[_0x93a2('0x35')](_0x1b414c['model'],qs[_0x93a2('0x37')](_0xa96d00['query'][_0x93a2('0x37')]));_0x230033[_0x93a2('0x36')]=_0x230033[_0x93a2('0x36')][_0x93a2('0x38')]?_0x230033[_0x93a2('0x36')]:_0x1b414c[_0x93a2('0x32')];if(_0xa96d00[_0x93a2('0x33')][_0x93a2('0x48')]){_0x230033['include']=[{'all':!![]}];}_0x230033=_[_0x93a2('0x3f')]({},_0x230033,_0xa96d00[_0x93a2('0x41')]);return db[_0x93a2('0x2d')][_0x93a2('0x49')](_0x230033)[_0x93a2('0x26')](handleEntityNotFound(_0xc2cbe0,null))[_0x93a2('0x26')](respondWithResult(_0xc2cbe0,null))['catch'](handleError(_0xc2cbe0,null));};exports[_0x93a2('0x4a')]=function(_0x322070,_0x80c4e0){return db[_0x93a2('0x2d')][_0x93a2('0x4a')](_0x322070[_0x93a2('0x4b')],{})[_0x93a2('0x26')](respondWithResult(_0x80c4e0,0xc9))[_0x93a2('0x44')](handleError(_0x80c4e0,null));};exports[_0x93a2('0x4c')]=function(_0x494d9d,_0x246f73){if(_0x494d9d[_0x93a2('0x4b')]['id']){delete _0x494d9d['body']['id'];}return db[_0x93a2('0x2d')]['find']({'where':{'id':_0x494d9d['params']['id']}})[_0x93a2('0x26')](handleEntityNotFound(_0x246f73,null))[_0x93a2('0x26')](saveUpdates(_0x494d9d[_0x93a2('0x4b')],null))[_0x93a2('0x26')](respondWithResult(_0x246f73,null))['catch'](handleError(_0x246f73,null));};exports[_0x93a2('0x4d')]=function(_0x1f2c0d,_0x52a911){return db[_0x93a2('0x2d')][_0x93a2('0x49')]({'where':{'id':_0x1f2c0d[_0x93a2('0x46')]['id']}})[_0x93a2('0x26')](handleEntityNotFound(_0x52a911,null))[_0x93a2('0x26')](removeEntity(_0x52a911,null))[_0x93a2('0x44')](handleError(_0x52a911,null));};exports['getFields']=function(_0x430fd6,_0x164f6b,_0x34db35){var _0x431118={};var _0xf50833={};var _0x523a09;var _0x2951f3;return db[_0x93a2('0x2d')]['findOne']({'where':{'id':_0x430fd6[_0x93a2('0x46')]['id']}})[_0x93a2('0x26')](handleEntityNotFound(_0x164f6b,null))[_0x93a2('0x26')](function(_0x344395){if(_0x344395){_0x523a09=_0x344395;_0xf50833[_0x93a2('0x32')]=_[_0x93a2('0x47')](db[_0x93a2('0x4e')]['rawAttributes']);_0xf50833['query']=_[_0x93a2('0x47')](_0x430fd6[_0x93a2('0x33')]);_0xf50833[_0x93a2('0x34')]=_[_0x93a2('0x35')](_0xf50833[_0x93a2('0x32')],_0xf50833[_0x93a2('0x33')]);_0x431118[_0x93a2('0x36')]=_[_0x93a2('0x35')](_0xf50833[_0x93a2('0x32')],qs[_0x93a2('0x37')](_0x430fd6['query']['fields']));_0x431118[_0x93a2('0x36')]=_0x431118['attributes'][_0x93a2('0x38')]?_0x431118[_0x93a2('0x36')]:_0xf50833[_0x93a2('0x32')];_0x431118['order']=qs['sort'](_0x430fd6[_0x93a2('0x33')][_0x93a2('0x3b')]);_0x431118[_0x93a2('0x3c')]=qs['filters'](_[_0x93a2('0x3d')](_0x430fd6[_0x93a2('0x33')],_0xf50833[_0x93a2('0x34')]));if(_0x430fd6[_0x93a2('0x33')][_0x93a2('0x3e')]){_0x431118[_0x93a2('0x3c')]=_[_0x93a2('0x3f')](_0x431118['where'],{'$or':_[_0x93a2('0x2c')](_0x431118['attributes'],function(_0x15d968){var _0x366c7a={};_0x366c7a[_0x15d968]={'$like':'%'+_0x430fd6[_0x93a2('0x33')]['filter']+'%'};return _0x366c7a;})});}_0x431118=_['merge']({},_0x431118,_0x430fd6[_0x93a2('0x41')]);return _0x523a09[_0x93a2('0x4f')](_0x431118);}})['then'](function(_0x5cea3d){if(_0x5cea3d){_0x2951f3=_0x5cea3d[_0x93a2('0x38')];if(!_0x430fd6[_0x93a2('0x33')][_0x93a2('0x39')](_0x93a2('0x50'))){_0x431118[_0x93a2('0x1f')]=qs[_0x93a2('0x1f')](_0x430fd6[_0x93a2('0x33')][_0x93a2('0x1f')]);_0x431118[_0x93a2('0x1d')]=qs[_0x93a2('0x1d')](_0x430fd6[_0x93a2('0x33')][_0x93a2('0x1d')]);}return _0x523a09[_0x93a2('0x4f')](_0x431118);}})[_0x93a2('0x26')](function(_0x1109aa){if(_0x1109aa){return _0x1109aa?{'count':_0x2951f3,'rows':_0x1109aa}:null;}})[_0x93a2('0x26')](respondWithResult(_0x164f6b,null))['catch'](handleError(_0x164f6b,null));};exports['getSubjects']=function(_0xdf865a,_0x102b6a,_0x515e9d){var _0x539c1d={};var _0x101096={};var _0x4b596b;var _0x25ce3d;return db['SalesforceConfiguration'][_0x93a2('0x51')]({'where':{'id':_0xdf865a[_0x93a2('0x46')]['id']}})[_0x93a2('0x26')](handleEntityNotFound(_0x102b6a,null))[_0x93a2('0x26')](function(_0xfc2c8e){if(_0xfc2c8e){_0x4b596b=_0xfc2c8e;_0x101096[_0x93a2('0x32')]=_[_0x93a2('0x47')](db[_0x93a2('0x4e')][_0x93a2('0x2e')]);_0x101096[_0x93a2('0x33')]=_[_0x93a2('0x47')](_0xdf865a['query']);_0x101096['filters']=_[_0x93a2('0x35')](_0x101096[_0x93a2('0x32')],_0x101096[_0x93a2('0x33')]);_0x539c1d[_0x93a2('0x36')]=_[_0x93a2('0x35')](_0x101096[_0x93a2('0x32')],qs[_0x93a2('0x37')](_0xdf865a[_0x93a2('0x33')]['fields']));_0x539c1d[_0x93a2('0x36')]=_0x539c1d[_0x93a2('0x36')][_0x93a2('0x38')]?_0x539c1d[_0x93a2('0x36')]:_0x101096[_0x93a2('0x32')];_0x539c1d[_0x93a2('0x3a')]=qs['sort'](_0xdf865a[_0x93a2('0x33')][_0x93a2('0x3b')]);_0x539c1d['where']=qs[_0x93a2('0x34')](_['pick'](_0xdf865a[_0x93a2('0x33')],_0x101096['filters']));if(_0xdf865a[_0x93a2('0x33')]['filter']){_0x539c1d['where']=_[_0x93a2('0x3f')](_0x539c1d['where'],{'$or':_[_0x93a2('0x2c')](_0x539c1d[_0x93a2('0x36')],function(_0xd519aa){var _0x516a82={};_0x516a82[_0xd519aa]={'$like':'%'+_0xdf865a[_0x93a2('0x33')][_0x93a2('0x3e')]+'%'};return _0x516a82;})});}_0x539c1d=_['merge']({},_0x539c1d,_0xdf865a[_0x93a2('0x41')]);return _0x4b596b['getSubjects'](_0x539c1d);}})[_0x93a2('0x26')](function(_0x205833){if(_0x205833){_0x25ce3d=_0x205833[_0x93a2('0x38')];if(!_0xdf865a[_0x93a2('0x33')][_0x93a2('0x39')](_0x93a2('0x50'))){_0x539c1d[_0x93a2('0x1f')]=qs['limit'](_0xdf865a['query'][_0x93a2('0x1f')]);_0x539c1d[_0x93a2('0x1d')]=qs['offset'](_0xdf865a['query'][_0x93a2('0x1d')]);}return _0x4b596b[_0x93a2('0x52')](_0x539c1d);}})[_0x93a2('0x26')](function(_0x283c00){if(_0x283c00){return _0x283c00?{'count':_0x25ce3d,'rows':_0x283c00}:null;}})[_0x93a2('0x26')](respondWithResult(_0x102b6a,null))[_0x93a2('0x44')](handleError(_0x102b6a,null));};exports[_0x93a2('0x53')]=function(_0x3e7726,_0x179afa,_0x4113cc){var _0x4f44ce={};var _0x2a8120={};var _0x581c89;var _0x4cbf3c;return db[_0x93a2('0x2d')][_0x93a2('0x51')]({'where':{'id':_0x3e7726['params']['id']}})[_0x93a2('0x26')](handleEntityNotFound(_0x179afa,null))[_0x93a2('0x26')](function(_0x42e38e){if(_0x42e38e){_0x581c89=_0x42e38e;_0x2a8120[_0x93a2('0x32')]=_[_0x93a2('0x47')](db[_0x93a2('0x4e')][_0x93a2('0x2e')]);_0x2a8120['query']=_[_0x93a2('0x47')](_0x3e7726[_0x93a2('0x33')]);_0x2a8120['filters']=_[_0x93a2('0x35')](_0x2a8120[_0x93a2('0x32')],_0x2a8120[_0x93a2('0x33')]);_0x4f44ce[_0x93a2('0x36')]=_[_0x93a2('0x35')](_0x2a8120[_0x93a2('0x32')],qs[_0x93a2('0x37')](_0x3e7726[_0x93a2('0x33')][_0x93a2('0x37')]));_0x4f44ce[_0x93a2('0x36')]=_0x4f44ce[_0x93a2('0x36')]['length']?_0x4f44ce['attributes']:_0x2a8120[_0x93a2('0x32')];_0x4f44ce['order']=qs[_0x93a2('0x3b')](_0x3e7726[_0x93a2('0x33')][_0x93a2('0x3b')]);_0x4f44ce['where']=qs[_0x93a2('0x34')](_['pick'](_0x3e7726[_0x93a2('0x33')],_0x2a8120[_0x93a2('0x34')]));if(_0x3e7726[_0x93a2('0x33')][_0x93a2('0x3e')]){_0x4f44ce[_0x93a2('0x3c')]=_['merge'](_0x4f44ce['where'],{'$or':_[_0x93a2('0x2c')](_0x4f44ce['attributes'],function(_0x41c968){var _0x53effe={};_0x53effe[_0x41c968]={'$like':'%'+_0x3e7726[_0x93a2('0x33')]['filter']+'%'};return _0x53effe;})});}_0x4f44ce=_[_0x93a2('0x3f')]({},_0x4f44ce,_0x3e7726[_0x93a2('0x41')]);return _0x581c89[_0x93a2('0x53')](_0x4f44ce);}})[_0x93a2('0x26')](function(_0x20f474){if(_0x20f474){_0x4cbf3c=_0x20f474[_0x93a2('0x38')];if(!_0x3e7726[_0x93a2('0x33')][_0x93a2('0x39')](_0x93a2('0x50'))){_0x4f44ce[_0x93a2('0x1f')]=qs[_0x93a2('0x1f')](_0x3e7726[_0x93a2('0x33')][_0x93a2('0x1f')]);_0x4f44ce[_0x93a2('0x1d')]=qs['offset'](_0x3e7726[_0x93a2('0x33')]['offset']);}return _0x581c89[_0x93a2('0x53')](_0x4f44ce);}})[_0x93a2('0x26')](function(_0x9c9da){if(_0x9c9da){return _0x9c9da?{'count':_0x4cbf3c,'rows':_0x9c9da}:null;}})[_0x93a2('0x26')](respondWithResult(_0x179afa,null))[_0x93a2('0x44')](handleError(_0x179afa,null));}; \ No newline at end of file +var _0xa07f=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','find','create','body','rawAttributes','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf'];(function(_0x2b60a6,_0x57129b){var _0x502c6b=function(_0x3ae745){while(--_0x3ae745){_0x2b60a6['push'](_0x2b60a6['shift']());}};_0x502c6b(++_0x57129b);}(_0xa07f,0xee));var _0xfa07=function(_0x131376,_0x3e7e1e){_0x131376=_0x131376-0x0;var _0x2e00e4=_0xa07f[_0x131376];return _0x2e00e4;};'use strict';var emlformat=require(_0xfa07('0x0'));var rimraf=require(_0xfa07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa07('0x2'));var rp=require(_0xfa07('0x3'));var moment=require(_0xfa07('0x4'));var BPromise=require(_0xfa07('0x5'));var Mustache=require('mustache');var util=require(_0xfa07('0x6'));var path=require(_0xfa07('0x7'));var sox=require(_0xfa07('0x8'));var csv=require(_0xfa07('0x9'));var ejs=require(_0xfa07('0xa'));var fs=require('fs');var fs_extra=require(_0xfa07('0xb'));var _=require('lodash');var squel=require(_0xfa07('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfa07('0xd'));var toCsv=require(_0xfa07('0x9'));var querystring=require('querystring');var Papa=require(_0xfa07('0xe'));var Redis=require('ioredis');var authService=require(_0xfa07('0xf'));var qs=require(_0xfa07('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa07('0x11'));var logger=require(_0xfa07('0x12'))(_0xfa07('0x13'));var utils=require(_0xfa07('0x14'));var config=require(_0xfa07('0x15'));var licenseUtil=require(_0xfa07('0x16'));var db=require(_0xfa07('0x17'))['db'];function respondWithStatusCode(_0x53fcc8,_0x12becb){_0x12becb=_0x12becb||0xcc;return function(_0x2e772d){if(_0x2e772d){return _0x53fcc8[_0xfa07('0x18')](_0x12becb);}return _0x53fcc8['status'](_0x12becb)[_0xfa07('0x19')]();};}function respondWithResult(_0xdd51b2,_0x490551){_0x490551=_0x490551||0xc8;return function(_0x154620){if(_0x154620){return _0xdd51b2[_0xfa07('0x1a')](_0x490551)['json'](_0x154620);}};}function respondWithFilteredResult(_0x26ae4f,_0x4ba143){return function(_0x272f49){if(_0x272f49){var _0x333f7e=typeof _0x4ba143['offset']===_0xfa07('0x1b')&&typeof _0x4ba143[_0xfa07('0x1c')]==='undefined';var _0x578066=_0x272f49[_0xfa07('0x1d')];var _0x52ab98=_0x333f7e?0x0:_0x4ba143[_0xfa07('0x1e')];var _0x1eb2d1=_0x333f7e?_0x272f49[_0xfa07('0x1d')]:_0x4ba143['offset']+_0x4ba143[_0xfa07('0x1c')];var _0x28d5fb;if(_0x1eb2d1>=_0x578066){_0x1eb2d1=_0x578066;_0x28d5fb=0xc8;}else{_0x28d5fb=0xce;}_0x26ae4f[_0xfa07('0x1a')](_0x28d5fb);return _0x26ae4f[_0xfa07('0x1f')](_0xfa07('0x20'),_0x52ab98+'-'+_0x1eb2d1+'/'+_0x578066)[_0xfa07('0x21')](_0x272f49);}return null;};}function patchUpdates(_0x2dd129){return function(_0x19cf29){try{jsonpatch[_0xfa07('0x22')](_0x19cf29,_0x2dd129,!![]);}catch(_0x32da4c){return BPromise[_0xfa07('0x23')](_0x32da4c);}return _0x19cf29[_0xfa07('0x24')]();};}function saveUpdates(_0x75552c,_0x306fe6){return function(_0x3c5075){if(_0x3c5075){return _0x3c5075[_0xfa07('0x25')](_0x75552c)[_0xfa07('0x26')](function(_0xf7e531){return _0xf7e531;});}return null;};}function removeEntity(_0x4823e9,_0x56fcf4){return function(_0x454881){if(_0x454881){return _0x454881['destroy']()['then'](function(){_0x4823e9[_0xfa07('0x1a')](0xcc)[_0xfa07('0x19')]();});}};}function handleEntityNotFound(_0x23d21e,_0x337a07){return function(_0x2fab12){if(!_0x2fab12){_0x23d21e[_0xfa07('0x18')](0x194);}return _0x2fab12;};}function handleError(_0x5e3511,_0x45ba03){_0x45ba03=_0x45ba03||0x1f4;return function(_0x2d81b9){logger[_0xfa07('0x27')](_0x2d81b9[_0xfa07('0x28')]);if(_0x2d81b9[_0xfa07('0x29')]){delete _0x2d81b9['name'];}_0x5e3511[_0xfa07('0x1a')](_0x45ba03)[_0xfa07('0x2a')](_0x2d81b9);};}exports[_0xfa07('0x2b')]=function(_0x2030b9,_0x5b64da){var _0x46b227={},_0x5203fe={},_0xb8d91e={'count':0x0,'rows':[]};var _0x1c6862=_[_0xfa07('0x2c')](db[_0xfa07('0x2d')]['rawAttributes'],function(_0x1cbef4){return{'name':_0x1cbef4[_0xfa07('0x2e')],'type':_0x1cbef4['type'][_0xfa07('0x2f')]};});_0x5203fe[_0xfa07('0x30')]=_[_0xfa07('0x2c')](_0x1c6862,_0xfa07('0x29'));_0x5203fe[_0xfa07('0x31')]=_[_0xfa07('0x32')](_0x2030b9[_0xfa07('0x31')]);_0x5203fe[_0xfa07('0x33')]=_[_0xfa07('0x34')](_0x5203fe[_0xfa07('0x30')],_0x5203fe[_0xfa07('0x31')]);_0x46b227[_0xfa07('0x35')]=_[_0xfa07('0x34')](_0x5203fe['model'],qs[_0xfa07('0x36')](_0x2030b9[_0xfa07('0x31')][_0xfa07('0x36')]));_0x46b227[_0xfa07('0x35')]=_0x46b227[_0xfa07('0x35')]['length']?_0x46b227[_0xfa07('0x35')]:_0x5203fe[_0xfa07('0x30')];if(!_0x2030b9[_0xfa07('0x31')][_0xfa07('0x37')](_0xfa07('0x38'))){_0x46b227['limit']=qs['limit'](_0x2030b9['query'][_0xfa07('0x1c')]);_0x46b227[_0xfa07('0x1e')]=qs[_0xfa07('0x1e')](_0x2030b9[_0xfa07('0x31')][_0xfa07('0x1e')]);}_0x46b227[_0xfa07('0x39')]=qs[_0xfa07('0x3a')](_0x2030b9[_0xfa07('0x31')]['sort']);_0x46b227[_0xfa07('0x3b')]=qs[_0xfa07('0x33')](_[_0xfa07('0x3c')](_0x2030b9[_0xfa07('0x31')],_0x5203fe[_0xfa07('0x33')]),_0x1c6862);if(_0x2030b9[_0xfa07('0x31')][_0xfa07('0x3d')]){_0x46b227[_0xfa07('0x3b')]=_[_0xfa07('0x3e')](_0x46b227['where'],{'$or':_[_0xfa07('0x2c')](_0x1c6862,function(_0x2c4385){if(_0x2c4385['type']!==_0xfa07('0x3f')){var _0x4dffde={};_0x4dffde[_0x2c4385[_0xfa07('0x29')]]={'$like':'%'+_0x2030b9[_0xfa07('0x31')][_0xfa07('0x3d')]+'%'};return _0x4dffde;}})});}_0x46b227=_[_0xfa07('0x3e')]({},_0x46b227,_0x2030b9[_0xfa07('0x40')]);var _0x53d7fe={'where':_0x46b227['where']};return db[_0xfa07('0x2d')][_0xfa07('0x1d')](_0x53d7fe)['then'](function(_0x55af2b){_0xb8d91e[_0xfa07('0x1d')]=_0x55af2b;if(_0x2030b9[_0xfa07('0x31')]['includeAll']){_0x46b227['include']=[{'all':!![]}];}return db[_0xfa07('0x2d')][_0xfa07('0x41')](_0x46b227);})[_0xfa07('0x26')](function(_0x5133cd){_0xb8d91e[_0xfa07('0x42')]=_0x5133cd;return _0xb8d91e;})[_0xfa07('0x26')](respondWithFilteredResult(_0x5b64da,_0x46b227))[_0xfa07('0x43')](handleError(_0x5b64da,null));};exports[_0xfa07('0x44')]=function(_0x552747,_0x4006f5){var _0x17262c={'raw':![],'where':{'id':_0x552747[_0xfa07('0x45')]['id']}},_0x398f02={};_0x398f02[_0xfa07('0x30')]=_[_0xfa07('0x32')](db[_0xfa07('0x2d')]['rawAttributes']);_0x398f02['query']=_[_0xfa07('0x32')](_0x552747['query']);_0x398f02['filters']=_[_0xfa07('0x34')](_0x398f02[_0xfa07('0x30')],_0x398f02['query']);_0x17262c[_0xfa07('0x35')]=_[_0xfa07('0x34')](_0x398f02['model'],qs['fields'](_0x552747[_0xfa07('0x31')][_0xfa07('0x36')]));_0x17262c[_0xfa07('0x35')]=_0x17262c['attributes'][_0xfa07('0x46')]?_0x17262c[_0xfa07('0x35')]:_0x398f02[_0xfa07('0x30')];if(_0x552747[_0xfa07('0x31')]['includeAll']){_0x17262c['include']=[{'all':!![]}];}_0x17262c=_[_0xfa07('0x3e')]({},_0x17262c,_0x552747[_0xfa07('0x40')]);return db[_0xfa07('0x2d')][_0xfa07('0x47')](_0x17262c)[_0xfa07('0x26')](handleEntityNotFound(_0x4006f5,null))[_0xfa07('0x26')](respondWithResult(_0x4006f5,null))['catch'](handleError(_0x4006f5,null));};exports[_0xfa07('0x48')]=function(_0x12f38e,_0x5dd753){return db[_0xfa07('0x2d')][_0xfa07('0x48')](_0x12f38e[_0xfa07('0x49')],{})[_0xfa07('0x26')](respondWithResult(_0x5dd753,0xc9))[_0xfa07('0x43')](handleError(_0x5dd753,null));};exports[_0xfa07('0x25')]=function(_0x1090ec,_0x5d066c){if(_0x1090ec[_0xfa07('0x49')]['id']){delete _0x1090ec[_0xfa07('0x49')]['id'];}return db[_0xfa07('0x2d')][_0xfa07('0x47')]({'where':{'id':_0x1090ec[_0xfa07('0x45')]['id']}})[_0xfa07('0x26')](handleEntityNotFound(_0x5d066c,null))[_0xfa07('0x26')](saveUpdates(_0x1090ec[_0xfa07('0x49')],null))[_0xfa07('0x26')](respondWithResult(_0x5d066c,null))[_0xfa07('0x43')](handleError(_0x5d066c,null));};exports['destroy']=function(_0x64afd9,_0x300e0e){return db[_0xfa07('0x2d')][_0xfa07('0x47')]({'where':{'id':_0x64afd9['params']['id']}})[_0xfa07('0x26')](handleEntityNotFound(_0x300e0e,null))[_0xfa07('0x26')](removeEntity(_0x300e0e,null))[_0xfa07('0x43')](handleError(_0x300e0e,null));};exports['getFields']=function(_0x1656e7,_0x4671f8,_0x12f35a){var _0x2c0969={};var _0xe9a49b={};var _0x198f38;var _0x785eaa;return db[_0xfa07('0x2d')]['findOne']({'where':{'id':_0x1656e7[_0xfa07('0x45')]['id']}})['then'](handleEntityNotFound(_0x4671f8,null))[_0xfa07('0x26')](function(_0x8e0e6d){if(_0x8e0e6d){_0x198f38=_0x8e0e6d;_0xe9a49b['model']=_[_0xfa07('0x32')](db['SalesforceField'][_0xfa07('0x4a')]);_0xe9a49b['query']=_['keys'](_0x1656e7[_0xfa07('0x31')]);_0xe9a49b[_0xfa07('0x33')]=_['intersection'](_0xe9a49b[_0xfa07('0x30')],_0xe9a49b[_0xfa07('0x31')]);_0x2c0969[_0xfa07('0x35')]=_[_0xfa07('0x34')](_0xe9a49b[_0xfa07('0x30')],qs[_0xfa07('0x36')](_0x1656e7['query'][_0xfa07('0x36')]));_0x2c0969[_0xfa07('0x35')]=_0x2c0969[_0xfa07('0x35')][_0xfa07('0x46')]?_0x2c0969[_0xfa07('0x35')]:_0xe9a49b[_0xfa07('0x30')];_0x2c0969[_0xfa07('0x39')]=qs['sort'](_0x1656e7[_0xfa07('0x31')]['sort']);_0x2c0969[_0xfa07('0x3b')]=qs[_0xfa07('0x33')](_[_0xfa07('0x3c')](_0x1656e7[_0xfa07('0x31')],_0xe9a49b[_0xfa07('0x33')]));if(_0x1656e7[_0xfa07('0x31')][_0xfa07('0x3d')]){_0x2c0969[_0xfa07('0x3b')]=_[_0xfa07('0x3e')](_0x2c0969[_0xfa07('0x3b')],{'$or':_[_0xfa07('0x2c')](_0x2c0969['attributes'],function(_0x3085d0){var _0xe40fb6={};_0xe40fb6[_0x3085d0]={'$like':'%'+_0x1656e7[_0xfa07('0x31')]['filter']+'%'};return _0xe40fb6;})});}_0x2c0969=_[_0xfa07('0x3e')]({},_0x2c0969,_0x1656e7['options']);return _0x198f38[_0xfa07('0x4b')](_0x2c0969);}})[_0xfa07('0x26')](function(_0x2cf7cf){if(_0x2cf7cf){_0x785eaa=_0x2cf7cf[_0xfa07('0x46')];if(!_0x1656e7['query'][_0xfa07('0x37')](_0xfa07('0x38'))){_0x2c0969[_0xfa07('0x1c')]=qs['limit'](_0x1656e7[_0xfa07('0x31')][_0xfa07('0x1c')]);_0x2c0969[_0xfa07('0x1e')]=qs[_0xfa07('0x1e')](_0x1656e7[_0xfa07('0x31')]['offset']);}return _0x198f38[_0xfa07('0x4b')](_0x2c0969);}})[_0xfa07('0x26')](function(_0x547e53){if(_0x547e53){return _0x547e53?{'count':_0x785eaa,'rows':_0x547e53}:null;}})[_0xfa07('0x26')](respondWithResult(_0x4671f8,null))[_0xfa07('0x43')](handleError(_0x4671f8,null));};exports['getSubjects']=function(_0x4733ca,_0xd44ae5,_0x1ce127){var _0x1b31cb={};var _0x54f07a={};var _0x53c36c;var _0xc68a5d;return db['SalesforceConfiguration'][_0xfa07('0x4c')]({'where':{'id':_0x4733ca[_0xfa07('0x45')]['id']}})[_0xfa07('0x26')](handleEntityNotFound(_0xd44ae5,null))['then'](function(_0x3d0c5b){if(_0x3d0c5b){_0x53c36c=_0x3d0c5b;_0x54f07a[_0xfa07('0x30')]=_['keys'](db[_0xfa07('0x4d')][_0xfa07('0x4a')]);_0x54f07a[_0xfa07('0x31')]=_[_0xfa07('0x32')](_0x4733ca[_0xfa07('0x31')]);_0x54f07a['filters']=_[_0xfa07('0x34')](_0x54f07a[_0xfa07('0x30')],_0x54f07a[_0xfa07('0x31')]);_0x1b31cb['attributes']=_['intersection'](_0x54f07a[_0xfa07('0x30')],qs[_0xfa07('0x36')](_0x4733ca[_0xfa07('0x31')][_0xfa07('0x36')]));_0x1b31cb['attributes']=_0x1b31cb[_0xfa07('0x35')][_0xfa07('0x46')]?_0x1b31cb[_0xfa07('0x35')]:_0x54f07a[_0xfa07('0x30')];_0x1b31cb[_0xfa07('0x39')]=qs[_0xfa07('0x3a')](_0x4733ca['query'][_0xfa07('0x3a')]);_0x1b31cb['where']=qs[_0xfa07('0x33')](_[_0xfa07('0x3c')](_0x4733ca['query'],_0x54f07a['filters']));if(_0x4733ca[_0xfa07('0x31')]['filter']){_0x1b31cb[_0xfa07('0x3b')]=_[_0xfa07('0x3e')](_0x1b31cb[_0xfa07('0x3b')],{'$or':_[_0xfa07('0x2c')](_0x1b31cb[_0xfa07('0x35')],function(_0x5c844c){var _0x14ca5e={};_0x14ca5e[_0x5c844c]={'$like':'%'+_0x4733ca[_0xfa07('0x31')][_0xfa07('0x3d')]+'%'};return _0x14ca5e;})});}_0x1b31cb=_[_0xfa07('0x3e')]({},_0x1b31cb,_0x4733ca[_0xfa07('0x40')]);return _0x53c36c[_0xfa07('0x4e')](_0x1b31cb);}})[_0xfa07('0x26')](function(_0x29b106){if(_0x29b106){_0xc68a5d=_0x29b106[_0xfa07('0x46')];if(!_0x4733ca['query']['hasOwnProperty']('nolimit')){_0x1b31cb[_0xfa07('0x1c')]=qs[_0xfa07('0x1c')](_0x4733ca[_0xfa07('0x31')][_0xfa07('0x1c')]);_0x1b31cb[_0xfa07('0x1e')]=qs[_0xfa07('0x1e')](_0x4733ca['query'][_0xfa07('0x1e')]);}return _0x53c36c['getSubjects'](_0x1b31cb);}})['then'](function(_0x4c8325){if(_0x4c8325){return _0x4c8325?{'count':_0xc68a5d,'rows':_0x4c8325}:null;}})[_0xfa07('0x26')](respondWithResult(_0xd44ae5,null))[_0xfa07('0x43')](handleError(_0xd44ae5,null));};exports[_0xfa07('0x4f')]=function(_0x377f40,_0x3f0bb0,_0x5158b5){var _0x58b325={};var _0x440c02={};var _0x369bf1;var _0x4d12db;return db[_0xfa07('0x2d')][_0xfa07('0x4c')]({'where':{'id':_0x377f40[_0xfa07('0x45')]['id']}})[_0xfa07('0x26')](handleEntityNotFound(_0x3f0bb0,null))[_0xfa07('0x26')](function(_0x4e755d){if(_0x4e755d){_0x369bf1=_0x4e755d;_0x440c02[_0xfa07('0x30')]=_[_0xfa07('0x32')](db[_0xfa07('0x4d')][_0xfa07('0x4a')]);_0x440c02[_0xfa07('0x31')]=_[_0xfa07('0x32')](_0x377f40[_0xfa07('0x31')]);_0x440c02[_0xfa07('0x33')]=_[_0xfa07('0x34')](_0x440c02[_0xfa07('0x30')],_0x440c02['query']);_0x58b325['attributes']=_['intersection'](_0x440c02[_0xfa07('0x30')],qs[_0xfa07('0x36')](_0x377f40['query']['fields']));_0x58b325['attributes']=_0x58b325[_0xfa07('0x35')]['length']?_0x58b325['attributes']:_0x440c02[_0xfa07('0x30')];_0x58b325[_0xfa07('0x39')]=qs['sort'](_0x377f40[_0xfa07('0x31')]['sort']);_0x58b325[_0xfa07('0x3b')]=qs[_0xfa07('0x33')](_[_0xfa07('0x3c')](_0x377f40[_0xfa07('0x31')],_0x440c02['filters']));if(_0x377f40[_0xfa07('0x31')][_0xfa07('0x3d')]){_0x58b325[_0xfa07('0x3b')]=_[_0xfa07('0x3e')](_0x58b325[_0xfa07('0x3b')],{'$or':_['map'](_0x58b325[_0xfa07('0x35')],function(_0x227a0f){var _0x146867={};_0x146867[_0x227a0f]={'$like':'%'+_0x377f40['query'][_0xfa07('0x3d')]+'%'};return _0x146867;})});}_0x58b325=_[_0xfa07('0x3e')]({},_0x58b325,_0x377f40[_0xfa07('0x40')]);return _0x369bf1[_0xfa07('0x4f')](_0x58b325);}})[_0xfa07('0x26')](function(_0x436f8b){if(_0x436f8b){_0x4d12db=_0x436f8b[_0xfa07('0x46')];if(!_0x377f40[_0xfa07('0x31')][_0xfa07('0x37')](_0xfa07('0x38'))){_0x58b325[_0xfa07('0x1c')]=qs[_0xfa07('0x1c')](_0x377f40['query'][_0xfa07('0x1c')]);_0x58b325[_0xfa07('0x1e')]=qs[_0xfa07('0x1e')](_0x377f40[_0xfa07('0x31')][_0xfa07('0x1e')]);}return _0x369bf1['getDescriptions'](_0x58b325);}})[_0xfa07('0x26')](function(_0x355e98){if(_0x355e98){return _0x355e98?{'count':_0x4d12db,'rows':_0x355e98}:null;}})[_0xfa07('0x26')](respondWithResult(_0x3f0bb0,null))[_0xfa07('0x43')](handleError(_0x3f0bb0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 760d9ce..8d9c652 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 _0x07d7=['define','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x58dbd5,_0x4bce7e){var _0x42a0a=function(_0xf3b11e){while(--_0xf3b11e){_0x58dbd5['push'](_0x58dbd5['shift']());}};_0x42a0a(++_0x4bce7e);}(_0x07d7,0x141));var _0x707d=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x07d7[_0x503306];return _0x44a99d;};'use strict';var _=require(_0x707d('0x0'));var util=require('util');var logger=require(_0x707d('0x1'))('api');var moment=require(_0x707d('0x2'));var BPromise=require(_0x707d('0x3'));var rp=require(_0x707d('0x4'));var fs=require('fs');var path=require(_0x707d('0x5'));var rimraf=require('rimraf');var config=require(_0x707d('0x6'));var attributes=require(_0x707d('0x7'));module[_0x707d('0x8')]=function(_0x242117,_0x146123){return _0x242117[_0x707d('0x9')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x239b=['bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x49b076,_0x4fb74e){var _0xa3609=function(_0x474e71){while(--_0x474e71){_0x49b076['push'](_0x49b076['shift']());}};_0xa3609(++_0x4fb74e);}(_0x239b,0xa3));var _0xb239=function(_0x553955,_0x43dcba){_0x553955=_0x553955-0x0;var _0x33b86b=_0x239b[_0x553955];return _0x33b86b;};'use strict';var _=require(_0xb239('0x0'));var util=require(_0xb239('0x1'));var logger=require(_0xb239('0x2'))(_0xb239('0x3'));var moment=require(_0xb239('0x4'));var BPromise=require(_0xb239('0x5'));var rp=require(_0xb239('0x6'));var fs=require('fs');var path=require(_0xb239('0x7'));var rimraf=require(_0xb239('0x8'));var config=require(_0xb239('0x9'));var attributes=require(_0xb239('0xa'));module['exports']=function(_0x342875,_0x3ed370){return _0x342875[_0xb239('0xb')](_0xb239('0xc'),attributes,{'tableName':_0xb239('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 af05d1d..1d2ff6b 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 _0xd145=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1205c6,_0xf4b282){var _0x40c4d1=function(_0x571cf0){while(--_0x571cf0){_0x1205c6['push'](_0x1205c6['shift']());}};_0x40c4d1(++_0xf4b282);}(_0xd145,0x192));var _0x5d14=function(_0x5322d5,_0x2e4303){_0x5322d5=_0x5322d5-0x0;var _0x4936d7=_0xd145[_0x5322d5];return _0x4936d7;};'use strict';var _=require(_0x5d14('0x0'));var util=require(_0x5d14('0x1'));var moment=require(_0x5d14('0x2'));var BPromise=require(_0x5d14('0x3'));var rs=require(_0x5d14('0x4'));var fs=require('fs');var Redis=require(_0x5d14('0x5'));var db=require(_0x5d14('0x6'))['db'];var utils=require(_0x5d14('0x7'));var logger=require(_0x5d14('0x8'))(_0x5d14('0x9'));var config=require(_0x5d14('0xa'));var jayson=require(_0x5d14('0xb'));var client=jayson['client'][_0x5d14('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a0d97,_0x31ed56,_0x17c3a2){return new BPromise(function(_0x1fe4f1,_0x3fe738){return client['request'](_0x1a0d97,_0x17c3a2)[_0x5d14('0xd')](function(_0x3a0ca4){logger['info'](_0x5d14('0xe'),_0x31ed56,_0x5d14('0xf'));logger[_0x5d14('0x10')](_0x5d14('0x11'),_0x31ed56,_0x5d14('0xf'),JSON[_0x5d14('0x12')](_0x3a0ca4));if(_0x3a0ca4[_0x5d14('0x13')]){if(_0x3a0ca4[_0x5d14('0x13')][_0x5d14('0x14')]===0x1f4){logger[_0x5d14('0x13')](_0x5d14('0xe'),_0x31ed56,_0x3a0ca4[_0x5d14('0x13')][_0x5d14('0x15')]);return _0x3fe738(_0x3a0ca4[_0x5d14('0x13')][_0x5d14('0x15')]);}logger[_0x5d14('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x31ed56,_0x3a0ca4[_0x5d14('0x13')][_0x5d14('0x15')]);return _0x1fe4f1(_0x3a0ca4[_0x5d14('0x13')][_0x5d14('0x15')]);}else{logger[_0x5d14('0x16')](_0x5d14('0xe'),_0x31ed56,_0x5d14('0xf'));_0x1fe4f1(_0x3a0ca4['result']['message']);}})[_0x5d14('0x17')](function(_0x3dcd84){logger[_0x5d14('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x31ed56,_0x3dcd84);_0x3fe738(_0x3dcd84);});});} \ No newline at end of file +var _0x580b=['then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x352e90,_0x441411){var _0x2f5c41=function(_0x98b9e8){while(--_0x98b9e8){_0x352e90['push'](_0x352e90['shift']());}};_0x2f5c41(++_0x441411);}(_0x580b,0xc7));var _0xb580=function(_0x117abc,_0x2b76be){_0x117abc=_0x117abc-0x0;var _0x294a63=_0x580b[_0x117abc];return _0x294a63;};'use strict';var _=require(_0xb580('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb580('0x1'));var rs=require(_0xb580('0x2'));var fs=require('fs');var Redis=require(_0xb580('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb580('0x4'));var logger=require('../../config/logger')(_0xb580('0x5'));var config=require(_0xb580('0x6'));var jayson=require(_0xb580('0x7'));var client=jayson[_0xb580('0x8')][_0xb580('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d918b,_0x5f1086,_0x3820bf){return new BPromise(function(_0x270f1e,_0x411b5b){return client[_0xb580('0xa')](_0x5d918b,_0x3820bf)[_0xb580('0xb')](function(_0x2dea56){logger[_0xb580('0xc')](_0xb580('0xd'),_0x5f1086,'request\x20sent');logger['debug'](_0xb580('0xe'),_0x5f1086,_0xb580('0xf'),JSON['stringify'](_0x2dea56));if(_0x2dea56[_0xb580('0x10')]){if(_0x2dea56['error'][_0xb580('0x11')]===0x1f4){logger['error'](_0xb580('0xd'),_0x5f1086,_0x2dea56['error']['message']);return _0x411b5b(_0x2dea56[_0xb580('0x10')][_0xb580('0x12')]);}logger[_0xb580('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5f1086,_0x2dea56[_0xb580('0x10')][_0xb580('0x12')]);return _0x270f1e(_0x2dea56['error'][_0xb580('0x12')]);}else{logger[_0xb580('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5f1086,'request\x20sent');_0x270f1e(_0x2dea56[_0xb580('0x13')][_0xb580('0x12')]);}})[_0xb580('0x14')](function(_0x1c3e83){logger[_0xb580('0x10')](_0xb580('0xd'),_0x5f1086,_0x1c3e83);_0x411b5b(_0x1c3e83);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index b7cb694..a63e28c 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 _0x9115=['get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x4208a4,_0x50a855){var _0x2200c4=function(_0x1e8226){while(--_0x1e8226){_0x4208a4['push'](_0x4208a4['shift']());}};_0x2200c4(++_0x50a855);}(_0x9115,0x8f));var _0x5911=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x9115[_0x2112d4];return _0x434972;};'use strict';var multer=require('multer');var util=require(_0x5911('0x0'));var path=require(_0x5911('0x1'));var timeout=require(_0x5911('0x2'));var express=require(_0x5911('0x3'));var router=express['Router']();var fs_extra=require(_0x5911('0x4'));var auth=require(_0x5911('0x5'));var interaction=require(_0x5911('0x6'));var config=require(_0x5911('0x7'));var controller=require(_0x5911('0x8'));router[_0x5911('0x9')]('/',auth[_0x5911('0xa')](),controller[_0x5911('0xb')]);router[_0x5911('0x9')](_0x5911('0xc'),auth['isAuthenticated'](),controller[_0x5911('0xd')]);router[_0x5911('0xe')]('/',auth['isAuthenticated'](),controller[_0x5911('0xf')]);router[_0x5911('0x10')](_0x5911('0xc'),auth[_0x5911('0xa')](),controller['update']);router[_0x5911('0x11')](_0x5911('0xc'),auth[_0x5911('0xa')](),controller['destroy']);module[_0x5911('0x12')]=router; \ No newline at end of file +var _0x6162=['index','/:id','show','post','create','put','update','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x15ad3f,_0x1d6280){var _0xfb1d10=function(_0x2730f7){while(--_0x2730f7){_0x15ad3f['push'](_0x15ad3f['shift']());}};_0xfb1d10(++_0x1d6280);}(_0x6162,0xa2));var _0x2616=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6162[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2616('0x0'));var timeout=require('connect-timeout');var express=require(_0x2616('0x1'));var router=express[_0x2616('0x2')]();var fs_extra=require(_0x2616('0x3'));var auth=require(_0x2616('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2616('0x5'));router[_0x2616('0x6')]('/',auth[_0x2616('0x7')](),controller[_0x2616('0x8')]);router[_0x2616('0x6')](_0x2616('0x9'),auth[_0x2616('0x7')](),controller[_0x2616('0xa')]);router[_0x2616('0xb')]('/',auth['isAuthenticated'](),controller[_0x2616('0xc')]);router[_0x2616('0xd')](_0x2616('0x9'),auth[_0x2616('0x7')](),controller[_0x2616('0xe')]);router[_0x2616('0xf')](_0x2616('0x9'),auth['isAuthenticated'](),controller[_0x2616('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8ce4bf0..3810b19 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 _0xf0b5=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','sequelize'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0xf0b5,0x1dc));var _0x5f0b=function(_0x502cb0,_0x36b7cb){_0x502cb0=_0x502cb0-0x0;var _0x29ce44=_0xf0b5[_0x502cb0];return _0x29ce44;};'use strict';var Sequelize=require(_0x5f0b('0x0'));module[_0x5f0b('0x1')]={'type':{'type':Sequelize[_0x5f0b('0x2')](_0x5f0b('0x3'),_0x5f0b('0x4'),'customVariable',_0x5f0b('0x5'),_0x5f0b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5f0b('0x7')]},'keyType':{'type':Sequelize[_0x5f0b('0x2')](_0x5f0b('0x3'),_0x5f0b('0x4'),_0x5f0b('0x8'))},'keyContent':{'type':Sequelize[_0x5f0b('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x598a=['ENUM','customVariable','string','STRING','variable','sequelize','exports'];(function(_0x2c78ba,_0x2b15b8){var _0x1e10e6=function(_0x58c247){while(--_0x58c247){_0x2c78ba['push'](_0x2c78ba['shift']());}};_0x1e10e6(++_0x2b15b8);}(_0x598a,0x7c));var _0xa598=function(_0x5d4910,_0x91dbc4){_0x5d4910=_0x5d4910-0x0;var _0x4ab71b=_0x598a[_0x5d4910];return _0x4ab71b;};'use strict';var Sequelize=require(_0xa598('0x0'));module[_0xa598('0x1')]={'type':{'type':Sequelize[_0xa598('0x2')]('string','variable',_0xa598('0x3'),'keyValue','picklist'),'defaultValue':_0xa598('0x4')},'content':{'type':Sequelize[_0xa598('0x5')]},'key':{'type':Sequelize[_0xa598('0x5')]},'keyType':{'type':Sequelize[_0xa598('0x2')]('string',_0xa598('0x6'),_0xa598('0x3'))},'keyContent':{'type':Sequelize[_0xa598('0x5')]},'idField':{'type':Sequelize[_0xa598('0x5')]},'variableName':{'type':Sequelize[_0xa598('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index be4deb9..32d3029 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 _0x39bc=['includeAll','options','find','catch','create','body','destroy','rimraf','fast-json-patch','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','error','stack','name','index','SalesforceField','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','include','findAll','rows','show','params'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x39bc,0x151));var _0xc39b=function(_0xf5061,_0x57ce8d){_0xf5061=_0xf5061-0x0;var _0x12b466=_0x39bc[_0xf5061];return _0x12b466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc39b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc39b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc39b('0x2'));var path=require(_0xc39b('0x3'));var sox=require('sox');var csv=require(_0xc39b('0x4'));var ejs=require(_0xc39b('0x5'));var fs=require('fs');var fs_extra=require(_0xc39b('0x6'));var _=require('lodash');var squel=require(_0xc39b('0x7'));var crypto=require(_0xc39b('0x8'));var jsforce=require(_0xc39b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc39b('0x4'));var querystring=require('querystring');var Papa=require(_0xc39b('0xa'));var Redis=require('ioredis');var authService=require(_0xc39b('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xc39b('0xc'));var hardwareService=require(_0xc39b('0xd'));var logger=require(_0xc39b('0xe'))(_0xc39b('0xf'));var utils=require(_0xc39b('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xc39b('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d87d8,_0x56b017){_0x56b017=_0x56b017||0xcc;return function(_0x4c7397){if(_0x4c7397){return _0x5d87d8['sendStatus'](_0x56b017);}return _0x5d87d8['status'](_0x56b017)[_0xc39b('0x12')]();};}function respondWithResult(_0x16faf6,_0x359542){_0x359542=_0x359542||0xc8;return function(_0x53581d){if(_0x53581d){return _0x16faf6['status'](_0x359542)[_0xc39b('0x13')](_0x53581d);}};}function respondWithFilteredResult(_0x25c49b,_0x11ad49){return function(_0x3645bc){if(_0x3645bc){var _0x5a52bc=typeof _0x11ad49[_0xc39b('0x14')]===_0xc39b('0x15')&&typeof _0x11ad49[_0xc39b('0x16')]==='undefined';var _0x397a13=_0x3645bc[_0xc39b('0x17')];var _0x33adff=_0x5a52bc?0x0:_0x11ad49[_0xc39b('0x14')];var _0x2ff7d2=_0x5a52bc?_0x3645bc[_0xc39b('0x17')]:_0x11ad49[_0xc39b('0x14')]+_0x11ad49[_0xc39b('0x16')];var _0x165b5e;if(_0x2ff7d2>=_0x397a13){_0x2ff7d2=_0x397a13;_0x165b5e=0xc8;}else{_0x165b5e=0xce;}_0x25c49b[_0xc39b('0x18')](_0x165b5e);return _0x25c49b[_0xc39b('0x19')]('Content-Range',_0x33adff+'-'+_0x2ff7d2+'/'+_0x397a13)[_0xc39b('0x13')](_0x3645bc);}return null;};}function patchUpdates(_0x2ade08){return function(_0x5687d4){try{jsonpatch['apply'](_0x5687d4,_0x2ade08,!![]);}catch(_0x1055dd){return BPromise[_0xc39b('0x1a')](_0x1055dd);}return _0x5687d4[_0xc39b('0x1b')]();};}function saveUpdates(_0x418e93,_0xe6f515){return function(_0x56fd5c){if(_0x56fd5c){return _0x56fd5c[_0xc39b('0x1c')](_0x418e93)[_0xc39b('0x1d')](function(_0x44fc2c){return _0x44fc2c;});}return null;};}function removeEntity(_0x59f1b3,_0x2feb55){return function(_0x1bdbca){if(_0x1bdbca){return _0x1bdbca['destroy']()[_0xc39b('0x1d')](function(){_0x59f1b3[_0xc39b('0x18')](0xcc)[_0xc39b('0x12')]();});}};}function handleEntityNotFound(_0x51f372,_0x337d17){return function(_0x13c553){if(!_0x13c553){_0x51f372['sendStatus'](0x194);}return _0x13c553;};}function handleError(_0x566f3c,_0x46e55f){_0x46e55f=_0x46e55f||0x1f4;return function(_0x1dcce9){logger[_0xc39b('0x1e')](_0x1dcce9[_0xc39b('0x1f')]);if(_0x1dcce9['name']){delete _0x1dcce9[_0xc39b('0x20')];}_0x566f3c[_0xc39b('0x18')](_0x46e55f)['send'](_0x1dcce9);};}exports[_0xc39b('0x21')]=function(_0x531d33,_0x261ccb){var _0x347485={},_0x4524d8={},_0x1806ce={'count':0x0,'rows':[]};var _0x99596a=_['map'](db[_0xc39b('0x22')][_0xc39b('0x23')],function(_0x57dfd6){return{'name':_0x57dfd6['fieldName'],'type':_0x57dfd6[_0xc39b('0x24')][_0xc39b('0x25')]};});_0x4524d8[_0xc39b('0x26')]=_[_0xc39b('0x27')](_0x99596a,_0xc39b('0x20'));_0x4524d8['query']=_[_0xc39b('0x28')](_0x531d33[_0xc39b('0x29')]);_0x4524d8[_0xc39b('0x2a')]=_[_0xc39b('0x2b')](_0x4524d8[_0xc39b('0x26')],_0x4524d8[_0xc39b('0x29')]);_0x347485['attributes']=_[_0xc39b('0x2b')](_0x4524d8['model'],qs[_0xc39b('0x2c')](_0x531d33['query']['fields']));_0x347485['attributes']=_0x347485[_0xc39b('0x2d')][_0xc39b('0x2e')]?_0x347485['attributes']:_0x4524d8[_0xc39b('0x26')];if(!_0x531d33['query']['hasOwnProperty'](_0xc39b('0x2f'))){_0x347485[_0xc39b('0x16')]=qs[_0xc39b('0x16')](_0x531d33['query'][_0xc39b('0x16')]);_0x347485[_0xc39b('0x14')]=qs[_0xc39b('0x14')](_0x531d33[_0xc39b('0x29')][_0xc39b('0x14')]);}_0x347485[_0xc39b('0x30')]=qs['sort'](_0x531d33['query'][_0xc39b('0x31')]);_0x347485['where']=qs[_0xc39b('0x2a')](_['pick'](_0x531d33[_0xc39b('0x29')],_0x4524d8[_0xc39b('0x2a')]),_0x99596a);if(_0x531d33[_0xc39b('0x29')][_0xc39b('0x32')]){_0x347485['where']=_[_0xc39b('0x33')](_0x347485[_0xc39b('0x34')],{'$or':_['map'](_0x99596a,function(_0x485494){if(_0x485494['type']!==_0xc39b('0x35')){var _0x331066={};_0x331066[_0x485494[_0xc39b('0x20')]]={'$like':'%'+_0x531d33['query']['filter']+'%'};return _0x331066;}})});}_0x347485=_['merge']({},_0x347485,_0x531d33['options']);var _0x118000={'where':_0x347485[_0xc39b('0x34')]};return db[_0xc39b('0x22')][_0xc39b('0x17')](_0x118000)['then'](function(_0x579d6b){_0x1806ce['count']=_0x579d6b;if(_0x531d33[_0xc39b('0x29')]['includeAll']){_0x347485[_0xc39b('0x36')]=[{'all':!![]}];}return db[_0xc39b('0x22')][_0xc39b('0x37')](_0x347485);})[_0xc39b('0x1d')](function(_0x5b6242){_0x1806ce[_0xc39b('0x38')]=_0x5b6242;return _0x1806ce;})['then'](respondWithFilteredResult(_0x261ccb,_0x347485))['catch'](handleError(_0x261ccb,null));};exports[_0xc39b('0x39')]=function(_0x5e5d18,_0x43c724){var _0x2740ca={'raw':!![],'where':{'id':_0x5e5d18[_0xc39b('0x3a')]['id']}},_0x5dfa55={};_0x5dfa55['model']=_[_0xc39b('0x28')](db[_0xc39b('0x22')][_0xc39b('0x23')]);_0x5dfa55['query']=_['keys'](_0x5e5d18['query']);_0x5dfa55[_0xc39b('0x2a')]=_[_0xc39b('0x2b')](_0x5dfa55['model'],_0x5dfa55[_0xc39b('0x29')]);_0x2740ca[_0xc39b('0x2d')]=_[_0xc39b('0x2b')](_0x5dfa55['model'],qs[_0xc39b('0x2c')](_0x5e5d18[_0xc39b('0x29')][_0xc39b('0x2c')]));_0x2740ca[_0xc39b('0x2d')]=_0x2740ca[_0xc39b('0x2d')]['length']?_0x2740ca[_0xc39b('0x2d')]:_0x5dfa55['model'];if(_0x5e5d18[_0xc39b('0x29')][_0xc39b('0x3b')]){_0x2740ca[_0xc39b('0x36')]=[{'all':!![]}];}_0x2740ca=_[_0xc39b('0x33')]({},_0x2740ca,_0x5e5d18[_0xc39b('0x3c')]);return db[_0xc39b('0x22')][_0xc39b('0x3d')](_0x2740ca)[_0xc39b('0x1d')](handleEntityNotFound(_0x43c724,null))[_0xc39b('0x1d')](respondWithResult(_0x43c724,null))[_0xc39b('0x3e')](handleError(_0x43c724,null));};exports['create']=function(_0x4dccc8,_0x3c309a){return db[_0xc39b('0x22')][_0xc39b('0x3f')](_0x4dccc8[_0xc39b('0x40')],{})[_0xc39b('0x1d')](respondWithResult(_0x3c309a,0xc9))[_0xc39b('0x3e')](handleError(_0x3c309a,null));};exports[_0xc39b('0x1c')]=function(_0x53b274,_0x474f71){if(_0x53b274['body']['id']){delete _0x53b274['body']['id'];}return db[_0xc39b('0x22')]['find']({'where':{'id':_0x53b274[_0xc39b('0x3a')]['id']}})['then'](handleEntityNotFound(_0x474f71,null))[_0xc39b('0x1d')](saveUpdates(_0x53b274[_0xc39b('0x40')],null))[_0xc39b('0x1d')](respondWithResult(_0x474f71,null))[_0xc39b('0x3e')](handleError(_0x474f71,null));};exports[_0xc39b('0x41')]=function(_0x4d9ffe,_0x1f85c4){return db[_0xc39b('0x22')]['find']({'where':{'id':_0x4d9ffe[_0xc39b('0x3a')]['id']}})[_0xc39b('0x1d')](handleEntityNotFound(_0x1f85c4,null))[_0xc39b('0x1d')](removeEntity(_0x1f85c4,null))[_0xc39b('0x3e')](handleError(_0x1f85c4,null));}; \ No newline at end of file +var _0x7afa=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','stack','name','send','map','SalesforceField','rawAttributes','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','intersection','include','create','body','update','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis'];(function(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0x7afa,0xfc));var _0xa7af=function(_0xb364d3,_0x5e9439){_0xb364d3=_0xb364d3-0x0;var _0x37f4b1=_0x7afa[_0xb364d3];return _0x37f4b1;};'use strict';var emlformat=require(_0xa7af('0x0'));var rimraf=require(_0xa7af('0x1'));var zipdir=require(_0xa7af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7af('0x3'));var moment=require(_0xa7af('0x4'));var BPromise=require(_0xa7af('0x5'));var Mustache=require(_0xa7af('0x6'));var util=require(_0xa7af('0x7'));var path=require('path');var sox=require(_0xa7af('0x8'));var csv=require(_0xa7af('0x9'));var ejs=require(_0xa7af('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7af('0xb'));var squel=require(_0xa7af('0xc'));var crypto=require(_0xa7af('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa7af('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa7af('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa7af('0x10'));var hardwareService=require(_0xa7af('0x11'));var logger=require('../../config/logger')(_0xa7af('0x12'));var utils=require(_0xa7af('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa7af('0x14'))['db'];function respondWithStatusCode(_0x18872a,_0x27a1a4){_0x27a1a4=_0x27a1a4||0xcc;return function(_0x42879a){if(_0x42879a){return _0x18872a[_0xa7af('0x15')](_0x27a1a4);}return _0x18872a[_0xa7af('0x16')](_0x27a1a4)['end']();};}function respondWithResult(_0x41f893,_0x5f30a1){_0x5f30a1=_0x5f30a1||0xc8;return function(_0x186e36){if(_0x186e36){return _0x41f893[_0xa7af('0x16')](_0x5f30a1)[_0xa7af('0x17')](_0x186e36);}};}function respondWithFilteredResult(_0x5e1f27,_0x4e5943){return function(_0x28e7d0){if(_0x28e7d0){var _0x7c4546=typeof _0x4e5943[_0xa7af('0x18')]===_0xa7af('0x19')&&typeof _0x4e5943[_0xa7af('0x1a')]===_0xa7af('0x19');var _0x18e362=_0x28e7d0[_0xa7af('0x1b')];var _0x1c08c6=_0x7c4546?0x0:_0x4e5943['offset'];var _0xee932b=_0x7c4546?_0x28e7d0['count']:_0x4e5943[_0xa7af('0x18')]+_0x4e5943[_0xa7af('0x1a')];var _0x4f1f09;if(_0xee932b>=_0x18e362){_0xee932b=_0x18e362;_0x4f1f09=0xc8;}else{_0x4f1f09=0xce;}_0x5e1f27[_0xa7af('0x16')](_0x4f1f09);return _0x5e1f27[_0xa7af('0x1c')]('Content-Range',_0x1c08c6+'-'+_0xee932b+'/'+_0x18e362)[_0xa7af('0x17')](_0x28e7d0);}return null;};}function patchUpdates(_0x417b1e){return function(_0x45bb79){try{jsonpatch['apply'](_0x45bb79,_0x417b1e,!![]);}catch(_0x52f7e4){return BPromise[_0xa7af('0x1d')](_0x52f7e4);}return _0x45bb79['save']();};}function saveUpdates(_0x86341e,_0x5e0c23){return function(_0x4c9009){if(_0x4c9009){return _0x4c9009['update'](_0x86341e)[_0xa7af('0x1e')](function(_0x15fb32){return _0x15fb32;});}return null;};}function removeEntity(_0x48750e,_0x1bcbc4){return function(_0x382b0a){if(_0x382b0a){return _0x382b0a['destroy']()[_0xa7af('0x1e')](function(){_0x48750e[_0xa7af('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27a9f3,_0x4e784b){return function(_0x56f9ea){if(!_0x56f9ea){_0x27a9f3[_0xa7af('0x15')](0x194);}return _0x56f9ea;};}function handleError(_0x4003aa,_0x28c475){_0x28c475=_0x28c475||0x1f4;return function(_0x5a2f8f){logger['error'](_0x5a2f8f[_0xa7af('0x1f')]);if(_0x5a2f8f[_0xa7af('0x20')]){delete _0x5a2f8f[_0xa7af('0x20')];}_0x4003aa[_0xa7af('0x16')](_0x28c475)[_0xa7af('0x21')](_0x5a2f8f);};}exports['index']=function(_0x10971e,_0x497487){var _0x6ae078={},_0x55bfa5={},_0x199ab0={'count':0x0,'rows':[]};var _0x2bc193=_[_0xa7af('0x22')](db[_0xa7af('0x23')][_0xa7af('0x24')],function(_0xb946bb){return{'name':_0xb946bb['fieldName'],'type':_0xb946bb[_0xa7af('0x25')][_0xa7af('0x26')]};});_0x55bfa5['model']=_['map'](_0x2bc193,_0xa7af('0x20'));_0x55bfa5[_0xa7af('0x27')]=_['keys'](_0x10971e[_0xa7af('0x27')]);_0x55bfa5[_0xa7af('0x28')]=_['intersection'](_0x55bfa5[_0xa7af('0x29')],_0x55bfa5[_0xa7af('0x27')]);_0x6ae078['attributes']=_['intersection'](_0x55bfa5['model'],qs[_0xa7af('0x2a')](_0x10971e[_0xa7af('0x27')][_0xa7af('0x2a')]));_0x6ae078[_0xa7af('0x2b')]=_0x6ae078[_0xa7af('0x2b')][_0xa7af('0x2c')]?_0x6ae078[_0xa7af('0x2b')]:_0x55bfa5[_0xa7af('0x29')];if(!_0x10971e[_0xa7af('0x27')][_0xa7af('0x2d')]('nolimit')){_0x6ae078['limit']=qs['limit'](_0x10971e[_0xa7af('0x27')][_0xa7af('0x1a')]);_0x6ae078[_0xa7af('0x18')]=qs['offset'](_0x10971e[_0xa7af('0x27')]['offset']);}_0x6ae078[_0xa7af('0x2e')]=qs[_0xa7af('0x2f')](_0x10971e[_0xa7af('0x27')][_0xa7af('0x2f')]);_0x6ae078['where']=qs[_0xa7af('0x28')](_[_0xa7af('0x30')](_0x10971e[_0xa7af('0x27')],_0x55bfa5['filters']),_0x2bc193);if(_0x10971e['query'][_0xa7af('0x31')]){_0x6ae078[_0xa7af('0x32')]=_[_0xa7af('0x33')](_0x6ae078[_0xa7af('0x32')],{'$or':_['map'](_0x2bc193,function(_0x330be2){if(_0x330be2[_0xa7af('0x25')]!==_0xa7af('0x34')){var _0x153577={};_0x153577[_0x330be2['name']]={'$like':'%'+_0x10971e['query'][_0xa7af('0x31')]+'%'};return _0x153577;}})});}_0x6ae078=_[_0xa7af('0x33')]({},_0x6ae078,_0x10971e[_0xa7af('0x35')]);var _0x52c946={'where':_0x6ae078[_0xa7af('0x32')]};return db[_0xa7af('0x23')][_0xa7af('0x1b')](_0x52c946)['then'](function(_0x57b075){_0x199ab0[_0xa7af('0x1b')]=_0x57b075;if(_0x10971e[_0xa7af('0x27')]['includeAll']){_0x6ae078['include']=[{'all':!![]}];}return db['SalesforceField'][_0xa7af('0x36')](_0x6ae078);})['then'](function(_0x4f9a27){_0x199ab0[_0xa7af('0x37')]=_0x4f9a27;return _0x199ab0;})[_0xa7af('0x1e')](respondWithFilteredResult(_0x497487,_0x6ae078))[_0xa7af('0x38')](handleError(_0x497487,null));};exports[_0xa7af('0x39')]=function(_0x28bf25,_0x477a04){var _0x443920={'raw':!![],'where':{'id':_0x28bf25[_0xa7af('0x3a')]['id']}},_0x403139={};_0x403139[_0xa7af('0x29')]=_[_0xa7af('0x3b')](db[_0xa7af('0x23')][_0xa7af('0x24')]);_0x403139[_0xa7af('0x27')]=_[_0xa7af('0x3b')](_0x28bf25[_0xa7af('0x27')]);_0x403139[_0xa7af('0x28')]=_[_0xa7af('0x3c')](_0x403139['model'],_0x403139[_0xa7af('0x27')]);_0x443920[_0xa7af('0x2b')]=_[_0xa7af('0x3c')](_0x403139[_0xa7af('0x29')],qs[_0xa7af('0x2a')](_0x28bf25['query']['fields']));_0x443920[_0xa7af('0x2b')]=_0x443920['attributes'][_0xa7af('0x2c')]?_0x443920[_0xa7af('0x2b')]:_0x403139[_0xa7af('0x29')];if(_0x28bf25[_0xa7af('0x27')]['includeAll']){_0x443920[_0xa7af('0x3d')]=[{'all':!![]}];}_0x443920=_[_0xa7af('0x33')]({},_0x443920,_0x28bf25[_0xa7af('0x35')]);return db[_0xa7af('0x23')]['find'](_0x443920)['then'](handleEntityNotFound(_0x477a04,null))[_0xa7af('0x1e')](respondWithResult(_0x477a04,null))['catch'](handleError(_0x477a04,null));};exports[_0xa7af('0x3e')]=function(_0x3a19f4,_0x20339e){return db['SalesforceField'][_0xa7af('0x3e')](_0x3a19f4[_0xa7af('0x3f')],{})['then'](respondWithResult(_0x20339e,0xc9))['catch'](handleError(_0x20339e,null));};exports[_0xa7af('0x40')]=function(_0x530fb1,_0xaae32f){if(_0x530fb1[_0xa7af('0x3f')]['id']){delete _0x530fb1[_0xa7af('0x3f')]['id'];}return db[_0xa7af('0x23')][_0xa7af('0x41')]({'where':{'id':_0x530fb1[_0xa7af('0x3a')]['id']}})[_0xa7af('0x1e')](handleEntityNotFound(_0xaae32f,null))[_0xa7af('0x1e')](saveUpdates(_0x530fb1[_0xa7af('0x3f')],null))[_0xa7af('0x1e')](respondWithResult(_0xaae32f,null))['catch'](handleError(_0xaae32f,null));};exports[_0xa7af('0x42')]=function(_0x3eeca2,_0x5a1a8d){return db[_0xa7af('0x23')][_0xa7af('0x41')]({'where':{'id':_0x3eeca2[_0xa7af('0x3a')]['id']}})[_0xa7af('0x1e')](handleEntityNotFound(_0x5a1a8d,null))[_0xa7af('0x1e')](removeEntity(_0x5a1a8d,null))[_0xa7af('0x38')](handleError(_0x5a1a8d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e4e9515..3713c09 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 _0x9be9=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x54dd2c,_0x71be92){var _0x54524d=function(_0x4df7f2){while(--_0x4df7f2){_0x54dd2c['push'](_0x54dd2c['shift']());}};_0x54524d(++_0x71be92);}(_0x9be9,0x17a));var _0x99be=function(_0xc51422,_0x4261b3){_0xc51422=_0xc51422-0x0;var _0x3352c9=_0x9be9[_0xc51422];return _0x3352c9;};'use strict';var _=require(_0x99be('0x0'));var util=require(_0x99be('0x1'));var logger=require(_0x99be('0x2'))(_0x99be('0x3'));var moment=require(_0x99be('0x4'));var BPromise=require(_0x99be('0x5'));var rp=require(_0x99be('0x6'));var fs=require('fs');var path=require(_0x99be('0x7'));var rimraf=require(_0x99be('0x8'));var config=require(_0x99be('0x9'));var attributes=require(_0x99be('0xa'));module['exports']=function(_0x35c9bc,_0x20a9a9){return _0x35c9bc[_0x99be('0xb')](_0x99be('0xc'),attributes,{'tableName':_0x99be('0xd'),'paranoid':![],'indexes':[{'name':_0x99be('0xe'),'fields':[_0x99be('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7529=['int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','SalesforceField'];(function(_0xfa3b3c,_0x492cb4){var _0x509c5d=function(_0xd1dc3b){while(--_0xd1dc3b){_0xfa3b3c['push'](_0xfa3b3c['shift']());}};_0x509c5d(++_0x492cb4);}(_0x7529,0x1f3));var _0x9752=function(_0x377494,_0x115a79){_0x377494=_0x377494-0x0;var _0x121829=_0x7529[_0x377494];return _0x121829;};'use strict';var _=require(_0x9752('0x0'));var util=require(_0x9752('0x1'));var logger=require(_0x9752('0x2'))(_0x9752('0x3'));var moment=require('moment');var BPromise=require(_0x9752('0x4'));var rp=require(_0x9752('0x5'));var fs=require('fs');var path=require(_0x9752('0x6'));var rimraf=require('rimraf');var config=require(_0x9752('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x9752('0x8')]=function(_0x523dbb,_0x1fad1e){return _0x523dbb[_0x9752('0x9')](_0x9752('0xa'),attributes,{'tableName':_0x9752('0xb'),'paranoid':![],'indexes':[{'name':_0x9752('0xc'),'fields':[_0x9752('0xd'),_0x9752('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 d56ced5..aa76924 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 _0x348f=['http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0x5a4bac,_0x1b133e){var _0x1e8b20=function(_0x576ecc){while(--_0x576ecc){_0x5a4bac['push'](_0x5a4bac['shift']());}};_0x1e8b20(++_0x1b133e);}(_0x348f,0x174));var _0xf348=function(_0x128c12,_0x23968d){_0x128c12=_0x128c12-0x0;var _0x2f7dbf=_0x348f[_0x128c12];return _0x2f7dbf;};'use strict';var _=require('lodash');var util=require(_0xf348('0x0'));var moment=require(_0xf348('0x1'));var BPromise=require(_0xf348('0x2'));var rs=require(_0xf348('0x3'));var fs=require('fs');var Redis=require(_0xf348('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf348('0x5'))(_0xf348('0x6'));var config=require('../../config/environment');var jayson=require(_0xf348('0x7'));var client=jayson['client'][_0xf348('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49bcb9,_0x3d2335,_0x23a1ae){return new BPromise(function(_0x3ead85,_0x109ace){return client[_0xf348('0x9')](_0x49bcb9,_0x23a1ae)['then'](function(_0x128311){logger[_0xf348('0xa')](_0xf348('0xb'),_0x3d2335,_0xf348('0xc'));logger['debug'](_0xf348('0xd'),_0x3d2335,_0xf348('0xc'),JSON[_0xf348('0xe')](_0x128311));if(_0x128311[_0xf348('0xf')]){if(_0x128311[_0xf348('0xf')][_0xf348('0x10')]===0x1f4){logger[_0xf348('0xf')](_0xf348('0xb'),_0x3d2335,_0x128311[_0xf348('0xf')]['message']);return _0x109ace(_0x128311[_0xf348('0xf')][_0xf348('0x11')]);}logger[_0xf348('0xf')]('SalesforceField,\x20%s,\x20%s',_0x3d2335,_0x128311[_0xf348('0xf')][_0xf348('0x11')]);return _0x3ead85(_0x128311[_0xf348('0xf')][_0xf348('0x11')]);}else{logger[_0xf348('0xa')](_0xf348('0xb'),_0x3d2335,_0xf348('0xc'));_0x3ead85(_0x128311[_0xf348('0x12')][_0xf348('0x11')]);}})['catch'](function(_0x1e864c){logger[_0xf348('0xf')](_0xf348('0xb'),_0x3d2335,_0x1e864c);_0x109ace(_0x1e864c);});});} \ No newline at end of file +var _0x963e=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x5c3290,_0x1bae3a){var _0x11c832=function(_0x5f2951){while(--_0x5f2951){_0x5c3290['push'](_0x5c3290['shift']());}};_0x11c832(++_0x1bae3a);}(_0x963e,0x7f));var _0xe963=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0x963e[_0x5e9876];return _0x576c48;};'use strict';var _=require(_0xe963('0x0'));var util=require(_0xe963('0x1'));var moment=require(_0xe963('0x2'));var BPromise=require(_0xe963('0x3'));var rs=require(_0xe963('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe963('0x5'))['db'];var utils=require(_0xe963('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe963('0x7'));var jayson=require(_0xe963('0x8'));var client=jayson[_0xe963('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3fc4b,_0x2421d5,_0x54feb8){return new BPromise(function(_0x4ccab5,_0x53e13a){return client[_0xe963('0xa')](_0xd3fc4b,_0x54feb8)[_0xe963('0xb')](function(_0x27b2e8){logger[_0xe963('0xc')](_0xe963('0xd'),_0x2421d5,_0xe963('0xe'));logger[_0xe963('0xf')](_0xe963('0x10'),_0x2421d5,_0xe963('0xe'),JSON[_0xe963('0x11')](_0x27b2e8));if(_0x27b2e8[_0xe963('0x12')]){if(_0x27b2e8[_0xe963('0x12')][_0xe963('0x13')]===0x1f4){logger['error'](_0xe963('0xd'),_0x2421d5,_0x27b2e8[_0xe963('0x12')][_0xe963('0x14')]);return _0x53e13a(_0x27b2e8[_0xe963('0x12')][_0xe963('0x14')]);}logger[_0xe963('0x12')](_0xe963('0xd'),_0x2421d5,_0x27b2e8[_0xe963('0x12')][_0xe963('0x14')]);return _0x4ccab5(_0x27b2e8['error'][_0xe963('0x14')]);}else{logger[_0xe963('0xc')]('SalesforceField,\x20%s,\x20%s',_0x2421d5,_0xe963('0xe'));_0x4ccab5(_0x27b2e8[_0xe963('0x15')]['message']);}})[_0xe963('0x16')](function(_0x5a36ee){logger[_0xe963('0x12')](_0xe963('0xd'),_0x2421d5,_0x5a36ee);_0x53e13a(_0x5a36ee);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 51dd485..cc14f10 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 _0xf2a9=['../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','/:id','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf2a9,0x77));var _0x9f2a=function(_0x436cfe,_0x1d8b47){_0x436cfe=_0x436cfe-0x0;var _0x529f00=_0xf2a9[_0x436cfe];return _0x529f00;};'use strict';var multer=require('multer');var util=require(_0x9f2a('0x0'));var path=require(_0x9f2a('0x1'));var timeout=require(_0x9f2a('0x2'));var express=require('express');var router=express[_0x9f2a('0x3')]();var fs_extra=require(_0x9f2a('0x4'));var auth=require(_0x9f2a('0x5'));var interaction=require(_0x9f2a('0x6'));var config=require(_0x9f2a('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x9f2a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9f2a('0x8')]('/:id',auth[_0x9f2a('0x9')](),controller[_0x9f2a('0xa')]);router[_0x9f2a('0x8')](_0x9f2a('0xb'),auth[_0x9f2a('0x9')](),controller[_0x9f2a('0xc')]);router['get']('/:id/fields',auth[_0x9f2a('0x9')](),controller[_0x9f2a('0xd')]);router[_0x9f2a('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f2a('0xf')]);router[_0x9f2a('0xe')](_0x9f2a('0xb'),auth[_0x9f2a('0x9')](),controller[_0x9f2a('0x10')]);router['put'](_0x9f2a('0x11'),auth[_0x9f2a('0x9')](),controller[_0x9f2a('0x12')]);router[_0x9f2a('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9f2a('0x14')]=router; \ No newline at end of file +var _0xc48a=['post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x290912,_0xc4350e){var _0x3d1544=function(_0x5d480b){while(--_0x5d480b){_0x290912['push'](_0x290912['shift']());}};_0x3d1544(++_0xc4350e);}(_0xc48a,0x1ea));var _0xac48=function(_0x53b004,_0xb58f4c){_0x53b004=_0x53b004-0x0;var _0x8fe3f4=_0xc48a[_0x53b004];return _0x8fe3f4;};'use strict';var multer=require('multer');var util=require(_0xac48('0x0'));var path=require(_0xac48('0x1'));var timeout=require(_0xac48('0x2'));var express=require(_0xac48('0x3'));var router=express[_0xac48('0x4')]();var fs_extra=require(_0xac48('0x5'));var auth=require(_0xac48('0x6'));var interaction=require(_0xac48('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xac48('0x8')]('/',auth[_0xac48('0x9')](),controller[_0xac48('0xa')]);router[_0xac48('0x8')](_0xac48('0xb'),auth[_0xac48('0x9')](),controller[_0xac48('0xc')]);router[_0xac48('0x8')](_0xac48('0xd'),auth['isAuthenticated'](),controller[_0xac48('0xe')]);router[_0xac48('0x8')](_0xac48('0xf'),auth[_0xac48('0x9')](),controller['getFields']);router[_0xac48('0x10')]('/',auth[_0xac48('0x9')](),controller[_0xac48('0x11')]);router[_0xac48('0x10')](_0xac48('0xd'),auth[_0xac48('0x9')](),controller[_0xac48('0x12')]);router[_0xac48('0x13')](_0xac48('0xb'),auth[_0xac48('0x9')](),controller[_0xac48('0x14')]);router['delete'](_0xac48('0xb'),auth[_0xac48('0x9')](),controller[_0xac48('0x15')]);module[_0xac48('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ccab84b..76e389b 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 _0x0568=['username','STRING'];(function(_0x327494,_0x19777b){var _0xc015d2=function(_0x3983f3){while(--_0x3983f3){_0x327494['push'](_0x327494['shift']());}};_0xc015d2(++_0x19777b);}(_0x0568,0x155));var _0x8056=function(_0x1af336,_0x279001){_0x1af336=_0x1af336-0x0;var _0x430563=_0x0568[_0x1af336];return _0x430563;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8056('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8056('0x0')],'unique':_0x8056('0x1')},'password':{'type':Sequelize[_0x8056('0x0')]},'email':{'type':Sequelize[_0x8056('0x0')]},'remoteUri':{'type':Sequelize[_0x8056('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x8056('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x2a01=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4ebf44,_0x25dc37){var _0x178323=function(_0xccc93d){while(--_0xccc93d){_0x4ebf44['push'](_0x4ebf44['shift']());}};_0x178323(++_0x25dc37);}(_0x2a01,0x1c6));var _0x12a0=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2a01[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x12a0('0x0'));module[_0x12a0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x12a0('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x12a0('0x3')},'password':{'type':Sequelize[_0x12a0('0x2')]},'email':{'type':Sequelize[_0x12a0('0x2')]},'remoteUri':{'type':Sequelize[_0x12a0('0x2')],'unique':_0x12a0('0x4')},'serverUrl':{'type':Sequelize[_0x12a0('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 ef79f03..8b79340 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 _0xdaff=['caller_id','approval_set','work_notes','delivery_task','assignment_group','business_stc','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','company','reassignment_count','assigned_to','comments','approval','due_date','escalation','upon_approval','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','all','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','includeAll','include','show','params','keys','options','catch','create','body','update','find','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_created_by','calendar_stc','closed_at','cmdb_ci','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','group_list','work_end','reopened_time'];(function(_0x793970,_0x45acc7){var _0x3b6c8e=function(_0x9468bd){while(--_0x9468bd){_0x793970['push'](_0x793970['shift']());}};_0x3b6c8e(++_0x45acc7);}(_0xdaff,0xe5));var _0xfdaf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdaff[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xfdaf('0x0'));var rimraf=require(_0xfdaf('0x1'));var zipdir=require(_0xfdaf('0x2'));var jsonpatch=require(_0xfdaf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfdaf('0x4'));var Mustache=require(_0xfdaf('0x5'));var util=require(_0xfdaf('0x6'));var path=require('path');var sox=require(_0xfdaf('0x7'));var csv=require(_0xfdaf('0x8'));var ejs=require(_0xfdaf('0x9'));var fs=require('fs');var fs_extra=require(_0xfdaf('0xa'));var _=require(_0xfdaf('0xb'));var squel=require(_0xfdaf('0xc'));var crypto=require(_0xfdaf('0xd'));var jsforce=require(_0xfdaf('0xe'));var deskjs=require(_0xfdaf('0xf'));var toCsv=require(_0xfdaf('0x8'));var querystring=require(_0xfdaf('0x10'));var Papa=require('papaparse');var Redis=require(_0xfdaf('0x11'));var authService=require(_0xfdaf('0x12'));var qs=require(_0xfdaf('0x13'));var as=require(_0xfdaf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfdaf('0x15'))(_0xfdaf('0x16'));var utils=require(_0xfdaf('0x17'));var config=require(_0xfdaf('0x18'));var licenseUtil=require(_0xfdaf('0x19'));var db=require(_0xfdaf('0x1a'))['db'];var integrations=require(_0xfdaf('0x1b'));function respondWithStatusCode(_0x180a78,_0x486271){_0x486271=_0x486271||0xcc;return function(_0x395b95){if(_0x395b95){return _0x180a78[_0xfdaf('0x1c')](_0x486271);}return _0x180a78[_0xfdaf('0x1d')](_0x486271)[_0xfdaf('0x1e')]();};}function respondWithResult(_0x29f00e,_0x184b0a){_0x184b0a=_0x184b0a||0xc8;return function(_0x5c748d){if(_0x5c748d){return _0x29f00e[_0xfdaf('0x1d')](_0x184b0a)[_0xfdaf('0x1f')](_0x5c748d);}};}function respondWithFilteredResult(_0x51e615,_0x1ae509){return function(_0x1efba5){if(_0x1efba5){var _0x3d1206=typeof _0x1ae509[_0xfdaf('0x20')]===_0xfdaf('0x21')&&typeof _0x1ae509[_0xfdaf('0x22')]===_0xfdaf('0x21');var _0x2515aa=_0x1efba5['count'];var _0x75607f=_0x3d1206?0x0:_0x1ae509[_0xfdaf('0x20')];var _0x4a45d9=_0x3d1206?_0x1efba5[_0xfdaf('0x23')]:_0x1ae509[_0xfdaf('0x20')]+_0x1ae509[_0xfdaf('0x22')];var _0xa13a36;if(_0x4a45d9>=_0x2515aa){_0x4a45d9=_0x2515aa;_0xa13a36=0xc8;}else{_0xa13a36=0xce;}_0x51e615[_0xfdaf('0x1d')](_0xa13a36);return _0x51e615['set']('Content-Range',_0x75607f+'-'+_0x4a45d9+'/'+_0x2515aa)[_0xfdaf('0x1f')](_0x1efba5);}return null;};}function patchUpdates(_0x3d7063){return function(_0xda4c66){try{jsonpatch[_0xfdaf('0x24')](_0xda4c66,_0x3d7063,!![]);}catch(_0x5692a4){return BPromise[_0xfdaf('0x25')](_0x5692a4);}return _0xda4c66[_0xfdaf('0x26')]();};}function saveUpdates(_0x154c55,_0x257cef){return function(_0x311b98){if(_0x311b98){return _0x311b98['update'](_0x154c55)[_0xfdaf('0x27')](function(_0x34bd8a){return _0x34bd8a;});}return null;};}function removeEntity(_0x15a2d4,_0x359f09){return function(_0x2b2d1d){if(_0x2b2d1d){return _0x2b2d1d[_0xfdaf('0x28')]()[_0xfdaf('0x27')](function(){_0x15a2d4[_0xfdaf('0x1d')](0xcc)[_0xfdaf('0x1e')]();});}};}function handleEntityNotFound(_0x466cfb,_0x1bd82d){return function(_0x126f63){if(!_0x126f63){_0x466cfb[_0xfdaf('0x1c')](0x194);}return _0x126f63;};}function handleError(_0x552323,_0x53b2f1){_0x53b2f1=_0x53b2f1||0x1f4;return function(_0x4f1c7a){logger[_0xfdaf('0x29')](_0x4f1c7a[_0xfdaf('0x2a')]);if(_0x4f1c7a['name']){delete _0x4f1c7a[_0xfdaf('0x2b')];}_0x552323['status'](_0x53b2f1)[_0xfdaf('0x2c')](_0x4f1c7a);};}exports[_0xfdaf('0x2d')]=function(_0xcf5da0,_0x3f5ab3){var _0x30225d={},_0x37365a={},_0x47f3df={'count':0x0,'rows':[]};var _0x1f510e=_[_0xfdaf('0x2e')](db[_0xfdaf('0x2f')][_0xfdaf('0x30')],function(_0x129419){return{'name':_0x129419['fieldName'],'type':_0x129419[_0xfdaf('0x31')][_0xfdaf('0x32')]};});_0x37365a[_0xfdaf('0x33')]=_['map'](_0x1f510e,_0xfdaf('0x2b'));_0x37365a['query']=_['keys'](_0xcf5da0[_0xfdaf('0x34')]);_0x37365a['filters']=_[_0xfdaf('0x35')](_0x37365a[_0xfdaf('0x33')],_0x37365a[_0xfdaf('0x34')]);_0x30225d[_0xfdaf('0x36')]=_['intersection'](_0x37365a[_0xfdaf('0x33')],qs[_0xfdaf('0x37')](_0xcf5da0[_0xfdaf('0x34')][_0xfdaf('0x37')]));_0x30225d[_0xfdaf('0x36')]=_0x30225d[_0xfdaf('0x36')][_0xfdaf('0x38')]?_0x30225d[_0xfdaf('0x36')]:_0x37365a[_0xfdaf('0x33')];if(!_0xcf5da0[_0xfdaf('0x34')][_0xfdaf('0x39')](_0xfdaf('0x3a'))){_0x30225d[_0xfdaf('0x22')]=qs[_0xfdaf('0x22')](_0xcf5da0['query'][_0xfdaf('0x22')]);_0x30225d[_0xfdaf('0x20')]=qs[_0xfdaf('0x20')](_0xcf5da0['query'][_0xfdaf('0x20')]);}_0x30225d[_0xfdaf('0x3b')]=qs[_0xfdaf('0x3c')](_0xcf5da0[_0xfdaf('0x34')]['sort']);_0x30225d[_0xfdaf('0x3d')]=qs['filters'](_[_0xfdaf('0x3e')](_0xcf5da0[_0xfdaf('0x34')],_0x37365a[_0xfdaf('0x3f')]),_0x1f510e);if(_0xcf5da0[_0xfdaf('0x34')]['filter']){_0x30225d[_0xfdaf('0x3d')]=_[_0xfdaf('0x40')](_0x30225d['where'],{'$or':_[_0xfdaf('0x2e')](_0x1f510e,function(_0x16266a){if(_0x16266a[_0xfdaf('0x31')]!==_0xfdaf('0x41')){var _0x5c7071={};_0x5c7071[_0x16266a['name']]={'$like':'%'+_0xcf5da0[_0xfdaf('0x34')][_0xfdaf('0x42')]+'%'};return _0x5c7071;}})});}_0x30225d=_[_0xfdaf('0x40')]({},_0x30225d,_0xcf5da0['options']);var _0x43e70b={'where':_0x30225d[_0xfdaf('0x3d')]};return db[_0xfdaf('0x2f')][_0xfdaf('0x23')](_0x43e70b)['then'](function(_0x15b527){_0x47f3df[_0xfdaf('0x23')]=_0x15b527;if(_0xcf5da0['query'][_0xfdaf('0x43')]){_0x30225d[_0xfdaf('0x44')]=[{'all':!![]}];}return db[_0xfdaf('0x2f')]['findAll'](_0x30225d);})[_0xfdaf('0x27')](function(_0x3e2250){_0x47f3df['rows']=_0x3e2250;return _0x47f3df;})[_0xfdaf('0x27')](respondWithFilteredResult(_0x3f5ab3,_0x30225d))['catch'](handleError(_0x3f5ab3,null));};exports[_0xfdaf('0x45')]=function(_0x1f4ead,_0x2eb4b3){var _0x469c30={'raw':![],'where':{'id':_0x1f4ead[_0xfdaf('0x46')]['id']}},_0x3a4101={};_0x3a4101[_0xfdaf('0x33')]=_[_0xfdaf('0x47')](db[_0xfdaf('0x2f')][_0xfdaf('0x30')]);_0x3a4101[_0xfdaf('0x34')]=_[_0xfdaf('0x47')](_0x1f4ead[_0xfdaf('0x34')]);_0x3a4101['filters']=_[_0xfdaf('0x35')](_0x3a4101[_0xfdaf('0x33')],_0x3a4101[_0xfdaf('0x34')]);_0x469c30[_0xfdaf('0x36')]=_[_0xfdaf('0x35')](_0x3a4101[_0xfdaf('0x33')],qs[_0xfdaf('0x37')](_0x1f4ead[_0xfdaf('0x34')][_0xfdaf('0x37')]));_0x469c30[_0xfdaf('0x36')]=_0x469c30[_0xfdaf('0x36')][_0xfdaf('0x38')]?_0x469c30[_0xfdaf('0x36')]:_0x3a4101[_0xfdaf('0x33')];if(_0x1f4ead[_0xfdaf('0x34')]['includeAll']){_0x469c30['include']=[{'all':!![]}];}_0x469c30=_['merge']({},_0x469c30,_0x1f4ead[_0xfdaf('0x48')]);return db['ServicenowAccount']['find'](_0x469c30)['then'](handleEntityNotFound(_0x2eb4b3,null))[_0xfdaf('0x27')](respondWithResult(_0x2eb4b3,null))[_0xfdaf('0x49')](handleError(_0x2eb4b3,null));};exports[_0xfdaf('0x4a')]=function(_0x33e990,_0x1843b7){return db[_0xfdaf('0x2f')][_0xfdaf('0x4a')](_0x33e990[_0xfdaf('0x4b')],{})[_0xfdaf('0x27')](respondWithResult(_0x1843b7,0xc9))[_0xfdaf('0x49')](handleError(_0x1843b7,null));};exports[_0xfdaf('0x4c')]=function(_0x348860,_0x1d6cd2){if(_0x348860[_0xfdaf('0x4b')]['id']){delete _0x348860[_0xfdaf('0x4b')]['id'];}return db['ServicenowAccount'][_0xfdaf('0x4d')]({'where':{'id':_0x348860['params']['id']}})['then'](handleEntityNotFound(_0x1d6cd2,null))[_0xfdaf('0x27')](saveUpdates(_0x348860[_0xfdaf('0x4b')],null))[_0xfdaf('0x27')](respondWithResult(_0x1d6cd2,null))[_0xfdaf('0x49')](handleError(_0x1d6cd2,null));};exports['destroy']=function(_0x307dbd,_0x2118ca){return db[_0xfdaf('0x2f')][_0xfdaf('0x4d')]({'where':{'id':_0x307dbd['params']['id']}})[_0xfdaf('0x27')](handleEntityNotFound(_0x2118ca,null))[_0xfdaf('0x27')](removeEntity(_0x2118ca,null))[_0xfdaf('0x49')](handleError(_0x2118ca,null));};exports[_0xfdaf('0x4e')]=function(_0x110777,_0x13304b,_0xa22248){var _0x11e314={};var _0x32660f={};var _0xfbb517;var _0x3cf7f3;return db[_0xfdaf('0x2f')][_0xfdaf('0x4f')]({'where':{'id':_0x110777['params']['id']}})[_0xfdaf('0x27')](handleEntityNotFound(_0x13304b,null))[_0xfdaf('0x27')](function(_0x4e80f5){if(_0x4e80f5){_0xfbb517=_0x4e80f5;_0x32660f[_0xfdaf('0x33')]=_[_0xfdaf('0x47')](db[_0xfdaf('0x50')][_0xfdaf('0x30')]);_0x32660f[_0xfdaf('0x34')]=_['keys'](_0x110777[_0xfdaf('0x34')]);_0x32660f[_0xfdaf('0x3f')]=_['intersection'](_0x32660f[_0xfdaf('0x33')],_0x32660f['query']);_0x11e314[_0xfdaf('0x36')]=_[_0xfdaf('0x35')](_0x32660f[_0xfdaf('0x33')],qs[_0xfdaf('0x37')](_0x110777['query']['fields']));_0x11e314[_0xfdaf('0x36')]=_0x11e314['attributes']['length']?_0x11e314[_0xfdaf('0x36')]:_0x32660f[_0xfdaf('0x33')];_0x11e314['order']=qs[_0xfdaf('0x3c')](_0x110777[_0xfdaf('0x34')][_0xfdaf('0x3c')]);_0x11e314['where']=qs[_0xfdaf('0x3f')](_['pick'](_0x110777[_0xfdaf('0x34')],_0x32660f['filters']));if(_0x110777[_0xfdaf('0x34')]['filter']){_0x11e314['where']=_['merge'](_0x11e314[_0xfdaf('0x3d')],{'$or':_[_0xfdaf('0x2e')](_0x11e314[_0xfdaf('0x36')],function(_0x43490e){var _0x41e618={};_0x41e618[_0x43490e]={'$like':'%'+_0x110777[_0xfdaf('0x34')]['filter']+'%'};return _0x41e618;})});}_0x11e314=_[_0xfdaf('0x40')]({},_0x11e314,_0x110777[_0xfdaf('0x48')]);return _0xfbb517[_0xfdaf('0x4e')](_0x11e314);}})[_0xfdaf('0x27')](function(_0x2bf646){if(_0x2bf646){_0x3cf7f3=_0x2bf646[_0xfdaf('0x38')];if(!_0x110777[_0xfdaf('0x34')][_0xfdaf('0x39')](_0xfdaf('0x3a'))){_0x11e314[_0xfdaf('0x22')]=qs[_0xfdaf('0x22')](_0x110777[_0xfdaf('0x34')][_0xfdaf('0x22')]);_0x11e314[_0xfdaf('0x20')]=qs[_0xfdaf('0x20')](_0x110777['query'][_0xfdaf('0x20')]);}return _0xfbb517[_0xfdaf('0x4e')](_0x11e314);}})[_0xfdaf('0x27')](function(_0x2717c6){if(_0x2717c6){return _0x2717c6?{'count':_0x3cf7f3,'rows':_0x2717c6}:null;}})[_0xfdaf('0x27')](respondWithResult(_0x13304b,null))[_0xfdaf('0x49')](handleError(_0x13304b,null));};exports[_0xfdaf('0x51')]=function(_0x18ff43,_0x8456db,_0x1b6257){if(_0x18ff43[_0xfdaf('0x4b')]['id']){delete _0x18ff43[_0xfdaf('0x4b')]['id'];}return db[_0xfdaf('0x2f')][_0xfdaf('0x4f')]({'where':{'id':_0x18ff43['params']['id']}})[_0xfdaf('0x27')](handleEntityNotFound(_0x8456db,null))[_0xfdaf('0x27')](function(_0x4bc6c9){if(_0x4bc6c9){_0x18ff43[_0xfdaf('0x4b')][_0xfdaf('0x52')]=_0x4bc6c9['id'];_0x18ff43['body'][_0xfdaf('0x53')]=integrations[_0xfdaf('0x54')](_0x18ff43['body'][_0xfdaf('0x55')],_0x18ff43[_0xfdaf('0x4b')]['type']);_0x18ff43[_0xfdaf('0x4b')][_0xfdaf('0x56')]=integrations[_0xfdaf('0x57')](_0x18ff43[_0xfdaf('0x4b')][_0xfdaf('0x55')],_0x18ff43[_0xfdaf('0x4b')]['type']);return db[_0xfdaf('0x50')]['create'](_0x18ff43['body'],{'include':[{'model':db[_0xfdaf('0x58')],'as':_0xfdaf('0x53')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x8456db,null))[_0xfdaf('0x49')](handleError(_0x8456db,null));};exports[_0xfdaf('0x59')]=function(_0x49376d,_0x4d28c8,_0x22b9fe){var _0x34e357=[_0xfdaf('0x5a'),_0xfdaf('0x5b'),_0xfdaf('0x5c'),'subcategory',_0xfdaf('0x5d'),_0xfdaf('0x5e'),_0xfdaf('0x5f'),_0xfdaf('0x60'),_0xfdaf('0x61')];var _0x3b84f6=[_0xfdaf('0x62'),_0xfdaf('0x5a'),_0xfdaf('0x63'),'watch_list','upon_reject','sys_updated_on',_0xfdaf('0x64'),_0xfdaf('0x5b'),_0xfdaf('0x65'),'number',_0xfdaf('0x66'),_0xfdaf('0x67'),_0xfdaf('0x68'),'user_input',_0xfdaf('0x69'),'sys_domain','state',_0xfdaf('0x6a'),_0xfdaf('0x5c'),_0xfdaf('0x3b'),_0xfdaf('0x6b'),_0xfdaf('0x6c'),_0xfdaf('0x6d'),'delivery_plan','impact',_0xfdaf('0x6e'),_0xfdaf('0x6f'),_0xfdaf('0x70'),_0xfdaf('0x71'),_0xfdaf('0x72'),'rfc',_0xfdaf('0x73'),_0xfdaf('0x74'),_0xfdaf('0x75'),'business_duration',_0xfdaf('0x76'),_0xfdaf('0x77'),_0xfdaf('0x78'),'resolved_at',_0xfdaf('0x79'),_0xfdaf('0x7a'),'subcategory',_0xfdaf('0x7b'),'short_description','close_code','correlation_display',_0xfdaf('0x7c'),'work_start',_0xfdaf('0x7d'),_0xfdaf('0x7e'),'additional_assignee_list',_0xfdaf('0x7f'),_0xfdaf('0x80'),_0xfdaf('0x5e'),_0xfdaf('0x81'),'close_notes',_0xfdaf('0x82'),_0xfdaf('0x83'),_0xfdaf('0x84'),'sys_id',_0xfdaf('0x85'),_0xfdaf('0x86'),'incident_state',_0xfdaf('0x87'),'problem_id',_0xfdaf('0x88'),_0xfdaf('0x89'),'activity_due',_0xfdaf('0x8a'),_0xfdaf('0x60'),_0xfdaf('0x8b'),'sla_due',_0xfdaf('0x8c'),'comments_and_work_notes',_0xfdaf('0x8d'),'sys_mod_count','reopen_count','sys_tags',_0xfdaf('0x8e'),_0xfdaf('0x8f'),'correlation_id','location',_0xfdaf('0x61')];var _0x484464='';var _0x59904b='';var _0xe0192b=[];var _0x53620a='';var _0x4db365='';var _0x588074=[];var _0x377ea2='';var _0x113f90='';var _0x5b58c5={};var _0x23f2ce='';return db[_0xfdaf('0x2f')][_0xfdaf('0x4f')]({'where':{'id':_0x49376d[_0xfdaf('0x46')]['id']},'attributes':['id',_0xfdaf('0x90'),_0xfdaf('0x91'),_0xfdaf('0x92'),_0xfdaf('0x93'),_0xfdaf('0x94')]})[_0xfdaf('0x27')](handleEntityNotFound(_0x4d28c8,null))['then'](function(_0xaa7cf5){if(_0xaa7cf5){_0x23f2ce=_0xaa7cf5[_0xfdaf('0x93')];var _0x4b2000=_0x23f2ce['slice'](-0x1);if(_0x4b2000==='/'){_0x23f2ce=_0x23f2ce[_0xfdaf('0x95')](0x0,_0x23f2ce[_0xfdaf('0x96')](_0x4b2000));}_0x113f90=util[_0xfdaf('0x97')](_0xfdaf('0x98'),_0x23f2ce);_0x377ea2=util['format']('%s/api/now/table/',_0x23f2ce);_0x5b58c5={'user':_0xaa7cf5[_0xfdaf('0x90')],'pass':_0xaa7cf5['password']};var _0x7d767b={'method':_0xfdaf('0x99'),'uri':_0x113f90+_0xfdaf('0x9a'),'auth':_0x5b58c5,'json':!![]};return rp(_0x7d767b);}})[_0xfdaf('0x27')](function(_0x43d262){if(_0x43d262[_0xfdaf('0x9b')]['length']>0x0){_0x484464=_0x43d262[_0xfdaf('0x9b')];}console[_0xfdaf('0x9c')](_0xfdaf('0x9d'),_0x484464);_0x588074=[];_0x59904b=Object['assign']([],_0x484464);_[_0xfdaf('0x9e')](_0x59904b,function(_0x250269){return!_0x34e357[_0xfdaf('0x9f')](_0x250269[_0xfdaf('0x2b')]);});_0x59904b[_0xfdaf('0xa0')](function(_0x3bfc3e){var _0x58d8dd=createFieldObject(_0x377ea2,_0x5b58c5,_0x3bfc3e[_0xfdaf('0xa1')],_0x3bfc3e[_0xfdaf('0x2b')],_0x3bfc3e[_0xfdaf('0xa2')],![]);_0x588074['push'](_0x58d8dd);});return Promise[_0xfdaf('0xa3')](_0x588074);})[_0xfdaf('0x27')](function(_0xb31a1c){_0xe0192b=_0xb31a1c;_0x53620a=Object['assign']([],_0x484464);console[_0xfdaf('0x9c')]('TCL:\x20_object',_0x484464);_[_0xfdaf('0x9e')](_0x53620a,function(_0x22705a){return _0x3b84f6[_0xfdaf('0x9f')](_0x22705a[_0xfdaf('0x2b')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x53620a);_0x588074=[];_0x53620a[_0xfdaf('0xa0')](function(_0x37d034){var _0x13a804=createFieldObject(_0x377ea2,_0x5b58c5,_0x37d034[_0xfdaf('0xa1')],_0x37d034[_0xfdaf('0x2b')],_0x37d034[_0xfdaf('0xa2')],!![]);_0x588074[_0xfdaf('0xa4')](_0x13a804);});return Promise[_0xfdaf('0xa3')](_0x588074);})[_0xfdaf('0x27')](function(_0x41148b){_0x4db365=_0x41148b;var _0x20f568=_0xe0192b[_0xfdaf('0xa5')](_0x4db365);return{'count':_0x20f568[_0xfdaf('0x38')],'rows':_0x20f568};})[_0xfdaf('0x27')](respondWithResult(_0x4d28c8,null))['catch'](function(_0x4d4372){console['log'](_0xfdaf('0xa6')+_0x4d4372);var _0x173c16=_0x49376d[_0xfdaf('0x34')][_0xfdaf('0xa7')]?0x1f4:_0x4d4372[_0xfdaf('0xa8')]||0x1f4;logger[_0xfdaf('0x29')](_0x4d4372[_0xfdaf('0x2a')]);delete _0x4d4372[_0xfdaf('0x2b')];if(_0x173c16===0x191){_0x173c16=0x190;}_0x4d28c8[_0xfdaf('0x1d')](_0x173c16)[_0xfdaf('0x2c')](_0x49376d[_0xfdaf('0x34')][_0xfdaf('0xa7')]?{'message':_0xfdaf('0xa9'),'statusCode':_0x4d4372[_0xfdaf('0xa8')]}:_0x4d4372);});};function createFieldObject(_0x1769d8,_0x828d5b,_0x2f3a33,_0xda76da,_0x28ba70,_0x2fa232){return new Promise(function(_0x1c168d,_0x481552){var _0xcb7999={'id':_0xda76da,'name':_0x28ba70,'custom':_0x2fa232};if(_0x2f3a33===_0xfdaf('0xaa')){_0xcb7999[_0xfdaf('0x48')]=[{'name':'True','value':_0xfdaf('0xab')},{'name':_0xfdaf('0xac'),'value':_0xfdaf('0xad')}];_0x1c168d(_0xcb7999);}else{var _0x4eb318={'method':_0xfdaf('0x99'),'uri':_0x1769d8+_0xfdaf('0xae')+_0xda76da,'auth':_0x828d5b,'json':!![]};return rp(_0x4eb318)[_0xfdaf('0x27')](function(_0x6eba9a){var _0x19b89b=[];if(_0x6eba9a[_0xfdaf('0x9b')][_0xfdaf('0x38')]>0x0){_0x6eba9a[_0xfdaf('0x9b')][_0xfdaf('0xa0')](function(_0x2e4218){if(_0x2e4218['inactive']===_0xfdaf('0xad')){var _0x129534={'name':_0x2e4218['label'],'value':_0x2e4218['value']};_0x19b89b[_0xfdaf('0xa4')](_0x129534);}});}_0xcb7999[_0xfdaf('0x48')]=_0x19b89b;if(_0xcb7999[_0xfdaf('0x48')]['length']>0x0){_0x1c168d(_0xcb7999);}else{if(_0x2fa232==![]){_0x1c168d();}else{_0x1c168d(_0xcb7999);}}});}});} \ No newline at end of file +var _0x0716=['VIRTUAL','options','ServicenowAccount','includeAll','include','rows','catch','show','params','length','find','body','ServicenowConfiguration','getConfigurations','findOne','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','closed_at','cmdb_ci','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','subcategory','work_notes','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','reassignment_count','assigned_to','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','assign','includes','forEach','internalType','label','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','true','False','sys_choice?sysparm_query=name=incident^element=','false','value','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x299daf,_0x4bb14a){var _0x34ccd4=function(_0x467889){while(--_0x467889){_0x299daf['push'](_0x299daf['shift']());}};_0x34ccd4(++_0x4bb14a);}(_0x0716,0x76));var _0x6071=function(_0x19cf7a,_0x1dd21e){_0x19cf7a=_0x19cf7a-0x0;var _0x1a75bb=_0x0716[_0x19cf7a];return _0x1a75bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6071('0x0'));var jsonpatch=require(_0x6071('0x1'));var rp=require(_0x6071('0x2'));var moment=require('moment');var BPromise=require(_0x6071('0x3'));var Mustache=require('mustache');var util=require(_0x6071('0x4'));var path=require(_0x6071('0x5'));var sox=require('sox');var csv=require(_0x6071('0x6'));var ejs=require(_0x6071('0x7'));var fs=require('fs');var fs_extra=require(_0x6071('0x8'));var _=require('lodash');var squel=require(_0x6071('0x9'));var crypto=require(_0x6071('0xa'));var jsforce=require(_0x6071('0xb'));var deskjs=require(_0x6071('0xc'));var toCsv=require(_0x6071('0x6'));var querystring=require('querystring');var Papa=require(_0x6071('0xd'));var Redis=require('ioredis');var authService=require(_0x6071('0xe'));var qs=require(_0x6071('0xf'));var as=require(_0x6071('0x10'));var hardwareService=require(_0x6071('0x11'));var logger=require(_0x6071('0x12'))(_0x6071('0x13'));var utils=require(_0x6071('0x14'));var config=require(_0x6071('0x15'));var licenseUtil=require(_0x6071('0x16'));var db=require(_0x6071('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2c2846,_0x3105a7){_0x3105a7=_0x3105a7||0xcc;return function(_0x31d37d){if(_0x31d37d){return _0x2c2846[_0x6071('0x18')](_0x3105a7);}return _0x2c2846[_0x6071('0x19')](_0x3105a7)[_0x6071('0x1a')]();};}function respondWithResult(_0x4912c3,_0x569802){_0x569802=_0x569802||0xc8;return function(_0x1f18ba){if(_0x1f18ba){return _0x4912c3[_0x6071('0x19')](_0x569802)[_0x6071('0x1b')](_0x1f18ba);}};}function respondWithFilteredResult(_0x464230,_0x54eda5){return function(_0x54f65e){if(_0x54f65e){var _0x4a50e8=typeof _0x54eda5[_0x6071('0x1c')]===_0x6071('0x1d')&&typeof _0x54eda5[_0x6071('0x1e')]==='undefined';var _0x169af0=_0x54f65e[_0x6071('0x1f')];var _0x37e8b9=_0x4a50e8?0x0:_0x54eda5[_0x6071('0x1c')];var _0x31d8b7=_0x4a50e8?_0x54f65e[_0x6071('0x1f')]:_0x54eda5['offset']+_0x54eda5[_0x6071('0x1e')];var _0x1512cb;if(_0x31d8b7>=_0x169af0){_0x31d8b7=_0x169af0;_0x1512cb=0xc8;}else{_0x1512cb=0xce;}_0x464230[_0x6071('0x19')](_0x1512cb);return _0x464230[_0x6071('0x20')]('Content-Range',_0x37e8b9+'-'+_0x31d8b7+'/'+_0x169af0)[_0x6071('0x1b')](_0x54f65e);}return null;};}function patchUpdates(_0x9fb9b4){return function(_0x4584a5){try{jsonpatch[_0x6071('0x21')](_0x4584a5,_0x9fb9b4,!![]);}catch(_0x70fa30){return BPromise[_0x6071('0x22')](_0x70fa30);}return _0x4584a5[_0x6071('0x23')]();};}function saveUpdates(_0x281d69,_0x354b1b){return function(_0x4c8c5d){if(_0x4c8c5d){return _0x4c8c5d[_0x6071('0x24')](_0x281d69)['then'](function(_0x445ec3){return _0x445ec3;});}return null;};}function removeEntity(_0x5838d9,_0x249b2b){return function(_0x573dc0){if(_0x573dc0){return _0x573dc0[_0x6071('0x25')]()[_0x6071('0x26')](function(){_0x5838d9[_0x6071('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ccda,_0x3fb49c){return function(_0x341559){if(!_0x341559){_0x55ccda['sendStatus'](0x194);}return _0x341559;};}function handleError(_0x495007,_0x56dd94){_0x56dd94=_0x56dd94||0x1f4;return function(_0x102edb){logger[_0x6071('0x27')](_0x102edb[_0x6071('0x28')]);if(_0x102edb['name']){delete _0x102edb[_0x6071('0x29')];}_0x495007[_0x6071('0x19')](_0x56dd94)[_0x6071('0x2a')](_0x102edb);};}exports['index']=function(_0x467b5a,_0x2389f9){var _0xb8c901={},_0xebd2fe={},_0x42b3ab={'count':0x0,'rows':[]};var _0x1a53ae=_[_0x6071('0x2b')](db['ServicenowAccount'][_0x6071('0x2c')],function(_0x504148){return{'name':_0x504148[_0x6071('0x2d')],'type':_0x504148['type']['key']};});_0xebd2fe[_0x6071('0x2e')]=_[_0x6071('0x2b')](_0x1a53ae,_0x6071('0x29'));_0xebd2fe[_0x6071('0x2f')]=_[_0x6071('0x30')](_0x467b5a[_0x6071('0x2f')]);_0xebd2fe[_0x6071('0x31')]=_[_0x6071('0x32')](_0xebd2fe[_0x6071('0x2e')],_0xebd2fe[_0x6071('0x2f')]);_0xb8c901['attributes']=_[_0x6071('0x32')](_0xebd2fe[_0x6071('0x2e')],qs[_0x6071('0x33')](_0x467b5a[_0x6071('0x2f')][_0x6071('0x33')]));_0xb8c901[_0x6071('0x34')]=_0xb8c901[_0x6071('0x34')]['length']?_0xb8c901[_0x6071('0x34')]:_0xebd2fe[_0x6071('0x2e')];if(!_0x467b5a['query'][_0x6071('0x35')](_0x6071('0x36'))){_0xb8c901['limit']=qs[_0x6071('0x1e')](_0x467b5a[_0x6071('0x2f')][_0x6071('0x1e')]);_0xb8c901[_0x6071('0x1c')]=qs[_0x6071('0x1c')](_0x467b5a[_0x6071('0x2f')]['offset']);}_0xb8c901[_0x6071('0x37')]=qs[_0x6071('0x38')](_0x467b5a[_0x6071('0x2f')][_0x6071('0x38')]);_0xb8c901[_0x6071('0x39')]=qs[_0x6071('0x31')](_[_0x6071('0x3a')](_0x467b5a['query'],_0xebd2fe[_0x6071('0x31')]),_0x1a53ae);if(_0x467b5a[_0x6071('0x2f')][_0x6071('0x3b')]){_0xb8c901[_0x6071('0x39')]=_[_0x6071('0x3c')](_0xb8c901[_0x6071('0x39')],{'$or':_[_0x6071('0x2b')](_0x1a53ae,function(_0x1aa1c2){if(_0x1aa1c2['type']!==_0x6071('0x3d')){var _0x49f782={};_0x49f782[_0x1aa1c2['name']]={'$like':'%'+_0x467b5a['query'][_0x6071('0x3b')]+'%'};return _0x49f782;}})});}_0xb8c901=_[_0x6071('0x3c')]({},_0xb8c901,_0x467b5a[_0x6071('0x3e')]);var _0x174d79={'where':_0xb8c901[_0x6071('0x39')]};return db[_0x6071('0x3f')][_0x6071('0x1f')](_0x174d79)[_0x6071('0x26')](function(_0x591a0f){_0x42b3ab[_0x6071('0x1f')]=_0x591a0f;if(_0x467b5a['query'][_0x6071('0x40')]){_0xb8c901[_0x6071('0x41')]=[{'all':!![]}];}return db[_0x6071('0x3f')]['findAll'](_0xb8c901);})[_0x6071('0x26')](function(_0x2eaf3a){_0x42b3ab[_0x6071('0x42')]=_0x2eaf3a;return _0x42b3ab;})[_0x6071('0x26')](respondWithFilteredResult(_0x2389f9,_0xb8c901))[_0x6071('0x43')](handleError(_0x2389f9,null));};exports[_0x6071('0x44')]=function(_0x551d9c,_0x10d0c0){var _0x204336={'raw':![],'where':{'id':_0x551d9c[_0x6071('0x45')]['id']}},_0x2be53f={};_0x2be53f[_0x6071('0x2e')]=_[_0x6071('0x30')](db[_0x6071('0x3f')]['rawAttributes']);_0x2be53f['query']=_[_0x6071('0x30')](_0x551d9c['query']);_0x2be53f[_0x6071('0x31')]=_[_0x6071('0x32')](_0x2be53f['model'],_0x2be53f[_0x6071('0x2f')]);_0x204336[_0x6071('0x34')]=_[_0x6071('0x32')](_0x2be53f[_0x6071('0x2e')],qs[_0x6071('0x33')](_0x551d9c[_0x6071('0x2f')][_0x6071('0x33')]));_0x204336['attributes']=_0x204336[_0x6071('0x34')][_0x6071('0x46')]?_0x204336[_0x6071('0x34')]:_0x2be53f[_0x6071('0x2e')];if(_0x551d9c['query'][_0x6071('0x40')]){_0x204336[_0x6071('0x41')]=[{'all':!![]}];}_0x204336=_[_0x6071('0x3c')]({},_0x204336,_0x551d9c['options']);return db[_0x6071('0x3f')][_0x6071('0x47')](_0x204336)[_0x6071('0x26')](handleEntityNotFound(_0x10d0c0,null))[_0x6071('0x26')](respondWithResult(_0x10d0c0,null))[_0x6071('0x43')](handleError(_0x10d0c0,null));};exports['create']=function(_0x55ea4a,_0x3c1813){return db[_0x6071('0x3f')]['create'](_0x55ea4a[_0x6071('0x48')],{})[_0x6071('0x26')](respondWithResult(_0x3c1813,0xc9))[_0x6071('0x43')](handleError(_0x3c1813,null));};exports[_0x6071('0x24')]=function(_0x22ca6a,_0x66fdf7){if(_0x22ca6a[_0x6071('0x48')]['id']){delete _0x22ca6a[_0x6071('0x48')]['id'];}return db[_0x6071('0x3f')][_0x6071('0x47')]({'where':{'id':_0x22ca6a[_0x6071('0x45')]['id']}})[_0x6071('0x26')](handleEntityNotFound(_0x66fdf7,null))[_0x6071('0x26')](saveUpdates(_0x22ca6a[_0x6071('0x48')],null))[_0x6071('0x26')](respondWithResult(_0x66fdf7,null))[_0x6071('0x43')](handleError(_0x66fdf7,null));};exports[_0x6071('0x25')]=function(_0x510f53,_0x5e7d91){return db[_0x6071('0x3f')]['find']({'where':{'id':_0x510f53[_0x6071('0x45')]['id']}})[_0x6071('0x26')](handleEntityNotFound(_0x5e7d91,null))[_0x6071('0x26')](removeEntity(_0x5e7d91,null))[_0x6071('0x43')](handleError(_0x5e7d91,null));};exports['getConfigurations']=function(_0x55d6c5,_0x3fa266,_0x6b65d8){var _0x20d457={};var _0x51fc9e={};var _0x24ea93;var _0x2bee30;return db[_0x6071('0x3f')]['findOne']({'where':{'id':_0x55d6c5[_0x6071('0x45')]['id']}})[_0x6071('0x26')](handleEntityNotFound(_0x3fa266,null))[_0x6071('0x26')](function(_0x19a929){if(_0x19a929){_0x24ea93=_0x19a929;_0x51fc9e[_0x6071('0x2e')]=_[_0x6071('0x30')](db[_0x6071('0x49')][_0x6071('0x2c')]);_0x51fc9e[_0x6071('0x2f')]=_['keys'](_0x55d6c5[_0x6071('0x2f')]);_0x51fc9e['filters']=_['intersection'](_0x51fc9e[_0x6071('0x2e')],_0x51fc9e[_0x6071('0x2f')]);_0x20d457[_0x6071('0x34')]=_[_0x6071('0x32')](_0x51fc9e['model'],qs[_0x6071('0x33')](_0x55d6c5[_0x6071('0x2f')][_0x6071('0x33')]));_0x20d457['attributes']=_0x20d457['attributes'][_0x6071('0x46')]?_0x20d457[_0x6071('0x34')]:_0x51fc9e[_0x6071('0x2e')];_0x20d457[_0x6071('0x37')]=qs['sort'](_0x55d6c5[_0x6071('0x2f')]['sort']);_0x20d457[_0x6071('0x39')]=qs[_0x6071('0x31')](_['pick'](_0x55d6c5[_0x6071('0x2f')],_0x51fc9e[_0x6071('0x31')]));if(_0x55d6c5[_0x6071('0x2f')][_0x6071('0x3b')]){_0x20d457['where']=_[_0x6071('0x3c')](_0x20d457[_0x6071('0x39')],{'$or':_[_0x6071('0x2b')](_0x20d457['attributes'],function(_0x4dfbba){var _0x4a4e10={};_0x4a4e10[_0x4dfbba]={'$like':'%'+_0x55d6c5['query'][_0x6071('0x3b')]+'%'};return _0x4a4e10;})});}_0x20d457=_[_0x6071('0x3c')]({},_0x20d457,_0x55d6c5[_0x6071('0x3e')]);return _0x24ea93['getConfigurations'](_0x20d457);}})[_0x6071('0x26')](function(_0x19b709){if(_0x19b709){_0x2bee30=_0x19b709[_0x6071('0x46')];if(!_0x55d6c5[_0x6071('0x2f')][_0x6071('0x35')]('nolimit')){_0x20d457[_0x6071('0x1e')]=qs[_0x6071('0x1e')](_0x55d6c5[_0x6071('0x2f')][_0x6071('0x1e')]);_0x20d457[_0x6071('0x1c')]=qs[_0x6071('0x1c')](_0x55d6c5[_0x6071('0x2f')][_0x6071('0x1c')]);}return _0x24ea93[_0x6071('0x4a')](_0x20d457);}})[_0x6071('0x26')](function(_0x19bacf){if(_0x19bacf){return _0x19bacf?{'count':_0x2bee30,'rows':_0x19bacf}:null;}})['then'](respondWithResult(_0x3fa266,null))[_0x6071('0x43')](handleError(_0x3fa266,null));};exports['addConfiguration']=function(_0x4831ae,_0x50ab67,_0x4a8549){if(_0x4831ae[_0x6071('0x48')]['id']){delete _0x4831ae['body']['id'];}return db[_0x6071('0x3f')][_0x6071('0x4b')]({'where':{'id':_0x4831ae['params']['id']}})[_0x6071('0x26')](handleEntityNotFound(_0x50ab67,null))[_0x6071('0x26')](function(_0x4cf0c4){if(_0x4cf0c4){_0x4831ae[_0x6071('0x48')]['AccountId']=_0x4cf0c4['id'];_0x4831ae[_0x6071('0x48')][_0x6071('0x4c')]=integrations[_0x6071('0x4d')](_0x4831ae[_0x6071('0x48')][_0x6071('0x4e')],_0x4831ae['body']['type']);_0x4831ae[_0x6071('0x48')][_0x6071('0x4f')]=integrations['getDescriptions'](_0x4831ae['body'][_0x6071('0x4e')],_0x4831ae['body']['type']);return db['ServicenowConfiguration']['create'](_0x4831ae[_0x6071('0x48')],{'include':[{'model':db[_0x6071('0x50')],'as':_0x6071('0x4c')},{'model':db[_0x6071('0x50')],'as':_0x6071('0x4f')}]});}return null;})['then'](respondWithResult(_0x50ab67,null))[_0x6071('0x43')](handleError(_0x50ab67,null));};exports[_0x6071('0x51')]=function(_0x39a19f,_0x197dba,_0x4277de){var _0x2a9dd9=[_0x6071('0x52'),_0x6071('0x53'),_0x6071('0x54'),'subcategory',_0x6071('0x55'),_0x6071('0x56'),_0x6071('0x57'),_0x6071('0x58'),_0x6071('0x59')];var _0x1df38a=[_0x6071('0x5a'),_0x6071('0x52'),_0x6071('0x5b'),'watch_list',_0x6071('0x5c'),_0x6071('0x5d'),'child_incidents',_0x6071('0x53'),'approval_history','number',_0x6071('0x5e'),_0x6071('0x5f'),_0x6071('0x60'),_0x6071('0x61'),_0x6071('0x62'),_0x6071('0x63'),'state',_0x6071('0x64'),_0x6071('0x54'),_0x6071('0x37'),'calendar_stc',_0x6071('0x65'),_0x6071('0x66'),'delivery_plan',_0x6071('0x67'),_0x6071('0x68'),_0x6071('0x69'),'business_service',_0x6071('0x6a'),_0x6071('0x6b'),_0x6071('0x6c'),_0x6071('0x6d'),_0x6071('0x6e'),_0x6071('0x6f'),_0x6071('0x70'),_0x6071('0x71'),_0x6071('0x72'),_0x6071('0x73'),_0x6071('0x74'),_0x6071('0x75'),'approval_set',_0x6071('0x76'),_0x6071('0x77'),'short_description',_0x6071('0x55'),_0x6071('0x78'),_0x6071('0x79'),'work_start',_0x6071('0x7a'),_0x6071('0x7b'),_0x6071('0x7c'),_0x6071('0x7d'),_0x6071('0x7e'),_0x6071('0x56'),_0x6071('0x7f'),_0x6071('0x80'),_0x6071('0x81'),_0x6071('0x82'),_0x6071('0x83'),_0x6071('0x84'),_0x6071('0x85'),_0x6071('0x86'),_0x6071('0x57'),'urgency',_0x6071('0x87'),'company',_0x6071('0x88'),'activity_due',_0x6071('0x89'),_0x6071('0x58'),'comments','sla_due',_0x6071('0x8a'),_0x6071('0x8b'),'due_date',_0x6071('0x8c'),_0x6071('0x8d'),_0x6071('0x8e'),_0x6071('0x8f'),_0x6071('0x90'),_0x6071('0x91'),_0x6071('0x92'),_0x6071('0x59')];var _0x2b24cc='';var _0x22816a='';var _0x4d258c=[];var _0x44c678='';var _0xaf3d65='';var _0x55b529=[];var _0x1814b1='';var _0x4a65b3='';var _0x1e7331={};var _0x1bbbc3='';return db[_0x6071('0x3f')]['findOne']({'where':{'id':_0x39a19f[_0x6071('0x45')]['id']},'attributes':['id',_0x6071('0x93'),'password',_0x6071('0x94'),_0x6071('0x95'),_0x6071('0x96')]})[_0x6071('0x26')](handleEntityNotFound(_0x197dba,null))[_0x6071('0x26')](function(_0x129e48){if(_0x129e48){_0x1bbbc3=_0x129e48[_0x6071('0x95')];var _0x254d5b=_0x1bbbc3[_0x6071('0x97')](-0x1);if(_0x254d5b==='/'){_0x1bbbc3=_0x1bbbc3[_0x6071('0x98')](0x0,_0x1bbbc3['lastIndexOf'](_0x254d5b));}_0x4a65b3=util[_0x6071('0x99')](_0x6071('0x9a'),_0x1bbbc3);_0x1814b1=util[_0x6071('0x99')](_0x6071('0x9b'),_0x1bbbc3);_0x1e7331={'user':_0x129e48[_0x6071('0x93')],'pass':_0x129e48[_0x6071('0x9c')]};var _0x4635de={'method':_0x6071('0x9d'),'uri':_0x4a65b3+_0x6071('0x9e'),'auth':_0x1e7331,'json':!![]};return rp(_0x4635de);}})[_0x6071('0x26')](function(_0x1becc8){if(_0x1becc8[_0x6071('0x9f')][_0x6071('0x46')]>0x0){_0x2b24cc=_0x1becc8[_0x6071('0x9f')];}console[_0x6071('0xa0')]('incident\x20table\x20objects',_0x2b24cc);_0x55b529=[];_0x22816a=Object[_0x6071('0xa1')]([],_0x2b24cc);_['remove'](_0x22816a,function(_0xe4779a){return!_0x2a9dd9[_0x6071('0xa2')](_0xe4779a[_0x6071('0x29')]);});_0x22816a[_0x6071('0xa3')](function(_0x2aea92){var _0xeab605=createFieldObject(_0x1814b1,_0x1e7331,_0x2aea92[_0x6071('0xa4')],_0x2aea92[_0x6071('0x29')],_0x2aea92[_0x6071('0xa5')],![]);_0x55b529['push'](_0xeab605);});return Promise[_0x6071('0xa6')](_0x55b529);})['then'](function(_0x3d9f91){_0x4d258c=_0x3d9f91;_0x44c678=Object['assign']([],_0x2b24cc);console[_0x6071('0xa0')](_0x6071('0xa7'),_0x2b24cc);_[_0x6071('0xa8')](_0x44c678,function(_0x1fb7ad){return _0x1df38a[_0x6071('0xa2')](_0x1fb7ad['name']);});console[_0x6071('0xa0')](_0x6071('0xa9'),_0x44c678);_0x55b529=[];_0x44c678[_0x6071('0xa3')](function(_0x3e1288){var _0x21fef6=createFieldObject(_0x1814b1,_0x1e7331,_0x3e1288[_0x6071('0xa4')],_0x3e1288[_0x6071('0x29')],_0x3e1288[_0x6071('0xa5')],!![]);_0x55b529[_0x6071('0xaa')](_0x21fef6);});return Promise[_0x6071('0xa6')](_0x55b529);})[_0x6071('0x26')](function(_0x4b74ad){_0xaf3d65=_0x4b74ad;var _0x212939=_0x4d258c[_0x6071('0xab')](_0xaf3d65);return{'count':_0x212939[_0x6071('0x46')],'rows':_0x212939};})['then'](respondWithResult(_0x197dba,null))[_0x6071('0x43')](function(_0xbaee92){console['log'](_0x6071('0xac')+_0xbaee92);var _0x543c18=_0x39a19f[_0x6071('0x2f')][_0x6071('0xad')]?0x1f4:_0xbaee92['statusCode']||0x1f4;logger[_0x6071('0x27')](_0xbaee92[_0x6071('0x28')]);delete _0xbaee92[_0x6071('0x29')];if(_0x543c18===0x191){_0x543c18=0x190;}_0x197dba['status'](_0x543c18)[_0x6071('0x2a')](_0x39a19f[_0x6071('0x2f')][_0x6071('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0xbaee92['statusCode']}:_0xbaee92);});};function createFieldObject(_0x200960,_0x2c918,_0x507b08,_0x50e8ac,_0x167adb,_0x349fb7){return new Promise(function(_0x35d7bc,_0x3bfd65){var _0x54371f={'id':_0x50e8ac,'name':_0x167adb,'custom':_0x349fb7};if(_0x507b08==='boolean'){_0x54371f['options']=[{'name':'True','value':_0x6071('0xae')},{'name':_0x6071('0xaf'),'value':'false'}];_0x35d7bc(_0x54371f);}else{var _0x308185={'method':_0x6071('0x9d'),'uri':_0x200960+_0x6071('0xb0')+_0x50e8ac,'auth':_0x2c918,'json':!![]};return rp(_0x308185)[_0x6071('0x26')](function(_0x1407a7){var _0x2a08de=[];if(_0x1407a7[_0x6071('0x9f')]['length']>0x0){_0x1407a7['result'][_0x6071('0xa3')](function(_0x57ef36){if(_0x57ef36['inactive']===_0x6071('0xb1')){var _0x11193a={'name':_0x57ef36['label'],'value':_0x57ef36[_0x6071('0xb2')]};_0x2a08de[_0x6071('0xaa')](_0x11193a);}});}_0x54371f[_0x6071('0x3e')]=_0x2a08de;if(_0x54371f[_0x6071('0x3e')][_0x6071('0x46')]>0x0){_0x35d7bc(_0x54371f);}else{if(_0x349fb7==![]){_0x35d7bc();}else{_0x35d7bc(_0x54371f);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 64bd229..b04d700 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 _0xda19=['request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment'];(function(_0x4ce39a,_0x3a4fa5){var _0x692191=function(_0x365191){while(--_0x365191){_0x4ce39a['push'](_0x4ce39a['shift']());}};_0x692191(++_0x3a4fa5);}(_0xda19,0xd5));var _0x9da1=function(_0xdd639f,_0x283a95){_0xdd639f=_0xdd639f-0x0;var _0x263d11=_0xda19[_0xdd639f];return _0x263d11;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));var integrations=require(_0x9da1('0x7'));module[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return _0x2dcbc6[_0x9da1('0x9')](_0x9da1('0xa'),attributes,{'tableName':_0x9da1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x88620a,_0x1bc1d5){var _0x28983a=function(_0x2fef0c){while(--_0x2fef0c){_0x88620a['push'](_0x88620a['shift']());}};_0x28983a(++_0x1bc1d5);}(_0xeff8,0x186));var _0x8eff=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xeff8[_0x235482];return _0x5f5bea;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8eff('0x9')]=function(_0xb54063,_0x3409bc){return _0xb54063[_0x8eff('0xa')]('ServicenowAccount',attributes,{'tableName':_0x8eff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index a86dbea..1a920dc 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 _0xf959=['ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','GetServicenowAccount','ShowServicenowAccount','find','lodash','randomstring','ioredis','../../config/utils','rpc','client','http','request','then'];(function(_0x55b280,_0x169d77){var _0x161bea=function(_0x17e6b8){while(--_0x17e6b8){_0x55b280['push'](_0x55b280['shift']());}};_0x161bea(++_0x169d77);}(_0xf959,0x177));var _0x9f95=function(_0x2e852e,_0x5150b2){_0x2e852e=_0x2e852e-0x0;var _0x4439a2=_0xf959[_0x2e852e];return _0x4439a2;};'use strict';var _=require(_0x9f95('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f95('0x1'));var fs=require('fs');var Redis=require(_0x9f95('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f95('0x3'));var logger=require('../../config/logger')(_0x9f95('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f95('0x5')][_0x9f95('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x501d35,_0x111d07,_0x563adb){return new BPromise(function(_0x2f61e5,_0x429f48){return client[_0x9f95('0x7')](_0x501d35,_0x563adb)[_0x9f95('0x8')](function(_0x389827){logger['info'](_0x9f95('0x9'),_0x111d07,_0x9f95('0xa'));logger[_0x9f95('0xb')](_0x9f95('0xc'),_0x111d07,'request\x20sent',JSON[_0x9f95('0xd')](_0x389827));if(_0x389827[_0x9f95('0xe')]){if(_0x389827['error'][_0x9f95('0xf')]===0x1f4){logger[_0x9f95('0xe')](_0x9f95('0x9'),_0x111d07,_0x389827[_0x9f95('0xe')][_0x9f95('0x10')]);return _0x429f48(_0x389827[_0x9f95('0xe')][_0x9f95('0x10')]);}logger[_0x9f95('0xe')](_0x9f95('0x9'),_0x111d07,_0x389827[_0x9f95('0xe')]['message']);return _0x2f61e5(_0x389827[_0x9f95('0xe')]['message']);}else{logger[_0x9f95('0x11')](_0x9f95('0x9'),_0x111d07,'request\x20sent');_0x2f61e5(_0x389827[_0x9f95('0x12')][_0x9f95('0x10')]);}})[_0x9f95('0x13')](function(_0xad2f8c){logger[_0x9f95('0xe')](_0x9f95('0x9'),_0x111d07,_0xad2f8c);_0x429f48(_0xad2f8c);});});}exports['GetServicenowAccount']=function(_0x1fc04d){var _0x1996fe=this;return new Promise(function(_0x2eecdf,_0x5bc1f0){return db[_0x9f95('0x14')]['findAll']({'raw':_0x1fc04d[_0x9f95('0x15')]?_0x1fc04d[_0x9f95('0x15')][_0x9f95('0x16')]===undefined?!![]:![]:!![],'where':_0x1fc04d[_0x9f95('0x15')]?_0x1fc04d['options'][_0x9f95('0x17')]||null:null,'attributes':_0x1fc04d['options']?_0x1fc04d[_0x9f95('0x15')][_0x9f95('0x18')]||null:null,'limit':_0x1fc04d[_0x9f95('0x15')]?_0x1fc04d[_0x9f95('0x15')][_0x9f95('0x19')]||null:null,'include':_0x1fc04d[_0x9f95('0x15')]?_0x1fc04d[_0x9f95('0x15')][_0x9f95('0x1a')]?_['map'](_0x1fc04d[_0x9f95('0x15')]['include'],function(_0x32684d){return{'model':db[_0x32684d[_0x9f95('0x1b')]],'as':_0x32684d['as'],'attributes':_0x32684d[_0x9f95('0x18')],'include':_0x32684d['include']?_[_0x9f95('0x1c')](_0x32684d['include'],function(_0x2aab1d){return{'model':db[_0x2aab1d[_0x9f95('0x1b')]],'as':_0x2aab1d['as'],'attributes':_0x2aab1d['attributes'],'include':_0x2aab1d[_0x9f95('0x1a')]?_['map'](_0x2aab1d[_0x9f95('0x1a')],function(_0x1d1aa5){return{'model':db[_0x1d1aa5[_0x9f95('0x1b')]],'as':_0x1d1aa5['as'],'attributes':_0x1d1aa5[_0x9f95('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x588283){logger[_0x9f95('0x11')](_0x9f95('0x1d'),_0x1fc04d);logger['debug'](_0x9f95('0x1d'),_0x1fc04d,JSON['stringify'](_0x588283));_0x2eecdf(_0x588283);})[_0x9f95('0x13')](function(_0x439800){logger['error'](_0x9f95('0x1d'),_0x439800[_0x9f95('0x10')],_0x1fc04d);_0x5bc1f0(_0x1996fe[_0x9f95('0xe')](0x1f4,_0x439800[_0x9f95('0x10')]));});});};exports[_0x9f95('0x1e')]=function(_0x135679){var _0x5917dd=this;return new Promise(function(_0x15199c,_0x34139f){return db[_0x9f95('0x14')][_0x9f95('0x1f')]({'raw':_0x135679[_0x9f95('0x15')]?_0x135679[_0x9f95('0x15')][_0x9f95('0x16')]===undefined?!![]:![]:!![],'where':_0x135679['options']?_0x135679[_0x9f95('0x15')][_0x9f95('0x17')]||null:null,'attributes':_0x135679['options']?_0x135679['options']['attributes']||null:null,'include':_0x135679['options']?_0x135679[_0x9f95('0x15')]['include']?_[_0x9f95('0x1c')](_0x135679[_0x9f95('0x15')][_0x9f95('0x1a')],function(_0xc82d8){return{'model':db[_0xc82d8[_0x9f95('0x1b')]],'as':_0xc82d8['as'],'attributes':_0xc82d8[_0x9f95('0x18')],'include':_0xc82d8[_0x9f95('0x1a')]?_['map'](_0xc82d8[_0x9f95('0x1a')],function(_0x503297){return{'model':db[_0x503297[_0x9f95('0x1b')]],'as':_0x503297['as'],'attributes':_0x503297[_0x9f95('0x18')],'include':_0x503297[_0x9f95('0x1a')]?_[_0x9f95('0x1c')](_0x503297[_0x9f95('0x1a')],function(_0x461544){return{'model':db[_0x461544[_0x9f95('0x1b')]],'as':_0x461544['as'],'attributes':_0x461544[_0x9f95('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17a75e){logger[_0x9f95('0x11')](_0x9f95('0x1e'),_0x135679);logger[_0x9f95('0xb')](_0x9f95('0x1e'),_0x135679,JSON[_0x9f95('0xd')](_0x17a75e));_0x15199c(_0x17a75e);})[_0x9f95('0x13')](function(_0xc27ad9){logger[_0x9f95('0xe')](_0x9f95('0x1e'),_0xc27ad9['message'],_0x135679);_0x34139f(_0x5917dd[_0x9f95('0xe')](0x1f4,_0xc27ad9[_0x9f95('0x10')]));});});}; \ No newline at end of file +var _0x136f=['ServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowServicenowAccount'];(function(_0xe35fa1,_0xa75391){var _0x59c5de=function(_0x4937ac){while(--_0x4937ac){_0xe35fa1['push'](_0xe35fa1['shift']());}};_0x59c5de(++_0xa75391);}(_0x136f,0x1ca));var _0xf136=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x136f[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0xf136('0x0'));var util=require(_0xf136('0x1'));var moment=require(_0xf136('0x2'));var BPromise=require(_0xf136('0x3'));var rs=require(_0xf136('0x4'));var fs=require('fs');var Redis=require(_0xf136('0x5'));var db=require(_0xf136('0x6'))['db'];var utils=require(_0xf136('0x7'));var logger=require('../../config/logger')(_0xf136('0x8'));var config=require(_0xf136('0x9'));var jayson=require(_0xf136('0xa'));var client=jayson[_0xf136('0xb')][_0xf136('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b4242,_0xfce5e0,_0x44fd7c){return new BPromise(function(_0x105f72,_0x41ba3d){return client[_0xf136('0xd')](_0x4b4242,_0x44fd7c)['then'](function(_0x43dd1d){logger[_0xf136('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0xfce5e0,_0xf136('0xf'));logger[_0xf136('0x10')](_0xf136('0x11'),_0xfce5e0,_0xf136('0xf'),JSON[_0xf136('0x12')](_0x43dd1d));if(_0x43dd1d[_0xf136('0x13')]){if(_0x43dd1d[_0xf136('0x13')]['code']===0x1f4){logger['error'](_0xf136('0x14'),_0xfce5e0,_0x43dd1d[_0xf136('0x13')][_0xf136('0x15')]);return _0x41ba3d(_0x43dd1d[_0xf136('0x13')][_0xf136('0x15')]);}logger[_0xf136('0x13')](_0xf136('0x14'),_0xfce5e0,_0x43dd1d[_0xf136('0x13')][_0xf136('0x15')]);return _0x105f72(_0x43dd1d[_0xf136('0x13')]['message']);}else{logger[_0xf136('0xe')](_0xf136('0x14'),_0xfce5e0,_0xf136('0xf'));_0x105f72(_0x43dd1d[_0xf136('0x16')][_0xf136('0x15')]);}})[_0xf136('0x17')](function(_0xc1cc2b){logger[_0xf136('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0xfce5e0,_0xc1cc2b);_0x41ba3d(_0xc1cc2b);});});}exports[_0xf136('0x18')]=function(_0x182f2a){var _0x56012c=this;return new Promise(function(_0x1a66f9,_0x45b214){return db['ServicenowAccount'][_0xf136('0x19')]({'raw':_0x182f2a['options']?_0x182f2a[_0xf136('0x1a')][_0xf136('0x1b')]===undefined?!![]:![]:!![],'where':_0x182f2a[_0xf136('0x1a')]?_0x182f2a[_0xf136('0x1a')][_0xf136('0x1c')]||null:null,'attributes':_0x182f2a[_0xf136('0x1a')]?_0x182f2a['options'][_0xf136('0x1d')]||null:null,'limit':_0x182f2a['options']?_0x182f2a[_0xf136('0x1a')][_0xf136('0x1e')]||null:null,'include':_0x182f2a[_0xf136('0x1a')]?_0x182f2a[_0xf136('0x1a')][_0xf136('0x1f')]?_[_0xf136('0x20')](_0x182f2a['options'][_0xf136('0x1f')],function(_0x7ef156){return{'model':db[_0x7ef156[_0xf136('0x21')]],'as':_0x7ef156['as'],'attributes':_0x7ef156[_0xf136('0x1d')],'include':_0x7ef156[_0xf136('0x1f')]?_[_0xf136('0x20')](_0x7ef156['include'],function(_0x2183ba){return{'model':db[_0x2183ba[_0xf136('0x21')]],'as':_0x2183ba['as'],'attributes':_0x2183ba[_0xf136('0x1d')],'include':_0x2183ba['include']?_['map'](_0x2183ba[_0xf136('0x1f')],function(_0xb30b6e){return{'model':db[_0xb30b6e[_0xf136('0x21')]],'as':_0xb30b6e['as'],'attributes':_0xb30b6e[_0xf136('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf136('0x22')](function(_0x5e557e){logger['info'](_0xf136('0x18'),_0x182f2a);logger[_0xf136('0x10')](_0xf136('0x18'),_0x182f2a,JSON[_0xf136('0x12')](_0x5e557e));_0x1a66f9(_0x5e557e);})[_0xf136('0x17')](function(_0xed1599){logger[_0xf136('0x13')]('GetServicenowAccount',_0xed1599[_0xf136('0x15')],_0x182f2a);_0x45b214(_0x56012c[_0xf136('0x13')](0x1f4,_0xed1599[_0xf136('0x15')]));});});};exports[_0xf136('0x23')]=function(_0x199b5e){var _0x46935e=this;return new Promise(function(_0x58ec7c,_0x3cfe99){return db[_0xf136('0x24')][_0xf136('0x25')]({'raw':_0x199b5e[_0xf136('0x1a')]?_0x199b5e[_0xf136('0x1a')][_0xf136('0x1b')]===undefined?!![]:![]:!![],'where':_0x199b5e['options']?_0x199b5e[_0xf136('0x1a')]['where']||null:null,'attributes':_0x199b5e['options']?_0x199b5e[_0xf136('0x1a')][_0xf136('0x1d')]||null:null,'include':_0x199b5e[_0xf136('0x1a')]?_0x199b5e[_0xf136('0x1a')][_0xf136('0x1f')]?_[_0xf136('0x20')](_0x199b5e[_0xf136('0x1a')][_0xf136('0x1f')],function(_0x51d911){return{'model':db[_0x51d911['model']],'as':_0x51d911['as'],'attributes':_0x51d911[_0xf136('0x1d')],'include':_0x51d911[_0xf136('0x1f')]?_['map'](_0x51d911[_0xf136('0x1f')],function(_0x164262){return{'model':db[_0x164262[_0xf136('0x21')]],'as':_0x164262['as'],'attributes':_0x164262[_0xf136('0x1d')],'include':_0x164262[_0xf136('0x1f')]?_['map'](_0x164262[_0xf136('0x1f')],function(_0x3487d8){return{'model':db[_0x3487d8[_0xf136('0x21')]],'as':_0x3487d8['as'],'attributes':_0x3487d8[_0xf136('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf136('0x22')](function(_0x524e58){logger[_0xf136('0xe')](_0xf136('0x23'),_0x199b5e);logger[_0xf136('0x10')](_0xf136('0x23'),_0x199b5e,JSON[_0xf136('0x12')](_0x524e58));_0x58ec7c(_0x524e58);})[_0xf136('0x17')](function(_0x178e19){logger[_0xf136('0x13')](_0xf136('0x23'),_0x178e19['message'],_0x199b5e);_0x3cfe99(_0x46935e[_0xf136('0x13')](0x1f4,_0x178e19[_0xf136('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b526fb1..e7cfb96 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 _0x7da1=['get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da1,0x1f3));var _0x17da=function(_0x324440,_0x541bf6){_0x324440=_0x324440-0x0;var _0x46182d=_0x7da1[_0x324440];return _0x46182d;};'use strict';var multer=require('multer');var util=require(_0x17da('0x0'));var path=require(_0x17da('0x1'));var timeout=require('connect-timeout');var express=require(_0x17da('0x2'));var router=express[_0x17da('0x3')]();var fs_extra=require(_0x17da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x17da('0x5'));var config=require('../../config/environment');var controller=require(_0x17da('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x17da('0x7')](_0x17da('0x8'),auth[_0x17da('0x9')](),controller[_0x17da('0xa')]);router[_0x17da('0x7')](_0x17da('0xb'),auth[_0x17da('0x9')](),controller[_0x17da('0xc')]);router[_0x17da('0x7')](_0x17da('0xd'),auth[_0x17da('0x9')](),controller[_0x17da('0xe')]);router['get'](_0x17da('0xf'),auth[_0x17da('0x9')](),controller[_0x17da('0x10')]);router[_0x17da('0x11')]('/',auth['isAuthenticated'](),controller[_0x17da('0x12')]);router[_0x17da('0x13')](_0x17da('0x8'),auth[_0x17da('0x9')](),controller[_0x17da('0x14')]);router[_0x17da('0x15')](_0x17da('0x8'),auth[_0x17da('0x9')](),controller['destroy']);module[_0x17da('0x16')]=router; \ No newline at end of file +var _0x78a4=['../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','put','delete','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xa76f70,_0x115a75){var _0x24459b=function(_0x425831){while(--_0x425831){_0xa76f70['push'](_0xa76f70['shift']());}};_0x24459b(++_0x115a75);}(_0x78a4,0xfe));var _0x478a=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x78a4[_0x3e531a];return _0x3c2574;};'use strict';var multer=require(_0x478a('0x0'));var util=require(_0x478a('0x1'));var path=require(_0x478a('0x2'));var timeout=require(_0x478a('0x3'));var express=require('express');var router=express[_0x478a('0x4')]();var fs_extra=require(_0x478a('0x5'));var auth=require(_0x478a('0x6'));var interaction=require(_0x478a('0x7'));var config=require('../../config/environment');var controller=require(_0x478a('0x8'));router[_0x478a('0x9')]('/',auth[_0x478a('0xa')](),controller['index']);router[_0x478a('0x9')](_0x478a('0xb'),auth[_0x478a('0xa')](),controller[_0x478a('0xc')]);router[_0x478a('0x9')](_0x478a('0xd'),auth['isAuthenticated'](),controller[_0x478a('0xe')]);router[_0x478a('0x9')]('/:id/subjects',auth[_0x478a('0xa')](),controller['getSubjects']);router[_0x478a('0x9')](_0x478a('0xf'),auth[_0x478a('0xa')](),controller[_0x478a('0x10')]);router[_0x478a('0x11')]('/',auth[_0x478a('0xa')](),controller['create']);router[_0x478a('0x12')](_0x478a('0xb'),auth[_0x478a('0xa')](),controller['update']);router[_0x478a('0x13')](_0x478a('0xb'),auth[_0x478a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 189297b..331809b 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 _0xe909=['STRING','sequelize'];(function(_0x5be8db,_0x1f198f){var _0x2e8b8b=function(_0x3c9905){while(--_0x3c9905){_0x5be8db['push'](_0x5be8db['shift']());}};_0x2e8b8b(++_0x1f198f);}(_0xe909,0xd5));var _0x9e90=function(_0x56986e,_0x28a678){_0x56986e=_0x56986e-0x0;var _0x19224f=_0xe909[_0x56986e];return _0x19224f;};'use strict';var Sequelize=require(_0x9e90('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9e90('0x1')]}}; \ No newline at end of file +var _0x4ff4=['STRING'];(function(_0xc2f39,_0x2d8a78){var _0x5cef84=function(_0x1df374){while(--_0x1df374){_0xc2f39['push'](_0xc2f39['shift']());}};_0x5cef84(++_0x2d8a78);}(_0x4ff4,0xf6));var _0x44ff=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x4ff4[_0x40a825];return _0x273a54;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x44ff('0x0')]},'description':{'type':Sequelize[_0x44ff('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index bf3d8a4..d1342c7 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 _0x87d0=['offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','where','catch','show','params','includeAll','find','create','body','destroy','getFields','findOne','ServicenowField','pick','options','keys','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87d0,0x11f));var _0x087d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x87d0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x087d('0x0'));var rimraf=require(_0x087d('0x1'));var zipdir=require(_0x087d('0x2'));var jsonpatch=require(_0x087d('0x3'));var rp=require(_0x087d('0x4'));var moment=require('moment');var BPromise=require(_0x087d('0x5'));var Mustache=require(_0x087d('0x6'));var util=require(_0x087d('0x7'));var path=require(_0x087d('0x8'));var sox=require('sox');var csv=require(_0x087d('0x9'));var ejs=require(_0x087d('0xa'));var fs=require('fs');var fs_extra=require(_0x087d('0xb'));var _=require(_0x087d('0xc'));var squel=require(_0x087d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x087d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x087d('0xf'));var Redis=require(_0x087d('0x10'));var authService=require(_0x087d('0x11'));var qs=require(_0x087d('0x12'));var as=require(_0x087d('0x13'));var hardwareService=require(_0x087d('0x14'));var logger=require(_0x087d('0x15'))('api');var utils=require(_0x087d('0x16'));var config=require(_0x087d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x087d('0x18'))['db'];function respondWithStatusCode(_0x2a8f90,_0x1d1492){_0x1d1492=_0x1d1492||0xcc;return function(_0x4e4a7f){if(_0x4e4a7f){return _0x2a8f90[_0x087d('0x19')](_0x1d1492);}return _0x2a8f90['status'](_0x1d1492)[_0x087d('0x1a')]();};}function respondWithResult(_0xaa6282,_0x27527e){_0x27527e=_0x27527e||0xc8;return function(_0x507fd5){if(_0x507fd5){return _0xaa6282[_0x087d('0x1b')](_0x27527e)[_0x087d('0x1c')](_0x507fd5);}};}function respondWithFilteredResult(_0x539ee2,_0x2adc53){return function(_0x21108e){if(_0x21108e){var _0x4c1488=typeof _0x2adc53[_0x087d('0x1d')]==='undefined'&&typeof _0x2adc53[_0x087d('0x1e')]===_0x087d('0x1f');var _0x24a86a=_0x21108e[_0x087d('0x20')];var _0x2325b3=_0x4c1488?0x0:_0x2adc53[_0x087d('0x1d')];var _0x1305bf=_0x4c1488?_0x21108e[_0x087d('0x20')]:_0x2adc53[_0x087d('0x1d')]+_0x2adc53[_0x087d('0x1e')];var _0x527bb7;if(_0x1305bf>=_0x24a86a){_0x1305bf=_0x24a86a;_0x527bb7=0xc8;}else{_0x527bb7=0xce;}_0x539ee2[_0x087d('0x1b')](_0x527bb7);return _0x539ee2['set'](_0x087d('0x21'),_0x2325b3+'-'+_0x1305bf+'/'+_0x24a86a)['json'](_0x21108e);}return null;};}function patchUpdates(_0x3dc73d){return function(_0x2fd445){try{jsonpatch[_0x087d('0x22')](_0x2fd445,_0x3dc73d,!![]);}catch(_0x24241b){return BPromise[_0x087d('0x23')](_0x24241b);}return _0x2fd445[_0x087d('0x24')]();};}function saveUpdates(_0x1e22c0,_0x4a034a){return function(_0x36a31b){if(_0x36a31b){return _0x36a31b[_0x087d('0x25')](_0x1e22c0)[_0x087d('0x26')](function(_0x4454c0){return _0x4454c0;});}return null;};}function removeEntity(_0x735485,_0x5c3213){return function(_0x186176){if(_0x186176){return _0x186176['destroy']()['then'](function(){_0x735485[_0x087d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58c61b,_0x4ae4a1){return function(_0x51ccc4){if(!_0x51ccc4){_0x58c61b['sendStatus'](0x194);}return _0x51ccc4;};}function handleError(_0x1cbe5a,_0x178b7c){_0x178b7c=_0x178b7c||0x1f4;return function(_0x54386b){logger[_0x087d('0x27')](_0x54386b['stack']);if(_0x54386b[_0x087d('0x28')]){delete _0x54386b['name'];}_0x1cbe5a[_0x087d('0x1b')](_0x178b7c)[_0x087d('0x29')](_0x54386b);};}exports[_0x087d('0x2a')]=function(_0x2441f2,_0x3b1404){var _0xcbbea3={},_0x262625={},_0x273d45={'count':0x0,'rows':[]};var _0x125ef2=_[_0x087d('0x2b')](db[_0x087d('0x2c')][_0x087d('0x2d')],function(_0x142990){return{'name':_0x142990[_0x087d('0x2e')],'type':_0x142990[_0x087d('0x2f')]['key']};});_0x262625[_0x087d('0x30')]=_[_0x087d('0x2b')](_0x125ef2,_0x087d('0x28'));_0x262625[_0x087d('0x31')]=_['keys'](_0x2441f2['query']);_0x262625[_0x087d('0x32')]=_[_0x087d('0x33')](_0x262625[_0x087d('0x30')],_0x262625['query']);_0xcbbea3[_0x087d('0x34')]=_['intersection'](_0x262625[_0x087d('0x30')],qs[_0x087d('0x35')](_0x2441f2['query'][_0x087d('0x35')]));_0xcbbea3['attributes']=_0xcbbea3[_0x087d('0x34')][_0x087d('0x36')]?_0xcbbea3[_0x087d('0x34')]:_0x262625[_0x087d('0x30')];if(!_0x2441f2[_0x087d('0x31')][_0x087d('0x37')](_0x087d('0x38'))){_0xcbbea3[_0x087d('0x1e')]=qs[_0x087d('0x1e')](_0x2441f2[_0x087d('0x31')][_0x087d('0x1e')]);_0xcbbea3[_0x087d('0x1d')]=qs[_0x087d('0x1d')](_0x2441f2[_0x087d('0x31')][_0x087d('0x1d')]);}_0xcbbea3[_0x087d('0x39')]=qs[_0x087d('0x3a')](_0x2441f2[_0x087d('0x31')]['sort']);_0xcbbea3['where']=qs[_0x087d('0x32')](_['pick'](_0x2441f2[_0x087d('0x31')],_0x262625[_0x087d('0x32')]),_0x125ef2);if(_0x2441f2[_0x087d('0x31')][_0x087d('0x3b')]){_0xcbbea3['where']=_[_0x087d('0x3c')](_0xcbbea3['where'],{'$or':_[_0x087d('0x2b')](_0x125ef2,function(_0x79f0d0){if(_0x79f0d0['type']!==_0x087d('0x3d')){var _0x3e82aa={};_0x3e82aa[_0x79f0d0['name']]={'$like':'%'+_0x2441f2[_0x087d('0x31')][_0x087d('0x3b')]+'%'};return _0x3e82aa;}})});}_0xcbbea3=_[_0x087d('0x3c')]({},_0xcbbea3,_0x2441f2['options']);var _0x227454={'where':_0xcbbea3[_0x087d('0x3e')]};return db[_0x087d('0x2c')][_0x087d('0x20')](_0x227454)[_0x087d('0x26')](function(_0x341da3){_0x273d45[_0x087d('0x20')]=_0x341da3;if(_0x2441f2[_0x087d('0x31')]['includeAll']){_0xcbbea3['include']=[{'all':!![]}];}return db[_0x087d('0x2c')]['findAll'](_0xcbbea3);})['then'](function(_0x644a9f){_0x273d45['rows']=_0x644a9f;return _0x273d45;})[_0x087d('0x26')](respondWithFilteredResult(_0x3b1404,_0xcbbea3))[_0x087d('0x3f')](handleError(_0x3b1404,null));};exports[_0x087d('0x40')]=function(_0x17a9c4,_0xb92db7){var _0x52ad64={'raw':![],'where':{'id':_0x17a9c4[_0x087d('0x41')]['id']}},_0x47f675={};_0x47f675[_0x087d('0x30')]=_['keys'](db[_0x087d('0x2c')][_0x087d('0x2d')]);_0x47f675[_0x087d('0x31')]=_['keys'](_0x17a9c4[_0x087d('0x31')]);_0x47f675['filters']=_[_0x087d('0x33')](_0x47f675[_0x087d('0x30')],_0x47f675[_0x087d('0x31')]);_0x52ad64[_0x087d('0x34')]=_['intersection'](_0x47f675[_0x087d('0x30')],qs['fields'](_0x17a9c4[_0x087d('0x31')][_0x087d('0x35')]));_0x52ad64[_0x087d('0x34')]=_0x52ad64[_0x087d('0x34')]['length']?_0x52ad64['attributes']:_0x47f675[_0x087d('0x30')];if(_0x17a9c4[_0x087d('0x31')][_0x087d('0x42')]){_0x52ad64['include']=[{'all':!![]}];}_0x52ad64=_[_0x087d('0x3c')]({},_0x52ad64,_0x17a9c4['options']);return db['ServicenowConfiguration'][_0x087d('0x43')](_0x52ad64)['then'](handleEntityNotFound(_0xb92db7,null))[_0x087d('0x26')](respondWithResult(_0xb92db7,null))['catch'](handleError(_0xb92db7,null));};exports[_0x087d('0x44')]=function(_0x5e9d73,_0x3d586f){return db[_0x087d('0x2c')][_0x087d('0x44')](_0x5e9d73[_0x087d('0x45')],{})[_0x087d('0x26')](respondWithResult(_0x3d586f,0xc9))[_0x087d('0x3f')](handleError(_0x3d586f,null));};exports[_0x087d('0x25')]=function(_0x1cfd37,_0x4d1671){if(_0x1cfd37['body']['id']){delete _0x1cfd37[_0x087d('0x45')]['id'];}return db['ServicenowConfiguration'][_0x087d('0x43')]({'where':{'id':_0x1cfd37[_0x087d('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d1671,null))[_0x087d('0x26')](saveUpdates(_0x1cfd37[_0x087d('0x45')],null))[_0x087d('0x26')](respondWithResult(_0x4d1671,null))['catch'](handleError(_0x4d1671,null));};exports[_0x087d('0x46')]=function(_0x59a518,_0x56b5fb){return db[_0x087d('0x2c')][_0x087d('0x43')]({'where':{'id':_0x59a518['params']['id']}})['then'](handleEntityNotFound(_0x56b5fb,null))[_0x087d('0x26')](removeEntity(_0x56b5fb,null))['catch'](handleError(_0x56b5fb,null));};exports[_0x087d('0x47')]=function(_0x415eb3,_0x18b9fa,_0x3c9a71){var _0x15fd5b={};var _0x12cb06={};var _0x5940f2;var _0x593e2d;return db[_0x087d('0x2c')][_0x087d('0x48')]({'where':{'id':_0x415eb3[_0x087d('0x41')]['id']}})[_0x087d('0x26')](handleEntityNotFound(_0x18b9fa,null))['then'](function(_0x5d87ce){if(_0x5d87ce){_0x5940f2=_0x5d87ce;_0x12cb06[_0x087d('0x30')]=_['keys'](db[_0x087d('0x49')][_0x087d('0x2d')]);_0x12cb06[_0x087d('0x31')]=_['keys'](_0x415eb3[_0x087d('0x31')]);_0x12cb06[_0x087d('0x32')]=_[_0x087d('0x33')](_0x12cb06['model'],_0x12cb06[_0x087d('0x31')]);_0x15fd5b[_0x087d('0x34')]=_['intersection'](_0x12cb06[_0x087d('0x30')],qs['fields'](_0x415eb3[_0x087d('0x31')][_0x087d('0x35')]));_0x15fd5b[_0x087d('0x34')]=_0x15fd5b[_0x087d('0x34')]['length']?_0x15fd5b[_0x087d('0x34')]:_0x12cb06[_0x087d('0x30')];_0x15fd5b['order']=qs['sort'](_0x415eb3[_0x087d('0x31')][_0x087d('0x3a')]);_0x15fd5b['where']=qs[_0x087d('0x32')](_[_0x087d('0x4a')](_0x415eb3[_0x087d('0x31')],_0x12cb06[_0x087d('0x32')]));if(_0x415eb3['query'][_0x087d('0x3b')]){_0x15fd5b['where']=_[_0x087d('0x3c')](_0x15fd5b[_0x087d('0x3e')],{'$or':_[_0x087d('0x2b')](_0x15fd5b['attributes'],function(_0xbdb776){var _0x338f29={};_0x338f29[_0xbdb776]={'$like':'%'+_0x415eb3[_0x087d('0x31')][_0x087d('0x3b')]+'%'};return _0x338f29;})});}_0x15fd5b=_[_0x087d('0x3c')]({},_0x15fd5b,_0x415eb3[_0x087d('0x4b')]);return _0x5940f2[_0x087d('0x47')](_0x15fd5b);}})[_0x087d('0x26')](function(_0x16bd15){if(_0x16bd15){_0x593e2d=_0x16bd15['length'];if(!_0x415eb3['query'][_0x087d('0x37')](_0x087d('0x38'))){_0x15fd5b[_0x087d('0x1e')]=qs[_0x087d('0x1e')](_0x415eb3[_0x087d('0x31')]['limit']);_0x15fd5b[_0x087d('0x1d')]=qs[_0x087d('0x1d')](_0x415eb3[_0x087d('0x31')][_0x087d('0x1d')]);}return _0x5940f2['getFields'](_0x15fd5b);}})[_0x087d('0x26')](function(_0x2503dc){if(_0x2503dc){return _0x2503dc?{'count':_0x593e2d,'rows':_0x2503dc}:null;}})[_0x087d('0x26')](respondWithResult(_0x18b9fa,null))[_0x087d('0x3f')](handleError(_0x18b9fa,null));};exports['getSubjects']=function(_0x3f094a,_0x2ed09d,_0xacb94){var _0x235198={};var _0x491188={};var _0x528f33;var _0x5b2194;return db[_0x087d('0x2c')][_0x087d('0x48')]({'where':{'id':_0x3f094a[_0x087d('0x41')]['id']}})[_0x087d('0x26')](handleEntityNotFound(_0x2ed09d,null))[_0x087d('0x26')](function(_0x281bd0){if(_0x281bd0){_0x528f33=_0x281bd0;_0x491188['model']=_[_0x087d('0x4c')](db['ServicenowField'][_0x087d('0x2d')]);_0x491188[_0x087d('0x31')]=_[_0x087d('0x4c')](_0x3f094a['query']);_0x491188[_0x087d('0x32')]=_['intersection'](_0x491188[_0x087d('0x30')],_0x491188[_0x087d('0x31')]);_0x235198[_0x087d('0x34')]=_[_0x087d('0x33')](_0x491188['model'],qs[_0x087d('0x35')](_0x3f094a['query'][_0x087d('0x35')]));_0x235198[_0x087d('0x34')]=_0x235198[_0x087d('0x34')]['length']?_0x235198[_0x087d('0x34')]:_0x491188['model'];_0x235198[_0x087d('0x39')]=qs[_0x087d('0x3a')](_0x3f094a['query'][_0x087d('0x3a')]);_0x235198['where']=qs[_0x087d('0x32')](_[_0x087d('0x4a')](_0x3f094a['query'],_0x491188[_0x087d('0x32')]));if(_0x3f094a[_0x087d('0x31')][_0x087d('0x3b')]){_0x235198[_0x087d('0x3e')]=_[_0x087d('0x3c')](_0x235198['where'],{'$or':_[_0x087d('0x2b')](_0x235198[_0x087d('0x34')],function(_0x3e4f3c){var _0x1c93e1={};_0x1c93e1[_0x3e4f3c]={'$like':'%'+_0x3f094a[_0x087d('0x31')][_0x087d('0x3b')]+'%'};return _0x1c93e1;})});}_0x235198=_[_0x087d('0x3c')]({},_0x235198,_0x3f094a[_0x087d('0x4b')]);return _0x528f33[_0x087d('0x4d')](_0x235198);}})[_0x087d('0x26')](function(_0x4a64a7){if(_0x4a64a7){_0x5b2194=_0x4a64a7[_0x087d('0x36')];if(!_0x3f094a[_0x087d('0x31')]['hasOwnProperty'](_0x087d('0x38'))){_0x235198['limit']=qs['limit'](_0x3f094a['query'][_0x087d('0x1e')]);_0x235198['offset']=qs[_0x087d('0x1d')](_0x3f094a[_0x087d('0x31')][_0x087d('0x1d')]);}return _0x528f33[_0x087d('0x4d')](_0x235198);}})[_0x087d('0x26')](function(_0x511fd3){if(_0x511fd3){return _0x511fd3?{'count':_0x5b2194,'rows':_0x511fd3}:null;}})[_0x087d('0x26')](respondWithResult(_0x2ed09d,null))[_0x087d('0x3f')](handleError(_0x2ed09d,null));};exports[_0x087d('0x4e')]=function(_0x464756,_0x241109,_0x3e742e){var _0x27c067={};var _0x257c7e={};var _0x103cba;var _0x32fe2a;return db[_0x087d('0x2c')][_0x087d('0x48')]({'where':{'id':_0x464756[_0x087d('0x41')]['id']}})[_0x087d('0x26')](handleEntityNotFound(_0x241109,null))[_0x087d('0x26')](function(_0x1aad5b){if(_0x1aad5b){_0x103cba=_0x1aad5b;_0x257c7e[_0x087d('0x30')]=_['keys'](db[_0x087d('0x49')][_0x087d('0x2d')]);_0x257c7e[_0x087d('0x31')]=_[_0x087d('0x4c')](_0x464756[_0x087d('0x31')]);_0x257c7e[_0x087d('0x32')]=_['intersection'](_0x257c7e[_0x087d('0x30')],_0x257c7e[_0x087d('0x31')]);_0x27c067[_0x087d('0x34')]=_[_0x087d('0x33')](_0x257c7e[_0x087d('0x30')],qs[_0x087d('0x35')](_0x464756['query'][_0x087d('0x35')]));_0x27c067[_0x087d('0x34')]=_0x27c067[_0x087d('0x34')][_0x087d('0x36')]?_0x27c067[_0x087d('0x34')]:_0x257c7e['model'];_0x27c067['order']=qs[_0x087d('0x3a')](_0x464756[_0x087d('0x31')][_0x087d('0x3a')]);_0x27c067['where']=qs[_0x087d('0x32')](_[_0x087d('0x4a')](_0x464756[_0x087d('0x31')],_0x257c7e[_0x087d('0x32')]));if(_0x464756[_0x087d('0x31')][_0x087d('0x3b')]){_0x27c067['where']=_[_0x087d('0x3c')](_0x27c067[_0x087d('0x3e')],{'$or':_[_0x087d('0x2b')](_0x27c067[_0x087d('0x34')],function(_0x2ea6a9){var _0x493339={};_0x493339[_0x2ea6a9]={'$like':'%'+_0x464756[_0x087d('0x31')]['filter']+'%'};return _0x493339;})});}_0x27c067=_[_0x087d('0x3c')]({},_0x27c067,_0x464756['options']);return _0x103cba[_0x087d('0x4e')](_0x27c067);}})[_0x087d('0x26')](function(_0x26cabb){if(_0x26cabb){_0x32fe2a=_0x26cabb[_0x087d('0x36')];if(!_0x464756[_0x087d('0x31')][_0x087d('0x37')](_0x087d('0x38'))){_0x27c067['limit']=qs['limit'](_0x464756[_0x087d('0x31')][_0x087d('0x1e')]);_0x27c067[_0x087d('0x1d')]=qs[_0x087d('0x1d')](_0x464756[_0x087d('0x31')][_0x087d('0x1d')]);}return _0x103cba[_0x087d('0x4e')](_0x27c067);}})[_0x087d('0x26')](function(_0x241113){if(_0x241113){return _0x241113?{'count':_0x32fe2a,'rows':_0x241113}:null;}})[_0x087d('0x26')](respondWithResult(_0x241109,null))[_0x087d('0x3f')](handleError(_0x241109,null));}; \ No newline at end of file +var _0xba94=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','map','VIRTUAL','ServicenowConfiguration','findAll','catch','show','params','includeAll','include','options','find','create','body','getFields','ServicenowField','filter','getSubjects','pick','getDescriptions','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0xfcc0e,_0x1da886){var _0x32bb2e=function(_0x4c627c){while(--_0x4c627c){_0xfcc0e['push'](_0xfcc0e['shift']());}};_0x32bb2e(++_0x1da886);}(_0xba94,0x18c));var _0x4ba9=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xba94[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0x4ba9('0x0'));var rimraf=require(_0x4ba9('0x1'));var zipdir=require(_0x4ba9('0x2'));var jsonpatch=require(_0x4ba9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ba9('0x4'));var Mustache=require(_0x4ba9('0x5'));var util=require(_0x4ba9('0x6'));var path=require(_0x4ba9('0x7'));var sox=require(_0x4ba9('0x8'));var csv=require('to-csv');var ejs=require(_0x4ba9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ba9('0xa'));var squel=require(_0x4ba9('0xb'));var crypto=require(_0x4ba9('0xc'));var jsforce=require(_0x4ba9('0xd'));var deskjs=require(_0x4ba9('0xe'));var toCsv=require(_0x4ba9('0xf'));var querystring=require(_0x4ba9('0x10'));var Papa=require(_0x4ba9('0x11'));var Redis=require(_0x4ba9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4ba9('0x13'));var as=require(_0x4ba9('0x14'));var hardwareService=require(_0x4ba9('0x15'));var logger=require(_0x4ba9('0x16'))(_0x4ba9('0x17'));var utils=require(_0x4ba9('0x18'));var config=require(_0x4ba9('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337d8f,_0x4878cb){_0x4878cb=_0x4878cb||0xcc;return function(_0x2b914b){if(_0x2b914b){return _0x337d8f[_0x4ba9('0x1a')](_0x4878cb);}return _0x337d8f['status'](_0x4878cb)[_0x4ba9('0x1b')]();};}function respondWithResult(_0x21f88f,_0x54644a){_0x54644a=_0x54644a||0xc8;return function(_0x1e9ee8){if(_0x1e9ee8){return _0x21f88f[_0x4ba9('0x1c')](_0x54644a)[_0x4ba9('0x1d')](_0x1e9ee8);}};}function respondWithFilteredResult(_0x37636c,_0x28d080){return function(_0x1cc66b){if(_0x1cc66b){var _0x3ec688=typeof _0x28d080[_0x4ba9('0x1e')]==='undefined'&&typeof _0x28d080[_0x4ba9('0x1f')]===_0x4ba9('0x20');var _0x52ed02=_0x1cc66b[_0x4ba9('0x21')];var _0xefbc30=_0x3ec688?0x0:_0x28d080[_0x4ba9('0x1e')];var _0x1adeb3=_0x3ec688?_0x1cc66b[_0x4ba9('0x21')]:_0x28d080['offset']+_0x28d080['limit'];var _0xc3f717;if(_0x1adeb3>=_0x52ed02){_0x1adeb3=_0x52ed02;_0xc3f717=0xc8;}else{_0xc3f717=0xce;}_0x37636c[_0x4ba9('0x1c')](_0xc3f717);return _0x37636c[_0x4ba9('0x22')]('Content-Range',_0xefbc30+'-'+_0x1adeb3+'/'+_0x52ed02)[_0x4ba9('0x1d')](_0x1cc66b);}return null;};}function patchUpdates(_0x21209a){return function(_0x2aa935){try{jsonpatch['apply'](_0x2aa935,_0x21209a,!![]);}catch(_0x28faf4){return BPromise[_0x4ba9('0x23')](_0x28faf4);}return _0x2aa935[_0x4ba9('0x24')]();};}function saveUpdates(_0x204f21,_0x2f2fa9){return function(_0x14d46b){if(_0x14d46b){return _0x14d46b[_0x4ba9('0x25')](_0x204f21)[_0x4ba9('0x26')](function(_0x26ba8e){return _0x26ba8e;});}return null;};}function removeEntity(_0x46a050,_0x123d65){return function(_0x3a0d90){if(_0x3a0d90){return _0x3a0d90[_0x4ba9('0x27')]()[_0x4ba9('0x26')](function(){_0x46a050['status'](0xcc)[_0x4ba9('0x1b')]();});}};}function handleEntityNotFound(_0x4a6ad6,_0x542dd8){return function(_0x36d6d9){if(!_0x36d6d9){_0x4a6ad6[_0x4ba9('0x1a')](0x194);}return _0x36d6d9;};}function handleError(_0x5ded79,_0x154787){_0x154787=_0x154787||0x1f4;return function(_0x3738f7){logger[_0x4ba9('0x28')](_0x3738f7[_0x4ba9('0x29')]);if(_0x3738f7[_0x4ba9('0x2a')]){delete _0x3738f7[_0x4ba9('0x2a')];}_0x5ded79[_0x4ba9('0x1c')](_0x154787)['send'](_0x3738f7);};}exports[_0x4ba9('0x2b')]=function(_0x95e81d,_0x3affcf){var _0x298c24={},_0x2c2e6f={},_0x30f77f={'count':0x0,'rows':[]};var _0x4ac0d0=_['map'](db['ServicenowConfiguration'][_0x4ba9('0x2c')],function(_0x12f5a8){return{'name':_0x12f5a8[_0x4ba9('0x2d')],'type':_0x12f5a8[_0x4ba9('0x2e')]['key']};});_0x2c2e6f['model']=_['map'](_0x4ac0d0,_0x4ba9('0x2a'));_0x2c2e6f['query']=_[_0x4ba9('0x2f')](_0x95e81d[_0x4ba9('0x30')]);_0x2c2e6f[_0x4ba9('0x31')]=_[_0x4ba9('0x32')](_0x2c2e6f[_0x4ba9('0x33')],_0x2c2e6f['query']);_0x298c24[_0x4ba9('0x34')]=_[_0x4ba9('0x32')](_0x2c2e6f['model'],qs[_0x4ba9('0x35')](_0x95e81d[_0x4ba9('0x30')][_0x4ba9('0x35')]));_0x298c24[_0x4ba9('0x34')]=_0x298c24[_0x4ba9('0x34')][_0x4ba9('0x36')]?_0x298c24[_0x4ba9('0x34')]:_0x2c2e6f[_0x4ba9('0x33')];if(!_0x95e81d['query'][_0x4ba9('0x37')](_0x4ba9('0x38'))){_0x298c24[_0x4ba9('0x1f')]=qs[_0x4ba9('0x1f')](_0x95e81d[_0x4ba9('0x30')][_0x4ba9('0x1f')]);_0x298c24[_0x4ba9('0x1e')]=qs[_0x4ba9('0x1e')](_0x95e81d[_0x4ba9('0x30')][_0x4ba9('0x1e')]);}_0x298c24['order']=qs[_0x4ba9('0x39')](_0x95e81d[_0x4ba9('0x30')][_0x4ba9('0x39')]);_0x298c24[_0x4ba9('0x3a')]=qs[_0x4ba9('0x31')](_['pick'](_0x95e81d[_0x4ba9('0x30')],_0x2c2e6f[_0x4ba9('0x31')]),_0x4ac0d0);if(_0x95e81d['query']['filter']){_0x298c24[_0x4ba9('0x3a')]=_[_0x4ba9('0x3b')](_0x298c24[_0x4ba9('0x3a')],{'$or':_[_0x4ba9('0x3c')](_0x4ac0d0,function(_0x6ff410){if(_0x6ff410[_0x4ba9('0x2e')]!==_0x4ba9('0x3d')){var _0x614b9a={};_0x614b9a[_0x6ff410[_0x4ba9('0x2a')]]={'$like':'%'+_0x95e81d[_0x4ba9('0x30')]['filter']+'%'};return _0x614b9a;}})});}_0x298c24=_['merge']({},_0x298c24,_0x95e81d['options']);var _0x137653={'where':_0x298c24[_0x4ba9('0x3a')]};return db[_0x4ba9('0x3e')][_0x4ba9('0x21')](_0x137653)['then'](function(_0x15d08c){_0x30f77f[_0x4ba9('0x21')]=_0x15d08c;if(_0x95e81d[_0x4ba9('0x30')]['includeAll']){_0x298c24['include']=[{'all':!![]}];}return db[_0x4ba9('0x3e')][_0x4ba9('0x3f')](_0x298c24);})[_0x4ba9('0x26')](function(_0x5a945f){_0x30f77f['rows']=_0x5a945f;return _0x30f77f;})[_0x4ba9('0x26')](respondWithFilteredResult(_0x3affcf,_0x298c24))[_0x4ba9('0x40')](handleError(_0x3affcf,null));};exports[_0x4ba9('0x41')]=function(_0x32a7f3,_0x17cece){var _0x5dd2cc={'raw':![],'where':{'id':_0x32a7f3[_0x4ba9('0x42')]['id']}},_0x26ae96={};_0x26ae96['model']=_[_0x4ba9('0x2f')](db[_0x4ba9('0x3e')][_0x4ba9('0x2c')]);_0x26ae96[_0x4ba9('0x30')]=_[_0x4ba9('0x2f')](_0x32a7f3[_0x4ba9('0x30')]);_0x26ae96[_0x4ba9('0x31')]=_[_0x4ba9('0x32')](_0x26ae96[_0x4ba9('0x33')],_0x26ae96[_0x4ba9('0x30')]);_0x5dd2cc['attributes']=_[_0x4ba9('0x32')](_0x26ae96['model'],qs[_0x4ba9('0x35')](_0x32a7f3[_0x4ba9('0x30')]['fields']));_0x5dd2cc[_0x4ba9('0x34')]=_0x5dd2cc[_0x4ba9('0x34')][_0x4ba9('0x36')]?_0x5dd2cc[_0x4ba9('0x34')]:_0x26ae96['model'];if(_0x32a7f3[_0x4ba9('0x30')][_0x4ba9('0x43')]){_0x5dd2cc[_0x4ba9('0x44')]=[{'all':!![]}];}_0x5dd2cc=_[_0x4ba9('0x3b')]({},_0x5dd2cc,_0x32a7f3[_0x4ba9('0x45')]);return db['ServicenowConfiguration'][_0x4ba9('0x46')](_0x5dd2cc)['then'](handleEntityNotFound(_0x17cece,null))[_0x4ba9('0x26')](respondWithResult(_0x17cece,null))['catch'](handleError(_0x17cece,null));};exports[_0x4ba9('0x47')]=function(_0x30e17e,_0x165fd6){return db[_0x4ba9('0x3e')][_0x4ba9('0x47')](_0x30e17e[_0x4ba9('0x48')],{})[_0x4ba9('0x26')](respondWithResult(_0x165fd6,0xc9))[_0x4ba9('0x40')](handleError(_0x165fd6,null));};exports['update']=function(_0x2e6a41,_0x3f32e6){if(_0x2e6a41[_0x4ba9('0x48')]['id']){delete _0x2e6a41['body']['id'];}return db[_0x4ba9('0x3e')]['find']({'where':{'id':_0x2e6a41[_0x4ba9('0x42')]['id']}})[_0x4ba9('0x26')](handleEntityNotFound(_0x3f32e6,null))[_0x4ba9('0x26')](saveUpdates(_0x2e6a41['body'],null))[_0x4ba9('0x26')](respondWithResult(_0x3f32e6,null))['catch'](handleError(_0x3f32e6,null));};exports[_0x4ba9('0x27')]=function(_0x505524,_0x18a40e){return db[_0x4ba9('0x3e')]['find']({'where':{'id':_0x505524[_0x4ba9('0x42')]['id']}})['then'](handleEntityNotFound(_0x18a40e,null))[_0x4ba9('0x26')](removeEntity(_0x18a40e,null))[_0x4ba9('0x40')](handleError(_0x18a40e,null));};exports[_0x4ba9('0x49')]=function(_0x4066af,_0x3eed28,_0x1643ff){var _0x75fc14={};var _0x4d6999={};var _0x5a5ec9;var _0x3f0bf5;return db[_0x4ba9('0x3e')]['findOne']({'where':{'id':_0x4066af[_0x4ba9('0x42')]['id']}})[_0x4ba9('0x26')](handleEntityNotFound(_0x3eed28,null))[_0x4ba9('0x26')](function(_0x12ae7d){if(_0x12ae7d){_0x5a5ec9=_0x12ae7d;_0x4d6999[_0x4ba9('0x33')]=_['keys'](db[_0x4ba9('0x4a')][_0x4ba9('0x2c')]);_0x4d6999[_0x4ba9('0x30')]=_[_0x4ba9('0x2f')](_0x4066af[_0x4ba9('0x30')]);_0x4d6999[_0x4ba9('0x31')]=_[_0x4ba9('0x32')](_0x4d6999[_0x4ba9('0x33')],_0x4d6999[_0x4ba9('0x30')]);_0x75fc14[_0x4ba9('0x34')]=_[_0x4ba9('0x32')](_0x4d6999[_0x4ba9('0x33')],qs[_0x4ba9('0x35')](_0x4066af[_0x4ba9('0x30')][_0x4ba9('0x35')]));_0x75fc14['attributes']=_0x75fc14[_0x4ba9('0x34')][_0x4ba9('0x36')]?_0x75fc14[_0x4ba9('0x34')]:_0x4d6999[_0x4ba9('0x33')];_0x75fc14['order']=qs[_0x4ba9('0x39')](_0x4066af[_0x4ba9('0x30')][_0x4ba9('0x39')]);_0x75fc14[_0x4ba9('0x3a')]=qs['filters'](_['pick'](_0x4066af['query'],_0x4d6999['filters']));if(_0x4066af[_0x4ba9('0x30')][_0x4ba9('0x4b')]){_0x75fc14[_0x4ba9('0x3a')]=_[_0x4ba9('0x3b')](_0x75fc14['where'],{'$or':_[_0x4ba9('0x3c')](_0x75fc14['attributes'],function(_0x22f35f){var _0x3563ab={};_0x3563ab[_0x22f35f]={'$like':'%'+_0x4066af['query'][_0x4ba9('0x4b')]+'%'};return _0x3563ab;})});}_0x75fc14=_[_0x4ba9('0x3b')]({},_0x75fc14,_0x4066af[_0x4ba9('0x45')]);return _0x5a5ec9[_0x4ba9('0x49')](_0x75fc14);}})[_0x4ba9('0x26')](function(_0x5c753b){if(_0x5c753b){_0x3f0bf5=_0x5c753b[_0x4ba9('0x36')];if(!_0x4066af['query'][_0x4ba9('0x37')](_0x4ba9('0x38'))){_0x75fc14[_0x4ba9('0x1f')]=qs[_0x4ba9('0x1f')](_0x4066af[_0x4ba9('0x30')][_0x4ba9('0x1f')]);_0x75fc14[_0x4ba9('0x1e')]=qs[_0x4ba9('0x1e')](_0x4066af[_0x4ba9('0x30')]['offset']);}return _0x5a5ec9[_0x4ba9('0x49')](_0x75fc14);}})['then'](function(_0x2f8169){if(_0x2f8169){return _0x2f8169?{'count':_0x3f0bf5,'rows':_0x2f8169}:null;}})[_0x4ba9('0x26')](respondWithResult(_0x3eed28,null))['catch'](handleError(_0x3eed28,null));};exports[_0x4ba9('0x4c')]=function(_0x1d571f,_0x346a57,_0x4f3d69){var _0x12a260={};var _0x2de9a4={};var _0x2bcd43;var _0x5c770e;return db[_0x4ba9('0x3e')]['findOne']({'where':{'id':_0x1d571f[_0x4ba9('0x42')]['id']}})[_0x4ba9('0x26')](handleEntityNotFound(_0x346a57,null))[_0x4ba9('0x26')](function(_0x1be092){if(_0x1be092){_0x2bcd43=_0x1be092;_0x2de9a4[_0x4ba9('0x33')]=_[_0x4ba9('0x2f')](db[_0x4ba9('0x4a')][_0x4ba9('0x2c')]);_0x2de9a4[_0x4ba9('0x30')]=_[_0x4ba9('0x2f')](_0x1d571f['query']);_0x2de9a4[_0x4ba9('0x31')]=_[_0x4ba9('0x32')](_0x2de9a4[_0x4ba9('0x33')],_0x2de9a4[_0x4ba9('0x30')]);_0x12a260['attributes']=_[_0x4ba9('0x32')](_0x2de9a4['model'],qs[_0x4ba9('0x35')](_0x1d571f['query']['fields']));_0x12a260[_0x4ba9('0x34')]=_0x12a260[_0x4ba9('0x34')][_0x4ba9('0x36')]?_0x12a260[_0x4ba9('0x34')]:_0x2de9a4['model'];_0x12a260['order']=qs[_0x4ba9('0x39')](_0x1d571f[_0x4ba9('0x30')]['sort']);_0x12a260[_0x4ba9('0x3a')]=qs['filters'](_[_0x4ba9('0x4d')](_0x1d571f[_0x4ba9('0x30')],_0x2de9a4[_0x4ba9('0x31')]));if(_0x1d571f[_0x4ba9('0x30')][_0x4ba9('0x4b')]){_0x12a260['where']=_['merge'](_0x12a260[_0x4ba9('0x3a')],{'$or':_['map'](_0x12a260[_0x4ba9('0x34')],function(_0x3a016d){var _0x125a56={};_0x125a56[_0x3a016d]={'$like':'%'+_0x1d571f[_0x4ba9('0x30')][_0x4ba9('0x4b')]+'%'};return _0x125a56;})});}_0x12a260=_['merge']({},_0x12a260,_0x1d571f[_0x4ba9('0x45')]);return _0x2bcd43[_0x4ba9('0x4c')](_0x12a260);}})[_0x4ba9('0x26')](function(_0x2a1b43){if(_0x2a1b43){_0x5c770e=_0x2a1b43['length'];if(!_0x1d571f['query'][_0x4ba9('0x37')]('nolimit')){_0x12a260[_0x4ba9('0x1f')]=qs[_0x4ba9('0x1f')](_0x1d571f[_0x4ba9('0x30')][_0x4ba9('0x1f')]);_0x12a260['offset']=qs[_0x4ba9('0x1e')](_0x1d571f['query'][_0x4ba9('0x1e')]);}return _0x2bcd43[_0x4ba9('0x4c')](_0x12a260);}})[_0x4ba9('0x26')](function(_0x4dc4ae){if(_0x4dc4ae){return _0x4dc4ae?{'count':_0x5c770e,'rows':_0x4dc4ae}:null;}})[_0x4ba9('0x26')](respondWithResult(_0x346a57,null))[_0x4ba9('0x40')](handleError(_0x346a57,null));};exports[_0x4ba9('0x4e')]=function(_0x4e1fcd,_0x250545,_0x1b8c32){var _0x54d3e8={};var _0x159ecf={};var _0x325b26;var _0x1ddc70;return db[_0x4ba9('0x3e')][_0x4ba9('0x4f')]({'where':{'id':_0x4e1fcd[_0x4ba9('0x42')]['id']}})[_0x4ba9('0x26')](handleEntityNotFound(_0x250545,null))[_0x4ba9('0x26')](function(_0x43a10c){if(_0x43a10c){_0x325b26=_0x43a10c;_0x159ecf[_0x4ba9('0x33')]=_[_0x4ba9('0x2f')](db[_0x4ba9('0x4a')]['rawAttributes']);_0x159ecf[_0x4ba9('0x30')]=_[_0x4ba9('0x2f')](_0x4e1fcd[_0x4ba9('0x30')]);_0x159ecf[_0x4ba9('0x31')]=_[_0x4ba9('0x32')](_0x159ecf[_0x4ba9('0x33')],_0x159ecf[_0x4ba9('0x30')]);_0x54d3e8[_0x4ba9('0x34')]=_[_0x4ba9('0x32')](_0x159ecf[_0x4ba9('0x33')],qs[_0x4ba9('0x35')](_0x4e1fcd[_0x4ba9('0x30')][_0x4ba9('0x35')]));_0x54d3e8[_0x4ba9('0x34')]=_0x54d3e8[_0x4ba9('0x34')]['length']?_0x54d3e8[_0x4ba9('0x34')]:_0x159ecf[_0x4ba9('0x33')];_0x54d3e8[_0x4ba9('0x50')]=qs[_0x4ba9('0x39')](_0x4e1fcd[_0x4ba9('0x30')][_0x4ba9('0x39')]);_0x54d3e8[_0x4ba9('0x3a')]=qs[_0x4ba9('0x31')](_[_0x4ba9('0x4d')](_0x4e1fcd[_0x4ba9('0x30')],_0x159ecf['filters']));if(_0x4e1fcd[_0x4ba9('0x30')][_0x4ba9('0x4b')]){_0x54d3e8[_0x4ba9('0x3a')]=_[_0x4ba9('0x3b')](_0x54d3e8[_0x4ba9('0x3a')],{'$or':_[_0x4ba9('0x3c')](_0x54d3e8[_0x4ba9('0x34')],function(_0x4d2813){var _0x535cde={};_0x535cde[_0x4d2813]={'$like':'%'+_0x4e1fcd[_0x4ba9('0x30')][_0x4ba9('0x4b')]+'%'};return _0x535cde;})});}_0x54d3e8=_[_0x4ba9('0x3b')]({},_0x54d3e8,_0x4e1fcd['options']);return _0x325b26[_0x4ba9('0x4e')](_0x54d3e8);}})['then'](function(_0x40a621){if(_0x40a621){_0x1ddc70=_0x40a621[_0x4ba9('0x36')];if(!_0x4e1fcd[_0x4ba9('0x30')][_0x4ba9('0x37')](_0x4ba9('0x38'))){_0x54d3e8['limit']=qs['limit'](_0x4e1fcd[_0x4ba9('0x30')]['limit']);_0x54d3e8['offset']=qs[_0x4ba9('0x1e')](_0x4e1fcd[_0x4ba9('0x30')][_0x4ba9('0x1e')]);}return _0x325b26[_0x4ba9('0x4e')](_0x54d3e8);}})[_0x4ba9('0x26')](function(_0xcc9920){if(_0xcc9920){return _0xcc9920?{'count':_0x1ddc70,'rows':_0xcc9920}:null;}})[_0x4ba9('0x26')](respondWithResult(_0x250545,null))[_0x4ba9('0x40')](handleError(_0x250545,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e75c661..c1bcd2f 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 _0xfc61=['util','../../config/logger','api','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xfc61,0x78));var _0x1fc6=function(_0x531b2a,_0x113b57){_0x531b2a=_0x531b2a-0x0;var _0x20560a=_0xfc61[_0x531b2a];return _0x20560a;};'use strict';var _=require(_0x1fc6('0x0'));var util=require(_0x1fc6('0x1'));var logger=require(_0x1fc6('0x2'))(_0x1fc6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fc6('0x4'));var rimraf=require(_0x1fc6('0x5'));var config=require(_0x1fc6('0x6'));var attributes=require(_0x1fc6('0x7'));module['exports']=function(_0x5b5f8c,_0x2c32ca){return _0x5b5f8c[_0x1fc6('0x8')](_0x1fc6('0x9'),attributes,{'tableName':_0x1fc6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fc9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x1f6f6b,_0x46d1a4){var _0xf77e94=function(_0x21bb77){while(--_0x21bb77){_0x1f6f6b['push'](_0x1f6f6b['shift']());}};_0xf77e94(++_0x46d1a4);}(_0x2fc9,0xc2));var _0x92fc=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x2fc9[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var logger=require(_0x92fc('0x1'))(_0x92fc('0x2'));var moment=require(_0x92fc('0x3'));var BPromise=require(_0x92fc('0x4'));var rp=require(_0x92fc('0x5'));var fs=require('fs');var path=require(_0x92fc('0x6'));var rimraf=require(_0x92fc('0x7'));var config=require(_0x92fc('0x8'));var attributes=require(_0x92fc('0x9'));module[_0x92fc('0xa')]=function(_0x5d492e,_0x580d4a){return _0x5d492e['define'](_0x92fc('0xb'),attributes,{'tableName':_0x92fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index cd6b6d4..1cd0c42 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 _0x9618=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x4e94bb,_0x4cd31c){var _0x2dfc12=function(_0x49243f){while(--_0x49243f){_0x4e94bb['push'](_0x4e94bb['shift']());}};_0x2dfc12(++_0x4cd31c);}(_0x9618,0x114));var _0x8961=function(_0x3b3cff,_0x3ab09a){_0x3b3cff=_0x3b3cff-0x0;var _0xab60e9=_0x9618[_0x3b3cff];return _0xab60e9;};'use strict';var _=require(_0x8961('0x0'));var util=require(_0x8961('0x1'));var moment=require(_0x8961('0x2'));var BPromise=require(_0x8961('0x3'));var rs=require(_0x8961('0x4'));var fs=require('fs');var Redis=require(_0x8961('0x5'));var db=require(_0x8961('0x6'))['db'];var utils=require(_0x8961('0x7'));var logger=require(_0x8961('0x8'))(_0x8961('0x9'));var config=require(_0x8961('0xa'));var jayson=require(_0x8961('0xb'));var client=jayson[_0x8961('0xc')][_0x8961('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x17da26,_0x272931,_0x1ba641){return new BPromise(function(_0x507baf,_0x4ba628){return client[_0x8961('0xe')](_0x17da26,_0x1ba641)[_0x8961('0xf')](function(_0x323096){logger[_0x8961('0x10')](_0x8961('0x11'),_0x272931,'request\x20sent');logger[_0x8961('0x12')](_0x8961('0x13'),_0x272931,_0x8961('0x14'),JSON['stringify'](_0x323096));if(_0x323096[_0x8961('0x15')]){if(_0x323096[_0x8961('0x15')]['code']===0x1f4){logger[_0x8961('0x15')](_0x8961('0x11'),_0x272931,_0x323096[_0x8961('0x15')]['message']);return _0x4ba628(_0x323096['error'][_0x8961('0x16')]);}logger[_0x8961('0x15')](_0x8961('0x11'),_0x272931,_0x323096[_0x8961('0x15')]['message']);return _0x507baf(_0x323096['error']['message']);}else{logger[_0x8961('0x10')](_0x8961('0x11'),_0x272931,_0x8961('0x14'));_0x507baf(_0x323096[_0x8961('0x17')][_0x8961('0x16')]);}})[_0x8961('0x18')](function(_0x328513){logger[_0x8961('0x15')](_0x8961('0x11'),_0x272931,_0x328513);_0x4ba628(_0x328513);});});} \ No newline at end of file +var _0x649e=['../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','code','message','info','ServicenowConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x27d844,_0x4bc844){var _0x50f19e=function(_0x298e7e){while(--_0x298e7e){_0x27d844['push'](_0x27d844['shift']());}};_0x50f19e(++_0x4bc844);}(_0x649e,0xdd));var _0xe649=function(_0x5d3d1e,_0x32086f){_0x5d3d1e=_0x5d3d1e-0x0;var _0x530533=_0x649e[_0x5d3d1e];return _0x530533;};'use strict';var _=require(_0xe649('0x0'));var util=require(_0xe649('0x1'));var moment=require(_0xe649('0x2'));var BPromise=require(_0xe649('0x3'));var rs=require(_0xe649('0x4'));var fs=require('fs');var Redis=require(_0xe649('0x5'));var db=require(_0xe649('0x6'))['db'];var utils=require(_0xe649('0x7'));var logger=require(_0xe649('0x8'))('rpc');var config=require(_0xe649('0x9'));var jayson=require(_0xe649('0xa'));var client=jayson[_0xe649('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13e3b5,_0x3cc06b,_0x2ac422){return new BPromise(function(_0x1086b7,_0x396270){return client[_0xe649('0xc')](_0x13e3b5,_0x2ac422)[_0xe649('0xd')](function(_0x2556e0){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3cc06b,_0xe649('0xe'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3cc06b,'request\x20sent',JSON[_0xe649('0xf')](_0x2556e0));if(_0x2556e0[_0xe649('0x10')]){if(_0x2556e0[_0xe649('0x10')][_0xe649('0x11')]===0x1f4){logger[_0xe649('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3cc06b,_0x2556e0[_0xe649('0x10')]['message']);return _0x396270(_0x2556e0['error'][_0xe649('0x12')]);}logger[_0xe649('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3cc06b,_0x2556e0[_0xe649('0x10')]['message']);return _0x1086b7(_0x2556e0[_0xe649('0x10')][_0xe649('0x12')]);}else{logger[_0xe649('0x13')](_0xe649('0x14'),_0x3cc06b,_0xe649('0xe'));_0x1086b7(_0x2556e0[_0xe649('0x15')][_0xe649('0x12')]);}})[_0xe649('0x16')](function(_0xb11506){logger[_0xe649('0x10')](_0xe649('0x14'),_0x3cc06b,_0xb11506);_0x396270(_0xb11506);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 07a1ccd..29a53b5 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 _0x1b65=['isAuthenticated','show','post','create','put','update','exports','multer','util','path','Router','fs-extra','../../config/environment','./intServicenowField.controller','get','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b65,0x157));var _0x51b6=function(_0x1a7cf5,_0x24c34a){_0x1a7cf5=_0x1a7cf5-0x0;var _0x39ca1f=_0x1b65[_0x1a7cf5];return _0x39ca1f;};'use strict';var multer=require(_0x51b6('0x0'));var util=require(_0x51b6('0x1'));var path=require(_0x51b6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x51b6('0x3')]();var fs_extra=require(_0x51b6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x51b6('0x5'));var controller=require(_0x51b6('0x6'));router[_0x51b6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x51b6('0x8'),auth[_0x51b6('0x9')](),controller[_0x51b6('0xa')]);router[_0x51b6('0xb')]('/',auth[_0x51b6('0x9')](),controller[_0x51b6('0xc')]);router[_0x51b6('0xd')]('/:id',auth[_0x51b6('0x9')](),controller[_0x51b6('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x51b6('0xf')]=router; \ No newline at end of file +var _0x69a5=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','/:id','show','create','put','delete','destroy'];(function(_0x29165d,_0x43cb3f){var _0x4c7aeb=function(_0x374530){while(--_0x374530){_0x29165d['push'](_0x29165d['shift']());}};_0x4c7aeb(++_0x43cb3f);}(_0x69a5,0x6d));var _0x569a=function(_0x3de138,_0x5ea27f){_0x3de138=_0x3de138-0x0;var _0x53d355=_0x69a5[_0x3de138];return _0x53d355;};'use strict';var multer=require('multer');var util=require(_0x569a('0x0'));var path=require(_0x569a('0x1'));var timeout=require(_0x569a('0x2'));var express=require(_0x569a('0x3'));var router=express['Router']();var fs_extra=require(_0x569a('0x4'));var auth=require(_0x569a('0x5'));var interaction=require(_0x569a('0x6'));var config=require(_0x569a('0x7'));var controller=require(_0x569a('0x8'));router['get']('/',auth[_0x569a('0x9')](),controller['index']);router[_0x569a('0xa')](_0x569a('0xb'),auth['isAuthenticated'](),controller[_0x569a('0xc')]);router['post']('/',auth[_0x569a('0x9')](),controller[_0x569a('0xd')]);router[_0x569a('0xe')]('/:id',auth[_0x569a('0x9')](),controller['update']);router[_0x569a('0xf')](_0x569a('0xb'),auth[_0x569a('0x9')](),controller[_0x569a('0x10')]);module[_0x569a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 90253a6..be1d40a 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 _0xd273=['ENUM','customVariable','keyValue','string','STRING','variable','sequelize','exports'];(function(_0x4b82b5,_0xae38e9){var _0x12fa03=function(_0x83f586){while(--_0x83f586){_0x4b82b5['push'](_0x4b82b5['shift']());}};_0x12fa03(++_0xae38e9);}(_0xd273,0x13e));var _0x3d27=function(_0x4cf0d9,_0x2d1cf1){_0x4cf0d9=_0x4cf0d9-0x0;var _0x2a0129=_0xd273[_0x4cf0d9];return _0x2a0129;};'use strict';var Sequelize=require(_0x3d27('0x0'));module[_0x3d27('0x1')]={'type':{'type':Sequelize[_0x3d27('0x2')]('string','variable',_0x3d27('0x3'),_0x3d27('0x4'),'picklist'),'defaultValue':_0x3d27('0x5')},'content':{'type':Sequelize[_0x3d27('0x6')]},'key':{'type':Sequelize[_0x3d27('0x6')]},'keyType':{'type':Sequelize[_0x3d27('0x2')](_0x3d27('0x5'),_0x3d27('0x7'),_0x3d27('0x3'))},'keyContent':{'type':Sequelize[_0x3d27('0x6')]},'idField':{'type':Sequelize[_0x3d27('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa3be=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x4e90f5,_0x1eb50e){var _0x5bb55b=function(_0x45c5cf){while(--_0x45c5cf){_0x4e90f5['push'](_0x4e90f5['shift']());}};_0x5bb55b(++_0x1eb50e);}(_0xa3be,0xc0));var _0xea3b=function(_0x538fa1,_0x563ac4){_0x538fa1=_0x538fa1-0x0;var _0x11c7fe=_0xa3be[_0x538fa1];return _0x11c7fe;};'use strict';var Sequelize=require('sequelize');module[_0xea3b('0x0')]={'type':{'type':Sequelize[_0xea3b('0x1')](_0xea3b('0x2'),_0xea3b('0x3'),_0xea3b('0x4'),_0xea3b('0x5'),_0xea3b('0x6')),'defaultValue':_0xea3b('0x2')},'content':{'type':Sequelize[_0xea3b('0x7')]},'key':{'type':Sequelize[_0xea3b('0x7')]},'keyType':{'type':Sequelize[_0xea3b('0x1')]('string',_0xea3b('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xea3b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xea3b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea3b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c9d3ad7..77b2a50 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 _0x8f9c=['crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','limit','undefined','offset','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ServicenowField','count','include','findAll','rows','catch','params','includeAll','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f9c,0x85));var _0xc8f9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8f9c[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8f9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8f9('0x1'));var rp=require(_0xc8f9('0x2'));var moment=require(_0xc8f9('0x3'));var BPromise=require(_0xc8f9('0x4'));var Mustache=require(_0xc8f9('0x5'));var util=require(_0xc8f9('0x6'));var path=require(_0xc8f9('0x7'));var sox=require(_0xc8f9('0x8'));var csv=require(_0xc8f9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8f9('0xa'));var _=require(_0xc8f9('0xb'));var squel=require(_0xc8f9('0xc'));var crypto=require(_0xc8f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc8f9('0xe'));var toCsv=require(_0xc8f9('0x9'));var querystring=require(_0xc8f9('0xf'));var Papa=require('papaparse');var Redis=require(_0xc8f9('0x10'));var authService=require(_0xc8f9('0x11'));var qs=require(_0xc8f9('0x12'));var as=require(_0xc8f9('0x13'));var hardwareService=require(_0xc8f9('0x14'));var logger=require(_0xc8f9('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc8f9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc8f9('0x17'))['db'];function respondWithStatusCode(_0xf6d1ea,_0x359e50){_0x359e50=_0x359e50||0xcc;return function(_0x5b4663){if(_0x5b4663){return _0xf6d1ea['sendStatus'](_0x359e50);}return _0xf6d1ea[_0xc8f9('0x18')](_0x359e50)[_0xc8f9('0x19')]();};}function respondWithResult(_0x26cc85,_0x12232b){_0x12232b=_0x12232b||0xc8;return function(_0x4ebc6f){if(_0x4ebc6f){return _0x26cc85[_0xc8f9('0x18')](_0x12232b)[_0xc8f9('0x1a')](_0x4ebc6f);}};}function respondWithFilteredResult(_0x5c6c7c,_0x4902cd){return function(_0x3c7d9c){if(_0x3c7d9c){var _0x5e5c10=typeof _0x4902cd['offset']==='undefined'&&typeof _0x4902cd[_0xc8f9('0x1b')]===_0xc8f9('0x1c');var _0x53ecdb=_0x3c7d9c['count'];var _0x30226c=_0x5e5c10?0x0:_0x4902cd[_0xc8f9('0x1d')];var _0x2b792f=_0x5e5c10?_0x3c7d9c['count']:_0x4902cd[_0xc8f9('0x1d')]+_0x4902cd['limit'];var _0xa3c688;if(_0x2b792f>=_0x53ecdb){_0x2b792f=_0x53ecdb;_0xa3c688=0xc8;}else{_0xa3c688=0xce;}_0x5c6c7c[_0xc8f9('0x18')](_0xa3c688);return _0x5c6c7c['set'](_0xc8f9('0x1e'),_0x30226c+'-'+_0x2b792f+'/'+_0x53ecdb)[_0xc8f9('0x1a')](_0x3c7d9c);}return null;};}function patchUpdates(_0x2eb15a){return function(_0x3a34b0){try{jsonpatch['apply'](_0x3a34b0,_0x2eb15a,!![]);}catch(_0x180647){return BPromise['reject'](_0x180647);}return _0x3a34b0['save']();};}function saveUpdates(_0x14708d,_0x2dd425){return function(_0x126b42){if(_0x126b42){return _0x126b42[_0xc8f9('0x1f')](_0x14708d)[_0xc8f9('0x20')](function(_0x3981aa){return _0x3981aa;});}return null;};}function removeEntity(_0x1ffb23,_0x7cf534){return function(_0x538de2){if(_0x538de2){return _0x538de2[_0xc8f9('0x21')]()['then'](function(){_0x1ffb23['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bf256,_0x3255b8){return function(_0x2a6eb7){if(!_0x2a6eb7){_0x3bf256[_0xc8f9('0x22')](0x194);}return _0x2a6eb7;};}function handleError(_0x35503d,_0x16763a){_0x16763a=_0x16763a||0x1f4;return function(_0x3e6c9e){logger[_0xc8f9('0x23')](_0x3e6c9e[_0xc8f9('0x24')]);if(_0x3e6c9e[_0xc8f9('0x25')]){delete _0x3e6c9e[_0xc8f9('0x25')];}_0x35503d[_0xc8f9('0x18')](_0x16763a)[_0xc8f9('0x26')](_0x3e6c9e);};}exports['index']=function(_0x304b1a,_0x54e7eb){var _0x128bf3={},_0x584661={},_0x1b6b1d={'count':0x0,'rows':[]};var _0x3713f3=_['map'](db['ServicenowField'][_0xc8f9('0x27')],function(_0xa6eacc){return{'name':_0xa6eacc[_0xc8f9('0x28')],'type':_0xa6eacc['type'][_0xc8f9('0x29')]};});_0x584661[_0xc8f9('0x2a')]=_[_0xc8f9('0x2b')](_0x3713f3,_0xc8f9('0x25'));_0x584661[_0xc8f9('0x2c')]=_[_0xc8f9('0x2d')](_0x304b1a['query']);_0x584661[_0xc8f9('0x2e')]=_['intersection'](_0x584661[_0xc8f9('0x2a')],_0x584661[_0xc8f9('0x2c')]);_0x128bf3[_0xc8f9('0x2f')]=_[_0xc8f9('0x30')](_0x584661['model'],qs[_0xc8f9('0x31')](_0x304b1a[_0xc8f9('0x2c')][_0xc8f9('0x31')]));_0x128bf3[_0xc8f9('0x2f')]=_0x128bf3['attributes'][_0xc8f9('0x32')]?_0x128bf3[_0xc8f9('0x2f')]:_0x584661['model'];if(!_0x304b1a[_0xc8f9('0x2c')][_0xc8f9('0x33')](_0xc8f9('0x34'))){_0x128bf3[_0xc8f9('0x1b')]=qs[_0xc8f9('0x1b')](_0x304b1a[_0xc8f9('0x2c')][_0xc8f9('0x1b')]);_0x128bf3['offset']=qs[_0xc8f9('0x1d')](_0x304b1a[_0xc8f9('0x2c')]['offset']);}_0x128bf3[_0xc8f9('0x35')]=qs[_0xc8f9('0x36')](_0x304b1a['query'][_0xc8f9('0x36')]);_0x128bf3[_0xc8f9('0x37')]=qs[_0xc8f9('0x2e')](_[_0xc8f9('0x38')](_0x304b1a[_0xc8f9('0x2c')],_0x584661[_0xc8f9('0x2e')]),_0x3713f3);if(_0x304b1a[_0xc8f9('0x2c')][_0xc8f9('0x39')]){_0x128bf3['where']=_[_0xc8f9('0x3a')](_0x128bf3['where'],{'$or':_[_0xc8f9('0x2b')](_0x3713f3,function(_0x2363f3){if(_0x2363f3[_0xc8f9('0x3b')]!==_0xc8f9('0x3c')){var _0x41fa1b={};_0x41fa1b[_0x2363f3['name']]={'$like':'%'+_0x304b1a['query'][_0xc8f9('0x39')]+'%'};return _0x41fa1b;}})});}_0x128bf3=_[_0xc8f9('0x3a')]({},_0x128bf3,_0x304b1a[_0xc8f9('0x3d')]);var _0x21d08c={'where':_0x128bf3[_0xc8f9('0x37')]};return db[_0xc8f9('0x3e')][_0xc8f9('0x3f')](_0x21d08c)['then'](function(_0x420e04){_0x1b6b1d[_0xc8f9('0x3f')]=_0x420e04;if(_0x304b1a[_0xc8f9('0x2c')]['includeAll']){_0x128bf3[_0xc8f9('0x40')]=[{'all':!![]}];}return db[_0xc8f9('0x3e')][_0xc8f9('0x41')](_0x128bf3);})[_0xc8f9('0x20')](function(_0x4cbd50){_0x1b6b1d[_0xc8f9('0x42')]=_0x4cbd50;return _0x1b6b1d;})[_0xc8f9('0x20')](respondWithFilteredResult(_0x54e7eb,_0x128bf3))[_0xc8f9('0x43')](handleError(_0x54e7eb,null));};exports['show']=function(_0x50365c,_0x4521b5){var _0x2343a1={'raw':!![],'where':{'id':_0x50365c[_0xc8f9('0x44')]['id']}},_0x553f2e={};_0x553f2e['model']=_['keys'](db[_0xc8f9('0x3e')][_0xc8f9('0x27')]);_0x553f2e['query']=_[_0xc8f9('0x2d')](_0x50365c['query']);_0x553f2e[_0xc8f9('0x2e')]=_['intersection'](_0x553f2e['model'],_0x553f2e['query']);_0x2343a1[_0xc8f9('0x2f')]=_[_0xc8f9('0x30')](_0x553f2e['model'],qs[_0xc8f9('0x31')](_0x50365c[_0xc8f9('0x2c')]['fields']));_0x2343a1[_0xc8f9('0x2f')]=_0x2343a1[_0xc8f9('0x2f')][_0xc8f9('0x32')]?_0x2343a1['attributes']:_0x553f2e[_0xc8f9('0x2a')];if(_0x50365c['query'][_0xc8f9('0x45')]){_0x2343a1[_0xc8f9('0x40')]=[{'all':!![]}];}_0x2343a1=_[_0xc8f9('0x3a')]({},_0x2343a1,_0x50365c[_0xc8f9('0x3d')]);return db[_0xc8f9('0x3e')]['find'](_0x2343a1)[_0xc8f9('0x20')](handleEntityNotFound(_0x4521b5,null))[_0xc8f9('0x20')](respondWithResult(_0x4521b5,null))['catch'](handleError(_0x4521b5,null));};exports['create']=function(_0x2f5081,_0x22d8d9){return db[_0xc8f9('0x3e')][_0xc8f9('0x46')](_0x2f5081['body'],{})[_0xc8f9('0x20')](respondWithResult(_0x22d8d9,0xc9))[_0xc8f9('0x43')](handleError(_0x22d8d9,null));};exports['update']=function(_0x4c2800,_0x589797){if(_0x4c2800[_0xc8f9('0x47')]['id']){delete _0x4c2800[_0xc8f9('0x47')]['id'];}return db[_0xc8f9('0x3e')][_0xc8f9('0x48')]({'where':{'id':_0x4c2800[_0xc8f9('0x44')]['id']}})[_0xc8f9('0x20')](handleEntityNotFound(_0x589797,null))[_0xc8f9('0x20')](saveUpdates(_0x4c2800[_0xc8f9('0x47')],null))[_0xc8f9('0x20')](respondWithResult(_0x589797,null))[_0xc8f9('0x43')](handleError(_0x589797,null));};exports['destroy']=function(_0x2f807b,_0x1e44c3){return db[_0xc8f9('0x3e')]['find']({'where':{'id':_0x2f807b['params']['id']}})[_0xc8f9('0x20')](handleEntityNotFound(_0x1e44c3,null))[_0xc8f9('0x20')](removeEntity(_0x1e44c3,null))[_0xc8f9('0x43')](handleError(_0x1e44c3,null));}; \ No newline at end of file +var _0xa8df=['destroy','end','sendStatus','error','stack','name','send','index','ServicenowField','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then'];(function(_0x2abb5e,_0x234f0b){var _0x1c5543=function(_0x19c64d){while(--_0x19c64d){_0x2abb5e['push'](_0x2abb5e['shift']());}};_0x1c5543(++_0x234f0b);}(_0xa8df,0x10e));var _0xfa8d=function(_0x2ea405,_0x3014e0){_0x2ea405=_0x2ea405-0x0;var _0x5a857b=_0xa8df[_0x2ea405];return _0x5a857b;};'use strict';var emlformat=require(_0xfa8d('0x0'));var rimraf=require(_0xfa8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa8d('0x2'));var rp=require(_0xfa8d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa8d('0x4'));var util=require(_0xfa8d('0x5'));var path=require(_0xfa8d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfa8d('0x7'));var fs=require('fs');var fs_extra=require(_0xfa8d('0x8'));var _=require(_0xfa8d('0x9'));var squel=require('squel');var crypto=require(_0xfa8d('0xa'));var jsforce=require(_0xfa8d('0xb'));var deskjs=require(_0xfa8d('0xc'));var toCsv=require(_0xfa8d('0xd'));var querystring=require(_0xfa8d('0xe'));var Papa=require(_0xfa8d('0xf'));var Redis=require(_0xfa8d('0x10'));var authService=require(_0xfa8d('0x11'));var qs=require(_0xfa8d('0x12'));var as=require(_0xfa8d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa8d('0x14'))(_0xfa8d('0x15'));var utils=require(_0xfa8d('0x16'));var config=require(_0xfa8d('0x17'));var licenseUtil=require(_0xfa8d('0x18'));var db=require(_0xfa8d('0x19'))['db'];function respondWithStatusCode(_0x19a288,_0x4397d8){_0x4397d8=_0x4397d8||0xcc;return function(_0x45cd15){if(_0x45cd15){return _0x19a288['sendStatus'](_0x4397d8);}return _0x19a288[_0xfa8d('0x1a')](_0x4397d8)['end']();};}function respondWithResult(_0x57c891,_0x5072fc){_0x5072fc=_0x5072fc||0xc8;return function(_0x3a9330){if(_0x3a9330){return _0x57c891[_0xfa8d('0x1a')](_0x5072fc)['json'](_0x3a9330);}};}function respondWithFilteredResult(_0x5bd013,_0x3eed67){return function(_0x9ee693){if(_0x9ee693){var _0x1ef4a6=typeof _0x3eed67['offset']===_0xfa8d('0x1b')&&typeof _0x3eed67[_0xfa8d('0x1c')]===_0xfa8d('0x1b');var _0x25de9=_0x9ee693[_0xfa8d('0x1d')];var _0x26ef3a=_0x1ef4a6?0x0:_0x3eed67[_0xfa8d('0x1e')];var _0x298b0b=_0x1ef4a6?_0x9ee693[_0xfa8d('0x1d')]:_0x3eed67['offset']+_0x3eed67[_0xfa8d('0x1c')];var _0x22be18;if(_0x298b0b>=_0x25de9){_0x298b0b=_0x25de9;_0x22be18=0xc8;}else{_0x22be18=0xce;}_0x5bd013['status'](_0x22be18);return _0x5bd013[_0xfa8d('0x1f')](_0xfa8d('0x20'),_0x26ef3a+'-'+_0x298b0b+'/'+_0x25de9)[_0xfa8d('0x21')](_0x9ee693);}return null;};}function patchUpdates(_0x4ddd3e){return function(_0x2007f5){try{jsonpatch['apply'](_0x2007f5,_0x4ddd3e,!![]);}catch(_0x314d4b){return BPromise[_0xfa8d('0x22')](_0x314d4b);}return _0x2007f5[_0xfa8d('0x23')]();};}function saveUpdates(_0x3d6cf9,_0x298faf){return function(_0x26046f){if(_0x26046f){return _0x26046f[_0xfa8d('0x24')](_0x3d6cf9)[_0xfa8d('0x25')](function(_0x3702d7){return _0x3702d7;});}return null;};}function removeEntity(_0x508692,_0x3ab8c1){return function(_0x95ba1f){if(_0x95ba1f){return _0x95ba1f[_0xfa8d('0x26')]()['then'](function(){_0x508692[_0xfa8d('0x1a')](0xcc)[_0xfa8d('0x27')]();});}};}function handleEntityNotFound(_0x4743c4,_0x21c30b){return function(_0x2eec4f){if(!_0x2eec4f){_0x4743c4[_0xfa8d('0x28')](0x194);}return _0x2eec4f;};}function handleError(_0x2ebc2a,_0x29d1aa){_0x29d1aa=_0x29d1aa||0x1f4;return function(_0x48663d){logger[_0xfa8d('0x29')](_0x48663d[_0xfa8d('0x2a')]);if(_0x48663d[_0xfa8d('0x2b')]){delete _0x48663d[_0xfa8d('0x2b')];}_0x2ebc2a['status'](_0x29d1aa)[_0xfa8d('0x2c')](_0x48663d);};}exports[_0xfa8d('0x2d')]=function(_0x4d5d5c,_0x2466d3){var _0x574814={},_0x342072={},_0x434d09={'count':0x0,'rows':[]};var _0x518c53=_['map'](db[_0xfa8d('0x2e')]['rawAttributes'],function(_0x94c7f7){return{'name':_0x94c7f7[_0xfa8d('0x2f')],'type':_0x94c7f7[_0xfa8d('0x30')][_0xfa8d('0x31')]};});_0x342072[_0xfa8d('0x32')]=_[_0xfa8d('0x33')](_0x518c53,'name');_0x342072['query']=_['keys'](_0x4d5d5c[_0xfa8d('0x34')]);_0x342072[_0xfa8d('0x35')]=_[_0xfa8d('0x36')](_0x342072['model'],_0x342072[_0xfa8d('0x34')]);_0x574814[_0xfa8d('0x37')]=_[_0xfa8d('0x36')](_0x342072[_0xfa8d('0x32')],qs[_0xfa8d('0x38')](_0x4d5d5c[_0xfa8d('0x34')][_0xfa8d('0x38')]));_0x574814[_0xfa8d('0x37')]=_0x574814[_0xfa8d('0x37')]['length']?_0x574814[_0xfa8d('0x37')]:_0x342072[_0xfa8d('0x32')];if(!_0x4d5d5c[_0xfa8d('0x34')][_0xfa8d('0x39')](_0xfa8d('0x3a'))){_0x574814['limit']=qs[_0xfa8d('0x1c')](_0x4d5d5c[_0xfa8d('0x34')][_0xfa8d('0x1c')]);_0x574814[_0xfa8d('0x1e')]=qs[_0xfa8d('0x1e')](_0x4d5d5c['query']['offset']);}_0x574814[_0xfa8d('0x3b')]=qs[_0xfa8d('0x3c')](_0x4d5d5c[_0xfa8d('0x34')][_0xfa8d('0x3c')]);_0x574814[_0xfa8d('0x3d')]=qs[_0xfa8d('0x35')](_[_0xfa8d('0x3e')](_0x4d5d5c[_0xfa8d('0x34')],_0x342072[_0xfa8d('0x35')]),_0x518c53);if(_0x4d5d5c[_0xfa8d('0x34')][_0xfa8d('0x3f')]){_0x574814[_0xfa8d('0x3d')]=_[_0xfa8d('0x40')](_0x574814[_0xfa8d('0x3d')],{'$or':_['map'](_0x518c53,function(_0x4d723c){if(_0x4d723c[_0xfa8d('0x30')]!=='VIRTUAL'){var _0xe31804={};_0xe31804[_0x4d723c[_0xfa8d('0x2b')]]={'$like':'%'+_0x4d5d5c[_0xfa8d('0x34')]['filter']+'%'};return _0xe31804;}})});}_0x574814=_['merge']({},_0x574814,_0x4d5d5c['options']);var _0x10683b={'where':_0x574814[_0xfa8d('0x3d')]};return db['ServicenowField']['count'](_0x10683b)[_0xfa8d('0x25')](function(_0x1d828d){_0x434d09[_0xfa8d('0x1d')]=_0x1d828d;if(_0x4d5d5c[_0xfa8d('0x34')][_0xfa8d('0x41')]){_0x574814[_0xfa8d('0x42')]=[{'all':!![]}];}return db[_0xfa8d('0x2e')][_0xfa8d('0x43')](_0x574814);})[_0xfa8d('0x25')](function(_0x53568a){_0x434d09[_0xfa8d('0x44')]=_0x53568a;return _0x434d09;})[_0xfa8d('0x25')](respondWithFilteredResult(_0x2466d3,_0x574814))[_0xfa8d('0x45')](handleError(_0x2466d3,null));};exports[_0xfa8d('0x46')]=function(_0x1effbe,_0x2aa480){var _0x56c900={'raw':!![],'where':{'id':_0x1effbe[_0xfa8d('0x47')]['id']}},_0x14951c={};_0x14951c[_0xfa8d('0x32')]=_[_0xfa8d('0x48')](db[_0xfa8d('0x2e')][_0xfa8d('0x49')]);_0x14951c[_0xfa8d('0x34')]=_[_0xfa8d('0x48')](_0x1effbe[_0xfa8d('0x34')]);_0x14951c[_0xfa8d('0x35')]=_[_0xfa8d('0x36')](_0x14951c[_0xfa8d('0x32')],_0x14951c[_0xfa8d('0x34')]);_0x56c900['attributes']=_[_0xfa8d('0x36')](_0x14951c['model'],qs[_0xfa8d('0x38')](_0x1effbe[_0xfa8d('0x34')][_0xfa8d('0x38')]));_0x56c900[_0xfa8d('0x37')]=_0x56c900[_0xfa8d('0x37')][_0xfa8d('0x4a')]?_0x56c900[_0xfa8d('0x37')]:_0x14951c[_0xfa8d('0x32')];if(_0x1effbe[_0xfa8d('0x34')][_0xfa8d('0x41')]){_0x56c900[_0xfa8d('0x42')]=[{'all':!![]}];}_0x56c900=_['merge']({},_0x56c900,_0x1effbe['options']);return db['ServicenowField'][_0xfa8d('0x4b')](_0x56c900)[_0xfa8d('0x25')](handleEntityNotFound(_0x2aa480,null))[_0xfa8d('0x25')](respondWithResult(_0x2aa480,null))[_0xfa8d('0x45')](handleError(_0x2aa480,null));};exports['create']=function(_0xad5e15,_0x328333){return db['ServicenowField']['create'](_0xad5e15[_0xfa8d('0x4c')],{})['then'](respondWithResult(_0x328333,0xc9))[_0xfa8d('0x45')](handleError(_0x328333,null));};exports[_0xfa8d('0x24')]=function(_0x116ada,_0x2e2a27){if(_0x116ada[_0xfa8d('0x4c')]['id']){delete _0x116ada[_0xfa8d('0x4c')]['id'];}return db[_0xfa8d('0x2e')][_0xfa8d('0x4b')]({'where':{'id':_0x116ada[_0xfa8d('0x47')]['id']}})[_0xfa8d('0x25')](handleEntityNotFound(_0x2e2a27,null))[_0xfa8d('0x25')](saveUpdates(_0x116ada[_0xfa8d('0x4c')],null))[_0xfa8d('0x25')](respondWithResult(_0x2e2a27,null))[_0xfa8d('0x45')](handleError(_0x2e2a27,null));};exports[_0xfa8d('0x26')]=function(_0x31ccc6,_0x15fda1){return db['ServicenowField'][_0xfa8d('0x4b')]({'where':{'id':_0x31ccc6[_0xfa8d('0x47')]['id']}})[_0xfa8d('0x25')](handleEntityNotFound(_0x15fda1,null))['then'](removeEntity(_0x15fda1,null))[_0xfa8d('0x45')](handleError(_0x15fda1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index e27c107..731633e 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 _0x1bec=['path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','../../config/logger','moment','bluebird','request-promise'];(function(_0x2f70dd,_0x2a10c4){var _0x573c38=function(_0x4824bd){while(--_0x4824bd){_0x2f70dd['push'](_0x2f70dd['shift']());}};_0x573c38(++_0x2a10c4);}(_0x1bec,0x168));var _0xc1be=function(_0x472173,_0x140ece){_0x472173=_0x472173-0x0;var _0x5abc10=_0x1bec[_0x472173];return _0x5abc10;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc1be('0x0'))('api');var moment=require(_0xc1be('0x1'));var BPromise=require(_0xc1be('0x2'));var rp=require(_0xc1be('0x3'));var fs=require('fs');var path=require(_0xc1be('0x4'));var rimraf=require('rimraf');var config=require(_0xc1be('0x5'));var attributes=require(_0xc1be('0x6'));module[_0xc1be('0x7')]=function(_0x24eb44,_0x2b0158){return _0x24eb44[_0xc1be('0x8')](_0xc1be('0x9'),attributes,{'tableName':_0xc1be('0xa'),'paranoid':![],'indexes':[{'name':_0xc1be('0xb'),'fields':[_0xc1be('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x34dd=['../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x1d9ff7,_0x3d3df1){var _0x161bf1=function(_0x5dfdf2){while(--_0x5dfdf2){_0x1d9ff7['push'](_0x1d9ff7['shift']());}};_0x161bf1(++_0x3d3df1);}(_0x34dd,0xa2));var _0xd34d=function(_0x259b38,_0x3114dc){_0x259b38=_0x259b38-0x0;var _0x13b50d=_0x34dd[_0x259b38];return _0x13b50d;};'use strict';var _=require(_0xd34d('0x0'));var util=require(_0xd34d('0x1'));var logger=require(_0xd34d('0x2'))('api');var moment=require(_0xd34d('0x3'));var BPromise=require(_0xd34d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd34d('0x5'));var rimraf=require('rimraf');var config=require(_0xd34d('0x6'));var attributes=require(_0xd34d('0x7'));module[_0xd34d('0x8')]=function(_0x1992fe,_0xdfb848){return _0x1992fe[_0xd34d('0x9')]('ServicenowField',attributes,{'tableName':_0xd34d('0xa'),'paranoid':![],'indexes':[{'name':_0xd34d('0xb'),'fields':[_0xd34d('0xc'),_0xd34d('0xd')],'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 00e66a7..48a89df 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 _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0xcd321c,_0x339b2d){var _0x5189fc=function(_0x46a725){while(--_0x46a725){_0xcd321c['push'](_0xcd321c['shift']());}};_0x5189fc(++_0x339b2d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ee4cb,_0x2fc572){var _0x341ae5=function(_0x5194a7){while(--_0x5194a7){_0x1ee4cb['push'](_0x1ee4cb['shift']());}};_0x341ae5(++_0x2fc572);}(_0x70e0,0x17b));var _0x070e=function(_0x3cb6b7,_0x42b5f7){_0x3cb6b7=_0x3cb6b7-0x0;var _0x5c3622=_0x70e0[_0x3cb6b7];return _0x5c3622;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 4e6205a..e16abaa 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(_0x4e99b2,_0x19272b){var _0x15a627=function(_0x4f86f5){while(--_0x4f86f5){_0x4e99b2['push'](_0x4e99b2['shift']());}};_0x15a627(++_0x19272b);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x45639a,_0x58fde8){var _0x57ed54=function(_0x45b43d){while(--_0x45b43d){_0x45639a['push'](_0x45639a['shift']());}};_0x57ed54(++_0x58fde8);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 b8ce36a..e4a637f 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(_0x19cced,_0x5b8acf){var _0x5ccca0=function(_0x54c01a){while(--_0x54c01a){_0x19cced['push'](_0x19cced['shift']());}};_0x5ccca0(++_0x5b8acf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x43fd70,_0x495ee4){var _0x464ff7=function(_0x1623ac){while(--_0x1623ac){_0x43fd70['push'](_0x43fd70['shift']());}};_0x464ff7(++_0x495ee4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 5d0929f..38e06ad 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 _0xc015=['POST','%s%s','/service/v4_1/rest.php','JSON','stringify','username','Password\x20Expired','format','values','module_fields','remove','includes','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','params','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','password','substring','lastIndexOf'];(function(_0x207db0,_0x57e199){var _0x545f5f=function(_0x48c715){while(--_0x48c715){_0x207db0['push'](_0x207db0['shift']());}};_0x545f5f(++_0x57e199);}(_0xc015,0x85));var _0x5c01=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xc015[_0x495e9f];return _0xb249d2;};'use strict';var emlformat=require(_0x5c01('0x0'));var rimraf=require(_0x5c01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c01('0x2'));var rp=require(_0x5c01('0x3'));var moment=require(_0x5c01('0x4'));var BPromise=require(_0x5c01('0x5'));var Mustache=require(_0x5c01('0x6'));var util=require(_0x5c01('0x7'));var path=require(_0x5c01('0x8'));var sox=require(_0x5c01('0x9'));var csv=require(_0x5c01('0xa'));var ejs=require(_0x5c01('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5c01('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5c01('0xa'));var querystring=require('querystring');var Papa=require(_0x5c01('0xd'));var Redis=require('ioredis');var authService=require(_0x5c01('0xe'));var qs=require(_0x5c01('0xf'));var as=require(_0x5c01('0x10'));var hardwareService=require(_0x5c01('0x11'));var logger=require(_0x5c01('0x12'))(_0x5c01('0x13'));var utils=require('../../config/utils');var config=require(_0x5c01('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c01('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xd0f224,_0x39707e){_0x39707e=_0x39707e||0xcc;return function(_0x318fd8){if(_0x318fd8){return _0xd0f224[_0x5c01('0x16')](_0x39707e);}return _0xd0f224[_0x5c01('0x17')](_0x39707e)[_0x5c01('0x18')]();};}function respondWithResult(_0x5b6c5f,_0x5339a9){_0x5339a9=_0x5339a9||0xc8;return function(_0x1f242e){if(_0x1f242e){return _0x5b6c5f[_0x5c01('0x17')](_0x5339a9)[_0x5c01('0x19')](_0x1f242e);}};}function respondWithFilteredResult(_0x41c4b9,_0x55a25){return function(_0x3707a0){if(_0x3707a0){var _0x314b4d=typeof _0x55a25[_0x5c01('0x1a')]==='undefined'&&typeof _0x55a25[_0x5c01('0x1b')]===_0x5c01('0x1c');var _0x2743bf=_0x3707a0[_0x5c01('0x1d')];var _0x1ae83b=_0x314b4d?0x0:_0x55a25['offset'];var _0x559733=_0x314b4d?_0x3707a0['count']:_0x55a25[_0x5c01('0x1a')]+_0x55a25[_0x5c01('0x1b')];var _0x35d0c9;if(_0x559733>=_0x2743bf){_0x559733=_0x2743bf;_0x35d0c9=0xc8;}else{_0x35d0c9=0xce;}_0x41c4b9[_0x5c01('0x17')](_0x35d0c9);return _0x41c4b9[_0x5c01('0x1e')](_0x5c01('0x1f'),_0x1ae83b+'-'+_0x559733+'/'+_0x2743bf)[_0x5c01('0x19')](_0x3707a0);}return null;};}function patchUpdates(_0x504c63){return function(_0x649fea){try{jsonpatch[_0x5c01('0x20')](_0x649fea,_0x504c63,!![]);}catch(_0x51f93c){return BPromise[_0x5c01('0x21')](_0x51f93c);}return _0x649fea['save']();};}function saveUpdates(_0x2eba4e,_0x3c8d78){return function(_0x10cfb6){if(_0x10cfb6){return _0x10cfb6[_0x5c01('0x22')](_0x2eba4e)[_0x5c01('0x23')](function(_0x1f55d4){return _0x1f55d4;});}return null;};}function removeEntity(_0x406594,_0x212495){return function(_0x4afc0f){if(_0x4afc0f){return _0x4afc0f[_0x5c01('0x24')]()[_0x5c01('0x23')](function(){_0x406594['status'](0xcc)[_0x5c01('0x18')]();});}};}function handleEntityNotFound(_0x11d0ec,_0x3cdfca){return function(_0x55d6a1){if(!_0x55d6a1){_0x11d0ec[_0x5c01('0x16')](0x194);}return _0x55d6a1;};}function handleError(_0x5a5991,_0x22cc0c){_0x22cc0c=_0x22cc0c||0x1f4;return function(_0x23e1af){logger[_0x5c01('0x25')](_0x23e1af[_0x5c01('0x26')]);if(_0x23e1af['name']){delete _0x23e1af[_0x5c01('0x27')];}_0x5a5991[_0x5c01('0x17')](_0x22cc0c)[_0x5c01('0x28')](_0x23e1af);};}exports[_0x5c01('0x29')]=function(_0x573b16,_0x37c103){var _0x45183d={},_0x478ff8={},_0x51fd3b={'count':0x0,'rows':[]};var _0x56d4ee=_[_0x5c01('0x2a')](db[_0x5c01('0x2b')][_0x5c01('0x2c')],function(_0x420514){return{'name':_0x420514['fieldName'],'type':_0x420514['type'][_0x5c01('0x2d')]};});_0x478ff8['model']=_[_0x5c01('0x2a')](_0x56d4ee,'name');_0x478ff8[_0x5c01('0x2e')]=_[_0x5c01('0x2f')](_0x573b16[_0x5c01('0x2e')]);_0x478ff8[_0x5c01('0x30')]=_[_0x5c01('0x31')](_0x478ff8[_0x5c01('0x32')],_0x478ff8[_0x5c01('0x2e')]);_0x45183d[_0x5c01('0x33')]=_['intersection'](_0x478ff8[_0x5c01('0x32')],qs[_0x5c01('0x34')](_0x573b16['query']['fields']));_0x45183d['attributes']=_0x45183d[_0x5c01('0x33')][_0x5c01('0x35')]?_0x45183d[_0x5c01('0x33')]:_0x478ff8[_0x5c01('0x32')];if(!_0x573b16[_0x5c01('0x2e')][_0x5c01('0x36')](_0x5c01('0x37'))){_0x45183d['limit']=qs[_0x5c01('0x1b')](_0x573b16[_0x5c01('0x2e')][_0x5c01('0x1b')]);_0x45183d[_0x5c01('0x1a')]=qs[_0x5c01('0x1a')](_0x573b16[_0x5c01('0x2e')][_0x5c01('0x1a')]);}_0x45183d[_0x5c01('0x38')]=qs[_0x5c01('0x39')](_0x573b16[_0x5c01('0x2e')]['sort']);_0x45183d[_0x5c01('0x3a')]=qs[_0x5c01('0x30')](_[_0x5c01('0x3b')](_0x573b16[_0x5c01('0x2e')],_0x478ff8[_0x5c01('0x30')]),_0x56d4ee);if(_0x573b16[_0x5c01('0x2e')]['filter']){_0x45183d[_0x5c01('0x3a')]=_[_0x5c01('0x3c')](_0x45183d['where'],{'$or':_['map'](_0x56d4ee,function(_0x3bd64c){if(_0x3bd64c[_0x5c01('0x3d')]!==_0x5c01('0x3e')){var _0x32268e={};_0x32268e[_0x3bd64c[_0x5c01('0x27')]]={'$like':'%'+_0x573b16[_0x5c01('0x2e')][_0x5c01('0x3f')]+'%'};return _0x32268e;}})});}_0x45183d=_[_0x5c01('0x3c')]({},_0x45183d,_0x573b16[_0x5c01('0x40')]);var _0xaf24f7={'where':_0x45183d[_0x5c01('0x3a')]};return db['SugarcrmAccount'][_0x5c01('0x1d')](_0xaf24f7)[_0x5c01('0x23')](function(_0x250165){_0x51fd3b['count']=_0x250165;if(_0x573b16[_0x5c01('0x2e')][_0x5c01('0x41')]){_0x45183d[_0x5c01('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x45183d);})[_0x5c01('0x23')](function(_0x5415f1){_0x51fd3b['rows']=_0x5415f1;return _0x51fd3b;})[_0x5c01('0x23')](respondWithFilteredResult(_0x37c103,_0x45183d))[_0x5c01('0x43')](handleError(_0x37c103,null));};exports[_0x5c01('0x44')]=function(_0x671d45,_0x3b4bce){var _0x143f33={'raw':![],'where':{'id':_0x671d45[_0x5c01('0x45')]['id']}},_0x384dc7={};_0x384dc7['model']=_[_0x5c01('0x2f')](db[_0x5c01('0x2b')][_0x5c01('0x2c')]);_0x384dc7[_0x5c01('0x2e')]=_[_0x5c01('0x2f')](_0x671d45[_0x5c01('0x2e')]);_0x384dc7[_0x5c01('0x30')]=_[_0x5c01('0x31')](_0x384dc7[_0x5c01('0x32')],_0x384dc7[_0x5c01('0x2e')]);_0x143f33['attributes']=_['intersection'](_0x384dc7[_0x5c01('0x32')],qs['fields'](_0x671d45[_0x5c01('0x2e')][_0x5c01('0x34')]));_0x143f33['attributes']=_0x143f33[_0x5c01('0x33')][_0x5c01('0x35')]?_0x143f33['attributes']:_0x384dc7[_0x5c01('0x32')];if(_0x671d45[_0x5c01('0x2e')][_0x5c01('0x41')]){_0x143f33['include']=[{'all':!![]}];}_0x143f33=_[_0x5c01('0x3c')]({},_0x143f33,_0x671d45[_0x5c01('0x40')]);return db[_0x5c01('0x2b')][_0x5c01('0x46')](_0x143f33)[_0x5c01('0x23')](handleEntityNotFound(_0x3b4bce,null))[_0x5c01('0x23')](respondWithResult(_0x3b4bce,null))['catch'](handleError(_0x3b4bce,null));};exports[_0x5c01('0x47')]=function(_0x39022f,_0x3d438c){return db[_0x5c01('0x2b')]['create'](_0x39022f[_0x5c01('0x48')],{})[_0x5c01('0x23')](respondWithResult(_0x3d438c,0xc9))[_0x5c01('0x43')](handleError(_0x3d438c,null));};exports[_0x5c01('0x22')]=function(_0xfadd88,_0x11eb03){if(_0xfadd88[_0x5c01('0x48')]['id']){delete _0xfadd88['body']['id'];}return db[_0x5c01('0x2b')][_0x5c01('0x46')]({'where':{'id':_0xfadd88[_0x5c01('0x45')]['id']}})['then'](handleEntityNotFound(_0x11eb03,null))['then'](saveUpdates(_0xfadd88[_0x5c01('0x48')],null))['then'](respondWithResult(_0x11eb03,null))[_0x5c01('0x43')](handleError(_0x11eb03,null));};exports[_0x5c01('0x24')]=function(_0x290c9f,_0x9d2471){return db['SugarcrmAccount'][_0x5c01('0x46')]({'where':{'id':_0x290c9f[_0x5c01('0x45')]['id']}})[_0x5c01('0x23')](handleEntityNotFound(_0x9d2471,null))[_0x5c01('0x23')](removeEntity(_0x9d2471,null))[_0x5c01('0x43')](handleError(_0x9d2471,null));};exports['getConfigurations']=function(_0x8712,_0x3c9fdd,_0x5359dc){var _0x4629bd={};var _0x17c5bd={};var _0x311fc9;var _0x4f9e55;return db[_0x5c01('0x2b')][_0x5c01('0x49')]({'where':{'id':_0x8712[_0x5c01('0x45')]['id']}})[_0x5c01('0x23')](handleEntityNotFound(_0x3c9fdd,null))['then'](function(_0x1b544d){if(_0x1b544d){_0x311fc9=_0x1b544d;_0x17c5bd[_0x5c01('0x32')]=_['keys'](db[_0x5c01('0x4a')][_0x5c01('0x2c')]);_0x17c5bd[_0x5c01('0x2e')]=_['keys'](_0x8712[_0x5c01('0x2e')]);_0x17c5bd['filters']=_[_0x5c01('0x31')](_0x17c5bd['model'],_0x17c5bd[_0x5c01('0x2e')]);_0x4629bd[_0x5c01('0x33')]=_[_0x5c01('0x31')](_0x17c5bd[_0x5c01('0x32')],qs[_0x5c01('0x34')](_0x8712[_0x5c01('0x2e')][_0x5c01('0x34')]));_0x4629bd['attributes']=_0x4629bd[_0x5c01('0x33')][_0x5c01('0x35')]?_0x4629bd[_0x5c01('0x33')]:_0x17c5bd[_0x5c01('0x32')];_0x4629bd[_0x5c01('0x38')]=qs[_0x5c01('0x39')](_0x8712[_0x5c01('0x2e')][_0x5c01('0x39')]);_0x4629bd[_0x5c01('0x3a')]=qs['filters'](_['pick'](_0x8712['query'],_0x17c5bd[_0x5c01('0x30')]));if(_0x8712['query'][_0x5c01('0x3f')]){_0x4629bd[_0x5c01('0x3a')]=_[_0x5c01('0x3c')](_0x4629bd[_0x5c01('0x3a')],{'$or':_[_0x5c01('0x2a')](_0x4629bd[_0x5c01('0x33')],function(_0x10ebe2){var _0x22a0c2={};_0x22a0c2[_0x10ebe2]={'$like':'%'+_0x8712['query']['filter']+'%'};return _0x22a0c2;})});}_0x4629bd=_[_0x5c01('0x3c')]({},_0x4629bd,_0x8712[_0x5c01('0x40')]);return _0x311fc9[_0x5c01('0x4b')](_0x4629bd);}})[_0x5c01('0x23')](function(_0x8df65a){if(_0x8df65a){_0x4f9e55=_0x8df65a[_0x5c01('0x35')];if(!_0x8712['query']['hasOwnProperty'](_0x5c01('0x37'))){_0x4629bd[_0x5c01('0x1b')]=qs[_0x5c01('0x1b')](_0x8712['query'][_0x5c01('0x1b')]);_0x4629bd[_0x5c01('0x1a')]=qs['offset'](_0x8712[_0x5c01('0x2e')]['offset']);}return _0x311fc9['getConfigurations'](_0x4629bd);}})[_0x5c01('0x23')](function(_0x2b9e1c){if(_0x2b9e1c){return _0x2b9e1c?{'count':_0x4f9e55,'rows':_0x2b9e1c}:null;}})['then'](respondWithResult(_0x3c9fdd,null))[_0x5c01('0x43')](handleError(_0x3c9fdd,null));};exports[_0x5c01('0x4c')]=function(_0xc9c0e6,_0x5b22c2,_0x34331f){if(_0xc9c0e6[_0x5c01('0x48')]['id']){delete _0xc9c0e6[_0x5c01('0x48')]['id'];}return db[_0x5c01('0x2b')][_0x5c01('0x49')]({'where':{'id':_0xc9c0e6[_0x5c01('0x45')]['id']}})[_0x5c01('0x23')](handleEntityNotFound(_0x5b22c2,null))[_0x5c01('0x23')](function(_0x1a8ef7){if(_0x1a8ef7){_0xc9c0e6[_0x5c01('0x48')][_0x5c01('0x4d')]=_0x1a8ef7['id'];_0xc9c0e6[_0x5c01('0x48')][_0x5c01('0x4e')]=integrations[_0x5c01('0x4f')](_0xc9c0e6[_0x5c01('0x48')][_0x5c01('0x50')],_0xc9c0e6['body']['type']);_0xc9c0e6[_0x5c01('0x48')][_0x5c01('0x51')]=integrations['getDescriptions'](_0xc9c0e6['body'][_0x5c01('0x50')],_0xc9c0e6[_0x5c01('0x48')]['type']);return db[_0x5c01('0x4a')][_0x5c01('0x47')](_0xc9c0e6[_0x5c01('0x48')],{'include':[{'model':db[_0x5c01('0x52')],'as':'Subjects'},{'model':db[_0x5c01('0x52')],'as':'Descriptions'}]});}return null;})[_0x5c01('0x23')](respondWithResult(_0x5b22c2,null))['catch'](handleError(_0x5b22c2,null));};exports['getFields']=function(_0x1c7217,_0x247087,_0x4168b6){var _0x5c8ee7='';var _0x3f6b1e=['id','name',_0x5c01('0x53'),_0x5c01('0x54'),_0x5c01('0x55'),_0x5c01('0x56'),'duration_hours',_0x5c01('0x57'),_0x5c01('0x58'),_0x5c01('0x59'),_0x5c01('0x5a'),_0x5c01('0x5b')];return db[_0x5c01('0x2b')][_0x5c01('0x49')]({'where':{'id':_0x1c7217['params']['id']},'attributes':['id','username',_0x5c01('0x5c'),'remoteUri']})[_0x5c01('0x23')](handleEntityNotFound(_0x247087,null))[_0x5c01('0x23')](function(_0x1de5ab){if(_0x1de5ab){_0x5c8ee7=_0x1de5ab['remoteUri'];var _0x3a7738=_0x5c8ee7['slice'](-0x1);if(_0x3a7738==='/'){_0x5c8ee7=_0x5c8ee7[_0x5c01('0x5d')](0x0,_0x5c8ee7[_0x5c01('0x5e')](_0x3a7738));}return rp({'method':_0x5c01('0x5f'),'uri':util['format'](_0x5c01('0x60'),_0x5c8ee7,_0x5c01('0x61')),'json':!![],'form':{'method':'login','input_type':_0x5c01('0x62'),'response_type':'JSON','rest_data':JSON[_0x5c01('0x63')]({'user_auth':{'user_name':_0x1de5ab[_0x5c01('0x64')],'password':_0x1de5ab[_0x5c01('0x5c')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x5c01('0x23')](function(_0x54a276){if(_0x54a276&&_0x54a276[_0x5c01('0x27')]!=='Invalid\x20Login'&&_0x54a276['name']!==_0x5c01('0x65')){return rp({'method':'POST','uri':util[_0x5c01('0x66')](_0x5c01('0x60'),_0x5c8ee7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x5c01('0x62'),'response_type':_0x5c01('0x62'),'rest_data':JSON[_0x5c01('0x63')]({'session':_0x54a276['id'],'module_name':'Calls'})}})[_0x5c01('0x23')](function(_0x21cae2){if(_0x21cae2){var _0x401cfe=_[_0x5c01('0x67')](_0x21cae2[_0x5c01('0x68')]);_[_0x5c01('0x69')](_0x401cfe,function(_0x5562f6){return _0x3f6b1e[_0x5c01('0x6a')](_0x5562f6[_0x5c01('0x27')]);});return{'count':_0x401cfe['length'],'rows':_[_0x5c01('0x2a')](_0x401cfe,function(_0x1b98e){return{'id':_0x1b98e[_0x5c01('0x27')],'name':_0x1b98e['label'],'custom':_[_0x5c01('0x6b')](_0x1b98e[_0x5c01('0x27')],'_c')?!![]:![],'options':_0x1b98e[_0x5c01('0x40')]?_[_0x5c01('0x2a')](_['values'](_0x1b98e['options']),function(_0x2ec22f){return{'name':_0x2ec22f[_0x5c01('0x6c')],'value':_0x2ec22f[_0x5c01('0x27')]};}):[]};})};}})['then'](respondWithResult(_0x247087,null))[_0x5c01('0x43')](function(_0x2d2054){var _0x131d18=_0x1c7217[_0x5c01('0x2e')]['test']?0x1f4:_0x2d2054[_0x5c01('0x6d')]||0x1f4;logger[_0x5c01('0x25')](_0x5c01('0x6e'),_0x5c01('0x6f'),_0x131d18,JSON[_0x5c01('0x63')](_0x2d2054));delete _0x2d2054[_0x5c01('0x27')];if(_0x131d18===0x191){_0x131d18=0x190;}_0x247087[_0x5c01('0x17')](_0x131d18)[_0x5c01('0x28')](_0x1c7217[_0x5c01('0x2e')][_0x5c01('0x70')]?{'message':_0x5c01('0x71'),'statusCode':_0x2d2054[_0x5c01('0x6d')]}:_0x2d2054);});}else{var _0x4ba00c=0x1f4;_0x247087[_0x5c01('0x17')](_0x4ba00c)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x74f9=['catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','lastIndexOf','POST','format','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','stringify','Calls','values','remove','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','error','send','index','map','SugarcrmAccount','fieldName','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x74f9,0x129));var _0x974f=function(_0x89fe4e,_0x37412f){_0x89fe4e=_0x89fe4e-0x0;var _0x38e246=_0x74f9[_0x89fe4e];return _0x38e246;};'use strict';var emlformat=require(_0x974f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x974f('0x1'));var jsonpatch=require(_0x974f('0x2'));var rp=require(_0x974f('0x3'));var moment=require(_0x974f('0x4'));var BPromise=require(_0x974f('0x5'));var Mustache=require('mustache');var util=require(_0x974f('0x6'));var path=require(_0x974f('0x7'));var sox=require(_0x974f('0x8'));var csv=require(_0x974f('0x9'));var ejs=require(_0x974f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x974f('0xb'));var crypto=require(_0x974f('0xc'));var jsforce=require(_0x974f('0xd'));var deskjs=require(_0x974f('0xe'));var toCsv=require(_0x974f('0x9'));var querystring=require(_0x974f('0xf'));var Papa=require(_0x974f('0x10'));var Redis=require(_0x974f('0x11'));var authService=require(_0x974f('0x12'));var qs=require(_0x974f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x974f('0x14'));var logger=require(_0x974f('0x15'))(_0x974f('0x16'));var utils=require(_0x974f('0x17'));var config=require(_0x974f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x974f('0x19'))['db'];var integrations=require(_0x974f('0x1a'));function respondWithStatusCode(_0x203f68,_0x15ac84){_0x15ac84=_0x15ac84||0xcc;return function(_0x41616a){if(_0x41616a){return _0x203f68[_0x974f('0x1b')](_0x15ac84);}return _0x203f68[_0x974f('0x1c')](_0x15ac84)[_0x974f('0x1d')]();};}function respondWithResult(_0x1fc521,_0x3d2974){_0x3d2974=_0x3d2974||0xc8;return function(_0x59bb24){if(_0x59bb24){return _0x1fc521[_0x974f('0x1c')](_0x3d2974)[_0x974f('0x1e')](_0x59bb24);}};}function respondWithFilteredResult(_0x31422e,_0x2f90bf){return function(_0x1006c0){if(_0x1006c0){var _0x3a2529=typeof _0x2f90bf['offset']===_0x974f('0x1f')&&typeof _0x2f90bf[_0x974f('0x20')]===_0x974f('0x1f');var _0x5e3ae8=_0x1006c0[_0x974f('0x21')];var _0x3699c2=_0x3a2529?0x0:_0x2f90bf[_0x974f('0x22')];var _0x25a784=_0x3a2529?_0x1006c0[_0x974f('0x21')]:_0x2f90bf[_0x974f('0x22')]+_0x2f90bf[_0x974f('0x20')];var _0x35c90c;if(_0x25a784>=_0x5e3ae8){_0x25a784=_0x5e3ae8;_0x35c90c=0xc8;}else{_0x35c90c=0xce;}_0x31422e[_0x974f('0x1c')](_0x35c90c);return _0x31422e[_0x974f('0x23')](_0x974f('0x24'),_0x3699c2+'-'+_0x25a784+'/'+_0x5e3ae8)[_0x974f('0x1e')](_0x1006c0);}return null;};}function patchUpdates(_0x32e317){return function(_0x482a55){try{jsonpatch['apply'](_0x482a55,_0x32e317,!![]);}catch(_0xfee63f){return BPromise[_0x974f('0x25')](_0xfee63f);}return _0x482a55[_0x974f('0x26')]();};}function saveUpdates(_0x19e8e8,_0x39a051){return function(_0x31cf32){if(_0x31cf32){return _0x31cf32[_0x974f('0x27')](_0x19e8e8)['then'](function(_0x34506b){return _0x34506b;});}return null;};}function removeEntity(_0x6a2081,_0x281d64){return function(_0x277f5d){if(_0x277f5d){return _0x277f5d[_0x974f('0x28')]()[_0x974f('0x29')](function(){_0x6a2081[_0x974f('0x1c')](0xcc)[_0x974f('0x1d')]();});}};}function handleEntityNotFound(_0xdc74be,_0x384c98){return function(_0x42b87c){if(!_0x42b87c){_0xdc74be[_0x974f('0x1b')](0x194);}return _0x42b87c;};}function handleError(_0x397737,_0x3224c2){_0x3224c2=_0x3224c2||0x1f4;return function(_0x51eb45){logger[_0x974f('0x2a')](_0x51eb45['stack']);if(_0x51eb45['name']){delete _0x51eb45['name'];}_0x397737[_0x974f('0x1c')](_0x3224c2)[_0x974f('0x2b')](_0x51eb45);};}exports[_0x974f('0x2c')]=function(_0x3e71ce,_0x78a853){var _0x3a2b4f={},_0x5ec8cf={},_0x35d48f={'count':0x0,'rows':[]};var _0x186722=_[_0x974f('0x2d')](db[_0x974f('0x2e')]['rawAttributes'],function(_0x22b877){return{'name':_0x22b877[_0x974f('0x2f')],'type':_0x22b877['type'][_0x974f('0x30')]};});_0x5ec8cf[_0x974f('0x31')]=_[_0x974f('0x2d')](_0x186722,_0x974f('0x32'));_0x5ec8cf['query']=_[_0x974f('0x33')](_0x3e71ce[_0x974f('0x34')]);_0x5ec8cf[_0x974f('0x35')]=_[_0x974f('0x36')](_0x5ec8cf[_0x974f('0x31')],_0x5ec8cf['query']);_0x3a2b4f['attributes']=_[_0x974f('0x36')](_0x5ec8cf['model'],qs[_0x974f('0x37')](_0x3e71ce[_0x974f('0x34')][_0x974f('0x37')]));_0x3a2b4f[_0x974f('0x38')]=_0x3a2b4f[_0x974f('0x38')][_0x974f('0x39')]?_0x3a2b4f[_0x974f('0x38')]:_0x5ec8cf[_0x974f('0x31')];if(!_0x3e71ce[_0x974f('0x34')][_0x974f('0x3a')]('nolimit')){_0x3a2b4f[_0x974f('0x20')]=qs[_0x974f('0x20')](_0x3e71ce[_0x974f('0x34')][_0x974f('0x20')]);_0x3a2b4f[_0x974f('0x22')]=qs['offset'](_0x3e71ce[_0x974f('0x34')][_0x974f('0x22')]);}_0x3a2b4f['order']=qs[_0x974f('0x3b')](_0x3e71ce[_0x974f('0x34')][_0x974f('0x3b')]);_0x3a2b4f[_0x974f('0x3c')]=qs['filters'](_[_0x974f('0x3d')](_0x3e71ce[_0x974f('0x34')],_0x5ec8cf[_0x974f('0x35')]),_0x186722);if(_0x3e71ce[_0x974f('0x34')][_0x974f('0x3e')]){_0x3a2b4f[_0x974f('0x3c')]=_[_0x974f('0x3f')](_0x3a2b4f[_0x974f('0x3c')],{'$or':_['map'](_0x186722,function(_0x44cfdc){if(_0x44cfdc[_0x974f('0x40')]!==_0x974f('0x41')){var _0x5b991c={};_0x5b991c[_0x44cfdc['name']]={'$like':'%'+_0x3e71ce[_0x974f('0x34')][_0x974f('0x3e')]+'%'};return _0x5b991c;}})});}_0x3a2b4f=_[_0x974f('0x3f')]({},_0x3a2b4f,_0x3e71ce['options']);var _0x433c13={'where':_0x3a2b4f[_0x974f('0x3c')]};return db['SugarcrmAccount']['count'](_0x433c13)[_0x974f('0x29')](function(_0x386761){_0x35d48f['count']=_0x386761;if(_0x3e71ce[_0x974f('0x34')][_0x974f('0x42')]){_0x3a2b4f[_0x974f('0x43')]=[{'all':!![]}];}return db[_0x974f('0x2e')][_0x974f('0x44')](_0x3a2b4f);})['then'](function(_0x8e5294){_0x35d48f[_0x974f('0x45')]=_0x8e5294;return _0x35d48f;})['then'](respondWithFilteredResult(_0x78a853,_0x3a2b4f))['catch'](handleError(_0x78a853,null));};exports[_0x974f('0x46')]=function(_0x53b6f5,_0x10b2a2){var _0x1749c3={'raw':![],'where':{'id':_0x53b6f5[_0x974f('0x47')]['id']}},_0x3e6908={};_0x3e6908[_0x974f('0x31')]=_['keys'](db[_0x974f('0x2e')][_0x974f('0x48')]);_0x3e6908[_0x974f('0x34')]=_[_0x974f('0x33')](_0x53b6f5[_0x974f('0x34')]);_0x3e6908[_0x974f('0x35')]=_[_0x974f('0x36')](_0x3e6908['model'],_0x3e6908[_0x974f('0x34')]);_0x1749c3[_0x974f('0x38')]=_['intersection'](_0x3e6908[_0x974f('0x31')],qs[_0x974f('0x37')](_0x53b6f5['query'][_0x974f('0x37')]));_0x1749c3[_0x974f('0x38')]=_0x1749c3[_0x974f('0x38')][_0x974f('0x39')]?_0x1749c3['attributes']:_0x3e6908[_0x974f('0x31')];if(_0x53b6f5[_0x974f('0x34')][_0x974f('0x42')]){_0x1749c3['include']=[{'all':!![]}];}_0x1749c3=_[_0x974f('0x3f')]({},_0x1749c3,_0x53b6f5[_0x974f('0x49')]);return db[_0x974f('0x2e')][_0x974f('0x4a')](_0x1749c3)[_0x974f('0x29')](handleEntityNotFound(_0x10b2a2,null))['then'](respondWithResult(_0x10b2a2,null))[_0x974f('0x4b')](handleError(_0x10b2a2,null));};exports['create']=function(_0x3b6a31,_0x319a57){return db[_0x974f('0x2e')][_0x974f('0x4c')](_0x3b6a31['body'],{})[_0x974f('0x29')](respondWithResult(_0x319a57,0xc9))[_0x974f('0x4b')](handleError(_0x319a57,null));};exports[_0x974f('0x27')]=function(_0x32aafe,_0x359cd9){if(_0x32aafe['body']['id']){delete _0x32aafe[_0x974f('0x4d')]['id'];}return db[_0x974f('0x2e')]['find']({'where':{'id':_0x32aafe['params']['id']}})[_0x974f('0x29')](handleEntityNotFound(_0x359cd9,null))[_0x974f('0x29')](saveUpdates(_0x32aafe['body'],null))[_0x974f('0x29')](respondWithResult(_0x359cd9,null))[_0x974f('0x4b')](handleError(_0x359cd9,null));};exports[_0x974f('0x28')]=function(_0x136204,_0x2ba6ef){return db['SugarcrmAccount'][_0x974f('0x4a')]({'where':{'id':_0x136204[_0x974f('0x47')]['id']}})[_0x974f('0x29')](handleEntityNotFound(_0x2ba6ef,null))[_0x974f('0x29')](removeEntity(_0x2ba6ef,null))[_0x974f('0x4b')](handleError(_0x2ba6ef,null));};exports[_0x974f('0x4e')]=function(_0x52c96e,_0x38d1f5,_0x3d8285){var _0x5dffc2={};var _0x5a79a2={};var _0x134f02;var _0x1dc588;return db[_0x974f('0x2e')][_0x974f('0x4f')]({'where':{'id':_0x52c96e[_0x974f('0x47')]['id']}})[_0x974f('0x29')](handleEntityNotFound(_0x38d1f5,null))[_0x974f('0x29')](function(_0x1934ef){if(_0x1934ef){_0x134f02=_0x1934ef;_0x5a79a2[_0x974f('0x31')]=_[_0x974f('0x33')](db[_0x974f('0x50')][_0x974f('0x48')]);_0x5a79a2[_0x974f('0x34')]=_[_0x974f('0x33')](_0x52c96e['query']);_0x5a79a2['filters']=_['intersection'](_0x5a79a2[_0x974f('0x31')],_0x5a79a2[_0x974f('0x34')]);_0x5dffc2[_0x974f('0x38')]=_[_0x974f('0x36')](_0x5a79a2['model'],qs[_0x974f('0x37')](_0x52c96e[_0x974f('0x34')][_0x974f('0x37')]));_0x5dffc2['attributes']=_0x5dffc2['attributes'][_0x974f('0x39')]?_0x5dffc2[_0x974f('0x38')]:_0x5a79a2['model'];_0x5dffc2[_0x974f('0x51')]=qs['sort'](_0x52c96e[_0x974f('0x34')][_0x974f('0x3b')]);_0x5dffc2[_0x974f('0x3c')]=qs['filters'](_[_0x974f('0x3d')](_0x52c96e[_0x974f('0x34')],_0x5a79a2[_0x974f('0x35')]));if(_0x52c96e[_0x974f('0x34')][_0x974f('0x3e')]){_0x5dffc2[_0x974f('0x3c')]=_[_0x974f('0x3f')](_0x5dffc2[_0x974f('0x3c')],{'$or':_[_0x974f('0x2d')](_0x5dffc2[_0x974f('0x38')],function(_0x83d84a){var _0x276a16={};_0x276a16[_0x83d84a]={'$like':'%'+_0x52c96e[_0x974f('0x34')]['filter']+'%'};return _0x276a16;})});}_0x5dffc2=_['merge']({},_0x5dffc2,_0x52c96e[_0x974f('0x49')]);return _0x134f02[_0x974f('0x4e')](_0x5dffc2);}})[_0x974f('0x29')](function(_0x22ec2d){if(_0x22ec2d){_0x1dc588=_0x22ec2d[_0x974f('0x39')];if(!_0x52c96e[_0x974f('0x34')][_0x974f('0x3a')](_0x974f('0x52'))){_0x5dffc2[_0x974f('0x20')]=qs[_0x974f('0x20')](_0x52c96e['query'][_0x974f('0x20')]);_0x5dffc2[_0x974f('0x22')]=qs[_0x974f('0x22')](_0x52c96e['query'][_0x974f('0x22')]);}return _0x134f02[_0x974f('0x4e')](_0x5dffc2);}})[_0x974f('0x29')](function(_0x4b9709){if(_0x4b9709){return _0x4b9709?{'count':_0x1dc588,'rows':_0x4b9709}:null;}})['then'](respondWithResult(_0x38d1f5,null))[_0x974f('0x4b')](handleError(_0x38d1f5,null));};exports[_0x974f('0x53')]=function(_0x3c0690,_0x190f06,_0x2e509c){if(_0x3c0690[_0x974f('0x4d')]['id']){delete _0x3c0690['body']['id'];}return db[_0x974f('0x2e')][_0x974f('0x4f')]({'where':{'id':_0x3c0690['params']['id']}})[_0x974f('0x29')](handleEntityNotFound(_0x190f06,null))['then'](function(_0xa835c0){if(_0xa835c0){_0x3c0690[_0x974f('0x4d')][_0x974f('0x54')]=_0xa835c0['id'];_0x3c0690[_0x974f('0x4d')][_0x974f('0x55')]=integrations[_0x974f('0x56')](_0x3c0690[_0x974f('0x4d')][_0x974f('0x57')],_0x3c0690[_0x974f('0x4d')][_0x974f('0x40')]);_0x3c0690['body']['Descriptions']=integrations['getDescriptions'](_0x3c0690[_0x974f('0x4d')][_0x974f('0x57')],_0x3c0690[_0x974f('0x4d')]['type']);return db['SugarcrmConfiguration'][_0x974f('0x4c')](_0x3c0690[_0x974f('0x4d')],{'include':[{'model':db[_0x974f('0x58')],'as':_0x974f('0x55')},{'model':db[_0x974f('0x58')],'as':_0x974f('0x59')}]});}return null;})['then'](respondWithResult(_0x190f06,null))['catch'](handleError(_0x190f06,null));};exports[_0x974f('0x5a')]=function(_0x149f65,_0x2b7cf7,_0x23d0f6){var _0xc75b98='';var _0x589cb9=['id',_0x974f('0x32'),_0x974f('0x5b'),_0x974f('0x5c'),_0x974f('0x5d'),_0x974f('0x5e'),_0x974f('0x5f'),_0x974f('0x60'),_0x974f('0x61'),_0x974f('0x62'),_0x974f('0x63'),'direction'];return db[_0x974f('0x2e')][_0x974f('0x4f')]({'where':{'id':_0x149f65[_0x974f('0x47')]['id']},'attributes':['id',_0x974f('0x64'),_0x974f('0x65'),_0x974f('0x66')]})[_0x974f('0x29')](handleEntityNotFound(_0x2b7cf7,null))[_0x974f('0x29')](function(_0x577382){if(_0x577382){_0xc75b98=_0x577382[_0x974f('0x66')];var _0x1fc3a7=_0xc75b98['slice'](-0x1);if(_0x1fc3a7==='/'){_0xc75b98=_0xc75b98['substring'](0x0,_0xc75b98[_0x974f('0x67')](_0x1fc3a7));}return rp({'method':_0x974f('0x68'),'uri':util[_0x974f('0x69')](_0x974f('0x6a'),_0xc75b98,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x974f('0x6b'),'input_type':'JSON','response_type':_0x974f('0x6c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x577382['username'],'password':_0x577382[_0x974f('0x65')],'encryption':_0x974f('0x6d')},'application':_0x974f('0x6e')})}});}})[_0x974f('0x29')](function(_0x23fb42){if(_0x23fb42&&_0x23fb42['name']!==_0x974f('0x6f')&&_0x23fb42[_0x974f('0x32')]!==_0x974f('0x70')){return rp({'method':'POST','uri':util['format']('%s%s',_0xc75b98,_0x974f('0x71')),'json':!![],'form':{'method':_0x974f('0x72'),'input_type':_0x974f('0x6c'),'response_type':'JSON','rest_data':JSON[_0x974f('0x73')]({'session':_0x23fb42['id'],'module_name':_0x974f('0x74')})}})['then'](function(_0x517764){if(_0x517764){var _0x366192=_[_0x974f('0x75')](_0x517764['module_fields']);_[_0x974f('0x76')](_0x366192,function(_0x2fa98a){return _0x589cb9['includes'](_0x2fa98a[_0x974f('0x32')]);});return{'count':_0x366192['length'],'rows':_[_0x974f('0x2d')](_0x366192,function(_0x5b4981){return{'id':_0x5b4981[_0x974f('0x32')],'name':_0x5b4981['label'],'custom':_[_0x974f('0x77')](_0x5b4981[_0x974f('0x32')],'_c')?!![]:![],'options':_0x5b4981['options']?_['map'](_[_0x974f('0x75')](_0x5b4981['options']),function(_0x3ee066){return{'name':_0x3ee066[_0x974f('0x78')],'value':_0x3ee066[_0x974f('0x32')]};}):[]};})};}})['then'](respondWithResult(_0x2b7cf7,null))[_0x974f('0x4b')](function(_0x10a9bc){var _0x16870d=_0x149f65[_0x974f('0x34')][_0x974f('0x79')]?0x1f4:_0x10a9bc['statusCode']||0x1f4;logger[_0x974f('0x2a')](_0x974f('0x7a'),_0x974f('0x5a'),_0x16870d,JSON['stringify'](_0x10a9bc));delete _0x10a9bc[_0x974f('0x32')];if(_0x16870d===0x191){_0x16870d=0x190;}_0x2b7cf7['status'](_0x16870d)[_0x974f('0x2b')](_0x149f65['query']['test']?{'message':_0x974f('0x7b'),'statusCode':_0x10a9bc['statusCode']}:_0x10a9bc);});}else{var _0x1572bf=0x1f4;_0x2b7cf7['status'](_0x1572bf)[_0x974f('0x2b')]({'message':_0x974f('0x7b'),'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 379dd7a..2c33235 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 _0x8296=['rimraf','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x44bb4e,_0x54d482){var _0x40d0c0=function(_0xa44f63){while(--_0xa44f63){_0x44bb4e['push'](_0x44bb4e['shift']());}};_0x40d0c0(++_0x54d482);}(_0x8296,0x1a9));var _0x6829=function(_0x1f28bb,_0x263b59){_0x1f28bb=_0x1f28bb-0x0;var _0x4be47c=_0x8296[_0x1f28bb];return _0x4be47c;};'use strict';var _=require(_0x6829('0x0'));var util=require(_0x6829('0x1'));var logger=require(_0x6829('0x2'))(_0x6829('0x3'));var moment=require(_0x6829('0x4'));var BPromise=require('bluebird');var rp=require(_0x6829('0x5'));var fs=require('fs');var path=require(_0x6829('0x6'));var rimraf=require(_0x6829('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x6829('0x8'));module['exports']=function(_0x23dfaf,_0x4fb455){return _0x23dfaf[_0x6829('0x9')](_0x6829('0xa'),attributes,{'tableName':_0x6829('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78d1=['request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5df2fc,_0x34cf52){var _0x123c47=function(_0x51edd7){while(--_0x51edd7){_0x5df2fc['push'](_0x5df2fc['shift']());}};_0x123c47(++_0x34cf52);}(_0x78d1,0x159));var _0x178d=function(_0x215da5,_0x1b1163){_0x215da5=_0x215da5-0x0;var _0x17eea7=_0x78d1[_0x215da5];return _0x17eea7;};'use strict';var _=require(_0x178d('0x0'));var util=require(_0x178d('0x1'));var logger=require(_0x178d('0x2'))('api');var moment=require(_0x178d('0x3'));var BPromise=require(_0x178d('0x4'));var rp=require(_0x178d('0x5'));var fs=require('fs');var path=require(_0x178d('0x6'));var rimraf=require(_0x178d('0x7'));var config=require(_0x178d('0x8'));var attributes=require(_0x178d('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x178d('0xa')]=function(_0x39b461,_0x412106){return _0x39b461[_0x178d('0xb')](_0x178d('0xc'),attributes,{'tableName':_0x178d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 011546c..3d8cc58 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 _0x9fc6=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSugarcrmAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowSugarcrmAccount','SugarcrmAccount','find','util'];(function(_0x484e47,_0x155a54){var _0x5c6ea5=function(_0x312683){while(--_0x312683){_0x484e47['push'](_0x484e47['shift']());}};_0x5c6ea5(++_0x155a54);}(_0x9fc6,0x153));var _0x69fc=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x9fc6[_0x38ced4];return _0x547c07;};'use strict';var _=require('lodash');var util=require(_0x69fc('0x0'));var moment=require(_0x69fc('0x1'));var BPromise=require(_0x69fc('0x2'));var rs=require(_0x69fc('0x3'));var fs=require('fs');var Redis=require(_0x69fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x69fc('0x5'));var logger=require('../../config/logger')(_0x69fc('0x6'));var config=require(_0x69fc('0x7'));var jayson=require(_0x69fc('0x8'));var client=jayson[_0x69fc('0x9')][_0x69fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf80dcf,_0x1ffe7c,_0xc052ef){return new BPromise(function(_0x29c94c,_0x125816){return client['request'](_0xf80dcf,_0xc052ef)[_0x69fc('0xb')](function(_0x3ae5f7){logger[_0x69fc('0xc')](_0x69fc('0xd'),_0x1ffe7c,_0x69fc('0xe'));logger[_0x69fc('0xf')](_0x69fc('0x10'),_0x1ffe7c,_0x69fc('0xe'),JSON[_0x69fc('0x11')](_0x3ae5f7));if(_0x3ae5f7[_0x69fc('0x12')]){if(_0x3ae5f7[_0x69fc('0x12')]['code']===0x1f4){logger[_0x69fc('0x12')](_0x69fc('0xd'),_0x1ffe7c,_0x3ae5f7['error']['message']);return _0x125816(_0x3ae5f7[_0x69fc('0x12')][_0x69fc('0x13')]);}logger[_0x69fc('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ffe7c,_0x3ae5f7[_0x69fc('0x12')][_0x69fc('0x13')]);return _0x29c94c(_0x3ae5f7[_0x69fc('0x12')][_0x69fc('0x13')]);}else{logger[_0x69fc('0xc')](_0x69fc('0xd'),_0x1ffe7c,'request\x20sent');_0x29c94c(_0x3ae5f7[_0x69fc('0x14')][_0x69fc('0x13')]);}})['catch'](function(_0x18e8d8){logger[_0x69fc('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ffe7c,_0x18e8d8);_0x125816(_0x18e8d8);});});}exports[_0x69fc('0x15')]=function(_0x475c90){var _0x57bd4c=this;return new Promise(function(_0x2fe805,_0x4f22b0){return db['SugarcrmAccount'][_0x69fc('0x16')]({'raw':_0x475c90['options']?_0x475c90[_0x69fc('0x17')][_0x69fc('0x18')]===undefined?!![]:![]:!![],'where':_0x475c90[_0x69fc('0x17')]?_0x475c90['options'][_0x69fc('0x19')]||null:null,'attributes':_0x475c90['options']?_0x475c90[_0x69fc('0x17')][_0x69fc('0x1a')]||null:null,'limit':_0x475c90['options']?_0x475c90[_0x69fc('0x17')]['limit']||null:null,'include':_0x475c90[_0x69fc('0x17')]?_0x475c90[_0x69fc('0x17')][_0x69fc('0x1b')]?_['map'](_0x475c90['options'][_0x69fc('0x1b')],function(_0x513787){return{'model':db[_0x513787[_0x69fc('0x1c')]],'as':_0x513787['as'],'attributes':_0x513787[_0x69fc('0x1a')],'include':_0x513787[_0x69fc('0x1b')]?_[_0x69fc('0x1d')](_0x513787['include'],function(_0x316a6a){return{'model':db[_0x316a6a[_0x69fc('0x1c')]],'as':_0x316a6a['as'],'attributes':_0x316a6a['attributes'],'include':_0x316a6a['include']?_[_0x69fc('0x1d')](_0x316a6a[_0x69fc('0x1b')],function(_0x31705c){return{'model':db[_0x31705c[_0x69fc('0x1c')]],'as':_0x31705c['as'],'attributes':_0x31705c[_0x69fc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30ea3d){logger['info'](_0x69fc('0x15'),_0x475c90);logger['debug']('GetSugarcrmAccount',_0x475c90,JSON['stringify'](_0x30ea3d));_0x2fe805(_0x30ea3d);})[_0x69fc('0x1e')](function(_0x5a99cf){logger[_0x69fc('0x12')](_0x69fc('0x15'),_0x5a99cf[_0x69fc('0x13')],_0x475c90);_0x4f22b0(_0x57bd4c['error'](0x1f4,_0x5a99cf[_0x69fc('0x13')]));});});};exports[_0x69fc('0x1f')]=function(_0x48e244){var _0x7de196=this;return new Promise(function(_0x4e06d4,_0x46d0d3){return db[_0x69fc('0x20')][_0x69fc('0x21')]({'raw':_0x48e244['options']?_0x48e244[_0x69fc('0x17')][_0x69fc('0x18')]===undefined?!![]:![]:!![],'where':_0x48e244[_0x69fc('0x17')]?_0x48e244[_0x69fc('0x17')]['where']||null:null,'attributes':_0x48e244[_0x69fc('0x17')]?_0x48e244[_0x69fc('0x17')]['attributes']||null:null,'include':_0x48e244[_0x69fc('0x17')]?_0x48e244[_0x69fc('0x17')][_0x69fc('0x1b')]?_[_0x69fc('0x1d')](_0x48e244[_0x69fc('0x17')][_0x69fc('0x1b')],function(_0x483ac2){return{'model':db[_0x483ac2[_0x69fc('0x1c')]],'as':_0x483ac2['as'],'attributes':_0x483ac2[_0x69fc('0x1a')],'include':_0x483ac2[_0x69fc('0x1b')]?_[_0x69fc('0x1d')](_0x483ac2[_0x69fc('0x1b')],function(_0x378bc0){return{'model':db[_0x378bc0['model']],'as':_0x378bc0['as'],'attributes':_0x378bc0['attributes'],'include':_0x378bc0[_0x69fc('0x1b')]?_[_0x69fc('0x1d')](_0x378bc0['include'],function(_0xe6589f){return{'model':db[_0xe6589f[_0x69fc('0x1c')]],'as':_0xe6589f['as'],'attributes':_0xe6589f[_0x69fc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x526064){logger[_0x69fc('0xc')](_0x69fc('0x1f'),_0x48e244);logger[_0x69fc('0xf')](_0x69fc('0x1f'),_0x48e244,JSON['stringify'](_0x526064));_0x4e06d4(_0x526064);})[_0x69fc('0x1e')](function(_0x5f0451){logger[_0x69fc('0x12')](_0x69fc('0x1f'),_0x5f0451[_0x69fc('0x13')],_0x48e244);_0x46d0d3(_0x7de196[_0x69fc('0x12')](0x1f4,_0x5f0451[_0x69fc('0x13')]));});});}; \ No newline at end of file +var _0xc6e4=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','map','include','model','debug','ShowSugarcrmAccount','find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request'];(function(_0x53c02b,_0x110393){var _0x279fad=function(_0x4290ef){while(--_0x4290ef){_0x53c02b['push'](_0x53c02b['shift']());}};_0x279fad(++_0x110393);}(_0xc6e4,0x1d1));var _0x4c6e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc6e4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x4c6e('0x0'));var moment=require(_0x4c6e('0x1'));var BPromise=require(_0x4c6e('0x2'));var rs=require(_0x4c6e('0x3'));var fs=require('fs');var Redis=require(_0x4c6e('0x4'));var db=require(_0x4c6e('0x5'))['db'];var utils=require(_0x4c6e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4c6e('0x7'));var client=jayson[_0x4c6e('0x8')][_0x4c6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x462751,_0xb2f306,_0x491b16){return new BPromise(function(_0x4c6a9b,_0x2f57ba){return client[_0x4c6e('0xa')](_0x462751,_0x491b16)['then'](function(_0x44b969){logger[_0x4c6e('0xb')](_0x4c6e('0xc'),_0xb2f306,_0x4c6e('0xd'));logger['debug'](_0x4c6e('0xe'),_0xb2f306,_0x4c6e('0xd'),JSON[_0x4c6e('0xf')](_0x44b969));if(_0x44b969[_0x4c6e('0x10')]){if(_0x44b969['error']['code']===0x1f4){logger[_0x4c6e('0x10')](_0x4c6e('0xc'),_0xb2f306,_0x44b969['error'][_0x4c6e('0x11')]);return _0x2f57ba(_0x44b969[_0x4c6e('0x10')][_0x4c6e('0x11')]);}logger[_0x4c6e('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0xb2f306,_0x44b969[_0x4c6e('0x10')]['message']);return _0x4c6a9b(_0x44b969['error'][_0x4c6e('0x11')]);}else{logger[_0x4c6e('0xb')](_0x4c6e('0xc'),_0xb2f306,_0x4c6e('0xd'));_0x4c6a9b(_0x44b969[_0x4c6e('0x12')][_0x4c6e('0x11')]);}})[_0x4c6e('0x13')](function(_0x18e4bc){logger[_0x4c6e('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0xb2f306,_0x18e4bc);_0x2f57ba(_0x18e4bc);});});}exports[_0x4c6e('0x14')]=function(_0x1b1bc6){var _0x214df5=this;return new Promise(function(_0x3ed9fa,_0x38b8d7){return db[_0x4c6e('0x15')]['findAll']({'raw':_0x1b1bc6['options']?_0x1b1bc6[_0x4c6e('0x16')][_0x4c6e('0x17')]===undefined?!![]:![]:!![],'where':_0x1b1bc6[_0x4c6e('0x16')]?_0x1b1bc6[_0x4c6e('0x16')][_0x4c6e('0x18')]||null:null,'attributes':_0x1b1bc6['options']?_0x1b1bc6['options'][_0x4c6e('0x19')]||null:null,'limit':_0x1b1bc6['options']?_0x1b1bc6[_0x4c6e('0x16')][_0x4c6e('0x1a')]||null:null,'include':_0x1b1bc6[_0x4c6e('0x16')]?_0x1b1bc6['options']['include']?_[_0x4c6e('0x1b')](_0x1b1bc6[_0x4c6e('0x16')][_0x4c6e('0x1c')],function(_0x322974){return{'model':db[_0x322974['model']],'as':_0x322974['as'],'attributes':_0x322974[_0x4c6e('0x19')],'include':_0x322974[_0x4c6e('0x1c')]?_['map'](_0x322974[_0x4c6e('0x1c')],function(_0x3e1ac5){return{'model':db[_0x3e1ac5[_0x4c6e('0x1d')]],'as':_0x3e1ac5['as'],'attributes':_0x3e1ac5[_0x4c6e('0x19')],'include':_0x3e1ac5['include']?_[_0x4c6e('0x1b')](_0x3e1ac5[_0x4c6e('0x1c')],function(_0x557b97){return{'model':db[_0x557b97[_0x4c6e('0x1d')]],'as':_0x557b97['as'],'attributes':_0x557b97[_0x4c6e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x172474){logger[_0x4c6e('0xb')](_0x4c6e('0x14'),_0x1b1bc6);logger[_0x4c6e('0x1e')](_0x4c6e('0x14'),_0x1b1bc6,JSON[_0x4c6e('0xf')](_0x172474));_0x3ed9fa(_0x172474);})[_0x4c6e('0x13')](function(_0x2b90a0){logger[_0x4c6e('0x10')](_0x4c6e('0x14'),_0x2b90a0[_0x4c6e('0x11')],_0x1b1bc6);_0x38b8d7(_0x214df5[_0x4c6e('0x10')](0x1f4,_0x2b90a0[_0x4c6e('0x11')]));});});};exports[_0x4c6e('0x1f')]=function(_0x379525){var _0x533579=this;return new Promise(function(_0x24ad54,_0x540e65){return db[_0x4c6e('0x15')][_0x4c6e('0x20')]({'raw':_0x379525['options']?_0x379525['options']['raw']===undefined?!![]:![]:!![],'where':_0x379525[_0x4c6e('0x16')]?_0x379525[_0x4c6e('0x16')][_0x4c6e('0x18')]||null:null,'attributes':_0x379525[_0x4c6e('0x16')]?_0x379525[_0x4c6e('0x16')][_0x4c6e('0x19')]||null:null,'include':_0x379525['options']?_0x379525['options'][_0x4c6e('0x1c')]?_[_0x4c6e('0x1b')](_0x379525[_0x4c6e('0x16')][_0x4c6e('0x1c')],function(_0x1af869){return{'model':db[_0x1af869[_0x4c6e('0x1d')]],'as':_0x1af869['as'],'attributes':_0x1af869[_0x4c6e('0x19')],'include':_0x1af869[_0x4c6e('0x1c')]?_['map'](_0x1af869['include'],function(_0x58584c){return{'model':db[_0x58584c[_0x4c6e('0x1d')]],'as':_0x58584c['as'],'attributes':_0x58584c[_0x4c6e('0x19')],'include':_0x58584c['include']?_[_0x4c6e('0x1b')](_0x58584c[_0x4c6e('0x1c')],function(_0x5a4261){return{'model':db[_0x5a4261[_0x4c6e('0x1d')]],'as':_0x5a4261['as'],'attributes':_0x5a4261[_0x4c6e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4c6e('0x21')](function(_0x22ecbc){logger[_0x4c6e('0xb')](_0x4c6e('0x1f'),_0x379525);logger[_0x4c6e('0x1e')](_0x4c6e('0x1f'),_0x379525,JSON[_0x4c6e('0xf')](_0x22ecbc));_0x24ad54(_0x22ecbc);})[_0x4c6e('0x13')](function(_0x45f5bd){logger['error'](_0x4c6e('0x1f'),_0x45f5bd[_0x4c6e('0x11')],_0x379525);_0x540e65(_0x533579[_0x4c6e('0x10')](0x1f4,_0x45f5bd[_0x4c6e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e995aaf..e763c9f 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 _0xe755=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update'];(function(_0x1cf16b,_0x33ae9b){var _0x1aa60e=function(_0x578e33){while(--_0x578e33){_0x1cf16b['push'](_0x1cf16b['shift']());}};_0x1aa60e(++_0x33ae9b);}(_0xe755,0xa3));var _0x5e75=function(_0x35ee21,_0x28fc95){_0x35ee21=_0x35ee21-0x0;var _0x4f2bfd=_0xe755[_0x35ee21];return _0x4f2bfd;};'use strict';var multer=require(_0x5e75('0x0'));var util=require(_0x5e75('0x1'));var path=require(_0x5e75('0x2'));var timeout=require(_0x5e75('0x3'));var express=require(_0x5e75('0x4'));var router=express['Router']();var fs_extra=require(_0x5e75('0x5'));var auth=require(_0x5e75('0x6'));var interaction=require(_0x5e75('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x5e75('0x8')]('/',auth['isAuthenticated'](),controller[_0x5e75('0x9')]);router[_0x5e75('0x8')](_0x5e75('0xa'),auth[_0x5e75('0xb')](),controller[_0x5e75('0xc')]);router[_0x5e75('0x8')]('/:id/fields',auth[_0x5e75('0xb')](),controller[_0x5e75('0xd')]);router[_0x5e75('0x8')](_0x5e75('0xe'),auth[_0x5e75('0xb')](),controller[_0x5e75('0xf')]);router['get'](_0x5e75('0x10'),auth[_0x5e75('0xb')](),controller[_0x5e75('0x11')]);router[_0x5e75('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5e75('0x13')](_0x5e75('0xa'),auth[_0x5e75('0xb')](),controller[_0x5e75('0x14')]);router[_0x5e75('0x15')](_0x5e75('0xa'),auth[_0x5e75('0xb')](),controller['destroy']);module[_0x5e75('0x16')]=router; \ No newline at end of file +var _0x7a7d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x3967e8,_0x3cd8a3){var _0x1831d3=function(_0x718f6f){while(--_0x718f6f){_0x3967e8['push'](_0x3967e8['shift']());}};_0x1831d3(++_0x3cd8a3);}(_0x7a7d,0xd2));var _0xd7a7=function(_0x3987f5,_0x29a73d){_0x3987f5=_0x3987f5-0x0;var _0x42826f=_0x7a7d[_0x3987f5];return _0x42826f;};'use strict';var multer=require(_0xd7a7('0x0'));var util=require(_0xd7a7('0x1'));var path=require(_0xd7a7('0x2'));var timeout=require(_0xd7a7('0x3'));var express=require(_0xd7a7('0x4'));var router=express[_0xd7a7('0x5')]();var fs_extra=require(_0xd7a7('0x6'));var auth=require(_0xd7a7('0x7'));var interaction=require(_0xd7a7('0x8'));var config=require(_0xd7a7('0x9'));var controller=require(_0xd7a7('0xa'));router[_0xd7a7('0xb')]('/',auth['isAuthenticated'](),controller[_0xd7a7('0xc')]);router[_0xd7a7('0xb')](_0xd7a7('0xd'),auth[_0xd7a7('0xe')](),controller[_0xd7a7('0xf')]);router[_0xd7a7('0xb')]('/:id/fields',auth[_0xd7a7('0xe')](),controller['getFields']);router['get'](_0xd7a7('0x10'),auth['isAuthenticated'](),controller[_0xd7a7('0x11')]);router[_0xd7a7('0xb')](_0xd7a7('0x12'),auth[_0xd7a7('0xe')](),controller[_0xd7a7('0x13')]);router[_0xd7a7('0x14')]('/',auth[_0xd7a7('0xe')](),controller['create']);router[_0xd7a7('0x15')]('/:id',auth[_0xd7a7('0xe')](),controller[_0xd7a7('0x16')]);router['delete'](_0xd7a7('0xd'),auth[_0xd7a7('0xe')](),controller[_0xd7a7('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index dafcb0d..bcdbfb9 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 _0x7a67=['STRING','exports'];(function(_0x5636e7,_0x25613a){var _0x81da06=function(_0x4c0c4d){while(--_0x4c0c4d){_0x5636e7['push'](_0x5636e7['shift']());}};_0x81da06(++_0x25613a);}(_0x7a67,0xed));var _0x77a6=function(_0x5855af,_0x26346d){_0x5855af=_0x5855af-0x0;var _0x4530de=_0x7a67[_0x5855af];return _0x4530de;};'use strict';var Sequelize=require('sequelize');module[_0x77a6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77a6('0x1')]}}; \ No newline at end of file +var _0x43de=['sequelize','exports','STRING'];(function(_0x2722d3,_0x1d03dc){var _0x4733c1=function(_0xd8bc6a){while(--_0xd8bc6a){_0x2722d3['push'](_0x2722d3['shift']());}};_0x4733c1(++_0x1d03dc);}(_0x43de,0x93));var _0xe43d=function(_0xe9c2c2,_0x5be188){_0xe9c2c2=_0xe9c2c2-0x0;var _0x26c290=_0x43de[_0xe9c2c2];return _0x26c290;};'use strict';var Sequelize=require(_0xe43d('0x0'));module[_0xe43d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe43d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 54f736a..42c80ec 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 _0x1aaf=['rows','catch','show','params','length','options','find','create','getFields','findOne','SugarcrmField','order','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x16cfb0,_0x28d646){var _0x3d8504=function(_0x415941){while(--_0x415941){_0x16cfb0['push'](_0x16cfb0['shift']());}};_0x3d8504(++_0x28d646);}(_0x1aaf,0xfc));var _0xf1aa=function(_0x12a518,_0x1554db){_0x12a518=_0x12a518-0x0;var _0x44be1e=_0x1aaf[_0x12a518];return _0x44be1e;};'use strict';var emlformat=require(_0xf1aa('0x0'));var rimraf=require(_0xf1aa('0x1'));var zipdir=require(_0xf1aa('0x2'));var jsonpatch=require(_0xf1aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1aa('0x4'));var Mustache=require('mustache');var util=require(_0xf1aa('0x5'));var path=require(_0xf1aa('0x6'));var sox=require(_0xf1aa('0x7'));var csv=require(_0xf1aa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1aa('0x9'));var _=require(_0xf1aa('0xa'));var squel=require('squel');var crypto=require(_0xf1aa('0xb'));var jsforce=require(_0xf1aa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf1aa('0x8'));var querystring=require('querystring');var Papa=require(_0xf1aa('0xd'));var Redis=require(_0xf1aa('0xe'));var authService=require(_0xf1aa('0xf'));var qs=require(_0xf1aa('0x10'));var as=require(_0xf1aa('0x11'));var hardwareService=require(_0xf1aa('0x12'));var logger=require(_0xf1aa('0x13'))('api');var utils=require(_0xf1aa('0x14'));var config=require(_0xf1aa('0x15'));var licenseUtil=require(_0xf1aa('0x16'));var db=require(_0xf1aa('0x17'))['db'];function respondWithStatusCode(_0x471ea7,_0x1d2148){_0x1d2148=_0x1d2148||0xcc;return function(_0x5802f9){if(_0x5802f9){return _0x471ea7[_0xf1aa('0x18')](_0x1d2148);}return _0x471ea7[_0xf1aa('0x19')](_0x1d2148)[_0xf1aa('0x1a')]();};}function respondWithResult(_0x24761d,_0x2f9040){_0x2f9040=_0x2f9040||0xc8;return function(_0x4895f4){if(_0x4895f4){return _0x24761d[_0xf1aa('0x19')](_0x2f9040)[_0xf1aa('0x1b')](_0x4895f4);}};}function respondWithFilteredResult(_0x18cf68,_0x4ded5e){return function(_0x3f94ce){if(_0x3f94ce){var _0x2f67cd=typeof _0x4ded5e[_0xf1aa('0x1c')]===_0xf1aa('0x1d')&&typeof _0x4ded5e[_0xf1aa('0x1e')]===_0xf1aa('0x1d');var _0x5d38a5=_0x3f94ce[_0xf1aa('0x1f')];var _0x578d0d=_0x2f67cd?0x0:_0x4ded5e[_0xf1aa('0x1c')];var _0x28c2c2=_0x2f67cd?_0x3f94ce[_0xf1aa('0x1f')]:_0x4ded5e['offset']+_0x4ded5e[_0xf1aa('0x1e')];var _0x5086f0;if(_0x28c2c2>=_0x5d38a5){_0x28c2c2=_0x5d38a5;_0x5086f0=0xc8;}else{_0x5086f0=0xce;}_0x18cf68[_0xf1aa('0x19')](_0x5086f0);return _0x18cf68[_0xf1aa('0x20')](_0xf1aa('0x21'),_0x578d0d+'-'+_0x28c2c2+'/'+_0x5d38a5)['json'](_0x3f94ce);}return null;};}function patchUpdates(_0x54e914){return function(_0x4145b6){try{jsonpatch['apply'](_0x4145b6,_0x54e914,!![]);}catch(_0x2a86a0){return BPromise[_0xf1aa('0x22')](_0x2a86a0);}return _0x4145b6['save']();};}function saveUpdates(_0x5ed154,_0x3bd16c){return function(_0x1b3b3c){if(_0x1b3b3c){return _0x1b3b3c[_0xf1aa('0x23')](_0x5ed154)['then'](function(_0x4c06db){return _0x4c06db;});}return null;};}function removeEntity(_0x5b04df,_0xf380fd){return function(_0x38a256){if(_0x38a256){return _0x38a256[_0xf1aa('0x24')]()[_0xf1aa('0x25')](function(){_0x5b04df[_0xf1aa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b522d,_0x246680){return function(_0x15f270){if(!_0x15f270){_0x9b522d['sendStatus'](0x194);}return _0x15f270;};}function handleError(_0x23e5ad,_0x180c6c){_0x180c6c=_0x180c6c||0x1f4;return function(_0x347faf){logger['error'](_0x347faf[_0xf1aa('0x26')]);if(_0x347faf[_0xf1aa('0x27')]){delete _0x347faf['name'];}_0x23e5ad[_0xf1aa('0x19')](_0x180c6c)[_0xf1aa('0x28')](_0x347faf);};}exports[_0xf1aa('0x29')]=function(_0x58e899,_0x3ef8dd){var _0x5a1ea3={},_0x2e5085={},_0x10c03a={'count':0x0,'rows':[]};var _0x2f2919=_[_0xf1aa('0x2a')](db[_0xf1aa('0x2b')][_0xf1aa('0x2c')],function(_0x2a8502){return{'name':_0x2a8502[_0xf1aa('0x2d')],'type':_0x2a8502['type'][_0xf1aa('0x2e')]};});_0x2e5085['model']=_[_0xf1aa('0x2a')](_0x2f2919,'name');_0x2e5085[_0xf1aa('0x2f')]=_[_0xf1aa('0x30')](_0x58e899['query']);_0x2e5085[_0xf1aa('0x31')]=_[_0xf1aa('0x32')](_0x2e5085[_0xf1aa('0x33')],_0x2e5085[_0xf1aa('0x2f')]);_0x5a1ea3[_0xf1aa('0x34')]=_[_0xf1aa('0x32')](_0x2e5085[_0xf1aa('0x33')],qs[_0xf1aa('0x35')](_0x58e899[_0xf1aa('0x2f')][_0xf1aa('0x35')]));_0x5a1ea3[_0xf1aa('0x34')]=_0x5a1ea3[_0xf1aa('0x34')]['length']?_0x5a1ea3[_0xf1aa('0x34')]:_0x2e5085['model'];if(!_0x58e899[_0xf1aa('0x2f')][_0xf1aa('0x36')](_0xf1aa('0x37'))){_0x5a1ea3[_0xf1aa('0x1e')]=qs[_0xf1aa('0x1e')](_0x58e899[_0xf1aa('0x2f')]['limit']);_0x5a1ea3[_0xf1aa('0x1c')]=qs['offset'](_0x58e899['query'][_0xf1aa('0x1c')]);}_0x5a1ea3['order']=qs[_0xf1aa('0x38')](_0x58e899[_0xf1aa('0x2f')]['sort']);_0x5a1ea3[_0xf1aa('0x39')]=qs[_0xf1aa('0x31')](_['pick'](_0x58e899['query'],_0x2e5085[_0xf1aa('0x31')]),_0x2f2919);if(_0x58e899['query'][_0xf1aa('0x3a')]){_0x5a1ea3[_0xf1aa('0x39')]=_[_0xf1aa('0x3b')](_0x5a1ea3[_0xf1aa('0x39')],{'$or':_['map'](_0x2f2919,function(_0x1f190d){if(_0x1f190d['type']!==_0xf1aa('0x3c')){var _0xf7bf42={};_0xf7bf42[_0x1f190d['name']]={'$like':'%'+_0x58e899[_0xf1aa('0x2f')][_0xf1aa('0x3a')]+'%'};return _0xf7bf42;}})});}_0x5a1ea3=_[_0xf1aa('0x3b')]({},_0x5a1ea3,_0x58e899['options']);var _0x1c6075={'where':_0x5a1ea3[_0xf1aa('0x39')]};return db[_0xf1aa('0x2b')]['count'](_0x1c6075)[_0xf1aa('0x25')](function(_0x3726f1){_0x10c03a['count']=_0x3726f1;if(_0x58e899[_0xf1aa('0x2f')][_0xf1aa('0x3d')]){_0x5a1ea3[_0xf1aa('0x3e')]=[{'all':!![]}];}return db[_0xf1aa('0x2b')][_0xf1aa('0x3f')](_0x5a1ea3);})['then'](function(_0x551594){_0x10c03a[_0xf1aa('0x40')]=_0x551594;return _0x10c03a;})[_0xf1aa('0x25')](respondWithFilteredResult(_0x3ef8dd,_0x5a1ea3))[_0xf1aa('0x41')](handleError(_0x3ef8dd,null));};exports[_0xf1aa('0x42')]=function(_0x2c0e2b,_0x56fdb8){var _0x575fd1={'raw':![],'where':{'id':_0x2c0e2b[_0xf1aa('0x43')]['id']}},_0x241a5e={};_0x241a5e[_0xf1aa('0x33')]=_[_0xf1aa('0x30')](db[_0xf1aa('0x2b')][_0xf1aa('0x2c')]);_0x241a5e[_0xf1aa('0x2f')]=_[_0xf1aa('0x30')](_0x2c0e2b[_0xf1aa('0x2f')]);_0x241a5e[_0xf1aa('0x31')]=_['intersection'](_0x241a5e['model'],_0x241a5e[_0xf1aa('0x2f')]);_0x575fd1[_0xf1aa('0x34')]=_[_0xf1aa('0x32')](_0x241a5e[_0xf1aa('0x33')],qs[_0xf1aa('0x35')](_0x2c0e2b[_0xf1aa('0x2f')]['fields']));_0x575fd1[_0xf1aa('0x34')]=_0x575fd1['attributes'][_0xf1aa('0x44')]?_0x575fd1[_0xf1aa('0x34')]:_0x241a5e[_0xf1aa('0x33')];if(_0x2c0e2b[_0xf1aa('0x2f')][_0xf1aa('0x3d')]){_0x575fd1[_0xf1aa('0x3e')]=[{'all':!![]}];}_0x575fd1=_[_0xf1aa('0x3b')]({},_0x575fd1,_0x2c0e2b[_0xf1aa('0x45')]);return db[_0xf1aa('0x2b')][_0xf1aa('0x46')](_0x575fd1)['then'](handleEntityNotFound(_0x56fdb8,null))[_0xf1aa('0x25')](respondWithResult(_0x56fdb8,null))[_0xf1aa('0x41')](handleError(_0x56fdb8,null));};exports[_0xf1aa('0x47')]=function(_0xe80f69,_0x130660){return db[_0xf1aa('0x2b')][_0xf1aa('0x47')](_0xe80f69['body'],{})['then'](respondWithResult(_0x130660,0xc9))[_0xf1aa('0x41')](handleError(_0x130660,null));};exports['update']=function(_0x453057,_0x8a3ff2){if(_0x453057['body']['id']){delete _0x453057['body']['id'];}return db['SugarcrmConfiguration'][_0xf1aa('0x46')]({'where':{'id':_0x453057[_0xf1aa('0x43')]['id']}})[_0xf1aa('0x25')](handleEntityNotFound(_0x8a3ff2,null))[_0xf1aa('0x25')](saveUpdates(_0x453057['body'],null))[_0xf1aa('0x25')](respondWithResult(_0x8a3ff2,null))[_0xf1aa('0x41')](handleError(_0x8a3ff2,null));};exports[_0xf1aa('0x24')]=function(_0x293c00,_0x5249d7){return db[_0xf1aa('0x2b')][_0xf1aa('0x46')]({'where':{'id':_0x293c00['params']['id']}})[_0xf1aa('0x25')](handleEntityNotFound(_0x5249d7,null))[_0xf1aa('0x25')](removeEntity(_0x5249d7,null))['catch'](handleError(_0x5249d7,null));};exports[_0xf1aa('0x48')]=function(_0x2316d,_0x1a1a01,_0x199d0e){var _0x5a8a32={};var _0x1e7b25={};var _0x5eebac;var _0x47a666;return db[_0xf1aa('0x2b')][_0xf1aa('0x49')]({'where':{'id':_0x2316d[_0xf1aa('0x43')]['id']}})[_0xf1aa('0x25')](handleEntityNotFound(_0x1a1a01,null))[_0xf1aa('0x25')](function(_0x2e0524){if(_0x2e0524){_0x5eebac=_0x2e0524;_0x1e7b25['model']=_[_0xf1aa('0x30')](db[_0xf1aa('0x4a')][_0xf1aa('0x2c')]);_0x1e7b25[_0xf1aa('0x2f')]=_['keys'](_0x2316d[_0xf1aa('0x2f')]);_0x1e7b25[_0xf1aa('0x31')]=_[_0xf1aa('0x32')](_0x1e7b25[_0xf1aa('0x33')],_0x1e7b25[_0xf1aa('0x2f')]);_0x5a8a32[_0xf1aa('0x34')]=_[_0xf1aa('0x32')](_0x1e7b25[_0xf1aa('0x33')],qs[_0xf1aa('0x35')](_0x2316d[_0xf1aa('0x2f')][_0xf1aa('0x35')]));_0x5a8a32[_0xf1aa('0x34')]=_0x5a8a32[_0xf1aa('0x34')][_0xf1aa('0x44')]?_0x5a8a32[_0xf1aa('0x34')]:_0x1e7b25[_0xf1aa('0x33')];_0x5a8a32[_0xf1aa('0x4b')]=qs[_0xf1aa('0x38')](_0x2316d[_0xf1aa('0x2f')][_0xf1aa('0x38')]);_0x5a8a32['where']=qs[_0xf1aa('0x31')](_[_0xf1aa('0x4c')](_0x2316d[_0xf1aa('0x2f')],_0x1e7b25['filters']));if(_0x2316d['query'][_0xf1aa('0x3a')]){_0x5a8a32[_0xf1aa('0x39')]=_['merge'](_0x5a8a32[_0xf1aa('0x39')],{'$or':_[_0xf1aa('0x2a')](_0x5a8a32['attributes'],function(_0x31c47e){var _0x3674fe={};_0x3674fe[_0x31c47e]={'$like':'%'+_0x2316d[_0xf1aa('0x2f')][_0xf1aa('0x3a')]+'%'};return _0x3674fe;})});}_0x5a8a32=_[_0xf1aa('0x3b')]({},_0x5a8a32,_0x2316d[_0xf1aa('0x45')]);return _0x5eebac['getFields'](_0x5a8a32);}})[_0xf1aa('0x25')](function(_0x32a5ba){if(_0x32a5ba){_0x47a666=_0x32a5ba['length'];if(!_0x2316d[_0xf1aa('0x2f')][_0xf1aa('0x36')](_0xf1aa('0x37'))){_0x5a8a32[_0xf1aa('0x1e')]=qs[_0xf1aa('0x1e')](_0x2316d[_0xf1aa('0x2f')][_0xf1aa('0x1e')]);_0x5a8a32[_0xf1aa('0x1c')]=qs['offset'](_0x2316d[_0xf1aa('0x2f')][_0xf1aa('0x1c')]);}return _0x5eebac[_0xf1aa('0x48')](_0x5a8a32);}})[_0xf1aa('0x25')](function(_0x13bf0f){if(_0x13bf0f){return _0x13bf0f?{'count':_0x47a666,'rows':_0x13bf0f}:null;}})['then'](respondWithResult(_0x1a1a01,null))[_0xf1aa('0x41')](handleError(_0x1a1a01,null));};exports[_0xf1aa('0x4d')]=function(_0x328442,_0x2ee27c,_0x567a41){var _0xdf597a={};var _0x28d280={};var _0x43ebdb;var _0x37739f;return db[_0xf1aa('0x2b')][_0xf1aa('0x49')]({'where':{'id':_0x328442[_0xf1aa('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ee27c,null))[_0xf1aa('0x25')](function(_0x2b0809){if(_0x2b0809){_0x43ebdb=_0x2b0809;_0x28d280['model']=_[_0xf1aa('0x30')](db[_0xf1aa('0x4a')]['rawAttributes']);_0x28d280['query']=_[_0xf1aa('0x30')](_0x328442[_0xf1aa('0x2f')]);_0x28d280[_0xf1aa('0x31')]=_[_0xf1aa('0x32')](_0x28d280['model'],_0x28d280[_0xf1aa('0x2f')]);_0xdf597a[_0xf1aa('0x34')]=_['intersection'](_0x28d280[_0xf1aa('0x33')],qs[_0xf1aa('0x35')](_0x328442[_0xf1aa('0x2f')][_0xf1aa('0x35')]));_0xdf597a[_0xf1aa('0x34')]=_0xdf597a[_0xf1aa('0x34')][_0xf1aa('0x44')]?_0xdf597a[_0xf1aa('0x34')]:_0x28d280[_0xf1aa('0x33')];_0xdf597a[_0xf1aa('0x4b')]=qs['sort'](_0x328442[_0xf1aa('0x2f')][_0xf1aa('0x38')]);_0xdf597a[_0xf1aa('0x39')]=qs[_0xf1aa('0x31')](_[_0xf1aa('0x4c')](_0x328442[_0xf1aa('0x2f')],_0x28d280['filters']));if(_0x328442[_0xf1aa('0x2f')]['filter']){_0xdf597a[_0xf1aa('0x39')]=_['merge'](_0xdf597a[_0xf1aa('0x39')],{'$or':_[_0xf1aa('0x2a')](_0xdf597a[_0xf1aa('0x34')],function(_0x3de5d2){var _0x383cc2={};_0x383cc2[_0x3de5d2]={'$like':'%'+_0x328442['query'][_0xf1aa('0x3a')]+'%'};return _0x383cc2;})});}_0xdf597a=_[_0xf1aa('0x3b')]({},_0xdf597a,_0x328442[_0xf1aa('0x45')]);return _0x43ebdb[_0xf1aa('0x4d')](_0xdf597a);}})[_0xf1aa('0x25')](function(_0x2557e8){if(_0x2557e8){_0x37739f=_0x2557e8[_0xf1aa('0x44')];if(!_0x328442[_0xf1aa('0x2f')][_0xf1aa('0x36')](_0xf1aa('0x37'))){_0xdf597a[_0xf1aa('0x1e')]=qs[_0xf1aa('0x1e')](_0x328442[_0xf1aa('0x2f')][_0xf1aa('0x1e')]);_0xdf597a[_0xf1aa('0x1c')]=qs[_0xf1aa('0x1c')](_0x328442[_0xf1aa('0x2f')]['offset']);}return _0x43ebdb[_0xf1aa('0x4d')](_0xdf597a);}})[_0xf1aa('0x25')](function(_0x3a3e94){if(_0x3a3e94){return _0x3a3e94?{'count':_0x37739f,'rows':_0x3a3e94}:null;}})[_0xf1aa('0x25')](respondWithResult(_0x2ee27c,null))[_0xf1aa('0x41')](handleError(_0x2ee27c,null));};exports[_0xf1aa('0x4e')]=function(_0x5d20c4,_0x4ca269,_0xfa9f71){var _0x48098d={};var _0x593549={};var _0x1677df;var _0x251bd8;return db[_0xf1aa('0x2b')][_0xf1aa('0x49')]({'where':{'id':_0x5d20c4['params']['id']}})['then'](handleEntityNotFound(_0x4ca269,null))['then'](function(_0x28b8f0){if(_0x28b8f0){_0x1677df=_0x28b8f0;_0x593549[_0xf1aa('0x33')]=_['keys'](db[_0xf1aa('0x4a')][_0xf1aa('0x2c')]);_0x593549[_0xf1aa('0x2f')]=_[_0xf1aa('0x30')](_0x5d20c4['query']);_0x593549[_0xf1aa('0x31')]=_[_0xf1aa('0x32')](_0x593549[_0xf1aa('0x33')],_0x593549['query']);_0x48098d['attributes']=_[_0xf1aa('0x32')](_0x593549['model'],qs['fields'](_0x5d20c4[_0xf1aa('0x2f')][_0xf1aa('0x35')]));_0x48098d[_0xf1aa('0x34')]=_0x48098d['attributes']['length']?_0x48098d['attributes']:_0x593549['model'];_0x48098d[_0xf1aa('0x4b')]=qs['sort'](_0x5d20c4[_0xf1aa('0x2f')][_0xf1aa('0x38')]);_0x48098d['where']=qs[_0xf1aa('0x31')](_[_0xf1aa('0x4c')](_0x5d20c4['query'],_0x593549[_0xf1aa('0x31')]));if(_0x5d20c4[_0xf1aa('0x2f')][_0xf1aa('0x3a')]){_0x48098d['where']=_[_0xf1aa('0x3b')](_0x48098d[_0xf1aa('0x39')],{'$or':_[_0xf1aa('0x2a')](_0x48098d[_0xf1aa('0x34')],function(_0x2034f6){var _0x1372f9={};_0x1372f9[_0x2034f6]={'$like':'%'+_0x5d20c4[_0xf1aa('0x2f')][_0xf1aa('0x3a')]+'%'};return _0x1372f9;})});}_0x48098d=_[_0xf1aa('0x3b')]({},_0x48098d,_0x5d20c4[_0xf1aa('0x45')]);return _0x1677df[_0xf1aa('0x4e')](_0x48098d);}})[_0xf1aa('0x25')](function(_0x1ac8f9){if(_0x1ac8f9){_0x251bd8=_0x1ac8f9[_0xf1aa('0x44')];if(!_0x5d20c4[_0xf1aa('0x2f')][_0xf1aa('0x36')](_0xf1aa('0x37'))){_0x48098d[_0xf1aa('0x1e')]=qs[_0xf1aa('0x1e')](_0x5d20c4[_0xf1aa('0x2f')][_0xf1aa('0x1e')]);_0x48098d['offset']=qs[_0xf1aa('0x1c')](_0x5d20c4[_0xf1aa('0x2f')][_0xf1aa('0x1c')]);}return _0x1677df[_0xf1aa('0x4e')](_0x48098d);}})[_0xf1aa('0x25')](function(_0x1bb195){if(_0x1bb195){return _0x1bb195?{'count':_0x251bd8,'rows':_0x1bb195}:null;}})[_0xf1aa('0x25')](respondWithResult(_0x4ca269,null))[_0xf1aa('0x41')](handleError(_0x4ca269,null));}; \ No newline at end of file +var _0x171f=['create','body','find','findOne','SugarcrmField','pick','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','map','SugarcrmConfiguration','type','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x171f,0xa3));var _0xf171=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x171f[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require(_0xf171('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf171('0x1'));var jsonpatch=require(_0xf171('0x2'));var rp=require(_0xf171('0x3'));var moment=require(_0xf171('0x4'));var BPromise=require(_0xf171('0x5'));var Mustache=require('mustache');var util=require(_0xf171('0x6'));var path=require('path');var sox=require(_0xf171('0x7'));var csv=require(_0xf171('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf171('0x9'));var squel=require(_0xf171('0xa'));var crypto=require(_0xf171('0xb'));var jsforce=require(_0xf171('0xc'));var deskjs=require(_0xf171('0xd'));var toCsv=require(_0xf171('0x8'));var querystring=require(_0xf171('0xe'));var Papa=require(_0xf171('0xf'));var Redis=require(_0xf171('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(_0xf171('0x11'))(_0xf171('0x12'));var utils=require('../../config/utils');var config=require(_0xf171('0x13'));var licenseUtil=require(_0xf171('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19d40d,_0x5e1be2){_0x5e1be2=_0x5e1be2||0xcc;return function(_0x5de4bb){if(_0x5de4bb){return _0x19d40d[_0xf171('0x15')](_0x5e1be2);}return _0x19d40d[_0xf171('0x16')](_0x5e1be2)[_0xf171('0x17')]();};}function respondWithResult(_0x287a1c,_0x26536b){_0x26536b=_0x26536b||0xc8;return function(_0x5e2693){if(_0x5e2693){return _0x287a1c[_0xf171('0x16')](_0x26536b)[_0xf171('0x18')](_0x5e2693);}};}function respondWithFilteredResult(_0x8f2a33,_0x5411aa){return function(_0x3fc43f){if(_0x3fc43f){var _0x2437a6=typeof _0x5411aa[_0xf171('0x19')]==='undefined'&&typeof _0x5411aa[_0xf171('0x1a')]===_0xf171('0x1b');var _0x16228a=_0x3fc43f['count'];var _0x145015=_0x2437a6?0x0:_0x5411aa[_0xf171('0x19')];var _0x551dba=_0x2437a6?_0x3fc43f[_0xf171('0x1c')]:_0x5411aa[_0xf171('0x19')]+_0x5411aa[_0xf171('0x1a')];var _0x203afa;if(_0x551dba>=_0x16228a){_0x551dba=_0x16228a;_0x203afa=0xc8;}else{_0x203afa=0xce;}_0x8f2a33['status'](_0x203afa);return _0x8f2a33[_0xf171('0x1d')]('Content-Range',_0x145015+'-'+_0x551dba+'/'+_0x16228a)[_0xf171('0x18')](_0x3fc43f);}return null;};}function patchUpdates(_0x7205a6){return function(_0x5d91eb){try{jsonpatch[_0xf171('0x1e')](_0x5d91eb,_0x7205a6,!![]);}catch(_0x585dc4){return BPromise[_0xf171('0x1f')](_0x585dc4);}return _0x5d91eb[_0xf171('0x20')]();};}function saveUpdates(_0x423794,_0x1bd060){return function(_0x2d8449){if(_0x2d8449){return _0x2d8449[_0xf171('0x21')](_0x423794)[_0xf171('0x22')](function(_0x4b31ee){return _0x4b31ee;});}return null;};}function removeEntity(_0x53bd8b,_0x589e12){return function(_0x2faee1){if(_0x2faee1){return _0x2faee1[_0xf171('0x23')]()['then'](function(){_0x53bd8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dbecf,_0x45293e){return function(_0x39b055){if(!_0x39b055){_0x4dbecf[_0xf171('0x15')](0x194);}return _0x39b055;};}function handleError(_0x1bcd37,_0x2cdc1b){_0x2cdc1b=_0x2cdc1b||0x1f4;return function(_0x44fab3){logger[_0xf171('0x24')](_0x44fab3[_0xf171('0x25')]);if(_0x44fab3[_0xf171('0x26')]){delete _0x44fab3[_0xf171('0x26')];}_0x1bcd37[_0xf171('0x16')](_0x2cdc1b)['send'](_0x44fab3);};}exports['index']=function(_0x1b56fa,_0x1c6860){var _0x51182e={},_0x1115d2={},_0x467090={'count':0x0,'rows':[]};var _0xcfeb79=_[_0xf171('0x27')](db[_0xf171('0x28')]['rawAttributes'],function(_0x239e0e){return{'name':_0x239e0e['fieldName'],'type':_0x239e0e[_0xf171('0x29')][_0xf171('0x2a')]};});_0x1115d2['model']=_['map'](_0xcfeb79,'name');_0x1115d2['query']=_[_0xf171('0x2b')](_0x1b56fa['query']);_0x1115d2[_0xf171('0x2c')]=_[_0xf171('0x2d')](_0x1115d2[_0xf171('0x2e')],_0x1115d2[_0xf171('0x2f')]);_0x51182e[_0xf171('0x30')]=_[_0xf171('0x2d')](_0x1115d2[_0xf171('0x2e')],qs[_0xf171('0x31')](_0x1b56fa[_0xf171('0x2f')]['fields']));_0x51182e[_0xf171('0x30')]=_0x51182e['attributes']['length']?_0x51182e[_0xf171('0x30')]:_0x1115d2[_0xf171('0x2e')];if(!_0x1b56fa[_0xf171('0x2f')][_0xf171('0x32')](_0xf171('0x33'))){_0x51182e['limit']=qs['limit'](_0x1b56fa[_0xf171('0x2f')][_0xf171('0x1a')]);_0x51182e[_0xf171('0x19')]=qs['offset'](_0x1b56fa[_0xf171('0x2f')][_0xf171('0x19')]);}_0x51182e[_0xf171('0x34')]=qs[_0xf171('0x35')](_0x1b56fa['query'][_0xf171('0x35')]);_0x51182e[_0xf171('0x36')]=qs['filters'](_['pick'](_0x1b56fa['query'],_0x1115d2['filters']),_0xcfeb79);if(_0x1b56fa['query'][_0xf171('0x37')]){_0x51182e[_0xf171('0x36')]=_[_0xf171('0x38')](_0x51182e[_0xf171('0x36')],{'$or':_[_0xf171('0x27')](_0xcfeb79,function(_0x4eaf3f){if(_0x4eaf3f['type']!==_0xf171('0x39')){var _0x9c3f92={};_0x9c3f92[_0x4eaf3f['name']]={'$like':'%'+_0x1b56fa['query']['filter']+'%'};return _0x9c3f92;}})});}_0x51182e=_[_0xf171('0x38')]({},_0x51182e,_0x1b56fa[_0xf171('0x3a')]);var _0x209ac8={'where':_0x51182e[_0xf171('0x36')]};return db['SugarcrmConfiguration'][_0xf171('0x1c')](_0x209ac8)[_0xf171('0x22')](function(_0x12344c){_0x467090[_0xf171('0x1c')]=_0x12344c;if(_0x1b56fa[_0xf171('0x2f')][_0xf171('0x3b')]){_0x51182e[_0xf171('0x3c')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xf171('0x3d')](_0x51182e);})['then'](function(_0x3c8e9a){_0x467090[_0xf171('0x3e')]=_0x3c8e9a;return _0x467090;})[_0xf171('0x22')](respondWithFilteredResult(_0x1c6860,_0x51182e))[_0xf171('0x3f')](handleError(_0x1c6860,null));};exports[_0xf171('0x40')]=function(_0x3592c7,_0x1d86ba){var _0xa078e9={'raw':![],'where':{'id':_0x3592c7[_0xf171('0x41')]['id']}},_0x40a898={};_0x40a898['model']=_['keys'](db['SugarcrmConfiguration'][_0xf171('0x42')]);_0x40a898[_0xf171('0x2f')]=_[_0xf171('0x2b')](_0x3592c7[_0xf171('0x2f')]);_0x40a898[_0xf171('0x2c')]=_['intersection'](_0x40a898[_0xf171('0x2e')],_0x40a898[_0xf171('0x2f')]);_0xa078e9['attributes']=_[_0xf171('0x2d')](_0x40a898[_0xf171('0x2e')],qs['fields'](_0x3592c7[_0xf171('0x2f')][_0xf171('0x31')]));_0xa078e9['attributes']=_0xa078e9[_0xf171('0x30')][_0xf171('0x43')]?_0xa078e9[_0xf171('0x30')]:_0x40a898['model'];if(_0x3592c7[_0xf171('0x2f')][_0xf171('0x3b')]){_0xa078e9[_0xf171('0x3c')]=[{'all':!![]}];}_0xa078e9=_[_0xf171('0x38')]({},_0xa078e9,_0x3592c7[_0xf171('0x3a')]);return db['SugarcrmConfiguration']['find'](_0xa078e9)['then'](handleEntityNotFound(_0x1d86ba,null))[_0xf171('0x22')](respondWithResult(_0x1d86ba,null))['catch'](handleError(_0x1d86ba,null));};exports[_0xf171('0x44')]=function(_0x2b9326,_0x52ed08){return db[_0xf171('0x28')]['create'](_0x2b9326[_0xf171('0x45')],{})[_0xf171('0x22')](respondWithResult(_0x52ed08,0xc9))[_0xf171('0x3f')](handleError(_0x52ed08,null));};exports[_0xf171('0x21')]=function(_0x3d81ae,_0x54e552){if(_0x3d81ae[_0xf171('0x45')]['id']){delete _0x3d81ae[_0xf171('0x45')]['id'];}return db[_0xf171('0x28')]['find']({'where':{'id':_0x3d81ae[_0xf171('0x41')]['id']}})[_0xf171('0x22')](handleEntityNotFound(_0x54e552,null))[_0xf171('0x22')](saveUpdates(_0x3d81ae[_0xf171('0x45')],null))['then'](respondWithResult(_0x54e552,null))[_0xf171('0x3f')](handleError(_0x54e552,null));};exports[_0xf171('0x23')]=function(_0x555227,_0x530f73){return db[_0xf171('0x28')][_0xf171('0x46')]({'where':{'id':_0x555227[_0xf171('0x41')]['id']}})['then'](handleEntityNotFound(_0x530f73,null))[_0xf171('0x22')](removeEntity(_0x530f73,null))[_0xf171('0x3f')](handleError(_0x530f73,null));};exports['getFields']=function(_0x4923b5,_0x3aec50,_0xd6e11f){var _0x5323fe={};var _0x2c8648={};var _0x2db157;var _0x2ae872;return db[_0xf171('0x28')][_0xf171('0x47')]({'where':{'id':_0x4923b5['params']['id']}})[_0xf171('0x22')](handleEntityNotFound(_0x3aec50,null))[_0xf171('0x22')](function(_0x6bdc48){if(_0x6bdc48){_0x2db157=_0x6bdc48;_0x2c8648[_0xf171('0x2e')]=_['keys'](db[_0xf171('0x48')]['rawAttributes']);_0x2c8648[_0xf171('0x2f')]=_[_0xf171('0x2b')](_0x4923b5['query']);_0x2c8648[_0xf171('0x2c')]=_[_0xf171('0x2d')](_0x2c8648[_0xf171('0x2e')],_0x2c8648[_0xf171('0x2f')]);_0x5323fe[_0xf171('0x30')]=_['intersection'](_0x2c8648[_0xf171('0x2e')],qs[_0xf171('0x31')](_0x4923b5[_0xf171('0x2f')][_0xf171('0x31')]));_0x5323fe[_0xf171('0x30')]=_0x5323fe['attributes'][_0xf171('0x43')]?_0x5323fe['attributes']:_0x2c8648['model'];_0x5323fe[_0xf171('0x34')]=qs[_0xf171('0x35')](_0x4923b5[_0xf171('0x2f')][_0xf171('0x35')]);_0x5323fe[_0xf171('0x36')]=qs[_0xf171('0x2c')](_[_0xf171('0x49')](_0x4923b5[_0xf171('0x2f')],_0x2c8648['filters']));if(_0x4923b5['query']['filter']){_0x5323fe[_0xf171('0x36')]=_['merge'](_0x5323fe['where'],{'$or':_[_0xf171('0x27')](_0x5323fe['attributes'],function(_0x2c13c5){var _0x2ca892={};_0x2ca892[_0x2c13c5]={'$like':'%'+_0x4923b5[_0xf171('0x2f')]['filter']+'%'};return _0x2ca892;})});}_0x5323fe=_[_0xf171('0x38')]({},_0x5323fe,_0x4923b5[_0xf171('0x3a')]);return _0x2db157['getFields'](_0x5323fe);}})[_0xf171('0x22')](function(_0x49d767){if(_0x49d767){_0x2ae872=_0x49d767[_0xf171('0x43')];if(!_0x4923b5['query'][_0xf171('0x32')](_0xf171('0x33'))){_0x5323fe[_0xf171('0x1a')]=qs[_0xf171('0x1a')](_0x4923b5[_0xf171('0x2f')][_0xf171('0x1a')]);_0x5323fe[_0xf171('0x19')]=qs[_0xf171('0x19')](_0x4923b5[_0xf171('0x2f')]['offset']);}return _0x2db157[_0xf171('0x4a')](_0x5323fe);}})['then'](function(_0x1dc7e6){if(_0x1dc7e6){return _0x1dc7e6?{'count':_0x2ae872,'rows':_0x1dc7e6}:null;}})[_0xf171('0x22')](respondWithResult(_0x3aec50,null))[_0xf171('0x3f')](handleError(_0x3aec50,null));};exports[_0xf171('0x4b')]=function(_0x33e08c,_0x15173f,_0x4f841f){var _0x5b791f={};var _0xf29c8b={};var _0x16532e;var _0x590304;return db[_0xf171('0x28')]['findOne']({'where':{'id':_0x33e08c['params']['id']}})[_0xf171('0x22')](handleEntityNotFound(_0x15173f,null))[_0xf171('0x22')](function(_0x34ca9f){if(_0x34ca9f){_0x16532e=_0x34ca9f;_0xf29c8b['model']=_[_0xf171('0x2b')](db[_0xf171('0x48')][_0xf171('0x42')]);_0xf29c8b['query']=_['keys'](_0x33e08c[_0xf171('0x2f')]);_0xf29c8b['filters']=_['intersection'](_0xf29c8b[_0xf171('0x2e')],_0xf29c8b[_0xf171('0x2f')]);_0x5b791f['attributes']=_[_0xf171('0x2d')](_0xf29c8b[_0xf171('0x2e')],qs[_0xf171('0x31')](_0x33e08c[_0xf171('0x2f')][_0xf171('0x31')]));_0x5b791f['attributes']=_0x5b791f[_0xf171('0x30')][_0xf171('0x43')]?_0x5b791f[_0xf171('0x30')]:_0xf29c8b[_0xf171('0x2e')];_0x5b791f['order']=qs[_0xf171('0x35')](_0x33e08c[_0xf171('0x2f')][_0xf171('0x35')]);_0x5b791f['where']=qs[_0xf171('0x2c')](_[_0xf171('0x49')](_0x33e08c[_0xf171('0x2f')],_0xf29c8b['filters']));if(_0x33e08c['query']['filter']){_0x5b791f[_0xf171('0x36')]=_[_0xf171('0x38')](_0x5b791f[_0xf171('0x36')],{'$or':_[_0xf171('0x27')](_0x5b791f['attributes'],function(_0x3047f3){var _0x107ed0={};_0x107ed0[_0x3047f3]={'$like':'%'+_0x33e08c['query'][_0xf171('0x37')]+'%'};return _0x107ed0;})});}_0x5b791f=_[_0xf171('0x38')]({},_0x5b791f,_0x33e08c[_0xf171('0x3a')]);return _0x16532e[_0xf171('0x4b')](_0x5b791f);}})[_0xf171('0x22')](function(_0x256cdb){if(_0x256cdb){_0x590304=_0x256cdb['length'];if(!_0x33e08c[_0xf171('0x2f')][_0xf171('0x32')](_0xf171('0x33'))){_0x5b791f[_0xf171('0x1a')]=qs['limit'](_0x33e08c['query']['limit']);_0x5b791f[_0xf171('0x19')]=qs['offset'](_0x33e08c[_0xf171('0x2f')][_0xf171('0x19')]);}return _0x16532e[_0xf171('0x4b')](_0x5b791f);}})[_0xf171('0x22')](function(_0x99555b){if(_0x99555b){return _0x99555b?{'count':_0x590304,'rows':_0x99555b}:null;}})[_0xf171('0x22')](respondWithResult(_0x15173f,null))[_0xf171('0x3f')](handleError(_0x15173f,null));};exports['getDescriptions']=function(_0xc83ca2,_0x3cb553,_0x5edda5){var _0x405ed3={};var _0xe1a495={};var _0x3c6135;var _0x111e4a;return db[_0xf171('0x28')][_0xf171('0x47')]({'where':{'id':_0xc83ca2[_0xf171('0x41')]['id']}})[_0xf171('0x22')](handleEntityNotFound(_0x3cb553,null))['then'](function(_0x56f53f){if(_0x56f53f){_0x3c6135=_0x56f53f;_0xe1a495[_0xf171('0x2e')]=_['keys'](db[_0xf171('0x48')][_0xf171('0x42')]);_0xe1a495[_0xf171('0x2f')]=_[_0xf171('0x2b')](_0xc83ca2[_0xf171('0x2f')]);_0xe1a495['filters']=_[_0xf171('0x2d')](_0xe1a495['model'],_0xe1a495[_0xf171('0x2f')]);_0x405ed3[_0xf171('0x30')]=_[_0xf171('0x2d')](_0xe1a495[_0xf171('0x2e')],qs[_0xf171('0x31')](_0xc83ca2[_0xf171('0x2f')][_0xf171('0x31')]));_0x405ed3[_0xf171('0x30')]=_0x405ed3['attributes'][_0xf171('0x43')]?_0x405ed3['attributes']:_0xe1a495[_0xf171('0x2e')];_0x405ed3[_0xf171('0x34')]=qs[_0xf171('0x35')](_0xc83ca2[_0xf171('0x2f')][_0xf171('0x35')]);_0x405ed3['where']=qs[_0xf171('0x2c')](_[_0xf171('0x49')](_0xc83ca2['query'],_0xe1a495['filters']));if(_0xc83ca2[_0xf171('0x2f')][_0xf171('0x37')]){_0x405ed3['where']=_['merge'](_0x405ed3[_0xf171('0x36')],{'$or':_[_0xf171('0x27')](_0x405ed3[_0xf171('0x30')],function(_0x301b7c){var _0x4d8b28={};_0x4d8b28[_0x301b7c]={'$like':'%'+_0xc83ca2['query'][_0xf171('0x37')]+'%'};return _0x4d8b28;})});}_0x405ed3=_[_0xf171('0x38')]({},_0x405ed3,_0xc83ca2[_0xf171('0x3a')]);return _0x3c6135[_0xf171('0x4c')](_0x405ed3);}})[_0xf171('0x22')](function(_0xefd36f){if(_0xefd36f){_0x111e4a=_0xefd36f[_0xf171('0x43')];if(!_0xc83ca2['query'][_0xf171('0x32')](_0xf171('0x33'))){_0x405ed3[_0xf171('0x1a')]=qs['limit'](_0xc83ca2['query'][_0xf171('0x1a')]);_0x405ed3[_0xf171('0x19')]=qs[_0xf171('0x19')](_0xc83ca2[_0xf171('0x2f')][_0xf171('0x19')]);}return _0x3c6135[_0xf171('0x4c')](_0x405ed3);}})[_0xf171('0x22')](function(_0x57f0b8){if(_0x57f0b8){return _0x57f0b8?{'count':_0x111e4a,'rows':_0x57f0b8}:null;}})[_0xf171('0x22')](respondWithResult(_0x3cb553,null))[_0xf171('0x3f')](handleError(_0x3cb553,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 991d473..ecf36f3 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 _0x8f8e=['SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x8f8e,0x7a));var _0xe8f8=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x8f8e[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var util=require(_0xe8f8('0x0'));var logger=require(_0xe8f8('0x1'))(_0xe8f8('0x2'));var moment=require('moment');var BPromise=require(_0xe8f8('0x3'));var rp=require(_0xe8f8('0x4'));var fs=require('fs');var path=require(_0xe8f8('0x5'));var rimraf=require(_0xe8f8('0x6'));var config=require('../../config/environment');var attributes=require(_0xe8f8('0x7'));module['exports']=function(_0x2e438c,_0x565111){return _0x2e438c['define'](_0xe8f8('0x8'),attributes,{'tableName':_0xe8f8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7ee=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment'];(function(_0x4a98f5,_0x12cb50){var _0x32307d=function(_0x278735){while(--_0x278735){_0x4a98f5['push'](_0x4a98f5['shift']());}};_0x32307d(++_0x12cb50);}(_0xe7ee,0x1e6));var _0xee7e=function(_0x365ccd,_0x269b98){_0x365ccd=_0x365ccd-0x0;var _0x67c1ee=_0xe7ee[_0x365ccd];return _0x67c1ee;};'use strict';var _=require(_0xee7e('0x0'));var util=require(_0xee7e('0x1'));var logger=require('../../config/logger')(_0xee7e('0x2'));var moment=require(_0xee7e('0x3'));var BPromise=require(_0xee7e('0x4'));var rp=require(_0xee7e('0x5'));var fs=require('fs');var path=require(_0xee7e('0x6'));var rimraf=require(_0xee7e('0x7'));var config=require(_0xee7e('0x8'));var attributes=require(_0xee7e('0x9'));module[_0xee7e('0xa')]=function(_0x36d630,_0x24ca2f){return _0x36d630[_0xee7e('0xb')](_0xee7e('0xc'),attributes,{'tableName':_0xee7e('0xd'),'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 9f88b3d..527ceb3 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 _0x3127=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0xfcebc4,_0x4dafbe){var _0x34fb21=function(_0x142309){while(--_0x142309){_0xfcebc4['push'](_0xfcebc4['shift']());}};_0x34fb21(++_0x4dafbe);}(_0x3127,0x12a));var _0x7312=function(_0x19b9f5,_0x2ff200){_0x19b9f5=_0x19b9f5-0x0;var _0x89c067=_0x3127[_0x19b9f5];return _0x89c067;};'use strict';var _=require('lodash');var util=require(_0x7312('0x0'));var moment=require(_0x7312('0x1'));var BPromise=require(_0x7312('0x2'));var rs=require(_0x7312('0x3'));var fs=require('fs');var Redis=require(_0x7312('0x4'));var db=require(_0x7312('0x5'))['db'];var utils=require(_0x7312('0x6'));var logger=require(_0x7312('0x7'))(_0x7312('0x8'));var config=require(_0x7312('0x9'));var jayson=require(_0x7312('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3c7f,_0x484222,_0x19945e){return new BPromise(function(_0x16c6e3,_0x485f62){return client[_0x7312('0xb')](_0x3e3c7f,_0x19945e)[_0x7312('0xc')](function(_0xf6cf9){logger[_0x7312('0xd')](_0x7312('0xe'),_0x484222,_0x7312('0xf'));logger[_0x7312('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x484222,_0x7312('0xf'),JSON[_0x7312('0x11')](_0xf6cf9));if(_0xf6cf9[_0x7312('0x12')]){if(_0xf6cf9[_0x7312('0x12')][_0x7312('0x13')]===0x1f4){logger[_0x7312('0x12')](_0x7312('0xe'),_0x484222,_0xf6cf9[_0x7312('0x12')]['message']);return _0x485f62(_0xf6cf9[_0x7312('0x12')]['message']);}logger['error'](_0x7312('0xe'),_0x484222,_0xf6cf9['error'][_0x7312('0x14')]);return _0x16c6e3(_0xf6cf9[_0x7312('0x12')]['message']);}else{logger[_0x7312('0xd')](_0x7312('0xe'),_0x484222,_0x7312('0xf'));_0x16c6e3(_0xf6cf9[_0x7312('0x15')]['message']);}})[_0x7312('0x16')](function(_0x1406a5){logger[_0x7312('0x12')](_0x7312('0xe'),_0x484222,_0x1406a5);_0x485f62(_0x1406a5);});});} \ No newline at end of file +var _0x9742=['http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4109ad,_0x4686b0){var _0x2f2ef4=function(_0x2d334f){while(--_0x2d334f){_0x4109ad['push'](_0x4109ad['shift']());}};_0x2f2ef4(++_0x4686b0);}(_0x9742,0x144));var _0x2974=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9742[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2974('0x0'));var util=require('util');var moment=require(_0x2974('0x1'));var BPromise=require(_0x2974('0x2'));var rs=require(_0x2974('0x3'));var fs=require('fs');var Redis=require(_0x2974('0x4'));var db=require(_0x2974('0x5'))['db'];var utils=require(_0x2974('0x6'));var logger=require(_0x2974('0x7'))(_0x2974('0x8'));var config=require(_0x2974('0x9'));var jayson=require(_0x2974('0xa'));var client=jayson[_0x2974('0xb')][_0x2974('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16c95d,_0x2f7282,_0x130967){return new BPromise(function(_0x1264a7,_0x20d232){return client[_0x2974('0xd')](_0x16c95d,_0x130967)[_0x2974('0xe')](function(_0x18e2c1){logger[_0x2974('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f7282,'request\x20sent');logger['debug'](_0x2974('0x10'),_0x2f7282,_0x2974('0x11'),JSON[_0x2974('0x12')](_0x18e2c1));if(_0x18e2c1[_0x2974('0x13')]){if(_0x18e2c1[_0x2974('0x13')][_0x2974('0x14')]===0x1f4){logger[_0x2974('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f7282,_0x18e2c1[_0x2974('0x13')][_0x2974('0x15')]);return _0x20d232(_0x18e2c1[_0x2974('0x13')]['message']);}logger[_0x2974('0x13')](_0x2974('0x16'),_0x2f7282,_0x18e2c1[_0x2974('0x13')]['message']);return _0x1264a7(_0x18e2c1[_0x2974('0x13')][_0x2974('0x15')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f7282,_0x2974('0x11'));_0x1264a7(_0x18e2c1['result'][_0x2974('0x15')]);}})[_0x2974('0x17')](function(_0x377b71){logger[_0x2974('0x13')](_0x2974('0x16'),_0x2f7282,_0x377b71);_0x20d232(_0x377b71);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 9b8882f..2e05a93 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 _0x5d5e=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x5d5e,0x109));var _0xe5d5=function(_0x357832,_0x5b0912){_0x357832=_0x357832-0x0;var _0x59c492=_0x5d5e[_0x357832];return _0x59c492;};'use strict';var multer=require(_0xe5d5('0x0'));var util=require(_0xe5d5('0x1'));var path=require(_0xe5d5('0x2'));var timeout=require(_0xe5d5('0x3'));var express=require(_0xe5d5('0x4'));var router=express[_0xe5d5('0x5')]();var fs_extra=require(_0xe5d5('0x6'));var auth=require(_0xe5d5('0x7'));var interaction=require(_0xe5d5('0x8'));var config=require(_0xe5d5('0x9'));var controller=require(_0xe5d5('0xa'));router[_0xe5d5('0xb')]('/',auth[_0xe5d5('0xc')](),controller[_0xe5d5('0xd')]);router[_0xe5d5('0xb')](_0xe5d5('0xe'),auth['isAuthenticated'](),controller[_0xe5d5('0xf')]);router[_0xe5d5('0x10')]('/',auth[_0xe5d5('0xc')](),controller[_0xe5d5('0x11')]);router[_0xe5d5('0x12')](_0xe5d5('0xe'),auth[_0xe5d5('0xc')](),controller[_0xe5d5('0x13')]);router[_0xe5d5('0x14')](_0xe5d5('0xe'),auth[_0xe5d5('0xc')](),controller['destroy']);module[_0xe5d5('0x15')]=router; \ No newline at end of file +var _0xddb6=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1483e6,_0x43548c){var _0x282a82=function(_0x3b0f5d){while(--_0x3b0f5d){_0x1483e6['push'](_0x1483e6['shift']());}};_0x282a82(++_0x43548c);}(_0xddb6,0xc9));var _0x6ddb=function(_0x3a657c,_0x30364b){_0x3a657c=_0x3a657c-0x0;var _0x412c0f=_0xddb6[_0x3a657c];return _0x412c0f;};'use strict';var multer=require(_0x6ddb('0x0'));var util=require(_0x6ddb('0x1'));var path=require(_0x6ddb('0x2'));var timeout=require(_0x6ddb('0x3'));var express=require('express');var router=express[_0x6ddb('0x4')]();var fs_extra=require(_0x6ddb('0x5'));var auth=require(_0x6ddb('0x6'));var interaction=require(_0x6ddb('0x7'));var config=require(_0x6ddb('0x8'));var controller=require(_0x6ddb('0x9'));router[_0x6ddb('0xa')]('/',auth[_0x6ddb('0xb')](),controller[_0x6ddb('0xc')]);router[_0x6ddb('0xa')](_0x6ddb('0xd'),auth[_0x6ddb('0xb')](),controller[_0x6ddb('0xe')]);router[_0x6ddb('0xf')]('/',auth['isAuthenticated'](),controller[_0x6ddb('0x10')]);router['put'](_0x6ddb('0xd'),auth[_0x6ddb('0xb')](),controller[_0x6ddb('0x11')]);router[_0x6ddb('0x12')](_0x6ddb('0xd'),auth[_0x6ddb('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e6a5d82..7f5c8a6 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 _0xd4f5=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x467e7d,_0x4ce7fd){var _0x552b11=function(_0xcb0516){while(--_0xcb0516){_0x467e7d['push'](_0x467e7d['shift']());}};_0x552b11(++_0x4ce7fd);}(_0xd4f5,0x14e));var _0x5d4f=function(_0x458dd7,_0xe5602b){_0x458dd7=_0x458dd7-0x0;var _0x2a12f3=_0xd4f5[_0x458dd7];return _0x2a12f3;};'use strict';var Sequelize=require(_0x5d4f('0x0'));module[_0x5d4f('0x1')]={'type':{'type':Sequelize[_0x5d4f('0x2')](_0x5d4f('0x3'),_0x5d4f('0x4'),'customVariable',_0x5d4f('0x5'),'picklist'),'defaultValue':_0x5d4f('0x3')},'content':{'type':Sequelize[_0x5d4f('0x6')]},'key':{'type':Sequelize[_0x5d4f('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x5d4f('0x7'))},'keyContent':{'type':Sequelize[_0x5d4f('0x6')]},'idField':{'type':Sequelize[_0x5d4f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5d4f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda5e=['sequelize','exports','ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN'];(function(_0x43c853,_0x384020){var _0x2c7eef=function(_0x3c42e2){while(--_0x3c42e2){_0x43c853['push'](_0x43c853['shift']());}};_0x2c7eef(++_0x384020);}(_0xda5e,0x129));var _0xeda5=function(_0x4073f8,_0x4daaa1){_0x4073f8=_0x4073f8-0x0;var _0x50048b=_0xda5e[_0x4073f8];return _0x50048b;};'use strict';var Sequelize=require(_0xeda5('0x0'));module[_0xeda5('0x1')]={'type':{'type':Sequelize[_0xeda5('0x2')](_0xeda5('0x3'),'variable',_0xeda5('0x4'),'keyValue',_0xeda5('0x5')),'defaultValue':_0xeda5('0x3')},'content':{'type':Sequelize[_0xeda5('0x6')]},'key':{'type':Sequelize[_0xeda5('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xeda5('0x3'),_0xeda5('0x7'),_0xeda5('0x4'))},'keyContent':{'type':Sequelize[_0xeda5('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xeda5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeda5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 3502f79..3681a19 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 _0x0ceb=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','update','find','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','name','index','map','SugarcrmField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick'];(function(_0x3c27ac,_0x39fd74){var _0x19b777=function(_0x57b10a){while(--_0x57b10a){_0x3c27ac['push'](_0x3c27ac['shift']());}};_0x19b777(++_0x39fd74);}(_0x0ceb,0x1e3));var _0xb0ce=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0ceb[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0ce('0x0'));var zipdir=require(_0xb0ce('0x1'));var jsonpatch=require(_0xb0ce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb0ce('0x3'));var util=require('util');var path=require(_0xb0ce('0x4'));var sox=require(_0xb0ce('0x5'));var csv=require(_0xb0ce('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0ce('0x7'));var _=require(_0xb0ce('0x8'));var squel=require(_0xb0ce('0x9'));var crypto=require(_0xb0ce('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb0ce('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb0ce('0xc'));var Papa=require(_0xb0ce('0xd'));var Redis=require(_0xb0ce('0xe'));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(_0xb0ce('0xf'))(_0xb0ce('0x10'));var utils=require('../../config/utils');var config=require(_0xb0ce('0x11'));var licenseUtil=require(_0xb0ce('0x12'));var db=require(_0xb0ce('0x13'))['db'];function respondWithStatusCode(_0x4f9b5f,_0x462fa8){_0x462fa8=_0x462fa8||0xcc;return function(_0x171d9d){if(_0x171d9d){return _0x4f9b5f[_0xb0ce('0x14')](_0x462fa8);}return _0x4f9b5f['status'](_0x462fa8)[_0xb0ce('0x15')]();};}function respondWithResult(_0x3dd721,_0x5ad572){_0x5ad572=_0x5ad572||0xc8;return function(_0x498754){if(_0x498754){return _0x3dd721[_0xb0ce('0x16')](_0x5ad572)[_0xb0ce('0x17')](_0x498754);}};}function respondWithFilteredResult(_0x21dcef,_0x3a9bb1){return function(_0x1ca8cf){if(_0x1ca8cf){var _0x159bed=typeof _0x3a9bb1[_0xb0ce('0x18')]===_0xb0ce('0x19')&&typeof _0x3a9bb1['limit']===_0xb0ce('0x19');var _0x503119=_0x1ca8cf['count'];var _0x44c8a=_0x159bed?0x0:_0x3a9bb1[_0xb0ce('0x18')];var _0x5c34da=_0x159bed?_0x1ca8cf[_0xb0ce('0x1a')]:_0x3a9bb1['offset']+_0x3a9bb1[_0xb0ce('0x1b')];var _0x2782ac;if(_0x5c34da>=_0x503119){_0x5c34da=_0x503119;_0x2782ac=0xc8;}else{_0x2782ac=0xce;}_0x21dcef[_0xb0ce('0x16')](_0x2782ac);return _0x21dcef[_0xb0ce('0x1c')](_0xb0ce('0x1d'),_0x44c8a+'-'+_0x5c34da+'/'+_0x503119)['json'](_0x1ca8cf);}return null;};}function patchUpdates(_0xcfab2){return function(_0xf48345){try{jsonpatch[_0xb0ce('0x1e')](_0xf48345,_0xcfab2,!![]);}catch(_0x1b3cb4){return BPromise[_0xb0ce('0x1f')](_0x1b3cb4);}return _0xf48345[_0xb0ce('0x20')]();};}function saveUpdates(_0x455b84,_0x411fbc){return function(_0x12fd18){if(_0x12fd18){return _0x12fd18['update'](_0x455b84)[_0xb0ce('0x21')](function(_0x19bb49){return _0x19bb49;});}return null;};}function removeEntity(_0x2ad341,_0x2521f0){return function(_0x117d2e){if(_0x117d2e){return _0x117d2e[_0xb0ce('0x22')]()['then'](function(){_0x2ad341[_0xb0ce('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa27490,_0x32387b){return function(_0x2780bd){if(!_0x2780bd){_0xa27490[_0xb0ce('0x14')](0x194);}return _0x2780bd;};}function handleError(_0x4c099e,_0x277b78){_0x277b78=_0x277b78||0x1f4;return function(_0x4beeb5){logger['error'](_0x4beeb5['stack']);if(_0x4beeb5[_0xb0ce('0x23')]){delete _0x4beeb5[_0xb0ce('0x23')];}_0x4c099e['status'](_0x277b78)['send'](_0x4beeb5);};}exports[_0xb0ce('0x24')]=function(_0x577b4d,_0x779f6d){var _0x2e39fb={},_0x5c6540={},_0x1778b5={'count':0x0,'rows':[]};var _0x442c3d=_[_0xb0ce('0x25')](db[_0xb0ce('0x26')]['rawAttributes'],function(_0x1d7cd3){return{'name':_0x1d7cd3[_0xb0ce('0x27')],'type':_0x1d7cd3[_0xb0ce('0x28')]['key']};});_0x5c6540[_0xb0ce('0x29')]=_[_0xb0ce('0x25')](_0x442c3d,_0xb0ce('0x23'));_0x5c6540[_0xb0ce('0x2a')]=_[_0xb0ce('0x2b')](_0x577b4d['query']);_0x5c6540[_0xb0ce('0x2c')]=_['intersection'](_0x5c6540[_0xb0ce('0x29')],_0x5c6540[_0xb0ce('0x2a')]);_0x2e39fb[_0xb0ce('0x2d')]=_[_0xb0ce('0x2e')](_0x5c6540[_0xb0ce('0x29')],qs[_0xb0ce('0x2f')](_0x577b4d['query'][_0xb0ce('0x2f')]));_0x2e39fb[_0xb0ce('0x2d')]=_0x2e39fb[_0xb0ce('0x2d')][_0xb0ce('0x30')]?_0x2e39fb[_0xb0ce('0x2d')]:_0x5c6540[_0xb0ce('0x29')];if(!_0x577b4d[_0xb0ce('0x2a')][_0xb0ce('0x31')]('nolimit')){_0x2e39fb[_0xb0ce('0x1b')]=qs[_0xb0ce('0x1b')](_0x577b4d[_0xb0ce('0x2a')][_0xb0ce('0x1b')]);_0x2e39fb['offset']=qs[_0xb0ce('0x18')](_0x577b4d[_0xb0ce('0x2a')][_0xb0ce('0x18')]);}_0x2e39fb['order']=qs[_0xb0ce('0x32')](_0x577b4d[_0xb0ce('0x2a')][_0xb0ce('0x32')]);_0x2e39fb[_0xb0ce('0x33')]=qs[_0xb0ce('0x2c')](_[_0xb0ce('0x34')](_0x577b4d[_0xb0ce('0x2a')],_0x5c6540[_0xb0ce('0x2c')]),_0x442c3d);if(_0x577b4d[_0xb0ce('0x2a')][_0xb0ce('0x35')]){_0x2e39fb['where']=_[_0xb0ce('0x36')](_0x2e39fb[_0xb0ce('0x33')],{'$or':_[_0xb0ce('0x25')](_0x442c3d,function(_0x5f07c7){if(_0x5f07c7[_0xb0ce('0x28')]!==_0xb0ce('0x37')){var _0x52f13b={};_0x52f13b[_0x5f07c7[_0xb0ce('0x23')]]={'$like':'%'+_0x577b4d[_0xb0ce('0x2a')][_0xb0ce('0x35')]+'%'};return _0x52f13b;}})});}_0x2e39fb=_['merge']({},_0x2e39fb,_0x577b4d[_0xb0ce('0x38')]);var _0x190634={'where':_0x2e39fb['where']};return db['SugarcrmField']['count'](_0x190634)[_0xb0ce('0x21')](function(_0x23b632){_0x1778b5[_0xb0ce('0x1a')]=_0x23b632;if(_0x577b4d[_0xb0ce('0x2a')][_0xb0ce('0x39')]){_0x2e39fb[_0xb0ce('0x3a')]=[{'all':!![]}];}return db['SugarcrmField'][_0xb0ce('0x3b')](_0x2e39fb);})[_0xb0ce('0x21')](function(_0x3696af){_0x1778b5[_0xb0ce('0x3c')]=_0x3696af;return _0x1778b5;})[_0xb0ce('0x21')](respondWithFilteredResult(_0x779f6d,_0x2e39fb))['catch'](handleError(_0x779f6d,null));};exports['show']=function(_0xda40ce,_0x391ee0){var _0x57212e={'raw':!![],'where':{'id':_0xda40ce[_0xb0ce('0x3d')]['id']}},_0x500c4c={};_0x500c4c[_0xb0ce('0x29')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x500c4c[_0xb0ce('0x2a')]=_[_0xb0ce('0x2b')](_0xda40ce['query']);_0x500c4c[_0xb0ce('0x2c')]=_[_0xb0ce('0x2e')](_0x500c4c['model'],_0x500c4c[_0xb0ce('0x2a')]);_0x57212e['attributes']=_[_0xb0ce('0x2e')](_0x500c4c[_0xb0ce('0x29')],qs[_0xb0ce('0x2f')](_0xda40ce[_0xb0ce('0x2a')][_0xb0ce('0x2f')]));_0x57212e[_0xb0ce('0x2d')]=_0x57212e[_0xb0ce('0x2d')][_0xb0ce('0x30')]?_0x57212e[_0xb0ce('0x2d')]:_0x500c4c[_0xb0ce('0x29')];if(_0xda40ce[_0xb0ce('0x2a')]['includeAll']){_0x57212e[_0xb0ce('0x3a')]=[{'all':!![]}];}_0x57212e=_['merge']({},_0x57212e,_0xda40ce[_0xb0ce('0x38')]);return db[_0xb0ce('0x26')]['find'](_0x57212e)[_0xb0ce('0x21')](handleEntityNotFound(_0x391ee0,null))['then'](respondWithResult(_0x391ee0,null))[_0xb0ce('0x3e')](handleError(_0x391ee0,null));};exports[_0xb0ce('0x3f')]=function(_0x2f81dd,_0x4f5817){return db['SugarcrmField']['create'](_0x2f81dd[_0xb0ce('0x40')],{})[_0xb0ce('0x21')](respondWithResult(_0x4f5817,0xc9))['catch'](handleError(_0x4f5817,null));};exports[_0xb0ce('0x41')]=function(_0x24ecad,_0x1d9e0a){if(_0x24ecad['body']['id']){delete _0x24ecad[_0xb0ce('0x40')]['id'];}return db['SugarcrmField'][_0xb0ce('0x42')]({'where':{'id':_0x24ecad[_0xb0ce('0x3d')]['id']}})[_0xb0ce('0x21')](handleEntityNotFound(_0x1d9e0a,null))[_0xb0ce('0x21')](saveUpdates(_0x24ecad[_0xb0ce('0x40')],null))[_0xb0ce('0x21')](respondWithResult(_0x1d9e0a,null))[_0xb0ce('0x3e')](handleError(_0x1d9e0a,null));};exports['destroy']=function(_0x49f2f8,_0x4d5c04){return db[_0xb0ce('0x26')][_0xb0ce('0x42')]({'where':{'id':_0x49f2f8[_0xb0ce('0x3d')]['id']}})[_0xb0ce('0x21')](handleEntityNotFound(_0x4d5c04,null))['then'](removeEntity(_0x4d5c04,null))[_0xb0ce('0x3e')](handleError(_0x4d5c04,null));}; \ No newline at end of file +var _0x7bcd=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','includeAll','include','SugarcrmField','findAll','rows','catch','show','params','keys','intersection','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb'];(function(_0x272eb7,_0x35b9d4){var _0x1cbc08=function(_0x278a33){while(--_0x278a33){_0x272eb7['push'](_0x272eb7['shift']());}};_0x1cbc08(++_0x35b9d4);}(_0x7bcd,0x154));var _0xd7bc=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0x7bcd[_0x152136];return _0x20df44;};'use strict';var emlformat=require(_0xd7bc('0x0'));var rimraf=require(_0xd7bc('0x1'));var zipdir=require(_0xd7bc('0x2'));var jsonpatch=require(_0xd7bc('0x3'));var rp=require(_0xd7bc('0x4'));var moment=require(_0xd7bc('0x5'));var BPromise=require(_0xd7bc('0x6'));var Mustache=require(_0xd7bc('0x7'));var util=require(_0xd7bc('0x8'));var path=require(_0xd7bc('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7bc('0xa'));var squel=require('squel');var crypto=require(_0xd7bc('0xb'));var jsforce=require(_0xd7bc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd7bc('0xd'));var Papa=require(_0xd7bc('0xe'));var Redis=require('ioredis');var authService=require(_0xd7bc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd7bc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd7bc('0x11'));var utils=require(_0xd7bc('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd7bc('0x13'))['db'];function respondWithStatusCode(_0x54a33d,_0x49dfbb){_0x49dfbb=_0x49dfbb||0xcc;return function(_0x246ca3){if(_0x246ca3){return _0x54a33d[_0xd7bc('0x14')](_0x49dfbb);}return _0x54a33d['status'](_0x49dfbb)[_0xd7bc('0x15')]();};}function respondWithResult(_0x384023,_0x2e2c76){_0x2e2c76=_0x2e2c76||0xc8;return function(_0x4305d9){if(_0x4305d9){return _0x384023[_0xd7bc('0x16')](_0x2e2c76)[_0xd7bc('0x17')](_0x4305d9);}};}function respondWithFilteredResult(_0x569dc5,_0x37d27f){return function(_0x53a449){if(_0x53a449){var _0x5c4fcf=typeof _0x37d27f[_0xd7bc('0x18')]===_0xd7bc('0x19')&&typeof _0x37d27f[_0xd7bc('0x1a')]===_0xd7bc('0x19');var _0x3a2b4f=_0x53a449[_0xd7bc('0x1b')];var _0x4cf577=_0x5c4fcf?0x0:_0x37d27f[_0xd7bc('0x18')];var _0x2cf77f=_0x5c4fcf?_0x53a449[_0xd7bc('0x1b')]:_0x37d27f['offset']+_0x37d27f[_0xd7bc('0x1a')];var _0x23e16a;if(_0x2cf77f>=_0x3a2b4f){_0x2cf77f=_0x3a2b4f;_0x23e16a=0xc8;}else{_0x23e16a=0xce;}_0x569dc5['status'](_0x23e16a);return _0x569dc5[_0xd7bc('0x1c')](_0xd7bc('0x1d'),_0x4cf577+'-'+_0x2cf77f+'/'+_0x3a2b4f)[_0xd7bc('0x17')](_0x53a449);}return null;};}function patchUpdates(_0xf170aa){return function(_0x3ff515){try{jsonpatch[_0xd7bc('0x1e')](_0x3ff515,_0xf170aa,!![]);}catch(_0x31ec77){return BPromise['reject'](_0x31ec77);}return _0x3ff515[_0xd7bc('0x1f')]();};}function saveUpdates(_0x411d5d,_0x5b4a13){return function(_0x590626){if(_0x590626){return _0x590626[_0xd7bc('0x20')](_0x411d5d)[_0xd7bc('0x21')](function(_0x1e2647){return _0x1e2647;});}return null;};}function removeEntity(_0x39aeb8,_0x5a02f1){return function(_0x53a581){if(_0x53a581){return _0x53a581[_0xd7bc('0x22')]()[_0xd7bc('0x21')](function(){_0x39aeb8[_0xd7bc('0x16')](0xcc)[_0xd7bc('0x15')]();});}};}function handleEntityNotFound(_0x38836a,_0x3b56e1){return function(_0x93f526){if(!_0x93f526){_0x38836a[_0xd7bc('0x14')](0x194);}return _0x93f526;};}function handleError(_0x4ed6d8,_0x3bbb98){_0x3bbb98=_0x3bbb98||0x1f4;return function(_0x20b049){logger[_0xd7bc('0x23')](_0x20b049[_0xd7bc('0x24')]);if(_0x20b049['name']){delete _0x20b049[_0xd7bc('0x25')];}_0x4ed6d8['status'](_0x3bbb98)[_0xd7bc('0x26')](_0x20b049);};}exports[_0xd7bc('0x27')]=function(_0xc944c2,_0x599620){var _0xc93de1={},_0x5215ef={},_0x351c63={'count':0x0,'rows':[]};var _0x3cfc2b=_[_0xd7bc('0x28')](db['SugarcrmField'][_0xd7bc('0x29')],function(_0x7b18fd){return{'name':_0x7b18fd[_0xd7bc('0x2a')],'type':_0x7b18fd[_0xd7bc('0x2b')]['key']};});_0x5215ef[_0xd7bc('0x2c')]=_[_0xd7bc('0x28')](_0x3cfc2b,_0xd7bc('0x25'));_0x5215ef[_0xd7bc('0x2d')]=_['keys'](_0xc944c2['query']);_0x5215ef[_0xd7bc('0x2e')]=_['intersection'](_0x5215ef[_0xd7bc('0x2c')],_0x5215ef['query']);_0xc93de1[_0xd7bc('0x2f')]=_['intersection'](_0x5215ef[_0xd7bc('0x2c')],qs[_0xd7bc('0x30')](_0xc944c2[_0xd7bc('0x2d')][_0xd7bc('0x30')]));_0xc93de1[_0xd7bc('0x2f')]=_0xc93de1[_0xd7bc('0x2f')][_0xd7bc('0x31')]?_0xc93de1['attributes']:_0x5215ef[_0xd7bc('0x2c')];if(!_0xc944c2['query'][_0xd7bc('0x32')](_0xd7bc('0x33'))){_0xc93de1[_0xd7bc('0x1a')]=qs[_0xd7bc('0x1a')](_0xc944c2[_0xd7bc('0x2d')][_0xd7bc('0x1a')]);_0xc93de1[_0xd7bc('0x18')]=qs['offset'](_0xc944c2[_0xd7bc('0x2d')][_0xd7bc('0x18')]);}_0xc93de1[_0xd7bc('0x34')]=qs[_0xd7bc('0x35')](_0xc944c2[_0xd7bc('0x2d')][_0xd7bc('0x35')]);_0xc93de1['where']=qs[_0xd7bc('0x2e')](_[_0xd7bc('0x36')](_0xc944c2[_0xd7bc('0x2d')],_0x5215ef[_0xd7bc('0x2e')]),_0x3cfc2b);if(_0xc944c2[_0xd7bc('0x2d')][_0xd7bc('0x37')]){_0xc93de1['where']=_[_0xd7bc('0x38')](_0xc93de1['where'],{'$or':_[_0xd7bc('0x28')](_0x3cfc2b,function(_0x1458ad){if(_0x1458ad[_0xd7bc('0x2b')]!=='VIRTUAL'){var _0x5812b7={};_0x5812b7[_0x1458ad['name']]={'$like':'%'+_0xc944c2['query'][_0xd7bc('0x37')]+'%'};return _0x5812b7;}})});}_0xc93de1=_[_0xd7bc('0x38')]({},_0xc93de1,_0xc944c2[_0xd7bc('0x39')]);var _0x553b45={'where':_0xc93de1[_0xd7bc('0x3a')]};return db['SugarcrmField'][_0xd7bc('0x1b')](_0x553b45)['then'](function(_0x5298a1){_0x351c63[_0xd7bc('0x1b')]=_0x5298a1;if(_0xc944c2[_0xd7bc('0x2d')][_0xd7bc('0x3b')]){_0xc93de1[_0xd7bc('0x3c')]=[{'all':!![]}];}return db[_0xd7bc('0x3d')][_0xd7bc('0x3e')](_0xc93de1);})[_0xd7bc('0x21')](function(_0x544d28){_0x351c63[_0xd7bc('0x3f')]=_0x544d28;return _0x351c63;})[_0xd7bc('0x21')](respondWithFilteredResult(_0x599620,_0xc93de1))[_0xd7bc('0x40')](handleError(_0x599620,null));};exports[_0xd7bc('0x41')]=function(_0x3bcade,_0x11db2d){var _0x222d41={'raw':!![],'where':{'id':_0x3bcade[_0xd7bc('0x42')]['id']}},_0x418362={};_0x418362[_0xd7bc('0x2c')]=_[_0xd7bc('0x43')](db['SugarcrmField'][_0xd7bc('0x29')]);_0x418362[_0xd7bc('0x2d')]=_[_0xd7bc('0x43')](_0x3bcade[_0xd7bc('0x2d')]);_0x418362[_0xd7bc('0x2e')]=_[_0xd7bc('0x44')](_0x418362[_0xd7bc('0x2c')],_0x418362['query']);_0x222d41[_0xd7bc('0x2f')]=_[_0xd7bc('0x44')](_0x418362[_0xd7bc('0x2c')],qs[_0xd7bc('0x30')](_0x3bcade[_0xd7bc('0x2d')][_0xd7bc('0x30')]));_0x222d41[_0xd7bc('0x2f')]=_0x222d41[_0xd7bc('0x2f')][_0xd7bc('0x31')]?_0x222d41[_0xd7bc('0x2f')]:_0x418362[_0xd7bc('0x2c')];if(_0x3bcade[_0xd7bc('0x2d')][_0xd7bc('0x3b')]){_0x222d41[_0xd7bc('0x3c')]=[{'all':!![]}];}_0x222d41=_[_0xd7bc('0x38')]({},_0x222d41,_0x3bcade[_0xd7bc('0x39')]);return db['SugarcrmField']['find'](_0x222d41)[_0xd7bc('0x21')](handleEntityNotFound(_0x11db2d,null))[_0xd7bc('0x21')](respondWithResult(_0x11db2d,null))[_0xd7bc('0x40')](handleError(_0x11db2d,null));};exports[_0xd7bc('0x45')]=function(_0xe88d84,_0x36658){return db['SugarcrmField'][_0xd7bc('0x45')](_0xe88d84[_0xd7bc('0x46')],{})[_0xd7bc('0x21')](respondWithResult(_0x36658,0xc9))[_0xd7bc('0x40')](handleError(_0x36658,null));};exports[_0xd7bc('0x20')]=function(_0x4bb643,_0x54ea2b){if(_0x4bb643[_0xd7bc('0x46')]['id']){delete _0x4bb643[_0xd7bc('0x46')]['id'];}return db['SugarcrmField'][_0xd7bc('0x47')]({'where':{'id':_0x4bb643['params']['id']}})[_0xd7bc('0x21')](handleEntityNotFound(_0x54ea2b,null))['then'](saveUpdates(_0x4bb643[_0xd7bc('0x46')],null))['then'](respondWithResult(_0x54ea2b,null))[_0xd7bc('0x40')](handleError(_0x54ea2b,null));};exports['destroy']=function(_0x41b63b,_0x42d1f2){return db[_0xd7bc('0x3d')][_0xd7bc('0x47')]({'where':{'id':_0x41b63b['params']['id']}})[_0xd7bc('0x21')](handleEntityNotFound(_0x42d1f2,null))[_0xd7bc('0x21')](removeEntity(_0x42d1f2,null))[_0xd7bc('0x40')](handleError(_0x42d1f2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index cd9d2dc..23e4eeb 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 _0xd448=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','moment','rimraf','../../config/environment','./intSugarcrmField.attributes','define'];(function(_0x3b2d66,_0x3abf1a){var _0x306ffc=function(_0x47d7e2){while(--_0x47d7e2){_0x3b2d66['push'](_0x3b2d66['shift']());}};_0x306ffc(++_0x3abf1a);}(_0xd448,0x13d));var _0x8d44=function(_0x56e59e,_0x1ca8f3){_0x56e59e=_0x56e59e-0x0;var _0x3dca40=_0xd448[_0x56e59e];return _0x3dca40;};'use strict';var _=require('lodash');var util=require(_0x8d44('0x0'));var logger=require(_0x8d44('0x1'))('api');var moment=require(_0x8d44('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d44('0x3'));var config=require(_0x8d44('0x4'));var attributes=require(_0x8d44('0x5'));module['exports']=function(_0x32546d,_0x5f2c45){return _0x32546d[_0x8d44('0x6')](_0x8d44('0x7'),attributes,{'tableName':_0x8d44('0x8'),'paranoid':![],'indexes':[{'name':_0x8d44('0x9'),'fields':[_0x8d44('0xa'),_0x8d44('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbb82=['util','../../config/logger','request-promise','path','rimraf','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb82,0x78));var _0x2bb8=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0xbb82[_0x562faf];return _0x22c1f6;};'use strict';var _=require(_0x2bb8('0x0'));var util=require(_0x2bb8('0x1'));var logger=require(_0x2bb8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2bb8('0x3'));var fs=require('fs');var path=require(_0x2bb8('0x4'));var rimraf=require(_0x2bb8('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x2bb8('0x6')]=function(_0x2c568b,_0xbc6357){return _0x2c568b[_0x2bb8('0x7')](_0x2bb8('0x8'),attributes,{'tableName':_0x2bb8('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x2bb8('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 6fd7f78..90698c1 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 _0xd1c2=['then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xd1c2,0x10d));var _0x2d1c=function(_0x2a11b4,_0x4f2819){_0x2a11b4=_0x2a11b4-0x0;var _0x9f9b55=_0xd1c2[_0x2a11b4];return _0x9f9b55;};'use strict';var _=require(_0x2d1c('0x0'));var util=require('util');var moment=require(_0x2d1c('0x1'));var BPromise=require(_0x2d1c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d1c('0x3'));var db=require(_0x2d1c('0x4'))['db'];var utils=require(_0x2d1c('0x5'));var logger=require(_0x2d1c('0x6'))(_0x2d1c('0x7'));var config=require('../../config/environment');var jayson=require(_0x2d1c('0x8'));var client=jayson['client'][_0x2d1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262d81,_0x2a383e,_0x1917bf){return new BPromise(function(_0x3e7a99,_0x142d60){return client[_0x2d1c('0xa')](_0x262d81,_0x1917bf)[_0x2d1c('0xb')](function(_0x8b7207){logger[_0x2d1c('0xc')](_0x2d1c('0xd'),_0x2a383e,_0x2d1c('0xe'));logger['debug'](_0x2d1c('0xf'),_0x2a383e,_0x2d1c('0xe'),JSON[_0x2d1c('0x10')](_0x8b7207));if(_0x8b7207[_0x2d1c('0x11')]){if(_0x8b7207[_0x2d1c('0x11')][_0x2d1c('0x12')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2a383e,_0x8b7207['error'][_0x2d1c('0x13')]);return _0x142d60(_0x8b7207[_0x2d1c('0x11')]['message']);}logger['error'](_0x2d1c('0xd'),_0x2a383e,_0x8b7207[_0x2d1c('0x11')][_0x2d1c('0x13')]);return _0x3e7a99(_0x8b7207[_0x2d1c('0x11')][_0x2d1c('0x13')]);}else{logger['info'](_0x2d1c('0xd'),_0x2a383e,_0x2d1c('0xe'));_0x3e7a99(_0x8b7207['result']['message']);}})['catch'](function(_0x89d4c2){logger[_0x2d1c('0x11')](_0x2d1c('0xd'),_0x2a383e,_0x89d4c2);_0x142d60(_0x89d4c2);});});} \ No newline at end of file +var _0x7beb=['client','http','request','then','info','request\x20sent','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0x7beb,0x14c));var _0xb7be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7beb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb7be('0x0'));var util=require(_0xb7be('0x1'));var moment=require(_0xb7be('0x2'));var BPromise=require(_0xb7be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7be('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7be('0x5'));var logger=require(_0xb7be('0x6'))(_0xb7be('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb7be('0x8')][_0xb7be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x573fa8,_0x1fbf9c,_0xa4c75c){return new BPromise(function(_0x323f3a,_0x54f395){return client[_0xb7be('0xa')](_0x573fa8,_0xa4c75c)[_0xb7be('0xb')](function(_0x5e4dda){logger[_0xb7be('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1fbf9c,_0xb7be('0xd'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1fbf9c,_0xb7be('0xd'),JSON['stringify'](_0x5e4dda));if(_0x5e4dda[_0xb7be('0xe')]){if(_0x5e4dda[_0xb7be('0xe')][_0xb7be('0xf')]===0x1f4){logger[_0xb7be('0xe')](_0xb7be('0x10'),_0x1fbf9c,_0x5e4dda[_0xb7be('0xe')][_0xb7be('0x11')]);return _0x54f395(_0x5e4dda['error'][_0xb7be('0x11')]);}logger[_0xb7be('0xe')](_0xb7be('0x10'),_0x1fbf9c,_0x5e4dda[_0xb7be('0xe')][_0xb7be('0x11')]);return _0x323f3a(_0x5e4dda['error']['message']);}else{logger['info'](_0xb7be('0x10'),_0x1fbf9c,_0xb7be('0xd'));_0x323f3a(_0x5e4dda[_0xb7be('0x12')]['message']);}})[_0xb7be('0x13')](function(_0x32c505){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1fbf9c,_0x32c505);_0x54f395(_0x32c505);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 2b01065..0b8a97c 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 _0x3dbb=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x450de1,_0x5b94bb){var _0x53849e=function(_0x46c70d){while(--_0x46c70d){_0x450de1['push'](_0x450de1['shift']());}};_0x53849e(++_0x5b94bb);}(_0x3dbb,0x67));var _0xb3db=function(_0x32088f,_0x538e0a){_0x32088f=_0x32088f-0x0;var _0x43abf1=_0x3dbb[_0x32088f];return _0x43abf1;};'use strict';var multer=require(_0xb3db('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb3db('0x1'));var express=require(_0xb3db('0x2'));var router=express['Router']();var fs_extra=require(_0xb3db('0x3'));var auth=require(_0xb3db('0x4'));var interaction=require(_0xb3db('0x5'));var config=require(_0xb3db('0x6'));var controller=require('./intVtigerAccount.controller');router[_0xb3db('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb3db('0x7')](_0xb3db('0x8'),auth[_0xb3db('0x9')](),controller['show']);router[_0xb3db('0x7')]('/:id/configurations',auth[_0xb3db('0x9')](),controller[_0xb3db('0xa')]);router['get'](_0xb3db('0xb'),auth[_0xb3db('0x9')](),controller[_0xb3db('0xc')]);router['post']('/',auth[_0xb3db('0x9')](),controller[_0xb3db('0xd')]);router[_0xb3db('0xe')](_0xb3db('0xf'),auth[_0xb3db('0x9')](),controller['addConfiguration']);router[_0xb3db('0x10')]('/:id',auth[_0xb3db('0x9')](),controller[_0xb3db('0x11')]);router[_0xb3db('0x12')]('/:id',auth[_0xb3db('0x9')](),controller[_0xb3db('0x13')]);module[_0xb3db('0x14')]=router; \ No newline at end of file +var _0x7b5b=['../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','getConfigurations','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x104a80,_0x32c145){var _0x4d10c5=function(_0x2d58de){while(--_0x2d58de){_0x104a80['push'](_0x104a80['shift']());}};_0x4d10c5(++_0x32c145);}(_0x7b5b,0x14a));var _0xb7b5=function(_0x389b17,_0x2b8e79){_0x389b17=_0x389b17-0x0;var _0x5a8e2a=_0x7b5b[_0x389b17];return _0x5a8e2a;};'use strict';var multer=require('multer');var util=require(_0xb7b5('0x0'));var path=require(_0xb7b5('0x1'));var timeout=require(_0xb7b5('0x2'));var express=require(_0xb7b5('0x3'));var router=express[_0xb7b5('0x4')]();var fs_extra=require(_0xb7b5('0x5'));var auth=require(_0xb7b5('0x6'));var interaction=require(_0xb7b5('0x7'));var config=require(_0xb7b5('0x8'));var controller=require(_0xb7b5('0x9'));router[_0xb7b5('0xa')]('/',auth[_0xb7b5('0xb')](),controller[_0xb7b5('0xc')]);router[_0xb7b5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb7b5('0xd')]);router[_0xb7b5('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xb7b5('0xe')]);router[_0xb7b5('0xa')]('/:id/fields',auth[_0xb7b5('0xb')](),controller[_0xb7b5('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb7b5('0x10')]);router[_0xb7b5('0x11')](_0xb7b5('0x12'),auth['isAuthenticated'](),controller[_0xb7b5('0x13')]);router[_0xb7b5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xb7b5('0x15')]);router[_0xb7b5('0x16')](_0xb7b5('0x17'),auth[_0xb7b5('0xb')](),controller[_0xb7b5('0x18')]);module[_0xb7b5('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 f805d1b..e034c65 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 _0x3898=['STRING','HelpDesk','sequelize','exports'];(function(_0x13d6f3,_0xec837c){var _0x17a727=function(_0xa2050c){while(--_0xa2050c){_0x13d6f3['push'](_0x13d6f3['shift']());}};_0x17a727(++_0xec837c);}(_0x3898,0x12a));var _0x8389=function(_0x10cf9c,_0xdb49bc){_0x10cf9c=_0x10cf9c-0x0;var _0x39b6ec=_0x3898[_0x10cf9c];return _0x39b6ec;};'use strict';var Sequelize=require(_0x8389('0x0'));module[_0x8389('0x1')]={'name':{'type':Sequelize[_0x8389('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8389('0x2')]},'username':{'type':Sequelize[_0x8389('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8389('0x2')],'allowNull':![],'defaultValue':_0x8389('0x3')},'remoteUri':{'type':Sequelize[_0x8389('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8389('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8357=['sequelize','STRING','HelpDesk'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x8357,0x111));var _0x7835=function(_0x36e173,_0xc62474){_0x36e173=_0x36e173-0x0;var _0x98d659=_0x8357[_0x36e173];return _0x98d659;};'use strict';var Sequelize=require(_0x7835('0x0'));module['exports']={'name':{'type':Sequelize[_0x7835('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7835('0x1')]},'username':{'type':Sequelize[_0x7835('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x7835('0x1')],'allowNull':![],'defaultValue':_0x7835('0x2')},'remoteUri':{'type':Sequelize[_0x7835('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7835('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index b45ac08..6a8caa9 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 _0x4922=['getFields','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','getchallenge','username','success','login','result','token','GET','describe','reference','remove','includes','editable','label','startsWith','picklist','picklistValues','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','end','error','stack','name','index','map','rawAttributes','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5'];(function(_0x2c8d89,_0x18ca1b){var _0xd38bab=function(_0x2be9d0){while(--_0x2be9d0){_0x2c8d89['push'](_0x2c8d89['shift']());}};_0xd38bab(++_0x18ca1b);}(_0x4922,0x96));var _0x2492=function(_0x42e5ea,_0x350f7a){_0x42e5ea=_0x42e5ea-0x0;var _0x2f4864=_0x4922[_0x42e5ea];return _0x2f4864;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2492('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2492('0x1'));var BPromise=require(_0x2492('0x2'));var Mustache=require(_0x2492('0x3'));var util=require(_0x2492('0x4'));var path=require(_0x2492('0x5'));var sox=require(_0x2492('0x6'));var csv=require(_0x2492('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2492('0x8'));var _=require('lodash');var squel=require(_0x2492('0x9'));var crypto=require(_0x2492('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2492('0xb'));var Papa=require(_0x2492('0xc'));var Redis=require(_0x2492('0xd'));var authService=require(_0x2492('0xe'));var qs=require(_0x2492('0xf'));var as=require(_0x2492('0x10'));var hardwareService=require(_0x2492('0x11'));var logger=require(_0x2492('0x12'))(_0x2492('0x13'));var utils=require(_0x2492('0x14'));var config=require(_0x2492('0x15'));var licenseUtil=require(_0x2492('0x16'));var db=require(_0x2492('0x17'))['db'];var integrations=require(_0x2492('0x18'));function respondWithStatusCode(_0x49d76b,_0x1bcc83){_0x1bcc83=_0x1bcc83||0xcc;return function(_0x548944){if(_0x548944){return _0x49d76b[_0x2492('0x19')](_0x1bcc83);}return _0x49d76b[_0x2492('0x1a')](_0x1bcc83)['end']();};}function respondWithResult(_0x5bb169,_0x22bf0c){_0x22bf0c=_0x22bf0c||0xc8;return function(_0x2aeb76){if(_0x2aeb76){return _0x5bb169[_0x2492('0x1a')](_0x22bf0c)[_0x2492('0x1b')](_0x2aeb76);}};}function respondWithFilteredResult(_0x8dcc95,_0x22c3e6){return function(_0x1787fc){if(_0x1787fc){var _0x4adc5d=typeof _0x22c3e6['offset']===_0x2492('0x1c')&&typeof _0x22c3e6[_0x2492('0x1d')]===_0x2492('0x1c');var _0x2a68ce=_0x1787fc[_0x2492('0x1e')];var _0x4bc9da=_0x4adc5d?0x0:_0x22c3e6[_0x2492('0x1f')];var _0xb3aafc=_0x4adc5d?_0x1787fc[_0x2492('0x1e')]:_0x22c3e6[_0x2492('0x1f')]+_0x22c3e6[_0x2492('0x1d')];var _0xaf20a0;if(_0xb3aafc>=_0x2a68ce){_0xb3aafc=_0x2a68ce;_0xaf20a0=0xc8;}else{_0xaf20a0=0xce;}_0x8dcc95['status'](_0xaf20a0);return _0x8dcc95[_0x2492('0x20')](_0x2492('0x21'),_0x4bc9da+'-'+_0xb3aafc+'/'+_0x2a68ce)['json'](_0x1787fc);}return null;};}function patchUpdates(_0x1f290f){return function(_0x414ebd){try{jsonpatch[_0x2492('0x22')](_0x414ebd,_0x1f290f,!![]);}catch(_0x4bc947){return BPromise['reject'](_0x4bc947);}return _0x414ebd[_0x2492('0x23')]();};}function saveUpdates(_0x586b92,_0x504902){return function(_0x1e3671){if(_0x1e3671){return _0x1e3671[_0x2492('0x24')](_0x586b92)['then'](function(_0x9526be){return _0x9526be;});}return null;};}function removeEntity(_0x21b73a,_0x253cb6){return function(_0x5b1987){if(_0x5b1987){return _0x5b1987['destroy']()[_0x2492('0x25')](function(){_0x21b73a[_0x2492('0x1a')](0xcc)[_0x2492('0x26')]();});}};}function handleEntityNotFound(_0x3682fc,_0x23a26f){return function(_0x5c756e){if(!_0x5c756e){_0x3682fc['sendStatus'](0x194);}return _0x5c756e;};}function handleError(_0x58e371,_0x3fbda0){_0x3fbda0=_0x3fbda0||0x1f4;return function(_0x12b8ba){logger[_0x2492('0x27')](_0x12b8ba[_0x2492('0x28')]);if(_0x12b8ba['name']){delete _0x12b8ba[_0x2492('0x29')];}_0x58e371[_0x2492('0x1a')](_0x3fbda0)['send'](_0x12b8ba);};}exports[_0x2492('0x2a')]=function(_0x5c2465,_0x17ca43){var _0x53a305={},_0xa49fb0={},_0x412e5c={'count':0x0,'rows':[]};var _0x5a8195=_[_0x2492('0x2b')](db['VtigerAccount'][_0x2492('0x2c')],function(_0x5ad48d){return{'name':_0x5ad48d['fieldName'],'type':_0x5ad48d[_0x2492('0x2d')][_0x2492('0x2e')]};});_0xa49fb0[_0x2492('0x2f')]=_[_0x2492('0x2b')](_0x5a8195,_0x2492('0x29'));_0xa49fb0['query']=_['keys'](_0x5c2465['query']);_0xa49fb0[_0x2492('0x30')]=_[_0x2492('0x31')](_0xa49fb0['model'],_0xa49fb0[_0x2492('0x32')]);_0x53a305[_0x2492('0x33')]=_['intersection'](_0xa49fb0[_0x2492('0x2f')],qs[_0x2492('0x34')](_0x5c2465[_0x2492('0x32')]['fields']));_0x53a305['attributes']=_0x53a305['attributes'][_0x2492('0x35')]?_0x53a305[_0x2492('0x33')]:_0xa49fb0[_0x2492('0x2f')];if(!_0x5c2465[_0x2492('0x32')][_0x2492('0x36')](_0x2492('0x37'))){_0x53a305[_0x2492('0x1d')]=qs[_0x2492('0x1d')](_0x5c2465[_0x2492('0x32')][_0x2492('0x1d')]);_0x53a305['offset']=qs[_0x2492('0x1f')](_0x5c2465[_0x2492('0x32')][_0x2492('0x1f')]);}_0x53a305[_0x2492('0x38')]=qs[_0x2492('0x39')](_0x5c2465['query'][_0x2492('0x39')]);_0x53a305[_0x2492('0x3a')]=qs[_0x2492('0x30')](_[_0x2492('0x3b')](_0x5c2465[_0x2492('0x32')],_0xa49fb0[_0x2492('0x30')]),_0x5a8195);if(_0x5c2465[_0x2492('0x32')][_0x2492('0x3c')]){_0x53a305[_0x2492('0x3a')]=_[_0x2492('0x3d')](_0x53a305[_0x2492('0x3a')],{'$or':_['map'](_0x5a8195,function(_0x239ed4){if(_0x239ed4[_0x2492('0x2d')]!==_0x2492('0x3e')){var _0x11f150={};_0x11f150[_0x239ed4['name']]={'$like':'%'+_0x5c2465['query'][_0x2492('0x3c')]+'%'};return _0x11f150;}})});}_0x53a305=_['merge']({},_0x53a305,_0x5c2465[_0x2492('0x3f')]);var _0x1e93a3={'where':_0x53a305[_0x2492('0x3a')]};return db[_0x2492('0x40')][_0x2492('0x1e')](_0x1e93a3)[_0x2492('0x25')](function(_0x452419){_0x412e5c[_0x2492('0x1e')]=_0x452419;if(_0x5c2465[_0x2492('0x32')][_0x2492('0x41')]){_0x53a305[_0x2492('0x42')]=[{'all':!![]}];}return db[_0x2492('0x40')][_0x2492('0x43')](_0x53a305);})[_0x2492('0x25')](function(_0x1a828b){_0x412e5c[_0x2492('0x44')]=_0x1a828b;return _0x412e5c;})[_0x2492('0x25')](respondWithFilteredResult(_0x17ca43,_0x53a305))[_0x2492('0x45')](handleError(_0x17ca43,null));};exports[_0x2492('0x46')]=function(_0x245396,_0x4d3c17){var _0x33314c={'raw':![],'where':{'id':_0x245396[_0x2492('0x47')]['id']}},_0x171191={};_0x171191[_0x2492('0x2f')]=_['keys'](db[_0x2492('0x40')]['rawAttributes']);_0x171191[_0x2492('0x32')]=_[_0x2492('0x48')](_0x245396[_0x2492('0x32')]);_0x171191[_0x2492('0x30')]=_['intersection'](_0x171191[_0x2492('0x2f')],_0x171191[_0x2492('0x32')]);_0x33314c[_0x2492('0x33')]=_['intersection'](_0x171191['model'],qs[_0x2492('0x34')](_0x245396[_0x2492('0x32')][_0x2492('0x34')]));_0x33314c[_0x2492('0x33')]=_0x33314c[_0x2492('0x33')]['length']?_0x33314c[_0x2492('0x33')]:_0x171191[_0x2492('0x2f')];if(_0x245396[_0x2492('0x32')][_0x2492('0x41')]){_0x33314c[_0x2492('0x42')]=[{'all':!![]}];}_0x33314c=_['merge']({},_0x33314c,_0x245396[_0x2492('0x3f')]);return db[_0x2492('0x40')]['find'](_0x33314c)[_0x2492('0x25')](handleEntityNotFound(_0x4d3c17,null))['then'](respondWithResult(_0x4d3c17,null))[_0x2492('0x45')](handleError(_0x4d3c17,null));};exports[_0x2492('0x49')]=function(_0x4ae1cf,_0x458f10){return db['VtigerAccount'][_0x2492('0x49')](_0x4ae1cf[_0x2492('0x4a')],{})[_0x2492('0x25')](respondWithResult(_0x458f10,0xc9))[_0x2492('0x45')](handleError(_0x458f10,null));};exports[_0x2492('0x24')]=function(_0x1e4688,_0x9821d1){if(_0x1e4688[_0x2492('0x4a')]['id']){delete _0x1e4688[_0x2492('0x4a')]['id'];}return db[_0x2492('0x40')][_0x2492('0x4b')]({'where':{'id':_0x1e4688[_0x2492('0x47')]['id']}})[_0x2492('0x25')](handleEntityNotFound(_0x9821d1,null))[_0x2492('0x25')](saveUpdates(_0x1e4688[_0x2492('0x4a')],null))[_0x2492('0x25')](respondWithResult(_0x9821d1,null))[_0x2492('0x45')](handleError(_0x9821d1,null));};exports[_0x2492('0x4c')]=function(_0x2866b2,_0x150032){return db[_0x2492('0x40')][_0x2492('0x4b')]({'where':{'id':_0x2866b2['params']['id']}})['then'](handleEntityNotFound(_0x150032,null))[_0x2492('0x25')](removeEntity(_0x150032,null))[_0x2492('0x45')](handleError(_0x150032,null));};exports['getConfigurations']=function(_0x11cb49,_0x15d85c,_0x564a8e){var _0x3ce4ba={};var _0x243b23={};var _0x373547;var _0x15c4ab;return db['VtigerAccount'][_0x2492('0x4d')]({'where':{'id':_0x11cb49[_0x2492('0x47')]['id']}})[_0x2492('0x25')](handleEntityNotFound(_0x15d85c,null))[_0x2492('0x25')](function(_0x2af15f){if(_0x2af15f){_0x373547=_0x2af15f;_0x243b23[_0x2492('0x2f')]=_[_0x2492('0x48')](db[_0x2492('0x4e')][_0x2492('0x2c')]);_0x243b23['query']=_[_0x2492('0x48')](_0x11cb49['query']);_0x243b23[_0x2492('0x30')]=_['intersection'](_0x243b23[_0x2492('0x2f')],_0x243b23[_0x2492('0x32')]);_0x3ce4ba['attributes']=_[_0x2492('0x31')](_0x243b23[_0x2492('0x2f')],qs[_0x2492('0x34')](_0x11cb49['query']['fields']));_0x3ce4ba[_0x2492('0x33')]=_0x3ce4ba[_0x2492('0x33')]['length']?_0x3ce4ba[_0x2492('0x33')]:_0x243b23[_0x2492('0x2f')];_0x3ce4ba[_0x2492('0x38')]=qs[_0x2492('0x39')](_0x11cb49[_0x2492('0x32')][_0x2492('0x39')]);_0x3ce4ba[_0x2492('0x3a')]=qs[_0x2492('0x30')](_[_0x2492('0x3b')](_0x11cb49['query'],_0x243b23[_0x2492('0x30')]));if(_0x11cb49[_0x2492('0x32')][_0x2492('0x3c')]){_0x3ce4ba[_0x2492('0x3a')]=_['merge'](_0x3ce4ba[_0x2492('0x3a')],{'$or':_[_0x2492('0x2b')](_0x3ce4ba[_0x2492('0x33')],function(_0x2fbdad){var _0x1005ad={};_0x1005ad[_0x2fbdad]={'$like':'%'+_0x11cb49[_0x2492('0x32')]['filter']+'%'};return _0x1005ad;})});}_0x3ce4ba=_[_0x2492('0x3d')]({},_0x3ce4ba,_0x11cb49[_0x2492('0x3f')]);return _0x373547['getConfigurations'](_0x3ce4ba);}})['then'](function(_0x1150aa){if(_0x1150aa){_0x15c4ab=_0x1150aa['length'];if(!_0x11cb49[_0x2492('0x32')][_0x2492('0x36')](_0x2492('0x37'))){_0x3ce4ba[_0x2492('0x1d')]=qs[_0x2492('0x1d')](_0x11cb49[_0x2492('0x32')]['limit']);_0x3ce4ba[_0x2492('0x1f')]=qs[_0x2492('0x1f')](_0x11cb49[_0x2492('0x32')][_0x2492('0x1f')]);}return _0x373547[_0x2492('0x4f')](_0x3ce4ba);}})['then'](function(_0x2bf4dc){if(_0x2bf4dc){return _0x2bf4dc?{'count':_0x15c4ab,'rows':_0x2bf4dc}:null;}})[_0x2492('0x25')](respondWithResult(_0x15d85c,null))[_0x2492('0x45')](handleError(_0x15d85c,null));};exports[_0x2492('0x50')]=function(_0x3eed3d,_0x138c45,_0x5bfd9b){if(_0x3eed3d[_0x2492('0x4a')]['id']){delete _0x3eed3d[_0x2492('0x4a')]['id'];}return db['VtigerAccount'][_0x2492('0x4d')]({'where':{'id':_0x3eed3d['params']['id']}})['then'](handleEntityNotFound(_0x138c45,null))[_0x2492('0x25')](function(_0x402433){if(_0x402433){_0x3eed3d[_0x2492('0x4a')][_0x2492('0x51')]=_0x402433['id'];_0x3eed3d['body']['Subjects']=integrations['getSubjects'](_0x3eed3d['body'][_0x2492('0x52')],_0x3eed3d['body'][_0x2492('0x2d')]);_0x3eed3d[_0x2492('0x4a')][_0x2492('0x53')]=integrations[_0x2492('0x54')](_0x3eed3d['body'][_0x2492('0x52')],_0x3eed3d['body']['type']);return db[_0x2492('0x4e')][_0x2492('0x49')](_0x3eed3d[_0x2492('0x4a')],{'include':[{'model':db[_0x2492('0x55')],'as':_0x2492('0x56')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x2492('0x25')](respondWithResult(_0x138c45,null))['catch'](handleError(_0x138c45,null));};var md5=require(_0x2492('0x57'));exports[_0x2492('0x58')]=function(_0x3ad87b,_0x4a4dc4,_0x3bdc78){var _0x4404af=null;var _0x32ab7c=null;var _0x506444=null;var _0x5271b7=null;var _0x25f5e9='';return db[_0x2492('0x40')][_0x2492('0x4d')]({'where':{'id':_0x3ad87b[_0x2492('0x47')]['id']},'attributes':['id',_0x2492('0x29'),'username','description',_0x2492('0x59'),_0x2492('0x5a'),_0x2492('0x5b'),_0x2492('0x5c')]})[_0x2492('0x25')](handleEntityNotFound(_0x4a4dc4,null))[_0x2492('0x25')](function(_0x22add3){if(_0x22add3){_0x4404af=_0x22add3['username'];_0x32ab7c=_0x22add3[_0x2492('0x5c')];_0x506444=_0x22add3[_0x2492('0x59')];_0x25f5e9=_0x22add3[_0x2492('0x5a')];var _0x5f3c4e=_0x25f5e9[_0x2492('0x5d')](-0x1);if(_0x5f3c4e==='/'){_0x25f5e9=_0x25f5e9[_0x2492('0x5e')](0x0,_0x25f5e9[_0x2492('0x5f')](_0x5f3c4e));}_0x5271b7=util['format']('%s/webservice.php',_0x25f5e9);var _0x436fa2={'method':'GET','uri':_0x5271b7,'qs':{'operation':_0x2492('0x60'),'username':_0x22add3[_0x2492('0x61')]},'json':!![]};return rp(_0x436fa2);}})[_0x2492('0x25')](function(_0x4925c7){if(_0x4925c7[_0x2492('0x62')]){var _0x29ed31={'method':'POST','uri':_0x5271b7,'form':{'operation':_0x2492('0x63'),'username':_0x4404af,'accessKey':md5(_0x4925c7[_0x2492('0x64')][_0x2492('0x65')]+_0x32ab7c)},'json':!![]};return rp(_0x29ed31);}})[_0x2492('0x25')](function(_0x5e1005){if(_0x5e1005[_0x2492('0x62')]){var _0x107c59={'method':_0x2492('0x66'),'uri':_0x5271b7,'qs':{'operation':_0x2492('0x67'),'username':_0x4404af,'sessionName':_0x5e1005[_0x2492('0x64')]['sessionName'],'elementType':_0x506444},'json':!![]};return rp(_0x107c59);}})[_0x2492('0x25')](function(_0x42c6f1){if(_0x42c6f1['success']){var _0x4feca4=['autogenerated',_0x2492('0x68'),'owner'];_[_0x2492('0x69')](_0x42c6f1[_0x2492('0x64')][_0x2492('0x34')],function(_0xb3c062){return _0x4feca4[_0x2492('0x6a')](_0xb3c062['type'][_0x2492('0x29')]);});_['remove'](_0x42c6f1[_0x2492('0x64')][_0x2492('0x34')],function(_0x557744){return _0x557744[_0x2492('0x6b')]==='false';});return{'count':_0x42c6f1[_0x2492('0x64')][_0x2492('0x34')][_0x2492('0x35')],'rows':_[_0x2492('0x2b')](_0x42c6f1[_0x2492('0x64')]['fields'],function(_0x274528){return{'id':_0x274528[_0x2492('0x29')],'name':_0x274528[_0x2492('0x6c')],'custom':_[_0x2492('0x6d')](_0x274528[_0x2492('0x29')],'cf_')?!![]:![],'options':_0x274528[_0x2492('0x2d')]['name']===_0x2492('0x6e')&&_0x274528[_0x2492('0x2d')][_0x2492('0x6f')][_0x2492('0x35')]>0x0?_[_0x2492('0x2b')](_0x274528['type'][_0x2492('0x6f')],function(_0x3325ec){return{'name':_0x3325ec[_0x2492('0x6c')],'value':_0x3325ec['value']};}):[]};})};}})[_0x2492('0x25')](respondWithResult(_0x4a4dc4,null))[_0x2492('0x45')](function(_0x2022c0){console[_0x2492('0x70')]('vTiger\x20error:\x20'+_0x2022c0);var _0x49d259=_0x3ad87b['query'][_0x2492('0x71')]?0x1f4:_0x2022c0[_0x2492('0x72')]||0x1f4;logger[_0x2492('0x27')](_0x2492('0x73'),'getFields',_0x49d259,JSON[_0x2492('0x74')](_0x2022c0));delete _0x2022c0['name'];if(_0x49d259===0x191){_0x49d259=0x190;}_0x4a4dc4[_0x2492('0x1a')](_0x49d259)[_0x2492('0x75')](_0x3ad87b[_0x2492('0x32')]['test']?{'message':_0x2492('0x76'),'statusCode':_0x2022c0['statusCode']}:_0x2022c0);});}; \ No newline at end of file +var _0x54cf=['error','stack','name','send','index','map','VtigerAccount','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','create','body','find','getConfigurations','findOne','VtigerConfiguration','merge','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','result','token','describe','sessionName','autogenerated','reference','owner','remove','false','startsWith','picklistValues','label','value','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then'];(function(_0xba6598,_0x3271a6){var _0x3b69d2=function(_0x15e0c6){while(--_0x15e0c6){_0xba6598['push'](_0xba6598['shift']());}};_0x3b69d2(++_0x3271a6);}(_0x54cf,0x149));var _0xf54c=function(_0x62b95,_0x5e3d0a){_0x62b95=_0x62b95-0x0;var _0x155531=_0x54cf[_0x62b95];return _0x155531;};'use strict';var emlformat=require(_0xf54c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf54c('0x1'));var rp=require(_0xf54c('0x2'));var moment=require(_0xf54c('0x3'));var BPromise=require(_0xf54c('0x4'));var Mustache=require(_0xf54c('0x5'));var util=require(_0xf54c('0x6'));var path=require(_0xf54c('0x7'));var sox=require(_0xf54c('0x8'));var csv=require(_0xf54c('0x9'));var ejs=require(_0xf54c('0xa'));var fs=require('fs');var fs_extra=require(_0xf54c('0xb'));var _=require(_0xf54c('0xc'));var squel=require(_0xf54c('0xd'));var crypto=require(_0xf54c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf54c('0xf'));var toCsv=require(_0xf54c('0x9'));var querystring=require('querystring');var Papa=require(_0xf54c('0x10'));var Redis=require(_0xf54c('0x11'));var authService=require(_0xf54c('0x12'));var qs=require(_0xf54c('0x13'));var as=require(_0xf54c('0x14'));var hardwareService=require(_0xf54c('0x15'));var logger=require(_0xf54c('0x16'))(_0xf54c('0x17'));var utils=require('../../config/utils');var config=require(_0xf54c('0x18'));var licenseUtil=require(_0xf54c('0x19'));var db=require(_0xf54c('0x1a'))['db'];var integrations=require(_0xf54c('0x1b'));function respondWithStatusCode(_0x38ae41,_0xb01779){_0xb01779=_0xb01779||0xcc;return function(_0x35b55e){if(_0x35b55e){return _0x38ae41[_0xf54c('0x1c')](_0xb01779);}return _0x38ae41[_0xf54c('0x1d')](_0xb01779)['end']();};}function respondWithResult(_0x214678,_0x440025){_0x440025=_0x440025||0xc8;return function(_0x419a2c){if(_0x419a2c){return _0x214678[_0xf54c('0x1d')](_0x440025)['json'](_0x419a2c);}};}function respondWithFilteredResult(_0x257004,_0xe6f899){return function(_0x51c50e){if(_0x51c50e){var _0x478589=typeof _0xe6f899[_0xf54c('0x1e')]==='undefined'&&typeof _0xe6f899[_0xf54c('0x1f')]===_0xf54c('0x20');var _0x373344=_0x51c50e[_0xf54c('0x21')];var _0x268f6f=_0x478589?0x0:_0xe6f899[_0xf54c('0x1e')];var _0xb4adc5=_0x478589?_0x51c50e[_0xf54c('0x21')]:_0xe6f899['offset']+_0xe6f899[_0xf54c('0x1f')];var _0x68ad4f;if(_0xb4adc5>=_0x373344){_0xb4adc5=_0x373344;_0x68ad4f=0xc8;}else{_0x68ad4f=0xce;}_0x257004[_0xf54c('0x1d')](_0x68ad4f);return _0x257004[_0xf54c('0x22')](_0xf54c('0x23'),_0x268f6f+'-'+_0xb4adc5+'/'+_0x373344)[_0xf54c('0x24')](_0x51c50e);}return null;};}function patchUpdates(_0x5ec277){return function(_0x2e3283){try{jsonpatch[_0xf54c('0x25')](_0x2e3283,_0x5ec277,!![]);}catch(_0x993e4a){return BPromise[_0xf54c('0x26')](_0x993e4a);}return _0x2e3283[_0xf54c('0x27')]();};}function saveUpdates(_0x448874,_0x3ecdb2){return function(_0x54f124){if(_0x54f124){return _0x54f124[_0xf54c('0x28')](_0x448874)['then'](function(_0x562ffe){return _0x562ffe;});}return null;};}function removeEntity(_0x1f363c,_0x4c5eea){return function(_0x4f0bf7){if(_0x4f0bf7){return _0x4f0bf7[_0xf54c('0x29')]()[_0xf54c('0x2a')](function(){_0x1f363c[_0xf54c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x317a8c,_0x13a29c){return function(_0x520762){if(!_0x520762){_0x317a8c[_0xf54c('0x1c')](0x194);}return _0x520762;};}function handleError(_0x53e6a3,_0x23cce3){_0x23cce3=_0x23cce3||0x1f4;return function(_0x25e84d){logger[_0xf54c('0x2b')](_0x25e84d[_0xf54c('0x2c')]);if(_0x25e84d['name']){delete _0x25e84d[_0xf54c('0x2d')];}_0x53e6a3[_0xf54c('0x1d')](_0x23cce3)[_0xf54c('0x2e')](_0x25e84d);};}exports[_0xf54c('0x2f')]=function(_0x377a5a,_0x341cf6){var _0x271245={},_0x40d5ec={},_0x179c12={'count':0x0,'rows':[]};var _0xd047e1=_[_0xf54c('0x30')](db[_0xf54c('0x31')]['rawAttributes'],function(_0x542c44){return{'name':_0x542c44[_0xf54c('0x32')],'type':_0x542c44[_0xf54c('0x33')][_0xf54c('0x34')]};});_0x40d5ec['model']=_[_0xf54c('0x30')](_0xd047e1,'name');_0x40d5ec[_0xf54c('0x35')]=_[_0xf54c('0x36')](_0x377a5a['query']);_0x40d5ec[_0xf54c('0x37')]=_[_0xf54c('0x38')](_0x40d5ec['model'],_0x40d5ec['query']);_0x271245['attributes']=_[_0xf54c('0x38')](_0x40d5ec[_0xf54c('0x39')],qs[_0xf54c('0x3a')](_0x377a5a['query'][_0xf54c('0x3a')]));_0x271245[_0xf54c('0x3b')]=_0x271245[_0xf54c('0x3b')][_0xf54c('0x3c')]?_0x271245[_0xf54c('0x3b')]:_0x40d5ec[_0xf54c('0x39')];if(!_0x377a5a[_0xf54c('0x35')][_0xf54c('0x3d')](_0xf54c('0x3e'))){_0x271245[_0xf54c('0x1f')]=qs[_0xf54c('0x1f')](_0x377a5a[_0xf54c('0x35')][_0xf54c('0x1f')]);_0x271245[_0xf54c('0x1e')]=qs[_0xf54c('0x1e')](_0x377a5a['query']['offset']);}_0x271245[_0xf54c('0x3f')]=qs['sort'](_0x377a5a['query'][_0xf54c('0x40')]);_0x271245[_0xf54c('0x41')]=qs['filters'](_[_0xf54c('0x42')](_0x377a5a['query'],_0x40d5ec[_0xf54c('0x37')]),_0xd047e1);if(_0x377a5a[_0xf54c('0x35')][_0xf54c('0x43')]){_0x271245[_0xf54c('0x41')]=_['merge'](_0x271245[_0xf54c('0x41')],{'$or':_[_0xf54c('0x30')](_0xd047e1,function(_0x56a235){if(_0x56a235['type']!==_0xf54c('0x44')){var _0x27de15={};_0x27de15[_0x56a235[_0xf54c('0x2d')]]={'$like':'%'+_0x377a5a[_0xf54c('0x35')][_0xf54c('0x43')]+'%'};return _0x27de15;}})});}_0x271245=_['merge']({},_0x271245,_0x377a5a[_0xf54c('0x45')]);var _0x223900={'where':_0x271245[_0xf54c('0x41')]};return db[_0xf54c('0x31')][_0xf54c('0x21')](_0x223900)[_0xf54c('0x2a')](function(_0x20fa09){_0x179c12[_0xf54c('0x21')]=_0x20fa09;if(_0x377a5a['query'][_0xf54c('0x46')]){_0x271245[_0xf54c('0x47')]=[{'all':!![]}];}return db[_0xf54c('0x31')][_0xf54c('0x48')](_0x271245);})['then'](function(_0x195f8c){_0x179c12['rows']=_0x195f8c;return _0x179c12;})[_0xf54c('0x2a')](respondWithFilteredResult(_0x341cf6,_0x271245))[_0xf54c('0x49')](handleError(_0x341cf6,null));};exports['show']=function(_0x2ffe3d,_0x56155f){var _0x234616={'raw':![],'where':{'id':_0x2ffe3d[_0xf54c('0x4a')]['id']}},_0x26e6f5={};_0x26e6f5[_0xf54c('0x39')]=_[_0xf54c('0x36')](db[_0xf54c('0x31')][_0xf54c('0x4b')]);_0x26e6f5[_0xf54c('0x35')]=_['keys'](_0x2ffe3d[_0xf54c('0x35')]);_0x26e6f5[_0xf54c('0x37')]=_['intersection'](_0x26e6f5[_0xf54c('0x39')],_0x26e6f5[_0xf54c('0x35')]);_0x234616[_0xf54c('0x3b')]=_['intersection'](_0x26e6f5[_0xf54c('0x39')],qs[_0xf54c('0x3a')](_0x2ffe3d[_0xf54c('0x35')][_0xf54c('0x3a')]));_0x234616[_0xf54c('0x3b')]=_0x234616['attributes'][_0xf54c('0x3c')]?_0x234616[_0xf54c('0x3b')]:_0x26e6f5['model'];if(_0x2ffe3d['query'][_0xf54c('0x46')]){_0x234616[_0xf54c('0x47')]=[{'all':!![]}];}_0x234616=_['merge']({},_0x234616,_0x2ffe3d['options']);return db[_0xf54c('0x31')]['find'](_0x234616)[_0xf54c('0x2a')](handleEntityNotFound(_0x56155f,null))[_0xf54c('0x2a')](respondWithResult(_0x56155f,null))['catch'](handleError(_0x56155f,null));};exports[_0xf54c('0x4c')]=function(_0x2ff7d3,_0x54a0c5){return db['VtigerAccount'][_0xf54c('0x4c')](_0x2ff7d3[_0xf54c('0x4d')],{})[_0xf54c('0x2a')](respondWithResult(_0x54a0c5,0xc9))[_0xf54c('0x49')](handleError(_0x54a0c5,null));};exports[_0xf54c('0x28')]=function(_0x3b85ed,_0x2f827d){if(_0x3b85ed['body']['id']){delete _0x3b85ed[_0xf54c('0x4d')]['id'];}return db[_0xf54c('0x31')][_0xf54c('0x4e')]({'where':{'id':_0x3b85ed['params']['id']}})[_0xf54c('0x2a')](handleEntityNotFound(_0x2f827d,null))[_0xf54c('0x2a')](saveUpdates(_0x3b85ed['body'],null))['then'](respondWithResult(_0x2f827d,null))[_0xf54c('0x49')](handleError(_0x2f827d,null));};exports[_0xf54c('0x29')]=function(_0x3dc18e,_0x5b54d4){return db[_0xf54c('0x31')][_0xf54c('0x4e')]({'where':{'id':_0x3dc18e[_0xf54c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b54d4,null))[_0xf54c('0x2a')](removeEntity(_0x5b54d4,null))[_0xf54c('0x49')](handleError(_0x5b54d4,null));};exports[_0xf54c('0x4f')]=function(_0x197aaa,_0x368f2e,_0x553c2c){var _0x242bbe={};var _0x3b1adc={};var _0x2ba1bf;var _0x432587;return db[_0xf54c('0x31')][_0xf54c('0x50')]({'where':{'id':_0x197aaa[_0xf54c('0x4a')]['id']}})[_0xf54c('0x2a')](handleEntityNotFound(_0x368f2e,null))['then'](function(_0x4fbd63){if(_0x4fbd63){_0x2ba1bf=_0x4fbd63;_0x3b1adc[_0xf54c('0x39')]=_['keys'](db[_0xf54c('0x51')][_0xf54c('0x4b')]);_0x3b1adc[_0xf54c('0x35')]=_[_0xf54c('0x36')](_0x197aaa[_0xf54c('0x35')]);_0x3b1adc[_0xf54c('0x37')]=_[_0xf54c('0x38')](_0x3b1adc['model'],_0x3b1adc[_0xf54c('0x35')]);_0x242bbe[_0xf54c('0x3b')]=_['intersection'](_0x3b1adc['model'],qs[_0xf54c('0x3a')](_0x197aaa[_0xf54c('0x35')][_0xf54c('0x3a')]));_0x242bbe['attributes']=_0x242bbe['attributes'][_0xf54c('0x3c')]?_0x242bbe[_0xf54c('0x3b')]:_0x3b1adc[_0xf54c('0x39')];_0x242bbe['order']=qs[_0xf54c('0x40')](_0x197aaa[_0xf54c('0x35')]['sort']);_0x242bbe['where']=qs[_0xf54c('0x37')](_[_0xf54c('0x42')](_0x197aaa[_0xf54c('0x35')],_0x3b1adc['filters']));if(_0x197aaa['query'][_0xf54c('0x43')]){_0x242bbe[_0xf54c('0x41')]=_[_0xf54c('0x52')](_0x242bbe[_0xf54c('0x41')],{'$or':_[_0xf54c('0x30')](_0x242bbe[_0xf54c('0x3b')],function(_0x34ec5f){var _0x58876d={};_0x58876d[_0x34ec5f]={'$like':'%'+_0x197aaa[_0xf54c('0x35')][_0xf54c('0x43')]+'%'};return _0x58876d;})});}_0x242bbe=_[_0xf54c('0x52')]({},_0x242bbe,_0x197aaa[_0xf54c('0x45')]);return _0x2ba1bf[_0xf54c('0x4f')](_0x242bbe);}})[_0xf54c('0x2a')](function(_0x364fc7){if(_0x364fc7){_0x432587=_0x364fc7['length'];if(!_0x197aaa[_0xf54c('0x35')][_0xf54c('0x3d')]('nolimit')){_0x242bbe[_0xf54c('0x1f')]=qs[_0xf54c('0x1f')](_0x197aaa[_0xf54c('0x35')][_0xf54c('0x1f')]);_0x242bbe[_0xf54c('0x1e')]=qs[_0xf54c('0x1e')](_0x197aaa['query'][_0xf54c('0x1e')]);}return _0x2ba1bf[_0xf54c('0x4f')](_0x242bbe);}})[_0xf54c('0x2a')](function(_0x46105e){if(_0x46105e){return _0x46105e?{'count':_0x432587,'rows':_0x46105e}:null;}})[_0xf54c('0x2a')](respondWithResult(_0x368f2e,null))['catch'](handleError(_0x368f2e,null));};exports[_0xf54c('0x53')]=function(_0x29df92,_0x2d605d,_0x505dad){if(_0x29df92[_0xf54c('0x4d')]['id']){delete _0x29df92['body']['id'];}return db[_0xf54c('0x31')][_0xf54c('0x50')]({'where':{'id':_0x29df92[_0xf54c('0x4a')]['id']}})[_0xf54c('0x2a')](handleEntityNotFound(_0x2d605d,null))[_0xf54c('0x2a')](function(_0x5284cf){if(_0x5284cf){_0x29df92[_0xf54c('0x4d')][_0xf54c('0x54')]=_0x5284cf['id'];_0x29df92['body'][_0xf54c('0x55')]=integrations[_0xf54c('0x56')](_0x29df92[_0xf54c('0x4d')][_0xf54c('0x57')],_0x29df92[_0xf54c('0x4d')][_0xf54c('0x33')]);_0x29df92[_0xf54c('0x4d')][_0xf54c('0x58')]=integrations[_0xf54c('0x59')](_0x29df92[_0xf54c('0x4d')]['channel'],_0x29df92['body']['type']);return db[_0xf54c('0x51')]['create'](_0x29df92[_0xf54c('0x4d')],{'include':[{'model':db[_0xf54c('0x5a')],'as':_0xf54c('0x55')},{'model':db[_0xf54c('0x5a')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2d605d,null))[_0xf54c('0x49')](handleError(_0x2d605d,null));};var md5=require(_0xf54c('0x5b'));exports[_0xf54c('0x5c')]=function(_0x4b4edb,_0x7227a4,_0x50c865){var _0x1d466b=null;var _0x4d1fcf=null;var _0x3f79f9=null;var _0x1f2f5f=null;var _0x50497f='';return db[_0xf54c('0x31')][_0xf54c('0x50')]({'where':{'id':_0x4b4edb[_0xf54c('0x4a')]['id']},'attributes':['id','name',_0xf54c('0x5d'),'description','moduleName',_0xf54c('0x5e'),_0xf54c('0x5f'),_0xf54c('0x60')]})[_0xf54c('0x2a')](handleEntityNotFound(_0x7227a4,null))[_0xf54c('0x2a')](function(_0x196839){if(_0x196839){_0x1d466b=_0x196839[_0xf54c('0x5d')];_0x4d1fcf=_0x196839['accessKey'];_0x3f79f9=_0x196839[_0xf54c('0x61')];_0x50497f=_0x196839[_0xf54c('0x5e')];var _0x58a718=_0x50497f[_0xf54c('0x62')](-0x1);if(_0x58a718==='/'){_0x50497f=_0x50497f[_0xf54c('0x63')](0x0,_0x50497f[_0xf54c('0x64')](_0x58a718));}_0x1f2f5f=util[_0xf54c('0x65')]('%s/webservice.php',_0x50497f);var _0x252f27={'method':_0xf54c('0x66'),'uri':_0x1f2f5f,'qs':{'operation':_0xf54c('0x67'),'username':_0x196839['username']},'json':!![]};return rp(_0x252f27);}})[_0xf54c('0x2a')](function(_0x2f21e9){if(_0x2f21e9[_0xf54c('0x68')]){var _0x59b50c={'method':_0xf54c('0x69'),'uri':_0x1f2f5f,'form':{'operation':'login','username':_0x1d466b,'accessKey':md5(_0x2f21e9[_0xf54c('0x6a')][_0xf54c('0x6b')]+_0x4d1fcf)},'json':!![]};return rp(_0x59b50c);}})['then'](function(_0x139613){if(_0x139613[_0xf54c('0x68')]){var _0x1d4b8b={'method':'GET','uri':_0x1f2f5f,'qs':{'operation':_0xf54c('0x6c'),'username':_0x1d466b,'sessionName':_0x139613[_0xf54c('0x6a')][_0xf54c('0x6d')],'elementType':_0x3f79f9},'json':!![]};return rp(_0x1d4b8b);}})['then'](function(_0x3413f5){if(_0x3413f5[_0xf54c('0x68')]){var _0x207ed1=[_0xf54c('0x6e'),_0xf54c('0x6f'),_0xf54c('0x70')];_[_0xf54c('0x71')](_0x3413f5[_0xf54c('0x6a')][_0xf54c('0x3a')],function(_0x8e9487){return _0x207ed1['includes'](_0x8e9487[_0xf54c('0x33')]['name']);});_['remove'](_0x3413f5[_0xf54c('0x6a')][_0xf54c('0x3a')],function(_0x4977f8){return _0x4977f8['editable']===_0xf54c('0x72');});return{'count':_0x3413f5[_0xf54c('0x6a')][_0xf54c('0x3a')][_0xf54c('0x3c')],'rows':_['map'](_0x3413f5[_0xf54c('0x6a')][_0xf54c('0x3a')],function(_0x5d864e){return{'id':_0x5d864e['name'],'name':_0x5d864e['label'],'custom':_[_0xf54c('0x73')](_0x5d864e[_0xf54c('0x2d')],'cf_')?!![]:![],'options':_0x5d864e['type'][_0xf54c('0x2d')]==='picklist'&&_0x5d864e[_0xf54c('0x33')][_0xf54c('0x74')][_0xf54c('0x3c')]>0x0?_[_0xf54c('0x30')](_0x5d864e[_0xf54c('0x33')][_0xf54c('0x74')],function(_0x19322c){return{'name':_0x19322c[_0xf54c('0x75')],'value':_0x19322c[_0xf54c('0x76')]};}):[]};})};}})[_0xf54c('0x2a')](respondWithResult(_0x7227a4,null))['catch'](function(_0x57bdaa){console[_0xf54c('0x77')](_0xf54c('0x78')+_0x57bdaa);var _0x4d6ce7=_0x4b4edb[_0xf54c('0x35')]['test']?0x1f4:_0x57bdaa['statusCode']||0x1f4;logger['error'](_0xf54c('0x79'),_0xf54c('0x5c'),_0x4d6ce7,JSON[_0xf54c('0x7a')](_0x57bdaa));delete _0x57bdaa[_0xf54c('0x2d')];if(_0x4d6ce7===0x191){_0x4d6ce7=0x190;}_0x7227a4['status'](_0x4d6ce7)[_0xf54c('0x2e')](_0x4b4edb[_0xf54c('0x35')][_0xf54c('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x57bdaa['statusCode']}:_0x57bdaa);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 752ad8b..e720398 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 _0xe4ae=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','VtigerAccount','int_vtiger_accounts','lodash','util','api','bluebird'];(function(_0x5c0ba5,_0x3354e0){var _0x239061=function(_0x186952){while(--_0x186952){_0x5c0ba5['push'](_0x5c0ba5['shift']());}};_0x239061(++_0x3354e0);}(_0xe4ae,0x1ca));var _0xee4a=function(_0x27c11f,_0x8f595d){_0x27c11f=_0x27c11f-0x0;var _0x5114d7=_0xe4ae[_0x27c11f];return _0x5114d7;};'use strict';var _=require(_0xee4a('0x0'));var util=require(_0xee4a('0x1'));var logger=require('../../config/logger')(_0xee4a('0x2'));var moment=require('moment');var BPromise=require(_0xee4a('0x3'));var rp=require(_0xee4a('0x4'));var fs=require('fs');var path=require(_0xee4a('0x5'));var rimraf=require(_0xee4a('0x6'));var config=require(_0xee4a('0x7'));var attributes=require(_0xee4a('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xd67297,_0x2b6179){return _0xd67297['define'](_0xee4a('0x9'),attributes,{'tableName':_0xee4a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf75=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0xbf75,0x84));var _0x5bf7=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xbf75[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x5bf7('0x0'));var util=require(_0x5bf7('0x1'));var logger=require(_0x5bf7('0x2'))(_0x5bf7('0x3'));var moment=require(_0x5bf7('0x4'));var BPromise=require(_0x5bf7('0x5'));var rp=require(_0x5bf7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bf7('0x7'));var config=require(_0x5bf7('0x8'));var attributes=require(_0x5bf7('0x9'));var integrations=require(_0x5bf7('0xa'));module[_0x5bf7('0xb')]=function(_0xaf394b,_0x38b0f3){return _0xaf394b[_0x5bf7('0xc')](_0x5bf7('0xd'),attributes,{'tableName':'int_vtiger_accounts','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 d55645b..7caecc3 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 _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','raw','lodash','util','moment','bluebird'];(function(_0x53594d,_0xb372ae){var _0x3b2544=function(_0x33359f){while(--_0x33359f){_0x53594d['push'](_0x53594d['shift']());}};_0x3b2544(++_0xb372ae);}(_0x1c7c,0x164));var _0xc1c7=function(_0xd54692,_0x137ace){_0xd54692=_0xd54692-0x0;var _0x38cc7e=_0x1c7c[_0xd54692];return _0x38cc7e;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')]({'raw':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options'][_0xc1c7('0x1c')]||null:null,'attributes':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options']['attributes']||null:null,'limit':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1d')]||null:null,'include':_0xb42702['options']?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0x3a2483){return{'model':db[_0x3a2483[_0xc1c7('0x20')]],'as':_0x3a2483['as'],'attributes':_0x3a2483[_0xc1c7('0x21')],'include':_0x3a2483[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x3a2483[_0xc1c7('0x1e')],function(_0x363fbc){return{'model':db[_0x363fbc[_0xc1c7('0x20')]],'as':_0x363fbc['as'],'attributes':_0x363fbc[_0xc1c7('0x21')],'include':_0x363fbc[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x363fbc['include'],function(_0xf0ab9c){return{'model':db[_0xf0ab9c[_0xc1c7('0x20')]],'as':_0xf0ab9c['as'],'attributes':_0xf0ab9c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x352f24){logger['info']('GetVtigerAccount',_0xb42702);logger[_0xc1c7('0x10')](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x352f24));_0x2e93e5(_0x352f24);})[_0xc1c7('0x17')](function(_0x461360){logger['error']('GetVtigerAccount',_0x461360[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x461360[_0xc1c7('0x14')]));});});};exports[_0xc1c7('0x22')]=function(_0x2e35f1){var _0x4968b0=this;return new Promise(function(_0x50042f,_0x125920){return db[_0xc1c7('0x19')]['find']({'raw':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x23')]===undefined?!![]:![]:!![],'where':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1c')]||null:null,'attributes':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1['options'][_0xc1c7('0x21')]||null:null,'include':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0xef703f){return{'model':db[_0xef703f[_0xc1c7('0x20')]],'as':_0xef703f['as'],'attributes':_0xef703f['attributes'],'include':_0xef703f['include']?_[_0xc1c7('0x1f')](_0xef703f[_0xc1c7('0x1e')],function(_0x263900){return{'model':db[_0x263900[_0xc1c7('0x20')]],'as':_0x263900['as'],'attributes':_0x263900[_0xc1c7('0x21')],'include':_0x263900[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x263900[_0xc1c7('0x1e')],function(_0x3bd3b0){return{'model':db[_0x3bd3b0[_0xc1c7('0x20')]],'as':_0x3bd3b0['as'],'attributes':_0x3bd3b0[_0xc1c7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1c7('0xd')](function(_0x154476){logger[_0xc1c7('0xe')](_0xc1c7('0x22'),_0x2e35f1);logger[_0xc1c7('0x10')](_0xc1c7('0x22'),_0x2e35f1,JSON[_0xc1c7('0x12')](_0x154476));_0x50042f(_0x154476);})[_0xc1c7('0x17')](function(_0x239a91){logger[_0xc1c7('0x13')]('ShowVtigerAccount',_0x239a91['message'],_0x2e35f1);_0x125920(_0x4968b0['error'](0x1f4,_0x239a91[_0xc1c7('0x14')]));});});}; \ No newline at end of file +var _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x34b297,_0xd7b0e6){var _0x569e83=function(_0x1207b8){while(--_0x1207b8){_0x34b297['push'](_0x34b297['shift']());}};_0x569e83(++_0xd7b0e6);}(_0x2547,0x1cd));var _0x7254=function(_0x1e1512,_0xb0c0bf){_0x1e1512=_0x1e1512-0x0;var _0x246df8=_0x2547[_0x1e1512];return _0x246df8;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')]({'raw':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1c')]||null:null,'limit':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1d')]||null:null,'include':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x2737e0[_0x7254('0x19')]['include'],function(_0x493bfd){return{'model':db[_0x493bfd[_0x7254('0x20')]],'as':_0x493bfd['as'],'attributes':_0x493bfd[_0x7254('0x1c')],'include':_0x493bfd[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x493bfd[_0x7254('0x1e')],function(_0x36b5d5){return{'model':db[_0x36b5d5[_0x7254('0x20')]],'as':_0x36b5d5['as'],'attributes':_0x36b5d5['attributes'],'include':_0x36b5d5[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x36b5d5[_0x7254('0x1e')],function(_0x494cdb){return{'model':db[_0x494cdb[_0x7254('0x20')]],'as':_0x494cdb['as'],'attributes':_0x494cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x7254('0x21')](function(_0x134a9e){logger['info'](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')]('GetVtigerAccount',_0x2737e0,JSON[_0x7254('0x11')](_0x134a9e));_0x1f48f6(_0x134a9e);})[_0x7254('0x15')](function(_0x37cb5c){logger[_0x7254('0x12')](_0x7254('0x16'),_0x37cb5c[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b['error'](0x1f4,_0x37cb5c[_0x7254('0x13')]));});});};exports[_0x7254('0x22')]=function(_0x5569be){var _0x2f75ea=this;return new Promise(function(_0x1279cd,_0x2be5fc){return db['VtigerAccount'][_0x7254('0x23')]({'raw':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x5569be['options']?_0x5569be[_0x7254('0x19')]['attributes']||null:null,'include':_0x5569be['options']?_0x5569be[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x5569be[_0x7254('0x19')][_0x7254('0x1e')],function(_0x430420){return{'model':db[_0x430420[_0x7254('0x20')]],'as':_0x430420['as'],'attributes':_0x430420[_0x7254('0x1c')],'include':_0x430420[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x430420[_0x7254('0x1e')],function(_0x3b0abd){return{'model':db[_0x3b0abd[_0x7254('0x20')]],'as':_0x3b0abd['as'],'attributes':_0x3b0abd[_0x7254('0x1c')],'include':_0x3b0abd['include']?_[_0x7254('0x1f')](_0x3b0abd[_0x7254('0x1e')],function(_0x2ea976){return{'model':db[_0x2ea976[_0x7254('0x20')]],'as':_0x2ea976['as'],'attributes':_0x2ea976[_0x7254('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140bb2){logger['info'](_0x7254('0x22'),_0x5569be);logger[_0x7254('0xf')](_0x7254('0x22'),_0x5569be,JSON[_0x7254('0x11')](_0x140bb2));_0x1279cd(_0x140bb2);})[_0x7254('0x15')](function(_0x4e6213){logger[_0x7254('0x12')]('ShowVtigerAccount',_0x4e6213[_0x7254('0x13')],_0x5569be);_0x2be5fc(_0x2f75ea[_0x7254('0x12')](0x1f4,_0x4e6213['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 523ad99..751822d 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 _0x9127=['/:id','getFields','/:id/subjects','getSubjects','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x1e072c,_0x5d7cd9){var _0xb3694f=function(_0x4406bb){while(--_0x4406bb){_0x1e072c['push'](_0x1e072c['shift']());}};_0xb3694f(++_0x5d7cd9);}(_0x9127,0x13e));var _0x7912=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x9127[_0x3e69ae];return _0x3d7f42;};'use strict';var multer=require(_0x7912('0x0'));var util=require(_0x7912('0x1'));var path=require(_0x7912('0x2'));var timeout=require(_0x7912('0x3'));var express=require(_0x7912('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7912('0x5'));var interaction=require(_0x7912('0x6'));var config=require(_0x7912('0x7'));var controller=require(_0x7912('0x8'));router[_0x7912('0x9')]('/',auth[_0x7912('0xa')](),controller[_0x7912('0xb')]);router[_0x7912('0x9')](_0x7912('0xc'),auth[_0x7912('0xa')](),controller['show']);router[_0x7912('0x9')]('/:id/fields',auth[_0x7912('0xa')](),controller[_0x7912('0xd')]);router[_0x7912('0x9')](_0x7912('0xe'),auth[_0x7912('0xa')](),controller[_0x7912('0xf')]);router[_0x7912('0x9')]('/:id/descriptions',auth[_0x7912('0xa')](),controller['getDescriptions']);router[_0x7912('0x10')]('/',auth['isAuthenticated'](),controller[_0x7912('0x11')]);router[_0x7912('0x12')](_0x7912('0xc'),auth['isAuthenticated'](),controller[_0x7912('0x13')]);router[_0x7912('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7912('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4c7f=['index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get'];(function(_0x1a15f9,_0x124b61){var _0x59b4d1=function(_0x250df6){while(--_0x250df6){_0x1a15f9['push'](_0x1a15f9['shift']());}};_0x59b4d1(++_0x124b61);}(_0x4c7f,0x6d));var _0xf4c7=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x4c7f[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require(_0xf4c7('0x0'));var util=require(_0xf4c7('0x1'));var path=require(_0xf4c7('0x2'));var timeout=require(_0xf4c7('0x3'));var express=require(_0xf4c7('0x4'));var router=express[_0xf4c7('0x5')]();var fs_extra=require(_0xf4c7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf4c7('0x7'));var config=require(_0xf4c7('0x8'));var controller=require(_0xf4c7('0x9'));router[_0xf4c7('0xa')]('/',auth['isAuthenticated'](),controller[_0xf4c7('0xb')]);router[_0xf4c7('0xa')](_0xf4c7('0xc'),auth[_0xf4c7('0xd')](),controller['show']);router[_0xf4c7('0xa')](_0xf4c7('0xe'),auth[_0xf4c7('0xd')](),controller['getFields']);router[_0xf4c7('0xa')](_0xf4c7('0xf'),auth[_0xf4c7('0xd')](),controller[_0xf4c7('0x10')]);router[_0xf4c7('0xa')](_0xf4c7('0x11'),auth[_0xf4c7('0xd')](),controller[_0xf4c7('0x12')]);router[_0xf4c7('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf4c7('0x14')](_0xf4c7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf4c7('0x15')](_0xf4c7('0xc'),auth[_0xf4c7('0xd')](),controller[_0xf4c7('0x16')]);module[_0xf4c7('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 5cf7449..bfc06f8 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 _0x37ba=['STRING','sequelize','exports'];(function(_0x42b030,_0x252cb6){var _0x112303=function(_0x261838){while(--_0x261838){_0x42b030['push'](_0x42b030['shift']());}};_0x112303(++_0x252cb6);}(_0x37ba,0x1db));var _0xa37b=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x37ba[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require(_0xa37b('0x0'));module[_0xa37b('0x1')]={'name':{'type':Sequelize[_0xa37b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x63bd=['sequelize','exports','STRING'];(function(_0x3efcd5,_0x4a8d63){var _0x1b3333=function(_0x29be93){while(--_0x29be93){_0x3efcd5['push'](_0x3efcd5['shift']());}};_0x1b3333(++_0x4a8d63);}(_0x63bd,0xd5));var _0xd63b=function(_0xfe877a,_0x201135){_0xfe877a=_0xfe877a-0x0;var _0x59b2c0=_0x63bd[_0xfe877a];return _0x59b2c0;};'use strict';var Sequelize=require(_0xd63b('0x0'));module[_0xd63b('0x1')]={'name':{'type':Sequelize[_0xd63b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 30e5f7b..6896531 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 _0x847d=['attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','filters','length','body','findOne','VtigerField','pick','getFields','getSubjects','getDescriptions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x1179f9,_0x7431e6){var _0x4db6b0=function(_0x3b839a){while(--_0x3b839a){_0x1179f9['push'](_0x1179f9['shift']());}};_0x4db6b0(++_0x7431e6);}(_0x847d,0x14a));var _0xd847=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x847d[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd847('0x0'));var zipdir=require(_0xd847('0x1'));var jsonpatch=require(_0xd847('0x2'));var rp=require('request-promise');var moment=require(_0xd847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x4'));var util=require(_0xd847('0x5'));var path=require('path');var sox=require(_0xd847('0x6'));var csv=require(_0xd847('0x7'));var ejs=require(_0xd847('0x8'));var fs=require('fs');var fs_extra=require(_0xd847('0x9'));var _=require('lodash');var squel=require(_0xd847('0xa'));var crypto=require(_0xd847('0xb'));var jsforce=require(_0xd847('0xc'));var deskjs=require(_0xd847('0xd'));var toCsv=require(_0xd847('0x7'));var querystring=require(_0xd847('0xe'));var Papa=require(_0xd847('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x13'));var db=require(_0xd847('0x14'))['db'];function respondWithStatusCode(_0x344d39,_0x2ea8e7){_0x2ea8e7=_0x2ea8e7||0xcc;return function(_0x1e4e26){if(_0x1e4e26){return _0x344d39[_0xd847('0x15')](_0x2ea8e7);}return _0x344d39[_0xd847('0x16')](_0x2ea8e7)[_0xd847('0x17')]();};}function respondWithResult(_0x1c827a,_0x2faa39){_0x2faa39=_0x2faa39||0xc8;return function(_0x3c4805){if(_0x3c4805){return _0x1c827a['status'](_0x2faa39)[_0xd847('0x18')](_0x3c4805);}};}function respondWithFilteredResult(_0x165fbe,_0xd69fc9){return function(_0x404bdb){if(_0x404bdb){var _0x16c79a=typeof _0xd69fc9['offset']===_0xd847('0x19')&&typeof _0xd69fc9[_0xd847('0x1a')]===_0xd847('0x19');var _0x1a01ad=_0x404bdb['count'];var _0x1ef765=_0x16c79a?0x0:_0xd69fc9['offset'];var _0x4b6264=_0x16c79a?_0x404bdb[_0xd847('0x1b')]:_0xd69fc9[_0xd847('0x1c')]+_0xd69fc9[_0xd847('0x1a')];var _0x3905b8;if(_0x4b6264>=_0x1a01ad){_0x4b6264=_0x1a01ad;_0x3905b8=0xc8;}else{_0x3905b8=0xce;}_0x165fbe['status'](_0x3905b8);return _0x165fbe[_0xd847('0x1d')]('Content-Range',_0x1ef765+'-'+_0x4b6264+'/'+_0x1a01ad)['json'](_0x404bdb);}return null;};}function patchUpdates(_0x25e139){return function(_0x2c1091){try{jsonpatch[_0xd847('0x1e')](_0x2c1091,_0x25e139,!![]);}catch(_0x2a57df){return BPromise[_0xd847('0x1f')](_0x2a57df);}return _0x2c1091[_0xd847('0x20')]();};}function saveUpdates(_0x1490a1,_0x39c465){return function(_0x1eaf08){if(_0x1eaf08){return _0x1eaf08[_0xd847('0x21')](_0x1490a1)[_0xd847('0x22')](function(_0x3795fc){return _0x3795fc;});}return null;};}function removeEntity(_0x4a1691,_0x560563){return function(_0x26a787){if(_0x26a787){return _0x26a787[_0xd847('0x23')]()[_0xd847('0x22')](function(){_0x4a1691['status'](0xcc)[_0xd847('0x17')]();});}};}function handleEntityNotFound(_0x246920,_0x74bf0e){return function(_0x64b701){if(!_0x64b701){_0x246920[_0xd847('0x15')](0x194);}return _0x64b701;};}function handleError(_0x5b8e2a,_0x24793c){_0x24793c=_0x24793c||0x1f4;return function(_0x460eba){logger[_0xd847('0x24')](_0x460eba['stack']);if(_0x460eba[_0xd847('0x25')]){delete _0x460eba[_0xd847('0x25')];}_0x5b8e2a[_0xd847('0x16')](_0x24793c)[_0xd847('0x26')](_0x460eba);};}exports[_0xd847('0x27')]=function(_0x3301cd,_0x5c0099){var _0x1e6119={},_0x5375fe={},_0x488e54={'count':0x0,'rows':[]};var _0x58889c=_[_0xd847('0x28')](db[_0xd847('0x29')][_0xd847('0x2a')],function(_0x18d162){return{'name':_0x18d162[_0xd847('0x2b')],'type':_0x18d162[_0xd847('0x2c')][_0xd847('0x2d')]};});_0x5375fe[_0xd847('0x2e')]=_[_0xd847('0x28')](_0x58889c,_0xd847('0x25'));_0x5375fe[_0xd847('0x2f')]=_[_0xd847('0x30')](_0x3301cd['query']);_0x5375fe['filters']=_[_0xd847('0x31')](_0x5375fe[_0xd847('0x2e')],_0x5375fe[_0xd847('0x2f')]);_0x1e6119[_0xd847('0x32')]=_[_0xd847('0x31')](_0x5375fe['model'],qs[_0xd847('0x33')](_0x3301cd['query'][_0xd847('0x33')]));_0x1e6119['attributes']=_0x1e6119[_0xd847('0x32')]['length']?_0x1e6119[_0xd847('0x32')]:_0x5375fe[_0xd847('0x2e')];if(!_0x3301cd['query']['hasOwnProperty'](_0xd847('0x34'))){_0x1e6119[_0xd847('0x1a')]=qs[_0xd847('0x1a')](_0x3301cd[_0xd847('0x2f')][_0xd847('0x1a')]);_0x1e6119[_0xd847('0x1c')]=qs['offset'](_0x3301cd['query'][_0xd847('0x1c')]);}_0x1e6119[_0xd847('0x35')]=qs[_0xd847('0x36')](_0x3301cd['query'][_0xd847('0x36')]);_0x1e6119[_0xd847('0x37')]=qs['filters'](_['pick'](_0x3301cd[_0xd847('0x2f')],_0x5375fe['filters']),_0x58889c);if(_0x3301cd[_0xd847('0x2f')][_0xd847('0x38')]){_0x1e6119[_0xd847('0x37')]=_['merge'](_0x1e6119['where'],{'$or':_[_0xd847('0x28')](_0x58889c,function(_0x4e6b4f){if(_0x4e6b4f['type']!==_0xd847('0x39')){var _0x5b5a61={};_0x5b5a61[_0x4e6b4f['name']]={'$like':'%'+_0x3301cd['query'][_0xd847('0x38')]+'%'};return _0x5b5a61;}})});}_0x1e6119=_[_0xd847('0x3a')]({},_0x1e6119,_0x3301cd[_0xd847('0x3b')]);var _0x173208={'where':_0x1e6119[_0xd847('0x37')]};return db[_0xd847('0x29')]['count'](_0x173208)[_0xd847('0x22')](function(_0x50c85b){_0x488e54[_0xd847('0x1b')]=_0x50c85b;if(_0x3301cd['query'][_0xd847('0x3c')]){_0x1e6119[_0xd847('0x3d')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xd847('0x3e')](_0x1e6119);})[_0xd847('0x22')](function(_0x3b551a){_0x488e54[_0xd847('0x3f')]=_0x3b551a;return _0x488e54;})[_0xd847('0x22')](respondWithFilteredResult(_0x5c0099,_0x1e6119))[_0xd847('0x40')](handleError(_0x5c0099,null));};exports['show']=function(_0xe4cd1,_0x340b96){var _0x1b962c={'raw':![],'where':{'id':_0xe4cd1[_0xd847('0x41')]['id']}},_0x4ec489={};_0x4ec489[_0xd847('0x2e')]=_['keys'](db[_0xd847('0x29')]['rawAttributes']);_0x4ec489[_0xd847('0x2f')]=_[_0xd847('0x30')](_0xe4cd1[_0xd847('0x2f')]);_0x4ec489[_0xd847('0x42')]=_['intersection'](_0x4ec489[_0xd847('0x2e')],_0x4ec489[_0xd847('0x2f')]);_0x1b962c[_0xd847('0x32')]=_['intersection'](_0x4ec489[_0xd847('0x2e')],qs[_0xd847('0x33')](_0xe4cd1[_0xd847('0x2f')]['fields']));_0x1b962c[_0xd847('0x32')]=_0x1b962c[_0xd847('0x32')][_0xd847('0x43')]?_0x1b962c[_0xd847('0x32')]:_0x4ec489['model'];if(_0xe4cd1['query']['includeAll']){_0x1b962c[_0xd847('0x3d')]=[{'all':!![]}];}_0x1b962c=_[_0xd847('0x3a')]({},_0x1b962c,_0xe4cd1[_0xd847('0x3b')]);return db[_0xd847('0x29')]['find'](_0x1b962c)[_0xd847('0x22')](handleEntityNotFound(_0x340b96,null))['then'](respondWithResult(_0x340b96,null))[_0xd847('0x40')](handleError(_0x340b96,null));};exports['create']=function(_0x54f984,_0x5c890d){return db[_0xd847('0x29')]['create'](_0x54f984[_0xd847('0x44')],{})[_0xd847('0x22')](respondWithResult(_0x5c890d,0xc9))[_0xd847('0x40')](handleError(_0x5c890d,null));};exports['update']=function(_0x2a130b,_0x465158){if(_0x2a130b[_0xd847('0x44')]['id']){delete _0x2a130b[_0xd847('0x44')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x2a130b['params']['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x465158,null))[_0xd847('0x22')](saveUpdates(_0x2a130b[_0xd847('0x44')],null))[_0xd847('0x22')](respondWithResult(_0x465158,null))[_0xd847('0x40')](handleError(_0x465158,null));};exports[_0xd847('0x23')]=function(_0x341289,_0x35d0a6){return db[_0xd847('0x29')]['find']({'where':{'id':_0x341289[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x35d0a6,null))[_0xd847('0x22')](removeEntity(_0x35d0a6,null))[_0xd847('0x40')](handleError(_0x35d0a6,null));};exports['getFields']=function(_0x432928,_0x2b3f6d,_0x461c69){var _0x15a6cf={};var _0x3e8b6f={};var _0x38be22;var _0xa3f6c2;return db[_0xd847('0x29')][_0xd847('0x45')]({'where':{'id':_0x432928[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x2b3f6d,null))[_0xd847('0x22')](function(_0x44d486){if(_0x44d486){_0x38be22=_0x44d486;_0x3e8b6f[_0xd847('0x2e')]=_[_0xd847('0x30')](db[_0xd847('0x46')]['rawAttributes']);_0x3e8b6f[_0xd847('0x2f')]=_[_0xd847('0x30')](_0x432928[_0xd847('0x2f')]);_0x3e8b6f['filters']=_[_0xd847('0x31')](_0x3e8b6f[_0xd847('0x2e')],_0x3e8b6f[_0xd847('0x2f')]);_0x15a6cf[_0xd847('0x32')]=_[_0xd847('0x31')](_0x3e8b6f[_0xd847('0x2e')],qs[_0xd847('0x33')](_0x432928['query'][_0xd847('0x33')]));_0x15a6cf['attributes']=_0x15a6cf[_0xd847('0x32')][_0xd847('0x43')]?_0x15a6cf[_0xd847('0x32')]:_0x3e8b6f[_0xd847('0x2e')];_0x15a6cf['order']=qs[_0xd847('0x36')](_0x432928[_0xd847('0x2f')][_0xd847('0x36')]);_0x15a6cf[_0xd847('0x37')]=qs[_0xd847('0x42')](_[_0xd847('0x47')](_0x432928[_0xd847('0x2f')],_0x3e8b6f[_0xd847('0x42')]));if(_0x432928[_0xd847('0x2f')][_0xd847('0x38')]){_0x15a6cf['where']=_['merge'](_0x15a6cf[_0xd847('0x37')],{'$or':_[_0xd847('0x28')](_0x15a6cf[_0xd847('0x32')],function(_0x325917){var _0x3cbea0={};_0x3cbea0[_0x325917]={'$like':'%'+_0x432928[_0xd847('0x2f')][_0xd847('0x38')]+'%'};return _0x3cbea0;})});}_0x15a6cf=_[_0xd847('0x3a')]({},_0x15a6cf,_0x432928[_0xd847('0x3b')]);return _0x38be22[_0xd847('0x48')](_0x15a6cf);}})[_0xd847('0x22')](function(_0x51d969){if(_0x51d969){_0xa3f6c2=_0x51d969[_0xd847('0x43')];if(!_0x432928['query']['hasOwnProperty'](_0xd847('0x34'))){_0x15a6cf['limit']=qs[_0xd847('0x1a')](_0x432928[_0xd847('0x2f')][_0xd847('0x1a')]);_0x15a6cf[_0xd847('0x1c')]=qs[_0xd847('0x1c')](_0x432928[_0xd847('0x2f')][_0xd847('0x1c')]);}return _0x38be22[_0xd847('0x48')](_0x15a6cf);}})['then'](function(_0xcbbe9){if(_0xcbbe9){return _0xcbbe9?{'count':_0xa3f6c2,'rows':_0xcbbe9}:null;}})[_0xd847('0x22')](respondWithResult(_0x2b3f6d,null))[_0xd847('0x40')](handleError(_0x2b3f6d,null));};exports[_0xd847('0x49')]=function(_0x5acd34,_0x3a6451,_0x58bf8e){var _0x565534={};var _0x425ee0={};var _0x4953c5;var _0x2a8611;return db[_0xd847('0x29')][_0xd847('0x45')]({'where':{'id':_0x5acd34[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x3a6451,null))[_0xd847('0x22')](function(_0x430de9){if(_0x430de9){_0x4953c5=_0x430de9;_0x425ee0[_0xd847('0x2e')]=_[_0xd847('0x30')](db[_0xd847('0x46')]['rawAttributes']);_0x425ee0[_0xd847('0x2f')]=_['keys'](_0x5acd34[_0xd847('0x2f')]);_0x425ee0[_0xd847('0x42')]=_['intersection'](_0x425ee0[_0xd847('0x2e')],_0x425ee0[_0xd847('0x2f')]);_0x565534[_0xd847('0x32')]=_[_0xd847('0x31')](_0x425ee0['model'],qs[_0xd847('0x33')](_0x5acd34[_0xd847('0x2f')][_0xd847('0x33')]));_0x565534[_0xd847('0x32')]=_0x565534[_0xd847('0x32')][_0xd847('0x43')]?_0x565534[_0xd847('0x32')]:_0x425ee0[_0xd847('0x2e')];_0x565534[_0xd847('0x35')]=qs['sort'](_0x5acd34[_0xd847('0x2f')]['sort']);_0x565534[_0xd847('0x37')]=qs[_0xd847('0x42')](_[_0xd847('0x47')](_0x5acd34['query'],_0x425ee0[_0xd847('0x42')]));if(_0x5acd34[_0xd847('0x2f')][_0xd847('0x38')]){_0x565534[_0xd847('0x37')]=_[_0xd847('0x3a')](_0x565534[_0xd847('0x37')],{'$or':_[_0xd847('0x28')](_0x565534['attributes'],function(_0x53b9ea){var _0x4c75a1={};_0x4c75a1[_0x53b9ea]={'$like':'%'+_0x5acd34['query']['filter']+'%'};return _0x4c75a1;})});}_0x565534=_['merge']({},_0x565534,_0x5acd34[_0xd847('0x3b')]);return _0x4953c5[_0xd847('0x49')](_0x565534);}})['then'](function(_0x5682f6){if(_0x5682f6){_0x2a8611=_0x5682f6[_0xd847('0x43')];if(!_0x5acd34[_0xd847('0x2f')]['hasOwnProperty'](_0xd847('0x34'))){_0x565534['limit']=qs[_0xd847('0x1a')](_0x5acd34[_0xd847('0x2f')][_0xd847('0x1a')]);_0x565534['offset']=qs[_0xd847('0x1c')](_0x5acd34[_0xd847('0x2f')][_0xd847('0x1c')]);}return _0x4953c5[_0xd847('0x49')](_0x565534);}})['then'](function(_0x7d3353){if(_0x7d3353){return _0x7d3353?{'count':_0x2a8611,'rows':_0x7d3353}:null;}})[_0xd847('0x22')](respondWithResult(_0x3a6451,null))[_0xd847('0x40')](handleError(_0x3a6451,null));};exports[_0xd847('0x4a')]=function(_0x9453df,_0x4ef86f,_0xe2bd64){var _0x4e6c84={};var _0x4d8432={};var _0x2bd1d1;var _0x1fae34;return db[_0xd847('0x29')][_0xd847('0x45')]({'where':{'id':_0x9453df['params']['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x4ef86f,null))[_0xd847('0x22')](function(_0x3bc07e){if(_0x3bc07e){_0x2bd1d1=_0x3bc07e;_0x4d8432[_0xd847('0x2e')]=_['keys'](db['VtigerField'][_0xd847('0x2a')]);_0x4d8432[_0xd847('0x2f')]=_[_0xd847('0x30')](_0x9453df[_0xd847('0x2f')]);_0x4d8432[_0xd847('0x42')]=_[_0xd847('0x31')](_0x4d8432[_0xd847('0x2e')],_0x4d8432[_0xd847('0x2f')]);_0x4e6c84[_0xd847('0x32')]=_[_0xd847('0x31')](_0x4d8432[_0xd847('0x2e')],qs[_0xd847('0x33')](_0x9453df[_0xd847('0x2f')][_0xd847('0x33')]));_0x4e6c84['attributes']=_0x4e6c84[_0xd847('0x32')][_0xd847('0x43')]?_0x4e6c84[_0xd847('0x32')]:_0x4d8432[_0xd847('0x2e')];_0x4e6c84[_0xd847('0x35')]=qs[_0xd847('0x36')](_0x9453df[_0xd847('0x2f')][_0xd847('0x36')]);_0x4e6c84[_0xd847('0x37')]=qs['filters'](_[_0xd847('0x47')](_0x9453df['query'],_0x4d8432[_0xd847('0x42')]));if(_0x9453df[_0xd847('0x2f')][_0xd847('0x38')]){_0x4e6c84['where']=_[_0xd847('0x3a')](_0x4e6c84['where'],{'$or':_['map'](_0x4e6c84[_0xd847('0x32')],function(_0x236715){var _0x49d0f7={};_0x49d0f7[_0x236715]={'$like':'%'+_0x9453df[_0xd847('0x2f')]['filter']+'%'};return _0x49d0f7;})});}_0x4e6c84=_['merge']({},_0x4e6c84,_0x9453df[_0xd847('0x3b')]);return _0x2bd1d1[_0xd847('0x4a')](_0x4e6c84);}})[_0xd847('0x22')](function(_0x308aff){if(_0x308aff){_0x1fae34=_0x308aff[_0xd847('0x43')];if(!_0x9453df[_0xd847('0x2f')][_0xd847('0x4b')]('nolimit')){_0x4e6c84[_0xd847('0x1a')]=qs[_0xd847('0x1a')](_0x9453df[_0xd847('0x2f')][_0xd847('0x1a')]);_0x4e6c84['offset']=qs[_0xd847('0x1c')](_0x9453df[_0xd847('0x2f')][_0xd847('0x1c')]);}return _0x2bd1d1[_0xd847('0x4a')](_0x4e6c84);}})['then'](function(_0x1392fb){if(_0x1392fb){return _0x1392fb?{'count':_0x1fae34,'rows':_0x1392fb}:null;}})['then'](respondWithResult(_0x4ef86f,null))['catch'](handleError(_0x4ef86f,null));}; \ No newline at end of file +var _0xf9e4=['pick','filter','merge','VIRTUAL','VtigerConfiguration','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','update','find','destroy','findOne','length','getFields','hasOwnProperty','getSubjects','VtigerField','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','nolimit','sort','where'];(function(_0x52b7d9,_0x1b4eb9){var _0x21a722=function(_0x3e5448){while(--_0x3e5448){_0x52b7d9['push'](_0x52b7d9['shift']());}};_0x21a722(++_0x1b4eb9);}(_0xf9e4,0xc5));var _0x4f9e=function(_0x771b37,_0x4b86e9){_0x771b37=_0x771b37-0x0;var _0x4f4d79=_0xf9e4[_0x771b37];return _0x4f4d79;};'use strict';var emlformat=require(_0x4f9e('0x0'));var rimraf=require(_0x4f9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f9e('0x2'));var rp=require(_0x4f9e('0x3'));var moment=require('moment');var BPromise=require(_0x4f9e('0x4'));var Mustache=require(_0x4f9e('0x5'));var util=require('util');var path=require(_0x4f9e('0x6'));var sox=require(_0x4f9e('0x7'));var csv=require(_0x4f9e('0x8'));var ejs=require(_0x4f9e('0x9'));var fs=require('fs');var fs_extra=require(_0x4f9e('0xa'));var _=require('lodash');var squel=require(_0x4f9e('0xb'));var crypto=require(_0x4f9e('0xc'));var jsforce=require(_0x4f9e('0xd'));var deskjs=require(_0x4f9e('0xe'));var toCsv=require(_0x4f9e('0x8'));var querystring=require(_0x4f9e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4f9e('0x10'));var as=require(_0x4f9e('0x11'));var hardwareService=require(_0x4f9e('0x12'));var logger=require(_0x4f9e('0x13'))(_0x4f9e('0x14'));var utils=require(_0x4f9e('0x15'));var config=require(_0x4f9e('0x16'));var licenseUtil=require(_0x4f9e('0x17'));var db=require(_0x4f9e('0x18'))['db'];function respondWithStatusCode(_0x45e4b0,_0x38b543){_0x38b543=_0x38b543||0xcc;return function(_0x1b071a){if(_0x1b071a){return _0x45e4b0[_0x4f9e('0x19')](_0x38b543);}return _0x45e4b0[_0x4f9e('0x1a')](_0x38b543)[_0x4f9e('0x1b')]();};}function respondWithResult(_0x40fce3,_0x4ac1ae){_0x4ac1ae=_0x4ac1ae||0xc8;return function(_0x29a1c3){if(_0x29a1c3){return _0x40fce3[_0x4f9e('0x1a')](_0x4ac1ae)[_0x4f9e('0x1c')](_0x29a1c3);}};}function respondWithFilteredResult(_0x27986d,_0x57b951){return function(_0x5a185d){if(_0x5a185d){var _0x5209d1=typeof _0x57b951[_0x4f9e('0x1d')]===_0x4f9e('0x1e')&&typeof _0x57b951[_0x4f9e('0x1f')]===_0x4f9e('0x1e');var _0x5ae52e=_0x5a185d[_0x4f9e('0x20')];var _0x24bed3=_0x5209d1?0x0:_0x57b951[_0x4f9e('0x1d')];var _0xb6532d=_0x5209d1?_0x5a185d[_0x4f9e('0x20')]:_0x57b951[_0x4f9e('0x1d')]+_0x57b951[_0x4f9e('0x1f')];var _0x2e3dbd;if(_0xb6532d>=_0x5ae52e){_0xb6532d=_0x5ae52e;_0x2e3dbd=0xc8;}else{_0x2e3dbd=0xce;}_0x27986d[_0x4f9e('0x1a')](_0x2e3dbd);return _0x27986d[_0x4f9e('0x21')](_0x4f9e('0x22'),_0x24bed3+'-'+_0xb6532d+'/'+_0x5ae52e)[_0x4f9e('0x1c')](_0x5a185d);}return null;};}function patchUpdates(_0x478995){return function(_0x77adc4){try{jsonpatch[_0x4f9e('0x23')](_0x77adc4,_0x478995,!![]);}catch(_0x2a8c25){return BPromise[_0x4f9e('0x24')](_0x2a8c25);}return _0x77adc4[_0x4f9e('0x25')]();};}function saveUpdates(_0x44e042,_0x5ac355){return function(_0x43ae4e){if(_0x43ae4e){return _0x43ae4e['update'](_0x44e042)[_0x4f9e('0x26')](function(_0x1b63c3){return _0x1b63c3;});}return null;};}function removeEntity(_0x41c20b,_0x10195c){return function(_0x2709d2){if(_0x2709d2){return _0x2709d2['destroy']()[_0x4f9e('0x26')](function(){_0x41c20b[_0x4f9e('0x1a')](0xcc)[_0x4f9e('0x1b')]();});}};}function handleEntityNotFound(_0x2cc783,_0x1009be){return function(_0x1d5682){if(!_0x1d5682){_0x2cc783[_0x4f9e('0x19')](0x194);}return _0x1d5682;};}function handleError(_0x267409,_0x127af3){_0x127af3=_0x127af3||0x1f4;return function(_0x42c95c){logger[_0x4f9e('0x27')](_0x42c95c[_0x4f9e('0x28')]);if(_0x42c95c[_0x4f9e('0x29')]){delete _0x42c95c[_0x4f9e('0x29')];}_0x267409[_0x4f9e('0x1a')](_0x127af3)[_0x4f9e('0x2a')](_0x42c95c);};}exports[_0x4f9e('0x2b')]=function(_0x4ad257,_0x23739f){var _0x515e62={},_0x3c1610={},_0x45b3b7={'count':0x0,'rows':[]};var _0x5b1b37=_[_0x4f9e('0x2c')](db['VtigerConfiguration'][_0x4f9e('0x2d')],function(_0x5b50fe){return{'name':_0x5b50fe[_0x4f9e('0x2e')],'type':_0x5b50fe[_0x4f9e('0x2f')][_0x4f9e('0x30')]};});_0x3c1610['model']=_[_0x4f9e('0x2c')](_0x5b1b37,_0x4f9e('0x29'));_0x3c1610['query']=_['keys'](_0x4ad257[_0x4f9e('0x31')]);_0x3c1610[_0x4f9e('0x32')]=_['intersection'](_0x3c1610[_0x4f9e('0x33')],_0x3c1610[_0x4f9e('0x31')]);_0x515e62[_0x4f9e('0x34')]=_[_0x4f9e('0x35')](_0x3c1610[_0x4f9e('0x33')],qs[_0x4f9e('0x36')](_0x4ad257[_0x4f9e('0x31')][_0x4f9e('0x36')]));_0x515e62[_0x4f9e('0x34')]=_0x515e62[_0x4f9e('0x34')]['length']?_0x515e62['attributes']:_0x3c1610[_0x4f9e('0x33')];if(!_0x4ad257[_0x4f9e('0x31')]['hasOwnProperty'](_0x4f9e('0x37'))){_0x515e62[_0x4f9e('0x1f')]=qs['limit'](_0x4ad257['query']['limit']);_0x515e62[_0x4f9e('0x1d')]=qs[_0x4f9e('0x1d')](_0x4ad257['query'][_0x4f9e('0x1d')]);}_0x515e62['order']=qs['sort'](_0x4ad257[_0x4f9e('0x31')][_0x4f9e('0x38')]);_0x515e62[_0x4f9e('0x39')]=qs[_0x4f9e('0x32')](_[_0x4f9e('0x3a')](_0x4ad257[_0x4f9e('0x31')],_0x3c1610[_0x4f9e('0x32')]),_0x5b1b37);if(_0x4ad257[_0x4f9e('0x31')][_0x4f9e('0x3b')]){_0x515e62[_0x4f9e('0x39')]=_[_0x4f9e('0x3c')](_0x515e62['where'],{'$or':_[_0x4f9e('0x2c')](_0x5b1b37,function(_0x32925b){if(_0x32925b[_0x4f9e('0x2f')]!==_0x4f9e('0x3d')){var _0x474d4b={};_0x474d4b[_0x32925b['name']]={'$like':'%'+_0x4ad257['query']['filter']+'%'};return _0x474d4b;}})});}_0x515e62=_[_0x4f9e('0x3c')]({},_0x515e62,_0x4ad257['options']);var _0x291b90={'where':_0x515e62[_0x4f9e('0x39')]};return db[_0x4f9e('0x3e')][_0x4f9e('0x20')](_0x291b90)[_0x4f9e('0x26')](function(_0x2c1f23){_0x45b3b7[_0x4f9e('0x20')]=_0x2c1f23;if(_0x4ad257[_0x4f9e('0x31')][_0x4f9e('0x3f')]){_0x515e62[_0x4f9e('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x4f9e('0x41')](_0x515e62);})[_0x4f9e('0x26')](function(_0x3e1d54){_0x45b3b7[_0x4f9e('0x42')]=_0x3e1d54;return _0x45b3b7;})[_0x4f9e('0x26')](respondWithFilteredResult(_0x23739f,_0x515e62))['catch'](handleError(_0x23739f,null));};exports[_0x4f9e('0x43')]=function(_0x74900,_0x28ae3c){var _0x5a7d37={'raw':![],'where':{'id':_0x74900[_0x4f9e('0x44')]['id']}},_0xb4def7={};_0xb4def7[_0x4f9e('0x33')]=_[_0x4f9e('0x45')](db[_0x4f9e('0x3e')][_0x4f9e('0x2d')]);_0xb4def7['query']=_['keys'](_0x74900[_0x4f9e('0x31')]);_0xb4def7[_0x4f9e('0x32')]=_['intersection'](_0xb4def7[_0x4f9e('0x33')],_0xb4def7[_0x4f9e('0x31')]);_0x5a7d37['attributes']=_[_0x4f9e('0x35')](_0xb4def7['model'],qs[_0x4f9e('0x36')](_0x74900[_0x4f9e('0x31')][_0x4f9e('0x36')]));_0x5a7d37[_0x4f9e('0x34')]=_0x5a7d37[_0x4f9e('0x34')]['length']?_0x5a7d37[_0x4f9e('0x34')]:_0xb4def7['model'];if(_0x74900[_0x4f9e('0x31')][_0x4f9e('0x3f')]){_0x5a7d37[_0x4f9e('0x40')]=[{'all':!![]}];}_0x5a7d37=_['merge']({},_0x5a7d37,_0x74900[_0x4f9e('0x46')]);return db[_0x4f9e('0x3e')]['find'](_0x5a7d37)[_0x4f9e('0x26')](handleEntityNotFound(_0x28ae3c,null))['then'](respondWithResult(_0x28ae3c,null))[_0x4f9e('0x47')](handleError(_0x28ae3c,null));};exports[_0x4f9e('0x48')]=function(_0x588e6a,_0x3d9f07){return db['VtigerConfiguration'][_0x4f9e('0x48')](_0x588e6a[_0x4f9e('0x49')],{})[_0x4f9e('0x26')](respondWithResult(_0x3d9f07,0xc9))[_0x4f9e('0x47')](handleError(_0x3d9f07,null));};exports[_0x4f9e('0x4a')]=function(_0x155b14,_0x2294bc){if(_0x155b14[_0x4f9e('0x49')]['id']){delete _0x155b14[_0x4f9e('0x49')]['id'];}return db[_0x4f9e('0x3e')][_0x4f9e('0x4b')]({'where':{'id':_0x155b14[_0x4f9e('0x44')]['id']}})[_0x4f9e('0x26')](handleEntityNotFound(_0x2294bc,null))[_0x4f9e('0x26')](saveUpdates(_0x155b14[_0x4f9e('0x49')],null))['then'](respondWithResult(_0x2294bc,null))[_0x4f9e('0x47')](handleError(_0x2294bc,null));};exports[_0x4f9e('0x4c')]=function(_0x4abad5,_0x25853b){return db[_0x4f9e('0x3e')][_0x4f9e('0x4b')]({'where':{'id':_0x4abad5[_0x4f9e('0x44')]['id']}})[_0x4f9e('0x26')](handleEntityNotFound(_0x25853b,null))[_0x4f9e('0x26')](removeEntity(_0x25853b,null))['catch'](handleError(_0x25853b,null));};exports['getFields']=function(_0x26cc35,_0x81e7f,_0x506929){var _0x15945b={};var _0x5d24c7={};var _0x382f31;var _0x28e758;return db[_0x4f9e('0x3e')][_0x4f9e('0x4d')]({'where':{'id':_0x26cc35[_0x4f9e('0x44')]['id']}})[_0x4f9e('0x26')](handleEntityNotFound(_0x81e7f,null))[_0x4f9e('0x26')](function(_0x2a93a0){if(_0x2a93a0){_0x382f31=_0x2a93a0;_0x5d24c7['model']=_[_0x4f9e('0x45')](db['VtigerField']['rawAttributes']);_0x5d24c7['query']=_[_0x4f9e('0x45')](_0x26cc35[_0x4f9e('0x31')]);_0x5d24c7[_0x4f9e('0x32')]=_['intersection'](_0x5d24c7[_0x4f9e('0x33')],_0x5d24c7[_0x4f9e('0x31')]);_0x15945b[_0x4f9e('0x34')]=_[_0x4f9e('0x35')](_0x5d24c7[_0x4f9e('0x33')],qs[_0x4f9e('0x36')](_0x26cc35[_0x4f9e('0x31')][_0x4f9e('0x36')]));_0x15945b[_0x4f9e('0x34')]=_0x15945b[_0x4f9e('0x34')][_0x4f9e('0x4e')]?_0x15945b['attributes']:_0x5d24c7['model'];_0x15945b['order']=qs[_0x4f9e('0x38')](_0x26cc35[_0x4f9e('0x31')]['sort']);_0x15945b[_0x4f9e('0x39')]=qs[_0x4f9e('0x32')](_[_0x4f9e('0x3a')](_0x26cc35['query'],_0x5d24c7[_0x4f9e('0x32')]));if(_0x26cc35['query'][_0x4f9e('0x3b')]){_0x15945b[_0x4f9e('0x39')]=_[_0x4f9e('0x3c')](_0x15945b[_0x4f9e('0x39')],{'$or':_[_0x4f9e('0x2c')](_0x15945b[_0x4f9e('0x34')],function(_0x221031){var _0x33a15f={};_0x33a15f[_0x221031]={'$like':'%'+_0x26cc35['query'][_0x4f9e('0x3b')]+'%'};return _0x33a15f;})});}_0x15945b=_[_0x4f9e('0x3c')]({},_0x15945b,_0x26cc35[_0x4f9e('0x46')]);return _0x382f31[_0x4f9e('0x4f')](_0x15945b);}})[_0x4f9e('0x26')](function(_0x1478d3){if(_0x1478d3){_0x28e758=_0x1478d3[_0x4f9e('0x4e')];if(!_0x26cc35[_0x4f9e('0x31')][_0x4f9e('0x50')]('nolimit')){_0x15945b['limit']=qs[_0x4f9e('0x1f')](_0x26cc35['query'][_0x4f9e('0x1f')]);_0x15945b[_0x4f9e('0x1d')]=qs[_0x4f9e('0x1d')](_0x26cc35[_0x4f9e('0x31')][_0x4f9e('0x1d')]);}return _0x382f31[_0x4f9e('0x4f')](_0x15945b);}})[_0x4f9e('0x26')](function(_0x3dc2b5){if(_0x3dc2b5){return _0x3dc2b5?{'count':_0x28e758,'rows':_0x3dc2b5}:null;}})[_0x4f9e('0x26')](respondWithResult(_0x81e7f,null))[_0x4f9e('0x47')](handleError(_0x81e7f,null));};exports[_0x4f9e('0x51')]=function(_0x418647,_0x3b64d7,_0x3ee75e){var _0xcda29a={};var _0x325870={};var _0x280bc9;var _0x1c073e;return db['VtigerConfiguration'][_0x4f9e('0x4d')]({'where':{'id':_0x418647['params']['id']}})[_0x4f9e('0x26')](handleEntityNotFound(_0x3b64d7,null))[_0x4f9e('0x26')](function(_0x3cd76d){if(_0x3cd76d){_0x280bc9=_0x3cd76d;_0x325870[_0x4f9e('0x33')]=_[_0x4f9e('0x45')](db[_0x4f9e('0x52')][_0x4f9e('0x2d')]);_0x325870[_0x4f9e('0x31')]=_[_0x4f9e('0x45')](_0x418647[_0x4f9e('0x31')]);_0x325870[_0x4f9e('0x32')]=_[_0x4f9e('0x35')](_0x325870[_0x4f9e('0x33')],_0x325870[_0x4f9e('0x31')]);_0xcda29a[_0x4f9e('0x34')]=_[_0x4f9e('0x35')](_0x325870[_0x4f9e('0x33')],qs[_0x4f9e('0x36')](_0x418647['query'][_0x4f9e('0x36')]));_0xcda29a[_0x4f9e('0x34')]=_0xcda29a[_0x4f9e('0x34')][_0x4f9e('0x4e')]?_0xcda29a[_0x4f9e('0x34')]:_0x325870['model'];_0xcda29a[_0x4f9e('0x53')]=qs['sort'](_0x418647[_0x4f9e('0x31')][_0x4f9e('0x38')]);_0xcda29a[_0x4f9e('0x39')]=qs[_0x4f9e('0x32')](_[_0x4f9e('0x3a')](_0x418647[_0x4f9e('0x31')],_0x325870[_0x4f9e('0x32')]));if(_0x418647[_0x4f9e('0x31')]['filter']){_0xcda29a[_0x4f9e('0x39')]=_[_0x4f9e('0x3c')](_0xcda29a['where'],{'$or':_['map'](_0xcda29a[_0x4f9e('0x34')],function(_0x49d0c8){var _0xcb723f={};_0xcb723f[_0x49d0c8]={'$like':'%'+_0x418647[_0x4f9e('0x31')][_0x4f9e('0x3b')]+'%'};return _0xcb723f;})});}_0xcda29a=_[_0x4f9e('0x3c')]({},_0xcda29a,_0x418647['options']);return _0x280bc9[_0x4f9e('0x51')](_0xcda29a);}})[_0x4f9e('0x26')](function(_0x16e711){if(_0x16e711){_0x1c073e=_0x16e711[_0x4f9e('0x4e')];if(!_0x418647['query']['hasOwnProperty'](_0x4f9e('0x37'))){_0xcda29a[_0x4f9e('0x1f')]=qs[_0x4f9e('0x1f')](_0x418647[_0x4f9e('0x31')][_0x4f9e('0x1f')]);_0xcda29a[_0x4f9e('0x1d')]=qs[_0x4f9e('0x1d')](_0x418647[_0x4f9e('0x31')][_0x4f9e('0x1d')]);}return _0x280bc9[_0x4f9e('0x51')](_0xcda29a);}})[_0x4f9e('0x26')](function(_0x32245d){if(_0x32245d){return _0x32245d?{'count':_0x1c073e,'rows':_0x32245d}:null;}})['then'](respondWithResult(_0x3b64d7,null))['catch'](handleError(_0x3b64d7,null));};exports[_0x4f9e('0x54')]=function(_0x392740,_0x52d8c4,_0x46048a){var _0x20361b={};var _0x58dffd={};var _0x3ba245;var _0x2a7dfd;return db[_0x4f9e('0x3e')][_0x4f9e('0x4d')]({'where':{'id':_0x392740[_0x4f9e('0x44')]['id']}})[_0x4f9e('0x26')](handleEntityNotFound(_0x52d8c4,null))[_0x4f9e('0x26')](function(_0x3f6211){if(_0x3f6211){_0x3ba245=_0x3f6211;_0x58dffd[_0x4f9e('0x33')]=_[_0x4f9e('0x45')](db[_0x4f9e('0x52')][_0x4f9e('0x2d')]);_0x58dffd[_0x4f9e('0x31')]=_['keys'](_0x392740[_0x4f9e('0x31')]);_0x58dffd[_0x4f9e('0x32')]=_[_0x4f9e('0x35')](_0x58dffd[_0x4f9e('0x33')],_0x58dffd[_0x4f9e('0x31')]);_0x20361b[_0x4f9e('0x34')]=_['intersection'](_0x58dffd['model'],qs[_0x4f9e('0x36')](_0x392740[_0x4f9e('0x31')][_0x4f9e('0x36')]));_0x20361b[_0x4f9e('0x34')]=_0x20361b[_0x4f9e('0x34')][_0x4f9e('0x4e')]?_0x20361b[_0x4f9e('0x34')]:_0x58dffd['model'];_0x20361b['order']=qs[_0x4f9e('0x38')](_0x392740['query'][_0x4f9e('0x38')]);_0x20361b[_0x4f9e('0x39')]=qs[_0x4f9e('0x32')](_[_0x4f9e('0x3a')](_0x392740[_0x4f9e('0x31')],_0x58dffd[_0x4f9e('0x32')]));if(_0x392740[_0x4f9e('0x31')][_0x4f9e('0x3b')]){_0x20361b[_0x4f9e('0x39')]=_[_0x4f9e('0x3c')](_0x20361b[_0x4f9e('0x39')],{'$or':_[_0x4f9e('0x2c')](_0x20361b[_0x4f9e('0x34')],function(_0x5bdfe6){var _0xb58b7f={};_0xb58b7f[_0x5bdfe6]={'$like':'%'+_0x392740[_0x4f9e('0x31')][_0x4f9e('0x3b')]+'%'};return _0xb58b7f;})});}_0x20361b=_[_0x4f9e('0x3c')]({},_0x20361b,_0x392740[_0x4f9e('0x46')]);return _0x3ba245[_0x4f9e('0x54')](_0x20361b);}})[_0x4f9e('0x26')](function(_0x1713a4){if(_0x1713a4){_0x2a7dfd=_0x1713a4[_0x4f9e('0x4e')];if(!_0x392740[_0x4f9e('0x31')][_0x4f9e('0x50')]('nolimit')){_0x20361b[_0x4f9e('0x1f')]=qs[_0x4f9e('0x1f')](_0x392740[_0x4f9e('0x31')][_0x4f9e('0x1f')]);_0x20361b[_0x4f9e('0x1d')]=qs['offset'](_0x392740[_0x4f9e('0x31')][_0x4f9e('0x1d')]);}return _0x3ba245[_0x4f9e('0x54')](_0x20361b);}})[_0x4f9e('0x26')](function(_0x15abb6){if(_0x15abb6){return _0x15abb6?{'count':_0x2a7dfd,'rows':_0x15abb6}:null;}})['then'](respondWithResult(_0x52d8c4,null))['catch'](handleError(_0x52d8c4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index ab4637f..a225c0b 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 _0xbcfe=['exports','define','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x1fb26f,_0x444784){var _0x2f8f2b=function(_0x3f17c8){while(--_0x3f17c8){_0x1fb26f['push'](_0x1fb26f['shift']());}};_0x2f8f2b(++_0x444784);}(_0xbcfe,0xbd));var _0xebcf=function(_0x55b557,_0x5bfe27){_0x55b557=_0x55b557-0x0;var _0x58dc81=_0xbcfe[_0x55b557];return _0x58dc81;};'use strict';var _=require(_0xebcf('0x0'));var util=require(_0xebcf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xebcf('0x2'));var BPromise=require(_0xebcf('0x3'));var rp=require(_0xebcf('0x4'));var fs=require('fs');var path=require(_0xebcf('0x5'));var rimraf=require(_0xebcf('0x6'));var config=require(_0xebcf('0x7'));var attributes=require(_0xebcf('0x8'));module[_0xebcf('0x9')]=function(_0x8aedf1,_0x2dc389){return _0x8aedf1[_0xebcf('0xa')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68df=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','api'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x68df,0xa6));var _0xf68d=function(_0x43a74a,_0x846237){_0x43a74a=_0x43a74a-0x0;var _0x35744a=_0x68df[_0x43a74a];return _0x35744a;};'use strict';var _=require(_0xf68d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf68d('0x1'));var moment=require(_0xf68d('0x2'));var BPromise=require(_0xf68d('0x3'));var rp=require(_0xf68d('0x4'));var fs=require('fs');var path=require(_0xf68d('0x5'));var rimraf=require(_0xf68d('0x6'));var config=require(_0xf68d('0x7'));var attributes=require(_0xf68d('0x8'));module['exports']=function(_0x4b9281,_0x133aed){return _0x4b9281[_0xf68d('0x9')](_0xf68d('0xa'),attributes,{'tableName':_0xf68d('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 96a1514..a4d988c 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 _0xf52e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x2fffff,_0x415518){var _0x4f2a2c=function(_0x32c77b){while(--_0x32c77b){_0x2fffff['push'](_0x2fffff['shift']());}};_0x4f2a2c(++_0x415518);}(_0xf52e,0xe1));var _0xef52=function(_0x2a6d16,_0x5f165){_0x2a6d16=_0x2a6d16-0x0;var _0x59bfe0=_0xf52e[_0x2a6d16];return _0x59bfe0;};'use strict';var _=require(_0xef52('0x0'));var util=require(_0xef52('0x1'));var moment=require(_0xef52('0x2'));var BPromise=require(_0xef52('0x3'));var rs=require(_0xef52('0x4'));var fs=require('fs');var Redis=require(_0xef52('0x5'));var db=require(_0xef52('0x6'))['db'];var utils=require(_0xef52('0x7'));var logger=require(_0xef52('0x8'))(_0xef52('0x9'));var config=require(_0xef52('0xa'));var jayson=require(_0xef52('0xb'));var client=jayson[_0xef52('0xc')][_0xef52('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x43ecc3,_0x321935,_0x2e9977){return new BPromise(function(_0x1e5ba1,_0x5434e1){return client[_0xef52('0xe')](_0x43ecc3,_0x2e9977)[_0xef52('0xf')](function(_0x193c64){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x321935,_0xef52('0x10'));logger[_0xef52('0x11')](_0xef52('0x12'),_0x321935,_0xef52('0x10'),JSON['stringify'](_0x193c64));if(_0x193c64[_0xef52('0x13')]){if(_0x193c64[_0xef52('0x13')][_0xef52('0x14')]===0x1f4){logger[_0xef52('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x321935,_0x193c64[_0xef52('0x13')]['message']);return _0x5434e1(_0x193c64['error']['message']);}logger[_0xef52('0x13')](_0xef52('0x15'),_0x321935,_0x193c64[_0xef52('0x13')]['message']);return _0x1e5ba1(_0x193c64[_0xef52('0x13')][_0xef52('0x16')]);}else{logger['info'](_0xef52('0x15'),_0x321935,_0xef52('0x10'));_0x1e5ba1(_0x193c64[_0xef52('0x17')][_0xef52('0x16')]);}})[_0xef52('0x18')](function(_0xb9b68b){logger[_0xef52('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x321935,_0xb9b68b);_0x5434e1(_0xb9b68b);});});} \ No newline at end of file +var _0x650f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x410ea5,_0x429d56){var _0x1d3573=function(_0x2b2eba){while(--_0x2b2eba){_0x410ea5['push'](_0x410ea5['shift']());}};_0x1d3573(++_0x429d56);}(_0x650f,0x103));var _0xf650=function(_0x4c1a70,_0x4c4c19){_0x4c1a70=_0x4c1a70-0x0;var _0x4802de=_0x650f[_0x4c1a70];return _0x4802de;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf650('0x0'));var BPromise=require(_0xf650('0x1'));var rs=require(_0xf650('0x2'));var fs=require('fs');var Redis=require(_0xf650('0x3'));var db=require(_0xf650('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf650('0x5'));var jayson=require(_0xf650('0x6'));var client=jayson[_0xf650('0x7')][_0xf650('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2fc7,_0x18be20,_0x3503b0){return new BPromise(function(_0x10a25c,_0x57d101){return client[_0xf650('0x9')](_0x4d2fc7,_0x3503b0)[_0xf650('0xa')](function(_0x5995fa){logger[_0xf650('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x18be20,_0xf650('0xc'));logger[_0xf650('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x18be20,'request\x20sent',JSON[_0xf650('0xe')](_0x5995fa));if(_0x5995fa[_0xf650('0xf')]){if(_0x5995fa['error']['code']===0x1f4){logger[_0xf650('0xf')](_0xf650('0x10'),_0x18be20,_0x5995fa[_0xf650('0xf')]['message']);return _0x57d101(_0x5995fa[_0xf650('0xf')][_0xf650('0x11')]);}logger[_0xf650('0xf')](_0xf650('0x10'),_0x18be20,_0x5995fa['error']['message']);return _0x10a25c(_0x5995fa['error'][_0xf650('0x11')]);}else{logger['info'](_0xf650('0x10'),_0x18be20,_0xf650('0xc'));_0x10a25c(_0x5995fa[_0xf650('0x12')]['message']);}})[_0xf650('0x13')](function(_0x456d2c){logger[_0xf650('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x18be20,_0x456d2c);_0x57d101(_0x456d2c);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index e92dec5..d1f14c3 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 _0x56a5=['isAuthenticated','post','put','/:id','delete','exports','util','express','Router','../../components/interaction/service','./intVtigerField.controller','index','get'];(function(_0x461f02,_0x183c6f){var _0x162d54=function(_0x210004){while(--_0x210004){_0x461f02['push'](_0x461f02['shift']());}};_0x162d54(++_0x183c6f);}(_0x56a5,0x95));var _0x556a=function(_0x58e61f,_0xbc1991){_0x58e61f=_0x58e61f-0x0;var _0x4ff4d5=_0x56a5[_0x58e61f];return _0x4ff4d5;};'use strict';var multer=require('multer');var util=require(_0x556a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x556a('0x1'));var router=express[_0x556a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x556a('0x3'));var config=require('../../config/environment');var controller=require(_0x556a('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x556a('0x5')]);router[_0x556a('0x6')]('/:id',auth[_0x556a('0x7')](),controller['show']);router[_0x556a('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x556a('0x9')](_0x556a('0xa'),auth[_0x556a('0x7')](),controller['update']);router[_0x556a('0xb')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x556a('0xc')]=router; \ No newline at end of file +var _0x65b2=['isAuthenticated','index','post','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x65b2,0xbc));var _0x265b=function(_0x11a0b0,_0x13077c){_0x11a0b0=_0x11a0b0-0x0;var _0x1382e6=_0x65b2[_0x11a0b0];return _0x1382e6;};'use strict';var multer=require('multer');var util=require(_0x265b('0x0'));var path=require(_0x265b('0x1'));var timeout=require(_0x265b('0x2'));var express=require(_0x265b('0x3'));var router=express[_0x265b('0x4')]();var fs_extra=require(_0x265b('0x5'));var auth=require(_0x265b('0x6'));var interaction=require(_0x265b('0x7'));var config=require('../../config/environment');var controller=require(_0x265b('0x8'));router[_0x265b('0x9')]('/',auth[_0x265b('0xa')](),controller[_0x265b('0xb')]);router['get']('/:id',auth[_0x265b('0xa')](),controller['show']);router[_0x265b('0xc')]('/',auth[_0x265b('0xa')](),controller['create']);router[_0x265b('0xd')](_0x265b('0xe'),auth[_0x265b('0xa')](),controller[_0x265b('0xf')]);router[_0x265b('0x10')](_0x265b('0xe'),auth[_0x265b('0xa')](),controller[_0x265b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b940a87..3a26269 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 _0xfd62=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x4427de,_0x33ad9e){var _0x22f57a=function(_0x48e49c){while(--_0x48e49c){_0x4427de['push'](_0x4427de['shift']());}};_0x22f57a(++_0x33ad9e);}(_0xfd62,0x106));var _0x2fd6=function(_0x16112b,_0x7dbbd4){_0x16112b=_0x16112b-0x0;var _0x3ec74d=_0xfd62[_0x16112b];return _0x3ec74d;};'use strict';var Sequelize=require(_0x2fd6('0x0'));module['exports']={'type':{'type':Sequelize[_0x2fd6('0x1')]('string',_0x2fd6('0x2'),_0x2fd6('0x3'),_0x2fd6('0x4'),_0x2fd6('0x5')),'defaultValue':_0x2fd6('0x6')},'content':{'type':Sequelize[_0x2fd6('0x7')]},'key':{'type':Sequelize[_0x2fd6('0x7')]},'keyType':{'type':Sequelize[_0x2fd6('0x1')](_0x2fd6('0x6'),_0x2fd6('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x2fd6('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2fd6('0x7')]},'customField':{'type':Sequelize[_0x2fd6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fd6('0x7')]}}; \ No newline at end of file +var _0xc5af=['picklist','STRING','ENUM','string','customVariable','keyValue'];(function(_0x51f260,_0x3e2be4){var _0xf4f20f=function(_0x1d7b86){while(--_0x1d7b86){_0x51f260['push'](_0x51f260['shift']());}};_0xf4f20f(++_0x3e2be4);}(_0xc5af,0x13a));var _0xfc5a=function(_0x587e4d,_0x13cbde){_0x587e4d=_0x587e4d-0x0;var _0x5b833d=_0xc5af[_0x587e4d];return _0x5b833d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfc5a('0x0')](_0xfc5a('0x1'),'variable',_0xfc5a('0x2'),_0xfc5a('0x3'),_0xfc5a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfc5a('0x5')]},'key':{'type':Sequelize[_0xfc5a('0x5')]},'keyType':{'type':Sequelize[_0xfc5a('0x0')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xfc5a('0x5')]},'idField':{'type':Sequelize[_0xfc5a('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index cc871e5..ace82b2 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 _0x3a8b=['key','map','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','VtigerField','fieldName','type'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3a8b,0x190));var _0xb3a8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x3a8b[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0xb3a8('0x0'));var rimraf=require(_0xb3a8('0x1'));var zipdir=require(_0xb3a8('0x2'));var jsonpatch=require(_0xb3a8('0x3'));var rp=require(_0xb3a8('0x4'));var moment=require(_0xb3a8('0x5'));var BPromise=require(_0xb3a8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb3a8('0x7'));var csv=require('to-csv');var ejs=require(_0xb3a8('0x8'));var fs=require('fs');var fs_extra=require(_0xb3a8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb3a8('0xa'));var deskjs=require(_0xb3a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb3a8('0xc'));var Papa=require(_0xb3a8('0xd'));var Redis=require(_0xb3a8('0xe'));var authService=require(_0xb3a8('0xf'));var qs=require(_0xb3a8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb3a8('0x11'));var config=require(_0xb3a8('0x12'));var licenseUtil=require(_0xb3a8('0x13'));var db=require(_0xb3a8('0x14'))['db'];function respondWithStatusCode(_0x3b42c3,_0x328666){_0x328666=_0x328666||0xcc;return function(_0x115f2c){if(_0x115f2c){return _0x3b42c3[_0xb3a8('0x15')](_0x328666);}return _0x3b42c3[_0xb3a8('0x16')](_0x328666)[_0xb3a8('0x17')]();};}function respondWithResult(_0x1a1336,_0x3cb28d){_0x3cb28d=_0x3cb28d||0xc8;return function(_0x372040){if(_0x372040){return _0x1a1336['status'](_0x3cb28d)['json'](_0x372040);}};}function respondWithFilteredResult(_0x104f62,_0xdf6090){return function(_0x28c71d){if(_0x28c71d){var _0x6cdc97=typeof _0xdf6090[_0xb3a8('0x18')]===_0xb3a8('0x19')&&typeof _0xdf6090['limit']===_0xb3a8('0x19');var _0x5976c8=_0x28c71d['count'];var _0x442e37=_0x6cdc97?0x0:_0xdf6090[_0xb3a8('0x18')];var _0x3906a1=_0x6cdc97?_0x28c71d[_0xb3a8('0x1a')]:_0xdf6090[_0xb3a8('0x18')]+_0xdf6090[_0xb3a8('0x1b')];var _0x3307ac;if(_0x3906a1>=_0x5976c8){_0x3906a1=_0x5976c8;_0x3307ac=0xc8;}else{_0x3307ac=0xce;}_0x104f62[_0xb3a8('0x16')](_0x3307ac);return _0x104f62[_0xb3a8('0x1c')](_0xb3a8('0x1d'),_0x442e37+'-'+_0x3906a1+'/'+_0x5976c8)[_0xb3a8('0x1e')](_0x28c71d);}return null;};}function patchUpdates(_0x4d858b){return function(_0xba3007){try{jsonpatch[_0xb3a8('0x1f')](_0xba3007,_0x4d858b,!![]);}catch(_0x24dad3){return BPromise[_0xb3a8('0x20')](_0x24dad3);}return _0xba3007[_0xb3a8('0x21')]();};}function saveUpdates(_0x4da637,_0x1cb542){return function(_0x5a97cd){if(_0x5a97cd){return _0x5a97cd[_0xb3a8('0x22')](_0x4da637)['then'](function(_0x21d31b){return _0x21d31b;});}return null;};}function removeEntity(_0x5658a4,_0x11837c){return function(_0x5f5d83){if(_0x5f5d83){return _0x5f5d83['destroy']()[_0xb3a8('0x23')](function(){_0x5658a4['status'](0xcc)[_0xb3a8('0x17')]();});}};}function handleEntityNotFound(_0x41a41d,_0x3378d6){return function(_0x1d2f25){if(!_0x1d2f25){_0x41a41d[_0xb3a8('0x15')](0x194);}return _0x1d2f25;};}function handleError(_0x162b7d,_0x28f527){_0x28f527=_0x28f527||0x1f4;return function(_0xde80a8){logger[_0xb3a8('0x24')](_0xde80a8[_0xb3a8('0x25')]);if(_0xde80a8['name']){delete _0xde80a8[_0xb3a8('0x26')];}_0x162b7d['status'](_0x28f527)[_0xb3a8('0x27')](_0xde80a8);};}exports[_0xb3a8('0x28')]=function(_0x5b4f9f,_0x4e45c6){var _0x175564={},_0x3f092c={},_0xb36178={'count':0x0,'rows':[]};var _0x3e6e75=_['map'](db[_0xb3a8('0x29')]['rawAttributes'],function(_0x3ff7fe){return{'name':_0x3ff7fe[_0xb3a8('0x2a')],'type':_0x3ff7fe[_0xb3a8('0x2b')][_0xb3a8('0x2c')]};});_0x3f092c['model']=_[_0xb3a8('0x2d')](_0x3e6e75,_0xb3a8('0x26'));_0x3f092c['query']=_[_0xb3a8('0x2e')](_0x5b4f9f[_0xb3a8('0x2f')]);_0x3f092c[_0xb3a8('0x30')]=_['intersection'](_0x3f092c[_0xb3a8('0x31')],_0x3f092c['query']);_0x175564[_0xb3a8('0x32')]=_[_0xb3a8('0x33')](_0x3f092c[_0xb3a8('0x31')],qs[_0xb3a8('0x34')](_0x5b4f9f[_0xb3a8('0x2f')][_0xb3a8('0x34')]));_0x175564['attributes']=_0x175564[_0xb3a8('0x32')]['length']?_0x175564['attributes']:_0x3f092c[_0xb3a8('0x31')];if(!_0x5b4f9f['query'][_0xb3a8('0x35')](_0xb3a8('0x36'))){_0x175564[_0xb3a8('0x1b')]=qs['limit'](_0x5b4f9f[_0xb3a8('0x2f')][_0xb3a8('0x1b')]);_0x175564[_0xb3a8('0x18')]=qs[_0xb3a8('0x18')](_0x5b4f9f[_0xb3a8('0x2f')][_0xb3a8('0x18')]);}_0x175564[_0xb3a8('0x37')]=qs[_0xb3a8('0x38')](_0x5b4f9f[_0xb3a8('0x2f')][_0xb3a8('0x38')]);_0x175564[_0xb3a8('0x39')]=qs[_0xb3a8('0x30')](_['pick'](_0x5b4f9f['query'],_0x3f092c[_0xb3a8('0x30')]),_0x3e6e75);if(_0x5b4f9f[_0xb3a8('0x2f')][_0xb3a8('0x3a')]){_0x175564[_0xb3a8('0x39')]=_[_0xb3a8('0x3b')](_0x175564[_0xb3a8('0x39')],{'$or':_['map'](_0x3e6e75,function(_0xc620f1){if(_0xc620f1[_0xb3a8('0x2b')]!==_0xb3a8('0x3c')){var _0x5774ac={};_0x5774ac[_0xc620f1[_0xb3a8('0x26')]]={'$like':'%'+_0x5b4f9f[_0xb3a8('0x2f')][_0xb3a8('0x3a')]+'%'};return _0x5774ac;}})});}_0x175564=_['merge']({},_0x175564,_0x5b4f9f['options']);var _0x5098c6={'where':_0x175564[_0xb3a8('0x39')]};return db[_0xb3a8('0x29')]['count'](_0x5098c6)[_0xb3a8('0x23')](function(_0x13183a){_0xb36178['count']=_0x13183a;if(_0x5b4f9f['query'][_0xb3a8('0x3d')]){_0x175564[_0xb3a8('0x3e')]=[{'all':!![]}];}return db[_0xb3a8('0x29')][_0xb3a8('0x3f')](_0x175564);})['then'](function(_0x6d3691){_0xb36178[_0xb3a8('0x40')]=_0x6d3691;return _0xb36178;})['then'](respondWithFilteredResult(_0x4e45c6,_0x175564))[_0xb3a8('0x41')](handleError(_0x4e45c6,null));};exports[_0xb3a8('0x42')]=function(_0x2aec8c,_0x308ec4){var _0x40dffb={'raw':!![],'where':{'id':_0x2aec8c['params']['id']}},_0x2763f3={};_0x2763f3[_0xb3a8('0x31')]=_[_0xb3a8('0x2e')](db[_0xb3a8('0x29')][_0xb3a8('0x43')]);_0x2763f3[_0xb3a8('0x2f')]=_['keys'](_0x2aec8c['query']);_0x2763f3[_0xb3a8('0x30')]=_['intersection'](_0x2763f3['model'],_0x2763f3['query']);_0x40dffb[_0xb3a8('0x32')]=_[_0xb3a8('0x33')](_0x2763f3[_0xb3a8('0x31')],qs[_0xb3a8('0x34')](_0x2aec8c[_0xb3a8('0x2f')][_0xb3a8('0x34')]));_0x40dffb[_0xb3a8('0x32')]=_0x40dffb[_0xb3a8('0x32')][_0xb3a8('0x44')]?_0x40dffb[_0xb3a8('0x32')]:_0x2763f3['model'];if(_0x2aec8c[_0xb3a8('0x2f')]['includeAll']){_0x40dffb[_0xb3a8('0x3e')]=[{'all':!![]}];}_0x40dffb=_['merge']({},_0x40dffb,_0x2aec8c['options']);return db[_0xb3a8('0x29')]['find'](_0x40dffb)[_0xb3a8('0x23')](handleEntityNotFound(_0x308ec4,null))['then'](respondWithResult(_0x308ec4,null))['catch'](handleError(_0x308ec4,null));};exports[_0xb3a8('0x45')]=function(_0x555f0f,_0x342955){return db[_0xb3a8('0x29')][_0xb3a8('0x45')](_0x555f0f[_0xb3a8('0x46')],{})[_0xb3a8('0x23')](respondWithResult(_0x342955,0xc9))[_0xb3a8('0x41')](handleError(_0x342955,null));};exports[_0xb3a8('0x22')]=function(_0x564caa,_0x34e2ff){if(_0x564caa['body']['id']){delete _0x564caa[_0xb3a8('0x46')]['id'];}return db[_0xb3a8('0x29')]['find']({'where':{'id':_0x564caa[_0xb3a8('0x47')]['id']}})[_0xb3a8('0x23')](handleEntityNotFound(_0x34e2ff,null))[_0xb3a8('0x23')](saveUpdates(_0x564caa['body'],null))[_0xb3a8('0x23')](respondWithResult(_0x34e2ff,null))[_0xb3a8('0x41')](handleError(_0x34e2ff,null));};exports[_0xb3a8('0x48')]=function(_0x2515bf,_0x10ffff){return db['VtigerField'][_0xb3a8('0x49')]({'where':{'id':_0x2515bf[_0xb3a8('0x47')]['id']}})['then'](handleEntityNotFound(_0x10ffff,null))['then'](removeEntity(_0x10ffff,null))[_0xb3a8('0x41')](handleError(_0x10ffff,null));}; \ No newline at end of file +var _0xacb4=['then','sendStatus','error','stack','name','send','index','VtigerField','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','fields','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0xacb4,0x1a2));var _0x4acb=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0xacb4[_0x128450];return _0x4d80ed;};'use strict';var emlformat=require(_0x4acb('0x0'));var rimraf=require(_0x4acb('0x1'));var zipdir=require(_0x4acb('0x2'));var jsonpatch=require(_0x4acb('0x3'));var rp=require(_0x4acb('0x4'));var moment=require(_0x4acb('0x5'));var BPromise=require(_0x4acb('0x6'));var Mustache=require(_0x4acb('0x7'));var util=require(_0x4acb('0x8'));var path=require(_0x4acb('0x9'));var sox=require(_0x4acb('0xa'));var csv=require(_0x4acb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4acb('0xc'));var squel=require(_0x4acb('0xd'));var crypto=require('crypto');var jsforce=require(_0x4acb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4acb('0xb'));var querystring=require(_0x4acb('0xf'));var Papa=require(_0x4acb('0x10'));var Redis=require(_0x4acb('0x11'));var authService=require(_0x4acb('0x12'));var qs=require(_0x4acb('0x13'));var as=require(_0x4acb('0x14'));var hardwareService=require(_0x4acb('0x15'));var logger=require(_0x4acb('0x16'))('api');var utils=require(_0x4acb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4acb('0x18'));var db=require(_0x4acb('0x19'))['db'];function respondWithStatusCode(_0x1aa421,_0xf92348){_0xf92348=_0xf92348||0xcc;return function(_0x2fbde4){if(_0x2fbde4){return _0x1aa421['sendStatus'](_0xf92348);}return _0x1aa421[_0x4acb('0x1a')](_0xf92348)[_0x4acb('0x1b')]();};}function respondWithResult(_0xe08c16,_0x169f0f){_0x169f0f=_0x169f0f||0xc8;return function(_0x17d211){if(_0x17d211){return _0xe08c16[_0x4acb('0x1a')](_0x169f0f)[_0x4acb('0x1c')](_0x17d211);}};}function respondWithFilteredResult(_0x235316,_0x1125dc){return function(_0x93f851){if(_0x93f851){var _0x5cc774=typeof _0x1125dc['offset']===_0x4acb('0x1d')&&typeof _0x1125dc[_0x4acb('0x1e')]===_0x4acb('0x1d');var _0x3314d1=_0x93f851[_0x4acb('0x1f')];var _0x395c14=_0x5cc774?0x0:_0x1125dc[_0x4acb('0x20')];var _0x13459b=_0x5cc774?_0x93f851[_0x4acb('0x1f')]:_0x1125dc[_0x4acb('0x20')]+_0x1125dc['limit'];var _0xb19c09;if(_0x13459b>=_0x3314d1){_0x13459b=_0x3314d1;_0xb19c09=0xc8;}else{_0xb19c09=0xce;}_0x235316[_0x4acb('0x1a')](_0xb19c09);return _0x235316[_0x4acb('0x21')](_0x4acb('0x22'),_0x395c14+'-'+_0x13459b+'/'+_0x3314d1)[_0x4acb('0x1c')](_0x93f851);}return null;};}function patchUpdates(_0x4714c1){return function(_0x1f9811){try{jsonpatch['apply'](_0x1f9811,_0x4714c1,!![]);}catch(_0x3648e3){return BPromise[_0x4acb('0x23')](_0x3648e3);}return _0x1f9811[_0x4acb('0x24')]();};}function saveUpdates(_0x3f33a1,_0x3fdf85){return function(_0x23d0b7){if(_0x23d0b7){return _0x23d0b7[_0x4acb('0x25')](_0x3f33a1)[_0x4acb('0x26')](function(_0x1265d0){return _0x1265d0;});}return null;};}function removeEntity(_0x5cc1b6,_0x23c1ed){return function(_0x5e423b){if(_0x5e423b){return _0x5e423b['destroy']()[_0x4acb('0x26')](function(){_0x5cc1b6[_0x4acb('0x1a')](0xcc)[_0x4acb('0x1b')]();});}};}function handleEntityNotFound(_0x48031e,_0x2024ec){return function(_0x399588){if(!_0x399588){_0x48031e[_0x4acb('0x27')](0x194);}return _0x399588;};}function handleError(_0x2f784a,_0x11d401){_0x11d401=_0x11d401||0x1f4;return function(_0x42cd23){logger[_0x4acb('0x28')](_0x42cd23[_0x4acb('0x29')]);if(_0x42cd23[_0x4acb('0x2a')]){delete _0x42cd23[_0x4acb('0x2a')];}_0x2f784a[_0x4acb('0x1a')](_0x11d401)[_0x4acb('0x2b')](_0x42cd23);};}exports[_0x4acb('0x2c')]=function(_0x3e8fe8,_0xb6d9a0){var _0x54a5f2={},_0x49fd43={},_0xc6926c={'count':0x0,'rows':[]};var _0x144ae6=_['map'](db[_0x4acb('0x2d')][_0x4acb('0x2e')],function(_0x98eb2d){return{'name':_0x98eb2d['fieldName'],'type':_0x98eb2d[_0x4acb('0x2f')][_0x4acb('0x30')]};});_0x49fd43['model']=_[_0x4acb('0x31')](_0x144ae6,_0x4acb('0x2a'));_0x49fd43[_0x4acb('0x32')]=_[_0x4acb('0x33')](_0x3e8fe8[_0x4acb('0x32')]);_0x49fd43[_0x4acb('0x34')]=_[_0x4acb('0x35')](_0x49fd43[_0x4acb('0x36')],_0x49fd43[_0x4acb('0x32')]);_0x54a5f2[_0x4acb('0x37')]=_[_0x4acb('0x35')](_0x49fd43[_0x4acb('0x36')],qs['fields'](_0x3e8fe8[_0x4acb('0x32')]['fields']));_0x54a5f2[_0x4acb('0x37')]=_0x54a5f2[_0x4acb('0x37')][_0x4acb('0x38')]?_0x54a5f2[_0x4acb('0x37')]:_0x49fd43[_0x4acb('0x36')];if(!_0x3e8fe8['query']['hasOwnProperty'](_0x4acb('0x39'))){_0x54a5f2[_0x4acb('0x1e')]=qs[_0x4acb('0x1e')](_0x3e8fe8['query'][_0x4acb('0x1e')]);_0x54a5f2['offset']=qs[_0x4acb('0x20')](_0x3e8fe8[_0x4acb('0x32')][_0x4acb('0x20')]);}_0x54a5f2[_0x4acb('0x3a')]=qs[_0x4acb('0x3b')](_0x3e8fe8[_0x4acb('0x32')]['sort']);_0x54a5f2[_0x4acb('0x3c')]=qs['filters'](_[_0x4acb('0x3d')](_0x3e8fe8[_0x4acb('0x32')],_0x49fd43[_0x4acb('0x34')]),_0x144ae6);if(_0x3e8fe8[_0x4acb('0x32')][_0x4acb('0x3e')]){_0x54a5f2[_0x4acb('0x3c')]=_[_0x4acb('0x3f')](_0x54a5f2[_0x4acb('0x3c')],{'$or':_['map'](_0x144ae6,function(_0x41a2cf){if(_0x41a2cf[_0x4acb('0x2f')]!==_0x4acb('0x40')){var _0x26b06f={};_0x26b06f[_0x41a2cf['name']]={'$like':'%'+_0x3e8fe8['query'][_0x4acb('0x3e')]+'%'};return _0x26b06f;}})});}_0x54a5f2=_[_0x4acb('0x3f')]({},_0x54a5f2,_0x3e8fe8['options']);var _0x2a84d6={'where':_0x54a5f2[_0x4acb('0x3c')]};return db[_0x4acb('0x2d')][_0x4acb('0x1f')](_0x2a84d6)[_0x4acb('0x26')](function(_0xaad75f){_0xc6926c[_0x4acb('0x1f')]=_0xaad75f;if(_0x3e8fe8['query']['includeAll']){_0x54a5f2[_0x4acb('0x41')]=[{'all':!![]}];}return db[_0x4acb('0x2d')][_0x4acb('0x42')](_0x54a5f2);})[_0x4acb('0x26')](function(_0x539f2f){_0xc6926c['rows']=_0x539f2f;return _0xc6926c;})[_0x4acb('0x26')](respondWithFilteredResult(_0xb6d9a0,_0x54a5f2))[_0x4acb('0x43')](handleError(_0xb6d9a0,null));};exports[_0x4acb('0x44')]=function(_0x391603,_0x35f8cb){var _0x577a22={'raw':!![],'where':{'id':_0x391603[_0x4acb('0x45')]['id']}},_0x90787c={};_0x90787c['model']=_[_0x4acb('0x33')](db[_0x4acb('0x2d')][_0x4acb('0x2e')]);_0x90787c[_0x4acb('0x32')]=_[_0x4acb('0x33')](_0x391603[_0x4acb('0x32')]);_0x90787c['filters']=_['intersection'](_0x90787c[_0x4acb('0x36')],_0x90787c[_0x4acb('0x32')]);_0x577a22['attributes']=_['intersection'](_0x90787c[_0x4acb('0x36')],qs[_0x4acb('0x46')](_0x391603[_0x4acb('0x32')]['fields']));_0x577a22['attributes']=_0x577a22[_0x4acb('0x37')][_0x4acb('0x38')]?_0x577a22[_0x4acb('0x37')]:_0x90787c[_0x4acb('0x36')];if(_0x391603[_0x4acb('0x32')][_0x4acb('0x47')]){_0x577a22['include']=[{'all':!![]}];}_0x577a22=_[_0x4acb('0x3f')]({},_0x577a22,_0x391603[_0x4acb('0x48')]);return db[_0x4acb('0x2d')][_0x4acb('0x49')](_0x577a22)[_0x4acb('0x26')](handleEntityNotFound(_0x35f8cb,null))[_0x4acb('0x26')](respondWithResult(_0x35f8cb,null))[_0x4acb('0x43')](handleError(_0x35f8cb,null));};exports[_0x4acb('0x4a')]=function(_0x4bef67,_0x40f32e){return db['VtigerField']['create'](_0x4bef67[_0x4acb('0x4b')],{})[_0x4acb('0x26')](respondWithResult(_0x40f32e,0xc9))['catch'](handleError(_0x40f32e,null));};exports[_0x4acb('0x25')]=function(_0x5bb279,_0xf20ca2){if(_0x5bb279[_0x4acb('0x4b')]['id']){delete _0x5bb279['body']['id'];}return db[_0x4acb('0x2d')][_0x4acb('0x49')]({'where':{'id':_0x5bb279[_0x4acb('0x45')]['id']}})['then'](handleEntityNotFound(_0xf20ca2,null))[_0x4acb('0x26')](saveUpdates(_0x5bb279[_0x4acb('0x4b')],null))[_0x4acb('0x26')](respondWithResult(_0xf20ca2,null))['catch'](handleError(_0xf20ca2,null));};exports['destroy']=function(_0x2bb25e,_0x11a724){return db[_0x4acb('0x2d')][_0x4acb('0x49')]({'where':{'id':_0x2bb25e[_0x4acb('0x45')]['id']}})['then'](handleEntityNotFound(_0x11a724,null))['then'](removeEntity(_0x11a724,null))[_0x4acb('0x43')](handleError(_0x11a724,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e820081..0d5088b 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 _0x0a46=['exports','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x0a46,0x95));var _0x60a4=function(_0x1883a1,_0x2000db){_0x1883a1=_0x1883a1-0x0;var _0x123a5b=_0x0a46[_0x1883a1];return _0x123a5b;};'use strict';var _=require(_0x60a4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x60a4('0x1'));var BPromise=require(_0x60a4('0x2'));var rp=require(_0x60a4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60a4('0x4'));var config=require(_0x60a4('0x5'));var attributes=require(_0x60a4('0x6'));module[_0x60a4('0x7')]=function(_0x4f4898,_0x4c8510){return _0x4f4898['define'](_0x60a4('0x8'),attributes,{'tableName':_0x60a4('0x9'),'paranoid':![],'indexes':[{'name':_0x60a4('0xa'),'fields':['idField',_0x60a4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe597=['request-promise','rimraf','./intVtigerField.attributes','exports','define','VtigerField','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x4ab927,_0x195a86){var _0x34d95d=function(_0x2b34f2){while(--_0x2b34f2){_0x4ab927['push'](_0x4ab927['shift']());}};_0x34d95d(++_0x195a86);}(_0xe597,0x167));var _0x7e59=function(_0x2c8b8d,_0x3ccc0e){_0x2c8b8d=_0x2c8b8d-0x0;var _0x3fae91=_0xe597[_0x2c8b8d];return _0x3fae91;};'use strict';var _=require(_0x7e59('0x0'));var util=require(_0x7e59('0x1'));var logger=require(_0x7e59('0x2'))(_0x7e59('0x3'));var moment=require('moment');var BPromise=require(_0x7e59('0x4'));var rp=require(_0x7e59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e59('0x6'));var config=require('../../config/environment');var attributes=require(_0x7e59('0x7'));module[_0x7e59('0x8')]=function(_0x11f6d5,_0x4cde1e){return _0x11f6d5[_0x7e59('0x9')](_0x7e59('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x7e59('0xb'),_0x7e59('0xc')],'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 5632303..bcfb8c0 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 _0xcef9=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xcef9,0x142));var _0x9cef=function(_0x264fe6,_0x353336){_0x264fe6=_0x264fe6-0x0;var _0x4df8b1=_0xcef9[_0x264fe6];return _0x4df8b1;};'use strict';var _=require(_0x9cef('0x0'));var util=require(_0x9cef('0x1'));var moment=require(_0x9cef('0x2'));var BPromise=require(_0x9cef('0x3'));var rs=require(_0x9cef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9cef('0x5'));var logger=require(_0x9cef('0x6'))('rpc');var config=require(_0x9cef('0x7'));var jayson=require(_0x9cef('0x8'));var client=jayson[_0x9cef('0x9')][_0x9cef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd91b79,_0x2c3101,_0x523914){return new BPromise(function(_0x2f1b85,_0x29a2d3){return client[_0x9cef('0xb')](_0xd91b79,_0x523914)[_0x9cef('0xc')](function(_0x35edfa){logger[_0x9cef('0xd')](_0x9cef('0xe'),_0x2c3101,_0x9cef('0xf'));logger[_0x9cef('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x2c3101,_0x9cef('0xf'),JSON[_0x9cef('0x11')](_0x35edfa));if(_0x35edfa[_0x9cef('0x12')]){if(_0x35edfa[_0x9cef('0x12')][_0x9cef('0x13')]===0x1f4){logger[_0x9cef('0x12')](_0x9cef('0xe'),_0x2c3101,_0x35edfa[_0x9cef('0x12')][_0x9cef('0x14')]);return _0x29a2d3(_0x35edfa[_0x9cef('0x12')][_0x9cef('0x14')]);}logger[_0x9cef('0x12')](_0x9cef('0xe'),_0x2c3101,_0x35edfa[_0x9cef('0x12')][_0x9cef('0x14')]);return _0x2f1b85(_0x35edfa[_0x9cef('0x12')][_0x9cef('0x14')]);}else{logger[_0x9cef('0xd')](_0x9cef('0xe'),_0x2c3101,_0x9cef('0xf'));_0x2f1b85(_0x35edfa[_0x9cef('0x15')][_0x9cef('0x14')]);}})['catch'](function(_0x34f335){logger[_0x9cef('0x12')](_0x9cef('0xe'),_0x2c3101,_0x34f335);_0x29a2d3(_0x34f335);});});} \ No newline at end of file +var _0x698f=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x698f,0xff));var _0xf698=function(_0xa69055,_0x1bd39a){_0xa69055=_0xa69055-0x0;var _0x3fb283=_0x698f[_0xa69055];return _0x3fb283;};'use strict';var _=require(_0xf698('0x0'));var util=require(_0xf698('0x1'));var moment=require(_0xf698('0x2'));var BPromise=require(_0xf698('0x3'));var rs=require(_0xf698('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf698('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf698('0x6'))(_0xf698('0x7'));var config=require(_0xf698('0x8'));var jayson=require(_0xf698('0x9'));var client=jayson[_0xf698('0xa')][_0xf698('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b6a3c,_0x3f7539,_0x176c3c){return new BPromise(function(_0x40ab2f,_0x29f443){return client[_0xf698('0xc')](_0x2b6a3c,_0x176c3c)[_0xf698('0xd')](function(_0x45a934){logger[_0xf698('0xe')](_0xf698('0xf'),_0x3f7539,'request\x20sent');logger[_0xf698('0x10')](_0xf698('0x11'),_0x3f7539,_0xf698('0x12'),JSON[_0xf698('0x13')](_0x45a934));if(_0x45a934[_0xf698('0x14')]){if(_0x45a934[_0xf698('0x14')][_0xf698('0x15')]===0x1f4){logger[_0xf698('0x14')](_0xf698('0xf'),_0x3f7539,_0x45a934[_0xf698('0x14')][_0xf698('0x16')]);return _0x29f443(_0x45a934[_0xf698('0x14')][_0xf698('0x16')]);}logger['error'](_0xf698('0xf'),_0x3f7539,_0x45a934[_0xf698('0x14')][_0xf698('0x16')]);return _0x40ab2f(_0x45a934[_0xf698('0x14')][_0xf698('0x16')]);}else{logger[_0xf698('0xe')]('VtigerField,\x20%s,\x20%s',_0x3f7539,_0xf698('0x12'));_0x40ab2f(_0x45a934['result'][_0xf698('0x16')]);}})[_0xf698('0x17')](function(_0x5b1290){logger['error'](_0xf698('0xf'),_0x3f7539,_0x5b1290);_0x29f443(_0x5b1290);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index fe58bbb..d22bd81 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 _0xe1ae=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations'];(function(_0x583941,_0x3b1db1){var _0x43c87c=function(_0x75eaf8){while(--_0x75eaf8){_0x583941['push'](_0x583941['shift']());}};_0x43c87c(++_0x3b1db1);}(_0xe1ae,0x137));var _0xee1a=function(_0x2b35ca,_0x4943ce){_0x2b35ca=_0x2b35ca-0x0;var _0x68389e=_0xe1ae[_0x2b35ca];return _0x68389e;};'use strict';var multer=require(_0xee1a('0x0'));var util=require('util');var path=require(_0xee1a('0x1'));var timeout=require(_0xee1a('0x2'));var express=require(_0xee1a('0x3'));var router=express[_0xee1a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee1a('0x5'));var interaction=require(_0xee1a('0x6'));var config=require(_0xee1a('0x7'));var controller=require('./intZendeskAccount.controller');router[_0xee1a('0x8')]('/',auth[_0xee1a('0x9')](),controller[_0xee1a('0xa')]);router[_0xee1a('0x8')](_0xee1a('0xb'),auth[_0xee1a('0x9')](),controller[_0xee1a('0xc')]);router['get']('/:id/configurations',auth[_0xee1a('0x9')](),controller[_0xee1a('0xd')]);router[_0xee1a('0x8')](_0xee1a('0xe'),auth[_0xee1a('0x9')](),controller[_0xee1a('0xf')]);router[_0xee1a('0x10')]('/',auth[_0xee1a('0x9')](),controller[_0xee1a('0x11')]);router[_0xee1a('0x10')](_0xee1a('0x12'),auth[_0xee1a('0x9')](),controller[_0xee1a('0x13')]);router[_0xee1a('0x14')](_0xee1a('0xb'),auth[_0xee1a('0x9')](),controller[_0xee1a('0x15')]);router[_0xee1a('0x16')]('/:id',auth[_0xee1a('0x9')](),controller[_0xee1a('0x17')]);module[_0xee1a('0x18')]=router; \ No newline at end of file +var _0x262f=['post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x4d9c72,_0x44de9e){var _0x3be3b9=function(_0x335c2f){while(--_0x335c2f){_0x4d9c72['push'](_0x4d9c72['shift']());}};_0x3be3b9(++_0x44de9e);}(_0x262f,0xb6));var _0xf262=function(_0x1959c6,_0x2e1600){_0x1959c6=_0x1959c6-0x0;var _0xec4bc0=_0x262f[_0x1959c6];return _0xec4bc0;};'use strict';var multer=require(_0xf262('0x0'));var util=require(_0xf262('0x1'));var path=require('path');var timeout=require(_0xf262('0x2'));var express=require(_0xf262('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf262('0x4'));var interaction=require(_0xf262('0x5'));var config=require(_0xf262('0x6'));var controller=require(_0xf262('0x7'));router[_0xf262('0x8')]('/',auth[_0xf262('0x9')](),controller[_0xf262('0xa')]);router[_0xf262('0x8')](_0xf262('0xb'),auth[_0xf262('0x9')](),controller[_0xf262('0xc')]);router['get']('/:id/configurations',auth[_0xf262('0x9')](),controller[_0xf262('0xd')]);router[_0xf262('0x8')](_0xf262('0xe'),auth['isAuthenticated'](),controller[_0xf262('0xf')]);router[_0xf262('0x10')]('/',auth[_0xf262('0x9')](),controller[_0xf262('0x11')]);router[_0xf262('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xf262('0xb'),auth[_0xf262('0x9')](),controller[_0xf262('0x12')]);router[_0xf262('0x13')]('/:id',auth[_0xf262('0x9')](),controller[_0xf262('0x14')]);module[_0xf262('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 0aa991b..2cdfff6 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 _0x1298=['exports','STRING','username','remoteUri','password','token','ENUM','integrationTab','newTab'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x1298,0x19e));var _0x8129=function(_0x117e01,_0x16b857){_0x117e01=_0x117e01-0x0;var _0x4ba552=_0x1298[_0x117e01];return _0x4ba552;};'use strict';var Sequelize=require('sequelize');module[_0x8129('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8129('0x1')]},'username':{'type':Sequelize[_0x8129('0x1')],'unique':_0x8129('0x2')},'password':{'type':Sequelize[_0x8129('0x1')]},'token':{'type':Sequelize[_0x8129('0x1')]},'remoteUri':{'type':Sequelize[_0x8129('0x1')],'unique':_0x8129('0x3')},'authType':{'type':Sequelize['ENUM'](_0x8129('0x4'),_0x8129('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8129('0x6')](_0x8129('0x7'),_0x8129('0x8')),'defaultValue':_0x8129('0x7')}}; \ No newline at end of file +var _0x8b52=['ENUM','password','token','newTab','sequelize','exports','STRING','username','remoteUri'];(function(_0xf68647,_0x7af217){var _0x2684b4=function(_0x589704){while(--_0x589704){_0xf68647['push'](_0xf68647['shift']());}};_0x2684b4(++_0x7af217);}(_0x8b52,0x151));var _0x28b5=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8b52[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x28b5('0x0'));module[_0x28b5('0x1')]={'name':{'type':Sequelize[_0x28b5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x28b5('0x2')],'unique':_0x28b5('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x28b5('0x2')]},'remoteUri':{'type':Sequelize[_0x28b5('0x2')],'unique':_0x28b5('0x4')},'authType':{'type':Sequelize[_0x28b5('0x5')](_0x28b5('0x6'),_0x28b5('0x7')),'defaultValue':_0x28b5('0x6')},'serverUrl':{'type':Sequelize[_0x28b5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x28b5('0x5')]('integrationTab',_0x28b5('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 646fd04..0b4da93 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 _0xee5b=['model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','getSubjects','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','%s:%s','toString','base64','headers','Basic\x20%s','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','includes','position','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','error','name','send','index','map','ZendeskAccount','rawAttributes','type'];(function(_0x491f9b,_0x3aaa43){var _0x24b994=function(_0x33f2d6){while(--_0x33f2d6){_0x491f9b['push'](_0x491f9b['shift']());}};_0x24b994(++_0x3aaa43);}(_0xee5b,0x1f4));var _0xbee5=function(_0x54400e,_0x14879e){_0x54400e=_0x54400e-0x0;var _0x3723c2=_0xee5b[_0x54400e];return _0x3723c2;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];var integrations=require(_0xbee5('0x17'));function respondWithStatusCode(_0x48f771,_0x14e032){_0x14e032=_0x14e032||0xcc;return function(_0x532a78){if(_0x532a78){return _0x48f771[_0xbee5('0x18')](_0x14e032);}return _0x48f771[_0xbee5('0x19')](_0x14e032)[_0xbee5('0x1a')]();};}function respondWithResult(_0x593ecb,_0x5092f2){_0x5092f2=_0x5092f2||0xc8;return function(_0x3c6e56){if(_0x3c6e56){return _0x593ecb['status'](_0x5092f2)[_0xbee5('0x1b')](_0x3c6e56);}};}function respondWithFilteredResult(_0x5426c9,_0x1a24bd){return function(_0x141878){if(_0x141878){var _0xf676b1=typeof _0x1a24bd['offset']===_0xbee5('0x1c')&&typeof _0x1a24bd[_0xbee5('0x1d')]==='undefined';var _0x254dd3=_0x141878[_0xbee5('0x1e')];var _0x11b4a3=_0xf676b1?0x0:_0x1a24bd[_0xbee5('0x1f')];var _0x35eb5c=_0xf676b1?_0x141878[_0xbee5('0x1e')]:_0x1a24bd[_0xbee5('0x1f')]+_0x1a24bd[_0xbee5('0x1d')];var _0x20cf52;if(_0x35eb5c>=_0x254dd3){_0x35eb5c=_0x254dd3;_0x20cf52=0xc8;}else{_0x20cf52=0xce;}_0x5426c9[_0xbee5('0x19')](_0x20cf52);return _0x5426c9[_0xbee5('0x20')](_0xbee5('0x21'),_0x11b4a3+'-'+_0x35eb5c+'/'+_0x254dd3)[_0xbee5('0x1b')](_0x141878);}return null;};}function patchUpdates(_0x40a06){return function(_0x450824){try{jsonpatch['apply'](_0x450824,_0x40a06,!![]);}catch(_0x550325){return BPromise[_0xbee5('0x22')](_0x550325);}return _0x450824['save']();};}function saveUpdates(_0x205491,_0x117cb3){return function(_0x3cee7f){if(_0x3cee7f){return _0x3cee7f[_0xbee5('0x23')](_0x205491)[_0xbee5('0x24')](function(_0xb665df){return _0xb665df;});}return null;};}function removeEntity(_0x359ccf,_0x3cfa8d){return function(_0xc79035){if(_0xc79035){return _0xc79035['destroy']()['then'](function(){_0x359ccf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d774,_0x1af3de){return function(_0x18d7f4){if(!_0x18d7f4){_0x50d774[_0xbee5('0x18')](0x194);}return _0x18d7f4;};}function handleError(_0x28c74d,_0x169042){_0x169042=_0x169042||0x1f4;return function(_0x20e7e8){logger[_0xbee5('0x25')](_0x20e7e8['stack']);if(_0x20e7e8[_0xbee5('0x26')]){delete _0x20e7e8[_0xbee5('0x26')];}_0x28c74d[_0xbee5('0x19')](_0x169042)[_0xbee5('0x27')](_0x20e7e8);};}exports[_0xbee5('0x28')]=function(_0x5f0419,_0x21b993){var _0x15ffb1={},_0xb7a077={},_0x136a00={'count':0x0,'rows':[]};var _0xa57f85=_[_0xbee5('0x29')](db[_0xbee5('0x2a')][_0xbee5('0x2b')],function(_0x2ccb91){return{'name':_0x2ccb91['fieldName'],'type':_0x2ccb91[_0xbee5('0x2c')]['key']};});_0xb7a077[_0xbee5('0x2d')]=_['map'](_0xa57f85,_0xbee5('0x26'));_0xb7a077['query']=_[_0xbee5('0x2e')](_0x5f0419['query']);_0xb7a077[_0xbee5('0x2f')]=_[_0xbee5('0x30')](_0xb7a077[_0xbee5('0x2d')],_0xb7a077[_0xbee5('0x31')]);_0x15ffb1['attributes']=_[_0xbee5('0x30')](_0xb7a077[_0xbee5('0x2d')],qs[_0xbee5('0x32')](_0x5f0419[_0xbee5('0x31')]['fields']));_0x15ffb1[_0xbee5('0x33')]=_0x15ffb1[_0xbee5('0x33')][_0xbee5('0x34')]?_0x15ffb1[_0xbee5('0x33')]:_0xb7a077['model'];if(!_0x5f0419[_0xbee5('0x31')][_0xbee5('0x35')](_0xbee5('0x36'))){_0x15ffb1[_0xbee5('0x1d')]=qs['limit'](_0x5f0419[_0xbee5('0x31')]['limit']);_0x15ffb1[_0xbee5('0x1f')]=qs['offset'](_0x5f0419['query']['offset']);}_0x15ffb1[_0xbee5('0x37')]=qs[_0xbee5('0x38')](_0x5f0419[_0xbee5('0x31')][_0xbee5('0x38')]);_0x15ffb1[_0xbee5('0x39')]=qs[_0xbee5('0x2f')](_[_0xbee5('0x3a')](_0x5f0419[_0xbee5('0x31')],_0xb7a077['filters']),_0xa57f85);if(_0x5f0419[_0xbee5('0x31')]['filter']){_0x15ffb1[_0xbee5('0x39')]=_[_0xbee5('0x3b')](_0x15ffb1[_0xbee5('0x39')],{'$or':_[_0xbee5('0x29')](_0xa57f85,function(_0x4a89ac){if(_0x4a89ac[_0xbee5('0x2c')]!=='VIRTUAL'){var _0x565e9f={};_0x565e9f[_0x4a89ac[_0xbee5('0x26')]]={'$like':'%'+_0x5f0419[_0xbee5('0x31')][_0xbee5('0x3c')]+'%'};return _0x565e9f;}})});}_0x15ffb1=_[_0xbee5('0x3b')]({},_0x15ffb1,_0x5f0419['options']);var _0xf3dd5={'where':_0x15ffb1[_0xbee5('0x39')]};return db[_0xbee5('0x2a')][_0xbee5('0x1e')](_0xf3dd5)[_0xbee5('0x24')](function(_0x25cf17){_0x136a00[_0xbee5('0x1e')]=_0x25cf17;if(_0x5f0419[_0xbee5('0x31')][_0xbee5('0x3d')]){_0x15ffb1[_0xbee5('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xbee5('0x3f')](_0x15ffb1);})[_0xbee5('0x24')](function(_0x5637e0){_0x136a00[_0xbee5('0x40')]=_0x5637e0;return _0x136a00;})[_0xbee5('0x24')](respondWithFilteredResult(_0x21b993,_0x15ffb1))[_0xbee5('0x41')](handleError(_0x21b993,null));};exports[_0xbee5('0x42')]=function(_0x4dad75,_0x4cfe54){var _0x4b4641={'raw':![],'where':{'id':_0x4dad75[_0xbee5('0x43')]['id']}},_0x138a40={};_0x138a40[_0xbee5('0x2d')]=_[_0xbee5('0x2e')](db[_0xbee5('0x2a')][_0xbee5('0x2b')]);_0x138a40[_0xbee5('0x31')]=_[_0xbee5('0x2e')](_0x4dad75[_0xbee5('0x31')]);_0x138a40['filters']=_['intersection'](_0x138a40[_0xbee5('0x2d')],_0x138a40['query']);_0x4b4641[_0xbee5('0x33')]=_[_0xbee5('0x30')](_0x138a40['model'],qs[_0xbee5('0x32')](_0x4dad75[_0xbee5('0x31')]['fields']));_0x4b4641['attributes']=_0x4b4641[_0xbee5('0x33')][_0xbee5('0x34')]?_0x4b4641['attributes']:_0x138a40[_0xbee5('0x2d')];if(_0x4dad75[_0xbee5('0x31')]['includeAll']){_0x4b4641[_0xbee5('0x3e')]=[{'all':!![]}];}_0x4b4641=_[_0xbee5('0x3b')]({},_0x4b4641,_0x4dad75[_0xbee5('0x44')]);return db[_0xbee5('0x2a')][_0xbee5('0x45')](_0x4b4641)[_0xbee5('0x24')](handleEntityNotFound(_0x4cfe54,null))[_0xbee5('0x24')](respondWithResult(_0x4cfe54,null))['catch'](handleError(_0x4cfe54,null));};exports[_0xbee5('0x46')]=function(_0x34f01d,_0x27ea7b){return db[_0xbee5('0x2a')]['create'](_0x34f01d[_0xbee5('0x47')],{})[_0xbee5('0x24')](respondWithResult(_0x27ea7b,0xc9))[_0xbee5('0x41')](handleError(_0x27ea7b,null));};exports['update']=function(_0x44d4b1,_0xf637bf){if(_0x44d4b1['body']['id']){delete _0x44d4b1['body']['id'];}return db['ZendeskAccount'][_0xbee5('0x45')]({'where':{'id':_0x44d4b1['params']['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0xf637bf,null))[_0xbee5('0x24')](saveUpdates(_0x44d4b1[_0xbee5('0x47')],null))[_0xbee5('0x24')](respondWithResult(_0xf637bf,null))[_0xbee5('0x41')](handleError(_0xf637bf,null));};exports[_0xbee5('0x48')]=function(_0x55e654,_0x24274d){return db[_0xbee5('0x2a')][_0xbee5('0x45')]({'where':{'id':_0x55e654[_0xbee5('0x43')]['id']}})['then'](handleEntityNotFound(_0x24274d,null))[_0xbee5('0x24')](removeEntity(_0x24274d,null))['catch'](handleError(_0x24274d,null));};exports[_0xbee5('0x49')]=function(_0x45d114,_0xf48059,_0x22c51){var _0x2484c7={};var _0x1b02eb={};var _0xe8902;var _0x35f1d1;return db[_0xbee5('0x2a')][_0xbee5('0x4a')]({'where':{'id':_0x45d114[_0xbee5('0x43')]['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0xf48059,null))[_0xbee5('0x24')](function(_0x359738){if(_0x359738){_0xe8902=_0x359738;_0x1b02eb[_0xbee5('0x2d')]=_['keys'](db[_0xbee5('0x4b')][_0xbee5('0x2b')]);_0x1b02eb[_0xbee5('0x31')]=_['keys'](_0x45d114[_0xbee5('0x31')]);_0x1b02eb[_0xbee5('0x2f')]=_[_0xbee5('0x30')](_0x1b02eb['model'],_0x1b02eb[_0xbee5('0x31')]);_0x2484c7['attributes']=_[_0xbee5('0x30')](_0x1b02eb['model'],qs[_0xbee5('0x32')](_0x45d114[_0xbee5('0x31')][_0xbee5('0x32')]));_0x2484c7['attributes']=_0x2484c7['attributes']['length']?_0x2484c7[_0xbee5('0x33')]:_0x1b02eb[_0xbee5('0x2d')];_0x2484c7[_0xbee5('0x37')]=qs['sort'](_0x45d114[_0xbee5('0x31')]['sort']);_0x2484c7[_0xbee5('0x39')]=qs[_0xbee5('0x2f')](_[_0xbee5('0x3a')](_0x45d114['query'],_0x1b02eb[_0xbee5('0x2f')]));if(_0x45d114[_0xbee5('0x31')][_0xbee5('0x3c')]){_0x2484c7[_0xbee5('0x39')]=_[_0xbee5('0x3b')](_0x2484c7[_0xbee5('0x39')],{'$or':_[_0xbee5('0x29')](_0x2484c7[_0xbee5('0x33')],function(_0x22fc1a){var _0x111027={};_0x111027[_0x22fc1a]={'$like':'%'+_0x45d114[_0xbee5('0x31')][_0xbee5('0x3c')]+'%'};return _0x111027;})});}_0x2484c7=_[_0xbee5('0x3b')]({},_0x2484c7,_0x45d114[_0xbee5('0x44')]);return _0xe8902[_0xbee5('0x49')](_0x2484c7);}})[_0xbee5('0x24')](function(_0x32a8d2){if(_0x32a8d2){_0x35f1d1=_0x32a8d2['length'];if(!_0x45d114[_0xbee5('0x31')]['hasOwnProperty']('nolimit')){_0x2484c7[_0xbee5('0x1d')]=qs[_0xbee5('0x1d')](_0x45d114['query']['limit']);_0x2484c7[_0xbee5('0x1f')]=qs['offset'](_0x45d114[_0xbee5('0x31')][_0xbee5('0x1f')]);}return _0xe8902['getConfigurations'](_0x2484c7);}})[_0xbee5('0x24')](function(_0x1a98c9){if(_0x1a98c9){return _0x1a98c9?{'count':_0x35f1d1,'rows':_0x1a98c9}:null;}})[_0xbee5('0x24')](respondWithResult(_0xf48059,null))[_0xbee5('0x41')](handleError(_0xf48059,null));};exports['addConfiguration']=function(_0x205784,_0x4ad4b5,_0x3294f1){if(_0x205784[_0xbee5('0x47')]['id']){delete _0x205784['body']['id'];}return db[_0xbee5('0x2a')][_0xbee5('0x4a')]({'where':{'id':_0x205784['params']['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x4ad4b5,null))[_0xbee5('0x24')](function(_0x4f431e){if(_0x4f431e){_0x205784[_0xbee5('0x47')]['AccountId']=_0x4f431e['id'];_0x205784[_0xbee5('0x47')]['Subjects']=integrations[_0xbee5('0x4c')](_0x205784['body']['channel'],_0x205784[_0xbee5('0x47')][_0xbee5('0x2c')]);_0x205784[_0xbee5('0x47')][_0xbee5('0x4d')]=integrations[_0xbee5('0x4e')](_0x205784[_0xbee5('0x47')]['channel'],_0x205784[_0xbee5('0x47')][_0xbee5('0x2c')]);return db[_0xbee5('0x4b')][_0xbee5('0x46')](_0x205784[_0xbee5('0x47')],{'include':[{'model':db[_0xbee5('0x4f')],'as':_0xbee5('0x50')},{'model':db[_0xbee5('0x4f')],'as':_0xbee5('0x4d')}]});}return null;})['then'](respondWithResult(_0x4ad4b5,null))[_0xbee5('0x41')](handleError(_0x4ad4b5,null));};exports[_0xbee5('0x51')]=function(_0x43452f,_0x274a2c,_0x59fe10){var _0x13e84a='';return db[_0xbee5('0x2a')][_0xbee5('0x4a')]({'where':{'id':_0x43452f[_0xbee5('0x43')]['id']},'attributes':['id',_0xbee5('0x52'),_0xbee5('0x53'),_0xbee5('0x54'),_0xbee5('0x55'),_0xbee5('0x56')]})[_0xbee5('0x24')](handleEntityNotFound(_0x274a2c,null))[_0xbee5('0x24')](function(_0x24cd85){if(_0x24cd85){_0x13e84a=_0x24cd85['remoteUri'];var _0x20a9d2=_0x13e84a[_0xbee5('0x57')](-0x1);if(_0x20a9d2==='/'){_0x13e84a=_0x13e84a['substring'](0x0,_0x13e84a[_0xbee5('0x58')](_0x20a9d2));}var _0x56ceeb={'method':_0xbee5('0x59'),'uri':util[_0xbee5('0x5a')]('%s/%s',_0x13e84a,_0xbee5('0x5b')),'json':!![]};switch(_0x24cd85['authType']){case'password':_0x56ceeb['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0xbee5('0x5c'),_0x24cd85[_0xbee5('0x52')],_0x24cd85[_0xbee5('0x53')]))[_0xbee5('0x5d')](_0xbee5('0x5e')))};break;case _0xbee5('0x54'):_0x56ceeb[_0xbee5('0x5f')]={'Authorization':util[_0xbee5('0x5a')](_0xbee5('0x60'),new Buffer(util[_0xbee5('0x5a')](_0xbee5('0x61'),_0x24cd85[_0xbee5('0x52')],_0x24cd85['token']))[_0xbee5('0x5d')](_0xbee5('0x5e')))};break;default:throw new db['Sequelize']['ValidationError'](_0xbee5('0x62'));}return rp(_0x56ceeb);}})[_0xbee5('0x24')](function(_0x39cc65){if(_0x39cc65){var _0x5e5cba=[_0xbee5('0x63'),_0xbee5('0x64'),_0xbee5('0x65'),'assignee'];_['remove'](_0x39cc65['ticket_fields'],function(_0x3b0d82){return _0x5e5cba[_0xbee5('0x66')](_0x3b0d82[_0xbee5('0x2c')]);});return{'count':_0x39cc65[_0xbee5('0x5b')][_0xbee5('0x34')],'rows':_[_0xbee5('0x29')](_0x39cc65[_0xbee5('0x5b')],function(_0x435b75){return{'id':_0x435b75['id'],'name':_0x435b75['position']>0x7?_0x435b75['title']:_0x435b75[_0xbee5('0x2c')],'custom':_0x435b75[_0xbee5('0x67')]>0x7?!![]:![],'options':_0x435b75['system_field_options']?_0x435b75['system_field_options']:_0x435b75[_0xbee5('0x68')]?_0x435b75['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x274a2c,null))[_0xbee5('0x41')](function(_0x525472){var _0x2b4ac9=_0x43452f[_0xbee5('0x31')]['test']?0x1f4:_0x525472[_0xbee5('0x69')]||0x1f4;logger[_0xbee5('0x25')](_0xbee5('0x6a'),_0xbee5('0x51'),_0x2b4ac9,JSON[_0xbee5('0x6b')](_0x525472));delete _0x525472['name'];if(_0x2b4ac9===0x191){_0x2b4ac9=0x190;}_0x274a2c['status'](_0x2b4ac9)[_0xbee5('0x27')](_0x43452f['query'][_0xbee5('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x525472[_0xbee5('0x69')]}:_0x525472);});}; \ No newline at end of file +var _0x1d2d=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','findAll','catch','includeAll','find','create','body','params','getConfigurations','ZendeskConfiguration','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','username','token','substring','lastIndexOf','GET','format','%s/%s','authType','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','Sequelize','subject','description','group','assignee','ticket_fields','includes'];(function(_0xe95829,_0x36decc){var _0xdaba40=function(_0x2fd0d1){while(--_0x2fd0d1){_0xe95829['push'](_0xe95829['shift']());}};_0xdaba40(++_0x36decc);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x1d7fb2,_0x292451){_0x1d7fb2=_0x1d7fb2-0x0;var _0x43ca01=_0x1d2d[_0x1d7fb2];return _0x43ca01;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];var integrations=require(_0xd1d2('0x1b'));function respondWithStatusCode(_0x129d8f,_0xc3ee82){_0xc3ee82=_0xc3ee82||0xcc;return function(_0x2df8a5){if(_0x2df8a5){return _0x129d8f[_0xd1d2('0x1c')](_0xc3ee82);}return _0x129d8f[_0xd1d2('0x1d')](_0xc3ee82)[_0xd1d2('0x1e')]();};}function respondWithResult(_0x4cf702,_0x2e7fec){_0x2e7fec=_0x2e7fec||0xc8;return function(_0x3c0296){if(_0x3c0296){return _0x4cf702[_0xd1d2('0x1d')](_0x2e7fec)['json'](_0x3c0296);}};}function respondWithFilteredResult(_0x35381b,_0xc36ce){return function(_0x208425){if(_0x208425){var _0x2f4cf9=typeof _0xc36ce[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0xc36ce[_0xd1d2('0x21')]==='undefined';var _0x539d5a=_0x208425[_0xd1d2('0x22')];var _0x55320b=_0x2f4cf9?0x0:_0xc36ce[_0xd1d2('0x1f')];var _0x42565b=_0x2f4cf9?_0x208425[_0xd1d2('0x22')]:_0xc36ce[_0xd1d2('0x1f')]+_0xc36ce['limit'];var _0x4f1201;if(_0x42565b>=_0x539d5a){_0x42565b=_0x539d5a;_0x4f1201=0xc8;}else{_0x4f1201=0xce;}_0x35381b[_0xd1d2('0x1d')](_0x4f1201);return _0x35381b['set']('Content-Range',_0x55320b+'-'+_0x42565b+'/'+_0x539d5a)[_0xd1d2('0x23')](_0x208425);}return null;};}function patchUpdates(_0x27e26b){return function(_0x3414ce){try{jsonpatch[_0xd1d2('0x24')](_0x3414ce,_0x27e26b,!![]);}catch(_0x596cd8){return BPromise[_0xd1d2('0x25')](_0x596cd8);}return _0x3414ce[_0xd1d2('0x26')]();};}function saveUpdates(_0x24b8db,_0x4eb082){return function(_0x59e72c){if(_0x59e72c){return _0x59e72c[_0xd1d2('0x27')](_0x24b8db)[_0xd1d2('0x28')](function(_0x19d535){return _0x19d535;});}return null;};}function removeEntity(_0x2f92ee,_0x3f229c){return function(_0x33a171){if(_0x33a171){return _0x33a171[_0xd1d2('0x29')]()['then'](function(){_0x2f92ee[_0xd1d2('0x1d')](0xcc)[_0xd1d2('0x1e')]();});}};}function handleEntityNotFound(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(!_0x5d3ee1){_0x41330f[_0xd1d2('0x1c')](0x194);}return _0x5d3ee1;};}function handleError(_0x28b8be,_0x34faf7){_0x34faf7=_0x34faf7||0x1f4;return function(_0xe6ef3c){logger[_0xd1d2('0x2a')](_0xe6ef3c[_0xd1d2('0x2b')]);if(_0xe6ef3c['name']){delete _0xe6ef3c['name'];}_0x28b8be[_0xd1d2('0x1d')](_0x34faf7)[_0xd1d2('0x2c')](_0xe6ef3c);};}exports[_0xd1d2('0x2d')]=function(_0x2b4c1f,_0xc815ea){var _0x48ade1={},_0x39d694={},_0x41171c={'count':0x0,'rows':[]};var _0x383947=_['map'](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0xbd855a){return{'name':_0xbd855a['fieldName'],'type':_0xbd855a[_0xd1d2('0x30')][_0xd1d2('0x31')]};});_0x39d694[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x383947,_0xd1d2('0x34'));_0x39d694[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0x2b4c1f[_0xd1d2('0x35')]);_0x39d694[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],_0x39d694[_0xd1d2('0x35')]);_0x48ade1[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x48ade1['attributes']=_0x48ade1[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x48ade1[_0xd1d2('0x39')]:_0x39d694['model'];if(!_0x2b4c1f[_0xd1d2('0x35')]['hasOwnProperty']('nolimit')){_0x48ade1[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x21')]);_0x48ade1[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x2b4c1f['query'][_0xd1d2('0x1f')]);}_0x48ade1[_0xd1d2('0x3c')]=qs['sort'](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x48ade1[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0x2b4c1f['query'],_0x39d694[_0xd1d2('0x37')]),_0x383947);if(_0x2b4c1f['query']['filter']){_0x48ade1['where']=_[_0xd1d2('0x3f')](_0x48ade1['where'],{'$or':_[_0xd1d2('0x33')](_0x383947,function(_0x4e7640){if(_0x4e7640['type']!=='VIRTUAL'){var _0x2dabfa={};_0x2dabfa[_0x4e7640[_0xd1d2('0x34')]]={'$like':'%'+_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x40')]+'%'};return _0x2dabfa;}})});}_0x48ade1=_[_0xd1d2('0x3f')]({},_0x48ade1,_0x2b4c1f[_0xd1d2('0x41')]);var _0x178f8b={'where':_0x48ade1[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x22')](_0x178f8b)[_0xd1d2('0x28')](function(_0x1fb5b5){_0x41171c[_0xd1d2('0x22')]=_0x1fb5b5;if(_0x2b4c1f[_0xd1d2('0x35')]['includeAll']){_0x48ade1['include']=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x42')](_0x48ade1);})[_0xd1d2('0x28')](function(_0x4d0fd9){_0x41171c['rows']=_0x4d0fd9;return _0x41171c;})[_0xd1d2('0x28')](respondWithFilteredResult(_0xc815ea,_0x48ade1))[_0xd1d2('0x43')](handleError(_0xc815ea,null));};exports['show']=function(_0x2fe92a,_0x4c5d49){var _0x5a3790={'raw':![],'where':{'id':_0x2fe92a['params']['id']}},_0x21eb24={};_0x21eb24['model']=_[_0xd1d2('0x36')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')]);_0x21eb24['query']=_[_0xd1d2('0x36')](_0x2fe92a[_0xd1d2('0x35')]);_0x21eb24[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x21eb24['model'],_0x21eb24[_0xd1d2('0x35')]);_0x5a3790[_0xd1d2('0x39')]=_['intersection'](_0x21eb24[_0xd1d2('0x32')],qs['fields'](_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x5a3790[_0xd1d2('0x39')]=_0x5a3790[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x5a3790['attributes']:_0x21eb24['model'];if(_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x44')]){_0x5a3790['include']=[{'all':!![]}];}_0x5a3790=_[_0xd1d2('0x3f')]({},_0x5a3790,_0x2fe92a[_0xd1d2('0x41')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x45')](_0x5a3790)[_0xd1d2('0x28')](handleEntityNotFound(_0x4c5d49,null))[_0xd1d2('0x28')](respondWithResult(_0x4c5d49,null))[_0xd1d2('0x43')](handleError(_0x4c5d49,null));};exports['create']=function(_0xed9e9,_0xc10c10){return db['ZendeskAccount'][_0xd1d2('0x46')](_0xed9e9[_0xd1d2('0x47')],{})['then'](respondWithResult(_0xc10c10,0xc9))['catch'](handleError(_0xc10c10,null));};exports[_0xd1d2('0x27')]=function(_0x182ea8,_0x4cb376){if(_0x182ea8[_0xd1d2('0x47')]['id']){delete _0x182ea8[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x45')]({'where':{'id':_0x182ea8[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cb376,null))['then'](saveUpdates(_0x182ea8[_0xd1d2('0x47')],null))['then'](respondWithResult(_0x4cb376,null))[_0xd1d2('0x43')](handleError(_0x4cb376,null));};exports[_0xd1d2('0x29')]=function(_0x4f4cb9,_0x389fcb){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x4f4cb9['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x389fcb,null))[_0xd1d2('0x28')](removeEntity(_0x389fcb,null))[_0xd1d2('0x43')](handleError(_0x389fcb,null));};exports[_0xd1d2('0x49')]=function(_0xa013ce,_0x34a793,_0x1f6150){var _0x3411c8={};var _0x33e332={};var _0x5e15cb;var _0x1958f3;return db['ZendeskAccount']['findOne']({'where':{'id':_0xa013ce[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x34a793,null))[_0xd1d2('0x28')](function(_0x47417f){if(_0x47417f){_0x5e15cb=_0x47417f;_0x33e332[_0xd1d2('0x32')]=_[_0xd1d2('0x36')](db[_0xd1d2('0x4a')][_0xd1d2('0x2f')]);_0x33e332[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0xa013ce[_0xd1d2('0x35')]);_0x33e332[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x33e332['model'],_0x33e332['query']);_0x3411c8[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x33e332[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x3411c8[_0xd1d2('0x39')]=_0x3411c8[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x3411c8[_0xd1d2('0x39')]:_0x33e332[_0xd1d2('0x32')];_0x3411c8['order']=qs['sort'](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x3411c8[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0xa013ce[_0xd1d2('0x35')],_0x33e332[_0xd1d2('0x37')]));if(_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x40')]){_0x3411c8[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3411c8[_0xd1d2('0x3e')],{'$or':_['map'](_0x3411c8[_0xd1d2('0x39')],function(_0x24d92c){var _0x1d8788={};_0x1d8788[_0x24d92c]={'$like':'%'+_0xa013ce['query']['filter']+'%'};return _0x1d8788;})});}_0x3411c8=_[_0xd1d2('0x3f')]({},_0x3411c8,_0xa013ce[_0xd1d2('0x41')]);return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0x598e6c){if(_0x598e6c){_0x1958f3=_0x598e6c[_0xd1d2('0x3b')];if(!_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x4b')]('nolimit')){_0x3411c8[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0xa013ce['query'][_0xd1d2('0x21')]);_0x3411c8[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xa013ce[_0xd1d2('0x35')]['offset']);}return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0xd82d10){if(_0xd82d10){return _0xd82d10?{'count':_0x1958f3,'rows':_0xd82d10}:null;}})[_0xd1d2('0x28')](respondWithResult(_0x34a793,null))[_0xd1d2('0x43')](handleError(_0x34a793,null));};exports['addConfiguration']=function(_0x47aa13,_0x500465,_0x541676){if(_0x47aa13['body']['id']){delete _0x47aa13[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x47aa13['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x500465,null))[_0xd1d2('0x28')](function(_0x22d617){if(_0x22d617){_0x47aa13['body'][_0xd1d2('0x4d')]=_0x22d617['id'];_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x4e')]=integrations[_0xd1d2('0x4f')](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13['body'][_0xd1d2('0x30')]);_0x47aa13[_0xd1d2('0x47')]['Descriptions']=integrations['getDescriptions'](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x30')]);return db['ZendeskConfiguration'][_0xd1d2('0x46')](_0x47aa13[_0xd1d2('0x47')],{'include':[{'model':db[_0xd1d2('0x51')],'as':_0xd1d2('0x4e')},{'model':db['ZendeskField'],'as':_0xd1d2('0x52')}]});}return null;})[_0xd1d2('0x28')](respondWithResult(_0x500465,null))[_0xd1d2('0x43')](handleError(_0x500465,null));};exports['getFields']=function(_0x46ff4d,_0x1ae9af,_0x4c35cb){var _0x2175ab='';return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x46ff4d[_0xd1d2('0x48')]['id']},'attributes':['id',_0xd1d2('0x53'),'password',_0xd1d2('0x54'),'authType','remoteUri']})['then'](handleEntityNotFound(_0x1ae9af,null))['then'](function(_0x89ec63){if(_0x89ec63){_0x2175ab=_0x89ec63['remoteUri'];var _0x37591f=_0x2175ab['slice'](-0x1);if(_0x37591f==='/'){_0x2175ab=_0x2175ab[_0xd1d2('0x55')](0x0,_0x2175ab[_0xd1d2('0x56')](_0x37591f));}var _0x16cc6c={'method':_0xd1d2('0x57'),'uri':util[_0xd1d2('0x58')](_0xd1d2('0x59'),_0x2175ab,'ticket_fields'),'json':!![]};switch(_0x89ec63[_0xd1d2('0x5a')]){case _0xd1d2('0x5b'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util[_0xd1d2('0x58')](_0xd1d2('0x5e'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x5b')]))[_0xd1d2('0x5f')]('base64'))};break;case _0xd1d2('0x54'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util['format'](_0xd1d2('0x60'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x54')]))['toString'](_0xd1d2('0x61')))};break;default:throw new db[(_0xd1d2('0x62'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x16cc6c);}})[_0xd1d2('0x28')](function(_0x268d6d){if(_0x268d6d){var _0x3fbd87=[_0xd1d2('0x63'),_0xd1d2('0x64'),_0xd1d2('0x65'),_0xd1d2('0x66')];_['remove'](_0x268d6d[_0xd1d2('0x67')],function(_0x9a98d4){return _0x3fbd87[_0xd1d2('0x68')](_0x9a98d4[_0xd1d2('0x30')]);});return{'count':_0x268d6d[_0xd1d2('0x67')][_0xd1d2('0x3b')],'rows':_[_0xd1d2('0x33')](_0x268d6d[_0xd1d2('0x67')],function(_0x44409e){return{'id':_0x44409e['id'],'name':_0x44409e[_0xd1d2('0x69')]>0x7?_0x44409e[_0xd1d2('0x6a')]:_0x44409e[_0xd1d2('0x30')],'custom':_0x44409e[_0xd1d2('0x69')]>0x7?!![]:![],'options':_0x44409e[_0xd1d2('0x6b')]?_0x44409e['system_field_options']:_0x44409e[_0xd1d2('0x6c')]?_0x44409e[_0xd1d2('0x6c')]:[]};})};}})[_0xd1d2('0x28')](respondWithResult(_0x1ae9af,null))[_0xd1d2('0x43')](function(_0x20a3f0){var _0x32c294=_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?0x1f4:_0x20a3f0[_0xd1d2('0x6e')]||0x1f4;logger[_0xd1d2('0x2a')](_0xd1d2('0x6f'),_0xd1d2('0x70'),_0x32c294,JSON[_0xd1d2('0x71')](_0x20a3f0));delete _0x20a3f0['name'];if(_0x32c294===0x191){_0x32c294=0x190;}_0x1ae9af[_0xd1d2('0x1d')](_0x32c294)[_0xd1d2('0x2c')](_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?{'message':_0xd1d2('0x72'),'statusCode':_0x20a3f0[_0xd1d2('0x6e')]}:_0x20a3f0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 0d9ae86..cc3ef9b 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 _0x1282=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x1ca316,_0x2e936a){var _0x45702f=function(_0x2d622d){while(--_0x2d622d){_0x1ca316['push'](_0x1ca316['shift']());}};_0x45702f(++_0x2e936a);}(_0x1282,0x94));var _0x2128=function(_0x4adc6d,_0x5a7a35){_0x4adc6d=_0x4adc6d-0x0;var _0x3d3165=_0x1282[_0x4adc6d];return _0x3d3165;};'use strict';var _=require(_0x2128('0x0'));var util=require(_0x2128('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2128('0x2'));var BPromise=require('bluebird');var rp=require(_0x2128('0x3'));var fs=require('fs');var path=require(_0x2128('0x4'));var rimraf=require(_0x2128('0x5'));var config=require(_0x2128('0x6'));var attributes=require(_0x2128('0x7'));var integrations=require(_0x2128('0x8'));module[_0x2128('0x9')]=function(_0x1446ef,_0x39742e){return _0x1446ef[_0x2128('0xa')](_0x2128('0xb'),attributes,{'tableName':_0x2128('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb77=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb77,0x19d));var _0x7db7=function(_0x39ee1c,_0x39b922){_0x39ee1c=_0x39ee1c-0x0;var _0x9cb66a=_0xdb77[_0x39ee1c];return _0x9cb66a;};'use strict';var _=require('lodash');var util=require(_0x7db7('0x0'));var logger=require(_0x7db7('0x1'))(_0x7db7('0x2'));var moment=require(_0x7db7('0x3'));var BPromise=require('bluebird');var rp=require(_0x7db7('0x4'));var fs=require('fs');var path=require(_0x7db7('0x5'));var rimraf=require(_0x7db7('0x6'));var config=require(_0x7db7('0x7'));var attributes=require(_0x7db7('0x8'));var integrations=require(_0x7db7('0x9'));module[_0x7db7('0xa')]=function(_0x441ffd,_0x448282){return _0x441ffd['define']('ZendeskAccount',attributes,{'tableName':_0x7db7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 425627a..84d44b4 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 _0x05dc=['ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','options','where','attributes','map','include','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info'];(function(_0x552b0c,_0x34d91f){var _0x5ca7d6=function(_0x2d8834){while(--_0x2d8834){_0x552b0c['push'](_0x552b0c['shift']());}};_0x5ca7d6(++_0x34d91f);}(_0x05dc,0xcd));var _0xc05d=function(_0x3f9606,_0x5b0a04){_0x3f9606=_0x3f9606-0x0;var _0x4487d6=_0x05dc[_0x3f9606];return _0x4487d6;};'use strict';var _=require(_0xc05d('0x0'));var util=require(_0xc05d('0x1'));var moment=require(_0xc05d('0x2'));var BPromise=require(_0xc05d('0x3'));var rs=require(_0xc05d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc05d('0x5'))['db'];var utils=require(_0xc05d('0x6'));var logger=require('../../config/logger')(_0xc05d('0x7'));var config=require('../../config/environment');var jayson=require(_0xc05d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x376ad4,_0x48dca3,_0x2b09d5){return new BPromise(function(_0x11fe6e,_0x14077d){return client[_0xc05d('0x9')](_0x376ad4,_0x2b09d5)[_0xc05d('0xa')](function(_0x51325e){logger[_0xc05d('0xb')](_0xc05d('0xc'),_0x48dca3,_0xc05d('0xd'));logger[_0xc05d('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x48dca3,_0xc05d('0xd'),JSON['stringify'](_0x51325e));if(_0x51325e['error']){if(_0x51325e['error'][_0xc05d('0xf')]===0x1f4){logger[_0xc05d('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x48dca3,_0x51325e[_0xc05d('0x10')][_0xc05d('0x11')]);return _0x14077d(_0x51325e['error'][_0xc05d('0x11')]);}logger[_0xc05d('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x48dca3,_0x51325e['error']['message']);return _0x11fe6e(_0x51325e[_0xc05d('0x10')][_0xc05d('0x11')]);}else{logger[_0xc05d('0xb')](_0xc05d('0xc'),_0x48dca3,_0xc05d('0xd'));_0x11fe6e(_0x51325e[_0xc05d('0x12')][_0xc05d('0x11')]);}})[_0xc05d('0x13')](function(_0x17b184){logger[_0xc05d('0x10')](_0xc05d('0xc'),_0x48dca3,_0x17b184);_0x14077d(_0x17b184);});});}exports['GetZendeskAccount']=function(_0x4cd66b){var _0x45dafb=this;return new Promise(function(_0x2e5a9b,_0x230ff9){return db['ZendeskAccount']['findAll']({'raw':_0x4cd66b[_0xc05d('0x14')]?_0x4cd66b[_0xc05d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4cd66b[_0xc05d('0x14')]?_0x4cd66b[_0xc05d('0x14')][_0xc05d('0x15')]||null:null,'attributes':_0x4cd66b[_0xc05d('0x14')]?_0x4cd66b[_0xc05d('0x14')][_0xc05d('0x16')]||null:null,'limit':_0x4cd66b[_0xc05d('0x14')]?_0x4cd66b[_0xc05d('0x14')]['limit']||null:null,'include':_0x4cd66b['options']?_0x4cd66b[_0xc05d('0x14')]['include']?_[_0xc05d('0x17')](_0x4cd66b['options'][_0xc05d('0x18')],function(_0x511ff0){return{'model':db[_0x511ff0[_0xc05d('0x19')]],'as':_0x511ff0['as'],'attributes':_0x511ff0[_0xc05d('0x16')],'include':_0x511ff0[_0xc05d('0x18')]?_[_0xc05d('0x17')](_0x511ff0[_0xc05d('0x18')],function(_0xeef9c0){return{'model':db[_0xeef9c0['model']],'as':_0xeef9c0['as'],'attributes':_0xeef9c0['attributes'],'include':_0xeef9c0[_0xc05d('0x18')]?_['map'](_0xeef9c0[_0xc05d('0x18')],function(_0x108549){return{'model':db[_0x108549[_0xc05d('0x19')]],'as':_0x108549['as'],'attributes':_0x108549['attributes']};}):[]};}):[]};}):[]:[]})[_0xc05d('0xa')](function(_0x452771){logger[_0xc05d('0xb')](_0xc05d('0x1a'),_0x4cd66b);logger[_0xc05d('0xe')](_0xc05d('0x1a'),_0x4cd66b,JSON[_0xc05d('0x1b')](_0x452771));_0x2e5a9b(_0x452771);})[_0xc05d('0x13')](function(_0x9f16d6){logger[_0xc05d('0x10')](_0xc05d('0x1a'),_0x9f16d6['message'],_0x4cd66b);_0x230ff9(_0x45dafb['error'](0x1f4,_0x9f16d6['message']));});});};exports[_0xc05d('0x1c')]=function(_0x54f278){var _0x20f2b2=this;return new Promise(function(_0x100b1f,_0xeb8ad7){return db['ZendeskAccount'][_0xc05d('0x1d')]({'raw':_0x54f278[_0xc05d('0x14')]?_0x54f278[_0xc05d('0x14')][_0xc05d('0x1e')]===undefined?!![]:![]:!![],'where':_0x54f278[_0xc05d('0x14')]?_0x54f278[_0xc05d('0x14')][_0xc05d('0x15')]||null:null,'attributes':_0x54f278[_0xc05d('0x14')]?_0x54f278['options'][_0xc05d('0x16')]||null:null,'include':_0x54f278[_0xc05d('0x14')]?_0x54f278['options']['include']?_[_0xc05d('0x17')](_0x54f278[_0xc05d('0x14')][_0xc05d('0x18')],function(_0xa0a928){return{'model':db[_0xa0a928['model']],'as':_0xa0a928['as'],'attributes':_0xa0a928[_0xc05d('0x16')],'include':_0xa0a928[_0xc05d('0x18')]?_[_0xc05d('0x17')](_0xa0a928['include'],function(_0x37a531){return{'model':db[_0x37a531[_0xc05d('0x19')]],'as':_0x37a531['as'],'attributes':_0x37a531[_0xc05d('0x16')],'include':_0x37a531[_0xc05d('0x18')]?_[_0xc05d('0x17')](_0x37a531['include'],function(_0x2034f4){return{'model':db[_0x2034f4[_0xc05d('0x19')]],'as':_0x2034f4['as'],'attributes':_0x2034f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a6170){logger[_0xc05d('0xb')]('ShowZendeskAccount',_0x54f278);logger['debug'](_0xc05d('0x1c'),_0x54f278,JSON[_0xc05d('0x1b')](_0x4a6170));_0x100b1f(_0x4a6170);})[_0xc05d('0x13')](function(_0x5627df){logger[_0xc05d('0x10')](_0xc05d('0x1c'),_0x5627df[_0xc05d('0x11')],_0x54f278);_0xeb8ad7(_0x20f2b2[_0xc05d('0x10')](0x1f4,_0x5627df[_0xc05d('0x11')]));});});}; \ No newline at end of file +var _0x9b11=['rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x314e30,_0x2348e2){var _0x356a19=function(_0xc20269){while(--_0xc20269){_0x314e30['push'](_0x314e30['shift']());}};_0x356a19(++_0x2348e2);}(_0x9b11,0xd6));var _0x19b1=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x9b11[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x19b1('0x0'));var util=require(_0x19b1('0x1'));var moment=require(_0x19b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x19b1('0x3'));var fs=require('fs');var Redis=require(_0x19b1('0x4'));var db=require(_0x19b1('0x5'))['db'];var utils=require(_0x19b1('0x6'));var logger=require(_0x19b1('0x7'))(_0x19b1('0x8'));var config=require(_0x19b1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19b1('0xa')][_0x19b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x439a4f,_0x451a1f,_0x3503e2){return new BPromise(function(_0x1c0f03,_0x17710e){return client[_0x19b1('0xc')](_0x439a4f,_0x3503e2)[_0x19b1('0xd')](function(_0x2ce6ea){logger[_0x19b1('0xe')](_0x19b1('0xf'),_0x451a1f,'request\x20sent');logger['debug'](_0x19b1('0x10'),_0x451a1f,_0x19b1('0x11'),JSON[_0x19b1('0x12')](_0x2ce6ea));if(_0x2ce6ea[_0x19b1('0x13')]){if(_0x2ce6ea[_0x19b1('0x13')][_0x19b1('0x14')]===0x1f4){logger[_0x19b1('0x13')](_0x19b1('0xf'),_0x451a1f,_0x2ce6ea[_0x19b1('0x13')][_0x19b1('0x15')]);return _0x17710e(_0x2ce6ea[_0x19b1('0x13')][_0x19b1('0x15')]);}logger['error'](_0x19b1('0xf'),_0x451a1f,_0x2ce6ea['error'][_0x19b1('0x15')]);return _0x1c0f03(_0x2ce6ea[_0x19b1('0x13')][_0x19b1('0x15')]);}else{logger[_0x19b1('0xe')](_0x19b1('0xf'),_0x451a1f,_0x19b1('0x11'));_0x1c0f03(_0x2ce6ea[_0x19b1('0x16')]['message']);}})['catch'](function(_0x56de6d){logger[_0x19b1('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x451a1f,_0x56de6d);_0x17710e(_0x56de6d);});});}exports[_0x19b1('0x17')]=function(_0x59d354){var _0x4d141b=this;return new Promise(function(_0x24f19c,_0x319a61){return db[_0x19b1('0x18')][_0x19b1('0x19')]({'raw':_0x59d354[_0x19b1('0x1a')]?_0x59d354[_0x19b1('0x1a')][_0x19b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x59d354[_0x19b1('0x1a')]?_0x59d354[_0x19b1('0x1a')][_0x19b1('0x1c')]||null:null,'attributes':_0x59d354[_0x19b1('0x1a')]?_0x59d354[_0x19b1('0x1a')][_0x19b1('0x1d')]||null:null,'limit':_0x59d354['options']?_0x59d354[_0x19b1('0x1a')][_0x19b1('0x1e')]||null:null,'include':_0x59d354[_0x19b1('0x1a')]?_0x59d354[_0x19b1('0x1a')][_0x19b1('0x1f')]?_[_0x19b1('0x20')](_0x59d354[_0x19b1('0x1a')]['include'],function(_0x44918d){return{'model':db[_0x44918d[_0x19b1('0x21')]],'as':_0x44918d['as'],'attributes':_0x44918d[_0x19b1('0x1d')],'include':_0x44918d[_0x19b1('0x1f')]?_[_0x19b1('0x20')](_0x44918d[_0x19b1('0x1f')],function(_0x4408c4){return{'model':db[_0x4408c4[_0x19b1('0x21')]],'as':_0x4408c4['as'],'attributes':_0x4408c4['attributes'],'include':_0x4408c4[_0x19b1('0x1f')]?_['map'](_0x4408c4['include'],function(_0x3156b6){return{'model':db[_0x3156b6['model']],'as':_0x3156b6['as'],'attributes':_0x3156b6['attributes']};}):[]};}):[]};}):[]:[]})[_0x19b1('0xd')](function(_0x16e025){logger[_0x19b1('0xe')](_0x19b1('0x17'),_0x59d354);logger['debug']('GetZendeskAccount',_0x59d354,JSON[_0x19b1('0x12')](_0x16e025));_0x24f19c(_0x16e025);})['catch'](function(_0x5f163a){logger[_0x19b1('0x13')](_0x19b1('0x17'),_0x5f163a[_0x19b1('0x15')],_0x59d354);_0x319a61(_0x4d141b[_0x19b1('0x13')](0x1f4,_0x5f163a[_0x19b1('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x246ddc){var _0xdf3ad=this;return new Promise(function(_0x4b3a7d,_0x4fa943){return db['ZendeskAccount']['find']({'raw':_0x246ddc['options']?_0x246ddc[_0x19b1('0x1a')][_0x19b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x246ddc['options']?_0x246ddc['options'][_0x19b1('0x1c')]||null:null,'attributes':_0x246ddc[_0x19b1('0x1a')]?_0x246ddc['options']['attributes']||null:null,'include':_0x246ddc[_0x19b1('0x1a')]?_0x246ddc['options'][_0x19b1('0x1f')]?_[_0x19b1('0x20')](_0x246ddc[_0x19b1('0x1a')][_0x19b1('0x1f')],function(_0x3dea78){return{'model':db[_0x3dea78['model']],'as':_0x3dea78['as'],'attributes':_0x3dea78[_0x19b1('0x1d')],'include':_0x3dea78[_0x19b1('0x1f')]?_[_0x19b1('0x20')](_0x3dea78[_0x19b1('0x1f')],function(_0x3caf6c){return{'model':db[_0x3caf6c[_0x19b1('0x21')]],'as':_0x3caf6c['as'],'attributes':_0x3caf6c[_0x19b1('0x1d')],'include':_0x3caf6c['include']?_[_0x19b1('0x20')](_0x3caf6c['include'],function(_0xe6f228){return{'model':db[_0xe6f228[_0x19b1('0x21')]],'as':_0xe6f228['as'],'attributes':_0xe6f228['attributes']};}):[]};}):[]};}):[]:[]})[_0x19b1('0xd')](function(_0x495bab){logger['info'](_0x19b1('0x22'),_0x246ddc);logger[_0x19b1('0x23')](_0x19b1('0x22'),_0x246ddc,JSON[_0x19b1('0x12')](_0x495bab));_0x4b3a7d(_0x495bab);})[_0x19b1('0x24')](function(_0x41e3b2){logger[_0x19b1('0x13')]('ShowZendeskAccount',_0x41e3b2[_0x19b1('0x15')],_0x246ddc);_0x4fa943(_0xdf3ad[_0x19b1('0x13')](0x1f4,_0x41e3b2[_0x19b1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 0ea79aa..8fecec7 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0xf6d7f2,_0x3016af){var _0x5282a4=function(_0x255f26){while(--_0x255f26){_0xf6d7f2['push'](_0xf6d7f2['shift']());}};_0x5282a4(++_0x3016af);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d763d,_0x2e9bec){_0x4d763d=_0x4d763d-0x0;var _0x3e74b7=_0xb10b[_0x4d763d];return _0x3e74b7;};'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['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +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(_0x4232a5,_0x1a326f){var _0x1dafb3=function(_0x488e16){while(--_0x488e16){_0x4232a5['push'](_0x4232a5['shift']());}};_0x1dafb3(++_0x1a326f);}(_0xda3f,0xec));var _0xfda3=function(_0x2f712c,_0x2956a6){_0x2f712c=_0x2f712c-0x0;var _0xd35e30=_0xda3f[_0x2f712c];return _0xd35e30;};'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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 76d5604..f6006cb 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 _0xd31d=['exports','STRING','sequelize'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0xd31d,0x1c1));var _0xdd31=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xd31d[_0x5037ab];return _0x512adb;};'use strict';var Sequelize=require(_0xdd31('0x0'));module[_0xdd31('0x1')]={'name':{'type':Sequelize[_0xdd31('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd69f=['sequelize','STRING'];(function(_0x246890,_0x46b964){var _0x2b2a5a=function(_0x4f1232){while(--_0x4f1232){_0x246890['push'](_0x246890['shift']());}};_0x2b2a5a(++_0x46b964);}(_0xd69f,0x13c));var _0xfd69=function(_0x4be912,_0x455a3a){_0x4be912=_0x4be912-0x0;var _0x33987e=_0xd69f[_0x4be912];return _0x33987e;};'use strict';var Sequelize=require(_0xfd69('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfd69('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index a6e2818..9b79d19 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 _0x3268=['map','ZendeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','findOne','getFields','getSubjects','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x3268,0xd6));var _0x8326=function(_0x8b5d15,_0x27b4c0){_0x8b5d15=_0x8b5d15-0x0;var _0x4ba000=_0x3268[_0x8b5d15];return _0x4ba000;};'use strict';var emlformat=require(_0x8326('0x0'));var rimraf=require(_0x8326('0x1'));var zipdir=require(_0x8326('0x2'));var jsonpatch=require(_0x8326('0x3'));var rp=require(_0x8326('0x4'));var moment=require(_0x8326('0x5'));var BPromise=require(_0x8326('0x6'));var Mustache=require(_0x8326('0x7'));var util=require(_0x8326('0x8'));var path=require(_0x8326('0x9'));var sox=require(_0x8326('0xa'));var csv=require('to-csv');var ejs=require(_0x8326('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8326('0xc'));var squel=require(_0x8326('0xd'));var crypto=require('crypto');var jsforce=require(_0x8326('0xe'));var deskjs=require(_0x8326('0xf'));var toCsv=require(_0x8326('0x10'));var querystring=require(_0x8326('0x11'));var Papa=require(_0x8326('0x12'));var Redis=require(_0x8326('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8326('0x14'));var as=require(_0x8326('0x15'));var hardwareService=require(_0x8326('0x16'));var logger=require(_0x8326('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x8326('0x18'));var licenseUtil=require(_0x8326('0x19'));var db=require(_0x8326('0x1a'))['db'];function respondWithStatusCode(_0x5d371c,_0x16c327){_0x16c327=_0x16c327||0xcc;return function(_0x806051){if(_0x806051){return _0x5d371c[_0x8326('0x1b')](_0x16c327);}return _0x5d371c[_0x8326('0x1c')](_0x16c327)[_0x8326('0x1d')]();};}function respondWithResult(_0x5b5a55,_0x287a99){_0x287a99=_0x287a99||0xc8;return function(_0x4392d2){if(_0x4392d2){return _0x5b5a55[_0x8326('0x1c')](_0x287a99)['json'](_0x4392d2);}};}function respondWithFilteredResult(_0x43809f,_0x33dab7){return function(_0x2164cb){if(_0x2164cb){var _0x5ea083=typeof _0x33dab7[_0x8326('0x1e')]===_0x8326('0x1f')&&typeof _0x33dab7['limit']===_0x8326('0x1f');var _0x1aa4af=_0x2164cb['count'];var _0x4cb407=_0x5ea083?0x0:_0x33dab7[_0x8326('0x1e')];var _0x462434=_0x5ea083?_0x2164cb[_0x8326('0x20')]:_0x33dab7[_0x8326('0x1e')]+_0x33dab7[_0x8326('0x21')];var _0x2b3484;if(_0x462434>=_0x1aa4af){_0x462434=_0x1aa4af;_0x2b3484=0xc8;}else{_0x2b3484=0xce;}_0x43809f[_0x8326('0x1c')](_0x2b3484);return _0x43809f[_0x8326('0x22')](_0x8326('0x23'),_0x4cb407+'-'+_0x462434+'/'+_0x1aa4af)['json'](_0x2164cb);}return null;};}function patchUpdates(_0x277a07){return function(_0x55a812){try{jsonpatch[_0x8326('0x24')](_0x55a812,_0x277a07,!![]);}catch(_0x525967){return BPromise[_0x8326('0x25')](_0x525967);}return _0x55a812[_0x8326('0x26')]();};}function saveUpdates(_0x4ca010,_0x173e82){return function(_0x456058){if(_0x456058){return _0x456058[_0x8326('0x27')](_0x4ca010)[_0x8326('0x28')](function(_0x350946){return _0x350946;});}return null;};}function removeEntity(_0xc3c0f0,_0x52c8d2){return function(_0x4586bb){if(_0x4586bb){return _0x4586bb[_0x8326('0x29')]()['then'](function(){_0xc3c0f0['status'](0xcc)[_0x8326('0x1d')]();});}};}function handleEntityNotFound(_0x5b9ae3,_0x1566df){return function(_0x1e2019){if(!_0x1e2019){_0x5b9ae3[_0x8326('0x1b')](0x194);}return _0x1e2019;};}function handleError(_0x337a2,_0x19caad){_0x19caad=_0x19caad||0x1f4;return function(_0x8eeaf7){logger[_0x8326('0x2a')](_0x8eeaf7[_0x8326('0x2b')]);if(_0x8eeaf7['name']){delete _0x8eeaf7[_0x8326('0x2c')];}_0x337a2[_0x8326('0x1c')](_0x19caad)[_0x8326('0x2d')](_0x8eeaf7);};}exports[_0x8326('0x2e')]=function(_0x1733a7,_0x386103){var _0x3f0dd7={},_0x1d5e6b={},_0x45edc2={'count':0x0,'rows':[]};var _0x3ee433=_[_0x8326('0x2f')](db[_0x8326('0x30')][_0x8326('0x31')],function(_0x370d6a){return{'name':_0x370d6a[_0x8326('0x32')],'type':_0x370d6a['type'][_0x8326('0x33')]};});_0x1d5e6b[_0x8326('0x34')]=_[_0x8326('0x2f')](_0x3ee433,_0x8326('0x2c'));_0x1d5e6b['query']=_[_0x8326('0x35')](_0x1733a7[_0x8326('0x36')]);_0x1d5e6b[_0x8326('0x37')]=_[_0x8326('0x38')](_0x1d5e6b['model'],_0x1d5e6b['query']);_0x3f0dd7[_0x8326('0x39')]=_[_0x8326('0x38')](_0x1d5e6b[_0x8326('0x34')],qs[_0x8326('0x3a')](_0x1733a7['query']['fields']));_0x3f0dd7[_0x8326('0x39')]=_0x3f0dd7[_0x8326('0x39')][_0x8326('0x3b')]?_0x3f0dd7[_0x8326('0x39')]:_0x1d5e6b[_0x8326('0x34')];if(!_0x1733a7[_0x8326('0x36')][_0x8326('0x3c')](_0x8326('0x3d'))){_0x3f0dd7['limit']=qs[_0x8326('0x21')](_0x1733a7[_0x8326('0x36')][_0x8326('0x21')]);_0x3f0dd7[_0x8326('0x1e')]=qs[_0x8326('0x1e')](_0x1733a7['query'][_0x8326('0x1e')]);}_0x3f0dd7[_0x8326('0x3e')]=qs['sort'](_0x1733a7['query'][_0x8326('0x3f')]);_0x3f0dd7[_0x8326('0x40')]=qs[_0x8326('0x37')](_[_0x8326('0x41')](_0x1733a7[_0x8326('0x36')],_0x1d5e6b[_0x8326('0x37')]),_0x3ee433);if(_0x1733a7[_0x8326('0x36')]['filter']){_0x3f0dd7[_0x8326('0x40')]=_[_0x8326('0x42')](_0x3f0dd7[_0x8326('0x40')],{'$or':_['map'](_0x3ee433,function(_0x101c70){if(_0x101c70[_0x8326('0x43')]!=='VIRTUAL'){var _0x277e9f={};_0x277e9f[_0x101c70['name']]={'$like':'%'+_0x1733a7[_0x8326('0x36')][_0x8326('0x44')]+'%'};return _0x277e9f;}})});}_0x3f0dd7=_['merge']({},_0x3f0dd7,_0x1733a7[_0x8326('0x45')]);var _0x24fba9={'where':_0x3f0dd7[_0x8326('0x40')]};return db['ZendeskConfiguration'][_0x8326('0x20')](_0x24fba9)[_0x8326('0x28')](function(_0x320de3){_0x45edc2[_0x8326('0x20')]=_0x320de3;if(_0x1733a7[_0x8326('0x36')][_0x8326('0x46')]){_0x3f0dd7['include']=[{'all':!![]}];}return db[_0x8326('0x30')][_0x8326('0x47')](_0x3f0dd7);})[_0x8326('0x28')](function(_0x563846){_0x45edc2[_0x8326('0x48')]=_0x563846;return _0x45edc2;})[_0x8326('0x28')](respondWithFilteredResult(_0x386103,_0x3f0dd7))['catch'](handleError(_0x386103,null));};exports[_0x8326('0x49')]=function(_0xc2ede8,_0x1e2b3c){var _0x3452cc={'raw':![],'where':{'id':_0xc2ede8[_0x8326('0x4a')]['id']}},_0x5df242={};_0x5df242['model']=_[_0x8326('0x35')](db[_0x8326('0x30')][_0x8326('0x31')]);_0x5df242['query']=_[_0x8326('0x35')](_0xc2ede8['query']);_0x5df242['filters']=_[_0x8326('0x38')](_0x5df242['model'],_0x5df242[_0x8326('0x36')]);_0x3452cc[_0x8326('0x39')]=_[_0x8326('0x38')](_0x5df242[_0x8326('0x34')],qs[_0x8326('0x3a')](_0xc2ede8[_0x8326('0x36')]['fields']));_0x3452cc['attributes']=_0x3452cc[_0x8326('0x39')][_0x8326('0x3b')]?_0x3452cc['attributes']:_0x5df242[_0x8326('0x34')];if(_0xc2ede8[_0x8326('0x36')][_0x8326('0x46')]){_0x3452cc[_0x8326('0x4b')]=[{'all':!![]}];}_0x3452cc=_[_0x8326('0x42')]({},_0x3452cc,_0xc2ede8[_0x8326('0x45')]);return db[_0x8326('0x30')][_0x8326('0x4c')](_0x3452cc)[_0x8326('0x28')](handleEntityNotFound(_0x1e2b3c,null))['then'](respondWithResult(_0x1e2b3c,null))[_0x8326('0x4d')](handleError(_0x1e2b3c,null));};exports[_0x8326('0x4e')]=function(_0x2db7cb,_0x104aea){return db['ZendeskConfiguration'][_0x8326('0x4e')](_0x2db7cb['body'],{})[_0x8326('0x28')](respondWithResult(_0x104aea,0xc9))[_0x8326('0x4d')](handleError(_0x104aea,null));};exports['update']=function(_0xfb4de9,_0x8c7290){if(_0xfb4de9[_0x8326('0x4f')]['id']){delete _0xfb4de9[_0x8326('0x4f')]['id'];}return db[_0x8326('0x30')][_0x8326('0x4c')]({'where':{'id':_0xfb4de9[_0x8326('0x4a')]['id']}})[_0x8326('0x28')](handleEntityNotFound(_0x8c7290,null))['then'](saveUpdates(_0xfb4de9[_0x8326('0x4f')],null))[_0x8326('0x28')](respondWithResult(_0x8c7290,null))['catch'](handleError(_0x8c7290,null));};exports[_0x8326('0x29')]=function(_0x23b7d2,_0x1d2b69){return db[_0x8326('0x30')][_0x8326('0x4c')]({'where':{'id':_0x23b7d2['params']['id']}})['then'](handleEntityNotFound(_0x1d2b69,null))[_0x8326('0x28')](removeEntity(_0x1d2b69,null))['catch'](handleError(_0x1d2b69,null));};exports['getFields']=function(_0x1ec82f,_0x2d5ed4,_0x4170d9){var _0x12b240={};var _0x2d50ef={};var _0x1e6253;var _0x20ca82;return db['ZendeskConfiguration'][_0x8326('0x50')]({'where':{'id':_0x1ec82f[_0x8326('0x4a')]['id']}})[_0x8326('0x28')](handleEntityNotFound(_0x2d5ed4,null))[_0x8326('0x28')](function(_0x247d29){if(_0x247d29){_0x1e6253=_0x247d29;_0x2d50ef[_0x8326('0x34')]=_[_0x8326('0x35')](db['ZendeskField']['rawAttributes']);_0x2d50ef[_0x8326('0x36')]=_[_0x8326('0x35')](_0x1ec82f['query']);_0x2d50ef[_0x8326('0x37')]=_[_0x8326('0x38')](_0x2d50ef[_0x8326('0x34')],_0x2d50ef[_0x8326('0x36')]);_0x12b240[_0x8326('0x39')]=_[_0x8326('0x38')](_0x2d50ef['model'],qs[_0x8326('0x3a')](_0x1ec82f[_0x8326('0x36')][_0x8326('0x3a')]));_0x12b240[_0x8326('0x39')]=_0x12b240[_0x8326('0x39')][_0x8326('0x3b')]?_0x12b240[_0x8326('0x39')]:_0x2d50ef[_0x8326('0x34')];_0x12b240[_0x8326('0x3e')]=qs['sort'](_0x1ec82f[_0x8326('0x36')][_0x8326('0x3f')]);_0x12b240[_0x8326('0x40')]=qs['filters'](_[_0x8326('0x41')](_0x1ec82f[_0x8326('0x36')],_0x2d50ef['filters']));if(_0x1ec82f[_0x8326('0x36')][_0x8326('0x44')]){_0x12b240['where']=_[_0x8326('0x42')](_0x12b240[_0x8326('0x40')],{'$or':_['map'](_0x12b240[_0x8326('0x39')],function(_0x4d71ae){var _0x444306={};_0x444306[_0x4d71ae]={'$like':'%'+_0x1ec82f[_0x8326('0x36')][_0x8326('0x44')]+'%'};return _0x444306;})});}_0x12b240=_['merge']({},_0x12b240,_0x1ec82f[_0x8326('0x45')]);return _0x1e6253[_0x8326('0x51')](_0x12b240);}})['then'](function(_0xbc99de){if(_0xbc99de){_0x20ca82=_0xbc99de[_0x8326('0x3b')];if(!_0x1ec82f[_0x8326('0x36')][_0x8326('0x3c')](_0x8326('0x3d'))){_0x12b240[_0x8326('0x21')]=qs[_0x8326('0x21')](_0x1ec82f[_0x8326('0x36')]['limit']);_0x12b240[_0x8326('0x1e')]=qs[_0x8326('0x1e')](_0x1ec82f[_0x8326('0x36')][_0x8326('0x1e')]);}return _0x1e6253[_0x8326('0x51')](_0x12b240);}})['then'](function(_0x449f47){if(_0x449f47){return _0x449f47?{'count':_0x20ca82,'rows':_0x449f47}:null;}})[_0x8326('0x28')](respondWithResult(_0x2d5ed4,null))[_0x8326('0x4d')](handleError(_0x2d5ed4,null));};exports[_0x8326('0x52')]=function(_0x4f48b9,_0x419c5e,_0x4a0cf0){var _0x6b0669={};var _0x32cf5b={};var _0x3f925f;var _0x222c85;return db[_0x8326('0x30')][_0x8326('0x50')]({'where':{'id':_0x4f48b9['params']['id']}})[_0x8326('0x28')](handleEntityNotFound(_0x419c5e,null))[_0x8326('0x28')](function(_0x3ca877){if(_0x3ca877){_0x3f925f=_0x3ca877;_0x32cf5b[_0x8326('0x34')]=_[_0x8326('0x35')](db['ZendeskField'][_0x8326('0x31')]);_0x32cf5b[_0x8326('0x36')]=_[_0x8326('0x35')](_0x4f48b9[_0x8326('0x36')]);_0x32cf5b['filters']=_[_0x8326('0x38')](_0x32cf5b['model'],_0x32cf5b[_0x8326('0x36')]);_0x6b0669[_0x8326('0x39')]=_['intersection'](_0x32cf5b[_0x8326('0x34')],qs[_0x8326('0x3a')](_0x4f48b9[_0x8326('0x36')][_0x8326('0x3a')]));_0x6b0669[_0x8326('0x39')]=_0x6b0669[_0x8326('0x39')]['length']?_0x6b0669[_0x8326('0x39')]:_0x32cf5b[_0x8326('0x34')];_0x6b0669[_0x8326('0x3e')]=qs[_0x8326('0x3f')](_0x4f48b9[_0x8326('0x36')][_0x8326('0x3f')]);_0x6b0669[_0x8326('0x40')]=qs[_0x8326('0x37')](_[_0x8326('0x41')](_0x4f48b9[_0x8326('0x36')],_0x32cf5b[_0x8326('0x37')]));if(_0x4f48b9[_0x8326('0x36')]['filter']){_0x6b0669[_0x8326('0x40')]=_[_0x8326('0x42')](_0x6b0669[_0x8326('0x40')],{'$or':_['map'](_0x6b0669[_0x8326('0x39')],function(_0x33b8fe){var _0x3f501e={};_0x3f501e[_0x33b8fe]={'$like':'%'+_0x4f48b9[_0x8326('0x36')][_0x8326('0x44')]+'%'};return _0x3f501e;})});}_0x6b0669=_[_0x8326('0x42')]({},_0x6b0669,_0x4f48b9[_0x8326('0x45')]);return _0x3f925f[_0x8326('0x52')](_0x6b0669);}})['then'](function(_0x35aa64){if(_0x35aa64){_0x222c85=_0x35aa64['length'];if(!_0x4f48b9[_0x8326('0x36')][_0x8326('0x3c')]('nolimit')){_0x6b0669[_0x8326('0x21')]=qs['limit'](_0x4f48b9[_0x8326('0x36')][_0x8326('0x21')]);_0x6b0669[_0x8326('0x1e')]=qs[_0x8326('0x1e')](_0x4f48b9[_0x8326('0x36')]['offset']);}return _0x3f925f['getSubjects'](_0x6b0669);}})['then'](function(_0x50d060){if(_0x50d060){return _0x50d060?{'count':_0x222c85,'rows':_0x50d060}:null;}})['then'](respondWithResult(_0x419c5e,null))['catch'](handleError(_0x419c5e,null));};exports['getDescriptions']=function(_0x42fe02,_0x51313d,_0x3fc898){var _0x2b3fe4={};var _0x15756d={};var _0x7780ef;var _0x125427;return db[_0x8326('0x30')][_0x8326('0x50')]({'where':{'id':_0x42fe02[_0x8326('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51313d,null))['then'](function(_0x1e72a4){if(_0x1e72a4){_0x7780ef=_0x1e72a4;_0x15756d[_0x8326('0x34')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x15756d[_0x8326('0x36')]=_['keys'](_0x42fe02[_0x8326('0x36')]);_0x15756d[_0x8326('0x37')]=_['intersection'](_0x15756d[_0x8326('0x34')],_0x15756d['query']);_0x2b3fe4[_0x8326('0x39')]=_[_0x8326('0x38')](_0x15756d[_0x8326('0x34')],qs['fields'](_0x42fe02[_0x8326('0x36')]['fields']));_0x2b3fe4[_0x8326('0x39')]=_0x2b3fe4[_0x8326('0x39')][_0x8326('0x3b')]?_0x2b3fe4[_0x8326('0x39')]:_0x15756d[_0x8326('0x34')];_0x2b3fe4[_0x8326('0x3e')]=qs[_0x8326('0x3f')](_0x42fe02[_0x8326('0x36')][_0x8326('0x3f')]);_0x2b3fe4[_0x8326('0x40')]=qs['filters'](_['pick'](_0x42fe02[_0x8326('0x36')],_0x15756d[_0x8326('0x37')]));if(_0x42fe02[_0x8326('0x36')][_0x8326('0x44')]){_0x2b3fe4['where']=_['merge'](_0x2b3fe4[_0x8326('0x40')],{'$or':_['map'](_0x2b3fe4[_0x8326('0x39')],function(_0x5c7273){var _0x2d9eaa={};_0x2d9eaa[_0x5c7273]={'$like':'%'+_0x42fe02[_0x8326('0x36')][_0x8326('0x44')]+'%'};return _0x2d9eaa;})});}_0x2b3fe4=_['merge']({},_0x2b3fe4,_0x42fe02[_0x8326('0x45')]);return _0x7780ef['getDescriptions'](_0x2b3fe4);}})[_0x8326('0x28')](function(_0x24cab5){if(_0x24cab5){_0x125427=_0x24cab5[_0x8326('0x3b')];if(!_0x42fe02[_0x8326('0x36')][_0x8326('0x3c')]('nolimit')){_0x2b3fe4[_0x8326('0x21')]=qs[_0x8326('0x21')](_0x42fe02[_0x8326('0x36')][_0x8326('0x21')]);_0x2b3fe4[_0x8326('0x1e')]=qs['offset'](_0x42fe02['query'][_0x8326('0x1e')]);}return _0x7780ef['getDescriptions'](_0x2b3fe4);}})[_0x8326('0x28')](function(_0x57eb65){if(_0x57eb65){return _0x57eb65?{'count':_0x125427,'rows':_0x57eb65}:null;}})[_0x8326('0x28')](respondWithResult(_0x51313d,null))['catch'](handleError(_0x51313d,null));};exports[_0x8326('0x53')]=function(_0x476d0d,_0x2e8ec4,_0x268c64){var _0x49ea8e={};var _0x53bfb4={};var _0x38f669;var _0x512be2;return db[_0x8326('0x30')]['findOne']({'where':{'id':_0x476d0d[_0x8326('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e8ec4,null))[_0x8326('0x28')](function(_0x2055a0){if(_0x2055a0){_0x38f669=_0x2055a0;_0x53bfb4['model']=_['keys'](db[_0x8326('0x54')][_0x8326('0x31')]);_0x53bfb4['query']=_['keys'](_0x476d0d[_0x8326('0x36')]);_0x53bfb4[_0x8326('0x37')]=_['intersection'](_0x53bfb4[_0x8326('0x34')],_0x53bfb4['query']);_0x49ea8e[_0x8326('0x39')]=_[_0x8326('0x38')](_0x53bfb4['model'],qs[_0x8326('0x3a')](_0x476d0d['query'][_0x8326('0x3a')]));_0x49ea8e['attributes']=_0x49ea8e[_0x8326('0x39')][_0x8326('0x3b')]?_0x49ea8e[_0x8326('0x39')]:_0x53bfb4[_0x8326('0x34')];_0x49ea8e[_0x8326('0x3e')]=qs['sort'](_0x476d0d[_0x8326('0x36')][_0x8326('0x3f')]);_0x49ea8e[_0x8326('0x40')]=qs[_0x8326('0x37')](_[_0x8326('0x41')](_0x476d0d[_0x8326('0x36')],_0x53bfb4[_0x8326('0x37')]));if(_0x476d0d[_0x8326('0x36')][_0x8326('0x44')]){_0x49ea8e[_0x8326('0x40')]=_[_0x8326('0x42')](_0x49ea8e[_0x8326('0x40')],{'$or':_[_0x8326('0x2f')](_0x49ea8e[_0x8326('0x39')],function(_0x3733f0){var _0x4b34dd={};_0x4b34dd[_0x3733f0]={'$like':'%'+_0x476d0d[_0x8326('0x36')][_0x8326('0x44')]+'%'};return _0x4b34dd;})});}_0x49ea8e=_[_0x8326('0x42')]({},_0x49ea8e,_0x476d0d[_0x8326('0x45')]);return _0x38f669[_0x8326('0x53')](_0x49ea8e);}})[_0x8326('0x28')](function(_0x1e8e96){if(_0x1e8e96){_0x512be2=_0x1e8e96[_0x8326('0x3b')];if(!_0x476d0d[_0x8326('0x36')][_0x8326('0x3c')](_0x8326('0x3d'))){_0x49ea8e[_0x8326('0x21')]=qs[_0x8326('0x21')](_0x476d0d[_0x8326('0x36')][_0x8326('0x21')]);_0x49ea8e[_0x8326('0x1e')]=qs[_0x8326('0x1e')](_0x476d0d[_0x8326('0x36')][_0x8326('0x1e')]);}return _0x38f669['getTags'](_0x49ea8e);}})[_0x8326('0x28')](function(_0x1fb148){if(_0x1fb148){return _0x1fb148?{'count':_0x512be2,'rows':_0x1fb148}:null;}})[_0x8326('0x28')](respondWithResult(_0x2e8ec4,null))['catch'](handleError(_0x2e8ec4,null));};exports['setTags']=function(_0x14bf9a,_0x12e2b6,_0x2cb552){if(_0x14bf9a[_0x8326('0x4f')]['id']){delete _0x14bf9a['body']['id'];}return db[_0x8326('0x30')][_0x8326('0x50')]({'where':{'id':_0x14bf9a[_0x8326('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12e2b6,null))[_0x8326('0x28')](function(_0x13a796){if(_0x13a796){return _0x13a796[_0x8326('0x55')](_0x14bf9a[_0x8326('0x4f')][_0x8326('0x56')]||[]);}return null;})[_0x8326('0x28')](respondWithResult(_0x12e2b6,null))[_0x8326('0x4d')](handleError(_0x12e2b6,null));}; \ No newline at end of file +var _0x827b=['sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','ZendeskConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x827b,0x19e));var _0xb827=function(_0xc0a3e1,_0x255176){_0xc0a3e1=_0xc0a3e1-0x0;var _0x302bb1=_0x827b[_0xc0a3e1];return _0x302bb1;};'use strict';var emlformat=require(_0xb827('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb827('0x1'));var jsonpatch=require(_0xb827('0x2'));var rp=require(_0xb827('0x3'));var moment=require(_0xb827('0x4'));var BPromise=require(_0xb827('0x5'));var Mustache=require(_0xb827('0x6'));var util=require(_0xb827('0x7'));var path=require(_0xb827('0x8'));var sox=require(_0xb827('0x9'));var csv=require(_0xb827('0xa'));var ejs=require(_0xb827('0xb'));var fs=require('fs');var fs_extra=require(_0xb827('0xc'));var _=require('lodash');var squel=require(_0xb827('0xd'));var crypto=require(_0xb827('0xe'));var jsforce=require(_0xb827('0xf'));var deskjs=require(_0xb827('0x10'));var toCsv=require(_0xb827('0xa'));var querystring=require(_0xb827('0x11'));var Papa=require(_0xb827('0x12'));var Redis=require(_0xb827('0x13'));var authService=require(_0xb827('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb827('0x15'));var logger=require('../../config/logger')(_0xb827('0x16'));var utils=require(_0xb827('0x17'));var config=require(_0xb827('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb827('0x19'))['db'];function respondWithStatusCode(_0x4b1e39,_0x3e17c8){_0x3e17c8=_0x3e17c8||0xcc;return function(_0x38fc43){if(_0x38fc43){return _0x4b1e39[_0xb827('0x1a')](_0x3e17c8);}return _0x4b1e39[_0xb827('0x1b')](_0x3e17c8)['end']();};}function respondWithResult(_0x16bcb7,_0x5155d4){_0x5155d4=_0x5155d4||0xc8;return function(_0x572b94){if(_0x572b94){return _0x16bcb7[_0xb827('0x1b')](_0x5155d4)[_0xb827('0x1c')](_0x572b94);}};}function respondWithFilteredResult(_0x1c278d,_0x54555e){return function(_0x2d19a8){if(_0x2d19a8){var _0x4cf651=typeof _0x54555e['offset']===_0xb827('0x1d')&&typeof _0x54555e[_0xb827('0x1e')]===_0xb827('0x1d');var _0x4fa025=_0x2d19a8[_0xb827('0x1f')];var _0x19b75e=_0x4cf651?0x0:_0x54555e[_0xb827('0x20')];var _0x40f2bc=_0x4cf651?_0x2d19a8[_0xb827('0x1f')]:_0x54555e[_0xb827('0x20')]+_0x54555e[_0xb827('0x1e')];var _0x104407;if(_0x40f2bc>=_0x4fa025){_0x40f2bc=_0x4fa025;_0x104407=0xc8;}else{_0x104407=0xce;}_0x1c278d['status'](_0x104407);return _0x1c278d[_0xb827('0x21')](_0xb827('0x22'),_0x19b75e+'-'+_0x40f2bc+'/'+_0x4fa025)[_0xb827('0x1c')](_0x2d19a8);}return null;};}function patchUpdates(_0x3daabd){return function(_0xeba2d9){try{jsonpatch[_0xb827('0x23')](_0xeba2d9,_0x3daabd,!![]);}catch(_0x598d5a){return BPromise[_0xb827('0x24')](_0x598d5a);}return _0xeba2d9[_0xb827('0x25')]();};}function saveUpdates(_0x1e6971,_0x5e2618){return function(_0x532f83){if(_0x532f83){return _0x532f83[_0xb827('0x26')](_0x1e6971)[_0xb827('0x27')](function(_0x437335){return _0x437335;});}return null;};}function removeEntity(_0x87dd74,_0xac89b6){return function(_0x1005c8){if(_0x1005c8){return _0x1005c8['destroy']()[_0xb827('0x27')](function(){_0x87dd74[_0xb827('0x1b')](0xcc)[_0xb827('0x28')]();});}};}function handleEntityNotFound(_0x5914e9,_0x4ca3bf){return function(_0x28b5da){if(!_0x28b5da){_0x5914e9[_0xb827('0x1a')](0x194);}return _0x28b5da;};}function handleError(_0x394384,_0x105f22){_0x105f22=_0x105f22||0x1f4;return function(_0x5d9915){logger['error'](_0x5d9915[_0xb827('0x29')]);if(_0x5d9915[_0xb827('0x2a')]){delete _0x5d9915[_0xb827('0x2a')];}_0x394384[_0xb827('0x1b')](_0x105f22)[_0xb827('0x2b')](_0x5d9915);};}exports[_0xb827('0x2c')]=function(_0xcdf7d7,_0x1aaa2c){var _0x4cedf6={},_0x33faa3={},_0xb83bb4={'count':0x0,'rows':[]};var _0x3d3c57=_[_0xb827('0x2d')](db['ZendeskConfiguration'][_0xb827('0x2e')],function(_0x345826){return{'name':_0x345826[_0xb827('0x2f')],'type':_0x345826[_0xb827('0x30')][_0xb827('0x31')]};});_0x33faa3[_0xb827('0x32')]=_[_0xb827('0x2d')](_0x3d3c57,_0xb827('0x2a'));_0x33faa3[_0xb827('0x33')]=_[_0xb827('0x34')](_0xcdf7d7[_0xb827('0x33')]);_0x33faa3[_0xb827('0x35')]=_[_0xb827('0x36')](_0x33faa3[_0xb827('0x32')],_0x33faa3['query']);_0x4cedf6[_0xb827('0x37')]=_[_0xb827('0x36')](_0x33faa3[_0xb827('0x32')],qs[_0xb827('0x38')](_0xcdf7d7[_0xb827('0x33')]['fields']));_0x4cedf6['attributes']=_0x4cedf6['attributes'][_0xb827('0x39')]?_0x4cedf6[_0xb827('0x37')]:_0x33faa3['model'];if(!_0xcdf7d7['query'][_0xb827('0x3a')](_0xb827('0x3b'))){_0x4cedf6[_0xb827('0x1e')]=qs['limit'](_0xcdf7d7[_0xb827('0x33')][_0xb827('0x1e')]);_0x4cedf6[_0xb827('0x20')]=qs[_0xb827('0x20')](_0xcdf7d7['query']['offset']);}_0x4cedf6[_0xb827('0x3c')]=qs[_0xb827('0x3d')](_0xcdf7d7[_0xb827('0x33')][_0xb827('0x3d')]);_0x4cedf6[_0xb827('0x3e')]=qs[_0xb827('0x35')](_['pick'](_0xcdf7d7[_0xb827('0x33')],_0x33faa3[_0xb827('0x35')]),_0x3d3c57);if(_0xcdf7d7[_0xb827('0x33')][_0xb827('0x3f')]){_0x4cedf6['where']=_[_0xb827('0x40')](_0x4cedf6['where'],{'$or':_['map'](_0x3d3c57,function(_0x4b0fdb){if(_0x4b0fdb[_0xb827('0x30')]!==_0xb827('0x41')){var _0x223996={};_0x223996[_0x4b0fdb[_0xb827('0x2a')]]={'$like':'%'+_0xcdf7d7['query'][_0xb827('0x3f')]+'%'};return _0x223996;}})});}_0x4cedf6=_[_0xb827('0x40')]({},_0x4cedf6,_0xcdf7d7['options']);var _0x45217b={'where':_0x4cedf6[_0xb827('0x3e')]};return db[_0xb827('0x42')][_0xb827('0x1f')](_0x45217b)['then'](function(_0x59dc2d){_0xb83bb4['count']=_0x59dc2d;if(_0xcdf7d7[_0xb827('0x33')][_0xb827('0x43')]){_0x4cedf6[_0xb827('0x44')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xb827('0x45')](_0x4cedf6);})['then'](function(_0x3f0ee1){_0xb83bb4[_0xb827('0x46')]=_0x3f0ee1;return _0xb83bb4;})[_0xb827('0x27')](respondWithFilteredResult(_0x1aaa2c,_0x4cedf6))[_0xb827('0x47')](handleError(_0x1aaa2c,null));};exports[_0xb827('0x48')]=function(_0x23e71a,_0x4c450d){var _0x68f3ea={'raw':![],'where':{'id':_0x23e71a[_0xb827('0x49')]['id']}},_0x1b35e3={};_0x1b35e3[_0xb827('0x32')]=_[_0xb827('0x34')](db[_0xb827('0x42')][_0xb827('0x2e')]);_0x1b35e3['query']=_[_0xb827('0x34')](_0x23e71a[_0xb827('0x33')]);_0x1b35e3[_0xb827('0x35')]=_['intersection'](_0x1b35e3['model'],_0x1b35e3[_0xb827('0x33')]);_0x68f3ea[_0xb827('0x37')]=_[_0xb827('0x36')](_0x1b35e3['model'],qs[_0xb827('0x38')](_0x23e71a[_0xb827('0x33')][_0xb827('0x38')]));_0x68f3ea['attributes']=_0x68f3ea[_0xb827('0x37')][_0xb827('0x39')]?_0x68f3ea[_0xb827('0x37')]:_0x1b35e3['model'];if(_0x23e71a[_0xb827('0x33')][_0xb827('0x43')]){_0x68f3ea[_0xb827('0x44')]=[{'all':!![]}];}_0x68f3ea=_['merge']({},_0x68f3ea,_0x23e71a[_0xb827('0x4a')]);return db[_0xb827('0x42')][_0xb827('0x4b')](_0x68f3ea)[_0xb827('0x27')](handleEntityNotFound(_0x4c450d,null))[_0xb827('0x27')](respondWithResult(_0x4c450d,null))[_0xb827('0x47')](handleError(_0x4c450d,null));};exports[_0xb827('0x4c')]=function(_0x19638d,_0x4c8ae7){return db[_0xb827('0x42')][_0xb827('0x4c')](_0x19638d[_0xb827('0x4d')],{})['then'](respondWithResult(_0x4c8ae7,0xc9))[_0xb827('0x47')](handleError(_0x4c8ae7,null));};exports[_0xb827('0x26')]=function(_0x23621b,_0x1e7d00){if(_0x23621b['body']['id']){delete _0x23621b['body']['id'];}return db['ZendeskConfiguration'][_0xb827('0x4b')]({'where':{'id':_0x23621b[_0xb827('0x49')]['id']}})[_0xb827('0x27')](handleEntityNotFound(_0x1e7d00,null))['then'](saveUpdates(_0x23621b[_0xb827('0x4d')],null))['then'](respondWithResult(_0x1e7d00,null))['catch'](handleError(_0x1e7d00,null));};exports[_0xb827('0x4e')]=function(_0x4c7f48,_0x419a64){return db[_0xb827('0x42')]['find']({'where':{'id':_0x4c7f48[_0xb827('0x49')]['id']}})['then'](handleEntityNotFound(_0x419a64,null))[_0xb827('0x27')](removeEntity(_0x419a64,null))[_0xb827('0x47')](handleError(_0x419a64,null));};exports[_0xb827('0x4f')]=function(_0x7f8230,_0x2c053f,_0xab957f){var _0x1d55d7={};var _0x4e496d={};var _0x504d20;var _0x18ee50;return db[_0xb827('0x42')][_0xb827('0x50')]({'where':{'id':_0x7f8230[_0xb827('0x49')]['id']}})[_0xb827('0x27')](handleEntityNotFound(_0x2c053f,null))[_0xb827('0x27')](function(_0x428d78){if(_0x428d78){_0x504d20=_0x428d78;_0x4e496d[_0xb827('0x32')]=_[_0xb827('0x34')](db[_0xb827('0x51')][_0xb827('0x2e')]);_0x4e496d[_0xb827('0x33')]=_['keys'](_0x7f8230[_0xb827('0x33')]);_0x4e496d[_0xb827('0x35')]=_[_0xb827('0x36')](_0x4e496d['model'],_0x4e496d[_0xb827('0x33')]);_0x1d55d7[_0xb827('0x37')]=_[_0xb827('0x36')](_0x4e496d[_0xb827('0x32')],qs[_0xb827('0x38')](_0x7f8230['query'][_0xb827('0x38')]));_0x1d55d7['attributes']=_0x1d55d7['attributes'][_0xb827('0x39')]?_0x1d55d7['attributes']:_0x4e496d[_0xb827('0x32')];_0x1d55d7[_0xb827('0x3c')]=qs['sort'](_0x7f8230[_0xb827('0x33')]['sort']);_0x1d55d7[_0xb827('0x3e')]=qs[_0xb827('0x35')](_[_0xb827('0x52')](_0x7f8230[_0xb827('0x33')],_0x4e496d[_0xb827('0x35')]));if(_0x7f8230['query'][_0xb827('0x3f')]){_0x1d55d7['where']=_[_0xb827('0x40')](_0x1d55d7['where'],{'$or':_[_0xb827('0x2d')](_0x1d55d7['attributes'],function(_0x49781f){var _0x43fba9={};_0x43fba9[_0x49781f]={'$like':'%'+_0x7f8230[_0xb827('0x33')][_0xb827('0x3f')]+'%'};return _0x43fba9;})});}_0x1d55d7=_[_0xb827('0x40')]({},_0x1d55d7,_0x7f8230[_0xb827('0x4a')]);return _0x504d20['getFields'](_0x1d55d7);}})[_0xb827('0x27')](function(_0x125c5d){if(_0x125c5d){_0x18ee50=_0x125c5d['length'];if(!_0x7f8230[_0xb827('0x33')][_0xb827('0x3a')]('nolimit')){_0x1d55d7[_0xb827('0x1e')]=qs[_0xb827('0x1e')](_0x7f8230['query']['limit']);_0x1d55d7[_0xb827('0x20')]=qs[_0xb827('0x20')](_0x7f8230[_0xb827('0x33')]['offset']);}return _0x504d20[_0xb827('0x4f')](_0x1d55d7);}})[_0xb827('0x27')](function(_0x52acdc){if(_0x52acdc){return _0x52acdc?{'count':_0x18ee50,'rows':_0x52acdc}:null;}})[_0xb827('0x27')](respondWithResult(_0x2c053f,null))['catch'](handleError(_0x2c053f,null));};exports[_0xb827('0x53')]=function(_0x5c2ea4,_0x195795,_0x49dde9){var _0x862ff9={};var _0x221a29={};var _0x388aaa;var _0x54c312;return db[_0xb827('0x42')]['findOne']({'where':{'id':_0x5c2ea4[_0xb827('0x49')]['id']}})[_0xb827('0x27')](handleEntityNotFound(_0x195795,null))[_0xb827('0x27')](function(_0x1446b6){if(_0x1446b6){_0x388aaa=_0x1446b6;_0x221a29[_0xb827('0x32')]=_[_0xb827('0x34')](db[_0xb827('0x51')][_0xb827('0x2e')]);_0x221a29['query']=_[_0xb827('0x34')](_0x5c2ea4[_0xb827('0x33')]);_0x221a29[_0xb827('0x35')]=_[_0xb827('0x36')](_0x221a29[_0xb827('0x32')],_0x221a29[_0xb827('0x33')]);_0x862ff9[_0xb827('0x37')]=_[_0xb827('0x36')](_0x221a29[_0xb827('0x32')],qs[_0xb827('0x38')](_0x5c2ea4[_0xb827('0x33')]['fields']));_0x862ff9[_0xb827('0x37')]=_0x862ff9[_0xb827('0x37')][_0xb827('0x39')]?_0x862ff9[_0xb827('0x37')]:_0x221a29[_0xb827('0x32')];_0x862ff9[_0xb827('0x3c')]=qs[_0xb827('0x3d')](_0x5c2ea4['query']['sort']);_0x862ff9[_0xb827('0x3e')]=qs[_0xb827('0x35')](_[_0xb827('0x52')](_0x5c2ea4['query'],_0x221a29['filters']));if(_0x5c2ea4[_0xb827('0x33')][_0xb827('0x3f')]){_0x862ff9['where']=_[_0xb827('0x40')](_0x862ff9[_0xb827('0x3e')],{'$or':_[_0xb827('0x2d')](_0x862ff9[_0xb827('0x37')],function(_0x618d39){var _0x1b610b={};_0x1b610b[_0x618d39]={'$like':'%'+_0x5c2ea4['query'][_0xb827('0x3f')]+'%'};return _0x1b610b;})});}_0x862ff9=_[_0xb827('0x40')]({},_0x862ff9,_0x5c2ea4['options']);return _0x388aaa[_0xb827('0x53')](_0x862ff9);}})[_0xb827('0x27')](function(_0x2da985){if(_0x2da985){_0x54c312=_0x2da985[_0xb827('0x39')];if(!_0x5c2ea4[_0xb827('0x33')][_0xb827('0x3a')](_0xb827('0x3b'))){_0x862ff9[_0xb827('0x1e')]=qs['limit'](_0x5c2ea4['query'][_0xb827('0x1e')]);_0x862ff9[_0xb827('0x20')]=qs[_0xb827('0x20')](_0x5c2ea4['query'][_0xb827('0x20')]);}return _0x388aaa[_0xb827('0x53')](_0x862ff9);}})[_0xb827('0x27')](function(_0x3a23bf){if(_0x3a23bf){return _0x3a23bf?{'count':_0x54c312,'rows':_0x3a23bf}:null;}})[_0xb827('0x27')](respondWithResult(_0x195795,null))[_0xb827('0x47')](handleError(_0x195795,null));};exports[_0xb827('0x54')]=function(_0x3e780a,_0x46504b,_0x1ccf3b){var _0x228272={};var _0xa4a918={};var _0x31b6f4;var _0x4d18d6;return db[_0xb827('0x42')]['findOne']({'where':{'id':_0x3e780a[_0xb827('0x49')]['id']}})['then'](handleEntityNotFound(_0x46504b,null))[_0xb827('0x27')](function(_0x4f0d70){if(_0x4f0d70){_0x31b6f4=_0x4f0d70;_0xa4a918['model']=_[_0xb827('0x34')](db[_0xb827('0x51')][_0xb827('0x2e')]);_0xa4a918[_0xb827('0x33')]=_[_0xb827('0x34')](_0x3e780a['query']);_0xa4a918[_0xb827('0x35')]=_[_0xb827('0x36')](_0xa4a918[_0xb827('0x32')],_0xa4a918[_0xb827('0x33')]);_0x228272[_0xb827('0x37')]=_['intersection'](_0xa4a918[_0xb827('0x32')],qs['fields'](_0x3e780a[_0xb827('0x33')][_0xb827('0x38')]));_0x228272[_0xb827('0x37')]=_0x228272[_0xb827('0x37')][_0xb827('0x39')]?_0x228272['attributes']:_0xa4a918[_0xb827('0x32')];_0x228272[_0xb827('0x3c')]=qs['sort'](_0x3e780a['query']['sort']);_0x228272['where']=qs[_0xb827('0x35')](_[_0xb827('0x52')](_0x3e780a[_0xb827('0x33')],_0xa4a918[_0xb827('0x35')]));if(_0x3e780a[_0xb827('0x33')][_0xb827('0x3f')]){_0x228272[_0xb827('0x3e')]=_[_0xb827('0x40')](_0x228272['where'],{'$or':_[_0xb827('0x2d')](_0x228272[_0xb827('0x37')],function(_0x4a2afb){var _0x256e08={};_0x256e08[_0x4a2afb]={'$like':'%'+_0x3e780a['query'][_0xb827('0x3f')]+'%'};return _0x256e08;})});}_0x228272=_[_0xb827('0x40')]({},_0x228272,_0x3e780a[_0xb827('0x4a')]);return _0x31b6f4[_0xb827('0x54')](_0x228272);}})['then'](function(_0x181697){if(_0x181697){_0x4d18d6=_0x181697['length'];if(!_0x3e780a[_0xb827('0x33')][_0xb827('0x3a')]('nolimit')){_0x228272[_0xb827('0x1e')]=qs[_0xb827('0x1e')](_0x3e780a[_0xb827('0x33')][_0xb827('0x1e')]);_0x228272[_0xb827('0x20')]=qs['offset'](_0x3e780a[_0xb827('0x33')][_0xb827('0x20')]);}return _0x31b6f4[_0xb827('0x54')](_0x228272);}})[_0xb827('0x27')](function(_0x39b8d7){if(_0x39b8d7){return _0x39b8d7?{'count':_0x4d18d6,'rows':_0x39b8d7}:null;}})[_0xb827('0x27')](respondWithResult(_0x46504b,null))[_0xb827('0x47')](handleError(_0x46504b,null));};exports[_0xb827('0x55')]=function(_0x3476e4,_0x28e66e,_0x4c324b){var _0x22afcd={};var _0x4c703a={};var _0x871f96;var _0x435c65;return db[_0xb827('0x42')][_0xb827('0x50')]({'where':{'id':_0x3476e4[_0xb827('0x49')]['id']}})[_0xb827('0x27')](handleEntityNotFound(_0x28e66e,null))[_0xb827('0x27')](function(_0x4c6bfd){if(_0x4c6bfd){_0x871f96=_0x4c6bfd;_0x4c703a[_0xb827('0x32')]=_[_0xb827('0x34')](db['Tag'][_0xb827('0x2e')]);_0x4c703a[_0xb827('0x33')]=_[_0xb827('0x34')](_0x3476e4[_0xb827('0x33')]);_0x4c703a[_0xb827('0x35')]=_['intersection'](_0x4c703a[_0xb827('0x32')],_0x4c703a[_0xb827('0x33')]);_0x22afcd[_0xb827('0x37')]=_[_0xb827('0x36')](_0x4c703a[_0xb827('0x32')],qs[_0xb827('0x38')](_0x3476e4[_0xb827('0x33')]['fields']));_0x22afcd[_0xb827('0x37')]=_0x22afcd['attributes']['length']?_0x22afcd[_0xb827('0x37')]:_0x4c703a['model'];_0x22afcd['order']=qs[_0xb827('0x3d')](_0x3476e4['query'][_0xb827('0x3d')]);_0x22afcd[_0xb827('0x3e')]=qs[_0xb827('0x35')](_['pick'](_0x3476e4[_0xb827('0x33')],_0x4c703a[_0xb827('0x35')]));if(_0x3476e4[_0xb827('0x33')][_0xb827('0x3f')]){_0x22afcd[_0xb827('0x3e')]=_[_0xb827('0x40')](_0x22afcd[_0xb827('0x3e')],{'$or':_[_0xb827('0x2d')](_0x22afcd[_0xb827('0x37')],function(_0x3a1bce){var _0x3917fd={};_0x3917fd[_0x3a1bce]={'$like':'%'+_0x3476e4['query'][_0xb827('0x3f')]+'%'};return _0x3917fd;})});}_0x22afcd=_[_0xb827('0x40')]({},_0x22afcd,_0x3476e4[_0xb827('0x4a')]);return _0x871f96[_0xb827('0x55')](_0x22afcd);}})[_0xb827('0x27')](function(_0x5391ac){if(_0x5391ac){_0x435c65=_0x5391ac['length'];if(!_0x3476e4[_0xb827('0x33')]['hasOwnProperty']('nolimit')){_0x22afcd[_0xb827('0x1e')]=qs[_0xb827('0x1e')](_0x3476e4[_0xb827('0x33')][_0xb827('0x1e')]);_0x22afcd[_0xb827('0x20')]=qs[_0xb827('0x20')](_0x3476e4[_0xb827('0x33')]['offset']);}return _0x871f96[_0xb827('0x55')](_0x22afcd);}})[_0xb827('0x27')](function(_0x2c75ed){if(_0x2c75ed){return _0x2c75ed?{'count':_0x435c65,'rows':_0x2c75ed}:null;}})['then'](respondWithResult(_0x28e66e,null))[_0xb827('0x47')](handleError(_0x28e66e,null));};exports['setTags']=function(_0x501cb5,_0x28cf00,_0x82d5d4){if(_0x501cb5[_0xb827('0x4d')]['id']){delete _0x501cb5['body']['id'];}return db[_0xb827('0x42')][_0xb827('0x50')]({'where':{'id':_0x501cb5[_0xb827('0x49')]['id']}})[_0xb827('0x27')](handleEntityNotFound(_0x28cf00,null))[_0xb827('0x27')](function(_0x1385ce){if(_0x1385ce){return _0x1385ce[_0xb827('0x56')](_0x501cb5[_0xb827('0x4d')][_0xb827('0x57')]||[]);}return null;})[_0xb827('0x27')](respondWithResult(_0x28cf00,null))[_0xb827('0x47')](handleError(_0x28cf00,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 009a382..afd9e98 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 _0xbbbc=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5adbb4,_0x5092e0){_0x5adbb4=_0x5adbb4-0x0;var _0x48e176=_0xbbbc[_0x5adbb4];return _0x48e176;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x236c=['../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x27474a,_0x129831){var _0x2f49fe=function(_0x4b21f1){while(--_0x4b21f1){_0x27474a['push'](_0x27474a['shift']());}};_0x2f49fe(++_0x129831);}(_0x236c,0x155));var _0xc236=function(_0x159ef0,_0x1accb7){_0x159ef0=_0x159ef0-0x0;var _0x5458e7=_0x236c[_0x159ef0];return _0x5458e7;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var logger=require(_0xc236('0x1'))(_0xc236('0x2'));var moment=require(_0xc236('0x3'));var BPromise=require(_0xc236('0x4'));var rp=require(_0xc236('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc236('0x6'));var config=require(_0xc236('0x7'));var attributes=require(_0xc236('0x8'));module[_0xc236('0x9')]=function(_0x23d3cc,_0x461c3a){return _0x23d3cc['define'](_0xc236('0xa'),attributes,{'tableName':_0xc236('0xb'),'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 d12916e..948164d 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 _0x145d=['message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x2b03a1,_0x5a37c2){var _0x4a402b=function(_0x18e40c){while(--_0x18e40c){_0x2b03a1['push'](_0x2b03a1['shift']());}};_0x4a402b(++_0x5a37c2);}(_0x145d,0x6d));var _0xd145=function(_0x254330,_0x1d6d4a){_0x254330=_0x254330-0x0;var _0x489771=_0x145d[_0x254330];return _0x489771;};'use strict';var _=require(_0xd145('0x0'));var util=require(_0xd145('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd145('0x2'));var fs=require('fs');var Redis=require(_0xd145('0x3'));var db=require(_0xd145('0x4'))['db'];var utils=require(_0xd145('0x5'));var logger=require('../../config/logger')(_0xd145('0x6'));var config=require('../../config/environment');var jayson=require(_0xd145('0x7'));var client=jayson[_0xd145('0x8')][_0xd145('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db90f,_0x12ee4c,_0x2cca0b){return new BPromise(function(_0x26cfd9,_0x21c3a7){return client['request'](_0x3db90f,_0x2cca0b)[_0xd145('0xa')](function(_0x18f4e9){logger[_0xd145('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x12ee4c,_0xd145('0xc'));logger[_0xd145('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x12ee4c,_0xd145('0xc'),JSON[_0xd145('0xe')](_0x18f4e9));if(_0x18f4e9[_0xd145('0xf')]){if(_0x18f4e9[_0xd145('0xf')][_0xd145('0x10')]===0x1f4){logger[_0xd145('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x12ee4c,_0x18f4e9[_0xd145('0xf')]['message']);return _0x21c3a7(_0x18f4e9[_0xd145('0xf')][_0xd145('0x11')]);}logger[_0xd145('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x12ee4c,_0x18f4e9[_0xd145('0xf')]['message']);return _0x26cfd9(_0x18f4e9[_0xd145('0xf')][_0xd145('0x11')]);}else{logger[_0xd145('0xb')](_0xd145('0x12'),_0x12ee4c,_0xd145('0xc'));_0x26cfd9(_0x18f4e9[_0xd145('0x13')][_0xd145('0x11')]);}})[_0xd145('0x14')](function(_0x2f6eae){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x12ee4c,_0x2f6eae);_0x21c3a7(_0x2f6eae);});});} \ No newline at end of file +var _0x49af=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2590c3,_0x809b8f){var _0x2cde8f=function(_0x5d5ce0){while(--_0x5d5ce0){_0x2590c3['push'](_0x2590c3['shift']());}};_0x2cde8f(++_0x809b8f);}(_0x49af,0xa5));var _0xf49a=function(_0x15d796,_0x298438){_0x15d796=_0x15d796-0x0;var _0x18707e=_0x49af[_0x15d796];return _0x18707e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf49a('0x0'));var BPromise=require(_0xf49a('0x1'));var rs=require(_0xf49a('0x2'));var fs=require('fs');var Redis=require(_0xf49a('0x3'));var db=require(_0xf49a('0x4'))['db'];var utils=require(_0xf49a('0x5'));var logger=require('../../config/logger')(_0xf49a('0x6'));var config=require(_0xf49a('0x7'));var jayson=require(_0xf49a('0x8'));var client=jayson['client'][_0xf49a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6404dd,_0x49f415,_0x59cd22){return new BPromise(function(_0xdcf0,_0x1cdbb0){return client[_0xf49a('0xa')](_0x6404dd,_0x59cd22)[_0xf49a('0xb')](function(_0x4ab276){logger['info'](_0xf49a('0xc'),_0x49f415,_0xf49a('0xd'));logger[_0xf49a('0xe')](_0xf49a('0xf'),_0x49f415,_0xf49a('0xd'),JSON[_0xf49a('0x10')](_0x4ab276));if(_0x4ab276[_0xf49a('0x11')]){if(_0x4ab276['error'][_0xf49a('0x12')]===0x1f4){logger[_0xf49a('0x11')](_0xf49a('0xc'),_0x49f415,_0x4ab276[_0xf49a('0x11')][_0xf49a('0x13')]);return _0x1cdbb0(_0x4ab276[_0xf49a('0x11')]['message']);}logger[_0xf49a('0x11')](_0xf49a('0xc'),_0x49f415,_0x4ab276[_0xf49a('0x11')][_0xf49a('0x13')]);return _0xdcf0(_0x4ab276[_0xf49a('0x11')][_0xf49a('0x13')]);}else{logger['info'](_0xf49a('0xc'),_0x49f415,_0xf49a('0xd'));_0xdcf0(_0x4ab276['result'][_0xf49a('0x13')]);}})['catch'](function(_0x2bc45e){logger[_0xf49a('0x11')](_0xf49a('0xc'),_0x49f415,_0x2bc45e);_0x1cdbb0(_0x2bc45e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5d49a24..8d76ce9 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 _0xc596=['/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x2a4c72,_0x567560){var _0x117347=function(_0x22c62f){while(--_0x22c62f){_0x2a4c72['push'](_0x2a4c72['shift']());}};_0x117347(++_0x567560);}(_0xc596,0x1a0));var _0x6c59=function(_0x3b9815,_0x21a16f){_0x3b9815=_0x3b9815-0x0;var _0x46fa98=_0xc596[_0x3b9815];return _0x46fa98;};'use strict';var multer=require('multer');var util=require(_0x6c59('0x0'));var path=require('path');var timeout=require(_0x6c59('0x1'));var express=require(_0x6c59('0x2'));var router=express['Router']();var fs_extra=require(_0x6c59('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6c59('0x4'));var config=require('../../config/environment');var controller=require(_0x6c59('0x5'));router[_0x6c59('0x6')]('/',auth[_0x6c59('0x7')](),controller[_0x6c59('0x8')]);router[_0x6c59('0x6')](_0x6c59('0x9'),auth[_0x6c59('0x7')](),controller[_0x6c59('0xa')]);router[_0x6c59('0xb')]('/',auth[_0x6c59('0x7')](),controller[_0x6c59('0xc')]);router[_0x6c59('0xd')](_0x6c59('0x9'),auth[_0x6c59('0x7')](),controller[_0x6c59('0xe')]);router[_0x6c59('0xf')]('/:id',auth[_0x6c59('0x7')](),controller['destroy']);module[_0x6c59('0x10')]=router; \ No newline at end of file +var _0x55e7=['show','post','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','index','/:id','isAuthenticated'];(function(_0x4ec7e6,_0x4812eb){var _0x1df113=function(_0x4b0446){while(--_0x4b0446){_0x4ec7e6['push'](_0x4ec7e6['shift']());}};_0x1df113(++_0x4812eb);}(_0x55e7,0x1f2));var _0x755e=function(_0x804499,_0x5bf33d){_0x804499=_0x804499-0x0;var _0x5aa007=_0x55e7[_0x804499];return _0x5aa007;};'use strict';var multer=require(_0x755e('0x0'));var util=require(_0x755e('0x1'));var path=require(_0x755e('0x2'));var timeout=require('connect-timeout');var express=require(_0x755e('0x3'));var router=express[_0x755e('0x4')]();var fs_extra=require(_0x755e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x755e('0x6'));var config=require(_0x755e('0x7'));var controller=require(_0x755e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x755e('0x9')]);router['get'](_0x755e('0xa'),auth[_0x755e('0xb')](),controller[_0x755e('0xc')]);router[_0x755e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x755e('0xa'),auth[_0x755e('0xb')](),controller[_0x755e('0xe')]);router[_0x755e('0xf')](_0x755e('0xa'),auth[_0x755e('0xb')](),controller['destroy']);module[_0x755e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2f7b5c1..d57ff85 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 _0x3e4c=['ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x2943d5,_0x3d319d){var _0x406ceb=function(_0x23c6b4){while(--_0x23c6b4){_0x2943d5['push'](_0x2943d5['shift']());}};_0x406ceb(++_0x3d319d);}(_0x3e4c,0x1a5));var _0xc3e4=function(_0x17c458,_0x24b556){_0x17c458=_0x17c458-0x0;var _0x532480=_0x3e4c[_0x17c458];return _0x532480;};'use strict';var Sequelize=require(_0xc3e4('0x0'));module[_0xc3e4('0x1')]={'type':{'type':Sequelize[_0xc3e4('0x2')](_0xc3e4('0x3'),'variable',_0xc3e4('0x4'),_0xc3e4('0x5'),'picklist'),'defaultValue':_0xc3e4('0x3')},'content':{'type':Sequelize[_0xc3e4('0x6')]},'key':{'type':Sequelize[_0xc3e4('0x6')]},'keyType':{'type':Sequelize[_0xc3e4('0x2')](_0xc3e4('0x3'),_0xc3e4('0x7'),_0xc3e4('0x4'))},'keyContent':{'type':Sequelize[_0xc3e4('0x6')]},'idField':{'type':Sequelize[_0xc3e4('0x6')]},'nameField':{'type':Sequelize[_0xc3e4('0x6')]},'customField':{'type':Sequelize[_0xc3e4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc3e4('0x6')]}}; \ No newline at end of file +var _0x78a5=['string','STRING','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x3fec75,_0x523d63){var _0x1dc06=function(_0xf83a9){while(--_0xf83a9){_0x3fec75['push'](_0x3fec75['shift']());}};_0x1dc06(++_0x523d63);}(_0x78a5,0x1eb));var _0x578a=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x78a5[_0xf0ec6e];return _0x8bbc27;};'use strict';var Sequelize=require(_0x578a('0x0'));module[_0x578a('0x1')]={'type':{'type':Sequelize[_0x578a('0x2')]('string','variable',_0x578a('0x3'),_0x578a('0x4'),'picklist'),'defaultValue':_0x578a('0x5')},'content':{'type':Sequelize[_0x578a('0x6')]},'key':{'type':Sequelize[_0x578a('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x578a('0x3'))},'keyContent':{'type':Sequelize[_0x578a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x578a('0x6')]},'customField':{'type':Sequelize[_0x578a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x578a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5587aae..d573d54 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 _0x7f91=['catch','show','params','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x5156db,_0x378e7f){var _0x4ca0fd=function(_0x4c1c50){while(--_0x4c1c50){_0x5156db['push'](_0x5156db['shift']());}};_0x4ca0fd(++_0x378e7f);}(_0x7f91,0x172));var _0x17f9=function(_0x1e6e39,_0x3c98ed){_0x1e6e39=_0x1e6e39-0x0;var _0x2d9029=_0x7f91[_0x1e6e39];return _0x2d9029;};'use strict';var emlformat=require(_0x17f9('0x0'));var rimraf=require(_0x17f9('0x1'));var zipdir=require(_0x17f9('0x2'));var jsonpatch=require(_0x17f9('0x3'));var rp=require(_0x17f9('0x4'));var moment=require('moment');var BPromise=require(_0x17f9('0x5'));var Mustache=require(_0x17f9('0x6'));var util=require(_0x17f9('0x7'));var path=require(_0x17f9('0x8'));var sox=require(_0x17f9('0x9'));var csv=require(_0x17f9('0xa'));var ejs=require(_0x17f9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17f9('0xc'));var squel=require(_0x17f9('0xd'));var crypto=require(_0x17f9('0xe'));var jsforce=require(_0x17f9('0xf'));var deskjs=require(_0x17f9('0x10'));var toCsv=require(_0x17f9('0xa'));var querystring=require(_0x17f9('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x17f9('0x12'));var qs=require(_0x17f9('0x13'));var as=require(_0x17f9('0x14'));var hardwareService=require(_0x17f9('0x15'));var logger=require(_0x17f9('0x16'))(_0x17f9('0x17'));var utils=require(_0x17f9('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdd19f4,_0x58f1f8){_0x58f1f8=_0x58f1f8||0xcc;return function(_0x475bbf){if(_0x475bbf){return _0xdd19f4[_0x17f9('0x19')](_0x58f1f8);}return _0xdd19f4[_0x17f9('0x1a')](_0x58f1f8)[_0x17f9('0x1b')]();};}function respondWithResult(_0x3dc11c,_0x5d7238){_0x5d7238=_0x5d7238||0xc8;return function(_0x548014){if(_0x548014){return _0x3dc11c[_0x17f9('0x1a')](_0x5d7238)[_0x17f9('0x1c')](_0x548014);}};}function respondWithFilteredResult(_0x481644,_0x268343){return function(_0x4796a2){if(_0x4796a2){var _0x11361a=typeof _0x268343[_0x17f9('0x1d')]==='undefined'&&typeof _0x268343[_0x17f9('0x1e')]===_0x17f9('0x1f');var _0x3322e2=_0x4796a2[_0x17f9('0x20')];var _0x3b6abb=_0x11361a?0x0:_0x268343[_0x17f9('0x1d')];var _0x56be14=_0x11361a?_0x4796a2[_0x17f9('0x20')]:_0x268343[_0x17f9('0x1d')]+_0x268343[_0x17f9('0x1e')];var _0x59b28d;if(_0x56be14>=_0x3322e2){_0x56be14=_0x3322e2;_0x59b28d=0xc8;}else{_0x59b28d=0xce;}_0x481644['status'](_0x59b28d);return _0x481644[_0x17f9('0x21')](_0x17f9('0x22'),_0x3b6abb+'-'+_0x56be14+'/'+_0x3322e2)['json'](_0x4796a2);}return null;};}function patchUpdates(_0xa427ea){return function(_0x137544){try{jsonpatch[_0x17f9('0x23')](_0x137544,_0xa427ea,!![]);}catch(_0x5d4e33){return BPromise[_0x17f9('0x24')](_0x5d4e33);}return _0x137544[_0x17f9('0x25')]();};}function saveUpdates(_0x5df7a5,_0x3f1163){return function(_0x355c36){if(_0x355c36){return _0x355c36[_0x17f9('0x26')](_0x5df7a5)[_0x17f9('0x27')](function(_0x286ac8){return _0x286ac8;});}return null;};}function removeEntity(_0xecbc89,_0x2abff4){return function(_0x5b1d36){if(_0x5b1d36){return _0x5b1d36[_0x17f9('0x28')]()[_0x17f9('0x27')](function(){_0xecbc89[_0x17f9('0x1a')](0xcc)[_0x17f9('0x1b')]();});}};}function handleEntityNotFound(_0x9a667f,_0x4af9f2){return function(_0x27aaa3){if(!_0x27aaa3){_0x9a667f[_0x17f9('0x19')](0x194);}return _0x27aaa3;};}function handleError(_0x123bec,_0x15845a){_0x15845a=_0x15845a||0x1f4;return function(_0x160d55){logger['error'](_0x160d55[_0x17f9('0x29')]);if(_0x160d55[_0x17f9('0x2a')]){delete _0x160d55[_0x17f9('0x2a')];}_0x123bec[_0x17f9('0x1a')](_0x15845a)['send'](_0x160d55);};}exports[_0x17f9('0x2b')]=function(_0xaf9428,_0x6df2c9){var _0x594042={},_0x5376cc={},_0x37e2bd={'count':0x0,'rows':[]};var _0x4f91bd=_[_0x17f9('0x2c')](db[_0x17f9('0x2d')][_0x17f9('0x2e')],function(_0x11a62a){return{'name':_0x11a62a[_0x17f9('0x2f')],'type':_0x11a62a[_0x17f9('0x30')][_0x17f9('0x31')]};});_0x5376cc[_0x17f9('0x32')]=_[_0x17f9('0x2c')](_0x4f91bd,_0x17f9('0x2a'));_0x5376cc['query']=_[_0x17f9('0x33')](_0xaf9428[_0x17f9('0x34')]);_0x5376cc['filters']=_[_0x17f9('0x35')](_0x5376cc[_0x17f9('0x32')],_0x5376cc['query']);_0x594042[_0x17f9('0x36')]=_['intersection'](_0x5376cc[_0x17f9('0x32')],qs[_0x17f9('0x37')](_0xaf9428[_0x17f9('0x34')][_0x17f9('0x37')]));_0x594042[_0x17f9('0x36')]=_0x594042[_0x17f9('0x36')]['length']?_0x594042[_0x17f9('0x36')]:_0x5376cc[_0x17f9('0x32')];if(!_0xaf9428[_0x17f9('0x34')][_0x17f9('0x38')]('nolimit')){_0x594042[_0x17f9('0x1e')]=qs[_0x17f9('0x1e')](_0xaf9428['query'][_0x17f9('0x1e')]);_0x594042[_0x17f9('0x1d')]=qs[_0x17f9('0x1d')](_0xaf9428[_0x17f9('0x34')][_0x17f9('0x1d')]);}_0x594042[_0x17f9('0x39')]=qs['sort'](_0xaf9428[_0x17f9('0x34')]['sort']);_0x594042[_0x17f9('0x3a')]=qs[_0x17f9('0x3b')](_[_0x17f9('0x3c')](_0xaf9428[_0x17f9('0x34')],_0x5376cc['filters']),_0x4f91bd);if(_0xaf9428[_0x17f9('0x34')][_0x17f9('0x3d')]){_0x594042[_0x17f9('0x3a')]=_[_0x17f9('0x3e')](_0x594042[_0x17f9('0x3a')],{'$or':_[_0x17f9('0x2c')](_0x4f91bd,function(_0x18cc4a){if(_0x18cc4a[_0x17f9('0x30')]!=='VIRTUAL'){var _0x442eac={};_0x442eac[_0x18cc4a[_0x17f9('0x2a')]]={'$like':'%'+_0xaf9428['query'][_0x17f9('0x3d')]+'%'};return _0x442eac;}})});}_0x594042=_[_0x17f9('0x3e')]({},_0x594042,_0xaf9428[_0x17f9('0x3f')]);var _0x5a6192={'where':_0x594042[_0x17f9('0x3a')]};return db['ZendeskField'][_0x17f9('0x20')](_0x5a6192)[_0x17f9('0x27')](function(_0x46e9ab){_0x37e2bd[_0x17f9('0x20')]=_0x46e9ab;if(_0xaf9428['query'][_0x17f9('0x40')]){_0x594042[_0x17f9('0x41')]=[{'all':!![]}];}return db[_0x17f9('0x2d')][_0x17f9('0x42')](_0x594042);})[_0x17f9('0x27')](function(_0x41bc6f){_0x37e2bd[_0x17f9('0x43')]=_0x41bc6f;return _0x37e2bd;})['then'](respondWithFilteredResult(_0x6df2c9,_0x594042))[_0x17f9('0x44')](handleError(_0x6df2c9,null));};exports[_0x17f9('0x45')]=function(_0x5d4013,_0xbf09dc){var _0x57c92b={'raw':!![],'where':{'id':_0x5d4013[_0x17f9('0x46')]['id']}},_0x14943a={};_0x14943a['model']=_[_0x17f9('0x33')](db[_0x17f9('0x2d')][_0x17f9('0x2e')]);_0x14943a['query']=_[_0x17f9('0x33')](_0x5d4013[_0x17f9('0x34')]);_0x14943a[_0x17f9('0x3b')]=_[_0x17f9('0x35')](_0x14943a[_0x17f9('0x32')],_0x14943a[_0x17f9('0x34')]);_0x57c92b[_0x17f9('0x36')]=_[_0x17f9('0x35')](_0x14943a[_0x17f9('0x32')],qs[_0x17f9('0x37')](_0x5d4013[_0x17f9('0x34')][_0x17f9('0x37')]));_0x57c92b[_0x17f9('0x36')]=_0x57c92b[_0x17f9('0x36')]['length']?_0x57c92b[_0x17f9('0x36')]:_0x14943a[_0x17f9('0x32')];if(_0x5d4013[_0x17f9('0x34')][_0x17f9('0x40')]){_0x57c92b['include']=[{'all':!![]}];}_0x57c92b=_[_0x17f9('0x3e')]({},_0x57c92b,_0x5d4013[_0x17f9('0x3f')]);return db[_0x17f9('0x2d')]['find'](_0x57c92b)[_0x17f9('0x27')](handleEntityNotFound(_0xbf09dc,null))[_0x17f9('0x27')](respondWithResult(_0xbf09dc,null))[_0x17f9('0x44')](handleError(_0xbf09dc,null));};exports[_0x17f9('0x47')]=function(_0x702c97,_0xe3e22a){return db[_0x17f9('0x2d')][_0x17f9('0x47')](_0x702c97[_0x17f9('0x48')],{})[_0x17f9('0x27')](respondWithResult(_0xe3e22a,0xc9))[_0x17f9('0x44')](handleError(_0xe3e22a,null));};exports['update']=function(_0x13b72f,_0x2926f3){if(_0x13b72f[_0x17f9('0x48')]['id']){delete _0x13b72f[_0x17f9('0x48')]['id'];}return db[_0x17f9('0x2d')]['find']({'where':{'id':_0x13b72f[_0x17f9('0x46')]['id']}})[_0x17f9('0x27')](handleEntityNotFound(_0x2926f3,null))['then'](saveUpdates(_0x13b72f['body'],null))[_0x17f9('0x27')](respondWithResult(_0x2926f3,null))[_0x17f9('0x44')](handleError(_0x2926f3,null));};exports['destroy']=function(_0x3eadff,_0x18a244){return db[_0x17f9('0x2d')]['find']({'where':{'id':_0x3eadff['params']['id']}})[_0x17f9('0x27')](handleEntityNotFound(_0x18a244,null))[_0x17f9('0x27')](removeEntity(_0x18a244,null))[_0x17f9('0x44')](handleError(_0x18a244,null));}; \ No newline at end of file +var _0xd52a=['catch','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','ZendeskField','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','filter','options','then','includeAll','rows','show','params','keys','include','find','create','body'];(function(_0x381892,_0x9ab197){var _0x4ecf6a=function(_0x2417c3){while(--_0x2417c3){_0x381892['push'](_0x381892['shift']());}};_0x4ecf6a(++_0x9ab197);}(_0xd52a,0xca));var _0xad52=function(_0x2ec671,_0xa0f365){_0x2ec671=_0x2ec671-0x0;var _0xb23108=_0xd52a[_0x2ec671];return _0xb23108;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad52('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad52('0x1'));var rp=require(_0xad52('0x2'));var moment=require(_0xad52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad52('0x4'));var util=require(_0xad52('0x5'));var path=require(_0xad52('0x6'));var sox=require(_0xad52('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad52('0x8'));var squel=require('squel');var crypto=require(_0xad52('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad52('0xa'));var toCsv=require(_0xad52('0xb'));var querystring=require('querystring');var Papa=require(_0xad52('0xc'));var Redis=require('ioredis');var authService=require(_0xad52('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xad52('0xe'));var hardwareService=require(_0xad52('0xf'));var logger=require(_0xad52('0x10'))(_0xad52('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad52('0x12'))['db'];function respondWithStatusCode(_0x79b1e7,_0x378b0c){_0x378b0c=_0x378b0c||0xcc;return function(_0x41331e){if(_0x41331e){return _0x79b1e7[_0xad52('0x13')](_0x378b0c);}return _0x79b1e7[_0xad52('0x14')](_0x378b0c)[_0xad52('0x15')]();};}function respondWithResult(_0xd04cde,_0x3d2df6){_0x3d2df6=_0x3d2df6||0xc8;return function(_0x5727a2){if(_0x5727a2){return _0xd04cde[_0xad52('0x14')](_0x3d2df6)[_0xad52('0x16')](_0x5727a2);}};}function respondWithFilteredResult(_0x3bc8f6,_0x42eb20){return function(_0x38be7e){if(_0x38be7e){var _0xcb6cd5=typeof _0x42eb20[_0xad52('0x17')]===_0xad52('0x18')&&typeof _0x42eb20[_0xad52('0x19')]==='undefined';var _0x4abd73=_0x38be7e[_0xad52('0x1a')];var _0x39128c=_0xcb6cd5?0x0:_0x42eb20[_0xad52('0x17')];var _0x1c19e9=_0xcb6cd5?_0x38be7e[_0xad52('0x1a')]:_0x42eb20['offset']+_0x42eb20[_0xad52('0x19')];var _0x5a71c4;if(_0x1c19e9>=_0x4abd73){_0x1c19e9=_0x4abd73;_0x5a71c4=0xc8;}else{_0x5a71c4=0xce;}_0x3bc8f6[_0xad52('0x14')](_0x5a71c4);return _0x3bc8f6[_0xad52('0x1b')](_0xad52('0x1c'),_0x39128c+'-'+_0x1c19e9+'/'+_0x4abd73)['json'](_0x38be7e);}return null;};}function patchUpdates(_0x24fb52){return function(_0x593dfd){try{jsonpatch[_0xad52('0x1d')](_0x593dfd,_0x24fb52,!![]);}catch(_0x179a64){return BPromise[_0xad52('0x1e')](_0x179a64);}return _0x593dfd[_0xad52('0x1f')]();};}function saveUpdates(_0x2c182f,_0x2f1526){return function(_0x4b5f2f){if(_0x4b5f2f){return _0x4b5f2f[_0xad52('0x20')](_0x2c182f)['then'](function(_0x1aac2e){return _0x1aac2e;});}return null;};}function removeEntity(_0x2acbb4,_0x2fa90c){return function(_0x5bce67){if(_0x5bce67){return _0x5bce67[_0xad52('0x21')]()['then'](function(){_0x2acbb4['status'](0xcc)[_0xad52('0x15')]();});}};}function handleEntityNotFound(_0x583999,_0x477b47){return function(_0x3a54a1){if(!_0x3a54a1){_0x583999['sendStatus'](0x194);}return _0x3a54a1;};}function handleError(_0x58adf5,_0xb526bf){_0xb526bf=_0xb526bf||0x1f4;return function(_0x31b5e0){logger[_0xad52('0x22')](_0x31b5e0['stack']);if(_0x31b5e0[_0xad52('0x23')]){delete _0x31b5e0['name'];}_0x58adf5[_0xad52('0x14')](_0xb526bf)[_0xad52('0x24')](_0x31b5e0);};}exports[_0xad52('0x25')]=function(_0x231bbe,_0x503bd0){var _0x426106={},_0x2a604c={},_0x534cc5={'count':0x0,'rows':[]};var _0x3f5757=_[_0xad52('0x26')](db[_0xad52('0x27')][_0xad52('0x28')],function(_0x32f4fe){return{'name':_0x32f4fe['fieldName'],'type':_0x32f4fe['type']['key']};});_0x2a604c[_0xad52('0x29')]=_[_0xad52('0x26')](_0x3f5757,_0xad52('0x23'));_0x2a604c['query']=_['keys'](_0x231bbe[_0xad52('0x2a')]);_0x2a604c[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x2a604c[_0xad52('0x29')],_0x2a604c[_0xad52('0x2a')]);_0x426106[_0xad52('0x2d')]=_['intersection'](_0x2a604c[_0xad52('0x29')],qs[_0xad52('0x2e')](_0x231bbe[_0xad52('0x2a')][_0xad52('0x2e')]));_0x426106[_0xad52('0x2d')]=_0x426106[_0xad52('0x2d')][_0xad52('0x2f')]?_0x426106[_0xad52('0x2d')]:_0x2a604c[_0xad52('0x29')];if(!_0x231bbe[_0xad52('0x2a')][_0xad52('0x30')]('nolimit')){_0x426106[_0xad52('0x19')]=qs[_0xad52('0x19')](_0x231bbe[_0xad52('0x2a')][_0xad52('0x19')]);_0x426106[_0xad52('0x17')]=qs[_0xad52('0x17')](_0x231bbe['query'][_0xad52('0x17')]);}_0x426106[_0xad52('0x31')]=qs[_0xad52('0x32')](_0x231bbe['query'][_0xad52('0x32')]);_0x426106[_0xad52('0x33')]=qs[_0xad52('0x2b')](_['pick'](_0x231bbe[_0xad52('0x2a')],_0x2a604c[_0xad52('0x2b')]),_0x3f5757);if(_0x231bbe[_0xad52('0x2a')]['filter']){_0x426106[_0xad52('0x33')]=_[_0xad52('0x34')](_0x426106[_0xad52('0x33')],{'$or':_[_0xad52('0x26')](_0x3f5757,function(_0x253c86){if(_0x253c86[_0xad52('0x35')]!=='VIRTUAL'){var _0xb1ea93={};_0xb1ea93[_0x253c86['name']]={'$like':'%'+_0x231bbe[_0xad52('0x2a')][_0xad52('0x36')]+'%'};return _0xb1ea93;}})});}_0x426106=_[_0xad52('0x34')]({},_0x426106,_0x231bbe[_0xad52('0x37')]);var _0x1d5e8a={'where':_0x426106['where']};return db[_0xad52('0x27')][_0xad52('0x1a')](_0x1d5e8a)[_0xad52('0x38')](function(_0x47f02c){_0x534cc5[_0xad52('0x1a')]=_0x47f02c;if(_0x231bbe[_0xad52('0x2a')][_0xad52('0x39')]){_0x426106['include']=[{'all':!![]}];}return db[_0xad52('0x27')]['findAll'](_0x426106);})[_0xad52('0x38')](function(_0x355381){_0x534cc5[_0xad52('0x3a')]=_0x355381;return _0x534cc5;})[_0xad52('0x38')](respondWithFilteredResult(_0x503bd0,_0x426106))['catch'](handleError(_0x503bd0,null));};exports[_0xad52('0x3b')]=function(_0x134d54,_0x249724){var _0x2bd94a={'raw':!![],'where':{'id':_0x134d54[_0xad52('0x3c')]['id']}},_0x3886ec={};_0x3886ec[_0xad52('0x29')]=_[_0xad52('0x3d')](db['ZendeskField'][_0xad52('0x28')]);_0x3886ec['query']=_[_0xad52('0x3d')](_0x134d54[_0xad52('0x2a')]);_0x3886ec[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x3886ec[_0xad52('0x29')],_0x3886ec[_0xad52('0x2a')]);_0x2bd94a[_0xad52('0x2d')]=_[_0xad52('0x2c')](_0x3886ec[_0xad52('0x29')],qs[_0xad52('0x2e')](_0x134d54[_0xad52('0x2a')][_0xad52('0x2e')]));_0x2bd94a[_0xad52('0x2d')]=_0x2bd94a[_0xad52('0x2d')][_0xad52('0x2f')]?_0x2bd94a[_0xad52('0x2d')]:_0x3886ec[_0xad52('0x29')];if(_0x134d54[_0xad52('0x2a')][_0xad52('0x39')]){_0x2bd94a[_0xad52('0x3e')]=[{'all':!![]}];}_0x2bd94a=_['merge']({},_0x2bd94a,_0x134d54[_0xad52('0x37')]);return db[_0xad52('0x27')][_0xad52('0x3f')](_0x2bd94a)['then'](handleEntityNotFound(_0x249724,null))[_0xad52('0x38')](respondWithResult(_0x249724,null))['catch'](handleError(_0x249724,null));};exports[_0xad52('0x40')]=function(_0x5bb02a,_0x4cf477){return db[_0xad52('0x27')][_0xad52('0x40')](_0x5bb02a[_0xad52('0x41')],{})[_0xad52('0x38')](respondWithResult(_0x4cf477,0xc9))['catch'](handleError(_0x4cf477,null));};exports['update']=function(_0x254416,_0x5dede4){if(_0x254416[_0xad52('0x41')]['id']){delete _0x254416['body']['id'];}return db[_0xad52('0x27')][_0xad52('0x3f')]({'where':{'id':_0x254416[_0xad52('0x3c')]['id']}})[_0xad52('0x38')](handleEntityNotFound(_0x5dede4,null))[_0xad52('0x38')](saveUpdates(_0x254416[_0xad52('0x41')],null))['then'](respondWithResult(_0x5dede4,null))[_0xad52('0x42')](handleError(_0x5dede4,null));};exports[_0xad52('0x21')]=function(_0x44c401,_0xb3a238){return db['ZendeskField'][_0xad52('0x3f')]({'where':{'id':_0x44c401[_0xad52('0x3c')]['id']}})[_0xad52('0x38')](handleEntityNotFound(_0xb3a238,null))['then'](removeEntity(_0xb3a238,null))[_0xad52('0x42')](handleError(_0xb3a238,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 72595f1..c76d01a 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 _0x682e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0x682e,0x197));var _0xe682=function(_0x5d1922,_0x5a4cc4){_0x5d1922=_0x5d1922-0x0;var _0x11b668=_0x682e[_0x5d1922];return _0x11b668;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var logger=require(_0xe682('0x2'))(_0xe682('0x3'));var moment=require('moment');var BPromise=require(_0xe682('0x4'));var rp=require(_0xe682('0x5'));var fs=require('fs');var path=require(_0xe682('0x6'));var rimraf=require(_0xe682('0x7'));var config=require(_0xe682('0x8'));var attributes=require(_0xe682('0x9'));module[_0xe682('0xa')]=function(_0x12a5f6,_0x4a9257){return _0x12a5f6[_0xe682('0xb')](_0xe682('0xc'),attributes,{'tableName':_0xe682('0xd'),'paranoid':![],'indexes':[{'name':_0xe682('0xe'),'fields':[_0xe682('0xf'),_0xe682('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4500=['idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x4dc4f1,_0x1b2cd4){var _0x56cdf5=function(_0x1d34d3){while(--_0x1d34d3){_0x4dc4f1['push'](_0x4dc4f1['shift']());}};_0x56cdf5(++_0x1b2cd4);}(_0x4500,0x1e1));var _0x0450=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x4500[_0x3b2369];return _0x5a1367;};'use strict';var _=require(_0x0450('0x0'));var util=require(_0x0450('0x1'));var logger=require(_0x0450('0x2'))(_0x0450('0x3'));var moment=require(_0x0450('0x4'));var BPromise=require('bluebird');var rp=require(_0x0450('0x5'));var fs=require('fs');var path=require(_0x0450('0x6'));var rimraf=require(_0x0450('0x7'));var config=require(_0x0450('0x8'));var attributes=require(_0x0450('0x9'));module[_0x0450('0xa')]=function(_0x2beeb6,_0x2ae778){return _0x2beeb6[_0x0450('0xb')](_0x0450('0xc'),attributes,{'tableName':_0x0450('0xd'),'paranoid':![],'indexes':[{'name':_0x0450('0xe'),'fields':[_0x0450('0xf'),'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 ac96d1b..65785af 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 _0x8622=['request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8622,0x9d));var _0x2862=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8622[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2862('0x0'));var util=require(_0x2862('0x1'));var moment=require(_0x2862('0x2'));var BPromise=require(_0x2862('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2862('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2862('0x5'))(_0x2862('0x6'));var config=require(_0x2862('0x7'));var jayson=require(_0x2862('0x8'));var client=jayson[_0x2862('0x9')][_0x2862('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3492d8,_0x169b3a,_0x8dd2ff){return new BPromise(function(_0x99ba39,_0x1da54e){return client[_0x2862('0xb')](_0x3492d8,_0x8dd2ff)[_0x2862('0xc')](function(_0x25804c){logger['info'](_0x2862('0xd'),_0x169b3a,_0x2862('0xe'));logger[_0x2862('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x169b3a,'request\x20sent',JSON['stringify'](_0x25804c));if(_0x25804c[_0x2862('0x10')]){if(_0x25804c[_0x2862('0x10')]['code']===0x1f4){logger[_0x2862('0x10')](_0x2862('0xd'),_0x169b3a,_0x25804c[_0x2862('0x10')][_0x2862('0x11')]);return _0x1da54e(_0x25804c[_0x2862('0x10')]['message']);}logger[_0x2862('0x10')]('ZendeskField,\x20%s,\x20%s',_0x169b3a,_0x25804c[_0x2862('0x10')][_0x2862('0x11')]);return _0x99ba39(_0x25804c[_0x2862('0x10')][_0x2862('0x11')]);}else{logger[_0x2862('0x12')](_0x2862('0xd'),_0x169b3a,_0x2862('0xe'));_0x99ba39(_0x25804c[_0x2862('0x13')]['message']);}})[_0x2862('0x14')](function(_0x15294e){logger['error'](_0x2862('0xd'),_0x169b3a,_0x15294e);_0x1da54e(_0x15294e);});});} \ No newline at end of file +var _0x0c1c=['request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','ZendeskField,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0c1c,0x1e6));var _0xc0c1=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0x0c1c[_0x28fbe3];return _0x45db6a;};'use strict';var _=require('lodash');var util=require(_0xc0c1('0x0'));var moment=require(_0xc0c1('0x1'));var BPromise=require(_0xc0c1('0x2'));var rs=require(_0xc0c1('0x3'));var fs=require('fs');var Redis=require(_0xc0c1('0x4'));var db=require(_0xc0c1('0x5'))['db'];var utils=require(_0xc0c1('0x6'));var logger=require('../../config/logger')(_0xc0c1('0x7'));var config=require(_0xc0c1('0x8'));var jayson=require(_0xc0c1('0x9'));var client=jayson[_0xc0c1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b3525,_0x41e25a,_0x46dede){return new BPromise(function(_0x1125e7,_0x1c0675){return client[_0xc0c1('0xb')](_0x5b3525,_0x46dede)['then'](function(_0x50b8db){logger[_0xc0c1('0xc')](_0xc0c1('0xd'),_0x41e25a,_0xc0c1('0xe'));logger['debug'](_0xc0c1('0xf'),_0x41e25a,_0xc0c1('0xe'),JSON['stringify'](_0x50b8db));if(_0x50b8db[_0xc0c1('0x10')]){if(_0x50b8db[_0xc0c1('0x10')][_0xc0c1('0x11')]===0x1f4){logger[_0xc0c1('0x10')](_0xc0c1('0xd'),_0x41e25a,_0x50b8db[_0xc0c1('0x10')]['message']);return _0x1c0675(_0x50b8db[_0xc0c1('0x10')][_0xc0c1('0x12')]);}logger['error'](_0xc0c1('0xd'),_0x41e25a,_0x50b8db[_0xc0c1('0x10')][_0xc0c1('0x12')]);return _0x1125e7(_0x50b8db[_0xc0c1('0x10')][_0xc0c1('0x12')]);}else{logger[_0xc0c1('0xc')](_0xc0c1('0xd'),_0x41e25a,_0xc0c1('0xe'));_0x1125e7(_0x50b8db['result'][_0xc0c1('0x12')]);}})[_0xc0c1('0x13')](function(_0x442284){logger[_0xc0c1('0x10')](_0xc0c1('0xd'),_0x41e25a,_0x442284);_0x1c0675(_0x442284);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 417f2a7..25af169 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 _0x9713=['get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller'];(function(_0x310a4f,_0x5d9678){var _0x423a78=function(_0x3bad20){while(--_0x3bad20){_0x310a4f['push'](_0x310a4f['shift']());}};_0x423a78(++_0x5d9678);}(_0x9713,0xdc));var _0x3971=function(_0x3f99c6,_0x122367){_0x3f99c6=_0x3f99c6-0x0;var _0x20c425=_0x9713[_0x3f99c6];return _0x20c425;};'use strict';var multer=require(_0x3971('0x0'));var util=require(_0x3971('0x1'));var path=require(_0x3971('0x2'));var timeout=require(_0x3971('0x3'));var express=require(_0x3971('0x4'));var router=express[_0x3971('0x5')]();var fs_extra=require(_0x3971('0x6'));var auth=require(_0x3971('0x7'));var interaction=require(_0x3971('0x8'));var config=require('../../config/environment');var controller=require(_0x3971('0x9'));router[_0x3971('0xa')]('/',auth[_0x3971('0xb')](),controller[_0x3971('0xc')]);router[_0x3971('0xa')](_0x3971('0xd'),auth[_0x3971('0xb')](),controller[_0x3971('0xe')]);router[_0x3971('0xa')](_0x3971('0xf'),auth[_0x3971('0xb')](),controller['getConfigurations']);router[_0x3971('0xa')](_0x3971('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x3971('0x11')]('/',auth[_0x3971('0xb')](),controller[_0x3971('0x12')]);router[_0x3971('0x11')](_0x3971('0xf'),auth['isAuthenticated'](),controller[_0x3971('0x13')]);router[_0x3971('0x14')](_0x3971('0xd'),auth[_0x3971('0xb')](),controller[_0x3971('0x15')]);router[_0x3971('0x16')](_0x3971('0xd'),auth[_0x3971('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x98b5=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index'];(function(_0x1fa4f8,_0x79ee9f){var _0x562a43=function(_0x15325b){while(--_0x15325b){_0x1fa4f8['push'](_0x1fa4f8['shift']());}};_0x562a43(++_0x79ee9f);}(_0x98b5,0x98));var _0x598b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x98b5[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x598b('0x0'));var path=require('path');var timeout=require(_0x598b('0x1'));var express=require(_0x598b('0x2'));var router=express['Router']();var fs_extra=require(_0x598b('0x3'));var auth=require(_0x598b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x598b('0x5'));var controller=require('./intZohoAccount.controller');router[_0x598b('0x6')]('/',auth['isAuthenticated'](),controller[_0x598b('0x7')]);router[_0x598b('0x6')](_0x598b('0x8'),auth[_0x598b('0x9')](),controller[_0x598b('0xa')]);router[_0x598b('0x6')](_0x598b('0xb'),auth['isAuthenticated'](),controller[_0x598b('0xc')]);router[_0x598b('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x598b('0xd')]);router[_0x598b('0xe')]('/',auth[_0x598b('0x9')](),controller[_0x598b('0xf')]);router[_0x598b('0xe')](_0x598b('0xb'),auth[_0x598b('0x9')](),controller[_0x598b('0x10')]);router['put'](_0x598b('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x598b('0x11')]('/:id',auth[_0x598b('0x9')](),controller[_0x598b('0x12')]);module[_0x598b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0d4e7b2..1e4279d 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 _0x99e9=['exports','STRING'];(function(_0x5958c7,_0x3d11ba){var _0x432cbe=function(_0x133bc8){while(--_0x133bc8){_0x5958c7['push'](_0x5958c7['shift']());}};_0x432cbe(++_0x3d11ba);}(_0x99e9,0xb4));var _0x999e=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0x99e9[_0x57dc85];return _0x563a2e;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'name':{'type':Sequelize[_0x999e('0x1')]},'description':{'type':Sequelize[_0x999e('0x1')]},'host':{'type':Sequelize[_0x999e('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x999e('0x1')]},'clientSecret':{'type':Sequelize[_0x999e('0x1')]},'serverUrl':{'type':Sequelize[_0x999e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x999e('0x1')]}}; \ No newline at end of file +var _0x008c=['exports','STRING','sequelize'];(function(_0x111b26,_0xf76620){var _0x3a0a1e=function(_0x2829cc){while(--_0x2829cc){_0x111b26['push'](_0x111b26['shift']());}};_0x3a0a1e(++_0xf76620);}(_0x008c,0x188));var _0xc008=function(_0x42fc8e,_0x26620d){_0x42fc8e=_0x42fc8e-0x0;var _0x4ad7b5=_0x008c[_0x42fc8e];return _0x4ad7b5;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')]},'description':{'type':Sequelize[_0xc008('0x2')]},'host':{'type':Sequelize[_0xc008('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc008('0x2')]},'clientSecret':{'type':Sequelize[_0xc008('0x2')]},'serverUrl':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xc008('0x2')]},'refreshToken':{'type':Sequelize[_0xc008('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 21f8261..1e92eb6 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 _0x774b=['clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientSecret','code','zoho.eu','serverUrl','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','Subject','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','apply','then','name','send','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','destroy','getConfigurations','findOne','order','filter','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken'];(function(_0x195d75,_0x1b3628){var _0x30a55e=function(_0x5cf5e5){while(--_0x5cf5e5){_0x195d75['push'](_0x195d75['shift']());}};_0x30a55e(++_0x1b3628);}(_0x774b,0xa1));var _0xb774=function(_0x217a61,_0x20392e){_0x217a61=_0x217a61-0x0;var _0x507118=_0x774b[_0x217a61];return _0x507118;};'use strict';var emlformat=require(_0xb774('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb774('0x1'));var jsonpatch=require(_0xb774('0x2'));var rp=require(_0xb774('0x3'));var moment=require('moment');var BPromise=require(_0xb774('0x4'));var Mustache=require('mustache');var util=require(_0xb774('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb774('0x6'));var _=require(_0xb774('0x7'));var squel=require(_0xb774('0x8'));var crypto=require(_0xb774('0x9'));var jsforce=require(_0xb774('0xa'));var deskjs=require(_0xb774('0xb'));var toCsv=require(_0xb774('0xc'));var querystring=require(_0xb774('0xd'));var Papa=require(_0xb774('0xe'));var Redis=require(_0xb774('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb774('0x10'));var hardwareService=require(_0xb774('0x11'));var logger=require('../../config/logger')(_0xb774('0x12'));var utils=require(_0xb774('0x13'));var config=require(_0xb774('0x14'));var licenseUtil=require(_0xb774('0x15'));var db=require(_0xb774('0x16'))['db'];var integrations=require(_0xb774('0x17'));function respondWithStatusCode(_0x4b74f3,_0x4121f5){_0x4121f5=_0x4121f5||0xcc;return function(_0x573f91){if(_0x573f91){return _0x4b74f3[_0xb774('0x18')](_0x4121f5);}return _0x4b74f3[_0xb774('0x19')](_0x4121f5)[_0xb774('0x1a')]();};}function respondWithResult(_0x1cbbb3,_0x579dc2){_0x579dc2=_0x579dc2||0xc8;return function(_0x1917e9){if(_0x1917e9){return _0x1cbbb3[_0xb774('0x19')](_0x579dc2)[_0xb774('0x1b')](_0x1917e9);}};}function respondWithFilteredResult(_0x555be5,_0x1a0346){return function(_0xeed6da){if(_0xeed6da){var _0x3b89b6=typeof _0x1a0346['offset']===_0xb774('0x1c')&&typeof _0x1a0346['limit']===_0xb774('0x1c');var _0x3d5496=_0xeed6da[_0xb774('0x1d')];var _0x282b8e=_0x3b89b6?0x0:_0x1a0346[_0xb774('0x1e')];var _0x25ad6c=_0x3b89b6?_0xeed6da[_0xb774('0x1d')]:_0x1a0346['offset']+_0x1a0346['limit'];var _0x37d8db;if(_0x25ad6c>=_0x3d5496){_0x25ad6c=_0x3d5496;_0x37d8db=0xc8;}else{_0x37d8db=0xce;}_0x555be5[_0xb774('0x19')](_0x37d8db);return _0x555be5[_0xb774('0x1f')]('Content-Range',_0x282b8e+'-'+_0x25ad6c+'/'+_0x3d5496)['json'](_0xeed6da);}return null;};}function patchUpdates(_0x5ec842){return function(_0xf544e9){try{jsonpatch[_0xb774('0x20')](_0xf544e9,_0x5ec842,!![]);}catch(_0x24d8a9){return BPromise['reject'](_0x24d8a9);}return _0xf544e9['save']();};}function saveUpdates(_0xe5ef2f,_0x543a8b){return function(_0x275b7b){if(_0x275b7b){return _0x275b7b['update'](_0xe5ef2f)[_0xb774('0x21')](function(_0x42c252){return _0x42c252;});}return null;};}function removeEntity(_0x4d0a20,_0x3c7c45){return function(_0x557602){if(_0x557602){return _0x557602['destroy']()[_0xb774('0x21')](function(){_0x4d0a20[_0xb774('0x19')](0xcc)[_0xb774('0x1a')]();});}};}function handleEntityNotFound(_0xdfa019,_0x40f31a){return function(_0x1bb801){if(!_0x1bb801){_0xdfa019[_0xb774('0x18')](0x194);}return _0x1bb801;};}function handleError(_0x2b172e,_0x477d6d){_0x477d6d=_0x477d6d||0x1f4;return function(_0x2fa1bf){logger['error'](_0x2fa1bf['stack']);if(_0x2fa1bf[_0xb774('0x22')]){delete _0x2fa1bf[_0xb774('0x22')];}_0x2b172e[_0xb774('0x19')](_0x477d6d)[_0xb774('0x23')](_0x2fa1bf);};}exports['index']=function(_0x2e0f28,_0x432437){var _0x493712={},_0x827255={},_0x12033d={'count':0x0,'rows':[]};var _0x5a0c92=_[_0xb774('0x24')](db[_0xb774('0x25')][_0xb774('0x26')],function(_0x25eba3){return{'name':_0x25eba3[_0xb774('0x27')],'type':_0x25eba3[_0xb774('0x28')]['key']};});_0x827255[_0xb774('0x29')]=_[_0xb774('0x24')](_0x5a0c92,_0xb774('0x22'));_0x827255[_0xb774('0x2a')]=_[_0xb774('0x2b')](_0x2e0f28[_0xb774('0x2a')]);_0x827255[_0xb774('0x2c')]=_[_0xb774('0x2d')](_0x827255['model'],_0x827255[_0xb774('0x2a')]);_0x493712['attributes']=_[_0xb774('0x2d')](_0x827255[_0xb774('0x29')],qs[_0xb774('0x2e')](_0x2e0f28['query']['fields']));_0x493712[_0xb774('0x2f')]=_0x493712[_0xb774('0x2f')][_0xb774('0x30')]?_0x493712[_0xb774('0x2f')]:_0x827255[_0xb774('0x29')];if(!_0x2e0f28[_0xb774('0x2a')][_0xb774('0x31')](_0xb774('0x32'))){_0x493712[_0xb774('0x33')]=qs['limit'](_0x2e0f28[_0xb774('0x2a')]['limit']);_0x493712['offset']=qs[_0xb774('0x1e')](_0x2e0f28[_0xb774('0x2a')]['offset']);}_0x493712['order']=qs[_0xb774('0x34')](_0x2e0f28[_0xb774('0x2a')]['sort']);_0x493712[_0xb774('0x35')]=qs[_0xb774('0x2c')](_[_0xb774('0x36')](_0x2e0f28[_0xb774('0x2a')],_0x827255[_0xb774('0x2c')]),_0x5a0c92);if(_0x2e0f28[_0xb774('0x2a')]['filter']){_0x493712[_0xb774('0x35')]=_[_0xb774('0x37')](_0x493712[_0xb774('0x35')],{'$or':_[_0xb774('0x24')](_0x5a0c92,function(_0x47e381){if(_0x47e381[_0xb774('0x28')]!==_0xb774('0x38')){var _0x5af205={};_0x5af205[_0x47e381['name']]={'$like':'%'+_0x2e0f28[_0xb774('0x2a')]['filter']+'%'};return _0x5af205;}})});}_0x493712=_[_0xb774('0x37')]({},_0x493712,_0x2e0f28['options']);var _0x40fa25={'where':_0x493712[_0xb774('0x35')]};return db[_0xb774('0x25')]['count'](_0x40fa25)[_0xb774('0x21')](function(_0x35df0e){_0x12033d[_0xb774('0x1d')]=_0x35df0e;if(_0x2e0f28[_0xb774('0x2a')][_0xb774('0x39')]){_0x493712[_0xb774('0x3a')]=[{'all':!![]}];}return db[_0xb774('0x25')][_0xb774('0x3b')](_0x493712);})[_0xb774('0x21')](function(_0x32ab03){_0x12033d[_0xb774('0x3c')]=_0x32ab03;return _0x12033d;})[_0xb774('0x21')](respondWithFilteredResult(_0x432437,_0x493712))[_0xb774('0x3d')](handleError(_0x432437,null));};exports[_0xb774('0x3e')]=function(_0x48bcec,_0x9704bd){var _0x553845={'raw':![],'where':{'id':_0x48bcec[_0xb774('0x3f')]['id']}},_0x3d5538={};_0x3d5538[_0xb774('0x29')]=_['keys'](db[_0xb774('0x25')]['rawAttributes']);_0x3d5538[_0xb774('0x2a')]=_[_0xb774('0x2b')](_0x48bcec[_0xb774('0x2a')]);_0x3d5538[_0xb774('0x2c')]=_['intersection'](_0x3d5538[_0xb774('0x29')],_0x3d5538[_0xb774('0x2a')]);_0x553845[_0xb774('0x2f')]=_['intersection'](_0x3d5538[_0xb774('0x29')],qs[_0xb774('0x2e')](_0x48bcec[_0xb774('0x2a')][_0xb774('0x2e')]));_0x553845[_0xb774('0x2f')]=_0x553845[_0xb774('0x2f')][_0xb774('0x30')]?_0x553845[_0xb774('0x2f')]:_0x3d5538[_0xb774('0x29')];if(_0x48bcec[_0xb774('0x2a')][_0xb774('0x39')]){_0x553845[_0xb774('0x3a')]=[{'all':!![]}];}_0x553845=_[_0xb774('0x37')]({},_0x553845,_0x48bcec[_0xb774('0x40')]);return db[_0xb774('0x25')][_0xb774('0x41')](_0x553845)['then'](handleEntityNotFound(_0x9704bd,null))['then'](respondWithResult(_0x9704bd,null))[_0xb774('0x3d')](handleError(_0x9704bd,null));};exports[_0xb774('0x42')]=function(_0x2ac7e6,_0x1a96db){return db[_0xb774('0x25')][_0xb774('0x42')](_0x2ac7e6[_0xb774('0x43')],{})[_0xb774('0x21')](respondWithResult(_0x1a96db,0xc9))[_0xb774('0x3d')](handleError(_0x1a96db,null));};exports[_0xb774('0x44')]=function(_0x47cf85,_0x455dfb){if(_0x47cf85['body']['id']){delete _0x47cf85[_0xb774('0x43')]['id'];}return db[_0xb774('0x25')]['find']({'where':{'id':_0x47cf85[_0xb774('0x3f')]['id']}})[_0xb774('0x21')](handleEntityNotFound(_0x455dfb,null))[_0xb774('0x21')](saveUpdates(_0x47cf85['body'],null))[_0xb774('0x21')](respondWithResult(_0x455dfb,null))[_0xb774('0x3d')](handleError(_0x455dfb,null));};exports[_0xb774('0x45')]=function(_0x2380f5,_0x90f0e2){return db[_0xb774('0x25')][_0xb774('0x41')]({'where':{'id':_0x2380f5[_0xb774('0x3f')]['id']}})[_0xb774('0x21')](handleEntityNotFound(_0x90f0e2,null))[_0xb774('0x21')](removeEntity(_0x90f0e2,null))['catch'](handleError(_0x90f0e2,null));};exports[_0xb774('0x46')]=function(_0x5305c8,_0x5b7757,_0x58c5cf){var _0x3a7c1e={};var _0x4879e6={};var _0x35f4d5;var _0x3a1104;return db['ZohoAccount'][_0xb774('0x47')]({'where':{'id':_0x5305c8[_0xb774('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5b7757,null))[_0xb774('0x21')](function(_0x35cbfd){if(_0x35cbfd){_0x35f4d5=_0x35cbfd;_0x4879e6[_0xb774('0x29')]=_[_0xb774('0x2b')](db['ZohoConfiguration']['rawAttributes']);_0x4879e6[_0xb774('0x2a')]=_[_0xb774('0x2b')](_0x5305c8['query']);_0x4879e6[_0xb774('0x2c')]=_['intersection'](_0x4879e6[_0xb774('0x29')],_0x4879e6[_0xb774('0x2a')]);_0x3a7c1e[_0xb774('0x2f')]=_['intersection'](_0x4879e6[_0xb774('0x29')],qs['fields'](_0x5305c8[_0xb774('0x2a')][_0xb774('0x2e')]));_0x3a7c1e['attributes']=_0x3a7c1e[_0xb774('0x2f')][_0xb774('0x30')]?_0x3a7c1e['attributes']:_0x4879e6[_0xb774('0x29')];_0x3a7c1e[_0xb774('0x48')]=qs[_0xb774('0x34')](_0x5305c8[_0xb774('0x2a')][_0xb774('0x34')]);_0x3a7c1e[_0xb774('0x35')]=qs[_0xb774('0x2c')](_[_0xb774('0x36')](_0x5305c8[_0xb774('0x2a')],_0x4879e6[_0xb774('0x2c')]));if(_0x5305c8[_0xb774('0x2a')][_0xb774('0x49')]){_0x3a7c1e[_0xb774('0x35')]=_[_0xb774('0x37')](_0x3a7c1e['where'],{'$or':_[_0xb774('0x24')](_0x3a7c1e[_0xb774('0x2f')],function(_0x2dd614){var _0x343749={};_0x343749[_0x2dd614]={'$like':'%'+_0x5305c8[_0xb774('0x2a')][_0xb774('0x49')]+'%'};return _0x343749;})});}_0x3a7c1e=_[_0xb774('0x37')]({},_0x3a7c1e,_0x5305c8[_0xb774('0x40')]);return _0x35f4d5[_0xb774('0x46')](_0x3a7c1e);}})[_0xb774('0x21')](function(_0x104086){if(_0x104086){_0x3a1104=_0x104086[_0xb774('0x30')];if(!_0x5305c8[_0xb774('0x2a')][_0xb774('0x31')](_0xb774('0x32'))){_0x3a7c1e[_0xb774('0x33')]=qs['limit'](_0x5305c8[_0xb774('0x2a')][_0xb774('0x33')]);_0x3a7c1e['offset']=qs[_0xb774('0x1e')](_0x5305c8[_0xb774('0x2a')][_0xb774('0x1e')]);}return _0x35f4d5[_0xb774('0x46')](_0x3a7c1e);}})['then'](function(_0x31a294){if(_0x31a294){return _0x31a294?{'count':_0x3a1104,'rows':_0x31a294}:null;}})['then'](respondWithResult(_0x5b7757,null))[_0xb774('0x3d')](handleError(_0x5b7757,null));};exports[_0xb774('0x4a')]=function(_0x399f75,_0x5ae2e2,_0x1b1aa5){if(_0x399f75['body']['id']){delete _0x399f75[_0xb774('0x43')]['id'];}return db[_0xb774('0x25')][_0xb774('0x47')]({'where':{'id':_0x399f75[_0xb774('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5ae2e2,null))[_0xb774('0x21')](function(_0x125ee5){if(_0x125ee5){_0x399f75[_0xb774('0x43')][_0xb774('0x4b')]=_0x125ee5['id'];_0x399f75[_0xb774('0x43')]['Subjects']=integrations[_0xb774('0x4c')](_0x399f75[_0xb774('0x43')]['channel'],_0x399f75[_0xb774('0x43')][_0xb774('0x28')]);_0x399f75['body'][_0xb774('0x4d')]=integrations[_0xb774('0x4e')](_0x399f75['body'][_0xb774('0x4f')],_0x399f75['body'][_0xb774('0x28')]);return db[_0xb774('0x50')]['create'](_0x399f75['body'],{'include':[{'model':db[_0xb774('0x51')],'as':'Subjects'},{'model':db[_0xb774('0x51')],'as':_0xb774('0x4d')}]});}return null;})[_0xb774('0x21')](respondWithResult(_0x5ae2e2,null))[_0xb774('0x3d')](handleError(_0x5ae2e2,null));};function getAccessToken(_0x4464f4){return new Promise(function(_0x48bc2c,_0xa107a5){var _0x4f32e6;switch(_0x4464f4[_0xb774('0x52')]){case'US':_0x4f32e6=_0xb774('0x53');break;case'AU':_0x4f32e6='https://accounts.zoho.com.au';break;case'EU':_0x4f32e6='https://accounts.zoho.eu';break;case'IN':_0x4f32e6=_0xb774('0x54');break;case'CN':_0x4f32e6='https://accounts.zoho.com.cn';break;default:_0x4f32e6=_0xb774('0x55');break;}var _0x495a30={'method':_0xb774('0x56'),'uri':_0x4f32e6+_0xb774('0x57'),'qs':{'refresh_token':_0x4464f4[_0xb774('0x58')],'client_id':_0x4464f4[_0xb774('0x59')],'client_secret':_0x4464f4['clientSecret'],'grant_type':_0xb774('0x5a')},'json':!![]};return rp(_0x495a30)[_0xb774('0x21')](function(_0x30cebd){if(_0x30cebd['access_token']){_0x48bc2c(_0x30cebd[_0xb774('0x5b')]);}else{_0xa107a5(_0xb774('0x5c'));}})[_0xb774('0x3d')](function(_0x54a98d){_0xa107a5(_0x54a98d);});});}exports['getFields']=function(_0x2aeb8f,_0x3c3f60,_0x1a75cf){var _0x1a4e88,_0x5a5af4,_0xf93ae5,_0x270ff7,_0x1ee05a;return db[_0xb774('0x25')][_0xb774('0x47')]({'where':{'id':_0x2aeb8f[_0xb774('0x3f')]['id']},'attributes':['id',_0xb774('0x5d'),_0xb774('0x52'),'clientId',_0xb774('0x5e'),'serverUrl',_0xb774('0x5f'),_0xb774('0x58')]})[_0xb774('0x21')](handleEntityNotFound(_0x3c3f60,null))[_0xb774('0x21')](function(_0x20407b){_0x1ee05a=_0x20407b;_0x1a4e88=_0x1ee05a[_0xb774('0x5d')];_0x5a5af4=_0x1a4e88===_0xb774('0x60')?'eu':'com';_0xf93ae5=_0x1ee05a[_0xb774('0x61')];var _0x2d41d2=_0xf93ae5[_0xb774('0x62')](-0x1);if(_0x2d41d2==='/'||_0x2d41d2==='\x5c'||_0x2d41d2===':'){_0xf93ae5=_0xf93ae5[_0xb774('0x63')](0x0,_0xf93ae5['lastIndexOf'](_0x2d41d2));}if(!_0x1ee05a[_0xb774('0x58')]){throw new Error(_0xb774('0x64'));}return getAccessToken(_0x1ee05a);})[_0xb774('0x21')](function(_0x59c47c){if(_0x59c47c){return rp({'method':_0xb774('0x65'),'uri':util[_0xb774('0x66')](_0xb774('0x67'),_0x5a5af4),'qs':{'module':'Calls'},'headers':{'Authorization':_0xb774('0x68')+_0x59c47c},'json':!![]});}})['then'](function(_0x42209c){if(_0x42209c){if(_0x42209c['response']&&_0x42209c[_0xb774('0x69')]['error']){throw new Error(_0x42209c[_0xb774('0x69')][_0xb774('0x6a')][_0xb774('0x6b')]);}var _0x18b6f1=[];var _0x506e6e=[];var _0x4b7677=[_0xb774('0x6c'),_0xb774('0x6d'),'Description','WhoId',_0xb774('0x6e'),'Call_Result',_0xb774('0x6f'),_0xb774('0x70')];_0x506e6e=_[_0xb774('0x71')](_0x42209c[_0xb774('0x2e')],function(_0x26f318){return _0x4b7677[_0xb774('0x72')](_0x26f318[_0xb774('0x73')]);});for(var _0x41cef7=0x0;_0x41cef7<_0x506e6e[_0xb774('0x30')];_0x41cef7++){if(_0x506e6e[_0x41cef7]['system_mandatory']===![]){_0x18b6f1[_0xb774('0x74')]({'id':_0x506e6e[_0x41cef7]['id'],'name':_0x506e6e[_0x41cef7]['display_label'],'custom':_0x506e6e[_0x41cef7][_0xb774('0x75')],'options':_0x506e6e[_0x41cef7][_0xb774('0x76')]===_0xb774('0x77')&&_0x506e6e[_0x41cef7]['pick_list_values']['length']>-0x1?_[_0xb774('0x24')](_0x506e6e[_0x41cef7][_0xb774('0x78')],function(_0x493a41){return{'name':_0x493a41,'value':_0x493a41};}):[]});}}return{'count':_0x18b6f1[_0xb774('0x30')],'rows':_0x18b6f1};}else{return{'count':0x0,'rows':[]};}})[_0xb774('0x21')](respondWithResult(_0x3c3f60,null))['catch'](function(_0x3ada7d){var _0x2fe1f6=_0x2aeb8f['query'][_0xb774('0x79')]?0x1f4:_0x3ada7d[_0xb774('0x7a')]||0x1f4;logger[_0xb774('0x6a')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2fe1f6,JSON[_0xb774('0x7b')](_0x3ada7d));delete _0x3ada7d[_0xb774('0x22')];if(_0x2fe1f6===0x191){_0x2fe1f6=0x190;}_0x3c3f60[_0xb774('0x19')](_0x2fe1f6)[_0xb774('0x23')](_0x2aeb8f[_0xb774('0x2a')]['test']?{'message':_0xb774('0x7c'),'statusCode':_0x3ada7d['statusCode']}:_0x3ada7d);});}; \ No newline at end of file +var _0x6704=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','create','body','find','destroy','getConfigurations','findOne','ZohoConfiguration','where','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','code','zoho.eu','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query'];(function(_0x4e495a,_0x58a164){var _0x161cd3=function(_0x1f613d){while(--_0x1f613d){_0x4e495a['push'](_0x4e495a['shift']());}};_0x161cd3(++_0x58a164);}(_0x6704,0xdb));var _0x4670=function(_0x19d813,_0x366b4a){_0x19d813=_0x19d813-0x0;var _0x47fd7b=_0x6704[_0x19d813];return _0x47fd7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4670('0x0'));var zipdir=require(_0x4670('0x1'));var jsonpatch=require(_0x4670('0x2'));var rp=require(_0x4670('0x3'));var moment=require(_0x4670('0x4'));var BPromise=require(_0x4670('0x5'));var Mustache=require(_0x4670('0x6'));var util=require(_0x4670('0x7'));var path=require(_0x4670('0x8'));var sox=require(_0x4670('0x9'));var csv=require(_0x4670('0xa'));var ejs=require(_0x4670('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4670('0xc'));var squel=require(_0x4670('0xd'));var crypto=require(_0x4670('0xe'));var jsforce=require(_0x4670('0xf'));var deskjs=require(_0x4670('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4670('0x11'));var Redis=require(_0x4670('0x12'));var authService=require(_0x4670('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4670('0x14'));var hardwareService=require(_0x4670('0x15'));var logger=require(_0x4670('0x16'))(_0x4670('0x17'));var utils=require(_0x4670('0x18'));var config=require(_0x4670('0x19'));var licenseUtil=require(_0x4670('0x1a'));var db=require(_0x4670('0x1b'))['db'];var integrations=require(_0x4670('0x1c'));function respondWithStatusCode(_0xc3f849,_0x1e2faf){_0x1e2faf=_0x1e2faf||0xcc;return function(_0x45778d){if(_0x45778d){return _0xc3f849['sendStatus'](_0x1e2faf);}return _0xc3f849[_0x4670('0x1d')](_0x1e2faf)[_0x4670('0x1e')]();};}function respondWithResult(_0x291bdb,_0x329f5d){_0x329f5d=_0x329f5d||0xc8;return function(_0x2d5505){if(_0x2d5505){return _0x291bdb['status'](_0x329f5d)[_0x4670('0x1f')](_0x2d5505);}};}function respondWithFilteredResult(_0x1ed884,_0xceae7e){return function(_0x584625){if(_0x584625){var _0x2a038f=typeof _0xceae7e[_0x4670('0x20')]===_0x4670('0x21')&&typeof _0xceae7e[_0x4670('0x22')]===_0x4670('0x21');var _0x3a347f=_0x584625['count'];var _0x307a52=_0x2a038f?0x0:_0xceae7e[_0x4670('0x20')];var _0x1d85a6=_0x2a038f?_0x584625[_0x4670('0x23')]:_0xceae7e['offset']+_0xceae7e[_0x4670('0x22')];var _0xbeb542;if(_0x1d85a6>=_0x3a347f){_0x1d85a6=_0x3a347f;_0xbeb542=0xc8;}else{_0xbeb542=0xce;}_0x1ed884[_0x4670('0x1d')](_0xbeb542);return _0x1ed884[_0x4670('0x24')](_0x4670('0x25'),_0x307a52+'-'+_0x1d85a6+'/'+_0x3a347f)[_0x4670('0x1f')](_0x584625);}return null;};}function patchUpdates(_0x178ecb){return function(_0x2c74b0){try{jsonpatch[_0x4670('0x26')](_0x2c74b0,_0x178ecb,!![]);}catch(_0x3eceac){return BPromise[_0x4670('0x27')](_0x3eceac);}return _0x2c74b0[_0x4670('0x28')]();};}function saveUpdates(_0x170321,_0x39a4cd){return function(_0x2e21ba){if(_0x2e21ba){return _0x2e21ba[_0x4670('0x29')](_0x170321)[_0x4670('0x2a')](function(_0x109414){return _0x109414;});}return null;};}function removeEntity(_0x90ac0,_0x49eed8){return function(_0x3e41d8){if(_0x3e41d8){return _0x3e41d8['destroy']()[_0x4670('0x2a')](function(){_0x90ac0[_0x4670('0x1d')](0xcc)[_0x4670('0x1e')]();});}};}function handleEntityNotFound(_0x533e17,_0x33d0f4){return function(_0x417b2c){if(!_0x417b2c){_0x533e17[_0x4670('0x2b')](0x194);}return _0x417b2c;};}function handleError(_0x2b9e1d,_0x2a317e){_0x2a317e=_0x2a317e||0x1f4;return function(_0x1af2ca){logger[_0x4670('0x2c')](_0x1af2ca[_0x4670('0x2d')]);if(_0x1af2ca[_0x4670('0x2e')]){delete _0x1af2ca['name'];}_0x2b9e1d[_0x4670('0x1d')](_0x2a317e)[_0x4670('0x2f')](_0x1af2ca);};}exports[_0x4670('0x30')]=function(_0x3fbff1,_0x38ab1e){var _0x65aa4b={},_0x499824={},_0x50ba06={'count':0x0,'rows':[]};var _0x1278b5=_[_0x4670('0x31')](db[_0x4670('0x32')][_0x4670('0x33')],function(_0x3afb79){return{'name':_0x3afb79[_0x4670('0x34')],'type':_0x3afb79[_0x4670('0x35')][_0x4670('0x36')]};});_0x499824[_0x4670('0x37')]=_['map'](_0x1278b5,_0x4670('0x2e'));_0x499824[_0x4670('0x38')]=_[_0x4670('0x39')](_0x3fbff1[_0x4670('0x38')]);_0x499824['filters']=_[_0x4670('0x3a')](_0x499824[_0x4670('0x37')],_0x499824['query']);_0x65aa4b[_0x4670('0x3b')]=_['intersection'](_0x499824['model'],qs[_0x4670('0x3c')](_0x3fbff1[_0x4670('0x38')][_0x4670('0x3c')]));_0x65aa4b[_0x4670('0x3b')]=_0x65aa4b[_0x4670('0x3b')][_0x4670('0x3d')]?_0x65aa4b[_0x4670('0x3b')]:_0x499824[_0x4670('0x37')];if(!_0x3fbff1[_0x4670('0x38')][_0x4670('0x3e')](_0x4670('0x3f'))){_0x65aa4b['limit']=qs[_0x4670('0x22')](_0x3fbff1[_0x4670('0x38')]['limit']);_0x65aa4b[_0x4670('0x20')]=qs[_0x4670('0x20')](_0x3fbff1['query'][_0x4670('0x20')]);}_0x65aa4b[_0x4670('0x40')]=qs[_0x4670('0x41')](_0x3fbff1['query'][_0x4670('0x41')]);_0x65aa4b['where']=qs[_0x4670('0x42')](_[_0x4670('0x43')](_0x3fbff1[_0x4670('0x38')],_0x499824['filters']),_0x1278b5);if(_0x3fbff1[_0x4670('0x38')][_0x4670('0x44')]){_0x65aa4b['where']=_['merge'](_0x65aa4b['where'],{'$or':_[_0x4670('0x31')](_0x1278b5,function(_0x1e1679){if(_0x1e1679[_0x4670('0x35')]!==_0x4670('0x45')){var _0x2d7eeb={};_0x2d7eeb[_0x1e1679[_0x4670('0x2e')]]={'$like':'%'+_0x3fbff1[_0x4670('0x38')]['filter']+'%'};return _0x2d7eeb;}})});}_0x65aa4b=_[_0x4670('0x46')]({},_0x65aa4b,_0x3fbff1[_0x4670('0x47')]);var _0x2ad89d={'where':_0x65aa4b['where']};return db[_0x4670('0x32')][_0x4670('0x23')](_0x2ad89d)[_0x4670('0x2a')](function(_0x156807){_0x50ba06[_0x4670('0x23')]=_0x156807;if(_0x3fbff1[_0x4670('0x38')]['includeAll']){_0x65aa4b['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x4670('0x48')](_0x65aa4b);})[_0x4670('0x2a')](function(_0x4e784d){_0x50ba06[_0x4670('0x49')]=_0x4e784d;return _0x50ba06;})[_0x4670('0x2a')](respondWithFilteredResult(_0x38ab1e,_0x65aa4b))[_0x4670('0x4a')](handleError(_0x38ab1e,null));};exports[_0x4670('0x4b')]=function(_0x4e022a,_0x4e390e){var _0x385b37={'raw':![],'where':{'id':_0x4e022a[_0x4670('0x4c')]['id']}},_0x193bf7={};_0x193bf7[_0x4670('0x37')]=_[_0x4670('0x39')](db[_0x4670('0x32')][_0x4670('0x33')]);_0x193bf7[_0x4670('0x38')]=_[_0x4670('0x39')](_0x4e022a['query']);_0x193bf7[_0x4670('0x42')]=_['intersection'](_0x193bf7[_0x4670('0x37')],_0x193bf7[_0x4670('0x38')]);_0x385b37[_0x4670('0x3b')]=_['intersection'](_0x193bf7[_0x4670('0x37')],qs['fields'](_0x4e022a[_0x4670('0x38')][_0x4670('0x3c')]));_0x385b37[_0x4670('0x3b')]=_0x385b37[_0x4670('0x3b')]['length']?_0x385b37['attributes']:_0x193bf7[_0x4670('0x37')];if(_0x4e022a['query'][_0x4670('0x4d')]){_0x385b37[_0x4670('0x4e')]=[{'all':!![]}];}_0x385b37=_[_0x4670('0x46')]({},_0x385b37,_0x4e022a[_0x4670('0x47')]);return db[_0x4670('0x32')]['find'](_0x385b37)['then'](handleEntityNotFound(_0x4e390e,null))[_0x4670('0x2a')](respondWithResult(_0x4e390e,null))[_0x4670('0x4a')](handleError(_0x4e390e,null));};exports[_0x4670('0x4f')]=function(_0xec9723,_0x7437bd){return db['ZohoAccount'][_0x4670('0x4f')](_0xec9723['body'],{})[_0x4670('0x2a')](respondWithResult(_0x7437bd,0xc9))['catch'](handleError(_0x7437bd,null));};exports[_0x4670('0x29')]=function(_0x3044ca,_0x3f6671){if(_0x3044ca[_0x4670('0x50')]['id']){delete _0x3044ca[_0x4670('0x50')]['id'];}return db['ZohoAccount'][_0x4670('0x51')]({'where':{'id':_0x3044ca[_0x4670('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3f6671,null))[_0x4670('0x2a')](saveUpdates(_0x3044ca['body'],null))['then'](respondWithResult(_0x3f6671,null))['catch'](handleError(_0x3f6671,null));};exports[_0x4670('0x52')]=function(_0x5eadb9,_0xf7a56d){return db[_0x4670('0x32')]['find']({'where':{'id':_0x5eadb9[_0x4670('0x4c')]['id']}})[_0x4670('0x2a')](handleEntityNotFound(_0xf7a56d,null))['then'](removeEntity(_0xf7a56d,null))['catch'](handleError(_0xf7a56d,null));};exports[_0x4670('0x53')]=function(_0x244fb6,_0x2ee84e,_0x2c49cf){var _0x75dcc6={};var _0xfee4e0={};var _0x232219;var _0x27f434;return db[_0x4670('0x32')][_0x4670('0x54')]({'where':{'id':_0x244fb6[_0x4670('0x4c')]['id']}})[_0x4670('0x2a')](handleEntityNotFound(_0x2ee84e,null))[_0x4670('0x2a')](function(_0x24d912){if(_0x24d912){_0x232219=_0x24d912;_0xfee4e0['model']=_['keys'](db[_0x4670('0x55')][_0x4670('0x33')]);_0xfee4e0[_0x4670('0x38')]=_['keys'](_0x244fb6[_0x4670('0x38')]);_0xfee4e0[_0x4670('0x42')]=_[_0x4670('0x3a')](_0xfee4e0[_0x4670('0x37')],_0xfee4e0[_0x4670('0x38')]);_0x75dcc6[_0x4670('0x3b')]=_['intersection'](_0xfee4e0[_0x4670('0x37')],qs[_0x4670('0x3c')](_0x244fb6[_0x4670('0x38')]['fields']));_0x75dcc6[_0x4670('0x3b')]=_0x75dcc6[_0x4670('0x3b')][_0x4670('0x3d')]?_0x75dcc6[_0x4670('0x3b')]:_0xfee4e0[_0x4670('0x37')];_0x75dcc6[_0x4670('0x40')]=qs[_0x4670('0x41')](_0x244fb6[_0x4670('0x38')][_0x4670('0x41')]);_0x75dcc6[_0x4670('0x56')]=qs[_0x4670('0x42')](_[_0x4670('0x43')](_0x244fb6['query'],_0xfee4e0[_0x4670('0x42')]));if(_0x244fb6['query']['filter']){_0x75dcc6[_0x4670('0x56')]=_[_0x4670('0x46')](_0x75dcc6['where'],{'$or':_[_0x4670('0x31')](_0x75dcc6[_0x4670('0x3b')],function(_0x1b165a){var _0x5b3b38={};_0x5b3b38[_0x1b165a]={'$like':'%'+_0x244fb6[_0x4670('0x38')][_0x4670('0x44')]+'%'};return _0x5b3b38;})});}_0x75dcc6=_['merge']({},_0x75dcc6,_0x244fb6[_0x4670('0x47')]);return _0x232219[_0x4670('0x53')](_0x75dcc6);}})[_0x4670('0x2a')](function(_0x390462){if(_0x390462){_0x27f434=_0x390462[_0x4670('0x3d')];if(!_0x244fb6[_0x4670('0x38')][_0x4670('0x3e')]('nolimit')){_0x75dcc6[_0x4670('0x22')]=qs[_0x4670('0x22')](_0x244fb6[_0x4670('0x38')][_0x4670('0x22')]);_0x75dcc6['offset']=qs[_0x4670('0x20')](_0x244fb6[_0x4670('0x38')][_0x4670('0x20')]);}return _0x232219[_0x4670('0x53')](_0x75dcc6);}})[_0x4670('0x2a')](function(_0x52eea1){if(_0x52eea1){return _0x52eea1?{'count':_0x27f434,'rows':_0x52eea1}:null;}})[_0x4670('0x2a')](respondWithResult(_0x2ee84e,null))[_0x4670('0x4a')](handleError(_0x2ee84e,null));};exports['addConfiguration']=function(_0x369291,_0xcc2164,_0x995246){if(_0x369291['body']['id']){delete _0x369291[_0x4670('0x50')]['id'];}return db['ZohoAccount'][_0x4670('0x54')]({'where':{'id':_0x369291[_0x4670('0x4c')]['id']}})[_0x4670('0x2a')](handleEntityNotFound(_0xcc2164,null))[_0x4670('0x2a')](function(_0x40a278){if(_0x40a278){_0x369291[_0x4670('0x50')][_0x4670('0x57')]=_0x40a278['id'];_0x369291[_0x4670('0x50')][_0x4670('0x58')]=integrations[_0x4670('0x59')](_0x369291['body'][_0x4670('0x5a')],_0x369291[_0x4670('0x50')][_0x4670('0x35')]);_0x369291[_0x4670('0x50')][_0x4670('0x5b')]=integrations['getDescriptions'](_0x369291[_0x4670('0x50')]['channel'],_0x369291[_0x4670('0x50')][_0x4670('0x35')]);return db[_0x4670('0x55')][_0x4670('0x4f')](_0x369291[_0x4670('0x50')],{'include':[{'model':db[_0x4670('0x5c')],'as':_0x4670('0x58')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x4670('0x2a')](respondWithResult(_0xcc2164,null))['catch'](handleError(_0xcc2164,null));};function getAccessToken(_0x439e30){return new Promise(function(_0x28698c,_0x53a499){var _0x1ec9b5;switch(_0x439e30[_0x4670('0x5d')]){case'US':_0x1ec9b5=_0x4670('0x5e');break;case'AU':_0x1ec9b5=_0x4670('0x5f');break;case'EU':_0x1ec9b5=_0x4670('0x60');break;case'IN':_0x1ec9b5='https://accounts.zoho.in';break;case'CN':_0x1ec9b5=_0x4670('0x61');break;default:_0x1ec9b5=_0x4670('0x60');break;}var _0x5ed73d={'method':_0x4670('0x62'),'uri':_0x1ec9b5+_0x4670('0x63'),'qs':{'refresh_token':_0x439e30[_0x4670('0x64')],'client_id':_0x439e30[_0x4670('0x65')],'client_secret':_0x439e30['clientSecret'],'grant_type':_0x4670('0x66')},'json':!![]};return rp(_0x5ed73d)['then'](function(_0xd602a0){if(_0xd602a0[_0x4670('0x67')]){_0x28698c(_0xd602a0[_0x4670('0x67')]);}else{_0x53a499(_0x4670('0x68'));}})[_0x4670('0x4a')](function(_0x282f5d){_0x53a499(_0x282f5d);});});}exports[_0x4670('0x69')]=function(_0x34a548,_0x35d516,_0x32a3ae){var _0x22cfe3,_0x462c45,_0x3c302f,_0x2b337f,_0x49a55e;return db[_0x4670('0x32')]['findOne']({'where':{'id':_0x34a548[_0x4670('0x4c')]['id']},'attributes':['id',_0x4670('0x6a'),_0x4670('0x5d'),_0x4670('0x65'),_0x4670('0x6b'),'serverUrl',_0x4670('0x6c'),_0x4670('0x64')]})[_0x4670('0x2a')](handleEntityNotFound(_0x35d516,null))[_0x4670('0x2a')](function(_0x424ac0){_0x49a55e=_0x424ac0;_0x22cfe3=_0x49a55e[_0x4670('0x6a')];_0x462c45=_0x22cfe3===_0x4670('0x6d')?'eu':'com';_0x3c302f=_0x49a55e[_0x4670('0x6e')];var _0x58539b=_0x3c302f[_0x4670('0x6f')](-0x1);if(_0x58539b==='/'||_0x58539b==='\x5c'||_0x58539b===':'){_0x3c302f=_0x3c302f[_0x4670('0x70')](0x0,_0x3c302f[_0x4670('0x71')](_0x58539b));}if(!_0x49a55e[_0x4670('0x64')]){throw new Error(_0x4670('0x72'));}return getAccessToken(_0x49a55e);})['then'](function(_0x5656ea){if(_0x5656ea){return rp({'method':'GET','uri':util['format'](_0x4670('0x73'),_0x462c45),'qs':{'module':_0x4670('0x74')},'headers':{'Authorization':_0x4670('0x75')+_0x5656ea},'json':!![]});}})['then'](function(_0x1c9b67){if(_0x1c9b67){if(_0x1c9b67['response']&&_0x1c9b67[_0x4670('0x76')][_0x4670('0x2c')]){throw new Error(_0x1c9b67[_0x4670('0x76')]['error'][_0x4670('0x77')]);}var _0x34cf36=[];var _0x21a6aa=[];var _0x3c93f7=[_0x4670('0x78'),'Subject',_0x4670('0x79'),'WhoId','Call_Duration',_0x4670('0x7a'),_0x4670('0x7b'),'Call_Type'];_0x21a6aa=_[_0x4670('0x7c')](_0x1c9b67[_0x4670('0x3c')],function(_0x192c2d){return _0x3c93f7[_0x4670('0x7d')](_0x192c2d[_0x4670('0x7e')]);});for(var _0x2c4890=0x0;_0x2c4890<_0x21a6aa[_0x4670('0x3d')];_0x2c4890++){if(_0x21a6aa[_0x2c4890][_0x4670('0x7f')]===![]){_0x34cf36[_0x4670('0x80')]({'id':_0x21a6aa[_0x2c4890]['id'],'name':_0x21a6aa[_0x2c4890][_0x4670('0x81')],'custom':_0x21a6aa[_0x2c4890][_0x4670('0x82')],'options':_0x21a6aa[_0x2c4890][_0x4670('0x83')]==='picklist'&&_0x21a6aa[_0x2c4890][_0x4670('0x84')]['length']>-0x1?_[_0x4670('0x31')](_0x21a6aa[_0x2c4890]['pick_list_values'],function(_0x3b86eb){return{'name':_0x3b86eb,'value':_0x3b86eb};}):[]});}}return{'count':_0x34cf36[_0x4670('0x3d')],'rows':_0x34cf36};}else{return{'count':0x0,'rows':[]};}})[_0x4670('0x2a')](respondWithResult(_0x35d516,null))['catch'](function(_0xa45941){var _0x44423e=_0x34a548[_0x4670('0x38')]['test']?0x1f4:_0xa45941[_0x4670('0x85')]||0x1f4;logger['error'](_0x4670('0x86'),_0x4670('0x69'),_0x44423e,JSON[_0x4670('0x87')](_0xa45941));delete _0xa45941[_0x4670('0x2e')];if(_0x44423e===0x191){_0x44423e=0x190;}_0x35d516[_0x4670('0x1d')](_0x44423e)['send'](_0x34a548[_0x4670('0x38')][_0x4670('0x88')]?{'message':_0x4670('0x89'),'statusCode':_0xa45941[_0x4670('0x85')]}:_0xa45941);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 952a950..e48d60d 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 _0xed65=['exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lodash','util','../../config/logger','api','bluebird','path','./intZohoAccount.attributes'];(function(_0x222104,_0x1d99bc){var _0x5043af=function(_0x4ae8cb){while(--_0x4ae8cb){_0x222104['push'](_0x222104['shift']());}};_0x5043af(++_0x1d99bc);}(_0xed65,0xa1));var _0x5ed6=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xed65[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require(_0x5ed6('0x0'));var util=require(_0x5ed6('0x1'));var logger=require(_0x5ed6('0x2'))(_0x5ed6('0x3'));var moment=require('moment');var BPromise=require(_0x5ed6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ed6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5ed6('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x5ed6('0x7')]=function(_0x28ca18,_0x2faffb){return _0x28ca18[_0x5ed6('0x8')](_0x5ed6('0x9'),attributes,{'tableName':_0x5ed6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2e38fd,_0x1f04bb,_0x5b9df4){if(_0x2e38fd[_0x5ed6('0xb')](_0x5ed6('0xc'))||_0x2e38fd[_0x5ed6('0xb')](_0x5ed6('0xd'))||_0x2e38fd[_0x5ed6('0xb')](_0x5ed6('0xe'))||_0x2e38fd[_0x5ed6('0xb')](_0x5ed6('0xf'))||_0x2e38fd[_0x5ed6('0xb')](_0x5ed6('0x10'))||_0x2e38fd[_0x5ed6('0xb')](_0x5ed6('0x11'))){var _0x583ff8,_0x472a8e;_0x583ff8=_0x2e38fd[_0x5ed6('0xd')];var _0x2773cc=_0x583ff8[_0x5ed6('0x12')](-0x1);if(_0x2773cc==='/'||_0x2773cc==='\x5c'||_0x2773cc===':'){_0x583ff8=_0x583ff8[_0x5ed6('0x13')](0x0,_0x583ff8[_0x5ed6('0x14')](_0x2773cc));}switch(_0x2e38fd[_0x5ed6('0xc')]){case'US':_0x472a8e=_0x5ed6('0x15');break;case'AU':_0x472a8e=_0x5ed6('0x16');break;case'IN':_0x472a8e=_0x5ed6('0x17');break;case'CN':_0x472a8e=_0x5ed6('0x18');break;default:_0x472a8e=_0x5ed6('0x19');break;}var _0x3b0265={'method':_0x5ed6('0x1a'),'uri':_0x472a8e+_0x5ed6('0x1b'),'form':{'grant_type':_0x5ed6('0x1c'),'client_id':_0x2e38fd['clientId'],'client_secret':_0x2e38fd[_0x5ed6('0xf')],'redirect_uri':_0x2e38fd[_0x5ed6('0xd')],'code':_0x2e38fd[_0x5ed6('0x10')]},'headers':{'Content-Type':_0x5ed6('0x1d')}};return rp(_0x3b0265)[_0x5ed6('0x1e')](function(_0x369299){var _0x442513=JSON[_0x5ed6('0x1f')](_0x369299);if(_0x442513['refresh_token']){_0x2e38fd[_0x5ed6('0x20')]=_0x442513[_0x5ed6('0x21')];logger[_0x5ed6('0x22')](util[_0x5ed6('0x23')](_0x5ed6('0x24'),_0x2e38fd[_0x5ed6('0x25')],_0x2e38fd['id']));}else{logger[_0x5ed6('0x26')](util['format'](_0x5ed6('0x27'),_0x2e38fd[_0x5ed6('0x25')],_0x2e38fd['id']),util[_0x5ed6('0x28')](_0x442513,{'showHidden':![],'depth':null}));}return _0x5b9df4(null,_0x1f04bb);})[_0x5ed6('0x29')](function(_0xe62ffb){logger[_0x5ed6('0x26')](util[_0x5ed6('0x23')](_0x5ed6('0x27'),_0x2e38fd[_0x5ed6('0x25')],_0x2e38fd['id']),util[_0x5ed6('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x5b9df4(_0xe62ffb);});}else{return _0x5b9df4(null,_0x1f04bb);}},'beforeUpdate':function(_0x4f0a01,_0x1da73e,_0x4ecc04){if(_0x4f0a01[_0x5ed6('0xb')](_0x5ed6('0xc'))||_0x4f0a01[_0x5ed6('0xb')](_0x5ed6('0xd'))||_0x4f0a01['changed']('clientId')||_0x4f0a01[_0x5ed6('0xb')]('clientSecret')||_0x4f0a01['changed']('code')||_0x4f0a01[_0x5ed6('0xb')]('host')){var _0x5ca7c9,_0x5bf2c0;_0x5ca7c9=_0x4f0a01[_0x5ed6('0xd')];var _0xaeb439=_0x5ca7c9[_0x5ed6('0x12')](-0x1);if(_0xaeb439==='/'||_0xaeb439==='\x5c'||_0xaeb439===':'){_0x5ca7c9=_0x5ca7c9[_0x5ed6('0x13')](0x0,_0x5ca7c9['lastIndexOf'](_0xaeb439));}switch(_0x4f0a01[_0x5ed6('0xc')]){case'US':_0x5bf2c0=_0x5ed6('0x15');break;case'AU':_0x5bf2c0=_0x5ed6('0x16');break;case'IN':_0x5bf2c0=_0x5ed6('0x17');break;case'CN':_0x5bf2c0=_0x5ed6('0x18');break;default:_0x5bf2c0=_0x5ed6('0x19');break;}var _0x487148={'method':_0x5ed6('0x1a'),'uri':_0x5bf2c0+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x4f0a01[_0x5ed6('0xe')],'client_secret':_0x4f0a01[_0x5ed6('0xf')],'redirect_uri':_0x4f0a01['serverUrl'],'code':_0x4f0a01[_0x5ed6('0x10')]},'headers':{'Content-Type':_0x5ed6('0x1d')}};return rp(_0x487148)[_0x5ed6('0x1e')](function(_0x4054fc){var _0x1ee865=JSON[_0x5ed6('0x1f')](_0x4054fc);if(_0x1ee865[_0x5ed6('0x21')]){_0x4f0a01['refreshToken']=_0x1ee865[_0x5ed6('0x21')];logger[_0x5ed6('0x22')](util[_0x5ed6('0x23')](_0x5ed6('0x24'),_0x4f0a01[_0x5ed6('0x25')],_0x4f0a01['id']));}else{logger[_0x5ed6('0x26')](util[_0x5ed6('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4f0a01[_0x5ed6('0x25')],_0x4f0a01['id']),util[_0x5ed6('0x28')](_0x1ee865,{'showHidden':![],'depth':null}));}return _0x4ecc04(null,_0x1da73e);})[_0x5ed6('0x29')](function(_0x23876b){logger['error'](util[_0x5ed6('0x23')](_0x5ed6('0x27'),_0x4f0a01[_0x5ed6('0x25')],_0x4f0a01['id']),util[_0x5ed6('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x4ecc04(_0x23876b);});}else{return _0x4ecc04(null,_0x1da73e);}}}});}; \ No newline at end of file +var _0x815f=['../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','host','slice','substring','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','code','then','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.eu','authorization_code','parse','refresh_token','catch','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes'];(function(_0x58bba9,_0x2a1e8c){var _0x47888c=function(_0x57c122){while(--_0x57c122){_0x58bba9['push'](_0x58bba9['shift']());}};_0x47888c(++_0x2a1e8c);}(_0x815f,0x1c5));var _0xf815=function(_0x30ab31,_0x4cc413){_0x30ab31=_0x30ab31-0x0;var _0x385ab5=_0x815f[_0x30ab31];return _0x385ab5;};'use strict';var _=require(_0xf815('0x0'));var util=require('util');var logger=require(_0xf815('0x1'))('api');var moment=require(_0xf815('0x2'));var BPromise=require(_0xf815('0x3'));var rp=require(_0xf815('0x4'));var fs=require('fs');var path=require(_0xf815('0x5'));var rimraf=require(_0xf815('0x6'));var config=require(_0xf815('0x7'));var attributes=require(_0xf815('0x8'));var integrations=require(_0xf815('0x9'));module['exports']=function(_0x4b22c1,_0x1665ff){return _0x4b22c1[_0xf815('0xa')](_0xf815('0xb'),attributes,{'tableName':_0xf815('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ac028,_0x48f73a,_0x2d3e29){if(_0x5ac028[_0xf815('0xd')]('zone')||_0x5ac028[_0xf815('0xd')](_0xf815('0xe'))||_0x5ac028[_0xf815('0xd')](_0xf815('0xf'))||_0x5ac028['changed']('clientSecret')||_0x5ac028[_0xf815('0xd')]('code')||_0x5ac028['changed'](_0xf815('0x10'))){var _0xbad1ce,_0x2c8506;_0xbad1ce=_0x5ac028[_0xf815('0xe')];var _0x5dd7be=_0xbad1ce[_0xf815('0x11')](-0x1);if(_0x5dd7be==='/'||_0x5dd7be==='\x5c'||_0x5dd7be===':'){_0xbad1ce=_0xbad1ce[_0xf815('0x12')](0x0,_0xbad1ce['lastIndexOf'](_0x5dd7be));}switch(_0x5ac028[_0xf815('0x13')]){case'US':_0x2c8506='https://accounts.zoho.com';break;case'AU':_0x2c8506=_0xf815('0x14');break;case'IN':_0x2c8506=_0xf815('0x15');break;case'CN':_0x2c8506=_0xf815('0x16');break;default:_0x2c8506='https://accounts.zoho.eu';break;}var _0x4d34af={'method':_0xf815('0x17'),'uri':_0x2c8506+_0xf815('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x5ac028['clientId'],'client_secret':_0x5ac028[_0xf815('0x19')],'redirect_uri':_0x5ac028['serverUrl'],'code':_0x5ac028[_0xf815('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4d34af)[_0xf815('0x1b')](function(_0x35aec6){var _0x161fad=JSON['parse'](_0x35aec6);if(_0x161fad['refresh_token']){_0x5ac028[_0xf815('0x1c')]=_0x161fad['refresh_token'];logger[_0xf815('0x1d')](util[_0xf815('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5ac028[_0xf815('0x1f')],_0x5ac028['id']));}else{logger[_0xf815('0x20')](util['format'](_0xf815('0x21'),_0x5ac028[_0xf815('0x1f')],_0x5ac028['id']),util[_0xf815('0x22')](_0x161fad,{'showHidden':![],'depth':null}));}return _0x2d3e29(null,_0x48f73a);})['catch'](function(_0x2971b3){logger[_0xf815('0x20')](util[_0xf815('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5ac028['name'],_0x5ac028['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2d3e29(_0x2971b3);});}else{return _0x2d3e29(null,_0x48f73a);}},'beforeUpdate':function(_0x29753c,_0x22955d,_0x410727){if(_0x29753c[_0xf815('0xd')](_0xf815('0x13'))||_0x29753c[_0xf815('0xd')](_0xf815('0xe'))||_0x29753c['changed'](_0xf815('0xf'))||_0x29753c[_0xf815('0xd')](_0xf815('0x19'))||_0x29753c['changed'](_0xf815('0x1a'))||_0x29753c['changed'](_0xf815('0x10'))){var _0x305fe8,_0x2ca569;_0x305fe8=_0x29753c[_0xf815('0xe')];var _0x46920e=_0x305fe8[_0xf815('0x11')](-0x1);if(_0x46920e==='/'||_0x46920e==='\x5c'||_0x46920e===':'){_0x305fe8=_0x305fe8['substring'](0x0,_0x305fe8[_0xf815('0x23')](_0x46920e));}switch(_0x29753c[_0xf815('0x13')]){case'US':_0x2ca569=_0xf815('0x24');break;case'AU':_0x2ca569=_0xf815('0x14');break;case'IN':_0x2ca569='https://accounts.zoho.in';break;case'CN':_0x2ca569=_0xf815('0x16');break;default:_0x2ca569=_0xf815('0x25');break;}var _0x2eb9bc={'method':'POST','uri':_0x2ca569+_0xf815('0x18'),'form':{'grant_type':_0xf815('0x26'),'client_id':_0x29753c[_0xf815('0xf')],'client_secret':_0x29753c[_0xf815('0x19')],'redirect_uri':_0x29753c['serverUrl'],'code':_0x29753c['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2eb9bc)[_0xf815('0x1b')](function(_0x42518e){var _0x39b731=JSON[_0xf815('0x27')](_0x42518e);if(_0x39b731[_0xf815('0x28')]){_0x29753c[_0xf815('0x1c')]=_0x39b731['refresh_token'];logger[_0xf815('0x1d')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x29753c[_0xf815('0x1f')],_0x29753c['id']));}else{logger[_0xf815('0x20')](util[_0xf815('0x1e')](_0xf815('0x21'),_0x29753c['name'],_0x29753c['id']),util[_0xf815('0x22')](_0x39b731,{'showHidden':![],'depth':null}));}return _0x410727(null,_0x22955d);})[_0xf815('0x29')](function(_0xf3feaf){logger['error'](util[_0xf815('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x29753c[_0xf815('0x1f')],_0x29753c['id']),util[_0xf815('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x410727(_0xf3feaf);});}else{return _0x410727(null,_0x22955d);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index a62c65b..91151e8 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 _0x5ba3=['options','raw','where','attributes','include','map','model','stringify','ShowZohoAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','ZohoAccount,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','GetZohoAccount','findAll'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5ba3,0x140));var _0x35ba=function(_0x16bb70,_0x290dfa){_0x16bb70=_0x16bb70-0x0;var _0x2d92fb=_0x5ba3[_0x16bb70];return _0x2d92fb;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}exports[_0x35ba('0x13')]=function(_0x374f91){var _0x4e96c6=this;return new Promise(function(_0x423666,_0x247440){return db['ZohoAccount'][_0x35ba('0x14')]({'raw':_0x374f91[_0x35ba('0x15')]?_0x374f91[_0x35ba('0x15')][_0x35ba('0x16')]===undefined?!![]:![]:!![],'where':_0x374f91[_0x35ba('0x15')]?_0x374f91[_0x35ba('0x15')][_0x35ba('0x17')]||null:null,'attributes':_0x374f91[_0x35ba('0x15')]?_0x374f91[_0x35ba('0x15')][_0x35ba('0x18')]||null:null,'limit':_0x374f91[_0x35ba('0x15')]?_0x374f91[_0x35ba('0x15')]['limit']||null:null,'include':_0x374f91[_0x35ba('0x15')]?_0x374f91[_0x35ba('0x15')][_0x35ba('0x19')]?_[_0x35ba('0x1a')](_0x374f91[_0x35ba('0x15')][_0x35ba('0x19')],function(_0xa9080b){return{'model':db[_0xa9080b[_0x35ba('0x1b')]],'as':_0xa9080b['as'],'attributes':_0xa9080b['attributes'],'include':_0xa9080b[_0x35ba('0x19')]?_['map'](_0xa9080b['include'],function(_0x1cffd9){return{'model':db[_0x1cffd9['model']],'as':_0x1cffd9['as'],'attributes':_0x1cffd9[_0x35ba('0x18')],'include':_0x1cffd9[_0x35ba('0x19')]?_[_0x35ba('0x1a')](_0x1cffd9[_0x35ba('0x19')],function(_0x398775){return{'model':db[_0x398775[_0x35ba('0x1b')]],'as':_0x398775['as'],'attributes':_0x398775[_0x35ba('0x18')]};}):[]};}):[]};}):[]:[]})[_0x35ba('0x9')](function(_0x13b8fb){logger[_0x35ba('0xa')](_0x35ba('0x13'),_0x374f91);logger[_0x35ba('0xc')](_0x35ba('0x13'),_0x374f91,JSON[_0x35ba('0x1c')](_0x13b8fb));_0x423666(_0x13b8fb);})[_0x35ba('0x12')](function(_0x14cbbc){logger['error'](_0x35ba('0x13'),_0x14cbbc[_0x35ba('0xf')],_0x374f91);_0x247440(_0x4e96c6[_0x35ba('0xd')](0x1f4,_0x14cbbc[_0x35ba('0xf')]));});});};exports[_0x35ba('0x1d')]=function(_0x1eceef){var _0xe130c5=this;return new Promise(function(_0x246981,_0x1cb674){return db['ZohoAccount'][_0x35ba('0x1e')]({'raw':_0x1eceef[_0x35ba('0x15')]?_0x1eceef[_0x35ba('0x15')][_0x35ba('0x16')]===undefined?!![]:![]:!![],'where':_0x1eceef['options']?_0x1eceef['options'][_0x35ba('0x17')]||null:null,'attributes':_0x1eceef[_0x35ba('0x15')]?_0x1eceef[_0x35ba('0x15')]['attributes']||null:null,'include':_0x1eceef[_0x35ba('0x15')]?_0x1eceef['options'][_0x35ba('0x19')]?_[_0x35ba('0x1a')](_0x1eceef['options']['include'],function(_0x1dd35f){return{'model':db[_0x1dd35f[_0x35ba('0x1b')]],'as':_0x1dd35f['as'],'attributes':_0x1dd35f[_0x35ba('0x18')],'include':_0x1dd35f[_0x35ba('0x19')]?_['map'](_0x1dd35f[_0x35ba('0x19')],function(_0x14e297){return{'model':db[_0x14e297[_0x35ba('0x1b')]],'as':_0x14e297['as'],'attributes':_0x14e297['attributes'],'include':_0x14e297[_0x35ba('0x19')]?_[_0x35ba('0x1a')](_0x14e297['include'],function(_0x519016){return{'model':db[_0x519016[_0x35ba('0x1b')]],'as':_0x519016['as'],'attributes':_0x519016[_0x35ba('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e85f2){logger['info'](_0x35ba('0x1d'),_0x1eceef);logger['debug']('ShowZohoAccount',_0x1eceef,JSON[_0x35ba('0x1c')](_0x5e85f2));_0x246981(_0x5e85f2);})[_0x35ba('0x12')](function(_0x2a22c8){logger[_0x35ba('0xd')](_0x35ba('0x1d'),_0x2a22c8[_0x35ba('0xf')],_0x1eceef);_0x1cb674(_0xe130c5[_0x35ba('0xd')](0x1f4,_0x2a22c8[_0x35ba('0xf')]));});});}; \ No newline at end of file +var _0x6017=['model','find','ShowZohoAccount','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x4852ff,_0x35118d){var _0x3ee92e=function(_0x37de82){while(--_0x37de82){_0x4852ff['push'](_0x4852ff['shift']());}};_0x3ee92e(++_0x35118d);}(_0x6017,0xae));var _0x7601=function(_0x9f2d37,_0x3fa295){_0x9f2d37=_0x9f2d37-0x0;var _0x3d2ac2=_0x6017[_0x9f2d37];return _0x3d2ac2;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var moment=require(_0x7601('0x2'));var BPromise=require('bluebird');var rs=require(_0x7601('0x3'));var fs=require('fs');var Redis=require(_0x7601('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7601('0x5'));var logger=require('../../config/logger')(_0x7601('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7601('0x7')][_0x7601('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcb5ed9,_0x34a36d,_0x2bc643){return new BPromise(function(_0xe6e524,_0x4ff3e4){return client[_0x7601('0x9')](_0xcb5ed9,_0x2bc643)[_0x7601('0xa')](function(_0xd3a338){logger['info'](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));logger[_0x7601('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x34a36d,_0x7601('0xc'),JSON[_0x7601('0xe')](_0xd3a338));if(_0xd3a338[_0x7601('0xf')]){if(_0xd3a338[_0x7601('0xf')][_0x7601('0x10')]===0x1f4){logger[_0x7601('0xf')](_0x7601('0xb'),_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0x4ff3e4(_0xd3a338[_0x7601('0xf')]['message']);}logger[_0x7601('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0xe6e524(_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);}else{logger[_0x7601('0x12')](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));_0xe6e524(_0xd3a338[_0x7601('0x13')][_0x7601('0x11')]);}})['catch'](function(_0xa0e556){logger[_0x7601('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x34a36d,_0xa0e556);_0x4ff3e4(_0xa0e556);});});}exports[_0x7601('0x14')]=function(_0x5c3fb7){var _0x5f530e=this;return new Promise(function(_0x22520e,_0x403e38){return db[_0x7601('0x15')][_0x7601('0x16')]({'raw':_0x5c3fb7[_0x7601('0x17')]?_0x5c3fb7[_0x7601('0x17')][_0x7601('0x18')]===undefined?!![]:![]:!![],'where':_0x5c3fb7['options']?_0x5c3fb7[_0x7601('0x17')][_0x7601('0x19')]||null:null,'attributes':_0x5c3fb7['options']?_0x5c3fb7[_0x7601('0x17')][_0x7601('0x1a')]||null:null,'limit':_0x5c3fb7[_0x7601('0x17')]?_0x5c3fb7[_0x7601('0x17')][_0x7601('0x1b')]||null:null,'include':_0x5c3fb7[_0x7601('0x17')]?_0x5c3fb7['options'][_0x7601('0x1c')]?_[_0x7601('0x1d')](_0x5c3fb7[_0x7601('0x17')][_0x7601('0x1c')],function(_0x57e7a6){return{'model':db[_0x57e7a6[_0x7601('0x1e')]],'as':_0x57e7a6['as'],'attributes':_0x57e7a6['attributes'],'include':_0x57e7a6[_0x7601('0x1c')]?_['map'](_0x57e7a6['include'],function(_0x326f8f){return{'model':db[_0x326f8f[_0x7601('0x1e')]],'as':_0x326f8f['as'],'attributes':_0x326f8f['attributes'],'include':_0x326f8f['include']?_[_0x7601('0x1d')](_0x326f8f['include'],function(_0x57f6e9){return{'model':db[_0x57f6e9[_0x7601('0x1e')]],'as':_0x57f6e9['as'],'attributes':_0x57f6e9[_0x7601('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7601('0xa')](function(_0x5807ce){logger[_0x7601('0x12')]('GetZohoAccount',_0x5c3fb7);logger[_0x7601('0xd')](_0x7601('0x14'),_0x5c3fb7,JSON['stringify'](_0x5807ce));_0x22520e(_0x5807ce);})['catch'](function(_0x44d765){logger[_0x7601('0xf')](_0x7601('0x14'),_0x44d765[_0x7601('0x11')],_0x5c3fb7);_0x403e38(_0x5f530e[_0x7601('0xf')](0x1f4,_0x44d765[_0x7601('0x11')]));});});};exports['ShowZohoAccount']=function(_0x497f5f){var _0x27f423=this;return new Promise(function(_0x170d27,_0xa483c4){return db[_0x7601('0x15')][_0x7601('0x1f')]({'raw':_0x497f5f['options']?_0x497f5f['options'][_0x7601('0x18')]===undefined?!![]:![]:!![],'where':_0x497f5f[_0x7601('0x17')]?_0x497f5f[_0x7601('0x17')][_0x7601('0x19')]||null:null,'attributes':_0x497f5f[_0x7601('0x17')]?_0x497f5f['options'][_0x7601('0x1a')]||null:null,'include':_0x497f5f[_0x7601('0x17')]?_0x497f5f['options'][_0x7601('0x1c')]?_[_0x7601('0x1d')](_0x497f5f[_0x7601('0x17')][_0x7601('0x1c')],function(_0x1f9d17){return{'model':db[_0x1f9d17['model']],'as':_0x1f9d17['as'],'attributes':_0x1f9d17[_0x7601('0x1a')],'include':_0x1f9d17[_0x7601('0x1c')]?_[_0x7601('0x1d')](_0x1f9d17[_0x7601('0x1c')],function(_0x570770){return{'model':db[_0x570770[_0x7601('0x1e')]],'as':_0x570770['as'],'attributes':_0x570770['attributes'],'include':_0x570770['include']?_[_0x7601('0x1d')](_0x570770[_0x7601('0x1c')],function(_0x46d013){return{'model':db[_0x46d013[_0x7601('0x1e')]],'as':_0x46d013['as'],'attributes':_0x46d013[_0x7601('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7601('0xa')](function(_0x259fd1){logger[_0x7601('0x12')](_0x7601('0x20'),_0x497f5f);logger[_0x7601('0xd')](_0x7601('0x20'),_0x497f5f,JSON[_0x7601('0xe')](_0x259fd1));_0x170d27(_0x259fd1);})[_0x7601('0x21')](function(_0x30c3cc){logger['error'](_0x7601('0x20'),_0x30c3cc[_0x7601('0x11')],_0x497f5f);_0xa483c4(_0x27f423[_0x7601('0xf')](0x1f4,_0x30c3cc[_0x7601('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index e424376..1ebe62f 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 _0x10db=['delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x10db,0xb1));var _0xb10d=function(_0x1ef800,_0x390848){_0x1ef800=_0x1ef800-0x0;var _0x2864ac=_0x10db[_0x1ef800];return _0x2864ac;};'use strict';var multer=require(_0xb10d('0x0'));var util=require(_0xb10d('0x1'));var path=require(_0xb10d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb10d('0x3')]();var fs_extra=require(_0xb10d('0x4'));var auth=require(_0xb10d('0x5'));var interaction=require(_0xb10d('0x6'));var config=require('../../config/environment');var controller=require(_0xb10d('0x7'));router[_0xb10d('0x8')]('/',auth[_0xb10d('0x9')](),controller[_0xb10d('0xa')]);router[_0xb10d('0x8')](_0xb10d('0xb'),auth[_0xb10d('0x9')](),controller[_0xb10d('0xc')]);router[_0xb10d('0x8')]('/:id/fields',auth[_0xb10d('0x9')](),controller[_0xb10d('0xd')]);router[_0xb10d('0x8')](_0xb10d('0xe'),auth[_0xb10d('0x9')](),controller['getSubjects']);router[_0xb10d('0x8')](_0xb10d('0xf'),auth[_0xb10d('0x9')](),controller[_0xb10d('0x10')]);router[_0xb10d('0x11')]('/',auth[_0xb10d('0x9')](),controller[_0xb10d('0x12')]);router[_0xb10d('0x13')]('/:id',auth[_0xb10d('0x9')](),controller[_0xb10d('0x14')]);router[_0xb10d('0x15')]('/:id',auth[_0xb10d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcb1f=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','show','/:id/fields'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcb1f,0x183));var _0xfcb1=function(_0x318d20,_0x177706){_0x318d20=_0x318d20-0x0;var _0x6ae05b=_0xcb1f[_0x318d20];return _0x6ae05b;};'use strict';var multer=require(_0xfcb1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfcb1('0x1'));var express=require(_0xfcb1('0x2'));var router=express['Router']();var fs_extra=require(_0xfcb1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfcb1('0x4'));var config=require(_0xfcb1('0x5'));var controller=require(_0xfcb1('0x6'));router[_0xfcb1('0x7')]('/',auth['isAuthenticated'](),controller[_0xfcb1('0x8')]);router[_0xfcb1('0x7')](_0xfcb1('0x9'),auth['isAuthenticated'](),controller[_0xfcb1('0xa')]);router[_0xfcb1('0x7')](_0xfcb1('0xb'),auth[_0xfcb1('0xc')](),controller[_0xfcb1('0xd')]);router['get'](_0xfcb1('0xe'),auth[_0xfcb1('0xc')](),controller[_0xfcb1('0xf')]);router[_0xfcb1('0x7')](_0xfcb1('0x10'),auth[_0xfcb1('0xc')](),controller['getDescriptions']);router[_0xfcb1('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xfcb1('0x9'),auth[_0xfcb1('0xc')](),controller[_0xfcb1('0x12')]);router['delete'](_0xfcb1('0x9'),auth[_0xfcb1('0xc')](),controller[_0xfcb1('0x13')]);module[_0xfcb1('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index af5b041..7d342c9 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 _0x5c71=['lead','contact','sequelize','exports','STRING','ENUM'];(function(_0x124671,_0x51c8e0){var _0x3fc17=function(_0x3d98e8){while(--_0x3d98e8){_0x124671['push'](_0x124671['shift']());}};_0x3fc17(++_0x51c8e0);}(_0x5c71,0x188));var _0x15c7=function(_0x311e39,_0x21f955){_0x311e39=_0x311e39-0x0;var _0x40687b=_0x5c71[_0x311e39];return _0x40687b;};'use strict';var Sequelize=require(_0x15c7('0x0'));module[_0x15c7('0x1')]={'name':{'type':Sequelize[_0x15c7('0x2')]},'moduleCreate':{'type':Sequelize[_0x15c7('0x3')](_0x15c7('0x4'),_0x15c7('0x5'),'nothing'),'defaultValue':_0x15c7('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0x15c7('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x15c7('0x2')]}}; \ No newline at end of file +var _0x2c9d=['contact_lead','STRING','sequelize','exports','lead','contact','nothing','ENUM'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x2c9d,0x13a));var _0xd2c9=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x2c9d[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0xd2c9('0x0'));module[_0xd2c9('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0xd2c9('0x2'),_0xd2c9('0x3'),_0xd2c9('0x4')),'defaultValue':_0xd2c9('0x2')},'moduleSearch':{'type':Sequelize[_0xd2c9('0x5')](_0xd2c9('0x6'),'contact',_0xd2c9('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xd2c9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 04c0025..e7f8ebe 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 _0x6af5=['create','body','getFields','findOne','ZohoField','order','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','sort','where','pick','filters','filter','VIRTUAL','merge','options','include','catch','show','params','includeAll','find'];(function(_0x1631cf,_0x231557){var _0x25e911=function(_0x14d7a9){while(--_0x14d7a9){_0x1631cf['push'](_0x1631cf['shift']());}};_0x25e911(++_0x231557);}(_0x6af5,0xa0));var _0x56af=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x6af5[_0x368fb9];return _0x4892fb;};'use strict';var emlformat=require(_0x56af('0x0'));var rimraf=require(_0x56af('0x1'));var zipdir=require(_0x56af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x56af('0x3'));var moment=require('moment');var BPromise=require(_0x56af('0x4'));var Mustache=require('mustache');var util=require(_0x56af('0x5'));var path=require(_0x56af('0x6'));var sox=require('sox');var csv=require(_0x56af('0x7'));var ejs=require(_0x56af('0x8'));var fs=require('fs');var fs_extra=require(_0x56af('0x9'));var _=require(_0x56af('0xa'));var squel=require('squel');var crypto=require(_0x56af('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x56af('0xc'));var toCsv=require(_0x56af('0x7'));var querystring=require(_0x56af('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x56af('0xe'));var as=require(_0x56af('0xf'));var hardwareService=require(_0x56af('0x10'));var logger=require('../../config/logger')(_0x56af('0x11'));var utils=require(_0x56af('0x12'));var config=require(_0x56af('0x13'));var licenseUtil=require(_0x56af('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45826c,_0x2e0b2e){_0x2e0b2e=_0x2e0b2e||0xcc;return function(_0x20d4a3){if(_0x20d4a3){return _0x45826c[_0x56af('0x15')](_0x2e0b2e);}return _0x45826c[_0x56af('0x16')](_0x2e0b2e)['end']();};}function respondWithResult(_0x28666f,_0x3cd9c9){_0x3cd9c9=_0x3cd9c9||0xc8;return function(_0x5dfaeb){if(_0x5dfaeb){return _0x28666f[_0x56af('0x16')](_0x3cd9c9)[_0x56af('0x17')](_0x5dfaeb);}};}function respondWithFilteredResult(_0x2c8ab9,_0x3fc426){return function(_0x10e216){if(_0x10e216){var _0x4202e9=typeof _0x3fc426[_0x56af('0x18')]==='undefined'&&typeof _0x3fc426[_0x56af('0x19')]===_0x56af('0x1a');var _0x473550=_0x10e216[_0x56af('0x1b')];var _0x2d36a3=_0x4202e9?0x0:_0x3fc426[_0x56af('0x18')];var _0x5c99af=_0x4202e9?_0x10e216[_0x56af('0x1b')]:_0x3fc426['offset']+_0x3fc426['limit'];var _0x4df91c;if(_0x5c99af>=_0x473550){_0x5c99af=_0x473550;_0x4df91c=0xc8;}else{_0x4df91c=0xce;}_0x2c8ab9['status'](_0x4df91c);return _0x2c8ab9[_0x56af('0x1c')](_0x56af('0x1d'),_0x2d36a3+'-'+_0x5c99af+'/'+_0x473550)['json'](_0x10e216);}return null;};}function patchUpdates(_0x149489){return function(_0x9102a0){try{jsonpatch[_0x56af('0x1e')](_0x9102a0,_0x149489,!![]);}catch(_0x48c3fe){return BPromise[_0x56af('0x1f')](_0x48c3fe);}return _0x9102a0[_0x56af('0x20')]();};}function saveUpdates(_0x578f31,_0x2f164c){return function(_0x16264b){if(_0x16264b){return _0x16264b[_0x56af('0x21')](_0x578f31)[_0x56af('0x22')](function(_0x37124c){return _0x37124c;});}return null;};}function removeEntity(_0x430c8e,_0x5ab937){return function(_0x501ffc){if(_0x501ffc){return _0x501ffc[_0x56af('0x23')]()['then'](function(){_0x430c8e['status'](0xcc)[_0x56af('0x24')]();});}};}function handleEntityNotFound(_0x8863e8,_0x33b646){return function(_0x22ef03){if(!_0x22ef03){_0x8863e8[_0x56af('0x15')](0x194);}return _0x22ef03;};}function handleError(_0x30c579,_0x560461){_0x560461=_0x560461||0x1f4;return function(_0x274332){logger['error'](_0x274332[_0x56af('0x25')]);if(_0x274332[_0x56af('0x26')]){delete _0x274332[_0x56af('0x26')];}_0x30c579[_0x56af('0x16')](_0x560461)[_0x56af('0x27')](_0x274332);};}exports['index']=function(_0x43da98,_0x537c08){var _0x3c3699={},_0x4f97ee={},_0x6f42e5={'count':0x0,'rows':[]};var _0x3da651=_[_0x56af('0x28')](db[_0x56af('0x29')][_0x56af('0x2a')],function(_0x323478){return{'name':_0x323478[_0x56af('0x2b')],'type':_0x323478['type']['key']};});_0x4f97ee[_0x56af('0x2c')]=_[_0x56af('0x28')](_0x3da651,'name');_0x4f97ee[_0x56af('0x2d')]=_[_0x56af('0x2e')](_0x43da98[_0x56af('0x2d')]);_0x4f97ee['filters']=_[_0x56af('0x2f')](_0x4f97ee[_0x56af('0x2c')],_0x4f97ee[_0x56af('0x2d')]);_0x3c3699[_0x56af('0x30')]=_[_0x56af('0x2f')](_0x4f97ee[_0x56af('0x2c')],qs[_0x56af('0x31')](_0x43da98['query']['fields']));_0x3c3699[_0x56af('0x30')]=_0x3c3699['attributes'][_0x56af('0x32')]?_0x3c3699[_0x56af('0x30')]:_0x4f97ee['model'];if(!_0x43da98['query']['hasOwnProperty']('nolimit')){_0x3c3699['limit']=qs[_0x56af('0x19')](_0x43da98[_0x56af('0x2d')]['limit']);_0x3c3699[_0x56af('0x18')]=qs[_0x56af('0x18')](_0x43da98['query'][_0x56af('0x18')]);}_0x3c3699['order']=qs[_0x56af('0x33')](_0x43da98[_0x56af('0x2d')][_0x56af('0x33')]);_0x3c3699[_0x56af('0x34')]=qs['filters'](_[_0x56af('0x35')](_0x43da98['query'],_0x4f97ee[_0x56af('0x36')]),_0x3da651);if(_0x43da98[_0x56af('0x2d')][_0x56af('0x37')]){_0x3c3699[_0x56af('0x34')]=_['merge'](_0x3c3699[_0x56af('0x34')],{'$or':_[_0x56af('0x28')](_0x3da651,function(_0xd4d12a){if(_0xd4d12a['type']!==_0x56af('0x38')){var _0xcc0b06={};_0xcc0b06[_0xd4d12a[_0x56af('0x26')]]={'$like':'%'+_0x43da98[_0x56af('0x2d')][_0x56af('0x37')]+'%'};return _0xcc0b06;}})});}_0x3c3699=_[_0x56af('0x39')]({},_0x3c3699,_0x43da98[_0x56af('0x3a')]);var _0x3f7c3c={'where':_0x3c3699[_0x56af('0x34')]};return db[_0x56af('0x29')][_0x56af('0x1b')](_0x3f7c3c)[_0x56af('0x22')](function(_0x22388d){_0x6f42e5[_0x56af('0x1b')]=_0x22388d;if(_0x43da98[_0x56af('0x2d')]['includeAll']){_0x3c3699[_0x56af('0x3b')]=[{'all':!![]}];}return db[_0x56af('0x29')]['findAll'](_0x3c3699);})[_0x56af('0x22')](function(_0x5b0b16){_0x6f42e5['rows']=_0x5b0b16;return _0x6f42e5;})[_0x56af('0x22')](respondWithFilteredResult(_0x537c08,_0x3c3699))[_0x56af('0x3c')](handleError(_0x537c08,null));};exports[_0x56af('0x3d')]=function(_0x271adb,_0x3f33f4){var _0x13a9f5={'raw':![],'where':{'id':_0x271adb[_0x56af('0x3e')]['id']}},_0x23feeb={};_0x23feeb[_0x56af('0x2c')]=_[_0x56af('0x2e')](db[_0x56af('0x29')][_0x56af('0x2a')]);_0x23feeb[_0x56af('0x2d')]=_[_0x56af('0x2e')](_0x271adb[_0x56af('0x2d')]);_0x23feeb[_0x56af('0x36')]=_['intersection'](_0x23feeb['model'],_0x23feeb[_0x56af('0x2d')]);_0x13a9f5[_0x56af('0x30')]=_['intersection'](_0x23feeb[_0x56af('0x2c')],qs['fields'](_0x271adb[_0x56af('0x2d')][_0x56af('0x31')]));_0x13a9f5[_0x56af('0x30')]=_0x13a9f5[_0x56af('0x30')]['length']?_0x13a9f5['attributes']:_0x23feeb[_0x56af('0x2c')];if(_0x271adb[_0x56af('0x2d')][_0x56af('0x3f')]){_0x13a9f5[_0x56af('0x3b')]=[{'all':!![]}];}_0x13a9f5=_[_0x56af('0x39')]({},_0x13a9f5,_0x271adb[_0x56af('0x3a')]);return db[_0x56af('0x29')][_0x56af('0x40')](_0x13a9f5)[_0x56af('0x22')](handleEntityNotFound(_0x3f33f4,null))[_0x56af('0x22')](respondWithResult(_0x3f33f4,null))[_0x56af('0x3c')](handleError(_0x3f33f4,null));};exports[_0x56af('0x41')]=function(_0x191ec3,_0x5ecabe){return db[_0x56af('0x29')][_0x56af('0x41')](_0x191ec3[_0x56af('0x42')],{})[_0x56af('0x22')](respondWithResult(_0x5ecabe,0xc9))['catch'](handleError(_0x5ecabe,null));};exports[_0x56af('0x21')]=function(_0x25842d,_0x5473b8){if(_0x25842d[_0x56af('0x42')]['id']){delete _0x25842d['body']['id'];}return db[_0x56af('0x29')][_0x56af('0x40')]({'where':{'id':_0x25842d[_0x56af('0x3e')]['id']}})[_0x56af('0x22')](handleEntityNotFound(_0x5473b8,null))[_0x56af('0x22')](saveUpdates(_0x25842d[_0x56af('0x42')],null))[_0x56af('0x22')](respondWithResult(_0x5473b8,null))[_0x56af('0x3c')](handleError(_0x5473b8,null));};exports[_0x56af('0x23')]=function(_0x2b93a8,_0x5d4db5){return db[_0x56af('0x29')][_0x56af('0x40')]({'where':{'id':_0x2b93a8[_0x56af('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5d4db5,null))[_0x56af('0x22')](removeEntity(_0x5d4db5,null))[_0x56af('0x3c')](handleError(_0x5d4db5,null));};exports[_0x56af('0x43')]=function(_0x5271c7,_0x6b6234,_0x513a74){var _0x3a54e9={};var _0x50ee72={};var _0x5e7b6f;var _0x45ef41;return db[_0x56af('0x29')][_0x56af('0x44')]({'where':{'id':_0x5271c7[_0x56af('0x3e')]['id']}})['then'](handleEntityNotFound(_0x6b6234,null))[_0x56af('0x22')](function(_0xb45eaf){if(_0xb45eaf){_0x5e7b6f=_0xb45eaf;_0x50ee72[_0x56af('0x2c')]=_['keys'](db[_0x56af('0x45')][_0x56af('0x2a')]);_0x50ee72[_0x56af('0x2d')]=_[_0x56af('0x2e')](_0x5271c7[_0x56af('0x2d')]);_0x50ee72[_0x56af('0x36')]=_[_0x56af('0x2f')](_0x50ee72[_0x56af('0x2c')],_0x50ee72['query']);_0x3a54e9[_0x56af('0x30')]=_[_0x56af('0x2f')](_0x50ee72[_0x56af('0x2c')],qs['fields'](_0x5271c7[_0x56af('0x2d')][_0x56af('0x31')]));_0x3a54e9['attributes']=_0x3a54e9[_0x56af('0x30')][_0x56af('0x32')]?_0x3a54e9[_0x56af('0x30')]:_0x50ee72[_0x56af('0x2c')];_0x3a54e9[_0x56af('0x46')]=qs[_0x56af('0x33')](_0x5271c7[_0x56af('0x2d')][_0x56af('0x33')]);_0x3a54e9['where']=qs['filters'](_[_0x56af('0x35')](_0x5271c7[_0x56af('0x2d')],_0x50ee72[_0x56af('0x36')]));if(_0x5271c7['query'][_0x56af('0x37')]){_0x3a54e9['where']=_[_0x56af('0x39')](_0x3a54e9[_0x56af('0x34')],{'$or':_[_0x56af('0x28')](_0x3a54e9[_0x56af('0x30')],function(_0x4d9b5b){var _0x2e803f={};_0x2e803f[_0x4d9b5b]={'$like':'%'+_0x5271c7[_0x56af('0x2d')][_0x56af('0x37')]+'%'};return _0x2e803f;})});}_0x3a54e9=_[_0x56af('0x39')]({},_0x3a54e9,_0x5271c7[_0x56af('0x3a')]);return _0x5e7b6f[_0x56af('0x43')](_0x3a54e9);}})[_0x56af('0x22')](function(_0x3a2bfb){if(_0x3a2bfb){_0x45ef41=_0x3a2bfb['length'];if(!_0x5271c7[_0x56af('0x2d')][_0x56af('0x47')](_0x56af('0x48'))){_0x3a54e9[_0x56af('0x19')]=qs[_0x56af('0x19')](_0x5271c7[_0x56af('0x2d')][_0x56af('0x19')]);_0x3a54e9[_0x56af('0x18')]=qs[_0x56af('0x18')](_0x5271c7[_0x56af('0x2d')]['offset']);}return _0x5e7b6f['getFields'](_0x3a54e9);}})[_0x56af('0x22')](function(_0x42bd7f){if(_0x42bd7f){return _0x42bd7f?{'count':_0x45ef41,'rows':_0x42bd7f}:null;}})[_0x56af('0x22')](respondWithResult(_0x6b6234,null))[_0x56af('0x3c')](handleError(_0x6b6234,null));};exports[_0x56af('0x49')]=function(_0x38b084,_0x1d1b2f,_0x111203){var _0x860c91={};var _0xcac555={};var _0x2a9fa3;var _0xaf023d;return db[_0x56af('0x29')][_0x56af('0x44')]({'where':{'id':_0x38b084['params']['id']}})[_0x56af('0x22')](handleEntityNotFound(_0x1d1b2f,null))[_0x56af('0x22')](function(_0x2067de){if(_0x2067de){_0x2a9fa3=_0x2067de;_0xcac555[_0x56af('0x2c')]=_[_0x56af('0x2e')](db[_0x56af('0x45')]['rawAttributes']);_0xcac555['query']=_[_0x56af('0x2e')](_0x38b084[_0x56af('0x2d')]);_0xcac555[_0x56af('0x36')]=_[_0x56af('0x2f')](_0xcac555[_0x56af('0x2c')],_0xcac555['query']);_0x860c91[_0x56af('0x30')]=_[_0x56af('0x2f')](_0xcac555[_0x56af('0x2c')],qs[_0x56af('0x31')](_0x38b084[_0x56af('0x2d')][_0x56af('0x31')]));_0x860c91['attributes']=_0x860c91[_0x56af('0x30')]['length']?_0x860c91[_0x56af('0x30')]:_0xcac555[_0x56af('0x2c')];_0x860c91[_0x56af('0x46')]=qs['sort'](_0x38b084[_0x56af('0x2d')][_0x56af('0x33')]);_0x860c91['where']=qs[_0x56af('0x36')](_['pick'](_0x38b084[_0x56af('0x2d')],_0xcac555[_0x56af('0x36')]));if(_0x38b084['query'][_0x56af('0x37')]){_0x860c91[_0x56af('0x34')]=_['merge'](_0x860c91[_0x56af('0x34')],{'$or':_[_0x56af('0x28')](_0x860c91[_0x56af('0x30')],function(_0x3b3ba4){var _0x1a81a4={};_0x1a81a4[_0x3b3ba4]={'$like':'%'+_0x38b084[_0x56af('0x2d')]['filter']+'%'};return _0x1a81a4;})});}_0x860c91=_[_0x56af('0x39')]({},_0x860c91,_0x38b084[_0x56af('0x3a')]);return _0x2a9fa3['getSubjects'](_0x860c91);}})['then'](function(_0x559206){if(_0x559206){_0xaf023d=_0x559206['length'];if(!_0x38b084[_0x56af('0x2d')][_0x56af('0x47')](_0x56af('0x48'))){_0x860c91[_0x56af('0x19')]=qs['limit'](_0x38b084[_0x56af('0x2d')][_0x56af('0x19')]);_0x860c91[_0x56af('0x18')]=qs[_0x56af('0x18')](_0x38b084[_0x56af('0x2d')][_0x56af('0x18')]);}return _0x2a9fa3[_0x56af('0x49')](_0x860c91);}})[_0x56af('0x22')](function(_0x5c89ce){if(_0x5c89ce){return _0x5c89ce?{'count':_0xaf023d,'rows':_0x5c89ce}:null;}})['then'](respondWithResult(_0x1d1b2f,null))[_0x56af('0x3c')](handleError(_0x1d1b2f,null));};exports['getDescriptions']=function(_0x2cd885,_0x5998d7,_0xe00d50){var _0x46f856={};var _0x3b8a61={};var _0x320165;var _0x343b24;return db[_0x56af('0x29')][_0x56af('0x44')]({'where':{'id':_0x2cd885[_0x56af('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5998d7,null))[_0x56af('0x22')](function(_0x51a5f2){if(_0x51a5f2){_0x320165=_0x51a5f2;_0x3b8a61[_0x56af('0x2c')]=_[_0x56af('0x2e')](db['ZohoField'][_0x56af('0x2a')]);_0x3b8a61[_0x56af('0x2d')]=_['keys'](_0x2cd885[_0x56af('0x2d')]);_0x3b8a61['filters']=_[_0x56af('0x2f')](_0x3b8a61[_0x56af('0x2c')],_0x3b8a61['query']);_0x46f856[_0x56af('0x30')]=_['intersection'](_0x3b8a61[_0x56af('0x2c')],qs[_0x56af('0x31')](_0x2cd885[_0x56af('0x2d')][_0x56af('0x31')]));_0x46f856[_0x56af('0x30')]=_0x46f856[_0x56af('0x30')][_0x56af('0x32')]?_0x46f856[_0x56af('0x30')]:_0x3b8a61[_0x56af('0x2c')];_0x46f856[_0x56af('0x46')]=qs[_0x56af('0x33')](_0x2cd885[_0x56af('0x2d')][_0x56af('0x33')]);_0x46f856[_0x56af('0x34')]=qs[_0x56af('0x36')](_[_0x56af('0x35')](_0x2cd885['query'],_0x3b8a61[_0x56af('0x36')]));if(_0x2cd885[_0x56af('0x2d')][_0x56af('0x37')]){_0x46f856[_0x56af('0x34')]=_[_0x56af('0x39')](_0x46f856[_0x56af('0x34')],{'$or':_['map'](_0x46f856[_0x56af('0x30')],function(_0x37e07c){var _0x29f87d={};_0x29f87d[_0x37e07c]={'$like':'%'+_0x2cd885[_0x56af('0x2d')][_0x56af('0x37')]+'%'};return _0x29f87d;})});}_0x46f856=_[_0x56af('0x39')]({},_0x46f856,_0x2cd885[_0x56af('0x3a')]);return _0x320165[_0x56af('0x4a')](_0x46f856);}})[_0x56af('0x22')](function(_0x5d1b5f){if(_0x5d1b5f){_0x343b24=_0x5d1b5f[_0x56af('0x32')];if(!_0x2cd885['query'][_0x56af('0x47')](_0x56af('0x48'))){_0x46f856[_0x56af('0x19')]=qs[_0x56af('0x19')](_0x2cd885[_0x56af('0x2d')][_0x56af('0x19')]);_0x46f856[_0x56af('0x18')]=qs[_0x56af('0x18')](_0x2cd885[_0x56af('0x2d')][_0x56af('0x18')]);}return _0x320165['getDescriptions'](_0x46f856);}})[_0x56af('0x22')](function(_0x12b9d4){if(_0x12b9d4){return _0x12b9d4?{'count':_0x343b24,'rows':_0x12b9d4}:null;}})[_0x56af('0x22')](respondWithResult(_0x5998d7,null))[_0x56af('0x3c')](handleError(_0x5998d7,null));}; \ No newline at end of file +var _0xb29d=['where','merge','VIRTUAL','filter','options','count','includeAll','findAll','catch','show','params','keys','rawAttributes','include','find','create','body','update','getFields','findOne','ZohoField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','then','destroy','name','send','index','map','ZohoConfiguration','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','pick'];(function(_0x482c95,_0x504190){var _0x38c2e8=function(_0x5685df){while(--_0x5685df){_0x482c95['push'](_0x482c95['shift']());}};_0x38c2e8(++_0x504190);}(_0xb29d,0x68));var _0xdb29=function(_0x27c9f9,_0xea7a9b){_0x27c9f9=_0x27c9f9-0x0;var _0x561f3d=_0xb29d[_0x27c9f9];return _0x561f3d;};'use strict';var emlformat=require(_0xdb29('0x0'));var rimraf=require(_0xdb29('0x1'));var zipdir=require(_0xdb29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb29('0x3'));var moment=require(_0xdb29('0x4'));var BPromise=require(_0xdb29('0x5'));var Mustache=require(_0xdb29('0x6'));var util=require(_0xdb29('0x7'));var path=require(_0xdb29('0x8'));var sox=require(_0xdb29('0x9'));var csv=require('to-csv');var ejs=require(_0xdb29('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb29('0xb'));var squel=require(_0xdb29('0xc'));var crypto=require('crypto');var jsforce=require(_0xdb29('0xd'));var deskjs=require(_0xdb29('0xe'));var toCsv=require(_0xdb29('0xf'));var querystring=require(_0xdb29('0x10'));var Papa=require(_0xdb29('0x11'));var Redis=require('ioredis');var authService=require(_0xdb29('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdb29('0x13'));var hardwareService=require(_0xdb29('0x14'));var logger=require(_0xdb29('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xdb29('0x16'));var licenseUtil=require(_0xdb29('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3afc8f,_0x3aba53){_0x3aba53=_0x3aba53||0xcc;return function(_0x5982e9){if(_0x5982e9){return _0x3afc8f[_0xdb29('0x18')](_0x3aba53);}return _0x3afc8f[_0xdb29('0x19')](_0x3aba53)[_0xdb29('0x1a')]();};}function respondWithResult(_0x19f9c7,_0x4c7603){_0x4c7603=_0x4c7603||0xc8;return function(_0x17b994){if(_0x17b994){return _0x19f9c7[_0xdb29('0x19')](_0x4c7603)['json'](_0x17b994);}};}function respondWithFilteredResult(_0x2a2255,_0x3b1435){return function(_0x52256b){if(_0x52256b){var _0x1ccded=typeof _0x3b1435[_0xdb29('0x1b')]===_0xdb29('0x1c')&&typeof _0x3b1435[_0xdb29('0x1d')]===_0xdb29('0x1c');var _0x1e2f41=_0x52256b['count'];var _0x554e0e=_0x1ccded?0x0:_0x3b1435[_0xdb29('0x1b')];var _0x19285d=_0x1ccded?_0x52256b['count']:_0x3b1435[_0xdb29('0x1b')]+_0x3b1435[_0xdb29('0x1d')];var _0xcd748;if(_0x19285d>=_0x1e2f41){_0x19285d=_0x1e2f41;_0xcd748=0xc8;}else{_0xcd748=0xce;}_0x2a2255[_0xdb29('0x19')](_0xcd748);return _0x2a2255['set'](_0xdb29('0x1e'),_0x554e0e+'-'+_0x19285d+'/'+_0x1e2f41)[_0xdb29('0x1f')](_0x52256b);}return null;};}function patchUpdates(_0x1f949d){return function(_0x5c390e){try{jsonpatch[_0xdb29('0x20')](_0x5c390e,_0x1f949d,!![]);}catch(_0x311137){return BPromise[_0xdb29('0x21')](_0x311137);}return _0x5c390e[_0xdb29('0x22')]();};}function saveUpdates(_0x1d6951,_0x101733){return function(_0x383d64){if(_0x383d64){return _0x383d64['update'](_0x1d6951)[_0xdb29('0x23')](function(_0x4ccde4){return _0x4ccde4;});}return null;};}function removeEntity(_0x3d9129,_0x54660a){return function(_0x9f523d){if(_0x9f523d){return _0x9f523d[_0xdb29('0x24')]()[_0xdb29('0x23')](function(){_0x3d9129[_0xdb29('0x19')](0xcc)[_0xdb29('0x1a')]();});}};}function handleEntityNotFound(_0x26c36c,_0x5e6859){return function(_0x9e6d0d){if(!_0x9e6d0d){_0x26c36c[_0xdb29('0x18')](0x194);}return _0x9e6d0d;};}function handleError(_0x48f456,_0x31626f){_0x31626f=_0x31626f||0x1f4;return function(_0x536f7d){logger['error'](_0x536f7d['stack']);if(_0x536f7d[_0xdb29('0x25')]){delete _0x536f7d[_0xdb29('0x25')];}_0x48f456[_0xdb29('0x19')](_0x31626f)[_0xdb29('0x26')](_0x536f7d);};}exports[_0xdb29('0x27')]=function(_0x42bfa0,_0x44d867){var _0x56aca3={},_0x295943={},_0x6db167={'count':0x0,'rows':[]};var _0x22cb1e=_[_0xdb29('0x28')](db[_0xdb29('0x29')]['rawAttributes'],function(_0x13518d){return{'name':_0x13518d[_0xdb29('0x2a')],'type':_0x13518d['type'][_0xdb29('0x2b')]};});_0x295943[_0xdb29('0x2c')]=_[_0xdb29('0x28')](_0x22cb1e,_0xdb29('0x25'));_0x295943[_0xdb29('0x2d')]=_['keys'](_0x42bfa0[_0xdb29('0x2d')]);_0x295943[_0xdb29('0x2e')]=_[_0xdb29('0x2f')](_0x295943[_0xdb29('0x2c')],_0x295943[_0xdb29('0x2d')]);_0x56aca3['attributes']=_['intersection'](_0x295943[_0xdb29('0x2c')],qs[_0xdb29('0x30')](_0x42bfa0[_0xdb29('0x2d')][_0xdb29('0x30')]));_0x56aca3[_0xdb29('0x31')]=_0x56aca3[_0xdb29('0x31')][_0xdb29('0x32')]?_0x56aca3[_0xdb29('0x31')]:_0x295943[_0xdb29('0x2c')];if(!_0x42bfa0[_0xdb29('0x2d')]['hasOwnProperty'](_0xdb29('0x33'))){_0x56aca3[_0xdb29('0x1d')]=qs[_0xdb29('0x1d')](_0x42bfa0[_0xdb29('0x2d')][_0xdb29('0x1d')]);_0x56aca3[_0xdb29('0x1b')]=qs['offset'](_0x42bfa0[_0xdb29('0x2d')]['offset']);}_0x56aca3['order']=qs['sort'](_0x42bfa0[_0xdb29('0x2d')][_0xdb29('0x34')]);_0x56aca3['where']=qs[_0xdb29('0x2e')](_[_0xdb29('0x35')](_0x42bfa0['query'],_0x295943[_0xdb29('0x2e')]),_0x22cb1e);if(_0x42bfa0[_0xdb29('0x2d')]['filter']){_0x56aca3[_0xdb29('0x36')]=_[_0xdb29('0x37')](_0x56aca3['where'],{'$or':_[_0xdb29('0x28')](_0x22cb1e,function(_0x360b20){if(_0x360b20['type']!==_0xdb29('0x38')){var _0x262205={};_0x262205[_0x360b20['name']]={'$like':'%'+_0x42bfa0['query'][_0xdb29('0x39')]+'%'};return _0x262205;}})});}_0x56aca3=_[_0xdb29('0x37')]({},_0x56aca3,_0x42bfa0[_0xdb29('0x3a')]);var _0x50ec9a={'where':_0x56aca3[_0xdb29('0x36')]};return db[_0xdb29('0x29')][_0xdb29('0x3b')](_0x50ec9a)['then'](function(_0x3dfc44){_0x6db167['count']=_0x3dfc44;if(_0x42bfa0[_0xdb29('0x2d')][_0xdb29('0x3c')]){_0x56aca3['include']=[{'all':!![]}];}return db[_0xdb29('0x29')][_0xdb29('0x3d')](_0x56aca3);})[_0xdb29('0x23')](function(_0x23f5bf){_0x6db167['rows']=_0x23f5bf;return _0x6db167;})[_0xdb29('0x23')](respondWithFilteredResult(_0x44d867,_0x56aca3))[_0xdb29('0x3e')](handleError(_0x44d867,null));};exports[_0xdb29('0x3f')]=function(_0x115d8e,_0x303bb3){var _0x534ab5={'raw':![],'where':{'id':_0x115d8e[_0xdb29('0x40')]['id']}},_0x10f961={};_0x10f961['model']=_[_0xdb29('0x41')](db[_0xdb29('0x29')][_0xdb29('0x42')]);_0x10f961[_0xdb29('0x2d')]=_[_0xdb29('0x41')](_0x115d8e[_0xdb29('0x2d')]);_0x10f961[_0xdb29('0x2e')]=_[_0xdb29('0x2f')](_0x10f961['model'],_0x10f961[_0xdb29('0x2d')]);_0x534ab5[_0xdb29('0x31')]=_[_0xdb29('0x2f')](_0x10f961[_0xdb29('0x2c')],qs[_0xdb29('0x30')](_0x115d8e[_0xdb29('0x2d')]['fields']));_0x534ab5[_0xdb29('0x31')]=_0x534ab5[_0xdb29('0x31')]['length']?_0x534ab5[_0xdb29('0x31')]:_0x10f961['model'];if(_0x115d8e[_0xdb29('0x2d')][_0xdb29('0x3c')]){_0x534ab5[_0xdb29('0x43')]=[{'all':!![]}];}_0x534ab5=_[_0xdb29('0x37')]({},_0x534ab5,_0x115d8e[_0xdb29('0x3a')]);return db['ZohoConfiguration'][_0xdb29('0x44')](_0x534ab5)[_0xdb29('0x23')](handleEntityNotFound(_0x303bb3,null))['then'](respondWithResult(_0x303bb3,null))[_0xdb29('0x3e')](handleError(_0x303bb3,null));};exports[_0xdb29('0x45')]=function(_0x55933c,_0x565601){return db[_0xdb29('0x29')][_0xdb29('0x45')](_0x55933c[_0xdb29('0x46')],{})[_0xdb29('0x23')](respondWithResult(_0x565601,0xc9))[_0xdb29('0x3e')](handleError(_0x565601,null));};exports[_0xdb29('0x47')]=function(_0x340548,_0x25eea0){if(_0x340548[_0xdb29('0x46')]['id']){delete _0x340548[_0xdb29('0x46')]['id'];}return db[_0xdb29('0x29')][_0xdb29('0x44')]({'where':{'id':_0x340548[_0xdb29('0x40')]['id']}})[_0xdb29('0x23')](handleEntityNotFound(_0x25eea0,null))[_0xdb29('0x23')](saveUpdates(_0x340548[_0xdb29('0x46')],null))['then'](respondWithResult(_0x25eea0,null))['catch'](handleError(_0x25eea0,null));};exports['destroy']=function(_0x5b3f7,_0x6375c3){return db['ZohoConfiguration'][_0xdb29('0x44')]({'where':{'id':_0x5b3f7[_0xdb29('0x40')]['id']}})[_0xdb29('0x23')](handleEntityNotFound(_0x6375c3,null))[_0xdb29('0x23')](removeEntity(_0x6375c3,null))[_0xdb29('0x3e')](handleError(_0x6375c3,null));};exports[_0xdb29('0x48')]=function(_0x407fb5,_0x2dc07a,_0x55d124){var _0x1f46bc={};var _0x5665df={};var _0x48a67e;var _0x4f35a5;return db['ZohoConfiguration'][_0xdb29('0x49')]({'where':{'id':_0x407fb5[_0xdb29('0x40')]['id']}})['then'](handleEntityNotFound(_0x2dc07a,null))[_0xdb29('0x23')](function(_0x89f939){if(_0x89f939){_0x48a67e=_0x89f939;_0x5665df[_0xdb29('0x2c')]=_['keys'](db[_0xdb29('0x4a')][_0xdb29('0x42')]);_0x5665df[_0xdb29('0x2d')]=_[_0xdb29('0x41')](_0x407fb5[_0xdb29('0x2d')]);_0x5665df[_0xdb29('0x2e')]=_[_0xdb29('0x2f')](_0x5665df[_0xdb29('0x2c')],_0x5665df[_0xdb29('0x2d')]);_0x1f46bc[_0xdb29('0x31')]=_[_0xdb29('0x2f')](_0x5665df[_0xdb29('0x2c')],qs['fields'](_0x407fb5['query'][_0xdb29('0x30')]));_0x1f46bc['attributes']=_0x1f46bc['attributes'][_0xdb29('0x32')]?_0x1f46bc[_0xdb29('0x31')]:_0x5665df[_0xdb29('0x2c')];_0x1f46bc[_0xdb29('0x4b')]=qs[_0xdb29('0x34')](_0x407fb5[_0xdb29('0x2d')][_0xdb29('0x34')]);_0x1f46bc['where']=qs[_0xdb29('0x2e')](_[_0xdb29('0x35')](_0x407fb5[_0xdb29('0x2d')],_0x5665df[_0xdb29('0x2e')]));if(_0x407fb5[_0xdb29('0x2d')][_0xdb29('0x39')]){_0x1f46bc['where']=_[_0xdb29('0x37')](_0x1f46bc['where'],{'$or':_[_0xdb29('0x28')](_0x1f46bc['attributes'],function(_0x458f29){var _0x205905={};_0x205905[_0x458f29]={'$like':'%'+_0x407fb5[_0xdb29('0x2d')][_0xdb29('0x39')]+'%'};return _0x205905;})});}_0x1f46bc=_[_0xdb29('0x37')]({},_0x1f46bc,_0x407fb5[_0xdb29('0x3a')]);return _0x48a67e['getFields'](_0x1f46bc);}})['then'](function(_0x433587){if(_0x433587){_0x4f35a5=_0x433587[_0xdb29('0x32')];if(!_0x407fb5['query'][_0xdb29('0x4c')](_0xdb29('0x33'))){_0x1f46bc['limit']=qs['limit'](_0x407fb5['query'][_0xdb29('0x1d')]);_0x1f46bc[_0xdb29('0x1b')]=qs[_0xdb29('0x1b')](_0x407fb5[_0xdb29('0x2d')][_0xdb29('0x1b')]);}return _0x48a67e[_0xdb29('0x48')](_0x1f46bc);}})[_0xdb29('0x23')](function(_0x3196aa){if(_0x3196aa){return _0x3196aa?{'count':_0x4f35a5,'rows':_0x3196aa}:null;}})['then'](respondWithResult(_0x2dc07a,null))['catch'](handleError(_0x2dc07a,null));};exports[_0xdb29('0x4d')]=function(_0x304073,_0x1e1e1f,_0x271d47){var _0x31d63c={};var _0x124c73={};var _0x3b171c;var _0x586df4;return db[_0xdb29('0x29')][_0xdb29('0x49')]({'where':{'id':_0x304073[_0xdb29('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e1e1f,null))[_0xdb29('0x23')](function(_0x3cb34a){if(_0x3cb34a){_0x3b171c=_0x3cb34a;_0x124c73[_0xdb29('0x2c')]=_[_0xdb29('0x41')](db[_0xdb29('0x4a')]['rawAttributes']);_0x124c73['query']=_['keys'](_0x304073[_0xdb29('0x2d')]);_0x124c73['filters']=_['intersection'](_0x124c73[_0xdb29('0x2c')],_0x124c73[_0xdb29('0x2d')]);_0x31d63c[_0xdb29('0x31')]=_[_0xdb29('0x2f')](_0x124c73['model'],qs['fields'](_0x304073[_0xdb29('0x2d')][_0xdb29('0x30')]));_0x31d63c[_0xdb29('0x31')]=_0x31d63c[_0xdb29('0x31')][_0xdb29('0x32')]?_0x31d63c['attributes']:_0x124c73[_0xdb29('0x2c')];_0x31d63c[_0xdb29('0x4b')]=qs[_0xdb29('0x34')](_0x304073[_0xdb29('0x2d')][_0xdb29('0x34')]);_0x31d63c[_0xdb29('0x36')]=qs[_0xdb29('0x2e')](_[_0xdb29('0x35')](_0x304073[_0xdb29('0x2d')],_0x124c73['filters']));if(_0x304073[_0xdb29('0x2d')]['filter']){_0x31d63c[_0xdb29('0x36')]=_[_0xdb29('0x37')](_0x31d63c[_0xdb29('0x36')],{'$or':_['map'](_0x31d63c[_0xdb29('0x31')],function(_0x3b96f0){var _0x6218f5={};_0x6218f5[_0x3b96f0]={'$like':'%'+_0x304073[_0xdb29('0x2d')][_0xdb29('0x39')]+'%'};return _0x6218f5;})});}_0x31d63c=_['merge']({},_0x31d63c,_0x304073[_0xdb29('0x3a')]);return _0x3b171c[_0xdb29('0x4d')](_0x31d63c);}})[_0xdb29('0x23')](function(_0x2ea9bd){if(_0x2ea9bd){_0x586df4=_0x2ea9bd[_0xdb29('0x32')];if(!_0x304073[_0xdb29('0x2d')]['hasOwnProperty'](_0xdb29('0x33'))){_0x31d63c[_0xdb29('0x1d')]=qs[_0xdb29('0x1d')](_0x304073[_0xdb29('0x2d')][_0xdb29('0x1d')]);_0x31d63c[_0xdb29('0x1b')]=qs[_0xdb29('0x1b')](_0x304073[_0xdb29('0x2d')][_0xdb29('0x1b')]);}return _0x3b171c[_0xdb29('0x4d')](_0x31d63c);}})[_0xdb29('0x23')](function(_0xb6ce5e){if(_0xb6ce5e){return _0xb6ce5e?{'count':_0x586df4,'rows':_0xb6ce5e}:null;}})[_0xdb29('0x23')](respondWithResult(_0x1e1e1f,null))[_0xdb29('0x3e')](handleError(_0x1e1e1f,null));};exports[_0xdb29('0x4e')]=function(_0x4ee7d5,_0x33d02e,_0x53bfd8){var _0x5dbf02={};var _0x91bf34={};var _0x2fc16b;var _0x292bb5;return db[_0xdb29('0x29')][_0xdb29('0x49')]({'where':{'id':_0x4ee7d5[_0xdb29('0x40')]['id']}})['then'](handleEntityNotFound(_0x33d02e,null))['then'](function(_0x7915ce){if(_0x7915ce){_0x2fc16b=_0x7915ce;_0x91bf34[_0xdb29('0x2c')]=_[_0xdb29('0x41')](db[_0xdb29('0x4a')][_0xdb29('0x42')]);_0x91bf34[_0xdb29('0x2d')]=_['keys'](_0x4ee7d5[_0xdb29('0x2d')]);_0x91bf34['filters']=_[_0xdb29('0x2f')](_0x91bf34[_0xdb29('0x2c')],_0x91bf34[_0xdb29('0x2d')]);_0x5dbf02['attributes']=_[_0xdb29('0x2f')](_0x91bf34[_0xdb29('0x2c')],qs[_0xdb29('0x30')](_0x4ee7d5[_0xdb29('0x2d')]['fields']));_0x5dbf02[_0xdb29('0x31')]=_0x5dbf02['attributes'][_0xdb29('0x32')]?_0x5dbf02[_0xdb29('0x31')]:_0x91bf34[_0xdb29('0x2c')];_0x5dbf02['order']=qs['sort'](_0x4ee7d5[_0xdb29('0x2d')][_0xdb29('0x34')]);_0x5dbf02[_0xdb29('0x36')]=qs[_0xdb29('0x2e')](_[_0xdb29('0x35')](_0x4ee7d5[_0xdb29('0x2d')],_0x91bf34[_0xdb29('0x2e')]));if(_0x4ee7d5[_0xdb29('0x2d')][_0xdb29('0x39')]){_0x5dbf02['where']=_['merge'](_0x5dbf02[_0xdb29('0x36')],{'$or':_[_0xdb29('0x28')](_0x5dbf02[_0xdb29('0x31')],function(_0x2144fb){var _0xf2688c={};_0xf2688c[_0x2144fb]={'$like':'%'+_0x4ee7d5[_0xdb29('0x2d')][_0xdb29('0x39')]+'%'};return _0xf2688c;})});}_0x5dbf02=_['merge']({},_0x5dbf02,_0x4ee7d5[_0xdb29('0x3a')]);return _0x2fc16b[_0xdb29('0x4e')](_0x5dbf02);}})[_0xdb29('0x23')](function(_0x47a82c){if(_0x47a82c){_0x292bb5=_0x47a82c['length'];if(!_0x4ee7d5['query'][_0xdb29('0x4c')](_0xdb29('0x33'))){_0x5dbf02[_0xdb29('0x1d')]=qs[_0xdb29('0x1d')](_0x4ee7d5[_0xdb29('0x2d')]['limit']);_0x5dbf02[_0xdb29('0x1b')]=qs[_0xdb29('0x1b')](_0x4ee7d5[_0xdb29('0x2d')]['offset']);}return _0x2fc16b[_0xdb29('0x4e')](_0x5dbf02);}})['then'](function(_0x504c56){if(_0x504c56){return _0x504c56?{'count':_0x292bb5,'rows':_0x504c56}:null;}})['then'](respondWithResult(_0x33d02e,null))['catch'](handleError(_0x33d02e,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b96483e..da6695a 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 _0x4dff=['path','../../config/environment','./intZohoConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x54b236,_0x3f7197){var _0x3da95c=function(_0x42e166){while(--_0x42e166){_0x54b236['push'](_0x54b236['shift']());}};_0x3da95c(++_0x3f7197);}(_0x4dff,0x10d));var _0xf4df=function(_0x48792e,_0x1e3335){_0x48792e=_0x48792e-0x0;var _0x15a480=_0x4dff[_0x48792e];return _0x15a480;};'use strict';var _=require(_0xf4df('0x0'));var util=require(_0xf4df('0x1'));var logger=require(_0xf4df('0x2'))(_0xf4df('0x3'));var moment=require(_0xf4df('0x4'));var BPromise=require(_0xf4df('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4df('0x6'));var rimraf=require('rimraf');var config=require(_0xf4df('0x7'));var attributes=require(_0xf4df('0x8'));module[_0xf4df('0x9')]=function(_0x233e6e,_0x39071b){return _0x233e6e[_0xf4df('0xa')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8133=['rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b0f65,_0x250366){var _0x17bad6=function(_0x59ec67){while(--_0x59ec67){_0x5b0f65['push'](_0x5b0f65['shift']());}};_0x17bad6(++_0x250366);}(_0x8133,0xc9));var _0x3813=function(_0x38be11,_0x1c9814){_0x38be11=_0x38be11-0x0;var _0xb97a5c=_0x8133[_0x38be11];return _0xb97a5c;};'use strict';var _=require('lodash');var util=require(_0x3813('0x0'));var logger=require(_0x3813('0x1'))(_0x3813('0x2'));var moment=require(_0x3813('0x3'));var BPromise=require(_0x3813('0x4'));var rp=require(_0x3813('0x5'));var fs=require('fs');var path=require(_0x3813('0x6'));var rimraf=require(_0x3813('0x7'));var config=require(_0x3813('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0x3813('0x9')]=function(_0x5460a8,_0x11bd25){return _0x5460a8[_0x3813('0xa')](_0x3813('0xb'),attributes,{'tableName':_0x3813('0xc'),'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 e4e62ab..400c2c8 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 _0x0194=['client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0194,0xef));var _0x4019=function(_0xcb9f17,_0x5f4f33){_0xcb9f17=_0xcb9f17-0x0;var _0x38299c=_0x0194[_0xcb9f17];return _0x38299c;};'use strict';var _=require(_0x4019('0x0'));var util=require(_0x4019('0x1'));var moment=require(_0x4019('0x2'));var BPromise=require(_0x4019('0x3'));var rs=require(_0x4019('0x4'));var fs=require('fs');var Redis=require(_0x4019('0x5'));var db=require(_0x4019('0x6'))['db'];var utils=require(_0x4019('0x7'));var logger=require(_0x4019('0x8'))(_0x4019('0x9'));var config=require('../../config/environment');var jayson=require(_0x4019('0xa'));var client=jayson[_0x4019('0xb')][_0x4019('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31cb97,_0x128687,_0x332f57){return new BPromise(function(_0x30edb7,_0x403045){return client[_0x4019('0xd')](_0x31cb97,_0x332f57)[_0x4019('0xe')](function(_0x33401e){logger[_0x4019('0xf')](_0x4019('0x10'),_0x128687,_0x4019('0x11'));logger[_0x4019('0x12')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x128687,_0x4019('0x11'),JSON[_0x4019('0x13')](_0x33401e));if(_0x33401e['error']){if(_0x33401e[_0x4019('0x14')][_0x4019('0x15')]===0x1f4){logger[_0x4019('0x14')](_0x4019('0x10'),_0x128687,_0x33401e[_0x4019('0x14')][_0x4019('0x16')]);return _0x403045(_0x33401e[_0x4019('0x14')][_0x4019('0x16')]);}logger['error'](_0x4019('0x10'),_0x128687,_0x33401e[_0x4019('0x14')]['message']);return _0x30edb7(_0x33401e[_0x4019('0x14')][_0x4019('0x16')]);}else{logger[_0x4019('0xf')](_0x4019('0x10'),_0x128687,_0x4019('0x11'));_0x30edb7(_0x33401e[_0x4019('0x17')]['message']);}})[_0x4019('0x18')](function(_0x454848){logger['error'](_0x4019('0x10'),_0x128687,_0x454848);_0x403045(_0x454848);});});} \ No newline at end of file +var _0x72da=['info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x548a7c,_0xa92734){var _0x577333=function(_0x34e33d){while(--_0x34e33d){_0x548a7c['push'](_0x548a7c['shift']());}};_0x577333(++_0xa92734);}(_0x72da,0x1a2));var _0xa72d=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x72da[_0x4521e3];return _0x46a272;};'use strict';var _=require(_0xa72d('0x0'));var util=require(_0xa72d('0x1'));var moment=require(_0xa72d('0x2'));var BPromise=require(_0xa72d('0x3'));var rs=require(_0xa72d('0x4'));var fs=require('fs');var Redis=require(_0xa72d('0x5'));var db=require(_0xa72d('0x6'))['db'];var utils=require(_0xa72d('0x7'));var logger=require(_0xa72d('0x8'))('rpc');var config=require(_0xa72d('0x9'));var jayson=require(_0xa72d('0xa'));var client=jayson[_0xa72d('0xb')][_0xa72d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34141e,_0xf8c581,_0x3362){return new BPromise(function(_0x3f827a,_0x371513){return client[_0xa72d('0xd')](_0x34141e,_0x3362)['then'](function(_0x538506){logger[_0xa72d('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0xf8c581,_0xa72d('0xf'));logger[_0xa72d('0x10')](_0xa72d('0x11'),_0xf8c581,_0xa72d('0xf'),JSON['stringify'](_0x538506));if(_0x538506['error']){if(_0x538506[_0xa72d('0x12')][_0xa72d('0x13')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xf8c581,_0x538506[_0xa72d('0x12')][_0xa72d('0x14')]);return _0x371513(_0x538506[_0xa72d('0x12')][_0xa72d('0x14')]);}logger[_0xa72d('0x12')](_0xa72d('0x15'),_0xf8c581,_0x538506['error'][_0xa72d('0x14')]);return _0x3f827a(_0x538506['error']['message']);}else{logger['info'](_0xa72d('0x15'),_0xf8c581,_0xa72d('0xf'));_0x3f827a(_0x538506[_0xa72d('0x16')][_0xa72d('0x14')]);}})[_0xa72d('0x17')](function(_0x3b5a1a){logger[_0xa72d('0x12')](_0xa72d('0x15'),_0xf8c581,_0x3b5a1a);_0x371513(_0x3b5a1a);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7635e3c..f3395d9 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 _0xdf18=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x262009,_0x41b287){var _0x4cc8ec=function(_0x302e8f){while(--_0x302e8f){_0x262009['push'](_0x262009['shift']());}};_0x4cc8ec(++_0x41b287);}(_0xdf18,0x1ba));var _0x8df1=function(_0x91973e,_0x102fda){_0x91973e=_0x91973e-0x0;var _0x12523b=_0xdf18[_0x91973e];return _0x12523b;};'use strict';var multer=require(_0x8df1('0x0'));var util=require(_0x8df1('0x1'));var path=require(_0x8df1('0x2'));var timeout=require(_0x8df1('0x3'));var express=require(_0x8df1('0x4'));var router=express[_0x8df1('0x5')]();var fs_extra=require(_0x8df1('0x6'));var auth=require(_0x8df1('0x7'));var interaction=require(_0x8df1('0x8'));var config=require(_0x8df1('0x9'));var controller=require(_0x8df1('0xa'));router[_0x8df1('0xb')]('/',auth[_0x8df1('0xc')](),controller[_0x8df1('0xd')]);router[_0x8df1('0xb')](_0x8df1('0xe'),auth[_0x8df1('0xc')](),controller[_0x8df1('0xf')]);router[_0x8df1('0x10')]('/',auth[_0x8df1('0xc')](),controller[_0x8df1('0x11')]);router[_0x8df1('0x12')](_0x8df1('0xe'),auth[_0x8df1('0xc')](),controller[_0x8df1('0x13')]);router[_0x8df1('0x14')]('/:id',auth[_0x8df1('0xc')](),controller['destroy']);module[_0x8df1('0x15')]=router; \ No newline at end of file +var _0xea76=['get','isAuthenticated','index','/:id','show','post','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x397c56,_0x4428d5){var _0x210a70=function(_0xed22d1){while(--_0xed22d1){_0x397c56['push'](_0x397c56['shift']());}};_0x210a70(++_0x4428d5);}(_0xea76,0xe6));var _0x6ea7=function(_0x175697,_0x8c0f37){_0x175697=_0x175697-0x0;var _0x14493c=_0xea76[_0x175697];return _0x14493c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6ea7('0x0'));var timeout=require(_0x6ea7('0x1'));var express=require('express');var router=express[_0x6ea7('0x2')]();var fs_extra=require(_0x6ea7('0x3'));var auth=require(_0x6ea7('0x4'));var interaction=require(_0x6ea7('0x5'));var config=require(_0x6ea7('0x6'));var controller=require(_0x6ea7('0x7'));router[_0x6ea7('0x8')]('/',auth[_0x6ea7('0x9')](),controller[_0x6ea7('0xa')]);router['get'](_0x6ea7('0xb'),auth['isAuthenticated'](),controller[_0x6ea7('0xc')]);router[_0x6ea7('0xd')]('/',auth[_0x6ea7('0x9')](),controller['create']);router['put'](_0x6ea7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6ea7('0xe')]('/:id',auth[_0x6ea7('0x9')](),controller[_0x6ea7('0xf')]);module[_0x6ea7('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index f0d8f4b..5c64a1e 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 _0x1639=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x535f6f,_0x4213ad){var _0xd59f56=function(_0x2ff727){while(--_0x2ff727){_0x535f6f['push'](_0x535f6f['shift']());}};_0xd59f56(++_0x4213ad);}(_0x1639,0xfe));var _0x9163=function(_0x470ffb,_0x53febf){_0x470ffb=_0x470ffb-0x0;var _0x1e5044=_0x1639[_0x470ffb];return _0x1e5044;};'use strict';var Sequelize=require(_0x9163('0x0'));module[_0x9163('0x1')]={'type':{'type':Sequelize[_0x9163('0x2')](_0x9163('0x3'),_0x9163('0x4'),_0x9163('0x5'),'keyValue',_0x9163('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9163('0x7')]},'key':{'type':Sequelize[_0x9163('0x7')]},'keyType':{'type':Sequelize[_0x9163('0x2')]('string',_0x9163('0x4'),_0x9163('0x5'))},'keyContent':{'type':Sequelize[_0x9163('0x7')]},'idField':{'type':Sequelize[_0x9163('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9163('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9163('0x7')]}}; \ No newline at end of file +var _0xe082=['keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable'];(function(_0x132b71,_0x25f23e){var _0x224664=function(_0x1f9e23){while(--_0x1f9e23){_0x132b71['push'](_0x132b71['shift']());}};_0x224664(++_0x25f23e);}(_0xe082,0xe2));var _0x2e08=function(_0x38f730,_0x2c7523){_0x38f730=_0x38f730-0x0;var _0x233bf4=_0xe082[_0x38f730];return _0x233bf4;};'use strict';var Sequelize=require(_0x2e08('0x0'));module[_0x2e08('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2e08('0x2'),_0x2e08('0x3'),'customVariable',_0x2e08('0x4'),_0x2e08('0x5')),'defaultValue':_0x2e08('0x2')},'content':{'type':Sequelize[_0x2e08('0x6')]},'key':{'type':Sequelize[_0x2e08('0x6')]},'keyType':{'type':Sequelize[_0x2e08('0x7')]('string',_0x2e08('0x3'),_0x2e08('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2e08('0x6')]},'nameField':{'type':Sequelize[_0x2e08('0x6')]},'customField':{'type':Sequelize[_0x2e08('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e08('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index b6d6963..a335c5e 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 _0x3f59=['nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','stack','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x206a68,_0x4b397a){var _0x25f083=function(_0x122dc3){while(--_0x122dc3){_0x206a68['push'](_0x206a68['shift']());}};_0x25f083(++_0x4b397a);}(_0x3f59,0x1d4));var _0x93f5=function(_0x584813,_0x530fbe){_0x584813=_0x584813-0x0;var _0x58c5d2=_0x3f59[_0x584813];return _0x58c5d2;};'use strict';var emlformat=require(_0x93f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93f5('0x1'));var jsonpatch=require(_0x93f5('0x2'));var rp=require(_0x93f5('0x3'));var moment=require(_0x93f5('0x4'));var BPromise=require(_0x93f5('0x5'));var Mustache=require(_0x93f5('0x6'));var util=require(_0x93f5('0x7'));var path=require(_0x93f5('0x8'));var sox=require(_0x93f5('0x9'));var csv=require('to-csv');var ejs=require(_0x93f5('0xa'));var fs=require('fs');var fs_extra=require(_0x93f5('0xb'));var _=require(_0x93f5('0xc'));var squel=require('squel');var crypto=require(_0x93f5('0xd'));var jsforce=require(_0x93f5('0xe'));var deskjs=require(_0x93f5('0xf'));var toCsv=require(_0x93f5('0x10'));var querystring=require(_0x93f5('0x11'));var Papa=require(_0x93f5('0x12'));var Redis=require(_0x93f5('0x13'));var authService=require(_0x93f5('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93f5('0x15'));var logger=require(_0x93f5('0x16'))(_0x93f5('0x17'));var utils=require(_0x93f5('0x18'));var config=require(_0x93f5('0x19'));var licenseUtil=require(_0x93f5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x453510,_0x379d44){_0x379d44=_0x379d44||0xcc;return function(_0x4c39ec){if(_0x4c39ec){return _0x453510[_0x93f5('0x1b')](_0x379d44);}return _0x453510[_0x93f5('0x1c')](_0x379d44)['end']();};}function respondWithResult(_0x1629e2,_0x5b73f9){_0x5b73f9=_0x5b73f9||0xc8;return function(_0x3a1155){if(_0x3a1155){return _0x1629e2[_0x93f5('0x1c')](_0x5b73f9)[_0x93f5('0x1d')](_0x3a1155);}};}function respondWithFilteredResult(_0x23ba2d,_0x69f8c6){return function(_0x96363){if(_0x96363){var _0x2b7597=typeof _0x69f8c6[_0x93f5('0x1e')]===_0x93f5('0x1f')&&typeof _0x69f8c6[_0x93f5('0x20')]===_0x93f5('0x1f');var _0x158c1d=_0x96363[_0x93f5('0x21')];var _0x4d0181=_0x2b7597?0x0:_0x69f8c6[_0x93f5('0x1e')];var _0x441442=_0x2b7597?_0x96363[_0x93f5('0x21')]:_0x69f8c6[_0x93f5('0x1e')]+_0x69f8c6[_0x93f5('0x20')];var _0x5524ee;if(_0x441442>=_0x158c1d){_0x441442=_0x158c1d;_0x5524ee=0xc8;}else{_0x5524ee=0xce;}_0x23ba2d['status'](_0x5524ee);return _0x23ba2d[_0x93f5('0x22')]('Content-Range',_0x4d0181+'-'+_0x441442+'/'+_0x158c1d)['json'](_0x96363);}return null;};}function patchUpdates(_0x1c2a12){return function(_0x19bbab){try{jsonpatch['apply'](_0x19bbab,_0x1c2a12,!![]);}catch(_0x1fa402){return BPromise[_0x93f5('0x23')](_0x1fa402);}return _0x19bbab['save']();};}function saveUpdates(_0x105f97,_0x253065){return function(_0x2aa191){if(_0x2aa191){return _0x2aa191[_0x93f5('0x24')](_0x105f97)[_0x93f5('0x25')](function(_0x87b67c){return _0x87b67c;});}return null;};}function removeEntity(_0x479a1d,_0xfc5d59){return function(_0x44c31b){if(_0x44c31b){return _0x44c31b[_0x93f5('0x26')]()[_0x93f5('0x25')](function(){_0x479a1d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb5cda0,_0xa7f623){return function(_0x66acfe){if(!_0x66acfe){_0xb5cda0[_0x93f5('0x1b')](0x194);}return _0x66acfe;};}function handleError(_0x5a4b05,_0x2ac3dc){_0x2ac3dc=_0x2ac3dc||0x1f4;return function(_0x53d993){logger['error'](_0x53d993[_0x93f5('0x27')]);if(_0x53d993['name']){delete _0x53d993['name'];}_0x5a4b05[_0x93f5('0x1c')](_0x2ac3dc)[_0x93f5('0x28')](_0x53d993);};}exports[_0x93f5('0x29')]=function(_0x9c7fde,_0x5c327e){var _0x3a30c2={},_0x1d3cad={},_0x1b83d2={'count':0x0,'rows':[]};var _0x95e1a3=_[_0x93f5('0x2a')](db[_0x93f5('0x2b')][_0x93f5('0x2c')],function(_0xa0dd2){return{'name':_0xa0dd2[_0x93f5('0x2d')],'type':_0xa0dd2[_0x93f5('0x2e')][_0x93f5('0x2f')]};});_0x1d3cad[_0x93f5('0x30')]=_[_0x93f5('0x2a')](_0x95e1a3,_0x93f5('0x31'));_0x1d3cad[_0x93f5('0x32')]=_['keys'](_0x9c7fde[_0x93f5('0x32')]);_0x1d3cad[_0x93f5('0x33')]=_[_0x93f5('0x34')](_0x1d3cad[_0x93f5('0x30')],_0x1d3cad[_0x93f5('0x32')]);_0x3a30c2[_0x93f5('0x35')]=_['intersection'](_0x1d3cad[_0x93f5('0x30')],qs['fields'](_0x9c7fde['query'][_0x93f5('0x36')]));_0x3a30c2[_0x93f5('0x35')]=_0x3a30c2['attributes'][_0x93f5('0x37')]?_0x3a30c2[_0x93f5('0x35')]:_0x1d3cad['model'];if(!_0x9c7fde[_0x93f5('0x32')][_0x93f5('0x38')](_0x93f5('0x39'))){_0x3a30c2[_0x93f5('0x20')]=qs[_0x93f5('0x20')](_0x9c7fde[_0x93f5('0x32')]['limit']);_0x3a30c2['offset']=qs[_0x93f5('0x1e')](_0x9c7fde[_0x93f5('0x32')][_0x93f5('0x1e')]);}_0x3a30c2[_0x93f5('0x3a')]=qs['sort'](_0x9c7fde[_0x93f5('0x32')]['sort']);_0x3a30c2[_0x93f5('0x3b')]=qs['filters'](_[_0x93f5('0x3c')](_0x9c7fde[_0x93f5('0x32')],_0x1d3cad['filters']),_0x95e1a3);if(_0x9c7fde[_0x93f5('0x32')][_0x93f5('0x3d')]){_0x3a30c2[_0x93f5('0x3b')]=_[_0x93f5('0x3e')](_0x3a30c2[_0x93f5('0x3b')],{'$or':_[_0x93f5('0x2a')](_0x95e1a3,function(_0x32f166){if(_0x32f166[_0x93f5('0x2e')]!==_0x93f5('0x3f')){var _0x239ad1={};_0x239ad1[_0x32f166[_0x93f5('0x31')]]={'$like':'%'+_0x9c7fde[_0x93f5('0x32')]['filter']+'%'};return _0x239ad1;}})});}_0x3a30c2=_[_0x93f5('0x3e')]({},_0x3a30c2,_0x9c7fde[_0x93f5('0x40')]);var _0x2bed7d={'where':_0x3a30c2[_0x93f5('0x3b')]};return db[_0x93f5('0x2b')][_0x93f5('0x21')](_0x2bed7d)[_0x93f5('0x25')](function(_0x2b8190){_0x1b83d2[_0x93f5('0x21')]=_0x2b8190;if(_0x9c7fde[_0x93f5('0x32')][_0x93f5('0x41')]){_0x3a30c2[_0x93f5('0x42')]=[{'all':!![]}];}return db['ZohoField'][_0x93f5('0x43')](_0x3a30c2);})['then'](function(_0x54d092){_0x1b83d2['rows']=_0x54d092;return _0x1b83d2;})['then'](respondWithFilteredResult(_0x5c327e,_0x3a30c2))[_0x93f5('0x44')](handleError(_0x5c327e,null));};exports[_0x93f5('0x45')]=function(_0x25abd5,_0x1e32c0){var _0x5e48a2={'raw':!![],'where':{'id':_0x25abd5[_0x93f5('0x46')]['id']}},_0x5e51b4={};_0x5e51b4[_0x93f5('0x30')]=_['keys'](db[_0x93f5('0x2b')][_0x93f5('0x2c')]);_0x5e51b4['query']=_[_0x93f5('0x47')](_0x25abd5[_0x93f5('0x32')]);_0x5e51b4[_0x93f5('0x33')]=_[_0x93f5('0x34')](_0x5e51b4['model'],_0x5e51b4[_0x93f5('0x32')]);_0x5e48a2['attributes']=_[_0x93f5('0x34')](_0x5e51b4[_0x93f5('0x30')],qs['fields'](_0x25abd5['query']['fields']));_0x5e48a2[_0x93f5('0x35')]=_0x5e48a2[_0x93f5('0x35')][_0x93f5('0x37')]?_0x5e48a2['attributes']:_0x5e51b4[_0x93f5('0x30')];if(_0x25abd5[_0x93f5('0x32')][_0x93f5('0x41')]){_0x5e48a2[_0x93f5('0x42')]=[{'all':!![]}];}_0x5e48a2=_[_0x93f5('0x3e')]({},_0x5e48a2,_0x25abd5['options']);return db[_0x93f5('0x2b')][_0x93f5('0x48')](_0x5e48a2)[_0x93f5('0x25')](handleEntityNotFound(_0x1e32c0,null))[_0x93f5('0x25')](respondWithResult(_0x1e32c0,null))[_0x93f5('0x44')](handleError(_0x1e32c0,null));};exports[_0x93f5('0x49')]=function(_0x59bd58,_0x567caf){return db[_0x93f5('0x2b')]['create'](_0x59bd58['body'],{})[_0x93f5('0x25')](respondWithResult(_0x567caf,0xc9))[_0x93f5('0x44')](handleError(_0x567caf,null));};exports['update']=function(_0x19a371,_0x2d21e0){if(_0x19a371[_0x93f5('0x4a')]['id']){delete _0x19a371[_0x93f5('0x4a')]['id'];}return db[_0x93f5('0x2b')][_0x93f5('0x48')]({'where':{'id':_0x19a371[_0x93f5('0x46')]['id']}})[_0x93f5('0x25')](handleEntityNotFound(_0x2d21e0,null))[_0x93f5('0x25')](saveUpdates(_0x19a371['body'],null))['then'](respondWithResult(_0x2d21e0,null))['catch'](handleError(_0x2d21e0,null));};exports[_0x93f5('0x26')]=function(_0x163da4,_0x3109a9){return db[_0x93f5('0x2b')][_0x93f5('0x48')]({'where':{'id':_0x163da4[_0x93f5('0x46')]['id']}})[_0x93f5('0x25')](handleEntityNotFound(_0x3109a9,null))['then'](removeEntity(_0x3109a9,null))[_0x93f5('0x44')](handleError(_0x3109a9,null));}; \ No newline at end of file +var _0xdd6e=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x4333d3,_0x2f6a80){var _0x1e4ee0=function(_0x11ed77){while(--_0x11ed77){_0x4333d3['push'](_0x4333d3['shift']());}};_0x1e4ee0(++_0x2f6a80);}(_0xdd6e,0xa5));var _0xedd6=function(_0xd87000,_0x481334){_0xd87000=_0xd87000-0x0;var _0xfc6ef8=_0xdd6e[_0xd87000];return _0xfc6ef8;};'use strict';var emlformat=require(_0xedd6('0x0'));var rimraf=require(_0xedd6('0x1'));var zipdir=require(_0xedd6('0x2'));var jsonpatch=require(_0xedd6('0x3'));var rp=require('request-promise');var moment=require(_0xedd6('0x4'));var BPromise=require(_0xedd6('0x5'));var Mustache=require(_0xedd6('0x6'));var util=require(_0xedd6('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xedd6('0x8'));var fs=require('fs');var fs_extra=require(_0xedd6('0x9'));var _=require('lodash');var squel=require(_0xedd6('0xa'));var crypto=require(_0xedd6('0xb'));var jsforce=require(_0xedd6('0xc'));var deskjs=require(_0xedd6('0xd'));var toCsv=require(_0xedd6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xedd6('0xf'));var authService=require(_0xedd6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xedd6('0x11'));var hardwareService=require(_0xedd6('0x12'));var logger=require(_0xedd6('0x13'))(_0xedd6('0x14'));var utils=require('../../config/utils');var config=require(_0xedd6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xedd6('0x16'))['db'];function respondWithStatusCode(_0x149b96,_0x6019d5){_0x6019d5=_0x6019d5||0xcc;return function(_0x339ab6){if(_0x339ab6){return _0x149b96['sendStatus'](_0x6019d5);}return _0x149b96[_0xedd6('0x17')](_0x6019d5)[_0xedd6('0x18')]();};}function respondWithResult(_0x16217f,_0x109ec5){_0x109ec5=_0x109ec5||0xc8;return function(_0x88ecf){if(_0x88ecf){return _0x16217f[_0xedd6('0x17')](_0x109ec5)[_0xedd6('0x19')](_0x88ecf);}};}function respondWithFilteredResult(_0x40f6bd,_0xb7ddc6){return function(_0x129bef){if(_0x129bef){var _0x2d75f4=typeof _0xb7ddc6[_0xedd6('0x1a')]==='undefined'&&typeof _0xb7ddc6[_0xedd6('0x1b')]===_0xedd6('0x1c');var _0x1c7808=_0x129bef[_0xedd6('0x1d')];var _0x4c0411=_0x2d75f4?0x0:_0xb7ddc6['offset'];var _0x129e82=_0x2d75f4?_0x129bef['count']:_0xb7ddc6[_0xedd6('0x1a')]+_0xb7ddc6[_0xedd6('0x1b')];var _0x3c3473;if(_0x129e82>=_0x1c7808){_0x129e82=_0x1c7808;_0x3c3473=0xc8;}else{_0x3c3473=0xce;}_0x40f6bd[_0xedd6('0x17')](_0x3c3473);return _0x40f6bd[_0xedd6('0x1e')](_0xedd6('0x1f'),_0x4c0411+'-'+_0x129e82+'/'+_0x1c7808)[_0xedd6('0x19')](_0x129bef);}return null;};}function patchUpdates(_0x3440c4){return function(_0x57cfad){try{jsonpatch[_0xedd6('0x20')](_0x57cfad,_0x3440c4,!![]);}catch(_0x7f0e4){return BPromise['reject'](_0x7f0e4);}return _0x57cfad[_0xedd6('0x21')]();};}function saveUpdates(_0x56a59b,_0x22073a){return function(_0x330d32){if(_0x330d32){return _0x330d32[_0xedd6('0x22')](_0x56a59b)['then'](function(_0x14989d){return _0x14989d;});}return null;};}function removeEntity(_0x3c3370,_0xdda721){return function(_0x3f86ab){if(_0x3f86ab){return _0x3f86ab['destroy']()[_0xedd6('0x23')](function(){_0x3c3370[_0xedd6('0x17')](0xcc)[_0xedd6('0x18')]();});}};}function handleEntityNotFound(_0x11748d,_0x518e3f){return function(_0x5968bf){if(!_0x5968bf){_0x11748d['sendStatus'](0x194);}return _0x5968bf;};}function handleError(_0x54bc1a,_0x129758){_0x129758=_0x129758||0x1f4;return function(_0x449eea){logger[_0xedd6('0x24')](_0x449eea[_0xedd6('0x25')]);if(_0x449eea[_0xedd6('0x26')]){delete _0x449eea[_0xedd6('0x26')];}_0x54bc1a[_0xedd6('0x17')](_0x129758)[_0xedd6('0x27')](_0x449eea);};}exports['index']=function(_0x40564e,_0x25e146){var _0x53cc63={},_0xc1730e={},_0x43438d={'count':0x0,'rows':[]};var _0x1875c9=_[_0xedd6('0x28')](db[_0xedd6('0x29')][_0xedd6('0x2a')],function(_0x344788){return{'name':_0x344788[_0xedd6('0x2b')],'type':_0x344788[_0xedd6('0x2c')][_0xedd6('0x2d')]};});_0xc1730e[_0xedd6('0x2e')]=_[_0xedd6('0x28')](_0x1875c9,'name');_0xc1730e['query']=_[_0xedd6('0x2f')](_0x40564e[_0xedd6('0x30')]);_0xc1730e[_0xedd6('0x31')]=_[_0xedd6('0x32')](_0xc1730e[_0xedd6('0x2e')],_0xc1730e[_0xedd6('0x30')]);_0x53cc63[_0xedd6('0x33')]=_[_0xedd6('0x32')](_0xc1730e['model'],qs[_0xedd6('0x34')](_0x40564e[_0xedd6('0x30')]['fields']));_0x53cc63[_0xedd6('0x33')]=_0x53cc63[_0xedd6('0x33')][_0xedd6('0x35')]?_0x53cc63[_0xedd6('0x33')]:_0xc1730e[_0xedd6('0x2e')];if(!_0x40564e[_0xedd6('0x30')][_0xedd6('0x36')](_0xedd6('0x37'))){_0x53cc63['limit']=qs['limit'](_0x40564e[_0xedd6('0x30')][_0xedd6('0x1b')]);_0x53cc63[_0xedd6('0x1a')]=qs[_0xedd6('0x1a')](_0x40564e['query'][_0xedd6('0x1a')]);}_0x53cc63[_0xedd6('0x38')]=qs[_0xedd6('0x39')](_0x40564e[_0xedd6('0x30')][_0xedd6('0x39')]);_0x53cc63[_0xedd6('0x3a')]=qs[_0xedd6('0x31')](_[_0xedd6('0x3b')](_0x40564e[_0xedd6('0x30')],_0xc1730e[_0xedd6('0x31')]),_0x1875c9);if(_0x40564e[_0xedd6('0x30')][_0xedd6('0x3c')]){_0x53cc63[_0xedd6('0x3a')]=_[_0xedd6('0x3d')](_0x53cc63[_0xedd6('0x3a')],{'$or':_[_0xedd6('0x28')](_0x1875c9,function(_0x1acb2b){if(_0x1acb2b[_0xedd6('0x2c')]!=='VIRTUAL'){var _0x1f0f50={};_0x1f0f50[_0x1acb2b[_0xedd6('0x26')]]={'$like':'%'+_0x40564e[_0xedd6('0x30')]['filter']+'%'};return _0x1f0f50;}})});}_0x53cc63=_[_0xedd6('0x3d')]({},_0x53cc63,_0x40564e[_0xedd6('0x3e')]);var _0x53c178={'where':_0x53cc63[_0xedd6('0x3a')]};return db['ZohoField'][_0xedd6('0x1d')](_0x53c178)[_0xedd6('0x23')](function(_0x88f128){_0x43438d['count']=_0x88f128;if(_0x40564e[_0xedd6('0x30')][_0xedd6('0x3f')]){_0x53cc63[_0xedd6('0x40')]=[{'all':!![]}];}return db[_0xedd6('0x29')]['findAll'](_0x53cc63);})[_0xedd6('0x23')](function(_0x1ce16e){_0x43438d[_0xedd6('0x41')]=_0x1ce16e;return _0x43438d;})[_0xedd6('0x23')](respondWithFilteredResult(_0x25e146,_0x53cc63))['catch'](handleError(_0x25e146,null));};exports[_0xedd6('0x42')]=function(_0x24bb2d,_0x344ee9){var _0x381067={'raw':!![],'where':{'id':_0x24bb2d[_0xedd6('0x43')]['id']}},_0x553522={};_0x553522[_0xedd6('0x2e')]=_[_0xedd6('0x2f')](db['ZohoField'][_0xedd6('0x2a')]);_0x553522[_0xedd6('0x30')]=_[_0xedd6('0x2f')](_0x24bb2d[_0xedd6('0x30')]);_0x553522[_0xedd6('0x31')]=_[_0xedd6('0x32')](_0x553522[_0xedd6('0x2e')],_0x553522[_0xedd6('0x30')]);_0x381067[_0xedd6('0x33')]=_[_0xedd6('0x32')](_0x553522['model'],qs[_0xedd6('0x34')](_0x24bb2d[_0xedd6('0x30')][_0xedd6('0x34')]));_0x381067[_0xedd6('0x33')]=_0x381067['attributes'][_0xedd6('0x35')]?_0x381067['attributes']:_0x553522[_0xedd6('0x2e')];if(_0x24bb2d[_0xedd6('0x30')]['includeAll']){_0x381067['include']=[{'all':!![]}];}_0x381067=_[_0xedd6('0x3d')]({},_0x381067,_0x24bb2d[_0xedd6('0x3e')]);return db['ZohoField'][_0xedd6('0x44')](_0x381067)[_0xedd6('0x23')](handleEntityNotFound(_0x344ee9,null))[_0xedd6('0x23')](respondWithResult(_0x344ee9,null))[_0xedd6('0x45')](handleError(_0x344ee9,null));};exports[_0xedd6('0x46')]=function(_0xce3f73,_0x4e6605){return db['ZohoField'][_0xedd6('0x46')](_0xce3f73['body'],{})['then'](respondWithResult(_0x4e6605,0xc9))[_0xedd6('0x45')](handleError(_0x4e6605,null));};exports[_0xedd6('0x22')]=function(_0x50b135,_0x498df2){if(_0x50b135['body']['id']){delete _0x50b135[_0xedd6('0x47')]['id'];}return db[_0xedd6('0x29')][_0xedd6('0x44')]({'where':{'id':_0x50b135[_0xedd6('0x43')]['id']}})['then'](handleEntityNotFound(_0x498df2,null))['then'](saveUpdates(_0x50b135[_0xedd6('0x47')],null))['then'](respondWithResult(_0x498df2,null))[_0xedd6('0x45')](handleError(_0x498df2,null));};exports['destroy']=function(_0x28fe10,_0x1b3818){return db['ZohoField'][_0xedd6('0x44')]({'where':{'id':_0x28fe10['params']['id']}})[_0xedd6('0x23')](handleEntityNotFound(_0x1b3818,null))[_0xedd6('0x23')](removeEntity(_0x1b3818,null))[_0xedd6('0x45')](handleError(_0x1b3818,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 25c017a..649c1d3 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 _0x66fa=['rimraf','../../config/environment','define','ZohoField','int_zoho_fields','idField','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x47137a,_0x5322a7){var _0x573b0a=function(_0x59b375){while(--_0x59b375){_0x47137a['push'](_0x47137a['shift']());}};_0x573b0a(++_0x5322a7);}(_0x66fa,0x117));var _0xa66f=function(_0x275a40,_0x46cdc3){_0x275a40=_0x275a40-0x0;var _0x239bd8=_0x66fa[_0x275a40];return _0x239bd8;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xa66f('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x81c6=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','idField','FieldId','util','bluebird','request-promise','path'];(function(_0x49d6ad,_0x90c7eb){var _0x3ceefc=function(_0x4f0a49){while(--_0x4f0a49){_0x49d6ad['push'](_0x49d6ad['shift']());}};_0x3ceefc(++_0x90c7eb);}(_0x81c6,0x1d5));var _0x681c=function(_0x431cf2,_0x1d4456){_0x431cf2=_0x431cf2-0x0;var _0x10c9a7=_0x81c6[_0x431cf2];return _0x10c9a7;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x681c('0x9'),_0x681c('0xa')],'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 55520d5..dfb1d59 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 _0x448b=['../../config/environment','client','request','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x33d38d,_0xc783c6){var _0x3cb8dc=function(_0x2ea265){while(--_0x2ea265){_0x33d38d['push'](_0x33d38d['shift']());}};_0x3cb8dc(++_0xc783c6);}(_0x448b,0x109));var _0xb448=function(_0x1ee138,_0x2005d6){_0x1ee138=_0x1ee138-0x0;var _0x2c289a=_0x448b[_0x1ee138];return _0x2c289a;};'use strict';var _=require(_0xb448('0x0'));var util=require('util');var moment=require(_0xb448('0x1'));var BPromise=require(_0xb448('0x2'));var rs=require(_0xb448('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb448('0x4'))['db'];var utils=require(_0xb448('0x5'));var logger=require(_0xb448('0x6'))(_0xb448('0x7'));var config=require(_0xb448('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb448('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52250c,_0x56bf32,_0x1189c6){return new BPromise(function(_0x124c7a,_0x51cf75){return client[_0xb448('0xa')](_0x52250c,_0x1189c6)['then'](function(_0x4bb298){logger[_0xb448('0xb')](_0xb448('0xc'),_0x56bf32,'request\x20sent');logger[_0xb448('0xd')](_0xb448('0xe'),_0x56bf32,_0xb448('0xf'),JSON[_0xb448('0x10')](_0x4bb298));if(_0x4bb298[_0xb448('0x11')]){if(_0x4bb298[_0xb448('0x11')][_0xb448('0x12')]===0x1f4){logger[_0xb448('0x11')](_0xb448('0xc'),_0x56bf32,_0x4bb298[_0xb448('0x11')][_0xb448('0x13')]);return _0x51cf75(_0x4bb298['error']['message']);}logger['error'](_0xb448('0xc'),_0x56bf32,_0x4bb298[_0xb448('0x11')][_0xb448('0x13')]);return _0x124c7a(_0x4bb298[_0xb448('0x11')][_0xb448('0x13')]);}else{logger[_0xb448('0xb')](_0xb448('0xc'),_0x56bf32,_0xb448('0xf'));_0x124c7a(_0x4bb298['result'][_0xb448('0x13')]);}})[_0xb448('0x14')](function(_0x25df24){logger['error']('ZohoField,\x20%s,\x20%s',_0x56bf32,_0x25df24);_0x51cf75(_0x25df24);});});} \ No newline at end of file +var _0x446a=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x446a,0x72));var _0xa446=function(_0x3ae766,_0x37c2fa){_0x3ae766=_0x3ae766-0x0;var _0x57d008=_0x446a[_0x3ae766];return _0x57d008;};'use strict';var _=require(_0xa446('0x0'));var util=require(_0xa446('0x1'));var moment=require('moment');var BPromise=require(_0xa446('0x2'));var rs=require(_0xa446('0x3'));var fs=require('fs');var Redis=require(_0xa446('0x4'));var db=require(_0xa446('0x5'))['db'];var utils=require(_0xa446('0x6'));var logger=require(_0xa446('0x7'))(_0xa446('0x8'));var config=require(_0xa446('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa446('0xa')][_0xa446('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e3ea1,_0x27c0fb,_0xc7d132){return new BPromise(function(_0x8a7150,_0x5d0922){return client[_0xa446('0xc')](_0x4e3ea1,_0xc7d132)[_0xa446('0xd')](function(_0x192638){logger[_0xa446('0xe')](_0xa446('0xf'),_0x27c0fb,_0xa446('0x10'));logger[_0xa446('0x11')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x27c0fb,_0xa446('0x10'),JSON['stringify'](_0x192638));if(_0x192638['error']){if(_0x192638[_0xa446('0x12')][_0xa446('0x13')]===0x1f4){logger['error'](_0xa446('0xf'),_0x27c0fb,_0x192638['error'][_0xa446('0x14')]);return _0x5d0922(_0x192638[_0xa446('0x12')]['message']);}logger[_0xa446('0x12')]('ZohoField,\x20%s,\x20%s',_0x27c0fb,_0x192638['error']['message']);return _0x8a7150(_0x192638[_0xa446('0x12')][_0xa446('0x14')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x27c0fb,_0xa446('0x10'));_0x8a7150(_0x192638['result'][_0xa446('0x14')]);}})[_0xa446('0x15')](function(_0x37596d){logger[_0xa446('0x12')]('ZohoField,\x20%s,\x20%s',_0x27c0fb,_0x37596d);_0x5d0922(_0x37596d);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 068b147..10768a4 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x43d71d,_0x197f38){var _0xb98b3e=function(_0x199472){while(--_0x199472){_0x43d71d['push'](_0x43d71d['shift']());}};_0xb98b3e(++_0x197f38);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x347399,_0x42bbda){var _0x24e7be=function(_0x33fdc){while(--_0x33fdc){_0x347399['push'](_0x347399['shift']());}};_0x24e7be(++_0x42bbda);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index d129f2e..b96d939 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 _0x552c=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0x552c,0x66));var _0xc552=function(_0x10b2f4,_0x2a7e9f){_0x10b2f4=_0x10b2f4-0x0;var _0x18fdde=_0x552c[_0x10b2f4];return _0x18fdde;};'use strict';var Sequelize=require(_0xc552('0x0'));module[_0xc552('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xc552('0x2')],'allowNull':![],'unique':_0xc552('0x3')},'main':{'type':Sequelize[_0xc552('0x2')],'defaultValue':_0xc552('0x4')},'filename':{'type':Sequelize[_0xc552('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xc552('0x5')]},'active':{'type':Sequelize[_0xc552('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xc552('0x2')]},'state':{'type':Sequelize[_0xc552('0x2')],'unique':_0xc552('0x7')},'description':{'type':Sequelize[_0xc552('0x2')]},'title':{'type':Sequelize[_0xc552('0x2')]},'remoteUri':{'type':Sequelize[_0xc552('0x2')]},'link':{'type':Sequelize[_0xc552('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5b89=['exports','STRING','unique_name_and_version','app.js','sequelize'];(function(_0x1040e5,_0x4fd332){var _0x458295=function(_0x58c398){while(--_0x58c398){_0x1040e5['push'](_0x1040e5['shift']());}};_0x458295(++_0x4fd332);}(_0x5b89,0x1a3));var _0x95b8=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0x5b89[_0x4503df];return _0x3f1b2b;};'use strict';var Sequelize=require(_0x95b8('0x0'));module[_0x95b8('0x1')]={'name':{'type':Sequelize[_0x95b8('0x2')],'allowNull':![],'unique':_0x95b8('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x95b8('0x3')},'main':{'type':Sequelize[_0x95b8('0x2')],'defaultValue':_0x95b8('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x95b8('0x2')]},'type':{'type':Sequelize[_0x95b8('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x95b8('0x2')]},'logo':{'type':Sequelize[_0x95b8('0x2')]},'state':{'type':Sequelize[_0x95b8('0x2')],'unique':'state'},'description':{'type':Sequelize[_0x95b8('0x2')]},'title':{'type':Sequelize[_0x95b8('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x95b8('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0351d20..41ce096 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x11b4db,_0x2da69c){var _0x200179=function(_0x3a8506){while(--_0x3a8506){_0x11b4db['push'](_0x11b4db['shift']());}};_0x200179(++_0x2da69c);}(_0x7a54,0x106));var _0x47a5=function(_0x1b70f2,_0x2bd17d){_0x1b70f2=_0x1b70f2-0x0;var _0x45c418=_0x7a54[_0x1b70f2];return _0x45c418;};'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['Integration'][_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['Integration']['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['Integration']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0xfdbd=['findAll','rows','show','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x3cdccd,_0x3d4011){var _0x4936a1=function(_0x132255){while(--_0x132255){_0x3cdccd['push'](_0x3cdccd['shift']());}};_0x4936a1(++_0x3d4011);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x45dd0e,_0x28e603){_0x45dd0e=_0x45dd0e-0x0;var _0x50e5ca=_0xfdbd[_0x45dd0e];return _0x50e5ca;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['Integration'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['Integration']['create'](_0x1c08fb[_0xdfdb('0x4b')],{})[_0xdfdb('0x26')](respondWithResult(_0x273477,0xc9))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports['update']=function(_0x36149e,_0x4d4c90){if(_0x36149e[_0xdfdb('0x4b')]['id']){delete _0x36149e[_0xdfdb('0x4b')]['id'];}return db['Integration'][_0xdfdb('0x48')]({'where':{'id':_0x36149e[_0xdfdb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d4c90,null))[_0xdfdb('0x26')](saveUpdates(_0x36149e[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x4d4c90,null))[_0xdfdb('0x49')](handleError(_0x4d4c90,null));};exports[_0xdfdb('0x25')]=function(_0x10b490,_0x17dfdb){return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'id':_0x10b490['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x17dfdb,null))['then'](removeEntity(_0x17dfdb,null))[_0xdfdb('0x49')](handleError(_0x17dfdb,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 3f8632d..1741328 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 _0x19ff=['../../config/environment','./integration.attributes','exports','Integration','integrations','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0xd58823,_0x15c483){var _0x249c0a=function(_0x4b8b67){while(--_0x4b8b67){_0xd58823['push'](_0xd58823['shift']());}};_0x249c0a(++_0x15c483);}(_0x19ff,0x9f));var _0xf19f=function(_0x5c50b4,_0x59823e){_0x5c50b4=_0x5c50b4-0x0;var _0x519cd4=_0x19ff[_0x5c50b4];return _0x519cd4;};'use strict';var _=require(_0xf19f('0x0'));var util=require('util');var logger=require(_0xf19f('0x1'))(_0xf19f('0x2'));var moment=require('moment');var BPromise=require(_0xf19f('0x3'));var rp=require(_0xf19f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf19f('0x5'));var config=require(_0xf19f('0x6'));var attributes=require(_0xf19f('0x7'));module[_0xf19f('0x8')]=function(_0x50b0ca,_0x15b3c4){return _0x50b0ca['define'](_0xf19f('0x9'),attributes,{'tableName':_0xf19f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dbc=['integrations','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0xa6ea8f,_0xcfee99){var _0x140466=function(_0x480e83){while(--_0x480e83){_0xa6ea8f['push'](_0xa6ea8f['shift']());}};_0x140466(++_0xcfee99);}(_0x6dbc,0x187));var _0xc6db=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6dbc[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xc6db('0x0'));var util=require(_0xc6db('0x1'));var logger=require(_0xc6db('0x2'))(_0xc6db('0x3'));var moment=require(_0xc6db('0x4'));var BPromise=require(_0xc6db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc6db('0x6'));var config=require(_0xc6db('0x7'));var attributes=require(_0xc6db('0x8'));module[_0xc6db('0x9')]=function(_0x56dc44,_0x448282){return _0x56dc44[_0xc6db('0xa')](_0xc6db('0xb'),attributes,{'tableName':_0xc6db('0xc'),'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 e926c91..dcc99ec 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x524e,0x15e));var _0xe524=function(_0x531c45,_0x240840){_0x531c45=_0x531c45-0x0;var _0x48845c=_0x524e[_0x531c45];return _0x48845c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0x4137,0xf8));var _0x7413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4137[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6611e2d..5622cdb 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 _0xc2c7=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x8a6a05,_0x3f3c3e){var _0x4917de=function(_0xc6bea0){while(--_0xc6bea0){_0x8a6a05['push'](_0x8a6a05['shift']());}};_0x4917de(++_0x3f3c3e);}(_0xc2c7,0x134));var _0x7c2c=function(_0x3022cd,_0xa06275){_0x3022cd=_0x3022cd-0x0;var _0x59e04a=_0xc2c7[_0x3022cd];return _0x59e04a;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);router[_0x7c2c('0x11')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x12')]);module[_0x7c2c('0x13')]=router; \ No newline at end of file +var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0xadb5,0xad));var _0x5adb=function(_0x42e080,_0x226f54){_0x42e080=_0x42e080-0x0;var _0x74f297=_0xadb5[_0x42e080];return _0x74f297;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./integrationReport.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 4ad0f56..7a671f0 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 _0xbd08=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','exports','STRING'];(function(_0x1b0c8c,_0xa1278f){var _0x553a6e=function(_0x1ce99d){while(--_0x1ce99d){_0x1b0c8c['push'](_0x1b0c8c['shift']());}};_0x553a6e(++_0xa1278f);}(_0xbd08,0x166));var _0x8bd0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbd08[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x8bd0('0x0')]={'integration':{'type':Sequelize[_0x8bd0('0x1')]},'eventChannel':{'type':Sequelize[_0x8bd0('0x1')]},'exitStatus':{'type':Sequelize[_0x8bd0('0x1')]},'ticketId':{'type':Sequelize[_0x8bd0('0x1')]},'integrationId':{'type':Sequelize[_0x8bd0('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8bd0('0x1')]},'calleridname':{'type':Sequelize[_0x8bd0('0x1')]},'queue':{'type':Sequelize[_0x8bd0('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8bd0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x8bd0('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8bd0('0x3')]},'holdtime':{'type':Sequelize[_0x8bd0('0x2')]},'agentcomplete':{'type':Sequelize[_0x8bd0('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8bd0('0x3')]},'talktime':{'type':Sequelize[_0x8bd0('0x2')]},'agentacw':{'type':Sequelize[_0x8bd0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8bd0('0x2')]},'reason':{'type':Sequelize[_0x8bd0('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x8bd0('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8bd0('0x3')]},'agentdump':{'type':Sequelize[_0x8bd0('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8bd0('0x3')]},'lastevent':{'type':Sequelize[_0x8bd0('0x1')]},'channel':{'type':Sequelize[_0x8bd0('0x1')]},'channelstate':{'type':Sequelize[_0x8bd0('0x2')]},'channelstatedesc':{'type':Sequelize[_0x8bd0('0x1')]},'connectedlinenum':{'type':Sequelize[_0x8bd0('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8bd0('0x1')]},'accountcode':{'type':Sequelize[_0x8bd0('0x1')]},'context':{'type':Sequelize[_0x8bd0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x8bd0('0x1')]},'destchannelstate':{'type':Sequelize[_0x8bd0('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x8bd0('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8bd0('0x1')]},'destcalleridname':{'type':Sequelize[_0x8bd0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8bd0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x8bd0('0x1')]},'destlanguage':{'type':Sequelize[_0x8bd0('0x1')]},'destaccountcode':{'type':Sequelize[_0x8bd0('0x1')]},'destcontext':{'type':Sequelize[_0x8bd0('0x1')]},'destexten':{'type':Sequelize[_0x8bd0('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8bd0('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8bd0('0x1')]},'subject':{'type':Sequelize[_0x8bd0('0x1')]},'from':{'type':Sequelize[_0x8bd0('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x8bd0('0x1')]},'attachment':{'type':Sequelize[_0x8bd0('0x5')]},'html':{'type':Sequelize[_0x8bd0('0x5')]},'text':{'type':Sequelize[_0x8bd0('0x5')]},'status':{'type':Sequelize[_0x8bd0('0x6')]('SENT',_0x8bd0('0x7'),_0x8bd0('0x8'),_0x8bd0('0x9'))},'url':{'type':Sequelize[_0x8bd0('0x1')]},'app':{'type':Sequelize[_0x8bd0('0x1')]},'appdata':{'type':Sequelize[_0x8bd0('0x1')]},'projectId':{'type':Sequelize[_0x8bd0('0x2')]}}; \ No newline at end of file +var _0xbfab=['TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE'];(function(_0x56a249,_0x3766d2){var _0x36b50e=function(_0x709799){while(--_0x709799){_0x56a249['push'](_0x56a249['shift']());}};_0x36b50e(++_0x3766d2);}(_0xbfab,0x165));var _0xbbfa=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xbfab[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xbbfa('0x0'));module[_0xbbfa('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xbbfa('0x2')]},'ticketId':{'type':Sequelize[_0xbbfa('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xbbfa('0x2')]},'uniqueid':{'type':Sequelize[_0xbbfa('0x2')]},'calleridnum':{'type':Sequelize[_0xbbfa('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xbbfa('0x2')]},'interface':{'type':Sequelize[_0xbbfa('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xbbfa('0x3')]},'agentcomplete':{'type':Sequelize[_0xbbfa('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xbbfa('0x5')]},'talktime':{'type':Sequelize[_0xbbfa('0x3')]},'agentacw':{'type':Sequelize[_0xbbfa('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbbfa('0x3')]},'reason':{'type':Sequelize[_0xbbfa('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xbbfa('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xbbfa('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbbfa('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xbbfa('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbbfa('0x2')]},'language':{'type':Sequelize[_0xbbfa('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbbfa('0x2')]},'exten':{'type':Sequelize[_0xbbfa('0x2')]},'priority':{'type':Sequelize[_0xbbfa('0x2')]},'destchannel':{'type':Sequelize[_0xbbfa('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xbbfa('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbbfa('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbbfa('0x2')]},'destlanguage':{'type':Sequelize[_0xbbfa('0x2')]},'destaccountcode':{'type':Sequelize[_0xbbfa('0x2')]},'destcontext':{'type':Sequelize[_0xbbfa('0x2')]},'destexten':{'type':Sequelize[_0xbbfa('0x2')]},'destpriority':{'type':Sequelize[_0xbbfa('0x2')]},'destuniqueid':{'type':Sequelize[_0xbbfa('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xbbfa('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xbbfa('0x2')]},'to':{'type':Sequelize[_0xbbfa('0x2')]},'cc':{'type':Sequelize[_0xbbfa('0x2')]},'attachment':{'type':Sequelize[_0xbbfa('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xbbfa('0x6')]},'status':{'type':Sequelize['ENUM'](_0xbbfa('0x7'),_0xbbfa('0x8'),_0xbbfa('0x9'),_0xbbfa('0xa'))},'url':{'type':Sequelize[_0xbbfa('0x2')]},'app':{'type':Sequelize[_0xbbfa('0x2')]},'appdata':{'type':Sequelize[_0xbbfa('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d6d96ac..a1999cd 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 _0xb56c=['index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xb56c,0xc2));var _0xcb56=function(_0x4b6507,_0x5518b5){_0x4b6507=_0x4b6507-0x0;var _0x2001ec=_0xb56c[_0x4b6507];return _0x2001ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb56('0x0'));var zipdir=require(_0xcb56('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb56('0x2'));var moment=require('moment');var BPromise=require(_0xcb56('0x3'));var Mustache=require('mustache');var util=require(_0xcb56('0x4'));var path=require(_0xcb56('0x5'));var sox=require(_0xcb56('0x6'));var csv=require(_0xcb56('0x7'));var ejs=require(_0xcb56('0x8'));var fs=require('fs');var fs_extra=require(_0xcb56('0x9'));var _=require(_0xcb56('0xa'));var squel=require(_0xcb56('0xb'));var crypto=require(_0xcb56('0xc'));var jsforce=require(_0xcb56('0xd'));var deskjs=require(_0xcb56('0xe'));var toCsv=require(_0xcb56('0x7'));var querystring=require(_0xcb56('0xf'));var Papa=require(_0xcb56('0x10'));var Redis=require(_0xcb56('0x11'));var authService=require(_0xcb56('0x12'));var qs=require(_0xcb56('0x13'));var as=require(_0xcb56('0x14'));var hardwareService=require(_0xcb56('0x15'));var logger=require(_0xcb56('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xcb56('0x17'));var licenseUtil=require(_0xcb56('0x18'));var db=require(_0xcb56('0x19'))['db'];function respondWithStatusCode(_0x5b9904,_0xb31b33){_0xb31b33=_0xb31b33||0xcc;return function(_0x378ca7){if(_0x378ca7){return _0x5b9904[_0xcb56('0x1a')](_0xb31b33);}return _0x5b9904[_0xcb56('0x1b')](_0xb31b33)['end']();};}function respondWithResult(_0x165554,_0xd7e21c){_0xd7e21c=_0xd7e21c||0xc8;return function(_0x5e2022){if(_0x5e2022){return _0x165554[_0xcb56('0x1b')](_0xd7e21c)['json'](_0x5e2022);}};}function respondWithFilteredResult(_0x52f0d2,_0x3fc1b4){return function(_0x205208){if(_0x205208){var _0x2b483d=typeof _0x3fc1b4[_0xcb56('0x1c')]===_0xcb56('0x1d')&&typeof _0x3fc1b4[_0xcb56('0x1e')]==='undefined';var _0x1498ab=_0x205208[_0xcb56('0x1f')];var _0xe2626=_0x2b483d?0x0:_0x3fc1b4[_0xcb56('0x1c')];var _0x51ebbd=_0x2b483d?_0x205208[_0xcb56('0x1f')]:_0x3fc1b4[_0xcb56('0x1c')]+_0x3fc1b4[_0xcb56('0x1e')];var _0x3f6538;if(_0x51ebbd>=_0x1498ab){_0x51ebbd=_0x1498ab;_0x3f6538=0xc8;}else{_0x3f6538=0xce;}_0x52f0d2['status'](_0x3f6538);return _0x52f0d2[_0xcb56('0x20')](_0xcb56('0x21'),_0xe2626+'-'+_0x51ebbd+'/'+_0x1498ab)[_0xcb56('0x22')](_0x205208);}return null;};}function patchUpdates(_0xaf7310){return function(_0xe5aa49){try{jsonpatch[_0xcb56('0x23')](_0xe5aa49,_0xaf7310,!![]);}catch(_0xa0c060){return BPromise[_0xcb56('0x24')](_0xa0c060);}return _0xe5aa49[_0xcb56('0x25')]();};}function saveUpdates(_0x199608,_0x4306c6){return function(_0x352b0e){if(_0x352b0e){return _0x352b0e[_0xcb56('0x26')](_0x199608)[_0xcb56('0x27')](function(_0x44226f){return _0x44226f;});}return null;};}function removeEntity(_0x3d75e5,_0x3e72ee){return function(_0x2d1036){if(_0x2d1036){return _0x2d1036[_0xcb56('0x28')]()[_0xcb56('0x27')](function(){_0x3d75e5[_0xcb56('0x1b')](0xcc)[_0xcb56('0x29')]();});}};}function handleEntityNotFound(_0x668a9f,_0x3f98af){return function(_0x35d9ab){if(!_0x35d9ab){_0x668a9f[_0xcb56('0x1a')](0x194);}return _0x35d9ab;};}function handleError(_0x5e1424,_0x2b04aa){_0x2b04aa=_0x2b04aa||0x1f4;return function(_0x4bd5fa){logger[_0xcb56('0x2a')](_0x4bd5fa[_0xcb56('0x2b')]);if(_0x4bd5fa['name']){delete _0x4bd5fa[_0xcb56('0x2c')];}_0x5e1424['status'](_0x2b04aa)[_0xcb56('0x2d')](_0x4bd5fa);};}exports[_0xcb56('0x2e')]=function(_0xfd883c,_0x1376da){var _0x510502={},_0x18fdd7={},_0x27cc85={'count':0x0,'rows':[]};var _0x500b4c=_[_0xcb56('0x2f')](db[_0xcb56('0x30')][_0xcb56('0x31')],function(_0x70a44c){return{'name':_0x70a44c[_0xcb56('0x32')],'type':_0x70a44c[_0xcb56('0x33')][_0xcb56('0x34')]};});_0x18fdd7[_0xcb56('0x35')]=_['map'](_0x500b4c,_0xcb56('0x2c'));_0x18fdd7[_0xcb56('0x36')]=_['keys'](_0xfd883c[_0xcb56('0x36')]);_0x18fdd7[_0xcb56('0x37')]=_['intersection'](_0x18fdd7[_0xcb56('0x35')],_0x18fdd7[_0xcb56('0x36')]);_0x510502[_0xcb56('0x38')]=_[_0xcb56('0x39')](_0x18fdd7[_0xcb56('0x35')],qs['fields'](_0xfd883c[_0xcb56('0x36')][_0xcb56('0x3a')]));_0x510502[_0xcb56('0x38')]=_0x510502[_0xcb56('0x38')][_0xcb56('0x3b')]?_0x510502['attributes']:_0x18fdd7[_0xcb56('0x35')];if(!_0xfd883c['query'][_0xcb56('0x3c')]('nolimit')){_0x510502[_0xcb56('0x1e')]=qs[_0xcb56('0x1e')](_0xfd883c[_0xcb56('0x36')][_0xcb56('0x1e')]);_0x510502[_0xcb56('0x1c')]=qs[_0xcb56('0x1c')](_0xfd883c[_0xcb56('0x36')]['offset']);}_0x510502[_0xcb56('0x3d')]=qs[_0xcb56('0x3e')](_0xfd883c[_0xcb56('0x36')][_0xcb56('0x3e')]);_0x510502[_0xcb56('0x3f')]=qs[_0xcb56('0x37')](_['pick'](_0xfd883c['query'],_0x18fdd7['filters']),_0x500b4c);if(_0xfd883c[_0xcb56('0x36')][_0xcb56('0x40')]){_0x510502[_0xcb56('0x3f')]=_['merge'](_0x510502['where'],{'$or':_['map'](_0x500b4c,function(_0x4a357b){if(_0x4a357b[_0xcb56('0x33')]!==_0xcb56('0x41')){var _0x948e68={};_0x948e68[_0x4a357b[_0xcb56('0x2c')]]={'$like':'%'+_0xfd883c['query'][_0xcb56('0x40')]+'%'};return _0x948e68;}})});}_0x510502=_[_0xcb56('0x42')]({},_0x510502,_0xfd883c[_0xcb56('0x43')]);var _0x19594b={'where':_0x510502[_0xcb56('0x3f')]};return db[_0xcb56('0x30')][_0xcb56('0x1f')](_0x19594b)[_0xcb56('0x27')](function(_0x2eaaba){_0x27cc85['count']=_0x2eaaba;if(_0xfd883c['query'][_0xcb56('0x44')]){_0x510502['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xcb56('0x45')](_0x510502);})[_0xcb56('0x27')](function(_0x53e05a){_0x27cc85[_0xcb56('0x46')]=_0x53e05a;return _0x27cc85;})[_0xcb56('0x27')](respondWithFilteredResult(_0x1376da,_0x510502))[_0xcb56('0x47')](handleError(_0x1376da,null));};exports[_0xcb56('0x48')]=function(_0x3d7b50,_0x33a6d1){var _0x8d640a={'raw':![],'where':{'id':_0x3d7b50[_0xcb56('0x49')]['id']}},_0x53d46a={};_0x53d46a[_0xcb56('0x35')]=_[_0xcb56('0x4a')](db[_0xcb56('0x30')][_0xcb56('0x31')]);_0x53d46a[_0xcb56('0x36')]=_['keys'](_0x3d7b50[_0xcb56('0x36')]);_0x53d46a[_0xcb56('0x37')]=_[_0xcb56('0x39')](_0x53d46a[_0xcb56('0x35')],_0x53d46a['query']);_0x8d640a['attributes']=_['intersection'](_0x53d46a[_0xcb56('0x35')],qs['fields'](_0x3d7b50['query']['fields']));_0x8d640a[_0xcb56('0x38')]=_0x8d640a[_0xcb56('0x38')]['length']?_0x8d640a[_0xcb56('0x38')]:_0x53d46a[_0xcb56('0x35')];if(_0x3d7b50[_0xcb56('0x36')][_0xcb56('0x44')]){_0x8d640a[_0xcb56('0x4b')]=[{'all':!![]}];}_0x8d640a=_[_0xcb56('0x42')]({},_0x8d640a,_0x3d7b50[_0xcb56('0x43')]);return db[_0xcb56('0x30')][_0xcb56('0x4c')](_0x8d640a)[_0xcb56('0x27')](handleEntityNotFound(_0x33a6d1,null))[_0xcb56('0x27')](respondWithResult(_0x33a6d1,null))['catch'](handleError(_0x33a6d1,null));};exports['create']=function(_0x4c0934,_0x420db0){return db[_0xcb56('0x30')][_0xcb56('0x4d')](_0x4c0934[_0xcb56('0x4e')],{})[_0xcb56('0x27')](respondWithResult(_0x420db0,0xc9))[_0xcb56('0x47')](handleError(_0x420db0,null));};exports[_0xcb56('0x26')]=function(_0x4eb828,_0x983cf4){if(_0x4eb828[_0xcb56('0x4e')]['id']){delete _0x4eb828['body']['id'];}return db[_0xcb56('0x30')]['find']({'where':{'id':_0x4eb828[_0xcb56('0x49')]['id']}})[_0xcb56('0x27')](handleEntityNotFound(_0x983cf4,null))[_0xcb56('0x27')](saveUpdates(_0x4eb828[_0xcb56('0x4e')],null))[_0xcb56('0x27')](respondWithResult(_0x983cf4,null))['catch'](handleError(_0x983cf4,null));};exports[_0xcb56('0x28')]=function(_0xdb3854,_0x10a38c){return db[_0xcb56('0x30')]['find']({'where':{'id':_0xdb3854[_0xcb56('0x49')]['id']}})[_0xcb56('0x27')](handleEntityNotFound(_0x10a38c,null))[_0xcb56('0x27')](removeEntity(_0x10a38c,null))['catch'](handleError(_0x10a38c,null));};exports[_0xcb56('0x4f')]=function(_0x246e7a,_0xfa229b){return db[_0xcb56('0x30')][_0xcb56('0x4f')]()[_0xcb56('0x27')](respondWithResult(_0xfa229b,null))[_0xcb56('0x47')](handleError(_0xfa229b,null));}; \ No newline at end of file +var _0x1d21=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','IntegrationReport','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x44fbf0,_0x29af3e){var _0x2de626=function(_0x209981){while(--_0x209981){_0x44fbf0['push'](_0x44fbf0['shift']());}};_0x2de626(++_0x29af3e);}(_0x1d21,0x1b0));var _0x11d2=function(_0xf7bf02,_0x13da13){_0xf7bf02=_0xf7bf02-0x0;var _0x4f263f=_0x1d21[_0xf7bf02];return _0x4f263f;};'use strict';var emlformat=require(_0x11d2('0x0'));var rimraf=require(_0x11d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x11d2('0x2'));var moment=require(_0x11d2('0x3'));var BPromise=require(_0x11d2('0x4'));var Mustache=require(_0x11d2('0x5'));var util=require('util');var path=require(_0x11d2('0x6'));var sox=require(_0x11d2('0x7'));var csv=require(_0x11d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11d2('0x9'));var squel=require(_0x11d2('0xa'));var crypto=require(_0x11d2('0xb'));var jsforce=require(_0x11d2('0xc'));var deskjs=require(_0x11d2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x11d2('0xe'));var Papa=require(_0x11d2('0xf'));var Redis=require(_0x11d2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x11d2('0x11'));var as=require(_0x11d2('0x12'));var hardwareService=require(_0x11d2('0x13'));var logger=require(_0x11d2('0x14'))(_0x11d2('0x15'));var utils=require('../../config/utils');var config=require(_0x11d2('0x16'));var licenseUtil=require(_0x11d2('0x17'));var db=require(_0x11d2('0x18'))['db'];function respondWithStatusCode(_0x5e5896,_0x196df4){_0x196df4=_0x196df4||0xcc;return function(_0x34bb9c){if(_0x34bb9c){return _0x5e5896[_0x11d2('0x19')](_0x196df4);}return _0x5e5896[_0x11d2('0x1a')](_0x196df4)[_0x11d2('0x1b')]();};}function respondWithResult(_0x5a2eb3,_0x38bf92){_0x38bf92=_0x38bf92||0xc8;return function(_0x35fad2){if(_0x35fad2){return _0x5a2eb3[_0x11d2('0x1a')](_0x38bf92)[_0x11d2('0x1c')](_0x35fad2);}};}function respondWithFilteredResult(_0x3912b1,_0x23cac9){return function(_0x2ca086){if(_0x2ca086){var _0x300065=typeof _0x23cac9[_0x11d2('0x1d')]===_0x11d2('0x1e')&&typeof _0x23cac9[_0x11d2('0x1f')]===_0x11d2('0x1e');var _0x44c6d5=_0x2ca086[_0x11d2('0x20')];var _0x40bbb0=_0x300065?0x0:_0x23cac9[_0x11d2('0x1d')];var _0x3b9cea=_0x300065?_0x2ca086['count']:_0x23cac9[_0x11d2('0x1d')]+_0x23cac9[_0x11d2('0x1f')];var _0x57c82c;if(_0x3b9cea>=_0x44c6d5){_0x3b9cea=_0x44c6d5;_0x57c82c=0xc8;}else{_0x57c82c=0xce;}_0x3912b1[_0x11d2('0x1a')](_0x57c82c);return _0x3912b1[_0x11d2('0x21')](_0x11d2('0x22'),_0x40bbb0+'-'+_0x3b9cea+'/'+_0x44c6d5)[_0x11d2('0x1c')](_0x2ca086);}return null;};}function patchUpdates(_0xd96275){return function(_0x339860){try{jsonpatch[_0x11d2('0x23')](_0x339860,_0xd96275,!![]);}catch(_0x22e5fb){return BPromise[_0x11d2('0x24')](_0x22e5fb);}return _0x339860[_0x11d2('0x25')]();};}function saveUpdates(_0x3ec8d8,_0x31742b){return function(_0x4beea0){if(_0x4beea0){return _0x4beea0[_0x11d2('0x26')](_0x3ec8d8)[_0x11d2('0x27')](function(_0x1ad856){return _0x1ad856;});}return null;};}function removeEntity(_0x1b468e,_0x2c2536){return function(_0x21c8ed){if(_0x21c8ed){return _0x21c8ed[_0x11d2('0x28')]()[_0x11d2('0x27')](function(){_0x1b468e[_0x11d2('0x1a')](0xcc)[_0x11d2('0x1b')]();});}};}function handleEntityNotFound(_0x6e6282,_0x161b54){return function(_0xbe6d30){if(!_0xbe6d30){_0x6e6282[_0x11d2('0x19')](0x194);}return _0xbe6d30;};}function handleError(_0x21ed2c,_0x13be39){_0x13be39=_0x13be39||0x1f4;return function(_0x531307){logger[_0x11d2('0x29')](_0x531307['stack']);if(_0x531307['name']){delete _0x531307['name'];}_0x21ed2c['status'](_0x13be39)['send'](_0x531307);};}exports['index']=function(_0x46e0e5,_0x4e6edb){var _0x4111f6={},_0x4c7db8={},_0x10b07d={'count':0x0,'rows':[]};var _0x1a9635=_['map'](db[_0x11d2('0x2a')][_0x11d2('0x2b')],function(_0x592a09){return{'name':_0x592a09['fieldName'],'type':_0x592a09[_0x11d2('0x2c')][_0x11d2('0x2d')]};});_0x4c7db8[_0x11d2('0x2e')]=_['map'](_0x1a9635,_0x11d2('0x2f'));_0x4c7db8[_0x11d2('0x30')]=_[_0x11d2('0x31')](_0x46e0e5[_0x11d2('0x30')]);_0x4c7db8[_0x11d2('0x32')]=_[_0x11d2('0x33')](_0x4c7db8[_0x11d2('0x2e')],_0x4c7db8['query']);_0x4111f6[_0x11d2('0x34')]=_[_0x11d2('0x33')](_0x4c7db8[_0x11d2('0x2e')],qs['fields'](_0x46e0e5[_0x11d2('0x30')]['fields']));_0x4111f6['attributes']=_0x4111f6['attributes'][_0x11d2('0x35')]?_0x4111f6[_0x11d2('0x34')]:_0x4c7db8['model'];if(!_0x46e0e5[_0x11d2('0x30')][_0x11d2('0x36')](_0x11d2('0x37'))){_0x4111f6[_0x11d2('0x1f')]=qs[_0x11d2('0x1f')](_0x46e0e5[_0x11d2('0x30')][_0x11d2('0x1f')]);_0x4111f6['offset']=qs[_0x11d2('0x1d')](_0x46e0e5[_0x11d2('0x30')][_0x11d2('0x1d')]);}_0x4111f6['order']=qs[_0x11d2('0x38')](_0x46e0e5[_0x11d2('0x30')]['sort']);_0x4111f6[_0x11d2('0x39')]=qs['filters'](_[_0x11d2('0x3a')](_0x46e0e5['query'],_0x4c7db8[_0x11d2('0x32')]),_0x1a9635);if(_0x46e0e5[_0x11d2('0x30')][_0x11d2('0x3b')]){_0x4111f6[_0x11d2('0x39')]=_['merge'](_0x4111f6[_0x11d2('0x39')],{'$or':_[_0x11d2('0x3c')](_0x1a9635,function(_0x4560b1){if(_0x4560b1[_0x11d2('0x2c')]!==_0x11d2('0x3d')){var _0x17d1b0={};_0x17d1b0[_0x4560b1[_0x11d2('0x2f')]]={'$like':'%'+_0x46e0e5['query'][_0x11d2('0x3b')]+'%'};return _0x17d1b0;}})});}_0x4111f6=_['merge']({},_0x4111f6,_0x46e0e5[_0x11d2('0x3e')]);var _0x2687e1={'where':_0x4111f6[_0x11d2('0x39')]};return db[_0x11d2('0x2a')][_0x11d2('0x20')](_0x2687e1)[_0x11d2('0x27')](function(_0x55e47e){_0x10b07d[_0x11d2('0x20')]=_0x55e47e;if(_0x46e0e5[_0x11d2('0x30')][_0x11d2('0x3f')]){_0x4111f6[_0x11d2('0x40')]=[{'all':!![]}];}return db[_0x11d2('0x2a')][_0x11d2('0x41')](_0x4111f6);})[_0x11d2('0x27')](function(_0x432b04){_0x10b07d[_0x11d2('0x42')]=_0x432b04;return _0x10b07d;})[_0x11d2('0x27')](respondWithFilteredResult(_0x4e6edb,_0x4111f6))[_0x11d2('0x43')](handleError(_0x4e6edb,null));};exports[_0x11d2('0x44')]=function(_0x51d441,_0x5696c3){var _0x30b601={'raw':![],'where':{'id':_0x51d441[_0x11d2('0x45')]['id']}},_0x472d78={};_0x472d78[_0x11d2('0x2e')]=_[_0x11d2('0x31')](db[_0x11d2('0x2a')][_0x11d2('0x2b')]);_0x472d78[_0x11d2('0x30')]=_[_0x11d2('0x31')](_0x51d441['query']);_0x472d78[_0x11d2('0x32')]=_[_0x11d2('0x33')](_0x472d78[_0x11d2('0x2e')],_0x472d78[_0x11d2('0x30')]);_0x30b601[_0x11d2('0x34')]=_['intersection'](_0x472d78[_0x11d2('0x2e')],qs['fields'](_0x51d441[_0x11d2('0x30')][_0x11d2('0x46')]));_0x30b601[_0x11d2('0x34')]=_0x30b601['attributes'][_0x11d2('0x35')]?_0x30b601[_0x11d2('0x34')]:_0x472d78[_0x11d2('0x2e')];if(_0x51d441['query'][_0x11d2('0x3f')]){_0x30b601[_0x11d2('0x40')]=[{'all':!![]}];}_0x30b601=_[_0x11d2('0x47')]({},_0x30b601,_0x51d441[_0x11d2('0x3e')]);return db[_0x11d2('0x2a')][_0x11d2('0x48')](_0x30b601)['then'](handleEntityNotFound(_0x5696c3,null))['then'](respondWithResult(_0x5696c3,null))['catch'](handleError(_0x5696c3,null));};exports[_0x11d2('0x49')]=function(_0x9939a6,_0x5eef2c){return db['IntegrationReport']['create'](_0x9939a6['body'],{})['then'](respondWithResult(_0x5eef2c,0xc9))['catch'](handleError(_0x5eef2c,null));};exports['update']=function(_0x5bec1a,_0x4450d1){if(_0x5bec1a[_0x11d2('0x4a')]['id']){delete _0x5bec1a[_0x11d2('0x4a')]['id'];}return db[_0x11d2('0x2a')][_0x11d2('0x48')]({'where':{'id':_0x5bec1a[_0x11d2('0x45')]['id']}})[_0x11d2('0x27')](handleEntityNotFound(_0x4450d1,null))[_0x11d2('0x27')](saveUpdates(_0x5bec1a[_0x11d2('0x4a')],null))[_0x11d2('0x27')](respondWithResult(_0x4450d1,null))[_0x11d2('0x43')](handleError(_0x4450d1,null));};exports['destroy']=function(_0x11ed44,_0xf88534){return db[_0x11d2('0x2a')][_0x11d2('0x48')]({'where':{'id':_0x11ed44[_0x11d2('0x45')]['id']}})[_0x11d2('0x27')](handleEntityNotFound(_0xf88534,null))['then'](removeEntity(_0xf88534,null))['catch'](handleError(_0xf88534,null));};exports[_0x11d2('0x4b')]=function(_0x117527,_0x589458){return db['IntegrationReport'][_0x11d2('0x4b')]()[_0x11d2('0x27')](respondWithResult(_0x589458,null))[_0x11d2('0x43')](handleError(_0x589458,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d7cfe30..9ecc8d6 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 _0x762b=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','report_integration'];(function(_0x2364b4,_0x21cd03){var _0x1592ca=function(_0x44a74b){while(--_0x44a74b){_0x2364b4['push'](_0x2364b4['shift']());}};_0x1592ca(++_0x21cd03);}(_0x762b,0xa5));var _0xb762=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x762b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xb762('0x0'));var util=require('util');var logger=require(_0xb762('0x1'))('api');var moment=require(_0xb762('0x2'));var BPromise=require(_0xb762('0x3'));var rp=require(_0xb762('0x4'));var fs=require('fs');var path=require(_0xb762('0x5'));var rimraf=require(_0xb762('0x6'));var config=require('../../config/environment');var attributes=require(_0xb762('0x7'));module[_0xb762('0x8')]=function(_0x2c3ded,_0x1ec873){return _0x2c3ded[_0xb762('0x9')]('IntegrationReport',attributes,{'tableName':_0xb762('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8560=['path','rimraf','IntegrationReport','report_integration','lodash','util','api','moment','bluebird','request-promise'];(function(_0x291014,_0x5073d8){var _0x30a9dc=function(_0x2fcbcd){while(--_0x2fcbcd){_0x291014['push'](_0x291014['shift']());}};_0x30a9dc(++_0x5073d8);}(_0x8560,0xae));var _0x0856=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0x8560[_0x3d8ca8];return _0x517e45;};'use strict';var _=require(_0x0856('0x0'));var util=require(_0x0856('0x1'));var logger=require('../../config/logger')(_0x0856('0x2'));var moment=require(_0x0856('0x3'));var BPromise=require(_0x0856('0x4'));var rp=require(_0x0856('0x5'));var fs=require('fs');var path=require(_0x0856('0x6'));var rimraf=require(_0x0856('0x7'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0x484922,_0x3aa4cd){return _0x484922['define'](_0x0856('0x8'),attributes,{'tableName':_0x0856('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index fcfa7eb..d509e7c 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 _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2f8b63,_0x5e8435){var _0x5431f9=function(_0x5072d5){while(--_0x5072d5){_0x2f8b63['push'](_0x2f8b63['shift']());}};_0x5431f9(++_0x5e8435);}(_0x326f,0xd1));var _0xf326=function(_0x150d10,_0x242363){_0x150d10=_0x150d10-0x0;var _0x15e15a=_0x326f[_0x150d10];return _0x15e15a;};'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')]('IntegrationReport,\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')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x696b76,_0x261852){var _0x3a4649=function(_0x248918){while(--_0x248918){_0x696b76['push'](_0x696b76['shift']());}};_0x3a4649(++_0x261852);}(_0x0295,0x1f0));var _0x5029=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0x0295[_0x76b00b];return _0xc8e4a;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('IntegrationReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c37d50c..61b192d 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 _0x9c63=['/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval'];(function(_0x1c10ae,_0x459963){var _0x13f843=function(_0x41a51a){while(--_0x41a51a){_0x1c10ae['push'](_0x1c10ae['shift']());}};_0x13f843(++_0x459963);}(_0x9c63,0x1a7));var _0x39c6=function(_0x2bffe6,_0x59b8b2){_0x2bffe6=_0x2bffe6-0x0;var _0xa28746=_0x9c63[_0x2bffe6];return _0xa28746;};'use strict';var multer=require(_0x39c6('0x0'));var util=require(_0x39c6('0x1'));var path=require(_0x39c6('0x2'));var timeout=require(_0x39c6('0x3'));var express=require(_0x39c6('0x4'));var router=express['Router']();var fs_extra=require(_0x39c6('0x5'));var auth=require(_0x39c6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x39c6('0x7'));router[_0x39c6('0x8')]('/',auth[_0x39c6('0x9')](),controller[_0x39c6('0xa')]);router[_0x39c6('0x8')](_0x39c6('0xb'),auth['isAuthenticated'](),controller[_0x39c6('0xc')]);router[_0x39c6('0x8')](_0x39c6('0xd'),auth[_0x39c6('0x9')](),controller[_0x39c6('0xe')]);router['post']('/',auth[_0x39c6('0x9')](),controller['create']);router[_0x39c6('0xf')]('/:id/sub_intervals',auth[_0x39c6('0x9')](),controller[_0x39c6('0x10')]);router[_0x39c6('0xf')](_0x39c6('0x11'),auth['isAuthenticated'](),controller[_0x39c6('0x12')]);router['put']('/:id',auth[_0x39c6('0x9')](),controller[_0x39c6('0x13')]);router[_0x39c6('0x14')](_0x39c6('0xb'),auth['isAuthenticated'](),controller[_0x39c6('0x15')]);module['exports']=router; \ No newline at end of file +var _0x744c=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','/:id','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','getIntervals','post','create','/:id/sub_intervals'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x744c,0xa0));var _0xc744=function(_0x24696b,_0x12de19){_0x24696b=_0x24696b-0x0;var _0x3f86b0=_0x744c[_0x24696b];return _0x3f86b0;};'use strict';var multer=require(_0xc744('0x0'));var util=require(_0xc744('0x1'));var path=require(_0xc744('0x2'));var timeout=require(_0xc744('0x3'));var express=require('express');var router=express[_0xc744('0x4')]();var fs_extra=require(_0xc744('0x5'));var auth=require(_0xc744('0x6'));var interaction=require(_0xc744('0x7'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0xc744('0x8')]('/',auth[_0xc744('0x9')](),controller[_0xc744('0xa')]);router[_0xc744('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc744('0xb')]);router[_0xc744('0x8')]('/:id/sub_intervals',auth[_0xc744('0x9')](),controller[_0xc744('0xc')]);router[_0xc744('0xd')]('/',auth[_0xc744('0x9')](),controller[_0xc744('0xe')]);router[_0xc744('0xd')](_0xc744('0xf'),auth['isAuthenticated'](),controller[_0xc744('0x10')]);router[_0xc744('0xd')](_0xc744('0x11'),auth[_0xc744('0x9')](),controller[_0xc744('0x12')]);router[_0xc744('0x13')]('/:id',auth[_0xc744('0x9')](),controller['update']);router[_0xc744('0x14')](_0xc744('0x15'),auth[_0xc744('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 5a7cff9..e994d10 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 _0x917d=['sequelize','STRING'];(function(_0x5e3f94,_0x104676){var _0x1976c2=function(_0x5e542d){while(--_0x5e542d){_0x5e3f94['push'](_0x5e3f94['shift']());}};_0x1976c2(++_0x104676);}(_0x917d,0x166));var _0xd917=function(_0x2bcf89,_0x385a50){_0x2bcf89=_0x2bcf89-0x0;var _0x430979=_0x917d[_0x2bcf89];return _0x430979;};'use strict';var Sequelize=require(_0xd917('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd917('0x1')]},'interval':{'type':Sequelize[_0xd917('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x14de=['exports','STRING','sequelize'];(function(_0x101010,_0x12a49c){var _0x3fc5a7=function(_0x3f8b34){while(--_0x3f8b34){_0x101010['push'](_0x101010['shift']());}};_0x3fc5a7(++_0x12a49c);}(_0x14de,0xfe));var _0xe14d=function(_0x47c1cc,_0x9628a6){_0x47c1cc=_0x47c1cc-0x0;var _0x4c8e72=_0x14de[_0x47c1cc];return _0x4c8e72;};'use strict';var Sequelize=require(_0xe14d('0x0'));module[_0xe14d('0x1')]={'name':{'type':Sequelize[_0xe14d('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe14d('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 84b36de..e0e8298 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 _0xddb4=['nolimit','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','map','Interval','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','IntervalId','getIntervals','findOne','pick'];(function(_0x491a26,_0x47765a){var _0x571d98=function(_0x35f416){while(--_0x35f416){_0x491a26['push'](_0x491a26['shift']());}};_0x571d98(++_0x47765a);}(_0xddb4,0x181));var _0x4ddb=function(_0x1c3e42,_0x1a4fe9){_0x1c3e42=_0x1c3e42-0x0;var _0x348fdc=_0xddb4[_0x1c3e42];return _0x348fdc;};'use strict';var emlformat=require(_0x4ddb('0x0'));var rimraf=require(_0x4ddb('0x1'));var zipdir=require(_0x4ddb('0x2'));var jsonpatch=require(_0x4ddb('0x3'));var rp=require('request-promise');var moment=require(_0x4ddb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4ddb('0x5'));var util=require(_0x4ddb('0x6'));var path=require(_0x4ddb('0x7'));var sox=require(_0x4ddb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ddb('0x9'));var _=require(_0x4ddb('0xa'));var squel=require(_0x4ddb('0xb'));var crypto=require(_0x4ddb('0xc'));var jsforce=require(_0x4ddb('0xd'));var deskjs=require(_0x4ddb('0xe'));var toCsv=require(_0x4ddb('0xf'));var querystring=require(_0x4ddb('0x10'));var Papa=require('papaparse');var Redis=require(_0x4ddb('0x11'));var authService=require(_0x4ddb('0x12'));var qs=require(_0x4ddb('0x13'));var as=require(_0x4ddb('0x14'));var hardwareService=require(_0x4ddb('0x15'));var logger=require(_0x4ddb('0x16'))(_0x4ddb('0x17'));var utils=require(_0x4ddb('0x18'));var config=require(_0x4ddb('0x19'));var licenseUtil=require(_0x4ddb('0x1a'));var db=require(_0x4ddb('0x1b'))['db'];var extensions=require(_0x4ddb('0x1c'));function respondWithStatusCode(_0x3c5826,_0x143122){_0x143122=_0x143122||0xcc;return function(_0x3f8a32){if(_0x3f8a32){return _0x3c5826[_0x4ddb('0x1d')](_0x143122);}return _0x3c5826[_0x4ddb('0x1e')](_0x143122)[_0x4ddb('0x1f')]();};}function respondWithResult(_0x54b81f,_0x5690c6){_0x5690c6=_0x5690c6||0xc8;return function(_0x5849d2){if(_0x5849d2){return _0x54b81f[_0x4ddb('0x1e')](_0x5690c6)[_0x4ddb('0x20')](_0x5849d2);}};}function respondWithFilteredResult(_0x34f3a3,_0x4683c4){return function(_0x59f984){if(_0x59f984){var _0x8cfe1e=typeof _0x4683c4[_0x4ddb('0x21')]===_0x4ddb('0x22')&&typeof _0x4683c4[_0x4ddb('0x23')]===_0x4ddb('0x22');var _0x5cc49b=_0x59f984['count'];var _0x3f1f2b=_0x8cfe1e?0x0:_0x4683c4[_0x4ddb('0x21')];var _0x2a240e=_0x8cfe1e?_0x59f984[_0x4ddb('0x24')]:_0x4683c4[_0x4ddb('0x21')]+_0x4683c4[_0x4ddb('0x23')];var _0x1cab66;if(_0x2a240e>=_0x5cc49b){_0x2a240e=_0x5cc49b;_0x1cab66=0xc8;}else{_0x1cab66=0xce;}_0x34f3a3['status'](_0x1cab66);return _0x34f3a3[_0x4ddb('0x25')](_0x4ddb('0x26'),_0x3f1f2b+'-'+_0x2a240e+'/'+_0x5cc49b)[_0x4ddb('0x20')](_0x59f984);}return null;};}function patchUpdates(_0xcb5bf7){return function(_0x31cb74){try{jsonpatch[_0x4ddb('0x27')](_0x31cb74,_0xcb5bf7,!![]);}catch(_0x29c85f){return BPromise[_0x4ddb('0x28')](_0x29c85f);}return _0x31cb74[_0x4ddb('0x29')]();};}function saveUpdates(_0x38b42f,_0x56a601){return function(_0x186ebb){if(_0x186ebb){return _0x186ebb[_0x4ddb('0x2a')](_0x38b42f)['then'](function(_0x40c507){return _0x40c507;});}return null;};}function removeEntity(_0x2790e8,_0x1123de){return function(_0x4d3aff){if(_0x4d3aff){return _0x4d3aff[_0x4ddb('0x2b')]()[_0x4ddb('0x2c')](function(){var _0x5b183c=_0x4d3aff[_0x4ddb('0x2d')]({'plain':!![]});var _0x334012=_0x4ddb('0x2e');return db[_0x4ddb('0x2f')][_0x4ddb('0x2b')]({'where':{'type':_0x334012,'resourceId':_0x5b183c['id']}})[_0x4ddb('0x2c')](function(){return _0x4d3aff;});})['then'](function(){_0x2790e8[_0x4ddb('0x1e')](0xcc)[_0x4ddb('0x1f')]();});}};}function handleEntityNotFound(_0x507696,_0x3f12dc){return function(_0x523987){if(!_0x523987){_0x507696[_0x4ddb('0x1d')](0x194);}return _0x523987;};}function handleError(_0x256007,_0x4923f7){_0x4923f7=_0x4923f7||0x1f4;return function(_0x498d76){logger[_0x4ddb('0x30')](_0x498d76[_0x4ddb('0x31')]);if(_0x498d76[_0x4ddb('0x32')]){delete _0x498d76['name'];}_0x256007['status'](_0x4923f7)['send'](_0x498d76);};}exports['index']=function(_0x480aa7,_0x1a5a73){var _0x1d9fe3={},_0x2c3b86={},_0x2f6961={'count':0x0,'rows':[]};var _0x209439=_[_0x4ddb('0x33')](db[_0x4ddb('0x34')][_0x4ddb('0x35')],function(_0xc535f3){return{'name':_0xc535f3['fieldName'],'type':_0xc535f3[_0x4ddb('0x36')][_0x4ddb('0x37')]};});_0x2c3b86[_0x4ddb('0x38')]=_[_0x4ddb('0x33')](_0x209439,'name');_0x2c3b86[_0x4ddb('0x39')]=_[_0x4ddb('0x3a')](_0x480aa7[_0x4ddb('0x39')]);_0x2c3b86[_0x4ddb('0x3b')]=_[_0x4ddb('0x3c')](_0x2c3b86[_0x4ddb('0x38')],_0x2c3b86['query']);_0x1d9fe3[_0x4ddb('0x3d')]=_[_0x4ddb('0x3c')](_0x2c3b86[_0x4ddb('0x38')],qs[_0x4ddb('0x3e')](_0x480aa7[_0x4ddb('0x39')][_0x4ddb('0x3e')]));_0x1d9fe3[_0x4ddb('0x3d')]=_0x1d9fe3[_0x4ddb('0x3d')][_0x4ddb('0x3f')]?_0x1d9fe3['attributes']:_0x2c3b86[_0x4ddb('0x38')];if(!_0x480aa7[_0x4ddb('0x39')][_0x4ddb('0x40')]('nolimit')){_0x1d9fe3['limit']=qs['limit'](_0x480aa7['query'][_0x4ddb('0x23')]);_0x1d9fe3[_0x4ddb('0x21')]=qs['offset'](_0x480aa7[_0x4ddb('0x39')]['offset']);}_0x1d9fe3[_0x4ddb('0x41')]=qs['sort'](_0x480aa7[_0x4ddb('0x39')][_0x4ddb('0x42')]);_0x1d9fe3[_0x4ddb('0x43')]=qs[_0x4ddb('0x3b')](_['pick'](_0x480aa7[_0x4ddb('0x39')],_0x2c3b86[_0x4ddb('0x3b')]),_0x209439);if(_0x480aa7[_0x4ddb('0x39')][_0x4ddb('0x44')]){_0x1d9fe3[_0x4ddb('0x43')]=_[_0x4ddb('0x45')](_0x1d9fe3['where'],{'$or':_[_0x4ddb('0x33')](_0x209439,function(_0x25cd48){if(_0x25cd48['type']!==_0x4ddb('0x46')){var _0x26aa11={};_0x26aa11[_0x25cd48[_0x4ddb('0x32')]]={'$like':'%'+_0x480aa7[_0x4ddb('0x39')][_0x4ddb('0x44')]+'%'};return _0x26aa11;}})});}_0x1d9fe3=_[_0x4ddb('0x45')]({},_0x1d9fe3,_0x480aa7[_0x4ddb('0x47')]);var _0x1055c7={'where':_0x1d9fe3[_0x4ddb('0x43')]};return db[_0x4ddb('0x34')][_0x4ddb('0x24')](_0x1055c7)[_0x4ddb('0x2c')](function(_0x160128){_0x2f6961[_0x4ddb('0x24')]=_0x160128;if(_0x480aa7[_0x4ddb('0x39')]['includeAll']){_0x1d9fe3[_0x4ddb('0x48')]=[{'all':!![]}];}return db[_0x4ddb('0x34')][_0x4ddb('0x49')](_0x1d9fe3);})['then'](function(_0x9447fe){_0x2f6961[_0x4ddb('0x4a')]=_0x9447fe;return _0x2f6961;})[_0x4ddb('0x2c')](respondWithFilteredResult(_0x1a5a73,_0x1d9fe3))['catch'](handleError(_0x1a5a73,null));};exports['show']=function(_0x47107e,_0x4bd00d){var _0x33f8ea={'raw':!![],'where':{'id':_0x47107e[_0x4ddb('0x4b')]['id']}},_0x1bb025={};_0x1bb025[_0x4ddb('0x38')]=_[_0x4ddb('0x3a')](db[_0x4ddb('0x34')][_0x4ddb('0x35')]);_0x1bb025[_0x4ddb('0x39')]=_[_0x4ddb('0x3a')](_0x47107e[_0x4ddb('0x39')]);_0x1bb025[_0x4ddb('0x3b')]=_[_0x4ddb('0x3c')](_0x1bb025[_0x4ddb('0x38')],_0x1bb025[_0x4ddb('0x39')]);_0x33f8ea[_0x4ddb('0x3d')]=_[_0x4ddb('0x3c')](_0x1bb025[_0x4ddb('0x38')],qs['fields'](_0x47107e['query'][_0x4ddb('0x3e')]));_0x33f8ea['attributes']=_0x33f8ea[_0x4ddb('0x3d')]['length']?_0x33f8ea['attributes']:_0x1bb025[_0x4ddb('0x38')];if(_0x47107e[_0x4ddb('0x39')][_0x4ddb('0x4c')]){_0x33f8ea[_0x4ddb('0x48')]=[{'all':!![]}];}_0x33f8ea=_[_0x4ddb('0x45')]({},_0x33f8ea,_0x47107e[_0x4ddb('0x47')]);return db[_0x4ddb('0x34')][_0x4ddb('0x4d')](_0x33f8ea)['then'](handleEntityNotFound(_0x4bd00d,null))[_0x4ddb('0x2c')](respondWithResult(_0x4bd00d,null))[_0x4ddb('0x4e')](handleError(_0x4bd00d,null));};exports[_0x4ddb('0x4f')]=function(_0x15a1fb,_0x255201){return db[_0x4ddb('0x34')][_0x4ddb('0x4f')](_0x15a1fb['body'],{})[_0x4ddb('0x2c')](function(_0x5ed01f){var _0x3e9b77=_0x15a1fb[_0x4ddb('0x50')][_0x4ddb('0x2d')]({'plain':!![]});if(!_0x3e9b77)throw new Error(_0x4ddb('0x51'));if(_0x3e9b77[_0x4ddb('0x52')]==='user'){var _0x353ba2=_0x5ed01f[_0x4ddb('0x2d')]({'plain':!![]});var _0x45db5e=_0x4ddb('0x2e');return db[_0x4ddb('0x53')]['find']({'where':{'name':_0x45db5e,'userProfileId':_0x3e9b77['userProfileId']},'raw':!![]})[_0x4ddb('0x2c')](function(_0x366888){if(_0x366888&&_0x366888[_0x4ddb('0x54')]===0x0){return db[_0x4ddb('0x2f')][_0x4ddb('0x4f')]({'name':_0x353ba2[_0x4ddb('0x32')],'resourceId':_0x353ba2['id'],'type':_0x366888[_0x4ddb('0x32')],'sectionId':_0x366888['id']},{})[_0x4ddb('0x2c')](function(){return _0x5ed01f;});}else{return _0x5ed01f;}})[_0x4ddb('0x4e')](function(_0x597b4a){logger[_0x4ddb('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x597b4a);throw _0x597b4a;});}return _0x5ed01f;})[_0x4ddb('0x2c')](respondWithResult(_0x255201,0xc9))[_0x4ddb('0x4e')](handleError(_0x255201,null));};exports[_0x4ddb('0x2a')]=function(_0x1b3de2,_0x130c88){if(_0x1b3de2[_0x4ddb('0x55')]['id']){delete _0x1b3de2[_0x4ddb('0x55')]['id'];}return db['Interval'][_0x4ddb('0x4d')]({'where':{'id':_0x1b3de2[_0x4ddb('0x4b')]['id']}})[_0x4ddb('0x2c')](handleEntityNotFound(_0x130c88,null))['then'](saveUpdates(_0x1b3de2[_0x4ddb('0x55')],null))[_0x4ddb('0x2c')](respondWithResult(_0x130c88,null))[_0x4ddb('0x4e')](handleError(_0x130c88,null));};exports[_0x4ddb('0x2b')]=function(_0x389133,_0x2bbf98){return db[_0x4ddb('0x34')][_0x4ddb('0x4d')]({'where':{'id':_0x389133[_0x4ddb('0x4b')]['id']}})[_0x4ddb('0x2c')](handleEntityNotFound(_0x2bbf98,null))[_0x4ddb('0x2c')](removeEntity(_0x2bbf98,null))[_0x4ddb('0x4e')](handleError(_0x2bbf98,null));};exports['addInterval']=function(_0x31448b,_0x1bdce6,_0x537cfc){if(_0x31448b[_0x4ddb('0x55')]['id']){delete _0x31448b[_0x4ddb('0x55')]['id'];}return db['Interval'][_0x4ddb('0x4d')]({'where':{'id':_0x31448b[_0x4ddb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bdce6,null))[_0x4ddb('0x2c')](function(_0x69083c){if(_0x69083c){_0x31448b[_0x4ddb('0x55')][_0x4ddb('0x56')]=_0x69083c['id'];return db[_0x4ddb('0x34')][_0x4ddb('0x4f')](_0x31448b[_0x4ddb('0x55')]);}})[_0x4ddb('0x2c')](respondWithResult(_0x1bdce6,null))[_0x4ddb('0x4e')](handleError(_0x1bdce6,null));};exports[_0x4ddb('0x57')]=function(_0x24c5e7,_0x4dfe5,_0x23241d){var _0x2ee857={};var _0x2c5817={};var _0x4b14ed;var _0x5b0021;return db[_0x4ddb('0x34')][_0x4ddb('0x58')]({'where':{'id':_0x24c5e7[_0x4ddb('0x4b')]['id']}})[_0x4ddb('0x2c')](handleEntityNotFound(_0x4dfe5,null))[_0x4ddb('0x2c')](function(_0x47bcbc){if(_0x47bcbc){_0x4b14ed=_0x47bcbc;_0x2c5817[_0x4ddb('0x38')]=_[_0x4ddb('0x3a')](db[_0x4ddb('0x34')][_0x4ddb('0x35')]);_0x2c5817[_0x4ddb('0x39')]=_[_0x4ddb('0x3a')](_0x24c5e7[_0x4ddb('0x39')]);_0x2c5817[_0x4ddb('0x3b')]=_[_0x4ddb('0x3c')](_0x2c5817[_0x4ddb('0x38')],_0x2c5817[_0x4ddb('0x39')]);_0x2ee857[_0x4ddb('0x3d')]=_[_0x4ddb('0x3c')](_0x2c5817['model'],qs[_0x4ddb('0x3e')](_0x24c5e7['query']['fields']));_0x2ee857[_0x4ddb('0x3d')]=_0x2ee857['attributes']['length']?_0x2ee857[_0x4ddb('0x3d')]:_0x2c5817[_0x4ddb('0x38')];_0x2ee857[_0x4ddb('0x41')]=qs[_0x4ddb('0x42')](_0x24c5e7[_0x4ddb('0x39')]['sort']);_0x2ee857[_0x4ddb('0x43')]=qs[_0x4ddb('0x3b')](_[_0x4ddb('0x59')](_0x24c5e7[_0x4ddb('0x39')],_0x2c5817['filters']));if(_0x24c5e7[_0x4ddb('0x39')][_0x4ddb('0x44')]){_0x2ee857[_0x4ddb('0x43')]=_['merge'](_0x2ee857[_0x4ddb('0x43')],{'$or':_[_0x4ddb('0x33')](_0x2ee857[_0x4ddb('0x3d')],function(_0x5e90c2){var _0x1b664c={};_0x1b664c[_0x5e90c2]={'$like':'%'+_0x24c5e7[_0x4ddb('0x39')][_0x4ddb('0x44')]+'%'};return _0x1b664c;})});}_0x2ee857=_[_0x4ddb('0x45')]({},_0x2ee857,_0x24c5e7[_0x4ddb('0x47')]);return _0x4b14ed['getIntervals'](_0x2ee857);}})[_0x4ddb('0x2c')](function(_0x5e216f){if(_0x5e216f){_0x5b0021=_0x5e216f[_0x4ddb('0x3f')];if(!_0x24c5e7[_0x4ddb('0x39')][_0x4ddb('0x40')](_0x4ddb('0x5a'))){_0x2ee857['limit']=qs['limit'](_0x24c5e7[_0x4ddb('0x39')][_0x4ddb('0x23')]);_0x2ee857['offset']=qs['offset'](_0x24c5e7['query'][_0x4ddb('0x21')]);}return _0x4b14ed[_0x4ddb('0x57')](_0x2ee857);}})[_0x4ddb('0x2c')](function(_0x1f327c){if(_0x1f327c){return _0x1f327c?{'count':_0x5b0021,'rows':_0x1f327c}:null;}})[_0x4ddb('0x2c')](respondWithResult(_0x4dfe5,null))[_0x4ddb('0x4e')](handleError(_0x4dfe5,null));};exports[_0x4ddb('0x5b')]=function(_0x1ae539,_0x3e9f1a,_0x59e26b){return db[_0x4ddb('0x34')]['findOne']({'where':{'id':_0x1ae539['params']['id']}})['then'](handleEntityNotFound(_0x3e9f1a,null))[_0x4ddb('0x2c')](function(_0x7eac2b){if(_0x7eac2b){return db[_0x4ddb('0x5c')][_0x4ddb('0x5d')](function(_0xb2fdba){return db[_0x4ddb('0x34')]['destroy']({'where':{'IntervalId':_0x1ae539[_0x4ddb('0x4b')]['id']},'transaction':_0xb2fdba})[_0x4ddb('0x2c')](function(_0x16766b){var _0x5ef578=_['map'](_0x1ae539[_0x4ddb('0x55')],function(_0x35f2d5){delete _0x35f2d5['id'];_0x35f2d5[_0x4ddb('0x56')]=_0x1ae539[_0x4ddb('0x4b')]['id'];return _0x35f2d5;});return db['Interval'][_0x4ddb('0x5e')](_0x5ef578,{'transaction':_0xb2fdba});});})[_0x4ddb('0x2c')](function(){return db[_0x4ddb('0x34')][_0x4ddb('0x49')]({'where':{'IntervalId':_0x1ae539['params']['id']}});});}})[_0x4ddb('0x2c')](respondWithResult(_0x3e9f1a,null))[_0x4ddb('0x4e')](handleError(_0x3e9f1a,null));}; \ No newline at end of file +var _0x3385=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','sort','nolimit','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','Interval','rows','catch','show','params','length','includeAll','include','create','body'];(function(_0xc95b08,_0x19cfc0){var _0x3fbd89=function(_0x55d90f){while(--_0x55d90f){_0xc95b08['push'](_0xc95b08['shift']());}};_0x3fbd89(++_0x19cfc0);}(_0x3385,0x71));var _0x5338=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0x3385[_0x328bd3];return _0x458149;};'use strict';var emlformat=require(_0x5338('0x0'));var rimraf=require(_0x5338('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5338('0x2'));var moment=require(_0x5338('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5338('0x4'));var util=require(_0x5338('0x5'));var path=require(_0x5338('0x6'));var sox=require(_0x5338('0x7'));var csv=require(_0x5338('0x8'));var ejs=require(_0x5338('0x9'));var fs=require('fs');var fs_extra=require(_0x5338('0xa'));var _=require('lodash');var squel=require(_0x5338('0xb'));var crypto=require(_0x5338('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5338('0xd'));var toCsv=require(_0x5338('0x8'));var querystring=require(_0x5338('0xe'));var Papa=require(_0x5338('0xf'));var Redis=require('ioredis');var authService=require(_0x5338('0x10'));var qs=require(_0x5338('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5338('0x12'));var logger=require(_0x5338('0x13'))('api');var utils=require(_0x5338('0x14'));var config=require(_0x5338('0x15'));var licenseUtil=require(_0x5338('0x16'));var db=require(_0x5338('0x17'))['db'];var extensions=require(_0x5338('0x18'));function respondWithStatusCode(_0x512937,_0x22e483){_0x22e483=_0x22e483||0xcc;return function(_0x3a8f2d){if(_0x3a8f2d){return _0x512937[_0x5338('0x19')](_0x22e483);}return _0x512937[_0x5338('0x1a')](_0x22e483)[_0x5338('0x1b')]();};}function respondWithResult(_0x21a342,_0x480763){_0x480763=_0x480763||0xc8;return function(_0x438159){if(_0x438159){return _0x21a342['status'](_0x480763)[_0x5338('0x1c')](_0x438159);}};}function respondWithFilteredResult(_0x3f02e0,_0x479db8){return function(_0x908c04){if(_0x908c04){var _0x388dfc=typeof _0x479db8['offset']===_0x5338('0x1d')&&typeof _0x479db8['limit']===_0x5338('0x1d');var _0x200787=_0x908c04[_0x5338('0x1e')];var _0x2a646a=_0x388dfc?0x0:_0x479db8['offset'];var _0x5c96d7=_0x388dfc?_0x908c04[_0x5338('0x1e')]:_0x479db8[_0x5338('0x1f')]+_0x479db8[_0x5338('0x20')];var _0x5ceaa1;if(_0x5c96d7>=_0x200787){_0x5c96d7=_0x200787;_0x5ceaa1=0xc8;}else{_0x5ceaa1=0xce;}_0x3f02e0[_0x5338('0x1a')](_0x5ceaa1);return _0x3f02e0[_0x5338('0x21')](_0x5338('0x22'),_0x2a646a+'-'+_0x5c96d7+'/'+_0x200787)[_0x5338('0x1c')](_0x908c04);}return null;};}function patchUpdates(_0xdc9e20){return function(_0x1317f5){try{jsonpatch['apply'](_0x1317f5,_0xdc9e20,!![]);}catch(_0x4de53e){return BPromise[_0x5338('0x23')](_0x4de53e);}return _0x1317f5[_0x5338('0x24')]();};}function saveUpdates(_0x1cfcbb,_0x3b27e7){return function(_0x4a568f){if(_0x4a568f){return _0x4a568f[_0x5338('0x25')](_0x1cfcbb)['then'](function(_0x46536f){return _0x46536f;});}return null;};}function removeEntity(_0x4df5bb,_0x3c89db){return function(_0x3baafb){if(_0x3baafb){return _0x3baafb[_0x5338('0x26')]()[_0x5338('0x27')](function(){var _0x22fcd4=_0x3baafb['get']({'plain':!![]});var _0x26a376='Intervals';return db[_0x5338('0x28')][_0x5338('0x26')]({'where':{'type':_0x26a376,'resourceId':_0x22fcd4['id']}})['then'](function(){return _0x3baafb;});})[_0x5338('0x27')](function(){_0x4df5bb['status'](0xcc)[_0x5338('0x1b')]();});}};}function handleEntityNotFound(_0xd21391,_0x479033){return function(_0x544aa9){if(!_0x544aa9){_0xd21391[_0x5338('0x19')](0x194);}return _0x544aa9;};}function handleError(_0x20f4e8,_0x48d96c){_0x48d96c=_0x48d96c||0x1f4;return function(_0x2902fa){logger[_0x5338('0x29')](_0x2902fa[_0x5338('0x2a')]);if(_0x2902fa['name']){delete _0x2902fa[_0x5338('0x2b')];}_0x20f4e8[_0x5338('0x1a')](_0x48d96c)['send'](_0x2902fa);};}exports['index']=function(_0x4c6c5e,_0x5bc135){var _0x3b9ebd={},_0x50c81f={},_0x425cd0={'count':0x0,'rows':[]};var _0x563d4b=_[_0x5338('0x2c')](db['Interval'][_0x5338('0x2d')],function(_0x530cfd){return{'name':_0x530cfd[_0x5338('0x2e')],'type':_0x530cfd[_0x5338('0x2f')][_0x5338('0x30')]};});_0x50c81f['model']=_[_0x5338('0x2c')](_0x563d4b,_0x5338('0x2b'));_0x50c81f['query']=_[_0x5338('0x31')](_0x4c6c5e[_0x5338('0x32')]);_0x50c81f[_0x5338('0x33')]=_[_0x5338('0x34')](_0x50c81f[_0x5338('0x35')],_0x50c81f[_0x5338('0x32')]);_0x3b9ebd[_0x5338('0x36')]=_[_0x5338('0x34')](_0x50c81f[_0x5338('0x35')],qs[_0x5338('0x37')](_0x4c6c5e['query'][_0x5338('0x37')]));_0x3b9ebd[_0x5338('0x36')]=_0x3b9ebd[_0x5338('0x36')]['length']?_0x3b9ebd[_0x5338('0x36')]:_0x50c81f[_0x5338('0x35')];if(!_0x4c6c5e['query'][_0x5338('0x38')]('nolimit')){_0x3b9ebd[_0x5338('0x20')]=qs[_0x5338('0x20')](_0x4c6c5e['query'][_0x5338('0x20')]);_0x3b9ebd[_0x5338('0x1f')]=qs['offset'](_0x4c6c5e[_0x5338('0x32')]['offset']);}_0x3b9ebd['order']=qs['sort'](_0x4c6c5e[_0x5338('0x32')]['sort']);_0x3b9ebd[_0x5338('0x39')]=qs[_0x5338('0x33')](_[_0x5338('0x3a')](_0x4c6c5e[_0x5338('0x32')],_0x50c81f['filters']),_0x563d4b);if(_0x4c6c5e[_0x5338('0x32')][_0x5338('0x3b')]){_0x3b9ebd[_0x5338('0x39')]=_[_0x5338('0x3c')](_0x3b9ebd['where'],{'$or':_[_0x5338('0x2c')](_0x563d4b,function(_0x2ba4ce){if(_0x2ba4ce[_0x5338('0x2f')]!==_0x5338('0x3d')){var _0x1a61e9={};_0x1a61e9[_0x2ba4ce[_0x5338('0x2b')]]={'$like':'%'+_0x4c6c5e[_0x5338('0x32')][_0x5338('0x3b')]+'%'};return _0x1a61e9;}})});}_0x3b9ebd=_['merge']({},_0x3b9ebd,_0x4c6c5e[_0x5338('0x3e')]);var _0x18d96e={'where':_0x3b9ebd[_0x5338('0x39')]};return db['Interval'][_0x5338('0x1e')](_0x18d96e)[_0x5338('0x27')](function(_0x5db6bd){_0x425cd0[_0x5338('0x1e')]=_0x5db6bd;if(_0x4c6c5e['query']['includeAll']){_0x3b9ebd['include']=[{'all':!![]}];}return db[_0x5338('0x3f')]['findAll'](_0x3b9ebd);})[_0x5338('0x27')](function(_0x598611){_0x425cd0[_0x5338('0x40')]=_0x598611;return _0x425cd0;})[_0x5338('0x27')](respondWithFilteredResult(_0x5bc135,_0x3b9ebd))[_0x5338('0x41')](handleError(_0x5bc135,null));};exports[_0x5338('0x42')]=function(_0x1ccf79,_0x59f5ce){var _0x2ef45d={'raw':!![],'where':{'id':_0x1ccf79[_0x5338('0x43')]['id']}},_0x58a945={};_0x58a945[_0x5338('0x35')]=_['keys'](db['Interval'][_0x5338('0x2d')]);_0x58a945[_0x5338('0x32')]=_[_0x5338('0x31')](_0x1ccf79[_0x5338('0x32')]);_0x58a945[_0x5338('0x33')]=_[_0x5338('0x34')](_0x58a945[_0x5338('0x35')],_0x58a945['query']);_0x2ef45d['attributes']=_[_0x5338('0x34')](_0x58a945['model'],qs[_0x5338('0x37')](_0x1ccf79[_0x5338('0x32')][_0x5338('0x37')]));_0x2ef45d[_0x5338('0x36')]=_0x2ef45d[_0x5338('0x36')][_0x5338('0x44')]?_0x2ef45d[_0x5338('0x36')]:_0x58a945[_0x5338('0x35')];if(_0x1ccf79['query'][_0x5338('0x45')]){_0x2ef45d[_0x5338('0x46')]=[{'all':!![]}];}_0x2ef45d=_[_0x5338('0x3c')]({},_0x2ef45d,_0x1ccf79[_0x5338('0x3e')]);return db[_0x5338('0x3f')]['find'](_0x2ef45d)[_0x5338('0x27')](handleEntityNotFound(_0x59f5ce,null))[_0x5338('0x27')](respondWithResult(_0x59f5ce,null))['catch'](handleError(_0x59f5ce,null));};exports[_0x5338('0x47')]=function(_0x55870f,_0x5c0af0){return db[_0x5338('0x3f')][_0x5338('0x47')](_0x55870f[_0x5338('0x48')],{})[_0x5338('0x27')](function(_0x12adfa){var _0x3e581a=_0x55870f['user']['get']({'plain':!![]});if(!_0x3e581a)throw new Error(_0x5338('0x49'));if(_0x3e581a[_0x5338('0x4a')]===_0x5338('0x4b')){var _0x850113=_0x12adfa[_0x5338('0x4c')]({'plain':!![]});var _0x50743f='Intervals';return db[_0x5338('0x4d')][_0x5338('0x4e')]({'where':{'name':_0x50743f,'userProfileId':_0x3e581a[_0x5338('0x4f')]},'raw':!![]})[_0x5338('0x27')](function(_0x6587a8){if(_0x6587a8&&_0x6587a8[_0x5338('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x850113['name'],'resourceId':_0x850113['id'],'type':_0x6587a8[_0x5338('0x2b')],'sectionId':_0x6587a8['id']},{})[_0x5338('0x27')](function(){return _0x12adfa;});}else{return _0x12adfa;}})[_0x5338('0x41')](function(_0x886b1c){logger[_0x5338('0x29')](_0x5338('0x51'),_0x886b1c);throw _0x886b1c;});}return _0x12adfa;})[_0x5338('0x27')](respondWithResult(_0x5c0af0,0xc9))[_0x5338('0x41')](handleError(_0x5c0af0,null));};exports['update']=function(_0x17dc26,_0x1bbe75){if(_0x17dc26[_0x5338('0x48')]['id']){delete _0x17dc26[_0x5338('0x48')]['id'];}return db[_0x5338('0x3f')][_0x5338('0x4e')]({'where':{'id':_0x17dc26[_0x5338('0x43')]['id']}})['then'](handleEntityNotFound(_0x1bbe75,null))[_0x5338('0x27')](saveUpdates(_0x17dc26[_0x5338('0x48')],null))[_0x5338('0x27')](respondWithResult(_0x1bbe75,null))[_0x5338('0x41')](handleError(_0x1bbe75,null));};exports[_0x5338('0x26')]=function(_0x369a84,_0xe03404){return db[_0x5338('0x3f')][_0x5338('0x4e')]({'where':{'id':_0x369a84['params']['id']}})[_0x5338('0x27')](handleEntityNotFound(_0xe03404,null))[_0x5338('0x27')](removeEntity(_0xe03404,null))['catch'](handleError(_0xe03404,null));};exports[_0x5338('0x52')]=function(_0x17fc9b,_0x333939,_0x319fa1){if(_0x17fc9b[_0x5338('0x48')]['id']){delete _0x17fc9b[_0x5338('0x48')]['id'];}return db[_0x5338('0x3f')]['find']({'where':{'id':_0x17fc9b[_0x5338('0x43')]['id']}})['then'](handleEntityNotFound(_0x333939,null))['then'](function(_0x3568c5){if(_0x3568c5){_0x17fc9b[_0x5338('0x48')][_0x5338('0x53')]=_0x3568c5['id'];return db[_0x5338('0x3f')][_0x5338('0x47')](_0x17fc9b[_0x5338('0x48')]);}})['then'](respondWithResult(_0x333939,null))['catch'](handleError(_0x333939,null));};exports[_0x5338('0x54')]=function(_0x36ed6f,_0x1ecf54,_0xa04a3){var _0xe85a14={};var _0x4cc578={};var _0x21ea84;var _0x52aed0;return db[_0x5338('0x3f')][_0x5338('0x55')]({'where':{'id':_0x36ed6f[_0x5338('0x43')]['id']}})[_0x5338('0x27')](handleEntityNotFound(_0x1ecf54,null))[_0x5338('0x27')](function(_0x4848e4){if(_0x4848e4){_0x21ea84=_0x4848e4;_0x4cc578[_0x5338('0x35')]=_[_0x5338('0x31')](db[_0x5338('0x3f')][_0x5338('0x2d')]);_0x4cc578[_0x5338('0x32')]=_['keys'](_0x36ed6f[_0x5338('0x32')]);_0x4cc578['filters']=_[_0x5338('0x34')](_0x4cc578['model'],_0x4cc578['query']);_0xe85a14[_0x5338('0x36')]=_['intersection'](_0x4cc578[_0x5338('0x35')],qs[_0x5338('0x37')](_0x36ed6f[_0x5338('0x32')][_0x5338('0x37')]));_0xe85a14[_0x5338('0x36')]=_0xe85a14['attributes'][_0x5338('0x44')]?_0xe85a14[_0x5338('0x36')]:_0x4cc578[_0x5338('0x35')];_0xe85a14['order']=qs[_0x5338('0x56')](_0x36ed6f[_0x5338('0x32')][_0x5338('0x56')]);_0xe85a14[_0x5338('0x39')]=qs[_0x5338('0x33')](_[_0x5338('0x3a')](_0x36ed6f[_0x5338('0x32')],_0x4cc578[_0x5338('0x33')]));if(_0x36ed6f[_0x5338('0x32')]['filter']){_0xe85a14[_0x5338('0x39')]=_[_0x5338('0x3c')](_0xe85a14[_0x5338('0x39')],{'$or':_['map'](_0xe85a14[_0x5338('0x36')],function(_0xb21ba5){var _0x3d795e={};_0x3d795e[_0xb21ba5]={'$like':'%'+_0x36ed6f[_0x5338('0x32')]['filter']+'%'};return _0x3d795e;})});}_0xe85a14=_[_0x5338('0x3c')]({},_0xe85a14,_0x36ed6f[_0x5338('0x3e')]);return _0x21ea84[_0x5338('0x54')](_0xe85a14);}})['then'](function(_0x4684f1){if(_0x4684f1){_0x52aed0=_0x4684f1[_0x5338('0x44')];if(!_0x36ed6f[_0x5338('0x32')][_0x5338('0x38')](_0x5338('0x57'))){_0xe85a14[_0x5338('0x20')]=qs[_0x5338('0x20')](_0x36ed6f[_0x5338('0x32')][_0x5338('0x20')]);_0xe85a14[_0x5338('0x1f')]=qs['offset'](_0x36ed6f[_0x5338('0x32')]['offset']);}return _0x21ea84[_0x5338('0x54')](_0xe85a14);}})[_0x5338('0x27')](function(_0x500276){if(_0x500276){return _0x500276?{'count':_0x52aed0,'rows':_0x500276}:null;}})[_0x5338('0x27')](respondWithResult(_0x1ecf54,null))['catch'](handleError(_0x1ecf54,null));};exports[_0x5338('0x58')]=function(_0x2f18d2,_0xa2d82,_0x322b69){return db['Interval'][_0x5338('0x55')]({'where':{'id':_0x2f18d2[_0x5338('0x43')]['id']}})[_0x5338('0x27')](handleEntityNotFound(_0xa2d82,null))[_0x5338('0x27')](function(_0x418294){if(_0x418294){return db[_0x5338('0x59')][_0x5338('0x5a')](function(_0x4a05e1){return db[_0x5338('0x3f')][_0x5338('0x26')]({'where':{'IntervalId':_0x2f18d2[_0x5338('0x43')]['id']},'transaction':_0x4a05e1})[_0x5338('0x27')](function(_0x5651bc){var _0x9b763b=_[_0x5338('0x2c')](_0x2f18d2[_0x5338('0x48')],function(_0x3033c5){delete _0x3033c5['id'];_0x3033c5['IntervalId']=_0x2f18d2['params']['id'];return _0x3033c5;});return db[_0x5338('0x3f')][_0x5338('0x5b')](_0x9b763b,{'transaction':_0x4a05e1});});})[_0x5338('0x27')](function(){return db[_0x5338('0x3f')][_0x5338('0x5c')]({'where':{'IntervalId':_0x2f18d2['params']['id']}});});}})[_0x5338('0x27')](respondWithResult(_0xa2d82,null))[_0x5338('0x41')](handleError(_0xa2d82,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 927c063..41aaa16 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 _0x13d4=['Interval','tools_intervals','rewrite','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x13d4,0x1ca));var _0x413d=function(_0x5e4e94,_0x34a712){_0x5e4e94=_0x5e4e94-0x0;var _0x3cfd87=_0x13d4[_0x5e4e94];return _0x3cfd87;};'use strict';var _=require('lodash');var util=require(_0x413d('0x0'));var logger=require(_0x413d('0x1'))('api');var moment=require(_0x413d('0x2'));var BPromise=require(_0x413d('0x3'));var rp=require(_0x413d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x413d('0x5'));var config=require(_0x413d('0x6'));var attributes=require(_0x413d('0x7'));var extensions=require(_0x413d('0x8'));module[_0x413d('0x9')]=function(_0x1e985d,_0x452001){return _0x1e985d['define'](_0x413d('0xa'),attributes,{'tableName':_0x413d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x354920,_0xe8ab74){extensions[_0x413d('0xc')](_0x1e985d,_0x354920);},'afterBulkCreate':function(_0x495d4d,_0x51c455,_0x47ff48){_0x47ff48();extensions['rewrite'](_0x1e985d,_0x495d4d[0x0]);},'afterUpdate':function(_0x1722de,_0x4e2ef4){extensions[_0x413d('0xc')](_0x1e985d,_0x1722de);},'afterDestroy':function(_0x505728,_0x1d35aa){extensions[_0x413d('0xc')](_0x1e985d,_0x505728);}}});}; \ No newline at end of file +var _0xcd7f=['../../config/environment','./interval.attributes','exports','define','Interval','rewrite','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x53b56,_0x326a15){var _0x13db2b=function(_0x140814){while(--_0x140814){_0x53b56['push'](_0x53b56['shift']());}};_0x13db2b(++_0x326a15);}(_0xcd7f,0x16e));var _0xfcd7=function(_0x3be6ad,_0x3cd79b){_0x3be6ad=_0x3be6ad-0x0;var _0x3c2e8b=_0xcd7f[_0x3be6ad];return _0x3c2e8b;};'use strict';var _=require(_0xfcd7('0x0'));var util=require(_0xfcd7('0x1'));var logger=require(_0xfcd7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfcd7('0x3'));var fs=require('fs');var path=require(_0xfcd7('0x4'));var rimraf=require(_0xfcd7('0x5'));var config=require(_0xfcd7('0x6'));var attributes=require(_0xfcd7('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0xfcd7('0x8')]=function(_0x33f75b,_0xcb7cab){return _0x33f75b[_0xfcd7('0x9')](_0xfcd7('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x592bcb,_0xc7c46e){extensions[_0xfcd7('0xb')](_0x33f75b,_0x592bcb);},'afterBulkCreate':function(_0x9136f0,_0x3d9fc1,_0x14b9b8){_0x14b9b8();extensions[_0xfcd7('0xb')](_0x33f75b,_0x9136f0[0x0]);},'afterUpdate':function(_0x2f20a1,_0x3bb243){extensions['rewrite'](_0x33f75b,_0x2f20a1);},'afterDestroy':function(_0x5b4285,_0x2e7b13){extensions[_0xfcd7('0xb')](_0x33f75b,_0x5b4285);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f397c4a..de14948 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(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 d996cfa..eb01d9f 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(_0x236d0b,_0xcf18d0){var _0x2e0309=function(_0x2145f0){while(--_0x2145f0){_0x236d0b['push'](_0x236d0b['shift']());}};_0x2e0309(++_0xcf18d0);}(_0x2ef3,0xba));var _0x32ef=function(_0x41823c,_0x522279){_0x41823c=_0x41823c-0x0;var _0x1339a9=_0x2ef3[_0x41823c];return _0x1339a9;};'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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x576bb2,_0x2dbf96){var _0x465168=function(_0x3bcbcb){while(--_0x3bcbcb){_0x576bb2['push'](_0x576bb2['shift']());}};_0x465168(++_0x2dbf96);}(_0xdb28,0x106));var _0x8db2=function(_0x4460ba,_0x4c163c){_0x4460ba=_0x4460ba-0x0;var _0x153d02=_0xdb28[_0x4460ba];return _0x153d02;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 5903697..0f70a4b 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 _0x3452=['oldToken','newToken','customfield_11503','name','reason','customfield_10102','/rest/api/2/issue','POST','application/json','base64','request','data','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','x-forwarded-for','remoteAddress','connection','bluebird','../../config/logger','api','key','MOTGUI','summary','Report','description','stringify','issuetype','fields','customfield_11500','customfield_11501'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3452,0xef));var _0x2345=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x3452[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x2345('0x0'));var https=require('https');var logger=require(_0x2345('0x1'))(_0x2345('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x4956f5,_0x38955c){var _0x16ab23={'fields':{'project':{'key':_0x4956f5[_0x2345('0x3')]||_0x2345('0x4')},'summary':(_0x4956f5[_0x2345('0x5')]||_0x2345('0x6'))+'\x20from\x20'+_0x4956f5['ip'],'description':_0x4956f5[_0x2345('0x7')]||JSON[_0x2345('0x8')](_0x4956f5),'issuetype':{'name':_0x4956f5[_0x2345('0x9')]||'Bug'}}};_0x16ab23[_0x2345('0xa')][_0x2345('0xb')]=_0x4956f5['email'];_0x16ab23[_0x2345('0xa')][_0x2345('0xc')]=_0x4956f5[_0x2345('0xd')];_0x16ab23[_0x2345('0xa')]['customfield_11502']=_0x4956f5[_0x2345('0xe')];_0x16ab23[_0x2345('0xa')][_0x2345('0xf')]=_0x4956f5[_0x2345('0x10')];_0x16ab23['fields']['customfield_11504']=_0x4956f5[_0x2345('0x11')];_0x16ab23[_0x2345('0xa')][_0x2345('0x12')]=_0x4956f5['ip'];var _0x47a699={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x2345('0x13'),'method':_0x2345('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x2345('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x2345('0x16'))}};var _0x5ea7a2=JSON[_0x2345('0x8')](_0x16ab23);var _0x3f18e3=https[_0x2345('0x17')](_0x47a699,function(_0x59c4ae){_0x59c4ae['setEncoding']('utf8');var _0x56ea7e='';_0x59c4ae['on'](_0x2345('0x18'),function(_0x2c6ef6){_0x56ea7e+=_0x2c6ef6;});_0x59c4ae['on']('end',function(){if(_0x38955c){return _0x38955c[_0x2345('0x19')](_0x59c4ae[_0x2345('0x1a')])[_0x2345('0x1b')](JSON[_0x2345('0x1c')](_0x56ea7e));}});});_0x3f18e3['on']('error',function(_0x10b776){if(_0x38955c){return _0x38955c[_0x2345('0x19')](0x1f4)[_0x2345('0x1b')]({'errors':[{'message':_0x2345('0x1d'),'type':_0x2345('0x1e')}]});}});_0x3f18e3[_0x2345('0x1f')](_0x5ea7a2);_0x3f18e3[_0x2345('0x20')]();}exports['openIssue']=openIssue;exports['send']=function(_0x45c529,_0x17df55){_0x45c529['body']['ip']=_0x45c529['headers'][_0x2345('0x21')]||_0x45c529['connection'][_0x2345('0x22')]||_0x45c529['socket'][_0x2345('0x22')]||_0x45c529[_0x2345('0x23')]['socket']['remoteAddress'];return openIssue(_0x45c529['body'],_0x17df55);}; \ No newline at end of file +var _0xf91c=['status','statusCode','json','parse','api.jira','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString','request','setEncoding','utf8','data','end'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0xf91c,0x147));var _0xcf91=function(_0x554b32,_0x577efd){_0x554b32=_0x554b32-0x0;var _0x2d896d=_0xf91c[_0x554b32];return _0x2d896d;};'use strict';var BPromise=require(_0xcf91('0x0'));var https=require(_0xcf91('0x1'));var logger=require(_0xcf91('0x2'))(_0xcf91('0x3'));var USERNAME=_0xcf91('0x4');var PASSWORD=_0xcf91('0x5');function openIssue(_0x3be28d,_0x6aa280){var _0x232d0d={'fields':{'project':{'key':_0x3be28d[_0xcf91('0x6')]||_0xcf91('0x7')},'summary':(_0x3be28d['summary']||'Report')+_0xcf91('0x8')+_0x3be28d['ip'],'description':_0x3be28d[_0xcf91('0x9')]||JSON[_0xcf91('0xa')](_0x3be28d),'issuetype':{'name':_0x3be28d[_0xcf91('0xb')]||_0xcf91('0xc')}}};_0x232d0d[_0xcf91('0xd')][_0xcf91('0xe')]=_0x3be28d[_0xcf91('0xf')];_0x232d0d[_0xcf91('0xd')][_0xcf91('0x10')]=_0x3be28d[_0xcf91('0x11')];_0x232d0d[_0xcf91('0xd')][_0xcf91('0x12')]=_0x3be28d['newToken'];_0x232d0d[_0xcf91('0xd')][_0xcf91('0x13')]=_0x3be28d[_0xcf91('0x14')];_0x232d0d['fields'][_0xcf91('0x15')]=_0x3be28d[_0xcf91('0x16')];_0x232d0d['fields'][_0xcf91('0x17')]=_0x3be28d['ip'];var _0x82df94={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xcf91('0x18'),'method':_0xcf91('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xcf91('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xcf91('0x1b')]('base64')}};var _0x2e79e9=JSON[_0xcf91('0xa')](_0x232d0d);var _0x6529bc=https[_0xcf91('0x1c')](_0x82df94,function(_0x335fda){_0x335fda[_0xcf91('0x1d')](_0xcf91('0x1e'));var _0x58cd5f='';_0x335fda['on'](_0xcf91('0x1f'),function(_0x5d0456){_0x58cd5f+=_0x5d0456;});_0x335fda['on'](_0xcf91('0x20'),function(){if(_0x6aa280){return _0x6aa280[_0xcf91('0x21')](_0x335fda[_0xcf91('0x22')])[_0xcf91('0x23')](JSON[_0xcf91('0x24')](_0x58cd5f));}});});_0x6529bc['on']('error',function(_0x4884bd){if(_0x6aa280){return _0x6aa280[_0xcf91('0x21')](0x1f4)[_0xcf91('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xcf91('0x25')}]});}});_0x6529bc['write'](_0x2e79e9);_0x6529bc[_0xcf91('0x20')]();}exports[_0xcf91('0x26')]=openIssue;exports['send']=function(_0x181274,_0x251d75){_0x181274['body']['ip']=_0x181274[_0xcf91('0x27')][_0xcf91('0x28')]||_0x181274[_0xcf91('0x29')][_0xcf91('0x2a')]||_0x181274['socket']['remoteAddress']||_0x181274[_0xcf91('0x29')][_0xcf91('0x2b')]['remoteAddress'];return openIssue(_0x181274[_0xcf91('0x2c')],_0x251d75);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 415122e..ffa1411 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 _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0x292801,_0x4c3d68){var _0x3322bb=function(_0x458893){while(--_0x458893){_0x292801['push'](_0x292801['shift']());}};_0x3322bb(++_0x4c3d68);}(_0x750a,0x140));var _0xa750=function(_0x315cdd,_0x364667){_0x315cdd=_0x315cdd-0x0;var _0x21e583=_0x750a[_0x315cdd];return _0x21e583;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=router; \ No newline at end of file +var _0xbdb7=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get','describe','show','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5c80cb,_0x15ba88){var _0x3b4eb4=function(_0x592c62){while(--_0x592c62){_0x5c80cb['push'](_0x5c80cb['shift']());}};_0x3b4eb4(++_0x15ba88);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xe3b7bb,_0x263836){_0xe3b7bb=_0xe3b7bb-0x0;var _0x2df486=_0xbdb7[_0xe3b7bb];return _0x2df486;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')]('/',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')](_0x7bdb('0x12'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0x14')]);module[_0x7bdb('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index e38976b..6eb54cc 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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x11698d,_0x596ab4){_0x11698d=_0x11698d-0x0;var _0x5cd453=_0x7a54[_0x11698d];return _0x5cd453;};'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(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x7a54,0x106));var _0x47a5=function(_0x5c5d5e,_0x381dbc){_0x5c5d5e=_0x5c5d5e-0x0;var _0xcfeba8=_0x7a54[_0x5c5d5e];return _0xcfeba8;};'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 ce74f06..394ad19 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 _0x6596=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','findAll','rows','show','params','length','includeAll','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse'];(function(_0x386e85,_0x39b2a3){var _0x2fcb9f=function(_0x5cd9cf){while(--_0x5cd9cf){_0x386e85['push'](_0x386e85['shift']());}};_0x2fcb9f(++_0x39b2a3);}(_0x6596,0x1d3));var _0x6659=function(_0x3ae955,_0x55bc94){_0x3ae955=_0x3ae955-0x0;var _0x1f128e=_0x6596[_0x3ae955];return _0x1f128e;};'use strict';var emlformat=require(_0x6659('0x0'));var rimraf=require(_0x6659('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6659('0x2'));var rp=require(_0x6659('0x3'));var moment=require(_0x6659('0x4'));var BPromise=require(_0x6659('0x5'));var Mustache=require(_0x6659('0x6'));var util=require(_0x6659('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6659('0x8'));var ejs=require(_0x6659('0x9'));var fs=require('fs');var fs_extra=require(_0x6659('0xa'));var _=require(_0x6659('0xb'));var squel=require(_0x6659('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6659('0xd'));var toCsv=require(_0x6659('0x8'));var querystring=require(_0x6659('0xe'));var Papa=require(_0x6659('0xf'));var Redis=require(_0x6659('0x10'));var authService=require(_0x6659('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6659('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6659('0x13'));var utils=require('../../config/utils');var config=require(_0x6659('0x14'));var licenseUtil=require(_0x6659('0x15'));var db=require(_0x6659('0x16'))['db'];function respondWithStatusCode(_0x438f95,_0x581baa){_0x581baa=_0x581baa||0xcc;return function(_0x3d68c5){if(_0x3d68c5){return _0x438f95[_0x6659('0x17')](_0x581baa);}return _0x438f95['status'](_0x581baa)[_0x6659('0x18')]();};}function respondWithResult(_0x2fd7da,_0x4238a7){_0x4238a7=_0x4238a7||0xc8;return function(_0x346cb6){if(_0x346cb6){return _0x2fd7da[_0x6659('0x19')](_0x4238a7)[_0x6659('0x1a')](_0x346cb6);}};}function respondWithFilteredResult(_0x5b5c16,_0x3246f1){return function(_0x36707c){if(_0x36707c){var _0x1ddce3=typeof _0x3246f1[_0x6659('0x1b')]===_0x6659('0x1c')&&typeof _0x3246f1[_0x6659('0x1d')]==='undefined';var _0x5b7658=_0x36707c[_0x6659('0x1e')];var _0x5e89f1=_0x1ddce3?0x0:_0x3246f1[_0x6659('0x1b')];var _0x38e4d6=_0x1ddce3?_0x36707c['count']:_0x3246f1[_0x6659('0x1b')]+_0x3246f1['limit'];var _0xa5e094;if(_0x38e4d6>=_0x5b7658){_0x38e4d6=_0x5b7658;_0xa5e094=0xc8;}else{_0xa5e094=0xce;}_0x5b5c16[_0x6659('0x19')](_0xa5e094);return _0x5b5c16['set'](_0x6659('0x1f'),_0x5e89f1+'-'+_0x38e4d6+'/'+_0x5b7658)[_0x6659('0x1a')](_0x36707c);}return null;};}function patchUpdates(_0x332d2c){return function(_0x3e139a){try{jsonpatch[_0x6659('0x20')](_0x3e139a,_0x332d2c,!![]);}catch(_0x3e1f83){return BPromise[_0x6659('0x21')](_0x3e1f83);}return _0x3e139a['save']();};}function saveUpdates(_0x2b4cce,_0x3506fd){return function(_0x314e40){if(_0x314e40){return _0x314e40[_0x6659('0x22')](_0x2b4cce)['then'](function(_0x4ce553){return _0x4ce553;});}return null;};}function removeEntity(_0x5a5e04,_0x564357){return function(_0xbad53f){if(_0xbad53f){return _0xbad53f[_0x6659('0x23')]()[_0x6659('0x24')](function(){_0x5a5e04[_0x6659('0x19')](0xcc)[_0x6659('0x18')]();});}};}function handleEntityNotFound(_0x12b218,_0x436691){return function(_0x3cb0dc){if(!_0x3cb0dc){_0x12b218[_0x6659('0x17')](0x194);}return _0x3cb0dc;};}function handleError(_0x5f48d6,_0x187571){_0x187571=_0x187571||0x1f4;return function(_0x373a3d){logger[_0x6659('0x25')](_0x373a3d['stack']);if(_0x373a3d['name']){delete _0x373a3d[_0x6659('0x26')];}_0x5f48d6[_0x6659('0x19')](_0x187571)['send'](_0x373a3d);};}exports[_0x6659('0x27')]=function(_0x2f5a16,_0x36dab5){var _0xcb5a33={},_0x1b721d={},_0x525b57={'count':0x0,'rows':[]};var _0x23ee05=_[_0x6659('0x28')](db[_0x6659('0x29')][_0x6659('0x2a')],function(_0xc9bd6a){return{'name':_0xc9bd6a['fieldName'],'type':_0xc9bd6a[_0x6659('0x2b')][_0x6659('0x2c')]};});_0x1b721d[_0x6659('0x2d')]=_[_0x6659('0x28')](_0x23ee05,_0x6659('0x26'));_0x1b721d[_0x6659('0x2e')]=_[_0x6659('0x2f')](_0x2f5a16['query']);_0x1b721d[_0x6659('0x30')]=_[_0x6659('0x31')](_0x1b721d['model'],_0x1b721d[_0x6659('0x2e')]);_0xcb5a33['attributes']=_[_0x6659('0x31')](_0x1b721d['model'],qs[_0x6659('0x32')](_0x2f5a16[_0x6659('0x2e')]['fields']));_0xcb5a33['attributes']=_0xcb5a33[_0x6659('0x33')]['length']?_0xcb5a33[_0x6659('0x33')]:_0x1b721d['model'];if(!_0x2f5a16[_0x6659('0x2e')]['hasOwnProperty'](_0x6659('0x34'))){_0xcb5a33[_0x6659('0x1d')]=qs['limit'](_0x2f5a16[_0x6659('0x2e')][_0x6659('0x1d')]);_0xcb5a33[_0x6659('0x1b')]=qs[_0x6659('0x1b')](_0x2f5a16[_0x6659('0x2e')]['offset']);}_0xcb5a33[_0x6659('0x35')]=qs['sort'](_0x2f5a16['query'][_0x6659('0x36')]);_0xcb5a33[_0x6659('0x37')]=qs[_0x6659('0x30')](_['pick'](_0x2f5a16[_0x6659('0x2e')],_0x1b721d['filters']),_0x23ee05);if(_0x2f5a16['query'][_0x6659('0x38')]){_0xcb5a33[_0x6659('0x37')]=_[_0x6659('0x39')](_0xcb5a33[_0x6659('0x37')],{'$or':_[_0x6659('0x28')](_0x23ee05,function(_0x90b64e){if(_0x90b64e[_0x6659('0x2b')]!=='VIRTUAL'){var _0x531a19={};_0x531a19[_0x90b64e[_0x6659('0x26')]]={'$like':'%'+_0x2f5a16[_0x6659('0x2e')][_0x6659('0x38')]+'%'};return _0x531a19;}})});}_0xcb5a33=_['merge']({},_0xcb5a33,_0x2f5a16[_0x6659('0x3a')]);var _0x3e4a93={'where':_0xcb5a33['where']};return db[_0x6659('0x29')][_0x6659('0x1e')](_0x3e4a93)[_0x6659('0x24')](function(_0x2924f4){_0x525b57[_0x6659('0x1e')]=_0x2924f4;if(_0x2f5a16['query']['includeAll']){_0xcb5a33['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6659('0x3b')](_0xcb5a33);})['then'](function(_0x552282){_0x525b57[_0x6659('0x3c')]=_0x552282;return _0x525b57;})[_0x6659('0x24')](respondWithFilteredResult(_0x36dab5,_0xcb5a33))['catch'](handleError(_0x36dab5,null));};exports[_0x6659('0x3d')]=function(_0x4230cf,_0x55cd09){var _0x176516={'raw':!![],'where':{'id':_0x4230cf[_0x6659('0x3e')]['id']}},_0x3551d4={};_0x3551d4[_0x6659('0x2d')]=_['keys'](db[_0x6659('0x29')]['rawAttributes']);_0x3551d4[_0x6659('0x2e')]=_[_0x6659('0x2f')](_0x4230cf[_0x6659('0x2e')]);_0x3551d4[_0x6659('0x30')]=_[_0x6659('0x31')](_0x3551d4[_0x6659('0x2d')],_0x3551d4['query']);_0x176516['attributes']=_[_0x6659('0x31')](_0x3551d4[_0x6659('0x2d')],qs[_0x6659('0x32')](_0x4230cf[_0x6659('0x2e')][_0x6659('0x32')]));_0x176516[_0x6659('0x33')]=_0x176516[_0x6659('0x33')][_0x6659('0x3f')]?_0x176516[_0x6659('0x33')]:_0x3551d4[_0x6659('0x2d')];if(_0x4230cf['query'][_0x6659('0x40')]){_0x176516['include']=[{'all':!![]}];}_0x176516=_[_0x6659('0x39')]({},_0x176516,_0x4230cf[_0x6659('0x3a')]);return db['JscriptyAnswerReport'][_0x6659('0x41')](_0x176516)[_0x6659('0x24')](handleEntityNotFound(_0x55cd09,null))['then'](respondWithResult(_0x55cd09,null))[_0x6659('0x42')](handleError(_0x55cd09,null));};exports[_0x6659('0x43')]=function(_0x6e0e41,_0x304733){return db['JscriptyAnswerReport']['create'](_0x6e0e41[_0x6659('0x44')],{})[_0x6659('0x24')](respondWithResult(_0x304733,0xc9))[_0x6659('0x42')](handleError(_0x304733,null));};exports[_0x6659('0x22')]=function(_0x442355,_0x3afc78){if(_0x442355['body']['id']){delete _0x442355[_0x6659('0x44')]['id'];}return db[_0x6659('0x29')]['find']({'where':{'id':_0x442355[_0x6659('0x3e')]['id']}})[_0x6659('0x24')](handleEntityNotFound(_0x3afc78,null))['then'](saveUpdates(_0x442355[_0x6659('0x44')],null))[_0x6659('0x24')](respondWithResult(_0x3afc78,null))[_0x6659('0x42')](handleError(_0x3afc78,null));};exports[_0x6659('0x23')]=function(_0x78c901,_0x1bdf74){return db[_0x6659('0x29')][_0x6659('0x41')]({'where':{'id':_0x78c901[_0x6659('0x3e')]['id']}})[_0x6659('0x24')](handleEntityNotFound(_0x1bdf74,null))[_0x6659('0x24')](removeEntity(_0x1bdf74,null))[_0x6659('0x42')](handleError(_0x1bdf74,null));};exports['describe']=function(_0x4c338b,_0x5fe9bd){return db[_0x6659('0x29')]['describe']()[_0x6659('0x24')](respondWithResult(_0x5fe9bd,null))[_0x6659('0x42')](handleError(_0x5fe9bd,null));}; \ No newline at end of file +var _0xdcc4=['params','find','catch','create','body','describe','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','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','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','show'];(function(_0x2ddd29,_0x577a16){var _0x4ed492=function(_0x55f3f3){while(--_0x55f3f3){_0x2ddd29['push'](_0x2ddd29['shift']());}};_0x4ed492(++_0x577a16);}(_0xdcc4,0xea));var _0x4dcc=function(_0x5f0633,_0x2dcd6f){_0x5f0633=_0x5f0633-0x0;var _0x167bcb=_0xdcc4[_0x5f0633];return _0x167bcb;};'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={},_0x5c2464={},_0x2ffac7={'count':0x0,'rows':[]};var _0x279524=_[_0x4dcc('0x2e')](db['JscriptyAnswerReport'][_0x4dcc('0x2f')],function(_0x4dd2e6){return{'name':_0x4dd2e6['fieldName'],'type':_0x4dd2e6[_0x4dcc('0x30')]['key']};});_0x5c2464[_0x4dcc('0x31')]=_[_0x4dcc('0x2e')](_0x279524,_0x4dcc('0x2b'));_0x5c2464[_0x4dcc('0x32')]=_[_0x4dcc('0x33')](_0x160805[_0x4dcc('0x32')]);_0x5c2464[_0x4dcc('0x34')]=_[_0x4dcc('0x35')](_0x5c2464[_0x4dcc('0x31')],_0x5c2464[_0x4dcc('0x32')]);_0x30c617[_0x4dcc('0x36')]=_['intersection'](_0x5c2464['model'],qs[_0x4dcc('0x37')](_0x160805['query'][_0x4dcc('0x37')]));_0x30c617[_0x4dcc('0x36')]=_0x30c617[_0x4dcc('0x36')][_0x4dcc('0x38')]?_0x30c617[_0x4dcc('0x36')]:_0x5c2464[_0x4dcc('0x31')];if(!_0x160805[_0x4dcc('0x32')][_0x4dcc('0x39')]('nolimit')){_0x30c617[_0x4dcc('0x21')]=qs['limit'](_0x160805[_0x4dcc('0x32')]['limit']);_0x30c617[_0x4dcc('0x1e')]=qs['offset'](_0x160805[_0x4dcc('0x32')][_0x4dcc('0x1e')]);}_0x30c617[_0x4dcc('0x3a')]=qs[_0x4dcc('0x3b')](_0x160805[_0x4dcc('0x32')]['sort']);_0x30c617[_0x4dcc('0x3c')]=qs['filters'](_[_0x4dcc('0x3d')](_0x160805[_0x4dcc('0x32')],_0x5c2464[_0x4dcc('0x34')]),_0x279524);if(_0x160805[_0x4dcc('0x32')][_0x4dcc('0x3e')]){_0x30c617[_0x4dcc('0x3c')]=_[_0x4dcc('0x3f')](_0x30c617[_0x4dcc('0x3c')],{'$or':_[_0x4dcc('0x2e')](_0x279524,function(_0x42d534){if(_0x42d534[_0x4dcc('0x30')]!==_0x4dcc('0x40')){var _0x4d4b92={};_0x4d4b92[_0x42d534['name']]={'$like':'%'+_0x160805[_0x4dcc('0x32')][_0x4dcc('0x3e')]+'%'};return _0x4d4b92;}})});}_0x30c617=_[_0x4dcc('0x3f')]({},_0x30c617,_0x160805['options']);var _0x478343={'where':_0x30c617['where']};return db[_0x4dcc('0x41')]['count'](_0x478343)['then'](function(_0x12d859){_0x2ffac7[_0x4dcc('0x20')]=_0x12d859;if(_0x160805[_0x4dcc('0x32')][_0x4dcc('0x42')]){_0x30c617[_0x4dcc('0x43')]=[{'all':!![]}];}return db[_0x4dcc('0x41')][_0x4dcc('0x44')](_0x30c617);})[_0x4dcc('0x28')](function(_0x5ec283){_0x2ffac7['rows']=_0x5ec283;return _0x2ffac7;})[_0x4dcc('0x28')](respondWithFilteredResult(_0x562d1f,_0x30c617))['catch'](handleError(_0x562d1f,null));};exports[_0x4dcc('0x45')]=function(_0x5545ed,_0x2cc3f7){var _0x4f3fa4={'raw':!![],'where':{'id':_0x5545ed[_0x4dcc('0x46')]['id']}},_0x34edc0={};_0x34edc0['model']=_[_0x4dcc('0x33')](db[_0x4dcc('0x41')][_0x4dcc('0x2f')]);_0x34edc0['query']=_[_0x4dcc('0x33')](_0x5545ed[_0x4dcc('0x32')]);_0x34edc0[_0x4dcc('0x34')]=_[_0x4dcc('0x35')](_0x34edc0[_0x4dcc('0x31')],_0x34edc0[_0x4dcc('0x32')]);_0x4f3fa4[_0x4dcc('0x36')]=_['intersection'](_0x34edc0[_0x4dcc('0x31')],qs[_0x4dcc('0x37')](_0x5545ed[_0x4dcc('0x32')]['fields']));_0x4f3fa4[_0x4dcc('0x36')]=_0x4f3fa4[_0x4dcc('0x36')]['length']?_0x4f3fa4[_0x4dcc('0x36')]:_0x34edc0[_0x4dcc('0x31')];if(_0x5545ed[_0x4dcc('0x32')][_0x4dcc('0x42')]){_0x4f3fa4[_0x4dcc('0x43')]=[{'all':!![]}];}_0x4f3fa4=_[_0x4dcc('0x3f')]({},_0x4f3fa4,_0x5545ed['options']);return db[_0x4dcc('0x41')][_0x4dcc('0x47')](_0x4f3fa4)[_0x4dcc('0x28')](handleEntityNotFound(_0x2cc3f7,null))['then'](respondWithResult(_0x2cc3f7,null))[_0x4dcc('0x48')](handleError(_0x2cc3f7,null));};exports['create']=function(_0x481b0c,_0x346afd){return db['JscriptyAnswerReport'][_0x4dcc('0x49')](_0x481b0c[_0x4dcc('0x4a')],{})[_0x4dcc('0x28')](respondWithResult(_0x346afd,0xc9))['catch'](handleError(_0x346afd,null));};exports[_0x4dcc('0x27')]=function(_0x53e1f1,_0x33f80c){if(_0x53e1f1['body']['id']){delete _0x53e1f1[_0x4dcc('0x4a')]['id'];}return db[_0x4dcc('0x41')]['find']({'where':{'id':_0x53e1f1[_0x4dcc('0x46')]['id']}})[_0x4dcc('0x28')](handleEntityNotFound(_0x33f80c,null))[_0x4dcc('0x28')](saveUpdates(_0x53e1f1[_0x4dcc('0x4a')],null))[_0x4dcc('0x28')](respondWithResult(_0x33f80c,null))[_0x4dcc('0x48')](handleError(_0x33f80c,null));};exports[_0x4dcc('0x29')]=function(_0x5970fb,_0x222ec8){return db[_0x4dcc('0x41')][_0x4dcc('0x47')]({'where':{'id':_0x5970fb[_0x4dcc('0x46')]['id']}})[_0x4dcc('0x28')](handleEntityNotFound(_0x222ec8,null))['then'](removeEntity(_0x222ec8,null))[_0x4dcc('0x48')](handleError(_0x222ec8,null));};exports[_0x4dcc('0x4b')]=function(_0x10968e,_0x3302bf){return db[_0x4dcc('0x41')][_0x4dcc('0x4b')]()[_0x4dcc('0x28')](respondWithResult(_0x3302bf,null))['catch'](handleError(_0x3302bf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 49756c3..3be6bbd 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 _0x7e65=['rimraf','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','bluebird','request-promise','path'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x7e65,0x96));var _0x57e6=function(_0x3ab0ec,_0x339990){_0x3ab0ec=_0x3ab0ec-0x0;var _0x226137=_0x7e65[_0x3ab0ec];return _0x226137;};'use strict';var _=require(_0x57e6('0x0'));var util=require(_0x57e6('0x1'));var logger=require('../../config/logger')(_0x57e6('0x2'));var moment=require('moment');var BPromise=require(_0x57e6('0x3'));var rp=require(_0x57e6('0x4'));var fs=require('fs');var path=require(_0x57e6('0x5'));var rimraf=require(_0x57e6('0x6'));var config=require(_0x57e6('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x57e6('0x8')]=function(_0x3a988b,_0x1f62e1){return _0x3a988b[_0x57e6('0x9')](_0x57e6('0xa'),attributes,{'tableName':_0x57e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x629d=['./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x2335ba,_0x408688){var _0x48d55b=function(_0x32a779){while(--_0x32a779){_0x2335ba['push'](_0x2335ba['shift']());}};_0x48d55b(++_0x408688);}(_0x629d,0xea));var _0xd629=function(_0x434339,_0x2abf5e){_0x434339=_0x434339-0x0;var _0x507ca6=_0x629d[_0x434339];return _0x507ca6;};'use strict';var _=require('lodash');var util=require(_0xd629('0x0'));var logger=require(_0xd629('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd629('0x2'));var fs=require('fs');var path=require(_0xd629('0x3'));var rimraf=require(_0xd629('0x4'));var config=require(_0xd629('0x5'));var attributes=require(_0xd629('0x6'));module['exports']=function(_0x3bba19,_0x3d3afd){return _0x3bba19[_0xd629('0x7')](_0xd629('0x8'),attributes,{'tableName':_0xd629('0x9'),'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 7355863..174e668 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 _0xcfec=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x533939,_0x3139be){var _0x41ac89=function(_0x3e9d51){while(--_0x3e9d51){_0x533939['push'](_0x533939['shift']());}};_0x41ac89(++_0x3139be);}(_0xcfec,0x86));var _0xccfe=function(_0x5c604c,_0x3c638f){_0x5c604c=_0x5c604c-0x0;var _0x565a0e=_0xcfec[_0x5c604c];return _0x565a0e;};'use strict';var _=require(_0xccfe('0x0'));var util=require(_0xccfe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xccfe('0x2'));var fs=require('fs');var Redis=require(_0xccfe('0x3'));var db=require(_0xccfe('0x4'))['db'];var utils=require(_0xccfe('0x5'));var logger=require(_0xccfe('0x6'))(_0xccfe('0x7'));var config=require(_0xccfe('0x8'));var jayson=require(_0xccfe('0x9'));var client=jayson[_0xccfe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1463bb,_0x498eaf,_0x2069f7){return new BPromise(function(_0x4d9197,_0x3cee7c){return client[_0xccfe('0xb')](_0x1463bb,_0x2069f7)[_0xccfe('0xc')](function(_0x18677f){logger[_0xccfe('0xd')](_0xccfe('0xe'),_0x498eaf,'request\x20sent');logger['debug'](_0xccfe('0xf'),_0x498eaf,_0xccfe('0x10'),JSON[_0xccfe('0x11')](_0x18677f));if(_0x18677f[_0xccfe('0x12')]){if(_0x18677f['error'][_0xccfe('0x13')]===0x1f4){logger[_0xccfe('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x498eaf,_0x18677f[_0xccfe('0x12')][_0xccfe('0x14')]);return _0x3cee7c(_0x18677f[_0xccfe('0x12')][_0xccfe('0x14')]);}logger[_0xccfe('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x498eaf,_0x18677f[_0xccfe('0x12')][_0xccfe('0x14')]);return _0x4d9197(_0x18677f['error'][_0xccfe('0x14')]);}else{logger[_0xccfe('0xd')](_0xccfe('0xe'),_0x498eaf,_0xccfe('0x10'));_0x4d9197(_0x18677f[_0xccfe('0x15')]['message']);}})[_0xccfe('0x16')](function(_0x4b31d1){logger[_0xccfe('0x12')](_0xccfe('0xe'),_0x498eaf,_0x4b31d1);_0x3cee7c(_0x4b31d1);});});} \ No newline at end of file +var _0xd64f=['../../config/environment','client','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x337271,_0x374c91){var _0x12248a=function(_0x33a48a){while(--_0x33a48a){_0x337271['push'](_0x337271['shift']());}};_0x12248a(++_0x374c91);}(_0xd64f,0xfe));var _0xfd64=function(_0x5577f3,_0x2b6def){_0x5577f3=_0x5577f3-0x0;var _0x2bfbbc=_0xd64f[_0x5577f3];return _0x2bfbbc;};'use strict';var _=require(_0xfd64('0x0'));var util=require(_0xfd64('0x1'));var moment=require(_0xfd64('0x2'));var BPromise=require(_0xfd64('0x3'));var rs=require(_0xfd64('0x4'));var fs=require('fs');var Redis=require(_0xfd64('0x5'));var db=require(_0xfd64('0x6'))['db'];var utils=require(_0xfd64('0x7'));var logger=require(_0xfd64('0x8'))(_0xfd64('0x9'));var config=require(_0xfd64('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xfd64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52cff5,_0x1d92b5,_0x491dd0){return new BPromise(function(_0x40099c,_0x41bbc2){return client[_0xfd64('0xc')](_0x52cff5,_0x491dd0)[_0xfd64('0xd')](function(_0x3b0bdc){logger['info'](_0xfd64('0xe'),_0x1d92b5,_0xfd64('0xf'));logger[_0xfd64('0x10')](_0xfd64('0x11'),_0x1d92b5,_0xfd64('0xf'),JSON['stringify'](_0x3b0bdc));if(_0x3b0bdc[_0xfd64('0x12')]){if(_0x3b0bdc[_0xfd64('0x12')][_0xfd64('0x13')]===0x1f4){logger[_0xfd64('0x12')](_0xfd64('0xe'),_0x1d92b5,_0x3b0bdc[_0xfd64('0x12')][_0xfd64('0x14')]);return _0x41bbc2(_0x3b0bdc[_0xfd64('0x12')]['message']);}logger[_0xfd64('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1d92b5,_0x3b0bdc[_0xfd64('0x12')]['message']);return _0x40099c(_0x3b0bdc['error'][_0xfd64('0x14')]);}else{logger[_0xfd64('0x15')](_0xfd64('0xe'),_0x1d92b5,'request\x20sent');_0x40099c(_0x3b0bdc[_0xfd64('0x16')][_0xfd64('0x14')]);}})[_0xfd64('0x17')](function(_0x4c4323){logger[_0xfd64('0x12')](_0xfd64('0xe'),_0x1d92b5,_0x4c4323);_0x41bbc2(_0x4c4323);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 781bca0..90e7d00 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 _0x6f2c=['Router','fs-extra','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x6f2c,0x1cc));var _0xc6f2=function(_0x2c1002,_0x37ebbf){_0x2c1002=_0x2c1002-0x0;var _0x44c986=_0x6f2c[_0x2c1002];return _0x44c986;};'use strict';var multer=require(_0xc6f2('0x0'));var util=require(_0xc6f2('0x1'));var path=require(_0xc6f2('0x2'));var timeout=require(_0xc6f2('0x3'));var express=require('express');var router=express[_0xc6f2('0x4')]();var fs_extra=require(_0xc6f2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc6f2('0x6'));var controller=require(_0xc6f2('0x7'));router[_0xc6f2('0x8')]('/',auth[_0xc6f2('0x9')](),controller[_0xc6f2('0xa')]);router['get'](_0xc6f2('0xb'),auth[_0xc6f2('0x9')](),controller[_0xc6f2('0xc')]);router[_0xc6f2('0x8')](_0xc6f2('0xd'),auth[_0xc6f2('0x9')](),controller[_0xc6f2('0xe')]);router[_0xc6f2('0x8')](_0xc6f2('0xf'),auth[_0xc6f2('0x9')](),controller[_0xc6f2('0x10')]);router[_0xc6f2('0x8')](_0xc6f2('0x11'),auth[_0xc6f2('0x9')](),timeout(_0xc6f2('0x12')),controller[_0xc6f2('0x13')]);router[_0xc6f2('0x14')]('/',auth['isAuthenticated'](),controller[_0xc6f2('0x15')]);router[_0xc6f2('0x14')](_0xc6f2('0x16'),auth['isAuthenticated'](),controller[_0xc6f2('0x17')]);router[_0xc6f2('0x18')](_0xc6f2('0xb'),auth['isAuthenticated'](),controller[_0xc6f2('0x19')]);router[_0xc6f2('0x1a')](_0xc6f2('0xb'),auth[_0xc6f2('0x9')](),controller[_0xc6f2('0x1b')]);module[_0xc6f2('0x1c')]=router; \ No newline at end of file +var _0x7896=['update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone'];(function(_0x283701,_0x1f88fa){var _0x1b9de7=function(_0x5ea471){while(--_0x5ea471){_0x283701['push'](_0x283701['shift']());}};_0x1b9de7(++_0x1f88fa);}(_0x7896,0x12f));var _0x6789=function(_0x343308,_0x500535){_0x343308=_0x343308-0x0;var _0x1504f1=_0x7896[_0x343308];return _0x1504f1;};'use strict';var multer=require('multer');var util=require(_0x6789('0x0'));var path=require('path');var timeout=require(_0x6789('0x1'));var express=require(_0x6789('0x2'));var router=express[_0x6789('0x3')]();var fs_extra=require(_0x6789('0x4'));var auth=require(_0x6789('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6789('0x6'));var controller=require(_0x6789('0x7'));router[_0x6789('0x8')]('/',auth[_0x6789('0x9')](),controller[_0x6789('0xa')]);router[_0x6789('0x8')](_0x6789('0xb'),auth[_0x6789('0x9')](),controller[_0x6789('0xc')]);router[_0x6789('0x8')](_0x6789('0xd'),auth['isAuthenticated'](),controller['getSessions']);router[_0x6789('0x8')](_0x6789('0xe'),auth[_0x6789('0x9')](),controller[_0x6789('0xf')]);router[_0x6789('0x8')]('/:id/summary',auth[_0x6789('0x9')](),timeout(_0x6789('0x10')),controller[_0x6789('0x11')]);router[_0x6789('0x12')]('/',auth['isAuthenticated'](),controller[_0x6789('0x13')]);router[_0x6789('0x12')](_0x6789('0x14'),auth[_0x6789('0x9')](),controller[_0x6789('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6789('0x16')]);router[_0x6789('0x17')]('/:id',auth[_0x6789('0x9')](),controller['destroy']);module[_0x6789('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index dd90cfb..6c0f40a 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 _0x6f18=['STRING','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','sequelize','lodash'];(function(_0x345c86,_0x2b12e0){var _0x41e895=function(_0x2af8c3){while(--_0x2af8c3){_0x345c86['push'](_0x345c86['shift']());}};_0x41e895(++_0x2b12e0);}(_0x6f18,0x1ec));var _0x86f1=function(_0xbf87ba,_0x5e4675){_0xbf87ba=_0xbf87ba-0x0;var _0x4d48f3=_0x6f18[_0xbf87ba];return _0x4d48f3;};'use strict';var Sequelize=require(_0x86f1('0x0'));var _=require(_0x86f1('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x86f1('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x86f1('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x86f1('0x3')),'set':function(_0x28e617){if(_['isObjectLike'](_0x28e617)){this[_0x86f1('0x4')](_0x86f1('0x5'),JSON[_0x86f1('0x6')](_0x28e617));}else if(_[_0x86f1('0x7')](_0x28e617)){this[_0x86f1('0x4')](_0x86f1('0x5'),_0x28e617);}else{this[_0x86f1('0x4')](_0x86f1('0x5'),util[_0x86f1('0x8')](_0x86f1('0x9'),this[_0x86f1('0xa')](_0x86f1('0xb'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x86f1('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfb0c=['name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xfb0c,0x1ab));var _0xcfb0=function(_0x1400ec,_0x19fd07){_0x1400ec=_0x1400ec-0x0;var _0x28ce84=_0xfb0c[_0x1400ec];return _0x28ce84;};'use strict';var Sequelize=require(_0xcfb0('0x0'));var _=require(_0xcfb0('0x1'));var util=require(_0xcfb0('0x2'));module[_0xcfb0('0x3')]={'name':{'type':Sequelize[_0xcfb0('0x4')],'unique':_0xcfb0('0x5')},'description':{'type':Sequelize[_0xcfb0('0x4')]},'formData':{'type':Sequelize[_0xcfb0('0x6')](_0xcfb0('0x7')),'set':function(_0x320703){if(_[_0xcfb0('0x8')](_0x320703)){this[_0xcfb0('0x9')](_0xcfb0('0xa'),JSON[_0xcfb0('0xb')](_0x320703));}else if(_[_0xcfb0('0xc')](_0x320703)){this[_0xcfb0('0x9')](_0xcfb0('0xa'),_0x320703);}else{this['setDataValue'](_0xcfb0('0xa'),util[_0xcfb0('0xd')](_0xcfb0('0xe'),this[_0xcfb0('0xf')](_0xcfb0('0x5'))||'',this[_0xcfb0('0xf')](_0xcfb0('0x10'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xcfb0('0x11')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xcfb0('0x11')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index c8a282e..c7083d6 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 _0x2c91=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','clone','include','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','getAnswers','JscriptyAnswerReport','ProjectId','number','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x568d36,_0x5e0e62){var _0x48006b=function(_0x1d28c9){while(--_0x1d28c9){_0x568d36['push'](_0x568d36['shift']());}};_0x48006b(++_0x5e0e62);}(_0x2c91,0x158));var _0x12c9=function(_0x402555,_0x3d61be){_0x402555=_0x402555-0x0;var _0x10bdd1=_0x2c91[_0x402555];return _0x10bdd1;};'use strict';var emlformat=require(_0x12c9('0x0'));var rimraf=require(_0x12c9('0x1'));var zipdir=require(_0x12c9('0x2'));var jsonpatch=require(_0x12c9('0x3'));var rp=require(_0x12c9('0x4'));var moment=require(_0x12c9('0x5'));var BPromise=require(_0x12c9('0x6'));var Mustache=require(_0x12c9('0x7'));var util=require('util');var path=require(_0x12c9('0x8'));var sox=require(_0x12c9('0x9'));var csv=require(_0x12c9('0xa'));var ejs=require(_0x12c9('0xb'));var fs=require('fs');var fs_extra=require(_0x12c9('0xc'));var _=require(_0x12c9('0xd'));var squel=require(_0x12c9('0xe'));var crypto=require('crypto');var jsforce=require(_0x12c9('0xf'));var deskjs=require(_0x12c9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x12c9('0x11'));var Papa=require(_0x12c9('0x12'));var Redis=require('ioredis');var authService=require(_0x12c9('0x13'));var qs=require(_0x12c9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12c9('0x15'));var logger=require(_0x12c9('0x16'))('api');var utils=require(_0x12c9('0x17'));var config=require(_0x12c9('0x18'));var licenseUtil=require(_0x12c9('0x19'));var db=require(_0x12c9('0x1a'))['db'];function respondWithStatusCode(_0x278da5,_0x2b239d){_0x2b239d=_0x2b239d||0xcc;return function(_0x5629b7){if(_0x5629b7){return _0x278da5[_0x12c9('0x1b')](_0x2b239d);}return _0x278da5[_0x12c9('0x1c')](_0x2b239d)[_0x12c9('0x1d')]();};}function respondWithResult(_0x4d0388,_0x4bf1a9){_0x4bf1a9=_0x4bf1a9||0xc8;return function(_0x490854){if(_0x490854){return _0x4d0388['status'](_0x4bf1a9)['json'](_0x490854);}};}function respondWithFilteredResult(_0x9fa35,_0x4e4cbf){return function(_0x3a83b4){if(_0x3a83b4){var _0x4460d5=typeof _0x4e4cbf[_0x12c9('0x1e')]===_0x12c9('0x1f')&&typeof _0x4e4cbf[_0x12c9('0x20')]==='undefined';var _0x2f704c=_0x3a83b4[_0x12c9('0x21')];var _0x1890d4=_0x4460d5?0x0:_0x4e4cbf[_0x12c9('0x1e')];var _0x44e9af=_0x4460d5?_0x3a83b4[_0x12c9('0x21')]:_0x4e4cbf[_0x12c9('0x1e')]+_0x4e4cbf[_0x12c9('0x20')];var _0x59b225;if(_0x44e9af>=_0x2f704c){_0x44e9af=_0x2f704c;_0x59b225=0xc8;}else{_0x59b225=0xce;}_0x9fa35[_0x12c9('0x1c')](_0x59b225);return _0x9fa35['set'](_0x12c9('0x22'),_0x1890d4+'-'+_0x44e9af+'/'+_0x2f704c)[_0x12c9('0x23')](_0x3a83b4);}return null;};}function patchUpdates(_0xd036ef){return function(_0x17675e){try{jsonpatch[_0x12c9('0x24')](_0x17675e,_0xd036ef,!![]);}catch(_0x4e767a){return BPromise[_0x12c9('0x25')](_0x4e767a);}return _0x17675e[_0x12c9('0x26')]();};}function saveUpdates(_0x2a324f,_0x36d400){return function(_0x370126){if(_0x370126){return _0x370126[_0x12c9('0x27')](_0x2a324f)[_0x12c9('0x28')](function(_0x1d7942){return _0x1d7942;});}return null;};}function removeEntity(_0x210a77,_0x2eecec){return function(_0x905751){if(_0x905751){return _0x905751['destroy']()[_0x12c9('0x28')](function(){var _0x1599a8=_0x905751[_0x12c9('0x29')]({'plain':!![]});var _0x1aa6a8=_0x12c9('0x2a');return db[_0x12c9('0x2b')][_0x12c9('0x2c')]({'where':{'type':_0x1aa6a8,'resourceId':_0x1599a8['id']}})[_0x12c9('0x28')](function(){return _0x905751;});})[_0x12c9('0x28')](function(){_0x210a77[_0x12c9('0x1c')](0xcc)[_0x12c9('0x1d')]();});}};}function handleEntityNotFound(_0x340f24,_0x447dec){return function(_0x2224ce){if(!_0x2224ce){_0x340f24[_0x12c9('0x1b')](0x194);}return _0x2224ce;};}function handleError(_0x4141db,_0x248bff){_0x248bff=_0x248bff||0x1f4;return function(_0xa53d40){logger[_0x12c9('0x2d')](_0xa53d40[_0x12c9('0x2e')]);if(_0xa53d40['name']){delete _0xa53d40[_0x12c9('0x2f')];}_0x4141db[_0x12c9('0x1c')](_0x248bff)[_0x12c9('0x30')](_0xa53d40);};}exports[_0x12c9('0x31')]=function(_0x6ddf60,_0x5138cc){var _0x98660f={},_0x59ba1a={},_0x179def={'count':0x0,'rows':[]};var _0x35a37d=_[_0x12c9('0x32')](db[_0x12c9('0x33')][_0x12c9('0x34')],function(_0x4c57c7){return{'name':_0x4c57c7[_0x12c9('0x35')],'type':_0x4c57c7['type'][_0x12c9('0x36')]};});_0x59ba1a[_0x12c9('0x37')]=_[_0x12c9('0x32')](_0x35a37d,_0x12c9('0x2f'));_0x59ba1a[_0x12c9('0x38')]=_[_0x12c9('0x39')](_0x6ddf60[_0x12c9('0x38')]);_0x59ba1a[_0x12c9('0x3a')]=_[_0x12c9('0x3b')](_0x59ba1a['model'],_0x59ba1a['query']);_0x98660f[_0x12c9('0x3c')]=_[_0x12c9('0x3b')](_0x59ba1a[_0x12c9('0x37')],qs[_0x12c9('0x3d')](_0x6ddf60[_0x12c9('0x38')][_0x12c9('0x3d')]));_0x98660f[_0x12c9('0x3c')]=_0x98660f['attributes'][_0x12c9('0x3e')]?_0x98660f[_0x12c9('0x3c')]:_0x59ba1a[_0x12c9('0x37')];if(!_0x6ddf60['query'][_0x12c9('0x3f')](_0x12c9('0x40'))){_0x98660f['limit']=qs[_0x12c9('0x20')](_0x6ddf60[_0x12c9('0x38')][_0x12c9('0x20')]);_0x98660f['offset']=qs[_0x12c9('0x1e')](_0x6ddf60[_0x12c9('0x38')][_0x12c9('0x1e')]);}_0x98660f[_0x12c9('0x41')]=qs[_0x12c9('0x42')](_0x6ddf60[_0x12c9('0x38')][_0x12c9('0x42')]);_0x98660f[_0x12c9('0x43')]=qs[_0x12c9('0x3a')](_[_0x12c9('0x44')](_0x6ddf60['query'],_0x59ba1a[_0x12c9('0x3a')]),_0x35a37d);if(_0x6ddf60[_0x12c9('0x38')][_0x12c9('0x45')]){_0x98660f[_0x12c9('0x43')]=_[_0x12c9('0x46')](_0x98660f['where'],{'$or':_[_0x12c9('0x32')](_0x35a37d,function(_0x4df548){if(_0x4df548[_0x12c9('0x47')]!==_0x12c9('0x48')){var _0x38c600={};_0x38c600[_0x4df548['name']]={'$like':'%'+_0x6ddf60['query'][_0x12c9('0x45')]+'%'};return _0x38c600;}})});}_0x98660f=_[_0x12c9('0x46')]({},_0x98660f,_0x6ddf60[_0x12c9('0x49')]);var _0x203ca2={'where':_0x98660f[_0x12c9('0x43')]};return db['JscriptyProject'][_0x12c9('0x21')](_0x203ca2)[_0x12c9('0x28')](function(_0x5bda1e){_0x179def[_0x12c9('0x21')]=_0x5bda1e;if(_0x6ddf60[_0x12c9('0x38')][_0x12c9('0x4a')]){_0x98660f['include']=[{'all':!![]}];}return db[_0x12c9('0x33')][_0x12c9('0x4b')](_0x98660f);})['then'](function(_0x2f1a27){_0x179def[_0x12c9('0x4c')]=_0x2f1a27;return _0x179def;})[_0x12c9('0x28')](respondWithFilteredResult(_0x5138cc,_0x98660f))[_0x12c9('0x4d')](handleError(_0x5138cc,null));};exports[_0x12c9('0x4e')]=function(_0x34c973,_0x11cbe8){var _0x5a2f0f={'raw':![],'where':{'id':_0x34c973[_0x12c9('0x4f')]['id']}},_0x1468d7={};_0x1468d7['model']=_[_0x12c9('0x39')](db[_0x12c9('0x33')][_0x12c9('0x34')]);_0x1468d7[_0x12c9('0x38')]=_[_0x12c9('0x39')](_0x34c973[_0x12c9('0x38')]);_0x1468d7[_0x12c9('0x3a')]=_['intersection'](_0x1468d7[_0x12c9('0x37')],_0x1468d7['query']);_0x5a2f0f[_0x12c9('0x3c')]=_['intersection'](_0x1468d7['model'],qs[_0x12c9('0x3d')](_0x34c973[_0x12c9('0x38')]['fields']));_0x5a2f0f[_0x12c9('0x3c')]=_0x5a2f0f[_0x12c9('0x3c')][_0x12c9('0x3e')]?_0x5a2f0f[_0x12c9('0x3c')]:_0x1468d7[_0x12c9('0x37')];if(_0x34c973[_0x12c9('0x38')][_0x12c9('0x4a')]){_0x5a2f0f['include']=[{'all':!![]}];}_0x5a2f0f=_[_0x12c9('0x46')]({},_0x5a2f0f,_0x34c973[_0x12c9('0x49')]);return db[_0x12c9('0x33')][_0x12c9('0x50')](_0x5a2f0f)['then'](handleEntityNotFound(_0x11cbe8,null))[_0x12c9('0x28')](respondWithResult(_0x11cbe8,null))['catch'](handleError(_0x11cbe8,null));};exports[_0x12c9('0x51')]=function(_0x43f2ec,_0x3e312a){return db[_0x12c9('0x33')]['create'](_0x43f2ec[_0x12c9('0x52')],{})[_0x12c9('0x28')](function(_0x39b578){var _0x58d2ff=_0x43f2ec[_0x12c9('0x53')]['get']({'plain':!![]});if(!_0x58d2ff)throw new Error(_0x12c9('0x54'));if(_0x58d2ff[_0x12c9('0x55')]==='user'){var _0x518335=_0x39b578['get']({'plain':!![]});var _0x3e6994=_0x12c9('0x2a');return db[_0x12c9('0x56')]['find']({'where':{'name':_0x3e6994,'userProfileId':_0x58d2ff['userProfileId']},'raw':!![]})[_0x12c9('0x28')](function(_0xf7b1d5){if(_0xf7b1d5&&_0xf7b1d5['autoAssociation']===0x0){return db[_0x12c9('0x2b')][_0x12c9('0x51')]({'name':_0x518335[_0x12c9('0x2f')],'resourceId':_0x518335['id'],'type':_0xf7b1d5[_0x12c9('0x2f')],'sectionId':_0xf7b1d5['id']},{})[_0x12c9('0x28')](function(){return _0x39b578;});}else{return _0x39b578;}})[_0x12c9('0x4d')](function(_0x2750c9){logger[_0x12c9('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2750c9);throw _0x2750c9;});}return _0x39b578;})[_0x12c9('0x28')](respondWithResult(_0x3e312a,0xc9))[_0x12c9('0x4d')](handleError(_0x3e312a,null));};exports[_0x12c9('0x57')]=function(_0x4f3ff7,_0x387bd6){var _0x5ac215={'where':{'id':_0x4f3ff7[_0x12c9('0x4f')]['id']}},_0x4c972f={};_0x4c972f['model']=_['keys'](db[_0x12c9('0x33')][_0x12c9('0x34')]);_0x5ac215['attributes']=_[_0x12c9('0x3b')](_0x4c972f[_0x12c9('0x37')],qs[_0x12c9('0x3d')](_0x4f3ff7[_0x12c9('0x38')][_0x12c9('0x3d')]));_0x5ac215[_0x12c9('0x3c')]=_0x5ac215[_0x12c9('0x3c')][_0x12c9('0x3e')]?_0x5ac215[_0x12c9('0x3c')]:_0x4c972f[_0x12c9('0x37')];if(_0x4f3ff7[_0x12c9('0x38')][_0x12c9('0x4a')]){_0x5ac215[_0x12c9('0x58')]=[{'all':!![]}];}_0x5ac215=_[_0x12c9('0x46')]({},_0x5ac215,_0x4f3ff7[_0x12c9('0x49')]);return db[_0x12c9('0x33')]['find'](_0x5ac215)[_0x12c9('0x28')](handleEntityNotFound(_0x387bd6,null))[_0x12c9('0x28')](function(_0x1aa875){if(_0x1aa875){var _0x5866f5=_0x1aa875[_0x12c9('0x29')]({'plain':!![]});_0x5866f5=qs[_0x12c9('0x59')](_0x5866f5,['id',_0x12c9('0x5a'),_0x12c9('0x5b')]);_0x4f3ff7[_0x12c9('0x52')]=_[_0x12c9('0x59')](_0x4f3ff7['body'],['id',_0x12c9('0x5a'),'updatedAt']);return db[_0x12c9('0x33')][_0x12c9('0x51')](_[_0x12c9('0x46')](_0x5866f5,_0x4f3ff7[_0x12c9('0x52')]),{'include':_0x4f3ff7['query'][_0x12c9('0x4a')]?[{'all':!![]}]:undefined})[_0x12c9('0x28')](function(_0x44400c){var _0x1c3edc=_0x4f3ff7['user']['get']({'plain':!![]});if(!_0x1c3edc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c3edc[_0x12c9('0x55')]===_0x12c9('0x53')){var _0x382d57=_0x44400c[_0x12c9('0x29')]({'plain':!![]});var _0x296e61=_0x12c9('0x2a');return db['UserProfileSection'][_0x12c9('0x50')]({'where':{'name':_0x296e61,'userProfileId':_0x1c3edc[_0x12c9('0x5c')]},'raw':!![]})[_0x12c9('0x28')](function(_0x12492c){if(_0x12492c&&_0x12492c[_0x12c9('0x5d')]===0x0){return db[_0x12c9('0x2b')][_0x12c9('0x51')]({'name':_0x382d57[_0x12c9('0x2f')],'resourceId':_0x382d57['id'],'type':_0x12492c['name'],'sectionId':_0x12492c['id']},{})[_0x12c9('0x28')](function(){return _0x44400c;});}else{return _0x44400c;}})[_0x12c9('0x4d')](function(_0x3441f8){logger[_0x12c9('0x2d')](_0x12c9('0x5e'),_0x3441f8);throw _0x3441f8;});}return _0x44400c;});}})[_0x12c9('0x28')](respondWithResult(_0x387bd6,0xc9))[_0x12c9('0x4d')](handleError(_0x387bd6,null));};exports['update']=function(_0x63c14d,_0x1ce279){if(_0x63c14d[_0x12c9('0x52')]['id']){delete _0x63c14d[_0x12c9('0x52')]['id'];}return db[_0x12c9('0x33')][_0x12c9('0x50')]({'where':{'id':_0x63c14d[_0x12c9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1ce279,null))[_0x12c9('0x28')](saveUpdates(_0x63c14d['body'],null))['then'](respondWithResult(_0x1ce279,null))[_0x12c9('0x4d')](handleError(_0x1ce279,null));};exports[_0x12c9('0x2c')]=function(_0x57e31a,_0x1f84e7){return db['JscriptyProject'][_0x12c9('0x50')]({'where':{'id':_0x57e31a[_0x12c9('0x4f')]['id']}})[_0x12c9('0x28')](handleEntityNotFound(_0x1f84e7,null))[_0x12c9('0x28')](removeEntity(_0x1f84e7,null))['catch'](handleError(_0x1f84e7,null));};exports[_0x12c9('0x5f')]=function(_0x432132,_0x2ec402,_0x17cec9){var _0x499752={'raw':!![],'where':{}};var _0x229d73={};var _0x1dd13d={'count':0x0,'rows':[]};return db[_0x12c9('0x33')]['findOne']({'where':{'id':_0x432132[_0x12c9('0x4f')]['id']}})[_0x12c9('0x28')](handleEntityNotFound(_0x2ec402,null))['then'](function(_0x2f40cb){if(_0x2f40cb){_0x229d73[_0x12c9('0x37')]=_[_0x12c9('0x39')](db[_0x12c9('0x60')][_0x12c9('0x34')]);_0x229d73['query']=_[_0x12c9('0x39')](_0x432132['query']);_0x229d73['filters']=_[_0x12c9('0x3b')](_0x229d73[_0x12c9('0x37')],_0x229d73['query']);_0x499752[_0x12c9('0x3c')]=_['intersection'](_0x229d73[_0x12c9('0x37')],qs[_0x12c9('0x3d')](_0x432132['query'][_0x12c9('0x3d')]));_0x499752[_0x12c9('0x3c')]=_0x499752[_0x12c9('0x3c')]['length']?_0x499752[_0x12c9('0x3c')]:_0x229d73['model'];if(!_0x432132[_0x12c9('0x38')]['hasOwnProperty'](_0x12c9('0x40'))){_0x499752[_0x12c9('0x20')]=qs[_0x12c9('0x20')](_0x432132[_0x12c9('0x38')][_0x12c9('0x20')]);_0x499752['offset']=qs[_0x12c9('0x1e')](_0x432132[_0x12c9('0x38')]['offset']);}_0x499752['order']=qs[_0x12c9('0x42')](_0x432132[_0x12c9('0x38')][_0x12c9('0x42')]);_0x499752[_0x12c9('0x43')]=qs[_0x12c9('0x3a')](_[_0x12c9('0x44')](_0x432132[_0x12c9('0x38')],_0x229d73[_0x12c9('0x3a')]));_0x499752[_0x12c9('0x43')]['ProjectId']=_0x2f40cb['id'];if(_0x432132[_0x12c9('0x38')][_0x12c9('0x45')]){_0x499752[_0x12c9('0x43')]=_['merge'](_0x499752['where'],{'$or':_['map'](_0x499752[_0x12c9('0x3c')],function(_0x41a4b6){var _0x3c9cd9={};_0x3c9cd9[_0x41a4b6]={'$like':'%'+_0x432132['query'][_0x12c9('0x45')]+'%'};return _0x3c9cd9;})});}_0x499752=_['merge']({},_0x499752,_0x432132[_0x12c9('0x49')]);return db[_0x12c9('0x60')][_0x12c9('0x21')]({'where':_0x499752[_0x12c9('0x43')]})[_0x12c9('0x28')](function(_0x5b803a){_0x1dd13d[_0x12c9('0x21')]=_0x5b803a;if(_0x432132[_0x12c9('0x38')]['includeAll']){_0x499752[_0x12c9('0x58')]=[{'all':!![]}];}return db[_0x12c9('0x60')][_0x12c9('0x4b')](_0x499752);})[_0x12c9('0x28')](function(_0x3dc0e3){_0x1dd13d[_0x12c9('0x4c')]=_0x3dc0e3;return _0x1dd13d;});}})[_0x12c9('0x28')](respondWithFilteredResult(_0x2ec402,_0x499752))['catch'](handleError(_0x2ec402,null));};exports[_0x12c9('0x61')]=function(_0x58fd5c,_0x3625fb,_0x4c7212){var _0x31a319={'raw':!![],'where':{}};var _0x48fde3={};var _0x4d9e4b={'count':0x0,'rows':[]};return db[_0x12c9('0x33')]['findOne']({'where':{'id':_0x58fd5c[_0x12c9('0x4f')]['id']}})[_0x12c9('0x28')](handleEntityNotFound(_0x3625fb,null))['then'](function(_0xa78085){if(_0xa78085){_0x48fde3[_0x12c9('0x37')]=_[_0x12c9('0x39')](db[_0x12c9('0x62')][_0x12c9('0x34')]);_0x48fde3[_0x12c9('0x38')]=_[_0x12c9('0x39')](_0x58fd5c[_0x12c9('0x38')]);_0x48fde3[_0x12c9('0x3a')]=_['intersection'](_0x48fde3[_0x12c9('0x37')],_0x48fde3[_0x12c9('0x38')]);_0x31a319[_0x12c9('0x3c')]=_[_0x12c9('0x3b')](_0x48fde3['model'],qs[_0x12c9('0x3d')](_0x58fd5c[_0x12c9('0x38')][_0x12c9('0x3d')]));_0x31a319[_0x12c9('0x3c')]=_0x31a319[_0x12c9('0x3c')][_0x12c9('0x3e')]?_0x31a319['attributes']:_0x48fde3[_0x12c9('0x37')];if(!_0x58fd5c[_0x12c9('0x38')][_0x12c9('0x3f')](_0x12c9('0x40'))){_0x31a319['limit']=qs[_0x12c9('0x20')](_0x58fd5c[_0x12c9('0x38')][_0x12c9('0x20')]);_0x31a319[_0x12c9('0x1e')]=qs[_0x12c9('0x1e')](_0x58fd5c[_0x12c9('0x38')]['offset']);}_0x31a319[_0x12c9('0x41')]=qs[_0x12c9('0x42')](_0x58fd5c[_0x12c9('0x38')][_0x12c9('0x42')]);_0x31a319[_0x12c9('0x43')]=qs['filters'](_[_0x12c9('0x44')](_0x58fd5c['query'],_0x48fde3['filters']));_0x31a319[_0x12c9('0x43')][_0x12c9('0x63')]=_0xa78085['id'];if(_0x58fd5c[_0x12c9('0x38')][_0x12c9('0x45')]){_0x31a319[_0x12c9('0x43')]=_[_0x12c9('0x46')](_0x31a319[_0x12c9('0x43')],{'$or':_['map'](_0x31a319['attributes'],function(_0x483d6d){var _0x48d28d={};_0x48d28d[_0x483d6d]={'$like':'%'+_0x58fd5c['query'][_0x12c9('0x45')]+'%'};return _0x48d28d;})});}_0x31a319=_[_0x12c9('0x46')]({},_0x31a319,_0x58fd5c[_0x12c9('0x49')]);return db[_0x12c9('0x62')]['count']({'where':_0x31a319['where']})[_0x12c9('0x28')](function(_0x593c83){_0x4d9e4b[_0x12c9('0x21')]=_0x593c83;if(_0x58fd5c[_0x12c9('0x38')][_0x12c9('0x4a')]){_0x31a319[_0x12c9('0x58')]=[{'all':!![]}];}return db[_0x12c9('0x62')][_0x12c9('0x4b')](_0x31a319);})[_0x12c9('0x28')](function(_0x116022){_0x4d9e4b[_0x12c9('0x4c')]=_0x116022;return _0x4d9e4b;});}})['then'](respondWithFilteredResult(_0x3625fb,_0x31a319))[_0x12c9('0x4d')](handleError(_0x3625fb,null));};function char(_0x41bde0){return _0x12c9('0x64')===typeof _0x41bde0?String['fromCharCode']['apply'](null,arguments):_0x41bde0;}function needsEncapsulation(_0x4499e8){return!!_0x4499e8&&(_0x4499e8[_0x12c9('0x65')]()[_0x12c9('0x66')](char(0xd))>=0x0||_0x4499e8['toString']()[_0x12c9('0x66')](char(0xa))>=0x0||_0x4499e8[_0x12c9('0x65')]()[_0x12c9('0x66')](char(0x2c))>=0x0||_0x4499e8[_0x12c9('0x65')]()[_0x12c9('0x66')](char(0x22))>=0x0);}function encapsulate(_0x749f4a){var _0x37b160=char(0x22),_0x4b8eb9='\x5c'+char(0x22),_0x37182e=_0x749f4a[_0x12c9('0x65')]()[_0x12c9('0x67')](new RegExp(_0x37b160,'g'),_0x4b8eb9);return _0x37b160+_0x37182e+_0x37b160;}exports[_0x12c9('0x68')]=function(_0x4774af,_0x34b989,_0x8fdf4){var _0x5deea3,_0x1272f7;var _0x40e9a1={'where':{'ProjectId':_0x4774af['params']['id']}};if(_0x4774af[_0x12c9('0x38')]['startTime']){_0x40e9a1[_0x12c9('0x43')]['starttime']=JSON['parse'](_0x4774af[_0x12c9('0x38')][_0x12c9('0x69')]);}return db[_0x12c9('0x60')][_0x12c9('0x4b')](_0x40e9a1)[_0x12c9('0x28')](handleEntityNotFound(_0x34b989,null))[_0x12c9('0x28')](function(_0x53d816){if(_0x53d816){_0x5deea3=_0x53d816;return db[_0x12c9('0x6a')]['findAll']({'where':{'SessionId':{'$in':_[_0x12c9('0x32')](_0x5deea3,'id')},'ProjectId':_0x4774af[_0x12c9('0x4f')]['id']},'order':_0x12c9('0x6b')});}})['then'](handleEntityNotFound(_0x34b989,null))[_0x12c9('0x28')](function(_0x2306e1){if(_0x2306e1){_0x1272f7=_0x2306e1;var _0x219e4a={};for(var _0x2bafe3=0x0,_0x4258d5=_0x1272f7['length'];_0x2bafe3<_0x4258d5;_0x2bafe3++){if(!_0x219e4a['hasOwnProperty'](_0x1272f7[_0x2bafe3]['questionId'])){_0x219e4a[_0x1272f7[_0x2bafe3][_0x12c9('0x6c')]]=needsEncapsulation(_0x1272f7[_0x2bafe3][_0x12c9('0x6d')])?encapsulate(_0x1272f7[_0x2bafe3][_0x12c9('0x6d')]):_0x1272f7[_0x2bafe3][_0x12c9('0x6d')];}}var _0x48c6e2=[],_0x390974={};for(var _0x1d00dd=0x0,_0x427ef5=_0x5deea3[_0x12c9('0x3e')];_0x1d00dd<_0x427ef5;_0x1d00dd++){_0x390974={'ProjectId':_0x4774af[_0x12c9('0x4f')]['id'],'SessionId':_0x5deea3[_0x1d00dd]['id'],'StartTime':moment(_0x5deea3[_0x1d00dd]['starttime'])[_0x12c9('0x6e')](_0x12c9('0x6f'))};for(var _0x53e10b=0x0,_0x249cbb=_0x1272f7['length'];_0x53e10b<_0x249cbb;_0x53e10b++){if(_0x1272f7[_0x53e10b][_0x12c9('0x70')]==_0x5deea3[_0x1d00dd]['id']&&_0x219e4a[_0x12c9('0x3f')](_0x1272f7[_0x53e10b][_0x12c9('0x6c')])){_0x390974[_0x219e4a[_0x1272f7[_0x53e10b][_0x12c9('0x6c')]]]=_0x1272f7[_0x53e10b][_0x12c9('0x71')];}}for(var _0x11d73a in _0x219e4a){if(!_0x390974[_0x12c9('0x3f')](_0x219e4a[_0x11d73a])){_0x390974[_0x219e4a[_0x11d73a]]=null;}}_0x48c6e2[_0x12c9('0x72')](_0x390974);}return _0x48c6e2;}})[_0x12c9('0x28')](function(_0x4b97c0){if(!_[_0x12c9('0x73')](_0x4b97c0)){var _0x4f4bdb=toCsv(_0x4b97c0);var _0x280a4f=Date['now']();fs[_0x12c9('0x74')](util[_0x12c9('0x6e')](_0x12c9('0x75'),_0x4774af[_0x12c9('0x4f')]['id'],_0x280a4f),_0x4f4bdb);_0x34b989[_0x12c9('0x76')](_0x12c9('0x77'),_0x12c9('0x78')+util[_0x12c9('0x6e')](_0x12c9('0x79'),_0x4774af[_0x12c9('0x4f')]['id'],_0x280a4f));_0x34b989[_0x12c9('0x76')](_0x12c9('0x7a'),_0x12c9('0x7b'));return _0x34b989['download'](util[_0x12c9('0x6e')](_0x12c9('0x75'),_0x4774af[_0x12c9('0x4f')]['id'],_0x280a4f));}else{return _0x34b989[_0x12c9('0x1b')](0xcc);}})[_0x12c9('0x4d')](handleError(_0x34b989,null));}; \ No newline at end of file +var _0x2f3a=['fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','Projects','error','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','UserProfileResource','params','getSessions','JscriptySessionReport','sort','ProjectId','getAnswers','JscriptyAnswerReport','number'];(function(_0x305d21,_0x10893e){var _0xf8378b=function(_0xae1f4c){while(--_0xae1f4c){_0x305d21['push'](_0x305d21['shift']());}};_0xf8378b(++_0x10893e);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x3a4e81,_0x453b4e){_0x3a4e81=_0x3a4e81-0x0;var _0x572874=_0x2f3a[_0x3a4e81];return _0x572874;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require(_0xa2f3('0x6'));var path=require('path');var sox=require(_0xa2f3('0x7'));var csv=require('to-csv');var ejs=require(_0xa2f3('0x8'));var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2f3('0xa'));var jsforce=require(_0xa2f3('0xb'));var deskjs=require(_0xa2f3('0xc'));var toCsv=require(_0xa2f3('0xd'));var querystring=require('querystring');var Papa=require(_0xa2f3('0xe'));var Redis=require(_0xa2f3('0xf'));var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))(_0xa2f3('0x14'));var utils=require('../../config/utils');var config=require(_0xa2f3('0x15'));var licenseUtil=require(_0xa2f3('0x16'));var db=require(_0xa2f3('0x17'))['db'];function respondWithStatusCode(_0x58f6df,_0x6aa8f2){_0x6aa8f2=_0x6aa8f2||0xcc;return function(_0x194281){if(_0x194281){return _0x58f6df[_0xa2f3('0x18')](_0x6aa8f2);}return _0x58f6df[_0xa2f3('0x19')](_0x6aa8f2)[_0xa2f3('0x1a')]();};}function respondWithResult(_0xd4f9db,_0x3907fe){_0x3907fe=_0x3907fe||0xc8;return function(_0x4544d4){if(_0x4544d4){return _0xd4f9db[_0xa2f3('0x19')](_0x3907fe)['json'](_0x4544d4);}};}function respondWithFilteredResult(_0xdc3967,_0x33bf10){return function(_0x74fb58){if(_0x74fb58){var _0x51d297=typeof _0x33bf10[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x33bf10['limit']==='undefined';var _0xb1fe06=_0x74fb58[_0xa2f3('0x1d')];var _0x2db0d2=_0x51d297?0x0:_0x33bf10[_0xa2f3('0x1b')];var _0x205578=_0x51d297?_0x74fb58[_0xa2f3('0x1d')]:_0x33bf10[_0xa2f3('0x1b')]+_0x33bf10[_0xa2f3('0x1e')];var _0x550d68;if(_0x205578>=_0xb1fe06){_0x205578=_0xb1fe06;_0x550d68=0xc8;}else{_0x550d68=0xce;}_0xdc3967[_0xa2f3('0x19')](_0x550d68);return _0xdc3967[_0xa2f3('0x1f')]('Content-Range',_0x2db0d2+'-'+_0x205578+'/'+_0xb1fe06)['json'](_0x74fb58);}return null;};}function patchUpdates(_0x2f74a0){return function(_0x53af81){try{jsonpatch[_0xa2f3('0x20')](_0x53af81,_0x2f74a0,!![]);}catch(_0x147fb7){return BPromise['reject'](_0x147fb7);}return _0x53af81[_0xa2f3('0x21')]();};}function saveUpdates(_0x3e055d,_0x14d989){return function(_0x2685bb){if(_0x2685bb){return _0x2685bb[_0xa2f3('0x22')](_0x3e055d)[_0xa2f3('0x23')](function(_0x37f8c2){return _0x37f8c2;});}return null;};}function removeEntity(_0xa02908,_0x49a589){return function(_0x81af9b){if(_0x81af9b){return _0x81af9b[_0xa2f3('0x24')]()[_0xa2f3('0x23')](function(){var _0x3d022e=_0x81af9b[_0xa2f3('0x25')]({'plain':!![]});var _0x2e6332=_0xa2f3('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e6332,'resourceId':_0x3d022e['id']}})[_0xa2f3('0x23')](function(){return _0x81af9b;});})[_0xa2f3('0x23')](function(){_0xa02908[_0xa2f3('0x19')](0xcc)[_0xa2f3('0x1a')]();});}};}function handleEntityNotFound(_0x580143,_0x254093){return function(_0x1eb1cc){if(!_0x1eb1cc){_0x580143[_0xa2f3('0x18')](0x194);}return _0x1eb1cc;};}function handleError(_0x5afda4,_0x246a36){_0x246a36=_0x246a36||0x1f4;return function(_0x4ec4ab){logger[_0xa2f3('0x27')](_0x4ec4ab['stack']);if(_0x4ec4ab[_0xa2f3('0x28')]){delete _0x4ec4ab['name'];}_0x5afda4[_0xa2f3('0x19')](_0x246a36)['send'](_0x4ec4ab);};}exports[_0xa2f3('0x29')]=function(_0x210a42,_0x2e8291){var _0x253fed={},_0x94ddd8={},_0x50ae25={'count':0x0,'rows':[]};var _0x27351d=_[_0xa2f3('0x2a')](db[_0xa2f3('0x2b')][_0xa2f3('0x2c')],function(_0x46686c){return{'name':_0x46686c[_0xa2f3('0x2d')],'type':_0x46686c[_0xa2f3('0x2e')][_0xa2f3('0x2f')]};});_0x94ddd8[_0xa2f3('0x30')]=_['map'](_0x27351d,_0xa2f3('0x28'));_0x94ddd8[_0xa2f3('0x31')]=_[_0xa2f3('0x32')](_0x210a42[_0xa2f3('0x31')]);_0x94ddd8[_0xa2f3('0x33')]=_['intersection'](_0x94ddd8[_0xa2f3('0x30')],_0x94ddd8['query']);_0x253fed['attributes']=_[_0xa2f3('0x34')](_0x94ddd8[_0xa2f3('0x30')],qs['fields'](_0x210a42[_0xa2f3('0x31')][_0xa2f3('0x35')]));_0x253fed['attributes']=_0x253fed[_0xa2f3('0x36')][_0xa2f3('0x37')]?_0x253fed['attributes']:_0x94ddd8['model'];if(!_0x210a42[_0xa2f3('0x31')][_0xa2f3('0x38')](_0xa2f3('0x39'))){_0x253fed[_0xa2f3('0x1e')]=qs['limit'](_0x210a42[_0xa2f3('0x31')]['limit']);_0x253fed[_0xa2f3('0x1b')]=qs['offset'](_0x210a42['query'][_0xa2f3('0x1b')]);}_0x253fed[_0xa2f3('0x3a')]=qs['sort'](_0x210a42[_0xa2f3('0x31')]['sort']);_0x253fed[_0xa2f3('0x3b')]=qs[_0xa2f3('0x33')](_[_0xa2f3('0x3c')](_0x210a42[_0xa2f3('0x31')],_0x94ddd8[_0xa2f3('0x33')]),_0x27351d);if(_0x210a42[_0xa2f3('0x31')]['filter']){_0x253fed[_0xa2f3('0x3b')]=_[_0xa2f3('0x3d')](_0x253fed[_0xa2f3('0x3b')],{'$or':_[_0xa2f3('0x2a')](_0x27351d,function(_0x194c52){if(_0x194c52[_0xa2f3('0x2e')]!==_0xa2f3('0x3e')){var _0x467c77={};_0x467c77[_0x194c52['name']]={'$like':'%'+_0x210a42[_0xa2f3('0x31')][_0xa2f3('0x3f')]+'%'};return _0x467c77;}})});}_0x253fed=_[_0xa2f3('0x3d')]({},_0x253fed,_0x210a42[_0xa2f3('0x40')]);var _0x3ba691={'where':_0x253fed['where']};return db[_0xa2f3('0x2b')][_0xa2f3('0x1d')](_0x3ba691)['then'](function(_0x3c5b86){_0x50ae25[_0xa2f3('0x1d')]=_0x3c5b86;if(_0x210a42[_0xa2f3('0x31')][_0xa2f3('0x41')]){_0x253fed['include']=[{'all':!![]}];}return db[_0xa2f3('0x2b')][_0xa2f3('0x42')](_0x253fed);})[_0xa2f3('0x23')](function(_0x2edc0b){_0x50ae25[_0xa2f3('0x43')]=_0x2edc0b;return _0x50ae25;})[_0xa2f3('0x23')](respondWithFilteredResult(_0x2e8291,_0x253fed))[_0xa2f3('0x44')](handleError(_0x2e8291,null));};exports[_0xa2f3('0x45')]=function(_0x3bd9b8,_0x14ade4){var _0x45a1e6={'raw':![],'where':{'id':_0x3bd9b8['params']['id']}},_0x689686={};_0x689686[_0xa2f3('0x30')]=_['keys'](db[_0xa2f3('0x2b')][_0xa2f3('0x2c')]);_0x689686[_0xa2f3('0x31')]=_[_0xa2f3('0x32')](_0x3bd9b8['query']);_0x689686[_0xa2f3('0x33')]=_[_0xa2f3('0x34')](_0x689686['model'],_0x689686['query']);_0x45a1e6[_0xa2f3('0x36')]=_[_0xa2f3('0x34')](_0x689686[_0xa2f3('0x30')],qs[_0xa2f3('0x35')](_0x3bd9b8[_0xa2f3('0x31')]['fields']));_0x45a1e6['attributes']=_0x45a1e6['attributes'][_0xa2f3('0x37')]?_0x45a1e6[_0xa2f3('0x36')]:_0x689686[_0xa2f3('0x30')];if(_0x3bd9b8[_0xa2f3('0x31')]['includeAll']){_0x45a1e6[_0xa2f3('0x46')]=[{'all':!![]}];}_0x45a1e6=_[_0xa2f3('0x3d')]({},_0x45a1e6,_0x3bd9b8[_0xa2f3('0x40')]);return db[_0xa2f3('0x2b')]['find'](_0x45a1e6)['then'](handleEntityNotFound(_0x14ade4,null))[_0xa2f3('0x23')](respondWithResult(_0x14ade4,null))[_0xa2f3('0x44')](handleError(_0x14ade4,null));};exports[_0xa2f3('0x47')]=function(_0x5b8403,_0xe2ad3){return db['JscriptyProject'][_0xa2f3('0x47')](_0x5b8403['body'],{})[_0xa2f3('0x23')](function(_0x31ba95){var _0x30aea0=_0x5b8403[_0xa2f3('0x48')][_0xa2f3('0x25')]({'plain':!![]});if(!_0x30aea0)throw new Error(_0xa2f3('0x49'));if(_0x30aea0[_0xa2f3('0x4a')]==='user'){var _0x5c634c=_0x31ba95[_0xa2f3('0x25')]({'plain':!![]});var _0x2b0a42=_0xa2f3('0x26');return db[_0xa2f3('0x4b')][_0xa2f3('0x4c')]({'where':{'name':_0x2b0a42,'userProfileId':_0x30aea0[_0xa2f3('0x4d')]},'raw':!![]})['then'](function(_0x473e7d){if(_0x473e7d&&_0x473e7d[_0xa2f3('0x4e')]===0x0){return db['UserProfileResource'][_0xa2f3('0x47')]({'name':_0x5c634c['name'],'resourceId':_0x5c634c['id'],'type':_0x473e7d[_0xa2f3('0x28')],'sectionId':_0x473e7d['id']},{})[_0xa2f3('0x23')](function(){return _0x31ba95;});}else{return _0x31ba95;}})[_0xa2f3('0x44')](function(_0x5735e4){logger[_0xa2f3('0x27')](_0xa2f3('0x4f'),_0x5735e4);throw _0x5735e4;});}return _0x31ba95;})[_0xa2f3('0x23')](respondWithResult(_0xe2ad3,0xc9))[_0xa2f3('0x44')](handleError(_0xe2ad3,null));};exports[_0xa2f3('0x50')]=function(_0x38ca14,_0x44279c){var _0x2de39f={'where':{'id':_0x38ca14['params']['id']}},_0x1b737f={};_0x1b737f[_0xa2f3('0x30')]=_[_0xa2f3('0x32')](db[_0xa2f3('0x2b')][_0xa2f3('0x2c')]);_0x2de39f[_0xa2f3('0x36')]=_[_0xa2f3('0x34')](_0x1b737f['model'],qs[_0xa2f3('0x35')](_0x38ca14['query']['fields']));_0x2de39f['attributes']=_0x2de39f[_0xa2f3('0x36')][_0xa2f3('0x37')]?_0x2de39f[_0xa2f3('0x36')]:_0x1b737f[_0xa2f3('0x30')];if(_0x38ca14['query'][_0xa2f3('0x41')]){_0x2de39f[_0xa2f3('0x46')]=[{'all':!![]}];}_0x2de39f=_['merge']({},_0x2de39f,_0x38ca14[_0xa2f3('0x40')]);return db[_0xa2f3('0x2b')][_0xa2f3('0x4c')](_0x2de39f)['then'](handleEntityNotFound(_0x44279c,null))[_0xa2f3('0x23')](function(_0x573432){if(_0x573432){var _0x40cbee=_0x573432[_0xa2f3('0x25')]({'plain':!![]});_0x40cbee=qs[_0xa2f3('0x51')](_0x40cbee,['id',_0xa2f3('0x52'),_0xa2f3('0x53')]);_0x38ca14[_0xa2f3('0x54')]=_[_0xa2f3('0x51')](_0x38ca14[_0xa2f3('0x54')],['id','createdAt',_0xa2f3('0x53')]);return db[_0xa2f3('0x2b')][_0xa2f3('0x47')](_['merge'](_0x40cbee,_0x38ca14[_0xa2f3('0x54')]),{'include':_0x38ca14['query']['includeAll']?[{'all':!![]}]:undefined})[_0xa2f3('0x23')](function(_0xbfaaed){var _0x5408fb=_0x38ca14[_0xa2f3('0x48')][_0xa2f3('0x25')]({'plain':!![]});if(!_0x5408fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5408fb[_0xa2f3('0x4a')]==='user'){var _0x41f629=_0xbfaaed['get']({'plain':!![]});var _0x28f6ad=_0xa2f3('0x26');return db[_0xa2f3('0x4b')][_0xa2f3('0x4c')]({'where':{'name':_0x28f6ad,'userProfileId':_0x5408fb['userProfileId']},'raw':!![]})[_0xa2f3('0x23')](function(_0x50c927){if(_0x50c927&&_0x50c927[_0xa2f3('0x4e')]===0x0){return db[_0xa2f3('0x55')][_0xa2f3('0x47')]({'name':_0x41f629[_0xa2f3('0x28')],'resourceId':_0x41f629['id'],'type':_0x50c927['name'],'sectionId':_0x50c927['id']},{})[_0xa2f3('0x23')](function(){return _0xbfaaed;});}else{return _0xbfaaed;}})[_0xa2f3('0x44')](function(_0x2fcf8f){logger[_0xa2f3('0x27')](_0xa2f3('0x4f'),_0x2fcf8f);throw _0x2fcf8f;});}return _0xbfaaed;});}})[_0xa2f3('0x23')](respondWithResult(_0x44279c,0xc9))['catch'](handleError(_0x44279c,null));};exports['update']=function(_0x1d2c6c,_0x3dca89){if(_0x1d2c6c[_0xa2f3('0x54')]['id']){delete _0x1d2c6c[_0xa2f3('0x54')]['id'];}return db[_0xa2f3('0x2b')][_0xa2f3('0x4c')]({'where':{'id':_0x1d2c6c[_0xa2f3('0x56')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x3dca89,null))[_0xa2f3('0x23')](saveUpdates(_0x1d2c6c[_0xa2f3('0x54')],null))[_0xa2f3('0x23')](respondWithResult(_0x3dca89,null))[_0xa2f3('0x44')](handleError(_0x3dca89,null));};exports['destroy']=function(_0x5adfe3,_0x4ff774){return db[_0xa2f3('0x2b')]['find']({'where':{'id':_0x5adfe3[_0xa2f3('0x56')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x4ff774,null))[_0xa2f3('0x23')](removeEntity(_0x4ff774,null))[_0xa2f3('0x44')](handleError(_0x4ff774,null));};exports[_0xa2f3('0x57')]=function(_0xff6ffd,_0x5bfc61,_0x2a03f5){var _0x5bbf3a={'raw':!![],'where':{}};var _0x2debbf={};var _0xe77695={'count':0x0,'rows':[]};return db[_0xa2f3('0x2b')]['findOne']({'where':{'id':_0xff6ffd[_0xa2f3('0x56')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x5bfc61,null))['then'](function(_0x21c87d){if(_0x21c87d){_0x2debbf[_0xa2f3('0x30')]=_[_0xa2f3('0x32')](db[_0xa2f3('0x58')]['rawAttributes']);_0x2debbf[_0xa2f3('0x31')]=_[_0xa2f3('0x32')](_0xff6ffd[_0xa2f3('0x31')]);_0x2debbf['filters']=_['intersection'](_0x2debbf[_0xa2f3('0x30')],_0x2debbf[_0xa2f3('0x31')]);_0x5bbf3a[_0xa2f3('0x36')]=_[_0xa2f3('0x34')](_0x2debbf[_0xa2f3('0x30')],qs[_0xa2f3('0x35')](_0xff6ffd[_0xa2f3('0x31')][_0xa2f3('0x35')]));_0x5bbf3a[_0xa2f3('0x36')]=_0x5bbf3a[_0xa2f3('0x36')]['length']?_0x5bbf3a[_0xa2f3('0x36')]:_0x2debbf['model'];if(!_0xff6ffd['query'][_0xa2f3('0x38')](_0xa2f3('0x39'))){_0x5bbf3a[_0xa2f3('0x1e')]=qs['limit'](_0xff6ffd[_0xa2f3('0x31')][_0xa2f3('0x1e')]);_0x5bbf3a[_0xa2f3('0x1b')]=qs[_0xa2f3('0x1b')](_0xff6ffd[_0xa2f3('0x31')][_0xa2f3('0x1b')]);}_0x5bbf3a['order']=qs[_0xa2f3('0x59')](_0xff6ffd['query'][_0xa2f3('0x59')]);_0x5bbf3a[_0xa2f3('0x3b')]=qs[_0xa2f3('0x33')](_[_0xa2f3('0x3c')](_0xff6ffd[_0xa2f3('0x31')],_0x2debbf[_0xa2f3('0x33')]));_0x5bbf3a['where'][_0xa2f3('0x5a')]=_0x21c87d['id'];if(_0xff6ffd[_0xa2f3('0x31')][_0xa2f3('0x3f')]){_0x5bbf3a[_0xa2f3('0x3b')]=_[_0xa2f3('0x3d')](_0x5bbf3a[_0xa2f3('0x3b')],{'$or':_[_0xa2f3('0x2a')](_0x5bbf3a[_0xa2f3('0x36')],function(_0x33bc40){var _0x46671e={};_0x46671e[_0x33bc40]={'$like':'%'+_0xff6ffd['query'][_0xa2f3('0x3f')]+'%'};return _0x46671e;})});}_0x5bbf3a=_[_0xa2f3('0x3d')]({},_0x5bbf3a,_0xff6ffd[_0xa2f3('0x40')]);return db[_0xa2f3('0x58')][_0xa2f3('0x1d')]({'where':_0x5bbf3a[_0xa2f3('0x3b')]})[_0xa2f3('0x23')](function(_0x522ef7){_0xe77695[_0xa2f3('0x1d')]=_0x522ef7;if(_0xff6ffd[_0xa2f3('0x31')][_0xa2f3('0x41')]){_0x5bbf3a[_0xa2f3('0x46')]=[{'all':!![]}];}return db[_0xa2f3('0x58')]['findAll'](_0x5bbf3a);})[_0xa2f3('0x23')](function(_0x5a1355){_0xe77695[_0xa2f3('0x43')]=_0x5a1355;return _0xe77695;});}})[_0xa2f3('0x23')](respondWithFilteredResult(_0x5bfc61,_0x5bbf3a))[_0xa2f3('0x44')](handleError(_0x5bfc61,null));};exports[_0xa2f3('0x5b')]=function(_0x1ad2d3,_0x43ef1c,_0x283478){var _0x3789d6={'raw':!![],'where':{}};var _0x4a7203={};var _0x483e76={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x1ad2d3[_0xa2f3('0x56')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x43ef1c,null))['then'](function(_0x258a14){if(_0x258a14){_0x4a7203[_0xa2f3('0x30')]=_[_0xa2f3('0x32')](db[_0xa2f3('0x5c')]['rawAttributes']);_0x4a7203[_0xa2f3('0x31')]=_['keys'](_0x1ad2d3[_0xa2f3('0x31')]);_0x4a7203[_0xa2f3('0x33')]=_[_0xa2f3('0x34')](_0x4a7203['model'],_0x4a7203[_0xa2f3('0x31')]);_0x3789d6['attributes']=_[_0xa2f3('0x34')](_0x4a7203[_0xa2f3('0x30')],qs['fields'](_0x1ad2d3[_0xa2f3('0x31')][_0xa2f3('0x35')]));_0x3789d6[_0xa2f3('0x36')]=_0x3789d6[_0xa2f3('0x36')]['length']?_0x3789d6[_0xa2f3('0x36')]:_0x4a7203[_0xa2f3('0x30')];if(!_0x1ad2d3[_0xa2f3('0x31')][_0xa2f3('0x38')]('nolimit')){_0x3789d6[_0xa2f3('0x1e')]=qs['limit'](_0x1ad2d3[_0xa2f3('0x31')][_0xa2f3('0x1e')]);_0x3789d6[_0xa2f3('0x1b')]=qs[_0xa2f3('0x1b')](_0x1ad2d3['query'][_0xa2f3('0x1b')]);}_0x3789d6['order']=qs[_0xa2f3('0x59')](_0x1ad2d3[_0xa2f3('0x31')]['sort']);_0x3789d6['where']=qs[_0xa2f3('0x33')](_[_0xa2f3('0x3c')](_0x1ad2d3['query'],_0x4a7203['filters']));_0x3789d6[_0xa2f3('0x3b')][_0xa2f3('0x5a')]=_0x258a14['id'];if(_0x1ad2d3[_0xa2f3('0x31')][_0xa2f3('0x3f')]){_0x3789d6[_0xa2f3('0x3b')]=_[_0xa2f3('0x3d')](_0x3789d6[_0xa2f3('0x3b')],{'$or':_[_0xa2f3('0x2a')](_0x3789d6[_0xa2f3('0x36')],function(_0x3ed645){var _0x447b65={};_0x447b65[_0x3ed645]={'$like':'%'+_0x1ad2d3[_0xa2f3('0x31')][_0xa2f3('0x3f')]+'%'};return _0x447b65;})});}_0x3789d6=_[_0xa2f3('0x3d')]({},_0x3789d6,_0x1ad2d3[_0xa2f3('0x40')]);return db[_0xa2f3('0x5c')][_0xa2f3('0x1d')]({'where':_0x3789d6['where']})[_0xa2f3('0x23')](function(_0x97d4c0){_0x483e76[_0xa2f3('0x1d')]=_0x97d4c0;if(_0x1ad2d3[_0xa2f3('0x31')][_0xa2f3('0x41')]){_0x3789d6['include']=[{'all':!![]}];}return db[_0xa2f3('0x5c')]['findAll'](_0x3789d6);})[_0xa2f3('0x23')](function(_0x4076c9){_0x483e76['rows']=_0x4076c9;return _0x483e76;});}})[_0xa2f3('0x23')](respondWithFilteredResult(_0x43ef1c,_0x3789d6))[_0xa2f3('0x44')](handleError(_0x43ef1c,null));};function char(_0x2219e4){return _0xa2f3('0x5d')===typeof _0x2219e4?String[_0xa2f3('0x5e')][_0xa2f3('0x20')](null,arguments):_0x2219e4;}function needsEncapsulation(_0x298b0e){return!!_0x298b0e&&(_0x298b0e[_0xa2f3('0x5f')]()[_0xa2f3('0x60')](char(0xd))>=0x0||_0x298b0e[_0xa2f3('0x5f')]()[_0xa2f3('0x60')](char(0xa))>=0x0||_0x298b0e[_0xa2f3('0x5f')]()[_0xa2f3('0x60')](char(0x2c))>=0x0||_0x298b0e[_0xa2f3('0x5f')]()[_0xa2f3('0x60')](char(0x22))>=0x0);}function encapsulate(_0x443d26){var _0x374e0f=char(0x22),_0x39d6d6='\x5c'+char(0x22),_0x84246f=_0x443d26[_0xa2f3('0x5f')]()[_0xa2f3('0x61')](new RegExp(_0x374e0f,'g'),_0x39d6d6);return _0x374e0f+_0x84246f+_0x374e0f;}exports[_0xa2f3('0x62')]=function(_0x120988,_0x5c2a69,_0x21a291){var _0x76816a,_0x3b87b4;var _0x3a2223={'where':{'ProjectId':_0x120988[_0xa2f3('0x56')]['id']}};if(_0x120988['query'][_0xa2f3('0x63')]){_0x3a2223[_0xa2f3('0x3b')][_0xa2f3('0x64')]=JSON[_0xa2f3('0x65')](_0x120988[_0xa2f3('0x31')][_0xa2f3('0x63')]);}return db[_0xa2f3('0x58')][_0xa2f3('0x42')](_0x3a2223)[_0xa2f3('0x23')](handleEntityNotFound(_0x5c2a69,null))[_0xa2f3('0x23')](function(_0x2b6a68){if(_0x2b6a68){_0x76816a=_0x2b6a68;return db[_0xa2f3('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0xa2f3('0x2a')](_0x76816a,'id')},'ProjectId':_0x120988[_0xa2f3('0x56')]['id']},'order':_0xa2f3('0x67')});}})[_0xa2f3('0x23')](handleEntityNotFound(_0x5c2a69,null))['then'](function(_0x4603b8){if(_0x4603b8){_0x3b87b4=_0x4603b8;var _0x4ea4ce={};for(var _0x316eaa=0x0,_0x213837=_0x3b87b4[_0xa2f3('0x37')];_0x316eaa<_0x213837;_0x316eaa++){if(!_0x4ea4ce[_0xa2f3('0x38')](_0x3b87b4[_0x316eaa][_0xa2f3('0x68')])){_0x4ea4ce[_0x3b87b4[_0x316eaa][_0xa2f3('0x68')]]=needsEncapsulation(_0x3b87b4[_0x316eaa]['question'])?encapsulate(_0x3b87b4[_0x316eaa]['question']):_0x3b87b4[_0x316eaa]['question'];}}var _0x26a21e=[],_0x1d8956={};for(var _0x182338=0x0,_0x164bcc=_0x76816a['length'];_0x182338<_0x164bcc;_0x182338++){_0x1d8956={'ProjectId':_0x120988[_0xa2f3('0x56')]['id'],'SessionId':_0x76816a[_0x182338]['id'],'StartTime':moment(_0x76816a[_0x182338][_0xa2f3('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x169513=0x0,_0x43634f=_0x3b87b4[_0xa2f3('0x37')];_0x169513<_0x43634f;_0x169513++){if(_0x3b87b4[_0x169513]['SessionId']==_0x76816a[_0x182338]['id']&&_0x4ea4ce[_0xa2f3('0x38')](_0x3b87b4[_0x169513][_0xa2f3('0x68')])){_0x1d8956[_0x4ea4ce[_0x3b87b4[_0x169513][_0xa2f3('0x68')]]]=_0x3b87b4[_0x169513][_0xa2f3('0x69')];}}for(var _0x36715b in _0x4ea4ce){if(!_0x1d8956[_0xa2f3('0x38')](_0x4ea4ce[_0x36715b])){_0x1d8956[_0x4ea4ce[_0x36715b]]=null;}}_0x26a21e['push'](_0x1d8956);}return _0x26a21e;}})['then'](function(_0x444c24){if(!_[_0xa2f3('0x6a')](_0x444c24)){var _0x5c3390=toCsv(_0x444c24);var _0x524aa2=Date['now']();fs[_0xa2f3('0x6b')](util['format'](_0xa2f3('0x6c'),_0x120988[_0xa2f3('0x56')]['id'],_0x524aa2),_0x5c3390);_0x5c2a69[_0xa2f3('0x6d')](_0xa2f3('0x6e'),'attachment;\x20filename='+util[_0xa2f3('0x6f')](_0xa2f3('0x70'),_0x120988[_0xa2f3('0x56')]['id'],_0x524aa2));_0x5c2a69[_0xa2f3('0x6d')](_0xa2f3('0x71'),_0xa2f3('0x72'));return _0x5c2a69['download'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x120988[_0xa2f3('0x56')]['id'],_0x524aa2));}else{return _0x5c2a69['sendStatus'](0xcc);}})[_0xa2f3('0x44')](handleError(_0x5c2a69,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5057837..822a170 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 _0xdc97=['path','../../config/environment','./jscriptyProject.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x5676d3,_0x582062){var _0x573736=function(_0x3760bc){while(--_0x3760bc){_0x5676d3['push'](_0x5676d3['shift']());}};_0x573736(++_0x582062);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3c3847,_0x112c51){_0x3c3847=_0x3c3847-0x0;var _0x27c9eb=_0xdc97[_0x3c3847];return _0x27c9eb;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c49=['jscripty_projects','lodash','util','moment','request-promise','path','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x7c49,0x141));var _0x97c4=function(_0xe393cb,_0x2aca4b){_0xe393cb=_0xe393cb-0x0;var _0x104375=_0x7c49[_0xe393cb];return _0x104375;};'use strict';var _=require(_0x97c4('0x0'));var util=require(_0x97c4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x97c4('0x2'));var BPromise=require('bluebird');var rp=require(_0x97c4('0x3'));var fs=require('fs');var path=require(_0x97c4('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x97c4('0x5'));module[_0x97c4('0x6')]=function(_0x2f02ec,_0x538c14){return _0x2f02ec[_0x97c4('0x7')](_0x97c4('0x8'),attributes,{'tableName':_0x97c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 1b68e7e..8b6e525 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x51f240,_0x14ec3f){var _0x4b7a1f=function(_0x136c29){while(--_0x136c29){_0x51f240['push'](_0x51f240['shift']());}};_0x4b7a1f(++_0x14ec3f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xcb91[_0x1602ef];return _0x5870ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _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(_0x289af9,_0xdf6cf0){var _0x5e0edb=function(_0x4ebd8d){while(--_0x4ebd8d){_0x289af9['push'](_0x289af9['shift']());}};_0x5e0edb(++_0xdf6cf0);}(_0xaa88,0x137));var _0x8aa8=function(_0x4c70c4,_0x963969){_0x4c70c4=_0x4c70c4-0x0;var _0x437865=_0xaa88[_0x4c70c4];return _0x437865;};'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 609e1d3..af4c5e8 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 _0x8690=['isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./jscriptyQuestionReport.controller','get'];(function(_0x2d991c,_0x1583d4){var _0x3d5af5=function(_0x4401aa){while(--_0x4401aa){_0x2d991c['push'](_0x2d991c['shift']());}};_0x3d5af5(++_0x1583d4);}(_0x8690,0xdc));var _0x0869=function(_0x2b8722,_0x50d540){_0x2b8722=_0x2b8722-0x0;var _0x20c180=_0x8690[_0x2b8722];return _0x20c180;};'use strict';var multer=require(_0x0869('0x0'));var util=require('util');var path=require(_0x0869('0x1'));var timeout=require(_0x0869('0x2'));var express=require(_0x0869('0x3'));var router=express[_0x0869('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0869('0x5'));var config=require('../../config/environment');var controller=require(_0x0869('0x6'));router[_0x0869('0x7')]('/',auth[_0x0869('0x8')](),controller[_0x0869('0x9')]);router[_0x0869('0x7')](_0x0869('0xa'),auth[_0x0869('0x8')](),controller[_0x0869('0xb')]);router[_0x0869('0x7')](_0x0869('0xc'),auth[_0x0869('0x8')](),controller[_0x0869('0xd')]);router['post']('/',auth[_0x0869('0x8')](),controller[_0x0869('0xe')]);router['put'](_0x0869('0xc'),auth[_0x0869('0x8')](),controller[_0x0869('0xf')]);router[_0x0869('0x10')](_0x0869('0xc'),auth[_0x0869('0x8')](),controller[_0x0869('0x11')]);module[_0x0869('0x12')]=router; \ No newline at end of file +var _0x70d6=['../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','delete','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x3fea84,_0x3e832f){var _0x20778a=function(_0x134027){while(--_0x134027){_0x3fea84['push'](_0x3fea84['shift']());}};_0x20778a(++_0x3e832f);}(_0x70d6,0xaf));var _0x670d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x70d6[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x670d('0x0'));var util=require(_0x670d('0x1'));var path=require('path');var timeout=require(_0x670d('0x2'));var express=require('express');var router=express[_0x670d('0x3')]();var fs_extra=require(_0x670d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x670d('0x5'));var config=require(_0x670d('0x6'));var controller=require(_0x670d('0x7'));router['get']('/',auth[_0x670d('0x8')](),controller[_0x670d('0x9')]);router[_0x670d('0xa')](_0x670d('0xb'),auth[_0x670d('0x8')](),controller['describe']);router[_0x670d('0xa')](_0x670d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x670d('0xd')]('/',auth[_0x670d('0x8')](),controller[_0x670d('0xe')]);router[_0x670d('0xf')](_0x670d('0xc'),auth[_0x670d('0x8')](),controller['update']);router[_0x670d('0x10')](_0x670d('0xc'),auth[_0x670d('0x8')](),controller['destroy']);module[_0x670d('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 18e1b5b..de6b5c9 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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0xa29442,_0x8d5cde){_0xa29442=_0xa29442-0x0;var _0x385c21=_0x7a54[_0xa29442];return _0x385c21;};'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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x1784e8,_0x310cb4){_0x1784e8=_0x1784e8-0x0;var _0x49b103=_0x7a54[_0x1784e8];return _0x49b103;};'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 51f9d2d..453046e 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 _0x6cad=['params','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','VIRTUAL','filter','options','include','show','includeAll','catch','create','body','find'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x6cad,0x8e));var _0xd6ca=function(_0x55672b,_0x675dd3){_0x55672b=_0x55672b-0x0;var _0x3e3ec4=_0x6cad[_0x55672b];return _0x3e3ec4;};'use strict';var emlformat=require(_0xd6ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6ca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6ca('0x2'));var moment=require('moment');var BPromise=require(_0xd6ca('0x3'));var Mustache=require(_0xd6ca('0x4'));var util=require(_0xd6ca('0x5'));var path=require(_0xd6ca('0x6'));var sox=require('sox');var csv=require(_0xd6ca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6ca('0x8'));var _=require(_0xd6ca('0x9'));var squel=require(_0xd6ca('0xa'));var crypto=require(_0xd6ca('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd6ca('0x7'));var querystring=require(_0xd6ca('0xc'));var Papa=require(_0xd6ca('0xd'));var Redis=require('ioredis');var authService=require(_0xd6ca('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6ca('0xf'))('api');var utils=require(_0xd6ca('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xd6ca('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x259491,_0x14fcde){_0x14fcde=_0x14fcde||0xcc;return function(_0x3a9c0a){if(_0x3a9c0a){return _0x259491[_0xd6ca('0x12')](_0x14fcde);}return _0x259491[_0xd6ca('0x13')](_0x14fcde)[_0xd6ca('0x14')]();};}function respondWithResult(_0x4d11d3,_0x314730){_0x314730=_0x314730||0xc8;return function(_0x1e8f3c){if(_0x1e8f3c){return _0x4d11d3[_0xd6ca('0x13')](_0x314730)[_0xd6ca('0x15')](_0x1e8f3c);}};}function respondWithFilteredResult(_0x9d8d68,_0x540a15){return function(_0x15c7cc){if(_0x15c7cc){var _0x48ebf2=typeof _0x540a15[_0xd6ca('0x16')]===_0xd6ca('0x17')&&typeof _0x540a15[_0xd6ca('0x18')]===_0xd6ca('0x17');var _0x2f8142=_0x15c7cc[_0xd6ca('0x19')];var _0x438681=_0x48ebf2?0x0:_0x540a15[_0xd6ca('0x16')];var _0x1172d5=_0x48ebf2?_0x15c7cc[_0xd6ca('0x19')]:_0x540a15[_0xd6ca('0x16')]+_0x540a15[_0xd6ca('0x18')];var _0x3beae6;if(_0x1172d5>=_0x2f8142){_0x1172d5=_0x2f8142;_0x3beae6=0xc8;}else{_0x3beae6=0xce;}_0x9d8d68[_0xd6ca('0x13')](_0x3beae6);return _0x9d8d68[_0xd6ca('0x1a')](_0xd6ca('0x1b'),_0x438681+'-'+_0x1172d5+'/'+_0x2f8142)[_0xd6ca('0x15')](_0x15c7cc);}return null;};}function patchUpdates(_0x1f2357){return function(_0x33d688){try{jsonpatch[_0xd6ca('0x1c')](_0x33d688,_0x1f2357,!![]);}catch(_0x246dbe){return BPromise[_0xd6ca('0x1d')](_0x246dbe);}return _0x33d688['save']();};}function saveUpdates(_0x3626f7,_0x536e50){return function(_0x5a304b){if(_0x5a304b){return _0x5a304b[_0xd6ca('0x1e')](_0x3626f7)['then'](function(_0x564ce0){return _0x564ce0;});}return null;};}function removeEntity(_0x4c3bc5,_0x9844e2){return function(_0x3e57a7){if(_0x3e57a7){return _0x3e57a7[_0xd6ca('0x1f')]()[_0xd6ca('0x20')](function(){_0x4c3bc5[_0xd6ca('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b2a0,_0x156b00){return function(_0x47652a){if(!_0x47652a){_0x45b2a0['sendStatus'](0x194);}return _0x47652a;};}function handleError(_0x4906e5,_0x316062){_0x316062=_0x316062||0x1f4;return function(_0x1a05f4){logger[_0xd6ca('0x21')](_0x1a05f4[_0xd6ca('0x22')]);if(_0x1a05f4[_0xd6ca('0x23')]){delete _0x1a05f4['name'];}_0x4906e5['status'](_0x316062)[_0xd6ca('0x24')](_0x1a05f4);};}exports[_0xd6ca('0x25')]=function(_0x4c35ed,_0x2965f3){var _0x1b47fd={},_0x81a549={},_0x484ca8={'count':0x0,'rows':[]};var _0xb1b7a8=_[_0xd6ca('0x26')](db[_0xd6ca('0x27')][_0xd6ca('0x28')],function(_0x2c4989){return{'name':_0x2c4989[_0xd6ca('0x29')],'type':_0x2c4989[_0xd6ca('0x2a')][_0xd6ca('0x2b')]};});_0x81a549['model']=_['map'](_0xb1b7a8,'name');_0x81a549[_0xd6ca('0x2c')]=_[_0xd6ca('0x2d')](_0x4c35ed[_0xd6ca('0x2c')]);_0x81a549['filters']=_[_0xd6ca('0x2e')](_0x81a549[_0xd6ca('0x2f')],_0x81a549[_0xd6ca('0x2c')]);_0x1b47fd[_0xd6ca('0x30')]=_[_0xd6ca('0x2e')](_0x81a549['model'],qs[_0xd6ca('0x31')](_0x4c35ed[_0xd6ca('0x2c')][_0xd6ca('0x31')]));_0x1b47fd['attributes']=_0x1b47fd[_0xd6ca('0x30')][_0xd6ca('0x32')]?_0x1b47fd[_0xd6ca('0x30')]:_0x81a549[_0xd6ca('0x2f')];if(!_0x4c35ed['query'][_0xd6ca('0x33')](_0xd6ca('0x34'))){_0x1b47fd[_0xd6ca('0x18')]=qs[_0xd6ca('0x18')](_0x4c35ed[_0xd6ca('0x2c')]['limit']);_0x1b47fd[_0xd6ca('0x16')]=qs[_0xd6ca('0x16')](_0x4c35ed[_0xd6ca('0x2c')]['offset']);}_0x1b47fd[_0xd6ca('0x35')]=qs['sort'](_0x4c35ed[_0xd6ca('0x2c')][_0xd6ca('0x36')]);_0x1b47fd['where']=qs['filters'](_['pick'](_0x4c35ed[_0xd6ca('0x2c')],_0x81a549[_0xd6ca('0x37')]),_0xb1b7a8);if(_0x4c35ed[_0xd6ca('0x2c')]['filter']){_0x1b47fd['where']=_[_0xd6ca('0x38')](_0x1b47fd[_0xd6ca('0x39')],{'$or':_[_0xd6ca('0x26')](_0xb1b7a8,function(_0x27e954){if(_0x27e954['type']!==_0xd6ca('0x3a')){var _0x41aa96={};_0x41aa96[_0x27e954[_0xd6ca('0x23')]]={'$like':'%'+_0x4c35ed[_0xd6ca('0x2c')][_0xd6ca('0x3b')]+'%'};return _0x41aa96;}})});}_0x1b47fd=_[_0xd6ca('0x38')]({},_0x1b47fd,_0x4c35ed[_0xd6ca('0x3c')]);var _0x4e7c05={'where':_0x1b47fd[_0xd6ca('0x39')]};return db[_0xd6ca('0x27')][_0xd6ca('0x19')](_0x4e7c05)[_0xd6ca('0x20')](function(_0x543167){_0x484ca8[_0xd6ca('0x19')]=_0x543167;if(_0x4c35ed[_0xd6ca('0x2c')]['includeAll']){_0x1b47fd[_0xd6ca('0x3d')]=[{'all':!![]}];}return db[_0xd6ca('0x27')]['findAll'](_0x1b47fd);})[_0xd6ca('0x20')](function(_0x159bad){_0x484ca8['rows']=_0x159bad;return _0x484ca8;})[_0xd6ca('0x20')](respondWithFilteredResult(_0x2965f3,_0x1b47fd))['catch'](handleError(_0x2965f3,null));};exports[_0xd6ca('0x3e')]=function(_0x2dfd66,_0x36db5b){var _0x12f85b={'raw':!![],'where':{'id':_0x2dfd66['params']['id']}},_0x1bc5f3={};_0x1bc5f3[_0xd6ca('0x2f')]=_[_0xd6ca('0x2d')](db[_0xd6ca('0x27')][_0xd6ca('0x28')]);_0x1bc5f3[_0xd6ca('0x2c')]=_[_0xd6ca('0x2d')](_0x2dfd66[_0xd6ca('0x2c')]);_0x1bc5f3['filters']=_[_0xd6ca('0x2e')](_0x1bc5f3['model'],_0x1bc5f3[_0xd6ca('0x2c')]);_0x12f85b['attributes']=_[_0xd6ca('0x2e')](_0x1bc5f3['model'],qs[_0xd6ca('0x31')](_0x2dfd66[_0xd6ca('0x2c')][_0xd6ca('0x31')]));_0x12f85b[_0xd6ca('0x30')]=_0x12f85b['attributes'][_0xd6ca('0x32')]?_0x12f85b['attributes']:_0x1bc5f3['model'];if(_0x2dfd66[_0xd6ca('0x2c')][_0xd6ca('0x3f')]){_0x12f85b[_0xd6ca('0x3d')]=[{'all':!![]}];}_0x12f85b=_[_0xd6ca('0x38')]({},_0x12f85b,_0x2dfd66['options']);return db[_0xd6ca('0x27')]['find'](_0x12f85b)[_0xd6ca('0x20')](handleEntityNotFound(_0x36db5b,null))['then'](respondWithResult(_0x36db5b,null))[_0xd6ca('0x40')](handleError(_0x36db5b,null));};exports[_0xd6ca('0x41')]=function(_0x32192a,_0x19d4ed){return db['JscriptyQuestionReport'][_0xd6ca('0x41')](_0x32192a['body'],{})[_0xd6ca('0x20')](respondWithResult(_0x19d4ed,0xc9))[_0xd6ca('0x40')](handleError(_0x19d4ed,null));};exports[_0xd6ca('0x1e')]=function(_0x2d4e41,_0x5ca586){if(_0x2d4e41[_0xd6ca('0x42')]['id']){delete _0x2d4e41[_0xd6ca('0x42')]['id'];}return db[_0xd6ca('0x27')][_0xd6ca('0x43')]({'where':{'id':_0x2d4e41[_0xd6ca('0x44')]['id']}})[_0xd6ca('0x20')](handleEntityNotFound(_0x5ca586,null))[_0xd6ca('0x20')](saveUpdates(_0x2d4e41[_0xd6ca('0x42')],null))[_0xd6ca('0x20')](respondWithResult(_0x5ca586,null))[_0xd6ca('0x40')](handleError(_0x5ca586,null));};exports['destroy']=function(_0x403781,_0xa90dbb){return db['JscriptyQuestionReport'][_0xd6ca('0x43')]({'where':{'id':_0x403781[_0xd6ca('0x44')]['id']}})['then'](handleEntityNotFound(_0xa90dbb,null))[_0xd6ca('0x20')](removeEntity(_0xa90dbb,null))[_0xd6ca('0x40')](handleError(_0xa90dbb,null));};exports[_0xd6ca('0x45')]=function(_0x31fbff,_0x1faa1d){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0x1faa1d,null))['catch'](handleError(_0x1faa1d,null));}; \ No newline at end of file +var _0xed76=['rawAttributes','includeAll','merge','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','JscriptyQuestionReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','filter','options','include','findAll','rows','catch','show','params'];(function(_0x1fe21d,_0x5229e4){var _0x399a59=function(_0x34e061){while(--_0x34e061){_0x1fe21d['push'](_0x1fe21d['shift']());}};_0x399a59(++_0x5229e4);}(_0xed76,0x9b));var _0x6ed7=function(_0x366018,_0x5e43cf){_0x366018=_0x366018-0x0;var _0x232389=_0xed76[_0x366018];return _0x232389;};'use strict';var emlformat=require(_0x6ed7('0x0'));var rimraf=require(_0x6ed7('0x1'));var zipdir=require(_0x6ed7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ed7('0x3'));var Mustache=require(_0x6ed7('0x4'));var util=require(_0x6ed7('0x5'));var path=require(_0x6ed7('0x6'));var sox=require(_0x6ed7('0x7'));var csv=require('to-csv');var ejs=require(_0x6ed7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ed7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6ed7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6ed7('0xb'));var querystring=require(_0x6ed7('0xc'));var Papa=require(_0x6ed7('0xd'));var Redis=require('ioredis');var authService=require(_0x6ed7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6ed7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ed7('0x10'))(_0x6ed7('0x11'));var utils=require(_0x6ed7('0x12'));var config=require(_0x6ed7('0x13'));var licenseUtil=require(_0x6ed7('0x14'));var db=require(_0x6ed7('0x15'))['db'];function respondWithStatusCode(_0xb32d17,_0x55cd54){_0x55cd54=_0x55cd54||0xcc;return function(_0x3104a1){if(_0x3104a1){return _0xb32d17[_0x6ed7('0x16')](_0x55cd54);}return _0xb32d17['status'](_0x55cd54)['end']();};}function respondWithResult(_0x3ea5d1,_0x484a7e){_0x484a7e=_0x484a7e||0xc8;return function(_0x2120a7){if(_0x2120a7){return _0x3ea5d1[_0x6ed7('0x17')](_0x484a7e)[_0x6ed7('0x18')](_0x2120a7);}};}function respondWithFilteredResult(_0x107d38,_0x211572){return function(_0x210633){if(_0x210633){var _0x2ea2b5=typeof _0x211572[_0x6ed7('0x19')]==='undefined'&&typeof _0x211572[_0x6ed7('0x1a')]===_0x6ed7('0x1b');var _0x2278f3=_0x210633['count'];var _0x3f6266=_0x2ea2b5?0x0:_0x211572[_0x6ed7('0x19')];var _0x3a9f80=_0x2ea2b5?_0x210633[_0x6ed7('0x1c')]:_0x211572[_0x6ed7('0x19')]+_0x211572[_0x6ed7('0x1a')];var _0x131499;if(_0x3a9f80>=_0x2278f3){_0x3a9f80=_0x2278f3;_0x131499=0xc8;}else{_0x131499=0xce;}_0x107d38[_0x6ed7('0x17')](_0x131499);return _0x107d38[_0x6ed7('0x1d')](_0x6ed7('0x1e'),_0x3f6266+'-'+_0x3a9f80+'/'+_0x2278f3)[_0x6ed7('0x18')](_0x210633);}return null;};}function patchUpdates(_0x53e64c){return function(_0x50c289){try{jsonpatch[_0x6ed7('0x1f')](_0x50c289,_0x53e64c,!![]);}catch(_0x4b3fa6){return BPromise['reject'](_0x4b3fa6);}return _0x50c289[_0x6ed7('0x20')]();};}function saveUpdates(_0x39a595,_0x595b60){return function(_0x22e7a7){if(_0x22e7a7){return _0x22e7a7[_0x6ed7('0x21')](_0x39a595)[_0x6ed7('0x22')](function(_0x3e8eed){return _0x3e8eed;});}return null;};}function removeEntity(_0x507a80,_0x105b6d){return function(_0x180cc2){if(_0x180cc2){return _0x180cc2[_0x6ed7('0x23')]()[_0x6ed7('0x22')](function(){_0x507a80[_0x6ed7('0x17')](0xcc)[_0x6ed7('0x24')]();});}};}function handleEntityNotFound(_0x4cb63b,_0x3e7910){return function(_0x13cfc9){if(!_0x13cfc9){_0x4cb63b[_0x6ed7('0x16')](0x194);}return _0x13cfc9;};}function handleError(_0x1d3bd7,_0x96a119){_0x96a119=_0x96a119||0x1f4;return function(_0x4fc6b8){logger['error'](_0x4fc6b8[_0x6ed7('0x25')]);if(_0x4fc6b8[_0x6ed7('0x26')]){delete _0x4fc6b8[_0x6ed7('0x26')];}_0x1d3bd7[_0x6ed7('0x17')](_0x96a119)[_0x6ed7('0x27')](_0x4fc6b8);};}exports[_0x6ed7('0x28')]=function(_0x2df78e,_0xff82b){var _0x41ebf8={},_0x2fa146={},_0x33604c={'count':0x0,'rows':[]};var _0x589f62=_['map'](db[_0x6ed7('0x29')]['rawAttributes'],function(_0x44ec0d){return{'name':_0x44ec0d[_0x6ed7('0x2a')],'type':_0x44ec0d['type'][_0x6ed7('0x2b')]};});_0x2fa146['model']=_['map'](_0x589f62,'name');_0x2fa146[_0x6ed7('0x2c')]=_[_0x6ed7('0x2d')](_0x2df78e[_0x6ed7('0x2c')]);_0x2fa146[_0x6ed7('0x2e')]=_[_0x6ed7('0x2f')](_0x2fa146[_0x6ed7('0x30')],_0x2fa146[_0x6ed7('0x2c')]);_0x41ebf8[_0x6ed7('0x31')]=_[_0x6ed7('0x2f')](_0x2fa146[_0x6ed7('0x30')],qs[_0x6ed7('0x32')](_0x2df78e[_0x6ed7('0x2c')][_0x6ed7('0x32')]));_0x41ebf8[_0x6ed7('0x31')]=_0x41ebf8[_0x6ed7('0x31')][_0x6ed7('0x33')]?_0x41ebf8['attributes']:_0x2fa146[_0x6ed7('0x30')];if(!_0x2df78e['query'][_0x6ed7('0x34')]('nolimit')){_0x41ebf8['limit']=qs[_0x6ed7('0x1a')](_0x2df78e[_0x6ed7('0x2c')][_0x6ed7('0x1a')]);_0x41ebf8[_0x6ed7('0x19')]=qs[_0x6ed7('0x19')](_0x2df78e['query'][_0x6ed7('0x19')]);}_0x41ebf8[_0x6ed7('0x35')]=qs['sort'](_0x2df78e[_0x6ed7('0x2c')][_0x6ed7('0x36')]);_0x41ebf8[_0x6ed7('0x37')]=qs[_0x6ed7('0x2e')](_[_0x6ed7('0x38')](_0x2df78e[_0x6ed7('0x2c')],_0x2fa146[_0x6ed7('0x2e')]),_0x589f62);if(_0x2df78e['query']['filter']){_0x41ebf8['where']=_['merge'](_0x41ebf8['where'],{'$or':_[_0x6ed7('0x39')](_0x589f62,function(_0x5e2d67){if(_0x5e2d67['type']!==_0x6ed7('0x3a')){var _0x32a227={};_0x32a227[_0x5e2d67[_0x6ed7('0x26')]]={'$like':'%'+_0x2df78e['query'][_0x6ed7('0x3b')]+'%'};return _0x32a227;}})});}_0x41ebf8=_['merge']({},_0x41ebf8,_0x2df78e[_0x6ed7('0x3c')]);var _0x5a7635={'where':_0x41ebf8[_0x6ed7('0x37')]};return db[_0x6ed7('0x29')][_0x6ed7('0x1c')](_0x5a7635)[_0x6ed7('0x22')](function(_0x5cd81d){_0x33604c['count']=_0x5cd81d;if(_0x2df78e[_0x6ed7('0x2c')]['includeAll']){_0x41ebf8[_0x6ed7('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x6ed7('0x3e')](_0x41ebf8);})[_0x6ed7('0x22')](function(_0x1bc88c){_0x33604c[_0x6ed7('0x3f')]=_0x1bc88c;return _0x33604c;})[_0x6ed7('0x22')](respondWithFilteredResult(_0xff82b,_0x41ebf8))[_0x6ed7('0x40')](handleError(_0xff82b,null));};exports[_0x6ed7('0x41')]=function(_0x4733be,_0x3c7fd4){var _0x4de12e={'raw':!![],'where':{'id':_0x4733be[_0x6ed7('0x42')]['id']}},_0x59bd92={};_0x59bd92[_0x6ed7('0x30')]=_['keys'](db[_0x6ed7('0x29')][_0x6ed7('0x43')]);_0x59bd92['query']=_[_0x6ed7('0x2d')](_0x4733be['query']);_0x59bd92[_0x6ed7('0x2e')]=_['intersection'](_0x59bd92[_0x6ed7('0x30')],_0x59bd92[_0x6ed7('0x2c')]);_0x4de12e[_0x6ed7('0x31')]=_['intersection'](_0x59bd92[_0x6ed7('0x30')],qs['fields'](_0x4733be['query']['fields']));_0x4de12e[_0x6ed7('0x31')]=_0x4de12e['attributes'][_0x6ed7('0x33')]?_0x4de12e[_0x6ed7('0x31')]:_0x59bd92['model'];if(_0x4733be[_0x6ed7('0x2c')][_0x6ed7('0x44')]){_0x4de12e[_0x6ed7('0x3d')]=[{'all':!![]}];}_0x4de12e=_[_0x6ed7('0x45')]({},_0x4de12e,_0x4733be['options']);return db[_0x6ed7('0x29')][_0x6ed7('0x46')](_0x4de12e)[_0x6ed7('0x22')](handleEntityNotFound(_0x3c7fd4,null))['then'](respondWithResult(_0x3c7fd4,null))[_0x6ed7('0x40')](handleError(_0x3c7fd4,null));};exports[_0x6ed7('0x47')]=function(_0x3dfc82,_0x6a6196){return db[_0x6ed7('0x29')][_0x6ed7('0x47')](_0x3dfc82['body'],{})['then'](respondWithResult(_0x6a6196,0xc9))[_0x6ed7('0x40')](handleError(_0x6a6196,null));};exports[_0x6ed7('0x21')]=function(_0x3d2382,_0x5a861a){if(_0x3d2382['body']['id']){delete _0x3d2382[_0x6ed7('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x6ed7('0x46')]({'where':{'id':_0x3d2382[_0x6ed7('0x42')]['id']}})[_0x6ed7('0x22')](handleEntityNotFound(_0x5a861a,null))['then'](saveUpdates(_0x3d2382[_0x6ed7('0x48')],null))[_0x6ed7('0x22')](respondWithResult(_0x5a861a,null))[_0x6ed7('0x40')](handleError(_0x5a861a,null));};exports[_0x6ed7('0x23')]=function(_0x389dc4,_0xdd69fa){return db[_0x6ed7('0x29')][_0x6ed7('0x46')]({'where':{'id':_0x389dc4[_0x6ed7('0x42')]['id']}})[_0x6ed7('0x22')](handleEntityNotFound(_0xdd69fa,null))[_0x6ed7('0x22')](removeEntity(_0xdd69fa,null))[_0x6ed7('0x40')](handleError(_0xdd69fa,null));};exports[_0x6ed7('0x49')]=function(_0x4aa757,_0x1dba21){return db[_0x6ed7('0x29')]['describe']()[_0x6ed7('0x22')](respondWithResult(_0x1dba21,null))[_0x6ed7('0x40')](handleError(_0x1dba21,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 8219dbc..0461450 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 _0x61d7=['../../config/environment','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4e7306,_0x51515f){var _0x403bbe=function(_0x311e60){while(--_0x311e60){_0x4e7306['push'](_0x4e7306['shift']());}};_0x403bbe(++_0x51515f);}(_0x61d7,0x18a));var _0x761d=function(_0x394331,_0x492a9a){_0x394331=_0x394331-0x0;var _0x51db5c=_0x61d7[_0x394331];return _0x51db5c;};'use strict';var _=require(_0x761d('0x0'));var util=require(_0x761d('0x1'));var logger=require(_0x761d('0x2'))(_0x761d('0x3'));var moment=require('moment');var BPromise=require(_0x761d('0x4'));var rp=require(_0x761d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x761d('0x6'));var attributes=require(_0x761d('0x7'));module['exports']=function(_0x2f52f4,_0x4eb3eb){return _0x2f52f4[_0x761d('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x761d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c79=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x6c79,0x1df));var _0x96c7=function(_0x30b4dc,_0xaba989){_0x30b4dc=_0x30b4dc-0x0;var _0x3a4dab=_0x6c79[_0x30b4dc];return _0x3a4dab;};'use strict';var _=require(_0x96c7('0x0'));var util=require('util');var logger=require(_0x96c7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x96c7('0x2'));var rp=require(_0x96c7('0x3'));var fs=require('fs');var path=require(_0x96c7('0x4'));var rimraf=require(_0x96c7('0x5'));var config=require(_0x96c7('0x6'));var attributes=require(_0x96c7('0x7'));module[_0x96c7('0x8')]=function(_0x417906,_0x46c3){return _0x417906[_0x96c7('0x9')](_0x96c7('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 3abf190..56df95f 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 _0x8222=['../../config/utils','../../config/logger','rpc','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3aec1e,_0x3be4a2){var _0x4df3d7=function(_0x4c92c6){while(--_0x4c92c6){_0x3aec1e['push'](_0x3aec1e['shift']());}};_0x4df3d7(++_0x3be4a2);}(_0x8222,0x1c6));var _0x2822=function(_0x3649af,_0x20b28a){_0x3649af=_0x3649af-0x0;var _0x3a08dd=_0x8222[_0x3649af];return _0x3a08dd;};'use strict';var _=require(_0x2822('0x0'));var util=require(_0x2822('0x1'));var moment=require('moment');var BPromise=require(_0x2822('0x2'));var rs=require(_0x2822('0x3'));var fs=require('fs');var Redis=require(_0x2822('0x4'));var db=require(_0x2822('0x5'))['db'];var utils=require(_0x2822('0x6'));var logger=require(_0x2822('0x7'))(_0x2822('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2822('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f1198,_0x475d93,_0x4de555){return new BPromise(function(_0x2aac47,_0x325cba){return client[_0x2822('0xa')](_0x4f1198,_0x4de555)[_0x2822('0xb')](function(_0x59bcf4){logger[_0x2822('0xc')](_0x2822('0xd'),_0x475d93,'request\x20sent');logger[_0x2822('0xe')](_0x2822('0xf'),_0x475d93,'request\x20sent',JSON['stringify'](_0x59bcf4));if(_0x59bcf4[_0x2822('0x10')]){if(_0x59bcf4['error']['code']===0x1f4){logger['error'](_0x2822('0xd'),_0x475d93,_0x59bcf4[_0x2822('0x10')][_0x2822('0x11')]);return _0x325cba(_0x59bcf4['error']['message']);}logger[_0x2822('0x10')](_0x2822('0xd'),_0x475d93,_0x59bcf4[_0x2822('0x10')][_0x2822('0x11')]);return _0x2aac47(_0x59bcf4['error'][_0x2822('0x11')]);}else{logger[_0x2822('0xc')](_0x2822('0xd'),_0x475d93,_0x2822('0x12'));_0x2aac47(_0x59bcf4['result'][_0x2822('0x11')]);}})[_0x2822('0x13')](function(_0x13f97d){logger[_0x2822('0x10')](_0x2822('0xd'),_0x475d93,_0x13f97d);_0x325cba(_0x13f97d);});});} \ No newline at end of file +var _0xce31=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xe78ad2,_0x9336c4){var _0x51aa5e=function(_0x896fc7){while(--_0x896fc7){_0xe78ad2['push'](_0xe78ad2['shift']());}};_0x51aa5e(++_0x9336c4);}(_0xce31,0x1f4));var _0x1ce3=function(_0x548471,_0x18c884){_0x548471=_0x548471-0x0;var _0x382208=_0xce31[_0x548471];return _0x382208;};'use strict';var _=require(_0x1ce3('0x0'));var util=require(_0x1ce3('0x1'));var moment=require(_0x1ce3('0x2'));var BPromise=require('bluebird');var rs=require(_0x1ce3('0x3'));var fs=require('fs');var Redis=require(_0x1ce3('0x4'));var db=require(_0x1ce3('0x5'))['db'];var utils=require(_0x1ce3('0x6'));var logger=require(_0x1ce3('0x7'))('rpc');var config=require(_0x1ce3('0x8'));var jayson=require(_0x1ce3('0x9'));var client=jayson[_0x1ce3('0xa')][_0x1ce3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1290f2,_0x35c488,_0x256dbe){return new BPromise(function(_0x242cbf,_0x4ba74f){return client[_0x1ce3('0xc')](_0x1290f2,_0x256dbe)[_0x1ce3('0xd')](function(_0x35c69a){logger[_0x1ce3('0xe')](_0x1ce3('0xf'),_0x35c488,_0x1ce3('0x10'));logger['debug'](_0x1ce3('0x11'),_0x35c488,_0x1ce3('0x10'),JSON['stringify'](_0x35c69a));if(_0x35c69a['error']){if(_0x35c69a[_0x1ce3('0x12')][_0x1ce3('0x13')]===0x1f4){logger[_0x1ce3('0x12')](_0x1ce3('0xf'),_0x35c488,_0x35c69a[_0x1ce3('0x12')][_0x1ce3('0x14')]);return _0x4ba74f(_0x35c69a[_0x1ce3('0x12')][_0x1ce3('0x14')]);}logger[_0x1ce3('0x12')](_0x1ce3('0xf'),_0x35c488,_0x35c69a[_0x1ce3('0x12')][_0x1ce3('0x14')]);return _0x242cbf(_0x35c69a['error'][_0x1ce3('0x14')]);}else{logger['info'](_0x1ce3('0xf'),_0x35c488,_0x1ce3('0x10'));_0x242cbf(_0x35c69a[_0x1ce3('0x15')][_0x1ce3('0x14')]);}})['catch'](function(_0x2175b2){logger['error'](_0x1ce3('0xf'),_0x35c488,_0x2175b2);_0x4ba74f(_0x2175b2);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index d6e5fb7..22d5fec 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 _0x6b6d=['update','delete','exports','express','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id/questions','getQuestions','post','create','/:id'];(function(_0x55fa52,_0x490381){var _0x1ed0b2=function(_0x56b413){while(--_0x56b413){_0x55fa52['push'](_0x55fa52['shift']());}};_0x1ed0b2(++_0x490381);}(_0x6b6d,0x1d3));var _0xd6b6=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x6b6d[_0x5b8b97];return _0x1fdf84;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd6b6('0x0'));var router=express['Router']();var fs_extra=require(_0xd6b6('0x1'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd6b6('0x2'));var controller=require(_0xd6b6('0x3'));router[_0xd6b6('0x4')]('/',auth[_0xd6b6('0x5')](),controller[_0xd6b6('0x6')]);router[_0xd6b6('0x4')]('/describe',auth[_0xd6b6('0x5')](),controller[_0xd6b6('0x7')]);router[_0xd6b6('0x4')]('/:id',auth[_0xd6b6('0x5')](),controller['show']);router['get'](_0xd6b6('0x8'),auth['isAuthenticated'](),controller[_0xd6b6('0x9')]);router[_0xd6b6('0xa')]('/',auth[_0xd6b6('0x5')](),controller[_0xd6b6('0xb')]);router['put'](_0xd6b6('0xc'),auth['isAuthenticated'](),controller[_0xd6b6('0xd')]);router[_0xd6b6('0xe')](_0xd6b6('0xc'),auth[_0xd6b6('0x5')](),controller['destroy']);module[_0xd6b6('0xf')]=router; \ No newline at end of file +var _0xf62b=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/questions','getQuestions','post','put','update','delete'];(function(_0x3a7d5e,_0x4843c7){var _0x34ab97=function(_0x270294){while(--_0x270294){_0x3a7d5e['push'](_0x3a7d5e['shift']());}};_0x34ab97(++_0x4843c7);}(_0xf62b,0x1cc));var _0xbf62=function(_0x21ed1f,_0xabbc54){_0x21ed1f=_0x21ed1f-0x0;var _0x2d8da9=_0xf62b[_0x21ed1f];return _0x2d8da9;};'use strict';var multer=require(_0xbf62('0x0'));var util=require(_0xbf62('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbf62('0x2'));var router=express[_0xbf62('0x3')]();var fs_extra=require(_0xbf62('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbf62('0x5'));var config=require(_0xbf62('0x6'));var controller=require(_0xbf62('0x7'));router[_0xbf62('0x8')]('/',auth[_0xbf62('0x9')](),controller[_0xbf62('0xa')]);router['get'](_0xbf62('0xb'),auth[_0xbf62('0x9')](),controller[_0xbf62('0xc')]);router[_0xbf62('0x8')](_0xbf62('0xd'),auth[_0xbf62('0x9')](),controller['show']);router[_0xbf62('0x8')](_0xbf62('0xe'),auth[_0xbf62('0x9')](),controller[_0xbf62('0xf')]);router[_0xbf62('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf62('0x11')](_0xbf62('0xd'),auth[_0xbf62('0x9')](),controller[_0xbf62('0x12')]);router[_0xbf62('0x13')]('/:id',auth[_0xbf62('0x9')](),controller['destroy']);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 8e46ea2..9d8d46f 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 _0xad1b=['STRING','moment','sequelize','exports','DATE','setDataValue','starttime','format'];(function(_0x51e731,_0x4ca707){var _0x52c1a4=function(_0x38c3a2){while(--_0x38c3a2){_0x51e731['push'](_0x51e731['shift']());}};_0x52c1a4(++_0x4ca707);}(_0xad1b,0x131));var _0xbad1=function(_0x456fcb,_0x4bfdb9){_0x456fcb=_0x456fcb-0x0;var _0x124da9=_0xad1b[_0x456fcb];return _0x124da9;};'use strict';var moment=require(_0xbad1('0x0'));var Sequelize=require(_0xbad1('0x1'));module[_0xbad1('0x2')]={'starttime':{'type':Sequelize[_0xbad1('0x3')],'set':function(_0x4f16fe){this[_0xbad1('0x4')](_0xbad1('0x5'),_0x4f16fe);this[_0xbad1('0x4')]('endtime',moment()[_0xbad1('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xbad1('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xbad1('0x7')]},'queue':{'type':Sequelize[_0xbad1('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9a2d=['BOOLEAN','moment','sequelize','DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x9a2d,0x6d));var _0xd9a2=function(_0x4172c2,_0x6a5814){_0x4172c2=_0x4172c2-0x0;var _0x3c5ccc=_0x9a2d[_0x4172c2];return _0x3c5ccc;};'use strict';var moment=require(_0xd9a2('0x0'));var Sequelize=require(_0xd9a2('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xd9a2('0x2')],'set':function(_0x118576){this[_0xd9a2('0x3')](_0xd9a2('0x4'),_0x118576);this[_0xd9a2('0x3')](_0xd9a2('0x5'),moment()['format'](_0xd9a2('0x6')));}},'endtime':{'type':Sequelize[_0xd9a2('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xd9a2('0x7')]},'queue':{'type':Sequelize[_0xd9a2('0x7')]},'uniqueid':{'type':Sequelize[_0xd9a2('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd9a2('0x7')]},'completed':{'type':Sequelize[_0xd9a2('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 ffd5457..fcc18bc 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 _0x0401=['offset','undefined','limit','count','set','reject','then','destroy','end','error','stack','name','map','JscriptySessionReport','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','find','create','update','body','describe','findOne','JscriptyQuestionReport','SessionId','include','findAll','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x3cc2c8,_0x2ff09a){var _0x28d499=function(_0x6d68f1){while(--_0x6d68f1){_0x3cc2c8['push'](_0x3cc2c8['shift']());}};_0x28d499(++_0x2ff09a);}(_0x0401,0xcc));var _0x1040=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0401[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1040('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1040('0x1'));var rp=require(_0x1040('0x2'));var moment=require(_0x1040('0x3'));var BPromise=require(_0x1040('0x4'));var Mustache=require(_0x1040('0x5'));var util=require(_0x1040('0x6'));var path=require('path');var sox=require(_0x1040('0x7'));var csv=require(_0x1040('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1040('0x9'));var squel=require(_0x1040('0xa'));var crypto=require(_0x1040('0xb'));var jsforce=require(_0x1040('0xc'));var deskjs=require(_0x1040('0xd'));var toCsv=require(_0x1040('0x8'));var querystring=require(_0x1040('0xe'));var Papa=require(_0x1040('0xf'));var Redis=require(_0x1040('0x10'));var authService=require(_0x1040('0x11'));var qs=require(_0x1040('0x12'));var as=require(_0x1040('0x13'));var hardwareService=require(_0x1040('0x14'));var logger=require('../../config/logger')(_0x1040('0x15'));var utils=require('../../config/utils');var config=require(_0x1040('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1040('0x17'))['db'];function respondWithStatusCode(_0x3ec72a,_0x2aa66f){_0x2aa66f=_0x2aa66f||0xcc;return function(_0x4a4894){if(_0x4a4894){return _0x3ec72a[_0x1040('0x18')](_0x2aa66f);}return _0x3ec72a[_0x1040('0x19')](_0x2aa66f)['end']();};}function respondWithResult(_0x307725,_0x3a37f4){_0x3a37f4=_0x3a37f4||0xc8;return function(_0x1f6af7){if(_0x1f6af7){return _0x307725[_0x1040('0x19')](_0x3a37f4)[_0x1040('0x1a')](_0x1f6af7);}};}function respondWithFilteredResult(_0x1bfe1c,_0x363710){return function(_0x4f2693){if(_0x4f2693){var _0x456b9e=typeof _0x363710[_0x1040('0x1b')]===_0x1040('0x1c')&&typeof _0x363710[_0x1040('0x1d')]===_0x1040('0x1c');var _0x459997=_0x4f2693[_0x1040('0x1e')];var _0x516ae1=_0x456b9e?0x0:_0x363710[_0x1040('0x1b')];var _0x263ef7=_0x456b9e?_0x4f2693[_0x1040('0x1e')]:_0x363710[_0x1040('0x1b')]+_0x363710['limit'];var _0x59cbc2;if(_0x263ef7>=_0x459997){_0x263ef7=_0x459997;_0x59cbc2=0xc8;}else{_0x59cbc2=0xce;}_0x1bfe1c[_0x1040('0x19')](_0x59cbc2);return _0x1bfe1c[_0x1040('0x1f')]('Content-Range',_0x516ae1+'-'+_0x263ef7+'/'+_0x459997)[_0x1040('0x1a')](_0x4f2693);}return null;};}function patchUpdates(_0x17644e){return function(_0x530afa){try{jsonpatch['apply'](_0x530afa,_0x17644e,!![]);}catch(_0x2d569a){return BPromise[_0x1040('0x20')](_0x2d569a);}return _0x530afa['save']();};}function saveUpdates(_0x1eda57,_0x234ccd){return function(_0x3f34a2){if(_0x3f34a2){return _0x3f34a2['update'](_0x1eda57)[_0x1040('0x21')](function(_0x38eac1){return _0x38eac1;});}return null;};}function removeEntity(_0x57d03b,_0x1ce3ba){return function(_0x5bdd00){if(_0x5bdd00){return _0x5bdd00[_0x1040('0x22')]()[_0x1040('0x21')](function(){_0x57d03b[_0x1040('0x19')](0xcc)[_0x1040('0x23')]();});}};}function handleEntityNotFound(_0x194635,_0x445868){return function(_0x4251b2){if(!_0x4251b2){_0x194635[_0x1040('0x18')](0x194);}return _0x4251b2;};}function handleError(_0x3a6076,_0x2154c6){_0x2154c6=_0x2154c6||0x1f4;return function(_0x56fbad){logger[_0x1040('0x24')](_0x56fbad[_0x1040('0x25')]);if(_0x56fbad[_0x1040('0x26')]){delete _0x56fbad[_0x1040('0x26')];}_0x3a6076[_0x1040('0x19')](_0x2154c6)['send'](_0x56fbad);};}exports['index']=function(_0x522b99,_0x815693){var _0x5e69b7={},_0x55378d={},_0x8d8f53={'count':0x0,'rows':[]};var _0x46a658=_[_0x1040('0x27')](db[_0x1040('0x28')][_0x1040('0x29')],function(_0x18ad70){return{'name':_0x18ad70['fieldName'],'type':_0x18ad70[_0x1040('0x2a')][_0x1040('0x2b')]};});_0x55378d['model']=_['map'](_0x46a658,_0x1040('0x26'));_0x55378d[_0x1040('0x2c')]=_[_0x1040('0x2d')](_0x522b99['query']);_0x55378d['filters']=_[_0x1040('0x2e')](_0x55378d[_0x1040('0x2f')],_0x55378d[_0x1040('0x2c')]);_0x5e69b7[_0x1040('0x30')]=_[_0x1040('0x2e')](_0x55378d['model'],qs['fields'](_0x522b99[_0x1040('0x2c')][_0x1040('0x31')]));_0x5e69b7[_0x1040('0x30')]=_0x5e69b7[_0x1040('0x30')]['length']?_0x5e69b7[_0x1040('0x30')]:_0x55378d['model'];if(!_0x522b99[_0x1040('0x2c')][_0x1040('0x32')](_0x1040('0x33'))){_0x5e69b7[_0x1040('0x1d')]=qs['limit'](_0x522b99['query'][_0x1040('0x1d')]);_0x5e69b7['offset']=qs['offset'](_0x522b99['query'][_0x1040('0x1b')]);}_0x5e69b7[_0x1040('0x34')]=qs[_0x1040('0x35')](_0x522b99[_0x1040('0x2c')][_0x1040('0x35')]);_0x5e69b7[_0x1040('0x36')]=qs[_0x1040('0x37')](_[_0x1040('0x38')](_0x522b99['query'],_0x55378d[_0x1040('0x37')]),_0x46a658);if(_0x522b99[_0x1040('0x2c')][_0x1040('0x39')]){_0x5e69b7[_0x1040('0x36')]=_[_0x1040('0x3a')](_0x5e69b7['where'],{'$or':_['map'](_0x46a658,function(_0x210e84){if(_0x210e84['type']!==_0x1040('0x3b')){var _0x16116b={};_0x16116b[_0x210e84[_0x1040('0x26')]]={'$like':'%'+_0x522b99[_0x1040('0x2c')]['filter']+'%'};return _0x16116b;}})});}_0x5e69b7=_[_0x1040('0x3a')]({},_0x5e69b7,_0x522b99[_0x1040('0x3c')]);var _0x336580={'where':_0x5e69b7[_0x1040('0x36')]};return db['JscriptySessionReport'][_0x1040('0x1e')](_0x336580)[_0x1040('0x21')](function(_0x16e3d0){_0x8d8f53['count']=_0x16e3d0;if(_0x522b99['query'][_0x1040('0x3d')]){_0x5e69b7['include']=[{'all':!![]}];}return db[_0x1040('0x28')]['findAll'](_0x5e69b7);})[_0x1040('0x21')](function(_0x3c1d72){_0x8d8f53[_0x1040('0x3e')]=_0x3c1d72;return _0x8d8f53;})[_0x1040('0x21')](respondWithFilteredResult(_0x815693,_0x5e69b7))[_0x1040('0x3f')](handleError(_0x815693,null));};exports[_0x1040('0x40')]=function(_0x1fb2bf,_0x21c54c){var _0x401d6d={'raw':!![],'where':{'id':_0x1fb2bf[_0x1040('0x41')]['id']}},_0x276052={};_0x276052['model']=_[_0x1040('0x2d')](db[_0x1040('0x28')][_0x1040('0x29')]);_0x276052[_0x1040('0x2c')]=_[_0x1040('0x2d')](_0x1fb2bf[_0x1040('0x2c')]);_0x276052[_0x1040('0x37')]=_[_0x1040('0x2e')](_0x276052[_0x1040('0x2f')],_0x276052[_0x1040('0x2c')]);_0x401d6d[_0x1040('0x30')]=_[_0x1040('0x2e')](_0x276052[_0x1040('0x2f')],qs[_0x1040('0x31')](_0x1fb2bf[_0x1040('0x2c')][_0x1040('0x31')]));_0x401d6d[_0x1040('0x30')]=_0x401d6d[_0x1040('0x30')][_0x1040('0x42')]?_0x401d6d['attributes']:_0x276052['model'];if(_0x1fb2bf[_0x1040('0x2c')][_0x1040('0x3d')]){_0x401d6d['include']=[{'all':!![]}];}_0x401d6d=_[_0x1040('0x3a')]({},_0x401d6d,_0x1fb2bf[_0x1040('0x3c')]);return db[_0x1040('0x28')][_0x1040('0x43')](_0x401d6d)[_0x1040('0x21')](handleEntityNotFound(_0x21c54c,null))[_0x1040('0x21')](respondWithResult(_0x21c54c,null))['catch'](handleError(_0x21c54c,null));};exports[_0x1040('0x44')]=function(_0x48c90f,_0x25ed78){return db[_0x1040('0x28')][_0x1040('0x44')](_0x48c90f['body'],{})[_0x1040('0x21')](respondWithResult(_0x25ed78,0xc9))[_0x1040('0x3f')](handleError(_0x25ed78,null));};exports[_0x1040('0x45')]=function(_0x1f3491,_0x583e67){if(_0x1f3491[_0x1040('0x46')]['id']){delete _0x1f3491[_0x1040('0x46')]['id'];}return db[_0x1040('0x28')][_0x1040('0x43')]({'where':{'id':_0x1f3491[_0x1040('0x41')]['id']}})['then'](handleEntityNotFound(_0x583e67,null))[_0x1040('0x21')](saveUpdates(_0x1f3491[_0x1040('0x46')],null))[_0x1040('0x21')](respondWithResult(_0x583e67,null))[_0x1040('0x3f')](handleError(_0x583e67,null));};exports['destroy']=function(_0x33995e,_0x43c41b){return db[_0x1040('0x28')][_0x1040('0x43')]({'where':{'id':_0x33995e[_0x1040('0x41')]['id']}})[_0x1040('0x21')](handleEntityNotFound(_0x43c41b,null))[_0x1040('0x21')](removeEntity(_0x43c41b,null))['catch'](handleError(_0x43c41b,null));};exports[_0x1040('0x47')]=function(_0x1c92a1,_0x390118){return db[_0x1040('0x28')][_0x1040('0x47')]()['then'](respondWithResult(_0x390118,null))[_0x1040('0x3f')](handleError(_0x390118,null));};exports['getQuestions']=function(_0x21a67c,_0x39898a,_0x4e38c9){var _0x203537={'raw':!![],'where':{}};var _0xca807={};var _0x530465={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x1040('0x48')]({'where':{'id':_0x21a67c[_0x1040('0x41')]['id']}})['then'](handleEntityNotFound(_0x39898a,null))[_0x1040('0x21')](function(_0x14332c){if(_0x14332c){_0xca807['model']=_[_0x1040('0x2d')](db[_0x1040('0x49')][_0x1040('0x29')]);_0xca807[_0x1040('0x2c')]=_[_0x1040('0x2d')](_0x21a67c[_0x1040('0x2c')]);_0xca807[_0x1040('0x37')]=_[_0x1040('0x2e')](_0xca807[_0x1040('0x2f')],_0xca807[_0x1040('0x2c')]);_0x203537[_0x1040('0x30')]=_[_0x1040('0x2e')](_0xca807[_0x1040('0x2f')],qs['fields'](_0x21a67c['query'][_0x1040('0x31')]));_0x203537[_0x1040('0x30')]=_0x203537['attributes'][_0x1040('0x42')]?_0x203537['attributes']:_0xca807[_0x1040('0x2f')];if(!_0x21a67c[_0x1040('0x2c')]['hasOwnProperty'](_0x1040('0x33'))){_0x203537[_0x1040('0x1d')]=qs['limit'](_0x21a67c['query']['limit']);_0x203537[_0x1040('0x1b')]=qs[_0x1040('0x1b')](_0x21a67c['query'][_0x1040('0x1b')]);}_0x203537['order']=qs[_0x1040('0x35')](_0x21a67c['query']['sort']);_0x203537[_0x1040('0x36')]=qs['filters'](_[_0x1040('0x38')](_0x21a67c[_0x1040('0x2c')],_0xca807[_0x1040('0x37')]));_0x203537['where'][_0x1040('0x4a')]=_0x14332c['id'];if(_0x21a67c[_0x1040('0x2c')]['filter']){_0x203537[_0x1040('0x36')]=_[_0x1040('0x3a')](_0x203537[_0x1040('0x36')],{'$or':_[_0x1040('0x27')](_0x203537[_0x1040('0x30')],function(_0x460a9d){var _0x494f76={};_0x494f76[_0x460a9d]={'$like':'%'+_0x21a67c[_0x1040('0x2c')][_0x1040('0x39')]+'%'};return _0x494f76;})});}_0x203537=_[_0x1040('0x3a')]({},_0x203537,_0x21a67c[_0x1040('0x3c')]);return db[_0x1040('0x49')][_0x1040('0x1e')]({'where':_0x203537[_0x1040('0x36')]})[_0x1040('0x21')](function(_0x4d6f80){_0x530465[_0x1040('0x1e')]=_0x4d6f80;if(_0x21a67c[_0x1040('0x2c')][_0x1040('0x3d')]){_0x203537[_0x1040('0x4b')]=[{'all':!![]}];}return db[_0x1040('0x49')][_0x1040('0x4c')](_0x203537);})[_0x1040('0x21')](function(_0x4614fd){_0x530465[_0x1040('0x3e')]=_0x4614fd;return _0x530465;});}})[_0x1040('0x21')](respondWithFilteredResult(_0x39898a,_0x203537))[_0x1040('0x3f')](handleError(_0x39898a,null));}; \ No newline at end of file +var _0xca5e=['stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','JscriptySessionReport','includeAll','findAll','catch','show','params','intersection','include','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x18f7da,_0x40d95e){var _0x38a3c4=function(_0x3480b5){while(--_0x3480b5){_0x18f7da['push'](_0x18f7da['shift']());}};_0x38a3c4(++_0x40d95e);}(_0xca5e,0x1b9));var _0xeca5=function(_0x31b63b,_0x14d0fd){_0x31b63b=_0x31b63b-0x0;var _0x5ac556=_0xca5e[_0x31b63b];return _0x5ac556;};'use strict';var emlformat=require(_0xeca5('0x0'));var rimraf=require(_0xeca5('0x1'));var zipdir=require(_0xeca5('0x2'));var jsonpatch=require(_0xeca5('0x3'));var rp=require(_0xeca5('0x4'));var moment=require(_0xeca5('0x5'));var BPromise=require(_0xeca5('0x6'));var Mustache=require('mustache');var util=require(_0xeca5('0x7'));var path=require(_0xeca5('0x8'));var sox=require('sox');var csv=require(_0xeca5('0x9'));var ejs=require(_0xeca5('0xa'));var fs=require('fs');var fs_extra=require(_0xeca5('0xb'));var _=require(_0xeca5('0xc'));var squel=require(_0xeca5('0xd'));var crypto=require(_0xeca5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xeca5('0xf'));var toCsv=require(_0xeca5('0x9'));var querystring=require('querystring');var Papa=require(_0xeca5('0x10'));var Redis=require('ioredis');var authService=require(_0xeca5('0x11'));var qs=require(_0xeca5('0x12'));var as=require(_0xeca5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeca5('0x14'))('api');var utils=require(_0xeca5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeca5('0x16'));var db=require(_0xeca5('0x17'))['db'];function respondWithStatusCode(_0x234943,_0x2a678c){_0x2a678c=_0x2a678c||0xcc;return function(_0xf9cf74){if(_0xf9cf74){return _0x234943['sendStatus'](_0x2a678c);}return _0x234943[_0xeca5('0x18')](_0x2a678c)[_0xeca5('0x19')]();};}function respondWithResult(_0x4aea27,_0x37dca5){_0x37dca5=_0x37dca5||0xc8;return function(_0x1bfb5f){if(_0x1bfb5f){return _0x4aea27[_0xeca5('0x18')](_0x37dca5)[_0xeca5('0x1a')](_0x1bfb5f);}};}function respondWithFilteredResult(_0x3d5f3d,_0x20b994){return function(_0x1067f9){if(_0x1067f9){var _0x20555c=typeof _0x20b994[_0xeca5('0x1b')]===_0xeca5('0x1c')&&typeof _0x20b994[_0xeca5('0x1d')]===_0xeca5('0x1c');var _0x1ad70b=_0x1067f9['count'];var _0x5f8bd3=_0x20555c?0x0:_0x20b994[_0xeca5('0x1b')];var _0x5bf9ca=_0x20555c?_0x1067f9[_0xeca5('0x1e')]:_0x20b994[_0xeca5('0x1b')]+_0x20b994[_0xeca5('0x1d')];var _0x206849;if(_0x5bf9ca>=_0x1ad70b){_0x5bf9ca=_0x1ad70b;_0x206849=0xc8;}else{_0x206849=0xce;}_0x3d5f3d[_0xeca5('0x18')](_0x206849);return _0x3d5f3d['set']('Content-Range',_0x5f8bd3+'-'+_0x5bf9ca+'/'+_0x1ad70b)[_0xeca5('0x1a')](_0x1067f9);}return null;};}function patchUpdates(_0x2396f3){return function(_0x2e4d17){try{jsonpatch[_0xeca5('0x1f')](_0x2e4d17,_0x2396f3,!![]);}catch(_0x3a4a8f){return BPromise[_0xeca5('0x20')](_0x3a4a8f);}return _0x2e4d17[_0xeca5('0x21')]();};}function saveUpdates(_0x4aec85,_0x5bc032){return function(_0x4a3583){if(_0x4a3583){return _0x4a3583[_0xeca5('0x22')](_0x4aec85)[_0xeca5('0x23')](function(_0x439839){return _0x439839;});}return null;};}function removeEntity(_0x154a60,_0x4b635f){return function(_0x4efb7c){if(_0x4efb7c){return _0x4efb7c[_0xeca5('0x24')]()[_0xeca5('0x23')](function(){_0x154a60['status'](0xcc)[_0xeca5('0x19')]();});}};}function handleEntityNotFound(_0x59803c,_0x3ae853){return function(_0x258c1c){if(!_0x258c1c){_0x59803c[_0xeca5('0x25')](0x194);}return _0x258c1c;};}function handleError(_0x1592b0,_0x22a4ca){_0x22a4ca=_0x22a4ca||0x1f4;return function(_0x409369){logger[_0xeca5('0x26')](_0x409369[_0xeca5('0x27')]);if(_0x409369[_0xeca5('0x28')]){delete _0x409369[_0xeca5('0x28')];}_0x1592b0[_0xeca5('0x18')](_0x22a4ca)[_0xeca5('0x29')](_0x409369);};}exports['index']=function(_0x19efd6,_0x103fce){var _0x434347={},_0x4e02c0={},_0x396a8a={'count':0x0,'rows':[]};var _0x3a63b2=_[_0xeca5('0x2a')](db['JscriptySessionReport'][_0xeca5('0x2b')],function(_0x27c1a2){return{'name':_0x27c1a2[_0xeca5('0x2c')],'type':_0x27c1a2['type']['key']};});_0x4e02c0[_0xeca5('0x2d')]=_['map'](_0x3a63b2,_0xeca5('0x28'));_0x4e02c0[_0xeca5('0x2e')]=_[_0xeca5('0x2f')](_0x19efd6[_0xeca5('0x2e')]);_0x4e02c0[_0xeca5('0x30')]=_['intersection'](_0x4e02c0[_0xeca5('0x2d')],_0x4e02c0['query']);_0x434347[_0xeca5('0x31')]=_['intersection'](_0x4e02c0['model'],qs['fields'](_0x19efd6[_0xeca5('0x2e')][_0xeca5('0x32')]));_0x434347[_0xeca5('0x31')]=_0x434347[_0xeca5('0x31')][_0xeca5('0x33')]?_0x434347[_0xeca5('0x31')]:_0x4e02c0['model'];if(!_0x19efd6['query'][_0xeca5('0x34')](_0xeca5('0x35'))){_0x434347[_0xeca5('0x1d')]=qs[_0xeca5('0x1d')](_0x19efd6[_0xeca5('0x2e')][_0xeca5('0x1d')]);_0x434347[_0xeca5('0x1b')]=qs['offset'](_0x19efd6['query'][_0xeca5('0x1b')]);}_0x434347[_0xeca5('0x36')]=qs['sort'](_0x19efd6[_0xeca5('0x2e')][_0xeca5('0x37')]);_0x434347[_0xeca5('0x38')]=qs[_0xeca5('0x30')](_[_0xeca5('0x39')](_0x19efd6[_0xeca5('0x2e')],_0x4e02c0[_0xeca5('0x30')]),_0x3a63b2);if(_0x19efd6[_0xeca5('0x2e')][_0xeca5('0x3a')]){_0x434347[_0xeca5('0x38')]=_['merge'](_0x434347[_0xeca5('0x38')],{'$or':_['map'](_0x3a63b2,function(_0x39762a){if(_0x39762a[_0xeca5('0x3b')]!==_0xeca5('0x3c')){var _0x5c028e={};_0x5c028e[_0x39762a[_0xeca5('0x28')]]={'$like':'%'+_0x19efd6[_0xeca5('0x2e')][_0xeca5('0x3a')]+'%'};return _0x5c028e;}})});}_0x434347=_[_0xeca5('0x3d')]({},_0x434347,_0x19efd6['options']);var _0x214f85={'where':_0x434347[_0xeca5('0x38')]};return db[_0xeca5('0x3e')][_0xeca5('0x1e')](_0x214f85)[_0xeca5('0x23')](function(_0x126c9c){_0x396a8a[_0xeca5('0x1e')]=_0x126c9c;if(_0x19efd6[_0xeca5('0x2e')][_0xeca5('0x3f')]){_0x434347['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xeca5('0x40')](_0x434347);})['then'](function(_0x42244b){_0x396a8a['rows']=_0x42244b;return _0x396a8a;})[_0xeca5('0x23')](respondWithFilteredResult(_0x103fce,_0x434347))[_0xeca5('0x41')](handleError(_0x103fce,null));};exports[_0xeca5('0x42')]=function(_0x19362a,_0x307ef2){var _0x1fd938={'raw':!![],'where':{'id':_0x19362a[_0xeca5('0x43')]['id']}},_0x575510={};_0x575510[_0xeca5('0x2d')]=_[_0xeca5('0x2f')](db['JscriptySessionReport'][_0xeca5('0x2b')]);_0x575510[_0xeca5('0x2e')]=_[_0xeca5('0x2f')](_0x19362a[_0xeca5('0x2e')]);_0x575510['filters']=_['intersection'](_0x575510[_0xeca5('0x2d')],_0x575510['query']);_0x1fd938[_0xeca5('0x31')]=_[_0xeca5('0x44')](_0x575510[_0xeca5('0x2d')],qs[_0xeca5('0x32')](_0x19362a['query'][_0xeca5('0x32')]));_0x1fd938[_0xeca5('0x31')]=_0x1fd938[_0xeca5('0x31')][_0xeca5('0x33')]?_0x1fd938[_0xeca5('0x31')]:_0x575510[_0xeca5('0x2d')];if(_0x19362a[_0xeca5('0x2e')]['includeAll']){_0x1fd938[_0xeca5('0x45')]=[{'all':!![]}];}_0x1fd938=_[_0xeca5('0x3d')]({},_0x1fd938,_0x19362a[_0xeca5('0x46')]);return db['JscriptySessionReport'][_0xeca5('0x47')](_0x1fd938)['then'](handleEntityNotFound(_0x307ef2,null))['then'](respondWithResult(_0x307ef2,null))[_0xeca5('0x41')](handleError(_0x307ef2,null));};exports[_0xeca5('0x48')]=function(_0x7ae112,_0xc5d84b){return db[_0xeca5('0x3e')][_0xeca5('0x48')](_0x7ae112['body'],{})[_0xeca5('0x23')](respondWithResult(_0xc5d84b,0xc9))[_0xeca5('0x41')](handleError(_0xc5d84b,null));};exports['update']=function(_0xfbb258,_0x4500c3){if(_0xfbb258['body']['id']){delete _0xfbb258['body']['id'];}return db[_0xeca5('0x3e')][_0xeca5('0x47')]({'where':{'id':_0xfbb258['params']['id']}})['then'](handleEntityNotFound(_0x4500c3,null))[_0xeca5('0x23')](saveUpdates(_0xfbb258[_0xeca5('0x49')],null))[_0xeca5('0x23')](respondWithResult(_0x4500c3,null))['catch'](handleError(_0x4500c3,null));};exports[_0xeca5('0x24')]=function(_0x53541c,_0x50a5a1){return db[_0xeca5('0x3e')]['find']({'where':{'id':_0x53541c['params']['id']}})[_0xeca5('0x23')](handleEntityNotFound(_0x50a5a1,null))[_0xeca5('0x23')](removeEntity(_0x50a5a1,null))['catch'](handleError(_0x50a5a1,null));};exports[_0xeca5('0x4a')]=function(_0x37f908,_0x4ad023){return db[_0xeca5('0x3e')][_0xeca5('0x4a')]()[_0xeca5('0x23')](respondWithResult(_0x4ad023,null))[_0xeca5('0x41')](handleError(_0x4ad023,null));};exports[_0xeca5('0x4b')]=function(_0x1240a8,_0x27a174,_0x388368){var _0x1bae68={'raw':!![],'where':{}};var _0x2f7dde={};var _0x99793d={'count':0x0,'rows':[]};return db[_0xeca5('0x3e')][_0xeca5('0x4c')]({'where':{'id':_0x1240a8[_0xeca5('0x43')]['id']}})[_0xeca5('0x23')](handleEntityNotFound(_0x27a174,null))[_0xeca5('0x23')](function(_0x34879d){if(_0x34879d){_0x2f7dde[_0xeca5('0x2d')]=_[_0xeca5('0x2f')](db[_0xeca5('0x4d')]['rawAttributes']);_0x2f7dde[_0xeca5('0x2e')]=_[_0xeca5('0x2f')](_0x1240a8[_0xeca5('0x2e')]);_0x2f7dde['filters']=_[_0xeca5('0x44')](_0x2f7dde[_0xeca5('0x2d')],_0x2f7dde[_0xeca5('0x2e')]);_0x1bae68[_0xeca5('0x31')]=_['intersection'](_0x2f7dde[_0xeca5('0x2d')],qs['fields'](_0x1240a8['query'][_0xeca5('0x32')]));_0x1bae68[_0xeca5('0x31')]=_0x1bae68[_0xeca5('0x31')][_0xeca5('0x33')]?_0x1bae68[_0xeca5('0x31')]:_0x2f7dde[_0xeca5('0x2d')];if(!_0x1240a8['query'][_0xeca5('0x34')](_0xeca5('0x35'))){_0x1bae68['limit']=qs[_0xeca5('0x1d')](_0x1240a8['query'][_0xeca5('0x1d')]);_0x1bae68[_0xeca5('0x1b')]=qs[_0xeca5('0x1b')](_0x1240a8[_0xeca5('0x2e')][_0xeca5('0x1b')]);}_0x1bae68[_0xeca5('0x36')]=qs[_0xeca5('0x37')](_0x1240a8[_0xeca5('0x2e')][_0xeca5('0x37')]);_0x1bae68['where']=qs[_0xeca5('0x30')](_['pick'](_0x1240a8[_0xeca5('0x2e')],_0x2f7dde[_0xeca5('0x30')]));_0x1bae68[_0xeca5('0x38')][_0xeca5('0x4e')]=_0x34879d['id'];if(_0x1240a8[_0xeca5('0x2e')]['filter']){_0x1bae68[_0xeca5('0x38')]=_[_0xeca5('0x3d')](_0x1bae68[_0xeca5('0x38')],{'$or':_[_0xeca5('0x2a')](_0x1bae68[_0xeca5('0x31')],function(_0x14fed5){var _0x2d9e59={};_0x2d9e59[_0x14fed5]={'$like':'%'+_0x1240a8[_0xeca5('0x2e')]['filter']+'%'};return _0x2d9e59;})});}_0x1bae68=_[_0xeca5('0x3d')]({},_0x1bae68,_0x1240a8['options']);return db[_0xeca5('0x4d')]['count']({'where':_0x1bae68[_0xeca5('0x38')]})[_0xeca5('0x23')](function(_0x2f6e55){_0x99793d[_0xeca5('0x1e')]=_0x2f6e55;if(_0x1240a8[_0xeca5('0x2e')][_0xeca5('0x3f')]){_0x1bae68['include']=[{'all':!![]}];}return db[_0xeca5('0x4d')][_0xeca5('0x40')](_0x1bae68);})[_0xeca5('0x23')](function(_0x3426fe){_0x99793d[_0xeca5('0x4f')]=_0x3426fe;return _0x99793d;});}})[_0xeca5('0x23')](respondWithFilteredResult(_0x27a174,_0x1bae68))['catch'](handleError(_0x27a174,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index cbb67b2..34481fb 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 _0x1cb9=['./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x57ed68,_0x24e4df){var _0x14cf4d=function(_0x19392d){while(--_0x19392d){_0x57ed68['push'](_0x57ed68['shift']());}};_0x14cf4d(++_0x24e4df);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5725de,_0x27d47b){_0x5725de=_0x5725de-0x0;var _0x58f12a=_0x1cb9[_0x5725de];return _0x58f12a;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['lodash','api','moment','bluebird','request-promise','path','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions'];(function(_0x4533dd,_0x146bec){var _0x67f0b9=function(_0x3e6946){while(--_0x3e6946){_0x4533dd['push'](_0x4533dd['shift']());}};_0x67f0b9(++_0x146bec);}(_0x1623,0xab));var _0x3162=function(_0x205373,_0x4586b3){_0x205373=_0x205373-0x0;var _0x2723bb=_0x1623[_0x205373];return _0x2723bb;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'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 11734db..adcf477 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 _0x1261=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2dea3c,_0x2f3680){var _0x6debb5=function(_0x2da492){while(--_0x2da492){_0x2dea3c['push'](_0x2dea3c['shift']());}};_0x6debb5(++_0x2f3680);}(_0x1261,0x144));var _0x1126=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0x1261[_0x2e3107];return _0x833d69;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xba34=['../../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','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x27a791,_0x895705){var _0x340fa4=function(_0x4d48aa){while(--_0x4d48aa){_0x27a791['push'](_0x27a791['shift']());}};_0x340fa4(++_0x895705);}(_0xba34,0x119));var _0x4ba3=function(_0x5a73b4,_0x8d3c8d){_0x5a73b4=_0x5a73b4-0x0;var _0xce12bb=_0xba34[_0x5a73b4];return _0xce12bb;};'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/license/index.js b/server/api/license/index.js index 144b39f..a5e6f2a 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 _0xcb3e=['put','/:id','update','isAuthenticated','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0xcb3e,0x17c));var _0xecb3=function(_0x1964b4,_0x5796f4){_0x1964b4=_0x1964b4-0x0;var _0x509a77=_0xcb3e[_0x1964b4];return _0x509a77;};'use strict';var multer=require(_0xecb3('0x0'));var util=require(_0xecb3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xecb3('0x2'));var router=express[_0xecb3('0x3')]();var fs_extra=require(_0xecb3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xecb3('0x5'));var config=require(_0xecb3('0x6'));var controller=require(_0xecb3('0x7'));router[_0xecb3('0x8')]('/',controller[_0xecb3('0x9')]);router[_0xecb3('0xa')](_0xecb3('0xb'),auth['isAuthenticated'](),controller[_0xecb3('0xc')]);router[_0xecb3('0x8')]('/download_log_file',auth[_0xecb3('0xd')](),controller['downloadLogFile']);module[_0xecb3('0xe')]=router; \ No newline at end of file +var _0x498c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x498c,0xd3));var _0xc498=function(_0x9ce42d,_0x153723){_0x9ce42d=_0x9ce42d-0x0;var _0xcb720e=_0x498c[_0x9ce42d];return _0xcb720e;};'use strict';var multer=require(_0xc498('0x0'));var util=require(_0xc498('0x1'));var path=require(_0xc498('0x2'));var timeout=require(_0xc498('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc498('0x4'));var auth=require(_0xc498('0x5'));var interaction=require(_0xc498('0x6'));var config=require(_0xc498('0x7'));var controller=require(_0xc498('0x8'));router[_0xc498('0x9')]('/',controller[_0xc498('0xa')]);router[_0xc498('0xb')](_0xc498('0xc'),auth['isAuthenticated'](),controller[_0xc498('0xd')]);router[_0xc498('0x9')](_0xc498('0xe'),auth[_0xc498('0xf')](),controller[_0xc498('0x10')]);module[_0xc498('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 12c607a..650287e 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 _0xdef5=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x10e317,_0x4caa86){var _0x47a6ef=function(_0x3f4d90){while(--_0x3f4d90){_0x10e317['push'](_0x10e317['shift']());}};_0x47a6ef(++_0x4caa86);}(_0xdef5,0x150));var _0x5def=function(_0xb3d509,_0x1c4d9d){_0xb3d509=_0xb3d509-0x0;var _0x2362d8=_0xdef5[_0xb3d509];return _0x2362d8;};'use strict';var Sequelize=require(_0x5def('0x0'));module[_0x5def('0x1')]={'license':{'type':Sequelize[_0x5def('0x2')]},'data1':{'type':Sequelize[_0x5def('0x3')]},'data2':{'type':Sequelize[_0x5def('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x5def('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x062e=['sequelize','exports','STRING'];(function(_0x5bba1b,_0x225b29){var _0x58cf27=function(_0x9f509f){while(--_0x9f509f){_0x5bba1b['push'](_0x5bba1b['shift']());}};_0x58cf27(++_0x225b29);}(_0x062e,0x162));var _0xe062=function(_0x502cb1,_0x1e7105){_0x502cb1=_0x502cb1-0x0;var _0x3fbaa8=_0x062e[_0x502cb1];return _0x3fbaa8;};'use strict';var Sequelize=require(_0xe062('0x0'));module[_0xe062('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xe062('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 871c939..ba1bab0 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 _0x67a7=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','keys','License','rawAttributes','query','filters','model','attributes','intersection','fields','length','merge','options','getLicense','catch','body','find','get','checkLicense','demo','downloadLogFile','/var','log','xcally','setHeader','Content-disposition','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs'];(function(_0x479557,_0x4cda1f){var _0x41be9f=function(_0x23b74c){while(--_0x23b74c){_0x479557['push'](_0x479557['shift']());}};_0x41be9f(++_0x4cda1f);}(_0x67a7,0x80));var _0x767a=function(_0x4b0313,_0x503c2a){_0x4b0313=_0x4b0313-0x0;var _0x57c6dc=_0x67a7[_0x4b0313];return _0x57c6dc;};'use strict';var emlformat=require(_0x767a('0x0'));var rimraf=require(_0x767a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x767a('0x2'));var rp=require(_0x767a('0x3'));var moment=require(_0x767a('0x4'));var BPromise=require(_0x767a('0x5'));var Mustache=require(_0x767a('0x6'));var util=require(_0x767a('0x7'));var path=require(_0x767a('0x8'));var sox=require(_0x767a('0x9'));var csv=require('to-csv');var ejs=require(_0x767a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x767a('0xb'));var squel=require(_0x767a('0xc'));var crypto=require('crypto');var jsforce=require(_0x767a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x767a('0xe'));var querystring=require(_0x767a('0xf'));var Papa=require('papaparse');var Redis=require(_0x767a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x767a('0x11'));var as=require(_0x767a('0x12'));var hardwareService=require(_0x767a('0x13'));var logger=require(_0x767a('0x14'))(_0x767a('0x15'));var utils=require(_0x767a('0x16'));var config=require(_0x767a('0x17'));var licenseUtil=require(_0x767a('0x18'));var db=require(_0x767a('0x19'))['db'];function respondWithStatusCode(_0x3f79f5,_0x1db71f){_0x1db71f=_0x1db71f||0xcc;return function(_0x1cbd45){if(_0x1cbd45){return _0x3f79f5['sendStatus'](_0x1db71f);}return _0x3f79f5[_0x767a('0x1a')](_0x1db71f)['end']();};}function respondWithResult(_0x2cb331,_0x3acd83){_0x3acd83=_0x3acd83||0xc8;return function(_0x2be232){if(_0x2be232){return _0x2cb331[_0x767a('0x1a')](_0x3acd83)['json'](_0x2be232);}};}function respondWithFilteredResult(_0x1e2c8b,_0x4d99ed){return function(_0x38708e){if(_0x38708e){var _0x17607f=typeof _0x4d99ed[_0x767a('0x1b')]===_0x767a('0x1c')&&typeof _0x4d99ed[_0x767a('0x1d')]===_0x767a('0x1c');var _0x659db8=_0x38708e[_0x767a('0x1e')];var _0x3fade2=_0x17607f?0x0:_0x4d99ed[_0x767a('0x1b')];var _0x365d35=_0x17607f?_0x38708e[_0x767a('0x1e')]:_0x4d99ed[_0x767a('0x1b')]+_0x4d99ed[_0x767a('0x1d')];var _0x39de46;if(_0x365d35>=_0x659db8){_0x365d35=_0x659db8;_0x39de46=0xc8;}else{_0x39de46=0xce;}_0x1e2c8b[_0x767a('0x1a')](_0x39de46);return _0x1e2c8b[_0x767a('0x1f')]('Content-Range',_0x3fade2+'-'+_0x365d35+'/'+_0x659db8)[_0x767a('0x20')](_0x38708e);}return null;};}function patchUpdates(_0x28d5f4){return function(_0x328744){try{jsonpatch[_0x767a('0x21')](_0x328744,_0x28d5f4,!![]);}catch(_0x474b02){return BPromise[_0x767a('0x22')](_0x474b02);}return _0x328744[_0x767a('0x23')]();};}function saveUpdates(_0x1ff2f1,_0x189d6b){return function(_0x27e780){if(_0x27e780){return _0x27e780[_0x767a('0x24')](_0x1ff2f1)[_0x767a('0x25')](function(_0x42d1c9){return _0x42d1c9;});}return null;};}function removeEntity(_0x3946e6,_0x1c9c48){return function(_0xc51aa){if(_0xc51aa){return _0xc51aa[_0x767a('0x26')]()[_0x767a('0x25')](function(){_0x3946e6[_0x767a('0x1a')](0xcc)[_0x767a('0x27')]();});}};}function handleEntityNotFound(_0x33b578,_0x4d794a){return function(_0x52e060){if(!_0x52e060){_0x33b578[_0x767a('0x28')](0x194);}return _0x52e060;};}function handleError(_0x4fe632,_0x1b44b3){_0x1b44b3=_0x1b44b3||0x1f4;return function(_0xc5c70b){logger[_0x767a('0x29')](_0xc5c70b[_0x767a('0x2a')]);if(_0xc5c70b[_0x767a('0x2b')]){delete _0xc5c70b[_0x767a('0x2b')];}_0x4fe632[_0x767a('0x1a')](_0x1b44b3)[_0x767a('0x2c')](_0xc5c70b);};}var utilLicense=require(_0x767a('0x18'));exports['index']=function(_0xcdd942,_0x272279){var _0x287116={'raw':!![],'where':{'id':0x1}},_0x255838={};_0x255838['model']=_[_0x767a('0x2d')](db[_0x767a('0x2e')][_0x767a('0x2f')]);_0x255838[_0x767a('0x30')]=_[_0x767a('0x2d')](_0xcdd942[_0x767a('0x30')]);_0x255838[_0x767a('0x31')]=_['intersection'](_0x255838[_0x767a('0x32')],_0x255838[_0x767a('0x30')]);_0x287116[_0x767a('0x33')]=_[_0x767a('0x34')](_0x255838[_0x767a('0x32')],qs[_0x767a('0x35')](_0xcdd942[_0x767a('0x30')]['fields']));_0x287116[_0x767a('0x33')]=_0x287116[_0x767a('0x33')][_0x767a('0x36')]?_0x287116['attributes']:_0x255838['model'];_0x287116=_[_0x767a('0x37')]({},_0x287116,_0xcdd942[_0x767a('0x38')]);return utilLicense[_0x767a('0x39')](_0x287116)['then'](respondWithResult(_0x272279,null))[_0x767a('0x3a')](handleError(_0x272279,null));};exports['update']=function(_0xf5905a,_0x5d1255){if(_0xf5905a['body']['id']){delete _0xf5905a[_0x767a('0x3b')]['id'];}return db[_0x767a('0x2e')][_0x767a('0x3c')]({'where':{'id':_0xf5905a['params']['id']}})['then'](handleEntityNotFound(_0x5d1255,null))[_0x767a('0x25')](function(_0x5775b4){var _0x29925f=_0x5775b4[_0x767a('0x3d')]({'plain':!![]});return utilLicense[_0x767a('0x3e')](_0x29925f,_0xf5905a['body']['key']);})['then'](function(_0x28cdaa){if(!_0x28cdaa[_0x767a('0x3f')]){return saveUpdates(_0xf5905a['body'],null);}return _0x28cdaa;})[_0x767a('0x25')](respondWithResult(_0x5d1255,null))[_0x767a('0x3a')](handleError(_0x5d1255,null));};exports[_0x767a('0x40')]=function(_0x57a19f,_0xcfe004){var _0x2465c1='license-info.log';var _0xb354ac=path['join'](_0x767a('0x41'),_0x767a('0x42'),_0x767a('0x43'),_0x2465c1);_0xcfe004[_0x767a('0x44')](_0x767a('0x45'),'attachment;\x20filename='+_0x2465c1);_0xcfe004[_0x767a('0x1f')](_0x767a('0x46'),_0x767a('0x47'));_0xcfe004[_0x767a('0x48')](_0xb354ac);}; \ No newline at end of file +var _0x4e87=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','error','stack','name','send','model','keys','License','rawAttributes','query','filters','attributes','fields','length','merge','options','catch','update','body','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x54080c,_0x2b5537){var _0x37b3a7=function(_0xb85a85){while(--_0xb85a85){_0x54080c['push'](_0x54080c['shift']());}};_0x37b3a7(++_0x2b5537);}(_0x4e87,0x19d));var _0x74e8=function(_0x4df52b,_0x5ec3f8){_0x4df52b=_0x4df52b-0x0;var _0x52b00e=_0x4e87[_0x4df52b];return _0x52b00e;};'use strict';var emlformat=require(_0x74e8('0x0'));var rimraf=require(_0x74e8('0x1'));var zipdir=require(_0x74e8('0x2'));var jsonpatch=require(_0x74e8('0x3'));var rp=require('request-promise');var moment=require(_0x74e8('0x4'));var BPromise=require(_0x74e8('0x5'));var Mustache=require(_0x74e8('0x6'));var util=require(_0x74e8('0x7'));var path=require(_0x74e8('0x8'));var sox=require(_0x74e8('0x9'));var csv=require(_0x74e8('0xa'));var ejs=require(_0x74e8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x74e8('0xc'));var crypto=require(_0x74e8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x74e8('0xe'));var toCsv=require(_0x74e8('0xa'));var querystring=require('querystring');var Papa=require(_0x74e8('0xf'));var Redis=require(_0x74e8('0x10'));var authService=require(_0x74e8('0x11'));var qs=require(_0x74e8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74e8('0x13'))('api');var utils=require(_0x74e8('0x14'));var config=require(_0x74e8('0x15'));var licenseUtil=require(_0x74e8('0x16'));var db=require(_0x74e8('0x17'))['db'];function respondWithStatusCode(_0x19cbe6,_0x5c0207){_0x5c0207=_0x5c0207||0xcc;return function(_0xaccdf9){if(_0xaccdf9){return _0x19cbe6[_0x74e8('0x18')](_0x5c0207);}return _0x19cbe6[_0x74e8('0x19')](_0x5c0207)[_0x74e8('0x1a')]();};}function respondWithResult(_0x20afbf,_0x18bf9a){_0x18bf9a=_0x18bf9a||0xc8;return function(_0x221ef8){if(_0x221ef8){return _0x20afbf[_0x74e8('0x19')](_0x18bf9a)[_0x74e8('0x1b')](_0x221ef8);}};}function respondWithFilteredResult(_0x4856d2,_0x47100e){return function(_0x19242b){if(_0x19242b){var _0x3aa5be=typeof _0x47100e[_0x74e8('0x1c')]===_0x74e8('0x1d')&&typeof _0x47100e[_0x74e8('0x1e')]===_0x74e8('0x1d');var _0x2fb3dc=_0x19242b[_0x74e8('0x1f')];var _0x5d56a8=_0x3aa5be?0x0:_0x47100e[_0x74e8('0x1c')];var _0x2f460d=_0x3aa5be?_0x19242b['count']:_0x47100e['offset']+_0x47100e[_0x74e8('0x1e')];var _0x3ff8bb;if(_0x2f460d>=_0x2fb3dc){_0x2f460d=_0x2fb3dc;_0x3ff8bb=0xc8;}else{_0x3ff8bb=0xce;}_0x4856d2['status'](_0x3ff8bb);return _0x4856d2[_0x74e8('0x20')]('Content-Range',_0x5d56a8+'-'+_0x2f460d+'/'+_0x2fb3dc)['json'](_0x19242b);}return null;};}function patchUpdates(_0x40462c){return function(_0x577677){try{jsonpatch['apply'](_0x577677,_0x40462c,!![]);}catch(_0x310d32){return BPromise[_0x74e8('0x21')](_0x310d32);}return _0x577677[_0x74e8('0x22')]();};}function saveUpdates(_0x2cfc29,_0x4fc2d2){return function(_0x580209){if(_0x580209){return _0x580209['update'](_0x2cfc29)[_0x74e8('0x23')](function(_0x382e53){return _0x382e53;});}return null;};}function removeEntity(_0x445347,_0x2cf284){return function(_0x1ff3fb){if(_0x1ff3fb){return _0x1ff3fb['destroy']()[_0x74e8('0x23')](function(){_0x445347[_0x74e8('0x19')](0xcc)[_0x74e8('0x1a')]();});}};}function handleEntityNotFound(_0x4a477e,_0x1a7f72){return function(_0x1dc23f){if(!_0x1dc23f){_0x4a477e['sendStatus'](0x194);}return _0x1dc23f;};}function handleError(_0xcf0457,_0x38cf63){_0x38cf63=_0x38cf63||0x1f4;return function(_0x4ce1e9){logger[_0x74e8('0x24')](_0x4ce1e9[_0x74e8('0x25')]);if(_0x4ce1e9['name']){delete _0x4ce1e9[_0x74e8('0x26')];}_0xcf0457['status'](_0x38cf63)[_0x74e8('0x27')](_0x4ce1e9);};}var utilLicense=require(_0x74e8('0x16'));exports['index']=function(_0x435d23,_0x221903){var _0x5bde02={'raw':!![],'where':{'id':0x1}},_0x12a2ef={};_0x12a2ef[_0x74e8('0x28')]=_[_0x74e8('0x29')](db[_0x74e8('0x2a')][_0x74e8('0x2b')]);_0x12a2ef[_0x74e8('0x2c')]=_['keys'](_0x435d23[_0x74e8('0x2c')]);_0x12a2ef[_0x74e8('0x2d')]=_['intersection'](_0x12a2ef[_0x74e8('0x28')],_0x12a2ef['query']);_0x5bde02[_0x74e8('0x2e')]=_['intersection'](_0x12a2ef[_0x74e8('0x28')],qs[_0x74e8('0x2f')](_0x435d23['query'][_0x74e8('0x2f')]));_0x5bde02[_0x74e8('0x2e')]=_0x5bde02[_0x74e8('0x2e')][_0x74e8('0x30')]?_0x5bde02[_0x74e8('0x2e')]:_0x12a2ef['model'];_0x5bde02=_[_0x74e8('0x31')]({},_0x5bde02,_0x435d23[_0x74e8('0x32')]);return utilLicense['getLicense'](_0x5bde02)['then'](respondWithResult(_0x221903,null))[_0x74e8('0x33')](handleError(_0x221903,null));};exports[_0x74e8('0x34')]=function(_0x24be26,_0x50fe7e){if(_0x24be26[_0x74e8('0x35')]['id']){delete _0x24be26[_0x74e8('0x35')]['id'];}return db['License'][_0x74e8('0x36')]({'where':{'id':_0x24be26[_0x74e8('0x37')]['id']}})[_0x74e8('0x23')](handleEntityNotFound(_0x50fe7e,null))[_0x74e8('0x23')](function(_0x59a3e7){var _0x48df38=_0x59a3e7[_0x74e8('0x38')]({'plain':!![]});return utilLicense[_0x74e8('0x39')](_0x48df38,_0x24be26[_0x74e8('0x35')][_0x74e8('0x3a')]);})[_0x74e8('0x23')](function(_0x158b1d){if(!_0x158b1d[_0x74e8('0x3b')]){return saveUpdates(_0x24be26[_0x74e8('0x35')],null);}return _0x158b1d;})[_0x74e8('0x23')](respondWithResult(_0x50fe7e,null))[_0x74e8('0x33')](handleError(_0x50fe7e,null));};exports[_0x74e8('0x3c')]=function(_0x34f9d6,_0x2667c7){var _0x2db830=_0x74e8('0x3d');var _0x941c0=path[_0x74e8('0x3e')](_0x74e8('0x3f'),_0x74e8('0x40'),_0x74e8('0x41'),_0x2db830);_0x2667c7[_0x74e8('0x42')](_0x74e8('0x43'),_0x74e8('0x44')+_0x2db830);_0x2667c7['set'](_0x74e8('0x45'),_0x74e8('0x46'));_0x2667c7['download'](_0x941c0);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 3482c76..fd649f7 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 _0xe515=['bluebird','request-promise','path','rimraf','./license.attributes','exports','define','License','lodash','../../config/logger','api','moment'];(function(_0xc16b14,_0x495094){var _0x30b436=function(_0x5c203c){while(--_0x5c203c){_0xc16b14['push'](_0xc16b14['shift']());}};_0x30b436(++_0x495094);}(_0xe515,0x194));var _0x5e51=function(_0x4f95f1,_0x1b7f5d){_0x4f95f1=_0x4f95f1-0x0;var _0x2da137=_0xe515[_0x4f95f1];return _0x2da137;};'use strict';var _=require(_0x5e51('0x0'));var util=require('util');var logger=require(_0x5e51('0x1'))(_0x5e51('0x2'));var moment=require(_0x5e51('0x3'));var BPromise=require(_0x5e51('0x4'));var rp=require(_0x5e51('0x5'));var fs=require('fs');var path=require(_0x5e51('0x6'));var rimraf=require(_0x5e51('0x7'));var config=require('../../config/environment');var attributes=require(_0x5e51('0x8'));module[_0x5e51('0x9')]=function(_0x3871a4,_0x25af1e){return _0x3871a4[_0x5e51('0xa')](_0x5e51('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc721=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','License','license','lodash','util','../../config/logger','api'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc721,0x64));var _0x1c72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc721[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1c72('0x0'));var util=require(_0x1c72('0x1'));var logger=require(_0x1c72('0x2'))(_0x1c72('0x3'));var moment=require(_0x1c72('0x4'));var BPromise=require(_0x1c72('0x5'));var rp=require(_0x1c72('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c72('0x7'));var config=require(_0x1c72('0x8'));var attributes=require('./license.attributes');module[_0x1c72('0x9')]=function(_0x59020c,_0x7e7dca){return _0x59020c[_0x1c72('0xa')](_0x1c72('0xb'),attributes,{'tableName':_0x1c72('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index e0a4413..a2ed8df 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 _0x1e60=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','License,\x20%s,\x20%s','info','result','catch','lodash','util','moment'];(function(_0x67b62f,_0x5de390){var _0x1d232c=function(_0x28708f){while(--_0x28708f){_0x67b62f['push'](_0x67b62f['shift']());}};_0x1d232c(++_0x5de390);}(_0x1e60,0xcf));var _0x01e6=function(_0x3039e0,_0x155469){_0x3039e0=_0x3039e0-0x0;var _0x3d817f=_0x1e60[_0x3039e0];return _0x3d817f;};'use strict';var _=require(_0x01e6('0x0'));var util=require(_0x01e6('0x1'));var moment=require(_0x01e6('0x2'));var BPromise=require(_0x01e6('0x3'));var rs=require(_0x01e6('0x4'));var fs=require('fs');var Redis=require(_0x01e6('0x5'));var db=require(_0x01e6('0x6'))['db'];var utils=require(_0x01e6('0x7'));var logger=require('../../config/logger')(_0x01e6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x01e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59639f,_0x131d2b,_0x1a6d45){return new BPromise(function(_0x16916a,_0x1a6356){return client[_0x01e6('0xa')](_0x59639f,_0x1a6d45)['then'](function(_0x315d8d){logger['info']('License,\x20%s,\x20%s',_0x131d2b,'request\x20sent');logger[_0x01e6('0xb')](_0x01e6('0xc'),_0x131d2b,_0x01e6('0xd'),JSON[_0x01e6('0xe')](_0x315d8d));if(_0x315d8d[_0x01e6('0xf')]){if(_0x315d8d['error']['code']===0x1f4){logger[_0x01e6('0xf')]('License,\x20%s,\x20%s',_0x131d2b,_0x315d8d[_0x01e6('0xf')][_0x01e6('0x10')]);return _0x1a6356(_0x315d8d['error']['message']);}logger[_0x01e6('0xf')](_0x01e6('0x11'),_0x131d2b,_0x315d8d['error'][_0x01e6('0x10')]);return _0x16916a(_0x315d8d[_0x01e6('0xf')][_0x01e6('0x10')]);}else{logger[_0x01e6('0x12')]('License,\x20%s,\x20%s',_0x131d2b,_0x01e6('0xd'));_0x16916a(_0x315d8d[_0x01e6('0x13')][_0x01e6('0x10')]);}})[_0x01e6('0x14')](function(_0x570114){logger[_0x01e6('0xf')]('License,\x20%s,\x20%s',_0x131d2b,_0x570114);_0x1a6356(_0x570114);});});} \ No newline at end of file +var _0x9020=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1e05a8,_0x289f89){var _0x1ce9ae=function(_0x564bc1){while(--_0x564bc1){_0x1e05a8['push'](_0x1e05a8['shift']());}};_0x1ce9ae(++_0x289f89);}(_0x9020,0x142));var _0x0902=function(_0x170310,_0x265c92){_0x170310=_0x170310-0x0;var _0x7f6112=_0x9020[_0x170310];return _0x7f6112;};'use strict';var _=require(_0x0902('0x0'));var util=require(_0x0902('0x1'));var moment=require(_0x0902('0x2'));var BPromise=require(_0x0902('0x3'));var rs=require(_0x0902('0x4'));var fs=require('fs');var Redis=require(_0x0902('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0902('0x6'));var logger=require('../../config/logger')(_0x0902('0x7'));var config=require(_0x0902('0x8'));var jayson=require(_0x0902('0x9'));var client=jayson[_0x0902('0xa')][_0x0902('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x304fe1,_0x471684,_0xdd082){return new BPromise(function(_0x1facb2,_0x389fa5){return client[_0x0902('0xc')](_0x304fe1,_0xdd082)[_0x0902('0xd')](function(_0x1c9c98){logger[_0x0902('0xe')](_0x0902('0xf'),_0x471684,_0x0902('0x10'));logger[_0x0902('0x11')](_0x0902('0x12'),_0x471684,_0x0902('0x10'),JSON[_0x0902('0x13')](_0x1c9c98));if(_0x1c9c98[_0x0902('0x14')]){if(_0x1c9c98[_0x0902('0x14')][_0x0902('0x15')]===0x1f4){logger[_0x0902('0x14')]('License,\x20%s,\x20%s',_0x471684,_0x1c9c98[_0x0902('0x14')][_0x0902('0x16')]);return _0x389fa5(_0x1c9c98['error'][_0x0902('0x16')]);}logger[_0x0902('0x14')](_0x0902('0xf'),_0x471684,_0x1c9c98[_0x0902('0x14')][_0x0902('0x16')]);return _0x1facb2(_0x1c9c98[_0x0902('0x14')][_0x0902('0x16')]);}else{logger[_0x0902('0xe')](_0x0902('0xf'),_0x471684,_0x0902('0x10'));_0x1facb2(_0x1c9c98[_0x0902('0x17')][_0x0902('0x16')]);}})[_0x0902('0x18')](function(_0x15d561){logger[_0x0902('0x14')](_0x0902('0xf'),_0x471684,_0x15d561);_0x389fa5(_0x15d561);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index bb22e2f..8a6c2f1 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 _0x70af=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','index','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addInteraction','addApplications','send','put','/:id','update','removeDispositions','removeAnswers','delete','destroy','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x70af,0x13d));var _0xf70a=function(_0x27d9df,_0x28e865){_0x27d9df=_0x27d9df-0x0;var _0x2596fa=_0x70af[_0x27d9df];return _0x2596fa;};'use strict';var multer=require(_0xf70a('0x0'));var util=require('util');var path=require(_0xf70a('0x1'));var timeout=require(_0xf70a('0x2'));var express=require('express');var router=express[_0xf70a('0x3')]();var fs_extra=require(_0xf70a('0x4'));var auth=require(_0xf70a('0x5'));var interaction=require(_0xf70a('0x6'));var config=require(_0xf70a('0x7'));var controller=require(_0xf70a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf70a('0x9')]);router[_0xf70a('0xa')](_0xf70a('0xb'),auth[_0xf70a('0xc')](),controller[_0xf70a('0xd')]);router[_0xf70a('0xa')]('/:id',auth[_0xf70a('0xc')](),controller[_0xf70a('0xe')]);router[_0xf70a('0xa')](_0xf70a('0xf'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x10')]);router[_0xf70a('0xa')]('/:id/canned_answers',auth[_0xf70a('0xc')](),controller[_0xf70a('0x11')]);router[_0xf70a('0xa')](_0xf70a('0x12'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x13')]);router[_0xf70a('0xa')](_0xf70a('0x14'),auth['isAuthenticated'](),controller[_0xf70a('0x15')]);router[_0xf70a('0xa')](_0xf70a('0x16'),auth[_0xf70a('0xc')](),controller['getInteractions']);router['get']('/:id/applications',auth[_0xf70a('0xc')](),controller[_0xf70a('0x17')]);router['get'](_0xf70a('0x18'),auth['isAuthenticated'](),controller['getMessages']);router[_0xf70a('0xa')](_0xf70a('0x19'),auth['isAuthenticated'](),controller[_0xf70a('0x1a')]);router[_0xf70a('0xa')](_0xf70a('0x1b'),auth[_0xf70a('0xc')](),controller['getAgents']);router[_0xf70a('0x1c')](_0xf70a('0xf'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x1d')]);router[_0xf70a('0x1c')](_0xf70a('0x1e'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x1f')]);router['post']('/',auth[_0xf70a('0xc')](),controller[_0xf70a('0x20')]);router[_0xf70a('0x1c')](_0xf70a('0x12'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x21')]);router[_0xf70a('0x1c')](_0xf70a('0x14'),auth[_0xf70a('0xc')](),controller['addSmtp']);router[_0xf70a('0x1c')](_0xf70a('0x16'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x22')]);router['post']('/:id/applications',auth[_0xf70a('0xc')](),controller[_0xf70a('0x23')]);router['post']('/:id/send',auth[_0xf70a('0xc')](),controller[_0xf70a('0x24')]);router[_0xf70a('0x1c')](_0xf70a('0x1b'),auth[_0xf70a('0xc')](),controller['addAgents']);router[_0xf70a('0x25')](_0xf70a('0x26'),auth['isAuthenticated'](),controller[_0xf70a('0x27')]);router['delete'](_0xf70a('0xf'),auth['isAuthenticated'](),controller[_0xf70a('0x28')]);router['delete']('/:id/canned_answers',auth[_0xf70a('0xc')](),controller[_0xf70a('0x29')]);router[_0xf70a('0x2a')](_0xf70a('0x12'),auth[_0xf70a('0xc')](),controller['removeImap']);router['delete']('/:id/out_servers',auth[_0xf70a('0xc')](),controller['removeSmtp']);router['delete'](_0xf70a('0x26'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x2b')]);router[_0xf70a('0x2a')](_0xf70a('0x1b'),auth[_0xf70a('0xc')](),controller[_0xf70a('0x2c')]);module[_0xf70a('0x2d')]=router; \ No newline at end of file +var _0xcc34=['isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','addImap','/:id/out_servers','addSmtp','/:id/send','send','/:id/users','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc34,0x1c3));var _0x4cc3=function(_0x1f8834,_0x541f29){_0x1f8834=_0x1f8834-0x0;var _0x325d2f=_0xcc34[_0x1f8834];return _0x325d2f;};'use strict';var multer=require(_0x4cc3('0x0'));var util=require(_0x4cc3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4cc3('0x2'));var router=express[_0x4cc3('0x3')]();var fs_extra=require(_0x4cc3('0x4'));var auth=require(_0x4cc3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4cc3('0x6'));var controller=require(_0x4cc3('0x7'));router[_0x4cc3('0x8')]('/',auth[_0x4cc3('0x9')](),controller[_0x4cc3('0xa')]);router[_0x4cc3('0x8')](_0x4cc3('0xb'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0xc')]);router[_0x4cc3('0x8')](_0x4cc3('0xd'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0xe')]);router[_0x4cc3('0x8')]('/:id/dispositions',auth[_0x4cc3('0x9')](),controller['getDispositions']);router['get'](_0x4cc3('0xf'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x10')]);router[_0x4cc3('0x8')](_0x4cc3('0x11'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x12')]);router[_0x4cc3('0x8')]('/:id/out_servers',auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x13')]);router['get'](_0x4cc3('0x14'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x15')]);router['get'](_0x4cc3('0x16'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x17')]);router[_0x4cc3('0x8')](_0x4cc3('0x18'),auth[_0x4cc3('0x9')](),controller['getMessages']);router[_0x4cc3('0x8')](_0x4cc3('0x19'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x4cc3('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4cc3('0x1a')]);router[_0x4cc3('0x1b')](_0x4cc3('0x1c'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x1d')]);router[_0x4cc3('0x1b')](_0x4cc3('0xf'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x1e')]);router[_0x4cc3('0x1b')]('/',auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x1f')]);router[_0x4cc3('0x1b')](_0x4cc3('0x11'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x20')]);router[_0x4cc3('0x1b')](_0x4cc3('0x21'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x22')]);router[_0x4cc3('0x1b')](_0x4cc3('0x14'),auth[_0x4cc3('0x9')](),controller['addInteraction']);router[_0x4cc3('0x1b')]('/:id/applications',auth[_0x4cc3('0x9')](),controller['addApplications']);router[_0x4cc3('0x1b')](_0x4cc3('0x23'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x24')]);router[_0x4cc3('0x1b')](_0x4cc3('0x25'),auth['isAuthenticated'](),controller[_0x4cc3('0x26')]);router['put'](_0x4cc3('0xd'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x27')]);router[_0x4cc3('0x28')](_0x4cc3('0x1c'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x29')]);router['delete'](_0x4cc3('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x4cc3('0x28')](_0x4cc3('0x11'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x2a')]);router[_0x4cc3('0x28')](_0x4cc3('0x21'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x2b')]);router[_0x4cc3('0x28')](_0x4cc3('0xd'),auth[_0x4cc3('0x9')](),controller[_0x4cc3('0x2c')]);router['delete'](_0x4cc3('0x25'),auth[_0x4cc3('0x9')](),controller['removeAgents']);module[_0x4cc3('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index cdc8be1..2f545c3 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 _0x2647=['provider','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','gmail','hotmail','yahoo','outlook365','getDataValue'];(function(_0x4fa8fe,_0x5cb28e){var _0x4148d0=function(_0x49f17a){while(--_0x49f17a){_0x4fa8fe['push'](_0x4fa8fe['shift']());}};_0x4148d0(++_0x5cb28e);}(_0x2647,0x169));var _0x7264=function(_0x5068d5,_0x353c3d){_0x5068d5=_0x5068d5-0x0;var _0x22123e=_0x2647[_0x5068d5];return _0x22123e;};'use strict';var Sequelize=require('sequelize');module[_0x7264('0x0')]={'description':{'type':Sequelize[_0x7264('0x1')]},'name':{'type':Sequelize[_0x7264('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x7264('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x7264('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7264('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x7264('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7264('0x1')],'allowNull':![],'defaultValue':_0x7264('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x7264('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7264('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7264('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7264('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7264('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7264('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7264('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7264('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7264('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x7264('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x7264('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x205662){if(!_0x205662)this[_0x7264('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x205662);}},'provider':{'type':Sequelize['ENUM'](_0x7264('0x9'),_0x7264('0xa'),_0x7264('0xb'),_0x7264('0xc')),'defaultValue':null,'get':function(){if(!this[_0x7264('0xd')](_0x7264('0xe')))return'custom';return this[_0x7264('0xd')](_0x7264('0xe'));},'set':function(_0x3e0bff){if(_0x3e0bff==='custom')_0x3e0bff=null;return this[_0x7264('0x8')](_0x7264('0xe'),_0x3e0bff);}}}; \ No newline at end of file +var _0xed2c=['hotmail','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xed2c,0x11e));var _0xced2=function(_0xf1226a,_0x29a250){_0xf1226a=_0xf1226a-0x0;var _0x1b8fe7=_0xed2c[_0xf1226a];return _0x1b8fe7;};'use strict';var Sequelize=require(_0xced2('0x0'));module[_0xced2('0x1')]={'description':{'type':Sequelize[_0xced2('0x2')]},'name':{'type':Sequelize[_0xced2('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xced2('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xced2('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xced2('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xced2('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xced2('0x4')]},'markAsUnread':{'type':Sequelize[_0xced2('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xced2('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xced2('0x4')],'defaultValue':function(){return _0xced2('0x6');}},'notificationSound':{'type':Sequelize[_0xced2('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xced2('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xced2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xced2('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xced2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xced2('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xced2('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xced2('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xced2('0x3')],'defaultValue':![],'comment':_0xced2('0x8'),'set':function(_0x5ad723){if(!_0x5ad723)this['setDataValue'](_0xced2('0x9'),null);this[_0xced2('0xa')](_0xced2('0xb'),_0x5ad723);}},'provider':{'type':Sequelize[_0xced2('0xc')](_0xced2('0xd'),_0xced2('0xe'),_0xced2('0xf'),_0xced2('0x10')),'defaultValue':null,'get':function(){if(!this[_0xced2('0x11')]('provider'))return _0xced2('0x12');return this[_0xced2('0x11')](_0xced2('0x13'));},'set':function(_0x49c382){if(_0x49c382===_0xced2('0x12'))_0x49c382=null;return this['setDataValue']('provider',_0x49c382);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f6b58b5..e309ed7 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 _0x5c27=['removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','json','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','server/files/attachments','basename','getSmtpOptions','List','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','status','offset','undefined','count','limit','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','end','sendStatus','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','show','params','rawAttributes','find','body','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions','findOne','Disposition','pick','MailAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','custom','provider','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp'];(function(_0x34603d,_0x111329){var _0x2a9d91=function(_0x33d252){while(--_0x33d252){_0x34603d['push'](_0x34603d['shift']());}};_0x2a9d91(++_0x111329);}(_0x5c27,0x109));var _0x75c2=function(_0x5d3313,_0x39c46e){_0x5d3313=_0x5d3313-0x0;var _0x40b46c=_0x5c27[_0x5d3313];return _0x40b46c;};'use strict';var moment=require(_0x75c2('0x0'));var BPromise=require(_0x75c2('0x1'));var util=require(_0x75c2('0x2'));var path=require('path');var _=require(_0x75c2('0x3'));var juice=require(_0x75c2('0x4'));var Redis=require(_0x75c2('0x5'));var qs=require(_0x75c2('0x6'));var logger=require(_0x75c2('0x7'))(_0x75c2('0x8'));var config=require('../../config/environment');var db=require(_0x75c2('0x9'))['db'];config[_0x75c2('0xa')]=_[_0x75c2('0xb')](config[_0x75c2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75c2('0xa')]));require(_0x75c2('0xc'))[_0x75c2('0xd')](socket);var jayson=require(_0x75c2('0xe'));var client=jayson[_0x75c2('0xf')][_0x75c2('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x314229,_0x5f431f,_0x5f28ab,_0x235120){return new BPromise(function(_0x279ad4,_0x2561a1){var _0x4c6f7a=_0x235120||client;return _0x4c6f7a[_0x75c2('0x11')](_0x314229,_0x5f28ab)[_0x75c2('0x12')](function(_0x396e81){logger[_0x75c2('0x13')]('MailAccount,\x20%s,\x20%s',_0x5f431f,_0x75c2('0x14'));logger[_0x75c2('0x15')](_0x75c2('0x16'),_0x5f431f,_0x75c2('0x14'),JSON[_0x75c2('0x17')](_0x396e81));if(_0x396e81[_0x75c2('0x18')]){if(_0x396e81[_0x75c2('0x18')][_0x75c2('0x19')]===0x1f4){logger[_0x75c2('0x18')](_0x75c2('0x1a'),_0x5f431f,_0x396e81[_0x75c2('0x18')][_0x75c2('0x1b')]);return _0x2561a1(_0x396e81[_0x75c2('0x18')]['message']);}logger['error'](_0x75c2('0x1a'),_0x5f431f,_0x396e81['error'][_0x75c2('0x1b')]);return _0x279ad4(_0x396e81['error']['message']);}else{logger[_0x75c2('0x13')](_0x75c2('0x1a'),_0x5f431f,'request\x20sent');_0x279ad4(_0x396e81[_0x75c2('0x1c')][_0x75c2('0x1b')]);}})[_0x75c2('0x1d')](function(_0x5b1114){logger[_0x75c2('0x18')]('MailAccount,\x20%s,\x20%s',_0x5f431f,_0x5b1114);_0x2561a1(_0x5b1114);});});}function respondWithStatusCode(_0x449ed3,_0x5c88b1){_0x5c88b1=_0x5c88b1||0xcc;return function(_0x58f825){if(_0x58f825){return _0x449ed3['sendStatus'](_0x5c88b1);}return _0x449ed3['status'](_0x5c88b1)['end']();};}function respondWithResult(_0x1e328c,_0x25c0c9){_0x25c0c9=_0x25c0c9||0xc8;return function(_0x2b53d4){if(_0x2b53d4){return _0x1e328c[_0x75c2('0x1e')](_0x25c0c9)['json'](_0x2b53d4);}};}function respondWithFilteredResult(_0x46eaef,_0x12f1d6){return function(_0x3a9fe0){if(_0x3a9fe0){var _0x4a4efc=typeof _0x12f1d6[_0x75c2('0x1f')]===_0x75c2('0x20')&&typeof _0x12f1d6['limit']===_0x75c2('0x20');var _0x158e43=_0x3a9fe0['count'];var _0x437b78=_0x4a4efc?0x0:_0x12f1d6['offset'];var _0x1b7f8f=_0x4a4efc?_0x3a9fe0[_0x75c2('0x21')]:_0x12f1d6[_0x75c2('0x1f')]+_0x12f1d6[_0x75c2('0x22')];var _0x4841f8;if(_0x1b7f8f>=_0x158e43){_0x1b7f8f=_0x158e43;_0x4841f8=0xc8;}else{_0x4841f8=0xce;}_0x46eaef[_0x75c2('0x1e')](_0x4841f8);return _0x46eaef[_0x75c2('0x23')](_0x75c2('0x24'),_0x437b78+'-'+_0x1b7f8f+'/'+_0x158e43)['json'](_0x3a9fe0);}return null;};}function saveUpdates(_0x4a3db8){return function(_0x1f11f4){if(_0x1f11f4){return _0x1f11f4[_0x75c2('0x25')](_0x4a3db8)[_0x75c2('0x12')](function(_0x2aef45){return _0x2aef45;});}return null;};}function removeEntity(_0x2075ef){return function(_0x10fc4c){if(_0x10fc4c){return _0x10fc4c[_0x75c2('0x26')]()[_0x75c2('0x12')](function(){var _0x1a46c3=_0x10fc4c[_0x75c2('0x27')]({'plain':!![]});var _0x44fd89=_0x75c2('0x28');return db[_0x75c2('0x29')][_0x75c2('0x26')]({'where':{'type':_0x44fd89,'resourceId':_0x1a46c3['id']}})[_0x75c2('0x12')](function(){return _0x10fc4c;});})[_0x75c2('0x12')](function(){_0x2075ef['status'](0xcc)[_0x75c2('0x2a')]();});}};}function handleEntityNotFound(_0x7a678b){return function(_0x3cba72){if(!_0x3cba72){_0x7a678b[_0x75c2('0x2b')](0x194);}return _0x3cba72;};}function handleError(_0x379947,_0x20f098){_0x20f098=_0x20f098||0x1f4;return function(_0xc83b47){logger[_0x75c2('0x18')](_0xc83b47[_0x75c2('0x2c')]);if(_0xc83b47[_0x75c2('0x2d')]){delete _0xc83b47[_0x75c2('0x2d')];}_0x379947[_0x75c2('0x1e')](_0x20f098)[_0x75c2('0x2e')](_0xc83b47);};}function getImapHost(_0x594eae){switch(_0x594eae){case _0x75c2('0x2f'):return'imap.gmail.com';case _0x75c2('0x30'):return _0x75c2('0x31');case _0x75c2('0x32'):return _0x75c2('0x33');case _0x75c2('0x34'):return _0x75c2('0x35');}throw new Error('Unknown\x20email\x20service\x20provider',_0x594eae);}function getSmtpHost(_0x4acc83){switch(_0x4acc83){case _0x75c2('0x2f'):return _0x75c2('0x36');case _0x75c2('0x30'):return'smtp.mail.yahoo.com';case _0x75c2('0x32'):return _0x75c2('0x37');case _0x75c2('0x34'):return _0x75c2('0x38');}throw new Error('Unknown\x20email\x20service\x20provider',_0x4acc83);}function getAuthenticationOptions(_0x56ea34,_0x5d676d){var _0x11000a={};var _0x55010e={};if(_0x56ea34){_0x11000a[_0x75c2('0x39')]=_0x55010e[_0x75c2('0x39')]=_0x5d676d[_0x75c2('0x3a')];_0x11000a[_0x75c2('0x3b')]=_0x55010e['pass']=_0x5d676d[_0x75c2('0x3b')];if(_0x5d676d[_0x75c2('0x3c')]){_0x11000a[_0x75c2('0x3c')]=_0x55010e[_0x75c2('0x3c')]=!![];_0x11000a[_0x75c2('0x3d')]=_0x55010e[_0x75c2('0x3d')]=_0x5d676d[_0x75c2('0x3d')];_0x11000a[_0x75c2('0x3b')]=_0x55010e[_0x75c2('0x3e')]=null;}else{_0x11000a[_0x75c2('0x3d')]=_0x55010e[_0x75c2('0x3d')]=null;}_0x11000a[_0x75c2('0x3f')]=getImapHost(_0x56ea34);_0x11000a[_0x75c2('0x40')]=0x3e1;_0x55010e[_0x75c2('0x3f')]=getSmtpHost(_0x56ea34);_0x55010e[_0x75c2('0x40')]=0x24b;_0x55010e[_0x75c2('0x41')]=![];_0x11000a[_0x75c2('0x42')]=_0x55010e[_0x75c2('0x42')]=null;}else{if(_0x5d676d[_0x75c2('0x43')]){_0x11000a[_0x75c2('0x39')]=_0x55010e[_0x75c2('0x39')]=_0x5d676d[_0x75c2('0x3a')];_0x11000a[_0x75c2('0x3b')]=_0x55010e[_0x75c2('0x3e')]=_0x5d676d[_0x75c2('0x3b')];}else{_0x11000a[_0x75c2('0x43')]=_0x55010e[_0x75c2('0x43')]=![];_0x11000a[_0x75c2('0x39')]=_0x55010e[_0x75c2('0x39')]=null;_0x11000a['password']=_0x55010e[_0x75c2('0x3e')]=null;}_0x11000a[_0x75c2('0x3f')]=_0x5d676d[_0x75c2('0x44')][_0x75c2('0x3f')];_0x11000a[_0x75c2('0x40')]=_0x5d676d[_0x75c2('0x44')][_0x75c2('0x40')];_0x55010e['host']=_0x5d676d[_0x75c2('0x45')][_0x75c2('0x3f')];_0x55010e[_0x75c2('0x40')]=_0x5d676d[_0x75c2('0x45')][_0x75c2('0x40')];}return{'Imap':_0x11000a,'Smtp':_0x55010e};}exports[_0x75c2('0x46')]=function(_0x10e3a2,_0x48a60a){var _0x14e64d={'include':[{'model':db[_0x75c2('0x47')],'as':_0x75c2('0x44')},{'model':db[_0x75c2('0x48')],'as':_0x75c2('0x45')},{'model':db[_0x75c2('0x49')],'as':_0x75c2('0x4a')}]},_0x15ff23={},_0x2b608e={'count':0x0,'rows':[]};var _0x16afca=_['map'](db['MailAccount']['rawAttributes'],function(_0x2e496a){return{'name':_0x2e496a[_0x75c2('0x4b')],'type':_0x2e496a[_0x75c2('0x4c')][_0x75c2('0x4d')]};});_0x15ff23[_0x75c2('0x4e')]=_[_0x75c2('0x4f')](_0x16afca,'name');_0x15ff23[_0x75c2('0x50')]=_[_0x75c2('0x51')](_0x10e3a2[_0x75c2('0x50')]);_0x15ff23[_0x75c2('0x52')]=_[_0x75c2('0x53')](_0x15ff23[_0x75c2('0x4e')],_0x15ff23['query']);_0x14e64d['attributes']=_[_0x75c2('0x53')](_0x15ff23[_0x75c2('0x4e')],qs[_0x75c2('0x54')](_0x10e3a2[_0x75c2('0x50')][_0x75c2('0x54')]));_0x14e64d[_0x75c2('0x55')]=_0x14e64d[_0x75c2('0x55')][_0x75c2('0x56')]?_0x14e64d[_0x75c2('0x55')]:_0x15ff23[_0x75c2('0x4e')];if(!_0x10e3a2[_0x75c2('0x50')][_0x75c2('0x57')](_0x75c2('0x58'))){_0x14e64d[_0x75c2('0x22')]=qs['limit'](_0x10e3a2[_0x75c2('0x50')]['limit']);_0x14e64d[_0x75c2('0x1f')]=qs[_0x75c2('0x1f')](_0x10e3a2[_0x75c2('0x50')][_0x75c2('0x1f')]);}_0x14e64d[_0x75c2('0x59')]=qs[_0x75c2('0x5a')](_0x10e3a2[_0x75c2('0x50')]['sort']);_0x14e64d[_0x75c2('0x5b')]=qs[_0x75c2('0x52')](_['pick'](_0x10e3a2[_0x75c2('0x50')],_0x15ff23[_0x75c2('0x52')]),_0x16afca);if(_0x10e3a2['query'][_0x75c2('0x5c')]){_0x14e64d[_0x75c2('0x5b')]=_[_0x75c2('0x5d')](_0x14e64d[_0x75c2('0x5b')],{'$or':_[_0x75c2('0x4f')](_0x16afca,function(_0x3ced89){if(_0x3ced89[_0x75c2('0x4c')]!==_0x75c2('0x5e')){var _0xea7c11={};_0xea7c11[_0x3ced89['name']]={'$like':'%'+_0x10e3a2[_0x75c2('0x50')][_0x75c2('0x5c')]+'%'};return _0xea7c11;}})});}_0x14e64d=_[_0x75c2('0x5d')]({},_0x14e64d,_0x10e3a2[_0x75c2('0x5f')]);var _0x4ee75d={'where':_0x14e64d[_0x75c2('0x5b')]};return db[_0x75c2('0x60')]['count'](_0x4ee75d)[_0x75c2('0x12')](function(_0x572010){_0x2b608e[_0x75c2('0x21')]=_0x572010;if(_0x10e3a2[_0x75c2('0x50')][_0x75c2('0x61')]){_0x14e64d[_0x75c2('0x62')]=[{'all':!![]}];}return db['MailAccount'][_0x75c2('0x63')](_0x14e64d);})[_0x75c2('0x12')](function(_0x2c76eb){_0x2b608e['rows']=_0x2c76eb;return _0x2b608e;})['then'](respondWithFilteredResult(_0x48a60a,_0x14e64d))[_0x75c2('0x1d')](handleError(_0x48a60a,null));};exports[_0x75c2('0x64')]=function(_0x675a0,_0x42e349){var _0x45c28a={'raw':![],'where':{'id':_0x675a0[_0x75c2('0x65')]['id']},'include':[{'model':db[_0x75c2('0x47')],'as':'Imap'},{'model':db[_0x75c2('0x48')],'as':_0x75c2('0x45')},{'model':db[_0x75c2('0x49')],'as':_0x75c2('0x4a')}]},_0x429b0a={};_0x429b0a['model']=_[_0x75c2('0x51')](db[_0x75c2('0x60')][_0x75c2('0x66')]);_0x429b0a[_0x75c2('0x50')]=_[_0x75c2('0x51')](_0x675a0[_0x75c2('0x50')]);_0x429b0a['filters']=_[_0x75c2('0x53')](_0x429b0a[_0x75c2('0x4e')],_0x429b0a[_0x75c2('0x50')]);_0x45c28a[_0x75c2('0x55')]=_['intersection'](_0x429b0a['model'],qs[_0x75c2('0x54')](_0x675a0[_0x75c2('0x50')][_0x75c2('0x54')]));_0x45c28a[_0x75c2('0x55')]=_0x45c28a['attributes'][_0x75c2('0x56')]?_0x45c28a[_0x75c2('0x55')]:_0x429b0a[_0x75c2('0x4e')];if(_0x675a0[_0x75c2('0x50')]['includeAll']){_0x45c28a[_0x75c2('0x62')]=[{'all':!![]}];}_0x45c28a=_[_0x75c2('0x5d')]({},_0x45c28a,_0x675a0[_0x75c2('0x5f')]);return db['MailAccount'][_0x75c2('0x67')](_0x45c28a)['then'](handleEntityNotFound(_0x42e349,null))[_0x75c2('0x12')](respondWithResult(_0x42e349,null))[_0x75c2('0x1d')](handleError(_0x42e349,null));};exports[_0x75c2('0x25')]=function(_0x2e2f7c,_0x1cce14){if(_0x2e2f7c[_0x75c2('0x68')]['id']){delete _0x2e2f7c[_0x75c2('0x68')]['id'];}var _0x2f6092=_0x2e2f7c[_0x75c2('0x68')]['provider']==='custom'?null:_0x2e2f7c[_0x75c2('0x68')]['provider'];var _0xdac84a=_0x2e2f7c[_0x75c2('0x68')][_0x75c2('0x44')]||{};var _0x46a4e8=_0x2e2f7c[_0x75c2('0x68')][_0x75c2('0x45')]||{};if(_0x2f6092){_0xdac84a[_0x75c2('0x3f')]=getImapHost(_0x2f6092);_0xdac84a[_0x75c2('0x40')]=0x3e1;_0x46a4e8['host']=getSmtpHost(_0x2f6092);_0x46a4e8['port']=0x24b;_0x46a4e8[_0x75c2('0x41')]=![];}if(_0x46a4e8[_0x75c2('0x3c')]){_0x46a4e8[_0x75c2('0x41')]=![];}else{_0x46a4e8['CloudProviderId']=null;}if(!_0xdac84a['modernAuthentication'])_0xdac84a['CloudProviderId']=null;_0x2e2f7c['body'][_0x75c2('0x44')]=_0xdac84a;_0x2e2f7c[_0x75c2('0x68')]['Smtp']=_0x46a4e8;return db[_0x75c2('0x60')]['find']({'where':{'id':_0x2e2f7c[_0x75c2('0x65')]['id']},'include':[{'model':db[_0x75c2('0x47')],'as':_0x75c2('0x44')},{'model':db[_0x75c2('0x48')],'as':_0x75c2('0x45')},{'model':db[_0x75c2('0x49')],'as':_0x75c2('0x4a')}]})[_0x75c2('0x12')](handleEntityNotFound(_0x1cce14,null))['then'](function(_0x5ebf30){if(!_0x5ebf30)throw new Error(_0x75c2('0x69'));if(_0x5ebf30['service'])delete _0x2e2f7c[_0x75c2('0x68')]['Imap'];return _0x5ebf30;})[_0x75c2('0x12')](saveUpdates(_0x2e2f7c[_0x75c2('0x68')],null))[_0x75c2('0x12')](function(_0x58c905){if(!_0x2e2f7c['body'][_0x75c2('0x44')])return _0x58c905;return db[_0x75c2('0x47')]['update'](_0x2e2f7c[_0x75c2('0x68')]['Imap'],{'where':{'MailAccountId':_0x58c905['id']}})[_0x75c2('0x12')](function(){return _0x58c905;});})[_0x75c2('0x12')](function(_0x23dd11){if(!_0x2e2f7c[_0x75c2('0x68')][_0x75c2('0x45')])return _0x23dd11;return db[_0x75c2('0x48')][_0x75c2('0x25')](_0x2e2f7c[_0x75c2('0x68')]['Smtp'],{'where':{'MailAccountId':_0x23dd11['id']}})[_0x75c2('0x12')](function(){return _0x23dd11;});})[_0x75c2('0x12')](respondWithResult(_0x1cce14,null))['catch'](handleError(_0x1cce14,null));};exports[_0x75c2('0x6a')]=function(_0x4609e9,_0x2d65ae){return db[_0x75c2('0x60')][_0x75c2('0x6a')]()['then'](respondWithResult(_0x2d65ae,null))['catch'](handleError(_0x2d65ae,null));};exports[_0x75c2('0x6b')]=function(_0x1f5b98,_0x23e09f){if(_0x1f5b98['body']['id']){delete _0x1f5b98[_0x75c2('0x68')]['id'];}return db[_0x75c2('0x60')][_0x75c2('0x67')]({'where':{'id':_0x1f5b98[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x23e09f,null))['then'](function(_0x363eb7){if(_0x363eb7){_0x1f5b98[_0x75c2('0x68')]['MailAccountId']=_0x363eb7['id'];return db['Disposition'][_0x75c2('0x6c')](_0x1f5b98['body']);}})[_0x75c2('0x12')](respondWithResult(_0x23e09f,null))['catch'](handleError(_0x23e09f,null));};exports[_0x75c2('0x6d')]=function(_0x342a62,_0x5ad15e){var _0xf2dab7={'raw':![],'where':{}};var _0x2409a0={};var _0x1bd0ec={'count':0x0,'rows':[]};return db[_0x75c2('0x60')][_0x75c2('0x6e')]({'where':{'id':_0x342a62[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x5ad15e,null))['then'](function(_0x2916b9){if(_0x2916b9){_0x2409a0['model']=_[_0x75c2('0x51')](db[_0x75c2('0x6f')]['rawAttributes']);_0x2409a0[_0x75c2('0x50')]=_['keys'](_0x342a62[_0x75c2('0x50')]);_0x2409a0[_0x75c2('0x52')]=_['intersection'](_0x2409a0['model'],_0x2409a0[_0x75c2('0x50')]);_0xf2dab7[_0x75c2('0x55')]=_[_0x75c2('0x53')](_0x2409a0[_0x75c2('0x4e')],qs[_0x75c2('0x54')](_0x342a62[_0x75c2('0x50')][_0x75c2('0x54')]));_0xf2dab7[_0x75c2('0x55')]=_0xf2dab7['attributes'][_0x75c2('0x56')]?_0xf2dab7[_0x75c2('0x55')]:_0x2409a0[_0x75c2('0x4e')];if(!_0x342a62[_0x75c2('0x50')][_0x75c2('0x57')](_0x75c2('0x58'))){_0xf2dab7[_0x75c2('0x22')]=qs[_0x75c2('0x22')](_0x342a62[_0x75c2('0x50')][_0x75c2('0x22')]);_0xf2dab7[_0x75c2('0x1f')]=qs[_0x75c2('0x1f')](_0x342a62['query'][_0x75c2('0x1f')]);}_0xf2dab7[_0x75c2('0x59')]=qs[_0x75c2('0x5a')](_0x342a62[_0x75c2('0x50')][_0x75c2('0x5a')]);_0xf2dab7[_0x75c2('0x5b')]=qs[_0x75c2('0x52')](_[_0x75c2('0x70')](_0x342a62['query'],_0x2409a0[_0x75c2('0x52')]));_0xf2dab7[_0x75c2('0x5b')][_0x75c2('0x71')]=_0x2916b9['id'];if(_0x342a62[_0x75c2('0x50')][_0x75c2('0x5c')]){_0xf2dab7[_0x75c2('0x5b')]=_['merge'](_0xf2dab7[_0x75c2('0x5b')],{'$or':_[_0x75c2('0x4f')](_0xf2dab7[_0x75c2('0x55')],function(_0x1d3952){var _0x56e639={};_0x56e639[_0x1d3952]={'$like':'%'+_0x342a62['query'][_0x75c2('0x5c')]+'%'};return _0x56e639;})});}_0xf2dab7=_[_0x75c2('0x5d')]({},_0xf2dab7,_0x342a62['options']);return db['Disposition'][_0x75c2('0x21')]({'where':_0xf2dab7[_0x75c2('0x5b')]})['then'](function(_0x341d79){_0x1bd0ec['count']=_0x341d79;if(_0x342a62[_0x75c2('0x50')]['includeAll']){_0xf2dab7[_0x75c2('0x62')]=[{'all':!![]}];}return db[_0x75c2('0x6f')][_0x75c2('0x63')](_0xf2dab7);})[_0x75c2('0x12')](function(_0x1621aa){_0x1bd0ec[_0x75c2('0x72')]=_0x1621aa;return _0x1bd0ec;});}})[_0x75c2('0x12')](respondWithFilteredResult(_0x5ad15e,_0xf2dab7))[_0x75c2('0x1d')](handleError(_0x5ad15e,null));};exports[_0x75c2('0x73')]=function(_0x5053a5,_0x36e8bb){return db[_0x75c2('0x60')]['find']({'where':{'id':_0x5053a5[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x36e8bb,null))[_0x75c2('0x12')](function(_0x10911e){if(_0x10911e){return _0x10911e[_0x75c2('0x73')](_0x5053a5['query'][_0x75c2('0x74')]);}})[_0x75c2('0x12')](respondWithStatusCode(_0x36e8bb,null))[_0x75c2('0x1d')](handleError(_0x36e8bb,null));};exports[_0x75c2('0x75')]=function(_0x237466,_0x30bc36){if(_0x237466['body']['id']){delete _0x237466[_0x75c2('0x68')]['id'];}return db[_0x75c2('0x60')][_0x75c2('0x67')]({'where':{'id':_0x237466[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x30bc36,null))[_0x75c2('0x12')](function(_0x1e9f0b){if(_0x1e9f0b){_0x237466[_0x75c2('0x68')]['MailAccountId']=_0x1e9f0b['id'];return db[_0x75c2('0x76')][_0x75c2('0x6c')](_0x237466[_0x75c2('0x68')]);}})[_0x75c2('0x12')](respondWithResult(_0x30bc36,null))[_0x75c2('0x1d')](handleError(_0x30bc36,null));};exports[_0x75c2('0x77')]=function(_0x2bd13c,_0x8921ed){var _0x453f72={'raw':![],'where':{}};var _0x5f0b06={};var _0x1fa458={'count':0x0,'rows':[]};return db[_0x75c2('0x60')]['findOne']({'where':{'id':_0x2bd13c[_0x75c2('0x65')]['id']}})['then'](handleEntityNotFound(_0x8921ed,null))[_0x75c2('0x12')](function(_0x237357){if(_0x237357){_0x5f0b06[_0x75c2('0x4e')]=_['keys'](db[_0x75c2('0x76')][_0x75c2('0x66')]);_0x5f0b06[_0x75c2('0x50')]=_[_0x75c2('0x51')](_0x2bd13c[_0x75c2('0x50')]);_0x5f0b06[_0x75c2('0x52')]=_[_0x75c2('0x53')](_0x5f0b06[_0x75c2('0x4e')],_0x5f0b06[_0x75c2('0x50')]);_0x453f72['attributes']=_[_0x75c2('0x53')](_0x5f0b06['model'],qs['fields'](_0x2bd13c['query']['fields']));_0x453f72['attributes']=_0x453f72[_0x75c2('0x55')][_0x75c2('0x56')]?_0x453f72[_0x75c2('0x55')]:_0x5f0b06['model'];if(!_0x2bd13c[_0x75c2('0x50')]['hasOwnProperty'](_0x75c2('0x58'))){_0x453f72[_0x75c2('0x22')]=qs['limit'](_0x2bd13c['query'][_0x75c2('0x22')]);_0x453f72['offset']=qs[_0x75c2('0x1f')](_0x2bd13c[_0x75c2('0x50')][_0x75c2('0x1f')]);}_0x453f72[_0x75c2('0x59')]=qs['sort'](_0x2bd13c[_0x75c2('0x50')]['sort']);_0x453f72[_0x75c2('0x5b')]=qs[_0x75c2('0x52')](_['pick'](_0x2bd13c[_0x75c2('0x50')],_0x5f0b06[_0x75c2('0x52')]));_0x453f72[_0x75c2('0x5b')][_0x75c2('0x71')]=_0x237357['id'];if(_0x2bd13c[_0x75c2('0x50')]['filter']){_0x453f72['where']=_['merge'](_0x453f72[_0x75c2('0x5b')],{'$or':_[_0x75c2('0x4f')](_0x453f72[_0x75c2('0x55')],function(_0x703078){var _0x3f869d={};_0x3f869d[_0x703078]={'$like':'%'+_0x2bd13c[_0x75c2('0x50')][_0x75c2('0x5c')]+'%'};return _0x3f869d;})});}_0x453f72=_[_0x75c2('0x5d')]({},_0x453f72,_0x2bd13c['options']);return db['CannedAnswer'][_0x75c2('0x21')]({'where':_0x453f72['where']})[_0x75c2('0x12')](function(_0x500209){_0x1fa458[_0x75c2('0x21')]=_0x500209;if(_0x2bd13c['query'][_0x75c2('0x61')]){_0x453f72[_0x75c2('0x62')]=[{'all':!![]}];}return db[_0x75c2('0x76')][_0x75c2('0x63')](_0x453f72);})[_0x75c2('0x12')](function(_0x3c8ba5){_0x1fa458['rows']=_0x3c8ba5;return _0x1fa458;});}})[_0x75c2('0x12')](respondWithFilteredResult(_0x8921ed,_0x453f72))['catch'](handleError(_0x8921ed,null));};exports['removeAnswers']=function(_0x22c7a0,_0x3279d0){return db[_0x75c2('0x60')][_0x75c2('0x67')]({'where':{'id':_0x22c7a0[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x3279d0,null))[_0x75c2('0x12')](function(_0x355f9b){if(_0x355f9b){return _0x355f9b[_0x75c2('0x78')](_0x22c7a0[_0x75c2('0x50')][_0x75c2('0x74')]);}})[_0x75c2('0x12')](respondWithStatusCode(_0x3279d0,null))[_0x75c2('0x1d')](handleError(_0x3279d0,null));};exports['create']=function(_0x304ce0,_0x3a328c){var _0x46e9a5={'name':_0x304ce0['body'][_0x75c2('0x2d')],'key':_0x304ce0[_0x75c2('0x68')][_0x75c2('0x4d')],'provider':_0x304ce0[_0x75c2('0x68')]['provider']===_0x75c2('0x79')?null:_0x304ce0[_0x75c2('0x68')][_0x75c2('0x7a')],'email':_0x304ce0[_0x75c2('0x68')]['email'],'ListId':_0x304ce0[_0x75c2('0x68')]['ListId'],'active':!_['isNil'](_0x304ce0['body'][_0x75c2('0x7b')])?_0x304ce0['body']['active']:!![],'description':_0x304ce0[_0x75c2('0x68')][_0x75c2('0x7c')]||null};var _0x4ab250=getAuthenticationOptions(_0x46e9a5[_0x75c2('0x7a')],_0x304ce0['body']);_0x46e9a5[_0x75c2('0x44')]=_0x4ab250[_0x75c2('0x44')];_0x46e9a5[_0x75c2('0x45')]=_0x4ab250['Smtp'];return db[_0x75c2('0x60')][_0x75c2('0x6c')](_0x46e9a5,{'include':[{'model':db[_0x75c2('0x48')],'as':_0x75c2('0x45')},{'model':db['MailServerIn'],'as':_0x75c2('0x44')}]})['then'](function(_0x2a58a0){var _0x59e35a=_0x304ce0[_0x75c2('0x39')][_0x75c2('0x27')]({'plain':!![]});if(!_0x59e35a)throw new Error(_0x75c2('0x7d'));if(_0x59e35a['role']==='user'){var _0x4b013a=_0x2a58a0[_0x75c2('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x75c2('0x67')]({'where':{'name':_0x75c2('0x28'),'userProfileId':_0x59e35a[_0x75c2('0x7e')]},'raw':!![]})[_0x75c2('0x12')](function(_0x24dd25){if(_0x24dd25&&_0x24dd25[_0x75c2('0x7f')]===0x0){return db['UserProfileResource'][_0x75c2('0x6c')]({'name':_0x4b013a[_0x75c2('0x2d')],'resourceId':_0x4b013a['id'],'type':_0x24dd25[_0x75c2('0x2d')],'sectionId':_0x24dd25['id']},{})[_0x75c2('0x12')](function(){return _0x2a58a0;});}else{return _0x2a58a0;}})[_0x75c2('0x1d')](function(_0x5cbf7f){logger[_0x75c2('0x18')](_0x75c2('0x80'),_0x5cbf7f);throw _0x5cbf7f;});}return _0x2a58a0;})[_0x75c2('0x12')](respondWithResult(_0x3a328c,0xc9))[_0x75c2('0x1d')](handleError(_0x3a328c,null));};exports[_0x75c2('0x81')]=function(_0x10da02,_0x2fda14){return db[_0x75c2('0x60')][_0x75c2('0x6e')]({'where':{'id':_0x10da02['params']['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x2fda14,null))[_0x75c2('0x12')](function(_0x395157){if(_0x395157){return _0x395157[_0x75c2('0x81')]();}return null;})['then'](respondWithResult(_0x2fda14,null))[_0x75c2('0x1d')](handleError(_0x2fda14,null));};exports[_0x75c2('0x82')]=function(_0x3ebd6a,_0x2cfa6f){if(_0x3ebd6a[_0x75c2('0x68')]['id']){delete _0x3ebd6a['body']['id'];}return db['MailAccount'][_0x75c2('0x67')]({'where':{'id':_0x3ebd6a[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x2cfa6f,null))['then'](function(_0x938830){if(_0x938830){_0x3ebd6a[_0x75c2('0x68')]['MailAccountId']=_0x938830['id'];return db[_0x75c2('0x47')][_0x75c2('0x6c')](_0x3ebd6a[_0x75c2('0x68')]);}})[_0x75c2('0x12')](respondWithResult(_0x2cfa6f,null))[_0x75c2('0x1d')](handleError(_0x2cfa6f,null));};exports[_0x75c2('0x83')]=function(_0x3dae29,_0x4af4fe){return db[_0x75c2('0x60')]['findOne']({'where':{'id':_0x3dae29['params']['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x4af4fe,null))['then'](function(_0x17bd63){if(_0x17bd63){return _0x17bd63[_0x75c2('0x84')](null);}return null;})[_0x75c2('0x12')](respondWithStatusCode(_0x4af4fe,null))[_0x75c2('0x1d')](handleError(_0x4af4fe,null));};exports[_0x75c2('0x85')]=function(_0x4a2747,_0x23c9f5){return db['MailAccount'][_0x75c2('0x6e')]({'where':{'id':_0x4a2747[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x23c9f5,null))['then'](function(_0x21b214){if(_0x21b214){return _0x21b214[_0x75c2('0x85')]();}return null;})[_0x75c2('0x12')](respondWithResult(_0x23c9f5,null))[_0x75c2('0x1d')](handleError(_0x23c9f5,null));};exports[_0x75c2('0x86')]=function(_0x51c4f7,_0x455d6b){if(_0x51c4f7['body']['id']){delete _0x51c4f7[_0x75c2('0x68')]['id'];}return db[_0x75c2('0x60')][_0x75c2('0x67')]({'where':{'id':_0x51c4f7[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x455d6b,null))['then'](function(_0x3e667e){if(_0x3e667e){_0x51c4f7[_0x75c2('0x68')][_0x75c2('0x71')]=_0x3e667e['id'];return db[_0x75c2('0x48')][_0x75c2('0x6c')](_0x51c4f7['body']);}})[_0x75c2('0x12')](respondWithResult(_0x455d6b,null))[_0x75c2('0x1d')](handleError(_0x455d6b,null));};exports[_0x75c2('0x87')]=function(_0x2555b2,_0x4f0b28){return db[_0x75c2('0x60')]['findOne']({'where':{'id':_0x2555b2['params']['id']}})['then'](handleEntityNotFound(_0x4f0b28,null))[_0x75c2('0x12')](function(_0x58c680){if(_0x58c680){return _0x58c680[_0x75c2('0x88')](null);}return null;})[_0x75c2('0x12')](respondWithStatusCode(_0x4f0b28,null))[_0x75c2('0x1d')](handleError(_0x4f0b28,null));};exports['addInteraction']=function(_0x5d4d60,_0x147cdb){return db[_0x75c2('0x89')][_0x75c2('0x67')]({'where':{'id':_0x5d4d60[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x147cdb,null))[_0x75c2('0x12')](function(_0x4f08f5){if(_0x4f08f5){return _0x4f08f5[_0x75c2('0x8a')](_0x5d4d60['body']['ids'],_[_0x75c2('0x8b')](_0x5d4d60['body'],[_0x75c2('0x74'),'id'])||{});}})[_0x75c2('0x12')](respondWithResult(_0x147cdb,null))['catch'](handleError(_0x147cdb,null));};exports[_0x75c2('0x8c')]=function(_0x1b54c2,_0x3c34b4){var _0x4f3111={'raw':![],'where':{}};var _0x3d2baa={};var _0x1b35db={'count':0x0,'rows':[]};return db[_0x75c2('0x60')][_0x75c2('0x6e')]({'where':{'id':_0x1b54c2[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x3c34b4,null))[_0x75c2('0x12')](function(_0x447cf0){if(_0x447cf0){_0x3d2baa[_0x75c2('0x4e')]=_[_0x75c2('0x51')](db[_0x75c2('0x89')]['rawAttributes']);_0x3d2baa['query']=_[_0x75c2('0x51')](_0x1b54c2[_0x75c2('0x50')]);_0x3d2baa['filters']=_[_0x75c2('0x53')](_0x3d2baa[_0x75c2('0x4e')],_0x3d2baa['query']);_0x4f3111['attributes']=_[_0x75c2('0x53')](_0x3d2baa[_0x75c2('0x4e')],qs[_0x75c2('0x54')](_0x1b54c2[_0x75c2('0x50')][_0x75c2('0x54')]));_0x4f3111[_0x75c2('0x55')]=_0x4f3111['attributes'][_0x75c2('0x56')]?_0x4f3111[_0x75c2('0x55')]:_0x3d2baa[_0x75c2('0x4e')];if(!_0x1b54c2[_0x75c2('0x50')]['hasOwnProperty']('nolimit')){_0x4f3111['limit']=qs[_0x75c2('0x22')](_0x1b54c2[_0x75c2('0x50')][_0x75c2('0x22')]);_0x4f3111['offset']=qs[_0x75c2('0x1f')](_0x1b54c2['query'][_0x75c2('0x1f')]);}_0x4f3111[_0x75c2('0x59')]=qs[_0x75c2('0x5a')](_0x1b54c2[_0x75c2('0x50')][_0x75c2('0x5a')]);_0x4f3111['where']=qs[_0x75c2('0x52')](_[_0x75c2('0x70')](_0x1b54c2['query'],_0x3d2baa['filters']));_0x4f3111[_0x75c2('0x5b')][_0x75c2('0x71')]=_0x447cf0['id'];if(_0x1b54c2[_0x75c2('0x50')][_0x75c2('0x5c')]){_0x4f3111[_0x75c2('0x5b')]=_['merge'](_0x4f3111['where'],{'$or':_[_0x75c2('0x4f')](_0x4f3111['attributes'],function(_0x1ccad2){var _0x1da130={};_0x1da130[_0x1ccad2]={'$like':'%'+_0x1b54c2['query'][_0x75c2('0x5c')]+'%'};return _0x1da130;})});}_0x4f3111=_[_0x75c2('0x5d')]({},_0x4f3111,_0x1b54c2[_0x75c2('0x5f')]);return db[_0x75c2('0x89')]['count']({'where':_0x4f3111[_0x75c2('0x5b')]})[_0x75c2('0x12')](function(_0x28d26b){_0x1b35db[_0x75c2('0x21')]=_0x28d26b;if(_0x1b54c2['query'][_0x75c2('0x61')]){_0x4f3111['include']=[{'model':db[_0x75c2('0x8d')],'as':_0x75c2('0x8e'),'required':![]},{'model':db[_0x75c2('0x8f')],'as':_0x75c2('0x90'),'attributes':[_0x75c2('0x2d'),'fullname',_0x75c2('0x91')],'required':![]},{'model':db[_0x75c2('0x92')],'as':_0x75c2('0x93'),'attributes':['id',_0x75c2('0x2d'),_0x75c2('0x94')],'where':_0x1b54c2[_0x75c2('0x50')][_0x75c2('0x95')]?{'id':_0x1b54c2[_0x75c2('0x50')]['tag']}:undefined,'required':_0x1b54c2[_0x75c2('0x50')]['tag']?!![]:![]}];}return db[_0x75c2('0x89')]['findAll'](_0x4f3111);})[_0x75c2('0x12')](function(_0x16182f){_0x1b35db[_0x75c2('0x72')]=_0x16182f;return _0x1b35db;});}})[_0x75c2('0x12')](respondWithFilteredResult(_0x3c34b4,_0x4f3111))[_0x75c2('0x1d')](handleError(_0x3c34b4,null));};exports[_0x75c2('0x96')]=function addApplications(_0x4a3630,_0x3a9c62){var _0x676e76=_0x4a3630[_0x75c2('0x65')]['id'];var _0x1219a8=_0x4a3630['body'];var _0x392c56=0xc8;var _0x2afc5e=null;return db[_0x75c2('0x97')]['transaction']({'isolationLevel':db['sequelize'][_0x75c2('0x98')][_0x75c2('0x99')][_0x75c2('0x9a')]},function(_0x3b331f){return db[_0x75c2('0x60')]['findOne']({'where':{'id':_0x676e76},'transaction':_0x3b331f})['then'](function(_0x31b860){if(_0x31b860){return db[_0x75c2('0x9b')]['destroy']({'where':{'MailAccountId':_0x676e76},'transaction':_0x3b331f})[_0x75c2('0x12')](function(){var _0x350ccd=_[_0x75c2('0x4f')](_0x1219a8,function(_0x419d1c){_0x419d1c[_0x75c2('0x71')]=_0x676e76;return _0x419d1c;});return db[_0x75c2('0x9b')][_0x75c2('0x9c')](_0x350ccd,{'transaction':_0x3b331f});});}else{_0x392c56=0x194;_0x2afc5e=[];}});})['then'](function(){if(_0x392c56!==0x194){return db['MailApplication'][_0x75c2('0x9d')]({'where':{'MailAccountId':_0x676e76},'order':_0x75c2('0x9e')})['then'](function(_0x1df529){_0x2afc5e=_0x1df529;});}})[_0x75c2('0x1d')](function(_0x3d4d2e){_0x392c56=0x1f4;logger[_0x75c2('0x18')](_0x3d4d2e[_0x75c2('0x2c')]);if(_0x3d4d2e[_0x75c2('0x2d')]){delete _0x3d4d2e[_0x75c2('0x2d')];}_0x2afc5e=_0x3d4d2e;})['finally'](function(){if(_0x2afc5e===null){_0x3a9c62[_0x75c2('0x2b')](_0x392c56);}else{if(_0x392c56===0x1f4){_0x3a9c62['status'](_0x392c56)['send'](_0x2afc5e);}else{_0x3a9c62[_0x75c2('0x1e')](_0x392c56)[_0x75c2('0x9f')](_0x2afc5e);}}});};exports[_0x75c2('0xa0')]=function(_0xc743ca,_0x329421){var _0x28e18d={};var _0x5495d5={};var _0x38eaf9;var _0x570a53;return db[_0x75c2('0x60')]['findOne']({'where':{'id':_0xc743ca[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x329421,null))[_0x75c2('0x12')](function(_0x59aa1f){if(_0x59aa1f){_0x38eaf9=_0x59aa1f;_0x5495d5['model']=_[_0x75c2('0x51')](db['MailApplication']['rawAttributes']);_0x5495d5['query']=_[_0x75c2('0x51')](_0xc743ca['query']);_0x5495d5['filters']=_['intersection'](_0x5495d5[_0x75c2('0x4e')],_0x5495d5[_0x75c2('0x50')]);_0x28e18d[_0x75c2('0x55')]=_[_0x75c2('0x53')](_0x5495d5['model'],qs[_0x75c2('0x54')](_0xc743ca[_0x75c2('0x50')][_0x75c2('0x54')]));_0x28e18d[_0x75c2('0x55')]=_0x28e18d[_0x75c2('0x55')][_0x75c2('0x56')]?_0x28e18d[_0x75c2('0x55')]:_0x5495d5[_0x75c2('0x4e')];_0x28e18d[_0x75c2('0x59')]=qs[_0x75c2('0x5a')](_0xc743ca[_0x75c2('0x50')][_0x75c2('0x5a')]);_0x28e18d[_0x75c2('0x5b')]=qs[_0x75c2('0x52')](_['pick'](_0xc743ca[_0x75c2('0x50')],_0x5495d5['filters']));if(_0xc743ca[_0x75c2('0x50')][_0x75c2('0x5c')]){_0x28e18d[_0x75c2('0x5b')]=_['merge'](_0x28e18d['where'],{'$or':_[_0x75c2('0x4f')](_0x28e18d[_0x75c2('0x55')],function(_0x73ddcb){var _0x4df654={};_0x4df654[_0x73ddcb]={'$like':'%'+_0xc743ca[_0x75c2('0x50')][_0x75c2('0x5c')]+'%'};return _0x4df654;})});}_0x28e18d=_['merge']({},_0x28e18d,_0xc743ca[_0x75c2('0x5f')]);return _0x38eaf9['getApplications'](_0x28e18d);}})[_0x75c2('0x12')](function(_0x4c6bc1){if(_0x4c6bc1){_0x570a53=_0x4c6bc1[_0x75c2('0x56')];if(!_0xc743ca[_0x75c2('0x50')]['hasOwnProperty'](_0x75c2('0x58'))){_0x28e18d[_0x75c2('0x22')]=qs[_0x75c2('0x22')](_0xc743ca['query'][_0x75c2('0x22')]);_0x28e18d[_0x75c2('0x1f')]=qs[_0x75c2('0x1f')](_0xc743ca['query'][_0x75c2('0x1f')]);}return _0x38eaf9[_0x75c2('0xa0')](_0x28e18d);}})[_0x75c2('0x12')](function(_0x44c0c9){if(_0x44c0c9){return _0x44c0c9?{'count':_0x570a53,'rows':_0x44c0c9}:null;}})[_0x75c2('0x12')](respondWithResult(_0x329421,null))[_0x75c2('0x1d')](handleError(_0x329421,null));};exports[_0x75c2('0xa1')]=function(_0x544077,_0x34280b){var _0x396b98={'raw':!![],'where':{}};var _0x4d8c71={};var _0x34264c={'count':0x0,'rows':[]};return db[_0x75c2('0x60')][_0x75c2('0x6e')]({'where':{'id':_0x544077['params']['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x34280b,null))[_0x75c2('0x12')](function(_0x306f8b){if(_0x306f8b){_0x4d8c71[_0x75c2('0x4e')]=_[_0x75c2('0x51')](db[_0x75c2('0xa2')][_0x75c2('0x66')]);_0x4d8c71[_0x75c2('0x50')]=_[_0x75c2('0x51')](_0x544077[_0x75c2('0x50')]);_0x4d8c71[_0x75c2('0x52')]=_[_0x75c2('0x53')](_0x4d8c71[_0x75c2('0x4e')],_0x4d8c71[_0x75c2('0x50')]);_0x396b98[_0x75c2('0x55')]=_['intersection'](_0x4d8c71[_0x75c2('0x4e')],qs[_0x75c2('0x54')](_0x544077['query']['fields']));_0x396b98[_0x75c2('0x55')]=_0x396b98[_0x75c2('0x55')][_0x75c2('0x56')]?_0x396b98[_0x75c2('0x55')]:_0x4d8c71[_0x75c2('0x4e')];if(!_0x544077[_0x75c2('0x50')][_0x75c2('0x57')](_0x75c2('0x58'))){_0x396b98[_0x75c2('0x22')]=qs[_0x75c2('0x22')](_0x544077['query'][_0x75c2('0x22')]);_0x396b98[_0x75c2('0x1f')]=qs[_0x75c2('0x1f')](_0x544077[_0x75c2('0x50')][_0x75c2('0x1f')]);}_0x396b98['order']=qs[_0x75c2('0x5a')](_0x544077[_0x75c2('0x50')]['sort']);_0x396b98[_0x75c2('0x5b')]=qs[_0x75c2('0x52')](_[_0x75c2('0x70')](_0x544077[_0x75c2('0x50')],_0x4d8c71[_0x75c2('0x52')]));_0x396b98['where']['MailAccountId']=_0x306f8b['id'];if(_0x544077[_0x75c2('0x50')]['filter']){_0x396b98[_0x75c2('0x5b')]=_[_0x75c2('0x5d')](_0x396b98[_0x75c2('0x5b')],{'$or':_[_0x75c2('0x4f')](_0x396b98[_0x75c2('0x55')],function(_0x4d9933){var _0x5377c5={};_0x5377c5[_0x4d9933]={'$like':'%'+_0x544077[_0x75c2('0x50')]['filter']+'%'};return _0x5377c5;})});}if(_0x544077[_0x75c2('0x50')][_0x75c2('0xa3')]){var _0x362984=_0x544077[_0x75c2('0x50')]['$gte'][_0x75c2('0xa4')](',');var _0x4dc74e={};_0x4dc74e[_0x362984[0x0]]={'$gte':moment(_0x362984[0x1])[_0x75c2('0xa5')](_0x75c2('0xa6'))};_0x396b98[_0x75c2('0x5b')]=_[_0x75c2('0x5d')](_0x396b98[_0x75c2('0x5b')],_0x4dc74e);}_0x396b98=_[_0x75c2('0x5d')]({},_0x396b98,_0x544077[_0x75c2('0x5f')]);return db[_0x75c2('0xa2')][_0x75c2('0x21')]({'where':_0x396b98[_0x75c2('0x5b')]})[_0x75c2('0x12')](function(_0x23188e){_0x34264c[_0x75c2('0x21')]=_0x23188e;if(_0x544077['query']['includeAll']){_0x396b98['include']=[{'all':!![]}];}return db[_0x75c2('0xa2')][_0x75c2('0x63')](_0x396b98);})[_0x75c2('0x12')](function(_0x56d89b){if(_0x544077['query'][_0x75c2('0xa7')]===_0x75c2('0xa8')){for(var _0x47c834=0x0;_0x47c834<_0x56d89b['length'];_0x47c834++){_0x56d89b[_0x47c834][_0x75c2('0x68')]=juice(_0x56d89b[_0x47c834][_0x75c2('0x68')]);}}_0x34264c[_0x75c2('0x72')]=_0x56d89b;return _0x34264c;});}})[_0x75c2('0x12')](respondWithFilteredResult(_0x34280b,_0x396b98))['catch'](handleError(_0x34280b,null));};exports[_0x75c2('0x2e')]=function(_0x1acd36,_0x53ea39){var _0x28aace,_0x826471={},_0x7b0b2d;if(_0x1acd36[_0x75c2('0x68')]['to']){_0x7b0b2d=_0x1acd36[_0x75c2('0x68')]['to'][_0x75c2('0xa4')](',')[0x0];}return db[_0x75c2('0x60')][_0x75c2('0x67')]({'where':{'id':_0x1acd36['params']['id']},'include':[{'model':db[_0x75c2('0xa9')],'as':'List','include':[{'model':db[_0x75c2('0x8d')],'as':_0x75c2('0xaa'),'where':{'email':_0x7b0b2d},'limit':0x1,'order':[['updatedAt',_0x75c2('0xab')]]}]},{'model':db['MailServerOut'],'as':_0x75c2('0x45'),'raw':!![],'include':[{'model':db[_0x75c2('0xac')],'as':_0x75c2('0xac'),'raw':!![]}]}]})[_0x75c2('0x12')](handleEntityNotFound(_0x53ea39,null))['then'](function(_0x554edc){if(!_0x554edc)return;_0x28aace=_0x554edc;if(!_0x554edc[_0x75c2('0x45')])throw new Error(_0x75c2('0xad'));if(_['isNil'](_0x1acd36[_0x75c2('0x68')]['from'])){_0x1acd36['body'][_0x75c2('0xae')]=util[_0x75c2('0xa5')](_0x75c2('0xaf'),_0x554edc[_0x75c2('0x2d')],_0x554edc[_0x75c2('0xb0')]||_0x554edc[_0x75c2('0x45')][_0x75c2('0x39')]);}if(_0x1acd36[_0x75c2('0x68')][_0x75c2('0xb1')]&&_0x1acd36[_0x75c2('0x68')][_0x75c2('0xb1')][_0x75c2('0x56')]){for(var _0x4a3047=0x0;_0x4a3047<_0x1acd36['body']['attachments']['length'];_0x4a3047+=0x1){_0x1acd36['body'][_0x75c2('0xb1')][_0x4a3047]={'filename':_0x1acd36[_0x75c2('0x68')][_0x75c2('0xb1')][_0x4a3047][_0x75c2('0x2d')],'path':path['join'](config['root'],_0x75c2('0xb2'),_0x1acd36[_0x75c2('0x68')][_0x75c2('0xb1')][_0x4a3047][_0x75c2('0xb3')])};}}var _0x1a97b0=_0x554edc[_0x75c2('0xb4')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1a97b0,'message':_0x1acd36[_0x75c2('0x68')]});})[_0x75c2('0x12')](function(_0x3861ca){if(!_0x3861ca)return;_0x826471=_0x3861ca;if(!_0x28aace[_0x75c2('0xb5')])throw new Error(_0x75c2('0xb6'));if(_0x28aace[_0x75c2('0xb5')][_0x75c2('0xaa')]['length'])return _0x28aace[_0x75c2('0xb5')]['Contacts'][0x0];return db[_0x75c2('0x8d')][_0x75c2('0x6c')](_['defaults'](_0x1acd36[_0x75c2('0x68')],{'firstName':_0x1acd36[_0x75c2('0x68')]['to'],'email':_0x1acd36[_0x75c2('0x68')]['to'],'phone':_0x1acd36[_0x75c2('0x68')]['to'],'ListId':_0x28aace[_0x75c2('0xb7')]}));})['then'](function(_0x1fbe8f){if(!_0x1fbe8f)return;var _0x42d294={'UserId':_0x1acd36[_0x75c2('0x39')]['id'],'ContactId':_0x1fbe8f['id'],'MailAccountId':_0x28aace['id'],'inReplyTo':_0x826471[_0x75c2('0xb8')],'to':_0x1acd36[_0x75c2('0x68')][_0x75c2('0xae')],'cc':_0x1acd36['body']['cc'],'subject':_0x1acd36[_0x75c2('0x68')][_0x75c2('0xb9')],'attach':_0x1acd36[_0x75c2('0x68')][_0x75c2('0xba')],'firstMsgDirection':_0x75c2('0xbb'),'lastMsgAt':moment()[_0x75c2('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x75c2('0xbb'),'Messages':[_['merge'](_0x1acd36[_0x75c2('0x68')],{'messageId':_0x826471[_0x75c2('0xb8')],'sentAt':moment()[_0x75c2('0xa5')](_0x75c2('0xa6')),'read':!![],'MailAccountId':_0x28aace['id'],'UserId':_0x1acd36[_0x75c2('0x39')]['id'],'ContactId':_0x1fbe8f['id']})]};if(_0x1acd36[_0x75c2('0x68')][_0x75c2('0xbc')]){_0x42d294=_[_0x75c2('0x5d')](_0x42d294,_0x1acd36[_0x75c2('0x68')][_0x75c2('0xbc')]);}return db[_0x75c2('0x89')][_0x75c2('0x6c')](_0x42d294,{'include':[{'model':db[_0x75c2('0xa2')],'as':_0x75c2('0xbd')}]});})[_0x75c2('0x12')](respondWithResult(_0x53ea39,null))['catch'](handleError(_0x53ea39,null));};exports[_0x75c2('0xbe')]=function(_0x5c2516,_0x40da08){return db['MailAccount'][_0x75c2('0x67')]({'where':{'id':_0x5c2516['params']['id']},'include':[{'model':db[_0x75c2('0x48')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x75c2('0xac')],'as':'CloudProvider','raw':!![]}]}]})[_0x75c2('0x12')](handleEntityNotFound(_0x40da08,null))['then'](function(_0x2c66c2){if(!_0x2c66c2[_0x75c2('0x45')])return;var _0x55e927=_0x2c66c2[_0x75c2('0xb4')]();return respondWithRpcPromise(_0x75c2('0xbf'),_0x75c2('0xbe'),{'account':_0x55e927});})['then'](respondWithResult(_0x40da08,null))[_0x75c2('0x1d')](handleError(_0x40da08,null));};exports['destroy']=function(_0xe90da9,_0x5b238a){return db[_0x75c2('0x60')][_0x75c2('0x67')]({'where':{'id':_0xe90da9[_0x75c2('0x65')]['id']}})['then'](handleEntityNotFound(_0x5b238a,null))[_0x75c2('0x12')](function(_0x39a5e){if(_0x39a5e&&_0x39a5e[_0x75c2('0x42')]){throw new db['Sequelize'][(_0x75c2('0xc0'))](_0x75c2('0xc1'));}return _0x39a5e;})['then'](removeEntity(_0x5b238a,null))[_0x75c2('0x1d')](handleError(_0x5b238a,null));};exports['addAgents']=function(_0x1cd9a4,_0x37eeef){return db[_0x75c2('0x60')]['find']({'where':{'id':_0x1cd9a4['params']['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x37eeef,null))[_0x75c2('0x12')](function(_0x5eb078){if(_0x5eb078){return _0x5eb078[_0x75c2('0xc2')](_0x1cd9a4['body'][_0x75c2('0x74')],_[_0x75c2('0x8b')](_0x1cd9a4['body'],[_0x75c2('0x74'),'id'])||{})['spread'](function(_0x511b16){for(var _0x10a71e=0x0;_0x10a71e<_0x1cd9a4[_0x75c2('0x68')][_0x75c2('0x74')][_0x75c2('0x56')];_0x10a71e+=0x1){socket[_0x75c2('0xc3')](_0x75c2('0xc4'),{'UserId':Number(_0x1cd9a4[_0x75c2('0x68')][_0x75c2('0x74')][_0x10a71e]),'MailAccountId':Number(_0x1cd9a4[_0x75c2('0x65')]['id'])});}return _0x511b16;});}})[_0x75c2('0x12')](respondWithResult(_0x37eeef,null))[_0x75c2('0x1d')](handleError(_0x37eeef,null));};exports[_0x75c2('0xc5')]=function(_0x1595b2,_0x5bd313){return db[_0x75c2('0x60')][_0x75c2('0x67')]({'where':{'id':_0x1595b2[_0x75c2('0x65')]['id']}})[_0x75c2('0x12')](handleEntityNotFound(_0x5bd313,null))[_0x75c2('0x12')](function(_0x5c54e7){if(_0x5c54e7){return _0x5c54e7[_0x75c2('0xc5')](_0x1595b2[_0x75c2('0x50')]['ids'])[_0x75c2('0x12')](function(){if(_['isArray'](_0x1595b2[_0x75c2('0x50')][_0x75c2('0x74')])){for(var _0x3b4da2=0x0;_0x3b4da2<_0x1595b2['query'][_0x75c2('0x74')][_0x75c2('0x56')];_0x3b4da2+=0x1){socket[_0x75c2('0xc3')](_0x75c2('0xc6'),{'UserId':Number(_0x1595b2[_0x75c2('0x50')][_0x75c2('0x74')][_0x3b4da2]),'MailAccountId':Number(_0x1595b2[_0x75c2('0x65')]['id'])});}}else{socket[_0x75c2('0xc3')]('userMailAccount:remove',{'UserId':Number(_0x1595b2[_0x75c2('0x50')][_0x75c2('0x74')]),'MailAccountId':Number(_0x1595b2['params']['id'])});}});}})[_0x75c2('0x12')](respondWithStatusCode(_0x5bd313,null))[_0x75c2('0x1d')](handleError(_0x5bd313,null));};exports['getAgents']=function(_0x481d7b,_0x51d2a2){var _0x28011d={};var _0x3cf496={};var _0x3032d1;var _0x18d49d;return db[_0x75c2('0x60')][_0x75c2('0x6e')]({'where':{'id':_0x481d7b[_0x75c2('0x65')]['id']}})['then'](handleEntityNotFound(_0x51d2a2,null))[_0x75c2('0x12')](function(_0x43c23f){if(_0x43c23f){_0x3032d1=_0x43c23f;_0x3cf496['model']=_[_0x75c2('0x51')](db['User'][_0x75c2('0x66')]);_0x3cf496[_0x75c2('0x50')]=_[_0x75c2('0x51')](_0x481d7b[_0x75c2('0x50')]);_0x3cf496[_0x75c2('0x52')]=_[_0x75c2('0x53')](_0x3cf496['model'],_0x3cf496[_0x75c2('0x50')]);_0x28011d[_0x75c2('0x55')]=_[_0x75c2('0x53')](_0x3cf496[_0x75c2('0x4e')],qs[_0x75c2('0x54')](_0x481d7b['query']['fields']));_0x28011d[_0x75c2('0x55')]=_0x28011d[_0x75c2('0x55')][_0x75c2('0x56')]?_0x28011d['attributes']:_0x3cf496[_0x75c2('0x4e')];_0x28011d[_0x75c2('0x59')]=qs[_0x75c2('0x5a')](_0x481d7b[_0x75c2('0x50')]['sort']);_0x28011d['where']=qs['filters'](_[_0x75c2('0x70')](_0x481d7b[_0x75c2('0x50')],_0x3cf496['filters']));if(_0x481d7b['query'][_0x75c2('0x5c')]){_0x28011d[_0x75c2('0x5b')]=_[_0x75c2('0x5d')](_0x28011d[_0x75c2('0x5b')],{'$or':_[_0x75c2('0x4f')](_0x28011d[_0x75c2('0x55')],function(_0xecb850){var _0x7d7bb2={};_0x7d7bb2[_0xecb850]={'$like':'%'+_0x481d7b[_0x75c2('0x50')][_0x75c2('0x5c')]+'%'};return _0x7d7bb2;})});}_0x28011d=_['merge']({},_0x28011d,_0x481d7b[_0x75c2('0x5f')]);return _0x3032d1['getAgents'](_0x28011d);}})['then'](function(_0x2615a6){if(_0x2615a6){_0x18d49d=_0x2615a6[_0x75c2('0x56')];if(!_0x481d7b[_0x75c2('0x50')][_0x75c2('0x57')]('nolimit')){_0x28011d[_0x75c2('0x22')]=qs[_0x75c2('0x22')](_0x481d7b[_0x75c2('0x50')]['limit']);_0x28011d[_0x75c2('0x1f')]=qs['offset'](_0x481d7b[_0x75c2('0x50')]['offset']);}return _0x3032d1[_0x75c2('0xc7')](_0x28011d);}})[_0x75c2('0x12')](function(_0x52a3ce){if(_0x52a3ce){return _0x52a3ce?{'count':_0x18d49d,'rows':_0x52a3ce}:null;}})['then'](respondWithResult(_0x51d2a2,null))['catch'](handleError(_0x51d2a2,null));}; \ No newline at end of file +var _0xe165=['../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','update','destroy','MailAccounts','UserProfileResource','stack','name','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','MailAccount','includeAll','findAll','show','params','MailServerIn','MailServerOut','mandatoryDispositionPause','find','body','provider','custom','secure','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','include','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','rows','removeAnswers','email','ListId','isNil','active','description','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','CmContact','Contact','Owner','fullname','internal','Tags','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','send','CmList','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','getSmtpOptions','sendMail','List','List\x20not\x20found','defaults','messageId','subject','attach','out','Interaction','Messages','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x44d66b,_0x1cb6b1){var _0x319397=function(_0x42efe5){while(--_0x42efe5){_0x44d66b['push'](_0x44d66b['shift']());}};_0x319397(++_0x1cb6b1);}(_0xe165,0xb8));var _0x5e16=function(_0x2fb9a2,_0x2ee3be){_0x2fb9a2=_0x2fb9a2-0x0;var _0x20e0c5=_0xe165[_0x2fb9a2];return _0x20e0c5;};'use strict';var moment=require(_0x5e16('0x0'));var BPromise=require('bluebird');var util=require(_0x5e16('0x1'));var path=require(_0x5e16('0x2'));var _=require(_0x5e16('0x3'));var juice=require(_0x5e16('0x4'));var Redis=require(_0x5e16('0x5'));var qs=require(_0x5e16('0x6'));var logger=require(_0x5e16('0x7'))(_0x5e16('0x8'));var config=require(_0x5e16('0x9'));var db=require(_0x5e16('0xa'))['db'];config['redis']=_['defaults'](config[_0x5e16('0xb')],{'host':_0x5e16('0xc'),'port':0x18eb});var socket=require(_0x5e16('0xd'))(new Redis(config[_0x5e16('0xb')]));require(_0x5e16('0xe'))[_0x5e16('0xf')](socket);var jayson=require(_0x5e16('0x10'));var client=jayson[_0x5e16('0x11')][_0x5e16('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x8f0e8e,_0x3a88fc,_0x44afe9,_0x53ddcf){return new BPromise(function(_0x3b22d4,_0x329b76){var _0x69f0f7=_0x53ddcf||client;return _0x69f0f7[_0x5e16('0x13')](_0x8f0e8e,_0x44afe9)[_0x5e16('0x14')](function(_0x544a36){logger[_0x5e16('0x15')](_0x5e16('0x16'),_0x3a88fc,_0x5e16('0x17'));logger['debug'](_0x5e16('0x18'),_0x3a88fc,_0x5e16('0x17'),JSON[_0x5e16('0x19')](_0x544a36));if(_0x544a36[_0x5e16('0x1a')]){if(_0x544a36[_0x5e16('0x1a')][_0x5e16('0x1b')]===0x1f4){logger[_0x5e16('0x1a')](_0x5e16('0x16'),_0x3a88fc,_0x544a36['error'][_0x5e16('0x1c')]);return _0x329b76(_0x544a36[_0x5e16('0x1a')]['message']);}logger['error'](_0x5e16('0x16'),_0x3a88fc,_0x544a36['error'][_0x5e16('0x1c')]);return _0x3b22d4(_0x544a36[_0x5e16('0x1a')][_0x5e16('0x1c')]);}else{logger['info'](_0x5e16('0x16'),_0x3a88fc,_0x5e16('0x17'));_0x3b22d4(_0x544a36[_0x5e16('0x1d')][_0x5e16('0x1c')]);}})[_0x5e16('0x1e')](function(_0x245271){logger[_0x5e16('0x1a')](_0x5e16('0x16'),_0x3a88fc,_0x245271);_0x329b76(_0x245271);});});}function respondWithStatusCode(_0x28e21f,_0x2ff40a){_0x2ff40a=_0x2ff40a||0xcc;return function(_0x13d973){if(_0x13d973){return _0x28e21f[_0x5e16('0x1f')](_0x2ff40a);}return _0x28e21f[_0x5e16('0x20')](_0x2ff40a)[_0x5e16('0x21')]();};}function respondWithResult(_0x4bbdad,_0x4d9bc4){_0x4d9bc4=_0x4d9bc4||0xc8;return function(_0x1bc59e){if(_0x1bc59e){return _0x4bbdad[_0x5e16('0x20')](_0x4d9bc4)['json'](_0x1bc59e);}};}function respondWithFilteredResult(_0x5ca3f7,_0xb54531){return function(_0x46ed13){if(_0x46ed13){var _0x49e616=typeof _0xb54531[_0x5e16('0x22')]===_0x5e16('0x23')&&typeof _0xb54531[_0x5e16('0x24')]===_0x5e16('0x23');var _0x21d20f=_0x46ed13[_0x5e16('0x25')];var _0x521bc5=_0x49e616?0x0:_0xb54531[_0x5e16('0x22')];var _0x3782fb=_0x49e616?_0x46ed13[_0x5e16('0x25')]:_0xb54531[_0x5e16('0x22')]+_0xb54531[_0x5e16('0x24')];var _0x3ae67e;if(_0x3782fb>=_0x21d20f){_0x3782fb=_0x21d20f;_0x3ae67e=0xc8;}else{_0x3ae67e=0xce;}_0x5ca3f7[_0x5e16('0x20')](_0x3ae67e);return _0x5ca3f7['set']('Content-Range',_0x521bc5+'-'+_0x3782fb+'/'+_0x21d20f)[_0x5e16('0x26')](_0x46ed13);}return null;};}function saveUpdates(_0x33ee85){return function(_0x43ea45){if(_0x43ea45){return _0x43ea45[_0x5e16('0x27')](_0x33ee85)[_0x5e16('0x14')](function(_0xe13c1d){return _0xe13c1d;});}return null;};}function removeEntity(_0xba9368){return function(_0x5cd56d){if(_0x5cd56d){return _0x5cd56d[_0x5e16('0x28')]()[_0x5e16('0x14')](function(){var _0x56d271=_0x5cd56d['get']({'plain':!![]});var _0x5a9582=_0x5e16('0x29');return db[_0x5e16('0x2a')][_0x5e16('0x28')]({'where':{'type':_0x5a9582,'resourceId':_0x56d271['id']}})[_0x5e16('0x14')](function(){return _0x5cd56d;});})[_0x5e16('0x14')](function(){_0xba9368[_0x5e16('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x454ed7){return function(_0x439038){if(!_0x439038){_0x454ed7[_0x5e16('0x1f')](0x194);}return _0x439038;};}function handleError(_0x308f6b,_0x39e205){_0x39e205=_0x39e205||0x1f4;return function(_0x53e332){logger['error'](_0x53e332[_0x5e16('0x2b')]);if(_0x53e332[_0x5e16('0x2c')]){delete _0x53e332['name'];}_0x308f6b['status'](_0x39e205)['send'](_0x53e332);};}function getImapHost(_0xcb8d19){switch(_0xcb8d19){case _0x5e16('0x2d'):return'imap.gmail.com';case _0x5e16('0x2e'):return _0x5e16('0x2f');case _0x5e16('0x30'):return'imap-mail.outlook.com';case _0x5e16('0x31'):return _0x5e16('0x32');}throw new Error(_0x5e16('0x33'),_0xcb8d19);}function getSmtpHost(_0x370a31){switch(_0x370a31){case _0x5e16('0x2d'):return'smtp.gmail.com';case _0x5e16('0x2e'):return _0x5e16('0x34');case'hotmail':return _0x5e16('0x35');case _0x5e16('0x31'):return'smtp.office365.com';}throw new Error(_0x5e16('0x33'),_0x370a31);}function getAuthenticationOptions(_0x39493c,_0x3da68a){var _0x3e2311={};var _0x51a517={};if(_0x39493c){_0x3e2311[_0x5e16('0x36')]=_0x51a517[_0x5e16('0x36')]=_0x3da68a[_0x5e16('0x37')];_0x3e2311[_0x5e16('0x38')]=_0x51a517[_0x5e16('0x39')]=_0x3da68a[_0x5e16('0x38')];if(_0x3da68a[_0x5e16('0x3a')]){_0x3e2311[_0x5e16('0x3a')]=_0x51a517[_0x5e16('0x3a')]=!![];_0x3e2311[_0x5e16('0x3b')]=_0x51a517[_0x5e16('0x3b')]=_0x3da68a[_0x5e16('0x3b')];_0x3e2311[_0x5e16('0x38')]=_0x51a517[_0x5e16('0x39')]=null;}else{_0x3e2311['CloudProviderId']=_0x51a517[_0x5e16('0x3b')]=null;}_0x3e2311[_0x5e16('0x3c')]=getImapHost(_0x39493c);_0x3e2311[_0x5e16('0x3d')]=0x3e1;_0x51a517['host']=getSmtpHost(_0x39493c);_0x51a517[_0x5e16('0x3d')]=0x24b;_0x51a517['secure']=![];_0x3e2311[_0x5e16('0x3e')]=_0x51a517[_0x5e16('0x3e')]=null;}else{if(_0x3da68a[_0x5e16('0x3f')]){_0x3e2311['user']=_0x51a517[_0x5e16('0x36')]=_0x3da68a[_0x5e16('0x37')];_0x3e2311[_0x5e16('0x38')]=_0x51a517[_0x5e16('0x39')]=_0x3da68a['password'];}else{_0x3e2311['authentication']=_0x51a517[_0x5e16('0x3f')]=![];_0x3e2311['user']=_0x51a517[_0x5e16('0x36')]=null;_0x3e2311['password']=_0x51a517[_0x5e16('0x39')]=null;}_0x3e2311[_0x5e16('0x3c')]=_0x3da68a[_0x5e16('0x40')][_0x5e16('0x3c')];_0x3e2311[_0x5e16('0x3d')]=_0x3da68a[_0x5e16('0x40')]['port'];_0x51a517['host']=_0x3da68a[_0x5e16('0x41')]['host'];_0x51a517[_0x5e16('0x3d')]=_0x3da68a[_0x5e16('0x41')][_0x5e16('0x3d')];}return{'Imap':_0x3e2311,'Smtp':_0x51a517};}exports[_0x5e16('0x42')]=function(_0x373cf7,_0x5cd2c2){var _0x287acb={'include':[{'model':db['MailServerIn'],'as':_0x5e16('0x40')},{'model':db['MailServerOut'],'as':_0x5e16('0x41')},{'model':db[_0x5e16('0x43')],'as':'mandatoryDispositionPause'}]},_0x433cc5={},_0x4817d0={'count':0x0,'rows':[]};var _0x1b465c=_['map'](db['MailAccount'][_0x5e16('0x44')],function(_0x1a19ae){return{'name':_0x1a19ae[_0x5e16('0x45')],'type':_0x1a19ae[_0x5e16('0x46')][_0x5e16('0x47')]};});_0x433cc5[_0x5e16('0x48')]=_[_0x5e16('0x49')](_0x1b465c,_0x5e16('0x2c'));_0x433cc5[_0x5e16('0x4a')]=_[_0x5e16('0x4b')](_0x373cf7[_0x5e16('0x4a')]);_0x433cc5[_0x5e16('0x4c')]=_[_0x5e16('0x4d')](_0x433cc5[_0x5e16('0x48')],_0x433cc5['query']);_0x287acb['attributes']=_[_0x5e16('0x4d')](_0x433cc5['model'],qs['fields'](_0x373cf7['query'][_0x5e16('0x4e')]));_0x287acb[_0x5e16('0x4f')]=_0x287acb['attributes'][_0x5e16('0x50')]?_0x287acb[_0x5e16('0x4f')]:_0x433cc5[_0x5e16('0x48')];if(!_0x373cf7[_0x5e16('0x4a')][_0x5e16('0x51')](_0x5e16('0x52'))){_0x287acb['limit']=qs[_0x5e16('0x24')](_0x373cf7[_0x5e16('0x4a')][_0x5e16('0x24')]);_0x287acb[_0x5e16('0x22')]=qs[_0x5e16('0x22')](_0x373cf7[_0x5e16('0x4a')][_0x5e16('0x22')]);}_0x287acb['order']=qs[_0x5e16('0x53')](_0x373cf7[_0x5e16('0x4a')][_0x5e16('0x53')]);_0x287acb[_0x5e16('0x54')]=qs[_0x5e16('0x4c')](_[_0x5e16('0x55')](_0x373cf7[_0x5e16('0x4a')],_0x433cc5[_0x5e16('0x4c')]),_0x1b465c);if(_0x373cf7[_0x5e16('0x4a')][_0x5e16('0x56')]){_0x287acb[_0x5e16('0x54')]=_[_0x5e16('0x57')](_0x287acb['where'],{'$or':_[_0x5e16('0x49')](_0x1b465c,function(_0x26f30b){if(_0x26f30b['type']!=='VIRTUAL'){var _0x1365c8={};_0x1365c8[_0x26f30b['name']]={'$like':'%'+_0x373cf7[_0x5e16('0x4a')][_0x5e16('0x56')]+'%'};return _0x1365c8;}})});}_0x287acb=_[_0x5e16('0x57')]({},_0x287acb,_0x373cf7[_0x5e16('0x58')]);var _0x1c701f={'where':_0x287acb['where']};return db[_0x5e16('0x59')]['count'](_0x1c701f)['then'](function(_0x4461b8){_0x4817d0[_0x5e16('0x25')]=_0x4461b8;if(_0x373cf7[_0x5e16('0x4a')][_0x5e16('0x5a')]){_0x287acb['include']=[{'all':!![]}];}return db[_0x5e16('0x59')][_0x5e16('0x5b')](_0x287acb);})[_0x5e16('0x14')](function(_0x36ad9d){_0x4817d0['rows']=_0x36ad9d;return _0x4817d0;})[_0x5e16('0x14')](respondWithFilteredResult(_0x5cd2c2,_0x287acb))['catch'](handleError(_0x5cd2c2,null));};exports[_0x5e16('0x5c')]=function(_0x173ca6,_0x359428){var _0x48d525={'raw':![],'where':{'id':_0x173ca6[_0x5e16('0x5d')]['id']},'include':[{'model':db[_0x5e16('0x5e')],'as':_0x5e16('0x40')},{'model':db[_0x5e16('0x5f')],'as':_0x5e16('0x41')},{'model':db[_0x5e16('0x43')],'as':_0x5e16('0x60')}]},_0x555f5e={};_0x555f5e[_0x5e16('0x48')]=_[_0x5e16('0x4b')](db['MailAccount']['rawAttributes']);_0x555f5e['query']=_[_0x5e16('0x4b')](_0x173ca6[_0x5e16('0x4a')]);_0x555f5e['filters']=_['intersection'](_0x555f5e['model'],_0x555f5e[_0x5e16('0x4a')]);_0x48d525[_0x5e16('0x4f')]=_[_0x5e16('0x4d')](_0x555f5e[_0x5e16('0x48')],qs[_0x5e16('0x4e')](_0x173ca6[_0x5e16('0x4a')][_0x5e16('0x4e')]));_0x48d525[_0x5e16('0x4f')]=_0x48d525[_0x5e16('0x4f')][_0x5e16('0x50')]?_0x48d525[_0x5e16('0x4f')]:_0x555f5e[_0x5e16('0x48')];if(_0x173ca6[_0x5e16('0x4a')][_0x5e16('0x5a')]){_0x48d525['include']=[{'all':!![]}];}_0x48d525=_[_0x5e16('0x57')]({},_0x48d525,_0x173ca6['options']);return db['MailAccount'][_0x5e16('0x61')](_0x48d525)[_0x5e16('0x14')](handleEntityNotFound(_0x359428,null))['then'](respondWithResult(_0x359428,null))[_0x5e16('0x1e')](handleError(_0x359428,null));};exports[_0x5e16('0x27')]=function(_0x42de08,_0xc7d7dc){if(_0x42de08[_0x5e16('0x62')]['id']){delete _0x42de08['body']['id'];}var _0x10890c=_0x42de08['body'][_0x5e16('0x63')]===_0x5e16('0x64')?null:_0x42de08[_0x5e16('0x62')][_0x5e16('0x63')];var _0x28c459=_0x42de08[_0x5e16('0x62')][_0x5e16('0x40')]||{};var _0x269f7e=_0x42de08[_0x5e16('0x62')][_0x5e16('0x41')]||{};if(_0x10890c){_0x28c459[_0x5e16('0x3c')]=getImapHost(_0x10890c);_0x28c459['port']=0x3e1;_0x269f7e['host']=getSmtpHost(_0x10890c);_0x269f7e['port']=0x24b;_0x269f7e[_0x5e16('0x65')]=![];}if(_0x269f7e[_0x5e16('0x3a')]){_0x269f7e[_0x5e16('0x65')]=![];}else{_0x269f7e[_0x5e16('0x3b')]=null;}if(!_0x28c459[_0x5e16('0x3a')])_0x28c459[_0x5e16('0x3b')]=null;_0x42de08['body'][_0x5e16('0x40')]=_0x28c459;_0x42de08[_0x5e16('0x62')][_0x5e16('0x41')]=_0x269f7e;return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0x42de08[_0x5e16('0x5d')]['id']},'include':[{'model':db[_0x5e16('0x5e')],'as':_0x5e16('0x40')},{'model':db['MailServerOut'],'as':_0x5e16('0x41')},{'model':db[_0x5e16('0x43')],'as':_0x5e16('0x60')}]})[_0x5e16('0x14')](handleEntityNotFound(_0xc7d7dc,null))['then'](function(_0x43139b){if(!_0x43139b)throw new Error('Mail\x20Account\x20not\x20found');if(_0x43139b[_0x5e16('0x3e')])delete _0x42de08['body'][_0x5e16('0x40')];return _0x43139b;})[_0x5e16('0x14')](saveUpdates(_0x42de08[_0x5e16('0x62')],null))[_0x5e16('0x14')](function(_0xb39b80){if(!_0x42de08[_0x5e16('0x62')]['Imap'])return _0xb39b80;return db[_0x5e16('0x5e')][_0x5e16('0x27')](_0x42de08['body']['Imap'],{'where':{'MailAccountId':_0xb39b80['id']}})['then'](function(){return _0xb39b80;});})[_0x5e16('0x14')](function(_0x5b43ff){if(!_0x42de08[_0x5e16('0x62')][_0x5e16('0x41')])return _0x5b43ff;return db[_0x5e16('0x5f')]['update'](_0x42de08[_0x5e16('0x62')][_0x5e16('0x41')],{'where':{'MailAccountId':_0x5b43ff['id']}})[_0x5e16('0x14')](function(){return _0x5b43ff;});})['then'](respondWithResult(_0xc7d7dc,null))[_0x5e16('0x1e')](handleError(_0xc7d7dc,null));};exports[_0x5e16('0x66')]=function(_0x53046d,_0x3e074a){return db['MailAccount'][_0x5e16('0x66')]()['then'](respondWithResult(_0x3e074a,null))[_0x5e16('0x1e')](handleError(_0x3e074a,null));};exports[_0x5e16('0x67')]=function(_0x36764e,_0x3bff33){if(_0x36764e[_0x5e16('0x62')]['id']){delete _0x36764e[_0x5e16('0x62')]['id'];}return db[_0x5e16('0x59')]['find']({'where':{'id':_0x36764e[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x3bff33,null))[_0x5e16('0x14')](function(_0x12841d){if(_0x12841d){_0x36764e[_0x5e16('0x62')][_0x5e16('0x68')]=_0x12841d['id'];return db[_0x5e16('0x69')][_0x5e16('0x6a')](_0x36764e[_0x5e16('0x62')]);}})['then'](respondWithResult(_0x3bff33,null))[_0x5e16('0x1e')](handleError(_0x3bff33,null));};exports[_0x5e16('0x6b')]=function(_0x325079,_0x2e33b1){var _0x546fa4={'raw':![],'where':{}};var _0x2745a9={};var _0x210517={'count':0x0,'rows':[]};return db[_0x5e16('0x59')][_0x5e16('0x6c')]({'where':{'id':_0x325079[_0x5e16('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2e33b1,null))[_0x5e16('0x14')](function(_0x48e4a2){if(_0x48e4a2){_0x2745a9[_0x5e16('0x48')]=_['keys'](db[_0x5e16('0x69')][_0x5e16('0x44')]);_0x2745a9['query']=_[_0x5e16('0x4b')](_0x325079[_0x5e16('0x4a')]);_0x2745a9[_0x5e16('0x4c')]=_['intersection'](_0x2745a9['model'],_0x2745a9[_0x5e16('0x4a')]);_0x546fa4[_0x5e16('0x4f')]=_[_0x5e16('0x4d')](_0x2745a9['model'],qs['fields'](_0x325079[_0x5e16('0x4a')][_0x5e16('0x4e')]));_0x546fa4[_0x5e16('0x4f')]=_0x546fa4[_0x5e16('0x4f')][_0x5e16('0x50')]?_0x546fa4['attributes']:_0x2745a9[_0x5e16('0x48')];if(!_0x325079[_0x5e16('0x4a')][_0x5e16('0x51')](_0x5e16('0x52'))){_0x546fa4[_0x5e16('0x24')]=qs[_0x5e16('0x24')](_0x325079['query']['limit']);_0x546fa4[_0x5e16('0x22')]=qs[_0x5e16('0x22')](_0x325079['query']['offset']);}_0x546fa4[_0x5e16('0x6d')]=qs[_0x5e16('0x53')](_0x325079['query'][_0x5e16('0x53')]);_0x546fa4['where']=qs[_0x5e16('0x4c')](_[_0x5e16('0x55')](_0x325079[_0x5e16('0x4a')],_0x2745a9[_0x5e16('0x4c')]));_0x546fa4['where'][_0x5e16('0x68')]=_0x48e4a2['id'];if(_0x325079[_0x5e16('0x4a')][_0x5e16('0x56')]){_0x546fa4[_0x5e16('0x54')]=_[_0x5e16('0x57')](_0x546fa4[_0x5e16('0x54')],{'$or':_['map'](_0x546fa4['attributes'],function(_0x22f54c){var _0x1941a0={};_0x1941a0[_0x22f54c]={'$like':'%'+_0x325079['query'][_0x5e16('0x56')]+'%'};return _0x1941a0;})});}_0x546fa4=_[_0x5e16('0x57')]({},_0x546fa4,_0x325079[_0x5e16('0x58')]);return db[_0x5e16('0x69')][_0x5e16('0x25')]({'where':_0x546fa4['where']})[_0x5e16('0x14')](function(_0x2f331f){_0x210517[_0x5e16('0x25')]=_0x2f331f;if(_0x325079[_0x5e16('0x4a')]['includeAll']){_0x546fa4[_0x5e16('0x6e')]=[{'all':!![]}];}return db[_0x5e16('0x69')][_0x5e16('0x5b')](_0x546fa4);})[_0x5e16('0x14')](function(_0x163c53){_0x210517['rows']=_0x163c53;return _0x210517;});}})[_0x5e16('0x14')](respondWithFilteredResult(_0x2e33b1,_0x546fa4))['catch'](handleError(_0x2e33b1,null));};exports[_0x5e16('0x6f')]=function(_0x43aa09,_0x200f87){return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0x43aa09['params']['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x200f87,null))[_0x5e16('0x14')](function(_0x3d8aa4){if(_0x3d8aa4){return _0x3d8aa4[_0x5e16('0x6f')](_0x43aa09[_0x5e16('0x4a')][_0x5e16('0x70')]);}})[_0x5e16('0x14')](respondWithStatusCode(_0x200f87,null))[_0x5e16('0x1e')](handleError(_0x200f87,null));};exports[_0x5e16('0x71')]=function(_0x571bba,_0x7dd851){if(_0x571bba[_0x5e16('0x62')]['id']){delete _0x571bba[_0x5e16('0x62')]['id'];}return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0x571bba['params']['id']}})['then'](handleEntityNotFound(_0x7dd851,null))[_0x5e16('0x14')](function(_0xdcf9b9){if(_0xdcf9b9){_0x571bba[_0x5e16('0x62')]['MailAccountId']=_0xdcf9b9['id'];return db['CannedAnswer'][_0x5e16('0x6a')](_0x571bba[_0x5e16('0x62')]);}})[_0x5e16('0x14')](respondWithResult(_0x7dd851,null))[_0x5e16('0x1e')](handleError(_0x7dd851,null));};exports[_0x5e16('0x72')]=function(_0x55f2c2,_0x40c05e){var _0x1616ec={'raw':![],'where':{}};var _0x5b7df7={};var _0x3115a2={'count':0x0,'rows':[]};return db['MailAccount'][_0x5e16('0x6c')]({'where':{'id':_0x55f2c2[_0x5e16('0x5d')]['id']}})['then'](handleEntityNotFound(_0x40c05e,null))[_0x5e16('0x14')](function(_0x3d973c){if(_0x3d973c){_0x5b7df7['model']=_[_0x5e16('0x4b')](db['CannedAnswer']['rawAttributes']);_0x5b7df7[_0x5e16('0x4a')]=_[_0x5e16('0x4b')](_0x55f2c2[_0x5e16('0x4a')]);_0x5b7df7[_0x5e16('0x4c')]=_[_0x5e16('0x4d')](_0x5b7df7['model'],_0x5b7df7[_0x5e16('0x4a')]);_0x1616ec[_0x5e16('0x4f')]=_[_0x5e16('0x4d')](_0x5b7df7[_0x5e16('0x48')],qs[_0x5e16('0x4e')](_0x55f2c2['query'][_0x5e16('0x4e')]));_0x1616ec[_0x5e16('0x4f')]=_0x1616ec[_0x5e16('0x4f')][_0x5e16('0x50')]?_0x1616ec['attributes']:_0x5b7df7[_0x5e16('0x48')];if(!_0x55f2c2[_0x5e16('0x4a')][_0x5e16('0x51')](_0x5e16('0x52'))){_0x1616ec[_0x5e16('0x24')]=qs['limit'](_0x55f2c2[_0x5e16('0x4a')]['limit']);_0x1616ec['offset']=qs[_0x5e16('0x22')](_0x55f2c2[_0x5e16('0x4a')][_0x5e16('0x22')]);}_0x1616ec[_0x5e16('0x6d')]=qs[_0x5e16('0x53')](_0x55f2c2[_0x5e16('0x4a')][_0x5e16('0x53')]);_0x1616ec[_0x5e16('0x54')]=qs[_0x5e16('0x4c')](_[_0x5e16('0x55')](_0x55f2c2[_0x5e16('0x4a')],_0x5b7df7[_0x5e16('0x4c')]));_0x1616ec[_0x5e16('0x54')][_0x5e16('0x68')]=_0x3d973c['id'];if(_0x55f2c2['query'][_0x5e16('0x56')]){_0x1616ec[_0x5e16('0x54')]=_['merge'](_0x1616ec['where'],{'$or':_[_0x5e16('0x49')](_0x1616ec[_0x5e16('0x4f')],function(_0x35ad25){var _0x1362b6={};_0x1362b6[_0x35ad25]={'$like':'%'+_0x55f2c2[_0x5e16('0x4a')][_0x5e16('0x56')]+'%'};return _0x1362b6;})});}_0x1616ec=_[_0x5e16('0x57')]({},_0x1616ec,_0x55f2c2[_0x5e16('0x58')]);return db['CannedAnswer'][_0x5e16('0x25')]({'where':_0x1616ec['where']})[_0x5e16('0x14')](function(_0x40ab0c){_0x3115a2['count']=_0x40ab0c;if(_0x55f2c2[_0x5e16('0x4a')]['includeAll']){_0x1616ec[_0x5e16('0x6e')]=[{'all':!![]}];}return db[_0x5e16('0x73')][_0x5e16('0x5b')](_0x1616ec);})[_0x5e16('0x14')](function(_0x2694a4){_0x3115a2[_0x5e16('0x74')]=_0x2694a4;return _0x3115a2;});}})['then'](respondWithFilteredResult(_0x40c05e,_0x1616ec))[_0x5e16('0x1e')](handleError(_0x40c05e,null));};exports[_0x5e16('0x75')]=function(_0x354099,_0x335fe2){return db['MailAccount'][_0x5e16('0x61')]({'where':{'id':_0x354099[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x335fe2,null))[_0x5e16('0x14')](function(_0x54658e){if(_0x54658e){return _0x54658e[_0x5e16('0x75')](_0x354099[_0x5e16('0x4a')][_0x5e16('0x70')]);}})[_0x5e16('0x14')](respondWithStatusCode(_0x335fe2,null))[_0x5e16('0x1e')](handleError(_0x335fe2,null));};exports[_0x5e16('0x6a')]=function(_0x37e11b,_0x4fa2f5){var _0x85efee={'name':_0x37e11b[_0x5e16('0x62')]['name'],'key':_0x37e11b[_0x5e16('0x62')][_0x5e16('0x47')],'provider':_0x37e11b['body'][_0x5e16('0x63')]===_0x5e16('0x64')?null:_0x37e11b[_0x5e16('0x62')][_0x5e16('0x63')],'email':_0x37e11b['body'][_0x5e16('0x76')],'ListId':_0x37e11b[_0x5e16('0x62')][_0x5e16('0x77')],'active':!_[_0x5e16('0x78')](_0x37e11b[_0x5e16('0x62')]['active'])?_0x37e11b['body'][_0x5e16('0x79')]:!![],'description':_0x37e11b[_0x5e16('0x62')][_0x5e16('0x7a')]||null};var _0x531a4e=getAuthenticationOptions(_0x85efee[_0x5e16('0x63')],_0x37e11b[_0x5e16('0x62')]);_0x85efee[_0x5e16('0x40')]=_0x531a4e[_0x5e16('0x40')];_0x85efee[_0x5e16('0x41')]=_0x531a4e[_0x5e16('0x41')];return db['MailAccount'][_0x5e16('0x6a')](_0x85efee,{'include':[{'model':db[_0x5e16('0x5f')],'as':'Smtp'},{'model':db[_0x5e16('0x5e')],'as':_0x5e16('0x40')}]})[_0x5e16('0x14')](function(_0x457b96){var _0x456801=_0x37e11b[_0x5e16('0x36')][_0x5e16('0x7b')]({'plain':!![]});if(!_0x456801)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x456801['role']===_0x5e16('0x36')){var _0x724e48=_0x457b96['get']({'plain':!![]});return db['UserProfileSection'][_0x5e16('0x61')]({'where':{'name':_0x5e16('0x29'),'userProfileId':_0x456801['userProfileId']},'raw':!![]})[_0x5e16('0x14')](function(_0x222e4b){if(_0x222e4b&&_0x222e4b['autoAssociation']===0x0){return db[_0x5e16('0x2a')]['create']({'name':_0x724e48['name'],'resourceId':_0x724e48['id'],'type':_0x222e4b[_0x5e16('0x2c')],'sectionId':_0x222e4b['id']},{})[_0x5e16('0x14')](function(){return _0x457b96;});}else{return _0x457b96;}})[_0x5e16('0x1e')](function(_0x3cee5b){logger[_0x5e16('0x1a')](_0x5e16('0x7c'),_0x3cee5b);throw _0x3cee5b;});}return _0x457b96;})[_0x5e16('0x14')](respondWithResult(_0x4fa2f5,0xc9))['catch'](handleError(_0x4fa2f5,null));};exports[_0x5e16('0x7d')]=function(_0x5d50e3,_0x42775d){return db['MailAccount']['findOne']({'where':{'id':_0x5d50e3['params']['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x42775d,null))['then'](function(_0x1b3725){if(_0x1b3725){return _0x1b3725[_0x5e16('0x7d')]();}return null;})[_0x5e16('0x14')](respondWithResult(_0x42775d,null))[_0x5e16('0x1e')](handleError(_0x42775d,null));};exports[_0x5e16('0x7e')]=function(_0xf62b11,_0x26ab38){if(_0xf62b11['body']['id']){delete _0xf62b11[_0x5e16('0x62')]['id'];}return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0xf62b11[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x26ab38,null))[_0x5e16('0x14')](function(_0x2b2c27){if(_0x2b2c27){_0xf62b11[_0x5e16('0x62')][_0x5e16('0x68')]=_0x2b2c27['id'];return db['MailServerIn'][_0x5e16('0x6a')](_0xf62b11[_0x5e16('0x62')]);}})[_0x5e16('0x14')](respondWithResult(_0x26ab38,null))[_0x5e16('0x1e')](handleError(_0x26ab38,null));};exports[_0x5e16('0x7f')]=function(_0x15bb72,_0x4a59ff){return db['MailAccount']['findOne']({'where':{'id':_0x15bb72['params']['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x4a59ff,null))[_0x5e16('0x14')](function(_0x57a3f2){if(_0x57a3f2){return _0x57a3f2['setImap'](null);}return null;})[_0x5e16('0x14')](respondWithStatusCode(_0x4a59ff,null))[_0x5e16('0x1e')](handleError(_0x4a59ff,null));};exports[_0x5e16('0x80')]=function(_0x46007d,_0x5f4435){return db[_0x5e16('0x59')][_0x5e16('0x6c')]({'where':{'id':_0x46007d[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x5f4435,null))[_0x5e16('0x14')](function(_0xb7744d){if(_0xb7744d){return _0xb7744d[_0x5e16('0x80')]();}return null;})[_0x5e16('0x14')](respondWithResult(_0x5f4435,null))[_0x5e16('0x1e')](handleError(_0x5f4435,null));};exports['addSmtp']=function(_0xfe13ab,_0x1a3f3d){if(_0xfe13ab[_0x5e16('0x62')]['id']){delete _0xfe13ab[_0x5e16('0x62')]['id'];}return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0xfe13ab[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x1a3f3d,null))['then'](function(_0x21b892){if(_0x21b892){_0xfe13ab[_0x5e16('0x62')][_0x5e16('0x68')]=_0x21b892['id'];return db[_0x5e16('0x5f')][_0x5e16('0x6a')](_0xfe13ab[_0x5e16('0x62')]);}})[_0x5e16('0x14')](respondWithResult(_0x1a3f3d,null))[_0x5e16('0x1e')](handleError(_0x1a3f3d,null));};exports[_0x5e16('0x81')]=function(_0x198b60,_0x389d46){return db[_0x5e16('0x59')][_0x5e16('0x6c')]({'where':{'id':_0x198b60['params']['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x389d46,null))[_0x5e16('0x14')](function(_0x2570c3){if(_0x2570c3){return _0x2570c3[_0x5e16('0x82')](null);}return null;})[_0x5e16('0x14')](respondWithStatusCode(_0x389d46,null))[_0x5e16('0x1e')](handleError(_0x389d46,null));};exports[_0x5e16('0x83')]=function(_0xcdd1e0,_0x22efa6){return db['MailInteraction']['find']({'where':{'id':_0xcdd1e0[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x22efa6,null))[_0x5e16('0x14')](function(_0x44ab45){if(_0x44ab45){return _0x44ab45[_0x5e16('0x83')](_0xcdd1e0[_0x5e16('0x62')][_0x5e16('0x70')],_['omit'](_0xcdd1e0[_0x5e16('0x62')],[_0x5e16('0x70'),'id'])||{});}})[_0x5e16('0x14')](respondWithResult(_0x22efa6,null))[_0x5e16('0x1e')](handleError(_0x22efa6,null));};exports[_0x5e16('0x84')]=function(_0x484072,_0x28fdc2){var _0x5593b4={'raw':![],'where':{}};var _0x389a1b={};var _0x4013cd={'count':0x0,'rows':[]};return db[_0x5e16('0x59')][_0x5e16('0x6c')]({'where':{'id':_0x484072[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x28fdc2,null))[_0x5e16('0x14')](function(_0x2dc2d0){if(_0x2dc2d0){_0x389a1b[_0x5e16('0x48')]=_[_0x5e16('0x4b')](db[_0x5e16('0x85')][_0x5e16('0x44')]);_0x389a1b['query']=_['keys'](_0x484072[_0x5e16('0x4a')]);_0x389a1b['filters']=_[_0x5e16('0x4d')](_0x389a1b['model'],_0x389a1b[_0x5e16('0x4a')]);_0x5593b4[_0x5e16('0x4f')]=_[_0x5e16('0x4d')](_0x389a1b[_0x5e16('0x48')],qs[_0x5e16('0x4e')](_0x484072[_0x5e16('0x4a')][_0x5e16('0x4e')]));_0x5593b4['attributes']=_0x5593b4[_0x5e16('0x4f')][_0x5e16('0x50')]?_0x5593b4[_0x5e16('0x4f')]:_0x389a1b[_0x5e16('0x48')];if(!_0x484072[_0x5e16('0x4a')][_0x5e16('0x51')](_0x5e16('0x52'))){_0x5593b4[_0x5e16('0x24')]=qs['limit'](_0x484072['query'][_0x5e16('0x24')]);_0x5593b4[_0x5e16('0x22')]=qs[_0x5e16('0x22')](_0x484072[_0x5e16('0x4a')][_0x5e16('0x22')]);}_0x5593b4['order']=qs[_0x5e16('0x53')](_0x484072[_0x5e16('0x4a')]['sort']);_0x5593b4[_0x5e16('0x54')]=qs[_0x5e16('0x4c')](_['pick'](_0x484072[_0x5e16('0x4a')],_0x389a1b[_0x5e16('0x4c')]));_0x5593b4[_0x5e16('0x54')][_0x5e16('0x68')]=_0x2dc2d0['id'];if(_0x484072['query'][_0x5e16('0x56')]){_0x5593b4[_0x5e16('0x54')]=_[_0x5e16('0x57')](_0x5593b4['where'],{'$or':_[_0x5e16('0x49')](_0x5593b4[_0x5e16('0x4f')],function(_0x49599a){var _0x24d4cc={};_0x24d4cc[_0x49599a]={'$like':'%'+_0x484072[_0x5e16('0x4a')][_0x5e16('0x56')]+'%'};return _0x24d4cc;})});}_0x5593b4=_[_0x5e16('0x57')]({},_0x5593b4,_0x484072[_0x5e16('0x58')]);return db[_0x5e16('0x85')][_0x5e16('0x25')]({'where':_0x5593b4[_0x5e16('0x54')]})[_0x5e16('0x14')](function(_0x312714){_0x4013cd[_0x5e16('0x25')]=_0x312714;if(_0x484072[_0x5e16('0x4a')]['includeAll']){_0x5593b4[_0x5e16('0x6e')]=[{'model':db[_0x5e16('0x86')],'as':_0x5e16('0x87'),'required':![]},{'model':db['User'],'as':_0x5e16('0x88'),'attributes':[_0x5e16('0x2c'),_0x5e16('0x89'),_0x5e16('0x8a')],'required':![]},{'model':db['Tag'],'as':_0x5e16('0x8b'),'attributes':['id','name','color'],'where':_0x484072[_0x5e16('0x4a')][_0x5e16('0x8c')]?{'id':_0x484072['query']['tag']}:undefined,'required':_0x484072[_0x5e16('0x4a')]['tag']?!![]:![]}];}return db[_0x5e16('0x85')][_0x5e16('0x5b')](_0x5593b4);})[_0x5e16('0x14')](function(_0x175913){_0x4013cd[_0x5e16('0x74')]=_0x175913;return _0x4013cd;});}})[_0x5e16('0x14')](respondWithFilteredResult(_0x28fdc2,_0x5593b4))[_0x5e16('0x1e')](handleError(_0x28fdc2,null));};exports[_0x5e16('0x8d')]=function addApplications(_0x23bca1,_0x6cd3e7){var _0x386091=_0x23bca1[_0x5e16('0x5d')]['id'];var _0x30825b=_0x23bca1[_0x5e16('0x62')];var _0x3a95bf=0xc8;var _0x2120db=null;return db['sequelize'][_0x5e16('0x8e')]({'isolationLevel':db[_0x5e16('0x8f')][_0x5e16('0x90')][_0x5e16('0x91')]['READ_COMMITTED']},function(_0x5e8499){return db[_0x5e16('0x59')][_0x5e16('0x6c')]({'where':{'id':_0x386091},'transaction':_0x5e8499})['then'](function(_0xf136da){if(_0xf136da){return db['MailApplication'][_0x5e16('0x28')]({'where':{'MailAccountId':_0x386091},'transaction':_0x5e8499})[_0x5e16('0x14')](function(){var _0x43a0bd=_[_0x5e16('0x49')](_0x30825b,function(_0xb433af){_0xb433af[_0x5e16('0x68')]=_0x386091;return _0xb433af;});return db[_0x5e16('0x92')]['bulkCreate'](_0x43a0bd,{'transaction':_0x5e8499});});}else{_0x3a95bf=0x194;_0x2120db=[];}});})[_0x5e16('0x14')](function(){if(_0x3a95bf!==0x194){return db[_0x5e16('0x92')][_0x5e16('0x93')]({'where':{'MailAccountId':_0x386091},'order':_0x5e16('0x94')})['then'](function(_0x96ac81){_0x2120db=_0x96ac81;});}})[_0x5e16('0x1e')](function(_0x29c2e3){_0x3a95bf=0x1f4;logger['error'](_0x29c2e3[_0x5e16('0x2b')]);if(_0x29c2e3[_0x5e16('0x2c')]){delete _0x29c2e3[_0x5e16('0x2c')];}_0x2120db=_0x29c2e3;})[_0x5e16('0x95')](function(){if(_0x2120db===null){_0x6cd3e7[_0x5e16('0x1f')](_0x3a95bf);}else{if(_0x3a95bf===0x1f4){_0x6cd3e7[_0x5e16('0x20')](_0x3a95bf)['send'](_0x2120db);}else{_0x6cd3e7[_0x5e16('0x20')](_0x3a95bf)['json'](_0x2120db);}}});};exports[_0x5e16('0x96')]=function(_0xea8c66,_0x4517da){var _0x226d45={};var _0x5b0a33={};var _0x3799af;var _0x45298d;return db['MailAccount'][_0x5e16('0x6c')]({'where':{'id':_0xea8c66[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x4517da,null))['then'](function(_0x323386){if(_0x323386){_0x3799af=_0x323386;_0x5b0a33[_0x5e16('0x48')]=_[_0x5e16('0x4b')](db[_0x5e16('0x92')][_0x5e16('0x44')]);_0x5b0a33[_0x5e16('0x4a')]=_[_0x5e16('0x4b')](_0xea8c66[_0x5e16('0x4a')]);_0x5b0a33[_0x5e16('0x4c')]=_[_0x5e16('0x4d')](_0x5b0a33[_0x5e16('0x48')],_0x5b0a33['query']);_0x226d45[_0x5e16('0x4f')]=_[_0x5e16('0x4d')](_0x5b0a33[_0x5e16('0x48')],qs[_0x5e16('0x4e')](_0xea8c66[_0x5e16('0x4a')][_0x5e16('0x4e')]));_0x226d45[_0x5e16('0x4f')]=_0x226d45[_0x5e16('0x4f')][_0x5e16('0x50')]?_0x226d45[_0x5e16('0x4f')]:_0x5b0a33[_0x5e16('0x48')];_0x226d45['order']=qs['sort'](_0xea8c66[_0x5e16('0x4a')][_0x5e16('0x53')]);_0x226d45[_0x5e16('0x54')]=qs['filters'](_[_0x5e16('0x55')](_0xea8c66[_0x5e16('0x4a')],_0x5b0a33[_0x5e16('0x4c')]));if(_0xea8c66[_0x5e16('0x4a')][_0x5e16('0x56')]){_0x226d45[_0x5e16('0x54')]=_['merge'](_0x226d45[_0x5e16('0x54')],{'$or':_[_0x5e16('0x49')](_0x226d45[_0x5e16('0x4f')],function(_0x2685c2){var _0x5bceff={};_0x5bceff[_0x2685c2]={'$like':'%'+_0xea8c66[_0x5e16('0x4a')][_0x5e16('0x56')]+'%'};return _0x5bceff;})});}_0x226d45=_[_0x5e16('0x57')]({},_0x226d45,_0xea8c66[_0x5e16('0x58')]);return _0x3799af[_0x5e16('0x96')](_0x226d45);}})['then'](function(_0x1e3294){if(_0x1e3294){_0x45298d=_0x1e3294[_0x5e16('0x50')];if(!_0xea8c66[_0x5e16('0x4a')][_0x5e16('0x51')](_0x5e16('0x52'))){_0x226d45[_0x5e16('0x24')]=qs[_0x5e16('0x24')](_0xea8c66['query'][_0x5e16('0x24')]);_0x226d45[_0x5e16('0x22')]=qs[_0x5e16('0x22')](_0xea8c66['query']['offset']);}return _0x3799af['getApplications'](_0x226d45);}})[_0x5e16('0x14')](function(_0x338047){if(_0x338047){return _0x338047?{'count':_0x45298d,'rows':_0x338047}:null;}})[_0x5e16('0x14')](respondWithResult(_0x4517da,null))['catch'](handleError(_0x4517da,null));};exports[_0x5e16('0x97')]=function(_0x520c57,_0x5d00e5){var _0x4407ae={'raw':!![],'where':{}};var _0xa0411a={};var _0x487978={'count':0x0,'rows':[]};return db[_0x5e16('0x59')][_0x5e16('0x6c')]({'where':{'id':_0x520c57['params']['id']}})['then'](handleEntityNotFound(_0x5d00e5,null))[_0x5e16('0x14')](function(_0x1e63ad){if(_0x1e63ad){_0xa0411a[_0x5e16('0x48')]=_[_0x5e16('0x4b')](db[_0x5e16('0x98')][_0x5e16('0x44')]);_0xa0411a[_0x5e16('0x4a')]=_[_0x5e16('0x4b')](_0x520c57[_0x5e16('0x4a')]);_0xa0411a['filters']=_[_0x5e16('0x4d')](_0xa0411a[_0x5e16('0x48')],_0xa0411a[_0x5e16('0x4a')]);_0x4407ae[_0x5e16('0x4f')]=_['intersection'](_0xa0411a[_0x5e16('0x48')],qs['fields'](_0x520c57[_0x5e16('0x4a')][_0x5e16('0x4e')]));_0x4407ae[_0x5e16('0x4f')]=_0x4407ae[_0x5e16('0x4f')][_0x5e16('0x50')]?_0x4407ae[_0x5e16('0x4f')]:_0xa0411a[_0x5e16('0x48')];if(!_0x520c57[_0x5e16('0x4a')][_0x5e16('0x51')](_0x5e16('0x52'))){_0x4407ae[_0x5e16('0x24')]=qs['limit'](_0x520c57[_0x5e16('0x4a')][_0x5e16('0x24')]);_0x4407ae[_0x5e16('0x22')]=qs[_0x5e16('0x22')](_0x520c57[_0x5e16('0x4a')][_0x5e16('0x22')]);}_0x4407ae[_0x5e16('0x6d')]=qs[_0x5e16('0x53')](_0x520c57['query'][_0x5e16('0x53')]);_0x4407ae[_0x5e16('0x54')]=qs[_0x5e16('0x4c')](_[_0x5e16('0x55')](_0x520c57[_0x5e16('0x4a')],_0xa0411a['filters']));_0x4407ae['where'][_0x5e16('0x68')]=_0x1e63ad['id'];if(_0x520c57[_0x5e16('0x4a')]['filter']){_0x4407ae[_0x5e16('0x54')]=_['merge'](_0x4407ae[_0x5e16('0x54')],{'$or':_[_0x5e16('0x49')](_0x4407ae[_0x5e16('0x4f')],function(_0x148a01){var _0x51752f={};_0x51752f[_0x148a01]={'$like':'%'+_0x520c57[_0x5e16('0x4a')]['filter']+'%'};return _0x51752f;})});}if(_0x520c57[_0x5e16('0x4a')]['$gte']){var _0x4aa045=_0x520c57[_0x5e16('0x4a')][_0x5e16('0x99')][_0x5e16('0x9a')](',');var _0x373a6b={};_0x373a6b[_0x4aa045[0x0]]={'$gte':moment(_0x4aa045[0x1])[_0x5e16('0x9b')](_0x5e16('0x9c'))};_0x4407ae[_0x5e16('0x54')]=_[_0x5e16('0x57')](_0x4407ae[_0x5e16('0x54')],_0x373a6b);}_0x4407ae=_[_0x5e16('0x57')]({},_0x4407ae,_0x520c57[_0x5e16('0x58')]);return db[_0x5e16('0x98')][_0x5e16('0x25')]({'where':_0x4407ae['where']})['then'](function(_0x4d1c9f){_0x487978[_0x5e16('0x25')]=_0x4d1c9f;if(_0x520c57[_0x5e16('0x4a')][_0x5e16('0x5a')]){_0x4407ae['include']=[{'all':!![]}];}return db[_0x5e16('0x98')][_0x5e16('0x5b')](_0x4407ae);})[_0x5e16('0x14')](function(_0x126521){if(_0x520c57[_0x5e16('0x4a')][_0x5e16('0x9d')]==='true'){for(var _0x3096e7=0x0;_0x3096e7<_0x126521[_0x5e16('0x50')];_0x3096e7++){_0x126521[_0x3096e7][_0x5e16('0x62')]=juice(_0x126521[_0x3096e7][_0x5e16('0x62')]);}}_0x487978[_0x5e16('0x74')]=_0x126521;return _0x487978;});}})[_0x5e16('0x14')](respondWithFilteredResult(_0x5d00e5,_0x4407ae))['catch'](handleError(_0x5d00e5,null));};exports[_0x5e16('0x9e')]=function(_0x28a875,_0x45266c){var _0x5b4a79,_0x5c87f5={},_0x2341fc;if(_0x28a875['body']['to']){_0x2341fc=_0x28a875['body']['to'][_0x5e16('0x9a')](',')[0x0];}return db[_0x5e16('0x59')]['find']({'where':{'id':_0x28a875['params']['id']},'include':[{'model':db[_0x5e16('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x5e16('0xa0'),'where':{'email':_0x2341fc},'limit':0x1,'order':[[_0x5e16('0xa1'),_0x5e16('0xa2')]]}]},{'model':db[_0x5e16('0x5f')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5e16('0xa3'),'raw':!![]}]}]})[_0x5e16('0x14')](handleEntityNotFound(_0x45266c,null))[_0x5e16('0x14')](function(_0xb8f059){if(!_0xb8f059)return;_0x5b4a79=_0xb8f059;if(!_0xb8f059[_0x5e16('0x41')])throw new Error(_0x5e16('0xa4'));if(_['isNil'](_0x28a875[_0x5e16('0x62')][_0x5e16('0xa5')])){_0x28a875[_0x5e16('0x62')][_0x5e16('0xa5')]=util['format'](_0x5e16('0xa6'),_0xb8f059[_0x5e16('0x2c')],_0xb8f059['email']||_0xb8f059['Smtp'][_0x5e16('0x36')]);}if(_0x28a875['body'][_0x5e16('0xa7')]&&_0x28a875[_0x5e16('0x62')]['attachments'][_0x5e16('0x50')]){for(var _0x4e49cb=0x0;_0x4e49cb<_0x28a875[_0x5e16('0x62')][_0x5e16('0xa7')][_0x5e16('0x50')];_0x4e49cb+=0x1){_0x28a875[_0x5e16('0x62')]['attachments'][_0x4e49cb]={'filename':_0x28a875[_0x5e16('0x62')][_0x5e16('0xa7')][_0x4e49cb]['name'],'path':path['join'](config[_0x5e16('0xa8')],_0x5e16('0xa9'),_0x28a875['body'][_0x5e16('0xa7')][_0x4e49cb]['basename'])};}}var _0x212cc6=_0xb8f059[_0x5e16('0xaa')]();return respondWithRpcPromise('SendMail',_0x5e16('0xab'),{'account':_0x212cc6,'message':_0x28a875[_0x5e16('0x62')]});})[_0x5e16('0x14')](function(_0x2e7dee){if(!_0x2e7dee)return;_0x5c87f5=_0x2e7dee;if(!_0x5b4a79[_0x5e16('0xac')])throw new Error(_0x5e16('0xad'));if(_0x5b4a79[_0x5e16('0xac')]['Contacts'][_0x5e16('0x50')])return _0x5b4a79[_0x5e16('0xac')][_0x5e16('0xa0')][0x0];return db[_0x5e16('0x86')][_0x5e16('0x6a')](_[_0x5e16('0xae')](_0x28a875[_0x5e16('0x62')],{'firstName':_0x28a875[_0x5e16('0x62')]['to'],'email':_0x28a875[_0x5e16('0x62')]['to'],'phone':_0x28a875['body']['to'],'ListId':_0x5b4a79['ListId']}));})[_0x5e16('0x14')](function(_0x221500){if(!_0x221500)return;var _0x1a25b1={'UserId':_0x28a875[_0x5e16('0x36')]['id'],'ContactId':_0x221500['id'],'MailAccountId':_0x5b4a79['id'],'inReplyTo':_0x5c87f5[_0x5e16('0xaf')],'to':_0x28a875[_0x5e16('0x62')][_0x5e16('0xa5')],'cc':_0x28a875[_0x5e16('0x62')]['cc'],'subject':_0x28a875[_0x5e16('0x62')][_0x5e16('0xb0')],'attach':_0x28a875[_0x5e16('0x62')][_0x5e16('0xb1')],'firstMsgDirection':_0x5e16('0xb2'),'lastMsgAt':moment()[_0x5e16('0x9b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x5e16('0xb2'),'Messages':[_[_0x5e16('0x57')](_0x28a875['body'],{'messageId':_0x5c87f5[_0x5e16('0xaf')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5b4a79['id'],'UserId':_0x28a875['user']['id'],'ContactId':_0x221500['id']})]};if(_0x28a875[_0x5e16('0x62')]['Interaction']){_0x1a25b1=_[_0x5e16('0x57')](_0x1a25b1,_0x28a875[_0x5e16('0x62')][_0x5e16('0xb3')]);}return db[_0x5e16('0x85')][_0x5e16('0x6a')](_0x1a25b1,{'include':[{'model':db[_0x5e16('0x98')],'as':_0x5e16('0xb4')}]});})[_0x5e16('0x14')](respondWithResult(_0x45266c,null))[_0x5e16('0x1e')](handleError(_0x45266c,null));};exports['verifySmtp']=function(_0x28128b,_0x17f1b7){return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0x28128b[_0x5e16('0x5d')]['id']},'include':[{'model':db[_0x5e16('0x5f')],'as':_0x5e16('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5e16('0xa3'),'raw':!![]}]}]})[_0x5e16('0x14')](handleEntityNotFound(_0x17f1b7,null))[_0x5e16('0x14')](function(_0x34d7bf){if(!_0x34d7bf[_0x5e16('0x41')])return;var _0x3e27f1=_0x34d7bf[_0x5e16('0xaa')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x3e27f1});})[_0x5e16('0x14')](respondWithResult(_0x17f1b7,null))['catch'](handleError(_0x17f1b7,null));};exports[_0x5e16('0x28')]=function(_0xad8f84,_0x4deb3e){return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0xad8f84['params']['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x4deb3e,null))[_0x5e16('0x14')](function(_0x1bd226){if(_0x1bd226&&_0x1bd226[_0x5e16('0x3e')]){throw new db[(_0x5e16('0xb5'))][(_0x5e16('0xb6'))](_0x5e16('0xb7'));}return _0x1bd226;})['then'](removeEntity(_0x4deb3e,null))[_0x5e16('0x1e')](handleError(_0x4deb3e,null));};exports['addAgents']=function(_0x139021,_0x16f863){return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0x139021[_0x5e16('0x5d')]['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x16f863,null))['then'](function(_0xd6a2cd){if(_0xd6a2cd){return _0xd6a2cd[_0x5e16('0xb8')](_0x139021[_0x5e16('0x62')]['ids'],_['omit'](_0x139021[_0x5e16('0x62')],['ids','id'])||{})[_0x5e16('0xb9')](function(_0x335f8f){for(var _0x310adf=0x0;_0x310adf<_0x139021['body'][_0x5e16('0x70')][_0x5e16('0x50')];_0x310adf+=0x1){socket[_0x5e16('0xba')](_0x5e16('0xbb'),{'UserId':Number(_0x139021[_0x5e16('0x62')][_0x5e16('0x70')][_0x310adf]),'MailAccountId':Number(_0x139021[_0x5e16('0x5d')]['id'])});}return _0x335f8f;});}})[_0x5e16('0x14')](respondWithResult(_0x16f863,null))[_0x5e16('0x1e')](handleError(_0x16f863,null));};exports[_0x5e16('0xbc')]=function(_0x53a7b0,_0x8b9d81){return db[_0x5e16('0x59')][_0x5e16('0x61')]({'where':{'id':_0x53a7b0[_0x5e16('0x5d')]['id']}})['then'](handleEntityNotFound(_0x8b9d81,null))[_0x5e16('0x14')](function(_0x3f55c7){if(_0x3f55c7){return _0x3f55c7[_0x5e16('0xbc')](_0x53a7b0[_0x5e16('0x4a')]['ids'])[_0x5e16('0x14')](function(){if(_[_0x5e16('0xbd')](_0x53a7b0[_0x5e16('0x4a')][_0x5e16('0x70')])){for(var _0x150488=0x0;_0x150488<_0x53a7b0[_0x5e16('0x4a')][_0x5e16('0x70')][_0x5e16('0x50')];_0x150488+=0x1){socket['emit'](_0x5e16('0xbe'),{'UserId':Number(_0x53a7b0[_0x5e16('0x4a')][_0x5e16('0x70')][_0x150488]),'MailAccountId':Number(_0x53a7b0['params']['id'])});}}else{socket[_0x5e16('0xba')](_0x5e16('0xbe'),{'UserId':Number(_0x53a7b0[_0x5e16('0x4a')]['ids']),'MailAccountId':Number(_0x53a7b0[_0x5e16('0x5d')]['id'])});}});}})[_0x5e16('0x14')](respondWithStatusCode(_0x8b9d81,null))[_0x5e16('0x1e')](handleError(_0x8b9d81,null));};exports[_0x5e16('0xbf')]=function(_0x42985b,_0x3a73b0){var _0x41a965={};var _0x4cc3d0={};var _0x1e40b6;var _0x2d23f9;return db[_0x5e16('0x59')]['findOne']({'where':{'id':_0x42985b['params']['id']}})[_0x5e16('0x14')](handleEntityNotFound(_0x3a73b0,null))[_0x5e16('0x14')](function(_0x32ea4f){if(_0x32ea4f){_0x1e40b6=_0x32ea4f;_0x4cc3d0[_0x5e16('0x48')]=_[_0x5e16('0x4b')](db[_0x5e16('0xc0')][_0x5e16('0x44')]);_0x4cc3d0[_0x5e16('0x4a')]=_[_0x5e16('0x4b')](_0x42985b[_0x5e16('0x4a')]);_0x4cc3d0[_0x5e16('0x4c')]=_['intersection'](_0x4cc3d0[_0x5e16('0x48')],_0x4cc3d0[_0x5e16('0x4a')]);_0x41a965[_0x5e16('0x4f')]=_['intersection'](_0x4cc3d0[_0x5e16('0x48')],qs[_0x5e16('0x4e')](_0x42985b['query'][_0x5e16('0x4e')]));_0x41a965[_0x5e16('0x4f')]=_0x41a965[_0x5e16('0x4f')]['length']?_0x41a965['attributes']:_0x4cc3d0[_0x5e16('0x48')];_0x41a965[_0x5e16('0x6d')]=qs[_0x5e16('0x53')](_0x42985b[_0x5e16('0x4a')][_0x5e16('0x53')]);_0x41a965[_0x5e16('0x54')]=qs[_0x5e16('0x4c')](_['pick'](_0x42985b[_0x5e16('0x4a')],_0x4cc3d0[_0x5e16('0x4c')]));if(_0x42985b[_0x5e16('0x4a')]['filter']){_0x41a965[_0x5e16('0x54')]=_[_0x5e16('0x57')](_0x41a965['where'],{'$or':_[_0x5e16('0x49')](_0x41a965[_0x5e16('0x4f')],function(_0xd5a9ce){var _0xb26ca8={};_0xb26ca8[_0xd5a9ce]={'$like':'%'+_0x42985b[_0x5e16('0x4a')][_0x5e16('0x56')]+'%'};return _0xb26ca8;})});}_0x41a965=_[_0x5e16('0x57')]({},_0x41a965,_0x42985b['options']);return _0x1e40b6[_0x5e16('0xbf')](_0x41a965);}})['then'](function(_0xd17a2a){if(_0xd17a2a){_0x2d23f9=_0xd17a2a['length'];if(!_0x42985b[_0x5e16('0x4a')][_0x5e16('0x51')]('nolimit')){_0x41a965[_0x5e16('0x24')]=qs[_0x5e16('0x24')](_0x42985b[_0x5e16('0x4a')]['limit']);_0x41a965[_0x5e16('0x22')]=qs['offset'](_0x42985b[_0x5e16('0x4a')][_0x5e16('0x22')]);}return _0x1e40b6[_0x5e16('0xbf')](_0x41a965);}})[_0x5e16('0x14')](function(_0xd089a2){if(_0xd089a2){return _0xd089a2?{'count':_0x2d23f9,'rows':_0xd089a2}:null;}})['then'](respondWithResult(_0x3a73b0,null))[_0x5e16('0x1e')](handleError(_0x3a73b0,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 19b726d..6210036 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 _0x2b38=['hook','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x1c494a,_0x38b42c){var _0x796382=function(_0xe5872f){while(--_0xe5872f){_0x1c494a['push'](_0x1c494a['shift']());}};_0x796382(++_0x38b42c);}(_0x2b38,0x19f));var _0x82b3=function(_0x1dc480,_0x4cc1a5){_0x1dc480=_0x1dc480-0x0;var _0x10b36d=_0x2b38[_0x1dc480];return _0x10b36d;};'use strict';var EventEmitter=require(_0x82b3('0x0'));var MailAccount=require(_0x82b3('0x1'))['db'][_0x82b3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x82b3('0x3')](0x0);var events={'afterCreate':_0x82b3('0x4'),'afterUpdate':_0x82b3('0x5'),'afterDestroy':_0x82b3('0x6')};function emitEvent(_0x567e7b){return function(_0x5d1c5f,_0x55865b,_0x445528){MailAccountEvents['emit'](_0x567e7b+':'+_0x5d1c5f['id'],_0x5d1c5f);MailAccountEvents[_0x82b3('0x7')](_0x567e7b,_0x5d1c5f);_0x445528(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x82b3('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x72e4=['MailAccount','setMaxListeners','update','emit','hook','exports','events','../../mysqldb'];(function(_0x2641e5,_0x165b4b){var _0x3831f2=function(_0x50a8c6){while(--_0x50a8c6){_0x2641e5['push'](_0x2641e5['shift']());}};_0x3831f2(++_0x165b4b);}(_0x72e4,0xae));var _0x472e=function(_0x5c2a55,_0x2d2ab0){_0x5c2a55=_0x5c2a55-0x0;var _0xd94921=_0x72e4[_0x5c2a55];return _0xd94921;};'use strict';var EventEmitter=require(_0x472e('0x0'));var MailAccount=require(_0x472e('0x1'))['db'][_0x472e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x472e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x472e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cbb43){return function(_0x36162d,_0x53f7c1,_0x122fa5){MailAccountEvents[_0x472e('0x5')](_0x4cbb43+':'+_0x36162d['id'],_0x36162d);MailAccountEvents[_0x472e('0x5')](_0x4cbb43,_0x36162d);_0x122fa5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x472e('0x6')](e,emitEvent(event));}}module[_0x472e('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 378e06b..9bf9f65 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 _0x69bc=['modernAuthentication','CloudProvider','auth','OAuth2','data5','user','pass','exports','MailAccount','provider','custom','service','host','Smtp','port','secure'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0x69bc,0x1a7));var _0xc69b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x69bc[_0xf50820];return _0x2a9b10;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xc69b('0x0')]=function(_0x2d7873){return _0x2d7873['define'](_0xc69b('0x1'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x10f09e=this;var _0x1f5325={'id':_0x10f09e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x10f09e[_0xc69b('0x2')]!==_0xc69b('0x3')){_0x1f5325[_0xc69b('0x4')]=_0x10f09e[_0xc69b('0x2')];}else{_0x1f5325[_0xc69b('0x5')]=_0x10f09e[_0xc69b('0x6')][_0xc69b('0x5')];_0x1f5325[_0xc69b('0x7')]=_0x10f09e[_0xc69b('0x6')][_0xc69b('0x7')];_0x1f5325['secure']=_0x10f09e[_0xc69b('0x6')][_0xc69b('0x8')];}if(_0x10f09e[_0xc69b('0x6')]['authentication']){if(_0x10f09e[_0xc69b('0x6')][_0xc69b('0x9')]){if(!_0x10f09e[_0xc69b('0x6')][_0xc69b('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x1f5325[_0xc69b('0xb')]={'type':_0xc69b('0xc'),'user':_0x10f09e[_0xc69b('0x6')]['user'],'accessToken':_0x10f09e[_0xc69b('0x6')]['CloudProvider'][_0xc69b('0xd')]};}else{_0x1f5325['auth']={'user':_0x10f09e['Smtp'][_0xc69b('0xe')],'pass':_0x10f09e['Smtp'][_0xc69b('0xf')]};}}return _0x1f5325;}}});}; \ No newline at end of file +var _0x68dc=['host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','OAuth2','user','data5','auth','pass','./mailAccount.attributes','exports','define','MailAccount','provider','service'];(function(_0x23a33f,_0x413c03){var _0x56e720=function(_0x21a646){while(--_0x21a646){_0x23a33f['push'](_0x23a33f['shift']());}};_0x56e720(++_0x413c03);}(_0x68dc,0xd2));var _0xc68d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x68dc[_0x51020b];return _0x371e47;};'use strict';var attributes=require(_0xc68d('0x0'));module[_0xc68d('0x1')]=function(_0x10690c){return _0x10690c[_0xc68d('0x2')](_0xc68d('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x43b58d=this;var _0x5d4371={'id':_0x43b58d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x43b58d[_0xc68d('0x4')]!=='custom'){_0x5d4371[_0xc68d('0x5')]=_0x43b58d[_0xc68d('0x4')];}else{_0x5d4371[_0xc68d('0x6')]=_0x43b58d[_0xc68d('0x7')][_0xc68d('0x6')];_0x5d4371[_0xc68d('0x8')]=_0x43b58d['Smtp']['port'];_0x5d4371[_0xc68d('0x9')]=_0x43b58d[_0xc68d('0x7')]['secure'];}if(_0x43b58d['Smtp'][_0xc68d('0xa')]){if(_0x43b58d['Smtp'][_0xc68d('0xb')]){if(!_0x43b58d['Smtp'][_0xc68d('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x5d4371['auth']={'type':_0xc68d('0xd'),'user':_0x43b58d['Smtp'][_0xc68d('0xe')],'accessToken':_0x43b58d[_0xc68d('0x7')][_0xc68d('0xc')][_0xc68d('0xf')]};}else{_0x5d4371[_0xc68d('0x10')]={'user':_0x43b58d['Smtp'][_0xc68d('0xe')],'pass':_0x43b58d[_0xc68d('0x7')][_0xc68d('0x11')]};}}return _0x5d4371;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 68e3d90..676e3ec 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 _0xe2fe=['list','List','priority','asc','autoclose','push','length','close','Contacts','defaults','ListId','CmContact','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','Contact\x20not\x20found','spread','interaction','MailMessage','originCc','Attachments','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','then','debug','catch','ShowMailAccount','raw','smtp','smtpOptions','getSmtpOptions','body','mail','keys','createdAt','updatedAt','CompanyId','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','find','account','CmList','Smtp','CloudProvider','get','omit','Applications','applications'];(function(_0x134625,_0x2f06ae){var _0x4dee9e=function(_0x37ffe7){while(--_0x37ffe7){_0x134625['push'](_0x134625['shift']());}};_0x4dee9e(++_0x2f06ae);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee2f('0x1'));var Redis=require('ioredis');var db=require(_0xee2f('0x2'))['db'];var logger=require(_0xee2f('0x3'))(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var jayson=require(_0xee2f('0x6'));var client=jayson['client'][_0xee2f('0x7')]({'port':0x232c});config[_0xee2f('0x8')]=_['defaults'](config[_0xee2f('0x8')],{'host':_0xee2f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0x8')]));require('./mailAccount.socket')[_0xee2f('0xa')](socket);function respondWithRpcPromise(_0x36920f,_0x53f7dd,_0x3a49bb){return new BPromise(function(_0x43f451,_0x4bf3c3){return client['request'](_0x36920f,_0x3a49bb)['then'](function(_0x56bbea){logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,'request\x20sent');logger['debug'](_0xee2f('0xc'),_0x53f7dd,_0xee2f('0xd'),JSON[_0xee2f('0xe')](_0x56bbea));if(_0x56bbea[_0xee2f('0xf')]){if(_0x56bbea[_0xee2f('0xf')][_0xee2f('0x10')]===0x1f4){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x56bbea['error'][_0xee2f('0x12')]);return _0x4bf3c3(_0x56bbea[_0xee2f('0xf')]['message']);}logger[_0xee2f('0xf')](_0xee2f('0x11'),_0x53f7dd,_0x56bbea[_0xee2f('0xf')][_0xee2f('0x12')]);return _0x43f451(_0x56bbea[_0xee2f('0xf')]['message']);}else{logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,_0xee2f('0xd'));_0x43f451(_0x56bbea[_0xee2f('0x13')]['message']);}})['catch'](function(_0x40b5bc){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x40b5bc);_0x4bf3c3(_0x40b5bc);});});}exports[_0xee2f('0x14')]=function(_0x28549d){var _0x5b83b5=this;return new Promise(function(_0x35e1a4,_0x1e70aa){return db[_0xee2f('0x15')][_0xee2f('0x16')]({'raw':_0x28549d[_0xee2f('0x17')]?_0x28549d['options']['raw']===undefined?!![]:![]:!![],'where':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x18')]||null:null,'attributes':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'limit':_0x28549d[_0xee2f('0x17')]?_0x28549d['options'][_0xee2f('0x1a')]||null:null,'include':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x13013f){return{'model':db[_0x13013f[_0xee2f('0x1d')]],'as':_0x13013f['as'],'attributes':_0x13013f[_0xee2f('0x19')],'include':_0x13013f[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x13013f[_0xee2f('0x1b')],function(_0x45c4a0){return{'model':db[_0x45c4a0['model']],'as':_0x45c4a0['as'],'attributes':_0x45c4a0['attributes'],'include':_0x45c4a0['include']?_[_0xee2f('0x1c')](_0x45c4a0[_0xee2f('0x1b')],function(_0x2cb0cb){return{'model':db[_0x2cb0cb[_0xee2f('0x1d')]],'as':_0x2cb0cb['as'],'attributes':_0x2cb0cb[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x4d8398){logger[_0xee2f('0xb')]('GetMailAccount',_0x28549d);logger[_0xee2f('0x1f')](_0xee2f('0x14'),_0x28549d,JSON[_0xee2f('0xe')](_0x4d8398));_0x35e1a4(_0x4d8398);})[_0xee2f('0x20')](function(_0x3ddbe3){logger['error'](_0xee2f('0x14'),_0x3ddbe3[_0xee2f('0x12')],_0x28549d);_0x1e70aa(_0x5b83b5['error'](0x1f4,_0x3ddbe3['message']));});});};exports[_0xee2f('0x21')]=function(_0x574899){var _0x33c426=this;return new Promise(function(_0xc447e,_0x53d9b7){return db[_0xee2f('0x15')]['find']({'raw':_0x574899['options']?_0x574899['options'][_0xee2f('0x22')]===undefined?!![]:![]:!![],'where':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x18')]||null:null,'attributes':_0x574899[_0xee2f('0x17')]?_0x574899[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'include':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x1b')]?_['map'](_0x574899[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x3dcb9e){return{'model':db[_0x3dcb9e['model']],'as':_0x3dcb9e['as'],'attributes':_0x3dcb9e[_0xee2f('0x19')],'include':_0x3dcb9e['include']?_[_0xee2f('0x1c')](_0x3dcb9e['include'],function(_0x3e6dcc){return{'model':db[_0x3e6dcc[_0xee2f('0x1d')]],'as':_0x3e6dcc['as'],'attributes':_0x3e6dcc[_0xee2f('0x19')],'include':_0x3e6dcc[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x3e6dcc[_0xee2f('0x1b')],function(_0x24380b){return{'model':db[_0x24380b[_0xee2f('0x1d')]],'as':_0x24380b['as'],'attributes':_0x24380b[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x433547){if(_0x574899['options'][_0xee2f('0x23')]===!![])_0x433547['setDataValue'](_0xee2f('0x24'),_0x433547[_0xee2f('0x25')]());logger[_0xee2f('0xb')](_0xee2f('0x21'),_0x574899);logger[_0xee2f('0x1f')](_0xee2f('0x21'),_0x574899,JSON[_0xee2f('0xe')](_0x433547));_0xc447e(_0x433547);})[_0xee2f('0x20')](function(_0x50ddd2){logger['error']('ShowMailAccount',_0x50ddd2[_0xee2f('0x12')],_0x574899);_0x53d9b7(_0x33c426['error'](0x1f4,_0x50ddd2[_0xee2f('0x12')]));});});};exports['NotifyMailAccount']=function(_0x558aa3){var _0x5027a6=this;return new Promise(function(_0x58e361,_0x430ac1){var _0x692686={'body':_0x558aa3[_0xee2f('0x26')],'channel':_0xee2f('0x27')};var _0x4823a7=_['difference'](_[_0xee2f('0x28')](db['CmContact']['rawAttributes']),[_0xee2f('0x29'),_0xee2f('0x2a'),_0xee2f('0x2b'),'ListId']);var _0x3bc173=![];if(_0x558aa3[_0xee2f('0x26')]['id']){delete _0x558aa3[_0xee2f('0x26')]['id'];}if(_['isNil'](_0x558aa3['body'][_0xee2f('0x2c')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2d')));}if(_[_0xee2f('0x2e')](_0x558aa3['body'][_0xee2f('0x26')])||_0x558aa3[_0xee2f('0x26')][_0xee2f('0x26')]===''){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2f')));}if(_[_0xee2f('0x2e')](_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x31')+_0x4823a7));}if(!_['includes'](_0x4823a7,_0x558aa3['body']['mapKey'])){return _0x430ac1(_0x5027a6['error'](0x1f4,_0xee2f('0x32')+_0x4823a7));}var _0x3e0d7b={};_0x3e0d7b[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3[_0xee2f('0x26')]['from'];return db[_0xee2f('0x15')][_0xee2f('0x33')]({'where':{'id':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db[_0xee2f('0x35')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3e0d7b,'limit':0x1,'order':[[_0xee2f('0x2a'),'DESC']]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xee2f('0x36'),'include':[{'model':db[_0xee2f('0x37')],'as':_0xee2f('0x37')}]}]})['then'](function(_0x22506e){if(_0x22506e&&_0x22506e['List']){var _0x3d95b8=_0x22506e[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x34')]=_[_0xee2f('0x39')](_0x3d95b8,[_0xee2f('0x3a'),'List']);_0x692686['account'][_0xee2f('0x24')]=_0x22506e['getSmtpOptions']();_0x692686[_0xee2f('0x3b')]=_0x3d95b8[_0xee2f('0x3a')];_0x692686[_0xee2f('0x3c')]=_0x3d95b8[_0xee2f('0x3d')];_0x692686['applications']=_['orderBy'](_0x692686[_0xee2f('0x3b')],[_0xee2f('0x3e')],[_0xee2f('0x3f')]);if(_0x692686[_0xee2f('0x34')]&&_0x692686[_0xee2f('0x34')][_0xee2f('0x40')]){_0x692686[_0xee2f('0x3b')][_0xee2f('0x41')]({'id':0x0,'priority':_0x692686[_0xee2f('0x3b')][_0xee2f('0x42')]+0x1,'app':_0xee2f('0x43'),'appdata':_0xee2f('0x40'),'interval':'*,*,*,*'});}if(_0x692686[_0xee2f('0x34')][_0xee2f('0x3a')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3a')];}if(_0x692686['account'][_0xee2f('0x3d')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3d')];}if(_0x3d95b8[_0xee2f('0x3d')][_0xee2f('0x44')]['length']){return _0x3d95b8[_0xee2f('0x3d')]['Contacts'][0x0];}var _0x4db455=_[_0xee2f('0x45')](_0x558aa3[_0xee2f('0x26')],{'firstName':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x2c')],'ListId':_0x3d95b8[_0xee2f('0x46')]});_0x4db455[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3['body'][_0xee2f('0x2c')];return db[_0xee2f('0x47')][_0xee2f('0x48')](_0x4db455);}else{throw new Error(_0xee2f('0x49'));}})[_0xee2f('0x1e')](function(_0x3e1184){_0x692686[_0xee2f('0x4a')]=_0x3e1184;if(_0x3e1184){if(!_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['messageId']){_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4b')]=rs[_0xee2f('0x4c')]()+'\x20'+_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')];}var _0x5ee444={'ContactId':_0x3e1184['id'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3['body']['message']['from'],'cc':_0x558aa3['body']['message']['cc'],'subject':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4d')],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'lastMsgAt':moment()[_0xee2f('0x4f')](_0xee2f('0x50')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xee2f('0x51'),'attributes':['messageId'],'where':{'messageId':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x52')]}}]})[_0xee2f('0x1e')](function(_0x2f419c){if(_0x2f419c){return[_0x2f419c,![]];}return db['MailInteraction'][_0xee2f('0x48')](_0x5ee444)[_0xee2f('0x1e')](function(_0x3bdfc5){return[_0x3bdfc5,!![]];});});}else{throw new Error(_0xee2f('0x53'));}})[_0xee2f('0x54')](function(_0x486146,_0xf0c721){if(_0x486146){_0x3bc173=_0xf0c721;if(!_0xf0c721){return _0x486146['update']({'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4d')],'attach':_0x486146['attach']?_0x486146[_0xee2f('0x4e')]:_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0xee2f('0x50')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x486146;}}})[_0xee2f('0x1e')](function(_0x46ecac){_0x692686[_0xee2f('0x55')]=_0x46ecac[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x55')]['created']=_0x3bc173;return db[_0xee2f('0x56')][_0xee2f('0x48')]({'body':_0x558aa3[_0xee2f('0x26')]['body'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'MailInteractionId':_0x46ecac['id'],'direction':'in','ContactId':_0x692686[_0xee2f('0x4a')]['id'],'messageId':_0x558aa3['body'][_0xee2f('0x12')][_0xee2f('0x4b')],'from':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['to'],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3['body']['message']['subject'],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'Attachments':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['attachments'],'originTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originTo'],'originCc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x57')],'bcc':_0x558aa3['body'][_0xee2f('0x12')]['bcc'],'ChatWebsiteId':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['ChatWebsiteId']||null,'originChannel':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originChannel']||'Email','ChatOfflineMessageId':_0x558aa3['body'][_0xee2f('0x12')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xee2f('0x58')}]});})[_0xee2f('0x1e')](function(_0x50a972){_0x692686[_0xee2f('0x12')]=_0x50a972;if(_0x692686['interaction'][_0xee2f('0x59')]){return db[_0xee2f('0x5a')][_0xee2f('0x33')]({'attributes':['id',_0xee2f('0x5b')],'where':{'id':_0x692686[_0xee2f('0x55')][_0xee2f('0x59')]}})[_0xee2f('0x1e')](function(_0x58da0d){if(_0x58da0d){_0x692686[_0xee2f('0x3b')][_0xee2f('0x5c')]({'id':0x0,'priority':0x0,'app':_0xee2f('0x5d'),'appdata':_0x58da0d[_0xee2f('0x5b')]+','+(_0x692686[_0xee2f('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0xee2f('0x5e')});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);})[_0xee2f('0x1e')](function(_0x4c3b2f){_0x58e361(_0x4c3b2f);})['catch'](function(_0x4051a7){_0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0x4051a7[_0xee2f('0x12')]));});});}; \ No newline at end of file +var _0x1a85=['getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','applications','orderBy','asc','autoclose','push','length','close','*,*,*,*','Contacts','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','Contact\x20not\x20found','update','attach','interaction','get','created','attachments','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','startRouting','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailAccount','findAll','options','where','attributes','map','include','model','GetMailAccount','ShowMailAccount','find','raw'];(function(_0x4d406c,_0x5e4805){var _0x521db0=function(_0x4250b0){while(--_0x4250b0){_0x4d406c['push'](_0x4d406c['shift']());}};_0x521db0(++_0x5e4805);}(_0x1a85,0x178));var _0x51a8=function(_0x1d5ce7,_0x213179){_0x1d5ce7=_0x1d5ce7-0x0;var _0x58141b=_0x1a85[_0x1d5ce7];return _0x58141b;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x51a8('0x0'));var rs=require(_0x51a8('0x1'));var Redis=require(_0x51a8('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x51a8('0x3'));var config=require(_0x51a8('0x4'));var jayson=require(_0x51a8('0x5'));var client=jayson['client'][_0x51a8('0x6')]({'port':0x232c});config['redis']=_[_0x51a8('0x7')](config['redis'],{'host':_0x51a8('0x8'),'port':0x18eb});var socket=require(_0x51a8('0x9'))(new Redis(config['redis']));require(_0x51a8('0xa'))['register'](socket);function respondWithRpcPromise(_0x56e1b4,_0x39e06a,_0x2f276b){return new BPromise(function(_0x1a476d,_0x45a3f4){return client[_0x51a8('0xb')](_0x56e1b4,_0x2f276b)[_0x51a8('0xc')](function(_0x3f93c7){logger[_0x51a8('0xd')](_0x51a8('0xe'),_0x39e06a,_0x51a8('0xf'));logger[_0x51a8('0x10')](_0x51a8('0x11'),_0x39e06a,_0x51a8('0xf'),JSON[_0x51a8('0x12')](_0x3f93c7));if(_0x3f93c7[_0x51a8('0x13')]){if(_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x14')]===0x1f4){logger['error'](_0x51a8('0xe'),_0x39e06a,_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x15')]);return _0x45a3f4(_0x3f93c7['error'][_0x51a8('0x15')]);}logger['error'](_0x51a8('0xe'),_0x39e06a,_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x15')]);return _0x1a476d(_0x3f93c7[_0x51a8('0x13')][_0x51a8('0x15')]);}else{logger[_0x51a8('0xd')](_0x51a8('0xe'),_0x39e06a,'request\x20sent');_0x1a476d(_0x3f93c7[_0x51a8('0x16')][_0x51a8('0x15')]);}})[_0x51a8('0x17')](function(_0x23539e){logger[_0x51a8('0x13')](_0x51a8('0xe'),_0x39e06a,_0x23539e);_0x45a3f4(_0x23539e);});});}exports['GetMailAccount']=function(_0x1df8c2){var _0x3b7e7e=this;return new Promise(function(_0x2217ce,_0x2f2681){return db[_0x51a8('0x18')][_0x51a8('0x19')]({'raw':_0x1df8c2[_0x51a8('0x1a')]?_0x1df8c2[_0x51a8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1df8c2[_0x51a8('0x1a')]?_0x1df8c2['options'][_0x51a8('0x1b')]||null:null,'attributes':_0x1df8c2[_0x51a8('0x1a')]?_0x1df8c2[_0x51a8('0x1a')][_0x51a8('0x1c')]||null:null,'limit':_0x1df8c2['options']?_0x1df8c2[_0x51a8('0x1a')]['limit']||null:null,'include':_0x1df8c2['options']?_0x1df8c2[_0x51a8('0x1a')]['include']?_[_0x51a8('0x1d')](_0x1df8c2[_0x51a8('0x1a')][_0x51a8('0x1e')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1f')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1f')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')],'include':_0x273ce2[_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x273ce2[_0x51a8('0x1e')],function(_0x1a886f){return{'model':db[_0x1a886f[_0x51a8('0x1f')]],'as':_0x1a886f['as'],'attributes':_0x1a886f[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0xc')](function(_0x20c6b5){logger[_0x51a8('0xd')]('GetMailAccount',_0x1df8c2);logger[_0x51a8('0x10')]('GetMailAccount',_0x1df8c2,JSON[_0x51a8('0x12')](_0x20c6b5));_0x2217ce(_0x20c6b5);})[_0x51a8('0x17')](function(_0x143f46){logger[_0x51a8('0x13')](_0x51a8('0x20'),_0x143f46['message'],_0x1df8c2);_0x2f2681(_0x3b7e7e[_0x51a8('0x13')](0x1f4,_0x143f46['message']));});});};exports[_0x51a8('0x21')]=function(_0x24b39a){var _0x253a59=this;return new Promise(function(_0x4b19c8,_0x2080a1){return db['MailAccount'][_0x51a8('0x22')]({'raw':_0x24b39a[_0x51a8('0x1a')]?_0x24b39a[_0x51a8('0x1a')][_0x51a8('0x23')]===undefined?!![]:![]:!![],'where':_0x24b39a[_0x51a8('0x1a')]?_0x24b39a['options'][_0x51a8('0x1b')]||null:null,'attributes':_0x24b39a['options']?_0x24b39a[_0x51a8('0x1a')][_0x51a8('0x1c')]||null:null,'include':_0x24b39a[_0x51a8('0x1a')]?_0x24b39a['options'][_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x24b39a[_0x51a8('0x1a')][_0x51a8('0x1e')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1d')](_0x41c020[_0x51a8('0x1e')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1f')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes'],'include':_0x4ec1db[_0x51a8('0x1e')]?_[_0x51a8('0x1d')](_0x4ec1db[_0x51a8('0x1e')],function(_0x1eef9d){return{'model':db[_0x1eef9d[_0x51a8('0x1f')]],'as':_0x1eef9d['as'],'attributes':_0x1eef9d[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5566){if(_0x24b39a[_0x51a8('0x1a')]['smtp']===!![])_0x4e5566['setDataValue']('smtpOptions',_0x4e5566[_0x51a8('0x24')]());logger[_0x51a8('0xd')](_0x51a8('0x21'),_0x24b39a);logger['debug'](_0x51a8('0x21'),_0x24b39a,JSON[_0x51a8('0x12')](_0x4e5566));_0x4b19c8(_0x4e5566);})[_0x51a8('0x17')](function(_0x310ad2){logger['error'](_0x51a8('0x21'),_0x310ad2[_0x51a8('0x15')],_0x24b39a);_0x2080a1(_0x253a59[_0x51a8('0x13')](0x1f4,_0x310ad2['message']));});});};exports[_0x51a8('0x25')]=function(_0x51d7bd){var _0x2032c0=this;return new Promise(function(_0x1e637a,_0x2a98bd){var _0x37d50b={'body':_0x51d7bd['body'],'channel':_0x51a8('0x26')};var _0x3da2cf=_[_0x51a8('0x27')](_[_0x51a8('0x28')](db[_0x51a8('0x29')][_0x51a8('0x2a')]),[_0x51a8('0x2b'),_0x51a8('0x2c'),_0x51a8('0x2d'),'ListId']);var _0x22e6e6=![];if(_0x51d7bd[_0x51a8('0x2e')]['id']){delete _0x51d7bd['body']['id'];}if(_['isNil'](_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2f')])){return _0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,_0x51a8('0x30')));}if(_[_0x51a8('0x31')](_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2e')])||_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2e')]===''){return _0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x51a8('0x31')](_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x32')])){return _0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,_0x51a8('0x33')+_0x3da2cf));}if(!_[_0x51a8('0x34')](_0x3da2cf,_0x51d7bd['body'][_0x51a8('0x32')])){return _0x2a98bd(_0x2032c0['error'](0x1f4,_0x51a8('0x35')+_0x3da2cf));}var _0x3a33f3={};_0x3a33f3[_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x32')]]=_0x51d7bd[_0x51a8('0x2e')]['from'];return db['MailAccount'][_0x51a8('0x22')]({'where':{'id':_0x51d7bd[_0x51a8('0x36')]['id']},'include':[{'model':db[_0x51a8('0x37')],'as':_0x51a8('0x38'),'include':[{'model':db[_0x51a8('0x29')],'as':'Contacts','where':_0x3a33f3,'limit':0x1,'order':[['updatedAt',_0x51a8('0x39')]]}]},{'model':db[_0x51a8('0x3a')],'as':_0x51a8('0x3b')},{'model':db[_0x51a8('0x3c')],'as':_0x51a8('0x3d'),'include':[{'model':db[_0x51a8('0x3e')],'as':_0x51a8('0x3e')}]}]})[_0x51a8('0xc')](function(_0x301578){if(_0x301578&&_0x301578['List']){var _0x5cb2cf=_0x301578['get']({'plain':!![]});_0x37d50b[_0x51a8('0x36')]=_[_0x51a8('0x3f')](_0x5cb2cf,[_0x51a8('0x3b'),'List']);_0x37d50b[_0x51a8('0x36')][_0x51a8('0x40')]=_0x301578['getSmtpOptions']();_0x37d50b[_0x51a8('0x41')]=_0x5cb2cf['Applications'];_0x37d50b['list']=_0x5cb2cf[_0x51a8('0x38')];_0x37d50b[_0x51a8('0x41')]=_[_0x51a8('0x42')](_0x37d50b['applications'],['priority'],[_0x51a8('0x43')]);if(_0x37d50b['account']&&_0x37d50b[_0x51a8('0x36')][_0x51a8('0x44')]){_0x37d50b[_0x51a8('0x41')][_0x51a8('0x45')]({'id':0x0,'priority':_0x37d50b[_0x51a8('0x41')][_0x51a8('0x46')]+0x1,'app':_0x51a8('0x47'),'appdata':_0x51a8('0x44'),'interval':_0x51a8('0x48')});}if(_0x37d50b['account'][_0x51a8('0x3b')]){delete _0x37d50b[_0x51a8('0x36')][_0x51a8('0x3b')];}if(_0x37d50b[_0x51a8('0x36')]['List']){delete _0x37d50b[_0x51a8('0x36')]['List'];}if(_0x5cb2cf[_0x51a8('0x38')][_0x51a8('0x49')]['length']){return _0x5cb2cf['List'][_0x51a8('0x49')][0x0];}var _0x16f124=_[_0x51a8('0x7')](_0x51d7bd[_0x51a8('0x2e')],{'firstName':_0x51d7bd[_0x51a8('0x2e')]['from'],'ListId':_0x5cb2cf[_0x51a8('0x4a')]});_0x16f124[_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x32')]]=_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2f')];return db['CmContact'][_0x51a8('0x4b')](_0x16f124);}else{throw new Error(_0x51a8('0x4c'));}})[_0x51a8('0xc')](function(_0x3e43cc){_0x37d50b[_0x51a8('0x4d')]=_0x3e43cc;if(_0x3e43cc){if(!_0x51d7bd[_0x51a8('0x2e')]['message']['messageId']){_0x51d7bd['body']['message'][_0x51a8('0x4e')]=rs[_0x51a8('0x4f')]()+'\x20'+_0x51d7bd['body'][_0x51a8('0x15')]['from'];}var _0x41cc00={'ContactId':_0x3e43cc['id'],'MailAccountId':_0x51d7bd['account']['id'],'inReplyTo':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['messageId'],'to':_0x51d7bd['body']['message'][_0x51a8('0x2f')],'cc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['cc'],'subject':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x50')],'attach':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['attach'],'lastMsgAt':moment()[_0x51a8('0x51')](_0x51a8('0x52')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x51a8('0x22')]({'where':{'closed':![],'MailAccountId':_0x51d7bd[_0x51a8('0x36')]['id']},'include':[{'model':db[_0x51a8('0x53')],'as':_0x51a8('0x54'),'attributes':[_0x51a8('0x4e')],'where':{'messageId':_0x51d7bd[_0x51a8('0x2e')]['message']['inReplyTo']}}]})[_0x51a8('0xc')](function(_0x53f25e){if(_0x53f25e){return[_0x53f25e,![]];}return db['MailInteraction']['create'](_0x41cc00)['then'](function(_0x483a5a){return[_0x483a5a,!![]];});});}else{throw new Error(_0x51a8('0x55'));}})['spread'](function(_0x1477af,_0x4772cd){if(_0x1477af){_0x22e6e6=_0x4772cd;if(!_0x4772cd){return _0x1477af[_0x51a8('0x56')]({'inReplyTo':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x4e')],'to':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x2f')],'cc':_0x51d7bd[_0x51a8('0x2e')]['message']['cc'],'subject':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x50')],'attach':_0x1477af['attach']?_0x1477af['attach']:_0x51d7bd['body'][_0x51a8('0x15')][_0x51a8('0x57')],'substatus':null,'substatusAt':moment()[_0x51a8('0x51')](_0x51a8('0x52')),'lastMsgAt':moment()[_0x51a8('0x51')](_0x51a8('0x52')),'lastMsgDirection':'in'});}else{return _0x1477af;}}})[_0x51a8('0xc')](function(_0x418445){_0x37d50b[_0x51a8('0x58')]=_0x418445[_0x51a8('0x59')]({'plain':!![]});_0x37d50b[_0x51a8('0x58')][_0x51a8('0x5a')]=_0x22e6e6;return db[_0x51a8('0x53')]['create']({'body':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x2e')],'MailAccountId':_0x51d7bd['account']['id'],'MailInteractionId':_0x418445['id'],'direction':'in','ContactId':_0x37d50b[_0x51a8('0x4d')]['id'],'messageId':_0x51d7bd['body']['message']['messageId'],'from':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x2f')],'to':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['to'],'cc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['cc'],'subject':_0x51d7bd['body']['message']['subject'],'attach':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x57')],'Attachments':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5b')],'originTo':_0x51d7bd['body'][_0x51a8('0x15')]['originTo'],'originCc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5c')],'bcc':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5d')],'ChatWebsiteId':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5e')]||null,'originChannel':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')]['originChannel']||'Email','ChatOfflineMessageId':_0x51d7bd[_0x51a8('0x2e')][_0x51a8('0x15')][_0x51a8('0x5f')]||null},{'include':[{'model':db[_0x51a8('0x60')],'as':'Attachments'}]});})[_0x51a8('0xc')](function(_0x4d418a){_0x37d50b[_0x51a8('0x15')]=_0x4d418a;if(_0x37d50b[_0x51a8('0x58')][_0x51a8('0x61')]){return db[_0x51a8('0x62')][_0x51a8('0x22')]({'attributes':['id',_0x51a8('0x63')],'where':{'id':_0x37d50b[_0x51a8('0x58')][_0x51a8('0x61')]}})[_0x51a8('0xc')](function(_0x53fc80){if(_0x53fc80){_0x37d50b[_0x51a8('0x41')][_0x51a8('0x64')]({'id':0x0,'priority':0x0,'app':_0x51a8('0x65'),'appdata':_0x53fc80[_0x51a8('0x63')]+','+(_0x37d50b['account']['waitForTheAssignedAgent']||0xa),'interval':_0x51a8('0x48')});}return respondWithRpcPromise('Start','startRouting',_0x37d50b);});}return respondWithRpcPromise('Start',_0x51a8('0x66'),_0x37d50b);})['then'](function(_0x5c7aca){_0x1e637a(_0x5c7aca);})[_0x51a8('0x17')](function(_0x23f82a){_0x2a98bd(_0x2032c0[_0x51a8('0x13')](0x1f4,_0x23f82a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 3427274..4912e27 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 _0x3f9b=['register','length','remove','removeListener'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x57e8f6,_0x4de286){_0x57e8f6=_0x57e8f6-0x0;var _0xa05a7d=_0x3f9b[_0x57e8f6];return _0xa05a7d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xb3f9('0x0'),'update'];function createListener(_0xa3095d,_0x43fc43){return function(_0x48838a){_0x43fc43['emit'](_0xa3095d,_0x48838a);};}function removeListener(_0x4970d5,_0x45e0d6){return function(){MailAccountEvents[_0xb3f9('0x1')](_0x4970d5,_0x45e0d6);};}exports[_0xb3f9('0x2')]=function(_0x57c82f){for(var _0x26b29c=0x0,_0x34d23e=events[_0xb3f9('0x3')];_0x26b29c<_0x34d23e;_0x26b29c++){var _0x390a03=events[_0x26b29c];var _0x16e819=createListener('mailAccount:'+_0x390a03,_0x57c82f);MailAccountEvents['on'](_0x390a03,_0x16e819);}}; \ No newline at end of file +var _0x790c=['register','length','./mailAccount.events','save','emit'];(function(_0x1ffe64,_0x44c809){var _0x3b0631=function(_0x503ee8){while(--_0x503ee8){_0x1ffe64['push'](_0x1ffe64['shift']());}};_0x3b0631(++_0x44c809);}(_0x790c,0x106));var _0xc790=function(_0x33afe7,_0x1d96a9){_0x33afe7=_0x33afe7-0x0;var _0x50ad5f=_0x790c[_0x33afe7];return _0x50ad5f;};'use strict';var MailAccountEvents=require(_0xc790('0x0'));var events=[_0xc790('0x1'),'remove','update'];function createListener(_0x5cefae,_0x171404){return function(_0x8c9c5a){_0x171404[_0xc790('0x2')](_0x5cefae,_0x8c9c5a);};}function removeListener(_0x7ef1f2,_0x10cad0){return function(){MailAccountEvents['removeListener'](_0x7ef1f2,_0x10cad0);};}exports[_0xc790('0x3')]=function(_0x3a42da){for(var _0x46a8b2=0x0,_0x530ec0=events[_0xc790('0x4')];_0x46a8b2<_0x530ec0;_0x46a8b2++){var _0x419d7d=events[_0x46a8b2];var _0x5d2734=createListener('mailAccount:'+_0x419d7d,_0x3a42da);MailAccountEvents['on'](_0x419d7d,_0x5d2734);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 0d5d134..38036f6 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 _0xb4ec=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete'];(function(_0x1bf33c,_0x349205){var _0x10feeb=function(_0xc10d2b){while(--_0xc10d2b){_0x1bf33c['push'](_0x1bf33c['shift']());}};_0x10feeb(++_0x349205);}(_0xb4ec,0x189));var _0xcb4e=function(_0x10feef,_0xe0352b){_0x10feef=_0x10feef-0x0;var _0x34afc0=_0xb4ec[_0x10feef];return _0x34afc0;};'use strict';var multer=require(_0xcb4e('0x0'));var util=require(_0xcb4e('0x1'));var path=require(_0xcb4e('0x2'));var timeout=require(_0xcb4e('0x3'));var express=require('express');var router=express[_0xcb4e('0x4')]();var fs_extra=require(_0xcb4e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb4e('0x6'));var config=require(_0xcb4e('0x7'));var controller=require(_0xcb4e('0x8'));router['get'](_0xcb4e('0x9'),auth[_0xcb4e('0xa')](),controller[_0xcb4e('0xb')]);router[_0xcb4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xcb4e('0xd')]);router[_0xcb4e('0xe')](_0xcb4e('0x9'),auth['isAuthenticated'](),controller[_0xcb4e('0xf')]);module[_0xcb4e('0x10')]=router; \ No newline at end of file +var _0x303a=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x303a,0x17e));var _0xa303=function(_0x458848,_0x2dcecd){_0x458848=_0x458848-0x0;var _0x20469e=_0x303a[_0x458848];return _0x20469e;};'use strict';var multer=require('multer');var util=require(_0xa303('0x0'));var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require('./mailApplication.controller');router['get'](_0xa303('0x8'),auth[_0xa303('0x9')](),controller['show']);router[_0xa303('0xa')]('/:id',auth[_0xa303('0x9')](),controller[_0xa303('0xb')]);router[_0xa303('0xc')]('/:id',auth[_0xa303('0x9')](),controller['destroy']);module[_0xa303('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 000000b..788d104 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 _0x6504=['*,*,*,*','sequelize','INTEGER','noop','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6504,0x10f));var _0x4650=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6504[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x4650('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4650('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4650('0x2')},'appdata':{'type':Sequelize[_0x4650('0x3')]()},'description':{'type':Sequelize[_0x4650('0x4')]},'interval':{'type':Sequelize[_0x4650('0x4')],'defaultValue':_0x4650('0x5')}}; \ No newline at end of file +var _0xd29c=['exports','noop','TEXT','STRING','sequelize'];(function(_0x19448a,_0x54a23a){var _0x5a0225=function(_0x224f1f){while(--_0x224f1f){_0x19448a['push'](_0x19448a['shift']());}};_0x5a0225(++_0x54a23a);}(_0xd29c,0x95));var _0xcd29=function(_0x31295e,_0x383ba3){_0x31295e=_0x31295e-0x0;var _0x53b458=_0xd29c[_0x31295e];return _0x53b458;};'use strict';var Sequelize=require(_0xcd29('0x0'));module[_0xcd29('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcd29('0x2')},'appdata':{'type':Sequelize[_0xcd29('0x3')]()},'description':{'type':Sequelize[_0xcd29('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index af147c7..e05702c 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 _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2d4f93,_0x2af13f){var _0x1da08b=function(_0x41a70c){while(--_0x41a70c){_0x2d4f93['push'](_0x2d4f93['shift']());}};_0x1da08b(++_0x2af13f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x2697b7,_0x266eaa){var _0x4e67a2=function(_0x23e8b1){while(--_0x23e8b1){_0x2697b7['push'](_0x2697b7['shift']());}};_0x4e67a2(++_0x266eaa);}(_0xac4a,0x13f));var _0xaac4=function(_0x2b8806,_0x3f0753){_0x2b8806=_0x2b8806-0x0;var _0x14de3a=_0xac4a[_0x2b8806];return _0x14de3a;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index f30fb48..f198347 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 _0x6aad=['rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path'];(function(_0x31a51b,_0x4775e8){var _0x38d5d8=function(_0x35b38b){while(--_0x35b38b){_0x31a51b['push'](_0x31a51b['shift']());}};_0x38d5d8(++_0x4775e8);}(_0x6aad,0x67));var _0xd6aa=function(_0x583a0b,_0x3c4d27){_0x583a0b=_0x583a0b-0x0;var _0x234c4a=_0x6aad[_0x583a0b];return _0x234c4a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd6aa('0x0'))(_0xd6aa('0x1'));var moment=require(_0xd6aa('0x2'));var BPromise=require('bluebird');var rp=require(_0xd6aa('0x3'));var fs=require('fs');var path=require(_0xd6aa('0x4'));var rimraf=require(_0xd6aa('0x5'));var config=require(_0xd6aa('0x6'));var attributes=require(_0xd6aa('0x7'));module[_0xd6aa('0x8')]=function(_0x39d926,_0xe4c58c){return _0x39d926['define']('MailApplication',attributes,{'tableName':_0xd6aa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd6aa('0xa'),'collate':_0xd6aa('0xb')});}; \ No newline at end of file +var _0x6e25=['MailApplication','utf8mb4','utf8mb4_unicode_ci','util','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','define'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x6e25,0xdf));var _0x56e2=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0x6e25[_0x186d17];return _0x5d4b89;};'use strict';var _=require('lodash');var util=require(_0x56e2('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x56e2('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56e2('0x2'));var rimraf=require(_0x56e2('0x3'));var config=require(_0x56e2('0x4'));var attributes=require(_0x56e2('0x5'));module['exports']=function(_0x299988,_0x19990a){return _0x299988[_0x56e2('0x6')](_0x56e2('0x7'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x56e2('0x8'),'collate':_0x56e2('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 5b8772d..1d1860d 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 _0xe59e=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','UpdateMailApplication','MailApplication','update','body','options','lodash','moment'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0xe59e,0x136));var _0xee59=function(_0xd57e5e,_0x514447){_0xd57e5e=_0xd57e5e-0x0;var _0x2f6d04=_0xe59e[_0xd57e5e];return _0x2f6d04;};'use strict';var _=require(_0xee59('0x0'));var util=require('util');var moment=require(_0xee59('0x1'));var BPromise=require(_0xee59('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee59('0x3'));var db=require(_0xee59('0x4'))['db'];var utils=require(_0xee59('0x5'));var logger=require(_0xee59('0x6'))(_0xee59('0x7'));var config=require(_0xee59('0x8'));var jayson=require(_0xee59('0x9'));var client=jayson['client'][_0xee59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f749c,_0x23ef86,_0xf7c994){return new BPromise(function(_0x5af312,_0x586290){return client['request'](_0x2f749c,_0xf7c994)[_0xee59('0xb')](function(_0x11b878){logger['info'](_0xee59('0xc'),_0x23ef86,'request\x20sent');logger[_0xee59('0xd')](_0xee59('0xe'),_0x23ef86,'request\x20sent',JSON[_0xee59('0xf')](_0x11b878));if(_0x11b878[_0xee59('0x10')]){if(_0x11b878[_0xee59('0x10')]['code']===0x1f4){logger[_0xee59('0x10')](_0xee59('0xc'),_0x23ef86,_0x11b878[_0xee59('0x10')][_0xee59('0x11')]);return _0x586290(_0x11b878[_0xee59('0x10')]['message']);}logger[_0xee59('0x10')](_0xee59('0xc'),_0x23ef86,_0x11b878['error'][_0xee59('0x11')]);return _0x5af312(_0x11b878[_0xee59('0x10')][_0xee59('0x11')]);}else{logger[_0xee59('0x12')](_0xee59('0xc'),_0x23ef86,_0xee59('0x13'));_0x5af312(_0x11b878['result'][_0xee59('0x11')]);}})[_0xee59('0x14')](function(_0x44fcb3){logger['error'](_0xee59('0xc'),_0x23ef86,_0x44fcb3);_0x586290(_0x44fcb3);});});}exports[_0xee59('0x15')]=function(_0x495a4f){var _0x422dfd=this;return new Promise(function(_0x176fb5,_0x2343f8){return db[_0xee59('0x16')][_0xee59('0x17')](_0x495a4f[_0xee59('0x18')],{'raw':_0x495a4f['options']?_0x495a4f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495a4f['options']?_0x495a4f[_0xee59('0x19')]['where']||null:null,'attributes':_0x495a4f[_0xee59('0x19')]?_0x495a4f[_0xee59('0x19')]['attributes']||null:null,'limit':_0x495a4f[_0xee59('0x19')]?_0x495a4f[_0xee59('0x19')]['limit']||null:null})[_0xee59('0xb')](function(_0x15c2ca){logger[_0xee59('0x12')](_0xee59('0x15'),_0x495a4f);logger[_0xee59('0xd')](_0xee59('0x15'),_0x495a4f,JSON[_0xee59('0xf')](_0x15c2ca));_0x176fb5(_0x15c2ca);})['catch'](function(_0x1f8bcb){logger['error']('UpdateMailApplication',_0x1f8bcb[_0xee59('0x11')],_0x495a4f);_0x2343f8(_0x422dfd['error'](0x1f4,_0x1f8bcb['message']));});});}; \ No newline at end of file +var _0xa410=['catch','UpdateMailApplication','MailApplication','update','options','raw','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4e6e99,_0x1b394f){var _0x1607d9=function(_0x185829){while(--_0x185829){_0x4e6e99['push'](_0x4e6e99['shift']());}};_0x1607d9(++_0x1b394f);}(_0xa410,0x1e7));var _0x0a41=function(_0x5c641d,_0x36410c){_0x5c641d=_0x5c641d-0x0;var _0x58425f=_0xa410[_0x5c641d];return _0x58425f;};'use strict';var _=require(_0x0a41('0x0'));var util=require(_0x0a41('0x1'));var moment=require(_0x0a41('0x2'));var BPromise=require(_0x0a41('0x3'));var rs=require(_0x0a41('0x4'));var fs=require('fs');var Redis=require(_0x0a41('0x5'));var db=require(_0x0a41('0x6'))['db'];var utils=require(_0x0a41('0x7'));var logger=require(_0x0a41('0x8'))(_0x0a41('0x9'));var config=require('../../config/environment');var jayson=require(_0x0a41('0xa'));var client=jayson[_0x0a41('0xb')][_0x0a41('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x149613,_0xeb8c46,_0x759f14){return new BPromise(function(_0x45be36,_0xd89de2){return client[_0x0a41('0xd')](_0x149613,_0x759f14)[_0x0a41('0xe')](function(_0x269dc9){logger['info'](_0x0a41('0xf'),_0xeb8c46,_0x0a41('0x10'));logger[_0x0a41('0x11')](_0x0a41('0x12'),_0xeb8c46,_0x0a41('0x10'),JSON[_0x0a41('0x13')](_0x269dc9));if(_0x269dc9['error']){if(_0x269dc9[_0x0a41('0x14')][_0x0a41('0x15')]===0x1f4){logger[_0x0a41('0x14')](_0x0a41('0xf'),_0xeb8c46,_0x269dc9[_0x0a41('0x14')][_0x0a41('0x16')]);return _0xd89de2(_0x269dc9['error'][_0x0a41('0x16')]);}logger[_0x0a41('0x14')](_0x0a41('0xf'),_0xeb8c46,_0x269dc9['error'][_0x0a41('0x16')]);return _0x45be36(_0x269dc9[_0x0a41('0x14')][_0x0a41('0x16')]);}else{logger[_0x0a41('0x17')](_0x0a41('0xf'),_0xeb8c46,'request\x20sent');_0x45be36(_0x269dc9[_0x0a41('0x18')][_0x0a41('0x16')]);}})[_0x0a41('0x19')](function(_0x3c5ade){logger[_0x0a41('0x14')]('MailApplication,\x20%s,\x20%s',_0xeb8c46,_0x3c5ade);_0xd89de2(_0x3c5ade);});});}exports[_0x0a41('0x1a')]=function(_0x2b163e){var _0x47fb65=this;return new Promise(function(_0x1c4223,_0x3c78cf){return db[_0x0a41('0x1b')][_0x0a41('0x1c')](_0x2b163e['body'],{'raw':_0x2b163e[_0x0a41('0x1d')]?_0x2b163e[_0x0a41('0x1d')][_0x0a41('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b163e[_0x0a41('0x1d')]?_0x2b163e[_0x0a41('0x1d')]['where']||null:null,'attributes':_0x2b163e[_0x0a41('0x1d')]?_0x2b163e[_0x0a41('0x1d')][_0x0a41('0x1f')]||null:null,'limit':_0x2b163e[_0x0a41('0x1d')]?_0x2b163e['options']['limit']||null:null})[_0x0a41('0xe')](function(_0x237c93){logger['info']('UpdateMailApplication',_0x2b163e);logger['debug']('UpdateMailApplication',_0x2b163e,JSON[_0x0a41('0x13')](_0x237c93));_0x1c4223(_0x237c93);})[_0x0a41('0x19')](function(_0x359edf){logger[_0x0a41('0x14')](_0x0a41('0x1a'),_0x359edf[_0x0a41('0x16')],_0x2b163e);_0x3c78cf(_0x47fb65[_0x0a41('0x14')](0x1f4,_0x359edf['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 9c715c1..4ae910b 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 _0x0886=['mailinteraction:destroy','destroy','removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x0886,0x95));var _0x6088=function(_0x3fbb7a,_0x32cdc2){_0x3fbb7a=_0x3fbb7a-0x0;var _0x3b96f4=_0x0886[_0x3fbb7a];return _0x3b96f4;};'use strict';var express=require(_0x6088('0x0'));var router=express['Router']();var auth=require(_0x6088('0x1'));var interaction=require(_0x6088('0x2'));var controller=require(_0x6088('0x3'));router[_0x6088('0x4')]('/',auth[_0x6088('0x5')](),controller[_0x6088('0x6')]);router[_0x6088('0x4')](_0x6088('0x7'),auth['isAuthenticated'](),controller[_0x6088('0x8')]);router[_0x6088('0x4')](_0x6088('0x9'),auth[_0x6088('0x5')](),controller[_0x6088('0xa')]);router[_0x6088('0x4')](_0x6088('0xb'),auth[_0x6088('0x5')](),controller[_0x6088('0xc')]);router[_0x6088('0x4')](_0x6088('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x6088('0xe')]('/',auth['isAuthenticated'](),controller[_0x6088('0xf')]);router[_0x6088('0xe')](_0x6088('0xb'),auth[_0x6088('0x5')](),controller['addMessage']);router[_0x6088('0xe')](_0x6088('0x10'),auth[_0x6088('0x5')](),interaction['tracked'](_0x6088('0x11'),_0x6088('0x12')),controller[_0x6088('0x13')]);router[_0x6088('0x14')](_0x6088('0x9'),auth[_0x6088('0x5')](),interaction[_0x6088('0x15')]('mail',_0x6088('0x16')),controller[_0x6088('0x17')]);router[_0x6088('0x18')](_0x6088('0x9'),auth['isAuthenticated'](),interaction[_0x6088('0x15')](_0x6088('0x11'),_0x6088('0x19')),controller[_0x6088('0x1a')]);router['delete'](_0x6088('0x10'),auth['isAuthenticated'](),controller[_0x6088('0x1b')]);module[_0x6088('0x1c')]=router; \ No newline at end of file +var _0x251f=['post','create','/:id/messages','/:id/tags','mailinteraction:addtags','addTags','put','tracked','mail','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','/:id/download','download'];(function(_0x11fd4e,_0x1a32ec){var _0x324371=function(_0x3f90a1){while(--_0x3f90a1){_0x11fd4e['push'](_0x11fd4e['shift']());}};_0x324371(++_0x1a32ec);}(_0x251f,0x10a));var _0xf251=function(_0xa2b098,_0x461a08){_0xa2b098=_0xa2b098-0x0;var _0x29502e=_0x251f[_0xa2b098];return _0x29502e;};'use strict';var express=require(_0xf251('0x0'));var router=express[_0xf251('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xf251('0x2'));var controller=require(_0xf251('0x3'));router['get']('/',auth[_0xf251('0x4')](),controller[_0xf251('0x5')]);router[_0xf251('0x6')](_0xf251('0x7'),auth[_0xf251('0x4')](),controller[_0xf251('0x8')]);router['get'](_0xf251('0x9'),auth['isAuthenticated'](),controller[_0xf251('0xa')]);router[_0xf251('0x6')]('/:id/messages',auth[_0xf251('0x4')](),controller[_0xf251('0xb')]);router[_0xf251('0x6')](_0xf251('0xc'),auth[_0xf251('0x4')](),controller[_0xf251('0xd')]);router[_0xf251('0xe')]('/',auth[_0xf251('0x4')](),controller[_0xf251('0xf')]);router[_0xf251('0xe')](_0xf251('0x10'),auth[_0xf251('0x4')](),controller['addMessage']);router['post'](_0xf251('0x11'),auth[_0xf251('0x4')](),interaction['tracked']('mail',_0xf251('0x12')),controller[_0xf251('0x13')]);router[_0xf251('0x14')](_0xf251('0x9'),auth['isAuthenticated'](),interaction[_0xf251('0x15')](_0xf251('0x16'),'mailinteraction:update'),controller[_0xf251('0x17')]);router['delete'](_0xf251('0x9'),auth['isAuthenticated'](),interaction[_0xf251('0x15')]('mail',_0xf251('0x18')),controller[_0xf251('0x19')]);router[_0xf251('0x1a')]('/:id/tags',auth[_0xf251('0x4')](),controller[_0xf251('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 0b74571..182a371 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 _0x59b7=['iconv','exports','BOOLEAN','DATE','STRING','long','ENUM','out','sequelize'];(function(_0xa8e599,_0x1b8386){var _0x2f2dd7=function(_0x2b7e51){while(--_0x2b7e51){_0xa8e599['push'](_0xa8e599['shift']());}};_0x2f2dd7(++_0x1b8386);}(_0x59b7,0xc5));var _0x759b=function(_0x49a3f6,_0x48dd4d){_0x49a3f6=_0x49a3f6-0x0;var _0x49a006=_0x59b7[_0x49a3f6];return _0x49a006;};'use strict';var Sequelize=require(_0x759b('0x0'));var iconv=require(_0x759b('0x1'));module[_0x759b('0x2')]={'closed':{'type':Sequelize[_0x759b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x759b('0x4')]},'disposition':{'type':Sequelize[_0x759b('0x5')]},'secondDisposition':{'type':Sequelize[_0x759b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x759b('0x5')]},'note':{'type':Sequelize[_0x759b('0x5')]},'inReplyTo':{'type':Sequelize[_0x759b('0x5')](0x1fe)},'to':{'type':Sequelize[_0x759b('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x759b('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x759b('0x4')]},'substatus':{'type':Sequelize[_0x759b('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x759b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x759b('0x7')]('in',_0x759b('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9614=['iconv','BOOLEAN','DATE','STRING','TEXT','long','ENUM','sequelize'];(function(_0x243304,_0x2d598e){var _0x2a8d68=function(_0x4ccea5){while(--_0x4ccea5){_0x243304['push'](_0x243304['shift']());}};_0x2a8d68(++_0x2d598e);}(_0x9614,0x167));var _0x4961=function(_0x256db8,_0x248342){_0x256db8=_0x256db8-0x0;var _0x25b73a=_0x9614[_0x256db8];return _0x25b73a;};'use strict';var Sequelize=require(_0x4961('0x0'));var iconv=require(_0x4961('0x1'));module['exports']={'closed':{'type':Sequelize[_0x4961('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4961('0x3')]},'disposition':{'type':Sequelize[_0x4961('0x4')]},'secondDisposition':{'type':Sequelize[_0x4961('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4961('0x4')]},'inReplyTo':{'type':Sequelize[_0x4961('0x4')](0x1fe)},'to':{'type':Sequelize[_0x4961('0x4')]},'cc':{'type':Sequelize[_0x4961('0x5')](_0x4961('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x4961('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4961('0x3')]},'substatus':{'type':Sequelize[_0x4961('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x4961('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4961('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4961('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 3144a52..b1dcb85 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 _0x217a=['readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','key','mail','query','user','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','catch','create','body','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','where','pick','MailInteractionId','filter','$gte','split','format','MailMessage','findAll','inlineCss','true','rows','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','createdAt','missing.recipient@your.company.com','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','Attachments','basename','existsSync'];(function(_0x521655,_0x23d7e9){var _0x1439d8=function(_0x356da1){while(--_0x356da1){_0x521655['push'](_0x521655['shift']());}};_0x1439d8(++_0x23d7e9);}(_0x217a,0x77));var _0xa217=function(_0x544e5f,_0x11bfde){_0x544e5f=_0x544e5f-0x0;var _0x5e3fec=_0x217a[_0x544e5f];return _0x5e3fec;};'use strict';var emlformat=require(_0xa217('0x0'));var rimraf=require(_0xa217('0x1'));var zipdir=require(_0xa217('0x2'));var moment=require(_0xa217('0x3'));var BPromise=require('bluebird');var util=require(_0xa217('0x4'));var path=require(_0xa217('0x5'));var fs=require('fs');var _=require(_0xa217('0x6'));var juice=require(_0xa217('0x7'));var Redis=require(_0xa217('0x8'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0xa217('0x9'))(_0xa217('0xa'));var config=require(_0xa217('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xa217('0xc'));config[_0xa217('0xd')]=_[_0xa217('0xe')](config[_0xa217('0xd')],{'host':_0xa217('0xf'),'port':0x18eb});var socket=require(_0xa217('0x10'))(new Redis(config[_0xa217('0xd')]));require(_0xa217('0x11'))['register'](socket);function respondWithStatusCode(_0x613bb5,_0x4d40f9){_0x4d40f9=_0x4d40f9||0xcc;return function(_0x55f3c7){if(_0x55f3c7){return _0x613bb5['sendStatus'](_0x4d40f9);}return _0x613bb5[_0xa217('0x12')](_0x4d40f9)[_0xa217('0x13')]();};}function respondWithResult(_0x24f431,_0x23f849){_0x23f849=_0x23f849||0xc8;return function(_0x3c909a){if(_0x3c909a){return _0x24f431[_0xa217('0x12')](_0x23f849)['json'](_0x3c909a);}};}function respondWithFilteredResult(_0x3e8090,_0x28d384){return function(_0x2d3696){if(_0x2d3696){var _0x28351a=typeof _0x28d384[_0xa217('0x14')]===_0xa217('0x15')&&typeof _0x28d384[_0xa217('0x16')]===_0xa217('0x15');var _0xfbc7b6=_0x2d3696[_0xa217('0x17')];var _0x1617b5=_0x28351a?0x0:_0x28d384[_0xa217('0x14')];var _0xe5523a=_0x28351a?_0x2d3696['count']:_0x28d384['offset']+_0x28d384[_0xa217('0x16')];var _0x57d4d3;if(_0xe5523a>=_0xfbc7b6){_0xe5523a=_0xfbc7b6;_0x57d4d3=0xc8;}else{_0x57d4d3=0xce;}_0x3e8090['status'](_0x57d4d3);return _0x3e8090[_0xa217('0x18')](_0xa217('0x19'),_0x1617b5+'-'+_0xe5523a+'/'+_0xfbc7b6)[_0xa217('0x1a')](_0x2d3696);}return null;};}function saveUpdates(_0x5e12e5){return function(_0x44e5bc){if(_0x44e5bc){return _0x44e5bc[_0xa217('0x1b')](_0x5e12e5)[_0xa217('0x1c')](function(_0x15b7d5){return _0x15b7d5;});}return null;};}function removeEntity(_0x225ee2){return function(_0x447d3f){if(_0x447d3f){return _0x447d3f[_0xa217('0x1d')]()[_0xa217('0x1c')](function(){_0x225ee2[_0xa217('0x12')](0xcc)[_0xa217('0x13')]();});}};}function handleEntityNotFound(_0x32b291){return function(_0x558d52){if(!_0x558d52){_0x32b291[_0xa217('0x1e')](0x194);}return _0x558d52;};}function handleError(_0x45826d,_0x59807e){_0x59807e=_0x59807e||0x1f4;return function(_0x5baf05){logger[_0xa217('0x1f')](_0x5baf05[_0xa217('0x20')]);if(_0x5baf05[_0xa217('0x21')]){delete _0x5baf05[_0xa217('0x21')];}_0x45826d[_0xa217('0x12')](_0x59807e)[_0xa217('0x22')](_0x5baf05);};}exports[_0xa217('0x23')]=function(_0x17b221,_0x8336e1){var _0x4cae89={};var _0x274c56=_[_0xa217('0x24')](db[_0xa217('0x25')][_0xa217('0x26')],function(_0x3c259f){return{'name':_0x3c259f[_0xa217('0x27')],'type':_0x3c259f['type'][_0xa217('0x28')]};});_0x4cae89=qs['getOptions'](_0x274c56,_0x17b221);return interaction['findAll'](_0xa217('0x29'),_0x17b221[_0xa217('0x2a')],_0x17b221[_0xa217('0x2b')],_0x4cae89,_0x274c56)[_0xa217('0x1c')](respondWithFilteredResult(_0x8336e1,_0x4cae89))['catch'](handleError(_0x8336e1,null));};exports['show']=function(_0x34d6d5,_0x219b0b){var _0x11dc6d={'raw':![],'where':{'id':_0x34d6d5[_0xa217('0x2c')]['id']}},_0x3449e6={};_0x3449e6[_0xa217('0x2d')]=_[_0xa217('0x2e')](db[_0xa217('0x25')][_0xa217('0x26')]);_0x3449e6[_0xa217('0x2a')]=_[_0xa217('0x2e')](_0x34d6d5[_0xa217('0x2a')]);_0x3449e6[_0xa217('0x2f')]=_[_0xa217('0x30')](_0x3449e6['model'],_0x3449e6[_0xa217('0x2a')]);_0x11dc6d[_0xa217('0x31')]=_[_0xa217('0x30')](_0x3449e6[_0xa217('0x2d')],qs[_0xa217('0x32')](_0x34d6d5[_0xa217('0x2a')]['fields']));_0x11dc6d[_0xa217('0x31')]=_0x11dc6d[_0xa217('0x31')][_0xa217('0x33')]?_0x11dc6d[_0xa217('0x31')]:_0x3449e6[_0xa217('0x2d')];if(_0x34d6d5[_0xa217('0x2a')]['includeAll']){_0x11dc6d[_0xa217('0x34')]=[{'all':!![]}];}_0x11dc6d=_[_0xa217('0x35')]({},_0x11dc6d,_0x34d6d5[_0xa217('0x36')]);return db[_0xa217('0x25')][_0xa217('0x37')](_0x11dc6d)['then'](handleEntityNotFound(_0x219b0b,null))['then'](respondWithResult(_0x219b0b,null))[_0xa217('0x38')](handleError(_0x219b0b,null));};exports[_0xa217('0x39')]=function(_0x2a8ef0,_0x30fd6a){return db[_0xa217('0x25')]['create'](_0x2a8ef0[_0xa217('0x3a')],{})[_0xa217('0x1c')](respondWithResult(_0x30fd6a,0xc9))['catch'](handleError(_0x30fd6a,null));};exports[_0xa217('0x1b')]=function(_0x5b388e,_0x187f53){if(_0x5b388e[_0xa217('0x3a')]['id']){delete _0x5b388e['body']['id'];}return db[_0xa217('0x25')][_0xa217('0x37')]({'where':{'id':_0x5b388e[_0xa217('0x2c')]['id']}})['then'](handleEntityNotFound(_0x187f53,null))[_0xa217('0x1c')](saveUpdates(_0x5b388e['body'],null))[_0xa217('0x1c')](respondWithResult(_0x187f53,null))['catch'](handleError(_0x187f53,null));};exports['destroy']=function(_0x448f49,_0x48aec4){return db[_0xa217('0x25')][_0xa217('0x37')]({'where':{'id':_0x448f49[_0xa217('0x2c')]['id']}})[_0xa217('0x1c')](handleEntityNotFound(_0x48aec4,null))['then'](removeEntity(_0x48aec4,null))['catch'](handleError(_0x48aec4,null));};exports[_0xa217('0x3b')]=function(_0x39932d,_0x3ace93){return db[_0xa217('0x25')]['describe']()[_0xa217('0x1c')](respondWithResult(_0x3ace93,null))[_0xa217('0x38')](handleError(_0x3ace93,null));};exports[_0xa217('0x3c')]=function(_0x498a32,_0x18dfd4){return db['MailMessage'][_0xa217('0x37')]({'where':{'id':_0x498a32[_0xa217('0x2c')]['id']}})['then'](handleEntityNotFound(_0x18dfd4,null))[_0xa217('0x1c')](function(_0x5c28df){if(_0x5c28df){return _0x5c28df['addMessage'](_0x498a32[_0xa217('0x3a')][_0xa217('0x3d')],_[_0xa217('0x3e')](_0x498a32[_0xa217('0x3a')],[_0xa217('0x3d'),'id'])||{});}})[_0xa217('0x1c')](respondWithResult(_0x18dfd4,null))['catch'](handleError(_0x18dfd4,null));};exports[_0xa217('0x3f')]=function(_0x104847,_0x4df712){var _0x5e77a7={'raw':![],'where':{}};var _0x1a548c={};var _0x27ce62={'count':0x0,'rows':[]};return db[_0xa217('0x25')][_0xa217('0x40')]({'where':{'id':_0x104847[_0xa217('0x2c')]['id']}})[_0xa217('0x1c')](handleEntityNotFound(_0x4df712,null))[_0xa217('0x1c')](function(_0x399c02){if(_0x399c02){_0x1a548c[_0xa217('0x2d')]=_['keys'](db['MailMessage'][_0xa217('0x26')]);_0x1a548c['query']=_[_0xa217('0x2e')](_0x104847[_0xa217('0x2a')]);_0x1a548c['filters']=_[_0xa217('0x30')](_0x1a548c[_0xa217('0x2d')],_0x1a548c[_0xa217('0x2a')]);_0x5e77a7['attributes']=_[_0xa217('0x30')](_0x1a548c[_0xa217('0x2d')],qs['fields'](_0x104847['query']['fields']));_0x5e77a7[_0xa217('0x31')]=_0x5e77a7[_0xa217('0x31')][_0xa217('0x33')]?_0x5e77a7['attributes']:_0x1a548c['model'];if(!_0x104847[_0xa217('0x2a')][_0xa217('0x41')](_0xa217('0x42'))){_0x5e77a7[_0xa217('0x16')]=qs['limit'](_0x104847[_0xa217('0x2a')]['limit']);_0x5e77a7[_0xa217('0x14')]=qs[_0xa217('0x14')](_0x104847[_0xa217('0x2a')][_0xa217('0x14')]);}_0x5e77a7[_0xa217('0x43')]=qs['sort'](_0x104847['query']['sort']);_0x5e77a7[_0xa217('0x44')]=qs[_0xa217('0x2f')](_[_0xa217('0x45')](_0x104847['query'],_0x1a548c[_0xa217('0x2f')]));_0x5e77a7[_0xa217('0x44')][_0xa217('0x46')]=_0x399c02['id'];if(_0x104847[_0xa217('0x2a')][_0xa217('0x47')]){_0x5e77a7[_0xa217('0x44')]=_['merge'](_0x5e77a7['where'],{'$or':_[_0xa217('0x24')](_0x5e77a7[_0xa217('0x31')],function(_0x81bf15){var _0x43642b={};_0x43642b[_0x81bf15]={'$like':'%'+_0x104847[_0xa217('0x2a')][_0xa217('0x47')]+'%'};return _0x43642b;})});}if(_0x104847[_0xa217('0x2a')][_0xa217('0x48')]){var _0x34b0cd=_0x104847[_0xa217('0x2a')][_0xa217('0x48')][_0xa217('0x49')](',');var _0x20eee2={};_0x20eee2[_0x34b0cd[0x0]]={'$gte':moment(_0x34b0cd[0x1])[_0xa217('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5e77a7['where']=_[_0xa217('0x35')](_0x5e77a7[_0xa217('0x44')],_0x20eee2);}_0x5e77a7=_[_0xa217('0x35')]({},_0x5e77a7,_0x104847[_0xa217('0x36')]);return db['MailMessage']['count']({'where':_0x5e77a7['where']})[_0xa217('0x1c')](function(_0x4d23a7){_0x27ce62[_0xa217('0x17')]=_0x4d23a7;if(_0x104847[_0xa217('0x2a')]['includeAll']){_0x5e77a7['include']=[{'all':!![]}];}return db[_0xa217('0x4b')][_0xa217('0x4c')](_0x5e77a7);})['then'](function(_0x17a068){if(_0x104847[_0xa217('0x2a')][_0xa217('0x4d')]===_0xa217('0x4e')){for(var _0x1d7921=0x0;_0x1d7921<_0x17a068[_0xa217('0x33')];_0x1d7921++){_0x17a068[_0x1d7921][_0xa217('0x3a')]=juice(_0x17a068[_0x1d7921][_0xa217('0x3a')]);}}_0x27ce62[_0xa217('0x4f')]=_0x17a068;return _0x27ce62;});}})['then'](respondWithFilteredResult(_0x4df712,_0x5e77a7))[_0xa217('0x38')](handleError(_0x4df712,null));};exports['addTags']=function(_0x168e9a,_0x212138){return db['MailInteraction']['find']({'where':{'id':_0x168e9a['params']['id']}})[_0xa217('0x1c')](handleEntityNotFound(_0x212138,null))['then'](function(_0x2a00b5){if(_0x2a00b5){return _0x2a00b5[_0xa217('0x50')](_0x168e9a[_0xa217('0x3a')][_0xa217('0x3d')],_[_0xa217('0x3e')](_0x168e9a[_0xa217('0x3a')],[_0xa217('0x3d'),'id'])||{})[_0xa217('0x51')](function(){return db[_0xa217('0x52')]['findAll']({'attributes':['id',_0xa217('0x21'),_0xa217('0x53')],'where':{'id':_0x168e9a['body'][_0xa217('0x3d')]}});})['then'](function(_0x1e1a0b){socket[_0xa217('0x54')](_0xa217('0x55'),{'id':Number(_0x168e9a[_0xa217('0x2c')]['id']),'tags':_0x1e1a0b||[]});return{'id':Number(_0x168e9a[_0xa217('0x2c')]['id']),'tags':_0x1e1a0b||[]};});}})[_0xa217('0x1c')](respondWithResult(_0x212138,null))[_0xa217('0x38')](handleError(_0x212138,null));};exports[_0xa217('0x56')]=function(_0x43fa24,_0x378eee){return db['MailInteraction'][_0xa217('0x37')]({'where':{'id':_0x43fa24[_0xa217('0x2c')]['id']}})[_0xa217('0x1c')](handleEntityNotFound(_0x378eee,null))['then'](function(_0x34a42){if(_0x34a42){return _0x34a42[_0xa217('0x56')](_0x43fa24[_0xa217('0x2a')][_0xa217('0x3d')]);}})['then'](respondWithStatusCode(_0x378eee,null))[_0xa217('0x38')](handleError(_0x378eee,null));};exports[_0xa217('0x57')]=function(_0x5d2010,_0x5b5c02){var _0x5e7ed1=moment()[_0xa217('0x58')]()['toString']();var _0x46e730=path[_0xa217('0x59')](config[_0xa217('0x5a')],_0xa217('0x5b'),_0xa217('0x5c'),_0xa217('0x5d'));var _0xe1c41b=path['join'](config[_0xa217('0x5a')],_0xa217('0x5b'),_0xa217('0x5c'),_0xa217('0x5e'));var _0x311802=path['join'](_0x46e730,_0x5e7ed1);var _0x588e02=util[_0xa217('0x4a')](_0xa217('0x5f'),_0x5d2010['params']['id'],_0x5e7ed1);var _0x31fd0f=path['join'](_0x46e730,_0x588e02);var _0x223dc1=[];if(_0x5d2010[_0xa217('0x2a')][_0xa217('0x5e')]){_0x223dc1[_0xa217('0x60')]({'model':db[_0xa217('0x61')],'as':'Attachments','raw':!![]});}var _0x3f04a7=[{'model':db[_0xa217('0x4b')],'as':_0xa217('0x62'),'attributes':['id',_0xa217('0x3a'),_0xa217('0x63'),'to','cc',_0xa217('0x64'),'subject',_0xa217('0x65')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x223dc1}];return db['MailInteraction'][_0xa217('0x37')]({'where':{'id':_0x5d2010['params']['id']},'include':_0x3f04a7})[_0xa217('0x1c')](handleEntityNotFound(_0x5b5c02,null))[_0xa217('0x1c')](function(_0x353d19){if(_0x353d19&&_0x353d19[_0xa217('0x62')]){var _0x25d2f8=_0x353d19['get']({'plain':!![]});fs['mkdirSync'](_0x311802);return BPromise['each'](_0x25d2f8[_0xa217('0x62')],function(_0x562d7c,_0x481e82){var _0x53bd68={'from':_0x562d7c[_0xa217('0x63')],'to':_0x562d7c['to']||_0xa217('0x66'),'subject':_0x562d7c[_0xa217('0x67')],'html':htmlEntities['decode'](_0x562d7c[_0xa217('0x3a')]),'headers':{'Date':moment(_0x562d7c[_0xa217('0x65')])[_0xa217('0x4a')](_0xa217('0x68'))},'attachments':[]};if(_0x562d7c['cc']){_0x53bd68['headers']['Cc']=_0x562d7c['cc'];}if(_0x562d7c[_0xa217('0x64')]){_0x53bd68['headers'][_0xa217('0x69')]=_0x562d7c[_0xa217('0x64')];}return new BPromise(function(_0xc0f6c7,_0x33b92d){if(_0x562d7c['Attachments']){for(var _0x2c45d9=0x0;_0x2c45d9<_0x562d7c[_0xa217('0x6a')][_0xa217('0x33')];_0x2c45d9++){var _0x2aead3=_0x562d7c['Attachments'][_0x2c45d9];var _0x3171a6=path[_0xa217('0x59')](_0xe1c41b,_0x2aead3[_0xa217('0x6b')]);if(fs[_0xa217('0x6c')](_0x3171a6)){_0x53bd68[_0xa217('0x5e')]['push']({'name':_0x2aead3[_0xa217('0x21')],'contentType':_0x2aead3['type'],'data':fs[_0xa217('0x6d')](_0x3171a6)});}}}emlformat[_0xa217('0x6e')](_0x53bd68,function(_0x404635,_0x156533){if(_0x404635)return _0x33b92d(_0x404635);fs[_0xa217('0x6f')](path[_0xa217('0x59')](_0x311802,util[_0xa217('0x4a')](_0xa217('0x70'),_0x481e82)),_0x156533);return _0xc0f6c7(_0x156533);});});})[_0xa217('0x1c')](function(){return new BPromise(function(_0x274b35,_0x3795da){zipdir(_0x311802,{'saveTo':_0x31fd0f},function(_0x5806c8,_0x2f122c){if(_0x5806c8)return _0x3795da(_0x5806c8);return _0x274b35(_0x2f122c);});})['then'](function(){return new BPromise(function(_0x384a39,_0x424bbb){rimraf(_0x311802,function(_0x321801){if(_0x321801)_0x424bbb(_0x321801);return _0x384a39();});});})[_0xa217('0x1c')](function(){return _0x5b5c02[_0xa217('0x57')](_0x31fd0f,_0x588e02,function(_0x3b487c){if(!_0x3b487c)fs[_0xa217('0x71')](_0x31fd0f);});});});}else{return _0x5b5c02[_0xa217('0x1e')](0xc8);}})[_0xa217('0x38')](handleError(_0x5b5c02,null));}; \ No newline at end of file +var _0x7770=['util','path','ioredis','../../components/interaction/service','api','../../config/environment','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','undefined','limit','offset','status','Content-Range','json','then','error','stack','send','index','map','MailInteraction','rawAttributes','key','getOptions','findAll','mail','query','user','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','catch','destroy','addMessage','ids','omit','findOne','MailMessage','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','true','rows','Tag','name','removeTags','download','unix','toString','join','root','tmp','server','files','transcript-%d-%s.zip','attachments','push','Attachment','Attachments','Messages','bcc','createdAt','each','missing.recipient@your.company.com','subject','decode','headers','basename','existsSync','readFileSync','build','message%d.eml','eml-format','rimraf','bluebird'];(function(_0x49676f,_0x164895){var _0x1d3d7a=function(_0x540bff){while(--_0x540bff){_0x49676f['push'](_0x49676f['shift']());}};_0x1d3d7a(++_0x164895);}(_0x7770,0xcd));var _0x0777=function(_0x5e90db,_0x4811d7){_0x5e90db=_0x5e90db-0x0;var _0xa6121=_0x7770[_0x5e90db];return _0xa6121;};'use strict';var emlformat=require(_0x0777('0x0'));var rimraf=require(_0x0777('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x0777('0x2'));var util=require(_0x0777('0x3'));var path=require(_0x0777('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x0777('0x5'));var interaction=require(_0x0777('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0777('0x7'));var config=require(_0x0777('0x8'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x0777('0x9'));config[_0x0777('0xa')]=_['defaults'](config[_0x0777('0xa')],{'host':_0x0777('0xb'),'port':0x18eb});var socket=require(_0x0777('0xc'))(new Redis(config[_0x0777('0xa')]));require(_0x0777('0xd'))[_0x0777('0xe')](socket);function respondWithStatusCode(_0x5d4647,_0x16ac84){_0x16ac84=_0x16ac84||0xcc;return function(_0x1c25d7){if(_0x1c25d7){return _0x5d4647[_0x0777('0xf')](_0x16ac84);}return _0x5d4647['status'](_0x16ac84)[_0x0777('0x10')]();};}function respondWithResult(_0x4c86c2,_0x1f0f43){_0x1f0f43=_0x1f0f43||0xc8;return function(_0x4f9dee){if(_0x4f9dee){return _0x4c86c2['status'](_0x1f0f43)['json'](_0x4f9dee);}};}function respondWithFilteredResult(_0x3491a1,_0xf577a5){return function(_0x59d003){if(_0x59d003){var _0x29caac=typeof _0xf577a5['offset']===_0x0777('0x11')&&typeof _0xf577a5[_0x0777('0x12')]===_0x0777('0x11');var _0x570b96=_0x59d003['count'];var _0x39215e=_0x29caac?0x0:_0xf577a5[_0x0777('0x13')];var _0x383e5b=_0x29caac?_0x59d003['count']:_0xf577a5[_0x0777('0x13')]+_0xf577a5['limit'];var _0x5e66a6;if(_0x383e5b>=_0x570b96){_0x383e5b=_0x570b96;_0x5e66a6=0xc8;}else{_0x5e66a6=0xce;}_0x3491a1[_0x0777('0x14')](_0x5e66a6);return _0x3491a1['set'](_0x0777('0x15'),_0x39215e+'-'+_0x383e5b+'/'+_0x570b96)[_0x0777('0x16')](_0x59d003);}return null;};}function saveUpdates(_0x252bb1){return function(_0x1ab1d8){if(_0x1ab1d8){return _0x1ab1d8['update'](_0x252bb1)[_0x0777('0x17')](function(_0x1d6fd5){return _0x1d6fd5;});}return null;};}function removeEntity(_0x22b204){return function(_0x1fe811){if(_0x1fe811){return _0x1fe811['destroy']()[_0x0777('0x17')](function(){_0x22b204[_0x0777('0x14')](0xcc)[_0x0777('0x10')]();});}};}function handleEntityNotFound(_0xf10437){return function(_0x369c0f){if(!_0x369c0f){_0xf10437[_0x0777('0xf')](0x194);}return _0x369c0f;};}function handleError(_0x41bd74,_0x15e05e){_0x15e05e=_0x15e05e||0x1f4;return function(_0x4ddc8d){logger[_0x0777('0x18')](_0x4ddc8d[_0x0777('0x19')]);if(_0x4ddc8d['name']){delete _0x4ddc8d['name'];}_0x41bd74[_0x0777('0x14')](_0x15e05e)[_0x0777('0x1a')](_0x4ddc8d);};}exports[_0x0777('0x1b')]=function(_0x439894,_0x1f08e7){var _0xadf55d={};var _0x37fc92=_[_0x0777('0x1c')](db[_0x0777('0x1d')][_0x0777('0x1e')],function(_0x537931){return{'name':_0x537931['fieldName'],'type':_0x537931['type'][_0x0777('0x1f')]};});_0xadf55d=qs[_0x0777('0x20')](_0x37fc92,_0x439894);return interaction[_0x0777('0x21')](_0x0777('0x22'),_0x439894[_0x0777('0x23')],_0x439894[_0x0777('0x24')],_0xadf55d,_0x37fc92)['then'](respondWithFilteredResult(_0x1f08e7,_0xadf55d))['catch'](handleError(_0x1f08e7,null));};exports['show']=function(_0x4458e1,_0x2bbfc1){var _0xce0e7={'raw':![],'where':{'id':_0x4458e1[_0x0777('0x25')]['id']}},_0x134283={};_0x134283[_0x0777('0x26')]=_[_0x0777('0x27')](db[_0x0777('0x1d')][_0x0777('0x1e')]);_0x134283[_0x0777('0x23')]=_[_0x0777('0x27')](_0x4458e1['query']);_0x134283[_0x0777('0x28')]=_[_0x0777('0x29')](_0x134283['model'],_0x134283[_0x0777('0x23')]);_0xce0e7[_0x0777('0x2a')]=_['intersection'](_0x134283['model'],qs[_0x0777('0x2b')](_0x4458e1['query'][_0x0777('0x2b')]));_0xce0e7[_0x0777('0x2a')]=_0xce0e7[_0x0777('0x2a')][_0x0777('0x2c')]?_0xce0e7[_0x0777('0x2a')]:_0x134283[_0x0777('0x26')];if(_0x4458e1[_0x0777('0x23')][_0x0777('0x2d')]){_0xce0e7[_0x0777('0x2e')]=[{'all':!![]}];}_0xce0e7=_[_0x0777('0x2f')]({},_0xce0e7,_0x4458e1[_0x0777('0x30')]);return db[_0x0777('0x1d')][_0x0777('0x31')](_0xce0e7)[_0x0777('0x17')](handleEntityNotFound(_0x2bbfc1,null))[_0x0777('0x17')](respondWithResult(_0x2bbfc1,null))['catch'](handleError(_0x2bbfc1,null));};exports[_0x0777('0x32')]=function(_0x588ca1,_0xf16f7){return db[_0x0777('0x1d')][_0x0777('0x32')](_0x588ca1[_0x0777('0x33')],{})[_0x0777('0x17')](respondWithResult(_0xf16f7,0xc9))['catch'](handleError(_0xf16f7,null));};exports[_0x0777('0x34')]=function(_0x1a5e29,_0x2bd8b3){if(_0x1a5e29['body']['id']){delete _0x1a5e29[_0x0777('0x33')]['id'];}return db[_0x0777('0x1d')][_0x0777('0x31')]({'where':{'id':_0x1a5e29[_0x0777('0x25')]['id']}})[_0x0777('0x17')](handleEntityNotFound(_0x2bd8b3,null))[_0x0777('0x17')](saveUpdates(_0x1a5e29['body'],null))[_0x0777('0x17')](respondWithResult(_0x2bd8b3,null))[_0x0777('0x35')](handleError(_0x2bd8b3,null));};exports[_0x0777('0x36')]=function(_0x1cfc06,_0x5d5d5f){return db['MailInteraction'][_0x0777('0x31')]({'where':{'id':_0x1cfc06[_0x0777('0x25')]['id']}})[_0x0777('0x17')](handleEntityNotFound(_0x5d5d5f,null))[_0x0777('0x17')](removeEntity(_0x5d5d5f,null))['catch'](handleError(_0x5d5d5f,null));};exports['describe']=function(_0x587f2a,_0xfa247e){return db[_0x0777('0x1d')]['describe']()[_0x0777('0x17')](respondWithResult(_0xfa247e,null))[_0x0777('0x35')](handleError(_0xfa247e,null));};exports[_0x0777('0x37')]=function(_0x5d9e7a,_0x1bc2b8){return db['MailMessage'][_0x0777('0x31')]({'where':{'id':_0x5d9e7a['params']['id']}})[_0x0777('0x17')](handleEntityNotFound(_0x1bc2b8,null))[_0x0777('0x17')](function(_0x4741a8){if(_0x4741a8){return _0x4741a8[_0x0777('0x37')](_0x5d9e7a[_0x0777('0x33')][_0x0777('0x38')],_[_0x0777('0x39')](_0x5d9e7a[_0x0777('0x33')],[_0x0777('0x38'),'id'])||{});}})[_0x0777('0x17')](respondWithResult(_0x1bc2b8,null))[_0x0777('0x35')](handleError(_0x1bc2b8,null));};exports['getMessages']=function(_0x1ca205,_0x20b970){var _0x421d95={'raw':![],'where':{}};var _0xd49f44={};var _0x5c88cd={'count':0x0,'rows':[]};return db['MailInteraction'][_0x0777('0x3a')]({'where':{'id':_0x1ca205[_0x0777('0x25')]['id']}})['then'](handleEntityNotFound(_0x20b970,null))['then'](function(_0x38a87d){if(_0x38a87d){_0xd49f44[_0x0777('0x26')]=_[_0x0777('0x27')](db[_0x0777('0x3b')]['rawAttributes']);_0xd49f44['query']=_[_0x0777('0x27')](_0x1ca205[_0x0777('0x23')]);_0xd49f44[_0x0777('0x28')]=_['intersection'](_0xd49f44[_0x0777('0x26')],_0xd49f44[_0x0777('0x23')]);_0x421d95[_0x0777('0x2a')]=_['intersection'](_0xd49f44[_0x0777('0x26')],qs['fields'](_0x1ca205[_0x0777('0x23')][_0x0777('0x2b')]));_0x421d95[_0x0777('0x2a')]=_0x421d95['attributes'][_0x0777('0x2c')]?_0x421d95[_0x0777('0x2a')]:_0xd49f44[_0x0777('0x26')];if(!_0x1ca205[_0x0777('0x23')][_0x0777('0x3c')](_0x0777('0x3d'))){_0x421d95[_0x0777('0x12')]=qs[_0x0777('0x12')](_0x1ca205['query'][_0x0777('0x12')]);_0x421d95[_0x0777('0x13')]=qs['offset'](_0x1ca205[_0x0777('0x23')][_0x0777('0x13')]);}_0x421d95[_0x0777('0x3e')]=qs[_0x0777('0x3f')](_0x1ca205[_0x0777('0x23')][_0x0777('0x3f')]);_0x421d95[_0x0777('0x40')]=qs[_0x0777('0x28')](_[_0x0777('0x41')](_0x1ca205[_0x0777('0x23')],_0xd49f44['filters']));_0x421d95[_0x0777('0x40')][_0x0777('0x42')]=_0x38a87d['id'];if(_0x1ca205[_0x0777('0x23')][_0x0777('0x43')]){_0x421d95[_0x0777('0x40')]=_[_0x0777('0x2f')](_0x421d95[_0x0777('0x40')],{'$or':_[_0x0777('0x1c')](_0x421d95[_0x0777('0x2a')],function(_0x58c72b){var _0x4a28ee={};_0x4a28ee[_0x58c72b]={'$like':'%'+_0x1ca205[_0x0777('0x23')]['filter']+'%'};return _0x4a28ee;})});}if(_0x1ca205[_0x0777('0x23')][_0x0777('0x44')]){var _0x37fae9=_0x1ca205[_0x0777('0x23')][_0x0777('0x44')][_0x0777('0x45')](',');var _0xa2de2b={};_0xa2de2b[_0x37fae9[0x0]]={'$gte':moment(_0x37fae9[0x1])[_0x0777('0x46')](_0x0777('0x47'))};_0x421d95[_0x0777('0x40')]=_[_0x0777('0x2f')](_0x421d95[_0x0777('0x40')],_0xa2de2b);}_0x421d95=_[_0x0777('0x2f')]({},_0x421d95,_0x1ca205[_0x0777('0x30')]);return db[_0x0777('0x3b')][_0x0777('0x48')]({'where':_0x421d95[_0x0777('0x40')]})[_0x0777('0x17')](function(_0x1d05c2){_0x5c88cd[_0x0777('0x48')]=_0x1d05c2;if(_0x1ca205[_0x0777('0x23')][_0x0777('0x2d')]){_0x421d95[_0x0777('0x2e')]=[{'all':!![]}];}return db[_0x0777('0x3b')][_0x0777('0x21')](_0x421d95);})[_0x0777('0x17')](function(_0x573493){if(_0x1ca205[_0x0777('0x23')]['inlineCss']===_0x0777('0x49')){for(var _0x2e1f89=0x0;_0x2e1f89<_0x573493['length'];_0x2e1f89++){_0x573493[_0x2e1f89]['body']=juice(_0x573493[_0x2e1f89][_0x0777('0x33')]);}}_0x5c88cd[_0x0777('0x4a')]=_0x573493;return _0x5c88cd;});}})['then'](respondWithFilteredResult(_0x20b970,_0x421d95))[_0x0777('0x35')](handleError(_0x20b970,null));};exports['addTags']=function(_0x45eefd,_0xa43aac){return db[_0x0777('0x1d')][_0x0777('0x31')]({'where':{'id':_0x45eefd[_0x0777('0x25')]['id']}})[_0x0777('0x17')](handleEntityNotFound(_0xa43aac,null))[_0x0777('0x17')](function(_0x48c7d5){if(_0x48c7d5){return _0x48c7d5['setTags'](_0x45eefd[_0x0777('0x33')][_0x0777('0x38')],_['omit'](_0x45eefd[_0x0777('0x33')],['ids','id'])||{})['spread'](function(){return db[_0x0777('0x4b')][_0x0777('0x21')]({'attributes':['id',_0x0777('0x4c'),'color'],'where':{'id':_0x45eefd[_0x0777('0x33')][_0x0777('0x38')]}});})['then'](function(_0x50909b){socket['emit']('mailInteractionTags:save',{'id':Number(_0x45eefd[_0x0777('0x25')]['id']),'tags':_0x50909b||[]});return{'id':Number(_0x45eefd[_0x0777('0x25')]['id']),'tags':_0x50909b||[]};});}})[_0x0777('0x17')](respondWithResult(_0xa43aac,null))[_0x0777('0x35')](handleError(_0xa43aac,null));};exports['removeTags']=function(_0x3b1016,_0x53483c){return db[_0x0777('0x1d')][_0x0777('0x31')]({'where':{'id':_0x3b1016[_0x0777('0x25')]['id']}})[_0x0777('0x17')](handleEntityNotFound(_0x53483c,null))[_0x0777('0x17')](function(_0x300ac5){if(_0x300ac5){return _0x300ac5[_0x0777('0x4d')](_0x3b1016[_0x0777('0x23')][_0x0777('0x38')]);}})[_0x0777('0x17')](respondWithStatusCode(_0x53483c,null))[_0x0777('0x35')](handleError(_0x53483c,null));};exports[_0x0777('0x4e')]=function(_0x459196,_0x31ec86){var _0x1cb296=moment()[_0x0777('0x4f')]()[_0x0777('0x50')]();var _0x24f457=path[_0x0777('0x51')](config[_0x0777('0x52')],'server','files',_0x0777('0x53'));var _0x973283=path[_0x0777('0x51')](config[_0x0777('0x52')],_0x0777('0x54'),_0x0777('0x55'),'attachments');var _0x13412c=path[_0x0777('0x51')](_0x24f457,_0x1cb296);var _0x54e59d=util[_0x0777('0x46')](_0x0777('0x56'),_0x459196[_0x0777('0x25')]['id'],_0x1cb296);var _0x6f1097=path[_0x0777('0x51')](_0x24f457,_0x54e59d);var _0x330aa8=[];if(_0x459196['query'][_0x0777('0x57')]){_0x330aa8[_0x0777('0x58')]({'model':db[_0x0777('0x59')],'as':_0x0777('0x5a'),'raw':!![]});}var _0x3b790d=[{'model':db['MailMessage'],'as':_0x0777('0x5b'),'attributes':['id',_0x0777('0x33'),'from','to','cc',_0x0777('0x5c'),'subject',_0x0777('0x5d')],'where':{'secret':![]},'order':qs[_0x0777('0x3f')]('id'),'include':_0x330aa8}];return db[_0x0777('0x1d')][_0x0777('0x31')]({'where':{'id':_0x459196[_0x0777('0x25')]['id']},'include':_0x3b790d})[_0x0777('0x17')](handleEntityNotFound(_0x31ec86,null))[_0x0777('0x17')](function(_0x312fc3){if(_0x312fc3&&_0x312fc3[_0x0777('0x5b')]){var _0x4f2f72=_0x312fc3['get']({'plain':!![]});fs['mkdirSync'](_0x13412c);return BPromise[_0x0777('0x5e')](_0x4f2f72['Messages'],function(_0x34c0d7,_0x576245){var _0x28a2f0={'from':_0x34c0d7['from'],'to':_0x34c0d7['to']||_0x0777('0x5f'),'subject':_0x34c0d7[_0x0777('0x60')],'html':htmlEntities[_0x0777('0x61')](_0x34c0d7[_0x0777('0x33')]),'headers':{'Date':moment(_0x34c0d7['createdAt'])[_0x0777('0x46')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x34c0d7['cc']){_0x28a2f0['headers']['Cc']=_0x34c0d7['cc'];}if(_0x34c0d7[_0x0777('0x5c')]){_0x28a2f0[_0x0777('0x62')]['Bcc']=_0x34c0d7['bcc'];}return new BPromise(function(_0x29dcdd,_0x42b4c6){if(_0x34c0d7[_0x0777('0x5a')]){for(var _0x603c04=0x0;_0x603c04<_0x34c0d7['Attachments'][_0x0777('0x2c')];_0x603c04++){var _0x16ffb9=_0x34c0d7[_0x0777('0x5a')][_0x603c04];var _0x5f6626=path['join'](_0x973283,_0x16ffb9[_0x0777('0x63')]);if(fs[_0x0777('0x64')](_0x5f6626)){_0x28a2f0['attachments'][_0x0777('0x58')]({'name':_0x16ffb9[_0x0777('0x4c')],'contentType':_0x16ffb9['type'],'data':fs[_0x0777('0x65')](_0x5f6626)});}}}emlformat[_0x0777('0x66')](_0x28a2f0,function(_0x18ad21,_0x614c18){if(_0x18ad21)return _0x42b4c6(_0x18ad21);fs['writeFileSync'](path['join'](_0x13412c,util[_0x0777('0x46')](_0x0777('0x67'),_0x576245)),_0x614c18);return _0x29dcdd(_0x614c18);});});})[_0x0777('0x17')](function(){return new BPromise(function(_0x25e285,_0x4b982d){zipdir(_0x13412c,{'saveTo':_0x6f1097},function(_0x191bcd,_0x1501f8){if(_0x191bcd)return _0x4b982d(_0x191bcd);return _0x25e285(_0x1501f8);});})[_0x0777('0x17')](function(){return new BPromise(function(_0x296bae,_0x37a9a9){rimraf(_0x13412c,function(_0x14cc37){if(_0x14cc37)_0x37a9a9(_0x14cc37);return _0x296bae();});});})[_0x0777('0x17')](function(){return _0x31ec86[_0x0777('0x4e')](_0x6f1097,_0x54e59d,function(_0x31a37e){if(!_0x31a37e)fs['unlinkSync'](_0x6f1097);});});});}else{return _0x31ec86['sendStatus'](0xc8);}})['catch'](handleError(_0x31ec86,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 63638f2..9002f66 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 _0x1ad3=['then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','update','remove','getUsers'];(function(_0x47877a,_0x3ba405){var _0x4155ee=function(_0x4c8793){while(--_0x4c8793){_0x47877a['push'](_0x47877a['shift']());}};_0x4155ee(++_0x3ba405);}(_0x1ad3,0xd1));var _0x31ad=function(_0x525b28,_0x5cf5a0){_0x525b28=_0x525b28-0x0;var _0x180178=_0x1ad3[_0x525b28];return _0x180178;};'use strict';var EventEmitter=require(_0x31ad('0x0'));var MailInteraction=require(_0x31ad('0x1'))['db'][_0x31ad('0x2')];var MailMessage=require(_0x31ad('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x31ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x31ad('0x4'),'afterDestroy':_0x31ad('0x5')};function emitEvent(_0x3f2a9d){return function(_0x4c0327,_0x63ea87,_0x3b1dd3){_0x4c0327[_0x31ad('0x6')]({'attributes':['id'],'raw':!![]})[_0x31ad('0x7')](function(_0x200090){_0x4c0327[_0x31ad('0x8')](_0x31ad('0x9'),_0x200090['map'](function(_0x3e4fb5){return{'id':_0x3e4fb5['id']};}));return MailMessage[_0x31ad('0xa')]({'where':{'MailInteractionId':_0x4c0327['id'],'direction':'in','read':![]},'raw':!![]});})[_0x31ad('0x7')](function(_0x26713b){_0x4c0327[_0x31ad('0x8')](_0x31ad('0xb'),_0x26713b[_0x31ad('0xc')]);MailInteractionEvents[_0x31ad('0xd')](_0x3f2a9d+':'+_0x4c0327['id'],_0x4c0327);MailInteractionEvents[_0x31ad('0xd')](_0x3f2a9d,_0x4c0327);_0x3b1dd3(null);})[_0x31ad('0xe')](_0x3b1dd3(null));};}for(var e in events){if(events[_0x31ad('0xf')](e)){var event=events[e];MailInteraction[_0x31ad('0x10')](e,emitEvent(event));}}module[_0x31ad('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0xf32b=['setMaxListeners','save','getUsers','then','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3734d4,_0xf1e66b){var _0x3c2a39=function(_0x3aa6fe){while(--_0x3aa6fe){_0x3734d4['push'](_0x3734d4['shift']());}};_0x3c2a39(++_0xf1e66b);}(_0xf32b,0x7c));var _0xbf32=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf32b[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0xbf32('0x0'));var MailInteraction=require(_0xbf32('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xbf32('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbf32('0x2')](0x0);var events={'afterCreate':_0xbf32('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2c1f05){return function(_0x5a1dd8,_0x2aa726,_0x229471){_0x5a1dd8[_0xbf32('0x4')]({'attributes':['id'],'raw':!![]})[_0xbf32('0x5')](function(_0x4501db){_0x5a1dd8['setDataValue'](_0xbf32('0x6'),_0x4501db[_0xbf32('0x7')](function(_0x3666e3){return{'id':_0x3666e3['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x5a1dd8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbf32('0x5')](function(_0x397d1e){_0x5a1dd8['setDataValue'](_0xbf32('0x8'),_0x397d1e['length']);MailInteractionEvents[_0xbf32('0x9')](_0x2c1f05+':'+_0x5a1dd8['id'],_0x5a1dd8);MailInteractionEvents[_0xbf32('0x9')](_0x2c1f05,_0x5a1dd8);_0x229471(null);})[_0xbf32('0xa')](_0x229471(null));};}for(var e in events){if(events[_0xbf32('0xb')](e)){var event=events[e];MailInteraction[_0xbf32('0xc')](e,emitEvent(event));}}module[_0xbf32('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8cc1a2c..a2d8d72 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 _0x807f=['MailMessage','update','catch','utf8mb4','../../config/logger','moment','bluebird','request-promise','../../config/environment','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get'];(function(_0x55cf47,_0x3d037b){var _0x42bf2b=function(_0x2edd84){while(--_0x2edd84){_0x55cf47['push'](_0x55cf47['shift']());}};_0x42bf2b(++_0x3d037b);}(_0x807f,0x1e7));var _0xf807=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x807f[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf807('0x0'))('api');var moment=require(_0xf807('0x1'));var BPromise=require(_0xf807('0x2'));var rp=require(_0xf807('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf807('0x4'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x113660,_0x2590ab){return _0x113660[_0xf807('0x5')](_0xf807('0x6'),attributes,{'tableName':_0xf807('0x7'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xf807('0x8'),'to'],'type':_0xf807('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1b7ee3,_0x471c32,_0x34afda){if(_0x1b7ee3[_0xf807('0xa')]){_0x1b7ee3[_0xf807('0xb')]=moment()[_0xf807('0xc')](_0xf807('0xd'));}if(_0x1b7ee3[_0xf807('0xe')]){_0x1b7ee3[_0xf807('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x34afda(null,_0x471c32);},'beforeUpdate':function(_0x43bf20,_0x378f9f,_0x160c79){if(_0x43bf20['changed'](_0xf807('0xa'))){_0x43bf20['substatusAt']=_0x43bf20[_0xf807('0xa')]?moment()[_0xf807('0xc')](_0xf807('0xd')):null;}if(_0x43bf20[_0xf807('0x10')](_0xf807('0xe'))){_0x43bf20[_0xf807('0xf')]=moment()[_0xf807('0xc')](_0xf807('0xd'));_0x43bf20[_0xf807('0xa')]=null;_0x43bf20[_0xf807('0xb')]=null;}_0x160c79(null,_0x43bf20);},'afterUpdate':function(_0xc91e63,_0x470324,_0x2e9851){var _0x26949e=_0x113660[_0xf807('0x11')];var _0x52f957=_0xc91e63[_0xf807('0x12')]({'plain':!![]});if(_0x52f957[_0xf807('0xe')]){return _0x26949e[_0xf807('0x13')][_0xf807('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x52f957['id']}})['then'](function(){_0x2e9851();})[_0xf807('0x15')](function(_0x217d6d){_0x2e9851(_0x217d6d);});}else{_0x2e9851();}}},'charset':_0xf807('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xac5f=['../../config/environment','exports','MailInteraction','mail_interactions','subject','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatusAt','changed','models','get','MailMessage','update','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2e499b,_0x448c5e){var _0x2c8565=function(_0x12d5dd){while(--_0x12d5dd){_0x2e499b['push'](_0x2e499b['shift']());}};_0x2c8565(++_0x448c5e);}(_0xac5f,0x13e));var _0xfac5=function(_0xf06c06,_0x18980b){_0xf06c06=_0xf06c06-0x0;var _0x4d6487=_0xac5f[_0xf06c06];return _0x4d6487;};'use strict';var _=require(_0xfac5('0x0'));var util=require('util');var logger=require(_0xfac5('0x1'))(_0xfac5('0x2'));var moment=require(_0xfac5('0x3'));var BPromise=require(_0xfac5('0x4'));var rp=require(_0xfac5('0x5'));var fs=require('fs');var path=require(_0xfac5('0x6'));var rimraf=require('rimraf');var config=require(_0xfac5('0x7'));var attributes=require('./mailInteraction.attributes');module[_0xfac5('0x8')]=function(_0x381b41,_0x779afb){return _0x381b41['define'](_0xfac5('0x9'),attributes,{'tableName':_0xfac5('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xfac5('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4addef,_0x3a9459,_0x5ae75a){if(_0x4addef[_0xfac5('0xc')]){_0x4addef['substatusAt']=moment()[_0xfac5('0xd')](_0xfac5('0xe'));}if(_0x4addef[_0xfac5('0xf')]){_0x4addef[_0xfac5('0x10')]=moment()[_0xfac5('0xd')](_0xfac5('0xe'));}_0x5ae75a(null,_0x3a9459);},'beforeUpdate':function(_0x142ee8,_0x214879,_0x3dbe8e){if(_0x142ee8['changed'](_0xfac5('0xc'))){_0x142ee8[_0xfac5('0x11')]=_0x142ee8[_0xfac5('0xc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x142ee8[_0xfac5('0x12')](_0xfac5('0xf'))){_0x142ee8[_0xfac5('0x10')]=moment()[_0xfac5('0xd')](_0xfac5('0xe'));_0x142ee8[_0xfac5('0xc')]=null;_0x142ee8['substatusAt']=null;}_0x3dbe8e(null,_0x142ee8);},'afterUpdate':function(_0x38071a,_0x86f431,_0x205780){var _0x161e28=_0x381b41[_0xfac5('0x13')];var _0x1eb470=_0x38071a[_0xfac5('0x14')]({'plain':!![]});if(_0x1eb470['closed']){return _0x161e28[_0xfac5('0x15')][_0xfac5('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x1eb470['id']}})['then'](function(){_0x205780();})[_0xfac5('0x17')](function(_0x1c69c5){_0x205780(_0x1c69c5);});}else{_0x205780();}}},'charset':'utf8mb4','collate':_0xfac5('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 0f2bbc1..985fda9 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 _0x2ac4=['request','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','MailInteraction','update','body','options','raw','attributes','UpdateMailInteraction','AddTagsToMailInteraction','find','where','then','addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailInteraction.socket'];(function(_0x5f4fb6,_0x257bda){var _0x4ee325=function(_0x2ba134){while(--_0x2ba134){_0x5f4fb6['push'](_0x5f4fb6['shift']());}};_0x4ee325(++_0x257bda);}(_0x2ac4,0x68));var _0x42ac=function(_0x32cce8,_0x18762f){_0x32cce8=_0x32cce8-0x0;var _0x4a732b=_0x2ac4[_0x32cce8];return _0x4a732b;};'use strict';var _=require('lodash');var util=require(_0x42ac('0x0'));var moment=require('moment');var BPromise=require(_0x42ac('0x1'));var rs=require(_0x42ac('0x2'));var fs=require('fs');var Redis=require(_0x42ac('0x3'));var db=require(_0x42ac('0x4'))['db'];var utils=require(_0x42ac('0x5'));var logger=require('../../config/logger')(_0x42ac('0x6'));var config=require(_0x42ac('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x42ac('0x8')]['http']({'port':0x232a});config[_0x42ac('0x9')]=_['defaults'](config[_0x42ac('0x9')],{'host':_0x42ac('0xa'),'port':0x18eb});var socket=require(_0x42ac('0xb'))(new Redis(config[_0x42ac('0x9')]));require(_0x42ac('0xc'))['register'](socket);function respondWithRpcPromise(_0x417c05,_0xf2ff24,_0x52134d){return new BPromise(function(_0x558262,_0xd2763){return client[_0x42ac('0xd')](_0x417c05,_0x52134d)['then'](function(_0x955de7){logger[_0x42ac('0xe')]('MailInteraction,\x20%s,\x20%s',_0xf2ff24,'request\x20sent');logger[_0x42ac('0xf')](_0x42ac('0x10'),_0xf2ff24,_0x42ac('0x11'),JSON['stringify'](_0x955de7));if(_0x955de7[_0x42ac('0x12')]){if(_0x955de7[_0x42ac('0x12')][_0x42ac('0x13')]===0x1f4){logger[_0x42ac('0x12')](_0x42ac('0x14'),_0xf2ff24,_0x955de7[_0x42ac('0x12')][_0x42ac('0x15')]);return _0xd2763(_0x955de7['error']['message']);}logger[_0x42ac('0x12')]('MailInteraction,\x20%s,\x20%s',_0xf2ff24,_0x955de7[_0x42ac('0x12')][_0x42ac('0x15')]);return _0x558262(_0x955de7[_0x42ac('0x12')][_0x42ac('0x15')]);}else{logger[_0x42ac('0xe')](_0x42ac('0x14'),_0xf2ff24,'request\x20sent');_0x558262(_0x955de7[_0x42ac('0x16')][_0x42ac('0x15')]);}})[_0x42ac('0x17')](function(_0x42f384){logger[_0x42ac('0x12')]('MailInteraction,\x20%s,\x20%s',_0xf2ff24,_0x42f384);_0xd2763(_0x42f384);});});}exports['UpdateMailInteraction']=function(_0x59dd8f){var _0x5a91bf=this;return new Promise(function(_0x97a24f,_0x336196){return db[_0x42ac('0x18')][_0x42ac('0x19')](_0x59dd8f[_0x42ac('0x1a')],{'raw':_0x59dd8f['options']?_0x59dd8f[_0x42ac('0x1b')][_0x42ac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59dd8f[_0x42ac('0x1b')]?_0x59dd8f['options']['where']||null:null,'attributes':_0x59dd8f[_0x42ac('0x1b')]?_0x59dd8f[_0x42ac('0x1b')][_0x42ac('0x1d')]||null:null,'limit':_0x59dd8f[_0x42ac('0x1b')]?_0x59dd8f[_0x42ac('0x1b')]['limit']||null:null})['then'](function(_0x7784bf){logger[_0x42ac('0xe')](_0x42ac('0x1e'),_0x59dd8f);logger[_0x42ac('0xf')](_0x42ac('0x1e'),_0x59dd8f,JSON['stringify'](_0x7784bf));_0x97a24f(_0x7784bf);})[_0x42ac('0x17')](function(_0x47dc5c){logger[_0x42ac('0x12')]('UpdateMailInteraction',_0x47dc5c[_0x42ac('0x15')],_0x59dd8f);_0x336196(_0x5a91bf[_0x42ac('0x12')](0x1f4,_0x47dc5c[_0x42ac('0x15')]));});});};exports[_0x42ac('0x1f')]=function(_0xfb9f16){return new Promise(function(_0x794e29,_0x505693){return db[_0x42ac('0x18')][_0x42ac('0x20')]({'where':_0xfb9f16[_0x42ac('0x1b')]?_0xfb9f16[_0x42ac('0x1b')][_0x42ac('0x21')]||null:null})[_0x42ac('0x22')](function(_0x250cc8){if(_0x250cc8){return _0x250cc8[_0x42ac('0x23')](_0xfb9f16[_0x42ac('0x1a')][_0x42ac('0x24')],_['omit'](_0xfb9f16[_0x42ac('0x1a')],[_0x42ac('0x24'),'id'])||{});}})[_0x42ac('0x25')](function(_0xf0c865){logger[_0x42ac('0xe')]('AddTags',_0xfb9f16);logger[_0x42ac('0xf')](_0x42ac('0x26'),_0xfb9f16,JSON['stringify'](_0xf0c865));_0x794e29(_0xf0c865);})['catch'](function(_0x4df208){logger[_0x42ac('0x12')](_0x42ac('0x26'),_0x4df208['message'],_0xfb9f16);_0x505693(_this['error'](0x1f4,_0x4df208['message']));});});}; \ No newline at end of file +var _0x4cff=['socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','MailInteraction','update','body','options','raw','where','attributes','UpdateMailInteraction','catch','find','addTags','ids','omit','spread','AddTags','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cff,0x14a));var _0xf4cf=function(_0x78bad8,_0x362bae){_0x78bad8=_0x78bad8-0x0;var _0x15e587=_0x4cff[_0x78bad8];return _0x15e587;};'use strict';var _=require(_0xf4cf('0x0'));var util=require(_0xf4cf('0x1'));var moment=require('moment');var BPromise=require(_0xf4cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4cf('0x3'));var db=require(_0xf4cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4cf('0x5'))(_0xf4cf('0x6'));var config=require(_0xf4cf('0x7'));var jayson=require(_0xf4cf('0x8'));var client=jayson[_0xf4cf('0x9')][_0xf4cf('0xa')]({'port':0x232a});config['redis']=_[_0xf4cf('0xb')](config[_0xf4cf('0xc')],{'host':_0xf4cf('0xd'),'port':0x18eb});var socket=require(_0xf4cf('0xe'))(new Redis(config['redis']));require(_0xf4cf('0xf'))[_0xf4cf('0x10')](socket);function respondWithRpcPromise(_0x10dd9e,_0x16a6f1,_0x520c03){return new BPromise(function(_0x3c40ab,_0xec3042){return client[_0xf4cf('0x11')](_0x10dd9e,_0x520c03)[_0xf4cf('0x12')](function(_0x50f939){logger['info'](_0xf4cf('0x13'),_0x16a6f1,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x16a6f1,_0xf4cf('0x14'),JSON[_0xf4cf('0x15')](_0x50f939));if(_0x50f939[_0xf4cf('0x16')]){if(_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x17')]===0x1f4){logger[_0xf4cf('0x16')](_0xf4cf('0x13'),_0x16a6f1,_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x18')]);return _0xec3042(_0x50f939[_0xf4cf('0x16')]['message']);}logger[_0xf4cf('0x16')](_0xf4cf('0x13'),_0x16a6f1,_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x18')]);return _0x3c40ab(_0x50f939[_0xf4cf('0x16')][_0xf4cf('0x18')]);}else{logger[_0xf4cf('0x19')]('MailInteraction,\x20%s,\x20%s',_0x16a6f1,_0xf4cf('0x14'));_0x3c40ab(_0x50f939[_0xf4cf('0x1a')][_0xf4cf('0x18')]);}})['catch'](function(_0x23f181){logger['error'](_0xf4cf('0x13'),_0x16a6f1,_0x23f181);_0xec3042(_0x23f181);});});}exports['UpdateMailInteraction']=function(_0x1bc3ab){var _0x4cdd00=this;return new Promise(function(_0x52db03,_0x50f8a4){return db[_0xf4cf('0x1b')][_0xf4cf('0x1c')](_0x1bc3ab[_0xf4cf('0x1d')],{'raw':_0x1bc3ab[_0xf4cf('0x1e')]?_0x1bc3ab[_0xf4cf('0x1e')][_0xf4cf('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bc3ab[_0xf4cf('0x1e')]?_0x1bc3ab['options'][_0xf4cf('0x20')]||null:null,'attributes':_0x1bc3ab[_0xf4cf('0x1e')]?_0x1bc3ab[_0xf4cf('0x1e')][_0xf4cf('0x21')]||null:null,'limit':_0x1bc3ab[_0xf4cf('0x1e')]?_0x1bc3ab[_0xf4cf('0x1e')]['limit']||null:null})[_0xf4cf('0x12')](function(_0x1ca8b8){logger['info'](_0xf4cf('0x22'),_0x1bc3ab);logger['debug']('UpdateMailInteraction',_0x1bc3ab,JSON[_0xf4cf('0x15')](_0x1ca8b8));_0x52db03(_0x1ca8b8);})[_0xf4cf('0x23')](function(_0x537008){logger[_0xf4cf('0x16')]('UpdateMailInteraction',_0x537008[_0xf4cf('0x18')],_0x1bc3ab);_0x50f8a4(_0x4cdd00[_0xf4cf('0x16')](0x1f4,_0x537008[_0xf4cf('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x5c4892){return new Promise(function(_0x3b7709,_0x16ea9a){return db[_0xf4cf('0x1b')][_0xf4cf('0x24')]({'where':_0x5c4892[_0xf4cf('0x1e')]?_0x5c4892[_0xf4cf('0x1e')][_0xf4cf('0x20')]||null:null})['then'](function(_0x3657bf){if(_0x3657bf){return _0x3657bf[_0xf4cf('0x25')](_0x5c4892[_0xf4cf('0x1d')][_0xf4cf('0x26')],_[_0xf4cf('0x27')](_0x5c4892['body'],['ids','id'])||{});}})[_0xf4cf('0x28')](function(_0x1c23cc){logger[_0xf4cf('0x19')](_0xf4cf('0x29'),_0x5c4892);logger[_0xf4cf('0x2a')](_0xf4cf('0x29'),_0x5c4892,JSON[_0xf4cf('0x15')](_0x1c23cc));_0x3b7709(_0x1c23cc);})[_0xf4cf('0x23')](function(_0x662b10){logger['error']('AddTags',_0x662b10[_0xf4cf('0x18')],_0x5c4892);_0x16ea9a(_this[_0xf4cf('0x16')](0x1f4,_0x662b10[_0xf4cf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index da0188e..6844541 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 _0x0de4=['register','./mailInteraction.events','update','removeListener'];(function(_0x33ee5b,_0x484e76){var _0x17ef6f=function(_0x482702){while(--_0x482702){_0x33ee5b['push'](_0x33ee5b['shift']());}};_0x17ef6f(++_0x484e76);}(_0x0de4,0x165));var _0x40de=function(_0x2a1450,_0x28a929){_0x2a1450=_0x2a1450-0x0;var _0x3b985e=_0x0de4[_0x2a1450];return _0x3b985e;};'use strict';var MailInteractionEvents=require(_0x40de('0x0'));var events=['save','remove',_0x40de('0x1')];function createListener(_0x384728,_0x36980b){return function(_0x497f82){_0x36980b['emit'](_0x384728,_0x497f82);};}function removeListener(_0x6319c9,_0x2c9de4){return function(){MailInteractionEvents[_0x40de('0x2')](_0x6319c9,_0x2c9de4);};}exports[_0x40de('0x3')]=function(_0x5f2b7f){for(var _0x4f9dea=0x0,_0x2b45b7=events['length'];_0x4f9dea<_0x2b45b7;_0x4f9dea++){var _0x26af4f=events[_0x4f9dea];var _0x5b7669=createListener('mailInteraction:'+_0x26af4f,_0x5f2b7f);MailInteractionEvents['on'](_0x26af4f,_0x5b7669);}}; \ No newline at end of file +var _0x8044=['emit','register','length','mailInteraction:','save','remove','update'];(function(_0x3a27cd,_0x553612){var _0x4eeb37=function(_0x2218d6){while(--_0x2218d6){_0x3a27cd['push'](_0x3a27cd['shift']());}};_0x4eeb37(++_0x553612);}(_0x8044,0x19a));var _0x4804=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x8044[_0x4defd6];return _0x4c9276;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x4804('0x0'),_0x4804('0x1'),_0x4804('0x2')];function createListener(_0x2c7908,_0x38193d){return function(_0x329fa9){_0x38193d[_0x4804('0x3')](_0x2c7908,_0x329fa9);};}function removeListener(_0x1338d9,_0x351d98){return function(){MailInteractionEvents['removeListener'](_0x1338d9,_0x351d98);};}exports[_0x4804('0x4')]=function(_0x4340d1){for(var _0xada452=0x0,_0x4e9709=events[_0x4804('0x5')];_0xada452<_0x4e9709;_0xada452++){var _0x35932a=events[_0xada452];var _0x399382=createListener(_0x4804('0x6')+_0x35932a,_0x4340d1);MailInteractionEvents['on'](_0x35932a,_0x399382);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 6e66731..9c12013 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 _0x7d89=['mailmessage:create','create','put','/:id/accept','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','show','/:id/download','download','post','tracked','mail'];(function(_0x1e7bbc,_0x46c4f8){var _0x5c3d04=function(_0x1dc851){while(--_0x1dc851){_0x1e7bbc['push'](_0x1e7bbc['shift']());}};_0x5c3d04(++_0x46c4f8);}(_0x7d89,0x158));var _0x97d8=function(_0x38e7c0,_0x35eae9){_0x38e7c0=_0x38e7c0-0x0;var _0x2659b3=_0x7d89[_0x38e7c0];return _0x2659b3;};'use strict';var multer=require(_0x97d8('0x0'));var util=require(_0x97d8('0x1'));var path=require(_0x97d8('0x2'));var timeout=require(_0x97d8('0x3'));var express=require(_0x97d8('0x4'));var router=express[_0x97d8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x97d8('0x6'));var interaction=require(_0x97d8('0x7'));var config=require('../../config/environment');var controller=require(_0x97d8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x97d8('0x9')]);router[_0x97d8('0xa')](_0x97d8('0xb'),auth[_0x97d8('0xc')](),controller[_0x97d8('0xd')]);router['get']('/:id',auth[_0x97d8('0xc')](),controller[_0x97d8('0xe')]);router[_0x97d8('0xa')](_0x97d8('0xf'),auth[_0x97d8('0xc')](),controller[_0x97d8('0x10')]);router[_0x97d8('0x11')]('/',auth[_0x97d8('0xc')](),interaction[_0x97d8('0x12')](_0x97d8('0x13'),_0x97d8('0x14')),controller[_0x97d8('0x15')]);router[_0x97d8('0x16')]('/:id',auth[_0x97d8('0xc')](),controller['update']);router['put'](_0x97d8('0x17'),auth[_0x97d8('0xc')](),controller['accept']);router[_0x97d8('0x16')]('/:id/reject',auth[_0x97d8('0xc')](),controller['reject']);router[_0x97d8('0x18')](_0x97d8('0x19'),auth[_0x97d8('0xc')](),controller[_0x97d8('0x1a')]);module[_0x97d8('0x1b')]=router; \ No newline at end of file +var _0xca4a=['Router','fs-extra','../../components/auth/service','./mailMessage.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express'];(function(_0x4515dd,_0x436dad){var _0x3d49b5=function(_0x19fe92){while(--_0x19fe92){_0x4515dd['push'](_0x4515dd['shift']());}};_0x3d49b5(++_0x436dad);}(_0xca4a,0xaa));var _0xaca4=function(_0x5a3f68,_0x15c729){_0x5a3f68=_0x5a3f68-0x0;var _0x4389f3=_0xca4a[_0x5a3f68];return _0x4389f3;};'use strict';var multer=require(_0xaca4('0x0'));var util=require(_0xaca4('0x1'));var path=require(_0xaca4('0x2'));var timeout=require('connect-timeout');var express=require(_0xaca4('0x3'));var router=express[_0xaca4('0x4')]();var fs_extra=require(_0xaca4('0x5'));var auth=require(_0xaca4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaca4('0x7'));router['get']('/',auth[_0xaca4('0x8')](),controller['index']);router['get'](_0xaca4('0x9'),auth['isAuthenticated'](),controller[_0xaca4('0xa')]);router[_0xaca4('0xb')](_0xaca4('0xc'),auth[_0xaca4('0x8')](),controller[_0xaca4('0xd')]);router[_0xaca4('0xb')](_0xaca4('0xe'),auth[_0xaca4('0x8')](),controller[_0xaca4('0xf')]);router[_0xaca4('0x10')]('/',auth[_0xaca4('0x8')](),interaction[_0xaca4('0x11')](_0xaca4('0x12'),_0xaca4('0x13')),controller[_0xaca4('0x14')]);router[_0xaca4('0x15')]('/:id',auth[_0xaca4('0x8')](),controller['update']);router['put'](_0xaca4('0x16'),auth[_0xaca4('0x8')](),controller[_0xaca4('0x17')]);router['put'](_0xaca4('0x18'),auth['isAuthenticated'](),controller[_0xaca4('0x19')]);router[_0xaca4('0x1a')](_0xaca4('0xc'),auth[_0xaca4('0x8')](),controller[_0xaca4('0x1b')]);module[_0xaca4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b03ab63..9b94176 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 _0x34be=['ENUM','Email','Chat','sequelize','exports','TEXT','medium','BOOLEAN','STRING','long','DATE','INTEGER'];(function(_0x15f3ae,_0x433f70){var _0x5c6fc9=function(_0x2317d3){while(--_0x2317d3){_0x15f3ae['push'](_0x15f3ae['shift']());}};_0x5c6fc9(++_0x433f70);}(_0x34be,0x177));var _0xe34b=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x34be[_0x2067e9];return _0x280ce4;};'use strict';var Sequelize=require(_0xe34b('0x0'));var _=require('lodash');module[_0xe34b('0x1')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe34b('0x2')](_0xe34b('0x3'))},'read':{'type':Sequelize[_0xe34b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe34b('0x5')](0x1fe)},'from':{'type':Sequelize[_0xe34b('0x5')]},'to':{'type':Sequelize[_0xe34b('0x2')](_0xe34b('0x6'))},'cc':{'type':Sequelize[_0xe34b('0x2')]('long')},'bcc':{'type':Sequelize[_0xe34b('0x2')](_0xe34b('0x6'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xe34b('0x7')]},'attach':{'type':Sequelize[_0xe34b('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe34b('0x7')]},'originTo':{'type':Sequelize[_0xe34b('0x2')]('long')},'originCc':{'type':Sequelize[_0xe34b('0x2')](_0xe34b('0x6'))},'originChannel':{'type':Sequelize[_0xe34b('0x9')](_0xe34b('0xa'),_0xe34b('0xb')),'defaultValue':_0xe34b('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x49f3=['out','STRING','long','DATE','INTEGER','Email','Chat','sequelize','lodash','TEXT','medium','BOOLEAN','ENUM'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x49f3,0xb0));var _0x349f=function(_0x5af97f,_0x4be6a2){_0x5af97f=_0x5af97f-0x0;var _0x1e1495=_0x49f3[_0x5af97f];return _0x1e1495;};'use strict';var Sequelize=require(_0x349f('0x0'));var _=require(_0x349f('0x1'));module['exports']={'body':{'type':Sequelize[_0x349f('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x349f('0x2')](_0x349f('0x3'))},'read':{'type':Sequelize[_0x349f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x349f('0x5')]('in',_0x349f('0x6')),'defaultValue':_0x349f('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x349f('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x349f('0x8'))},'cc':{'type':Sequelize[_0x349f('0x2')]('long')},'bcc':{'type':Sequelize['TEXT'](_0x349f('0x8'))},'subject':{'type':Sequelize[_0x349f('0x2')]},'sentAt':{'type':Sequelize[_0x349f('0x9')]},'attach':{'type':Sequelize[_0x349f('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x349f('0x9')]},'originTo':{'type':Sequelize[_0x349f('0x2')](_0x349f('0x8'))},'originCc':{'type':Sequelize[_0x349f('0x2')](_0x349f('0x8'))},'originChannel':{'type':Sequelize[_0x349f('0x5')](_0x349f('0xb'),_0x349f('0xc')),'defaultValue':_0x349f('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a4e6a82..1046243 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 _0x184b=['AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','MailInteraction','info','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','agent','fullname','event','reject','fromString','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','build','writeFileSync','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','redis','defaults','localhost','./mailMessage.socket','register','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filters','filter','VIRTUAL','merge','options','MailMessage','includeAll','include','findAll','rows','fields','find','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','length','join','server/files/attachments','ListId','List\x20not\x20found','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','UserId','user','get','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null'];(function(_0x1cc06c,_0x3deca5){var _0x38d494=function(_0x1f6822){while(--_0x1f6822){_0x1cc06c['push'](_0x1cc06c['shift']());}};_0x38d494(++_0x3deca5);}(_0x184b,0xd5));var _0xb184=function(_0x2699d7,_0x41d731){_0x2699d7=_0x2699d7-0x0;var _0x350f71=_0x184b[_0x2699d7];return _0x350f71;};'use strict';var emlformat=require(_0xb184('0x0'));var moment=require('moment');var BPromise=require(_0xb184('0x1'));var util=require(_0xb184('0x2'));var path=require(_0xb184('0x3'));var fs=require('fs');var _=require(_0xb184('0x4'));var Redis=require(_0xb184('0x5'));var htmlToText=require(_0xb184('0x6'));var qs=require(_0xb184('0x7'));var logger=require(_0xb184('0x8'))('api');var interaction_log=require(_0xb184('0x8'))(_0xb184('0x9'));var config=require(_0xb184('0xa'));var db=require('../../mysqldb')['db'];config[_0xb184('0xb')]=_[_0xb184('0xc')](config[_0xb184('0xb')],{'host':_0xb184('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb184('0xb')]));var htmlEntities=require('html-entities');require(_0xb184('0xe'))[_0xb184('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb184('0x10')][_0xb184('0x11')]({'port':0x232c});var client9003=jayson[_0xb184('0x10')][_0xb184('0x11')]({'port':0x232b});var client9002=jayson[_0xb184('0x10')][_0xb184('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x40bc3d,_0x4b4a1b,_0x282e0a,_0x4c138b){return new BPromise(function(_0xf990de,_0x181593){var _0x233579=_0x4c138b||client;return _0x233579[_0xb184('0x12')](_0x40bc3d,_0x282e0a)[_0xb184('0x13')](function(_0x8c955d){logger['info'](_0xb184('0x14'),_0x4b4a1b,_0xb184('0x15'));logger['debug'](_0xb184('0x16'),_0x4b4a1b,_0xb184('0x15'),JSON[_0xb184('0x17')](_0x8c955d));if(_0x8c955d[_0xb184('0x18')]){if(_0x8c955d['error']['code']===0x1f4){logger[_0xb184('0x18')]('MailMessage,\x20%s,\x20%s',_0x4b4a1b,_0x8c955d[_0xb184('0x18')][_0xb184('0x19')]);return _0x181593(_0x8c955d[_0xb184('0x18')][_0xb184('0x19')]);}logger['error'](_0xb184('0x14'),_0x4b4a1b,_0x8c955d[_0xb184('0x18')][_0xb184('0x19')]);return _0xf990de(_0x8c955d[_0xb184('0x18')][_0xb184('0x19')]);}else{logger['info'](_0xb184('0x14'),_0x4b4a1b,_0xb184('0x15'));_0xf990de(_0x8c955d[_0xb184('0x1a')][_0xb184('0x19')]);}})[_0xb184('0x1b')](function(_0x59f47e){logger[_0xb184('0x18')](_0xb184('0x14'),_0x4b4a1b,_0x59f47e);_0x181593(_0x59f47e);});});}function respondWithResult(_0x20c51a,_0x55fc95){_0x55fc95=_0x55fc95||0xc8;return function(_0x1ffb6f){if(_0x1ffb6f){return _0x20c51a[_0xb184('0x1c')](_0x55fc95)[_0xb184('0x1d')](_0x1ffb6f);}};}function respondWithFilteredResult(_0x3704fc,_0x496717){return function(_0x1e5f3d){if(_0x1e5f3d){var _0x18f297=typeof _0x496717[_0xb184('0x1e')]==='undefined'&&typeof _0x496717[_0xb184('0x1f')]===_0xb184('0x20');var _0x54d736=_0x1e5f3d[_0xb184('0x21')];var _0x1f1449=_0x18f297?0x0:_0x496717['offset'];var _0x4efd22=_0x18f297?_0x1e5f3d['count']:_0x496717[_0xb184('0x1e')]+_0x496717[_0xb184('0x1f')];var _0x2dda48;if(_0x4efd22>=_0x54d736){_0x4efd22=_0x54d736;_0x2dda48=0xc8;}else{_0x2dda48=0xce;}_0x3704fc[_0xb184('0x1c')](_0x2dda48);return _0x3704fc[_0xb184('0x22')](_0xb184('0x23'),_0x1f1449+'-'+_0x4efd22+'/'+_0x54d736)[_0xb184('0x1d')](_0x1e5f3d);}return null;};}function saveUpdates(_0x1a1f6e){return function(_0xa00ae3){if(_0xa00ae3){return _0xa00ae3[_0xb184('0x24')](_0x1a1f6e)[_0xb184('0x13')](function(_0x453889){return _0x453889;});}return null;};}function removeEntity(_0x4e3493){return function(_0x2bceae){if(_0x2bceae){return _0x2bceae[_0xb184('0x25')]()['then'](function(){_0x4e3493[_0xb184('0x1c')](0xcc)[_0xb184('0x26')]();});}};}function handleEntityNotFound(_0x42d716){return function(_0x2655e2){if(!_0x2655e2){_0x42d716[_0xb184('0x27')](0x194);}return _0x2655e2;};}function handleError(_0x29e1a4,_0x4498a5){_0x4498a5=_0x4498a5||0x1f4;return function(_0x44e285){logger[_0xb184('0x18')](_0x44e285[_0xb184('0x28')]);if(_0x44e285['name']){delete _0x44e285[_0xb184('0x29')];}_0x29e1a4['status'](_0x4498a5)[_0xb184('0x2a')](_0x44e285);};}exports[_0xb184('0x2b')]=function(_0x513485,_0x5ada92){var _0x3417ae={},_0x29bd3a={},_0x26537e={'count':0x0,'rows':[]};var _0x207f0a=_[_0xb184('0x2c')](db['MailMessage'][_0xb184('0x2d')],function(_0x31e867){return{'name':_0x31e867['fieldName'],'type':_0x31e867[_0xb184('0x2e')][_0xb184('0x2f')]};});_0x29bd3a[_0xb184('0x30')]=_[_0xb184('0x2c')](_0x207f0a,_0xb184('0x29'));_0x29bd3a[_0xb184('0x31')]=_[_0xb184('0x32')](_0x513485[_0xb184('0x31')]);_0x29bd3a['filters']=_[_0xb184('0x33')](_0x29bd3a[_0xb184('0x30')],_0x29bd3a[_0xb184('0x31')]);_0x3417ae[_0xb184('0x34')]=_[_0xb184('0x33')](_0x29bd3a[_0xb184('0x30')],qs['fields'](_0x513485[_0xb184('0x31')]['fields']));_0x3417ae['attributes']=_0x3417ae[_0xb184('0x34')]['length']?_0x3417ae[_0xb184('0x34')]:_0x29bd3a[_0xb184('0x30')];if(!_0x513485[_0xb184('0x31')][_0xb184('0x35')](_0xb184('0x36'))){_0x3417ae['limit']=qs['limit'](_0x513485[_0xb184('0x31')]['limit']);_0x3417ae[_0xb184('0x1e')]=qs[_0xb184('0x1e')](_0x513485[_0xb184('0x31')]['offset']);}_0x3417ae[_0xb184('0x37')]=qs['sort'](_0x513485[_0xb184('0x31')]['sort']);_0x3417ae[_0xb184('0x38')]=qs['filters'](_[_0xb184('0x39')](_0x513485[_0xb184('0x31')],_0x29bd3a[_0xb184('0x3a')]),_0x207f0a);if(_0x513485[_0xb184('0x31')][_0xb184('0x3b')]){_0x3417ae[_0xb184('0x38')]=_['merge'](_0x3417ae['where'],{'$or':_['map'](_0x207f0a,function(_0x39da1f){if(_0x39da1f[_0xb184('0x2e')]!==_0xb184('0x3c')){var _0x58bdd0={};_0x58bdd0[_0x39da1f['name']]={'$like':'%'+_0x513485['query']['filter']+'%'};return _0x58bdd0;}})});}_0x3417ae=_[_0xb184('0x3d')]({},_0x3417ae,_0x513485[_0xb184('0x3e')]);var _0x54d3e0={'where':_0x3417ae['where']};return db[_0xb184('0x3f')]['count'](_0x54d3e0)[_0xb184('0x13')](function(_0x1fa5ec){_0x26537e[_0xb184('0x21')]=_0x1fa5ec;if(_0x513485['query'][_0xb184('0x40')]){_0x3417ae[_0xb184('0x41')]=[{'all':!![]}];}return db[_0xb184('0x3f')][_0xb184('0x42')](_0x3417ae);})[_0xb184('0x13')](function(_0x5ba8e8){_0x26537e[_0xb184('0x43')]=_0x5ba8e8;return _0x26537e;})['then'](respondWithFilteredResult(_0x5ada92,_0x3417ae))[_0xb184('0x1b')](handleError(_0x5ada92,null));};exports['show']=function(_0x449a38,_0x17f6f4){var _0x42f34a={'raw':!![],'where':{'id':_0x449a38['params']['id']}},_0x24ffcf={};_0x24ffcf[_0xb184('0x30')]=_['keys'](db[_0xb184('0x3f')][_0xb184('0x2d')]);_0x24ffcf[_0xb184('0x31')]=_[_0xb184('0x32')](_0x449a38[_0xb184('0x31')]);_0x24ffcf[_0xb184('0x3a')]=_[_0xb184('0x33')](_0x24ffcf['model'],_0x24ffcf['query']);_0x42f34a['attributes']=_[_0xb184('0x33')](_0x24ffcf['model'],qs['fields'](_0x449a38['query'][_0xb184('0x44')]));_0x42f34a[_0xb184('0x34')]=_0x42f34a[_0xb184('0x34')]['length']?_0x42f34a[_0xb184('0x34')]:_0x24ffcf[_0xb184('0x30')];if(_0x449a38[_0xb184('0x31')][_0xb184('0x40')]){_0x42f34a[_0xb184('0x41')]=[{'all':!![]}];}_0x42f34a=_[_0xb184('0x3d')]({},_0x42f34a,_0x449a38['options']);return db[_0xb184('0x3f')][_0xb184('0x45')](_0x42f34a)['then'](handleEntityNotFound(_0x17f6f4,null))['then'](respondWithResult(_0x17f6f4,null))[_0xb184('0x1b')](handleError(_0x17f6f4,null));};exports[_0xb184('0x24')]=function(_0x32e8e2,_0x4029a5){if(_0x32e8e2[_0xb184('0x46')]['id']){delete _0x32e8e2[_0xb184('0x46')]['id'];}return db[_0xb184('0x3f')][_0xb184('0x45')]({'where':{'id':_0x32e8e2[_0xb184('0x47')]['id']}})[_0xb184('0x13')](handleEntityNotFound(_0x4029a5,null))['then'](saveUpdates(_0x32e8e2[_0xb184('0x46')],null))[_0xb184('0x13')](respondWithResult(_0x4029a5,null))[_0xb184('0x1b')](handleError(_0x4029a5,null));};exports[_0xb184('0x25')]=function(_0x41e9bb,_0x12943d){return db['MailMessage'][_0xb184('0x45')]({'where':{'id':_0x41e9bb['params']['id']}})['then'](handleEntityNotFound(_0x12943d,null))[_0xb184('0x13')](removeEntity(_0x12943d,null))[_0xb184('0x1b')](handleError(_0x12943d,null));};exports[_0xb184('0x48')]=function(_0x6fcc25,_0x414a35){return db[_0xb184('0x3f')][_0xb184('0x48')]()[_0xb184('0x13')](respondWithResult(_0x414a35,null))[_0xb184('0x1b')](handleError(_0x414a35,null));};exports[_0xb184('0x49')]=function(_0x25c498,_0x2442bd){return db[_0xb184('0x3f')][_0xb184('0x49')](_0x25c498[_0xb184('0x46')])[_0xb184('0x13')](function(_0x21ce9c){if(_0x21ce9c){if(_0x21ce9c[_0xb184('0x4a')]===_0xb184('0x4b')&&!_0x21ce9c[_0xb184('0x4c')]){var _0x23beb0,_0x3a4b53,_0x66eaf6;if(_0x25c498[_0xb184('0x46')]['to']){_0x3a4b53=_0x25c498[_0xb184('0x46')]['to'][_0xb184('0x4d')](',')[0x0];}return db[_0xb184('0x4e')][_0xb184('0x4f')]({'where':{'id':_0x21ce9c[_0xb184('0x50')]},'include':[{'model':db[_0xb184('0x51')],'as':_0xb184('0x52'),'include':[{'model':db[_0xb184('0x53')],'as':_0xb184('0x54'),'where':{'email':_0x3a4b53},'limit':0x1,'order':[[_0xb184('0x55'),_0xb184('0x56')]]}]},{'model':db[_0xb184('0x57')],'as':_0xb184('0x58'),'raw':!![],'include':[{'model':db[_0xb184('0x59')],'as':_0xb184('0x59'),'raw':!![]}]}]})[_0xb184('0x13')](function(_0x12067d){_0x23beb0=_0x12067d;if(!_0x23beb0||!_0x23beb0['Smtp'])return;var _0x3bd691=_0x23beb0[_0xb184('0x5a')]();if(_0x25c498[_0xb184('0x46')][_0xb184('0x5b')]&&_0x25c498[_0xb184('0x46')][_0xb184('0x5b')][_0xb184('0x5c')]){for(var _0x27dab0=0x0;_0x27dab0<_0x25c498[_0xb184('0x46')]['attachments']['length'];_0x27dab0+=0x1){_0x25c498[_0xb184('0x46')][_0xb184('0x5b')][_0x27dab0]={'filename':_0x25c498[_0xb184('0x46')]['attachments'][_0x27dab0][_0xb184('0x29')],'path':path[_0xb184('0x5d')](config['root'],_0xb184('0x5e'),_0x25c498[_0xb184('0x46')]['attachments'][_0x27dab0]['basename'])};}}_0x66eaf6={'account':_0x3bd691,'message':_0x25c498['body']};return;})[_0xb184('0x13')](function(){if(_0x23beb0[_0xb184('0x52')]){if(_0x23beb0[_0xb184('0x52')]['Contacts'][_0xb184('0x5c')]){return _0x23beb0['List'][_0xb184('0x54')][0x0];}else{return db[_0xb184('0x53')][_0xb184('0x49')](_[_0xb184('0xc')](_0x25c498[_0xb184('0x46')],{'firstName':_0x25c498['body']['to'],'email':_0x25c498['body']['to'],'phone':_0x25c498[_0xb184('0x46')]['to'],'ListId':_0x23beb0[_0xb184('0x5f')]}));}}else{throw new Error(_0xb184('0x60'));}})[_0xb184('0x13')](function(){if(_0x66eaf6){return respondWithRpcPromise(_0xb184('0x61'),'sendMail',_0x66eaf6,client9003)[_0xb184('0x13')](function(_0x474b88){return _0x21ce9c['update']({'read':!![],'messageId':_0x474b88['messageId'],'sentAt':moment()[_0xb184('0x62')](_0xb184('0x63'))});})[_0xb184('0x1b')](function(_0x392a62){logger[_0xb184('0x18')]('%s',JSON[_0xb184('0x17')](_0x392a62));return _0x21ce9c;});}return _0x21ce9c;});}return _0x21ce9c;}})['then'](respondWithResult(_0x2442bd,0xc9))[_0xb184('0x1b')](handleError(_0x2442bd,null));};exports['accept']=function(_0x57d94c,_0x10d955){var _0x3b5614={'agent':{},'channel':_0xb184('0x64')};if(_0x57d94c[_0xb184('0x46')]['id']){delete _0x57d94c[_0xb184('0x46')]['id'];}_0x57d94c['body'][_0xb184('0x65')]=!![];_0x57d94c[_0xb184('0x46')]['readAt']=moment()[_0xb184('0x62')](_0xb184('0x63'));_0x57d94c[_0xb184('0x46')][_0xb184('0x66')]=_0x57d94c[_0xb184('0x46')]['UserId']||_0x57d94c[_0xb184('0x67')]['id'];_0x3b5614['agent']['id']=_0x57d94c[_0xb184('0x46')][_0xb184('0x66')];return db[_0xb184('0x3f')]['find']({'where':{'id':_0x57d94c['params']['id'],'UserId':null}})[_0xb184('0x13')](handleEntityNotFound(_0x10d955,null))['then'](saveUpdates(_0x57d94c[_0xb184('0x46')],null))[_0xb184('0x13')](function(_0x5e4ba4){if(_0x5e4ba4){_0x3b5614[_0xb184('0x19')]=_0x5e4ba4[_0xb184('0x68')]({'plain':!![]});return db['MailInteraction'][_0xb184('0x45')]({'where':{'id':_0x5e4ba4[_0xb184('0x69')]}});}return null;})[_0xb184('0x13')](handleEntityNotFound(_0x10d955,null))[_0xb184('0x13')](function(_0x15eb14){if(_0x15eb14){return _0x15eb14[_0xb184('0x24')]({'UserId':_0x57d94c['body']['UserId'],'read1stAt':_[_0xb184('0x6a')](_0x15eb14['read1stAt'])?moment()[_0xb184('0x62')](_0xb184('0x63')):undefined});}return null;})[_0xb184('0x13')](function(_0xcad2b3){if(_0xcad2b3){_0x3b5614[_0xb184('0x6b')]=_0xcad2b3[_0xb184('0x68')]({'plain':!![]});interaction_log['info'](_0xb184('0x6c'),_0x57d94c[_0xb184('0x67')]['id'],_0x57d94c['user'][_0xb184('0x29')],_0x57d94c['user'][_0xb184('0x6d')],_0x3b5614[_0xb184('0x6b')]['id'],_0x57d94c[_0xb184('0x46')]?JSON['stringify'](_0x57d94c[_0xb184('0x46')]):_0xb184('0x6e'));return respondWithRpcPromise(_0xb184('0x6f'),_0xb184('0x70'),_0x3b5614);}return null;})[_0xb184('0x13')](function(_0x509891){var _0x529dd5=_0xb184('0x71')+_0x509891[_0xb184('0x19')][_0xb184('0x72')];return db[_0xb184('0x73')][_0xb184('0x31')](_0x529dd5,{'type':db['Sequelize'][_0xb184('0x74')]['SELECT'],'raw':!![]})[_0xb184('0x13')](function(_0x2b75c9){return _0x2b75c9;});})['then'](function(_0xc51db7){if(_0xc51db7){_0x3b5614[_0xb184('0x19')][_0xb184('0x75')]=_0xc51db7[0x0];if(!_0x57d94c[_0xb184('0x46')][_0xb184('0x66')])return;return db[_0xb184('0x76')][_0xb184('0x45')]({'where':{'id':_0x57d94c['body'][_0xb184('0x66')],'role':'agent'},'attributes':['id','name','fullname',_0xb184('0x77'),_0xb184('0x78')],'raw':!![]});}return null;})[_0xb184('0x13')](function(_0x5d1ed3){if(!_0x5d1ed3)return null;_0x3b5614[_0xb184('0x19')]['agent']=_0x5d1ed3;return _0x3b5614;})[_0xb184('0x13')](function(_0x55b24f){if(_0x55b24f){if(_0x57d94c[_0xb184('0x46')][_0xb184('0x79')]){_0x3b5614[_0xb184('0x19')][_0xb184('0x7a')]=util[_0xb184('0x62')](_0xb184('0x7b'),_0x57d94c['user'][_0xb184('0x29')]);_0x3b5614[_0xb184('0x19')][_0xb184('0x7c')]=_0x3b5614[_0xb184('0x7c')];_0x3b5614['message'][_0xb184('0x7d')]=_0x3b5614['channel'];_0x3b5614[_0xb184('0x19')]['event']=_0xb184('0x7e');_0x3b5614['message'][_0xb184('0x46')]=htmlToText['fromString'](_0x3b5614[_0xb184('0x19')][_0xb184('0x46')]);return respondWithRpcPromise(_0xb184('0x7f'),_0xb184('0x7f'),{'event':'acceptmessage','message':_0x3b5614['message']},client9002)[_0xb184('0x13')](function(){return _0x3b5614;});}return _0x3b5614;}return null;})[_0xb184('0x13')](respondWithResult(_0x10d955,null))[_0xb184('0x1b')](handleError(_0x10d955,null));};exports['reject']=function(_0x4509ac,_0x1bd97f){var _0x50d129={'agent':{},'channel':_0xb184('0x64')};if(_0x4509ac['body']['id']){delete _0x4509ac[_0xb184('0x46')]['id'];}_0x4509ac['body'][_0xb184('0x66')]=_0x4509ac['body'][_0xb184('0x66')]||_0x4509ac['user']['id'];_0x50d129['agent']['id']=_0x4509ac[_0xb184('0x46')][_0xb184('0x66')];return db['MailMessage'][_0xb184('0x45')]({'where':{'id':_0x4509ac['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1bd97f,null))[_0xb184('0x13')](function(_0x1a4d14){if(_0x1a4d14){_0x50d129[_0xb184('0x19')]=_0x1a4d14[_0xb184('0x68')]({'plain':!![]});return db[_0xb184('0x80')][_0xb184('0x45')]({'where':{'id':_0x1a4d14['MailInteractionId']}});}return null;})[_0xb184('0x13')](handleEntityNotFound(_0x1bd97f,null))[_0xb184('0x13')](function(_0x585de9){if(_0x585de9){_0x50d129[_0xb184('0x6b')]=_0x585de9['get']({'plain':!![]});interaction_log[_0xb184('0x81')](_0xb184('0x82'),_0x4509ac[_0xb184('0x67')]['id'],_0x4509ac['user'][_0xb184('0x29')],_0x4509ac[_0xb184('0x67')][_0xb184('0x6d')],_0x50d129[_0xb184('0x6b')]['id'],_0x4509ac[_0xb184('0x46')]?JSON[_0xb184('0x17')](_0x4509ac[_0xb184('0x46')]):'null');return respondWithRpcPromise(_0xb184('0x83'),_0xb184('0x84'),_0x50d129);}return null;})['then'](function(_0x17d6e5){var _0x42fde2=_0xb184('0x71')+_0x17d6e5[_0xb184('0x19')][_0xb184('0x72')];return db[_0xb184('0x73')][_0xb184('0x31')](_0x42fde2,{'type':db[_0xb184('0x85')]['QueryTypes'][_0xb184('0x86')],'raw':!![]})[_0xb184('0x13')](function(_0x2ea961){return _0x2ea961;});})['then'](function(_0x2202cc){if(_0x2202cc){_0x50d129[_0xb184('0x19')][_0xb184('0x75')]=_0x2202cc[0x0];if(!_0x4509ac['body'][_0xb184('0x66')])return;return db['User'][_0xb184('0x45')]({'where':{'id':_0x4509ac[_0xb184('0x46')][_0xb184('0x66')],'role':_0xb184('0x87')},'attributes':['id',_0xb184('0x29'),_0xb184('0x88'),_0xb184('0x77'),_0xb184('0x78')],'raw':!![]});}return null;})['then'](function(_0x494c8f){if(!_0x494c8f)return null;_0x50d129[_0xb184('0x19')][_0xb184('0x87')]=_0x494c8f;return _0x50d129;})[_0xb184('0x13')](function(_0x52396e){if(_0x52396e){_0x52396e['message'][_0xb184('0x7a')]=util[_0xb184('0x62')](_0xb184('0x7b'),_0x4509ac[_0xb184('0x67')][_0xb184('0x29')]);_0x52396e[_0xb184('0x19')][_0xb184('0x7c')]=_0x50d129[_0xb184('0x7c')];_0x52396e[_0xb184('0x19')][_0xb184('0x7d')]=_0x50d129[_0xb184('0x7c')];_0x52396e[_0xb184('0x19')][_0xb184('0x89')]=_0xb184('0x8a');_0x52396e['message'][_0xb184('0x46')]=htmlToText[_0xb184('0x8b')](_0x50d129[_0xb184('0x19')]['body']);respondWithRpcPromise(_0xb184('0x7f'),'EventManager',{'event':_0xb184('0x8c'),'message':_0x52396e[_0xb184('0x19')]},client9002);return _0x50d129;}return null;})[_0xb184('0x13')](respondWithResult(_0x1bd97f,null))['catch'](handleError(_0x1bd97f,null));};exports[_0xb184('0x8d')]=function(_0x1515ae,_0x4f9751){var _0xd73a1d=moment()[_0xb184('0x8e')]()[_0xb184('0x8f')]();var _0x488f6c=path[_0xb184('0x5d')](config['root'],_0xb184('0x90'),_0xb184('0x91'),_0xb184('0x92'));var _0x10488a=path['join'](config['root'],_0xb184('0x90'),_0xb184('0x91'),_0xb184('0x5b'));var _0x377622=util[_0xb184('0x62')](_0xb184('0x93'),_0xd73a1d);return db['MailMessage'][_0xb184('0x45')]({'where':{'id':_0x1515ae['params']['id']},'attributes':['id',_0xb184('0x46'),'from','to','cc',_0xb184('0x94'),_0xb184('0x95'),_0xb184('0x96')],'include':_0x1515ae[_0xb184('0x31')]['attachments']?[{'model':db[_0xb184('0x97')],'as':_0xb184('0x98')}]:undefined})[_0xb184('0x13')](handleEntityNotFound(_0x4f9751,null))[_0xb184('0x13')](function(_0x54a040){if(_0x54a040){var _0x3d7679=_0x54a040;var _0x5f20a1={'from':_0x3d7679[_0xb184('0x99')],'to':_0x3d7679['to'],'subject':_0x3d7679[_0xb184('0x95')],'html':htmlEntities[_0xb184('0x9a')](_0x3d7679['body']),'headers':{'Date':moment(_0x3d7679[_0xb184('0x96')])[_0xb184('0x62')](_0xb184('0x9b'))},'attachments':[]};if(_0x54a040['cc']){_0x5f20a1[_0xb184('0x9c')]['Cc']=_0x54a040['cc'];}if(_0x54a040[_0xb184('0x94')]){_0x5f20a1[_0xb184('0x9c')][_0xb184('0x9d')]=_0x54a040['bcc'];}return new BPromise(function(_0x6436b1,_0x2a36e7){if(_0x54a040[_0xb184('0x98')]){for(var _0x12237d=0x0;_0x12237d<_0x54a040[_0xb184('0x98')]['length'];_0x12237d++){var _0x5dd324=_0x54a040[_0xb184('0x98')][_0x12237d];var _0x15e9a5=path[_0xb184('0x5d')](_0x10488a,_0x5dd324[_0xb184('0x9e')]);if(fs['existsSync'](_0x15e9a5)){_0x5f20a1[_0xb184('0x5b')]['push']({'name':_0x5dd324[_0xb184('0x29')],'contentType':_0x5dd324[_0xb184('0x2e')],'data':fs['readFileSync'](_0x15e9a5)});}}}emlformat[_0xb184('0x9f')](_0x5f20a1,function(_0x45ba91,_0x3453b5){if(_0x45ba91)return _0x2a36e7(_0x45ba91);fs[_0xb184('0xa0')](path[_0xb184('0x5d')](_0x488f6c,_0x377622),_0x3453b5);return _0x6436b1(_0x3453b5);});});}})[_0xb184('0x13')](function(_0x5985bc){if(_0x5985bc){return _0x4f9751[_0xb184('0x8d')](path['join'](_0x488f6c,_0x377622),_0x377622,function(_0xb3abc8){if(!_0xb3abc8)fs[_0xb184('0xa1')](path[_0xb184('0x5d')](_0x488f6c,_0x377622));});}})[_0xb184('0x1b')](handleError(_0x4f9751,null));}; \ No newline at end of file +var _0x1cf5=['name','send','index','map','MailMessage','rawAttributes','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','rows','show','keys','length','includeAll','find','body','params','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','accept','mail','read','format','UserId','user','MailInteraction','MailInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','contact','User','download','server','tmp','message-%s.eml','from','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../mysqldb','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','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','set','Content-Range','update','destroy','status','sendStatus','stack'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x1cf5,0x1b5));var _0x51cf=function(_0x11549d,_0x2198f3){_0x11549d=_0x11549d-0x0;var _0x321cad=_0x1cf5[_0x11549d];return _0x321cad;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x51cf('0x0'));var util=require(_0x51cf('0x1'));var path=require(_0x51cf('0x2'));var fs=require('fs');var _=require(_0x51cf('0x3'));var Redis=require(_0x51cf('0x4'));var htmlToText=require(_0x51cf('0x5'));var qs=require(_0x51cf('0x6'));var logger=require('../../config/logger')(_0x51cf('0x7'));var interaction_log=require(_0x51cf('0x8'))(_0x51cf('0x9'));var config=require('../../config/environment');var db=require(_0x51cf('0xa'))['db'];config[_0x51cf('0xb')]=_['defaults'](config[_0x51cf('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x51cf('0xc'))(new Redis(config[_0x51cf('0xb')]));var htmlEntities=require(_0x51cf('0xd'));require(_0x51cf('0xe'))[_0x51cf('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0x51cf('0x10')][_0x51cf('0x11')]({'port':0x232c});var client9003=jayson[_0x51cf('0x10')][_0x51cf('0x11')]({'port':0x232b});var client9002=jayson[_0x51cf('0x10')][_0x51cf('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x5d6560,_0x37e3b5,_0x10c9eb,_0x12ddd8){return new BPromise(function(_0xded19b,_0x74da6f){var _0x5ecd96=_0x12ddd8||client;return _0x5ecd96[_0x51cf('0x12')](_0x5d6560,_0x10c9eb)[_0x51cf('0x13')](function(_0x14ff08){logger[_0x51cf('0x14')](_0x51cf('0x15'),_0x37e3b5,_0x51cf('0x16'));logger[_0x51cf('0x17')](_0x51cf('0x18'),_0x37e3b5,_0x51cf('0x16'),JSON[_0x51cf('0x19')](_0x14ff08));if(_0x14ff08[_0x51cf('0x1a')]){if(_0x14ff08[_0x51cf('0x1a')][_0x51cf('0x1b')]===0x1f4){logger[_0x51cf('0x1a')](_0x51cf('0x15'),_0x37e3b5,_0x14ff08['error'][_0x51cf('0x1c')]);return _0x74da6f(_0x14ff08[_0x51cf('0x1a')]['message']);}logger[_0x51cf('0x1a')](_0x51cf('0x15'),_0x37e3b5,_0x14ff08[_0x51cf('0x1a')]['message']);return _0xded19b(_0x14ff08['error']['message']);}else{logger[_0x51cf('0x14')](_0x51cf('0x15'),_0x37e3b5,_0x51cf('0x16'));_0xded19b(_0x14ff08[_0x51cf('0x1d')][_0x51cf('0x1c')]);}})[_0x51cf('0x1e')](function(_0xc511f9){logger[_0x51cf('0x1a')](_0x51cf('0x15'),_0x37e3b5,_0xc511f9);_0x74da6f(_0xc511f9);});});}function respondWithResult(_0x4a8a6b,_0x4c11fe){_0x4c11fe=_0x4c11fe||0xc8;return function(_0x1b4edc){if(_0x1b4edc){return _0x4a8a6b['status'](_0x4c11fe)[_0x51cf('0x1f')](_0x1b4edc);}};}function respondWithFilteredResult(_0x290733,_0x23bae4){return function(_0x3bb69a){if(_0x3bb69a){var _0x15b1dc=typeof _0x23bae4[_0x51cf('0x20')]===_0x51cf('0x21')&&typeof _0x23bae4[_0x51cf('0x22')]===_0x51cf('0x21');var _0xfec47e=_0x3bb69a[_0x51cf('0x23')];var _0x3ce499=_0x15b1dc?0x0:_0x23bae4['offset'];var _0x309fdf=_0x15b1dc?_0x3bb69a['count']:_0x23bae4[_0x51cf('0x20')]+_0x23bae4[_0x51cf('0x22')];var _0x2ea70a;if(_0x309fdf>=_0xfec47e){_0x309fdf=_0xfec47e;_0x2ea70a=0xc8;}else{_0x2ea70a=0xce;}_0x290733['status'](_0x2ea70a);return _0x290733[_0x51cf('0x24')](_0x51cf('0x25'),_0x3ce499+'-'+_0x309fdf+'/'+_0xfec47e)[_0x51cf('0x1f')](_0x3bb69a);}return null;};}function saveUpdates(_0x840677){return function(_0x2d300d){if(_0x2d300d){return _0x2d300d[_0x51cf('0x26')](_0x840677)[_0x51cf('0x13')](function(_0x17a906){return _0x17a906;});}return null;};}function removeEntity(_0xccfd29){return function(_0x1cc734){if(_0x1cc734){return _0x1cc734[_0x51cf('0x27')]()[_0x51cf('0x13')](function(){_0xccfd29[_0x51cf('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a3e85){return function(_0xdcb318){if(!_0xdcb318){_0x4a3e85[_0x51cf('0x29')](0x194);}return _0xdcb318;};}function handleError(_0x254c77,_0xf105dd){_0xf105dd=_0xf105dd||0x1f4;return function(_0x47528d){logger[_0x51cf('0x1a')](_0x47528d[_0x51cf('0x2a')]);if(_0x47528d[_0x51cf('0x2b')]){delete _0x47528d[_0x51cf('0x2b')];}_0x254c77[_0x51cf('0x28')](_0xf105dd)[_0x51cf('0x2c')](_0x47528d);};}exports[_0x51cf('0x2d')]=function(_0x2c4c87,_0x3ce88d){var _0x1e12a1={},_0x44512a={},_0x26f27d={'count':0x0,'rows':[]};var _0x5698f9=_[_0x51cf('0x2e')](db[_0x51cf('0x2f')][_0x51cf('0x30')],function(_0x3f5e3d){return{'name':_0x3f5e3d['fieldName'],'type':_0x3f5e3d['type'][_0x51cf('0x31')]};});_0x44512a[_0x51cf('0x32')]=_[_0x51cf('0x2e')](_0x5698f9,_0x51cf('0x2b'));_0x44512a[_0x51cf('0x33')]=_['keys'](_0x2c4c87[_0x51cf('0x33')]);_0x44512a[_0x51cf('0x34')]=_[_0x51cf('0x35')](_0x44512a[_0x51cf('0x32')],_0x44512a['query']);_0x1e12a1['attributes']=_[_0x51cf('0x35')](_0x44512a[_0x51cf('0x32')],qs[_0x51cf('0x36')](_0x2c4c87[_0x51cf('0x33')][_0x51cf('0x36')]));_0x1e12a1[_0x51cf('0x37')]=_0x1e12a1[_0x51cf('0x37')]['length']?_0x1e12a1[_0x51cf('0x37')]:_0x44512a[_0x51cf('0x32')];if(!_0x2c4c87[_0x51cf('0x33')][_0x51cf('0x38')]('nolimit')){_0x1e12a1[_0x51cf('0x22')]=qs[_0x51cf('0x22')](_0x2c4c87[_0x51cf('0x33')]['limit']);_0x1e12a1[_0x51cf('0x20')]=qs['offset'](_0x2c4c87[_0x51cf('0x33')][_0x51cf('0x20')]);}_0x1e12a1[_0x51cf('0x39')]=qs[_0x51cf('0x3a')](_0x2c4c87['query'][_0x51cf('0x3a')]);_0x1e12a1[_0x51cf('0x3b')]=qs['filters'](_[_0x51cf('0x3c')](_0x2c4c87[_0x51cf('0x33')],_0x44512a[_0x51cf('0x34')]),_0x5698f9);if(_0x2c4c87[_0x51cf('0x33')][_0x51cf('0x3d')]){_0x1e12a1[_0x51cf('0x3b')]=_['merge'](_0x1e12a1[_0x51cf('0x3b')],{'$or':_[_0x51cf('0x2e')](_0x5698f9,function(_0x5211c3){if(_0x5211c3[_0x51cf('0x3e')]!==_0x51cf('0x3f')){var _0x46089b={};_0x46089b[_0x5211c3[_0x51cf('0x2b')]]={'$like':'%'+_0x2c4c87[_0x51cf('0x33')][_0x51cf('0x3d')]+'%'};return _0x46089b;}})});}_0x1e12a1=_[_0x51cf('0x40')]({},_0x1e12a1,_0x2c4c87[_0x51cf('0x41')]);var _0x4fd76d={'where':_0x1e12a1[_0x51cf('0x3b')]};return db[_0x51cf('0x2f')][_0x51cf('0x23')](_0x4fd76d)[_0x51cf('0x13')](function(_0x4bf6d4){_0x26f27d['count']=_0x4bf6d4;if(_0x2c4c87[_0x51cf('0x33')]['includeAll']){_0x1e12a1[_0x51cf('0x42')]=[{'all':!![]}];}return db[_0x51cf('0x2f')]['findAll'](_0x1e12a1);})[_0x51cf('0x13')](function(_0x562389){_0x26f27d[_0x51cf('0x43')]=_0x562389;return _0x26f27d;})[_0x51cf('0x13')](respondWithFilteredResult(_0x3ce88d,_0x1e12a1))[_0x51cf('0x1e')](handleError(_0x3ce88d,null));};exports[_0x51cf('0x44')]=function(_0x1b8ff6,_0x354c09){var _0x160538={'raw':!![],'where':{'id':_0x1b8ff6['params']['id']}},_0x150eae={};_0x150eae['model']=_[_0x51cf('0x45')](db[_0x51cf('0x2f')]['rawAttributes']);_0x150eae[_0x51cf('0x33')]=_[_0x51cf('0x45')](_0x1b8ff6[_0x51cf('0x33')]);_0x150eae[_0x51cf('0x34')]=_[_0x51cf('0x35')](_0x150eae['model'],_0x150eae['query']);_0x160538[_0x51cf('0x37')]=_[_0x51cf('0x35')](_0x150eae['model'],qs[_0x51cf('0x36')](_0x1b8ff6['query'][_0x51cf('0x36')]));_0x160538['attributes']=_0x160538[_0x51cf('0x37')][_0x51cf('0x46')]?_0x160538[_0x51cf('0x37')]:_0x150eae[_0x51cf('0x32')];if(_0x1b8ff6[_0x51cf('0x33')][_0x51cf('0x47')]){_0x160538['include']=[{'all':!![]}];}_0x160538=_[_0x51cf('0x40')]({},_0x160538,_0x1b8ff6[_0x51cf('0x41')]);return db[_0x51cf('0x2f')][_0x51cf('0x48')](_0x160538)[_0x51cf('0x13')](handleEntityNotFound(_0x354c09,null))[_0x51cf('0x13')](respondWithResult(_0x354c09,null))[_0x51cf('0x1e')](handleError(_0x354c09,null));};exports[_0x51cf('0x26')]=function(_0x3be7b5,_0x34527f){if(_0x3be7b5[_0x51cf('0x49')]['id']){delete _0x3be7b5[_0x51cf('0x49')]['id'];}return db[_0x51cf('0x2f')][_0x51cf('0x48')]({'where':{'id':_0x3be7b5[_0x51cf('0x4a')]['id']}})[_0x51cf('0x13')](handleEntityNotFound(_0x34527f,null))['then'](saveUpdates(_0x3be7b5[_0x51cf('0x49')],null))[_0x51cf('0x13')](respondWithResult(_0x34527f,null))[_0x51cf('0x1e')](handleError(_0x34527f,null));};exports['destroy']=function(_0xf8858e,_0xf7b9d0){return db[_0x51cf('0x2f')][_0x51cf('0x48')]({'where':{'id':_0xf8858e[_0x51cf('0x4a')]['id']}})[_0x51cf('0x13')](handleEntityNotFound(_0xf7b9d0,null))[_0x51cf('0x13')](removeEntity(_0xf7b9d0,null))['catch'](handleError(_0xf7b9d0,null));};exports[_0x51cf('0x4b')]=function(_0x3c90fc,_0x14d994){return db[_0x51cf('0x2f')][_0x51cf('0x4b')]()[_0x51cf('0x13')](respondWithResult(_0x14d994,null))[_0x51cf('0x1e')](handleError(_0x14d994,null));};exports['create']=function(_0xe02586,_0x2ef059){return db[_0x51cf('0x2f')][_0x51cf('0x4c')](_0xe02586[_0x51cf('0x49')])[_0x51cf('0x13')](function(_0x260e0f){if(_0x260e0f){if(_0x260e0f[_0x51cf('0x4d')]===_0x51cf('0x4e')&&!_0x260e0f['secret']){var _0x518793,_0x48c578,_0x4a3780;if(_0xe02586[_0x51cf('0x49')]['to']){_0x48c578=_0xe02586[_0x51cf('0x49')]['to'][_0x51cf('0x4f')](',')[0x0];}return db[_0x51cf('0x50')][_0x51cf('0x51')]({'where':{'id':_0x260e0f[_0x51cf('0x52')]},'include':[{'model':db[_0x51cf('0x53')],'as':_0x51cf('0x54'),'include':[{'model':db['CmContact'],'as':_0x51cf('0x55'),'where':{'email':_0x48c578},'limit':0x1,'order':[[_0x51cf('0x56'),_0x51cf('0x57')]]}]},{'model':db[_0x51cf('0x58')],'as':_0x51cf('0x59'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x51cf('0x5a'),'raw':!![]}]}]})[_0x51cf('0x13')](function(_0x74c1dd){_0x518793=_0x74c1dd;if(!_0x518793||!_0x518793[_0x51cf('0x59')])return;var _0x53e96b=_0x518793[_0x51cf('0x5b')]();if(_0xe02586[_0x51cf('0x49')][_0x51cf('0x5c')]&&_0xe02586[_0x51cf('0x49')][_0x51cf('0x5c')][_0x51cf('0x46')]){for(var _0x1c0220=0x0;_0x1c0220<_0xe02586['body'][_0x51cf('0x5c')][_0x51cf('0x46')];_0x1c0220+=0x1){_0xe02586[_0x51cf('0x49')]['attachments'][_0x1c0220]={'filename':_0xe02586[_0x51cf('0x49')][_0x51cf('0x5c')][_0x1c0220]['name'],'path':path[_0x51cf('0x5d')](config[_0x51cf('0x5e')],_0x51cf('0x5f'),_0xe02586[_0x51cf('0x49')][_0x51cf('0x5c')][_0x1c0220][_0x51cf('0x60')])};}}_0x4a3780={'account':_0x53e96b,'message':_0xe02586[_0x51cf('0x49')]};return;})[_0x51cf('0x13')](function(){if(_0x518793[_0x51cf('0x54')]){if(_0x518793[_0x51cf('0x54')][_0x51cf('0x55')][_0x51cf('0x46')]){return _0x518793[_0x51cf('0x54')][_0x51cf('0x55')][0x0];}else{return db[_0x51cf('0x61')][_0x51cf('0x4c')](_[_0x51cf('0x62')](_0xe02586['body'],{'firstName':_0xe02586['body']['to'],'email':_0xe02586['body']['to'],'phone':_0xe02586[_0x51cf('0x49')]['to'],'ListId':_0x518793[_0x51cf('0x63')]}));}}else{throw new Error(_0x51cf('0x64'));}})[_0x51cf('0x13')](function(){if(_0x4a3780){return respondWithRpcPromise(_0x51cf('0x65'),_0x51cf('0x66'),_0x4a3780,client9003)[_0x51cf('0x13')](function(_0x4ebbc2){return _0x260e0f[_0x51cf('0x26')]({'read':!![],'messageId':_0x4ebbc2[_0x51cf('0x67')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x51cf('0x1e')](function(_0x23a13e){logger['error']('%s',JSON[_0x51cf('0x19')](_0x23a13e));return _0x260e0f;});}return _0x260e0f;});}return _0x260e0f;}})[_0x51cf('0x13')](respondWithResult(_0x2ef059,0xc9))[_0x51cf('0x1e')](handleError(_0x2ef059,null));};exports[_0x51cf('0x68')]=function(_0x1173e2,_0x1425d0){var _0x7e87b1={'agent':{},'channel':_0x51cf('0x69')};if(_0x1173e2[_0x51cf('0x49')]['id']){delete _0x1173e2[_0x51cf('0x49')]['id'];}_0x1173e2[_0x51cf('0x49')][_0x51cf('0x6a')]=!![];_0x1173e2[_0x51cf('0x49')]['readAt']=moment()[_0x51cf('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');_0x1173e2[_0x51cf('0x49')][_0x51cf('0x6c')]=_0x1173e2[_0x51cf('0x49')]['UserId']||_0x1173e2[_0x51cf('0x6d')]['id'];_0x7e87b1['agent']['id']=_0x1173e2[_0x51cf('0x49')][_0x51cf('0x6c')];return db['MailMessage'][_0x51cf('0x48')]({'where':{'id':_0x1173e2['params']['id'],'UserId':null}})[_0x51cf('0x13')](handleEntityNotFound(_0x1425d0,null))[_0x51cf('0x13')](saveUpdates(_0x1173e2[_0x51cf('0x49')],null))[_0x51cf('0x13')](function(_0x4a5320){if(_0x4a5320){_0x7e87b1[_0x51cf('0x1c')]=_0x4a5320['get']({'plain':!![]});return db[_0x51cf('0x6e')][_0x51cf('0x48')]({'where':{'id':_0x4a5320[_0x51cf('0x6f')]}});}return null;})[_0x51cf('0x13')](handleEntityNotFound(_0x1425d0,null))[_0x51cf('0x13')](function(_0x332421){if(_0x332421){return _0x332421['update']({'UserId':_0x1173e2[_0x51cf('0x49')][_0x51cf('0x6c')],'read1stAt':_[_0x51cf('0x70')](_0x332421['read1stAt'])?moment()[_0x51cf('0x6b')](_0x51cf('0x71')):undefined});}return null;})[_0x51cf('0x13')](function(_0x5eed7b){if(_0x5eed7b){_0x7e87b1[_0x51cf('0x72')]=_0x5eed7b[_0x51cf('0x73')]({'plain':!![]});interaction_log[_0x51cf('0x14')](_0x51cf('0x74'),_0x1173e2[_0x51cf('0x6d')]['id'],_0x1173e2[_0x51cf('0x6d')][_0x51cf('0x2b')],_0x1173e2[_0x51cf('0x6d')]['role'],_0x7e87b1[_0x51cf('0x72')]['id'],_0x1173e2['body']?JSON[_0x51cf('0x19')](_0x1173e2['body']):_0x51cf('0x75'));return respondWithRpcPromise(_0x51cf('0x76'),_0x51cf('0x77'),_0x7e87b1);}return null;})[_0x51cf('0x13')](function(_0x141469){var _0x5c57a5=_0x51cf('0x78')+_0x141469[_0x51cf('0x1c')]['ContactId'];return db[_0x51cf('0x79')][_0x51cf('0x33')](_0x5c57a5,{'type':db[_0x51cf('0x7a')][_0x51cf('0x7b')][_0x51cf('0x7c')],'raw':!![]})[_0x51cf('0x13')](function(_0xe16a69){return _0xe16a69;});})[_0x51cf('0x13')](function(_0x4742d0){if(_0x4742d0){_0x7e87b1[_0x51cf('0x1c')]['contact']=_0x4742d0[0x0];if(!_0x1173e2[_0x51cf('0x49')][_0x51cf('0x6c')])return;return db['User'][_0x51cf('0x48')]({'where':{'id':_0x1173e2['body'][_0x51cf('0x6c')],'role':_0x51cf('0x7d')},'attributes':['id',_0x51cf('0x2b'),_0x51cf('0x7e'),'email',_0x51cf('0x7f')],'raw':!![]});}return null;})[_0x51cf('0x13')](function(_0x40ce0f){if(!_0x40ce0f)return null;_0x7e87b1['message'][_0x51cf('0x7d')]=_0x40ce0f;return _0x7e87b1;})[_0x51cf('0x13')](function(_0x559344){if(_0x559344){if(_0x1173e2[_0x51cf('0x49')][_0x51cf('0x80')]){_0x7e87b1[_0x51cf('0x1c')][_0x51cf('0x81')]=util['format'](_0x51cf('0x82'),_0x1173e2['user'][_0x51cf('0x2b')]);_0x7e87b1[_0x51cf('0x1c')][_0x51cf('0x83')]=_0x7e87b1[_0x51cf('0x83')];_0x7e87b1[_0x51cf('0x1c')]['motionChannel']=_0x7e87b1[_0x51cf('0x83')];_0x7e87b1[_0x51cf('0x1c')][_0x51cf('0x84')]='accept';_0x7e87b1[_0x51cf('0x1c')][_0x51cf('0x49')]=htmlToText[_0x51cf('0x85')](_0x7e87b1[_0x51cf('0x1c')][_0x51cf('0x49')]);return respondWithRpcPromise(_0x51cf('0x86'),_0x51cf('0x86'),{'event':_0x51cf('0x87'),'message':_0x7e87b1['message']},client9002)['then'](function(){return _0x7e87b1;});}return _0x7e87b1;}return null;})['then'](respondWithResult(_0x1425d0,null))['catch'](handleError(_0x1425d0,null));};exports[_0x51cf('0x88')]=function(_0x2f4c21,_0x121b9){var _0x2050bf={'agent':{},'channel':'mail'};if(_0x2f4c21[_0x51cf('0x49')]['id']){delete _0x2f4c21[_0x51cf('0x49')]['id'];}_0x2f4c21['body'][_0x51cf('0x6c')]=_0x2f4c21['body'][_0x51cf('0x6c')]||_0x2f4c21[_0x51cf('0x6d')]['id'];_0x2050bf[_0x51cf('0x7d')]['id']=_0x2f4c21[_0x51cf('0x49')][_0x51cf('0x6c')];return db[_0x51cf('0x2f')][_0x51cf('0x48')]({'where':{'id':_0x2f4c21['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x121b9,null))[_0x51cf('0x13')](function(_0x556d1e){if(_0x556d1e){_0x2050bf[_0x51cf('0x1c')]=_0x556d1e[_0x51cf('0x73')]({'plain':!![]});return db['MailInteraction'][_0x51cf('0x48')]({'where':{'id':_0x556d1e['MailInteractionId']}});}return null;})[_0x51cf('0x13')](handleEntityNotFound(_0x121b9,null))[_0x51cf('0x13')](function(_0x19c1c3){if(_0x19c1c3){_0x2050bf[_0x51cf('0x72')]=_0x19c1c3[_0x51cf('0x73')]({'plain':!![]});interaction_log[_0x51cf('0x14')](_0x51cf('0x89'),_0x2f4c21[_0x51cf('0x6d')]['id'],_0x2f4c21['user'][_0x51cf('0x2b')],_0x2f4c21[_0x51cf('0x6d')][_0x51cf('0x8a')],_0x2050bf[_0x51cf('0x72')]['id'],_0x2f4c21['body']?JSON[_0x51cf('0x19')](_0x2f4c21[_0x51cf('0x49')]):_0x51cf('0x75'));return respondWithRpcPromise(_0x51cf('0x8b'),'rejectMessage',_0x2050bf);}return null;})[_0x51cf('0x13')](function(_0x8c126c){var _0x184e13='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x8c126c[_0x51cf('0x1c')][_0x51cf('0x8c')];return db['sequelize'][_0x51cf('0x33')](_0x184e13,{'type':db[_0x51cf('0x7a')]['QueryTypes'][_0x51cf('0x7c')],'raw':!![]})[_0x51cf('0x13')](function(_0x24764e){return _0x24764e;});})[_0x51cf('0x13')](function(_0x24e4c2){if(_0x24e4c2){_0x2050bf[_0x51cf('0x1c')][_0x51cf('0x8d')]=_0x24e4c2[0x0];if(!_0x2f4c21[_0x51cf('0x49')][_0x51cf('0x6c')])return;return db[_0x51cf('0x8e')][_0x51cf('0x48')]({'where':{'id':_0x2f4c21[_0x51cf('0x49')]['UserId'],'role':_0x51cf('0x7d')},'attributes':['id',_0x51cf('0x2b'),_0x51cf('0x7e'),'email','internal'],'raw':!![]});}return null;})[_0x51cf('0x13')](function(_0x3af972){if(!_0x3af972)return null;_0x2050bf[_0x51cf('0x1c')][_0x51cf('0x7d')]=_0x3af972;return _0x2050bf;})[_0x51cf('0x13')](function(_0x53861a){if(_0x53861a){_0x53861a['message'][_0x51cf('0x81')]=util[_0x51cf('0x6b')](_0x51cf('0x82'),_0x2f4c21[_0x51cf('0x6d')][_0x51cf('0x2b')]);_0x53861a[_0x51cf('0x1c')][_0x51cf('0x83')]=_0x2050bf['channel'];_0x53861a[_0x51cf('0x1c')]['motionChannel']=_0x2050bf[_0x51cf('0x83')];_0x53861a['message'][_0x51cf('0x84')]=_0x51cf('0x88');_0x53861a[_0x51cf('0x1c')][_0x51cf('0x49')]=htmlToText[_0x51cf('0x85')](_0x2050bf[_0x51cf('0x1c')][_0x51cf('0x49')]);respondWithRpcPromise(_0x51cf('0x86'),_0x51cf('0x86'),{'event':'rejectmessage','message':_0x53861a[_0x51cf('0x1c')]},client9002);return _0x2050bf;}return null;})[_0x51cf('0x13')](respondWithResult(_0x121b9,null))[_0x51cf('0x1e')](handleError(_0x121b9,null));};exports[_0x51cf('0x8f')]=function(_0x4b6e94,_0x3c498c){var _0x5e0bf0=moment()['unix']()['toString']();var _0x1f3e51=path[_0x51cf('0x5d')](config[_0x51cf('0x5e')],_0x51cf('0x90'),'files',_0x51cf('0x91'));var _0x2d7550=path[_0x51cf('0x5d')](config[_0x51cf('0x5e')],_0x51cf('0x90'),'files',_0x51cf('0x5c'));var _0x55dd0f=util[_0x51cf('0x6b')](_0x51cf('0x92'),_0x5e0bf0);return db[_0x51cf('0x2f')][_0x51cf('0x48')]({'where':{'id':_0x4b6e94[_0x51cf('0x4a')]['id']},'attributes':['id',_0x51cf('0x49'),_0x51cf('0x93'),'to','cc','bcc',_0x51cf('0x94'),_0x51cf('0x95')],'include':_0x4b6e94['query'][_0x51cf('0x5c')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x3c498c,null))[_0x51cf('0x13')](function(_0x3fba30){if(_0x3fba30){var _0x4592b3=_0x3fba30;var _0xf53c36={'from':_0x4592b3[_0x51cf('0x93')],'to':_0x4592b3['to'],'subject':_0x4592b3[_0x51cf('0x94')],'html':htmlEntities['decode'](_0x4592b3[_0x51cf('0x49')]),'headers':{'Date':moment(_0x4592b3[_0x51cf('0x95')])[_0x51cf('0x6b')](_0x51cf('0x96'))},'attachments':[]};if(_0x3fba30['cc']){_0xf53c36['headers']['Cc']=_0x3fba30['cc'];}if(_0x3fba30[_0x51cf('0x97')]){_0xf53c36[_0x51cf('0x98')]['Bcc']=_0x3fba30[_0x51cf('0x97')];}return new BPromise(function(_0x4fa28f,_0x4ffe53){if(_0x3fba30[_0x51cf('0x99')]){for(var _0xb55c33=0x0;_0xb55c33<_0x3fba30[_0x51cf('0x99')][_0x51cf('0x46')];_0xb55c33++){var _0x14e880=_0x3fba30[_0x51cf('0x99')][_0xb55c33];var _0x15c1ef=path[_0x51cf('0x5d')](_0x2d7550,_0x14e880[_0x51cf('0x60')]);if(fs[_0x51cf('0x9a')](_0x15c1ef)){_0xf53c36[_0x51cf('0x5c')][_0x51cf('0x9b')]({'name':_0x14e880[_0x51cf('0x2b')],'contentType':_0x14e880[_0x51cf('0x3e')],'data':fs[_0x51cf('0x9c')](_0x15c1ef)});}}}emlformat[_0x51cf('0x9d')](_0xf53c36,function(_0x141ffc,_0x5417b1){if(_0x141ffc)return _0x4ffe53(_0x141ffc);fs[_0x51cf('0x9e')](path[_0x51cf('0x5d')](_0x1f3e51,_0x55dd0f),_0x5417b1);return _0x4fa28f(_0x5417b1);});});}})[_0x51cf('0x13')](function(_0x2001aa){if(_0x2001aa){return _0x3c498c['download'](path['join'](_0x1f3e51,_0x55dd0f),_0x55dd0f,function(_0xa5be2f){if(!_0xa5be2f)fs[_0x51cf('0x9f')](path[_0x51cf('0x5d')](_0x1f3e51,_0x55dd0f));});}})[_0x51cf('0x1e')](handleError(_0x3c498c,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1997f4f..2b61d1c 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 _0x8bea=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage'];(function(_0x2a638c,_0x4689ca){var _0x11876d=function(_0x359645){while(--_0x359645){_0x2a638c['push'](_0x2a638c['shift']());}};_0x11876d(++_0x4689ca);}(_0x8bea,0x170));var _0xa8be=function(_0x28118a,_0x15fcdc){_0x28118a=_0x28118a-0x0;var _0x4ec102=_0x8bea[_0x28118a];return _0x4ec102;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xa8be('0x0'))['db'][_0xa8be('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xa8be('0x2')](0x0);var events={'afterCreate':_0xa8be('0x3'),'afterUpdate':_0xa8be('0x4'),'afterDestroy':_0xa8be('0x5')};function emitEvent(_0x264345){return function(_0x27d093,_0x43fd9b,_0x5d426d){MailMessageEvents[_0xa8be('0x6')](_0x264345+':'+_0x27d093['id'],_0x27d093);MailMessageEvents[_0xa8be('0x6')](_0x264345,_0x27d093);_0x5d426d(null);};}for(var e in events){if(events[_0xa8be('0x7')](e)){var event=events[e];MailMessage[_0xa8be('0x8')](e,emitEvent(event));}}module[_0xa8be('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x1bcc=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x1e40e9,_0x16cc7a){var _0x3d3cbc=function(_0x51019e){while(--_0x51019e){_0x1e40e9['push'](_0x1e40e9['shift']());}};_0x3d3cbc(++_0x16cc7a);}(_0x1bcc,0x195));var _0xc1bc=function(_0x586837,_0x4f9ed1){_0x586837=_0x586837-0x0;var _0xea18c3=_0x1bcc[_0x586837];return _0xea18c3;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xc1bc('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc1bc('0x1'),'afterUpdate':_0xc1bc('0x2'),'afterDestroy':_0xc1bc('0x3')};function emitEvent(_0xf79d21){return function(_0x14c26e,_0x1c3559,_0x149b9f){MailMessageEvents[_0xc1bc('0x4')](_0xf79d21+':'+_0x14c26e['id'],_0x14c26e);MailMessageEvents[_0xc1bc('0x4')](_0xf79d21,_0x14c26e);_0x149b9f(null);};}for(var e in events){if(events[_0xc1bc('0x5')](e)){var event=events[e];MailMessage[_0xc1bc('0x6')](e,emitEvent(event));}}module[_0xc1bc('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index f4bf418..19a4a2a 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 _0x5db0=['html-to-text','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','isNil','MailInteraction','MailInteractionId','update','createdAt','catch','error','lodash','util','../../config/logger','moment','request-promise'];(function(_0x56418e,_0x362812){var _0x5b160c=function(_0x5b44cb){while(--_0x5b44cb){_0x56418e['push'](_0x56418e['shift']());}};_0x5b160c(++_0x362812);}(_0x5db0,0x113));var _0x05db=function(_0x5ccb9d,_0x4db883){_0x5ccb9d=_0x5ccb9d-0x0;var _0x223f33=_0x5db0[_0x5ccb9d];return _0x223f33;};'use strict';var _=require(_0x05db('0x0'));var util=require(_0x05db('0x1'));var logger=require(_0x05db('0x2'))('api');var moment=require(_0x05db('0x3'));var BPromise=require('bluebird');var rp=require(_0x05db('0x4'));var htmlToText=require(_0x05db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05db('0x6'));var config=require(_0x05db('0x7'));var attributes=require(_0x05db('0x8'));module['exports']=function(_0x13c17b,_0x13919c){return _0x13c17b['define'](_0x05db('0x9'),attributes,{'tableName':_0x05db('0xa'),'paranoid':![],'indexes':[{'name':_0x05db('0xb'),'fields':[_0x05db('0xb')]},{'name':_0x05db('0xc'),'fields':[_0x05db('0xd'),_0x05db('0xe')],'type':_0x05db('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x46810a,_0x1d2ba4,_0x5d3065){if(_0x46810a['body']){_0x46810a[_0x05db('0xd')]=htmlToText['fromString'](_0x46810a[_0x05db('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5d3065(null,_0x1d2ba4);},'afterCreate':function(_0x5f3d4f,_0x179960,_0x4793cb){var _0xe37ac7=_0x13c17b['models'];var _0x2d7568=_0x5f3d4f[_0x05db('0x11')]({'plain':!![]});if(_0x2d7568[_0x05db('0x12')][_0x05db('0x13')]()==='in'||_0x2d7568[_0x05db('0x12')]['toLowerCase']()===_0x05db('0x14')&&!_0x2d7568['secret']&&!_[_0x05db('0x15')](_0x2d7568['UserId'])){_0xe37ac7[_0x05db('0x16')]['findOne']({'where':{'id':_0x2d7568[_0x05db('0x17')]}})['then'](function(_0x7de726){if(_0x7de726){_0x7de726[_0x05db('0x18')]({'lastMsgAt':_0x2d7568[_0x05db('0x19')],'lastMsgDirection':_0x2d7568[_0x05db('0x12')][_0x05db('0x13')]()});}})[_0x05db('0x1a')](function(_0x398f6a){console[_0x05db('0x1b')](_0x398f6a);});}_0x4793cb();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0eea=['html-to-text','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','direction','toLowerCase','isNil','UserId','MailInteraction','findOne','MailInteractionId','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise'];(function(_0x15f626,_0x5a77bc){var _0x135c68=function(_0x45e374){while(--_0x45e374){_0x15f626['push'](_0x15f626['shift']());}};_0x135c68(++_0x5a77bc);}(_0x0eea,0x114));var _0xa0ee=function(_0x32cdfc,_0x3d79bf){_0x32cdfc=_0x32cdfc-0x0;var _0x2e79b0=_0x0eea[_0x32cdfc];return _0x2e79b0;};'use strict';var _=require(_0xa0ee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa0ee('0x1'));var moment=require(_0xa0ee('0x2'));var BPromise=require('bluebird');var rp=require(_0xa0ee('0x3'));var htmlToText=require(_0xa0ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0ee('0x5'));var config=require(_0xa0ee('0x6'));var attributes=require(_0xa0ee('0x7'));module['exports']=function(_0xd8d902,_0x49894e){return _0xd8d902[_0xa0ee('0x8')](_0xa0ee('0x9'),attributes,{'tableName':_0xa0ee('0xa'),'paranoid':![],'indexes':[{'name':_0xa0ee('0xb'),'fields':[_0xa0ee('0xb')]},{'name':_0xa0ee('0xc'),'fields':[_0xa0ee('0xd'),'subject'],'type':_0xa0ee('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1cc27d,_0x423532,_0x333277){if(_0x1cc27d['body']){_0x1cc27d[_0xa0ee('0xd')]=htmlToText['fromString'](_0x1cc27d[_0xa0ee('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x333277(null,_0x423532);},'afterCreate':function(_0x5edb5f,_0x50baa2,_0x35c0c2){var _0x1c1fab=_0xd8d902[_0xa0ee('0x10')];var _0x12ba97=_0x5edb5f['get']({'plain':!![]});if(_0x12ba97[_0xa0ee('0x11')][_0xa0ee('0x12')]()==='in'||_0x12ba97[_0xa0ee('0x11')][_0xa0ee('0x12')]()==='out'&&!_0x12ba97['secret']&&!_[_0xa0ee('0x13')](_0x12ba97[_0xa0ee('0x14')])){_0x1c1fab[_0xa0ee('0x15')][_0xa0ee('0x16')]({'where':{'id':_0x12ba97[_0xa0ee('0x17')]}})['then'](function(_0x422d63){if(_0x422d63){_0x422d63['update']({'lastMsgAt':_0x12ba97[_0xa0ee('0x18')],'lastMsgDirection':_0x12ba97[_0xa0ee('0x11')][_0xa0ee('0x12')]()});}})['catch'](function(_0x36ffa0){console[_0xa0ee('0x19')](_0x36ffa0);});}_0x35c0c2();}},'charset':_0xa0ee('0x1a'),'collate':_0xa0ee('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0f2ae54..14b9a12 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 _0xe2cf=['MailMessage,\x20%s,\x20%s','request\x20sent','error','message','result','CreateMailMessage','MailMessage','create','options','debug','stringify','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','request','then','info'];(function(_0x439f26,_0x21396a){var _0x21957e=function(_0x280d76){while(--_0x280d76){_0x439f26['push'](_0x439f26['shift']());}};_0x21957e(++_0x21396a);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x51eb91,_0x4799d5){_0x51eb91=_0x51eb91-0x0;var _0x1c4fc4=_0xe2cf[_0x51eb91];return _0x1c4fc4;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xfe2c('0x8')]=_[_0xfe2c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe2c('0xa'))(new Redis(config[_0xfe2c('0x8')]));require(_0xfe2c('0xb'))['register'](socket);function respondWithRpcPromise(_0x5b616c,_0x396912,_0x15421e){return new BPromise(function(_0x495513,_0x22278c){return client[_0xfe2c('0xc')](_0x5b616c,_0x15421e)[_0xfe2c('0xd')](function(_0xa176e9){logger[_0xfe2c('0xe')](_0xfe2c('0xf'),_0x396912,_0xfe2c('0x10'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x396912,'request\x20sent',JSON['stringify'](_0xa176e9));if(_0xa176e9[_0xfe2c('0x11')]){if(_0xa176e9['error']['code']===0x1f4){logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0xa176e9[_0xfe2c('0x11')][_0xfe2c('0x12')]);return _0x22278c(_0xa176e9['error']['message']);}logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0xa176e9[_0xfe2c('0x11')][_0xfe2c('0x12')]);return _0x495513(_0xa176e9['error'][_0xfe2c('0x12')]);}else{logger[_0xfe2c('0xe')](_0xfe2c('0xf'),_0x396912,_0xfe2c('0x10'));_0x495513(_0xa176e9[_0xfe2c('0x13')][_0xfe2c('0x12')]);}})['catch'](function(_0x22481a){logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0x22481a);_0x22278c(_0x22481a);});});}exports[_0xfe2c('0x14')]=function(_0x55f751){var _0x1139fe=this;return new Promise(function(_0x59bdeb,_0x4e9137){return db[_0xfe2c('0x15')][_0xfe2c('0x16')](_0x55f751['body'],{'raw':_0x55f751[_0xfe2c('0x17')]?_0x55f751[_0xfe2c('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xfe2c('0xd')](function(_0x5dd54b){logger[_0xfe2c('0xe')](_0xfe2c('0x14'),_0x55f751);logger[_0xfe2c('0x18')](_0xfe2c('0x14'),_0x55f751,JSON[_0xfe2c('0x19')](_0x5dd54b));_0x59bdeb(_0x5dd54b);})[_0xfe2c('0x1a')](function(_0x57cd6d){logger[_0xfe2c('0x11')](_0xfe2c('0x14'),_0x57cd6d[_0xfe2c('0x12')],_0x55f751);_0x4e9137(_0x1139fe[_0xfe2c('0x11')](0x1f4,_0x57cd6d[_0xfe2c('0x12')]));});});}; \ No newline at end of file +var _0x28f2=['CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3357bc,_0x44acd2){var _0x57b5a9=function(_0x29a8bf){while(--_0x29a8bf){_0x3357bc['push'](_0x3357bc['shift']());}};_0x57b5a9(++_0x44acd2);}(_0x28f2,0x193));var _0x228f=function(_0x5db433,_0x8118b4){_0x5db433=_0x5db433-0x0;var _0x332b9a=_0x28f2[_0x5db433];return _0x332b9a;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var moment=require(_0x228f('0x2'));var BPromise=require(_0x228f('0x3'));var rs=require(_0x228f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x228f('0x5'))['db'];var utils=require(_0x228f('0x6'));var logger=require(_0x228f('0x7'))(_0x228f('0x8'));var config=require(_0x228f('0x9'));var jayson=require(_0x228f('0xa'));var client=jayson[_0x228f('0xb')]['http']({'port':0x232a});config[_0x228f('0xc')]=_['defaults'](config[_0x228f('0xc')],{'host':_0x228f('0xd'),'port':0x18eb});var socket=require(_0x228f('0xe'))(new Redis(config['redis']));require(_0x228f('0xf'))['register'](socket);function respondWithRpcPromise(_0x212c90,_0x2dfd07,_0x4e26fe){return new BPromise(function(_0x3884c6,_0x40aca5){return client[_0x228f('0x10')](_0x212c90,_0x4e26fe)[_0x228f('0x11')](function(_0x3aa9bf){logger['info'](_0x228f('0x12'),_0x2dfd07,_0x228f('0x13'));logger[_0x228f('0x14')](_0x228f('0x15'),_0x2dfd07,_0x228f('0x13'),JSON[_0x228f('0x16')](_0x3aa9bf));if(_0x3aa9bf[_0x228f('0x17')]){if(_0x3aa9bf[_0x228f('0x17')]['code']===0x1f4){logger[_0x228f('0x17')](_0x228f('0x12'),_0x2dfd07,_0x3aa9bf[_0x228f('0x17')][_0x228f('0x18')]);return _0x40aca5(_0x3aa9bf[_0x228f('0x17')][_0x228f('0x18')]);}logger[_0x228f('0x17')]('MailMessage,\x20%s,\x20%s',_0x2dfd07,_0x3aa9bf[_0x228f('0x17')]['message']);return _0x3884c6(_0x3aa9bf[_0x228f('0x17')][_0x228f('0x18')]);}else{logger[_0x228f('0x19')]('MailMessage,\x20%s,\x20%s',_0x2dfd07,_0x228f('0x13'));_0x3884c6(_0x3aa9bf['result'][_0x228f('0x18')]);}})['catch'](function(_0x30cbc2){logger['error']('MailMessage,\x20%s,\x20%s',_0x2dfd07,_0x30cbc2);_0x40aca5(_0x30cbc2);});});}exports[_0x228f('0x1a')]=function(_0x52da36){var _0x302d54=this;return new Promise(function(_0x139373,_0x1294a8){return db[_0x228f('0x1b')][_0x228f('0x1c')](_0x52da36[_0x228f('0x1d')],{'raw':_0x52da36[_0x228f('0x1e')]?_0x52da36[_0x228f('0x1e')][_0x228f('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1e96d4){logger[_0x228f('0x19')](_0x228f('0x1a'),_0x52da36);logger[_0x228f('0x14')](_0x228f('0x1a'),_0x52da36,JSON[_0x228f('0x16')](_0x1e96d4));_0x139373(_0x1e96d4);})[_0x228f('0x20')](function(_0x20c111){logger[_0x228f('0x17')]('CreateMailMessage',_0x20c111[_0x228f('0x18')],_0x52da36);_0x1294a8(_0x302d54[_0x228f('0x17')](0x1f4,_0x20c111[_0x228f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 29841ca..2b50e7f 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 _0x4351=['register','length','mailMessage:','./mailMessage.events','remove','update','emit'];(function(_0x1e34be,_0x165d8a){var _0x2957ff=function(_0x5b5fe9){while(--_0x5b5fe9){_0x1e34be['push'](_0x1e34be['shift']());}};_0x2957ff(++_0x165d8a);}(_0x4351,0xb2));var _0x1435=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4351[_0x3bf83f];return _0x22c4a9;};'use strict';var MailMessageEvents=require(_0x1435('0x0'));var events=['save',_0x1435('0x1'),_0x1435('0x2')];function createListener(_0x3a1614,_0x299cfa){return function(_0x59541b){_0x299cfa[_0x1435('0x3')](_0x3a1614,_0x59541b);};}function removeListener(_0x346b57,_0x414cda){return function(){MailMessageEvents['removeListener'](_0x346b57,_0x414cda);};}exports[_0x1435('0x4')]=function(_0x5a6ff0){for(var _0x775411=0x0,_0x29c0ab=events[_0x1435('0x5')];_0x775411<_0x29c0ab;_0x775411++){var _0x1ab498=events[_0x775411];var _0x24059b=createListener(_0x1435('0x6')+_0x1ab498,_0x5a6ff0);MailMessageEvents['on'](_0x1ab498,_0x24059b);}}; \ No newline at end of file +var _0x1b58=['mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x16c90e,_0x5caf28){var _0x40057a=function(_0x24f044){while(--_0x24f044){_0x16c90e['push'](_0x16c90e['shift']());}};_0x40057a(++_0x5caf28);}(_0x1b58,0x184));var _0x81b5=function(_0x4d51f2,_0x458975){_0x4d51f2=_0x4d51f2-0x0;var _0x12e628=_0x1b58[_0x4d51f2];return _0x12e628;};'use strict';var MailMessageEvents=require(_0x81b5('0x0'));var events=[_0x81b5('0x1'),_0x81b5('0x2'),_0x81b5('0x3')];function createListener(_0x151074,_0x15d05e){return function(_0x343b51){_0x15d05e[_0x81b5('0x4')](_0x151074,_0x343b51);};}function removeListener(_0x1bc460,_0x4bfc0a){return function(){MailMessageEvents[_0x81b5('0x5')](_0x1bc460,_0x4bfc0a);};}exports[_0x81b5('0x6')]=function(_0x218dab){for(var _0x716a7=0x0,_0x1d48f3=events[_0x81b5('0x7')];_0x716a7<_0x1d48f3;_0x716a7++){var _0x35317b=events[_0x716a7];var _0x39b6be=createListener(_0x81b5('0x8')+_0x35317b,_0x218dab);MailMessageEvents['on'](_0x35317b,_0x39b6be);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index f9cffcd..cf3af3b 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 _0x0e57=['/:id/users','getAgents','post','create','addTeams','update','delete','destroy','removeTeams','removeAgents','util','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x292abe,_0x541ad7){var _0x4ef3c6=function(_0x4a4d7c){while(--_0x4a4d7c){_0x292abe['push'](_0x292abe['shift']());}};_0x4ef3c6(++_0x541ad7);}(_0x0e57,0x19a));var _0x70e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e57[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x70e5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x70e5('0x1'));var router=express['Router']();var fs_extra=require(_0x70e5('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x70e5('0x3'));var config=require(_0x70e5('0x4'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x70e5('0x5')](),controller[_0x70e5('0x6')]);router[_0x70e5('0x7')](_0x70e5('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x70e5('0x9'),auth[_0x70e5('0x5')](),controller[_0x70e5('0xa')]);router['get'](_0x70e5('0xb'),auth[_0x70e5('0x5')](),controller[_0x70e5('0xc')]);router[_0x70e5('0x7')](_0x70e5('0xd'),auth[_0x70e5('0x5')](),controller[_0x70e5('0xe')]);router[_0x70e5('0x7')](_0x70e5('0xf'),auth[_0x70e5('0x5')](),controller[_0x70e5('0x10')]);router[_0x70e5('0x11')]('/',auth[_0x70e5('0x5')](),controller[_0x70e5('0x12')]);router[_0x70e5('0x11')](_0x70e5('0xd'),auth[_0x70e5('0x5')](),controller[_0x70e5('0x13')]);router['post'](_0x70e5('0xf'),auth[_0x70e5('0x5')](),controller['addAgents']);router['put']('/:id',auth[_0x70e5('0x5')](),controller[_0x70e5('0x14')]);router[_0x70e5('0x15')](_0x70e5('0x9'),auth['isAuthenticated'](),controller[_0x70e5('0x16')]);router['delete'](_0x70e5('0xd'),auth[_0x70e5('0x5')](),controller[_0x70e5('0x17')]);router[_0x70e5('0x15')](_0x70e5('0xf'),auth[_0x70e5('0x5')](),controller[_0x70e5('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb5f2=['./mailQueue.controller','get','describe','/:id','isAuthenticated','getTeams','getAgents','post','create','/:id/teams','addTeams','addAgents','put','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0xb5f2,0x101));var _0x2b5f=function(_0x5003e1,_0x2b65f2){_0x5003e1=_0x5003e1-0x0;var _0x33249f=_0xb5f2[_0x5003e1];return _0x33249f;};'use strict';var multer=require(_0x2b5f('0x0'));var util=require(_0x2b5f('0x1'));var path=require(_0x2b5f('0x2'));var timeout=require(_0x2b5f('0x3'));var express=require(_0x2b5f('0x4'));var router=express[_0x2b5f('0x5')]();var fs_extra=require(_0x2b5f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2b5f('0x7'));router[_0x2b5f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x2b5f('0x9')]);router[_0x2b5f('0x8')](_0x2b5f('0xa'),auth[_0x2b5f('0xb')](),controller['show']);router[_0x2b5f('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x2b5f('0x8')]('/:id/teams',auth[_0x2b5f('0xb')](),controller[_0x2b5f('0xc')]);router[_0x2b5f('0x8')]('/:id/users',auth[_0x2b5f('0xb')](),controller[_0x2b5f('0xd')]);router[_0x2b5f('0xe')]('/',auth[_0x2b5f('0xb')](),controller[_0x2b5f('0xf')]);router[_0x2b5f('0xe')](_0x2b5f('0x10'),auth[_0x2b5f('0xb')](),controller[_0x2b5f('0x11')]);router['post']('/:id/users',auth[_0x2b5f('0xb')](),controller[_0x2b5f('0x12')]);router[_0x2b5f('0x13')](_0x2b5f('0xa'),auth[_0x2b5f('0xb')](),controller['update']);router['delete'](_0x2b5f('0xa'),auth[_0x2b5f('0xb')](),controller[_0x2b5f('0x14')]);router['delete'](_0x2b5f('0x10'),auth[_0x2b5f('0xb')](),controller['removeTeams']);router[_0x2b5f('0x15')]('/:id/users',auth[_0x2b5f('0xb')](),controller[_0x2b5f('0x16')]);module[_0x2b5f('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index d85ff93..db60f64 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 _0x2fef=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x2fef,0x1ec));var _0xf2fe=function(_0x2aeca6,_0x565154){_0x2aeca6=_0x2aeca6-0x0;var _0x48c8c9=_0x2fef[_0x2aeca6];return _0x48c8c9;};'use strict';var Sequelize=require('sequelize');module[_0xf2fe('0x0')]={'name':{'type':Sequelize[_0xf2fe('0x1')],'unique':_0xf2fe('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf2fe('0x1')]},'timeout':{'type':Sequelize[_0xf2fe('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf2fe('0x4')](_0xf2fe('0x5'),_0xf2fe('0x6'),_0xf2fe('0x7'))}}; \ No newline at end of file +var _0x2826=['sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x1d6968,_0x1de264){var _0x252135=function(_0xe7cec2){while(--_0xe7cec2){_0x1d6968['push'](_0x1d6968['shift']());}};_0x252135(++_0x1de264);}(_0x2826,0x78));var _0x6282=function(_0x4ca58d,_0x54c7b9){_0x4ca58d=_0x4ca58d-0x0;var _0x1f3e49=_0x2826[_0x4ca58d];return _0x1f3e49;};'use strict';var Sequelize=require(_0x6282('0x0'));module[_0x6282('0x1')]={'name':{'type':Sequelize[_0x6282('0x2')],'unique':_0x6282('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6282('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6282('0x4')](_0x6282('0x5'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a01772e..bea6d98 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 _0x827a=['hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','MailQueueId','options','UserMailQueue','User','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','mailPause','getTeams','Team','Agents','online','interface','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','ids','select','field','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','MailQueues','UserProfileResource','destroy','end','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length'];(function(_0x2ac8f0,_0x21d3df){var _0x4e9e93=function(_0x292289){while(--_0x292289){_0x2ac8f0['push'](_0x2ac8f0['shift']());}};_0x4e9e93(++_0x21d3df);}(_0x827a,0x167));var _0xa827=function(_0x4acb9d,_0x51215f){_0x4acb9d=_0x4acb9d-0x0;var _0x2bd014=_0x827a[_0x4acb9d];return _0x2bd014;};'use strict';var emlformat=require(_0xa827('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa827('0x1'));var rp=require(_0xa827('0x2'));var moment=require(_0xa827('0x3'));var BPromise=require(_0xa827('0x4'));var Mustache=require(_0xa827('0x5'));var util=require('util');var path=require(_0xa827('0x6'));var sox=require(_0xa827('0x7'));var csv=require(_0xa827('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa827('0x9'));var _=require(_0xa827('0xa'));var squel=require(_0xa827('0xb'));var crypto=require(_0xa827('0xc'));var jsforce=require(_0xa827('0xd'));var deskjs=require(_0xa827('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa827('0xf'));var Papa=require(_0xa827('0x10'));var Redis=require(_0xa827('0x11'));var authService=require(_0xa827('0x12'));var qs=require(_0xa827('0x13'));var as=require(_0xa827('0x14'));var hardwareService=require(_0xa827('0x15'));var logger=require('../../config/logger')(_0xa827('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa827('0x17'));var db=require(_0xa827('0x18'))['db'];config['redis']=_[_0xa827('0x19')](config[_0xa827('0x1a')],{'host':_0xa827('0x1b'),'port':0x18eb});var socket=require(_0xa827('0x1c'))(new Redis(config[_0xa827('0x1a')]));require(_0xa827('0x1d'))['register'](socket);function respondWithStatusCode(_0x2bbd3f,_0x29dd7a){_0x29dd7a=_0x29dd7a||0xcc;return function(_0x4a2fba){if(_0x4a2fba){return _0x2bbd3f[_0xa827('0x1e')](_0x29dd7a);}return _0x2bbd3f[_0xa827('0x1f')](_0x29dd7a)['end']();};}function respondWithResult(_0x1e54ed,_0x23a7b3){_0x23a7b3=_0x23a7b3||0xc8;return function(_0x276885){if(_0x276885){return _0x1e54ed[_0xa827('0x1f')](_0x23a7b3)[_0xa827('0x20')](_0x276885);}};}function respondWithFilteredResult(_0x3e7455,_0x5ce329){return function(_0x56fdc3){if(_0x56fdc3){var _0x447eee=typeof _0x5ce329[_0xa827('0x21')]===_0xa827('0x22')&&typeof _0x5ce329[_0xa827('0x23')]===_0xa827('0x22');var _0x386e21=_0x56fdc3[_0xa827('0x24')];var _0x53ce64=_0x447eee?0x0:_0x5ce329['offset'];var _0x763966=_0x447eee?_0x56fdc3[_0xa827('0x24')]:_0x5ce329[_0xa827('0x21')]+_0x5ce329[_0xa827('0x23')];var _0x51ef3f;if(_0x763966>=_0x386e21){_0x763966=_0x386e21;_0x51ef3f=0xc8;}else{_0x51ef3f=0xce;}_0x3e7455[_0xa827('0x1f')](_0x51ef3f);return _0x3e7455[_0xa827('0x25')](_0xa827('0x26'),_0x53ce64+'-'+_0x763966+'/'+_0x386e21)[_0xa827('0x20')](_0x56fdc3);}return null;};}function patchUpdates(_0x1312d3){return function(_0x21f90c){try{jsonpatch[_0xa827('0x27')](_0x21f90c,_0x1312d3,!![]);}catch(_0x1b8ed0){return BPromise[_0xa827('0x28')](_0x1b8ed0);}return _0x21f90c['save']();};}function saveUpdates(_0xe07d0b,_0x3a7e08){return function(_0x3563fe){if(_0x3563fe){return _0x3563fe['update'](_0xe07d0b)[_0xa827('0x29')](function(_0x921f10){return _0x921f10;});}return null;};}function removeEntity(_0x4d0b7f,_0x17c8ee){return function(_0x2873f1){if(_0x2873f1){return _0x2873f1['destroy']()[_0xa827('0x29')](function(){var _0x46d224=_0x2873f1[_0xa827('0x2a')]({'plain':!![]});var _0x385cb9=_0xa827('0x2b');return db[_0xa827('0x2c')][_0xa827('0x2d')]({'where':{'type':_0x385cb9,'resourceId':_0x46d224['id']}})[_0xa827('0x29')](function(){return _0x2873f1;});})[_0xa827('0x29')](function(){_0x4d0b7f[_0xa827('0x1f')](0xcc)[_0xa827('0x2e')]();});}};}function handleEntityNotFound(_0x1b75b3,_0x59f9c4){return function(_0x19fa2f){if(!_0x19fa2f){_0x1b75b3[_0xa827('0x1e')](0x194);}return _0x19fa2f;};}function handleError(_0x3d2bc0,_0x202f55){_0x202f55=_0x202f55||0x1f4;return function(_0x11f7b4){logger['error'](_0x11f7b4[_0xa827('0x2f')]);if(_0x11f7b4[_0xa827('0x30')]){delete _0x11f7b4[_0xa827('0x30')];}_0x3d2bc0[_0xa827('0x1f')](_0x202f55)[_0xa827('0x31')](_0x11f7b4);};}exports['index']=function(_0x29d668,_0x2d6490){var _0x127b5a={},_0x50d308={},_0x3d0aec={'count':0x0,'rows':[]};var _0x2063bf=_['map'](db[_0xa827('0x32')][_0xa827('0x33')],function(_0x55f7a6){return{'name':_0x55f7a6[_0xa827('0x34')],'type':_0x55f7a6[_0xa827('0x35')][_0xa827('0x36')]};});_0x50d308[_0xa827('0x37')]=_[_0xa827('0x38')](_0x2063bf,'name');_0x50d308['query']=_[_0xa827('0x39')](_0x29d668[_0xa827('0x3a')]);_0x50d308[_0xa827('0x3b')]=_[_0xa827('0x3c')](_0x50d308[_0xa827('0x37')],_0x50d308[_0xa827('0x3a')]);_0x127b5a[_0xa827('0x3d')]=_[_0xa827('0x3c')](_0x50d308[_0xa827('0x37')],qs['fields'](_0x29d668[_0xa827('0x3a')][_0xa827('0x3e')]));_0x127b5a[_0xa827('0x3d')]=_0x127b5a[_0xa827('0x3d')][_0xa827('0x3f')]?_0x127b5a['attributes']:_0x50d308[_0xa827('0x37')];if(!_0x29d668[_0xa827('0x3a')][_0xa827('0x40')](_0xa827('0x41'))){_0x127b5a[_0xa827('0x23')]=qs[_0xa827('0x23')](_0x29d668[_0xa827('0x3a')]['limit']);_0x127b5a[_0xa827('0x21')]=qs[_0xa827('0x21')](_0x29d668['query'][_0xa827('0x21')]);}_0x127b5a[_0xa827('0x42')]=qs['sort'](_0x29d668[_0xa827('0x3a')][_0xa827('0x43')]);_0x127b5a['where']=qs[_0xa827('0x3b')](_[_0xa827('0x44')](_0x29d668['query'],_0x50d308[_0xa827('0x3b')]),_0x2063bf);if(_0x29d668[_0xa827('0x3a')][_0xa827('0x45')]){_0x127b5a[_0xa827('0x46')]=_[_0xa827('0x47')](_0x127b5a[_0xa827('0x46')],{'$or':_['map'](_0x2063bf,function(_0x37f206){if(_0x37f206[_0xa827('0x35')]!==_0xa827('0x48')){var _0x361603={};_0x361603[_0x37f206[_0xa827('0x30')]]={'$like':'%'+_0x29d668[_0xa827('0x3a')][_0xa827('0x45')]+'%'};return _0x361603;}})});}_0x127b5a=_['merge']({},_0x127b5a,_0x29d668['options']);var _0x12d132={'where':_0x127b5a[_0xa827('0x46')]};return db[_0xa827('0x32')][_0xa827('0x24')](_0x12d132)['then'](function(_0x373ba8){_0x3d0aec['count']=_0x373ba8;if(_0x29d668[_0xa827('0x3a')][_0xa827('0x49')]){_0x127b5a[_0xa827('0x4a')]=[{'all':!![]}];}return db[_0xa827('0x32')][_0xa827('0x4b')](_0x127b5a);})['then'](function(_0x56717d){_0x3d0aec['rows']=_0x56717d;return _0x3d0aec;})[_0xa827('0x29')](respondWithFilteredResult(_0x2d6490,_0x127b5a))[_0xa827('0x4c')](handleError(_0x2d6490,null));};exports[_0xa827('0x4d')]=function(_0x5f4f98,_0x2961bc){var _0x477a15={'raw':!![],'where':{'id':_0x5f4f98[_0xa827('0x4e')]['id']}},_0x3c954c={};_0x3c954c[_0xa827('0x37')]=_[_0xa827('0x39')](db[_0xa827('0x32')][_0xa827('0x33')]);_0x3c954c[_0xa827('0x3a')]=_[_0xa827('0x39')](_0x5f4f98[_0xa827('0x3a')]);_0x3c954c[_0xa827('0x3b')]=_[_0xa827('0x3c')](_0x3c954c[_0xa827('0x37')],_0x3c954c[_0xa827('0x3a')]);_0x477a15[_0xa827('0x3d')]=_[_0xa827('0x3c')](_0x3c954c[_0xa827('0x37')],qs['fields'](_0x5f4f98[_0xa827('0x3a')][_0xa827('0x3e')]));_0x477a15['attributes']=_0x477a15['attributes'][_0xa827('0x3f')]?_0x477a15[_0xa827('0x3d')]:_0x3c954c[_0xa827('0x37')];if(_0x5f4f98[_0xa827('0x3a')][_0xa827('0x49')]){_0x477a15[_0xa827('0x4a')]=[{'all':!![]}];}_0x477a15=_[_0xa827('0x47')]({},_0x477a15,_0x5f4f98['options']);return db['MailQueue'][_0xa827('0x4f')](_0x477a15)[_0xa827('0x29')](handleEntityNotFound(_0x2961bc,null))['then'](respondWithResult(_0x2961bc,null))[_0xa827('0x4c')](handleError(_0x2961bc,null));};exports[_0xa827('0x50')]=function(_0x1023ff,_0x5083c0){return db[_0xa827('0x32')][_0xa827('0x50')](_0x1023ff[_0xa827('0x51')],{})[_0xa827('0x29')](function(_0x4586cd){var _0x63a9f=_0x1023ff['user'][_0xa827('0x2a')]({'plain':!![]});if(!_0x63a9f)throw new Error(_0xa827('0x52'));if(_0x63a9f[_0xa827('0x53')]===_0xa827('0x54')){var _0x33459f=_0x4586cd[_0xa827('0x2a')]({'plain':!![]});var _0x50a1fa=_0xa827('0x2b');return db[_0xa827('0x55')][_0xa827('0x4f')]({'where':{'name':_0x50a1fa,'userProfileId':_0x63a9f['userProfileId']},'raw':!![]})[_0xa827('0x29')](function(_0x10e6eb){if(_0x10e6eb&&_0x10e6eb[_0xa827('0x56')]===0x0){return db[_0xa827('0x2c')]['create']({'name':_0x33459f[_0xa827('0x30')],'resourceId':_0x33459f['id'],'type':_0x10e6eb[_0xa827('0x30')],'sectionId':_0x10e6eb['id']},{})['then'](function(){return _0x4586cd;});}else{return _0x4586cd;}})[_0xa827('0x4c')](function(_0x32c313){logger[_0xa827('0x57')](_0xa827('0x58'),_0x32c313);throw _0x32c313;});}return _0x4586cd;})[_0xa827('0x29')](respondWithResult(_0x5083c0,0xc9))['catch'](handleError(_0x5083c0,null));};exports[_0xa827('0x59')]=function(_0x22f45b,_0x3e87ba){if(_0x22f45b[_0xa827('0x51')]['id']){delete _0x22f45b[_0xa827('0x51')]['id'];}return db[_0xa827('0x32')]['find']({'where':{'id':_0x22f45b[_0xa827('0x4e')]['id']}})[_0xa827('0x29')](handleEntityNotFound(_0x3e87ba,null))['then'](saveUpdates(_0x22f45b[_0xa827('0x51')],null))['then'](respondWithResult(_0x3e87ba,null))[_0xa827('0x4c')](handleError(_0x3e87ba,null));};exports[_0xa827('0x2d')]=function(_0x4398a2,_0x5e99f9){return db['MailQueue']['find']({'where':{'id':_0x4398a2[_0xa827('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e99f9,null))[_0xa827('0x29')](removeEntity(_0x5e99f9,null))[_0xa827('0x4c')](handleError(_0x5e99f9,null));};exports[_0xa827('0x5a')]=function(_0x1946f9,_0x30743c){return db[_0xa827('0x32')]['describe']()[_0xa827('0x29')](respondWithResult(_0x30743c,null))[_0xa827('0x4c')](handleError(_0x30743c,null));};exports[_0xa827('0x5b')]=function(_0x21be4a,_0x50c8fe,_0xaeab31){var _0x10c2a6={'raw':!![],'where':{}},_0x3eb4e1={},_0x51b6d9;return db[_0xa827('0x32')][_0xa827('0x5c')]({'where':{'id':_0x21be4a[_0xa827('0x4e')]['id']}})['then'](handleEntityNotFound(_0x50c8fe,null))[_0xa827('0x29')](function(_0x593fd3){if(_0x593fd3){_0x51b6d9=_0x593fd3[_0xa827('0x2a')]({'plain':!![]});_0x3eb4e1['model']=_[_0xa827('0x39')](db['UserMailQueue']['rawAttributes']);_0x3eb4e1[_0xa827('0x3a')]=_[_0xa827('0x39')](_0x21be4a[_0xa827('0x3a')]);_0x3eb4e1[_0xa827('0x3b')]=_[_0xa827('0x3c')](_0x3eb4e1['model'],_0x3eb4e1['query']);_0x10c2a6['attributes']=_['intersection'](_0x3eb4e1['model'],qs['fields'](_0x21be4a[_0xa827('0x3a')][_0xa827('0x3e')]));_0x10c2a6[_0xa827('0x3d')]=_0x10c2a6[_0xa827('0x3d')]['length']?_0x10c2a6[_0xa827('0x3d')]:_0x3eb4e1[_0xa827('0x37')];if(!_0x21be4a['query'][_0xa827('0x40')](_0xa827('0x41'))){_0x10c2a6['limit']=qs['limit'](_0x21be4a[_0xa827('0x3a')][_0xa827('0x23')]);_0x10c2a6['offset']=qs['offset'](_0x21be4a[_0xa827('0x3a')]['offset']);}_0x10c2a6['order']=qs[_0xa827('0x43')](_0x21be4a['query'][_0xa827('0x43')]);_0x10c2a6[_0xa827('0x46')]=qs[_0xa827('0x3b')](_[_0xa827('0x44')](_0x21be4a[_0xa827('0x3a')],_0x3eb4e1[_0xa827('0x3b')]));_0x10c2a6[_0xa827('0x46')][_0xa827('0x5d')]=_0x593fd3['id'];if(_0x21be4a[_0xa827('0x3a')]['filter']){_0x10c2a6[_0xa827('0x46')]=_['merge'](_0x10c2a6[_0xa827('0x46')],{'$or':_['map'](_0x10c2a6[_0xa827('0x3d')],function(_0x3e8d54){var _0xafbc3b={};_0xafbc3b[_0x3e8d54]={'$like':'%'+_0x21be4a['query'][_0xa827('0x45')]+'%'};return _0xafbc3b;})});}_0x10c2a6=_[_0xa827('0x47')]({},_0x10c2a6,_0x21be4a[_0xa827('0x5e')]);return db[_0xa827('0x5f')][_0xa827('0x4b')](_0x10c2a6);}})[_0xa827('0x29')](function(_0x15e686){if(_0x15e686){return db[_0xa827('0x60')]['findAndCountAll']({'where':{'id':_[_0xa827('0x38')](_0x15e686,_0xa827('0x61')),'role':_0xa827('0x62')},'attributes':['id',_0xa827('0x30'),'mailPause',_0xa827('0x63'),_0xa827('0x64')]});}})[_0xa827('0x29')](function(_0x2e2e02){if(_0x2e2e02){return{'count':_0x2e2e02[_0xa827('0x24')],'rows':_['map'](_0x2e2e02[_0xa827('0x65')],function(_0x421970){return{'membername':_0x421970[_0xa827('0x30')],'UserId':_0x421970['id'],'queue_name':_0x51b6d9[_0xa827('0x30')],'MailQueueId':_0x51b6d9['id'],'interface':util[_0xa827('0x66')](_0xa827('0x67'),_0xa827('0x68'),_0x421970['name']),'penalty':0x0,'paused':_0x421970[_0xa827('0x69')],'createdAt':_0x421970['createdAt'],'updatedAt':_0x421970['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa827('0x29')](respondWithFilteredResult(_0x50c8fe,_0x10c2a6))[_0xa827('0x4c')](handleError(_0x50c8fe,null));};exports[_0xa827('0x6a')]=function(_0x267fc6,_0xb6a9ae,_0x3c682a){var _0x416a8b={};var _0x4b7a16={};var _0x426eeb;var _0x2e2820;return db['MailQueue'][_0xa827('0x5c')]({'where':{'id':_0x267fc6[_0xa827('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb6a9ae,null))[_0xa827('0x29')](function(_0x3ce83a){if(_0x3ce83a){_0x426eeb=_0x3ce83a;_0x4b7a16[_0xa827('0x37')]=_[_0xa827('0x39')](db[_0xa827('0x6b')][_0xa827('0x33')]);_0x4b7a16[_0xa827('0x3a')]=_['keys'](_0x267fc6[_0xa827('0x3a')]);_0x4b7a16[_0xa827('0x3b')]=_[_0xa827('0x3c')](_0x4b7a16[_0xa827('0x37')],_0x4b7a16['query']);_0x416a8b['attributes']=_[_0xa827('0x3c')](_0x4b7a16[_0xa827('0x37')],qs['fields'](_0x267fc6[_0xa827('0x3a')]['fields']));_0x416a8b['attributes']=_0x416a8b[_0xa827('0x3d')][_0xa827('0x3f')]?_0x416a8b[_0xa827('0x3d')]:_0x4b7a16[_0xa827('0x37')];_0x416a8b['order']=qs[_0xa827('0x43')](_0x267fc6[_0xa827('0x3a')]['sort']);_0x416a8b[_0xa827('0x46')]=qs[_0xa827('0x3b')](_[_0xa827('0x44')](_0x267fc6[_0xa827('0x3a')],_0x4b7a16[_0xa827('0x3b')]));if(_0x267fc6[_0xa827('0x3a')][_0xa827('0x45')]){_0x416a8b[_0xa827('0x46')]=_[_0xa827('0x47')](_0x416a8b[_0xa827('0x46')],{'$or':_[_0xa827('0x38')](_0x416a8b[_0xa827('0x3d')],function(_0x3177e9){var _0x59883a={};_0x59883a[_0x3177e9]={'$like':'%'+_0x267fc6[_0xa827('0x3a')][_0xa827('0x45')]+'%'};return _0x59883a;})});}_0x416a8b=_[_0xa827('0x47')]({},_0x416a8b,_0x267fc6[_0xa827('0x5e')]);return _0x426eeb[_0xa827('0x6a')](_0x416a8b);}})[_0xa827('0x29')](function(_0x2c4811){if(_0x2c4811){_0x2e2820=_0x2c4811[_0xa827('0x3f')];if(!_0x267fc6['query'][_0xa827('0x40')]('nolimit')){_0x416a8b['limit']=qs[_0xa827('0x23')](_0x267fc6['query'][_0xa827('0x23')]);_0x416a8b[_0xa827('0x21')]=qs['offset'](_0x267fc6[_0xa827('0x3a')][_0xa827('0x21')]);}return _0x426eeb[_0xa827('0x6a')](_0x416a8b);}})[_0xa827('0x29')](function(_0x2343bb){if(_0x2343bb){return _0x2343bb?{'count':_0x2e2820,'rows':_0x2343bb}:null;}})['then'](respondWithResult(_0xb6a9ae,null))['catch'](handleError(_0xb6a9ae,null));};exports['addTeams']=function(_0x492405,_0x516cde,_0x408fd4){var _0x2d6ead=_0x492405[_0xa827('0x51')]['ids'];return db[_0xa827('0x6b')][_0xa827('0x4b')]({'where':{'id':_0x2d6ead},'attributes':['id'],'include':[{'model':db[_0xa827('0x60')],'as':_0xa827('0x6c'),'attributes':['id',_0xa827('0x30'),_0xa827('0x6d'),'voicePause',_0xa827('0x6e')],'raw':!![]}]})['then'](function(_0x24d05d){if(_0x24d05d){var _0x8a8794=_['flatMap'](_0x24d05d,function(_0x3f2815){var _0x54848b=_0x3f2815[_0xa827('0x2a')]({'plain':!![]});return _0x54848b[_0xa827('0x6c')];});return db[_0xa827('0x32')][_0xa827('0x4f')]({'where':{'id':_0x492405[_0xa827('0x4e')]['id']}})[_0xa827('0x29')](function(_0x4ce289){return db[_0xa827('0x6f')][_0xa827('0x70')](function(_0xc22cc5){return _0x4ce289['addTeams'](_0x2d6ead,{'transaction':_0xc22cc5})['then'](function(){return BPromise[_0xa827('0x71')](_0x8a8794,function(_0x2c8c68){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x2c8c68['id'],'MailQueueId':_0x492405[_0xa827('0x4e')]['id']},'transaction':_0xc22cc5});});})[_0xa827('0x29')](function(){_0x8a8794[_0xa827('0x72')](function(_0x5d8e76){socket[_0xa827('0x73')](_0xa827('0x74'),{'UserId':_0x5d8e76['id'],'MailQueueId':_0x4ce289['id']});});});});});}})['then'](respondWithStatusCode(_0x516cde,null))['catch'](handleError(_0x516cde,null));};exports[_0xa827('0x75')]=function(_0x4494c7,_0x154acc,_0x5471fc){return db[_0xa827('0x6b')][_0xa827('0x4b')]({'where':{'id':_0x4494c7['query'][_0xa827('0x76')]},'attributes':['id'],'include':[{'model':db[_0xa827('0x60')],'as':_0xa827('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xa827('0x29')](handleEntityNotFound(_0x154acc,null))['then'](function(_0x559a43){var _0x5c5b64=_[_0xa827('0x38')](_0x559a43,'id');var _0x4a4644=[];var _0x1680c3=[];var _0x42fea1=squel[_0xa827('0x77')]();_0x42fea1[_0xa827('0x78')]('tq.TeamId')[_0xa827('0x79')]('team_has_mail_queues','tq')[_0xa827('0x7a')](_0xa827('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa827('0x7c'),_0x4494c7[_0xa827('0x4e')]['id']);for(var _0x26cd09=0x0;_0x26cd09<_0x559a43[_0xa827('0x3f')];_0x26cd09+=0x1){let _0x50e92a=_0x559a43[_0x26cd09];for(var _0x40806e=0x0;_0x40806e<_0x50e92a[_0xa827('0x6c')][_0xa827('0x3f')];_0x40806e+=0x1){let _0x8b2107=_0x50e92a[_0xa827('0x6c')][_0x40806e];var _0x569363=_0x42fea1[_0xa827('0x7d')]();_0x569363[_0xa827('0x46')](_0xa827('0x7e'),_0x8b2107['id']);_0x1680c3['push'](db[_0xa827('0x6f')][_0xa827('0x3a')](_0x569363['toString'](),{'type':db[_0xa827('0x6f')][_0xa827('0x7f')][_0xa827('0x80')]})['then'](function(_0xbcce2f){if(_0xbcce2f['length']===0x1){return _0x8b2107['id'];}else{var _0x449d10=_['every'](_[_0xa827('0x38')](_0xbcce2f,_0xa827('0x81')),function(_0x4566dc){return _[_0xa827('0x82')](_0x5c5b64,_0x4566dc);});if(_0x449d10){return _0x8b2107['id'];}}}));}}return BPromise['all'](_0x1680c3)[_0xa827('0x29')](function(_0x64c0c3){_0x4a4644=_(_0x4a4644)[_0xa827('0x83')](_0x64c0c3)[_0xa827('0x84')]()[_0xa827('0x85')]();return db['MailQueue']['find']({'where':{'id':_0x4494c7[_0xa827('0x4e')]['id']}})['then'](function(_0x4801b8){return db['sequelize'][_0xa827('0x70')](function(_0x3d3729){return _0x4801b8[_0xa827('0x75')](_0x4494c7['query']['ids'],{'transaction':_0x3d3729})[_0xa827('0x29')](function(){if(!_[_0xa827('0x86')](_0x4a4644)){return _0x4801b8['removeAgents'](_0x4a4644,{'transaction':_0x3d3729});}})['then'](function(){_0x4a4644[_0xa827('0x72')](function(_0x1bb341){socket[_0xa827('0x73')](_0xa827('0x87'),{'UserId':_0x1bb341,'MailQueueId':_0x4801b8['id']});});});});});});})[_0xa827('0x29')](respondWithStatusCode(_0x154acc,null))[_0xa827('0x4c')](handleError(_0x154acc,null));};exports[_0xa827('0x88')]=function(_0x5cefe8,_0x284202,_0xfe9f9d){return db['MailQueue'][_0xa827('0x4f')]({'where':{'id':_0x5cefe8['params']['id']}})['then'](handleEntityNotFound(_0x284202,null))['then'](function(_0x1ed721){if(_0x1ed721){return _0x1ed721['addAgents'](_0x5cefe8[_0xa827('0x51')][_0xa827('0x76')],_[_0xa827('0x89')](_0x5cefe8[_0xa827('0x51')],[_0xa827('0x76'),'id'])||{})['spread'](function(_0x2184bc){for(var _0xdf29dd=0x0;_0xdf29dd<_0x5cefe8[_0xa827('0x51')][_0xa827('0x76')][_0xa827('0x3f')];_0xdf29dd+=0x1){socket[_0xa827('0x73')](_0xa827('0x74'),{'UserId':Number(_0x5cefe8['body']['ids'][_0xdf29dd]),'MailQueueId':Number(_0x5cefe8[_0xa827('0x4e')]['id'])});}return _0x2184bc;});}})['then'](respondWithResult(_0x284202,null))[_0xa827('0x4c')](handleError(_0x284202,null));};exports[_0xa827('0x8a')]=function(_0x54f5e2,_0x32b86b,_0x57ce5a){return db[_0xa827('0x32')][_0xa827('0x4f')]({'where':{'id':_0x54f5e2[_0xa827('0x4e')]['id']}})[_0xa827('0x29')](handleEntityNotFound(_0x32b86b,null))['then'](function(_0x2ec25c){if(_0x2ec25c){return _0x2ec25c[_0xa827('0x8a')](_0x54f5e2[_0xa827('0x3a')]['ids'])['then'](function(){if(_[_0xa827('0x8b')](_0x54f5e2[_0xa827('0x3a')]['ids'])){for(var _0x2ef52a=0x0;_0x2ef52a<_0x54f5e2['query'][_0xa827('0x76')][_0xa827('0x3f')];_0x2ef52a+=0x1){socket[_0xa827('0x73')]('userMailQueue:remove',{'UserId':Number(_0x54f5e2['query'][_0xa827('0x76')][_0x2ef52a]),'MailQueueId':Number(_0x54f5e2[_0xa827('0x4e')]['id'])});}}else{socket[_0xa827('0x73')](_0xa827('0x87'),{'UserId':Number(_0x54f5e2[_0xa827('0x3a')][_0xa827('0x76')]),'MailQueueId':Number(_0x54f5e2[_0xa827('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x32b86b,null))[_0xa827('0x4c')](handleError(_0x32b86b,null));};exports[_0xa827('0x8c')]=function(_0x57c66d,_0x36aeb8,_0x376064){var _0x2e8e3c={};var _0x1f65a5={};var _0x35087b;var _0x7431af;return db[_0xa827('0x32')][_0xa827('0x5c')]({'where':{'id':_0x57c66d[_0xa827('0x4e')]['id']}})['then'](handleEntityNotFound(_0x36aeb8,null))[_0xa827('0x29')](function(_0x5aee61){if(_0x5aee61){_0x35087b=_0x5aee61;_0x1f65a5[_0xa827('0x37')]=_[_0xa827('0x39')](db['User']['rawAttributes']);_0x1f65a5[_0xa827('0x3a')]=_[_0xa827('0x39')](_0x57c66d[_0xa827('0x3a')]);_0x1f65a5['filters']=_[_0xa827('0x3c')](_0x1f65a5[_0xa827('0x37')],_0x1f65a5[_0xa827('0x3a')]);_0x2e8e3c['attributes']=_['intersection'](_0x1f65a5[_0xa827('0x37')],qs[_0xa827('0x3e')](_0x57c66d[_0xa827('0x3a')][_0xa827('0x3e')]));_0x2e8e3c['attributes']=_0x2e8e3c[_0xa827('0x3d')]['length']?_0x2e8e3c[_0xa827('0x3d')]:_0x1f65a5[_0xa827('0x37')];_0x2e8e3c[_0xa827('0x42')]=qs[_0xa827('0x43')](_0x57c66d['query'][_0xa827('0x43')]);_0x2e8e3c['where']=qs[_0xa827('0x3b')](_['pick'](_0x57c66d[_0xa827('0x3a')],_0x1f65a5[_0xa827('0x3b')]));if(_0x57c66d['query'][_0xa827('0x45')]){_0x2e8e3c[_0xa827('0x46')]=_[_0xa827('0x47')](_0x2e8e3c[_0xa827('0x46')],{'$or':_[_0xa827('0x38')](_0x2e8e3c[_0xa827('0x3d')],function(_0xe01e52){var _0x2eed1a={};_0x2eed1a[_0xe01e52]={'$like':'%'+_0x57c66d[_0xa827('0x3a')]['filter']+'%'};return _0x2eed1a;})});}_0x2e8e3c=_[_0xa827('0x47')]({},_0x2e8e3c,_0x57c66d[_0xa827('0x5e')]);return _0x35087b[_0xa827('0x8c')](_0x2e8e3c);}})['then'](function(_0x192a8b){if(_0x192a8b){_0x7431af=_0x192a8b['length'];if(!_0x57c66d[_0xa827('0x3a')]['hasOwnProperty'](_0xa827('0x41'))){_0x2e8e3c[_0xa827('0x23')]=qs[_0xa827('0x23')](_0x57c66d[_0xa827('0x3a')][_0xa827('0x23')]);_0x2e8e3c['offset']=qs['offset'](_0x57c66d[_0xa827('0x3a')][_0xa827('0x21')]);}return _0x35087b[_0xa827('0x8c')](_0x2e8e3c);}})[_0xa827('0x29')](function(_0x2b1bc0){if(_0x2b1bc0){return _0x2b1bc0?{'count':_0x7431af,'rows':_0x2b1bc0}:null;}})[_0xa827('0x29')](respondWithResult(_0x36aeb8,null))['catch'](handleError(_0x36aeb8,null));}; \ No newline at end of file +var _0xb8fb=['userMailQueue:save','removeTeams','field','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','addAgents','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','get','MailQueues','UserProfileResource','destroy','then','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','MailQueue','findAll','catch','params','keys','rawAttributes','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','update','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb8fb,0xa4));var _0xbb8f=function(_0xb14b09,_0xe417fd){_0xb14b09=_0xb14b09-0x0;var _0x4130ca=_0xb8fb[_0xb14b09];return _0x4130ca;};'use strict';var emlformat=require(_0xbb8f('0x0'));var rimraf=require(_0xbb8f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb8f('0x2'));var rp=require(_0xbb8f('0x3'));var moment=require(_0xbb8f('0x4'));var BPromise=require(_0xbb8f('0x5'));var Mustache=require(_0xbb8f('0x6'));var util=require(_0xbb8f('0x7'));var path=require(_0xbb8f('0x8'));var sox=require(_0xbb8f('0x9'));var csv=require('to-csv');var ejs=require(_0xbb8f('0xa'));var fs=require('fs');var fs_extra=require(_0xbb8f('0xb'));var _=require(_0xbb8f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb8f('0xd'));var deskjs=require(_0xbb8f('0xe'));var toCsv=require(_0xbb8f('0xf'));var querystring=require(_0xbb8f('0x10'));var Papa=require(_0xbb8f('0x11'));var Redis=require(_0xbb8f('0x12'));var authService=require(_0xbb8f('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb8f('0x14'));var logger=require(_0xbb8f('0x15'))(_0xbb8f('0x16'));var utils=require(_0xbb8f('0x17'));var config=require(_0xbb8f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbb8f('0x19')]=_[_0xbb8f('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbb8f('0x1b'))(new Redis(config['redis']));require('./mailQueue.socket')[_0xbb8f('0x1c')](socket);function respondWithStatusCode(_0x220e2e,_0x2ce921){_0x2ce921=_0x2ce921||0xcc;return function(_0x348d5c){if(_0x348d5c){return _0x220e2e[_0xbb8f('0x1d')](_0x2ce921);}return _0x220e2e[_0xbb8f('0x1e')](_0x2ce921)[_0xbb8f('0x1f')]();};}function respondWithResult(_0x59a50b,_0x1e4528){_0x1e4528=_0x1e4528||0xc8;return function(_0xef0652){if(_0xef0652){return _0x59a50b[_0xbb8f('0x1e')](_0x1e4528)['json'](_0xef0652);}};}function respondWithFilteredResult(_0x49407d,_0x1f6997){return function(_0x5a3b42){if(_0x5a3b42){var _0x58be59=typeof _0x1f6997[_0xbb8f('0x20')]===_0xbb8f('0x21')&&typeof _0x1f6997['limit']==='undefined';var _0x30b927=_0x5a3b42[_0xbb8f('0x22')];var _0x11ec19=_0x58be59?0x0:_0x1f6997[_0xbb8f('0x20')];var _0x2171bb=_0x58be59?_0x5a3b42[_0xbb8f('0x22')]:_0x1f6997[_0xbb8f('0x20')]+_0x1f6997[_0xbb8f('0x23')];var _0x251ab5;if(_0x2171bb>=_0x30b927){_0x2171bb=_0x30b927;_0x251ab5=0xc8;}else{_0x251ab5=0xce;}_0x49407d[_0xbb8f('0x1e')](_0x251ab5);return _0x49407d[_0xbb8f('0x24')](_0xbb8f('0x25'),_0x11ec19+'-'+_0x2171bb+'/'+_0x30b927)[_0xbb8f('0x26')](_0x5a3b42);}return null;};}function patchUpdates(_0x2fd010){return function(_0xcc42de){try{jsonpatch[_0xbb8f('0x27')](_0xcc42de,_0x2fd010,!![]);}catch(_0x36ee1c){return BPromise[_0xbb8f('0x28')](_0x36ee1c);}return _0xcc42de['save']();};}function saveUpdates(_0x138883,_0x207f24){return function(_0x162895){if(_0x162895){return _0x162895['update'](_0x138883)['then'](function(_0x4de617){return _0x4de617;});}return null;};}function removeEntity(_0xf9413a,_0x383c4e){return function(_0x3ea918){if(_0x3ea918){return _0x3ea918['destroy']()['then'](function(){var _0x38f7a5=_0x3ea918[_0xbb8f('0x29')]({'plain':!![]});var _0x16c705=_0xbb8f('0x2a');return db[_0xbb8f('0x2b')][_0xbb8f('0x2c')]({'where':{'type':_0x16c705,'resourceId':_0x38f7a5['id']}})[_0xbb8f('0x2d')](function(){return _0x3ea918;});})['then'](function(){_0xf9413a[_0xbb8f('0x1e')](0xcc)[_0xbb8f('0x1f')]();});}};}function handleEntityNotFound(_0x5382a1,_0x5101a1){return function(_0x28220e){if(!_0x28220e){_0x5382a1[_0xbb8f('0x1d')](0x194);}return _0x28220e;};}function handleError(_0x271c84,_0x44d6a1){_0x44d6a1=_0x44d6a1||0x1f4;return function(_0x4937c7){logger[_0xbb8f('0x2e')](_0x4937c7[_0xbb8f('0x2f')]);if(_0x4937c7[_0xbb8f('0x30')]){delete _0x4937c7['name'];}_0x271c84['status'](_0x44d6a1)[_0xbb8f('0x31')](_0x4937c7);};}exports['index']=function(_0x3ef6d2,_0x44c24f){var _0x216740={},_0x4a093b={},_0x307cd9={'count':0x0,'rows':[]};var _0x1e8807=_[_0xbb8f('0x32')](db['MailQueue']['rawAttributes'],function(_0x42884b){return{'name':_0x42884b[_0xbb8f('0x33')],'type':_0x42884b[_0xbb8f('0x34')][_0xbb8f('0x35')]};});_0x4a093b[_0xbb8f('0x36')]=_[_0xbb8f('0x32')](_0x1e8807,_0xbb8f('0x30'));_0x4a093b['query']=_['keys'](_0x3ef6d2[_0xbb8f('0x37')]);_0x4a093b[_0xbb8f('0x38')]=_[_0xbb8f('0x39')](_0x4a093b[_0xbb8f('0x36')],_0x4a093b[_0xbb8f('0x37')]);_0x216740['attributes']=_['intersection'](_0x4a093b['model'],qs[_0xbb8f('0x3a')](_0x3ef6d2[_0xbb8f('0x37')]['fields']));_0x216740[_0xbb8f('0x3b')]=_0x216740[_0xbb8f('0x3b')][_0xbb8f('0x3c')]?_0x216740['attributes']:_0x4a093b[_0xbb8f('0x36')];if(!_0x3ef6d2[_0xbb8f('0x37')][_0xbb8f('0x3d')](_0xbb8f('0x3e'))){_0x216740[_0xbb8f('0x23')]=qs[_0xbb8f('0x23')](_0x3ef6d2[_0xbb8f('0x37')][_0xbb8f('0x23')]);_0x216740[_0xbb8f('0x20')]=qs[_0xbb8f('0x20')](_0x3ef6d2[_0xbb8f('0x37')]['offset']);}_0x216740[_0xbb8f('0x3f')]=qs['sort'](_0x3ef6d2[_0xbb8f('0x37')][_0xbb8f('0x40')]);_0x216740[_0xbb8f('0x41')]=qs[_0xbb8f('0x38')](_['pick'](_0x3ef6d2[_0xbb8f('0x37')],_0x4a093b[_0xbb8f('0x38')]),_0x1e8807);if(_0x3ef6d2[_0xbb8f('0x37')][_0xbb8f('0x42')]){_0x216740[_0xbb8f('0x41')]=_[_0xbb8f('0x43')](_0x216740[_0xbb8f('0x41')],{'$or':_[_0xbb8f('0x32')](_0x1e8807,function(_0x4270c0){if(_0x4270c0[_0xbb8f('0x34')]!==_0xbb8f('0x44')){var _0x6a6539={};_0x6a6539[_0x4270c0['name']]={'$like':'%'+_0x3ef6d2[_0xbb8f('0x37')][_0xbb8f('0x42')]+'%'};return _0x6a6539;}})});}_0x216740=_[_0xbb8f('0x43')]({},_0x216740,_0x3ef6d2[_0xbb8f('0x45')]);var _0x148353={'where':_0x216740[_0xbb8f('0x41')]};return db['MailQueue'][_0xbb8f('0x22')](_0x148353)[_0xbb8f('0x2d')](function(_0x35d82a){_0x307cd9[_0xbb8f('0x22')]=_0x35d82a;if(_0x3ef6d2[_0xbb8f('0x37')][_0xbb8f('0x46')]){_0x216740[_0xbb8f('0x47')]=[{'all':!![]}];}return db[_0xbb8f('0x48')][_0xbb8f('0x49')](_0x216740);})['then'](function(_0x519e00){_0x307cd9['rows']=_0x519e00;return _0x307cd9;})[_0xbb8f('0x2d')](respondWithFilteredResult(_0x44c24f,_0x216740))[_0xbb8f('0x4a')](handleError(_0x44c24f,null));};exports['show']=function(_0x296eb0,_0x4bad9e){var _0x530003={'raw':!![],'where':{'id':_0x296eb0[_0xbb8f('0x4b')]['id']}},_0x267c5b={};_0x267c5b[_0xbb8f('0x36')]=_[_0xbb8f('0x4c')](db[_0xbb8f('0x48')][_0xbb8f('0x4d')]);_0x267c5b['query']=_[_0xbb8f('0x4c')](_0x296eb0['query']);_0x267c5b[_0xbb8f('0x38')]=_[_0xbb8f('0x39')](_0x267c5b['model'],_0x267c5b[_0xbb8f('0x37')]);_0x530003[_0xbb8f('0x3b')]=_[_0xbb8f('0x39')](_0x267c5b['model'],qs['fields'](_0x296eb0[_0xbb8f('0x37')][_0xbb8f('0x3a')]));_0x530003[_0xbb8f('0x3b')]=_0x530003[_0xbb8f('0x3b')][_0xbb8f('0x3c')]?_0x530003[_0xbb8f('0x3b')]:_0x267c5b[_0xbb8f('0x36')];if(_0x296eb0['query'][_0xbb8f('0x46')]){_0x530003['include']=[{'all':!![]}];}_0x530003=_[_0xbb8f('0x43')]({},_0x530003,_0x296eb0[_0xbb8f('0x45')]);return db['MailQueue'][_0xbb8f('0x4e')](_0x530003)[_0xbb8f('0x2d')](handleEntityNotFound(_0x4bad9e,null))[_0xbb8f('0x2d')](respondWithResult(_0x4bad9e,null))[_0xbb8f('0x4a')](handleError(_0x4bad9e,null));};exports[_0xbb8f('0x4f')]=function(_0x30cc2e,_0x4f2bb8){return db[_0xbb8f('0x48')][_0xbb8f('0x4f')](_0x30cc2e[_0xbb8f('0x50')],{})[_0xbb8f('0x2d')](function(_0x551e4e){var _0x3f90af=_0x30cc2e[_0xbb8f('0x51')][_0xbb8f('0x29')]({'plain':!![]});if(!_0x3f90af)throw new Error(_0xbb8f('0x52'));if(_0x3f90af[_0xbb8f('0x53')]===_0xbb8f('0x51')){var _0x27cfaa=_0x551e4e[_0xbb8f('0x29')]({'plain':!![]});var _0x2ee46f=_0xbb8f('0x2a');return db[_0xbb8f('0x54')][_0xbb8f('0x4e')]({'where':{'name':_0x2ee46f,'userProfileId':_0x3f90af[_0xbb8f('0x55')]},'raw':!![]})[_0xbb8f('0x2d')](function(_0x3c78ad){if(_0x3c78ad&&_0x3c78ad[_0xbb8f('0x56')]===0x0){return db[_0xbb8f('0x2b')][_0xbb8f('0x4f')]({'name':_0x27cfaa[_0xbb8f('0x30')],'resourceId':_0x27cfaa['id'],'type':_0x3c78ad['name'],'sectionId':_0x3c78ad['id']},{})[_0xbb8f('0x2d')](function(){return _0x551e4e;});}else{return _0x551e4e;}})[_0xbb8f('0x4a')](function(_0x199590){logger['error'](_0xbb8f('0x57'),_0x199590);throw _0x199590;});}return _0x551e4e;})[_0xbb8f('0x2d')](respondWithResult(_0x4f2bb8,0xc9))['catch'](handleError(_0x4f2bb8,null));};exports[_0xbb8f('0x58')]=function(_0x597705,_0x48a520){if(_0x597705['body']['id']){delete _0x597705[_0xbb8f('0x50')]['id'];}return db[_0xbb8f('0x48')][_0xbb8f('0x4e')]({'where':{'id':_0x597705[_0xbb8f('0x4b')]['id']}})[_0xbb8f('0x2d')](handleEntityNotFound(_0x48a520,null))['then'](saveUpdates(_0x597705[_0xbb8f('0x50')],null))[_0xbb8f('0x2d')](respondWithResult(_0x48a520,null))['catch'](handleError(_0x48a520,null));};exports[_0xbb8f('0x2c')]=function(_0xa25403,_0x48da12){return db[_0xbb8f('0x48')]['find']({'where':{'id':_0xa25403['params']['id']}})[_0xbb8f('0x2d')](handleEntityNotFound(_0x48da12,null))[_0xbb8f('0x2d')](removeEntity(_0x48da12,null))['catch'](handleError(_0x48da12,null));};exports[_0xbb8f('0x59')]=function(_0x4b978f,_0x392a24){return db[_0xbb8f('0x48')]['describe']()['then'](respondWithResult(_0x392a24,null))[_0xbb8f('0x4a')](handleError(_0x392a24,null));};exports[_0xbb8f('0x5a')]=function(_0x563dad,_0x4495bf,_0x17cd14){var _0x13f2bc={'raw':!![],'where':{}},_0x10eadd={},_0x5c98cc;return db[_0xbb8f('0x48')][_0xbb8f('0x5b')]({'where':{'id':_0x563dad['params']['id']}})['then'](handleEntityNotFound(_0x4495bf,null))['then'](function(_0x467d0d){if(_0x467d0d){_0x5c98cc=_0x467d0d['get']({'plain':!![]});_0x10eadd[_0xbb8f('0x36')]=_['keys'](db[_0xbb8f('0x5c')][_0xbb8f('0x4d')]);_0x10eadd[_0xbb8f('0x37')]=_[_0xbb8f('0x4c')](_0x563dad[_0xbb8f('0x37')]);_0x10eadd[_0xbb8f('0x38')]=_['intersection'](_0x10eadd[_0xbb8f('0x36')],_0x10eadd[_0xbb8f('0x37')]);_0x13f2bc[_0xbb8f('0x3b')]=_[_0xbb8f('0x39')](_0x10eadd[_0xbb8f('0x36')],qs[_0xbb8f('0x3a')](_0x563dad['query'][_0xbb8f('0x3a')]));_0x13f2bc[_0xbb8f('0x3b')]=_0x13f2bc[_0xbb8f('0x3b')]['length']?_0x13f2bc['attributes']:_0x10eadd[_0xbb8f('0x36')];if(!_0x563dad[_0xbb8f('0x37')][_0xbb8f('0x3d')](_0xbb8f('0x3e'))){_0x13f2bc[_0xbb8f('0x23')]=qs['limit'](_0x563dad[_0xbb8f('0x37')][_0xbb8f('0x23')]);_0x13f2bc[_0xbb8f('0x20')]=qs[_0xbb8f('0x20')](_0x563dad[_0xbb8f('0x37')]['offset']);}_0x13f2bc['order']=qs[_0xbb8f('0x40')](_0x563dad['query'][_0xbb8f('0x40')]);_0x13f2bc[_0xbb8f('0x41')]=qs['filters'](_[_0xbb8f('0x5d')](_0x563dad[_0xbb8f('0x37')],_0x10eadd[_0xbb8f('0x38')]));_0x13f2bc['where'][_0xbb8f('0x5e')]=_0x467d0d['id'];if(_0x563dad['query'][_0xbb8f('0x42')]){_0x13f2bc[_0xbb8f('0x41')]=_['merge'](_0x13f2bc[_0xbb8f('0x41')],{'$or':_[_0xbb8f('0x32')](_0x13f2bc[_0xbb8f('0x3b')],function(_0x2f38b3){var _0x5be30b={};_0x5be30b[_0x2f38b3]={'$like':'%'+_0x563dad['query'][_0xbb8f('0x42')]+'%'};return _0x5be30b;})});}_0x13f2bc=_[_0xbb8f('0x43')]({},_0x13f2bc,_0x563dad[_0xbb8f('0x45')]);return db[_0xbb8f('0x5c')][_0xbb8f('0x49')](_0x13f2bc);}})[_0xbb8f('0x2d')](function(_0x55dad1){if(_0x55dad1){return db[_0xbb8f('0x5f')]['findAndCountAll']({'where':{'id':_[_0xbb8f('0x32')](_0x55dad1,_0xbb8f('0x60')),'role':_0xbb8f('0x61')},'attributes':['id',_0xbb8f('0x30'),_0xbb8f('0x62'),_0xbb8f('0x63'),_0xbb8f('0x64')]});}})[_0xbb8f('0x2d')](function(_0x1306c5){if(_0x1306c5){return{'count':_0x1306c5[_0xbb8f('0x22')],'rows':_[_0xbb8f('0x32')](_0x1306c5[_0xbb8f('0x65')],function(_0x22ed39){return{'membername':_0x22ed39['name'],'UserId':_0x22ed39['id'],'queue_name':_0x5c98cc['name'],'MailQueueId':_0x5c98cc['id'],'interface':util[_0xbb8f('0x66')](_0xbb8f('0x67'),_0xbb8f('0x68'),_0x22ed39[_0xbb8f('0x30')]),'penalty':0x0,'paused':_0x22ed39[_0xbb8f('0x62')],'createdAt':_0x22ed39[_0xbb8f('0x64')],'updatedAt':_0x22ed39[_0xbb8f('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbb8f('0x2d')](respondWithFilteredResult(_0x4495bf,_0x13f2bc))[_0xbb8f('0x4a')](handleError(_0x4495bf,null));};exports[_0xbb8f('0x69')]=function(_0x379f0b,_0x403cf4,_0x5a6c43){var _0x55503c={};var _0x39a9d0={};var _0x518b20;var _0x2797d8;return db[_0xbb8f('0x48')][_0xbb8f('0x5b')]({'where':{'id':_0x379f0b[_0xbb8f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x403cf4,null))[_0xbb8f('0x2d')](function(_0x27a12f){if(_0x27a12f){_0x518b20=_0x27a12f;_0x39a9d0[_0xbb8f('0x36')]=_[_0xbb8f('0x4c')](db['Team'][_0xbb8f('0x4d')]);_0x39a9d0[_0xbb8f('0x37')]=_[_0xbb8f('0x4c')](_0x379f0b[_0xbb8f('0x37')]);_0x39a9d0[_0xbb8f('0x38')]=_[_0xbb8f('0x39')](_0x39a9d0['model'],_0x39a9d0[_0xbb8f('0x37')]);_0x55503c['attributes']=_[_0xbb8f('0x39')](_0x39a9d0[_0xbb8f('0x36')],qs[_0xbb8f('0x3a')](_0x379f0b[_0xbb8f('0x37')][_0xbb8f('0x3a')]));_0x55503c['attributes']=_0x55503c[_0xbb8f('0x3b')]['length']?_0x55503c[_0xbb8f('0x3b')]:_0x39a9d0['model'];_0x55503c['order']=qs[_0xbb8f('0x40')](_0x379f0b[_0xbb8f('0x37')][_0xbb8f('0x40')]);_0x55503c[_0xbb8f('0x41')]=qs[_0xbb8f('0x38')](_['pick'](_0x379f0b[_0xbb8f('0x37')],_0x39a9d0[_0xbb8f('0x38')]));if(_0x379f0b[_0xbb8f('0x37')][_0xbb8f('0x42')]){_0x55503c[_0xbb8f('0x41')]=_[_0xbb8f('0x43')](_0x55503c[_0xbb8f('0x41')],{'$or':_[_0xbb8f('0x32')](_0x55503c['attributes'],function(_0x474c70){var _0x2e146e={};_0x2e146e[_0x474c70]={'$like':'%'+_0x379f0b[_0xbb8f('0x37')][_0xbb8f('0x42')]+'%'};return _0x2e146e;})});}_0x55503c=_['merge']({},_0x55503c,_0x379f0b['options']);return _0x518b20[_0xbb8f('0x69')](_0x55503c);}})[_0xbb8f('0x2d')](function(_0x5f4e72){if(_0x5f4e72){_0x2797d8=_0x5f4e72['length'];if(!_0x379f0b[_0xbb8f('0x37')][_0xbb8f('0x3d')](_0xbb8f('0x3e'))){_0x55503c[_0xbb8f('0x23')]=qs[_0xbb8f('0x23')](_0x379f0b[_0xbb8f('0x37')][_0xbb8f('0x23')]);_0x55503c[_0xbb8f('0x20')]=qs[_0xbb8f('0x20')](_0x379f0b[_0xbb8f('0x37')][_0xbb8f('0x20')]);}return _0x518b20[_0xbb8f('0x69')](_0x55503c);}})[_0xbb8f('0x2d')](function(_0x319dfb){if(_0x319dfb){return _0x319dfb?{'count':_0x2797d8,'rows':_0x319dfb}:null;}})['then'](respondWithResult(_0x403cf4,null))[_0xbb8f('0x4a')](handleError(_0x403cf4,null));};exports[_0xbb8f('0x6a')]=function(_0x51ee38,_0x3f36a5,_0x5b444a){var _0x568d47=_0x51ee38[_0xbb8f('0x50')][_0xbb8f('0x6b')];return db[_0xbb8f('0x6c')][_0xbb8f('0x49')]({'where':{'id':_0x568d47},'attributes':['id'],'include':[{'model':db[_0xbb8f('0x5f')],'as':_0xbb8f('0x6d'),'attributes':['id','name',_0xbb8f('0x6e'),_0xbb8f('0x6f'),'interface'],'raw':!![]}]})[_0xbb8f('0x2d')](function(_0x19d9bc){if(_0x19d9bc){var _0x30bb13=_[_0xbb8f('0x70')](_0x19d9bc,function(_0x505e10){var _0x195954=_0x505e10[_0xbb8f('0x29')]({'plain':!![]});return _0x195954[_0xbb8f('0x6d')];});return db['MailQueue'][_0xbb8f('0x4e')]({'where':{'id':_0x51ee38['params']['id']}})[_0xbb8f('0x2d')](function(_0x59f404){return db[_0xbb8f('0x71')][_0xbb8f('0x72')](function(_0x3dc554){return _0x59f404[_0xbb8f('0x6a')](_0x568d47,{'transaction':_0x3dc554})[_0xbb8f('0x2d')](function(){return BPromise['each'](_0x30bb13,function(_0x2742ae){return db[_0xbb8f('0x5c')][_0xbb8f('0x73')]({'where':{'UserId':_0x2742ae['id'],'MailQueueId':_0x51ee38[_0xbb8f('0x4b')]['id']},'transaction':_0x3dc554});});})['then'](function(){_0x30bb13[_0xbb8f('0x74')](function(_0x36976c){socket[_0xbb8f('0x75')](_0xbb8f('0x76'),{'UserId':_0x36976c['id'],'MailQueueId':_0x59f404['id']});});});});});}})[_0xbb8f('0x2d')](respondWithStatusCode(_0x3f36a5,null))[_0xbb8f('0x4a')](handleError(_0x3f36a5,null));};exports[_0xbb8f('0x77')]=function(_0x25d82a,_0x1ac81a,_0x579dde){return db['Team'][_0xbb8f('0x49')]({'where':{'id':_0x25d82a[_0xbb8f('0x37')][_0xbb8f('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xbb8f('0x5f')],'as':_0xbb8f('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xbb8f('0x2d')](handleEntityNotFound(_0x1ac81a,null))[_0xbb8f('0x2d')](function(_0x59f1e1){var _0x21c7f8=_[_0xbb8f('0x32')](_0x59f1e1,'id');var _0x251b36=[];var _0x2b2865=[];var _0x34036e=squel['select']();_0x34036e[_0xbb8f('0x78')]('tq.TeamId')['from'](_0xbb8f('0x79'),'tq')[_0xbb8f('0x7a')](_0xbb8f('0x7b'),'ut',_0xbb8f('0x7c'))[_0xbb8f('0x41')]('MailQueueId\x20=\x20?',_0x25d82a[_0xbb8f('0x4b')]['id']);for(var _0x1096a1=0x0;_0x1096a1<_0x59f1e1[_0xbb8f('0x3c')];_0x1096a1+=0x1){let _0x1eb6f9=_0x59f1e1[_0x1096a1];for(var _0x50cb06=0x0;_0x50cb06<_0x1eb6f9[_0xbb8f('0x6d')][_0xbb8f('0x3c')];_0x50cb06+=0x1){let _0x1a012c=_0x1eb6f9['Agents'][_0x50cb06];var _0x27b040=_0x34036e['clone']();_0x27b040[_0xbb8f('0x41')]('ut.UserId\x20=\x20?',_0x1a012c['id']);_0x2b2865[_0xbb8f('0x7d')](db['sequelize'][_0xbb8f('0x37')](_0x27b040['toString'](),{'type':db[_0xbb8f('0x71')][_0xbb8f('0x7e')][_0xbb8f('0x7f')]})[_0xbb8f('0x2d')](function(_0x2c4f05){if(_0x2c4f05[_0xbb8f('0x3c')]===0x1){return _0x1a012c['id'];}else{var _0x21ec59=_[_0xbb8f('0x80')](_[_0xbb8f('0x32')](_0x2c4f05,_0xbb8f('0x81')),function(_0x4361a3){return _[_0xbb8f('0x82')](_0x21c7f8,_0x4361a3);});if(_0x21ec59){return _0x1a012c['id'];}}}));}}return BPromise[_0xbb8f('0x83')](_0x2b2865)[_0xbb8f('0x2d')](function(_0x5c3a9c){_0x251b36=_(_0x251b36)[_0xbb8f('0x84')](_0x5c3a9c)['compact']()[_0xbb8f('0x85')]();return db[_0xbb8f('0x48')][_0xbb8f('0x4e')]({'where':{'id':_0x25d82a[_0xbb8f('0x4b')]['id']}})[_0xbb8f('0x2d')](function(_0x40b866){return db[_0xbb8f('0x71')][_0xbb8f('0x72')](function(_0x3257a7){return _0x40b866[_0xbb8f('0x77')](_0x25d82a[_0xbb8f('0x37')]['ids'],{'transaction':_0x3257a7})[_0xbb8f('0x2d')](function(){if(!_[_0xbb8f('0x86')](_0x251b36)){return _0x40b866[_0xbb8f('0x87')](_0x251b36,{'transaction':_0x3257a7});}})[_0xbb8f('0x2d')](function(){_0x251b36['forEach'](function(_0x2773e2){socket[_0xbb8f('0x75')]('userMailQueue:remove',{'UserId':_0x2773e2,'MailQueueId':_0x40b866['id']});});});});});});})[_0xbb8f('0x2d')](respondWithStatusCode(_0x1ac81a,null))[_0xbb8f('0x4a')](handleError(_0x1ac81a,null));};exports[_0xbb8f('0x88')]=function(_0x177582,_0x1400b8,_0x27ec4d){return db[_0xbb8f('0x48')][_0xbb8f('0x4e')]({'where':{'id':_0x177582['params']['id']}})[_0xbb8f('0x2d')](handleEntityNotFound(_0x1400b8,null))['then'](function(_0x2f3525){if(_0x2f3525){return _0x2f3525[_0xbb8f('0x88')](_0x177582['body'][_0xbb8f('0x6b')],_['omit'](_0x177582[_0xbb8f('0x50')],[_0xbb8f('0x6b'),'id'])||{})[_0xbb8f('0x89')](function(_0x3de54c){for(var _0x5f4fd7=0x0;_0x5f4fd7<_0x177582[_0xbb8f('0x50')][_0xbb8f('0x6b')]['length'];_0x5f4fd7+=0x1){socket['emit'](_0xbb8f('0x76'),{'UserId':Number(_0x177582['body'][_0xbb8f('0x6b')][_0x5f4fd7]),'MailQueueId':Number(_0x177582[_0xbb8f('0x4b')]['id'])});}return _0x3de54c;});}})['then'](respondWithResult(_0x1400b8,null))[_0xbb8f('0x4a')](handleError(_0x1400b8,null));};exports[_0xbb8f('0x87')]=function(_0x1d8fdc,_0x494214,_0x159616){return db[_0xbb8f('0x48')][_0xbb8f('0x4e')]({'where':{'id':_0x1d8fdc[_0xbb8f('0x4b')]['id']}})[_0xbb8f('0x2d')](handleEntityNotFound(_0x494214,null))[_0xbb8f('0x2d')](function(_0x10e56c){if(_0x10e56c){return _0x10e56c[_0xbb8f('0x87')](_0x1d8fdc[_0xbb8f('0x37')][_0xbb8f('0x6b')])[_0xbb8f('0x2d')](function(){if(_[_0xbb8f('0x8a')](_0x1d8fdc[_0xbb8f('0x37')][_0xbb8f('0x6b')])){for(var _0x3877aa=0x0;_0x3877aa<_0x1d8fdc[_0xbb8f('0x37')][_0xbb8f('0x6b')][_0xbb8f('0x3c')];_0x3877aa+=0x1){socket[_0xbb8f('0x75')]('userMailQueue:remove',{'UserId':Number(_0x1d8fdc['query'][_0xbb8f('0x6b')][_0x3877aa]),'MailQueueId':Number(_0x1d8fdc[_0xbb8f('0x4b')]['id'])});}}else{socket[_0xbb8f('0x75')](_0xbb8f('0x8b'),{'UserId':Number(_0x1d8fdc[_0xbb8f('0x37')][_0xbb8f('0x6b')]),'MailQueueId':Number(_0x1d8fdc[_0xbb8f('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x494214,null))[_0xbb8f('0x4a')](handleError(_0x494214,null));};exports[_0xbb8f('0x8c')]=function(_0x9c4118,_0x2a13ad,_0x520fb7){var _0x11fac0={};var _0x2432ec={};var _0x44afe9;var _0x2b3f61;return db['MailQueue'][_0xbb8f('0x5b')]({'where':{'id':_0x9c4118[_0xbb8f('0x4b')]['id']}})[_0xbb8f('0x2d')](handleEntityNotFound(_0x2a13ad,null))[_0xbb8f('0x2d')](function(_0x32464e){if(_0x32464e){_0x44afe9=_0x32464e;_0x2432ec[_0xbb8f('0x36')]=_['keys'](db['User'][_0xbb8f('0x4d')]);_0x2432ec[_0xbb8f('0x37')]=_[_0xbb8f('0x4c')](_0x9c4118[_0xbb8f('0x37')]);_0x2432ec[_0xbb8f('0x38')]=_[_0xbb8f('0x39')](_0x2432ec[_0xbb8f('0x36')],_0x2432ec['query']);_0x11fac0['attributes']=_[_0xbb8f('0x39')](_0x2432ec[_0xbb8f('0x36')],qs[_0xbb8f('0x3a')](_0x9c4118[_0xbb8f('0x37')][_0xbb8f('0x3a')]));_0x11fac0[_0xbb8f('0x3b')]=_0x11fac0[_0xbb8f('0x3b')][_0xbb8f('0x3c')]?_0x11fac0[_0xbb8f('0x3b')]:_0x2432ec[_0xbb8f('0x36')];_0x11fac0[_0xbb8f('0x3f')]=qs[_0xbb8f('0x40')](_0x9c4118[_0xbb8f('0x37')]['sort']);_0x11fac0[_0xbb8f('0x41')]=qs[_0xbb8f('0x38')](_['pick'](_0x9c4118[_0xbb8f('0x37')],_0x2432ec['filters']));if(_0x9c4118[_0xbb8f('0x37')][_0xbb8f('0x42')]){_0x11fac0[_0xbb8f('0x41')]=_[_0xbb8f('0x43')](_0x11fac0[_0xbb8f('0x41')],{'$or':_[_0xbb8f('0x32')](_0x11fac0[_0xbb8f('0x3b')],function(_0x241a8a){var _0x3c900c={};_0x3c900c[_0x241a8a]={'$like':'%'+_0x9c4118[_0xbb8f('0x37')][_0xbb8f('0x42')]+'%'};return _0x3c900c;})});}_0x11fac0=_[_0xbb8f('0x43')]({},_0x11fac0,_0x9c4118[_0xbb8f('0x45')]);return _0x44afe9[_0xbb8f('0x8c')](_0x11fac0);}})[_0xbb8f('0x2d')](function(_0x3690ba){if(_0x3690ba){_0x2b3f61=_0x3690ba[_0xbb8f('0x3c')];if(!_0x9c4118['query'][_0xbb8f('0x3d')](_0xbb8f('0x3e'))){_0x11fac0[_0xbb8f('0x23')]=qs[_0xbb8f('0x23')](_0x9c4118['query'][_0xbb8f('0x23')]);_0x11fac0[_0xbb8f('0x20')]=qs['offset'](_0x9c4118[_0xbb8f('0x37')][_0xbb8f('0x20')]);}return _0x44afe9[_0xbb8f('0x8c')](_0x11fac0);}})[_0xbb8f('0x2d')](function(_0x137ebc){if(_0x137ebc){return _0x137ebc?{'count':_0x2b3f61,'rows':_0x137ebc}:null;}})[_0xbb8f('0x2d')](respondWithResult(_0x2a13ad,null))['catch'](handleError(_0x2a13ad,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c0d2d8c..5573714 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 _0x40a3=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x42f682,_0x52af08){var _0x532605=function(_0x1317a6){while(--_0x1317a6){_0x42f682['push'](_0x42f682['shift']());}};_0x532605(++_0x52af08);}(_0x40a3,0x94));var _0x340a=function(_0x5de2d6,_0x4f9922){_0x5de2d6=_0x5de2d6-0x0;var _0xdc949c=_0x40a3[_0x5de2d6];return _0xdc949c;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x340a('0x0'))['db'][_0x340a('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x340a('0x2')](0x0);var events={'afterCreate':_0x340a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x212f59){return function(_0x41cf43,_0x599427,_0x48b393){MailQueueEvents[_0x340a('0x4')](_0x212f59+':'+_0x41cf43['id'],_0x41cf43);MailQueueEvents[_0x340a('0x4')](_0x212f59,_0x41cf43);_0x48b393(null);};}for(var e in events){if(events[_0x340a('0x5')](e)){var event=events[e];MailQueue[_0x340a('0x6')](e,emitEvent(event));}}module[_0x340a('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xd983=['exports','events','../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x33670a,_0x55e188){var _0x36ad1d=function(_0x3cacbb){while(--_0x3cacbb){_0x33670a['push'](_0x33670a['shift']());}};_0x36ad1d(++_0x55e188);}(_0xd983,0x10f));var _0x3d98=function(_0x10d394,_0x445fda){_0x10d394=_0x10d394-0x0;var _0x15daee=_0xd983[_0x10d394];return _0x15daee;};'use strict';var EventEmitter=require(_0x3d98('0x0'));var MailQueue=require(_0x3d98('0x1'))['db'][_0x3d98('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x3d98('0x3')](0x0);var events={'afterCreate':_0x3d98('0x4'),'afterUpdate':'update','afterDestroy':_0x3d98('0x5')};function emitEvent(_0x5051fd){return function(_0x1524b6,_0x4ce097,_0x196afa){MailQueueEvents[_0x3d98('0x6')](_0x5051fd+':'+_0x1524b6['id'],_0x1524b6);MailQueueEvents[_0x3d98('0x6')](_0x5051fd,_0x1524b6);_0x196afa(null);};}for(var e in events){if(events[_0x3d98('0x7')](e)){var event=events[e];MailQueue[_0x3d98('0x8')](e,emitEvent(event));}}module[_0x3d98('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 3588a23..6344b2b 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 _0x8775=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x8775,0x107));var _0x5877=function(_0x14490c,_0x50e8ab){_0x14490c=_0x14490c-0x0;var _0x2f6825=_0x8775[_0x14490c];return _0x2f6825;};'use strict';var _=require(_0x5877('0x0'));var util=require('util');var logger=require(_0x5877('0x1'))('api');var moment=require(_0x5877('0x2'));var BPromise=require(_0x5877('0x3'));var rp=require(_0x5877('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5877('0x5'));var config=require(_0x5877('0x6'));var attributes=require(_0x5877('0x7'));module[_0x5877('0x8')]=function(_0x2c1d5e,_0x452ed9){return _0x2c1d5e[_0x5877('0x9')](_0x5877('0xa'),attributes,{'tableName':_0x5877('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c21=['define','MailQueue','mail_queues','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x27135b,_0x56f6bd){var _0x33f7d8=function(_0x52c639){while(--_0x52c639){_0x27135b['push'](_0x27135b['shift']());}};_0x33f7d8(++_0x56f6bd);}(_0x2c21,0x1d7));var _0x12c2=function(_0x45bfbc,_0x1ff15e){_0x45bfbc=_0x45bfbc-0x0;var _0x407018=_0x2c21[_0x45bfbc];return _0x407018;};'use strict';var _=require('lodash');var util=require(_0x12c2('0x0'));var logger=require(_0x12c2('0x1'))(_0x12c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x12c2('0x3'));var fs=require('fs');var path=require(_0x12c2('0x4'));var rimraf=require(_0x12c2('0x5'));var config=require(_0x12c2('0x6'));var attributes=require(_0x12c2('0x7'));module[_0x12c2('0x8')]=function(_0x1cc5c4,_0x4eace1){return _0x1cc5c4[_0x12c2('0x9')](_0x12c2('0xa'),attributes,{'tableName':_0x12c2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index edd71b4..ee654a0 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 _0x5e4b=['where','attributes','include','map','model','ShowMailQueue','MailQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','GetMailQueue','findAll','options','raw'];(function(_0x91d3c2,_0x4f076a){var _0x3f3f49=function(_0x6ab067){while(--_0x6ab067){_0x91d3c2['push'](_0x91d3c2['shift']());}};_0x3f3f49(++_0x4f076a);}(_0x5e4b,0x7a));var _0xb5e4=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x5e4b[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0xb5e4('0x0'));var moment=require(_0xb5e4('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5e4('0x2'));var fs=require('fs');var Redis=require(_0xb5e4('0x3'));var db=require(_0xb5e4('0x4'))['db'];var utils=require(_0xb5e4('0x5'));var logger=require(_0xb5e4('0x6'))(_0xb5e4('0x7'));var config=require(_0xb5e4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb5e4('0x9')]['http']({'port':0x232a});config[_0xb5e4('0xa')]=_['defaults'](config['redis'],{'host':_0xb5e4('0xb'),'port':0x18eb});var socket=require(_0xb5e4('0xc'))(new Redis(config[_0xb5e4('0xa')]));require(_0xb5e4('0xd'))[_0xb5e4('0xe')](socket);function respondWithRpcPromise(_0x5c8bc3,_0x35e23e,_0x504118){return new BPromise(function(_0x1ca950,_0xa0902f){return client[_0xb5e4('0xf')](_0x5c8bc3,_0x504118)[_0xb5e4('0x10')](function(_0x47bf1d){logger['info'](_0xb5e4('0x11'),_0x35e23e,_0xb5e4('0x12'));logger[_0xb5e4('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x35e23e,_0xb5e4('0x12'),JSON[_0xb5e4('0x14')](_0x47bf1d));if(_0x47bf1d['error']){if(_0x47bf1d['error'][_0xb5e4('0x15')]===0x1f4){logger[_0xb5e4('0x16')]('MailQueue,\x20%s,\x20%s',_0x35e23e,_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);return _0xa0902f(_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);}logger[_0xb5e4('0x16')](_0xb5e4('0x11'),_0x35e23e,_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);return _0x1ca950(_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);}else{logger[_0xb5e4('0x18')](_0xb5e4('0x11'),_0x35e23e,_0xb5e4('0x12'));_0x1ca950(_0x47bf1d['result']['message']);}})[_0xb5e4('0x19')](function(_0x2d119a){logger[_0xb5e4('0x16')](_0xb5e4('0x11'),_0x35e23e,_0x2d119a);_0xa0902f(_0x2d119a);});});}exports[_0xb5e4('0x1a')]=function(_0x1bcd21){var _0x147cd3=this;return new Promise(function(_0x2597f9,_0x206be5){return db['MailQueue'][_0xb5e4('0x1b')]({'raw':_0x1bcd21['options']?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x1d')]===undefined?!![]:![]:!![],'where':_0x1bcd21[_0xb5e4('0x1c')]?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x1e')]||null:null,'attributes':_0x1bcd21[_0xb5e4('0x1c')]?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x1f')]||null:null,'limit':_0x1bcd21[_0xb5e4('0x1c')]?_0x1bcd21['options']['limit']||null:null,'include':_0x1bcd21['options']?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x1bcd21['options'][_0xb5e4('0x20')],function(_0x2414b4){return{'model':db[_0x2414b4[_0xb5e4('0x22')]],'as':_0x2414b4['as'],'attributes':_0x2414b4[_0xb5e4('0x1f')],'include':_0x2414b4[_0xb5e4('0x20')]?_['map'](_0x2414b4[_0xb5e4('0x20')],function(_0x2311c7){return{'model':db[_0x2311c7['model']],'as':_0x2311c7['as'],'attributes':_0x2311c7[_0xb5e4('0x1f')],'include':_0x2311c7[_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x2311c7[_0xb5e4('0x20')],function(_0xffcb75){return{'model':db[_0xffcb75[_0xb5e4('0x22')]],'as':_0xffcb75['as'],'attributes':_0xffcb75[_0xb5e4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5e4('0x10')](function(_0x2691b3){logger[_0xb5e4('0x18')](_0xb5e4('0x1a'),_0x1bcd21);logger[_0xb5e4('0x13')](_0xb5e4('0x1a'),_0x1bcd21,JSON['stringify'](_0x2691b3));_0x2597f9(_0x2691b3);})[_0xb5e4('0x19')](function(_0x26f6f7){logger[_0xb5e4('0x16')](_0xb5e4('0x1a'),_0x26f6f7['message'],_0x1bcd21);_0x206be5(_0x147cd3[_0xb5e4('0x16')](0x1f4,_0x26f6f7['message']));});});};exports[_0xb5e4('0x23')]=function(_0xdf6a19){var _0x205d02=this;return new Promise(function(_0x8c8835,_0x47106d){return db[_0xb5e4('0x24')][_0xb5e4('0x25')]({'raw':_0xdf6a19['options']?_0xdf6a19[_0xb5e4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xdf6a19[_0xb5e4('0x1c')]?_0xdf6a19[_0xb5e4('0x1c')][_0xb5e4('0x1e')]||null:null,'attributes':_0xdf6a19[_0xb5e4('0x1c')]?_0xdf6a19[_0xb5e4('0x1c')][_0xb5e4('0x1f')]||null:null,'include':_0xdf6a19[_0xb5e4('0x1c')]?_0xdf6a19['options']['include']?_[_0xb5e4('0x21')](_0xdf6a19['options']['include'],function(_0x594fd3){return{'model':db[_0x594fd3[_0xb5e4('0x22')]],'as':_0x594fd3['as'],'attributes':_0x594fd3[_0xb5e4('0x1f')],'include':_0x594fd3[_0xb5e4('0x20')]?_['map'](_0x594fd3[_0xb5e4('0x20')],function(_0x5920fb){return{'model':db[_0x5920fb[_0xb5e4('0x22')]],'as':_0x5920fb['as'],'attributes':_0x5920fb[_0xb5e4('0x1f')],'include':_0x5920fb[_0xb5e4('0x20')]?_['map'](_0x5920fb['include'],function(_0x1b7866){return{'model':db[_0x1b7866['model']],'as':_0x1b7866['as'],'attributes':_0x1b7866['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5e4('0x10')](function(_0x1435b3){logger[_0xb5e4('0x18')](_0xb5e4('0x23'),_0xdf6a19);logger['debug'](_0xb5e4('0x23'),_0xdf6a19,JSON['stringify'](_0x1435b3));_0x8c8835(_0x1435b3);})[_0xb5e4('0x19')](function(_0x3e405a){logger['error'](_0xb5e4('0x23'),_0x3e405a[_0xb5e4('0x17')],_0xdf6a19);_0x47106d(_0x205d02[_0xb5e4('0x16')](0x1f4,_0x3e405a['message']));});});}; \ No newline at end of file +var _0x5cea=['code','message','info','result','GetMailQueue','findAll','options','where','include','map','model','attributes','then','catch','find','ShowMailQueue','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c9b8b,_0x5e14dc){var _0x2a3127=function(_0x564ced){while(--_0x564ced){_0x1c9b8b['push'](_0x1c9b8b['shift']());}};_0x2a3127(++_0x5e14dc);}(_0x5cea,0x151));var _0xa5ce=function(_0x199146,_0x45d0a1){_0x199146=_0x199146-0x0;var _0x9e00f2=_0x5cea[_0x199146];return _0x9e00f2;};'use strict';var _=require('lodash');var util=require(_0xa5ce('0x0'));var moment=require(_0xa5ce('0x1'));var BPromise=require(_0xa5ce('0x2'));var rs=require(_0xa5ce('0x3'));var fs=require('fs');var Redis=require(_0xa5ce('0x4'));var db=require(_0xa5ce('0x5'))['db'];var utils=require(_0xa5ce('0x6'));var logger=require('../../config/logger')(_0xa5ce('0x7'));var config=require(_0xa5ce('0x8'));var jayson=require(_0xa5ce('0x9'));var client=jayson[_0xa5ce('0xa')][_0xa5ce('0xb')]({'port':0x232a});config[_0xa5ce('0xc')]=_[_0xa5ce('0xd')](config[_0xa5ce('0xc')],{'host':_0xa5ce('0xe'),'port':0x18eb});var socket=require(_0xa5ce('0xf'))(new Redis(config[_0xa5ce('0xc')]));require(_0xa5ce('0x10'))[_0xa5ce('0x11')](socket);function respondWithRpcPromise(_0x1a45ad,_0x34f92d,_0x5d5f8d){return new BPromise(function(_0x1af483,_0x4d8c80){return client[_0xa5ce('0x12')](_0x1a45ad,_0x5d5f8d)['then'](function(_0x553ccd){logger['info']('MailQueue,\x20%s,\x20%s',_0x34f92d,_0xa5ce('0x13'));logger['debug'](_0xa5ce('0x14'),_0x34f92d,'request\x20sent',JSON[_0xa5ce('0x15')](_0x553ccd));if(_0x553ccd[_0xa5ce('0x16')]){if(_0x553ccd[_0xa5ce('0x16')][_0xa5ce('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x34f92d,_0x553ccd[_0xa5ce('0x16')][_0xa5ce('0x18')]);return _0x4d8c80(_0x553ccd[_0xa5ce('0x16')][_0xa5ce('0x18')]);}logger[_0xa5ce('0x16')]('MailQueue,\x20%s,\x20%s',_0x34f92d,_0x553ccd[_0xa5ce('0x16')]['message']);return _0x1af483(_0x553ccd['error'][_0xa5ce('0x18')]);}else{logger[_0xa5ce('0x19')]('MailQueue,\x20%s,\x20%s',_0x34f92d,_0xa5ce('0x13'));_0x1af483(_0x553ccd[_0xa5ce('0x1a')][_0xa5ce('0x18')]);}})['catch'](function(_0x4a6812){logger[_0xa5ce('0x16')]('MailQueue,\x20%s,\x20%s',_0x34f92d,_0x4a6812);_0x4d8c80(_0x4a6812);});});}exports[_0xa5ce('0x1b')]=function(_0x2e556c){var _0x599136=this;return new Promise(function(_0x412e4e,_0x3b1019){return db['MailQueue'][_0xa5ce('0x1c')]({'raw':_0x2e556c[_0xa5ce('0x1d')]?_0x2e556c['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e556c[_0xa5ce('0x1d')]?_0x2e556c[_0xa5ce('0x1d')][_0xa5ce('0x1e')]||null:null,'attributes':_0x2e556c[_0xa5ce('0x1d')]?_0x2e556c[_0xa5ce('0x1d')]['attributes']||null:null,'limit':_0x2e556c[_0xa5ce('0x1d')]?_0x2e556c['options']['limit']||null:null,'include':_0x2e556c[_0xa5ce('0x1d')]?_0x2e556c[_0xa5ce('0x1d')][_0xa5ce('0x1f')]?_[_0xa5ce('0x20')](_0x2e556c[_0xa5ce('0x1d')][_0xa5ce('0x1f')],function(_0x32422c){return{'model':db[_0x32422c[_0xa5ce('0x21')]],'as':_0x32422c['as'],'attributes':_0x32422c[_0xa5ce('0x22')],'include':_0x32422c[_0xa5ce('0x1f')]?_[_0xa5ce('0x20')](_0x32422c[_0xa5ce('0x1f')],function(_0x3ddaaa){return{'model':db[_0x3ddaaa[_0xa5ce('0x21')]],'as':_0x3ddaaa['as'],'attributes':_0x3ddaaa[_0xa5ce('0x22')],'include':_0x3ddaaa['include']?_[_0xa5ce('0x20')](_0x3ddaaa['include'],function(_0x610d3){return{'model':db[_0x610d3[_0xa5ce('0x21')]],'as':_0x610d3['as'],'attributes':_0x610d3[_0xa5ce('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa5ce('0x23')](function(_0x518cf6){logger[_0xa5ce('0x19')]('GetMailQueue',_0x2e556c);logger['debug'](_0xa5ce('0x1b'),_0x2e556c,JSON[_0xa5ce('0x15')](_0x518cf6));_0x412e4e(_0x518cf6);})[_0xa5ce('0x24')](function(_0x5913ba){logger['error'](_0xa5ce('0x1b'),_0x5913ba[_0xa5ce('0x18')],_0x2e556c);_0x3b1019(_0x599136['error'](0x1f4,_0x5913ba[_0xa5ce('0x18')]));});});};exports['ShowMailQueue']=function(_0x4c77c1){var _0x2e5481=this;return new Promise(function(_0x532008,_0x185486){return db['MailQueue'][_0xa5ce('0x25')]({'raw':_0x4c77c1[_0xa5ce('0x1d')]?_0x4c77c1[_0xa5ce('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4c77c1[_0xa5ce('0x1d')]?_0x4c77c1[_0xa5ce('0x1d')][_0xa5ce('0x1e')]||null:null,'attributes':_0x4c77c1[_0xa5ce('0x1d')]?_0x4c77c1[_0xa5ce('0x1d')][_0xa5ce('0x22')]||null:null,'include':_0x4c77c1[_0xa5ce('0x1d')]?_0x4c77c1[_0xa5ce('0x1d')][_0xa5ce('0x1f')]?_[_0xa5ce('0x20')](_0x4c77c1[_0xa5ce('0x1d')]['include'],function(_0x35c169){return{'model':db[_0x35c169[_0xa5ce('0x21')]],'as':_0x35c169['as'],'attributes':_0x35c169[_0xa5ce('0x22')],'include':_0x35c169[_0xa5ce('0x1f')]?_['map'](_0x35c169[_0xa5ce('0x1f')],function(_0x3e7a45){return{'model':db[_0x3e7a45[_0xa5ce('0x21')]],'as':_0x3e7a45['as'],'attributes':_0x3e7a45['attributes'],'include':_0x3e7a45['include']?_[_0xa5ce('0x20')](_0x3e7a45[_0xa5ce('0x1f')],function(_0x5f47d3){return{'model':db[_0x5f47d3['model']],'as':_0x5f47d3['as'],'attributes':_0x5f47d3[_0xa5ce('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f3809){logger[_0xa5ce('0x19')](_0xa5ce('0x26'),_0x4c77c1);logger[_0xa5ce('0x27')](_0xa5ce('0x26'),_0x4c77c1,JSON[_0xa5ce('0x15')](_0x4f3809));_0x532008(_0x4f3809);})['catch'](function(_0x45807d){logger[_0xa5ce('0x16')]('ShowMailQueue',_0x45807d[_0xa5ce('0x18')],_0x4c77c1);_0x185486(_0x2e5481[_0xa5ce('0x16')](0x1f4,_0x45807d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e531ba3..e434e95 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 _0x4e4c=['remove','update','emit','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x25d895,_0x455c2e){var _0x10a795=function(_0x3a3060){while(--_0x3a3060){_0x25d895['push'](_0x25d895['shift']());}};_0x10a795(++_0x455c2e);}(_0x4e4c,0x176));var _0xc4e4=function(_0x2345c2,_0x3d730e){_0x2345c2=_0x2345c2-0x0;var _0x1d1caa=_0x4e4c[_0x2345c2];return _0x1d1caa;};'use strict';var MailQueueEvents=require(_0xc4e4('0x0'));var events=[_0xc4e4('0x1'),_0xc4e4('0x2'),_0xc4e4('0x3')];function createListener(_0x55da26,_0x239624){return function(_0x1b613d){_0x239624[_0xc4e4('0x4')](_0x55da26,_0x1b613d);};}function removeListener(_0x544e91,_0x28fd96){return function(){MailQueueEvents['removeListener'](_0x544e91,_0x28fd96);};}exports[_0xc4e4('0x5')]=function(_0x1a1e9a){for(var _0x4af822=0x0,_0x15383d=events[_0xc4e4('0x6')];_0x4af822<_0x15383d;_0x4af822++){var _0x38dc97=events[_0x4af822];var _0x581cd6=createListener(_0xc4e4('0x7')+_0x38dc97,_0x1a1e9a);MailQueueEvents['on'](_0x38dc97,_0x581cd6);}}; \ No newline at end of file +var _0xe651=['update','removeListener','register','length','mailQueue:','./mailQueue.events','save','remove'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xe651,0x1a5));var _0x1e65=function(_0x567b1e,_0x5c5f62){_0x567b1e=_0x567b1e-0x0;var _0x30a32d=_0xe651[_0x567b1e];return _0x30a32d;};'use strict';var MailQueueEvents=require(_0x1e65('0x0'));var events=[_0x1e65('0x1'),_0x1e65('0x2'),_0x1e65('0x3')];function createListener(_0x37770e,_0x353c78){return function(_0x2d0c07){_0x353c78['emit'](_0x37770e,_0x2d0c07);};}function removeListener(_0x20f48b,_0x4d11ee){return function(){MailQueueEvents[_0x1e65('0x4')](_0x20f48b,_0x4d11ee);};}exports[_0x1e65('0x5')]=function(_0x3d4fd5){for(var _0x517358=0x0,_0x5f3e21=events[_0x1e65('0x6')];_0x517358<_0x5f3e21;_0x517358++){var _0x54f991=events[_0x517358];var _0x3975ae=createListener(_0x1e65('0x7')+_0x54f991,_0x3d4fd5);MailQueueEvents['on'](_0x54f991,_0x3975ae);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4919e3d..719909c 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 _0x4176=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x3b4ee4,_0x96e26d){var _0x374b79=function(_0x527d29){while(--_0x527d29){_0x3b4ee4['push'](_0x3b4ee4['shift']());}};_0x374b79(++_0x96e26d);}(_0x4176,0x15d));var _0x6417=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x4176[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x6417('0x0'));var util=require('util');var path=require(_0x6417('0x1'));var timeout=require(_0x6417('0x2'));var express=require(_0x6417('0x3'));var router=express[_0x6417('0x4')]();var fs_extra=require(_0x6417('0x5'));var auth=require(_0x6417('0x6'));var interaction=require(_0x6417('0x7'));var config=require(_0x6417('0x8'));var controller=require(_0x6417('0x9'));router[_0x6417('0xa')]('/',auth[_0x6417('0xb')](),controller[_0x6417('0xc')]);router[_0x6417('0xa')]('/describe',auth[_0x6417('0xb')](),controller['describe']);router[_0x6417('0xa')](_0x6417('0xd'),auth[_0x6417('0xb')](),controller[_0x6417('0xe')]);router[_0x6417('0xf')]('/',auth['isAuthenticated'](),controller[_0x6417('0x10')]);router[_0x6417('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6417('0x12')]);router[_0x6417('0x13')](_0x6417('0xd'),auth['isAuthenticated'](),controller[_0x6417('0x14')]);module[_0x6417('0x15')]=router; \ No newline at end of file +var _0x8429=['/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create'];(function(_0x1b7bb9,_0x1cec5b){var _0x46e70f=function(_0x2248c1){while(--_0x2248c1){_0x1b7bb9['push'](_0x1b7bb9['shift']());}};_0x46e70f(++_0x1cec5b);}(_0x8429,0x147));var _0x9842=function(_0x414dcc,_0x158573){_0x414dcc=_0x414dcc-0x0;var _0x48b61d=_0x8429[_0x414dcc];return _0x48b61d;};'use strict';var multer=require(_0x9842('0x0'));var util=require(_0x9842('0x1'));var path=require(_0x9842('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9842('0x3')]();var fs_extra=require(_0x9842('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9842('0x5'));var config=require(_0x9842('0x6'));var controller=require(_0x9842('0x7'));router[_0x9842('0x8')]('/',auth[_0x9842('0x9')](),controller[_0x9842('0xa')]);router[_0x9842('0x8')](_0x9842('0xb'),auth[_0x9842('0x9')](),controller[_0x9842('0xc')]);router['get']('/:id',auth[_0x9842('0x9')](),controller[_0x9842('0xd')]);router['post']('/',auth[_0x9842('0x9')](),controller[_0x9842('0xe')]);router['put'](_0x9842('0xf'),auth['isAuthenticated'](),controller[_0x9842('0x10')]);router[_0x9842('0x11')](_0x9842('0xf'),auth[_0x9842('0x9')](),controller['destroy']);module[_0x9842('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 21165a3..32a2afd 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 _0x4c8f=['sequelize','STRING','DATE','moment'];(function(_0x3b3b42,_0x1304d9){var _0x278b61=function(_0x1de9a3){while(--_0x1de9a3){_0x3b3b42['push'](_0x3b3b42['shift']());}};_0x278b61(++_0x1304d9);}(_0x4c8f,0x10b));var _0xf4c8=function(_0x56d4fa,_0x11decd){_0x56d4fa=_0x56d4fa-0x0;var _0x2d728d=_0x4c8f[_0x56d4fa];return _0x2d728d;};'use strict';var moment=require(_0xf4c8('0x0'));var Sequelize=require(_0xf4c8('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf4c8('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf4c8('0x3')]},'leaveAt':{'type':Sequelize[_0xf4c8('0x3')]},'acceptAt':{'type':Sequelize[_0xf4c8('0x3')]},'exitAt':{'type':Sequelize[_0xf4c8('0x3')]},'reason':{'type':Sequelize[_0xf4c8('0x2')]}}; \ No newline at end of file +var _0x0327=['sequelize','exports','STRING','DATE','moment'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x0327,0x18f));var _0x7032=function(_0xd206ad,_0x1c3175){_0xd206ad=_0xd206ad-0x0;var _0x19322d=_0x0327[_0xd206ad];return _0x19322d;};'use strict';var moment=require(_0x7032('0x0'));var Sequelize=require(_0x7032('0x1'));module[_0x7032('0x2')]={'uniqueid':{'type':Sequelize[_0x7032('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7032('0x3')]},'joinAt':{'type':Sequelize[_0x7032('0x4')]},'leaveAt':{'type':Sequelize[_0x7032('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7032('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 6e24601..a62843f 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 _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','MailQueueReport','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x896e,0x1e9));var _0xe896=function(_0x3aa91b,_0x26d32c){_0x3aa91b=_0x3aa91b-0x0;var _0x4aff48=_0x896e[_0x3aa91b];return _0x4aff48;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['MailQueueReport'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':!![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['MailQueueReport'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file +var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','MailQueueReport','rawAttributes','type'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['MailQueueReport'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':!![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['MailQueueReport']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['MailQueueReport'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 2add4dc..e123c06 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 _0x35e6=['api','moment','request-promise','path','rimraf','../../config/environment','MailQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x35e6,0xb2));var _0x635e=function(_0x1aac1d,_0x1dca6c){_0x1aac1d=_0x1aac1d-0x0;var _0x140f0d=_0x35e6[_0x1aac1d];return _0x140f0d;};'use strict';var _=require(_0x635e('0x0'));var util=require('util');var logger=require(_0x635e('0x1'))(_0x635e('0x2'));var moment=require(_0x635e('0x3'));var BPromise=require('bluebird');var rp=require(_0x635e('0x4'));var fs=require('fs');var path=require(_0x635e('0x5'));var rimraf=require(_0x635e('0x6'));var config=require(_0x635e('0x7'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x4f7fc3,_0x26e1f5){return _0x4f7fc3['define'](_0x635e('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x635e('0x9'),'fields':[_0x635e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x73ca=['uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue'];(function(_0x32f9ae,_0x26553b){var _0x489bb7=function(_0x5b5a57){while(--_0x5b5a57){_0x32f9ae['push'](_0x32f9ae['shift']());}};_0x489bb7(++_0x26553b);}(_0x73ca,0x7a));var _0xa73c=function(_0x13c66f,_0x476ed2){_0x13c66f=_0x13c66f-0x0;var _0x3b1456=_0x73ca[_0x13c66f];return _0x3b1456;};'use strict';var _=require(_0xa73c('0x0'));var util=require(_0xa73c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa73c('0x2'));var BPromise=require('bluebird');var rp=require(_0xa73c('0x3'));var fs=require('fs');var path=require(_0xa73c('0x4'));var rimraf=require(_0xa73c('0x5'));var config=require(_0xa73c('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0xa73c('0x7')]=function(_0x3ee8c,_0x40372d){return _0x3ee8c['define'](_0xa73c('0x8'),attributes,{'tableName':_0xa73c('0x9'),'paranoid':![],'indexes':[{'name':_0xa73c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index bac8922..450ce75 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4547d1,_0x4f1e14){var _0x54250c=function(_0x253e3d){while(--_0x253e3d){_0x4547d1['push'](_0x4547d1['shift']());}};_0x54250c(++_0x4f1e14);}(_0x1261,0x144));var _0x1126=function(_0x57ec1a,_0x2b7624){_0x57ec1a=_0x57ec1a-0x0;var _0x2159ad=_0x1261[_0x57ec1a];return _0x2159ad;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x51ea1b,_0x1c5a3b){var _0x56d914=function(_0x34623a){while(--_0x34623a){_0x51ea1b['push'](_0x51ea1b['shift']());}};_0x56d914(++_0x1c5a3b);}(_0xdb28,0x106));var _0x8db2=function(_0x4bd9a3,_0x4978a3){_0x4bd9a3=_0x4bd9a3-0x0;var _0x23ccb5=_0xdb28[_0x4bd9a3];return _0x23ccb5;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 20929f7..36f8cb4 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(_0x17a142,_0x402132){var _0x552792=function(_0x112030){while(--_0x112030){_0x17a142['push'](_0x17a142['shift']());}};_0x552792(++_0x402132);}(_0x70e0,0x17b));var _0x070e=function(_0x4c3d1d,_0x29dcad){_0x4c3d1d=_0x4c3d1d-0x0;var _0x296af0=_0x70e0[_0x4c3d1d];return _0x296af0;};'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(_0x5bfae5,_0x5415dd){var _0x124627=function(_0x45330b){while(--_0x45330b){_0x5bfae5['push'](_0x5bfae5['shift']());}};_0x124627(++_0x5415dd);}(_0xe706,0xa3));var _0x6e70=function(_0x19046c,_0x2494b5){_0x19046c=_0x19046c-0x0;var _0x469c79=_0xe706[_0x19046c];return _0x469c79;};'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 59ee84b..ff2b062 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 _0xdb6a=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x58d8d7,_0x108377){var _0x339d20=function(_0x45849e){while(--_0x45849e){_0x58d8d7['push'](_0x58d8d7['shift']());}};_0x339d20(++_0x108377);}(_0xdb6a,0x196));var _0xadb6=function(_0x341944,_0x3bc54a){_0x341944=_0x341944-0x0;var _0x45d230=_0xdb6a[_0x341944];return _0x45d230;};'use strict';var Sequelize=require('sequelize');module[_0xadb6('0x0')]={'description':{'type':Sequelize[_0xadb6('0x1')]},'host':{'type':Sequelize[_0xadb6('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xadb6('0x1')]},'port':{'type':Sequelize[_0xadb6('0x2')]},'tls':{'type':Sequelize[_0xadb6('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xadb6('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xadb6('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xadb6('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xadb6('0x1')]},'modernAuthentication':{'type':Sequelize[_0xadb6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xefab=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0xefab,0x73));var _0xbefa=function(_0x234cdb,_0x28750b){_0x234cdb=_0x234cdb-0x0;var _0x1d18bb=_0xefab[_0x234cdb];return _0x1d18bb;};'use strict';var Sequelize=require(_0xbefa('0x0'));module[_0xbefa('0x1')]={'description':{'type':Sequelize[_0xbefa('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xbefa('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbefa('0x2')]},'port':{'type':Sequelize[_0xbefa('0x4')]},'tls':{'type':Sequelize[_0xbefa('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xbefa('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xbefa('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xbefa('0x2')]},'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 4801892..5340421 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 _0x7df3=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','api'];(function(_0x565d6b,_0x4dbea1){var _0x1bd2f2=function(_0x5ef50b){while(--_0x5ef50b){_0x565d6b['push'](_0x565d6b['shift']());}};_0x1bd2f2(++_0x4dbea1);}(_0x7df3,0x11d));var _0x37df=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7df3[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var logger=require('../../config/logger')(_0x37df('0x2'));var moment=require(_0x37df('0x3'));var BPromise=require(_0x37df('0x4'));var rp=require(_0x37df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37df('0x6'));var config=require(_0x37df('0x7'));var attributes=require(_0x37df('0x8'));module[_0x37df('0x9')]=function(_0x2cd958,_0xf51712){return _0x2cd958[_0x37df('0xa')](_0x37df('0xb'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd32f=['mail_servers_in','util','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','define'];(function(_0x1e9dd1,_0x2e180a){var _0x1752dc=function(_0x2612f0){while(--_0x2612f0){_0x1e9dd1['push'](_0x1e9dd1['shift']());}};_0x1752dc(++_0x2e180a);}(_0xd32f,0x1c4));var _0xfd32=function(_0x37b8c8,_0x7a30b4){_0x37b8c8=_0x37b8c8-0x0;var _0x50a494=_0xd32f[_0x37b8c8];return _0x50a494;};'use strict';var _=require('lodash');var util=require(_0xfd32('0x0'));var logger=require('../../config/logger')(_0xfd32('0x1'));var moment=require(_0xfd32('0x2'));var BPromise=require(_0xfd32('0x3'));var rp=require(_0xfd32('0x4'));var fs=require('fs');var path=require(_0xfd32('0x5'));var rimraf=require(_0xfd32('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd32('0x7'));module[_0xfd32('0x8')]=function(_0x55ed00,_0x390c5e){return _0x55ed00[_0xfd32('0x9')]('MailServerIn',attributes,{'tableName':_0xfd32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 7829edf..1658d24 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 _0xc719=['client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','code','message','error','catch','MailServerIn','findAll','options','raw','where','attributes','map','model','include','GetMailServerIn','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1559e3,_0x2f8dea){var _0x33517c=function(_0x2343a7){while(--_0x2343a7){_0x1559e3['push'](_0x1559e3['shift']());}};_0x33517c(++_0x2f8dea);}(_0xc719,0x1d2));var _0x9c71=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0xc719[_0x5b8685];return _0xa3ef57;};'use strict';var _=require(_0x9c71('0x0'));var util=require(_0x9c71('0x1'));var moment=require(_0x9c71('0x2'));var BPromise=require(_0x9c71('0x3'));var rs=require(_0x9c71('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c71('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c71('0x6'))(_0x9c71('0x7'));var config=require(_0x9c71('0x8'));var jayson=require(_0x9c71('0x9'));var client=jayson[_0x9c71('0xa')][_0x9c71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x413519,_0x162af5,_0x55a82e){return new BPromise(function(_0x1c27d2,_0x2f212e){return client[_0x9c71('0xc')](_0x413519,_0x55a82e)[_0x9c71('0xd')](function(_0x37bc17){logger[_0x9c71('0xe')](_0x9c71('0xf'),_0x162af5,_0x9c71('0x10'));logger[_0x9c71('0x11')](_0x9c71('0x12'),_0x162af5,_0x9c71('0x10'),JSON[_0x9c71('0x13')](_0x37bc17));if(_0x37bc17['error']){if(_0x37bc17['error'][_0x9c71('0x14')]===0x1f4){logger['error'](_0x9c71('0xf'),_0x162af5,_0x37bc17['error'][_0x9c71('0x15')]);return _0x2f212e(_0x37bc17[_0x9c71('0x16')][_0x9c71('0x15')]);}logger['error'](_0x9c71('0xf'),_0x162af5,_0x37bc17[_0x9c71('0x16')][_0x9c71('0x15')]);return _0x1c27d2(_0x37bc17['error']['message']);}else{logger[_0x9c71('0xe')](_0x9c71('0xf'),_0x162af5,'request\x20sent');_0x1c27d2(_0x37bc17['result']['message']);}})[_0x9c71('0x17')](function(_0x588f14){logger[_0x9c71('0x16')](_0x9c71('0xf'),_0x162af5,_0x588f14);_0x2f212e(_0x588f14);});});}exports['GetMailServerIn']=function(_0x3941b9){var _0x287f35=this;return new Promise(function(_0x550bc1,_0x3a1020){return db[_0x9c71('0x18')][_0x9c71('0x19')]({'raw':_0x3941b9[_0x9c71('0x1a')]?_0x3941b9[_0x9c71('0x1a')][_0x9c71('0x1b')]===undefined?!![]:![]:!![],'where':_0x3941b9[_0x9c71('0x1a')]?_0x3941b9[_0x9c71('0x1a')][_0x9c71('0x1c')]||null:null,'attributes':_0x3941b9[_0x9c71('0x1a')]?_0x3941b9[_0x9c71('0x1a')][_0x9c71('0x1d')]||null:null,'limit':_0x3941b9[_0x9c71('0x1a')]?_0x3941b9[_0x9c71('0x1a')]['limit']||null:null,'include':_0x3941b9['options']?_0x3941b9[_0x9c71('0x1a')]['include']?_[_0x9c71('0x1e')](_0x3941b9[_0x9c71('0x1a')]['include'],function(_0xdfa2ed){return{'model':db[_0xdfa2ed[_0x9c71('0x1f')]],'as':_0xdfa2ed['as'],'attributes':_0xdfa2ed[_0x9c71('0x1d')],'include':_0xdfa2ed[_0x9c71('0x20')]?_[_0x9c71('0x1e')](_0xdfa2ed[_0x9c71('0x20')],function(_0x5aa446){return{'model':db[_0x5aa446[_0x9c71('0x1f')]],'as':_0x5aa446['as'],'attributes':_0x5aa446[_0x9c71('0x1d')],'include':_0x5aa446[_0x9c71('0x20')]?_[_0x9c71('0x1e')](_0x5aa446[_0x9c71('0x20')],function(_0x485804){return{'model':db[_0x485804['model']],'as':_0x485804['as'],'attributes':_0x485804[_0x9c71('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9c71('0xd')](function(_0x4747d0){logger[_0x9c71('0xe')](_0x9c71('0x21'),_0x3941b9);logger['debug'](_0x9c71('0x21'),_0x3941b9,JSON[_0x9c71('0x13')](_0x4747d0));_0x550bc1(_0x4747d0);})[_0x9c71('0x17')](function(_0x23ad53){logger[_0x9c71('0x16')](_0x9c71('0x21'),_0x23ad53['message'],_0x3941b9);_0x3a1020(_0x287f35['error'](0x1f4,_0x23ad53[_0x9c71('0x15')]));});});}; \ No newline at end of file +var _0x4e94=['attributes','map','include','model','debug','lodash','util','bluebird','randomstring','../../config/utils','rpc','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where'];(function(_0x59342e,_0xdc5f1d){var _0x360276=function(_0x351c88){while(--_0x351c88){_0x59342e['push'](_0x59342e['shift']());}};_0x360276(++_0xdc5f1d);}(_0x4e94,0x155));var _0x44e9=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x4e94[_0x4aba15];return _0x1c8122;};'use strict';var _=require(_0x44e9('0x0'));var util=require(_0x44e9('0x1'));var moment=require('moment');var BPromise=require(_0x44e9('0x2'));var rs=require(_0x44e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44e9('0x4'));var logger=require('../../config/logger')(_0x44e9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1b9c32,_0x3c9f48,_0x55b18a){return new BPromise(function(_0xdc9afd,_0x1df4a0){return client['request'](_0x1b9c32,_0x55b18a)[_0x44e9('0x7')](function(_0x42a573){logger[_0x44e9('0x8')](_0x44e9('0x9'),_0x3c9f48,_0x44e9('0xa'));logger['debug'](_0x44e9('0xb'),_0x3c9f48,_0x44e9('0xa'),JSON[_0x44e9('0xc')](_0x42a573));if(_0x42a573[_0x44e9('0xd')]){if(_0x42a573[_0x44e9('0xd')]['code']===0x1f4){logger[_0x44e9('0xd')](_0x44e9('0x9'),_0x3c9f48,_0x42a573[_0x44e9('0xd')]['message']);return _0x1df4a0(_0x42a573[_0x44e9('0xd')][_0x44e9('0xe')]);}logger[_0x44e9('0xd')](_0x44e9('0x9'),_0x3c9f48,_0x42a573[_0x44e9('0xd')][_0x44e9('0xe')]);return _0xdc9afd(_0x42a573[_0x44e9('0xd')][_0x44e9('0xe')]);}else{logger['info'](_0x44e9('0x9'),_0x3c9f48,_0x44e9('0xa'));_0xdc9afd(_0x42a573[_0x44e9('0xf')][_0x44e9('0xe')]);}})[_0x44e9('0x10')](function(_0x444b42){logger[_0x44e9('0xd')](_0x44e9('0x9'),_0x3c9f48,_0x444b42);_0x1df4a0(_0x444b42);});});}exports[_0x44e9('0x11')]=function(_0x1e5ebd){var _0x5a3e67=this;return new Promise(function(_0x17d338,_0x45812e){return db[_0x44e9('0x12')][_0x44e9('0x13')]({'raw':_0x1e5ebd[_0x44e9('0x14')]?_0x1e5ebd[_0x44e9('0x14')][_0x44e9('0x15')]===undefined?!![]:![]:!![],'where':_0x1e5ebd['options']?_0x1e5ebd[_0x44e9('0x14')][_0x44e9('0x16')]||null:null,'attributes':_0x1e5ebd[_0x44e9('0x14')]?_0x1e5ebd[_0x44e9('0x14')][_0x44e9('0x17')]||null:null,'limit':_0x1e5ebd[_0x44e9('0x14')]?_0x1e5ebd[_0x44e9('0x14')]['limit']||null:null,'include':_0x1e5ebd['options']?_0x1e5ebd[_0x44e9('0x14')]['include']?_[_0x44e9('0x18')](_0x1e5ebd[_0x44e9('0x14')][_0x44e9('0x19')],function(_0x25e3fa){return{'model':db[_0x25e3fa[_0x44e9('0x1a')]],'as':_0x25e3fa['as'],'attributes':_0x25e3fa[_0x44e9('0x17')],'include':_0x25e3fa[_0x44e9('0x19')]?_[_0x44e9('0x18')](_0x25e3fa[_0x44e9('0x19')],function(_0x472f97){return{'model':db[_0x472f97[_0x44e9('0x1a')]],'as':_0x472f97['as'],'attributes':_0x472f97[_0x44e9('0x17')],'include':_0x472f97['include']?_[_0x44e9('0x18')](_0x472f97['include'],function(_0x174a3b){return{'model':db[_0x174a3b[_0x44e9('0x1a')]],'as':_0x174a3b['as'],'attributes':_0x174a3b['attributes']};}):[]};}):[]};}):[]:[]})[_0x44e9('0x7')](function(_0x186e60){logger[_0x44e9('0x8')](_0x44e9('0x11'),_0x1e5ebd);logger[_0x44e9('0x1b')](_0x44e9('0x11'),_0x1e5ebd,JSON[_0x44e9('0xc')](_0x186e60));_0x17d338(_0x186e60);})[_0x44e9('0x10')](function(_0x3ae903){logger['error'](_0x44e9('0x11'),_0x3ae903[_0x44e9('0xe')],_0x1e5ebd);_0x45812e(_0x5a3e67['error'](0x1f4,_0x3ae903[_0x44e9('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a29e1eb..0117f6f 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 66738c5..f21f7d8 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 _0x5ec6=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0x5ec6,0x7f));var _0x65ec=function(_0x27e11c,_0x46cdf3){_0x27e11c=_0x27e11c-0x0;var _0x5722a2=_0x5ec6[_0x27e11c];return _0x5722a2;};'use strict';var Sequelize=require(_0x65ec('0x0'));module[_0x65ec('0x1')]={'description':{'type':Sequelize[_0x65ec('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x65ec('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x65ec('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x65ec('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x65ec('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x757a=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x3897e2,_0x521478){var _0x14105a=function(_0x345918){while(--_0x345918){_0x3897e2['push'](_0x3897e2['shift']());}};_0x14105a(++_0x521478);}(_0x757a,0xde));var _0xa757=function(_0x575524,_0x110a3c){_0x575524=_0x575524-0x0;var _0x4659a2=_0x757a[_0x575524];return _0x4659a2;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'description':{'type':Sequelize[_0xa757('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa757('0x2')]},'secure':{'type':Sequelize[_0xa757('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa757('0x1')]},'authentication':{'type':Sequelize[_0xa757('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xa757('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 827545c..0b68866 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 _0x2890=['sort','where','pick','filter','merge','options','includeAll','include','catch','params','filters','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','index','map','MailServerOut','rawAttributes','type','key','model','name','keys','query','intersection','fields','attributes','length','nolimit','offset','order'];(function(_0x2b8f84,_0x349ee2){var _0x2927ca=function(_0x1700be){while(--_0x1700be){_0x2b8f84['push'](_0x2b8f84['shift']());}};_0x2927ca(++_0x349ee2);}(_0x2890,0x138));var _0x0289=function(_0x24e32e,_0x271404){_0x24e32e=_0x24e32e-0x0;var _0x5b92fd=_0x2890[_0x24e32e];return _0x5b92fd;};'use strict';var emlformat=require(_0x0289('0x0'));var rimraf=require(_0x0289('0x1'));var zipdir=require(_0x0289('0x2'));var jsonpatch=require(_0x0289('0x3'));var rp=require(_0x0289('0x4'));var moment=require(_0x0289('0x5'));var BPromise=require(_0x0289('0x6'));var Mustache=require('mustache');var util=require(_0x0289('0x7'));var path=require(_0x0289('0x8'));var sox=require('sox');var csv=require(_0x0289('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0289('0xa'));var _=require(_0x0289('0xb'));var squel=require(_0x0289('0xc'));var crypto=require(_0x0289('0xd'));var jsforce=require(_0x0289('0xe'));var deskjs=require(_0x0289('0xf'));var toCsv=require(_0x0289('0x9'));var querystring=require('querystring');var Papa=require(_0x0289('0x10'));var Redis=require(_0x0289('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0289('0x12'));var as=require(_0x0289('0x13'));var hardwareService=require(_0x0289('0x14'));var logger=require(_0x0289('0x15'))(_0x0289('0x16'));var utils=require(_0x0289('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0289('0x18'));var db=require(_0x0289('0x19'))['db'];function respondWithStatusCode(_0x3cc494,_0x576943){_0x576943=_0x576943||0xcc;return function(_0x349b99){if(_0x349b99){return _0x3cc494[_0x0289('0x1a')](_0x576943);}return _0x3cc494[_0x0289('0x1b')](_0x576943)[_0x0289('0x1c')]();};}function respondWithResult(_0x361deb,_0x213ce8){_0x213ce8=_0x213ce8||0xc8;return function(_0x3bdd2f){if(_0x3bdd2f){return _0x361deb[_0x0289('0x1b')](_0x213ce8)[_0x0289('0x1d')](_0x3bdd2f);}};}function respondWithFilteredResult(_0x13b177,_0xbeddae){return function(_0x5e7d6b){if(_0x5e7d6b){var _0xdc919=typeof _0xbeddae['offset']===_0x0289('0x1e')&&typeof _0xbeddae[_0x0289('0x1f')]===_0x0289('0x1e');var _0x4ed351=_0x5e7d6b['count'];var _0x4efaf8=_0xdc919?0x0:_0xbeddae['offset'];var _0x4e05da=_0xdc919?_0x5e7d6b[_0x0289('0x20')]:_0xbeddae['offset']+_0xbeddae[_0x0289('0x1f')];var _0x3f9477;if(_0x4e05da>=_0x4ed351){_0x4e05da=_0x4ed351;_0x3f9477=0xc8;}else{_0x3f9477=0xce;}_0x13b177[_0x0289('0x1b')](_0x3f9477);return _0x13b177[_0x0289('0x21')](_0x0289('0x22'),_0x4efaf8+'-'+_0x4e05da+'/'+_0x4ed351)[_0x0289('0x1d')](_0x5e7d6b);}return null;};}function patchUpdates(_0x3c8da1){return function(_0x38ee56){try{jsonpatch[_0x0289('0x23')](_0x38ee56,_0x3c8da1,!![]);}catch(_0xe2121e){return BPromise[_0x0289('0x24')](_0xe2121e);}return _0x38ee56[_0x0289('0x25')]();};}function saveUpdates(_0x24a885,_0x59f7c9){return function(_0x2ed022){if(_0x2ed022){return _0x2ed022['update'](_0x24a885)[_0x0289('0x26')](function(_0x3e7a82){return _0x3e7a82;});}return null;};}function removeEntity(_0x581f99,_0x8009e1){return function(_0x3fbc78){if(_0x3fbc78){return _0x3fbc78['destroy']()[_0x0289('0x26')](function(){_0x581f99[_0x0289('0x1b')](0xcc)[_0x0289('0x1c')]();});}};}function handleEntityNotFound(_0x588db5,_0x365314){return function(_0x16d081){if(!_0x16d081){_0x588db5['sendStatus'](0x194);}return _0x16d081;};}function handleError(_0x399eb2,_0x4c3b3a){_0x4c3b3a=_0x4c3b3a||0x1f4;return function(_0x2685c3){logger[_0x0289('0x27')](_0x2685c3[_0x0289('0x28')]);if(_0x2685c3['name']){delete _0x2685c3['name'];}_0x399eb2[_0x0289('0x1b')](_0x4c3b3a)['send'](_0x2685c3);};}exports[_0x0289('0x29')]=function(_0x5445d5,_0x3afdd9){var _0x10dccc={},_0x3ee4b0={},_0x593e4a={'count':0x0,'rows':[]};var _0x5867dc=_[_0x0289('0x2a')](db[_0x0289('0x2b')][_0x0289('0x2c')],function(_0x49b566){return{'name':_0x49b566['fieldName'],'type':_0x49b566[_0x0289('0x2d')][_0x0289('0x2e')]};});_0x3ee4b0[_0x0289('0x2f')]=_['map'](_0x5867dc,_0x0289('0x30'));_0x3ee4b0['query']=_[_0x0289('0x31')](_0x5445d5[_0x0289('0x32')]);_0x3ee4b0['filters']=_[_0x0289('0x33')](_0x3ee4b0[_0x0289('0x2f')],_0x3ee4b0[_0x0289('0x32')]);_0x10dccc['attributes']=_[_0x0289('0x33')](_0x3ee4b0[_0x0289('0x2f')],qs['fields'](_0x5445d5[_0x0289('0x32')][_0x0289('0x34')]));_0x10dccc[_0x0289('0x35')]=_0x10dccc['attributes'][_0x0289('0x36')]?_0x10dccc['attributes']:_0x3ee4b0[_0x0289('0x2f')];if(!_0x5445d5[_0x0289('0x32')]['hasOwnProperty'](_0x0289('0x37'))){_0x10dccc[_0x0289('0x1f')]=qs[_0x0289('0x1f')](_0x5445d5[_0x0289('0x32')][_0x0289('0x1f')]);_0x10dccc[_0x0289('0x38')]=qs[_0x0289('0x38')](_0x5445d5[_0x0289('0x32')]['offset']);}_0x10dccc[_0x0289('0x39')]=qs[_0x0289('0x3a')](_0x5445d5[_0x0289('0x32')][_0x0289('0x3a')]);_0x10dccc[_0x0289('0x3b')]=qs['filters'](_[_0x0289('0x3c')](_0x5445d5['query'],_0x3ee4b0['filters']),_0x5867dc);if(_0x5445d5[_0x0289('0x32')][_0x0289('0x3d')]){_0x10dccc[_0x0289('0x3b')]=_[_0x0289('0x3e')](_0x10dccc[_0x0289('0x3b')],{'$or':_['map'](_0x5867dc,function(_0x17fc8e){if(_0x17fc8e['type']!=='VIRTUAL'){var _0xefafdb={};_0xefafdb[_0x17fc8e[_0x0289('0x30')]]={'$like':'%'+_0x5445d5['query'][_0x0289('0x3d')]+'%'};return _0xefafdb;}})});}_0x10dccc=_[_0x0289('0x3e')]({},_0x10dccc,_0x5445d5[_0x0289('0x3f')]);var _0x282e38={'where':_0x10dccc[_0x0289('0x3b')]};return db[_0x0289('0x2b')]['count'](_0x282e38)[_0x0289('0x26')](function(_0x2c585d){_0x593e4a[_0x0289('0x20')]=_0x2c585d;if(_0x5445d5[_0x0289('0x32')][_0x0289('0x40')]){_0x10dccc[_0x0289('0x41')]=[{'all':!![]}];}return db[_0x0289('0x2b')]['findAll'](_0x10dccc);})['then'](function(_0x3d76b6){_0x593e4a['rows']=_0x3d76b6;return _0x593e4a;})[_0x0289('0x26')](respondWithFilteredResult(_0x3afdd9,_0x10dccc))[_0x0289('0x42')](handleError(_0x3afdd9,null));};exports['show']=function(_0xcac038,_0x24fc47){var _0x2c1d11={'raw':!![],'where':{'id':_0xcac038[_0x0289('0x43')]['id']}},_0x5d17db={};_0x5d17db[_0x0289('0x2f')]=_['keys'](db[_0x0289('0x2b')][_0x0289('0x2c')]);_0x5d17db[_0x0289('0x32')]=_[_0x0289('0x31')](_0xcac038[_0x0289('0x32')]);_0x5d17db[_0x0289('0x44')]=_[_0x0289('0x33')](_0x5d17db['model'],_0x5d17db['query']);_0x2c1d11[_0x0289('0x35')]=_[_0x0289('0x33')](_0x5d17db[_0x0289('0x2f')],qs[_0x0289('0x34')](_0xcac038[_0x0289('0x32')][_0x0289('0x34')]));_0x2c1d11[_0x0289('0x35')]=_0x2c1d11[_0x0289('0x35')]['length']?_0x2c1d11[_0x0289('0x35')]:_0x5d17db['model'];if(_0xcac038['query'][_0x0289('0x40')]){_0x2c1d11[_0x0289('0x41')]=[{'all':!![]}];}_0x2c1d11=_[_0x0289('0x3e')]({},_0x2c1d11,_0xcac038[_0x0289('0x3f')]);return db[_0x0289('0x2b')]['find'](_0x2c1d11)['then'](handleEntityNotFound(_0x24fc47,null))['then'](respondWithResult(_0x24fc47,null))[_0x0289('0x42')](handleError(_0x24fc47,null));};exports[_0x0289('0x45')]=function(_0x2f2db7,_0x2908c9){return db[_0x0289('0x2b')][_0x0289('0x45')](_0x2f2db7[_0x0289('0x46')],{})[_0x0289('0x26')](respondWithResult(_0x2908c9,0xc9))['catch'](handleError(_0x2908c9,null));};exports[_0x0289('0x47')]=function(_0xd05bca,_0x9ffe3b){if(_0xd05bca[_0x0289('0x46')]['id']){delete _0xd05bca['body']['id'];}return db[_0x0289('0x2b')][_0x0289('0x48')]({'where':{'id':_0xd05bca[_0x0289('0x43')]['id']}})[_0x0289('0x26')](handleEntityNotFound(_0x9ffe3b,null))[_0x0289('0x26')](saveUpdates(_0xd05bca['body'],null))[_0x0289('0x26')](respondWithResult(_0x9ffe3b,null))[_0x0289('0x42')](handleError(_0x9ffe3b,null));};exports[_0x0289('0x49')]=function(_0xb6e06e,_0x50b62b){return db['MailServerOut']['find']({'where':{'id':_0xb6e06e[_0x0289('0x43')]['id']}})[_0x0289('0x26')](handleEntityNotFound(_0x50b62b,null))[_0x0289('0x26')](removeEntity(_0x50b62b,null))[_0x0289('0x42')](handleError(_0x50b62b,null));}; \ No newline at end of file +var _0xdf42=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','MailServerOut','rawAttributes','fieldName','key','model','map'];(function(_0x26f4a7,_0x3f8fcb){var _0x25c0e1=function(_0x3108e2){while(--_0x3108e2){_0x26f4a7['push'](_0x26f4a7['shift']());}};_0x25c0e1(++_0x3f8fcb);}(_0xdf42,0x103));var _0x2df4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf42[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x2df4('0x0'));var rimraf=require(_0x2df4('0x1'));var zipdir=require(_0x2df4('0x2'));var jsonpatch=require(_0x2df4('0x3'));var rp=require(_0x2df4('0x4'));var moment=require('moment');var BPromise=require(_0x2df4('0x5'));var Mustache=require(_0x2df4('0x6'));var util=require('util');var path=require(_0x2df4('0x7'));var sox=require(_0x2df4('0x8'));var csv=require(_0x2df4('0x9'));var ejs=require(_0x2df4('0xa'));var fs=require('fs');var fs_extra=require(_0x2df4('0xb'));var _=require(_0x2df4('0xc'));var squel=require(_0x2df4('0xd'));var crypto=require('crypto');var jsforce=require(_0x2df4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2df4('0xf'));var Papa=require(_0x2df4('0x10'));var Redis=require(_0x2df4('0x11'));var authService=require(_0x2df4('0x12'));var qs=require(_0x2df4('0x13'));var as=require(_0x2df4('0x14'));var hardwareService=require(_0x2df4('0x15'));var logger=require(_0x2df4('0x16'))(_0x2df4('0x17'));var utils=require(_0x2df4('0x18'));var config=require(_0x2df4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2df4('0x1a'))['db'];function respondWithStatusCode(_0x40f3b8,_0x56f12){_0x56f12=_0x56f12||0xcc;return function(_0x5108db){if(_0x5108db){return _0x40f3b8[_0x2df4('0x1b')](_0x56f12);}return _0x40f3b8[_0x2df4('0x1c')](_0x56f12)['end']();};}function respondWithResult(_0x2344d8,_0x401b58){_0x401b58=_0x401b58||0xc8;return function(_0x46eb2f){if(_0x46eb2f){return _0x2344d8[_0x2df4('0x1c')](_0x401b58)[_0x2df4('0x1d')](_0x46eb2f);}};}function respondWithFilteredResult(_0x522fb7,_0x5677c5){return function(_0x4f3f37){if(_0x4f3f37){var _0x4d9c2b=typeof _0x5677c5[_0x2df4('0x1e')]===_0x2df4('0x1f')&&typeof _0x5677c5[_0x2df4('0x20')]===_0x2df4('0x1f');var _0x54bea0=_0x4f3f37[_0x2df4('0x21')];var _0x5e0928=_0x4d9c2b?0x0:_0x5677c5['offset'];var _0x2b1ff9=_0x4d9c2b?_0x4f3f37[_0x2df4('0x21')]:_0x5677c5['offset']+_0x5677c5[_0x2df4('0x20')];var _0x21f97c;if(_0x2b1ff9>=_0x54bea0){_0x2b1ff9=_0x54bea0;_0x21f97c=0xc8;}else{_0x21f97c=0xce;}_0x522fb7[_0x2df4('0x1c')](_0x21f97c);return _0x522fb7[_0x2df4('0x22')](_0x2df4('0x23'),_0x5e0928+'-'+_0x2b1ff9+'/'+_0x54bea0)[_0x2df4('0x1d')](_0x4f3f37);}return null;};}function patchUpdates(_0x386f83){return function(_0x4912e1){try{jsonpatch[_0x2df4('0x24')](_0x4912e1,_0x386f83,!![]);}catch(_0x52afa8){return BPromise[_0x2df4('0x25')](_0x52afa8);}return _0x4912e1[_0x2df4('0x26')]();};}function saveUpdates(_0x6d1463,_0x2e61ed){return function(_0x3ffef8){if(_0x3ffef8){return _0x3ffef8[_0x2df4('0x27')](_0x6d1463)[_0x2df4('0x28')](function(_0x5806ac){return _0x5806ac;});}return null;};}function removeEntity(_0x3cd2d1,_0x3c7997){return function(_0x923048){if(_0x923048){return _0x923048[_0x2df4('0x29')]()['then'](function(){_0x3cd2d1[_0x2df4('0x1c')](0xcc)[_0x2df4('0x2a')]();});}};}function handleEntityNotFound(_0x4a7dbf,_0x361da7){return function(_0x2c6bee){if(!_0x2c6bee){_0x4a7dbf[_0x2df4('0x1b')](0x194);}return _0x2c6bee;};}function handleError(_0x1a7d01,_0x4ff589){_0x4ff589=_0x4ff589||0x1f4;return function(_0x3b6fad){logger['error'](_0x3b6fad[_0x2df4('0x2b')]);if(_0x3b6fad[_0x2df4('0x2c')]){delete _0x3b6fad['name'];}_0x1a7d01[_0x2df4('0x1c')](_0x4ff589)[_0x2df4('0x2d')](_0x3b6fad);};}exports[_0x2df4('0x2e')]=function(_0x3d5a82,_0x252038){var _0x1f376e={},_0x3307e2={},_0x398bb1={'count':0x0,'rows':[]};var _0x4ff86f=_['map'](db[_0x2df4('0x2f')][_0x2df4('0x30')],function(_0xd3416a){return{'name':_0xd3416a[_0x2df4('0x31')],'type':_0xd3416a['type'][_0x2df4('0x32')]};});_0x3307e2[_0x2df4('0x33')]=_[_0x2df4('0x34')](_0x4ff86f,_0x2df4('0x2c'));_0x3307e2[_0x2df4('0x35')]=_[_0x2df4('0x36')](_0x3d5a82[_0x2df4('0x35')]);_0x3307e2[_0x2df4('0x37')]=_[_0x2df4('0x38')](_0x3307e2[_0x2df4('0x33')],_0x3307e2[_0x2df4('0x35')]);_0x1f376e[_0x2df4('0x39')]=_[_0x2df4('0x38')](_0x3307e2[_0x2df4('0x33')],qs[_0x2df4('0x3a')](_0x3d5a82[_0x2df4('0x35')][_0x2df4('0x3a')]));_0x1f376e[_0x2df4('0x39')]=_0x1f376e['attributes'][_0x2df4('0x3b')]?_0x1f376e[_0x2df4('0x39')]:_0x3307e2[_0x2df4('0x33')];if(!_0x3d5a82[_0x2df4('0x35')]['hasOwnProperty'](_0x2df4('0x3c'))){_0x1f376e['limit']=qs[_0x2df4('0x20')](_0x3d5a82[_0x2df4('0x35')]['limit']);_0x1f376e[_0x2df4('0x1e')]=qs[_0x2df4('0x1e')](_0x3d5a82[_0x2df4('0x35')][_0x2df4('0x1e')]);}_0x1f376e[_0x2df4('0x3d')]=qs[_0x2df4('0x3e')](_0x3d5a82[_0x2df4('0x35')]['sort']);_0x1f376e[_0x2df4('0x3f')]=qs[_0x2df4('0x37')](_[_0x2df4('0x40')](_0x3d5a82[_0x2df4('0x35')],_0x3307e2[_0x2df4('0x37')]),_0x4ff86f);if(_0x3d5a82['query'][_0x2df4('0x41')]){_0x1f376e[_0x2df4('0x3f')]=_[_0x2df4('0x42')](_0x1f376e['where'],{'$or':_[_0x2df4('0x34')](_0x4ff86f,function(_0x29169b){if(_0x29169b[_0x2df4('0x43')]!=='VIRTUAL'){var _0x4a4b72={};_0x4a4b72[_0x29169b['name']]={'$like':'%'+_0x3d5a82[_0x2df4('0x35')][_0x2df4('0x41')]+'%'};return _0x4a4b72;}})});}_0x1f376e=_[_0x2df4('0x42')]({},_0x1f376e,_0x3d5a82[_0x2df4('0x44')]);var _0x40d227={'where':_0x1f376e[_0x2df4('0x3f')]};return db[_0x2df4('0x2f')][_0x2df4('0x21')](_0x40d227)[_0x2df4('0x28')](function(_0x53765e){_0x398bb1['count']=_0x53765e;if(_0x3d5a82[_0x2df4('0x35')][_0x2df4('0x45')]){_0x1f376e['include']=[{'all':!![]}];}return db['MailServerOut'][_0x2df4('0x46')](_0x1f376e);})['then'](function(_0x3a504c){_0x398bb1[_0x2df4('0x47')]=_0x3a504c;return _0x398bb1;})[_0x2df4('0x28')](respondWithFilteredResult(_0x252038,_0x1f376e))[_0x2df4('0x48')](handleError(_0x252038,null));};exports[_0x2df4('0x49')]=function(_0x2664ca,_0x16a4a1){var _0x13a8a9={'raw':!![],'where':{'id':_0x2664ca[_0x2df4('0x4a')]['id']}},_0x2db514={};_0x2db514[_0x2df4('0x33')]=_[_0x2df4('0x36')](db[_0x2df4('0x2f')]['rawAttributes']);_0x2db514[_0x2df4('0x35')]=_['keys'](_0x2664ca[_0x2df4('0x35')]);_0x2db514[_0x2df4('0x37')]=_[_0x2df4('0x38')](_0x2db514[_0x2df4('0x33')],_0x2db514[_0x2df4('0x35')]);_0x13a8a9['attributes']=_[_0x2df4('0x38')](_0x2db514[_0x2df4('0x33')],qs[_0x2df4('0x3a')](_0x2664ca[_0x2df4('0x35')]['fields']));_0x13a8a9[_0x2df4('0x39')]=_0x13a8a9['attributes'][_0x2df4('0x3b')]?_0x13a8a9[_0x2df4('0x39')]:_0x2db514[_0x2df4('0x33')];if(_0x2664ca[_0x2df4('0x35')]['includeAll']){_0x13a8a9['include']=[{'all':!![]}];}_0x13a8a9=_[_0x2df4('0x42')]({},_0x13a8a9,_0x2664ca[_0x2df4('0x44')]);return db['MailServerOut'][_0x2df4('0x4b')](_0x13a8a9)[_0x2df4('0x28')](handleEntityNotFound(_0x16a4a1,null))['then'](respondWithResult(_0x16a4a1,null))[_0x2df4('0x48')](handleError(_0x16a4a1,null));};exports['create']=function(_0x439e0e,_0x46c6b1){return db[_0x2df4('0x2f')][_0x2df4('0x4c')](_0x439e0e['body'],{})[_0x2df4('0x28')](respondWithResult(_0x46c6b1,0xc9))[_0x2df4('0x48')](handleError(_0x46c6b1,null));};exports['update']=function(_0x22d23b,_0x5a586f){if(_0x22d23b[_0x2df4('0x4d')]['id']){delete _0x22d23b['body']['id'];}return db[_0x2df4('0x2f')]['find']({'where':{'id':_0x22d23b['params']['id']}})[_0x2df4('0x28')](handleEntityNotFound(_0x5a586f,null))['then'](saveUpdates(_0x22d23b[_0x2df4('0x4d')],null))[_0x2df4('0x28')](respondWithResult(_0x5a586f,null))[_0x2df4('0x48')](handleError(_0x5a586f,null));};exports[_0x2df4('0x29')]=function(_0x28783c,_0x45dc44){return db[_0x2df4('0x2f')][_0x2df4('0x4b')]({'where':{'id':_0x28783c[_0x2df4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x45dc44,null))[_0x2df4('0x28')](removeEntity(_0x45dc44,null))['catch'](handleError(_0x45dc44,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index a8a73bc..37810b4 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 _0x6b56=['path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','moment','bluebird','request-promise'];(function(_0x417b5f,_0x4e946a){var _0x3ed016=function(_0x811e75){while(--_0x811e75){_0x417b5f['push'](_0x417b5f['shift']());}};_0x3ed016(++_0x4e946a);}(_0x6b56,0x80));var _0x66b5=function(_0xd4bba2,_0x25651a){_0xd4bba2=_0xd4bba2-0x0;var _0x455420=_0x6b56[_0xd4bba2];return _0x455420;};'use strict';var _=require(_0x66b5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x66b5('0x1'));var BPromise=require(_0x66b5('0x2'));var rp=require(_0x66b5('0x3'));var fs=require('fs');var path=require(_0x66b5('0x4'));var rimraf=require(_0x66b5('0x5'));var config=require(_0x66b5('0x6'));var attributes=require(_0x66b5('0x7'));module[_0x66b5('0x8')]=function(_0x5f1c5e,_0x9976cc){return _0x5f1c5e[_0x66b5('0x9')](_0x66b5('0xa'),attributes,{'tableName':_0x66b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f85=['mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x8f85,0x1a3));var _0x58f8=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x8f85[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x58f8('0x0'));var util=require(_0x58f8('0x1'));var logger=require(_0x58f8('0x2'))(_0x58f8('0x3'));var moment=require('moment');var BPromise=require(_0x58f8('0x4'));var rp=require(_0x58f8('0x5'));var fs=require('fs');var path=require(_0x58f8('0x6'));var rimraf=require(_0x58f8('0x7'));var config=require('../../config/environment');var attributes=require(_0x58f8('0x8'));module[_0x58f8('0x9')]=function(_0x344f6e,_0x5c17d9){return _0x344f6e['define']('MailServerOut',attributes,{'tableName':_0x58f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index e7cc63a..8e08f0f 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x47e1c1,_0x22d007){var _0x12f2d0=function(_0x36811e){while(--_0x36811e){_0x47e1c1['push'](_0x47e1c1['shift']());}};_0x12f2d0(++_0x22d007);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'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')]('MailServerOut,\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','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x47d553,_0x4cf7d7){_0x47d553=_0x47d553-0x0;var _0x5005f5=_0x7a54[_0x47d553];return _0x5005f5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 9aa99b1..a1fbd90 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 _0x66a0=['get','describe','show','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated'];(function(_0x50653b,_0x565ab3){var _0x446b45=function(_0x280f9f){while(--_0x280f9f){_0x50653b['push'](_0x50653b['shift']());}};_0x446b45(++_0x565ab3);}(_0x66a0,0xdc));var _0x066a=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0x66a0[_0x541095];return _0x5a2c40;};'use strict';var multer=require(_0x066a('0x0'));var util=require('util');var path=require(_0x066a('0x1'));var timeout=require(_0x066a('0x2'));var express=require(_0x066a('0x3'));var router=express[_0x066a('0x4')]();var fs_extra=require(_0x066a('0x5'));var auth=require(_0x066a('0x6'));var interaction=require(_0x066a('0x7'));var config=require(_0x066a('0x8'));var controller=require(_0x066a('0x9'));router['get']('/',auth[_0x066a('0xa')](),controller['index']);router[_0x066a('0xb')]('/describe',auth[_0x066a('0xa')](),controller[_0x066a('0xc')]);router[_0x066a('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x066a('0xd')]);router['post']('/',auth[_0x066a('0xa')](),controller[_0x066a('0xe')]);router[_0x066a('0xf')](_0x066a('0x10'),auth['isAuthenticated'](),controller[_0x066a('0x11')]);router[_0x066a('0x12')](_0x066a('0x10'),auth['isAuthenticated'](),controller[_0x066a('0x13')]);module[_0x066a('0x14')]=router; \ No newline at end of file +var _0xf1a7=['update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','isAuthenticated','describe','show','create','/:id'];(function(_0x2a6127,_0x345056){var _0x456577=function(_0x36a6cf){while(--_0x36a6cf){_0x2a6127['push'](_0x2a6127['shift']());}};_0x456577(++_0x345056);}(_0xf1a7,0x1d7));var _0x7f1a=function(_0x52c8ce,_0x1f27d7){_0x52c8ce=_0x52c8ce-0x0;var _0x45ec40=_0xf1a7[_0x52c8ce];return _0x45ec40;};'use strict';var multer=require(_0x7f1a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7f1a('0x1'));var express=require(_0x7f1a('0x2'));var router=express[_0x7f1a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f1a('0x4'));var interaction=require(_0x7f1a('0x5'));var config=require(_0x7f1a('0x6'));var controller=require(_0x7f1a('0x7'));router[_0x7f1a('0x8')]('/',auth['isAuthenticated'](),controller[_0x7f1a('0x9')]);router[_0x7f1a('0x8')]('/describe',auth[_0x7f1a('0xa')](),controller[_0x7f1a('0xb')]);router[_0x7f1a('0x8')]('/:id',auth[_0x7f1a('0xa')](),controller[_0x7f1a('0xc')]);router['post']('/',auth[_0x7f1a('0xa')](),controller[_0x7f1a('0xd')]);router['put'](_0x7f1a('0xe'),auth[_0x7f1a('0xa')](),controller[_0x7f1a('0xf')]);router['delete']('/:id',auth[_0x7f1a('0xa')](),controller[_0x7f1a('0x10')]);module[_0x7f1a('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index eb50851..2c07cdb 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 _0xb934=['exports','STRING','sequelize'];(function(_0x577d91,_0x4631a6){var _0x55fc37=function(_0x384dc4){while(--_0x384dc4){_0x577d91['push'](_0x577d91['shift']());}};_0x55fc37(++_0x4631a6);}(_0xb934,0x92));var _0x4b93=function(_0x18e0fc,_0x346139){_0x18e0fc=_0x18e0fc-0x0;var _0x1814cf=_0xb934[_0x18e0fc];return _0x1814cf;};'use strict';var Sequelize=require(_0x4b93('0x0'));module[_0x4b93('0x1')]={'name':{'type':Sequelize[_0x4b93('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4b93('0x2')]}}; \ No newline at end of file +var _0x277c=['sequelize','STRING','name'];(function(_0x10a73c,_0x3da0c6){var _0x5dde78=function(_0x4c35cd){while(--_0x4c35cd){_0x10a73c['push'](_0x10a73c['shift']());}};_0x5dde78(++_0x3da0c6);}(_0x277c,0x153));var _0xc277=function(_0x4ce30c,_0x1587a1){_0x4ce30c=_0x4ce30c-0x0;var _0x5831d7=_0x277c[_0x4ce30c];return _0x5831d7;};'use strict';var Sequelize=require(_0xc277('0x0'));module['exports']={'name':{'type':Sequelize[_0xc277('0x1')],'unique':_0xc277('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc277('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 9b3dc63..e7ea7ae 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 _0x38d2=['jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','MailSubstatus','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x38d2,0x86));var _0x238d=function(_0x3e63b,_0x34fc05){_0x3e63b=_0x3e63b-0x0;var _0x317d58=_0x38d2[_0x3e63b];return _0x317d58;};'use strict';var emlformat=require(_0x238d('0x0'));var rimraf=require(_0x238d('0x1'));var zipdir=require(_0x238d('0x2'));var jsonpatch=require(_0x238d('0x3'));var rp=require(_0x238d('0x4'));var moment=require(_0x238d('0x5'));var BPromise=require(_0x238d('0x6'));var Mustache=require(_0x238d('0x7'));var util=require(_0x238d('0x8'));var path=require(_0x238d('0x9'));var sox=require(_0x238d('0xa'));var csv=require('to-csv');var ejs=require(_0x238d('0xb'));var fs=require('fs');var fs_extra=require(_0x238d('0xc'));var _=require(_0x238d('0xd'));var squel=require(_0x238d('0xe'));var crypto=require(_0x238d('0xf'));var jsforce=require(_0x238d('0x10'));var deskjs=require(_0x238d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x238d('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x238d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x238d('0x14'));var logger=require(_0x238d('0x15'))(_0x238d('0x16'));var utils=require(_0x238d('0x17'));var config=require(_0x238d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x238d('0x19'))['db'];function respondWithStatusCode(_0x3f6792,_0x4f3389){_0x4f3389=_0x4f3389||0xcc;return function(_0x3d4fe1){if(_0x3d4fe1){return _0x3f6792[_0x238d('0x1a')](_0x4f3389);}return _0x3f6792['status'](_0x4f3389)[_0x238d('0x1b')]();};}function respondWithResult(_0x54f0d9,_0x241990){_0x241990=_0x241990||0xc8;return function(_0x2eabf1){if(_0x2eabf1){return _0x54f0d9[_0x238d('0x1c')](_0x241990)[_0x238d('0x1d')](_0x2eabf1);}};}function respondWithFilteredResult(_0x3ecbac,_0x5a1895){return function(_0x5f0825){if(_0x5f0825){var _0x4abf9a=typeof _0x5a1895[_0x238d('0x1e')]===_0x238d('0x1f')&&typeof _0x5a1895[_0x238d('0x20')]===_0x238d('0x1f');var _0x587bbd=_0x5f0825[_0x238d('0x21')];var _0x5aaa57=_0x4abf9a?0x0:_0x5a1895[_0x238d('0x1e')];var _0x535218=_0x4abf9a?_0x5f0825[_0x238d('0x21')]:_0x5a1895[_0x238d('0x1e')]+_0x5a1895['limit'];var _0x14b07a;if(_0x535218>=_0x587bbd){_0x535218=_0x587bbd;_0x14b07a=0xc8;}else{_0x14b07a=0xce;}_0x3ecbac[_0x238d('0x1c')](_0x14b07a);return _0x3ecbac[_0x238d('0x22')](_0x238d('0x23'),_0x5aaa57+'-'+_0x535218+'/'+_0x587bbd)[_0x238d('0x1d')](_0x5f0825);}return null;};}function patchUpdates(_0x35c3b5){return function(_0x4f95e8){try{jsonpatch[_0x238d('0x24')](_0x4f95e8,_0x35c3b5,!![]);}catch(_0x49c51c){return BPromise['reject'](_0x49c51c);}return _0x4f95e8[_0x238d('0x25')]();};}function saveUpdates(_0x21d466,_0x57df30){return function(_0x5de17f){if(_0x5de17f){return _0x5de17f[_0x238d('0x26')](_0x21d466)[_0x238d('0x27')](function(_0x130c15){return _0x130c15;});}return null;};}function removeEntity(_0x2f4a4f,_0xe44860){return function(_0x435ad7){if(_0x435ad7){return _0x435ad7[_0x238d('0x28')]()['then'](function(){_0x2f4a4f[_0x238d('0x1c')](0xcc)[_0x238d('0x1b')]();});}};}function handleEntityNotFound(_0x533747,_0x5571a5){return function(_0x5cb130){if(!_0x5cb130){_0x533747[_0x238d('0x1a')](0x194);}return _0x5cb130;};}function handleError(_0x2edd4f,_0x4aa0df){_0x4aa0df=_0x4aa0df||0x1f4;return function(_0x158dd1){logger['error'](_0x158dd1[_0x238d('0x29')]);if(_0x158dd1[_0x238d('0x2a')]){delete _0x158dd1[_0x238d('0x2a')];}_0x2edd4f[_0x238d('0x1c')](_0x4aa0df)[_0x238d('0x2b')](_0x158dd1);};}exports['index']=function(_0x34ff84,_0x61cba5){var _0x1fe8ca={},_0x2a7e1b={},_0x539de2={'count':0x0,'rows':[]};var _0x2289cd=_[_0x238d('0x2c')](db[_0x238d('0x2d')][_0x238d('0x2e')],function(_0x42bb97){return{'name':_0x42bb97['fieldName'],'type':_0x42bb97['type'][_0x238d('0x2f')]};});_0x2a7e1b[_0x238d('0x30')]=_['map'](_0x2289cd,_0x238d('0x2a'));_0x2a7e1b[_0x238d('0x31')]=_[_0x238d('0x32')](_0x34ff84[_0x238d('0x31')]);_0x2a7e1b[_0x238d('0x33')]=_['intersection'](_0x2a7e1b[_0x238d('0x30')],_0x2a7e1b[_0x238d('0x31')]);_0x1fe8ca[_0x238d('0x34')]=_[_0x238d('0x35')](_0x2a7e1b[_0x238d('0x30')],qs[_0x238d('0x36')](_0x34ff84[_0x238d('0x31')][_0x238d('0x36')]));_0x1fe8ca[_0x238d('0x34')]=_0x1fe8ca['attributes'][_0x238d('0x37')]?_0x1fe8ca[_0x238d('0x34')]:_0x2a7e1b['model'];if(!_0x34ff84[_0x238d('0x31')][_0x238d('0x38')](_0x238d('0x39'))){_0x1fe8ca[_0x238d('0x20')]=qs[_0x238d('0x20')](_0x34ff84['query'][_0x238d('0x20')]);_0x1fe8ca[_0x238d('0x1e')]=qs[_0x238d('0x1e')](_0x34ff84[_0x238d('0x31')][_0x238d('0x1e')]);}_0x1fe8ca['order']=qs['sort'](_0x34ff84[_0x238d('0x31')]['sort']);_0x1fe8ca[_0x238d('0x3a')]=qs[_0x238d('0x33')](_[_0x238d('0x3b')](_0x34ff84[_0x238d('0x31')],_0x2a7e1b[_0x238d('0x33')]),_0x2289cd);if(_0x34ff84[_0x238d('0x31')]['filter']){_0x1fe8ca[_0x238d('0x3a')]=_[_0x238d('0x3c')](_0x1fe8ca[_0x238d('0x3a')],{'$or':_[_0x238d('0x2c')](_0x2289cd,function(_0x32791c){if(_0x32791c[_0x238d('0x3d')]!==_0x238d('0x3e')){var _0x50569a={};_0x50569a[_0x32791c['name']]={'$like':'%'+_0x34ff84[_0x238d('0x31')][_0x238d('0x3f')]+'%'};return _0x50569a;}})});}_0x1fe8ca=_[_0x238d('0x3c')]({},_0x1fe8ca,_0x34ff84[_0x238d('0x40')]);var _0x5d6900={'where':_0x1fe8ca[_0x238d('0x3a')]};return db[_0x238d('0x2d')]['count'](_0x5d6900)[_0x238d('0x27')](function(_0x27b86c){_0x539de2[_0x238d('0x21')]=_0x27b86c;if(_0x34ff84['query']['includeAll']){_0x1fe8ca[_0x238d('0x41')]=[{'all':!![]}];}return db[_0x238d('0x2d')]['findAll'](_0x1fe8ca);})['then'](function(_0x1e9695){_0x539de2[_0x238d('0x42')]=_0x1e9695;return _0x539de2;})[_0x238d('0x27')](respondWithFilteredResult(_0x61cba5,_0x1fe8ca))[_0x238d('0x43')](handleError(_0x61cba5,null));};exports[_0x238d('0x44')]=function(_0x36ae5f,_0x217eb3){var _0x3cb296={'raw':!![],'where':{'id':_0x36ae5f[_0x238d('0x45')]['id']}},_0x151376={};_0x151376[_0x238d('0x30')]=_[_0x238d('0x32')](db[_0x238d('0x2d')][_0x238d('0x2e')]);_0x151376['query']=_[_0x238d('0x32')](_0x36ae5f[_0x238d('0x31')]);_0x151376[_0x238d('0x33')]=_[_0x238d('0x35')](_0x151376['model'],_0x151376[_0x238d('0x31')]);_0x3cb296['attributes']=_[_0x238d('0x35')](_0x151376['model'],qs[_0x238d('0x36')](_0x36ae5f['query']['fields']));_0x3cb296['attributes']=_0x3cb296[_0x238d('0x34')][_0x238d('0x37')]?_0x3cb296[_0x238d('0x34')]:_0x151376[_0x238d('0x30')];if(_0x36ae5f['query'][_0x238d('0x46')]){_0x3cb296[_0x238d('0x41')]=[{'all':!![]}];}_0x3cb296=_['merge']({},_0x3cb296,_0x36ae5f[_0x238d('0x40')]);return db[_0x238d('0x2d')][_0x238d('0x47')](_0x3cb296)[_0x238d('0x27')](handleEntityNotFound(_0x217eb3,null))[_0x238d('0x27')](respondWithResult(_0x217eb3,null))[_0x238d('0x43')](handleError(_0x217eb3,null));};exports[_0x238d('0x48')]=function(_0x934d30,_0x36a6c8){return db[_0x238d('0x2d')][_0x238d('0x48')](_0x934d30[_0x238d('0x49')],{})[_0x238d('0x27')](respondWithResult(_0x36a6c8,0xc9))[_0x238d('0x43')](handleError(_0x36a6c8,null));};exports[_0x238d('0x26')]=function(_0x381cbc,_0x26bec1){if(_0x381cbc[_0x238d('0x49')]['id']){delete _0x381cbc['body']['id'];}return db[_0x238d('0x2d')][_0x238d('0x47')]({'where':{'id':_0x381cbc[_0x238d('0x45')]['id']}})[_0x238d('0x27')](handleEntityNotFound(_0x26bec1,null))[_0x238d('0x27')](saveUpdates(_0x381cbc[_0x238d('0x49')],null))[_0x238d('0x27')](respondWithResult(_0x26bec1,null))[_0x238d('0x43')](handleError(_0x26bec1,null));};exports[_0x238d('0x28')]=function(_0x537600,_0x39278e){return db['MailSubstatus']['find']({'where':{'id':_0x537600['params']['id']}})[_0x238d('0x27')](handleEntityNotFound(_0x39278e,null))[_0x238d('0x27')](removeEntity(_0x39278e,null))[_0x238d('0x43')](handleError(_0x39278e,null));};exports[_0x238d('0x4a')]=function(_0x1d0dd6,_0xbc39fd){return db[_0x238d('0x2d')]['describe']()['then'](respondWithResult(_0xbc39fd,null))[_0x238d('0x43')](handleError(_0xbc39fd,null));}; \ No newline at end of file +var _0xb52e=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','status','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','MailSubstatus','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x5f5c75,_0x6fd44d){var _0x18b1b5=function(_0x2e3a89){while(--_0x2e3a89){_0x5f5c75['push'](_0x5f5c75['shift']());}};_0x18b1b5(++_0x6fd44d);}(_0xb52e,0xdd));var _0xeb52=function(_0x2b404d,_0xb872b1){_0x2b404d=_0x2b404d-0x0;var _0x20316a=_0xb52e[_0x2b404d];return _0x20316a;};'use strict';var emlformat=require(_0xeb52('0x0'));var rimraf=require(_0xeb52('0x1'));var zipdir=require(_0xeb52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb52('0x3'));var moment=require(_0xeb52('0x4'));var BPromise=require(_0xeb52('0x5'));var Mustache=require(_0xeb52('0x6'));var util=require(_0xeb52('0x7'));var path=require(_0xeb52('0x8'));var sox=require(_0xeb52('0x9'));var csv=require(_0xeb52('0xa'));var ejs=require(_0xeb52('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb52('0xc'));var crypto=require(_0xeb52('0xd'));var jsforce=require(_0xeb52('0xe'));var deskjs=require(_0xeb52('0xf'));var toCsv=require(_0xeb52('0xa'));var querystring=require('querystring');var Papa=require(_0xeb52('0x10'));var Redis=require(_0xeb52('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeb52('0x12'));var as=require(_0xeb52('0x13'));var hardwareService=require(_0xeb52('0x14'));var logger=require(_0xeb52('0x15'))(_0xeb52('0x16'));var utils=require(_0xeb52('0x17'));var config=require(_0xeb52('0x18'));var licenseUtil=require(_0xeb52('0x19'));var db=require(_0xeb52('0x1a'))['db'];function respondWithStatusCode(_0x5c713d,_0x458608){_0x458608=_0x458608||0xcc;return function(_0xd49fab){if(_0xd49fab){return _0x5c713d[_0xeb52('0x1b')](_0x458608);}return _0x5c713d['status'](_0x458608)[_0xeb52('0x1c')]();};}function respondWithResult(_0xbe0ca4,_0x192eb3){_0x192eb3=_0x192eb3||0xc8;return function(_0x59f646){if(_0x59f646){return _0xbe0ca4['status'](_0x192eb3)['json'](_0x59f646);}};}function respondWithFilteredResult(_0x2033b,_0x385450){return function(_0x96c5ec){if(_0x96c5ec){var _0x4a32a0=typeof _0x385450[_0xeb52('0x1d')]===_0xeb52('0x1e')&&typeof _0x385450[_0xeb52('0x1f')]===_0xeb52('0x1e');var _0x18ccbb=_0x96c5ec[_0xeb52('0x20')];var _0x18639f=_0x4a32a0?0x0:_0x385450['offset'];var _0x25a9c3=_0x4a32a0?_0x96c5ec[_0xeb52('0x20')]:_0x385450[_0xeb52('0x1d')]+_0x385450[_0xeb52('0x1f')];var _0xf72eef;if(_0x25a9c3>=_0x18ccbb){_0x25a9c3=_0x18ccbb;_0xf72eef=0xc8;}else{_0xf72eef=0xce;}_0x2033b['status'](_0xf72eef);return _0x2033b[_0xeb52('0x21')](_0xeb52('0x22'),_0x18639f+'-'+_0x25a9c3+'/'+_0x18ccbb)[_0xeb52('0x23')](_0x96c5ec);}return null;};}function patchUpdates(_0x3c1437){return function(_0xbfcb79){try{jsonpatch['apply'](_0xbfcb79,_0x3c1437,!![]);}catch(_0x42b604){return BPromise[_0xeb52('0x24')](_0x42b604);}return _0xbfcb79[_0xeb52('0x25')]();};}function saveUpdates(_0x13cd8e,_0x4baba3){return function(_0x878c7c){if(_0x878c7c){return _0x878c7c[_0xeb52('0x26')](_0x13cd8e)[_0xeb52('0x27')](function(_0x4b2174){return _0x4b2174;});}return null;};}function removeEntity(_0x7e14f5,_0x3638ff){return function(_0x15f7bb){if(_0x15f7bb){return _0x15f7bb[_0xeb52('0x28')]()['then'](function(){_0x7e14f5[_0xeb52('0x29')](0xcc)[_0xeb52('0x1c')]();});}};}function handleEntityNotFound(_0x2141ef,_0xc869a8){return function(_0x2809d2){if(!_0x2809d2){_0x2141ef['sendStatus'](0x194);}return _0x2809d2;};}function handleError(_0x37c00e,_0x15ba88){_0x15ba88=_0x15ba88||0x1f4;return function(_0x942b23){logger[_0xeb52('0x2a')](_0x942b23[_0xeb52('0x2b')]);if(_0x942b23['name']){delete _0x942b23[_0xeb52('0x2c')];}_0x37c00e[_0xeb52('0x29')](_0x15ba88)['send'](_0x942b23);};}exports[_0xeb52('0x2d')]=function(_0x27e76b,_0x530ebe){var _0x382761={},_0x348938={},_0x544650={'count':0x0,'rows':[]};var _0x2d5134=_[_0xeb52('0x2e')](db['MailSubstatus'][_0xeb52('0x2f')],function(_0x314679){return{'name':_0x314679['fieldName'],'type':_0x314679[_0xeb52('0x30')][_0xeb52('0x31')]};});_0x348938[_0xeb52('0x32')]=_[_0xeb52('0x2e')](_0x2d5134,'name');_0x348938[_0xeb52('0x33')]=_['keys'](_0x27e76b['query']);_0x348938[_0xeb52('0x34')]=_[_0xeb52('0x35')](_0x348938[_0xeb52('0x32')],_0x348938[_0xeb52('0x33')]);_0x382761['attributes']=_[_0xeb52('0x35')](_0x348938[_0xeb52('0x32')],qs[_0xeb52('0x36')](_0x27e76b[_0xeb52('0x33')][_0xeb52('0x36')]));_0x382761[_0xeb52('0x37')]=_0x382761[_0xeb52('0x37')]['length']?_0x382761[_0xeb52('0x37')]:_0x348938[_0xeb52('0x32')];if(!_0x27e76b[_0xeb52('0x33')][_0xeb52('0x38')](_0xeb52('0x39'))){_0x382761[_0xeb52('0x1f')]=qs[_0xeb52('0x1f')](_0x27e76b['query'][_0xeb52('0x1f')]);_0x382761[_0xeb52('0x1d')]=qs[_0xeb52('0x1d')](_0x27e76b[_0xeb52('0x33')][_0xeb52('0x1d')]);}_0x382761[_0xeb52('0x3a')]=qs[_0xeb52('0x3b')](_0x27e76b[_0xeb52('0x33')]['sort']);_0x382761['where']=qs[_0xeb52('0x34')](_[_0xeb52('0x3c')](_0x27e76b[_0xeb52('0x33')],_0x348938['filters']),_0x2d5134);if(_0x27e76b[_0xeb52('0x33')][_0xeb52('0x3d')]){_0x382761[_0xeb52('0x3e')]=_['merge'](_0x382761[_0xeb52('0x3e')],{'$or':_[_0xeb52('0x2e')](_0x2d5134,function(_0x45cb8d){if(_0x45cb8d['type']!==_0xeb52('0x3f')){var _0x805f1={};_0x805f1[_0x45cb8d[_0xeb52('0x2c')]]={'$like':'%'+_0x27e76b[_0xeb52('0x33')]['filter']+'%'};return _0x805f1;}})});}_0x382761=_[_0xeb52('0x40')]({},_0x382761,_0x27e76b[_0xeb52('0x41')]);var _0x10ef87={'where':_0x382761['where']};return db['MailSubstatus'][_0xeb52('0x20')](_0x10ef87)[_0xeb52('0x27')](function(_0x2db7f6){_0x544650[_0xeb52('0x20')]=_0x2db7f6;if(_0x27e76b[_0xeb52('0x33')][_0xeb52('0x42')]){_0x382761['include']=[{'all':!![]}];}return db[_0xeb52('0x43')][_0xeb52('0x44')](_0x382761);})[_0xeb52('0x27')](function(_0x992a08){_0x544650[_0xeb52('0x45')]=_0x992a08;return _0x544650;})['then'](respondWithFilteredResult(_0x530ebe,_0x382761))[_0xeb52('0x46')](handleError(_0x530ebe,null));};exports[_0xeb52('0x47')]=function(_0x4cb037,_0x40ad4c){var _0x78a1e5={'raw':!![],'where':{'id':_0x4cb037[_0xeb52('0x48')]['id']}},_0x43f09={};_0x43f09[_0xeb52('0x32')]=_['keys'](db[_0xeb52('0x43')][_0xeb52('0x2f')]);_0x43f09['query']=_['keys'](_0x4cb037['query']);_0x43f09[_0xeb52('0x34')]=_[_0xeb52('0x35')](_0x43f09[_0xeb52('0x32')],_0x43f09[_0xeb52('0x33')]);_0x78a1e5[_0xeb52('0x37')]=_[_0xeb52('0x35')](_0x43f09[_0xeb52('0x32')],qs[_0xeb52('0x36')](_0x4cb037[_0xeb52('0x33')][_0xeb52('0x36')]));_0x78a1e5[_0xeb52('0x37')]=_0x78a1e5[_0xeb52('0x37')][_0xeb52('0x49')]?_0x78a1e5[_0xeb52('0x37')]:_0x43f09[_0xeb52('0x32')];if(_0x4cb037['query']['includeAll']){_0x78a1e5[_0xeb52('0x4a')]=[{'all':!![]}];}_0x78a1e5=_[_0xeb52('0x40')]({},_0x78a1e5,_0x4cb037['options']);return db[_0xeb52('0x43')][_0xeb52('0x4b')](_0x78a1e5)[_0xeb52('0x27')](handleEntityNotFound(_0x40ad4c,null))['then'](respondWithResult(_0x40ad4c,null))[_0xeb52('0x46')](handleError(_0x40ad4c,null));};exports[_0xeb52('0x4c')]=function(_0x5708ae,_0x1338cf){return db['MailSubstatus'][_0xeb52('0x4c')](_0x5708ae[_0xeb52('0x4d')],{})['then'](respondWithResult(_0x1338cf,0xc9))[_0xeb52('0x46')](handleError(_0x1338cf,null));};exports['update']=function(_0x544099,_0x774e03){if(_0x544099[_0xeb52('0x4d')]['id']){delete _0x544099[_0xeb52('0x4d')]['id'];}return db[_0xeb52('0x43')][_0xeb52('0x4b')]({'where':{'id':_0x544099[_0xeb52('0x48')]['id']}})[_0xeb52('0x27')](handleEntityNotFound(_0x774e03,null))[_0xeb52('0x27')](saveUpdates(_0x544099[_0xeb52('0x4d')],null))[_0xeb52('0x27')](respondWithResult(_0x774e03,null))[_0xeb52('0x46')](handleError(_0x774e03,null));};exports[_0xeb52('0x28')]=function(_0x2e1267,_0x94024b){return db[_0xeb52('0x43')][_0xeb52('0x4b')]({'where':{'id':_0x2e1267['params']['id']}})[_0xeb52('0x27')](handleEntityNotFound(_0x94024b,null))[_0xeb52('0x27')](removeEntity(_0x94024b,null))[_0xeb52('0x46')](handleError(_0x94024b,null));};exports['describe']=function(_0x5ef94b,_0x573fe4){return db[_0xeb52('0x43')][_0xeb52('0x4e')]()['then'](respondWithResult(_0x573fe4,null))['catch'](handleError(_0x573fe4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 52a8040..2d495b8 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 _0xab21=['hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x33cea4,_0x4a6abc){var _0x516818=function(_0x44d1a0){while(--_0x44d1a0){_0x33cea4['push'](_0x33cea4['shift']());}};_0x516818(++_0x4a6abc);}(_0xab21,0xe4));var _0x1ab2=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xab21[_0x256b72];return _0x2183e3;};'use strict';var EventEmitter=require(_0x1ab2('0x0'));var MailSubstatus=require(_0x1ab2('0x1'))['db'][_0x1ab2('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x1ab2('0x3')](0x0);var events={'afterUpdate':_0x1ab2('0x4')};function emitEvent(_0x2f648e){return function(_0x41eafd,_0xec77b5,_0x5a4553){MailSubstatusEvents[_0x1ab2('0x5')](_0x2f648e+':'+_0x41eafd['id'],_0x41eafd);MailSubstatusEvents[_0x1ab2('0x5')](_0x2f648e,_0x41eafd);_0x5a4553(null);};}for(var e in events){if(events[_0x1ab2('0x6')](e)){var event=events[e];MailSubstatus[_0x1ab2('0x7')](e,emitEvent(event));}}module[_0x1ab2('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0x2240=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x550d4e,_0x3774d6){var _0x17ff78=function(_0x15e253){while(--_0x15e253){_0x550d4e['push'](_0x550d4e['shift']());}};_0x17ff78(++_0x3774d6);}(_0x2240,0xbe));var _0x0224=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x2240[_0x23e7c1];return _0x1add43;};'use strict';var EventEmitter=require(_0x0224('0x0'));var MailSubstatus=require(_0x0224('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0224('0x2')](0x0);var events={'afterUpdate':_0x0224('0x3')};function emitEvent(_0x455fa8){return function(_0x5a2ee9,_0x5e3b6a,_0x358c0d){MailSubstatusEvents[_0x0224('0x4')](_0x455fa8+':'+_0x5a2ee9['id'],_0x5a2ee9);MailSubstatusEvents[_0x0224('0x4')](_0x455fa8,_0x5a2ee9);_0x358c0d(null);};}for(var e in events){if(events[_0x0224('0x5')](e)){var event=events[e];MailSubstatus[_0x0224('0x6')](e,emitEvent(event));}}module[_0x0224('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 53c220b..6b38d4f 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 _0x301e=['models','define','MailSubstatus','update','name','mailSubstatus','then','catch','./mailSubstatus.attributes'];(function(_0x62e852,_0x108a6a){var _0x3bee5f=function(_0x35c0cd){while(--_0x35c0cd){_0x62e852['push'](_0x62e852['shift']());}};_0x3bee5f(++_0x108a6a);}(_0x301e,0xce));var _0xe301=function(_0x5d71fb,_0x5b3f42){_0x5d71fb=_0x5d71fb-0x0;var _0x19bac8=_0x301e[_0x5d71fb];return _0x19bac8;};'use strict';var attributes=require(_0xe301('0x0'));module['exports']=function(_0x1eddd5){var _0x5ca1e7=_0x1eddd5[_0xe301('0x1')];return _0x1eddd5[_0xe301('0x2')](_0xe301('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5ae0ee,_0xf9c2fb,_0x34d89d){return _0x5ca1e7['Condition'][_0xe301('0x4')]({'value':_0x5ae0ee[_0xe301('0x5')]},{'where':{'field':_0xe301('0x6'),'value':_0x5ae0ee['_previousDataValues']['name']}})[_0xe301('0x7')](function(){_0x34d89d();})[_0xe301('0x8')](function(_0x3298fc){_0x34d89d(_0x3298fc);});}}});}; \ No newline at end of file +var _0xbb21=['catch','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name','then'];(function(_0x1b3aff,_0x2123ad){var _0x53e897=function(_0x5c78dc){while(--_0x5c78dc){_0x1b3aff['push'](_0x1b3aff['shift']());}};_0x53e897(++_0x2123ad);}(_0xbb21,0x1c9));var _0x1bb2=function(_0x37734d,_0x58ce8e){_0x37734d=_0x37734d-0x0;var _0x4a900b=_0xbb21[_0x37734d];return _0x4a900b;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x1bb2('0x0')]=function(_0x22fde0){var _0x236514=_0x22fde0[_0x1bb2('0x1')];return _0x22fde0[_0x1bb2('0x2')](_0x1bb2('0x3'),attributes,{'tableName':_0x1bb2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x377c8b,_0x24c4ad,_0x57ddcb){return _0x236514[_0x1bb2('0x5')][_0x1bb2('0x6')]({'value':_0x377c8b['name']},{'where':{'field':_0x1bb2('0x7'),'value':_0x377c8b[_0x1bb2('0x8')][_0x1bb2('0x9')]}})[_0x1bb2('0xa')](function(){_0x57ddcb();})[_0x1bb2('0xb')](function(_0x5e640a){_0x57ddcb(_0x5e640a);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index f63ac13..29d8c65 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 _0xe59b=['info','result','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe59b,0x1e5));var _0xbe59=function(_0x533434,_0xe8be9a){_0x533434=_0x533434-0x0;var _0x47aa84=_0xe59b[_0x533434];return _0x47aa84;};'use strict';var _=require(_0xbe59('0x0'));var util=require('util');var moment=require(_0xbe59('0x1'));var BPromise=require('bluebird');var rs=require(_0xbe59('0x2'));var fs=require('fs');var Redis=require(_0xbe59('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe59('0x4'))('rpc');var config=require(_0xbe59('0x5'));var jayson=require(_0xbe59('0x6'));var client=jayson[_0xbe59('0x7')][_0xbe59('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d7b72,_0x352bd4,_0x558d02){return new BPromise(function(_0x2da8e5,_0x209479){return client[_0xbe59('0x9')](_0x3d7b72,_0x558d02)[_0xbe59('0xa')](function(_0x53536f){logger['info'](_0xbe59('0xb'),_0x352bd4,'request\x20sent');logger[_0xbe59('0xc')](_0xbe59('0xd'),_0x352bd4,_0xbe59('0xe'),JSON[_0xbe59('0xf')](_0x53536f));if(_0x53536f['error']){if(_0x53536f[_0xbe59('0x10')][_0xbe59('0x11')]===0x1f4){logger[_0xbe59('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x352bd4,_0x53536f[_0xbe59('0x10')][_0xbe59('0x12')]);return _0x209479(_0x53536f['error']['message']);}logger[_0xbe59('0x10')](_0xbe59('0xb'),_0x352bd4,_0x53536f['error'][_0xbe59('0x12')]);return _0x2da8e5(_0x53536f[_0xbe59('0x10')]['message']);}else{logger[_0xbe59('0x13')](_0xbe59('0xb'),_0x352bd4,_0xbe59('0xe'));_0x2da8e5(_0x53536f[_0xbe59('0x14')][_0xbe59('0x12')]);}})['catch'](function(_0x5f5368){logger[_0xbe59('0x10')](_0xbe59('0xb'),_0x352bd4,_0x5f5368);_0x209479(_0x5f5368);});});} \ No newline at end of file +var _0xf4e6=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x1ac7f7,_0x381523){var _0x5b5b32=function(_0x36efa8){while(--_0x36efa8){_0x1ac7f7['push'](_0x1ac7f7['shift']());}};_0x5b5b32(++_0x381523);}(_0xf4e6,0x1e1));var _0x6f4e=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xf4e6[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6f4e('0x0'));var rs=require(_0x6f4e('0x1'));var fs=require('fs');var Redis=require(_0x6f4e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f4e('0x3'));var logger=require(_0x6f4e('0x4'))(_0x6f4e('0x5'));var config=require('../../config/environment');var jayson=require(_0x6f4e('0x6'));var client=jayson['client'][_0x6f4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e3f62,_0x1e5a6e,_0x5c57ca){return new BPromise(function(_0x974edd,_0x4b3b8d){return client[_0x6f4e('0x8')](_0x2e3f62,_0x5c57ca)[_0x6f4e('0x9')](function(_0x883573){logger[_0x6f4e('0xa')](_0x6f4e('0xb'),_0x1e5a6e,_0x6f4e('0xc'));logger['debug'](_0x6f4e('0xd'),_0x1e5a6e,'request\x20sent',JSON[_0x6f4e('0xe')](_0x883573));if(_0x883573[_0x6f4e('0xf')]){if(_0x883573[_0x6f4e('0xf')][_0x6f4e('0x10')]===0x1f4){logger[_0x6f4e('0xf')](_0x6f4e('0xb'),_0x1e5a6e,_0x883573[_0x6f4e('0xf')][_0x6f4e('0x11')]);return _0x4b3b8d(_0x883573['error'][_0x6f4e('0x11')]);}logger[_0x6f4e('0xf')](_0x6f4e('0xb'),_0x1e5a6e,_0x883573[_0x6f4e('0xf')][_0x6f4e('0x11')]);return _0x974edd(_0x883573[_0x6f4e('0xf')]['message']);}else{logger[_0x6f4e('0xa')](_0x6f4e('0xb'),_0x1e5a6e,_0x6f4e('0xc'));_0x974edd(_0x883573[_0x6f4e('0x12')]['message']);}})['catch'](function(_0x1a1a2a){logger[_0x6f4e('0xf')](_0x6f4e('0xb'),_0x1e5a6e,_0x1a1a2a);_0x4b3b8d(_0x1a1a2a);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 43af3e6..dfcb4d7 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 _0xe5b0=['get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','/describe','isAuthenticated','describe'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xe5b0,0x16a));var _0x0e5b=function(_0x138ac2,_0x1dba6c){_0x138ac2=_0x138ac2-0x0;var _0x30c94b=_0xe5b0[_0x138ac2];return _0x30c94b;};'use strict';var multer=require(_0x0e5b('0x0'));var util=require(_0x0e5b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0e5b('0x2'));var router=express[_0x0e5b('0x3')]();var fs_extra=require(_0x0e5b('0x4'));var auth=require(_0x0e5b('0x5'));var interaction=require(_0x0e5b('0x6'));var config=require(_0x0e5b('0x7'));var controller=require(_0x0e5b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0e5b('0x9'),auth[_0x0e5b('0xa')](),controller[_0x0e5b('0xb')]);router[_0x0e5b('0xc')](_0x0e5b('0xd'),auth['isAuthenticated'](),controller[_0x0e5b('0xe')]);router[_0x0e5b('0xf')]('/',auth[_0x0e5b('0xa')](),controller[_0x0e5b('0x10')]);router[_0x0e5b('0x11')](_0x0e5b('0xd'),auth['isAuthenticated'](),controller[_0x0e5b('0x12')]);router[_0x0e5b('0x13')](_0x0e5b('0xd'),auth[_0x0e5b('0xa')](),controller[_0x0e5b('0x14')]);module[_0x0e5b('0x15')]=router; \ No newline at end of file +var _0x4d3e=['create','put','update','delete','destroy','util','connect-timeout','Router','../../config/environment','./mailTransferReport.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4d3e,0x140));var _0xe4d3=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x4d3e[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0xe4d3('0x0'));var path=require('path');var timeout=require(_0xe4d3('0x1'));var express=require('express');var router=express[_0xe4d3('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe4d3('0x3'));var controller=require(_0xe4d3('0x4'));router[_0xe4d3('0x5')]('/',auth['isAuthenticated'](),controller[_0xe4d3('0x6')]);router[_0xe4d3('0x5')](_0xe4d3('0x7'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xe4d3('0x8'),auth[_0xe4d3('0x9')](),controller['show']);router['post']('/',auth[_0xe4d3('0x9')](),controller[_0xe4d3('0xa')]);router[_0xe4d3('0xb')]('/:id',auth[_0xe4d3('0x9')](),controller[_0xe4d3('0xc')]);router[_0xe4d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xe4d3('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index aa89fdc..18c28be 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x43bb1e,_0x184613){var _0x554c38=function(_0x1a205f){while(--_0x1a205f){_0x43bb1e['push'](_0x43bb1e['shift']());}};_0x554c38(++_0x184613);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x31871a,_0x49ccd3){var _0x3588c6=function(_0x58f924){while(--_0x58f924){_0x31871a['push'](_0x31871a['shift']());}};_0x3588c6(++_0x49ccd3);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 6e66e24..e1230da 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 _0x340d=['intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','send','index','map','MailTransferReport','type','key','model','query','filters'];(function(_0x52cf8e,_0x15851e){var _0x2c009f=function(_0x4888be){while(--_0x4888be){_0x52cf8e['push'](_0x52cf8e['shift']());}};_0x2c009f(++_0x15851e);}(_0x340d,0xa8));var _0xd340=function(_0x490161,_0x28c6b3){_0x490161=_0x490161-0x0;var _0x323377=_0x340d[_0x490161];return _0x323377;};'use strict';var emlformat=require(_0xd340('0x0'));var rimraf=require(_0xd340('0x1'));var zipdir=require(_0xd340('0x2'));var jsonpatch=require(_0xd340('0x3'));var rp=require(_0xd340('0x4'));var moment=require('moment');var BPromise=require(_0xd340('0x5'));var Mustache=require(_0xd340('0x6'));var util=require(_0xd340('0x7'));var path=require(_0xd340('0x8'));var sox=require(_0xd340('0x9'));var csv=require('to-csv');var ejs=require(_0xd340('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd340('0xb'));var squel=require('squel');var crypto=require(_0xd340('0xc'));var jsforce=require(_0xd340('0xd'));var deskjs=require(_0xd340('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd340('0xf'));var Papa=require(_0xd340('0x10'));var Redis=require(_0xd340('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd340('0x12'));var hardwareService=require(_0xd340('0x13'));var logger=require('../../config/logger')(_0xd340('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd340('0x15'));var db=require(_0xd340('0x16'))['db'];function respondWithStatusCode(_0x479a7b,_0x66cd97){_0x66cd97=_0x66cd97||0xcc;return function(_0x37f386){if(_0x37f386){return _0x479a7b['sendStatus'](_0x66cd97);}return _0x479a7b[_0xd340('0x17')](_0x66cd97)['end']();};}function respondWithResult(_0x2365e7,_0x68de3f){_0x68de3f=_0x68de3f||0xc8;return function(_0x58648f){if(_0x58648f){return _0x2365e7[_0xd340('0x17')](_0x68de3f)['json'](_0x58648f);}};}function respondWithFilteredResult(_0x5dfd73,_0x36c819){return function(_0x1f3924){if(_0x1f3924){var _0x1e67e7=typeof _0x36c819[_0xd340('0x18')]===_0xd340('0x19')&&typeof _0x36c819[_0xd340('0x1a')]===_0xd340('0x19');var _0x1419bd=_0x1f3924[_0xd340('0x1b')];var _0x241242=_0x1e67e7?0x0:_0x36c819[_0xd340('0x18')];var _0x2b018f=_0x1e67e7?_0x1f3924[_0xd340('0x1b')]:_0x36c819[_0xd340('0x18')]+_0x36c819[_0xd340('0x1a')];var _0x1aa079;if(_0x2b018f>=_0x1419bd){_0x2b018f=_0x1419bd;_0x1aa079=0xc8;}else{_0x1aa079=0xce;}_0x5dfd73[_0xd340('0x17')](_0x1aa079);return _0x5dfd73[_0xd340('0x1c')](_0xd340('0x1d'),_0x241242+'-'+_0x2b018f+'/'+_0x1419bd)['json'](_0x1f3924);}return null;};}function patchUpdates(_0x2f17b8){return function(_0x5479b2){try{jsonpatch[_0xd340('0x1e')](_0x5479b2,_0x2f17b8,!![]);}catch(_0x4ef306){return BPromise[_0xd340('0x1f')](_0x4ef306);}return _0x5479b2[_0xd340('0x20')]();};}function saveUpdates(_0x12d5de,_0x2af093){return function(_0x4b8783){if(_0x4b8783){return _0x4b8783[_0xd340('0x21')](_0x12d5de)[_0xd340('0x22')](function(_0x223238){return _0x223238;});}return null;};}function removeEntity(_0x4ba15e,_0x106b4c){return function(_0x1641d7){if(_0x1641d7){return _0x1641d7['destroy']()[_0xd340('0x22')](function(){_0x4ba15e['status'](0xcc)[_0xd340('0x23')]();});}};}function handleEntityNotFound(_0x2f77a4,_0x1bf591){return function(_0x1f83f4){if(!_0x1f83f4){_0x2f77a4[_0xd340('0x24')](0x194);}return _0x1f83f4;};}function handleError(_0x2fe77b,_0x54b301){_0x54b301=_0x54b301||0x1f4;return function(_0x2f4849){logger[_0xd340('0x25')](_0x2f4849['stack']);if(_0x2f4849[_0xd340('0x26')]){delete _0x2f4849['name'];}_0x2fe77b[_0xd340('0x17')](_0x54b301)[_0xd340('0x27')](_0x2f4849);};}exports[_0xd340('0x28')]=function(_0x5fa95a,_0x3b4035){var _0x5bd244={},_0x282825={},_0x3190ff={'count':0x0,'rows':[]};var _0x3ff98e=_[_0xd340('0x29')](db[_0xd340('0x2a')]['rawAttributes'],function(_0x3634f9){return{'name':_0x3634f9['fieldName'],'type':_0x3634f9[_0xd340('0x2b')][_0xd340('0x2c')]};});_0x282825[_0xd340('0x2d')]=_[_0xd340('0x29')](_0x3ff98e,'name');_0x282825[_0xd340('0x2e')]=_['keys'](_0x5fa95a[_0xd340('0x2e')]);_0x282825[_0xd340('0x2f')]=_[_0xd340('0x30')](_0x282825['model'],_0x282825[_0xd340('0x2e')]);_0x5bd244['attributes']=_[_0xd340('0x30')](_0x282825[_0xd340('0x2d')],qs[_0xd340('0x31')](_0x5fa95a[_0xd340('0x2e')][_0xd340('0x31')]));_0x5bd244[_0xd340('0x32')]=_0x5bd244[_0xd340('0x32')][_0xd340('0x33')]?_0x5bd244['attributes']:_0x282825[_0xd340('0x2d')];if(!_0x5fa95a['query']['hasOwnProperty'](_0xd340('0x34'))){_0x5bd244[_0xd340('0x1a')]=qs['limit'](_0x5fa95a[_0xd340('0x2e')][_0xd340('0x1a')]);_0x5bd244[_0xd340('0x18')]=qs['offset'](_0x5fa95a[_0xd340('0x2e')][_0xd340('0x18')]);}_0x5bd244[_0xd340('0x35')]=qs[_0xd340('0x36')](_0x5fa95a[_0xd340('0x2e')]['sort']);_0x5bd244['where']=qs['filters'](_['pick'](_0x5fa95a['query'],_0x282825['filters']),_0x3ff98e);if(_0x5fa95a[_0xd340('0x2e')][_0xd340('0x37')]){_0x5bd244[_0xd340('0x38')]=_[_0xd340('0x39')](_0x5bd244[_0xd340('0x38')],{'$or':_[_0xd340('0x29')](_0x3ff98e,function(_0x541346){if(_0x541346[_0xd340('0x2b')]!=='VIRTUAL'){var _0xdb827d={};_0xdb827d[_0x541346['name']]={'$like':'%'+_0x5fa95a['query'][_0xd340('0x37')]+'%'};return _0xdb827d;}})});}_0x5bd244=_[_0xd340('0x39')]({},_0x5bd244,_0x5fa95a[_0xd340('0x3a')]);var _0x353e8e={'where':_0x5bd244[_0xd340('0x38')]};return db[_0xd340('0x2a')][_0xd340('0x1b')](_0x353e8e)[_0xd340('0x22')](function(_0x463547){_0x3190ff['count']=_0x463547;if(_0x5fa95a['query'][_0xd340('0x3b')]){_0x5bd244['include']=[{'all':!![]}];}return db[_0xd340('0x2a')][_0xd340('0x3c')](_0x5bd244);})[_0xd340('0x22')](function(_0x218c4e){_0x3190ff[_0xd340('0x3d')]=_0x218c4e;return _0x3190ff;})[_0xd340('0x22')](respondWithFilteredResult(_0x3b4035,_0x5bd244))[_0xd340('0x3e')](handleError(_0x3b4035,null));};exports[_0xd340('0x3f')]=function(_0x528085,_0x32ac89){var _0xd228fb={'raw':!![],'where':{'id':_0x528085[_0xd340('0x40')]['id']}},_0x2f4a2f={};_0x2f4a2f['model']=_[_0xd340('0x41')](db['MailTransferReport'][_0xd340('0x42')]);_0x2f4a2f['query']=_['keys'](_0x528085[_0xd340('0x2e')]);_0x2f4a2f[_0xd340('0x2f')]=_[_0xd340('0x30')](_0x2f4a2f['model'],_0x2f4a2f[_0xd340('0x2e')]);_0xd228fb[_0xd340('0x32')]=_['intersection'](_0x2f4a2f['model'],qs[_0xd340('0x31')](_0x528085['query'][_0xd340('0x31')]));_0xd228fb['attributes']=_0xd228fb[_0xd340('0x32')][_0xd340('0x33')]?_0xd228fb[_0xd340('0x32')]:_0x2f4a2f[_0xd340('0x2d')];if(_0x528085['query']['includeAll']){_0xd228fb[_0xd340('0x43')]=[{'all':!![]}];}_0xd228fb=_[_0xd340('0x39')]({},_0xd228fb,_0x528085['options']);return db['MailTransferReport'][_0xd340('0x44')](_0xd228fb)['then'](handleEntityNotFound(_0x32ac89,null))['then'](respondWithResult(_0x32ac89,null))[_0xd340('0x3e')](handleError(_0x32ac89,null));};exports[_0xd340('0x45')]=function(_0x227c8e,_0x3e64b9){return db[_0xd340('0x2a')]['create'](_0x227c8e[_0xd340('0x46')],{})['then'](respondWithResult(_0x3e64b9,0xc9))[_0xd340('0x3e')](handleError(_0x3e64b9,null));};exports[_0xd340('0x21')]=function(_0x26b39,_0x431e6c){if(_0x26b39['body']['id']){delete _0x26b39[_0xd340('0x46')]['id'];}return db[_0xd340('0x2a')][_0xd340('0x44')]({'where':{'id':_0x26b39['params']['id']}})[_0xd340('0x22')](handleEntityNotFound(_0x431e6c,null))[_0xd340('0x22')](saveUpdates(_0x26b39['body'],null))[_0xd340('0x22')](respondWithResult(_0x431e6c,null))[_0xd340('0x3e')](handleError(_0x431e6c,null));};exports['destroy']=function(_0x5f0f94,_0x12d5b1){return db[_0xd340('0x2a')][_0xd340('0x44')]({'where':{'id':_0x5f0f94[_0xd340('0x40')]['id']}})[_0xd340('0x22')](handleEntityNotFound(_0x12d5b1,null))[_0xd340('0x22')](removeEntity(_0x12d5b1,null))[_0xd340('0x3e')](handleError(_0x12d5b1,null));};exports[_0xd340('0x47')]=function(_0x3bdc57,_0xfa418f){return db[_0xd340('0x2a')][_0xd340('0x47')]()[_0xd340('0x22')](respondWithResult(_0xfa418f,null))[_0xd340('0x3e')](handleError(_0xfa418f,null));}; \ No newline at end of file +var _0x87b3=['index','MailTransferReport','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name'];(function(_0x24b78f,_0x22d90a){var _0x450887=function(_0x1d675a){while(--_0x1d675a){_0x24b78f['push'](_0x24b78f['shift']());}};_0x450887(++_0x22d90a);}(_0x87b3,0x1e4));var _0x387b=function(_0x47e915,_0x4afe78){_0x47e915=_0x47e915-0x0;var _0x3f6ccf=_0x87b3[_0x47e915];return _0x3f6ccf;};'use strict';var emlformat=require(_0x387b('0x0'));var rimraf=require(_0x387b('0x1'));var zipdir=require(_0x387b('0x2'));var jsonpatch=require(_0x387b('0x3'));var rp=require(_0x387b('0x4'));var moment=require(_0x387b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x387b('0x6'));var path=require(_0x387b('0x7'));var sox=require(_0x387b('0x8'));var csv=require(_0x387b('0x9'));var ejs=require(_0x387b('0xa'));var fs=require('fs');var fs_extra=require(_0x387b('0xb'));var _=require(_0x387b('0xc'));var squel=require(_0x387b('0xd'));var crypto=require(_0x387b('0xe'));var jsforce=require(_0x387b('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x387b('0x10'));var authService=require(_0x387b('0x11'));var qs=require(_0x387b('0x12'));var as=require(_0x387b('0x13'));var hardwareService=require(_0x387b('0x14'));var logger=require(_0x387b('0x15'))(_0x387b('0x16'));var utils=require(_0x387b('0x17'));var config=require(_0x387b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x387b('0x19'))['db'];function respondWithStatusCode(_0x4fd99c,_0x5ef58c){_0x5ef58c=_0x5ef58c||0xcc;return function(_0x56fe3f){if(_0x56fe3f){return _0x4fd99c[_0x387b('0x1a')](_0x5ef58c);}return _0x4fd99c[_0x387b('0x1b')](_0x5ef58c)[_0x387b('0x1c')]();};}function respondWithResult(_0x62b3e1,_0x474425){_0x474425=_0x474425||0xc8;return function(_0x475a17){if(_0x475a17){return _0x62b3e1[_0x387b('0x1b')](_0x474425)[_0x387b('0x1d')](_0x475a17);}};}function respondWithFilteredResult(_0x5af5f9,_0x42452a){return function(_0x3ff78d){if(_0x3ff78d){var _0x4bbab9=typeof _0x42452a[_0x387b('0x1e')]===_0x387b('0x1f')&&typeof _0x42452a['limit']===_0x387b('0x1f');var _0x5397c2=_0x3ff78d[_0x387b('0x20')];var _0x1731e4=_0x4bbab9?0x0:_0x42452a[_0x387b('0x1e')];var _0x4e33f0=_0x4bbab9?_0x3ff78d['count']:_0x42452a[_0x387b('0x1e')]+_0x42452a['limit'];var _0x55fa2b;if(_0x4e33f0>=_0x5397c2){_0x4e33f0=_0x5397c2;_0x55fa2b=0xc8;}else{_0x55fa2b=0xce;}_0x5af5f9['status'](_0x55fa2b);return _0x5af5f9['set'](_0x387b('0x21'),_0x1731e4+'-'+_0x4e33f0+'/'+_0x5397c2)[_0x387b('0x1d')](_0x3ff78d);}return null;};}function patchUpdates(_0x2e8c96){return function(_0x3b24cd){try{jsonpatch[_0x387b('0x22')](_0x3b24cd,_0x2e8c96,!![]);}catch(_0x127ef3){return BPromise[_0x387b('0x23')](_0x127ef3);}return _0x3b24cd['save']();};}function saveUpdates(_0x34b59b,_0x5d9ab6){return function(_0x4df5c7){if(_0x4df5c7){return _0x4df5c7[_0x387b('0x24')](_0x34b59b)[_0x387b('0x25')](function(_0x11d7d1){return _0x11d7d1;});}return null;};}function removeEntity(_0x59e799,_0x2aff65){return function(_0x4ad84d){if(_0x4ad84d){return _0x4ad84d[_0x387b('0x26')]()[_0x387b('0x25')](function(){_0x59e799['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x331ca1,_0x24fd6b){return function(_0x3907c4){if(!_0x3907c4){_0x331ca1[_0x387b('0x1a')](0x194);}return _0x3907c4;};}function handleError(_0x28b6b9,_0x21e63a){_0x21e63a=_0x21e63a||0x1f4;return function(_0x2bcc63){logger[_0x387b('0x27')](_0x2bcc63['stack']);if(_0x2bcc63[_0x387b('0x28')]){delete _0x2bcc63[_0x387b('0x28')];}_0x28b6b9[_0x387b('0x1b')](_0x21e63a)['send'](_0x2bcc63);};}exports[_0x387b('0x29')]=function(_0x506c2b,_0x55273b){var _0x59ab0c={},_0x1a80ef={},_0x11e3c7={'count':0x0,'rows':[]};var _0x2120c9=_['map'](db[_0x387b('0x2a')]['rawAttributes'],function(_0x5b3ad9){return{'name':_0x5b3ad9[_0x387b('0x2b')],'type':_0x5b3ad9[_0x387b('0x2c')][_0x387b('0x2d')]};});_0x1a80ef[_0x387b('0x2e')]=_[_0x387b('0x2f')](_0x2120c9,_0x387b('0x28'));_0x1a80ef[_0x387b('0x30')]=_['keys'](_0x506c2b[_0x387b('0x30')]);_0x1a80ef[_0x387b('0x31')]=_['intersection'](_0x1a80ef['model'],_0x1a80ef[_0x387b('0x30')]);_0x59ab0c[_0x387b('0x32')]=_[_0x387b('0x33')](_0x1a80ef[_0x387b('0x2e')],qs['fields'](_0x506c2b[_0x387b('0x30')][_0x387b('0x34')]));_0x59ab0c[_0x387b('0x32')]=_0x59ab0c[_0x387b('0x32')][_0x387b('0x35')]?_0x59ab0c[_0x387b('0x32')]:_0x1a80ef[_0x387b('0x2e')];if(!_0x506c2b['query']['hasOwnProperty'](_0x387b('0x36'))){_0x59ab0c[_0x387b('0x37')]=qs['limit'](_0x506c2b[_0x387b('0x30')]['limit']);_0x59ab0c[_0x387b('0x1e')]=qs[_0x387b('0x1e')](_0x506c2b[_0x387b('0x30')][_0x387b('0x1e')]);}_0x59ab0c[_0x387b('0x38')]=qs['sort'](_0x506c2b[_0x387b('0x30')][_0x387b('0x39')]);_0x59ab0c[_0x387b('0x3a')]=qs[_0x387b('0x31')](_['pick'](_0x506c2b[_0x387b('0x30')],_0x1a80ef[_0x387b('0x31')]),_0x2120c9);if(_0x506c2b[_0x387b('0x30')][_0x387b('0x3b')]){_0x59ab0c[_0x387b('0x3a')]=_[_0x387b('0x3c')](_0x59ab0c[_0x387b('0x3a')],{'$or':_[_0x387b('0x2f')](_0x2120c9,function(_0x4fda19){if(_0x4fda19['type']!=='VIRTUAL'){var _0x1bcc6a={};_0x1bcc6a[_0x4fda19['name']]={'$like':'%'+_0x506c2b['query'][_0x387b('0x3b')]+'%'};return _0x1bcc6a;}})});}_0x59ab0c=_[_0x387b('0x3c')]({},_0x59ab0c,_0x506c2b['options']);var _0x52bd33={'where':_0x59ab0c[_0x387b('0x3a')]};return db[_0x387b('0x2a')][_0x387b('0x20')](_0x52bd33)[_0x387b('0x25')](function(_0x1f1031){_0x11e3c7[_0x387b('0x20')]=_0x1f1031;if(_0x506c2b[_0x387b('0x30')][_0x387b('0x3d')]){_0x59ab0c[_0x387b('0x3e')]=[{'all':!![]}];}return db[_0x387b('0x2a')][_0x387b('0x3f')](_0x59ab0c);})[_0x387b('0x25')](function(_0x2e0462){_0x11e3c7[_0x387b('0x40')]=_0x2e0462;return _0x11e3c7;})[_0x387b('0x25')](respondWithFilteredResult(_0x55273b,_0x59ab0c))[_0x387b('0x41')](handleError(_0x55273b,null));};exports[_0x387b('0x42')]=function(_0x40641e,_0x51d616){var _0x3c7794={'raw':!![],'where':{'id':_0x40641e[_0x387b('0x43')]['id']}},_0x35bf5d={};_0x35bf5d[_0x387b('0x2e')]=_[_0x387b('0x44')](db[_0x387b('0x2a')][_0x387b('0x45')]);_0x35bf5d[_0x387b('0x30')]=_[_0x387b('0x44')](_0x40641e[_0x387b('0x30')]);_0x35bf5d[_0x387b('0x31')]=_[_0x387b('0x33')](_0x35bf5d[_0x387b('0x2e')],_0x35bf5d[_0x387b('0x30')]);_0x3c7794[_0x387b('0x32')]=_[_0x387b('0x33')](_0x35bf5d[_0x387b('0x2e')],qs['fields'](_0x40641e['query'][_0x387b('0x34')]));_0x3c7794[_0x387b('0x32')]=_0x3c7794[_0x387b('0x32')]['length']?_0x3c7794['attributes']:_0x35bf5d[_0x387b('0x2e')];if(_0x40641e['query'][_0x387b('0x3d')]){_0x3c7794[_0x387b('0x3e')]=[{'all':!![]}];}_0x3c7794=_[_0x387b('0x3c')]({},_0x3c7794,_0x40641e[_0x387b('0x46')]);return db[_0x387b('0x2a')]['find'](_0x3c7794)['then'](handleEntityNotFound(_0x51d616,null))[_0x387b('0x25')](respondWithResult(_0x51d616,null))[_0x387b('0x41')](handleError(_0x51d616,null));};exports[_0x387b('0x47')]=function(_0x1a83f0,_0x8f7ea2){return db[_0x387b('0x2a')][_0x387b('0x47')](_0x1a83f0['body'],{})[_0x387b('0x25')](respondWithResult(_0x8f7ea2,0xc9))[_0x387b('0x41')](handleError(_0x8f7ea2,null));};exports['update']=function(_0x277607,_0x21a87d){if(_0x277607['body']['id']){delete _0x277607[_0x387b('0x48')]['id'];}return db[_0x387b('0x2a')][_0x387b('0x49')]({'where':{'id':_0x277607['params']['id']}})[_0x387b('0x25')](handleEntityNotFound(_0x21a87d,null))[_0x387b('0x25')](saveUpdates(_0x277607[_0x387b('0x48')],null))[_0x387b('0x25')](respondWithResult(_0x21a87d,null))['catch'](handleError(_0x21a87d,null));};exports['destroy']=function(_0x147313,_0x3c5d13){return db[_0x387b('0x2a')][_0x387b('0x49')]({'where':{'id':_0x147313[_0x387b('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c5d13,null))['then'](removeEntity(_0x3c5d13,null))['catch'](handleError(_0x3c5d13,null));};exports[_0x387b('0x4a')]=function(_0x45be7b,_0x2f028b){return db[_0x387b('0x2a')][_0x387b('0x4a')]()[_0x387b('0x25')](respondWithResult(_0x2f028b,null))[_0x387b('0x41')](handleError(_0x2f028b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index ca5d446..6d6b172 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 _0x320e=['request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','moment','bluebird'];(function(_0x32ba11,_0x4d0690){var _0x557163=function(_0x1800cb){while(--_0x1800cb){_0x32ba11['push'](_0x32ba11['shift']());}};_0x557163(++_0x4d0690);}(_0x320e,0x8c));var _0xe320=function(_0x220f3b,_0x34332d){_0x220f3b=_0x220f3b-0x0;var _0x752fb7=_0x320e[_0x220f3b];return _0x752fb7;};'use strict';var _=require(_0xe320('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe320('0x1'));var BPromise=require(_0xe320('0x2'));var rp=require(_0xe320('0x3'));var fs=require('fs');var path=require(_0xe320('0x4'));var rimraf=require('rimraf');var config=require(_0xe320('0x5'));var attributes=require(_0xe320('0x6'));module[_0xe320('0x7')]=function(_0x3f4b14,_0x436712){return _0x3f4b14[_0xe320('0x8')]('MailTransferReport',attributes,{'tableName':_0xe320('0x9'),'paranoid':![],'indexes':[{'name':_0xe320('0xa'),'fields':[_0xe320('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d55=['util','api','moment','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x39ff07,_0xba9c03){var _0xaeee06=function(_0x14da43){while(--_0x14da43){_0x39ff07['push'](_0x39ff07['shift']());}};_0xaeee06(++_0xba9c03);}(_0x5d55,0x1a4));var _0x55d5=function(_0xc7e96d,_0x25b488){_0xc7e96d=_0xc7e96d-0x0;var _0x2c5ae6=_0x5d55[_0xc7e96d];return _0x2c5ae6;};'use strict';var _=require('lodash');var util=require(_0x55d5('0x0'));var logger=require('../../config/logger')(_0x55d5('0x1'));var moment=require(_0x55d5('0x2'));var BPromise=require('bluebird');var rp=require(_0x55d5('0x3'));var fs=require('fs');var path=require(_0x55d5('0x4'));var rimraf=require(_0x55d5('0x5'));var config=require('../../config/environment');var attributes=require(_0x55d5('0x6'));module[_0x55d5('0x7')]=function(_0x33e5c5,_0x35fe43){return _0x33e5c5[_0x55d5('0x8')](_0x55d5('0x9'),attributes,{'tableName':_0x55d5('0xa'),'paranoid':![],'indexes':[{'name':_0x55d5('0xb'),'fields':[_0x55d5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 35200b3..7e2c91d 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 _0xd47e=['rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5d3276,_0xd38063){var _0x3562f5=function(_0x5c5594){while(--_0x5c5594){_0x5d3276['push'](_0x5d3276['shift']());}};_0x3562f5(++_0xd38063);}(_0xd47e,0x1db));var _0xed47=function(_0x576e48,_0x42b102){_0x576e48=_0x576e48-0x0;var _0x3f089e=_0xd47e[_0x576e48];return _0x3f089e;};'use strict';var _=require(_0xed47('0x0'));var util=require(_0xed47('0x1'));var moment=require(_0xed47('0x2'));var BPromise=require(_0xed47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed47('0x4'));var db=require(_0xed47('0x5'))['db'];var utils=require(_0xed47('0x6'));var logger=require(_0xed47('0x7'))(_0xed47('0x8'));var config=require(_0xed47('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xed47('0xa')][_0xed47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31ea59,_0x8eabca,_0x2fcf10){return new BPromise(function(_0x54e538,_0x35fcbf){return client[_0xed47('0xc')](_0x31ea59,_0x2fcf10)[_0xed47('0xd')](function(_0x55cd2d){logger[_0xed47('0xe')](_0xed47('0xf'),_0x8eabca,'request\x20sent');logger[_0xed47('0x10')](_0xed47('0x11'),_0x8eabca,_0xed47('0x12'),JSON[_0xed47('0x13')](_0x55cd2d));if(_0x55cd2d['error']){if(_0x55cd2d['error']['code']===0x1f4){logger['error'](_0xed47('0xf'),_0x8eabca,_0x55cd2d[_0xed47('0x14')][_0xed47('0x15')]);return _0x35fcbf(_0x55cd2d[_0xed47('0x14')][_0xed47('0x15')]);}logger[_0xed47('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x8eabca,_0x55cd2d[_0xed47('0x14')][_0xed47('0x15')]);return _0x54e538(_0x55cd2d[_0xed47('0x14')][_0xed47('0x15')]);}else{logger[_0xed47('0xe')](_0xed47('0xf'),_0x8eabca,_0xed47('0x12'));_0x54e538(_0x55cd2d['result'][_0xed47('0x15')]);}})[_0xed47('0x16')](function(_0x38fb0d){logger[_0xed47('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x8eabca,_0x38fb0d);_0x35fcbf(_0x38fb0d);});});} \ No newline at end of file +var _0xe52e=['request\x20sent','result','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x4d27f8,_0x1a0842){var _0x457a2e=function(_0x3d222a){while(--_0x3d222a){_0x4d27f8['push'](_0x4d27f8['shift']());}};_0x457a2e(++_0x1a0842);}(_0xe52e,0x8a));var _0xee52=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xe52e[_0x172ed7];return _0xfa8f61;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee52('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee52('0x1'))['db'];var utils=require(_0xee52('0x2'));var logger=require(_0xee52('0x3'))(_0xee52('0x4'));var config=require(_0xee52('0x5'));var jayson=require(_0xee52('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x396559,_0xc9220,_0x59899d){return new BPromise(function(_0x234777,_0x31db8f){return client['request'](_0x396559,_0x59899d)['then'](function(_0x22cbee){logger[_0xee52('0x7')]('MailTransferReport,\x20%s,\x20%s',_0xc9220,'request\x20sent');logger[_0xee52('0x8')](_0xee52('0x9'),_0xc9220,'request\x20sent',JSON[_0xee52('0xa')](_0x22cbee));if(_0x22cbee[_0xee52('0xb')]){if(_0x22cbee[_0xee52('0xb')][_0xee52('0xc')]===0x1f4){logger[_0xee52('0xb')](_0xee52('0xd'),_0xc9220,_0x22cbee[_0xee52('0xb')][_0xee52('0xe')]);return _0x31db8f(_0x22cbee[_0xee52('0xb')][_0xee52('0xe')]);}logger[_0xee52('0xb')](_0xee52('0xd'),_0xc9220,_0x22cbee[_0xee52('0xb')][_0xee52('0xe')]);return _0x234777(_0x22cbee[_0xee52('0xb')]['message']);}else{logger[_0xee52('0x7')](_0xee52('0xd'),_0xc9220,_0xee52('0xf'));_0x234777(_0x22cbee[_0xee52('0x10')][_0xee52('0xe')]);}})['catch'](function(_0x330714){logger[_0xee52('0xb')]('MailTransferReport,\x20%s,\x20%s',_0xc9220,_0x330714);_0x31db8f(_0x330714);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 112677b..0aaef2e 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 _0xd37c=['../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy','exports','multer','express','../../components/auth/service'];(function(_0x4753f6,_0x29ce35){var _0x37028e=function(_0x48b715){while(--_0x48b715){_0x4753f6['push'](_0x4753f6['shift']());}};_0x37028e(++_0x29ce35);}(_0xd37c,0x147));var _0xcd37=function(_0x48f475,_0x314648){_0x48f475=_0x48f475-0x0;var _0x53b1f1=_0xd37c[_0x48f475];return _0x53b1f1;};'use strict';var multer=require(_0xcd37('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcd37('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcd37('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xcd37('0x3'));var controller=require('./memberReport.controller');router[_0xcd37('0x4')]('/',auth[_0xcd37('0x5')](),controller[_0xcd37('0x6')]);router[_0xcd37('0x4')](_0xcd37('0x7'),auth[_0xcd37('0x5')](),controller['describe']);router[_0xcd37('0x4')](_0xcd37('0x8'),auth[_0xcd37('0x5')](),controller['show']);router[_0xcd37('0x9')]('/',auth[_0xcd37('0x5')](),controller[_0xcd37('0xa')]);router[_0xcd37('0xb')](_0xcd37('0x8'),auth['isAuthenticated'](),controller[_0xcd37('0xc')]);router['delete'](_0xcd37('0x8'),auth[_0xcd37('0x5')](),controller[_0xcd37('0xd')]);module[_0xcd37('0xe')]=router; \ No newline at end of file +var _0xf0e4=['../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x351d17,_0x41764c){var _0x3efd53=function(_0x2b101f){while(--_0x2b101f){_0x351d17['push'](_0x351d17['shift']());}};_0x3efd53(++_0x41764c);}(_0xf0e4,0x1c8));var _0x4f0e=function(_0x488d92,_0xecaa28){_0x488d92=_0x488d92-0x0;var _0x22a8db=_0xf0e4[_0x488d92];return _0x22a8db;};'use strict';var multer=require(_0x4f0e('0x0'));var util=require(_0x4f0e('0x1'));var path=require(_0x4f0e('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f0e('0x3'));var router=express[_0x4f0e('0x4')]();var fs_extra=require(_0x4f0e('0x5'));var auth=require(_0x4f0e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f0e('0x7'));var controller=require(_0x4f0e('0x8'));router[_0x4f0e('0x9')]('/',auth[_0x4f0e('0xa')](),controller[_0x4f0e('0xb')]);router[_0x4f0e('0x9')]('/describe',auth[_0x4f0e('0xa')](),controller[_0x4f0e('0xc')]);router[_0x4f0e('0x9')](_0x4f0e('0xd'),auth[_0x4f0e('0xa')](),controller[_0x4f0e('0xe')]);router[_0x4f0e('0xf')]('/',auth[_0x4f0e('0xa')](),controller[_0x4f0e('0x10')]);router[_0x4f0e('0x11')](_0x4f0e('0xd'),auth[_0x4f0e('0xa')](),controller[_0x4f0e('0x12')]);router['delete'](_0x4f0e('0xd'),auth[_0x4f0e('0xa')](),controller[_0x4f0e('0x13')]);module[_0x4f0e('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index dd38ca5..e391563 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 _0xf8f6=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','sequelize','moment','exports','STRING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt'];(function(_0x569f9a,_0x58cc03){var _0x33cafb=function(_0x4b2300){while(--_0x4b2300){_0x569f9a['push'](_0x569f9a['shift']());}};_0x33cafb(++_0x58cc03);}(_0xf8f6,0x8f));var _0x6f8f=function(_0x3c76e5,_0x2d0e51){_0x3c76e5=_0x3c76e5-0x0;var _0x49ec2a=_0xf8f6[_0x3c76e5];return _0x49ec2a;};'use strict';var Sequelize=require(_0x6f8f('0x0'));var moment=require(_0x6f8f('0x1'));module[_0x6f8f('0x2')]={'channel':{'type':Sequelize[_0x6f8f('0x3')]},'membername':{'type':Sequelize[_0x6f8f('0x3')]},'interface':{'type':Sequelize[_0x6f8f('0x3')]},'type':{'type':Sequelize[_0x6f8f('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6f8f('0x4')]},'enterAt':{'type':Sequelize[_0x6f8f('0x5')]},'exitAt':{'type':Sequelize[_0x6f8f('0x5')],'set':function(_0x1aea0e){var _0x34209a=moment(_0x1aea0e);var _0x4a7b34=moment(this[_0x6f8f('0x6')](_0x6f8f('0x7')));var _0x502167=_0x34209a['diff'](_0x4a7b34,_0x6f8f('0x8'));this[_0x6f8f('0x9')](_0x6f8f('0xa'),_0x1aea0e);this[_0x6f8f('0x9')]('duration',_0x502167>=0x0?_0x502167:null);}},'data1':{'type':Sequelize[_0x6f8f('0x3')],'comment':_0x6f8f('0xb')},'data2':{'type':Sequelize[_0x6f8f('0x3')],'comment':_0x6f8f('0xc')},'data3':{'type':Sequelize[_0x6f8f('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x6f8f('0xd')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x6f8f('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8c87=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','setDataValue'];(function(_0x3b0386,_0x25cce2){var _0x2ef184=function(_0x4a7250){while(--_0x4a7250){_0x3b0386['push'](_0x3b0386['shift']());}};_0x2ef184(++_0x25cce2);}(_0x8c87,0x9e));var _0x78c8=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x8c87[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x78c8('0x0'));var moment=require(_0x78c8('0x1'));module[_0x78c8('0x2')]={'channel':{'type':Sequelize[_0x78c8('0x3')]},'membername':{'type':Sequelize[_0x78c8('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x78c8('0x3')],'defaultValue':_0x78c8('0x4'),'comment':_0x78c8('0x5')},'duration':{'type':Sequelize[_0x78c8('0x6')]},'enterAt':{'type':Sequelize[_0x78c8('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x481253){var _0x2928c0=moment(_0x481253);var _0x31859a=moment(this[_0x78c8('0x8')]('enterAt'));var _0x5e7b48=_0x2928c0[_0x78c8('0x9')](_0x31859a,_0x78c8('0xa'));this[_0x78c8('0xb')]('exitAt',_0x481253);this[_0x78c8('0xb')]('duration',_0x5e7b48>=0x0?_0x5e7b48:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x78c8('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x78c8('0xd')},'data3':{'type':Sequelize[_0x78c8('0x3')],'comment':_0x78c8('0xe')},'data4':{'type':Sequelize[_0x78c8('0x3')],'comment':_0x78c8('0xf')},'data5':{'type':Sequelize[_0x78c8('0x3')],'comment':_0x78c8('0x10')},'role':{'type':Sequelize[_0x78c8('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x78c8('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 0310f37..22333d5 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a3d2c,_0x4426dd){_0x5a3d2c=_0x5a3d2c-0x0;var _0x4c57f6=_0xedd9[_0x5a3d2c];return _0x4c57f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _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(_0x24dbee,_0x555794){var _0x444811=function(_0x3d2ce7){while(--_0x3d2ce7){_0x24dbee['push'](_0x24dbee['shift']());}};_0x444811(++_0x555794);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 7e1e098..9d0223b 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 _0xd1b5=['exports','MemberReport','report_member','membername_interface','interface','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x2655e2,_0xfdca89){var _0x57f14a=function(_0x3ce4ae){while(--_0x3ce4ae){_0x2655e2['push'](_0x2655e2['shift']());}};_0x57f14a(++_0xfdca89);}(_0xd1b5,0x67));var _0x5d1b=function(_0x5977cf,_0x3e31a6){_0x5977cf=_0x5977cf-0x0;var _0x41329f=_0xd1b5[_0x5977cf];return _0x41329f;};'use strict';var _=require(_0x5d1b('0x0'));var util=require(_0x5d1b('0x1'));var logger=require('../../config/logger')(_0x5d1b('0x2'));var moment=require('moment');var BPromise=require(_0x5d1b('0x3'));var rp=require(_0x5d1b('0x4'));var fs=require('fs');var path=require(_0x5d1b('0x5'));var rimraf=require(_0x5d1b('0x6'));var config=require(_0x5d1b('0x7'));var attributes=require(_0x5d1b('0x8'));module[_0x5d1b('0x9')]=function(_0xab66a0,_0x59518){return _0xab66a0['define'](_0x5d1b('0xa'),attributes,{'tableName':_0x5d1b('0xb'),'paranoid':![],'indexes':[{'name':_0x5d1b('0xc'),'fields':['membername',_0x5d1b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x36b2=['request-promise','rimraf','../../config/environment','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x36b2,0x6b));var _0x236b=function(_0x40d3a8,_0x120176){_0x40d3a8=_0x40d3a8-0x0;var _0xf8f402=_0x36b2[_0x40d3a8];return _0xf8f402;};'use strict';var _=require(_0x236b('0x0'));var util=require(_0x236b('0x1'));var logger=require(_0x236b('0x2'))('api');var moment=require(_0x236b('0x3'));var BPromise=require(_0x236b('0x4'));var rp=require(_0x236b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x236b('0x6'));var config=require(_0x236b('0x7'));var attributes=require('./memberReport.attributes');module[_0x236b('0x8')]=function(_0x27c095,_0x37867a){return _0x27c095[_0x236b('0x9')](_0x236b('0xa'),attributes,{'tableName':_0x236b('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x236b('0xc'),_0x236b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index bcd5b40..1042e44 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 _0xe5e0=['result','catch','GetMemberReport','findAll','options','raw','attributes','limit','include','map','model','CreateMemberReport','MemberReport','UpdateMemberReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s','message','info'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x992fd5,_0xe331d3){_0x992fd5=_0x992fd5-0x0;var _0x15782d=_0xe5e0[_0x992fd5];return _0x15782d;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var moment=require(_0x0e5e('0x2'));var BPromise=require(_0x0e5e('0x3'));var rs=require(_0x0e5e('0x4'));var fs=require('fs');var Redis=require(_0x0e5e('0x5'));var db=require(_0x0e5e('0x6'))['db'];var utils=require(_0x0e5e('0x7'));var logger=require(_0x0e5e('0x8'))('rpc');var config=require(_0x0e5e('0x9'));var jayson=require(_0x0e5e('0xa'));var client=jayson[_0x0e5e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b9800,_0x437362,_0x827738){return new BPromise(function(_0x4093cc,_0x6eba1c){return client[_0x0e5e('0xc')](_0x4b9800,_0x827738)[_0x0e5e('0xd')](function(_0x4b8feb){logger['info']('MemberReport,\x20%s,\x20%s',_0x437362,_0x0e5e('0xe'));logger[_0x0e5e('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x437362,'request\x20sent',JSON[_0x0e5e('0x10')](_0x4b8feb));if(_0x4b8feb[_0x0e5e('0x11')]){if(_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x12')]===0x1f4){logger['error'](_0x0e5e('0x13'),_0x437362,_0x4b8feb[_0x0e5e('0x11')]['message']);return _0x6eba1c(_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x14')]);}logger[_0x0e5e('0x11')]('MemberReport,\x20%s,\x20%s',_0x437362,_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x14')]);return _0x4093cc(_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x14')]);}else{logger[_0x0e5e('0x15')](_0x0e5e('0x13'),_0x437362,'request\x20sent');_0x4093cc(_0x4b8feb[_0x0e5e('0x16')][_0x0e5e('0x14')]);}})[_0x0e5e('0x17')](function(_0x245920){logger[_0x0e5e('0x11')]('MemberReport,\x20%s,\x20%s',_0x437362,_0x245920);_0x6eba1c(_0x245920);});});}exports[_0x0e5e('0x18')]=function(_0x2efa7f){var _0x4bfc60=this;return new Promise(function(_0x29597b,_0x3fd280){return db['MemberReport'][_0x0e5e('0x19')]({'raw':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f['options'][_0x0e5e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f[_0x0e5e('0x1a')]['where']||null:null,'attributes':_0x2efa7f['options']?_0x2efa7f[_0x0e5e('0x1a')][_0x0e5e('0x1c')]||null:null,'limit':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f[_0x0e5e('0x1a')][_0x0e5e('0x1d')]||null:null,'include':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f[_0x0e5e('0x1a')][_0x0e5e('0x1e')]?_[_0x0e5e('0x1f')](_0x2efa7f[_0x0e5e('0x1a')]['include'],function(_0x742ee8){return{'model':db[_0x742ee8[_0x0e5e('0x20')]],'as':_0x742ee8['as'],'attributes':_0x742ee8[_0x0e5e('0x1c')],'include':_0x742ee8[_0x0e5e('0x1e')]?_[_0x0e5e('0x1f')](_0x742ee8[_0x0e5e('0x1e')],function(_0x46cbd7){return{'model':db[_0x46cbd7['model']],'as':_0x46cbd7['as'],'attributes':_0x46cbd7[_0x0e5e('0x1c')],'include':_0x46cbd7['include']?_[_0x0e5e('0x1f')](_0x46cbd7[_0x0e5e('0x1e')],function(_0x5e3a60){return{'model':db[_0x5e3a60[_0x0e5e('0x20')]],'as':_0x5e3a60['as'],'attributes':_0x5e3a60[_0x0e5e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0e5e('0xd')](function(_0x563870){logger[_0x0e5e('0x15')]('GetMemberReport',_0x2efa7f);logger[_0x0e5e('0xf')](_0x0e5e('0x18'),_0x2efa7f,JSON[_0x0e5e('0x10')](_0x563870));_0x29597b(_0x563870);})['catch'](function(_0x38930f){logger[_0x0e5e('0x11')](_0x0e5e('0x18'),_0x38930f[_0x0e5e('0x14')],_0x2efa7f);_0x3fd280(_0x4bfc60[_0x0e5e('0x11')](0x1f4,_0x38930f[_0x0e5e('0x14')]));});});};exports[_0x0e5e('0x21')]=function(_0x4ca32e){var _0x34455b=this;return new Promise(function(_0x43a2be,_0x2c7dff){return db[_0x0e5e('0x22')]['create'](_0x4ca32e['body'],{'raw':_0x4ca32e['options']?_0x4ca32e['options'][_0x0e5e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x44b4e7){logger[_0x0e5e('0x15')](_0x0e5e('0x21'),_0x4ca32e);logger['debug'](_0x0e5e('0x21'),_0x4ca32e,JSON['stringify'](_0x44b4e7));_0x43a2be(_0x44b4e7);})['catch'](function(_0x1fc5c5){logger[_0x0e5e('0x11')](_0x0e5e('0x21'),_0x1fc5c5[_0x0e5e('0x14')],_0x4ca32e);_0x2c7dff(_0x34455b[_0x0e5e('0x11')](0x1f4,_0x1fc5c5['message']));});});};exports[_0x0e5e('0x23')]=function(_0x3621c9){var _0x308f4d=this;return new Promise(function(_0x1744d9,_0x38871b){return db[_0x0e5e('0x22')][_0x0e5e('0x24')](_0x3621c9[_0x0e5e('0x25')],{'raw':_0x3621c9[_0x0e5e('0x1a')]?_0x3621c9['options'][_0x0e5e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3621c9[_0x0e5e('0x1a')]?_0x3621c9[_0x0e5e('0x1a')][_0x0e5e('0x26')]||null:null,'attributes':_0x3621c9['options']?_0x3621c9[_0x0e5e('0x1a')]['attributes']||null:null,'limit':_0x3621c9[_0x0e5e('0x1a')]?_0x3621c9[_0x0e5e('0x1a')][_0x0e5e('0x1d')]||null:null})['then'](function(_0x471b0f){logger[_0x0e5e('0x15')](_0x0e5e('0x23'),_0x3621c9);logger['debug']('UpdateMemberReport',_0x3621c9,JSON[_0x0e5e('0x10')](_0x471b0f));_0x1744d9(_0x471b0f);})[_0x0e5e('0x17')](function(_0x3a962c){logger['error'](_0x0e5e('0x23'),_0x3a962c[_0x0e5e('0x14')],_0x3621c9);_0x38871b(_0x308f4d[_0x0e5e('0x11')](0x1f4,_0x3a962c[_0x0e5e('0x14')]));});});}; \ No newline at end of file +var _0x5a99=['jayson/promise','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','MemberReport','findAll','options','raw','where','attributes','include','map','model','GetMemberReport','debug','body','CreateMemberReport','UpdateMemberReport','update','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1b59e6,_0x3eba86){var _0x3a2b0a=function(_0x16461f){while(--_0x16461f){_0x1b59e6['push'](_0x1b59e6['shift']());}};_0x3a2b0a(++_0x3eba86);}(_0x5a99,0xc9));var _0x95a9=function(_0x1ead65,_0x1c1199){_0x1ead65=_0x1ead65-0x0;var _0x17a017=_0x5a99[_0x1ead65];return _0x17a017;};'use strict';var _=require(_0x95a9('0x0'));var util=require(_0x95a9('0x1'));var moment=require(_0x95a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x95a9('0x3'));var fs=require('fs');var Redis=require(_0x95a9('0x4'));var db=require(_0x95a9('0x5'))['db'];var utils=require(_0x95a9('0x6'));var logger=require('../../config/logger')(_0x95a9('0x7'));var config=require(_0x95a9('0x8'));var jayson=require(_0x95a9('0x9'));var client=jayson[_0x95a9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x438069,_0x45850f,_0x108eb6){return new BPromise(function(_0x4b2d58,_0x3d9149){return client['request'](_0x438069,_0x108eb6)[_0x95a9('0xb')](function(_0x34290e){logger[_0x95a9('0xc')](_0x95a9('0xd'),_0x45850f,_0x95a9('0xe'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x45850f,_0x95a9('0xe'),JSON[_0x95a9('0xf')](_0x34290e));if(_0x34290e['error']){if(_0x34290e[_0x95a9('0x10')]['code']===0x1f4){logger[_0x95a9('0x10')](_0x95a9('0xd'),_0x45850f,_0x34290e[_0x95a9('0x10')][_0x95a9('0x11')]);return _0x3d9149(_0x34290e[_0x95a9('0x10')]['message']);}logger['error']('MemberReport,\x20%s,\x20%s',_0x45850f,_0x34290e[_0x95a9('0x10')]['message']);return _0x4b2d58(_0x34290e[_0x95a9('0x10')][_0x95a9('0x11')]);}else{logger[_0x95a9('0xc')]('MemberReport,\x20%s,\x20%s',_0x45850f,_0x95a9('0xe'));_0x4b2d58(_0x34290e['result'][_0x95a9('0x11')]);}})[_0x95a9('0x12')](function(_0x45e88c){logger['error'](_0x95a9('0xd'),_0x45850f,_0x45e88c);_0x3d9149(_0x45e88c);});});}exports['GetMemberReport']=function(_0x4bcec6){var _0x3ee15f=this;return new Promise(function(_0x3b6d30,_0x2cd19a){return db[_0x95a9('0x13')][_0x95a9('0x14')]({'raw':_0x4bcec6[_0x95a9('0x15')]?_0x4bcec6[_0x95a9('0x15')][_0x95a9('0x16')]===undefined?!![]:![]:!![],'where':_0x4bcec6[_0x95a9('0x15')]?_0x4bcec6[_0x95a9('0x15')][_0x95a9('0x17')]||null:null,'attributes':_0x4bcec6['options']?_0x4bcec6[_0x95a9('0x15')][_0x95a9('0x18')]||null:null,'limit':_0x4bcec6[_0x95a9('0x15')]?_0x4bcec6[_0x95a9('0x15')]['limit']||null:null,'include':_0x4bcec6[_0x95a9('0x15')]?_0x4bcec6[_0x95a9('0x15')][_0x95a9('0x19')]?_[_0x95a9('0x1a')](_0x4bcec6[_0x95a9('0x15')][_0x95a9('0x19')],function(_0x203c51){return{'model':db[_0x203c51['model']],'as':_0x203c51['as'],'attributes':_0x203c51[_0x95a9('0x18')],'include':_0x203c51[_0x95a9('0x19')]?_[_0x95a9('0x1a')](_0x203c51['include'],function(_0x493acf){return{'model':db[_0x493acf[_0x95a9('0x1b')]],'as':_0x493acf['as'],'attributes':_0x493acf['attributes'],'include':_0x493acf['include']?_[_0x95a9('0x1a')](_0x493acf['include'],function(_0x19e04f){return{'model':db[_0x19e04f[_0x95a9('0x1b')]],'as':_0x19e04f['as'],'attributes':_0x19e04f[_0x95a9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x95a9('0xb')](function(_0x2951f4){logger[_0x95a9('0xc')](_0x95a9('0x1c'),_0x4bcec6);logger[_0x95a9('0x1d')](_0x95a9('0x1c'),_0x4bcec6,JSON[_0x95a9('0xf')](_0x2951f4));_0x3b6d30(_0x2951f4);})[_0x95a9('0x12')](function(_0xe64e70){logger[_0x95a9('0x10')](_0x95a9('0x1c'),_0xe64e70[_0x95a9('0x11')],_0x4bcec6);_0x2cd19a(_0x3ee15f[_0x95a9('0x10')](0x1f4,_0xe64e70[_0x95a9('0x11')]));});});};exports['CreateMemberReport']=function(_0x5edbf1){var _0x59087c=this;return new Promise(function(_0x462993,_0x1d4ab3){return db[_0x95a9('0x13')]['create'](_0x5edbf1[_0x95a9('0x1e')],{'raw':_0x5edbf1[_0x95a9('0x15')]?_0x5edbf1[_0x95a9('0x15')][_0x95a9('0x16')]===undefined?!![]:![]:!![]})[_0x95a9('0xb')](function(_0x3a7e75){logger[_0x95a9('0xc')](_0x95a9('0x1f'),_0x5edbf1);logger['debug']('CreateMemberReport',_0x5edbf1,JSON['stringify'](_0x3a7e75));_0x462993(_0x3a7e75);})[_0x95a9('0x12')](function(_0x205fdd){logger[_0x95a9('0x10')](_0x95a9('0x1f'),_0x205fdd['message'],_0x5edbf1);_0x1d4ab3(_0x59087c[_0x95a9('0x10')](0x1f4,_0x205fdd[_0x95a9('0x11')]));});});};exports[_0x95a9('0x20')]=function(_0x3772e6){var _0x31f34e=this;return new Promise(function(_0xa9e4d,_0x3e4c05){return db[_0x95a9('0x13')][_0x95a9('0x21')](_0x3772e6[_0x95a9('0x1e')],{'raw':_0x3772e6[_0x95a9('0x15')]?_0x3772e6['options'][_0x95a9('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3772e6[_0x95a9('0x15')]?_0x3772e6[_0x95a9('0x15')][_0x95a9('0x17')]||null:null,'attributes':_0x3772e6[_0x95a9('0x15')]?_0x3772e6[_0x95a9('0x15')]['attributes']||null:null,'limit':_0x3772e6[_0x95a9('0x15')]?_0x3772e6[_0x95a9('0x15')][_0x95a9('0x22')]||null:null})[_0x95a9('0xb')](function(_0xf2b0b4){logger['info'](_0x95a9('0x20'),_0x3772e6);logger[_0x95a9('0x1d')]('UpdateMemberReport',_0x3772e6,JSON[_0x95a9('0xf')](_0xf2b0b4));_0xa9e4d(_0xf2b0b4);})[_0x95a9('0x12')](function(_0x5e7471){logger['error'](_0x95a9('0x20'),_0x5e7471[_0x95a9('0x11')],_0x3772e6);_0x3e4c05(_0x31f34e[_0x95a9('0x10')](0x1f4,_0x5e7471[_0x95a9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 89b0bfd..ab9cf6b 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 _0x383c=['express','fs-extra','../../components/auth/service','../../config/environment','get','exports','path'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x383c,0x164));var _0xc383=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x383c[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc383('0x0'));var timeout=require('connect-timeout');var express=require(_0xc383('0x1'));var router=express['Router']();var fs_extra=require(_0xc383('0x2'));var auth=require(_0xc383('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc383('0x4'));var controller=require('./migration.controller');router[_0xc383('0x5')]('/',controller['index']);module[_0xc383('0x6')]=router; \ No newline at end of file +var _0x161e=['Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','multer','util','connect-timeout','express'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x161e,0x1e8));var _0xe161=function(_0x4f7ff1,_0x11fae1){_0x4f7ff1=_0x4f7ff1-0x0;var _0xd6e2d5=_0x161e[_0x4f7ff1];return _0xd6e2d5;};'use strict';var multer=require(_0xe161('0x0'));var util=require(_0xe161('0x1'));var path=require('path');var timeout=require(_0xe161('0x2'));var express=require(_0xe161('0x3'));var router=express[_0xe161('0x4')]();var fs_extra=require(_0xe161('0x5'));var auth=require(_0xe161('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe161('0x7'));var controller=require(_0xe161('0x8'));router[_0xe161('0x9')]('/',controller[_0xe161('0xa')]);module[_0xe161('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index d914ee6..deb7f52 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 _0x1f64=['STRING','version','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1f64,0x17e));var _0x41f6=function(_0x33267d,_0x1bcdb4){_0x33267d=_0x33267d-0x0;var _0x27d0d=_0x1f64[_0x33267d];return _0x27d0d;};'use strict';var Sequelize=require(_0x41f6('0x0'));module[_0x41f6('0x1')]={'version':{'type':Sequelize[_0x41f6('0x2')],'unique':_0x41f6('0x3')}}; \ No newline at end of file +var _0x5c24=['sequelize','exports','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5c24,0x15f));var _0x45c2=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0x5c24[_0x59b2a1];return _0x4908d1;};'use strict';var Sequelize=require(_0x45c2('0x0'));module[_0x45c2('0x1')]={'version':{'type':Sequelize[_0x45c2('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index fbfcc2a..dbbf88c 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 _0x8d88=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','error','stack','name','send','index','map','Migration','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring'];(function(_0xf5de21,_0x29591f){var _0xc1694a=function(_0x445a5e){while(--_0x445a5e){_0xf5de21['push'](_0xf5de21['shift']());}};_0xc1694a(++_0x29591f);}(_0x8d88,0x1be));var _0x88d8=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0x8d88[_0x6182ff];return _0x1cec22;};'use strict';var emlformat=require(_0x88d8('0x0'));var rimraf=require(_0x88d8('0x1'));var zipdir=require(_0x88d8('0x2'));var jsonpatch=require(_0x88d8('0x3'));var rp=require(_0x88d8('0x4'));var moment=require(_0x88d8('0x5'));var BPromise=require(_0x88d8('0x6'));var Mustache=require(_0x88d8('0x7'));var util=require(_0x88d8('0x8'));var path=require(_0x88d8('0x9'));var sox=require(_0x88d8('0xa'));var csv=require(_0x88d8('0xb'));var ejs=require(_0x88d8('0xc'));var fs=require('fs');var fs_extra=require(_0x88d8('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x88d8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x88d8('0xb'));var querystring=require(_0x88d8('0xf'));var Papa=require(_0x88d8('0x10'));var Redis=require(_0x88d8('0x11'));var authService=require(_0x88d8('0x12'));var qs=require(_0x88d8('0x13'));var as=require(_0x88d8('0x14'));var hardwareService=require(_0x88d8('0x15'));var logger=require(_0x88d8('0x16'))('api');var utils=require(_0x88d8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x88d8('0x18'));var db=require(_0x88d8('0x19'))['db'];function respondWithStatusCode(_0x17e710,_0x58a607){_0x58a607=_0x58a607||0xcc;return function(_0xc29a9e){if(_0xc29a9e){return _0x17e710[_0x88d8('0x1a')](_0x58a607);}return _0x17e710[_0x88d8('0x1b')](_0x58a607)[_0x88d8('0x1c')]();};}function respondWithResult(_0x268bad,_0x56b63d){_0x56b63d=_0x56b63d||0xc8;return function(_0x39bf29){if(_0x39bf29){return _0x268bad['status'](_0x56b63d)[_0x88d8('0x1d')](_0x39bf29);}};}function respondWithFilteredResult(_0x132630,_0xb39ff8){return function(_0xcc7fe5){if(_0xcc7fe5){var _0x199af3=typeof _0xb39ff8['offset']==='undefined'&&typeof _0xb39ff8[_0x88d8('0x1e')]===_0x88d8('0x1f');var _0xcc182f=_0xcc7fe5['count'];var _0x8a2950=_0x199af3?0x0:_0xb39ff8['offset'];var _0x77e333=_0x199af3?_0xcc7fe5[_0x88d8('0x20')]:_0xb39ff8[_0x88d8('0x21')]+_0xb39ff8['limit'];var _0x55d2ff;if(_0x77e333>=_0xcc182f){_0x77e333=_0xcc182f;_0x55d2ff=0xc8;}else{_0x55d2ff=0xce;}_0x132630['status'](_0x55d2ff);return _0x132630[_0x88d8('0x22')](_0x88d8('0x23'),_0x8a2950+'-'+_0x77e333+'/'+_0xcc182f)[_0x88d8('0x1d')](_0xcc7fe5);}return null;};}function patchUpdates(_0x179545){return function(_0x5a6305){try{jsonpatch['apply'](_0x5a6305,_0x179545,!![]);}catch(_0x51643e){return BPromise[_0x88d8('0x24')](_0x51643e);}return _0x5a6305[_0x88d8('0x25')]();};}function saveUpdates(_0x5e7104,_0x95f259){return function(_0x580a6a){if(_0x580a6a){return _0x580a6a['update'](_0x5e7104)[_0x88d8('0x26')](function(_0x7f269d){return _0x7f269d;});}return null;};}function removeEntity(_0x28e64e,_0x14bc48){return function(_0x3dc858){if(_0x3dc858){return _0x3dc858['destroy']()['then'](function(){_0x28e64e['status'](0xcc)[_0x88d8('0x1c')]();});}};}function handleEntityNotFound(_0x53df7b,_0x337b53){return function(_0x149ddd){if(!_0x149ddd){_0x53df7b['sendStatus'](0x194);}return _0x149ddd;};}function handleError(_0x3b55c2,_0xf84672){_0xf84672=_0xf84672||0x1f4;return function(_0x3532e2){logger[_0x88d8('0x27')](_0x3532e2[_0x88d8('0x28')]);if(_0x3532e2[_0x88d8('0x29')]){delete _0x3532e2['name'];}_0x3b55c2[_0x88d8('0x1b')](_0xf84672)[_0x88d8('0x2a')](_0x3532e2);};}exports[_0x88d8('0x2b')]=function(_0x44d934,_0x575fd3){var _0x5eed36={},_0x26bcc5={},_0x55e9ac={'count':0x0,'rows':[]};var _0x5c2f8c=_[_0x88d8('0x2c')](db[_0x88d8('0x2d')][_0x88d8('0x2e')],function(_0x4cc0e4){return{'name':_0x4cc0e4['fieldName'],'type':_0x4cc0e4[_0x88d8('0x2f')][_0x88d8('0x30')]};});_0x26bcc5[_0x88d8('0x31')]=_['map'](_0x5c2f8c,_0x88d8('0x29'));_0x26bcc5['query']=_[_0x88d8('0x32')](_0x44d934[_0x88d8('0x33')]);_0x26bcc5[_0x88d8('0x34')]=_['intersection'](_0x26bcc5[_0x88d8('0x31')],_0x26bcc5[_0x88d8('0x33')]);_0x5eed36['attributes']=_[_0x88d8('0x35')](_0x26bcc5[_0x88d8('0x31')],qs[_0x88d8('0x36')](_0x44d934[_0x88d8('0x33')]['fields']));_0x5eed36[_0x88d8('0x37')]=_0x5eed36[_0x88d8('0x37')]['length']?_0x5eed36['attributes']:_0x26bcc5[_0x88d8('0x31')];if(!_0x44d934[_0x88d8('0x33')][_0x88d8('0x38')](_0x88d8('0x39'))){_0x5eed36[_0x88d8('0x1e')]=qs[_0x88d8('0x1e')](_0x44d934[_0x88d8('0x33')][_0x88d8('0x1e')]);_0x5eed36[_0x88d8('0x21')]=qs[_0x88d8('0x21')](_0x44d934[_0x88d8('0x33')][_0x88d8('0x21')]);}_0x5eed36['order']=qs[_0x88d8('0x3a')](_0x44d934[_0x88d8('0x33')]['sort']);_0x5eed36[_0x88d8('0x3b')]=qs[_0x88d8('0x34')](_['pick'](_0x44d934[_0x88d8('0x33')],_0x26bcc5[_0x88d8('0x34')]),_0x5c2f8c);if(_0x44d934[_0x88d8('0x33')][_0x88d8('0x3c')]){_0x5eed36[_0x88d8('0x3b')]=_[_0x88d8('0x3d')](_0x5eed36['where'],{'$or':_['map'](_0x5c2f8c,function(_0x19f049){if(_0x19f049[_0x88d8('0x2f')]!=='VIRTUAL'){var _0x4e0bf9={};_0x4e0bf9[_0x19f049['name']]={'$like':'%'+_0x44d934[_0x88d8('0x33')]['filter']+'%'};return _0x4e0bf9;}})});}_0x5eed36=_['merge']({},_0x5eed36,_0x44d934[_0x88d8('0x3e')]);var _0x40bbf1={'where':_0x5eed36[_0x88d8('0x3b')]};return db[_0x88d8('0x2d')][_0x88d8('0x20')](_0x40bbf1)[_0x88d8('0x26')](function(_0x29a560){_0x55e9ac[_0x88d8('0x20')]=_0x29a560;if(_0x44d934['query']['includeAll']){_0x5eed36['include']=[{'all':!![]}];}return db[_0x88d8('0x2d')][_0x88d8('0x3f')](_0x5eed36);})['then'](function(_0x4308a4){_0x55e9ac[_0x88d8('0x40')]=_0x4308a4;return _0x55e9ac;})[_0x88d8('0x26')](respondWithFilteredResult(_0x575fd3,_0x5eed36))[_0x88d8('0x41')](handleError(_0x575fd3,null));}; \ No newline at end of file +var _0xf365=['model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','options','include','rows','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','Migration','fieldName','type','key'];(function(_0x25d9cd,_0x4e22d3){var _0x4fbb45=function(_0x423fdd){while(--_0x423fdd){_0x25d9cd['push'](_0x25d9cd['shift']());}};_0x4fbb45(++_0x4e22d3);}(_0xf365,0xce));var _0x5f36=function(_0x162246,_0x4e5038){_0x162246=_0x162246-0x0;var _0x32ac95=_0xf365[_0x162246];return _0x32ac95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f36('0x0'));var zipdir=require(_0x5f36('0x1'));var jsonpatch=require(_0x5f36('0x2'));var rp=require('request-promise');var moment=require(_0x5f36('0x3'));var BPromise=require(_0x5f36('0x4'));var Mustache=require(_0x5f36('0x5'));var util=require(_0x5f36('0x6'));var path=require(_0x5f36('0x7'));var sox=require('sox');var csv=require(_0x5f36('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f36('0x9'));var _=require(_0x5f36('0xa'));var squel=require('squel');var crypto=require(_0x5f36('0xb'));var jsforce=require(_0x5f36('0xc'));var deskjs=require(_0x5f36('0xd'));var toCsv=require(_0x5f36('0x8'));var querystring=require(_0x5f36('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f36('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5f36('0x10'));var hardwareService=require(_0x5f36('0x11'));var logger=require(_0x5f36('0x12'))(_0x5f36('0x13'));var utils=require(_0x5f36('0x14'));var config=require(_0x5f36('0x15'));var licenseUtil=require(_0x5f36('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14743b,_0x5af21f){_0x5af21f=_0x5af21f||0xcc;return function(_0x5dc98c){if(_0x5dc98c){return _0x14743b[_0x5f36('0x17')](_0x5af21f);}return _0x14743b[_0x5f36('0x18')](_0x5af21f)[_0x5f36('0x19')]();};}function respondWithResult(_0x2ea4a3,_0x2cec6b){_0x2cec6b=_0x2cec6b||0xc8;return function(_0x106348){if(_0x106348){return _0x2ea4a3[_0x5f36('0x18')](_0x2cec6b)['json'](_0x106348);}};}function respondWithFilteredResult(_0x48c318,_0xd63e37){return function(_0x4e2fcc){if(_0x4e2fcc){var _0x5ec0c3=typeof _0xd63e37[_0x5f36('0x1a')]===_0x5f36('0x1b')&&typeof _0xd63e37[_0x5f36('0x1c')]===_0x5f36('0x1b');var _0x4be430=_0x4e2fcc[_0x5f36('0x1d')];var _0x2b8043=_0x5ec0c3?0x0:_0xd63e37[_0x5f36('0x1a')];var _0x4c4083=_0x5ec0c3?_0x4e2fcc['count']:_0xd63e37[_0x5f36('0x1a')]+_0xd63e37[_0x5f36('0x1c')];var _0x1fed6e;if(_0x4c4083>=_0x4be430){_0x4c4083=_0x4be430;_0x1fed6e=0xc8;}else{_0x1fed6e=0xce;}_0x48c318['status'](_0x1fed6e);return _0x48c318['set'](_0x5f36('0x1e'),_0x2b8043+'-'+_0x4c4083+'/'+_0x4be430)[_0x5f36('0x1f')](_0x4e2fcc);}return null;};}function patchUpdates(_0x2de4dd){return function(_0x45e61b){try{jsonpatch[_0x5f36('0x20')](_0x45e61b,_0x2de4dd,!![]);}catch(_0xb538fa){return BPromise[_0x5f36('0x21')](_0xb538fa);}return _0x45e61b[_0x5f36('0x22')]();};}function saveUpdates(_0x2a78e3,_0x383384){return function(_0x4ee568){if(_0x4ee568){return _0x4ee568[_0x5f36('0x23')](_0x2a78e3)[_0x5f36('0x24')](function(_0xe4600f){return _0xe4600f;});}return null;};}function removeEntity(_0x1d0985,_0x275ebd){return function(_0x4083f8){if(_0x4083f8){return _0x4083f8[_0x5f36('0x25')]()[_0x5f36('0x24')](function(){_0x1d0985[_0x5f36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42cf40,_0x49ea30){return function(_0x447d6c){if(!_0x447d6c){_0x42cf40[_0x5f36('0x17')](0x194);}return _0x447d6c;};}function handleError(_0x2141f9,_0x3239bc){_0x3239bc=_0x3239bc||0x1f4;return function(_0x6edd30){logger[_0x5f36('0x26')](_0x6edd30['stack']);if(_0x6edd30[_0x5f36('0x27')]){delete _0x6edd30['name'];}_0x2141f9[_0x5f36('0x18')](_0x3239bc)[_0x5f36('0x28')](_0x6edd30);};}exports[_0x5f36('0x29')]=function(_0x1886e5,_0x3a298d){var _0x4db457={},_0x2f4cf7={},_0x3c87ac={'count':0x0,'rows':[]};var _0x260525=_['map'](db[_0x5f36('0x2a')]['rawAttributes'],function(_0x25c732){return{'name':_0x25c732[_0x5f36('0x2b')],'type':_0x25c732[_0x5f36('0x2c')][_0x5f36('0x2d')]};});_0x2f4cf7[_0x5f36('0x2e')]=_[_0x5f36('0x2f')](_0x260525,'name');_0x2f4cf7[_0x5f36('0x30')]=_[_0x5f36('0x31')](_0x1886e5[_0x5f36('0x30')]);_0x2f4cf7[_0x5f36('0x32')]=_[_0x5f36('0x33')](_0x2f4cf7[_0x5f36('0x2e')],_0x2f4cf7[_0x5f36('0x30')]);_0x4db457[_0x5f36('0x34')]=_[_0x5f36('0x33')](_0x2f4cf7[_0x5f36('0x2e')],qs[_0x5f36('0x35')](_0x1886e5[_0x5f36('0x30')]['fields']));_0x4db457[_0x5f36('0x34')]=_0x4db457['attributes']['length']?_0x4db457['attributes']:_0x2f4cf7[_0x5f36('0x2e')];if(!_0x1886e5[_0x5f36('0x30')][_0x5f36('0x36')](_0x5f36('0x37'))){_0x4db457['limit']=qs['limit'](_0x1886e5[_0x5f36('0x30')][_0x5f36('0x1c')]);_0x4db457[_0x5f36('0x1a')]=qs['offset'](_0x1886e5['query'][_0x5f36('0x1a')]);}_0x4db457['order']=qs[_0x5f36('0x38')](_0x1886e5['query'][_0x5f36('0x38')]);_0x4db457[_0x5f36('0x39')]=qs['filters'](_[_0x5f36('0x3a')](_0x1886e5['query'],_0x2f4cf7[_0x5f36('0x32')]),_0x260525);if(_0x1886e5[_0x5f36('0x30')]['filter']){_0x4db457[_0x5f36('0x39')]=_['merge'](_0x4db457['where'],{'$or':_['map'](_0x260525,function(_0x272b5b){if(_0x272b5b[_0x5f36('0x2c')]!=='VIRTUAL'){var _0xadda9c={};_0xadda9c[_0x272b5b[_0x5f36('0x27')]]={'$like':'%'+_0x1886e5[_0x5f36('0x30')]['filter']+'%'};return _0xadda9c;}})});}_0x4db457=_['merge']({},_0x4db457,_0x1886e5[_0x5f36('0x3b')]);var _0x562245={'where':_0x4db457[_0x5f36('0x39')]};return db[_0x5f36('0x2a')][_0x5f36('0x1d')](_0x562245)[_0x5f36('0x24')](function(_0x18aced){_0x3c87ac[_0x5f36('0x1d')]=_0x18aced;if(_0x1886e5['query']['includeAll']){_0x4db457[_0x5f36('0x3c')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x4db457);})['then'](function(_0x547991){_0x3c87ac[_0x5f36('0x3d')]=_0x547991;return _0x3c87ac;})[_0x5f36('0x24')](respondWithFilteredResult(_0x3a298d,_0x4db457))[_0x5f36('0x3e')](handleError(_0x3a298d,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f4ffa3c..d780e00 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 _0xdcdb=['exports','define','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x15a29b,_0x58c005){var _0x4117b4=function(_0x4f76b9){while(--_0x4f76b9){_0x15a29b['push'](_0x15a29b['shift']());}};_0x4117b4(++_0x58c005);}(_0xdcdb,0xb2));var _0xbdcd=function(_0x53a306,_0x2cb4b0){_0x53a306=_0x53a306-0x0;var _0x3f3507=_0xdcdb[_0x53a306];return _0x3f3507;};'use strict';var _=require('lodash');var util=require(_0xbdcd('0x0'));var logger=require(_0xbdcd('0x1'))(_0xbdcd('0x2'));var moment=require(_0xbdcd('0x3'));var BPromise=require(_0xbdcd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdcd('0x5'));var rimraf=require(_0xbdcd('0x6'));var config=require(_0xbdcd('0x7'));var attributes=require(_0xbdcd('0x8'));module[_0xbdcd('0x9')]=function(_0x17575b,_0x52db2b){return _0x17575b[_0xbdcd('0xa')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eb4=['./migration.attributes','exports','define','migrations','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xccd1cd,_0x5bbacd){var _0x24740a=function(_0x44b944){while(--_0x44b944){_0xccd1cd['push'](_0xccd1cd['shift']());}};_0x24740a(++_0x5bbacd);}(_0x6eb4,0x9e));var _0x46eb=function(_0x19b705,_0x5d3650){_0x19b705=_0x19b705-0x0;var _0x369ea7=_0x6eb4[_0x19b705];return _0x369ea7;};'use strict';var _=require(_0x46eb('0x0'));var util=require(_0x46eb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x46eb('0x2'));var BPromise=require('bluebird');var rp=require(_0x46eb('0x3'));var fs=require('fs');var path=require(_0x46eb('0x4'));var rimraf=require(_0x46eb('0x5'));var config=require(_0x46eb('0x6'));var attributes=require(_0x46eb('0x7'));module[_0x46eb('0x8')]=function(_0x288848,_0x92e381){return _0x288848[_0x46eb('0x9')]('Migration',attributes,{'tableName':_0x46eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 3af5e8e..916170d 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 _0xe920=['../../config/logger','rpc','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','Migration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3d1fbf,_0x2ed575){var _0x4cc702=function(_0x40dacf){while(--_0x40dacf){_0x3d1fbf['push'](_0x3d1fbf['shift']());}};_0x4cc702(++_0x2ed575);}(_0xe920,0xbe));var _0x0e92=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0xe920[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var moment=require(_0x0e92('0x2'));var BPromise=require(_0x0e92('0x3'));var rs=require(_0x0e92('0x4'));var fs=require('fs');var Redis=require(_0x0e92('0x5'));var db=require(_0x0e92('0x6'))['db'];var utils=require(_0x0e92('0x7'));var logger=require(_0x0e92('0x8'))(_0x0e92('0x9'));var config=require('../../config/environment');var jayson=require(_0x0e92('0xa'));var client=jayson['client'][_0x0e92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33a315,_0x2d921f,_0x176c3b){return new BPromise(function(_0x5662dc,_0x3dbc96){return client[_0x0e92('0xc')](_0x33a315,_0x176c3b)[_0x0e92('0xd')](function(_0x129376){logger[_0x0e92('0xe')]('Migration,\x20%s,\x20%s',_0x2d921f,'request\x20sent');logger['debug'](_0x0e92('0xf'),_0x2d921f,_0x0e92('0x10'),JSON['stringify'](_0x129376));if(_0x129376['error']){if(_0x129376['error'][_0x0e92('0x11')]===0x1f4){logger[_0x0e92('0x12')]('Migration,\x20%s,\x20%s',_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x3dbc96(_0x129376['error'][_0x0e92('0x13')]);}logger[_0x0e92('0x12')](_0x0e92('0x14'),_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x5662dc(_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x2d921f,_0x0e92('0x10'));_0x5662dc(_0x129376[_0x0e92('0x15')]['message']);}})['catch'](function(_0x424c3a){logger['error'](_0x0e92('0x14'),_0x2d921f,_0x424c3a);_0x3dbc96(_0x424c3a);});});} \ No newline at end of file +var _0x833b=['request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x52a8fc,_0x2768b5){var _0x5c7670=function(_0x22bf01){while(--_0x22bf01){_0x52a8fc['push'](_0x52a8fc['shift']());}};_0x5c7670(++_0x2768b5);}(_0x833b,0x131));var _0xb833=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x833b[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0xb833('0x0'));var moment=require('moment');var BPromise=require(_0xb833('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb833('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb833('0x3'));var logger=require(_0xb833('0x4'))(_0xb833('0x5'));var config=require(_0xb833('0x6'));var jayson=require(_0xb833('0x7'));var client=jayson[_0xb833('0x8')][_0xb833('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eaff4,_0x3afa71,_0xb60891){return new BPromise(function(_0x3922f5,_0x2525aa){return client[_0xb833('0xa')](_0x4eaff4,_0xb60891)[_0xb833('0xb')](function(_0x26cbf6){logger['info'](_0xb833('0xc'),_0x3afa71,'request\x20sent');logger[_0xb833('0xd')](_0xb833('0xe'),_0x3afa71,_0xb833('0xf'),JSON[_0xb833('0x10')](_0x26cbf6));if(_0x26cbf6['error']){if(_0x26cbf6['error'][_0xb833('0x11')]===0x1f4){logger[_0xb833('0x12')]('Migration,\x20%s,\x20%s',_0x3afa71,_0x26cbf6[_0xb833('0x12')]['message']);return _0x2525aa(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);return _0x3922f5(_0x26cbf6[_0xb833('0x12')][_0xb833('0x13')]);}else{logger['info'](_0xb833('0xc'),_0x3afa71,_0xb833('0xf'));_0x3922f5(_0x26cbf6['result']['message']);}})[_0xb833('0x14')](function(_0x59d65f){logger[_0xb833('0x12')](_0xb833('0xc'),_0x3afa71,_0x59d65f);_0x2525aa(_0x59d65f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index bf6b93d..d7be7bc 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 _0x79a3=['isAuthenticated','index','show','post','create','put','/:id','exports','multer','path','connect-timeout','Router','../../config/environment','./network.controller','get'];(function(_0x3044f1,_0x33e1b0){var _0x13d62b=function(_0xd40215){while(--_0xd40215){_0x3044f1['push'](_0x3044f1['shift']());}};_0x13d62b(++_0x33e1b0);}(_0x79a3,0x80));var _0x379a=function(_0x5159de,_0x24b2f4){_0x5159de=_0x5159de-0x0;var _0x308204=_0x79a3[_0x5159de];return _0x308204;};'use strict';var multer=require(_0x379a('0x0'));var util=require('util');var path=require(_0x379a('0x1'));var timeout=require(_0x379a('0x2'));var express=require('express');var router=express[_0x379a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x379a('0x4'));var controller=require(_0x379a('0x5'));router[_0x379a('0x6')]('/',auth[_0x379a('0x7')](),controller[_0x379a('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x379a('0x9')]);router[_0x379a('0xa')]('/',auth[_0x379a('0x7')](),controller[_0x379a('0xb')]);router[_0x379a('0xc')](_0x379a('0xd'),auth[_0x379a('0x7')](),controller['update']);router['delete'](_0x379a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x379a('0xe')]=router; \ No newline at end of file +var _0x1f2d=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x3a5cd2,_0x4a8dfd){var _0x39303e=function(_0x3eb64a){while(--_0x3eb64a){_0x3a5cd2['push'](_0x3a5cd2['shift']());}};_0x39303e(++_0x4a8dfd);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x1f2d[_0x31cb5f];return _0x586042;};'use strict';var multer=require(_0xd1f2('0x0'));var util=require(_0xd1f2('0x1'));var path=require(_0xd1f2('0x2'));var timeout=require(_0xd1f2('0x3'));var express=require('express');var router=express[_0xd1f2('0x4')]();var fs_extra=require(_0xd1f2('0x5'));var auth=require(_0xd1f2('0x6'));var interaction=require(_0xd1f2('0x7'));var config=require(_0xd1f2('0x8'));var controller=require(_0xd1f2('0x9'));router[_0xd1f2('0xa')]('/',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0xc')]);router[_0xd1f2('0xa')](_0xd1f2('0xd'),auth[_0xd1f2('0xb')](),controller[_0xd1f2('0xe')]);router[_0xd1f2('0xf')]('/',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0x10')]);router[_0xd1f2('0x11')]('/:id',auth[_0xd1f2('0xb')](),controller[_0xd1f2('0x12')]);router[_0xd1f2('0x13')](_0xd1f2('0xd'),auth['isAuthenticated'](),controller[_0xd1f2('0x14')]);module[_0xd1f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index a75f8be..974c4a7 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 _0xc9c1=['ENUM','localnet','externip','stun','turn','STRING','sequelize','exports'];(function(_0x29b378,_0xbe7d44){var _0x282d06=function(_0x2fc80d){while(--_0x2fc80d){_0x29b378['push'](_0x29b378['shift']());}};_0x282d06(++_0xbe7d44);}(_0xc9c1,0xce));var _0x1c9c=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xc9c1[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x1c9c('0x0'));module[_0x1c9c('0x1')]={'type':{'type':Sequelize[_0x1c9c('0x2')](_0x1c9c('0x3'),_0x1c9c('0x4'),_0x1c9c('0x5'),_0x1c9c('0x6'))},'value':{'type':Sequelize[_0x1c9c('0x7')]},'username':{'type':Sequelize[_0x1c9c('0x7')]},'password':{'type':Sequelize[_0x1c9c('0x7')]}}; \ No newline at end of file +var _0xe6da=['ENUM','localnet','externip','stun','turn','STRING','sequelize','exports'];(function(_0x1bd24f,_0x35d491){var _0x174cac=function(_0x2a7d95){while(--_0x2a7d95){_0x1bd24f['push'](_0x1bd24f['shift']());}};_0x174cac(++_0x35d491);}(_0xe6da,0x86));var _0xae6d=function(_0x47a1ad,_0xf8a478){_0x47a1ad=_0x47a1ad-0x0;var _0x4dfe6e=_0xe6da[_0x47a1ad];return _0x4dfe6e;};'use strict';var Sequelize=require(_0xae6d('0x0'));module[_0xae6d('0x1')]={'type':{'type':Sequelize[_0xae6d('0x2')](_0xae6d('0x3'),_0xae6d('0x4'),_0xae6d('0x5'),_0xae6d('0x6'))},'value':{'type':Sequelize[_0xae6d('0x7')]},'username':{'type':Sequelize[_0xae6d('0x7')]},'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 622ad34..124ec3e 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 _0xf5e8=['root','server/files/templates/stun_multiple.ejs','utf8','Reload','TURN','join','server/files/templates/turn_multiple.ejs','render','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','/etc/asterisk/stun_xcally.conf','chan_sip.so','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','count','limit','set','Content-Range','json','destroy','stack','name','send','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','include','findAll','rows','show','params','includeAll','options','find','create','body','toUpperCase','STUN','readFileSync'];(function(_0x13e106,_0x136633){var _0x16602e=function(_0x4491d9){while(--_0x4491d9){_0x13e106['push'](_0x13e106['shift']());}};_0x16602e(++_0x136633);}(_0xf5e8,0xbd));var _0x8f5e=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xf5e8[_0x62c958];return _0x57ec61;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x8f5e('0x0'));var fs=require('fs');var _=require(_0x8f5e('0x1'));var qs=require(_0x8f5e('0x2'));var logger=require('../../config/logger')(_0x8f5e('0x3'));var config=require(_0x8f5e('0x4'));var db=require(_0x8f5e('0x5'))['db'];var jayson=require(_0x8f5e('0x6'));var client=jayson[_0x8f5e('0x7')][_0x8f5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23db78,_0x3aeca6,_0x4551e4,_0x6be79b){return new Promise(function(_0x16673c,_0x26bef5){var _0x11ab7e=_0x6be79b||client;return _0x11ab7e[_0x8f5e('0x9')](_0x23db78,_0x4551e4)[_0x8f5e('0xa')](function(_0x2ee687){logger[_0x8f5e('0xb')](_0x8f5e('0xc'),_0x3aeca6,_0x8f5e('0xd'));logger[_0x8f5e('0xe')](_0x8f5e('0xf'),_0x3aeca6,_0x8f5e('0xd'),JSON[_0x8f5e('0x10')](_0x2ee687));if(_0x2ee687[_0x8f5e('0x11')]){if(_0x2ee687[_0x8f5e('0x11')][_0x8f5e('0x12')]===0x1f4){logger[_0x8f5e('0x11')](_0x8f5e('0xc'),_0x3aeca6,_0x2ee687['error']['message']);return _0x26bef5(_0x2ee687[_0x8f5e('0x11')][_0x8f5e('0x13')]);}logger[_0x8f5e('0x11')](_0x8f5e('0xc'),_0x3aeca6,_0x2ee687[_0x8f5e('0x11')][_0x8f5e('0x13')]);return _0x16673c(_0x2ee687[_0x8f5e('0x11')][_0x8f5e('0x13')]);}else{logger[_0x8f5e('0xb')]('Network,\x20%s,\x20%s',_0x3aeca6,_0x8f5e('0xd'));_0x16673c(_0x2ee687[_0x8f5e('0x14')][_0x8f5e('0x13')]);}})[_0x8f5e('0x15')](function(_0x5e2751){logger[_0x8f5e('0x11')](_0x8f5e('0xc'),_0x3aeca6,_0x5e2751);_0x26bef5(_0x5e2751);});});}function respondWithResult(_0x2afece,_0x5227f3){_0x5227f3=_0x5227f3||0xc8;return function(_0x32d3e2){if(_0x32d3e2){return _0x2afece[_0x8f5e('0x16')](_0x5227f3)['json'](_0x32d3e2);}};}function respondWithFilteredResult(_0x4643a4,_0x3a59fd){return function(_0xb9f818){if(_0xb9f818){var _0x4768c0=typeof _0x3a59fd[_0x8f5e('0x17')]===_0x8f5e('0x18')&&typeof _0x3a59fd['limit']===_0x8f5e('0x18');var _0x576e68=_0xb9f818[_0x8f5e('0x19')];var _0x3771dc=_0x4768c0?0x0:_0x3a59fd[_0x8f5e('0x17')];var _0x32cf0a=_0x4768c0?_0xb9f818['count']:_0x3a59fd[_0x8f5e('0x17')]+_0x3a59fd[_0x8f5e('0x1a')];var _0x5b9d41;if(_0x32cf0a>=_0x576e68){_0x32cf0a=_0x576e68;_0x5b9d41=0xc8;}else{_0x5b9d41=0xce;}_0x4643a4[_0x8f5e('0x16')](_0x5b9d41);return _0x4643a4[_0x8f5e('0x1b')](_0x8f5e('0x1c'),_0x3771dc+'-'+_0x32cf0a+'/'+_0x576e68)[_0x8f5e('0x1d')](_0xb9f818);}return null;};}function saveUpdates(_0x4b9c73){return function(_0x9ae937){if(_0x9ae937){return _0x9ae937['update'](_0x4b9c73)[_0x8f5e('0xa')](function(_0x2eadd6){return _0x2eadd6;});}return null;};}function removeEntity(_0x56a6fd){return function(_0xf07165){if(_0xf07165){return _0xf07165[_0x8f5e('0x1e')]()[_0x8f5e('0xa')](function(){_0x56a6fd[_0x8f5e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40fdbe){return function(_0x2188c4){if(!_0x2188c4){_0x40fdbe['sendStatus'](0x194);}return _0x2188c4;};}function handleError(_0x44b971,_0x1e5e5e){_0x1e5e5e=_0x1e5e5e||0x1f4;return function(_0x5eec1c){logger[_0x8f5e('0x11')](_0x5eec1c[_0x8f5e('0x1f')]);if(_0x5eec1c[_0x8f5e('0x20')]){delete _0x5eec1c['name'];}_0x44b971[_0x8f5e('0x16')](_0x1e5e5e)[_0x8f5e('0x21')](_0x5eec1c);};}exports['index']=function(_0x4caba3,_0x3ccf75){var _0x28f477={},_0x176441={},_0x16ce29={'count':0x0,'rows':[]};var _0x4ac4fc=_[_0x8f5e('0x22')](db[_0x8f5e('0x23')][_0x8f5e('0x24')],function(_0xe57537){return{'name':_0xe57537[_0x8f5e('0x25')],'type':_0xe57537[_0x8f5e('0x26')][_0x8f5e('0x27')]};});_0x176441[_0x8f5e('0x28')]=_['map'](_0x4ac4fc,_0x8f5e('0x20'));_0x176441[_0x8f5e('0x29')]=_[_0x8f5e('0x2a')](_0x4caba3[_0x8f5e('0x29')]);_0x176441[_0x8f5e('0x2b')]=_[_0x8f5e('0x2c')](_0x176441[_0x8f5e('0x28')],_0x176441[_0x8f5e('0x29')]);_0x28f477[_0x8f5e('0x2d')]=_[_0x8f5e('0x2c')](_0x176441[_0x8f5e('0x28')],qs[_0x8f5e('0x2e')](_0x4caba3[_0x8f5e('0x29')][_0x8f5e('0x2e')]));_0x28f477[_0x8f5e('0x2d')]=_0x28f477[_0x8f5e('0x2d')][_0x8f5e('0x2f')]?_0x28f477[_0x8f5e('0x2d')]:_0x176441[_0x8f5e('0x28')];if(!_0x4caba3[_0x8f5e('0x29')][_0x8f5e('0x30')](_0x8f5e('0x31'))){_0x28f477[_0x8f5e('0x1a')]=qs[_0x8f5e('0x1a')](_0x4caba3['query'][_0x8f5e('0x1a')]);_0x28f477[_0x8f5e('0x17')]=qs[_0x8f5e('0x17')](_0x4caba3[_0x8f5e('0x29')][_0x8f5e('0x17')]);}_0x28f477[_0x8f5e('0x32')]=qs[_0x8f5e('0x33')](_0x4caba3[_0x8f5e('0x29')][_0x8f5e('0x33')]);_0x28f477[_0x8f5e('0x34')]=qs[_0x8f5e('0x2b')](_[_0x8f5e('0x35')](_0x4caba3[_0x8f5e('0x29')],_0x176441[_0x8f5e('0x2b')]),_0x4ac4fc);if(_0x4caba3[_0x8f5e('0x29')]['filter']){_0x28f477['where']=_[_0x8f5e('0x36')](_0x28f477[_0x8f5e('0x34')],{'$or':_['map'](_0x4ac4fc,function(_0x56f374){if(_0x56f374[_0x8f5e('0x26')]!=='VIRTUAL'){var _0xa88ebb={};_0xa88ebb[_0x56f374['name']]={'$like':'%'+_0x4caba3[_0x8f5e('0x29')][_0x8f5e('0x37')]+'%'};return _0xa88ebb;}})});}_0x28f477=_[_0x8f5e('0x36')]({},_0x28f477,_0x4caba3['options']);var _0x35c429={'where':_0x28f477[_0x8f5e('0x34')]};return db[_0x8f5e('0x23')][_0x8f5e('0x19')](_0x35c429)['then'](function(_0x465bff){_0x16ce29[_0x8f5e('0x19')]=_0x465bff;if(_0x4caba3[_0x8f5e('0x29')]['includeAll']){_0x28f477[_0x8f5e('0x38')]=[{'all':!![]}];}return db[_0x8f5e('0x23')][_0x8f5e('0x39')](_0x28f477);})['then'](function(_0x2c4f8b){_0x16ce29[_0x8f5e('0x3a')]=_0x2c4f8b;return _0x16ce29;})[_0x8f5e('0xa')](respondWithFilteredResult(_0x3ccf75,_0x28f477))['catch'](handleError(_0x3ccf75,null));};exports[_0x8f5e('0x3b')]=function(_0x2fdbe6,_0x38e5e6){var _0x16ead8={'raw':!![],'where':{'id':_0x2fdbe6[_0x8f5e('0x3c')]['id']}},_0x15f4ca={};_0x15f4ca['model']=_[_0x8f5e('0x2a')](db['Network'][_0x8f5e('0x24')]);_0x15f4ca[_0x8f5e('0x29')]=_[_0x8f5e('0x2a')](_0x2fdbe6[_0x8f5e('0x29')]);_0x15f4ca[_0x8f5e('0x2b')]=_[_0x8f5e('0x2c')](_0x15f4ca['model'],_0x15f4ca[_0x8f5e('0x29')]);_0x16ead8['attributes']=_[_0x8f5e('0x2c')](_0x15f4ca[_0x8f5e('0x28')],qs['fields'](_0x2fdbe6[_0x8f5e('0x29')][_0x8f5e('0x2e')]));_0x16ead8[_0x8f5e('0x2d')]=_0x16ead8[_0x8f5e('0x2d')][_0x8f5e('0x2f')]?_0x16ead8['attributes']:_0x15f4ca[_0x8f5e('0x28')];if(_0x2fdbe6[_0x8f5e('0x29')][_0x8f5e('0x3d')]){_0x16ead8[_0x8f5e('0x38')]=[{'all':!![]}];}_0x16ead8=_[_0x8f5e('0x36')]({},_0x16ead8,_0x2fdbe6[_0x8f5e('0x3e')]);return db['Network'][_0x8f5e('0x3f')](_0x16ead8)[_0x8f5e('0xa')](handleEntityNotFound(_0x38e5e6,null))[_0x8f5e('0xa')](respondWithResult(_0x38e5e6,null))[_0x8f5e('0x15')](handleError(_0x38e5e6,null));};exports[_0x8f5e('0x40')]=function(_0x53d91a,_0x2f1cec){var _0x41f6a9;return db[_0x8f5e('0x23')][_0x8f5e('0x40')](_0x53d91a[_0x8f5e('0x41')],{'raw':!![]})[_0x8f5e('0xa')](function(_0x54a4a8){_0x41f6a9=_0x54a4a8;return db[_0x8f5e('0x23')][_0x8f5e('0x39')]({'where':{'type':_0x53d91a['body'][_0x8f5e('0x26')]},'raw':!![]});})[_0x8f5e('0xa')](function(_0x40cb25){if(_0x41f6a9[_0x8f5e('0x26')][_0x8f5e('0x42')]()==_0x8f5e('0x43')){var _0x4b9233=fs[_0x8f5e('0x44')](path['join'](config[_0x8f5e('0x45')],_0x8f5e('0x46')),_0x8f5e('0x47'));var _0x4bbb3e=ejs['render'](_0x4b9233,{'networks':_0x40cb25||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4bbb3e);return respondWithRpcPromise(_0x8f5e('0x48'),_0x8f5e('0x40'),{'module':'res_stun_monitor.so'});}else if(_0x41f6a9[_0x8f5e('0x26')][_0x8f5e('0x42')]()==_0x8f5e('0x49')){var _0x2b5114=fs[_0x8f5e('0x44')](path[_0x8f5e('0x4a')](config[_0x8f5e('0x45')],_0x8f5e('0x4b')),_0x8f5e('0x47'));var _0x29d1b5=ejs[_0x8f5e('0x4c')](_0x2b5114,{'networks':_0x40cb25||[]});fs[_0x8f5e('0x4d')](_0x8f5e('0x4e'),_0x29d1b5);return respondWithRpcPromise(_0x8f5e('0x48'),'create',{'module':_0x8f5e('0x4f')});}else{var _0x1bf387=fs[_0x8f5e('0x44')](path[_0x8f5e('0x4a')](config['root'],'server/files/templates/network.ejs'),_0x8f5e('0x47'));var _0x96b180=ejs[_0x8f5e('0x4c')](_0x1bf387,{'networks':_0x40cb25||[]});fs[_0x8f5e('0x4d')](util[_0x8f5e('0x50')](_0x8f5e('0x51'),_0x53d91a[_0x8f5e('0x41')][_0x8f5e('0x26')][_0x8f5e('0x52')]()),_0x96b180);return respondWithRpcPromise(_0x8f5e('0x48'),_0x8f5e('0x40'),{'module':'chan_sip.so'});}})[_0x8f5e('0xa')](function(){return _0x41f6a9;})['then'](respondWithResult(_0x2f1cec,0xc9))['catch'](handleError(_0x2f1cec,null));};exports[_0x8f5e('0x53')]=function(_0x4d40dc,_0x368265){var _0x3de6d2;return db[_0x8f5e('0x23')][_0x8f5e('0x3f')]({'where':{'id':_0x4d40dc['params']['id']}})[_0x8f5e('0xa')](handleEntityNotFound(_0x368265,null))['then'](saveUpdates(_0x4d40dc[_0x8f5e('0x41')],null))[_0x8f5e('0xa')](function(_0x4053cc){if(_0x4053cc){_0x3de6d2=_0x4053cc;return db[_0x8f5e('0x23')]['findAll']({'where':{'type':_0x3de6d2[_0x8f5e('0x26')]},'raw':!![]});}return null;})[_0x8f5e('0xa')](function(_0x1d4edb){if(_0x3de6d2[_0x8f5e('0x26')]['toUpperCase']()==_0x8f5e('0x43')){var _0x1b2571=fs[_0x8f5e('0x44')](path['join'](config[_0x8f5e('0x45')],_0x8f5e('0x46')),'utf8');var _0x2a6c12=ejs[_0x8f5e('0x4c')](_0x1b2571,{'networks':_0x1d4edb||[]});fs['writeFileSync'](_0x8f5e('0x54'),_0x2a6c12);return respondWithRpcPromise(_0x8f5e('0x48'),_0x8f5e('0x53'),{'module':_0x8f5e('0x4f')});}else if(_0x3de6d2[_0x8f5e('0x26')][_0x8f5e('0x42')]()==_0x8f5e('0x49')){var _0x3dbd8d=fs[_0x8f5e('0x44')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x8f5e('0x47'));var _0x15ef5a=ejs['render'](_0x3dbd8d,{'networks':_0x1d4edb||[]});fs['writeFileSync'](_0x8f5e('0x4e'),_0x15ef5a);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else{var _0x21b047=fs[_0x8f5e('0x44')](path['join'](config[_0x8f5e('0x45')],'server/files/templates/network.ejs'),_0x8f5e('0x47'));var _0x55f2ad=ejs[_0x8f5e('0x4c')](_0x21b047,{'networks':_0x1d4edb||[]});fs[_0x8f5e('0x4d')](util['format'](_0x8f5e('0x51'),_0x4d40dc[_0x8f5e('0x41')][_0x8f5e('0x26')]['toLowerCase']()),_0x55f2ad);return respondWithRpcPromise('Reload',_0x8f5e('0x53'),{'module':_0x8f5e('0x55')});}})[_0x8f5e('0xa')](function(_0x423e38){if(_0x423e38){return _0x3de6d2;}return null;})[_0x8f5e('0xa')](respondWithResult(_0x368265,null))[_0x8f5e('0x15')](handleError(_0x368265,null));};exports[_0x8f5e('0x1e')]=function(_0x39067e,_0x30b6b4){var _0x1d08f8;return db['Network'][_0x8f5e('0x3f')]({'where':{'id':_0x39067e[_0x8f5e('0x3c')]['id']}})['then'](function(_0x3af7df){_0x1d08f8=_0x3af7df;return _0x3af7df;})[_0x8f5e('0xa')](handleEntityNotFound(_0x30b6b4,null))[_0x8f5e('0xa')](removeEntity(_0x30b6b4,null))['then'](function(){if(_0x1d08f8){return db[_0x8f5e('0x23')][_0x8f5e('0x39')]({'where':{'type':_0x1d08f8[_0x8f5e('0x26')]},'raw':!![]});}})[_0x8f5e('0xa')](function(_0x2a8e0f){if(_0x1d08f8[_0x8f5e('0x26')][_0x8f5e('0x42')]()=='STUN'){var _0xa543b2=fs[_0x8f5e('0x44')](path['join'](config[_0x8f5e('0x45')],_0x8f5e('0x46')),_0x8f5e('0x47'));var _0x5003b7=ejs[_0x8f5e('0x4c')](_0xa543b2,{'networks':_0x2a8e0f||[]});fs[_0x8f5e('0x4d')](_0x8f5e('0x54'),_0x5003b7);return respondWithRpcPromise(_0x8f5e('0x48'),_0x8f5e('0x1e'),{'module':'res_stun_monitor.so'});}else if(_0x1d08f8[_0x8f5e('0x26')][_0x8f5e('0x42')]()=='TURN'){var _0x21bacf=fs[_0x8f5e('0x44')](path[_0x8f5e('0x4a')](config[_0x8f5e('0x45')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x44f3d4=ejs['render'](_0x21bacf,{'networks':_0x2a8e0f||[]});fs['writeFileSync'](_0x8f5e('0x4e'),_0x44f3d4);return respondWithRpcPromise(_0x8f5e('0x48'),_0x8f5e('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x35c9dc=fs['readFileSync'](path[_0x8f5e('0x4a')](config[_0x8f5e('0x45')],'server/files/templates/network.ejs'),_0x8f5e('0x47'));var _0x48eed2=ejs[_0x8f5e('0x4c')](_0x35c9dc,{'networks':_0x2a8e0f||[]});fs[_0x8f5e('0x4d')](util[_0x8f5e('0x50')](_0x8f5e('0x51'),_0x1d08f8[_0x8f5e('0x26')][_0x8f5e('0x52')]()),_0x48eed2);return respondWithRpcPromise(_0x8f5e('0x48'),'destroy',{'module':_0x8f5e('0x55')});}})[_0x8f5e('0x15')](handleError(_0x30b6b4,null));}; \ No newline at end of file +var _0x5ee5=['count','set','Content-Range','update','end','name','send','index','Network','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','create','body','toUpperCase','STUN','readFileSync','join','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','root','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','server/files/templates/stun_multiple.ejs','/etc/asterisk/turn_xcally.conf','toLowerCase','find','server/files/templates/turn_multiple.ejs','destroy','util','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','limit','undefined'];(function(_0x50978c,_0xb7fdf8){var _0x5b012d=function(_0x5c8b15){while(--_0x5c8b15){_0x50978c['push'](_0x50978c['shift']());}};_0x5b012d(++_0xb7fdf8);}(_0x5ee5,0x1ea));var _0x55ee=function(_0x3f70cd,_0x6bf4ed){_0x3f70cd=_0x3f70cd-0x0;var _0x3feb93=_0x5ee5[_0x3f70cd];return _0x3feb93;};'use strict';var util=require(_0x55ee('0x0'));var path=require('path');var ejs=require(_0x55ee('0x1'));var fs=require('fs');var _=require(_0x55ee('0x2'));var qs=require(_0x55ee('0x3'));var logger=require(_0x55ee('0x4'))(_0x55ee('0x5'));var config=require(_0x55ee('0x6'));var db=require(_0x55ee('0x7'))['db'];var jayson=require(_0x55ee('0x8'));var client=jayson['client'][_0x55ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55adc6,_0x3b9e3f,_0x311a27,_0x2821f4){return new Promise(function(_0x11a172,_0x59ee44){var _0x501a5=_0x2821f4||client;return _0x501a5['request'](_0x55adc6,_0x311a27)[_0x55ee('0xa')](function(_0x26120e){logger[_0x55ee('0xb')](_0x55ee('0xc'),_0x3b9e3f,_0x55ee('0xd'));logger[_0x55ee('0xe')](_0x55ee('0xf'),_0x3b9e3f,'request\x20sent',JSON[_0x55ee('0x10')](_0x26120e));if(_0x26120e[_0x55ee('0x11')]){if(_0x26120e[_0x55ee('0x11')][_0x55ee('0x12')]===0x1f4){logger[_0x55ee('0x11')](_0x55ee('0xc'),_0x3b9e3f,_0x26120e[_0x55ee('0x11')][_0x55ee('0x13')]);return _0x59ee44(_0x26120e[_0x55ee('0x11')]['message']);}logger[_0x55ee('0x11')]('Network,\x20%s,\x20%s',_0x3b9e3f,_0x26120e[_0x55ee('0x11')][_0x55ee('0x13')]);return _0x11a172(_0x26120e[_0x55ee('0x11')][_0x55ee('0x13')]);}else{logger['info'](_0x55ee('0xc'),_0x3b9e3f,_0x55ee('0xd'));_0x11a172(_0x26120e['result'][_0x55ee('0x13')]);}})[_0x55ee('0x14')](function(_0x3dd0bf){logger['error']('Network,\x20%s,\x20%s',_0x3b9e3f,_0x3dd0bf);_0x59ee44(_0x3dd0bf);});});}function respondWithResult(_0x384605,_0x34dd31){_0x34dd31=_0x34dd31||0xc8;return function(_0x467eb4){if(_0x467eb4){return _0x384605[_0x55ee('0x15')](_0x34dd31)[_0x55ee('0x16')](_0x467eb4);}};}function respondWithFilteredResult(_0xb613e5,_0x13c379){return function(_0x608397){if(_0x608397){var _0x287760=typeof _0x13c379[_0x55ee('0x17')]==='undefined'&&typeof _0x13c379[_0x55ee('0x18')]===_0x55ee('0x19');var _0x2fc560=_0x608397[_0x55ee('0x1a')];var _0x14c4d6=_0x287760?0x0:_0x13c379['offset'];var _0x5d58ea=_0x287760?_0x608397[_0x55ee('0x1a')]:_0x13c379[_0x55ee('0x17')]+_0x13c379[_0x55ee('0x18')];var _0xa3d05b;if(_0x5d58ea>=_0x2fc560){_0x5d58ea=_0x2fc560;_0xa3d05b=0xc8;}else{_0xa3d05b=0xce;}_0xb613e5[_0x55ee('0x15')](_0xa3d05b);return _0xb613e5[_0x55ee('0x1b')](_0x55ee('0x1c'),_0x14c4d6+'-'+_0x5d58ea+'/'+_0x2fc560)[_0x55ee('0x16')](_0x608397);}return null;};}function saveUpdates(_0xd55ac6){return function(_0x63330a){if(_0x63330a){return _0x63330a[_0x55ee('0x1d')](_0xd55ac6)['then'](function(_0x5d3883){return _0x5d3883;});}return null;};}function removeEntity(_0x297d68){return function(_0x4deea0){if(_0x4deea0){return _0x4deea0['destroy']()[_0x55ee('0xa')](function(){_0x297d68[_0x55ee('0x15')](0xcc)[_0x55ee('0x1e')]();});}};}function handleEntityNotFound(_0xddf316){return function(_0x265509){if(!_0x265509){_0xddf316['sendStatus'](0x194);}return _0x265509;};}function handleError(_0x54f3de,_0x31800e){_0x31800e=_0x31800e||0x1f4;return function(_0x12e921){logger['error'](_0x12e921['stack']);if(_0x12e921[_0x55ee('0x1f')]){delete _0x12e921[_0x55ee('0x1f')];}_0x54f3de[_0x55ee('0x15')](_0x31800e)[_0x55ee('0x20')](_0x12e921);};}exports[_0x55ee('0x21')]=function(_0x2b6447,_0x466084){var _0x53d605={},_0x3db036={},_0x3bc4d0={'count':0x0,'rows':[]};var _0x136ce9=_['map'](db[_0x55ee('0x22')][_0x55ee('0x23')],function(_0x44c34a){return{'name':_0x44c34a[_0x55ee('0x24')],'type':_0x44c34a[_0x55ee('0x25')]['key']};});_0x3db036['model']=_['map'](_0x136ce9,_0x55ee('0x1f'));_0x3db036['query']=_['keys'](_0x2b6447[_0x55ee('0x26')]);_0x3db036[_0x55ee('0x27')]=_[_0x55ee('0x28')](_0x3db036[_0x55ee('0x29')],_0x3db036[_0x55ee('0x26')]);_0x53d605[_0x55ee('0x2a')]=_['intersection'](_0x3db036['model'],qs['fields'](_0x2b6447['query'][_0x55ee('0x2b')]));_0x53d605[_0x55ee('0x2a')]=_0x53d605['attributes'][_0x55ee('0x2c')]?_0x53d605['attributes']:_0x3db036[_0x55ee('0x29')];if(!_0x2b6447[_0x55ee('0x26')][_0x55ee('0x2d')](_0x55ee('0x2e'))){_0x53d605[_0x55ee('0x18')]=qs[_0x55ee('0x18')](_0x2b6447['query']['limit']);_0x53d605[_0x55ee('0x17')]=qs[_0x55ee('0x17')](_0x2b6447[_0x55ee('0x26')][_0x55ee('0x17')]);}_0x53d605[_0x55ee('0x2f')]=qs['sort'](_0x2b6447['query'][_0x55ee('0x30')]);_0x53d605['where']=qs['filters'](_[_0x55ee('0x31')](_0x2b6447[_0x55ee('0x26')],_0x3db036['filters']),_0x136ce9);if(_0x2b6447[_0x55ee('0x26')][_0x55ee('0x32')]){_0x53d605[_0x55ee('0x33')]=_[_0x55ee('0x34')](_0x53d605[_0x55ee('0x33')],{'$or':_['map'](_0x136ce9,function(_0x58c20e){if(_0x58c20e['type']!==_0x55ee('0x35')){var _0x452f98={};_0x452f98[_0x58c20e[_0x55ee('0x1f')]]={'$like':'%'+_0x2b6447[_0x55ee('0x26')][_0x55ee('0x32')]+'%'};return _0x452f98;}})});}_0x53d605=_[_0x55ee('0x34')]({},_0x53d605,_0x2b6447[_0x55ee('0x36')]);var _0x78412b={'where':_0x53d605[_0x55ee('0x33')]};return db['Network']['count'](_0x78412b)[_0x55ee('0xa')](function(_0x343047){_0x3bc4d0[_0x55ee('0x1a')]=_0x343047;if(_0x2b6447[_0x55ee('0x26')][_0x55ee('0x37')]){_0x53d605[_0x55ee('0x38')]=[{'all':!![]}];}return db[_0x55ee('0x22')][_0x55ee('0x39')](_0x53d605);})[_0x55ee('0xa')](function(_0x48d45d){_0x3bc4d0[_0x55ee('0x3a')]=_0x48d45d;return _0x3bc4d0;})[_0x55ee('0xa')](respondWithFilteredResult(_0x466084,_0x53d605))[_0x55ee('0x14')](handleError(_0x466084,null));};exports[_0x55ee('0x3b')]=function(_0x55a906,_0x5bc27d){var _0x398da9={'raw':!![],'where':{'id':_0x55a906[_0x55ee('0x3c')]['id']}},_0x113db2={};_0x113db2[_0x55ee('0x29')]=_[_0x55ee('0x3d')](db[_0x55ee('0x22')][_0x55ee('0x23')]);_0x113db2[_0x55ee('0x26')]=_[_0x55ee('0x3d')](_0x55a906['query']);_0x113db2[_0x55ee('0x27')]=_['intersection'](_0x113db2[_0x55ee('0x29')],_0x113db2[_0x55ee('0x26')]);_0x398da9[_0x55ee('0x2a')]=_[_0x55ee('0x28')](_0x113db2[_0x55ee('0x29')],qs[_0x55ee('0x2b')](_0x55a906[_0x55ee('0x26')][_0x55ee('0x2b')]));_0x398da9[_0x55ee('0x2a')]=_0x398da9[_0x55ee('0x2a')][_0x55ee('0x2c')]?_0x398da9[_0x55ee('0x2a')]:_0x113db2[_0x55ee('0x29')];if(_0x55a906['query'][_0x55ee('0x37')]){_0x398da9[_0x55ee('0x38')]=[{'all':!![]}];}_0x398da9=_[_0x55ee('0x34')]({},_0x398da9,_0x55a906[_0x55ee('0x36')]);return db['Network']['find'](_0x398da9)[_0x55ee('0xa')](handleEntityNotFound(_0x5bc27d,null))['then'](respondWithResult(_0x5bc27d,null))['catch'](handleError(_0x5bc27d,null));};exports[_0x55ee('0x3e')]=function(_0x396bef,_0xe23a68){var _0x512426;return db[_0x55ee('0x22')]['create'](_0x396bef['body'],{'raw':!![]})[_0x55ee('0xa')](function(_0x505782){_0x512426=_0x505782;return db[_0x55ee('0x22')][_0x55ee('0x39')]({'where':{'type':_0x396bef[_0x55ee('0x3f')][_0x55ee('0x25')]},'raw':!![]});})['then'](function(_0x19d7c4){if(_0x512426['type'][_0x55ee('0x40')]()==_0x55ee('0x41')){var _0x4de84f=fs[_0x55ee('0x42')](path[_0x55ee('0x43')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x55ee('0x44'));var _0xb6057d=ejs[_0x55ee('0x45')](_0x4de84f,{'networks':_0x19d7c4||[]});fs[_0x55ee('0x46')](_0x55ee('0x47'),_0xb6057d);return respondWithRpcPromise(_0x55ee('0x48'),_0x55ee('0x3e'),{'module':'res_stun_monitor.so'});}else if(_0x512426[_0x55ee('0x25')]['toUpperCase']()==_0x55ee('0x49')){var _0x53ec97=fs[_0x55ee('0x42')](path[_0x55ee('0x43')](config[_0x55ee('0x4a')],'server/files/templates/turn_multiple.ejs'),_0x55ee('0x44'));var _0x1b0819=ejs[_0x55ee('0x45')](_0x53ec97,{'networks':_0x19d7c4||[]});fs[_0x55ee('0x46')]('/etc/asterisk/turn_xcally.conf',_0x1b0819);return respondWithRpcPromise('Reload',_0x55ee('0x3e'),{'module':_0x55ee('0x4b')});}else{var _0x5459f7=fs[_0x55ee('0x42')](path['join'](config[_0x55ee('0x4a')],_0x55ee('0x4c')),_0x55ee('0x44'));var _0x4d91e4=ejs['render'](_0x5459f7,{'networks':_0x19d7c4||[]});fs['writeFileSync'](util[_0x55ee('0x4d')](_0x55ee('0x4e'),_0x396bef[_0x55ee('0x3f')][_0x55ee('0x25')]['toLowerCase']()),_0x4d91e4);return respondWithRpcPromise(_0x55ee('0x48'),_0x55ee('0x3e'),{'module':_0x55ee('0x4f')});}})['then'](function(){return _0x512426;})['then'](respondWithResult(_0xe23a68,0xc9))[_0x55ee('0x14')](handleError(_0xe23a68,null));};exports[_0x55ee('0x1d')]=function(_0xd00b65,_0x11ee58){var _0x4d4077;return db[_0x55ee('0x22')]['find']({'where':{'id':_0xd00b65[_0x55ee('0x3c')]['id']}})['then'](handleEntityNotFound(_0x11ee58,null))[_0x55ee('0xa')](saveUpdates(_0xd00b65[_0x55ee('0x3f')],null))[_0x55ee('0xa')](function(_0x2e7503){if(_0x2e7503){_0x4d4077=_0x2e7503;return db['Network']['findAll']({'where':{'type':_0x4d4077[_0x55ee('0x25')]},'raw':!![]});}return null;})[_0x55ee('0xa')](function(_0x4bf7f7){if(_0x4d4077[_0x55ee('0x25')][_0x55ee('0x40')]()==_0x55ee('0x41')){var _0xe01b49=fs[_0x55ee('0x42')](path[_0x55ee('0x43')](config[_0x55ee('0x4a')],_0x55ee('0x50')),_0x55ee('0x44'));var _0x15c942=ejs[_0x55ee('0x45')](_0xe01b49,{'networks':_0x4bf7f7||[]});fs[_0x55ee('0x46')](_0x55ee('0x47'),_0x15c942);return respondWithRpcPromise(_0x55ee('0x48'),'update',{'module':'res_stun_monitor.so'});}else if(_0x4d4077[_0x55ee('0x25')][_0x55ee('0x40')]()=='TURN'){var _0x159832=fs[_0x55ee('0x42')](path[_0x55ee('0x43')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x55ee('0x44'));var _0x42a0c6=ejs['render'](_0x159832,{'networks':_0x4bf7f7||[]});fs[_0x55ee('0x46')](_0x55ee('0x51'),_0x42a0c6);return respondWithRpcPromise(_0x55ee('0x48'),'update',{'module':_0x55ee('0x4b')});}else{var _0x375d00=fs[_0x55ee('0x42')](path['join'](config['root'],_0x55ee('0x4c')),_0x55ee('0x44'));var _0x29c625=ejs[_0x55ee('0x45')](_0x375d00,{'networks':_0x4bf7f7||[]});fs[_0x55ee('0x46')](util[_0x55ee('0x4d')]('/etc/asterisk/sip_xcally_%s.conf',_0xd00b65[_0x55ee('0x3f')][_0x55ee('0x25')][_0x55ee('0x52')]()),_0x29c625);return respondWithRpcPromise(_0x55ee('0x48'),_0x55ee('0x1d'),{'module':_0x55ee('0x4f')});}})[_0x55ee('0xa')](function(_0x3983bc){if(_0x3983bc){return _0x4d4077;}return null;})['then'](respondWithResult(_0x11ee58,null))[_0x55ee('0x14')](handleError(_0x11ee58,null));};exports['destroy']=function(_0x32b1ca,_0x14e8b9){var _0x5caa33;return db[_0x55ee('0x22')][_0x55ee('0x53')]({'where':{'id':_0x32b1ca[_0x55ee('0x3c')]['id']}})[_0x55ee('0xa')](function(_0x45fd97){_0x5caa33=_0x45fd97;return _0x45fd97;})[_0x55ee('0xa')](handleEntityNotFound(_0x14e8b9,null))['then'](removeEntity(_0x14e8b9,null))[_0x55ee('0xa')](function(){if(_0x5caa33){return db[_0x55ee('0x22')]['findAll']({'where':{'type':_0x5caa33['type']},'raw':!![]});}})[_0x55ee('0xa')](function(_0x208da4){if(_0x5caa33['type'][_0x55ee('0x40')]()==_0x55ee('0x41')){var _0x4070ef=fs[_0x55ee('0x42')](path['join'](config[_0x55ee('0x4a')],'server/files/templates/stun_multiple.ejs'),_0x55ee('0x44'));var _0x293200=ejs[_0x55ee('0x45')](_0x4070ef,{'networks':_0x208da4||[]});fs[_0x55ee('0x46')]('/etc/asterisk/stun_xcally.conf',_0x293200);return respondWithRpcPromise(_0x55ee('0x48'),'destroy',{'module':_0x55ee('0x4b')});}else if(_0x5caa33[_0x55ee('0x25')][_0x55ee('0x40')]()==_0x55ee('0x49')){var _0x4726da=fs[_0x55ee('0x42')](path['join'](config[_0x55ee('0x4a')],_0x55ee('0x54')),'utf8');var _0x359794=ejs[_0x55ee('0x45')](_0x4726da,{'networks':_0x208da4||[]});fs[_0x55ee('0x46')]('/etc/asterisk/turn_xcally.conf',_0x359794);return respondWithRpcPromise('Reload',_0x55ee('0x55'),{'module':_0x55ee('0x4b')});}else{var _0x25f208=fs[_0x55ee('0x42')](path[_0x55ee('0x43')](config[_0x55ee('0x4a')],'server/files/templates/network.ejs'),'utf8');var _0x352c55=ejs[_0x55ee('0x45')](_0x25f208,{'networks':_0x208da4||[]});fs[_0x55ee('0x46')](util[_0x55ee('0x4d')](_0x55ee('0x4e'),_0x5caa33[_0x55ee('0x25')]['toLowerCase']()),_0x352c55);return respondWithRpcPromise(_0x55ee('0x48'),_0x55ee('0x55'),{'module':_0x55ee('0x4f')});}})[_0x55ee('0x14')](handleError(_0x14e8b9,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d573983..beda2d7 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 _0xbdb7=['request-promise','path','rimraf','./network.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x67d2b,_0xc3be07){_0x67d2b=_0x67d2b-0x0;var _0x23e7c1=_0xbdb7[_0x67d2b];return _0x23e7c1;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./network.attributes','Network','network'];(function(_0x1de5b9,_0x2b80c2){var _0x492371=function(_0x5d00af){while(--_0x5d00af){_0x1de5b9['push'](_0x1de5b9['shift']());}};_0x492371(++_0x2b80c2);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x447765,_0x57fcd6){_0x447765=_0x447765-0x0;var _0x3c241e=_0x4fdb[_0x447765];return _0x3c241e;};'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':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index a673b5e..af0284a 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x300cb7,_0xe37653){_0x300cb7=_0x300cb7-0x0;var _0x50224c=_0x7a54[_0x300cb7];return _0x50224c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb614d3,_0x3753a5){var _0x524123=function(_0x5a5971){while(--_0x5a5971){_0xb614d3['push'](_0xb614d3['shift']());}};_0x524123(++_0x3753a5);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 82dca04..42316ee 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 _0x5454=['/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','/describe','describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addAgents'];(function(_0x2414f2,_0x25d54d){var _0x2b64cc=function(_0x3d317a){while(--_0x3d317a){_0x2414f2['push'](_0x2414f2['shift']());}};_0x2b64cc(++_0x25d54d);}(_0x5454,0x149));var _0x4545=function(_0x459284,_0x26952c){_0x459284=_0x459284-0x0;var _0x38c612=_0x5454[_0x459284];return _0x38c612;};'use strict';var multer=require(_0x4545('0x0'));var util=require('util');var path=require(_0x4545('0x1'));var timeout=require(_0x4545('0x2'));var express=require(_0x4545('0x3'));var router=express[_0x4545('0x4')]();var fs_extra=require(_0x4545('0x5'));var auth=require(_0x4545('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4545('0x7'));var controller=require(_0x4545('0x8'));router['get']('/',auth[_0x4545('0x9')](),controller['index']);router['get'](_0x4545('0xa'),auth[_0x4545('0x9')](),controller[_0x4545('0xb')]);router[_0x4545('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4545('0xd')]);router[_0x4545('0xc')](_0x4545('0xe'),auth[_0x4545('0x9')](),controller[_0x4545('0xf')]);router[_0x4545('0xc')](_0x4545('0x10'),auth[_0x4545('0x9')](),controller[_0x4545('0x11')]);router['get']('/:id/applications',auth[_0x4545('0x9')](),controller[_0x4545('0x12')]);router['get'](_0x4545('0x13'),auth[_0x4545('0x9')](),controller[_0x4545('0x14')]);router[_0x4545('0xc')](_0x4545('0x15'),auth['isAuthenticated'](),controller[_0x4545('0x16')]);router[_0x4545('0x17')]('/',auth['isAuthenticated'](),controller[_0x4545('0x18')]);router['post'](_0x4545('0xe'),auth[_0x4545('0x9')](),controller[_0x4545('0x19')]);router[_0x4545('0x17')](_0x4545('0x10'),auth['isAuthenticated'](),controller[_0x4545('0x1a')]);router[_0x4545('0x17')](_0x4545('0x1b'),controller[_0x4545('0x1c')]);router[_0x4545('0x17')](_0x4545('0x1d'),auth['isAuthenticated'](),controller['addApplications']);router[_0x4545('0x17')](_0x4545('0x15'),auth[_0x4545('0x9')](),controller[_0x4545('0x1e')]);router[_0x4545('0x17')](_0x4545('0x1f'),auth[_0x4545('0x9')](),controller[_0x4545('0x20')]);router['put'](_0x4545('0x21'),auth[_0x4545('0x9')](),controller[_0x4545('0x22')]);router[_0x4545('0x23')]('/:id',auth['isAuthenticated'](),controller[_0x4545('0x24')]);router[_0x4545('0x23')](_0x4545('0xe'),auth['isAuthenticated'](),controller[_0x4545('0x25')]);router[_0x4545('0x23')](_0x4545('0x10'),auth[_0x4545('0x9')](),controller[_0x4545('0x26')]);router[_0x4545('0x23')]('/:id/users',auth[_0x4545('0x9')](),controller[_0x4545('0x27')]);module['exports']=router; \ No newline at end of file +var _0x6eea=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router'];(function(_0x13b76a,_0x4ac2aa){var _0x48fd30=function(_0x214bcf){while(--_0x214bcf){_0x13b76a['push'](_0x13b76a['shift']());}};_0x48fd30(++_0x4ac2aa);}(_0x6eea,0xc3));var _0xa6ee=function(_0x5bc4e2,_0x427ff9){_0x5bc4e2=_0x5bc4e2-0x0;var _0x4c93f9=_0x6eea[_0x5bc4e2];return _0x4c93f9;};'use strict';var multer=require(_0xa6ee('0x0'));var util=require(_0xa6ee('0x1'));var path=require('path');var timeout=require(_0xa6ee('0x2'));var express=require(_0xa6ee('0x3'));var router=express[_0xa6ee('0x4')]();var fs_extra=require(_0xa6ee('0x5'));var auth=require(_0xa6ee('0x6'));var interaction=require(_0xa6ee('0x7'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xa6ee('0x8')]('/',auth[_0xa6ee('0x9')](),controller[_0xa6ee('0xa')]);router[_0xa6ee('0x8')](_0xa6ee('0xb'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0xc')]);router['get'](_0xa6ee('0xd'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0xe')]);router[_0xa6ee('0x8')](_0xa6ee('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xa6ee('0x8')](_0xa6ee('0x10'),auth['isAuthenticated'](),controller[_0xa6ee('0x11')]);router[_0xa6ee('0x8')]('/:id/applications',auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x12')]);router['get'](_0xa6ee('0x13'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x14')]);router[_0xa6ee('0x8')](_0xa6ee('0x15'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x16')]);router[_0xa6ee('0x17')]('/',auth[_0xa6ee('0x9')](),controller['create']);router[_0xa6ee('0x17')](_0xa6ee('0xf'),auth[_0xa6ee('0x9')](),controller['addDisposition']);router[_0xa6ee('0x17')]('/:id/canned_answers',auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x18')]);router[_0xa6ee('0x17')](_0xa6ee('0x19'),controller[_0xa6ee('0x1a')]);router[_0xa6ee('0x17')](_0xa6ee('0x1b'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x1c')]);router[_0xa6ee('0x17')](_0xa6ee('0x15'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x1d')]);router['post'](_0xa6ee('0x1e'),auth['isAuthenticated'](),controller[_0xa6ee('0x1f')]);router[_0xa6ee('0x20')](_0xa6ee('0xd'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x21')]);router[_0xa6ee('0x22')](_0xa6ee('0xd'),auth['isAuthenticated'](),controller[_0xa6ee('0x23')]);router['delete'](_0xa6ee('0xf'),auth['isAuthenticated'](),controller[_0xa6ee('0x24')]);router[_0xa6ee('0x22')](_0xa6ee('0x10'),auth[_0xa6ee('0x9')](),controller[_0xa6ee('0x25')]);router[_0xa6ee('0x22')]('/:id/users',auth['isAuthenticated'](),controller[_0xa6ee('0x26')]);module[_0xa6ee('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 74f8637..0aa0328 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 _0x2051=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING','generate','TEXT','BOOLEAN'];(function(_0x4e5af0,_0x2eb195){var _0x19c473=function(_0x3d22f2){while(--_0x3d22f2){_0x4e5af0['push'](_0x4e5af0['shift']());}};_0x19c473(++_0x2eb195);}(_0x2051,0x123));var _0x1205=function(_0x3408b2,_0x4bb2f9){_0x3408b2=_0x3408b2-0x0;var _0x241c68=_0x2051[_0x3408b2];return _0x241c68;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1205('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1205('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x1205('0x2')]},'token':{'type':Sequelize[_0x1205('0x2')],'defaultValue':function(){return rs[_0x1205('0x3')]();}},'replyUri':{'type':Sequelize[_0x1205('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1205('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1205('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1205('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1205('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1205('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1205('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1205('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xffb16a){if(!_0xffb16a)this[_0x1205('0x8')](_0x1205('0x9'),null);this['setDataValue'](_0x1205('0xa'),_0xffb16a);}}}; \ No newline at end of file +var _0x6240=['randomstring','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x42e4b1,_0x570114){var _0x4ba5cc=function(_0x4fae9d){while(--_0x4fae9d){_0x42e4b1['push'](_0x42e4b1['shift']());}};_0x4ba5cc(++_0x570114);}(_0x6240,0x12b));var _0x0624=function(_0x14fa20,_0x4ea90e){_0x14fa20=_0x14fa20-0x0;var _0x181495=_0x6240[_0x14fa20];return _0x181495;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0624('0x0'));module[_0x0624('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0624('0x2')],'defaultValue':function(){return rs[_0x0624('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0624('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0624('0x4')],'defaultValue':function(){return _0x0624('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0624('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0624('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0624('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0624('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0624('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x0624('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x0624('0x8')],'defaultValue':![],'comment':_0x0624('0x9'),'set':function(_0x5eb297){if(!_0x5eb297)this['setDataValue'](_0x0624('0xa'),null);this[_0x0624('0xb')](_0x0624('0xc'),_0x5eb297);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 183f2d7..fcdd999 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 _0x4876=['name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','catch','show','params','Pause','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','create','getDispositions','findOne','Disposition','OpenchannelAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','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','List','Contacts','DESC','Applications','account','applications','priority','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','OpenchannelAccounts','UserProfileResource','then','stack'];(function(_0x21fd6,_0xdfbacb){var _0x285bf5=function(_0x51f42c){while(--_0x51f42c){_0x21fd6['push'](_0x21fd6['shift']());}};_0x285bf5(++_0xdfbacb);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6487('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6487('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6487('0x2'));var util=require(_0x6487('0x3'));var path=require(_0x6487('0x4'));var sox=require(_0x6487('0x5'));var csv=require('to-csv');var ejs=require(_0x6487('0x6'));var fs=require('fs');var fs_extra=require(_0x6487('0x7'));var _=require('lodash');var squel=require(_0x6487('0x8'));var crypto=require(_0x6487('0x9'));var jsforce=require(_0x6487('0xa'));var deskjs=require(_0x6487('0xb'));var toCsv=require(_0x6487('0xc'));var querystring=require(_0x6487('0xd'));var Papa=require(_0x6487('0xe'));var Redis=require(_0x6487('0xf'));var authService=require(_0x6487('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6487('0x11'));var hardwareService=require(_0x6487('0x12'));var logger=require(_0x6487('0x13'))(_0x6487('0x14'));var utils=require(_0x6487('0x15'));var config=require(_0x6487('0x16'));var licenseUtil=require(_0x6487('0x17'));var db=require(_0x6487('0x18'))['db'];config['redis']=_[_0x6487('0x19')](config[_0x6487('0x1a')],{'host':_0x6487('0x1b'),'port':0x18eb});var socket=require(_0x6487('0x1c'))(new Redis(config['redis']));require(_0x6487('0x1d'))[_0x6487('0x1e')](socket);var jayson=require(_0x6487('0x1f'));var client=jayson[_0x6487('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x6487('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x552f2d,_0x2fdfc3,_0x583f04,_0x1bd934){return new BPromise(function(_0x3e7560,_0x174f41){var _0x26b2f2=_0x1bd934||client;return _0x26b2f2[_0x6487('0x22')](_0x552f2d,_0x583f04)['then'](function(_0x4cedf9){logger['info'](_0x6487('0x23'),_0x2fdfc3,_0x6487('0x24'));logger[_0x6487('0x25')](_0x6487('0x26'),_0x2fdfc3,_0x6487('0x24'),JSON[_0x6487('0x27')](_0x4cedf9));if(_0x4cedf9[_0x6487('0x28')]){if(_0x4cedf9[_0x6487('0x28')][_0x6487('0x29')]===0x1f4){logger[_0x6487('0x28')](_0x6487('0x23'),_0x2fdfc3,_0x4cedf9[_0x6487('0x28')][_0x6487('0x2a')]);return _0x174f41(_0x4cedf9[_0x6487('0x28')][_0x6487('0x2a')]);}logger[_0x6487('0x28')](_0x6487('0x23'),_0x2fdfc3,_0x4cedf9[_0x6487('0x28')][_0x6487('0x2a')]);return _0x3e7560(_0x4cedf9['error']['message']);}else{logger[_0x6487('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x2fdfc3,'request\x20sent');_0x3e7560(_0x4cedf9[_0x6487('0x2c')][_0x6487('0x2a')]);}})['catch'](function(_0x116995){logger[_0x6487('0x28')](_0x6487('0x23'),_0x2fdfc3,_0x116995);_0x174f41(_0x116995);});});}function respondWithStatusCode(_0x3afdc6,_0x392e60){_0x392e60=_0x392e60||0xcc;return function(_0x5439f7){if(_0x5439f7){return _0x3afdc6[_0x6487('0x2d')](_0x392e60);}return _0x3afdc6['status'](_0x392e60)[_0x6487('0x2e')]();};}function respondWithResult(_0x5a29f9,_0x5a9ef0){_0x5a9ef0=_0x5a9ef0||0xc8;return function(_0x412056){if(_0x412056){return _0x5a29f9[_0x6487('0x2f')](_0x5a9ef0)[_0x6487('0x30')](_0x412056);}};}function respondWithFilteredResult(_0x4c424a,_0x39581d){return function(_0x3c4411){if(_0x3c4411){var _0x33085b=typeof _0x39581d[_0x6487('0x31')]===_0x6487('0x32')&&typeof _0x39581d[_0x6487('0x33')]==='undefined';var _0x2868d7=_0x3c4411[_0x6487('0x34')];var _0x5df993=_0x33085b?0x0:_0x39581d[_0x6487('0x31')];var _0x2920a9=_0x33085b?_0x3c4411[_0x6487('0x34')]:_0x39581d[_0x6487('0x31')]+_0x39581d[_0x6487('0x33')];var _0x809bb8;if(_0x2920a9>=_0x2868d7){_0x2920a9=_0x2868d7;_0x809bb8=0xc8;}else{_0x809bb8=0xce;}_0x4c424a[_0x6487('0x2f')](_0x809bb8);return _0x4c424a['set'](_0x6487('0x35'),_0x5df993+'-'+_0x2920a9+'/'+_0x2868d7)['json'](_0x3c4411);}return null;};}function patchUpdates(_0x2d320c){return function(_0x4d5c04){try{jsonpatch['apply'](_0x4d5c04,_0x2d320c,!![]);}catch(_0x4c2c75){return BPromise['reject'](_0x4c2c75);}return _0x4d5c04[_0x6487('0x36')]();};}function saveUpdates(_0x36c78e,_0x2ee6de){return function(_0x4c1066){if(_0x4c1066){return _0x4c1066[_0x6487('0x37')](_0x36c78e)['then'](function(_0x1415b1){return _0x1415b1;});}return null;};}function removeEntity(_0x3685ff,_0x3d311f){return function(_0x3e5174){if(_0x3e5174){return _0x3e5174[_0x6487('0x38')]()['then'](function(){var _0x22b286=_0x3e5174['get']({'plain':!![]});var _0x32dbf5=_0x6487('0x39');return db[_0x6487('0x3a')][_0x6487('0x38')]({'where':{'type':_0x32dbf5,'resourceId':_0x22b286['id']}})['then'](function(){return _0x3e5174;});})[_0x6487('0x3b')](function(){_0x3685ff[_0x6487('0x2f')](0xcc)[_0x6487('0x2e')]();});}};}function handleEntityNotFound(_0x530c21,_0x53e715){return function(_0x2cbbe2){if(!_0x2cbbe2){_0x530c21['sendStatus'](0x194);}return _0x2cbbe2;};}function handleError(_0x3fdb77,_0x175a9c){_0x175a9c=_0x175a9c||0x1f4;return function(_0xff0c42){logger['error'](_0xff0c42[_0x6487('0x3c')]);if(_0xff0c42[_0x6487('0x3d')]){delete _0xff0c42[_0x6487('0x3d')];}_0x3fdb77[_0x6487('0x2f')](_0x175a9c)[_0x6487('0x3e')](_0xff0c42);};}exports[_0x6487('0x3f')]=function(_0x295a79,_0x538293){var _0xa2a8dc={'include':[{'model':db['Pause'],'as':_0x6487('0x40')}]},_0x3aa184={},_0x192028={'count':0x0,'rows':[]};var _0x4de8c8=_[_0x6487('0x41')](db['OpenchannelAccount'][_0x6487('0x42')],function(_0x584ecd){return{'name':_0x584ecd[_0x6487('0x43')],'type':_0x584ecd[_0x6487('0x44')][_0x6487('0x45')]};});_0x3aa184[_0x6487('0x46')]=_[_0x6487('0x41')](_0x4de8c8,_0x6487('0x3d'));_0x3aa184[_0x6487('0x47')]=_[_0x6487('0x48')](_0x295a79['query']);_0x3aa184[_0x6487('0x49')]=_[_0x6487('0x4a')](_0x3aa184[_0x6487('0x46')],_0x3aa184[_0x6487('0x47')]);_0xa2a8dc[_0x6487('0x4b')]=_[_0x6487('0x4a')](_0x3aa184['model'],qs[_0x6487('0x4c')](_0x295a79[_0x6487('0x47')]['fields']));_0xa2a8dc[_0x6487('0x4b')]=_0xa2a8dc[_0x6487('0x4b')][_0x6487('0x4d')]?_0xa2a8dc[_0x6487('0x4b')]:_0x3aa184[_0x6487('0x46')];if(!_0x295a79[_0x6487('0x47')][_0x6487('0x4e')](_0x6487('0x4f'))){_0xa2a8dc[_0x6487('0x33')]=qs['limit'](_0x295a79[_0x6487('0x47')][_0x6487('0x33')]);_0xa2a8dc[_0x6487('0x31')]=qs['offset'](_0x295a79['query'][_0x6487('0x31')]);}_0xa2a8dc[_0x6487('0x50')]=qs[_0x6487('0x51')](_0x295a79[_0x6487('0x47')][_0x6487('0x51')]);_0xa2a8dc[_0x6487('0x52')]=qs['filters'](_[_0x6487('0x53')](_0x295a79['query'],_0x3aa184[_0x6487('0x49')]),_0x4de8c8);if(_0x295a79[_0x6487('0x47')][_0x6487('0x54')]){_0xa2a8dc[_0x6487('0x52')]=_[_0x6487('0x55')](_0xa2a8dc[_0x6487('0x52')],{'$or':_[_0x6487('0x41')](_0x4de8c8,function(_0x27811e){if(_0x27811e[_0x6487('0x44')]!==_0x6487('0x56')){var _0x12e864={};_0x12e864[_0x27811e[_0x6487('0x3d')]]={'$like':'%'+_0x295a79['query'][_0x6487('0x54')]+'%'};return _0x12e864;}})});}_0xa2a8dc=_['merge']({},_0xa2a8dc,_0x295a79[_0x6487('0x57')]);var _0x2c4272={'where':_0xa2a8dc[_0x6487('0x52')]};return db[_0x6487('0x58')][_0x6487('0x34')](_0x2c4272)[_0x6487('0x3b')](function(_0x2f5602){_0x192028[_0x6487('0x34')]=_0x2f5602;if(_0x295a79[_0x6487('0x47')][_0x6487('0x59')]){_0xa2a8dc[_0x6487('0x5a')]=[{'all':!![]}];}return db[_0x6487('0x58')][_0x6487('0x5b')](_0xa2a8dc);})[_0x6487('0x3b')](function(_0x2a7715){_0x192028[_0x6487('0x5c')]=_0x2a7715;return _0x192028;})[_0x6487('0x3b')](respondWithFilteredResult(_0x538293,_0xa2a8dc))[_0x6487('0x5d')](handleError(_0x538293,null));};exports[_0x6487('0x5e')]=function(_0x56aa08,_0x301f96){var _0x3f9fb9={'raw':![],'where':{'id':_0x56aa08[_0x6487('0x5f')]['id']},'include':[{'model':db[_0x6487('0x60')],'as':_0x6487('0x40')}]},_0x529f28={};_0x529f28[_0x6487('0x46')]=_['keys'](db[_0x6487('0x58')][_0x6487('0x42')]);_0x529f28[_0x6487('0x47')]=_[_0x6487('0x48')](_0x56aa08[_0x6487('0x47')]);_0x529f28[_0x6487('0x49')]=_[_0x6487('0x4a')](_0x529f28['model'],_0x529f28[_0x6487('0x47')]);_0x3f9fb9[_0x6487('0x4b')]=_[_0x6487('0x4a')](_0x529f28[_0x6487('0x46')],qs[_0x6487('0x4c')](_0x56aa08[_0x6487('0x47')][_0x6487('0x4c')]));_0x3f9fb9[_0x6487('0x4b')]=_0x3f9fb9[_0x6487('0x4b')][_0x6487('0x4d')]?_0x3f9fb9[_0x6487('0x4b')]:_0x529f28['model'];if(_0x56aa08[_0x6487('0x47')]['includeAll']){_0x3f9fb9[_0x6487('0x5a')]=[{'all':!![]}];}_0x3f9fb9=_[_0x6487('0x55')]({},_0x3f9fb9,_0x56aa08[_0x6487('0x57')]);return db[_0x6487('0x58')][_0x6487('0x61')](_0x3f9fb9)[_0x6487('0x3b')](handleEntityNotFound(_0x301f96,null))[_0x6487('0x3b')](respondWithResult(_0x301f96,null))[_0x6487('0x5d')](handleError(_0x301f96,null));};exports['create']=function(_0x4d7a8a,_0x246b60){return db[_0x6487('0x58')]['create'](_0x4d7a8a[_0x6487('0x62')],{})[_0x6487('0x3b')](function(_0x382ce1){var _0x7b0612=_0x4d7a8a[_0x6487('0x63')][_0x6487('0x64')]({'plain':!![]});if(!_0x7b0612)throw new Error(_0x6487('0x65'));if(_0x7b0612['role']==='user'){var _0x5703de=_0x382ce1['get']({'plain':!![]});var _0x4ec018=_0x6487('0x39');return db[_0x6487('0x66')][_0x6487('0x61')]({'where':{'name':_0x4ec018,'userProfileId':_0x7b0612[_0x6487('0x67')]},'raw':!![]})[_0x6487('0x3b')](function(_0x3a9bf0){if(_0x3a9bf0&&_0x3a9bf0[_0x6487('0x68')]===0x0){return db[_0x6487('0x3a')]['create']({'name':_0x5703de['name'],'resourceId':_0x5703de['id'],'type':_0x3a9bf0[_0x6487('0x3d')],'sectionId':_0x3a9bf0['id']},{})[_0x6487('0x3b')](function(){return _0x382ce1;});}else{return _0x382ce1;}})[_0x6487('0x5d')](function(_0x1585ae){logger[_0x6487('0x28')](_0x6487('0x69'),_0x1585ae);throw _0x1585ae;});}return _0x382ce1;})[_0x6487('0x3b')](respondWithResult(_0x246b60,0xc9))[_0x6487('0x5d')](handleError(_0x246b60,null));};exports['update']=function(_0x221f57,_0x27a2a1){if(_0x221f57[_0x6487('0x62')]['id']){delete _0x221f57[_0x6487('0x62')]['id'];}return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x221f57[_0x6487('0x5f')]['id']},'include':[{'model':db[_0x6487('0x60')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x27a2a1,null))[_0x6487('0x3b')](saveUpdates(_0x221f57[_0x6487('0x62')],null))[_0x6487('0x3b')](respondWithResult(_0x27a2a1,null))[_0x6487('0x5d')](handleError(_0x27a2a1,null));};exports['destroy']=function(_0x5a0e08,_0xe432f4){return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x5a0e08[_0x6487('0x5f')]['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0xe432f4,null))[_0x6487('0x3b')](removeEntity(_0xe432f4,null))[_0x6487('0x5d')](handleError(_0xe432f4,null));};exports[_0x6487('0x6a')]=function(_0x287187,_0x1eeecb){return db['OpenchannelAccount'][_0x6487('0x6a')]()[_0x6487('0x3b')](respondWithResult(_0x1eeecb,null))[_0x6487('0x5d')](handleError(_0x1eeecb,null));};exports[_0x6487('0x6b')]=function(_0x176dd1,_0x1d3eae,_0x34a484){if(_0x176dd1[_0x6487('0x62')]['id']){delete _0x176dd1['body']['id'];}return db[_0x6487('0x58')]['find']({'where':{'id':_0x176dd1[_0x6487('0x5f')]['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x1d3eae,null))[_0x6487('0x3b')](function(_0x420d73){if(_0x420d73){_0x176dd1[_0x6487('0x62')]['OpenchannelAccountId']=_0x420d73['id'];return db['Disposition'][_0x6487('0x6c')](_0x176dd1[_0x6487('0x62')]);}})[_0x6487('0x3b')](respondWithResult(_0x1d3eae,null))[_0x6487('0x5d')](handleError(_0x1d3eae,null));};exports[_0x6487('0x6d')]=function(_0x264465,_0x550af9,_0x374054){var _0x168f0d={'raw':![],'where':{}};var _0x395db7={};var _0x2db80a={'count':0x0,'rows':[]};return db[_0x6487('0x58')][_0x6487('0x6e')]({'where':{'id':_0x264465[_0x6487('0x5f')]['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x550af9,null))['then'](function(_0x374135){if(_0x374135){_0x395db7[_0x6487('0x46')]=_[_0x6487('0x48')](db[_0x6487('0x6f')]['rawAttributes']);_0x395db7[_0x6487('0x47')]=_['keys'](_0x264465[_0x6487('0x47')]);_0x395db7[_0x6487('0x49')]=_[_0x6487('0x4a')](_0x395db7[_0x6487('0x46')],_0x395db7[_0x6487('0x47')]);_0x168f0d[_0x6487('0x4b')]=_[_0x6487('0x4a')](_0x395db7[_0x6487('0x46')],qs[_0x6487('0x4c')](_0x264465['query'][_0x6487('0x4c')]));_0x168f0d['attributes']=_0x168f0d['attributes'][_0x6487('0x4d')]?_0x168f0d[_0x6487('0x4b')]:_0x395db7['model'];if(!_0x264465[_0x6487('0x47')][_0x6487('0x4e')]('nolimit')){_0x168f0d[_0x6487('0x33')]=qs[_0x6487('0x33')](_0x264465[_0x6487('0x47')][_0x6487('0x33')]);_0x168f0d['offset']=qs[_0x6487('0x31')](_0x264465['query'][_0x6487('0x31')]);}_0x168f0d['order']=qs[_0x6487('0x51')](_0x264465['query'][_0x6487('0x51')]);_0x168f0d[_0x6487('0x52')]=qs['filters'](_[_0x6487('0x53')](_0x264465[_0x6487('0x47')],_0x395db7[_0x6487('0x49')]));_0x168f0d['where'][_0x6487('0x70')]=_0x374135['id'];if(_0x264465[_0x6487('0x47')][_0x6487('0x54')]){_0x168f0d['where']=_[_0x6487('0x55')](_0x168f0d[_0x6487('0x52')],{'$or':_[_0x6487('0x41')](_0x168f0d[_0x6487('0x4b')],function(_0x3f7a41){var _0x39bf94={};_0x39bf94[_0x3f7a41]={'$like':'%'+_0x264465[_0x6487('0x47')]['filter']+'%'};return _0x39bf94;})});}_0x168f0d=_[_0x6487('0x55')]({},_0x168f0d,_0x264465['options']);return db[_0x6487('0x6f')][_0x6487('0x34')]({'where':_0x168f0d[_0x6487('0x52')]})[_0x6487('0x3b')](function(_0x7809ae){_0x2db80a[_0x6487('0x34')]=_0x7809ae;if(_0x264465[_0x6487('0x47')][_0x6487('0x59')]){_0x168f0d[_0x6487('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x6487('0x5b')](_0x168f0d);})['then'](function(_0x45e4f3){_0x2db80a[_0x6487('0x5c')]=_0x45e4f3;return _0x2db80a;});}})['then'](respondWithFilteredResult(_0x550af9,_0x168f0d))[_0x6487('0x5d')](handleError(_0x550af9,null));};exports[_0x6487('0x71')]=function(_0x4d6e8a,_0x173337,_0x1d7152){return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x4d6e8a[_0x6487('0x5f')]['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x173337,null))['then'](function(_0x18dca7){if(_0x18dca7){return _0x18dca7[_0x6487('0x71')](_0x4d6e8a['query']['ids']);}})['then'](respondWithStatusCode(_0x173337,null))['catch'](handleError(_0x173337,null));};exports[_0x6487('0x72')]=function(_0x3c66a2,_0xa5de13,_0x26468a){if(_0x3c66a2['body']['id']){delete _0x3c66a2[_0x6487('0x62')]['id'];}return db[_0x6487('0x58')]['find']({'where':{'id':_0x3c66a2[_0x6487('0x5f')]['id']}})['then'](handleEntityNotFound(_0xa5de13,null))['then'](function(_0x5852a2){if(_0x5852a2){_0x3c66a2[_0x6487('0x62')]['OpenchannelAccountId']=_0x5852a2['id'];return db[_0x6487('0x73')]['create'](_0x3c66a2[_0x6487('0x62')]);}})['then'](respondWithResult(_0xa5de13,null))[_0x6487('0x5d')](handleError(_0xa5de13,null));};exports[_0x6487('0x74')]=function(_0x1f40fb,_0x59961e,_0x13af1d){var _0x308b46={'raw':![],'where':{}};var _0x4ea04c={};var _0x3029f9={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6487('0x6e')]({'where':{'id':_0x1f40fb['params']['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x59961e,null))[_0x6487('0x3b')](function(_0x448cb2){if(_0x448cb2){_0x4ea04c[_0x6487('0x46')]=_['keys'](db[_0x6487('0x73')][_0x6487('0x42')]);_0x4ea04c[_0x6487('0x47')]=_['keys'](_0x1f40fb['query']);_0x4ea04c[_0x6487('0x49')]=_[_0x6487('0x4a')](_0x4ea04c[_0x6487('0x46')],_0x4ea04c['query']);_0x308b46[_0x6487('0x4b')]=_[_0x6487('0x4a')](_0x4ea04c[_0x6487('0x46')],qs['fields'](_0x1f40fb[_0x6487('0x47')][_0x6487('0x4c')]));_0x308b46[_0x6487('0x4b')]=_0x308b46[_0x6487('0x4b')][_0x6487('0x4d')]?_0x308b46[_0x6487('0x4b')]:_0x4ea04c[_0x6487('0x46')];if(!_0x1f40fb[_0x6487('0x47')]['hasOwnProperty'](_0x6487('0x4f'))){_0x308b46['limit']=qs[_0x6487('0x33')](_0x1f40fb[_0x6487('0x47')][_0x6487('0x33')]);_0x308b46['offset']=qs[_0x6487('0x31')](_0x1f40fb[_0x6487('0x47')][_0x6487('0x31')]);}_0x308b46[_0x6487('0x50')]=qs['sort'](_0x1f40fb['query']['sort']);_0x308b46[_0x6487('0x52')]=qs[_0x6487('0x49')](_['pick'](_0x1f40fb['query'],_0x4ea04c[_0x6487('0x49')]));_0x308b46[_0x6487('0x52')][_0x6487('0x70')]=_0x448cb2['id'];if(_0x1f40fb[_0x6487('0x47')]['filter']){_0x308b46[_0x6487('0x52')]=_['merge'](_0x308b46[_0x6487('0x52')],{'$or':_['map'](_0x308b46[_0x6487('0x4b')],function(_0x50fcda){var _0xa9923b={};_0xa9923b[_0x50fcda]={'$like':'%'+_0x1f40fb['query']['filter']+'%'};return _0xa9923b;})});}_0x308b46=_[_0x6487('0x55')]({},_0x308b46,_0x1f40fb[_0x6487('0x57')]);return db[_0x6487('0x73')][_0x6487('0x34')]({'where':_0x308b46[_0x6487('0x52')]})[_0x6487('0x3b')](function(_0x3b69bc){_0x3029f9[_0x6487('0x34')]=_0x3b69bc;if(_0x1f40fb[_0x6487('0x47')][_0x6487('0x59')]){_0x308b46['include']=[{'all':!![]}];}return db[_0x6487('0x73')][_0x6487('0x5b')](_0x308b46);})['then'](function(_0x247549){_0x3029f9['rows']=_0x247549;return _0x3029f9;});}})[_0x6487('0x3b')](respondWithFilteredResult(_0x59961e,_0x308b46))[_0x6487('0x5d')](handleError(_0x59961e,null));};exports[_0x6487('0x75')]=function(_0x305e3e,_0x2a1ef7,_0x312522){return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x305e3e['params']['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x2a1ef7,null))[_0x6487('0x3b')](function(_0xa95160){if(_0xa95160){return _0xa95160[_0x6487('0x75')](_0x305e3e[_0x6487('0x47')][_0x6487('0x76')]);}})[_0x6487('0x3b')](respondWithStatusCode(_0x2a1ef7,null))['catch'](handleError(_0x2a1ef7,null));};exports[_0x6487('0x77')]=function(_0x22c1f6,_0x565e78,_0x5c3f5c){var _0x59148d={'body':_0x22c1f6[_0x6487('0x62')],'channel':'openchannel'};var _0x4aa1a4=[];var _0x209362=[];var _0x5cd4fc={};var _0x3d287a=![];return db[_0x6487('0x78')]['describe']()['then'](function(_0x1df07d){if(!_0x1df07d){throw new db[(_0x6487('0x79'))][(_0x6487('0x7a'))](_0x6487('0x7b'));}_0x4aa1a4=_['difference'](_[_0x6487('0x48')](_0x1df07d),[_0x6487('0x7c'),'updatedAt']);_0x209362=_['difference'](_[_0x6487('0x48')](_0x1df07d),[_0x6487('0x7c'),_0x6487('0x7d'),_0x6487('0x7e'),'ListId']);if(_0x22c1f6[_0x6487('0x62')]['id']){delete _0x22c1f6[_0x6487('0x62')]['id'];}if(_[_0x6487('0x7f')](_0x22c1f6['body'][_0x6487('0x80')])){throw new db[(_0x6487('0x79'))][(_0x6487('0x7a'))](_0x6487('0x81'));}if(_[_0x6487('0x7f')](_0x22c1f6[_0x6487('0x62')][_0x6487('0x62')])||_0x22c1f6[_0x6487('0x62')][_0x6487('0x62')]===''){throw new db[(_0x6487('0x79'))][(_0x6487('0x7a'))](_0x6487('0x82'));}if(_[_0x6487('0x7f')](_0x22c1f6['body'][_0x6487('0x83')])){throw new db['Sequelize'][(_0x6487('0x7a'))](_0x6487('0x84')+_0x209362);}if(!_[_0x6487('0x85')](_0x209362,_0x22c1f6[_0x6487('0x62')][_0x6487('0x83')])){throw new db['Sequelize'][(_0x6487('0x7a'))](_0x6487('0x86')+_0x209362);}_0x5cd4fc[_0x22c1f6['body'][_0x6487('0x83')]]=_0x22c1f6[_0x6487('0x62')][_0x6487('0x80')];})['then'](function(){return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x22c1f6['params']['id']},'include':[{'model':db['CmList'],'as':_0x6487('0x87'),'include':[{'model':db[_0x6487('0x78')],'as':_0x6487('0x88'),'where':_0x5cd4fc,'limit':0x1,'order':[['updatedAt',_0x6487('0x89')]]}]},{'model':db['OpenchannelApplication'],'as':_0x6487('0x8a')}]});})['then'](handleEntityNotFound(_0x565e78,null))[_0x6487('0x3b')](function(_0x3a055e){if(_0x3a055e&&_0x3a055e[_0x6487('0x87')]){_0x59148d[_0x6487('0x8b')]=_0x3a055e;_0x59148d[_0x6487('0x8c')]=_0x3a055e[_0x6487('0x8a')];_0x59148d['list']=_0x3a055e['List'];_0x59148d[_0x6487('0x8c')]=_['orderBy'](_0x59148d[_0x6487('0x8c')],[_0x6487('0x8d')],['asc']);if(_0x59148d[_0x6487('0x8b')][_0x6487('0x8a')]){delete _0x59148d[_0x6487('0x8b')]['Applications'];}if(_0x59148d[_0x6487('0x8b')][_0x6487('0x87')]&&_0x59148d['account'][_0x6487('0x87')][_0x6487('0x88')][_0x6487('0x4d')]){return _0x59148d[_0x6487('0x8b')][_0x6487('0x87')][_0x6487('0x88')][0x0];}var _0x58a313=_[_0x6487('0x19')](_0x22c1f6['body'],{'firstName':_0x22c1f6[_0x6487('0x62')][_0x6487('0x80')],'ListId':_0x3a055e[_0x6487('0x8e')]});_0x58a313[_0x22c1f6[_0x6487('0x62')]['mapKey']]=_0x22c1f6[_0x6487('0x62')][_0x6487('0x80')];return db[_0x6487('0x78')][_0x6487('0x6c')](_0x58a313,{'fields':_0x4aa1a4,'raw':!![]});}})[_0x6487('0x3b')](handleEntityNotFound(_0x565e78,null))['then'](function(_0x103d08){_0x59148d[_0x6487('0x8f')]=_0x103d08;if(_0x103d08){var _0x4a780c={'ContactId':_0x103d08['id'],'OpenchannelAccountId':_0x22c1f6[_0x6487('0x5f')]['id'],'from':(_0x103d08[_0x6487('0x90')]||'')+'\x20'+(_0x103d08[_0x6487('0x91')]||'')};var _0x14a8da={'OpenchannelAccountId':_0x22c1f6['params']['id'],'closed':![]};if(_0x22c1f6['body']['threadId']){_0x14a8da[_0x6487('0x92')]=_0x22c1f6[_0x6487('0x62')][_0x6487('0x92')];return db[_0x6487('0x93')][_0x6487('0x61')]({'where':_0x14a8da})['then'](function(_0x5bad56){if(_0x5bad56){return[_0x5bad56,![]];}_0x4a780c[_0x6487('0x92')]=_0x22c1f6['body'][_0x6487('0x92')];_0x4a780c[_0x6487('0x94')]=_0x22c1f6[_0x6487('0x62')][_0x6487('0x94')];return db[_0x6487('0x93')][_0x6487('0x6c')](_0x4a780c)[_0x6487('0x3b')](function(_0x11bd17){return[_0x11bd17,!![]];});});}else{_0x14a8da['threadId']=null;}_0x14a8da['ContactId']=_0x103d08['id'];return db[_0x6487('0x93')][_0x6487('0x61')]({'where':_0x14a8da})[_0x6487('0x3b')](function(_0x52af09){if(_0x52af09){return[_0x52af09,![]];}return db[_0x6487('0x93')][_0x6487('0x6c')](_0x4a780c)[_0x6487('0x3b')](function(_0x101881){return[_0x101881,!![]];});});}})[_0x6487('0x95')](function(_0x20c9de,_0x5bb223){if(_0x20c9de){_0x3d287a=_0x5bb223;if(!_0x5bb223){var _0x29a2be={'from':(_0x59148d[_0x6487('0x8f')]['firstName']||'')+'\x20'+(_0x59148d['contact']['lastName']||'')};if(_0x22c1f6[_0x6487('0x62')][_0x6487('0x92')]&&_0x22c1f6[_0x6487('0x62')][_0x6487('0x96')]&&_0x22c1f6['body'][_0x6487('0x92')]!=_0x22c1f6[_0x6487('0x62')][_0x6487('0x96')]){_0x29a2be[_0x6487('0x92')]=_0x22c1f6['body'][_0x6487('0x96')];}return _0x20c9de[_0x6487('0x37')](_0x29a2be);}else{return _0x20c9de;}}})[_0x6487('0x3b')](function(_0x1f3c37){_0x59148d[_0x6487('0x97')]=_0x1f3c37[_0x6487('0x64')]({'plain':!![]});_0x59148d['interaction'][_0x6487('0x98')]=_0x3d287a;if(_0x59148d[_0x6487('0x97')][_0x6487('0x98')]){if(_0x59148d[_0x6487('0x8b')][_0x6487('0x99')]){_0x59148d[_0x6487('0x8c')][_0x6487('0x9a')]({'id':0x0,'priority':_0x59148d['applications'][_0x6487('0x4d')]+0x1,'app':'close','appdata':_0x6487('0x9b'),'interval':_0x6487('0x9c')});}}return db[_0x6487('0x9d')][_0x6487('0x6c')]({'body':_0x22c1f6[_0x6487('0x62')][_0x6487('0x62')],'OpenchannelAccountId':_0x22c1f6['params']['id'],'OpenchannelInteractionId':_0x1f3c37['id'],'direction':'in','ContactId':_0x59148d['contact']['id'],'AttachmentId':_0x22c1f6['body'][_0x6487('0x9e')]});})[_0x6487('0x3b')](function(_0x3c685f){_0x59148d[_0x6487('0x2a')]=_0x3c685f;if(_0x59148d[_0x6487('0x97')][_0x6487('0x9f')]){return db[_0x6487('0xa0')][_0x6487('0x61')]({'attributes':['id','name'],'where':{'id':_0x59148d[_0x6487('0x97')]['UserId']}})[_0x6487('0x3b')](function(_0x50b899){if(_0x50b899){_0x59148d[_0x6487('0x8c')][_0x6487('0xa1')]({'id':0x0,'priority':0x0,'app':_0x6487('0xa2'),'appdata':_0x50b899[_0x6487('0x3d')]+','+(_0x59148d['account'][_0x6487('0xa3')]||0xa),'interval':_0x6487('0x9c')});_0x59148d[_0x6487('0xa4')]=![];}return respondWithRpcPromise(_0x6487('0xa5'),'startRouting',_0x59148d);});}return respondWithRpcPromise(_0x6487('0xa5'),_0x6487('0xa6'),_0x59148d);})['then'](function(_0x39ac2f){respondWithRpcPromise(_0x6487('0xa7'),'EventManager',{'event':_0x6487('0x77'),'message':_0x39ac2f},client9002);return _0x39ac2f;})[_0x6487('0x3b')](respondWithResult(_0x565e78,null))[_0x6487('0x5d')](handleError(_0x565e78,null));};exports[_0x6487('0xa8')]=function(_0x26fd95,_0xe16d08){var _0x4080d1=_0x26fd95[_0x6487('0x5f')]['id'];var _0x5b0afc=_0x26fd95[_0x6487('0x62')];var _0x36e38e=0xc8;var _0x1eb341=null;return db[_0x6487('0xa9')]['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x6487('0xaa')]['READ_COMMITTED']},function(_0x123346){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4080d1},'transaction':_0x123346})['then'](function(_0x5c2e92){if(_0x5c2e92){return db[_0x6487('0xab')][_0x6487('0x38')]({'where':{'OpenchannelAccountId':_0x4080d1},'transaction':_0x123346})[_0x6487('0x3b')](function(){var _0x3698da=_[_0x6487('0x41')](_0x5b0afc,function(_0x19466a){_0x19466a[_0x6487('0x70')]=_0x4080d1;return _0x19466a;});return db[_0x6487('0xab')][_0x6487('0xac')](_0x3698da,{'transaction':_0x123346});});}else{_0x36e38e=0x194;_0x1eb341=[];}});})[_0x6487('0x3b')](function(){if(_0x36e38e!==0x194){return db['OpenchannelApplication'][_0x6487('0xad')]({'where':{'OpenchannelAccountId':_0x4080d1},'order':_0x6487('0x8d')})[_0x6487('0x3b')](function(_0x4fd832){_0x1eb341=_0x4fd832;});}})[_0x6487('0x5d')](function(_0x45ad16){_0x36e38e=0x1f4;logger[_0x6487('0x28')](_0x45ad16[_0x6487('0x3c')]);if(_0x45ad16[_0x6487('0x3d')]){delete _0x45ad16[_0x6487('0x3d')];}_0x1eb341=_0x45ad16;})[_0x6487('0xae')](function(){if(_0x1eb341===null){_0xe16d08['sendStatus'](_0x36e38e);}else{if(_0x36e38e===0x1f4){_0xe16d08[_0x6487('0x2f')](_0x36e38e)[_0x6487('0x3e')](_0x1eb341);}else{_0xe16d08['status'](_0x36e38e)[_0x6487('0x30')](_0x1eb341);}}});};exports[_0x6487('0xaf')]=function(_0x4df29f,_0x57cd20,_0x1979e3){var _0xf86870={};var _0x22377b={};var _0x4017f1;var _0x4e08a4;return db[_0x6487('0x58')][_0x6487('0x6e')]({'where':{'id':_0x4df29f[_0x6487('0x5f')]['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x57cd20,null))[_0x6487('0x3b')](function(_0x381f62){if(_0x381f62){_0x4017f1=_0x381f62;_0x22377b['model']=_[_0x6487('0x48')](db[_0x6487('0xab')][_0x6487('0x42')]);_0x22377b['query']=_[_0x6487('0x48')](_0x4df29f[_0x6487('0x47')]);_0x22377b[_0x6487('0x49')]=_[_0x6487('0x4a')](_0x22377b['model'],_0x22377b['query']);_0xf86870['attributes']=_[_0x6487('0x4a')](_0x22377b[_0x6487('0x46')],qs[_0x6487('0x4c')](_0x4df29f[_0x6487('0x47')]['fields']));_0xf86870[_0x6487('0x4b')]=_0xf86870[_0x6487('0x4b')][_0x6487('0x4d')]?_0xf86870[_0x6487('0x4b')]:_0x22377b['model'];_0xf86870[_0x6487('0x50')]=qs['sort'](_0x4df29f['query']['sort']);_0xf86870[_0x6487('0x52')]=qs['filters'](_[_0x6487('0x53')](_0x4df29f['query'],_0x22377b[_0x6487('0x49')]));if(_0x4df29f[_0x6487('0x47')][_0x6487('0x54')]){_0xf86870[_0x6487('0x52')]=_['merge'](_0xf86870[_0x6487('0x52')],{'$or':_['map'](_0xf86870[_0x6487('0x4b')],function(_0xe34c84){var _0x1b58c6={};_0x1b58c6[_0xe34c84]={'$like':'%'+_0x4df29f[_0x6487('0x47')][_0x6487('0x54')]+'%'};return _0x1b58c6;})});}_0xf86870=_[_0x6487('0x55')]({},_0xf86870,_0x4df29f[_0x6487('0x57')]);return _0x4017f1[_0x6487('0xaf')](_0xf86870);}})[_0x6487('0x3b')](function(_0x533897){if(_0x533897){_0x4e08a4=_0x533897[_0x6487('0x4d')];if(!_0x4df29f[_0x6487('0x47')]['hasOwnProperty'](_0x6487('0x4f'))){_0xf86870['limit']=qs[_0x6487('0x33')](_0x4df29f['query'][_0x6487('0x33')]);_0xf86870[_0x6487('0x31')]=qs[_0x6487('0x31')](_0x4df29f[_0x6487('0x47')][_0x6487('0x31')]);}return _0x4017f1[_0x6487('0xaf')](_0xf86870);}})[_0x6487('0x3b')](function(_0x23caae){if(_0x23caae){return _0x23caae?{'count':_0x4e08a4,'rows':_0x23caae}:null;}})['then'](respondWithResult(_0x57cd20,null))[_0x6487('0x5d')](handleError(_0x57cd20,null));};exports[_0x6487('0xb0')]=function(_0x463d6c,_0x55c0d1,_0xcfff8b){var _0x50aedc={'raw':![],'where':{}};var _0x52654d={};var _0x2b0759={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6487('0x6e')]({'where':{'id':_0x463d6c['params']['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x55c0d1,null))['then'](function(_0x475b0c){if(_0x475b0c){_0x52654d[_0x6487('0x46')]=_[_0x6487('0x48')](db[_0x6487('0x93')][_0x6487('0x42')]);_0x52654d['query']=_['keys'](_0x463d6c[_0x6487('0x47')]);_0x52654d['filters']=_[_0x6487('0x4a')](_0x52654d['model'],_0x52654d[_0x6487('0x47')]);_0x50aedc[_0x6487('0x4b')]=_['intersection'](_0x52654d[_0x6487('0x46')],qs[_0x6487('0x4c')](_0x463d6c[_0x6487('0x47')][_0x6487('0x4c')]));_0x50aedc[_0x6487('0x4b')]=_0x50aedc[_0x6487('0x4b')][_0x6487('0x4d')]?_0x50aedc[_0x6487('0x4b')]:_0x52654d['model'];if(!_0x463d6c[_0x6487('0x47')][_0x6487('0x4e')](_0x6487('0x4f'))){_0x50aedc[_0x6487('0x33')]=qs[_0x6487('0x33')](_0x463d6c[_0x6487('0x47')][_0x6487('0x33')]);_0x50aedc['offset']=qs[_0x6487('0x31')](_0x463d6c[_0x6487('0x47')][_0x6487('0x31')]);}_0x50aedc['order']=qs['sort'](_0x463d6c['query'][_0x6487('0x51')]);_0x50aedc[_0x6487('0x52')]=qs['filters'](_[_0x6487('0x53')](_0x463d6c[_0x6487('0x47')],_0x52654d[_0x6487('0x49')]));_0x50aedc[_0x6487('0x52')][_0x6487('0x70')]=_0x475b0c['id'];if(_0x463d6c[_0x6487('0x47')]['filter']){_0x50aedc[_0x6487('0x52')]=_['merge'](_0x50aedc['where'],{'$or':_[_0x6487('0x41')](_0x50aedc[_0x6487('0x4b')],function(_0x50f1fb){var _0x14151e={};_0x14151e[_0x50f1fb]={'$like':'%'+_0x463d6c[_0x6487('0x47')][_0x6487('0x54')]+'%'};return _0x14151e;})});}_0x50aedc=_['merge']({},_0x50aedc,_0x463d6c[_0x6487('0x57')]);return db[_0x6487('0x93')]['count']({'where':_0x50aedc[_0x6487('0x52')]})[_0x6487('0x3b')](function(_0x13e4e7){_0x2b0759[_0x6487('0x34')]=_0x13e4e7;if(_0x463d6c[_0x6487('0x47')][_0x6487('0x59')]){_0x50aedc['include']=[{'model':db[_0x6487('0x78')],'as':_0x6487('0xb1'),'required':![]},{'model':db['User'],'as':_0x6487('0xb2'),'attributes':[_0x6487('0x3d'),_0x6487('0xb3'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x6487('0xb4'),'attributes':['id',_0x6487('0x3d'),_0x6487('0xb5')],'where':_0x463d6c[_0x6487('0x47')][_0x6487('0xb6')]?{'id':_0x463d6c[_0x6487('0x47')][_0x6487('0xb6')]}:undefined,'required':_0x463d6c['query'][_0x6487('0xb6')]?!![]:![]}];}return db[_0x6487('0x93')][_0x6487('0x5b')](_0x50aedc);})['then'](function(_0x4d9a7c){_0x2b0759[_0x6487('0x5c')]=_0x4d9a7c;return _0x2b0759;});}})[_0x6487('0x3b')](respondWithFilteredResult(_0x55c0d1,_0x50aedc))[_0x6487('0x5d')](handleError(_0x55c0d1,null));};exports[_0x6487('0xb7')]=function(_0x31392a,_0x2ee224,_0x204cdb){return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x31392a['params']['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x2ee224,null))['then'](function(_0x1d06fd){if(_0x1d06fd){return _0x1d06fd[_0x6487('0xb7')](_0x31392a[_0x6487('0x62')]['ids'],_[_0x6487('0xb8')](_0x31392a[_0x6487('0x62')],[_0x6487('0x76'),'id'])||{})[_0x6487('0x95')](function(_0x148af1){for(var _0x4dbdaf=0x0;_0x4dbdaf<_0x31392a[_0x6487('0x62')][_0x6487('0x76')]['length'];_0x4dbdaf+=0x1){socket[_0x6487('0xb9')]('userOpenchannelAccount:save',{'UserId':Number(_0x31392a[_0x6487('0x62')][_0x6487('0x76')][_0x4dbdaf]),'OpenchannelAccountId':Number(_0x31392a['params']['id'])});}return _0x148af1;});}})[_0x6487('0x3b')](respondWithResult(_0x2ee224,null))[_0x6487('0x5d')](handleError(_0x2ee224,null));};exports[_0x6487('0xba')]=function(_0x3d3eca,_0x5225fd,_0x3affe3){return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x3d3eca['params']['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x5225fd,null))['then'](function(_0x3f4922){if(_0x3f4922){return _0x3f4922[_0x6487('0xba')](_0x3d3eca[_0x6487('0x47')][_0x6487('0x76')])[_0x6487('0x3b')](function(){if(_[_0x6487('0xbb')](_0x3d3eca[_0x6487('0x47')][_0x6487('0x76')])){for(var _0x48d9d8=0x0;_0x48d9d8<_0x3d3eca['query'][_0x6487('0x76')]['length'];_0x48d9d8+=0x1){socket[_0x6487('0xb9')](_0x6487('0xbc'),{'UserId':Number(_0x3d3eca[_0x6487('0x47')][_0x6487('0x76')][_0x48d9d8]),'OpenchannelAccountId':Number(_0x3d3eca[_0x6487('0x5f')]['id'])});}}else{socket[_0x6487('0xb9')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3d3eca[_0x6487('0x47')][_0x6487('0x76')]),'OpenchannelAccountId':Number(_0x3d3eca[_0x6487('0x5f')]['id'])});}});}})[_0x6487('0x3b')](respondWithStatusCode(_0x5225fd,null))[_0x6487('0x5d')](handleError(_0x5225fd,null));};exports[_0x6487('0xbd')]=function(_0x570b28,_0x544c94,_0x26b025){var _0xf2468={};var _0x53f11b={};var _0x62d7a7;var _0x248207;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x570b28['params']['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x544c94,null))['then'](function(_0x142bea){if(_0x142bea){_0x62d7a7=_0x142bea;_0x53f11b[_0x6487('0x46')]=_['keys'](db[_0x6487('0xa0')][_0x6487('0x42')]);_0x53f11b[_0x6487('0x47')]=_[_0x6487('0x48')](_0x570b28[_0x6487('0x47')]);_0x53f11b[_0x6487('0x49')]=_[_0x6487('0x4a')](_0x53f11b[_0x6487('0x46')],_0x53f11b[_0x6487('0x47')]);_0xf2468[_0x6487('0x4b')]=_[_0x6487('0x4a')](_0x53f11b[_0x6487('0x46')],qs[_0x6487('0x4c')](_0x570b28[_0x6487('0x47')]['fields']));_0xf2468['attributes']=_0xf2468[_0x6487('0x4b')][_0x6487('0x4d')]?_0xf2468['attributes']:_0x53f11b[_0x6487('0x46')];_0xf2468[_0x6487('0x50')]=qs[_0x6487('0x51')](_0x570b28[_0x6487('0x47')][_0x6487('0x51')]);_0xf2468[_0x6487('0x52')]=qs[_0x6487('0x49')](_['pick'](_0x570b28[_0x6487('0x47')],_0x53f11b[_0x6487('0x49')]));if(_0x570b28[_0x6487('0x47')]['filter']){_0xf2468['where']=_[_0x6487('0x55')](_0xf2468[_0x6487('0x52')],{'$or':_[_0x6487('0x41')](_0xf2468['attributes'],function(_0x5123c3){var _0x2b0179={};_0x2b0179[_0x5123c3]={'$like':'%'+_0x570b28[_0x6487('0x47')][_0x6487('0x54')]+'%'};return _0x2b0179;})});}_0xf2468=_['merge']({},_0xf2468,_0x570b28[_0x6487('0x57')]);return _0x62d7a7[_0x6487('0xbd')](_0xf2468);}})['then'](function(_0x465e42){if(_0x465e42){_0x248207=_0x465e42[_0x6487('0x4d')];if(!_0x570b28[_0x6487('0x47')][_0x6487('0x4e')](_0x6487('0x4f'))){_0xf2468['limit']=qs[_0x6487('0x33')](_0x570b28[_0x6487('0x47')]['limit']);_0xf2468['offset']=qs['offset'](_0x570b28['query']['offset']);}return _0x62d7a7[_0x6487('0xbd')](_0xf2468);}})['then'](function(_0x1c716d){if(_0x1c716d){return _0x1c716d?{'count':_0x248207,'rows':_0x1c716d}:null;}})[_0x6487('0x3b')](respondWithResult(_0x544c94,null))[_0x6487('0x5d')](handleError(_0x544c94,null));};exports[_0x6487('0x3e')]=function(_0x4c9fc2,_0x3f6bb3,_0x10cbac){var _0x2bd5e8,_0x14705f,_0xd01cde;if(_[_0x6487('0x7f')](_0x4c9fc2['body'][_0x6487('0x62')])||_0x4c9fc2['body'][_0x6487('0x62')]===''){throw new db[(_0x6487('0x79'))][(_0x6487('0x7a'))](_0x6487('0x82'));}if(_[_0x6487('0x7f')](_0x4c9fc2[_0x6487('0x62')]['to'])){}_0x2bd5e8=_0x4c9fc2['body']['to'];return db[_0x6487('0x58')][_0x6487('0x6e')]({'where':{'id':_0x4c9fc2[_0x6487('0x5f')]['id']}})[_0x6487('0x3b')](handleEntityNotFound(_0x3f6bb3,null))[_0x6487('0x3b')](function(_0x39a765){if(_0x39a765){return db[_0x6487('0x58')][_0x6487('0x61')]({'where':{'id':_0x39a765['id']},'include':[{'model':db['CmList'],'as':_0x6487('0x87'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x39a765['mapKey']]:_0x2bd5e8},'limit':0x1,'order':[[_0x6487('0x7d'),'DESC']]}]}]})[_0x6487('0x3b')](handleEntityNotFound(_0x3f6bb3,null))[_0x6487('0x3b')](function(_0x4276c0){if(_0x4276c0&&_0x4276c0[_0x6487('0x87')]){_0x14705f=_0x4276c0[_0x6487('0x64')]({'plain':!![]});if(_0x14705f[_0x6487('0x87')]&&_0x14705f[_0x6487('0x87')][_0x6487('0x88')][_0x6487('0x4d')]){return _0x14705f[_0x6487('0x87')][_0x6487('0x88')][0x0];}return db['CmContact']['create'](_[_0x6487('0x19')](_0x4c9fc2[_0x6487('0x62')],{'firstName':_0x2bd5e8,[_0x4276c0[_0x6487('0x83')]]:_0x2bd5e8,'phone':_0x2bd5e8,'ListId':_0x14705f[_0x6487('0x8e')]}));}})['then'](handleEntityNotFound(_0x3f6bb3,null))[_0x6487('0x3b')](function(_0x3fa5a6){if(_0x3fa5a6){_0xd01cde=_0x3fa5a6;return db[_0x6487('0x93')]['find']({'where':{'ContactId':_0xd01cde['id'],'closed':![],'OpenchannelAccountId':_0x14705f['id']}})[_0x6487('0x3b')](function(_0x4827d3){if(_0x4827d3){return[_0x4827d3,![]];}return db['OpenchannelInteraction'][_0x6487('0x6c')]({'UserId':_0x4c9fc2[_0x6487('0x63')]['id'],'ContactId':_0xd01cde['id'],'OpenchannelAccountId':_0x14705f['id'],'lastMsgDirection':_0x6487('0xbe'),'firstMsgDirection':_0x6487('0xbe'),'Messages':[_[_0x6487('0x55')](_0x4c9fc2[_0x6487('0x62')],{'read':![],'body':_0x4c9fc2['body'][_0x6487('0x62')],'OpenchannelAccountId':_0x14705f['id'],'UserId':_0x4c9fc2[_0x6487('0x63')]['id'],'ContactId':_0xd01cde['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x6487('0xbf')}]})[_0x6487('0x3b')](function(_0x3bcd8e){return[_0x3bcd8e,!![]];});});}})['spread'](function(_0x1176c6,_0x52566a){if(_0x52566a){return _0x1176c6;}return db[_0x6487('0x9d')][_0x6487('0x6c')](_[_0x6487('0x55')](_0x4c9fc2[_0x6487('0x62')],{'read':![],'body':_0x4c9fc2['body'][_0x6487('0x62')],'OpenchannelAccountId':_0x14705f['id'],'OpenchannelInteractionId':_0x1176c6['id'],'UserId':_0x4c9fc2[_0x6487('0x63')]['id'],'ContactId':_0xd01cde['id']}))['then'](function(_0x5371c2){_0x1176c6['dataValues']['Messages']=[];_0x1176c6['dataValues'][_0x6487('0xbf')]['push'](_0x5371c2[_0x6487('0xc0')]);return _0x1176c6;});});}})[_0x6487('0x3b')](respondWithResult(_0x3f6bb3,null))[_0x6487('0x5d')](handleError(_0x3f6bb3,null));}; \ No newline at end of file +var _0x3ee5=['account','list','applications','ListId','lastName','threadId','OpenchannelInteraction','externalUrl','spread','contact','firstName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','OpenchannelApplication','findAndCountAll','priority','finally','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','limit','Content-Range','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','rows','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','findOne','removeAnswers','ids','notify','openchannel','ValidationError','no\x20available\x20attributes','difference','createdAt','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','updatedAt','DESC','Applications'];(function(_0x122a22,_0x24efe9){var _0x2becc6=function(_0xdbfcb4){while(--_0xdbfcb4){_0x122a22['push'](_0x122a22['shift']());}};_0x2becc6(++_0x24efe9);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x37d72b,_0x307581){_0x37d72b=_0x37d72b-0x0;var _0x5123b1=_0x3ee5[_0x37d72b];return _0x5123b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53ee('0x0'));var zipdir=require(_0x53ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53ee('0x2'));var moment=require(_0x53ee('0x3'));var BPromise=require(_0x53ee('0x4'));var Mustache=require(_0x53ee('0x5'));var util=require(_0x53ee('0x6'));var path=require(_0x53ee('0x7'));var sox=require(_0x53ee('0x8'));var csv=require(_0x53ee('0x9'));var ejs=require(_0x53ee('0xa'));var fs=require('fs');var fs_extra=require(_0x53ee('0xb'));var _=require(_0x53ee('0xc'));var squel=require('squel');var crypto=require(_0x53ee('0xd'));var jsforce=require(_0x53ee('0xe'));var deskjs=require(_0x53ee('0xf'));var toCsv=require(_0x53ee('0x9'));var querystring=require(_0x53ee('0x10'));var Papa=require(_0x53ee('0x11'));var Redis=require(_0x53ee('0x12'));var authService=require(_0x53ee('0x13'));var qs=require(_0x53ee('0x14'));var as=require(_0x53ee('0x15'));var hardwareService=require(_0x53ee('0x16'));var logger=require(_0x53ee('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x53ee('0x18'));var licenseUtil=require(_0x53ee('0x19'));var db=require(_0x53ee('0x1a'))['db'];config[_0x53ee('0x1b')]=_[_0x53ee('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x53ee('0x1d'))(new Redis(config[_0x53ee('0x1b')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x53ee('0x1e'));var client=jayson[_0x53ee('0x1f')][_0x53ee('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x53ee('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3de016,_0x34545b,_0x15a1a5,_0x10a622){return new BPromise(function(_0x2fb3cd,_0x486ede){var _0x13a622=_0x10a622||client;return _0x13a622[_0x53ee('0x21')](_0x3de016,_0x15a1a5)[_0x53ee('0x22')](function(_0x17c3cb){logger[_0x53ee('0x23')](_0x53ee('0x24'),_0x34545b,_0x53ee('0x25'));logger[_0x53ee('0x26')](_0x53ee('0x27'),_0x34545b,_0x53ee('0x25'),JSON[_0x53ee('0x28')](_0x17c3cb));if(_0x17c3cb[_0x53ee('0x29')]){if(_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2a')]===0x1f4){logger['error'](_0x53ee('0x24'),_0x34545b,_0x17c3cb['error']['message']);return _0x486ede(_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2b')]);}logger[_0x53ee('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x34545b,_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2b')]);return _0x2fb3cd(_0x17c3cb[_0x53ee('0x29')][_0x53ee('0x2b')]);}else{logger[_0x53ee('0x23')](_0x53ee('0x24'),_0x34545b,'request\x20sent');_0x2fb3cd(_0x17c3cb['result'][_0x53ee('0x2b')]);}})[_0x53ee('0x2c')](function(_0x2274cf){logger[_0x53ee('0x29')](_0x53ee('0x24'),_0x34545b,_0x2274cf);_0x486ede(_0x2274cf);});});}function respondWithStatusCode(_0x55522c,_0x2b49f9){_0x2b49f9=_0x2b49f9||0xcc;return function(_0x5f3206){if(_0x5f3206){return _0x55522c[_0x53ee('0x2d')](_0x2b49f9);}return _0x55522c['status'](_0x2b49f9)[_0x53ee('0x2e')]();};}function respondWithResult(_0x446f12,_0x11d4fa){_0x11d4fa=_0x11d4fa||0xc8;return function(_0x36ab7c){if(_0x36ab7c){return _0x446f12[_0x53ee('0x2f')](_0x11d4fa)[_0x53ee('0x30')](_0x36ab7c);}};}function respondWithFilteredResult(_0x16062c,_0x3b9ae7){return function(_0x3e92a0){if(_0x3e92a0){var _0x189ef9=typeof _0x3b9ae7[_0x53ee('0x31')]==='undefined'&&typeof _0x3b9ae7[_0x53ee('0x32')]==='undefined';var _0x3ea35e=_0x3e92a0['count'];var _0x92c662=_0x189ef9?0x0:_0x3b9ae7[_0x53ee('0x31')];var _0x2a9e25=_0x189ef9?_0x3e92a0['count']:_0x3b9ae7['offset']+_0x3b9ae7[_0x53ee('0x32')];var _0x156f59;if(_0x2a9e25>=_0x3ea35e){_0x2a9e25=_0x3ea35e;_0x156f59=0xc8;}else{_0x156f59=0xce;}_0x16062c[_0x53ee('0x2f')](_0x156f59);return _0x16062c['set'](_0x53ee('0x33'),_0x92c662+'-'+_0x2a9e25+'/'+_0x3ea35e)['json'](_0x3e92a0);}return null;};}function patchUpdates(_0x4453bb){return function(_0x206f72){try{jsonpatch['apply'](_0x206f72,_0x4453bb,!![]);}catch(_0xd3ed27){return BPromise['reject'](_0xd3ed27);}return _0x206f72[_0x53ee('0x34')]();};}function saveUpdates(_0x95dfce,_0xbaecc0){return function(_0x21e5ca){if(_0x21e5ca){return _0x21e5ca[_0x53ee('0x35')](_0x95dfce)[_0x53ee('0x22')](function(_0x2323eb){return _0x2323eb;});}return null;};}function removeEntity(_0x2138de,_0x411d1f){return function(_0x4770c8){if(_0x4770c8){return _0x4770c8[_0x53ee('0x36')]()[_0x53ee('0x22')](function(){var _0xa83513=_0x4770c8[_0x53ee('0x37')]({'plain':!![]});var _0x3f8821=_0x53ee('0x38');return db[_0x53ee('0x39')][_0x53ee('0x36')]({'where':{'type':_0x3f8821,'resourceId':_0xa83513['id']}})['then'](function(){return _0x4770c8;});})[_0x53ee('0x22')](function(){_0x2138de[_0x53ee('0x2f')](0xcc)[_0x53ee('0x2e')]();});}};}function handleEntityNotFound(_0x501595,_0x58584f){return function(_0x1445d2){if(!_0x1445d2){_0x501595[_0x53ee('0x2d')](0x194);}return _0x1445d2;};}function handleError(_0xd8e631,_0x5bb6f2){_0x5bb6f2=_0x5bb6f2||0x1f4;return function(_0x22b913){logger[_0x53ee('0x29')](_0x22b913[_0x53ee('0x3a')]);if(_0x22b913[_0x53ee('0x3b')]){delete _0x22b913['name'];}_0xd8e631[_0x53ee('0x2f')](_0x5bb6f2)['send'](_0x22b913);};}exports[_0x53ee('0x3c')]=function(_0x477cbf,_0x394fc9){var _0x5ee378={'include':[{'model':db[_0x53ee('0x3d')],'as':_0x53ee('0x3e')}]},_0x29af8d={},_0x42e0e4={'count':0x0,'rows':[]};var _0x4bf3b3=_[_0x53ee('0x3f')](db[_0x53ee('0x40')][_0x53ee('0x41')],function(_0x2eda26){return{'name':_0x2eda26[_0x53ee('0x42')],'type':_0x2eda26[_0x53ee('0x43')]['key']};});_0x29af8d['model']=_[_0x53ee('0x3f')](_0x4bf3b3,_0x53ee('0x3b'));_0x29af8d[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x477cbf[_0x53ee('0x44')]);_0x29af8d[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x29af8d[_0x53ee('0x48')],_0x29af8d[_0x53ee('0x44')]);_0x5ee378['attributes']=_[_0x53ee('0x47')](_0x29af8d['model'],qs[_0x53ee('0x49')](_0x477cbf[_0x53ee('0x44')][_0x53ee('0x49')]));_0x5ee378['attributes']=_0x5ee378[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x5ee378['attributes']:_0x29af8d[_0x53ee('0x48')];if(!_0x477cbf[_0x53ee('0x44')][_0x53ee('0x4c')](_0x53ee('0x4d'))){_0x5ee378[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x477cbf[_0x53ee('0x44')][_0x53ee('0x32')]);_0x5ee378[_0x53ee('0x31')]=qs[_0x53ee('0x31')](_0x477cbf[_0x53ee('0x44')][_0x53ee('0x31')]);}_0x5ee378[_0x53ee('0x4e')]=qs[_0x53ee('0x4f')](_0x477cbf['query'][_0x53ee('0x4f')]);_0x5ee378[_0x53ee('0x50')]=qs[_0x53ee('0x46')](_[_0x53ee('0x51')](_0x477cbf['query'],_0x29af8d[_0x53ee('0x46')]),_0x4bf3b3);if(_0x477cbf[_0x53ee('0x44')][_0x53ee('0x52')]){_0x5ee378[_0x53ee('0x50')]=_['merge'](_0x5ee378[_0x53ee('0x50')],{'$or':_['map'](_0x4bf3b3,function(_0x55e839){if(_0x55e839[_0x53ee('0x43')]!==_0x53ee('0x53')){var _0x3de4bb={};_0x3de4bb[_0x55e839[_0x53ee('0x3b')]]={'$like':'%'+_0x477cbf[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x3de4bb;}})});}_0x5ee378=_[_0x53ee('0x54')]({},_0x5ee378,_0x477cbf['options']);var _0x5da011={'where':_0x5ee378[_0x53ee('0x50')]};return db[_0x53ee('0x40')][_0x53ee('0x55')](_0x5da011)[_0x53ee('0x22')](function(_0x4ddfec){_0x42e0e4[_0x53ee('0x55')]=_0x4ddfec;if(_0x477cbf[_0x53ee('0x44')][_0x53ee('0x56')]){_0x5ee378[_0x53ee('0x57')]=[{'all':!![]}];}return db[_0x53ee('0x40')][_0x53ee('0x58')](_0x5ee378);})['then'](function(_0x29ecdf){_0x42e0e4['rows']=_0x29ecdf;return _0x42e0e4;})['then'](respondWithFilteredResult(_0x394fc9,_0x5ee378))[_0x53ee('0x2c')](handleError(_0x394fc9,null));};exports[_0x53ee('0x59')]=function(_0x57f7e4,_0x131b85){var _0xccc92d={'raw':![],'where':{'id':_0x57f7e4[_0x53ee('0x5a')]['id']},'include':[{'model':db[_0x53ee('0x3d')],'as':_0x53ee('0x3e')}]},_0xda2c9c={};_0xda2c9c[_0x53ee('0x48')]=_[_0x53ee('0x45')](db[_0x53ee('0x40')][_0x53ee('0x41')]);_0xda2c9c['query']=_[_0x53ee('0x45')](_0x57f7e4[_0x53ee('0x44')]);_0xda2c9c['filters']=_[_0x53ee('0x47')](_0xda2c9c['model'],_0xda2c9c[_0x53ee('0x44')]);_0xccc92d[_0x53ee('0x4a')]=_['intersection'](_0xda2c9c['model'],qs[_0x53ee('0x49')](_0x57f7e4[_0x53ee('0x44')]['fields']));_0xccc92d[_0x53ee('0x4a')]=_0xccc92d[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0xccc92d[_0x53ee('0x4a')]:_0xda2c9c[_0x53ee('0x48')];if(_0x57f7e4[_0x53ee('0x44')][_0x53ee('0x56')]){_0xccc92d[_0x53ee('0x57')]=[{'all':!![]}];}_0xccc92d=_['merge']({},_0xccc92d,_0x57f7e4[_0x53ee('0x5b')]);return db['OpenchannelAccount'][_0x53ee('0x5c')](_0xccc92d)[_0x53ee('0x22')](handleEntityNotFound(_0x131b85,null))[_0x53ee('0x22')](respondWithResult(_0x131b85,null))[_0x53ee('0x2c')](handleError(_0x131b85,null));};exports[_0x53ee('0x5d')]=function(_0x47e0af,_0xb4f489){return db['OpenchannelAccount']['create'](_0x47e0af[_0x53ee('0x5e')],{})[_0x53ee('0x22')](function(_0x3b3c77){var _0x1a2ab1=_0x47e0af[_0x53ee('0x5f')][_0x53ee('0x37')]({'plain':!![]});if(!_0x1a2ab1)throw new Error(_0x53ee('0x60'));if(_0x1a2ab1[_0x53ee('0x61')]===_0x53ee('0x5f')){var _0x3762e5=_0x3b3c77[_0x53ee('0x37')]({'plain':!![]});var _0x101a56=_0x53ee('0x38');return db[_0x53ee('0x62')][_0x53ee('0x5c')]({'where':{'name':_0x101a56,'userProfileId':_0x1a2ab1[_0x53ee('0x63')]},'raw':!![]})['then'](function(_0x1091f3){if(_0x1091f3&&_0x1091f3[_0x53ee('0x64')]===0x0){return db[_0x53ee('0x39')][_0x53ee('0x5d')]({'name':_0x3762e5[_0x53ee('0x3b')],'resourceId':_0x3762e5['id'],'type':_0x1091f3[_0x53ee('0x3b')],'sectionId':_0x1091f3['id']},{})[_0x53ee('0x22')](function(){return _0x3b3c77;});}else{return _0x3b3c77;}})['catch'](function(_0x2e70ee){logger[_0x53ee('0x29')](_0x53ee('0x65'),_0x2e70ee);throw _0x2e70ee;});}return _0x3b3c77;})[_0x53ee('0x22')](respondWithResult(_0xb4f489,0xc9))['catch'](handleError(_0xb4f489,null));};exports['update']=function(_0x56562d,_0x3e2b55){if(_0x56562d[_0x53ee('0x5e')]['id']){delete _0x56562d[_0x53ee('0x5e')]['id'];}return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x56562d[_0x53ee('0x5a')]['id']},'include':[{'model':db[_0x53ee('0x3d')],'as':_0x53ee('0x3e')}]})[_0x53ee('0x22')](handleEntityNotFound(_0x3e2b55,null))['then'](saveUpdates(_0x56562d[_0x53ee('0x5e')],null))['then'](respondWithResult(_0x3e2b55,null))[_0x53ee('0x2c')](handleError(_0x3e2b55,null));};exports[_0x53ee('0x36')]=function(_0x59766f,_0x256221){return db['OpenchannelAccount']['find']({'where':{'id':_0x59766f[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x256221,null))[_0x53ee('0x22')](removeEntity(_0x256221,null))[_0x53ee('0x2c')](handleError(_0x256221,null));};exports[_0x53ee('0x66')]=function(_0x162feb,_0x537680){return db[_0x53ee('0x40')][_0x53ee('0x66')]()[_0x53ee('0x22')](respondWithResult(_0x537680,null))[_0x53ee('0x2c')](handleError(_0x537680,null));};exports['addDisposition']=function(_0x41d280,_0x25b479,_0x14e4ed){if(_0x41d280[_0x53ee('0x5e')]['id']){delete _0x41d280[_0x53ee('0x5e')]['id'];}return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x41d280['params']['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x25b479,null))[_0x53ee('0x22')](function(_0x4d446d){if(_0x4d446d){_0x41d280[_0x53ee('0x5e')]['OpenchannelAccountId']=_0x4d446d['id'];return db[_0x53ee('0x67')][_0x53ee('0x5d')](_0x41d280[_0x53ee('0x5e')]);}})[_0x53ee('0x22')](respondWithResult(_0x25b479,null))[_0x53ee('0x2c')](handleError(_0x25b479,null));};exports[_0x53ee('0x68')]=function(_0x4aca92,_0xe7881a,_0x4d060f){var _0x49f405={'raw':![],'where':{}};var _0x387a45={};var _0x3f0f70={'count':0x0,'rows':[]};return db[_0x53ee('0x40')]['findOne']({'where':{'id':_0x4aca92['params']['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0xe7881a,null))[_0x53ee('0x22')](function(_0x2c778e){if(_0x2c778e){_0x387a45[_0x53ee('0x48')]=_[_0x53ee('0x45')](db[_0x53ee('0x67')][_0x53ee('0x41')]);_0x387a45[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x4aca92[_0x53ee('0x44')]);_0x387a45[_0x53ee('0x46')]=_['intersection'](_0x387a45['model'],_0x387a45[_0x53ee('0x44')]);_0x49f405[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x387a45[_0x53ee('0x48')],qs['fields'](_0x4aca92[_0x53ee('0x44')][_0x53ee('0x49')]));_0x49f405[_0x53ee('0x4a')]=_0x49f405[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x49f405[_0x53ee('0x4a')]:_0x387a45[_0x53ee('0x48')];if(!_0x4aca92[_0x53ee('0x44')][_0x53ee('0x4c')](_0x53ee('0x4d'))){_0x49f405[_0x53ee('0x32')]=qs['limit'](_0x4aca92[_0x53ee('0x44')]['limit']);_0x49f405[_0x53ee('0x31')]=qs['offset'](_0x4aca92[_0x53ee('0x44')]['offset']);}_0x49f405[_0x53ee('0x4e')]=qs['sort'](_0x4aca92[_0x53ee('0x44')][_0x53ee('0x4f')]);_0x49f405[_0x53ee('0x50')]=qs['filters'](_[_0x53ee('0x51')](_0x4aca92[_0x53ee('0x44')],_0x387a45[_0x53ee('0x46')]));_0x49f405[_0x53ee('0x50')]['OpenchannelAccountId']=_0x2c778e['id'];if(_0x4aca92[_0x53ee('0x44')][_0x53ee('0x52')]){_0x49f405[_0x53ee('0x50')]=_['merge'](_0x49f405[_0x53ee('0x50')],{'$or':_[_0x53ee('0x3f')](_0x49f405[_0x53ee('0x4a')],function(_0x764eed){var _0x11426b={};_0x11426b[_0x764eed]={'$like':'%'+_0x4aca92[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x11426b;})});}_0x49f405=_[_0x53ee('0x54')]({},_0x49f405,_0x4aca92[_0x53ee('0x5b')]);return db['Disposition']['count']({'where':_0x49f405[_0x53ee('0x50')]})['then'](function(_0x6e31f5){_0x3f0f70[_0x53ee('0x55')]=_0x6e31f5;if(_0x4aca92[_0x53ee('0x44')][_0x53ee('0x56')]){_0x49f405[_0x53ee('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x53ee('0x58')](_0x49f405);})[_0x53ee('0x22')](function(_0x3ad284){_0x3f0f70[_0x53ee('0x69')]=_0x3ad284;return _0x3f0f70;});}})['then'](respondWithFilteredResult(_0xe7881a,_0x49f405))['catch'](handleError(_0xe7881a,null));};exports[_0x53ee('0x6a')]=function(_0x5e7b0d,_0x26a83d,_0x150b9f){return db['OpenchannelAccount'][_0x53ee('0x5c')]({'where':{'id':_0x5e7b0d[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x26a83d,null))['then'](function(_0x181ad0){if(_0x181ad0){return _0x181ad0[_0x53ee('0x6a')](_0x5e7b0d[_0x53ee('0x44')]['ids']);}})[_0x53ee('0x22')](respondWithStatusCode(_0x26a83d,null))[_0x53ee('0x2c')](handleError(_0x26a83d,null));};exports[_0x53ee('0x6b')]=function(_0x3612c2,_0x1db0dc,_0x4f1b11){if(_0x3612c2[_0x53ee('0x5e')]['id']){delete _0x3612c2[_0x53ee('0x5e')]['id'];}return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x3612c2[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x1db0dc,null))[_0x53ee('0x22')](function(_0x471b6c){if(_0x471b6c){_0x3612c2[_0x53ee('0x5e')][_0x53ee('0x6c')]=_0x471b6c['id'];return db[_0x53ee('0x6d')]['create'](_0x3612c2[_0x53ee('0x5e')]);}})[_0x53ee('0x22')](respondWithResult(_0x1db0dc,null))[_0x53ee('0x2c')](handleError(_0x1db0dc,null));};exports[_0x53ee('0x6e')]=function(_0x2c4c40,_0x4c85d9,_0x5565a6){var _0x2b84a8={'raw':![],'where':{}};var _0x1b5ceb={};var _0x4abeb7={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x53ee('0x6f')]({'where':{'id':_0x2c4c40[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c85d9,null))[_0x53ee('0x22')](function(_0x3f450d){if(_0x3f450d){_0x1b5ceb[_0x53ee('0x48')]=_['keys'](db[_0x53ee('0x6d')]['rawAttributes']);_0x1b5ceb[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x2c4c40[_0x53ee('0x44')]);_0x1b5ceb[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x1b5ceb['model'],_0x1b5ceb['query']);_0x2b84a8[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x1b5ceb[_0x53ee('0x48')],qs[_0x53ee('0x49')](_0x2c4c40[_0x53ee('0x44')]['fields']));_0x2b84a8['attributes']=_0x2b84a8[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x2b84a8[_0x53ee('0x4a')]:_0x1b5ceb[_0x53ee('0x48')];if(!_0x2c4c40[_0x53ee('0x44')]['hasOwnProperty'](_0x53ee('0x4d'))){_0x2b84a8[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x2c4c40[_0x53ee('0x44')][_0x53ee('0x32')]);_0x2b84a8['offset']=qs['offset'](_0x2c4c40[_0x53ee('0x44')][_0x53ee('0x31')]);}_0x2b84a8['order']=qs[_0x53ee('0x4f')](_0x2c4c40['query'][_0x53ee('0x4f')]);_0x2b84a8[_0x53ee('0x50')]=qs['filters'](_[_0x53ee('0x51')](_0x2c4c40[_0x53ee('0x44')],_0x1b5ceb[_0x53ee('0x46')]));_0x2b84a8['where'][_0x53ee('0x6c')]=_0x3f450d['id'];if(_0x2c4c40[_0x53ee('0x44')][_0x53ee('0x52')]){_0x2b84a8['where']=_[_0x53ee('0x54')](_0x2b84a8[_0x53ee('0x50')],{'$or':_[_0x53ee('0x3f')](_0x2b84a8[_0x53ee('0x4a')],function(_0x526218){var _0x4c39f1={};_0x4c39f1[_0x526218]={'$like':'%'+_0x2c4c40['query'][_0x53ee('0x52')]+'%'};return _0x4c39f1;})});}_0x2b84a8=_[_0x53ee('0x54')]({},_0x2b84a8,_0x2c4c40[_0x53ee('0x5b')]);return db['CannedAnswer'][_0x53ee('0x55')]({'where':_0x2b84a8[_0x53ee('0x50')]})[_0x53ee('0x22')](function(_0x2d9d4c){_0x4abeb7['count']=_0x2d9d4c;if(_0x2c4c40[_0x53ee('0x44')]['includeAll']){_0x2b84a8[_0x53ee('0x57')]=[{'all':!![]}];}return db[_0x53ee('0x6d')]['findAll'](_0x2b84a8);})['then'](function(_0x1a29e4){_0x4abeb7[_0x53ee('0x69')]=_0x1a29e4;return _0x4abeb7;});}})['then'](respondWithFilteredResult(_0x4c85d9,_0x2b84a8))[_0x53ee('0x2c')](handleError(_0x4c85d9,null));};exports[_0x53ee('0x70')]=function(_0x454b51,_0x281e2d,_0x30d4b3){return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x454b51[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x281e2d,null))[_0x53ee('0x22')](function(_0x586768){if(_0x586768){return _0x586768[_0x53ee('0x70')](_0x454b51[_0x53ee('0x44')][_0x53ee('0x71')]);}})[_0x53ee('0x22')](respondWithStatusCode(_0x281e2d,null))[_0x53ee('0x2c')](handleError(_0x281e2d,null));};exports[_0x53ee('0x72')]=function(_0x1ba807,_0x25b31c,_0x19f9f5){var _0x31542e={'body':_0x1ba807['body'],'channel':_0x53ee('0x73')};var _0x68330f=[];var _0x2c1f6b=[];var _0x115b5b={};var _0xd8199d=![];return db['CmContact'][_0x53ee('0x66')]()[_0x53ee('0x22')](function(_0x3bfd7c){if(!_0x3bfd7c){throw new db['Sequelize'][(_0x53ee('0x74'))](_0x53ee('0x75'));}_0x68330f=_[_0x53ee('0x76')](_['keys'](_0x3bfd7c),[_0x53ee('0x77'),'updatedAt']);_0x2c1f6b=_[_0x53ee('0x76')](_['keys'](_0x3bfd7c),[_0x53ee('0x77'),'updatedAt','CompanyId','ListId']);if(_0x1ba807[_0x53ee('0x5e')]['id']){delete _0x1ba807[_0x53ee('0x5e')]['id'];}if(_[_0x53ee('0x78')](_0x1ba807[_0x53ee('0x5e')]['from'])){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7a'));}if(_[_0x53ee('0x78')](_0x1ba807[_0x53ee('0x5e')]['body'])||_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x5e')]===''){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7b'));}if(_['isNil'](_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7c')])){throw new db[(_0x53ee('0x79'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c1f6b);}if(!_[_0x53ee('0x7d')](_0x2c1f6b,_0x1ba807['body']['mapKey'])){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7e')+_0x2c1f6b);}_0x115b5b[_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7c')]]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7f')];})[_0x53ee('0x22')](function(){return db['OpenchannelAccount'][_0x53ee('0x5c')]({'where':{'id':_0x1ba807[_0x53ee('0x5a')]['id']},'include':[{'model':db[_0x53ee('0x80')],'as':_0x53ee('0x81'),'include':[{'model':db[_0x53ee('0x82')],'as':_0x53ee('0x83'),'where':_0x115b5b,'limit':0x1,'order':[[_0x53ee('0x84'),_0x53ee('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0x53ee('0x86')}]});})['then'](handleEntityNotFound(_0x25b31c,null))[_0x53ee('0x22')](function(_0x3cd597){if(_0x3cd597&&_0x3cd597['List']){_0x31542e[_0x53ee('0x87')]=_0x3cd597;_0x31542e['applications']=_0x3cd597[_0x53ee('0x86')];_0x31542e[_0x53ee('0x88')]=_0x3cd597[_0x53ee('0x81')];_0x31542e[_0x53ee('0x89')]=_['orderBy'](_0x31542e[_0x53ee('0x89')],['priority'],['asc']);if(_0x31542e[_0x53ee('0x87')]['Applications']){delete _0x31542e['account'][_0x53ee('0x86')];}if(_0x31542e[_0x53ee('0x87')]['List']&&_0x31542e['account'][_0x53ee('0x81')]['Contacts'][_0x53ee('0x4b')]){return _0x31542e[_0x53ee('0x87')]['List']['Contacts'][0x0];}var _0x2f6a25=_[_0x53ee('0x1c')](_0x1ba807[_0x53ee('0x5e')],{'firstName':_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7f')],'ListId':_0x3cd597[_0x53ee('0x8a')]});_0x2f6a25[_0x1ba807[_0x53ee('0x5e')]['mapKey']]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x7f')];return db['CmContact'][_0x53ee('0x5d')](_0x2f6a25,{'fields':_0x68330f,'raw':!![]});}})[_0x53ee('0x22')](handleEntityNotFound(_0x25b31c,null))['then'](function(_0x57af6b){_0x31542e['contact']=_0x57af6b;if(_0x57af6b){var _0x554550={'ContactId':_0x57af6b['id'],'OpenchannelAccountId':_0x1ba807[_0x53ee('0x5a')]['id'],'from':(_0x57af6b['firstName']||'')+'\x20'+(_0x57af6b[_0x53ee('0x8b')]||'')};var _0x31aceb={'OpenchannelAccountId':_0x1ba807[_0x53ee('0x5a')]['id'],'closed':![]};if(_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x8c')]){_0x31aceb[_0x53ee('0x8c')]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x8c')];return db[_0x53ee('0x8d')][_0x53ee('0x5c')]({'where':_0x31aceb})[_0x53ee('0x22')](function(_0x17290c){if(_0x17290c){return[_0x17290c,![]];}_0x554550[_0x53ee('0x8c')]=_0x1ba807['body']['threadId'];_0x554550[_0x53ee('0x8e')]=_0x1ba807['body']['externalUrl'];return db[_0x53ee('0x8d')]['create'](_0x554550)[_0x53ee('0x22')](function(_0x35a317){return[_0x35a317,!![]];});});}else{_0x31aceb[_0x53ee('0x8c')]=null;}_0x31aceb['ContactId']=_0x57af6b['id'];return db[_0x53ee('0x8d')][_0x53ee('0x5c')]({'where':_0x31aceb})['then'](function(_0x20d7c9){if(_0x20d7c9){return[_0x20d7c9,![]];}return db[_0x53ee('0x8d')][_0x53ee('0x5d')](_0x554550)[_0x53ee('0x22')](function(_0x435a2a){return[_0x435a2a,!![]];});});}})[_0x53ee('0x8f')](function(_0x281d91,_0x5c9a3e){if(_0x281d91){_0xd8199d=_0x5c9a3e;if(!_0x5c9a3e){var _0x345ccc={'from':(_0x31542e[_0x53ee('0x90')][_0x53ee('0x91')]||'')+'\x20'+(_0x31542e[_0x53ee('0x90')][_0x53ee('0x8b')]||'')};if(_0x1ba807['body'][_0x53ee('0x8c')]&&_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x92')]&&_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x8c')]!=_0x1ba807['body'][_0x53ee('0x92')]){_0x345ccc[_0x53ee('0x8c')]=_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x92')];}return _0x281d91[_0x53ee('0x35')](_0x345ccc);}else{return _0x281d91;}}})[_0x53ee('0x22')](function(_0x159f23){_0x31542e[_0x53ee('0x93')]=_0x159f23['get']({'plain':!![]});_0x31542e['interaction'][_0x53ee('0x94')]=_0xd8199d;if(_0x31542e[_0x53ee('0x93')][_0x53ee('0x94')]){if(_0x31542e['account'][_0x53ee('0x95')]){_0x31542e['applications'][_0x53ee('0x96')]({'id':0x0,'priority':_0x31542e[_0x53ee('0x89')]['length']+0x1,'app':'close','appdata':_0x53ee('0x97'),'interval':_0x53ee('0x98')});}}return db[_0x53ee('0x99')][_0x53ee('0x5d')]({'body':_0x1ba807[_0x53ee('0x5e')][_0x53ee('0x5e')],'OpenchannelAccountId':_0x1ba807[_0x53ee('0x5a')]['id'],'OpenchannelInteractionId':_0x159f23['id'],'direction':'in','ContactId':_0x31542e['contact']['id'],'AttachmentId':_0x1ba807['body'][_0x53ee('0x9a')]});})[_0x53ee('0x22')](function(_0x1723e2){_0x31542e['message']=_0x1723e2;if(_0x31542e['interaction'][_0x53ee('0x9b')]){return db[_0x53ee('0x9c')][_0x53ee('0x5c')]({'attributes':['id',_0x53ee('0x3b')],'where':{'id':_0x31542e[_0x53ee('0x93')][_0x53ee('0x9b')]}})[_0x53ee('0x22')](function(_0x2697a9){if(_0x2697a9){_0x31542e[_0x53ee('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0x53ee('0x9d'),'appdata':_0x2697a9[_0x53ee('0x3b')]+','+(_0x31542e[_0x53ee('0x87')]['waitForTheAssignedAgent']||0xa),'interval':_0x53ee('0x98')});_0x31542e[_0x53ee('0x9e')]=![];}return respondWithRpcPromise('Start','startRouting',_0x31542e);});}return respondWithRpcPromise('Start',_0x53ee('0x9f'),_0x31542e);})[_0x53ee('0x22')](function(_0x333dca){respondWithRpcPromise(_0x53ee('0xa0'),'EventManager',{'event':_0x53ee('0x72'),'message':_0x333dca},client9002);return _0x333dca;})['then'](respondWithResult(_0x25b31c,null))[_0x53ee('0x2c')](handleError(_0x25b31c,null));};exports[_0x53ee('0xa1')]=function(_0x326e77,_0x303896){var _0x41ee59=_0x326e77[_0x53ee('0x5a')]['id'];var _0x3fd753=_0x326e77['body'];var _0x178f38=0xc8;var _0x112c4a=null;return db[_0x53ee('0xa2')][_0x53ee('0xa3')]({'isolationLevel':db[_0x53ee('0xa2')][_0x53ee('0xa4')][_0x53ee('0xa5')][_0x53ee('0xa6')]},function(_0x3563b4){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x41ee59},'transaction':_0x3563b4})[_0x53ee('0x22')](function(_0x3bfc10){if(_0x3bfc10){return db['OpenchannelApplication'][_0x53ee('0x36')]({'where':{'OpenchannelAccountId':_0x41ee59},'transaction':_0x3563b4})[_0x53ee('0x22')](function(){var _0x520a2e=_[_0x53ee('0x3f')](_0x3fd753,function(_0x59d9d3){_0x59d9d3[_0x53ee('0x6c')]=_0x41ee59;return _0x59d9d3;});return db['OpenchannelApplication'][_0x53ee('0xa7')](_0x520a2e,{'transaction':_0x3563b4});});}else{_0x178f38=0x194;_0x112c4a=[];}});})[_0x53ee('0x22')](function(){if(_0x178f38!==0x194){return db[_0x53ee('0xa8')][_0x53ee('0xa9')]({'where':{'OpenchannelAccountId':_0x41ee59},'order':_0x53ee('0xaa')})[_0x53ee('0x22')](function(_0x522d01){_0x112c4a=_0x522d01;});}})['catch'](function(_0x317943){_0x178f38=0x1f4;logger[_0x53ee('0x29')](_0x317943[_0x53ee('0x3a')]);if(_0x317943[_0x53ee('0x3b')]){delete _0x317943[_0x53ee('0x3b')];}_0x112c4a=_0x317943;})[_0x53ee('0xab')](function(){if(_0x112c4a===null){_0x303896[_0x53ee('0x2d')](_0x178f38);}else{if(_0x178f38===0x1f4){_0x303896[_0x53ee('0x2f')](_0x178f38)[_0x53ee('0xac')](_0x112c4a);}else{_0x303896['status'](_0x178f38)[_0x53ee('0x30')](_0x112c4a);}}});};exports[_0x53ee('0xad')]=function(_0x47c3d3,_0x10c406,_0x51cf25){var _0x3769a3={};var _0x2bfdc3={};var _0x46ca06;var _0x4d2da2;return db[_0x53ee('0x40')]['findOne']({'where':{'id':_0x47c3d3[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x10c406,null))[_0x53ee('0x22')](function(_0x5cc893){if(_0x5cc893){_0x46ca06=_0x5cc893;_0x2bfdc3['model']=_['keys'](db[_0x53ee('0xa8')][_0x53ee('0x41')]);_0x2bfdc3[_0x53ee('0x44')]=_['keys'](_0x47c3d3[_0x53ee('0x44')]);_0x2bfdc3[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x2bfdc3[_0x53ee('0x48')],_0x2bfdc3['query']);_0x3769a3[_0x53ee('0x4a')]=_['intersection'](_0x2bfdc3['model'],qs[_0x53ee('0x49')](_0x47c3d3[_0x53ee('0x44')]['fields']));_0x3769a3[_0x53ee('0x4a')]=_0x3769a3[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x3769a3['attributes']:_0x2bfdc3[_0x53ee('0x48')];_0x3769a3[_0x53ee('0x4e')]=qs[_0x53ee('0x4f')](_0x47c3d3['query']['sort']);_0x3769a3['where']=qs[_0x53ee('0x46')](_['pick'](_0x47c3d3[_0x53ee('0x44')],_0x2bfdc3[_0x53ee('0x46')]));if(_0x47c3d3[_0x53ee('0x44')][_0x53ee('0x52')]){_0x3769a3[_0x53ee('0x50')]=_[_0x53ee('0x54')](_0x3769a3[_0x53ee('0x50')],{'$or':_[_0x53ee('0x3f')](_0x3769a3['attributes'],function(_0x9f30a6){var _0x3a0f48={};_0x3a0f48[_0x9f30a6]={'$like':'%'+_0x47c3d3[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x3a0f48;})});}_0x3769a3=_[_0x53ee('0x54')]({},_0x3769a3,_0x47c3d3[_0x53ee('0x5b')]);return _0x46ca06['getApplications'](_0x3769a3);}})[_0x53ee('0x22')](function(_0x4fdff6){if(_0x4fdff6){_0x4d2da2=_0x4fdff6['length'];if(!_0x47c3d3[_0x53ee('0x44')][_0x53ee('0x4c')]('nolimit')){_0x3769a3[_0x53ee('0x32')]=qs['limit'](_0x47c3d3['query'][_0x53ee('0x32')]);_0x3769a3[_0x53ee('0x31')]=qs[_0x53ee('0x31')](_0x47c3d3[_0x53ee('0x44')]['offset']);}return _0x46ca06[_0x53ee('0xad')](_0x3769a3);}})[_0x53ee('0x22')](function(_0x2ea33d){if(_0x2ea33d){return _0x2ea33d?{'count':_0x4d2da2,'rows':_0x2ea33d}:null;}})[_0x53ee('0x22')](respondWithResult(_0x10c406,null))['catch'](handleError(_0x10c406,null));};exports[_0x53ee('0xae')]=function(_0x450801,_0x3cdee3,_0x1b9413){var _0x251377={'raw':![],'where':{}};var _0x1fa9b6={};var _0x2a9dcb={'count':0x0,'rows':[]};return db[_0x53ee('0x40')][_0x53ee('0x6f')]({'where':{'id':_0x450801[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3cdee3,null))[_0x53ee('0x22')](function(_0xf2668a){if(_0xf2668a){_0x1fa9b6['model']=_['keys'](db[_0x53ee('0x8d')][_0x53ee('0x41')]);_0x1fa9b6[_0x53ee('0x44')]=_[_0x53ee('0x45')](_0x450801[_0x53ee('0x44')]);_0x1fa9b6[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x1fa9b6[_0x53ee('0x48')],_0x1fa9b6[_0x53ee('0x44')]);_0x251377[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x1fa9b6['model'],qs[_0x53ee('0x49')](_0x450801['query'][_0x53ee('0x49')]));_0x251377[_0x53ee('0x4a')]=_0x251377[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x251377['attributes']:_0x1fa9b6[_0x53ee('0x48')];if(!_0x450801['query']['hasOwnProperty'](_0x53ee('0x4d'))){_0x251377[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x450801['query']['limit']);_0x251377['offset']=qs['offset'](_0x450801[_0x53ee('0x44')][_0x53ee('0x31')]);}_0x251377[_0x53ee('0x4e')]=qs[_0x53ee('0x4f')](_0x450801['query']['sort']);_0x251377[_0x53ee('0x50')]=qs[_0x53ee('0x46')](_[_0x53ee('0x51')](_0x450801['query'],_0x1fa9b6['filters']));_0x251377['where']['OpenchannelAccountId']=_0xf2668a['id'];if(_0x450801[_0x53ee('0x44')]['filter']){_0x251377['where']=_[_0x53ee('0x54')](_0x251377[_0x53ee('0x50')],{'$or':_['map'](_0x251377['attributes'],function(_0x42d271){var _0x3da21d={};_0x3da21d[_0x42d271]={'$like':'%'+_0x450801[_0x53ee('0x44')][_0x53ee('0x52')]+'%'};return _0x3da21d;})});}_0x251377=_[_0x53ee('0x54')]({},_0x251377,_0x450801[_0x53ee('0x5b')]);return db[_0x53ee('0x8d')][_0x53ee('0x55')]({'where':_0x251377['where']})[_0x53ee('0x22')](function(_0x1acd6a){_0x2a9dcb[_0x53ee('0x55')]=_0x1acd6a;if(_0x450801['query'][_0x53ee('0x56')]){_0x251377[_0x53ee('0x57')]=[{'model':db['CmContact'],'as':_0x53ee('0xaf'),'required':![]},{'model':db['User'],'as':_0x53ee('0xb0'),'attributes':[_0x53ee('0x3b'),_0x53ee('0xb1'),_0x53ee('0xb2')],'required':![]},{'model':db['Tag'],'as':_0x53ee('0xb3'),'attributes':['id','name','color'],'where':_0x450801[_0x53ee('0x44')][_0x53ee('0xb4')]?{'id':_0x450801[_0x53ee('0x44')][_0x53ee('0xb4')]}:undefined,'required':_0x450801[_0x53ee('0x44')][_0x53ee('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x53ee('0x58')](_0x251377);})['then'](function(_0x221335){_0x2a9dcb[_0x53ee('0x69')]=_0x221335;return _0x2a9dcb;});}})['then'](respondWithFilteredResult(_0x3cdee3,_0x251377))[_0x53ee('0x2c')](handleError(_0x3cdee3,null));};exports[_0x53ee('0xb5')]=function(_0x2cd346,_0x27bcc9,_0x1eb6b5){return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x2cd346[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x27bcc9,null))['then'](function(_0x44e018){if(_0x44e018){return _0x44e018['addAgents'](_0x2cd346[_0x53ee('0x5e')][_0x53ee('0x71')],_['omit'](_0x2cd346['body'],[_0x53ee('0x71'),'id'])||{})[_0x53ee('0x8f')](function(_0x372ca7){for(var _0x1b761f=0x0;_0x1b761f<_0x2cd346['body'][_0x53ee('0x71')][_0x53ee('0x4b')];_0x1b761f+=0x1){socket[_0x53ee('0xb6')](_0x53ee('0xb7'),{'UserId':Number(_0x2cd346[_0x53ee('0x5e')][_0x53ee('0x71')][_0x1b761f]),'OpenchannelAccountId':Number(_0x2cd346[_0x53ee('0x5a')]['id'])});}return _0x372ca7;});}})[_0x53ee('0x22')](respondWithResult(_0x27bcc9,null))['catch'](handleError(_0x27bcc9,null));};exports[_0x53ee('0xb8')]=function(_0x3874dc,_0x48c8e2,_0x32da3e){return db[_0x53ee('0x40')][_0x53ee('0x5c')]({'where':{'id':_0x3874dc[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x48c8e2,null))[_0x53ee('0x22')](function(_0x3faa14){if(_0x3faa14){return _0x3faa14[_0x53ee('0xb8')](_0x3874dc[_0x53ee('0x44')]['ids'])[_0x53ee('0x22')](function(){if(_[_0x53ee('0xb9')](_0x3874dc['query'][_0x53ee('0x71')])){for(var _0xf8834b=0x0;_0xf8834b<_0x3874dc[_0x53ee('0x44')]['ids'][_0x53ee('0x4b')];_0xf8834b+=0x1){socket[_0x53ee('0xb6')](_0x53ee('0xba'),{'UserId':Number(_0x3874dc[_0x53ee('0x44')][_0x53ee('0x71')][_0xf8834b]),'OpenchannelAccountId':Number(_0x3874dc[_0x53ee('0x5a')]['id'])});}}else{socket[_0x53ee('0xb6')](_0x53ee('0xba'),{'UserId':Number(_0x3874dc[_0x53ee('0x44')][_0x53ee('0x71')]),'OpenchannelAccountId':Number(_0x3874dc[_0x53ee('0x5a')]['id'])});}});}})[_0x53ee('0x22')](respondWithStatusCode(_0x48c8e2,null))[_0x53ee('0x2c')](handleError(_0x48c8e2,null));};exports['getAgents']=function(_0x5e9bcf,_0x330d32,_0x201738){var _0x1816ec={};var _0x44d813={};var _0x33b8d6;var _0x4378ac;return db[_0x53ee('0x40')][_0x53ee('0x6f')]({'where':{'id':_0x5e9bcf[_0x53ee('0x5a')]['id']}})['then'](handleEntityNotFound(_0x330d32,null))[_0x53ee('0x22')](function(_0x620c97){if(_0x620c97){_0x33b8d6=_0x620c97;_0x44d813[_0x53ee('0x48')]=_[_0x53ee('0x45')](db[_0x53ee('0x9c')][_0x53ee('0x41')]);_0x44d813['query']=_[_0x53ee('0x45')](_0x5e9bcf['query']);_0x44d813[_0x53ee('0x46')]=_[_0x53ee('0x47')](_0x44d813['model'],_0x44d813[_0x53ee('0x44')]);_0x1816ec[_0x53ee('0x4a')]=_[_0x53ee('0x47')](_0x44d813[_0x53ee('0x48')],qs[_0x53ee('0x49')](_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x49')]));_0x1816ec[_0x53ee('0x4a')]=_0x1816ec[_0x53ee('0x4a')][_0x53ee('0x4b')]?_0x1816ec[_0x53ee('0x4a')]:_0x44d813[_0x53ee('0x48')];_0x1816ec['order']=qs['sort'](_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x4f')]);_0x1816ec[_0x53ee('0x50')]=qs[_0x53ee('0x46')](_[_0x53ee('0x51')](_0x5e9bcf[_0x53ee('0x44')],_0x44d813[_0x53ee('0x46')]));if(_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x52')]){_0x1816ec[_0x53ee('0x50')]=_[_0x53ee('0x54')](_0x1816ec[_0x53ee('0x50')],{'$or':_['map'](_0x1816ec[_0x53ee('0x4a')],function(_0x520fbb){var _0x333d79={};_0x333d79[_0x520fbb]={'$like':'%'+_0x5e9bcf[_0x53ee('0x44')]['filter']+'%'};return _0x333d79;})});}_0x1816ec=_[_0x53ee('0x54')]({},_0x1816ec,_0x5e9bcf[_0x53ee('0x5b')]);return _0x33b8d6[_0x53ee('0xbb')](_0x1816ec);}})[_0x53ee('0x22')](function(_0x2470ee){if(_0x2470ee){_0x4378ac=_0x2470ee[_0x53ee('0x4b')];if(!_0x5e9bcf[_0x53ee('0x44')][_0x53ee('0x4c')](_0x53ee('0x4d'))){_0x1816ec[_0x53ee('0x32')]=qs[_0x53ee('0x32')](_0x5e9bcf[_0x53ee('0x44')]['limit']);_0x1816ec[_0x53ee('0x31')]=qs[_0x53ee('0x31')](_0x5e9bcf[_0x53ee('0x44')]['offset']);}return _0x33b8d6['getAgents'](_0x1816ec);}})[_0x53ee('0x22')](function(_0x56459e){if(_0x56459e){return _0x56459e?{'count':_0x4378ac,'rows':_0x56459e}:null;}})[_0x53ee('0x22')](respondWithResult(_0x330d32,null))[_0x53ee('0x2c')](handleError(_0x330d32,null));};exports[_0x53ee('0xac')]=function(_0x15ac4d,_0x37fecc,_0x2c1726){var _0x168941,_0x3bdaad,_0x352625;if(_[_0x53ee('0x78')](_0x15ac4d[_0x53ee('0x5e')]['body'])||_0x15ac4d[_0x53ee('0x5e')][_0x53ee('0x5e')]===''){throw new db[(_0x53ee('0x79'))][(_0x53ee('0x74'))](_0x53ee('0x7b'));}if(_[_0x53ee('0x78')](_0x15ac4d[_0x53ee('0x5e')]['to'])){}_0x168941=_0x15ac4d['body']['to'];return db[_0x53ee('0x40')][_0x53ee('0x6f')]({'where':{'id':_0x15ac4d[_0x53ee('0x5a')]['id']}})[_0x53ee('0x22')](handleEntityNotFound(_0x37fecc,null))['then'](function(_0x4a7345){if(_0x4a7345){return db['OpenchannelAccount'][_0x53ee('0x5c')]({'where':{'id':_0x4a7345['id']},'include':[{'model':db[_0x53ee('0x80')],'as':_0x53ee('0x81'),'include':[{'model':db['CmContact'],'as':_0x53ee('0x83'),'where':{[_0x4a7345[_0x53ee('0x7c')]]:_0x168941},'limit':0x1,'order':[[_0x53ee('0x84'),_0x53ee('0x85')]]}]}]})[_0x53ee('0x22')](handleEntityNotFound(_0x37fecc,null))[_0x53ee('0x22')](function(_0xbe5bea){if(_0xbe5bea&&_0xbe5bea[_0x53ee('0x81')]){_0x3bdaad=_0xbe5bea[_0x53ee('0x37')]({'plain':!![]});if(_0x3bdaad[_0x53ee('0x81')]&&_0x3bdaad['List'][_0x53ee('0x83')][_0x53ee('0x4b')]){return _0x3bdaad[_0x53ee('0x81')][_0x53ee('0x83')][0x0];}return db[_0x53ee('0x82')][_0x53ee('0x5d')](_[_0x53ee('0x1c')](_0x15ac4d['body'],{'firstName':_0x168941,[_0xbe5bea[_0x53ee('0x7c')]]:_0x168941,'phone':_0x168941,'ListId':_0x3bdaad['ListId']}));}})['then'](handleEntityNotFound(_0x37fecc,null))['then'](function(_0x379d03){if(_0x379d03){_0x352625=_0x379d03;return db[_0x53ee('0x8d')][_0x53ee('0x5c')]({'where':{'ContactId':_0x352625['id'],'closed':![],'OpenchannelAccountId':_0x3bdaad['id']}})[_0x53ee('0x22')](function(_0x275904){if(_0x275904){return[_0x275904,![]];}return db[_0x53ee('0x8d')][_0x53ee('0x5d')]({'UserId':_0x15ac4d['user']['id'],'ContactId':_0x352625['id'],'OpenchannelAccountId':_0x3bdaad['id'],'lastMsgDirection':_0x53ee('0xbc'),'firstMsgDirection':_0x53ee('0xbc'),'Messages':[_[_0x53ee('0x54')](_0x15ac4d[_0x53ee('0x5e')],{'read':![],'body':_0x15ac4d[_0x53ee('0x5e')][_0x53ee('0x5e')],'OpenchannelAccountId':_0x3bdaad['id'],'UserId':_0x15ac4d[_0x53ee('0x5f')]['id'],'ContactId':_0x352625['id']})]},{'include':[{'model':db[_0x53ee('0x99')],'as':_0x53ee('0xbd')}]})[_0x53ee('0x22')](function(_0x75f8a2){return[_0x75f8a2,!![]];});});}})[_0x53ee('0x8f')](function(_0x908b2c,_0x4f77dd){if(_0x4f77dd){return _0x908b2c;}return db[_0x53ee('0x99')][_0x53ee('0x5d')](_[_0x53ee('0x54')](_0x15ac4d['body'],{'read':![],'body':_0x15ac4d[_0x53ee('0x5e')]['body'],'OpenchannelAccountId':_0x3bdaad['id'],'OpenchannelInteractionId':_0x908b2c['id'],'UserId':_0x15ac4d[_0x53ee('0x5f')]['id'],'ContactId':_0x352625['id']}))[_0x53ee('0x22')](function(_0x8f91ca){_0x908b2c['dataValues'][_0x53ee('0xbd')]=[];_0x908b2c[_0x53ee('0xbe')][_0x53ee('0xbd')][_0x53ee('0x96')](_0x8f91ca['dataValues']);return _0x908b2c;});});}})[_0x53ee('0x22')](respondWithResult(_0x37fecc,null))[_0x53ee('0x2c')](handleError(_0x37fecc,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 72fdf13..282b5a4 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 _0xd8b0=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x32cf0d,_0x55a53e){var _0x6e2e19=function(_0x1124c4){while(--_0x1124c4){_0x32cf0d['push'](_0x32cf0d['shift']());}};_0x6e2e19(++_0x55a53e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x0d8b('0x0'));var OpenchannelAccount=require(_0x0d8b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d8b('0x2'),'afterDestroy':_0x0d8b('0x3')};function emitEvent(_0x43bca1){return function(_0x364286,_0x8196ed,_0x577834){OpenchannelAccountEvents['emit'](_0x43bca1+':'+_0x364286['id'],_0x364286);OpenchannelAccountEvents[_0x0d8b('0x4')](_0x43bca1,_0x364286);_0x577834(null);};}for(var e in events){if(events[_0x0d8b('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0d8b('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x56ff30,_0x3ec6a8){var _0x559832=function(_0x2ff9da){while(--_0x2ff9da){_0x56ff30['push'](_0x56ff30['shift']());}};_0x559832(++_0x3ec6a8);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5c7c31,_0x22aa86){_0x5c7c31=_0x5c7c31-0x0;var _0x193fdf=_0xbdb7[_0x5c7c31];return _0x193fdf;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var OpenchannelAccount=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){OpenchannelAccountEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);OpenchannelAccountEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];OpenchannelAccount[_0x7bdb('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 8181d04..79ec460 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(_0x5b8168,_0x35bda6){var _0x5f02b6=function(_0x3a2273){while(--_0x3a2273){_0x5b8168['push'](_0x5b8168['shift']());}};_0x5f02b6(++_0x35bda6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x1ff4cb,_0x529761){var _0x57df51=function(_0x52a2ec){while(--_0x52a2ec){_0x1ff4cb['push'](_0x1ff4cb['shift']());}};_0x57df51(++_0x529761);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 14d97cb..b2360f1 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 _0x4ded=['request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0x4ded,0x116));var _0xd4de=function(_0x538f85,_0x5080b1){_0x538f85=_0x538f85-0x0;var _0x8fdd47=_0x4ded[_0x538f85];return _0x8fdd47;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});config[_0xd4de('0xd')]=_[_0xd4de('0xe')](config[_0xd4de('0xd')],{'host':_0xd4de('0xf'),'port':0x18eb});var socket=require(_0xd4de('0x10'))(new Redis(config['redis']));require(_0xd4de('0x11'))['register'](socket);function respondWithRpcPromise(_0x4ab822,_0x4b0876,_0x176b31){return new BPromise(function(_0x459a46,_0x4e5b10){return client['request'](_0x4ab822,_0x176b31)['then'](function(_0x29e265){logger['info'](_0xd4de('0x12'),_0x4b0876,_0xd4de('0x13'));logger[_0xd4de('0x14')](_0xd4de('0x15'),_0x4b0876,_0xd4de('0x13'),JSON[_0xd4de('0x16')](_0x29e265));if(_0x29e265[_0xd4de('0x17')]){if(_0x29e265[_0xd4de('0x17')][_0xd4de('0x18')]===0x1f4){logger[_0xd4de('0x17')](_0xd4de('0x12'),_0x4b0876,_0x29e265[_0xd4de('0x17')][_0xd4de('0x19')]);return _0x4e5b10(_0x29e265[_0xd4de('0x17')][_0xd4de('0x19')]);}logger[_0xd4de('0x17')](_0xd4de('0x12'),_0x4b0876,_0x29e265['error']['message']);return _0x459a46(_0x29e265[_0xd4de('0x17')][_0xd4de('0x19')]);}else{logger[_0xd4de('0x1a')](_0xd4de('0x12'),_0x4b0876,'request\x20sent');_0x459a46(_0x29e265['result'][_0xd4de('0x19')]);}})['catch'](function(_0xeaaefa){logger[_0xd4de('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b0876,_0xeaaefa);_0x4e5b10(_0xeaaefa);});});} \ No newline at end of file +var _0x2f3a=['http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x10277d,_0x3a943a){var _0x33b644=function(_0x2b9253){while(--_0x2b9253){_0x10277d['push'](_0x10277d['shift']());}};_0x33b644(++_0x3a943a);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x11031f,_0x5ad3a3){_0x11031f=_0x11031f-0x0;var _0x306646=_0x2f3a[_0x11031f];return _0x306646;};'use strict';var _=require(_0xa2f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2f3('0x1'));var rs=require(_0xa2f3('0x2'));var fs=require('fs');var Redis=require(_0xa2f3('0x3'));var db=require(_0xa2f3('0x4'))['db'];var utils=require(_0xa2f3('0x5'));var logger=require(_0xa2f3('0x6'))('rpc');var config=require(_0xa2f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2f3('0x8')][_0xa2f3('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa2f3('0xa')],{'host':_0xa2f3('0xb'),'port':0x18eb});var socket=require(_0xa2f3('0xc'))(new Redis(config[_0xa2f3('0xa')]));require('./openchannelAccount.socket')[_0xa2f3('0xd')](socket);function respondWithRpcPromise(_0x6373f7,_0x1fce68,_0x41a90c){return new BPromise(function(_0x214f68,_0x55ff83){return client[_0xa2f3('0xe')](_0x6373f7,_0x41a90c)[_0xa2f3('0xf')](function(_0x52aabd){logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));logger['debug'](_0xa2f3('0x13'),_0x1fce68,_0xa2f3('0x12'),JSON[_0xa2f3('0x14')](_0x52aabd));if(_0x52aabd[_0xa2f3('0x15')]){if(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x16')]===0x1f4){logger[_0xa2f3('0x15')](_0xa2f3('0x11'),_0x1fce68,_0x52aabd[_0xa2f3('0x15')]['message']);return _0x55ff83(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);}logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);return _0x214f68(_0x52aabd['error']['message']);}else{logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));_0x214f68(_0x52aabd[_0xa2f3('0x18')][_0xa2f3('0x17')]);}})[_0xa2f3('0x19')](function(_0x30be69){logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x30be69);_0x55ff83(_0x30be69);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index fd6efe1..e0e786b 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 _0x652b=['length','openchannelAccount:','./openchannelAccount.events','save','remove','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x652b,0x68));var _0xb652=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x652b[_0x2b81be];return _0x8ed4a7;};'use strict';var OpenchannelAccountEvents=require(_0xb652('0x0'));var events=[_0xb652('0x1'),_0xb652('0x2'),'update'];function createListener(_0x4070c6,_0x4a11b5){return function(_0x5b10a1){_0x4a11b5[_0xb652('0x3')](_0x4070c6,_0x5b10a1);};}function removeListener(_0x1dd99b,_0x1c8fb4){return function(){OpenchannelAccountEvents['removeListener'](_0x1dd99b,_0x1c8fb4);};}exports['register']=function(_0x43f467){for(var _0x491ce7=0x0,_0x58d168=events[_0xb652('0x4')];_0x491ce7<_0x58d168;_0x491ce7++){var _0x5c0245=events[_0x491ce7];var _0x2b82fd=createListener(_0xb652('0x5')+_0x5c0245,_0x43f467);OpenchannelAccountEvents['on'](_0x5c0245,_0x2b82fd);}}; \ No newline at end of file +var _0x55ea=['remove','emit','removeListener','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0x55ea,0xc9));var _0xa55e=function(_0x36c94a,_0x17e873){_0x36c94a=_0x36c94a-0x0;var _0x3ec881=_0x55ea[_0x36c94a];return _0x3ec881;};'use strict';var OpenchannelAccountEvents=require(_0xa55e('0x0'));var events=[_0xa55e('0x1'),_0xa55e('0x2'),'update'];function createListener(_0x2b5bc7,_0x26b2ef){return function(_0x17dd4d){_0x26b2ef[_0xa55e('0x3')](_0x2b5bc7,_0x17dd4d);};}function removeListener(_0x95af3d,_0x54f178){return function(){OpenchannelAccountEvents[_0xa55e('0x4')](_0x95af3d,_0x54f178);};}exports['register']=function(_0x515646){for(var _0x588751=0x0,_0x5a009c=events[_0xa55e('0x5')];_0x588751<_0x5a009c;_0x588751++){var _0x20f2ac=events[_0x588751];var _0x30b885=createListener(_0xa55e('0x6')+_0x20f2ac,_0x515646);OpenchannelAccountEvents['on'](_0x20f2ac,_0x30b885);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 66e7233..3aeba61 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 _0xbe38=['../../config/environment','./openchannelApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xafa3b3,_0x419820){var _0x25fa7f=function(_0x547df6){while(--_0x547df6){_0xafa3b3['push'](_0xafa3b3['shift']());}};_0x25fa7f(++_0x419820);}(_0xbe38,0x12b));var _0x8be3=function(_0x58e2a5,_0x4e822c){_0x58e2a5=_0x58e2a5-0x0;var _0x440ba0=_0xbe38[_0x58e2a5];return _0x440ba0;};'use strict';var multer=require(_0x8be3('0x0'));var util=require('util');var path=require(_0x8be3('0x1'));var timeout=require('connect-timeout');var express=require(_0x8be3('0x2'));var router=express[_0x8be3('0x3')]();var fs_extra=require(_0x8be3('0x4'));var auth=require(_0x8be3('0x5'));var interaction=require(_0x8be3('0x6'));var config=require(_0x8be3('0x7'));var controller=require(_0x8be3('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8be3('0x9')](_0x8be3('0xa'),auth['isAuthenticated'](),controller[_0x8be3('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8be3('0xc')](_0x8be3('0xa'),auth[_0x8be3('0xd')](),controller[_0x8be3('0xe')]);router[_0x8be3('0xf')](_0x8be3('0xa'),auth['isAuthenticated'](),controller[_0x8be3('0x10')]);module[_0x8be3('0x11')]=router; \ No newline at end of file +var _0xcb85=['show','post','create','put','/:id','isAuthenticated','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','get'];(function(_0x8ebb33,_0x13f312){var _0x453c81=function(_0x3f9152){while(--_0x3f9152){_0x8ebb33['push'](_0x8ebb33['shift']());}};_0x453c81(++_0x13f312);}(_0xcb85,0x7b));var _0x5cb8=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0xcb85[_0x3f00ee];return _0x18a07e;};'use strict';var multer=require(_0x5cb8('0x0'));var util=require('util');var path=require(_0x5cb8('0x1'));var timeout=require(_0x5cb8('0x2'));var express=require('express');var router=express[_0x5cb8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5cb8('0x4'));var interaction=require(_0x5cb8('0x5'));var config=require(_0x5cb8('0x6'));var controller=require(_0x5cb8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5cb8('0x8')]);router[_0x5cb8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5cb8('0xa')]);router[_0x5cb8('0xb')]('/',auth['isAuthenticated'](),controller[_0x5cb8('0xc')]);router[_0x5cb8('0xd')](_0x5cb8('0xe'),auth[_0x5cb8('0xf')](),controller[_0x5cb8('0x10')]);router[_0x5cb8('0x11')](_0x5cb8('0xe'),auth[_0x5cb8('0xf')](),controller[_0x5cb8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index e5787ad..7ed69f3 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 _0xde6f=['STRING','TEXT','sequelize','INTEGER'];(function(_0x41ba9f,_0x2eb00f){var _0x410dcf=function(_0x4ed0c5){while(--_0x4ed0c5){_0x41ba9f['push'](_0x41ba9f['shift']());}};_0x410dcf(++_0x2eb00f);}(_0xde6f,0x14a));var _0xfde6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde6f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfde6('0x0'));module['exports']={'priority':{'type':Sequelize[_0xfde6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfde6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfde6('0x3')]()},'description':{'type':Sequelize[_0xfde6('0x2')]},'interval':{'type':Sequelize[_0xfde6('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4d83=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5b82e9,_0x382fe1){var _0x204239=function(_0x477bd3){while(--_0x477bd3){_0x5b82e9['push'](_0x5b82e9['shift']());}};_0x204239(++_0x382fe1);}(_0x4d83,0x142));var _0x34d8=function(_0x4c60fc,_0x35a259){_0x4c60fc=_0x4c60fc-0x0;var _0x221a30=_0x4d83[_0x4c60fc];return _0x221a30;};'use strict';var Sequelize=require(_0x34d8('0x0'));module[_0x34d8('0x1')]={'priority':{'type':Sequelize[_0x34d8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x34d8('0x3')],'allowNull':![],'defaultValue':_0x34d8('0x4')},'appdata':{'type':Sequelize[_0x34d8('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x34d8('0x3')],'defaultValue':_0x34d8('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 58f636c..7c165d8 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 _0x8071=['map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','save','update','then','destroy','end','stack','name','send','index'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x8071,0x6d));var _0x1807=function(_0x1a8260,_0x1f9501){_0x1a8260=_0x1a8260-0x0;var _0xb72d2a=_0x8071[_0x1a8260];return _0xb72d2a;};'use strict';var emlformat=require(_0x1807('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1807('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1807('0x2'));var BPromise=require(_0x1807('0x3'));var Mustache=require(_0x1807('0x4'));var util=require('util');var path=require(_0x1807('0x5'));var sox=require(_0x1807('0x6'));var csv=require(_0x1807('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1807('0x8'));var _=require(_0x1807('0x9'));var squel=require(_0x1807('0xa'));var crypto=require(_0x1807('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1807('0xc'));var toCsv=require(_0x1807('0x7'));var querystring=require('querystring');var Papa=require(_0x1807('0xd'));var Redis=require(_0x1807('0xe'));var authService=require(_0x1807('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1807('0x10'));var hardwareService=require(_0x1807('0x11'));var logger=require(_0x1807('0x12'))(_0x1807('0x13'));var utils=require(_0x1807('0x14'));var config=require(_0x1807('0x15'));var licenseUtil=require(_0x1807('0x16'));var db=require(_0x1807('0x17'))['db'];function respondWithStatusCode(_0x36d952,_0x44655e){_0x44655e=_0x44655e||0xcc;return function(_0x364871){if(_0x364871){return _0x36d952[_0x1807('0x18')](_0x44655e);}return _0x36d952[_0x1807('0x19')](_0x44655e)['end']();};}function respondWithResult(_0x5b516c,_0x4da4d6){_0x4da4d6=_0x4da4d6||0xc8;return function(_0xc87f6f){if(_0xc87f6f){return _0x5b516c['status'](_0x4da4d6)[_0x1807('0x1a')](_0xc87f6f);}};}function respondWithFilteredResult(_0x5acd49,_0x207fbc){return function(_0x5d28be){if(_0x5d28be){var _0x5371e4=typeof _0x207fbc[_0x1807('0x1b')]===_0x1807('0x1c')&&typeof _0x207fbc[_0x1807('0x1d')]===_0x1807('0x1c');var _0x636416=_0x5d28be['count'];var _0x5e8b9f=_0x5371e4?0x0:_0x207fbc[_0x1807('0x1b')];var _0x583d8b=_0x5371e4?_0x5d28be['count']:_0x207fbc[_0x1807('0x1b')]+_0x207fbc[_0x1807('0x1d')];var _0x175284;if(_0x583d8b>=_0x636416){_0x583d8b=_0x636416;_0x175284=0xc8;}else{_0x175284=0xce;}_0x5acd49[_0x1807('0x19')](_0x175284);return _0x5acd49[_0x1807('0x1e')]('Content-Range',_0x5e8b9f+'-'+_0x583d8b+'/'+_0x636416)[_0x1807('0x1a')](_0x5d28be);}return null;};}function patchUpdates(_0x1092a8){return function(_0x413b02){try{jsonpatch[_0x1807('0x1f')](_0x413b02,_0x1092a8,!![]);}catch(_0x44f137){return BPromise['reject'](_0x44f137);}return _0x413b02[_0x1807('0x20')]();};}function saveUpdates(_0x2fe666,_0x55a7fe){return function(_0x13845a){if(_0x13845a){return _0x13845a[_0x1807('0x21')](_0x2fe666)[_0x1807('0x22')](function(_0x4f4850){return _0x4f4850;});}return null;};}function removeEntity(_0x352c51,_0x271223){return function(_0x474c15){if(_0x474c15){return _0x474c15[_0x1807('0x23')]()['then'](function(){_0x352c51['status'](0xcc)[_0x1807('0x24')]();});}};}function handleEntityNotFound(_0x1615e6,_0x4fc6f2){return function(_0x26edbc){if(!_0x26edbc){_0x1615e6[_0x1807('0x18')](0x194);}return _0x26edbc;};}function handleError(_0x466fe8,_0xf83782){_0xf83782=_0xf83782||0x1f4;return function(_0x206eca){logger['error'](_0x206eca[_0x1807('0x25')]);if(_0x206eca[_0x1807('0x26')]){delete _0x206eca[_0x1807('0x26')];}_0x466fe8[_0x1807('0x19')](_0xf83782)[_0x1807('0x27')](_0x206eca);};}exports[_0x1807('0x28')]=function(_0x17e17f,_0x41e439){var _0x373376={},_0x464a41={},_0x56811d={'count':0x0,'rows':[]};var _0x3e7fc6=_[_0x1807('0x29')](db[_0x1807('0x2a')][_0x1807('0x2b')],function(_0x49f8a5){return{'name':_0x49f8a5[_0x1807('0x2c')],'type':_0x49f8a5[_0x1807('0x2d')][_0x1807('0x2e')]};});_0x464a41[_0x1807('0x2f')]=_[_0x1807('0x29')](_0x3e7fc6,_0x1807('0x26'));_0x464a41['query']=_['keys'](_0x17e17f['query']);_0x464a41['filters']=_[_0x1807('0x30')](_0x464a41[_0x1807('0x2f')],_0x464a41[_0x1807('0x31')]);_0x373376[_0x1807('0x32')]=_[_0x1807('0x30')](_0x464a41[_0x1807('0x2f')],qs['fields'](_0x17e17f[_0x1807('0x31')][_0x1807('0x33')]));_0x373376['attributes']=_0x373376['attributes'][_0x1807('0x34')]?_0x373376[_0x1807('0x32')]:_0x464a41[_0x1807('0x2f')];if(!_0x17e17f['query'][_0x1807('0x35')](_0x1807('0x36'))){_0x373376[_0x1807('0x1d')]=qs[_0x1807('0x1d')](_0x17e17f[_0x1807('0x31')][_0x1807('0x1d')]);_0x373376['offset']=qs[_0x1807('0x1b')](_0x17e17f[_0x1807('0x31')]['offset']);}_0x373376[_0x1807('0x37')]=qs[_0x1807('0x38')](_0x17e17f[_0x1807('0x31')]['sort']);_0x373376[_0x1807('0x39')]=qs[_0x1807('0x3a')](_['pick'](_0x17e17f[_0x1807('0x31')],_0x464a41[_0x1807('0x3a')]),_0x3e7fc6);if(_0x17e17f['query'][_0x1807('0x3b')]){_0x373376[_0x1807('0x39')]=_[_0x1807('0x3c')](_0x373376[_0x1807('0x39')],{'$or':_[_0x1807('0x29')](_0x3e7fc6,function(_0x67c21c){if(_0x67c21c[_0x1807('0x2d')]!==_0x1807('0x3d')){var _0x512a3d={};_0x512a3d[_0x67c21c[_0x1807('0x26')]]={'$like':'%'+_0x17e17f[_0x1807('0x31')][_0x1807('0x3b')]+'%'};return _0x512a3d;}})});}_0x373376=_[_0x1807('0x3c')]({},_0x373376,_0x17e17f['options']);var _0x488bb5={'where':_0x373376[_0x1807('0x39')]};return db['OpenchannelApplication'][_0x1807('0x3e')](_0x488bb5)[_0x1807('0x22')](function(_0x553127){_0x56811d[_0x1807('0x3e')]=_0x553127;if(_0x17e17f[_0x1807('0x31')][_0x1807('0x3f')]){_0x373376[_0x1807('0x40')]=[{'all':!![]}];}return db[_0x1807('0x2a')][_0x1807('0x41')](_0x373376);})[_0x1807('0x22')](function(_0x406891){_0x56811d[_0x1807('0x42')]=_0x406891;return _0x56811d;})['then'](respondWithFilteredResult(_0x41e439,_0x373376))[_0x1807('0x43')](handleError(_0x41e439,null));};exports[_0x1807('0x44')]=function(_0x112944,_0x1ba29b){var _0x30dc04={'raw':!![],'where':{'id':_0x112944[_0x1807('0x45')]['id']}},_0x58f2fb={};_0x58f2fb[_0x1807('0x2f')]=_[_0x1807('0x46')](db[_0x1807('0x2a')]['rawAttributes']);_0x58f2fb[_0x1807('0x31')]=_[_0x1807('0x46')](_0x112944[_0x1807('0x31')]);_0x58f2fb['filters']=_['intersection'](_0x58f2fb[_0x1807('0x2f')],_0x58f2fb['query']);_0x30dc04['attributes']=_[_0x1807('0x30')](_0x58f2fb['model'],qs[_0x1807('0x33')](_0x112944[_0x1807('0x31')][_0x1807('0x33')]));_0x30dc04[_0x1807('0x32')]=_0x30dc04[_0x1807('0x32')][_0x1807('0x34')]?_0x30dc04['attributes']:_0x58f2fb[_0x1807('0x2f')];if(_0x112944['query'][_0x1807('0x3f')]){_0x30dc04['include']=[{'all':!![]}];}_0x30dc04=_[_0x1807('0x3c')]({},_0x30dc04,_0x112944[_0x1807('0x47')]);return db['OpenchannelApplication'][_0x1807('0x48')](_0x30dc04)[_0x1807('0x22')](handleEntityNotFound(_0x1ba29b,null))[_0x1807('0x22')](respondWithResult(_0x1ba29b,null))[_0x1807('0x43')](handleError(_0x1ba29b,null));};exports[_0x1807('0x49')]=function(_0x527bc7,_0xc15ff0){return db[_0x1807('0x2a')][_0x1807('0x49')](_0x527bc7['body'],{})[_0x1807('0x22')](respondWithResult(_0xc15ff0,0xc9))['catch'](handleError(_0xc15ff0,null));};exports['update']=function(_0x2fae8e,_0x175e1c){if(_0x2fae8e[_0x1807('0x4a')]['id']){delete _0x2fae8e[_0x1807('0x4a')]['id'];}return db['OpenchannelApplication'][_0x1807('0x48')]({'where':{'id':_0x2fae8e['params']['id']}})[_0x1807('0x22')](handleEntityNotFound(_0x175e1c,null))[_0x1807('0x22')](saveUpdates(_0x2fae8e['body'],null))[_0x1807('0x22')](respondWithResult(_0x175e1c,null))[_0x1807('0x43')](handleError(_0x175e1c,null));};exports[_0x1807('0x23')]=function(_0x169221,_0x430afa){return db[_0x1807('0x2a')]['find']({'where':{'id':_0x169221[_0x1807('0x45')]['id']}})[_0x1807('0x22')](handleEntityNotFound(_0x430afa,null))[_0x1807('0x22')](removeEntity(_0x430afa,null))[_0x1807('0x43')](handleError(_0x430afa,null));}; \ No newline at end of file +var _0xf979=['fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../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','apply','save','then','destroy','end','error','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x1989f1,_0x2f4ce7){var _0x191ffe=function(_0x198a54){while(--_0x198a54){_0x1989f1['push'](_0x1989f1['shift']());}};_0x191ffe(++_0x2f4ce7);}(_0xf979,0x15e));var _0x9f97=function(_0x797e77,_0x404131){_0x797e77=_0x797e77-0x0;var _0x3f64bd=_0xf979[_0x797e77];return _0x3f64bd;};'use strict';var emlformat=require(_0x9f97('0x0'));var rimraf=require(_0x9f97('0x1'));var zipdir=require(_0x9f97('0x2'));var jsonpatch=require(_0x9f97('0x3'));var rp=require(_0x9f97('0x4'));var moment=require(_0x9f97('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f97('0x6'));var path=require(_0x9f97('0x7'));var sox=require('sox');var csv=require(_0x9f97('0x8'));var ejs=require(_0x9f97('0x9'));var fs=require('fs');var fs_extra=require(_0x9f97('0xa'));var _=require('lodash');var squel=require(_0x9f97('0xb'));var crypto=require(_0x9f97('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f97('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f97('0xe'));var Redis=require(_0x9f97('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9f97('0x10'));var as=require(_0x9f97('0x11'));var hardwareService=require(_0x9f97('0x12'));var logger=require('../../config/logger')(_0x9f97('0x13'));var utils=require(_0x9f97('0x14'));var config=require(_0x9f97('0x15'));var licenseUtil=require(_0x9f97('0x16'));var db=require(_0x9f97('0x17'))['db'];function respondWithStatusCode(_0x15a394,_0x56a830){_0x56a830=_0x56a830||0xcc;return function(_0x2b3f9a){if(_0x2b3f9a){return _0x15a394[_0x9f97('0x18')](_0x56a830);}return _0x15a394['status'](_0x56a830)['end']();};}function respondWithResult(_0x149b59,_0x4c6326){_0x4c6326=_0x4c6326||0xc8;return function(_0x59d887){if(_0x59d887){return _0x149b59[_0x9f97('0x19')](_0x4c6326)[_0x9f97('0x1a')](_0x59d887);}};}function respondWithFilteredResult(_0x226eff,_0x45da9f){return function(_0x1710a8){if(_0x1710a8){var _0x371f83=typeof _0x45da9f[_0x9f97('0x1b')]===_0x9f97('0x1c')&&typeof _0x45da9f[_0x9f97('0x1d')]==='undefined';var _0x4ac8bc=_0x1710a8[_0x9f97('0x1e')];var _0x119515=_0x371f83?0x0:_0x45da9f['offset'];var _0x2f28ee=_0x371f83?_0x1710a8[_0x9f97('0x1e')]:_0x45da9f[_0x9f97('0x1b')]+_0x45da9f['limit'];var _0xb7f3f6;if(_0x2f28ee>=_0x4ac8bc){_0x2f28ee=_0x4ac8bc;_0xb7f3f6=0xc8;}else{_0xb7f3f6=0xce;}_0x226eff[_0x9f97('0x19')](_0xb7f3f6);return _0x226eff[_0x9f97('0x1f')](_0x9f97('0x20'),_0x119515+'-'+_0x2f28ee+'/'+_0x4ac8bc)[_0x9f97('0x1a')](_0x1710a8);}return null;};}function patchUpdates(_0x3454f7){return function(_0x37c17a){try{jsonpatch[_0x9f97('0x21')](_0x37c17a,_0x3454f7,!![]);}catch(_0x2aea55){return BPromise['reject'](_0x2aea55);}return _0x37c17a[_0x9f97('0x22')]();};}function saveUpdates(_0x527095,_0x3a7f63){return function(_0x364c37){if(_0x364c37){return _0x364c37['update'](_0x527095)[_0x9f97('0x23')](function(_0x5398f2){return _0x5398f2;});}return null;};}function removeEntity(_0x536aaf,_0x29848d){return function(_0x11c662){if(_0x11c662){return _0x11c662[_0x9f97('0x24')]()['then'](function(){_0x536aaf[_0x9f97('0x19')](0xcc)[_0x9f97('0x25')]();});}};}function handleEntityNotFound(_0x2d4779,_0x11e4a6){return function(_0x2410b4){if(!_0x2410b4){_0x2d4779['sendStatus'](0x194);}return _0x2410b4;};}function handleError(_0x104390,_0x2d3d5b){_0x2d3d5b=_0x2d3d5b||0x1f4;return function(_0x1b86ab){logger[_0x9f97('0x26')](_0x1b86ab['stack']);if(_0x1b86ab[_0x9f97('0x27')]){delete _0x1b86ab[_0x9f97('0x27')];}_0x104390[_0x9f97('0x19')](_0x2d3d5b)[_0x9f97('0x28')](_0x1b86ab);};}exports['index']=function(_0x224f7b,_0xaa526){var _0x271858={},_0x39151f={},_0x1b13de={'count':0x0,'rows':[]};var _0x2afc5e=_[_0x9f97('0x29')](db[_0x9f97('0x2a')][_0x9f97('0x2b')],function(_0x2baa21){return{'name':_0x2baa21[_0x9f97('0x2c')],'type':_0x2baa21[_0x9f97('0x2d')]['key']};});_0x39151f[_0x9f97('0x2e')]=_[_0x9f97('0x29')](_0x2afc5e,'name');_0x39151f['query']=_[_0x9f97('0x2f')](_0x224f7b[_0x9f97('0x30')]);_0x39151f[_0x9f97('0x31')]=_[_0x9f97('0x32')](_0x39151f[_0x9f97('0x2e')],_0x39151f[_0x9f97('0x30')]);_0x271858[_0x9f97('0x33')]=_[_0x9f97('0x32')](_0x39151f[_0x9f97('0x2e')],qs[_0x9f97('0x34')](_0x224f7b[_0x9f97('0x30')]['fields']));_0x271858['attributes']=_0x271858['attributes'][_0x9f97('0x35')]?_0x271858['attributes']:_0x39151f[_0x9f97('0x2e')];if(!_0x224f7b[_0x9f97('0x30')][_0x9f97('0x36')](_0x9f97('0x37'))){_0x271858[_0x9f97('0x1d')]=qs['limit'](_0x224f7b[_0x9f97('0x30')][_0x9f97('0x1d')]);_0x271858['offset']=qs[_0x9f97('0x1b')](_0x224f7b['query'][_0x9f97('0x1b')]);}_0x271858['order']=qs['sort'](_0x224f7b[_0x9f97('0x30')][_0x9f97('0x38')]);_0x271858[_0x9f97('0x39')]=qs[_0x9f97('0x31')](_[_0x9f97('0x3a')](_0x224f7b[_0x9f97('0x30')],_0x39151f[_0x9f97('0x31')]),_0x2afc5e);if(_0x224f7b['query']['filter']){_0x271858['where']=_[_0x9f97('0x3b')](_0x271858[_0x9f97('0x39')],{'$or':_['map'](_0x2afc5e,function(_0x385694){if(_0x385694['type']!==_0x9f97('0x3c')){var _0x204e57={};_0x204e57[_0x385694[_0x9f97('0x27')]]={'$like':'%'+_0x224f7b[_0x9f97('0x30')][_0x9f97('0x3d')]+'%'};return _0x204e57;}})});}_0x271858=_[_0x9f97('0x3b')]({},_0x271858,_0x224f7b[_0x9f97('0x3e')]);var _0x40f612={'where':_0x271858[_0x9f97('0x39')]};return db[_0x9f97('0x2a')][_0x9f97('0x1e')](_0x40f612)['then'](function(_0x53c6d9){_0x1b13de[_0x9f97('0x1e')]=_0x53c6d9;if(_0x224f7b[_0x9f97('0x30')][_0x9f97('0x3f')]){_0x271858[_0x9f97('0x40')]=[{'all':!![]}];}return db[_0x9f97('0x2a')]['findAll'](_0x271858);})[_0x9f97('0x23')](function(_0x2ba263){_0x1b13de['rows']=_0x2ba263;return _0x1b13de;})[_0x9f97('0x23')](respondWithFilteredResult(_0xaa526,_0x271858))[_0x9f97('0x41')](handleError(_0xaa526,null));};exports[_0x9f97('0x42')]=function(_0x19307c,_0x1fa723){var _0x44382e={'raw':!![],'where':{'id':_0x19307c[_0x9f97('0x43')]['id']}},_0x2d83c5={};_0x2d83c5[_0x9f97('0x2e')]=_[_0x9f97('0x2f')](db[_0x9f97('0x2a')][_0x9f97('0x2b')]);_0x2d83c5[_0x9f97('0x30')]=_[_0x9f97('0x2f')](_0x19307c[_0x9f97('0x30')]);_0x2d83c5[_0x9f97('0x31')]=_[_0x9f97('0x32')](_0x2d83c5['model'],_0x2d83c5[_0x9f97('0x30')]);_0x44382e['attributes']=_[_0x9f97('0x32')](_0x2d83c5[_0x9f97('0x2e')],qs[_0x9f97('0x34')](_0x19307c[_0x9f97('0x30')][_0x9f97('0x34')]));_0x44382e[_0x9f97('0x33')]=_0x44382e['attributes'][_0x9f97('0x35')]?_0x44382e[_0x9f97('0x33')]:_0x2d83c5['model'];if(_0x19307c[_0x9f97('0x30')][_0x9f97('0x3f')]){_0x44382e[_0x9f97('0x40')]=[{'all':!![]}];}_0x44382e=_['merge']({},_0x44382e,_0x19307c[_0x9f97('0x3e')]);return db['OpenchannelApplication'][_0x9f97('0x44')](_0x44382e)['then'](handleEntityNotFound(_0x1fa723,null))[_0x9f97('0x23')](respondWithResult(_0x1fa723,null))[_0x9f97('0x41')](handleError(_0x1fa723,null));};exports['create']=function(_0x50ab5c,_0x3bdeb4){return db[_0x9f97('0x2a')][_0x9f97('0x45')](_0x50ab5c['body'],{})[_0x9f97('0x23')](respondWithResult(_0x3bdeb4,0xc9))[_0x9f97('0x41')](handleError(_0x3bdeb4,null));};exports[_0x9f97('0x46')]=function(_0x37840e,_0x2383ee){if(_0x37840e['body']['id']){delete _0x37840e[_0x9f97('0x47')]['id'];}return db[_0x9f97('0x2a')][_0x9f97('0x44')]({'where':{'id':_0x37840e[_0x9f97('0x43')]['id']}})[_0x9f97('0x23')](handleEntityNotFound(_0x2383ee,null))[_0x9f97('0x23')](saveUpdates(_0x37840e[_0x9f97('0x47')],null))[_0x9f97('0x23')](respondWithResult(_0x2383ee,null))['catch'](handleError(_0x2383ee,null));};exports[_0x9f97('0x24')]=function(_0x5d2ca9,_0x14636e){return db['OpenchannelApplication']['find']({'where':{'id':_0x5d2ca9[_0x9f97('0x43')]['id']}})['then'](handleEntityNotFound(_0x14636e,null))[_0x9f97('0x23')](removeEntity(_0x14636e,null))['catch'](handleError(_0x14636e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1765644..598eb03 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 _0x965e=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','define'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0x965e,0x17e));var _0xe965=function(_0x14c4f2,_0x4df4b1){_0x14c4f2=_0x14c4f2-0x0;var _0x255998=_0x965e[_0x14c4f2];return _0x255998;};'use strict';var _=require(_0xe965('0x0'));var util=require(_0xe965('0x1'));var logger=require(_0xe965('0x2'))(_0xe965('0x3'));var moment=require('moment');var BPromise=require(_0xe965('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe965('0x5'));var rimraf=require(_0xe965('0x6'));var config=require(_0xe965('0x7'));var attributes=require(_0xe965('0x8'));module['exports']=function(_0x5be946,_0x3308f4){return _0x5be946[_0xe965('0x9')](_0xe965('0xa'),attributes,{'tableName':_0xe965('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe965('0xc'),'collate':_0xe965('0xd')});}; \ No newline at end of file +var _0xd685=['bluebird','path','rimraf','exports','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd685,0xcf));var _0x5d68=function(_0x37aae2,_0x38b26b){_0x37aae2=_0x37aae2-0x0;var _0x55bc61=_0xd685[_0x37aae2];return _0x55bc61;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5d68('0x0'))(_0x5d68('0x1'));var moment=require(_0x5d68('0x2'));var BPromise=require(_0x5d68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d68('0x4'));var rimraf=require(_0x5d68('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x5d68('0x6')]=function(_0x507a00,_0x3a0771){return _0x507a00['define'](_0x5d68('0x7'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d68('0x8'),'collate':_0x5d68('0x9')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7f50885..f805433 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 _0xbad0=['info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result','catch','UpdateOpenchannelApplication','update','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xbad0,0x6f));var _0x0bad=function(_0x76e2cb,_0x4aab51){_0x76e2cb=_0x76e2cb-0x0;var _0x137334=_0xbad0[_0x76e2cb];return _0x137334;};'use strict';var _=require(_0x0bad('0x0'));var util=require(_0x0bad('0x1'));var moment=require(_0x0bad('0x2'));var BPromise=require(_0x0bad('0x3'));var rs=require(_0x0bad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bad('0x5'))['db'];var utils=require(_0x0bad('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0bad('0x7'));var jayson=require(_0x0bad('0x8'));var client=jayson[_0x0bad('0x9')][_0x0bad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x251527,_0x5a6a5f,_0x4c0b30){return new BPromise(function(_0x573a50,_0x159cc1){return client[_0x0bad('0xb')](_0x251527,_0x4c0b30)[_0x0bad('0xc')](function(_0x4a674){logger[_0x0bad('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x5a6a5f,_0x0bad('0xe'));logger[_0x0bad('0xf')](_0x0bad('0x10'),_0x5a6a5f,'request\x20sent',JSON[_0x0bad('0x11')](_0x4a674));if(_0x4a674[_0x0bad('0x12')]){if(_0x4a674[_0x0bad('0x12')][_0x0bad('0x13')]===0x1f4){logger[_0x0bad('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x5a6a5f,_0x4a674[_0x0bad('0x12')][_0x0bad('0x14')]);return _0x159cc1(_0x4a674[_0x0bad('0x12')]['message']);}logger[_0x0bad('0x12')](_0x0bad('0x15'),_0x5a6a5f,_0x4a674[_0x0bad('0x12')][_0x0bad('0x14')]);return _0x573a50(_0x4a674[_0x0bad('0x12')][_0x0bad('0x14')]);}else{logger[_0x0bad('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x5a6a5f,_0x0bad('0xe'));_0x573a50(_0x4a674[_0x0bad('0x16')][_0x0bad('0x14')]);}})[_0x0bad('0x17')](function(_0x51ad40){logger[_0x0bad('0x12')](_0x0bad('0x15'),_0x5a6a5f,_0x51ad40);_0x159cc1(_0x51ad40);});});}exports[_0x0bad('0x18')]=function(_0xd851ed){var _0x1eaf8f=this;return new Promise(function(_0x4029ba,_0x482a50){return db['OpenchannelApplication'][_0x0bad('0x19')](_0xd851ed['body'],{'raw':_0xd851ed[_0x0bad('0x1a')]?_0xd851ed['options'][_0x0bad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd851ed[_0x0bad('0x1a')]?_0xd851ed[_0x0bad('0x1a')][_0x0bad('0x1c')]||null:null,'attributes':_0xd851ed[_0x0bad('0x1a')]?_0xd851ed[_0x0bad('0x1a')][_0x0bad('0x1d')]||null:null,'limit':_0xd851ed[_0x0bad('0x1a')]?_0xd851ed[_0x0bad('0x1a')][_0x0bad('0x1e')]||null:null})[_0x0bad('0xc')](function(_0x272861){logger[_0x0bad('0xd')](_0x0bad('0x18'),_0xd851ed);logger[_0x0bad('0xf')](_0x0bad('0x18'),_0xd851ed,JSON[_0x0bad('0x11')](_0x272861));_0x4029ba(_0x272861);})[_0x0bad('0x17')](function(_0x36fb1b){logger[_0x0bad('0x12')](_0x0bad('0x18'),_0x36fb1b[_0x0bad('0x14')],_0xd851ed);_0x482a50(_0x1eaf8f[_0x0bad('0x12')](0x1f4,_0x36fb1b[_0x0bad('0x14')]));});});}; \ No newline at end of file +var _0x2a23=['http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','OpenchannelApplication','options','raw','where','attributes','limit','then','UpdateOpenchannelApplication','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2d053a,_0xe7b66d){var _0x38e163=function(_0x218a14){while(--_0x218a14){_0x2d053a['push'](_0x2d053a['shift']());}};_0x38e163(++_0xe7b66d);}(_0x2a23,0x64));var _0x32a2=function(_0x5e452c,_0x508c30){_0x5e452c=_0x5e452c-0x0;var _0x54d97f=_0x2a23[_0x5e452c];return _0x54d97f;};'use strict';var _=require(_0x32a2('0x0'));var util=require('util');var moment=require(_0x32a2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32a2('0x2'));var db=require(_0x32a2('0x3'))['db'];var utils=require(_0x32a2('0x4'));var logger=require('../../config/logger')(_0x32a2('0x5'));var config=require(_0x32a2('0x6'));var jayson=require(_0x32a2('0x7'));var client=jayson['client'][_0x32a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c90a1,_0xcf5cb3,_0x14f2bb){return new BPromise(function(_0x2eba66,_0x35ea15){return client[_0x32a2('0x9')](_0x4c90a1,_0x14f2bb)['then'](function(_0x5cdb23){logger[_0x32a2('0xa')](_0x32a2('0xb'),_0xcf5cb3,'request\x20sent');logger[_0x32a2('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xcf5cb3,'request\x20sent',JSON[_0x32a2('0xd')](_0x5cdb23));if(_0x5cdb23[_0x32a2('0xe')]){if(_0x5cdb23['error'][_0x32a2('0xf')]===0x1f4){logger[_0x32a2('0xe')](_0x32a2('0xb'),_0xcf5cb3,_0x5cdb23[_0x32a2('0xe')][_0x32a2('0x10')]);return _0x35ea15(_0x5cdb23[_0x32a2('0xe')][_0x32a2('0x10')]);}logger[_0x32a2('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0xcf5cb3,_0x5cdb23[_0x32a2('0xe')][_0x32a2('0x10')]);return _0x2eba66(_0x5cdb23[_0x32a2('0xe')][_0x32a2('0x10')]);}else{logger[_0x32a2('0xa')](_0x32a2('0xb'),_0xcf5cb3,'request\x20sent');_0x2eba66(_0x5cdb23[_0x32a2('0x11')]['message']);}})[_0x32a2('0x12')](function(_0x3ab98e){logger['error'](_0x32a2('0xb'),_0xcf5cb3,_0x3ab98e);_0x35ea15(_0x3ab98e);});});}exports['UpdateOpenchannelApplication']=function(_0x4b6c8f){var _0x4dbf86=this;return new Promise(function(_0x18b153,_0x364776){return db[_0x32a2('0x13')]['update'](_0x4b6c8f['body'],{'raw':_0x4b6c8f[_0x32a2('0x14')]?_0x4b6c8f[_0x32a2('0x14')][_0x32a2('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6c8f[_0x32a2('0x14')]?_0x4b6c8f['options'][_0x32a2('0x16')]||null:null,'attributes':_0x4b6c8f[_0x32a2('0x14')]?_0x4b6c8f[_0x32a2('0x14')][_0x32a2('0x17')]||null:null,'limit':_0x4b6c8f['options']?_0x4b6c8f[_0x32a2('0x14')][_0x32a2('0x18')]||null:null})[_0x32a2('0x19')](function(_0x33062d){logger[_0x32a2('0xa')](_0x32a2('0x1a'),_0x4b6c8f);logger[_0x32a2('0xc')](_0x32a2('0x1a'),_0x4b6c8f,JSON['stringify'](_0x33062d));_0x18b153(_0x33062d);})[_0x32a2('0x12')](function(_0x33144c){logger[_0x32a2('0xe')]('UpdateOpenchannelApplication',_0x33144c[_0x32a2('0x10')],_0x4b6c8f);_0x364776(_0x4dbf86[_0x32a2('0xe')](0x1f4,_0x33144c[_0x32a2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 913f997..473b201 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 _0x3131=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','tracked','destroy','removeTags','exports'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x3131,0xe0));var _0x1313=function(_0x43abfd,_0x148990){_0x43abfd=_0x43abfd-0x0;var _0x727621=_0x3131[_0x43abfd];return _0x727621;};'use strict';var multer=require('multer');var util=require(_0x1313('0x0'));var path=require('path');var timeout=require(_0x1313('0x1'));var express=require(_0x1313('0x2'));var router=express[_0x1313('0x3')]();var fs_extra=require(_0x1313('0x4'));var auth=require(_0x1313('0x5'));var interaction=require(_0x1313('0x6'));var config=require(_0x1313('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x1313('0x8')]('/',auth['isAuthenticated'](),controller[_0x1313('0x9')]);router[_0x1313('0x8')](_0x1313('0xa'),auth['isAuthenticated'](),controller[_0x1313('0xb')]);router['get'](_0x1313('0xc'),auth[_0x1313('0xd')](),controller[_0x1313('0xe')]);router['get'](_0x1313('0xf'),auth[_0x1313('0xd')](),controller[_0x1313('0x10')]);router['get'](_0x1313('0x11'),auth[_0x1313('0xd')](),controller['download']);router[_0x1313('0x12')]('/',auth['isAuthenticated'](),controller[_0x1313('0x13')]);router[_0x1313('0x12')](_0x1313('0xf'),auth[_0x1313('0xd')](),controller[_0x1313('0x14')]);router[_0x1313('0x12')](_0x1313('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x1313('0x16'),_0x1313('0x17')),controller[_0x1313('0x18')]);router[_0x1313('0x19')]('/:id',auth[_0x1313('0xd')](),interaction['tracked'](_0x1313('0x16'),'openchannelinteraction:update'),controller[_0x1313('0x1a')]);router[_0x1313('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x1313('0x1c')](_0x1313('0x16'),'openchannelinteraction:destroy'),controller[_0x1313('0x1d')]);router[_0x1313('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x1313('0x1e')]);module[_0x1313('0x1f')]=router; \ No newline at end of file +var _0x278d=['isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x30ff30,_0x1795b7){var _0x548fbe=function(_0x144ca7){while(--_0x144ca7){_0x30ff30['push'](_0x30ff30['shift']());}};_0x548fbe(++_0x1795b7);}(_0x278d,0x1d8));var _0xd278=function(_0x58f457,_0x990c9b){_0x58f457=_0x58f457-0x0;var _0x2e8229=_0x278d[_0x58f457];return _0x2e8229;};'use strict';var multer=require(_0xd278('0x0'));var util=require(_0xd278('0x1'));var path=require(_0xd278('0x2'));var timeout=require(_0xd278('0x3'));var express=require(_0xd278('0x4'));var router=express[_0xd278('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd278('0x6'));var interaction=require(_0xd278('0x7'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0xd278('0x8')](),controller[_0xd278('0x9')]);router[_0xd278('0xa')](_0xd278('0xb'),auth[_0xd278('0x8')](),controller[_0xd278('0xc')]);router[_0xd278('0xa')](_0xd278('0xd'),auth[_0xd278('0x8')](),controller[_0xd278('0xe')]);router[_0xd278('0xa')](_0xd278('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd278('0xa')](_0xd278('0x10'),auth[_0xd278('0x8')](),controller[_0xd278('0x11')]);router[_0xd278('0x12')]('/',auth[_0xd278('0x8')](),controller[_0xd278('0x13')]);router[_0xd278('0x12')](_0xd278('0xf'),auth[_0xd278('0x8')](),controller[_0xd278('0x14')]);router[_0xd278('0x12')](_0xd278('0x15'),auth[_0xd278('0x8')](),interaction[_0xd278('0x16')](_0xd278('0x17'),_0xd278('0x18')),controller[_0xd278('0x19')]);router['put'](_0xd278('0xd'),auth['isAuthenticated'](),interaction[_0xd278('0x16')]('openchannel',_0xd278('0x1a')),controller['update']);router[_0xd278('0x1b')]('/:id',auth[_0xd278('0x8')](),interaction[_0xd278('0x16')](_0xd278('0x17'),_0xd278('0x1c')),controller[_0xd278('0x1d')]);router['delete'](_0xd278('0x15'),auth[_0xd278('0x8')](),controller[_0xd278('0x1e')]);module[_0xd278('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4ab9214..c35183b 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 _0x4849=['BOOLEAN','sequelize','exports','DATE','STRING','ENUM','out'];(function(_0xbf5788,_0x47bffe){var _0x153258=function(_0x130794){while(--_0x130794){_0xbf5788['push'](_0xbf5788['shift']());}};_0x153258(++_0x47bffe);}(_0x4849,0x86));var _0x9484=function(_0x231ff9,_0x58335e){_0x231ff9=_0x231ff9-0x0;var _0x750bd3=_0x4849[_0x231ff9];return _0x750bd3;};'use strict';var Sequelize=require(_0x9484('0x0'));module[_0x9484('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9484('0x2')]},'disposition':{'type':Sequelize[_0x9484('0x3')]},'secondDisposition':{'type':Sequelize[_0x9484('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9484('0x3')]},'note':{'type':Sequelize[_0x9484('0x3')]},'read1stAt':{'type':Sequelize[_0x9484('0x2')]},'threadId':{'type':Sequelize[_0x9484('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x9484('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9484('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9484('0x4')]('in',_0x9484('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9484('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x9484('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x87ae=['BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x87ae,0xf5));var _0xe87a=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x87ae[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xe87a('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe87a('0x1')]},'thirdDisposition':{'type':Sequelize[_0xe87a('0x1')]},'note':{'type':Sequelize[_0xe87a('0x1')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xe87a('0x1')]},'externalUrl':{'type':Sequelize[_0xe87a('0x1')]},'lastMsgAt':{'type':Sequelize[_0xe87a('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe87a('0x3')]('in',_0xe87a('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xe87a('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 8a14f38..2c6fa90 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 _0xd76c=['openchannel','query','user','show','from','params','keys','filters','intersection','model','attributes','fields','length','merge','find','catch','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','setTags','omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','root','files','server','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closed','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','lastName','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','path','lodash','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','error','stack','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll'];(function(_0x256e37,_0x46d8f1){var _0x124ac7=function(_0x17f44e){while(--_0x17f44e){_0x256e37['push'](_0x256e37['shift']());}};_0x124ac7(++_0x46d8f1);}(_0xd76c,0xe1));var _0xcd76=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0xd76c[_0x810e4d];return _0x13f01c;};'use strict';var rimraf=require(_0xcd76('0x0'));var zipdir=require(_0xcd76('0x1'));var moment=require(_0xcd76('0x2'));var util=require('util');var path=require(_0xcd76('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcd76('0x4'));var Redis=require('ioredis');var interaction=require(_0xcd76('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0xcd76('0x6'));var logger=require('../../config/logger')(_0xcd76('0x7'));var config=require(_0xcd76('0x8'));var db=require(_0xcd76('0x9'))['db'];config[_0xcd76('0xa')]=_[_0xcd76('0xb')](config[_0xcd76('0xa')],{'host':_0xcd76('0xc'),'port':0x18eb});var socket=require(_0xcd76('0xd'))(new Redis(config[_0xcd76('0xa')]));require(_0xcd76('0xe'))[_0xcd76('0xf')](socket);function respondWithStatusCode(_0x2b95e4,_0x429968){_0x429968=_0x429968||0xcc;return function(_0x3d8845){if(_0x3d8845){return _0x2b95e4[_0xcd76('0x10')](_0x429968);}return _0x2b95e4[_0xcd76('0x11')](_0x429968)[_0xcd76('0x12')]();};}function respondWithResult(_0x5791f5,_0x2e9a73){_0x2e9a73=_0x2e9a73||0xc8;return function(_0x338d67){if(_0x338d67){return _0x5791f5[_0xcd76('0x11')](_0x2e9a73)['json'](_0x338d67);}};}function respondWithFilteredResult(_0x239fe5,_0x3d100f){return function(_0xe77e8a){if(_0xe77e8a){var _0x46dbeb=typeof _0x3d100f[_0xcd76('0x13')]===_0xcd76('0x14')&&typeof _0x3d100f[_0xcd76('0x15')]===_0xcd76('0x14');var _0x234cd4=_0xe77e8a['count'];var _0x171bdb=_0x46dbeb?0x0:_0x3d100f[_0xcd76('0x13')];var _0x449caa=_0x46dbeb?_0xe77e8a[_0xcd76('0x16')]:_0x3d100f[_0xcd76('0x13')]+_0x3d100f[_0xcd76('0x15')];var _0x57210d;if(_0x449caa>=_0x234cd4){_0x449caa=_0x234cd4;_0x57210d=0xc8;}else{_0x57210d=0xce;}_0x239fe5[_0xcd76('0x11')](_0x57210d);return _0x239fe5[_0xcd76('0x17')](_0xcd76('0x18'),_0x171bdb+'-'+_0x449caa+'/'+_0x234cd4)[_0xcd76('0x19')](_0xe77e8a);}return null;};}function saveUpdates(_0x5db4ef){return function(_0x25595e){if(_0x25595e){return _0x25595e[_0xcd76('0x1a')](_0x5db4ef)['then'](function(_0x7a8997){return _0x7a8997;});}return null;};}function removeEntity(_0x1396f3){return function(_0x4ee8a7){if(_0x4ee8a7){return _0x4ee8a7[_0xcd76('0x1b')]()[_0xcd76('0x1c')](function(){_0x1396f3[_0xcd76('0x11')](0xcc)[_0xcd76('0x12')]();});}};}function handleEntityNotFound(_0x5450c5){return function(_0x211e0d){if(!_0x211e0d){_0x5450c5[_0xcd76('0x10')](0x194);}return _0x211e0d;};}function handleError(_0x2afc50,_0x1100e4){_0x1100e4=_0x1100e4||0x1f4;return function(_0x48fed1){logger[_0xcd76('0x1d')](_0x48fed1[_0xcd76('0x1e')]);if(_0x48fed1[_0xcd76('0x1f')]){delete _0x48fed1[_0xcd76('0x1f')];}_0x2afc50[_0xcd76('0x11')](_0x1100e4)[_0xcd76('0x20')](_0x48fed1);};}exports['index']=function(_0x38f8d5,_0x20dbb9){var _0x461d9f={};var _0x2d9eba=_[_0xcd76('0x21')](db[_0xcd76('0x22')][_0xcd76('0x23')],function(_0x219960){return{'name':_0x219960[_0xcd76('0x24')],'type':_0x219960[_0xcd76('0x25')][_0xcd76('0x26')]};});_0x461d9f=qs[_0xcd76('0x27')](_0x2d9eba,_0x38f8d5);return interaction[_0xcd76('0x28')](_0xcd76('0x29'),_0x38f8d5[_0xcd76('0x2a')],_0x38f8d5[_0xcd76('0x2b')],_0x461d9f,_0x2d9eba)[_0xcd76('0x1c')](respondWithFilteredResult(_0x20dbb9,_0x461d9f))['catch'](handleError(_0x20dbb9,null));};exports[_0xcd76('0x2c')]=function(_0x3dbdcf,_0x78ac83){var _0x46edb8={};if(_0x3dbdcf[_0xcd76('0x2a')][_0xcd76('0x25')]&&_0x3dbdcf[_0xcd76('0x2a')][_0xcd76('0x25')]==='from'){_0x46edb8[_0xcd76('0x2d')]=_0x3dbdcf[_0xcd76('0x2e')]['id'];}else{_0x46edb8['id']=_0x3dbdcf[_0xcd76('0x2e')]['id'];}var _0x4febb6={'raw':![],'where':_0x46edb8},_0x1c4279={};_0x1c4279['model']=_[_0xcd76('0x2f')](db['OpenchannelInteraction']['rawAttributes']);_0x1c4279[_0xcd76('0x2a')]=_['keys'](_0x3dbdcf[_0xcd76('0x2a')]);_0x1c4279[_0xcd76('0x30')]=_[_0xcd76('0x31')](_0x1c4279[_0xcd76('0x32')],_0x1c4279[_0xcd76('0x2a')]);_0x4febb6[_0xcd76('0x33')]=_[_0xcd76('0x31')](_0x1c4279[_0xcd76('0x32')],qs['fields'](_0x3dbdcf[_0xcd76('0x2a')][_0xcd76('0x34')]));_0x4febb6[_0xcd76('0x33')]=_0x4febb6[_0xcd76('0x33')][_0xcd76('0x35')]?_0x4febb6[_0xcd76('0x33')]:_0x1c4279[_0xcd76('0x32')];if(_0x3dbdcf[_0xcd76('0x2a')]['includeAll']){_0x4febb6['include']=[{'all':!![]}];}_0x4febb6=_[_0xcd76('0x36')]({},_0x4febb6,_0x3dbdcf['options']);return db[_0xcd76('0x22')][_0xcd76('0x37')](_0x4febb6)[_0xcd76('0x1c')](handleEntityNotFound(_0x78ac83,null))[_0xcd76('0x1c')](respondWithResult(_0x78ac83,null))[_0xcd76('0x38')](handleError(_0x78ac83,null));};exports[_0xcd76('0x39')]=function(_0x36e7c4,_0x932954){return db[_0xcd76('0x22')][_0xcd76('0x39')](_0x36e7c4['body'],{})[_0xcd76('0x1c')](respondWithResult(_0x932954,0xc9))[_0xcd76('0x38')](handleError(_0x932954,null));};exports[_0xcd76('0x1a')]=function(_0x2172e4,_0x1e0b2e){if(_0x2172e4[_0xcd76('0x3a')]['id']){delete _0x2172e4[_0xcd76('0x3a')]['id'];}return db['OpenchannelInteraction'][_0xcd76('0x37')]({'where':{'id':_0x2172e4[_0xcd76('0x2e')]['id']}})[_0xcd76('0x1c')](handleEntityNotFound(_0x1e0b2e,null))[_0xcd76('0x1c')](saveUpdates(_0x2172e4[_0xcd76('0x3a')],null))[_0xcd76('0x1c')](respondWithResult(_0x1e0b2e,null))[_0xcd76('0x38')](handleError(_0x1e0b2e,null));};exports[_0xcd76('0x1b')]=function(_0x13ed2a,_0x3224c4){return db['OpenchannelInteraction'][_0xcd76('0x37')]({'where':{'id':_0x13ed2a[_0xcd76('0x2e')]['id']}})[_0xcd76('0x1c')](handleEntityNotFound(_0x3224c4,null))['then'](removeEntity(_0x3224c4,null))[_0xcd76('0x38')](handleError(_0x3224c4,null));};exports[_0xcd76('0x3b')]=function(_0x38e738,_0x555cc7){return db[_0xcd76('0x22')][_0xcd76('0x3b')]()[_0xcd76('0x1c')](respondWithResult(_0x555cc7,null))[_0xcd76('0x38')](handleError(_0x555cc7,null));};exports[_0xcd76('0x3c')]=function(_0x1942ee,_0xce669e){return db[_0xcd76('0x3d')]['find']({'where':{'id':_0x1942ee[_0xcd76('0x2e')]['id']}})['then'](handleEntityNotFound(_0xce669e,null))[_0xcd76('0x1c')](function(_0x4c6e36){if(_0x4c6e36){return _0x4c6e36[_0xcd76('0x3c')](_0x1942ee['body'][_0xcd76('0x3e')],_['omit'](_0x1942ee[_0xcd76('0x3a')],['ids','id'])||{});}})[_0xcd76('0x1c')](respondWithResult(_0xce669e,null))['catch'](handleError(_0xce669e,null));};exports[_0xcd76('0x3f')]=function(_0x481357,_0x208e8f){var _0x3b328a={'raw':![],'where':{}};var _0x3460f4={};var _0x185f40={'count':0x0,'rows':[]};return db[_0xcd76('0x22')][_0xcd76('0x40')]({'where':{'id':_0x481357[_0xcd76('0x2e')]['id']}})[_0xcd76('0x1c')](handleEntityNotFound(_0x208e8f,null))['then'](function(_0x4a278a){if(_0x4a278a){_0x3460f4[_0xcd76('0x32')]=_['keys'](db[_0xcd76('0x3d')]['rawAttributes']);_0x3460f4['query']=_['keys'](_0x481357[_0xcd76('0x2a')]);_0x3460f4['filters']=_[_0xcd76('0x31')](_0x3460f4[_0xcd76('0x32')],_0x3460f4[_0xcd76('0x2a')]);_0x3b328a[_0xcd76('0x33')]=_[_0xcd76('0x31')](_0x3460f4['model'],qs[_0xcd76('0x34')](_0x481357[_0xcd76('0x2a')][_0xcd76('0x34')]));_0x3b328a['attributes']=_0x3b328a[_0xcd76('0x33')][_0xcd76('0x35')]?_0x3b328a['attributes']:_0x3460f4[_0xcd76('0x32')];if(!_0x481357[_0xcd76('0x2a')][_0xcd76('0x41')]('nolimit')){_0x3b328a[_0xcd76('0x15')]=qs[_0xcd76('0x15')](_0x481357[_0xcd76('0x2a')][_0xcd76('0x15')]);_0x3b328a[_0xcd76('0x13')]=qs[_0xcd76('0x13')](_0x481357['query'][_0xcd76('0x13')]);}_0x3b328a[_0xcd76('0x42')]=qs[_0xcd76('0x43')](_0x481357['query'][_0xcd76('0x43')]);_0x3b328a[_0xcd76('0x44')]=qs[_0xcd76('0x30')](_[_0xcd76('0x45')](_0x481357['query'],_0x3460f4[_0xcd76('0x30')]));_0x3b328a[_0xcd76('0x44')][_0xcd76('0x46')]=_0x4a278a['id'];if(_0x481357[_0xcd76('0x2a')][_0xcd76('0x47')]){_0x3b328a[_0xcd76('0x44')]=_[_0xcd76('0x36')](_0x3b328a['where'],{'$or':_[_0xcd76('0x21')](_0x3b328a[_0xcd76('0x33')],function(_0x82b992){var _0x3704d8={};_0x3704d8[_0x82b992]={'$like':'%'+_0x481357[_0xcd76('0x2a')][_0xcd76('0x47')]+'%'};return _0x3704d8;})});}if(_0x481357[_0xcd76('0x2a')][_0xcd76('0x48')]){var _0x1386f0=_0x481357[_0xcd76('0x2a')][_0xcd76('0x48')][_0xcd76('0x49')](',');var _0x7dc90c={};_0x7dc90c[_0x1386f0[0x0]]={'$gte':moment(_0x1386f0[0x1])[_0xcd76('0x4a')](_0xcd76('0x4b'))};_0x3b328a[_0xcd76('0x44')]=_[_0xcd76('0x36')](_0x3b328a['where'],_0x7dc90c);}_0x3b328a=_[_0xcd76('0x36')]({},_0x3b328a,_0x481357['options']);return db[_0xcd76('0x3d')][_0xcd76('0x16')]({'where':_0x3b328a[_0xcd76('0x44')]})['then'](function(_0x4a72c9){_0x185f40[_0xcd76('0x16')]=_0x4a72c9;if(_0x481357[_0xcd76('0x2a')][_0xcd76('0x4c')]){_0x3b328a[_0xcd76('0x4d')]=[{'all':!![]}];}return db[_0xcd76('0x3d')][_0xcd76('0x28')](_0x3b328a);})['then'](function(_0x1abc2b){_0x185f40['rows']=_0x1abc2b;return _0x185f40;});}})[_0xcd76('0x1c')](respondWithFilteredResult(_0x208e8f,_0x3b328a))[_0xcd76('0x38')](handleError(_0x208e8f,null));};exports['addTags']=function(_0x2a05d5,_0xb77227){return db[_0xcd76('0x22')][_0xcd76('0x37')]({'where':{'id':_0x2a05d5[_0xcd76('0x2e')]['id']}})[_0xcd76('0x1c')](handleEntityNotFound(_0xb77227,null))[_0xcd76('0x1c')](function(_0x3c8748){if(_0x3c8748){return _0x3c8748[_0xcd76('0x4e')](_0x2a05d5[_0xcd76('0x3a')][_0xcd76('0x3e')],_[_0xcd76('0x4f')](_0x2a05d5['body'],[_0xcd76('0x3e'),'id'])||{})[_0xcd76('0x50')](function(){return db[_0xcd76('0x51')][_0xcd76('0x28')]({'attributes':['id','name',_0xcd76('0x52')],'where':{'id':_0x2a05d5[_0xcd76('0x3a')][_0xcd76('0x3e')]}});})[_0xcd76('0x1c')](function(_0x3d0684){socket[_0xcd76('0x53')](_0xcd76('0x54'),{'id':Number(_0x2a05d5[_0xcd76('0x2e')]['id']),'tags':_0x3d0684||[]});return{'id':Number(_0x2a05d5[_0xcd76('0x2e')]['id']),'tags':_0x3d0684||[]};});}})['then'](respondWithResult(_0xb77227,null))['catch'](handleError(_0xb77227,null));};exports[_0xcd76('0x55')]=function(_0xb3fe69,_0x8b388){return db[_0xcd76('0x22')][_0xcd76('0x37')]({'where':{'id':_0xb3fe69['params']['id']}})[_0xcd76('0x1c')](handleEntityNotFound(_0x8b388,null))['then'](function(_0xdeedd4){if(_0xdeedd4){return _0xdeedd4[_0xcd76('0x55')](_0xb3fe69['query'][_0xcd76('0x3e')]);}})[_0xcd76('0x1c')](respondWithStatusCode(_0x8b388,null))['catch'](handleError(_0x8b388,null));};exports['download']=function(_0x2dbf66,_0x54e766){var _0x1f1ef2=moment()[_0xcd76('0x56')]()[_0xcd76('0x57')]();var _0x909844=path[_0xcd76('0x58')](config[_0xcd76('0x59')],'server',_0xcd76('0x5a'),'tmp');var _0xaed5b2=path['join'](config['root'],_0xcd76('0x5b'),_0xcd76('0x5a'),'attachments');var _0x169751=path[_0xcd76('0x58')](_0x909844,_0x1f1ef2);var _0x57da8f=util[_0xcd76('0x4a')]('transcript-%d-%s.zip',_0x2dbf66[_0xcd76('0x2e')]['id'],_0x1f1ef2);var _0x93c206=path[_0xcd76('0x58')](_0x909844,_0x57da8f);var _0x309de0=[];_0x309de0[_0xcd76('0x5c')]({'model':db[_0xcd76('0x5d')],'as':_0xcd76('0x5d'),'attributes':['id',_0xcd76('0x5e')],'raw':!![]});_0x309de0[_0xcd76('0x5c')]({'model':db[_0xcd76('0x5f')],'as':_0xcd76('0x60'),'attributes':['id',_0xcd76('0x61'),'lastName'],'raw':!![]});if(_0x2dbf66[_0xcd76('0x2a')]['attachments']){_0x309de0[_0xcd76('0x5c')]({'model':db[_0xcd76('0x62')],'as':_0xcd76('0x62'),'raw':!![]});}var _0x45c0c3=[{'model':db['OpenchannelMessage'],'as':_0xcd76('0x63'),'attributes':['id',_0xcd76('0x3a'),_0xcd76('0x64'),_0xcd76('0x65'),'secret',_0xcd76('0x66')],'include':_0x309de0}];_0x45c0c3[_0xcd76('0x5c')]({'model':db[_0xcd76('0x67')],'as':_0xcd76('0x68'),'attributes':['id',_0xcd76('0x1f')]});_0x45c0c3[_0xcd76('0x5c')]({'model':db[_0xcd76('0x5d')],'as':_0xcd76('0x69'),'attributes':['id',_0xcd76('0x5e')]});return db[_0xcd76('0x22')][_0xcd76('0x37')]({'where':{'id':_0x2dbf66[_0xcd76('0x2e')]['id']},'include':_0x45c0c3})[_0xcd76('0x1c')](handleEntityNotFound(_0x54e766,null))['then'](function(_0x41f7cd){if(_0x41f7cd){var _0x1907a5=_0x41f7cd[_0xcd76('0x6a')]({'plain':!![]});fs[_0xcd76('0x6b')](_0x169751);var _0x361479={'channel':_0xcd76('0x6c'),'account':_0x1907a5[_0xcd76('0x68')][_0xcd76('0x1f')],'agent':_0x1907a5['Owner']?_0x1907a5[_0xcd76('0x69')][_0xcd76('0x5e')]:'N.A.','createdAt':moment(_0x1907a5['createdAt'])[_0xcd76('0x4a')](_0xcd76('0x4b'))['toString'](),'closedAt':_0x1907a5[_0xcd76('0x6d')]?moment(_0x1907a5[_0xcd76('0x6e')])[_0xcd76('0x4a')](_0xcd76('0x4b'))[_0xcd76('0x57')]():'','disposition':_0x1907a5[_0xcd76('0x6f')],'visibility':_0x1907a5[_0xcd76('0x70')]?_0xcd76('0x71'):_0xcd76('0x72'),'messages':_(_0x1907a5[_0xcd76('0x63')])[_0xcd76('0x47')]({'secret':![]})[_0xcd76('0x21')](function(_0x46eea7){if(_0x46eea7[_0xcd76('0x62')]){var _0x4645c6=path['join'](_0xaed5b2,_0x46eea7[_0xcd76('0x62')]['basename']);if(fs[_0xcd76('0x73')](_0x4645c6)){fs[_0xcd76('0x74')](_0x4645c6)[_0xcd76('0x75')](fs[_0xcd76('0x76')](path[_0xcd76('0x58')](_0x169751,_0x46eea7[_0xcd76('0x62')][_0xcd76('0x77')])));}}return{'date':moment(_0x46eea7[_0xcd76('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xcd76('0x57')](),'sender':_0x46eea7['direction']===_0xcd76('0x78')?_0x46eea7[_0xcd76('0x5d')]?_0x46eea7[_0xcd76('0x5d')][_0xcd76('0x5e')]:_0xcd76('0x79'):_0x46eea7[_0xcd76('0x60')]['firstName']+(_0x46eea7[_0xcd76('0x60')]['lastName']?'\x20'+_0x46eea7[_0xcd76('0x60')][_0xcd76('0x7a')]:''),'body':_0x46eea7[_0xcd76('0x62')]?_0x46eea7[_0xcd76('0x62')]['basename']:_0x46eea7['body'],'direction':_0x46eea7[_0xcd76('0x65')]===_0xcd76('0x78')?'A':'C','secret':_0x46eea7[_0xcd76('0x7b')],'read':_0x46eea7['read'],'attachment':_0x46eea7['Attachment']};})[_0xcd76('0x7c')]()};return ejs[_0xcd76('0x7d')](path['join'](config[_0xcd76('0x59')],_0xcd76('0x5b'),_0xcd76('0x7e'),_0xcd76('0x7f')),{'interaction':_0x361479})[_0xcd76('0x1c')](function(_0x27f1ef){var _0x17429a=path[_0xcd76('0x58')](_0x169751,_0xcd76('0x80')+_0x1907a5['id']+'-'+_0x1f1ef2+'.pdf');var _0x35f8a9={'path':_0x17429a,'channel':'Openchannel','interactionId':_0x1907a5['id']};return pdf[_0xcd76('0x81')](_0x27f1ef,_0x35f8a9);})[_0xcd76('0x1c')](function(){return new Promise(function(_0x24fc35,_0x4ac81c){zipdir(_0x169751,{'saveTo':_0x93c206},function(_0x1b2657,_0x252138){if(_0x1b2657)return _0x4ac81c(_0x1b2657);return _0x24fc35(_0x252138);});})['then'](function(){return new Promise(function(_0x13c09a,_0x8334f){rimraf(_0x169751,function(_0x2a9e07){if(_0x2a9e07)_0x8334f(_0x2a9e07);return _0x13c09a();});});})['then'](function(){return _0x54e766[_0xcd76('0x82')](_0x93c206,_0x57da8f,function(_0x46903c){if(_0x46903c){logger['error'](_0xcd76('0x83'),_0x46903c);}else{fs[_0xcd76('0x84')](_0x93c206);}});});});}else{return _0x54e766[_0xcd76('0x10')](0xc8);}})[_0xcd76('0x38')](handleError(_0x54e766,null));}; \ No newline at end of file +var _0x6e91=['Messages','basename','existsSync','pipe','direction','out','System','read','server','views','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','name','send','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','findAll','user','catch','show','query','from','params','model','keys','attributes','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','filters','intersection','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','files','push','User','fullname','CmContact','Contact','firstName','lastName','attachments','Attachment','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','createdAt','closed','threadId','Private'];(function(_0x2cd03b,_0x7d0fe2){var _0x458ff5=function(_0x176701){while(--_0x176701){_0x2cd03b['push'](_0x2cd03b['shift']());}};_0x458ff5(++_0x7d0fe2);}(_0x6e91,0x88));var _0x16e9=function(_0x46067f,_0x1e32c6){_0x46067f=_0x46067f-0x0;var _0x4b585d=_0x6e91[_0x46067f];return _0x4b585d;};'use strict';var rimraf=require(_0x16e9('0x0'));var zipdir=require(_0x16e9('0x1'));var moment=require(_0x16e9('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x16e9('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x16e9('0x4'));var interaction=require(_0x16e9('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x16e9('0x6'));var logger=require(_0x16e9('0x7'))(_0x16e9('0x8'));var config=require(_0x16e9('0x9'));var db=require(_0x16e9('0xa'))['db'];config[_0x16e9('0xb')]=_[_0x16e9('0xc')](config['redis'],{'host':_0x16e9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x16e9('0xb')]));require('./openchannelInteraction.socket')[_0x16e9('0xe')](socket);function respondWithStatusCode(_0x326e6c,_0x4db87b){_0x4db87b=_0x4db87b||0xcc;return function(_0x1628e2){if(_0x1628e2){return _0x326e6c[_0x16e9('0xf')](_0x4db87b);}return _0x326e6c[_0x16e9('0x10')](_0x4db87b)[_0x16e9('0x11')]();};}function respondWithResult(_0x190770,_0x3f266e){_0x3f266e=_0x3f266e||0xc8;return function(_0x1ae34c){if(_0x1ae34c){return _0x190770['status'](_0x3f266e)[_0x16e9('0x12')](_0x1ae34c);}};}function respondWithFilteredResult(_0x4c6e4f,_0x20cd19){return function(_0x4dbe83){if(_0x4dbe83){var _0xe96232=typeof _0x20cd19[_0x16e9('0x13')]===_0x16e9('0x14')&&typeof _0x20cd19[_0x16e9('0x15')]===_0x16e9('0x14');var _0x57ec6a=_0x4dbe83[_0x16e9('0x16')];var _0x5984f4=_0xe96232?0x0:_0x20cd19[_0x16e9('0x13')];var _0x47d911=_0xe96232?_0x4dbe83[_0x16e9('0x16')]:_0x20cd19['offset']+_0x20cd19['limit'];var _0x4de6b0;if(_0x47d911>=_0x57ec6a){_0x47d911=_0x57ec6a;_0x4de6b0=0xc8;}else{_0x4de6b0=0xce;}_0x4c6e4f[_0x16e9('0x10')](_0x4de6b0);return _0x4c6e4f[_0x16e9('0x17')]('Content-Range',_0x5984f4+'-'+_0x47d911+'/'+_0x57ec6a)[_0x16e9('0x12')](_0x4dbe83);}return null;};}function saveUpdates(_0x4ddd1c){return function(_0x42f4a2){if(_0x42f4a2){return _0x42f4a2[_0x16e9('0x18')](_0x4ddd1c)[_0x16e9('0x19')](function(_0x4638a0){return _0x4638a0;});}return null;};}function removeEntity(_0x11465f){return function(_0x1f63e2){if(_0x1f63e2){return _0x1f63e2['destroy']()[_0x16e9('0x19')](function(){_0x11465f[_0x16e9('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x102ff8){return function(_0x1d4a65){if(!_0x1d4a65){_0x102ff8[_0x16e9('0xf')](0x194);}return _0x1d4a65;};}function handleError(_0x355f66,_0x4efab7){_0x4efab7=_0x4efab7||0x1f4;return function(_0x54fee7){logger[_0x16e9('0x1a')](_0x54fee7['stack']);if(_0x54fee7[_0x16e9('0x1b')]){delete _0x54fee7[_0x16e9('0x1b')];}_0x355f66[_0x16e9('0x10')](_0x4efab7)[_0x16e9('0x1c')](_0x54fee7);};}exports['index']=function(_0x2211b4,_0x5acf57){var _0x28423a={};var _0x238e73=_[_0x16e9('0x1d')](db[_0x16e9('0x1e')][_0x16e9('0x1f')],function(_0x94df7f){return{'name':_0x94df7f['fieldName'],'type':_0x94df7f[_0x16e9('0x20')][_0x16e9('0x21')]};});_0x28423a=qs[_0x16e9('0x22')](_0x238e73,_0x2211b4);return interaction[_0x16e9('0x23')]('openchannel',_0x2211b4['query'],_0x2211b4[_0x16e9('0x24')],_0x28423a,_0x238e73)[_0x16e9('0x19')](respondWithFilteredResult(_0x5acf57,_0x28423a))[_0x16e9('0x25')](handleError(_0x5acf57,null));};exports[_0x16e9('0x26')]=function(_0x4a16fe,_0x37ef67){var _0x24217b={};if(_0x4a16fe['query'][_0x16e9('0x20')]&&_0x4a16fe[_0x16e9('0x27')][_0x16e9('0x20')]===_0x16e9('0x28')){_0x24217b[_0x16e9('0x28')]=_0x4a16fe['params']['id'];}else{_0x24217b['id']=_0x4a16fe[_0x16e9('0x29')]['id'];}var _0x306859={'raw':![],'where':_0x24217b},_0x452fd8={};_0x452fd8[_0x16e9('0x2a')]=_[_0x16e9('0x2b')](db[_0x16e9('0x1e')][_0x16e9('0x1f')]);_0x452fd8['query']=_['keys'](_0x4a16fe['query']);_0x452fd8['filters']=_['intersection'](_0x452fd8[_0x16e9('0x2a')],_0x452fd8['query']);_0x306859[_0x16e9('0x2c')]=_['intersection'](_0x452fd8[_0x16e9('0x2a')],qs[_0x16e9('0x2d')](_0x4a16fe['query']['fields']));_0x306859['attributes']=_0x306859[_0x16e9('0x2c')][_0x16e9('0x2e')]?_0x306859['attributes']:_0x452fd8[_0x16e9('0x2a')];if(_0x4a16fe['query'][_0x16e9('0x2f')]){_0x306859[_0x16e9('0x30')]=[{'all':!![]}];}_0x306859=_[_0x16e9('0x31')]({},_0x306859,_0x4a16fe[_0x16e9('0x32')]);return db['OpenchannelInteraction'][_0x16e9('0x33')](_0x306859)[_0x16e9('0x19')](handleEntityNotFound(_0x37ef67,null))[_0x16e9('0x19')](respondWithResult(_0x37ef67,null))[_0x16e9('0x25')](handleError(_0x37ef67,null));};exports[_0x16e9('0x34')]=function(_0x1c5050,_0x1082a5){return db[_0x16e9('0x1e')][_0x16e9('0x34')](_0x1c5050[_0x16e9('0x35')],{})['then'](respondWithResult(_0x1082a5,0xc9))['catch'](handleError(_0x1082a5,null));};exports[_0x16e9('0x18')]=function(_0x13f962,_0xfe18af){if(_0x13f962[_0x16e9('0x35')]['id']){delete _0x13f962[_0x16e9('0x35')]['id'];}return db[_0x16e9('0x1e')][_0x16e9('0x33')]({'where':{'id':_0x13f962[_0x16e9('0x29')]['id']}})[_0x16e9('0x19')](handleEntityNotFound(_0xfe18af,null))['then'](saveUpdates(_0x13f962[_0x16e9('0x35')],null))[_0x16e9('0x19')](respondWithResult(_0xfe18af,null))['catch'](handleError(_0xfe18af,null));};exports[_0x16e9('0x36')]=function(_0x384617,_0xc61cf9){return db[_0x16e9('0x1e')][_0x16e9('0x33')]({'where':{'id':_0x384617[_0x16e9('0x29')]['id']}})['then'](handleEntityNotFound(_0xc61cf9,null))['then'](removeEntity(_0xc61cf9,null))[_0x16e9('0x25')](handleError(_0xc61cf9,null));};exports[_0x16e9('0x37')]=function(_0x3fd0bd,_0x133165){return db[_0x16e9('0x1e')][_0x16e9('0x37')]()['then'](respondWithResult(_0x133165,null))[_0x16e9('0x25')](handleError(_0x133165,null));};exports[_0x16e9('0x38')]=function(_0x1b511f,_0x31e633){return db[_0x16e9('0x39')][_0x16e9('0x33')]({'where':{'id':_0x1b511f[_0x16e9('0x29')]['id']}})[_0x16e9('0x19')](handleEntityNotFound(_0x31e633,null))[_0x16e9('0x19')](function(_0x334c54){if(_0x334c54){return _0x334c54['addMessage'](_0x1b511f[_0x16e9('0x35')][_0x16e9('0x3a')],_[_0x16e9('0x3b')](_0x1b511f[_0x16e9('0x35')],[_0x16e9('0x3a'),'id'])||{});}})[_0x16e9('0x19')](respondWithResult(_0x31e633,null))[_0x16e9('0x25')](handleError(_0x31e633,null));};exports[_0x16e9('0x3c')]=function(_0x41f0d3,_0x24b141){var _0x196042={'raw':![],'where':{}};var _0x18dbd0={};var _0x59d32d={'count':0x0,'rows':[]};return db[_0x16e9('0x1e')][_0x16e9('0x3d')]({'where':{'id':_0x41f0d3['params']['id']}})[_0x16e9('0x19')](handleEntityNotFound(_0x24b141,null))[_0x16e9('0x19')](function(_0x4c5caf){if(_0x4c5caf){_0x18dbd0['model']=_[_0x16e9('0x2b')](db['OpenchannelMessage'][_0x16e9('0x1f')]);_0x18dbd0[_0x16e9('0x27')]=_[_0x16e9('0x2b')](_0x41f0d3[_0x16e9('0x27')]);_0x18dbd0[_0x16e9('0x3e')]=_[_0x16e9('0x3f')](_0x18dbd0['model'],_0x18dbd0[_0x16e9('0x27')]);_0x196042[_0x16e9('0x2c')]=_[_0x16e9('0x3f')](_0x18dbd0['model'],qs[_0x16e9('0x2d')](_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x2d')]));_0x196042[_0x16e9('0x2c')]=_0x196042[_0x16e9('0x2c')]['length']?_0x196042[_0x16e9('0x2c')]:_0x18dbd0[_0x16e9('0x2a')];if(!_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x40')](_0x16e9('0x41'))){_0x196042[_0x16e9('0x15')]=qs[_0x16e9('0x15')](_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x15')]);_0x196042[_0x16e9('0x13')]=qs[_0x16e9('0x13')](_0x41f0d3['query'][_0x16e9('0x13')]);}_0x196042[_0x16e9('0x42')]=qs[_0x16e9('0x43')](_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x43')]);_0x196042[_0x16e9('0x44')]=qs[_0x16e9('0x3e')](_[_0x16e9('0x45')](_0x41f0d3['query'],_0x18dbd0[_0x16e9('0x3e')]));_0x196042['where'][_0x16e9('0x46')]=_0x4c5caf['id'];if(_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x47')]){_0x196042[_0x16e9('0x44')]=_[_0x16e9('0x31')](_0x196042[_0x16e9('0x44')],{'$or':_['map'](_0x196042[_0x16e9('0x2c')],function(_0x43848a){var _0x13b198={};_0x13b198[_0x43848a]={'$like':'%'+_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x47')]+'%'};return _0x13b198;})});}if(_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x48')]){var _0x59e494=_0x41f0d3[_0x16e9('0x27')][_0x16e9('0x48')]['split'](',');var _0x183e7f={};_0x183e7f[_0x59e494[0x0]]={'$gte':moment(_0x59e494[0x1])[_0x16e9('0x49')](_0x16e9('0x4a'))};_0x196042['where']=_[_0x16e9('0x31')](_0x196042['where'],_0x183e7f);}_0x196042=_['merge']({},_0x196042,_0x41f0d3[_0x16e9('0x32')]);return db['OpenchannelMessage'][_0x16e9('0x16')]({'where':_0x196042[_0x16e9('0x44')]})[_0x16e9('0x19')](function(_0x3b75b3){_0x59d32d['count']=_0x3b75b3;if(_0x41f0d3[_0x16e9('0x27')]['includeAll']){_0x196042[_0x16e9('0x30')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x16e9('0x23')](_0x196042);})[_0x16e9('0x19')](function(_0x15d331){_0x59d32d['rows']=_0x15d331;return _0x59d32d;});}})[_0x16e9('0x19')](respondWithFilteredResult(_0x24b141,_0x196042))['catch'](handleError(_0x24b141,null));};exports[_0x16e9('0x4b')]=function(_0x35ec45,_0x4ad340){return db[_0x16e9('0x1e')][_0x16e9('0x33')]({'where':{'id':_0x35ec45[_0x16e9('0x29')]['id']}})[_0x16e9('0x19')](handleEntityNotFound(_0x4ad340,null))[_0x16e9('0x19')](function(_0xbf8fd7){if(_0xbf8fd7){return _0xbf8fd7[_0x16e9('0x4c')](_0x35ec45[_0x16e9('0x35')][_0x16e9('0x3a')],_[_0x16e9('0x3b')](_0x35ec45[_0x16e9('0x35')],[_0x16e9('0x3a'),'id'])||{})[_0x16e9('0x4d')](function(){return db[_0x16e9('0x4e')][_0x16e9('0x23')]({'attributes':['id','name',_0x16e9('0x4f')],'where':{'id':_0x35ec45['body'][_0x16e9('0x3a')]}});})[_0x16e9('0x19')](function(_0x4594ee){socket[_0x16e9('0x50')](_0x16e9('0x51'),{'id':Number(_0x35ec45[_0x16e9('0x29')]['id']),'tags':_0x4594ee||[]});return{'id':Number(_0x35ec45[_0x16e9('0x29')]['id']),'tags':_0x4594ee||[]};});}})[_0x16e9('0x19')](respondWithResult(_0x4ad340,null))['catch'](handleError(_0x4ad340,null));};exports[_0x16e9('0x52')]=function(_0x39df4e,_0x1cf3bb){return db[_0x16e9('0x1e')][_0x16e9('0x33')]({'where':{'id':_0x39df4e[_0x16e9('0x29')]['id']}})[_0x16e9('0x19')](handleEntityNotFound(_0x1cf3bb,null))['then'](function(_0x1767dc){if(_0x1767dc){return _0x1767dc['removeTags'](_0x39df4e[_0x16e9('0x27')][_0x16e9('0x3a')]);}})[_0x16e9('0x19')](respondWithStatusCode(_0x1cf3bb,null))[_0x16e9('0x25')](handleError(_0x1cf3bb,null));};exports[_0x16e9('0x53')]=function(_0x433b55,_0x34c287){var _0x54d732=moment()[_0x16e9('0x54')]()[_0x16e9('0x55')]();var _0x5efb57=path[_0x16e9('0x56')](config[_0x16e9('0x57')],'server',_0x16e9('0x58'),'tmp');var _0x14b150=path['join'](config[_0x16e9('0x57')],'server',_0x16e9('0x58'),'attachments');var _0xeef4f5=path['join'](_0x5efb57,_0x54d732);var _0x92167b=util[_0x16e9('0x49')]('transcript-%d-%s.zip',_0x433b55[_0x16e9('0x29')]['id'],_0x54d732);var _0x280c42=path['join'](_0x5efb57,_0x92167b);var _0x2e625f=[];_0x2e625f[_0x16e9('0x59')]({'model':db[_0x16e9('0x5a')],'as':_0x16e9('0x5a'),'attributes':['id',_0x16e9('0x5b')],'raw':!![]});_0x2e625f[_0x16e9('0x59')]({'model':db[_0x16e9('0x5c')],'as':_0x16e9('0x5d'),'attributes':['id',_0x16e9('0x5e'),_0x16e9('0x5f')],'raw':!![]});if(_0x433b55['query'][_0x16e9('0x60')]){_0x2e625f[_0x16e9('0x59')]({'model':db[_0x16e9('0x61')],'as':'Attachment','raw':!![]});}var _0x3711c3=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x16e9('0x35'),'createdAt','direction',_0x16e9('0x62'),'read'],'include':_0x2e625f}];_0x3711c3['push']({'model':db[_0x16e9('0x63')],'as':_0x16e9('0x64'),'attributes':['id',_0x16e9('0x1b')]});_0x3711c3[_0x16e9('0x59')]({'model':db['User'],'as':_0x16e9('0x65'),'attributes':['id',_0x16e9('0x5b')]});return db[_0x16e9('0x1e')][_0x16e9('0x33')]({'where':{'id':_0x433b55[_0x16e9('0x29')]['id']},'include':_0x3711c3})[_0x16e9('0x19')](handleEntityNotFound(_0x34c287,null))['then'](function(_0x2f960c){if(_0x2f960c){var _0x2c46e3=_0x2f960c[_0x16e9('0x66')]({'plain':!![]});fs[_0x16e9('0x67')](_0xeef4f5);var _0x5d6adc={'channel':_0x16e9('0x68'),'account':_0x2c46e3['Account'][_0x16e9('0x1b')],'agent':_0x2c46e3[_0x16e9('0x65')]?_0x2c46e3[_0x16e9('0x65')][_0x16e9('0x5b')]:_0x16e9('0x69'),'createdAt':moment(_0x2c46e3[_0x16e9('0x6a')])[_0x16e9('0x49')](_0x16e9('0x4a'))[_0x16e9('0x55')](),'closedAt':_0x2c46e3[_0x16e9('0x6b')]?moment(_0x2c46e3['closedAt'])[_0x16e9('0x49')](_0x16e9('0x4a'))['toString']():'','disposition':_0x2c46e3['disposition'],'visibility':_0x2c46e3[_0x16e9('0x6c')]?'Public':_0x16e9('0x6d'),'messages':_(_0x2c46e3[_0x16e9('0x6e')])[_0x16e9('0x47')]({'secret':![]})[_0x16e9('0x1d')](function(_0x3ac6d0){if(_0x3ac6d0[_0x16e9('0x61')]){var _0x5dcaf7=path[_0x16e9('0x56')](_0x14b150,_0x3ac6d0[_0x16e9('0x61')][_0x16e9('0x6f')]);if(fs[_0x16e9('0x70')](_0x5dcaf7)){fs['createReadStream'](_0x5dcaf7)[_0x16e9('0x71')](fs['createWriteStream'](path[_0x16e9('0x56')](_0xeef4f5,_0x3ac6d0[_0x16e9('0x61')][_0x16e9('0x6f')])));}}return{'date':moment(_0x3ac6d0[_0x16e9('0x6a')])[_0x16e9('0x49')](_0x16e9('0x4a'))[_0x16e9('0x55')](),'sender':_0x3ac6d0[_0x16e9('0x72')]===_0x16e9('0x73')?_0x3ac6d0[_0x16e9('0x5a')]?_0x3ac6d0[_0x16e9('0x5a')][_0x16e9('0x5b')]:_0x16e9('0x74'):_0x3ac6d0[_0x16e9('0x5d')][_0x16e9('0x5e')]+(_0x3ac6d0[_0x16e9('0x5d')][_0x16e9('0x5f')]?'\x20'+_0x3ac6d0[_0x16e9('0x5d')]['lastName']:''),'body':_0x3ac6d0[_0x16e9('0x61')]?_0x3ac6d0[_0x16e9('0x61')][_0x16e9('0x6f')]:_0x3ac6d0[_0x16e9('0x35')],'direction':_0x3ac6d0[_0x16e9('0x72')]===_0x16e9('0x73')?'A':'C','secret':_0x3ac6d0['secret'],'read':_0x3ac6d0[_0x16e9('0x75')],'attachment':_0x3ac6d0['Attachment']};})['value']()};return ejs['renderFile'](path[_0x16e9('0x56')](config['root'],_0x16e9('0x76'),_0x16e9('0x77'),'downloadInteraction.ejs'),{'interaction':_0x5d6adc})['then'](function(_0x3983ff){var _0x16884d=path[_0x16e9('0x56')](_0xeef4f5,'transcript-'+_0x2c46e3['id']+'-'+_0x54d732+_0x16e9('0x78'));var _0x590fb7={'path':_0x16884d,'channel':_0x16e9('0x68'),'interactionId':_0x2c46e3['id']};return pdf[_0x16e9('0x79')](_0x3983ff,_0x590fb7);})[_0x16e9('0x19')](function(){return new Promise(function(_0x3d68af,_0xbbfeee){zipdir(_0xeef4f5,{'saveTo':_0x280c42},function(_0x505a41,_0x22be66){if(_0x505a41)return _0xbbfeee(_0x505a41);return _0x3d68af(_0x22be66);});})[_0x16e9('0x19')](function(){return new Promise(function(_0x5aba1c,_0x356341){rimraf(_0xeef4f5,function(_0x2029f2){if(_0x2029f2)_0x356341(_0x2029f2);return _0x5aba1c();});});})[_0x16e9('0x19')](function(){return _0x34c287[_0x16e9('0x53')](_0x280c42,_0x92167b,function(_0x46d793){if(_0x46d793){logger['error']('Unable\x20to\x20delete\x20zip\x20file',_0x46d793);}else{fs[_0x16e9('0x7a')](_0x280c42);}});});});}else{return _0x34c287[_0x16e9('0xf')](0xc8);}})[_0x16e9('0x25')](handleError(_0x34c287,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 6ea36cd..d52a8fa 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 _0xd71f=['getUsers','then','Users','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','update','remove'];(function(_0x19b869,_0x346fe3){var _0x330778=function(_0x4573c0){while(--_0x4573c0){_0x19b869['push'](_0x19b869['shift']());}};_0x330778(++_0x346fe3);}(_0xd71f,0x18a));var _0xfd71=function(_0x44fe1b,_0x38db6a){_0x44fe1b=_0x44fe1b-0x0;var _0x5a0a34=_0xd71f[_0x44fe1b];return _0x5a0a34;};'use strict';var EventEmitter=require(_0xfd71('0x0'));var OpenchannelInteraction=require(_0xfd71('0x1'))['db'][_0xfd71('0x2')];var OpenchannelMessage=require(_0xfd71('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xfd71('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfd71('0x4'),'afterDestroy':_0xfd71('0x5')};function emitEvent(_0x176800){return function(_0x49bd83,_0x214494,_0x3b869c){_0x49bd83[_0xfd71('0x6')]({'attributes':['id'],'raw':!![]})[_0xfd71('0x7')](function(_0x5bc77e){_0x49bd83['setDataValue'](_0xfd71('0x8'),_0x5bc77e['map'](function(_0x643cb8){return{'id':_0x643cb8['id']};}));return OpenchannelMessage[_0xfd71('0x9')]({'where':{'OpenchannelInteractionId':_0x49bd83['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfd71('0x7')](function(_0x3fcf3d){_0x49bd83[_0xfd71('0xa')](_0xfd71('0xb'),_0x3fcf3d['length']);OpenchannelInteractionEvents['emit'](_0x176800+':'+_0x49bd83['id'],_0x49bd83);OpenchannelInteractionEvents[_0xfd71('0xc')](_0x176800,_0x49bd83);_0x3b869c(null);})[_0xfd71('0xd')](_0x3b869c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xfd71('0xe')](e,emitEvent(event));}}module[_0xfd71('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x3346=['Users','map','findAll','then','unreadMessages','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','getUsers','setDataValue'];(function(_0x3bd84e,_0x1e4a81){var _0xbf14d1=function(_0x4bdfe4){while(--_0x4bdfe4){_0x3bd84e['push'](_0x3bd84e['shift']());}};_0xbf14d1(++_0x1e4a81);}(_0x3346,0x68));var _0x6334=function(_0x5b3b71,_0x13dcf1){_0x5b3b71=_0x5b3b71-0x0;var _0x398b9b=_0x3346[_0x5b3b71];return _0x398b9b;};'use strict';var EventEmitter=require(_0x6334('0x0'));var OpenchannelInteraction=require(_0x6334('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x6334('0x1'))['db'][_0x6334('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6334('0x3')](0x0);var events={'afterCreate':_0x6334('0x4'),'afterUpdate':_0x6334('0x5'),'afterDestroy':'remove'};function emitEvent(_0x10fccb){return function(_0xb8ac03,_0x5c87ad,_0x40f7b9){_0xb8ac03[_0x6334('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x11cdbc){_0xb8ac03[_0x6334('0x7')](_0x6334('0x8'),_0x11cdbc[_0x6334('0x9')](function(_0x15b558){return{'id':_0x15b558['id']};}));return OpenchannelMessage[_0x6334('0xa')]({'where':{'OpenchannelInteractionId':_0xb8ac03['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6334('0xb')](function(_0x43d9d4){_0xb8ac03[_0x6334('0x7')](_0x6334('0xc'),_0x43d9d4['length']);OpenchannelInteractionEvents['emit'](_0x10fccb+':'+_0xb8ac03['id'],_0xb8ac03);OpenchannelInteractionEvents[_0x6334('0xd')](_0x10fccb,_0xb8ac03);_0x40f7b9(null);})['catch'](_0x40f7b9(null));};}for(var e in events){if(events[_0x6334('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x6334('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5fcb202..8cdbfb0 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 _0xa7f6=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','closed'];(function(_0x3e257e,_0x483b3f){var _0x5f17ff=function(_0x3572f3){while(--_0x3572f3){_0x3e257e['push'](_0x3e257e['shift']());}};_0x5f17ff(++_0x483b3f);}(_0xa7f6,0xf9));var _0x6a7f=function(_0x3fbc55,_0x29bdbb){_0x3fbc55=_0x3fbc55-0x0;var _0xa03c71=_0xa7f6[_0x3fbc55];return _0xa03c71;};'use strict';var _=require(_0x6a7f('0x0'));var util=require(_0x6a7f('0x1'));var logger=require('../../config/logger')(_0x6a7f('0x2'));var moment=require('moment');var BPromise=require(_0x6a7f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a7f('0x4'));var rimraf=require(_0x6a7f('0x5'));var config=require(_0x6a7f('0x6'));var attributes=require(_0x6a7f('0x7'));module['exports']=function(_0x38e111,_0x506e6a){return _0x38e111[_0x6a7f('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x6a7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x3d1c66,_0x1e6849,_0x231c90){if(_0x3d1c66['changed'](_0x6a7f('0xa'))){_0x3d1c66[_0x6a7f('0xb')]=moment()['format'](_0x6a7f('0xc'));}_0x231c90(null,_0x3d1c66);}}});}; \ No newline at end of file +var _0xb448=['utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4'];(function(_0xc52898,_0x165722){var _0x1941d7=function(_0x3de672){while(--_0x3de672){_0xc52898['push'](_0xc52898['shift']());}};_0x1941d7(++_0x165722);}(_0xb448,0x1c5));var _0x8b44=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb448[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x8b44('0x0'));var util=require(_0x8b44('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8b44('0x2'));var rp=require(_0x8b44('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b44('0x4'));var config=require(_0x8b44('0x5'));var attributes=require(_0x8b44('0x6'));module[_0x8b44('0x7')]=function(_0x1a27ff,_0x49bc56){return _0x1a27ff[_0x8b44('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x8b44('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b44('0xa'),'collate':_0x8b44('0xb'),'hooks':{'beforeUpdate':function(_0x46c73a,_0x11371f,_0x3bcfcf){if(_0x46c73a[_0x8b44('0xc')](_0x8b44('0xd'))){_0x46c73a[_0x8b44('0xe')]=moment()[_0x8b44('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3bcfcf(null,_0x46c73a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 324944c..f5eac56 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 _0x54c0=['omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x54c0,0xe4));var _0x054c=function(_0x2ffd23,_0x2127f7){_0x2ffd23=_0x2ffd23-0x0;var _0x23c078=_0x54c0[_0x2ffd23];return _0x23c078;};'use strict';var _=require(_0x054c('0x0'));var util=require(_0x054c('0x1'));var moment=require(_0x054c('0x2'));var BPromise=require(_0x054c('0x3'));var rs=require(_0x054c('0x4'));var fs=require('fs');var Redis=require(_0x054c('0x5'));var db=require(_0x054c('0x6'))['db'];var utils=require(_0x054c('0x7'));var logger=require('../../config/logger')(_0x054c('0x8'));var config=require(_0x054c('0x9'));var jayson=require(_0x054c('0xa'));var client=jayson[_0x054c('0xb')][_0x054c('0xc')]({'port':0x232a});config[_0x054c('0xd')]=_[_0x054c('0xe')](config['redis'],{'host':_0x054c('0xf'),'port':0x18eb});var socket=require(_0x054c('0x10'))(new Redis(config[_0x054c('0xd')]));require(_0x054c('0x11'))['register'](socket);function respondWithRpcPromise(_0x12fac6,_0x1e2d28,_0x431645){return new BPromise(function(_0x40766f,_0x3fc8fd){return client[_0x054c('0x12')](_0x12fac6,_0x431645)[_0x054c('0x13')](function(_0x2a079f){logger[_0x054c('0x14')](_0x054c('0x15'),_0x1e2d28,_0x054c('0x16'));logger[_0x054c('0x17')](_0x054c('0x18'),_0x1e2d28,_0x054c('0x16'),JSON['stringify'](_0x2a079f));if(_0x2a079f['error']){if(_0x2a079f[_0x054c('0x19')][_0x054c('0x1a')]===0x1f4){logger[_0x054c('0x19')](_0x054c('0x15'),_0x1e2d28,_0x2a079f[_0x054c('0x19')][_0x054c('0x1b')]);return _0x3fc8fd(_0x2a079f[_0x054c('0x19')][_0x054c('0x1b')]);}logger[_0x054c('0x19')](_0x054c('0x15'),_0x1e2d28,_0x2a079f[_0x054c('0x19')]['message']);return _0x40766f(_0x2a079f[_0x054c('0x19')][_0x054c('0x1b')]);}else{logger[_0x054c('0x14')](_0x054c('0x15'),_0x1e2d28,_0x054c('0x16'));_0x40766f(_0x2a079f['result'][_0x054c('0x1b')]);}})[_0x054c('0x1c')](function(_0x35eade){logger[_0x054c('0x19')](_0x054c('0x15'),_0x1e2d28,_0x35eade);_0x3fc8fd(_0x35eade);});});}exports[_0x054c('0x1d')]=function(_0x52165e){var _0x23af5d=this;return new Promise(function(_0x48a116,_0x4b13c3){return db[_0x054c('0x1e')]['update'](_0x52165e[_0x054c('0x1f')],{'raw':_0x52165e[_0x054c('0x20')]?_0x52165e[_0x054c('0x20')][_0x054c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52165e['options']?_0x52165e[_0x054c('0x20')][_0x054c('0x22')]||null:null,'attributes':_0x52165e[_0x054c('0x20')]?_0x52165e[_0x054c('0x20')][_0x054c('0x23')]||null:null,'limit':_0x52165e[_0x054c('0x20')]?_0x52165e[_0x054c('0x20')][_0x054c('0x24')]||null:null})[_0x054c('0x13')](function(_0x5a326e){logger[_0x054c('0x14')](_0x054c('0x1d'),_0x52165e);logger[_0x054c('0x17')](_0x054c('0x1d'),_0x52165e,JSON[_0x054c('0x25')](_0x5a326e));_0x48a116(_0x5a326e);})[_0x054c('0x1c')](function(_0x35cb29){logger[_0x054c('0x19')]('UpdateOpenchannelInteraction',_0x35cb29[_0x054c('0x1b')],_0x52165e);_0x4b13c3(_0x23af5d[_0x054c('0x19')](0x1f4,_0x35cb29[_0x054c('0x1b')]));});});};exports[_0x054c('0x26')]=function(_0x5964e5){return new Promise(function(_0x1b4fcc,_0x305160){return db[_0x054c('0x1e')][_0x054c('0x27')]({'where':_0x5964e5[_0x054c('0x20')]?_0x5964e5['options'][_0x054c('0x22')]||null:null})[_0x054c('0x13')](function(_0x41fa6f){if(_0x41fa6f){return _0x41fa6f[_0x054c('0x28')](_0x5964e5['body'][_0x054c('0x29')],_[_0x054c('0x2a')](_0x5964e5['body'],['ids','id'])||{});}})[_0x054c('0x2b')](function(_0x462a68){logger[_0x054c('0x14')](_0x054c('0x2c'),_0x5964e5);logger[_0x054c('0x17')]('AddTags',_0x5964e5,JSON[_0x054c('0x25')](_0x462a68));_0x1b4fcc(_0x462a68);})[_0x054c('0x1c')](function(_0x5e3b17){logger[_0x054c('0x19')](_0x054c('0x2c'),_0x5e3b17[_0x054c('0x1b')],_0x5964e5);_0x305160(_this[_0x054c('0x19')](0x1f4,_0x5e3b17[_0x054c('0x1b')]));});});}; \ No newline at end of file +var _0x1835=['attributes','limit','debug','stringify','AddTagsToOpenchannelInteraction','addTags','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where'];(function(_0x4e7d90,_0x26f64a){var _0xf6b90b=function(_0x3cce2e){while(--_0x3cce2e){_0x4e7d90['push'](_0x4e7d90['shift']());}};_0xf6b90b(++_0x26f64a);}(_0x1835,0xd1));var _0x5183=function(_0x1058fb,_0x3eb28){_0x1058fb=_0x1058fb-0x0;var _0x29d02e=_0x1835[_0x1058fb];return _0x29d02e;};'use strict';var _=require(_0x5183('0x0'));var util=require(_0x5183('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5183('0x2'));var fs=require('fs');var Redis=require(_0x5183('0x3'));var db=require(_0x5183('0x4'))['db'];var utils=require(_0x5183('0x5'));var logger=require('../../config/logger')(_0x5183('0x6'));var config=require('../../config/environment');var jayson=require(_0x5183('0x7'));var client=jayson[_0x5183('0x8')][_0x5183('0x9')]({'port':0x232a});config[_0x5183('0xa')]=_[_0x5183('0xb')](config[_0x5183('0xa')],{'host':_0x5183('0xc'),'port':0x18eb});var socket=require(_0x5183('0xd'))(new Redis(config['redis']));require(_0x5183('0xe'))[_0x5183('0xf')](socket);function respondWithRpcPromise(_0x191628,_0x3ef633,_0x5ce902){return new BPromise(function(_0x56e4eb,_0x441530){return client['request'](_0x191628,_0x5ce902)[_0x5183('0x10')](function(_0x234139){logger[_0x5183('0x11')](_0x5183('0x12'),_0x3ef633,_0x5183('0x13'));logger['debug'](_0x5183('0x14'),_0x3ef633,_0x5183('0x13'),JSON['stringify'](_0x234139));if(_0x234139[_0x5183('0x15')]){if(_0x234139['error'][_0x5183('0x16')]===0x1f4){logger[_0x5183('0x15')](_0x5183('0x12'),_0x3ef633,_0x234139[_0x5183('0x15')][_0x5183('0x17')]);return _0x441530(_0x234139[_0x5183('0x15')][_0x5183('0x17')]);}logger[_0x5183('0x15')](_0x5183('0x12'),_0x3ef633,_0x234139[_0x5183('0x15')][_0x5183('0x17')]);return _0x56e4eb(_0x234139[_0x5183('0x15')]['message']);}else{logger['info'](_0x5183('0x12'),_0x3ef633,_0x5183('0x13'));_0x56e4eb(_0x234139[_0x5183('0x18')][_0x5183('0x17')]);}})['catch'](function(_0x19cd74){logger[_0x5183('0x15')](_0x5183('0x12'),_0x3ef633,_0x19cd74);_0x441530(_0x19cd74);});});}exports[_0x5183('0x19')]=function(_0xbec406){var _0x262a8d=this;return new Promise(function(_0x389be6,_0x165c3c){return db[_0x5183('0x1a')][_0x5183('0x1b')](_0xbec406[_0x5183('0x1c')],{'raw':_0xbec406[_0x5183('0x1d')]?_0xbec406[_0x5183('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbec406[_0x5183('0x1d')]?_0xbec406[_0x5183('0x1d')][_0x5183('0x1e')]||null:null,'attributes':_0xbec406[_0x5183('0x1d')]?_0xbec406[_0x5183('0x1d')][_0x5183('0x1f')]||null:null,'limit':_0xbec406[_0x5183('0x1d')]?_0xbec406[_0x5183('0x1d')][_0x5183('0x20')]||null:null})['then'](function(_0x52c734){logger[_0x5183('0x11')]('UpdateOpenchannelInteraction',_0xbec406);logger[_0x5183('0x21')](_0x5183('0x19'),_0xbec406,JSON[_0x5183('0x22')](_0x52c734));_0x389be6(_0x52c734);})['catch'](function(_0x2dc73a){logger[_0x5183('0x15')](_0x5183('0x19'),_0x2dc73a[_0x5183('0x17')],_0xbec406);_0x165c3c(_0x262a8d['error'](0x1f4,_0x2dc73a[_0x5183('0x17')]));});});};exports[_0x5183('0x23')]=function(_0x10d657){return new Promise(function(_0x3fdf91,_0x9952d){return db['OpenchannelInteraction']['find']({'where':_0x10d657['options']?_0x10d657[_0x5183('0x1d')]['where']||null:null})[_0x5183('0x10')](function(_0x4e7215){if(_0x4e7215){return _0x4e7215[_0x5183('0x24')](_0x10d657[_0x5183('0x1c')]['ids'],_[_0x5183('0x25')](_0x10d657[_0x5183('0x1c')],['ids','id'])||{});}})[_0x5183('0x26')](function(_0xb66679){logger[_0x5183('0x11')](_0x5183('0x27'),_0x10d657);logger[_0x5183('0x21')](_0x5183('0x27'),_0x10d657,JSON[_0x5183('0x22')](_0xb66679));_0x3fdf91(_0xb66679);})['catch'](function(_0xf29d04){logger[_0x5183('0x15')](_0x5183('0x27'),_0xf29d04['message'],_0x10d657);_0x9952d(_this[_0x5183('0x15')](0x1f4,_0xf29d04[_0x5183('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 98d7481..1ae0f0c 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 _0xc8a0=['length','openchannelInteraction:','./openchannelInteraction.events','remove','update','register'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xc8a0,0x134));var _0x0c8a=function(_0x536c9e,_0x581312){_0x536c9e=_0x536c9e-0x0;var _0x41365e=_0xc8a0[_0x536c9e];return _0x41365e;};'use strict';var OpenchannelInteractionEvents=require(_0x0c8a('0x0'));var events=['save',_0x0c8a('0x1'),_0x0c8a('0x2')];function createListener(_0x5a6409,_0x416cbf){return function(_0xb46f2f){_0x416cbf['emit'](_0x5a6409,_0xb46f2f);};}function removeListener(_0x14dfa0,_0x598483){return function(){OpenchannelInteractionEvents['removeListener'](_0x14dfa0,_0x598483);};}exports[_0x0c8a('0x3')]=function(_0xd1d5b7){for(var _0x1b0543=0x0,_0x13be3f=events[_0x0c8a('0x4')];_0x1b0543<_0x13be3f;_0x1b0543++){var _0x367274=events[_0x1b0543];var _0x42103d=createListener(_0x0c8a('0x5')+_0x367274,_0xd1d5b7);OpenchannelInteractionEvents['on'](_0x367274,_0x42103d);}}; \ No newline at end of file +var _0x3dac=['emit','removeListener','register','length','save','remove','update'];(function(_0x85de91,_0x5614ce){var _0xa285ca=function(_0x2386d6){while(--_0x2386d6){_0x85de91['push'](_0x85de91['shift']());}};_0xa285ca(++_0x5614ce);}(_0x3dac,0x14d));var _0xc3da=function(_0x4bc300,_0x374390){_0x4bc300=_0x4bc300-0x0;var _0x50e595=_0x3dac[_0x4bc300];return _0x50e595;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xc3da('0x0'),_0xc3da('0x1'),_0xc3da('0x2')];function createListener(_0x1de42e,_0x35da72){return function(_0x8beda4){_0x35da72[_0xc3da('0x3')](_0x1de42e,_0x8beda4);};}function removeListener(_0x17ba1c,_0x4c8d81){return function(){OpenchannelInteractionEvents[_0xc3da('0x4')](_0x17ba1c,_0x4c8d81);};}exports[_0xc3da('0x5')]=function(_0x26bda7){for(var _0x35c70f=0x0,_0x109095=events[_0xc3da('0x6')];_0x35c70f<_0x109095;_0x35c70f++){var _0x287ae9=events[_0x35c70f];var _0x51757d=createListener('openchannelInteraction:'+_0x287ae9,_0x26bda7);OpenchannelInteractionEvents['on'](_0x287ae9,_0x51757d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ef32f3b..91a8c54 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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_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')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x183856,_0x3408ac){var _0x3aa03f=function(_0x5b581e){while(--_0x5b581e){_0x183856['push'](_0x183856['shift']());}};_0x3aa03f(++_0x3408ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);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 da6663c..93ab48c 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 _0x8383=['sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x4d44d8,_0x973338){var _0x1af3ec=function(_0x5bec02){while(--_0x5bec02){_0x4d44d8['push'](_0x4d44d8['shift']());}};_0x1af3ec(++_0x973338);}(_0x8383,0x98));var _0x3838=function(_0x2de6dd,_0x5edc0f){_0x2de6dd=_0x2de6dd-0x0;var _0x48ef08=_0x8383[_0x2de6dd];return _0x48ef08;};'use strict';var Sequelize=require(_0x3838('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3838('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3838('0x3')]('in',_0x3838('0x4')),'defaultValue':_0x3838('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3838('0x5')]},'providerName':{'type':Sequelize[_0x3838('0x6')]},'providerResponse':{'type':Sequelize[_0x3838('0x7')]}}; \ No newline at end of file +var _0x585e=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x166976,_0x5c38c9){var _0x2b4dad=function(_0x2a3d96){while(--_0x2a3d96){_0x166976['push'](_0x166976['shift']());}};_0x2b4dad(++_0x5c38c9);}(_0x585e,0x1c2));var _0xe585=function(_0xacdead,_0x1cdad6){_0xacdead=_0xacdead-0x0;var _0x307fe4=_0x585e[_0xacdead];return _0x307fe4;};'use strict';var Sequelize=require(_0xe585('0x0'));module[_0xe585('0x1')]={'body':{'type':Sequelize[_0xe585('0x2')](_0xe585('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe585('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe585('0x5')),'defaultValue':_0xe585('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xe585('0x6')]},'providerResponse':{'type':Sequelize[_0xe585('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a3fec70..2132352 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 _0x1d9f=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','includeAll','find','create','update','body','params','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x15512c,_0x594bc6){var _0x5f178b=function(_0x263523){while(--_0x263523){_0x15512c['push'](_0x15512c['shift']());}};_0x5f178b(++_0x594bc6);}(_0x1d9f,0x174));var _0xf1d9=function(_0x24d88c,_0x485c4d){_0x24d88c=_0x24d88c-0x0;var _0x49ac8c=_0x1d9f[_0x24d88c];return _0x49ac8c;};'use strict';var emlformat=require(_0xf1d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1d9('0x1'));var jsonpatch=require(_0xf1d9('0x2'));var rp=require('request-promise');var moment=require(_0xf1d9('0x3'));var BPromise=require(_0xf1d9('0x4'));var Mustache=require(_0xf1d9('0x5'));var util=require(_0xf1d9('0x6'));var path=require(_0xf1d9('0x7'));var sox=require(_0xf1d9('0x8'));var csv=require(_0xf1d9('0x9'));var ejs=require(_0xf1d9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf1d9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf1d9('0x9'));var querystring=require(_0xf1d9('0xc'));var Papa=require(_0xf1d9('0xd'));var Redis=require(_0xf1d9('0xe'));var authService=require(_0xf1d9('0xf'));var qs=require(_0xf1d9('0x10'));var as=require(_0xf1d9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1d9('0x12'))(_0xf1d9('0x13'));var utils=require(_0xf1d9('0x14'));var config=require(_0xf1d9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1d9('0x16'))['db'];config[_0xf1d9('0x17')]=_[_0xf1d9('0x18')](config[_0xf1d9('0x17')],{'host':_0xf1d9('0x19'),'port':0x18eb});var socket=require(_0xf1d9('0x1a'))(new Redis(config[_0xf1d9('0x17')]));require(_0xf1d9('0x1b'))[_0xf1d9('0x1c')](socket);var jayson=require(_0xf1d9('0x1d'));var client=jayson[_0xf1d9('0x1e')][_0xf1d9('0x1f')]({'port':0x232c});var client9002=jayson[_0xf1d9('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31555b,_0x276cce,_0x40069b,_0x3beef2){return new BPromise(function(_0x13c2fe,_0x38f0fd){var _0x41c802=_0x3beef2||client;return _0x41c802[_0xf1d9('0x20')](_0x31555b,_0x40069b)[_0xf1d9('0x21')](function(_0x3fc435){logger['info'](_0xf1d9('0x22'),_0x276cce,'request\x20sent');logger[_0xf1d9('0x23')](_0xf1d9('0x24'),_0x276cce,_0xf1d9('0x25'),JSON[_0xf1d9('0x26')](_0x3fc435));if(_0x3fc435['error']){if(_0x3fc435['error'][_0xf1d9('0x27')]===0x1f4){logger[_0xf1d9('0x28')](_0xf1d9('0x22'),_0x276cce,_0x3fc435[_0xf1d9('0x28')][_0xf1d9('0x29')]);return _0x38f0fd(_0x3fc435[_0xf1d9('0x28')]['message']);}logger['error'](_0xf1d9('0x22'),_0x276cce,_0x3fc435['error'][_0xf1d9('0x29')]);return _0x13c2fe(_0x3fc435[_0xf1d9('0x28')]['message']);}else{logger[_0xf1d9('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x276cce,_0xf1d9('0x25'));_0x13c2fe(_0x3fc435[_0xf1d9('0x2b')][_0xf1d9('0x29')]);}})[_0xf1d9('0x2c')](function(_0xcf4309){logger[_0xf1d9('0x28')](_0xf1d9('0x22'),_0x276cce,_0xcf4309);_0x38f0fd(_0xcf4309);});});}function respondWithStatusCode(_0x14c9d9,_0xb2f8b7){_0xb2f8b7=_0xb2f8b7||0xcc;return function(_0x283874){if(_0x283874){return _0x14c9d9[_0xf1d9('0x2d')](_0xb2f8b7);}return _0x14c9d9[_0xf1d9('0x2e')](_0xb2f8b7)[_0xf1d9('0x2f')]();};}function respondWithResult(_0x4f649c,_0x557880){_0x557880=_0x557880||0xc8;return function(_0x18a236){if(_0x18a236){return _0x4f649c[_0xf1d9('0x2e')](_0x557880)[_0xf1d9('0x30')](_0x18a236);}};}function respondWithFilteredResult(_0x400fa4,_0x13ab88){return function(_0x5e71b0){if(_0x5e71b0){var _0x354b3e=typeof _0x13ab88['offset']===_0xf1d9('0x31')&&typeof _0x13ab88[_0xf1d9('0x32')]===_0xf1d9('0x31');var _0x5a5d35=_0x5e71b0[_0xf1d9('0x33')];var _0x4a19d4=_0x354b3e?0x0:_0x13ab88[_0xf1d9('0x34')];var _0x400c30=_0x354b3e?_0x5e71b0[_0xf1d9('0x33')]:_0x13ab88[_0xf1d9('0x34')]+_0x13ab88[_0xf1d9('0x32')];var _0x58c60f;if(_0x400c30>=_0x5a5d35){_0x400c30=_0x5a5d35;_0x58c60f=0xc8;}else{_0x58c60f=0xce;}_0x400fa4[_0xf1d9('0x2e')](_0x58c60f);return _0x400fa4[_0xf1d9('0x35')](_0xf1d9('0x36'),_0x4a19d4+'-'+_0x400c30+'/'+_0x5a5d35)[_0xf1d9('0x30')](_0x5e71b0);}return null;};}function patchUpdates(_0xcc583a){return function(_0x526117){try{jsonpatch[_0xf1d9('0x37')](_0x526117,_0xcc583a,!![]);}catch(_0x15117a){return BPromise[_0xf1d9('0x38')](_0x15117a);}return _0x526117['save']();};}function saveUpdates(_0x507324,_0x1b55c5){return function(_0x1b0101){if(_0x1b0101){return _0x1b0101['update'](_0x507324)['then'](function(_0x33dd30){return _0x33dd30;});}return null;};}function removeEntity(_0x4df8b7,_0x24e7b5){return function(_0x4346b5){if(_0x4346b5){return _0x4346b5[_0xf1d9('0x39')]()[_0xf1d9('0x21')](function(){_0x4df8b7['status'](0xcc)[_0xf1d9('0x2f')]();});}};}function handleEntityNotFound(_0x3b8dae,_0x3f7ae2){return function(_0x213860){if(!_0x213860){_0x3b8dae['sendStatus'](0x194);}return _0x213860;};}function handleError(_0x301496,_0x1e2edb){_0x1e2edb=_0x1e2edb||0x1f4;return function(_0x50780c){logger[_0xf1d9('0x28')](_0x50780c[_0xf1d9('0x3a')]);if(_0x50780c['name']){delete _0x50780c[_0xf1d9('0x3b')];}_0x301496[_0xf1d9('0x2e')](_0x1e2edb)[_0xf1d9('0x3c')](_0x50780c);};}exports[_0xf1d9('0x3d')]=function(_0x1b7d66,_0x3c462d){var _0x21087d={},_0x5f0fbc={},_0x4ede11={'count':0x0,'rows':[]};var _0x2cd037=_[_0xf1d9('0x3e')](db[_0xf1d9('0x3f')][_0xf1d9('0x40')],function(_0x409df3){return{'name':_0x409df3[_0xf1d9('0x41')],'type':_0x409df3[_0xf1d9('0x42')][_0xf1d9('0x43')]};});_0x5f0fbc[_0xf1d9('0x44')]=_['map'](_0x2cd037,_0xf1d9('0x3b'));_0x5f0fbc[_0xf1d9('0x45')]=_[_0xf1d9('0x46')](_0x1b7d66['query']);_0x5f0fbc[_0xf1d9('0x47')]=_['intersection'](_0x5f0fbc[_0xf1d9('0x44')],_0x5f0fbc[_0xf1d9('0x45')]);_0x21087d['attributes']=_[_0xf1d9('0x48')](_0x5f0fbc[_0xf1d9('0x44')],qs['fields'](_0x1b7d66[_0xf1d9('0x45')][_0xf1d9('0x49')]));_0x21087d[_0xf1d9('0x4a')]=_0x21087d[_0xf1d9('0x4a')][_0xf1d9('0x4b')]?_0x21087d[_0xf1d9('0x4a')]:_0x5f0fbc['model'];if(!_0x1b7d66[_0xf1d9('0x45')][_0xf1d9('0x4c')](_0xf1d9('0x4d'))){_0x21087d[_0xf1d9('0x32')]=qs[_0xf1d9('0x32')](_0x1b7d66[_0xf1d9('0x45')]['limit']);_0x21087d[_0xf1d9('0x34')]=qs['offset'](_0x1b7d66[_0xf1d9('0x45')][_0xf1d9('0x34')]);}_0x21087d[_0xf1d9('0x4e')]=qs['sort'](_0x1b7d66[_0xf1d9('0x45')]['sort']);_0x21087d['where']=qs[_0xf1d9('0x47')](_[_0xf1d9('0x4f')](_0x1b7d66[_0xf1d9('0x45')],_0x5f0fbc[_0xf1d9('0x47')]),_0x2cd037);if(_0x1b7d66[_0xf1d9('0x45')][_0xf1d9('0x50')]){_0x21087d[_0xf1d9('0x51')]=_[_0xf1d9('0x52')](_0x21087d[_0xf1d9('0x51')],{'$or':_[_0xf1d9('0x3e')](_0x2cd037,function(_0x42ca7b){if(_0x42ca7b['type']!==_0xf1d9('0x53')){var _0x2537a4={};_0x2537a4[_0x42ca7b[_0xf1d9('0x3b')]]={'$like':'%'+_0x1b7d66['query'][_0xf1d9('0x50')]+'%'};return _0x2537a4;}})});}_0x21087d=_[_0xf1d9('0x52')]({},_0x21087d,_0x1b7d66[_0xf1d9('0x54')]);var _0xb52672={'where':_0x21087d['where']};return db[_0xf1d9('0x3f')]['count'](_0xb52672)[_0xf1d9('0x21')](function(_0x4ad1e0){_0x4ede11[_0xf1d9('0x33')]=_0x4ad1e0;if(_0x1b7d66[_0xf1d9('0x45')]['includeAll']){_0x21087d[_0xf1d9('0x55')]=[{'all':!![]}];}return db[_0xf1d9('0x3f')][_0xf1d9('0x56')](_0x21087d);})['then'](function(_0x2b2d9c){_0x4ede11['rows']=_0x2b2d9c;return _0x4ede11;})[_0xf1d9('0x21')](respondWithFilteredResult(_0x3c462d,_0x21087d))[_0xf1d9('0x2c')](handleError(_0x3c462d,null));};exports[_0xf1d9('0x57')]=function(_0x4bcb2f,_0x555137){var _0x5ca39d={'raw':!![],'where':{'id':_0x4bcb2f['params']['id']}},_0x11e46a={};_0x11e46a[_0xf1d9('0x44')]=_['keys'](db[_0xf1d9('0x3f')]['rawAttributes']);_0x11e46a[_0xf1d9('0x45')]=_[_0xf1d9('0x46')](_0x4bcb2f['query']);_0x11e46a[_0xf1d9('0x47')]=_[_0xf1d9('0x48')](_0x11e46a['model'],_0x11e46a['query']);_0x5ca39d[_0xf1d9('0x4a')]=_[_0xf1d9('0x48')](_0x11e46a[_0xf1d9('0x44')],qs[_0xf1d9('0x49')](_0x4bcb2f[_0xf1d9('0x45')][_0xf1d9('0x49')]));_0x5ca39d[_0xf1d9('0x4a')]=_0x5ca39d['attributes']['length']?_0x5ca39d[_0xf1d9('0x4a')]:_0x11e46a[_0xf1d9('0x44')];if(_0x4bcb2f[_0xf1d9('0x45')][_0xf1d9('0x58')]){_0x5ca39d[_0xf1d9('0x55')]=[{'all':!![]}];}_0x5ca39d=_['merge']({},_0x5ca39d,_0x4bcb2f[_0xf1d9('0x54')]);return db[_0xf1d9('0x3f')][_0xf1d9('0x59')](_0x5ca39d)[_0xf1d9('0x21')](handleEntityNotFound(_0x555137,null))['then'](respondWithResult(_0x555137,null))[_0xf1d9('0x2c')](handleError(_0x555137,null));};exports[_0xf1d9('0x5a')]=function(_0x4cf951,_0x4d60a0){return db[_0xf1d9('0x3f')]['create'](_0x4cf951['body'],{})[_0xf1d9('0x21')](respondWithResult(_0x4d60a0,0xc9))['catch'](handleError(_0x4d60a0,null));};exports[_0xf1d9('0x5b')]=function(_0x1b84d4,_0x283999){if(_0x1b84d4['body']['id']){delete _0x1b84d4[_0xf1d9('0x5c')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x1b84d4[_0xf1d9('0x5d')]['id']}})[_0xf1d9('0x21')](handleEntityNotFound(_0x283999,null))[_0xf1d9('0x21')](saveUpdates(_0x1b84d4['body'],null))[_0xf1d9('0x21')](respondWithResult(_0x283999,null))['catch'](handleError(_0x283999,null));};exports[_0xf1d9('0x39')]=function(_0x3382ad,_0x3ebe18){return db['OpenchannelMessage'][_0xf1d9('0x59')]({'where':{'id':_0x3382ad[_0xf1d9('0x5d')]['id']}})[_0xf1d9('0x21')](handleEntityNotFound(_0x3ebe18,null))[_0xf1d9('0x21')](removeEntity(_0x3ebe18,null))['catch'](handleError(_0x3ebe18,null));};exports[_0xf1d9('0x5e')]=function(_0x5b5129,_0x20c718){return db[_0xf1d9('0x3f')][_0xf1d9('0x5e')]()[_0xf1d9('0x21')](respondWithResult(_0x20c718,null))['catch'](handleError(_0x20c718,null));};var interaction_log=require(_0xf1d9('0x12'))(_0xf1d9('0x5f'));exports[_0xf1d9('0x60')]=function(_0xed924b,_0x211634,_0x43eeac){var _0x2baa76={'agent':{},'channel':_0xf1d9('0x61')};if(_0xed924b[_0xf1d9('0x5c')]['id']){delete _0xed924b['body']['id'];}_0xed924b['body'][_0xf1d9('0x62')]=!![];_0xed924b[_0xf1d9('0x5c')]['readAt']=moment()[_0xf1d9('0x63')](_0xf1d9('0x64'));_0xed924b['body'][_0xf1d9('0x65')]=_0xed924b[_0xf1d9('0x5c')][_0xf1d9('0x65')]||_0xed924b['user']['id'];_0x2baa76[_0xf1d9('0x66')]['id']=_0xed924b['body']['UserId'];return db[_0xf1d9('0x3f')]['find']({'where':{'id':_0xed924b[_0xf1d9('0x5d')]['id'],'UserId':null}})[_0xf1d9('0x21')](handleEntityNotFound(_0x211634,null))[_0xf1d9('0x21')](saveUpdates(_0xed924b[_0xf1d9('0x5c')],null))[_0xf1d9('0x21')](function(_0x5a558a){if(_0x5a558a){_0x2baa76[_0xf1d9('0x29')]=_0x5a558a['get']({'plain':!![]});return db[_0xf1d9('0x67')][_0xf1d9('0x59')]({'where':{'id':_0x5a558a[_0xf1d9('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x211634,null))[_0xf1d9('0x21')](function(_0xa8f4a7){if(_0xa8f4a7){return _0xa8f4a7[_0xf1d9('0x5b')]({'UserId':_0xed924b[_0xf1d9('0x5c')][_0xf1d9('0x65')],'read1stAt':_['isNil'](_0xa8f4a7[_0xf1d9('0x69')])?moment()['format'](_0xf1d9('0x64')):undefined});}return null;})[_0xf1d9('0x21')](function(_0x2d0178){if(_0x2d0178){_0x2baa76[_0xf1d9('0x6a')]=_0x2d0178[_0xf1d9('0x6b')]({'plain':!![]});interaction_log[_0xf1d9('0x2a')](_0xf1d9('0x6c'),_0xed924b[_0xf1d9('0x6d')]['id'],_0xed924b[_0xf1d9('0x6d')][_0xf1d9('0x3b')],_0xed924b[_0xf1d9('0x6d')][_0xf1d9('0x6e')],_0x2baa76[_0xf1d9('0x6a')]['id'],_0xed924b[_0xf1d9('0x5c')]?JSON[_0xf1d9('0x26')](_0xed924b['body']):_0xf1d9('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2baa76);}return null;})[_0xf1d9('0x21')](function(_0x4d2aed){var _0x3f65ab=_0xf1d9('0x70')+_0x4d2aed[_0xf1d9('0x29')][_0xf1d9('0x71')];return db[_0xf1d9('0x72')][_0xf1d9('0x45')](_0x3f65ab,{'type':db[_0xf1d9('0x73')][_0xf1d9('0x74')][_0xf1d9('0x75')],'raw':!![]})[_0xf1d9('0x21')](function(_0xf786a6){return _0xf786a6;});})[_0xf1d9('0x21')](function(_0x3499f9){if(_0x3499f9){_0x2baa76['message'][_0xf1d9('0x76')]=_0x3499f9[0x0];if(!_0xed924b['body'][_0xf1d9('0x65')])return;return db[_0xf1d9('0x77')][_0xf1d9('0x59')]({'where':{'id':_0xed924b[_0xf1d9('0x5c')][_0xf1d9('0x65')],'role':_0xf1d9('0x66')},'attributes':['id',_0xf1d9('0x3b'),_0xf1d9('0x78'),'email',_0xf1d9('0x79')],'raw':!![]});}return null;})['then'](function(_0x3d3cc2){if(!_0x3d3cc2)return null;_0x2baa76[_0xf1d9('0x29')]['agent']=_0x3d3cc2;return _0x2baa76;})[_0xf1d9('0x21')](function(_0x551191){if(_0x551191){if(_0xed924b[_0xf1d9('0x5c')][_0xf1d9('0x7a')]){_0x2baa76[_0xf1d9('0x29')][_0xf1d9('0x7b')]=util[_0xf1d9('0x63')](_0xf1d9('0x7c'),_0xed924b['user'][_0xf1d9('0x3b')]);_0x2baa76[_0xf1d9('0x29')][_0xf1d9('0x7d')]=_0x2baa76[_0xf1d9('0x7d')];_0x2baa76['message']['motionChannel']=_0x2baa76[_0xf1d9('0x7d')];_0x2baa76[_0xf1d9('0x29')][_0xf1d9('0x7e')]=_0xf1d9('0x60');return respondWithRpcPromise(_0xf1d9('0x7f'),_0xf1d9('0x7f'),{'event':_0xf1d9('0x80'),'message':_0x2baa76[_0xf1d9('0x29')]},client9002)['then'](function(){return _0x2baa76;});}return _0x2baa76;}return null;})['then'](respondWithResult(_0x211634,null))[_0xf1d9('0x2c')](handleError(_0x211634,null));};var interaction_log=require('../../config/logger')(_0xf1d9('0x5f'));exports['reject']=function(_0x3441b1,_0x3faa54,_0x3c5093){var _0x3ffa1={'agent':{},'channel':_0xf1d9('0x61')};if(_0x3441b1[_0xf1d9('0x5c')]['id']){delete _0x3441b1[_0xf1d9('0x5c')]['id'];}_0x3441b1[_0xf1d9('0x5c')]['UserId']=_0x3441b1['body']['UserId']||_0x3441b1[_0xf1d9('0x6d')]['id'];_0x3ffa1[_0xf1d9('0x66')]['id']=_0x3441b1[_0xf1d9('0x5c')][_0xf1d9('0x65')];return db[_0xf1d9('0x3f')][_0xf1d9('0x59')]({'where':{'id':_0x3441b1[_0xf1d9('0x5d')]['id'],'UserId':null}})[_0xf1d9('0x21')](handleEntityNotFound(_0x3faa54,null))[_0xf1d9('0x21')](function(_0x300440){if(_0x300440){_0x3ffa1[_0xf1d9('0x29')]=_0x300440[_0xf1d9('0x6b')]({'plain':!![]});return db[_0xf1d9('0x67')][_0xf1d9('0x59')]({'where':{'id':_0x300440['OpenchannelInteractionId']}});}return null;})[_0xf1d9('0x21')](handleEntityNotFound(_0x3faa54,null))[_0xf1d9('0x21')](function(_0x4de6e9){if(_0x4de6e9){_0x3ffa1[_0xf1d9('0x6a')]=_0x4de6e9['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3441b1[_0xf1d9('0x6d')]['id'],_0x3441b1[_0xf1d9('0x6d')][_0xf1d9('0x3b')],_0x3441b1[_0xf1d9('0x6d')]['role'],_0x3ffa1['interaction']['id'],_0x3441b1[_0xf1d9('0x5c')]?JSON['stringify'](_0x3441b1[_0xf1d9('0x5c')]):_0xf1d9('0x6f'));return respondWithRpcPromise(_0xf1d9('0x81'),_0xf1d9('0x82'),_0x3ffa1);}return null;})[_0xf1d9('0x21')](function(_0x34fd68){var _0x409541=_0xf1d9('0x70')+_0x34fd68['message'][_0xf1d9('0x71')];return db[_0xf1d9('0x72')][_0xf1d9('0x45')](_0x409541,{'type':db[_0xf1d9('0x73')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf1d9('0x21')](function(_0x7dca85){return _0x7dca85;});})['then'](function(_0x2d1a70){if(_0x2d1a70){_0x3ffa1['message']['contact']=_0x2d1a70[0x0];if(!_0x3441b1[_0xf1d9('0x5c')][_0xf1d9('0x65')])return;return db[_0xf1d9('0x77')][_0xf1d9('0x59')]({'where':{'id':_0x3441b1['body'][_0xf1d9('0x65')],'role':_0xf1d9('0x66')},'attributes':['id','name',_0xf1d9('0x78'),'email',_0xf1d9('0x79')],'raw':!![]});}return null;})[_0xf1d9('0x21')](function(_0x5c2ae4){if(!_0x5c2ae4)return null;_0x3ffa1[_0xf1d9('0x29')][_0xf1d9('0x66')]=_0x5c2ae4;return _0x3ffa1;})[_0xf1d9('0x21')](function(_0x30a17e){if(_0x30a17e){_0x30a17e[_0xf1d9('0x29')]['interface']=util[_0xf1d9('0x63')](_0xf1d9('0x7c'),_0x3441b1[_0xf1d9('0x6d')][_0xf1d9('0x3b')]);_0x30a17e[_0xf1d9('0x29')][_0xf1d9('0x7d')]=_0x3ffa1[_0xf1d9('0x7d')];_0x30a17e[_0xf1d9('0x29')]['motionChannel']=_0x3ffa1[_0xf1d9('0x7d')];_0x30a17e['message'][_0xf1d9('0x7e')]=_0xf1d9('0x38');respondWithRpcPromise(_0xf1d9('0x7f'),_0xf1d9('0x7f'),{'event':'rejectmessage','message':_0x30a17e[_0xf1d9('0x29')]},client9002);return _0x3ffa1;}return null;})['then'](respondWithResult(_0x3faa54,null))[_0xf1d9('0x2c')](handleError(_0x3faa54,null));}; \ No newline at end of file +var _0x734f=['count','offset','apply','reject','save','update','destroy','end','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','find','create','body','params','describe','openchannel-interactions','read','format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[OPENCHANNELMESSAGE: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','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','interface','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x734f,0xd3));var _0xf734=function(_0x2863e7,_0x2e4167){_0x2863e7=_0x2863e7-0x0;var _0xf4870f=_0x734f[_0x2863e7];return _0xf4870f;};'use strict';var emlformat=require(_0xf734('0x0'));var rimraf=require(_0xf734('0x1'));var zipdir=require(_0xf734('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf734('0x3'));var moment=require(_0xf734('0x4'));var BPromise=require(_0xf734('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf734('0x6'));var csv=require('to-csv');var ejs=require(_0xf734('0x7'));var fs=require('fs');var fs_extra=require(_0xf734('0x8'));var _=require(_0xf734('0x9'));var squel=require('squel');var crypto=require(_0xf734('0xa'));var jsforce=require(_0xf734('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf734('0xc'));var Papa=require('papaparse');var Redis=require(_0xf734('0xd'));var authService=require(_0xf734('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf734('0xf'));var hardwareService=require(_0xf734('0x10'));var logger=require(_0xf734('0x11'))(_0xf734('0x12'));var utils=require(_0xf734('0x13'));var config=require(_0xf734('0x14'));var licenseUtil=require(_0xf734('0x15'));var db=require('../../mysqldb')['db'];config[_0xf734('0x16')]=_[_0xf734('0x17')](config[_0xf734('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xf734('0x18'))(new Redis(config[_0xf734('0x16')]));require('./openchannelMessage.socket')[_0xf734('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf734('0x1a')][_0xf734('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xf734('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4b20e6,_0x1ecbd5,_0x1904ec,_0x26d900){return new BPromise(function(_0x37d6ca,_0x5cb0ee){var _0x4362eb=_0x26d900||client;return _0x4362eb['request'](_0x4b20e6,_0x1904ec)[_0xf734('0x1c')](function(_0x4ee6ed){logger[_0xf734('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x1ecbd5,_0xf734('0x1e'));logger[_0xf734('0x1f')](_0xf734('0x20'),_0x1ecbd5,_0xf734('0x1e'),JSON[_0xf734('0x21')](_0x4ee6ed));if(_0x4ee6ed[_0xf734('0x22')]){if(_0x4ee6ed['error'][_0xf734('0x23')]===0x1f4){logger[_0xf734('0x22')](_0xf734('0x24'),_0x1ecbd5,_0x4ee6ed[_0xf734('0x22')][_0xf734('0x25')]);return _0x5cb0ee(_0x4ee6ed['error'][_0xf734('0x25')]);}logger[_0xf734('0x22')](_0xf734('0x24'),_0x1ecbd5,_0x4ee6ed[_0xf734('0x22')][_0xf734('0x25')]);return _0x37d6ca(_0x4ee6ed[_0xf734('0x22')][_0xf734('0x25')]);}else{logger[_0xf734('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x1ecbd5,_0xf734('0x1e'));_0x37d6ca(_0x4ee6ed[_0xf734('0x26')][_0xf734('0x25')]);}})[_0xf734('0x27')](function(_0x277570){logger[_0xf734('0x22')](_0xf734('0x24'),_0x1ecbd5,_0x277570);_0x5cb0ee(_0x277570);});});}function respondWithStatusCode(_0x42ad92,_0x25c908){_0x25c908=_0x25c908||0xcc;return function(_0x3b856e){if(_0x3b856e){return _0x42ad92[_0xf734('0x28')](_0x25c908);}return _0x42ad92[_0xf734('0x29')](_0x25c908)['end']();};}function respondWithResult(_0x295790,_0x5ac318){_0x5ac318=_0x5ac318||0xc8;return function(_0x48b6fb){if(_0x48b6fb){return _0x295790[_0xf734('0x29')](_0x5ac318)[_0xf734('0x2a')](_0x48b6fb);}};}function respondWithFilteredResult(_0x5e688e,_0x1683d2){return function(_0x59bb9c){if(_0x59bb9c){var _0x2c48bd=typeof _0x1683d2['offset']===_0xf734('0x2b')&&typeof _0x1683d2[_0xf734('0x2c')]===_0xf734('0x2b');var _0x223c79=_0x59bb9c[_0xf734('0x2d')];var _0x2e56c9=_0x2c48bd?0x0:_0x1683d2['offset'];var _0xa240dc=_0x2c48bd?_0x59bb9c[_0xf734('0x2d')]:_0x1683d2[_0xf734('0x2e')]+_0x1683d2[_0xf734('0x2c')];var _0xcd190d;if(_0xa240dc>=_0x223c79){_0xa240dc=_0x223c79;_0xcd190d=0xc8;}else{_0xcd190d=0xce;}_0x5e688e[_0xf734('0x29')](_0xcd190d);return _0x5e688e['set']('Content-Range',_0x2e56c9+'-'+_0xa240dc+'/'+_0x223c79)['json'](_0x59bb9c);}return null;};}function patchUpdates(_0x5a7745){return function(_0x18754a){try{jsonpatch[_0xf734('0x2f')](_0x18754a,_0x5a7745,!![]);}catch(_0x66d329){return BPromise[_0xf734('0x30')](_0x66d329);}return _0x18754a[_0xf734('0x31')]();};}function saveUpdates(_0x5db56a,_0x56a023){return function(_0x1537aa){if(_0x1537aa){return _0x1537aa[_0xf734('0x32')](_0x5db56a)[_0xf734('0x1c')](function(_0x25ad17){return _0x25ad17;});}return null;};}function removeEntity(_0x1a0ff6,_0x557daf){return function(_0x3aea76){if(_0x3aea76){return _0x3aea76[_0xf734('0x33')]()[_0xf734('0x1c')](function(){_0x1a0ff6[_0xf734('0x29')](0xcc)[_0xf734('0x34')]();});}};}function handleEntityNotFound(_0x57dc1e,_0x540e22){return function(_0x142b6e){if(!_0x142b6e){_0x57dc1e[_0xf734('0x28')](0x194);}return _0x142b6e;};}function handleError(_0x3a47a7,_0x2fd614){_0x2fd614=_0x2fd614||0x1f4;return function(_0x545354){logger['error'](_0x545354['stack']);if(_0x545354[_0xf734('0x35')]){delete _0x545354[_0xf734('0x35')];}_0x3a47a7[_0xf734('0x29')](_0x2fd614)['send'](_0x545354);};}exports[_0xf734('0x36')]=function(_0x5569d7,_0xd6e3ac){var _0x209401={},_0x350f9a={},_0x1cced7={'count':0x0,'rows':[]};var _0x3578e7=_[_0xf734('0x37')](db[_0xf734('0x38')][_0xf734('0x39')],function(_0x1f4e47){return{'name':_0x1f4e47[_0xf734('0x3a')],'type':_0x1f4e47[_0xf734('0x3b')][_0xf734('0x3c')]};});_0x350f9a[_0xf734('0x3d')]=_['map'](_0x3578e7,_0xf734('0x35'));_0x350f9a['query']=_[_0xf734('0x3e')](_0x5569d7[_0xf734('0x3f')]);_0x350f9a[_0xf734('0x40')]=_[_0xf734('0x41')](_0x350f9a[_0xf734('0x3d')],_0x350f9a['query']);_0x209401[_0xf734('0x42')]=_[_0xf734('0x41')](_0x350f9a['model'],qs[_0xf734('0x43')](_0x5569d7[_0xf734('0x3f')][_0xf734('0x43')]));_0x209401[_0xf734('0x42')]=_0x209401[_0xf734('0x42')][_0xf734('0x44')]?_0x209401[_0xf734('0x42')]:_0x350f9a['model'];if(!_0x5569d7['query'][_0xf734('0x45')]('nolimit')){_0x209401[_0xf734('0x2c')]=qs[_0xf734('0x2c')](_0x5569d7['query']['limit']);_0x209401[_0xf734('0x2e')]=qs[_0xf734('0x2e')](_0x5569d7[_0xf734('0x3f')]['offset']);}_0x209401['order']=qs[_0xf734('0x46')](_0x5569d7[_0xf734('0x3f')]['sort']);_0x209401[_0xf734('0x47')]=qs[_0xf734('0x40')](_[_0xf734('0x48')](_0x5569d7[_0xf734('0x3f')],_0x350f9a[_0xf734('0x40')]),_0x3578e7);if(_0x5569d7[_0xf734('0x3f')][_0xf734('0x49')]){_0x209401['where']=_['merge'](_0x209401[_0xf734('0x47')],{'$or':_[_0xf734('0x37')](_0x3578e7,function(_0x55e50f){if(_0x55e50f[_0xf734('0x3b')]!==_0xf734('0x4a')){var _0x39638c={};_0x39638c[_0x55e50f[_0xf734('0x35')]]={'$like':'%'+_0x5569d7[_0xf734('0x3f')][_0xf734('0x49')]+'%'};return _0x39638c;}})});}_0x209401=_[_0xf734('0x4b')]({},_0x209401,_0x5569d7[_0xf734('0x4c')]);var _0x46c470={'where':_0x209401[_0xf734('0x47')]};return db[_0xf734('0x38')][_0xf734('0x2d')](_0x46c470)[_0xf734('0x1c')](function(_0x2b6676){_0x1cced7['count']=_0x2b6676;if(_0x5569d7[_0xf734('0x3f')][_0xf734('0x4d')]){_0x209401[_0xf734('0x4e')]=[{'all':!![]}];}return db[_0xf734('0x38')][_0xf734('0x4f')](_0x209401);})[_0xf734('0x1c')](function(_0x959836){_0x1cced7[_0xf734('0x50')]=_0x959836;return _0x1cced7;})[_0xf734('0x1c')](respondWithFilteredResult(_0xd6e3ac,_0x209401))[_0xf734('0x27')](handleError(_0xd6e3ac,null));};exports['show']=function(_0x58b741,_0x34ad8e){var _0x3b63c8={'raw':!![],'where':{'id':_0x58b741['params']['id']}},_0x5ec32d={};_0x5ec32d[_0xf734('0x3d')]=_[_0xf734('0x3e')](db[_0xf734('0x38')]['rawAttributes']);_0x5ec32d[_0xf734('0x3f')]=_[_0xf734('0x3e')](_0x58b741[_0xf734('0x3f')]);_0x5ec32d[_0xf734('0x40')]=_[_0xf734('0x41')](_0x5ec32d[_0xf734('0x3d')],_0x5ec32d[_0xf734('0x3f')]);_0x3b63c8[_0xf734('0x42')]=_[_0xf734('0x41')](_0x5ec32d[_0xf734('0x3d')],qs[_0xf734('0x43')](_0x58b741[_0xf734('0x3f')][_0xf734('0x43')]));_0x3b63c8['attributes']=_0x3b63c8[_0xf734('0x42')]['length']?_0x3b63c8[_0xf734('0x42')]:_0x5ec32d['model'];if(_0x58b741[_0xf734('0x3f')][_0xf734('0x4d')]){_0x3b63c8[_0xf734('0x4e')]=[{'all':!![]}];}_0x3b63c8=_[_0xf734('0x4b')]({},_0x3b63c8,_0x58b741[_0xf734('0x4c')]);return db[_0xf734('0x38')][_0xf734('0x51')](_0x3b63c8)[_0xf734('0x1c')](handleEntityNotFound(_0x34ad8e,null))['then'](respondWithResult(_0x34ad8e,null))[_0xf734('0x27')](handleError(_0x34ad8e,null));};exports[_0xf734('0x52')]=function(_0x4c742e,_0x1457bf){return db[_0xf734('0x38')][_0xf734('0x52')](_0x4c742e[_0xf734('0x53')],{})['then'](respondWithResult(_0x1457bf,0xc9))['catch'](handleError(_0x1457bf,null));};exports[_0xf734('0x32')]=function(_0x1f7947,_0x38933c){if(_0x1f7947[_0xf734('0x53')]['id']){delete _0x1f7947['body']['id'];}return db[_0xf734('0x38')][_0xf734('0x51')]({'where':{'id':_0x1f7947[_0xf734('0x54')]['id']}})[_0xf734('0x1c')](handleEntityNotFound(_0x38933c,null))[_0xf734('0x1c')](saveUpdates(_0x1f7947[_0xf734('0x53')],null))[_0xf734('0x1c')](respondWithResult(_0x38933c,null))[_0xf734('0x27')](handleError(_0x38933c,null));};exports[_0xf734('0x33')]=function(_0x2c1bbd,_0x27f564){return db[_0xf734('0x38')][_0xf734('0x51')]({'where':{'id':_0x2c1bbd[_0xf734('0x54')]['id']}})['then'](handleEntityNotFound(_0x27f564,null))[_0xf734('0x1c')](removeEntity(_0x27f564,null))[_0xf734('0x27')](handleError(_0x27f564,null));};exports[_0xf734('0x55')]=function(_0x4f2ae0,_0x37add5){return db[_0xf734('0x38')][_0xf734('0x55')]()[_0xf734('0x1c')](respondWithResult(_0x37add5,null))[_0xf734('0x27')](handleError(_0x37add5,null));};var interaction_log=require(_0xf734('0x11'))(_0xf734('0x56'));exports['accept']=function(_0xee0105,_0x59d0d3,_0x5bcc9a){var _0x475c2d={'agent':{},'channel':'openchannel'};if(_0xee0105[_0xf734('0x53')]['id']){delete _0xee0105['body']['id'];}_0xee0105['body'][_0xf734('0x57')]=!![];_0xee0105[_0xf734('0x53')]['readAt']=moment()[_0xf734('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0xee0105['body']['UserId']=_0xee0105['body'][_0xf734('0x59')]||_0xee0105[_0xf734('0x5a')]['id'];_0x475c2d[_0xf734('0x5b')]['id']=_0xee0105[_0xf734('0x53')]['UserId'];return db[_0xf734('0x38')][_0xf734('0x51')]({'where':{'id':_0xee0105['params']['id'],'UserId':null}})[_0xf734('0x1c')](handleEntityNotFound(_0x59d0d3,null))[_0xf734('0x1c')](saveUpdates(_0xee0105[_0xf734('0x53')],null))[_0xf734('0x1c')](function(_0xefd408){if(_0xefd408){_0x475c2d['message']=_0xefd408['get']({'plain':!![]});return db[_0xf734('0x5c')]['find']({'where':{'id':_0xefd408[_0xf734('0x5d')]}});}return null;})[_0xf734('0x1c')](handleEntityNotFound(_0x59d0d3,null))[_0xf734('0x1c')](function(_0x21978b){if(_0x21978b){return _0x21978b[_0xf734('0x32')]({'UserId':_0xee0105[_0xf734('0x53')][_0xf734('0x59')],'read1stAt':_[_0xf734('0x5e')](_0x21978b[_0xf734('0x5f')])?moment()[_0xf734('0x58')](_0xf734('0x60')):undefined});}return null;})[_0xf734('0x1c')](function(_0x205bac){if(_0x205bac){_0x475c2d[_0xf734('0x61')]=_0x205bac[_0xf734('0x62')]({'plain':!![]});interaction_log['info'](_0xf734('0x63'),_0xee0105['user']['id'],_0xee0105[_0xf734('0x5a')][_0xf734('0x35')],_0xee0105[_0xf734('0x5a')][_0xf734('0x64')],_0x475c2d['interaction']['id'],_0xee0105[_0xf734('0x53')]?JSON['stringify'](_0xee0105['body']):_0xf734('0x65'));return respondWithRpcPromise(_0xf734('0x66'),_0xf734('0x67'),_0x475c2d);}return null;})[_0xf734('0x1c')](function(_0xed0c38){var _0x459336=_0xf734('0x68')+_0xed0c38['message'][_0xf734('0x69')];return db[_0xf734('0x6a')]['query'](_0x459336,{'type':db[_0xf734('0x6b')][_0xf734('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x300df7){return _0x300df7;});})[_0xf734('0x1c')](function(_0x3e088e){if(_0x3e088e){_0x475c2d[_0xf734('0x25')][_0xf734('0x6d')]=_0x3e088e[0x0];if(!_0xee0105[_0xf734('0x53')][_0xf734('0x59')])return;return db[_0xf734('0x6e')][_0xf734('0x51')]({'where':{'id':_0xee0105['body'][_0xf734('0x59')],'role':_0xf734('0x5b')},'attributes':['id',_0xf734('0x35'),_0xf734('0x6f'),_0xf734('0x70'),_0xf734('0x71')],'raw':!![]});}return null;})['then'](function(_0x3dc002){if(!_0x3dc002)return null;_0x475c2d[_0xf734('0x25')][_0xf734('0x5b')]=_0x3dc002;return _0x475c2d;})['then'](function(_0x3bcd6c){if(_0x3bcd6c){if(_0xee0105[_0xf734('0x53')][_0xf734('0x72')]){_0x475c2d['message']['interface']=util[_0xf734('0x58')](_0xf734('0x73'),_0xee0105['user'][_0xf734('0x35')]);_0x475c2d[_0xf734('0x25')][_0xf734('0x74')]=_0x475c2d[_0xf734('0x74')];_0x475c2d[_0xf734('0x25')]['motionChannel']=_0x475c2d[_0xf734('0x74')];_0x475c2d[_0xf734('0x25')][_0xf734('0x75')]=_0xf734('0x76');return respondWithRpcPromise(_0xf734('0x77'),'EventManager',{'event':_0xf734('0x78'),'message':_0x475c2d[_0xf734('0x25')]},client9002)['then'](function(){return _0x475c2d;});}return _0x475c2d;}return null;})[_0xf734('0x1c')](respondWithResult(_0x59d0d3,null))['catch'](handleError(_0x59d0d3,null));};var interaction_log=require(_0xf734('0x11'))(_0xf734('0x56'));exports[_0xf734('0x30')]=function(_0x2835b8,_0x231753,_0x1eed6b){var _0x58dc6d={'agent':{},'channel':_0xf734('0x79')};if(_0x2835b8['body']['id']){delete _0x2835b8[_0xf734('0x53')]['id'];}_0x2835b8[_0xf734('0x53')]['UserId']=_0x2835b8['body'][_0xf734('0x59')]||_0x2835b8[_0xf734('0x5a')]['id'];_0x58dc6d['agent']['id']=_0x2835b8[_0xf734('0x53')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x2835b8[_0xf734('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x231753,null))['then'](function(_0x33af91){if(_0x33af91){_0x58dc6d[_0xf734('0x25')]=_0x33af91['get']({'plain':!![]});return db[_0xf734('0x5c')]['find']({'where':{'id':_0x33af91[_0xf734('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x231753,null))[_0xf734('0x1c')](function(_0xe854d5){if(_0xe854d5){_0x58dc6d[_0xf734('0x61')]=_0xe854d5[_0xf734('0x62')]({'plain':!![]});interaction_log[_0xf734('0x1d')](_0xf734('0x7a'),_0x2835b8[_0xf734('0x5a')]['id'],_0x2835b8[_0xf734('0x5a')][_0xf734('0x35')],_0x2835b8[_0xf734('0x5a')][_0xf734('0x64')],_0x58dc6d[_0xf734('0x61')]['id'],_0x2835b8[_0xf734('0x53')]?JSON[_0xf734('0x21')](_0x2835b8[_0xf734('0x53')]):_0xf734('0x65'));return respondWithRpcPromise(_0xf734('0x7b'),_0xf734('0x7c'),_0x58dc6d);}return null;})['then'](function(_0x33adbe){var _0x3aeeba=_0xf734('0x68')+_0x33adbe[_0xf734('0x25')][_0xf734('0x69')];return db[_0xf734('0x6a')][_0xf734('0x3f')](_0x3aeeba,{'type':db[_0xf734('0x6b')][_0xf734('0x6c')][_0xf734('0x7d')],'raw':!![]})[_0xf734('0x1c')](function(_0x5139e0){return _0x5139e0;});})[_0xf734('0x1c')](function(_0xe20a63){if(_0xe20a63){_0x58dc6d[_0xf734('0x25')][_0xf734('0x6d')]=_0xe20a63[0x0];if(!_0x2835b8[_0xf734('0x53')][_0xf734('0x59')])return;return db[_0xf734('0x6e')][_0xf734('0x51')]({'where':{'id':_0x2835b8[_0xf734('0x53')][_0xf734('0x59')],'role':_0xf734('0x5b')},'attributes':['id','name',_0xf734('0x6f'),'email',_0xf734('0x71')],'raw':!![]});}return null;})[_0xf734('0x1c')](function(_0xbeb8eb){if(!_0xbeb8eb)return null;_0x58dc6d['message'][_0xf734('0x5b')]=_0xbeb8eb;return _0x58dc6d;})[_0xf734('0x1c')](function(_0x1828e8){if(_0x1828e8){_0x1828e8[_0xf734('0x25')][_0xf734('0x7e')]=util[_0xf734('0x58')](_0xf734('0x73'),_0x2835b8['user']['name']);_0x1828e8[_0xf734('0x25')][_0xf734('0x74')]=_0x58dc6d[_0xf734('0x74')];_0x1828e8[_0xf734('0x25')]['motionChannel']=_0x58dc6d[_0xf734('0x74')];_0x1828e8[_0xf734('0x25')][_0xf734('0x75')]=_0xf734('0x30');respondWithRpcPromise(_0xf734('0x77'),'EventManager',{'event':_0xf734('0x7f'),'message':_0x1828e8[_0xf734('0x25')]},client9002);return _0x58dc6d;}return null;})[_0xf734('0x1c')](respondWithResult(_0x231753,null))['catch'](handleError(_0x231753,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ae45a05..1d6dd20 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 _0x006b=['OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x006b,0x97));var _0xb006=function(_0x34e4f3,_0x1da709){_0x34e4f3=_0x34e4f3-0x0;var _0x9106e6=_0x006b[_0x34e4f3];return _0x9106e6;};'use strict';var EventEmitter=require(_0xb006('0x0'));var OpenchannelMessage=require(_0xb006('0x1'))['db'][_0xb006('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb006('0x3')](0x0);var events={'afterCreate':_0xb006('0x4'),'afterUpdate':_0xb006('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1b67bc){return function(_0x426463,_0xee8c15,_0x3354de){OpenchannelMessageEvents[_0xb006('0x6')](_0x1b67bc+':'+_0x426463['id'],_0x426463);OpenchannelMessageEvents['emit'](_0x1b67bc,_0x426463);_0x3354de(null);};}for(var e in events){if(events[_0xb006('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xb006('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xbf08=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf08,0x93));var _0x8bf0=function(_0x15f990,_0x3c8e06){_0x15f990=_0x15f990-0x0;var _0x336cf5=_0xbf08[_0x15f990];return _0x336cf5;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x8bf0('0x0'))['db'][_0x8bf0('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8bf0('0x2')](0x0);var events={'afterCreate':_0x8bf0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e2353){return function(_0x1a3774,_0x83e069,_0xce7977){OpenchannelMessageEvents[_0x8bf0('0x4')](_0x1e2353+':'+_0x1a3774['id'],_0x1a3774);OpenchannelMessageEvents['emit'](_0x1e2353,_0x1a3774);_0xce7977(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x8bf0('0x5')](e,emitEvent(event));}}module[_0x8bf0('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index afa51bf..ca57033 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 _0x0573=['Interaction','POST','method','format','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','out','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','secret','CmContact','describe','find','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0573,0x69));var _0x3057=function(_0x16534b,_0x56ff7f){_0x16534b=_0x16534b-0x0;var _0x1be48f=_0x0573[_0x16534b];return _0x1be48f;};'use strict';var _=require(_0x3057('0x0'));var util=require('util');var logger=require(_0x3057('0x1'))(_0x3057('0x2'));var moment=require(_0x3057('0x3'));var BPromise=require(_0x3057('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3057('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0x3057('0x6')]=function(_0x5cfc33,_0xbb1a6b){return _0x5cfc33[_0x3057('0x7')](_0x3057('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x3057('0x9'),'fields':['body'],'type':_0x3057('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x63bf0f,_0x3345c3,_0x41d741){var _0xbff335=_0x5cfc33['models'];var _0xfbb8e7=_0x63bf0f[_0x3057('0xb')]({'plain':!![]});if(_0xfbb8e7[_0x3057('0xc')][_0x3057('0xd')]()==='in'||_0xfbb8e7[_0x3057('0xc')][_0x3057('0xd')]()===_0x3057('0xe')&&!_0xfbb8e7['secret']&&!_[_0x3057('0xf')](_0xfbb8e7['UserId'])){_0xbff335[_0x3057('0x10')][_0x3057('0x11')]({'where':{'id':_0xfbb8e7[_0x3057('0x12')]}})[_0x3057('0x13')](function(_0x423119){if(_0x423119){_0x423119[_0x3057('0x14')]({'lastMsgAt':_0xfbb8e7[_0x3057('0x15')],'lastMsgDirection':_0xfbb8e7[_0x3057('0xc')]['toLowerCase']()});}})[_0x3057('0x16')](function(_0x400800){console[_0x3057('0x17')](_0x400800);});}if(_0xfbb8e7[_0x3057('0xc')]==='out'&&!_0xfbb8e7[_0x3057('0x18')]){var _0x33b24e;_0xbff335[_0x3057('0x19')][_0x3057('0x1a')]()[_0x3057('0x13')](function(_0x2544b7){return _0xbff335['OpenchannelAccount'][_0x3057('0x1b')]({'where':{'id':_0xfbb8e7['OpenchannelAccountId']},'include':[{'model':_0xbff335[_0x3057('0x10')],'as':_0x3057('0x1c'),'where':{'id':_0xfbb8e7[_0x3057('0x12')]},'limit':0x1,'include':[{'model':_0xbff335[_0x3057('0x19')],'as':_0x3057('0x1d'),'attributes':_[_0x3057('0x1e')](_0x2544b7)}]}]});})['then'](function(_0x37b1d7){_0x33b24e=_0x37b1d7[_0x3057('0xb')]({'plain':!![]});if(_0x33b24e&&_0x33b24e[_0x3057('0x1f')]){logger['info'](_0x3057('0x20'),_0x3057('0x21'),util['format'](_0x3057('0x22'),_0xfbb8e7['id'],_0x33b24e[_0x3057('0x1f')]));if(_0x33b24e[_0x3057('0x1c')]&&_0x33b24e[_0x3057('0x1c')][_0x3057('0x23')]){_0xfbb8e7[_0x3057('0x24')]=_['omit'](_0x33b24e[_0x3057('0x1c')][0x0],_0x3057('0x1d'));_0xfbb8e7[_0x3057('0x1d')]=_0x33b24e[_0x3057('0x1c')][0x0][_0x3057('0x1d')];}var _0x3345c3={'method':_0x3057('0x25'),'uri':encodeURI(_0x33b24e['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3345c3[_0x3057('0x26')]){case'GET':_0x3345c3['qs']=_0xfbb8e7;break;case _0x3057('0x25'):_0x3345c3['body']=_0xfbb8e7;break;}return rp(_0x3345c3)['then'](function(_0x335e49){logger['info'](_0x3057('0x20'),_0x3057('0x21'),util[_0x3057('0x27')](_0x3057('0x28'),_0xfbb8e7['id'],_0x33b24e[_0x3057('0x1f')]));if(_0x335e49[_0x3057('0x29')]['threadId']&&_0x335e49['body'][_0x3057('0x2a')]!=_0xfbb8e7[_0x3057('0x24')][_0x3057('0x2a')]){return _0xbff335['OpenchannelInteraction'][_0x3057('0x14')]({'threadId':_0x335e49[_0x3057('0x29')][_0x3057('0x2a')]},{'where':{'id':_0xfbb8e7[_0x3057('0x24')]['id']}});}else{return;}})['then'](function(){return _0x63bf0f['update']({'read':!![]});})['catch'](function(_0x347636){logger[_0x3057('0x17')](_0x3057('0x20'),_0x3057('0x21'),util[_0x3057('0x2b')](_0x347636,{'showHidden':![],'depth':null}));_0x41d741();});}else{_0x41d741();}})[_0x3057('0x2c')](function(){_0x41d741();});}else{_0x41d741();}}},'charset':_0x3057('0x2d'),'collate':_0x3057('0x2e')});}; \ No newline at end of file +var _0x2bb4=['POST','body','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','moment','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','get','direction','toLowerCase','out','secret','update','createdAt','catch','error','CmContact','then','find','OpenchannelInteraction','OpenchannelInteractionId','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','format','replyUri','Interactions','length','Interaction','omit','method','GET'];(function(_0xc94941,_0x5a9cf2){var _0x4bcf9c=function(_0x101d54){while(--_0x101d54){_0xc94941['push'](_0xc94941['shift']());}};_0x4bcf9c(++_0x5a9cf2);}(_0x2bb4,0xdf));var _0x42bb=function(_0xd902ad,_0x34a4db){_0xd902ad=_0xd902ad-0x0;var _0x2dda06=_0x2bb4[_0xd902ad];return _0x2dda06;};'use strict';var _=require(_0x42bb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x42bb('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x42bb('0x2'));var rimraf=require(_0x42bb('0x3'));var config=require('../../config/environment');var attributes=require(_0x42bb('0x4'));module[_0x42bb('0x5')]=function(_0x10d44f,_0x1a25ed){return _0x10d44f[_0x42bb('0x6')](_0x42bb('0x7'),attributes,{'tableName':_0x42bb('0x8'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x22adc1,_0x5115f0,_0x1ff5ad){var _0x204ba1=_0x10d44f['models'];var _0x2e92bd=_0x22adc1[_0x42bb('0x9')]({'plain':!![]});if(_0x2e92bd[_0x42bb('0xa')][_0x42bb('0xb')]()==='in'||_0x2e92bd['direction'][_0x42bb('0xb')]()===_0x42bb('0xc')&&!_0x2e92bd[_0x42bb('0xd')]&&!_['isNil'](_0x2e92bd['UserId'])){_0x204ba1['OpenchannelInteraction']['findOne']({'where':{'id':_0x2e92bd['OpenchannelInteractionId']}})['then'](function(_0x3255b4){if(_0x3255b4){_0x3255b4[_0x42bb('0xe')]({'lastMsgAt':_0x2e92bd[_0x42bb('0xf')],'lastMsgDirection':_0x2e92bd[_0x42bb('0xa')][_0x42bb('0xb')]()});}})[_0x42bb('0x10')](function(_0x18a7cb){console[_0x42bb('0x11')](_0x18a7cb);});}if(_0x2e92bd['direction']===_0x42bb('0xc')&&!_0x2e92bd[_0x42bb('0xd')]){var _0x269e47;_0x204ba1[_0x42bb('0x12')]['describe']()[_0x42bb('0x13')](function(_0xfcd1ff){return _0x204ba1['OpenchannelAccount'][_0x42bb('0x14')]({'where':{'id':_0x2e92bd['OpenchannelAccountId']},'include':[{'model':_0x204ba1[_0x42bb('0x15')],'as':'Interactions','where':{'id':_0x2e92bd[_0x42bb('0x16')]},'limit':0x1,'include':[{'model':_0x204ba1[_0x42bb('0x12')],'as':_0x42bb('0x17'),'attributes':_[_0x42bb('0x18')](_0xfcd1ff)}]}]});})[_0x42bb('0x13')](function(_0x1bc54e){_0x269e47=_0x1bc54e['get']({'plain':!![]});if(_0x269e47&&_0x269e47['replyUri']){logger[_0x42bb('0x19')](_0x42bb('0x1a'),'afterCreate',util[_0x42bb('0x1b')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x2e92bd['id'],_0x269e47[_0x42bb('0x1c')]));if(_0x269e47['Interactions']&&_0x269e47[_0x42bb('0x1d')][_0x42bb('0x1e')]){_0x2e92bd[_0x42bb('0x1f')]=_[_0x42bb('0x20')](_0x269e47[_0x42bb('0x1d')][0x0],'Contact');_0x2e92bd[_0x42bb('0x17')]=_0x269e47[_0x42bb('0x1d')][0x0][_0x42bb('0x17')];}var _0x5115f0={'method':'POST','uri':encodeURI(_0x269e47[_0x42bb('0x1c')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5115f0[_0x42bb('0x21')]){case _0x42bb('0x22'):_0x5115f0['qs']=_0x2e92bd;break;case _0x42bb('0x23'):_0x5115f0[_0x42bb('0x24')]=_0x2e92bd;break;}return rp(_0x5115f0)[_0x42bb('0x13')](function(_0x528a90){logger['info'](_0x42bb('0x1a'),_0x42bb('0x25'),util['format'](_0x42bb('0x26'),_0x2e92bd['id'],_0x269e47[_0x42bb('0x1c')]));if(_0x528a90[_0x42bb('0x24')][_0x42bb('0x27')]&&_0x528a90[_0x42bb('0x24')][_0x42bb('0x27')]!=_0x2e92bd['Interaction'][_0x42bb('0x27')]){return _0x204ba1['OpenchannelInteraction'][_0x42bb('0xe')]({'threadId':_0x528a90[_0x42bb('0x24')][_0x42bb('0x27')]},{'where':{'id':_0x2e92bd[_0x42bb('0x1f')]['id']}});}else{return;}})['then'](function(){return _0x22adc1[_0x42bb('0xe')]({'read':!![]});})['catch'](function(_0x57bf97){logger[_0x42bb('0x11')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x42bb('0x28')](_0x57bf97,{'showHidden':![],'depth':null}));_0x1ff5ad();});}else{_0x1ff5ad();}})['finally'](function(){_0x1ff5ad();});}else{_0x1ff5ad();}}},'charset':_0x42bb('0x29'),'collate':_0x42bb('0x2a')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 4f22e41..c74eed7 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x43754a,_0x76c188){var _0x322613=function(_0x20545d){while(--_0x20545d){_0x43754a['push'](_0x43754a['shift']());}};_0x322613(++_0x76c188);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x80bcf8,_0x1e2e73){var _0x5df22c=function(_0x2e267a){while(--_0x2e267a){_0x80bcf8['push'](_0x80bcf8['shift']());}};_0x5df22c(++_0x1e2e73);}(_0x1261,0x144));var _0x1126=function(_0x3af955,_0x21431c){_0x3af955=_0x3af955-0x0;var _0x167de5=_0x1261[_0x3af955];return _0x167de5;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 327b2e3..e4db858 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 _0x2af5=['update','removeListener','register','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x22a518,_0x4dd9a6){var _0x5395a9=function(_0x55eeb3){while(--_0x55eeb3){_0x22a518['push'](_0x22a518['shift']());}};_0x5395a9(++_0x4dd9a6);}(_0x2af5,0xba));var _0x52af=function(_0x52544a,_0x41e302){_0x52544a=_0x52544a-0x0;var _0x501ecf=_0x2af5[_0x52544a];return _0x501ecf;};'use strict';var OpenchannelMessageEvents=require(_0x52af('0x0'));var events=[_0x52af('0x1'),_0x52af('0x2'),_0x52af('0x3')];function createListener(_0x26cbca,_0x34ec63){return function(_0x5351ee){_0x34ec63['emit'](_0x26cbca,_0x5351ee);};}function removeListener(_0x31169b,_0x28f04f){return function(){OpenchannelMessageEvents[_0x52af('0x4')](_0x31169b,_0x28f04f);};}exports[_0x52af('0x5')]=function(_0xabf4e8){for(var _0x5b2a2b=0x0,_0x1d0770=events['length'];_0x5b2a2b<_0x1d0770;_0x5b2a2b++){var _0x378258=events[_0x5b2a2b];var _0x2f1976=createListener(_0x52af('0x6')+_0x378258,_0xabf4e8);OpenchannelMessageEvents['on'](_0x378258,_0x2f1976);}}; \ No newline at end of file +var _0x908e=['emit','length','./openchannelMessage.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x908e,0x182));var _0xe908=function(_0x3d9de8,_0x26defd){_0x3d9de8=_0x3d9de8-0x0;var _0x2746f1=_0x908e[_0x3d9de8];return _0x2746f1;};'use strict';var OpenchannelMessageEvents=require(_0xe908('0x0'));var events=[_0xe908('0x1'),'remove','update'];function createListener(_0x380c86,_0x2d374a){return function(_0x1b6093){_0x2d374a[_0xe908('0x2')](_0x380c86,_0x1b6093);};}function removeListener(_0x4c2cdb,_0x46a00d){return function(){OpenchannelMessageEvents['removeListener'](_0x4c2cdb,_0x46a00d);};}exports['register']=function(_0x448267){for(var _0x27b216=0x0,_0x2df114=events[_0xe908('0x3')];_0x27b216<_0x2df114;_0x27b216++){var _0x7a1fdd=events[_0x27b216];var _0x6e8920=createListener('openchannelMessage:'+_0x7a1fdd,_0x448267);OpenchannelMessageEvents['on'](_0x7a1fdd,_0x6e8920);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 3f485cb..8e9d8e0 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 _0x931f=['show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','destroy','delete','removeTeams','removeAgents','util','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x2a5517,_0x250516){var _0x2a40b4=function(_0x3a35b4){while(--_0x3a35b4){_0x2a5517['push'](_0x2a5517['shift']());}};_0x2a40b4(++_0x250516);}(_0x931f,0x187));var _0xf931=function(_0x1a4b42,_0x198645){_0x1a4b42=_0x1a4b42-0x0;var _0x4e78a9=_0x931f[_0x1a4b42];return _0x4e78a9;};'use strict';var multer=require('multer');var util=require(_0xf931('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf931('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf931('0x2'));var config=require(_0xf931('0x3'));var controller=require(_0xf931('0x4'));router[_0xf931('0x5')]('/',auth[_0xf931('0x6')](),controller['index']);router['get'](_0xf931('0x7'),auth['isAuthenticated'](),controller[_0xf931('0x8')]);router['get']('/:id',auth[_0xf931('0x6')](),controller[_0xf931('0x9')]);router['get'](_0xf931('0xa'),auth[_0xf931('0x6')](),controller[_0xf931('0xb')]);router[_0xf931('0x5')](_0xf931('0xc'),auth[_0xf931('0x6')](),controller[_0xf931('0xd')]);router[_0xf931('0x5')]('/:id/users',auth[_0xf931('0x6')](),controller[_0xf931('0xe')]);router[_0xf931('0xf')]('/',auth['isAuthenticated'](),controller[_0xf931('0x10')]);router['post'](_0xf931('0xc'),auth['isAuthenticated'](),controller[_0xf931('0x11')]);router[_0xf931('0xf')](_0xf931('0x12'),auth[_0xf931('0x6')](),controller[_0xf931('0x13')]);router[_0xf931('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf931('0x15')]);router[_0xf931('0x16')](_0xf931('0xc'),auth[_0xf931('0x6')](),controller[_0xf931('0x17')]);router[_0xf931('0x16')](_0xf931('0x12'),auth[_0xf931('0x6')](),controller[_0xf931('0x18')]);module['exports']=router; \ No newline at end of file +var _0x2848=['post','/:id/teams','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents'];(function(_0x2b2194,_0x1fe7e6){var _0x54c2fa=function(_0x303bbe){while(--_0x303bbe){_0x2b2194['push'](_0x2b2194['shift']());}};_0x54c2fa(++_0x1fe7e6);}(_0x2848,0x1e9));var _0x8284=function(_0x2c95c5,_0x21d246){_0x2c95c5=_0x2c95c5-0x0;var _0x2887ee=_0x2848[_0x2c95c5];return _0x2887ee;};'use strict';var multer=require(_0x8284('0x0'));var util=require('util');var path=require(_0x8284('0x1'));var timeout=require('connect-timeout');var express=require(_0x8284('0x2'));var router=express[_0x8284('0x3')]();var fs_extra=require(_0x8284('0x4'));var auth=require(_0x8284('0x5'));var interaction=require(_0x8284('0x6'));var config=require(_0x8284('0x7'));var controller=require(_0x8284('0x8'));router[_0x8284('0x9')]('/',auth['isAuthenticated'](),controller[_0x8284('0xa')]);router[_0x8284('0x9')](_0x8284('0xb'),auth[_0x8284('0xc')](),controller[_0x8284('0xd')]);router[_0x8284('0x9')](_0x8284('0xe'),auth['isAuthenticated'](),controller[_0x8284('0xf')]);router['get'](_0x8284('0x10'),auth[_0x8284('0xc')](),controller[_0x8284('0x11')]);router['get']('/:id/teams',auth[_0x8284('0xc')](),controller[_0x8284('0x12')]);router[_0x8284('0x9')](_0x8284('0x13'),auth[_0x8284('0xc')](),controller[_0x8284('0x14')]);router[_0x8284('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8284('0x15')](_0x8284('0x16'),auth[_0x8284('0xc')](),controller[_0x8284('0x17')]);router[_0x8284('0x15')](_0x8284('0x13'),auth[_0x8284('0xc')](),controller[_0x8284('0x18')]);router['put'](_0x8284('0xe'),auth['isAuthenticated'](),controller[_0x8284('0x19')]);router[_0x8284('0x1a')]('/:id',auth[_0x8284('0xc')](),controller[_0x8284('0x1b')]);router[_0x8284('0x1a')](_0x8284('0x16'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x8284('0x1a')](_0x8284('0x13'),auth['isAuthenticated'](),controller[_0x8284('0x1c')]);module[_0x8284('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index e2fd484..0fbf13e 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 _0x49db=['exports','STRING','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x391a34,_0x20efae){var _0x29a99d=function(_0x2d0afd){while(--_0x2d0afd){_0x391a34['push'](_0x391a34['shift']());}};_0x29a99d(++_0x20efae);}(_0x49db,0x173));var _0xb49d=function(_0x467ec8,_0x10ef57){_0x467ec8=_0x467ec8-0x0;var _0x42bb8f=_0x49db[_0x467ec8];return _0x42bb8f;};'use strict';var Sequelize=require(_0xb49d('0x0'));module[_0xb49d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb49d('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb49d('0x3')](_0xb49d('0x4'),'beepall',_0xb49d('0x5'))}}; \ No newline at end of file +var _0xff74=['rrmemory','beepall','roundrobin','sequelize','STRING','name','ENUM'];(function(_0x3e97f1,_0x31d803){var _0x1e382=function(_0x44e4ad){while(--_0x44e4ad){_0x3e97f1['push'](_0x3e97f1['shift']());}};_0x1e382(++_0x31d803);}(_0xff74,0x16f));var _0x4ff7=function(_0x430f44,_0x4ae21b){_0x430f44=_0x430f44-0x0;var _0x1f6b0f=_0xff74[_0x430f44];return _0x1f6b0f;};'use strict';var Sequelize=require(_0x4ff7('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ff7('0x1')],'unique':_0x4ff7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4ff7('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4ff7('0x3')](_0x4ff7('0x4'),_0x4ff7('0x5'),_0x4ff7('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 380a4cd..6cb0166 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 _0xbaec=['sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','forEach','emit','removeTeams','select','field','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','union','sequelize','isEmpty','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','mustache','path'];(function(_0x1db08,_0x1550e2){var _0x14ec11=function(_0x522856){while(--_0x522856){_0x1db08['push'](_0x1db08['shift']());}};_0x14ec11(++_0x1550e2);}(_0xbaec,0x7f));var _0xcbae=function(_0x3e86d8,_0xaf6e5c){_0x3e86d8=_0x3e86d8-0x0;var _0x52daf1=_0xbaec[_0x3e86d8];return _0x52daf1;};'use strict';var emlformat=require(_0xcbae('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbae('0x1'));var rp=require(_0xcbae('0x2'));var moment=require(_0xcbae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcbae('0x4'));var util=require('util');var path=require(_0xcbae('0x5'));var sox=require(_0xcbae('0x6'));var csv=require(_0xcbae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcbae('0x8'));var _=require('lodash');var squel=require(_0xcbae('0x9'));var crypto=require(_0xcbae('0xa'));var jsforce=require(_0xcbae('0xb'));var deskjs=require(_0xcbae('0xc'));var toCsv=require(_0xcbae('0x7'));var querystring=require(_0xcbae('0xd'));var Papa=require(_0xcbae('0xe'));var Redis=require(_0xcbae('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcbae('0x10'));var as=require(_0xcbae('0x11'));var hardwareService=require(_0xcbae('0x12'));var logger=require(_0xcbae('0x13'))(_0xcbae('0x14'));var utils=require(_0xcbae('0x15'));var config=require(_0xcbae('0x16'));var licenseUtil=require(_0xcbae('0x17'));var db=require(_0xcbae('0x18'))['db'];config[_0xcbae('0x19')]=_[_0xcbae('0x1a')](config[_0xcbae('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xcbae('0x1b'))(new Redis(config[_0xcbae('0x19')]));require('./openchannelQueue.socket')[_0xcbae('0x1c')](socket);function respondWithStatusCode(_0x22008,_0x174db8){_0x174db8=_0x174db8||0xcc;return function(_0x3afa90){if(_0x3afa90){return _0x22008['sendStatus'](_0x174db8);}return _0x22008[_0xcbae('0x1d')](_0x174db8)[_0xcbae('0x1e')]();};}function respondWithResult(_0x1b071d,_0x50fe9b){_0x50fe9b=_0x50fe9b||0xc8;return function(_0x24ca3f){if(_0x24ca3f){return _0x1b071d[_0xcbae('0x1d')](_0x50fe9b)['json'](_0x24ca3f);}};}function respondWithFilteredResult(_0x1a16ac,_0x1d06fa){return function(_0x233998){if(_0x233998){var _0x5d7b56=typeof _0x1d06fa[_0xcbae('0x1f')]===_0xcbae('0x20')&&typeof _0x1d06fa['limit']===_0xcbae('0x20');var _0x2ebe39=_0x233998['count'];var _0x9af4cb=_0x5d7b56?0x0:_0x1d06fa['offset'];var _0x6e36b8=_0x5d7b56?_0x233998[_0xcbae('0x21')]:_0x1d06fa['offset']+_0x1d06fa[_0xcbae('0x22')];var _0x5b4777;if(_0x6e36b8>=_0x2ebe39){_0x6e36b8=_0x2ebe39;_0x5b4777=0xc8;}else{_0x5b4777=0xce;}_0x1a16ac['status'](_0x5b4777);return _0x1a16ac[_0xcbae('0x23')](_0xcbae('0x24'),_0x9af4cb+'-'+_0x6e36b8+'/'+_0x2ebe39)['json'](_0x233998);}return null;};}function patchUpdates(_0x5894ec){return function(_0x3d4efc){try{jsonpatch[_0xcbae('0x25')](_0x3d4efc,_0x5894ec,!![]);}catch(_0x3c71fa){return BPromise['reject'](_0x3c71fa);}return _0x3d4efc['save']();};}function saveUpdates(_0x28afa7,_0xb72b5){return function(_0x585fcc){if(_0x585fcc){return _0x585fcc[_0xcbae('0x26')](_0x28afa7)[_0xcbae('0x27')](function(_0x1008d5){return _0x1008d5;});}return null;};}function removeEntity(_0x19e803,_0x30ec21){return function(_0x2f4c9b){if(_0x2f4c9b){return _0x2f4c9b[_0xcbae('0x28')]()['then'](function(){var _0x4fd528=_0x2f4c9b[_0xcbae('0x29')]({'plain':!![]});var _0xec0e6d=_0xcbae('0x2a');return db[_0xcbae('0x2b')][_0xcbae('0x28')]({'where':{'type':_0xec0e6d,'resourceId':_0x4fd528['id']}})['then'](function(){return _0x2f4c9b;});})['then'](function(){_0x19e803['status'](0xcc)[_0xcbae('0x1e')]();});}};}function handleEntityNotFound(_0x2b0bc3,_0x543385){return function(_0x2e538a){if(!_0x2e538a){_0x2b0bc3[_0xcbae('0x2c')](0x194);}return _0x2e538a;};}function handleError(_0x331063,_0x2d04bd){_0x2d04bd=_0x2d04bd||0x1f4;return function(_0x2ad09c){logger[_0xcbae('0x2d')](_0x2ad09c[_0xcbae('0x2e')]);if(_0x2ad09c[_0xcbae('0x2f')]){delete _0x2ad09c['name'];}_0x331063[_0xcbae('0x1d')](_0x2d04bd)[_0xcbae('0x30')](_0x2ad09c);};}exports[_0xcbae('0x31')]=function(_0x3cb703,_0x275909){var _0x4a5c8d={},_0x29d037={},_0x28f88f={'count':0x0,'rows':[]};var _0x171876=_['map'](db[_0xcbae('0x32')][_0xcbae('0x33')],function(_0x438cc5){return{'name':_0x438cc5[_0xcbae('0x34')],'type':_0x438cc5[_0xcbae('0x35')]['key']};});_0x29d037[_0xcbae('0x36')]=_[_0xcbae('0x37')](_0x171876,_0xcbae('0x2f'));_0x29d037[_0xcbae('0x38')]=_['keys'](_0x3cb703[_0xcbae('0x38')]);_0x29d037['filters']=_[_0xcbae('0x39')](_0x29d037[_0xcbae('0x36')],_0x29d037[_0xcbae('0x38')]);_0x4a5c8d[_0xcbae('0x3a')]=_[_0xcbae('0x39')](_0x29d037[_0xcbae('0x36')],qs[_0xcbae('0x3b')](_0x3cb703[_0xcbae('0x38')][_0xcbae('0x3b')]));_0x4a5c8d['attributes']=_0x4a5c8d[_0xcbae('0x3a')][_0xcbae('0x3c')]?_0x4a5c8d[_0xcbae('0x3a')]:_0x29d037[_0xcbae('0x36')];if(!_0x3cb703[_0xcbae('0x38')][_0xcbae('0x3d')]('nolimit')){_0x4a5c8d[_0xcbae('0x22')]=qs[_0xcbae('0x22')](_0x3cb703[_0xcbae('0x38')][_0xcbae('0x22')]);_0x4a5c8d[_0xcbae('0x1f')]=qs[_0xcbae('0x1f')](_0x3cb703[_0xcbae('0x38')][_0xcbae('0x1f')]);}_0x4a5c8d[_0xcbae('0x3e')]=qs[_0xcbae('0x3f')](_0x3cb703[_0xcbae('0x38')][_0xcbae('0x3f')]);_0x4a5c8d['where']=qs[_0xcbae('0x40')](_[_0xcbae('0x41')](_0x3cb703['query'],_0x29d037[_0xcbae('0x40')]),_0x171876);if(_0x3cb703[_0xcbae('0x38')][_0xcbae('0x42')]){_0x4a5c8d[_0xcbae('0x43')]=_[_0xcbae('0x44')](_0x4a5c8d[_0xcbae('0x43')],{'$or':_[_0xcbae('0x37')](_0x171876,function(_0x2e2280){if(_0x2e2280[_0xcbae('0x35')]!==_0xcbae('0x45')){var _0x4601dc={};_0x4601dc[_0x2e2280['name']]={'$like':'%'+_0x3cb703[_0xcbae('0x38')][_0xcbae('0x42')]+'%'};return _0x4601dc;}})});}_0x4a5c8d=_[_0xcbae('0x44')]({},_0x4a5c8d,_0x3cb703[_0xcbae('0x46')]);var _0x1db3d3={'where':_0x4a5c8d[_0xcbae('0x43')]};return db[_0xcbae('0x32')][_0xcbae('0x21')](_0x1db3d3)['then'](function(_0x40a13e){_0x28f88f['count']=_0x40a13e;if(_0x3cb703[_0xcbae('0x38')]['includeAll']){_0x4a5c8d[_0xcbae('0x47')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xcbae('0x48')](_0x4a5c8d);})['then'](function(_0x1a0af3){_0x28f88f[_0xcbae('0x49')]=_0x1a0af3;return _0x28f88f;})[_0xcbae('0x27')](respondWithFilteredResult(_0x275909,_0x4a5c8d))[_0xcbae('0x4a')](handleError(_0x275909,null));};exports[_0xcbae('0x4b')]=function(_0x39a8a1,_0x47e2c3){var _0x38e1f3={'raw':!![],'where':{'id':_0x39a8a1[_0xcbae('0x4c')]['id']}},_0x3a2e6d={};_0x3a2e6d[_0xcbae('0x36')]=_['keys'](db[_0xcbae('0x32')][_0xcbae('0x33')]);_0x3a2e6d['query']=_[_0xcbae('0x4d')](_0x39a8a1[_0xcbae('0x38')]);_0x3a2e6d['filters']=_[_0xcbae('0x39')](_0x3a2e6d[_0xcbae('0x36')],_0x3a2e6d[_0xcbae('0x38')]);_0x38e1f3['attributes']=_[_0xcbae('0x39')](_0x3a2e6d[_0xcbae('0x36')],qs[_0xcbae('0x3b')](_0x39a8a1[_0xcbae('0x38')][_0xcbae('0x3b')]));_0x38e1f3[_0xcbae('0x3a')]=_0x38e1f3['attributes']['length']?_0x38e1f3[_0xcbae('0x3a')]:_0x3a2e6d[_0xcbae('0x36')];if(_0x39a8a1[_0xcbae('0x38')][_0xcbae('0x4e')]){_0x38e1f3['include']=[{'all':!![]}];}_0x38e1f3=_[_0xcbae('0x44')]({},_0x38e1f3,_0x39a8a1['options']);return db[_0xcbae('0x32')][_0xcbae('0x4f')](_0x38e1f3)[_0xcbae('0x27')](handleEntityNotFound(_0x47e2c3,null))[_0xcbae('0x27')](respondWithResult(_0x47e2c3,null))[_0xcbae('0x4a')](handleError(_0x47e2c3,null));};exports['create']=function(_0x2b3bef,_0x2498db){return db[_0xcbae('0x32')]['create'](_0x2b3bef['body'],{})[_0xcbae('0x27')](function(_0x3cb857){var _0x178572=_0x2b3bef['user']['get']({'plain':!![]});if(!_0x178572)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x178572['role']===_0xcbae('0x50')){var _0x5d28d7=_0x3cb857[_0xcbae('0x29')]({'plain':!![]});var _0x3df991=_0xcbae('0x2a');return db[_0xcbae('0x51')][_0xcbae('0x4f')]({'where':{'name':_0x3df991,'userProfileId':_0x178572['userProfileId']},'raw':!![]})[_0xcbae('0x27')](function(_0x4ee2f4){if(_0x4ee2f4&&_0x4ee2f4[_0xcbae('0x52')]===0x0){return db['UserProfileResource'][_0xcbae('0x53')]({'name':_0x5d28d7[_0xcbae('0x2f')],'resourceId':_0x5d28d7['id'],'type':_0x4ee2f4[_0xcbae('0x2f')],'sectionId':_0x4ee2f4['id']},{})[_0xcbae('0x27')](function(){return _0x3cb857;});}else{return _0x3cb857;}})[_0xcbae('0x4a')](function(_0x2f562e){logger['error'](_0xcbae('0x54'),_0x2f562e);throw _0x2f562e;});}return _0x3cb857;})['then'](respondWithResult(_0x2498db,0xc9))[_0xcbae('0x4a')](handleError(_0x2498db,null));};exports[_0xcbae('0x26')]=function(_0x53e021,_0x8c7ad7){if(_0x53e021[_0xcbae('0x55')]['id']){delete _0x53e021[_0xcbae('0x55')]['id'];}return db[_0xcbae('0x32')][_0xcbae('0x4f')]({'where':{'id':_0x53e021[_0xcbae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x8c7ad7,null))['then'](saveUpdates(_0x53e021['body'],null))[_0xcbae('0x27')](respondWithResult(_0x8c7ad7,null))[_0xcbae('0x4a')](handleError(_0x8c7ad7,null));};exports[_0xcbae('0x28')]=function(_0x4e10b6,_0x4b9e81){return db[_0xcbae('0x32')][_0xcbae('0x4f')]({'where':{'id':_0x4e10b6['params']['id']}})[_0xcbae('0x27')](handleEntityNotFound(_0x4b9e81,null))[_0xcbae('0x27')](removeEntity(_0x4b9e81,null))['catch'](handleError(_0x4b9e81,null));};exports[_0xcbae('0x56')]=function(_0x39c1f8,_0xdac676){return db[_0xcbae('0x32')][_0xcbae('0x56')]()['then'](respondWithResult(_0xdac676,null))['catch'](handleError(_0xdac676,null));};exports[_0xcbae('0x57')]=function(_0x203295,_0x2d4403,_0x468555){var _0x4f3cce={'raw':!![],'where':{}},_0x1156ad={},_0x4b8dc8;return db[_0xcbae('0x32')]['findOne']({'where':{'id':_0x203295['params']['id']}})['then'](handleEntityNotFound(_0x2d4403,null))[_0xcbae('0x27')](function(_0x4ae8d0){if(_0x4ae8d0){_0x4b8dc8=_0x4ae8d0['get']({'plain':!![]});_0x1156ad[_0xcbae('0x36')]=_['keys'](db[_0xcbae('0x58')][_0xcbae('0x33')]);_0x1156ad[_0xcbae('0x38')]=_['keys'](_0x203295[_0xcbae('0x38')]);_0x1156ad[_0xcbae('0x40')]=_[_0xcbae('0x39')](_0x1156ad[_0xcbae('0x36')],_0x1156ad[_0xcbae('0x38')]);_0x4f3cce[_0xcbae('0x3a')]=_[_0xcbae('0x39')](_0x1156ad[_0xcbae('0x36')],qs[_0xcbae('0x3b')](_0x203295['query']['fields']));_0x4f3cce[_0xcbae('0x3a')]=_0x4f3cce[_0xcbae('0x3a')][_0xcbae('0x3c')]?_0x4f3cce['attributes']:_0x1156ad[_0xcbae('0x36')];if(!_0x203295[_0xcbae('0x38')][_0xcbae('0x3d')](_0xcbae('0x59'))){_0x4f3cce['limit']=qs[_0xcbae('0x22')](_0x203295[_0xcbae('0x38')][_0xcbae('0x22')]);_0x4f3cce[_0xcbae('0x1f')]=qs['offset'](_0x203295[_0xcbae('0x38')]['offset']);}_0x4f3cce['order']=qs[_0xcbae('0x3f')](_0x203295['query'][_0xcbae('0x3f')]);_0x4f3cce[_0xcbae('0x43')]=qs[_0xcbae('0x40')](_[_0xcbae('0x41')](_0x203295['query'],_0x1156ad[_0xcbae('0x40')]));_0x4f3cce['where'][_0xcbae('0x5a')]=_0x4ae8d0['id'];if(_0x203295[_0xcbae('0x38')][_0xcbae('0x42')]){_0x4f3cce['where']=_[_0xcbae('0x44')](_0x4f3cce[_0xcbae('0x43')],{'$or':_[_0xcbae('0x37')](_0x4f3cce[_0xcbae('0x3a')],function(_0x2b3c6b){var _0x4d8832={};_0x4d8832[_0x2b3c6b]={'$like':'%'+_0x203295[_0xcbae('0x38')][_0xcbae('0x42')]+'%'};return _0x4d8832;})});}_0x4f3cce=_[_0xcbae('0x44')]({},_0x4f3cce,_0x203295[_0xcbae('0x46')]);return db[_0xcbae('0x58')][_0xcbae('0x48')](_0x4f3cce);}})[_0xcbae('0x27')](function(_0xa2d693){if(_0xa2d693){return db[_0xcbae('0x5b')][_0xcbae('0x5c')]({'where':{'id':_[_0xcbae('0x37')](_0xa2d693,'UserId'),'role':'agent'},'attributes':['id',_0xcbae('0x2f'),_0xcbae('0x5d'),_0xcbae('0x5e'),_0xcbae('0x5f')]});}})['then'](function(_0x1d777d){if(_0x1d777d){return{'count':_0x1d777d[_0xcbae('0x21')],'rows':_[_0xcbae('0x37')](_0x1d777d['rows'],function(_0x27148d){return{'membername':_0x27148d[_0xcbae('0x2f')],'UserId':_0x27148d['id'],'queue_name':_0x4b8dc8[_0xcbae('0x2f')],'OpenchannelQueueId':_0x4b8dc8['id'],'interface':util[_0xcbae('0x60')](_0xcbae('0x61'),'SIP',_0x27148d[_0xcbae('0x2f')]),'penalty':0x0,'paused':_0x27148d[_0xcbae('0x5d')],'createdAt':_0x27148d[_0xcbae('0x5f')],'updatedAt':_0x27148d[_0xcbae('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcbae('0x27')](respondWithFilteredResult(_0x2d4403,_0x4f3cce))['catch'](handleError(_0x2d4403,null));};exports[_0xcbae('0x62')]=function(_0x35b78c,_0x197b92,_0x1c9239){var _0x23f65b={};var _0xa87ce4={};var _0x52d793;var _0x5b8094;return db[_0xcbae('0x32')][_0xcbae('0x63')]({'where':{'id':_0x35b78c[_0xcbae('0x4c')]['id']}})[_0xcbae('0x27')](handleEntityNotFound(_0x197b92,null))[_0xcbae('0x27')](function(_0x219f9e){if(_0x219f9e){_0x52d793=_0x219f9e;_0xa87ce4[_0xcbae('0x36')]=_['keys'](db[_0xcbae('0x64')][_0xcbae('0x33')]);_0xa87ce4[_0xcbae('0x38')]=_[_0xcbae('0x4d')](_0x35b78c[_0xcbae('0x38')]);_0xa87ce4[_0xcbae('0x40')]=_[_0xcbae('0x39')](_0xa87ce4['model'],_0xa87ce4[_0xcbae('0x38')]);_0x23f65b[_0xcbae('0x3a')]=_['intersection'](_0xa87ce4['model'],qs['fields'](_0x35b78c['query'][_0xcbae('0x3b')]));_0x23f65b['attributes']=_0x23f65b[_0xcbae('0x3a')][_0xcbae('0x3c')]?_0x23f65b['attributes']:_0xa87ce4[_0xcbae('0x36')];_0x23f65b[_0xcbae('0x3e')]=qs[_0xcbae('0x3f')](_0x35b78c[_0xcbae('0x38')][_0xcbae('0x3f')]);_0x23f65b[_0xcbae('0x43')]=qs[_0xcbae('0x40')](_[_0xcbae('0x41')](_0x35b78c[_0xcbae('0x38')],_0xa87ce4['filters']));if(_0x35b78c[_0xcbae('0x38')][_0xcbae('0x42')]){_0x23f65b[_0xcbae('0x43')]=_['merge'](_0x23f65b['where'],{'$or':_[_0xcbae('0x37')](_0x23f65b[_0xcbae('0x3a')],function(_0x402b0b){var _0x56e1dd={};_0x56e1dd[_0x402b0b]={'$like':'%'+_0x35b78c[_0xcbae('0x38')][_0xcbae('0x42')]+'%'};return _0x56e1dd;})});}_0x23f65b=_[_0xcbae('0x44')]({},_0x23f65b,_0x35b78c[_0xcbae('0x46')]);return _0x52d793['getTeams'](_0x23f65b);}})['then'](function(_0x4a0d48){if(_0x4a0d48){_0x5b8094=_0x4a0d48[_0xcbae('0x3c')];if(!_0x35b78c[_0xcbae('0x38')]['hasOwnProperty'](_0xcbae('0x59'))){_0x23f65b[_0xcbae('0x22')]=qs[_0xcbae('0x22')](_0x35b78c[_0xcbae('0x38')][_0xcbae('0x22')]);_0x23f65b[_0xcbae('0x1f')]=qs['offset'](_0x35b78c[_0xcbae('0x38')][_0xcbae('0x1f')]);}return _0x52d793['getTeams'](_0x23f65b);}})['then'](function(_0x46e117){if(_0x46e117){return _0x46e117?{'count':_0x5b8094,'rows':_0x46e117}:null;}})[_0xcbae('0x27')](respondWithResult(_0x197b92,null))[_0xcbae('0x4a')](handleError(_0x197b92,null));};exports[_0xcbae('0x65')]=function(_0x1a4d5a,_0x418d8c,_0x453a46){var _0x453df5=_0x1a4d5a[_0xcbae('0x55')][_0xcbae('0x66')];return db[_0xcbae('0x64')][_0xcbae('0x48')]({'where':{'id':_0x453df5},'attributes':['id'],'include':[{'model':db[_0xcbae('0x5b')],'as':_0xcbae('0x67'),'attributes':['id',_0xcbae('0x2f'),_0xcbae('0x68'),_0xcbae('0x69'),_0xcbae('0x6a')],'raw':!![]}]})[_0xcbae('0x27')](function(_0x1f7493){if(_0x1f7493){var _0x13c510=_['flatMap'](_0x1f7493,function(_0x2b7249){var _0x1ad04e=_0x2b7249[_0xcbae('0x29')]({'plain':!![]});return _0x1ad04e[_0xcbae('0x67')];});return db[_0xcbae('0x32')]['find']({'where':{'id':_0x1a4d5a['params']['id']}})[_0xcbae('0x27')](function(_0x1ae94d){return db['sequelize'][_0xcbae('0x6b')](function(_0x5ecf50){return _0x1ae94d[_0xcbae('0x65')](_0x453df5,{'transaction':_0x5ecf50})['then'](function(){return BPromise[_0xcbae('0x6c')](_0x13c510,function(_0x45d112){return db[_0xcbae('0x58')]['findOrCreate']({'where':{'UserId':_0x45d112['id'],'OpenchannelQueueId':_0x1a4d5a[_0xcbae('0x4c')]['id']},'transaction':_0x5ecf50});});})['then'](function(){_0x13c510[_0xcbae('0x6d')](function(_0x5cbdf7){socket[_0xcbae('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x5cbdf7['id'],'OpenchannelQueueId':_0x1ae94d['id']});});});});});}})[_0xcbae('0x27')](respondWithStatusCode(_0x418d8c,null))[_0xcbae('0x4a')](handleError(_0x418d8c,null));};exports[_0xcbae('0x6f')]=function(_0x190cad,_0x5ab370,_0x159f58){return db['Team'][_0xcbae('0x48')]({'where':{'id':_0x190cad[_0xcbae('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xcbae('0x5b')],'as':_0xcbae('0x67'),'attributes':['id'],'raw':!![]}]})[_0xcbae('0x27')](handleEntityNotFound(_0x5ab370,null))[_0xcbae('0x27')](function(_0x2439c8){var _0x55b66f=_['map'](_0x2439c8,'id');var _0x37f7e7=[];var _0x3a3d4c=[];var _0x228fbd=squel[_0xcbae('0x70')]();_0x228fbd[_0xcbae('0x71')]('tq.TeamId')['from'](_0xcbae('0x72'),'tq')['join'](_0xcbae('0x73'),'ut',_0xcbae('0x74'))[_0xcbae('0x43')]('OpenchannelQueueId\x20=\x20?',_0x190cad[_0xcbae('0x4c')]['id']);for(var _0x24e0b5=0x0;_0x24e0b5<_0x2439c8[_0xcbae('0x3c')];_0x24e0b5+=0x1){let _0x2b9cda=_0x2439c8[_0x24e0b5];for(var _0x1227e0=0x0;_0x1227e0<_0x2b9cda['Agents'][_0xcbae('0x3c')];_0x1227e0+=0x1){let _0x3cacbb=_0x2b9cda[_0xcbae('0x67')][_0x1227e0];var _0x10334b=_0x228fbd[_0xcbae('0x75')]();_0x10334b['where'](_0xcbae('0x76'),_0x3cacbb['id']);_0x3a3d4c[_0xcbae('0x77')](db['sequelize'][_0xcbae('0x38')](_0x10334b['toString'](),{'type':db['sequelize'][_0xcbae('0x78')]['SELECT']})[_0xcbae('0x27')](function(_0x4ab134){if(_0x4ab134[_0xcbae('0x3c')]===0x1){return _0x3cacbb['id'];}else{var _0x1c8065=_['every'](_[_0xcbae('0x37')](_0x4ab134,_0xcbae('0x79')),function(_0x3ca325){return _[_0xcbae('0x7a')](_0x55b66f,_0x3ca325);});if(_0x1c8065){return _0x3cacbb['id'];}}}));}}return BPromise['all'](_0x3a3d4c)[_0xcbae('0x27')](function(_0x4a594b){_0x37f7e7=_(_0x37f7e7)[_0xcbae('0x7b')](_0x4a594b)['compact']()['value']();return db[_0xcbae('0x32')]['find']({'where':{'id':_0x190cad[_0xcbae('0x4c')]['id']}})[_0xcbae('0x27')](function(_0x446506){return db[_0xcbae('0x7c')][_0xcbae('0x6b')](function(_0x5af1c5){return _0x446506[_0xcbae('0x6f')](_0x190cad[_0xcbae('0x38')][_0xcbae('0x66')],{'transaction':_0x5af1c5})['then'](function(){if(!_[_0xcbae('0x7d')](_0x37f7e7)){return _0x446506['removeAgents'](_0x37f7e7,{'transaction':_0x5af1c5});}})[_0xcbae('0x27')](function(){_0x37f7e7['forEach'](function(_0x5ec806){socket['emit'](_0xcbae('0x7e'),{'UserId':_0x5ec806,'OpenchannelQueueId':_0x446506['id']});});});});});});})[_0xcbae('0x27')](respondWithStatusCode(_0x5ab370,null))[_0xcbae('0x4a')](handleError(_0x5ab370,null));};exports[_0xcbae('0x7f')]=function(_0x15e435,_0x16ceca,_0x52056c){return db[_0xcbae('0x32')][_0xcbae('0x4f')]({'where':{'id':_0x15e435[_0xcbae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16ceca,null))[_0xcbae('0x27')](function(_0x4f2ac4){if(_0x4f2ac4){return _0x4f2ac4[_0xcbae('0x7f')](_0x15e435[_0xcbae('0x55')][_0xcbae('0x66')],_['omit'](_0x15e435[_0xcbae('0x55')],[_0xcbae('0x66'),'id'])||{})[_0xcbae('0x80')](function(_0x4501ea){for(var _0xec9058=0x0;_0xec9058<_0x15e435[_0xcbae('0x55')]['ids'][_0xcbae('0x3c')];_0xec9058+=0x1){socket['emit'](_0xcbae('0x81'),{'UserId':Number(_0x15e435['body'][_0xcbae('0x66')][_0xec9058]),'OpenchannelQueueId':Number(_0x15e435['params']['id'])});}return _0x4501ea;});}})['then'](respondWithResult(_0x16ceca,null))[_0xcbae('0x4a')](handleError(_0x16ceca,null));};exports[_0xcbae('0x82')]=function(_0x502973,_0x334df5,_0x3b152b){return db[_0xcbae('0x32')][_0xcbae('0x4f')]({'where':{'id':_0x502973['params']['id']}})[_0xcbae('0x27')](handleEntityNotFound(_0x334df5,null))[_0xcbae('0x27')](function(_0x1e7f80){if(_0x1e7f80){return _0x1e7f80[_0xcbae('0x82')](_0x502973[_0xcbae('0x38')][_0xcbae('0x66')])[_0xcbae('0x27')](function(){if(_[_0xcbae('0x83')](_0x502973[_0xcbae('0x38')][_0xcbae('0x66')])){for(var _0x5d33a8=0x0;_0x5d33a8<_0x502973[_0xcbae('0x38')]['ids'][_0xcbae('0x3c')];_0x5d33a8+=0x1){socket['emit'](_0xcbae('0x7e'),{'UserId':Number(_0x502973[_0xcbae('0x38')][_0xcbae('0x66')][_0x5d33a8]),'OpenchannelQueueId':Number(_0x502973['params']['id'])});}}else{socket[_0xcbae('0x6e')](_0xcbae('0x7e'),{'UserId':Number(_0x502973['query']['ids']),'OpenchannelQueueId':Number(_0x502973[_0xcbae('0x4c')]['id'])});}});}})[_0xcbae('0x27')](respondWithStatusCode(_0x334df5,null))[_0xcbae('0x4a')](handleError(_0x334df5,null));};exports[_0xcbae('0x84')]=function(_0x35ac00,_0x3d4fe8,_0x4cf4eb){var _0x7fad96={};var _0x29d922={};var _0x425b03;var _0x4c40d2;return db[_0xcbae('0x32')][_0xcbae('0x63')]({'where':{'id':_0x35ac00[_0xcbae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d4fe8,null))[_0xcbae('0x27')](function(_0x1d03c8){if(_0x1d03c8){_0x425b03=_0x1d03c8;_0x29d922[_0xcbae('0x36')]=_[_0xcbae('0x4d')](db['User']['rawAttributes']);_0x29d922['query']=_[_0xcbae('0x4d')](_0x35ac00[_0xcbae('0x38')]);_0x29d922[_0xcbae('0x40')]=_[_0xcbae('0x39')](_0x29d922[_0xcbae('0x36')],_0x29d922[_0xcbae('0x38')]);_0x7fad96[_0xcbae('0x3a')]=_[_0xcbae('0x39')](_0x29d922['model'],qs['fields'](_0x35ac00['query'][_0xcbae('0x3b')]));_0x7fad96[_0xcbae('0x3a')]=_0x7fad96['attributes'][_0xcbae('0x3c')]?_0x7fad96[_0xcbae('0x3a')]:_0x29d922[_0xcbae('0x36')];_0x7fad96['order']=qs[_0xcbae('0x3f')](_0x35ac00[_0xcbae('0x38')]['sort']);_0x7fad96[_0xcbae('0x43')]=qs[_0xcbae('0x40')](_[_0xcbae('0x41')](_0x35ac00[_0xcbae('0x38')],_0x29d922['filters']));if(_0x35ac00[_0xcbae('0x38')][_0xcbae('0x42')]){_0x7fad96[_0xcbae('0x43')]=_[_0xcbae('0x44')](_0x7fad96[_0xcbae('0x43')],{'$or':_[_0xcbae('0x37')](_0x7fad96[_0xcbae('0x3a')],function(_0x23424c){var _0x2afbce={};_0x2afbce[_0x23424c]={'$like':'%'+_0x35ac00['query'][_0xcbae('0x42')]+'%'};return _0x2afbce;})});}_0x7fad96=_['merge']({},_0x7fad96,_0x35ac00[_0xcbae('0x46')]);return _0x425b03[_0xcbae('0x84')](_0x7fad96);}})[_0xcbae('0x27')](function(_0x226d19){if(_0x226d19){_0x4c40d2=_0x226d19[_0xcbae('0x3c')];if(!_0x35ac00['query'][_0xcbae('0x3d')]('nolimit')){_0x7fad96[_0xcbae('0x22')]=qs[_0xcbae('0x22')](_0x35ac00[_0xcbae('0x38')][_0xcbae('0x22')]);_0x7fad96[_0xcbae('0x1f')]=qs[_0xcbae('0x1f')](_0x35ac00[_0xcbae('0x38')][_0xcbae('0x1f')]);}return _0x425b03[_0xcbae('0x84')](_0x7fad96);}})[_0xcbae('0x27')](function(_0x5effcb){if(_0x5effcb){return _0x5effcb?{'count':_0x4c40d2,'rows':_0x5effcb}:null;}})[_0xcbae('0x27')](respondWithResult(_0x3d4fe8,null))[_0xcbae('0x4a')](handleError(_0x3d4fe8,null));}; \ No newline at end of file +var _0x9578=['value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelQueue','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','order','OpenchannelQueueId','UserOpenchannelQueue','findAndCountAll','agent','openchannelPause','updatedAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x9578,0x12c));var _0x8957=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9578[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8957('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8957('0x1'));var moment=require(_0x8957('0x2'));var BPromise=require(_0x8957('0x3'));var Mustache=require(_0x8957('0x4'));var util=require('util');var path=require(_0x8957('0x5'));var sox=require(_0x8957('0x6'));var csv=require(_0x8957('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8957('0x8'));var _=require(_0x8957('0x9'));var squel=require(_0x8957('0xa'));var crypto=require('crypto');var jsforce=require(_0x8957('0xb'));var deskjs=require(_0x8957('0xc'));var toCsv=require(_0x8957('0x7'));var querystring=require(_0x8957('0xd'));var Papa=require(_0x8957('0xe'));var Redis=require(_0x8957('0xf'));var authService=require(_0x8957('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8957('0x11'));var hardwareService=require(_0x8957('0x12'));var logger=require(_0x8957('0x13'))(_0x8957('0x14'));var utils=require(_0x8957('0x15'));var config=require(_0x8957('0x16'));var licenseUtil=require(_0x8957('0x17'));var db=require(_0x8957('0x18'))['db'];config['redis']=_['defaults'](config[_0x8957('0x19')],{'host':_0x8957('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8957('0x19')]));require(_0x8957('0x1b'))[_0x8957('0x1c')](socket);function respondWithStatusCode(_0x3c500c,_0x125078){_0x125078=_0x125078||0xcc;return function(_0x35a8da){if(_0x35a8da){return _0x3c500c[_0x8957('0x1d')](_0x125078);}return _0x3c500c[_0x8957('0x1e')](_0x125078)[_0x8957('0x1f')]();};}function respondWithResult(_0x97702c,_0x3454b3){_0x3454b3=_0x3454b3||0xc8;return function(_0x5f5879){if(_0x5f5879){return _0x97702c['status'](_0x3454b3)[_0x8957('0x20')](_0x5f5879);}};}function respondWithFilteredResult(_0x114d71,_0x3403f5){return function(_0x5920d4){if(_0x5920d4){var _0x35f0c8=typeof _0x3403f5[_0x8957('0x21')]===_0x8957('0x22')&&typeof _0x3403f5[_0x8957('0x23')]===_0x8957('0x22');var _0xea449b=_0x5920d4[_0x8957('0x24')];var _0x111712=_0x35f0c8?0x0:_0x3403f5[_0x8957('0x21')];var _0x584512=_0x35f0c8?_0x5920d4[_0x8957('0x24')]:_0x3403f5[_0x8957('0x21')]+_0x3403f5[_0x8957('0x23')];var _0x6f260d;if(_0x584512>=_0xea449b){_0x584512=_0xea449b;_0x6f260d=0xc8;}else{_0x6f260d=0xce;}_0x114d71[_0x8957('0x1e')](_0x6f260d);return _0x114d71[_0x8957('0x25')]('Content-Range',_0x111712+'-'+_0x584512+'/'+_0xea449b)['json'](_0x5920d4);}return null;};}function patchUpdates(_0x8e7105){return function(_0x448e93){try{jsonpatch[_0x8957('0x26')](_0x448e93,_0x8e7105,!![]);}catch(_0x74a5f6){return BPromise[_0x8957('0x27')](_0x74a5f6);}return _0x448e93[_0x8957('0x28')]();};}function saveUpdates(_0x3d57ae,_0x1be0d5){return function(_0x5acea0){if(_0x5acea0){return _0x5acea0[_0x8957('0x29')](_0x3d57ae)[_0x8957('0x2a')](function(_0x2288d8){return _0x2288d8;});}return null;};}function removeEntity(_0x1179f0,_0x3e0b3b){return function(_0x265706){if(_0x265706){return _0x265706['destroy']()[_0x8957('0x2a')](function(){var _0x2a7b55=_0x265706[_0x8957('0x2b')]({'plain':!![]});var _0x3d760a=_0x8957('0x2c');return db[_0x8957('0x2d')][_0x8957('0x2e')]({'where':{'type':_0x3d760a,'resourceId':_0x2a7b55['id']}})['then'](function(){return _0x265706;});})[_0x8957('0x2a')](function(){_0x1179f0['status'](0xcc)[_0x8957('0x1f')]();});}};}function handleEntityNotFound(_0x49e31c,_0x7b1ad2){return function(_0x3af079){if(!_0x3af079){_0x49e31c['sendStatus'](0x194);}return _0x3af079;};}function handleError(_0x31a7f7,_0x2d1c76){_0x2d1c76=_0x2d1c76||0x1f4;return function(_0x1c4dec){logger[_0x8957('0x2f')](_0x1c4dec[_0x8957('0x30')]);if(_0x1c4dec[_0x8957('0x31')]){delete _0x1c4dec['name'];}_0x31a7f7['status'](_0x2d1c76)[_0x8957('0x32')](_0x1c4dec);};}exports['index']=function(_0x335728,_0xc1ada9){var _0x55df47={},_0x59cdb6={},_0x14e138={'count':0x0,'rows':[]};var _0x38f640=_[_0x8957('0x33')](db['OpenchannelQueue']['rawAttributes'],function(_0x4eb524){return{'name':_0x4eb524[_0x8957('0x34')],'type':_0x4eb524[_0x8957('0x35')]['key']};});_0x59cdb6[_0x8957('0x36')]=_[_0x8957('0x33')](_0x38f640,_0x8957('0x31'));_0x59cdb6[_0x8957('0x37')]=_[_0x8957('0x38')](_0x335728[_0x8957('0x37')]);_0x59cdb6[_0x8957('0x39')]=_[_0x8957('0x3a')](_0x59cdb6['model'],_0x59cdb6['query']);_0x55df47[_0x8957('0x3b')]=_['intersection'](_0x59cdb6[_0x8957('0x36')],qs['fields'](_0x335728['query'][_0x8957('0x3c')]));_0x55df47[_0x8957('0x3b')]=_0x55df47[_0x8957('0x3b')][_0x8957('0x3d')]?_0x55df47['attributes']:_0x59cdb6['model'];if(!_0x335728[_0x8957('0x37')][_0x8957('0x3e')](_0x8957('0x3f'))){_0x55df47[_0x8957('0x23')]=qs[_0x8957('0x23')](_0x335728[_0x8957('0x37')][_0x8957('0x23')]);_0x55df47[_0x8957('0x21')]=qs[_0x8957('0x21')](_0x335728[_0x8957('0x37')][_0x8957('0x21')]);}_0x55df47['order']=qs[_0x8957('0x40')](_0x335728['query']['sort']);_0x55df47[_0x8957('0x41')]=qs['filters'](_[_0x8957('0x42')](_0x335728[_0x8957('0x37')],_0x59cdb6['filters']),_0x38f640);if(_0x335728['query'][_0x8957('0x43')]){_0x55df47[_0x8957('0x41')]=_['merge'](_0x55df47[_0x8957('0x41')],{'$or':_[_0x8957('0x33')](_0x38f640,function(_0x38d951){if(_0x38d951[_0x8957('0x35')]!==_0x8957('0x44')){var _0x247348={};_0x247348[_0x38d951['name']]={'$like':'%'+_0x335728[_0x8957('0x37')][_0x8957('0x43')]+'%'};return _0x247348;}})});}_0x55df47=_[_0x8957('0x45')]({},_0x55df47,_0x335728[_0x8957('0x46')]);var _0x390573={'where':_0x55df47[_0x8957('0x41')]};return db[_0x8957('0x47')]['count'](_0x390573)[_0x8957('0x2a')](function(_0x227e82){_0x14e138['count']=_0x227e82;if(_0x335728[_0x8957('0x37')][_0x8957('0x48')]){_0x55df47['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0x8957('0x49')](_0x55df47);})['then'](function(_0x3f250f){_0x14e138[_0x8957('0x4a')]=_0x3f250f;return _0x14e138;})['then'](respondWithFilteredResult(_0xc1ada9,_0x55df47))[_0x8957('0x4b')](handleError(_0xc1ada9,null));};exports[_0x8957('0x4c')]=function(_0x4d9125,_0x2eec10){var _0x516738={'raw':!![],'where':{'id':_0x4d9125[_0x8957('0x4d')]['id']}},_0xfb2ae6={};_0xfb2ae6[_0x8957('0x36')]=_[_0x8957('0x38')](db['OpenchannelQueue'][_0x8957('0x4e')]);_0xfb2ae6[_0x8957('0x37')]=_[_0x8957('0x38')](_0x4d9125[_0x8957('0x37')]);_0xfb2ae6[_0x8957('0x39')]=_[_0x8957('0x3a')](_0xfb2ae6['model'],_0xfb2ae6[_0x8957('0x37')]);_0x516738[_0x8957('0x3b')]=_[_0x8957('0x3a')](_0xfb2ae6[_0x8957('0x36')],qs[_0x8957('0x3c')](_0x4d9125[_0x8957('0x37')][_0x8957('0x3c')]));_0x516738[_0x8957('0x3b')]=_0x516738[_0x8957('0x3b')][_0x8957('0x3d')]?_0x516738[_0x8957('0x3b')]:_0xfb2ae6[_0x8957('0x36')];if(_0x4d9125[_0x8957('0x37')][_0x8957('0x48')]){_0x516738[_0x8957('0x4f')]=[{'all':!![]}];}_0x516738=_[_0x8957('0x45')]({},_0x516738,_0x4d9125['options']);return db[_0x8957('0x47')][_0x8957('0x50')](_0x516738)['then'](handleEntityNotFound(_0x2eec10,null))['then'](respondWithResult(_0x2eec10,null))[_0x8957('0x4b')](handleError(_0x2eec10,null));};exports[_0x8957('0x51')]=function(_0x1c7ea1,_0x42f201){return db[_0x8957('0x47')][_0x8957('0x51')](_0x1c7ea1[_0x8957('0x52')],{})['then'](function(_0xd7b366){var _0x4d29fd=_0x1c7ea1[_0x8957('0x53')][_0x8957('0x2b')]({'plain':!![]});if(!_0x4d29fd)throw new Error(_0x8957('0x54'));if(_0x4d29fd[_0x8957('0x55')]==='user'){var _0x361eaa=_0xd7b366[_0x8957('0x2b')]({'plain':!![]});var _0x1e7f0d=_0x8957('0x2c');return db[_0x8957('0x56')][_0x8957('0x50')]({'where':{'name':_0x1e7f0d,'userProfileId':_0x4d29fd[_0x8957('0x57')]},'raw':!![]})['then'](function(_0x2c4560){if(_0x2c4560&&_0x2c4560[_0x8957('0x58')]===0x0){return db[_0x8957('0x2d')]['create']({'name':_0x361eaa[_0x8957('0x31')],'resourceId':_0x361eaa['id'],'type':_0x2c4560[_0x8957('0x31')],'sectionId':_0x2c4560['id']},{})[_0x8957('0x2a')](function(){return _0xd7b366;});}else{return _0xd7b366;}})[_0x8957('0x4b')](function(_0x5a16ee){logger[_0x8957('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a16ee);throw _0x5a16ee;});}return _0xd7b366;})['then'](respondWithResult(_0x42f201,0xc9))[_0x8957('0x4b')](handleError(_0x42f201,null));};exports[_0x8957('0x29')]=function(_0x3db8e7,_0x2d7896){if(_0x3db8e7['body']['id']){delete _0x3db8e7['body']['id'];}return db['OpenchannelQueue'][_0x8957('0x50')]({'where':{'id':_0x3db8e7['params']['id']}})[_0x8957('0x2a')](handleEntityNotFound(_0x2d7896,null))[_0x8957('0x2a')](saveUpdates(_0x3db8e7[_0x8957('0x52')],null))[_0x8957('0x2a')](respondWithResult(_0x2d7896,null))['catch'](handleError(_0x2d7896,null));};exports[_0x8957('0x2e')]=function(_0x488947,_0x3ad0bd){return db[_0x8957('0x47')][_0x8957('0x50')]({'where':{'id':_0x488947[_0x8957('0x4d')]['id']}})[_0x8957('0x2a')](handleEntityNotFound(_0x3ad0bd,null))[_0x8957('0x2a')](removeEntity(_0x3ad0bd,null))[_0x8957('0x4b')](handleError(_0x3ad0bd,null));};exports['describe']=function(_0x514d85,_0x5d2255){return db[_0x8957('0x47')][_0x8957('0x59')]()[_0x8957('0x2a')](respondWithResult(_0x5d2255,null))[_0x8957('0x4b')](handleError(_0x5d2255,null));};exports['getMembers']=function(_0x5b24bf,_0x3439e9,_0x397156){var _0x11a39c={'raw':!![],'where':{}},_0xce6078={},_0x7b9b63;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x5b24bf[_0x8957('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3439e9,null))['then'](function(_0x5170e1){if(_0x5170e1){_0x7b9b63=_0x5170e1[_0x8957('0x2b')]({'plain':!![]});_0xce6078[_0x8957('0x36')]=_['keys'](db['UserOpenchannelQueue'][_0x8957('0x4e')]);_0xce6078[_0x8957('0x37')]=_[_0x8957('0x38')](_0x5b24bf[_0x8957('0x37')]);_0xce6078['filters']=_['intersection'](_0xce6078['model'],_0xce6078['query']);_0x11a39c[_0x8957('0x3b')]=_[_0x8957('0x3a')](_0xce6078[_0x8957('0x36')],qs['fields'](_0x5b24bf[_0x8957('0x37')][_0x8957('0x3c')]));_0x11a39c[_0x8957('0x3b')]=_0x11a39c['attributes']['length']?_0x11a39c[_0x8957('0x3b')]:_0xce6078[_0x8957('0x36')];if(!_0x5b24bf[_0x8957('0x37')][_0x8957('0x3e')]('nolimit')){_0x11a39c[_0x8957('0x23')]=qs[_0x8957('0x23')](_0x5b24bf[_0x8957('0x37')]['limit']);_0x11a39c[_0x8957('0x21')]=qs['offset'](_0x5b24bf[_0x8957('0x37')]['offset']);}_0x11a39c[_0x8957('0x5a')]=qs[_0x8957('0x40')](_0x5b24bf['query'][_0x8957('0x40')]);_0x11a39c['where']=qs[_0x8957('0x39')](_[_0x8957('0x42')](_0x5b24bf[_0x8957('0x37')],_0xce6078[_0x8957('0x39')]));_0x11a39c[_0x8957('0x41')][_0x8957('0x5b')]=_0x5170e1['id'];if(_0x5b24bf['query'][_0x8957('0x43')]){_0x11a39c[_0x8957('0x41')]=_[_0x8957('0x45')](_0x11a39c[_0x8957('0x41')],{'$or':_['map'](_0x11a39c['attributes'],function(_0x4aabac){var _0x17c09c={};_0x17c09c[_0x4aabac]={'$like':'%'+_0x5b24bf[_0x8957('0x37')]['filter']+'%'};return _0x17c09c;})});}_0x11a39c=_[_0x8957('0x45')]({},_0x11a39c,_0x5b24bf[_0x8957('0x46')]);return db[_0x8957('0x5c')][_0x8957('0x49')](_0x11a39c);}})['then'](function(_0x534368){if(_0x534368){return db['User'][_0x8957('0x5d')]({'where':{'id':_['map'](_0x534368,'UserId'),'role':_0x8957('0x5e')},'attributes':['id',_0x8957('0x31'),_0x8957('0x5f'),_0x8957('0x60'),'createdAt']});}})[_0x8957('0x2a')](function(_0xab832){if(_0xab832){return{'count':_0xab832[_0x8957('0x24')],'rows':_[_0x8957('0x33')](_0xab832[_0x8957('0x4a')],function(_0x1c5c41){return{'membername':_0x1c5c41['name'],'UserId':_0x1c5c41['id'],'queue_name':_0x7b9b63['name'],'OpenchannelQueueId':_0x7b9b63['id'],'interface':util[_0x8957('0x61')](_0x8957('0x62'),_0x8957('0x63'),_0x1c5c41['name']),'penalty':0x0,'paused':_0x1c5c41[_0x8957('0x5f')],'createdAt':_0x1c5c41['createdAt'],'updatedAt':_0x1c5c41['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3439e9,_0x11a39c))[_0x8957('0x4b')](handleError(_0x3439e9,null));};exports[_0x8957('0x64')]=function(_0x1b0723,_0x2308c9,_0x2f42cd){var _0x3d1682={};var _0x218b07={};var _0x39015d;var _0x5427ee;return db[_0x8957('0x47')][_0x8957('0x65')]({'where':{'id':_0x1b0723[_0x8957('0x4d')]['id']}})[_0x8957('0x2a')](handleEntityNotFound(_0x2308c9,null))[_0x8957('0x2a')](function(_0x267143){if(_0x267143){_0x39015d=_0x267143;_0x218b07[_0x8957('0x36')]=_[_0x8957('0x38')](db[_0x8957('0x66')][_0x8957('0x4e')]);_0x218b07['query']=_[_0x8957('0x38')](_0x1b0723['query']);_0x218b07['filters']=_['intersection'](_0x218b07[_0x8957('0x36')],_0x218b07[_0x8957('0x37')]);_0x3d1682[_0x8957('0x3b')]=_[_0x8957('0x3a')](_0x218b07['model'],qs[_0x8957('0x3c')](_0x1b0723['query']['fields']));_0x3d1682['attributes']=_0x3d1682['attributes'][_0x8957('0x3d')]?_0x3d1682['attributes']:_0x218b07[_0x8957('0x36')];_0x3d1682['order']=qs[_0x8957('0x40')](_0x1b0723['query'][_0x8957('0x40')]);_0x3d1682['where']=qs['filters'](_['pick'](_0x1b0723[_0x8957('0x37')],_0x218b07[_0x8957('0x39')]));if(_0x1b0723['query'][_0x8957('0x43')]){_0x3d1682[_0x8957('0x41')]=_[_0x8957('0x45')](_0x3d1682[_0x8957('0x41')],{'$or':_[_0x8957('0x33')](_0x3d1682[_0x8957('0x3b')],function(_0x2c2840){var _0x22eff5={};_0x22eff5[_0x2c2840]={'$like':'%'+_0x1b0723[_0x8957('0x37')][_0x8957('0x43')]+'%'};return _0x22eff5;})});}_0x3d1682=_[_0x8957('0x45')]({},_0x3d1682,_0x1b0723[_0x8957('0x46')]);return _0x39015d[_0x8957('0x64')](_0x3d1682);}})[_0x8957('0x2a')](function(_0x52dd56){if(_0x52dd56){_0x5427ee=_0x52dd56['length'];if(!_0x1b0723[_0x8957('0x37')]['hasOwnProperty']('nolimit')){_0x3d1682['limit']=qs['limit'](_0x1b0723[_0x8957('0x37')][_0x8957('0x23')]);_0x3d1682[_0x8957('0x21')]=qs[_0x8957('0x21')](_0x1b0723[_0x8957('0x37')]['offset']);}return _0x39015d['getTeams'](_0x3d1682);}})[_0x8957('0x2a')](function(_0x3f10fc){if(_0x3f10fc){return _0x3f10fc?{'count':_0x5427ee,'rows':_0x3f10fc}:null;}})['then'](respondWithResult(_0x2308c9,null))[_0x8957('0x4b')](handleError(_0x2308c9,null));};exports[_0x8957('0x67')]=function(_0x43a8d8,_0x59a84a,_0x59a4f0){var _0x38e67d=_0x43a8d8[_0x8957('0x52')][_0x8957('0x68')];return db[_0x8957('0x66')][_0x8957('0x49')]({'where':{'id':_0x38e67d},'attributes':['id'],'include':[{'model':db[_0x8957('0x69')],'as':_0x8957('0x6a'),'attributes':['id',_0x8957('0x31'),_0x8957('0x6b'),_0x8957('0x6c'),_0x8957('0x6d')],'raw':!![]}]})[_0x8957('0x2a')](function(_0x409fad){if(_0x409fad){var _0x45fbce=_[_0x8957('0x6e')](_0x409fad,function(_0x32d710){var _0x3d7978=_0x32d710['get']({'plain':!![]});return _0x3d7978[_0x8957('0x6a')];});return db['OpenchannelQueue'][_0x8957('0x50')]({'where':{'id':_0x43a8d8[_0x8957('0x4d')]['id']}})['then'](function(_0x49c4d5){return db['sequelize'][_0x8957('0x6f')](function(_0x4eb7f6){return _0x49c4d5[_0x8957('0x67')](_0x38e67d,{'transaction':_0x4eb7f6})[_0x8957('0x2a')](function(){return BPromise['each'](_0x45fbce,function(_0x455537){return db[_0x8957('0x5c')][_0x8957('0x70')]({'where':{'UserId':_0x455537['id'],'OpenchannelQueueId':_0x43a8d8[_0x8957('0x4d')]['id']},'transaction':_0x4eb7f6});});})[_0x8957('0x2a')](function(){_0x45fbce['forEach'](function(_0x1fa1aa){socket[_0x8957('0x71')](_0x8957('0x72'),{'UserId':_0x1fa1aa['id'],'OpenchannelQueueId':_0x49c4d5['id']});});});});});}})['then'](respondWithStatusCode(_0x59a84a,null))[_0x8957('0x4b')](handleError(_0x59a84a,null));};exports[_0x8957('0x73')]=function(_0x214c16,_0x5a2de6,_0x2cb927){return db[_0x8957('0x66')]['findAll']({'where':{'id':_0x214c16[_0x8957('0x37')][_0x8957('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8957('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x8957('0x2a')](handleEntityNotFound(_0x5a2de6,null))[_0x8957('0x2a')](function(_0x9c9a82){var _0x363a90=_['map'](_0x9c9a82,'id');var _0x501d56=[];var _0x3cf452=[];var _0x49ad5a=squel[_0x8957('0x74')]();_0x49ad5a['field'](_0x8957('0x75'))[_0x8957('0x76')](_0x8957('0x77'),'tq')['join'](_0x8957('0x78'),'ut',_0x8957('0x79'))[_0x8957('0x41')](_0x8957('0x7a'),_0x214c16[_0x8957('0x4d')]['id']);for(var _0x4a37b4=0x0;_0x4a37b4<_0x9c9a82[_0x8957('0x3d')];_0x4a37b4+=0x1){let _0xefa103=_0x9c9a82[_0x4a37b4];for(var _0x23f39e=0x0;_0x23f39e<_0xefa103['Agents']['length'];_0x23f39e+=0x1){let _0x2f749e=_0xefa103[_0x8957('0x6a')][_0x23f39e];var _0x2f73f7=_0x49ad5a[_0x8957('0x7b')]();_0x2f73f7[_0x8957('0x41')](_0x8957('0x7c'),_0x2f749e['id']);_0x3cf452[_0x8957('0x7d')](db[_0x8957('0x7e')]['query'](_0x2f73f7[_0x8957('0x7f')](),{'type':db[_0x8957('0x7e')]['QueryTypes'][_0x8957('0x80')]})[_0x8957('0x2a')](function(_0xddfb7f){if(_0xddfb7f[_0x8957('0x3d')]===0x1){return _0x2f749e['id'];}else{var _0xcd003=_[_0x8957('0x81')](_[_0x8957('0x33')](_0xddfb7f,_0x8957('0x82')),function(_0x258e18){return _[_0x8957('0x83')](_0x363a90,_0x258e18);});if(_0xcd003){return _0x2f749e['id'];}}}));}}return BPromise[_0x8957('0x84')](_0x3cf452)['then'](function(_0x4ef005){_0x501d56=_(_0x501d56)[_0x8957('0x85')](_0x4ef005)[_0x8957('0x86')]()[_0x8957('0x87')]();return db[_0x8957('0x47')][_0x8957('0x50')]({'where':{'id':_0x214c16['params']['id']}})[_0x8957('0x2a')](function(_0x18e8f3){return db[_0x8957('0x7e')]['transaction'](function(_0x595432){return _0x18e8f3['removeTeams'](_0x214c16[_0x8957('0x37')][_0x8957('0x68')],{'transaction':_0x595432})[_0x8957('0x2a')](function(){if(!_[_0x8957('0x88')](_0x501d56)){return _0x18e8f3[_0x8957('0x89')](_0x501d56,{'transaction':_0x595432});}})[_0x8957('0x2a')](function(){_0x501d56[_0x8957('0x8a')](function(_0x4270f5){socket[_0x8957('0x71')](_0x8957('0x8b'),{'UserId':_0x4270f5,'OpenchannelQueueId':_0x18e8f3['id']});});});});});});})[_0x8957('0x2a')](respondWithStatusCode(_0x5a2de6,null))[_0x8957('0x4b')](handleError(_0x5a2de6,null));};exports['addAgents']=function(_0x24e9ad,_0x5cdb40,_0x4259af){return db[_0x8957('0x47')]['find']({'where':{'id':_0x24e9ad[_0x8957('0x4d')]['id']}})[_0x8957('0x2a')](handleEntityNotFound(_0x5cdb40,null))[_0x8957('0x2a')](function(_0xfe19d0){if(_0xfe19d0){return _0xfe19d0[_0x8957('0x8c')](_0x24e9ad['body'][_0x8957('0x68')],_[_0x8957('0x8d')](_0x24e9ad[_0x8957('0x52')],[_0x8957('0x68'),'id'])||{})[_0x8957('0x8e')](function(_0x2056dc){for(var _0x2c7dbc=0x0;_0x2c7dbc<_0x24e9ad['body'][_0x8957('0x68')][_0x8957('0x3d')];_0x2c7dbc+=0x1){socket['emit'](_0x8957('0x72'),{'UserId':Number(_0x24e9ad[_0x8957('0x52')][_0x8957('0x68')][_0x2c7dbc]),'OpenchannelQueueId':Number(_0x24e9ad[_0x8957('0x4d')]['id'])});}return _0x2056dc;});}})[_0x8957('0x2a')](respondWithResult(_0x5cdb40,null))[_0x8957('0x4b')](handleError(_0x5cdb40,null));};exports['removeAgents']=function(_0x2c816f,_0x2fe51e,_0x303649){return db[_0x8957('0x47')][_0x8957('0x50')]({'where':{'id':_0x2c816f[_0x8957('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2fe51e,null))[_0x8957('0x2a')](function(_0x4bb56f){if(_0x4bb56f){return _0x4bb56f[_0x8957('0x89')](_0x2c816f[_0x8957('0x37')][_0x8957('0x68')])[_0x8957('0x2a')](function(){if(_[_0x8957('0x8f')](_0x2c816f[_0x8957('0x37')][_0x8957('0x68')])){for(var _0x5ae3e6=0x0;_0x5ae3e6<_0x2c816f[_0x8957('0x37')][_0x8957('0x68')][_0x8957('0x3d')];_0x5ae3e6+=0x1){socket['emit'](_0x8957('0x8b'),{'UserId':Number(_0x2c816f[_0x8957('0x37')][_0x8957('0x68')][_0x5ae3e6]),'OpenchannelQueueId':Number(_0x2c816f['params']['id'])});}}else{socket[_0x8957('0x71')](_0x8957('0x8b'),{'UserId':Number(_0x2c816f[_0x8957('0x37')][_0x8957('0x68')]),'OpenchannelQueueId':Number(_0x2c816f[_0x8957('0x4d')]['id'])});}});}})[_0x8957('0x2a')](respondWithStatusCode(_0x2fe51e,null))[_0x8957('0x4b')](handleError(_0x2fe51e,null));};exports[_0x8957('0x90')]=function(_0x53db67,_0x4ea91f,_0x522aec){var _0x25387d={};var _0x1cc9dc={};var _0x889445;var _0x211228;return db['OpenchannelQueue'][_0x8957('0x65')]({'where':{'id':_0x53db67[_0x8957('0x4d')]['id']}})[_0x8957('0x2a')](handleEntityNotFound(_0x4ea91f,null))['then'](function(_0x3c16c6){if(_0x3c16c6){_0x889445=_0x3c16c6;_0x1cc9dc[_0x8957('0x36')]=_[_0x8957('0x38')](db[_0x8957('0x69')][_0x8957('0x4e')]);_0x1cc9dc[_0x8957('0x37')]=_[_0x8957('0x38')](_0x53db67[_0x8957('0x37')]);_0x1cc9dc['filters']=_[_0x8957('0x3a')](_0x1cc9dc[_0x8957('0x36')],_0x1cc9dc['query']);_0x25387d[_0x8957('0x3b')]=_[_0x8957('0x3a')](_0x1cc9dc['model'],qs[_0x8957('0x3c')](_0x53db67[_0x8957('0x37')]['fields']));_0x25387d[_0x8957('0x3b')]=_0x25387d['attributes'][_0x8957('0x3d')]?_0x25387d[_0x8957('0x3b')]:_0x1cc9dc[_0x8957('0x36')];_0x25387d['order']=qs[_0x8957('0x40')](_0x53db67[_0x8957('0x37')][_0x8957('0x40')]);_0x25387d[_0x8957('0x41')]=qs['filters'](_['pick'](_0x53db67[_0x8957('0x37')],_0x1cc9dc[_0x8957('0x39')]));if(_0x53db67[_0x8957('0x37')][_0x8957('0x43')]){_0x25387d[_0x8957('0x41')]=_['merge'](_0x25387d['where'],{'$or':_[_0x8957('0x33')](_0x25387d[_0x8957('0x3b')],function(_0x316a76){var _0x775c24={};_0x775c24[_0x316a76]={'$like':'%'+_0x53db67['query'][_0x8957('0x43')]+'%'};return _0x775c24;})});}_0x25387d=_[_0x8957('0x45')]({},_0x25387d,_0x53db67['options']);return _0x889445[_0x8957('0x90')](_0x25387d);}})[_0x8957('0x2a')](function(_0x40b151){if(_0x40b151){_0x211228=_0x40b151[_0x8957('0x3d')];if(!_0x53db67['query'][_0x8957('0x3e')](_0x8957('0x3f'))){_0x25387d[_0x8957('0x23')]=qs[_0x8957('0x23')](_0x53db67['query'][_0x8957('0x23')]);_0x25387d[_0x8957('0x21')]=qs[_0x8957('0x21')](_0x53db67[_0x8957('0x37')]['offset']);}return _0x889445[_0x8957('0x90')](_0x25387d);}})[_0x8957('0x2a')](function(_0x38c626){if(_0x38c626){return _0x38c626?{'count':_0x211228,'rows':_0x38c626}:null;}})['then'](respondWithResult(_0x4ea91f,null))[_0x8957('0x4b')](handleError(_0x4ea91f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 84b4305..1f5a145 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 _0xeb99=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove'];(function(_0x39cf36,_0x1b4af1){var _0x42c624=function(_0x1f5955){while(--_0x1f5955){_0x39cf36['push'](_0x39cf36['shift']());}};_0x42c624(++_0x1b4af1);}(_0xeb99,0x1e3));var _0x9eb9=function(_0x363876,_0x1359e2){_0x363876=_0x363876-0x0;var _0x3cb88e=_0xeb99[_0x363876];return _0x3cb88e;};'use strict';var EventEmitter=require(_0x9eb9('0x0'));var OpenchannelQueue=require(_0x9eb9('0x1'))['db'][_0x9eb9('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9eb9('0x3')](0x0);var events={'afterCreate':_0x9eb9('0x4'),'afterUpdate':_0x9eb9('0x5'),'afterDestroy':_0x9eb9('0x6')};function emitEvent(_0x526c04){return function(_0xbb6cea,_0x189cac,_0x4056ed){OpenchannelQueueEvents['emit'](_0x526c04+':'+_0xbb6cea['id'],_0xbb6cea);OpenchannelQueueEvents['emit'](_0x526c04,_0xbb6cea);_0x4056ed(null);};}for(var e in events){if(events[_0x9eb9('0x7')](e)){var event=events[e];OpenchannelQueue[_0x9eb9('0x8')](e,emitEvent(event));}}module[_0x9eb9('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x26c0=['emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x508d1,_0xc0c0e5){var _0x322d8d=function(_0x51b75f){while(--_0x51b75f){_0x508d1['push'](_0x508d1['shift']());}};_0x322d8d(++_0xc0c0e5);}(_0x26c0,0xaf));var _0x026c=function(_0x18bd08,_0x4a39ae){_0x18bd08=_0x18bd08-0x0;var _0x3b3c3c=_0x26c0[_0x18bd08];return _0x3b3c3c;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x026c('0x0'))['db'][_0x026c('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x026c('0x2')](0x0);var events={'afterCreate':_0x026c('0x3'),'afterUpdate':_0x026c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7b65d6){return function(_0x24d318,_0x228c97,_0x12f406){OpenchannelQueueEvents[_0x026c('0x5')](_0x7b65d6+':'+_0x24d318['id'],_0x24d318);OpenchannelQueueEvents[_0x026c('0x5')](_0x7b65d6,_0x24d318);_0x12f406(null);};}for(var e in events){if(events[_0x026c('0x6')](e)){var event=events[e];OpenchannelQueue[_0x026c('0x7')](e,emitEvent(event));}}module[_0x026c('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index eb7a71e..696135b 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 _0x5190=['openchannel_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','OpenchannelQueue'];(function(_0x28db22,_0x1687b5){var _0xb0d9ba=function(_0x5ca46e){while(--_0x5ca46e){_0x28db22['push'](_0x28db22['shift']());}};_0xb0d9ba(++_0x1687b5);}(_0x5190,0x1e1));var _0x0519=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x5190[_0x1cd47d];return _0x29d52f;};'use strict';var _=require('lodash');var util=require(_0x0519('0x0'));var logger=require(_0x0519('0x1'))('api');var moment=require(_0x0519('0x2'));var BPromise=require(_0x0519('0x3'));var rp=require(_0x0519('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0519('0x5'));var config=require(_0x0519('0x6'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x2be470,_0x1e6cc1){return _0x2be470[_0x0519('0x7')](_0x0519('0x8'),attributes,{'tableName':_0x0519('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x151e=['./openchannelQueue.attributes','exports','define','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x4e4b0b,_0x968ecd){var _0x517dce=function(_0x25b8e6){while(--_0x25b8e6){_0x4e4b0b['push'](_0x4e4b0b['shift']());}};_0x517dce(++_0x968ecd);}(_0x151e,0x1c5));var _0xe151=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x151e[_0x2e1907];return _0x401555;};'use strict';var _=require('lodash');var util=require(_0xe151('0x0'));var logger=require(_0xe151('0x1'))(_0xe151('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe151('0x3'));var fs=require('fs');var path=require(_0xe151('0x4'));var rimraf=require(_0xe151('0x5'));var config=require(_0xe151('0x6'));var attributes=require(_0xe151('0x7'));module[_0xe151('0x8')]=function(_0xaab6b1,_0x539a64){return _0xaab6b1[_0xe151('0x9')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','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 045d4b4..fe8bbf4 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 _0x832a=['redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','map','include','model','attributes','then','catch','find','raw','where','ShowOpenchannelQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x346803,_0x1b58dc){var _0x13d91d=function(_0x5573f5){while(--_0x5573f5){_0x346803['push'](_0x346803['shift']());}};_0x13d91d(++_0x1b58dc);}(_0x832a,0x10d));var _0xa832=function(_0x5c2871,_0x9f21e6){_0x5c2871=_0x5c2871-0x0;var _0x4d962d=_0x832a[_0x5c2871];return _0x4d962d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa832('0x0'));var BPromise=require(_0xa832('0x1'));var rs=require(_0xa832('0x2'));var fs=require('fs');var Redis=require(_0xa832('0x3'));var db=require(_0xa832('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa832('0x5'))(_0xa832('0x6'));var config=require(_0xa832('0x7'));var jayson=require(_0xa832('0x8'));var client=jayson[_0xa832('0x9')][_0xa832('0xa')]({'port':0x232a});config[_0xa832('0xb')]=_[_0xa832('0xc')](config['redis'],{'host':_0xa832('0xd'),'port':0x18eb});var socket=require(_0xa832('0xe'))(new Redis(config[_0xa832('0xb')]));require(_0xa832('0xf'))[_0xa832('0x10')](socket);function respondWithRpcPromise(_0x425712,_0xaf3697,_0x522734){return new BPromise(function(_0x3e8d8a,_0xcd2b94){return client[_0xa832('0x11')](_0x425712,_0x522734)['then'](function(_0x212206){logger[_0xa832('0x12')](_0xa832('0x13'),_0xaf3697,_0xa832('0x14'));logger[_0xa832('0x15')](_0xa832('0x16'),_0xaf3697,_0xa832('0x14'),JSON[_0xa832('0x17')](_0x212206));if(_0x212206[_0xa832('0x18')]){if(_0x212206[_0xa832('0x18')]['code']===0x1f4){logger[_0xa832('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0xaf3697,_0x212206[_0xa832('0x18')]['message']);return _0xcd2b94(_0x212206[_0xa832('0x18')][_0xa832('0x19')]);}logger[_0xa832('0x18')](_0xa832('0x13'),_0xaf3697,_0x212206[_0xa832('0x18')][_0xa832('0x19')]);return _0x3e8d8a(_0x212206[_0xa832('0x18')]['message']);}else{logger[_0xa832('0x12')](_0xa832('0x13'),_0xaf3697,_0xa832('0x14'));_0x3e8d8a(_0x212206['result'][_0xa832('0x19')]);}})['catch'](function(_0x254d8c){logger[_0xa832('0x18')](_0xa832('0x13'),_0xaf3697,_0x254d8c);_0xcd2b94(_0x254d8c);});});}exports[_0xa832('0x1a')]=function(_0x34017c){var _0xf2e2a3=this;return new Promise(function(_0x246b53,_0x479b82){return db[_0xa832('0x1b')][_0xa832('0x1c')]({'raw':_0x34017c[_0xa832('0x1d')]?_0x34017c[_0xa832('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x34017c[_0xa832('0x1d')]?_0x34017c['options']['where']||null:null,'attributes':_0x34017c[_0xa832('0x1d')]?_0x34017c[_0xa832('0x1d')]['attributes']||null:null,'limit':_0x34017c[_0xa832('0x1d')]?_0x34017c[_0xa832('0x1d')]['limit']||null:null,'include':_0x34017c[_0xa832('0x1d')]?_0x34017c[_0xa832('0x1d')]['include']?_[_0xa832('0x1e')](_0x34017c[_0xa832('0x1d')][_0xa832('0x1f')],function(_0x2918cb){return{'model':db[_0x2918cb[_0xa832('0x20')]],'as':_0x2918cb['as'],'attributes':_0x2918cb[_0xa832('0x21')],'include':_0x2918cb[_0xa832('0x1f')]?_[_0xa832('0x1e')](_0x2918cb['include'],function(_0x558dc6){return{'model':db[_0x558dc6['model']],'as':_0x558dc6['as'],'attributes':_0x558dc6['attributes'],'include':_0x558dc6[_0xa832('0x1f')]?_[_0xa832('0x1e')](_0x558dc6[_0xa832('0x1f')],function(_0x5a7ac6){return{'model':db[_0x5a7ac6[_0xa832('0x20')]],'as':_0x5a7ac6['as'],'attributes':_0x5a7ac6['attributes']};}):[]};}):[]};}):[]:[]})[_0xa832('0x22')](function(_0x265fd5){logger['info'](_0xa832('0x1a'),_0x34017c);logger[_0xa832('0x15')]('GetOpenchannelQueue',_0x34017c,JSON[_0xa832('0x17')](_0x265fd5));_0x246b53(_0x265fd5);})[_0xa832('0x23')](function(_0x45aa81){logger[_0xa832('0x18')](_0xa832('0x1a'),_0x45aa81[_0xa832('0x19')],_0x34017c);_0x479b82(_0xf2e2a3['error'](0x1f4,_0x45aa81[_0xa832('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x467396){var _0x8862bd=this;return new Promise(function(_0x43237b,_0xb5808e){return db[_0xa832('0x1b')][_0xa832('0x24')]({'raw':_0x467396[_0xa832('0x1d')]?_0x467396[_0xa832('0x1d')][_0xa832('0x25')]===undefined?!![]:![]:!![],'where':_0x467396[_0xa832('0x1d')]?_0x467396['options'][_0xa832('0x26')]||null:null,'attributes':_0x467396['options']?_0x467396[_0xa832('0x1d')][_0xa832('0x21')]||null:null,'include':_0x467396[_0xa832('0x1d')]?_0x467396[_0xa832('0x1d')][_0xa832('0x1f')]?_[_0xa832('0x1e')](_0x467396[_0xa832('0x1d')][_0xa832('0x1f')],function(_0xb82d80){return{'model':db[_0xb82d80[_0xa832('0x20')]],'as':_0xb82d80['as'],'attributes':_0xb82d80[_0xa832('0x21')],'include':_0xb82d80[_0xa832('0x1f')]?_['map'](_0xb82d80['include'],function(_0x1c386a){return{'model':db[_0x1c386a[_0xa832('0x20')]],'as':_0x1c386a['as'],'attributes':_0x1c386a[_0xa832('0x21')],'include':_0x1c386a[_0xa832('0x1f')]?_[_0xa832('0x1e')](_0x1c386a[_0xa832('0x1f')],function(_0x29e4d8){return{'model':db[_0x29e4d8['model']],'as':_0x29e4d8['as'],'attributes':_0x29e4d8[_0xa832('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa832('0x22')](function(_0x36d6dd){logger[_0xa832('0x12')](_0xa832('0x27'),_0x467396);logger['debug'](_0xa832('0x27'),_0x467396,JSON['stringify'](_0x36d6dd));_0x43237b(_0x36d6dd);})[_0xa832('0x23')](function(_0x33c525){logger[_0xa832('0x18')]('ShowOpenchannelQueue',_0x33c525['message'],_0x467396);_0xb5808e(_0x8862bd[_0xa832('0x18')](0x1f4,_0x33c525[_0xa832('0x19')]));});});}; \ No newline at end of file +var _0xf8c7=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelQueue,\x20%s,\x20%s','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','map','model','include','stringify','where','ShowOpenchannelQueue','debug','lodash','util'];(function(_0x1bbe6c,_0x56d18a){var _0x76ab07=function(_0x220f14){while(--_0x220f14){_0x1bbe6c['push'](_0x1bbe6c['shift']());}};_0x76ab07(++_0x56d18a);}(_0xf8c7,0x79));var _0x7f8c=function(_0x246a25,_0x2c0c46){_0x246a25=_0x246a25-0x0;var _0x5996f4=_0xf8c7[_0x246a25];return _0x5996f4;};'use strict';var _=require(_0x7f8c('0x0'));var util=require(_0x7f8c('0x1'));var moment=require(_0x7f8c('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f8c('0x3'));var fs=require('fs');var Redis=require(_0x7f8c('0x4'));var db=require(_0x7f8c('0x5'))['db'];var utils=require(_0x7f8c('0x6'));var logger=require('../../config/logger')(_0x7f8c('0x7'));var config=require(_0x7f8c('0x8'));var jayson=require(_0x7f8c('0x9'));var client=jayson[_0x7f8c('0xa')]['http']({'port':0x232a});config[_0x7f8c('0xb')]=_[_0x7f8c('0xc')](config[_0x7f8c('0xb')],{'host':_0x7f8c('0xd'),'port':0x18eb});var socket=require(_0x7f8c('0xe'))(new Redis(config[_0x7f8c('0xb')]));require(_0x7f8c('0xf'))[_0x7f8c('0x10')](socket);function respondWithRpcPromise(_0x11dd26,_0x4542c2,_0x2d7d30){return new BPromise(function(_0x2093f9,_0x12d644){return client[_0x7f8c('0x11')](_0x11dd26,_0x2d7d30)[_0x7f8c('0x12')](function(_0x110910){logger[_0x7f8c('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x4542c2,_0x7f8c('0x14'));logger['debug'](_0x7f8c('0x15'),_0x4542c2,'request\x20sent',JSON['stringify'](_0x110910));if(_0x110910[_0x7f8c('0x16')]){if(_0x110910[_0x7f8c('0x16')][_0x7f8c('0x17')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4542c2,_0x110910['error'][_0x7f8c('0x18')]);return _0x12d644(_0x110910[_0x7f8c('0x16')][_0x7f8c('0x18')]);}logger[_0x7f8c('0x16')](_0x7f8c('0x19'),_0x4542c2,_0x110910[_0x7f8c('0x16')][_0x7f8c('0x18')]);return _0x2093f9(_0x110910[_0x7f8c('0x16')][_0x7f8c('0x18')]);}else{logger[_0x7f8c('0x13')](_0x7f8c('0x19'),_0x4542c2,_0x7f8c('0x14'));_0x2093f9(_0x110910['result'][_0x7f8c('0x18')]);}})[_0x7f8c('0x1a')](function(_0x1d44ad){logger[_0x7f8c('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x4542c2,_0x1d44ad);_0x12d644(_0x1d44ad);});});}exports[_0x7f8c('0x1b')]=function(_0x2772f2){var _0x21ef8a=this;return new Promise(function(_0x496e38,_0x4e2e8b){return db[_0x7f8c('0x1c')][_0x7f8c('0x1d')]({'raw':_0x2772f2[_0x7f8c('0x1e')]?_0x2772f2[_0x7f8c('0x1e')][_0x7f8c('0x1f')]===undefined?!![]:![]:!![],'where':_0x2772f2['options']?_0x2772f2[_0x7f8c('0x1e')]['where']||null:null,'attributes':_0x2772f2['options']?_0x2772f2[_0x7f8c('0x1e')][_0x7f8c('0x20')]||null:null,'limit':_0x2772f2[_0x7f8c('0x1e')]?_0x2772f2[_0x7f8c('0x1e')][_0x7f8c('0x21')]||null:null,'include':_0x2772f2[_0x7f8c('0x1e')]?_0x2772f2['options']['include']?_[_0x7f8c('0x22')](_0x2772f2[_0x7f8c('0x1e')]['include'],function(_0x9c5a85){return{'model':db[_0x9c5a85[_0x7f8c('0x23')]],'as':_0x9c5a85['as'],'attributes':_0x9c5a85[_0x7f8c('0x20')],'include':_0x9c5a85['include']?_[_0x7f8c('0x22')](_0x9c5a85[_0x7f8c('0x24')],function(_0xe8deab){return{'model':db[_0xe8deab[_0x7f8c('0x23')]],'as':_0xe8deab['as'],'attributes':_0xe8deab['attributes'],'include':_0xe8deab[_0x7f8c('0x24')]?_[_0x7f8c('0x22')](_0xe8deab['include'],function(_0x2698fd){return{'model':db[_0x2698fd['model']],'as':_0x2698fd['as'],'attributes':_0x2698fd[_0x7f8c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7f8c('0x12')](function(_0x377880){logger[_0x7f8c('0x13')](_0x7f8c('0x1b'),_0x2772f2);logger['debug'](_0x7f8c('0x1b'),_0x2772f2,JSON[_0x7f8c('0x25')](_0x377880));_0x496e38(_0x377880);})[_0x7f8c('0x1a')](function(_0x5eeed0){logger[_0x7f8c('0x16')](_0x7f8c('0x1b'),_0x5eeed0[_0x7f8c('0x18')],_0x2772f2);_0x4e2e8b(_0x21ef8a['error'](0x1f4,_0x5eeed0['message']));});});};exports['ShowOpenchannelQueue']=function(_0x861e50){var _0x2cb755=this;return new Promise(function(_0x2505bd,_0x57135f){return db['OpenchannelQueue']['find']({'raw':_0x861e50[_0x7f8c('0x1e')]?_0x861e50[_0x7f8c('0x1e')][_0x7f8c('0x1f')]===undefined?!![]:![]:!![],'where':_0x861e50[_0x7f8c('0x1e')]?_0x861e50[_0x7f8c('0x1e')][_0x7f8c('0x26')]||null:null,'attributes':_0x861e50[_0x7f8c('0x1e')]?_0x861e50[_0x7f8c('0x1e')][_0x7f8c('0x20')]||null:null,'include':_0x861e50[_0x7f8c('0x1e')]?_0x861e50[_0x7f8c('0x1e')]['include']?_[_0x7f8c('0x22')](_0x861e50[_0x7f8c('0x1e')][_0x7f8c('0x24')],function(_0x6dfe94){return{'model':db[_0x6dfe94[_0x7f8c('0x23')]],'as':_0x6dfe94['as'],'attributes':_0x6dfe94[_0x7f8c('0x20')],'include':_0x6dfe94[_0x7f8c('0x24')]?_[_0x7f8c('0x22')](_0x6dfe94[_0x7f8c('0x24')],function(_0x5dbca1){return{'model':db[_0x5dbca1[_0x7f8c('0x23')]],'as':_0x5dbca1['as'],'attributes':_0x5dbca1[_0x7f8c('0x20')],'include':_0x5dbca1[_0x7f8c('0x24')]?_[_0x7f8c('0x22')](_0x5dbca1['include'],function(_0x17ae1c){return{'model':db[_0x17ae1c[_0x7f8c('0x23')]],'as':_0x17ae1c['as'],'attributes':_0x17ae1c[_0x7f8c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7f8c('0x12')](function(_0x7a04e6){logger[_0x7f8c('0x13')](_0x7f8c('0x27'),_0x861e50);logger[_0x7f8c('0x28')](_0x7f8c('0x27'),_0x861e50,JSON[_0x7f8c('0x25')](_0x7a04e6));_0x2505bd(_0x7a04e6);})[_0x7f8c('0x1a')](function(_0x5e81ce){logger[_0x7f8c('0x16')]('ShowOpenchannelQueue',_0x5e81ce[_0x7f8c('0x18')],_0x861e50);_0x57135f(_0x2cb755[_0x7f8c('0x16')](0x1f4,_0x5e81ce[_0x7f8c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 8ae89c1..1f25cf7 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 _0xcf00=['save','remove','update','emit','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf00,0x1aa));var _0x0cf0=function(_0xe38e0c,_0x5884ea){_0xe38e0c=_0xe38e0c-0x0;var _0x2c6987=_0xcf00[_0xe38e0c];return _0x2c6987;};'use strict';var OpenchannelQueueEvents=require(_0x0cf0('0x0'));var events=[_0x0cf0('0x1'),_0x0cf0('0x2'),_0x0cf0('0x3')];function createListener(_0x3eb86c,_0x4c9681){return function(_0x1ca4e1){_0x4c9681[_0x0cf0('0x4')](_0x3eb86c,_0x1ca4e1);};}function removeListener(_0x14dbed,_0x45eb5c){return function(){OpenchannelQueueEvents['removeListener'](_0x14dbed,_0x45eb5c);};}exports['register']=function(_0xdbc52c){for(var _0x1edca8=0x0,_0x39a3eb=events[_0x0cf0('0x5')];_0x1edca8<_0x39a3eb;_0x1edca8++){var _0x413309=events[_0x1edca8];var _0x369e83=createListener(_0x0cf0('0x6')+_0x413309,_0xdbc52c);OpenchannelQueueEvents['on'](_0x413309,_0x369e83);}}; \ No newline at end of file +var _0x7087=['openchannelQueue:','save','update','emit','register'];(function(_0x65e85f,_0x262d3e){var _0x4453af=function(_0x139d37){while(--_0x139d37){_0x65e85f['push'](_0x65e85f['shift']());}};_0x4453af(++_0x262d3e);}(_0x7087,0x128));var _0x7708=function(_0x23b630,_0x913b14){_0x23b630=_0x23b630-0x0;var _0x2e66e2=_0x7087[_0x23b630];return _0x2e66e2;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x7708('0x0'),'remove',_0x7708('0x1')];function createListener(_0x4c61f2,_0x25c113){return function(_0x1949c9){_0x25c113[_0x7708('0x2')](_0x4c61f2,_0x1949c9);};}function removeListener(_0x23b65d,_0x415502){return function(){OpenchannelQueueEvents['removeListener'](_0x23b65d,_0x415502);};}exports[_0x7708('0x3')]=function(_0xa62acd){for(var _0x2fc213=0x0,_0x4f3b74=events['length'];_0x2fc213<_0x4f3b74;_0x2fc213++){var _0x42261e=events[_0x2fc213];var _0x164a5f=createListener(_0x7708('0x4')+_0x42261e,_0xa62acd);OpenchannelQueueEvents['on'](_0x42261e,_0x164a5f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3bf2843..96b6d92 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 _0x4c95=['update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x51c1c2,_0x3d6289){var _0x3552f3=function(_0x43160e){while(--_0x43160e){_0x51c1c2['push'](_0x51c1c2['shift']());}};_0x3552f3(++_0x3d6289);}(_0x4c95,0x1e7));var _0x54c9=function(_0x586770,_0xd04ca3){_0x586770=_0x586770-0x0;var _0x5ea8d9=_0x4c95[_0x586770];return _0x5ea8d9;};'use strict';var multer=require(_0x54c9('0x0'));var util=require('util');var path=require(_0x54c9('0x1'));var timeout=require('connect-timeout');var express=require(_0x54c9('0x2'));var router=express[_0x54c9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x54c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x54c9('0x5'));var controller=require(_0x54c9('0x6'));router['get']('/',auth[_0x54c9('0x7')](),controller[_0x54c9('0x8')]);router[_0x54c9('0x9')](_0x54c9('0xa'),auth[_0x54c9('0x7')](),controller[_0x54c9('0xb')]);router[_0x54c9('0x9')](_0x54c9('0xc'),auth[_0x54c9('0x7')](),controller[_0x54c9('0xd')]);router[_0x54c9('0xe')]('/',auth[_0x54c9('0x7')](),controller[_0x54c9('0xf')]);router[_0x54c9('0x10')]('/:id',auth[_0x54c9('0x7')](),controller[_0x54c9('0x11')]);router[_0x54c9('0x12')](_0x54c9('0xc'),auth[_0x54c9('0x7')](),controller[_0x54c9('0x13')]);module[_0x54c9('0x14')]=router; \ No newline at end of file +var _0x0c92=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','create','put','destroy'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x0c92,0xab));var _0x20c9=function(_0x444e8b,_0x3524cc){_0x444e8b=_0x444e8b-0x0;var _0x35eb37=_0x0c92[_0x444e8b];return _0x35eb37;};'use strict';var multer=require(_0x20c9('0x0'));var util=require('util');var path=require(_0x20c9('0x1'));var timeout=require(_0x20c9('0x2'));var express=require(_0x20c9('0x3'));var router=express[_0x20c9('0x4')]();var fs_extra=require(_0x20c9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20c9('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x20c9('0x7')](),controller['index']);router['get'](_0x20c9('0x8'),auth[_0x20c9('0x7')](),controller[_0x20c9('0x9')]);router[_0x20c9('0xa')](_0x20c9('0xb'),auth[_0x20c9('0x7')](),controller[_0x20c9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x20c9('0xd')]);router[_0x20c9('0xe')](_0x20c9('0xb'),auth[_0x20c9('0x7')](),controller['update']);router['delete'](_0x20c9('0xb'),auth['isAuthenticated'](),controller[_0x20c9('0xf')]);module[_0x20c9('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2f49fbd..3a6f5de 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 _0xfa58=['exports','STRING','DATE','sequelize'];(function(_0x1f3593,_0x50e35b){var _0xf2ba67=function(_0x397f40){while(--_0x397f40){_0x1f3593['push'](_0x1f3593['shift']());}};_0xf2ba67(++_0x50e35b);}(_0xfa58,0x157));var _0x8fa5=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xfa58[_0x4c445a];return _0x2f611c;};'use strict';var moment=require('moment');var Sequelize=require(_0x8fa5('0x0'));module[_0x8fa5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8fa5('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8fa5('0x3')]},'acceptAt':{'type':Sequelize[_0x8fa5('0x3')]},'exitAt':{'type':Sequelize[_0x8fa5('0x3')]},'reason':{'type':Sequelize[_0x8fa5('0x2')]}}; \ No newline at end of file +var _0xd7af=['DATE','moment','sequelize','exports','STRING'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xd7af,0x1a5));var _0xfd7a=function(_0x459eea,_0x5a9228){_0x459eea=_0x459eea-0x0;var _0x4f9a38=_0xd7af[_0x459eea];return _0x4f9a38;};'use strict';var moment=require(_0xfd7a('0x0'));var Sequelize=require(_0xfd7a('0x1'));module[_0xfd7a('0x2')]={'uniqueid':{'type':Sequelize[_0xfd7a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfd7a('0x3')]},'joinAt':{'type':Sequelize[_0xfd7a('0x4')]},'leaveAt':{'type':Sequelize[_0xfd7a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfd7a('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b299e34..3af67c6 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 _0xed95=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x19aba2,_0x469e8a){var _0x3fc7df=function(_0x55eafc){while(--_0x55eafc){_0x19aba2['push'](_0x19aba2['shift']());}};_0x3fc7df(++_0x469e8a);}(_0xed95,0x81));var _0x5ed9=function(_0x18f7be,_0x28b45f){_0x18f7be=_0x18f7be-0x0;var _0x427085=_0xed95[_0x18f7be];return _0x427085;};'use strict';var emlformat=require(_0x5ed9('0x0'));var rimraf=require(_0x5ed9('0x1'));var zipdir=require(_0x5ed9('0x2'));var jsonpatch=require(_0x5ed9('0x3'));var rp=require(_0x5ed9('0x4'));var moment=require('moment');var BPromise=require(_0x5ed9('0x5'));var Mustache=require(_0x5ed9('0x6'));var util=require(_0x5ed9('0x7'));var path=require(_0x5ed9('0x8'));var sox=require(_0x5ed9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ed9('0xa'));var _=require(_0x5ed9('0xb'));var squel=require(_0x5ed9('0xc'));var crypto=require(_0x5ed9('0xd'));var jsforce=require(_0x5ed9('0xe'));var deskjs=require(_0x5ed9('0xf'));var toCsv=require(_0x5ed9('0x10'));var querystring=require('querystring');var Papa=require(_0x5ed9('0x11'));var Redis=require(_0x5ed9('0x12'));var authService=require(_0x5ed9('0x13'));var qs=require(_0x5ed9('0x14'));var as=require(_0x5ed9('0x15'));var hardwareService=require(_0x5ed9('0x16'));var logger=require('../../config/logger')(_0x5ed9('0x17'));var utils=require(_0x5ed9('0x18'));var config=require(_0x5ed9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ed9('0x1a'))['db'];function respondWithStatusCode(_0x4cdb14,_0x306108){_0x306108=_0x306108||0xcc;return function(_0x1121a6){if(_0x1121a6){return _0x4cdb14[_0x5ed9('0x1b')](_0x306108);}return _0x4cdb14['status'](_0x306108)[_0x5ed9('0x1c')]();};}function respondWithResult(_0xc74c17,_0x41b590){_0x41b590=_0x41b590||0xc8;return function(_0x58d9df){if(_0x58d9df){return _0xc74c17[_0x5ed9('0x1d')](_0x41b590)[_0x5ed9('0x1e')](_0x58d9df);}};}function respondWithFilteredResult(_0x2df4b6,_0x298ab5){return function(_0x348a53){if(_0x348a53){var _0x586b10=typeof _0x298ab5[_0x5ed9('0x1f')]===_0x5ed9('0x20')&&typeof _0x298ab5[_0x5ed9('0x21')]===_0x5ed9('0x20');var _0x366380=_0x348a53['count'];var _0x46b163=_0x586b10?0x0:_0x298ab5[_0x5ed9('0x1f')];var _0x223a82=_0x586b10?_0x348a53[_0x5ed9('0x22')]:_0x298ab5['offset']+_0x298ab5['limit'];var _0x103b2e;if(_0x223a82>=_0x366380){_0x223a82=_0x366380;_0x103b2e=0xc8;}else{_0x103b2e=0xce;}_0x2df4b6[_0x5ed9('0x1d')](_0x103b2e);return _0x2df4b6[_0x5ed9('0x23')](_0x5ed9('0x24'),_0x46b163+'-'+_0x223a82+'/'+_0x366380)[_0x5ed9('0x1e')](_0x348a53);}return null;};}function patchUpdates(_0x4a0c35){return function(_0x457291){try{jsonpatch[_0x5ed9('0x25')](_0x457291,_0x4a0c35,!![]);}catch(_0x16314e){return BPromise['reject'](_0x16314e);}return _0x457291[_0x5ed9('0x26')]();};}function saveUpdates(_0x456735,_0x364c3e){return function(_0x28c3c8){if(_0x28c3c8){return _0x28c3c8[_0x5ed9('0x27')](_0x456735)[_0x5ed9('0x28')](function(_0x47411a){return _0x47411a;});}return null;};}function removeEntity(_0x45b94a,_0x4bee3c){return function(_0x1178e8){if(_0x1178e8){return _0x1178e8[_0x5ed9('0x29')]()['then'](function(){_0x45b94a[_0x5ed9('0x1d')](0xcc)[_0x5ed9('0x1c')]();});}};}function handleEntityNotFound(_0xd9c908,_0x266cf5){return function(_0x13c1d8){if(!_0x13c1d8){_0xd9c908[_0x5ed9('0x1b')](0x194);}return _0x13c1d8;};}function handleError(_0x4b45d7,_0x1b3079){_0x1b3079=_0x1b3079||0x1f4;return function(_0x3be2c7){logger[_0x5ed9('0x2a')](_0x3be2c7[_0x5ed9('0x2b')]);if(_0x3be2c7[_0x5ed9('0x2c')]){delete _0x3be2c7['name'];}_0x4b45d7['status'](_0x1b3079)['send'](_0x3be2c7);};}exports[_0x5ed9('0x2d')]=function(_0x499fc8,_0x1177fe){var _0x25c1f6={},_0x1589dc={},_0x54d302={'count':0x0,'rows':[]};var _0xa3da54=_[_0x5ed9('0x2e')](db[_0x5ed9('0x2f')][_0x5ed9('0x30')],function(_0x589338){return{'name':_0x589338[_0x5ed9('0x31')],'type':_0x589338['type'][_0x5ed9('0x32')]};});_0x1589dc[_0x5ed9('0x33')]=_[_0x5ed9('0x2e')](_0xa3da54,_0x5ed9('0x2c'));_0x1589dc[_0x5ed9('0x34')]=_[_0x5ed9('0x35')](_0x499fc8[_0x5ed9('0x34')]);_0x1589dc['filters']=_[_0x5ed9('0x36')](_0x1589dc[_0x5ed9('0x33')],_0x1589dc[_0x5ed9('0x34')]);_0x25c1f6[_0x5ed9('0x37')]=_[_0x5ed9('0x36')](_0x1589dc['model'],qs[_0x5ed9('0x38')](_0x499fc8[_0x5ed9('0x34')][_0x5ed9('0x38')]));_0x25c1f6[_0x5ed9('0x37')]=_0x25c1f6[_0x5ed9('0x37')][_0x5ed9('0x39')]?_0x25c1f6[_0x5ed9('0x37')]:_0x1589dc['model'];if(!_0x499fc8[_0x5ed9('0x34')]['hasOwnProperty'](_0x5ed9('0x3a'))){_0x25c1f6[_0x5ed9('0x21')]=qs['limit'](_0x499fc8[_0x5ed9('0x34')][_0x5ed9('0x21')]);_0x25c1f6[_0x5ed9('0x1f')]=qs['offset'](_0x499fc8['query'][_0x5ed9('0x1f')]);}_0x25c1f6[_0x5ed9('0x3b')]=qs[_0x5ed9('0x3c')](_0x499fc8['query'][_0x5ed9('0x3c')]);_0x25c1f6[_0x5ed9('0x3d')]=qs[_0x5ed9('0x3e')](_['pick'](_0x499fc8[_0x5ed9('0x34')],_0x1589dc[_0x5ed9('0x3e')]),_0xa3da54);if(_0x499fc8[_0x5ed9('0x34')]['filter']){_0x25c1f6[_0x5ed9('0x3d')]=_['merge'](_0x25c1f6[_0x5ed9('0x3d')],{'$or':_[_0x5ed9('0x2e')](_0xa3da54,function(_0x489211){if(_0x489211['type']!=='VIRTUAL'){var _0x4fae7e={};_0x4fae7e[_0x489211[_0x5ed9('0x2c')]]={'$like':'%'+_0x499fc8['query'][_0x5ed9('0x3f')]+'%'};return _0x4fae7e;}})});}_0x25c1f6=_[_0x5ed9('0x40')]({},_0x25c1f6,_0x499fc8['options']);var _0x32ccf2={'where':_0x25c1f6['where']};return db[_0x5ed9('0x2f')][_0x5ed9('0x22')](_0x32ccf2)['then'](function(_0x12ecf6){_0x54d302['count']=_0x12ecf6;if(_0x499fc8[_0x5ed9('0x34')][_0x5ed9('0x41')]){_0x25c1f6[_0x5ed9('0x42')]=[{'all':!![]}];}return db[_0x5ed9('0x2f')][_0x5ed9('0x43')](_0x25c1f6);})[_0x5ed9('0x28')](function(_0x1ea534){_0x54d302[_0x5ed9('0x44')]=_0x1ea534;return _0x54d302;})[_0x5ed9('0x28')](respondWithFilteredResult(_0x1177fe,_0x25c1f6))['catch'](handleError(_0x1177fe,null));};exports['show']=function(_0x52bd0a,_0x42cc95){var _0x368909={'raw':!![],'where':{'id':_0x52bd0a['params']['id']}},_0x4e78b4={};_0x4e78b4[_0x5ed9('0x33')]=_[_0x5ed9('0x35')](db[_0x5ed9('0x2f')][_0x5ed9('0x30')]);_0x4e78b4[_0x5ed9('0x34')]=_[_0x5ed9('0x35')](_0x52bd0a[_0x5ed9('0x34')]);_0x4e78b4[_0x5ed9('0x3e')]=_[_0x5ed9('0x36')](_0x4e78b4['model'],_0x4e78b4[_0x5ed9('0x34')]);_0x368909[_0x5ed9('0x37')]=_[_0x5ed9('0x36')](_0x4e78b4[_0x5ed9('0x33')],qs[_0x5ed9('0x38')](_0x52bd0a[_0x5ed9('0x34')][_0x5ed9('0x38')]));_0x368909[_0x5ed9('0x37')]=_0x368909['attributes'][_0x5ed9('0x39')]?_0x368909[_0x5ed9('0x37')]:_0x4e78b4[_0x5ed9('0x33')];if(_0x52bd0a[_0x5ed9('0x34')][_0x5ed9('0x41')]){_0x368909['include']=[{'all':!![]}];}_0x368909=_[_0x5ed9('0x40')]({},_0x368909,_0x52bd0a[_0x5ed9('0x45')]);return db[_0x5ed9('0x2f')][_0x5ed9('0x46')](_0x368909)[_0x5ed9('0x28')](handleEntityNotFound(_0x42cc95,null))['then'](respondWithResult(_0x42cc95,null))[_0x5ed9('0x47')](handleError(_0x42cc95,null));};exports[_0x5ed9('0x48')]=function(_0x23e4fc,_0x4a911a){return db['OpenchannelQueueReport'][_0x5ed9('0x48')](_0x23e4fc['body'],{})[_0x5ed9('0x28')](respondWithResult(_0x4a911a,0xc9))[_0x5ed9('0x47')](handleError(_0x4a911a,null));};exports[_0x5ed9('0x27')]=function(_0x300c13,_0x558e52){if(_0x300c13[_0x5ed9('0x49')]['id']){delete _0x300c13[_0x5ed9('0x49')]['id'];}return db['OpenchannelQueueReport'][_0x5ed9('0x46')]({'where':{'id':_0x300c13[_0x5ed9('0x4a')]['id']}})[_0x5ed9('0x28')](handleEntityNotFound(_0x558e52,null))[_0x5ed9('0x28')](saveUpdates(_0x300c13[_0x5ed9('0x49')],null))[_0x5ed9('0x28')](respondWithResult(_0x558e52,null))[_0x5ed9('0x47')](handleError(_0x558e52,null));};exports['destroy']=function(_0x3c59a3,_0x41c2ad){return db[_0x5ed9('0x2f')][_0x5ed9('0x46')]({'where':{'id':_0x3c59a3[_0x5ed9('0x4a')]['id']}})[_0x5ed9('0x28')](handleEntityNotFound(_0x41c2ad,null))['then'](removeEntity(_0x41c2ad,null))['catch'](handleError(_0x41c2ad,null));};exports[_0x5ed9('0x4b')]=function(_0x5a3d8d,_0x3beb54){return db[_0x5ed9('0x2f')][_0x5ed9('0x4b')]()[_0x5ed9('0x28')](respondWithResult(_0x3beb54,null))['catch'](handleError(_0x3beb54,null));}; \ No newline at end of file +var _0x7e47=['type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','rows','show','intersection','length','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e47,0x152));var _0x77e4=function(_0x106336,_0x152712){_0x106336=_0x106336-0x0;var _0x2687ff=_0x7e47[_0x106336];return _0x2687ff;};'use strict';var emlformat=require(_0x77e4('0x0'));var rimraf=require(_0x77e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77e4('0x2'));var rp=require(_0x77e4('0x3'));var moment=require(_0x77e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77e4('0x5'));var util=require(_0x77e4('0x6'));var path=require('path');var sox=require(_0x77e4('0x7'));var csv=require(_0x77e4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77e4('0x9'));var _=require(_0x77e4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x77e4('0xb'));var deskjs=require(_0x77e4('0xc'));var toCsv=require(_0x77e4('0x8'));var querystring=require(_0x77e4('0xd'));var Papa=require(_0x77e4('0xe'));var Redis=require('ioredis');var authService=require(_0x77e4('0xf'));var qs=require(_0x77e4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77e4('0x11'));var logger=require('../../config/logger')(_0x77e4('0x12'));var utils=require(_0x77e4('0x13'));var config=require(_0x77e4('0x14'));var licenseUtil=require(_0x77e4('0x15'));var db=require(_0x77e4('0x16'))['db'];function respondWithStatusCode(_0x4bf7b9,_0x4bb2ff){_0x4bb2ff=_0x4bb2ff||0xcc;return function(_0x31f56a){if(_0x31f56a){return _0x4bf7b9['sendStatus'](_0x4bb2ff);}return _0x4bf7b9[_0x77e4('0x17')](_0x4bb2ff)['end']();};}function respondWithResult(_0x3a4d91,_0x1f5cec){_0x1f5cec=_0x1f5cec||0xc8;return function(_0x27cdfe){if(_0x27cdfe){return _0x3a4d91[_0x77e4('0x17')](_0x1f5cec)[_0x77e4('0x18')](_0x27cdfe);}};}function respondWithFilteredResult(_0x1c4cbd,_0x355e99){return function(_0x43b132){if(_0x43b132){var _0x39ab7e=typeof _0x355e99['offset']===_0x77e4('0x19')&&typeof _0x355e99[_0x77e4('0x1a')]===_0x77e4('0x19');var _0x47f3b2=_0x43b132[_0x77e4('0x1b')];var _0x25178b=_0x39ab7e?0x0:_0x355e99[_0x77e4('0x1c')];var _0x25f17a=_0x39ab7e?_0x43b132[_0x77e4('0x1b')]:_0x355e99[_0x77e4('0x1c')]+_0x355e99[_0x77e4('0x1a')];var _0x13b0b8;if(_0x25f17a>=_0x47f3b2){_0x25f17a=_0x47f3b2;_0x13b0b8=0xc8;}else{_0x13b0b8=0xce;}_0x1c4cbd[_0x77e4('0x17')](_0x13b0b8);return _0x1c4cbd[_0x77e4('0x1d')](_0x77e4('0x1e'),_0x25178b+'-'+_0x25f17a+'/'+_0x47f3b2)[_0x77e4('0x18')](_0x43b132);}return null;};}function patchUpdates(_0x166861){return function(_0x2a9e7a){try{jsonpatch[_0x77e4('0x1f')](_0x2a9e7a,_0x166861,!![]);}catch(_0x1f3208){return BPromise[_0x77e4('0x20')](_0x1f3208);}return _0x2a9e7a[_0x77e4('0x21')]();};}function saveUpdates(_0x5654a7,_0x312b5a){return function(_0x2e69da){if(_0x2e69da){return _0x2e69da[_0x77e4('0x22')](_0x5654a7)[_0x77e4('0x23')](function(_0x26dc60){return _0x26dc60;});}return null;};}function removeEntity(_0x70428c,_0x9af7c7){return function(_0x20f834){if(_0x20f834){return _0x20f834[_0x77e4('0x24')]()[_0x77e4('0x23')](function(){_0x70428c['status'](0xcc)[_0x77e4('0x25')]();});}};}function handleEntityNotFound(_0x2ce562,_0x244fbc){return function(_0x42ee70){if(!_0x42ee70){_0x2ce562[_0x77e4('0x26')](0x194);}return _0x42ee70;};}function handleError(_0x4f8439,_0x439e73){_0x439e73=_0x439e73||0x1f4;return function(_0x335da1){logger[_0x77e4('0x27')](_0x335da1[_0x77e4('0x28')]);if(_0x335da1[_0x77e4('0x29')]){delete _0x335da1['name'];}_0x4f8439[_0x77e4('0x17')](_0x439e73)[_0x77e4('0x2a')](_0x335da1);};}exports[_0x77e4('0x2b')]=function(_0x269ebb,_0x3e38d1){var _0xb8b0cd={},_0x9e7118={},_0x3eaba5={'count':0x0,'rows':[]};var _0x1dfb73=_[_0x77e4('0x2c')](db[_0x77e4('0x2d')][_0x77e4('0x2e')],function(_0x2e5c36){return{'name':_0x2e5c36['fieldName'],'type':_0x2e5c36[_0x77e4('0x2f')][_0x77e4('0x30')]};});_0x9e7118[_0x77e4('0x31')]=_[_0x77e4('0x2c')](_0x1dfb73,_0x77e4('0x29'));_0x9e7118[_0x77e4('0x32')]=_[_0x77e4('0x33')](_0x269ebb[_0x77e4('0x32')]);_0x9e7118[_0x77e4('0x34')]=_['intersection'](_0x9e7118[_0x77e4('0x31')],_0x9e7118[_0x77e4('0x32')]);_0xb8b0cd[_0x77e4('0x35')]=_['intersection'](_0x9e7118[_0x77e4('0x31')],qs[_0x77e4('0x36')](_0x269ebb[_0x77e4('0x32')][_0x77e4('0x36')]));_0xb8b0cd[_0x77e4('0x35')]=_0xb8b0cd[_0x77e4('0x35')]['length']?_0xb8b0cd['attributes']:_0x9e7118[_0x77e4('0x31')];if(!_0x269ebb[_0x77e4('0x32')][_0x77e4('0x37')](_0x77e4('0x38'))){_0xb8b0cd[_0x77e4('0x1a')]=qs[_0x77e4('0x1a')](_0x269ebb[_0x77e4('0x32')][_0x77e4('0x1a')]);_0xb8b0cd['offset']=qs[_0x77e4('0x1c')](_0x269ebb[_0x77e4('0x32')][_0x77e4('0x1c')]);}_0xb8b0cd[_0x77e4('0x39')]=qs[_0x77e4('0x3a')](_0x269ebb[_0x77e4('0x32')][_0x77e4('0x3a')]);_0xb8b0cd['where']=qs['filters'](_[_0x77e4('0x3b')](_0x269ebb['query'],_0x9e7118[_0x77e4('0x34')]),_0x1dfb73);if(_0x269ebb[_0x77e4('0x32')][_0x77e4('0x3c')]){_0xb8b0cd[_0x77e4('0x3d')]=_['merge'](_0xb8b0cd[_0x77e4('0x3d')],{'$or':_[_0x77e4('0x2c')](_0x1dfb73,function(_0x1b1342){if(_0x1b1342[_0x77e4('0x2f')]!==_0x77e4('0x3e')){var _0x2a99c1={};_0x2a99c1[_0x1b1342['name']]={'$like':'%'+_0x269ebb[_0x77e4('0x32')][_0x77e4('0x3c')]+'%'};return _0x2a99c1;}})});}_0xb8b0cd=_[_0x77e4('0x3f')]({},_0xb8b0cd,_0x269ebb[_0x77e4('0x40')]);var _0x7a1898={'where':_0xb8b0cd[_0x77e4('0x3d')]};return db[_0x77e4('0x2d')][_0x77e4('0x1b')](_0x7a1898)[_0x77e4('0x23')](function(_0x28c23e){_0x3eaba5[_0x77e4('0x1b')]=_0x28c23e;if(_0x269ebb[_0x77e4('0x32')]['includeAll']){_0xb8b0cd[_0x77e4('0x41')]=[{'all':!![]}];}return db[_0x77e4('0x2d')]['findAll'](_0xb8b0cd);})[_0x77e4('0x23')](function(_0x175eff){_0x3eaba5[_0x77e4('0x42')]=_0x175eff;return _0x3eaba5;})['then'](respondWithFilteredResult(_0x3e38d1,_0xb8b0cd))['catch'](handleError(_0x3e38d1,null));};exports[_0x77e4('0x43')]=function(_0x2aa8fa,_0x28c798){var _0x2f7409={'raw':!![],'where':{'id':_0x2aa8fa['params']['id']}},_0x16fb71={};_0x16fb71[_0x77e4('0x31')]=_['keys'](db[_0x77e4('0x2d')]['rawAttributes']);_0x16fb71[_0x77e4('0x32')]=_[_0x77e4('0x33')](_0x2aa8fa[_0x77e4('0x32')]);_0x16fb71[_0x77e4('0x34')]=_[_0x77e4('0x44')](_0x16fb71[_0x77e4('0x31')],_0x16fb71['query']);_0x2f7409[_0x77e4('0x35')]=_[_0x77e4('0x44')](_0x16fb71[_0x77e4('0x31')],qs[_0x77e4('0x36')](_0x2aa8fa[_0x77e4('0x32')]['fields']));_0x2f7409[_0x77e4('0x35')]=_0x2f7409[_0x77e4('0x35')][_0x77e4('0x45')]?_0x2f7409[_0x77e4('0x35')]:_0x16fb71[_0x77e4('0x31')];if(_0x2aa8fa['query'][_0x77e4('0x46')]){_0x2f7409[_0x77e4('0x41')]=[{'all':!![]}];}_0x2f7409=_[_0x77e4('0x3f')]({},_0x2f7409,_0x2aa8fa[_0x77e4('0x40')]);return db['OpenchannelQueueReport'][_0x77e4('0x47')](_0x2f7409)[_0x77e4('0x23')](handleEntityNotFound(_0x28c798,null))['then'](respondWithResult(_0x28c798,null))[_0x77e4('0x48')](handleError(_0x28c798,null));};exports[_0x77e4('0x49')]=function(_0x264c9c,_0x509f37){return db[_0x77e4('0x2d')][_0x77e4('0x49')](_0x264c9c[_0x77e4('0x4a')],{})[_0x77e4('0x23')](respondWithResult(_0x509f37,0xc9))[_0x77e4('0x48')](handleError(_0x509f37,null));};exports[_0x77e4('0x22')]=function(_0x5213c7,_0x230094){if(_0x5213c7[_0x77e4('0x4a')]['id']){delete _0x5213c7[_0x77e4('0x4a')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x5213c7[_0x77e4('0x4b')]['id']}})[_0x77e4('0x23')](handleEntityNotFound(_0x230094,null))[_0x77e4('0x23')](saveUpdates(_0x5213c7[_0x77e4('0x4a')],null))[_0x77e4('0x23')](respondWithResult(_0x230094,null))['catch'](handleError(_0x230094,null));};exports[_0x77e4('0x24')]=function(_0x2002ba,_0x4bcff6){return db['OpenchannelQueueReport'][_0x77e4('0x47')]({'where':{'id':_0x2002ba[_0x77e4('0x4b')]['id']}})[_0x77e4('0x23')](handleEntityNotFound(_0x4bcff6,null))['then'](removeEntity(_0x4bcff6,null))['catch'](handleError(_0x4bcff6,null));};exports[_0x77e4('0x4c')]=function(_0x3c6f59,_0xbc13fa){return db[_0x77e4('0x2d')][_0x77e4('0x4c')]()[_0x77e4('0x23')](respondWithResult(_0xbc13fa,null))[_0x77e4('0x48')](handleError(_0xbc13fa,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index b730783..ba12d2b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x3fc42b,_0x1bcc9c){var _0x16e60f=function(_0x22b0b2){while(--_0x22b0b2){_0x3fc42b['push'](_0x3fc42b['shift']());}};_0x16e60f(++_0x1bcc9c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x511ebf,_0x1e72aa){var _0x50d2d3=function(_0x1e29eb){while(--_0x1e29eb){_0x511ebf['push'](_0x511ebf['shift']());}};_0x50d2d3(++_0x1e72aa);}(_0x1261,0x144));var _0x1126=function(_0xe38764,_0x28ce79){_0xe38764=_0xe38764-0x0;var _0x5979cf=_0x1261[_0xe38764];return _0x5979cf;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 9633e03..b697786 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 _0x5f66=['error','info','catch','CreateOpenchannelQueueReport','create','raw','update','body','options','where','attributes','limit','UpdateOpenchannelQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','message'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['OpenchannelQueueReport'][_0x65f6('0x16')](_0x1f974c['body'],{'raw':_0x1f974c['options']?_0x1f974c['options'][_0x65f6('0x17')]===undefined?!![]:![]:!![]})[_0x65f6('0xa')](function(_0x5114a4){logger[_0x65f6('0x13')](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON[_0x65f6('0xf')](_0x5114a4));_0x18380e(_0x5114a4);})[_0x65f6('0x14')](function(_0x581374){logger[_0x65f6('0x12')]('CreateOpenchannelQueueReport',_0x581374['message'],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x581374[_0x65f6('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1eeaaa){var _0x471a33=this;return new Promise(function(_0x2317ce,_0x2774a1){return db['OpenchannelQueueReport'][_0x65f6('0x18')](_0x1eeaaa[_0x65f6('0x19')],{'raw':_0x1eeaaa[_0x65f6('0x1a')]?_0x1eeaaa['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1b')]||null:null,'attributes':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'limit':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null})[_0x65f6('0xa')](function(_0x559330){logger['info']('UpdateOpenchannelQueueReport',_0x1eeaaa);logger[_0x65f6('0xd')](_0x65f6('0x1e'),_0x1eeaaa,JSON[_0x65f6('0xf')](_0x559330));_0x2317ce(_0x559330);})[_0x65f6('0x14')](function(_0x518cac){logger[_0x65f6('0x12')](_0x65f6('0x1e'),_0x518cac['message'],_0x1eeaaa);_0x2774a1(_0x471a33['error'](0x1f4,_0x518cac[_0x65f6('0x11')]));});});}; \ No newline at end of file +var _0x19e1=['where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update'];(function(_0x408cf3,_0x3607c1){var _0x3a5e16=function(_0x3fe28d){while(--_0x3fe28d){_0x408cf3['push'](_0x408cf3['shift']());}};_0x3a5e16(++_0x3607c1);}(_0x19e1,0x163));var _0x119e=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0x19e1[_0x3f9584];return _0x9d54c;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require(_0x119e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119e('0x4'))['db'];var utils=require(_0x119e('0x5'));var logger=require('../../config/logger')(_0x119e('0x6'));var config=require(_0x119e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x119e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5306,_0x25e166,_0x16a2ee){return new BPromise(function(_0x1b3797,_0x53d5b7){return client[_0x119e('0x9')](_0x1b5306,_0x16a2ee)[_0x119e('0xa')](function(_0x1a6747){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x25e166,_0x119e('0xb'));logger[_0x119e('0xc')](_0x119e('0xd'),_0x25e166,_0x119e('0xb'),JSON[_0x119e('0xe')](_0x1a6747));if(_0x1a6747[_0x119e('0xf')]){if(_0x1a6747[_0x119e('0xf')]['code']===0x1f4){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x53d5b7(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}logger['error'](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x1b3797(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}else{logger[_0x119e('0x12')](_0x119e('0x10'),_0x25e166,_0x119e('0xb'));_0x1b3797(_0x1a6747[_0x119e('0x13')][_0x119e('0x11')]);}})[_0x119e('0x14')](function(_0x54c326){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x54c326);_0x53d5b7(_0x54c326);});});}exports[_0x119e('0x15')]=function(_0xb3375c){var _0x348ae3=this;return new Promise(function(_0xedc945,_0x2848fa){return db[_0x119e('0x16')][_0x119e('0x17')](_0xb3375c[_0x119e('0x18')],{'raw':_0xb3375c[_0x119e('0x19')]?_0xb3375c['options'][_0x119e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xd4c2d5){logger['info'](_0x119e('0x15'),_0xb3375c);logger[_0x119e('0xc')]('CreateOpenchannelQueueReport',_0xb3375c,JSON['stringify'](_0xd4c2d5));_0xedc945(_0xd4c2d5);})[_0x119e('0x14')](function(_0x29de19){logger[_0x119e('0xf')]('CreateOpenchannelQueueReport',_0x29de19['message'],_0xb3375c);_0x2848fa(_0x348ae3[_0x119e('0xf')](0x1f4,_0x29de19['message']));});});};exports[_0x119e('0x1b')]=function(_0x21fb19){var _0x198f7b=this;return new Promise(function(_0x596dfb,_0x1e4c98){return db['OpenchannelQueueReport'][_0x119e('0x1c')](_0x21fb19['body'],{'raw':_0x21fb19['options']?_0x21fb19[_0x119e('0x19')][_0x119e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21fb19[_0x119e('0x19')]?_0x21fb19[_0x119e('0x19')][_0x119e('0x1d')]||null:null,'attributes':_0x21fb19[_0x119e('0x19')]?_0x21fb19['options'][_0x119e('0x1e')]||null:null,'limit':_0x21fb19[_0x119e('0x19')]?_0x21fb19['options'][_0x119e('0x1f')]||null:null})[_0x119e('0xa')](function(_0x49b965){logger[_0x119e('0x12')]('UpdateOpenchannelQueueReport',_0x21fb19);logger[_0x119e('0xc')](_0x119e('0x1b'),_0x21fb19,JSON[_0x119e('0xe')](_0x49b965));_0x596dfb(_0x49b965);})[_0x119e('0x14')](function(_0x3df7e9){logger['error'](_0x119e('0x1b'),_0x3df7e9[_0x119e('0x11')],_0x21fb19);_0x1e4c98(_0x198f7b[_0x119e('0xf')](0x1f4,_0x3df7e9[_0x119e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 416bec7..338432f 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 _0x35e7=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x164741,_0x1f8ca8){var _0x408e88=function(_0x12f3df){while(--_0x12f3df){_0x164741['push'](_0x164741['shift']());}};_0x408e88(++_0x1f8ca8);}(_0x35e7,0x141));var _0x735e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x35e7[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x735e('0x0'));var util=require(_0x735e('0x1'));var path=require(_0x735e('0x2'));var timeout=require(_0x735e('0x3'));var express=require('express');var router=express[_0x735e('0x4')]();var fs_extra=require(_0x735e('0x5'));var auth=require(_0x735e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x735e('0x7'));var controller=require(_0x735e('0x8'));router[_0x735e('0x9')]('/',auth[_0x735e('0xa')](),controller[_0x735e('0xb')]);router[_0x735e('0x9')](_0x735e('0xc'),auth[_0x735e('0xa')](),controller[_0x735e('0xd')]);router[_0x735e('0x9')](_0x735e('0xe'),auth['isAuthenticated'](),controller[_0x735e('0xf')]);router['post']('/',auth[_0x735e('0xa')](),controller['create']);router[_0x735e('0x10')](_0x735e('0xe'),auth[_0x735e('0xa')](),controller[_0x735e('0x11')]);router[_0x735e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x735e('0x13')]);module[_0x735e('0x14')]=router; \ No newline at end of file +var _0xdf2b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xdf2b,0x99));var _0xbdf2=function(_0x35f14f,_0x43dc93){_0x35f14f=_0x35f14f-0x0;var _0x4cda77=_0xdf2b[_0x35f14f];return _0x4cda77;};'use strict';var multer=require(_0xbdf2('0x0'));var util=require(_0xbdf2('0x1'));var path=require(_0xbdf2('0x2'));var timeout=require(_0xbdf2('0x3'));var express=require(_0xbdf2('0x4'));var router=express[_0xbdf2('0x5')]();var fs_extra=require(_0xbdf2('0x6'));var auth=require(_0xbdf2('0x7'));var interaction=require(_0xbdf2('0x8'));var config=require(_0xbdf2('0x9'));var controller=require(_0xbdf2('0xa'));router[_0xbdf2('0xb')]('/',auth[_0xbdf2('0xc')](),controller[_0xbdf2('0xd')]);router['get'](_0xbdf2('0xe'),auth[_0xbdf2('0xc')](),controller['describe']);router[_0xbdf2('0xb')](_0xbdf2('0xf'),auth[_0xbdf2('0xc')](),controller['show']);router[_0xbdf2('0x10')]('/',auth[_0xbdf2('0xc')](),controller[_0xbdf2('0x11')]);router['put']('/:id',auth[_0xbdf2('0xc')](),controller['update']);router[_0xbdf2('0x12')](_0xbdf2('0xf'),auth[_0xbdf2('0xc')](),controller[_0xbdf2('0x13')]);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 7ef8822..a7e51df 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x95a8bf,_0xf27da8){var _0x204aa3=function(_0x3fd56c){while(--_0x3fd56c){_0x95a8bf['push'](_0x95a8bf['shift']());}};_0x204aa3(++_0xf27da8);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2808bc,_0x5b9837){_0x2808bc=_0x2808bc-0x0;var _0x564364=_0xf4eb[_0x2808bc];return _0x564364;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x5787a2,_0x176bed){var _0xb37102=function(_0x13f733){while(--_0x13f733){_0x5787a2['push'](_0x5787a2['shift']());}};_0xb37102(++_0x176bed);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x79b53e,_0x108f8d){_0x79b53e=_0x79b53e-0x0;var _0x2d4d6c=_0xf3cd[_0x79b53e];return _0x2d4d6c;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 181e4ae..d579800 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 _0x1d55=['undefined','limit','status','set','Content-Range','apply','save','update','then','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset'];(function(_0x30a38c,_0x364ca8){var _0x306e89=function(_0x252a22){while(--_0x252a22){_0x30a38c['push'](_0x30a38c['shift']());}};_0x306e89(++_0x364ca8);}(_0x1d55,0x78));var _0x51d5=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x1d55[_0x1a8f86];return _0x20d876;};'use strict';var emlformat=require(_0x51d5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51d5('0x1'));var moment=require(_0x51d5('0x2'));var BPromise=require(_0x51d5('0x3'));var Mustache=require(_0x51d5('0x4'));var util=require(_0x51d5('0x5'));var path=require(_0x51d5('0x6'));var sox=require(_0x51d5('0x7'));var csv=require(_0x51d5('0x8'));var ejs=require(_0x51d5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x51d5('0xa'));var crypto=require(_0x51d5('0xb'));var jsforce=require(_0x51d5('0xc'));var deskjs=require(_0x51d5('0xd'));var toCsv=require(_0x51d5('0x8'));var querystring=require(_0x51d5('0xe'));var Papa=require('papaparse');var Redis=require(_0x51d5('0xf'));var authService=require(_0x51d5('0x10'));var qs=require(_0x51d5('0x11'));var as=require(_0x51d5('0x12'));var hardwareService=require(_0x51d5('0x13'));var logger=require(_0x51d5('0x14'))('api');var utils=require(_0x51d5('0x15'));var config=require(_0x51d5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x51d5('0x17'))['db'];function respondWithStatusCode(_0x1438fe,_0x5458e1){_0x5458e1=_0x5458e1||0xcc;return function(_0x3e1090){if(_0x3e1090){return _0x1438fe[_0x51d5('0x18')](_0x5458e1);}return _0x1438fe['status'](_0x5458e1)[_0x51d5('0x19')]();};}function respondWithResult(_0x361ef6,_0x4329a8){_0x4329a8=_0x4329a8||0xc8;return function(_0x1168d2){if(_0x1168d2){return _0x361ef6['status'](_0x4329a8)[_0x51d5('0x1a')](_0x1168d2);}};}function respondWithFilteredResult(_0x1fa136,_0xa5738e){return function(_0xbb7dbb){if(_0xbb7dbb){var _0x5cad31=typeof _0xa5738e[_0x51d5('0x1b')]===_0x51d5('0x1c')&&typeof _0xa5738e[_0x51d5('0x1d')]===_0x51d5('0x1c');var _0x5d9387=_0xbb7dbb['count'];var _0x440dbe=_0x5cad31?0x0:_0xa5738e['offset'];var _0x5deafc=_0x5cad31?_0xbb7dbb['count']:_0xa5738e[_0x51d5('0x1b')]+_0xa5738e['limit'];var _0xa147f6;if(_0x5deafc>=_0x5d9387){_0x5deafc=_0x5d9387;_0xa147f6=0xc8;}else{_0xa147f6=0xce;}_0x1fa136[_0x51d5('0x1e')](_0xa147f6);return _0x1fa136[_0x51d5('0x1f')](_0x51d5('0x20'),_0x440dbe+'-'+_0x5deafc+'/'+_0x5d9387)[_0x51d5('0x1a')](_0xbb7dbb);}return null;};}function patchUpdates(_0x18cd04){return function(_0x5c91ac){try{jsonpatch[_0x51d5('0x21')](_0x5c91ac,_0x18cd04,!![]);}catch(_0x2e1fb5){return BPromise['reject'](_0x2e1fb5);}return _0x5c91ac[_0x51d5('0x22')]();};}function saveUpdates(_0x41d9e6,_0x4d5145){return function(_0x3244f8){if(_0x3244f8){return _0x3244f8[_0x51d5('0x23')](_0x41d9e6)[_0x51d5('0x24')](function(_0x3c117d){return _0x3c117d;});}return null;};}function removeEntity(_0x4effcf,_0x42a97b){return function(_0x123bc8){if(_0x123bc8){return _0x123bc8['destroy']()[_0x51d5('0x24')](function(){_0x4effcf[_0x51d5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33fcfe,_0x3e3081){return function(_0x5694b1){if(!_0x5694b1){_0x33fcfe[_0x51d5('0x18')](0x194);}return _0x5694b1;};}function handleError(_0x87afde,_0x22b933){_0x22b933=_0x22b933||0x1f4;return function(_0x34e943){logger[_0x51d5('0x25')](_0x34e943[_0x51d5('0x26')]);if(_0x34e943[_0x51d5('0x27')]){delete _0x34e943['name'];}_0x87afde['status'](_0x22b933)[_0x51d5('0x28')](_0x34e943);};}exports['index']=function(_0x2646ae,_0x30a1d2){var _0x41b58c={},_0x2b6ade={},_0x1e689a={'count':0x0,'rows':[]};var _0x2d8c91=_[_0x51d5('0x29')](db[_0x51d5('0x2a')][_0x51d5('0x2b')],function(_0x435cf4){return{'name':_0x435cf4[_0x51d5('0x2c')],'type':_0x435cf4['type'][_0x51d5('0x2d')]};});_0x2b6ade[_0x51d5('0x2e')]=_[_0x51d5('0x29')](_0x2d8c91,_0x51d5('0x27'));_0x2b6ade[_0x51d5('0x2f')]=_[_0x51d5('0x30')](_0x2646ae[_0x51d5('0x2f')]);_0x2b6ade['filters']=_[_0x51d5('0x31')](_0x2b6ade['model'],_0x2b6ade[_0x51d5('0x2f')]);_0x41b58c[_0x51d5('0x32')]=_[_0x51d5('0x31')](_0x2b6ade[_0x51d5('0x2e')],qs[_0x51d5('0x33')](_0x2646ae[_0x51d5('0x2f')][_0x51d5('0x33')]));_0x41b58c[_0x51d5('0x32')]=_0x41b58c['attributes'][_0x51d5('0x34')]?_0x41b58c[_0x51d5('0x32')]:_0x2b6ade[_0x51d5('0x2e')];if(!_0x2646ae['query'][_0x51d5('0x35')](_0x51d5('0x36'))){_0x41b58c[_0x51d5('0x1d')]=qs['limit'](_0x2646ae[_0x51d5('0x2f')][_0x51d5('0x1d')]);_0x41b58c['offset']=qs[_0x51d5('0x1b')](_0x2646ae[_0x51d5('0x2f')][_0x51d5('0x1b')]);}_0x41b58c['order']=qs[_0x51d5('0x37')](_0x2646ae[_0x51d5('0x2f')][_0x51d5('0x37')]);_0x41b58c['where']=qs[_0x51d5('0x38')](_['pick'](_0x2646ae[_0x51d5('0x2f')],_0x2b6ade['filters']),_0x2d8c91);if(_0x2646ae['query'][_0x51d5('0x39')]){_0x41b58c[_0x51d5('0x3a')]=_[_0x51d5('0x3b')](_0x41b58c[_0x51d5('0x3a')],{'$or':_[_0x51d5('0x29')](_0x2d8c91,function(_0x449af3){if(_0x449af3[_0x51d5('0x3c')]!==_0x51d5('0x3d')){var _0x7bc579={};_0x7bc579[_0x449af3['name']]={'$like':'%'+_0x2646ae['query'][_0x51d5('0x39')]+'%'};return _0x7bc579;}})});}_0x41b58c=_[_0x51d5('0x3b')]({},_0x41b58c,_0x2646ae[_0x51d5('0x3e')]);var _0x195b5f={'where':_0x41b58c[_0x51d5('0x3a')]};return db[_0x51d5('0x2a')]['count'](_0x195b5f)[_0x51d5('0x24')](function(_0x5ccaa1){_0x1e689a['count']=_0x5ccaa1;if(_0x2646ae[_0x51d5('0x2f')][_0x51d5('0x3f')]){_0x41b58c['include']=[{'all':!![]}];}return db[_0x51d5('0x2a')][_0x51d5('0x40')](_0x41b58c);})[_0x51d5('0x24')](function(_0x1ca85){_0x1e689a['rows']=_0x1ca85;return _0x1e689a;})[_0x51d5('0x24')](respondWithFilteredResult(_0x30a1d2,_0x41b58c))[_0x51d5('0x41')](handleError(_0x30a1d2,null));};exports[_0x51d5('0x42')]=function(_0xc03a62,_0xf2d1e0){var _0x473ad4={'raw':!![],'where':{'id':_0xc03a62[_0x51d5('0x43')]['id']}},_0x444b86={};_0x444b86[_0x51d5('0x2e')]=_[_0x51d5('0x30')](db['OpenchannelTransferReport'][_0x51d5('0x2b')]);_0x444b86[_0x51d5('0x2f')]=_['keys'](_0xc03a62[_0x51d5('0x2f')]);_0x444b86[_0x51d5('0x38')]=_[_0x51d5('0x31')](_0x444b86[_0x51d5('0x2e')],_0x444b86[_0x51d5('0x2f')]);_0x473ad4[_0x51d5('0x32')]=_[_0x51d5('0x31')](_0x444b86['model'],qs[_0x51d5('0x33')](_0xc03a62[_0x51d5('0x2f')][_0x51d5('0x33')]));_0x473ad4[_0x51d5('0x32')]=_0x473ad4[_0x51d5('0x32')][_0x51d5('0x34')]?_0x473ad4[_0x51d5('0x32')]:_0x444b86[_0x51d5('0x2e')];if(_0xc03a62[_0x51d5('0x2f')]['includeAll']){_0x473ad4[_0x51d5('0x44')]=[{'all':!![]}];}_0x473ad4=_['merge']({},_0x473ad4,_0xc03a62[_0x51d5('0x3e')]);return db[_0x51d5('0x2a')][_0x51d5('0x45')](_0x473ad4)[_0x51d5('0x24')](handleEntityNotFound(_0xf2d1e0,null))[_0x51d5('0x24')](respondWithResult(_0xf2d1e0,null))['catch'](handleError(_0xf2d1e0,null));};exports[_0x51d5('0x46')]=function(_0x1eeb03,_0x1fa204){return db[_0x51d5('0x2a')][_0x51d5('0x46')](_0x1eeb03[_0x51d5('0x47')],{})[_0x51d5('0x24')](respondWithResult(_0x1fa204,0xc9))['catch'](handleError(_0x1fa204,null));};exports[_0x51d5('0x23')]=function(_0x3e59f2,_0x127152){if(_0x3e59f2[_0x51d5('0x47')]['id']){delete _0x3e59f2[_0x51d5('0x47')]['id'];}return db[_0x51d5('0x2a')][_0x51d5('0x45')]({'where':{'id':_0x3e59f2[_0x51d5('0x43')]['id']}})[_0x51d5('0x24')](handleEntityNotFound(_0x127152,null))[_0x51d5('0x24')](saveUpdates(_0x3e59f2[_0x51d5('0x47')],null))[_0x51d5('0x24')](respondWithResult(_0x127152,null))[_0x51d5('0x41')](handleError(_0x127152,null));};exports[_0x51d5('0x48')]=function(_0x2fab7d,_0x18a45b){return db['OpenchannelTransferReport'][_0x51d5('0x45')]({'where':{'id':_0x2fab7d[_0x51d5('0x43')]['id']}})[_0x51d5('0x24')](handleEntityNotFound(_0x18a45b,null))[_0x51d5('0x24')](removeEntity(_0x18a45b,null))['catch'](handleError(_0x18a45b,null));};exports[_0x51d5('0x49')]=function(_0x25f7a4,_0x2b81c0){return db['OpenchannelTransferReport'][_0x51d5('0x49')]()[_0x51d5('0x24')](respondWithResult(_0x2b81c0,null))['catch'](handleError(_0x2b81c0,null));}; \ No newline at end of file +var _0x8548=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','findAll','catch','params','keys','includeAll','include','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x809c1f,_0x5e77aa){var _0x9fa32d=function(_0x4cb735){while(--_0x4cb735){_0x809c1f['push'](_0x809c1f['shift']());}};_0x9fa32d(++_0x5e77aa);}(_0x8548,0x82));var _0x8854=function(_0x9acace,_0x4175a4){_0x9acace=_0x9acace-0x0;var _0x119d3f=_0x8548[_0x9acace];return _0x119d3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8854('0x0'));var zipdir=require(_0x8854('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8854('0x2'));var moment=require(_0x8854('0x3'));var BPromise=require(_0x8854('0x4'));var Mustache=require(_0x8854('0x5'));var util=require('util');var path=require(_0x8854('0x6'));var sox=require(_0x8854('0x7'));var csv=require('to-csv');var ejs=require(_0x8854('0x8'));var fs=require('fs');var fs_extra=require(_0x8854('0x9'));var _=require(_0x8854('0xa'));var squel=require(_0x8854('0xb'));var crypto=require(_0x8854('0xc'));var jsforce=require(_0x8854('0xd'));var deskjs=require(_0x8854('0xe'));var toCsv=require(_0x8854('0xf'));var querystring=require('querystring');var Papa=require(_0x8854('0x10'));var Redis=require(_0x8854('0x11'));var authService=require(_0x8854('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8854('0x13'));var hardwareService=require(_0x8854('0x14'));var logger=require('../../config/logger')(_0x8854('0x15'));var utils=require(_0x8854('0x16'));var config=require(_0x8854('0x17'));var licenseUtil=require(_0x8854('0x18'));var db=require(_0x8854('0x19'))['db'];function respondWithStatusCode(_0xf5a929,_0x510487){_0x510487=_0x510487||0xcc;return function(_0x2f9bb0){if(_0x2f9bb0){return _0xf5a929[_0x8854('0x1a')](_0x510487);}return _0xf5a929[_0x8854('0x1b')](_0x510487)[_0x8854('0x1c')]();};}function respondWithResult(_0x496168,_0x444d0a){_0x444d0a=_0x444d0a||0xc8;return function(_0x51249e){if(_0x51249e){return _0x496168[_0x8854('0x1b')](_0x444d0a)[_0x8854('0x1d')](_0x51249e);}};}function respondWithFilteredResult(_0x5ccbf7,_0x4c6d01){return function(_0x592a54){if(_0x592a54){var _0x52b040=typeof _0x4c6d01[_0x8854('0x1e')]===_0x8854('0x1f')&&typeof _0x4c6d01[_0x8854('0x20')]===_0x8854('0x1f');var _0x503afa=_0x592a54[_0x8854('0x21')];var _0xf0aac7=_0x52b040?0x0:_0x4c6d01[_0x8854('0x1e')];var _0x56bc11=_0x52b040?_0x592a54[_0x8854('0x21')]:_0x4c6d01[_0x8854('0x1e')]+_0x4c6d01['limit'];var _0x133474;if(_0x56bc11>=_0x503afa){_0x56bc11=_0x503afa;_0x133474=0xc8;}else{_0x133474=0xce;}_0x5ccbf7[_0x8854('0x1b')](_0x133474);return _0x5ccbf7[_0x8854('0x22')]('Content-Range',_0xf0aac7+'-'+_0x56bc11+'/'+_0x503afa)[_0x8854('0x1d')](_0x592a54);}return null;};}function patchUpdates(_0x122667){return function(_0x532085){try{jsonpatch['apply'](_0x532085,_0x122667,!![]);}catch(_0x1780f4){return BPromise['reject'](_0x1780f4);}return _0x532085[_0x8854('0x23')]();};}function saveUpdates(_0x16e251,_0x1e6001){return function(_0x500370){if(_0x500370){return _0x500370[_0x8854('0x24')](_0x16e251)[_0x8854('0x25')](function(_0x49612c){return _0x49612c;});}return null;};}function removeEntity(_0x336d80,_0x41665d){return function(_0x2deddd){if(_0x2deddd){return _0x2deddd[_0x8854('0x26')]()[_0x8854('0x25')](function(){_0x336d80[_0x8854('0x1b')](0xcc)[_0x8854('0x1c')]();});}};}function handleEntityNotFound(_0x45ac73,_0x471f4e){return function(_0x58fc47){if(!_0x58fc47){_0x45ac73[_0x8854('0x1a')](0x194);}return _0x58fc47;};}function handleError(_0x49d3c2,_0x52075a){_0x52075a=_0x52075a||0x1f4;return function(_0x23591e){logger[_0x8854('0x27')](_0x23591e[_0x8854('0x28')]);if(_0x23591e[_0x8854('0x29')]){delete _0x23591e['name'];}_0x49d3c2['status'](_0x52075a)[_0x8854('0x2a')](_0x23591e);};}exports[_0x8854('0x2b')]=function(_0x3dfb0b,_0x11386d){var _0x2d64d5={},_0x231e47={},_0x49cd94={'count':0x0,'rows':[]};var _0x38ca21=_[_0x8854('0x2c')](db['OpenchannelTransferReport'][_0x8854('0x2d')],function(_0x435c4a){return{'name':_0x435c4a[_0x8854('0x2e')],'type':_0x435c4a[_0x8854('0x2f')][_0x8854('0x30')]};});_0x231e47[_0x8854('0x31')]=_['map'](_0x38ca21,_0x8854('0x29'));_0x231e47[_0x8854('0x32')]=_['keys'](_0x3dfb0b[_0x8854('0x32')]);_0x231e47[_0x8854('0x33')]=_[_0x8854('0x34')](_0x231e47[_0x8854('0x31')],_0x231e47[_0x8854('0x32')]);_0x2d64d5['attributes']=_['intersection'](_0x231e47[_0x8854('0x31')],qs[_0x8854('0x35')](_0x3dfb0b[_0x8854('0x32')][_0x8854('0x35')]));_0x2d64d5[_0x8854('0x36')]=_0x2d64d5[_0x8854('0x36')][_0x8854('0x37')]?_0x2d64d5[_0x8854('0x36')]:_0x231e47[_0x8854('0x31')];if(!_0x3dfb0b[_0x8854('0x32')][_0x8854('0x38')](_0x8854('0x39'))){_0x2d64d5[_0x8854('0x20')]=qs[_0x8854('0x20')](_0x3dfb0b[_0x8854('0x32')][_0x8854('0x20')]);_0x2d64d5[_0x8854('0x1e')]=qs[_0x8854('0x1e')](_0x3dfb0b['query'][_0x8854('0x1e')]);}_0x2d64d5[_0x8854('0x3a')]=qs[_0x8854('0x3b')](_0x3dfb0b[_0x8854('0x32')][_0x8854('0x3b')]);_0x2d64d5[_0x8854('0x3c')]=qs[_0x8854('0x33')](_[_0x8854('0x3d')](_0x3dfb0b[_0x8854('0x32')],_0x231e47['filters']),_0x38ca21);if(_0x3dfb0b['query'][_0x8854('0x3e')]){_0x2d64d5[_0x8854('0x3c')]=_[_0x8854('0x3f')](_0x2d64d5['where'],{'$or':_[_0x8854('0x2c')](_0x38ca21,function(_0x2922f8){if(_0x2922f8[_0x8854('0x2f')]!==_0x8854('0x40')){var _0x5c1f13={};_0x5c1f13[_0x2922f8[_0x8854('0x29')]]={'$like':'%'+_0x3dfb0b[_0x8854('0x32')][_0x8854('0x3e')]+'%'};return _0x5c1f13;}})});}_0x2d64d5=_[_0x8854('0x3f')]({},_0x2d64d5,_0x3dfb0b[_0x8854('0x41')]);var _0x4e77cf={'where':_0x2d64d5[_0x8854('0x3c')]};return db[_0x8854('0x42')][_0x8854('0x21')](_0x4e77cf)[_0x8854('0x25')](function(_0x5657e5){_0x49cd94[_0x8854('0x21')]=_0x5657e5;if(_0x3dfb0b[_0x8854('0x32')]['includeAll']){_0x2d64d5['include']=[{'all':!![]}];}return db[_0x8854('0x42')][_0x8854('0x43')](_0x2d64d5);})['then'](function(_0x2e3a64){_0x49cd94['rows']=_0x2e3a64;return _0x49cd94;})[_0x8854('0x25')](respondWithFilteredResult(_0x11386d,_0x2d64d5))[_0x8854('0x44')](handleError(_0x11386d,null));};exports['show']=function(_0x59dfe8,_0x490362){var _0x41bdb7={'raw':!![],'where':{'id':_0x59dfe8[_0x8854('0x45')]['id']}},_0x242d2f={};_0x242d2f[_0x8854('0x31')]=_[_0x8854('0x46')](db[_0x8854('0x42')]['rawAttributes']);_0x242d2f[_0x8854('0x32')]=_[_0x8854('0x46')](_0x59dfe8[_0x8854('0x32')]);_0x242d2f['filters']=_['intersection'](_0x242d2f[_0x8854('0x31')],_0x242d2f[_0x8854('0x32')]);_0x41bdb7[_0x8854('0x36')]=_[_0x8854('0x34')](_0x242d2f[_0x8854('0x31')],qs[_0x8854('0x35')](_0x59dfe8[_0x8854('0x32')][_0x8854('0x35')]));_0x41bdb7['attributes']=_0x41bdb7[_0x8854('0x36')][_0x8854('0x37')]?_0x41bdb7['attributes']:_0x242d2f[_0x8854('0x31')];if(_0x59dfe8['query'][_0x8854('0x47')]){_0x41bdb7[_0x8854('0x48')]=[{'all':!![]}];}_0x41bdb7=_[_0x8854('0x3f')]({},_0x41bdb7,_0x59dfe8[_0x8854('0x41')]);return db[_0x8854('0x42')][_0x8854('0x49')](_0x41bdb7)[_0x8854('0x25')](handleEntityNotFound(_0x490362,null))[_0x8854('0x25')](respondWithResult(_0x490362,null))[_0x8854('0x44')](handleError(_0x490362,null));};exports[_0x8854('0x4a')]=function(_0x463861,_0x2a6d85){return db['OpenchannelTransferReport'][_0x8854('0x4a')](_0x463861[_0x8854('0x4b')],{})['then'](respondWithResult(_0x2a6d85,0xc9))[_0x8854('0x44')](handleError(_0x2a6d85,null));};exports[_0x8854('0x24')]=function(_0x579020,_0x20a94f){if(_0x579020[_0x8854('0x4b')]['id']){delete _0x579020[_0x8854('0x4b')]['id'];}return db[_0x8854('0x42')]['find']({'where':{'id':_0x579020[_0x8854('0x45')]['id']}})['then'](handleEntityNotFound(_0x20a94f,null))['then'](saveUpdates(_0x579020['body'],null))[_0x8854('0x25')](respondWithResult(_0x20a94f,null))[_0x8854('0x44')](handleError(_0x20a94f,null));};exports['destroy']=function(_0x441adf,_0x2a83c1){return db[_0x8854('0x42')][_0x8854('0x49')]({'where':{'id':_0x441adf[_0x8854('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a83c1,null))[_0x8854('0x25')](removeEntity(_0x2a83c1,null))['catch'](handleError(_0x2a83c1,null));};exports[_0x8854('0x4c')]=function(_0x4c7ac2,_0x42f78a){return db[_0x8854('0x42')][_0x8854('0x4c')]()[_0x8854('0x25')](respondWithResult(_0x42f78a,null))[_0x8854('0x44')](handleError(_0x42f78a,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 6ff9a30..a3576ab 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 _0x58bd=['path','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x11fac2,_0x27ea5){var _0x4d6b0e=function(_0x31ea0d){while(--_0x31ea0d){_0x11fac2['push'](_0x11fac2['shift']());}};_0x4d6b0e(++_0x27ea5);}(_0x58bd,0x192));var _0xd58b=function(_0x2b1693,_0x4ac1ff){_0x2b1693=_0x2b1693-0x0;var _0x2bbda7=_0x58bd[_0x2b1693];return _0x2bbda7;};'use strict';var _=require(_0xd58b('0x0'));var util=require('util');var logger=require(_0xd58b('0x1'))(_0xd58b('0x2'));var moment=require('moment');var BPromise=require(_0xd58b('0x3'));var rp=require(_0xd58b('0x4'));var fs=require('fs');var path=require(_0xd58b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd58b('0x6'));module[_0xd58b('0x7')]=function(_0x2d42ae,_0x2b0693){return _0x2d42ae[_0xd58b('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0xd58b('0x9'),'paranoid':![],'indexes':[{'name':_0xd58b('0xa'),'fields':[_0xd58b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x506a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x506a,0x1a1));var _0xa506=function(_0x4237ae,_0x35ce07){_0x4237ae=_0x4237ae-0x0;var _0x9f6254=_0x506a[_0x4237ae];return _0x9f6254;};'use strict';var _=require(_0xa506('0x0'));var util=require(_0xa506('0x1'));var logger=require(_0xa506('0x2'))(_0xa506('0x3'));var moment=require(_0xa506('0x4'));var BPromise=require(_0xa506('0x5'));var rp=require(_0xa506('0x6'));var fs=require('fs');var path=require(_0xa506('0x7'));var rimraf=require(_0xa506('0x8'));var config=require(_0xa506('0x9'));var attributes=require(_0xa506('0xa'));module[_0xa506('0xb')]=function(_0x29874c,_0x195270){return _0x29874c[_0xa506('0xc')](_0xa506('0xd'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa506('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index f5a3ffe..828aef7 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 _0x723e=['OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x2106be,_0x1bea82){var _0x224fcb=function(_0x145166){while(--_0x145166){_0x2106be['push'](_0x2106be['shift']());}};_0x224fcb(++_0x1bea82);}(_0x723e,0x179));var _0xe723=function(_0x45493c,_0x39478b){_0x45493c=_0x45493c-0x0;var _0xe89240=_0x723e[_0x45493c];return _0xe89240;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var moment=require(_0xe723('0x1'));var BPromise=require(_0xe723('0x2'));var rs=require(_0xe723('0x3'));var fs=require('fs');var Redis=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];var utils=require(_0xe723('0x6'));var logger=require(_0xe723('0x7'))(_0xe723('0x8'));var config=require(_0xe723('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe723('0xa')][_0xe723('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1335cd,_0x3bf082,_0x2aebbd){return new BPromise(function(_0xe50f7,_0x1b46e0){return client[_0xe723('0xc')](_0x1335cd,_0x2aebbd)['then'](function(_0x380444){logger[_0xe723('0xd')](_0xe723('0xe'),_0x3bf082,'request\x20sent');logger[_0xe723('0xf')](_0xe723('0x10'),_0x3bf082,_0xe723('0x11'),JSON['stringify'](_0x380444));if(_0x380444[_0xe723('0x12')]){if(_0x380444[_0xe723('0x12')][_0xe723('0x13')]===0x1f4){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x380444['error'][_0xe723('0x14')]);return _0x1b46e0(_0x380444['error']['message']);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3bf082,_0x380444[_0xe723('0x12')][_0xe723('0x14')]);return _0xe50f7(_0x380444[_0xe723('0x12')][_0xe723('0x14')]);}else{logger[_0xe723('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3bf082,_0xe723('0x11'));_0xe50f7(_0x380444[_0xe723('0x15')][_0xe723('0x14')]);}})[_0xe723('0x16')](function(_0x347fa0){logger[_0xe723('0x12')](_0xe723('0xe'),_0x3bf082,_0x347fa0);_0x1b46e0(_0x347fa0);});});} \ No newline at end of file +var _0xd9ef=['OpenchannelTransferReport,\x20%s,\x20%s','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd9ef,0x95));var _0xfd9e=function(_0x33ff23,_0x2e2f0a){_0x33ff23=_0x33ff23-0x0;var _0xce614=_0xd9ef[_0x33ff23];return _0xce614;};'use strict';var _=require(_0xfd9e('0x0'));var util=require(_0xfd9e('0x1'));var moment=require('moment');var BPromise=require(_0xfd9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd9e('0x3'));var logger=require(_0xfd9e('0x4'))(_0xfd9e('0x5'));var config=require(_0xfd9e('0x6'));var jayson=require(_0xfd9e('0x7'));var client=jayson[_0xfd9e('0x8')][_0xfd9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c3dec,_0x261826,_0x302795){return new BPromise(function(_0xb61585,_0x1f35c7){return client[_0xfd9e('0xa')](_0x3c3dec,_0x302795)['then'](function(_0xd8d6bc){logger[_0xfd9e('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x261826,_0xfd9e('0xc'));logger[_0xfd9e('0xd')](_0xfd9e('0xe'),_0x261826,'request\x20sent',JSON[_0xfd9e('0xf')](_0xd8d6bc));if(_0xd8d6bc[_0xfd9e('0x10')]){if(_0xd8d6bc[_0xfd9e('0x10')][_0xfd9e('0x11')]===0x1f4){logger[_0xfd9e('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x261826,_0xd8d6bc[_0xfd9e('0x10')][_0xfd9e('0x12')]);return _0x1f35c7(_0xd8d6bc[_0xfd9e('0x10')][_0xfd9e('0x12')]);}logger[_0xfd9e('0x10')](_0xfd9e('0x13'),_0x261826,_0xd8d6bc[_0xfd9e('0x10')][_0xfd9e('0x12')]);return _0xb61585(_0xd8d6bc[_0xfd9e('0x10')][_0xfd9e('0x12')]);}else{logger['info'](_0xfd9e('0x13'),_0x261826,'request\x20sent');_0xb61585(_0xd8d6bc['result'][_0xfd9e('0x12')]);}})[_0xfd9e('0x14')](function(_0x144372){logger['error'](_0xfd9e('0x13'),_0x261826,_0x144372);_0x1f35c7(_0x144372);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 9f4714d..a0834c1 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 _0x5b5f=['../../components/auth/service','../../config/environment','./pause.controller','isAuthenticated','/:id','post','put','delete','destroy','path','connect-timeout','express','fs-extra'];(function(_0x137152,_0x3cc794){var _0xbf32cc=function(_0x3868be){while(--_0x3868be){_0x137152['push'](_0x137152['shift']());}};_0xbf32cc(++_0x3cc794);}(_0x5b5f,0xd9));var _0xf5b5=function(_0x5b984b,_0x355e68){_0x5b984b=_0x5b984b-0x0;var _0x52e07d=_0x5b5f[_0x5b984b];return _0x52e07d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf5b5('0x0'));var timeout=require(_0xf5b5('0x1'));var express=require(_0xf5b5('0x2'));var router=express['Router']();var fs_extra=require(_0xf5b5('0x3'));var auth=require(_0xf5b5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf5b5('0x5'));var controller=require(_0xf5b5('0x6'));router['get']('/',auth[_0xf5b5('0x7')](),controller['index']);router['get'](_0xf5b5('0x8'),auth[_0xf5b5('0x7')](),controller['show']);router[_0xf5b5('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf5b5('0xa')](_0xf5b5('0x8'),auth[_0xf5b5('0x7')](),controller['update']);router[_0xf5b5('0xb')]('/:id',auth[_0xf5b5('0x7')](),controller[_0xf5b5('0xc')]);module['exports']=router; \ No newline at end of file +var _0x0738=['./pause.controller','isAuthenticated','index','get','show','create','put','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc441b5,_0xa58567){var _0x4f5e7c=function(_0x4ea6ea){while(--_0x4ea6ea){_0xc441b5['push'](_0xc441b5['shift']());}};_0x4f5e7c(++_0xa58567);}(_0x0738,0x186));var _0x8073=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0x0738[_0x1b6311];return _0x25aab6;};'use strict';var multer=require(_0x8073('0x0'));var util=require(_0x8073('0x1'));var path=require('path');var timeout=require(_0x8073('0x2'));var express=require(_0x8073('0x3'));var router=express[_0x8073('0x4')]();var fs_extra=require(_0x8073('0x5'));var auth=require(_0x8073('0x6'));var interaction=require(_0x8073('0x7'));var config=require(_0x8073('0x8'));var controller=require(_0x8073('0x9'));router['get']('/',auth[_0x8073('0xa')](),controller[_0x8073('0xb')]);router[_0x8073('0xc')]('/:id',auth[_0x8073('0xa')](),controller[_0x8073('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8073('0xe')]);router[_0x8073('0xf')](_0x8073('0x10'),auth[_0x8073('0xa')](),controller['update']);router[_0x8073('0x11')](_0x8073('0x10'),auth[_0x8073('0xa')](),controller['destroy']);module[_0x8073('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 6405216..7cb025c 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 _0x8774=['STRING','sequelize'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x8774,0x16f));var _0x4877=function(_0xe8e487,_0x1dde8a){_0xe8e487=_0xe8e487-0x0;var _0xfbc9bf=_0x8774[_0xe8e487];return _0xfbc9bf;};'use strict';var Sequelize=require(_0x4877('0x0'));module['exports']={'name':{'type':Sequelize[_0x4877('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4877('0x1')]}}; \ No newline at end of file +var _0xd272=['name','exports','STRING'];(function(_0x116115,_0x3a301b){var _0x2a31cc=function(_0x8022b0){while(--_0x8022b0){_0x116115['push'](_0x116115['shift']());}};_0x2a31cc(++_0x3a301b);}(_0xd272,0x1b4));var _0x2d27=function(_0x1f3c6d,_0x5887b8){_0x1f3c6d=_0x1f3c6d-0x0;var _0x1760aa=_0xd272[_0x1f3c6d];return _0x1760aa;};'use strict';var Sequelize=require('sequelize');module[_0x2d27('0x0')]={'name':{'type':Sequelize[_0x2d27('0x1')],'unique':_0x2d27('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c76da5e..00e3555 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 _0xa604=['role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','stack','name','index','map','rawAttributes','type','key','model','query','filters','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','Pause','includeAll','include','findAll','rows','catch','show','params','keys','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xf264b9,_0xfd2d89){var _0x257b29=function(_0x1fd237){while(--_0x1fd237){_0xf264b9['push'](_0xf264b9['shift']());}};_0x257b29(++_0xfd2d89);}(_0xa604,0x18d));var _0x4a60=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa604[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a60('0x0'));var zipdir=require(_0x4a60('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a60('0x2'));var moment=require(_0x4a60('0x3'));var BPromise=require(_0x4a60('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a60('0x5'));var sox=require(_0x4a60('0x6'));var csv=require(_0x4a60('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a60('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4a60('0x9'));var deskjs=require(_0x4a60('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a60('0xb'));var Redis=require(_0x4a60('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4a60('0xd'));var as=require(_0x4a60('0xe'));var hardwareService=require(_0x4a60('0xf'));var logger=require('../../config/logger')(_0x4a60('0x10'));var utils=require(_0x4a60('0x11'));var config=require(_0x4a60('0x12'));var licenseUtil=require(_0x4a60('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32da77,_0x5d5d57){_0x5d5d57=_0x5d5d57||0xcc;return function(_0x49e534){if(_0x49e534){return _0x32da77[_0x4a60('0x14')](_0x5d5d57);}return _0x32da77[_0x4a60('0x15')](_0x5d5d57)[_0x4a60('0x16')]();};}function respondWithResult(_0x167517,_0x2f219f){_0x2f219f=_0x2f219f||0xc8;return function(_0x1ee501){if(_0x1ee501){return _0x167517[_0x4a60('0x15')](_0x2f219f)[_0x4a60('0x17')](_0x1ee501);}};}function respondWithFilteredResult(_0x51c21f,_0x47e464){return function(_0x2fe9de){if(_0x2fe9de){var _0x5de4b4=typeof _0x47e464[_0x4a60('0x18')]===_0x4a60('0x19')&&typeof _0x47e464[_0x4a60('0x1a')]===_0x4a60('0x19');var _0x15939d=_0x2fe9de[_0x4a60('0x1b')];var _0x1eab5f=_0x5de4b4?0x0:_0x47e464[_0x4a60('0x18')];var _0x2d1773=_0x5de4b4?_0x2fe9de['count']:_0x47e464[_0x4a60('0x18')]+_0x47e464[_0x4a60('0x1a')];var _0x2d4fca;if(_0x2d1773>=_0x15939d){_0x2d1773=_0x15939d;_0x2d4fca=0xc8;}else{_0x2d4fca=0xce;}_0x51c21f[_0x4a60('0x15')](_0x2d4fca);return _0x51c21f[_0x4a60('0x1c')]('Content-Range',_0x1eab5f+'-'+_0x2d1773+'/'+_0x15939d)[_0x4a60('0x17')](_0x2fe9de);}return null;};}function patchUpdates(_0x37f1e8){return function(_0x2ef66a){try{jsonpatch[_0x4a60('0x1d')](_0x2ef66a,_0x37f1e8,!![]);}catch(_0x575535){return BPromise[_0x4a60('0x1e')](_0x575535);}return _0x2ef66a[_0x4a60('0x1f')]();};}function saveUpdates(_0x313207,_0x574fff){return function(_0x3bf734){if(_0x3bf734){return _0x3bf734[_0x4a60('0x20')](_0x313207)[_0x4a60('0x21')](function(_0x5481ac){return _0x5481ac;});}return null;};}function removeEntity(_0x530b6b,_0x19db69){return function(_0x5031a8){if(_0x5031a8){return _0x5031a8[_0x4a60('0x22')]()['then'](function(){var _0x5f4162=_0x5031a8[_0x4a60('0x23')]({'plain':!![]});var _0x443f3f=_0x4a60('0x24');return db[_0x4a60('0x25')]['destroy']({'where':{'type':_0x443f3f,'resourceId':_0x5f4162['id']}})[_0x4a60('0x21')](function(){return _0x5031a8;});})[_0x4a60('0x21')](function(){_0x530b6b[_0x4a60('0x15')](0xcc)[_0x4a60('0x16')]();});}};}function handleEntityNotFound(_0x22f525,_0xa90d66){return function(_0x442336){if(!_0x442336){_0x22f525[_0x4a60('0x14')](0x194);}return _0x442336;};}function handleError(_0x1115a8,_0xebe4){_0xebe4=_0xebe4||0x1f4;return function(_0x3df2b6){logger['error'](_0x3df2b6[_0x4a60('0x26')]);if(_0x3df2b6[_0x4a60('0x27')]){delete _0x3df2b6['name'];}_0x1115a8[_0x4a60('0x15')](_0xebe4)['send'](_0x3df2b6);};}exports[_0x4a60('0x28')]=function(_0x2107c8,_0x53882e){var _0x268117={},_0x355bbb={},_0x8b175b={'count':0x0,'rows':[]};var _0x235f86=_[_0x4a60('0x29')](db['Pause'][_0x4a60('0x2a')],function(_0x31c86b){return{'name':_0x31c86b['fieldName'],'type':_0x31c86b[_0x4a60('0x2b')][_0x4a60('0x2c')]};});_0x355bbb[_0x4a60('0x2d')]=_[_0x4a60('0x29')](_0x235f86,_0x4a60('0x27'));_0x355bbb['query']=_['keys'](_0x2107c8[_0x4a60('0x2e')]);_0x355bbb[_0x4a60('0x2f')]=_['intersection'](_0x355bbb[_0x4a60('0x2d')],_0x355bbb['query']);_0x268117['attributes']=_['intersection'](_0x355bbb[_0x4a60('0x2d')],qs[_0x4a60('0x30')](_0x2107c8[_0x4a60('0x2e')]['fields']));_0x268117['attributes']=_0x268117[_0x4a60('0x31')]['length']?_0x268117[_0x4a60('0x31')]:_0x355bbb['model'];if(!_0x2107c8[_0x4a60('0x2e')][_0x4a60('0x32')]('nolimit')){_0x268117[_0x4a60('0x1a')]=qs[_0x4a60('0x1a')](_0x2107c8[_0x4a60('0x2e')]['limit']);_0x268117[_0x4a60('0x18')]=qs[_0x4a60('0x18')](_0x2107c8['query']['offset']);}_0x268117['order']=qs[_0x4a60('0x33')](_0x2107c8[_0x4a60('0x2e')][_0x4a60('0x33')]);_0x268117[_0x4a60('0x34')]=qs[_0x4a60('0x2f')](_['pick'](_0x2107c8[_0x4a60('0x2e')],_0x355bbb[_0x4a60('0x2f')]),_0x235f86);if(_0x2107c8[_0x4a60('0x2e')][_0x4a60('0x35')]){_0x268117[_0x4a60('0x34')]=_[_0x4a60('0x36')](_0x268117[_0x4a60('0x34')],{'$or':_['map'](_0x235f86,function(_0x44b18f){if(_0x44b18f[_0x4a60('0x2b')]!==_0x4a60('0x37')){var _0x1029b9={};_0x1029b9[_0x44b18f[_0x4a60('0x27')]]={'$like':'%'+_0x2107c8[_0x4a60('0x2e')][_0x4a60('0x35')]+'%'};return _0x1029b9;}})});}_0x268117=_[_0x4a60('0x36')]({},_0x268117,_0x2107c8[_0x4a60('0x38')]);var _0x3fa8c7={'where':_0x268117[_0x4a60('0x34')]};return db[_0x4a60('0x39')][_0x4a60('0x1b')](_0x3fa8c7)[_0x4a60('0x21')](function(_0x10a8b8){_0x8b175b[_0x4a60('0x1b')]=_0x10a8b8;if(_0x2107c8['query'][_0x4a60('0x3a')]){_0x268117[_0x4a60('0x3b')]=[{'all':!![]}];}return db[_0x4a60('0x39')][_0x4a60('0x3c')](_0x268117);})[_0x4a60('0x21')](function(_0x31e0a7){_0x8b175b[_0x4a60('0x3d')]=_0x31e0a7;return _0x8b175b;})[_0x4a60('0x21')](respondWithFilteredResult(_0x53882e,_0x268117))[_0x4a60('0x3e')](handleError(_0x53882e,null));};exports[_0x4a60('0x3f')]=function(_0x3c8d4a,_0x269017){var _0x104c86={'raw':!![],'where':{'id':_0x3c8d4a[_0x4a60('0x40')]['id']}},_0x468571={};_0x468571[_0x4a60('0x2d')]=_[_0x4a60('0x41')](db[_0x4a60('0x39')]['rawAttributes']);_0x468571['query']=_[_0x4a60('0x41')](_0x3c8d4a[_0x4a60('0x2e')]);_0x468571[_0x4a60('0x2f')]=_[_0x4a60('0x42')](_0x468571[_0x4a60('0x2d')],_0x468571[_0x4a60('0x2e')]);_0x104c86[_0x4a60('0x31')]=_[_0x4a60('0x42')](_0x468571[_0x4a60('0x2d')],qs[_0x4a60('0x30')](_0x3c8d4a[_0x4a60('0x2e')][_0x4a60('0x30')]));_0x104c86[_0x4a60('0x31')]=_0x104c86[_0x4a60('0x31')]['length']?_0x104c86[_0x4a60('0x31')]:_0x468571['model'];if(_0x3c8d4a[_0x4a60('0x2e')][_0x4a60('0x3a')]){_0x104c86[_0x4a60('0x3b')]=[{'all':!![]}];}_0x104c86=_[_0x4a60('0x36')]({},_0x104c86,_0x3c8d4a[_0x4a60('0x38')]);return db['Pause']['find'](_0x104c86)['then'](handleEntityNotFound(_0x269017,null))[_0x4a60('0x21')](respondWithResult(_0x269017,null))['catch'](handleError(_0x269017,null));};exports[_0x4a60('0x43')]=function(_0x26c512,_0x186336){return db[_0x4a60('0x39')]['create'](_0x26c512[_0x4a60('0x44')],{})[_0x4a60('0x21')](function(_0x5b99af){var _0xc79ba8=_0x26c512[_0x4a60('0x45')][_0x4a60('0x23')]({'plain':!![]});if(!_0xc79ba8)throw new Error(_0x4a60('0x46'));if(_0xc79ba8[_0x4a60('0x47')]==='user'){var _0xbd122a=_0x5b99af['get']({'plain':!![]});var _0x32be44=_0x4a60('0x24');return db[_0x4a60('0x48')]['find']({'where':{'name':_0x32be44,'userProfileId':_0xc79ba8[_0x4a60('0x49')]},'raw':!![]})[_0x4a60('0x21')](function(_0x2f8526){if(_0x2f8526&&_0x2f8526[_0x4a60('0x4a')]===0x0){return db[_0x4a60('0x25')][_0x4a60('0x43')]({'name':_0xbd122a['name'],'resourceId':_0xbd122a['id'],'type':_0x2f8526[_0x4a60('0x27')],'sectionId':_0x2f8526['id']},{})['then'](function(){return _0x5b99af;});}else{return _0x5b99af;}})[_0x4a60('0x3e')](function(_0x52de75){logger[_0x4a60('0x4b')](_0x4a60('0x4c'),_0x52de75);throw _0x52de75;});}return _0x5b99af;})[_0x4a60('0x21')](respondWithResult(_0x186336,0xc9))[_0x4a60('0x3e')](handleError(_0x186336,null));};exports[_0x4a60('0x20')]=function(_0x22515f,_0x41a761){if(_0x22515f[_0x4a60('0x44')]['id']){delete _0x22515f[_0x4a60('0x44')]['id'];}return db['Pause'][_0x4a60('0x4d')]({'where':{'id':_0x22515f[_0x4a60('0x40')]['id']}})['then'](handleEntityNotFound(_0x41a761,null))[_0x4a60('0x21')](saveUpdates(_0x22515f[_0x4a60('0x44')],null))[_0x4a60('0x21')](respondWithResult(_0x41a761,null))['catch'](handleError(_0x41a761,null));};exports[_0x4a60('0x22')]=function(_0x285696,_0x5bb649){return db['Pause'][_0x4a60('0x4d')]({'where':{'id':_0x285696['params']['id']}})[_0x4a60('0x21')](handleEntityNotFound(_0x5bb649,null))['then'](removeEntity(_0x5bb649,null))[_0x4a60('0x3e')](handleError(_0x5bb649,null));}; \ No newline at end of file +var _0x092b=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Pauses','UserProfileResource','then','end','name','send','index','map','Pause','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x33e232,_0x45748e){var _0x14b761=function(_0x276ff5){while(--_0x276ff5){_0x33e232['push'](_0x33e232['shift']());}};_0x14b761(++_0x45748e);}(_0x092b,0xe2));var _0xb092=function(_0x47c830,_0x3eeb7e){_0x47c830=_0x47c830-0x0;var _0x289284=_0x092b[_0x47c830];return _0x289284;};'use strict';var emlformat=require(_0xb092('0x0'));var rimraf=require(_0xb092('0x1'));var zipdir=require(_0xb092('0x2'));var jsonpatch=require(_0xb092('0x3'));var rp=require('request-promise');var moment=require(_0xb092('0x4'));var BPromise=require(_0xb092('0x5'));var Mustache=require(_0xb092('0x6'));var util=require(_0xb092('0x7'));var path=require(_0xb092('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb092('0x9'));var squel=require(_0xb092('0xa'));var crypto=require(_0xb092('0xb'));var jsforce=require(_0xb092('0xc'));var deskjs=require(_0xb092('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb092('0xe'));var Papa=require(_0xb092('0xf'));var Redis=require(_0xb092('0x10'));var authService=require(_0xb092('0x11'));var qs=require(_0xb092('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb092('0x13'));var logger=require(_0xb092('0x14'))(_0xb092('0x15'));var utils=require(_0xb092('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb092('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x456ec0,_0x362616){_0x362616=_0x362616||0xcc;return function(_0x2ff0b7){if(_0x2ff0b7){return _0x456ec0[_0xb092('0x18')](_0x362616);}return _0x456ec0['status'](_0x362616)['end']();};}function respondWithResult(_0x1f20b5,_0x1201e6){_0x1201e6=_0x1201e6||0xc8;return function(_0x21b892){if(_0x21b892){return _0x1f20b5[_0xb092('0x19')](_0x1201e6)['json'](_0x21b892);}};}function respondWithFilteredResult(_0x4569a8,_0x2a5677){return function(_0x3da433){if(_0x3da433){var _0x124e74=typeof _0x2a5677[_0xb092('0x1a')]==='undefined'&&typeof _0x2a5677[_0xb092('0x1b')]==='undefined';var _0x2f295e=_0x3da433[_0xb092('0x1c')];var _0x591f80=_0x124e74?0x0:_0x2a5677[_0xb092('0x1a')];var _0x4011ab=_0x124e74?_0x3da433[_0xb092('0x1c')]:_0x2a5677[_0xb092('0x1a')]+_0x2a5677[_0xb092('0x1b')];var _0x54b9c7;if(_0x4011ab>=_0x2f295e){_0x4011ab=_0x2f295e;_0x54b9c7=0xc8;}else{_0x54b9c7=0xce;}_0x4569a8[_0xb092('0x19')](_0x54b9c7);return _0x4569a8[_0xb092('0x1d')](_0xb092('0x1e'),_0x591f80+'-'+_0x4011ab+'/'+_0x2f295e)['json'](_0x3da433);}return null;};}function patchUpdates(_0x1fb6f5){return function(_0x1d9169){try{jsonpatch[_0xb092('0x1f')](_0x1d9169,_0x1fb6f5,!![]);}catch(_0x1d0480){return BPromise[_0xb092('0x20')](_0x1d0480);}return _0x1d9169[_0xb092('0x21')]();};}function saveUpdates(_0x52da28,_0x50d989){return function(_0x31c6a0){if(_0x31c6a0){return _0x31c6a0[_0xb092('0x22')](_0x52da28)['then'](function(_0x3ba3f6){return _0x3ba3f6;});}return null;};}function removeEntity(_0x5eac58,_0x2fa477){return function(_0x182d98){if(_0x182d98){return _0x182d98[_0xb092('0x23')]()['then'](function(){var _0x152a34=_0x182d98[_0xb092('0x24')]({'plain':!![]});var _0x1dcf01=_0xb092('0x25');return db[_0xb092('0x26')][_0xb092('0x23')]({'where':{'type':_0x1dcf01,'resourceId':_0x152a34['id']}})[_0xb092('0x27')](function(){return _0x182d98;});})[_0xb092('0x27')](function(){_0x5eac58[_0xb092('0x19')](0xcc)[_0xb092('0x28')]();});}};}function handleEntityNotFound(_0x15753c,_0x1846d5){return function(_0x5dd1af){if(!_0x5dd1af){_0x15753c[_0xb092('0x18')](0x194);}return _0x5dd1af;};}function handleError(_0x4329bd,_0x548d30){_0x548d30=_0x548d30||0x1f4;return function(_0x2bd032){logger['error'](_0x2bd032['stack']);if(_0x2bd032[_0xb092('0x29')]){delete _0x2bd032[_0xb092('0x29')];}_0x4329bd[_0xb092('0x19')](_0x548d30)[_0xb092('0x2a')](_0x2bd032);};}exports[_0xb092('0x2b')]=function(_0x5e2fb1,_0x1806e2){var _0x2b86ac={},_0x386838={},_0x43caec={'count':0x0,'rows':[]};var _0x2a4f8c=_[_0xb092('0x2c')](db[_0xb092('0x2d')][_0xb092('0x2e')],function(_0x8f639d){return{'name':_0x8f639d[_0xb092('0x2f')],'type':_0x8f639d['type'][_0xb092('0x30')]};});_0x386838[_0xb092('0x31')]=_[_0xb092('0x2c')](_0x2a4f8c,_0xb092('0x29'));_0x386838['query']=_[_0xb092('0x32')](_0x5e2fb1[_0xb092('0x33')]);_0x386838[_0xb092('0x34')]=_[_0xb092('0x35')](_0x386838[_0xb092('0x31')],_0x386838['query']);_0x2b86ac[_0xb092('0x36')]=_[_0xb092('0x35')](_0x386838[_0xb092('0x31')],qs[_0xb092('0x37')](_0x5e2fb1[_0xb092('0x33')][_0xb092('0x37')]));_0x2b86ac['attributes']=_0x2b86ac[_0xb092('0x36')][_0xb092('0x38')]?_0x2b86ac[_0xb092('0x36')]:_0x386838[_0xb092('0x31')];if(!_0x5e2fb1[_0xb092('0x33')][_0xb092('0x39')](_0xb092('0x3a'))){_0x2b86ac['limit']=qs[_0xb092('0x1b')](_0x5e2fb1[_0xb092('0x33')]['limit']);_0x2b86ac[_0xb092('0x1a')]=qs['offset'](_0x5e2fb1['query'][_0xb092('0x1a')]);}_0x2b86ac[_0xb092('0x3b')]=qs[_0xb092('0x3c')](_0x5e2fb1['query']['sort']);_0x2b86ac['where']=qs[_0xb092('0x34')](_[_0xb092('0x3d')](_0x5e2fb1[_0xb092('0x33')],_0x386838['filters']),_0x2a4f8c);if(_0x5e2fb1[_0xb092('0x33')][_0xb092('0x3e')]){_0x2b86ac['where']=_['merge'](_0x2b86ac[_0xb092('0x3f')],{'$or':_[_0xb092('0x2c')](_0x2a4f8c,function(_0xc7c239){if(_0xc7c239[_0xb092('0x40')]!==_0xb092('0x41')){var _0x59889c={};_0x59889c[_0xc7c239['name']]={'$like':'%'+_0x5e2fb1['query'][_0xb092('0x3e')]+'%'};return _0x59889c;}})});}_0x2b86ac=_[_0xb092('0x42')]({},_0x2b86ac,_0x5e2fb1[_0xb092('0x43')]);var _0x27c7f6={'where':_0x2b86ac[_0xb092('0x3f')]};return db[_0xb092('0x2d')][_0xb092('0x1c')](_0x27c7f6)[_0xb092('0x27')](function(_0x3050c6){_0x43caec[_0xb092('0x1c')]=_0x3050c6;if(_0x5e2fb1[_0xb092('0x33')][_0xb092('0x44')]){_0x2b86ac[_0xb092('0x45')]=[{'all':!![]}];}return db[_0xb092('0x2d')]['findAll'](_0x2b86ac);})['then'](function(_0x4e1363){_0x43caec[_0xb092('0x46')]=_0x4e1363;return _0x43caec;})[_0xb092('0x27')](respondWithFilteredResult(_0x1806e2,_0x2b86ac))[_0xb092('0x47')](handleError(_0x1806e2,null));};exports['show']=function(_0x33d54,_0xd3c325){var _0x55daf1={'raw':!![],'where':{'id':_0x33d54[_0xb092('0x48')]['id']}},_0x439ba3={};_0x439ba3[_0xb092('0x31')]=_[_0xb092('0x32')](db[_0xb092('0x2d')][_0xb092('0x2e')]);_0x439ba3[_0xb092('0x33')]=_[_0xb092('0x32')](_0x33d54['query']);_0x439ba3['filters']=_['intersection'](_0x439ba3[_0xb092('0x31')],_0x439ba3[_0xb092('0x33')]);_0x55daf1['attributes']=_['intersection'](_0x439ba3[_0xb092('0x31')],qs[_0xb092('0x37')](_0x33d54[_0xb092('0x33')][_0xb092('0x37')]));_0x55daf1[_0xb092('0x36')]=_0x55daf1[_0xb092('0x36')]['length']?_0x55daf1[_0xb092('0x36')]:_0x439ba3[_0xb092('0x31')];if(_0x33d54[_0xb092('0x33')]['includeAll']){_0x55daf1['include']=[{'all':!![]}];}_0x55daf1=_[_0xb092('0x42')]({},_0x55daf1,_0x33d54[_0xb092('0x43')]);return db[_0xb092('0x2d')]['find'](_0x55daf1)[_0xb092('0x27')](handleEntityNotFound(_0xd3c325,null))['then'](respondWithResult(_0xd3c325,null))[_0xb092('0x47')](handleError(_0xd3c325,null));};exports['create']=function(_0x1d885b,_0x47b241){return db[_0xb092('0x2d')][_0xb092('0x49')](_0x1d885b['body'],{})[_0xb092('0x27')](function(_0x3b7192){var _0x32d7b8=_0x1d885b[_0xb092('0x4a')]['get']({'plain':!![]});if(!_0x32d7b8)throw new Error(_0xb092('0x4b'));if(_0x32d7b8[_0xb092('0x4c')]===_0xb092('0x4a')){var _0x184a5b=_0x3b7192[_0xb092('0x24')]({'plain':!![]});var _0x37096c='Pauses';return db[_0xb092('0x4d')][_0xb092('0x4e')]({'where':{'name':_0x37096c,'userProfileId':_0x32d7b8[_0xb092('0x4f')]},'raw':!![]})[_0xb092('0x27')](function(_0xc62a00){if(_0xc62a00&&_0xc62a00['autoAssociation']===0x0){return db[_0xb092('0x26')][_0xb092('0x49')]({'name':_0x184a5b[_0xb092('0x29')],'resourceId':_0x184a5b['id'],'type':_0xc62a00['name'],'sectionId':_0xc62a00['id']},{})[_0xb092('0x27')](function(){return _0x3b7192;});}else{return _0x3b7192;}})[_0xb092('0x47')](function(_0x3ea494){logger[_0xb092('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ea494);throw _0x3ea494;});}return _0x3b7192;})[_0xb092('0x27')](respondWithResult(_0x47b241,0xc9))['catch'](handleError(_0x47b241,null));};exports[_0xb092('0x22')]=function(_0x193864,_0x1965c1){if(_0x193864['body']['id']){delete _0x193864[_0xb092('0x51')]['id'];}return db[_0xb092('0x2d')][_0xb092('0x4e')]({'where':{'id':_0x193864['params']['id']}})[_0xb092('0x27')](handleEntityNotFound(_0x1965c1,null))[_0xb092('0x27')](saveUpdates(_0x193864[_0xb092('0x51')],null))[_0xb092('0x27')](respondWithResult(_0x1965c1,null))[_0xb092('0x47')](handleError(_0x1965c1,null));};exports[_0xb092('0x23')]=function(_0x36e7ab,_0x3c029d){return db[_0xb092('0x2d')][_0xb092('0x4e')]({'where':{'id':_0x36e7ab['params']['id']}})[_0xb092('0x27')](handleEntityNotFound(_0x3c029d,null))[_0xb092('0x27')](removeEntity(_0x3c029d,null))['catch'](handleError(_0x3c029d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 45ad0ad..738f3f2 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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x7217,0x19e));var _0x7721=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7217[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x5cb807,_0x737e4f){var _0x32d6d8=function(_0x30f120){while(--_0x30f120){_0x5cb807['push'](_0x5cb807['shift']());}};_0x32d6d8(++_0x737e4f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x5fc3[_0x3f94f9];return _0x46f84f;};'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')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'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 b4e788a..514d509 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x16aa74,_0x6388fb){var _0x5e3a2c=function(_0x11bdbc){while(--_0x11bdbc){_0x16aa74['push'](_0x16aa74['shift']());}};_0x5e3a2c(++_0x6388fb);}(_0x7a54,0x106));var _0x47a5=function(_0x1d69de,_0x26c848){_0x1d69de=_0x1d69de-0x0;var _0x37d779=_0x7a54[_0x1d69de];return _0x37d779;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x4fc347,_0x5c7381){var _0x28f75e=function(_0x45ebb1){while(--_0x45ebb1){_0x4fc347['push'](_0x4fc347['shift']());}};_0x28f75e(++_0x5c7381);}(_0xb10b,0x12a));var _0xbb10=function(_0x11fd35,_0x259295){_0x11fd35=_0x11fd35-0x0;var _0x3792de=_0xb10b[_0x11fd35];return _0x3792de;};'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 a889c04..b07556d 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 _0xf3cd=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update'];(function(_0xafd1b2,_0x4af81d){var _0x4d8be2=function(_0x52a7ef){while(--_0x52a7ef){_0xafd1b2['push'](_0xafd1b2['shift']());}};_0x4d8be2(++_0x4af81d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xf3cd[_0x34bc6c];return _0x168820;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf3c('0x6'));var interaction=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var controller=require('./plugin.controller');router[_0xdf3c('0x9')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xb')]);router[_0xdf3c('0x9')](_0xdf3c('0xc'),controller[_0xdf3c('0xd')]);router['get'](_0xdf3c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xdf3c('0x9')](_0xdf3c('0xf'),auth['isAuthenticated'](),controller[_0xdf3c('0x10')]);var upload=multer({'storage':multer[_0xdf3c('0x11')]({'destination':function(_0x2d420c,_0x21a6e5,_0x3a3154){_0x3a3154(null,path[_0xdf3c('0x12')](config[_0xdf3c('0x13')],_0xdf3c('0x14')));},'filename':function(_0x5e8925,_0x1d483c,_0x166ae5){_0x1d483c[_0xdf3c('0x15')]=_0x1d483c[_0xdf3c('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x166ae5(null,util[_0xdf3c('0x16')](_0xdf3c('0x17'),path[_0xdf3c('0x18')](_0x1d483c['originalname'],path[_0xdf3c('0x19')](_0x1d483c[_0xdf3c('0x15')])),Date[_0xdf3c('0x1a')](),path[_0xdf3c('0x19')](_0x1d483c[_0xdf3c('0x15')])));}})});router[_0xdf3c('0x1b')]('/',upload[_0xdf3c('0x1c')](_0xdf3c('0x1d')),controller[_0xdf3c('0x1e')]);router[_0xdf3c('0x1b')]('/webhook',controller[_0xdf3c('0x1f')]);router[_0xdf3c('0x20')](_0xdf3c('0xe'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x21')]);router[_0xdf3c('0x22')](_0xdf3c('0xe'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x22')]);module[_0xdf3c('0x23')]=router; \ No newline at end of file +var _0xd2ea=['./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','diskStorage','root','server/files/plugins','originalname','replace','extname','now','post','single','file','upload','webhookPost','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4bbdb1,_0x5af48c){_0x4bbdb1=_0x4bbdb1-0x0;var _0x44c313=_0xd2ea[_0x4bbdb1];return _0x44c313;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),controller[_0xad2e('0xd')]);router['get'](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['show']);router[_0xad2e('0xa')]('/:id/download',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);var upload=multer({'storage':multer[_0xad2e('0x10')]({'destination':function(_0x24c5da,_0x489f25,_0x7df3c6){_0x7df3c6(null,path['join'](config[_0xad2e('0x11')],_0xad2e('0x12')));},'filename':function(_0x433696,_0x42e2f2,_0x59a342){_0x42e2f2[_0xad2e('0x13')]=_0x42e2f2['originalname'][_0xad2e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59a342(null,util['format']('%s-%s%s',path['basename'](_0x42e2f2['originalname'],path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])),Date[_0xad2e('0x16')](),path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])));}})});router[_0xad2e('0x17')]('/',upload[_0xad2e('0x18')](_0xad2e('0x19')),controller[_0xad2e('0x1a')]);router[_0xad2e('0x17')](_0xad2e('0xc'),controller[_0xad2e('0x1b')]);router[_0xad2e('0x1c')](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['update']);router[_0xad2e('0x1d')](_0xad2e('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index a56c596..c044fac 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 _0x491c=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM','script'];(function(_0x222734,_0x1b0508){var _0x42e99f=function(_0x40516b){while(--_0x40516b){_0x222734['push'](_0x222734['shift']());}};_0x42e99f(++_0x1b0508);}(_0x491c,0x1f1));var _0xc491=function(_0x95f829,_0x8fdf08){_0x95f829=_0x95f829-0x0;var _0x2de524=_0x491c[_0x95f829];return _0x2de524;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc491('0x0')]},'type':{'type':Sequelize[_0xc491('0x1')]('html',_0xc491('0x2'))},'description':{'type':Sequelize[_0xc491('0x3')]},'version':{'type':Sequelize[_0xc491('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0xc491('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc491('0x5')},'sidebar':{'type':Sequelize[_0xc491('0x1')](_0xc491('0x6'),_0xc491('0x7'),'always',_0xc491('0x8')),'defaultValue':'always','comment':_0xc491('0x9')},'icon':{'type':Sequelize[_0xc491('0x0')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xc491('0x0')]},'scriptName':{'type':Sequelize[_0xc491('0x0')]},'scriptPath':{'type':Sequelize[_0xc491('0x0')]}}; \ No newline at end of file +var _0xad63=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0x4ce9e6,_0x255059){var _0x1db19b=function(_0x2ebc3f){while(--_0x2ebc3f){_0x4ce9e6['push'](_0x4ce9e6['shift']());}};_0x1db19b(++_0x255059);}(_0xad63,0x163));var _0x3ad6=function(_0x1d8e12,_0x3a1e9a){_0x1d8e12=_0x1d8e12-0x0;var _0x16d168=_0xad63[_0x1d8e12];return _0x16d168;};'use strict';var Sequelize=require('sequelize');module[_0x3ad6('0x0')]={'name':{'type':Sequelize[_0x3ad6('0x1')]},'type':{'type':Sequelize[_0x3ad6('0x2')](_0x3ad6('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x3ad6('0x4')]},'path':{'type':Sequelize[_0x3ad6('0x1')],'comment':_0x3ad6('0x5')},'active':{'type':Sequelize[_0x3ad6('0x6')],'defaultValue':0x0,'comment':_0x3ad6('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x3ad6('0x8'),_0x3ad6('0x9'),_0x3ad6('0xa'),_0x3ad6('0xb')),'defaultValue':_0x3ad6('0xa'),'comment':_0x3ad6('0xc')},'icon':{'type':Sequelize[_0x3ad6('0x1')]},'adminUrl':{'type':Sequelize[_0x3ad6('0x1')]},'agentUrl':{'type':Sequelize[_0x3ad6('0x1')]},'scriptName':{'type':Sequelize[_0x3ad6('0x1')]},'scriptPath':{'type':Sequelize[_0x3ad6('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index cbc8dc9..0842682 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 _0x17df=['unlinkSync','info','Download\x20completed','upload','file','filename','extname','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','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','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','Warning:\x20admin\x20view\x20not\x20specified','agent','test','plugins','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','eml-format','rimraf','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','extract-zip','archiver','../../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','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','get','Plugins','UserProfileResource','stack','name','map','Plugin','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','download','find','path','join','root','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','error','pipe','attachments/**/*','close','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin'];(function(_0x129797,_0x2c2af1){var _0x48c9f1=function(_0x40a5f3){while(--_0x40a5f3){_0x129797['push'](_0x129797['shift']());}};_0x48c9f1(++_0x2c2af1);}(_0x17df,0x19d));var _0xf17d=function(_0x30f1e2,_0x369232){_0x30f1e2=_0x30f1e2-0x0;var _0x3dd7ae=_0x17df[_0x30f1e2];return _0x3dd7ae;};'use strict';var emlformat=require(_0xf17d('0x0'));var rimraf=require(_0xf17d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf17d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf17d('0x3'));var util=require(_0xf17d('0x4'));var path=require('path');var sox=require(_0xf17d('0x5'));var csv=require(_0xf17d('0x6'));var ejs=require(_0xf17d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf17d('0x8'));var squel=require('squel');var crypto=require(_0xf17d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf17d('0x6'));var querystring=require(_0xf17d('0xa'));var Papa=require(_0xf17d('0xb'));var extract=require(_0xf17d('0xc'));var rimraf=require(_0xf17d('0x1'));var archiver=require(_0xf17d('0xd'));var Redis=require('ioredis');var authService=require(_0xf17d('0xe'));var qs=require(_0xf17d('0xf'));var as=require(_0xf17d('0x10'));var hardwareService=require(_0xf17d('0x11'));var logger=require(_0xf17d('0x12'))(_0xf17d('0x13'));var utils=require(_0xf17d('0x14'));var config=require(_0xf17d('0x15'));var licenseUtil=require(_0xf17d('0x16'));var db=require(_0xf17d('0x17'))['db'];config['redis']=_[_0xf17d('0x18')](config[_0xf17d('0x19')],{'host':_0xf17d('0x1a'),'port':0x18eb});var socket=require(_0xf17d('0x1b'))(new Redis(config[_0xf17d('0x19')]));require(_0xf17d('0x1c'))[_0xf17d('0x1d')](socket);function respondWithStatusCode(_0x1be262,_0x20815e){_0x20815e=_0x20815e||0xcc;return function(_0x40f3b5){if(_0x40f3b5){return _0x1be262[_0xf17d('0x1e')](_0x20815e);}return _0x1be262[_0xf17d('0x1f')](_0x20815e)[_0xf17d('0x20')]();};}function respondWithResult(_0x36d496,_0x4256db){_0x4256db=_0x4256db||0xc8;return function(_0x5f4ae4){if(_0x5f4ae4){return _0x36d496[_0xf17d('0x1f')](_0x4256db)[_0xf17d('0x21')](_0x5f4ae4);}};}function respondWithFilteredResult(_0x3d41c8,_0x5331c1){return function(_0x5783e4){if(_0x5783e4){var _0x1749fd=typeof _0x5331c1[_0xf17d('0x22')]==='undefined'&&typeof _0x5331c1['limit']===_0xf17d('0x23');var _0x7796cb=_0x5783e4[_0xf17d('0x24')];var _0x34d3a6=_0x1749fd?0x0:_0x5331c1['offset'];var _0x423502=_0x1749fd?_0x5783e4[_0xf17d('0x24')]:_0x5331c1['offset']+_0x5331c1[_0xf17d('0x25')];var _0x33fa03;if(_0x423502>=_0x7796cb){_0x423502=_0x7796cb;_0x33fa03=0xc8;}else{_0x33fa03=0xce;}_0x3d41c8[_0xf17d('0x1f')](_0x33fa03);return _0x3d41c8['set'](_0xf17d('0x26'),_0x34d3a6+'-'+_0x423502+'/'+_0x7796cb)[_0xf17d('0x21')](_0x5783e4);}return null;};}function patchUpdates(_0x1ffe9a){return function(_0xbb1874){try{jsonpatch[_0xf17d('0x27')](_0xbb1874,_0x1ffe9a,!![]);}catch(_0x2ed186){return BPromise[_0xf17d('0x28')](_0x2ed186);}return _0xbb1874['save']();};}function saveUpdates(_0x199696,_0x277684){return function(_0x58fd64){if(_0x58fd64){return _0x58fd64['update'](_0x199696)[_0xf17d('0x29')](function(_0xdbbc4c){return _0xdbbc4c;});}return null;};}function removeEntity(_0x26fbbd,_0x383d98){return function(_0x84f074){if(_0x84f074){return _0x84f074[_0xf17d('0x2a')]()['then'](function(){var _0x6c794c=_0x84f074[_0xf17d('0x2b')]({'plain':!![]});var _0x5ae70f=_0xf17d('0x2c');return db[_0xf17d('0x2d')][_0xf17d('0x2a')]({'where':{'type':_0x5ae70f,'resourceId':_0x6c794c['id']}})[_0xf17d('0x29')](function(){return _0x84f074;});})['then'](function(){_0x26fbbd[_0xf17d('0x1f')](0xcc)[_0xf17d('0x20')]();});}};}function handleEntityNotFound(_0x404eaf,_0x5ef97d){return function(_0x6b4c5a){if(!_0x6b4c5a){_0x404eaf['sendStatus'](0x194);}return _0x6b4c5a;};}function handleError(_0x5b9e11,_0x20c52b){_0x20c52b=_0x20c52b||0x1f4;return function(_0x20f9d1){logger['error'](_0x20f9d1[_0xf17d('0x2e')]);if(_0x20f9d1[_0xf17d('0x2f')]){delete _0x20f9d1[_0xf17d('0x2f')];}_0x5b9e11['status'](_0x20c52b)['send'](_0x20f9d1);};}exports['index']=function(_0x52b06c,_0x2e8b33){var _0x358a92={},_0xe6749b={},_0x3debbd={'count':0x0,'rows':[]};var _0x5ae14f=_[_0xf17d('0x30')](db[_0xf17d('0x31')][_0xf17d('0x32')],function(_0x2f915c){return{'name':_0x2f915c[_0xf17d('0x33')],'type':_0x2f915c[_0xf17d('0x34')]['key']};});_0xe6749b[_0xf17d('0x35')]=_['map'](_0x5ae14f,_0xf17d('0x2f'));_0xe6749b['query']=_[_0xf17d('0x36')](_0x52b06c[_0xf17d('0x37')]);_0xe6749b[_0xf17d('0x38')]=_['intersection'](_0xe6749b['model'],_0xe6749b[_0xf17d('0x37')]);_0x358a92[_0xf17d('0x39')]=_[_0xf17d('0x3a')](_0xe6749b[_0xf17d('0x35')],qs['fields'](_0x52b06c[_0xf17d('0x37')][_0xf17d('0x3b')]));_0x358a92['attributes']=_0x358a92['attributes'][_0xf17d('0x3c')]?_0x358a92[_0xf17d('0x39')]:_0xe6749b[_0xf17d('0x35')];if(!_0x52b06c['query'][_0xf17d('0x3d')]('nolimit')){_0x358a92[_0xf17d('0x25')]=qs[_0xf17d('0x25')](_0x52b06c[_0xf17d('0x37')]['limit']);_0x358a92[_0xf17d('0x22')]=qs[_0xf17d('0x22')](_0x52b06c[_0xf17d('0x37')]['offset']);}_0x358a92[_0xf17d('0x3e')]=qs['sort'](_0x52b06c['query'][_0xf17d('0x3f')]);_0x358a92['where']=qs[_0xf17d('0x38')](_[_0xf17d('0x40')](_0x52b06c[_0xf17d('0x37')],_0xe6749b[_0xf17d('0x38')]),_0x5ae14f);if(_0x52b06c[_0xf17d('0x37')]['filter']){_0x358a92['where']=_['merge'](_0x358a92[_0xf17d('0x41')],{'$or':_[_0xf17d('0x30')](_0x5ae14f,function(_0xb20792){if(_0xb20792[_0xf17d('0x34')]!==_0xf17d('0x42')){var _0x308a82={};_0x308a82[_0xb20792[_0xf17d('0x2f')]]={'$like':'%'+_0x52b06c['query'][_0xf17d('0x43')]+'%'};return _0x308a82;}})});}_0x358a92=_[_0xf17d('0x44')]({},_0x358a92,_0x52b06c['options']);var _0x3914a1={'where':_0x358a92['where']};return db[_0xf17d('0x31')][_0xf17d('0x24')](_0x3914a1)[_0xf17d('0x29')](function(_0x47ba04){_0x3debbd['count']=_0x47ba04;if(_0x52b06c[_0xf17d('0x37')][_0xf17d('0x45')]){_0x358a92[_0xf17d('0x46')]=[{'all':!![]}];}return db[_0xf17d('0x31')][_0xf17d('0x47')](_0x358a92);})[_0xf17d('0x29')](function(_0x7a6b4c){_0x3debbd[_0xf17d('0x48')]=_0x7a6b4c;return _0x3debbd;})[_0xf17d('0x29')](respondWithFilteredResult(_0x2e8b33,_0x358a92))[_0xf17d('0x49')](handleError(_0x2e8b33,null));};exports[_0xf17d('0x4a')]=function(_0x39c6e4,_0x50b397){var _0x1d65df={'raw':!![],'where':{'id':_0x39c6e4[_0xf17d('0x4b')]['id']}},_0x1089fe={};_0x1089fe['model']=_[_0xf17d('0x36')](db['Plugin'][_0xf17d('0x32')]);_0x1089fe[_0xf17d('0x37')]=_[_0xf17d('0x36')](_0x39c6e4[_0xf17d('0x37')]);_0x1089fe[_0xf17d('0x38')]=_[_0xf17d('0x3a')](_0x1089fe[_0xf17d('0x35')],_0x1089fe[_0xf17d('0x37')]);_0x1d65df[_0xf17d('0x39')]=_['intersection'](_0x1089fe[_0xf17d('0x35')],qs[_0xf17d('0x3b')](_0x39c6e4[_0xf17d('0x37')]['fields']));_0x1d65df[_0xf17d('0x39')]=_0x1d65df[_0xf17d('0x39')][_0xf17d('0x3c')]?_0x1d65df[_0xf17d('0x39')]:_0x1089fe[_0xf17d('0x35')];if(_0x39c6e4[_0xf17d('0x37')]['includeAll']){_0x1d65df['include']=[{'all':!![]}];}_0x1d65df=_[_0xf17d('0x44')]({},_0x1d65df,_0x39c6e4[_0xf17d('0x4c')]);return db[_0xf17d('0x31')]['find'](_0x1d65df)[_0xf17d('0x29')](handleEntityNotFound(_0x50b397,null))['then'](respondWithResult(_0x50b397,null))['catch'](handleError(_0x50b397,null));};exports[_0xf17d('0x4d')]=function(_0x113cd4,_0x4fb43e,_0x3c7127){return db['Plugin'][_0xf17d('0x4e')]({'where':{'id':_0x113cd4[_0xf17d('0x4b')]['id']},'attributes':[_0xf17d('0x2f'),_0xf17d('0x4f')],'raw':!![]})[_0xf17d('0x29')](handleEntityNotFound(_0x4fb43e,null))[_0xf17d('0x29')](function(_0x5d646b){if(_0x5d646b){var _0x57f7e0=path[_0xf17d('0x50')](config[_0xf17d('0x51')],'server/files/plugins',util['format'](_0xf17d('0x52'),path[_0xf17d('0x53')](_0x5d646b[_0xf17d('0x4f')])));var _0x129392=fs[_0xf17d('0x54')](_0x57f7e0);var _0x10d74=archiver(_0xf17d('0x55'),{'zlib':{'level':0x9}});_0x10d74['on'](_0xf17d('0x56'),function(_0x5843a1){if(_0x5843a1[_0xf17d('0x57')]==='ENOENT'){logger['error'](_0x5843a1);}else{throw new db[(_0xf17d('0x58'))][(_0xf17d('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x10d74['on'](_0xf17d('0x5a'),function(_0x3aa265){throw new db['Sequelize'][(_0xf17d('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x10d74[_0xf17d('0x5b')](_0x129392);_0x10d74['glob']('**/*',{'cwd':path['join'](config[_0xf17d('0x51')],'server/files/plugins',path['dirname'](_0x5d646b['path'])),'ignore':[path[_0xf17d('0x50')](path[_0xf17d('0x53')](_0x5d646b['path']),'node_modules/**/*'),path['join'](path[_0xf17d('0x53')](_0x5d646b['path']),_0xf17d('0x5c'))],'nodir':!![]})['finalize']();_0x129392['on'](_0xf17d('0x5d'),function(){if(!fs['existsSync'](_0x57f7e0)){throw new db[(_0xf17d('0x58'))][(_0xf17d('0x59'))](_0xf17d('0x5e'));}return _0x4fb43e[_0xf17d('0x4d')](_0x57f7e0,util[_0xf17d('0x5f')]('%s.zip',path[_0xf17d('0x53')](_0x5d646b[_0xf17d('0x4f')])),function(_0x5cd8d4){if(_0x5cd8d4){throw new db[(_0xf17d('0x58'))][(_0xf17d('0x59'))](_0xf17d('0x60'));}fs[_0xf17d('0x61')](_0x57f7e0);logger[_0xf17d('0x62')](_0xf17d('0x63'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x4fb43e,null));};exports[_0xf17d('0x64')]=function(_0x2c2d18,_0x34b5b0,_0x3a858d){var _0x1999a4=path[_0xf17d('0x53')](_0x2c2d18[_0xf17d('0x65')][_0xf17d('0x66')],path[_0xf17d('0x67')](_0x2c2d18[_0xf17d('0x65')][_0xf17d('0x66')]));var _0x41d627=path[_0xf17d('0x50')](config['root'],_0xf17d('0x68'),_0x2c2d18['file'][_0xf17d('0x66')]);var _0x522b4d=path[_0xf17d('0x50')](config['root'],_0xf17d('0x68'),_0x1999a4);logger[_0xf17d('0x62')](_0xf17d('0x69'),_0x41d627);logger[_0xf17d('0x62')]('Plugin\x20upload\x20destination:\x20%s',_0x522b4d);try{fs[_0xf17d('0x6a')](_0x41d627,parseInt(_0xf17d('0x6b'),0x8));extract(_0x41d627,{'dir':_0x522b4d},function(_0x8feae9){if(_0x8feae9){logger[_0xf17d('0x5a')](_0x8feae9);handleError(_0x8feae9,!![]);};var _0x5cc6cb=fs[_0xf17d('0x6c')](_0x522b4d);if(_0x5cc6cb['length']>0x1){removeReferences(_0x41d627,_0x522b4d);logger[_0xf17d('0x5a')](_0xf17d('0x6d'));return _0x3a858d(new Error(_0xf17d('0x6d')));}var _0x2879a0=fs['lstatSync'](path[_0xf17d('0x50')](_0x522b4d,_0x5cc6cb[0x0]));if(_0x2879a0[_0xf17d('0x6e')]()){removeReferences(_0x41d627,_0x522b4d);logger[_0xf17d('0x5a')]('Invalid\x20plugin\x20structure');return _0x3a858d(new Error(_0xf17d('0x6d')));}if(_0x2879a0[_0xf17d('0x6f')]()){var _0x5465ed=fs[_0xf17d('0x6c')](path[_0xf17d('0x50')](_0x522b4d,_0x5cc6cb[0x0]));if(_0x5465ed['length']===0x0){removeReferences(_0x41d627,_0x522b4d);logger['error']('Invalid\x20plugin\x20structure');return _0x3a858d(new Error(_0xf17d('0x6d')));}var _0x8c8873=_0x5465ed[_0xf17d('0x70')](function(_0x44e3c7){return _0x44e3c7===_0xf17d('0x71');});if(!_0x8c8873){return _0x3a858d(new Error(_0xf17d('0x72')));}var _0x5e7aca=fs[_0xf17d('0x73')](path[_0xf17d('0x50')](_0x522b4d,_0x5cc6cb[0x0],_0xf17d('0x71')));var _0x2f69ad=JSON[_0xf17d('0x74')](_0x5e7aca);if(_0xf17d('0x23')==typeof _0x2f69ad[_0xf17d('0x2f')]){return _0x3a858d(new Error(_0xf17d('0x75')));}if('undefined'==typeof _0x2f69ad[_0xf17d('0x34')]){return _0x3a858d(new Error(_0xf17d('0x76')));}if(_0xf17d('0x23')==typeof _0x2f69ad[_0xf17d('0x77')]){return _0x3a858d(new Error(_0xf17d('0x78')));}if(_0xf17d('0x23')==typeof _0x2f69ad[_0xf17d('0x79')]){return _0x3a858d(new Error(_0xf17d('0x7a')));}if(_0x2f69ad[_0xf17d('0x34')]===_0xf17d('0x7b')){if(_0xf17d('0x23')==typeof _0x2f69ad['parameters'][_0xf17d('0x7c')]){return _0x3a858d(new Error(_0xf17d('0x7d')));}if(_0xf17d('0x23')==typeof _0x2f69ad[_0xf17d('0x79')]['views'][_0xf17d('0x7e')]&&_0xf17d('0x23')==typeof _0x2f69ad['parameters'][_0xf17d('0x7c')]['agent']){return _0x3a858d(new Error(_0xf17d('0x7f')));}}else if(_0x2f69ad[_0xf17d('0x34')]==='script'){if('undefined'==typeof _0x2f69ad[_0xf17d('0x79')][_0xf17d('0x80')]){return _0x3a858d(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xf17d('0x23')==typeof _0x2f69ad[_0xf17d('0x79')][_0xf17d('0x81')]){return _0x3a858d(new Error(_0xf17d('0x82')));}}else{return _0x3a858d(new Error(_0xf17d('0x83')));}var _0x5a7f02=_0x2f69ad[_0xf17d('0x2f')];var _0x1baff2=_0x2f69ad[_0xf17d('0x84')];var _0x178455=_0x2f69ad[_0xf17d('0x34')];var _0x1b859d=_0x2f69ad[_0xf17d('0x85')]?_0x2f69ad[_0xf17d('0x85')]:'always';var _0x39058b=_0x2f69ad[_0xf17d('0x86')]?_0x2f69ad['icon']:'icon-apps';var _0x511534='';var _0x32ef2e='';var _0x197570='';var _0x5ded1e='';var _0x15c6ac=_0x2f69ad['version'];if(_0x178455==='html'){if('undefined'!=typeof _0x2f69ad[_0xf17d('0x79')]['views'][_0xf17d('0x7e')]){var _0x1f5da2=_0x2f69ad['parameters'][_0xf17d('0x7c')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1f5da2)){_0x511534=path[_0xf17d('0x50')]('plugins',_0x1999a4,_0x5cc6cb[0x0],_0x1f5da2);}else{_0x511534=_0x1f5da2;}}else{logger[_0xf17d('0x62')](_0xf17d('0x87'));}if(_0xf17d('0x23')!=typeof _0x2f69ad[_0xf17d('0x79')][_0xf17d('0x7c')][_0xf17d('0x88')]){var _0x5acdcb=_0x2f69ad[_0xf17d('0x79')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf17d('0x89')](_0x5acdcb)){_0x32ef2e=path['join'](_0xf17d('0x8a'),_0x1999a4,_0x5cc6cb[0x0],_0x5acdcb);}else{_0x32ef2e=_0x5acdcb;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x178455===_0xf17d('0x8b')){_0x197570=_0x2f69ad[_0xf17d('0x79')][_0xf17d('0x80')];_0x5ded1e=_0x2f69ad[_0xf17d('0x79')][_0xf17d('0x81')];if(_0xf17d('0x23')!=typeof _0x2f69ad[_0xf17d('0x79')]['views']){if(_0xf17d('0x23')!=typeof _0x2f69ad[_0xf17d('0x79')][_0xf17d('0x7c')]['admin']){var _0x1f5da2=_0x2f69ad[_0xf17d('0x79')]['views'][_0xf17d('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xf17d('0x89')](_0x1f5da2)){_0x511534=path[_0xf17d('0x50')](_0xf17d('0x8a'),_0x1999a4,_0x5cc6cb[0x0],_0x1f5da2);}else{_0x511534=_0x1f5da2;}}if(_0xf17d('0x23')!=typeof _0x2f69ad[_0xf17d('0x79')][_0xf17d('0x7c')]['agent']){var _0x5acdcb=_0x2f69ad[_0xf17d('0x79')][_0xf17d('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf17d('0x89')](_0x5acdcb)){_0x32ef2e=path['join'](_0xf17d('0x8a'),_0x1999a4,_0x5cc6cb[0x0],_0x5acdcb);}else{_0x32ef2e=_0x5acdcb;}}}}var _0x31a2c2={'name':_0x5a7f02,'description':_0x1baff2,'path':path['join'](_0x1999a4,_0x5cc6cb[0x0]),'type':_0x178455,'sidebar':_0x1b859d,'icon':_0x39058b,'adminUrl':_0x511534,'agentUrl':_0x32ef2e,'scriptName':_0x197570,'scriptPath':_0x5ded1e,'version':_0x15c6ac};removeReferences(_0x41d627,null);return db[_0xf17d('0x31')][_0xf17d('0x8c')](_0x31a2c2)[_0xf17d('0x29')](function(_0x2c2df1){var _0x404741={'role':_0x2c2d18[_0xf17d('0x8d')][_0xf17d('0x8e')],'userProfileId':_0x2c2d18['body'][_0xf17d('0x8f')]};if(!_0x404741)throw new Error(_0xf17d('0x90'));if(_0x404741[_0xf17d('0x8e')]===_0xf17d('0x91')){var _0x41e08d=_0x2c2df1[_0xf17d('0x2b')]({'plain':!![]});return db[_0xf17d('0x92')][_0xf17d('0x4e')]({'where':{'name':_0xf17d('0x2c'),'userProfileId':_0x404741[_0xf17d('0x8f')]},'raw':!![]})[_0xf17d('0x29')](function(_0x29cbad){if(_0x29cbad&&_0x29cbad[_0xf17d('0x93')]===0x0){return db[_0xf17d('0x2d')][_0xf17d('0x8c')]({'name':_0x41e08d[_0xf17d('0x2f')],'resourceId':_0x41e08d['id'],'type':_0x29cbad[_0xf17d('0x2f')],'sectionId':_0x29cbad['id']},{})[_0xf17d('0x29')](function(){return _0x2c2df1;});}else{return _0x2c2df1;}})[_0xf17d('0x49')](function(_0x10eccb){logger[_0xf17d('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10eccb);throw _0x10eccb;});}return _0x2c2df1;})[_0xf17d('0x29')](respondWithResult(_0x34b5b0,null))[_0xf17d('0x49')](handleError(_0x34b5b0,null));}});}catch(_0x2ea96b){_0x34b5b0[_0xf17d('0x1f')](0x1f4)[_0xf17d('0x94')](_0x2ea96b);}};function removeReferences(_0x2eb1f6,_0x47f599){try{if(_0x2eb1f6){fs[_0xf17d('0x61')](_0x2eb1f6);logger['info'](_0xf17d('0x95'));}if(_0x47f599){rimraf(_0x47f599,function(){});logger[_0xf17d('0x62')](_0xf17d('0x96'));}}catch(_0x182aa1){logger[_0xf17d('0x5a')](_0x182aa1);}}exports[_0xf17d('0x97')]=function(_0x42e896,_0x572d28,_0x2f1ba7){return db[_0xf17d('0x31')][_0xf17d('0x4e')]({'where':{'id':_0x42e896['params']['id']}})[_0xf17d('0x29')](handleEntityNotFound(_0x572d28,null))[_0xf17d('0x29')](saveUpdates(_0x42e896[_0xf17d('0x8d')],null))[_0xf17d('0x29')](respondWithResult(_0x572d28,null))[_0xf17d('0x49')](handleError(_0x572d28,null));};exports[_0xf17d('0x98')]=function(_0x1e82f0,_0x546a03,_0x5524e1){return db[_0xf17d('0x31')][_0xf17d('0x4e')]({'where':{'id':_0x1e82f0[_0xf17d('0x4b')]['id']}})[_0xf17d('0x29')](function(_0x1c74d6){if(_0x1c74d6){return _0x1c74d6[_0xf17d('0x2a')]();}})[_0xf17d('0x29')](function(_0x529308){rimraf(path[_0xf17d('0x50')](config[_0xf17d('0x51')],_0xf17d('0x68'),path[_0xf17d('0x99')](_0x529308[_0xf17d('0x4f')])),function(){});return _0x529308;})['then'](handleEntityNotFound(_0x546a03,null))[_0xf17d('0x29')](respondWithStatusCode(_0x546a03,null))[_0xf17d('0x49')](handleError(_0x546a03,null));};exports[_0xf17d('0x9a')]=function(_0x508938,_0x374418,_0x265132){return BPromise[_0xf17d('0x9b')]()[_0xf17d('0x29')](function(){if(!_0x508938[_0xf17d('0x37')][_0xf17d('0x4f')]){throw new Error(_0xf17d('0x9c'));}if(!_0x508938[_0xf17d('0x37')]['port']){throw new Error(_0xf17d('0x9d'));}var _0x4a7e1b=_0x508938[_0xf17d('0x37')]['hostname']?_0x508938[_0xf17d('0x37')][_0xf17d('0x9e')]+':'+_0x508938[_0xf17d('0x37')]['port']:_0xf17d('0x9f')+_0x508938[_0xf17d('0x37')][_0xf17d('0xa0')];var _0x5d0988=_0x508938[_0xf17d('0x37')][_0xf17d('0x21')]?_0x508938[_0xf17d('0x37')][_0xf17d('0x21')]:!![];var _0x354ad9=_0x508938[_0xf17d('0x37')][_0xf17d('0xa1')]?_0x508938[_0xf17d('0x37')][_0xf17d('0xa1')]:null;var _0x409c06={'method':_0x508938[_0xf17d('0xa2')],'uri':util['format'](_0xf17d('0xa3'),_0x4a7e1b,_0x508938['query'][_0xf17d('0x4f')]),'json':_0x5d0988,'resolveWithFullResponse':!![],'encoding':_0x354ad9,'qs':_0x508938[_0xf17d('0x37')]};if(_0x508938[_0xf17d('0xa4')]){_0x409c06[_0xf17d('0xa4')]=_0x508938[_0xf17d('0xa4')];if(_0x409c06[_0xf17d('0xa4')][_0xf17d('0xa5')]){delete _0x409c06[_0xf17d('0xa4')][_0xf17d('0xa5')];}}if(_0x409c06['headers'][_0xf17d('0xa6')]){delete _0x409c06[_0xf17d('0xa4')]['content-type'];}return rp(_0x409c06);})[_0xf17d('0x29')](function(_0x3d73db){if(_0x3d73db){_0x374418[_0xf17d('0xa7')](_0x3d73db[_0xf17d('0xa4')]);logger[_0xf17d('0x62')](_0x3d73db['body']);if(_[_0xf17d('0xa8')](_0x508938['query'][_0xf17d('0x4f')],'download')&&_0x3d73db['statusCode']==0x1f4){return _0x374418[_0xf17d('0x1e')](_0x3d73db['statusCode']);}else{return _0x374418['status'](_0x3d73db[_0xf17d('0xa9')])[_0xf17d('0x94')](_0x3d73db[_0xf17d('0x8d')]);}}else{return _0x374418[_0xf17d('0x1e')](0xc8);}})[_0xf17d('0x49')](handleError(_0x374418,null));};exports['webhookPost']=function(_0x23dd88,_0x311dfe,_0x52fdc0){return BPromise['resolve']()[_0xf17d('0x29')](function(){if(!_0x23dd88[_0xf17d('0x37')][_0xf17d('0x4f')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x23dd88[_0xf17d('0x37')][_0xf17d('0xa0')]){throw new Error(_0xf17d('0x9d'));}var _0x1fb488=_0x23dd88[_0xf17d('0x37')][_0xf17d('0x9e')]?_0x23dd88['query'][_0xf17d('0x9e')]+':'+_0x23dd88['query']['port']:_0xf17d('0x9f')+_0x23dd88[_0xf17d('0x37')][_0xf17d('0xa0')];var _0x1c0c50=_0x23dd88[_0xf17d('0x37')]['json']?_0x23dd88[_0xf17d('0x37')][_0xf17d('0x21')]:!![];var _0x30d0fa=_0x23dd88[_0xf17d('0x37')]['encoding']?_0x23dd88[_0xf17d('0x37')][_0xf17d('0xa1')]:null;var _0x5461a3={'method':_0x23dd88[_0xf17d('0xa2')],'uri':util[_0xf17d('0x5f')](_0xf17d('0xa3'),_0x1fb488,_0x23dd88[_0xf17d('0x37')][_0xf17d('0x4f')]),'json':_0x1c0c50,'resolveWithFullResponse':!![],'encoding':_0x30d0fa,'body':_0x23dd88[_0xf17d('0x8d')]};if(_0x23dd88[_0xf17d('0xa4')]){_0x5461a3['headers']=_0x23dd88[_0xf17d('0xa4')];if(_0x5461a3[_0xf17d('0xa4')][_0xf17d('0xa5')]){delete _0x5461a3[_0xf17d('0xa4')][_0xf17d('0xa5')];}}if(_0x5461a3[_0xf17d('0xa4')][_0xf17d('0xa6')]){delete _0x5461a3[_0xf17d('0xa4')][_0xf17d('0xa6')];}return rp(_0x5461a3);})[_0xf17d('0x29')](function(_0x5c743f){if(_0x5c743f){_0x311dfe[_0xf17d('0xa7')](_0x5c743f[_0xf17d('0xa4')]);logger[_0xf17d('0x62')](_0x5c743f['body']);return _0x311dfe['status'](_0x5c743f[_0xf17d('0xa9')])[_0xf17d('0x94')](_0x5c743f[_0xf17d('0x8d')]);}else{return _0x311dfe['sendStatus'](0xc8);}})[_0xf17d('0x49')](handleError(_0x311dfe,null));}; \ No newline at end of file +var _0x7217=['description','sidebar','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','params','body','delete','webhookGet','resolve','port','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','content-type','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','get','Plugins','error','stack','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','include','rows','catch','show','length','options','find','download','join','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','pipe','glob','dirname','basename','node_modules/**/*','attachments/**/*','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type'];(function(_0x35b19d,_0x585ab5){var _0x571f72=function(_0x16057d){while(--_0x16057d){_0x35b19d['push'](_0x35b19d['shift']());}};_0x571f72(++_0x585ab5);}(_0x7217,0x17e));var _0x7721=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7217[_0x36dfbd];return _0x4ecad9;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require(_0x7721('0x6'));var util=require('util');var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var fs_extra=require(_0x7721('0xb'));var _=require(_0x7721('0xc'));var squel=require(_0x7721('0xd'));var crypto=require(_0x7721('0xe'));var jsforce=require(_0x7721('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7721('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x7721('0x10'));var Redis=require(_0x7721('0x11'));var authService=require(_0x7721('0x12'));var qs=require(_0x7721('0x13'));var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))('api');var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var licenseUtil=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];config[_0x7721('0x1b')]=_[_0x7721('0x1c')](config[_0x7721('0x1b')],{'host':_0x7721('0x1d'),'port':0x18eb});var socket=require(_0x7721('0x1e'))(new Redis(config['redis']));require(_0x7721('0x1f'))['register'](socket);function respondWithStatusCode(_0x1afd68,_0xfdc619){_0xfdc619=_0xfdc619||0xcc;return function(_0x2d533c){if(_0x2d533c){return _0x1afd68[_0x7721('0x20')](_0xfdc619);}return _0x1afd68[_0x7721('0x21')](_0xfdc619)[_0x7721('0x22')]();};}function respondWithResult(_0x3af45e,_0x15a17f){_0x15a17f=_0x15a17f||0xc8;return function(_0x2d7578){if(_0x2d7578){return _0x3af45e[_0x7721('0x21')](_0x15a17f)[_0x7721('0x23')](_0x2d7578);}};}function respondWithFilteredResult(_0xa93107,_0x214234){return function(_0x4f679f){if(_0x4f679f){var _0x149d44=typeof _0x214234[_0x7721('0x24')]===_0x7721('0x25')&&typeof _0x214234['limit']===_0x7721('0x25');var _0x35b81d=_0x4f679f[_0x7721('0x26')];var _0x55e7f1=_0x149d44?0x0:_0x214234[_0x7721('0x24')];var _0x392887=_0x149d44?_0x4f679f[_0x7721('0x26')]:_0x214234[_0x7721('0x24')]+_0x214234['limit'];var _0x4856be;if(_0x392887>=_0x35b81d){_0x392887=_0x35b81d;_0x4856be=0xc8;}else{_0x4856be=0xce;}_0xa93107['status'](_0x4856be);return _0xa93107[_0x7721('0x27')]('Content-Range',_0x55e7f1+'-'+_0x392887+'/'+_0x35b81d)[_0x7721('0x23')](_0x4f679f);}return null;};}function patchUpdates(_0x3388b6){return function(_0x328b51){try{jsonpatch['apply'](_0x328b51,_0x3388b6,!![]);}catch(_0x2e8520){return BPromise[_0x7721('0x28')](_0x2e8520);}return _0x328b51[_0x7721('0x29')]();};}function saveUpdates(_0x3f5887,_0x198e63){return function(_0x578e90){if(_0x578e90){return _0x578e90[_0x7721('0x2a')](_0x3f5887)[_0x7721('0x2b')](function(_0x16e9ad){return _0x16e9ad;});}return null;};}function removeEntity(_0x5794bc,_0x306337){return function(_0x598322){if(_0x598322){return _0x598322[_0x7721('0x2c')]()[_0x7721('0x2b')](function(){var _0x57badd=_0x598322[_0x7721('0x2d')]({'plain':!![]});var _0x33ba86=_0x7721('0x2e');return db['UserProfileResource'][_0x7721('0x2c')]({'where':{'type':_0x33ba86,'resourceId':_0x57badd['id']}})[_0x7721('0x2b')](function(){return _0x598322;});})['then'](function(){_0x5794bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f04a,_0x3e4477){return function(_0x5afcb5){if(!_0x5afcb5){_0x15f04a[_0x7721('0x20')](0x194);}return _0x5afcb5;};}function handleError(_0x3c537f,_0x24e67c){_0x24e67c=_0x24e67c||0x1f4;return function(_0x20f8f3){logger[_0x7721('0x2f')](_0x20f8f3[_0x7721('0x30')]);if(_0x20f8f3['name']){delete _0x20f8f3['name'];}_0x3c537f[_0x7721('0x21')](_0x24e67c)[_0x7721('0x31')](_0x20f8f3);};}exports[_0x7721('0x32')]=function(_0x440150,_0x3b561d){var _0x34b53b={},_0x2eb46a={},_0x9c85cc={'count':0x0,'rows':[]};var _0x29ec3e=_[_0x7721('0x33')](db[_0x7721('0x34')][_0x7721('0x35')],function(_0x3c3348){return{'name':_0x3c3348[_0x7721('0x36')],'type':_0x3c3348[_0x7721('0x37')][_0x7721('0x38')]};});_0x2eb46a[_0x7721('0x39')]=_[_0x7721('0x33')](_0x29ec3e,'name');_0x2eb46a[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x440150[_0x7721('0x3a')]);_0x2eb46a[_0x7721('0x3c')]=_['intersection'](_0x2eb46a['model'],_0x2eb46a[_0x7721('0x3a')]);_0x34b53b['attributes']=_[_0x7721('0x3d')](_0x2eb46a['model'],qs[_0x7721('0x3e')](_0x440150[_0x7721('0x3a')][_0x7721('0x3e')]));_0x34b53b['attributes']=_0x34b53b[_0x7721('0x3f')]['length']?_0x34b53b[_0x7721('0x3f')]:_0x2eb46a[_0x7721('0x39')];if(!_0x440150[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x40'))){_0x34b53b[_0x7721('0x41')]=qs['limit'](_0x440150[_0x7721('0x3a')][_0x7721('0x41')]);_0x34b53b['offset']=qs[_0x7721('0x24')](_0x440150[_0x7721('0x3a')][_0x7721('0x24')]);}_0x34b53b[_0x7721('0x42')]=qs[_0x7721('0x43')](_0x440150[_0x7721('0x3a')][_0x7721('0x43')]);_0x34b53b[_0x7721('0x44')]=qs[_0x7721('0x3c')](_[_0x7721('0x45')](_0x440150['query'],_0x2eb46a[_0x7721('0x3c')]),_0x29ec3e);if(_0x440150[_0x7721('0x3a')][_0x7721('0x46')]){_0x34b53b[_0x7721('0x44')]=_[_0x7721('0x47')](_0x34b53b[_0x7721('0x44')],{'$or':_[_0x7721('0x33')](_0x29ec3e,function(_0x3e9256){if(_0x3e9256[_0x7721('0x37')]!==_0x7721('0x48')){var _0x2ce511={};_0x2ce511[_0x3e9256[_0x7721('0x49')]]={'$like':'%'+_0x440150[_0x7721('0x3a')]['filter']+'%'};return _0x2ce511;}})});}_0x34b53b=_['merge']({},_0x34b53b,_0x440150['options']);var _0x2923b8={'where':_0x34b53b[_0x7721('0x44')]};return db[_0x7721('0x34')][_0x7721('0x26')](_0x2923b8)[_0x7721('0x2b')](function(_0x1014e7){_0x9c85cc[_0x7721('0x26')]=_0x1014e7;if(_0x440150[_0x7721('0x3a')][_0x7721('0x4a')]){_0x34b53b[_0x7721('0x4b')]=[{'all':!![]}];}return db[_0x7721('0x34')]['findAll'](_0x34b53b);})[_0x7721('0x2b')](function(_0x270b59){_0x9c85cc[_0x7721('0x4c')]=_0x270b59;return _0x9c85cc;})[_0x7721('0x2b')](respondWithFilteredResult(_0x3b561d,_0x34b53b))[_0x7721('0x4d')](handleError(_0x3b561d,null));};exports[_0x7721('0x4e')]=function(_0x219c68,_0x5a280d){var _0x16fc06={'raw':!![],'where':{'id':_0x219c68['params']['id']}},_0x50f82e={};_0x50f82e[_0x7721('0x39')]=_[_0x7721('0x3b')](db[_0x7721('0x34')][_0x7721('0x35')]);_0x50f82e['query']=_['keys'](_0x219c68[_0x7721('0x3a')]);_0x50f82e[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x50f82e[_0x7721('0x39')],_0x50f82e[_0x7721('0x3a')]);_0x16fc06[_0x7721('0x3f')]=_[_0x7721('0x3d')](_0x50f82e[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x219c68[_0x7721('0x3a')]['fields']));_0x16fc06[_0x7721('0x3f')]=_0x16fc06['attributes'][_0x7721('0x4f')]?_0x16fc06[_0x7721('0x3f')]:_0x50f82e[_0x7721('0x39')];if(_0x219c68[_0x7721('0x3a')][_0x7721('0x4a')]){_0x16fc06['include']=[{'all':!![]}];}_0x16fc06=_[_0x7721('0x47')]({},_0x16fc06,_0x219c68[_0x7721('0x50')]);return db[_0x7721('0x34')][_0x7721('0x51')](_0x16fc06)[_0x7721('0x2b')](handleEntityNotFound(_0x5a280d,null))[_0x7721('0x2b')](respondWithResult(_0x5a280d,null))[_0x7721('0x4d')](handleError(_0x5a280d,null));};exports[_0x7721('0x52')]=function(_0x19e5fa,_0x21f979,_0x4fb7b6){return db[_0x7721('0x34')][_0x7721('0x51')]({'where':{'id':_0x19e5fa['params']['id']},'attributes':[_0x7721('0x49'),_0x7721('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x21f979,null))[_0x7721('0x2b')](function(_0x44e930){if(_0x44e930){var _0x3edd57=path[_0x7721('0x53')](config['root'],_0x7721('0x54'),util[_0x7721('0x55')](_0x7721('0x56'),path['basename'](_0x44e930['path'])));var _0xeec26c=fs[_0x7721('0x57')](_0x3edd57);var _0x10e2b0=archiver(_0x7721('0x58'),{'zlib':{'level':0x9}});_0x10e2b0['on'](_0x7721('0x59'),function(_0x49b5c6){if(_0x49b5c6[_0x7721('0x5a')]===_0x7721('0x5b')){logger[_0x7721('0x2f')](_0x49b5c6);}else{throw new db[(_0x7721('0x5c'))][(_0x7721('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x10e2b0['on'](_0x7721('0x2f'),function(_0x5a4ad8){throw new db[(_0x7721('0x5c'))][(_0x7721('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x10e2b0[_0x7721('0x5e')](_0xeec26c);_0x10e2b0[_0x7721('0x5f')]('**/*',{'cwd':path[_0x7721('0x53')](config['root'],_0x7721('0x54'),path[_0x7721('0x60')](_0x44e930[_0x7721('0x7')])),'ignore':[path[_0x7721('0x53')](path[_0x7721('0x61')](_0x44e930[_0x7721('0x7')]),_0x7721('0x62')),path[_0x7721('0x53')](path[_0x7721('0x61')](_0x44e930[_0x7721('0x7')]),_0x7721('0x63'))],'nodir':!![]})['finalize']();_0xeec26c['on']('close',function(){if(!fs['existsSync'](_0x3edd57)){throw new db[(_0x7721('0x5c'))]['Error'](_0x7721('0x64'));}return _0x21f979['download'](_0x3edd57,util[_0x7721('0x55')](_0x7721('0x56'),path[_0x7721('0x61')](_0x44e930[_0x7721('0x7')])),function(_0x4ddb5a){if(_0x4ddb5a){throw new db[(_0x7721('0x5c'))][(_0x7721('0x5d'))](_0x7721('0x65'));}fs['unlinkSync'](_0x3edd57);logger[_0x7721('0x66')](_0x7721('0x67'));logger[_0x7721('0x66')](_0x7721('0x68'));});});}return null;})[_0x7721('0x4d')](handleError(_0x21f979,null));};exports['upload']=function(_0x3bdba8,_0x245c23,_0x12ac13){var _0x4b14d0=path[_0x7721('0x61')](_0x3bdba8[_0x7721('0x69')][_0x7721('0x6a')],path[_0x7721('0x6b')](_0x3bdba8[_0x7721('0x69')][_0x7721('0x6a')]));var _0x434793=path[_0x7721('0x53')](config[_0x7721('0x6c')],'server/files/plugins',_0x3bdba8[_0x7721('0x69')][_0x7721('0x6a')]);var _0x35bd7f=path[_0x7721('0x53')](config[_0x7721('0x6c')],_0x7721('0x54'),_0x4b14d0);logger[_0x7721('0x66')](_0x7721('0x6d'),_0x434793);logger[_0x7721('0x66')](_0x7721('0x6e'),_0x35bd7f);try{fs[_0x7721('0x6f')](_0x434793,parseInt(_0x7721('0x70'),0x8));extract(_0x434793,{'dir':_0x35bd7f},function(_0x54dfb8){if(_0x54dfb8){logger[_0x7721('0x2f')](_0x54dfb8);handleError(_0x54dfb8,!![]);};var _0xf72cda=fs[_0x7721('0x71')](_0x35bd7f);if(_0xf72cda['length']>0x1){removeReferences(_0x434793,_0x35bd7f);logger[_0x7721('0x2f')]('Invalid\x20plugin\x20structure');return _0x12ac13(new Error('Invalid\x20plugin\x20structure'));}var _0xf4a7c3=fs[_0x7721('0x72')](path[_0x7721('0x53')](_0x35bd7f,_0xf72cda[0x0]));if(_0xf4a7c3[_0x7721('0x73')]()){removeReferences(_0x434793,_0x35bd7f);logger['error']('Invalid\x20plugin\x20structure');return _0x12ac13(new Error(_0x7721('0x74')));}if(_0xf4a7c3[_0x7721('0x75')]()){var _0x2b45e4=fs[_0x7721('0x71')](path['join'](_0x35bd7f,_0xf72cda[0x0]));if(_0x2b45e4[_0x7721('0x4f')]===0x0){removeReferences(_0x434793,_0x35bd7f);logger[_0x7721('0x2f')](_0x7721('0x74'));return _0x12ac13(new Error(_0x7721('0x74')));}var _0x3f6a7a=_0x2b45e4[_0x7721('0x76')](function(_0x233833){return _0x233833===_0x7721('0x77');});if(!_0x3f6a7a){return _0x12ac13(new Error('Plugin\x20manifest\x20missing'));}var _0x645d86=fs[_0x7721('0x78')](path[_0x7721('0x53')](_0x35bd7f,_0xf72cda[0x0],'manifest.json'));var _0x1edded=JSON[_0x7721('0x79')](_0x645d86);if('undefined'==typeof _0x1edded[_0x7721('0x49')]){return _0x12ac13(new Error(_0x7721('0x7a')));}if(_0x7721('0x25')==typeof _0x1edded[_0x7721('0x37')]){return _0x12ac13(new Error(_0x7721('0x7b')));}if(_0x7721('0x25')==typeof _0x1edded[_0x7721('0x7c')]){return _0x12ac13(new Error(_0x7721('0x7d')));}if(_0x7721('0x25')==typeof _0x1edded[_0x7721('0x7e')]){return _0x12ac13(new Error(_0x7721('0x7f')));}if(_0x1edded[_0x7721('0x37')]==='html'){if(_0x7721('0x25')==typeof _0x1edded['parameters'][_0x7721('0x80')]){return _0x12ac13(new Error(_0x7721('0x81')));}if(_0x7721('0x25')==typeof _0x1edded[_0x7721('0x7e')][_0x7721('0x80')][_0x7721('0x82')]&&_0x7721('0x25')==typeof _0x1edded['parameters'][_0x7721('0x80')]['agent']){return _0x12ac13(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1edded['type']===_0x7721('0x83')){if(_0x7721('0x25')==typeof _0x1edded['parameters'][_0x7721('0x84')]){return _0x12ac13(new Error(_0x7721('0x85')));}if(_0x7721('0x25')==typeof _0x1edded[_0x7721('0x7e')][_0x7721('0x86')]){return _0x12ac13(new Error(_0x7721('0x87')));}}else{return _0x12ac13(new Error(_0x7721('0x88')));}var _0x48f001=_0x1edded[_0x7721('0x49')];var _0x10b43d=_0x1edded[_0x7721('0x89')];var _0x43892f=_0x1edded[_0x7721('0x37')];var _0x49d246=_0x1edded[_0x7721('0x8a')]?_0x1edded[_0x7721('0x8a')]:_0x7721('0x8b');var _0x4f2a22=_0x1edded[_0x7721('0x8c')]?_0x1edded[_0x7721('0x8c')]:'icon-apps';var _0x3efdd4='';var _0x4ee8aa='';var _0x58fab4='';var _0xa33d2='';var _0x2ea0e3=_0x1edded['version'];if(_0x43892f==='html'){if('undefined'!=typeof _0x1edded[_0x7721('0x7e')][_0x7721('0x80')]['admin']){var _0x181683=_0x1edded['parameters'][_0x7721('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7721('0x8d')](_0x181683)){_0x3efdd4=path['join'](_0x7721('0x8e'),_0x4b14d0,_0xf72cda[0x0],_0x181683);}else{_0x3efdd4=_0x181683;}}else{logger[_0x7721('0x66')](_0x7721('0x8f'));}if(_0x7721('0x25')!=typeof _0x1edded[_0x7721('0x7e')][_0x7721('0x80')][_0x7721('0x90')]){var _0x1bb354=_0x1edded[_0x7721('0x7e')][_0x7721('0x80')][_0x7721('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x7721('0x8d')](_0x1bb354)){_0x4ee8aa=path[_0x7721('0x53')](_0x7721('0x8e'),_0x4b14d0,_0xf72cda[0x0],_0x1bb354);}else{_0x4ee8aa=_0x1bb354;}}else{logger['info'](_0x7721('0x91'));}}else if(_0x43892f===_0x7721('0x83')){_0x58fab4=_0x1edded[_0x7721('0x7e')]['scriptName'];_0xa33d2=_0x1edded[_0x7721('0x7e')][_0x7721('0x86')];if(_0x7721('0x25')!=typeof _0x1edded[_0x7721('0x7e')]['views']){if(_0x7721('0x25')!=typeof _0x1edded['parameters']['views'][_0x7721('0x82')]){var _0x181683=_0x1edded[_0x7721('0x7e')][_0x7721('0x80')][_0x7721('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x7721('0x8d')](_0x181683)){_0x3efdd4=path[_0x7721('0x53')](_0x7721('0x8e'),_0x4b14d0,_0xf72cda[0x0],_0x181683);}else{_0x3efdd4=_0x181683;}}if(_0x7721('0x25')!=typeof _0x1edded[_0x7721('0x7e')][_0x7721('0x80')][_0x7721('0x90')]){var _0x1bb354=_0x1edded[_0x7721('0x7e')][_0x7721('0x80')][_0x7721('0x90')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1bb354)){_0x4ee8aa=path['join'](_0x7721('0x8e'),_0x4b14d0,_0xf72cda[0x0],_0x1bb354);}else{_0x4ee8aa=_0x1bb354;}}}}var _0x53c2a1={'name':_0x48f001,'description':_0x10b43d,'path':path[_0x7721('0x53')](_0x4b14d0,_0xf72cda[0x0]),'type':_0x43892f,'sidebar':_0x49d246,'icon':_0x4f2a22,'adminUrl':_0x3efdd4,'agentUrl':_0x4ee8aa,'scriptName':_0x58fab4,'scriptPath':_0xa33d2,'version':_0x2ea0e3};removeReferences(_0x434793,null);return db[_0x7721('0x34')][_0x7721('0x92')](_0x53c2a1)[_0x7721('0x2b')](function(_0x41a03a){var _0x1d9617={'role':_0x3bdba8['body'][_0x7721('0x93')],'userProfileId':_0x3bdba8['body'][_0x7721('0x94')]};if(!_0x1d9617)throw new Error(_0x7721('0x95'));if(_0x1d9617[_0x7721('0x93')]===_0x7721('0x96')){var _0x142bbe=_0x41a03a[_0x7721('0x2d')]({'plain':!![]});return db[_0x7721('0x97')][_0x7721('0x51')]({'where':{'name':_0x7721('0x2e'),'userProfileId':_0x1d9617[_0x7721('0x94')]},'raw':!![]})[_0x7721('0x2b')](function(_0x5ba814){if(_0x5ba814&&_0x5ba814[_0x7721('0x98')]===0x0){return db['UserProfileResource'][_0x7721('0x92')]({'name':_0x142bbe[_0x7721('0x49')],'resourceId':_0x142bbe['id'],'type':_0x5ba814[_0x7721('0x49')],'sectionId':_0x5ba814['id']},{})[_0x7721('0x2b')](function(){return _0x41a03a;});}else{return _0x41a03a;}})['catch'](function(_0x299f89){logger['error'](_0x7721('0x99'),_0x299f89);throw _0x299f89;});}return _0x41a03a;})[_0x7721('0x2b')](respondWithResult(_0x245c23,null))['catch'](handleError(_0x245c23,null));}});}catch(_0x3c211e){_0x245c23[_0x7721('0x21')](0x1f4)['send'](_0x3c211e);}};function removeReferences(_0x4736a2,_0x3614c7){try{if(_0x4736a2){fs[_0x7721('0x9a')](_0x4736a2);logger['info']('Zip\x20archive\x20removed');}if(_0x3614c7){rimraf(_0x3614c7,function(){});logger[_0x7721('0x66')]('Extracted\x20folder\x20removed');}}catch(_0x142a46){logger[_0x7721('0x2f')](_0x142a46);}}exports[_0x7721('0x2a')]=function(_0xc06f0a,_0x285290,_0x2e9e62){return db[_0x7721('0x34')]['find']({'where':{'id':_0xc06f0a[_0x7721('0x9b')]['id']}})[_0x7721('0x2b')](handleEntityNotFound(_0x285290,null))[_0x7721('0x2b')](saveUpdates(_0xc06f0a[_0x7721('0x9c')],null))[_0x7721('0x2b')](respondWithResult(_0x285290,null))[_0x7721('0x4d')](handleError(_0x285290,null));};exports[_0x7721('0x9d')]=function(_0x3aa9ce,_0x3a21a7,_0x49a414){return db[_0x7721('0x34')][_0x7721('0x51')]({'where':{'id':_0x3aa9ce[_0x7721('0x9b')]['id']}})[_0x7721('0x2b')](function(_0x26c658){if(_0x26c658){return _0x26c658['destroy']();}})[_0x7721('0x2b')](function(_0x2910ad){rimraf(path[_0x7721('0x53')](config[_0x7721('0x6c')],_0x7721('0x54'),path[_0x7721('0x60')](_0x2910ad[_0x7721('0x7')])),function(){});return _0x2910ad;})[_0x7721('0x2b')](handleEntityNotFound(_0x3a21a7,null))['then'](respondWithStatusCode(_0x3a21a7,null))[_0x7721('0x4d')](handleError(_0x3a21a7,null));};exports[_0x7721('0x9e')]=function(_0x2c98c5,_0x5b437e,_0x7e0d69){return BPromise[_0x7721('0x9f')]()[_0x7721('0x2b')](function(){if(!_0x2c98c5[_0x7721('0x3a')][_0x7721('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2c98c5[_0x7721('0x3a')][_0x7721('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x45dee1=_0x2c98c5[_0x7721('0x3a')][_0x7721('0xa1')]?_0x2c98c5['query'][_0x7721('0xa1')]+':'+_0x2c98c5[_0x7721('0x3a')][_0x7721('0xa0')]:'http://localhost:'+_0x2c98c5[_0x7721('0x3a')][_0x7721('0xa0')];var _0x4f0002=_0x2c98c5[_0x7721('0x3a')][_0x7721('0x23')]?_0x2c98c5[_0x7721('0x3a')]['json']:!![];var _0x476653=_0x2c98c5['query']['encoding']?_0x2c98c5[_0x7721('0x3a')][_0x7721('0xa2')]:null;var _0x588f4e={'method':_0x2c98c5[_0x7721('0xa3')],'uri':util[_0x7721('0x55')](_0x7721('0xa4'),_0x45dee1,_0x2c98c5['query']['path']),'json':_0x4f0002,'resolveWithFullResponse':!![],'encoding':_0x476653,'qs':_0x2c98c5[_0x7721('0x3a')]};if(_0x2c98c5[_0x7721('0xa5')]){_0x588f4e[_0x7721('0xa5')]=_0x2c98c5['headers'];if(_0x588f4e[_0x7721('0xa5')][_0x7721('0xa6')]){delete _0x588f4e[_0x7721('0xa5')][_0x7721('0xa6')];}}if(_0x588f4e[_0x7721('0xa5')]['content-type']){delete _0x588f4e['headers']['content-type'];}return rp(_0x588f4e);})[_0x7721('0x2b')](function(_0x1d13b5){if(_0x1d13b5){_0x5b437e[_0x7721('0x27')](_0x1d13b5[_0x7721('0xa5')]);logger[_0x7721('0x66')](_0x1d13b5[_0x7721('0x9c')]);if(_[_0x7721('0xa7')](_0x2c98c5[_0x7721('0x3a')]['path'],'download')&&_0x1d13b5[_0x7721('0xa8')]==0x1f4){return _0x5b437e[_0x7721('0x20')](_0x1d13b5[_0x7721('0xa8')]);}else{return _0x5b437e[_0x7721('0x21')](_0x1d13b5['statusCode'])[_0x7721('0x31')](_0x1d13b5['body']);}}else{return _0x5b437e['sendStatus'](0xc8);}})[_0x7721('0x4d')](handleError(_0x5b437e,null));};exports['webhookPost']=function(_0x38d8f9,_0x3186d3,_0x5ad918){return BPromise[_0x7721('0x9f')]()[_0x7721('0x2b')](function(){if(!_0x38d8f9[_0x7721('0x3a')][_0x7721('0x7')]){throw new Error(_0x7721('0xa9'));}if(!_0x38d8f9[_0x7721('0x3a')]['port']){throw new Error(_0x7721('0xaa'));}var _0x36c79d=_0x38d8f9[_0x7721('0x3a')][_0x7721('0xa1')]?_0x38d8f9[_0x7721('0x3a')][_0x7721('0xa1')]+':'+_0x38d8f9[_0x7721('0x3a')][_0x7721('0xa0')]:_0x7721('0xab')+_0x38d8f9[_0x7721('0x3a')][_0x7721('0xa0')];var _0x33f9fe=_0x38d8f9['query'][_0x7721('0x23')]?_0x38d8f9[_0x7721('0x3a')][_0x7721('0x23')]:!![];var _0x5479e6=_0x38d8f9['query'][_0x7721('0xa2')]?_0x38d8f9[_0x7721('0x3a')][_0x7721('0xa2')]:null;var _0x5de5bd={'method':_0x38d8f9[_0x7721('0xa3')],'uri':util[_0x7721('0x55')](_0x7721('0xa4'),_0x36c79d,_0x38d8f9[_0x7721('0x3a')][_0x7721('0x7')]),'json':_0x33f9fe,'resolveWithFullResponse':!![],'encoding':_0x5479e6,'body':_0x38d8f9['body']};if(_0x38d8f9[_0x7721('0xa5')]){_0x5de5bd[_0x7721('0xa5')]=_0x38d8f9[_0x7721('0xa5')];if(_0x5de5bd[_0x7721('0xa5')][_0x7721('0xa6')]){delete _0x5de5bd['headers'][_0x7721('0xa6')];}}if(_0x5de5bd['headers'][_0x7721('0xac')]){delete _0x5de5bd[_0x7721('0xa5')][_0x7721('0xac')];}return rp(_0x5de5bd);})[_0x7721('0x2b')](function(_0x18f68a){if(_0x18f68a){_0x3186d3[_0x7721('0x27')](_0x18f68a['headers']);logger[_0x7721('0x66')](_0x18f68a[_0x7721('0x9c')]);return _0x3186d3[_0x7721('0x21')](_0x18f68a[_0x7721('0xa8')])[_0x7721('0x31')](_0x18f68a[_0x7721('0x9c')]);}else{return _0x3186d3[_0x7721('0x20')](0xc8);}})['catch'](handleError(_0x3186d3,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index a2e410a..3b0af51 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 _0xf1c6=['update','remove','emit','hasOwnProperty','exports','Plugin','setMaxListeners','save'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf1c6,0x145));var _0x6f1c=function(_0x2afa7a,_0xcea95d){_0x2afa7a=_0x2afa7a-0x0;var _0x453f7b=_0xf1c6[_0x2afa7a];return _0x453f7b;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x6f1c('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x6f1c('0x1')](0x0);var events={'afterCreate':_0x6f1c('0x2'),'afterUpdate':_0x6f1c('0x3'),'afterDestroy':_0x6f1c('0x4')};function emitEvent(_0x5daa45){return function(_0x5f0d77,_0x43775d,_0x4bd0c2){PluginEvents[_0x6f1c('0x5')](_0x5daa45+':'+_0x5f0d77['id'],_0x5f0d77);PluginEvents[_0x6f1c('0x5')](_0x5daa45,_0x5f0d77);_0x4bd0c2(null);};}for(var e in events){if(events[_0x6f1c('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x6f1c('0x7')]=PluginEvents; \ No newline at end of file +var _0x4745=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin'];(function(_0x52bc1c,_0x3bc7b1){var _0x863d7a=function(_0x2828cb){while(--_0x2828cb){_0x52bc1c['push'](_0x52bc1c['shift']());}};_0x863d7a(++_0x3bc7b1);}(_0x4745,0x1e7));var _0x5474=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x4745[_0x21aec3];return _0x288bbc;};'use strict';var EventEmitter=require(_0x5474('0x0'));var Plugin=require(_0x5474('0x1'))['db'][_0x5474('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x5474('0x3')](0x0);var events={'afterCreate':_0x5474('0x4'),'afterUpdate':_0x5474('0x5'),'afterDestroy':_0x5474('0x6')};function emitEvent(_0x19bbf0){return function(_0x28d8aa,_0x39fb9b,_0x45a895){PluginEvents[_0x5474('0x7')](_0x19bbf0+':'+_0x28d8aa['id'],_0x28d8aa);PluginEvents['emit'](_0x19bbf0,_0x28d8aa);_0x45a895(null);};}for(var e in events){if(events[_0x5474('0x8')](e)){var event=events[e];Plugin[_0x5474('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index eeefbec..9c388d1 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 _0xc2f5=['path','rimraf','./plugin.attributes','define','Plugin','util','../../config/logger','moment'];(function(_0xcb92e,_0x1e016a){var _0x3d853b=function(_0x5382af){while(--_0x5382af){_0xcb92e['push'](_0xcb92e['shift']());}};_0x3d853b(++_0x1e016a);}(_0xc2f5,0x175));var _0x5c2f=function(_0x294f30,_0x4cdb4c){_0x294f30=_0x294f30-0x0;var _0x39cd8b=_0xc2f5[_0x294f30];return _0x39cd8b;};'use strict';var _=require('lodash');var util=require(_0x5c2f('0x0'));var logger=require(_0x5c2f('0x1'))('api');var moment=require(_0x5c2f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c2f('0x3'));var rimraf=require(_0x5c2f('0x4'));var config=require('../../config/environment');var attributes=require(_0x5c2f('0x5'));module['exports']=function(_0x536fe4,_0x5275bd){return _0x536fe4[_0x5c2f('0x6')](_0x5c2f('0x7'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67e4=['exports','define','Plugin','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x67e4,0x161));var _0x467e=function(_0x519c88,_0xb84103){_0x519c88=_0x519c88-0x0;var _0x4668d7=_0x67e4[_0x519c88];return _0x4668d7;};'use strict';var _=require(_0x467e('0x0'));var util=require(_0x467e('0x1'));var logger=require(_0x467e('0x2'))(_0x467e('0x3'));var moment=require(_0x467e('0x4'));var BPromise=require(_0x467e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x467e('0x6'));var attributes=require('./plugin.attributes');module[_0x467e('0x7')]=function(_0x1f3531,_0x33b8bd){return _0x1f3531[_0x467e('0x8')](_0x467e('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 2d3090c..f12a4fa 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 _0x0541=['request','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','lodash','util','moment','randomstring','ioredis','../../config/environment','http','redis','defaults','localhost','./plugin.socket','register'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0541,0x1f2));var _0x1054=function(_0x39a71e,_0x128d6c){_0x39a71e=_0x39a71e-0x0;var _0x1d62fb=_0x0541[_0x39a71e];return _0x1d62fb;};'use strict';var _=require(_0x1054('0x0'));var util=require(_0x1054('0x1'));var moment=require(_0x1054('0x2'));var BPromise=require('bluebird');var rs=require(_0x1054('0x3'));var fs=require('fs');var Redis=require(_0x1054('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1054('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1054('0x6')]({'port':0x232a});config[_0x1054('0x7')]=_[_0x1054('0x8')](config[_0x1054('0x7')],{'host':_0x1054('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1054('0xa'))[_0x1054('0xb')](socket);function respondWithRpcPromise(_0x1e8db8,_0x36d86,_0x14b010){return new BPromise(function(_0x23dab2,_0x18885b){return client[_0x1054('0xc')](_0x1e8db8,_0x14b010)['then'](function(_0x2e034c){logger['info'](_0x1054('0xd'),_0x36d86,'request\x20sent');logger[_0x1054('0xe')]('Plugin,\x20%s,\x20%s,\x20%s',_0x36d86,_0x1054('0xf'),JSON[_0x1054('0x10')](_0x2e034c));if(_0x2e034c['error']){if(_0x2e034c['error'][_0x1054('0x11')]===0x1f4){logger[_0x1054('0x12')]('Plugin,\x20%s,\x20%s',_0x36d86,_0x2e034c[_0x1054('0x12')][_0x1054('0x13')]);return _0x18885b(_0x2e034c[_0x1054('0x12')][_0x1054('0x13')]);}logger[_0x1054('0x12')](_0x1054('0xd'),_0x36d86,_0x2e034c['error']['message']);return _0x23dab2(_0x2e034c[_0x1054('0x12')][_0x1054('0x13')]);}else{logger[_0x1054('0x14')](_0x1054('0xd'),_0x36d86,_0x1054('0xf'));_0x23dab2(_0x2e034c[_0x1054('0x15')]['message']);}})[_0x1054('0x16')](function(_0x274054){logger[_0x1054('0x12')](_0x1054('0xd'),_0x36d86,_0x274054);_0x18885b(_0x274054);});});}exports[_0x1054('0x17')]=function(_0x2a7872){var _0x5812a2=this;return new Promise(function(_0x3b5790,_0x2e8b2d){return db[_0x1054('0x18')][_0x1054('0x19')](_0x2a7872[_0x1054('0x1a')],{'raw':_0x2a7872[_0x1054('0x1b')]?_0x2a7872['options'][_0x1054('0x1c')]===undefined?!![]:![]:!![]})[_0x1054('0x1d')](function(_0x3340bd){logger[_0x1054('0x14')](_0x1054('0x17'),_0x2a7872);logger[_0x1054('0xe')](_0x1054('0x17'),_0x2a7872,JSON['stringify'](_0x3340bd));_0x3b5790(_0x3340bd);})['catch'](function(_0x3989d5){logger[_0x1054('0x12')](_0x1054('0x17'),_0x3989d5[_0x1054('0x13')],_0x2a7872);_0x2e8b2d(_0x5812a2[_0x1054('0x12')](0x1f4,_0x3989d5[_0x1054('0x13')]));});});}; \ No newline at end of file +var _0x7bc0=['socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreatePlugin','create','body','options','raw','debug','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost'];(function(_0xa8c027,_0x3f025e){var _0x5684a2=function(_0x5ef668){while(--_0x5ef668){_0xa8c027['push'](_0xa8c027['shift']());}};_0x5684a2(++_0x3f025e);}(_0x7bc0,0x1c2));var _0x07bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x07bc('0x0'));var moment=require(_0x07bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x07bc('0x2'));var fs=require('fs');var Redis=require(_0x07bc('0x3'));var db=require(_0x07bc('0x4'))['db'];var utils=require(_0x07bc('0x5'));var logger=require('../../config/logger')(_0x07bc('0x6'));var config=require(_0x07bc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x07bc('0x8')]({'port':0x232a});config['redis']=_[_0x07bc('0x9')](config[_0x07bc('0xa')],{'host':_0x07bc('0xb'),'port':0x18eb});var socket=require(_0x07bc('0xc'))(new Redis(config[_0x07bc('0xa')]));require(_0x07bc('0xd'))[_0x07bc('0xe')](socket);function respondWithRpcPromise(_0x151e38,_0x42ea1b,_0x311831){return new BPromise(function(_0x1a7f12,_0x48e953){return client[_0x07bc('0xf')](_0x151e38,_0x311831)[_0x07bc('0x10')](function(_0x3c1b7d){logger[_0x07bc('0x11')](_0x07bc('0x12'),_0x42ea1b,_0x07bc('0x13'));logger['debug'](_0x07bc('0x14'),_0x42ea1b,_0x07bc('0x13'),JSON[_0x07bc('0x15')](_0x3c1b7d));if(_0x3c1b7d[_0x07bc('0x16')]){if(_0x3c1b7d['error'][_0x07bc('0x17')]===0x1f4){logger[_0x07bc('0x16')]('Plugin,\x20%s,\x20%s',_0x42ea1b,_0x3c1b7d[_0x07bc('0x16')][_0x07bc('0x18')]);return _0x48e953(_0x3c1b7d[_0x07bc('0x16')][_0x07bc('0x18')]);}logger[_0x07bc('0x16')](_0x07bc('0x12'),_0x42ea1b,_0x3c1b7d[_0x07bc('0x16')]['message']);return _0x1a7f12(_0x3c1b7d['error'][_0x07bc('0x18')]);}else{logger[_0x07bc('0x11')](_0x07bc('0x12'),_0x42ea1b,_0x07bc('0x13'));_0x1a7f12(_0x3c1b7d[_0x07bc('0x19')][_0x07bc('0x18')]);}})['catch'](function(_0x2054ab){logger['error'](_0x07bc('0x12'),_0x42ea1b,_0x2054ab);_0x48e953(_0x2054ab);});});}exports[_0x07bc('0x1a')]=function(_0x4a006c){var _0x2eb4ed=this;return new Promise(function(_0x18244f,_0x322d65){return db['Plugin'][_0x07bc('0x1b')](_0x4a006c[_0x07bc('0x1c')],{'raw':_0x4a006c[_0x07bc('0x1d')]?_0x4a006c[_0x07bc('0x1d')][_0x07bc('0x1e')]===undefined?!![]:![]:!![]})[_0x07bc('0x10')](function(_0x3ead30){logger[_0x07bc('0x11')](_0x07bc('0x1a'),_0x4a006c);logger[_0x07bc('0x1f')](_0x07bc('0x1a'),_0x4a006c,JSON[_0x07bc('0x15')](_0x3ead30));_0x18244f(_0x3ead30);})[_0x07bc('0x20')](function(_0x5eeabf){logger[_0x07bc('0x16')](_0x07bc('0x1a'),_0x5eeabf[_0x07bc('0x18')],_0x4a006c);_0x322d65(_0x2eb4ed[_0x07bc('0x16')](0x1f4,_0x5eeabf[_0x07bc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 3767779..03597de 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 _0xa1a8=['length','plugin:','remove','update','emit','removeListener','register'];(function(_0x36aa12,_0x4f96b5){var _0x127975=function(_0x15a6cd){while(--_0x15a6cd){_0x36aa12['push'](_0x36aa12['shift']());}};_0x127975(++_0x4f96b5);}(_0xa1a8,0x9c));var _0x8a1a=function(_0x1b21f2,_0x2f4776){_0x1b21f2=_0x1b21f2-0x0;var _0x225c1f=_0xa1a8[_0x1b21f2];return _0x225c1f;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x8a1a('0x0'),_0x8a1a('0x1')];function createListener(_0x105cb9,_0x3b283e){return function(_0x229acd){_0x3b283e[_0x8a1a('0x2')](_0x105cb9,_0x229acd);};}function removeListener(_0x1512ad,_0x381eba){return function(){PluginEvents[_0x8a1a('0x3')](_0x1512ad,_0x381eba);};}exports[_0x8a1a('0x4')]=function(_0x2eaa13){for(var _0x506fce=0x0,_0x506348=events[_0x8a1a('0x5')];_0x506fce<_0x506348;_0x506fce++){var _0x1c1a31=events[_0x506fce];var _0x40d87b=createListener(_0x8a1a('0x6')+_0x1c1a31,_0x2eaa13);PluginEvents['on'](_0x1c1a31,_0x40d87b);}}; \ No newline at end of file +var _0xbaf7=['save','remove','update','emit','length','plugin:','./plugin.events'];(function(_0x3c283d,_0x257db4){var _0x532c2a=function(_0x41a3ca){while(--_0x41a3ca){_0x3c283d['push'](_0x3c283d['shift']());}};_0x532c2a(++_0x257db4);}(_0xbaf7,0x172));var _0x7baf=function(_0x8647ae,_0x4dec9e){_0x8647ae=_0x8647ae-0x0;var _0x4bfde6=_0xbaf7[_0x8647ae];return _0x4bfde6;};'use strict';var PluginEvents=require(_0x7baf('0x0'));var events=[_0x7baf('0x1'),_0x7baf('0x2'),_0x7baf('0x3')];function createListener(_0x3d7aed,_0x155e0c){return function(_0x3e347a){_0x155e0c[_0x7baf('0x4')](_0x3d7aed,_0x3e347a);};}function removeListener(_0x58f550,_0x201f2f){return function(){PluginEvents['removeListener'](_0x58f550,_0x201f2f);};}exports['register']=function(_0x482c23){for(var _0x3bedc2=0x0,_0x5687f5=events[_0x7baf('0x5')];_0x3bedc2<_0x5687f5;_0x3bedc2++){var _0x520f05=events[_0x3bedc2];var _0x5e564a=createListener(_0x7baf('0x6')+_0x520f05,_0x482c23);PluginEvents['on'](_0x520f05,_0x5e564a);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 03c0b81..eaee229 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(_0x19386d,_0x14d13d){var _0x4673ee=function(_0x4eed23){while(--_0x4eed23){_0x19386d['push'](_0x19386d['shift']());}};_0x4673ee(++_0x14d13d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x30fc8f,_0x215149){var _0x17b462=function(_0x1b4c3a){while(--_0x1b4c3a){_0x30fc8f['push'](_0x30fc8f['shift']());}};_0x17b462(++_0x215149);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 1904760..be06365 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 _0xb332=['dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20id','lodash','../../config/logger','api','child_process','bluebird','sendStatus','error','stack','name','status','send','npm\x20install','info','list','reject','motion2','length','then','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb332,0xd9));var _0x2b33=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0xb332[_0x4404ff];return _0x5e7b19;};'use strict';var _=require(_0x2b33('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var path=require('path');var exec=require(_0x2b33('0x3'))['exec'];var BPromise=require(_0x2b33('0x4'));function handleEntityNotFound(_0x4c6634,_0x34b111){return function(_0x5e5e86){if(!_0x5e5e86){_0x4c6634[_0x2b33('0x5')](0x194);;}return _0x5e5e86;};}function respondWithResult(_0x22d66,_0x478214){_0x478214=_0x478214||0xc8;return function(_0x461d44){if(_0x461d44){return _0x22d66['status'](_0x478214)['json'](_0x461d44);}return null;};}function handleError(_0x4302b7,_0x5f29ab){_0x5f29ab=_0x5f29ab||0x1f4;return function(_0xb3aeab){logger[_0x2b33('0x6')](_0xb3aeab[_0x2b33('0x7')]);if(_0xb3aeab[_0x2b33('0x8')]){delete _0xb3aeab['name'];}_0x4302b7[_0x2b33('0x9')](_0x5f29ab)[_0x2b33('0xa')](_0xb3aeab);};}function execChildProcess(){return new BPromise(function(_0x1be19d,_0x1d83a6){exec(_0x2b33('0xb'),function(_0xf1e5e5,_0x5251b,_0x2b106e){logger[_0x2b33('0xc')](_0x5251b);logger[_0x2b33('0xc')](_0x2b106e);if(_0xf1e5e5){logger[_0x2b33('0x6')](_0xf1e5e5);return _0x1d83a6(_0xf1e5e5);}return _0x1be19d(_0x5251b);});});}exports['index']=function(_0x183773,_0xa44d45){return pm2[_0x2b33('0xd')]()['then'](function(_0x173c75){if(_0x173c75){var _0x4d39db=_[_0x2b33('0xe')](_0x173c75,function(_0x17292f){return _0x17292f[_0x2b33('0x8')]==='express'||_0x17292f['name']===_0x2b33('0xf');});return{'rows':_0x4d39db,'count':_0x4d39db[_0x2b33('0x10')]};}return null;})[_0x2b33('0x11')](respondWithResult(_0xa44d45,null))[_0x2b33('0x12')](handleError(_0xa44d45,null));};exports[_0x2b33('0x13')]=function(_0x4d69d0,_0x554ab3){return pm2['describe'](_0x4d69d0[_0x2b33('0x14')]['id'])['then'](respondWithResult(_0x554ab3,null))['then'](handleEntityNotFound(_0x554ab3,null))[_0x2b33('0x12')](handleError(_0x554ab3,null));};exports[_0x2b33('0x15')]=function(_0x205d8f,_0x539c5f){if(_0x205d8f[_0x2b33('0x16')]['name']&&_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]){var _0x8c8dc2=path[_0x2b33('0x18')](__dirname,_0x2b33('0x19'),_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]);var _0x4fb725=process[_0x2b33('0x1a')]();process[_0x2b33('0x1b')](path[_0x2b33('0x1c')](_0x8c8dc2));return execChildProcess()[_0x2b33('0x11')](function(_0x58998e){process[_0x2b33('0x1b')](_0x4fb725);return pm2[_0x2b33('0x1d')]({'name':_0x205d8f[_0x2b33('0x16')]['name'],'script':_0x8c8dc2});})[_0x2b33('0x11')](function(_0x1b9a48){pm2[_0x2b33('0x1e')]();return _0x1b9a48[0x0];})[_0x2b33('0x11')](respondWithResult(_0x539c5f,0xc9))['catch'](handleError(_0x539c5f,null));}else{return _0x539c5f[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x1f')});}};exports['update']=function(_0x2e74d0,_0x341e0e){if(_0x2e74d0['body']['id']){delete _0x2e74d0[_0x2b33('0x16')]['id'];}var _0x53c2ad={'online':_0x2b33('0x20'),'stopped':'stop'};if(_0x53c2ad[_0x2b33('0x21')](_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')])){return pm2[_0x53c2ad[_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')]]](_0x2e74d0[_0x2b33('0x14')]['id'])[_0x2b33('0x11')](respondWithResult(_0x341e0e,0xc8))[_0x2b33('0x12')](handleError(_0x341e0e,null));}else{return _0x341e0e[_0x2b33('0x9')](0x1f4)[_0x2b33('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x106ea0,_0x2a081c){if(_0x106ea0[_0x2b33('0x16')]['id']){delete _0x106ea0[_0x2b33('0x16')]['id'];}if(_0x106ea0[_0x2b33('0x14')]['id']){return pm2['delete'](_0x106ea0['params']['id'])[_0x2b33('0x11')](function(_0x3d2aaa){pm2[_0x2b33('0x1e')]();return _0x3d2aaa[0x0];})[_0x2b33('0x11')](respondWithResult(_0x2a081c,null))[_0x2b33('0x12')](handleError(_0x2a081c,null));}else{return _0x2a081c[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x22')});}}; \ No newline at end of file +var _0x39cb=['create','body','join','../../files/plugins','cwd','chdir','start','send','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','../../config/pm2','../../config/logger','path','child_process','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params'];(function(_0x24a51b,_0x41df3b){var _0x4c111d=function(_0x199992){while(--_0x199992){_0x24a51b['push'](_0x24a51b['shift']());}};_0x4c111d(++_0x41df3b);}(_0x39cb,0x1bd));var _0xb39c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x39cb[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var pm2=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var path=require(_0xb39c('0x2'));var exec=require(_0xb39c('0x3'))['exec'];var BPromise=require(_0xb39c('0x4'));function handleEntityNotFound(_0x285eca,_0x398d07){return function(_0x2bca14){if(!_0x2bca14){_0x285eca[_0xb39c('0x5')](0x194);;}return _0x2bca14;};}function respondWithResult(_0x4ae4cf,_0x32cdcd){_0x32cdcd=_0x32cdcd||0xc8;return function(_0x2fc868){if(_0x2fc868){return _0x4ae4cf[_0xb39c('0x6')](_0x32cdcd)[_0xb39c('0x7')](_0x2fc868);}return null;};}function handleError(_0x47d6d7,_0x5ae14a){_0x5ae14a=_0x5ae14a||0x1f4;return function(_0x41557b){logger[_0xb39c('0x8')](_0x41557b[_0xb39c('0x9')]);if(_0x41557b[_0xb39c('0xa')]){delete _0x41557b['name'];}_0x47d6d7['status'](_0x5ae14a)['send'](_0x41557b);};}function execChildProcess(){return new BPromise(function(_0x1de94f,_0x497ffc){exec(_0xb39c('0xb'),function(_0x1088ee,_0x433ee8,_0x340622){logger[_0xb39c('0xc')](_0x433ee8);logger[_0xb39c('0xc')](_0x340622);if(_0x1088ee){logger['error'](_0x1088ee);return _0x497ffc(_0x1088ee);}return _0x1de94f(_0x433ee8);});});}exports[_0xb39c('0xd')]=function(_0x468995,_0x2620cd){return pm2['list']()[_0xb39c('0xe')](function(_0x40a6d3){if(_0x40a6d3){var _0x42a203=_[_0xb39c('0xf')](_0x40a6d3,function(_0x469fa9){return _0x469fa9[_0xb39c('0xa')]===_0xb39c('0x10')||_0x469fa9['name']===_0xb39c('0x11');});return{'rows':_0x42a203,'count':_0x42a203[_0xb39c('0x12')]};}return null;})[_0xb39c('0xe')](respondWithResult(_0x2620cd,null))[_0xb39c('0x13')](handleError(_0x2620cd,null));};exports[_0xb39c('0x14')]=function(_0x3b7fad,_0x1a2f48){return pm2[_0xb39c('0x15')](_0x3b7fad[_0xb39c('0x16')]['id'])[_0xb39c('0xe')](respondWithResult(_0x1a2f48,null))['then'](handleEntityNotFound(_0x1a2f48,null))[_0xb39c('0x13')](handleError(_0x1a2f48,null));};exports[_0xb39c('0x17')]=function(_0x28bbe1,_0x447352){if(_0x28bbe1['body'][_0xb39c('0xa')]&&_0x28bbe1[_0xb39c('0x18')]['script']){var _0x2d8e93=path[_0xb39c('0x19')](__dirname,_0xb39c('0x1a'),_0x28bbe1['body']['script']);var _0x2789fd=process[_0xb39c('0x1b')]();process[_0xb39c('0x1c')](path['dirname'](_0x2d8e93));return execChildProcess()[_0xb39c('0xe')](function(_0x438207){process[_0xb39c('0x1c')](_0x2789fd);return pm2[_0xb39c('0x1d')]({'name':_0x28bbe1[_0xb39c('0x18')]['name'],'script':_0x2d8e93});})[_0xb39c('0xe')](function(_0xbeab7e){pm2['dump']();return _0xbeab7e[0x0];})[_0xb39c('0xe')](respondWithResult(_0x447352,0xc9))[_0xb39c('0x13')](handleError(_0x447352,null));}else{return _0x447352[_0xb39c('0x6')](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x1f')});}};exports['update']=function(_0x23a2f1,_0x299c27){if(_0x23a2f1[_0xb39c('0x18')]['id']){delete _0x23a2f1['body']['id'];}var _0x41fff2={'online':_0xb39c('0x20'),'stopped':'stop'};if(_0x41fff2[_0xb39c('0x21')](_0x23a2f1[_0xb39c('0x18')][_0xb39c('0x6')])){return pm2[_0x41fff2[_0x23a2f1['body'][_0xb39c('0x6')]]](_0x23a2f1[_0xb39c('0x16')]['id'])['then'](respondWithResult(_0x299c27,0xc8))[_0xb39c('0x13')](handleError(_0x299c27,null));}else{return _0x299c27['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x22')});}};exports[_0xb39c('0x23')]=function(_0x7339b4,_0x17eb7b){if(_0x7339b4['body']['id']){delete _0x7339b4[_0xb39c('0x18')]['id'];}if(_0x7339b4['params']['id']){return pm2[_0xb39c('0x24')](_0x7339b4['params']['id'])[_0xb39c('0xe')](function(_0xe2111a){pm2[_0xb39c('0x25')]();return _0xe2111a[0x0];})[_0xb39c('0xe')](respondWithResult(_0x17eb7b,null))['catch'](handleError(_0x17eb7b,null));}else{return _0x17eb7b['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x26')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index cfb8896..c21d5c5 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 _0xcc38=['/agents','getAgents','/queues','express','./realtime.controller'];(function(_0x56188d,_0x514566){var _0x6004b1=function(_0x43ec36){while(--_0x43ec36){_0x56188d['push'](_0x56188d['shift']());}};_0x6004b1(++_0x514566);}(_0xcc38,0x99));var _0x8cc3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcc38[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x8cc3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x8cc3('0x1'));router['get'](_0x8cc3('0x2'),auth['isAuthenticated'](),controller[_0x8cc3('0x3')]);router['get'](_0x8cc3('0x4'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0xb5ee=['/queues','isAuthenticated','getQueues','exports','express','../../components/auth/service','./realtime.controller','getAgents','get'];(function(_0x2d0910,_0x692f39){var _0x5537a5=function(_0x286196){while(--_0x286196){_0x2d0910['push'](_0x2d0910['shift']());}};_0x5537a5(++_0x692f39);}(_0xb5ee,0x82));var _0xeb5e=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xb5ee[_0x5ce8b9];return _0xe34be0;};'use strict';var express=require(_0xeb5e('0x0'));var router=express['Router']();var auth=require(_0xeb5e('0x1'));var controller=require(_0xeb5e('0x2'));router['get']('/agents',auth['isAuthenticated'](),controller[_0xeb5e('0x3')]);router[_0xeb5e('0x4')](_0xeb5e('0x5'),auth[_0xeb5e('0x6')](),controller[_0xeb5e('0x7')]);module[_0xeb5e('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 44e2256..e37faad 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 _0xd373=['getQueues','resolve','Queue','type','QueueCampaigns','getResources','findAndCountAll','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','api','client','http','offset','limit','undefined','count','set','Content-Range','json','name','status','send','startCase','Queues','then','error','format','catch','request','VoiceQueuesChannels','result','loggedIn','available','waiting','voice','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','paused','outbound','pTalking','originated','find','merge','filter','queue','length','some','connectedlinenum','talking','getMembers','UserId','accountcode','voiceStatus','loggedInDb','busy','agents','push','User','Pause','findAll','QueueId','online','getChannels','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','pause','*pause','channel','sort','includes','globalStatus','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','key','role','agent','getOptions','sequelize','literal','FIELD(id,','forEach','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus'];(function(_0x218b74,_0x657c2e){var _0x28b0de=function(_0x37a8b6){while(--_0x37a8b6){_0x218b74['push'](_0x218b74['shift']());}};_0x28b0de(++_0x657c2e);}(_0xd373,0xfd));var _0x3d37=function(_0x527626,_0x44e599){_0x527626=_0x527626-0x0;var _0x2fc32f=_0xd373[_0x527626];return _0x2fc32f;};'use strict';var util=require('util');var _=require(_0x3d37('0x0'));var jayson=require(_0x3d37('0x1'));var rta=require(_0x3d37('0x2'));var qs=require(_0x3d37('0x3'));var utils=require(_0x3d37('0x4'));var logger=require(_0x3d37('0x5'))(_0x3d37('0x6'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x3d37('0x7')][_0x3d37('0x8')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x151cd1,_0xddb72e){return function(_0x27cee1){if(_0x27cee1){var _0x36739f=typeof _0xddb72e[_0x3d37('0x9')]==='undefined'&&typeof _0xddb72e[_0x3d37('0xa')]===_0x3d37('0xb');var _0x5f57db=_0x27cee1[_0x3d37('0xc')];var _0x57bc51=_0x36739f?0x0:_0xddb72e[_0x3d37('0x9')];var _0x18ac31=_0x36739f?_0x27cee1[_0x3d37('0xc')]:_0xddb72e[_0x3d37('0x9')]+_0xddb72e[_0x3d37('0xa')];var _0x4cf0b3;if(_0x18ac31>=_0x5f57db){_0x18ac31=_0x5f57db;_0x4cf0b3=0xc8;}else{_0x4cf0b3=0xce;}_0x151cd1['status'](_0x4cf0b3);return _0x151cd1[_0x3d37('0xd')](_0x3d37('0xe'),_0x57bc51+'-'+_0x18ac31+'/'+_0x5f57db)[_0x3d37('0xf')](_0x27cee1);}return null;};}function handleError(_0x244e68,_0x258aea){_0x258aea=_0x258aea||0x1f4;return function(_0x253f19){logger['error'](_0x253f19['stack']);if(_0x253f19[_0x3d37('0x10')]){delete _0x253f19[_0x3d37('0x10')];}_0x244e68[_0x3d37('0x11')](_0x258aea)[_0x3d37('0x12')](_0x253f19);};}function getRealtimeQueues(_0x27ff2c,_0x1939a3){return new Promise(function(_0x4c6921,_0x435148){var _0x402804=_0x1939a3==='voice'?amiClient:routingClient;return _0x402804['request'](_[_0x3d37('0x13')](_0x1939a3)+_0x3d37('0x14'),_0x27ff2c)[_0x3d37('0x15')](function(_0x4c00fa){if(_0x4c00fa[_0x3d37('0x16')])throw new Error(util[_0x3d37('0x17')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1939a3));return _0x4c6921(_0x4c00fa['result']);})[_0x3d37('0x18')](function(_0x52a9b5){_0x435148(_0x52a9b5);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4cf660,_0x5320db){return amiClient[_0x3d37('0x19')](_0x3d37('0x1a'),{})[_0x3d37('0x15')](function(_0x46577c){if(_0x46577c['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x4cf660(_0x46577c[_0x3d37('0x1b')]);})[_0x3d37('0x18')](function(_0x3fdff6){_0x5320db(_0x3fdff6);});});}function initializeQueues(_0x29bcc9,_0x5ab8ce,_0x42a956,_0x3c09da){var _0x32d95d=[_0x3d37('0x1c'),_0x3d37('0x1d'),_0x3d37('0x1e'),'talking','paused'];if(_0x42a956===_0x3d37('0x1f')&&_0x3c09da==='outbound'){_0x32d95d['push']('pTalking','originated',_0x3d37('0x20'),_0x3d37('0x21'),_0x3d37('0x22'),_0x3d37('0x23'),_0x3d37('0x24'),_0x3d37('0x25'),'erlangCalls',_0x3d37('0x26'),'erlangAbandonmentRate',_0x3d37('0x27'),'dialPredictiveInterval',_0x3d37('0x28'),_0x3d37('0x29'),_0x3d37('0x2a'),_0x3d37('0x2b'),_0x3d37('0x2c'),'predictiveIntervalDroppedCallsTimeout',_0x3d37('0x2d'),_0x3d37('0x2e'),_0x3d37('0x2f'));}return _0x29bcc9[_0x3d37('0x30')](function(_0x3b729a){var _0xb41f21=_0x3b729a[_0x3d37('0x31')]({'plain':!![]});_0xb41f21['agents']=[];_0xb41f21[_0x3d37('0x32')]=0x0;_0xb41f21['loggedInDb']=0x0;_0xb41f21[_0x3d37('0x1c')]=0x0;_0xb41f21[_0x3d37('0x1d')]=0x0;_0xb41f21[_0x3d37('0x1e')]=0x0;if(_0x42a956===_0x3d37('0x1f')){_0xb41f21['talking']=0x0;_0xb41f21['busy']=0x0;if(_0x3c09da===_0x3d37('0x33')){_0xb41f21[_0x3d37('0x34')]=0x0;_0xb41f21[_0x3d37('0x35')]=0x0;}}var _0x5dc361=_[_0x3d37('0x36')](_0x5ab8ce,['id',_0xb41f21['id']]);if(_0x5dc361)_[_0x3d37('0x37')](_0xb41f21,_['pick'](_0x5dc361,_0x32d95d));return _0xb41f21;});}function updateAgentVoiceStatus(_0x5bbe0f,_0x51bf0d,_0x191db1){var _0x283a1f=_[_0x3d37('0x38')](_0x191db1,[_0x3d37('0x39'),_0x51bf0d['name']]);if(_0x283a1f[_0x3d37('0x3a')]===0x0)return _0x5bbe0f['busy']=!![];if(_[_0x3d37('0x3b')](_0x283a1f,[_0x3d37('0x3c'),_0x5bbe0f['internal']['toString']()]))return _0x5bbe0f[_0x3d37('0x3d')]=!![];if(!_0x5bbe0f[_0x3d37('0x3d')])return _0x5bbe0f['busy']=!![];}function getVoiceQueueAgents(_0x9fcfc7,_0x1b576d,_0x18f384,_0x9f754f){var _0xf9b804=_['find'](_0x1b576d,['id',_0x9fcfc7['id']]);if(!_0xf9b804)return _0x9fcfc7;return _0xf9b804[_0x3d37('0x3e')]({'raw':!![]})['then'](function(_0x590c7b){for(var _0x5ea871=0x0;_0x5ea871<_0x590c7b['length'];_0x5ea871++){var _0x4df7e4=_[_0x3d37('0x36')](_0x18f384,['id',_0x590c7b[_0x5ea871][_0x3d37('0x3f')]]);if(!_0x4df7e4){_0x4df7e4={'id':_0x590c7b[_0x5ea871][_0x3d37('0x3f')],'name':_0x590c7b[_0x5ea871][_0x3d37('0x3f')],'accountcode':'','online':![]};}var _0x5d5b2c={'id':_0x4df7e4['id'],'name':_0x4df7e4[_0x3d37('0x10')],'internal':_0x4df7e4[_0x3d37('0x40')],'online':Boolean(_0x4df7e4['online']),'paused':Boolean(_0x590c7b[_0x5ea871][_0x3d37('0x32')])};if(_0x4df7e4[_0x3d37('0x41')]===_0x3d37('0x3d'))updateAgentVoiceStatus(_0x5d5b2c,_0x9fcfc7,_0x9f754f);if(_0x5d5b2c['online'])_0x9fcfc7[_0x3d37('0x42')]++;if(_0x5d5b2c[_0x3d37('0x43')])_0x9fcfc7[_0x3d37('0x43')]++;if(_0x5d5b2c[_0x3d37('0x32')]&&!_0x5d5b2c[_0x3d37('0x43')]&&!_0x5d5b2c[_0x3d37('0x3d')])_0x9fcfc7[_0x3d37('0x32')]++;_0x9fcfc7[_0x3d37('0x44')][_0x3d37('0x45')](_0x5d5b2c);}return _0x9fcfc7;});}function getQueueAgents(_0x46afc0,_0x4f92c9,_0x59e1f1){var _0xa70644=_0x3d37('0x46')+_[_0x3d37('0x13')](_0x59e1f1)+'Queue';var _0x482424=_0x59e1f1+_0x3d37('0x47');return db[_0xa70644][_0x3d37('0x48')]({'where':{[_['startCase'](_0x59e1f1)+_0x3d37('0x49')]:_0x46afc0['id']},'raw':!![]})[_0x3d37('0x15')](function(_0x4ae5f5){for(var _0x5c5164=0x0;_0x5c5164<_0x4ae5f5[_0x3d37('0x3a')];_0x5c5164++){var _0x4e078a=_[_0x3d37('0x36')](_0x4f92c9,['id',_0x4ae5f5[_0x5c5164]['UserId']]);if(!_0x4e078a){_0x4e078a={'id':_0x4ae5f5[_0x5c5164][_0x3d37('0x3f')],'name':_0x4ae5f5[_0x5c5164]['UserId'],'online':![],['pauseField']:![]};}var _0x261901={'id':_0x4e078a['id'],'name':_0x4e078a[_0x3d37('0x10')],'online':Boolean(_0x4e078a['online']),'paused':Boolean(_0x4e078a[_0x482424])};if(_0x261901[_0x3d37('0x4a')])_0x46afc0[_0x3d37('0x42')]++;_0x46afc0[_0x3d37('0x44')][_0x3d37('0x45')](_0x261901);}return _0x46afc0;});}function validateChannel(_0x4c264d){var _0x4d4656=utils[_0x3d37('0x4b')]();if(!_['includes'](_0x4d4656,_0x4c264d[_0x3d37('0x4c')]()))throw new Error(_0x3d37('0x4d'));return _0x4c264d[_0x3d37('0x4c')]();}exports[_0x3d37('0x4e')]=function(_0x56bd07,_0x3a4c3c){var _0x357412={'count':0x0,'rows':[]};var _0x46f1a0={};var _0x4b25cc;var _0x2190c0;var _0x4ac4c4;var _0x2fcd18;var _0x108d63=utils[_0x3d37('0x4b')]();var _0x42422f=_0x56bd07[_0x3d37('0x4f')][_0x3d37('0x50')];var _0x3df165=_0x56bd07[_0x3d37('0x4f')][_0x3d37('0x51')];var _0x54194c=_0x56bd07['query']['pauseTypeFilter'];var _0x12978b=_0x3df165===_0x3d37('0x52')||_0x3df165===_0x3d37('0x53')?!![]:![];var _0x533d26=[];var _0x4bbc8c;Promise['resolve']()[_0x3d37('0x15')](function(){if(_0x56bd07['query']['channel']){_0x4b25cc=validateChannel(_0x56bd07[_0x3d37('0x4f')][_0x3d37('0x54')]);}if(!_0x56bd07[_0x3d37('0x4f')]['sort']||!_0x56bd07['query'][_0x3d37('0x55')][_0x3d37('0x56')](_0x3d37('0x57'))){_0x56bd07[_0x3d37('0x4f')]['sort']=rta['validateSortParameter'](_0x56bd07[_0x3d37('0x4f')][_0x3d37('0x55')]);return;}var _0x5b1f8b=rta['getUpdatedSortOptions'](_0x56bd07[_0x3d37('0x4f')][_0x3d37('0x55')]);_0x56bd07[_0x3d37('0x4f')]['sort']=_0x5b1f8b[_0x3d37('0x58')]['join'](',');_0x2190c0=_0x5b1f8b[_0x3d37('0x59')];})[_0x3d37('0x15')](function(){if(!_0x42422f){return[];}return rta[_0x3d37('0x5a')](_0x42422f,_0x4b25cc);})[_0x3d37('0x15')](function(_0x4673b4){_0x533d26=_0x4673b4;return rta[_0x3d37('0x5b')]();})[_0x3d37('0x15')](function(_0x549327){_0x2fcd18=_0x549327[_0x3d37('0x5c')];if((!_0x3df165||_0x12978b)&&!_0x2190c0){return _0x533d26;}if(_0x2190c0&&!_0x3df165){return rta[_0x3d37('0x5d')](_0x2fcd18,_0x533d26,_0x2190c0);}else{return rta[_0x3d37('0x5e')](_0x2fcd18,_0x533d26,_0x3df165);}})[_0x3d37('0x15')](function(_0x31db14){_0x533d26=_0x31db14;var _0x40f2ac=![];if(_0x533d26[_0x3d37('0x3a')]===0x0){if(_0x42422f||_0x3df165){_0x40f2ac=!![];}if(_0x12978b){_0x40f2ac=![];}}if(_0x40f2ac){return _0x357412;}var _0x11890a=_['map'](db[_0x3d37('0x46')][_0x3d37('0x5f')],function(_0x4ee0fe){return{'name':_0x4ee0fe[_0x3d37('0x60')],'type':_0x4ee0fe['type'][_0x3d37('0x61')]};});_0x56bd07[_0x3d37('0x4f')][_0x3d37('0x62')]=_0x3d37('0x63');_0x56bd07[_0x3d37('0x4f')]['online']=!![];_0x46f1a0=qs[_0x3d37('0x64')](_0x11890a,_0x56bd07);_0x46f1a0['raw']=!![];var _0x4d3415=[];if(_0x533d26[_0x3d37('0x3a')]>0x0){_0x4d3415[_0x3d37('0x45')]({'id':{'$in':_0x533d26}});if(_0x2190c0&&!_0x3df165){_0x4bbc8c=[db[_0x3d37('0x65')][_0x3d37('0x66')](_0x3d37('0x67')+_0x533d26+')')];_0x46f1a0[_0x3d37('0x59')]=_0x4bbc8c;}}if(_0x12978b){_0x108d63[_0x3d37('0x68')](function(_0x4190e9){var _0xf9d454=!![];if(_0x3df165===_0x3d37('0x53')&&_0x4b25cc!==_0x4190e9){_0xf9d454=![];}_0x4d3415[_0x3d37('0x45')]({[_0x4190e9+'Pause']:_0xf9d454});});if(_0x54194c){_0x4d3415[_0x3d37('0x45')]({'pauseType':_0x54194c});}}else if(_0x3df165){_0x108d63[_0x3d37('0x68')](function(_0x1ca6a0){_0x4d3415[_0x3d37('0x45')]({[_0x1ca6a0+_0x3d37('0x47')]:![]});});}_0x46f1a0[_0x3d37('0x69')]=_['merge'](_0x46f1a0['where'],{'$and':_0x4d3415});if(_0x56bd07[_0x3d37('0x6a')][_0x3d37('0x62')]===_0x3d37('0x6a')){var _0xa88d2e={'params':{'id':_0x56bd07[_0x3d37('0x6a')][_0x3d37('0x6b')]},'query':{'section':_0x3d37('0x6c'),'role':'agent','online':!![],'raw':!![],'ids':_0x533d26,'customSorting':_0x4bbc8c}};if(_0x12978b){_0xa88d2e['query'][_0x3d37('0x6d')]=_0x4d3415;}_0xa88d2e[_0x3d37('0x4f')]=Object[_0x3d37('0x6e')](_0xa88d2e[_0x3d37('0x4f')],_0x56bd07[_0x3d37('0x4f')]);delete _0xa88d2e[_0x3d37('0x4f')]['id'];return db[_0x3d37('0x6f')]['getResources'](_0xa88d2e);}return db[_0x3d37('0x46')]['findAndCountAll'](_0x46f1a0);})['then'](function(_0x1aae72){_0x357412['count']=_0x1aae72[_0x3d37('0xc')];_0x4ac4c4=_0x1aae72[_0x3d37('0x5c')];return _0x4ac4c4[_0x3d37('0x30')](function(_0x4024af){var _0x3cf1d5=_[_0x3d37('0x36')](_0x2fcd18,['id',_0x4024af['id']]);if(_0x3cf1d5){var _0x52f801=rta[_0x3d37('0x70')](_0x3cf1d5);_['merge'](_0x4024af,_0x52f801);}_0x4024af[_0x3d37('0x57')]=rta[_0x3d37('0x71')](_0x4024af);if(_0x4024af[_0x3d37('0x57')][_0x3d37('0x56')](_0x3d37('0x52'))){_0x108d63[_0x3d37('0x68')](function(_0x1444af){if(_0x4024af[_0x1444af+'Pause']){_0x4024af[_0x1444af+_0x3d37('0x72')]=_0x3d37('0x52');}});}return _0x4024af;});})['then'](function(_0x221f44){if(!_0x2190c0||_0x4bbc8c){return _0x221f44;}return rta[_0x3d37('0x73')](_0x221f44,_0x2190c0);})[_0x3d37('0x15')](function(_0x113dad){_0x357412[_0x3d37('0x5c')]=_0x113dad;return _0x357412;})[_0x3d37('0x15')](respondWithFilteredResult(_0x3a4c3c,_0x46f1a0))[_0x3d37('0x18')](handleError(_0x3a4c3c,null));};exports[_0x3d37('0x74')]=function(_0x4206bd,_0x206348){var _0x575b96={'count':0x0,'rows':[]},_0xaad43b={},_0x21cb82,_0x278287,_0x35ba74,_0x34b402,_0x4e2fa2;Promise[_0x3d37('0x75')]()[_0x3d37('0x15')](function(){if(_0x4206bd[_0x3d37('0x4f')]['channel'])_0x21cb82=validateChannel(_0x4206bd[_0x3d37('0x4f')][_0x3d37('0x54')]);var _0x58aabc=_[_0x3d37('0x13')](_0x21cb82)+_0x3d37('0x76');var _0x32cd46=_['map'](db[_0x58aabc]['rawAttributes'],function(_0x4235c6){return{'name':_0x4235c6[_0x3d37('0x60')],'type':_0x4235c6[_0x3d37('0x77')][_0x3d37('0x61')]};});_0xaad43b=qs[_0x3d37('0x64')](_0x32cd46,_0x4206bd);if(_0x4206bd['user']['role']==='user'){var _0x42cf46={'params':{'id':_0x4206bd['user']['userProfileId']},'query':{'section':_0x21cb82==='voice'&&_0x4206bd[_0x3d37('0x4f')]['type']==='outbound'?_0x3d37('0x78'):_['startCase'](_0x21cb82)+'Queues','type':_0x4206bd[_0x3d37('0x4f')]['type'],'nolimit':!![],'sort':_0x3d37('0x10'),'filter':_0x4206bd[_0x3d37('0x4f')][_0x3d37('0x38')]}};return db['UserProfile'][_0x3d37('0x79')](_0x42cf46);}return db[_0x58aabc][_0x3d37('0x7a')](_0xaad43b);})[_0x3d37('0x15')](function(_0x883c36){_0x575b96[_0x3d37('0xc')]=_0x883c36['count'];_0x278287=_0x883c36[_0x3d37('0x5c')];return getRealtimeQueues(_0x4206bd,_0x21cb82);})['then'](function(_0x2e9960){_0x34b402=_0x2e9960[_0x3d37('0x5c')];return rta[_0x3d37('0x5b')]();})[_0x3d37('0x15')](function(_0x4a407a){_0x35ba74=_0x4a407a[_0x3d37('0x5c')];if(_0x21cb82!=_0x3d37('0x1f'))return;return getRealtimeVoiceQueueChannels();})[_0x3d37('0x15')](function(_0xc1574a){_0x4e2fa2=_0xc1574a?_0xc1574a[_0x3d37('0x5c')]:[];return initializeQueues(_0x278287,_0x34b402,_0x21cb82,_0x4206bd['query'][_0x3d37('0x77')]);})[_0x3d37('0x15')](function(_0x55319c){var _0x723668=_0x55319c[_0x3d37('0x30')](function(_0x32960f){if(_0x21cb82===_0x3d37('0x1f'))return getVoiceQueueAgents(_0x32960f,_0x278287,_0x35ba74,_0x4e2fa2);else return getQueueAgents(_0x32960f,_0x35ba74,_0x21cb82);});return Promise['all'](_0x723668);})['then'](function(_0x3f4e54){_0x575b96['rows']=_0x3f4e54;return _0x575b96;})[_0x3d37('0x15')](respondWithFilteredResult(_0x206348,_0xaad43b))[_0x3d37('0x18')](handleError(_0x206348,null));}; \ No newline at end of file +var _0xea5d=['getResources','all','util','lodash','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','limit','undefined','count','offset','status','Content-Range','json','stack','name','send','startCase','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','voice','outbound','push','pTalking','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','loggedInDb','originated','find','pick','queue','length','busy','some','connectedlinenum','toString','getMembers','UserId','accountcode','online','agents','User','QueueId','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','channel','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','rawAttributes','type','key','role','agent','getOptions','literal','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','findAndCountAll','filterAgentAttributes','getAgentStatus','pause','sortAgentsByStatus','getQueues','resolve','Queue','QueueCampaigns','Queues','filter'];(function(_0x49526c,_0x348193){var _0x4033f6=function(_0x202d18){while(--_0x202d18){_0x49526c['push'](_0x49526c['shift']());}};_0x4033f6(++_0x348193);}(_0xea5d,0x170));var _0xdea5=function(_0x3d7ace,_0x380db1){_0x3d7ace=_0x3d7ace-0x0;var _0x6925ec=_0xea5d[_0x3d7ace];return _0x6925ec;};'use strict';var util=require(_0xdea5('0x0'));var _=require(_0xdea5('0x1'));var jayson=require('jayson/promise');var rta=require(_0xdea5('0x2'));var qs=require(_0xdea5('0x3'));var utils=require(_0xdea5('0x4'));var logger=require(_0xdea5('0x5'))(_0xdea5('0x6'));var db=require(_0xdea5('0x7'))['db'];var amiClient=jayson[_0xdea5('0x8')][_0xdea5('0x9')]({'port':0x232a});var routingClient=jayson[_0xdea5('0x8')][_0xdea5('0x9')]({'port':0x232c});function respondWithFilteredResult(_0x16cfd9,_0x30213b){return function(_0x1cbb74){if(_0x1cbb74){var _0x2c202a=typeof _0x30213b['offset']==='undefined'&&typeof _0x30213b[_0xdea5('0xa')]===_0xdea5('0xb');var _0x2cefda=_0x1cbb74[_0xdea5('0xc')];var _0x21628b=_0x2c202a?0x0:_0x30213b[_0xdea5('0xd')];var _0x4926f7=_0x2c202a?_0x1cbb74[_0xdea5('0xc')]:_0x30213b[_0xdea5('0xd')]+_0x30213b[_0xdea5('0xa')];var _0x19d149;if(_0x4926f7>=_0x2cefda){_0x4926f7=_0x2cefda;_0x19d149=0xc8;}else{_0x19d149=0xce;}_0x16cfd9[_0xdea5('0xe')](_0x19d149);return _0x16cfd9['set'](_0xdea5('0xf'),_0x21628b+'-'+_0x4926f7+'/'+_0x2cefda)[_0xdea5('0x10')](_0x1cbb74);}return null;};}function handleError(_0x227262,_0x426e92){_0x426e92=_0x426e92||0x1f4;return function(_0x264033){logger['error'](_0x264033[_0xdea5('0x11')]);if(_0x264033[_0xdea5('0x12')]){delete _0x264033[_0xdea5('0x12')];}_0x227262[_0xdea5('0xe')](_0x426e92)[_0xdea5('0x13')](_0x264033);};}function getRealtimeQueues(_0x400b49,_0xce3685){return new Promise(function(_0x548c6f,_0x2d7331){var _0x3e03ab=_0xce3685==='voice'?amiClient:routingClient;return _0x3e03ab['request'](_[_0xdea5('0x14')](_0xce3685)+'Queues',_0x400b49)[_0xdea5('0x15')](function(_0x3784e7){if(_0x3784e7[_0xdea5('0x16')])throw new Error(util['format'](_0xdea5('0x17'),_0xce3685));return _0x548c6f(_0x3784e7[_0xdea5('0x18')]);})[_0xdea5('0x19')](function(_0x2d90f5){_0x2d7331(_0x2d90f5);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x37a8b3,_0x1975a1){return amiClient['request'](_0xdea5('0x1a'),{})['then'](function(_0x1b7318){if(_0x1b7318[_0xdea5('0x16')])throw new Error(_0xdea5('0x1b'));return _0x37a8b3(_0x1b7318['result']);})[_0xdea5('0x19')](function(_0x1381f2){_0x1975a1(_0x1381f2);});});}function initializeQueues(_0x849c48,_0x4a5558,_0x2a09c7,_0x27c0a8){var _0x5ae645=[_0xdea5('0x1c'),_0xdea5('0x1d'),_0xdea5('0x1e'),_0xdea5('0x1f'),_0xdea5('0x20')];if(_0x2a09c7===_0xdea5('0x21')&&_0x27c0a8===_0xdea5('0x22')){_0x5ae645[_0xdea5('0x23')](_0xdea5('0x24'),'originated',_0xdea5('0x25'),_0xdea5('0x26'),_0xdea5('0x27'),'Trunk',_0xdea5('0x28'),_0xdea5('0x29'),_0xdea5('0x2a'),_0xdea5('0x2b'),'erlangAbandonmentRate','erlangBusyFactor',_0xdea5('0x2c'),_0xdea5('0x2d'),_0xdea5('0x2e'),_0xdea5('0x2f'),_0xdea5('0x30'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0xdea5('0x31'),_0xdea5('0x32'),'predictiveIntervalAvgTalktime');}return _0x849c48[_0xdea5('0x33')](function(_0x599ae6){var _0x179dc0=_0x599ae6[_0xdea5('0x34')]({'plain':!![]});_0x179dc0['agents']=[];_0x179dc0[_0xdea5('0x20')]=0x0;_0x179dc0[_0xdea5('0x35')]=0x0;_0x179dc0[_0xdea5('0x1c')]=0x0;_0x179dc0[_0xdea5('0x1d')]=0x0;_0x179dc0[_0xdea5('0x1e')]=0x0;if(_0x2a09c7==='voice'){_0x179dc0[_0xdea5('0x1f')]=0x0;_0x179dc0['busy']=0x0;if(_0x27c0a8===_0xdea5('0x22')){_0x179dc0['pTalking']=0x0;_0x179dc0[_0xdea5('0x36')]=0x0;}}var _0x2893fb=_[_0xdea5('0x37')](_0x4a5558,['id',_0x179dc0['id']]);if(_0x2893fb)_['merge'](_0x179dc0,_[_0xdea5('0x38')](_0x2893fb,_0x5ae645));return _0x179dc0;});}function updateAgentVoiceStatus(_0x3bb2ea,_0x4c1550,_0x2cee32){var _0x1b76d9=_['filter'](_0x2cee32,[_0xdea5('0x39'),_0x4c1550['name']]);if(_0x1b76d9[_0xdea5('0x3a')]===0x0)return _0x3bb2ea[_0xdea5('0x3b')]=!![];if(_[_0xdea5('0x3c')](_0x1b76d9,[_0xdea5('0x3d'),_0x3bb2ea['internal'][_0xdea5('0x3e')]()]))return _0x3bb2ea[_0xdea5('0x1f')]=!![];if(!_0x3bb2ea[_0xdea5('0x1f')])return _0x3bb2ea[_0xdea5('0x3b')]=!![];}function getVoiceQueueAgents(_0x3beb29,_0x30840c,_0x6e5c7a,_0x36e9b7){var _0x54b3e8=_[_0xdea5('0x37')](_0x30840c,['id',_0x3beb29['id']]);if(!_0x54b3e8)return _0x3beb29;return _0x54b3e8[_0xdea5('0x3f')]({'raw':!![]})[_0xdea5('0x15')](function(_0x28c6a9){for(var _0x543033=0x0;_0x543033<_0x28c6a9[_0xdea5('0x3a')];_0x543033++){var _0x45954c=_[_0xdea5('0x37')](_0x6e5c7a,['id',_0x28c6a9[_0x543033][_0xdea5('0x40')]]);if(!_0x45954c){_0x45954c={'id':_0x28c6a9[_0x543033][_0xdea5('0x40')],'name':_0x28c6a9[_0x543033]['UserId'],'accountcode':'','online':![]};}var _0x4366a4={'id':_0x45954c['id'],'name':_0x45954c[_0xdea5('0x12')],'internal':_0x45954c[_0xdea5('0x41')],'online':Boolean(_0x45954c[_0xdea5('0x42')]),'paused':Boolean(_0x28c6a9[_0x543033]['paused'])};if(_0x45954c['voiceStatus']===_0xdea5('0x1f'))updateAgentVoiceStatus(_0x4366a4,_0x3beb29,_0x36e9b7);if(_0x4366a4[_0xdea5('0x42')])_0x3beb29[_0xdea5('0x35')]++;if(_0x4366a4[_0xdea5('0x3b')])_0x3beb29[_0xdea5('0x3b')]++;if(_0x4366a4[_0xdea5('0x20')]&&!_0x4366a4[_0xdea5('0x3b')]&&!_0x4366a4[_0xdea5('0x1f')])_0x3beb29[_0xdea5('0x20')]++;_0x3beb29[_0xdea5('0x43')][_0xdea5('0x23')](_0x4366a4);}return _0x3beb29;});}function getQueueAgents(_0x1442b2,_0xd4c572,_0x4e7c51){var _0x1c577=_0xdea5('0x44')+_[_0xdea5('0x14')](_0x4e7c51)+'Queue';var _0x9a4fe9=_0x4e7c51+'Pause';return db[_0x1c577]['findAll']({'where':{[_['startCase'](_0x4e7c51)+_0xdea5('0x45')]:_0x1442b2['id']},'raw':!![]})['then'](function(_0x8020b0){for(var _0x338ab6=0x0;_0x338ab6<_0x8020b0[_0xdea5('0x3a')];_0x338ab6++){var _0xe3f08a=_[_0xdea5('0x37')](_0xd4c572,['id',_0x8020b0[_0x338ab6][_0xdea5('0x40')]]);if(!_0xe3f08a){_0xe3f08a={'id':_0x8020b0[_0x338ab6][_0xdea5('0x40')],'name':_0x8020b0[_0x338ab6][_0xdea5('0x40')],'online':![],['pauseField']:![]};}var _0x22de4f={'id':_0xe3f08a['id'],'name':_0xe3f08a[_0xdea5('0x12')],'online':Boolean(_0xe3f08a[_0xdea5('0x42')]),'paused':Boolean(_0xe3f08a[_0x9a4fe9])};if(_0x22de4f[_0xdea5('0x42')])_0x1442b2[_0xdea5('0x35')]++;_0x1442b2[_0xdea5('0x43')][_0xdea5('0x23')](_0x22de4f);}return _0x1442b2;});}function validateChannel(_0x157ea5){var _0x12fa49=utils[_0xdea5('0x46')]();if(!_[_0xdea5('0x47')](_0x12fa49,_0x157ea5[_0xdea5('0x48')]()))throw new Error(_0xdea5('0x49'));return _0x157ea5[_0xdea5('0x48')]();}exports[_0xdea5('0x4a')]=function(_0x10c7d9,_0x59bb0e){var _0x1a7b2b={'count':0x0,'rows':[]};var _0x239ed7={};var _0x3422c7;var _0x2bfef7;var _0x5de995;var _0x1a2fb3;var _0x26c335=utils[_0xdea5('0x46')]();var _0x484323=_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x4c')];var _0x2272d8=_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x4d')];var _0x2a3488=_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x4e')];var _0x5168d0=_0x2272d8==='pause'||_0x2272d8===_0xdea5('0x4f')?!![]:![];var _0x5ac12b=[];var _0x3b8532;Promise['resolve']()['then'](function(){if(_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x50')]){_0x3422c7=validateChannel(_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x50')]);}if(!_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x51')]||!_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x51')][_0xdea5('0x47')](_0xdea5('0x52'))){_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x51')]=rta[_0xdea5('0x53')](_0x10c7d9['query'][_0xdea5('0x51')]);return;}var _0x4a3671=rta[_0xdea5('0x54')](_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x51')]);_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x51')]=_0x4a3671['fields'][_0xdea5('0x55')](',');_0x2bfef7=_0x4a3671[_0xdea5('0x56')];})[_0xdea5('0x15')](function(){if(!_0x484323){return[];}return rta[_0xdea5('0x57')](_0x484323,_0x3422c7);})['then'](function(_0x3e54e4){_0x5ac12b=_0x3e54e4;return rta[_0xdea5('0x58')]();})[_0xdea5('0x15')](function(_0x4e616b){_0x1a2fb3=_0x4e616b[_0xdea5('0x59')];if((!_0x2272d8||_0x5168d0)&&!_0x2bfef7){return _0x5ac12b;}if(_0x2bfef7&&!_0x2272d8){return rta['getSortedAgentsIdsByStatus'](_0x1a2fb3,_0x5ac12b,_0x2bfef7);}else{return rta[_0xdea5('0x5a')](_0x1a2fb3,_0x5ac12b,_0x2272d8);}})[_0xdea5('0x15')](function(_0x233320){_0x5ac12b=_0x233320;var _0x2673ce=![];if(_0x5ac12b[_0xdea5('0x3a')]===0x0){if(_0x484323||_0x2272d8){_0x2673ce=!![];}if(_0x5168d0){_0x2673ce=![];}}if(_0x2673ce){return _0x1a7b2b;}var _0x2ca210=_[_0xdea5('0x33')](db[_0xdea5('0x44')][_0xdea5('0x5b')],function(_0x195a6d){return{'name':_0x195a6d['fieldName'],'type':_0x195a6d[_0xdea5('0x5c')][_0xdea5('0x5d')]};});_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x5e')]=_0xdea5('0x5f');_0x10c7d9[_0xdea5('0x4b')][_0xdea5('0x42')]=!![];_0x239ed7=qs[_0xdea5('0x60')](_0x2ca210,_0x10c7d9);_0x239ed7['raw']=!![];var _0x17289e=[];if(_0x5ac12b['length']>0x0){_0x17289e[_0xdea5('0x23')]({'id':{'$in':_0x5ac12b}});if(_0x2bfef7&&!_0x2272d8){_0x3b8532=[db['sequelize'][_0xdea5('0x61')](_0xdea5('0x62')+_0x5ac12b+')')];_0x239ed7[_0xdea5('0x56')]=_0x3b8532;}}if(_0x5168d0){_0x26c335[_0xdea5('0x63')](function(_0x1d88b1){var _0x5c0a3f=!![];if(_0x2272d8==='*pause'&&_0x3422c7!==_0x1d88b1){_0x5c0a3f=![];}_0x17289e[_0xdea5('0x23')]({[_0x1d88b1+_0xdea5('0x64')]:_0x5c0a3f});});if(_0x2a3488){_0x17289e[_0xdea5('0x23')]({'pauseType':_0x2a3488});}}else if(_0x2272d8){_0x26c335[_0xdea5('0x63')](function(_0x4f9956){_0x17289e[_0xdea5('0x23')]({[_0x4f9956+_0xdea5('0x64')]:![]});});}_0x239ed7[_0xdea5('0x65')]=_[_0xdea5('0x66')](_0x239ed7['where'],{'$and':_0x17289e});if(_0x10c7d9['user']['role']===_0xdea5('0x67')){var _0x4d5e5f={'params':{'id':_0x10c7d9['user'][_0xdea5('0x68')]},'query':{'section':_0xdea5('0x69'),'role':'agent','online':!![],'raw':!![],'ids':_0x5ac12b,'customSorting':_0x3b8532}};if(_0x5168d0){_0x4d5e5f[_0xdea5('0x4b')][_0xdea5('0x6a')]=_0x17289e;}_0x4d5e5f[_0xdea5('0x4b')]=Object[_0xdea5('0x6b')](_0x4d5e5f[_0xdea5('0x4b')],_0x10c7d9[_0xdea5('0x4b')]);delete _0x4d5e5f['query']['id'];return db[_0xdea5('0x6c')]['getResources'](_0x4d5e5f);}return db[_0xdea5('0x44')][_0xdea5('0x6d')](_0x239ed7);})[_0xdea5('0x15')](function(_0x1b5f3e){_0x1a7b2b[_0xdea5('0xc')]=_0x1b5f3e[_0xdea5('0xc')];_0x5de995=_0x1b5f3e['rows'];return _0x5de995[_0xdea5('0x33')](function(_0x57a9d8){var _0x3d6843=_[_0xdea5('0x37')](_0x1a2fb3,['id',_0x57a9d8['id']]);if(_0x3d6843){var _0x21408f=rta[_0xdea5('0x6e')](_0x3d6843);_['merge'](_0x57a9d8,_0x21408f);}_0x57a9d8[_0xdea5('0x52')]=rta[_0xdea5('0x6f')](_0x57a9d8);if(_0x57a9d8[_0xdea5('0x52')][_0xdea5('0x47')](_0xdea5('0x70'))){_0x26c335[_0xdea5('0x63')](function(_0x38ad34){if(_0x57a9d8[_0x38ad34+_0xdea5('0x64')]){_0x57a9d8[_0x38ad34+'Status']='pause';}});}return _0x57a9d8;});})[_0xdea5('0x15')](function(_0x370e77){if(!_0x2bfef7||_0x3b8532){return _0x370e77;}return rta[_0xdea5('0x71')](_0x370e77,_0x2bfef7);})[_0xdea5('0x15')](function(_0x57969a){_0x1a7b2b['rows']=_0x57969a;return _0x1a7b2b;})['then'](respondWithFilteredResult(_0x59bb0e,_0x239ed7))[_0xdea5('0x19')](handleError(_0x59bb0e,null));};exports[_0xdea5('0x72')]=function(_0xc28a11,_0x350988){var _0xda0e0b={'count':0x0,'rows':[]},_0x42fa14={},_0x20d3e7,_0x361466,_0x4d426f,_0x498aba,_0x3b8e3f;Promise[_0xdea5('0x73')]()[_0xdea5('0x15')](function(){if(_0xc28a11['query'][_0xdea5('0x50')])_0x20d3e7=validateChannel(_0xc28a11['query'][_0xdea5('0x50')]);var _0x2af235=_[_0xdea5('0x14')](_0x20d3e7)+_0xdea5('0x74');var _0x7a0733=_['map'](db[_0x2af235][_0xdea5('0x5b')],function(_0x5a6eb6){return{'name':_0x5a6eb6['fieldName'],'type':_0x5a6eb6[_0xdea5('0x5c')][_0xdea5('0x5d')]};});_0x42fa14=qs[_0xdea5('0x60')](_0x7a0733,_0xc28a11);if(_0xc28a11[_0xdea5('0x67')][_0xdea5('0x5e')]===_0xdea5('0x67')){var _0x331773={'params':{'id':_0xc28a11[_0xdea5('0x67')][_0xdea5('0x68')]},'query':{'section':_0x20d3e7==='voice'&&_0xc28a11[_0xdea5('0x4b')][_0xdea5('0x5c')]===_0xdea5('0x22')?_0xdea5('0x75'):_[_0xdea5('0x14')](_0x20d3e7)+_0xdea5('0x76'),'type':_0xc28a11[_0xdea5('0x4b')][_0xdea5('0x5c')],'nolimit':!![],'sort':_0xdea5('0x12'),'filter':_0xc28a11[_0xdea5('0x4b')][_0xdea5('0x77')]}};return db[_0xdea5('0x6c')][_0xdea5('0x78')](_0x331773);}return db[_0x2af235][_0xdea5('0x6d')](_0x42fa14);})[_0xdea5('0x15')](function(_0x599693){_0xda0e0b[_0xdea5('0xc')]=_0x599693[_0xdea5('0xc')];_0x361466=_0x599693[_0xdea5('0x59')];return getRealtimeQueues(_0xc28a11,_0x20d3e7);})[_0xdea5('0x15')](function(_0xc9e739){_0x498aba=_0xc9e739[_0xdea5('0x59')];return rta[_0xdea5('0x58')]();})[_0xdea5('0x15')](function(_0x251000){_0x4d426f=_0x251000[_0xdea5('0x59')];if(_0x20d3e7!=_0xdea5('0x21'))return;return getRealtimeVoiceQueueChannels();})[_0xdea5('0x15')](function(_0x31e51b){_0x3b8e3f=_0x31e51b?_0x31e51b[_0xdea5('0x59')]:[];return initializeQueues(_0x361466,_0x498aba,_0x20d3e7,_0xc28a11['query'][_0xdea5('0x5c')]);})[_0xdea5('0x15')](function(_0x1f1bdc){var _0x296989=_0x1f1bdc[_0xdea5('0x33')](function(_0x177f67){if(_0x20d3e7==='voice')return getVoiceQueueAgents(_0x177f67,_0x361466,_0x4d426f,_0x3b8e3f);else return getQueueAgents(_0x177f67,_0x4d426f,_0x20d3e7);});return Promise[_0xdea5('0x79')](_0x296989);})[_0xdea5('0x15')](function(_0x856cc5){_0xda0e0b[_0xdea5('0x59')]=_0x856cc5;return _0xda0e0b;})['then'](respondWithFilteredResult(_0x350988,_0x42fa14))[_0xdea5('0x19')](handleError(_0x350988,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 173a7f3..ff3162e 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x446a89,_0x3496ea){var _0x5102ea=function(_0x5d38c4){while(--_0x5d38c4){_0x446a89['push'](_0x446a89['shift']());}};_0x5102ea(++_0x3496ea);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xcb91[_0xf26c2e];return _0x46ecb4;};'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(_0x2a6ba9,_0x28dfd2){var _0x5f264a=function(_0x349192){while(--_0x349192){_0x2a6ba9['push'](_0x2a6ba9['shift']());}};_0x5f264a(++_0x28dfd2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 3662bca..8410538 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 _0x2d06=['INTEGER','STRING','DATE','exports'];(function(_0x24705e,_0xf99091){var _0x44466e=function(_0x5f2ad0){while(--_0x5f2ad0){_0x24705e['push'](_0x24705e['shift']());}};_0x44466e(++_0xf99091);}(_0x2d06,0x157));var _0x62d0=function(_0x520c1d,_0x2bcaeb){_0x520c1d=_0x520c1d-0x0;var _0xb3bf8=_0x2d06[_0x520c1d];return _0xb3bf8;};'use strict';var Sequelize=require('sequelize');module[_0x62d0('0x0')]={'state':{'type':Sequelize[_0x62d0('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x62d0('0x2')]},'scheduledat':{'type':Sequelize[_0x62d0('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x62d0('0x3')]},'responsetime':{'type':Sequelize[_0x62d0('0x3')]},'ringtime':{'type':Sequelize[_0x62d0('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x62d0('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x62d0('0x2')]}}; \ No newline at end of file +var _0x8917=['INTEGER','STRING','DATE','sequelize'];(function(_0xe3cbad,_0xe0bd95){var _0x28355c=function(_0x4eaf33){while(--_0x4eaf33){_0xe3cbad['push'](_0xe3cbad['shift']());}};_0x28355c(++_0xe0bd95);}(_0x8917,0x1d7));var _0x7891=function(_0x3b81f6,_0x17705d){_0x3b81f6=_0x3b81f6-0x0;var _0x3896a6=_0x8917[_0x3b81f6];return _0x3896a6;};'use strict';var Sequelize=require(_0x7891('0x0'));module['exports']={'state':{'type':Sequelize[_0x7891('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7891('0x2')]},'scheduledat':{'type':Sequelize[_0x7891('0x3')]},'uniqueid':{'type':Sequelize[_0x7891('0x2')]},'starttime':{'type':Sequelize[_0x7891('0x3')]},'responsetime':{'type':Sequelize[_0x7891('0x3')]},'ringtime':{'type':Sequelize[_0x7891('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7891('0x2')]},'campaigntype':{'type':Sequelize[_0x7891('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 7476d58..4beb375 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 _0x1efe=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','util','api'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x1efe,0x1db));var _0xe1ef=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x1efe[_0x2576d7];return _0x16a08c;};'use strict';var _=require('lodash');var util=require(_0xe1ef('0x0'));var logger=require('../../config/logger')(_0xe1ef('0x1'));var moment=require('moment');var BPromise=require(_0xe1ef('0x2'));var rp=require(_0xe1ef('0x3'));var fs=require('fs');var path=require(_0xe1ef('0x4'));var rimraf=require(_0xe1ef('0x5'));var config=require(_0xe1ef('0x6'));var attributes=require(_0xe1ef('0x7'));module['exports']=function(_0x3278be,_0x42e993){return _0x3278be['define'](_0xe1ef('0x8'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a71=['report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x2a71,0x178));var _0x12a7=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x2a71[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x12a7('0x0'));var util=require(_0x12a7('0x1'));var logger=require(_0x12a7('0x2'))(_0x12a7('0x3'));var moment=require(_0x12a7('0x4'));var BPromise=require(_0x12a7('0x5'));var rp=require(_0x12a7('0x6'));var fs=require('fs');var path=require(_0x12a7('0x7'));var rimraf=require(_0x12a7('0x8'));var config=require(_0x12a7('0x9'));var attributes=require(_0x12a7('0xa'));module[_0x12a7('0xb')]=function(_0xfa5137,_0x50bdd9){return _0xfa5137[_0x12a7('0xc')](_0x12a7('0xd'),attributes,{'tableName':_0x12a7('0xe'),'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 6c3e117..246645f 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 _0xa27f=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0xa27f,0x1f3));var _0xfa27=function(_0x563cc2,_0x4535df){_0x563cc2=_0x563cc2-0x0;var _0x5e9297=_0xa27f[_0x563cc2];return _0x5e9297;};'use strict';var _=require(_0xfa27('0x0'));var util=require(_0xfa27('0x1'));var moment=require(_0xfa27('0x2'));var BPromise=require(_0xfa27('0x3'));var rs=require(_0xfa27('0x4'));var fs=require('fs');var Redis=require(_0xfa27('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa27('0x6'));var logger=require(_0xfa27('0x7'))(_0xfa27('0x8'));var config=require(_0xfa27('0x9'));var jayson=require(_0xfa27('0xa'));var client=jayson[_0xfa27('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3218ee,_0x1d6605,_0x468ce8){return new BPromise(function(_0x336ab6,_0x396a39){return client[_0xfa27('0xc')](_0x3218ee,_0x468ce8)[_0xfa27('0xd')](function(_0xb437cb){logger[_0xfa27('0xe')](_0xfa27('0xf'),_0x1d6605,_0xfa27('0x10'));logger[_0xfa27('0x11')](_0xfa27('0x12'),_0x1d6605,_0xfa27('0x10'),JSON[_0xfa27('0x13')](_0xb437cb));if(_0xb437cb[_0xfa27('0x14')]){if(_0xb437cb[_0xfa27('0x14')]['code']===0x1f4){logger[_0xfa27('0x14')](_0xfa27('0xf'),_0x1d6605,_0xb437cb['error'][_0xfa27('0x15')]);return _0x396a39(_0xb437cb[_0xfa27('0x14')][_0xfa27('0x15')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1d6605,_0xb437cb[_0xfa27('0x14')][_0xfa27('0x15')]);return _0x336ab6(_0xb437cb[_0xfa27('0x14')][_0xfa27('0x15')]);}else{logger[_0xfa27('0xe')](_0xfa27('0xf'),_0x1d6605,_0xfa27('0x10'));_0x336ab6(_0xb437cb['result']['message']);}})[_0xfa27('0x16')](function(_0x4875b6){logger['error'](_0xfa27('0xf'),_0x1d6605,_0x4875b6);_0x396a39(_0x4875b6);});});}exports[_0xfa27('0x17')]=function(_0x4eefb5){var _0x40ab43=this;return new Promise(function(_0xcafe1f,_0x256ae5){return db[_0xfa27('0x18')][_0xfa27('0x19')](_0x4eefb5[_0xfa27('0x1a')],{'raw':_0x4eefb5[_0xfa27('0x1b')]?_0x4eefb5[_0xfa27('0x1b')][_0xfa27('0x1c')]===undefined?!![]:![]:!![]})[_0xfa27('0xd')](function(_0x284a8a){logger[_0xfa27('0xe')]('CreateReportAgentPreview',_0x4eefb5);logger['debug'](_0xfa27('0x17'),_0x4eefb5,JSON['stringify'](_0x284a8a));_0xcafe1f(_0x284a8a);})[_0xfa27('0x16')](function(_0x4e7642){logger[_0xfa27('0x14')](_0xfa27('0x17'),_0x4e7642['message'],_0x4eefb5);_0x256ae5(_0x40ab43[_0xfa27('0x14')](0x1f4,_0x4e7642[_0xfa27('0x15')]));});});}; \ No newline at end of file +var _0x1a33=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x1a33,0x1a9));var _0x31a3=function(_0x1b9e39,_0x5c7f18){_0x1b9e39=_0x1b9e39-0x0;var _0x2ecc05=_0x1a33[_0x1b9e39];return _0x2ecc05;};'use strict';var _=require(_0x31a3('0x0'));var util=require(_0x31a3('0x1'));var moment=require(_0x31a3('0x2'));var BPromise=require(_0x31a3('0x3'));var rs=require(_0x31a3('0x4'));var fs=require('fs');var Redis=require(_0x31a3('0x5'));var db=require(_0x31a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x31a3('0x7'))(_0x31a3('0x8'));var config=require(_0x31a3('0x9'));var jayson=require(_0x31a3('0xa'));var client=jayson[_0x31a3('0xb')][_0x31a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5adc9b,_0x2aaa46,_0x4a03b2){return new BPromise(function(_0xb80f39,_0x45380a){return client[_0x31a3('0xd')](_0x5adc9b,_0x4a03b2)[_0x31a3('0xe')](function(_0x44d3c6){logger[_0x31a3('0xf')](_0x31a3('0x10'),_0x2aaa46,'request\x20sent');logger[_0x31a3('0x11')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x2aaa46,_0x31a3('0x12'),JSON[_0x31a3('0x13')](_0x44d3c6));if(_0x44d3c6[_0x31a3('0x14')]){if(_0x44d3c6[_0x31a3('0x14')][_0x31a3('0x15')]===0x1f4){logger['error'](_0x31a3('0x10'),_0x2aaa46,_0x44d3c6[_0x31a3('0x14')]['message']);return _0x45380a(_0x44d3c6[_0x31a3('0x14')][_0x31a3('0x16')]);}logger[_0x31a3('0x14')](_0x31a3('0x10'),_0x2aaa46,_0x44d3c6[_0x31a3('0x14')][_0x31a3('0x16')]);return _0xb80f39(_0x44d3c6[_0x31a3('0x14')][_0x31a3('0x16')]);}else{logger[_0x31a3('0xf')](_0x31a3('0x10'),_0x2aaa46,_0x31a3('0x12'));_0xb80f39(_0x44d3c6[_0x31a3('0x17')]['message']);}})[_0x31a3('0x18')](function(_0x3526fc){logger[_0x31a3('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x2aaa46,_0x3526fc);_0x45380a(_0x3526fc);});});}exports[_0x31a3('0x19')]=function(_0xafd73e){var _0x37d50e=this;return new Promise(function(_0x271dfa,_0x4aca01){return db[_0x31a3('0x1a')][_0x31a3('0x1b')](_0xafd73e[_0x31a3('0x1c')],{'raw':_0xafd73e[_0x31a3('0x1d')]?_0xafd73e[_0x31a3('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x31a3('0xe')](function(_0x1d38b4){logger[_0x31a3('0xf')](_0x31a3('0x19'),_0xafd73e);logger[_0x31a3('0x11')](_0x31a3('0x19'),_0xafd73e,JSON[_0x31a3('0x13')](_0x1d38b4));_0x271dfa(_0x1d38b4);})[_0x31a3('0x18')](function(_0x803500){logger[_0x31a3('0x14')](_0x31a3('0x19'),_0x803500[_0x31a3('0x16')],_0xafd73e);_0x4aca01(_0x37d50e[_0x31a3('0x14')](0x1f4,_0x803500[_0x31a3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index e25bea1..f9541af 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 _0xfc69=['voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','get','/voice/channels'];(function(_0x13e066,_0x532e2b){var _0x2b3e2a=function(_0x5508ea){while(--_0x5508ea){_0x13e066['push'](_0x13e066['shift']());}};_0x2b3e2a(++_0x532e2b);}(_0xfc69,0x145));var _0x9fc6=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xfc69[_0x34bf97];return _0x292719;};'use strict';var multer=require('multer');var util=require(_0x9fc6('0x0'));var path=require(_0x9fc6('0x1'));var express=require(_0x9fc6('0x2'));var router=express[_0x9fc6('0x3')]();var auth=require(_0x9fc6('0x4'));var controller=require('./rpc.controller');router[_0x9fc6('0x5')](_0x9fc6('0x6'),auth['isAuthenticated'](),controller[_0x9fc6('0x7')]);router[_0x9fc6('0x5')](_0x9fc6('0x8'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0xa')]);router[_0x9fc6('0x5')](_0x9fc6('0xb'),auth[_0x9fc6('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x9fc6('0x5')]('/voice/queues',auth[_0x9fc6('0x9')](),controller[_0x9fc6('0xc')]);router[_0x9fc6('0x5')](_0x9fc6('0xd'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0xe')]);router[_0x9fc6('0x5')](_0x9fc6('0xf'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x10')]);router[_0x9fc6('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x9fc6('0x11')]);router['get'](_0x9fc6('0x12'),auth[_0x9fc6('0x9')](),controller['openchannelQueues']);router[_0x9fc6('0x5')](_0x9fc6('0x13'),auth['isAuthenticated'](),controller[_0x9fc6('0x14')]);router[_0x9fc6('0x5')](_0x9fc6('0x15'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x16')]);router[_0x9fc6('0x5')](_0x9fc6('0x17'),auth['isAuthenticated'](),controller[_0x9fc6('0x18')]);router[_0x9fc6('0x5')](_0x9fc6('0x19'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x1a')]);router[_0x9fc6('0x5')](_0x9fc6('0x1b'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x1c')]);router[_0x9fc6('0x5')](_0x9fc6('0x1d'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x1e')]);router[_0x9fc6('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x1f')]);router[_0x9fc6('0x5')](_0x9fc6('0x20'),auth[_0x9fc6('0x9')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x9fc6('0x21'),auth['isAuthenticated'](),controller[_0x9fc6('0x22')]);router[_0x9fc6('0x23')](_0x9fc6('0x21'),auth['isAuthenticated'](),controller[_0x9fc6('0x24')]);router[_0x9fc6('0x5')](_0x9fc6('0x25'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x26')]);router[_0x9fc6('0x5')](_0x9fc6('0x27'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x28')]);router[_0x9fc6('0x5')]('/agents',auth['isAuthenticated'](),controller[_0x9fc6('0x29')]);router[_0x9fc6('0x23')](_0x9fc6('0x2a'),auth[_0x9fc6('0x9')](),controller['agentCapacity']);router[_0x9fc6('0x5')]('/telephones',auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x2b')]);router[_0x9fc6('0x5')](_0x9fc6('0x2c'),auth['isAuthenticated'](),controller[_0x9fc6('0x2d')]);router[_0x9fc6('0x5')]('/campaigns',auth['isAuthenticated'](),controller[_0x9fc6('0x2e')]);router[_0x9fc6('0x5')](_0x9fc6('0x2f'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x30')]);router[_0x9fc6('0x5')]('/chat/queues/waitinginteractions',auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x31')]);router[_0x9fc6('0x5')](_0x9fc6('0x32'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x33')]);router[_0x9fc6('0x5')](_0x9fc6('0x34'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x35')]);router[_0x9fc6('0x5')](_0x9fc6('0x36'),auth[_0x9fc6('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x9fc6('0x5')]('/sms/queues/waitinginteractions',auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x37')]);router[_0x9fc6('0x5')](_0x9fc6('0x38'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x39')]);router['get'](_0x9fc6('0x3a'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x9fc6('0x3b')](_0x9fc6('0x3c'),auth['isAuthenticated'](),controller[_0x9fc6('0x3d')](_0x9fc6('0x3e')));router[_0x9fc6('0x5')](_0x9fc6('0x3f'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x40')]);router[_0x9fc6('0x3b')](_0x9fc6('0x41'),auth[_0x9fc6('0x9')](),controller['queueNotify'](_0x9fc6('0x42')));router[_0x9fc6('0x5')](_0x9fc6('0x43'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x9fc6('0x3b')]('/fax/queues/:id/notify',auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x3d')](_0x9fc6('0x44')));router[_0x9fc6('0x5')](_0x9fc6('0x45'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x9fc6('0x3b')](_0x9fc6('0x46'),auth['isAuthenticated'](),controller[_0x9fc6('0x3d')](_0x9fc6('0x47')));router[_0x9fc6('0x5')](_0x9fc6('0x48'),auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x49')]);router[_0x9fc6('0x3b')](_0x9fc6('0x4a'),auth['isAuthenticated'](),controller[_0x9fc6('0x3d')](_0x9fc6('0x4b')));router[_0x9fc6('0x3b')](_0x9fc6('0x4c'),auth['isAuthenticated'](),controller[_0x9fc6('0x3d')](_0x9fc6('0x4d')));router['get'](_0x9fc6('0x4e'),auth['isAuthenticated'](),controller['showSmsQueues']);router['get']('/whatsapp/queues/:id',auth[_0x9fc6('0x9')](),controller[_0x9fc6('0x4f')]);router['post'](_0x9fc6('0x50'),auth['isAuthenticated'](),controller[_0x9fc6('0x51')]);module[_0x9fc6('0x52')]=router; \ No newline at end of file +var _0x85c3=['showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','post','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id'];(function(_0x43e278,_0x34c8bc){var _0x127eb6=function(_0x4f47a1){while(--_0x4f47a1){_0x43e278['push'](_0x43e278['shift']());}};_0x127eb6(++_0x34c8bc);}(_0x85c3,0x18a));var _0x385c=function(_0x361f63,_0x5e1b65){_0x361f63=_0x361f63-0x0;var _0x43d095=_0x85c3[_0x361f63];return _0x43d095;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x385c('0x0'));var express=require(_0x385c('0x1'));var router=express[_0x385c('0x2')]();var auth=require(_0x385c('0x3'));var controller=require(_0x385c('0x4'));router[_0x385c('0x5')](_0x385c('0x6'),auth['isAuthenticated'](),controller[_0x385c('0x7')]);router[_0x385c('0x5')](_0x385c('0x8'),auth[_0x385c('0x9')](),controller[_0x385c('0xa')]);router[_0x385c('0x5')](_0x385c('0xb'),auth[_0x385c('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x385c('0x5')](_0x385c('0xc'),auth[_0x385c('0x9')](),controller['voiceQueues']);router[_0x385c('0x5')](_0x385c('0xd'),auth[_0x385c('0x9')](),controller[_0x385c('0xe')]);router[_0x385c('0x5')](_0x385c('0xf'),auth[_0x385c('0x9')](),controller[_0x385c('0x10')]);router[_0x385c('0x5')]('/mail/accounts',auth[_0x385c('0x9')](),controller[_0x385c('0x11')]);router[_0x385c('0x5')](_0x385c('0x12'),auth[_0x385c('0x9')](),controller[_0x385c('0x13')]);router[_0x385c('0x5')](_0x385c('0x14'),auth[_0x385c('0x9')](),controller['smsQueues']);router[_0x385c('0x5')](_0x385c('0x15'),auth[_0x385c('0x9')](),controller[_0x385c('0x16')]);router['get'](_0x385c('0x17'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x385c('0x5')](_0x385c('0x18'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x385c('0x5')](_0x385c('0x19'),auth[_0x385c('0x9')](),controller[_0x385c('0x1a')]);router[_0x385c('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x385c('0x9')](),controller['voiceQueuesChannel']);router[_0x385c('0x5')](_0x385c('0x1b'),auth[_0x385c('0x9')](),controller[_0x385c('0x1c')]);router[_0x385c('0x5')](_0x385c('0x1d'),auth[_0x385c('0x9')](),controller[_0x385c('0x1e')]);router[_0x385c('0x5')](_0x385c('0x1f'),auth[_0x385c('0x9')](),controller['showVoiceQueues']);router[_0x385c('0x20')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x385c('0x21')]);router[_0x385c('0x5')](_0x385c('0x22'),auth[_0x385c('0x9')](),controller['outbound']);router[_0x385c('0x5')](_0x385c('0x23'),auth[_0x385c('0x9')](),controller['outboundChannels']);router[_0x385c('0x5')](_0x385c('0x24'),auth['isAuthenticated'](),controller[_0x385c('0x25')]);router['put'](_0x385c('0x26'),auth[_0x385c('0x9')](),controller[_0x385c('0x27')]);router[_0x385c('0x5')]('/telephones',auth[_0x385c('0x9')](),controller[_0x385c('0x28')]);router[_0x385c('0x5')](_0x385c('0x29'),auth[_0x385c('0x9')](),controller[_0x385c('0x2a')]);router[_0x385c('0x5')]('/campaigns',auth[_0x385c('0x9')](),controller[_0x385c('0x2b')]);router[_0x385c('0x5')](_0x385c('0x2c'),auth['isAuthenticated'](),controller[_0x385c('0x2d')]);router[_0x385c('0x5')](_0x385c('0x2e'),auth[_0x385c('0x9')](),controller['chatQueuesWaitingInteractions']);router['get'](_0x385c('0x2f'),auth[_0x385c('0x9')](),controller[_0x385c('0x30')]);router[_0x385c('0x5')](_0x385c('0x31'),auth[_0x385c('0x9')](),controller[_0x385c('0x32')]);router[_0x385c('0x5')](_0x385c('0x33'),auth[_0x385c('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x385c('0x34'),auth['isAuthenticated'](),controller[_0x385c('0x35')]);router[_0x385c('0x5')](_0x385c('0x36'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x385c('0x5')](_0x385c('0x37'),auth[_0x385c('0x9')](),controller[_0x385c('0x38')]);router['post'](_0x385c('0x39'),auth[_0x385c('0x9')](),controller[_0x385c('0x3a')]('mail'));router[_0x385c('0x5')](_0x385c('0x3b'),auth[_0x385c('0x9')](),controller[_0x385c('0x3c')]);router[_0x385c('0x3d')]('/chat/queues/:id/notify',auth[_0x385c('0x9')](),controller['queueNotify']('chat'));router[_0x385c('0x5')](_0x385c('0x3e'),auth[_0x385c('0x9')](),controller[_0x385c('0x3f')]);router[_0x385c('0x3d')]('/fax/queues/:id/notify',auth[_0x385c('0x9')](),controller[_0x385c('0x3a')](_0x385c('0x40')));router[_0x385c('0x5')](_0x385c('0x41'),auth[_0x385c('0x9')](),controller['showFaxQueues']);router[_0x385c('0x3d')](_0x385c('0x42'),auth[_0x385c('0x9')](),controller[_0x385c('0x3a')]('openchannel'));router[_0x385c('0x5')](_0x385c('0x43'),auth[_0x385c('0x9')](),controller[_0x385c('0x44')]);router[_0x385c('0x3d')](_0x385c('0x45'),auth[_0x385c('0x9')](),controller['queueNotify'](_0x385c('0x46')));router['post'](_0x385c('0x47'),auth[_0x385c('0x9')](),controller[_0x385c('0x3a')](_0x385c('0x48')));router[_0x385c('0x5')](_0x385c('0x49'),auth['isAuthenticated'](),controller[_0x385c('0x4a')]);router[_0x385c('0x5')](_0x385c('0x4b'),auth[_0x385c('0x9')](),controller['showWhatsappQueues']);router[_0x385c('0x3d')](_0x385c('0x4c'),auth[_0x385c('0x9')](),controller['agentNotify']);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 31fb335..a070158 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 _0x33c5=['VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','INTERACTION','length','format','updateAttributes','findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','findOne','Message','messageId','Interaction','update','queue','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x33c5,0xe6));var _0x533c=function(_0xdae8e6,_0x34854a){_0xdae8e6=_0xdae8e6-0x0;var _0x24c7a7=_0x33c5[_0xdae8e6];return _0x24c7a7;};'use strict';var BPromise=require('bluebird');var moment=require(_0x533c('0x0'));var _=require(_0x533c('0x1'));var util=require('util');var db=require(_0x533c('0x2'))['db'];var logger=require(_0x533c('0x3'))(_0x533c('0x4'));var jayson=require(_0x533c('0x5'));var amiClient=jayson[_0x533c('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232b});var routingClient=jayson[_0x533c('0x6')][_0x533c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x34ca89,_0x1699d5,_0x3a009b){return new BPromise(function(_0x36d74e,_0x2c297c){var _0x1b929b=_0x3a009b?_0x3a009b:amiClient;return _0x1b929b[_0x533c('0x8')](_0x34ca89,_0x1699d5)[_0x533c('0x9')](function(_0x2c0214){if(_0x2c0214[_0x533c('0xa')]){if(_0x2c0214[_0x533c('0xa')][_0x533c('0xb')]===0x1f4){return _0x2c297c(_0x2c0214['error'][_0x533c('0xc')]);}return _0x36d74e(_0x2c0214[_0x533c('0xa')][_0x533c('0xc')]);}else{_0x36d74e(_0x2c0214[_0x533c('0xd')]);}})[_0x533c('0xe')](function(_0x346e0f){_0x2c297c(_0x346e0f);});});}function respondWithResult(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xc8;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0xf')](_0x5c9462)[_0x533c('0x10')](_0xf93007);}return _0x530e10[_0x533c('0x11')](0x194);};}function handleError(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0x1f4;return function(_0xa616ca){logger['error'](_0xa616ca[_0x533c('0x12')]);if(_0xa616ca[_0x533c('0x13')]){delete _0xa616ca[_0x533c('0x13')];}_0x1a2a83[_0x533c('0xf')](_0x8d7c66)['send'](_0xa616ca);};}function findById(_0x1031e7){return function(_0x1ed6ba){if(!_[_0x533c('0x14')](_0x1031e7)&&!_[_0x533c('0x14')](_0x1ed6ba)&&!_[_0x533c('0x14')](_0x1ed6ba[_0x533c('0x15')])){return _[_0x533c('0x16')](_0x1ed6ba[_0x533c('0x15')],function(_0x1f9f85){return _0x1f9f85['id']==_0x1031e7;});}return null;};}exports[_0x533c('0x17')]=function(_0x287b9e,_0x2c41e9){return respondWithRpcPromise(_0x533c('0x18'),_0x287b9e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x2c41e9,null))[_0x533c('0xe')](handleError(_0x2c41e9,null));};exports[_0x533c('0x1a')]=function(_0x2bc58f,_0x4ba0bd){return respondWithRpcPromise(_0x533c('0x1b'),_['merge'](_0x2bc58f['query'],_0x2bc58f[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x4ba0bd,null))['catch'](handleError(_0x4ba0bd,null));};exports[_0x533c('0x1d')]=function(_0x37651e,_0x3839fe){return respondWithRpcPromise(_0x533c('0x1e'),_['merge'](_0x37651e[_0x533c('0x19')],_0x37651e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3839fe,null))[_0x533c('0xe')](handleError(_0x3839fe,null));};exports[_0x533c('0x1f')]=function(_0x140269,_0xb51a5){return respondWithRpcPromise(_0x533c('0x20'),_0x140269[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0xb51a5,null))['catch'](handleError(_0xb51a5,null));};exports[_0x533c('0x21')]=function(_0xfab4da,_0x503c2e){return respondWithRpcPromise(_0x533c('0x20'),_0xfab4da['query'])[_0x533c('0x9')](findById(_0xfab4da[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x503c2e,null))[_0x533c('0xe')](handleError(_0x503c2e,null));};exports[_0x533c('0x22')]=function(_0x146a8e,_0x212d1b){return respondWithRpcPromise(_0x533c('0x23'),_[_0x533c('0x24')](_0x146a8e[_0x533c('0x25')],_0x146a8e[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x212d1b,null))['catch'](handleError(_0x212d1b,null));};exports[_0x533c('0x26')]=function(_0x591499,_0x3290de){return respondWithRpcPromise(_0x533c('0x27'),_[_0x533c('0x24')](_0x591499[_0x533c('0x19')],_0x591499[_0x533c('0x1c')]))[_0x533c('0x9')](respondWithResult(_0x3290de,null))[_0x533c('0xe')](handleError(_0x3290de,null));};exports[_0x533c('0x28')]=function(_0x287ee5,_0x47831f){return respondWithRpcPromise(_0x533c('0x29'),_0x287ee5[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x47831f,null))[_0x533c('0xe')](handleError(_0x47831f,null));};exports[_0x533c('0x2a')]=function(_0x5ac6b4,_0x2b801e){return respondWithRpcPromise(_0x533c('0x2b'),_[_0x533c('0x24')](_0x5ac6b4[_0x533c('0x19')],_0x5ac6b4['params']))[_0x533c('0x9')](respondWithResult(_0x2b801e,null))[_0x533c('0xe')](handleError(_0x2b801e,null));};exports[_0x533c('0x2c')]=function(_0x40f077,_0x1255b1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x40f077['query'],_0x40f077['params']))['then'](respondWithResult(_0x1255b1,null))[_0x533c('0xe')](handleError(_0x1255b1,null));};exports['voiceQueuesChannelRedirect']=function(_0x42994d,_0x55726a){return respondWithRpcPromise(_0x533c('0x2d'),_[_0x533c('0x24')](_0x42994d[_0x533c('0x19')],_0x42994d['params']))[_0x533c('0x9')](respondWithResult(_0x55726a,null))[_0x533c('0xe')](handleError(_0x55726a,null));};exports[_0x533c('0x2e')]=function(_0x55b010,_0x160d4b){return respondWithRpcPromise(_0x533c('0x2f'),_0x55b010[_0x533c('0x19')])['then'](respondWithResult(_0x160d4b,null))[_0x533c('0xe')](handleError(_0x160d4b,null));};exports[_0x533c('0x30')]=function(_0x2cd02f,_0x3f2b53){return respondWithRpcPromise(_0x533c('0x31'),_0x2cd02f[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x3f2b53,null))[_0x533c('0xe')](handleError(_0x3f2b53,null));};exports[_0x533c('0x32')]=function(_0x2c03fa,_0x298cea){var _0x55af6e;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')])[_0x533c('0x9')](function(_0x3562b8){_0x55af6e=_0x3562b8;return respondWithRpcPromise(_0x533c('0x33'),_0x2c03fa[_0x533c('0x19')],routingClient);})['then'](function(_0x88ea5d){return _[_0x533c('0x24')]({},_0x88ea5d,_0x55af6e);})[_0x533c('0x9')](respondWithResult(_0x298cea,null))['catch'](handleError(_0x298cea,null));};exports[_0x533c('0x34')]=function(_0x4170e4,_0x315e67){if(_0x4170e4[_0x533c('0x25')]&&_0x4170e4['body'][_0x533c('0x35')]&&_0x4170e4['user']&&_0x4170e4[_0x533c('0x36')][_0x533c('0x13')]){for(var _0x55a372 in _0x4170e4[_0x533c('0x25')][_0x533c('0x35')]){if(_0x4170e4[_0x533c('0x25')]['interaction']['hasOwnProperty'](_0x55a372)){db['MemberReport']['findAll']({'where':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')]['name'],'type':_0x533c('0x37'),'exitAt':null,'uniqueid':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]&&_0x4170e4['body'][_0x533c('0x35')][_0x55a372][_0x533c('0x38')]?{'$notIn':_0x4170e4['body'][_0x533c('0x35')][_0x55a372]}:{'$ne':null}}})[_0x533c('0x9')](function(_0x27ac8e){var _0x10e374=moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x47cca7=0x0,_0x22dc87=_0x27ac8e[_0x533c('0x38')];_0x47cca7<_0x22dc87;_0x47cca7+=0x1){_0x27ac8e[_0x47cca7][_0x533c('0x3a')]({'exitAt':_0x10e374});}});for(var _0x4fcdc5=0x0;_0x4fcdc5<_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372]['length'];_0x4fcdc5+=0x1){db['MemberReport'][_0x533c('0x3b')]({'where':{'channel':_0x55a372,'membername':_0x4170e4['user'][_0x533c('0x13')],'type':_0x533c('0x37'),'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5],'exitAt':null},'defaults':{'channel':_0x55a372,'membername':_0x4170e4[_0x533c('0x36')][_0x533c('0x13')],'interface':_[_0x533c('0x14')](_0x4170e4[_0x533c('0x36')]['interface'])?util[_0x533c('0x39')](_0x533c('0x3c'),_0x4170e4[_0x533c('0x36')]['name']):_0x4170e4[_0x533c('0x36')][_0x533c('0x3d')],'type':'INTERACTION','enterAt':moment()[_0x533c('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x533c('0x3e'),'internal':_0x4170e4[_0x533c('0x36')][_0x533c('0x3f')],'uniqueid':_0x4170e4[_0x533c('0x25')][_0x533c('0x35')][_0x55a372][_0x4fcdc5]}});}}}}return respondWithRpcPromise(_0x533c('0x40'),{'id':_0x4170e4[_0x533c('0x1c')]['id'],'capacity':_0x4170e4['body'][_0x533c('0x41')]},routingClient)[_0x533c('0x9')](respondWithResult(_0x315e67,null))[_0x533c('0xe')](handleError(_0x315e67,null));};exports[_0x533c('0x42')]=function(_0x24ca50,_0x1558ef){return respondWithRpcPromise(_0x533c('0x43'),_0x24ca50['query'])['then'](respondWithResult(_0x1558ef,null))['catch'](handleError(_0x1558ef,null));};exports['trunks']=function(_0xc99f96,_0x4434a1){return respondWithRpcPromise('Trunks',_0xc99f96[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x4434a1,null))[_0x533c('0xe')](handleError(_0x4434a1,null));};exports['campaigns']=function(_0x1de19e,_0x564a31){return respondWithRpcPromise('Campaigns',_0x1de19e[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x564a31,null))[_0x533c('0xe')](handleError(_0x564a31,null));};exports[_0x533c('0x44')]=function(_0x381544,_0x3bb176){return respondWithRpcPromise(_0x533c('0x45'),_0x381544['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x3bb176,null))['catch'](handleError(_0x3bb176,null));};exports[_0x533c('0x46')]=function(_0x26645d,_0x274686){return respondWithRpcPromise(_0x533c('0x45'),_0x26645d[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x26645d[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x274686,null))['catch'](handleError(_0x274686,null));};exports[_0x533c('0x47')]=function(_0x43a333,_0x163563){return respondWithRpcPromise(_0x533c('0x48'),_0x43a333[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x163563,null))['catch'](handleError(_0x163563,null));};exports[_0x533c('0x49')]=function(_0x554a9f,_0x43383e){return respondWithRpcPromise(_0x533c('0x48'),_0x554a9f[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x554a9f[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x43383e,null))['catch'](handleError(_0x43383e,null));};exports['mailAccounts']=function(_0x1005a6,_0x376619){return respondWithRpcPromise(_0x533c('0x4a'),_0x1005a6[_0x533c('0x19')],mailClient)['then'](respondWithResult(_0x376619,null))[_0x533c('0xe')](handleError(_0x376619,null));};exports[_0x533c('0x4b')]=function(_0x8e04c7,_0x352e07){return respondWithRpcPromise(_0x533c('0x4c'),_0x8e04c7[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x352e07,null))[_0x533c('0xe')](handleError(_0x352e07,null));};exports[_0x533c('0x4d')]=function(_0x3aba19,_0x404a93){return respondWithRpcPromise(_0x533c('0x4c'),_0x3aba19[_0x533c('0x19')],routingClient)[_0x533c('0x9')](findById(_0x3aba19[_0x533c('0x1c')]['id']))[_0x533c('0x9')](respondWithResult(_0x404a93,null))[_0x533c('0xe')](handleError(_0x404a93,null));};exports['smsQueues']=function(_0x31bba1,_0x5206ad){return respondWithRpcPromise('SmsQueues',_0x31bba1[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x5206ad,null))[_0x533c('0xe')](handleError(_0x5206ad,null));};exports[_0x533c('0x4e')]=function(_0x417158,_0x1eaf34){return respondWithRpcPromise(_0x533c('0x4f'),_0x417158['query'],routingClient)[_0x533c('0x9')](findById(_0x417158[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x1eaf34,null))[_0x533c('0xe')](handleError(_0x1eaf34,null));};exports[_0x533c('0x50')]=function(_0x8174d0,_0x3e3b25){return respondWithRpcPromise('WhatsappQueues',_0x8174d0[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x3e3b25,null))['catch'](handleError(_0x3e3b25,null));};exports[_0x533c('0x51')]=function(_0x3e8d57,_0x5f2b8b){return respondWithRpcPromise(_0x533c('0x52'),_0x3e8d57[_0x533c('0x19')],routingClient)['then'](findById(_0x3e8d57[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x5f2b8b,null))['catch'](handleError(_0x5f2b8b,null));};exports[_0x533c('0x53')]=function(_0x28239c,_0x451def){return respondWithRpcPromise(_0x533c('0x54'),_0x28239c['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x451def,null))[_0x533c('0xe')](handleError(_0x451def,null));};exports[_0x533c('0x55')]=function(_0x245792,_0x20d344){return respondWithRpcPromise('FaxQueues',_0x245792[_0x533c('0x19')],routingClient)['then'](findById(_0x245792[_0x533c('0x1c')]['id']))['then'](respondWithResult(_0x20d344,null))[_0x533c('0xe')](handleError(_0x20d344,null));};exports['faxAccounts']=function(_0x4bd014,_0x511f74){return respondWithRpcPromise(_0x533c('0x56'),_0x4bd014[_0x533c('0x19')])[_0x533c('0x9')](respondWithResult(_0x511f74,null))['catch'](handleError(_0x511f74,null));};exports[_0x533c('0x57')]=function(_0x24a00c,_0x3fbb08){return respondWithRpcPromise(_0x533c('0x58'),_0x24a00c[_0x533c('0x19')],routingClient)['then'](respondWithResult(_0x3fbb08,null))['catch'](handleError(_0x3fbb08,null));};exports[_0x533c('0x59')]=function(_0x313fa5,_0x2c0f59){return respondWithRpcPromise(_0x533c('0x5a'),_0x313fa5[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x2c0f59,null))[_0x533c('0xe')](handleError(_0x2c0f59,null));};exports[_0x533c('0x5b')]=function(_0x45c4ca,_0x4f0961){return respondWithRpcPromise(_0x533c('0x5c'),_0x45c4ca[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x4f0961,null))[_0x533c('0xe')](handleError(_0x4f0961,null));};exports[_0x533c('0x5d')]=function(_0x18102b,_0x1b9816){return respondWithRpcPromise(_0x533c('0x5c'),_0x18102b[_0x533c('0x19')],routingClient)[_0x533c('0x9')](function(_0xfd598d){if(_0x18102b[_0x533c('0x19')][_0x533c('0x5e')]!==undefined){var _0x452915=_(_0xfd598d[_0x533c('0x15')])[_0x533c('0x5f')]([_0x18102b[_0x533c('0x19')]['type'],_0x18102b[_0x533c('0x1c')]['id']])[_0x533c('0x60')]('queue_id')['uniq']()[_0x533c('0x61')]();return _0xfd598d['rows'][_0x533c('0x5f')](function(_0x307fe5){return _0x452915[_0x533c('0x62')](_0x307fe5[_0x533c('0x63')])>-0x1;});}else{return _0xfd598d[_0x533c('0x15')]['filter'](function(_0x275db2){return _0x275db2[_0x533c('0x63')]===parseInt(_0x18102b[_0x533c('0x1c')]['id']);});}})[_0x533c('0x9')](respondWithResult(_0x1b9816,null))[_0x533c('0xe')](handleError(_0x1b9816,null));};exports[_0x533c('0x64')]=function(_0x1aa938,_0x248ede){return respondWithRpcPromise(_0x533c('0x65'),_0x1aa938[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x248ede,null))[_0x533c('0xe')](handleError(_0x248ede,null));};exports[_0x533c('0x66')]=function(_0x452759,_0x9c8d2){return respondWithRpcPromise(_0x533c('0x67'),_0x452759[_0x533c('0x19')],routingClient)[_0x533c('0x9')](respondWithResult(_0x9c8d2,null))['catch'](handleError(_0x9c8d2,null));};exports[_0x533c('0x68')]=function(_0x15d09a,_0x247915){return respondWithRpcPromise(_0x533c('0x69'),_0x15d09a['query'],routingClient)[_0x533c('0x9')](respondWithResult(_0x247915,null))[_0x533c('0xe')](handleError(_0x247915,null));};exports['queueNotify']=function(_0x411f86){return function(_0x5b8ead,_0x291be3){var _0x4be94e,_0x11654c;var _0x33a661=_[_0x533c('0x6a')](_0x411f86);var _0x5c938c=_0x411f86==='chat'?'Website':_0x533c('0x6b');return db[_0x33a661+'Queue'][_0x533c('0x6c')]({'raw':!![],'where':{'id':_0x5b8ead[_0x533c('0x1c')]['id']}})[_0x533c('0x9')](function(_0x450152){if(_['isNil'](_0x450152)){throw new Error(_0x33a661+'\x20Queue\x20not\x20found');}_0x4be94e=_0x450152;return db[_0x33a661+_0x533c('0x6d')]['findOne']({'where':{'id':_0x5b8ead[_0x533c('0x25')][_0x533c('0x6e')]},'include':[{'model':db[_0x33a661+_0x533c('0x6f')],'as':'Interaction'},{'model':db[_0x33a661+_0x5c938c],'as':_0x533c('0x6b')}]});})['then'](function(_0x6e0d38){if(_[_0x533c('0x14')](_0x6e0d38)){throw new Error(_0x33a661+'\x20Message\x20not\x20found');}_0x11654c=_0x6e0d38;return _0x6e0d38[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x1c9381={'uniqueid':_0x411f86+'.'+_0x11654c['id']+'.'+_0x11654c[_0x533c('0x6f')]['id'],'FromUserId':_0x5b8ead[_0x533c('0x36')]['id'],'type':_0x533c('0x71')};_0x1c9381[_0x33a661+'MessageId']=_0x11654c['id'];_0x1c9381[_0x33a661+_0x533c('0x72')]=_0x11654c[_0x533c('0x6f')]['id'];_0x1c9381[_0x533c('0x73')+_0x33a661+_0x5c938c+'Id']=_0x11654c['Account']['id'];_0x1c9381['To'+_0x33a661+_0x533c('0x74')]=_0x4be94e['id'];return db[_0x33a661+'TransferReport']['create'](_0x1c9381);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x411f86,'interaction':_0x11654c['Interaction'],'message':_0x11654c,'account':_0x11654c[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x71'),'appdata':_0x4be94e[_0x533c('0x13')]+','+(_0x11654c[_0x533c('0x6b')][_0x533c('0x76')]||0x12c),'interval':_0x533c('0x77')}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x291be3,null))[_0x533c('0xe')](handleError(_0x291be3,null));};};exports[_0x533c('0x78')]=function(_0x299f43,_0x14db14){var _0x243d1a,_0x368552;if(_['isNil'](_0x299f43[_0x533c('0x25')][_0x533c('0x79')])){throw new Error(_0x533c('0x7a'));}var _0x4c3f6d=_0x299f43[_0x533c('0x25')]['channel'];var _0x2c7faf=_[_0x533c('0x6a')](_0x4c3f6d);var _0x2377a3=_0x4c3f6d==='chat'?_0x533c('0x7b'):_0x533c('0x6b');return db[_0x533c('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x299f43['params']['id'],'role':_0x533c('0x3e')}})['then'](function(_0x392968){if(_['isNil'](_0x392968)){throw new Error(_0x533c('0x7d'));}_0x243d1a=_0x392968;return db[_0x2c7faf+_0x533c('0x6d')][_0x533c('0x6c')]({'where':{'id':_0x299f43['body']['messageId']},'include':[{'model':db[_0x2c7faf+_0x533c('0x6f')],'as':_0x533c('0x6f')},{'model':db[_0x2c7faf+_0x2377a3],'as':_0x533c('0x6b')}]});})[_0x533c('0x9')](function(_0x313916){if(_[_0x533c('0x14')](_0x313916)){throw new Error(_0x2c7faf+_0x533c('0x7e'));}_0x368552=_0x313916;return _0x313916[_0x533c('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x533c('0x9')](function(){var _0x5307b3={'uniqueid':_0x4c3f6d+'.'+_0x368552['id']+'.'+_0x368552[_0x533c('0x6f')]['id'],'FromUserId':_0x299f43[_0x533c('0x36')]['id'],'type':_0x533c('0x71'),'ToUserId':_0x243d1a['id']};_0x5307b3[_0x2c7faf+'MessageId']=_0x368552['id'];_0x5307b3[_0x2c7faf+_0x533c('0x72')]=_0x368552[_0x533c('0x6f')]['id'];_0x5307b3[_0x533c('0x73')+_0x2c7faf+_0x2377a3+'Id']=_0x368552[_0x533c('0x6b')]['id'];return db[_0x2c7faf+_0x533c('0x7f')][_0x533c('0x80')](_0x5307b3);})[_0x533c('0x9')](function(){return respondWithRpcPromise(_0x533c('0x75'),{'channel':_0x4c3f6d,'interaction':_0x368552[_0x533c('0x6f')],'message':_0x368552,'account':_0x368552[_0x533c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x533c('0x3e'),'appdata':_0x243d1a[_0x533c('0x13')]+','+(_0x368552['Account'][_0x533c('0x81')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x533c('0x9')](respondWithResult(_0x14db14,null))[_0x533c('0xe')](handleError(_0x14db14,null));}; \ No newline at end of file +var _0xee14=['telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','channel','Website','User','agent','Agent\x20not\x20found','\x20Message\x20not\x20found','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','user','interaction','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','INTERACTION','SIP/%s','AgentCapacity'];(function(_0x5d508a,_0x81d3c2){var _0x55405a=function(_0x4ea0e1){while(--_0x4ea0e1){_0x5d508a['push'](_0x5d508a['shift']());}};_0x55405a(++_0x81d3c2);}(_0xee14,0x13a));var _0x4ee1=function(_0xf3b659,_0x37aec4){_0xf3b659=_0xf3b659-0x0;var _0x4e7af4=_0xee14[_0xf3b659];return _0x4e7af4;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x4ee1('0x0'));var util=require(_0x4ee1('0x1'));var db=require(_0x4ee1('0x2'))['db'];var logger=require(_0x4ee1('0x3'))(_0x4ee1('0x4'));var jayson=require(_0x4ee1('0x5'));var amiClient=jayson[_0x4ee1('0x6')][_0x4ee1('0x7')]({'port':0x232a});var mailClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){var _0x1fd8c8=_0x187656?_0x187656:amiClient;return _0x1fd8c8['request'](_0x327c18,_0x3a45a3)[_0x4ee1('0x8')](function(_0x38be25){if(_0x38be25['error']){if(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xa')]===0x1f4){return _0xdfe9c1(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xb')]);}return _0x293d5f(_0x38be25['error'][_0x4ee1('0xb')]);}else{_0x293d5f(_0x38be25[_0x4ee1('0xc')]);}})[_0x4ee1('0xd')](function(_0x2d5d3c){_0xdfe9c1(_0x2d5d3c);});});}function respondWithResult(_0x2f864e,_0x174427){_0x174427=_0x174427||0xc8;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0xe')](_0x174427)[_0x4ee1('0xf')](_0x5616d6);}return _0x2f864e[_0x4ee1('0x10')](0x194);};}function handleError(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0x1f4;return function(_0x1c342a){logger[_0x4ee1('0x9')](_0x1c342a[_0x4ee1('0x11')]);if(_0x1c342a[_0x4ee1('0x12')]){delete _0x1c342a['name'];}_0x24a915[_0x4ee1('0xe')](_0x46d2c2)[_0x4ee1('0x13')](_0x1c342a);};}function findById(_0x34651b){return function(_0x1b1e0e){if(!_[_0x4ee1('0x14')](_0x34651b)&&!_[_0x4ee1('0x14')](_0x1b1e0e)&&!_[_0x4ee1('0x14')](_0x1b1e0e[_0x4ee1('0x15')])){return _[_0x4ee1('0x16')](_0x1b1e0e[_0x4ee1('0x15')],function(_0x274de5){return _0x274de5['id']==_0x34651b;});}return null;};}exports['voiceChannels']=function(_0x236215,_0x3db827){return respondWithRpcPromise(_0x4ee1('0x17'),_0x236215[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3db827,null))[_0x4ee1('0xd')](handleError(_0x3db827,null));};exports['voiceChannelMixMonitor']=function(_0x8a631f,_0x333e96){return respondWithRpcPromise(_0x4ee1('0x19'),_[_0x4ee1('0x1a')](_0x8a631f[_0x4ee1('0x18')],_0x8a631f[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x333e96,null))[_0x4ee1('0xd')](handleError(_0x333e96,null));};exports[_0x4ee1('0x1c')]=function(_0x3e5038,_0x4faaf6){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x4ee1('0x1a')](_0x3e5038[_0x4ee1('0x18')],_0x3e5038[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x4faaf6,null))[_0x4ee1('0xd')](handleError(_0x4faaf6,null));};exports[_0x4ee1('0x1d')]=function(_0x57d45d,_0x5cc0b5){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x57d45d[_0x4ee1('0x18')])['then'](respondWithResult(_0x5cc0b5,null))[_0x4ee1('0xd')](handleError(_0x5cc0b5,null));};exports[_0x4ee1('0x1f')]=function(_0x36654c,_0x215949){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x36654c[_0x4ee1('0x18')])[_0x4ee1('0x8')](findById(_0x36654c['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x215949,null))['catch'](handleError(_0x215949,null));};exports[_0x4ee1('0x20')]=function(_0x4ec408,_0x3dc870){return respondWithRpcPromise(_0x4ee1('0x21'),_[_0x4ee1('0x1a')](_0x4ec408[_0x4ee1('0x22')],_0x4ec408[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x3dc870,null))[_0x4ee1('0xd')](handleError(_0x3dc870,null));};exports['voiceQueuesPreview']=function(_0x121301,_0x3d5e6c){return respondWithRpcPromise(_0x4ee1('0x23'),_[_0x4ee1('0x1a')](_0x121301[_0x4ee1('0x18')],_0x121301['params']))[_0x4ee1('0x8')](respondWithResult(_0x3d5e6c,null))[_0x4ee1('0xd')](handleError(_0x3d5e6c,null));};exports[_0x4ee1('0x24')]=function(_0x2e37a3,_0x79f87c){return respondWithRpcPromise(_0x4ee1('0x25'),_0x2e37a3['query'])['then'](respondWithResult(_0x79f87c,null))[_0x4ee1('0xd')](handleError(_0x79f87c,null));};exports[_0x4ee1('0x26')]=function(_0x41ab60,_0x5a2f6f){return respondWithRpcPromise(_0x4ee1('0x27'),_[_0x4ee1('0x1a')](_0x41ab60[_0x4ee1('0x18')],_0x41ab60[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x5a2f6f,null))[_0x4ee1('0xd')](handleError(_0x5a2f6f,null));};exports[_0x4ee1('0x28')]=function(_0x199e11,_0x36898c){return respondWithRpcPromise(_0x4ee1('0x29'),_[_0x4ee1('0x1a')](_0x199e11[_0x4ee1('0x18')],_0x199e11[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x36898c,null))[_0x4ee1('0xd')](handleError(_0x36898c,null));};exports[_0x4ee1('0x2a')]=function(_0x882468,_0x50539f){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ee1('0x1a')](_0x882468[_0x4ee1('0x18')],_0x882468[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x50539f,null))['catch'](handleError(_0x50539f,null));};exports[_0x4ee1('0x2b')]=function(_0x2ed16f,_0x11721a){return respondWithRpcPromise(_0x4ee1('0x2c'),_0x2ed16f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x11721a,null))[_0x4ee1('0xd')](handleError(_0x11721a,null));};exports[_0x4ee1('0x2d')]=function(_0x59b5cc,_0x3b346e){return respondWithRpcPromise(_0x4ee1('0x2e'),_0x59b5cc[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3b346e,null))[_0x4ee1('0xd')](handleError(_0x3b346e,null));};exports[_0x4ee1('0x2f')]=function(_0x543b2e,_0x3e2ca7){var _0x37176a;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')])[_0x4ee1('0x8')](function(_0x352dc5){_0x37176a=_0x352dc5;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')],routingClient);})[_0x4ee1('0x8')](function(_0x29493d){return _[_0x4ee1('0x1a')]({},_0x29493d,_0x37176a);})[_0x4ee1('0x8')](respondWithResult(_0x3e2ca7,null))[_0x4ee1('0xd')](handleError(_0x3e2ca7,null));};exports['agentCapacity']=function(_0x3b3bed,_0x40a3e3){if(_0x3b3bed['body']&&_0x3b3bed[_0x4ee1('0x22')]['interaction']&&_0x3b3bed[_0x4ee1('0x31')]&&_0x3b3bed['user'][_0x4ee1('0x12')]){for(var _0xc7580c in _0x3b3bed['body'][_0x4ee1('0x32')]){if(_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0x4ee1('0x33')](_0xc7580c)){db['MemberReport'][_0x4ee1('0x34')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3b3bed['body'][_0x4ee1('0x32')][_0xc7580c]&&_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')]?{'$notIn':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c]}:{'$ne':null}}})['then'](function(_0xaa71d5){var _0x266add=moment()[_0x4ee1('0x36')](_0x4ee1('0x37'));for(var _0x5c5862=0x0,_0x3d6bf4=_0xaa71d5[_0x4ee1('0x35')];_0x5c5862<_0x3d6bf4;_0x5c5862+=0x1){_0xaa71d5[_0x5c5862]['updateAttributes']({'exitAt':_0x266add});}});for(var _0x21ebb8=0x0;_0x21ebb8<_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')];_0x21ebb8+=0x1){db[_0x4ee1('0x38')][_0x4ee1('0x39')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':_0x4ee1('0x3a'),'uniqueid':_0x3b3bed['body']['interaction'][_0xc7580c][_0x21ebb8],'exitAt':null},'defaults':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'interface':_[_0x4ee1('0x14')](_0x3b3bed[_0x4ee1('0x31')]['interface'])?util[_0x4ee1('0x36')](_0x4ee1('0x3b'),_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')]):_0x3b3bed[_0x4ee1('0x31')]['interface'],'type':_0x4ee1('0x3a'),'enterAt':moment()[_0x4ee1('0x36')](_0x4ee1('0x37')),'role':'agent','internal':_0x3b3bed[_0x4ee1('0x31')]['internal'],'uniqueid':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c][_0x21ebb8]}});}}}}return respondWithRpcPromise(_0x4ee1('0x3c'),{'id':_0x3b3bed['params']['id'],'capacity':_0x3b3bed[_0x4ee1('0x22')]['capacity']},routingClient)[_0x4ee1('0x8')](respondWithResult(_0x40a3e3,null))[_0x4ee1('0xd')](handleError(_0x40a3e3,null));};exports[_0x4ee1('0x3d')]=function(_0x5f4f78,_0x3368ed){return respondWithRpcPromise(_0x4ee1('0x3e'),_0x5f4f78[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3368ed,null))[_0x4ee1('0xd')](handleError(_0x3368ed,null));};exports[_0x4ee1('0x3f')]=function(_0x3f1c32,_0x517729){return respondWithRpcPromise('Trunks',_0x3f1c32[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x517729,null))[_0x4ee1('0xd')](handleError(_0x517729,null));};exports[_0x4ee1('0x40')]=function(_0x44e65f,_0x31e82d){return respondWithRpcPromise(_0x4ee1('0x41'),_0x44e65f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x31e82d,null))[_0x4ee1('0xd')](handleError(_0x31e82d,null));};exports[_0x4ee1('0x42')]=function(_0x2453ac,_0x3c2e42){return respondWithRpcPromise('ChatQueues',_0x2453ac[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x3c2e42,null))[_0x4ee1('0xd')](handleError(_0x3c2e42,null));};exports[_0x4ee1('0x43')]=function(_0x59bbca,_0x1e0aac){return respondWithRpcPromise(_0x4ee1('0x44'),_0x59bbca['query'],routingClient)['then'](findById(_0x59bbca[_0x4ee1('0x1b')]['id']))['then'](respondWithResult(_0x1e0aac,null))[_0x4ee1('0xd')](handleError(_0x1e0aac,null));};exports[_0x4ee1('0x45')]=function(_0x59ba70,_0x43489c){return respondWithRpcPromise(_0x4ee1('0x46'),_0x59ba70[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x43489c,null))[_0x4ee1('0xd')](handleError(_0x43489c,null));};exports[_0x4ee1('0x47')]=function(_0x11f619,_0x5f5694){return respondWithRpcPromise('MailQueues',_0x11f619[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x11f619['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x5f5694,null))[_0x4ee1('0xd')](handleError(_0x5f5694,null));};exports[_0x4ee1('0x48')]=function(_0x51e341,_0x1ad933){return respondWithRpcPromise('MailAccounts',_0x51e341[_0x4ee1('0x18')],mailClient)['then'](respondWithResult(_0x1ad933,null))['catch'](handleError(_0x1ad933,null));};exports[_0x4ee1('0x49')]=function(_0x16fcd0,_0x290451){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x16fcd0[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x290451,null))[_0x4ee1('0xd')](handleError(_0x290451,null));};exports[_0x4ee1('0x4b')]=function(_0x10f4e,_0x58eb1d){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x10f4e[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x10f4e[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x58eb1d,null))[_0x4ee1('0xd')](handleError(_0x58eb1d,null));};exports[_0x4ee1('0x4c')]=function(_0x20ca0b,_0x19fa31){return respondWithRpcPromise(_0x4ee1('0x4d'),_0x20ca0b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x19fa31,null))['catch'](handleError(_0x19fa31,null));};exports[_0x4ee1('0x4e')]=function(_0x5bf5e9,_0x25cfc3){return respondWithRpcPromise('SmsQueues',_0x5bf5e9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x5bf5e9[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x25cfc3,null))[_0x4ee1('0xd')](handleError(_0x25cfc3,null));};exports[_0x4ee1('0x4f')]=function(_0x342aa1,_0x447060){return respondWithRpcPromise(_0x4ee1('0x50'),_0x342aa1[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x447060,null))[_0x4ee1('0xd')](handleError(_0x447060,null));};exports['showWhatsappQueues']=function(_0x759888,_0x24308c){return respondWithRpcPromise(_0x4ee1('0x50'),_0x759888['query'],routingClient)['then'](findById(_0x759888[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x24308c,null))['catch'](handleError(_0x24308c,null));};exports[_0x4ee1('0x51')]=function(_0x431dfa,_0x3f8f94){return respondWithRpcPromise(_0x4ee1('0x52'),_0x431dfa[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x3f8f94,null))[_0x4ee1('0xd')](handleError(_0x3f8f94,null));};exports[_0x4ee1('0x53')]=function(_0x28e11c,_0x3824bf){return respondWithRpcPromise('FaxQueues',_0x28e11c[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x28e11c['params']['id']))['then'](respondWithResult(_0x3824bf,null))[_0x4ee1('0xd')](handleError(_0x3824bf,null));};exports[_0x4ee1('0x54')]=function(_0x19e095,_0x38e06){return respondWithRpcPromise(_0x4ee1('0x55'),_0x19e095[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x38e06,null))['catch'](handleError(_0x38e06,null));};exports[_0x4ee1('0x56')]=function(_0x39583b,_0x44af66){return respondWithRpcPromise(_0x4ee1('0x57'),_0x39583b[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x44af66,null))[_0x4ee1('0xd')](handleError(_0x44af66,null));};exports['mailQueuesWaitingInteractions']=function(_0x1d360f,_0x29371c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1d360f['query'],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x29371c,null))[_0x4ee1('0xd')](handleError(_0x29371c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2beb82,_0x5aacf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2beb82[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x5aacf1,null))[_0x4ee1('0xd')](handleError(_0x5aacf1,null));};exports[_0x4ee1('0x58')]=function(_0x37fa42,_0x38698a){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37fa42[_0x4ee1('0x18')],routingClient)['then'](function(_0x57f66c){if(_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')]!==undefined){var _0x411c99=_(_0x57f66c[_0x4ee1('0x15')])[_0x4ee1('0x5a')]([_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')],_0x37fa42[_0x4ee1('0x1b')]['id']])['map'](_0x4ee1('0x5b'))[_0x4ee1('0x5c')]()['value']();return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0xcd0dd9){return _0x411c99[_0x4ee1('0x5d')](_0xcd0dd9[_0x4ee1('0x5b')])>-0x1;});}else{return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0x4dee3a){return _0x4dee3a[_0x4ee1('0x5b')]===parseInt(_0x37fa42['params']['id']);});}})[_0x4ee1('0x8')](respondWithResult(_0x38698a,null))[_0x4ee1('0xd')](handleError(_0x38698a,null));};exports[_0x4ee1('0x5e')]=function(_0x35a719,_0x48c51c){return respondWithRpcPromise(_0x4ee1('0x5f'),_0x35a719[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x48c51c,null))['catch'](handleError(_0x48c51c,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2ef7c9,_0x4b4ad5){return respondWithRpcPromise(_0x4ee1('0x60'),_0x2ef7c9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x4b4ad5,null))['catch'](handleError(_0x4b4ad5,null));};exports['faxQueuesWaitingInteractions']=function(_0x27fd3b,_0x1e2360){return respondWithRpcPromise(_0x4ee1('0x61'),_0x27fd3b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x1e2360,null))[_0x4ee1('0xd')](handleError(_0x1e2360,null));};exports[_0x4ee1('0x62')]=function(_0x5727ef){return function(_0x4a3201,_0x50645b){var _0x3fba19,_0x3a75a7;var _0x33f5af=_[_0x4ee1('0x63')](_0x5727ef);var _0x4db801=_0x5727ef===_0x4ee1('0x64')?'Website':_0x4ee1('0x65');return db[_0x33f5af+_0x4ee1('0x66')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x4a3201[_0x4ee1('0x1b')]['id']}})[_0x4ee1('0x8')](function(_0x190f59){if(_['isNil'](_0x190f59)){throw new Error(_0x33f5af+_0x4ee1('0x68'));}_0x3fba19=_0x190f59;return db[_0x33f5af+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x4a3201[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0x33f5af+_0x4ee1('0x6b')],'as':_0x4ee1('0x6b')},{'model':db[_0x33f5af+_0x4db801],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x207758){if(_[_0x4ee1('0x14')](_0x207758)){throw new Error(_0x33f5af+'\x20Message\x20not\x20found');}_0x3a75a7=_0x207758;return _0x207758[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x646878={'uniqueid':_0x5727ef+'.'+_0x3a75a7['id']+'.'+_0x3a75a7[_0x4ee1('0x6b')]['id'],'FromUserId':_0x4a3201[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d')};_0x646878[_0x33f5af+_0x4ee1('0x6e')]=_0x3a75a7['id'];_0x646878[_0x33f5af+_0x4ee1('0x6f')]=_0x3a75a7[_0x4ee1('0x6b')]['id'];_0x646878[_0x4ee1('0x70')+_0x33f5af+_0x4db801+'Id']=_0x3a75a7[_0x4ee1('0x65')]['id'];_0x646878['To'+_0x33f5af+_0x4ee1('0x71')]=_0x3fba19['id'];return db[_0x33f5af+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x646878);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x5727ef,'interaction':_0x3a75a7['Interaction'],'message':_0x3a75a7,'account':_0x3a75a7[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x6d'),'appdata':_0x3fba19['name']+','+(_0x3a75a7[_0x4ee1('0x65')][_0x4ee1('0x75')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x50645b,null))[_0x4ee1('0xd')](handleError(_0x50645b,null));};};exports['agentNotify']=function(_0x13a755,_0x1a00a4){var _0x47b854,_0x1700c6;if(_[_0x4ee1('0x14')](_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x2bc05a=_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')];var _0xc07f75=_[_0x4ee1('0x63')](_0x2bc05a);var _0x4315e9=_0x2bc05a===_0x4ee1('0x64')?_0x4ee1('0x77'):'Account';return db[_0x4ee1('0x78')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x13a755['params']['id'],'role':_0x4ee1('0x79')}})['then'](function(_0x5cf7fb){if(_[_0x4ee1('0x14')](_0x5cf7fb)){throw new Error(_0x4ee1('0x7a'));}_0x47b854=_0x5cf7fb;return db[_0xc07f75+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0xc07f75+'Interaction'],'as':_0x4ee1('0x6b')},{'model':db[_0xc07f75+_0x4315e9],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x17ae2d){if(_[_0x4ee1('0x14')](_0x17ae2d)){throw new Error(_0xc07f75+_0x4ee1('0x7b'));}_0x1700c6=_0x17ae2d;return _0x17ae2d[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x5076c6={'uniqueid':_0x2bc05a+'.'+_0x1700c6['id']+'.'+_0x1700c6[_0x4ee1('0x6b')]['id'],'FromUserId':_0x13a755[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d'),'ToUserId':_0x47b854['id']};_0x5076c6[_0xc07f75+_0x4ee1('0x6e')]=_0x1700c6['id'];_0x5076c6[_0xc07f75+_0x4ee1('0x6f')]=_0x1700c6['Interaction']['id'];_0x5076c6[_0x4ee1('0x70')+_0xc07f75+_0x4315e9+'Id']=_0x1700c6['Account']['id'];return db[_0xc07f75+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x5076c6);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x2bc05a,'interaction':_0x1700c6['Interaction'],'message':_0x1700c6,'account':_0x1700c6[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x79'),'appdata':_0x47b854['name']+','+(_0x1700c6[_0x4ee1('0x65')]['agentTransferTimeout']||0x12c),'interval':_0x4ee1('0x7c')}]},routingClient);})[_0x4ee1('0x8')](respondWithResult(_0x1a00a4,null))['catch'](handleError(_0x1a00a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 473bd87..ee27f22 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 _0x7448=['isAuthenticated','run','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../config/environment','./schedule.controller','get','/:id','/:id/run'];(function(_0x1a1b94,_0x1ea1ae){var _0x44fb3e=function(_0x37aa23){while(--_0x37aa23){_0x1a1b94['push'](_0x1a1b94['shift']());}};_0x44fb3e(++_0x1ea1ae);}(_0x7448,0x7b));var _0x8744=function(_0x52937e,_0x51b2c4){_0x52937e=_0x52937e-0x0;var _0x196172=_0x7448[_0x52937e];return _0x196172;};'use strict';var multer=require('multer');var util=require(_0x8744('0x0'));var path=require(_0x8744('0x1'));var timeout=require(_0x8744('0x2'));var express=require('express');var router=express[_0x8744('0x3')]();var fs_extra=require(_0x8744('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8744('0x5'));var controller=require(_0x8744('0x6'));router[_0x8744('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8744('0x7')](_0x8744('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x8744('0x7')](_0x8744('0x9'),auth[_0x8744('0xa')](),controller[_0x8744('0xb')]);router[_0x8744('0xc')]('/',auth[_0x8744('0xa')](),controller[_0x8744('0xd')]);router[_0x8744('0xe')](_0x8744('0x8'),auth[_0x8744('0xa')](),controller[_0x8744('0xf')]);router[_0x8744('0x10')](_0x8744('0x8'),auth[_0x8744('0xa')](),controller[_0x8744('0x11')]);module[_0x8744('0x12')]=router; \ No newline at end of file +var _0x129a=['../../config/environment','get','isAuthenticated','index','/:id','show','run','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x129a,0xcb));var _0xa129=function(_0x417cd5,_0x94c9d){_0x417cd5=_0x417cd5-0x0;var _0x398264=_0x129a[_0x417cd5];return _0x398264;};'use strict';var multer=require(_0xa129('0x0'));var util=require(_0xa129('0x1'));var path=require('path');var timeout=require(_0xa129('0x2'));var express=require(_0xa129('0x3'));var router=express[_0xa129('0x4')]();var fs_extra=require(_0xa129('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa129('0x6'));var config=require(_0xa129('0x7'));var controller=require('./schedule.controller');router[_0xa129('0x8')]('/',auth[_0xa129('0x9')](),controller[_0xa129('0xa')]);router[_0xa129('0x8')](_0xa129('0xb'),auth['isAuthenticated'](),controller[_0xa129('0xc')]);router['get']('/:id/run',auth[_0xa129('0x9')](),controller[_0xa129('0xd')]);router[_0xa129('0xe')]('/',auth[_0xa129('0x9')](),controller[_0xa129('0xf')]);router[_0xa129('0x10')](_0xa129('0xb'),auth[_0xa129('0x9')](),controller[_0xa129('0x11')]);router[_0xa129('0x12')]('/:id',auth[_0xa129('0x9')](),controller[_0xa129('0x13')]);module[_0xa129('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2d2b205..dcf06b7 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 _0x8c5e=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','days','hours','xlsx','csv','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING'];(function(_0x4c49c0,_0x4adb76){var _0x596b70=function(_0x292c6b){while(--_0x292c6b){_0x4c49c0['push'](_0x4c49c0['shift']());}};_0x596b70(++_0x4adb76);}(_0x8c5e,0x1c8));var _0xe8c5=function(_0x3a3ba4,_0x308733){_0x3a3ba4=_0x3a3ba4-0x0;var _0x49959a=_0x8c5e[_0x3a3ba4];return _0x49959a;};'use strict';var Sequelize=require(_0xe8c5('0x0'));module[_0xe8c5('0x1')]={'name':{'type':Sequelize[_0xe8c5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe8c5('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe8c5('0x2')],'allowNull':![],'defaultValue':_0xe8c5('0x3')},'startAt':{'type':Sequelize[_0xe8c5('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe8c5('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe8c5('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe8c5('0x6')]('years',_0xe8c5('0x7'),_0xe8c5('0x8'),'weeks',_0xe8c5('0x9'),_0xe8c5('0xa'),'minutes'),'allowNull':![],'defaultValue':_0xe8c5('0x9')},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xe8c5('0xb')),'allowNull':![],'defaultValue':_0xe8c5('0xc')},'type':{'type':Sequelize[_0xe8c5('0x6')](_0xe8c5('0xd'),_0xe8c5('0xe')),'allowNull':![],'defaultValue':_0xe8c5('0xd')},'sendMail':{'type':Sequelize[_0xe8c5('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0xe8c5('0x2')]},'cc':{'type':Sequelize[_0xe8c5('0x10')]},'bcc':{'type':Sequelize[_0xe8c5('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xe8c5('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7835=['quarters','months','weeks','days','hours','minutes','pdf','xlsx','csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x246104,_0x146a9c){var _0x5885e1=function(_0x3f8802){while(--_0x3f8802){_0x246104['push'](_0x246104['shift']());}};_0x5885e1(++_0x146a9c);}(_0x7835,0x19b));var _0x5783=function(_0x4a95f0,_0x266572){_0x4a95f0=_0x4a95f0-0x0;var _0x447500=_0x7835[_0x4a95f0];return _0x447500;};'use strict';var Sequelize=require(_0x5783('0x0'));module[_0x5783('0x1')]={'name':{'type':Sequelize[_0x5783('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5783('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5783('0x2')],'allowNull':![],'defaultValue':_0x5783('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x5783('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5783('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5783('0x7')](_0x5783('0x8'),_0x5783('0x9'),_0x5783('0xa'),_0x5783('0xb'),_0x5783('0xc'),_0x5783('0xd'),_0x5783('0xe')),'allowNull':![],'defaultValue':_0x5783('0xc')},'output':{'type':Sequelize[_0x5783('0x7')]('csv',_0x5783('0xf'),_0x5783('0x10')),'allowNull':![],'defaultValue':_0x5783('0x11')},'type':{'type':Sequelize[_0x5783('0x7')](_0x5783('0x12'),_0x5783('0x13')),'allowNull':![],'defaultValue':_0x5783('0x12')},'sendMail':{'type':Sequelize[_0x5783('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5783('0x2')]},'cc':{'type':Sequelize[_0x5783('0x14')]},'bcc':{'type':Sequelize[_0x5783('0x14')]},'sendIfEmpty':{'type':Sequelize[_0x5783('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index a4563b3..0e11e76 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 _0xf536=['keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','limit','Content-Range','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params'];(function(_0x4379b3,_0x462110){var _0x3ebd83=function(_0x57df0e){while(--_0x57df0e){_0x4379b3['push'](_0x4379b3['shift']());}};_0x3ebd83(++_0x462110);}(_0xf536,0x15b));var _0x6f53=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0xf536[_0x23ec06];return _0x2831d4;};'use strict';var emlformat=require(_0x6f53('0x0'));var rimraf=require(_0x6f53('0x1'));var zipdir=require(_0x6f53('0x2'));var jsonpatch=require(_0x6f53('0x3'));var rp=require('request-promise');var moment=require(_0x6f53('0x4'));var BPromise=require(_0x6f53('0x5'));var Mustache=require(_0x6f53('0x6'));var util=require(_0x6f53('0x7'));var path=require('path');var sox=require(_0x6f53('0x8'));var csv=require(_0x6f53('0x9'));var ejs=require(_0x6f53('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f53('0xb'));var jsforce=require(_0x6f53('0xc'));var deskjs=require(_0x6f53('0xd'));var toCsv=require(_0x6f53('0x9'));var querystring=require(_0x6f53('0xe'));var Papa=require(_0x6f53('0xf'));var Redis=require(_0x6f53('0x10'));var authService=require(_0x6f53('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6f53('0x12'));var hardwareService=require(_0x6f53('0x13'));var logger=require(_0x6f53('0x14'))(_0x6f53('0x15'));var utils=require(_0x6f53('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f53('0x17'))['db'];function respondWithStatusCode(_0x2fa2a9,_0x4e66cf){_0x4e66cf=_0x4e66cf||0xcc;return function(_0x4502be){if(_0x4502be){return _0x2fa2a9[_0x6f53('0x18')](_0x4e66cf);}return _0x2fa2a9[_0x6f53('0x19')](_0x4e66cf)[_0x6f53('0x1a')]();};}function respondWithResult(_0x43f673,_0x1f359a){_0x1f359a=_0x1f359a||0xc8;return function(_0x2a1b39){if(_0x2a1b39){return _0x43f673[_0x6f53('0x19')](_0x1f359a)[_0x6f53('0x1b')](_0x2a1b39);}};}function respondWithFilteredResult(_0x1c74cd,_0x5f03a6){return function(_0x374c36){if(_0x374c36){var _0x564bab=typeof _0x5f03a6[_0x6f53('0x1c')]==='undefined'&&typeof _0x5f03a6['limit']==='undefined';var _0x253537=_0x374c36['count'];var _0x167dd4=_0x564bab?0x0:_0x5f03a6[_0x6f53('0x1c')];var _0x21e089=_0x564bab?_0x374c36[_0x6f53('0x1d')]:_0x5f03a6[_0x6f53('0x1c')]+_0x5f03a6[_0x6f53('0x1e')];var _0x7ff851;if(_0x21e089>=_0x253537){_0x21e089=_0x253537;_0x7ff851=0xc8;}else{_0x7ff851=0xce;}_0x1c74cd['status'](_0x7ff851);return _0x1c74cd['set'](_0x6f53('0x1f'),_0x167dd4+'-'+_0x21e089+'/'+_0x253537)[_0x6f53('0x1b')](_0x374c36);}return null;};}function patchUpdates(_0xe38e2f){return function(_0x1e132b){try{jsonpatch['apply'](_0x1e132b,_0xe38e2f,!![]);}catch(_0x53d226){return BPromise[_0x6f53('0x20')](_0x53d226);}return _0x1e132b[_0x6f53('0x21')]();};}function saveUpdates(_0x56859a,_0x1ffa7a){return function(_0x5b13a3){if(_0x5b13a3){return _0x5b13a3['update'](_0x56859a)[_0x6f53('0x22')](function(_0x49c298){return _0x49c298;});}return null;};}function removeEntity(_0x33a0bb,_0x43d99d){return function(_0x42aa69){if(_0x42aa69){return _0x42aa69[_0x6f53('0x23')]()[_0x6f53('0x22')](function(){var _0x4c2eb2=_0x42aa69['get']({'plain':!![]});var _0x171fc2='Scheduler';return db[_0x6f53('0x24')][_0x6f53('0x23')]({'where':{'type':_0x171fc2,'resourceId':_0x4c2eb2['id']}})[_0x6f53('0x22')](function(){return _0x42aa69;});})[_0x6f53('0x22')](function(){_0x33a0bb['status'](0xcc)[_0x6f53('0x1a')]();});}};}function handleEntityNotFound(_0x47eadf,_0x444276){return function(_0x18155d){if(!_0x18155d){_0x47eadf[_0x6f53('0x18')](0x194);}return _0x18155d;};}function handleError(_0x317587,_0x514539){_0x514539=_0x514539||0x1f4;return function(_0x14cde4){logger[_0x6f53('0x25')](_0x14cde4[_0x6f53('0x26')]);if(_0x14cde4[_0x6f53('0x27')]){delete _0x14cde4[_0x6f53('0x27')];}_0x317587[_0x6f53('0x19')](_0x514539)[_0x6f53('0x28')](_0x14cde4);};}exports[_0x6f53('0x29')]=function(_0x262775,_0x2fb5f0){var _0x4fa4ec={},_0x28c76d={},_0x120a59={'count':0x0,'rows':[]};var _0x3aa7cb=_[_0x6f53('0x2a')](db[_0x6f53('0x2b')][_0x6f53('0x2c')],function(_0x2aa786){return{'name':_0x2aa786[_0x6f53('0x2d')],'type':_0x2aa786[_0x6f53('0x2e')][_0x6f53('0x2f')]};});_0x28c76d[_0x6f53('0x30')]=_[_0x6f53('0x2a')](_0x3aa7cb,_0x6f53('0x27'));_0x28c76d['query']=_['keys'](_0x262775[_0x6f53('0x31')]);_0x28c76d['filters']=_[_0x6f53('0x32')](_0x28c76d['model'],_0x28c76d[_0x6f53('0x31')]);_0x4fa4ec[_0x6f53('0x33')]=_[_0x6f53('0x32')](_0x28c76d[_0x6f53('0x30')],qs[_0x6f53('0x34')](_0x262775[_0x6f53('0x31')]['fields']));_0x4fa4ec[_0x6f53('0x33')]=_0x4fa4ec[_0x6f53('0x33')][_0x6f53('0x35')]?_0x4fa4ec[_0x6f53('0x33')]:_0x28c76d[_0x6f53('0x30')];if(!_0x262775[_0x6f53('0x31')]['hasOwnProperty'](_0x6f53('0x36'))){_0x4fa4ec[_0x6f53('0x1e')]=qs[_0x6f53('0x1e')](_0x262775[_0x6f53('0x31')][_0x6f53('0x1e')]);_0x4fa4ec['offset']=qs[_0x6f53('0x1c')](_0x262775[_0x6f53('0x31')][_0x6f53('0x1c')]);}_0x4fa4ec['order']=qs[_0x6f53('0x37')](_0x262775['query'][_0x6f53('0x37')]);_0x4fa4ec[_0x6f53('0x38')]=qs[_0x6f53('0x39')](_[_0x6f53('0x3a')](_0x262775[_0x6f53('0x31')],_0x28c76d['filters']),_0x3aa7cb);if(_0x262775[_0x6f53('0x31')][_0x6f53('0x3b')]){_0x4fa4ec[_0x6f53('0x38')]=_[_0x6f53('0x3c')](_0x4fa4ec[_0x6f53('0x38')],{'$or':_['map'](_0x3aa7cb,function(_0x14ff71){if(_0x14ff71[_0x6f53('0x2e')]!==_0x6f53('0x3d')){var _0x38780f={};_0x38780f[_0x14ff71[_0x6f53('0x27')]]={'$like':'%'+_0x262775['query']['filter']+'%'};return _0x38780f;}})});}_0x4fa4ec=_[_0x6f53('0x3c')]({},_0x4fa4ec,_0x262775[_0x6f53('0x3e')]);var _0x5284bc={'where':_0x4fa4ec['where']};return db[_0x6f53('0x2b')][_0x6f53('0x1d')](_0x5284bc)[_0x6f53('0x22')](function(_0x688f4c){_0x120a59[_0x6f53('0x1d')]=_0x688f4c;if(_0x262775['query']['includeAll']){_0x4fa4ec[_0x6f53('0x3f')]=[{'all':!![]}];}return db['Schedule'][_0x6f53('0x40')](_0x4fa4ec);})[_0x6f53('0x22')](function(_0x1be668){_0x120a59[_0x6f53('0x41')]=_0x1be668;return _0x120a59;})[_0x6f53('0x22')](respondWithFilteredResult(_0x2fb5f0,_0x4fa4ec))[_0x6f53('0x42')](handleError(_0x2fb5f0,null));};exports['show']=function(_0x2dbfa9,_0x4f3e6f){var _0x7d42cd={'raw':![],'where':{'id':_0x2dbfa9[_0x6f53('0x43')]['id']}},_0x52f656={};_0x52f656[_0x6f53('0x30')]=_[_0x6f53('0x44')](db[_0x6f53('0x2b')][_0x6f53('0x2c')]);_0x52f656['query']=_[_0x6f53('0x44')](_0x2dbfa9['query']);_0x52f656[_0x6f53('0x39')]=_[_0x6f53('0x32')](_0x52f656['model'],_0x52f656['query']);_0x7d42cd['attributes']=_[_0x6f53('0x32')](_0x52f656[_0x6f53('0x30')],qs[_0x6f53('0x34')](_0x2dbfa9['query'][_0x6f53('0x34')]));_0x7d42cd[_0x6f53('0x33')]=_0x7d42cd[_0x6f53('0x33')][_0x6f53('0x35')]?_0x7d42cd[_0x6f53('0x33')]:_0x52f656[_0x6f53('0x30')];if(_0x2dbfa9['query'][_0x6f53('0x45')]){_0x7d42cd[_0x6f53('0x3f')]=[{'all':!![]}];}_0x7d42cd=_[_0x6f53('0x3c')]({},_0x7d42cd,_0x2dbfa9['options']);return db[_0x6f53('0x2b')][_0x6f53('0x46')](_0x7d42cd)['then'](handleEntityNotFound(_0x4f3e6f,null))[_0x6f53('0x22')](respondWithResult(_0x4f3e6f,null))[_0x6f53('0x42')](handleError(_0x4f3e6f,null));};exports['create']=function(_0x31b059,_0x5a7b13){return db[_0x6f53('0x2b')][_0x6f53('0x47')](_0x31b059[_0x6f53('0x48')],{})['then'](function(_0x567d3b){var _0x5dc8a6=_0x31b059[_0x6f53('0x49')][_0x6f53('0x4a')]({'plain':!![]});if(!_0x5dc8a6)throw new Error(_0x6f53('0x4b'));if(_0x5dc8a6[_0x6f53('0x4c')]===_0x6f53('0x49')){var _0x326383=_0x567d3b['get']({'plain':!![]});var _0xb37106='Scheduler';return db[_0x6f53('0x4d')][_0x6f53('0x46')]({'where':{'name':_0xb37106,'userProfileId':_0x5dc8a6[_0x6f53('0x4e')]},'raw':!![]})['then'](function(_0xa67761){if(_0xa67761&&_0xa67761[_0x6f53('0x4f')]===0x0){return db['UserProfileResource'][_0x6f53('0x47')]({'name':_0x326383[_0x6f53('0x27')],'resourceId':_0x326383['id'],'type':_0xa67761['name'],'sectionId':_0xa67761['id']},{})[_0x6f53('0x22')](function(){return _0x567d3b;});}else{return _0x567d3b;}})[_0x6f53('0x42')](function(_0x3739f2){logger[_0x6f53('0x25')](_0x6f53('0x50'),_0x3739f2);throw _0x3739f2;});}return _0x567d3b;})[_0x6f53('0x22')](respondWithResult(_0x5a7b13,0xc9))['catch'](handleError(_0x5a7b13,null));};exports['update']=function(_0x467886,_0x3b53e3){if(_0x467886[_0x6f53('0x48')]['id']){delete _0x467886['body']['id'];}return db[_0x6f53('0x2b')][_0x6f53('0x46')]({'where':{'id':_0x467886[_0x6f53('0x43')]['id']}})[_0x6f53('0x22')](handleEntityNotFound(_0x3b53e3,null))[_0x6f53('0x22')](saveUpdates(_0x467886[_0x6f53('0x48')],null))['then'](respondWithResult(_0x3b53e3,null))[_0x6f53('0x42')](handleError(_0x3b53e3,null));};exports[_0x6f53('0x23')]=function(_0x4deaa4,_0x9d607f){return db[_0x6f53('0x2b')][_0x6f53('0x46')]({'where':{'id':_0x4deaa4['params']['id']}})[_0x6f53('0x22')](handleEntityNotFound(_0x9d607f,null))[_0x6f53('0x22')](removeEntity(_0x9d607f,null))[_0x6f53('0x42')](handleError(_0x9d607f,null));};exports[_0x6f53('0x51')]=function(_0x5501f3,_0x1d4c32,_0x3e511f){var _0x3aac69=require(_0x6f53('0x52'));return db[_0x6f53('0x2b')][_0x6f53('0x46')]({'where':{'id':_0x5501f3['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1d4c32,null))[_0x6f53('0x22')](function(){_0x3aac69[_0x6f53('0x51')](_0x5501f3['params']['id']);})[_0x6f53('0x22')](respondWithStatusCode(_0x1d4c32,null))[_0x6f53('0x42')](handleError(_0x1d4c32,null));}; \ No newline at end of file +var _0x2c79=['error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','type','VIRTUAL','options','Schedule','includeAll','include','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x2c79,0xd3));var _0x92c7=function(_0x5745e6,_0xa7bc69){_0x5745e6=_0x5745e6-0x0;var _0x3d43fe=_0x2c79[_0x5745e6];return _0x3d43fe;};'use strict';var emlformat=require(_0x92c7('0x0'));var rimraf=require(_0x92c7('0x1'));var zipdir=require(_0x92c7('0x2'));var jsonpatch=require(_0x92c7('0x3'));var rp=require(_0x92c7('0x4'));var moment=require('moment');var BPromise=require(_0x92c7('0x5'));var Mustache=require(_0x92c7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x92c7('0x7'));var csv=require(_0x92c7('0x8'));var ejs=require(_0x92c7('0x9'));var fs=require('fs');var fs_extra=require(_0x92c7('0xa'));var _=require(_0x92c7('0xb'));var squel=require(_0x92c7('0xc'));var crypto=require(_0x92c7('0xd'));var jsforce=require(_0x92c7('0xe'));var deskjs=require(_0x92c7('0xf'));var toCsv=require(_0x92c7('0x8'));var querystring=require('querystring');var Papa=require(_0x92c7('0x10'));var Redis=require(_0x92c7('0x11'));var authService=require(_0x92c7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x92c7('0x13'));var hardwareService=require(_0x92c7('0x14'));var logger=require('../../config/logger')(_0x92c7('0x15'));var utils=require(_0x92c7('0x16'));var config=require(_0x92c7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x92c7('0x18'))['db'];function respondWithStatusCode(_0x7ae42f,_0x53c833){_0x53c833=_0x53c833||0xcc;return function(_0x1fd0dd){if(_0x1fd0dd){return _0x7ae42f[_0x92c7('0x19')](_0x53c833);}return _0x7ae42f['status'](_0x53c833)['end']();};}function respondWithResult(_0x6cf541,_0x417b1a){_0x417b1a=_0x417b1a||0xc8;return function(_0x4ed132){if(_0x4ed132){return _0x6cf541[_0x92c7('0x1a')](_0x417b1a)['json'](_0x4ed132);}};}function respondWithFilteredResult(_0x3f5905,_0x4e3b1a){return function(_0x5ee307){if(_0x5ee307){var _0x53a0ef=typeof _0x4e3b1a[_0x92c7('0x1b')]===_0x92c7('0x1c')&&typeof _0x4e3b1a['limit']===_0x92c7('0x1c');var _0x2746e1=_0x5ee307['count'];var _0x3e0be1=_0x53a0ef?0x0:_0x4e3b1a['offset'];var _0x237a26=_0x53a0ef?_0x5ee307[_0x92c7('0x1d')]:_0x4e3b1a[_0x92c7('0x1b')]+_0x4e3b1a['limit'];var _0x2e7010;if(_0x237a26>=_0x2746e1){_0x237a26=_0x2746e1;_0x2e7010=0xc8;}else{_0x2e7010=0xce;}_0x3f5905['status'](_0x2e7010);return _0x3f5905['set'](_0x92c7('0x1e'),_0x3e0be1+'-'+_0x237a26+'/'+_0x2746e1)[_0x92c7('0x1f')](_0x5ee307);}return null;};}function patchUpdates(_0x1a5364){return function(_0x57b48f){try{jsonpatch[_0x92c7('0x20')](_0x57b48f,_0x1a5364,!![]);}catch(_0x5c0769){return BPromise[_0x92c7('0x21')](_0x5c0769);}return _0x57b48f[_0x92c7('0x22')]();};}function saveUpdates(_0x4fc6bd,_0x3ae577){return function(_0xf23544){if(_0xf23544){return _0xf23544[_0x92c7('0x23')](_0x4fc6bd)[_0x92c7('0x24')](function(_0x218d30){return _0x218d30;});}return null;};}function removeEntity(_0x3226c3,_0x9b81f5){return function(_0x1aec06){if(_0x1aec06){return _0x1aec06[_0x92c7('0x25')]()[_0x92c7('0x24')](function(){var _0x3d3bd0=_0x1aec06[_0x92c7('0x26')]({'plain':!![]});var _0x17d999=_0x92c7('0x27');return db[_0x92c7('0x28')][_0x92c7('0x25')]({'where':{'type':_0x17d999,'resourceId':_0x3d3bd0['id']}})[_0x92c7('0x24')](function(){return _0x1aec06;});})[_0x92c7('0x24')](function(){_0x3226c3[_0x92c7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42094c,_0x504599){return function(_0x23bfe9){if(!_0x23bfe9){_0x42094c[_0x92c7('0x19')](0x194);}return _0x23bfe9;};}function handleError(_0x546e2d,_0x27d944){_0x27d944=_0x27d944||0x1f4;return function(_0x288e71){logger[_0x92c7('0x29')](_0x288e71[_0x92c7('0x2a')]);if(_0x288e71[_0x92c7('0x2b')]){delete _0x288e71[_0x92c7('0x2b')];}_0x546e2d['status'](_0x27d944)[_0x92c7('0x2c')](_0x288e71);};}exports[_0x92c7('0x2d')]=function(_0x599787,_0x5de6cf){var _0x29ced0={},_0x14e6c2={},_0x114823={'count':0x0,'rows':[]};var _0x25a762=_[_0x92c7('0x2e')](db['Schedule'][_0x92c7('0x2f')],function(_0x20156a){return{'name':_0x20156a[_0x92c7('0x30')],'type':_0x20156a['type']['key']};});_0x14e6c2[_0x92c7('0x31')]=_['map'](_0x25a762,'name');_0x14e6c2[_0x92c7('0x32')]=_[_0x92c7('0x33')](_0x599787[_0x92c7('0x32')]);_0x14e6c2[_0x92c7('0x34')]=_['intersection'](_0x14e6c2['model'],_0x14e6c2[_0x92c7('0x32')]);_0x29ced0[_0x92c7('0x35')]=_[_0x92c7('0x36')](_0x14e6c2[_0x92c7('0x31')],qs[_0x92c7('0x37')](_0x599787[_0x92c7('0x32')][_0x92c7('0x37')]));_0x29ced0[_0x92c7('0x35')]=_0x29ced0[_0x92c7('0x35')][_0x92c7('0x38')]?_0x29ced0[_0x92c7('0x35')]:_0x14e6c2[_0x92c7('0x31')];if(!_0x599787[_0x92c7('0x32')][_0x92c7('0x39')]('nolimit')){_0x29ced0[_0x92c7('0x3a')]=qs[_0x92c7('0x3a')](_0x599787[_0x92c7('0x32')][_0x92c7('0x3a')]);_0x29ced0['offset']=qs[_0x92c7('0x1b')](_0x599787[_0x92c7('0x32')][_0x92c7('0x1b')]);}_0x29ced0[_0x92c7('0x3b')]=qs[_0x92c7('0x3c')](_0x599787[_0x92c7('0x32')][_0x92c7('0x3c')]);_0x29ced0[_0x92c7('0x3d')]=qs['filters'](_['pick'](_0x599787[_0x92c7('0x32')],_0x14e6c2[_0x92c7('0x34')]),_0x25a762);if(_0x599787[_0x92c7('0x32')][_0x92c7('0x3e')]){_0x29ced0[_0x92c7('0x3d')]=_[_0x92c7('0x3f')](_0x29ced0[_0x92c7('0x3d')],{'$or':_[_0x92c7('0x2e')](_0x25a762,function(_0x10430c){if(_0x10430c[_0x92c7('0x40')]!==_0x92c7('0x41')){var _0x3230b9={};_0x3230b9[_0x10430c[_0x92c7('0x2b')]]={'$like':'%'+_0x599787[_0x92c7('0x32')][_0x92c7('0x3e')]+'%'};return _0x3230b9;}})});}_0x29ced0=_[_0x92c7('0x3f')]({},_0x29ced0,_0x599787[_0x92c7('0x42')]);var _0x1589e2={'where':_0x29ced0[_0x92c7('0x3d')]};return db[_0x92c7('0x43')][_0x92c7('0x1d')](_0x1589e2)['then'](function(_0x20b485){_0x114823['count']=_0x20b485;if(_0x599787[_0x92c7('0x32')][_0x92c7('0x44')]){_0x29ced0[_0x92c7('0x45')]=[{'all':!![]}];}return db[_0x92c7('0x43')]['findAll'](_0x29ced0);})[_0x92c7('0x24')](function(_0x5b3cbd){_0x114823['rows']=_0x5b3cbd;return _0x114823;})['then'](respondWithFilteredResult(_0x5de6cf,_0x29ced0))[_0x92c7('0x46')](handleError(_0x5de6cf,null));};exports['show']=function(_0x17e209,_0x2325b8){var _0x393356={'raw':![],'where':{'id':_0x17e209[_0x92c7('0x47')]['id']}},_0x4902e6={};_0x4902e6['model']=_[_0x92c7('0x33')](db[_0x92c7('0x43')][_0x92c7('0x2f')]);_0x4902e6['query']=_[_0x92c7('0x33')](_0x17e209[_0x92c7('0x32')]);_0x4902e6[_0x92c7('0x34')]=_[_0x92c7('0x36')](_0x4902e6[_0x92c7('0x31')],_0x4902e6[_0x92c7('0x32')]);_0x393356[_0x92c7('0x35')]=_['intersection'](_0x4902e6[_0x92c7('0x31')],qs[_0x92c7('0x37')](_0x17e209[_0x92c7('0x32')]['fields']));_0x393356[_0x92c7('0x35')]=_0x393356[_0x92c7('0x35')]['length']?_0x393356[_0x92c7('0x35')]:_0x4902e6[_0x92c7('0x31')];if(_0x17e209[_0x92c7('0x32')][_0x92c7('0x44')]){_0x393356['include']=[{'all':!![]}];}_0x393356=_[_0x92c7('0x3f')]({},_0x393356,_0x17e209[_0x92c7('0x42')]);return db['Schedule']['find'](_0x393356)['then'](handleEntityNotFound(_0x2325b8,null))[_0x92c7('0x24')](respondWithResult(_0x2325b8,null))['catch'](handleError(_0x2325b8,null));};exports['create']=function(_0x321ca4,_0x1ea6fe){return db[_0x92c7('0x43')][_0x92c7('0x48')](_0x321ca4[_0x92c7('0x49')],{})[_0x92c7('0x24')](function(_0x2e9a36){var _0x3a27f6=_0x321ca4['user'][_0x92c7('0x26')]({'plain':!![]});if(!_0x3a27f6)throw new Error(_0x92c7('0x4a'));if(_0x3a27f6[_0x92c7('0x4b')]===_0x92c7('0x4c')){var _0x37f9d5=_0x2e9a36[_0x92c7('0x26')]({'plain':!![]});var _0x287c79=_0x92c7('0x27');return db[_0x92c7('0x4d')]['find']({'where':{'name':_0x287c79,'userProfileId':_0x3a27f6[_0x92c7('0x4e')]},'raw':!![]})['then'](function(_0x15c379){if(_0x15c379&&_0x15c379[_0x92c7('0x4f')]===0x0){return db[_0x92c7('0x28')][_0x92c7('0x48')]({'name':_0x37f9d5[_0x92c7('0x2b')],'resourceId':_0x37f9d5['id'],'type':_0x15c379['name'],'sectionId':_0x15c379['id']},{})['then'](function(){return _0x2e9a36;});}else{return _0x2e9a36;}})[_0x92c7('0x46')](function(_0x36f555){logger['error'](_0x92c7('0x50'),_0x36f555);throw _0x36f555;});}return _0x2e9a36;})[_0x92c7('0x24')](respondWithResult(_0x1ea6fe,0xc9))[_0x92c7('0x46')](handleError(_0x1ea6fe,null));};exports[_0x92c7('0x23')]=function(_0x232642,_0x40548c){if(_0x232642['body']['id']){delete _0x232642[_0x92c7('0x49')]['id'];}return db[_0x92c7('0x43')][_0x92c7('0x51')]({'where':{'id':_0x232642[_0x92c7('0x47')]['id']}})[_0x92c7('0x24')](handleEntityNotFound(_0x40548c,null))[_0x92c7('0x24')](saveUpdates(_0x232642[_0x92c7('0x49')],null))['then'](respondWithResult(_0x40548c,null))[_0x92c7('0x46')](handleError(_0x40548c,null));};exports['destroy']=function(_0x21ec63,_0x14d228){return db[_0x92c7('0x43')][_0x92c7('0x51')]({'where':{'id':_0x21ec63[_0x92c7('0x47')]['id']}})[_0x92c7('0x24')](handleEntityNotFound(_0x14d228,null))[_0x92c7('0x24')](removeEntity(_0x14d228,null))['catch'](handleError(_0x14d228,null));};exports[_0x92c7('0x52')]=function(_0x3fc1cf,_0xa44626,_0x61764f){var _0x486119=require(_0x92c7('0x53'));return db['Schedule'][_0x92c7('0x51')]({'where':{'id':_0x3fc1cf[_0x92c7('0x47')]['id']},'raw':!![]})[_0x92c7('0x24')](handleEntityNotFound(_0xa44626,null))[_0x92c7('0x24')](function(){_0x486119[_0x92c7('0x52')](_0x3fc1cf[_0x92c7('0x47')]['id']);})[_0x92c7('0x24')](respondWithStatusCode(_0xa44626,null))['catch'](handleError(_0xa44626,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f966404..7195a04 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 _0x223d=['Schedule','tools_schedules','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0x2dfe14,_0x528cf2){var _0x13ea18=function(_0x714114){while(--_0x714114){_0x2dfe14['push'](_0x2dfe14['shift']());}};_0x13ea18(++_0x528cf2);}(_0x223d,0x106));var _0xd223=function(_0x4f09ed,_0x335d34){_0x4f09ed=_0x4f09ed-0x0;var _0x37da7f=_0x223d[_0x4f09ed];return _0x37da7f;};'use strict';var _=require(_0xd223('0x0'));var util=require(_0xd223('0x1'));var logger=require('../../config/logger')(_0xd223('0x2'));var moment=require(_0xd223('0x3'));var BPromise=require(_0xd223('0x4'));var rp=require(_0xd223('0x5'));var fs=require('fs');var path=require(_0xd223('0x6'));var rimraf=require(_0xd223('0x7'));var config=require(_0xd223('0x8'));var attributes=require(_0xd223('0x9'));module[_0xd223('0xa')]=function(_0x4ec8e6,_0x38a7ac){return _0x4ec8e6['define'](_0xd223('0xb'),attributes,{'tableName':_0xd223('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b4b=['rimraf','./schedule.attributes','exports','define','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1eeccd,_0x42a3b2){var _0x27f925=function(_0x2380d8){while(--_0x2380d8){_0x1eeccd['push'](_0x1eeccd['shift']());}};_0x27f925(++_0x42a3b2);}(_0x4b4b,0x179));var _0xb4b4=function(_0x3d9390,_0x4e6d7b){_0x3d9390=_0x3d9390-0x0;var _0x4e4cb4=_0x4b4b[_0x3d9390];return _0x4e4cb4;};'use strict';var _=require(_0xb4b4('0x0'));var util=require(_0xb4b4('0x1'));var logger=require(_0xb4b4('0x2'))(_0xb4b4('0x3'));var moment=require(_0xb4b4('0x4'));var BPromise=require(_0xb4b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4b4('0x6'));var rimraf=require(_0xb4b4('0x7'));var config=require('../../config/environment');var attributes=require(_0xb4b4('0x8'));module[_0xb4b4('0x9')]=function(_0x5c19eb,_0x4135c){return _0x5c19eb[_0xb4b4('0xa')]('Schedule',attributes,{'tableName':_0xb4b4('0xb'),'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 886ed51..4a27422 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 _0x4f68=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x240b93,_0x575f73){var _0x243027=function(_0x2a0249){while(--_0x2a0249){_0x240b93['push'](_0x240b93['shift']());}};_0x243027(++_0x575f73);}(_0x4f68,0x10e));var _0x84f6=function(_0x30f3b4,_0x5d1682){_0x30f3b4=_0x30f3b4-0x0;var _0x35ce88=_0x4f68[_0x30f3b4];return _0x35ce88;};'use strict';var _=require('lodash');var util=require(_0x84f6('0x0'));var moment=require(_0x84f6('0x1'));var BPromise=require(_0x84f6('0x2'));var rs=require(_0x84f6('0x3'));var fs=require('fs');var Redis=require(_0x84f6('0x4'));var db=require(_0x84f6('0x5'))['db'];var utils=require(_0x84f6('0x6'));var logger=require(_0x84f6('0x7'))('rpc');var config=require(_0x84f6('0x8'));var jayson=require(_0x84f6('0x9'));var client=jayson[_0x84f6('0xa')][_0x84f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc3e1,_0x2a17d5,_0x3c769d){return new BPromise(function(_0x1055af,_0x1e4d0b){return client[_0x84f6('0xc')](_0x5bc3e1,_0x3c769d)['then'](function(_0x27ee70){logger[_0x84f6('0xd')](_0x84f6('0xe'),_0x2a17d5,'request\x20sent');logger[_0x84f6('0xf')](_0x84f6('0x10'),_0x2a17d5,_0x84f6('0x11'),JSON[_0x84f6('0x12')](_0x27ee70));if(_0x27ee70[_0x84f6('0x13')]){if(_0x27ee70[_0x84f6('0x13')][_0x84f6('0x14')]===0x1f4){logger[_0x84f6('0x13')](_0x84f6('0xe'),_0x2a17d5,_0x27ee70[_0x84f6('0x13')]['message']);return _0x1e4d0b(_0x27ee70['error']['message']);}logger[_0x84f6('0x13')]('Schedule,\x20%s,\x20%s',_0x2a17d5,_0x27ee70[_0x84f6('0x13')]['message']);return _0x1055af(_0x27ee70[_0x84f6('0x13')][_0x84f6('0x15')]);}else{logger[_0x84f6('0xd')](_0x84f6('0xe'),_0x2a17d5,_0x84f6('0x11'));_0x1055af(_0x27ee70[_0x84f6('0x16')]['message']);}})[_0x84f6('0x17')](function(_0x37daf8){logger[_0x84f6('0x13')](_0x84f6('0xe'),_0x2a17d5,_0x37daf8);_0x1e4d0b(_0x37daf8);});});} \ No newline at end of file +var _0x4eb2=['request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x260739,_0x272afc){var _0x524e30=function(_0x545293){while(--_0x545293){_0x260739['push'](_0x260739['shift']());}};_0x524e30(++_0x272afc);}(_0x4eb2,0xdb));var _0x24eb=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4eb2[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x24eb('0x0'));var util=require('util');var moment=require(_0x24eb('0x1'));var BPromise=require('bluebird');var rs=require(_0x24eb('0x2'));var fs=require('fs');var Redis=require(_0x24eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x24eb('0x4'));var logger=require(_0x24eb('0x5'))(_0x24eb('0x6'));var config=require(_0x24eb('0x7'));var jayson=require(_0x24eb('0x8'));var client=jayson[_0x24eb('0x9')][_0x24eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bfbb1,_0x1e1dc1,_0x22dabc){return new BPromise(function(_0xb3c13f,_0x321e3f){return client[_0x24eb('0xb')](_0x5bfbb1,_0x22dabc)[_0x24eb('0xc')](function(_0xb6a944){logger[_0x24eb('0xd')](_0x24eb('0xe'),_0x1e1dc1,'request\x20sent');logger[_0x24eb('0xf')](_0x24eb('0x10'),_0x1e1dc1,_0x24eb('0x11'),JSON[_0x24eb('0x12')](_0xb6a944));if(_0xb6a944[_0x24eb('0x13')]){if(_0xb6a944[_0x24eb('0x13')][_0x24eb('0x14')]===0x1f4){logger[_0x24eb('0x13')](_0x24eb('0xe'),_0x1e1dc1,_0xb6a944[_0x24eb('0x13')][_0x24eb('0x15')]);return _0x321e3f(_0xb6a944[_0x24eb('0x13')][_0x24eb('0x15')]);}logger['error'](_0x24eb('0xe'),_0x1e1dc1,_0xb6a944['error'][_0x24eb('0x15')]);return _0xb3c13f(_0xb6a944['error']['message']);}else{logger[_0x24eb('0xd')]('Schedule,\x20%s,\x20%s',_0x1e1dc1,_0x24eb('0x11'));_0xb3c13f(_0xb6a944['result'][_0x24eb('0x15')]);}})[_0x24eb('0x16')](function(_0x1418ba){logger[_0x24eb('0x13')](_0x24eb('0xe'),_0x1e1dc1,_0x1418ba);_0x321e3f(_0x1418ba);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 7337f9d..9eb48ea 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 _0x28ef=['delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','isAuthenticated','describe','get','/:id','/:id/download','download','post','create','put'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x28ef,0x1df));var _0xf28e=function(_0x70b4e7,_0x15a637){_0x70b4e7=_0x70b4e7-0x0;var _0x4057db=_0x28ef[_0x70b4e7];return _0x4057db;};'use strict';var multer=require('multer');var util=require(_0xf28e('0x0'));var path=require(_0xf28e('0x1'));var timeout=require(_0xf28e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf28e('0x3'));var auth=require(_0xf28e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./screenRecording.controller');router['get']('/',auth[_0xf28e('0x5')](),controller['index']);router['get']('/describe',auth[_0xf28e('0x5')](),controller[_0xf28e('0x6')]);router[_0xf28e('0x7')](_0xf28e('0x8'),auth[_0xf28e('0x5')](),controller['show']);router['get'](_0xf28e('0x9'),auth[_0xf28e('0x5')](),controller[_0xf28e('0xa')]);router[_0xf28e('0xb')]('/',auth['isAuthenticated'](),controller[_0xf28e('0xc')]);router[_0xf28e('0xd')](_0xf28e('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xf28e('0xe')]('/:id',auth[_0xf28e('0x5')](),controller[_0xf28e('0xf')]);module[_0xf28e('0x10')]=router; \ No newline at end of file +var _0x7ad7=['connect-timeout','Router','fs-extra','../../components/auth/service','./screenRecording.controller','get','isAuthenticated','index','/describe','post','create','/:id','update','delete','multer'];(function(_0x5d49a8,_0x32bdb6){var _0x1109ec=function(_0x4629ee){while(--_0x4629ee){_0x5d49a8['push'](_0x5d49a8['shift']());}};_0x1109ec(++_0x32bdb6);}(_0x7ad7,0xe0));var _0x77ad=function(_0x4ec8ac,_0x284cb7){_0x4ec8ac=_0x4ec8ac-0x0;var _0x5c6c40=_0x7ad7[_0x4ec8ac];return _0x5c6c40;};'use strict';var multer=require(_0x77ad('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x77ad('0x1'));var express=require('express');var router=express[_0x77ad('0x2')]();var fs_extra=require(_0x77ad('0x3'));var auth=require(_0x77ad('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77ad('0x5'));router[_0x77ad('0x6')]('/',auth[_0x77ad('0x7')](),controller[_0x77ad('0x8')]);router[_0x77ad('0x6')](_0x77ad('0x9'),auth[_0x77ad('0x7')](),controller['describe']);router['get']('/:id',auth[_0x77ad('0x7')](),controller['show']);router[_0x77ad('0x6')]('/:id/download',auth[_0x77ad('0x7')](),controller['download']);router[_0x77ad('0xa')]('/',auth['isAuthenticated'](),controller[_0x77ad('0xb')]);router['put'](_0x77ad('0xc'),auth['isAuthenticated'](),controller[_0x77ad('0xd')]);router[_0x77ad('0xe')](_0x77ad('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1b8bd57..ebc29d7 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 _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(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0xa9e1[_0x4e0a03];return _0x2478fc;};'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 +var _0xb8cb=['../../config/environment','exports','VIRTUAL','getDataValue','extname','STRING','replace','setDataValue','value','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x5b91e5,_0x4b06a5){_0x5b91e5=_0x5b91e5-0x0;var _0x9c0f24=_0xb8cb[_0x5b91e5];return _0x9c0f24;};'use strict';var Sequelize=require(_0xbb8c('0x0'));var moment=require(_0xbb8c('0x1'));var path=require(_0xbb8c('0x2'));var config=require(_0xbb8c('0x3'));module[_0xbb8c('0x4')]={'format':{'type':Sequelize[_0xbb8c('0x5')],'get':function(){return this[_0xbb8c('0x6')]('value')?path[_0xbb8c('0x7')](this[_0xbb8c('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbb8c('0x8')]},'value':{'type':Sequelize[_0xbb8c('0x8')],'set':function(_0x3eb759){var _0x497956=_0x3eb759[_0xbb8c('0x9')](/\\/g,'/');this[_0xbb8c('0xa')](_0xbb8c('0xb'),_0x497956);}},'rating':{'type':Sequelize[_0xbb8c('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xbb8c('0xc')],'set':function(_0x2a9791){this[_0xbb8c('0xa')](_0xbb8c('0xd'),moment()[_0xbb8c('0xe')](_0x2a9791,'ms'));this[_0xbb8c('0xa')](_0xbb8c('0xf'),moment());this[_0xbb8c('0xa')]('duration',_0x2a9791);}},'startedAt':{'type':Sequelize[_0xbb8c('0x10')],'get':function(){return moment(this[_0xbb8c('0x6')](_0xbb8c('0xd')))[_0xbb8c('0x11')](_0xbb8c('0x12'))['toString']();}},'closedAt':{'type':Sequelize[_0xbb8c('0x10')],'get':function(){return moment(this[_0xbb8c('0x6')](_0xbb8c('0xf')))[_0xbb8c('0x11')](_0xbb8c('0x12'))[_0xbb8c('0x13')]();}},'createdAt':{'type':Sequelize[_0xbb8c('0x10')],'get':function(){return moment(this['getDataValue'](_0xbb8c('0x14')))[_0xbb8c('0x11')](_0xbb8c('0x12'))[_0xbb8c('0x13')]();}},'updatedAt':{'type':Sequelize[_0xbb8c('0x10')],'get':function(){return moment(this[_0xbb8c('0x6')](_0xbb8c('0x15')))[_0xbb8c('0x11')](_0xbb8c('0x12'))[_0xbb8c('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 2fa23f3..e445507 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 _0x2bd8=['unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x6c1026,_0x3a4422){var _0x44ff42=function(_0x2e2167){while(--_0x2e2167){_0x6c1026['push'](_0x6c1026['shift']());}};_0x44ff42(++_0x3a4422);}(_0x2bd8,0x130));var _0x82bd=function(_0x8a02d7,_0x2621f7){_0x8a02d7=_0x8a02d7-0x0;var _0xd242ca=_0x2bd8[_0x8a02d7];return _0xd242ca;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file +var _0x8d0e=['name','send','map','fieldName','type','key','format','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','show','includeAll','include','ScreenRecording','find','create','body','duration','value','params','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','filename','unlink','ScreenRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','stack'];(function(_0x1259f7,_0x1aebd2){var _0x2a978f=function(_0x388948){while(--_0x388948){_0x1259f7['push'](_0x1259f7['shift']());}};_0x2a978f(++_0x1aebd2);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5a1efa,_0x1da9c9){_0x5a1efa=_0x5a1efa-0x0;var _0x37205c=_0x8d0e[_0x5a1efa];return _0x37205c;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){_0x9f747[_0xe8d0('0x1b')](0xcc)[_0xe8d0('0x28')]();});}};}function handleEntityNotFound(_0x149dfd,_0x31519b){return function(_0x32f0c1){if(!_0x32f0c1){_0x149dfd[_0xe8d0('0x29')](0x194);}return _0x32f0c1;};}function handleError(_0x2dee67,_0x264de4){_0x264de4=_0x264de4||0x1f4;return function(_0x539548){logger[_0xe8d0('0x2a')](_0x539548[_0xe8d0('0x2b')]);if(_0x539548[_0xe8d0('0x2c')]){delete _0x539548['name'];}_0x2dee67[_0xe8d0('0x1b')](_0x264de4)[_0xe8d0('0x2d')](_0x539548);};}exports['index']=function(_0x1519e2,_0x3ffcb7){var _0x11fcf2={},_0x9eec0e={},_0x3cf3d6={'count':0x0,'rows':[]};var _0x495064=_[_0xe8d0('0x2e')](db['ScreenRecording']['rawAttributes'],function(_0x50ad3c){return{'name':_0x50ad3c[_0xe8d0('0x2f')],'type':_0x50ad3c[_0xe8d0('0x30')][_0xe8d0('0x31')]};});_0x9eec0e['model']=_['differenceBy'](_[_0xe8d0('0x2e')](_0x495064,'name'),[_0xe8d0('0x32')]);_0x9eec0e[_0xe8d0('0x33')]=_[_0xe8d0('0x34')](_0x1519e2[_0xe8d0('0x33')]);_0x9eec0e[_0xe8d0('0x35')]=_['intersection'](_0x9eec0e[_0xe8d0('0x36')],_0x9eec0e[_0xe8d0('0x33')]);_0x11fcf2[_0xe8d0('0x37')]=_[_0xe8d0('0x38')](_0x9eec0e['model'],qs[_0xe8d0('0x39')](_0x1519e2[_0xe8d0('0x33')]['fields']));_0x11fcf2[_0xe8d0('0x37')]=_0x11fcf2['attributes'][_0xe8d0('0x3a')]?_0x11fcf2['attributes']:_0x9eec0e[_0xe8d0('0x36')];if(!_0x1519e2['query'][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x11fcf2[_0xe8d0('0x1e')]=qs[_0xe8d0('0x1e')](_0x1519e2['query'][_0xe8d0('0x1e')]);_0x11fcf2[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x1519e2['query'][_0xe8d0('0x1f')]);}_0x11fcf2[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x3e')]);_0x11fcf2['where']=qs[_0xe8d0('0x35')](_[_0xe8d0('0x3f')](_0x1519e2[_0xe8d0('0x33')],_0x9eec0e[_0xe8d0('0x35')]),_0x495064);if(_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x40')]){_0x11fcf2[_0xe8d0('0x41')]=_[_0xe8d0('0x42')](_0x11fcf2['where'],{'$or':_['map'](_0x495064,function(_0xdca203){if(_0xdca203[_0xe8d0('0x30')]!==_0xe8d0('0x43')){var _0x377dc1={};_0x377dc1[_0xdca203[_0xe8d0('0x2c')]]={'$like':'%'+_0x1519e2['query'][_0xe8d0('0x40')]+'%'};return _0x377dc1;}})});}_0x11fcf2=_['merge']({},_0x11fcf2,_0x1519e2[_0xe8d0('0x44')]);var _0x458294={'where':_0x11fcf2[_0xe8d0('0x41')]};return db['ScreenRecording'][_0xe8d0('0x20')](_0x458294)[_0xe8d0('0x27')](function(_0x731382){_0x3cf3d6[_0xe8d0('0x20')]=_0x731382;if(_0x1519e2[_0xe8d0('0x33')]['includeAll']){_0x11fcf2['include']=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x11fcf2);})[_0xe8d0('0x27')](function(_0x52f288){_0x3cf3d6[_0xe8d0('0x45')]=_0x52f288;return _0x3cf3d6;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x3ffcb7,_0x11fcf2))[_0xe8d0('0x46')](handleError(_0x3ffcb7,null));};exports[_0xe8d0('0x47')]=function(_0x2fd21e,_0x1156da){var _0x1b41c7={'raw':![],'where':{'id':_0x2fd21e['params']['id']}},_0x3cbca5={};_0x3cbca5[_0xe8d0('0x36')]=_[_0xe8d0('0x34')](db['ScreenRecording']['rawAttributes']);_0x3cbca5[_0xe8d0('0x33')]=_[_0xe8d0('0x34')](_0x2fd21e[_0xe8d0('0x33')]);_0x3cbca5['filters']=_[_0xe8d0('0x38')](_0x3cbca5[_0xe8d0('0x36')],_0x3cbca5['query']);_0x1b41c7[_0xe8d0('0x37')]=_[_0xe8d0('0x38')](_0x3cbca5['model'],qs[_0xe8d0('0x39')](_0x2fd21e[_0xe8d0('0x33')][_0xe8d0('0x39')]));_0x1b41c7[_0xe8d0('0x37')]=_0x1b41c7[_0xe8d0('0x37')][_0xe8d0('0x3a')]?_0x1b41c7[_0xe8d0('0x37')]:_0x3cbca5[_0xe8d0('0x36')];if(_0x2fd21e['query'][_0xe8d0('0x48')]){_0x1b41c7[_0xe8d0('0x49')]=[{'all':!![]}];}_0x1b41c7=_[_0xe8d0('0x42')]({},_0x1b41c7,_0x2fd21e[_0xe8d0('0x44')]);return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')](_0x1b41c7)[_0xe8d0('0x27')](handleEntityNotFound(_0x1156da,null))[_0xe8d0('0x27')](respondWithResult(_0x1156da,null))[_0xe8d0('0x46')](handleError(_0x1156da,null));};exports[_0xe8d0('0x4c')]=function(_0x361e3d,_0x3a5987){return db['ScreenRecording'][_0xe8d0('0x4c')](_0x361e3d[_0xe8d0('0x4d')],{})[_0xe8d0('0x27')](respondWithResult(_0x3a5987,0xc9))[_0xe8d0('0x46')](handleError(_0x3a5987,null));};exports[_0xe8d0('0x25')]=function(_0x2e4caf,_0x5a0c7e){if(_0x2e4caf['body']['id']){delete _0x2e4caf[_0xe8d0('0x4d')]['id'];}delete _0x2e4caf[_0xe8d0('0x4d')][_0xe8d0('0x4e')];delete _0x2e4caf[_0xe8d0('0x4d')]['createdAt'];delete _0x2e4caf[_0xe8d0('0x4d')]['closedAt'];delete _0x2e4caf[_0xe8d0('0x4d')][_0xe8d0('0x4f')];return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')]({'where':{'id':_0x2e4caf[_0xe8d0('0x50')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x5a0c7e,null))[_0xe8d0('0x27')](saveUpdates(_0x2e4caf['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x5a0c7e,null))['catch'](handleError(_0x5a0c7e,null));};exports['describe']=function(_0x35138a,_0x5516ad){return db[_0xe8d0('0x4a')]['describe']()[_0xe8d0('0x27')](respondWithResult(_0x5516ad,null))[_0xe8d0('0x46')](handleError(_0x5516ad,null));};exports[_0xe8d0('0x51')]=function(_0xcf4642,_0x555a56,_0x3088b1){var _0xbd55db=require(_0xe8d0('0x52'));var _0x2e3f1d=![];var _0x18cc14={};if(_0xcf4642['query'][_0xe8d0('0x30')]&&_0xcf4642[_0xe8d0('0x33')][_0xe8d0('0x30')]==='uniqueid'){_0x18cc14[_0xe8d0('0x53')]=_0xcf4642['params']['id'];}else{_0x18cc14['id']=_0xcf4642['params']['id'];}return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')]({'where':_0x18cc14,'attributes':['id','value'],'raw':!![]})[_0xe8d0('0x27')](handleEntityNotFound(_0x555a56,null))[_0xe8d0('0x27')](function(_0x47893d){if(_0x47893d){var _0x2a54c1=path[_0xe8d0('0x54')](config[_0xe8d0('0x55')],_0xe8d0('0x56'),_0x47893d['value']);var _0x20f6c2=util[_0xe8d0('0x32')](_0xe8d0('0x57'),_0x2a54c1);if(fs[_0xe8d0('0x58')](_0x20f6c2)){_0x2e3f1d=!![];return _0xbd55db['decryptFile'](_0x20f6c2,_0x2a54c1,config[_0xe8d0('0x59')][_0xe8d0('0x5a')])[_0xe8d0('0x27')](function(){return _0x47893d;});}return _0x47893d;}})[_0xe8d0('0x27')](function(_0x1a74d0){if(_0x1a74d0){var _0x29667c=path['join'](config['root'],_0xe8d0('0x56'),_0x1a74d0['value']);if(!fs[_0xe8d0('0x58')](_0x29667c)){throw new db[(_0xe8d0('0x5b'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x1a74d0[_0xe8d0('0x5c')]){return _0x555a56['download'](_0x29667c,_0x1a74d0[_0xe8d0('0x5c')]+path['extname'](_0x29667c),function(){if(_0x2e3f1d){fs[_0xe8d0('0x5d')](_0x29667c);}});}else{return _0x555a56[_0xe8d0('0x51')](_0x29667c,function(_0x13b9f0){if(_0x2e3f1d){fs['unlink'](_0x29667c);}});}}})[_0xe8d0('0x46')](function(_0x3cbc9f){if(_0x3cbc9f['message']===_0xe8d0('0x5e')){_0x555a56['status'](0x194)[_0xe8d0('0x2d')]('Not\x20found');}else{return handleError(_0x555a56,null);}});};exports[_0xe8d0('0x26')]=function(_0x17afc2,_0x29467d){return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')]({'where':{'id':_0x17afc2['params']['id']}})['then'](function(_0xd7d433){if(_['isNil'](_0xd7d433)){throw new ReferenceError(_0xe8d0('0x5f'));}return _0xd7d433;})[_0xe8d0('0x27')](function(_0xbbe457){var _0x95565d=path[_0xe8d0('0x54')](config[_0xe8d0('0x55')],_0xe8d0('0x56'),_0xbbe457[_0xe8d0('0x4f')]);logger[_0xe8d0('0x60')](_0xe8d0('0x61'),_0x95565d);if(!_[_0xe8d0('0x62')](_0xbbe457[_0xe8d0('0x4f')])&&fs[_0xe8d0('0x58')](_0x95565d)){logger[_0xe8d0('0x60')](_0xe8d0('0x63')+_0x95565d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe8d0('0x64')](_0x95565d);}_0x95565d=_0x95565d+_0xe8d0('0x65');if(!_[_0xe8d0('0x62')](_0xbbe457[_0xe8d0('0x4f')])&&fs[_0xe8d0('0x58')](_0x95565d)){logger['info'](_0xe8d0('0x63')+_0x95565d+_0xe8d0('0x66'));fs[_0xe8d0('0x64')](_0x95565d);}return _0xbbe457;})[_0xe8d0('0x27')](function(_0x360633){if(!_0x360633)throw new InternalError();return _0x360633[_0xe8d0('0x26')]();})[_0xe8d0('0x27')](function(){_0x29467d[_0xe8d0('0x1b')](0xcc)[_0xe8d0('0x28')]();})[_0xe8d0('0x46')](handleError(_0x29467d,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 730aa9f..83acf35 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 _0xc0ac=['../../config/environment','./screenRecording.attributes','define','screen_recordings','interactionid','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1dfad6,_0x215923){var _0x1dc3b3=function(_0x500fa2){while(--_0x500fa2){_0x1dfad6['push'](_0x1dfad6['shift']());}};_0x1dc3b3(++_0x215923);}(_0xc0ac,0x161));var _0xcc0a=function(_0xf560ed,_0x2090aa){_0xf560ed=_0xf560ed-0x0;var _0x937f3c=_0xc0ac[_0xf560ed];return _0x937f3c;};'use strict';var _=require(_0xcc0a('0x0'));var util=require(_0xcc0a('0x1'));var logger=require(_0xcc0a('0x2'))('api');var moment=require(_0xcc0a('0x3'));var BPromise=require(_0xcc0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc0a('0x5'));var rimraf=require(_0xcc0a('0x6'));var config=require(_0xcc0a('0x7'));var attributes=require(_0xcc0a('0x8'));module['exports']=function(_0x15877f,_0x1ae638){return _0x15877f[_0xcc0a('0x9')]('ScreenRecording',attributes,{'tableName':_0xcc0a('0xa'),'paranoid':![],'indexes':[{'name':_0xcc0a('0xb'),'fields':[_0xcc0a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c1e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash','api'];(function(_0x338164,_0x18d899){var _0x45832b=function(_0x53fc4c){while(--_0x53fc4c){_0x338164['push'](_0x338164['shift']());}};_0x45832b(++_0x18d899);}(_0x7c1e,0x177));var _0xe7c1=function(_0x46ab1c,_0x46e561){_0x46ab1c=_0x46ab1c-0x0;var _0x3fb929=_0x7c1e[_0x46ab1c];return _0x3fb929;};'use strict';var _=require(_0xe7c1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe7c1('0x1'));var moment=require(_0xe7c1('0x2'));var BPromise=require(_0xe7c1('0x3'));var rp=require(_0xe7c1('0x4'));var fs=require('fs');var path=require(_0xe7c1('0x5'));var rimraf=require(_0xe7c1('0x6'));var config=require(_0xe7c1('0x7'));var attributes=require(_0xe7c1('0x8'));module[_0xe7c1('0x9')]=function(_0x4a71a2,_0x1c9f1d){return _0x4a71a2[_0xe7c1('0xa')]('ScreenRecording',attributes,{'tableName':_0xe7c1('0xb'),'paranoid':![],'indexes':[{'name':_0xe7c1('0xc'),'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 626e00e..e6008cd 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 _0x7bbc=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x7bbc,0x1cf));var _0xc7bb=function(_0x53d2c9,_0x43ec2d){_0x53d2c9=_0x53d2c9-0x0;var _0x3e15f5=_0x7bbc[_0x53d2c9];return _0x3e15f5;};'use strict';var _=require(_0xc7bb('0x0'));var util=require(_0xc7bb('0x1'));var moment=require('moment');var BPromise=require(_0xc7bb('0x2'));var rs=require(_0xc7bb('0x3'));var fs=require('fs');var Redis=require(_0xc7bb('0x4'));var db=require(_0xc7bb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc7bb('0x6'));var client=jayson[_0xc7bb('0x7')][_0xc7bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22d1a1,_0x511bde,_0xf3e57c){return new BPromise(function(_0x38270c,_0x2428af){return client[_0xc7bb('0x9')](_0x22d1a1,_0xf3e57c)[_0xc7bb('0xa')](function(_0x3e5a93){logger[_0xc7bb('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x511bde,_0xc7bb('0xc'));logger['debug'](_0xc7bb('0xd'),_0x511bde,_0xc7bb('0xc'),JSON['stringify'](_0x3e5a93));if(_0x3e5a93[_0xc7bb('0xe')]){if(_0x3e5a93[_0xc7bb('0xe')][_0xc7bb('0xf')]===0x1f4){logger[_0xc7bb('0xe')](_0xc7bb('0x10'),_0x511bde,_0x3e5a93[_0xc7bb('0xe')][_0xc7bb('0x11')]);return _0x2428af(_0x3e5a93['error'][_0xc7bb('0x11')]);}logger['error'](_0xc7bb('0x10'),_0x511bde,_0x3e5a93[_0xc7bb('0xe')][_0xc7bb('0x11')]);return _0x38270c(_0x3e5a93[_0xc7bb('0xe')][_0xc7bb('0x11')]);}else{logger[_0xc7bb('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x511bde,_0xc7bb('0xc'));_0x38270c(_0x3e5a93[_0xc7bb('0x12')]['message']);}})[_0xc7bb('0x13')](function(_0x4bf5ca){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x511bde,_0x4bf5ca);_0x2428af(_0x4bf5ca);});});} \ No newline at end of file +var _0x99b9=['error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2cde51,_0x41b85c){var _0x37177e=function(_0x5a68f4){while(--_0x5a68f4){_0x2cde51['push'](_0x2cde51['shift']());}};_0x37177e(++_0x41b85c);}(_0x99b9,0x1d3));var _0x999b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x99b9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x999b('0x0'));var util=require('util');var moment=require(_0x999b('0x1'));var BPromise=require(_0x999b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x999b('0x3'));var db=require(_0x999b('0x4'))['db'];var utils=require(_0x999b('0x5'));var logger=require(_0x999b('0x6'))(_0x999b('0x7'));var config=require(_0x999b('0x8'));var jayson=require(_0x999b('0x9'));var client=jayson[_0x999b('0xa')][_0x999b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0ab6,_0xe3f327,_0xbbb29c){return new BPromise(function(_0x592052,_0x4658cf){return client['request'](_0x3b0ab6,_0xbbb29c)[_0x999b('0xc')](function(_0x4b65bc){logger['info'](_0x999b('0xd'),_0xe3f327,'request\x20sent');logger[_0x999b('0xe')](_0x999b('0xf'),_0xe3f327,_0x999b('0x10'),JSON['stringify'](_0x4b65bc));if(_0x4b65bc['error']){if(_0x4b65bc[_0x999b('0x11')][_0x999b('0x12')]===0x1f4){logger[_0x999b('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xe3f327,_0x4b65bc[_0x999b('0x11')][_0x999b('0x13')]);return _0x4658cf(_0x4b65bc[_0x999b('0x11')][_0x999b('0x13')]);}logger['error'](_0x999b('0xd'),_0xe3f327,_0x4b65bc[_0x999b('0x11')][_0x999b('0x13')]);return _0x592052(_0x4b65bc[_0x999b('0x11')][_0x999b('0x13')]);}else{logger['info'](_0x999b('0xd'),_0xe3f327,_0x999b('0x10'));_0x592052(_0x4b65bc[_0x999b('0x14')][_0x999b('0x13')]);}})[_0x999b('0x15')](function(_0x414f9d){logger[_0x999b('0x11')](_0x999b('0xd'),_0xe3f327,_0x414f9d);_0x4658cf(_0x414f9d);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index a4888d4..1d4a1e1 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 _0x56d9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','show','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','extname','post','/:id/logo','single','file','addLogo','root','logologin','originalname','addLogoLogin','addPreferred','favicon','addFavicon','/:id','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x2549c9,_0x2832ec){var _0x5b2550=function(_0x25f2ca){while(--_0x25f2ca){_0x2549c9['push'](_0x2549c9['shift']());}};_0x5b2550(++_0x2832ec);}(_0x56d9,0x79));var _0x956d=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x56d9[_0x1bf809];return _0x1caa4e;};'use strict';var multer=require(_0x956d('0x0'));var util=require(_0x956d('0x1'));var path=require('path');var timeout=require(_0x956d('0x2'));var express=require('express');var router=express[_0x956d('0x3')]();var fs_extra=require(_0x956d('0x4'));var auth=require(_0x956d('0x5'));var interaction=require(_0x956d('0x6'));var config=require(_0x956d('0x7'));var controller=require(_0x956d('0x8'));router[_0x956d('0x9')]('/',auth[_0x956d('0xa')](),controller[_0x956d('0xb')]);router[_0x956d('0x9')](_0x956d('0xc'),controller['getDate']);router[_0x956d('0x9')]('/:id',controller[_0x956d('0xd')]);router[_0x956d('0x9')]('/:id/logo',controller[_0x956d('0xe')]);router[_0x956d('0x9')](_0x956d('0xf'),controller['getLogoLogin']);router[_0x956d('0x9')](_0x956d('0x10'),controller[_0x956d('0x11')]);router[_0x956d('0x9')](_0x956d('0x12'),controller[_0x956d('0x13')]);router[_0x956d('0x9')](_0x956d('0x14'),controller[_0x956d('0x15')]);var upload=multer({'storage':multer[_0x956d('0x16')]({'destination':function(_0x4f4354,_0x1c0601,_0x3d28da){_0x3d28da(null,path[_0x956d('0x17')](config['root'],_0x956d('0x18')));},'filename':function(_0x435015,_0x175965,_0x34bf79){_0x34bf79(null,util[_0x956d('0x19')](_0x956d('0x1a'),'logo',path[_0x956d('0x1b')](_0x175965['originalname'])));}})});router[_0x956d('0x1c')](_0x956d('0x1d'),upload[_0x956d('0x1e')](_0x956d('0x1f')),controller[_0x956d('0x20')]);var upload=multer({'storage':multer[_0x956d('0x16')]({'destination':function(_0x14871e,_0x207631,_0x395654){_0x395654(null,path[_0x956d('0x17')](config[_0x956d('0x21')],'server/files/images/logos/'));},'filename':function(_0x136717,_0x4a13f4,_0x33297a){_0x33297a(null,util['format']('%s%s',_0x956d('0x22'),path[_0x956d('0x1b')](_0x4a13f4[_0x956d('0x23')])));}})});router['post']('/:id/logo_login',upload['single'](_0x956d('0x1f')),controller[_0x956d('0x24')]);var upload=multer({'storage':multer[_0x956d('0x16')]({'destination':function(_0x39c4b2,_0x3b0f22,_0x1c56a8){_0x1c56a8(null,path[_0x956d('0x17')](config[_0x956d('0x21')],_0x956d('0x18')));},'filename':function(_0x5a991d,_0x49fcf0,_0x4f541c){_0x4f541c(null,util['format']('%s%s','preferred',path[_0x956d('0x1b')](_0x49fcf0['originalname'])));}})});router[_0x956d('0x1c')](_0x956d('0x12'),upload['single'](_0x956d('0x1f')),controller[_0x956d('0x25')]);var upload=multer({'storage':multer[_0x956d('0x16')]({'destination':function(_0x53b21b,_0x367eb3,_0x50f15c){_0x50f15c(null,path['join'](config[_0x956d('0x21')],_0x956d('0x18')));},'filename':function(_0x590434,_0x1bac82,_0x44cbc4){_0x44cbc4(null,util['format'](_0x956d('0x1a'),_0x956d('0x26'),path[_0x956d('0x1b')](_0x1bac82[_0x956d('0x23')])));}})});router[_0x956d('0x1c')](_0x956d('0x14'),upload[_0x956d('0x1e')](_0x956d('0x1f')),controller[_0x956d('0x27')]);router['put'](_0x956d('0x28'),auth['isAuthenticated'](),controller['update']);module[_0x956d('0x29')]=router; \ No newline at end of file +var _0xcd92=['/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','diskStorage','join','server/files/images/logos/','format','logo','extname','post','file','root','%s%s','logologin','single','addLogoLogin','preferred','originalname','addPreferred','favicon','addFavicon','isAuthenticated','update','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./setting.controller','get','/now','getDate','/:id','show','/:id/logo','getLogo'];(function(_0x472833,_0x238091){var _0x579fbc=function(_0x4ecd5e){while(--_0x4ecd5e){_0x472833['push'](_0x472833['shift']());}};_0x579fbc(++_0x238091);}(_0xcd92,0x92));var _0x2cd9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xcd92[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2cd9('0x0'));var timeout=require(_0x2cd9('0x1'));var express=require(_0x2cd9('0x2'));var router=express[_0x2cd9('0x3')]();var fs_extra=require(_0x2cd9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2cd9('0x5'));var controller=require(_0x2cd9('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2cd9('0x7')](_0x2cd9('0x8'),controller[_0x2cd9('0x9')]);router[_0x2cd9('0x7')](_0x2cd9('0xa'),controller[_0x2cd9('0xb')]);router[_0x2cd9('0x7')](_0x2cd9('0xc'),controller[_0x2cd9('0xd')]);router[_0x2cd9('0x7')](_0x2cd9('0xe'),controller[_0x2cd9('0xf')]);router[_0x2cd9('0x7')](_0x2cd9('0x10'),controller['gdpr']);router[_0x2cd9('0x7')](_0x2cd9('0x11'),controller['getPreferred']);router['get'](_0x2cd9('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x2cd9('0x13')]({'destination':function(_0x554958,_0x284fe,_0x5697c1){_0x5697c1(null,path[_0x2cd9('0x14')](config['root'],_0x2cd9('0x15')));},'filename':function(_0x189329,_0x49c054,_0x4e1a4f){_0x4e1a4f(null,util[_0x2cd9('0x16')]('%s%s',_0x2cd9('0x17'),path[_0x2cd9('0x18')](_0x49c054['originalname'])));}})});router[_0x2cd9('0x19')](_0x2cd9('0xc'),upload['single'](_0x2cd9('0x1a')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3cb59f,_0x58a8f6,_0x19c3ac){_0x19c3ac(null,path[_0x2cd9('0x14')](config[_0x2cd9('0x1b')],'server/files/images/logos/'));},'filename':function(_0xebed7f,_0x445841,_0x2a9db0){_0x2a9db0(null,util[_0x2cd9('0x16')](_0x2cd9('0x1c'),_0x2cd9('0x1d'),path['extname'](_0x445841['originalname'])));}})});router['post'](_0x2cd9('0xe'),upload[_0x2cd9('0x1e')]('file'),controller[_0x2cd9('0x1f')]);var upload=multer({'storage':multer[_0x2cd9('0x13')]({'destination':function(_0x1d4d27,_0x354c8d,_0x1d2f2b){_0x1d2f2b(null,path[_0x2cd9('0x14')](config[_0x2cd9('0x1b')],_0x2cd9('0x15')));},'filename':function(_0x4d53c9,_0x1e2a2b,_0x3ce1e0){_0x3ce1e0(null,util[_0x2cd9('0x16')](_0x2cd9('0x1c'),_0x2cd9('0x20'),path[_0x2cd9('0x18')](_0x1e2a2b[_0x2cd9('0x21')])));}})});router[_0x2cd9('0x19')](_0x2cd9('0x11'),upload[_0x2cd9('0x1e')](_0x2cd9('0x1a')),controller[_0x2cd9('0x22')]);var upload=multer({'storage':multer[_0x2cd9('0x13')]({'destination':function(_0x493d6b,_0x1c3898,_0x38d9b1){_0x38d9b1(null,path[_0x2cd9('0x14')](config[_0x2cd9('0x1b')],_0x2cd9('0x15')));},'filename':function(_0xe7114e,_0x1f19bf,_0x33d759){_0x33d759(null,util['format'](_0x2cd9('0x1c'),_0x2cd9('0x23'),path[_0x2cd9('0x18')](_0x1f19bf[_0x2cd9('0x21')])));}})});router[_0x2cd9('0x19')](_0x2cd9('0x12'),upload['single'](_0x2cd9('0x1a')),controller[_0x2cd9('0x24')]);router['put'](_0x2cd9('0xa'),auth[_0x2cd9('0x25')](),controller[_0x2cd9('0x26')]);module[_0x2cd9('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 133cbcb..f5ca36e 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4bf03d,_0x125a6c){var _0x39ae54=function(_0x54b631){while(--_0x54b631){_0x4bf03d['push'](_0x4bf03d['shift']());}};_0x39ae54(++_0x125a6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x142eab,_0x3ee95e){var _0x3829aa=function(_0x508386){while(--_0x508386){_0x142eab['push'](_0x142eab['shift']());}};_0x3829aa(++_0x3ee95e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index bb0941e..2b1c371 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 _0x581a=['find','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','join','root','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','server/files/images/logos','getFavicon','default_favicon.ico','Sequelize','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','name','index','Setting','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','body'];(function(_0x949780,_0x184b92){var _0x1a1d06=function(_0x29b316){while(--_0x29b316){_0x949780['push'](_0x949780['shift']());}};_0x1a1d06(++_0x184b92);}(_0x581a,0x127));var _0xa581=function(_0x482071,_0x5541d0){_0x482071=_0x482071-0x0;var _0x160d10=_0x581a[_0x482071];return _0x160d10;};'use strict';var emlformat=require(_0xa581('0x0'));var rimraf=require(_0xa581('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa581('0x2'));var rp=require(_0xa581('0x3'));var moment=require(_0xa581('0x4'));var BPromise=require(_0xa581('0x5'));var Mustache=require(_0xa581('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa581('0x7'));var csv=require('to-csv');var ejs=require(_0xa581('0x8'));var fs=require('fs');var fs_extra=require(_0xa581('0x9'));var _=require(_0xa581('0xa'));var squel=require(_0xa581('0xb'));var crypto=require(_0xa581('0xc'));var jsforce=require(_0xa581('0xd'));var deskjs=require(_0xa581('0xe'));var toCsv=require(_0xa581('0xf'));var querystring=require(_0xa581('0x10'));var Papa=require(_0xa581('0x11'));var Redis=require(_0xa581('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa581('0x13'));var as=require(_0xa581('0x14'));var hardwareService=require(_0xa581('0x15'));var logger=require(_0xa581('0x16'))(_0xa581('0x17'));var utils=require(_0xa581('0x18'));var config=require(_0xa581('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa581('0x1a'))['db'];var jayson=require(_0xa581('0x1b'));var client=jayson[_0xa581('0x1c')][_0xa581('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x202296,_0x5690b5,_0x38e03d,_0x16d285){return new BPromise(function(_0x23b205,_0x3ba90d){var _0x499c08=_0x16d285||client;return _0x499c08['request'](_0x202296,_0x38e03d)[_0xa581('0x1e')](function(_0x27bf02){logger[_0xa581('0x1f')](_0xa581('0x20'),_0x5690b5,_0xa581('0x21'));logger['debug'](_0xa581('0x22'),_0x5690b5,_0xa581('0x21'),JSON[_0xa581('0x23')](_0x27bf02));if(_0x27bf02[_0xa581('0x24')]){if(_0x27bf02[_0xa581('0x24')][_0xa581('0x25')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x5690b5,_0x27bf02[_0xa581('0x24')][_0xa581('0x26')]);return _0x3ba90d(_0x27bf02[_0xa581('0x24')]['message']);}logger[_0xa581('0x24')](_0xa581('0x20'),_0x5690b5,_0x27bf02[_0xa581('0x24')][_0xa581('0x26')]);return _0x23b205(_0x27bf02[_0xa581('0x24')][_0xa581('0x26')]);}else{logger[_0xa581('0x1f')](_0xa581('0x20'),_0x5690b5,_0xa581('0x21'));_0x23b205(_0x27bf02[_0xa581('0x27')][_0xa581('0x26')]);}})[_0xa581('0x28')](function(_0x231ce2){logger['error'](_0xa581('0x20'),_0x5690b5,_0x231ce2);_0x3ba90d(_0x231ce2);});});}function respondWithStatusCode(_0x44fa06,_0x32bdaa){_0x32bdaa=_0x32bdaa||0xcc;return function(_0x1f05b1){if(_0x1f05b1){return _0x44fa06[_0xa581('0x29')](_0x32bdaa);}return _0x44fa06[_0xa581('0x2a')](_0x32bdaa)[_0xa581('0x2b')]();};}function respondWithResult(_0x2207b7,_0x1c1f5f){_0x1c1f5f=_0x1c1f5f||0xc8;return function(_0x5c15fe){if(_0x5c15fe){return _0x2207b7[_0xa581('0x2a')](_0x1c1f5f)[_0xa581('0x2c')](_0x5c15fe);}};}function respondWithFilteredResult(_0x2887ba,_0x31e377){return function(_0x36ba28){if(_0x36ba28){var _0x1f52ec=typeof _0x31e377['offset']===_0xa581('0x2d')&&typeof _0x31e377[_0xa581('0x2e')]===_0xa581('0x2d');var _0x501574=_0x36ba28[_0xa581('0x2f')];var _0x1d585b=_0x1f52ec?0x0:_0x31e377[_0xa581('0x30')];var _0x213eb5=_0x1f52ec?_0x36ba28[_0xa581('0x2f')]:_0x31e377['offset']+_0x31e377[_0xa581('0x2e')];var _0x590a36;if(_0x213eb5>=_0x501574){_0x213eb5=_0x501574;_0x590a36=0xc8;}else{_0x590a36=0xce;}_0x2887ba[_0xa581('0x2a')](_0x590a36);return _0x2887ba['set'](_0xa581('0x31'),_0x1d585b+'-'+_0x213eb5+'/'+_0x501574)[_0xa581('0x2c')](_0x36ba28);}return null;};}function patchUpdates(_0x209946){return function(_0x329b2e){try{jsonpatch['apply'](_0x329b2e,_0x209946,!![]);}catch(_0x2f3cab){return BPromise[_0xa581('0x32')](_0x2f3cab);}return _0x329b2e[_0xa581('0x33')]();};}function saveUpdates(_0x5e047a,_0x3b9653){return function(_0x2aa743){if(_0x2aa743){return _0x2aa743[_0xa581('0x34')](_0x5e047a)[_0xa581('0x1e')](function(_0x3aecc6){return _0x3aecc6;});}return null;};}function removeEntity(_0x53d17a,_0x24ec46){return function(_0xb8f4c1){if(_0xb8f4c1){return _0xb8f4c1[_0xa581('0x35')]()[_0xa581('0x1e')](function(){_0x53d17a[_0xa581('0x2a')](0xcc)[_0xa581('0x2b')]();});}};}function handleEntityNotFound(_0x2831f4,_0x3b77b1){return function(_0x11109f){if(!_0x11109f){_0x2831f4['sendStatus'](0x194);}return _0x11109f;};}function handleError(_0x6a8894,_0xbc51d7){_0xbc51d7=_0xbc51d7||0x1f4;return function(_0x21996d){logger['error'](_0x21996d['stack']);if(_0x21996d[_0xa581('0x36')]){delete _0x21996d[_0xa581('0x36')];}_0x6a8894['status'](_0xbc51d7)['send'](_0x21996d);};}exports[_0xa581('0x37')]=function(_0x989283,_0x5b1ec3){var _0x3ceb12={},_0x31d2d9={},_0xc4359a={'count':0x0,'rows':[]};var _0x478d58=_['map'](db[_0xa581('0x38')][_0xa581('0x39')],function(_0x229218){return{'name':_0x229218[_0xa581('0x3a')],'type':_0x229218[_0xa581('0x3b')][_0xa581('0x3c')]};});_0x31d2d9[_0xa581('0x3d')]=_[_0xa581('0x3e')](_0x478d58,_0xa581('0x36'));_0x31d2d9[_0xa581('0x3f')]=_[_0xa581('0x40')](_0x989283[_0xa581('0x3f')]);_0x31d2d9['filters']=_[_0xa581('0x41')](_0x31d2d9[_0xa581('0x3d')],_0x31d2d9[_0xa581('0x3f')]);_0x3ceb12[_0xa581('0x42')]=_[_0xa581('0x41')](_0x31d2d9['model'],qs[_0xa581('0x43')](_0x989283[_0xa581('0x3f')][_0xa581('0x43')]));_0x3ceb12[_0xa581('0x42')]=_0x3ceb12[_0xa581('0x42')][_0xa581('0x44')]?_0x3ceb12['attributes']:_0x31d2d9[_0xa581('0x3d')];if(!_0x989283['query'][_0xa581('0x45')]('nolimit')){_0x3ceb12['limit']=qs[_0xa581('0x2e')](_0x989283[_0xa581('0x3f')][_0xa581('0x2e')]);_0x3ceb12[_0xa581('0x30')]=qs['offset'](_0x989283['query']['offset']);}_0x3ceb12[_0xa581('0x46')]=qs[_0xa581('0x47')](_0x989283['query'][_0xa581('0x47')]);_0x3ceb12[_0xa581('0x48')]=qs[_0xa581('0x49')](_[_0xa581('0x4a')](_0x989283['query'],_0x31d2d9[_0xa581('0x49')]),_0x478d58);if(_0x989283[_0xa581('0x3f')][_0xa581('0x4b')]){_0x3ceb12[_0xa581('0x48')]=_[_0xa581('0x4c')](_0x3ceb12['where'],{'$or':_[_0xa581('0x3e')](_0x478d58,function(_0x443083){if(_0x443083[_0xa581('0x3b')]!==_0xa581('0x4d')){var _0x58a341={};_0x58a341[_0x443083['name']]={'$like':'%'+_0x989283[_0xa581('0x3f')]['filter']+'%'};return _0x58a341;}})});}_0x3ceb12=_[_0xa581('0x4c')]({},_0x3ceb12,_0x989283['options']);var _0x49f105={'where':_0x3ceb12[_0xa581('0x48')]};return db[_0xa581('0x38')][_0xa581('0x2f')](_0x49f105)[_0xa581('0x1e')](function(_0x5c46c5){_0xc4359a['count']=_0x5c46c5;if(_0x989283[_0xa581('0x3f')][_0xa581('0x4e')]){_0x3ceb12[_0xa581('0x4f')]=[{'all':!![]}];}return db[_0xa581('0x38')][_0xa581('0x50')](_0x3ceb12);})[_0xa581('0x1e')](function(_0x101d52){_0xc4359a[_0xa581('0x51')]=_0x101d52;return _0xc4359a;})['then'](respondWithFilteredResult(_0x5b1ec3,_0x3ceb12))[_0xa581('0x28')](handleError(_0x5b1ec3,null));};exports[_0xa581('0x52')]=function(_0x5d8f4e,_0x3ffe9e){var _0x2de03a={'raw':![],'where':{'id':_0x5d8f4e[_0xa581('0x53')]['id']}},_0x4940b7={};_0x4940b7[_0xa581('0x3d')]=_['keys'](db[_0xa581('0x38')]['rawAttributes']);_0x4940b7[_0xa581('0x3f')]=_[_0xa581('0x40')](_0x5d8f4e[_0xa581('0x3f')]);_0x4940b7[_0xa581('0x49')]=_[_0xa581('0x41')](_0x4940b7[_0xa581('0x3d')],_0x4940b7[_0xa581('0x3f')]);_0x2de03a['attributes']=_[_0xa581('0x41')](_0x4940b7[_0xa581('0x3d')],qs['fields'](_0x5d8f4e[_0xa581('0x3f')]['fields']));_0x2de03a[_0xa581('0x42')]=_0x2de03a[_0xa581('0x42')][_0xa581('0x44')]?_0x2de03a[_0xa581('0x42')]:_0x4940b7[_0xa581('0x3d')];if(_0x5d8f4e[_0xa581('0x3f')][_0xa581('0x4e')]){_0x2de03a['include']=[{'all':!![]}];}_0x2de03a=_[_0xa581('0x4c')]({},_0x2de03a,_0x5d8f4e[_0xa581('0x54')]);return db[_0xa581('0x38')]['find'](_0x2de03a)[_0xa581('0x1e')](handleEntityNotFound(_0x3ffe9e,null))[_0xa581('0x1e')](respondWithResult(_0x3ffe9e,null))[_0xa581('0x28')](handleError(_0x3ffe9e,null));};exports[_0xa581('0x34')]=function(_0x400e3e,_0x2b9175){if(_0x400e3e[_0xa581('0x55')]['id']){delete _0x400e3e['body']['id'];}return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x400e3e[_0xa581('0x53')]['id']}})[_0xa581('0x1e')](handleEntityNotFound(_0x2b9175,null))[_0xa581('0x1e')](saveUpdates(_0x400e3e[_0xa581('0x55')],null))[_0xa581('0x1e')](respondWithResult(_0x2b9175,null))[_0xa581('0x28')](handleError(_0x2b9175,null));};exports[_0xa581('0x57')]=function(_0x2c18bc,_0x2caab9,_0x4eae17){if(_0x2c18bc[_0xa581('0x58')]&&_0x2c18bc[_0xa581('0x58')][_0xa581('0x59')]){_0x2c18bc[_0xa581('0x55')]['logo']=_0x2c18bc[_0xa581('0x58')]['filename'];}return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x2c18bc[_0xa581('0x53')]['id']}})[_0xa581('0x1e')](handleEntityNotFound(_0x2caab9,null))[_0xa581('0x1e')](saveUpdates(_0x2c18bc[_0xa581('0x55')],null))[_0xa581('0x1e')](respondWithResult(_0x2caab9,null))[_0xa581('0x28')](handleError(_0x2caab9,null));};exports[_0xa581('0x5a')]=function(_0x5f0aee,_0x3a6d74,_0x3a689c){if(_0x5f0aee[_0xa581('0x58')]&&_0x5f0aee[_0xa581('0x58')][_0xa581('0x59')]){_0x5f0aee[_0xa581('0x55')][_0xa581('0x5b')]=_0x5f0aee['file'][_0xa581('0x59')];}return db['Setting'][_0xa581('0x56')]({'where':{'id':_0x5f0aee[_0xa581('0x53')]['id']}})[_0xa581('0x1e')](handleEntityNotFound(_0x3a6d74,null))[_0xa581('0x1e')](saveUpdates(_0x5f0aee[_0xa581('0x55')],null))[_0xa581('0x1e')](respondWithResult(_0x3a6d74,null))[_0xa581('0x28')](handleError(_0x3a6d74,null));};var utilLicense=require(_0xa581('0x5c'));exports[_0xa581('0x5d')]=function(_0x10db93,_0x43d57d,_0xffdd76){var _0x9adf21='server/files/images/logos';var _0x3fe7d2={'custom':![]};return utilLicense[_0xa581('0x5e')]()[_0xa581('0x1e')](function(_0x5f1475){if(_0x5f1475){_0x3fe7d2=_0x5f1475;}return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x10db93['params']['id']},'attributes':[_0xa581('0x5f'),_0xa581('0x5b'),_0xa581('0x60'),_0xa581('0x61'),_0xa581('0x62'),_0xa581('0x63'),_0xa581('0x64'),_0xa581('0x65')],'raw':!![]});})[_0xa581('0x1e')](handleEntityNotFound(_0x43d57d,null))[_0xa581('0x1e')](function(_0x22c0eb){if(_0x22c0eb){var _0x5a3b50=_0x22c0eb[_0xa581('0x5f')]&&fs[_0xa581('0x66')](path['join'](config['root'],_0x9adf21,_[_0xa581('0x67')](_0x22c0eb[_0xa581('0x5f')])))?path['join'](config['root'],_0x9adf21,_[_0xa581('0x67')](_0x22c0eb[_0xa581('0x5f')])):path[_0xa581('0x68')](config[_0xa581('0x69')],_0x9adf21,_[_0xa581('0x67')](_0xa581('0x6a')));var _0xeb2c57=_0xa581('0x6b')+_[_0xa581('0x6c')](_0xa581('0x5f'));if(_0x22c0eb[_0xeb2c57]||!_0x3fe7d2[_0xa581('0x6d')]){_0x5a3b50=path[_0xa581('0x68')](config[_0xa581('0x69')],_0x9adf21,_[_0xa581('0x67')](_0xa581('0x6a')));}if(!fs[_0xa581('0x66')](_0x5a3b50)){throw new db['Sequelize'][(_0xa581('0x6e'))](_[_0xa581('0x6c')](_0xa581('0x5f'))+_0xa581('0x6f'));}return _0x43d57d[_0xa581('0x70')](_0x5a3b50);}})[_0xa581('0x28')](handleError(_0x43d57d,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x1ab319,_0xb8befb,_0x56df81){var _0x1a4932='server/files/images/logos';var _0x99b897={'custom':![]};return utilLicense[_0xa581('0x5e')]()[_0xa581('0x1e')](function(_0x33cc02){if(_0x33cc02){_0x99b897=_0x33cc02;}return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x1ab319[_0xa581('0x53')]['id']},'attributes':[_0xa581('0x5f'),_0xa581('0x5b'),_0xa581('0x60'),_0xa581('0x61'),_0xa581('0x62'),_0xa581('0x63'),_0xa581('0x64'),_0xa581('0x65')],'raw':!![]});})[_0xa581('0x1e')](handleEntityNotFound(_0xb8befb,null))['then'](function(_0x1fa56){if(_0x1fa56){var _0x88bb11=_0x1fa56['loginLogo']&&fs[_0xa581('0x66')](path[_0xa581('0x68')](config[_0xa581('0x69')],_0x1a4932,_[_0xa581('0x67')](_0x1fa56[_0xa581('0x5b')])))?path[_0xa581('0x68')](config[_0xa581('0x69')],_0x1a4932,_['toLower'](_0x1fa56[_0xa581('0x5b')])):path['join'](config[_0xa581('0x69')],_0x1a4932,_[_0xa581('0x67')](_0xa581('0x71')));var _0x119955=_0xa581('0x6b')+_['upperFirst'](_0xa581('0x5b'));if(_0x1fa56[_0x119955]||!_0x99b897['custom']){_0x88bb11=path[_0xa581('0x68')](config[_0xa581('0x69')],_0x1a4932,_[_0xa581('0x67')](_0xa581('0x71')));}if(!fs['existsSync'](_0x88bb11)){throw new db['Sequelize']['ValidationError'](_[_0xa581('0x6c')](_0xa581('0x5b'))+_0xa581('0x6f'));}return _0xb8befb['download'](_0x88bb11);}})['catch'](handleError(_0xb8befb,null));};exports[_0xa581('0x72')]=function(_0x242ba4,_0x24d87d){return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x242ba4['params']['id']},'attributes':[_0xa581('0x73')]})['then'](respondWithResult(_0x24d87d,null))[_0xa581('0x28')](handleError(_0x24d87d,null));};exports[_0xa581('0x74')]=function(_0x1d18e6,_0x200c64,_0x16a72f){if(_0x1d18e6[_0xa581('0x58')]&&_0x1d18e6['file']['filename']){_0x1d18e6['body'][_0xa581('0x60')]=_0x1d18e6[_0xa581('0x58')][_0xa581('0x59')];}return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x1d18e6['params']['id']}})['then'](handleEntityNotFound(_0x200c64,null))[_0xa581('0x1e')](saveUpdates(_0x1d18e6['body'],null))[_0xa581('0x1e')](respondWithResult(_0x200c64,null))[_0xa581('0x28')](handleError(_0x200c64,null));};var utilLicense=require('../../config/license/util');exports[_0xa581('0x75')]=function(_0x5e1a38,_0x3ef9d3,_0x3db50e){var _0x4f46a1=_0xa581('0x76');var _0xce673c={'custom':![]};return utilLicense[_0xa581('0x5e')]()['then'](function(_0x227257){if(_0x227257){_0xce673c=_0x227257;}return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x5e1a38[_0xa581('0x53')]['id']},'attributes':['logo',_0xa581('0x5b'),'preferred',_0xa581('0x61'),'defaultLogo',_0xa581('0x63'),_0xa581('0x64'),_0xa581('0x65')],'raw':!![]});})[_0xa581('0x1e')](handleEntityNotFound(_0x3ef9d3,null))['then'](function(_0x452543){if(_0x452543){var _0x363bea=_0x452543[_0xa581('0x60')]&&fs[_0xa581('0x66')](path['join'](config[_0xa581('0x69')],_0x4f46a1,_[_0xa581('0x67')](_0x452543['preferred'])))?path['join'](config[_0xa581('0x69')],_0x4f46a1,_['toLower'](_0x452543[_0xa581('0x60')])):path[_0xa581('0x68')](config[_0xa581('0x69')],_0x4f46a1,_[_0xa581('0x67')]('default_preferred.png'));var _0x77be35=_0xa581('0x6b')+_[_0xa581('0x6c')](_0xa581('0x60'));if(_0x452543[_0x77be35]||!_0xce673c[_0xa581('0x6d')]||!_0xce673c[_0xa581('0x60')]){_0x363bea=path[_0xa581('0x68')](config[_0xa581('0x69')],_0x4f46a1,_[_0xa581('0x67')]('default_preferred.png'));}if(!fs[_0xa581('0x66')](_0x363bea)){throw new db['Sequelize'][(_0xa581('0x6e'))](_[_0xa581('0x6c')]('preferred')+_0xa581('0x6f'));}return _0x3ef9d3[_0xa581('0x70')](_0x363bea);}})[_0xa581('0x28')](handleError(_0x3ef9d3,null));};exports['addFavicon']=function(_0x10a8d1,_0x269d6b,_0x4ac9c9){if(_0x10a8d1[_0xa581('0x58')]&&_0x10a8d1[_0xa581('0x58')][_0xa581('0x59')]){_0x10a8d1[_0xa581('0x55')][_0xa581('0x61')]=_0x10a8d1[_0xa581('0x58')][_0xa581('0x59')];}return db[_0xa581('0x38')][_0xa581('0x56')]({'where':{'id':_0x10a8d1[_0xa581('0x53')]['id']}})[_0xa581('0x1e')](handleEntityNotFound(_0x269d6b,null))[_0xa581('0x1e')](saveUpdates(_0x10a8d1[_0xa581('0x55')],null))[_0xa581('0x1e')](respondWithResult(_0x269d6b,null))['catch'](handleError(_0x269d6b,null));};var utilLicense=require('../../config/license/util');exports[_0xa581('0x77')]=function(_0x263d68,_0x42aa68,_0x245520){var _0x246a04='server/files/images/logos';var _0x584703={'custom':![]};return utilLicense[_0xa581('0x5e')]()[_0xa581('0x1e')](function(_0xa3d8f){if(_0xa3d8f){_0x584703=_0xa3d8f;}return db[_0xa581('0x38')]['find']({'where':{'id':_0x263d68[_0xa581('0x53')]['id']},'attributes':[_0xa581('0x5f'),_0xa581('0x5b'),_0xa581('0x60'),_0xa581('0x61'),'defaultLogo','defaultLoginLogo',_0xa581('0x64'),'defaultFavicon'],'raw':!![]});})[_0xa581('0x1e')](handleEntityNotFound(_0x42aa68,null))[_0xa581('0x1e')](function(_0x37c035){if(_0x37c035){var _0x231ebc=_0x37c035[_0xa581('0x61')]&&fs[_0xa581('0x66')](path[_0xa581('0x68')](config['root'],_0x246a04,_[_0xa581('0x67')](_0x37c035[_0xa581('0x61')])))?path[_0xa581('0x68')](config[_0xa581('0x69')],_0x246a04,_[_0xa581('0x67')](_0x37c035['favicon'])):path[_0xa581('0x68')](config[_0xa581('0x69')],_0x246a04,_['toLower']('default_favicon.ico'));var _0x58f27c='default'+_[_0xa581('0x6c')]('favicon');if(_0x37c035[_0x58f27c]||!_0x584703['custom']){_0x231ebc=path['join'](config['root'],_0x246a04,_[_0xa581('0x67')](_0xa581('0x78')));}if(!fs[_0xa581('0x66')](_0x231ebc)){throw new db[(_0xa581('0x79'))]['ValidationError'](_[_0xa581('0x6c')](_0xa581('0x61'))+_0xa581('0x6f'));}return _0x42aa68[_0xa581('0x70')](_0x231ebc);}})[_0xa581('0x28')](handleError(_0x42aa68,null));};exports[_0xa581('0x7a')]=function(_0x5af2b2,_0x463525){var _0x3e82ae={'offset':moment()[_0xa581('0x7b')]()};_0x3e82ae['now']=moment()['utcOffset'](_0x3e82ae[_0xa581('0x30')])[_0xa581('0x7c')](_0xa581('0x7d'));return _0x463525[_0xa581('0x2a')](0xc8)[_0xa581('0x7e')](_0x3e82ae);}; \ No newline at end of file +var _0xf6a9=['default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','getLogoLogin','defaultPreferred','default_loginLogo.svg','download','gdpr','securePassword','getPreferred','default_preferred.png','\x20not\x20found','default_favicon.ico','getDate','utcOffset','now','format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','end','stack','send','index','map','Setting','rawAttributes','type','key','name','keys','query','filters','intersection','model','fields','attributes','length','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','update','body','addLogo','file','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join'];(function(_0x1cd32e,_0x3c9e65){var _0xe42286=function(_0x3e1e44){while(--_0x3e1e44){_0x1cd32e['push'](_0x1cd32e['shift']());}};_0xe42286(++_0x3c9e65);}(_0xf6a9,0x176));var _0x9f6a=function(_0x48604d,_0xdac795){_0x48604d=_0x48604d-0x0;var _0x10a5e7=_0xf6a9[_0x48604d];return _0x10a5e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9f6a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f6a('0x1'));var moment=require(_0x9f6a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9f6a('0x3'));var util=require(_0x9f6a('0x4'));var path=require(_0x9f6a('0x5'));var sox=require(_0x9f6a('0x6'));var csv=require(_0x9f6a('0x7'));var ejs=require(_0x9f6a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f6a('0x9'));var squel=require(_0x9f6a('0xa'));var crypto=require(_0x9f6a('0xb'));var jsforce=require(_0x9f6a('0xc'));var deskjs=require(_0x9f6a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f6a('0xe'));var Redis=require(_0x9f6a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9f6a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f6a('0x11'))(_0x9f6a('0x12'));var utils=require('../../config/utils');var config=require(_0x9f6a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f6a('0x14'))['db'];var jayson=require(_0x9f6a('0x15'));var client=jayson[_0x9f6a('0x16')][_0x9f6a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x289b1b,_0x2ab9e1,_0x4cb805,_0x18f560){return new BPromise(function(_0x15dda2,_0x193fc2){var _0x5f4be8=_0x18f560||client;return _0x5f4be8['request'](_0x289b1b,_0x4cb805)[_0x9f6a('0x18')](function(_0x2d193f){logger['info'](_0x9f6a('0x19'),_0x2ab9e1,_0x9f6a('0x1a'));logger[_0x9f6a('0x1b')](_0x9f6a('0x1c'),_0x2ab9e1,_0x9f6a('0x1a'),JSON[_0x9f6a('0x1d')](_0x2d193f));if(_0x2d193f[_0x9f6a('0x1e')]){if(_0x2d193f[_0x9f6a('0x1e')][_0x9f6a('0x1f')]===0x1f4){logger[_0x9f6a('0x1e')](_0x9f6a('0x19'),_0x2ab9e1,_0x2d193f[_0x9f6a('0x1e')][_0x9f6a('0x20')]);return _0x193fc2(_0x2d193f[_0x9f6a('0x1e')][_0x9f6a('0x20')]);}logger[_0x9f6a('0x1e')](_0x9f6a('0x19'),_0x2ab9e1,_0x2d193f[_0x9f6a('0x1e')][_0x9f6a('0x20')]);return _0x15dda2(_0x2d193f[_0x9f6a('0x1e')]['message']);}else{logger[_0x9f6a('0x21')](_0x9f6a('0x19'),_0x2ab9e1,_0x9f6a('0x1a'));_0x15dda2(_0x2d193f[_0x9f6a('0x22')]['message']);}})[_0x9f6a('0x23')](function(_0xf00706){logger[_0x9f6a('0x1e')](_0x9f6a('0x19'),_0x2ab9e1,_0xf00706);_0x193fc2(_0xf00706);});});}function respondWithStatusCode(_0x4ac7e8,_0x7a5ef){_0x7a5ef=_0x7a5ef||0xcc;return function(_0x3d4fb3){if(_0x3d4fb3){return _0x4ac7e8[_0x9f6a('0x24')](_0x7a5ef);}return _0x4ac7e8[_0x9f6a('0x25')](_0x7a5ef)['end']();};}function respondWithResult(_0x55eff8,_0x2716ee){_0x2716ee=_0x2716ee||0xc8;return function(_0x3c9fb1){if(_0x3c9fb1){return _0x55eff8[_0x9f6a('0x25')](_0x2716ee)[_0x9f6a('0x26')](_0x3c9fb1);}};}function respondWithFilteredResult(_0xf12374,_0x11e50c){return function(_0x37697b){if(_0x37697b){var _0xcd81b7=typeof _0x11e50c[_0x9f6a('0x27')]===_0x9f6a('0x28')&&typeof _0x11e50c[_0x9f6a('0x29')]===_0x9f6a('0x28');var _0x7519c4=_0x37697b[_0x9f6a('0x2a')];var _0x3fd353=_0xcd81b7?0x0:_0x11e50c[_0x9f6a('0x27')];var _0x559218=_0xcd81b7?_0x37697b[_0x9f6a('0x2a')]:_0x11e50c[_0x9f6a('0x27')]+_0x11e50c[_0x9f6a('0x29')];var _0x32126c;if(_0x559218>=_0x7519c4){_0x559218=_0x7519c4;_0x32126c=0xc8;}else{_0x32126c=0xce;}_0xf12374[_0x9f6a('0x25')](_0x32126c);return _0xf12374[_0x9f6a('0x2b')](_0x9f6a('0x2c'),_0x3fd353+'-'+_0x559218+'/'+_0x7519c4)[_0x9f6a('0x26')](_0x37697b);}return null;};}function patchUpdates(_0x42478c){return function(_0x3cb8e5){try{jsonpatch['apply'](_0x3cb8e5,_0x42478c,!![]);}catch(_0x246b09){return BPromise[_0x9f6a('0x2d')](_0x246b09);}return _0x3cb8e5[_0x9f6a('0x2e')]();};}function saveUpdates(_0x26d7ae,_0x24f936){return function(_0x3fb7b5){if(_0x3fb7b5){return _0x3fb7b5['update'](_0x26d7ae)[_0x9f6a('0x18')](function(_0x342ac5){return _0x342ac5;});}return null;};}function removeEntity(_0x1c0115,_0x46706e){return function(_0x2db95a){if(_0x2db95a){return _0x2db95a[_0x9f6a('0x2f')]()[_0x9f6a('0x18')](function(){_0x1c0115[_0x9f6a('0x25')](0xcc)[_0x9f6a('0x30')]();});}};}function handleEntityNotFound(_0x345000,_0x121190){return function(_0x34fc0d){if(!_0x34fc0d){_0x345000['sendStatus'](0x194);}return _0x34fc0d;};}function handleError(_0x376913,_0x468761){_0x468761=_0x468761||0x1f4;return function(_0x32b966){logger[_0x9f6a('0x1e')](_0x32b966[_0x9f6a('0x31')]);if(_0x32b966['name']){delete _0x32b966['name'];}_0x376913['status'](_0x468761)[_0x9f6a('0x32')](_0x32b966);};}exports[_0x9f6a('0x33')]=function(_0x1f307a,_0x42a674){var _0x119729={},_0x9e3f80={},_0x2da67c={'count':0x0,'rows':[]};var _0x4e0ecb=_[_0x9f6a('0x34')](db[_0x9f6a('0x35')][_0x9f6a('0x36')],function(_0x195b3f){return{'name':_0x195b3f['fieldName'],'type':_0x195b3f[_0x9f6a('0x37')][_0x9f6a('0x38')]};});_0x9e3f80['model']=_[_0x9f6a('0x34')](_0x4e0ecb,_0x9f6a('0x39'));_0x9e3f80['query']=_[_0x9f6a('0x3a')](_0x1f307a[_0x9f6a('0x3b')]);_0x9e3f80[_0x9f6a('0x3c')]=_[_0x9f6a('0x3d')](_0x9e3f80[_0x9f6a('0x3e')],_0x9e3f80['query']);_0x119729['attributes']=_[_0x9f6a('0x3d')](_0x9e3f80['model'],qs[_0x9f6a('0x3f')](_0x1f307a[_0x9f6a('0x3b')][_0x9f6a('0x3f')]));_0x119729['attributes']=_0x119729[_0x9f6a('0x40')][_0x9f6a('0x41')]?_0x119729[_0x9f6a('0x40')]:_0x9e3f80[_0x9f6a('0x3e')];if(!_0x1f307a['query']['hasOwnProperty']('nolimit')){_0x119729[_0x9f6a('0x29')]=qs[_0x9f6a('0x29')](_0x1f307a[_0x9f6a('0x3b')][_0x9f6a('0x29')]);_0x119729[_0x9f6a('0x27')]=qs[_0x9f6a('0x27')](_0x1f307a[_0x9f6a('0x3b')]['offset']);}_0x119729['order']=qs['sort'](_0x1f307a[_0x9f6a('0x3b')][_0x9f6a('0x42')]);_0x119729[_0x9f6a('0x43')]=qs[_0x9f6a('0x3c')](_['pick'](_0x1f307a['query'],_0x9e3f80[_0x9f6a('0x3c')]),_0x4e0ecb);if(_0x1f307a[_0x9f6a('0x3b')]['filter']){_0x119729[_0x9f6a('0x43')]=_[_0x9f6a('0x44')](_0x119729['where'],{'$or':_[_0x9f6a('0x34')](_0x4e0ecb,function(_0x311781){if(_0x311781[_0x9f6a('0x37')]!==_0x9f6a('0x45')){var _0x586503={};_0x586503[_0x311781[_0x9f6a('0x39')]]={'$like':'%'+_0x1f307a[_0x9f6a('0x3b')]['filter']+'%'};return _0x586503;}})});}_0x119729=_[_0x9f6a('0x44')]({},_0x119729,_0x1f307a[_0x9f6a('0x46')]);var _0x2f66cd={'where':_0x119729[_0x9f6a('0x43')]};return db[_0x9f6a('0x35')]['count'](_0x2f66cd)[_0x9f6a('0x18')](function(_0x326509){_0x2da67c[_0x9f6a('0x2a')]=_0x326509;if(_0x1f307a[_0x9f6a('0x3b')][_0x9f6a('0x47')]){_0x119729[_0x9f6a('0x48')]=[{'all':!![]}];}return db[_0x9f6a('0x35')][_0x9f6a('0x49')](_0x119729);})[_0x9f6a('0x18')](function(_0x1af624){_0x2da67c[_0x9f6a('0x4a')]=_0x1af624;return _0x2da67c;})['then'](respondWithFilteredResult(_0x42a674,_0x119729))[_0x9f6a('0x23')](handleError(_0x42a674,null));};exports[_0x9f6a('0x4b')]=function(_0x21d1f9,_0x4607b3){var _0x44e882={'raw':![],'where':{'id':_0x21d1f9[_0x9f6a('0x4c')]['id']}},_0x155b55={};_0x155b55['model']=_[_0x9f6a('0x3a')](db[_0x9f6a('0x35')][_0x9f6a('0x36')]);_0x155b55['query']=_[_0x9f6a('0x3a')](_0x21d1f9['query']);_0x155b55[_0x9f6a('0x3c')]=_['intersection'](_0x155b55[_0x9f6a('0x3e')],_0x155b55['query']);_0x44e882[_0x9f6a('0x40')]=_[_0x9f6a('0x3d')](_0x155b55[_0x9f6a('0x3e')],qs[_0x9f6a('0x3f')](_0x21d1f9[_0x9f6a('0x3b')][_0x9f6a('0x3f')]));_0x44e882[_0x9f6a('0x40')]=_0x44e882['attributes'][_0x9f6a('0x41')]?_0x44e882[_0x9f6a('0x40')]:_0x155b55[_0x9f6a('0x3e')];if(_0x21d1f9[_0x9f6a('0x3b')][_0x9f6a('0x47')]){_0x44e882[_0x9f6a('0x48')]=[{'all':!![]}];}_0x44e882=_[_0x9f6a('0x44')]({},_0x44e882,_0x21d1f9[_0x9f6a('0x46')]);return db[_0x9f6a('0x35')][_0x9f6a('0x4d')](_0x44e882)[_0x9f6a('0x18')](handleEntityNotFound(_0x4607b3,null))['then'](respondWithResult(_0x4607b3,null))[_0x9f6a('0x23')](handleError(_0x4607b3,null));};exports[_0x9f6a('0x4e')]=function(_0x2e2e6a,_0x5c0755){if(_0x2e2e6a[_0x9f6a('0x4f')]['id']){delete _0x2e2e6a[_0x9f6a('0x4f')]['id'];}return db[_0x9f6a('0x35')][_0x9f6a('0x4d')]({'where':{'id':_0x2e2e6a[_0x9f6a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5c0755,null))[_0x9f6a('0x18')](saveUpdates(_0x2e2e6a[_0x9f6a('0x4f')],null))['then'](respondWithResult(_0x5c0755,null))[_0x9f6a('0x23')](handleError(_0x5c0755,null));};exports[_0x9f6a('0x50')]=function(_0x18c0a3,_0x1f80c8,_0x24441b){if(_0x18c0a3[_0x9f6a('0x51')]&&_0x18c0a3[_0x9f6a('0x51')]['filename']){_0x18c0a3['body']['logo']=_0x18c0a3[_0x9f6a('0x51')][_0x9f6a('0x52')];}return db[_0x9f6a('0x35')][_0x9f6a('0x4d')]({'where':{'id':_0x18c0a3[_0x9f6a('0x4c')]['id']}})[_0x9f6a('0x18')](handleEntityNotFound(_0x1f80c8,null))[_0x9f6a('0x18')](saveUpdates(_0x18c0a3['body'],null))[_0x9f6a('0x18')](respondWithResult(_0x1f80c8,null))['catch'](handleError(_0x1f80c8,null));};exports['addLogoLogin']=function(_0x57cf1d,_0x579a4a,_0xea671c){if(_0x57cf1d[_0x9f6a('0x51')]&&_0x57cf1d[_0x9f6a('0x51')]['filename']){_0x57cf1d[_0x9f6a('0x4f')][_0x9f6a('0x53')]=_0x57cf1d[_0x9f6a('0x51')][_0x9f6a('0x52')];}return db[_0x9f6a('0x35')][_0x9f6a('0x4d')]({'where':{'id':_0x57cf1d[_0x9f6a('0x4c')]['id']}})[_0x9f6a('0x18')](handleEntityNotFound(_0x579a4a,null))['then'](saveUpdates(_0x57cf1d[_0x9f6a('0x4f')],null))[_0x9f6a('0x18')](respondWithResult(_0x579a4a,null))[_0x9f6a('0x23')](handleError(_0x579a4a,null));};var utilLicense=require(_0x9f6a('0x54'));exports[_0x9f6a('0x55')]=function(_0x3f8ad0,_0xca6d19,_0x48cf06){var _0xfafac2=_0x9f6a('0x56');var _0x1b3ce4={'custom':![]};return utilLicense[_0x9f6a('0x57')]()['then'](function(_0x4d618a){if(_0x4d618a){_0x1b3ce4=_0x4d618a;}return db[_0x9f6a('0x35')][_0x9f6a('0x4d')]({'where':{'id':_0x3f8ad0[_0x9f6a('0x4c')]['id']},'attributes':[_0x9f6a('0x58'),'loginLogo',_0x9f6a('0x59'),_0x9f6a('0x5a'),_0x9f6a('0x5b'),_0x9f6a('0x5c'),'defaultPreferred',_0x9f6a('0x5d')],'raw':!![]});})[_0x9f6a('0x18')](handleEntityNotFound(_0xca6d19,null))[_0x9f6a('0x18')](function(_0xcb033){if(_0xcb033){var _0x2abe9=_0xcb033['logo']&&fs[_0x9f6a('0x5e')](path['join'](config[_0x9f6a('0x5f')],_0xfafac2,_[_0x9f6a('0x60')](_0xcb033[_0x9f6a('0x58')])))?path[_0x9f6a('0x61')](config['root'],_0xfafac2,_[_0x9f6a('0x60')](_0xcb033['logo'])):path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0xfafac2,_[_0x9f6a('0x60')](_0x9f6a('0x62')));var _0x1cdc5f=_0x9f6a('0x63')+_['upperFirst'](_0x9f6a('0x58'));if(_0xcb033[_0x1cdc5f]||!_0x1b3ce4[_0x9f6a('0x64')]){_0x2abe9=path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0xfafac2,_[_0x9f6a('0x60')](_0x9f6a('0x62')));}if(!fs['existsSync'](_0x2abe9)){throw new db[(_0x9f6a('0x65'))][(_0x9f6a('0x66'))](_[_0x9f6a('0x67')]('logo')+'\x20not\x20found');}return _0xca6d19['download'](_0x2abe9);}})[_0x9f6a('0x23')](handleError(_0xca6d19,null));};var utilLicense=require(_0x9f6a('0x54'));exports[_0x9f6a('0x68')]=function(_0x2b006a,_0x1ce93b,_0x44507a){var _0x1bdec6=_0x9f6a('0x56');var _0x21477b={'custom':![]};return utilLicense[_0x9f6a('0x57')]()['then'](function(_0x3e38a7){if(_0x3e38a7){_0x21477b=_0x3e38a7;}return db['Setting'][_0x9f6a('0x4d')]({'where':{'id':_0x2b006a[_0x9f6a('0x4c')]['id']},'attributes':['logo','loginLogo',_0x9f6a('0x59'),'favicon','defaultLogo',_0x9f6a('0x5c'),_0x9f6a('0x69'),'defaultFavicon'],'raw':!![]});})[_0x9f6a('0x18')](handleEntityNotFound(_0x1ce93b,null))[_0x9f6a('0x18')](function(_0x42f4c8){if(_0x42f4c8){var _0x13c418=_0x42f4c8[_0x9f6a('0x53')]&&fs['existsSync'](path['join'](config[_0x9f6a('0x5f')],_0x1bdec6,_[_0x9f6a('0x60')](_0x42f4c8['loginLogo'])))?path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x1bdec6,_[_0x9f6a('0x60')](_0x42f4c8['loginLogo'])):path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x1bdec6,_[_0x9f6a('0x60')](_0x9f6a('0x6a')));var _0x32f45f=_0x9f6a('0x63')+_[_0x9f6a('0x67')](_0x9f6a('0x53'));if(_0x42f4c8[_0x32f45f]||!_0x21477b['custom']){_0x13c418=path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x1bdec6,_[_0x9f6a('0x60')]('default_loginLogo.svg'));}if(!fs[_0x9f6a('0x5e')](_0x13c418)){throw new db['Sequelize']['ValidationError'](_[_0x9f6a('0x67')](_0x9f6a('0x53'))+'\x20not\x20found');}return _0x1ce93b[_0x9f6a('0x6b')](_0x13c418);}})[_0x9f6a('0x23')](handleError(_0x1ce93b,null));};exports[_0x9f6a('0x6c')]=function(_0x27014c,_0x1cd0c5){return db[_0x9f6a('0x35')]['find']({'where':{'id':_0x27014c[_0x9f6a('0x4c')]['id']},'attributes':[_0x9f6a('0x6d')]})['then'](respondWithResult(_0x1cd0c5,null))[_0x9f6a('0x23')](handleError(_0x1cd0c5,null));};exports['addPreferred']=function(_0x5532a8,_0x52cfda,_0x203ca8){if(_0x5532a8[_0x9f6a('0x51')]&&_0x5532a8[_0x9f6a('0x51')][_0x9f6a('0x52')]){_0x5532a8[_0x9f6a('0x4f')][_0x9f6a('0x59')]=_0x5532a8[_0x9f6a('0x51')]['filename'];}return db['Setting']['find']({'where':{'id':_0x5532a8[_0x9f6a('0x4c')]['id']}})[_0x9f6a('0x18')](handleEntityNotFound(_0x52cfda,null))[_0x9f6a('0x18')](saveUpdates(_0x5532a8[_0x9f6a('0x4f')],null))[_0x9f6a('0x18')](respondWithResult(_0x52cfda,null))[_0x9f6a('0x23')](handleError(_0x52cfda,null));};var utilLicense=require(_0x9f6a('0x54'));exports[_0x9f6a('0x6e')]=function(_0x2eaf6e,_0x31d663,_0x4e58e7){var _0x46e999=_0x9f6a('0x56');var _0x34fb07={'custom':![]};return utilLicense[_0x9f6a('0x57')]()['then'](function(_0x4c2e17){if(_0x4c2e17){_0x34fb07=_0x4c2e17;}return db[_0x9f6a('0x35')][_0x9f6a('0x4d')]({'where':{'id':_0x2eaf6e[_0x9f6a('0x4c')]['id']},'attributes':[_0x9f6a('0x58'),_0x9f6a('0x53'),_0x9f6a('0x59'),_0x9f6a('0x5a'),_0x9f6a('0x5b'),_0x9f6a('0x5c'),_0x9f6a('0x69'),_0x9f6a('0x5d')],'raw':!![]});})[_0x9f6a('0x18')](handleEntityNotFound(_0x31d663,null))[_0x9f6a('0x18')](function(_0x4b2d3d){if(_0x4b2d3d){var _0x16d775=_0x4b2d3d[_0x9f6a('0x59')]&&fs[_0x9f6a('0x5e')](path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x46e999,_[_0x9f6a('0x60')](_0x4b2d3d['preferred'])))?path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x46e999,_['toLower'](_0x4b2d3d[_0x9f6a('0x59')])):path['join'](config[_0x9f6a('0x5f')],_0x46e999,_[_0x9f6a('0x60')]('default_preferred.png'));var _0x30e523=_0x9f6a('0x63')+_[_0x9f6a('0x67')](_0x9f6a('0x59'));if(_0x4b2d3d[_0x30e523]||!_0x34fb07[_0x9f6a('0x64')]||!_0x34fb07['preferred']){_0x16d775=path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x46e999,_['toLower'](_0x9f6a('0x6f')));}if(!fs[_0x9f6a('0x5e')](_0x16d775)){throw new db['Sequelize'][(_0x9f6a('0x66'))](_['upperFirst'](_0x9f6a('0x59'))+_0x9f6a('0x70'));}return _0x31d663['download'](_0x16d775);}})[_0x9f6a('0x23')](handleError(_0x31d663,null));};exports['addFavicon']=function(_0x3a88a1,_0x4d6309,_0x3e9d24){if(_0x3a88a1['file']&&_0x3a88a1[_0x9f6a('0x51')][_0x9f6a('0x52')]){_0x3a88a1[_0x9f6a('0x4f')][_0x9f6a('0x5a')]=_0x3a88a1[_0x9f6a('0x51')][_0x9f6a('0x52')];}return db[_0x9f6a('0x35')][_0x9f6a('0x4d')]({'where':{'id':_0x3a88a1['params']['id']}})[_0x9f6a('0x18')](handleEntityNotFound(_0x4d6309,null))['then'](saveUpdates(_0x3a88a1['body'],null))[_0x9f6a('0x18')](respondWithResult(_0x4d6309,null))[_0x9f6a('0x23')](handleError(_0x4d6309,null));};var utilLicense=require(_0x9f6a('0x54'));exports['getFavicon']=function(_0x9414fe,_0x3687da,_0x229510){var _0x12fcc3='server/files/images/logos';var _0x53fb57={'custom':![]};return utilLicense[_0x9f6a('0x57')]()[_0x9f6a('0x18')](function(_0x1871df){if(_0x1871df){_0x53fb57=_0x1871df;}return db[_0x9f6a('0x35')][_0x9f6a('0x4d')]({'where':{'id':_0x9414fe[_0x9f6a('0x4c')]['id']},'attributes':[_0x9f6a('0x58'),'loginLogo','preferred',_0x9f6a('0x5a'),_0x9f6a('0x5b'),'defaultLoginLogo',_0x9f6a('0x69'),_0x9f6a('0x5d')],'raw':!![]});})[_0x9f6a('0x18')](handleEntityNotFound(_0x3687da,null))['then'](function(_0x35db75){if(_0x35db75){var _0x5755be=_0x35db75['favicon']&&fs[_0x9f6a('0x5e')](path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x12fcc3,_[_0x9f6a('0x60')](_0x35db75[_0x9f6a('0x5a')])))?path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x12fcc3,_['toLower'](_0x35db75['favicon'])):path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x12fcc3,_['toLower'](_0x9f6a('0x71')));var _0x526856=_0x9f6a('0x63')+_[_0x9f6a('0x67')](_0x9f6a('0x5a'));if(_0x35db75[_0x526856]||!_0x53fb57[_0x9f6a('0x64')]){_0x5755be=path[_0x9f6a('0x61')](config[_0x9f6a('0x5f')],_0x12fcc3,_[_0x9f6a('0x60')](_0x9f6a('0x71')));}if(!fs[_0x9f6a('0x5e')](_0x5755be)){throw new db[(_0x9f6a('0x65'))][(_0x9f6a('0x66'))](_['upperFirst'](_0x9f6a('0x5a'))+_0x9f6a('0x70'));}return _0x3687da[_0x9f6a('0x6b')](_0x5755be);}})[_0x9f6a('0x23')](handleError(_0x3687da,null));};exports[_0x9f6a('0x72')]=function(_0x25f506,_0x35a881){var _0x396e8c={'offset':moment()[_0x9f6a('0x73')]()};_0x396e8c[_0x9f6a('0x74')]=moment()[_0x9f6a('0x73')](_0x396e8c['offset'])[_0x9f6a('0x75')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x35a881['status'](0xc8)['send'](_0x396e8c);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index fd60f60..305afdd 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x39780c,_0x5782c9){var _0x53c19b=function(_0x594f01){while(--_0x594f01){_0x39780c['push'](_0x39780c['shift']());}};_0x53c19b(++_0x5782c9);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index fa9cce6..b0ac050 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 _0x50b9=['request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSetting','Setting','options','raw','where','include','map','model','attributes','debug','stringify','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Setting,\x20%s,\x20%s'];(function(_0x241dd1,_0x15eb80){var _0x39d07c=function(_0x5d2313){while(--_0x5d2313){_0x241dd1['push'](_0x241dd1['shift']());}};_0x39d07c(++_0x15eb80);}(_0x50b9,0x113));var _0x950b=function(_0x4b54fb,_0x2150e4){_0x4b54fb=_0x4b54fb-0x0;var _0x375eb4=_0x50b9[_0x4b54fb];return _0x375eb4;};'use strict';var _=require(_0x950b('0x0'));var util=require(_0x950b('0x1'));var moment=require(_0x950b('0x2'));var BPromise=require(_0x950b('0x3'));var rs=require(_0x950b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x950b('0x5'))(_0x950b('0x6'));var config=require(_0x950b('0x7'));var jayson=require(_0x950b('0x8'));var client=jayson[_0x950b('0x9')][_0x950b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x311a4a,_0x382467,_0x1337e3){return new BPromise(function(_0x2317b,_0x5ca1a7){return client['request'](_0x311a4a,_0x1337e3)[_0x950b('0xb')](function(_0x230e13){logger['info'](_0x950b('0xc'),_0x382467,_0x950b('0xd'));logger['debug'](_0x950b('0xe'),_0x382467,_0x950b('0xd'),JSON['stringify'](_0x230e13));if(_0x230e13[_0x950b('0xf')]){if(_0x230e13['error'][_0x950b('0x10')]===0x1f4){logger[_0x950b('0xf')]('Setting,\x20%s,\x20%s',_0x382467,_0x230e13[_0x950b('0xf')][_0x950b('0x11')]);return _0x5ca1a7(_0x230e13[_0x950b('0xf')][_0x950b('0x11')]);}logger[_0x950b('0xf')](_0x950b('0xc'),_0x382467,_0x230e13[_0x950b('0xf')][_0x950b('0x11')]);return _0x2317b(_0x230e13[_0x950b('0xf')][_0x950b('0x11')]);}else{logger[_0x950b('0x12')](_0x950b('0xc'),_0x382467,_0x950b('0xd'));_0x2317b(_0x230e13[_0x950b('0x13')][_0x950b('0x11')]);}})[_0x950b('0x14')](function(_0x4d47){logger['error'](_0x950b('0xc'),_0x382467,_0x4d47);_0x5ca1a7(_0x4d47);});});}exports[_0x950b('0x15')]=function(_0x4e0225){var _0x3fd9ac=this;return new Promise(function(_0x5129b5,_0x3bf786){return db[_0x950b('0x16')]['find']({'raw':_0x4e0225['options']?_0x4e0225[_0x950b('0x17')][_0x950b('0x18')]===undefined?!![]:![]:!![],'where':_0x4e0225['options']?_0x4e0225[_0x950b('0x17')][_0x950b('0x19')]||null:null,'attributes':_0x4e0225[_0x950b('0x17')]?_0x4e0225['options']['attributes']||null:null,'include':_0x4e0225[_0x950b('0x17')]?_0x4e0225[_0x950b('0x17')][_0x950b('0x1a')]?_[_0x950b('0x1b')](_0x4e0225['options'][_0x950b('0x1a')],function(_0x11d02c){return{'model':db[_0x11d02c[_0x950b('0x1c')]],'as':_0x11d02c['as'],'attributes':_0x11d02c[_0x950b('0x1d')],'include':_0x11d02c[_0x950b('0x1a')]?_['map'](_0x11d02c['include'],function(_0x19af5e){return{'model':db[_0x19af5e[_0x950b('0x1c')]],'as':_0x19af5e['as'],'attributes':_0x19af5e[_0x950b('0x1d')],'include':_0x19af5e[_0x950b('0x1a')]?_[_0x950b('0x1b')](_0x19af5e[_0x950b('0x1a')],function(_0x1aa0ae){return{'model':db[_0x1aa0ae['model']],'as':_0x1aa0ae['as'],'attributes':_0x1aa0ae[_0x950b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x950b('0xb')](function(_0x58992b){logger[_0x950b('0x12')](_0x950b('0x15'),_0x4e0225);logger[_0x950b('0x1e')]('ShowSetting',_0x4e0225,JSON[_0x950b('0x1f')](_0x58992b));_0x5129b5(_0x58992b);})[_0x950b('0x14')](function(_0xb76fd9){logger[_0x950b('0xf')](_0x950b('0x15'),_0xb76fd9[_0x950b('0x11')],_0x4e0225);_0x3bf786(_0x3fd9ac[_0x950b('0xf')](0x1f4,_0xb76fd9[_0x950b('0x11')]));});});}; \ No newline at end of file +var _0xbde3=['../../config/utils','../../config/logger','rpc','jayson/promise','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2f84f1,_0x5192dd){var _0x3dbe5d=function(_0xf5f983){while(--_0xf5f983){_0x2f84f1['push'](_0x2f84f1['shift']());}};_0x3dbe5d(++_0x5192dd);}(_0xbde3,0x73));var _0x3bde=function(_0xde4ad6,_0x51e47f){_0xde4ad6=_0xde4ad6-0x0;var _0x5d7023=_0xbde3[_0xde4ad6];return _0x5d7023;};'use strict';var _=require(_0x3bde('0x0'));var util=require(_0x3bde('0x1'));var moment=require('moment');var BPromise=require(_0x3bde('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bde('0x3'));var db=require(_0x3bde('0x4'))['db'];var utils=require(_0x3bde('0x5'));var logger=require(_0x3bde('0x6'))(_0x3bde('0x7'));var config=require('../../config/environment');var jayson=require(_0x3bde('0x8'));var client=jayson['client'][_0x3bde('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b954f,_0x281d8a,_0x5a1c34){return new BPromise(function(_0xf4026e,_0x537d81){return client['request'](_0x1b954f,_0x5a1c34)[_0x3bde('0xa')](function(_0x3fe1a5){logger['info'](_0x3bde('0xb'),_0x281d8a,_0x3bde('0xc'));logger[_0x3bde('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x281d8a,'request\x20sent',JSON[_0x3bde('0xe')](_0x3fe1a5));if(_0x3fe1a5[_0x3bde('0xf')]){if(_0x3fe1a5['error']['code']===0x1f4){logger[_0x3bde('0xf')](_0x3bde('0xb'),_0x281d8a,_0x3fe1a5['error'][_0x3bde('0x10')]);return _0x537d81(_0x3fe1a5[_0x3bde('0xf')][_0x3bde('0x10')]);}logger[_0x3bde('0xf')]('Setting,\x20%s,\x20%s',_0x281d8a,_0x3fe1a5[_0x3bde('0xf')]['message']);return _0xf4026e(_0x3fe1a5[_0x3bde('0xf')][_0x3bde('0x10')]);}else{logger[_0x3bde('0x11')]('Setting,\x20%s,\x20%s',_0x281d8a,_0x3bde('0xc'));_0xf4026e(_0x3fe1a5[_0x3bde('0x12')][_0x3bde('0x10')]);}})[_0x3bde('0x13')](function(_0x4149d2){logger['error'](_0x3bde('0xb'),_0x281d8a,_0x4149d2);_0x537d81(_0x4149d2);});});}exports[_0x3bde('0x14')]=function(_0x482136){var _0x3ce172=this;return new Promise(function(_0x2e835a,_0xd76274){return db[_0x3bde('0x15')][_0x3bde('0x16')]({'raw':_0x482136['options']?_0x482136[_0x3bde('0x17')][_0x3bde('0x18')]===undefined?!![]:![]:!![],'where':_0x482136[_0x3bde('0x17')]?_0x482136[_0x3bde('0x17')][_0x3bde('0x19')]||null:null,'attributes':_0x482136[_0x3bde('0x17')]?_0x482136[_0x3bde('0x17')][_0x3bde('0x1a')]||null:null,'include':_0x482136['options']?_0x482136[_0x3bde('0x17')][_0x3bde('0x1b')]?_[_0x3bde('0x1c')](_0x482136[_0x3bde('0x17')][_0x3bde('0x1b')],function(_0x7a8bc1){return{'model':db[_0x7a8bc1[_0x3bde('0x1d')]],'as':_0x7a8bc1['as'],'attributes':_0x7a8bc1['attributes'],'include':_0x7a8bc1[_0x3bde('0x1b')]?_[_0x3bde('0x1c')](_0x7a8bc1['include'],function(_0x292445){return{'model':db[_0x292445[_0x3bde('0x1d')]],'as':_0x292445['as'],'attributes':_0x292445[_0x3bde('0x1a')],'include':_0x292445[_0x3bde('0x1b')]?_['map'](_0x292445[_0x3bde('0x1b')],function(_0x55311f){return{'model':db[_0x55311f[_0x3bde('0x1d')]],'as':_0x55311f['as'],'attributes':_0x55311f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3bde('0xa')](function(_0x35ebde){logger['info']('ShowSetting',_0x482136);logger['debug']('ShowSetting',_0x482136,JSON[_0x3bde('0xe')](_0x35ebde));_0x2e835a(_0x35ebde);})[_0x3bde('0x13')](function(_0x12595d){logger['error'](_0x3bde('0x14'),_0x12595d[_0x3bde('0x10')],_0x482136);_0xd76274(_0x3ce172['error'](0x1f4,_0x12595d[_0x3bde('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d0d5d82..a794e52 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1f65b6,_0x4fd481){_0x1f65b6=_0x1f65b6-0x0;var _0x390cc0=_0x1cb9[_0x1f65b6];return _0x390cc0;};'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 _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x276167,_0x21086e){var _0x27a866=function(_0xa47f17){while(--_0xa47f17){_0x276167['push'](_0x276167['shift']());}};_0x27a866(++_0x21086e);}(_0xe14b,0x93));var _0xbe14=function(_0x33cbd3,_0x164dfd){_0x33cbd3=_0x33cbd3-0x0;var _0x56a810=_0xe14b[_0x33cbd3];return _0x56a810;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index b826659..0ee253e 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 _0x1f37=['skebby','connectel','clicksend','plivo','clickatell','bandwidth','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','sequelize','randomstring','STRING','name','generate','ENUM','twilio'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x1f37,0x14f));var _0x71f3=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x1f37[_0x1e2321];return _0x1d346d;};'use strict';var Sequelize=require(_0x71f3('0x0'));var rs=require(_0x71f3('0x1'));module['exports']={'name':{'type':Sequelize[_0x71f3('0x2')],'unique':_0x71f3('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x71f3('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x71f3('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x71f3('0x2')],'defaultValue':function(){return rs[_0x71f3('0x4')]();}},'phone':{'type':Sequelize[_0x71f3('0x2')]},'type':{'type':Sequelize[_0x71f3('0x5')](_0x71f3('0x6'),_0x71f3('0x7'),_0x71f3('0x8'),_0x71f3('0x9'),_0x71f3('0xa'),_0x71f3('0xb'),_0x71f3('0xc'),'csc','infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x71f3('0x2')]},'authId':{'type':Sequelize[_0x71f3('0x2')]},'authToken':{'type':Sequelize[_0x71f3('0x2')]},'smsMethod':{'type':Sequelize[_0x71f3('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x71f3('0x2')]},'password':{'type':Sequelize[_0x71f3('0x2')]},'apiKey':{'type':Sequelize[_0x71f3('0x2')]},'applicationId':{'type':Sequelize[_0x71f3('0x2')]},'accountId':{'type':Sequelize[_0x71f3('0x2')]},'senderString':{'type':Sequelize[_0x71f3('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x71f3('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x71f3('0xd');}},'notificationSound':{'type':Sequelize[_0x71f3('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x71f3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x71f3('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x71f3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x71f3('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x71f3('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x71f3('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x71f3('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x71f3('0xe')],'defaultValue':![],'comment':_0x71f3('0x11'),'set':function(_0x58d99d){if(!_0x58d99d)this[_0x71f3('0x12')]('mandatoryDispositionPauseId',null);this[_0x71f3('0x12')]('mandatoryDisposition',_0x58d99d);}}}; \ No newline at end of file +var _0x62bb=['infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','twilio','skebby','clickatell','bandwidth','csc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x62bb,0x1d6));var _0xb62b=function(_0x2e7dd0,_0x2e0016){_0x2e7dd0=_0x2e7dd0-0x0;var _0x5699e4=_0x62bb[_0x2e7dd0];return _0x5699e4;};'use strict';var Sequelize=require(_0xb62b('0x0'));var rs=require('randomstring');module[_0xb62b('0x1')]={'name':{'type':Sequelize[_0xb62b('0x2')],'unique':_0xb62b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb62b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb62b('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb62b('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xb62b('0x5'),_0xb62b('0x6'),'connectel','clicksend','plivo',_0xb62b('0x7'),_0xb62b('0x8'),_0xb62b('0x9'),_0xb62b('0xa'),_0xb62b('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xb62b('0x2')]},'authToken':{'type':Sequelize[_0xb62b('0x2')]},'smsMethod':{'type':Sequelize[_0xb62b('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb62b('0x2')]},'password':{'type':Sequelize[_0xb62b('0x2')]},'apiKey':{'type':Sequelize[_0xb62b('0x2')]},'applicationId':{'type':Sequelize[_0xb62b('0x2')]},'accountId':{'type':Sequelize[_0xb62b('0x2')]},'senderString':{'type':Sequelize[_0xb62b('0x2')]},'deliveryReport':{'type':Sequelize[_0xb62b('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb62b('0xe');}},'notificationSound':{'type':Sequelize[_0xb62b('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb62b('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb62b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb62b('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb62b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb62b('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb62b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb62b('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb62b('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb62b('0xd')],'defaultValue':![],'comment':_0xb62b('0x10'),'set':function(_0x1ea22b){if(!_0x1ea22b)this[_0xb62b('0x11')](_0xb62b('0x12'),null);this[_0xb62b('0x11')](_0xb62b('0x13'),_0x1ea22b);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index c5cf9c7..92be58b 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 _0xa0c6=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','get','SmsAccounts','UserProfileResource','destroy','stack','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','sort','where','pick','filter','merge','name','options','SmsAccount','includeAll','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','length','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getDispositions','findOne','Disposition','hasOwnProperty','nolimit','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','Applications','orderBy','priority','asc','account','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','skebby','sender','text','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','replyMessageId','intelepeer','refid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','list','omit','defaults','SmsInteraction','spread','interaction','autoclose','applications','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','findAndCountAll','getApplications','order','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','DESC','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','status_code','groupName','redif','error_code','DELIVERED','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0xee715c,_0x3db212){var _0x2fc181=function(_0x27df93){while(--_0x27df93){_0xee715c['push'](_0xee715c['shift']());}};_0x2fc181(++_0x3db212);}(_0xa0c6,0xd0));var _0x6a0c=function(_0xb60631,_0xdd32b4){_0xb60631=_0xb60631-0x0;var _0x218ebe=_0xa0c6[_0xb60631];return _0x218ebe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a0c('0x0'));var zipdir=require(_0x6a0c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a0c('0x2'));var moment=require(_0x6a0c('0x3'));var BPromise=require(_0x6a0c('0x4'));var Mustache=require(_0x6a0c('0x5'));var util=require(_0x6a0c('0x6'));var path=require(_0x6a0c('0x7'));var sox=require('sox');var csv=require(_0x6a0c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a0c('0x9'));var squel=require('squel');var crypto=require(_0x6a0c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6a0c('0xb'));var toCsv=require(_0x6a0c('0x8'));var querystring=require(_0x6a0c('0xc'));var Papa=require(_0x6a0c('0xd'));var Redis=require(_0x6a0c('0xe'));var authService=require(_0x6a0c('0xf'));var qs=require(_0x6a0c('0x10'));var as=require(_0x6a0c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a0c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6a0c('0x13'));var licenseUtil=require(_0x6a0c('0x14'));var db=require(_0x6a0c('0x15'))['db'];config[_0x6a0c('0x16')]=_['defaults'](config[_0x6a0c('0x16')],{'host':_0x6a0c('0x17'),'port':0x18eb});var socket=require(_0x6a0c('0x18'))(new Redis(config[_0x6a0c('0x16')]));require('./smsAccount.socket')[_0x6a0c('0x19')](socket);var jayson=require(_0x6a0c('0x1a'));var client=jayson[_0x6a0c('0x1b')][_0x6a0c('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x5218a3,_0xf95cad,_0x58e49f,_0x37ef36){return new BPromise(function(_0x44e916,_0x36816c){var _0x408b09=_0x37ef36||client;return _0x408b09['request'](_0x5218a3,_0x58e49f)[_0x6a0c('0x1d')](function(_0x442f79){logger[_0x6a0c('0x1e')](_0x6a0c('0x1f'),_0xf95cad,_0x6a0c('0x20'));logger[_0x6a0c('0x21')](_0x6a0c('0x22'),_0xf95cad,'request\x20sent',JSON[_0x6a0c('0x23')](_0x442f79));if(_0x442f79['error']){if(_0x442f79[_0x6a0c('0x24')][_0x6a0c('0x25')]===0x1f4){logger[_0x6a0c('0x24')](_0x6a0c('0x1f'),_0xf95cad,_0x442f79[_0x6a0c('0x24')][_0x6a0c('0x26')]);return _0x36816c(_0x442f79['error']['message']);}logger[_0x6a0c('0x24')](_0x6a0c('0x1f'),_0xf95cad,_0x442f79['error'][_0x6a0c('0x26')]);return _0x44e916(_0x442f79[_0x6a0c('0x24')][_0x6a0c('0x26')]);}else{logger[_0x6a0c('0x1e')](_0x6a0c('0x1f'),_0xf95cad,_0x6a0c('0x20'));_0x44e916(_0x442f79['result']['message']);}})[_0x6a0c('0x27')](function(_0x3493fb){logger[_0x6a0c('0x24')](_0x6a0c('0x1f'),_0xf95cad,_0x3493fb);_0x36816c(_0x3493fb);});});}function respondWithStatusCode(_0x28996c,_0x1cb5dd){_0x1cb5dd=_0x1cb5dd||0xcc;return function(_0x56fbd0){if(_0x56fbd0){return _0x28996c[_0x6a0c('0x28')](_0x1cb5dd);}return _0x28996c['status'](_0x1cb5dd)[_0x6a0c('0x29')]();};}function respondWithResult(_0x33db3d,_0x38436c){_0x38436c=_0x38436c||0xc8;return function(_0x2b252d){if(_0x2b252d){return _0x33db3d[_0x6a0c('0x2a')](_0x38436c)[_0x6a0c('0x2b')](_0x2b252d);}};}function respondWithFilteredResult(_0x494ba0,_0x152c8c){return function(_0x43d1cf){if(_0x43d1cf){var _0x113ff7=typeof _0x152c8c[_0x6a0c('0x2c')]===_0x6a0c('0x2d')&&typeof _0x152c8c[_0x6a0c('0x2e')]==='undefined';var _0x4e79f1=_0x43d1cf[_0x6a0c('0x2f')];var _0x227182=_0x113ff7?0x0:_0x152c8c[_0x6a0c('0x2c')];var _0x59acc7=_0x113ff7?_0x43d1cf['count']:_0x152c8c[_0x6a0c('0x2c')]+_0x152c8c[_0x6a0c('0x2e')];var _0x4f3bc5;if(_0x59acc7>=_0x4e79f1){_0x59acc7=_0x4e79f1;_0x4f3bc5=0xc8;}else{_0x4f3bc5=0xce;}_0x494ba0['status'](_0x4f3bc5);return _0x494ba0[_0x6a0c('0x30')](_0x6a0c('0x31'),_0x227182+'-'+_0x59acc7+'/'+_0x4e79f1)[_0x6a0c('0x2b')](_0x43d1cf);}return null;};}function patchUpdates(_0x53e197){return function(_0x45d72a){try{jsonpatch[_0x6a0c('0x32')](_0x45d72a,_0x53e197,!![]);}catch(_0x2300df){return BPromise['reject'](_0x2300df);}return _0x45d72a[_0x6a0c('0x33')]();};}function saveUpdates(_0x2ee306,_0x29eeb4){return function(_0x156ad5){if(_0x156ad5){return _0x156ad5['update'](_0x2ee306)[_0x6a0c('0x1d')](function(_0x4668c1){return _0x4668c1;});}return null;};}function removeEntity(_0x39cf52,_0x3cb0c6){return function(_0x2e2269){if(_0x2e2269){return _0x2e2269['destroy']()[_0x6a0c('0x1d')](function(){var _0x53cf28=_0x2e2269[_0x6a0c('0x34')]({'plain':!![]});var _0x20a9a1=_0x6a0c('0x35');return db[_0x6a0c('0x36')][_0x6a0c('0x37')]({'where':{'type':_0x20a9a1,'resourceId':_0x53cf28['id']}})['then'](function(){return _0x2e2269;});})[_0x6a0c('0x1d')](function(){_0x39cf52[_0x6a0c('0x2a')](0xcc)[_0x6a0c('0x29')]();});}};}function handleEntityNotFound(_0x2ba272,_0x3b0dd2){return function(_0x170a12){if(!_0x170a12){_0x2ba272['sendStatus'](0x194);}return _0x170a12;};}function handleError(_0x3e1d59,_0x5d76dc){_0x5d76dc=_0x5d76dc||0x1f4;return function(_0x3850e9){logger[_0x6a0c('0x24')](_0x3850e9[_0x6a0c('0x38')]);if(_0x3850e9['name']){delete _0x3850e9['name'];}_0x3e1d59[_0x6a0c('0x2a')](_0x5d76dc)[_0x6a0c('0x39')](_0x3850e9);};}exports[_0x6a0c('0x3a')]=function(_0xd931a4,_0x5f528f){var _0x370d7b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x533a80={},_0x2604a8={'count':0x0,'rows':[]};var _0x142f6f=_[_0x6a0c('0x3b')](db['SmsAccount'][_0x6a0c('0x3c')],function(_0xdd8970){return{'name':_0xdd8970[_0x6a0c('0x3d')],'type':_0xdd8970[_0x6a0c('0x3e')]['key']};});_0x533a80[_0x6a0c('0x3f')]=_[_0x6a0c('0x3b')](_0x142f6f,'name');_0x533a80[_0x6a0c('0x40')]=_[_0x6a0c('0x41')](_0xd931a4[_0x6a0c('0x40')]);_0x533a80[_0x6a0c('0x42')]=_[_0x6a0c('0x43')](_0x533a80[_0x6a0c('0x3f')],_0x533a80['query']);_0x370d7b[_0x6a0c('0x44')]=_[_0x6a0c('0x43')](_0x533a80['model'],qs['fields'](_0xd931a4[_0x6a0c('0x40')][_0x6a0c('0x45')]));_0x370d7b[_0x6a0c('0x44')]=_0x370d7b['attributes']['length']?_0x370d7b['attributes']:_0x533a80[_0x6a0c('0x3f')];if(!_0xd931a4['query']['hasOwnProperty']('nolimit')){_0x370d7b[_0x6a0c('0x2e')]=qs['limit'](_0xd931a4[_0x6a0c('0x40')][_0x6a0c('0x2e')]);_0x370d7b[_0x6a0c('0x2c')]=qs[_0x6a0c('0x2c')](_0xd931a4[_0x6a0c('0x40')]['offset']);}_0x370d7b['order']=qs[_0x6a0c('0x46')](_0xd931a4['query'][_0x6a0c('0x46')]);_0x370d7b[_0x6a0c('0x47')]=qs[_0x6a0c('0x42')](_[_0x6a0c('0x48')](_0xd931a4['query'],_0x533a80['filters']),_0x142f6f);if(_0xd931a4[_0x6a0c('0x40')][_0x6a0c('0x49')]){_0x370d7b[_0x6a0c('0x47')]=_[_0x6a0c('0x4a')](_0x370d7b['where'],{'$or':_[_0x6a0c('0x3b')](_0x142f6f,function(_0x8c99d8){if(_0x8c99d8[_0x6a0c('0x3e')]!=='VIRTUAL'){var _0x2fce30={};_0x2fce30[_0x8c99d8[_0x6a0c('0x4b')]]={'$like':'%'+_0xd931a4[_0x6a0c('0x40')][_0x6a0c('0x49')]+'%'};return _0x2fce30;}})});}_0x370d7b=_[_0x6a0c('0x4a')]({},_0x370d7b,_0xd931a4[_0x6a0c('0x4c')]);var _0x5f56a4={'where':_0x370d7b['where']};return db[_0x6a0c('0x4d')]['count'](_0x5f56a4)[_0x6a0c('0x1d')](function(_0x2499df){_0x2604a8[_0x6a0c('0x2f')]=_0x2499df;if(_0xd931a4[_0x6a0c('0x40')][_0x6a0c('0x4e')]){_0x370d7b[_0x6a0c('0x4f')]=[{'all':!![]}];}return db['SmsAccount'][_0x6a0c('0x50')](_0x370d7b);})[_0x6a0c('0x1d')](function(_0x379bf4){_0x2604a8[_0x6a0c('0x51')]=_0x379bf4;return _0x2604a8;})[_0x6a0c('0x1d')](respondWithFilteredResult(_0x5f528f,_0x370d7b))[_0x6a0c('0x27')](handleError(_0x5f528f,null));};exports[_0x6a0c('0x52')]=function(_0x19cc26,_0x462c58){var _0xc0ed06={'raw':![],'where':{'id':_0x19cc26[_0x6a0c('0x53')]['id']},'include':[{'model':db[_0x6a0c('0x54')],'as':_0x6a0c('0x55')}]},_0x1c51fb={};_0x1c51fb[_0x6a0c('0x3f')]=_[_0x6a0c('0x41')](db[_0x6a0c('0x4d')][_0x6a0c('0x3c')]);_0x1c51fb[_0x6a0c('0x40')]=_['keys'](_0x19cc26[_0x6a0c('0x40')]);_0x1c51fb[_0x6a0c('0x42')]=_[_0x6a0c('0x43')](_0x1c51fb[_0x6a0c('0x3f')],_0x1c51fb['query']);_0xc0ed06[_0x6a0c('0x44')]=_[_0x6a0c('0x43')](_0x1c51fb['model'],qs['fields'](_0x19cc26['query'][_0x6a0c('0x45')]));_0xc0ed06['attributes']=_0xc0ed06['attributes'][_0x6a0c('0x56')]?_0xc0ed06['attributes']:_0x1c51fb['model'];if(_0x19cc26['query'][_0x6a0c('0x4e')]){_0xc0ed06[_0x6a0c('0x4f')]=[{'all':!![]}];}_0xc0ed06=_['merge']({},_0xc0ed06,_0x19cc26[_0x6a0c('0x4c')]);return db['SmsAccount'][_0x6a0c('0x57')](_0xc0ed06)[_0x6a0c('0x1d')](handleEntityNotFound(_0x462c58,null))['then'](respondWithResult(_0x462c58,null))[_0x6a0c('0x27')](handleError(_0x462c58,null));};exports['create']=function(_0xd31d6b,_0x5cd082){return db[_0x6a0c('0x4d')][_0x6a0c('0x58')](_0xd31d6b[_0x6a0c('0x59')],{})[_0x6a0c('0x1d')](function(_0x5b97de){var _0x4aa0aa=_0xd31d6b[_0x6a0c('0x5a')][_0x6a0c('0x34')]({'plain':!![]});if(!_0x4aa0aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aa0aa['role']==='user'){var _0x2b45d3=_0x5b97de[_0x6a0c('0x34')]({'plain':!![]});var _0x46b38d='SmsAccounts';return db[_0x6a0c('0x5b')][_0x6a0c('0x57')]({'where':{'name':_0x46b38d,'userProfileId':_0x4aa0aa[_0x6a0c('0x5c')]},'raw':!![]})[_0x6a0c('0x1d')](function(_0x34d507){if(_0x34d507&&_0x34d507[_0x6a0c('0x5d')]===0x0){return db[_0x6a0c('0x36')]['create']({'name':_0x2b45d3[_0x6a0c('0x4b')],'resourceId':_0x2b45d3['id'],'type':_0x34d507[_0x6a0c('0x4b')],'sectionId':_0x34d507['id']},{})[_0x6a0c('0x1d')](function(){return _0x5b97de;});}else{return _0x5b97de;}})[_0x6a0c('0x27')](function(_0x5f2bd8){logger[_0x6a0c('0x24')](_0x6a0c('0x5e'),_0x5f2bd8);throw _0x5f2bd8;});}return _0x5b97de;})[_0x6a0c('0x1d')](respondWithResult(_0x5cd082,0xc9))['catch'](handleError(_0x5cd082,null));};exports[_0x6a0c('0x5f')]=function(_0x1e6fb7,_0x1d1cb5){if(_0x1e6fb7[_0x6a0c('0x59')]['id']){delete _0x1e6fb7[_0x6a0c('0x59')]['id'];}return db[_0x6a0c('0x4d')]['find']({'where':{'id':_0x1e6fb7['params']['id']},'include':[{'model':db[_0x6a0c('0x54')],'as':_0x6a0c('0x55')}]})[_0x6a0c('0x1d')](handleEntityNotFound(_0x1d1cb5,null))[_0x6a0c('0x1d')](saveUpdates(_0x1e6fb7[_0x6a0c('0x59')],null))[_0x6a0c('0x1d')](respondWithResult(_0x1d1cb5,null))['catch'](handleError(_0x1d1cb5,null));};exports[_0x6a0c('0x37')]=function(_0x1f7d00,_0x119ea2){return db[_0x6a0c('0x4d')][_0x6a0c('0x57')]({'where':{'id':_0x1f7d00['params']['id']}})['then'](handleEntityNotFound(_0x119ea2,null))[_0x6a0c('0x1d')](removeEntity(_0x119ea2,null))[_0x6a0c('0x27')](handleError(_0x119ea2,null));};exports['describe']=function(_0x1e8e26,_0x485c6a){return db[_0x6a0c('0x4d')][_0x6a0c('0x60')]()['then'](respondWithResult(_0x485c6a,null))[_0x6a0c('0x27')](handleError(_0x485c6a,null));};exports['addDisposition']=function(_0x2180a2,_0x580333,_0x7e88c0){if(_0x2180a2[_0x6a0c('0x59')]['id']){delete _0x2180a2[_0x6a0c('0x59')]['id'];}return db[_0x6a0c('0x4d')][_0x6a0c('0x57')]({'where':{'id':_0x2180a2[_0x6a0c('0x53')]['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x580333,null))[_0x6a0c('0x1d')](function(_0x44738f){if(_0x44738f){_0x2180a2['body']['SmsAccountId']=_0x44738f['id'];return db['Disposition'][_0x6a0c('0x58')](_0x2180a2[_0x6a0c('0x59')]);}})[_0x6a0c('0x1d')](respondWithResult(_0x580333,null))[_0x6a0c('0x27')](handleError(_0x580333,null));};exports[_0x6a0c('0x61')]=function(_0x241762,_0xc0006e,_0x4eebfc){var _0x4bb0f0={'raw':![],'where':{}};var _0x2f66ec={};var _0x10e4d4={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6a0c('0x62')]({'where':{'id':_0x241762[_0x6a0c('0x53')]['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0xc0006e,null))[_0x6a0c('0x1d')](function(_0x2c5f48){if(_0x2c5f48){_0x2f66ec[_0x6a0c('0x3f')]=_[_0x6a0c('0x41')](db[_0x6a0c('0x63')][_0x6a0c('0x3c')]);_0x2f66ec[_0x6a0c('0x40')]=_[_0x6a0c('0x41')](_0x241762[_0x6a0c('0x40')]);_0x2f66ec[_0x6a0c('0x42')]=_[_0x6a0c('0x43')](_0x2f66ec[_0x6a0c('0x3f')],_0x2f66ec[_0x6a0c('0x40')]);_0x4bb0f0['attributes']=_['intersection'](_0x2f66ec[_0x6a0c('0x3f')],qs[_0x6a0c('0x45')](_0x241762['query'][_0x6a0c('0x45')]));_0x4bb0f0[_0x6a0c('0x44')]=_0x4bb0f0[_0x6a0c('0x44')][_0x6a0c('0x56')]?_0x4bb0f0[_0x6a0c('0x44')]:_0x2f66ec[_0x6a0c('0x3f')];if(!_0x241762[_0x6a0c('0x40')][_0x6a0c('0x64')](_0x6a0c('0x65'))){_0x4bb0f0[_0x6a0c('0x2e')]=qs['limit'](_0x241762[_0x6a0c('0x40')]['limit']);_0x4bb0f0['offset']=qs[_0x6a0c('0x2c')](_0x241762['query']['offset']);}_0x4bb0f0['order']=qs['sort'](_0x241762[_0x6a0c('0x40')]['sort']);_0x4bb0f0['where']=qs['filters'](_['pick'](_0x241762[_0x6a0c('0x40')],_0x2f66ec[_0x6a0c('0x42')]));_0x4bb0f0[_0x6a0c('0x47')][_0x6a0c('0x66')]=_0x2c5f48['id'];if(_0x241762[_0x6a0c('0x40')][_0x6a0c('0x49')]){_0x4bb0f0[_0x6a0c('0x47')]=_[_0x6a0c('0x4a')](_0x4bb0f0[_0x6a0c('0x47')],{'$or':_[_0x6a0c('0x3b')](_0x4bb0f0['attributes'],function(_0x466d23){var _0x2f6268={};_0x2f6268[_0x466d23]={'$like':'%'+_0x241762['query']['filter']+'%'};return _0x2f6268;})});}_0x4bb0f0=_[_0x6a0c('0x4a')]({},_0x4bb0f0,_0x241762[_0x6a0c('0x4c')]);return db[_0x6a0c('0x63')][_0x6a0c('0x2f')]({'where':_0x4bb0f0[_0x6a0c('0x47')]})[_0x6a0c('0x1d')](function(_0x53c6a0){_0x10e4d4[_0x6a0c('0x2f')]=_0x53c6a0;if(_0x241762[_0x6a0c('0x40')][_0x6a0c('0x4e')]){_0x4bb0f0[_0x6a0c('0x4f')]=[{'all':!![]}];}return db[_0x6a0c('0x63')][_0x6a0c('0x50')](_0x4bb0f0);})[_0x6a0c('0x1d')](function(_0x50151e){_0x10e4d4[_0x6a0c('0x51')]=_0x50151e;return _0x10e4d4;});}})[_0x6a0c('0x1d')](respondWithFilteredResult(_0xc0006e,_0x4bb0f0))[_0x6a0c('0x27')](handleError(_0xc0006e,null));};exports[_0x6a0c('0x67')]=function(_0x4cd8de,_0x3295cf,_0x5359ea){return db[_0x6a0c('0x4d')][_0x6a0c('0x57')]({'where':{'id':_0x4cd8de[_0x6a0c('0x53')]['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x3295cf,null))[_0x6a0c('0x1d')](function(_0x1dbaf9){if(_0x1dbaf9){return _0x1dbaf9[_0x6a0c('0x67')](_0x4cd8de[_0x6a0c('0x40')][_0x6a0c('0x68')]);}})[_0x6a0c('0x1d')](respondWithStatusCode(_0x3295cf,null))[_0x6a0c('0x27')](handleError(_0x3295cf,null));};exports[_0x6a0c('0x69')]=function(_0x482b5f,_0x2fa4e9,_0x2c307d){if(_0x482b5f[_0x6a0c('0x59')]['id']){delete _0x482b5f[_0x6a0c('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x482b5f['params']['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x2fa4e9,null))[_0x6a0c('0x1d')](function(_0x34ef88){if(_0x34ef88){_0x482b5f['body']['SmsAccountId']=_0x34ef88['id'];return db[_0x6a0c('0x6a')][_0x6a0c('0x58')](_0x482b5f[_0x6a0c('0x59')]);}})[_0x6a0c('0x1d')](respondWithResult(_0x2fa4e9,null))['catch'](handleError(_0x2fa4e9,null));};exports[_0x6a0c('0x6b')]=function(_0x1ad8f4,_0x49d637,_0x290e97){var _0x3bae6e={'raw':![],'where':{}};var _0x7e52c9={};var _0x4798a2={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6a0c('0x62')]({'where':{'id':_0x1ad8f4[_0x6a0c('0x53')]['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x49d637,null))[_0x6a0c('0x1d')](function(_0x5adc56){if(_0x5adc56){_0x7e52c9[_0x6a0c('0x3f')]=_[_0x6a0c('0x41')](db['CannedAnswer']['rawAttributes']);_0x7e52c9['query']=_[_0x6a0c('0x41')](_0x1ad8f4[_0x6a0c('0x40')]);_0x7e52c9[_0x6a0c('0x42')]=_['intersection'](_0x7e52c9['model'],_0x7e52c9[_0x6a0c('0x40')]);_0x3bae6e[_0x6a0c('0x44')]=_[_0x6a0c('0x43')](_0x7e52c9[_0x6a0c('0x3f')],qs[_0x6a0c('0x45')](_0x1ad8f4[_0x6a0c('0x40')][_0x6a0c('0x45')]));_0x3bae6e[_0x6a0c('0x44')]=_0x3bae6e['attributes'][_0x6a0c('0x56')]?_0x3bae6e['attributes']:_0x7e52c9[_0x6a0c('0x3f')];if(!_0x1ad8f4[_0x6a0c('0x40')][_0x6a0c('0x64')](_0x6a0c('0x65'))){_0x3bae6e[_0x6a0c('0x2e')]=qs[_0x6a0c('0x2e')](_0x1ad8f4[_0x6a0c('0x40')][_0x6a0c('0x2e')]);_0x3bae6e[_0x6a0c('0x2c')]=qs[_0x6a0c('0x2c')](_0x1ad8f4[_0x6a0c('0x40')][_0x6a0c('0x2c')]);}_0x3bae6e['order']=qs[_0x6a0c('0x46')](_0x1ad8f4[_0x6a0c('0x40')][_0x6a0c('0x46')]);_0x3bae6e['where']=qs[_0x6a0c('0x42')](_[_0x6a0c('0x48')](_0x1ad8f4[_0x6a0c('0x40')],_0x7e52c9[_0x6a0c('0x42')]));_0x3bae6e[_0x6a0c('0x47')][_0x6a0c('0x66')]=_0x5adc56['id'];if(_0x1ad8f4['query'][_0x6a0c('0x49')]){_0x3bae6e[_0x6a0c('0x47')]=_[_0x6a0c('0x4a')](_0x3bae6e[_0x6a0c('0x47')],{'$or':_[_0x6a0c('0x3b')](_0x3bae6e[_0x6a0c('0x44')],function(_0xf4d1e9){var _0x2fd3b3={};_0x2fd3b3[_0xf4d1e9]={'$like':'%'+_0x1ad8f4[_0x6a0c('0x40')][_0x6a0c('0x49')]+'%'};return _0x2fd3b3;})});}_0x3bae6e=_['merge']({},_0x3bae6e,_0x1ad8f4[_0x6a0c('0x4c')]);return db[_0x6a0c('0x6a')]['count']({'where':_0x3bae6e[_0x6a0c('0x47')]})[_0x6a0c('0x1d')](function(_0x5d9b04){_0x4798a2[_0x6a0c('0x2f')]=_0x5d9b04;if(_0x1ad8f4[_0x6a0c('0x40')][_0x6a0c('0x4e')]){_0x3bae6e[_0x6a0c('0x4f')]=[{'all':!![]}];}return db[_0x6a0c('0x6a')][_0x6a0c('0x50')](_0x3bae6e);})[_0x6a0c('0x1d')](function(_0x934758){_0x4798a2[_0x6a0c('0x51')]=_0x934758;return _0x4798a2;});}})[_0x6a0c('0x1d')](respondWithFilteredResult(_0x49d637,_0x3bae6e))['catch'](handleError(_0x49d637,null));};exports[_0x6a0c('0x6c')]=function(_0x5030c7,_0x55e2e3,_0x3da48a){return db['SmsAccount'][_0x6a0c('0x57')]({'where':{'id':_0x5030c7['params']['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x55e2e3,null))[_0x6a0c('0x1d')](function(_0x427cad){if(_0x427cad){return _0x427cad[_0x6a0c('0x6c')](_0x5030c7[_0x6a0c('0x40')]['ids']);}})[_0x6a0c('0x1d')](respondWithStatusCode(_0x55e2e3,null))['catch'](handleError(_0x55e2e3,null));};exports[_0x6a0c('0x6d')]=function(_0x320396,_0x4c3dae,_0x1929ae){var _0x5cfecc={'channel':_0x6a0c('0x6e')};var _0x35bc22=[];var _0x5e875b=[];var _0x5be2f0={};return db[_0x6a0c('0x4d')][_0x6a0c('0x57')]({'where':{'id':_0x320396[_0x6a0c('0x53')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x6a0c('0x6f')}]})['then'](handleEntityNotFound(_0x4c3dae,null))[_0x6a0c('0x1d')](function(_0x1c0cf8){_0x5cfecc['account']=_0x1c0cf8;_0x5cfecc['applications']=_[_0x6a0c('0x70')](_0x1c0cf8[_0x6a0c('0x6f')],[_0x6a0c('0x71')],[_0x6a0c('0x72')]);if(_0x5cfecc[_0x6a0c('0x73')][_0x6a0c('0x6f')]){delete _0x5cfecc[_0x6a0c('0x73')][_0x6a0c('0x6f')];}return db[_0x6a0c('0x74')][_0x6a0c('0x60')]();})[_0x6a0c('0x1d')](function(_0x11e373){if(!_0x11e373){throw new db[(_0x6a0c('0x75'))]['ValidationError'](_0x6a0c('0x76'));}_0x35bc22=_[_0x6a0c('0x77')](_[_0x6a0c('0x41')](_0x11e373),[_0x6a0c('0x78'),_0x6a0c('0x79')]);_0x5e875b=_[_0x6a0c('0x77')](_[_0x6a0c('0x41')](_0x11e373),[_0x6a0c('0x78'),'updatedAt',_0x6a0c('0x7a'),'ListId']);_0x5cfecc[_0x6a0c('0x59')]={'mapKey':_0x6a0c('0x7b')};if(_0x5cfecc[_0x6a0c('0x73')][_0x6a0c('0x3e')]){switch(_0x5cfecc[_0x6a0c('0x73')][_0x6a0c('0x3e')]){case _0x6a0c('0x7c'):_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x7e')];_0x5cfecc[_0x6a0c('0x59')]['body']=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x7f')];_0x5cfecc['body'][_0x6a0c('0x80')]=_0x320396[_0x6a0c('0x59')]['MessageSid'];break;case _0x6a0c('0x81'):_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')]='+'+_0x320396[_0x6a0c('0x59')][_0x6a0c('0x82')];_0x5cfecc['body'][_0x6a0c('0x59')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x83')];break;case'connectel':_0x5cfecc['body'][_0x6a0c('0x7d')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x7d')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x59')]=_0x320396['body'][_0x6a0c('0x26')];break;case'clicksend':_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x7d')];_0x5cfecc[_0x6a0c('0x59')]['body']=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x59')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x80')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x84')];break;case _0x6a0c('0x85'):_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')]=_0x320396['body'][_0x6a0c('0x7e')];_0x5cfecc['body'][_0x6a0c('0x59')]=_0x320396['body'][_0x6a0c('0x86')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x80')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x87')];break;case _0x6a0c('0x88'):_0x5cfecc['body'][_0x6a0c('0x7d')]='+'+_0x320396['body'][_0x6a0c('0x89')][0x0][_0x6a0c('0x7d')];_0x5cfecc['body'][_0x6a0c('0x59')]=_0x320396[_0x6a0c('0x59')]['results'][0x0][_0x6a0c('0x83')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x80')]=_0x320396['body'][_0x6a0c('0x89')][0x0][_0x6a0c('0x80')];break;case _0x6a0c('0x8a'):_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')]=_0x320396['body'][_0x6a0c('0x8b')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x59')]=_0x320396[_0x6a0c('0x59')]['segmentedMessage']['message'];break;case'clickatell':_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')]=_0x320396['body']['fromNumber'];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x59')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x83')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x80')]=_0x320396['body'][_0x6a0c('0x8c')];break;case'bandwidth':_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x80')]=_0x320396[_0x6a0c('0x59')][0x0][_0x6a0c('0x26')]['id'];_0x5cfecc['body'][_0x6a0c('0x7d')]=_0x320396[_0x6a0c('0x59')][0x0][_0x6a0c('0x26')][_0x6a0c('0x7d')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x59')]=_0x320396[_0x6a0c('0x59')][0x0][_0x6a0c('0x26')][_0x6a0c('0x83')];break;case _0x6a0c('0x8d'):_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')]=_0x320396[_0x6a0c('0x59')][_0x6a0c('0x7d')];_0x5cfecc[_0x6a0c('0x59')]['body']=_0x320396['body'][_0x6a0c('0x26')];_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x80')]=_0x320396['body'][_0x6a0c('0x8e')];break;}}if(_0x5cfecc['body']['id']){delete _0x5cfecc['body']['id'];}if(_[_0x6a0c('0x8f')](_0x5cfecc[_0x6a0c('0x59')]['from'])){throw new db['Sequelize'][(_0x6a0c('0x90'))]('from\x20is\x20mandatory');}if(_[_0x6a0c('0x8f')](_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x59')])||_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x59')]===''){throw new db[(_0x6a0c('0x75'))][(_0x6a0c('0x90'))](_0x6a0c('0x91'));}if(_[_0x6a0c('0x8f')](_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x92')])){throw new db[(_0x6a0c('0x75'))][(_0x6a0c('0x90'))](_0x6a0c('0x93')+_0x5e875b);}if(!_['includes'](_0x5e875b,_0x5cfecc['body'][_0x6a0c('0x92')])){throw new db[(_0x6a0c('0x75'))][(_0x6a0c('0x90'))](_0x6a0c('0x94')+_0x5e875b);}_0x5be2f0[_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x92')]]=_0x5cfecc[_0x6a0c('0x59')]['from'];return db[_0x6a0c('0x95')][_0x6a0c('0x57')]({'where':{'id':_0x5cfecc[_0x6a0c('0x73')][_0x6a0c('0x96')]},'include':[{'model':db[_0x6a0c('0x74')],'as':_0x6a0c('0x97'),'where':_0x5be2f0,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x6a0c('0x1d')](handleEntityNotFound(_0x4c3dae,null))[_0x6a0c('0x1d')](function(_0x543569){if(_0x543569){_0x5cfecc[_0x6a0c('0x98')]=_[_0x6a0c('0x99')](_0x543569,[_0x6a0c('0x97')]);if(_0x543569['Contacts'][_0x6a0c('0x56')]){return _0x543569[_0x6a0c('0x97')][0x0];}var _0x55d46b=_[_0x6a0c('0x9a')](_0x5cfecc[_0x6a0c('0x59')],{'firstName':_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')],'ListId':_0x543569['id']});_0x55d46b[_0x5cfecc[_0x6a0c('0x59')]['mapKey']]=_0x5cfecc['body']['from'];return db[_0x6a0c('0x74')][_0x6a0c('0x58')](_0x55d46b,{'fields':_0x35bc22,'raw':!![]});}})['then'](handleEntityNotFound(_0x4c3dae,null))[_0x6a0c('0x1d')](function(_0x1d7e8d){if(_0x1d7e8d){_0x5cfecc['contact']=_0x1d7e8d;var _0x56cc68={'ContactId':_0x1d7e8d['id'],'phone':_0x5cfecc['body']['from'],'SmsAccountId':_0x320396['params']['id']};var _0x3e761b={'ContactId':_0x1d7e8d['id'],'SmsAccountId':_0x320396[_0x6a0c('0x53')]['id'],'closed':![]};return db['SmsInteraction'][_0x6a0c('0x57')]({'where':_0x3e761b})['then'](function(_0x2750e9){if(_0x2750e9){return[_0x2750e9,![]];}return db[_0x6a0c('0x9b')][_0x6a0c('0x58')](_0x56cc68)['then'](function(_0xbb306a){return[_0xbb306a,!![]];});});}})[_0x6a0c('0x9c')](function(_0x71b0ef,_0x1eb2dc){_0x5cfecc[_0x6a0c('0x9d')]=_0x71b0ef[_0x6a0c('0x34')]({'plain':!![]});_0x5cfecc[_0x6a0c('0x9d')]['created']=![];if(_0x1eb2dc){if(_0x5cfecc[_0x6a0c('0x73')][_0x6a0c('0x9e')]){_0x5cfecc[_0x6a0c('0x9f')][_0x6a0c('0xa0')]({'id':0x0,'priority':_0x5cfecc[_0x6a0c('0x9f')][_0x6a0c('0x56')]+0x1,'app':_0x6a0c('0xa1'),'appdata':_0x6a0c('0xa2'),'interval':'*,*,*,*'});}_0x5cfecc[_0x6a0c('0x9d')]['created']=!![];}return db[_0x6a0c('0xa3')][_0x6a0c('0x58')]({'phone':_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x7d')],'messageId':_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0x80')],'body':_0x5cfecc['body'][_0x6a0c('0x59')],'SmsAccountId':_0x320396['params']['id'],'SmsInteractionId':_0x71b0ef['id'],'direction':'in','ContactId':_0x71b0ef[_0x6a0c('0xa4')],'AttachmentId':_0x5cfecc[_0x6a0c('0x59')][_0x6a0c('0xa5')]});})['then'](function(_0x443750){_0x5cfecc[_0x6a0c('0x26')]=_0x443750;if(_0x5cfecc[_0x6a0c('0x9d')][_0x6a0c('0xa6')]){return db['User'][_0x6a0c('0x57')]({'attributes':['id',_0x6a0c('0x4b')],'where':{'id':_0x5cfecc['interaction'][_0x6a0c('0xa6')]}})[_0x6a0c('0x1d')](function(_0x57264f){if(_0x57264f){_0x5cfecc['applications'][_0x6a0c('0xa7')]({'id':0x0,'priority':0x0,'app':_0x6a0c('0xa8'),'appdata':_0x57264f[_0x6a0c('0x4b')]+','+(_0x5cfecc[_0x6a0c('0x73')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6a0c('0xa9'),_0x6a0c('0xaa'),_0x5cfecc);});}return respondWithRpcPromise(_0x6a0c('0xa9'),_0x6a0c('0xaa'),_0x5cfecc);})[_0x6a0c('0x1d')](function(_0x5c8cbd){if(_0x5c8cbd){var _0x220b8e=0xc8;var _0x3fbeed=_0x6a0c('0xab');logger[_0x6a0c('0x1e')](_0x6a0c('0x22'),_0x3fbeed,_0x220b8e,'entity\x20found');logger[_0x6a0c('0x21')](_0x6a0c('0xac'),_0x3fbeed,_0x220b8e,_0x6a0c('0xad'),JSON[_0x6a0c('0x23')](_0x5c8cbd));if(_0x5cfecc[_0x6a0c('0x73')]['type']==='twilio'){return _0x4c3dae['status'](_0x220b8e)['set']('Content-Type','text/xml')[_0x6a0c('0x39')]('\x0a');}else{return _0x4c3dae['status'](_0x220b8e)[_0x6a0c('0x2b')](_0x5c8cbd);}}})['catch'](handleError(_0x4c3dae,null));};exports['addApplications']=function(_0x2f2b91,_0x142f72){var _0x3d4024=_0x2f2b91['params']['id'];var _0x30f7cd=_0x2f2b91[_0x6a0c('0x59')];var _0x5c1a13=0xc8;var _0x40a322=null;return db[_0x6a0c('0xae')][_0x6a0c('0xaf')]({'isolationLevel':db[_0x6a0c('0xae')]['Transaction'][_0x6a0c('0xb0')][_0x6a0c('0xb1')]},function(_0x1fd3d4){return db['SmsAccount'][_0x6a0c('0x62')]({'where':{'id':_0x3d4024},'transaction':_0x1fd3d4})[_0x6a0c('0x1d')](function(_0x4bed85){if(_0x4bed85){return db[_0x6a0c('0xb2')][_0x6a0c('0x37')]({'where':{'SmsAccountId':_0x3d4024},'transaction':_0x1fd3d4})[_0x6a0c('0x1d')](function(){var _0x3d45b3=_[_0x6a0c('0x3b')](_0x30f7cd,function(_0x44a27a){_0x44a27a[_0x6a0c('0x66')]=_0x3d4024;return _0x44a27a;});return db['SmsApplication']['bulkCreate'](_0x3d45b3,{'transaction':_0x1fd3d4});});}else{_0x5c1a13=0x194;_0x40a322=[];}});})['then'](function(){if(_0x5c1a13!==0x194){return db[_0x6a0c('0xb2')][_0x6a0c('0xb3')]({'where':{'SmsAccountId':_0x3d4024},'order':'priority'})['then'](function(_0x38a817){_0x40a322=_0x38a817;});}})[_0x6a0c('0x27')](function(_0x409ab3){_0x5c1a13=0x1f4;logger['error'](_0x409ab3[_0x6a0c('0x38')]);if(_0x409ab3[_0x6a0c('0x4b')]){delete _0x409ab3[_0x6a0c('0x4b')];}_0x40a322=_0x409ab3;})['finally'](function(){if(_0x40a322===null){_0x142f72[_0x6a0c('0x28')](_0x5c1a13);}else{if(_0x5c1a13===0x1f4){_0x142f72[_0x6a0c('0x2a')](_0x5c1a13)['send'](_0x40a322);}else{_0x142f72['status'](_0x5c1a13)['json'](_0x40a322);}}});};exports[_0x6a0c('0xb4')]=function(_0x2018e9,_0xed17f5,_0x5a715b){var _0x13eefc={};var _0x38da28={};var _0x311506;var _0x2911a1;return db[_0x6a0c('0x4d')][_0x6a0c('0x62')]({'where':{'id':_0x2018e9['params']['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0xed17f5,null))['then'](function(_0x2efe38){if(_0x2efe38){_0x311506=_0x2efe38;_0x38da28[_0x6a0c('0x3f')]=_[_0x6a0c('0x41')](db['SmsApplication'][_0x6a0c('0x3c')]);_0x38da28[_0x6a0c('0x40')]=_[_0x6a0c('0x41')](_0x2018e9[_0x6a0c('0x40')]);_0x38da28[_0x6a0c('0x42')]=_['intersection'](_0x38da28[_0x6a0c('0x3f')],_0x38da28[_0x6a0c('0x40')]);_0x13eefc['attributes']=_['intersection'](_0x38da28[_0x6a0c('0x3f')],qs[_0x6a0c('0x45')](_0x2018e9[_0x6a0c('0x40')][_0x6a0c('0x45')]));_0x13eefc[_0x6a0c('0x44')]=_0x13eefc['attributes'][_0x6a0c('0x56')]?_0x13eefc[_0x6a0c('0x44')]:_0x38da28[_0x6a0c('0x3f')];_0x13eefc['order']=qs[_0x6a0c('0x46')](_0x2018e9[_0x6a0c('0x40')][_0x6a0c('0x46')]);_0x13eefc[_0x6a0c('0x47')]=qs[_0x6a0c('0x42')](_['pick'](_0x2018e9['query'],_0x38da28[_0x6a0c('0x42')]));if(_0x2018e9[_0x6a0c('0x40')][_0x6a0c('0x49')]){_0x13eefc[_0x6a0c('0x47')]=_[_0x6a0c('0x4a')](_0x13eefc[_0x6a0c('0x47')],{'$or':_['map'](_0x13eefc[_0x6a0c('0x44')],function(_0x51bffb){var _0x202b12={};_0x202b12[_0x51bffb]={'$like':'%'+_0x2018e9['query'][_0x6a0c('0x49')]+'%'};return _0x202b12;})});}_0x13eefc=_[_0x6a0c('0x4a')]({},_0x13eefc,_0x2018e9['options']);return _0x311506[_0x6a0c('0xb4')](_0x13eefc);}})[_0x6a0c('0x1d')](function(_0x27b743){if(_0x27b743){_0x2911a1=_0x27b743[_0x6a0c('0x56')];if(!_0x2018e9['query'][_0x6a0c('0x64')](_0x6a0c('0x65'))){_0x13eefc[_0x6a0c('0x2e')]=qs['limit'](_0x2018e9[_0x6a0c('0x40')][_0x6a0c('0x2e')]);_0x13eefc[_0x6a0c('0x2c')]=qs[_0x6a0c('0x2c')](_0x2018e9['query'][_0x6a0c('0x2c')]);}return _0x311506[_0x6a0c('0xb4')](_0x13eefc);}})[_0x6a0c('0x1d')](function(_0x4adc3a){if(_0x4adc3a){return _0x4adc3a?{'count':_0x2911a1,'rows':_0x4adc3a}:null;}})['then'](respondWithResult(_0xed17f5,null))[_0x6a0c('0x27')](handleError(_0xed17f5,null));};exports['getInteractions']=function(_0x2f7822,_0x2845b0,_0x5e5a52){var _0x19edb2={'raw':![],'where':{}};var _0x54e97c={};var _0x33339a={'count':0x0,'rows':[]};return db[_0x6a0c('0x4d')][_0x6a0c('0x62')]({'where':{'id':_0x2f7822[_0x6a0c('0x53')]['id']}})['then'](handleEntityNotFound(_0x2845b0,null))[_0x6a0c('0x1d')](function(_0x424f03){if(_0x424f03){_0x54e97c[_0x6a0c('0x3f')]=_['keys'](db[_0x6a0c('0x9b')][_0x6a0c('0x3c')]);_0x54e97c[_0x6a0c('0x40')]=_[_0x6a0c('0x41')](_0x2f7822[_0x6a0c('0x40')]);_0x54e97c['filters']=_['intersection'](_0x54e97c[_0x6a0c('0x3f')],_0x54e97c[_0x6a0c('0x40')]);_0x19edb2[_0x6a0c('0x44')]=_[_0x6a0c('0x43')](_0x54e97c[_0x6a0c('0x3f')],qs[_0x6a0c('0x45')](_0x2f7822[_0x6a0c('0x40')][_0x6a0c('0x45')]));_0x19edb2['attributes']=_0x19edb2[_0x6a0c('0x44')]['length']?_0x19edb2[_0x6a0c('0x44')]:_0x54e97c['model'];if(!_0x2f7822[_0x6a0c('0x40')]['hasOwnProperty'](_0x6a0c('0x65'))){_0x19edb2[_0x6a0c('0x2e')]=qs[_0x6a0c('0x2e')](_0x2f7822['query'][_0x6a0c('0x2e')]);_0x19edb2[_0x6a0c('0x2c')]=qs[_0x6a0c('0x2c')](_0x2f7822[_0x6a0c('0x40')][_0x6a0c('0x2c')]);}_0x19edb2[_0x6a0c('0xb5')]=qs[_0x6a0c('0x46')](_0x2f7822[_0x6a0c('0x40')][_0x6a0c('0x46')]);_0x19edb2[_0x6a0c('0x47')]=qs[_0x6a0c('0x42')](_[_0x6a0c('0x48')](_0x2f7822['query'],_0x54e97c[_0x6a0c('0x42')]));_0x19edb2[_0x6a0c('0x47')]['SmsAccountId']=_0x424f03['id'];if(_0x2f7822[_0x6a0c('0x40')][_0x6a0c('0x49')]){_0x19edb2[_0x6a0c('0x47')]=_[_0x6a0c('0x4a')](_0x19edb2[_0x6a0c('0x47')],{'$or':_[_0x6a0c('0x3b')](_0x19edb2[_0x6a0c('0x44')],function(_0x278bd5){var _0x40d330={};_0x40d330[_0x278bd5]={'$like':'%'+_0x2f7822[_0x6a0c('0x40')]['filter']+'%'};return _0x40d330;})});}_0x19edb2=_[_0x6a0c('0x4a')]({},_0x19edb2,_0x2f7822[_0x6a0c('0x4c')]);return db[_0x6a0c('0x9b')][_0x6a0c('0x2f')]({'where':_0x19edb2[_0x6a0c('0x47')]})[_0x6a0c('0x1d')](function(_0x25cc09){_0x33339a[_0x6a0c('0x2f')]=_0x25cc09;if(_0x2f7822[_0x6a0c('0x40')]['includeAll']){_0x19edb2[_0x6a0c('0x4f')]=[{'model':db[_0x6a0c('0x74')],'as':_0x6a0c('0xb6'),'required':![]},{'model':db[_0x6a0c('0xb7')],'as':_0x6a0c('0xb8'),'attributes':[_0x6a0c('0x4b'),_0x6a0c('0xb9'),_0x6a0c('0xba')],'required':![]},{'model':db[_0x6a0c('0xbb')],'as':_0x6a0c('0xbc'),'attributes':['id',_0x6a0c('0x4b'),_0x6a0c('0xbd')],'where':_0x2f7822['query'][_0x6a0c('0xbe')]?{'id':_0x2f7822[_0x6a0c('0x40')][_0x6a0c('0xbe')]}:undefined,'required':_0x2f7822[_0x6a0c('0x40')][_0x6a0c('0xbe')]?!![]:![]}];}return db[_0x6a0c('0x9b')][_0x6a0c('0x50')](_0x19edb2);})[_0x6a0c('0x1d')](function(_0x411c2d){_0x33339a[_0x6a0c('0x51')]=_0x411c2d;return _0x33339a;});}})[_0x6a0c('0x1d')](respondWithFilteredResult(_0x2845b0,_0x19edb2))['catch'](handleError(_0x2845b0,null));};exports[_0x6a0c('0x39')]=function(_0x5c15d4,_0x2ec1f8,_0xad988d){var _0x16e82c,_0x2ddb0b,_0x425ad6;if(_[_0x6a0c('0x8f')](_0x5c15d4[_0x6a0c('0x59')][_0x6a0c('0x59')])||_0x5c15d4['body'][_0x6a0c('0x59')]===''){throw new db[(_0x6a0c('0x75'))][(_0x6a0c('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5c15d4[_0x6a0c('0x59')]['to'])){throw new db[(_0x6a0c('0x75'))]['ValidationError']('to\x20is\x20mandatory');}_0x16e82c=_0x5c15d4[_0x6a0c('0x59')]['to'];return db['SmsAccount'][_0x6a0c('0x57')]({'where':{'id':_0x5c15d4[_0x6a0c('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6a0c('0x74')],'as':_0x6a0c('0x97'),'where':{'mobile':_0x16e82c},'limit':0x1,'order':[['updatedAt',_0x6a0c('0xbf')]]}]}]})[_0x6a0c('0x1d')](handleEntityNotFound(_0x2ec1f8,null))[_0x6a0c('0x1d')](function(_0x246caa){if(_0x246caa&&_0x246caa[_0x6a0c('0xc0')]){_0x2ddb0b=_0x246caa[_0x6a0c('0x34')]({'plain':!![]});if(_0x2ddb0b[_0x6a0c('0xc0')]&&_0x2ddb0b['List']['Contacts']['length']){return _0x2ddb0b['List'][_0x6a0c('0x97')][0x0];}return db['CmContact'][_0x6a0c('0x58')](_[_0x6a0c('0x9a')](_0x5c15d4['body'],{'firstName':_0x16e82c,'mobile':_0x16e82c,'phone':_0x16e82c,'ListId':_0x2ddb0b[_0x6a0c('0x96')]}));}})['then'](handleEntityNotFound(_0x2ec1f8,null))[_0x6a0c('0x1d')](function(_0x2090ed){if(_0x2090ed){_0x425ad6=_0x2090ed;return db[_0x6a0c('0x9b')][_0x6a0c('0x57')]({'where':{'ContactId':_0x425ad6['id'],'closed':![],'SmsAccountId':_0x2ddb0b['id']}})['then'](function(_0x8673e4){if(_0x8673e4){return[_0x8673e4,![]];}return db[_0x6a0c('0x9b')][_0x6a0c('0x58')]({'UserId':_0x5c15d4[_0x6a0c('0x5a')]['id'],'ContactId':_0x425ad6['id'],'SmsAccountId':_0x2ddb0b['id'],'phone':_0x16e82c,'firstMsgDirection':_0x6a0c('0xc1'),'Messages':[_['merge'](_0x5c15d4[_0x6a0c('0x59')],{'read':![],'body':_0x5c15d4['body']['body'],'phone':_0x16e82c,'SmsAccountId':_0x2ddb0b['id'],'UserId':_0x5c15d4[_0x6a0c('0x5a')]['id'],'ContactId':_0x425ad6['id']})]},{'include':[{'model':db[_0x6a0c('0xa3')],'as':_0x6a0c('0xc2')}]})[_0x6a0c('0x1d')](function(_0x510274){return[_0x510274,!![]];});});}})[_0x6a0c('0x9c')](function(_0x5bef45,_0x2a99d5){if(_0x2a99d5){return _0x5bef45;}return db[_0x6a0c('0xa3')]['create'](_[_0x6a0c('0x4a')](_0x5c15d4[_0x6a0c('0x59')],{'read':![],'body':_0x5c15d4[_0x6a0c('0x59')][_0x6a0c('0x59')],'phone':_0x16e82c,'SmsAccountId':_0x2ddb0b['id'],'SmsInteractionId':_0x5bef45['id'],'UserId':_0x5c15d4[_0x6a0c('0x5a')]['id'],'ContactId':_0x425ad6['id']}))[_0x6a0c('0x1d')](function(_0x4bc3af){_0x5bef45[_0x6a0c('0xc3')][_0x6a0c('0xc2')]=[];_0x5bef45[_0x6a0c('0xc3')]['Messages'][_0x6a0c('0xa0')](_0x4bc3af['dataValues']);return _0x5bef45;});})['then'](respondWithResult(_0x2ec1f8,null))['catch'](handleError(_0x2ec1f8,null));};exports[_0x6a0c('0x2a')]=function(_0x1c2e23,_0x54397c,_0x750f99){if(_0x1c2e23[_0x6a0c('0x59')]['id']){delete _0x1c2e23[_0x6a0c('0x59')]['id'];}var _0x5856a5,_0x33bb33,_0x37f6c4;return db[_0x6a0c('0x4d')][_0x6a0c('0x57')]({'where':{'id':_0x1c2e23[_0x6a0c('0x53')]['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x54397c,null))[_0x6a0c('0x1d')](function(_0x492397){if(_0x492397){_0x37f6c4=_0x492397;logger['debug'](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0xc4'),_0x492397[_0x6a0c('0x3e')],util[_0x6a0c('0xc5')](_0x1c2e23[_0x6a0c('0x59')],{'showHidden':![],'depth':null}));switch(_0x492397[_0x6a0c('0x3e')]){case'skebby':if(_0x1c2e23[_0x6a0c('0x59')]['skebby_dispatch_id']&&_0x1c2e23[_0x6a0c('0x59')]['status']){_0x33bb33=_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x2a')];return db[_0x6a0c('0xa3')][_0x6a0c('0x57')]({'where':{'messageId':_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0xc6')]}});}break;case _0x6a0c('0xc7'):if(_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0xc8')]&&_0x1c2e23[_0x6a0c('0x59')]['statusInt']){_0x33bb33=_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0xc9')];return db[_0x6a0c('0xa3')][_0x6a0c('0x57')]({'where':{'messageId':_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0xc8')]}});}break;case _0x6a0c('0xca'):if(_0x1c2e23['body'][_0x6a0c('0x84')]&&_0x1c2e23[_0x6a0c('0x59')]['status_code']){_0x33bb33=_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0xcb')];return db[_0x6a0c('0xa3')][_0x6a0c('0x57')]({'where':{'messageId':_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x84')]}});}break;case'infobip':var _0x5e6443=_0x1c2e23['body'][_0x6a0c('0x89')][0x0];if(_0x5e6443['messageId']&&_0x5e6443[_0x6a0c('0x2a')]['groupName']==='DELIVERED'){_0x33bb33=_0x5e6443[_0x6a0c('0x2a')][_0x6a0c('0xcc')];return db['SmsMessage'][_0x6a0c('0x57')]({'where':{'messageId':_0x5e6443[_0x6a0c('0x80')]}});}break;case'clickatell':if(_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x80')]&&_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x2a')]){_0x33bb33=_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x2a')];return db[_0x6a0c('0xa3')][_0x6a0c('0x57')]({'where':{'messageId':_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x80')]}});}break;case'bandwidth':if(_0x1c2e23['body'][0x0][_0x6a0c('0x26')]['id']){_0x33bb33=_0x1c2e23[_0x6a0c('0x59')][0x0]['type'];return db[_0x6a0c('0xa3')]['find']({'where':{'messageId':_0x1c2e23['body'][0x0]['message']['id']}});}break;case _0x6a0c('0x8d'):if(_0x1c2e23['body'][_0x6a0c('0xcd')]&&_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x2a')]){_0x33bb33=_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x2a')];return db[_0x6a0c('0xa3')][_0x6a0c('0x57')]({'where':{'messageId':_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0xcd')]}});}break;}}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x54397c,null))['then'](function(_0x4ed94f){if(_0x4ed94f){_0x5856a5=_0x4ed94f;switch(_0x37f6c4[_0x6a0c('0x3e')]){case _0x6a0c('0x81'):if(_0x33bb33==='DELIVERED'){return _0x5856a5['update']({'read':!![]});}else{logger[_0x6a0c('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6a0c('0x2a'),_0x6a0c('0x81'),util['inspect'](_0x1c2e23[_0x6a0c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x6a0c('0xc7'):if(_0x33bb33==='1'){return _0x5856a5[_0x6a0c('0x5f')]({'read':!![]});}else{logger[_0x6a0c('0x24')](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0x81'),util[_0x6a0c('0xc5')](_0x1c2e23[_0x6a0c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x6a0c('0xca'):if(!_0x1c2e23['body'][_0x6a0c('0xce')]&&_0x33bb33>=0xc8&&_0x33bb33<=0xce){return _0x5856a5[_0x6a0c('0x5f')]({'read':!![]});}else{logger[_0x6a0c('0x24')](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0xca'),util[_0x6a0c('0xc5')](_0x1c2e23['body'],{'showHidden':![],'depth':null}));}break;case _0x6a0c('0x88'):var _0x2b1065=_0x1c2e23[_0x6a0c('0x59')][_0x6a0c('0x89')][0x0];if(_0x2b1065[_0x6a0c('0x2a')][_0x6a0c('0xcc')]===_0x6a0c('0xcf')){return _0x5856a5[_0x6a0c('0x5f')]({'read':!![]});}else{logger['error'](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0x88'),util[_0x6a0c('0xc5')](_0x1c2e23[_0x6a0c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x6a0c('0xd0'):if(_0x33bb33==_0x6a0c('0xd1')||_0x33bb33==_0x6a0c('0xd2')){return _0x5856a5[_0x6a0c('0x5f')]({'read':!![]});}else{logger[_0x6a0c('0x24')](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0xd0'),util[_0x6a0c('0xc5')](_0x1c2e23['body'],{'showHidden':![],'depth':null}));}break;case _0x6a0c('0xd3'):if(_0x33bb33==_0x6a0c('0xd4')){return _0x5856a5[_0x6a0c('0x5f')]({'read':!![]});}else{logger[_0x6a0c('0x24')](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0xd3'),util[_0x6a0c('0xc5')](_0x1c2e23[_0x6a0c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x6a0c('0x8d'):if(_0x33bb33==='DELIVRD'||_0x33bb33==='ACCEPTD'){return _0x5856a5['update']({'read':!![]});}else{logger[_0x6a0c('0x24')](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0x8d'),util['inspect'](_0x1c2e23[_0x6a0c('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x5856a5;}})['then'](respondWithResult(_0x54397c,null))[_0x6a0c('0x27')](handleError(_0x54397c,null));};exports[_0x6a0c('0xd5')]=function(_0x33a686,_0x3a9720,_0x322ad4){var _0x3b88f2,_0x2ffa39,_0x1dcf84;return db[_0x6a0c('0x4d')]['find']({'where':{'id':_0x33a686[_0x6a0c('0x53')]['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x3a9720,null))[_0x6a0c('0x1d')](function(_0x29fa0b){if(_0x29fa0b){_0x1dcf84=_0x29fa0b;logger[_0x6a0c('0x21')](_0x6a0c('0x22'),_0x6a0c('0x2a'),_0x6a0c('0xc4'),_0x29fa0b['type'],util[_0x6a0c('0xc5')](_0x33a686['query'],{'showHidden':![],'depth':null}));switch(_0x29fa0b['type']){case _0x6a0c('0x8a'):if(_0x33a686['query'][_0x6a0c('0xd6')]&&_0x33a686[_0x6a0c('0x40')][_0x6a0c('0xd7')]){_0x2ffa39=_0x33a686[_0x6a0c('0x40')]['state'];return db[_0x6a0c('0xa3')]['find']({'where':{'messageId':_0x33a686[_0x6a0c('0x40')][_0x6a0c('0xd6')]}});}break;}}})['then'](handleEntityNotFound(_0x3a9720,null))[_0x6a0c('0x1d')](function(_0x494fd3){if(_0x494fd3){_0x3b88f2=_0x494fd3;switch(_0x1dcf84[_0x6a0c('0x3e')]){case _0x6a0c('0x8a'):if(_0x2ffa39==='2'||_0x2ffa39==='6'){return _0x3b88f2[_0x6a0c('0x5f')]({'read':!![]});}else{logger[_0x6a0c('0x24')](_0x6a0c('0x22'),'status',_0x6a0c('0x8a'),util[_0x6a0c('0xc5')](_0x33a686[_0x6a0c('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x3b88f2;}})[_0x6a0c('0x1d')](respondWithResult(_0x3a9720,null))[_0x6a0c('0x27')](handleError(_0x3a9720,null));};exports[_0x6a0c('0xd8')]=function(_0x48f35c,_0x11a097,_0x1bd929){return db['SmsAccount'][_0x6a0c('0x57')]({'where':{'id':_0x48f35c['params']['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x11a097,null))[_0x6a0c('0x1d')](function(_0x92441f){if(_0x92441f){return _0x92441f['addAgents'](_0x48f35c[_0x6a0c('0x59')][_0x6a0c('0x68')],_[_0x6a0c('0x99')](_0x48f35c[_0x6a0c('0x59')],['ids','id'])||{})[_0x6a0c('0x9c')](function(_0xa63cb6){for(var _0x12f855=0x0;_0x12f855<_0x48f35c[_0x6a0c('0x59')][_0x6a0c('0x68')]['length'];_0x12f855+=0x1){socket['emit'](_0x6a0c('0xd9'),{'UserId':Number(_0x48f35c[_0x6a0c('0x59')][_0x6a0c('0x68')][_0x12f855]),'SmsAccountId':Number(_0x48f35c['params']['id'])});}return _0xa63cb6;});}})[_0x6a0c('0x1d')](respondWithResult(_0x11a097,null))['catch'](handleError(_0x11a097,null));};exports[_0x6a0c('0xda')]=function(_0x40269e,_0x5a44d6,_0x159ca4){return db[_0x6a0c('0x4d')]['find']({'where':{'id':_0x40269e[_0x6a0c('0x53')]['id']}})[_0x6a0c('0x1d')](handleEntityNotFound(_0x5a44d6,null))['then'](function(_0x136e1c){if(_0x136e1c){return _0x136e1c['removeAgents'](_0x40269e[_0x6a0c('0x40')][_0x6a0c('0x68')])[_0x6a0c('0x1d')](function(){if(_[_0x6a0c('0xdb')](_0x40269e[_0x6a0c('0x40')][_0x6a0c('0x68')])){for(var _0xdd0f02=0x0;_0xdd0f02<_0x40269e[_0x6a0c('0x40')][_0x6a0c('0x68')][_0x6a0c('0x56')];_0xdd0f02+=0x1){socket['emit'](_0x6a0c('0xdc'),{'UserId':Number(_0x40269e[_0x6a0c('0x40')][_0x6a0c('0x68')][_0xdd0f02]),'SmsAccountId':Number(_0x40269e[_0x6a0c('0x53')]['id'])});}}else{socket[_0x6a0c('0xdd')](_0x6a0c('0xdc'),{'UserId':Number(_0x40269e[_0x6a0c('0x40')]['ids']),'SmsAccountId':Number(_0x40269e[_0x6a0c('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a44d6,null))[_0x6a0c('0x27')](handleError(_0x5a44d6,null));};exports['getAgents']=function(_0x4f1083,_0x3cd385,_0x375e2c){var _0x8191a0={};var _0x4da351={};var _0x49d549;var _0x572b20;return db[_0x6a0c('0x4d')][_0x6a0c('0x62')]({'where':{'id':_0x4f1083[_0x6a0c('0x53')]['id']}})['then'](handleEntityNotFound(_0x3cd385,null))['then'](function(_0x13ab40){if(_0x13ab40){_0x49d549=_0x13ab40;_0x4da351[_0x6a0c('0x3f')]=_[_0x6a0c('0x41')](db[_0x6a0c('0xb7')][_0x6a0c('0x3c')]);_0x4da351[_0x6a0c('0x40')]=_[_0x6a0c('0x41')](_0x4f1083[_0x6a0c('0x40')]);_0x4da351['filters']=_[_0x6a0c('0x43')](_0x4da351[_0x6a0c('0x3f')],_0x4da351[_0x6a0c('0x40')]);_0x8191a0[_0x6a0c('0x44')]=_[_0x6a0c('0x43')](_0x4da351[_0x6a0c('0x3f')],qs['fields'](_0x4f1083[_0x6a0c('0x40')]['fields']));_0x8191a0[_0x6a0c('0x44')]=_0x8191a0['attributes'][_0x6a0c('0x56')]?_0x8191a0[_0x6a0c('0x44')]:_0x4da351[_0x6a0c('0x3f')];_0x8191a0[_0x6a0c('0xb5')]=qs[_0x6a0c('0x46')](_0x4f1083['query']['sort']);_0x8191a0[_0x6a0c('0x47')]=qs['filters'](_['pick'](_0x4f1083[_0x6a0c('0x40')],_0x4da351[_0x6a0c('0x42')]));if(_0x4f1083['query'][_0x6a0c('0x49')]){_0x8191a0[_0x6a0c('0x47')]=_[_0x6a0c('0x4a')](_0x8191a0[_0x6a0c('0x47')],{'$or':_[_0x6a0c('0x3b')](_0x8191a0[_0x6a0c('0x44')],function(_0x2839f1){var _0x4cefc0={};_0x4cefc0[_0x2839f1]={'$like':'%'+_0x4f1083[_0x6a0c('0x40')][_0x6a0c('0x49')]+'%'};return _0x4cefc0;})});}_0x8191a0=_[_0x6a0c('0x4a')]({},_0x8191a0,_0x4f1083['options']);return _0x49d549['getAgents'](_0x8191a0);}})[_0x6a0c('0x1d')](function(_0x243265){if(_0x243265){_0x572b20=_0x243265[_0x6a0c('0x56')];if(!_0x4f1083[_0x6a0c('0x40')]['hasOwnProperty'](_0x6a0c('0x65'))){_0x8191a0[_0x6a0c('0x2e')]=qs[_0x6a0c('0x2e')](_0x4f1083[_0x6a0c('0x40')][_0x6a0c('0x2e')]);_0x8191a0[_0x6a0c('0x2c')]=qs['offset'](_0x4f1083[_0x6a0c('0x40')][_0x6a0c('0x2c')]);}return _0x49d549[_0x6a0c('0xde')](_0x8191a0);}})[_0x6a0c('0x1d')](function(_0x3dc62b){if(_0x3dc62b){return _0x3dc62b?{'count':_0x572b20,'rows':_0x3dc62b}:null;}})[_0x6a0c('0x1d')](respondWithResult(_0x3cd385,null))[_0x6a0c('0x27')](handleError(_0x3cd385,null));}; \ No newline at end of file +var _0xb8f1=['inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','client','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','findOne','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','getAnswers','map','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','Text','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','sequelize','READ_COMMITTED','priority','finally','getApplications','Contact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','Messages','dataValues'];(function(_0x1b28dc,_0x374168){var _0x43abe8=function(_0x1a380e){while(--_0x1a380e){_0x1b28dc['push'](_0x1b28dc['shift']());}};_0x43abe8(++_0x374168);}(_0xb8f1,0xf4));var _0x1b8f=function(_0x43f6a0,_0xe9102c){_0x43f6a0=_0x43f6a0-0x0;var _0x58a774=_0xb8f1[_0x43f6a0];return _0x58a774;};'use strict';var emlformat=require(_0x1b8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1b8f('0x1'));var rp=require(_0x1b8f('0x2'));var moment=require(_0x1b8f('0x3'));var BPromise=require(_0x1b8f('0x4'));var Mustache=require(_0x1b8f('0x5'));var util=require(_0x1b8f('0x6'));var path=require(_0x1b8f('0x7'));var sox=require('sox');var csv=require(_0x1b8f('0x8'));var ejs=require(_0x1b8f('0x9'));var fs=require('fs');var fs_extra=require(_0x1b8f('0xa'));var _=require(_0x1b8f('0xb'));var squel=require('squel');var crypto=require(_0x1b8f('0xc'));var jsforce=require(_0x1b8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1b8f('0x8'));var querystring=require(_0x1b8f('0xe'));var Papa=require(_0x1b8f('0xf'));var Redis=require(_0x1b8f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1b8f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b8f('0x12'));var logger=require(_0x1b8f('0x13'))('api');var utils=require(_0x1b8f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b8f('0x15'))['db'];config['redis']=_['defaults'](config[_0x1b8f('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b8f('0x17'))(new Redis(config[_0x1b8f('0x16')]));require(_0x1b8f('0x18'))[_0x1b8f('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1b8f('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x458c6d,_0x307ef7,_0x30cbca,_0x9a8f1d){return new BPromise(function(_0x5ef629,_0x44a825){var _0x247c02=_0x9a8f1d||client;return _0x247c02['request'](_0x458c6d,_0x30cbca)['then'](function(_0x490f5b){logger[_0x1b8f('0x1b')](_0x1b8f('0x1c'),_0x307ef7,_0x1b8f('0x1d'));logger[_0x1b8f('0x1e')](_0x1b8f('0x1f'),_0x307ef7,_0x1b8f('0x1d'),JSON[_0x1b8f('0x20')](_0x490f5b));if(_0x490f5b[_0x1b8f('0x21')]){if(_0x490f5b[_0x1b8f('0x21')][_0x1b8f('0x22')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x307ef7,_0x490f5b[_0x1b8f('0x21')][_0x1b8f('0x23')]);return _0x44a825(_0x490f5b['error'][_0x1b8f('0x23')]);}logger['error'](_0x1b8f('0x1c'),_0x307ef7,_0x490f5b[_0x1b8f('0x21')][_0x1b8f('0x23')]);return _0x5ef629(_0x490f5b[_0x1b8f('0x21')]['message']);}else{logger['info'](_0x1b8f('0x1c'),_0x307ef7,_0x1b8f('0x1d'));_0x5ef629(_0x490f5b['result'][_0x1b8f('0x23')]);}})[_0x1b8f('0x24')](function(_0x35c9eb){logger[_0x1b8f('0x21')](_0x1b8f('0x1c'),_0x307ef7,_0x35c9eb);_0x44a825(_0x35c9eb);});});}function respondWithStatusCode(_0x2ebe08,_0x53de86){_0x53de86=_0x53de86||0xcc;return function(_0x55269b){if(_0x55269b){return _0x2ebe08['sendStatus'](_0x53de86);}return _0x2ebe08['status'](_0x53de86)[_0x1b8f('0x25')]();};}function respondWithResult(_0x50c4fb,_0x23beeb){_0x23beeb=_0x23beeb||0xc8;return function(_0x4aa4a1){if(_0x4aa4a1){return _0x50c4fb[_0x1b8f('0x26')](_0x23beeb)[_0x1b8f('0x27')](_0x4aa4a1);}};}function respondWithFilteredResult(_0x3ee7e8,_0x574bc1){return function(_0x51f49a){if(_0x51f49a){var _0x1be9ec=typeof _0x574bc1[_0x1b8f('0x28')]===_0x1b8f('0x29')&&typeof _0x574bc1[_0x1b8f('0x2a')]===_0x1b8f('0x29');var _0x223560=_0x51f49a['count'];var _0x1f6cf2=_0x1be9ec?0x0:_0x574bc1[_0x1b8f('0x28')];var _0x1c01f3=_0x1be9ec?_0x51f49a[_0x1b8f('0x2b')]:_0x574bc1[_0x1b8f('0x28')]+_0x574bc1[_0x1b8f('0x2a')];var _0x377c32;if(_0x1c01f3>=_0x223560){_0x1c01f3=_0x223560;_0x377c32=0xc8;}else{_0x377c32=0xce;}_0x3ee7e8[_0x1b8f('0x26')](_0x377c32);return _0x3ee7e8[_0x1b8f('0x2c')]('Content-Range',_0x1f6cf2+'-'+_0x1c01f3+'/'+_0x223560)[_0x1b8f('0x27')](_0x51f49a);}return null;};}function patchUpdates(_0x28a4f6){return function(_0x4aa829){try{jsonpatch[_0x1b8f('0x2d')](_0x4aa829,_0x28a4f6,!![]);}catch(_0x25045e){return BPromise[_0x1b8f('0x2e')](_0x25045e);}return _0x4aa829[_0x1b8f('0x2f')]();};}function saveUpdates(_0x69414e,_0x42658e){return function(_0x18e526){if(_0x18e526){return _0x18e526[_0x1b8f('0x30')](_0x69414e)[_0x1b8f('0x31')](function(_0x19c8e1){return _0x19c8e1;});}return null;};}function removeEntity(_0x47756d,_0x2dd65d){return function(_0x4332b0){if(_0x4332b0){return _0x4332b0[_0x1b8f('0x32')]()[_0x1b8f('0x31')](function(){var _0x41baf3=_0x4332b0[_0x1b8f('0x33')]({'plain':!![]});var _0x400b9f=_0x1b8f('0x34');return db[_0x1b8f('0x35')]['destroy']({'where':{'type':_0x400b9f,'resourceId':_0x41baf3['id']}})[_0x1b8f('0x31')](function(){return _0x4332b0;});})[_0x1b8f('0x31')](function(){_0x47756d[_0x1b8f('0x26')](0xcc)[_0x1b8f('0x25')]();});}};}function handleEntityNotFound(_0x3831db,_0xfeb3e4){return function(_0x4a80e8){if(!_0x4a80e8){_0x3831db[_0x1b8f('0x36')](0x194);}return _0x4a80e8;};}function handleError(_0xe3741,_0x1bf1da){_0x1bf1da=_0x1bf1da||0x1f4;return function(_0xe22fc4){logger['error'](_0xe22fc4['stack']);if(_0xe22fc4['name']){delete _0xe22fc4[_0x1b8f('0x37')];}_0xe3741[_0x1b8f('0x26')](_0x1bf1da)[_0x1b8f('0x38')](_0xe22fc4);};}exports[_0x1b8f('0x39')]=function(_0x396efc,_0x58a329){var _0x4aa84d={'include':[{'model':db[_0x1b8f('0x3a')],'as':_0x1b8f('0x3b')}]},_0x51b99a={},_0x136780={'count':0x0,'rows':[]};var _0x173d73=_['map'](db[_0x1b8f('0x3c')][_0x1b8f('0x3d')],function(_0xf18909){return{'name':_0xf18909['fieldName'],'type':_0xf18909[_0x1b8f('0x3e')][_0x1b8f('0x3f')]};});_0x51b99a[_0x1b8f('0x40')]=_['map'](_0x173d73,_0x1b8f('0x37'));_0x51b99a[_0x1b8f('0x41')]=_[_0x1b8f('0x42')](_0x396efc[_0x1b8f('0x41')]);_0x51b99a[_0x1b8f('0x43')]=_[_0x1b8f('0x44')](_0x51b99a[_0x1b8f('0x40')],_0x51b99a[_0x1b8f('0x41')]);_0x4aa84d[_0x1b8f('0x45')]=_[_0x1b8f('0x44')](_0x51b99a['model'],qs['fields'](_0x396efc[_0x1b8f('0x41')][_0x1b8f('0x46')]));_0x4aa84d['attributes']=_0x4aa84d['attributes'][_0x1b8f('0x47')]?_0x4aa84d[_0x1b8f('0x45')]:_0x51b99a[_0x1b8f('0x40')];if(!_0x396efc['query']['hasOwnProperty'](_0x1b8f('0x48'))){_0x4aa84d[_0x1b8f('0x2a')]=qs['limit'](_0x396efc[_0x1b8f('0x41')][_0x1b8f('0x2a')]);_0x4aa84d[_0x1b8f('0x28')]=qs[_0x1b8f('0x28')](_0x396efc[_0x1b8f('0x41')][_0x1b8f('0x28')]);}_0x4aa84d[_0x1b8f('0x49')]=qs[_0x1b8f('0x4a')](_0x396efc[_0x1b8f('0x41')]['sort']);_0x4aa84d['where']=qs['filters'](_[_0x1b8f('0x4b')](_0x396efc['query'],_0x51b99a['filters']),_0x173d73);if(_0x396efc[_0x1b8f('0x41')][_0x1b8f('0x4c')]){_0x4aa84d[_0x1b8f('0x4d')]=_[_0x1b8f('0x4e')](_0x4aa84d[_0x1b8f('0x4d')],{'$or':_['map'](_0x173d73,function(_0x22fecc){if(_0x22fecc['type']!==_0x1b8f('0x4f')){var _0x2f90ec={};_0x2f90ec[_0x22fecc[_0x1b8f('0x37')]]={'$like':'%'+_0x396efc[_0x1b8f('0x41')]['filter']+'%'};return _0x2f90ec;}})});}_0x4aa84d=_['merge']({},_0x4aa84d,_0x396efc[_0x1b8f('0x50')]);var _0x3d8c45={'where':_0x4aa84d[_0x1b8f('0x4d')]};return db['SmsAccount']['count'](_0x3d8c45)[_0x1b8f('0x31')](function(_0x5deae6){_0x136780['count']=_0x5deae6;if(_0x396efc['query'][_0x1b8f('0x51')]){_0x4aa84d[_0x1b8f('0x52')]=[{'all':!![]}];}return db[_0x1b8f('0x3c')][_0x1b8f('0x53')](_0x4aa84d);})[_0x1b8f('0x31')](function(_0x3e4aed){_0x136780[_0x1b8f('0x54')]=_0x3e4aed;return _0x136780;})['then'](respondWithFilteredResult(_0x58a329,_0x4aa84d))['catch'](handleError(_0x58a329,null));};exports['show']=function(_0x5cc728,_0x376923){var _0x33e8ec={'raw':![],'where':{'id':_0x5cc728[_0x1b8f('0x55')]['id']},'include':[{'model':db[_0x1b8f('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1ca4c7={};_0x1ca4c7[_0x1b8f('0x40')]=_[_0x1b8f('0x42')](db[_0x1b8f('0x3c')][_0x1b8f('0x3d')]);_0x1ca4c7['query']=_['keys'](_0x5cc728[_0x1b8f('0x41')]);_0x1ca4c7[_0x1b8f('0x43')]=_[_0x1b8f('0x44')](_0x1ca4c7[_0x1b8f('0x40')],_0x1ca4c7[_0x1b8f('0x41')]);_0x33e8ec['attributes']=_[_0x1b8f('0x44')](_0x1ca4c7[_0x1b8f('0x40')],qs[_0x1b8f('0x46')](_0x5cc728[_0x1b8f('0x41')]['fields']));_0x33e8ec['attributes']=_0x33e8ec[_0x1b8f('0x45')][_0x1b8f('0x47')]?_0x33e8ec['attributes']:_0x1ca4c7['model'];if(_0x5cc728[_0x1b8f('0x41')][_0x1b8f('0x51')]){_0x33e8ec[_0x1b8f('0x52')]=[{'all':!![]}];}_0x33e8ec=_[_0x1b8f('0x4e')]({},_0x33e8ec,_0x5cc728[_0x1b8f('0x50')]);return db[_0x1b8f('0x3c')][_0x1b8f('0x56')](_0x33e8ec)[_0x1b8f('0x31')](handleEntityNotFound(_0x376923,null))[_0x1b8f('0x31')](respondWithResult(_0x376923,null))['catch'](handleError(_0x376923,null));};exports['create']=function(_0xcaabd5,_0x3f3178){return db[_0x1b8f('0x3c')][_0x1b8f('0x57')](_0xcaabd5['body'],{})[_0x1b8f('0x31')](function(_0x12621f){var _0x2121be=_0xcaabd5['user'][_0x1b8f('0x33')]({'plain':!![]});if(!_0x2121be)throw new Error(_0x1b8f('0x58'));if(_0x2121be[_0x1b8f('0x59')]===_0x1b8f('0x5a')){var _0x49b8a7=_0x12621f['get']({'plain':!![]});var _0x4139aa=_0x1b8f('0x34');return db[_0x1b8f('0x5b')]['find']({'where':{'name':_0x4139aa,'userProfileId':_0x2121be['userProfileId']},'raw':!![]})[_0x1b8f('0x31')](function(_0x87aac9){if(_0x87aac9&&_0x87aac9[_0x1b8f('0x5c')]===0x0){return db[_0x1b8f('0x35')][_0x1b8f('0x57')]({'name':_0x49b8a7[_0x1b8f('0x37')],'resourceId':_0x49b8a7['id'],'type':_0x87aac9[_0x1b8f('0x37')],'sectionId':_0x87aac9['id']},{})[_0x1b8f('0x31')](function(){return _0x12621f;});}else{return _0x12621f;}})[_0x1b8f('0x24')](function(_0x570b0e){logger[_0x1b8f('0x21')](_0x1b8f('0x5d'),_0x570b0e);throw _0x570b0e;});}return _0x12621f;})['then'](respondWithResult(_0x3f3178,0xc9))[_0x1b8f('0x24')](handleError(_0x3f3178,null));};exports[_0x1b8f('0x30')]=function(_0x33b184,_0x1f26c4){if(_0x33b184[_0x1b8f('0x5e')]['id']){delete _0x33b184['body']['id'];}return db[_0x1b8f('0x3c')][_0x1b8f('0x56')]({'where':{'id':_0x33b184['params']['id']},'include':[{'model':db[_0x1b8f('0x3a')],'as':_0x1b8f('0x3b')}]})[_0x1b8f('0x31')](handleEntityNotFound(_0x1f26c4,null))[_0x1b8f('0x31')](saveUpdates(_0x33b184[_0x1b8f('0x5e')],null))[_0x1b8f('0x31')](respondWithResult(_0x1f26c4,null))[_0x1b8f('0x24')](handleError(_0x1f26c4,null));};exports[_0x1b8f('0x32')]=function(_0x113742,_0x43ca73){return db[_0x1b8f('0x3c')][_0x1b8f('0x56')]({'where':{'id':_0x113742[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x43ca73,null))[_0x1b8f('0x31')](removeEntity(_0x43ca73,null))[_0x1b8f('0x24')](handleError(_0x43ca73,null));};exports[_0x1b8f('0x5f')]=function(_0x51166f,_0x28f866){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x28f866,null))['catch'](handleError(_0x28f866,null));};exports[_0x1b8f('0x60')]=function(_0x285409,_0x2471a5,_0x560925){if(_0x285409['body']['id']){delete _0x285409[_0x1b8f('0x5e')]['id'];}return db['SmsAccount'][_0x1b8f('0x56')]({'where':{'id':_0x285409[_0x1b8f('0x55')]['id']}})['then'](handleEntityNotFound(_0x2471a5,null))[_0x1b8f('0x31')](function(_0x144ad9){if(_0x144ad9){_0x285409[_0x1b8f('0x5e')][_0x1b8f('0x61')]=_0x144ad9['id'];return db[_0x1b8f('0x62')][_0x1b8f('0x57')](_0x285409[_0x1b8f('0x5e')]);}})[_0x1b8f('0x31')](respondWithResult(_0x2471a5,null))[_0x1b8f('0x24')](handleError(_0x2471a5,null));};exports['getDispositions']=function(_0x3536ee,_0x584dfd,_0x2d2224){var _0x322b6f={'raw':![],'where':{}};var _0x3451c7={};var _0x358f6b={'count':0x0,'rows':[]};return db[_0x1b8f('0x3c')][_0x1b8f('0x63')]({'where':{'id':_0x3536ee[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x584dfd,null))[_0x1b8f('0x31')](function(_0x56a2f8){if(_0x56a2f8){_0x3451c7[_0x1b8f('0x40')]=_[_0x1b8f('0x42')](db[_0x1b8f('0x62')][_0x1b8f('0x3d')]);_0x3451c7[_0x1b8f('0x41')]=_['keys'](_0x3536ee[_0x1b8f('0x41')]);_0x3451c7[_0x1b8f('0x43')]=_['intersection'](_0x3451c7[_0x1b8f('0x40')],_0x3451c7[_0x1b8f('0x41')]);_0x322b6f[_0x1b8f('0x45')]=_[_0x1b8f('0x44')](_0x3451c7['model'],qs[_0x1b8f('0x46')](_0x3536ee[_0x1b8f('0x41')][_0x1b8f('0x46')]));_0x322b6f[_0x1b8f('0x45')]=_0x322b6f['attributes'][_0x1b8f('0x47')]?_0x322b6f['attributes']:_0x3451c7[_0x1b8f('0x40')];if(!_0x3536ee['query'][_0x1b8f('0x64')](_0x1b8f('0x48'))){_0x322b6f[_0x1b8f('0x2a')]=qs[_0x1b8f('0x2a')](_0x3536ee[_0x1b8f('0x41')]['limit']);_0x322b6f[_0x1b8f('0x28')]=qs['offset'](_0x3536ee[_0x1b8f('0x41')][_0x1b8f('0x28')]);}_0x322b6f[_0x1b8f('0x49')]=qs['sort'](_0x3536ee[_0x1b8f('0x41')][_0x1b8f('0x4a')]);_0x322b6f[_0x1b8f('0x4d')]=qs['filters'](_[_0x1b8f('0x4b')](_0x3536ee[_0x1b8f('0x41')],_0x3451c7[_0x1b8f('0x43')]));_0x322b6f['where'][_0x1b8f('0x61')]=_0x56a2f8['id'];if(_0x3536ee[_0x1b8f('0x41')][_0x1b8f('0x4c')]){_0x322b6f['where']=_[_0x1b8f('0x4e')](_0x322b6f['where'],{'$or':_['map'](_0x322b6f['attributes'],function(_0x42b4f1){var _0x514ed3={};_0x514ed3[_0x42b4f1]={'$like':'%'+_0x3536ee[_0x1b8f('0x41')][_0x1b8f('0x4c')]+'%'};return _0x514ed3;})});}_0x322b6f=_['merge']({},_0x322b6f,_0x3536ee[_0x1b8f('0x50')]);return db[_0x1b8f('0x62')][_0x1b8f('0x2b')]({'where':_0x322b6f[_0x1b8f('0x4d')]})[_0x1b8f('0x31')](function(_0x31c427){_0x358f6b['count']=_0x31c427;if(_0x3536ee[_0x1b8f('0x41')][_0x1b8f('0x51')]){_0x322b6f[_0x1b8f('0x52')]=[{'all':!![]}];}return db[_0x1b8f('0x62')][_0x1b8f('0x53')](_0x322b6f);})[_0x1b8f('0x31')](function(_0x586b89){_0x358f6b[_0x1b8f('0x54')]=_0x586b89;return _0x358f6b;});}})[_0x1b8f('0x31')](respondWithFilteredResult(_0x584dfd,_0x322b6f))[_0x1b8f('0x24')](handleError(_0x584dfd,null));};exports[_0x1b8f('0x65')]=function(_0x27a9e0,_0x44f2d2,_0x353825){return db[_0x1b8f('0x3c')][_0x1b8f('0x56')]({'where':{'id':_0x27a9e0[_0x1b8f('0x55')]['id']}})['then'](handleEntityNotFound(_0x44f2d2,null))[_0x1b8f('0x31')](function(_0x17fee8){if(_0x17fee8){return _0x17fee8[_0x1b8f('0x65')](_0x27a9e0[_0x1b8f('0x41')]['ids']);}})[_0x1b8f('0x31')](respondWithStatusCode(_0x44f2d2,null))[_0x1b8f('0x24')](handleError(_0x44f2d2,null));};exports[_0x1b8f('0x66')]=function(_0x5d2b0b,_0x2271f6,_0x5275c4){if(_0x5d2b0b[_0x1b8f('0x5e')]['id']){delete _0x5d2b0b[_0x1b8f('0x5e')]['id'];}return db[_0x1b8f('0x3c')]['find']({'where':{'id':_0x5d2b0b[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x2271f6,null))[_0x1b8f('0x31')](function(_0x13296c){if(_0x13296c){_0x5d2b0b[_0x1b8f('0x5e')][_0x1b8f('0x61')]=_0x13296c['id'];return db[_0x1b8f('0x67')][_0x1b8f('0x57')](_0x5d2b0b[_0x1b8f('0x5e')]);}})['then'](respondWithResult(_0x2271f6,null))[_0x1b8f('0x24')](handleError(_0x2271f6,null));};exports[_0x1b8f('0x68')]=function(_0x5cfcb1,_0x98c3a9,_0x3fc962){var _0x1a5d9b={'raw':![],'where':{}};var _0x330fc2={};var _0x52977d={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1b8f('0x63')]({'where':{'id':_0x5cfcb1[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x98c3a9,null))[_0x1b8f('0x31')](function(_0x22f70d){if(_0x22f70d){_0x330fc2[_0x1b8f('0x40')]=_['keys'](db[_0x1b8f('0x67')][_0x1b8f('0x3d')]);_0x330fc2['query']=_[_0x1b8f('0x42')](_0x5cfcb1[_0x1b8f('0x41')]);_0x330fc2['filters']=_['intersection'](_0x330fc2[_0x1b8f('0x40')],_0x330fc2[_0x1b8f('0x41')]);_0x1a5d9b[_0x1b8f('0x45')]=_['intersection'](_0x330fc2[_0x1b8f('0x40')],qs[_0x1b8f('0x46')](_0x5cfcb1[_0x1b8f('0x41')][_0x1b8f('0x46')]));_0x1a5d9b['attributes']=_0x1a5d9b[_0x1b8f('0x45')]['length']?_0x1a5d9b['attributes']:_0x330fc2[_0x1b8f('0x40')];if(!_0x5cfcb1[_0x1b8f('0x41')]['hasOwnProperty']('nolimit')){_0x1a5d9b[_0x1b8f('0x2a')]=qs[_0x1b8f('0x2a')](_0x5cfcb1[_0x1b8f('0x41')][_0x1b8f('0x2a')]);_0x1a5d9b[_0x1b8f('0x28')]=qs[_0x1b8f('0x28')](_0x5cfcb1[_0x1b8f('0x41')][_0x1b8f('0x28')]);}_0x1a5d9b[_0x1b8f('0x49')]=qs[_0x1b8f('0x4a')](_0x5cfcb1[_0x1b8f('0x41')][_0x1b8f('0x4a')]);_0x1a5d9b['where']=qs[_0x1b8f('0x43')](_[_0x1b8f('0x4b')](_0x5cfcb1['query'],_0x330fc2[_0x1b8f('0x43')]));_0x1a5d9b[_0x1b8f('0x4d')][_0x1b8f('0x61')]=_0x22f70d['id'];if(_0x5cfcb1[_0x1b8f('0x41')][_0x1b8f('0x4c')]){_0x1a5d9b[_0x1b8f('0x4d')]=_[_0x1b8f('0x4e')](_0x1a5d9b[_0x1b8f('0x4d')],{'$or':_[_0x1b8f('0x69')](_0x1a5d9b[_0x1b8f('0x45')],function(_0x3952bc){var _0x181a8a={};_0x181a8a[_0x3952bc]={'$like':'%'+_0x5cfcb1[_0x1b8f('0x41')][_0x1b8f('0x4c')]+'%'};return _0x181a8a;})});}_0x1a5d9b=_[_0x1b8f('0x4e')]({},_0x1a5d9b,_0x5cfcb1[_0x1b8f('0x50')]);return db[_0x1b8f('0x67')][_0x1b8f('0x2b')]({'where':_0x1a5d9b[_0x1b8f('0x4d')]})[_0x1b8f('0x31')](function(_0x144a87){_0x52977d[_0x1b8f('0x2b')]=_0x144a87;if(_0x5cfcb1[_0x1b8f('0x41')][_0x1b8f('0x51')]){_0x1a5d9b[_0x1b8f('0x52')]=[{'all':!![]}];}return db[_0x1b8f('0x67')][_0x1b8f('0x53')](_0x1a5d9b);})[_0x1b8f('0x31')](function(_0x328858){_0x52977d['rows']=_0x328858;return _0x52977d;});}})[_0x1b8f('0x31')](respondWithFilteredResult(_0x98c3a9,_0x1a5d9b))[_0x1b8f('0x24')](handleError(_0x98c3a9,null));};exports[_0x1b8f('0x6a')]=function(_0x55d232,_0x3cc442,_0x27a3f2){return db['SmsAccount'][_0x1b8f('0x56')]({'where':{'id':_0x55d232[_0x1b8f('0x55')]['id']}})['then'](handleEntityNotFound(_0x3cc442,null))[_0x1b8f('0x31')](function(_0x4765f5){if(_0x4765f5){return _0x4765f5[_0x1b8f('0x6a')](_0x55d232[_0x1b8f('0x41')][_0x1b8f('0x6b')]);}})[_0x1b8f('0x31')](respondWithStatusCode(_0x3cc442,null))['catch'](handleError(_0x3cc442,null));};exports[_0x1b8f('0x6c')]=function(_0x39b654,_0x5add7e,_0xdb9a5e){var _0x152824={'channel':_0x1b8f('0x6d')};var _0x5eb0e4=[];var _0x511df1=[];var _0x6821d3={};return db[_0x1b8f('0x3c')][_0x1b8f('0x56')]({'where':{'id':_0x39b654[_0x1b8f('0x55')]['id']},'include':[{'model':db[_0x1b8f('0x6e')],'as':_0x1b8f('0x6f')}]})['then'](handleEntityNotFound(_0x5add7e,null))[_0x1b8f('0x31')](function(_0x5c5c9f){_0x152824[_0x1b8f('0x70')]=_0x5c5c9f;_0x152824['applications']=_[_0x1b8f('0x71')](_0x5c5c9f[_0x1b8f('0x6f')],['priority'],[_0x1b8f('0x72')]);if(_0x152824['account'][_0x1b8f('0x6f')]){delete _0x152824[_0x1b8f('0x70')][_0x1b8f('0x6f')];}return db[_0x1b8f('0x73')][_0x1b8f('0x5f')]();})[_0x1b8f('0x31')](function(_0x4a2bd2){if(!_0x4a2bd2){throw new db['Sequelize'][(_0x1b8f('0x74'))](_0x1b8f('0x75'));}_0x5eb0e4=_[_0x1b8f('0x76')](_['keys'](_0x4a2bd2),[_0x1b8f('0x77'),_0x1b8f('0x78')]);_0x511df1=_[_0x1b8f('0x76')](_[_0x1b8f('0x42')](_0x4a2bd2),[_0x1b8f('0x77'),_0x1b8f('0x78'),_0x1b8f('0x79'),'ListId']);_0x152824[_0x1b8f('0x5e')]={'mapKey':_0x1b8f('0x7a')};if(_0x152824['account'][_0x1b8f('0x3e')]){switch(_0x152824[_0x1b8f('0x70')]['type']){case _0x1b8f('0x7b'):_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7c')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x7d')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x5e')]=_0x39b654[_0x1b8f('0x5e')]['Body'];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7e')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x7f')];break;case _0x1b8f('0x80'):_0x152824['body'][_0x1b8f('0x7c')]='+'+_0x39b654['body']['sender'];_0x152824[_0x1b8f('0x5e')]['body']=_0x39b654['body'][_0x1b8f('0x81')];break;case _0x1b8f('0x82'):_0x152824['body'][_0x1b8f('0x7c')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x7c')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x5e')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x23')];break;case _0x1b8f('0x83'):_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7c')]=_0x39b654[_0x1b8f('0x5e')]['from'];_0x152824['body'][_0x1b8f('0x5e')]=_0x39b654[_0x1b8f('0x5e')]['body'];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7e')]=_0x39b654['body'][_0x1b8f('0x84')];break;case'plivo':_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7c')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x7d')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x5e')]=_0x39b654['body'][_0x1b8f('0x85')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7e')]=_0x39b654['body']['MessageUUID'];break;case _0x1b8f('0x86'):_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7c')]='+'+_0x39b654[_0x1b8f('0x5e')]['results'][0x0][_0x1b8f('0x7c')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x5e')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x87')][0x0][_0x1b8f('0x81')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7e')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x87')][0x0][_0x1b8f('0x7e')];break;case'csc':_0x152824['body'][_0x1b8f('0x7c')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x88')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x5e')]=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x89')]['message'];break;case _0x1b8f('0x8a'):_0x152824[_0x1b8f('0x5e')]['from']=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x8b')];_0x152824['body']['body']=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x81')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7e')]=_0x39b654['body'][_0x1b8f('0x8c')];break;case _0x1b8f('0x8d'):_0x152824['body'][_0x1b8f('0x7e')]=_0x39b654[_0x1b8f('0x5e')][0x0][_0x1b8f('0x23')]['id'];_0x152824[_0x1b8f('0x5e')]['from']=_0x39b654[_0x1b8f('0x5e')][0x0]['message'][_0x1b8f('0x7c')];_0x152824[_0x1b8f('0x5e')]['body']=_0x39b654[_0x1b8f('0x5e')][0x0]['message']['text'];break;case'intelepeer':_0x152824[_0x1b8f('0x5e')]['from']=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x7c')];_0x152824['body']['body']=_0x39b654[_0x1b8f('0x5e')][_0x1b8f('0x23')];_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7e')]=_0x39b654[_0x1b8f('0x5e')]['refid'];break;}}if(_0x152824[_0x1b8f('0x5e')]['id']){delete _0x152824[_0x1b8f('0x5e')]['id'];}if(_[_0x1b8f('0x8e')](_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7c')])){throw new db[(_0x1b8f('0x8f'))][(_0x1b8f('0x74'))](_0x1b8f('0x90'));}if(_['isNil'](_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x5e')])||_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x5e')]===''){throw new db[(_0x1b8f('0x8f'))][(_0x1b8f('0x74'))](_0x1b8f('0x91'));}if(_[_0x1b8f('0x8e')](_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x92')])){throw new db[(_0x1b8f('0x8f'))][(_0x1b8f('0x74'))](_0x1b8f('0x93')+_0x511df1);}if(!_[_0x1b8f('0x94')](_0x511df1,_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x92')])){throw new db['Sequelize'][(_0x1b8f('0x74'))](_0x1b8f('0x95')+_0x511df1);}_0x6821d3[_0x152824[_0x1b8f('0x5e')]['mapKey']]=_0x152824[_0x1b8f('0x5e')]['from'];return db[_0x1b8f('0x96')][_0x1b8f('0x56')]({'where':{'id':_0x152824[_0x1b8f('0x70')][_0x1b8f('0x97')]},'include':[{'model':db[_0x1b8f('0x73')],'as':'Contacts','where':_0x6821d3,'limit':0x1,'order':[[_0x1b8f('0x78'),'DESC']]}]});})['then'](handleEntityNotFound(_0x5add7e,null))[_0x1b8f('0x31')](function(_0x1f1d2b){if(_0x1f1d2b){_0x152824['list']=_['omit'](_0x1f1d2b,[_0x1b8f('0x98')]);if(_0x1f1d2b[_0x1b8f('0x98')]['length']){return _0x1f1d2b[_0x1b8f('0x98')][0x0];}var _0x4d0b99=_['defaults'](_0x152824[_0x1b8f('0x5e')],{'firstName':_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7c')],'ListId':_0x1f1d2b['id']});_0x4d0b99[_0x152824[_0x1b8f('0x5e')]['mapKey']]=_0x152824['body'][_0x1b8f('0x7c')];return db[_0x1b8f('0x73')][_0x1b8f('0x57')](_0x4d0b99,{'fields':_0x5eb0e4,'raw':!![]});}})[_0x1b8f('0x31')](handleEntityNotFound(_0x5add7e,null))[_0x1b8f('0x31')](function(_0x46274d){if(_0x46274d){_0x152824[_0x1b8f('0x99')]=_0x46274d;var _0x36018f={'ContactId':_0x46274d['id'],'phone':_0x152824[_0x1b8f('0x5e')]['from'],'SmsAccountId':_0x39b654[_0x1b8f('0x55')]['id']};var _0x151fa3={'ContactId':_0x46274d['id'],'SmsAccountId':_0x39b654['params']['id'],'closed':![]};return db[_0x1b8f('0x9a')][_0x1b8f('0x56')]({'where':_0x151fa3})[_0x1b8f('0x31')](function(_0x1a925f){if(_0x1a925f){return[_0x1a925f,![]];}return db[_0x1b8f('0x9a')][_0x1b8f('0x57')](_0x36018f)[_0x1b8f('0x31')](function(_0x2eda4c){return[_0x2eda4c,!![]];});});}})[_0x1b8f('0x9b')](function(_0x56d6c4,_0x49bf9f){_0x152824[_0x1b8f('0x9c')]=_0x56d6c4[_0x1b8f('0x33')]({'plain':!![]});_0x152824['interaction'][_0x1b8f('0x9d')]=![];if(_0x49bf9f){if(_0x152824['account'][_0x1b8f('0x9e')]){_0x152824[_0x1b8f('0x9f')][_0x1b8f('0xa0')]({'id':0x0,'priority':_0x152824[_0x1b8f('0x9f')][_0x1b8f('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x1b8f('0xa1')});}_0x152824[_0x1b8f('0x9c')][_0x1b8f('0x9d')]=!![];}return db[_0x1b8f('0xa2')]['create']({'phone':_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7c')],'messageId':_0x152824[_0x1b8f('0x5e')][_0x1b8f('0x7e')],'body':_0x152824['body'][_0x1b8f('0x5e')],'SmsAccountId':_0x39b654[_0x1b8f('0x55')]['id'],'SmsInteractionId':_0x56d6c4['id'],'direction':'in','ContactId':_0x56d6c4[_0x1b8f('0xa3')],'AttachmentId':_0x152824[_0x1b8f('0x5e')]['AttachmentId']});})['then'](function(_0x193b0b){_0x152824[_0x1b8f('0x23')]=_0x193b0b;if(_0x152824['interaction'][_0x1b8f('0xa4')]){return db[_0x1b8f('0xa5')][_0x1b8f('0x56')]({'attributes':['id',_0x1b8f('0x37')],'where':{'id':_0x152824[_0x1b8f('0x9c')]['UserId']}})[_0x1b8f('0x31')](function(_0x432eab){if(_0x432eab){_0x152824[_0x1b8f('0x9f')][_0x1b8f('0xa6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x432eab['name']+','+(_0x152824[_0x1b8f('0x70')][_0x1b8f('0xa7')]||0xa),'interval':_0x1b8f('0xa1')});}return respondWithRpcPromise(_0x1b8f('0xa8'),_0x1b8f('0xa9'),_0x152824);});}return respondWithRpcPromise('Start','startRouting',_0x152824);})[_0x1b8f('0x31')](function(_0x57e153){if(_0x57e153){var _0x142523=0xc8;var _0x5a56d1='receiveMessage';logger['info'](_0x1b8f('0x1f'),_0x5a56d1,_0x142523,'entity\x20found');logger['debug'](_0x1b8f('0xaa'),_0x5a56d1,_0x142523,_0x1b8f('0xab'),JSON[_0x1b8f('0x20')](_0x57e153));if(_0x152824[_0x1b8f('0x70')]['type']==='twilio'){return _0x5add7e['status'](_0x142523)[_0x1b8f('0x2c')](_0x1b8f('0xac'),'text/xml')['send'](_0x1b8f('0xad'));}else{return _0x5add7e['status'](_0x142523)['json'](_0x57e153);}}})['catch'](handleError(_0x5add7e,null));};exports['addApplications']=function(_0x1e997b,_0x37f506){var _0xf107f0=_0x1e997b[_0x1b8f('0x55')]['id'];var _0x3ca47f=_0x1e997b[_0x1b8f('0x5e')];var _0x3ba5e8=0xc8;var _0x283e6b=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x1b8f('0xae')]['Transaction']['ISOLATION_LEVELS'][_0x1b8f('0xaf')]},function(_0x2e9819){return db[_0x1b8f('0x3c')][_0x1b8f('0x63')]({'where':{'id':_0xf107f0},'transaction':_0x2e9819})[_0x1b8f('0x31')](function(_0x5937fd){if(_0x5937fd){return db[_0x1b8f('0x6e')][_0x1b8f('0x32')]({'where':{'SmsAccountId':_0xf107f0},'transaction':_0x2e9819})[_0x1b8f('0x31')](function(){var _0x5e00f9=_['map'](_0x3ca47f,function(_0x31466a){_0x31466a[_0x1b8f('0x61')]=_0xf107f0;return _0x31466a;});return db[_0x1b8f('0x6e')]['bulkCreate'](_0x5e00f9,{'transaction':_0x2e9819});});}else{_0x3ba5e8=0x194;_0x283e6b=[];}});})[_0x1b8f('0x31')](function(){if(_0x3ba5e8!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0xf107f0},'order':_0x1b8f('0xb0')})['then'](function(_0x22cb5e){_0x283e6b=_0x22cb5e;});}})[_0x1b8f('0x24')](function(_0x2715aa){_0x3ba5e8=0x1f4;logger[_0x1b8f('0x21')](_0x2715aa['stack']);if(_0x2715aa[_0x1b8f('0x37')]){delete _0x2715aa[_0x1b8f('0x37')];}_0x283e6b=_0x2715aa;})[_0x1b8f('0xb1')](function(){if(_0x283e6b===null){_0x37f506[_0x1b8f('0x36')](_0x3ba5e8);}else{if(_0x3ba5e8===0x1f4){_0x37f506[_0x1b8f('0x26')](_0x3ba5e8)[_0x1b8f('0x38')](_0x283e6b);}else{_0x37f506[_0x1b8f('0x26')](_0x3ba5e8)[_0x1b8f('0x27')](_0x283e6b);}}});};exports['getApplications']=function(_0x31affa,_0x2e746d,_0xb37c87){var _0xf0075e={};var _0x164b9a={};var _0x5a7d9b;var _0x2ee260;return db[_0x1b8f('0x3c')][_0x1b8f('0x63')]({'where':{'id':_0x31affa[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x2e746d,null))['then'](function(_0x16fdaf){if(_0x16fdaf){_0x5a7d9b=_0x16fdaf;_0x164b9a[_0x1b8f('0x40')]=_[_0x1b8f('0x42')](db[_0x1b8f('0x6e')][_0x1b8f('0x3d')]);_0x164b9a['query']=_['keys'](_0x31affa[_0x1b8f('0x41')]);_0x164b9a['filters']=_['intersection'](_0x164b9a['model'],_0x164b9a[_0x1b8f('0x41')]);_0xf0075e['attributes']=_[_0x1b8f('0x44')](_0x164b9a['model'],qs[_0x1b8f('0x46')](_0x31affa[_0x1b8f('0x41')][_0x1b8f('0x46')]));_0xf0075e[_0x1b8f('0x45')]=_0xf0075e[_0x1b8f('0x45')]['length']?_0xf0075e[_0x1b8f('0x45')]:_0x164b9a[_0x1b8f('0x40')];_0xf0075e[_0x1b8f('0x49')]=qs[_0x1b8f('0x4a')](_0x31affa['query'][_0x1b8f('0x4a')]);_0xf0075e[_0x1b8f('0x4d')]=qs[_0x1b8f('0x43')](_[_0x1b8f('0x4b')](_0x31affa[_0x1b8f('0x41')],_0x164b9a[_0x1b8f('0x43')]));if(_0x31affa[_0x1b8f('0x41')][_0x1b8f('0x4c')]){_0xf0075e[_0x1b8f('0x4d')]=_['merge'](_0xf0075e[_0x1b8f('0x4d')],{'$or':_[_0x1b8f('0x69')](_0xf0075e[_0x1b8f('0x45')],function(_0x1dacd6){var _0x2ee054={};_0x2ee054[_0x1dacd6]={'$like':'%'+_0x31affa[_0x1b8f('0x41')][_0x1b8f('0x4c')]+'%'};return _0x2ee054;})});}_0xf0075e=_[_0x1b8f('0x4e')]({},_0xf0075e,_0x31affa[_0x1b8f('0x50')]);return _0x5a7d9b['getApplications'](_0xf0075e);}})[_0x1b8f('0x31')](function(_0x114d39){if(_0x114d39){_0x2ee260=_0x114d39[_0x1b8f('0x47')];if(!_0x31affa['query'][_0x1b8f('0x64')](_0x1b8f('0x48'))){_0xf0075e[_0x1b8f('0x2a')]=qs['limit'](_0x31affa['query'][_0x1b8f('0x2a')]);_0xf0075e[_0x1b8f('0x28')]=qs['offset'](_0x31affa[_0x1b8f('0x41')]['offset']);}return _0x5a7d9b[_0x1b8f('0xb2')](_0xf0075e);}})[_0x1b8f('0x31')](function(_0x1202a8){if(_0x1202a8){return _0x1202a8?{'count':_0x2ee260,'rows':_0x1202a8}:null;}})[_0x1b8f('0x31')](respondWithResult(_0x2e746d,null))[_0x1b8f('0x24')](handleError(_0x2e746d,null));};exports['getInteractions']=function(_0x2a5668,_0x53ee4d,_0x12fcb6){var _0x44ac30={'raw':![],'where':{}};var _0x57e16f={};var _0x5c19a5={'count':0x0,'rows':[]};return db[_0x1b8f('0x3c')][_0x1b8f('0x63')]({'where':{'id':_0x2a5668[_0x1b8f('0x55')]['id']}})['then'](handleEntityNotFound(_0x53ee4d,null))[_0x1b8f('0x31')](function(_0x53d08a){if(_0x53d08a){_0x57e16f[_0x1b8f('0x40')]=_[_0x1b8f('0x42')](db[_0x1b8f('0x9a')][_0x1b8f('0x3d')]);_0x57e16f['query']=_[_0x1b8f('0x42')](_0x2a5668[_0x1b8f('0x41')]);_0x57e16f[_0x1b8f('0x43')]=_['intersection'](_0x57e16f[_0x1b8f('0x40')],_0x57e16f['query']);_0x44ac30[_0x1b8f('0x45')]=_[_0x1b8f('0x44')](_0x57e16f[_0x1b8f('0x40')],qs[_0x1b8f('0x46')](_0x2a5668[_0x1b8f('0x41')]['fields']));_0x44ac30[_0x1b8f('0x45')]=_0x44ac30[_0x1b8f('0x45')][_0x1b8f('0x47')]?_0x44ac30[_0x1b8f('0x45')]:_0x57e16f['model'];if(!_0x2a5668[_0x1b8f('0x41')]['hasOwnProperty'](_0x1b8f('0x48'))){_0x44ac30['limit']=qs['limit'](_0x2a5668[_0x1b8f('0x41')][_0x1b8f('0x2a')]);_0x44ac30[_0x1b8f('0x28')]=qs[_0x1b8f('0x28')](_0x2a5668[_0x1b8f('0x41')][_0x1b8f('0x28')]);}_0x44ac30[_0x1b8f('0x49')]=qs[_0x1b8f('0x4a')](_0x2a5668[_0x1b8f('0x41')]['sort']);_0x44ac30[_0x1b8f('0x4d')]=qs['filters'](_['pick'](_0x2a5668[_0x1b8f('0x41')],_0x57e16f[_0x1b8f('0x43')]));_0x44ac30[_0x1b8f('0x4d')][_0x1b8f('0x61')]=_0x53d08a['id'];if(_0x2a5668['query'][_0x1b8f('0x4c')]){_0x44ac30[_0x1b8f('0x4d')]=_[_0x1b8f('0x4e')](_0x44ac30['where'],{'$or':_['map'](_0x44ac30[_0x1b8f('0x45')],function(_0x255aa7){var _0x54c39d={};_0x54c39d[_0x255aa7]={'$like':'%'+_0x2a5668[_0x1b8f('0x41')]['filter']+'%'};return _0x54c39d;})});}_0x44ac30=_[_0x1b8f('0x4e')]({},_0x44ac30,_0x2a5668[_0x1b8f('0x50')]);return db[_0x1b8f('0x9a')]['count']({'where':_0x44ac30[_0x1b8f('0x4d')]})[_0x1b8f('0x31')](function(_0xc90a83){_0x5c19a5[_0x1b8f('0x2b')]=_0xc90a83;if(_0x2a5668[_0x1b8f('0x41')][_0x1b8f('0x51')]){_0x44ac30['include']=[{'model':db[_0x1b8f('0x73')],'as':_0x1b8f('0xb3'),'required':![]},{'model':db[_0x1b8f('0xa5')],'as':_0x1b8f('0xb4'),'attributes':['name','fullname',_0x1b8f('0xb5')],'required':![]},{'model':db[_0x1b8f('0xb6')],'as':_0x1b8f('0xb7'),'attributes':['id',_0x1b8f('0x37'),_0x1b8f('0xb8')],'where':_0x2a5668[_0x1b8f('0x41')]['tag']?{'id':_0x2a5668[_0x1b8f('0x41')][_0x1b8f('0xb9')]}:undefined,'required':_0x2a5668[_0x1b8f('0x41')][_0x1b8f('0xb9')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x44ac30);})['then'](function(_0x21ddf5){_0x5c19a5['rows']=_0x21ddf5;return _0x5c19a5;});}})[_0x1b8f('0x31')](respondWithFilteredResult(_0x53ee4d,_0x44ac30))[_0x1b8f('0x24')](handleError(_0x53ee4d,null));};exports[_0x1b8f('0x38')]=function(_0x243e92,_0x3e7149,_0x283f0f){var _0x31c95c,_0x369c2f,_0x961217;if(_[_0x1b8f('0x8e')](_0x243e92[_0x1b8f('0x5e')][_0x1b8f('0x5e')])||_0x243e92['body'][_0x1b8f('0x5e')]===''){throw new db[(_0x1b8f('0x8f'))][(_0x1b8f('0x74'))](_0x1b8f('0x91'));}if(_[_0x1b8f('0x8e')](_0x243e92[_0x1b8f('0x5e')]['to'])){throw new db[(_0x1b8f('0x8f'))][(_0x1b8f('0x74'))](_0x1b8f('0xba'));}_0x31c95c=_0x243e92[_0x1b8f('0x5e')]['to'];return db[_0x1b8f('0x3c')][_0x1b8f('0x56')]({'where':{'id':_0x243e92['params']['id']},'include':[{'model':db['CmList'],'as':_0x1b8f('0xbb'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x31c95c},'limit':0x1,'order':[[_0x1b8f('0x78'),'DESC']]}]}]})[_0x1b8f('0x31')](handleEntityNotFound(_0x3e7149,null))[_0x1b8f('0x31')](function(_0xf57ce2){if(_0xf57ce2&&_0xf57ce2[_0x1b8f('0xbb')]){_0x369c2f=_0xf57ce2['get']({'plain':!![]});if(_0x369c2f[_0x1b8f('0xbb')]&&_0x369c2f[_0x1b8f('0xbb')]['Contacts'][_0x1b8f('0x47')]){return _0x369c2f['List'][_0x1b8f('0x98')][0x0];}return db[_0x1b8f('0x73')][_0x1b8f('0x57')](_['defaults'](_0x243e92[_0x1b8f('0x5e')],{'firstName':_0x31c95c,'mobile':_0x31c95c,'phone':_0x31c95c,'ListId':_0x369c2f[_0x1b8f('0x97')]}));}})[_0x1b8f('0x31')](handleEntityNotFound(_0x3e7149,null))['then'](function(_0x255b16){if(_0x255b16){_0x961217=_0x255b16;return db[_0x1b8f('0x9a')][_0x1b8f('0x56')]({'where':{'ContactId':_0x961217['id'],'closed':![],'SmsAccountId':_0x369c2f['id']}})[_0x1b8f('0x31')](function(_0x3c08aa){if(_0x3c08aa){return[_0x3c08aa,![]];}return db[_0x1b8f('0x9a')]['create']({'UserId':_0x243e92['user']['id'],'ContactId':_0x961217['id'],'SmsAccountId':_0x369c2f['id'],'phone':_0x31c95c,'firstMsgDirection':'out','Messages':[_[_0x1b8f('0x4e')](_0x243e92[_0x1b8f('0x5e')],{'read':![],'body':_0x243e92[_0x1b8f('0x5e')]['body'],'phone':_0x31c95c,'SmsAccountId':_0x369c2f['id'],'UserId':_0x243e92[_0x1b8f('0x5a')]['id'],'ContactId':_0x961217['id']})]},{'include':[{'model':db[_0x1b8f('0xa2')],'as':_0x1b8f('0xbc')}]})[_0x1b8f('0x31')](function(_0x114971){return[_0x114971,!![]];});});}})[_0x1b8f('0x9b')](function(_0xc4ef7,_0x2822ba){if(_0x2822ba){return _0xc4ef7;}return db[_0x1b8f('0xa2')]['create'](_[_0x1b8f('0x4e')](_0x243e92[_0x1b8f('0x5e')],{'read':![],'body':_0x243e92[_0x1b8f('0x5e')]['body'],'phone':_0x31c95c,'SmsAccountId':_0x369c2f['id'],'SmsInteractionId':_0xc4ef7['id'],'UserId':_0x243e92[_0x1b8f('0x5a')]['id'],'ContactId':_0x961217['id']}))[_0x1b8f('0x31')](function(_0x3414f6){_0xc4ef7[_0x1b8f('0xbd')][_0x1b8f('0xbc')]=[];_0xc4ef7[_0x1b8f('0xbd')][_0x1b8f('0xbc')][_0x1b8f('0xa0')](_0x3414f6[_0x1b8f('0xbd')]);return _0xc4ef7;});})[_0x1b8f('0x31')](respondWithResult(_0x3e7149,null))[_0x1b8f('0x24')](handleError(_0x3e7149,null));};exports[_0x1b8f('0x26')]=function(_0x48531a,_0xe32d66,_0x46bcae){if(_0x48531a[_0x1b8f('0x5e')]['id']){delete _0x48531a[_0x1b8f('0x5e')]['id'];}var _0x49a308,_0x5c807e,_0x390cb3;return db['SmsAccount']['find']({'where':{'id':_0x48531a[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0xe32d66,null))[_0x1b8f('0x31')](function(_0x16767b){if(_0x16767b){_0x390cb3=_0x16767b;logger[_0x1b8f('0x1e')](_0x1b8f('0x1f'),_0x1b8f('0x26'),'received\x20delivery\x20report\x20from',_0x16767b[_0x1b8f('0x3e')],util[_0x1b8f('0xbe')](_0x48531a[_0x1b8f('0x5e')],{'showHidden':![],'depth':null}));switch(_0x16767b['type']){case'skebby':if(_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xbf')]&&_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x26')]){_0x5c807e=_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x26')];return db[_0x1b8f('0xa2')][_0x1b8f('0x56')]({'where':{'messageId':_0x48531a['body'][_0x1b8f('0xbf')]}});}break;case _0x1b8f('0x82'):if(_0x48531a['body'][_0x1b8f('0xc0')]&&_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc1')]){_0x5c807e=_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc1')];return db['SmsMessage'][_0x1b8f('0x56')]({'where':{'messageId':_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc0')]}});}break;case _0x1b8f('0x83'):if(_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x84')]&&_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc2')]){_0x5c807e=_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc2')];return db['SmsMessage'][_0x1b8f('0x56')]({'where':{'messageId':_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x84')]}});}break;case _0x1b8f('0x86'):var _0x594beb=_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x87')][0x0];if(_0x594beb[_0x1b8f('0x7e')]&&_0x594beb['status']['groupName']===_0x1b8f('0xc3')){_0x5c807e=_0x594beb[_0x1b8f('0x26')][_0x1b8f('0xc4')];return db[_0x1b8f('0xa2')][_0x1b8f('0x56')]({'where':{'messageId':_0x594beb[_0x1b8f('0x7e')]}});}break;case _0x1b8f('0x8a'):if(_0x48531a[_0x1b8f('0x5e')]['messageId']&&_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x26')]){_0x5c807e=_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x26')];return db['SmsMessage']['find']({'where':{'messageId':_0x48531a['body']['messageId']}});}break;case _0x1b8f('0x8d'):if(_0x48531a[_0x1b8f('0x5e')][0x0]['message']['id']){_0x5c807e=_0x48531a[_0x1b8f('0x5e')][0x0]['type'];return db[_0x1b8f('0xa2')][_0x1b8f('0x56')]({'where':{'messageId':_0x48531a[_0x1b8f('0x5e')][0x0][_0x1b8f('0x23')]['id']}});}break;case _0x1b8f('0xc5'):if(_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc6')]&&_0x48531a['body'][_0x1b8f('0x26')]){_0x5c807e=_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0x26')];return db[_0x1b8f('0xa2')][_0x1b8f('0x56')]({'where':{'messageId':_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc6')]}});}break;}}})['then'](handleEntityNotFound(_0xe32d66,null))['then'](function(_0x2baa2c){if(_0x2baa2c){_0x49a308=_0x2baa2c;switch(_0x390cb3[_0x1b8f('0x3e')]){case'skebby':if(_0x5c807e===_0x1b8f('0xc3')){return _0x49a308['update']({'read':!![]});}else{logger[_0x1b8f('0x21')](_0x1b8f('0x1f'),'status',_0x1b8f('0x80'),util[_0x1b8f('0xbe')](_0x48531a[_0x1b8f('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x1b8f('0x82'):if(_0x5c807e==='1'){return _0x49a308[_0x1b8f('0x30')]({'read':!![]});}else{logger[_0x1b8f('0x21')](_0x1b8f('0x1f'),'status','skebby',util[_0x1b8f('0xbe')](_0x48531a['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x48531a[_0x1b8f('0x5e')][_0x1b8f('0xc7')]&&_0x5c807e>=0xc8&&_0x5c807e<=0xce){return _0x49a308[_0x1b8f('0x30')]({'read':!![]});}else{logger[_0x1b8f('0x21')](_0x1b8f('0x1f'),'status',_0x1b8f('0x83'),util['inspect'](_0x48531a['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x401ed3=_0x48531a[_0x1b8f('0x5e')]['results'][0x0];if(_0x401ed3[_0x1b8f('0x26')][_0x1b8f('0xc4')]==='DELIVERED'){return _0x49a308[_0x1b8f('0x30')]({'read':!![]});}else{logger[_0x1b8f('0x21')](_0x1b8f('0x1f'),_0x1b8f('0x26'),_0x1b8f('0x86'),util[_0x1b8f('0xbe')](_0x48531a[_0x1b8f('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x1b8f('0x8a'):if(_0x5c807e==_0x1b8f('0xc8')||_0x5c807e==_0x1b8f('0xc9')){return _0x49a308['update']({'read':!![]});}else{logger[_0x1b8f('0x21')](_0x1b8f('0x1f'),_0x1b8f('0x26'),_0x1b8f('0x8a'),util[_0x1b8f('0xbe')](_0x48531a['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5c807e==_0x1b8f('0xca')){return _0x49a308[_0x1b8f('0x30')]({'read':!![]});}else{logger['error'](_0x1b8f('0x1f'),_0x1b8f('0x26'),'bandwidth',util[_0x1b8f('0xbe')](_0x48531a[_0x1b8f('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x1b8f('0xc5'):if(_0x5c807e===_0x1b8f('0xcb')||_0x5c807e===_0x1b8f('0xcc')){return _0x49a308[_0x1b8f('0x30')]({'read':!![]});}else{logger[_0x1b8f('0x21')](_0x1b8f('0x1f'),'status','intelepeer',util[_0x1b8f('0xbe')](_0x48531a['body'],{'showHidden':![],'depth':null}));}break;}return _0x49a308;}})[_0x1b8f('0x31')](respondWithResult(_0xe32d66,null))[_0x1b8f('0x24')](handleError(_0xe32d66,null));};exports[_0x1b8f('0xcd')]=function(_0xd83262,_0x9d1263,_0x2c1d3e){var _0xacde98,_0x627f46,_0x42975a;return db[_0x1b8f('0x3c')][_0x1b8f('0x56')]({'where':{'id':_0xd83262['params']['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x9d1263,null))[_0x1b8f('0x31')](function(_0x589ae8){if(_0x589ae8){_0x42975a=_0x589ae8;logger[_0x1b8f('0x1e')](_0x1b8f('0x1f'),_0x1b8f('0x26'),_0x1b8f('0xce'),_0x589ae8[_0x1b8f('0x3e')],util[_0x1b8f('0xbe')](_0xd83262['query'],{'showHidden':![],'depth':null}));switch(_0x589ae8['type']){case _0x1b8f('0xcf'):if(_0xd83262[_0x1b8f('0x41')][_0x1b8f('0xd0')]&&_0xd83262[_0x1b8f('0x41')][_0x1b8f('0xd1')]){_0x627f46=_0xd83262[_0x1b8f('0x41')][_0x1b8f('0xd1')];return db[_0x1b8f('0xa2')]['find']({'where':{'messageId':_0xd83262[_0x1b8f('0x41')][_0x1b8f('0xd0')]}});}break;}}})[_0x1b8f('0x31')](handleEntityNotFound(_0x9d1263,null))[_0x1b8f('0x31')](function(_0x27b801){if(_0x27b801){_0xacde98=_0x27b801;switch(_0x42975a['type']){case _0x1b8f('0xcf'):if(_0x627f46==='2'||_0x627f46==='6'){return _0xacde98[_0x1b8f('0x30')]({'read':!![]});}else{logger[_0x1b8f('0x21')](_0x1b8f('0x1f'),'status',_0x1b8f('0xcf'),util['inspect'](_0xd83262[_0x1b8f('0x41')],{'showHidden':![],'depth':null}));};break;}return _0xacde98;}})[_0x1b8f('0x31')](respondWithResult(_0x9d1263,null))['catch'](handleError(_0x9d1263,null));};exports[_0x1b8f('0xd2')]=function(_0x1574b8,_0x5b77c4,_0x40e322){return db[_0x1b8f('0x3c')][_0x1b8f('0x56')]({'where':{'id':_0x1574b8[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x5b77c4,null))[_0x1b8f('0x31')](function(_0x252dbd){if(_0x252dbd){return _0x252dbd[_0x1b8f('0xd2')](_0x1574b8['body']['ids'],_['omit'](_0x1574b8['body'],['ids','id'])||{})[_0x1b8f('0x9b')](function(_0x14a0ab){for(var _0x3f7df3=0x0;_0x3f7df3<_0x1574b8[_0x1b8f('0x5e')][_0x1b8f('0x6b')]['length'];_0x3f7df3+=0x1){socket[_0x1b8f('0xd3')](_0x1b8f('0xd4'),{'UserId':Number(_0x1574b8[_0x1b8f('0x5e')][_0x1b8f('0x6b')][_0x3f7df3]),'SmsAccountId':Number(_0x1574b8[_0x1b8f('0x55')]['id'])});}return _0x14a0ab;});}})[_0x1b8f('0x31')](respondWithResult(_0x5b77c4,null))['catch'](handleError(_0x5b77c4,null));};exports[_0x1b8f('0xd5')]=function(_0x2764f1,_0x4b08b2,_0x5e2127){return db['SmsAccount']['find']({'where':{'id':_0x2764f1[_0x1b8f('0x55')]['id']}})[_0x1b8f('0x31')](handleEntityNotFound(_0x4b08b2,null))[_0x1b8f('0x31')](function(_0x35862f){if(_0x35862f){return _0x35862f[_0x1b8f('0xd5')](_0x2764f1[_0x1b8f('0x41')]['ids'])[_0x1b8f('0x31')](function(){if(_[_0x1b8f('0xd6')](_0x2764f1[_0x1b8f('0x41')][_0x1b8f('0x6b')])){for(var _0x4869d0=0x0;_0x4869d0<_0x2764f1[_0x1b8f('0x41')][_0x1b8f('0x6b')]['length'];_0x4869d0+=0x1){socket[_0x1b8f('0xd3')](_0x1b8f('0xd7'),{'UserId':Number(_0x2764f1['query'][_0x1b8f('0x6b')][_0x4869d0]),'SmsAccountId':Number(_0x2764f1[_0x1b8f('0x55')]['id'])});}}else{socket['emit'](_0x1b8f('0xd7'),{'UserId':Number(_0x2764f1[_0x1b8f('0x41')][_0x1b8f('0x6b')]),'SmsAccountId':Number(_0x2764f1[_0x1b8f('0x55')]['id'])});}});}})[_0x1b8f('0x31')](respondWithStatusCode(_0x4b08b2,null))[_0x1b8f('0x24')](handleError(_0x4b08b2,null));};exports[_0x1b8f('0xd8')]=function(_0x252547,_0x2f7aa0,_0x58492b){var _0xb75607={};var _0x537985={};var _0x12dbb1;var _0x162075;return db[_0x1b8f('0x3c')][_0x1b8f('0x63')]({'where':{'id':_0x252547[_0x1b8f('0x55')]['id']}})['then'](handleEntityNotFound(_0x2f7aa0,null))[_0x1b8f('0x31')](function(_0x337866){if(_0x337866){_0x12dbb1=_0x337866;_0x537985[_0x1b8f('0x40')]=_[_0x1b8f('0x42')](db['User']['rawAttributes']);_0x537985[_0x1b8f('0x41')]=_['keys'](_0x252547[_0x1b8f('0x41')]);_0x537985[_0x1b8f('0x43')]=_[_0x1b8f('0x44')](_0x537985[_0x1b8f('0x40')],_0x537985[_0x1b8f('0x41')]);_0xb75607['attributes']=_['intersection'](_0x537985[_0x1b8f('0x40')],qs[_0x1b8f('0x46')](_0x252547[_0x1b8f('0x41')][_0x1b8f('0x46')]));_0xb75607[_0x1b8f('0x45')]=_0xb75607[_0x1b8f('0x45')]['length']?_0xb75607[_0x1b8f('0x45')]:_0x537985['model'];_0xb75607['order']=qs[_0x1b8f('0x4a')](_0x252547[_0x1b8f('0x41')][_0x1b8f('0x4a')]);_0xb75607['where']=qs[_0x1b8f('0x43')](_[_0x1b8f('0x4b')](_0x252547['query'],_0x537985[_0x1b8f('0x43')]));if(_0x252547['query'][_0x1b8f('0x4c')]){_0xb75607[_0x1b8f('0x4d')]=_['merge'](_0xb75607['where'],{'$or':_[_0x1b8f('0x69')](_0xb75607[_0x1b8f('0x45')],function(_0x13734c){var _0x4a467d={};_0x4a467d[_0x13734c]={'$like':'%'+_0x252547[_0x1b8f('0x41')]['filter']+'%'};return _0x4a467d;})});}_0xb75607=_[_0x1b8f('0x4e')]({},_0xb75607,_0x252547[_0x1b8f('0x50')]);return _0x12dbb1[_0x1b8f('0xd8')](_0xb75607);}})[_0x1b8f('0x31')](function(_0x50ed5d){if(_0x50ed5d){_0x162075=_0x50ed5d[_0x1b8f('0x47')];if(!_0x252547[_0x1b8f('0x41')][_0x1b8f('0x64')](_0x1b8f('0x48'))){_0xb75607[_0x1b8f('0x2a')]=qs[_0x1b8f('0x2a')](_0x252547[_0x1b8f('0x41')]['limit']);_0xb75607[_0x1b8f('0x28')]=qs[_0x1b8f('0x28')](_0x252547['query'][_0x1b8f('0x28')]);}return _0x12dbb1['getAgents'](_0xb75607);}})['then'](function(_0xf31f90){if(_0xf31f90){return _0xf31f90?{'count':_0x162075,'rows':_0xf31f90}:null;}})[_0x1b8f('0x31')](respondWithResult(_0x2f7aa0,null))[_0x1b8f('0x24')](handleError(_0x2f7aa0,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a71f6ca..4d91194 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 _0xa040=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x3daa35,_0x48e199){var _0x4108e3=function(_0x42a37c){while(--_0x42a37c){_0x3daa35['push'](_0x3daa35['shift']());}};_0x4108e3(++_0x48e199);}(_0xa040,0xe1));var _0x0a04=function(_0x44066a,_0x4834d8){_0x44066a=_0x44066a-0x0;var _0x4e2c23=_0xa040[_0x44066a];return _0x4e2c23;};'use strict';var EventEmitter=require(_0x0a04('0x0'));var SmsAccount=require(_0x0a04('0x1'))['db'][_0x0a04('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0a04('0x3')](0x0);var events={'afterCreate':_0x0a04('0x4'),'afterUpdate':_0x0a04('0x5'),'afterDestroy':_0x0a04('0x6')};function emitEvent(_0xba6140){return function(_0x8f83a3,_0x5d811c,_0x551c15){SmsAccountEvents['emit'](_0xba6140+':'+_0x8f83a3['id'],_0x8f83a3);SmsAccountEvents[_0x0a04('0x7')](_0xba6140,_0x8f83a3);_0x551c15(null);};}for(var e in events){if(events[_0x0a04('0x8')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x0a04('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xceef=['setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x18afa5,_0x2dbea3){var _0x20de45=function(_0xcbbca7){while(--_0xcbbca7){_0x18afa5['push'](_0x18afa5['shift']());}};_0x20de45(++_0x2dbea3);}(_0xceef,0xd1));var _0xfcee=function(_0x3ce15d,_0x13bf9b){_0x3ce15d=_0x3ce15d-0x0;var _0x163ae4=_0xceef[_0x3ce15d];return _0x163ae4;};'use strict';var EventEmitter=require(_0xfcee('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xfcee('0x1')](0x0);var events={'afterCreate':_0xfcee('0x2'),'afterUpdate':_0xfcee('0x3'),'afterDestroy':_0xfcee('0x4')};function emitEvent(_0x1c8c0f){return function(_0x25ad97,_0x25d6d6,_0x5557f4){SmsAccountEvents['emit'](_0x1c8c0f+':'+_0x25ad97['id'],_0x25ad97);SmsAccountEvents[_0xfcee('0x5')](_0x1c8c0f,_0x25ad97);_0x5557f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xfcee('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index f71658f..0d983b7 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 _0xa4ee=['request-promise','path','rimraf','./smsAccount.attributes','exports','SmsAccount','lodash','moment','bluebird'];(function(_0x5d250f,_0x1c78f4){var _0x5adaec=function(_0x4fa90a){while(--_0x4fa90a){_0x5d250f['push'](_0x5d250f['shift']());}};_0x5adaec(++_0x1c78f4);}(_0xa4ee,0xd5));var _0xea4e=function(_0x455d02,_0x51dfb1){_0x455d02=_0x455d02-0x0;var _0x1fa776=_0xa4ee[_0x455d02];return _0x1fa776;};'use strict';var _=require(_0xea4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xea4e('0x1'));var BPromise=require(_0xea4e('0x2'));var rp=require(_0xea4e('0x3'));var fs=require('fs');var path=require(_0xea4e('0x4'));var rimraf=require(_0xea4e('0x5'));var config=require('../../config/environment');var attributes=require(_0xea4e('0x6'));module[_0xea4e('0x7')]=function(_0x2fa61b,_0x45e3de){return _0x2fa61b['define'](_0xea4e('0x8'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aad=['api','bluebird','request-promise','../../config/environment','define','sms_accounts','lodash','util'];(function(_0x243283,_0x4946dd){var _0x3d4107=function(_0x40d126){while(--_0x40d126){_0x243283['push'](_0x243283['shift']());}};_0x3d4107(++_0x4946dd);}(_0x8aad,0x146));var _0xd8aa=function(_0x4dd0c8,_0x542f76){_0x4dd0c8=_0x4dd0c8-0x0;var _0x269a8b=_0x8aad[_0x4dd0c8];return _0x269a8b;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('SmsAccount',attributes,{'tableName':_0xd8aa('0x7'),'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 c564961..8494e60 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 _0x73ad=['then','ShowSmsAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','./smsAccount.socket','register','request','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','info','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model'];(function(_0x3814f0,_0x856e2d){var _0x54c25b=function(_0x7bf540){while(--_0x7bf540){_0x3814f0['push'](_0x3814f0['shift']());}};_0x54c25b(++_0x856e2d);}(_0x73ad,0x199));var _0xd73a=function(_0x5a52b2,_0x1b5f32){_0x5a52b2=_0x5a52b2-0x0;var _0x3ac12f=_0x73ad[_0x5a52b2];return _0x3ac12f;};'use strict';var _=require(_0xd73a('0x0'));var util=require(_0xd73a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd73a('0x2'));var fs=require('fs');var Redis=require(_0xd73a('0x3'));var db=require(_0xd73a('0x4'))['db'];var utils=require(_0xd73a('0x5'));var logger=require(_0xd73a('0x6'))(_0xd73a('0x7'));var config=require(_0xd73a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd73a('0x9')]['http']({'port':0x232a});config['redis']=_[_0xd73a('0xa')](config[_0xd73a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd73a('0xb')]));require(_0xd73a('0xc'))[_0xd73a('0xd')](socket);function respondWithRpcPromise(_0x523861,_0x2e8baa,_0x5b9d28){return new BPromise(function(_0x2108be,_0x4a8f12){return client[_0xd73a('0xe')](_0x523861,_0x5b9d28)['then'](function(_0x3655e3){logger['info']('SmsAccount,\x20%s,\x20%s',_0x2e8baa,_0xd73a('0xf'));logger[_0xd73a('0x10')](_0xd73a('0x11'),_0x2e8baa,_0xd73a('0xf'),JSON[_0xd73a('0x12')](_0x3655e3));if(_0x3655e3[_0xd73a('0x13')]){if(_0x3655e3[_0xd73a('0x13')][_0xd73a('0x14')]===0x1f4){logger[_0xd73a('0x13')]('SmsAccount,\x20%s,\x20%s',_0x2e8baa,_0x3655e3[_0xd73a('0x13')][_0xd73a('0x15')]);return _0x4a8f12(_0x3655e3[_0xd73a('0x13')]['message']);}logger[_0xd73a('0x13')](_0xd73a('0x16'),_0x2e8baa,_0x3655e3[_0xd73a('0x13')][_0xd73a('0x15')]);return _0x2108be(_0x3655e3[_0xd73a('0x13')]['message']);}else{logger[_0xd73a('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2e8baa,_0xd73a('0xf'));_0x2108be(_0x3655e3[_0xd73a('0x18')][_0xd73a('0x15')]);}})[_0xd73a('0x19')](function(_0x3a3906){logger['error'](_0xd73a('0x16'),_0x2e8baa,_0x3a3906);_0x4a8f12(_0x3a3906);});});}exports['ShowSmsAccount']=function(_0x71b83d){var _0x506536=this;return new Promise(function(_0x2fa2b8,_0x537f47){return db[_0xd73a('0x1a')][_0xd73a('0x1b')]({'raw':_0x71b83d[_0xd73a('0x1c')]?_0x71b83d[_0xd73a('0x1c')][_0xd73a('0x1d')]===undefined?!![]:![]:!![],'where':_0x71b83d['options']?_0x71b83d[_0xd73a('0x1c')][_0xd73a('0x1e')]||null:null,'attributes':_0x71b83d[_0xd73a('0x1c')]?_0x71b83d['options'][_0xd73a('0x1f')]||null:null,'include':_0x71b83d[_0xd73a('0x1c')]?_0x71b83d[_0xd73a('0x1c')][_0xd73a('0x20')]?_[_0xd73a('0x21')](_0x71b83d[_0xd73a('0x1c')]['include'],function(_0x504e94){return{'model':db[_0x504e94[_0xd73a('0x22')]],'as':_0x504e94['as'],'attributes':_0x504e94[_0xd73a('0x1f')],'include':_0x504e94[_0xd73a('0x20')]?_[_0xd73a('0x21')](_0x504e94[_0xd73a('0x20')],function(_0x155add){return{'model':db[_0x155add['model']],'as':_0x155add['as'],'attributes':_0x155add[_0xd73a('0x1f')],'include':_0x155add[_0xd73a('0x20')]?_[_0xd73a('0x21')](_0x155add['include'],function(_0x55754e){return{'model':db[_0x55754e['model']],'as':_0x55754e['as'],'attributes':_0x55754e[_0xd73a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd73a('0x23')](function(_0x4ea6f4){logger[_0xd73a('0x17')]('ShowSmsAccount',_0x71b83d);logger[_0xd73a('0x10')](_0xd73a('0x24'),_0x71b83d,JSON[_0xd73a('0x12')](_0x4ea6f4));_0x2fa2b8(_0x4ea6f4);})[_0xd73a('0x19')](function(_0x269af6){logger[_0xd73a('0x13')](_0xd73a('0x24'),_0x269af6[_0xd73a('0x15')],_0x71b83d);_0x537f47(_0x506536[_0xd73a('0x13')](0x1f4,_0x269af6[_0xd73a('0x15')]));});});}; \ No newline at end of file +var _0x5718=['model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','include','map'];(function(_0x29c541,_0xdffbd2){var _0x32a9cc=function(_0x5efcf2){while(--_0x5efcf2){_0x29c541['push'](_0x29c541['shift']());}};_0x32a9cc(++_0xdffbd2);}(_0x5718,0x16a));var _0x8571=function(_0x199753,_0x2e717b){_0x199753=_0x199753-0x0;var _0x37d655=_0x5718[_0x199753];return _0x37d655;};'use strict';var _=require(_0x8571('0x0'));var util=require(_0x8571('0x1'));var moment=require(_0x8571('0x2'));var BPromise=require('bluebird');var rs=require(_0x8571('0x3'));var fs=require('fs');var Redis=require(_0x8571('0x4'));var db=require(_0x8571('0x5'))['db'];var utils=require(_0x8571('0x6'));var logger=require(_0x8571('0x7'))(_0x8571('0x8'));var config=require(_0x8571('0x9'));var jayson=require(_0x8571('0xa'));var client=jayson[_0x8571('0xb')][_0x8571('0xc')]({'port':0x232a});config[_0x8571('0xd')]=_[_0x8571('0xe')](config[_0x8571('0xd')],{'host':_0x8571('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8571('0xd')]));require(_0x8571('0x10'))[_0x8571('0x11')](socket);function respondWithRpcPromise(_0x48ccb3,_0x86ec3c,_0x2b9067){return new BPromise(function(_0xbe6827,_0x2be6f2){return client[_0x8571('0x12')](_0x48ccb3,_0x2b9067)[_0x8571('0x13')](function(_0x44376c){logger[_0x8571('0x14')](_0x8571('0x15'),_0x86ec3c,_0x8571('0x16'));logger['debug'](_0x8571('0x17'),_0x86ec3c,_0x8571('0x16'),JSON[_0x8571('0x18')](_0x44376c));if(_0x44376c[_0x8571('0x19')]){if(_0x44376c[_0x8571('0x19')][_0x8571('0x1a')]===0x1f4){logger[_0x8571('0x19')](_0x8571('0x15'),_0x86ec3c,_0x44376c['error'][_0x8571('0x1b')]);return _0x2be6f2(_0x44376c[_0x8571('0x19')]['message']);}logger['error'](_0x8571('0x15'),_0x86ec3c,_0x44376c['error'][_0x8571('0x1b')]);return _0xbe6827(_0x44376c[_0x8571('0x19')][_0x8571('0x1b')]);}else{logger[_0x8571('0x14')](_0x8571('0x15'),_0x86ec3c,_0x8571('0x16'));_0xbe6827(_0x44376c['result']['message']);}})[_0x8571('0x1c')](function(_0x4a86b8){logger['error'](_0x8571('0x15'),_0x86ec3c,_0x4a86b8);_0x2be6f2(_0x4a86b8);});});}exports[_0x8571('0x1d')]=function(_0x4e8926){var _0x2016e6=this;return new Promise(function(_0x3dd45b,_0x1468cf){return db[_0x8571('0x1e')][_0x8571('0x1f')]({'raw':_0x4e8926['options']?_0x4e8926['options'][_0x8571('0x20')]===undefined?!![]:![]:!![],'where':_0x4e8926[_0x8571('0x21')]?_0x4e8926[_0x8571('0x21')][_0x8571('0x22')]||null:null,'attributes':_0x4e8926[_0x8571('0x21')]?_0x4e8926['options'][_0x8571('0x23')]||null:null,'include':_0x4e8926[_0x8571('0x21')]?_0x4e8926[_0x8571('0x21')][_0x8571('0x24')]?_[_0x8571('0x25')](_0x4e8926[_0x8571('0x21')][_0x8571('0x24')],function(_0x58b01f){return{'model':db[_0x58b01f[_0x8571('0x26')]],'as':_0x58b01f['as'],'attributes':_0x58b01f['attributes'],'include':_0x58b01f[_0x8571('0x24')]?_[_0x8571('0x25')](_0x58b01f[_0x8571('0x24')],function(_0x50475f){return{'model':db[_0x50475f[_0x8571('0x26')]],'as':_0x50475f['as'],'attributes':_0x50475f[_0x8571('0x23')],'include':_0x50475f[_0x8571('0x24')]?_[_0x8571('0x25')](_0x50475f[_0x8571('0x24')],function(_0x149484){return{'model':db[_0x149484[_0x8571('0x26')]],'as':_0x149484['as'],'attributes':_0x149484[_0x8571('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28663a){logger['info'](_0x8571('0x1d'),_0x4e8926);logger[_0x8571('0x27')]('ShowSmsAccount',_0x4e8926,JSON[_0x8571('0x18')](_0x28663a));_0x3dd45b(_0x28663a);})[_0x8571('0x1c')](function(_0x50ebd1){logger[_0x8571('0x19')]('ShowSmsAccount',_0x50ebd1[_0x8571('0x1b')],_0x4e8926);_0x1468cf(_0x2016e6[_0x8571('0x19')](0x1f4,_0x50ebd1[_0x8571('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bf899a1..e1fb55c 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 9a4325f..c63acc1 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 06cd46f..4fa8214 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 _0xd69e=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x333195,_0x366608){var _0x2e44de=function(_0x5c1dd7){while(--_0x5c1dd7){_0x333195['push'](_0x333195['shift']());}};_0x2e44de(++_0x366608);}(_0xd69e,0x1cc));var _0xed69=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd69e[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xed69('0x0'));module[_0xed69('0x1')]={'priority':{'type':Sequelize[_0xed69('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xed69('0x3')],'allowNull':![],'defaultValue':_0xed69('0x4')},'appdata':{'type':Sequelize[_0xed69('0x5')]()},'description':{'type':Sequelize[_0xed69('0x3')]},'interval':{'type':Sequelize[_0xed69('0x3')],'defaultValue':_0xed69('0x6')}}; \ No newline at end of file +var _0x9102=['sequelize','noop','STRING','*,*,*,*'];(function(_0x516a5c,_0x4d9afb){var _0x49503d=function(_0x2ae049){while(--_0x2ae049){_0x516a5c['push'](_0x516a5c['shift']());}};_0x49503d(++_0x4d9afb);}(_0x9102,0x1d4));var _0x2910=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x9102[_0x17406e];return _0x2bfc5a;};'use strict';var Sequelize=require(_0x2910('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2910('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2910('0x2')]},'interval':{'type':Sequelize[_0x2910('0x2')],'defaultValue':_0x2910('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c9aa3cf..adf102a 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 _0xd153=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','SmsApplication','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','length','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x13ebbe,_0x5d34bd){var _0x5d3316=function(_0x34e6bf){while(--_0x34e6bf){_0x13ebbe['push'](_0x13ebbe['shift']());}};_0x5d3316(++_0x5d34bd);}(_0xd153,0x80));var _0x3d15=function(_0x535ca3,_0x4a0792){_0x535ca3=_0x535ca3-0x0;var _0x265018=_0xd153[_0x535ca3];return _0x265018;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d15('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d15('0x1'));var rp=require(_0x3d15('0x2'));var moment=require(_0x3d15('0x3'));var BPromise=require(_0x3d15('0x4'));var Mustache=require(_0x3d15('0x5'));var util=require('util');var path=require(_0x3d15('0x6'));var sox=require('sox');var csv=require(_0x3d15('0x7'));var ejs=require(_0x3d15('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d15('0x9'));var squel=require(_0x3d15('0xa'));var crypto=require(_0x3d15('0xb'));var jsforce=require(_0x3d15('0xc'));var deskjs=require(_0x3d15('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3d15('0xe'));var Papa=require('papaparse');var Redis=require(_0x3d15('0xf'));var authService=require(_0x3d15('0x10'));var qs=require(_0x3d15('0x11'));var as=require(_0x3d15('0x12'));var hardwareService=require(_0x3d15('0x13'));var logger=require(_0x3d15('0x14'))('api');var utils=require(_0x3d15('0x15'));var config=require(_0x3d15('0x16'));var licenseUtil=require(_0x3d15('0x17'));var db=require(_0x3d15('0x18'))['db'];function respondWithStatusCode(_0x2f6abb,_0x3a4abd){_0x3a4abd=_0x3a4abd||0xcc;return function(_0x4a32ae){if(_0x4a32ae){return _0x2f6abb[_0x3d15('0x19')](_0x3a4abd);}return _0x2f6abb['status'](_0x3a4abd)['end']();};}function respondWithResult(_0x5bcf22,_0x4b5af4){_0x4b5af4=_0x4b5af4||0xc8;return function(_0xe92f84){if(_0xe92f84){return _0x5bcf22[_0x3d15('0x1a')](_0x4b5af4)['json'](_0xe92f84);}};}function respondWithFilteredResult(_0x1f1f7a,_0x463675){return function(_0x2ca8b5){if(_0x2ca8b5){var _0x275b1f=typeof _0x463675[_0x3d15('0x1b')]===_0x3d15('0x1c')&&typeof _0x463675[_0x3d15('0x1d')]==='undefined';var _0x45eb38=_0x2ca8b5[_0x3d15('0x1e')];var _0x53ddb4=_0x275b1f?0x0:_0x463675['offset'];var _0x26afad=_0x275b1f?_0x2ca8b5[_0x3d15('0x1e')]:_0x463675[_0x3d15('0x1b')]+_0x463675[_0x3d15('0x1d')];var _0x42e3bc;if(_0x26afad>=_0x45eb38){_0x26afad=_0x45eb38;_0x42e3bc=0xc8;}else{_0x42e3bc=0xce;}_0x1f1f7a[_0x3d15('0x1a')](_0x42e3bc);return _0x1f1f7a[_0x3d15('0x1f')](_0x3d15('0x20'),_0x53ddb4+'-'+_0x26afad+'/'+_0x45eb38)['json'](_0x2ca8b5);}return null;};}function patchUpdates(_0x541a6f){return function(_0x294b10){try{jsonpatch[_0x3d15('0x21')](_0x294b10,_0x541a6f,!![]);}catch(_0x94d7b9){return BPromise[_0x3d15('0x22')](_0x94d7b9);}return _0x294b10['save']();};}function saveUpdates(_0x355a06,_0x5c5901){return function(_0x259db1){if(_0x259db1){return _0x259db1[_0x3d15('0x23')](_0x355a06)[_0x3d15('0x24')](function(_0x4eb24c){return _0x4eb24c;});}return null;};}function removeEntity(_0x2fb97b,_0xab2fe2){return function(_0x42e715){if(_0x42e715){return _0x42e715[_0x3d15('0x25')]()[_0x3d15('0x24')](function(){_0x2fb97b[_0x3d15('0x1a')](0xcc)[_0x3d15('0x26')]();});}};}function handleEntityNotFound(_0x517ea9,_0x4e43ac){return function(_0x602b4){if(!_0x602b4){_0x517ea9[_0x3d15('0x19')](0x194);}return _0x602b4;};}function handleError(_0x1c9e21,_0x279561){_0x279561=_0x279561||0x1f4;return function(_0xc0971c){logger[_0x3d15('0x27')](_0xc0971c['stack']);if(_0xc0971c['name']){delete _0xc0971c[_0x3d15('0x28')];}_0x1c9e21['status'](_0x279561)[_0x3d15('0x29')](_0xc0971c);};}exports[_0x3d15('0x2a')]=function(_0x1245bc,_0x540eeb){var _0xdd5802={},_0x4e9eed={},_0x5f4251={'count':0x0,'rows':[]};var _0x1943ac=_[_0x3d15('0x2b')](db[_0x3d15('0x2c')][_0x3d15('0x2d')],function(_0x1a1495){return{'name':_0x1a1495['fieldName'],'type':_0x1a1495[_0x3d15('0x2e')]['key']};});_0x4e9eed[_0x3d15('0x2f')]=_[_0x3d15('0x2b')](_0x1943ac,_0x3d15('0x28'));_0x4e9eed['query']=_[_0x3d15('0x30')](_0x1245bc[_0x3d15('0x31')]);_0x4e9eed[_0x3d15('0x32')]=_[_0x3d15('0x33')](_0x4e9eed[_0x3d15('0x2f')],_0x4e9eed[_0x3d15('0x31')]);_0xdd5802[_0x3d15('0x34')]=_[_0x3d15('0x33')](_0x4e9eed[_0x3d15('0x2f')],qs['fields'](_0x1245bc[_0x3d15('0x31')][_0x3d15('0x35')]));_0xdd5802[_0x3d15('0x34')]=_0xdd5802['attributes']['length']?_0xdd5802[_0x3d15('0x34')]:_0x4e9eed['model'];if(!_0x1245bc[_0x3d15('0x31')][_0x3d15('0x36')](_0x3d15('0x37'))){_0xdd5802[_0x3d15('0x1d')]=qs[_0x3d15('0x1d')](_0x1245bc[_0x3d15('0x31')]['limit']);_0xdd5802[_0x3d15('0x1b')]=qs['offset'](_0x1245bc[_0x3d15('0x31')][_0x3d15('0x1b')]);}_0xdd5802[_0x3d15('0x38')]=qs['sort'](_0x1245bc['query'][_0x3d15('0x39')]);_0xdd5802['where']=qs['filters'](_[_0x3d15('0x3a')](_0x1245bc[_0x3d15('0x31')],_0x4e9eed['filters']),_0x1943ac);if(_0x1245bc[_0x3d15('0x31')][_0x3d15('0x3b')]){_0xdd5802[_0x3d15('0x3c')]=_['merge'](_0xdd5802['where'],{'$or':_[_0x3d15('0x2b')](_0x1943ac,function(_0x10ca5d){if(_0x10ca5d[_0x3d15('0x2e')]!=='VIRTUAL'){var _0x19a07a={};_0x19a07a[_0x10ca5d[_0x3d15('0x28')]]={'$like':'%'+_0x1245bc['query'][_0x3d15('0x3b')]+'%'};return _0x19a07a;}})});}_0xdd5802=_[_0x3d15('0x3d')]({},_0xdd5802,_0x1245bc[_0x3d15('0x3e')]);var _0x3ca734={'where':_0xdd5802['where']};return db[_0x3d15('0x2c')][_0x3d15('0x1e')](_0x3ca734)['then'](function(_0x29307c){_0x5f4251[_0x3d15('0x1e')]=_0x29307c;if(_0x1245bc[_0x3d15('0x31')][_0x3d15('0x3f')]){_0xdd5802[_0x3d15('0x40')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0xdd5802);})['then'](function(_0x1745e9){_0x5f4251[_0x3d15('0x41')]=_0x1745e9;return _0x5f4251;})['then'](respondWithFilteredResult(_0x540eeb,_0xdd5802))[_0x3d15('0x42')](handleError(_0x540eeb,null));};exports[_0x3d15('0x43')]=function(_0x34c548,_0x3cd2ba){var _0x546f48={'raw':!![],'where':{'id':_0x34c548[_0x3d15('0x44')]['id']}},_0x341655={};_0x341655[_0x3d15('0x2f')]=_['keys'](db['SmsApplication'][_0x3d15('0x2d')]);_0x341655[_0x3d15('0x31')]=_[_0x3d15('0x30')](_0x34c548[_0x3d15('0x31')]);_0x341655[_0x3d15('0x32')]=_[_0x3d15('0x33')](_0x341655['model'],_0x341655[_0x3d15('0x31')]);_0x546f48[_0x3d15('0x34')]=_[_0x3d15('0x33')](_0x341655['model'],qs[_0x3d15('0x35')](_0x34c548[_0x3d15('0x31')][_0x3d15('0x35')]));_0x546f48['attributes']=_0x546f48[_0x3d15('0x34')][_0x3d15('0x45')]?_0x546f48[_0x3d15('0x34')]:_0x341655['model'];if(_0x34c548[_0x3d15('0x31')][_0x3d15('0x3f')]){_0x546f48[_0x3d15('0x40')]=[{'all':!![]}];}_0x546f48=_['merge']({},_0x546f48,_0x34c548[_0x3d15('0x3e')]);return db['SmsApplication']['find'](_0x546f48)[_0x3d15('0x24')](handleEntityNotFound(_0x3cd2ba,null))[_0x3d15('0x24')](respondWithResult(_0x3cd2ba,null))[_0x3d15('0x42')](handleError(_0x3cd2ba,null));};exports[_0x3d15('0x46')]=function(_0x132581,_0x10cbb2){return db[_0x3d15('0x2c')]['create'](_0x132581['body'],{})[_0x3d15('0x24')](respondWithResult(_0x10cbb2,0xc9))[_0x3d15('0x42')](handleError(_0x10cbb2,null));};exports['update']=function(_0x25d43e,_0x5507dc){if(_0x25d43e[_0x3d15('0x47')]['id']){delete _0x25d43e[_0x3d15('0x47')]['id'];}return db['SmsApplication']['find']({'where':{'id':_0x25d43e[_0x3d15('0x44')]['id']}})['then'](handleEntityNotFound(_0x5507dc,null))[_0x3d15('0x24')](saveUpdates(_0x25d43e[_0x3d15('0x47')],null))['then'](respondWithResult(_0x5507dc,null))['catch'](handleError(_0x5507dc,null));};exports['destroy']=function(_0x3a81f8,_0x3a0491){return db[_0x3d15('0x2c')][_0x3d15('0x48')]({'where':{'id':_0x3a81f8[_0x3d15('0x44')]['id']}})[_0x3d15('0x24')](handleEntityNotFound(_0x3a0491,null))['then'](removeEntity(_0x3a0491,null))[_0x3d15('0x42')](handleError(_0x3a0491,null));}; \ No newline at end of file +var _0xb852=['find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','SmsApplication','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0xb852,0x161));var _0x2b85=function(_0x289efb,_0x25de41){_0x289efb=_0x289efb-0x0;var _0x512eee=_0xb852[_0x289efb];return _0x512eee;};'use strict';var emlformat=require(_0x2b85('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b85('0x1'));var jsonpatch=require(_0x2b85('0x2'));var rp=require(_0x2b85('0x3'));var moment=require(_0x2b85('0x4'));var BPromise=require(_0x2b85('0x5'));var Mustache=require(_0x2b85('0x6'));var util=require(_0x2b85('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2b85('0x8'));var ejs=require(_0x2b85('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b85('0xa'));var squel=require(_0x2b85('0xb'));var crypto=require(_0x2b85('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2b85('0xd'));var Papa=require(_0x2b85('0xe'));var Redis=require(_0x2b85('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2b85('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b85('0x11'));var utils=require(_0x2b85('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2b85('0x13'))['db'];function respondWithStatusCode(_0x5dae15,_0x1d6a8d){_0x1d6a8d=_0x1d6a8d||0xcc;return function(_0x52e533){if(_0x52e533){return _0x5dae15[_0x2b85('0x14')](_0x1d6a8d);}return _0x5dae15[_0x2b85('0x15')](_0x1d6a8d)['end']();};}function respondWithResult(_0x3e445b,_0x578be9){_0x578be9=_0x578be9||0xc8;return function(_0x2dca31){if(_0x2dca31){return _0x3e445b[_0x2b85('0x15')](_0x578be9)[_0x2b85('0x16')](_0x2dca31);}};}function respondWithFilteredResult(_0x36ee0d,_0x106962){return function(_0x324d06){if(_0x324d06){var _0x4fa91e=typeof _0x106962[_0x2b85('0x17')]===_0x2b85('0x18')&&typeof _0x106962[_0x2b85('0x19')]===_0x2b85('0x18');var _0x472075=_0x324d06[_0x2b85('0x1a')];var _0x543046=_0x4fa91e?0x0:_0x106962['offset'];var _0x21dc4e=_0x4fa91e?_0x324d06[_0x2b85('0x1a')]:_0x106962['offset']+_0x106962[_0x2b85('0x19')];var _0x1e5984;if(_0x21dc4e>=_0x472075){_0x21dc4e=_0x472075;_0x1e5984=0xc8;}else{_0x1e5984=0xce;}_0x36ee0d[_0x2b85('0x15')](_0x1e5984);return _0x36ee0d['set'](_0x2b85('0x1b'),_0x543046+'-'+_0x21dc4e+'/'+_0x472075)[_0x2b85('0x16')](_0x324d06);}return null;};}function patchUpdates(_0x23d024){return function(_0x1105a1){try{jsonpatch[_0x2b85('0x1c')](_0x1105a1,_0x23d024,!![]);}catch(_0x42c198){return BPromise[_0x2b85('0x1d')](_0x42c198);}return _0x1105a1[_0x2b85('0x1e')]();};}function saveUpdates(_0x3cb229,_0x56c6ee){return function(_0xaa4313){if(_0xaa4313){return _0xaa4313[_0x2b85('0x1f')](_0x3cb229)[_0x2b85('0x20')](function(_0x18909a){return _0x18909a;});}return null;};}function removeEntity(_0x2e31e5,_0x2b9fdd){return function(_0xbc515f){if(_0xbc515f){return _0xbc515f[_0x2b85('0x21')]()[_0x2b85('0x20')](function(){_0x2e31e5['status'](0xcc)[_0x2b85('0x22')]();});}};}function handleEntityNotFound(_0x13edf9,_0x766a34){return function(_0x2a7949){if(!_0x2a7949){_0x13edf9[_0x2b85('0x14')](0x194);}return _0x2a7949;};}function handleError(_0x286bf0,_0x1f06dc){_0x1f06dc=_0x1f06dc||0x1f4;return function(_0x437e31){logger[_0x2b85('0x23')](_0x437e31['stack']);if(_0x437e31[_0x2b85('0x24')]){delete _0x437e31[_0x2b85('0x24')];}_0x286bf0[_0x2b85('0x15')](_0x1f06dc)[_0x2b85('0x25')](_0x437e31);};}exports[_0x2b85('0x26')]=function(_0x2d32a7,_0x289e41){var _0x23c3c4={},_0xddfdfb={},_0x375eaa={'count':0x0,'rows':[]};var _0xb8d5c7=_['map'](db[_0x2b85('0x27')]['rawAttributes'],function(_0x461a16){return{'name':_0x461a16[_0x2b85('0x28')],'type':_0x461a16[_0x2b85('0x29')][_0x2b85('0x2a')]};});_0xddfdfb[_0x2b85('0x2b')]=_['map'](_0xb8d5c7,_0x2b85('0x24'));_0xddfdfb['query']=_[_0x2b85('0x2c')](_0x2d32a7['query']);_0xddfdfb[_0x2b85('0x2d')]=_[_0x2b85('0x2e')](_0xddfdfb['model'],_0xddfdfb[_0x2b85('0x2f')]);_0x23c3c4['attributes']=_[_0x2b85('0x2e')](_0xddfdfb[_0x2b85('0x2b')],qs[_0x2b85('0x30')](_0x2d32a7[_0x2b85('0x2f')][_0x2b85('0x30')]));_0x23c3c4[_0x2b85('0x31')]=_0x23c3c4[_0x2b85('0x31')][_0x2b85('0x32')]?_0x23c3c4[_0x2b85('0x31')]:_0xddfdfb[_0x2b85('0x2b')];if(!_0x2d32a7['query'][_0x2b85('0x33')](_0x2b85('0x34'))){_0x23c3c4[_0x2b85('0x19')]=qs['limit'](_0x2d32a7['query']['limit']);_0x23c3c4[_0x2b85('0x17')]=qs[_0x2b85('0x17')](_0x2d32a7[_0x2b85('0x2f')][_0x2b85('0x17')]);}_0x23c3c4[_0x2b85('0x35')]=qs[_0x2b85('0x36')](_0x2d32a7[_0x2b85('0x2f')][_0x2b85('0x36')]);_0x23c3c4[_0x2b85('0x37')]=qs['filters'](_[_0x2b85('0x38')](_0x2d32a7['query'],_0xddfdfb['filters']),_0xb8d5c7);if(_0x2d32a7[_0x2b85('0x2f')]['filter']){_0x23c3c4[_0x2b85('0x37')]=_[_0x2b85('0x39')](_0x23c3c4['where'],{'$or':_['map'](_0xb8d5c7,function(_0x810fdb){if(_0x810fdb[_0x2b85('0x29')]!=='VIRTUAL'){var _0x57987c={};_0x57987c[_0x810fdb[_0x2b85('0x24')]]={'$like':'%'+_0x2d32a7[_0x2b85('0x2f')][_0x2b85('0x3a')]+'%'};return _0x57987c;}})});}_0x23c3c4=_[_0x2b85('0x39')]({},_0x23c3c4,_0x2d32a7[_0x2b85('0x3b')]);var _0x3cc78e={'where':_0x23c3c4[_0x2b85('0x37')]};return db[_0x2b85('0x27')][_0x2b85('0x1a')](_0x3cc78e)[_0x2b85('0x20')](function(_0xac3366){_0x375eaa[_0x2b85('0x1a')]=_0xac3366;if(_0x2d32a7['query'][_0x2b85('0x3c')]){_0x23c3c4[_0x2b85('0x3d')]=[{'all':!![]}];}return db[_0x2b85('0x27')][_0x2b85('0x3e')](_0x23c3c4);})[_0x2b85('0x20')](function(_0x42ff60){_0x375eaa[_0x2b85('0x3f')]=_0x42ff60;return _0x375eaa;})[_0x2b85('0x20')](respondWithFilteredResult(_0x289e41,_0x23c3c4))[_0x2b85('0x40')](handleError(_0x289e41,null));};exports['show']=function(_0xa1aca1,_0x1c6b5f){var _0x1de2c0={'raw':!![],'where':{'id':_0xa1aca1[_0x2b85('0x41')]['id']}},_0x4c0180={};_0x4c0180[_0x2b85('0x2b')]=_[_0x2b85('0x2c')](db[_0x2b85('0x27')][_0x2b85('0x42')]);_0x4c0180[_0x2b85('0x2f')]=_[_0x2b85('0x2c')](_0xa1aca1[_0x2b85('0x2f')]);_0x4c0180[_0x2b85('0x2d')]=_[_0x2b85('0x2e')](_0x4c0180[_0x2b85('0x2b')],_0x4c0180[_0x2b85('0x2f')]);_0x1de2c0[_0x2b85('0x31')]=_['intersection'](_0x4c0180[_0x2b85('0x2b')],qs[_0x2b85('0x30')](_0xa1aca1[_0x2b85('0x2f')][_0x2b85('0x30')]));_0x1de2c0[_0x2b85('0x31')]=_0x1de2c0[_0x2b85('0x31')]['length']?_0x1de2c0[_0x2b85('0x31')]:_0x4c0180[_0x2b85('0x2b')];if(_0xa1aca1[_0x2b85('0x2f')][_0x2b85('0x3c')]){_0x1de2c0[_0x2b85('0x3d')]=[{'all':!![]}];}_0x1de2c0=_[_0x2b85('0x39')]({},_0x1de2c0,_0xa1aca1['options']);return db[_0x2b85('0x27')][_0x2b85('0x43')](_0x1de2c0)[_0x2b85('0x20')](handleEntityNotFound(_0x1c6b5f,null))[_0x2b85('0x20')](respondWithResult(_0x1c6b5f,null))[_0x2b85('0x40')](handleError(_0x1c6b5f,null));};exports[_0x2b85('0x44')]=function(_0xb14bc7,_0x14d156){return db['SmsApplication'][_0x2b85('0x44')](_0xb14bc7[_0x2b85('0x45')],{})[_0x2b85('0x20')](respondWithResult(_0x14d156,0xc9))[_0x2b85('0x40')](handleError(_0x14d156,null));};exports['update']=function(_0x38aa8c,_0x5e920c){if(_0x38aa8c[_0x2b85('0x45')]['id']){delete _0x38aa8c[_0x2b85('0x45')]['id'];}return db[_0x2b85('0x27')][_0x2b85('0x43')]({'where':{'id':_0x38aa8c['params']['id']}})['then'](handleEntityNotFound(_0x5e920c,null))[_0x2b85('0x20')](saveUpdates(_0x38aa8c[_0x2b85('0x45')],null))[_0x2b85('0x20')](respondWithResult(_0x5e920c,null))[_0x2b85('0x40')](handleError(_0x5e920c,null));};exports[_0x2b85('0x21')]=function(_0x32621b,_0x5ce53d){return db['SmsApplication'][_0x2b85('0x43')]({'where':{'id':_0x32621b[_0x2b85('0x41')]['id']}})[_0x2b85('0x20')](handleEntityNotFound(_0x5ce53d,null))[_0x2b85('0x20')](removeEntity(_0x5ce53d,null))[_0x2b85('0x40')](handleError(_0x5ce53d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c32d0e7..2e9a07b 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 _0xdc9f=['exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x5dd799,_0x591d52){var _0x3a7037=function(_0x33d623){while(--_0x33d623){_0x5dd799['push'](_0x5dd799['shift']());}};_0x3a7037(++_0x591d52);}(_0xdc9f,0x8d));var _0xfdc9=function(_0xe6a53e,_0x3fe3b7){_0xe6a53e=_0xe6a53e-0x0;var _0x2f87ea=_0xdc9f[_0xe6a53e];return _0x2f87ea;};'use strict';var _=require(_0xfdc9('0x0'));var util=require('util');var logger=require(_0xfdc9('0x1'))(_0xfdc9('0x2'));var moment=require(_0xfdc9('0x3'));var BPromise=require(_0xfdc9('0x4'));var rp=require(_0xfdc9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfdc9('0x6'));var config=require(_0xfdc9('0x7'));var attributes=require(_0xfdc9('0x8'));module[_0xfdc9('0x9')]=function(_0x490bdf,_0x322b9c){return _0x490bdf[_0xfdc9('0xa')](_0xfdc9('0xb'),attributes,{'tableName':_0xfdc9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfdc9('0xd'),'collate':_0xfdc9('0xe')});}; \ No newline at end of file +var _0xe0d6=['path','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b82cb,_0x44ed33){var _0x4789ac=function(_0x4be1ee){while(--_0x4be1ee){_0x5b82cb['push'](_0x5b82cb['shift']());}};_0x4789ac(++_0x44ed33);}(_0xe0d6,0x13f));var _0x6e0d=function(_0x331bb6,_0x17327b){_0x331bb6=_0x331bb6-0x0;var _0x170b47=_0xe0d6[_0x331bb6];return _0x170b47;};'use strict';var _=require('lodash');var util=require(_0x6e0d('0x0'));var logger=require(_0x6e0d('0x1'))(_0x6e0d('0x2'));var moment=require(_0x6e0d('0x3'));var BPromise=require(_0x6e0d('0x4'));var rp=require(_0x6e0d('0x5'));var fs=require('fs');var path=require(_0x6e0d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e0d('0x7'));module[_0x6e0d('0x8')]=function(_0x605dab,_0x4a39e6){return _0x605dab['define'](_0x6e0d('0x9'),attributes,{'tableName':_0x6e0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e0d('0xb'),'collate':_0x6e0d('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index e3922d9..f05301e 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 _0x4c4a=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x148529,_0x2b8d41){_0x148529=_0x148529-0x0;var _0x27c7eb=_0x4c4a[_0x148529];return _0x27c7eb;};'use strict';var _=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var moment=require(_0xa4c4('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4c4('0x3'));var fs=require('fs');var Redis=require(_0xa4c4('0x4'));var db=require(_0xa4c4('0x5'))['db'];var utils=require(_0xa4c4('0x6'));var logger=require('../../config/logger')(_0xa4c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xa4c4('0x8'));var client=jayson[_0xa4c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557596,_0x11b498,_0x553525){return new BPromise(function(_0x27b877,_0x118d89){return client[_0xa4c4('0xa')](_0x557596,_0x553525)['then'](function(_0x5ec64c){logger[_0xa4c4('0xb')](_0xa4c4('0xc'),_0x11b498,_0xa4c4('0xd'));logger[_0xa4c4('0xe')](_0xa4c4('0xf'),_0x11b498,'request\x20sent',JSON[_0xa4c4('0x10')](_0x5ec64c));if(_0x5ec64c['error']){if(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x12')]===0x1f4){logger[_0xa4c4('0x11')](_0xa4c4('0xc'),_0x11b498,_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);return _0x118d89(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);}logger[_0xa4c4('0x11')]('SmsApplication,\x20%s,\x20%s',_0x11b498,_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);return _0x27b877(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);}else{logger[_0xa4c4('0xb')](_0xa4c4('0xc'),_0x11b498,_0xa4c4('0xd'));_0x27b877(_0x5ec64c['result'][_0xa4c4('0x13')]);}})[_0xa4c4('0x14')](function(_0x4b2f2d){logger[_0xa4c4('0x11')](_0xa4c4('0xc'),_0x11b498,_0x4b2f2d);_0x118d89(_0x4b2f2d);});});} \ No newline at end of file +var _0xd232=['then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x51606,_0x3bbf4b){var _0x2c76ce=function(_0x4a4b1a){while(--_0x4a4b1a){_0x51606['push'](_0x51606['shift']());}};_0x2c76ce(++_0x3bbf4b);}(_0xd232,0x74));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2d23('0x0'));var util=require('util');var moment=require(_0x2d23('0x1'));var BPromise=require(_0x2d23('0x2'));var rs=require(_0x2d23('0x3'));var fs=require('fs');var Redis=require(_0x2d23('0x4'));var db=require(_0x2d23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d23('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d23('0x7')][_0x2d23('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15c735,_0x53ac18,_0x18cac8){return new BPromise(function(_0x4cf7f4,_0x2c4667){return client[_0x2d23('0x9')](_0x15c735,_0x18cac8)[_0x2d23('0xa')](function(_0x7847cb){logger[_0x2d23('0xb')](_0x2d23('0xc'),_0x53ac18,_0x2d23('0xd'));logger['debug'](_0x2d23('0xe'),_0x53ac18,_0x2d23('0xd'),JSON[_0x2d23('0xf')](_0x7847cb));if(_0x7847cb[_0x2d23('0x10')]){if(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x11')]===0x1f4){logger[_0x2d23('0x10')](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x2c4667(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}logger['error'](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x4cf7f4(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}else{logger['info'](_0x2d23('0xc'),_0x53ac18,'request\x20sent');_0x4cf7f4(_0x7847cb[_0x2d23('0x13')]['message']);}})[_0x2d23('0x14')](function(_0x30b578){logger['error']('SmsApplication,\x20%s,\x20%s',_0x53ac18,_0x30b578);_0x2c4667(_0x30b578);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index da440c8..5f3cf13 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 _0x4024=['addTags','put','smsinteraction:update','update','delete','destroy','removeTags','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x4024,0x89));var _0x4402=function(_0x38238b,_0x5ea2f1){_0x38238b=_0x38238b-0x0;var _0x4e5544=_0x4024[_0x38238b];return _0x4e5544;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/describe',auth[_0x4402('0x7')](),controller['describe']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4402('0x9')]('/:id/messages',auth[_0x4402('0x7')](),controller['getMessages']);router[_0x4402('0x9')]('/:id/download',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xc')]);router[_0x4402('0xd')]('/:id/messages',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xd')](_0x4402('0xf'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')](_0x4402('0x11'),_0x4402('0x12')),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0xa'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')](_0x4402('0x11'),_0x4402('0x15')),controller[_0x4402('0x16')]);router[_0x4402('0x17')](_0x4402('0xa'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')]('sms','smsinteraction:destroy'),controller[_0x4402('0x18')]);router[_0x4402('0x17')]('/:id/tags',auth[_0x4402('0x7')](),controller[_0x4402('0x19')]);module['exports']=router; \ No newline at end of file +var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46333f,_0x40a643){var _0x2159e4=function(_0x332944){while(--_0x332944){_0x46333f['push'](_0x46333f['shift']());}};_0x2159e4(++_0x40a643);}(_0xe605,0x92));var _0x5e60=function(_0x5d9d89,_0x30e69a){_0x5d9d89=_0x5d9d89-0x0;var _0x1103c3=_0xe605[_0x5d9d89];return _0x1103c3;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index cdce517..596bd93 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 _0x55ca=['sequelize','moment','STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x55ca,0x126));var _0xa55c=function(_0x18849b,_0x530b07){_0x18849b=_0x18849b-0x0;var _0x23b2df=_0x55ca[_0x18849b];return _0x23b2df;};'use strict';var Sequelize=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa55c('0x2')]},'secondDisposition':{'type':Sequelize[_0xa55c('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa55c('0x2')]},'phone':{'type':Sequelize[_0xa55c('0x2')]},'read1stAt':{'type':Sequelize[_0xa55c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa55c('0x4')]('in',_0xa55c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa55c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa55c('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa55c('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x96aa=['BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x2ef30f,_0x3308b0){var _0x10f1ee=function(_0x5ae0c9){while(--_0x5ae0c9){_0x2ef30f['push'](_0x2ef30f['shift']());}};_0x10f1ee(++_0x3308b0);}(_0x96aa,0x67));var _0xa96a=function(_0x14c0fd,_0x2fb554){_0x14c0fd=_0x14c0fd-0x0;var _0x32fa2a=_0x96aa[_0x14c0fd];return _0x32fa2a;};'use strict';var Sequelize=require(_0xa96a('0x0'));var moment=require(_0xa96a('0x1'));module['exports']={'closed':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa96a('0x3')]},'disposition':{'type':Sequelize[_0xa96a('0x4')]},'secondDisposition':{'type':Sequelize[_0xa96a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa96a('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa96a('0x4')]},'read1stAt':{'type':Sequelize[_0xa96a('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa96a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa96a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa96a('0x6')]('in',_0xa96a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa96a('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index cf152ab..801509f 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 _0x989d=['err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','stack','name','send','map','SmsInteraction','rawAttributes','fieldName','type','key','sms','query','user','catch','show','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','SmsMessage','ids','getMessages','nolimit','order','sort','pick','where','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','toString','join','root','server','files','format','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','createdAt','direction','secret','read','Owner','mkdirSync','Account','N.A.','closed','closedAt','Messages','out','Contact','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log'];(function(_0x4deedc,_0x507c03){var _0x51a361=function(_0x1e0a2d){while(--_0x1e0a2d){_0x4deedc['push'](_0x4deedc['shift']());}};_0x51a361(++_0x507c03);}(_0x989d,0x1de));var _0xd989=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x989d[_0x413feb];return _0x40ee88;};'use strict';var rimraf=require(_0xd989('0x0'));var zipdir=require(_0xd989('0x1'));var moment=require(_0xd989('0x2'));var BPromise=require(_0xd989('0x3'));var util=require(_0xd989('0x4'));var path=require(_0xd989('0x5'));var ejs=require(_0xd989('0x6'));var fs=require('fs');var _=require(_0xd989('0x7'));var Redis=require(_0xd989('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xd989('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xd989('0xa'))(_0xd989('0xb'));var config=require(_0xd989('0xc'));var db=require(_0xd989('0xd'))['db'];config[_0xd989('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd989('0xf'))(new Redis(config[_0xd989('0xe')]));require(_0xd989('0x10'))[_0xd989('0x11')](socket);function respondWithStatusCode(_0x41ef30,_0x4ad49a){_0x4ad49a=_0x4ad49a||0xcc;return function(_0x333382){if(_0x333382){return _0x41ef30[_0xd989('0x12')](_0x4ad49a);}return _0x41ef30[_0xd989('0x13')](_0x4ad49a)[_0xd989('0x14')]();};}function respondWithResult(_0x257782,_0x386ba0){_0x386ba0=_0x386ba0||0xc8;return function(_0x2117af){if(_0x2117af){return _0x257782[_0xd989('0x13')](_0x386ba0)[_0xd989('0x15')](_0x2117af);}};}function respondWithFilteredResult(_0x442cc9,_0x102ad3){return function(_0x10df72){if(_0x10df72){var _0x54ac01=typeof _0x102ad3[_0xd989('0x16')]===_0xd989('0x17')&&typeof _0x102ad3[_0xd989('0x18')]===_0xd989('0x17');var _0x75a554=_0x10df72['count'];var _0x52ad94=_0x54ac01?0x0:_0x102ad3[_0xd989('0x16')];var _0x4bde95=_0x54ac01?_0x10df72[_0xd989('0x19')]:_0x102ad3[_0xd989('0x16')]+_0x102ad3['limit'];var _0x470835;if(_0x4bde95>=_0x75a554){_0x4bde95=_0x75a554;_0x470835=0xc8;}else{_0x470835=0xce;}_0x442cc9[_0xd989('0x13')](_0x470835);return _0x442cc9['set'](_0xd989('0x1a'),_0x52ad94+'-'+_0x4bde95+'/'+_0x75a554)[_0xd989('0x15')](_0x10df72);}return null;};}function saveUpdates(_0x372ecc){return function(_0x399aab){if(_0x399aab){return _0x399aab[_0xd989('0x1b')](_0x372ecc)[_0xd989('0x1c')](function(_0x450a1c){return _0x450a1c;});}return null;};}function removeEntity(_0x2fdb8a){return function(_0x2abcf7){if(_0x2abcf7){return _0x2abcf7[_0xd989('0x1d')]()[_0xd989('0x1c')](function(){_0x2fdb8a[_0xd989('0x13')](0xcc)[_0xd989('0x14')]();});}};}function handleEntityNotFound(_0x138498){return function(_0x1dd216){if(!_0x1dd216){_0x138498[_0xd989('0x12')](0x194);}return _0x1dd216;};}function handleError(_0x4ce696,_0x3d4ad2){_0x3d4ad2=_0x3d4ad2||0x1f4;return function(_0x510d00){logger['error'](_0x510d00[_0xd989('0x1e')]);if(_0x510d00[_0xd989('0x1f')]){delete _0x510d00['name'];}_0x4ce696[_0xd989('0x13')](_0x3d4ad2)[_0xd989('0x20')](_0x510d00);};}exports['index']=function(_0x3ad05a,_0xa88bda){var _0x23f629={};var _0x4bab76=_[_0xd989('0x21')](db[_0xd989('0x22')][_0xd989('0x23')],function(_0x4ded99){return{'name':_0x4ded99[_0xd989('0x24')],'type':_0x4ded99[_0xd989('0x25')][_0xd989('0x26')]};});_0x23f629=qs['getOptions'](_0x4bab76,_0x3ad05a);return interaction['findAll'](_0xd989('0x27'),_0x3ad05a[_0xd989('0x28')],_0x3ad05a[_0xd989('0x29')],_0x23f629,_0x4bab76)[_0xd989('0x1c')](respondWithFilteredResult(_0xa88bda,_0x23f629))[_0xd989('0x2a')](handleError(_0xa88bda,null));};exports[_0xd989('0x2b')]=function(_0x124964,_0x223629){var _0x4759f6={'raw':![],'where':{'id':_0x124964['params']['id']}},_0x24720d={};_0x24720d['model']=_[_0xd989('0x2c')](db['SmsInteraction'][_0xd989('0x23')]);_0x24720d[_0xd989('0x28')]=_[_0xd989('0x2c')](_0x124964[_0xd989('0x28')]);_0x24720d[_0xd989('0x2d')]=_[_0xd989('0x2e')](_0x24720d[_0xd989('0x2f')],_0x24720d['query']);_0x4759f6[_0xd989('0x30')]=_[_0xd989('0x2e')](_0x24720d['model'],qs[_0xd989('0x31')](_0x124964[_0xd989('0x28')]['fields']));_0x4759f6['attributes']=_0x4759f6[_0xd989('0x30')][_0xd989('0x32')]?_0x4759f6[_0xd989('0x30')]:_0x24720d[_0xd989('0x2f')];if(_0x124964[_0xd989('0x28')][_0xd989('0x33')]){_0x4759f6[_0xd989('0x34')]=[{'all':!![]}];}_0x4759f6=_[_0xd989('0x35')]({},_0x4759f6,_0x124964[_0xd989('0x36')]);return db['SmsInteraction'][_0xd989('0x37')](_0x4759f6)['then'](handleEntityNotFound(_0x223629,null))[_0xd989('0x1c')](respondWithResult(_0x223629,null))[_0xd989('0x2a')](handleError(_0x223629,null));};exports[_0xd989('0x38')]=function(_0x38b8b3,_0x10ecc1){return db[_0xd989('0x22')][_0xd989('0x38')](_0x38b8b3['body'],{})[_0xd989('0x1c')](respondWithResult(_0x10ecc1,0xc9))[_0xd989('0x2a')](handleError(_0x10ecc1,null));};exports[_0xd989('0x1b')]=function(_0x489fed,_0x59c998){if(_0x489fed['body']['id']){delete _0x489fed[_0xd989('0x39')]['id'];}return db[_0xd989('0x22')][_0xd989('0x37')]({'where':{'id':_0x489fed[_0xd989('0x3a')]['id']}})[_0xd989('0x1c')](handleEntityNotFound(_0x59c998,null))[_0xd989('0x1c')](saveUpdates(_0x489fed[_0xd989('0x39')],null))['then'](respondWithResult(_0x59c998,null))[_0xd989('0x2a')](handleError(_0x59c998,null));};exports[_0xd989('0x1d')]=function(_0x48249d,_0x437389){return db[_0xd989('0x22')][_0xd989('0x37')]({'where':{'id':_0x48249d[_0xd989('0x3a')]['id']}})[_0xd989('0x1c')](handleEntityNotFound(_0x437389,null))[_0xd989('0x1c')](removeEntity(_0x437389,null))['catch'](handleError(_0x437389,null));};exports[_0xd989('0x3b')]=function(_0x1f7776,_0x20ac1a){return db[_0xd989('0x22')]['describe']()[_0xd989('0x1c')](respondWithResult(_0x20ac1a,null))[_0xd989('0x2a')](handleError(_0x20ac1a,null));};exports[_0xd989('0x3c')]=function(_0x2cbd8b,_0x6e59b){return db[_0xd989('0x3d')][_0xd989('0x37')]({'where':{'id':_0x2cbd8b['params']['id']}})['then'](handleEntityNotFound(_0x6e59b,null))[_0xd989('0x1c')](function(_0x2b7fd4){if(_0x2b7fd4){return _0x2b7fd4[_0xd989('0x3c')](_0x2cbd8b[_0xd989('0x39')][_0xd989('0x3e')],_['omit'](_0x2cbd8b[_0xd989('0x39')],[_0xd989('0x3e'),'id'])||{});}})[_0xd989('0x1c')](respondWithResult(_0x6e59b,null))[_0xd989('0x2a')](handleError(_0x6e59b,null));};exports[_0xd989('0x3f')]=function(_0x1df795,_0x53dbb8){var _0x5846e5={'raw':![],'where':{}};var _0x2e6274={};var _0x38fa1a={'count':0x0,'rows':[]};return db[_0xd989('0x22')]['findOne']({'where':{'id':_0x1df795[_0xd989('0x3a')]['id']}})[_0xd989('0x1c')](handleEntityNotFound(_0x53dbb8,null))[_0xd989('0x1c')](function(_0x40aa4f){if(_0x40aa4f){_0x2e6274[_0xd989('0x2f')]=_[_0xd989('0x2c')](db['SmsMessage']['rawAttributes']);_0x2e6274[_0xd989('0x28')]=_['keys'](_0x1df795[_0xd989('0x28')]);_0x2e6274[_0xd989('0x2d')]=_[_0xd989('0x2e')](_0x2e6274['model'],_0x2e6274[_0xd989('0x28')]);_0x5846e5[_0xd989('0x30')]=_[_0xd989('0x2e')](_0x2e6274[_0xd989('0x2f')],qs['fields'](_0x1df795['query'][_0xd989('0x31')]));_0x5846e5[_0xd989('0x30')]=_0x5846e5[_0xd989('0x30')]['length']?_0x5846e5['attributes']:_0x2e6274[_0xd989('0x2f')];if(!_0x1df795[_0xd989('0x28')]['hasOwnProperty'](_0xd989('0x40'))){_0x5846e5[_0xd989('0x18')]=qs[_0xd989('0x18')](_0x1df795[_0xd989('0x28')][_0xd989('0x18')]);_0x5846e5['offset']=qs[_0xd989('0x16')](_0x1df795[_0xd989('0x28')][_0xd989('0x16')]);}_0x5846e5[_0xd989('0x41')]=qs[_0xd989('0x42')](_0x1df795[_0xd989('0x28')][_0xd989('0x42')]);_0x5846e5['where']=qs[_0xd989('0x2d')](_[_0xd989('0x43')](_0x1df795['query'],_0x2e6274[_0xd989('0x2d')]));_0x5846e5[_0xd989('0x44')][_0xd989('0x45')]=_0x40aa4f['id'];if(_0x1df795[_0xd989('0x28')]['filter']){_0x5846e5[_0xd989('0x44')]=_[_0xd989('0x35')](_0x5846e5['where'],{'$or':_[_0xd989('0x21')](_0x5846e5[_0xd989('0x30')],function(_0x36df73){var _0x2456d3={};_0x2456d3[_0x36df73]={'$like':'%'+_0x1df795[_0xd989('0x28')][_0xd989('0x46')]+'%'};return _0x2456d3;})});}if(_0x1df795[_0xd989('0x28')][_0xd989('0x47')]){var _0x42aaca=_0x1df795[_0xd989('0x28')][_0xd989('0x47')][_0xd989('0x48')](',');var _0x37a14b={};_0x37a14b[_0x42aaca[0x0]]={'$gte':moment(_0x42aaca[0x1])['format'](_0xd989('0x49'))};_0x5846e5['where']=_[_0xd989('0x35')](_0x5846e5[_0xd989('0x44')],_0x37a14b);}_0x5846e5=_[_0xd989('0x35')]({},_0x5846e5,_0x1df795[_0xd989('0x36')]);return db['SmsMessage'][_0xd989('0x19')]({'where':_0x5846e5[_0xd989('0x44')]})[_0xd989('0x1c')](function(_0x50acaf){_0x38fa1a['count']=_0x50acaf;if(_0x1df795[_0xd989('0x28')][_0xd989('0x33')]){_0x5846e5[_0xd989('0x34')]=[{'all':!![]}];}return db[_0xd989('0x3d')][_0xd989('0x4a')](_0x5846e5);})['then'](function(_0x573e09){_0x38fa1a[_0xd989('0x4b')]=_0x573e09;return _0x38fa1a;});}})[_0xd989('0x1c')](respondWithFilteredResult(_0x53dbb8,_0x5846e5))[_0xd989('0x2a')](handleError(_0x53dbb8,null));};exports[_0xd989('0x4c')]=function(_0x486bed,_0xb048aa){return db[_0xd989('0x22')][_0xd989('0x37')]({'where':{'id':_0x486bed[_0xd989('0x3a')]['id']}})[_0xd989('0x1c')](handleEntityNotFound(_0xb048aa,null))[_0xd989('0x1c')](function(_0x3e5e78){if(_0x3e5e78){return _0x3e5e78[_0xd989('0x4d')](_0x486bed[_0xd989('0x39')]['ids'],_['omit'](_0x486bed[_0xd989('0x39')],[_0xd989('0x3e'),'id'])||{})[_0xd989('0x4e')](function(){return db[_0xd989('0x4f')][_0xd989('0x4a')]({'attributes':['id',_0xd989('0x1f'),'color'],'where':{'id':_0x486bed[_0xd989('0x39')]['ids']}});})[_0xd989('0x1c')](function(_0x3fb83b){socket[_0xd989('0x50')](_0xd989('0x51'),{'id':Number(_0x486bed[_0xd989('0x3a')]['id']),'tags':_0x3fb83b||[]});return{'id':Number(_0x486bed[_0xd989('0x3a')]['id']),'tags':_0x3fb83b||[]};});}})[_0xd989('0x1c')](respondWithResult(_0xb048aa,null))[_0xd989('0x2a')](handleError(_0xb048aa,null));};exports['removeTags']=function(_0x22c815,_0x2bd6a1){return db['SmsInteraction'][_0xd989('0x37')]({'where':{'id':_0x22c815[_0xd989('0x3a')]['id']}})[_0xd989('0x1c')](handleEntityNotFound(_0x2bd6a1,null))['then'](function(_0x5b1c02){if(_0x5b1c02){return _0x5b1c02[_0xd989('0x52')](_0x22c815[_0xd989('0x28')][_0xd989('0x3e')]);}})[_0xd989('0x1c')](respondWithStatusCode(_0x2bd6a1,null))[_0xd989('0x2a')](handleError(_0x2bd6a1,null));};exports['download']=function(_0x4be2e1,_0x58d2e0){var _0x488d1e=moment()['unix']()[_0xd989('0x53')]();var _0x31fcb2=path[_0xd989('0x54')](config[_0xd989('0x55')],_0xd989('0x56'),_0xd989('0x57'),'tmp');var _0xc25a84=path[_0xd989('0x54')](_0x31fcb2,_0x488d1e);var _0x3bc9a7=util[_0xd989('0x58')](_0xd989('0x59'),_0x4be2e1[_0xd989('0x3a')]['id'],_0x488d1e);var _0x459326=path[_0xd989('0x54')](_0x31fcb2,_0x3bc9a7);var _0x492505=[];_0x492505[_0xd989('0x5a')]({'model':db[_0xd989('0x5b')],'as':_0xd989('0x5b'),'attributes':['id',_0xd989('0x5c')],'raw':!![]});_0x492505[_0xd989('0x5a')]({'model':db[_0xd989('0x5d')],'as':'Contact','attributes':['id',_0xd989('0x5e'),_0xd989('0x5f')],'raw':!![]});var _0xd37b60=[{'model':db[_0xd989('0x3d')],'as':'Messages','attributes':['id',_0xd989('0x39'),_0xd989('0x60'),_0xd989('0x61'),_0xd989('0x62'),_0xd989('0x63')],'include':_0x492505}];_0xd37b60[_0xd989('0x5a')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xd989('0x1f')]});_0xd37b60[_0xd989('0x5a')]({'model':db[_0xd989('0x5b')],'as':_0xd989('0x64'),'attributes':['id',_0xd989('0x5c')]});return db['SmsInteraction'][_0xd989('0x37')]({'where':{'id':_0x4be2e1[_0xd989('0x3a')]['id']},'include':_0xd37b60})[_0xd989('0x1c')](handleEntityNotFound(_0x58d2e0,null))[_0xd989('0x1c')](function(_0x24dfd1){if(_0x24dfd1){var _0x2149bc=_0x24dfd1['get']({'plain':!![]});fs[_0xd989('0x65')](_0xc25a84);var _0x2ab762={'channel':'Sms','account':_0x2149bc[_0xd989('0x66')][_0xd989('0x1f')],'agent':_0x2149bc[_0xd989('0x64')]?_0x2149bc[_0xd989('0x64')][_0xd989('0x5c')]:_0xd989('0x67'),'createdAt':moment(_0x2149bc[_0xd989('0x60')])[_0xd989('0x58')](_0xd989('0x49'))['toString'](),'closedAt':_0x2149bc[_0xd989('0x68')]?moment(_0x2149bc[_0xd989('0x69')])[_0xd989('0x58')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd989('0x53')]():'','disposition':_0x2149bc['disposition'],'messages':_(_0x2149bc[_0xd989('0x6a')])[_0xd989('0x46')]({'secret':![]})[_0xd989('0x21')](function(_0x1e912b){return{'date':moment(_0x1e912b[_0xd989('0x60')])[_0xd989('0x58')](_0xd989('0x49'))['toString'](),'sender':_0x1e912b[_0xd989('0x61')]===_0xd989('0x6b')?_0x1e912b[_0xd989('0x5b')]?_0x1e912b[_0xd989('0x5b')][_0xd989('0x5c')]:'System':_0x1e912b[_0xd989('0x6c')][_0xd989('0x5e')]+(_0x1e912b[_0xd989('0x6c')][_0xd989('0x5f')]?'\x20'+_0x1e912b[_0xd989('0x6c')]['lastName']:''),'body':_0x1e912b[_0xd989('0x39')],'direction':_0x1e912b[_0xd989('0x61')]===_0xd989('0x6b')?'A':'C','secret':_0x1e912b['secret'],'read':_0x1e912b['read']};})[_0xd989('0x6d')]()};return ejs[_0xd989('0x6e')](path[_0xd989('0x54')](config[_0xd989('0x55')],'server','views',_0xd989('0x6f')),{'interaction':_0x2ab762})[_0xd989('0x1c')](function(_0x424f41){var _0x4344be=path[_0xd989('0x54')](_0xc25a84,_0xd989('0x70')+_0x2149bc['id']+'-'+_0x488d1e+_0xd989('0x71'));var _0x2fa51a={'path':_0x4344be,'channel':'Sms','interactionId':_0x2149bc['id']};return pdf[_0xd989('0x72')](_0x424f41,_0x2fa51a);})['then'](function(){return new BPromise(function(_0x4cc305,_0x45486e){zipdir(_0xc25a84,{'saveTo':_0x459326},function(_0x9ffaa3,_0x489069){if(_0x9ffaa3)return _0x45486e(_0x9ffaa3);return _0x4cc305(_0x489069);});})['then'](function(){return new BPromise(function(_0x37c3e0,_0x552c0c){rimraf(_0xc25a84,function(_0x7eb6fd){if(_0x7eb6fd)_0x552c0c(_0x7eb6fd);return _0x37c3e0();});});})[_0xd989('0x1c')](function(){return _0x58d2e0[_0xd989('0x73')](_0x459326,_0x3bc9a7,function(_0x151fe0){if(_0x151fe0){console[_0xd989('0x74')](_0xd989('0x75'),_0x151fe0);}else{fs[_0xd989('0x76')](_0x459326);}});});});}else{return _0x58d2e0[_0xd989('0x12')](0xc8);}})['catch'](handleError(_0x58d2e0,null));}; \ No newline at end of file +var _0x56ea=['fields','length','includeAll','include','merge','options','create','body','describe','addMessage','SmsMessage','find','getMessages','filters','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','addTags','setTags','ids','omit','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','root','tmp','format','transcript-%d-%s.zip','join','User','push','CmContact','firstName','lastName','createdAt','direction','read','SmsAccount','Owner','fullname','mkdirSync','Sms','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','System','Contact','out','secret','renderFile','server','views','.pdf','createPdfFromHTML','rimraf','zip-dir','moment','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./smsInteraction.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','then','destroy','sendStatus','error','stack','name','send','index','map','SmsInteraction','fieldName','type','key','getOptions','findAll','sms','query','catch','show','params','model','keys','rawAttributes','attributes','intersection'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0x56ea,0x12b));var _0xa56e=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0x56ea[_0x420f2a];return _0x28f802;};'use strict';var rimraf=require(_0xa56e('0x0'));var zipdir=require(_0xa56e('0x1'));var moment=require(_0xa56e('0x2'));var BPromise=require('bluebird');var util=require(_0xa56e('0x3'));var path=require(_0xa56e('0x4'));var ejs=require(_0xa56e('0x5'));var fs=require('fs');var _=require(_0xa56e('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xa56e('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0xa56e('0x8'))(_0xa56e('0x9'));var config=require(_0xa56e('0xa'));var db=require('../../mysqldb')['db'];config[_0xa56e('0xb')]=_['defaults'](config[_0xa56e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa56e('0xc'))(new Redis(config[_0xa56e('0xb')]));require(_0xa56e('0xd'))[_0xa56e('0xe')](socket);function respondWithStatusCode(_0xa2151,_0x2738c6){_0x2738c6=_0x2738c6||0xcc;return function(_0x29f502){if(_0x29f502){return _0xa2151['sendStatus'](_0x2738c6);}return _0xa2151[_0xa56e('0xf')](_0x2738c6)[_0xa56e('0x10')]();};}function respondWithResult(_0x48eca9,_0x5f51ac){_0x5f51ac=_0x5f51ac||0xc8;return function(_0x47cfd2){if(_0x47cfd2){return _0x48eca9[_0xa56e('0xf')](_0x5f51ac)['json'](_0x47cfd2);}};}function respondWithFilteredResult(_0x15415d,_0x2adf4b){return function(_0x3fdbd7){if(_0x3fdbd7){var _0x439490=typeof _0x2adf4b[_0xa56e('0x11')]===_0xa56e('0x12')&&typeof _0x2adf4b[_0xa56e('0x13')]===_0xa56e('0x12');var _0x3e41e3=_0x3fdbd7[_0xa56e('0x14')];var _0x28346b=_0x439490?0x0:_0x2adf4b['offset'];var _0x56f24a=_0x439490?_0x3fdbd7[_0xa56e('0x14')]:_0x2adf4b[_0xa56e('0x11')]+_0x2adf4b['limit'];var _0x13c9fb;if(_0x56f24a>=_0x3e41e3){_0x56f24a=_0x3e41e3;_0x13c9fb=0xc8;}else{_0x13c9fb=0xce;}_0x15415d[_0xa56e('0xf')](_0x13c9fb);return _0x15415d[_0xa56e('0x15')](_0xa56e('0x16'),_0x28346b+'-'+_0x56f24a+'/'+_0x3e41e3)[_0xa56e('0x17')](_0x3fdbd7);}return null;};}function saveUpdates(_0x1147b6){return function(_0x409cc7){if(_0x409cc7){return _0x409cc7['update'](_0x1147b6)[_0xa56e('0x18')](function(_0x1e4091){return _0x1e4091;});}return null;};}function removeEntity(_0x2d6b1d){return function(_0x204cc0){if(_0x204cc0){return _0x204cc0[_0xa56e('0x19')]()['then'](function(){_0x2d6b1d['status'](0xcc)[_0xa56e('0x10')]();});}};}function handleEntityNotFound(_0x5d08f5){return function(_0x209a0c){if(!_0x209a0c){_0x5d08f5[_0xa56e('0x1a')](0x194);}return _0x209a0c;};}function handleError(_0x23bb13,_0x173569){_0x173569=_0x173569||0x1f4;return function(_0x424d83){logger[_0xa56e('0x1b')](_0x424d83[_0xa56e('0x1c')]);if(_0x424d83[_0xa56e('0x1d')]){delete _0x424d83['name'];}_0x23bb13[_0xa56e('0xf')](_0x173569)[_0xa56e('0x1e')](_0x424d83);};}exports[_0xa56e('0x1f')]=function(_0x27e865,_0x37b09d){var _0xfbc1d5={};var _0x47249c=_[_0xa56e('0x20')](db[_0xa56e('0x21')]['rawAttributes'],function(_0x4d5b63){return{'name':_0x4d5b63[_0xa56e('0x22')],'type':_0x4d5b63[_0xa56e('0x23')][_0xa56e('0x24')]};});_0xfbc1d5=qs[_0xa56e('0x25')](_0x47249c,_0x27e865);return interaction[_0xa56e('0x26')](_0xa56e('0x27'),_0x27e865[_0xa56e('0x28')],_0x27e865['user'],_0xfbc1d5,_0x47249c)[_0xa56e('0x18')](respondWithFilteredResult(_0x37b09d,_0xfbc1d5))[_0xa56e('0x29')](handleError(_0x37b09d,null));};exports[_0xa56e('0x2a')]=function(_0x5cd9ee,_0x14472f){var _0x4081a8={'raw':![],'where':{'id':_0x5cd9ee[_0xa56e('0x2b')]['id']}},_0x3b4f61={};_0x3b4f61[_0xa56e('0x2c')]=_[_0xa56e('0x2d')](db[_0xa56e('0x21')][_0xa56e('0x2e')]);_0x3b4f61[_0xa56e('0x28')]=_[_0xa56e('0x2d')](_0x5cd9ee['query']);_0x3b4f61['filters']=_['intersection'](_0x3b4f61['model'],_0x3b4f61[_0xa56e('0x28')]);_0x4081a8[_0xa56e('0x2f')]=_[_0xa56e('0x30')](_0x3b4f61[_0xa56e('0x2c')],qs[_0xa56e('0x31')](_0x5cd9ee['query']['fields']));_0x4081a8['attributes']=_0x4081a8[_0xa56e('0x2f')][_0xa56e('0x32')]?_0x4081a8[_0xa56e('0x2f')]:_0x3b4f61[_0xa56e('0x2c')];if(_0x5cd9ee['query'][_0xa56e('0x33')]){_0x4081a8[_0xa56e('0x34')]=[{'all':!![]}];}_0x4081a8=_[_0xa56e('0x35')]({},_0x4081a8,_0x5cd9ee[_0xa56e('0x36')]);return db['SmsInteraction']['find'](_0x4081a8)[_0xa56e('0x18')](handleEntityNotFound(_0x14472f,null))[_0xa56e('0x18')](respondWithResult(_0x14472f,null))[_0xa56e('0x29')](handleError(_0x14472f,null));};exports[_0xa56e('0x37')]=function(_0xc22e60,_0x40a764){return db[_0xa56e('0x21')][_0xa56e('0x37')](_0xc22e60[_0xa56e('0x38')],{})[_0xa56e('0x18')](respondWithResult(_0x40a764,0xc9))[_0xa56e('0x29')](handleError(_0x40a764,null));};exports['update']=function(_0x254844,_0x58b375){if(_0x254844[_0xa56e('0x38')]['id']){delete _0x254844[_0xa56e('0x38')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x254844[_0xa56e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x58b375,null))['then'](saveUpdates(_0x254844[_0xa56e('0x38')],null))[_0xa56e('0x18')](respondWithResult(_0x58b375,null))[_0xa56e('0x29')](handleError(_0x58b375,null));};exports[_0xa56e('0x19')]=function(_0x1a123a,_0x105603){return db[_0xa56e('0x21')]['find']({'where':{'id':_0x1a123a[_0xa56e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x105603,null))[_0xa56e('0x18')](removeEntity(_0x105603,null))['catch'](handleError(_0x105603,null));};exports[_0xa56e('0x39')]=function(_0x3f20bf,_0x34388f){return db[_0xa56e('0x21')][_0xa56e('0x39')]()[_0xa56e('0x18')](respondWithResult(_0x34388f,null))[_0xa56e('0x29')](handleError(_0x34388f,null));};exports[_0xa56e('0x3a')]=function(_0x40857d,_0x48826c){return db[_0xa56e('0x3b')][_0xa56e('0x3c')]({'where':{'id':_0x40857d[_0xa56e('0x2b')]['id']}})[_0xa56e('0x18')](handleEntityNotFound(_0x48826c,null))['then'](function(_0x3b103e){if(_0x3b103e){return _0x3b103e['addMessage'](_0x40857d[_0xa56e('0x38')]['ids'],_['omit'](_0x40857d[_0xa56e('0x38')],['ids','id'])||{});}})['then'](respondWithResult(_0x48826c,null))[_0xa56e('0x29')](handleError(_0x48826c,null));};exports[_0xa56e('0x3d')]=function(_0x3eef3f,_0x51641e){var _0x8792df={'raw':![],'where':{}};var _0x492a50={};var _0x539c32={'count':0x0,'rows':[]};return db[_0xa56e('0x21')]['findOne']({'where':{'id':_0x3eef3f[_0xa56e('0x2b')]['id']}})[_0xa56e('0x18')](handleEntityNotFound(_0x51641e,null))[_0xa56e('0x18')](function(_0x4f4353){if(_0x4f4353){_0x492a50[_0xa56e('0x2c')]=_['keys'](db[_0xa56e('0x3b')]['rawAttributes']);_0x492a50[_0xa56e('0x28')]=_[_0xa56e('0x2d')](_0x3eef3f[_0xa56e('0x28')]);_0x492a50[_0xa56e('0x3e')]=_[_0xa56e('0x30')](_0x492a50[_0xa56e('0x2c')],_0x492a50[_0xa56e('0x28')]);_0x8792df[_0xa56e('0x2f')]=_[_0xa56e('0x30')](_0x492a50[_0xa56e('0x2c')],qs['fields'](_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x31')]));_0x8792df[_0xa56e('0x2f')]=_0x8792df[_0xa56e('0x2f')][_0xa56e('0x32')]?_0x8792df[_0xa56e('0x2f')]:_0x492a50[_0xa56e('0x2c')];if(!_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x3f')](_0xa56e('0x40'))){_0x8792df[_0xa56e('0x13')]=qs[_0xa56e('0x13')](_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x13')]);_0x8792df[_0xa56e('0x11')]=qs[_0xa56e('0x11')](_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x11')]);}_0x8792df[_0xa56e('0x41')]=qs[_0xa56e('0x42')](_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x42')]);_0x8792df['where']=qs['filters'](_[_0xa56e('0x43')](_0x3eef3f[_0xa56e('0x28')],_0x492a50['filters']));_0x8792df[_0xa56e('0x44')]['SmsInteractionId']=_0x4f4353['id'];if(_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x45')]){_0x8792df[_0xa56e('0x44')]=_[_0xa56e('0x35')](_0x8792df['where'],{'$or':_[_0xa56e('0x20')](_0x8792df[_0xa56e('0x2f')],function(_0x19e022){var _0x5a9e6a={};_0x5a9e6a[_0x19e022]={'$like':'%'+_0x3eef3f['query'][_0xa56e('0x45')]+'%'};return _0x5a9e6a;})});}if(_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x46')]){var _0x43ad19=_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x46')]['split'](',');var _0x28b245={};_0x28b245[_0x43ad19[0x0]]={'$gte':moment(_0x43ad19[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x8792df[_0xa56e('0x44')]=_[_0xa56e('0x35')](_0x8792df['where'],_0x28b245);}_0x8792df=_[_0xa56e('0x35')]({},_0x8792df,_0x3eef3f[_0xa56e('0x36')]);return db[_0xa56e('0x3b')][_0xa56e('0x14')]({'where':_0x8792df['where']})[_0xa56e('0x18')](function(_0x5051b9){_0x539c32[_0xa56e('0x14')]=_0x5051b9;if(_0x3eef3f[_0xa56e('0x28')][_0xa56e('0x33')]){_0x8792df[_0xa56e('0x34')]=[{'all':!![]}];}return db[_0xa56e('0x3b')][_0xa56e('0x26')](_0x8792df);})[_0xa56e('0x18')](function(_0x11557d){_0x539c32['rows']=_0x11557d;return _0x539c32;});}})[_0xa56e('0x18')](respondWithFilteredResult(_0x51641e,_0x8792df))[_0xa56e('0x29')](handleError(_0x51641e,null));};exports[_0xa56e('0x47')]=function(_0x4a69b8,_0x423b40){return db[_0xa56e('0x21')][_0xa56e('0x3c')]({'where':{'id':_0x4a69b8[_0xa56e('0x2b')]['id']}})[_0xa56e('0x18')](handleEntityNotFound(_0x423b40,null))[_0xa56e('0x18')](function(_0x3f219c){if(_0x3f219c){return _0x3f219c[_0xa56e('0x48')](_0x4a69b8[_0xa56e('0x38')][_0xa56e('0x49')],_[_0xa56e('0x4a')](_0x4a69b8[_0xa56e('0x38')],[_0xa56e('0x49'),'id'])||{})[_0xa56e('0x4b')](function(){return db[_0xa56e('0x4c')][_0xa56e('0x26')]({'attributes':['id',_0xa56e('0x1d'),_0xa56e('0x4d')],'where':{'id':_0x4a69b8['body']['ids']}});})[_0xa56e('0x18')](function(_0x575710){socket[_0xa56e('0x4e')](_0xa56e('0x4f'),{'id':Number(_0x4a69b8[_0xa56e('0x2b')]['id']),'tags':_0x575710||[]});return{'id':Number(_0x4a69b8['params']['id']),'tags':_0x575710||[]};});}})['then'](respondWithResult(_0x423b40,null))[_0xa56e('0x29')](handleError(_0x423b40,null));};exports['removeTags']=function(_0x4a1b73,_0x440c0c){return db['SmsInteraction'][_0xa56e('0x3c')]({'where':{'id':_0x4a1b73[_0xa56e('0x2b')]['id']}})[_0xa56e('0x18')](handleEntityNotFound(_0x440c0c,null))['then'](function(_0x667754){if(_0x667754){return _0x667754[_0xa56e('0x50')](_0x4a1b73[_0xa56e('0x28')][_0xa56e('0x49')]);}})[_0xa56e('0x18')](respondWithStatusCode(_0x440c0c,null))[_0xa56e('0x29')](handleError(_0x440c0c,null));};exports[_0xa56e('0x51')]=function(_0x43b84a,_0x4d7b5c){var _0x4431bb=moment()[_0xa56e('0x52')]()['toString']();var _0xb71108=path['join'](config[_0xa56e('0x53')],'server','files',_0xa56e('0x54'));var _0x7060c4=path['join'](_0xb71108,_0x4431bb);var _0x14fbef=util[_0xa56e('0x55')](_0xa56e('0x56'),_0x43b84a[_0xa56e('0x2b')]['id'],_0x4431bb);var _0x4c78a7=path[_0xa56e('0x57')](_0xb71108,_0x14fbef);var _0x31f6f8=[];_0x31f6f8['push']({'model':db[_0xa56e('0x58')],'as':_0xa56e('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x31f6f8[_0xa56e('0x59')]({'model':db[_0xa56e('0x5a')],'as':'Contact','attributes':['id',_0xa56e('0x5b'),_0xa56e('0x5c')],'raw':!![]});var _0x52d137=[{'model':db[_0xa56e('0x3b')],'as':'Messages','attributes':['id',_0xa56e('0x38'),_0xa56e('0x5d'),_0xa56e('0x5e'),'secret',_0xa56e('0x5f')],'include':_0x31f6f8}];_0x52d137[_0xa56e('0x59')]({'model':db[_0xa56e('0x60')],'as':'Account','attributes':['id',_0xa56e('0x1d')]});_0x52d137[_0xa56e('0x59')]({'model':db['User'],'as':_0xa56e('0x61'),'attributes':['id',_0xa56e('0x62')]});return db[_0xa56e('0x21')][_0xa56e('0x3c')]({'where':{'id':_0x43b84a[_0xa56e('0x2b')]['id']},'include':_0x52d137})[_0xa56e('0x18')](handleEntityNotFound(_0x4d7b5c,null))[_0xa56e('0x18')](function(_0x495bb3){if(_0x495bb3){var _0x5efb12=_0x495bb3['get']({'plain':!![]});fs[_0xa56e('0x63')](_0x7060c4);var _0x37786f={'channel':_0xa56e('0x64'),'account':_0x5efb12[_0xa56e('0x65')][_0xa56e('0x1d')],'agent':_0x5efb12[_0xa56e('0x61')]?_0x5efb12[_0xa56e('0x61')][_0xa56e('0x62')]:_0xa56e('0x66'),'createdAt':moment(_0x5efb12[_0xa56e('0x5d')])['format'](_0xa56e('0x67'))[_0xa56e('0x68')](),'closedAt':_0x5efb12[_0xa56e('0x69')]?moment(_0x5efb12[_0xa56e('0x6a')])[_0xa56e('0x55')](_0xa56e('0x67'))[_0xa56e('0x68')]():'','disposition':_0x5efb12['disposition'],'messages':_(_0x5efb12['Messages'])[_0xa56e('0x45')]({'secret':![]})[_0xa56e('0x20')](function(_0x3d339a){return{'date':moment(_0x3d339a[_0xa56e('0x5d')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa56e('0x68')](),'sender':_0x3d339a[_0xa56e('0x5e')]==='out'?_0x3d339a[_0xa56e('0x58')]?_0x3d339a[_0xa56e('0x58')]['fullname']:_0xa56e('0x6b'):_0x3d339a[_0xa56e('0x6c')][_0xa56e('0x5b')]+(_0x3d339a[_0xa56e('0x6c')][_0xa56e('0x5c')]?'\x20'+_0x3d339a[_0xa56e('0x6c')]['lastName']:''),'body':_0x3d339a[_0xa56e('0x38')],'direction':_0x3d339a[_0xa56e('0x5e')]===_0xa56e('0x6d')?'A':'C','secret':_0x3d339a[_0xa56e('0x6e')],'read':_0x3d339a[_0xa56e('0x5f')]};})['value']()};return ejs[_0xa56e('0x6f')](path[_0xa56e('0x57')](config[_0xa56e('0x53')],_0xa56e('0x70'),_0xa56e('0x71'),'downloadInteraction.ejs'),{'interaction':_0x37786f})['then'](function(_0x40d66e){var _0x18661b=path[_0xa56e('0x57')](_0x7060c4,'transcript-'+_0x5efb12['id']+'-'+_0x4431bb+_0xa56e('0x72'));var _0x263f00={'path':_0x18661b,'channel':'Sms','interactionId':_0x5efb12['id']};return pdf[_0xa56e('0x73')](_0x40d66e,_0x263f00);})['then'](function(){return new BPromise(function(_0xfb0bd8,_0x389641){zipdir(_0x7060c4,{'saveTo':_0x4c78a7},function(_0x3c2dd0,_0x5d4c8f){if(_0x3c2dd0)return _0x389641(_0x3c2dd0);return _0xfb0bd8(_0x5d4c8f);});})[_0xa56e('0x18')](function(){return new BPromise(function(_0x1c7f96,_0x2626b4){rimraf(_0x7060c4,function(_0x37b3cc){if(_0x37b3cc)_0x2626b4(_0x37b3cc);return _0x1c7f96();});});})['then'](function(){return _0x4d7b5c[_0xa56e('0x51')](_0x4c78a7,_0x14fbef,function(_0x38c755){if(_0x38c755){console['log']('err',_0x38c755);}else{fs['unlinkSync'](_0x4c78a7);}});});});}else{return _0x4d7b5c['sendStatus'](0xc8);}})['catch'](handleError(_0x4d7b5c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 2fd2004..6816ad5 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 _0x1a37=['events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch'];(function(_0x38e9e6,_0x571024){var _0x5f1bef=function(_0x3a5d89){while(--_0x3a5d89){_0x38e9e6['push'](_0x38e9e6['shift']());}};_0x5f1bef(++_0x571024);}(_0x1a37,0xb4));var _0x71a3=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x1a37[_0x474bc0];return _0x4b24cf;};'use strict';var EventEmitter=require(_0x71a3('0x0'));var SmsInteraction=require(_0x71a3('0x1'))['db'][_0x71a3('0x2')];var SmsMessage=require(_0x71a3('0x1'))['db'][_0x71a3('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x71a3('0x4')](0x0);var events={'afterCreate':_0x71a3('0x5'),'afterUpdate':_0x71a3('0x6'),'afterDestroy':_0x71a3('0x7')};function emitEvent(_0x100181){return function(_0x4af5b4,_0x11e8a8,_0x4f6b7a){_0x4af5b4[_0x71a3('0x8')]({'attributes':['id'],'raw':!![]})[_0x71a3('0x9')](function(_0x231ea7){_0x4af5b4[_0x71a3('0xa')]('Users',_0x231ea7['map'](function(_0x56c351){return{'id':_0x56c351['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x4af5b4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x71a3('0x9')](function(_0x18320a){_0x4af5b4[_0x71a3('0xa')](_0x71a3('0xb'),_0x18320a[_0x71a3('0xc')]);SmsInteractionEvents[_0x71a3('0xd')](_0x100181+':'+_0x4af5b4['id'],_0x4af5b4);SmsInteractionEvents[_0x71a3('0xd')](_0x100181,_0x4af5b4);_0x4f6b7a(null);})[_0x71a3('0xe')](_0x4f6b7a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x1c7c=['../../mysqldb','SmsInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x44511e,_0x2242ba){var _0x243798=function(_0x29a312){while(--_0x29a312){_0x44511e['push'](_0x44511e['shift']());}};_0x243798(++_0x2242ba);}(_0x1c7c,0x164));var _0xc1c7=function(_0x62d2fc,_0x51b3b7){_0x62d2fc=_0x62d2fc-0x0;var _0x597842=_0x1c7c[_0x62d2fc];return _0x597842;};'use strict';var EventEmitter=require(_0xc1c7('0x0'));var SmsInteraction=require(_0xc1c7('0x1'))['db'][_0xc1c7('0x2')];var SmsMessage=require(_0xc1c7('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc1c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1c7('0x4'),'afterDestroy':_0xc1c7('0x5')};function emitEvent(_0xbb9da0){return function(_0x2a0383,_0x42e930,_0x364dde){_0x2a0383[_0xc1c7('0x6')]({'attributes':['id'],'raw':!![]})[_0xc1c7('0x7')](function(_0xce5bcd){_0x2a0383[_0xc1c7('0x8')](_0xc1c7('0x9'),_0xce5bcd[_0xc1c7('0xa')](function(_0x92e892){return{'id':_0x92e892['id']};}));return SmsMessage[_0xc1c7('0xb')]({'where':{'SmsInteractionId':_0x2a0383['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc1c7('0x7')](function(_0x301abf){_0x2a0383[_0xc1c7('0x8')]('unreadMessages',_0x301abf[_0xc1c7('0xc')]);SmsInteractionEvents[_0xc1c7('0xd')](_0xbb9da0+':'+_0x2a0383['id'],_0x2a0383);SmsInteractionEvents['emit'](_0xbb9da0,_0x2a0383);_0x364dde(null);})[_0xc1c7('0xe')](_0x364dde(null));};}for(var e in events){if(events[_0xc1c7('0xf')](e)){var event=events[e];SmsInteraction[_0xc1c7('0x10')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 9e72397..0f5c0ae 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 _0x3014=['closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x3014,0x153));var _0x4301=function(_0x3de3a7,_0x497f52){_0x3de3a7=_0x3de3a7-0x0;var _0x1e56e4=_0x3014[_0x3de3a7];return _0x1e56e4;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var logger=require(_0x4301('0x2'))('api');var moment=require(_0x4301('0x3'));var BPromise=require(_0x4301('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4301('0x5'));var rimraf=require('rimraf');var config=require(_0x4301('0x6'));var attributes=require(_0x4301('0x7'));module[_0x4301('0x8')]=function(_0x317d0a,_0x45036b){return _0x317d0a[_0x4301('0x9')](_0x4301('0xa'),attributes,{'tableName':_0x4301('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x349e17,_0x17dac9,_0x24ee5c){if(_0x349e17[_0x4301('0xc')](_0x4301('0xd'))){_0x349e17[_0x4301('0xe')]=moment()[_0x4301('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x24ee5c(null,_0x349e17);}}});}; \ No newline at end of file +var _0x9a9a=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','closed','closedAt','format'];(function(_0x165be3,_0x2e9010){var _0x4441ee=function(_0x34b6ad){while(--_0x34b6ad){_0x165be3['push'](_0x165be3['shift']());}};_0x4441ee(++_0x2e9010);}(_0x9a9a,0x1cc));var _0xa9a9=function(_0x52d6d7,_0xe2f108){_0x52d6d7=_0x52d6d7-0x0;var _0x479d30=_0x9a9a[_0x52d6d7];return _0x479d30;};'use strict';var _=require(_0xa9a9('0x0'));var util=require(_0xa9a9('0x1'));var logger=require('../../config/logger')(_0xa9a9('0x2'));var moment=require(_0xa9a9('0x3'));var BPromise=require(_0xa9a9('0x4'));var rp=require(_0xa9a9('0x5'));var fs=require('fs');var path=require(_0xa9a9('0x6'));var rimraf=require(_0xa9a9('0x7'));var config=require(_0xa9a9('0x8'));var attributes=require('./smsInteraction.attributes');module[_0xa9a9('0x9')]=function(_0x5bb4e0,_0x4ab725){return _0x5bb4e0[_0xa9a9('0xa')](_0xa9a9('0xb'),attributes,{'tableName':_0xa9a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50a7e3,_0x4c53fa,_0x20322a){if(_0x50a7e3['changed'](_0xa9a9('0xd'))){_0x50a7e3[_0xa9a9('0xe')]=moment()[_0xa9a9('0xf')](_0xa9a9('0x10'));}_0x20322a(null,_0x50a7e3);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2e7bf4d..048e26e 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 _0xa9ec=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','SmsInteraction','update','body','options','raw','attributes','limit','stringify','find','where','addTags','ids','omit','AddTags','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s'];(function(_0x5df502,_0x1120ed){var _0x293ca3=function(_0x3093d2){while(--_0x3093d2){_0x5df502['push'](_0x5df502['shift']());}};_0x293ca3(++_0x1120ed);}(_0xa9ec,0x1d1));var _0xca9e=function(_0x423b10,_0x36cad4){_0x423b10=_0x423b10-0x0;var _0x1338d9=_0xa9ec[_0x423b10];return _0x1338d9;};'use strict';var _=require(_0xca9e('0x0'));var util=require(_0xca9e('0x1'));var moment=require(_0xca9e('0x2'));var BPromise=require('bluebird');var rs=require(_0xca9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xca9e('0x4'));var logger=require(_0xca9e('0x5'))(_0xca9e('0x6'));var config=require(_0xca9e('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xca9e('0x8')]=_[_0xca9e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xca9e('0xa'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xca9e('0xb')](socket);function respondWithRpcPromise(_0x11ed1e,_0x1dbbac,_0x2ccf03){return new BPromise(function(_0x101ed9,_0x568369){return client[_0xca9e('0xc')](_0x11ed1e,_0x2ccf03)[_0xca9e('0xd')](function(_0x5cd92a){logger[_0xca9e('0xe')](_0xca9e('0xf'),_0x1dbbac,'request\x20sent');logger[_0xca9e('0x10')](_0xca9e('0x11'),_0x1dbbac,_0xca9e('0x12'),JSON['stringify'](_0x5cd92a));if(_0x5cd92a['error']){if(_0x5cd92a['error']['code']===0x1f4){logger[_0xca9e('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x1dbbac,_0x5cd92a[_0xca9e('0x13')]['message']);return _0x568369(_0x5cd92a[_0xca9e('0x13')][_0xca9e('0x14')]);}logger[_0xca9e('0x13')](_0xca9e('0xf'),_0x1dbbac,_0x5cd92a['error'][_0xca9e('0x14')]);return _0x101ed9(_0x5cd92a[_0xca9e('0x13')][_0xca9e('0x14')]);}else{logger[_0xca9e('0xe')](_0xca9e('0xf'),_0x1dbbac,'request\x20sent');_0x101ed9(_0x5cd92a[_0xca9e('0x15')][_0xca9e('0x14')]);}})[_0xca9e('0x16')](function(_0x55f19f){logger[_0xca9e('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x1dbbac,_0x55f19f);_0x568369(_0x55f19f);});});}exports['UpdateSmsInteraction']=function(_0x3e6927){var _0x51c87b=this;return new Promise(function(_0x27a119,_0x1b2a3e){return db[_0xca9e('0x17')][_0xca9e('0x18')](_0x3e6927[_0xca9e('0x19')],{'raw':_0x3e6927[_0xca9e('0x1a')]?_0x3e6927[_0xca9e('0x1a')][_0xca9e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e6927['options']?_0x3e6927[_0xca9e('0x1a')]['where']||null:null,'attributes':_0x3e6927[_0xca9e('0x1a')]?_0x3e6927[_0xca9e('0x1a')][_0xca9e('0x1c')]||null:null,'limit':_0x3e6927[_0xca9e('0x1a')]?_0x3e6927[_0xca9e('0x1a')][_0xca9e('0x1d')]||null:null})[_0xca9e('0xd')](function(_0xb1285){logger[_0xca9e('0xe')]('UpdateSmsInteraction',_0x3e6927);logger[_0xca9e('0x10')]('UpdateSmsInteraction',_0x3e6927,JSON[_0xca9e('0x1e')](_0xb1285));_0x27a119(_0xb1285);})[_0xca9e('0x16')](function(_0x49e3a7){logger[_0xca9e('0x13')]('UpdateSmsInteraction',_0x49e3a7[_0xca9e('0x14')],_0x3e6927);_0x1b2a3e(_0x51c87b[_0xca9e('0x13')](0x1f4,_0x49e3a7[_0xca9e('0x14')]));});});};exports['AddTagsToSmsInteraction']=function(_0x3c5b0c){return new Promise(function(_0x255532,_0x3f9e34){return db[_0xca9e('0x17')][_0xca9e('0x1f')]({'where':_0x3c5b0c['options']?_0x3c5b0c['options'][_0xca9e('0x20')]||null:null})['then'](function(_0x3743eb){if(_0x3743eb){return _0x3743eb[_0xca9e('0x21')](_0x3c5b0c['body'][_0xca9e('0x22')],_[_0xca9e('0x23')](_0x3c5b0c['body'],[_0xca9e('0x22'),'id'])||{});}})['spread'](function(_0x4f0ec9){logger[_0xca9e('0xe')](_0xca9e('0x24'),_0x3c5b0c);logger[_0xca9e('0x10')]('AddTags',_0x3c5b0c,JSON['stringify'](_0x4f0ec9));_0x255532(_0x4f0ec9);})[_0xca9e('0x16')](function(_0xe2a6fd){logger['error'](_0xca9e('0x24'),_0xe2a6fd[_0xca9e('0x14')],_0x3c5b0c);_0x3f9e34(_this[_0xca9e('0x13')](0x1f4,_0xe2a6fd[_0xca9e('0x14')]));});});}; \ No newline at end of file +var _0x57b8=['where','attributes','limit','stringify','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','raw'];(function(_0x18207c,_0x1dd7d9){var _0x18d26e=function(_0x5a3103){while(--_0x5a3103){_0x18207c['push'](_0x18207c['shift']());}};_0x18d26e(++_0x1dd7d9);}(_0x57b8,0xf2));var _0x857b=function(_0x5e4e34,_0x5a2965){_0x5e4e34=_0x5e4e34-0x0;var _0x262e87=_0x57b8[_0x5e4e34];return _0x262e87;};'use strict';var _=require(_0x857b('0x0'));var util=require(_0x857b('0x1'));var moment=require(_0x857b('0x2'));var BPromise=require(_0x857b('0x3'));var rs=require(_0x857b('0x4'));var fs=require('fs');var Redis=require(_0x857b('0x5'));var db=require(_0x857b('0x6'))['db'];var utils=require(_0x857b('0x7'));var logger=require('../../config/logger')(_0x857b('0x8'));var config=require(_0x857b('0x9'));var jayson=require(_0x857b('0xa'));var client=jayson[_0x857b('0xb')][_0x857b('0xc')]({'port':0x232a});config[_0x857b('0xd')]=_[_0x857b('0xe')](config['redis'],{'host':_0x857b('0xf'),'port':0x18eb});var socket=require(_0x857b('0x10'))(new Redis(config['redis']));require(_0x857b('0x11'))[_0x857b('0x12')](socket);function respondWithRpcPromise(_0xcfdbec,_0x2939a9,_0x565ba9){return new BPromise(function(_0x4643d5,_0x1f17f9){return client['request'](_0xcfdbec,_0x565ba9)[_0x857b('0x13')](function(_0xd168f0){logger[_0x857b('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2939a9,_0x857b('0x15'));logger[_0x857b('0x16')](_0x857b('0x17'),_0x2939a9,'request\x20sent',JSON['stringify'](_0xd168f0));if(_0xd168f0['error']){if(_0xd168f0[_0x857b('0x18')][_0x857b('0x19')]===0x1f4){logger[_0x857b('0x18')](_0x857b('0x1a'),_0x2939a9,_0xd168f0[_0x857b('0x18')][_0x857b('0x1b')]);return _0x1f17f9(_0xd168f0['error'][_0x857b('0x1b')]);}logger[_0x857b('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x2939a9,_0xd168f0[_0x857b('0x18')][_0x857b('0x1b')]);return _0x4643d5(_0xd168f0['error'][_0x857b('0x1b')]);}else{logger[_0x857b('0x14')](_0x857b('0x1a'),_0x2939a9,_0x857b('0x15'));_0x4643d5(_0xd168f0[_0x857b('0x1c')][_0x857b('0x1b')]);}})[_0x857b('0x1d')](function(_0x22e1d5){logger['error'](_0x857b('0x1a'),_0x2939a9,_0x22e1d5);_0x1f17f9(_0x22e1d5);});});}exports[_0x857b('0x1e')]=function(_0x3e366f){var _0x43ed02=this;return new Promise(function(_0x268461,_0x4ef30e){return db[_0x857b('0x1f')]['update'](_0x3e366f['body'],{'raw':_0x3e366f[_0x857b('0x20')]?_0x3e366f[_0x857b('0x20')][_0x857b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e366f[_0x857b('0x20')]?_0x3e366f[_0x857b('0x20')][_0x857b('0x22')]||null:null,'attributes':_0x3e366f[_0x857b('0x20')]?_0x3e366f[_0x857b('0x20')][_0x857b('0x23')]||null:null,'limit':_0x3e366f[_0x857b('0x20')]?_0x3e366f[_0x857b('0x20')][_0x857b('0x24')]||null:null})[_0x857b('0x13')](function(_0x4ee9aa){logger[_0x857b('0x14')](_0x857b('0x1e'),_0x3e366f);logger[_0x857b('0x16')](_0x857b('0x1e'),_0x3e366f,JSON[_0x857b('0x25')](_0x4ee9aa));_0x268461(_0x4ee9aa);})['catch'](function(_0x576b8d){logger[_0x857b('0x18')](_0x857b('0x1e'),_0x576b8d[_0x857b('0x1b')],_0x3e366f);_0x4ef30e(_0x43ed02['error'](0x1f4,_0x576b8d[_0x857b('0x1b')]));});});};exports[_0x857b('0x26')]=function(_0x11ae42){return new Promise(function(_0x28ef42,_0x29a62b){return db[_0x857b('0x1f')][_0x857b('0x27')]({'where':_0x11ae42[_0x857b('0x20')]?_0x11ae42[_0x857b('0x20')][_0x857b('0x22')]||null:null})[_0x857b('0x13')](function(_0x135714){if(_0x135714){return _0x135714[_0x857b('0x28')](_0x11ae42[_0x857b('0x29')][_0x857b('0x2a')],_[_0x857b('0x2b')](_0x11ae42[_0x857b('0x29')],[_0x857b('0x2a'),'id'])||{});}})[_0x857b('0x2c')](function(_0x5dfa32){logger[_0x857b('0x14')](_0x857b('0x2d'),_0x11ae42);logger[_0x857b('0x16')](_0x857b('0x2d'),_0x11ae42,JSON[_0x857b('0x25')](_0x5dfa32));_0x28ef42(_0x5dfa32);})[_0x857b('0x1d')](function(_0x1878da){logger[_0x857b('0x18')](_0x857b('0x2d'),_0x1878da['message'],_0x11ae42);_0x29a62b(_this[_0x857b('0x18')](0x1f4,_0x1878da[_0x857b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6b221cc..26440c9 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 _0x162f=['remove','update','emit','removeListener','length','smsInteraction:','save'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x162f,0x110));var _0xf162=function(_0x130885,_0x5640ea){_0x130885=_0x130885-0x0;var _0x5d99b7=_0x162f[_0x130885];return _0x5d99b7;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xf162('0x0'),_0xf162('0x1'),_0xf162('0x2')];function createListener(_0x4f1bb9,_0x4332ee){return function(_0x1456af){_0x4332ee[_0xf162('0x3')](_0x4f1bb9,_0x1456af);};}function removeListener(_0x239f7d,_0x5469b3){return function(){SmsInteractionEvents[_0xf162('0x4')](_0x239f7d,_0x5469b3);};}exports['register']=function(_0x5449cc){for(var _0x389629=0x0,_0x17f107=events[_0xf162('0x5')];_0x389629<_0x17f107;_0x389629++){var _0xcee801=events[_0x389629];var _0x1a6c86=createListener(_0xf162('0x6')+_0xcee801,_0x5449cc);SmsInteractionEvents['on'](_0xcee801,_0x1a6c86);}}; \ No newline at end of file +var _0x1b6e=['remove','update','removeListener','register','smsInteraction:','./smsInteraction.events','save'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1b6e,0xe5));var _0xe1b6=function(_0x4cc5e3,_0x29923e){_0x4cc5e3=_0x4cc5e3-0x0;var _0x52db78=_0x1b6e[_0x4cc5e3];return _0x52db78;};'use strict';var SmsInteractionEvents=require(_0xe1b6('0x0'));var events=[_0xe1b6('0x1'),_0xe1b6('0x2'),_0xe1b6('0x3')];function createListener(_0x45cc57,_0x41b294){return function(_0x47f16c){_0x41b294['emit'](_0x45cc57,_0x47f16c);};}function removeListener(_0x25c477,_0x2861d1){return function(){SmsInteractionEvents[_0xe1b6('0x4')](_0x25c477,_0x2861d1);};}exports[_0xe1b6('0x5')]=function(_0x1b9354){for(var _0x482727=0x0,_0x2ba39b=events['length'];_0x482727<_0x2ba39b;_0x482727++){var _0x3c7d17=events[_0x482727];var _0x32132b=createListener(_0xe1b6('0x6')+_0x3c7d17,_0x1b9354);SmsInteractionEvents['on'](_0x3c7d17,_0x32132b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9783b28..6293dcc 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 _0xe6e4=['/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','index','get','isAuthenticated','describe','/:id','post','tracked','sms','smsmessage:create','/:id/status','put','update','/:id/accept'];(function(_0x5309ee,_0x148627){var _0x48ada7=function(_0x5b8f44){while(--_0x5b8f44){_0x5309ee['push'](_0x5309ee['shift']());}};_0x48ada7(++_0x148627);}(_0xe6e4,0xc1));var _0x4e6e=function(_0x217332,_0x3c4328){_0x217332=_0x217332-0x0;var _0x141ba3=_0xe6e4[_0x217332];return _0x141ba3;};'use strict';var multer=require(_0x4e6e('0x0'));var util=require(_0x4e6e('0x1'));var path=require(_0x4e6e('0x2'));var timeout=require(_0x4e6e('0x3'));var express=require(_0x4e6e('0x4'));var router=express[_0x4e6e('0x5')]();var fs_extra=require(_0x4e6e('0x6'));var auth=require(_0x4e6e('0x7'));var interaction=require(_0x4e6e('0x8'));var config=require('../../config/environment');var controller=require(_0x4e6e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e6e('0xa')]);router[_0x4e6e('0xb')]('/describe',auth[_0x4e6e('0xc')](),controller[_0x4e6e('0xd')]);router[_0x4e6e('0xb')](_0x4e6e('0xe'),auth[_0x4e6e('0xc')](),controller['show']);router[_0x4e6e('0xf')]('/',auth[_0x4e6e('0xc')](),interaction[_0x4e6e('0x10')](_0x4e6e('0x11'),_0x4e6e('0x12')),controller['create']);router[_0x4e6e('0xf')](_0x4e6e('0x13'),controller['status']);router[_0x4e6e('0x14')](_0x4e6e('0xe'),auth[_0x4e6e('0xc')](),controller[_0x4e6e('0x15')]);router[_0x4e6e('0x14')](_0x4e6e('0x16'),auth[_0x4e6e('0xc')](),controller['accept']);router[_0x4e6e('0x14')](_0x4e6e('0x17'),auth[_0x4e6e('0xc')](),controller[_0x4e6e('0x18')]);router[_0x4e6e('0x19')](_0x4e6e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4e6e('0x1a')]=router; \ No newline at end of file +var _0xefad=['isAuthenticated','index','/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller'];(function(_0x5721f1,_0x12a43a){var _0xe25329=function(_0x4aa493){while(--_0x4aa493){_0x5721f1['push'](_0x5721f1['shift']());}};_0xe25329(++_0x12a43a);}(_0xefad,0x1d6));var _0xdefa=function(_0x15d4f8,_0x4b746b){_0x15d4f8=_0x15d4f8-0x0;var _0x4a8d92=_0xefad[_0x15d4f8];return _0x4a8d92;};'use strict';var multer=require(_0xdefa('0x0'));var util=require('util');var path=require(_0xdefa('0x1'));var timeout=require(_0xdefa('0x2'));var express=require(_0xdefa('0x3'));var router=express[_0xdefa('0x4')]();var fs_extra=require(_0xdefa('0x5'));var auth=require(_0xdefa('0x6'));var interaction=require(_0xdefa('0x7'));var config=require(_0xdefa('0x8'));var controller=require(_0xdefa('0x9'));router['get']('/',auth[_0xdefa('0xa')](),controller[_0xdefa('0xb')]);router['get'](_0xdefa('0xc'),auth[_0xdefa('0xa')](),controller[_0xdefa('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdefa('0xe')]);router[_0xdefa('0xf')]('/',auth[_0xdefa('0xa')](),interaction[_0xdefa('0x10')](_0xdefa('0x11'),_0xdefa('0x12')),controller[_0xdefa('0x13')]);router[_0xdefa('0xf')](_0xdefa('0x14'),controller[_0xdefa('0x15')]);router[_0xdefa('0x16')](_0xdefa('0x17'),auth[_0xdefa('0xa')](),controller['update']);router[_0xdefa('0x16')](_0xdefa('0x18'),auth[_0xdefa('0xa')](),controller[_0xdefa('0x19')]);router['put'](_0xdefa('0x1a'),auth[_0xdefa('0xa')](),controller[_0xdefa('0x1b')]);router['delete'](_0xdefa('0x17'),auth[_0xdefa('0xa')](),controller[_0xdefa('0x1c')]);module[_0xdefa('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d748c69..c120cbc 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 _0x0fa0=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0xb67f8b,_0x4704ef){var _0x52c20e=function(_0x4f52b6){while(--_0x4f52b6){_0xb67f8b['push'](_0xb67f8b['shift']());}};_0x52c20e(++_0x4704ef);}(_0x0fa0,0xbc));var _0x00fa=function(_0x234c8b,_0x2220da){_0x234c8b=_0x234c8b-0x0;var _0x4555e8=_0x0fa0[_0x234c8b];return _0x4555e8;};'use strict';var Sequelize=require(_0x00fa('0x0'));module['exports']={'body':{'type':Sequelize[_0x00fa('0x1')](_0x00fa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x00fa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x00fa('0x4')]('in',_0x00fa('0x5')),'defaultValue':_0x00fa('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x00fa('0x6')](0xbe)},'phone':{'type':Sequelize[_0x00fa('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x00fa('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x00fa('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5384=['BOOLEAN','sequelize','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x5f187b,_0x3c796a){var _0x4038cb=function(_0x139a42){while(--_0x139a42){_0x5f187b['push'](_0x5f187b['shift']());}};_0x4038cb(++_0x3c796a);}(_0x5384,0x159));var _0x4538=function(_0x40297c,_0x7a4e62){_0x40297c=_0x40297c-0x0;var _0x5d0047=_0x5384[_0x40297c];return _0x5d0047;};'use strict';var Sequelize=require(_0x4538('0x0'));module['exports']={'body':{'type':Sequelize[_0x4538('0x1')](_0x4538('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4538('0x3')]('in',_0x4538('0x4')),'defaultValue':_0x4538('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4538('0x5')](0xbe)},'phone':{'type':Sequelize[_0x4538('0x5')]},'readAt':{'type':Sequelize[_0x4538('0x6')]},'secret':{'type':Sequelize[_0x4538('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 6ae4c66..e25d107 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 _0x554e=['QueryTypes','SELECT','contact','agent','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','null','RejectMessage','rejectMessage','User','fullname','internal','reject','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','Status','plivio','infobip','results','groupName','DELIVERED','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','client','http','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','SmsInteractionId','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize'];(function(_0xce2ee4,_0x3fe1e1){var _0x3fd000=function(_0x554493){while(--_0x554493){_0xce2ee4['push'](_0xce2ee4['shift']());}};_0x3fd000(++_0x3fe1e1);}(_0x554e,0xb6));var _0xe554=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x554e[_0x1d04b5];return _0x161342;};'use strict';var emlformat=require(_0xe554('0x0'));var rimraf=require(_0xe554('0x1'));var zipdir=require(_0xe554('0x2'));var jsonpatch=require(_0xe554('0x3'));var rp=require(_0xe554('0x4'));var moment=require(_0xe554('0x5'));var BPromise=require(_0xe554('0x6'));var Mustache=require(_0xe554('0x7'));var util=require(_0xe554('0x8'));var path=require(_0xe554('0x9'));var sox=require('sox');var csv=require(_0xe554('0xa'));var ejs=require(_0xe554('0xb'));var fs=require('fs');var fs_extra=require(_0xe554('0xc'));var _=require('lodash');var squel=require(_0xe554('0xd'));var crypto=require(_0xe554('0xe'));var jsforce=require(_0xe554('0xf'));var deskjs=require(_0xe554('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe554('0x11'));var Papa=require(_0xe554('0x12'));var Redis=require('ioredis');var authService=require(_0xe554('0x13'));var qs=require(_0xe554('0x14'));var as=require(_0xe554('0x15'));var hardwareService=require(_0xe554('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe554('0x17'));var config=require(_0xe554('0x18'));var licenseUtil=require(_0xe554('0x19'));var db=require('../../mysqldb')['db'];config[_0xe554('0x1a')]=_[_0xe554('0x1b')](config[_0xe554('0x1a')],{'host':_0xe554('0x1c'),'port':0x18eb});var socket=require(_0xe554('0x1d'))(new Redis(config[_0xe554('0x1a')]));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe554('0x1e')][_0xe554('0x1f')]({'port':0x232c});var client9002=jayson[_0xe554('0x1e')][_0xe554('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4e9415,_0x443d6c,_0x5e07c3,_0x46eaac){return new BPromise(function(_0x30e1d8,_0x3ba5aa){var _0x14d2a6=_0x46eaac||client;return _0x14d2a6[_0xe554('0x20')](_0x4e9415,_0x5e07c3)['then'](function(_0x2e529f){logger['info'](_0xe554('0x21'),_0x443d6c,_0xe554('0x22'));logger[_0xe554('0x23')](_0xe554('0x24'),_0x443d6c,_0xe554('0x22'),JSON[_0xe554('0x25')](_0x2e529f));if(_0x2e529f[_0xe554('0x26')]){if(_0x2e529f['error'][_0xe554('0x27')]===0x1f4){logger['error'](_0xe554('0x21'),_0x443d6c,_0x2e529f[_0xe554('0x26')][_0xe554('0x28')]);return _0x3ba5aa(_0x2e529f[_0xe554('0x26')]['message']);}logger['error'](_0xe554('0x21'),_0x443d6c,_0x2e529f[_0xe554('0x26')][_0xe554('0x28')]);return _0x30e1d8(_0x2e529f[_0xe554('0x26')]['message']);}else{logger[_0xe554('0x29')](_0xe554('0x21'),_0x443d6c,_0xe554('0x22'));_0x30e1d8(_0x2e529f[_0xe554('0x2a')][_0xe554('0x28')]);}})['catch'](function(_0x59c1a1){logger[_0xe554('0x26')](_0xe554('0x21'),_0x443d6c,_0x59c1a1);_0x3ba5aa(_0x59c1a1);});});}function respondWithStatusCode(_0x2c23ae,_0x17a4b6){_0x17a4b6=_0x17a4b6||0xcc;return function(_0xebb837){if(_0xebb837){return _0x2c23ae[_0xe554('0x2b')](_0x17a4b6);}return _0x2c23ae[_0xe554('0x2c')](_0x17a4b6)['end']();};}function respondWithResult(_0x4661fc,_0x306b08){_0x306b08=_0x306b08||0xc8;return function(_0xabbcb1){if(_0xabbcb1){return _0x4661fc[_0xe554('0x2c')](_0x306b08)[_0xe554('0x2d')](_0xabbcb1);}};}function respondWithFilteredResult(_0x155c2e,_0x16fa2b){return function(_0x1340bd){if(_0x1340bd){var _0x44ccb2=typeof _0x16fa2b[_0xe554('0x2e')]===_0xe554('0x2f')&&typeof _0x16fa2b[_0xe554('0x30')]===_0xe554('0x2f');var _0x3f8c74=_0x1340bd[_0xe554('0x31')];var _0xeadaa3=_0x44ccb2?0x0:_0x16fa2b[_0xe554('0x2e')];var _0x42c483=_0x44ccb2?_0x1340bd['count']:_0x16fa2b[_0xe554('0x2e')]+_0x16fa2b[_0xe554('0x30')];var _0x295a9f;if(_0x42c483>=_0x3f8c74){_0x42c483=_0x3f8c74;_0x295a9f=0xc8;}else{_0x295a9f=0xce;}_0x155c2e[_0xe554('0x2c')](_0x295a9f);return _0x155c2e[_0xe554('0x32')](_0xe554('0x33'),_0xeadaa3+'-'+_0x42c483+'/'+_0x3f8c74)['json'](_0x1340bd);}return null;};}function patchUpdates(_0x1a3565){return function(_0x19d077){try{jsonpatch['apply'](_0x19d077,_0x1a3565,!![]);}catch(_0x475ec9){return BPromise['reject'](_0x475ec9);}return _0x19d077[_0xe554('0x34')]();};}function saveUpdates(_0x4b3ec4,_0x34dc31){return function(_0x37ef5e){if(_0x37ef5e){return _0x37ef5e[_0xe554('0x35')](_0x4b3ec4)[_0xe554('0x36')](function(_0x36e166){return _0x36e166;});}return null;};}function removeEntity(_0x384f0c,_0x2bce7d){return function(_0x14208c){if(_0x14208c){return _0x14208c[_0xe554('0x37')]()[_0xe554('0x36')](function(){_0x384f0c[_0xe554('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35eeb7,_0x49b147){return function(_0x101b69){if(!_0x101b69){_0x35eeb7[_0xe554('0x2b')](0x194);}return _0x101b69;};}function handleError(_0x1c83fc,_0x2332a3){_0x2332a3=_0x2332a3||0x1f4;return function(_0x2e5a88){logger['error'](_0x2e5a88[_0xe554('0x38')]);if(_0x2e5a88[_0xe554('0x39')]){delete _0x2e5a88[_0xe554('0x39')];}_0x1c83fc['status'](_0x2332a3)['send'](_0x2e5a88);};}exports['index']=function(_0x2a8b8f,_0x116425){var _0x21305a={},_0x9e7ded={},_0x319747={'count':0x0,'rows':[]};var _0x4cb33e=_[_0xe554('0x3a')](db[_0xe554('0x3b')][_0xe554('0x3c')],function(_0x1a7651){return{'name':_0x1a7651[_0xe554('0x3d')],'type':_0x1a7651[_0xe554('0x3e')][_0xe554('0x3f')]};});_0x9e7ded[_0xe554('0x40')]=_[_0xe554('0x3a')](_0x4cb33e,_0xe554('0x39'));_0x9e7ded[_0xe554('0x41')]=_[_0xe554('0x42')](_0x2a8b8f['query']);_0x9e7ded[_0xe554('0x43')]=_['intersection'](_0x9e7ded[_0xe554('0x40')],_0x9e7ded[_0xe554('0x41')]);_0x21305a[_0xe554('0x44')]=_['intersection'](_0x9e7ded[_0xe554('0x40')],qs[_0xe554('0x45')](_0x2a8b8f[_0xe554('0x41')]['fields']));_0x21305a[_0xe554('0x44')]=_0x21305a[_0xe554('0x44')][_0xe554('0x46')]?_0x21305a['attributes']:_0x9e7ded['model'];if(!_0x2a8b8f[_0xe554('0x41')]['hasOwnProperty'](_0xe554('0x47'))){_0x21305a['limit']=qs[_0xe554('0x30')](_0x2a8b8f[_0xe554('0x41')][_0xe554('0x30')]);_0x21305a[_0xe554('0x2e')]=qs[_0xe554('0x2e')](_0x2a8b8f[_0xe554('0x41')][_0xe554('0x2e')]);}_0x21305a[_0xe554('0x48')]=qs[_0xe554('0x49')](_0x2a8b8f[_0xe554('0x41')][_0xe554('0x49')]);_0x21305a['where']=qs[_0xe554('0x43')](_[_0xe554('0x4a')](_0x2a8b8f[_0xe554('0x41')],_0x9e7ded[_0xe554('0x43')]),_0x4cb33e);if(_0x2a8b8f[_0xe554('0x41')][_0xe554('0x4b')]){_0x21305a[_0xe554('0x4c')]=_[_0xe554('0x4d')](_0x21305a[_0xe554('0x4c')],{'$or':_['map'](_0x4cb33e,function(_0x23c38a){if(_0x23c38a['type']!==_0xe554('0x4e')){var _0xe9d13={};_0xe9d13[_0x23c38a[_0xe554('0x39')]]={'$like':'%'+_0x2a8b8f[_0xe554('0x41')][_0xe554('0x4b')]+'%'};return _0xe9d13;}})});}_0x21305a=_[_0xe554('0x4d')]({},_0x21305a,_0x2a8b8f[_0xe554('0x4f')]);var _0x58d724={'where':_0x21305a[_0xe554('0x4c')]};return db[_0xe554('0x3b')][_0xe554('0x31')](_0x58d724)['then'](function(_0x3c076f){_0x319747[_0xe554('0x31')]=_0x3c076f;if(_0x2a8b8f[_0xe554('0x41')][_0xe554('0x50')]){_0x21305a[_0xe554('0x51')]=[{'all':!![]}];}return db[_0xe554('0x3b')][_0xe554('0x52')](_0x21305a);})[_0xe554('0x36')](function(_0x4dd74e){_0x319747[_0xe554('0x53')]=_0x4dd74e;return _0x319747;})[_0xe554('0x36')](respondWithFilteredResult(_0x116425,_0x21305a))[_0xe554('0x54')](handleError(_0x116425,null));};exports[_0xe554('0x55')]=function(_0x4bdf9f,_0x3dfe23){var _0x4281c3={'raw':!![],'where':{'id':_0x4bdf9f['params']['id']}},_0x568e14={};_0x568e14[_0xe554('0x40')]=_[_0xe554('0x42')](db[_0xe554('0x3b')]['rawAttributes']);_0x568e14['query']=_[_0xe554('0x42')](_0x4bdf9f[_0xe554('0x41')]);_0x568e14[_0xe554('0x43')]=_['intersection'](_0x568e14[_0xe554('0x40')],_0x568e14['query']);_0x4281c3[_0xe554('0x44')]=_[_0xe554('0x56')](_0x568e14[_0xe554('0x40')],qs[_0xe554('0x45')](_0x4bdf9f['query'][_0xe554('0x45')]));_0x4281c3[_0xe554('0x44')]=_0x4281c3['attributes']['length']?_0x4281c3['attributes']:_0x568e14['model'];if(_0x4bdf9f[_0xe554('0x41')][_0xe554('0x50')]){_0x4281c3[_0xe554('0x51')]=[{'all':!![]}];}_0x4281c3=_[_0xe554('0x4d')]({},_0x4281c3,_0x4bdf9f[_0xe554('0x4f')]);return db[_0xe554('0x3b')][_0xe554('0x57')](_0x4281c3)[_0xe554('0x36')](handleEntityNotFound(_0x3dfe23,null))[_0xe554('0x36')](respondWithResult(_0x3dfe23,null))['catch'](handleError(_0x3dfe23,null));};exports[_0xe554('0x58')]=function(_0x310f9d,_0x178908){return db[_0xe554('0x3b')][_0xe554('0x58')](_0x310f9d[_0xe554('0x59')],{})[_0xe554('0x36')](respondWithResult(_0x178908,0xc9))['catch'](handleError(_0x178908,null));};exports[_0xe554('0x35')]=function(_0x36387a,_0x22ed24){if(_0x36387a[_0xe554('0x59')]['id']){delete _0x36387a[_0xe554('0x59')]['id'];}return db['SmsMessage'][_0xe554('0x57')]({'where':{'id':_0x36387a[_0xe554('0x5a')]['id']}})[_0xe554('0x36')](handleEntityNotFound(_0x22ed24,null))[_0xe554('0x36')](saveUpdates(_0x36387a[_0xe554('0x59')],null))[_0xe554('0x36')](respondWithResult(_0x22ed24,null))[_0xe554('0x54')](handleError(_0x22ed24,null));};exports[_0xe554('0x37')]=function(_0x4b0e62,_0x478440){return db[_0xe554('0x3b')]['find']({'where':{'id':_0x4b0e62[_0xe554('0x5a')]['id']}})[_0xe554('0x36')](handleEntityNotFound(_0x478440,null))[_0xe554('0x36')](removeEntity(_0x478440,null))[_0xe554('0x54')](handleError(_0x478440,null));};exports['describe']=function(_0x10d1cf,_0x710844){return db['SmsMessage']['describe']()[_0xe554('0x36')](respondWithResult(_0x710844,null))['catch'](handleError(_0x710844,null));};var interaction_log=require(_0xe554('0x5b'))(_0xe554('0x5c'));exports[_0xe554('0x5d')]=function(_0x3db684,_0xaa0a2,_0x588b47){var _0x923eea={'agent':{},'channel':_0xe554('0x5e')};if(_0x3db684[_0xe554('0x59')]['id']){delete _0x3db684['body']['id'];}_0x3db684[_0xe554('0x59')][_0xe554('0x5f')]=!![];_0x3db684['body'][_0xe554('0x60')]=moment()[_0xe554('0x61')](_0xe554('0x62'));_0x3db684['body'][_0xe554('0x63')]=_0x3db684['body'][_0xe554('0x63')]||_0x3db684['user']['id'];_0x923eea['agent']['id']=_0x3db684[_0xe554('0x59')][_0xe554('0x63')];return db[_0xe554('0x3b')][_0xe554('0x57')]({'where':{'id':_0x3db684[_0xe554('0x5a')]['id'],'UserId':null}})[_0xe554('0x36')](handleEntityNotFound(_0xaa0a2,null))[_0xe554('0x36')](saveUpdates(_0x3db684[_0xe554('0x59')],null))[_0xe554('0x36')](function(_0x32675c){if(_0x32675c){_0x923eea[_0xe554('0x28')]=_0x32675c[_0xe554('0x64')]({'plain':!![]});return db[_0xe554('0x65')][_0xe554('0x57')]({'where':{'id':_0x32675c[_0xe554('0x66')]}});}return null;})[_0xe554('0x36')](handleEntityNotFound(_0xaa0a2,null))[_0xe554('0x36')](function(_0x1d6ee7){if(_0x1d6ee7){return _0x1d6ee7['update']({'UserId':_0x3db684['body'][_0xe554('0x63')],'read1stAt':_['isNil'](_0x1d6ee7[_0xe554('0x67')])?moment()[_0xe554('0x61')](_0xe554('0x62')):undefined});}return null;})['then'](function(_0x599599){if(_0x599599){_0x923eea['interaction']=_0x599599['get']({'plain':!![]});interaction_log[_0xe554('0x29')](_0xe554('0x68'),_0x3db684[_0xe554('0x69')]['id'],_0x3db684[_0xe554('0x69')][_0xe554('0x39')],_0x3db684['user'][_0xe554('0x6a')],_0x923eea[_0xe554('0x6b')]['id'],_0x3db684[_0xe554('0x59')]?JSON[_0xe554('0x25')](_0x3db684['body']):'null');return respondWithRpcPromise('AcceptMessage',_0xe554('0x6c'),_0x923eea);}return null;})[_0xe554('0x36')](function(_0x293c04){var _0x5155b5=_0xe554('0x6d')+_0x293c04[_0xe554('0x28')][_0xe554('0x6e')];return db['sequelize'][_0xe554('0x41')](_0x5155b5,{'type':db[_0xe554('0x6f')][_0xe554('0x70')][_0xe554('0x71')],'raw':!![]})['then'](function(_0x266491){return _0x266491;});})[_0xe554('0x36')](function(_0x2d33ef){if(_0x2d33ef){_0x923eea[_0xe554('0x28')][_0xe554('0x72')]=_0x2d33ef[0x0];if(!_0x3db684[_0xe554('0x59')][_0xe554('0x63')])return;return db['User'][_0xe554('0x57')]({'where':{'id':_0x3db684[_0xe554('0x59')][_0xe554('0x63')],'role':_0xe554('0x73')},'attributes':['id',_0xe554('0x39'),'fullname',_0xe554('0x74'),'internal'],'raw':!![]});}return null;})[_0xe554('0x36')](function(_0x40e764){if(!_0x40e764)return null;_0x923eea[_0xe554('0x28')]['agent']=_0x40e764;return _0x923eea;})['then'](function(_0x4a303f){if(_0x4a303f){if(_0x3db684[_0xe554('0x59')][_0xe554('0x75')]){_0x923eea[_0xe554('0x28')][_0xe554('0x76')]=util[_0xe554('0x61')](_0xe554('0x77'),_0x3db684[_0xe554('0x69')][_0xe554('0x39')]);_0x923eea[_0xe554('0x28')][_0xe554('0x78')]=_0x923eea[_0xe554('0x78')];_0x923eea[_0xe554('0x28')][_0xe554('0x79')]=_0x923eea[_0xe554('0x78')];_0x923eea[_0xe554('0x28')][_0xe554('0x7a')]=_0xe554('0x5d');return respondWithRpcPromise(_0xe554('0x7b'),_0xe554('0x7b'),{'event':_0xe554('0x7c'),'message':_0x923eea[_0xe554('0x28')]},client9002)[_0xe554('0x36')](function(){return _0x923eea;});}return _0x923eea;}return null;})[_0xe554('0x36')](respondWithResult(_0xaa0a2,null))[_0xe554('0x54')](handleError(_0xaa0a2,null));};var interaction_log=require(_0xe554('0x5b'))(_0xe554('0x5c'));exports['reject']=function(_0x2f3822,_0xffb047,_0x3a5c0b){var _0x156fe3={'agent':{},'channel':_0xe554('0x5e')};if(_0x2f3822['body']['id']){delete _0x2f3822['body']['id'];}_0x2f3822[_0xe554('0x59')][_0xe554('0x63')]=_0x2f3822['body'][_0xe554('0x63')]||_0x2f3822[_0xe554('0x69')]['id'];_0x156fe3[_0xe554('0x73')]['id']=_0x2f3822[_0xe554('0x59')]['UserId'];return db['SmsMessage'][_0xe554('0x57')]({'where':{'id':_0x2f3822[_0xe554('0x5a')]['id'],'UserId':null}})[_0xe554('0x36')](handleEntityNotFound(_0xffb047,null))[_0xe554('0x36')](function(_0x5627da){if(_0x5627da){_0x156fe3[_0xe554('0x28')]=_0x5627da[_0xe554('0x64')]({'plain':!![]});return db[_0xe554('0x65')][_0xe554('0x57')]({'where':{'id':_0x5627da[_0xe554('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xffb047,null))[_0xe554('0x36')](function(_0x184b50){if(_0x184b50){_0x156fe3[_0xe554('0x6b')]=_0x184b50[_0xe554('0x64')]({'plain':!![]});interaction_log[_0xe554('0x29')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2f3822[_0xe554('0x69')]['id'],_0x2f3822[_0xe554('0x69')][_0xe554('0x39')],_0x2f3822[_0xe554('0x69')][_0xe554('0x6a')],_0x156fe3[_0xe554('0x6b')]['id'],_0x2f3822['body']?JSON[_0xe554('0x25')](_0x2f3822['body']):_0xe554('0x7d'));return respondWithRpcPromise(_0xe554('0x7e'),_0xe554('0x7f'),_0x156fe3);}return null;})[_0xe554('0x36')](function(_0x36bbe1){var _0x38b43e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x36bbe1[_0xe554('0x28')][_0xe554('0x6e')];return db['sequelize']['query'](_0x38b43e,{'type':db[_0xe554('0x6f')][_0xe554('0x70')]['SELECT'],'raw':!![]})[_0xe554('0x36')](function(_0x15bbbb){return _0x15bbbb;});})['then'](function(_0x12f9c5){if(_0x12f9c5){_0x156fe3[_0xe554('0x28')][_0xe554('0x72')]=_0x12f9c5[0x0];if(!_0x2f3822[_0xe554('0x59')][_0xe554('0x63')])return;return db[_0xe554('0x80')][_0xe554('0x57')]({'where':{'id':_0x2f3822[_0xe554('0x59')][_0xe554('0x63')],'role':_0xe554('0x73')},'attributes':['id','name',_0xe554('0x81'),_0xe554('0x74'),_0xe554('0x82')],'raw':!![]});}return null;})['then'](function(_0xc01ae8){if(!_0xc01ae8)return null;_0x156fe3[_0xe554('0x28')][_0xe554('0x73')]=_0xc01ae8;return _0x156fe3;})[_0xe554('0x36')](function(_0x55a537){if(_0x55a537){_0x55a537['message'][_0xe554('0x76')]=util['format'](_0xe554('0x77'),_0x2f3822[_0xe554('0x69')][_0xe554('0x39')]);_0x55a537[_0xe554('0x28')][_0xe554('0x78')]=_0x156fe3['channel'];_0x55a537['message'][_0xe554('0x79')]=_0x156fe3[_0xe554('0x78')];_0x55a537[_0xe554('0x28')]['event']=_0xe554('0x83');respondWithRpcPromise(_0xe554('0x7b'),_0xe554('0x7b'),{'event':'rejectmessage','message':_0x55a537['message']},client9002);return _0x156fe3;}return null;})[_0xe554('0x36')](respondWithResult(_0xffb047,null))[_0xe554('0x54')](handleError(_0xffb047,null));};exports['status']=function(_0x468150,_0x34357a,_0x3e8432){if(_0x468150[_0xe554('0x59')]['id']){delete _0x468150[_0xe554('0x59')]['id'];}var _0x41b3aa;return db[_0xe554('0x3b')]['find']({'where':{'id':_0x468150['params']['id']}})[_0xe554('0x36')](handleEntityNotFound(_0x34357a,null))[_0xe554('0x36')](function(_0x261fa7){if(_0x261fa7){_0x41b3aa=_0x261fa7;return db['SmsAccount'][_0xe554('0x57')]({'where':{'id':_0x261fa7['SmsAccountId']}});}})[_0xe554('0x36')](handleEntityNotFound(_0x34357a,null))[_0xe554('0x36')](function(_0x14c553){if(_0x14c553){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe554('0x2c'),_0xe554('0x84'),_0x14c553['type'],util[_0xe554('0x85')](_0x468150[_0xe554('0x59')],{'showHidden':![],'depth':null}));switch(_0x14c553[_0xe554('0x3e')]){case _0xe554('0x86'):if(_0x468150[_0xe554('0x59')][_0xe554('0x87')]&&_0x468150[_0xe554('0x59')][_0xe554('0x87')]===_0x41b3aa[_0xe554('0x88')]){return _0x41b3aa[_0xe554('0x35')]({'read':!![]});}else{logger[_0xe554('0x26')](_0xe554('0x89'),_0xe554('0x2c'),_0xe554('0x86'),util[_0xe554('0x85')](_0x468150[_0xe554('0x59')],{'showHidden':![],'depth':null}));}break;case _0xe554('0x8a'):if(_0x468150[_0xe554('0x59')]['MessageUUID']&&_0x468150[_0xe554('0x59')][_0xe554('0x8b')]===_0x41b3aa[_0xe554('0x88')]&&_['indexOf']([_0xe554('0x8c'),'delivered'],_0x468150['body'][_0xe554('0x8d')])>=0x0){return _0x41b3aa[_0xe554('0x35')]({'read':!![]});}else{logger[_0xe554('0x26')](_0xe554('0x89'),_0xe554('0x2c'),_0xe554('0x8e'),util[_0xe554('0x85')](_0x468150[_0xe554('0x59')],{'showHidden':![],'depth':null}));}break;case _0xe554('0x8f'):var _0xfa738a=_0x468150[_0xe554('0x59')][_0xe554('0x90')][0x0];if(_0xfa738a[_0xe554('0x2c')][_0xe554('0x91')]===_0xe554('0x92')){return _0x41b3aa[_0xe554('0x35')]({'read':!![]});}else{logger[_0xe554('0x26')](_0xe554('0x89'),_0xe554('0x2c'),'infobip',util[_0xe554('0x85')](_0x468150['body'],{'showHidden':![],'depth':null}));}break;}return _0x41b3aa;}})[_0xe554('0x36')](respondWithResult(_0x34357a,null))['catch'](handleError(_0x34357a,null));}; \ No newline at end of file +var _0x7b77=['model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','delivered','Status','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','debug','error','SmsMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x7b77,0x179));var _0x77b7=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x7b77[_0x1b6186];return _0x186121;};'use strict';var emlformat=require(_0x77b7('0x0'));var rimraf=require(_0x77b7('0x1'));var zipdir=require(_0x77b7('0x2'));var jsonpatch=require(_0x77b7('0x3'));var rp=require('request-promise');var moment=require(_0x77b7('0x4'));var BPromise=require(_0x77b7('0x5'));var Mustache=require(_0x77b7('0x6'));var util=require('util');var path=require(_0x77b7('0x7'));var sox=require(_0x77b7('0x8'));var csv=require(_0x77b7('0x9'));var ejs=require(_0x77b7('0xa'));var fs=require('fs');var fs_extra=require(_0x77b7('0xb'));var _=require(_0x77b7('0xc'));var squel=require('squel');var crypto=require(_0x77b7('0xd'));var jsforce=require(_0x77b7('0xe'));var deskjs=require(_0x77b7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x77b7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x77b7('0x11'));var as=require(_0x77b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77b7('0x13'))(_0x77b7('0x14'));var utils=require(_0x77b7('0x15'));var config=require(_0x77b7('0x16'));var licenseUtil=require(_0x77b7('0x17'));var db=require(_0x77b7('0x18'))['db'];config[_0x77b7('0x19')]=_['defaults'](config[_0x77b7('0x19')],{'host':_0x77b7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x77b7('0x1b')](socket);var jayson=require(_0x77b7('0x1c'));var client=jayson[_0x77b7('0x1d')][_0x77b7('0x1e')]({'port':0x232c});var client9002=jayson[_0x77b7('0x1d')][_0x77b7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4dbe04,_0x19d460,_0x253543,_0x3cb44b){return new BPromise(function(_0x2060df,_0x1cd7dd){var _0x25f361=_0x3cb44b||client;return _0x25f361[_0x77b7('0x1f')](_0x4dbe04,_0x253543)[_0x77b7('0x20')](function(_0x286046){logger['info']('SmsMessage,\x20%s,\x20%s',_0x19d460,'request\x20sent');logger[_0x77b7('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x19d460,'request\x20sent',JSON['stringify'](_0x286046));if(_0x286046['error']){if(_0x286046[_0x77b7('0x22')]['code']===0x1f4){logger[_0x77b7('0x22')]('SmsMessage,\x20%s,\x20%s',_0x19d460,_0x286046[_0x77b7('0x22')]['message']);return _0x1cd7dd(_0x286046[_0x77b7('0x22')]['message']);}logger[_0x77b7('0x22')](_0x77b7('0x23'),_0x19d460,_0x286046[_0x77b7('0x22')][_0x77b7('0x24')]);return _0x2060df(_0x286046[_0x77b7('0x22')][_0x77b7('0x24')]);}else{logger[_0x77b7('0x25')](_0x77b7('0x23'),_0x19d460,_0x77b7('0x26'));_0x2060df(_0x286046[_0x77b7('0x27')][_0x77b7('0x24')]);}})[_0x77b7('0x28')](function(_0x29c2aa){logger[_0x77b7('0x22')](_0x77b7('0x23'),_0x19d460,_0x29c2aa);_0x1cd7dd(_0x29c2aa);});});}function respondWithStatusCode(_0x359b23,_0x300de9){_0x300de9=_0x300de9||0xcc;return function(_0x1cfcbb){if(_0x1cfcbb){return _0x359b23['sendStatus'](_0x300de9);}return _0x359b23['status'](_0x300de9)[_0x77b7('0x29')]();};}function respondWithResult(_0x22c56d,_0x3cae5a){_0x3cae5a=_0x3cae5a||0xc8;return function(_0x4c6f8d){if(_0x4c6f8d){return _0x22c56d[_0x77b7('0x2a')](_0x3cae5a)[_0x77b7('0x2b')](_0x4c6f8d);}};}function respondWithFilteredResult(_0x20de87,_0x16b66a){return function(_0x114cf0){if(_0x114cf0){var _0x323363=typeof _0x16b66a[_0x77b7('0x2c')]===_0x77b7('0x2d')&&typeof _0x16b66a[_0x77b7('0x2e')]==='undefined';var _0x2afbf5=_0x114cf0[_0x77b7('0x2f')];var _0x23aa7e=_0x323363?0x0:_0x16b66a[_0x77b7('0x2c')];var _0x2e87e6=_0x323363?_0x114cf0[_0x77b7('0x2f')]:_0x16b66a[_0x77b7('0x2c')]+_0x16b66a[_0x77b7('0x2e')];var _0xcac9e;if(_0x2e87e6>=_0x2afbf5){_0x2e87e6=_0x2afbf5;_0xcac9e=0xc8;}else{_0xcac9e=0xce;}_0x20de87[_0x77b7('0x2a')](_0xcac9e);return _0x20de87['set'](_0x77b7('0x30'),_0x23aa7e+'-'+_0x2e87e6+'/'+_0x2afbf5)[_0x77b7('0x2b')](_0x114cf0);}return null;};}function patchUpdates(_0x15eb97){return function(_0x4c4ba5){try{jsonpatch[_0x77b7('0x31')](_0x4c4ba5,_0x15eb97,!![]);}catch(_0x4b8d1e){return BPromise[_0x77b7('0x32')](_0x4b8d1e);}return _0x4c4ba5[_0x77b7('0x33')]();};}function saveUpdates(_0x4b24a2,_0x31102a){return function(_0x4eb758){if(_0x4eb758){return _0x4eb758[_0x77b7('0x34')](_0x4b24a2)[_0x77b7('0x20')](function(_0xad1a3c){return _0xad1a3c;});}return null;};}function removeEntity(_0x50345e,_0x21fae3){return function(_0x108c6d){if(_0x108c6d){return _0x108c6d[_0x77b7('0x35')]()[_0x77b7('0x20')](function(){_0x50345e[_0x77b7('0x2a')](0xcc)[_0x77b7('0x29')]();});}};}function handleEntityNotFound(_0x214257,_0x26a52d){return function(_0x3cf95f){if(!_0x3cf95f){_0x214257[_0x77b7('0x36')](0x194);}return _0x3cf95f;};}function handleError(_0x3546d8,_0xacd0b7){_0xacd0b7=_0xacd0b7||0x1f4;return function(_0xb5f230){logger['error'](_0xb5f230[_0x77b7('0x37')]);if(_0xb5f230[_0x77b7('0x38')]){delete _0xb5f230[_0x77b7('0x38')];}_0x3546d8['status'](_0xacd0b7)['send'](_0xb5f230);};}exports[_0x77b7('0x39')]=function(_0x2c5c77,_0x42d245){var _0x2d11ef={},_0x1bdfec={},_0x1f5184={'count':0x0,'rows':[]};var _0x1330e9=_[_0x77b7('0x3a')](db[_0x77b7('0x3b')][_0x77b7('0x3c')],function(_0x17f4ca){return{'name':_0x17f4ca[_0x77b7('0x3d')],'type':_0x17f4ca[_0x77b7('0x3e')][_0x77b7('0x3f')]};});_0x1bdfec[_0x77b7('0x40')]=_[_0x77b7('0x3a')](_0x1330e9,_0x77b7('0x38'));_0x1bdfec[_0x77b7('0x41')]=_[_0x77b7('0x42')](_0x2c5c77[_0x77b7('0x41')]);_0x1bdfec[_0x77b7('0x43')]=_['intersection'](_0x1bdfec[_0x77b7('0x40')],_0x1bdfec[_0x77b7('0x41')]);_0x2d11ef['attributes']=_[_0x77b7('0x44')](_0x1bdfec['model'],qs[_0x77b7('0x45')](_0x2c5c77[_0x77b7('0x41')]['fields']));_0x2d11ef[_0x77b7('0x46')]=_0x2d11ef['attributes']['length']?_0x2d11ef[_0x77b7('0x46')]:_0x1bdfec['model'];if(!_0x2c5c77[_0x77b7('0x41')]['hasOwnProperty'](_0x77b7('0x47'))){_0x2d11ef[_0x77b7('0x2e')]=qs[_0x77b7('0x2e')](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x2e')]);_0x2d11ef[_0x77b7('0x2c')]=qs['offset'](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x2c')]);}_0x2d11ef[_0x77b7('0x48')]=qs[_0x77b7('0x49')](_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x49')]);_0x2d11ef[_0x77b7('0x4a')]=qs[_0x77b7('0x43')](_['pick'](_0x2c5c77[_0x77b7('0x41')],_0x1bdfec['filters']),_0x1330e9);if(_0x2c5c77[_0x77b7('0x41')]['filter']){_0x2d11ef[_0x77b7('0x4a')]=_[_0x77b7('0x4b')](_0x2d11ef[_0x77b7('0x4a')],{'$or':_[_0x77b7('0x3a')](_0x1330e9,function(_0x1250ad){if(_0x1250ad[_0x77b7('0x3e')]!==_0x77b7('0x4c')){var _0x52a73d={};_0x52a73d[_0x1250ad[_0x77b7('0x38')]]={'$like':'%'+_0x2c5c77[_0x77b7('0x41')]['filter']+'%'};return _0x52a73d;}})});}_0x2d11ef=_['merge']({},_0x2d11ef,_0x2c5c77[_0x77b7('0x4d')]);var _0x5dbb20={'where':_0x2d11ef[_0x77b7('0x4a')]};return db[_0x77b7('0x3b')][_0x77b7('0x2f')](_0x5dbb20)[_0x77b7('0x20')](function(_0x46d361){_0x1f5184[_0x77b7('0x2f')]=_0x46d361;if(_0x2c5c77[_0x77b7('0x41')][_0x77b7('0x4e')]){_0x2d11ef[_0x77b7('0x4f')]=[{'all':!![]}];}return db[_0x77b7('0x3b')][_0x77b7('0x50')](_0x2d11ef);})[_0x77b7('0x20')](function(_0x272bfb){_0x1f5184[_0x77b7('0x51')]=_0x272bfb;return _0x1f5184;})[_0x77b7('0x20')](respondWithFilteredResult(_0x42d245,_0x2d11ef))['catch'](handleError(_0x42d245,null));};exports[_0x77b7('0x52')]=function(_0x59a29d,_0x2da729){var _0x4ffde2={'raw':!![],'where':{'id':_0x59a29d[_0x77b7('0x53')]['id']}},_0x37ba6b={};_0x37ba6b[_0x77b7('0x40')]=_[_0x77b7('0x42')](db['SmsMessage'][_0x77b7('0x3c')]);_0x37ba6b['query']=_[_0x77b7('0x42')](_0x59a29d[_0x77b7('0x41')]);_0x37ba6b['filters']=_['intersection'](_0x37ba6b['model'],_0x37ba6b[_0x77b7('0x41')]);_0x4ffde2['attributes']=_[_0x77b7('0x44')](_0x37ba6b[_0x77b7('0x40')],qs[_0x77b7('0x45')](_0x59a29d[_0x77b7('0x41')]['fields']));_0x4ffde2[_0x77b7('0x46')]=_0x4ffde2[_0x77b7('0x46')][_0x77b7('0x54')]?_0x4ffde2[_0x77b7('0x46')]:_0x37ba6b['model'];if(_0x59a29d[_0x77b7('0x41')][_0x77b7('0x4e')]){_0x4ffde2['include']=[{'all':!![]}];}_0x4ffde2=_[_0x77b7('0x4b')]({},_0x4ffde2,_0x59a29d[_0x77b7('0x4d')]);return db[_0x77b7('0x3b')][_0x77b7('0x55')](_0x4ffde2)[_0x77b7('0x20')](handleEntityNotFound(_0x2da729,null))[_0x77b7('0x20')](respondWithResult(_0x2da729,null))[_0x77b7('0x28')](handleError(_0x2da729,null));};exports['create']=function(_0x404f23,_0x29d52b){return db['SmsMessage'][_0x77b7('0x56')](_0x404f23[_0x77b7('0x57')],{})[_0x77b7('0x20')](respondWithResult(_0x29d52b,0xc9))[_0x77b7('0x28')](handleError(_0x29d52b,null));};exports['update']=function(_0x50e6ab,_0x3a4902){if(_0x50e6ab[_0x77b7('0x57')]['id']){delete _0x50e6ab['body']['id'];}return db['SmsMessage'][_0x77b7('0x55')]({'where':{'id':_0x50e6ab[_0x77b7('0x53')]['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x3a4902,null))[_0x77b7('0x20')](saveUpdates(_0x50e6ab[_0x77b7('0x57')],null))[_0x77b7('0x20')](respondWithResult(_0x3a4902,null))[_0x77b7('0x28')](handleError(_0x3a4902,null));};exports[_0x77b7('0x35')]=function(_0x58296f,_0x5aa315){return db[_0x77b7('0x3b')][_0x77b7('0x55')]({'where':{'id':_0x58296f[_0x77b7('0x53')]['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x5aa315,null))[_0x77b7('0x20')](removeEntity(_0x5aa315,null))['catch'](handleError(_0x5aa315,null));};exports['describe']=function(_0x642f7a,_0x1323fc){return db['SmsMessage'][_0x77b7('0x58')]()['then'](respondWithResult(_0x1323fc,null))[_0x77b7('0x28')](handleError(_0x1323fc,null));};var interaction_log=require(_0x77b7('0x13'))(_0x77b7('0x59'));exports[_0x77b7('0x5a')]=function(_0x136fb5,_0x346083,_0x325208){var _0x1f590e={'agent':{},'channel':_0x77b7('0x5b')};if(_0x136fb5[_0x77b7('0x57')]['id']){delete _0x136fb5[_0x77b7('0x57')]['id'];}_0x136fb5['body'][_0x77b7('0x5c')]=!![];_0x136fb5[_0x77b7('0x57')][_0x77b7('0x5d')]=moment()[_0x77b7('0x5e')](_0x77b7('0x5f'));_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')]=_0x136fb5['body'][_0x77b7('0x60')]||_0x136fb5[_0x77b7('0x61')]['id'];_0x1f590e[_0x77b7('0x62')]['id']=_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')];return db[_0x77b7('0x3b')][_0x77b7('0x55')]({'where':{'id':_0x136fb5[_0x77b7('0x53')]['id'],'UserId':null}})[_0x77b7('0x20')](handleEntityNotFound(_0x346083,null))[_0x77b7('0x20')](saveUpdates(_0x136fb5[_0x77b7('0x57')],null))[_0x77b7('0x20')](function(_0x1da758){if(_0x1da758){_0x1f590e[_0x77b7('0x24')]=_0x1da758[_0x77b7('0x63')]({'plain':!![]});return db[_0x77b7('0x64')][_0x77b7('0x55')]({'where':{'id':_0x1da758[_0x77b7('0x65')]}});}return null;})[_0x77b7('0x20')](handleEntityNotFound(_0x346083,null))[_0x77b7('0x20')](function(_0x5e4338){if(_0x5e4338){return _0x5e4338['update']({'UserId':_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')],'read1stAt':_[_0x77b7('0x66')](_0x5e4338[_0x77b7('0x67')])?moment()[_0x77b7('0x5e')](_0x77b7('0x5f')):undefined});}return null;})[_0x77b7('0x20')](function(_0x4ddf38){if(_0x4ddf38){_0x1f590e[_0x77b7('0x68')]=_0x4ddf38['get']({'plain':!![]});interaction_log[_0x77b7('0x25')](_0x77b7('0x69'),_0x136fb5[_0x77b7('0x61')]['id'],_0x136fb5[_0x77b7('0x61')][_0x77b7('0x38')],_0x136fb5['user'][_0x77b7('0x6a')],_0x1f590e[_0x77b7('0x68')]['id'],_0x136fb5['body']?JSON[_0x77b7('0x6b')](_0x136fb5[_0x77b7('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0x77b7('0x6c'),_0x1f590e);}return null;})['then'](function(_0x2e1910){var _0x571041='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e1910[_0x77b7('0x24')][_0x77b7('0x6d')];return db[_0x77b7('0x6e')]['query'](_0x571041,{'type':db[_0x77b7('0x6f')]['QueryTypes'][_0x77b7('0x70')],'raw':!![]})[_0x77b7('0x20')](function(_0x23911a){return _0x23911a;});})[_0x77b7('0x20')](function(_0x57ce8b){if(_0x57ce8b){_0x1f590e['message'][_0x77b7('0x71')]=_0x57ce8b[0x0];if(!_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')])return;return db[_0x77b7('0x72')][_0x77b7('0x55')]({'where':{'id':_0x136fb5[_0x77b7('0x57')][_0x77b7('0x60')],'role':_0x77b7('0x62')},'attributes':['id',_0x77b7('0x38'),_0x77b7('0x73'),_0x77b7('0x74'),'internal'],'raw':!![]});}return null;})[_0x77b7('0x20')](function(_0x5bca0e){if(!_0x5bca0e)return null;_0x1f590e['message']['agent']=_0x5bca0e;return _0x1f590e;})['then'](function(_0x20aa17){if(_0x20aa17){if(_0x136fb5[_0x77b7('0x57')][_0x77b7('0x75')]){_0x1f590e[_0x77b7('0x24')][_0x77b7('0x76')]=util[_0x77b7('0x5e')](_0x77b7('0x77'),_0x136fb5['user']['name']);_0x1f590e[_0x77b7('0x24')][_0x77b7('0x78')]=_0x1f590e[_0x77b7('0x78')];_0x1f590e[_0x77b7('0x24')][_0x77b7('0x79')]=_0x1f590e[_0x77b7('0x78')];_0x1f590e[_0x77b7('0x24')][_0x77b7('0x7a')]=_0x77b7('0x5a');return respondWithRpcPromise(_0x77b7('0x7b'),'EventManager',{'event':_0x77b7('0x7c'),'message':_0x1f590e[_0x77b7('0x24')]},client9002)[_0x77b7('0x20')](function(){return _0x1f590e;});}return _0x1f590e;}return null;})[_0x77b7('0x20')](respondWithResult(_0x346083,null))[_0x77b7('0x28')](handleError(_0x346083,null));};var interaction_log=require('../../config/logger')(_0x77b7('0x59'));exports[_0x77b7('0x32')]=function(_0x2dea85,_0x48924c,_0x4fd6ce){var _0xbdf72f={'agent':{},'channel':'sms'};if(_0x2dea85[_0x77b7('0x57')]['id']){delete _0x2dea85[_0x77b7('0x57')]['id'];}_0x2dea85['body']['UserId']=_0x2dea85['body']['UserId']||_0x2dea85[_0x77b7('0x61')]['id'];_0xbdf72f[_0x77b7('0x62')]['id']=_0x2dea85['body'][_0x77b7('0x60')];return db['SmsMessage']['find']({'where':{'id':_0x2dea85[_0x77b7('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48924c,null))[_0x77b7('0x20')](function(_0x56aa57){if(_0x56aa57){_0xbdf72f['message']=_0x56aa57[_0x77b7('0x63')]({'plain':!![]});return db[_0x77b7('0x64')][_0x77b7('0x55')]({'where':{'id':_0x56aa57[_0x77b7('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x48924c,null))['then'](function(_0x4e787f){if(_0x4e787f){_0xbdf72f[_0x77b7('0x68')]=_0x4e787f[_0x77b7('0x63')]({'plain':!![]});interaction_log[_0x77b7('0x25')](_0x77b7('0x7d'),_0x2dea85[_0x77b7('0x61')]['id'],_0x2dea85[_0x77b7('0x61')][_0x77b7('0x38')],_0x2dea85[_0x77b7('0x61')][_0x77b7('0x6a')],_0xbdf72f[_0x77b7('0x68')]['id'],_0x2dea85['body']?JSON['stringify'](_0x2dea85[_0x77b7('0x57')]):_0x77b7('0x7e'));return respondWithRpcPromise(_0x77b7('0x7f'),_0x77b7('0x80'),_0xbdf72f);}return null;})[_0x77b7('0x20')](function(_0x411810){var _0x385987=_0x77b7('0x81')+_0x411810[_0x77b7('0x24')][_0x77b7('0x6d')];return db['sequelize'][_0x77b7('0x41')](_0x385987,{'type':db[_0x77b7('0x6f')]['QueryTypes'][_0x77b7('0x70')],'raw':!![]})[_0x77b7('0x20')](function(_0x5d41fb){return _0x5d41fb;});})[_0x77b7('0x20')](function(_0x4ba5bd){if(_0x4ba5bd){_0xbdf72f[_0x77b7('0x24')][_0x77b7('0x71')]=_0x4ba5bd[0x0];if(!_0x2dea85[_0x77b7('0x57')][_0x77b7('0x60')])return;return db['User'][_0x77b7('0x55')]({'where':{'id':_0x2dea85['body'][_0x77b7('0x60')],'role':_0x77b7('0x62')},'attributes':['id',_0x77b7('0x38'),_0x77b7('0x73'),_0x77b7('0x74'),_0x77b7('0x82')],'raw':!![]});}return null;})[_0x77b7('0x20')](function(_0x2c4e23){if(!_0x2c4e23)return null;_0xbdf72f[_0x77b7('0x24')]['agent']=_0x2c4e23;return _0xbdf72f;})[_0x77b7('0x20')](function(_0x326b13){if(_0x326b13){_0x326b13[_0x77b7('0x24')][_0x77b7('0x76')]=util[_0x77b7('0x5e')](_0x77b7('0x77'),_0x2dea85['user']['name']);_0x326b13[_0x77b7('0x24')][_0x77b7('0x78')]=_0xbdf72f[_0x77b7('0x78')];_0x326b13['message'][_0x77b7('0x79')]=_0xbdf72f['channel'];_0x326b13[_0x77b7('0x24')][_0x77b7('0x7a')]=_0x77b7('0x32');respondWithRpcPromise(_0x77b7('0x7b'),_0x77b7('0x7b'),{'event':'rejectmessage','message':_0x326b13[_0x77b7('0x24')]},client9002);return _0xbdf72f;}return null;})['then'](respondWithResult(_0x48924c,null))[_0x77b7('0x28')](handleError(_0x48924c,null));};exports[_0x77b7('0x2a')]=function(_0x1a7afd,_0x2558fd,_0x11adb5){if(_0x1a7afd[_0x77b7('0x57')]['id']){delete _0x1a7afd['body']['id'];}var _0x1582ab;return db['SmsMessage'][_0x77b7('0x55')]({'where':{'id':_0x1a7afd['params']['id']}})[_0x77b7('0x20')](handleEntityNotFound(_0x2558fd,null))['then'](function(_0x2798da){if(_0x2798da){_0x1582ab=_0x2798da;return db['SmsAccount'][_0x77b7('0x55')]({'where':{'id':_0x2798da['SmsAccountId']}});}})[_0x77b7('0x20')](handleEntityNotFound(_0x2558fd,null))[_0x77b7('0x20')](function(_0x43faf7){if(_0x43faf7){logger['debug'](_0x77b7('0x83'),_0x77b7('0x2a'),_0x77b7('0x84'),_0x43faf7[_0x77b7('0x3e')],util['inspect'](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));switch(_0x43faf7[_0x77b7('0x3e')]){case _0x77b7('0x85'):if(_0x1a7afd['body'][_0x77b7('0x86')]&&_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x86')]===_0x1582ab[_0x77b7('0x87')]){return _0x1582ab[_0x77b7('0x34')]({'read':!![]});}else{logger['error'](_0x77b7('0x88'),_0x77b7('0x2a'),_0x77b7('0x85'),util[_0x77b7('0x89')](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));}break;case _0x77b7('0x8a'):if(_0x1a7afd['body'][_0x77b7('0x8b')]&&_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x8b')]===_0x1582ab['messageId']&&_[_0x77b7('0x8c')](['sent',_0x77b7('0x8d')],_0x1a7afd[_0x77b7('0x57')][_0x77b7('0x8e')])>=0x0){return _0x1582ab['update']({'read':!![]});}else{logger[_0x77b7('0x22')](_0x77b7('0x88'),_0x77b7('0x2a'),'plivio',util[_0x77b7('0x89')](_0x1a7afd['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5eb9de=_0x1a7afd['body'][_0x77b7('0x8f')][0x0];if(_0x5eb9de[_0x77b7('0x2a')][_0x77b7('0x90')]===_0x77b7('0x91')){return _0x1582ab[_0x77b7('0x34')]({'read':!![]});}else{logger[_0x77b7('0x22')](_0x77b7('0x88'),'status',_0x77b7('0x92'),util['inspect'](_0x1a7afd[_0x77b7('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1582ab;}})[_0x77b7('0x20')](respondWithResult(_0x2558fd,null))[_0x77b7('0x28')](handleError(_0x2558fd,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b1e532b..9b5cf17 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 _0x26d1=['hook','exports','events','SmsMessage','setMaxListeners','save','update','hasOwnProperty'];(function(_0x1e5a0f,_0x28389c){var _0xeff22c=function(_0x28da88){while(--_0x28da88){_0x1e5a0f['push'](_0x1e5a0f['shift']());}};_0xeff22c(++_0x28389c);}(_0x26d1,0xfa));var _0x126d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x26d1[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0x126d('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x126d('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x126d('0x2')](0x0);var events={'afterCreate':_0x126d('0x3'),'afterUpdate':_0x126d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52a806){return function(_0x3cc5e2,_0x293c16,_0x11e498){SmsMessageEvents['emit'](_0x52a806+':'+_0x3cc5e2['id'],_0x3cc5e2);SmsMessageEvents['emit'](_0x52a806,_0x3cc5e2);_0x11e498(null);};}for(var e in events){if(events[_0x126d('0x5')](e)){var event=events[e];SmsMessage[_0x126d('0x6')](e,emitEvent(event));}}module[_0x126d('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x8cc0=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x3b5bb9,_0xb6966c){var _0x442019=function(_0x147c15){while(--_0x147c15){_0x3b5bb9['push'](_0x3b5bb9['shift']());}};_0x442019(++_0xb6966c);}(_0x8cc0,0x1ed));var _0x08cc=function(_0xe91574,_0x58e962){_0xe91574=_0xe91574-0x0;var _0x371f15=_0x8cc0[_0xe91574];return _0x371f15;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x08cc('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x08cc('0x1')](0x0);var events={'afterCreate':_0x08cc('0x2'),'afterUpdate':'update','afterDestroy':_0x08cc('0x3')};function emitEvent(_0x6f8b30){return function(_0x25b25f,_0x93d18b,_0x5aedc1){SmsMessageEvents['emit'](_0x6f8b30+':'+_0x25b25f['id'],_0x25b25f);SmsMessageEvents[_0x08cc('0x4')](_0x6f8b30,_0x25b25f);_0x5aedc1(null);};}for(var e in events){if(events[_0x08cc('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x08cc('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index fde25f9..b6769a3 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 _0x5c05=['afterCreate','inspect','error','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','crypto','apiKey','login','text','timestamp','keys','sort','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x5c05,0x1c5));var _0x55c0=function(_0x47c265,_0x42fab5){_0x47c265=_0x47c265-0x0;var _0x3c372a=_0x5c05[_0x47c265];return _0x3c372a;};'use strict';var _=require(_0x55c0('0x0'));var util=require(_0x55c0('0x1'));var logger=require(_0x55c0('0x2'))(_0x55c0('0x3'));var moment=require(_0x55c0('0x4'));var BPromise=require(_0x55c0('0x5'));var rp=require(_0x55c0('0x6'));var fs=require('fs');var path=require(_0x55c0('0x7'));var rimraf=require(_0x55c0('0x8'));var config=require(_0x55c0('0x9'));var attributes=require('./smsMessage.attributes');module[_0x55c0('0xa')]=function(_0x4fb708,_0x8417c7){return _0x4fb708[_0x55c0('0xb')](_0x55c0('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x55c0('0xd')]},{'name':_0x55c0('0xe'),'fields':[_0x55c0('0xf')],'type':_0x55c0('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x19fcde,_0x1a3fe0,_0x404a48){var _0xfa0943=_0x4fb708['models'];var _0x422ecf=_0x19fcde[_0x55c0('0x11')]({'plain':!![]});if(_0x422ecf[_0x55c0('0x12')]['toLowerCase']()==='in'||_0x422ecf['direction']['toLowerCase']()===_0x55c0('0x13')&&!_0x422ecf[_0x55c0('0x14')]&&!_[_0x55c0('0x15')](_0x422ecf['UserId'])&&!_['isNil'](_0x422ecf['SmsInteractionId'])){_0xfa0943[_0x55c0('0x16')][_0x55c0('0x17')]({'where':{'id':_0x422ecf[_0x55c0('0x18')]}})[_0x55c0('0x19')](function(_0x2e779e){if(_0x2e779e){_0x2e779e[_0x55c0('0x1a')]({'lastMsgAt':_0x422ecf[_0x55c0('0x1b')],'lastMsgDirection':_0x422ecf['direction']['toLowerCase']()});}})['catch'](function(_0x6e447a){console['error'](_0x6e447a);});}if(_0x422ecf[_0x55c0('0x12')]==='out'&&!_0x422ecf[_0x55c0('0x14')]){var _0x1d0d3a;_0xfa0943[_0x55c0('0x1c')]['find']({'where':{'id':_0x422ecf[_0x55c0('0x1d')]},'raw':!![]})[_0x55c0('0x19')](function(_0xb80d58){_0x1d0d3a=_0xb80d58;if(_0x1d0d3a&&_0x1d0d3a[_0x55c0('0x1e')]){switch(_0x1d0d3a['type']){case _0x55c0('0x1f'):var _0x46637e=require('twilio');if(_0x1d0d3a[_0x55c0('0x20')]&&_0x1d0d3a[_0x55c0('0x21')]&&_0x1d0d3a[_0x55c0('0x22')]){var _0x3d3128=new _0x46637e(_0x1d0d3a[_0x55c0('0x20')],_0x1d0d3a['authToken']);_0x3d3128[_0x55c0('0x23')][_0x55c0('0x24')]({'body':_0x422ecf[_0x55c0('0xf')],'to':_0x422ecf[_0x55c0('0x22')],'from':_0x1d0d3a[_0x55c0('0x22')],'statusCallback':_0x1d0d3a[_0x55c0('0x25')]+_0x55c0('0x26')+_0x422ecf['id']+_0x55c0('0x27')+_0x1d0d3a[_0x55c0('0x28')]})[_0x55c0('0x19')](function(_0x44394f){if(_0x44394f[_0x55c0('0x29')]){return _0x19fcde[_0x55c0('0x1a')]({'messageId':_0x44394f[_0x55c0('0x29')]});}})[_0x55c0('0x2a')](function(_0x4bd7b9){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x55c0('0x2b'),_0x55c0('0x1f'),util[_0x55c0('0x2c')](_0x4bd7b9,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x55c0('0x2f'):var _0x4e1124=_0x55c0('0x30');if(_0x1d0d3a[_0x55c0('0x31')]&&_0x1d0d3a[_0x55c0('0x32')]){var _0x54a04f={'recipient':[_0x422ecf['phone']],'message':_0x422ecf[_0x55c0('0xf')],'message_type':_0x1d0d3a[_0x55c0('0x33')]};if(_0x1d0d3a[_0x55c0('0x33')]&&_0x1d0d3a[_0x55c0('0x33')]!=='SI'){_0x54a04f[_0x55c0('0x34')]=_0x1d0d3a[_0x55c0('0x22')];}var _0x17a2bf={'url':_0x4e1124+_0x55c0('0x35')+_0x1d0d3a[_0x55c0('0x31')]+_0x55c0('0x36')+_0x1d0d3a['password'],'method':_0x55c0('0x37')};rp(_0x17a2bf)[_0x55c0('0x19')](function(_0x2dc95b){var _0x546a0a=_0x2dc95b[_0x55c0('0x38')](';');var _0x2819c5={'user_key':_0x546a0a[0x0],'session_key':_0x546a0a[0x1]};_0x17a2bf={'url':_0x4e1124+_0x55c0('0x39'),'method':_0x55c0('0x3a'),'headers':{'user_key':_0x2819c5[_0x55c0('0x3b')],'Session_key':_0x2819c5[_0x55c0('0x3c')]},'json':!![],'body':_0x54a04f};return rp(_0x17a2bf);})[_0x55c0('0x19')](function(_0x2d4580){if(_0x2d4580[_0x55c0('0x3d')]>=0x1){var _0x2bba13={'messageId':_0x2d4580[_0x55c0('0x3e')]};if(_0x1d0d3a[_0x55c0('0x33')]!=='GP'||!_0x1d0d3a['deliveryReport']){_0x2bba13[_0x55c0('0x3f')]=!![];}return _0x19fcde['update'](_0x2bba13);}else{return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x2f'),util[_0x55c0('0x2c')](_0x2d4580,{'showHidden':![],'depth':null}));}})[_0x55c0('0x2a')](function(_0x4f67d5){return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x2f'),util[_0x55c0('0x2c')](_0x4f67d5,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),'skebby',_0x55c0('0x40'));}break;case'connectel':if(_0x1d0d3a['authToken']){var _0x69c82b={'recipient':_0x422ecf[_0x55c0('0x22')],'message':_0x422ecf['body'],'sender':_0x1d0d3a[_0x55c0('0x41')]||_0x1d0d3a['phone'],'authorization':_0x1d0d3a[_0x55c0('0x21')]};var _0x1a3fe0={'method':_0x55c0('0x3a'),'uri':_0x55c0('0x42'),'body':_0x69c82b,'json':!![]};rp(_0x1a3fe0)[_0x55c0('0x19')](function(_0x54c3de){var _0x5c8b1e={'messageId':_0x54c3de[_0x55c0('0x43')]};if(!_0x1d0d3a[_0x55c0('0x44')]){_0x5c8b1e[_0x55c0('0x3f')]=!![];}return _0x19fcde[_0x55c0('0x1a')](_0x5c8b1e);})[_0x55c0('0x2a')](function(_0xd4929b){logger[_0x55c0('0x2d')](_0x55c0('0x2e'),'afterCreate',_0x55c0('0x45'),util['inspect'](_0xd4929b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x45'),_0x55c0('0x46'));}break;case _0x55c0('0x47'):if(_0x1d0d3a[_0x55c0('0x31')]&&_0x1d0d3a['password']){var _0x69c82b={'messages':[{'source':'xCALLY\x20Motion','to':_0x422ecf[_0x55c0('0x22')],'body':_0x422ecf[_0x55c0('0xf')],'from':_0x1d0d3a[_0x55c0('0x41')]||_0x1d0d3a[_0x55c0('0x22')]}]};var _0x43d1dd=util[_0x55c0('0x48')](_0x55c0('0x49'),_0x1d0d3a[_0x55c0('0x31')],_0x1d0d3a[_0x55c0('0x32')]);var _0x1a3fe0={'method':_0x55c0('0x3a'),'uri':_0x55c0('0x4a'),'body':_0x69c82b,'headers':{'Authorization':util[_0x55c0('0x48')]('Basic\x20%s',new Buffer(_0x43d1dd)[_0x55c0('0x4b')](_0x55c0('0x4c')))},'json':!![]};rp(_0x1a3fe0)[_0x55c0('0x19')](function(_0x1549bb){if(_0x1549bb[_0x55c0('0x4d')]>=0xc8&&_0x1549bb['http_code']<=0xce){if(_0x1549bb[_0x55c0('0x4e')]&&_0x1549bb['data'][_0x55c0('0x4f')]>0x0){var _0x122744=_['head'](_0x1549bb[_0x55c0('0x4e')][_0x55c0('0x23')]);var _0x4f9dd8={'messageId':_0x122744[_0x55c0('0x50')]};if(!_0x1d0d3a[_0x55c0('0x44')]){_0x4f9dd8[_0x55c0('0x3f')]=!![];}return _0x19fcde[_0x55c0('0x1a')](_0x4f9dd8);}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),'afterCreate','clickSend',util['inspect'](_0x1549bb,{'showHidden':![],'depth':null}));}}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x51'),util[_0x55c0('0x2c')](_0x1549bb,{'showHidden':![],'depth':null}));}})[_0x55c0('0x2a')](function(_0x54f468){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x55c0('0x51'),util[_0x55c0('0x2c')](_0x54f468,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),'afterCreate',_0x55c0('0x51'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x55c0('0x52'):if(_0x1d0d3a[_0x55c0('0x53')]&&_0x1d0d3a[_0x55c0('0x21')]){var _0x69c82b={'dst':_0x422ecf[_0x55c0('0x22')],'text':_0x422ecf[_0x55c0('0xf')],'src':_0x1d0d3a[_0x55c0('0x41')]||_0x1d0d3a[_0x55c0('0x22')],'url':_0x1d0d3a['remote']+_0x55c0('0x26')+_0x422ecf['id']+'/status?token='+_0x1d0d3a['token']};var _0x43d1dd=util['format'](_0x55c0('0x49'),_0x1d0d3a['authId'],_0x1d0d3a[_0x55c0('0x21')]);var _0x1a3fe0={'method':_0x55c0('0x3a'),'uri':util[_0x55c0('0x48')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1d0d3a['authId']),'body':_0x69c82b,'headers':{'Authorization':util[_0x55c0('0x48')](_0x55c0('0x54'),new Buffer(_0x43d1dd)['toString'](_0x55c0('0x4c')))},'json':!![]};rp(_0x1a3fe0)[_0x55c0('0x19')](function(_0x31d9b0){var _0x4de417={'messageId':_0x31d9b0[_0x55c0('0x55')][0x0]};return _0x19fcde[_0x55c0('0x1a')](_0x4de417);})[_0x55c0('0x2a')](function(_0x521523){logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x52'),util[_0x55c0('0x2c')](_0x521523,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x55c0('0x2b'),_0x55c0('0x52'),_0x55c0('0x56'));}break;case _0x55c0('0x57'):if(_0x1d0d3a[_0x55c0('0x31')]&&_0x1d0d3a['password']){if(_0x1d0d3a[_0x55c0('0x58')]){var _0x54a306={'method':_0x55c0('0x3a'),'uri':_0x1d0d3a['baseUrl']+_0x55c0('0x59'),'body':{'username':_0x1d0d3a[_0x55c0('0x31')],'password':_0x1d0d3a[_0x55c0('0x32')]},'json':!![]};return rp(_0x54a306)[_0x55c0('0x19')](function(_0x459d2e){var _0x572048={'method':'POST','uri':_0x1d0d3a[_0x55c0('0x58')]+_0x55c0('0x5a'),'body':{'messages':[{'from':_0x1d0d3a[_0x55c0('0x22')],'destinations':[{'to':_0x422ecf[_0x55c0('0x22')]}],'text':_0x422ecf[_0x55c0('0xf')],'notifyUrl':_0x1d0d3a['remote']+_0x55c0('0x26')+_0x422ecf['id']+_0x55c0('0x27')+_0x1d0d3a[_0x55c0('0x28')],'notifyContentType':'application/json','callbackData':_0x1d0d3a[_0x55c0('0x22')]+';'+_0x422ecf[_0x55c0('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x459d2e['token']},'json':!![]};return rp(_0x572048)['then'](function(_0x5c9515){if(_0x5c9515[_0x55c0('0x23')]){var _0x3c4d06={'messageId':_0x5c9515[_0x55c0('0x23')][0x0][_0x55c0('0xd')]};if(!_0x1d0d3a[_0x55c0('0x44')]){_0x3c4d06['read']=!![];}return _0x19fcde[_0x55c0('0x1a')](_0x3c4d06);}else{return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x57'),util['inspect'](_0x5c9515,{'showHidden':![],'depth':null}));}});})[_0x55c0('0x2a')](function(_0x2fda7f){return logger['error'](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x57'),util[_0x55c0('0x2c')](_0x2fda7f,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x55c0('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x55c0('0x2b'),_0x55c0('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x10026c=require(_0x55c0('0x5b'));if(_0x1d0d3a[_0x55c0('0x5c')]){var _0x39e2cc={};_0x39e2cc[_0x55c0('0x5d')]=_0x1d0d3a['username'];_0x39e2cc[_0x55c0('0x22')]=_0x422ecf['phone'];_0x39e2cc[_0x55c0('0x34')]=_0x1d0d3a['phone'];_0x39e2cc[_0x55c0('0x5e')]=_0x422ecf[_0x55c0('0xf')];_0x39e2cc[_0x55c0('0x5f')]=+new Date();var _0x1e398e='';var _0x434660='';var _0x28fb83=Object[_0x55c0('0x60')](_0x39e2cc);_0x28fb83[_0x55c0('0x61')]();for(var _0x38f6f2=0x0;_0x38f6f2<_0x28fb83['length'];_0x38f6f2++){if(_0x1e398e!=''){_0x1e398e+='&';}_0x1e398e+=_0x28fb83[_0x38f6f2]+'='+encodeURIComponent(_0x39e2cc[_0x28fb83[_0x38f6f2]]);_0x434660+=_0x39e2cc[_0x28fb83[_0x38f6f2]];}_0x434660+=_0x1d0d3a['apiKey'];_0x434660=_0x10026c[_0x55c0('0x62')](_0x55c0('0x63'))[_0x55c0('0x1a')](_0x434660)[_0x55c0('0x64')]('hex');if(_0x1e398e!==''){_0x1e398e+='&';}_0x1e398e+=_0x55c0('0x65')+_0x434660;var _0x17a2bf={'method':'GET','uri':_0x1d0d3a['baseUrl']+_0x55c0('0x66')+_0x1e398e,'json':!![]};return rp(_0x17a2bf)[_0x55c0('0x19')](function(_0x4b6fb0){var _0x35a0a5=Object[_0x55c0('0x60')](_0x4b6fb0);if(_0x4b6fb0[_0x35a0a5[0x0]][_0x55c0('0x2d')]&&parseInt(_0x4b6fb0[_0x35a0a5[0x0]]['error'])===0x0){var _0x363bc5={'messageId':_0x4b6fb0[_0x35a0a5[0x0]][_0x55c0('0x67')]};if(!_0x1d0d3a[_0x55c0('0x44')]){_0x363bc5[_0x55c0('0x3f')]=!![];}return _0x19fcde[_0x55c0('0x1a')](_0x363bc5);}else{return logger['error'](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x68'),util['inspect'](_0x4b6fb0['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x489919){return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x68'),util[_0x55c0('0x2c')](_0x489919,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x55c0('0x68'),_0x55c0('0x69'));}break;case _0x55c0('0x6a'):if(_0x1d0d3a[_0x55c0('0x5c')]){var _0x18b973={'method':_0x55c0('0x3a'),'uri':_0x55c0('0x6b'),'headers':{'Authorization':_0x1d0d3a['apiKey']},'body':{'content':_0x422ecf['body'],'to':[_0x422ecf[_0x55c0('0x22')]],'from':_0x1d0d3a[_0x55c0('0x22')],'binary':![],'clientMessageId':_0x55c0('0x6c'),'charset':'UTF-8'},'json':!![]};rp(_0x18b973)[_0x55c0('0x19')](function(_0x4c08c8){if(!_0x4c08c8[_0x55c0('0x2d')]){var _0x541d3e={'messageId':_0x4c08c8[_0x55c0('0x23')][0x0][_0x55c0('0x6d')]};if(!_0x1d0d3a['deliveryReport']){_0x541d3e['read']=!![];}return _0x19fcde[_0x55c0('0x1a')](_0x541d3e);}else{return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x6a'),util[_0x55c0('0x2c')](_0x4c08c8[_0x55c0('0x2d')],{'showHidden':![],'depth':null}));}})[_0x55c0('0x2a')](function(_0x187457){return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x6a'),util[_0x55c0('0x2c')](_0x187457,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),'afterCreate',_0x55c0('0x6a'),_0x55c0('0x69'));}break;case _0x55c0('0x6e'):if(_0x1d0d3a[_0x55c0('0x31')]&&_0x1d0d3a['password']){var _0x43d1dd=util[_0x55c0('0x48')]('%s:%s',_0x1d0d3a[_0x55c0('0x31')],_0x1d0d3a[_0x55c0('0x32')]);var _0x1a3fe0={'method':_0x55c0('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1d0d3a[_0x55c0('0x6f')]+_0x55c0('0x70'),'body':{'to':[_0x422ecf[_0x55c0('0x22')]],'text':_0x422ecf[_0x55c0('0xf')],'from':_0x1d0d3a[_0x55c0('0x22')],'applicationId':_0x1d0d3a[_0x55c0('0x71')]},'headers':{'Authorization':util['format'](_0x55c0('0x54'),new Buffer(_0x43d1dd)[_0x55c0('0x4b')]('base64'))},'json':!![]};rp(_0x1a3fe0)[_0x55c0('0x19')](function(_0x2a53a2){if(_0x2a53a2['id']){var _0x3fcaad={'messageId':_0x2a53a2['id']};return _0x19fcde[_0x55c0('0x1a')](_0x3fcaad);}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x6e'),util[_0x55c0('0x2c')](_0x2a53a2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x50330b){logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x6e'),util['inspect'](_0x50330b,{'showHidden':![],'depth':null}));});}else{logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x6e'),_0x55c0('0x40'));}break;case _0x55c0('0x72'):if(_0x1d0d3a[_0x55c0('0x5c')]){var _0x3a21ea={};var _0x17a2bf={'method':_0x55c0('0x3a'),'uri':_0x55c0('0x73'),'headers':{'Authorization':_0x55c0('0x74')+_0x1d0d3a[_0x55c0('0x5c')],'Content-Type':_0x55c0('0x75')},'body':{'from':_0x1d0d3a[_0x55c0('0x22')],'to':_0x422ecf[_0x55c0('0x22')],'text':_0x422ecf[_0x55c0('0xf')]},'json':!![]};return rp(_0x17a2bf)[_0x55c0('0x19')](function(_0x33ad41){if(_0x33ad41['code']==0xca){_0x3a21ea[_0x55c0('0x76')]=_0x33ad41;var _0x4f60b0={'method':'POST','uri':_0x55c0('0x77'),'headers':{'Authorization':'Bearer\x20'+_0x1d0d3a[_0x55c0('0x5c')],'Content-Type':'application/json'},'body':{'refid':_0x3a21ea['message']['refid']},'json':!![]};return rp(_0x4f60b0)[_0x55c0('0x19')](function(_0x439524){_0x3a21ea['status']=_0x439524;var _0x47d065={'messageId':_0x3a21ea[_0x55c0('0x76')][_0x55c0('0x78')],'read':!![]};return _0x19fcde['update'](_0x47d065);});}else{return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x72'),util[_0x55c0('0x2c')](_0x33ad41,{'showHidden':![],'depth':null}));}})[_0x55c0('0x2a')](function(_0x5a8e93){return logger['error'](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x72'),util[_0x55c0('0x2c')](_0x5a8e93,{'showHidden':![],'depth':null}));});}else{return logger[_0x55c0('0x2d')](_0x55c0('0x2e'),_0x55c0('0x2b'),_0x55c0('0x72'),_0x55c0('0x79'));}break;}}})['finally'](function(){_0x404a48();});}else{_0x404a48();}}},'charset':_0x55c0('0x7a'),'collate':_0x55c0('0x7b')});}; \ No newline at end of file +var _0x3a2d=['token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','http_code','data','head','message_id','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','application/json','IBSSO\x20','csc','crypto','apiKey','login','timestamp','sort','length','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','accountId','/messages','applicationId','Missing\x20parameters:\x20username,\x20password','Bearer\x20','status','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','body','/status?token='];(function(_0x51d771,_0x4c0562){var _0x559f12=function(_0x52cf40){while(--_0x52cf40){_0x51d771['push'](_0x51d771['shift']());}};_0x559f12(++_0x4c0562);}(_0x3a2d,0x1c4));var _0xd3a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3a2('0x0'));var logger=require(_0xd3a2('0x1'))(_0xd3a2('0x2'));var moment=require(_0xd3a2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd3a2('0x4'));var config=require(_0xd3a2('0x5'));var attributes=require(_0xd3a2('0x6'));module['exports']=function(_0x21b9c8,_0x2d1126){return _0x21b9c8[_0xd3a2('0x7')](_0xd3a2('0x8'),attributes,{'tableName':_0xd3a2('0x9'),'paranoid':![],'indexes':[{'name':_0xd3a2('0xa'),'fields':[_0xd3a2('0xa')]},{'name':_0xd3a2('0xb'),'fields':['body'],'type':_0xd3a2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d7cb9,_0x58c805,_0x5d4521){var _0x37b81a=_0x21b9c8[_0xd3a2('0xd')];var _0x1db72b=_0x5d7cb9[_0xd3a2('0xe')]({'plain':!![]});if(_0x1db72b['direction'][_0xd3a2('0xf')]()==='in'||_0x1db72b[_0xd3a2('0x10')][_0xd3a2('0xf')]()===_0xd3a2('0x11')&&!_0x1db72b[_0xd3a2('0x12')]&&!_[_0xd3a2('0x13')](_0x1db72b[_0xd3a2('0x14')])&&!_[_0xd3a2('0x13')](_0x1db72b['SmsInteractionId'])){_0x37b81a[_0xd3a2('0x15')][_0xd3a2('0x16')]({'where':{'id':_0x1db72b[_0xd3a2('0x17')]}})[_0xd3a2('0x18')](function(_0x2cf4ca){if(_0x2cf4ca){_0x2cf4ca[_0xd3a2('0x19')]({'lastMsgAt':_0x1db72b[_0xd3a2('0x1a')],'lastMsgDirection':_0x1db72b[_0xd3a2('0x10')][_0xd3a2('0xf')]()});}})[_0xd3a2('0x1b')](function(_0xeac327){console['error'](_0xeac327);});}if(_0x1db72b[_0xd3a2('0x10')]===_0xd3a2('0x11')&&!_0x1db72b['secret']){var _0x2d252d;_0x37b81a[_0xd3a2('0x1c')][_0xd3a2('0x1d')]({'where':{'id':_0x1db72b[_0xd3a2('0x1e')]},'raw':!![]})[_0xd3a2('0x18')](function(_0x13a8fc){_0x2d252d=_0x13a8fc;if(_0x2d252d&&_0x2d252d[_0xd3a2('0x1f')]){switch(_0x2d252d[_0xd3a2('0x1f')]){case _0xd3a2('0x20'):var _0x2fa146=require('twilio');if(_0x2d252d['accountSid']&&_0x2d252d[_0xd3a2('0x21')]&&_0x2d252d[_0xd3a2('0x22')]){var _0x59b21c=new _0x2fa146(_0x2d252d[_0xd3a2('0x23')],_0x2d252d[_0xd3a2('0x21')]);_0x59b21c[_0xd3a2('0x24')][_0xd3a2('0x25')]({'body':_0x1db72b[_0xd3a2('0x26')],'to':_0x1db72b[_0xd3a2('0x22')],'from':_0x2d252d[_0xd3a2('0x22')],'statusCallback':_0x2d252d['remote']+'/api/sms/messages/'+_0x1db72b['id']+_0xd3a2('0x27')+_0x2d252d[_0xd3a2('0x28')]})[_0xd3a2('0x18')](function(_0x567963){if(_0x567963['sid']){return _0x5d7cb9[_0xd3a2('0x19')]({'messageId':_0x567963[_0xd3a2('0x29')]});}})[_0xd3a2('0x1b')](function(_0x564abf){logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x20'),util[_0xd3a2('0x2d')](_0x564abf,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a2('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a2('0x2c'),_0xd3a2('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xd3a2('0x2e'):var _0x450b4c=_0xd3a2('0x2f');if(_0x2d252d[_0xd3a2('0x30')]&&_0x2d252d[_0xd3a2('0x31')]){var _0xa7e40c={'recipient':[_0x1db72b[_0xd3a2('0x22')]],'message':_0x1db72b['body'],'message_type':_0x2d252d[_0xd3a2('0x32')]};if(_0x2d252d[_0xd3a2('0x32')]&&_0x2d252d[_0xd3a2('0x32')]!=='SI'){_0xa7e40c[_0xd3a2('0x33')]=_0x2d252d[_0xd3a2('0x22')];}var _0x37fe82={'url':_0x450b4c+_0xd3a2('0x34')+_0x2d252d['username']+_0xd3a2('0x35')+_0x2d252d[_0xd3a2('0x31')],'method':_0xd3a2('0x36')};rp(_0x37fe82)[_0xd3a2('0x18')](function(_0x3049a2){var _0x2cce47=_0x3049a2['split'](';');var _0x35bcfb={'user_key':_0x2cce47[0x0],'session_key':_0x2cce47[0x1]};_0x37fe82={'url':_0x450b4c+_0xd3a2('0x37'),'method':_0xd3a2('0x38'),'headers':{'user_key':_0x35bcfb[_0xd3a2('0x39')],'Session_key':_0x35bcfb['session_key']},'json':!![],'body':_0xa7e40c};return rp(_0x37fe82);})[_0xd3a2('0x18')](function(_0x3d4095){if(_0x3d4095[_0xd3a2('0x3a')]>=0x1){var _0x298b36={'messageId':_0x3d4095[_0xd3a2('0x3b')]};if(_0x2d252d[_0xd3a2('0x32')]!=='GP'||!_0x2d252d[_0xd3a2('0x3c')]){_0x298b36[_0xd3a2('0x3d')]=!![];}return _0x5d7cb9[_0xd3a2('0x19')](_0x298b36);}else{return logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x2e'),util[_0xd3a2('0x2d')](_0x3d4095,{'showHidden':![],'depth':null}));}})[_0xd3a2('0x1b')](function(_0x1b013a){return logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x2e'),util[_0xd3a2('0x2d')](_0x1b013a,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd3a2('0x3e'):if(_0x2d252d[_0xd3a2('0x21')]){var _0x19cd54={'recipient':_0x1db72b[_0xd3a2('0x22')],'message':_0x1db72b[_0xd3a2('0x26')],'sender':_0x2d252d[_0xd3a2('0x3f')]||_0x2d252d['phone'],'authorization':_0x2d252d[_0xd3a2('0x21')]};var _0x58c805={'method':_0xd3a2('0x38'),'uri':_0xd3a2('0x40'),'body':_0x19cd54,'json':!![]};rp(_0x58c805)[_0xd3a2('0x18')](function(_0x560258){var _0x1077d1={'messageId':_0x560258[_0xd3a2('0x41')]};if(!_0x2d252d[_0xd3a2('0x3c')]){_0x1077d1['read']=!![];}return _0x5d7cb9['update'](_0x1077d1);})[_0xd3a2('0x1b')](function(_0x575b81){logger[_0xd3a2('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a2('0x2c'),'connectel',util['inspect'](_0x575b81,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0xd3a2('0x42'));}break;case _0xd3a2('0x43'):if(_0x2d252d[_0xd3a2('0x30')]&&_0x2d252d[_0xd3a2('0x31')]){var _0x19cd54={'messages':[{'source':_0xd3a2('0x44'),'to':_0x1db72b[_0xd3a2('0x22')],'body':_0x1db72b[_0xd3a2('0x26')],'from':_0x2d252d['senderString']||_0x2d252d['phone']}]};var _0x298e22=util[_0xd3a2('0x45')](_0xd3a2('0x46'),_0x2d252d[_0xd3a2('0x30')],_0x2d252d[_0xd3a2('0x31')]);var _0x58c805={'method':_0xd3a2('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x19cd54,'headers':{'Authorization':util[_0xd3a2('0x45')](_0xd3a2('0x47'),new Buffer(_0x298e22)[_0xd3a2('0x48')]('base64'))},'json':!![]};rp(_0x58c805)[_0xd3a2('0x18')](function(_0x983eb5){if(_0x983eb5[_0xd3a2('0x49')]>=0xc8&&_0x983eb5[_0xd3a2('0x49')]<=0xce){if(_0x983eb5[_0xd3a2('0x4a')]&&_0x983eb5[_0xd3a2('0x4a')]['queued_count']>0x0){var _0x310185=_[_0xd3a2('0x4b')](_0x983eb5[_0xd3a2('0x4a')][_0xd3a2('0x24')]);var _0x10d399={'messageId':_0x310185[_0xd3a2('0x4c')]};if(!_0x2d252d['deliveryReport']){_0x10d399[_0xd3a2('0x3d')]=!![];}return _0x5d7cb9[_0xd3a2('0x19')](_0x10d399);}else{logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x4d'),util[_0xd3a2('0x2d')](_0x983eb5,{'showHidden':![],'depth':null}));}}else{logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),'afterCreate','clickSend',util[_0xd3a2('0x2d')](_0x983eb5,{'showHidden':![],'depth':null}));}})[_0xd3a2('0x1b')](function(_0xa0ef57){logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x4d'),util[_0xd3a2('0x2d')](_0xa0ef57,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a2('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd3a2('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x2d252d[_0xd3a2('0x4e')]&&_0x2d252d[_0xd3a2('0x21')]){var _0x19cd54={'dst':_0x1db72b[_0xd3a2('0x22')],'text':_0x1db72b[_0xd3a2('0x26')],'src':_0x2d252d[_0xd3a2('0x3f')]||_0x2d252d[_0xd3a2('0x22')],'url':_0x2d252d[_0xd3a2('0x4f')]+'/api/sms/messages/'+_0x1db72b['id']+_0xd3a2('0x27')+_0x2d252d[_0xd3a2('0x28')]};var _0x298e22=util[_0xd3a2('0x45')](_0xd3a2('0x46'),_0x2d252d[_0xd3a2('0x4e')],_0x2d252d['authToken']);var _0x58c805={'method':_0xd3a2('0x38'),'uri':util[_0xd3a2('0x45')](_0xd3a2('0x50'),_0x2d252d[_0xd3a2('0x4e')]),'body':_0x19cd54,'headers':{'Authorization':util[_0xd3a2('0x45')]('Basic\x20%s',new Buffer(_0x298e22)[_0xd3a2('0x48')]('base64'))},'json':!![]};rp(_0x58c805)[_0xd3a2('0x18')](function(_0x4cd231){var _0x4091ce={'messageId':_0x4cd231[_0xd3a2('0x51')][0x0]};return _0x5d7cb9['update'](_0x4091ce);})[_0xd3a2('0x1b')](function(_0x117a1b){logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),'plivo',util[_0xd3a2('0x2d')](_0x117a1b,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),'plivo',_0xd3a2('0x52'));}break;case _0xd3a2('0x53'):if(_0x2d252d[_0xd3a2('0x30')]&&_0x2d252d[_0xd3a2('0x31')]){if(_0x2d252d[_0xd3a2('0x54')]){var _0x2d548d={'method':_0xd3a2('0x38'),'uri':_0x2d252d['baseUrl']+_0xd3a2('0x55'),'body':{'username':_0x2d252d['username'],'password':_0x2d252d[_0xd3a2('0x31')]},'json':!![]};return rp(_0x2d548d)[_0xd3a2('0x18')](function(_0x17babf){var _0x5076a3={'method':_0xd3a2('0x38'),'uri':_0x2d252d['baseUrl']+_0xd3a2('0x56'),'body':{'messages':[{'from':_0x2d252d[_0xd3a2('0x22')],'destinations':[{'to':_0x1db72b[_0xd3a2('0x22')]}],'text':_0x1db72b['body'],'notifyUrl':_0x2d252d['remote']+_0xd3a2('0x57')+_0x1db72b['id']+_0xd3a2('0x27')+_0x2d252d[_0xd3a2('0x28')],'notifyContentType':_0xd3a2('0x58'),'callbackData':_0x2d252d[_0xd3a2('0x22')]+';'+_0x1db72b[_0xd3a2('0x26')]}]},'headers':{'Authorization':_0xd3a2('0x59')+_0x17babf['token']},'json':!![]};return rp(_0x5076a3)['then'](function(_0x38293d){if(_0x38293d[_0xd3a2('0x24')]){var _0x37e376={'messageId':_0x38293d[_0xd3a2('0x24')][0x0][_0xd3a2('0xa')]};if(!_0x2d252d[_0xd3a2('0x3c')]){_0x37e376[_0xd3a2('0x3d')]=!![];}return _0x5d7cb9[_0xd3a2('0x19')](_0x37e376);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a2('0x2c'),_0xd3a2('0x53'),util['inspect'](_0x38293d,{'showHidden':![],'depth':null}));}});})[_0xd3a2('0x1b')](function(_0x38b12f){return logger[_0xd3a2('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a2('0x2c'),_0xd3a2('0x53'),util[_0xd3a2('0x2d')](_0x38b12f,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd3a2('0x5a'):var _0x224196=require(_0xd3a2('0x5b'));if(_0x2d252d[_0xd3a2('0x5c')]){var _0x2b2e1d={};_0x2b2e1d[_0xd3a2('0x5d')]=_0x2d252d[_0xd3a2('0x30')];_0x2b2e1d[_0xd3a2('0x22')]=_0x1db72b[_0xd3a2('0x22')];_0x2b2e1d[_0xd3a2('0x33')]=_0x2d252d['phone'];_0x2b2e1d['text']=_0x1db72b[_0xd3a2('0x26')];_0x2b2e1d[_0xd3a2('0x5e')]=+new Date();var _0x889e9c='';var _0x9e8849='';var _0x2f8dcf=Object['keys'](_0x2b2e1d);_0x2f8dcf[_0xd3a2('0x5f')]();for(var _0xf58a07=0x0;_0xf58a07<_0x2f8dcf[_0xd3a2('0x60')];_0xf58a07++){if(_0x889e9c!=''){_0x889e9c+='&';}_0x889e9c+=_0x2f8dcf[_0xf58a07]+'='+encodeURIComponent(_0x2b2e1d[_0x2f8dcf[_0xf58a07]]);_0x9e8849+=_0x2b2e1d[_0x2f8dcf[_0xf58a07]];}_0x9e8849+=_0x2d252d['apiKey'];_0x9e8849=_0x224196['createHash'](_0xd3a2('0x61'))['update'](_0x9e8849)[_0xd3a2('0x62')](_0xd3a2('0x63'));if(_0x889e9c!==''){_0x889e9c+='&';}_0x889e9c+=_0xd3a2('0x64')+_0x9e8849;var _0x37fe82={'method':_0xd3a2('0x36'),'uri':_0x2d252d[_0xd3a2('0x54')]+_0xd3a2('0x65')+_0x889e9c,'json':!![]};return rp(_0x37fe82)['then'](function(_0x1741a6){var _0x5679c9=Object[_0xd3a2('0x66')](_0x1741a6);if(_0x1741a6[_0x5679c9[0x0]][_0xd3a2('0x2a')]&&parseInt(_0x1741a6[_0x5679c9[0x0]][_0xd3a2('0x2a')])===0x0){var _0x22adcf={'messageId':_0x1741a6[_0x5679c9[0x0]][_0xd3a2('0x67')]};if(!_0x2d252d[_0xd3a2('0x3c')]){_0x22adcf['read']=!![];}return _0x5d7cb9[_0xd3a2('0x19')](_0x22adcf);}else{return logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),'csc',util[_0xd3a2('0x2d')](_0x1741a6[_0xd3a2('0x2a')],{'showHidden':![],'depth':null}));}})[_0xd3a2('0x1b')](function(_0x1120bc){return logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x5a'),util[_0xd3a2('0x2d')](_0x1120bc,{'showHidden':![],'depth':null}));});}else{logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),'afterCreate',_0xd3a2('0x5a'),_0xd3a2('0x68'));}break;case _0xd3a2('0x69'):if(_0x2d252d[_0xd3a2('0x5c')]){var _0x30164e={'method':_0xd3a2('0x38'),'uri':_0xd3a2('0x6a'),'headers':{'Authorization':_0x2d252d[_0xd3a2('0x5c')]},'body':{'content':_0x1db72b[_0xd3a2('0x26')],'to':[_0x1db72b[_0xd3a2('0x22')]],'from':_0x2d252d['phone'],'binary':![],'clientMessageId':_0xd3a2('0x6b'),'charset':_0xd3a2('0x6c')},'json':!![]};rp(_0x30164e)[_0xd3a2('0x18')](function(_0x12d7c8){if(!_0x12d7c8['error']){var _0x21c6ed={'messageId':_0x12d7c8[_0xd3a2('0x24')][0x0][_0xd3a2('0x6d')]};if(!_0x2d252d[_0xd3a2('0x3c')]){_0x21c6ed[_0xd3a2('0x3d')]=!![];}return _0x5d7cb9[_0xd3a2('0x19')](_0x21c6ed);}else{return logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),'afterCreate','clickatell',util[_0xd3a2('0x2d')](_0x12d7c8[_0xd3a2('0x2a')],{'showHidden':![],'depth':null}));}})[_0xd3a2('0x1b')](function(_0xb94c84){return logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x69'),util['inspect'](_0xb94c84,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd3a2('0x2b'),'afterCreate',_0xd3a2('0x69'),_0xd3a2('0x68'));}break;case _0xd3a2('0x6e'):if(_0x2d252d[_0xd3a2('0x30')]&&_0x2d252d[_0xd3a2('0x31')]){var _0x298e22=util[_0xd3a2('0x45')](_0xd3a2('0x46'),_0x2d252d[_0xd3a2('0x30')],_0x2d252d['password']);var _0x58c805={'method':_0xd3a2('0x38'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x2d252d[_0xd3a2('0x6f')]+_0xd3a2('0x70'),'body':{'to':[_0x1db72b[_0xd3a2('0x22')]],'text':_0x1db72b[_0xd3a2('0x26')],'from':_0x2d252d[_0xd3a2('0x22')],'applicationId':_0x2d252d[_0xd3a2('0x71')]},'headers':{'Authorization':util[_0xd3a2('0x45')](_0xd3a2('0x47'),new Buffer(_0x298e22)[_0xd3a2('0x48')]('base64'))},'json':!![]};rp(_0x58c805)['then'](function(_0x14cdf5){if(_0x14cdf5['id']){var _0x3ccbb1={'messageId':_0x14cdf5['id']};return _0x5d7cb9['update'](_0x3ccbb1);}else{logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x6e'),util['inspect'](_0x14cdf5,{'showHidden':![],'depth':null}));}})[_0xd3a2('0x1b')](function(_0x1b3149){logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x6e'),util[_0xd3a2('0x2d')](_0x1b3149,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3a2('0x2c'),_0xd3a2('0x6e'),_0xd3a2('0x72'));}break;case'intelepeer':if(_0x2d252d[_0xd3a2('0x5c')]){var _0x4a917d={};var _0x37fe82={'method':_0xd3a2('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xd3a2('0x73')+_0x2d252d['apiKey'],'Content-Type':_0xd3a2('0x58')},'body':{'from':_0x2d252d['phone'],'to':_0x1db72b[_0xd3a2('0x22')],'text':_0x1db72b[_0xd3a2('0x26')]},'json':!![]};return rp(_0x37fe82)[_0xd3a2('0x18')](function(_0x28fc3d){if(_0x28fc3d['code']==0xca){_0x4a917d['message']=_0x28fc3d;var _0x5723d9={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xd3a2('0x73')+_0x2d252d['apiKey'],'Content-Type':_0xd3a2('0x58')},'body':{'refid':_0x4a917d['message']['refid']},'json':!![]};return rp(_0x5723d9)[_0xd3a2('0x18')](function(_0x10c73d){_0x4a917d[_0xd3a2('0x74')]=_0x10c73d;var _0x38a917={'messageId':_0x4a917d['message'][_0xd3a2('0x75')],'read':!![]};return _0x5d7cb9[_0xd3a2('0x19')](_0x38a917);});}else{return logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x76'),util[_0xd3a2('0x2d')](_0x28fc3d,{'showHidden':![],'depth':null}));}})[_0xd3a2('0x1b')](function(_0x2c7808){return logger[_0xd3a2('0x2a')](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x76'),util[_0xd3a2('0x2d')](_0x2c7808,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd3a2('0x2b'),_0xd3a2('0x2c'),_0xd3a2('0x76'),_0xd3a2('0x77'));}break;}}})[_0xd3a2('0x78')](function(){_0x5d4521();});}else{_0x5d4521();}}},'charset':_0xd3a2('0x79'),'collate':_0xd3a2('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 35dcd43..ef976ed 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 _0x67fc=['error','message','SmsMessage,\x20%s,\x20%s','info','CreateSmsMessage','SmsMessage','body','raw','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','request\x20sent','debug','stringify'];(function(_0x15a3ab,_0x3e1529){var _0x12ee22=function(_0x587d95){while(--_0x587d95){_0x15a3ab['push'](_0x15a3ab['shift']());}};_0x12ee22(++_0x3e1529);}(_0x67fc,0x1db));var _0xc67f=function(_0x3a508a,_0x358c16){_0x3a508a=_0x3a508a-0x0;var _0x5a8c34=_0x67fc[_0x3a508a];return _0x5a8c34;};'use strict';var _=require(_0xc67f('0x0'));var util=require(_0xc67f('0x1'));var moment=require('moment');var BPromise=require(_0xc67f('0x2'));var rs=require(_0xc67f('0x3'));var fs=require('fs');var Redis=require(_0xc67f('0x4'));var db=require(_0xc67f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc67f('0x6'))(_0xc67f('0x7'));var config=require(_0xc67f('0x8'));var jayson=require(_0xc67f('0x9'));var client=jayson[_0xc67f('0xa')][_0xc67f('0xb')]({'port':0x232a});config[_0xc67f('0xc')]=_[_0xc67f('0xd')](config['redis'],{'host':_0xc67f('0xe'),'port':0x18eb});var socket=require(_0xc67f('0xf'))(new Redis(config[_0xc67f('0xc')]));require('./smsMessage.socket')[_0xc67f('0x10')](socket);function respondWithRpcPromise(_0x446bdc,_0xe86b17,_0x4a7ea3){return new BPromise(function(_0x5cfb1f,_0x5e565a){return client[_0xc67f('0x11')](_0x446bdc,_0x4a7ea3)['then'](function(_0x4e7193){logger['info']('SmsMessage,\x20%s,\x20%s',_0xe86b17,_0xc67f('0x12'));logger[_0xc67f('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe86b17,'request\x20sent',JSON[_0xc67f('0x14')](_0x4e7193));if(_0x4e7193['error']){if(_0x4e7193['error']['code']===0x1f4){logger[_0xc67f('0x15')]('SmsMessage,\x20%s,\x20%s',_0xe86b17,_0x4e7193[_0xc67f('0x15')][_0xc67f('0x16')]);return _0x5e565a(_0x4e7193[_0xc67f('0x15')][_0xc67f('0x16')]);}logger[_0xc67f('0x15')](_0xc67f('0x17'),_0xe86b17,_0x4e7193[_0xc67f('0x15')][_0xc67f('0x16')]);return _0x5cfb1f(_0x4e7193[_0xc67f('0x15')][_0xc67f('0x16')]);}else{logger[_0xc67f('0x18')](_0xc67f('0x17'),_0xe86b17,_0xc67f('0x12'));_0x5cfb1f(_0x4e7193['result'][_0xc67f('0x16')]);}})['catch'](function(_0xba659f){logger[_0xc67f('0x15')]('SmsMessage,\x20%s,\x20%s',_0xe86b17,_0xba659f);_0x5e565a(_0xba659f);});});}exports[_0xc67f('0x19')]=function(_0x5c4795){var _0x4bdd51=this;return new Promise(function(_0x74c654,_0x2b6e24){return db[_0xc67f('0x1a')]['create'](_0x5c4795[_0xc67f('0x1b')],{'raw':_0x5c4795['options']?_0x5c4795['options'][_0xc67f('0x1c')]===undefined?!![]:![]:!![]})[_0xc67f('0x1d')](function(_0x51b4b7){logger[_0xc67f('0x18')](_0xc67f('0x19'),_0x5c4795);logger['debug'](_0xc67f('0x19'),_0x5c4795,JSON[_0xc67f('0x14')](_0x51b4b7));_0x74c654(_0x51b4b7);})[_0xc67f('0x1e')](function(_0x4f88bd){logger[_0xc67f('0x15')](_0xc67f('0x19'),_0x4f88bd[_0xc67f('0x16')],_0x5c4795);_0x2b6e24(_0x4bdd51['error'](0x1f4,_0x4f88bd[_0xc67f('0x16')]));});});}; \ No newline at end of file +var _0x06b0=['options','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','create'];(function(_0xdfff8f,_0x5e6f27){var _0x46cb10=function(_0x91cc6e){while(--_0x91cc6e){_0xdfff8f['push'](_0xdfff8f['shift']());}};_0x46cb10(++_0x5e6f27);}(_0x06b0,0xa3));var _0x006b=function(_0x2dc551,_0x40f04c){_0x2dc551=_0x2dc551-0x0;var _0x45b129=_0x06b0[_0x2dc551];return _0x45b129;};'use strict';var _=require(_0x006b('0x0'));var util=require(_0x006b('0x1'));var moment=require(_0x006b('0x2'));var BPromise=require(_0x006b('0x3'));var rs=require(_0x006b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x006b('0x5'))['db'];var utils=require(_0x006b('0x6'));var logger=require(_0x006b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x006b('0x8'));var client=jayson[_0x006b('0x9')][_0x006b('0xa')]({'port':0x232a});config[_0x006b('0xb')]=_[_0x006b('0xc')](config[_0x006b('0xb')],{'host':_0x006b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x006b('0xb')]));require(_0x006b('0xe'))[_0x006b('0xf')](socket);function respondWithRpcPromise(_0xc1e45b,_0x25ceff,_0x425414){return new BPromise(function(_0x2b6c6c,_0x380f3a){return client['request'](_0xc1e45b,_0x425414)[_0x006b('0x10')](function(_0x1df8f6){logger[_0x006b('0x11')]('SmsMessage,\x20%s,\x20%s',_0x25ceff,'request\x20sent');logger['debug'](_0x006b('0x12'),_0x25ceff,_0x006b('0x13'),JSON[_0x006b('0x14')](_0x1df8f6));if(_0x1df8f6[_0x006b('0x15')]){if(_0x1df8f6[_0x006b('0x15')][_0x006b('0x16')]===0x1f4){logger[_0x006b('0x15')](_0x006b('0x17'),_0x25ceff,_0x1df8f6[_0x006b('0x15')]['message']);return _0x380f3a(_0x1df8f6[_0x006b('0x15')]['message']);}logger['error'](_0x006b('0x17'),_0x25ceff,_0x1df8f6[_0x006b('0x15')][_0x006b('0x18')]);return _0x2b6c6c(_0x1df8f6[_0x006b('0x15')][_0x006b('0x18')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x25ceff,'request\x20sent');_0x2b6c6c(_0x1df8f6[_0x006b('0x19')]['message']);}})[_0x006b('0x1a')](function(_0x5cfbe9){logger[_0x006b('0x15')](_0x006b('0x17'),_0x25ceff,_0x5cfbe9);_0x380f3a(_0x5cfbe9);});});}exports[_0x006b('0x1b')]=function(_0x4c28b0){var _0x4ba572=this;return new Promise(function(_0x39ac48,_0x438368){return db['SmsMessage'][_0x006b('0x1c')](_0x4c28b0['body'],{'raw':_0x4c28b0[_0x006b('0x1d')]?_0x4c28b0[_0x006b('0x1d')][_0x006b('0x1e')]===undefined?!![]:![]:!![]})[_0x006b('0x10')](function(_0x1bf45b){logger['info'](_0x006b('0x1b'),_0x4c28b0);logger[_0x006b('0x1f')](_0x006b('0x1b'),_0x4c28b0,JSON[_0x006b('0x14')](_0x1bf45b));_0x39ac48(_0x1bf45b);})[_0x006b('0x1a')](function(_0x4ffb7c){logger[_0x006b('0x15')]('CreateSmsMessage',_0x4ffb7c[_0x006b('0x18')],_0x4c28b0);_0x438368(_0x4ba572[_0x006b('0x15')](0x1f4,_0x4ffb7c[_0x006b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 0ffbe6e..9700baf 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 _0x6820=['save','remove','update','emit','register','./smsMessage.events'];(function(_0x3de0d9,_0x2ccb8f){var _0x161cd9=function(_0x8e23e7){while(--_0x8e23e7){_0x3de0d9['push'](_0x3de0d9['shift']());}};_0x161cd9(++_0x2ccb8f);}(_0x6820,0xbf));var _0x0682=function(_0x708d9a,_0x98b24a){_0x708d9a=_0x708d9a-0x0;var _0x150b58=_0x6820[_0x708d9a];return _0x150b58;};'use strict';var SmsMessageEvents=require(_0x0682('0x0'));var events=[_0x0682('0x1'),_0x0682('0x2'),_0x0682('0x3')];function createListener(_0x3f5549,_0x19e68a){return function(_0x33e32e){_0x19e68a[_0x0682('0x4')](_0x3f5549,_0x33e32e);};}function removeListener(_0x4ebec4,_0x3de955){return function(){SmsMessageEvents['removeListener'](_0x4ebec4,_0x3de955);};}exports[_0x0682('0x5')]=function(_0x388e58){for(var _0x54e3e3=0x0,_0x515697=events['length'];_0x54e3e3<_0x515697;_0x54e3e3++){var _0x23384d=events[_0x54e3e3];var _0x4a85db=createListener('smsMessage:'+_0x23384d,_0x388e58);SmsMessageEvents['on'](_0x23384d,_0x4a85db);}}; \ No newline at end of file +var _0x8c37=['removeListener','length','smsMessage:','remove','emit'];(function(_0x371cff,_0x538c92){var _0x2d9b7a=function(_0x154807){while(--_0x154807){_0x371cff['push'](_0x371cff['shift']());}};_0x2d9b7a(++_0x538c92);}(_0x8c37,0xe4));var _0x78c3=function(_0xb4e0c2,_0x17334c){_0xb4e0c2=_0xb4e0c2-0x0;var _0x36893b=_0x8c37[_0xb4e0c2];return _0x36893b;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x78c3('0x0'),'update'];function createListener(_0x8e8d81,_0x5daa2b){return function(_0x599d04){_0x5daa2b[_0x78c3('0x1')](_0x8e8d81,_0x599d04);};}function removeListener(_0x5b720a,_0x2a90ab){return function(){SmsMessageEvents[_0x78c3('0x2')](_0x5b720a,_0x2a90ab);};}exports['register']=function(_0x16fefe){for(var _0x1c4444=0x0,_0x4ae56f=events[_0x78c3('0x3')];_0x1c4444<_0x4ae56f;_0x1c4444++){var _0x2ed7f6=events[_0x1c4444];var _0x34596c=createListener(_0x78c3('0x4')+_0x2ed7f6,_0x16fefe);SmsMessageEvents['on'](_0x2ed7f6,_0x34596c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 31fe341..1acd334 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 _0x15c3=['/:id','show','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','destroy','delete','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x135aa6,_0x486b4e){var _0x57541d=function(_0x3156a9){while(--_0x3156a9){_0x135aa6['push'](_0x135aa6['shift']());}};_0x57541d(++_0x486b4e);}(_0x15c3,0x188));var _0x315c=function(_0x47d6e7,_0x356b24){_0x47d6e7=_0x47d6e7-0x0;var _0x5d53fb=_0x15c3[_0x47d6e7];return _0x5d53fb;};'use strict';var multer=require(_0x315c('0x0'));var util=require(_0x315c('0x1'));var path=require('path');var timeout=require(_0x315c('0x2'));var express=require(_0x315c('0x3'));var router=express[_0x315c('0x4')]();var fs_extra=require(_0x315c('0x5'));var auth=require(_0x315c('0x6'));var interaction=require(_0x315c('0x7'));var config=require('../../config/environment');var controller=require(_0x315c('0x8'));router[_0x315c('0x9')]('/',auth[_0x315c('0xa')](),controller[_0x315c('0xb')]);router[_0x315c('0x9')](_0x315c('0xc'),auth[_0x315c('0xa')](),controller[_0x315c('0xd')]);router['get'](_0x315c('0xe'),auth[_0x315c('0xa')](),controller[_0x315c('0xf')]);router[_0x315c('0x9')]('/:id/members',auth[_0x315c('0xa')](),controller[_0x315c('0x10')]);router[_0x315c('0x9')](_0x315c('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0x315c('0x9')](_0x315c('0x12'),auth[_0x315c('0xa')](),controller[_0x315c('0x13')]);router[_0x315c('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x315c('0x14')]('/:id/teams',auth[_0x315c('0xa')](),controller[_0x315c('0x15')]);router[_0x315c('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x315c('0x16')]);router[_0x315c('0x17')](_0x315c('0xe'),auth[_0x315c('0xa')](),controller[_0x315c('0x18')]);router['delete']('/:id',auth[_0x315c('0xa')](),controller[_0x315c('0x19')]);router[_0x315c('0x1a')](_0x315c('0x11'),auth[_0x315c('0xa')](),controller[_0x315c('0x1b')]);router['delete']('/:id/users',auth[_0x315c('0xa')](),controller['removeAgents']);module[_0x315c('0x1c')]=router; \ No newline at end of file +var _0xf861=['../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','delete','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf861,0x198));var _0x1f86=function(_0x294a60,_0x5636a1){_0x294a60=_0x294a60-0x0;var _0x3d7a2c=_0xf861[_0x294a60];return _0x3d7a2c;};'use strict';var multer=require(_0x1f86('0x0'));var util=require(_0x1f86('0x1'));var path=require('path');var timeout=require(_0x1f86('0x2'));var express=require(_0x1f86('0x3'));var router=express[_0x1f86('0x4')]();var fs_extra=require(_0x1f86('0x5'));var auth=require(_0x1f86('0x6'));var interaction=require(_0x1f86('0x7'));var config=require(_0x1f86('0x8'));var controller=require('./smsQueue.controller');router[_0x1f86('0x9')]('/',auth[_0x1f86('0xa')](),controller['index']);router[_0x1f86('0x9')](_0x1f86('0xb'),auth[_0x1f86('0xa')](),controller[_0x1f86('0xc')]);router[_0x1f86('0x9')]('/:id',auth[_0x1f86('0xa')](),controller[_0x1f86('0xd')]);router['get'](_0x1f86('0xe'),auth[_0x1f86('0xa')](),controller[_0x1f86('0xf')]);router[_0x1f86('0x9')](_0x1f86('0x10'),auth[_0x1f86('0xa')](),controller[_0x1f86('0x11')]);router[_0x1f86('0x9')](_0x1f86('0x12'),auth[_0x1f86('0xa')](),controller['getAgents']);router[_0x1f86('0x13')]('/',auth[_0x1f86('0xa')](),controller[_0x1f86('0x14')]);router[_0x1f86('0x13')]('/:id/teams',auth[_0x1f86('0xa')](),controller[_0x1f86('0x15')]);router['post']('/:id/users',auth[_0x1f86('0xa')](),controller['addAgents']);router[_0x1f86('0x16')]('/:id',auth[_0x1f86('0xa')](),controller['update']);router[_0x1f86('0x17')]('/:id',auth[_0x1f86('0xa')](),controller['destroy']);router[_0x1f86('0x17')](_0x1f86('0x10'),auth[_0x1f86('0xa')](),controller[_0x1f86('0x18')]);router[_0x1f86('0x17')]('/:id/users',auth[_0x1f86('0xa')](),controller[_0x1f86('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 9b9de5b..a0d4d57 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 _0x2a82=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x2a82,0x124));var _0x22a8=function(_0x1d24e0,_0x3bba26){_0x1d24e0=_0x1d24e0-0x0;var _0x138d58=_0x2a82[_0x1d24e0];return _0x138d58;};'use strict';var Sequelize=require(_0x22a8('0x0'));module[_0x22a8('0x1')]={'name':{'type':Sequelize[_0x22a8('0x2')],'unique':_0x22a8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x22a8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x22a8('0x5')](_0x22a8('0x6'),_0x22a8('0x7'),_0x22a8('0x8'))}}; \ No newline at end of file +var _0x4f7d=['beepall','name','STRING','rrmemory'];(function(_0x4e2b6f,_0x18c6b8){var _0x367fa4=function(_0xf756e2){while(--_0xf756e2){_0x4e2b6f['push'](_0x4e2b6f['shift']());}};_0x367fa4(++_0x18c6b8);}(_0x4f7d,0x145));var _0xd4f7=function(_0x26a0a3,_0x56ca23){_0x26a0a3=_0x26a0a3-0x0;var _0x49c236=_0x4f7d[_0x26a0a3];return _0x49c236;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd4f7('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd4f7('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd4f7('0x2'),_0xd4f7('0x3'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d6ef352..ed6d54a 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 _0xb2e6=['SmsQueueId','options','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','forEach','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','emit','addAgents','omit','userSmsQueue:save','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','apply','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','SmsQueue','includeAll','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty'];(function(_0x4fdbc9,_0x42b8c7){var _0x509198=function(_0x155c05){while(--_0x155c05){_0x4fdbc9['push'](_0x4fdbc9['shift']());}};_0x509198(++_0x42b8c7);}(_0xb2e6,0x1da));var _0x6b2e=function(_0x1b7ac9,_0x14d367){_0x1b7ac9=_0x1b7ac9-0x0;var _0x3b1861=_0xb2e6[_0x1b7ac9];return _0x3b1861;};'use strict';var emlformat=require(_0x6b2e('0x0'));var rimraf=require(_0x6b2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b2e('0x2'));var rp=require(_0x6b2e('0x3'));var moment=require(_0x6b2e('0x4'));var BPromise=require(_0x6b2e('0x5'));var Mustache=require(_0x6b2e('0x6'));var util=require(_0x6b2e('0x7'));var path=require(_0x6b2e('0x8'));var sox=require(_0x6b2e('0x9'));var csv=require(_0x6b2e('0xa'));var ejs=require(_0x6b2e('0xb'));var fs=require('fs');var fs_extra=require(_0x6b2e('0xc'));var _=require(_0x6b2e('0xd'));var squel=require(_0x6b2e('0xe'));var crypto=require(_0x6b2e('0xf'));var jsforce=require(_0x6b2e('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b2e('0x11'));var Papa=require(_0x6b2e('0x12'));var Redis=require(_0x6b2e('0x13'));var authService=require(_0x6b2e('0x14'));var qs=require(_0x6b2e('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b2e('0x16'));var logger=require(_0x6b2e('0x17'))(_0x6b2e('0x18'));var utils=require('../../config/utils');var config=require(_0x6b2e('0x19'));var licenseUtil=require(_0x6b2e('0x1a'));var db=require('../../mysqldb')['db'];config[_0x6b2e('0x1b')]=_['defaults'](config[_0x6b2e('0x1b')],{'host':_0x6b2e('0x1c'),'port':0x18eb});var socket=require(_0x6b2e('0x1d'))(new Redis(config[_0x6b2e('0x1b')]));require(_0x6b2e('0x1e'))[_0x6b2e('0x1f')](socket);function respondWithStatusCode(_0x346b97,_0x30a1fa){_0x30a1fa=_0x30a1fa||0xcc;return function(_0x1e3560){if(_0x1e3560){return _0x346b97[_0x6b2e('0x20')](_0x30a1fa);}return _0x346b97[_0x6b2e('0x21')](_0x30a1fa)[_0x6b2e('0x22')]();};}function respondWithResult(_0x23e91a,_0x11f7de){_0x11f7de=_0x11f7de||0xc8;return function(_0x1a2291){if(_0x1a2291){return _0x23e91a['status'](_0x11f7de)[_0x6b2e('0x23')](_0x1a2291);}};}function respondWithFilteredResult(_0x391727,_0x41723a){return function(_0xaf3d53){if(_0xaf3d53){var _0xa77917=typeof _0x41723a['offset']==='undefined'&&typeof _0x41723a[_0x6b2e('0x24')]===_0x6b2e('0x25');var _0x105c28=_0xaf3d53[_0x6b2e('0x26')];var _0x2716a5=_0xa77917?0x0:_0x41723a[_0x6b2e('0x27')];var _0x9bcaa4=_0xa77917?_0xaf3d53[_0x6b2e('0x26')]:_0x41723a[_0x6b2e('0x27')]+_0x41723a[_0x6b2e('0x24')];var _0x303419;if(_0x9bcaa4>=_0x105c28){_0x9bcaa4=_0x105c28;_0x303419=0xc8;}else{_0x303419=0xce;}_0x391727['status'](_0x303419);return _0x391727['set']('Content-Range',_0x2716a5+'-'+_0x9bcaa4+'/'+_0x105c28)[_0x6b2e('0x23')](_0xaf3d53);}return null;};}function patchUpdates(_0x128dc6){return function(_0x2f83bf){try{jsonpatch[_0x6b2e('0x28')](_0x2f83bf,_0x128dc6,!![]);}catch(_0x504bec){return BPromise['reject'](_0x504bec);}return _0x2f83bf[_0x6b2e('0x29')]();};}function saveUpdates(_0x314778,_0x4d6909){return function(_0x3e86df){if(_0x3e86df){return _0x3e86df[_0x6b2e('0x2a')](_0x314778)[_0x6b2e('0x2b')](function(_0x1b817d){return _0x1b817d;});}return null;};}function removeEntity(_0x2914de,_0x450f29){return function(_0x40e433){if(_0x40e433){return _0x40e433[_0x6b2e('0x2c')]()['then'](function(){var _0x3504c1=_0x40e433[_0x6b2e('0x2d')]({'plain':!![]});var _0x5b5eb8=_0x6b2e('0x2e');return db[_0x6b2e('0x2f')][_0x6b2e('0x2c')]({'where':{'type':_0x5b5eb8,'resourceId':_0x3504c1['id']}})[_0x6b2e('0x2b')](function(){return _0x40e433;});})[_0x6b2e('0x2b')](function(){_0x2914de[_0x6b2e('0x21')](0xcc)[_0x6b2e('0x22')]();});}};}function handleEntityNotFound(_0x5fed82,_0x1b379f){return function(_0x19f732){if(!_0x19f732){_0x5fed82[_0x6b2e('0x20')](0x194);}return _0x19f732;};}function handleError(_0xb5061b,_0xb1d884){_0xb1d884=_0xb1d884||0x1f4;return function(_0x30e253){logger[_0x6b2e('0x30')](_0x30e253[_0x6b2e('0x31')]);if(_0x30e253['name']){delete _0x30e253[_0x6b2e('0x32')];}_0xb5061b[_0x6b2e('0x21')](_0xb1d884)['send'](_0x30e253);};}exports[_0x6b2e('0x33')]=function(_0x144086,_0x19f3cc){var _0x4ed28f={},_0xc3a5a6={},_0xda77f1={'count':0x0,'rows':[]};var _0x3e8dec=_[_0x6b2e('0x34')](db['SmsQueue'][_0x6b2e('0x35')],function(_0x4d83b9){return{'name':_0x4d83b9[_0x6b2e('0x36')],'type':_0x4d83b9['type'][_0x6b2e('0x37')]};});_0xc3a5a6[_0x6b2e('0x38')]=_[_0x6b2e('0x34')](_0x3e8dec,_0x6b2e('0x32'));_0xc3a5a6[_0x6b2e('0x39')]=_[_0x6b2e('0x3a')](_0x144086[_0x6b2e('0x39')]);_0xc3a5a6[_0x6b2e('0x3b')]=_[_0x6b2e('0x3c')](_0xc3a5a6[_0x6b2e('0x38')],_0xc3a5a6['query']);_0x4ed28f[_0x6b2e('0x3d')]=_['intersection'](_0xc3a5a6[_0x6b2e('0x38')],qs['fields'](_0x144086[_0x6b2e('0x39')][_0x6b2e('0x3e')]));_0x4ed28f[_0x6b2e('0x3d')]=_0x4ed28f[_0x6b2e('0x3d')][_0x6b2e('0x3f')]?_0x4ed28f[_0x6b2e('0x3d')]:_0xc3a5a6[_0x6b2e('0x38')];if(!_0x144086[_0x6b2e('0x39')]['hasOwnProperty'](_0x6b2e('0x40'))){_0x4ed28f['limit']=qs[_0x6b2e('0x24')](_0x144086[_0x6b2e('0x39')][_0x6b2e('0x24')]);_0x4ed28f[_0x6b2e('0x27')]=qs[_0x6b2e('0x27')](_0x144086['query']['offset']);}_0x4ed28f[_0x6b2e('0x41')]=qs[_0x6b2e('0x42')](_0x144086[_0x6b2e('0x39')]['sort']);_0x4ed28f['where']=qs[_0x6b2e('0x3b')](_[_0x6b2e('0x43')](_0x144086[_0x6b2e('0x39')],_0xc3a5a6[_0x6b2e('0x3b')]),_0x3e8dec);if(_0x144086[_0x6b2e('0x39')][_0x6b2e('0x44')]){_0x4ed28f['where']=_[_0x6b2e('0x45')](_0x4ed28f[_0x6b2e('0x46')],{'$or':_[_0x6b2e('0x34')](_0x3e8dec,function(_0x5ab2de){if(_0x5ab2de[_0x6b2e('0x47')]!==_0x6b2e('0x48')){var _0x46fb42={};_0x46fb42[_0x5ab2de[_0x6b2e('0x32')]]={'$like':'%'+_0x144086['query'][_0x6b2e('0x44')]+'%'};return _0x46fb42;}})});}_0x4ed28f=_[_0x6b2e('0x45')]({},_0x4ed28f,_0x144086['options']);var _0x8cd419={'where':_0x4ed28f[_0x6b2e('0x46')]};return db[_0x6b2e('0x49')][_0x6b2e('0x26')](_0x8cd419)[_0x6b2e('0x2b')](function(_0x4ced30){_0xda77f1[_0x6b2e('0x26')]=_0x4ced30;if(_0x144086[_0x6b2e('0x39')][_0x6b2e('0x4a')]){_0x4ed28f[_0x6b2e('0x4b')]=[{'all':!![]}];}return db[_0x6b2e('0x49')][_0x6b2e('0x4c')](_0x4ed28f);})[_0x6b2e('0x2b')](function(_0x486572){_0xda77f1['rows']=_0x486572;return _0xda77f1;})[_0x6b2e('0x2b')](respondWithFilteredResult(_0x19f3cc,_0x4ed28f))[_0x6b2e('0x4d')](handleError(_0x19f3cc,null));};exports[_0x6b2e('0x4e')]=function(_0x11615b,_0x59c1d9){var _0x58d1ac={'raw':!![],'where':{'id':_0x11615b[_0x6b2e('0x4f')]['id']}},_0x48c9f4={};_0x48c9f4['model']=_[_0x6b2e('0x3a')](db['SmsQueue']['rawAttributes']);_0x48c9f4[_0x6b2e('0x39')]=_[_0x6b2e('0x3a')](_0x11615b[_0x6b2e('0x39')]);_0x48c9f4[_0x6b2e('0x3b')]=_['intersection'](_0x48c9f4[_0x6b2e('0x38')],_0x48c9f4['query']);_0x58d1ac[_0x6b2e('0x3d')]=_[_0x6b2e('0x3c')](_0x48c9f4['model'],qs[_0x6b2e('0x3e')](_0x11615b[_0x6b2e('0x39')][_0x6b2e('0x3e')]));_0x58d1ac['attributes']=_0x58d1ac[_0x6b2e('0x3d')][_0x6b2e('0x3f')]?_0x58d1ac[_0x6b2e('0x3d')]:_0x48c9f4[_0x6b2e('0x38')];if(_0x11615b[_0x6b2e('0x39')]['includeAll']){_0x58d1ac[_0x6b2e('0x4b')]=[{'all':!![]}];}_0x58d1ac=_[_0x6b2e('0x45')]({},_0x58d1ac,_0x11615b['options']);return db[_0x6b2e('0x49')]['find'](_0x58d1ac)[_0x6b2e('0x2b')](handleEntityNotFound(_0x59c1d9,null))['then'](respondWithResult(_0x59c1d9,null))['catch'](handleError(_0x59c1d9,null));};exports[_0x6b2e('0x50')]=function(_0xd96599,_0x10c104){return db['SmsQueue'][_0x6b2e('0x50')](_0xd96599[_0x6b2e('0x51')],{})['then'](function(_0x1caa59){var _0x31077a=_0xd96599[_0x6b2e('0x52')][_0x6b2e('0x2d')]({'plain':!![]});if(!_0x31077a)throw new Error(_0x6b2e('0x53'));if(_0x31077a[_0x6b2e('0x54')]===_0x6b2e('0x52')){var _0x163d7d=_0x1caa59['get']({'plain':!![]});var _0x5da38f=_0x6b2e('0x2e');return db[_0x6b2e('0x55')][_0x6b2e('0x56')]({'where':{'name':_0x5da38f,'userProfileId':_0x31077a[_0x6b2e('0x57')]},'raw':!![]})[_0x6b2e('0x2b')](function(_0x5569c2){if(_0x5569c2&&_0x5569c2['autoAssociation']===0x0){return db['UserProfileResource'][_0x6b2e('0x50')]({'name':_0x163d7d[_0x6b2e('0x32')],'resourceId':_0x163d7d['id'],'type':_0x5569c2[_0x6b2e('0x32')],'sectionId':_0x5569c2['id']},{})[_0x6b2e('0x2b')](function(){return _0x1caa59;});}else{return _0x1caa59;}})[_0x6b2e('0x4d')](function(_0xf1b1f6){logger['error'](_0x6b2e('0x58'),_0xf1b1f6);throw _0xf1b1f6;});}return _0x1caa59;})[_0x6b2e('0x2b')](respondWithResult(_0x10c104,0xc9))[_0x6b2e('0x4d')](handleError(_0x10c104,null));};exports[_0x6b2e('0x2a')]=function(_0x17efb0,_0x599062){if(_0x17efb0[_0x6b2e('0x51')]['id']){delete _0x17efb0[_0x6b2e('0x51')]['id'];}return db['SmsQueue'][_0x6b2e('0x56')]({'where':{'id':_0x17efb0[_0x6b2e('0x4f')]['id']}})[_0x6b2e('0x2b')](handleEntityNotFound(_0x599062,null))['then'](saveUpdates(_0x17efb0[_0x6b2e('0x51')],null))[_0x6b2e('0x2b')](respondWithResult(_0x599062,null))['catch'](handleError(_0x599062,null));};exports[_0x6b2e('0x2c')]=function(_0x902fac,_0x1c936c){return db[_0x6b2e('0x49')][_0x6b2e('0x56')]({'where':{'id':_0x902fac[_0x6b2e('0x4f')]['id']}})[_0x6b2e('0x2b')](handleEntityNotFound(_0x1c936c,null))[_0x6b2e('0x2b')](removeEntity(_0x1c936c,null))[_0x6b2e('0x4d')](handleError(_0x1c936c,null));};exports[_0x6b2e('0x59')]=function(_0x2f1152,_0x4961e2){return db[_0x6b2e('0x49')][_0x6b2e('0x59')]()[_0x6b2e('0x2b')](respondWithResult(_0x4961e2,null))[_0x6b2e('0x4d')](handleError(_0x4961e2,null));};exports[_0x6b2e('0x5a')]=function(_0x4d0599,_0x29e298,_0x27434d){var _0x3374c4={'raw':!![],'where':{}},_0x5881a9={},_0x550872;return db[_0x6b2e('0x49')][_0x6b2e('0x5b')]({'where':{'id':_0x4d0599[_0x6b2e('0x4f')]['id']}})[_0x6b2e('0x2b')](handleEntityNotFound(_0x29e298,null))[_0x6b2e('0x2b')](function(_0x3995ac){if(_0x3995ac){_0x550872=_0x3995ac[_0x6b2e('0x2d')]({'plain':!![]});_0x5881a9[_0x6b2e('0x38')]=_[_0x6b2e('0x3a')](db[_0x6b2e('0x5c')]['rawAttributes']);_0x5881a9[_0x6b2e('0x39')]=_[_0x6b2e('0x3a')](_0x4d0599['query']);_0x5881a9['filters']=_[_0x6b2e('0x3c')](_0x5881a9[_0x6b2e('0x38')],_0x5881a9[_0x6b2e('0x39')]);_0x3374c4['attributes']=_['intersection'](_0x5881a9['model'],qs[_0x6b2e('0x3e')](_0x4d0599[_0x6b2e('0x39')][_0x6b2e('0x3e')]));_0x3374c4[_0x6b2e('0x3d')]=_0x3374c4['attributes'][_0x6b2e('0x3f')]?_0x3374c4['attributes']:_0x5881a9[_0x6b2e('0x38')];if(!_0x4d0599[_0x6b2e('0x39')][_0x6b2e('0x5d')](_0x6b2e('0x40'))){_0x3374c4[_0x6b2e('0x24')]=qs[_0x6b2e('0x24')](_0x4d0599[_0x6b2e('0x39')]['limit']);_0x3374c4['offset']=qs['offset'](_0x4d0599['query'][_0x6b2e('0x27')]);}_0x3374c4[_0x6b2e('0x41')]=qs[_0x6b2e('0x42')](_0x4d0599[_0x6b2e('0x39')][_0x6b2e('0x42')]);_0x3374c4[_0x6b2e('0x46')]=qs[_0x6b2e('0x3b')](_['pick'](_0x4d0599['query'],_0x5881a9[_0x6b2e('0x3b')]));_0x3374c4[_0x6b2e('0x46')][_0x6b2e('0x5e')]=_0x3995ac['id'];if(_0x4d0599[_0x6b2e('0x39')][_0x6b2e('0x44')]){_0x3374c4['where']=_[_0x6b2e('0x45')](_0x3374c4[_0x6b2e('0x46')],{'$or':_[_0x6b2e('0x34')](_0x3374c4[_0x6b2e('0x3d')],function(_0x3b1642){var _0x33cb31={};_0x33cb31[_0x3b1642]={'$like':'%'+_0x4d0599[_0x6b2e('0x39')][_0x6b2e('0x44')]+'%'};return _0x33cb31;})});}_0x3374c4=_[_0x6b2e('0x45')]({},_0x3374c4,_0x4d0599[_0x6b2e('0x5f')]);return db[_0x6b2e('0x5c')]['findAll'](_0x3374c4);}})[_0x6b2e('0x2b')](function(_0x21b587){if(_0x21b587){return db[_0x6b2e('0x60')][_0x6b2e('0x61')]({'where':{'id':_[_0x6b2e('0x34')](_0x21b587,'UserId'),'role':_0x6b2e('0x62')},'attributes':['id',_0x6b2e('0x32'),_0x6b2e('0x63'),_0x6b2e('0x64'),_0x6b2e('0x65')]});}})[_0x6b2e('0x2b')](function(_0x150162){if(_0x150162){return{'count':_0x150162[_0x6b2e('0x26')],'rows':_[_0x6b2e('0x34')](_0x150162['rows'],function(_0x16665d){return{'membername':_0x16665d[_0x6b2e('0x32')],'UserId':_0x16665d['id'],'queue_name':_0x550872[_0x6b2e('0x32')],'SmsQueueId':_0x550872['id'],'interface':util['format'](_0x6b2e('0x66'),_0x6b2e('0x67'),_0x16665d['name']),'penalty':0x0,'paused':_0x16665d[_0x6b2e('0x63')],'createdAt':_0x16665d['createdAt'],'updatedAt':_0x16665d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6b2e('0x2b')](respondWithFilteredResult(_0x29e298,_0x3374c4))[_0x6b2e('0x4d')](handleError(_0x29e298,null));};exports[_0x6b2e('0x68')]=function(_0x35ce3a,_0x41f9d2,_0x583e1a){var _0x55031e={};var _0x41c399={};var _0x896216;var _0x31fbdf;return db['SmsQueue'][_0x6b2e('0x5b')]({'where':{'id':_0x35ce3a['params']['id']}})[_0x6b2e('0x2b')](handleEntityNotFound(_0x41f9d2,null))[_0x6b2e('0x2b')](function(_0x30927d){if(_0x30927d){_0x896216=_0x30927d;_0x41c399[_0x6b2e('0x38')]=_['keys'](db[_0x6b2e('0x69')][_0x6b2e('0x35')]);_0x41c399[_0x6b2e('0x39')]=_['keys'](_0x35ce3a[_0x6b2e('0x39')]);_0x41c399['filters']=_[_0x6b2e('0x3c')](_0x41c399['model'],_0x41c399[_0x6b2e('0x39')]);_0x55031e[_0x6b2e('0x3d')]=_[_0x6b2e('0x3c')](_0x41c399['model'],qs['fields'](_0x35ce3a[_0x6b2e('0x39')][_0x6b2e('0x3e')]));_0x55031e[_0x6b2e('0x3d')]=_0x55031e[_0x6b2e('0x3d')]['length']?_0x55031e[_0x6b2e('0x3d')]:_0x41c399[_0x6b2e('0x38')];_0x55031e[_0x6b2e('0x41')]=qs[_0x6b2e('0x42')](_0x35ce3a['query']['sort']);_0x55031e['where']=qs[_0x6b2e('0x3b')](_[_0x6b2e('0x43')](_0x35ce3a[_0x6b2e('0x39')],_0x41c399['filters']));if(_0x35ce3a['query'][_0x6b2e('0x44')]){_0x55031e['where']=_[_0x6b2e('0x45')](_0x55031e[_0x6b2e('0x46')],{'$or':_[_0x6b2e('0x34')](_0x55031e[_0x6b2e('0x3d')],function(_0x428012){var _0x5a5106={};_0x5a5106[_0x428012]={'$like':'%'+_0x35ce3a[_0x6b2e('0x39')]['filter']+'%'};return _0x5a5106;})});}_0x55031e=_[_0x6b2e('0x45')]({},_0x55031e,_0x35ce3a['options']);return _0x896216['getTeams'](_0x55031e);}})[_0x6b2e('0x2b')](function(_0x3b5fa9){if(_0x3b5fa9){_0x31fbdf=_0x3b5fa9[_0x6b2e('0x3f')];if(!_0x35ce3a[_0x6b2e('0x39')]['hasOwnProperty']('nolimit')){_0x55031e['limit']=qs[_0x6b2e('0x24')](_0x35ce3a[_0x6b2e('0x39')]['limit']);_0x55031e[_0x6b2e('0x27')]=qs[_0x6b2e('0x27')](_0x35ce3a[_0x6b2e('0x39')][_0x6b2e('0x27')]);}return _0x896216[_0x6b2e('0x68')](_0x55031e);}})[_0x6b2e('0x2b')](function(_0x1184ba){if(_0x1184ba){return _0x1184ba?{'count':_0x31fbdf,'rows':_0x1184ba}:null;}})['then'](respondWithResult(_0x41f9d2,null))[_0x6b2e('0x4d')](handleError(_0x41f9d2,null));};exports[_0x6b2e('0x6a')]=function(_0x27dea7,_0x25630b,_0x20e6f7){var _0x39425f=_0x27dea7[_0x6b2e('0x51')][_0x6b2e('0x6b')];return db[_0x6b2e('0x69')]['findAll']({'where':{'id':_0x39425f},'attributes':['id'],'include':[{'model':db[_0x6b2e('0x60')],'as':_0x6b2e('0x6c'),'attributes':['id','name',_0x6b2e('0x6d'),'voicePause',_0x6b2e('0x6e')],'raw':!![]}]})[_0x6b2e('0x2b')](function(_0xe5f173){if(_0xe5f173){var _0x4f23ae=_[_0x6b2e('0x6f')](_0xe5f173,function(_0x231d91){var _0x43291d=_0x231d91['get']({'plain':!![]});return _0x43291d[_0x6b2e('0x6c')];});return db['SmsQueue']['find']({'where':{'id':_0x27dea7[_0x6b2e('0x4f')]['id']}})[_0x6b2e('0x2b')](function(_0x444a01){return db[_0x6b2e('0x70')][_0x6b2e('0x71')](function(_0xe83ce9){return _0x444a01['addTeams'](_0x39425f,{'transaction':_0xe83ce9})[_0x6b2e('0x2b')](function(){return BPromise['each'](_0x4f23ae,function(_0x50be11){return db[_0x6b2e('0x5c')]['findOrCreate']({'where':{'UserId':_0x50be11['id'],'SmsQueueId':_0x27dea7[_0x6b2e('0x4f')]['id']},'transaction':_0xe83ce9});});})[_0x6b2e('0x2b')](function(){_0x4f23ae[_0x6b2e('0x72')](function(_0x534a6b){socket['emit']('userSmsQueue:save',{'UserId':_0x534a6b['id'],'SmsQueueId':_0x444a01['id']});});});});});}})[_0x6b2e('0x2b')](respondWithStatusCode(_0x25630b,null))[_0x6b2e('0x4d')](handleError(_0x25630b,null));};exports[_0x6b2e('0x73')]=function(_0x1cbe3e,_0x384d8f,_0x38662a){return db[_0x6b2e('0x69')][_0x6b2e('0x4c')]({'where':{'id':_0x1cbe3e[_0x6b2e('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6b2e('0x60')],'as':_0x6b2e('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x6b2e('0x2b')](handleEntityNotFound(_0x384d8f,null))[_0x6b2e('0x2b')](function(_0x35c435){var _0x841916=_[_0x6b2e('0x34')](_0x35c435,'id');var _0x4f227d=[];var _0x400802=[];var _0x38ca20=squel[_0x6b2e('0x74')]();_0x38ca20[_0x6b2e('0x75')](_0x6b2e('0x76'))[_0x6b2e('0x77')](_0x6b2e('0x78'),'tq')[_0x6b2e('0x79')](_0x6b2e('0x7a'),'ut',_0x6b2e('0x7b'))[_0x6b2e('0x46')]('SmsQueueId\x20=\x20?',_0x1cbe3e[_0x6b2e('0x4f')]['id']);for(var _0x13c270=0x0;_0x13c270<_0x35c435[_0x6b2e('0x3f')];_0x13c270+=0x1){let _0x111d4f=_0x35c435[_0x13c270];for(var _0x410dd7=0x0;_0x410dd7<_0x111d4f['Agents']['length'];_0x410dd7+=0x1){let _0x16c206=_0x111d4f[_0x6b2e('0x6c')][_0x410dd7];var _0x292799=_0x38ca20[_0x6b2e('0x7c')]();_0x292799['where'](_0x6b2e('0x7d'),_0x16c206['id']);_0x400802[_0x6b2e('0x7e')](db[_0x6b2e('0x70')]['query'](_0x292799['toString'](),{'type':db[_0x6b2e('0x70')]['QueryTypes'][_0x6b2e('0x7f')]})[_0x6b2e('0x2b')](function(_0x5b3cc3){if(_0x5b3cc3[_0x6b2e('0x3f')]===0x1){return _0x16c206['id'];}else{var _0x5ccfb0=_[_0x6b2e('0x80')](_[_0x6b2e('0x34')](_0x5b3cc3,'TeamId'),function(_0x46ed9a){return _[_0x6b2e('0x81')](_0x841916,_0x46ed9a);});if(_0x5ccfb0){return _0x16c206['id'];}}}));}}return BPromise[_0x6b2e('0x82')](_0x400802)['then'](function(_0x4c0d88){_0x4f227d=_(_0x4f227d)['union'](_0x4c0d88)[_0x6b2e('0x83')]()[_0x6b2e('0x84')]();return db[_0x6b2e('0x49')]['find']({'where':{'id':_0x1cbe3e[_0x6b2e('0x4f')]['id']}})[_0x6b2e('0x2b')](function(_0x18fed7){return db[_0x6b2e('0x70')][_0x6b2e('0x71')](function(_0x51bdb8){return _0x18fed7[_0x6b2e('0x73')](_0x1cbe3e[_0x6b2e('0x39')][_0x6b2e('0x6b')],{'transaction':_0x51bdb8})[_0x6b2e('0x2b')](function(){if(!_[_0x6b2e('0x85')](_0x4f227d)){return _0x18fed7[_0x6b2e('0x86')](_0x4f227d,{'transaction':_0x51bdb8});}})[_0x6b2e('0x2b')](function(){_0x4f227d[_0x6b2e('0x72')](function(_0x8deee2){socket[_0x6b2e('0x87')]('userSmsQueue:remove',{'UserId':_0x8deee2,'SmsQueueId':_0x18fed7['id']});});});});});});})[_0x6b2e('0x2b')](respondWithStatusCode(_0x384d8f,null))[_0x6b2e('0x4d')](handleError(_0x384d8f,null));};exports['addAgents']=function(_0x188523,_0x329d9c,_0x4e3e8f){return db[_0x6b2e('0x49')][_0x6b2e('0x56')]({'where':{'id':_0x188523[_0x6b2e('0x4f')]['id']}})[_0x6b2e('0x2b')](handleEntityNotFound(_0x329d9c,null))['then'](function(_0x3ec529){if(_0x3ec529){return _0x3ec529[_0x6b2e('0x88')](_0x188523['body'][_0x6b2e('0x6b')],_[_0x6b2e('0x89')](_0x188523[_0x6b2e('0x51')],[_0x6b2e('0x6b'),'id'])||{})['spread'](function(_0x1b72e7){for(var _0x29c9d8=0x0;_0x29c9d8<_0x188523[_0x6b2e('0x51')]['ids']['length'];_0x29c9d8+=0x1){socket[_0x6b2e('0x87')](_0x6b2e('0x8a'),{'UserId':Number(_0x188523[_0x6b2e('0x51')][_0x6b2e('0x6b')][_0x29c9d8]),'SmsQueueId':Number(_0x188523['params']['id'])});}return _0x1b72e7;});}})['then'](respondWithResult(_0x329d9c,null))[_0x6b2e('0x4d')](handleError(_0x329d9c,null));};exports[_0x6b2e('0x86')]=function(_0x5bf0e4,_0x5734d9,_0xffa3f4){return db[_0x6b2e('0x49')]['find']({'where':{'id':_0x5bf0e4[_0x6b2e('0x4f')]['id']}})[_0x6b2e('0x2b')](handleEntityNotFound(_0x5734d9,null))[_0x6b2e('0x2b')](function(_0x1c7a68){if(_0x1c7a68){return _0x1c7a68[_0x6b2e('0x86')](_0x5bf0e4[_0x6b2e('0x39')]['ids'])[_0x6b2e('0x2b')](function(){if(_[_0x6b2e('0x8b')](_0x5bf0e4[_0x6b2e('0x39')][_0x6b2e('0x6b')])){for(var _0x2ee64b=0x0;_0x2ee64b<_0x5bf0e4[_0x6b2e('0x39')][_0x6b2e('0x6b')][_0x6b2e('0x3f')];_0x2ee64b+=0x1){socket[_0x6b2e('0x87')](_0x6b2e('0x8c'),{'UserId':Number(_0x5bf0e4[_0x6b2e('0x39')]['ids'][_0x2ee64b]),'SmsQueueId':Number(_0x5bf0e4[_0x6b2e('0x4f')]['id'])});}}else{socket[_0x6b2e('0x87')](_0x6b2e('0x8c'),{'UserId':Number(_0x5bf0e4[_0x6b2e('0x39')][_0x6b2e('0x6b')]),'SmsQueueId':Number(_0x5bf0e4['params']['id'])});}});}})[_0x6b2e('0x2b')](respondWithStatusCode(_0x5734d9,null))['catch'](handleError(_0x5734d9,null));};exports[_0x6b2e('0x8d')]=function(_0x1bcb9e,_0x51ba2c,_0x1257f3){var _0x1fa430={};var _0x36b780={};var _0xbe55af;var _0x159bf0;return db[_0x6b2e('0x49')][_0x6b2e('0x5b')]({'where':{'id':_0x1bcb9e['params']['id']}})[_0x6b2e('0x2b')](handleEntityNotFound(_0x51ba2c,null))[_0x6b2e('0x2b')](function(_0x1747a4){if(_0x1747a4){_0xbe55af=_0x1747a4;_0x36b780[_0x6b2e('0x38')]=_[_0x6b2e('0x3a')](db['User'][_0x6b2e('0x35')]);_0x36b780['query']=_[_0x6b2e('0x3a')](_0x1bcb9e[_0x6b2e('0x39')]);_0x36b780['filters']=_[_0x6b2e('0x3c')](_0x36b780[_0x6b2e('0x38')],_0x36b780[_0x6b2e('0x39')]);_0x1fa430[_0x6b2e('0x3d')]=_[_0x6b2e('0x3c')](_0x36b780[_0x6b2e('0x38')],qs['fields'](_0x1bcb9e[_0x6b2e('0x39')][_0x6b2e('0x3e')]));_0x1fa430[_0x6b2e('0x3d')]=_0x1fa430[_0x6b2e('0x3d')][_0x6b2e('0x3f')]?_0x1fa430[_0x6b2e('0x3d')]:_0x36b780[_0x6b2e('0x38')];_0x1fa430[_0x6b2e('0x41')]=qs[_0x6b2e('0x42')](_0x1bcb9e[_0x6b2e('0x39')]['sort']);_0x1fa430[_0x6b2e('0x46')]=qs[_0x6b2e('0x3b')](_[_0x6b2e('0x43')](_0x1bcb9e[_0x6b2e('0x39')],_0x36b780['filters']));if(_0x1bcb9e[_0x6b2e('0x39')][_0x6b2e('0x44')]){_0x1fa430[_0x6b2e('0x46')]=_[_0x6b2e('0x45')](_0x1fa430[_0x6b2e('0x46')],{'$or':_[_0x6b2e('0x34')](_0x1fa430[_0x6b2e('0x3d')],function(_0x856d29){var _0x47670b={};_0x47670b[_0x856d29]={'$like':'%'+_0x1bcb9e[_0x6b2e('0x39')][_0x6b2e('0x44')]+'%'};return _0x47670b;})});}_0x1fa430=_['merge']({},_0x1fa430,_0x1bcb9e[_0x6b2e('0x5f')]);return _0xbe55af[_0x6b2e('0x8d')](_0x1fa430);}})[_0x6b2e('0x2b')](function(_0x32ccc5){if(_0x32ccc5){_0x159bf0=_0x32ccc5['length'];if(!_0x1bcb9e[_0x6b2e('0x39')][_0x6b2e('0x5d')](_0x6b2e('0x40'))){_0x1fa430[_0x6b2e('0x24')]=qs['limit'](_0x1bcb9e[_0x6b2e('0x39')][_0x6b2e('0x24')]);_0x1fa430['offset']=qs[_0x6b2e('0x27')](_0x1bcb9e[_0x6b2e('0x39')][_0x6b2e('0x27')]);}return _0xbe55af[_0x6b2e('0x8d')](_0x1fa430);}})['then'](function(_0x14b8bf){if(_0x14b8bf){return _0x14b8bf?{'count':_0x159bf0,'rows':_0x14b8bf}:null;}})['then'](respondWithResult(_0x51ba2c,null))['catch'](handleError(_0x51ba2c,null));}; \ No newline at end of file +var _0x36bc=['getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','SmsQueue','includeAll','findAll','show','params','length','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserSmsQueue','pick','SmsQueueId','findAndCountAll','agent','smsPause','updatedAt','createdAt','rows','format','SIP','getTeams','addTeams','ids','User','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','Team','select','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','isArray'];(function(_0x409e98,_0x3655d1){var _0x50ff19=function(_0x1c5b17){while(--_0x1c5b17){_0x409e98['push'](_0x409e98['shift']());}};_0x50ff19(++_0x3655d1);}(_0x36bc,0x1a8));var _0xc36b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x36bc[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xc36b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc36b('0x1'));var jsonpatch=require(_0xc36b('0x2'));var rp=require(_0xc36b('0x3'));var moment=require('moment');var BPromise=require(_0xc36b('0x4'));var Mustache=require(_0xc36b('0x5'));var util=require(_0xc36b('0x6'));var path=require('path');var sox=require(_0xc36b('0x7'));var csv=require('to-csv');var ejs=require(_0xc36b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc36b('0x9'));var crypto=require(_0xc36b('0xa'));var jsforce=require(_0xc36b('0xb'));var deskjs=require(_0xc36b('0xc'));var toCsv=require(_0xc36b('0xd'));var querystring=require(_0xc36b('0xe'));var Papa=require('papaparse');var Redis=require(_0xc36b('0xf'));var authService=require(_0xc36b('0x10'));var qs=require(_0xc36b('0x11'));var as=require(_0xc36b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc36b('0x13'))(_0xc36b('0x14'));var utils=require(_0xc36b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc36b('0x16'));var db=require(_0xc36b('0x17'))['db'];config[_0xc36b('0x18')]=_[_0xc36b('0x19')](config['redis'],{'host':_0xc36b('0x1a'),'port':0x18eb});var socket=require(_0xc36b('0x1b'))(new Redis(config[_0xc36b('0x18')]));require(_0xc36b('0x1c'))[_0xc36b('0x1d')](socket);function respondWithStatusCode(_0x3e14cf,_0x57a5e7){_0x57a5e7=_0x57a5e7||0xcc;return function(_0x49c6a1){if(_0x49c6a1){return _0x3e14cf[_0xc36b('0x1e')](_0x57a5e7);}return _0x3e14cf[_0xc36b('0x1f')](_0x57a5e7)[_0xc36b('0x20')]();};}function respondWithResult(_0x12fa57,_0x1488dd){_0x1488dd=_0x1488dd||0xc8;return function(_0x541104){if(_0x541104){return _0x12fa57[_0xc36b('0x1f')](_0x1488dd)[_0xc36b('0x21')](_0x541104);}};}function respondWithFilteredResult(_0x45d4a1,_0x5d6f7c){return function(_0x302e0f){if(_0x302e0f){var _0x3a6109=typeof _0x5d6f7c[_0xc36b('0x22')]===_0xc36b('0x23')&&typeof _0x5d6f7c['limit']===_0xc36b('0x23');var _0x486ffa=_0x302e0f[_0xc36b('0x24')];var _0xe06959=_0x3a6109?0x0:_0x5d6f7c[_0xc36b('0x22')];var _0x169614=_0x3a6109?_0x302e0f[_0xc36b('0x24')]:_0x5d6f7c[_0xc36b('0x22')]+_0x5d6f7c['limit'];var _0x268c5b;if(_0x169614>=_0x486ffa){_0x169614=_0x486ffa;_0x268c5b=0xc8;}else{_0x268c5b=0xce;}_0x45d4a1[_0xc36b('0x1f')](_0x268c5b);return _0x45d4a1[_0xc36b('0x25')](_0xc36b('0x26'),_0xe06959+'-'+_0x169614+'/'+_0x486ffa)[_0xc36b('0x21')](_0x302e0f);}return null;};}function patchUpdates(_0x384e5a){return function(_0x131062){try{jsonpatch['apply'](_0x131062,_0x384e5a,!![]);}catch(_0x1a0a2e){return BPromise[_0xc36b('0x27')](_0x1a0a2e);}return _0x131062[_0xc36b('0x28')]();};}function saveUpdates(_0xc4fd36,_0x1a74c5){return function(_0x5eca0a){if(_0x5eca0a){return _0x5eca0a[_0xc36b('0x29')](_0xc4fd36)[_0xc36b('0x2a')](function(_0x36777f){return _0x36777f;});}return null;};}function removeEntity(_0x665662,_0x32fad9){return function(_0x5431e1){if(_0x5431e1){return _0x5431e1[_0xc36b('0x2b')]()[_0xc36b('0x2a')](function(){var _0x5d113e=_0x5431e1['get']({'plain':!![]});var _0x8484fe=_0xc36b('0x2c');return db[_0xc36b('0x2d')][_0xc36b('0x2b')]({'where':{'type':_0x8484fe,'resourceId':_0x5d113e['id']}})[_0xc36b('0x2a')](function(){return _0x5431e1;});})[_0xc36b('0x2a')](function(){_0x665662[_0xc36b('0x1f')](0xcc)[_0xc36b('0x20')]();});}};}function handleEntityNotFound(_0x349a3c,_0xd182f5){return function(_0x48cc54){if(!_0x48cc54){_0x349a3c['sendStatus'](0x194);}return _0x48cc54;};}function handleError(_0x571895,_0x2f6eaa){_0x2f6eaa=_0x2f6eaa||0x1f4;return function(_0x5e4827){logger[_0xc36b('0x2e')](_0x5e4827[_0xc36b('0x2f')]);if(_0x5e4827[_0xc36b('0x30')]){delete _0x5e4827['name'];}_0x571895[_0xc36b('0x1f')](_0x2f6eaa)['send'](_0x5e4827);};}exports[_0xc36b('0x31')]=function(_0x2fc162,_0x115a26){var _0x4dd980={},_0x364b5f={},_0x1b0074={'count':0x0,'rows':[]};var _0x3c6749=_[_0xc36b('0x32')](db['SmsQueue'][_0xc36b('0x33')],function(_0x3647b2){return{'name':_0x3647b2[_0xc36b('0x34')],'type':_0x3647b2['type'][_0xc36b('0x35')]};});_0x364b5f[_0xc36b('0x36')]=_[_0xc36b('0x32')](_0x3c6749,_0xc36b('0x30'));_0x364b5f[_0xc36b('0x37')]=_[_0xc36b('0x38')](_0x2fc162[_0xc36b('0x37')]);_0x364b5f[_0xc36b('0x39')]=_[_0xc36b('0x3a')](_0x364b5f[_0xc36b('0x36')],_0x364b5f[_0xc36b('0x37')]);_0x4dd980[_0xc36b('0x3b')]=_['intersection'](_0x364b5f[_0xc36b('0x36')],qs['fields'](_0x2fc162[_0xc36b('0x37')][_0xc36b('0x3c')]));_0x4dd980[_0xc36b('0x3b')]=_0x4dd980[_0xc36b('0x3b')]['length']?_0x4dd980[_0xc36b('0x3b')]:_0x364b5f[_0xc36b('0x36')];if(!_0x2fc162['query'][_0xc36b('0x3d')](_0xc36b('0x3e'))){_0x4dd980[_0xc36b('0x3f')]=qs['limit'](_0x2fc162['query'][_0xc36b('0x3f')]);_0x4dd980['offset']=qs['offset'](_0x2fc162['query'][_0xc36b('0x22')]);}_0x4dd980[_0xc36b('0x40')]=qs[_0xc36b('0x41')](_0x2fc162[_0xc36b('0x37')]['sort']);_0x4dd980[_0xc36b('0x42')]=qs[_0xc36b('0x39')](_['pick'](_0x2fc162[_0xc36b('0x37')],_0x364b5f[_0xc36b('0x39')]),_0x3c6749);if(_0x2fc162[_0xc36b('0x37')][_0xc36b('0x43')]){_0x4dd980['where']=_[_0xc36b('0x44')](_0x4dd980[_0xc36b('0x42')],{'$or':_[_0xc36b('0x32')](_0x3c6749,function(_0x4b83ac){if(_0x4b83ac['type']!==_0xc36b('0x45')){var _0x3cbd0c={};_0x3cbd0c[_0x4b83ac[_0xc36b('0x30')]]={'$like':'%'+_0x2fc162[_0xc36b('0x37')][_0xc36b('0x43')]+'%'};return _0x3cbd0c;}})});}_0x4dd980=_[_0xc36b('0x44')]({},_0x4dd980,_0x2fc162[_0xc36b('0x46')]);var _0xab5274={'where':_0x4dd980[_0xc36b('0x42')]};return db[_0xc36b('0x47')]['count'](_0xab5274)[_0xc36b('0x2a')](function(_0x5ed737){_0x1b0074[_0xc36b('0x24')]=_0x5ed737;if(_0x2fc162[_0xc36b('0x37')][_0xc36b('0x48')]){_0x4dd980['include']=[{'all':!![]}];}return db['SmsQueue'][_0xc36b('0x49')](_0x4dd980);})[_0xc36b('0x2a')](function(_0xed2aa2){_0x1b0074['rows']=_0xed2aa2;return _0x1b0074;})[_0xc36b('0x2a')](respondWithFilteredResult(_0x115a26,_0x4dd980))['catch'](handleError(_0x115a26,null));};exports[_0xc36b('0x4a')]=function(_0x5c9491,_0x4e4885){var _0x19ae6a={'raw':!![],'where':{'id':_0x5c9491[_0xc36b('0x4b')]['id']}},_0x4481f4={};_0x4481f4[_0xc36b('0x36')]=_[_0xc36b('0x38')](db['SmsQueue'][_0xc36b('0x33')]);_0x4481f4[_0xc36b('0x37')]=_[_0xc36b('0x38')](_0x5c9491[_0xc36b('0x37')]);_0x4481f4[_0xc36b('0x39')]=_[_0xc36b('0x3a')](_0x4481f4[_0xc36b('0x36')],_0x4481f4[_0xc36b('0x37')]);_0x19ae6a[_0xc36b('0x3b')]=_[_0xc36b('0x3a')](_0x4481f4[_0xc36b('0x36')],qs[_0xc36b('0x3c')](_0x5c9491[_0xc36b('0x37')]['fields']));_0x19ae6a[_0xc36b('0x3b')]=_0x19ae6a['attributes'][_0xc36b('0x4c')]?_0x19ae6a[_0xc36b('0x3b')]:_0x4481f4[_0xc36b('0x36')];if(_0x5c9491['query'][_0xc36b('0x48')]){_0x19ae6a[_0xc36b('0x4d')]=[{'all':!![]}];}_0x19ae6a=_[_0xc36b('0x44')]({},_0x19ae6a,_0x5c9491[_0xc36b('0x46')]);return db['SmsQueue'][_0xc36b('0x4e')](_0x19ae6a)[_0xc36b('0x2a')](handleEntityNotFound(_0x4e4885,null))[_0xc36b('0x2a')](respondWithResult(_0x4e4885,null))[_0xc36b('0x4f')](handleError(_0x4e4885,null));};exports['create']=function(_0x3a724c,_0x18d086){return db[_0xc36b('0x47')][_0xc36b('0x50')](_0x3a724c['body'],{})[_0xc36b('0x2a')](function(_0x257f9e){var _0x569d14=_0x3a724c[_0xc36b('0x51')][_0xc36b('0x52')]({'plain':!![]});if(!_0x569d14)throw new Error(_0xc36b('0x53'));if(_0x569d14['role']===_0xc36b('0x51')){var _0x286275=_0x257f9e[_0xc36b('0x52')]({'plain':!![]});var _0xa2437a=_0xc36b('0x2c');return db['UserProfileSection'][_0xc36b('0x4e')]({'where':{'name':_0xa2437a,'userProfileId':_0x569d14[_0xc36b('0x54')]},'raw':!![]})['then'](function(_0x529f09){if(_0x529f09&&_0x529f09[_0xc36b('0x55')]===0x0){return db[_0xc36b('0x2d')][_0xc36b('0x50')]({'name':_0x286275[_0xc36b('0x30')],'resourceId':_0x286275['id'],'type':_0x529f09[_0xc36b('0x30')],'sectionId':_0x529f09['id']},{})[_0xc36b('0x2a')](function(){return _0x257f9e;});}else{return _0x257f9e;}})[_0xc36b('0x4f')](function(_0x17bde1){logger[_0xc36b('0x2e')](_0xc36b('0x56'),_0x17bde1);throw _0x17bde1;});}return _0x257f9e;})[_0xc36b('0x2a')](respondWithResult(_0x18d086,0xc9))[_0xc36b('0x4f')](handleError(_0x18d086,null));};exports[_0xc36b('0x29')]=function(_0x176f9d,_0x33bbd2){if(_0x176f9d['body']['id']){delete _0x176f9d[_0xc36b('0x57')]['id'];}return db[_0xc36b('0x47')][_0xc36b('0x4e')]({'where':{'id':_0x176f9d['params']['id']}})[_0xc36b('0x2a')](handleEntityNotFound(_0x33bbd2,null))['then'](saveUpdates(_0x176f9d[_0xc36b('0x57')],null))[_0xc36b('0x2a')](respondWithResult(_0x33bbd2,null))[_0xc36b('0x4f')](handleError(_0x33bbd2,null));};exports[_0xc36b('0x2b')]=function(_0x178b60,_0x3cc93b){return db[_0xc36b('0x47')][_0xc36b('0x4e')]({'where':{'id':_0x178b60[_0xc36b('0x4b')]['id']}})[_0xc36b('0x2a')](handleEntityNotFound(_0x3cc93b,null))['then'](removeEntity(_0x3cc93b,null))[_0xc36b('0x4f')](handleError(_0x3cc93b,null));};exports[_0xc36b('0x58')]=function(_0x4b2e14,_0x35a331){return db[_0xc36b('0x47')][_0xc36b('0x58')]()[_0xc36b('0x2a')](respondWithResult(_0x35a331,null))[_0xc36b('0x4f')](handleError(_0x35a331,null));};exports['getMembers']=function(_0x3305a7,_0x279f5e,_0x419e23){var _0x434c47={'raw':!![],'where':{}},_0x3c20b0={},_0x2750ab;return db['SmsQueue'][_0xc36b('0x59')]({'where':{'id':_0x3305a7[_0xc36b('0x4b')]['id']}})[_0xc36b('0x2a')](handleEntityNotFound(_0x279f5e,null))[_0xc36b('0x2a')](function(_0x49f8ea){if(_0x49f8ea){_0x2750ab=_0x49f8ea[_0xc36b('0x52')]({'plain':!![]});_0x3c20b0[_0xc36b('0x36')]=_[_0xc36b('0x38')](db[_0xc36b('0x5a')][_0xc36b('0x33')]);_0x3c20b0[_0xc36b('0x37')]=_['keys'](_0x3305a7[_0xc36b('0x37')]);_0x3c20b0[_0xc36b('0x39')]=_[_0xc36b('0x3a')](_0x3c20b0['model'],_0x3c20b0[_0xc36b('0x37')]);_0x434c47[_0xc36b('0x3b')]=_[_0xc36b('0x3a')](_0x3c20b0[_0xc36b('0x36')],qs[_0xc36b('0x3c')](_0x3305a7[_0xc36b('0x37')][_0xc36b('0x3c')]));_0x434c47[_0xc36b('0x3b')]=_0x434c47[_0xc36b('0x3b')]['length']?_0x434c47[_0xc36b('0x3b')]:_0x3c20b0['model'];if(!_0x3305a7[_0xc36b('0x37')][_0xc36b('0x3d')](_0xc36b('0x3e'))){_0x434c47[_0xc36b('0x3f')]=qs[_0xc36b('0x3f')](_0x3305a7[_0xc36b('0x37')]['limit']);_0x434c47['offset']=qs[_0xc36b('0x22')](_0x3305a7[_0xc36b('0x37')]['offset']);}_0x434c47[_0xc36b('0x40')]=qs[_0xc36b('0x41')](_0x3305a7[_0xc36b('0x37')]['sort']);_0x434c47['where']=qs['filters'](_[_0xc36b('0x5b')](_0x3305a7['query'],_0x3c20b0['filters']));_0x434c47[_0xc36b('0x42')][_0xc36b('0x5c')]=_0x49f8ea['id'];if(_0x3305a7['query'][_0xc36b('0x43')]){_0x434c47[_0xc36b('0x42')]=_['merge'](_0x434c47['where'],{'$or':_['map'](_0x434c47['attributes'],function(_0x4a63d9){var _0x2653ca={};_0x2653ca[_0x4a63d9]={'$like':'%'+_0x3305a7[_0xc36b('0x37')][_0xc36b('0x43')]+'%'};return _0x2653ca;})});}_0x434c47=_[_0xc36b('0x44')]({},_0x434c47,_0x3305a7[_0xc36b('0x46')]);return db['UserSmsQueue'][_0xc36b('0x49')](_0x434c47);}})['then'](function(_0x8bc201){if(_0x8bc201){return db['User'][_0xc36b('0x5d')]({'where':{'id':_['map'](_0x8bc201,'UserId'),'role':_0xc36b('0x5e')},'attributes':['id','name',_0xc36b('0x5f'),_0xc36b('0x60'),_0xc36b('0x61')]});}})[_0xc36b('0x2a')](function(_0x2edb3f){if(_0x2edb3f){return{'count':_0x2edb3f[_0xc36b('0x24')],'rows':_[_0xc36b('0x32')](_0x2edb3f[_0xc36b('0x62')],function(_0x6d3f5a){return{'membername':_0x6d3f5a[_0xc36b('0x30')],'UserId':_0x6d3f5a['id'],'queue_name':_0x2750ab[_0xc36b('0x30')],'SmsQueueId':_0x2750ab['id'],'interface':util[_0xc36b('0x63')]('%s/%s',_0xc36b('0x64'),_0x6d3f5a[_0xc36b('0x30')]),'penalty':0x0,'paused':_0x6d3f5a[_0xc36b('0x5f')],'createdAt':_0x6d3f5a[_0xc36b('0x61')],'updatedAt':_0x6d3f5a[_0xc36b('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x279f5e,_0x434c47))[_0xc36b('0x4f')](handleError(_0x279f5e,null));};exports[_0xc36b('0x65')]=function(_0x1ca7ae,_0x50cac8,_0x5acea6){var _0x3b77ff={};var _0x4bcebe={};var _0x197c7e;var _0x23adcb;return db[_0xc36b('0x47')]['findOne']({'where':{'id':_0x1ca7ae[_0xc36b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50cac8,null))[_0xc36b('0x2a')](function(_0x3a9f9d){if(_0x3a9f9d){_0x197c7e=_0x3a9f9d;_0x4bcebe[_0xc36b('0x36')]=_[_0xc36b('0x38')](db['Team'][_0xc36b('0x33')]);_0x4bcebe['query']=_[_0xc36b('0x38')](_0x1ca7ae[_0xc36b('0x37')]);_0x4bcebe[_0xc36b('0x39')]=_['intersection'](_0x4bcebe[_0xc36b('0x36')],_0x4bcebe[_0xc36b('0x37')]);_0x3b77ff[_0xc36b('0x3b')]=_['intersection'](_0x4bcebe[_0xc36b('0x36')],qs[_0xc36b('0x3c')](_0x1ca7ae['query'][_0xc36b('0x3c')]));_0x3b77ff[_0xc36b('0x3b')]=_0x3b77ff[_0xc36b('0x3b')][_0xc36b('0x4c')]?_0x3b77ff[_0xc36b('0x3b')]:_0x4bcebe[_0xc36b('0x36')];_0x3b77ff[_0xc36b('0x40')]=qs[_0xc36b('0x41')](_0x1ca7ae['query']['sort']);_0x3b77ff[_0xc36b('0x42')]=qs[_0xc36b('0x39')](_[_0xc36b('0x5b')](_0x1ca7ae[_0xc36b('0x37')],_0x4bcebe[_0xc36b('0x39')]));if(_0x1ca7ae[_0xc36b('0x37')][_0xc36b('0x43')]){_0x3b77ff['where']=_[_0xc36b('0x44')](_0x3b77ff['where'],{'$or':_[_0xc36b('0x32')](_0x3b77ff[_0xc36b('0x3b')],function(_0x3e5401){var _0x1f138a={};_0x1f138a[_0x3e5401]={'$like':'%'+_0x1ca7ae[_0xc36b('0x37')][_0xc36b('0x43')]+'%'};return _0x1f138a;})});}_0x3b77ff=_['merge']({},_0x3b77ff,_0x1ca7ae[_0xc36b('0x46')]);return _0x197c7e[_0xc36b('0x65')](_0x3b77ff);}})[_0xc36b('0x2a')](function(_0x36f823){if(_0x36f823){_0x23adcb=_0x36f823[_0xc36b('0x4c')];if(!_0x1ca7ae[_0xc36b('0x37')][_0xc36b('0x3d')]('nolimit')){_0x3b77ff['limit']=qs['limit'](_0x1ca7ae[_0xc36b('0x37')][_0xc36b('0x3f')]);_0x3b77ff['offset']=qs[_0xc36b('0x22')](_0x1ca7ae[_0xc36b('0x37')]['offset']);}return _0x197c7e[_0xc36b('0x65')](_0x3b77ff);}})['then'](function(_0x1440bc){if(_0x1440bc){return _0x1440bc?{'count':_0x23adcb,'rows':_0x1440bc}:null;}})['then'](respondWithResult(_0x50cac8,null))[_0xc36b('0x4f')](handleError(_0x50cac8,null));};exports[_0xc36b('0x66')]=function(_0x3095fa,_0x4f5235,_0x5a86e9){var _0x2b8218=_0x3095fa['body'][_0xc36b('0x67')];return db['Team'][_0xc36b('0x49')]({'where':{'id':_0x2b8218},'attributes':['id'],'include':[{'model':db[_0xc36b('0x68')],'as':'Agents','attributes':['id','name','online',_0xc36b('0x69'),_0xc36b('0x6a')],'raw':!![]}]})['then'](function(_0x437ab5){if(_0x437ab5){var _0x2de64f=_['flatMap'](_0x437ab5,function(_0x38fa31){var _0x3f85b6=_0x38fa31[_0xc36b('0x52')]({'plain':!![]});return _0x3f85b6[_0xc36b('0x6b')];});return db[_0xc36b('0x47')][_0xc36b('0x4e')]({'where':{'id':_0x3095fa['params']['id']}})[_0xc36b('0x2a')](function(_0x3716bd){return db[_0xc36b('0x6c')][_0xc36b('0x6d')](function(_0x5b27ca){return _0x3716bd['addTeams'](_0x2b8218,{'transaction':_0x5b27ca})['then'](function(){return BPromise[_0xc36b('0x6e')](_0x2de64f,function(_0x6d2182){return db[_0xc36b('0x5a')][_0xc36b('0x6f')]({'where':{'UserId':_0x6d2182['id'],'SmsQueueId':_0x3095fa[_0xc36b('0x4b')]['id']},'transaction':_0x5b27ca});});})[_0xc36b('0x2a')](function(){_0x2de64f['forEach'](function(_0x4e4aeb){socket[_0xc36b('0x70')](_0xc36b('0x71'),{'UserId':_0x4e4aeb['id'],'SmsQueueId':_0x3716bd['id']});});});});});}})[_0xc36b('0x2a')](respondWithStatusCode(_0x4f5235,null))[_0xc36b('0x4f')](handleError(_0x4f5235,null));};exports[_0xc36b('0x72')]=function(_0x2510e5,_0x35a4a5,_0x65a8aa){return db[_0xc36b('0x73')]['findAll']({'where':{'id':_0x2510e5[_0xc36b('0x37')][_0xc36b('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc36b('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xc36b('0x2a')](handleEntityNotFound(_0x35a4a5,null))[_0xc36b('0x2a')](function(_0x1ac6d6){var _0x2e5104=_[_0xc36b('0x32')](_0x1ac6d6,'id');var _0x1704f6=[];var _0x42760a=[];var _0x38e5e7=squel[_0xc36b('0x74')]();_0x38e5e7['field'](_0xc36b('0x75'))[_0xc36b('0x76')](_0xc36b('0x77'),'tq')[_0xc36b('0x78')]('user_has_teams','ut',_0xc36b('0x79'))[_0xc36b('0x42')](_0xc36b('0x7a'),_0x2510e5[_0xc36b('0x4b')]['id']);for(var _0x50744=0x0;_0x50744<_0x1ac6d6[_0xc36b('0x4c')];_0x50744+=0x1){let _0x58c52c=_0x1ac6d6[_0x50744];for(var _0x4f0e2d=0x0;_0x4f0e2d<_0x58c52c[_0xc36b('0x6b')][_0xc36b('0x4c')];_0x4f0e2d+=0x1){let _0x580e71=_0x58c52c['Agents'][_0x4f0e2d];var _0x1e125d=_0x38e5e7[_0xc36b('0x7b')]();_0x1e125d['where'](_0xc36b('0x7c'),_0x580e71['id']);_0x42760a[_0xc36b('0x7d')](db[_0xc36b('0x6c')]['query'](_0x1e125d[_0xc36b('0x7e')](),{'type':db[_0xc36b('0x6c')][_0xc36b('0x7f')][_0xc36b('0x80')]})['then'](function(_0x366de0){if(_0x366de0[_0xc36b('0x4c')]===0x1){return _0x580e71['id'];}else{var _0x575149=_['every'](_[_0xc36b('0x32')](_0x366de0,_0xc36b('0x81')),function(_0x586d35){return _[_0xc36b('0x82')](_0x2e5104,_0x586d35);});if(_0x575149){return _0x580e71['id'];}}}));}}return BPromise[_0xc36b('0x83')](_0x42760a)[_0xc36b('0x2a')](function(_0x284523){_0x1704f6=_(_0x1704f6)['union'](_0x284523)[_0xc36b('0x84')]()[_0xc36b('0x85')]();return db[_0xc36b('0x47')][_0xc36b('0x4e')]({'where':{'id':_0x2510e5[_0xc36b('0x4b')]['id']}})[_0xc36b('0x2a')](function(_0x5330aa){return db['sequelize']['transaction'](function(_0x221e17){return _0x5330aa[_0xc36b('0x72')](_0x2510e5['query'][_0xc36b('0x67')],{'transaction':_0x221e17})['then'](function(){if(!_[_0xc36b('0x86')](_0x1704f6)){return _0x5330aa[_0xc36b('0x87')](_0x1704f6,{'transaction':_0x221e17});}})[_0xc36b('0x2a')](function(){_0x1704f6['forEach'](function(_0x82b3e8){socket['emit'](_0xc36b('0x88'),{'UserId':_0x82b3e8,'SmsQueueId':_0x5330aa['id']});});});});});});})[_0xc36b('0x2a')](respondWithStatusCode(_0x35a4a5,null))[_0xc36b('0x4f')](handleError(_0x35a4a5,null));};exports[_0xc36b('0x89')]=function(_0x163d0b,_0xdd51ac,_0x5de001){return db[_0xc36b('0x47')]['find']({'where':{'id':_0x163d0b['params']['id']}})[_0xc36b('0x2a')](handleEntityNotFound(_0xdd51ac,null))[_0xc36b('0x2a')](function(_0x17910b){if(_0x17910b){return _0x17910b['addAgents'](_0x163d0b[_0xc36b('0x57')][_0xc36b('0x67')],_[_0xc36b('0x8a')](_0x163d0b[_0xc36b('0x57')],['ids','id'])||{})['spread'](function(_0x481fe9){for(var _0x5100cf=0x0;_0x5100cf<_0x163d0b[_0xc36b('0x57')][_0xc36b('0x67')][_0xc36b('0x4c')];_0x5100cf+=0x1){socket['emit'](_0xc36b('0x71'),{'UserId':Number(_0x163d0b[_0xc36b('0x57')][_0xc36b('0x67')][_0x5100cf]),'SmsQueueId':Number(_0x163d0b[_0xc36b('0x4b')]['id'])});}return _0x481fe9;});}})[_0xc36b('0x2a')](respondWithResult(_0xdd51ac,null))[_0xc36b('0x4f')](handleError(_0xdd51ac,null));};exports['removeAgents']=function(_0x2edf42,_0x5aff14,_0x19b5bc){return db[_0xc36b('0x47')][_0xc36b('0x4e')]({'where':{'id':_0x2edf42[_0xc36b('0x4b')]['id']}})[_0xc36b('0x2a')](handleEntityNotFound(_0x5aff14,null))[_0xc36b('0x2a')](function(_0x5e8972){if(_0x5e8972){return _0x5e8972['removeAgents'](_0x2edf42[_0xc36b('0x37')][_0xc36b('0x67')])[_0xc36b('0x2a')](function(){if(_[_0xc36b('0x8b')](_0x2edf42[_0xc36b('0x37')][_0xc36b('0x67')])){for(var _0x3942bc=0x0;_0x3942bc<_0x2edf42[_0xc36b('0x37')][_0xc36b('0x67')][_0xc36b('0x4c')];_0x3942bc+=0x1){socket[_0xc36b('0x70')](_0xc36b('0x88'),{'UserId':Number(_0x2edf42[_0xc36b('0x37')][_0xc36b('0x67')][_0x3942bc]),'SmsQueueId':Number(_0x2edf42[_0xc36b('0x4b')]['id'])});}}else{socket[_0xc36b('0x70')](_0xc36b('0x88'),{'UserId':Number(_0x2edf42[_0xc36b('0x37')][_0xc36b('0x67')]),'SmsQueueId':Number(_0x2edf42['params']['id'])});}});}})[_0xc36b('0x2a')](respondWithStatusCode(_0x5aff14,null))[_0xc36b('0x4f')](handleError(_0x5aff14,null));};exports[_0xc36b('0x8c')]=function(_0x37449a,_0x1f9d3a,_0x42dba1){var _0x545317={};var _0x4b19a1={};var _0x41640d;var _0x5b208f;return db[_0xc36b('0x47')][_0xc36b('0x59')]({'where':{'id':_0x37449a[_0xc36b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1f9d3a,null))[_0xc36b('0x2a')](function(_0x3038d5){if(_0x3038d5){_0x41640d=_0x3038d5;_0x4b19a1['model']=_[_0xc36b('0x38')](db[_0xc36b('0x68')][_0xc36b('0x33')]);_0x4b19a1[_0xc36b('0x37')]=_[_0xc36b('0x38')](_0x37449a[_0xc36b('0x37')]);_0x4b19a1['filters']=_[_0xc36b('0x3a')](_0x4b19a1[_0xc36b('0x36')],_0x4b19a1['query']);_0x545317['attributes']=_[_0xc36b('0x3a')](_0x4b19a1[_0xc36b('0x36')],qs['fields'](_0x37449a[_0xc36b('0x37')][_0xc36b('0x3c')]));_0x545317['attributes']=_0x545317[_0xc36b('0x3b')][_0xc36b('0x4c')]?_0x545317['attributes']:_0x4b19a1[_0xc36b('0x36')];_0x545317[_0xc36b('0x40')]=qs[_0xc36b('0x41')](_0x37449a[_0xc36b('0x37')][_0xc36b('0x41')]);_0x545317[_0xc36b('0x42')]=qs[_0xc36b('0x39')](_['pick'](_0x37449a[_0xc36b('0x37')],_0x4b19a1[_0xc36b('0x39')]));if(_0x37449a['query'][_0xc36b('0x43')]){_0x545317['where']=_[_0xc36b('0x44')](_0x545317[_0xc36b('0x42')],{'$or':_[_0xc36b('0x32')](_0x545317['attributes'],function(_0xd47db0){var _0x13d9d2={};_0x13d9d2[_0xd47db0]={'$like':'%'+_0x37449a[_0xc36b('0x37')][_0xc36b('0x43')]+'%'};return _0x13d9d2;})});}_0x545317=_[_0xc36b('0x44')]({},_0x545317,_0x37449a[_0xc36b('0x46')]);return _0x41640d[_0xc36b('0x8c')](_0x545317);}})[_0xc36b('0x2a')](function(_0x33de4a){if(_0x33de4a){_0x5b208f=_0x33de4a[_0xc36b('0x4c')];if(!_0x37449a[_0xc36b('0x37')][_0xc36b('0x3d')]('nolimit')){_0x545317['limit']=qs[_0xc36b('0x3f')](_0x37449a[_0xc36b('0x37')]['limit']);_0x545317[_0xc36b('0x22')]=qs[_0xc36b('0x22')](_0x37449a[_0xc36b('0x37')][_0xc36b('0x22')]);}return _0x41640d[_0xc36b('0x8c')](_0x545317);}})['then'](function(_0x225ba7){if(_0x225ba7){return _0x225ba7?{'count':_0x5b208f,'rows':_0x225ba7}:null;}})[_0xc36b('0x2a')](respondWithResult(_0x1f9d3a,null))[_0xc36b('0x4f')](handleError(_0x1f9d3a,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 72f69e5..30fc5d9 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 _0x26f8=['SmsQueue','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x26f8,0x198));var _0x826f=function(_0x282f9a,_0x63dff){_0x282f9a=_0x282f9a-0x0;var _0x52528c=_0x26f8[_0x282f9a];return _0x52528c;};'use strict';var EventEmitter=require(_0x826f('0x0'));var SmsQueue=require(_0x826f('0x1'))['db'][_0x826f('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x826f('0x3')](0x0);var events={'afterCreate':_0x826f('0x4'),'afterUpdate':_0x826f('0x5'),'afterDestroy':_0x826f('0x6')};function emitEvent(_0x267ff5){return function(_0x18367b,_0x48f860,_0x5723c1){SmsQueueEvents[_0x826f('0x7')](_0x267ff5+':'+_0x18367b['id'],_0x18367b);SmsQueueEvents[_0x826f('0x7')](_0x267ff5,_0x18367b);_0x5723c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x826f('0x8')](e,emitEvent(event));}}module[_0x826f('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xea4e=['SmsQueue','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5916a3,_0x4c4e39){var _0x2dffb9=function(_0x276c83){while(--_0x276c83){_0x5916a3['push'](_0x5916a3['shift']());}};_0x2dffb9(++_0x4c4e39);}(_0xea4e,0x107));var _0xeea4=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0xea4e[_0x1c4409];return _0x356d8f;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xeea4('0x0'))['db'][_0xeea4('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeea4('0x2'),'afterUpdate':'update','afterDestroy':_0xeea4('0x3')};function emitEvent(_0x163199){return function(_0x5987d6,_0x40f0af,_0x5ad8da){SmsQueueEvents[_0xeea4('0x4')](_0x163199+':'+_0x5987d6['id'],_0x5987d6);SmsQueueEvents[_0xeea4('0x4')](_0x163199,_0x5987d6);_0x5ad8da(null);};}for(var e in events){if(events[_0xeea4('0x5')](e)){var event=events[e];SmsQueue[_0xeea4('0x6')](e,emitEvent(event));}}module[_0xeea4('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index fd1e237..054ed77 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 _0x1b30=['rimraf','../../config/environment','exports','define','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1c7e95,_0x58b83e){var _0x332109=function(_0x3c9c67){while(--_0x3c9c67){_0x1c7e95['push'](_0x1c7e95['shift']());}};_0x332109(++_0x58b83e);}(_0x1b30,0x101));var _0x01b3=function(_0x408bef,_0x55e8c4){_0x408bef=_0x408bef-0x0;var _0x3bc57c=_0x1b30[_0x408bef];return _0x3bc57c;};'use strict';var _=require(_0x01b3('0x0'));var util=require(_0x01b3('0x1'));var logger=require(_0x01b3('0x2'))('api');var moment=require(_0x01b3('0x3'));var BPromise=require(_0x01b3('0x4'));var rp=require(_0x01b3('0x5'));var fs=require('fs');var path=require(_0x01b3('0x6'));var rimraf=require(_0x01b3('0x7'));var config=require(_0x01b3('0x8'));var attributes=require('./smsQueue.attributes');module[_0x01b3('0x9')]=function(_0x2d53f6,_0x5be1b0){return _0x2d53f6[_0x01b3('0xa')]('SmsQueue',attributes,{'tableName':_0x01b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3a0=['../../config/logger','api','bluebird','rimraf','define','SmsQueue','sms_queues','util'];(function(_0x3d894c,_0x3754a1){var _0x4ed26f=function(_0x3a0eed){while(--_0x3a0eed){_0x3d894c['push'](_0x3d894c['shift']());}};_0x4ed26f(++_0x3754a1);}(_0xb3a0,0x14f));var _0x0b3a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb3a0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0b3a('0x0'));var logger=require(_0x0b3a('0x1'))(_0x0b3a('0x2'));var moment=require('moment');var BPromise=require(_0x0b3a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0b3a('0x4'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module['exports']=function(_0x304aea,_0x5286a5){return _0x304aea[_0x0b3a('0x5')](_0x0b3a('0x6'),attributes,{'tableName':_0x0b3a('0x7'),'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 a9fb25f..5898d5d 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 _0xfe7c=['localhost','socket.io-emitter','register','request','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','include','map','then','debug','find','model','ShowSmsQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x3e448a,_0x521003){var _0x1b8d2b=function(_0x435420){while(--_0x435420){_0x3e448a['push'](_0x3e448a['shift']());}};_0x1b8d2b(++_0x521003);}(_0xfe7c,0x166));var _0xcfe7=function(_0x4b2e2a,_0x96a242){_0x4b2e2a=_0x4b2e2a-0x0;var _0x23e063=_0xfe7c[_0x4b2e2a];return _0x23e063;};'use strict';var _=require('lodash');var util=require(_0xcfe7('0x0'));var moment=require(_0xcfe7('0x1'));var BPromise=require(_0xcfe7('0x2'));var rs=require(_0xcfe7('0x3'));var fs=require('fs');var Redis=require(_0xcfe7('0x4'));var db=require(_0xcfe7('0x5'))['db'];var utils=require(_0xcfe7('0x6'));var logger=require(_0xcfe7('0x7'))(_0xcfe7('0x8'));var config=require(_0xcfe7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfe7('0xa')]({'port':0x232a});config[_0xcfe7('0xb')]=_['defaults'](config['redis'],{'host':_0xcfe7('0xc'),'port':0x18eb});var socket=require(_0xcfe7('0xd'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xcfe7('0xe')](socket);function respondWithRpcPromise(_0x598d4d,_0x1f67ed,_0x13cbc4){return new BPromise(function(_0x23aebe,_0x2946d2){return client[_0xcfe7('0xf')](_0x598d4d,_0x13cbc4)['then'](function(_0x21e3bb){logger['info']('SmsQueue,\x20%s,\x20%s',_0x1f67ed,_0xcfe7('0x10'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1f67ed,_0xcfe7('0x10'),JSON[_0xcfe7('0x11')](_0x21e3bb));if(_0x21e3bb['error']){if(_0x21e3bb[_0xcfe7('0x12')]['code']===0x1f4){logger['error'](_0xcfe7('0x13'),_0x1f67ed,_0x21e3bb[_0xcfe7('0x12')]['message']);return _0x2946d2(_0x21e3bb[_0xcfe7('0x12')][_0xcfe7('0x14')]);}logger[_0xcfe7('0x12')](_0xcfe7('0x13'),_0x1f67ed,_0x21e3bb[_0xcfe7('0x12')]['message']);return _0x23aebe(_0x21e3bb[_0xcfe7('0x12')][_0xcfe7('0x14')]);}else{logger[_0xcfe7('0x15')](_0xcfe7('0x13'),_0x1f67ed,_0xcfe7('0x10'));_0x23aebe(_0x21e3bb[_0xcfe7('0x16')]['message']);}})[_0xcfe7('0x17')](function(_0x14f7d4){logger['error'](_0xcfe7('0x13'),_0x1f67ed,_0x14f7d4);_0x2946d2(_0x14f7d4);});});}exports[_0xcfe7('0x18')]=function(_0x1c900a){var _0xaf663d=this;return new Promise(function(_0x1c9d02,_0x24ba0c){return db[_0xcfe7('0x19')]['findAll']({'raw':_0x1c900a['options']?_0x1c900a[_0xcfe7('0x1a')][_0xcfe7('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c900a[_0xcfe7('0x1a')]?_0x1c900a[_0xcfe7('0x1a')][_0xcfe7('0x1c')]||null:null,'attributes':_0x1c900a[_0xcfe7('0x1a')]?_0x1c900a[_0xcfe7('0x1a')][_0xcfe7('0x1d')]||null:null,'limit':_0x1c900a[_0xcfe7('0x1a')]?_0x1c900a['options']['limit']||null:null,'include':_0x1c900a[_0xcfe7('0x1a')]?_0x1c900a[_0xcfe7('0x1a')][_0xcfe7('0x1e')]?_[_0xcfe7('0x1f')](_0x1c900a[_0xcfe7('0x1a')][_0xcfe7('0x1e')],function(_0x29fbbd){return{'model':db[_0x29fbbd['model']],'as':_0x29fbbd['as'],'attributes':_0x29fbbd['attributes'],'include':_0x29fbbd[_0xcfe7('0x1e')]?_[_0xcfe7('0x1f')](_0x29fbbd[_0xcfe7('0x1e')],function(_0x533858){return{'model':db[_0x533858['model']],'as':_0x533858['as'],'attributes':_0x533858[_0xcfe7('0x1d')],'include':_0x533858[_0xcfe7('0x1e')]?_[_0xcfe7('0x1f')](_0x533858[_0xcfe7('0x1e')],function(_0x154802){return{'model':db[_0x154802['model']],'as':_0x154802['as'],'attributes':_0x154802[_0xcfe7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcfe7('0x20')](function(_0x5040f7){logger[_0xcfe7('0x15')]('GetSmsQueue',_0x1c900a);logger[_0xcfe7('0x21')](_0xcfe7('0x18'),_0x1c900a,JSON[_0xcfe7('0x11')](_0x5040f7));_0x1c9d02(_0x5040f7);})[_0xcfe7('0x17')](function(_0x43d7d2){logger['error'](_0xcfe7('0x18'),_0x43d7d2[_0xcfe7('0x14')],_0x1c900a);_0x24ba0c(_0xaf663d['error'](0x1f4,_0x43d7d2[_0xcfe7('0x14')]));});});};exports['ShowSmsQueue']=function(_0x364096){var _0x17fc0b=this;return new Promise(function(_0x2d9060,_0x508efb){return db['SmsQueue'][_0xcfe7('0x22')]({'raw':_0x364096['options']?_0x364096[_0xcfe7('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x364096['options']?_0x364096[_0xcfe7('0x1a')][_0xcfe7('0x1c')]||null:null,'attributes':_0x364096[_0xcfe7('0x1a')]?_0x364096[_0xcfe7('0x1a')][_0xcfe7('0x1d')]||null:null,'include':_0x364096[_0xcfe7('0x1a')]?_0x364096[_0xcfe7('0x1a')][_0xcfe7('0x1e')]?_[_0xcfe7('0x1f')](_0x364096[_0xcfe7('0x1a')][_0xcfe7('0x1e')],function(_0x5c2a40){return{'model':db[_0x5c2a40['model']],'as':_0x5c2a40['as'],'attributes':_0x5c2a40['attributes'],'include':_0x5c2a40[_0xcfe7('0x1e')]?_[_0xcfe7('0x1f')](_0x5c2a40[_0xcfe7('0x1e')],function(_0x42db71){return{'model':db[_0x42db71[_0xcfe7('0x23')]],'as':_0x42db71['as'],'attributes':_0x42db71[_0xcfe7('0x1d')],'include':_0x42db71[_0xcfe7('0x1e')]?_[_0xcfe7('0x1f')](_0x42db71[_0xcfe7('0x1e')],function(_0x40eba5){return{'model':db[_0x40eba5[_0xcfe7('0x23')]],'as':_0x40eba5['as'],'attributes':_0x40eba5[_0xcfe7('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x438760){logger[_0xcfe7('0x15')](_0xcfe7('0x24'),_0x364096);logger[_0xcfe7('0x21')](_0xcfe7('0x24'),_0x364096,JSON[_0xcfe7('0x11')](_0x438760));_0x2d9060(_0x438760);})[_0xcfe7('0x17')](function(_0x337b5d){logger[_0xcfe7('0x12')](_0xcfe7('0x24'),_0x337b5d[_0xcfe7('0x14')],_0x364096);_0x508efb(_0x17fc0b['error'](0x1f4,_0x337b5d[_0xcfe7('0x14')]));});});}; \ No newline at end of file +var _0xa6eb=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetSmsQueue','stringify','ShowSmsQueue'];(function(_0x9817e7,_0x1d8098){var _0x56eccb=function(_0x5e71cc){while(--_0x5e71cc){_0x9817e7['push'](_0x9817e7['shift']());}};_0x56eccb(++_0x1d8098);}(_0xa6eb,0xcd));var _0xba6e=function(_0x431e8e,_0x482fd7){_0x431e8e=_0x431e8e-0x0;var _0x53396c=_0xa6eb[_0x431e8e];return _0x53396c;};'use strict';var _=require(_0xba6e('0x0'));var util=require(_0xba6e('0x1'));var moment=require('moment');var BPromise=require(_0xba6e('0x2'));var rs=require(_0xba6e('0x3'));var fs=require('fs');var Redis=require(_0xba6e('0x4'));var db=require(_0xba6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xba6e('0x6'))(_0xba6e('0x7'));var config=require(_0xba6e('0x8'));var jayson=require(_0xba6e('0x9'));var client=jayson[_0xba6e('0xa')][_0xba6e('0xb')]({'port':0x232a});config[_0xba6e('0xc')]=_[_0xba6e('0xd')](config['redis'],{'host':_0xba6e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba6e('0xc')]));require('./smsQueue.socket')[_0xba6e('0xf')](socket);function respondWithRpcPromise(_0x3a3f4d,_0x1128f0,_0x3f81b7){return new BPromise(function(_0x4f033f,_0x4a40d8){return client[_0xba6e('0x10')](_0x3a3f4d,_0x3f81b7)[_0xba6e('0x11')](function(_0x3a1332){logger[_0xba6e('0x12')](_0xba6e('0x13'),_0x1128f0,_0xba6e('0x14'));logger[_0xba6e('0x15')](_0xba6e('0x16'),_0x1128f0,_0xba6e('0x14'),JSON['stringify'](_0x3a1332));if(_0x3a1332[_0xba6e('0x17')]){if(_0x3a1332['error'][_0xba6e('0x18')]===0x1f4){logger[_0xba6e('0x17')](_0xba6e('0x13'),_0x1128f0,_0x3a1332['error'][_0xba6e('0x19')]);return _0x4a40d8(_0x3a1332[_0xba6e('0x17')][_0xba6e('0x19')]);}logger[_0xba6e('0x17')](_0xba6e('0x13'),_0x1128f0,_0x3a1332[_0xba6e('0x17')][_0xba6e('0x19')]);return _0x4f033f(_0x3a1332[_0xba6e('0x17')][_0xba6e('0x19')]);}else{logger[_0xba6e('0x12')](_0xba6e('0x13'),_0x1128f0,_0xba6e('0x14'));_0x4f033f(_0x3a1332[_0xba6e('0x1a')][_0xba6e('0x19')]);}})[_0xba6e('0x1b')](function(_0x87e71){logger[_0xba6e('0x17')](_0xba6e('0x13'),_0x1128f0,_0x87e71);_0x4a40d8(_0x87e71);});});}exports['GetSmsQueue']=function(_0x1eddf2){var _0x380c77=this;return new Promise(function(_0x888e59,_0xe0931b){return db[_0xba6e('0x1c')][_0xba6e('0x1d')]({'raw':_0x1eddf2['options']?_0x1eddf2[_0xba6e('0x1e')][_0xba6e('0x1f')]===undefined?!![]:![]:!![],'where':_0x1eddf2['options']?_0x1eddf2['options'][_0xba6e('0x20')]||null:null,'attributes':_0x1eddf2[_0xba6e('0x1e')]?_0x1eddf2[_0xba6e('0x1e')][_0xba6e('0x21')]||null:null,'limit':_0x1eddf2[_0xba6e('0x1e')]?_0x1eddf2[_0xba6e('0x1e')][_0xba6e('0x22')]||null:null,'include':_0x1eddf2[_0xba6e('0x1e')]?_0x1eddf2[_0xba6e('0x1e')]['include']?_[_0xba6e('0x23')](_0x1eddf2['options'][_0xba6e('0x24')],function(_0x2b0965){return{'model':db[_0x2b0965[_0xba6e('0x25')]],'as':_0x2b0965['as'],'attributes':_0x2b0965[_0xba6e('0x21')],'include':_0x2b0965['include']?_[_0xba6e('0x23')](_0x2b0965[_0xba6e('0x24')],function(_0x2e1a05){return{'model':db[_0x2e1a05[_0xba6e('0x25')]],'as':_0x2e1a05['as'],'attributes':_0x2e1a05[_0xba6e('0x21')],'include':_0x2e1a05[_0xba6e('0x24')]?_[_0xba6e('0x23')](_0x2e1a05[_0xba6e('0x24')],function(_0x48bcf7){return{'model':db[_0x48bcf7['model']],'as':_0x48bcf7['as'],'attributes':_0x48bcf7[_0xba6e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xba6e('0x11')](function(_0x42eef3){logger['info']('GetSmsQueue',_0x1eddf2);logger['debug'](_0xba6e('0x26'),_0x1eddf2,JSON[_0xba6e('0x27')](_0x42eef3));_0x888e59(_0x42eef3);})[_0xba6e('0x1b')](function(_0x49b16c){logger[_0xba6e('0x17')](_0xba6e('0x26'),_0x49b16c[_0xba6e('0x19')],_0x1eddf2);_0xe0931b(_0x380c77[_0xba6e('0x17')](0x1f4,_0x49b16c[_0xba6e('0x19')]));});});};exports[_0xba6e('0x28')]=function(_0x3060f2){var _0x37f7ba=this;return new Promise(function(_0x5c6a85,_0x276485){return db['SmsQueue']['find']({'raw':_0x3060f2[_0xba6e('0x1e')]?_0x3060f2[_0xba6e('0x1e')][_0xba6e('0x1f')]===undefined?!![]:![]:!![],'where':_0x3060f2[_0xba6e('0x1e')]?_0x3060f2[_0xba6e('0x1e')][_0xba6e('0x20')]||null:null,'attributes':_0x3060f2[_0xba6e('0x1e')]?_0x3060f2[_0xba6e('0x1e')][_0xba6e('0x21')]||null:null,'include':_0x3060f2[_0xba6e('0x1e')]?_0x3060f2['options'][_0xba6e('0x24')]?_[_0xba6e('0x23')](_0x3060f2[_0xba6e('0x1e')][_0xba6e('0x24')],function(_0x12b3a7){return{'model':db[_0x12b3a7[_0xba6e('0x25')]],'as':_0x12b3a7['as'],'attributes':_0x12b3a7[_0xba6e('0x21')],'include':_0x12b3a7[_0xba6e('0x24')]?_[_0xba6e('0x23')](_0x12b3a7['include'],function(_0x23c438){return{'model':db[_0x23c438[_0xba6e('0x25')]],'as':_0x23c438['as'],'attributes':_0x23c438[_0xba6e('0x21')],'include':_0x23c438[_0xba6e('0x24')]?_[_0xba6e('0x23')](_0x23c438[_0xba6e('0x24')],function(_0x47f920){return{'model':db[_0x47f920[_0xba6e('0x25')]],'as':_0x47f920['as'],'attributes':_0x47f920['attributes']};}):[]};}):[]};}):[]:[]})[_0xba6e('0x11')](function(_0x1560ef){logger[_0xba6e('0x12')](_0xba6e('0x28'),_0x3060f2);logger['debug'](_0xba6e('0x28'),_0x3060f2,JSON[_0xba6e('0x27')](_0x1560ef));_0x5c6a85(_0x1560ef);})[_0xba6e('0x1b')](function(_0x5792cd){logger[_0xba6e('0x17')]('ShowSmsQueue',_0x5792cd[_0xba6e('0x19')],_0x3060f2);_0x276485(_0x37f7ba['error'](0x1f4,_0x5792cd['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 07f4d31..18cd647 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 _0x224d=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x4e18a1,_0x3f641a){var _0x1722c8=function(_0x1c5cc2){while(--_0x1c5cc2){_0x4e18a1['push'](_0x4e18a1['shift']());}};_0x1722c8(++_0x3f641a);}(_0x224d,0x1a3));var _0xd224=function(_0x4d682d,_0x5d4a79){_0x4d682d=_0x4d682d-0x0;var _0x50eeff=_0x224d[_0x4d682d];return _0x50eeff;};'use strict';var SmsQueueEvents=require(_0xd224('0x0'));var events=[_0xd224('0x1'),_0xd224('0x2'),_0xd224('0x3')];function createListener(_0x5790aa,_0xb8a75c){return function(_0x4c6d72){_0xb8a75c[_0xd224('0x4')](_0x5790aa,_0x4c6d72);};}function removeListener(_0x395423,_0x31b91e){return function(){SmsQueueEvents[_0xd224('0x5')](_0x395423,_0x31b91e);};}exports[_0xd224('0x6')]=function(_0x1672ff){for(var _0x3575e9=0x0,_0x2dc745=events[_0xd224('0x7')];_0x3575e9<_0x2dc745;_0x3575e9++){var _0x27713a=events[_0x3575e9];var _0x375544=createListener(_0xd224('0x8')+_0x27713a,_0x1672ff);SmsQueueEvents['on'](_0x27713a,_0x375544);}}; \ No newline at end of file +var _0xe86d=['length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x23739c,_0x462750){var _0x1e1e2d=function(_0x3ac8ba){while(--_0x3ac8ba){_0x23739c['push'](_0x23739c['shift']());}};_0x1e1e2d(++_0x462750);}(_0xe86d,0xb6));var _0xde86=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe86d[_0x321bb2];return _0x9c12ed;};'use strict';var SmsQueueEvents=require(_0xde86('0x0'));var events=[_0xde86('0x1'),_0xde86('0x2'),_0xde86('0x3')];function createListener(_0x35a667,_0x180759){return function(_0x532746){_0x180759[_0xde86('0x4')](_0x35a667,_0x532746);};}function removeListener(_0x51e0d2,_0x4fc5ba){return function(){SmsQueueEvents[_0xde86('0x5')](_0x51e0d2,_0x4fc5ba);};}exports[_0xde86('0x6')]=function(_0x25b3c3){for(var _0x849232=0x0,_0x2d7aca=events[_0xde86('0x7')];_0x849232<_0x2d7aca;_0x849232++){var _0x3ff3dc=events[_0x849232];var _0x36a0b6=createListener(_0xde86('0x8')+_0x3ff3dc,_0x25b3c3);SmsQueueEvents['on'](_0x3ff3dc,_0x36a0b6);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 67063b4..b094b7a 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 _0x43e8=['/describe','describe','show','post','create','put','/:id','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x28abee,_0x9da7f6){var _0x1c931f=function(_0x5cf785){while(--_0x5cf785){_0x28abee['push'](_0x28abee['shift']());}};_0x1c931f(++_0x9da7f6);}(_0x43e8,0x81));var _0x843e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x43e8[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x843e('0x0'));var util=require(_0x843e('0x1'));var path=require(_0x843e('0x2'));var timeout=require('connect-timeout');var express=require(_0x843e('0x3'));var router=express[_0x843e('0x4')]();var fs_extra=require(_0x843e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x843e('0x6'));var config=require(_0x843e('0x7'));var controller=require('./smsQueueReport.controller');router[_0x843e('0x8')]('/',auth[_0x843e('0x9')](),controller[_0x843e('0xa')]);router[_0x843e('0x8')](_0x843e('0xb'),auth[_0x843e('0x9')](),controller[_0x843e('0xc')]);router['get']('/:id',auth[_0x843e('0x9')](),controller[_0x843e('0xd')]);router[_0x843e('0xe')]('/',auth['isAuthenticated'](),controller[_0x843e('0xf')]);router[_0x843e('0x10')](_0x843e('0x11'),auth[_0x843e('0x9')](),controller[_0x843e('0x12')]);router[_0x843e('0x13')](_0x843e('0x11'),auth[_0x843e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa39b=['show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x1c794d,_0x174300){var _0x2428b5=function(_0x24ca3f){while(--_0x24ca3f){_0x1c794d['push'](_0x1c794d['shift']());}};_0x2428b5(++_0x174300);}(_0xa39b,0xee));var _0xba39=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa39b[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xba39('0x0'));var util=require(_0xba39('0x1'));var path=require(_0xba39('0x2'));var timeout=require(_0xba39('0x3'));var express=require(_0xba39('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xba39('0x5'));var interaction=require(_0xba39('0x6'));var config=require(_0xba39('0x7'));var controller=require(_0xba39('0x8'));router['get']('/',auth[_0xba39('0x9')](),controller[_0xba39('0xa')]);router[_0xba39('0xb')](_0xba39('0xc'),auth['isAuthenticated'](),controller[_0xba39('0xd')]);router['get']('/:id',auth[_0xba39('0x9')](),controller[_0xba39('0xe')]);router[_0xba39('0xf')]('/',auth['isAuthenticated'](),controller[_0xba39('0x10')]);router[_0xba39('0x11')](_0xba39('0x12'),auth[_0xba39('0x9')](),controller[_0xba39('0x13')]);router['delete'](_0xba39('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xba39('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 18841e8..7efb2d8 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 _0x60ba=['exports','STRING','DATE','sequelize'];(function(_0x2579a6,_0x1955a3){var _0x5bb1c4=function(_0x2bb8e9){while(--_0x2bb8e9){_0x2579a6['push'](_0x2579a6['shift']());}};_0x5bb1c4(++_0x1955a3);}(_0x60ba,0x16f));var _0xa60b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x60ba[_0x1facfa];return _0x9ec701;};'use strict';var moment=require('moment');var Sequelize=require(_0xa60b('0x0'));module[_0xa60b('0x1')]={'uniqueid':{'type':Sequelize[_0xa60b('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa60b('0x3')]},'leaveAt':{'type':Sequelize[_0xa60b('0x3')]},'acceptAt':{'type':Sequelize[_0xa60b('0x3')]},'exitAt':{'type':Sequelize[_0xa60b('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcad3=['DATE','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcad3,0xc4));var _0x3cad=function(_0x47fb54,_0x28698c){_0x47fb54=_0x47fb54-0x0;var _0x1139a7=_0xcad3[_0x47fb54];return _0x1139a7;};'use strict';var moment=require('moment');var Sequelize=require(_0x3cad('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3cad('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3cad('0x1')]},'joinAt':{'type':Sequelize[_0x3cad('0x2')]},'leaveAt':{'type':Sequelize[_0x3cad('0x2')]},'acceptAt':{'type':Sequelize[_0x3cad('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3cad('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0160938..e8d6a54 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 _0xc035=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','SmsQueueReport','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0xc035,0xd6));var _0x5c03=function(_0x650cfc,_0x33ede8){_0x650cfc=_0x650cfc-0x0;var _0x420005=_0xc035[_0x650cfc];return _0x420005;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c03('0x0'));var zipdir=require(_0x5c03('0x1'));var jsonpatch=require(_0x5c03('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5c03('0x3'));var util=require(_0x5c03('0x4'));var path=require(_0x5c03('0x5'));var sox=require(_0x5c03('0x6'));var csv=require(_0x5c03('0x7'));var ejs=require(_0x5c03('0x8'));var fs=require('fs');var fs_extra=require(_0x5c03('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c03('0xa'));var jsforce=require(_0x5c03('0xb'));var deskjs=require(_0x5c03('0xc'));var toCsv=require(_0x5c03('0x7'));var querystring=require(_0x5c03('0xd'));var Papa=require(_0x5c03('0xe'));var Redis=require(_0x5c03('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5c03('0x10'));var as=require(_0x5c03('0x11'));var hardwareService=require(_0x5c03('0x12'));var logger=require(_0x5c03('0x13'))('api');var utils=require(_0x5c03('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5c03('0x15'))['db'];function respondWithStatusCode(_0x3c547b,_0x2c5aeb){_0x2c5aeb=_0x2c5aeb||0xcc;return function(_0x24125c){if(_0x24125c){return _0x3c547b[_0x5c03('0x16')](_0x2c5aeb);}return _0x3c547b[_0x5c03('0x17')](_0x2c5aeb)[_0x5c03('0x18')]();};}function respondWithResult(_0x2b4fcb,_0x3fe14a){_0x3fe14a=_0x3fe14a||0xc8;return function(_0x48bc32){if(_0x48bc32){return _0x2b4fcb[_0x5c03('0x17')](_0x3fe14a)[_0x5c03('0x19')](_0x48bc32);}};}function respondWithFilteredResult(_0x2f4e54,_0x11893a){return function(_0x547fbf){if(_0x547fbf){var _0x6cd770=typeof _0x11893a[_0x5c03('0x1a')]===_0x5c03('0x1b')&&typeof _0x11893a[_0x5c03('0x1c')]===_0x5c03('0x1b');var _0x2ed115=_0x547fbf[_0x5c03('0x1d')];var _0x3a17f2=_0x6cd770?0x0:_0x11893a['offset'];var _0x218b64=_0x6cd770?_0x547fbf[_0x5c03('0x1d')]:_0x11893a[_0x5c03('0x1a')]+_0x11893a[_0x5c03('0x1c')];var _0x429f2c;if(_0x218b64>=_0x2ed115){_0x218b64=_0x2ed115;_0x429f2c=0xc8;}else{_0x429f2c=0xce;}_0x2f4e54[_0x5c03('0x17')](_0x429f2c);return _0x2f4e54['set'](_0x5c03('0x1e'),_0x3a17f2+'-'+_0x218b64+'/'+_0x2ed115)[_0x5c03('0x19')](_0x547fbf);}return null;};}function patchUpdates(_0x165c11){return function(_0x14238d){try{jsonpatch[_0x5c03('0x1f')](_0x14238d,_0x165c11,!![]);}catch(_0x4ee098){return BPromise['reject'](_0x4ee098);}return _0x14238d[_0x5c03('0x20')]();};}function saveUpdates(_0x5300f9,_0x3bb096){return function(_0x41bc03){if(_0x41bc03){return _0x41bc03[_0x5c03('0x21')](_0x5300f9)[_0x5c03('0x22')](function(_0x1cb779){return _0x1cb779;});}return null;};}function removeEntity(_0x34b56c,_0x300ef9){return function(_0x1b46f3){if(_0x1b46f3){return _0x1b46f3[_0x5c03('0x23')]()[_0x5c03('0x22')](function(){_0x34b56c['status'](0xcc)[_0x5c03('0x18')]();});}};}function handleEntityNotFound(_0x43fd9e,_0x26cb5e){return function(_0x295601){if(!_0x295601){_0x43fd9e[_0x5c03('0x16')](0x194);}return _0x295601;};}function handleError(_0x2e116b,_0xcacac8){_0xcacac8=_0xcacac8||0x1f4;return function(_0x4ac6d7){logger[_0x5c03('0x24')](_0x4ac6d7[_0x5c03('0x25')]);if(_0x4ac6d7[_0x5c03('0x26')]){delete _0x4ac6d7[_0x5c03('0x26')];}_0x2e116b[_0x5c03('0x17')](_0xcacac8)[_0x5c03('0x27')](_0x4ac6d7);};}exports[_0x5c03('0x28')]=function(_0x1a4925,_0x260811){var _0x50dbf4={},_0x35405c={},_0x99050b={'count':0x0,'rows':[]};var _0x30f423=_[_0x5c03('0x29')](db['SmsQueueReport'][_0x5c03('0x2a')],function(_0x2b4269){return{'name':_0x2b4269[_0x5c03('0x2b')],'type':_0x2b4269[_0x5c03('0x2c')][_0x5c03('0x2d')]};});_0x35405c['model']=_[_0x5c03('0x29')](_0x30f423,_0x5c03('0x26'));_0x35405c[_0x5c03('0x2e')]=_['keys'](_0x1a4925[_0x5c03('0x2e')]);_0x35405c[_0x5c03('0x2f')]=_[_0x5c03('0x30')](_0x35405c['model'],_0x35405c[_0x5c03('0x2e')]);_0x50dbf4[_0x5c03('0x31')]=_[_0x5c03('0x30')](_0x35405c['model'],qs[_0x5c03('0x32')](_0x1a4925[_0x5c03('0x2e')][_0x5c03('0x32')]));_0x50dbf4['attributes']=_0x50dbf4['attributes'][_0x5c03('0x33')]?_0x50dbf4[_0x5c03('0x31')]:_0x35405c[_0x5c03('0x34')];if(!_0x1a4925['query'][_0x5c03('0x35')](_0x5c03('0x36'))){_0x50dbf4[_0x5c03('0x1c')]=qs[_0x5c03('0x1c')](_0x1a4925[_0x5c03('0x2e')]['limit']);_0x50dbf4['offset']=qs[_0x5c03('0x1a')](_0x1a4925[_0x5c03('0x2e')][_0x5c03('0x1a')]);}_0x50dbf4[_0x5c03('0x37')]=qs['sort'](_0x1a4925[_0x5c03('0x2e')]['sort']);_0x50dbf4[_0x5c03('0x38')]=qs['filters'](_[_0x5c03('0x39')](_0x1a4925[_0x5c03('0x2e')],_0x35405c['filters']),_0x30f423);if(_0x1a4925['query'][_0x5c03('0x3a')]){_0x50dbf4[_0x5c03('0x38')]=_[_0x5c03('0x3b')](_0x50dbf4[_0x5c03('0x38')],{'$or':_[_0x5c03('0x29')](_0x30f423,function(_0x580496){if(_0x580496[_0x5c03('0x2c')]!==_0x5c03('0x3c')){var _0x111f6a={};_0x111f6a[_0x580496[_0x5c03('0x26')]]={'$like':'%'+_0x1a4925[_0x5c03('0x2e')][_0x5c03('0x3a')]+'%'};return _0x111f6a;}})});}_0x50dbf4=_['merge']({},_0x50dbf4,_0x1a4925['options']);var _0x4cf091={'where':_0x50dbf4[_0x5c03('0x38')]};return db[_0x5c03('0x3d')][_0x5c03('0x1d')](_0x4cf091)[_0x5c03('0x22')](function(_0x4ab49a){_0x99050b[_0x5c03('0x1d')]=_0x4ab49a;if(_0x1a4925[_0x5c03('0x2e')][_0x5c03('0x3e')]){_0x50dbf4[_0x5c03('0x3f')]=[{'all':!![]}];}return db[_0x5c03('0x3d')][_0x5c03('0x40')](_0x50dbf4);})[_0x5c03('0x22')](function(_0x2903ee){_0x99050b[_0x5c03('0x41')]=_0x2903ee;return _0x99050b;})[_0x5c03('0x22')](respondWithFilteredResult(_0x260811,_0x50dbf4))[_0x5c03('0x42')](handleError(_0x260811,null));};exports[_0x5c03('0x43')]=function(_0x10e1ba,_0x20a0aa){var _0x3d9ca4={'raw':!![],'where':{'id':_0x10e1ba['params']['id']}},_0x27e213={};_0x27e213[_0x5c03('0x34')]=_['keys'](db['SmsQueueReport']['rawAttributes']);_0x27e213[_0x5c03('0x2e')]=_[_0x5c03('0x44')](_0x10e1ba[_0x5c03('0x2e')]);_0x27e213[_0x5c03('0x2f')]=_['intersection'](_0x27e213[_0x5c03('0x34')],_0x27e213['query']);_0x3d9ca4[_0x5c03('0x31')]=_['intersection'](_0x27e213[_0x5c03('0x34')],qs[_0x5c03('0x32')](_0x10e1ba[_0x5c03('0x2e')][_0x5c03('0x32')]));_0x3d9ca4[_0x5c03('0x31')]=_0x3d9ca4[_0x5c03('0x31')]['length']?_0x3d9ca4[_0x5c03('0x31')]:_0x27e213[_0x5c03('0x34')];if(_0x10e1ba[_0x5c03('0x2e')][_0x5c03('0x3e')]){_0x3d9ca4[_0x5c03('0x3f')]=[{'all':!![]}];}_0x3d9ca4=_['merge']({},_0x3d9ca4,_0x10e1ba['options']);return db[_0x5c03('0x3d')][_0x5c03('0x45')](_0x3d9ca4)[_0x5c03('0x22')](handleEntityNotFound(_0x20a0aa,null))[_0x5c03('0x22')](respondWithResult(_0x20a0aa,null))[_0x5c03('0x42')](handleError(_0x20a0aa,null));};exports[_0x5c03('0x46')]=function(_0x2f05fd,_0x2f89ef){return db[_0x5c03('0x3d')][_0x5c03('0x46')](_0x2f05fd[_0x5c03('0x47')],{})[_0x5c03('0x22')](respondWithResult(_0x2f89ef,0xc9))[_0x5c03('0x42')](handleError(_0x2f89ef,null));};exports['update']=function(_0x2dda3f,_0x9b1e79){if(_0x2dda3f[_0x5c03('0x47')]['id']){delete _0x2dda3f[_0x5c03('0x47')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x2dda3f[_0x5c03('0x48')]['id']}})[_0x5c03('0x22')](handleEntityNotFound(_0x9b1e79,null))['then'](saveUpdates(_0x2dda3f['body'],null))[_0x5c03('0x22')](respondWithResult(_0x9b1e79,null))[_0x5c03('0x42')](handleError(_0x9b1e79,null));};exports[_0x5c03('0x23')]=function(_0x357524,_0x1b671b){return db['SmsQueueReport'][_0x5c03('0x45')]({'where':{'id':_0x357524[_0x5c03('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b671b,null))['then'](removeEntity(_0x1b671b,null))[_0x5c03('0x42')](handleError(_0x1b671b,null));};exports[_0x5c03('0x49')]=function(_0x5a8b65,_0x51142a){return db['SmsQueueReport'][_0x5c03('0x49')]()[_0x5c03('0x22')](respondWithResult(_0x51142a,null))[_0x5c03('0x42')](handleError(_0x51142a,null));}; \ No newline at end of file +var _0xe1df=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x170941,_0x38d105){var _0x50e48d=function(_0x1eb49a){while(--_0x1eb49a){_0x170941['push'](_0x170941['shift']());}};_0x50e48d(++_0x38d105);}(_0xe1df,0xd3));var _0xfe1d=function(_0x5c3cab,_0x5ee797){_0x5c3cab=_0x5c3cab-0x0;var _0x2b3fe3=_0xe1df[_0x5c3cab];return _0x2b3fe3;};'use strict';var emlformat=require(_0xfe1d('0x0'));var rimraf=require(_0xfe1d('0x1'));var zipdir=require(_0xfe1d('0x2'));var jsonpatch=require(_0xfe1d('0x3'));var rp=require(_0xfe1d('0x4'));var moment=require('moment');var BPromise=require(_0xfe1d('0x5'));var Mustache=require(_0xfe1d('0x6'));var util=require('util');var path=require(_0xfe1d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfe1d('0x8'));var fs=require('fs');var fs_extra=require(_0xfe1d('0x9'));var _=require(_0xfe1d('0xa'));var squel=require('squel');var crypto=require(_0xfe1d('0xb'));var jsforce=require(_0xfe1d('0xc'));var deskjs=require(_0xfe1d('0xd'));var toCsv=require(_0xfe1d('0xe'));var querystring=require(_0xfe1d('0xf'));var Papa=require(_0xfe1d('0x10'));var Redis=require('ioredis');var authService=require(_0xfe1d('0x11'));var qs=require(_0xfe1d('0x12'));var as=require(_0xfe1d('0x13'));var hardwareService=require(_0xfe1d('0x14'));var logger=require(_0xfe1d('0x15'))('api');var utils=require(_0xfe1d('0x16'));var config=require(_0xfe1d('0x17'));var licenseUtil=require(_0xfe1d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ec885,_0x3acbc5){_0x3acbc5=_0x3acbc5||0xcc;return function(_0x5c8946){if(_0x5c8946){return _0x2ec885[_0xfe1d('0x19')](_0x3acbc5);}return _0x2ec885['status'](_0x3acbc5)[_0xfe1d('0x1a')]();};}function respondWithResult(_0x79e804,_0x598e94){_0x598e94=_0x598e94||0xc8;return function(_0x56fa7f){if(_0x56fa7f){return _0x79e804[_0xfe1d('0x1b')](_0x598e94)[_0xfe1d('0x1c')](_0x56fa7f);}};}function respondWithFilteredResult(_0xf07784,_0xec96de){return function(_0x47ab21){if(_0x47ab21){var _0x374b46=typeof _0xec96de['offset']===_0xfe1d('0x1d')&&typeof _0xec96de[_0xfe1d('0x1e')]===_0xfe1d('0x1d');var _0x2b328f=_0x47ab21[_0xfe1d('0x1f')];var _0x40a08f=_0x374b46?0x0:_0xec96de[_0xfe1d('0x20')];var _0x639e50=_0x374b46?_0x47ab21[_0xfe1d('0x1f')]:_0xec96de[_0xfe1d('0x20')]+_0xec96de[_0xfe1d('0x1e')];var _0x13836f;if(_0x639e50>=_0x2b328f){_0x639e50=_0x2b328f;_0x13836f=0xc8;}else{_0x13836f=0xce;}_0xf07784[_0xfe1d('0x1b')](_0x13836f);return _0xf07784[_0xfe1d('0x21')]('Content-Range',_0x40a08f+'-'+_0x639e50+'/'+_0x2b328f)[_0xfe1d('0x1c')](_0x47ab21);}return null;};}function patchUpdates(_0x799084){return function(_0x1965ea){try{jsonpatch[_0xfe1d('0x22')](_0x1965ea,_0x799084,!![]);}catch(_0x507bcb){return BPromise[_0xfe1d('0x23')](_0x507bcb);}return _0x1965ea[_0xfe1d('0x24')]();};}function saveUpdates(_0x40f31c,_0x401b89){return function(_0x134311){if(_0x134311){return _0x134311['update'](_0x40f31c)[_0xfe1d('0x25')](function(_0x1b6906){return _0x1b6906;});}return null;};}function removeEntity(_0x187892,_0xf4d829){return function(_0x1d613b){if(_0x1d613b){return _0x1d613b['destroy']()[_0xfe1d('0x25')](function(){_0x187892[_0xfe1d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3309c7,_0x3df4c8){return function(_0x2e73cd){if(!_0x2e73cd){_0x3309c7[_0xfe1d('0x19')](0x194);}return _0x2e73cd;};}function handleError(_0x5306d7,_0x1ca696){_0x1ca696=_0x1ca696||0x1f4;return function(_0x195973){logger['error'](_0x195973[_0xfe1d('0x26')]);if(_0x195973['name']){delete _0x195973[_0xfe1d('0x27')];}_0x5306d7[_0xfe1d('0x1b')](_0x1ca696)[_0xfe1d('0x28')](_0x195973);};}exports[_0xfe1d('0x29')]=function(_0x1c5017,_0x49d658){var _0x382366={},_0xb667a8={},_0x3ebe14={'count':0x0,'rows':[]};var _0x51c1a6=_[_0xfe1d('0x2a')](db[_0xfe1d('0x2b')][_0xfe1d('0x2c')],function(_0x22ee31){return{'name':_0x22ee31[_0xfe1d('0x2d')],'type':_0x22ee31['type'][_0xfe1d('0x2e')]};});_0xb667a8[_0xfe1d('0x2f')]=_['map'](_0x51c1a6,_0xfe1d('0x27'));_0xb667a8['query']=_[_0xfe1d('0x30')](_0x1c5017[_0xfe1d('0x31')]);_0xb667a8[_0xfe1d('0x32')]=_['intersection'](_0xb667a8[_0xfe1d('0x2f')],_0xb667a8[_0xfe1d('0x31')]);_0x382366[_0xfe1d('0x33')]=_[_0xfe1d('0x34')](_0xb667a8[_0xfe1d('0x2f')],qs[_0xfe1d('0x35')](_0x1c5017['query']['fields']));_0x382366['attributes']=_0x382366[_0xfe1d('0x33')][_0xfe1d('0x36')]?_0x382366['attributes']:_0xb667a8[_0xfe1d('0x2f')];if(!_0x1c5017['query'][_0xfe1d('0x37')](_0xfe1d('0x38'))){_0x382366[_0xfe1d('0x1e')]=qs[_0xfe1d('0x1e')](_0x1c5017['query'][_0xfe1d('0x1e')]);_0x382366[_0xfe1d('0x20')]=qs['offset'](_0x1c5017['query'][_0xfe1d('0x20')]);}_0x382366['order']=qs['sort'](_0x1c5017[_0xfe1d('0x31')][_0xfe1d('0x39')]);_0x382366['where']=qs[_0xfe1d('0x32')](_['pick'](_0x1c5017[_0xfe1d('0x31')],_0xb667a8[_0xfe1d('0x32')]),_0x51c1a6);if(_0x1c5017[_0xfe1d('0x31')][_0xfe1d('0x3a')]){_0x382366[_0xfe1d('0x3b')]=_[_0xfe1d('0x3c')](_0x382366[_0xfe1d('0x3b')],{'$or':_['map'](_0x51c1a6,function(_0x3fe71e){if(_0x3fe71e[_0xfe1d('0x3d')]!==_0xfe1d('0x3e')){var _0x47b122={};_0x47b122[_0x3fe71e[_0xfe1d('0x27')]]={'$like':'%'+_0x1c5017[_0xfe1d('0x31')][_0xfe1d('0x3a')]+'%'};return _0x47b122;}})});}_0x382366=_[_0xfe1d('0x3c')]({},_0x382366,_0x1c5017[_0xfe1d('0x3f')]);var _0x1fba67={'where':_0x382366[_0xfe1d('0x3b')]};return db[_0xfe1d('0x2b')][_0xfe1d('0x1f')](_0x1fba67)['then'](function(_0x593899){_0x3ebe14[_0xfe1d('0x1f')]=_0x593899;if(_0x1c5017[_0xfe1d('0x31')][_0xfe1d('0x40')]){_0x382366[_0xfe1d('0x41')]=[{'all':!![]}];}return db[_0xfe1d('0x2b')]['findAll'](_0x382366);})[_0xfe1d('0x25')](function(_0x1b37ef){_0x3ebe14[_0xfe1d('0x42')]=_0x1b37ef;return _0x3ebe14;})[_0xfe1d('0x25')](respondWithFilteredResult(_0x49d658,_0x382366))[_0xfe1d('0x43')](handleError(_0x49d658,null));};exports[_0xfe1d('0x44')]=function(_0x2732e8,_0x423a92){var _0x59d371={'raw':!![],'where':{'id':_0x2732e8[_0xfe1d('0x45')]['id']}},_0x1de49e={};_0x1de49e['model']=_[_0xfe1d('0x30')](db[_0xfe1d('0x2b')]['rawAttributes']);_0x1de49e[_0xfe1d('0x31')]=_['keys'](_0x2732e8[_0xfe1d('0x31')]);_0x1de49e['filters']=_[_0xfe1d('0x34')](_0x1de49e[_0xfe1d('0x2f')],_0x1de49e[_0xfe1d('0x31')]);_0x59d371['attributes']=_[_0xfe1d('0x34')](_0x1de49e[_0xfe1d('0x2f')],qs[_0xfe1d('0x35')](_0x2732e8[_0xfe1d('0x31')][_0xfe1d('0x35')]));_0x59d371[_0xfe1d('0x33')]=_0x59d371[_0xfe1d('0x33')][_0xfe1d('0x36')]?_0x59d371[_0xfe1d('0x33')]:_0x1de49e['model'];if(_0x2732e8[_0xfe1d('0x31')][_0xfe1d('0x40')]){_0x59d371[_0xfe1d('0x41')]=[{'all':!![]}];}_0x59d371=_[_0xfe1d('0x3c')]({},_0x59d371,_0x2732e8['options']);return db['SmsQueueReport'][_0xfe1d('0x46')](_0x59d371)[_0xfe1d('0x25')](handleEntityNotFound(_0x423a92,null))[_0xfe1d('0x25')](respondWithResult(_0x423a92,null))[_0xfe1d('0x43')](handleError(_0x423a92,null));};exports[_0xfe1d('0x47')]=function(_0x4d951f,_0x133412){return db[_0xfe1d('0x2b')][_0xfe1d('0x47')](_0x4d951f[_0xfe1d('0x48')],{})[_0xfe1d('0x25')](respondWithResult(_0x133412,0xc9))['catch'](handleError(_0x133412,null));};exports[_0xfe1d('0x49')]=function(_0x5c607f,_0x208541){if(_0x5c607f[_0xfe1d('0x48')]['id']){delete _0x5c607f[_0xfe1d('0x48')]['id'];}return db[_0xfe1d('0x2b')][_0xfe1d('0x46')]({'where':{'id':_0x5c607f[_0xfe1d('0x45')]['id']}})[_0xfe1d('0x25')](handleEntityNotFound(_0x208541,null))[_0xfe1d('0x25')](saveUpdates(_0x5c607f[_0xfe1d('0x48')],null))[_0xfe1d('0x25')](respondWithResult(_0x208541,null))['catch'](handleError(_0x208541,null));};exports[_0xfe1d('0x4a')]=function(_0x3f0128,_0x2847c4){return db[_0xfe1d('0x2b')]['find']({'where':{'id':_0x3f0128['params']['id']}})[_0xfe1d('0x25')](handleEntityNotFound(_0x2847c4,null))[_0xfe1d('0x25')](removeEntity(_0x2847c4,null))['catch'](handleError(_0x2847c4,null));};exports[_0xfe1d('0x4b')]=function(_0x324912,_0x285e04){return db[_0xfe1d('0x2b')][_0xfe1d('0x4b')]()['then'](respondWithResult(_0x285e04,null))[_0xfe1d('0x43')](handleError(_0x285e04,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 473729b..94fc2f8 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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 logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index d3aa204..3e833b6 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 _0x19ce=['SmsQueueReport','update','where','attributes','limit','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','stringify','UpdateSmsQueueReport'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x19ce,0x116));var _0xe19c=function(_0x16ecd4,_0x264ae1){_0x16ecd4=_0x16ecd4-0x0;var _0xda8b38=_0x19ce[_0x16ecd4];return _0xda8b38;};'use strict';var _=require(_0xe19c('0x0'));var util=require('util');var moment=require(_0xe19c('0x1'));var BPromise=require(_0xe19c('0x2'));var rs=require(_0xe19c('0x3'));var fs=require('fs');var Redis=require(_0xe19c('0x4'));var db=require(_0xe19c('0x5'))['db'];var utils=require(_0xe19c('0x6'));var logger=require(_0xe19c('0x7'))('rpc');var config=require(_0xe19c('0x8'));var jayson=require(_0xe19c('0x9'));var client=jayson[_0xe19c('0xa')][_0xe19c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e592c,_0x3e8bc3,_0x5caf16){return new BPromise(function(_0x311c74,_0x5b312c){return client['request'](_0x4e592c,_0x5caf16)[_0xe19c('0xc')](function(_0x5f2d2b){logger[_0xe19c('0xd')](_0xe19c('0xe'),_0x3e8bc3,'request\x20sent');logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x3e8bc3,_0xe19c('0xf'),JSON['stringify'](_0x5f2d2b));if(_0x5f2d2b[_0xe19c('0x10')]){if(_0x5f2d2b[_0xe19c('0x10')][_0xe19c('0x11')]===0x1f4){logger[_0xe19c('0x10')](_0xe19c('0xe'),_0x3e8bc3,_0x5f2d2b['error']['message']);return _0x5b312c(_0x5f2d2b[_0xe19c('0x10')]['message']);}logger[_0xe19c('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x3e8bc3,_0x5f2d2b['error'][_0xe19c('0x12')]);return _0x311c74(_0x5f2d2b[_0xe19c('0x10')][_0xe19c('0x12')]);}else{logger[_0xe19c('0xd')](_0xe19c('0xe'),_0x3e8bc3,'request\x20sent');_0x311c74(_0x5f2d2b[_0xe19c('0x13')][_0xe19c('0x12')]);}})[_0xe19c('0x14')](function(_0x12b55c){logger[_0xe19c('0x10')](_0xe19c('0xe'),_0x3e8bc3,_0x12b55c);_0x5b312c(_0x12b55c);});});}exports[_0xe19c('0x15')]=function(_0x562dae){var _0xa86a72=this;return new Promise(function(_0x5d924b,_0x212a6b){return db['SmsQueueReport'][_0xe19c('0x16')](_0x562dae[_0xe19c('0x17')],{'raw':_0x562dae[_0xe19c('0x18')]?_0x562dae['options'][_0xe19c('0x19')]===undefined?!![]:![]:!![]})[_0xe19c('0xc')](function(_0x112226){logger[_0xe19c('0xd')](_0xe19c('0x15'),_0x562dae);logger['debug'](_0xe19c('0x15'),_0x562dae,JSON[_0xe19c('0x1a')](_0x112226));_0x5d924b(_0x112226);})[_0xe19c('0x14')](function(_0x160e89){logger['error'](_0xe19c('0x15'),_0x160e89[_0xe19c('0x12')],_0x562dae);_0x212a6b(_0xa86a72['error'](0x1f4,_0x160e89[_0xe19c('0x12')]));});});};exports[_0xe19c('0x1b')]=function(_0x5d69cf){var _0x88dcad=this;return new Promise(function(_0x364a12,_0x489635){return db[_0xe19c('0x1c')][_0xe19c('0x1d')](_0x5d69cf[_0xe19c('0x17')],{'raw':_0x5d69cf[_0xe19c('0x18')]?_0x5d69cf['options'][_0xe19c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d69cf[_0xe19c('0x18')]?_0x5d69cf[_0xe19c('0x18')][_0xe19c('0x1e')]||null:null,'attributes':_0x5d69cf[_0xe19c('0x18')]?_0x5d69cf[_0xe19c('0x18')][_0xe19c('0x1f')]||null:null,'limit':_0x5d69cf[_0xe19c('0x18')]?_0x5d69cf['options'][_0xe19c('0x20')]||null:null})['then'](function(_0x1edbb5){logger['info']('UpdateSmsQueueReport',_0x5d69cf);logger[_0xe19c('0x21')](_0xe19c('0x1b'),_0x5d69cf,JSON['stringify'](_0x1edbb5));_0x364a12(_0x1edbb5);})[_0xe19c('0x14')](function(_0x312e55){logger[_0xe19c('0x10')](_0xe19c('0x1b'),_0x312e55[_0xe19c('0x12')],_0x5d69cf);_0x489635(_0x88dcad['error'](0x1f4,_0x312e55[_0xe19c('0x12')]));});});}; \ No newline at end of file +var _0x4a08=['catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','stringify','UpdateSmsQueueReport','body','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2b9c0c,_0x4678a3){var _0xd8577b=function(_0x2dd9eb){while(--_0x2dd9eb){_0x2b9c0c['push'](_0x2b9c0c['shift']());}};_0xd8577b(++_0x4678a3);}(_0x4a08,0x142));var _0x84a0=function(_0x415375,_0x2585f9){_0x415375=_0x415375-0x0;var _0x192734=_0x4a08[_0x415375];return _0x192734;};'use strict';var _=require(_0x84a0('0x0'));var util=require('util');var moment=require(_0x84a0('0x1'));var BPromise=require(_0x84a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84a0('0x3'))['db'];var utils=require(_0x84a0('0x4'));var logger=require('../../config/logger')(_0x84a0('0x5'));var config=require(_0x84a0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x84a0('0x7')][_0x84a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a4559,_0x87cb13,_0x1a52f8){return new BPromise(function(_0x5c4937,_0x3362d7){return client[_0x84a0('0x9')](_0x5a4559,_0x1a52f8)['then'](function(_0x1cdd55){logger[_0x84a0('0xa')](_0x84a0('0xb'),_0x87cb13,_0x84a0('0xc'));logger[_0x84a0('0xd')](_0x84a0('0xe'),_0x87cb13,_0x84a0('0xc'),JSON['stringify'](_0x1cdd55));if(_0x1cdd55[_0x84a0('0xf')]){if(_0x1cdd55[_0x84a0('0xf')][_0x84a0('0x10')]===0x1f4){logger['error'](_0x84a0('0xb'),_0x87cb13,_0x1cdd55[_0x84a0('0xf')][_0x84a0('0x11')]);return _0x3362d7(_0x1cdd55['error'][_0x84a0('0x11')]);}logger[_0x84a0('0xf')](_0x84a0('0xb'),_0x87cb13,_0x1cdd55[_0x84a0('0xf')][_0x84a0('0x11')]);return _0x5c4937(_0x1cdd55[_0x84a0('0xf')]['message']);}else{logger[_0x84a0('0xa')](_0x84a0('0xb'),_0x87cb13,_0x84a0('0xc'));_0x5c4937(_0x1cdd55[_0x84a0('0x12')][_0x84a0('0x11')]);}})[_0x84a0('0x13')](function(_0x3dcafd){logger[_0x84a0('0xf')](_0x84a0('0xb'),_0x87cb13,_0x3dcafd);_0x3362d7(_0x3dcafd);});});}exports[_0x84a0('0x14')]=function(_0x265271){var _0x5427ae=this;return new Promise(function(_0x106a55,_0x19f114){return db[_0x84a0('0x15')][_0x84a0('0x16')](_0x265271['body'],{'raw':_0x265271[_0x84a0('0x17')]?_0x265271[_0x84a0('0x17')][_0x84a0('0x18')]===undefined?!![]:![]:!![]})[_0x84a0('0x19')](function(_0x52d738){logger[_0x84a0('0xa')](_0x84a0('0x14'),_0x265271);logger[_0x84a0('0xd')]('CreateSmsQueueReport',_0x265271,JSON[_0x84a0('0x1a')](_0x52d738));_0x106a55(_0x52d738);})[_0x84a0('0x13')](function(_0x58c9c9){logger[_0x84a0('0xf')](_0x84a0('0x14'),_0x58c9c9[_0x84a0('0x11')],_0x265271);_0x19f114(_0x5427ae['error'](0x1f4,_0x58c9c9['message']));});});};exports[_0x84a0('0x1b')]=function(_0x8fffc9){var _0x7921c8=this;return new Promise(function(_0x4469ba,_0x5a3930){return db[_0x84a0('0x15')]['update'](_0x8fffc9[_0x84a0('0x1c')],{'raw':_0x8fffc9[_0x84a0('0x17')]?_0x8fffc9[_0x84a0('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8fffc9[_0x84a0('0x17')]?_0x8fffc9['options'][_0x84a0('0x1d')]||null:null,'attributes':_0x8fffc9[_0x84a0('0x17')]?_0x8fffc9[_0x84a0('0x17')][_0x84a0('0x1e')]||null:null,'limit':_0x8fffc9[_0x84a0('0x17')]?_0x8fffc9[_0x84a0('0x17')]['limit']||null:null})[_0x84a0('0x19')](function(_0x1795a6){logger[_0x84a0('0xa')]('UpdateSmsQueueReport',_0x8fffc9);logger[_0x84a0('0xd')](_0x84a0('0x1b'),_0x8fffc9,JSON[_0x84a0('0x1a')](_0x1795a6));_0x4469ba(_0x1795a6);})[_0x84a0('0x13')](function(_0xfcc201){logger['error'](_0x84a0('0x1b'),_0xfcc201[_0x84a0('0x11')],_0x8fffc9);_0x5a3930(_0x7921c8[_0x84a0('0xf')](0x1f4,_0xfcc201[_0x84a0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 7c3f48a..8eac3ee 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 _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xca9e,0x136));var _0xeca9=function(_0x487438,_0x466e22){_0x487438=_0x487438-0x0;var _0x18d7ca=_0xca9e[_0x487438];return _0x18d7ca;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file +var _0x2123=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ec087,_0x4506cd){var _0x52d370=function(_0x19f1a0){while(--_0x19f1a0){_0x1ec087['push'](_0x1ec087['shift']());}};_0x52d370(++_0x4506cd);}(_0x2123,0x190));var _0x3212=function(_0x5149a8,_0x54cc8c){_0x5149a8=_0x5149a8-0x0;var _0x5c3b6c=_0x2123[_0x5149a8];return _0x5c3b6c;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),auth['isAuthenticated'](),controller[_0x3212('0xe')]);router['get'](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x11')]);router[_0x3212('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3212('0x13')](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x14')]);router[_0x3212('0x15')](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x16')]);module[_0x3212('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 507804f..f783b32 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49a968,_0x1bd5b6){_0x49a968=_0x49a968-0x0;var _0x2b7a8d=_0xb43b[_0x49a968];return _0x2b7a8d;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4ce379,_0x207133){var _0x57647c=function(_0x4e97fc){while(--_0x4e97fc){_0x4ce379['push'](_0x4ce379['shift']());}};_0x57647c(++_0x207133);}(_0xf4eb,0xec));var _0xbf4e=function(_0x442c9d,_0x592ae0){_0x442c9d=_0x442c9d-0x0;var _0x189d25=_0xf4eb[_0x442c9d];return _0x189d25;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 0c6d04c..accfac2 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 _0x74c4=['bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x74c4,0x172));var _0x474c=function(_0x9c3d4b,_0x58454f){_0x9c3d4b=_0x9c3d4b-0x0;var _0x10103a=_0x74c4[_0x9c3d4b];return _0x10103a;};'use strict';var emlformat=require(_0x474c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x474c('0x1'));var jsonpatch=require(_0x474c('0x2'));var rp=require(_0x474c('0x3'));var moment=require(_0x474c('0x4'));var BPromise=require(_0x474c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x474c('0x6'));var sox=require('sox');var csv=require(_0x474c('0x7'));var ejs=require(_0x474c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x474c('0x9'));var squel=require(_0x474c('0xa'));var crypto=require(_0x474c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x474c('0xc'));var toCsv=require(_0x474c('0x7'));var querystring=require(_0x474c('0xd'));var Papa=require(_0x474c('0xe'));var Redis=require(_0x474c('0xf'));var authService=require(_0x474c('0x10'));var qs=require(_0x474c('0x11'));var as=require(_0x474c('0x12'));var hardwareService=require(_0x474c('0x13'));var logger=require('../../config/logger')(_0x474c('0x14'));var utils=require('../../config/utils');var config=require(_0x474c('0x15'));var licenseUtil=require(_0x474c('0x16'));var db=require(_0x474c('0x17'))['db'];function respondWithStatusCode(_0x27c932,_0x204ed3){_0x204ed3=_0x204ed3||0xcc;return function(_0x479ddd){if(_0x479ddd){return _0x27c932[_0x474c('0x18')](_0x204ed3);}return _0x27c932['status'](_0x204ed3)['end']();};}function respondWithResult(_0x2bb7a2,_0x55943e){_0x55943e=_0x55943e||0xc8;return function(_0x14a7f0){if(_0x14a7f0){return _0x2bb7a2[_0x474c('0x19')](_0x55943e)['json'](_0x14a7f0);}};}function respondWithFilteredResult(_0x2d745b,_0x1470a4){return function(_0x48ed30){if(_0x48ed30){var _0x16c363=typeof _0x1470a4['offset']===_0x474c('0x1a')&&typeof _0x1470a4[_0x474c('0x1b')]===_0x474c('0x1a');var _0x18c0e1=_0x48ed30[_0x474c('0x1c')];var _0x4d8526=_0x16c363?0x0:_0x1470a4[_0x474c('0x1d')];var _0x223e37=_0x16c363?_0x48ed30[_0x474c('0x1c')]:_0x1470a4['offset']+_0x1470a4[_0x474c('0x1b')];var _0x4d713c;if(_0x223e37>=_0x18c0e1){_0x223e37=_0x18c0e1;_0x4d713c=0xc8;}else{_0x4d713c=0xce;}_0x2d745b[_0x474c('0x19')](_0x4d713c);return _0x2d745b[_0x474c('0x1e')](_0x474c('0x1f'),_0x4d8526+'-'+_0x223e37+'/'+_0x18c0e1)['json'](_0x48ed30);}return null;};}function patchUpdates(_0x1d4c54){return function(_0x198d33){try{jsonpatch[_0x474c('0x20')](_0x198d33,_0x1d4c54,!![]);}catch(_0x47e512){return BPromise[_0x474c('0x21')](_0x47e512);}return _0x198d33[_0x474c('0x22')]();};}function saveUpdates(_0x4d73fa,_0x228d93){return function(_0x34616b){if(_0x34616b){return _0x34616b['update'](_0x4d73fa)[_0x474c('0x23')](function(_0x4595e5){return _0x4595e5;});}return null;};}function removeEntity(_0x20e661,_0x4e4b0){return function(_0xce2118){if(_0xce2118){return _0xce2118[_0x474c('0x24')]()[_0x474c('0x23')](function(){_0x20e661[_0x474c('0x19')](0xcc)[_0x474c('0x25')]();});}};}function handleEntityNotFound(_0xe93a4e,_0x5dfb6e){return function(_0x4e156c){if(!_0x4e156c){_0xe93a4e[_0x474c('0x18')](0x194);}return _0x4e156c;};}function handleError(_0x31b66a,_0x28d88d){_0x28d88d=_0x28d88d||0x1f4;return function(_0xed4628){logger[_0x474c('0x26')](_0xed4628[_0x474c('0x27')]);if(_0xed4628[_0x474c('0x28')]){delete _0xed4628['name'];}_0x31b66a[_0x474c('0x19')](_0x28d88d)['send'](_0xed4628);};}exports[_0x474c('0x29')]=function(_0x232537,_0x1cd949){var _0xd4d6d6={},_0x30ae90={},_0x146956={'count':0x0,'rows':[]};var _0x4f9281=_[_0x474c('0x2a')](db[_0x474c('0x2b')][_0x474c('0x2c')],function(_0x41f7df){return{'name':_0x41f7df[_0x474c('0x2d')],'type':_0x41f7df['type'][_0x474c('0x2e')]};});_0x30ae90[_0x474c('0x2f')]=_[_0x474c('0x2a')](_0x4f9281,'name');_0x30ae90['query']=_[_0x474c('0x30')](_0x232537[_0x474c('0x31')]);_0x30ae90[_0x474c('0x32')]=_[_0x474c('0x33')](_0x30ae90[_0x474c('0x2f')],_0x30ae90[_0x474c('0x31')]);_0xd4d6d6[_0x474c('0x34')]=_['intersection'](_0x30ae90[_0x474c('0x2f')],qs[_0x474c('0x35')](_0x232537['query'][_0x474c('0x35')]));_0xd4d6d6[_0x474c('0x34')]=_0xd4d6d6[_0x474c('0x34')]['length']?_0xd4d6d6[_0x474c('0x34')]:_0x30ae90[_0x474c('0x2f')];if(!_0x232537[_0x474c('0x31')][_0x474c('0x36')]('nolimit')){_0xd4d6d6['limit']=qs[_0x474c('0x1b')](_0x232537[_0x474c('0x31')][_0x474c('0x1b')]);_0xd4d6d6[_0x474c('0x1d')]=qs[_0x474c('0x1d')](_0x232537[_0x474c('0x31')][_0x474c('0x1d')]);}_0xd4d6d6[_0x474c('0x37')]=qs[_0x474c('0x38')](_0x232537[_0x474c('0x31')]['sort']);_0xd4d6d6[_0x474c('0x39')]=qs[_0x474c('0x32')](_[_0x474c('0x3a')](_0x232537[_0x474c('0x31')],_0x30ae90[_0x474c('0x32')]),_0x4f9281);if(_0x232537[_0x474c('0x31')][_0x474c('0x3b')]){_0xd4d6d6[_0x474c('0x39')]=_['merge'](_0xd4d6d6[_0x474c('0x39')],{'$or':_[_0x474c('0x2a')](_0x4f9281,function(_0x531320){if(_0x531320[_0x474c('0x3c')]!==_0x474c('0x3d')){var _0xf15e7a={};_0xf15e7a[_0x531320['name']]={'$like':'%'+_0x232537[_0x474c('0x31')][_0x474c('0x3b')]+'%'};return _0xf15e7a;}})});}_0xd4d6d6=_[_0x474c('0x3e')]({},_0xd4d6d6,_0x232537[_0x474c('0x3f')]);var _0x39ccb={'where':_0xd4d6d6[_0x474c('0x39')]};return db[_0x474c('0x2b')]['count'](_0x39ccb)[_0x474c('0x23')](function(_0x3890c5){_0x146956[_0x474c('0x1c')]=_0x3890c5;if(_0x232537[_0x474c('0x31')][_0x474c('0x40')]){_0xd4d6d6[_0x474c('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x474c('0x42')](_0xd4d6d6);})[_0x474c('0x23')](function(_0x37a790){_0x146956[_0x474c('0x43')]=_0x37a790;return _0x146956;})[_0x474c('0x23')](respondWithFilteredResult(_0x1cd949,_0xd4d6d6))[_0x474c('0x44')](handleError(_0x1cd949,null));};exports['show']=function(_0x32a3b4,_0x10240b){var _0x256d0e={'raw':!![],'where':{'id':_0x32a3b4[_0x474c('0x45')]['id']}},_0x1ab64d={};_0x1ab64d[_0x474c('0x2f')]=_['keys'](db[_0x474c('0x2b')][_0x474c('0x2c')]);_0x1ab64d[_0x474c('0x31')]=_[_0x474c('0x30')](_0x32a3b4['query']);_0x1ab64d[_0x474c('0x32')]=_['intersection'](_0x1ab64d[_0x474c('0x2f')],_0x1ab64d[_0x474c('0x31')]);_0x256d0e['attributes']=_[_0x474c('0x33')](_0x1ab64d['model'],qs[_0x474c('0x35')](_0x32a3b4[_0x474c('0x31')][_0x474c('0x35')]));_0x256d0e[_0x474c('0x34')]=_0x256d0e[_0x474c('0x34')]['length']?_0x256d0e[_0x474c('0x34')]:_0x1ab64d[_0x474c('0x2f')];if(_0x32a3b4[_0x474c('0x31')][_0x474c('0x40')]){_0x256d0e[_0x474c('0x41')]=[{'all':!![]}];}_0x256d0e=_['merge']({},_0x256d0e,_0x32a3b4[_0x474c('0x3f')]);return db[_0x474c('0x2b')]['find'](_0x256d0e)[_0x474c('0x23')](handleEntityNotFound(_0x10240b,null))[_0x474c('0x23')](respondWithResult(_0x10240b,null))[_0x474c('0x44')](handleError(_0x10240b,null));};exports['create']=function(_0x344602,_0xc70404){return db[_0x474c('0x2b')][_0x474c('0x46')](_0x344602[_0x474c('0x47')],{})[_0x474c('0x23')](respondWithResult(_0xc70404,0xc9))['catch'](handleError(_0xc70404,null));};exports[_0x474c('0x48')]=function(_0x1025c8,_0x261a28){if(_0x1025c8['body']['id']){delete _0x1025c8[_0x474c('0x47')]['id'];}return db[_0x474c('0x2b')][_0x474c('0x49')]({'where':{'id':_0x1025c8[_0x474c('0x45')]['id']}})[_0x474c('0x23')](handleEntityNotFound(_0x261a28,null))[_0x474c('0x23')](saveUpdates(_0x1025c8['body'],null))[_0x474c('0x23')](respondWithResult(_0x261a28,null))[_0x474c('0x44')](handleError(_0x261a28,null));};exports[_0x474c('0x24')]=function(_0x56344e,_0x4978f0){return db[_0x474c('0x2b')][_0x474c('0x49')]({'where':{'id':_0x56344e[_0x474c('0x45')]['id']}})[_0x474c('0x23')](handleEntityNotFound(_0x4978f0,null))['then'](removeEntity(_0x4978f0,null))[_0x474c('0x44')](handleError(_0x4978f0,null));};exports[_0x474c('0x4a')]=function(_0x388269,_0x4d6b4f){return db[_0x474c('0x2b')][_0x474c('0x4a')]()[_0x474c('0x23')](respondWithResult(_0x4d6b4f,null))[_0x474c('0x44')](handleError(_0x4d6b4f,null));}; \ No newline at end of file +var _0xdc3c=['filter','options','SmsTransferReport','includeAll','include','findAll','rows','catch','params','keys','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','map'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0xdc3c,0x1d1));var _0xcdc3=function(_0x32453a,_0x3ed27d){_0x32453a=_0x32453a-0x0;var _0x2182bb=_0xdc3c[_0x32453a];return _0x2182bb;};'use strict';var emlformat=require(_0xcdc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdc3('0x1'));var jsonpatch=require(_0xcdc3('0x2'));var rp=require(_0xcdc3('0x3'));var moment=require(_0xcdc3('0x4'));var BPromise=require(_0xcdc3('0x5'));var Mustache=require(_0xcdc3('0x6'));var util=require(_0xcdc3('0x7'));var path=require('path');var sox=require(_0xcdc3('0x8'));var csv=require(_0xcdc3('0x9'));var ejs=require(_0xcdc3('0xa'));var fs=require('fs');var fs_extra=require(_0xcdc3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcdc3('0xc'));var jsforce=require(_0xcdc3('0xd'));var deskjs=require(_0xcdc3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcdc3('0xf'));var Papa=require(_0xcdc3('0x10'));var Redis=require(_0xcdc3('0x11'));var authService=require(_0xcdc3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcdc3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdc3('0x14'))(_0xcdc3('0x15'));var utils=require(_0xcdc3('0x16'));var config=require(_0xcdc3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdc3('0x18'))['db'];function respondWithStatusCode(_0x265ca0,_0x3d0245){_0x3d0245=_0x3d0245||0xcc;return function(_0x3741f4){if(_0x3741f4){return _0x265ca0['sendStatus'](_0x3d0245);}return _0x265ca0[_0xcdc3('0x19')](_0x3d0245)[_0xcdc3('0x1a')]();};}function respondWithResult(_0x4ced6d,_0x3bdfb6){_0x3bdfb6=_0x3bdfb6||0xc8;return function(_0x366b99){if(_0x366b99){return _0x4ced6d[_0xcdc3('0x19')](_0x3bdfb6)['json'](_0x366b99);}};}function respondWithFilteredResult(_0x66abc5,_0x5b74e4){return function(_0x288ba7){if(_0x288ba7){var _0x5b57be=typeof _0x5b74e4[_0xcdc3('0x1b')]===_0xcdc3('0x1c')&&typeof _0x5b74e4[_0xcdc3('0x1d')]===_0xcdc3('0x1c');var _0x451a0c=_0x288ba7[_0xcdc3('0x1e')];var _0x473ecd=_0x5b57be?0x0:_0x5b74e4['offset'];var _0x8cfef0=_0x5b57be?_0x288ba7[_0xcdc3('0x1e')]:_0x5b74e4['offset']+_0x5b74e4[_0xcdc3('0x1d')];var _0x20216c;if(_0x8cfef0>=_0x451a0c){_0x8cfef0=_0x451a0c;_0x20216c=0xc8;}else{_0x20216c=0xce;}_0x66abc5[_0xcdc3('0x19')](_0x20216c);return _0x66abc5[_0xcdc3('0x1f')](_0xcdc3('0x20'),_0x473ecd+'-'+_0x8cfef0+'/'+_0x451a0c)[_0xcdc3('0x21')](_0x288ba7);}return null;};}function patchUpdates(_0xb97189){return function(_0x532d30){try{jsonpatch['apply'](_0x532d30,_0xb97189,!![]);}catch(_0x40fc87){return BPromise[_0xcdc3('0x22')](_0x40fc87);}return _0x532d30[_0xcdc3('0x23')]();};}function saveUpdates(_0x1d7830,_0x2277f7){return function(_0x3793c5){if(_0x3793c5){return _0x3793c5[_0xcdc3('0x24')](_0x1d7830)[_0xcdc3('0x25')](function(_0xa389e){return _0xa389e;});}return null;};}function removeEntity(_0x5f30f5,_0x327b98){return function(_0x17dd3e){if(_0x17dd3e){return _0x17dd3e['destroy']()['then'](function(){_0x5f30f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbca7,_0x134834){return function(_0x5e2596){if(!_0x5e2596){_0x2cbca7[_0xcdc3('0x26')](0x194);}return _0x5e2596;};}function handleError(_0x499852,_0x4ae8a0){_0x4ae8a0=_0x4ae8a0||0x1f4;return function(_0x25d6a9){logger[_0xcdc3('0x27')](_0x25d6a9[_0xcdc3('0x28')]);if(_0x25d6a9['name']){delete _0x25d6a9[_0xcdc3('0x29')];}_0x499852[_0xcdc3('0x19')](_0x4ae8a0)[_0xcdc3('0x2a')](_0x25d6a9);};}exports['index']=function(_0x518ae2,_0x364e4b){var _0x37de1f={},_0x3b3747={},_0x2297a7={'count':0x0,'rows':[]};var _0x2b6396=_['map'](db['SmsTransferReport'][_0xcdc3('0x2b')],function(_0x4966cf){return{'name':_0x4966cf[_0xcdc3('0x2c')],'type':_0x4966cf[_0xcdc3('0x2d')][_0xcdc3('0x2e')]};});_0x3b3747[_0xcdc3('0x2f')]=_['map'](_0x2b6396,_0xcdc3('0x29'));_0x3b3747[_0xcdc3('0x30')]=_['keys'](_0x518ae2['query']);_0x3b3747[_0xcdc3('0x31')]=_[_0xcdc3('0x32')](_0x3b3747[_0xcdc3('0x2f')],_0x3b3747['query']);_0x37de1f['attributes']=_[_0xcdc3('0x32')](_0x3b3747[_0xcdc3('0x2f')],qs['fields'](_0x518ae2['query']['fields']));_0x37de1f['attributes']=_0x37de1f[_0xcdc3('0x33')][_0xcdc3('0x34')]?_0x37de1f[_0xcdc3('0x33')]:_0x3b3747['model'];if(!_0x518ae2[_0xcdc3('0x30')][_0xcdc3('0x35')](_0xcdc3('0x36'))){_0x37de1f['limit']=qs[_0xcdc3('0x1d')](_0x518ae2['query']['limit']);_0x37de1f[_0xcdc3('0x1b')]=qs['offset'](_0x518ae2[_0xcdc3('0x30')][_0xcdc3('0x1b')]);}_0x37de1f[_0xcdc3('0x37')]=qs[_0xcdc3('0x38')](_0x518ae2[_0xcdc3('0x30')][_0xcdc3('0x38')]);_0x37de1f[_0xcdc3('0x39')]=qs['filters'](_['pick'](_0x518ae2['query'],_0x3b3747[_0xcdc3('0x31')]),_0x2b6396);if(_0x518ae2[_0xcdc3('0x30')]['filter']){_0x37de1f[_0xcdc3('0x39')]=_[_0xcdc3('0x3a')](_0x37de1f[_0xcdc3('0x39')],{'$or':_[_0xcdc3('0x3b')](_0x2b6396,function(_0x2a1484){if(_0x2a1484['type']!=='VIRTUAL'){var _0x3c5eeb={};_0x3c5eeb[_0x2a1484[_0xcdc3('0x29')]]={'$like':'%'+_0x518ae2[_0xcdc3('0x30')][_0xcdc3('0x3c')]+'%'};return _0x3c5eeb;}})});}_0x37de1f=_[_0xcdc3('0x3a')]({},_0x37de1f,_0x518ae2[_0xcdc3('0x3d')]);var _0x55186f={'where':_0x37de1f[_0xcdc3('0x39')]};return db[_0xcdc3('0x3e')][_0xcdc3('0x1e')](_0x55186f)[_0xcdc3('0x25')](function(_0x39639a){_0x2297a7['count']=_0x39639a;if(_0x518ae2[_0xcdc3('0x30')][_0xcdc3('0x3f')]){_0x37de1f[_0xcdc3('0x40')]=[{'all':!![]}];}return db[_0xcdc3('0x3e')][_0xcdc3('0x41')](_0x37de1f);})[_0xcdc3('0x25')](function(_0x540163){_0x2297a7[_0xcdc3('0x42')]=_0x540163;return _0x2297a7;})[_0xcdc3('0x25')](respondWithFilteredResult(_0x364e4b,_0x37de1f))[_0xcdc3('0x43')](handleError(_0x364e4b,null));};exports['show']=function(_0x301edf,_0x4304d0){var _0x5de7e4={'raw':!![],'where':{'id':_0x301edf[_0xcdc3('0x44')]['id']}},_0x282353={};_0x282353[_0xcdc3('0x2f')]=_['keys'](db[_0xcdc3('0x3e')]['rawAttributes']);_0x282353['query']=_[_0xcdc3('0x45')](_0x301edf[_0xcdc3('0x30')]);_0x282353[_0xcdc3('0x31')]=_[_0xcdc3('0x32')](_0x282353[_0xcdc3('0x2f')],_0x282353[_0xcdc3('0x30')]);_0x5de7e4[_0xcdc3('0x33')]=_['intersection'](_0x282353[_0xcdc3('0x2f')],qs[_0xcdc3('0x46')](_0x301edf['query'][_0xcdc3('0x46')]));_0x5de7e4[_0xcdc3('0x33')]=_0x5de7e4[_0xcdc3('0x33')][_0xcdc3('0x34')]?_0x5de7e4['attributes']:_0x282353[_0xcdc3('0x2f')];if(_0x301edf[_0xcdc3('0x30')][_0xcdc3('0x3f')]){_0x5de7e4['include']=[{'all':!![]}];}_0x5de7e4=_[_0xcdc3('0x3a')]({},_0x5de7e4,_0x301edf[_0xcdc3('0x3d')]);return db[_0xcdc3('0x3e')][_0xcdc3('0x47')](_0x5de7e4)[_0xcdc3('0x25')](handleEntityNotFound(_0x4304d0,null))['then'](respondWithResult(_0x4304d0,null))['catch'](handleError(_0x4304d0,null));};exports[_0xcdc3('0x48')]=function(_0x4ba16c,_0x288959){return db[_0xcdc3('0x3e')][_0xcdc3('0x48')](_0x4ba16c[_0xcdc3('0x49')],{})[_0xcdc3('0x25')](respondWithResult(_0x288959,0xc9))[_0xcdc3('0x43')](handleError(_0x288959,null));};exports[_0xcdc3('0x24')]=function(_0x2d6b6a,_0x20c1e2){if(_0x2d6b6a[_0xcdc3('0x49')]['id']){delete _0x2d6b6a[_0xcdc3('0x49')]['id'];}return db[_0xcdc3('0x3e')]['find']({'where':{'id':_0x2d6b6a[_0xcdc3('0x44')]['id']}})[_0xcdc3('0x25')](handleEntityNotFound(_0x20c1e2,null))[_0xcdc3('0x25')](saveUpdates(_0x2d6b6a[_0xcdc3('0x49')],null))[_0xcdc3('0x25')](respondWithResult(_0x20c1e2,null))['catch'](handleError(_0x20c1e2,null));};exports['destroy']=function(_0x9df9d4,_0xb21eea){return db[_0xcdc3('0x3e')]['find']({'where':{'id':_0x9df9d4[_0xcdc3('0x44')]['id']}})[_0xcdc3('0x25')](handleEntityNotFound(_0xb21eea,null))[_0xcdc3('0x25')](removeEntity(_0xb21eea,null))['catch'](handleError(_0xb21eea,null));};exports[_0xcdc3('0x4a')]=function(_0x5a4a11,_0x22fd27){return db['SmsTransferReport']['describe']()[_0xcdc3('0x25')](respondWithResult(_0x22fd27,null))[_0xcdc3('0x43')](handleError(_0x22fd27,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b0a351f..2c79057 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 _0xf250=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util'];(function(_0x3b2035,_0x375ce8){var _0x161ca3=function(_0x1b8e3a){while(--_0x1b8e3a){_0x3b2035['push'](_0x3b2035['shift']());}};_0x161ca3(++_0x375ce8);}(_0xf250,0x73));var _0x0f25=function(_0xbf99dd,_0x255ca3){_0xbf99dd=_0xbf99dd-0x0;var _0x3f173d=_0xf250[_0xbf99dd];return _0x3f173d;};'use strict';var _=require(_0x0f25('0x0'));var util=require(_0x0f25('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0f25('0x2'));var BPromise=require(_0x0f25('0x3'));var rp=require(_0x0f25('0x4'));var fs=require('fs');var path=require(_0x0f25('0x5'));var rimraf=require(_0x0f25('0x6'));var config=require(_0x0f25('0x7'));var attributes=require(_0x0f25('0x8'));module[_0x0f25('0x9')]=function(_0x224c7d,_0x29241b){return _0x224c7d[_0x0f25('0xa')](_0x0f25('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0f25('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x62c7=['api','moment','bluebird','request-promise','path','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x62c7,0x107));var _0x762c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62c7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x762c('0x0'));var logger=require('../../config/logger')(_0x762c('0x1'));var moment=require(_0x762c('0x2'));var BPromise=require(_0x762c('0x3'));var rp=require(_0x762c('0x4'));var fs=require('fs');var path=require(_0x762c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x762c('0x6'));module[_0x762c('0x7')]=function(_0x3ed179,_0x5dea6a){return _0x3ed179[_0x762c('0x8')](_0x762c('0x9'),attributes,{'tableName':_0x762c('0xa'),'paranoid':![],'indexes':[{'name':_0x762c('0xb'),'fields':[_0x762c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 4048d49..0a80c6d 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 _0x16cc=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x3f2ae7,_0x3f6685){var _0x1d46ec=function(_0x41c3e7){while(--_0x41c3e7){_0x3f2ae7['push'](_0x3f2ae7['shift']());}};_0x1d46ec(++_0x3f6685);}(_0x16cc,0x120));var _0xc16c=function(_0x25bb2f,_0x12fd3b){_0x25bb2f=_0x25bb2f-0x0;var _0x39a72c=_0x16cc[_0x25bb2f];return _0x39a72c;};'use strict';var _=require('lodash');var util=require(_0xc16c('0x0'));var moment=require(_0xc16c('0x1'));var BPromise=require(_0xc16c('0x2'));var rs=require(_0xc16c('0x3'));var fs=require('fs');var Redis=require(_0xc16c('0x4'));var db=require(_0xc16c('0x5'))['db'];var utils=require(_0xc16c('0x6'));var logger=require('../../config/logger')(_0xc16c('0x7'));var config=require(_0xc16c('0x8'));var jayson=require(_0xc16c('0x9'));var client=jayson[_0xc16c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3492da,_0x561b61,_0x828798){return new BPromise(function(_0x14d607,_0x37b245){return client[_0xc16c('0xb')](_0x3492da,_0x828798)['then'](function(_0x27f3e6){logger[_0xc16c('0xc')](_0xc16c('0xd'),_0x561b61,_0xc16c('0xe'));logger['debug'](_0xc16c('0xf'),_0x561b61,_0xc16c('0xe'),JSON[_0xc16c('0x10')](_0x27f3e6));if(_0x27f3e6['error']){if(_0x27f3e6['error'][_0xc16c('0x11')]===0x1f4){logger[_0xc16c('0x12')](_0xc16c('0xd'),_0x561b61,_0x27f3e6['error']['message']);return _0x37b245(_0x27f3e6['error'][_0xc16c('0x13')]);}logger[_0xc16c('0x12')](_0xc16c('0xd'),_0x561b61,_0x27f3e6[_0xc16c('0x12')][_0xc16c('0x13')]);return _0x14d607(_0x27f3e6[_0xc16c('0x12')][_0xc16c('0x13')]);}else{logger[_0xc16c('0xc')](_0xc16c('0xd'),_0x561b61,_0xc16c('0xe'));_0x14d607(_0x27f3e6[_0xc16c('0x14')][_0xc16c('0x13')]);}})[_0xc16c('0x15')](function(_0x2bf102){logger[_0xc16c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x561b61,_0x2bf102);_0x37b245(_0x2bf102);});});} \ No newline at end of file +var _0x50d0=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x35caf2,_0x137e77){var _0x4bfd82=function(_0x57c1fd){while(--_0x57c1fd){_0x35caf2['push'](_0x35caf2['shift']());}};_0x4bfd82(++_0x137e77);}(_0x50d0,0x101));var _0x050d=function(_0x4b9fcd,_0x10fc42){_0x4b9fcd=_0x4b9fcd-0x0;var _0x3f83cd=_0x50d0[_0x4b9fcd];return _0x3f83cd;};'use strict';var _=require(_0x050d('0x0'));var util=require('util');var moment=require(_0x050d('0x1'));var BPromise=require(_0x050d('0x2'));var rs=require(_0x050d('0x3'));var fs=require('fs');var Redis=require(_0x050d('0x4'));var db=require(_0x050d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x050d('0x6'))(_0x050d('0x7'));var config=require(_0x050d('0x8'));var jayson=require(_0x050d('0x9'));var client=jayson[_0x050d('0xa')][_0x050d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348909,_0x5535d6,_0x2b2faa){return new BPromise(function(_0x516f5d,_0x1d3dd6){return client[_0x050d('0xc')](_0x348909,_0x2b2faa)[_0x050d('0xd')](function(_0x4f2e84){logger[_0x050d('0xe')](_0x050d('0xf'),_0x5535d6,_0x050d('0x10'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5535d6,_0x050d('0x10'),JSON[_0x050d('0x11')](_0x4f2e84));if(_0x4f2e84[_0x050d('0x12')]){if(_0x4f2e84[_0x050d('0x12')][_0x050d('0x13')]===0x1f4){logger[_0x050d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error'][_0x050d('0x14')]);return _0x1d3dd6(_0x4f2e84[_0x050d('0x12')][_0x050d('0x14')]);}logger[_0x050d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error']['message']);return _0x516f5d(_0x4f2e84['error']['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,'request\x20sent');_0x516f5d(_0x4f2e84[_0x050d('0x15')][_0x050d('0x14')]);}})[_0x050d('0x16')](function(_0x2001c6){logger[_0x050d('0x12')](_0x050d('0xf'),_0x5535d6,_0x2001c6);_0x1d3dd6(_0x2001c6);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f56d0f3..48f20d6 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 _0x4a81=['show','/:id/download','diskStorage','join','server/files/sounds/original/','originalname','format','basename','extname','post','single','file','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x5caf19,_0x2b1d36){var _0xce3353=function(_0x3bde60){while(--_0x3bde60){_0x5caf19['push'](_0x5caf19['shift']());}};_0xce3353(++_0x2b1d36);}(_0x4a81,0x17c));var _0x14a8=function(_0x1e760e,_0x1e9f03){_0x1e760e=_0x1e760e-0x0;var _0x5caf8e=_0x4a81[_0x1e760e];return _0x5caf8e;};'use strict';var multer=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var path=require(_0x14a8('0x2'));var timeout=require(_0x14a8('0x3'));var express=require('express');var router=express[_0x14a8('0x4')]();var fs_extra=require(_0x14a8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x14a8('0x6'));var config=require(_0x14a8('0x7'));var controller=require('./sound.controller');router[_0x14a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x14a8('0x9')]);router['get'](_0x14a8('0xa'),auth[_0x14a8('0xb')](),controller[_0x14a8('0xc')]);router[_0x14a8('0x8')](_0x14a8('0xd'),auth[_0x14a8('0xb')](),controller['download']);var upload=multer({'storage':multer[_0x14a8('0xe')]({'destination':function(_0x37282f,_0x2fc4b7,_0xacf218){_0xacf218(null,path[_0x14a8('0xf')](config['root'],_0x14a8('0x10')));},'filename':function(_0x177e96,_0x411266,_0x4d8ee6){_0x411266[_0x14a8('0x11')]=_0x411266[_0x14a8('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d8ee6(null,util[_0x14a8('0x12')]('%s-%s%s',path[_0x14a8('0x13')](_0x411266['originalname'],path['extname'](_0x411266[_0x14a8('0x11')])),Date['now'](),path[_0x14a8('0x14')](_0x411266[_0x14a8('0x11')])));}})});router[_0x14a8('0x15')]('/',upload[_0x14a8('0x16')](_0x14a8('0x17')),controller[_0x14a8('0x18')]);router[_0x14a8('0x19')](_0x14a8('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x14a8('0x1a')](_0x14a8('0xa'),auth[_0x14a8('0xb')](),controller[_0x14a8('0x1a')]);module[_0x14a8('0x1b')]=router; \ No newline at end of file +var _0x3df6=['create','update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','file'];(function(_0x21fcd6,_0x217ae8){var _0xcfdd83=function(_0x1af8c2){while(--_0x1af8c2){_0x21fcd6['push'](_0x21fcd6['shift']());}};_0xcfdd83(++_0x217ae8);}(_0x3df6,0x1f1));var _0x63df=function(_0x1b1600,_0x28bb72){_0x1b1600=_0x1b1600-0x0;var _0x5bbb1a=_0x3df6[_0x1b1600];return _0x5bbb1a;};'use strict';var multer=require(_0x63df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63df('0x1'));var express=require('express');var router=express[_0x63df('0x2')]();var fs_extra=require(_0x63df('0x3'));var auth=require(_0x63df('0x4'));var interaction=require(_0x63df('0x5'));var config=require(_0x63df('0x6'));var controller=require(_0x63df('0x7'));router['get']('/',auth[_0x63df('0x8')](),controller['index']);router[_0x63df('0x9')](_0x63df('0xa'),auth[_0x63df('0x8')](),controller[_0x63df('0xb')]);router[_0x63df('0x9')](_0x63df('0xc'),auth['isAuthenticated'](),controller[_0x63df('0xd')]);var upload=multer({'storage':multer[_0x63df('0xe')]({'destination':function(_0x29058f,_0x1c24bb,_0x5059b2){_0x5059b2(null,path[_0x63df('0xf')](config[_0x63df('0x10')],_0x63df('0x11')));},'filename':function(_0x2d50f9,_0x3eae03,_0x3eee01){_0x3eae03[_0x63df('0x12')]=_0x3eae03['originalname'][_0x63df('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3eee01(null,util[_0x63df('0x14')](_0x63df('0x15'),path['basename'](_0x3eae03[_0x63df('0x12')],path[_0x63df('0x16')](_0x3eae03[_0x63df('0x12')])),Date[_0x63df('0x17')](),path[_0x63df('0x16')](_0x3eae03[_0x63df('0x12')])));}})});router['post']('/',upload['single'](_0x63df('0x18')),controller[_0x63df('0x19')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x63df('0x1a')]);router[_0x63df('0x1b')](_0x63df('0xa'),auth[_0x63df('0x8')](),controller[_0x63df('0x1b')]);module[_0x63df('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 3b3bae7..16a6c2d 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 _0x8623=['STRING','FLOAT','BIGINT','INTEGER','exports'];(function(_0x241a2f,_0x5216e5){var _0x61c13d=function(_0x1f1e4a){while(--_0x1f1e4a){_0x241a2f['push'](_0x241a2f['shift']());}};_0x61c13d(++_0x5216e5);}(_0x8623,0x1f3));var _0x3862=function(_0x5b3ed2,_0x36bae1){_0x5b3ed2=_0x5b3ed2-0x0;var _0x585937=_0x8623[_0x5b3ed2];return _0x585937;};'use strict';var Sequelize=require('sequelize');module[_0x3862('0x0')]={'name':{'type':Sequelize[_0x3862('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x3862('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x3862('0x1')]},'original_format':{'type':Sequelize[_0x3862('0x1')]},'original_duration':{'type':Sequelize[_0x3862('0x2')]},'original_sampleCount':{'type':Sequelize[_0x3862('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x3862('0x3')]},'original_sampleRate':{'type':Sequelize[_0x3862('0x4')]},'converted_format':{'type':Sequelize[_0x3862('0x1')]},'converted_duration':{'type':Sequelize[_0x3862('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x3862('0x3')]},'converted_channelCount':{'type':Sequelize[_0x3862('0x4')]},'converted_bitRate':{'type':Sequelize[_0x3862('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x3862('0x4')]}}; \ No newline at end of file +var _0xecd2=['name','BIGINT','INTEGER','FLOAT','sequelize','STRING'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xecd2,0x1ba));var _0x2ecd=function(_0x34cc2e,_0x546536){_0x34cc2e=_0x34cc2e-0x0;var _0x11d6f8=_0xecd2[_0x34cc2e];return _0x11d6f8;};'use strict';var Sequelize=require(_0x2ecd('0x0'));module['exports']={'name':{'type':Sequelize[_0x2ecd('0x1')],'unique':_0x2ecd('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2ecd('0x1')]},'display_name':{'type':Sequelize[_0x2ecd('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x2ecd('0x1')]},'original_format':{'type':Sequelize[_0x2ecd('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x2ecd('0x3')]},'original_channelCount':{'type':Sequelize[_0x2ecd('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x2ecd('0x4')]},'converted_format':{'type':Sequelize[_0x2ecd('0x1')]},'converted_duration':{'type':Sequelize[_0x2ecd('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x2ecd('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 7fe6fc7..e7366f7 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 _0x1a73=['includeAll','include','findAll','catch','show','params','find','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','file','extname','originalname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','body','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','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','Content-Range','reject','save','update','destroy','then','Sounds','UserProfileResource','sendStatus','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x1440fb,_0x3afe4c){var _0x5198ff=function(_0x5eb446){while(--_0x5eb446){_0x1440fb['push'](_0x1440fb['shift']());}};_0x5198ff(++_0x3afe4c);}(_0x1a73,0x130));var _0x31a7=function(_0x365130,_0x3a68c3){_0x365130=_0x365130-0x0;var _0x9886e9=_0x1a73[_0x365130];return _0x9886e9;};'use strict';var emlformat=require(_0x31a7('0x0'));var rimraf=require(_0x31a7('0x1'));var zipdir=require(_0x31a7('0x2'));var jsonpatch=require(_0x31a7('0x3'));var rp=require('request-promise');var moment=require(_0x31a7('0x4'));var BPromise=require(_0x31a7('0x5'));var Mustache=require(_0x31a7('0x6'));var util=require('util');var path=require(_0x31a7('0x7'));var sox=require('sox');var csv=require(_0x31a7('0x8'));var ejs=require(_0x31a7('0x9'));var fs=require('fs');var fs_extra=require(_0x31a7('0xa'));var _=require(_0x31a7('0xb'));var squel=require(_0x31a7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x31a7('0xd'));var toCsv=require(_0x31a7('0x8'));var querystring=require(_0x31a7('0xe'));var Papa=require('papaparse');var Redis=require(_0x31a7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x31a7('0x10'));var as=require(_0x31a7('0x11'));var hardwareService=require(_0x31a7('0x12'));var logger=require(_0x31a7('0x13'))(_0x31a7('0x14'));var utils=require(_0x31a7('0x15'));var config=require(_0x31a7('0x16'));var licenseUtil=require(_0x31a7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2097c5,_0x1cabc4){_0x1cabc4=_0x1cabc4||0xcc;return function(_0x6134e){if(_0x6134e){return _0x2097c5['sendStatus'](_0x1cabc4);}return _0x2097c5[_0x31a7('0x18')](_0x1cabc4)[_0x31a7('0x19')]();};}function respondWithResult(_0x4e9edf,_0x343e76){_0x343e76=_0x343e76||0xc8;return function(_0x515aed){if(_0x515aed){return _0x4e9edf[_0x31a7('0x18')](_0x343e76)[_0x31a7('0x1a')](_0x515aed);}};}function respondWithFilteredResult(_0x15f4ce,_0x1152ea){return function(_0x1263de){if(_0x1263de){var _0x27c39f=typeof _0x1152ea[_0x31a7('0x1b')]===_0x31a7('0x1c')&&typeof _0x1152ea[_0x31a7('0x1d')]===_0x31a7('0x1c');var _0x10449a=_0x1263de[_0x31a7('0x1e')];var _0x32a792=_0x27c39f?0x0:_0x1152ea[_0x31a7('0x1b')];var _0x5b6a40=_0x27c39f?_0x1263de[_0x31a7('0x1e')]:_0x1152ea['offset']+_0x1152ea[_0x31a7('0x1d')];var _0x13a065;if(_0x5b6a40>=_0x10449a){_0x5b6a40=_0x10449a;_0x13a065=0xc8;}else{_0x13a065=0xce;}_0x15f4ce['status'](_0x13a065);return _0x15f4ce['set'](_0x31a7('0x1f'),_0x32a792+'-'+_0x5b6a40+'/'+_0x10449a)[_0x31a7('0x1a')](_0x1263de);}return null;};}function patchUpdates(_0x14f775){return function(_0x2bd5ab){try{jsonpatch['apply'](_0x2bd5ab,_0x14f775,!![]);}catch(_0x5b9958){return BPromise[_0x31a7('0x20')](_0x5b9958);}return _0x2bd5ab[_0x31a7('0x21')]();};}function saveUpdates(_0x23b535,_0x3f9cc6){return function(_0x40c8df){if(_0x40c8df){return _0x40c8df[_0x31a7('0x22')](_0x23b535)['then'](function(_0x1fdd94){return _0x1fdd94;});}return null;};}function removeEntity(_0x4b9606,_0x1fc0ec){return function(_0x299d01){if(_0x299d01){return _0x299d01[_0x31a7('0x23')]()[_0x31a7('0x24')](function(){var _0x51cf73=_0x299d01['get']({'plain':!![]});var _0x33fc32=_0x31a7('0x25');return db[_0x31a7('0x26')][_0x31a7('0x23')]({'where':{'type':_0x33fc32,'resourceId':_0x51cf73['id']}})[_0x31a7('0x24')](function(){return _0x299d01;});})[_0x31a7('0x24')](function(){_0x4b9606['status'](0xcc)[_0x31a7('0x19')]();});}};}function handleEntityNotFound(_0x32eada,_0x41ef54){return function(_0x259462){if(!_0x259462){_0x32eada[_0x31a7('0x27')](0x194);}return _0x259462;};}function handleError(_0x29e96f,_0x160d00){_0x160d00=_0x160d00||0x1f4;return function(_0x551ad3){logger[_0x31a7('0x28')](_0x551ad3['stack']);if(_0x551ad3[_0x31a7('0x29')]){delete _0x551ad3[_0x31a7('0x29')];}_0x29e96f['status'](_0x160d00)[_0x31a7('0x2a')](_0x551ad3);};}exports[_0x31a7('0x2b')]=function(_0x3dfaa0,_0x5c52e8){var _0x67d4c1={},_0x1279d4={},_0x32e6e7={'count':0x0,'rows':[]};var _0x22e0e1=_[_0x31a7('0x2c')](db[_0x31a7('0x2d')][_0x31a7('0x2e')],function(_0x4a29e3){return{'name':_0x4a29e3[_0x31a7('0x2f')],'type':_0x4a29e3[_0x31a7('0x30')][_0x31a7('0x31')]};});_0x1279d4[_0x31a7('0x32')]=_[_0x31a7('0x2c')](_0x22e0e1,_0x31a7('0x29'));_0x1279d4[_0x31a7('0x33')]=_[_0x31a7('0x34')](_0x3dfaa0[_0x31a7('0x33')]);_0x1279d4[_0x31a7('0x35')]=_[_0x31a7('0x36')](_0x1279d4[_0x31a7('0x32')],_0x1279d4['query']);_0x67d4c1['attributes']=_['intersection'](_0x1279d4['model'],qs['fields'](_0x3dfaa0[_0x31a7('0x33')][_0x31a7('0x37')]));_0x67d4c1[_0x31a7('0x38')]=_0x67d4c1[_0x31a7('0x38')]['length']?_0x67d4c1[_0x31a7('0x38')]:_0x1279d4['model'];if(!_0x3dfaa0['query'][_0x31a7('0x39')]('nolimit')){_0x67d4c1[_0x31a7('0x1d')]=qs[_0x31a7('0x1d')](_0x3dfaa0['query'][_0x31a7('0x1d')]);_0x67d4c1[_0x31a7('0x1b')]=qs['offset'](_0x3dfaa0['query'][_0x31a7('0x1b')]);}_0x67d4c1['order']=qs['sort'](_0x3dfaa0['query'][_0x31a7('0x3a')]);_0x67d4c1[_0x31a7('0x3b')]=qs[_0x31a7('0x35')](_[_0x31a7('0x3c')](_0x3dfaa0[_0x31a7('0x33')],_0x1279d4[_0x31a7('0x35')]),_0x22e0e1);if(_0x3dfaa0[_0x31a7('0x33')][_0x31a7('0x3d')]){_0x67d4c1[_0x31a7('0x3b')]=_[_0x31a7('0x3e')](_0x67d4c1['where'],{'$or':_[_0x31a7('0x2c')](_0x22e0e1,function(_0x4e79f7){if(_0x4e79f7[_0x31a7('0x30')]!==_0x31a7('0x3f')){var _0x2975f9={};_0x2975f9[_0x4e79f7['name']]={'$like':'%'+_0x3dfaa0['query'][_0x31a7('0x3d')]+'%'};return _0x2975f9;}})});}_0x67d4c1=_[_0x31a7('0x3e')]({},_0x67d4c1,_0x3dfaa0[_0x31a7('0x40')]);var _0x16ebe0={'where':_0x67d4c1[_0x31a7('0x3b')]};return db[_0x31a7('0x2d')][_0x31a7('0x1e')](_0x16ebe0)[_0x31a7('0x24')](function(_0x49b7e0){_0x32e6e7[_0x31a7('0x1e')]=_0x49b7e0;if(_0x3dfaa0[_0x31a7('0x33')][_0x31a7('0x41')]){_0x67d4c1[_0x31a7('0x42')]=[{'all':!![]}];}return db[_0x31a7('0x2d')][_0x31a7('0x43')](_0x67d4c1);})[_0x31a7('0x24')](function(_0x453843){_0x32e6e7['rows']=_0x453843;return _0x32e6e7;})['then'](respondWithFilteredResult(_0x5c52e8,_0x67d4c1))[_0x31a7('0x44')](handleError(_0x5c52e8,null));};exports[_0x31a7('0x45')]=function(_0x5daf1c,_0x5b4b52){var _0x4b6b9a={'raw':!![],'where':{'id':_0x5daf1c[_0x31a7('0x46')]['id']}},_0x10f451={};_0x10f451[_0x31a7('0x32')]=_[_0x31a7('0x34')](db['Sound'][_0x31a7('0x2e')]);_0x10f451[_0x31a7('0x33')]=_['keys'](_0x5daf1c[_0x31a7('0x33')]);_0x10f451[_0x31a7('0x35')]=_[_0x31a7('0x36')](_0x10f451[_0x31a7('0x32')],_0x10f451[_0x31a7('0x33')]);_0x4b6b9a['attributes']=_[_0x31a7('0x36')](_0x10f451['model'],qs[_0x31a7('0x37')](_0x5daf1c[_0x31a7('0x33')][_0x31a7('0x37')]));_0x4b6b9a[_0x31a7('0x38')]=_0x4b6b9a[_0x31a7('0x38')]['length']?_0x4b6b9a[_0x31a7('0x38')]:_0x10f451[_0x31a7('0x32')];if(_0x5daf1c[_0x31a7('0x33')]['includeAll']){_0x4b6b9a[_0x31a7('0x42')]=[{'all':!![]}];}_0x4b6b9a=_[_0x31a7('0x3e')]({},_0x4b6b9a,_0x5daf1c['options']);return db['Sound'][_0x31a7('0x47')](_0x4b6b9a)[_0x31a7('0x24')](handleEntityNotFound(_0x5b4b52,null))[_0x31a7('0x24')](respondWithResult(_0x5b4b52,null))[_0x31a7('0x44')](handleError(_0x5b4b52,null));};exports[_0x31a7('0x48')]=function(_0x2041f5,_0x30c5be,_0x37d96){return db[_0x31a7('0x2d')][_0x31a7('0x47')]({'where':{'id':_0x2041f5[_0x31a7('0x46')]['id']},'attributes':['name','save_name',_0x31a7('0x49')],'raw':!![]})[_0x31a7('0x24')](handleEntityNotFound(_0x30c5be,null))[_0x31a7('0x24')](function(_0x4c216a){if(_0x4c216a){if(!fs['existsSync'](path[_0x31a7('0x4a')](config[_0x31a7('0x4b')],_0x31a7('0x4c'),_0x4c216a[_0x31a7('0x4d')]+'.'+_0x4c216a[_0x31a7('0x49')]))){throw new db[(_0x31a7('0x4e'))][(_0x31a7('0x4f'))](_0x31a7('0x50'));}return _0x30c5be['download'](path[_0x31a7('0x4a')](config['root'],_0x31a7('0x4c'),util[_0x31a7('0x51')](_0x31a7('0x52'),_0x4c216a[_0x31a7('0x4d')],_0x4c216a[_0x31a7('0x49')])),util[_0x31a7('0x51')](_0x31a7('0x52'),_0x4c216a[_0x31a7('0x29')],_0x4c216a['converted_format']));}return null;})[_0x31a7('0x44')](handleError(_0x30c5be,null));};exports['create']=function(_0x421d03,_0x2afb1c,_0x3e0638){var _0x3504b5={'name':path[_0x31a7('0x53')](_0x421d03[_0x31a7('0x54')]['originalname'],path[_0x31a7('0x55')](_0x421d03[_0x31a7('0x54')][_0x31a7('0x56')])),'save_name':path[_0x31a7('0x53')](_0x421d03[_0x31a7('0x54')][_0x31a7('0x57')],path['extname'](_0x421d03['file'][_0x31a7('0x57')])),'original_format':path[_0x31a7('0x55')](_0x421d03[_0x31a7('0x54')][_0x31a7('0x56')])['substring'](0x1),'converted_format':_0x31a7('0x58')};var _0x1a0038=path[_0x31a7('0x4a')](config[_0x31a7('0x4b')],_0x31a7('0x59'),_0x421d03[_0x31a7('0x54')][_0x31a7('0x57')]);var _0x22960d=path[_0x31a7('0x4a')](config[_0x31a7('0x4b')],'server/files/sounds/converted',util['format'](_0x31a7('0x52'),path[_0x31a7('0x53')](_0x421d03[_0x31a7('0x54')][_0x31a7('0x57')],path[_0x31a7('0x55')](_0x421d03[_0x31a7('0x54')][_0x31a7('0x57')])),_0x3504b5[_0x31a7('0x49')]));logger[_0x31a7('0x5a')](_0x31a7('0x5b'),_0x1a0038);logger[_0x31a7('0x5a')](_0x31a7('0x5c'),_0x22960d);try{fs[_0x31a7('0x5d')](_0x1a0038,parseInt(_0x31a7('0x5e'),0x8));var _0x568110=sox[_0x31a7('0x5f')](_0x1a0038,_0x22960d,{'sampleRate':0x1f40,'format':_0x31a7('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x568110['on'](_0x31a7('0x28'),function(_0x450ebf){fs[_0x31a7('0x60')](_0x1a0038);_0x2afb1c[_0x31a7('0x18')](0x1f4)[_0x31a7('0x2a')](_0x450ebf);});_0x568110['on'](_0x31a7('0x61'),function(_0x346023){_0x3504b5['original_duration']=isNaN(_0x346023['duration'])?null:_0x346023[_0x31a7('0x62')]*0x3e8;_0x3504b5['original_sampleCount']=isNaN(_0x346023[_0x31a7('0x63')])?null:_0x346023[_0x31a7('0x63')];_0x3504b5[_0x31a7('0x64')]=isNaN(_0x346023[_0x31a7('0x65')])?null:_0x346023[_0x31a7('0x65')];_0x3504b5[_0x31a7('0x66')]=isNaN(_0x346023['bitRate'])?null:_0x346023['bitRate'];_0x3504b5['original_sampleRate']=isNaN(_0x346023[_0x31a7('0x67')])?null:_0x346023[_0x31a7('0x67')];});_0x568110['on'](_0x31a7('0x68'),function(_0x4e73ee){_0x3504b5[_0x31a7('0x69')]=isNaN(_0x4e73ee[_0x31a7('0x62')])?null:_0x4e73ee[_0x31a7('0x62')]*0x3e8;_0x3504b5[_0x31a7('0x6a')]=isNaN(_0x4e73ee[_0x31a7('0x63')])?null:_0x4e73ee[_0x31a7('0x63')];_0x3504b5[_0x31a7('0x6b')]=isNaN(_0x4e73ee[_0x31a7('0x65')])?null:_0x4e73ee['channelCount'];_0x3504b5[_0x31a7('0x6c')]=isNaN(_0x4e73ee['bitRate'])?null:_0x4e73ee['bitRate'];_0x3504b5[_0x31a7('0x6d')]=isNaN(_0x4e73ee[_0x31a7('0x67')])?null:_0x4e73ee[_0x31a7('0x67')];});_0x568110['on'](_0x31a7('0x19'),function(){fs['chmodSync'](_0x22960d,parseInt(_0x31a7('0x5e'),0x8));return db['Sound']['create'](_0x3504b5)[_0x31a7('0x24')](function(_0x10d270){var _0x3a0a0c={'role':_0x421d03['body']['role'],'userProfileId':_0x421d03['body']['userProfileId']};if(!_0x3a0a0c)throw new Error(_0x31a7('0x6e'));if(_0x3a0a0c[_0x31a7('0x6f')]===_0x31a7('0x70')){var _0x222a78=_0x10d270['get']({'plain':!![]});return db[_0x31a7('0x71')]['find']({'where':{'name':_0x31a7('0x25'),'userProfileId':_0x3a0a0c[_0x31a7('0x72')]},'raw':!![]})[_0x31a7('0x24')](function(_0x21ec63){if(_0x21ec63&&_0x21ec63[_0x31a7('0x73')]===0x0){return db[_0x31a7('0x26')][_0x31a7('0x74')]({'name':_0x222a78['name'],'resourceId':_0x222a78['id'],'type':_0x21ec63[_0x31a7('0x29')],'sectionId':_0x21ec63['id']},{})[_0x31a7('0x24')](function(){return _0x10d270;});}else{return _0x10d270;}})[_0x31a7('0x44')](function(_0x2120ae){logger[_0x31a7('0x28')](_0x31a7('0x75'),_0x2120ae);throw _0x2120ae;});}return _0x10d270;})['then'](respondWithResult(_0x2afb1c,null))[_0x31a7('0x44')](handleError(_0x2afb1c,null));});_0x568110[_0x31a7('0x76')]();}catch(_0xb00013){_0x2afb1c[_0x31a7('0x18')](0x1f4)['send'](_0xb00013);}};exports['update']=function(_0x957333,_0xf497e3,_0x25f2e5){return db[_0x31a7('0x2d')][_0x31a7('0x47')]({'where':{'id':_0x957333[_0x31a7('0x46')]['id']}})[_0x31a7('0x24')](handleEntityNotFound(_0xf497e3,null))[_0x31a7('0x24')](saveUpdates(_[_0x31a7('0x3c')](_0x957333[_0x31a7('0x77')],[_0x31a7('0x29'),_0x31a7('0x78')]),null))[_0x31a7('0x24')](respondWithResult(_0xf497e3,null))[_0x31a7('0x44')](handleError(_0xf497e3,null));};exports[_0x31a7('0x79')]=function(_0x3e7a20,_0x37684e,_0x39e630){return db[_0x31a7('0x2d')][_0x31a7('0x47')]({'where':{'id':_0x3e7a20['params']['id']}})[_0x31a7('0x24')](function(_0x35363d){if(_0x35363d){return _0x35363d[_0x31a7('0x23')]();}})[_0x31a7('0x24')](function(_0x188c33){var _0x54920c=path['join'](config[_0x31a7('0x4b')],_0x31a7('0x59'),util['format'](_0x31a7('0x52'),_0x188c33['save_name'],_0x188c33[_0x31a7('0x7a')]));var _0x4ee3ac=path[_0x31a7('0x4a')](config[_0x31a7('0x4b')],_0x31a7('0x4c'),util['format'](_0x31a7('0x52'),_0x188c33[_0x31a7('0x4d')],_0x188c33[_0x31a7('0x49')]));fs[_0x31a7('0x60')](_0x54920c);fs[_0x31a7('0x60')](_0x4ee3ac);return _0x188c33;})[_0x31a7('0x24')](function(_0x3344a4){if(_0x3344a4){return _0x37684e[_0x31a7('0x18')](0xcc)['end']();}})[_0x31a7('0x24')](handleEntityNotFound(_0x37684e,null))[_0x31a7('0x44')](handleError(_0x37684e,null));}; \ No newline at end of file +var _0x594d=['lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','set','json','apply','save','update','Sounds','UserProfileResource','destroy','then','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','catch','show','keys','includeAll','include','find','download','params','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','format','%s.%s','create','file','originalname','extname','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','wav','original_sampleCount','sampleCount','bitRate','original_sampleRate','dest','duration','converted_sampleCount','converted_channelCount','converted_bitRate','sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','description','delete','original_format','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x4295bc,_0x55b581){var _0x2f0298=function(_0x3015e2){while(--_0x3015e2){_0x4295bc['push'](_0x4295bc['shift']());}};_0x2f0298(++_0x55b581);}(_0x594d,0x14f));var _0xd594=function(_0x377775,_0x358a13){_0x377775=_0x377775-0x0;var _0x47edf3=_0x594d[_0x377775];return _0x47edf3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd594('0x0'));var zipdir=require(_0xd594('0x1'));var jsonpatch=require(_0xd594('0x2'));var rp=require('request-promise');var moment=require(_0xd594('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd594('0x4'));var util=require(_0xd594('0x5'));var path=require(_0xd594('0x6'));var sox=require(_0xd594('0x7'));var csv=require(_0xd594('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd594('0x9'));var _=require(_0xd594('0xa'));var squel=require(_0xd594('0xb'));var crypto=require(_0xd594('0xc'));var jsforce=require(_0xd594('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd594('0x8'));var querystring=require(_0xd594('0xe'));var Papa=require(_0xd594('0xf'));var Redis=require('ioredis');var authService=require(_0xd594('0x10'));var qs=require(_0xd594('0x11'));var as=require(_0xd594('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd594('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd594('0x14'));var db=require(_0xd594('0x15'))['db'];function respondWithStatusCode(_0x37c008,_0x3f7bae){_0x3f7bae=_0x3f7bae||0xcc;return function(_0x237248){if(_0x237248){return _0x37c008[_0xd594('0x16')](_0x3f7bae);}return _0x37c008['status'](_0x3f7bae)[_0xd594('0x17')]();};}function respondWithResult(_0x2868c0,_0x3d9b91){_0x3d9b91=_0x3d9b91||0xc8;return function(_0x45f959){if(_0x45f959){return _0x2868c0[_0xd594('0x18')](_0x3d9b91)['json'](_0x45f959);}};}function respondWithFilteredResult(_0x474985,_0x9b5aed){return function(_0x3a8f2e){if(_0x3a8f2e){var _0x2c4b0a=typeof _0x9b5aed[_0xd594('0x19')]==='undefined'&&typeof _0x9b5aed[_0xd594('0x1a')]===_0xd594('0x1b');var _0x556d07=_0x3a8f2e['count'];var _0x45ddbc=_0x2c4b0a?0x0:_0x9b5aed['offset'];var _0x5b4ec7=_0x2c4b0a?_0x3a8f2e['count']:_0x9b5aed[_0xd594('0x19')]+_0x9b5aed[_0xd594('0x1a')];var _0x6175cd;if(_0x5b4ec7>=_0x556d07){_0x5b4ec7=_0x556d07;_0x6175cd=0xc8;}else{_0x6175cd=0xce;}_0x474985['status'](_0x6175cd);return _0x474985[_0xd594('0x1c')]('Content-Range',_0x45ddbc+'-'+_0x5b4ec7+'/'+_0x556d07)[_0xd594('0x1d')](_0x3a8f2e);}return null;};}function patchUpdates(_0x5b5e5f){return function(_0x3e309d){try{jsonpatch[_0xd594('0x1e')](_0x3e309d,_0x5b5e5f,!![]);}catch(_0x3aeb48){return BPromise['reject'](_0x3aeb48);}return _0x3e309d[_0xd594('0x1f')]();};}function saveUpdates(_0x1402b9,_0x2ff0ac){return function(_0x50bb79){if(_0x50bb79){return _0x50bb79[_0xd594('0x20')](_0x1402b9)['then'](function(_0x5f1b62){return _0x5f1b62;});}return null;};}function removeEntity(_0x4025d9,_0x3e3da7){return function(_0x55870f){if(_0x55870f){return _0x55870f['destroy']()['then'](function(){var _0x2178c0=_0x55870f['get']({'plain':!![]});var _0x46b51e=_0xd594('0x21');return db[_0xd594('0x22')][_0xd594('0x23')]({'where':{'type':_0x46b51e,'resourceId':_0x2178c0['id']}})[_0xd594('0x24')](function(){return _0x55870f;});})[_0xd594('0x24')](function(){_0x4025d9[_0xd594('0x18')](0xcc)[_0xd594('0x17')]();});}};}function handleEntityNotFound(_0x3f1927,_0x433181){return function(_0x304791){if(!_0x304791){_0x3f1927[_0xd594('0x16')](0x194);}return _0x304791;};}function handleError(_0x1248c4,_0x514c9a){_0x514c9a=_0x514c9a||0x1f4;return function(_0x41b0bb){logger[_0xd594('0x25')](_0x41b0bb['stack']);if(_0x41b0bb[_0xd594('0x26')]){delete _0x41b0bb[_0xd594('0x26')];}_0x1248c4[_0xd594('0x18')](_0x514c9a)[_0xd594('0x27')](_0x41b0bb);};}exports[_0xd594('0x28')]=function(_0x64ec4b,_0x2ab520){var _0x20dcc2={},_0x506bd5={},_0x801f20={'count':0x0,'rows':[]};var _0x4bd859=_[_0xd594('0x29')](db[_0xd594('0x2a')][_0xd594('0x2b')],function(_0x103434){return{'name':_0x103434[_0xd594('0x2c')],'type':_0x103434[_0xd594('0x2d')][_0xd594('0x2e')]};});_0x506bd5[_0xd594('0x2f')]=_[_0xd594('0x29')](_0x4bd859,_0xd594('0x26'));_0x506bd5[_0xd594('0x30')]=_['keys'](_0x64ec4b[_0xd594('0x30')]);_0x506bd5[_0xd594('0x31')]=_[_0xd594('0x32')](_0x506bd5[_0xd594('0x2f')],_0x506bd5[_0xd594('0x30')]);_0x20dcc2['attributes']=_[_0xd594('0x32')](_0x506bd5[_0xd594('0x2f')],qs['fields'](_0x64ec4b[_0xd594('0x30')][_0xd594('0x33')]));_0x20dcc2['attributes']=_0x20dcc2[_0xd594('0x34')][_0xd594('0x35')]?_0x20dcc2[_0xd594('0x34')]:_0x506bd5[_0xd594('0x2f')];if(!_0x64ec4b[_0xd594('0x30')][_0xd594('0x36')]('nolimit')){_0x20dcc2[_0xd594('0x1a')]=qs[_0xd594('0x1a')](_0x64ec4b[_0xd594('0x30')]['limit']);_0x20dcc2['offset']=qs[_0xd594('0x19')](_0x64ec4b[_0xd594('0x30')][_0xd594('0x19')]);}_0x20dcc2[_0xd594('0x37')]=qs['sort'](_0x64ec4b[_0xd594('0x30')][_0xd594('0x38')]);_0x20dcc2[_0xd594('0x39')]=qs[_0xd594('0x31')](_[_0xd594('0x3a')](_0x64ec4b[_0xd594('0x30')],_0x506bd5[_0xd594('0x31')]),_0x4bd859);if(_0x64ec4b[_0xd594('0x30')][_0xd594('0x3b')]){_0x20dcc2['where']=_[_0xd594('0x3c')](_0x20dcc2[_0xd594('0x39')],{'$or':_[_0xd594('0x29')](_0x4bd859,function(_0x57a0f6){if(_0x57a0f6[_0xd594('0x2d')]!==_0xd594('0x3d')){var _0x56e072={};_0x56e072[_0x57a0f6['name']]={'$like':'%'+_0x64ec4b[_0xd594('0x30')]['filter']+'%'};return _0x56e072;}})});}_0x20dcc2=_[_0xd594('0x3c')]({},_0x20dcc2,_0x64ec4b[_0xd594('0x3e')]);var _0x3fcece={'where':_0x20dcc2[_0xd594('0x39')]};return db[_0xd594('0x2a')][_0xd594('0x3f')](_0x3fcece)['then'](function(_0x31b2de){_0x801f20[_0xd594('0x3f')]=_0x31b2de;if(_0x64ec4b[_0xd594('0x30')]['includeAll']){_0x20dcc2['include']=[{'all':!![]}];}return db[_0xd594('0x2a')]['findAll'](_0x20dcc2);})['then'](function(_0x4cbcd2){_0x801f20['rows']=_0x4cbcd2;return _0x801f20;})[_0xd594('0x24')](respondWithFilteredResult(_0x2ab520,_0x20dcc2))[_0xd594('0x40')](handleError(_0x2ab520,null));};exports[_0xd594('0x41')]=function(_0x1f9463,_0x17629d){var _0x51b834={'raw':!![],'where':{'id':_0x1f9463['params']['id']}},_0x4bbf98={};_0x4bbf98['model']=_[_0xd594('0x42')](db[_0xd594('0x2a')][_0xd594('0x2b')]);_0x4bbf98[_0xd594('0x30')]=_[_0xd594('0x42')](_0x1f9463['query']);_0x4bbf98[_0xd594('0x31')]=_['intersection'](_0x4bbf98[_0xd594('0x2f')],_0x4bbf98['query']);_0x51b834[_0xd594('0x34')]=_[_0xd594('0x32')](_0x4bbf98['model'],qs[_0xd594('0x33')](_0x1f9463[_0xd594('0x30')][_0xd594('0x33')]));_0x51b834[_0xd594('0x34')]=_0x51b834['attributes'][_0xd594('0x35')]?_0x51b834[_0xd594('0x34')]:_0x4bbf98['model'];if(_0x1f9463['query'][_0xd594('0x43')]){_0x51b834[_0xd594('0x44')]=[{'all':!![]}];}_0x51b834=_[_0xd594('0x3c')]({},_0x51b834,_0x1f9463[_0xd594('0x3e')]);return db[_0xd594('0x2a')][_0xd594('0x45')](_0x51b834)[_0xd594('0x24')](handleEntityNotFound(_0x17629d,null))[_0xd594('0x24')](respondWithResult(_0x17629d,null))[_0xd594('0x40')](handleError(_0x17629d,null));};exports[_0xd594('0x46')]=function(_0x19f029,_0x45880a,_0x63316a){return db[_0xd594('0x2a')][_0xd594('0x45')]({'where':{'id':_0x19f029[_0xd594('0x47')]['id']},'attributes':[_0xd594('0x26'),_0xd594('0x48'),'converted_format'],'raw':!![]})[_0xd594('0x24')](handleEntityNotFound(_0x45880a,null))[_0xd594('0x24')](function(_0x2c52db){if(_0x2c52db){if(!fs[_0xd594('0x49')](path[_0xd594('0x4a')](config[_0xd594('0x4b')],_0xd594('0x4c'),_0x2c52db[_0xd594('0x48')]+'.'+_0x2c52db[_0xd594('0x4d')]))){throw new db[(_0xd594('0x4e'))][(_0xd594('0x4f'))]('Sound\x20not\x20found');}return _0x45880a[_0xd594('0x46')](path[_0xd594('0x4a')](config['root'],_0xd594('0x4c'),util[_0xd594('0x50')](_0xd594('0x51'),_0x2c52db[_0xd594('0x48')],_0x2c52db[_0xd594('0x4d')])),util[_0xd594('0x50')]('%s.%s',_0x2c52db['name'],_0x2c52db[_0xd594('0x4d')]));}return null;})[_0xd594('0x40')](handleError(_0x45880a,null));};exports[_0xd594('0x52')]=function(_0x37fac4,_0x24b71d,_0x18b8e9){var _0x55764c={'name':path['basename'](_0x37fac4[_0xd594('0x53')][_0xd594('0x54')],path[_0xd594('0x55')](_0x37fac4[_0xd594('0x53')][_0xd594('0x54')])),'save_name':path[_0xd594('0x56')](_0x37fac4[_0xd594('0x53')][_0xd594('0x57')],path[_0xd594('0x55')](_0x37fac4[_0xd594('0x53')][_0xd594('0x57')])),'original_format':path['extname'](_0x37fac4[_0xd594('0x53')][_0xd594('0x54')])[_0xd594('0x58')](0x1),'converted_format':'wav'};var _0x38cf85=path[_0xd594('0x4a')](config[_0xd594('0x4b')],_0xd594('0x59'),_0x37fac4[_0xd594('0x53')]['filename']);var _0x256846=path['join'](config[_0xd594('0x4b')],_0xd594('0x4c'),util[_0xd594('0x50')](_0xd594('0x51'),path[_0xd594('0x56')](_0x37fac4['file'][_0xd594('0x57')],path[_0xd594('0x55')](_0x37fac4[_0xd594('0x53')][_0xd594('0x57')])),_0x55764c[_0xd594('0x4d')]));logger[_0xd594('0x5a')](_0xd594('0x5b'),_0x38cf85);logger[_0xd594('0x5a')]('Sound\x20upload\x20destination:\x20%s',_0x256846);try{fs[_0xd594('0x5c')](_0x38cf85,parseInt(_0xd594('0x5d'),0x8));var _0x134c56=sox[_0xd594('0x5e')](_0x38cf85,_0x256846,{'sampleRate':0x1f40,'format':_0xd594('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x134c56['on']('error',function(_0x38a0e7){fs['unlinkSync'](_0x38cf85);_0x24b71d[_0xd594('0x18')](0x1f4)[_0xd594('0x27')](_0x38a0e7);});_0x134c56['on']('src',function(_0xd7c3f4){_0x55764c['original_duration']=isNaN(_0xd7c3f4['duration'])?null:_0xd7c3f4['duration']*0x3e8;_0x55764c[_0xd594('0x60')]=isNaN(_0xd7c3f4[_0xd594('0x61')])?null:_0xd7c3f4[_0xd594('0x61')];_0x55764c['original_channelCount']=isNaN(_0xd7c3f4['channelCount'])?null:_0xd7c3f4['channelCount'];_0x55764c['original_bitRate']=isNaN(_0xd7c3f4[_0xd594('0x62')])?null:_0xd7c3f4[_0xd594('0x62')];_0x55764c[_0xd594('0x63')]=isNaN(_0xd7c3f4['sampleRate'])?null:_0xd7c3f4['sampleRate'];});_0x134c56['on'](_0xd594('0x64'),function(_0xe26da0){_0x55764c['converted_duration']=isNaN(_0xe26da0[_0xd594('0x65')])?null:_0xe26da0[_0xd594('0x65')]*0x3e8;_0x55764c[_0xd594('0x66')]=isNaN(_0xe26da0['sampleCount'])?null:_0xe26da0['sampleCount'];_0x55764c[_0xd594('0x67')]=isNaN(_0xe26da0['channelCount'])?null:_0xe26da0['channelCount'];_0x55764c[_0xd594('0x68')]=isNaN(_0xe26da0[_0xd594('0x62')])?null:_0xe26da0[_0xd594('0x62')];_0x55764c['converted_sampleRate']=isNaN(_0xe26da0[_0xd594('0x69')])?null:_0xe26da0[_0xd594('0x69')];});_0x134c56['on'](_0xd594('0x17'),function(){fs['chmodSync'](_0x256846,parseInt(_0xd594('0x5d'),0x8));return db[_0xd594('0x2a')][_0xd594('0x52')](_0x55764c)['then'](function(_0x5861bb){var _0x3eab33={'role':_0x37fac4[_0xd594('0x6a')][_0xd594('0x6b')],'userProfileId':_0x37fac4['body'][_0xd594('0x6c')]};if(!_0x3eab33)throw new Error(_0xd594('0x6d'));if(_0x3eab33[_0xd594('0x6b')]==='user'){var _0x12b9ef=_0x5861bb['get']({'plain':!![]});return db[_0xd594('0x6e')]['find']({'where':{'name':_0xd594('0x21'),'userProfileId':_0x3eab33[_0xd594('0x6c')]},'raw':!![]})[_0xd594('0x24')](function(_0x36d5ba){if(_0x36d5ba&&_0x36d5ba['autoAssociation']===0x0){return db[_0xd594('0x22')]['create']({'name':_0x12b9ef[_0xd594('0x26')],'resourceId':_0x12b9ef['id'],'type':_0x36d5ba[_0xd594('0x26')],'sectionId':_0x36d5ba['id']},{})['then'](function(){return _0x5861bb;});}else{return _0x5861bb;}})['catch'](function(_0x3a9150){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a9150);throw _0x3a9150;});}return _0x5861bb;})[_0xd594('0x24')](respondWithResult(_0x24b71d,null))[_0xd594('0x40')](handleError(_0x24b71d,null));});_0x134c56['start']();}catch(_0x4a2274){_0x24b71d[_0xd594('0x18')](0x1f4)[_0xd594('0x27')](_0x4a2274);}};exports[_0xd594('0x20')]=function(_0x452c12,_0x283085,_0x125db7){return db['Sound']['find']({'where':{'id':_0x452c12[_0xd594('0x47')]['id']}})[_0xd594('0x24')](handleEntityNotFound(_0x283085,null))[_0xd594('0x24')](saveUpdates(_[_0xd594('0x3a')](_0x452c12[_0xd594('0x6a')],[_0xd594('0x26'),_0xd594('0x6f')]),null))[_0xd594('0x24')](respondWithResult(_0x283085,null))[_0xd594('0x40')](handleError(_0x283085,null));};exports[_0xd594('0x70')]=function(_0x13d278,_0x19e558,_0x2fc1db){return db[_0xd594('0x2a')][_0xd594('0x45')]({'where':{'id':_0x13d278[_0xd594('0x47')]['id']}})['then'](function(_0x3795e3){if(_0x3795e3){return _0x3795e3[_0xd594('0x23')]();}})[_0xd594('0x24')](function(_0x1a558f){var _0x509b05=path['join'](config[_0xd594('0x4b')],_0xd594('0x59'),util[_0xd594('0x50')](_0xd594('0x51'),_0x1a558f[_0xd594('0x48')],_0x1a558f[_0xd594('0x71')]));var _0x32e61c=path[_0xd594('0x4a')](config[_0xd594('0x4b')],'server/files/sounds/converted',util[_0xd594('0x50')]('%s.%s',_0x1a558f[_0xd594('0x48')],_0x1a558f[_0xd594('0x4d')]));fs[_0xd594('0x72')](_0x509b05);fs['unlinkSync'](_0x32e61c);return _0x1a558f;})[_0xd594('0x24')](function(_0x10847c){if(_0x10847c){return _0x19e558['status'](0xcc)[_0xd594('0x17')]();}})['then'](handleEntityNotFound(_0x19e558,null))[_0xd594('0x40')](handleError(_0x19e558,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 250378b..ede807f 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 _0x1ee2=['define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x336d23,_0x5ee69a){var _0x3d7248=function(_0x3eea4b){while(--_0x3eea4b){_0x336d23['push'](_0x336d23['shift']());}};_0x3d7248(++_0x5ee69a);}(_0x1ee2,0x1d7));var _0x21ee=function(_0x1f0e74,_0x53c4a9){_0x1f0e74=_0x1f0e74-0x0;var _0x323a48=_0x1ee2[_0x1f0e74];return _0x323a48;};'use strict';var _=require(_0x21ee('0x0'));var util=require(_0x21ee('0x1'));var logger=require(_0x21ee('0x2'))(_0x21ee('0x3'));var moment=require(_0x21ee('0x4'));var BPromise=require('bluebird');var rp=require(_0x21ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21ee('0x6'));var config=require(_0x21ee('0x7'));var attributes=require(_0x21ee('0x8'));module[_0x21ee('0x9')]=function(_0x1ea9c2,_0x3c851e){return _0x1ea9c2[_0x21ee('0xa')](_0x21ee('0xb'),attributes,{'tableName':_0x21ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bf7=['../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','api','moment','bluebird','request-promise'];(function(_0x499715,_0xa6b5bd){var _0x40bf6d=function(_0x44f1ea){while(--_0x44f1ea){_0x499715['push'](_0x499715['shift']());}};_0x40bf6d(++_0xa6b5bd);}(_0x8bf7,0x14f));var _0x78bf=function(_0x3388c6,_0x2b96f2){_0x3388c6=_0x3388c6-0x0;var _0x8dbf96=_0x8bf7[_0x3388c6];return _0x8dbf96;};'use strict';var _=require(_0x78bf('0x0'));var util=require(_0x78bf('0x1'));var logger=require('../../config/logger')(_0x78bf('0x2'));var moment=require(_0x78bf('0x3'));var BPromise=require(_0x78bf('0x4'));var rp=require(_0x78bf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x78bf('0x6'));var attributes=require(_0x78bf('0x7'));module[_0x78bf('0x8')]=function(_0x3e2caf,_0x57c3d8){return _0x3e2caf[_0x78bf('0x9')](_0x78bf('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 13c6340..ae25eef 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 _0x4b20=['info','result','catch','Sound','find','options','raw','where','attributes','include','map','model','ShowSound','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5ee20b,_0x5d2159){var _0x7dc82e=function(_0x33807c){while(--_0x33807c){_0x5ee20b['push'](_0x5ee20b['shift']());}};_0x7dc82e(++_0x5d2159);}(_0x4b20,0x1bf));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x04b2('0x0'));var moment=require(_0x04b2('0x1'));var BPromise=require(_0x04b2('0x2'));var rs=require(_0x04b2('0x3'));var fs=require('fs');var Redis=require(_0x04b2('0x4'));var db=require(_0x04b2('0x5'))['db'];var utils=require(_0x04b2('0x6'));var logger=require(_0x04b2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x04b2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x234a07,_0x5f249d,_0x327f84){return new BPromise(function(_0x2913cd,_0x5e8877){return client['request'](_0x234a07,_0x327f84)[_0x04b2('0x9')](function(_0x3ccbcc){logger['info'](_0x04b2('0xa'),_0x5f249d,_0x04b2('0xb'));logger[_0x04b2('0xc')](_0x04b2('0xd'),_0x5f249d,_0x04b2('0xb'),JSON[_0x04b2('0xe')](_0x3ccbcc));if(_0x3ccbcc['error']){if(_0x3ccbcc[_0x04b2('0xf')][_0x04b2('0x10')]===0x1f4){logger['error'](_0x04b2('0xa'),_0x5f249d,_0x3ccbcc['error'][_0x04b2('0x11')]);return _0x5e8877(_0x3ccbcc[_0x04b2('0xf')][_0x04b2('0x11')]);}logger['error']('Sound,\x20%s,\x20%s',_0x5f249d,_0x3ccbcc[_0x04b2('0xf')][_0x04b2('0x11')]);return _0x2913cd(_0x3ccbcc[_0x04b2('0xf')]['message']);}else{logger[_0x04b2('0x12')](_0x04b2('0xa'),_0x5f249d,_0x04b2('0xb'));_0x2913cd(_0x3ccbcc[_0x04b2('0x13')][_0x04b2('0x11')]);}})[_0x04b2('0x14')](function(_0x568605){logger[_0x04b2('0xf')]('Sound,\x20%s,\x20%s',_0x5f249d,_0x568605);_0x5e8877(_0x568605);});});}exports['ShowSound']=function(_0x4e5d0c){var _0x57c363=this;return new Promise(function(_0x5ce0ef,_0x54942c){return db[_0x04b2('0x15')][_0x04b2('0x16')]({'raw':_0x4e5d0c[_0x04b2('0x17')]?_0x4e5d0c[_0x04b2('0x17')][_0x04b2('0x18')]===undefined?!![]:![]:!![],'where':_0x4e5d0c[_0x04b2('0x17')]?_0x4e5d0c[_0x04b2('0x17')][_0x04b2('0x19')]||null:null,'attributes':_0x4e5d0c[_0x04b2('0x17')]?_0x4e5d0c['options'][_0x04b2('0x1a')]||null:null,'include':_0x4e5d0c[_0x04b2('0x17')]?_0x4e5d0c[_0x04b2('0x17')][_0x04b2('0x1b')]?_[_0x04b2('0x1c')](_0x4e5d0c['options']['include'],function(_0x2cea44){return{'model':db[_0x2cea44[_0x04b2('0x1d')]],'as':_0x2cea44['as'],'attributes':_0x2cea44[_0x04b2('0x1a')],'include':_0x2cea44[_0x04b2('0x1b')]?_[_0x04b2('0x1c')](_0x2cea44[_0x04b2('0x1b')],function(_0x5e7f31){return{'model':db[_0x5e7f31[_0x04b2('0x1d')]],'as':_0x5e7f31['as'],'attributes':_0x5e7f31[_0x04b2('0x1a')],'include':_0x5e7f31[_0x04b2('0x1b')]?_[_0x04b2('0x1c')](_0x5e7f31['include'],function(_0x1d410c){return{'model':db[_0x1d410c[_0x04b2('0x1d')]],'as':_0x1d410c['as'],'attributes':_0x1d410c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a258c){logger[_0x04b2('0x12')]('ShowSound',_0x4e5d0c);logger[_0x04b2('0xc')](_0x04b2('0x1e'),_0x4e5d0c,JSON[_0x04b2('0xe')](_0x3a258c));_0x5ce0ef(_0x3a258c);})[_0x04b2('0x14')](function(_0x36ba21){logger[_0x04b2('0xf')](_0x04b2('0x1e'),_0x36ba21[_0x04b2('0x11')],_0x4e5d0c);_0x54942c(_0x57c363[_0x04b2('0xf')](0x1f4,_0x36ba21[_0x04b2('0x11')]));});});}; \ No newline at end of file +var _0xa8fa=['lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSound','Sound','find','raw','options','where','attributes','include','map','model','stringify'];(function(_0x1a788a,_0x3d0b62){var _0x86edb3=function(_0x1b14bd){while(--_0x1b14bd){_0x1a788a['push'](_0x1a788a['shift']());}};_0x86edb3(++_0x3d0b62);}(_0xa8fa,0x129));var _0xaa8f=function(_0x388898,_0x1728a8){_0x388898=_0x388898-0x0;var _0x4b2bdd=_0xa8fa[_0x388898];return _0x4b2bdd;};'use strict';var _=require(_0xaa8f('0x0'));var util=require('util');var moment=require(_0xaa8f('0x1'));var BPromise=require(_0xaa8f('0x2'));var rs=require(_0xaa8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa8f('0x4'));var logger=require('../../config/logger')(_0xaa8f('0x5'));var config=require(_0xaa8f('0x6'));var jayson=require(_0xaa8f('0x7'));var client=jayson[_0xaa8f('0x8')][_0xaa8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49de69,_0x14db6b,_0x51df4e){return new BPromise(function(_0x110235,_0x59bfe7){return client[_0xaa8f('0xa')](_0x49de69,_0x51df4e)[_0xaa8f('0xb')](function(_0x13252d){logger['info'](_0xaa8f('0xc'),_0x14db6b,_0xaa8f('0xd'));logger[_0xaa8f('0xe')](_0xaa8f('0xf'),_0x14db6b,_0xaa8f('0xd'),JSON['stringify'](_0x13252d));if(_0x13252d[_0xaa8f('0x10')]){if(_0x13252d[_0xaa8f('0x10')][_0xaa8f('0x11')]===0x1f4){logger['error'](_0xaa8f('0xc'),_0x14db6b,_0x13252d['error']['message']);return _0x59bfe7(_0x13252d[_0xaa8f('0x10')]['message']);}logger['error']('Sound,\x20%s,\x20%s',_0x14db6b,_0x13252d[_0xaa8f('0x10')][_0xaa8f('0x12')]);return _0x110235(_0x13252d[_0xaa8f('0x10')][_0xaa8f('0x12')]);}else{logger[_0xaa8f('0x13')]('Sound,\x20%s,\x20%s',_0x14db6b,_0xaa8f('0xd'));_0x110235(_0x13252d[_0xaa8f('0x14')]['message']);}})[_0xaa8f('0x15')](function(_0x240454){logger[_0xaa8f('0x10')](_0xaa8f('0xc'),_0x14db6b,_0x240454);_0x59bfe7(_0x240454);});});}exports[_0xaa8f('0x16')]=function(_0x1b67ea){var _0x12f30c=this;return new Promise(function(_0x25782c,_0x239c25){return db[_0xaa8f('0x17')][_0xaa8f('0x18')]({'raw':_0x1b67ea['options']?_0x1b67ea['options'][_0xaa8f('0x19')]===undefined?!![]:![]:!![],'where':_0x1b67ea[_0xaa8f('0x1a')]?_0x1b67ea[_0xaa8f('0x1a')][_0xaa8f('0x1b')]||null:null,'attributes':_0x1b67ea[_0xaa8f('0x1a')]?_0x1b67ea['options'][_0xaa8f('0x1c')]||null:null,'include':_0x1b67ea[_0xaa8f('0x1a')]?_0x1b67ea[_0xaa8f('0x1a')][_0xaa8f('0x1d')]?_[_0xaa8f('0x1e')](_0x1b67ea[_0xaa8f('0x1a')][_0xaa8f('0x1d')],function(_0x1868ed){return{'model':db[_0x1868ed[_0xaa8f('0x1f')]],'as':_0x1868ed['as'],'attributes':_0x1868ed[_0xaa8f('0x1c')],'include':_0x1868ed[_0xaa8f('0x1d')]?_['map'](_0x1868ed[_0xaa8f('0x1d')],function(_0xba24ae){return{'model':db[_0xba24ae['model']],'as':_0xba24ae['as'],'attributes':_0xba24ae[_0xaa8f('0x1c')],'include':_0xba24ae[_0xaa8f('0x1d')]?_[_0xaa8f('0x1e')](_0xba24ae[_0xaa8f('0x1d')],function(_0x1b638a){return{'model':db[_0x1b638a[_0xaa8f('0x1f')]],'as':_0x1b638a['as'],'attributes':_0x1b638a[_0xaa8f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaa8f('0xb')](function(_0x5f4072){logger[_0xaa8f('0x13')](_0xaa8f('0x16'),_0x1b67ea);logger[_0xaa8f('0xe')](_0xaa8f('0x16'),_0x1b67ea,JSON[_0xaa8f('0x20')](_0x5f4072));_0x25782c(_0x5f4072);})[_0xaa8f('0x15')](function(_0x46d32e){logger['error'](_0xaa8f('0x16'),_0x46d32e[_0xaa8f('0x12')],_0x1b67ea);_0x239c25(_0x12f30c[_0xaa8f('0x10')](0x1f4,_0x46d32e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 6100601..6872dba 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 _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x259853,_0x12d0b3){var _0x47721f=function(_0x349360){while(--_0x349360){_0x259853['push'](_0x259853['shift']());}};_0x47721f(++_0x12d0b3);}(_0x757a,0xde));var _0xa757=function(_0x33d619,_0x18f26d){_0x33d619=_0x33d619-0x0;var _0x13ac4c=_0x757a[_0x33d619];return _0x13ac4c;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0xf05fc0,_0x52369b){var _0x1427c0=function(_0x3fc9ee){while(--_0x3fc9ee){_0xf05fc0['push'](_0xf05fc0['shift']());}};_0x1427c0(++_0x52369b);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x5eb8[_0x5c38cd];return _0xc985ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f258aed..33732a6 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 _0x66a1=['ENUM','STRING','TEXT'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x66a1,0x94));var _0x166a=function(_0x4061ca,_0x5e7fc3){_0x4061ca=_0x4061ca-0x0;var _0x532491=_0x66a1[_0x4061ca];return _0x532491;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x166a('0x0')]},'body':{'type':Sequelize[_0x166a('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x166a('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x166a('0x0')]},'providerResponse':{'type':Sequelize[_0x166a('0x1')]}}; \ No newline at end of file +var _0x80e1=['medium','ENUM','out','exports','STRING','TEXT'];(function(_0x5c3834,_0x2f4bcc){var _0x415f97=function(_0x1a76ed){while(--_0x1a76ed){_0x5c3834['push'](_0x5c3834['shift']());}};_0x415f97(++_0x2f4bcc);}(_0x80e1,0x81));var _0x180e=function(_0x333e5f,_0x20bcbc){_0x333e5f=_0x333e5f-0x0;var _0x16cf30=_0x80e1[_0x333e5f];return _0x16cf30;};'use strict';var Sequelize=require('sequelize');module[_0x180e('0x0')]={'uniqueid':{'type':Sequelize[_0x180e('0x1')]},'body':{'type':Sequelize[_0x180e('0x2')](_0x180e('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x180e('0x4')]('in',_0x180e('0x5')),'defaultValue':_0x180e('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x180e('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7b55d79..118a2eb 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 _0x0419=['fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','create','body','find','zip-dir'];(function(_0x5421a4,_0x362d8b){var _0x16b546=function(_0x2aa318){while(--_0x2aa318){_0x5421a4['push'](_0x5421a4['shift']());}};_0x16b546(++_0x362d8b);}(_0x0419,0x153));var _0x9041=function(_0x27f88b,_0x526bad){_0x27f88b=_0x27f88b-0x0;var _0x2114f4=_0x0419[_0x27f88b];return _0x2114f4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9041('0x0'));var jsonpatch=require(_0x9041('0x1'));var rp=require(_0x9041('0x2'));var moment=require(_0x9041('0x3'));var BPromise=require(_0x9041('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9041('0x5'));var sox=require(_0x9041('0x6'));var csv=require(_0x9041('0x7'));var ejs=require(_0x9041('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9041('0x9'));var squel=require(_0x9041('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9041('0xb'));var toCsv=require(_0x9041('0x7'));var querystring=require(_0x9041('0xc'));var Papa=require('papaparse');var Redis=require(_0x9041('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9041('0xe'));var as=require(_0x9041('0xf'));var hardwareService=require(_0x9041('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x9041('0x11'));var config=require(_0x9041('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39c188,_0x8185f4){_0x8185f4=_0x8185f4||0xcc;return function(_0x2874c4){if(_0x2874c4){return _0x39c188[_0x9041('0x13')](_0x8185f4);}return _0x39c188[_0x9041('0x14')](_0x8185f4)[_0x9041('0x15')]();};}function respondWithResult(_0x57b91a,_0x23a86c){_0x23a86c=_0x23a86c||0xc8;return function(_0x3c3c01){if(_0x3c3c01){return _0x57b91a[_0x9041('0x14')](_0x23a86c)[_0x9041('0x16')](_0x3c3c01);}};}function respondWithFilteredResult(_0x52c21b,_0x52db38){return function(_0x5ab8ff){if(_0x5ab8ff){var _0x45cf58=typeof _0x52db38[_0x9041('0x17')]===_0x9041('0x18')&&typeof _0x52db38['limit']===_0x9041('0x18');var _0x421177=_0x5ab8ff[_0x9041('0x19')];var _0x4ebe42=_0x45cf58?0x0:_0x52db38[_0x9041('0x17')];var _0xf0630d=_0x45cf58?_0x5ab8ff[_0x9041('0x19')]:_0x52db38[_0x9041('0x17')]+_0x52db38[_0x9041('0x1a')];var _0x9ae452;if(_0xf0630d>=_0x421177){_0xf0630d=_0x421177;_0x9ae452=0xc8;}else{_0x9ae452=0xce;}_0x52c21b[_0x9041('0x14')](_0x9ae452);return _0x52c21b[_0x9041('0x1b')]('Content-Range',_0x4ebe42+'-'+_0xf0630d+'/'+_0x421177)[_0x9041('0x16')](_0x5ab8ff);}return null;};}function patchUpdates(_0xa8ee07){return function(_0x3b4324){try{jsonpatch['apply'](_0x3b4324,_0xa8ee07,!![]);}catch(_0x1e4369){return BPromise[_0x9041('0x1c')](_0x1e4369);}return _0x3b4324[_0x9041('0x1d')]();};}function saveUpdates(_0x5a3c7a,_0x12c81c){return function(_0x501dcc){if(_0x501dcc){return _0x501dcc[_0x9041('0x1e')](_0x5a3c7a)[_0x9041('0x1f')](function(_0x54d619){return _0x54d619;});}return null;};}function removeEntity(_0x5ce0be,_0x4767f6){return function(_0x3d0002){if(_0x3d0002){return _0x3d0002[_0x9041('0x20')]()[_0x9041('0x1f')](function(){_0x5ce0be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47264a,_0x425da1){return function(_0x11401a){if(!_0x11401a){_0x47264a[_0x9041('0x13')](0x194);}return _0x11401a;};}function handleError(_0x1fc7cd,_0x5a48f5){_0x5a48f5=_0x5a48f5||0x1f4;return function(_0x45287c){logger[_0x9041('0x21')](_0x45287c['stack']);if(_0x45287c[_0x9041('0x22')]){delete _0x45287c[_0x9041('0x22')];}_0x1fc7cd[_0x9041('0x14')](_0x5a48f5)[_0x9041('0x23')](_0x45287c);};}exports[_0x9041('0x24')]=function(_0x462620,_0x20b434){var _0x33ef88={},_0x16af4c={},_0xd3861e={'count':0x0,'rows':[]};var _0xf5b071=_[_0x9041('0x25')](db[_0x9041('0x26')][_0x9041('0x27')],function(_0x388ed2){return{'name':_0x388ed2[_0x9041('0x28')],'type':_0x388ed2['type'][_0x9041('0x29')]};});_0x16af4c[_0x9041('0x2a')]=_[_0x9041('0x25')](_0xf5b071,'name');_0x16af4c[_0x9041('0x2b')]=_[_0x9041('0x2c')](_0x462620[_0x9041('0x2b')]);_0x16af4c[_0x9041('0x2d')]=_[_0x9041('0x2e')](_0x16af4c[_0x9041('0x2a')],_0x16af4c['query']);_0x33ef88['attributes']=_['intersection'](_0x16af4c['model'],qs[_0x9041('0x2f')](_0x462620[_0x9041('0x2b')]['fields']));_0x33ef88['attributes']=_0x33ef88[_0x9041('0x30')][_0x9041('0x31')]?_0x33ef88[_0x9041('0x30')]:_0x16af4c[_0x9041('0x2a')];if(!_0x462620[_0x9041('0x2b')][_0x9041('0x32')]('nolimit')){_0x33ef88['limit']=qs['limit'](_0x462620[_0x9041('0x2b')]['limit']);_0x33ef88['offset']=qs[_0x9041('0x17')](_0x462620[_0x9041('0x2b')][_0x9041('0x17')]);}_0x33ef88[_0x9041('0x33')]=qs[_0x9041('0x34')](_0x462620[_0x9041('0x2b')][_0x9041('0x34')]);_0x33ef88['where']=qs[_0x9041('0x2d')](_[_0x9041('0x35')](_0x462620[_0x9041('0x2b')],_0x16af4c['filters']),_0xf5b071);if(_0x462620[_0x9041('0x2b')][_0x9041('0x36')]){_0x33ef88[_0x9041('0x37')]=_['merge'](_0x33ef88[_0x9041('0x37')],{'$or':_[_0x9041('0x25')](_0xf5b071,function(_0xc23c9){if(_0xc23c9['type']!==_0x9041('0x38')){var _0x758ab5={};_0x758ab5[_0xc23c9[_0x9041('0x22')]]={'$like':'%'+_0x462620[_0x9041('0x2b')][_0x9041('0x36')]+'%'};return _0x758ab5;}})});}_0x33ef88=_[_0x9041('0x39')]({},_0x33ef88,_0x462620[_0x9041('0x3a')]);var _0x3f6c64={'where':_0x33ef88[_0x9041('0x37')]};return db['SquareMessage']['count'](_0x3f6c64)[_0x9041('0x1f')](function(_0x4bdebf){_0xd3861e['count']=_0x4bdebf;if(_0x462620[_0x9041('0x2b')]['includeAll']){_0x33ef88[_0x9041('0x3b')]=[{'all':!![]}];}return db['SquareMessage'][_0x9041('0x3c')](_0x33ef88);})[_0x9041('0x1f')](function(_0x49432c){_0xd3861e['rows']=_0x49432c;return _0xd3861e;})[_0x9041('0x1f')](respondWithFilteredResult(_0x20b434,_0x33ef88))[_0x9041('0x3d')](handleError(_0x20b434,null));};exports[_0x9041('0x3e')]=function(_0x19f24e,_0x229037){var _0x6f89ae={'raw':!![],'where':{'id':_0x19f24e[_0x9041('0x3f')]['id']}},_0x23b60f={};_0x23b60f[_0x9041('0x2a')]=_[_0x9041('0x2c')](db[_0x9041('0x26')][_0x9041('0x27')]);_0x23b60f[_0x9041('0x2b')]=_[_0x9041('0x2c')](_0x19f24e[_0x9041('0x2b')]);_0x23b60f[_0x9041('0x2d')]=_['intersection'](_0x23b60f[_0x9041('0x2a')],_0x23b60f['query']);_0x6f89ae['attributes']=_['intersection'](_0x23b60f[_0x9041('0x2a')],qs[_0x9041('0x2f')](_0x19f24e['query'][_0x9041('0x2f')]));_0x6f89ae[_0x9041('0x30')]=_0x6f89ae[_0x9041('0x30')][_0x9041('0x31')]?_0x6f89ae[_0x9041('0x30')]:_0x23b60f['model'];if(_0x19f24e['query'][_0x9041('0x40')]){_0x6f89ae[_0x9041('0x3b')]=[{'all':!![]}];}_0x6f89ae=_['merge']({},_0x6f89ae,_0x19f24e['options']);return db['SquareMessage']['find'](_0x6f89ae)[_0x9041('0x1f')](handleEntityNotFound(_0x229037,null))[_0x9041('0x1f')](respondWithResult(_0x229037,null))['catch'](handleError(_0x229037,null));};exports[_0x9041('0x41')]=function(_0x261f64,_0x1770a7){return db['SquareMessage'][_0x9041('0x41')](_0x261f64['body'],{})[_0x9041('0x1f')](respondWithResult(_0x1770a7,0xc9))['catch'](handleError(_0x1770a7,null));};exports[_0x9041('0x1e')]=function(_0x505729,_0x6d7e7f){if(_0x505729[_0x9041('0x42')]['id']){delete _0x505729[_0x9041('0x42')]['id'];}return db['SquareMessage'][_0x9041('0x43')]({'where':{'id':_0x505729[_0x9041('0x3f')]['id']}})[_0x9041('0x1f')](handleEntityNotFound(_0x6d7e7f,null))[_0x9041('0x1f')](saveUpdates(_0x505729[_0x9041('0x42')],null))[_0x9041('0x1f')](respondWithResult(_0x6d7e7f,null))['catch'](handleError(_0x6d7e7f,null));};exports['destroy']=function(_0xc9325c,_0x4b9e9f){return db[_0x9041('0x26')]['find']({'where':{'id':_0xc9325c[_0x9041('0x3f')]['id']}})[_0x9041('0x1f')](handleEntityNotFound(_0x4b9e9f,null))[_0x9041('0x1f')](removeEntity(_0x4b9e9f,null))[_0x9041('0x3d')](handleError(_0x4b9e9f,null));}; \ No newline at end of file +var _0x5a1c=['find','catch','create','body','update','eml-format','rimraf','request-promise','bluebird','mustache','util','path','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','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','nolimit','sort','where','pick','filters','merge','type','VIRTUAL','options','rows','show','params','includeAll','include'];(function(_0xafdb3e,_0x1fb4de){var _0x260d03=function(_0x4cbb4d){while(--_0x4cbb4d){_0xafdb3e['push'](_0xafdb3e['shift']());}};_0x260d03(++_0x1fb4de);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0xab5241,_0x4287a4){_0xab5241=_0xab5241-0x0;var _0x64f196=_0x5a1c[_0xab5241];return _0x64f196;};'use strict';var emlformat=require(_0xc5a1('0x0'));var rimraf=require(_0xc5a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc5a1('0x2'));var moment=require('moment');var BPromise=require(_0xc5a1('0x3'));var Mustache=require(_0xc5a1('0x4'));var util=require(_0xc5a1('0x5'));var path=require(_0xc5a1('0x6'));var sox=require('sox');var csv=require(_0xc5a1('0x7'));var ejs=require(_0xc5a1('0x8'));var fs=require('fs');var fs_extra=require(_0xc5a1('0x9'));var _=require('lodash');var squel=require(_0xc5a1('0xa'));var crypto=require(_0xc5a1('0xb'));var jsforce=require(_0xc5a1('0xc'));var deskjs=require(_0xc5a1('0xd'));var toCsv=require(_0xc5a1('0x7'));var querystring=require(_0xc5a1('0xe'));var Papa=require(_0xc5a1('0xf'));var Redis=require(_0xc5a1('0x10'));var authService=require(_0xc5a1('0x11'));var qs=require(_0xc5a1('0x12'));var as=require(_0xc5a1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5a1('0x14'))(_0xc5a1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc5a1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17d063,_0x5f2534){_0x5f2534=_0x5f2534||0xcc;return function(_0x37b863){if(_0x37b863){return _0x17d063[_0xc5a1('0x17')](_0x5f2534);}return _0x17d063['status'](_0x5f2534)[_0xc5a1('0x18')]();};}function respondWithResult(_0x4b8056,_0xa8e50a){_0xa8e50a=_0xa8e50a||0xc8;return function(_0x56406c){if(_0x56406c){return _0x4b8056[_0xc5a1('0x19')](_0xa8e50a)[_0xc5a1('0x1a')](_0x56406c);}};}function respondWithFilteredResult(_0x289fdd,_0x15a5e9){return function(_0x3e99b5){if(_0x3e99b5){var _0x5af680=typeof _0x15a5e9[_0xc5a1('0x1b')]===_0xc5a1('0x1c')&&typeof _0x15a5e9[_0xc5a1('0x1d')]===_0xc5a1('0x1c');var _0x3c64b2=_0x3e99b5[_0xc5a1('0x1e')];var _0x174693=_0x5af680?0x0:_0x15a5e9['offset'];var _0x354bd3=_0x5af680?_0x3e99b5[_0xc5a1('0x1e')]:_0x15a5e9[_0xc5a1('0x1b')]+_0x15a5e9[_0xc5a1('0x1d')];var _0x5f1409;if(_0x354bd3>=_0x3c64b2){_0x354bd3=_0x3c64b2;_0x5f1409=0xc8;}else{_0x5f1409=0xce;}_0x289fdd[_0xc5a1('0x19')](_0x5f1409);return _0x289fdd[_0xc5a1('0x1f')](_0xc5a1('0x20'),_0x174693+'-'+_0x354bd3+'/'+_0x3c64b2)[_0xc5a1('0x1a')](_0x3e99b5);}return null;};}function patchUpdates(_0x13d8e6){return function(_0x35152d){try{jsonpatch[_0xc5a1('0x21')](_0x35152d,_0x13d8e6,!![]);}catch(_0x1bde6c){return BPromise['reject'](_0x1bde6c);}return _0x35152d[_0xc5a1('0x22')]();};}function saveUpdates(_0x578788,_0x4137e6){return function(_0x3f8614){if(_0x3f8614){return _0x3f8614['update'](_0x578788)[_0xc5a1('0x23')](function(_0x2085fa){return _0x2085fa;});}return null;};}function removeEntity(_0x5240e4,_0x5352fe){return function(_0xc726f7){if(_0xc726f7){return _0xc726f7[_0xc5a1('0x24')]()['then'](function(){_0x5240e4[_0xc5a1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29a6f8,_0x397c34){return function(_0x34de5a){if(!_0x34de5a){_0x29a6f8[_0xc5a1('0x17')](0x194);}return _0x34de5a;};}function handleError(_0x34998d,_0x344673){_0x344673=_0x344673||0x1f4;return function(_0x29e7cf){logger[_0xc5a1('0x25')](_0x29e7cf[_0xc5a1('0x26')]);if(_0x29e7cf[_0xc5a1('0x27')]){delete _0x29e7cf[_0xc5a1('0x27')];}_0x34998d['status'](_0x344673)[_0xc5a1('0x28')](_0x29e7cf);};}exports[_0xc5a1('0x29')]=function(_0x5ea691,_0x3671cd){var _0x53112b={},_0x854671={},_0x580488={'count':0x0,'rows':[]};var _0x40ae05=_[_0xc5a1('0x2a')](db[_0xc5a1('0x2b')][_0xc5a1('0x2c')],function(_0x1bf164){return{'name':_0x1bf164[_0xc5a1('0x2d')],'type':_0x1bf164['type'][_0xc5a1('0x2e')]};});_0x854671['model']=_['map'](_0x40ae05,_0xc5a1('0x27'));_0x854671[_0xc5a1('0x2f')]=_[_0xc5a1('0x30')](_0x5ea691[_0xc5a1('0x2f')]);_0x854671['filters']=_[_0xc5a1('0x31')](_0x854671['model'],_0x854671[_0xc5a1('0x2f')]);_0x53112b['attributes']=_[_0xc5a1('0x31')](_0x854671[_0xc5a1('0x32')],qs[_0xc5a1('0x33')](_0x5ea691['query'][_0xc5a1('0x33')]));_0x53112b[_0xc5a1('0x34')]=_0x53112b[_0xc5a1('0x34')]['length']?_0x53112b[_0xc5a1('0x34')]:_0x854671['model'];if(!_0x5ea691[_0xc5a1('0x2f')]['hasOwnProperty'](_0xc5a1('0x35'))){_0x53112b[_0xc5a1('0x1d')]=qs[_0xc5a1('0x1d')](_0x5ea691[_0xc5a1('0x2f')][_0xc5a1('0x1d')]);_0x53112b[_0xc5a1('0x1b')]=qs[_0xc5a1('0x1b')](_0x5ea691[_0xc5a1('0x2f')]['offset']);}_0x53112b['order']=qs[_0xc5a1('0x36')](_0x5ea691[_0xc5a1('0x2f')][_0xc5a1('0x36')]);_0x53112b[_0xc5a1('0x37')]=qs['filters'](_[_0xc5a1('0x38')](_0x5ea691[_0xc5a1('0x2f')],_0x854671[_0xc5a1('0x39')]),_0x40ae05);if(_0x5ea691[_0xc5a1('0x2f')]['filter']){_0x53112b['where']=_[_0xc5a1('0x3a')](_0x53112b['where'],{'$or':_['map'](_0x40ae05,function(_0x3e3f08){if(_0x3e3f08[_0xc5a1('0x3b')]!==_0xc5a1('0x3c')){var _0x11b721={};_0x11b721[_0x3e3f08[_0xc5a1('0x27')]]={'$like':'%'+_0x5ea691[_0xc5a1('0x2f')]['filter']+'%'};return _0x11b721;}})});}_0x53112b=_[_0xc5a1('0x3a')]({},_0x53112b,_0x5ea691[_0xc5a1('0x3d')]);var _0x3fd7a7={'where':_0x53112b[_0xc5a1('0x37')]};return db['SquareMessage']['count'](_0x3fd7a7)[_0xc5a1('0x23')](function(_0x764d6a){_0x580488[_0xc5a1('0x1e')]=_0x764d6a;if(_0x5ea691[_0xc5a1('0x2f')]['includeAll']){_0x53112b['include']=[{'all':!![]}];}return db[_0xc5a1('0x2b')]['findAll'](_0x53112b);})[_0xc5a1('0x23')](function(_0x1403b3){_0x580488[_0xc5a1('0x3e')]=_0x1403b3;return _0x580488;})['then'](respondWithFilteredResult(_0x3671cd,_0x53112b))['catch'](handleError(_0x3671cd,null));};exports[_0xc5a1('0x3f')]=function(_0x1fb5ca,_0x38f4a7){var _0x2154e1={'raw':!![],'where':{'id':_0x1fb5ca[_0xc5a1('0x40')]['id']}},_0x4309f4={};_0x4309f4[_0xc5a1('0x32')]=_[_0xc5a1('0x30')](db[_0xc5a1('0x2b')][_0xc5a1('0x2c')]);_0x4309f4[_0xc5a1('0x2f')]=_[_0xc5a1('0x30')](_0x1fb5ca['query']);_0x4309f4['filters']=_[_0xc5a1('0x31')](_0x4309f4[_0xc5a1('0x32')],_0x4309f4['query']);_0x2154e1[_0xc5a1('0x34')]=_['intersection'](_0x4309f4['model'],qs[_0xc5a1('0x33')](_0x1fb5ca[_0xc5a1('0x2f')][_0xc5a1('0x33')]));_0x2154e1[_0xc5a1('0x34')]=_0x2154e1[_0xc5a1('0x34')]['length']?_0x2154e1[_0xc5a1('0x34')]:_0x4309f4[_0xc5a1('0x32')];if(_0x1fb5ca[_0xc5a1('0x2f')][_0xc5a1('0x41')]){_0x2154e1[_0xc5a1('0x42')]=[{'all':!![]}];}_0x2154e1=_[_0xc5a1('0x3a')]({},_0x2154e1,_0x1fb5ca[_0xc5a1('0x3d')]);return db['SquareMessage'][_0xc5a1('0x43')](_0x2154e1)['then'](handleEntityNotFound(_0x38f4a7,null))[_0xc5a1('0x23')](respondWithResult(_0x38f4a7,null))[_0xc5a1('0x44')](handleError(_0x38f4a7,null));};exports[_0xc5a1('0x45')]=function(_0x2e2cde,_0x11488d){return db[_0xc5a1('0x2b')][_0xc5a1('0x45')](_0x2e2cde[_0xc5a1('0x46')],{})[_0xc5a1('0x23')](respondWithResult(_0x11488d,0xc9))[_0xc5a1('0x44')](handleError(_0x11488d,null));};exports[_0xc5a1('0x47')]=function(_0x57e111,_0x49aaca){if(_0x57e111[_0xc5a1('0x46')]['id']){delete _0x57e111['body']['id'];}return db['SquareMessage'][_0xc5a1('0x43')]({'where':{'id':_0x57e111[_0xc5a1('0x40')]['id']}})[_0xc5a1('0x23')](handleEntityNotFound(_0x49aaca,null))[_0xc5a1('0x23')](saveUpdates(_0x57e111[_0xc5a1('0x46')],null))[_0xc5a1('0x23')](respondWithResult(_0x49aaca,null))[_0xc5a1('0x44')](handleError(_0x49aaca,null));};exports[_0xc5a1('0x24')]=function(_0x3e74af,_0x4b91fc){return db[_0xc5a1('0x2b')]['find']({'where':{'id':_0x3e74af[_0xc5a1('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b91fc,null))['then'](removeEntity(_0x4b91fc,null))[_0xc5a1('0x44')](handleError(_0x4b91fc,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 06fbf78..c4e4dda 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 _0xb6a9=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3f6009,_0x2e5f25){var _0x1c2377=function(_0x1e40ad){while(--_0x1e40ad){_0x3f6009['push'](_0x3f6009['shift']());}};_0x1c2377(++_0x2e5f25);}(_0xb6a9,0x1c2));var _0x9b6a=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xb6a9[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x9b6a('0x0'));var util=require(_0x9b6a('0x1'));var logger=require(_0x9b6a('0x2'))(_0x9b6a('0x3'));var moment=require(_0x9b6a('0x4'));var BPromise=require('bluebird');var rp=require(_0x9b6a('0x5'));var fs=require('fs');var path=require(_0x9b6a('0x6'));var rimraf=require(_0x9b6a('0x7'));var config=require(_0x9b6a('0x8'));var attributes=require(_0x9b6a('0x9'));module[_0x9b6a('0xa')]=function(_0x41a298,_0xa0493c){return _0x41a298['define'](_0x9b6a('0xb'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x318a=['SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x129059,_0x33a8c1){var _0xc4ae62=function(_0x1da5f7){while(--_0x1da5f7){_0x129059['push'](_0x129059['shift']());}};_0xc4ae62(++_0x33a8c1);}(_0x318a,0x7a));var _0xa318=function(_0x56f26c,_0x3c51eb){_0x56f26c=_0x56f26c-0x0;var _0x26420f=_0x318a[_0x56f26c];return _0x26420f;};'use strict';var _=require(_0xa318('0x0'));var util=require(_0xa318('0x1'));var logger=require(_0xa318('0x2'))(_0xa318('0x3'));var moment=require(_0xa318('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa318('0x5'));var rimraf=require(_0xa318('0x6'));var config=require(_0xa318('0x7'));var attributes=require(_0xa318('0x8'));module[_0xa318('0x9')]=function(_0x13a57a,_0x218310){return _0x13a57a['define'](_0xa318('0xa'),attributes,{'tableName':_0xa318('0xb'),'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 637d08f..79ebd69 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 _0xca6a=['debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareMessage','create','body','options','info','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','SquareMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4ae319,_0x34d937){var _0x29d437=function(_0x541a97){while(--_0x541a97){_0x4ae319['push'](_0x4ae319['shift']());}};_0x29d437(++_0x34d937);}(_0xca6a,0x164));var _0xaca6=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xca6a[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0xaca6('0x0'));var moment=require(_0xaca6('0x1'));var BPromise=require(_0xaca6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaca6('0x3'));var db=require(_0xaca6('0x4'))['db'];var utils=require(_0xaca6('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xaca6('0x6'));var client=jayson[_0xaca6('0x7')][_0xaca6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc95e6f,_0x477054,_0x453f8d){return new BPromise(function(_0x1b1adb,_0x3cdf34){return client['request'](_0xc95e6f,_0x453f8d)[_0xaca6('0x9')](function(_0x14ee4d){logger['info'](_0xaca6('0xa'),_0x477054,_0xaca6('0xb'));logger[_0xaca6('0xc')](_0xaca6('0xd'),_0x477054,_0xaca6('0xb'),JSON['stringify'](_0x14ee4d));if(_0x14ee4d[_0xaca6('0xe')]){if(_0x14ee4d[_0xaca6('0xe')]['code']===0x1f4){logger[_0xaca6('0xe')](_0xaca6('0xa'),_0x477054,_0x14ee4d[_0xaca6('0xe')][_0xaca6('0xf')]);return _0x3cdf34(_0x14ee4d['error']['message']);}logger[_0xaca6('0xe')](_0xaca6('0xa'),_0x477054,_0x14ee4d['error'][_0xaca6('0xf')]);return _0x1b1adb(_0x14ee4d[_0xaca6('0xe')][_0xaca6('0xf')]);}else{logger['info'](_0xaca6('0xa'),_0x477054,_0xaca6('0xb'));_0x1b1adb(_0x14ee4d[_0xaca6('0x10')][_0xaca6('0xf')]);}})[_0xaca6('0x11')](function(_0x4ae230){logger[_0xaca6('0xe')](_0xaca6('0xa'),_0x477054,_0x4ae230);_0x3cdf34(_0x4ae230);});});}exports[_0xaca6('0x12')]=function(_0x1bdd5f){var _0xb09669=this;return new Promise(function(_0x4bf4bd,_0xdc5a04){return db['SquareMessage'][_0xaca6('0x13')](_0x1bdd5f[_0xaca6('0x14')],{'raw':_0x1bdd5f['options']?_0x1bdd5f[_0xaca6('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xaca6('0x9')](function(_0x52a4b1){logger[_0xaca6('0x16')](_0xaca6('0x12'),_0x1bdd5f);logger[_0xaca6('0xc')](_0xaca6('0x12'),_0x1bdd5f,JSON['stringify'](_0x52a4b1));_0x4bf4bd(_0x52a4b1);})[_0xaca6('0x11')](function(_0x2b428c){logger['error'](_0xaca6('0x12'),_0x2b428c[_0xaca6('0xf')],_0x1bdd5f);_0xdc5a04(_0xb09669['error'](0x1f4,_0x2b428c[_0xaca6('0xf')]));});});}; \ No newline at end of file +var _0x9969=['code','message','catch','CreateSquareMessage','SquareMessage','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x5c7f1c,_0x1ca2f5){var _0x28ecbc=function(_0x552932){while(--_0x552932){_0x5c7f1c['push'](_0x5c7f1c['shift']());}};_0x28ecbc(++_0x1ca2f5);}(_0x9969,0x18f));var _0x9996=function(_0x157fb8,_0x1902d8){_0x157fb8=_0x157fb8-0x0;var _0x5143a5=_0x9969[_0x157fb8];return _0x5143a5;};'use strict';var _=require('lodash');var util=require(_0x9996('0x0'));var moment=require(_0x9996('0x1'));var BPromise=require(_0x9996('0x2'));var rs=require(_0x9996('0x3'));var fs=require('fs');var Redis=require(_0x9996('0x4'));var db=require(_0x9996('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9996('0x6'))(_0x9996('0x7'));var config=require('../../config/environment');var jayson=require(_0x9996('0x8'));var client=jayson[_0x9996('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa845ce,_0x964146,_0x32fa2e){return new BPromise(function(_0x368036,_0x24ac8a){return client['request'](_0xa845ce,_0x32fa2e)[_0x9996('0xa')](function(_0x3ed967){logger[_0x9996('0xb')](_0x9996('0xc'),_0x964146,_0x9996('0xd'));logger[_0x9996('0xe')](_0x9996('0xf'),_0x964146,_0x9996('0xd'),JSON['stringify'](_0x3ed967));if(_0x3ed967[_0x9996('0x10')]){if(_0x3ed967[_0x9996('0x10')][_0x9996('0x11')]===0x1f4){logger[_0x9996('0x10')]('SquareMessage,\x20%s,\x20%s',_0x964146,_0x3ed967[_0x9996('0x10')][_0x9996('0x12')]);return _0x24ac8a(_0x3ed967['error']['message']);}logger['error'](_0x9996('0xc'),_0x964146,_0x3ed967[_0x9996('0x10')][_0x9996('0x12')]);return _0x368036(_0x3ed967['error'][_0x9996('0x12')]);}else{logger[_0x9996('0xb')](_0x9996('0xc'),_0x964146,_0x9996('0xd'));_0x368036(_0x3ed967['result'][_0x9996('0x12')]);}})[_0x9996('0x13')](function(_0x43738f){logger[_0x9996('0x10')](_0x9996('0xc'),_0x964146,_0x43738f);_0x24ac8a(_0x43738f);});});}exports[_0x9996('0x14')]=function(_0x460342){var _0x3aa3fb=this;return new Promise(function(_0x263427,_0x3fe2ee){return db[_0x9996('0x15')]['create'](_0x460342[_0x9996('0x16')],{'raw':_0x460342[_0x9996('0x17')]?_0x460342[_0x9996('0x17')][_0x9996('0x18')]===undefined?!![]:![]:!![]})[_0x9996('0xa')](function(_0x57810b){logger['info'](_0x9996('0x14'),_0x460342);logger['debug'](_0x9996('0x14'),_0x460342,JSON[_0x9996('0x19')](_0x57810b));_0x263427(_0x57810b);})[_0x9996('0x13')](function(_0x423bde){logger[_0x9996('0x10')](_0x9996('0x14'),_0x423bde[_0x9996('0x12')],_0x460342);_0x3fe2ee(_0x3aa3fb[_0x9996('0x10')](0x1f4,_0x423bde[_0x9996('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9cf05aa..639ea54 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 _0x3b77=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','test','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2d15c6,_0x2489f9){var _0x2ecfdf=function(_0x23b6cc){while(--_0x23b6cc){_0x2d15c6['push'](_0x2d15c6['shift']());}};_0x2ecfdf(++_0x2489f9);}(_0x3b77,0x124));var _0x73b7=function(_0x3dcfab,_0x47600b){_0x3dcfab=_0x3dcfab-0x0;var _0xf6f86d=_0x3b77[_0x3dcfab];return _0xf6f86d;};'use strict';var multer=require(_0x73b7('0x0'));var util=require(_0x73b7('0x1'));var path=require(_0x73b7('0x2'));var timeout=require(_0x73b7('0x3'));var express=require(_0x73b7('0x4'));var router=express[_0x73b7('0x5')]();var fs_extra=require(_0x73b7('0x6'));var auth=require(_0x73b7('0x7'));var interaction=require(_0x73b7('0x8'));var config=require(_0x73b7('0x9'));var controller=require('./squareOdbc.controller');router[_0x73b7('0xa')]('/',auth[_0x73b7('0xb')](),controller[_0x73b7('0xc')]);router[_0x73b7('0xa')](_0x73b7('0xd'),auth['isAuthenticated'](),controller[_0x73b7('0xe')]);router[_0x73b7('0xa')](_0x73b7('0xf'),auth[_0x73b7('0xb')](),timeout('15s'),controller[_0x73b7('0x10')]);router[_0x73b7('0x11')]('/',auth[_0x73b7('0xb')](),controller['create']);router[_0x73b7('0x12')](_0x73b7('0xd'),auth[_0x73b7('0xb')](),controller[_0x73b7('0x13')]);router[_0x73b7('0x14')](_0x73b7('0xd'),auth[_0x73b7('0xb')](),controller[_0x73b7('0x15')]);module[_0x73b7('0x16')]=router; \ No newline at end of file +var _0x799a=['test','post','create','put','/:id','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','show','15s'];(function(_0x8a5bf,_0x32cbce){var _0x531724=function(_0x161d3e){while(--_0x161d3e){_0x8a5bf['push'](_0x8a5bf['shift']());}};_0x531724(++_0x32cbce);}(_0x799a,0x1a9));var _0xa799=function(_0xf7638b,_0x59ca5a){_0xf7638b=_0xf7638b-0x0;var _0x4ae829=_0x799a[_0xf7638b];return _0x4ae829;};'use strict';var multer=require('multer');var util=require(_0xa799('0x0'));var path=require('path');var timeout=require(_0xa799('0x1'));var express=require(_0xa799('0x2'));var router=express[_0xa799('0x3')]();var fs_extra=require(_0xa799('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa799('0x5'));var config=require('../../config/environment');var controller=require(_0xa799('0x6'));router[_0xa799('0x7')]('/',auth[_0xa799('0x8')](),controller[_0xa799('0x9')]);router[_0xa799('0x7')]('/:id',auth[_0xa799('0x8')](),controller[_0xa799('0xa')]);router['get']('/:id/test',auth[_0xa799('0x8')](),timeout(_0xa799('0xb')),controller[_0xa799('0xc')]);router[_0xa799('0xd')]('/',auth['isAuthenticated'](),controller[_0xa799('0xe')]);router[_0xa799('0xf')](_0xa799('0x10'),auth['isAuthenticated'](),controller[_0xa799('0x11')]);router['delete'](_0xa799('0x10'),auth[_0xa799('0x8')](),controller[_0xa799('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index fec9ff2..a35a048 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 _0x298f=['sequelize','exports','STRING','name'];(function(_0x5e88a1,_0x3a9f75){var _0x32a879=function(_0x300eec){while(--_0x300eec){_0x5e88a1['push'](_0x5e88a1['shift']());}};_0x32a879(++_0x3a9f75);}(_0x298f,0x184));var _0xf298=function(_0x158345,_0xf2f20d){_0x158345=_0x158345-0x0;var _0x23f6c2=_0x298f[_0x158345];return _0x23f6c2;};'use strict';var Sequelize=require(_0xf298('0x0'));module[_0xf298('0x1')]={'name':{'type':Sequelize[_0xf298('0x2')],'unique':_0xf298('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf298('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc0b0=['sequelize','STRING','name'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0xc0b0,0x117));var _0x0c0b=function(_0x25b5e8,_0x163c3f){_0x25b5e8=_0x25b5e8-0x0;var _0x2bca60=_0xc0b0[_0x25b5e8];return _0x2bca60;};'use strict';var Sequelize=require(_0x0c0b('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c0b('0x1')],'unique':_0x0c0b('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0c0b('0x1')]},'description':{'type':Sequelize[_0x0c0b('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index a33e529..c8533bc 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 _0xf319=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','ODBC','UserProfileResource','stack','name','send','index','SquareOdbc','fieldName','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','odbc','openSync','dsn','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4ae459,_0x3bf329){var _0x51d0c9=function(_0x1ce66b){while(--_0x1ce66b){_0x4ae459['push'](_0x4ae459['shift']());}};_0x51d0c9(++_0x3bf329);}(_0xf319,0x90));var _0x9f31=function(_0x35ce92,_0x51cc6b){_0x35ce92=_0x35ce92-0x0;var _0x5941d7=_0xf319[_0x35ce92];return _0x5941d7;};'use strict';var emlformat=require(_0x9f31('0x0'));var rimraf=require(_0x9f31('0x1'));var zipdir=require(_0x9f31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f31('0x3'));var moment=require(_0x9f31('0x4'));var BPromise=require(_0x9f31('0x5'));var Mustache=require(_0x9f31('0x6'));var util=require(_0x9f31('0x7'));var path=require('path');var sox=require(_0x9f31('0x8'));var csv=require('to-csv');var ejs=require(_0x9f31('0x9'));var fs=require('fs');var fs_extra=require(_0x9f31('0xa'));var _=require(_0x9f31('0xb'));var squel=require(_0x9f31('0xc'));var crypto=require(_0x9f31('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f31('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9f31('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f31('0x10'));var qs=require(_0x9f31('0x11'));var as=require(_0x9f31('0x12'));var hardwareService=require(_0x9f31('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9f31('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9f31('0x15'));var db=require(_0x9f31('0x16'))['db'];function respondWithStatusCode(_0x10eeca,_0x20f471){_0x20f471=_0x20f471||0xcc;return function(_0x5c6d93){if(_0x5c6d93){return _0x10eeca[_0x9f31('0x17')](_0x20f471);}return _0x10eeca[_0x9f31('0x18')](_0x20f471)[_0x9f31('0x19')]();};}function respondWithResult(_0xb28bfc,_0x49acb5){_0x49acb5=_0x49acb5||0xc8;return function(_0x3e85d5){if(_0x3e85d5){return _0xb28bfc['status'](_0x49acb5)[_0x9f31('0x1a')](_0x3e85d5);}};}function respondWithFilteredResult(_0x43f4c0,_0x352396){return function(_0x1a1083){if(_0x1a1083){var _0x4e7ae6=typeof _0x352396[_0x9f31('0x1b')]===_0x9f31('0x1c')&&typeof _0x352396[_0x9f31('0x1d')]===_0x9f31('0x1c');var _0x5d042e=_0x1a1083['count'];var _0x19eb2b=_0x4e7ae6?0x0:_0x352396[_0x9f31('0x1b')];var _0x199b5c=_0x4e7ae6?_0x1a1083[_0x9f31('0x1e')]:_0x352396[_0x9f31('0x1b')]+_0x352396['limit'];var _0x23c7a6;if(_0x199b5c>=_0x5d042e){_0x199b5c=_0x5d042e;_0x23c7a6=0xc8;}else{_0x23c7a6=0xce;}_0x43f4c0[_0x9f31('0x18')](_0x23c7a6);return _0x43f4c0[_0x9f31('0x1f')](_0x9f31('0x20'),_0x19eb2b+'-'+_0x199b5c+'/'+_0x5d042e)['json'](_0x1a1083);}return null;};}function patchUpdates(_0x272b87){return function(_0x167003){try{jsonpatch['apply'](_0x167003,_0x272b87,!![]);}catch(_0x2949e6){return BPromise[_0x9f31('0x21')](_0x2949e6);}return _0x167003['save']();};}function saveUpdates(_0x70cdfc,_0x1eba24){return function(_0x5ef024){if(_0x5ef024){return _0x5ef024['update'](_0x70cdfc)[_0x9f31('0x22')](function(_0x436584){return _0x436584;});}return null;};}function removeEntity(_0x4caf94,_0x3e263b){return function(_0x296b99){if(_0x296b99){return _0x296b99[_0x9f31('0x23')]()[_0x9f31('0x22')](function(){var _0xf68861=_0x296b99[_0x9f31('0x24')]({'plain':!![]});var _0x53df44=_0x9f31('0x25');return db[_0x9f31('0x26')]['destroy']({'where':{'type':_0x53df44,'resourceId':_0xf68861['id']}})[_0x9f31('0x22')](function(){return _0x296b99;});})[_0x9f31('0x22')](function(){_0x4caf94['status'](0xcc)[_0x9f31('0x19')]();});}};}function handleEntityNotFound(_0x1dffaf,_0x34e176){return function(_0x590544){if(!_0x590544){_0x1dffaf[_0x9f31('0x17')](0x194);}return _0x590544;};}function handleError(_0x308b54,_0x314846){_0x314846=_0x314846||0x1f4;return function(_0x223d16){logger['error'](_0x223d16[_0x9f31('0x27')]);if(_0x223d16[_0x9f31('0x28')]){delete _0x223d16[_0x9f31('0x28')];}_0x308b54[_0x9f31('0x18')](_0x314846)[_0x9f31('0x29')](_0x223d16);};}exports[_0x9f31('0x2a')]=function(_0x35bfb9,_0x2f9d03){var _0x3ed523={},_0x3e0931={},_0x359fe3={'count':0x0,'rows':[]};var _0x43b371=_['map'](db[_0x9f31('0x2b')]['rawAttributes'],function(_0x239bcf){return{'name':_0x239bcf[_0x9f31('0x2c')],'type':_0x239bcf['type']['key']};});_0x3e0931['model']=_['map'](_0x43b371,_0x9f31('0x28'));_0x3e0931[_0x9f31('0x2d')]=_[_0x9f31('0x2e')](_0x35bfb9['query']);_0x3e0931[_0x9f31('0x2f')]=_[_0x9f31('0x30')](_0x3e0931[_0x9f31('0x31')],_0x3e0931[_0x9f31('0x2d')]);_0x3ed523['attributes']=_[_0x9f31('0x30')](_0x3e0931[_0x9f31('0x31')],qs[_0x9f31('0x32')](_0x35bfb9['query']['fields']));_0x3ed523[_0x9f31('0x33')]=_0x3ed523[_0x9f31('0x33')][_0x9f31('0x34')]?_0x3ed523[_0x9f31('0x33')]:_0x3e0931[_0x9f31('0x31')];if(!_0x35bfb9[_0x9f31('0x2d')]['hasOwnProperty'](_0x9f31('0x35'))){_0x3ed523['limit']=qs['limit'](_0x35bfb9['query'][_0x9f31('0x1d')]);_0x3ed523[_0x9f31('0x1b')]=qs['offset'](_0x35bfb9[_0x9f31('0x2d')][_0x9f31('0x1b')]);}_0x3ed523[_0x9f31('0x36')]=qs[_0x9f31('0x37')](_0x35bfb9['query']['sort']);_0x3ed523[_0x9f31('0x38')]=qs[_0x9f31('0x2f')](_[_0x9f31('0x39')](_0x35bfb9[_0x9f31('0x2d')],_0x3e0931[_0x9f31('0x2f')]),_0x43b371);if(_0x35bfb9['query'][_0x9f31('0x3a')]){_0x3ed523[_0x9f31('0x38')]=_[_0x9f31('0x3b')](_0x3ed523[_0x9f31('0x38')],{'$or':_[_0x9f31('0x3c')](_0x43b371,function(_0x3836d3){if(_0x3836d3['type']!==_0x9f31('0x3d')){var _0x4cce6a={};_0x4cce6a[_0x3836d3[_0x9f31('0x28')]]={'$like':'%'+_0x35bfb9[_0x9f31('0x2d')][_0x9f31('0x3a')]+'%'};return _0x4cce6a;}})});}_0x3ed523=_['merge']({},_0x3ed523,_0x35bfb9[_0x9f31('0x3e')]);var _0x24c21a={'where':_0x3ed523[_0x9f31('0x38')]};return db[_0x9f31('0x2b')][_0x9f31('0x1e')](_0x24c21a)['then'](function(_0x539044){_0x359fe3[_0x9f31('0x1e')]=_0x539044;if(_0x35bfb9[_0x9f31('0x2d')]['includeAll']){_0x3ed523[_0x9f31('0x3f')]=[{'all':!![]}];}return db[_0x9f31('0x2b')][_0x9f31('0x40')](_0x3ed523);})['then'](function(_0x1ce841){_0x359fe3[_0x9f31('0x41')]=_0x1ce841;return _0x359fe3;})['then'](respondWithFilteredResult(_0x2f9d03,_0x3ed523))[_0x9f31('0x42')](handleError(_0x2f9d03,null));};exports[_0x9f31('0x43')]=function(_0x1eee9e,_0x5dc5d9){var _0x1f2c96={'raw':!![],'where':{'id':_0x1eee9e[_0x9f31('0x44')]['id']}},_0x33f5c8={};_0x33f5c8['model']=_[_0x9f31('0x2e')](db['SquareOdbc'][_0x9f31('0x45')]);_0x33f5c8['query']=_[_0x9f31('0x2e')](_0x1eee9e[_0x9f31('0x2d')]);_0x33f5c8['filters']=_['intersection'](_0x33f5c8['model'],_0x33f5c8[_0x9f31('0x2d')]);_0x1f2c96[_0x9f31('0x33')]=_[_0x9f31('0x30')](_0x33f5c8[_0x9f31('0x31')],qs['fields'](_0x1eee9e[_0x9f31('0x2d')][_0x9f31('0x32')]));_0x1f2c96[_0x9f31('0x33')]=_0x1f2c96[_0x9f31('0x33')]['length']?_0x1f2c96[_0x9f31('0x33')]:_0x33f5c8['model'];if(_0x1eee9e[_0x9f31('0x2d')]['includeAll']){_0x1f2c96[_0x9f31('0x3f')]=[{'all':!![]}];}_0x1f2c96=_[_0x9f31('0x3b')]({},_0x1f2c96,_0x1eee9e['options']);return db[_0x9f31('0x2b')][_0x9f31('0x46')](_0x1f2c96)[_0x9f31('0x22')](handleEntityNotFound(_0x5dc5d9,null))[_0x9f31('0x22')](respondWithResult(_0x5dc5d9,null))[_0x9f31('0x42')](handleError(_0x5dc5d9,null));};exports[_0x9f31('0x47')]=function(_0x2abd99,_0x400ff4){return db[_0x9f31('0x2b')][_0x9f31('0x47')](_0x2abd99[_0x9f31('0x48')],{})[_0x9f31('0x22')](function(_0x33797a){var _0x30c5ca=_0x2abd99['user'][_0x9f31('0x24')]({'plain':!![]});if(!_0x30c5ca)throw new Error(_0x9f31('0x49'));if(_0x30c5ca['role']===_0x9f31('0x4a')){var _0x53f42f=_0x33797a[_0x9f31('0x24')]({'plain':!![]});var _0x5c4c9e=_0x9f31('0x25');return db[_0x9f31('0x4b')][_0x9f31('0x46')]({'where':{'name':_0x5c4c9e,'userProfileId':_0x30c5ca[_0x9f31('0x4c')]},'raw':!![]})[_0x9f31('0x22')](function(_0x582a47){if(_0x582a47&&_0x582a47[_0x9f31('0x4d')]===0x0){return db[_0x9f31('0x26')][_0x9f31('0x47')]({'name':_0x53f42f['name'],'resourceId':_0x53f42f['id'],'type':_0x582a47[_0x9f31('0x28')],'sectionId':_0x582a47['id']},{})['then'](function(){return _0x33797a;});}else{return _0x33797a;}})['catch'](function(_0x402d17){logger['error'](_0x9f31('0x4e'),_0x402d17);throw _0x402d17;});}return _0x33797a;})[_0x9f31('0x22')](respondWithResult(_0x400ff4,0xc9))[_0x9f31('0x42')](handleError(_0x400ff4,null));};exports[_0x9f31('0x4f')]=function(_0x1c168a,_0x4daabd){if(_0x1c168a[_0x9f31('0x48')]['id']){delete _0x1c168a['body']['id'];}return db[_0x9f31('0x2b')][_0x9f31('0x46')]({'where':{'id':_0x1c168a['params']['id']}})[_0x9f31('0x22')](handleEntityNotFound(_0x4daabd,null))[_0x9f31('0x22')](saveUpdates(_0x1c168a[_0x9f31('0x48')],null))[_0x9f31('0x22')](respondWithResult(_0x4daabd,null))[_0x9f31('0x42')](handleError(_0x4daabd,null));};exports[_0x9f31('0x23')]=function(_0x145f41,_0x3f3c86){return db[_0x9f31('0x2b')][_0x9f31('0x46')]({'where':{'id':_0x145f41['params']['id']}})[_0x9f31('0x22')](handleEntityNotFound(_0x3f3c86,null))[_0x9f31('0x22')](removeEntity(_0x3f3c86,null))[_0x9f31('0x42')](handleError(_0x3f3c86,null));};exports[_0x9f31('0x50')]=function(_0x12b274,_0x1a023f,_0x2e4dce){var _0x2d54cb;return db[_0x9f31('0x2b')]['find']({'where':{'id':_0x12b274['params']['id']},'attributes':['id','dsn']})[_0x9f31('0x22')](handleEntityNotFound(_0x1a023f,null))[_0x9f31('0x22')](function(_0x3efd04){if(_0x3efd04){var _0x128736=require(_0x9f31('0x51'))();_0x128736[_0x9f31('0x52')](_0x3efd04[_0x9f31('0x53')]);_0x128736['closeSync']();return _0x3efd04;}})[_0x9f31('0x22')](respondWithResult(_0x1a023f,null))[_0x9f31('0x42')](handleError(_0x1a023f,null));}; \ No newline at end of file +var _0x27f1=['bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x27f1,0xa9));var _0x127f=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0x27f1[_0x37e886];return _0x57c5cd;};'use strict';var emlformat=require(_0x127f('0x0'));var rimraf=require(_0x127f('0x1'));var zipdir=require(_0x127f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x127f('0x3'));var moment=require(_0x127f('0x4'));var BPromise=require(_0x127f('0x5'));var Mustache=require(_0x127f('0x6'));var util=require(_0x127f('0x7'));var path=require('path');var sox=require(_0x127f('0x8'));var csv=require(_0x127f('0x9'));var ejs=require(_0x127f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x127f('0xb'));var squel=require('squel');var crypto=require(_0x127f('0xc'));var jsforce=require(_0x127f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x127f('0xe'));var Papa=require(_0x127f('0xf'));var Redis=require(_0x127f('0x10'));var authService=require(_0x127f('0x11'));var qs=require(_0x127f('0x12'));var as=require(_0x127f('0x13'));var hardwareService=require(_0x127f('0x14'));var logger=require(_0x127f('0x15'))('api');var utils=require(_0x127f('0x16'));var config=require(_0x127f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x280602,_0x7e5de7){_0x7e5de7=_0x7e5de7||0xcc;return function(_0x2faa00){if(_0x2faa00){return _0x280602[_0x127f('0x18')](_0x7e5de7);}return _0x280602[_0x127f('0x19')](_0x7e5de7)[_0x127f('0x1a')]();};}function respondWithResult(_0x52efc5,_0x387620){_0x387620=_0x387620||0xc8;return function(_0x5b31eb){if(_0x5b31eb){return _0x52efc5['status'](_0x387620)[_0x127f('0x1b')](_0x5b31eb);}};}function respondWithFilteredResult(_0x285e59,_0x16c46a){return function(_0x56e258){if(_0x56e258){var _0x491ee7=typeof _0x16c46a['offset']===_0x127f('0x1c')&&typeof _0x16c46a[_0x127f('0x1d')]===_0x127f('0x1c');var _0x1ee531=_0x56e258[_0x127f('0x1e')];var _0x50ecec=_0x491ee7?0x0:_0x16c46a[_0x127f('0x1f')];var _0x3a3ddd=_0x491ee7?_0x56e258['count']:_0x16c46a[_0x127f('0x1f')]+_0x16c46a['limit'];var _0x4bdfbd;if(_0x3a3ddd>=_0x1ee531){_0x3a3ddd=_0x1ee531;_0x4bdfbd=0xc8;}else{_0x4bdfbd=0xce;}_0x285e59['status'](_0x4bdfbd);return _0x285e59[_0x127f('0x20')](_0x127f('0x21'),_0x50ecec+'-'+_0x3a3ddd+'/'+_0x1ee531)[_0x127f('0x1b')](_0x56e258);}return null;};}function patchUpdates(_0x1e948d){return function(_0x59e0f0){try{jsonpatch[_0x127f('0x22')](_0x59e0f0,_0x1e948d,!![]);}catch(_0x44c5d3){return BPromise[_0x127f('0x23')](_0x44c5d3);}return _0x59e0f0[_0x127f('0x24')]();};}function saveUpdates(_0x4adda9,_0x44ff7b){return function(_0x4ad56b){if(_0x4ad56b){return _0x4ad56b[_0x127f('0x25')](_0x4adda9)[_0x127f('0x26')](function(_0x3ce00e){return _0x3ce00e;});}return null;};}function removeEntity(_0xda9896,_0x5e1e8b){return function(_0x1684d4){if(_0x1684d4){return _0x1684d4[_0x127f('0x27')]()[_0x127f('0x26')](function(){var _0x7d77c=_0x1684d4[_0x127f('0x28')]({'plain':!![]});var _0x49874e='ODBC';return db[_0x127f('0x29')][_0x127f('0x27')]({'where':{'type':_0x49874e,'resourceId':_0x7d77c['id']}})[_0x127f('0x26')](function(){return _0x1684d4;});})[_0x127f('0x26')](function(){_0xda9896['status'](0xcc)[_0x127f('0x1a')]();});}};}function handleEntityNotFound(_0x16320c,_0x2978c6){return function(_0x101d74){if(!_0x101d74){_0x16320c['sendStatus'](0x194);}return _0x101d74;};}function handleError(_0x2aa24f,_0x2063c4){_0x2063c4=_0x2063c4||0x1f4;return function(_0x5871c2){logger[_0x127f('0x2a')](_0x5871c2[_0x127f('0x2b')]);if(_0x5871c2[_0x127f('0x2c')]){delete _0x5871c2['name'];}_0x2aa24f[_0x127f('0x19')](_0x2063c4)[_0x127f('0x2d')](_0x5871c2);};}exports['index']=function(_0x57483d,_0x1cdc94){var _0x1598ea={},_0x30c51f={},_0x3fbe09={'count':0x0,'rows':[]};var _0x498942=_[_0x127f('0x2e')](db[_0x127f('0x2f')][_0x127f('0x30')],function(_0x15158f){return{'name':_0x15158f[_0x127f('0x31')],'type':_0x15158f['type'][_0x127f('0x32')]};});_0x30c51f[_0x127f('0x33')]=_[_0x127f('0x2e')](_0x498942,_0x127f('0x2c'));_0x30c51f[_0x127f('0x34')]=_['keys'](_0x57483d[_0x127f('0x34')]);_0x30c51f['filters']=_[_0x127f('0x35')](_0x30c51f['model'],_0x30c51f['query']);_0x1598ea[_0x127f('0x36')]=_[_0x127f('0x35')](_0x30c51f[_0x127f('0x33')],qs[_0x127f('0x37')](_0x57483d['query'][_0x127f('0x37')]));_0x1598ea[_0x127f('0x36')]=_0x1598ea[_0x127f('0x36')][_0x127f('0x38')]?_0x1598ea[_0x127f('0x36')]:_0x30c51f[_0x127f('0x33')];if(!_0x57483d[_0x127f('0x34')][_0x127f('0x39')](_0x127f('0x3a'))){_0x1598ea['limit']=qs['limit'](_0x57483d[_0x127f('0x34')][_0x127f('0x1d')]);_0x1598ea[_0x127f('0x1f')]=qs['offset'](_0x57483d[_0x127f('0x34')][_0x127f('0x1f')]);}_0x1598ea[_0x127f('0x3b')]=qs['sort'](_0x57483d[_0x127f('0x34')][_0x127f('0x3c')]);_0x1598ea['where']=qs[_0x127f('0x3d')](_['pick'](_0x57483d['query'],_0x30c51f[_0x127f('0x3d')]),_0x498942);if(_0x57483d[_0x127f('0x34')]['filter']){_0x1598ea[_0x127f('0x3e')]=_[_0x127f('0x3f')](_0x1598ea[_0x127f('0x3e')],{'$or':_['map'](_0x498942,function(_0x2f1a25){if(_0x2f1a25['type']!=='VIRTUAL'){var _0x3734e6={};_0x3734e6[_0x2f1a25[_0x127f('0x2c')]]={'$like':'%'+_0x57483d[_0x127f('0x34')][_0x127f('0x40')]+'%'};return _0x3734e6;}})});}_0x1598ea=_['merge']({},_0x1598ea,_0x57483d[_0x127f('0x41')]);var _0x20eb27={'where':_0x1598ea[_0x127f('0x3e')]};return db[_0x127f('0x2f')][_0x127f('0x1e')](_0x20eb27)[_0x127f('0x26')](function(_0x105231){_0x3fbe09[_0x127f('0x1e')]=_0x105231;if(_0x57483d['query'][_0x127f('0x42')]){_0x1598ea[_0x127f('0x43')]=[{'all':!![]}];}return db['SquareOdbc'][_0x127f('0x44')](_0x1598ea);})['then'](function(_0x13a939){_0x3fbe09[_0x127f('0x45')]=_0x13a939;return _0x3fbe09;})['then'](respondWithFilteredResult(_0x1cdc94,_0x1598ea))[_0x127f('0x46')](handleError(_0x1cdc94,null));};exports[_0x127f('0x47')]=function(_0x4207d4,_0x4f509f){var _0x2519c5={'raw':!![],'where':{'id':_0x4207d4[_0x127f('0x48')]['id']}},_0x22f1d1={};_0x22f1d1['model']=_[_0x127f('0x49')](db[_0x127f('0x2f')][_0x127f('0x30')]);_0x22f1d1['query']=_[_0x127f('0x49')](_0x4207d4[_0x127f('0x34')]);_0x22f1d1[_0x127f('0x3d')]=_[_0x127f('0x35')](_0x22f1d1[_0x127f('0x33')],_0x22f1d1[_0x127f('0x34')]);_0x2519c5[_0x127f('0x36')]=_[_0x127f('0x35')](_0x22f1d1[_0x127f('0x33')],qs[_0x127f('0x37')](_0x4207d4[_0x127f('0x34')][_0x127f('0x37')]));_0x2519c5[_0x127f('0x36')]=_0x2519c5['attributes'][_0x127f('0x38')]?_0x2519c5[_0x127f('0x36')]:_0x22f1d1[_0x127f('0x33')];if(_0x4207d4['query'][_0x127f('0x42')]){_0x2519c5[_0x127f('0x43')]=[{'all':!![]}];}_0x2519c5=_[_0x127f('0x3f')]({},_0x2519c5,_0x4207d4[_0x127f('0x41')]);return db[_0x127f('0x2f')][_0x127f('0x4a')](_0x2519c5)['then'](handleEntityNotFound(_0x4f509f,null))[_0x127f('0x26')](respondWithResult(_0x4f509f,null))[_0x127f('0x46')](handleError(_0x4f509f,null));};exports[_0x127f('0x4b')]=function(_0x3f59f1,_0x5569b5){return db[_0x127f('0x2f')][_0x127f('0x4b')](_0x3f59f1[_0x127f('0x4c')],{})['then'](function(_0x1534bd){var _0x14f890=_0x3f59f1[_0x127f('0x4d')][_0x127f('0x28')]({'plain':!![]});if(!_0x14f890)throw new Error(_0x127f('0x4e'));if(_0x14f890[_0x127f('0x4f')]==='user'){var _0x3a8ab7=_0x1534bd[_0x127f('0x28')]({'plain':!![]});var _0x1d3158=_0x127f('0x50');return db['UserProfileSection'][_0x127f('0x4a')]({'where':{'name':_0x1d3158,'userProfileId':_0x14f890['userProfileId']},'raw':!![]})['then'](function(_0x3f07b6){if(_0x3f07b6&&_0x3f07b6[_0x127f('0x51')]===0x0){return db[_0x127f('0x29')][_0x127f('0x4b')]({'name':_0x3a8ab7[_0x127f('0x2c')],'resourceId':_0x3a8ab7['id'],'type':_0x3f07b6[_0x127f('0x2c')],'sectionId':_0x3f07b6['id']},{})[_0x127f('0x26')](function(){return _0x1534bd;});}else{return _0x1534bd;}})[_0x127f('0x46')](function(_0x28b619){logger[_0x127f('0x2a')](_0x127f('0x52'),_0x28b619);throw _0x28b619;});}return _0x1534bd;})[_0x127f('0x26')](respondWithResult(_0x5569b5,0xc9))[_0x127f('0x46')](handleError(_0x5569b5,null));};exports[_0x127f('0x25')]=function(_0x25f93e,_0x3880da){if(_0x25f93e[_0x127f('0x4c')]['id']){delete _0x25f93e[_0x127f('0x4c')]['id'];}return db[_0x127f('0x2f')][_0x127f('0x4a')]({'where':{'id':_0x25f93e[_0x127f('0x48')]['id']}})['then'](handleEntityNotFound(_0x3880da,null))[_0x127f('0x26')](saveUpdates(_0x25f93e[_0x127f('0x4c')],null))[_0x127f('0x26')](respondWithResult(_0x3880da,null))[_0x127f('0x46')](handleError(_0x3880da,null));};exports['destroy']=function(_0x337e98,_0x863c5){return db['SquareOdbc'][_0x127f('0x4a')]({'where':{'id':_0x337e98[_0x127f('0x48')]['id']}})[_0x127f('0x26')](handleEntityNotFound(_0x863c5,null))['then'](removeEntity(_0x863c5,null))['catch'](handleError(_0x863c5,null));};exports[_0x127f('0x53')]=function(_0x1a9b18,_0x1fce0b,_0x549708){var _0x2d08e3;return db[_0x127f('0x2f')]['find']({'where':{'id':_0x1a9b18[_0x127f('0x48')]['id']},'attributes':['id',_0x127f('0x54')]})[_0x127f('0x26')](handleEntityNotFound(_0x1fce0b,null))[_0x127f('0x26')](function(_0x45b354){if(_0x45b354){var _0x41e7e5=require('odbc')();_0x41e7e5[_0x127f('0x55')](_0x45b354['dsn']);_0x41e7e5[_0x127f('0x56')]();return _0x45b354;}})[_0x127f('0x26')](respondWithResult(_0x1fce0b,null))['catch'](handleError(_0x1fce0b,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 0440d75..0ef22c3 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 _0x2051=['util','moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','lodash'];(function(_0x122e5d,_0x37ab04){var _0x4b0a7f=function(_0x13f877){while(--_0x13f877){_0x122e5d['push'](_0x122e5d['shift']());}};_0x4b0a7f(++_0x37ab04);}(_0x2051,0x7d));var _0x1205=function(_0x3e6510,_0x3db770){_0x3e6510=_0x3e6510-0x0;var _0x3bbed9=_0x2051[_0x3e6510];return _0x3bbed9;};'use strict';var _=require(_0x1205('0x0'));var util=require(_0x1205('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1205('0x2'));var BPromise=require('bluebird');var rp=require(_0x1205('0x3'));var fs=require('fs');var path=require(_0x1205('0x4'));var rimraf=require(_0x1205('0x5'));var config=require(_0x1205('0x6'));var attributes=require(_0x1205('0x7'));module[_0x1205('0x8')]=function(_0x58a0c6,_0x4a65d1){return _0x58a0c6['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58e5=['square_odbc','lodash','util','../../config/logger','api','bluebird','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x41031d,_0x17a3ee){var _0x2606c8=function(_0x24b03a){while(--_0x24b03a){_0x41031d['push'](_0x41031d['shift']());}};_0x2606c8(++_0x17a3ee);}(_0x58e5,0x85));var _0x558e=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x58e5[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0x558e('0x0'));var util=require(_0x558e('0x1'));var logger=require(_0x558e('0x2'))(_0x558e('0x3'));var moment=require('moment');var BPromise=require(_0x558e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x558e('0x5'));var rimraf=require(_0x558e('0x6'));var config=require('../../config/environment');var attributes=require(_0x558e('0x7'));module[_0x558e('0x8')]=function(_0x103f08,_0x582ab8){return _0x103f08[_0x558e('0x9')](_0x558e('0xa'),attributes,{'tableName':_0x558e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 6cd5fd8..8e4df80 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 _0x0c4b=['code','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5dedb9,_0x5e8912){var _0x4ed5b4=function(_0x15ab91){while(--_0x15ab91){_0x5dedb9['push'](_0x5dedb9['shift']());}};_0x4ed5b4(++_0x5e8912);}(_0x0c4b,0x137));var _0xb0c4=function(_0x498b9e,_0x46ae26){_0x498b9e=_0x498b9e-0x0;var _0x29dd57=_0x0c4b[_0x498b9e];return _0x29dd57;};'use strict';var _=require('lodash');var util=require(_0xb0c4('0x0'));var moment=require(_0xb0c4('0x1'));var BPromise=require(_0xb0c4('0x2'));var rs=require(_0xb0c4('0x3'));var fs=require('fs');var Redis=require(_0xb0c4('0x4'));var db=require(_0xb0c4('0x5'))['db'];var utils=require(_0xb0c4('0x6'));var logger=require('../../config/logger')(_0xb0c4('0x7'));var config=require(_0xb0c4('0x8'));var jayson=require(_0xb0c4('0x9'));var client=jayson['client'][_0xb0c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37c5bb,_0x987f94,_0x4a8530){return new BPromise(function(_0x2637df,_0x1ab8a0){return client[_0xb0c4('0xb')](_0x37c5bb,_0x4a8530)['then'](function(_0x5f3cd4){logger[_0xb0c4('0xc')](_0xb0c4('0xd'),_0x987f94,'request\x20sent');logger[_0xb0c4('0xe')](_0xb0c4('0xf'),_0x987f94,_0xb0c4('0x10'),JSON[_0xb0c4('0x11')](_0x5f3cd4));if(_0x5f3cd4[_0xb0c4('0x12')]){if(_0x5f3cd4[_0xb0c4('0x12')][_0xb0c4('0x13')]===0x1f4){logger[_0xb0c4('0x12')](_0xb0c4('0xd'),_0x987f94,_0x5f3cd4['error'][_0xb0c4('0x14')]);return _0x1ab8a0(_0x5f3cd4['error'][_0xb0c4('0x14')]);}logger[_0xb0c4('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x987f94,_0x5f3cd4[_0xb0c4('0x12')]['message']);return _0x2637df(_0x5f3cd4[_0xb0c4('0x12')][_0xb0c4('0x14')]);}else{logger['info'](_0xb0c4('0xd'),_0x987f94,'request\x20sent');_0x2637df(_0x5f3cd4[_0xb0c4('0x15')]['message']);}})['catch'](function(_0x53ccd4){logger[_0xb0c4('0x12')](_0xb0c4('0xd'),_0x987f94,_0x53ccd4);_0x1ab8a0(_0x53ccd4);});});}exports[_0xb0c4('0x16')]=function(_0x440dcb){var _0x798f44=this;return new Promise(function(_0x9703cc,_0x25efc7){return db[_0xb0c4('0x17')][_0xb0c4('0x18')]({'raw':_0x440dcb[_0xb0c4('0x19')]?_0x440dcb[_0xb0c4('0x19')][_0xb0c4('0x1a')]===undefined?!![]:![]:!![],'where':_0x440dcb[_0xb0c4('0x19')]?_0x440dcb[_0xb0c4('0x19')][_0xb0c4('0x1b')]||null:null,'attributes':_0x440dcb[_0xb0c4('0x19')]?_0x440dcb[_0xb0c4('0x19')][_0xb0c4('0x1c')]||null:null,'include':_0x440dcb[_0xb0c4('0x19')]?_0x440dcb['options'][_0xb0c4('0x1d')]?_[_0xb0c4('0x1e')](_0x440dcb[_0xb0c4('0x19')][_0xb0c4('0x1d')],function(_0x36abf8){return{'model':db[_0x36abf8[_0xb0c4('0x1f')]],'as':_0x36abf8['as'],'attributes':_0x36abf8[_0xb0c4('0x1c')],'include':_0x36abf8[_0xb0c4('0x1d')]?_[_0xb0c4('0x1e')](_0x36abf8[_0xb0c4('0x1d')],function(_0x19bd50){return{'model':db[_0x19bd50[_0xb0c4('0x1f')]],'as':_0x19bd50['as'],'attributes':_0x19bd50[_0xb0c4('0x1c')],'include':_0x19bd50[_0xb0c4('0x1d')]?_[_0xb0c4('0x1e')](_0x19bd50['include'],function(_0x3a8263){return{'model':db[_0x3a8263[_0xb0c4('0x1f')]],'as':_0x3a8263['as'],'attributes':_0x3a8263[_0xb0c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb0c4('0x20')](function(_0x214ded){logger['info'](_0xb0c4('0x16'),_0x440dcb);logger[_0xb0c4('0xe')](_0xb0c4('0x16'),_0x440dcb,JSON[_0xb0c4('0x11')](_0x214ded));_0x9703cc(_0x214ded);})['catch'](function(_0x537222){logger[_0xb0c4('0x12')](_0xb0c4('0x16'),_0x537222[_0xb0c4('0x14')],_0x440dcb);_0x25efc7(_0x798f44['error'](0x1f4,_0x537222[_0xb0c4('0x14')]));});});}; \ No newline at end of file +var _0x7de4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','info','catch','ShowSquareOdbc','options','raw','where','attributes','include','map','model','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7de4,0x8f));var _0x47de=function(_0x2b64ec,_0x220ccb){_0x2b64ec=_0x2b64ec-0x0;var _0x188241=_0x7de4[_0x2b64ec];return _0x188241;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x47de('0x0'));var BPromise=require(_0x47de('0x1'));var rs=require(_0x47de('0x2'));var fs=require('fs');var Redis=require(_0x47de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x47de('0x4'));var logger=require(_0x47de('0x5'))(_0x47de('0x6'));var config=require(_0x47de('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x47de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x358385,_0x4f823c,_0x1832f0){return new BPromise(function(_0x590b8f,_0x32bbef){return client[_0x47de('0x9')](_0x358385,_0x1832f0)[_0x47de('0xa')](function(_0xd89e00){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4f823c,_0x47de('0xb'));logger[_0x47de('0xc')](_0x47de('0xd'),_0x4f823c,_0x47de('0xb'),JSON[_0x47de('0xe')](_0xd89e00));if(_0xd89e00[_0x47de('0xf')]){if(_0xd89e00[_0x47de('0xf')][_0x47de('0x10')]===0x1f4){logger[_0x47de('0xf')](_0x47de('0x11'),_0x4f823c,_0xd89e00[_0x47de('0xf')][_0x47de('0x12')]);return _0x32bbef(_0xd89e00[_0x47de('0xf')]['message']);}logger[_0x47de('0xf')](_0x47de('0x11'),_0x4f823c,_0xd89e00[_0x47de('0xf')][_0x47de('0x12')]);return _0x590b8f(_0xd89e00[_0x47de('0xf')][_0x47de('0x12')]);}else{logger[_0x47de('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x4f823c,_0x47de('0xb'));_0x590b8f(_0xd89e00['result'][_0x47de('0x12')]);}})[_0x47de('0x14')](function(_0xbefaa5){logger[_0x47de('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x4f823c,_0xbefaa5);_0x32bbef(_0xbefaa5);});});}exports[_0x47de('0x15')]=function(_0x4232d8){var _0x22e02c=this;return new Promise(function(_0xdf0bec,_0x1c44fc){return db['SquareOdbc']['find']({'raw':_0x4232d8[_0x47de('0x16')]?_0x4232d8[_0x47de('0x16')][_0x47de('0x17')]===undefined?!![]:![]:!![],'where':_0x4232d8[_0x47de('0x16')]?_0x4232d8[_0x47de('0x16')][_0x47de('0x18')]||null:null,'attributes':_0x4232d8[_0x47de('0x16')]?_0x4232d8['options'][_0x47de('0x19')]||null:null,'include':_0x4232d8[_0x47de('0x16')]?_0x4232d8[_0x47de('0x16')][_0x47de('0x1a')]?_[_0x47de('0x1b')](_0x4232d8[_0x47de('0x16')][_0x47de('0x1a')],function(_0xc85cb8){return{'model':db[_0xc85cb8[_0x47de('0x1c')]],'as':_0xc85cb8['as'],'attributes':_0xc85cb8[_0x47de('0x19')],'include':_0xc85cb8[_0x47de('0x1a')]?_[_0x47de('0x1b')](_0xc85cb8[_0x47de('0x1a')],function(_0x21c818){return{'model':db[_0x21c818[_0x47de('0x1c')]],'as':_0x21c818['as'],'attributes':_0x21c818[_0x47de('0x19')],'include':_0x21c818[_0x47de('0x1a')]?_[_0x47de('0x1b')](_0x21c818[_0x47de('0x1a')],function(_0x221409){return{'model':db[_0x221409[_0x47de('0x1c')]],'as':_0x221409['as'],'attributes':_0x221409[_0x47de('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51a0b2){logger[_0x47de('0x13')](_0x47de('0x15'),_0x4232d8);logger[_0x47de('0xc')](_0x47de('0x15'),_0x4232d8,JSON[_0x47de('0xe')](_0x51a0b2));_0xdf0bec(_0x51a0b2);})[_0x47de('0x14')](function(_0x5f4fd4){logger[_0x47de('0xf')](_0x47de('0x15'),_0x5f4fd4[_0x47de('0x12')],_0x4232d8);_0x1c44fc(_0x22e02c['error'](0x1f4,_0x5f4fd4[_0x47de('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f948595..70d9030 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 _0x1d11=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','/:id','/:id/users','post','create','addUsers','update','delete','destroy','removeUsers','exports','multer','util'];(function(_0x3d67f8,_0x3dcb0a){var _0x13dae1=function(_0x39cfd2){while(--_0x39cfd2){_0x3d67f8['push'](_0x3d67f8['shift']());}};_0x13dae1(++_0x3dcb0a);}(_0x1d11,0xb6));var _0x11d1=function(_0x228029,_0x569b7b){_0x228029=_0x228029-0x0;var _0x3222d0=_0x1d11[_0x228029];return _0x3222d0;};'use strict';var multer=require(_0x11d1('0x0'));var util=require(_0x11d1('0x1'));var path=require(_0x11d1('0x2'));var timeout=require(_0x11d1('0x3'));var express=require(_0x11d1('0x4'));var router=express[_0x11d1('0x5')]();var fs_extra=require(_0x11d1('0x6'));var auth=require(_0x11d1('0x7'));var interaction=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var controller=require(_0x11d1('0xa'));router['get']('/',auth[_0x11d1('0xb')](),controller['index']);router[_0x11d1('0xc')](_0x11d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x11d1('0xc')](_0x11d1('0xe'),auth['isAuthenticated'](),controller['getUsers']);router[_0x11d1('0xf')]('/',auth[_0x11d1('0xb')](),controller[_0x11d1('0x10')]);router['post']('/:id/users',auth[_0x11d1('0xb')](),controller[_0x11d1('0x11')]);router['put']('/:id',auth[_0x11d1('0xb')](),controller[_0x11d1('0x12')]);router[_0x11d1('0x13')](_0x11d1('0xd'),auth['isAuthenticated'](),controller[_0x11d1('0x14')]);router[_0x11d1('0x13')](_0x11d1('0xe'),auth['isAuthenticated'](),controller[_0x11d1('0x15')]);module[_0x11d1('0x16')]=router; \ No newline at end of file +var _0x2c91=['../../components/auth/service','../../config/environment','index','get','/:id','show','/:id/users','isAuthenticated','post','create','addUsers','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x5bc47a,_0x5dbd63){var _0x3c30b4=function(_0x3f3a77){while(--_0x3f3a77){_0x5bc47a['push'](_0x5bc47a['shift']());}};_0x3c30b4(++_0x5dbd63);}(_0x2c91,0xe0));var _0x12c9=function(_0x4bb90f,_0x4f3d14){_0x4bb90f=_0x4bb90f-0x0;var _0x229e78=_0x2c91[_0x4bb90f];return _0x229e78;};'use strict';var multer=require('multer');var util=require(_0x12c9('0x0'));var path=require('path');var timeout=require(_0x12c9('0x1'));var express=require(_0x12c9('0x2'));var router=express[_0x12c9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x12c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x12c9('0x5'));var controller=require('./squareProject.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x12c9('0x6')]);router[_0x12c9('0x7')](_0x12c9('0x8'),auth['isAuthenticated'](),controller[_0x12c9('0x9')]);router['get'](_0x12c9('0xa'),auth[_0x12c9('0xb')](),controller['getUsers']);router[_0x12c9('0xc')]('/',auth[_0x12c9('0xb')](),controller[_0x12c9('0xd')]);router[_0x12c9('0xc')](_0x12c9('0xa'),auth[_0x12c9('0xb')](),controller[_0x12c9('0xe')]);router[_0x12c9('0xf')](_0x12c9('0x8'),auth[_0x12c9('0xb')](),controller[_0x12c9('0x10')]);router[_0x12c9('0x11')](_0x12c9('0x8'),auth[_0x12c9('0xb')](),controller['destroy']);router[_0x12c9('0x11')](_0x12c9('0xa'),auth[_0x12c9('0xb')](),controller['removeUsers']);module[_0x12c9('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3ef0c0b..1b2e84f 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 _0x19a7=['TEXT','BLOB','long','getDataValue','preproduction','utf8','production','toString','DATE','sequelize','STRING','name'];(function(_0x2d3f32,_0xb531aa){var _0x26ab09=function(_0x4256c2){while(--_0x4256c2){_0x2d3f32['push'](_0x2d3f32['shift']());}};_0x26ab09(++_0xb531aa);}(_0x19a7,0x1a1));var _0x719a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x19a7[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x719a('0x0'));module['exports']={'name':{'type':Sequelize[_0x719a('0x1')],'unique':_0x719a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x719a('0x1')]},'notes':{'type':Sequelize[_0x719a('0x3')]},'preproduction':{'type':Sequelize[_0x719a('0x4')](_0x719a('0x5')),'get':function(){if(this[_0x719a('0x6')](_0x719a('0x7'))){return this[_0x719a('0x6')](_0x719a('0x7'))['toString'](_0x719a('0x8'));}}},'production':{'type':Sequelize[_0x719a('0x4')](_0x719a('0x5')),'get':function(){if(this[_0x719a('0x6')](_0x719a('0x9'))){return this[_0x719a('0x6')]('production')[_0x719a('0xa')](_0x719a('0x8'));}}},'savedAt':{'type':Sequelize[_0x719a('0xb')]},'publishedAt':{'type':Sequelize[_0x719a('0xb')]}}; \ No newline at end of file +var _0x9c90=['preproduction','toString','utf8','production','DATE','exports','name','STRING','TEXT','BLOB','long','getDataValue'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x9c90,0xd1));var _0x09c9=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0x9c90[_0x53ddab];return _0x5819ac;};'use strict';var Sequelize=require('sequelize');module[_0x09c9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x09c9('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x09c9('0x2')]},'notes':{'type':Sequelize[_0x09c9('0x3')]},'preproduction':{'type':Sequelize[_0x09c9('0x4')](_0x09c9('0x5')),'get':function(){if(this[_0x09c9('0x6')](_0x09c9('0x7'))){return this[_0x09c9('0x6')](_0x09c9('0x7'))[_0x09c9('0x8')](_0x09c9('0x9'));}}},'production':{'type':Sequelize[_0x09c9('0x4')]('long'),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0x09c9('0xa'))[_0x09c9('0x8')](_0x09c9('0x9'));}}},'savedAt':{'type':Sequelize[_0x09c9('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 379a8d0..1fdee2f 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 _0x4991=['userSquareProject:remove','findOne','User','getUsers','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','then','destroy','SquareProjects','UserProfileResource','publish','agi','stringify','error','name','send','index','map','SquareProject','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','intersection','options','find','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','production','addUsers','ids','omit','removeUsers','isArray','emit'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x4991,0xf7));var _0x1499=function(_0x4b2b90,_0x47519b){_0x4b2b90=_0x4b2b90-0x0;var _0x105a06=_0x4991[_0x4b2b90];return _0x105a06;};'use strict';var _=require(_0x1499('0x0'));var Redis=require('ioredis');var qs=require(_0x1499('0x1'));var logger=require('../../config/logger')(_0x1499('0x2'));var config=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];config[_0x1499('0x5')]=_[_0x1499('0x6')](config[_0x1499('0x5')],{'host':_0x1499('0x7'),'port':0x18eb});var socket=require(_0x1499('0x8'))(new Redis(config['redis']));require(_0x1499('0x9'))[_0x1499('0xa')](socket);function respondWithStatusCode(_0x1c65c3,_0x33b261){_0x33b261=_0x33b261||0xcc;return function(_0x133bae){if(_0x133bae){return _0x1c65c3[_0x1499('0xb')](_0x33b261);}return _0x1c65c3[_0x1499('0xc')](_0x33b261)[_0x1499('0xd')]();};}function respondWithResult(_0x48d2ca,_0x16e8ad){_0x16e8ad=_0x16e8ad||0xc8;return function(_0x36a053){if(_0x36a053){return _0x48d2ca['status'](_0x16e8ad)[_0x1499('0xe')](_0x36a053);}};}function respondWithFilteredResult(_0x352180,_0x4c2bd2){return function(_0x4407c2){if(_0x4407c2){var _0x2867b1=typeof _0x4c2bd2['offset']==='undefined'&&typeof _0x4c2bd2['limit']===_0x1499('0xf');var _0x274bc1=_0x4407c2[_0x1499('0x10')];var _0x334d7e=_0x2867b1?0x0:_0x4c2bd2[_0x1499('0x11')];var _0x57a0a2=_0x2867b1?_0x4407c2['count']:_0x4c2bd2[_0x1499('0x11')]+_0x4c2bd2['limit'];var _0x37d99e;if(_0x57a0a2>=_0x274bc1){_0x57a0a2=_0x274bc1;_0x37d99e=0xc8;}else{_0x37d99e=0xce;}_0x352180[_0x1499('0xc')](_0x37d99e);return _0x352180[_0x1499('0x12')](_0x1499('0x13'),_0x334d7e+'-'+_0x57a0a2+'/'+_0x274bc1)['json'](_0x4407c2);}return null;};}function saveUpdates(_0x1ed43b){return function(_0x373f57){if(_0x373f57){return _0x373f57['update'](_0x1ed43b)[_0x1499('0x14')](function(_0x2d405f){return _0x2d405f;});}return null;};}function removeEntity(_0x46b364){return function(_0xc92272){if(_0xc92272){return _0xc92272[_0x1499('0x15')]()[_0x1499('0x14')](function(){var _0x5b9859=_0xc92272['get']({'plain':!![]});var _0x5bcb5f=_0x1499('0x16');return db[_0x1499('0x17')]['destroy']({'where':{'type':_0x5bcb5f,'resourceId':_0x5b9859['id']}})[_0x1499('0x14')](function(){return _0xc92272;});})[_0x1499('0x14')](function(){var _0x28dff3=new Redis(config[_0x1499('0x5')]);_0x28dff3[_0x1499('0x18')](_0x1499('0x19'),JSON[_0x1499('0x1a')]({'id':_0xc92272['id'],'deleted':!![]}));})[_0x1499('0x14')](function(){_0x46b364[_0x1499('0xc')](0xcc)[_0x1499('0xd')]();});}};}function handleEntityNotFound(_0x2bb71f){return function(_0x836081){if(!_0x836081){_0x2bb71f[_0x1499('0xb')](0x194);}return _0x836081;};}function handleError(_0x3b73f6,_0x4ec57a){_0x4ec57a=_0x4ec57a||0x1f4;return function(_0x1e2c51){logger[_0x1499('0x1b')](_0x1e2c51['stack']);if(_0x1e2c51[_0x1499('0x1c')]){delete _0x1e2c51[_0x1499('0x1c')];}_0x3b73f6[_0x1499('0xc')](_0x4ec57a)[_0x1499('0x1d')](_0x1e2c51);};}exports[_0x1499('0x1e')]=function(_0x16d036,_0x54f3c2){var _0x501c0d={},_0x12739b={},_0x3c9aca={'count':0x0,'rows':[]};var _0x3b9259=_[_0x1499('0x1f')](db[_0x1499('0x20')]['rawAttributes'],function(_0x3e5ed1){return{'name':_0x3e5ed1['fieldName'],'type':_0x3e5ed1['type']['key']};});_0x12739b[_0x1499('0x21')]=_[_0x1499('0x1f')](_0x3b9259,_0x1499('0x1c'));_0x12739b[_0x1499('0x22')]=_[_0x1499('0x23')](_0x16d036[_0x1499('0x22')]);_0x12739b[_0x1499('0x24')]=_['intersection'](_0x12739b[_0x1499('0x21')],_0x12739b[_0x1499('0x22')]);_0x501c0d[_0x1499('0x25')]=_['intersection'](_0x12739b[_0x1499('0x21')],qs[_0x1499('0x26')](_0x16d036['query'][_0x1499('0x26')]));_0x501c0d[_0x1499('0x25')]=_0x501c0d['attributes'][_0x1499('0x27')]?_0x501c0d[_0x1499('0x25')]:_0x12739b[_0x1499('0x21')];if(!_0x16d036[_0x1499('0x22')][_0x1499('0x28')](_0x1499('0x29'))){_0x501c0d[_0x1499('0x2a')]=qs[_0x1499('0x2a')](_0x16d036[_0x1499('0x22')][_0x1499('0x2a')]);_0x501c0d[_0x1499('0x11')]=qs[_0x1499('0x11')](_0x16d036[_0x1499('0x22')][_0x1499('0x11')]);}_0x501c0d[_0x1499('0x2b')]=qs[_0x1499('0x2c')](_0x16d036[_0x1499('0x22')][_0x1499('0x2c')]);_0x501c0d[_0x1499('0x2d')]=qs[_0x1499('0x24')](_['pick'](_0x16d036[_0x1499('0x22')],_0x12739b[_0x1499('0x24')]),_0x3b9259);if(_0x16d036[_0x1499('0x22')][_0x1499('0x2e')]){_0x501c0d[_0x1499('0x2d')]=_[_0x1499('0x2f')](_0x501c0d[_0x1499('0x2d')],{'$or':_[_0x1499('0x1f')](_0x3b9259,function(_0x12cf93){if(_0x12cf93[_0x1499('0x30')]!==_0x1499('0x31')){var _0x4e3ca2={};_0x4e3ca2[_0x12cf93['name']]={'$like':'%'+_0x16d036[_0x1499('0x22')]['filter']+'%'};return _0x4e3ca2;}})});}_0x501c0d=_[_0x1499('0x2f')]({},_0x501c0d,_0x16d036['options']);var _0x30dc0c={'where':_0x501c0d[_0x1499('0x2d')]};return db[_0x1499('0x20')][_0x1499('0x10')](_0x30dc0c)['then'](function(_0x2b6eeb){_0x3c9aca['count']=_0x2b6eeb;if(_0x16d036[_0x1499('0x22')][_0x1499('0x32')]){_0x501c0d[_0x1499('0x33')]=[{'all':!![]}];}return db[_0x1499('0x20')]['findAll'](_0x501c0d);})[_0x1499('0x14')](function(_0x815a99){_0x3c9aca[_0x1499('0x34')]=_0x815a99;return _0x3c9aca;})[_0x1499('0x14')](respondWithFilteredResult(_0x54f3c2,_0x501c0d))['catch'](handleError(_0x54f3c2,null));};exports[_0x1499('0x35')]=function(_0x4cc411,_0x3770b5){var _0x38f449={'raw':![],'where':{'id':_0x4cc411[_0x1499('0x36')]['id']}},_0x2a2441={};_0x2a2441[_0x1499('0x21')]=_[_0x1499('0x23')](db[_0x1499('0x20')][_0x1499('0x37')]);_0x2a2441[_0x1499('0x22')]=_[_0x1499('0x23')](_0x4cc411['query']);_0x2a2441[_0x1499('0x24')]=_['intersection'](_0x2a2441[_0x1499('0x21')],_0x2a2441[_0x1499('0x22')]);_0x38f449['attributes']=_[_0x1499('0x38')](_0x2a2441[_0x1499('0x21')],qs[_0x1499('0x26')](_0x4cc411[_0x1499('0x22')][_0x1499('0x26')]));_0x38f449['attributes']=_0x38f449['attributes'][_0x1499('0x27')]?_0x38f449[_0x1499('0x25')]:_0x2a2441['model'];if(_0x4cc411[_0x1499('0x22')][_0x1499('0x32')]){_0x38f449['include']=[{'all':!![]}];}_0x38f449=_['merge']({},_0x38f449,_0x4cc411[_0x1499('0x39')]);return db[_0x1499('0x20')][_0x1499('0x3a')](_0x38f449)['then'](handleEntityNotFound(_0x3770b5,null))[_0x1499('0x14')](respondWithResult(_0x3770b5,null))[_0x1499('0x3b')](handleError(_0x3770b5,null));};exports[_0x1499('0x3c')]=function(_0x360394,_0x5a364a){return db[_0x1499('0x20')][_0x1499('0x3c')](_0x360394[_0x1499('0x3d')],{})[_0x1499('0x14')](function(_0x49cce1){var _0x2e425c=_0x360394[_0x1499('0x3e')][_0x1499('0x3f')]({'plain':!![]});if(!_0x2e425c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e425c['role']===_0x1499('0x3e')){var _0x491777=_0x49cce1[_0x1499('0x3f')]({'plain':!![]});var _0x34f35c=_0x1499('0x16');return db[_0x1499('0x40')][_0x1499('0x3a')]({'where':{'name':_0x34f35c,'userProfileId':_0x2e425c[_0x1499('0x41')]},'raw':!![]})[_0x1499('0x14')](function(_0x591aa8){if(_0x591aa8&&_0x591aa8[_0x1499('0x42')]===0x0){return db['UserProfileResource'][_0x1499('0x3c')]({'name':_0x491777[_0x1499('0x1c')],'resourceId':_0x491777['id'],'type':_0x591aa8['name'],'sectionId':_0x591aa8['id']},{})[_0x1499('0x14')](function(){return _0x49cce1;});}else{return _0x49cce1;}})[_0x1499('0x3b')](function(_0x3de674){logger['error'](_0x1499('0x43'),_0x3de674);throw _0x3de674;});}return _0x49cce1;})[_0x1499('0x14')](respondWithResult(_0x5a364a,0xc9))[_0x1499('0x3b')](handleError(_0x5a364a,null));};exports[_0x1499('0x44')]=function(_0x305599,_0x11aafe){if(_0x305599[_0x1499('0x3d')]['id']){delete _0x305599[_0x1499('0x3d')]['id'];}return db[_0x1499('0x20')][_0x1499('0x3a')]({'where':{'id':_0x305599['params']['id']}})[_0x1499('0x14')](handleEntityNotFound(_0x11aafe,null))[_0x1499('0x14')](saveUpdates(_0x305599[_0x1499('0x3d')],null))['then'](function(_0x339471){if(!_0x339471)return;var _0x2a7614=_0x339471['get']({'plain':!![]});return _0x2a7614;})[_0x1499('0x14')](function(_0x162ddb){var _0x54134d=new Redis(config[_0x1499('0x5')]);_0x54134d[_0x1499('0x18')](_0x1499('0x19'),JSON[_0x1499('0x1a')](_[_0x1499('0x45')](_0x162ddb,['id',_0x1499('0x1c'),_0x1499('0x46')])));return _0x162ddb;})['then'](respondWithResult(_0x11aafe,null))[_0x1499('0x3b')](handleError(_0x11aafe,null));};exports[_0x1499('0x15')]=function(_0xf2e353,_0x175b8d){return db['SquareProject']['find']({'where':{'id':_0xf2e353[_0x1499('0x36')]['id']}})[_0x1499('0x14')](handleEntityNotFound(_0x175b8d,null))['then'](removeEntity(_0x175b8d,null))[_0x1499('0x3b')](handleError(_0x175b8d,null));};exports[_0x1499('0x47')]=function(_0xf09b4c,_0x55b6ed){return db['SquareProject']['find']({'where':{'id':_0xf09b4c[_0x1499('0x36')]['id']}})[_0x1499('0x14')](handleEntityNotFound(_0x55b6ed,null))[_0x1499('0x14')](function(_0x51af9e){if(_0x51af9e){return _0x51af9e[_0x1499('0x47')](_0xf09b4c['body'][_0x1499('0x48')],_[_0x1499('0x49')](_0xf09b4c[_0x1499('0x3d')],[_0x1499('0x48'),'id'])||{});}})['then'](respondWithResult(_0x55b6ed,null))['catch'](handleError(_0x55b6ed,null));};exports['removeUsers']=function(_0x403832,_0x42629d){return db[_0x1499('0x20')][_0x1499('0x3a')]({'where':{'id':_0x403832['params']['id']}})[_0x1499('0x14')](handleEntityNotFound(_0x42629d,null))[_0x1499('0x14')](function(_0x517f15){if(_0x517f15){return _0x517f15[_0x1499('0x4a')](_0x403832['query'][_0x1499('0x48')])[_0x1499('0x14')](function(){if(_[_0x1499('0x4b')](_0x403832['query'][_0x1499('0x48')])){for(var _0xca5326=0x0;_0xca5326<_0x403832[_0x1499('0x22')]['ids'][_0x1499('0x27')];_0xca5326+=0x1){socket[_0x1499('0x4c')](_0x1499('0x4d'),{'UserId':Number(_0x403832['query'][_0x1499('0x48')][_0xca5326]),'SquareProjectId':Number(_0x403832[_0x1499('0x36')]['id'])});}}else{socket[_0x1499('0x4c')](_0x1499('0x4d'),{'UserId':Number(_0x403832[_0x1499('0x22')][_0x1499('0x48')]),'SquareProjectId':Number(_0x403832['params']['id'])});}});}})[_0x1499('0x14')](respondWithStatusCode(_0x42629d,null))[_0x1499('0x3b')](handleError(_0x42629d,null));};exports['getUsers']=function(_0x3839da,_0x258555){var _0x26cc61={};var _0x1eba4e={};var _0x46b626;var _0x34436f;return db['SquareProject'][_0x1499('0x4e')]({'where':{'id':_0x3839da[_0x1499('0x36')]['id']}})[_0x1499('0x14')](handleEntityNotFound(_0x258555,null))['then'](function(_0x1ff29d){if(_0x1ff29d){_0x46b626=_0x1ff29d;_0x1eba4e[_0x1499('0x21')]=_['keys'](db[_0x1499('0x4f')][_0x1499('0x37')]);_0x1eba4e[_0x1499('0x22')]=_[_0x1499('0x23')](_0x3839da[_0x1499('0x22')]);_0x1eba4e['filters']=_['intersection'](_0x1eba4e[_0x1499('0x21')],_0x1eba4e['query']);_0x26cc61['attributes']=_[_0x1499('0x38')](_0x1eba4e[_0x1499('0x21')],qs['fields'](_0x3839da[_0x1499('0x22')][_0x1499('0x26')]));_0x26cc61[_0x1499('0x25')]=_0x26cc61['attributes']['length']?_0x26cc61[_0x1499('0x25')]:_0x1eba4e[_0x1499('0x21')];_0x26cc61[_0x1499('0x2b')]=qs[_0x1499('0x2c')](_0x3839da[_0x1499('0x22')]['sort']);_0x26cc61[_0x1499('0x2d')]=qs[_0x1499('0x24')](_['pick'](_0x3839da[_0x1499('0x22')],_0x1eba4e[_0x1499('0x24')]));if(_0x3839da[_0x1499('0x22')]['filter']){_0x26cc61[_0x1499('0x2d')]=_[_0x1499('0x2f')](_0x26cc61[_0x1499('0x2d')],{'$or':_[_0x1499('0x1f')](_0x26cc61['attributes'],function(_0x325614){var _0x74e09b={};_0x74e09b[_0x325614]={'$like':'%'+_0x3839da[_0x1499('0x22')]['filter']+'%'};return _0x74e09b;})});}_0x26cc61=_[_0x1499('0x2f')]({},_0x26cc61,_0x3839da[_0x1499('0x39')]);return _0x46b626[_0x1499('0x50')](_0x26cc61);}})[_0x1499('0x14')](function(_0x199516){if(_0x199516){_0x34436f=_0x199516[_0x1499('0x27')];if(!_0x3839da['query'][_0x1499('0x28')]('nolimit')){_0x26cc61['limit']=qs[_0x1499('0x2a')](_0x3839da[_0x1499('0x22')][_0x1499('0x2a')]);_0x26cc61['offset']=qs['offset'](_0x3839da[_0x1499('0x22')][_0x1499('0x11')]);}return _0x46b626['getUsers'](_0x26cc61);}})[_0x1499('0x14')](function(_0x254fc7){if(_0x254fc7){return _0x254fc7?{'count':_0x34436f,'rows':_0x254fc7}:null;}})[_0x1499('0x14')](respondWithResult(_0x258555,null))[_0x1499('0x3b')](handleError(_0x258555,null));}; \ No newline at end of file +var _0x9f0e=['length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','rows','catch','show','params','SquareProject','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','production','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','order','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','Content-Range','update','then','destroy','get','SquareProjects','publish','agi','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x9f0e,0x116));var _0xe9f0=function(_0x25a42f,_0x3a066d){_0x25a42f=_0x25a42f-0x0;var _0x11bf16=_0x9f0e[_0x25a42f];return _0x11bf16;};'use strict';var _=require(_0xe9f0('0x0'));var Redis=require(_0xe9f0('0x1'));var qs=require(_0xe9f0('0x2'));var logger=require(_0xe9f0('0x3'))(_0xe9f0('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe9f0('0x5')]=_[_0xe9f0('0x6')](config[_0xe9f0('0x5')],{'host':_0xe9f0('0x7'),'port':0x18eb});var socket=require(_0xe9f0('0x8'))(new Redis(config['redis']));require('./squareProject.socket')[_0xe9f0('0x9')](socket);function respondWithStatusCode(_0x167198,_0xe64a79){_0xe64a79=_0xe64a79||0xcc;return function(_0x4be6a6){if(_0x4be6a6){return _0x167198[_0xe9f0('0xa')](_0xe64a79);}return _0x167198[_0xe9f0('0xb')](_0xe64a79)[_0xe9f0('0xc')]();};}function respondWithResult(_0x3386a8,_0xa523c0){_0xa523c0=_0xa523c0||0xc8;return function(_0x240932){if(_0x240932){return _0x3386a8[_0xe9f0('0xb')](_0xa523c0)[_0xe9f0('0xd')](_0x240932);}};}function respondWithFilteredResult(_0x6acfb,_0x5352e0){return function(_0x39b5b1){if(_0x39b5b1){var _0x329ecd=typeof _0x5352e0[_0xe9f0('0xe')]==='undefined'&&typeof _0x5352e0[_0xe9f0('0xf')]==='undefined';var _0x367545=_0x39b5b1[_0xe9f0('0x10')];var _0xb49c44=_0x329ecd?0x0:_0x5352e0[_0xe9f0('0xe')];var _0x55a388=_0x329ecd?_0x39b5b1[_0xe9f0('0x10')]:_0x5352e0['offset']+_0x5352e0[_0xe9f0('0xf')];var _0x23914b;if(_0x55a388>=_0x367545){_0x55a388=_0x367545;_0x23914b=0xc8;}else{_0x23914b=0xce;}_0x6acfb[_0xe9f0('0xb')](_0x23914b);return _0x6acfb['set'](_0xe9f0('0x11'),_0xb49c44+'-'+_0x55a388+'/'+_0x367545)[_0xe9f0('0xd')](_0x39b5b1);}return null;};}function saveUpdates(_0x2e68ef){return function(_0x598eee){if(_0x598eee){return _0x598eee[_0xe9f0('0x12')](_0x2e68ef)[_0xe9f0('0x13')](function(_0xcd2042){return _0xcd2042;});}return null;};}function removeEntity(_0xd71ac8){return function(_0x3ed69a){if(_0x3ed69a){return _0x3ed69a[_0xe9f0('0x14')]()[_0xe9f0('0x13')](function(){var _0x59bf5a=_0x3ed69a[_0xe9f0('0x15')]({'plain':!![]});var _0x19e090=_0xe9f0('0x16');return db['UserProfileResource'][_0xe9f0('0x14')]({'where':{'type':_0x19e090,'resourceId':_0x59bf5a['id']}})[_0xe9f0('0x13')](function(){return _0x3ed69a;});})[_0xe9f0('0x13')](function(){var _0x43f399=new Redis(config['redis']);_0x43f399[_0xe9f0('0x17')](_0xe9f0('0x18'),JSON['stringify']({'id':_0x3ed69a['id'],'deleted':!![]}));})['then'](function(){_0xd71ac8['status'](0xcc)[_0xe9f0('0xc')]();});}};}function handleEntityNotFound(_0xa1ddc){return function(_0x1211ae){if(!_0x1211ae){_0xa1ddc[_0xe9f0('0xa')](0x194);}return _0x1211ae;};}function handleError(_0x3ce106,_0x4a5c27){_0x4a5c27=_0x4a5c27||0x1f4;return function(_0x229fe0){logger[_0xe9f0('0x19')](_0x229fe0[_0xe9f0('0x1a')]);if(_0x229fe0[_0xe9f0('0x1b')]){delete _0x229fe0[_0xe9f0('0x1b')];}_0x3ce106[_0xe9f0('0xb')](_0x4a5c27)[_0xe9f0('0x1c')](_0x229fe0);};}exports[_0xe9f0('0x1d')]=function(_0x3c4ba9,_0x3fce54){var _0x48128a={},_0x371095={},_0x27541f={'count':0x0,'rows':[]};var _0x2ddfba=_[_0xe9f0('0x1e')](db['SquareProject'][_0xe9f0('0x1f')],function(_0x2613fd){return{'name':_0x2613fd[_0xe9f0('0x20')],'type':_0x2613fd[_0xe9f0('0x21')][_0xe9f0('0x22')]};});_0x371095['model']=_[_0xe9f0('0x1e')](_0x2ddfba,_0xe9f0('0x1b'));_0x371095[_0xe9f0('0x23')]=_[_0xe9f0('0x24')](_0x3c4ba9[_0xe9f0('0x23')]);_0x371095[_0xe9f0('0x25')]=_[_0xe9f0('0x26')](_0x371095[_0xe9f0('0x27')],_0x371095[_0xe9f0('0x23')]);_0x48128a[_0xe9f0('0x28')]=_[_0xe9f0('0x26')](_0x371095[_0xe9f0('0x27')],qs[_0xe9f0('0x29')](_0x3c4ba9[_0xe9f0('0x23')][_0xe9f0('0x29')]));_0x48128a[_0xe9f0('0x28')]=_0x48128a[_0xe9f0('0x28')][_0xe9f0('0x2a')]?_0x48128a[_0xe9f0('0x28')]:_0x371095[_0xe9f0('0x27')];if(!_0x3c4ba9[_0xe9f0('0x23')][_0xe9f0('0x2b')](_0xe9f0('0x2c'))){_0x48128a[_0xe9f0('0xf')]=qs['limit'](_0x3c4ba9['query']['limit']);_0x48128a[_0xe9f0('0xe')]=qs['offset'](_0x3c4ba9[_0xe9f0('0x23')][_0xe9f0('0xe')]);}_0x48128a['order']=qs[_0xe9f0('0x2d')](_0x3c4ba9['query']['sort']);_0x48128a['where']=qs[_0xe9f0('0x25')](_[_0xe9f0('0x2e')](_0x3c4ba9['query'],_0x371095[_0xe9f0('0x25')]),_0x2ddfba);if(_0x3c4ba9[_0xe9f0('0x23')][_0xe9f0('0x2f')]){_0x48128a['where']=_['merge'](_0x48128a[_0xe9f0('0x30')],{'$or':_[_0xe9f0('0x1e')](_0x2ddfba,function(_0x1917c8){if(_0x1917c8['type']!==_0xe9f0('0x31')){var _0x2e7997={};_0x2e7997[_0x1917c8[_0xe9f0('0x1b')]]={'$like':'%'+_0x3c4ba9[_0xe9f0('0x23')][_0xe9f0('0x2f')]+'%'};return _0x2e7997;}})});}_0x48128a=_['merge']({},_0x48128a,_0x3c4ba9[_0xe9f0('0x32')]);var _0x3a2b23={'where':_0x48128a[_0xe9f0('0x30')]};return db['SquareProject'][_0xe9f0('0x10')](_0x3a2b23)[_0xe9f0('0x13')](function(_0x4825f2){_0x27541f[_0xe9f0('0x10')]=_0x4825f2;if(_0x3c4ba9['query'][_0xe9f0('0x33')]){_0x48128a['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x48128a);})['then'](function(_0x5165f7){_0x27541f[_0xe9f0('0x34')]=_0x5165f7;return _0x27541f;})[_0xe9f0('0x13')](respondWithFilteredResult(_0x3fce54,_0x48128a))[_0xe9f0('0x35')](handleError(_0x3fce54,null));};exports[_0xe9f0('0x36')]=function(_0x2560c6,_0xd9b61b){var _0x3d4eb7={'raw':![],'where':{'id':_0x2560c6[_0xe9f0('0x37')]['id']}},_0x3e79c1={};_0x3e79c1['model']=_[_0xe9f0('0x24')](db[_0xe9f0('0x38')][_0xe9f0('0x1f')]);_0x3e79c1['query']=_['keys'](_0x2560c6[_0xe9f0('0x23')]);_0x3e79c1['filters']=_[_0xe9f0('0x26')](_0x3e79c1[_0xe9f0('0x27')],_0x3e79c1[_0xe9f0('0x23')]);_0x3d4eb7[_0xe9f0('0x28')]=_['intersection'](_0x3e79c1[_0xe9f0('0x27')],qs[_0xe9f0('0x29')](_0x2560c6[_0xe9f0('0x23')][_0xe9f0('0x29')]));_0x3d4eb7[_0xe9f0('0x28')]=_0x3d4eb7['attributes'][_0xe9f0('0x2a')]?_0x3d4eb7[_0xe9f0('0x28')]:_0x3e79c1[_0xe9f0('0x27')];if(_0x2560c6[_0xe9f0('0x23')][_0xe9f0('0x33')]){_0x3d4eb7['include']=[{'all':!![]}];}_0x3d4eb7=_[_0xe9f0('0x39')]({},_0x3d4eb7,_0x2560c6['options']);return db['SquareProject'][_0xe9f0('0x3a')](_0x3d4eb7)[_0xe9f0('0x13')](handleEntityNotFound(_0xd9b61b,null))['then'](respondWithResult(_0xd9b61b,null))[_0xe9f0('0x35')](handleError(_0xd9b61b,null));};exports[_0xe9f0('0x3b')]=function(_0x42d859,_0x7b167b){return db[_0xe9f0('0x38')][_0xe9f0('0x3b')](_0x42d859[_0xe9f0('0x3c')],{})['then'](function(_0x8b8da3){var _0x4a6e2a=_0x42d859[_0xe9f0('0x3d')]['get']({'plain':!![]});if(!_0x4a6e2a)throw new Error(_0xe9f0('0x3e'));if(_0x4a6e2a['role']===_0xe9f0('0x3d')){var _0x2023b4=_0x8b8da3[_0xe9f0('0x15')]({'plain':!![]});var _0x4c94e9=_0xe9f0('0x16');return db[_0xe9f0('0x3f')][_0xe9f0('0x3a')]({'where':{'name':_0x4c94e9,'userProfileId':_0x4a6e2a[_0xe9f0('0x40')]},'raw':!![]})[_0xe9f0('0x13')](function(_0x135175){if(_0x135175&&_0x135175[_0xe9f0('0x41')]===0x0){return db[_0xe9f0('0x42')][_0xe9f0('0x3b')]({'name':_0x2023b4[_0xe9f0('0x1b')],'resourceId':_0x2023b4['id'],'type':_0x135175[_0xe9f0('0x1b')],'sectionId':_0x135175['id']},{})[_0xe9f0('0x13')](function(){return _0x8b8da3;});}else{return _0x8b8da3;}})['catch'](function(_0x55e898){logger[_0xe9f0('0x19')](_0xe9f0('0x43'),_0x55e898);throw _0x55e898;});}return _0x8b8da3;})[_0xe9f0('0x13')](respondWithResult(_0x7b167b,0xc9))['catch'](handleError(_0x7b167b,null));};exports[_0xe9f0('0x12')]=function(_0x4d8b2e,_0x323e1e){if(_0x4d8b2e[_0xe9f0('0x3c')]['id']){delete _0x4d8b2e[_0xe9f0('0x3c')]['id'];}return db[_0xe9f0('0x38')]['find']({'where':{'id':_0x4d8b2e[_0xe9f0('0x37')]['id']}})[_0xe9f0('0x13')](handleEntityNotFound(_0x323e1e,null))['then'](saveUpdates(_0x4d8b2e[_0xe9f0('0x3c')],null))[_0xe9f0('0x13')](function(_0x33f26c){if(!_0x33f26c)return;var _0xa26972=_0x33f26c['get']({'plain':!![]});return _0xa26972;})[_0xe9f0('0x13')](function(_0x3a5d19){var _0x3dd40d=new Redis(config[_0xe9f0('0x5')]);_0x3dd40d[_0xe9f0('0x17')](_0xe9f0('0x18'),JSON[_0xe9f0('0x44')](_[_0xe9f0('0x2e')](_0x3a5d19,['id','name',_0xe9f0('0x45')])));return _0x3a5d19;})[_0xe9f0('0x13')](respondWithResult(_0x323e1e,null))[_0xe9f0('0x35')](handleError(_0x323e1e,null));};exports[_0xe9f0('0x14')]=function(_0x335325,_0xe67052){return db[_0xe9f0('0x38')][_0xe9f0('0x3a')]({'where':{'id':_0x335325[_0xe9f0('0x37')]['id']}})[_0xe9f0('0x13')](handleEntityNotFound(_0xe67052,null))[_0xe9f0('0x13')](removeEntity(_0xe67052,null))[_0xe9f0('0x35')](handleError(_0xe67052,null));};exports[_0xe9f0('0x46')]=function(_0x421891,_0x4ea259){return db[_0xe9f0('0x38')][_0xe9f0('0x3a')]({'where':{'id':_0x421891[_0xe9f0('0x37')]['id']}})['then'](handleEntityNotFound(_0x4ea259,null))['then'](function(_0x416308){if(_0x416308){return _0x416308['addUsers'](_0x421891[_0xe9f0('0x3c')][_0xe9f0('0x47')],_[_0xe9f0('0x48')](_0x421891['body'],[_0xe9f0('0x47'),'id'])||{});}})[_0xe9f0('0x13')](respondWithResult(_0x4ea259,null))[_0xe9f0('0x35')](handleError(_0x4ea259,null));};exports[_0xe9f0('0x49')]=function(_0x4bb39d,_0x392eae){return db[_0xe9f0('0x38')][_0xe9f0('0x3a')]({'where':{'id':_0x4bb39d[_0xe9f0('0x37')]['id']}})['then'](handleEntityNotFound(_0x392eae,null))['then'](function(_0x45efe4){if(_0x45efe4){return _0x45efe4[_0xe9f0('0x49')](_0x4bb39d[_0xe9f0('0x23')][_0xe9f0('0x47')])[_0xe9f0('0x13')](function(){if(_['isArray'](_0x4bb39d[_0xe9f0('0x23')]['ids'])){for(var _0x16b3c0=0x0;_0x16b3c0<_0x4bb39d['query'][_0xe9f0('0x47')][_0xe9f0('0x2a')];_0x16b3c0+=0x1){socket[_0xe9f0('0x4a')](_0xe9f0('0x4b'),{'UserId':Number(_0x4bb39d[_0xe9f0('0x23')]['ids'][_0x16b3c0]),'SquareProjectId':Number(_0x4bb39d['params']['id'])});}}else{socket['emit'](_0xe9f0('0x4b'),{'UserId':Number(_0x4bb39d[_0xe9f0('0x23')]['ids']),'SquareProjectId':Number(_0x4bb39d[_0xe9f0('0x37')]['id'])});}});}})['then'](respondWithStatusCode(_0x392eae,null))['catch'](handleError(_0x392eae,null));};exports[_0xe9f0('0x4c')]=function(_0x329e9e,_0x2d65f8){var _0x1dcb10={};var _0x1d2fb2={};var _0x470163;var _0x494efc;return db['SquareProject'][_0xe9f0('0x4d')]({'where':{'id':_0x329e9e[_0xe9f0('0x37')]['id']}})[_0xe9f0('0x13')](handleEntityNotFound(_0x2d65f8,null))[_0xe9f0('0x13')](function(_0x55dae1){if(_0x55dae1){_0x470163=_0x55dae1;_0x1d2fb2[_0xe9f0('0x27')]=_[_0xe9f0('0x24')](db[_0xe9f0('0x4e')][_0xe9f0('0x1f')]);_0x1d2fb2[_0xe9f0('0x23')]=_[_0xe9f0('0x24')](_0x329e9e['query']);_0x1d2fb2[_0xe9f0('0x25')]=_[_0xe9f0('0x26')](_0x1d2fb2[_0xe9f0('0x27')],_0x1d2fb2[_0xe9f0('0x23')]);_0x1dcb10[_0xe9f0('0x28')]=_['intersection'](_0x1d2fb2[_0xe9f0('0x27')],qs[_0xe9f0('0x29')](_0x329e9e[_0xe9f0('0x23')][_0xe9f0('0x29')]));_0x1dcb10[_0xe9f0('0x28')]=_0x1dcb10[_0xe9f0('0x28')][_0xe9f0('0x2a')]?_0x1dcb10[_0xe9f0('0x28')]:_0x1d2fb2[_0xe9f0('0x27')];_0x1dcb10[_0xe9f0('0x4f')]=qs[_0xe9f0('0x2d')](_0x329e9e[_0xe9f0('0x23')]['sort']);_0x1dcb10[_0xe9f0('0x30')]=qs[_0xe9f0('0x25')](_[_0xe9f0('0x2e')](_0x329e9e[_0xe9f0('0x23')],_0x1d2fb2[_0xe9f0('0x25')]));if(_0x329e9e[_0xe9f0('0x23')][_0xe9f0('0x2f')]){_0x1dcb10['where']=_[_0xe9f0('0x39')](_0x1dcb10[_0xe9f0('0x30')],{'$or':_['map'](_0x1dcb10[_0xe9f0('0x28')],function(_0x472a79){var _0x442b78={};_0x442b78[_0x472a79]={'$like':'%'+_0x329e9e['query'][_0xe9f0('0x2f')]+'%'};return _0x442b78;})});}_0x1dcb10=_[_0xe9f0('0x39')]({},_0x1dcb10,_0x329e9e['options']);return _0x470163[_0xe9f0('0x4c')](_0x1dcb10);}})[_0xe9f0('0x13')](function(_0x4ee187){if(_0x4ee187){_0x494efc=_0x4ee187['length'];if(!_0x329e9e[_0xe9f0('0x23')]['hasOwnProperty'](_0xe9f0('0x2c'))){_0x1dcb10[_0xe9f0('0xf')]=qs['limit'](_0x329e9e[_0xe9f0('0x23')][_0xe9f0('0xf')]);_0x1dcb10[_0xe9f0('0xe')]=qs[_0xe9f0('0xe')](_0x329e9e[_0xe9f0('0x23')][_0xe9f0('0xe')]);}return _0x470163[_0xe9f0('0x4c')](_0x1dcb10);}})[_0xe9f0('0x13')](function(_0x594421){if(_0x594421){return _0x594421?{'count':_0x494efc,'rows':_0x594421}:null;}})['then'](respondWithResult(_0x2d65f8,null))[_0xe9f0('0x35')](handleError(_0x2d65f8,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f8bd596..20b74c6 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 _0x899d=['SquareProject','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x32e94b,_0x38c7a7){var _0x3b1567=function(_0x282670){while(--_0x282670){_0x32e94b['push'](_0x32e94b['shift']());}};_0x3b1567(++_0x38c7a7);}(_0x899d,0xbf));var _0xd899=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x899d[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xd899('0x0'))['db'][_0xd899('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd899('0x2'),'afterUpdate':_0xd899('0x3'),'afterDestroy':_0xd899('0x4')};function emitEvent(_0x360c92){return function(_0x370d86,_0x859ede,_0x1ecd0d){SquareProjectEvents['emit'](_0x360c92+':'+_0x370d86['id'],_0x370d86);SquareProjectEvents[_0xd899('0x5')](_0x360c92,_0x370d86);_0x1ecd0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xd899('0x6')](e,emitEvent(event));}}module[_0xd899('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x0d1c=['hook','exports','events','update','remove','emit','hasOwnProperty'];(function(_0x5927eb,_0xdf684c){var _0x3eacc4=function(_0x40919f){while(--_0x40919f){_0x5927eb['push'](_0x5927eb['shift']());}};_0x3eacc4(++_0xdf684c);}(_0x0d1c,0x18a));var _0xc0d1=function(_0x18930a,_0x3d4957){_0x18930a=_0x18930a-0x0;var _0x4e63ef=_0x0d1c[_0x18930a];return _0x4e63ef;};'use strict';var EventEmitter=require(_0xc0d1('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0d1('0x1'),'afterDestroy':_0xc0d1('0x2')};function emitEvent(_0x359c6a){return function(_0x1a70d4,_0x56212b,_0x2bf114){SquareProjectEvents[_0xc0d1('0x3')](_0x359c6a+':'+_0x1a70d4['id'],_0x1a70d4);SquareProjectEvents[_0xc0d1('0x3')](_0x359c6a,_0x1a70d4);_0x2bf114(null);};}for(var e in events){if(events[_0xc0d1('0x4')](e)){var event=events[e];SquareProject[_0xc0d1('0x5')](e,emitEvent(event));}}module[_0xc0d1('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 5541866..81e1423 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 _0xd50d=['path','rimraf','changed','preproduction','savedAt','format','production','publishedAt','lodash','util','../../config/logger','bluebird'];(function(_0x12e1fa,_0x44e981){var _0x1e743e=function(_0x56e0c1){while(--_0x56e0c1){_0x12e1fa['push'](_0x12e1fa['shift']());}};_0x1e743e(++_0x44e981);}(_0xd50d,0x1c4));var _0xdd50=function(_0x52b011,_0x2be722){_0x52b011=_0x52b011-0x0;var _0x5a6bfc=_0xd50d[_0x52b011];return _0x5a6bfc;};'use strict';var _=require(_0xdd50('0x0'));var util=require(_0xdd50('0x1'));var logger=require(_0xdd50('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdd50('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd50('0x4'));var rimraf=require(_0xdd50('0x5'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x4b5eae,_0x5560c3){return _0x4b5eae['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bf5fd,_0x276830,_0x3d0831){if(_0x2bf5fd[_0xdd50('0x6')](_0xdd50('0x7'))){_0x2bf5fd[_0xdd50('0x8')]=moment()[_0xdd50('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2bf5fd[_0xdd50('0x6')](_0xdd50('0xa'))){_0x2bf5fd[_0xdd50('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3d0831(null,_0x2bf5fd);}}});}; \ No newline at end of file +var _0x36d5=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareProject.attributes','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x5920c0,_0x11a94e){var _0x45e4eb=function(_0x294f07){while(--_0x294f07){_0x5920c0['push'](_0x5920c0['shift']());}};_0x45e4eb(++_0x11a94e);}(_0x36d5,0x1a0));var _0x536d=function(_0xd3b0ac,_0x2f5065){_0xd3b0ac=_0xd3b0ac-0x0;var _0x3d773e=_0x36d5[_0xd3b0ac];return _0x3d773e;};'use strict';var _=require(_0x536d('0x0'));var util=require(_0x536d('0x1'));var logger=require(_0x536d('0x2'))(_0x536d('0x3'));var moment=require(_0x536d('0x4'));var BPromise=require(_0x536d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x536d('0x6'));var rimraf=require('rimraf');var config=require(_0x536d('0x7'));var attributes=require(_0x536d('0x8'));module['exports']=function(_0x48bd5e,_0x3e0c96){return _0x48bd5e['define'](_0x536d('0x9'),attributes,{'tableName':_0x536d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3651a9,_0x3dedb6,_0x17e13c){if(_0x3651a9[_0x536d('0xb')](_0x536d('0xc'))){_0x3651a9['savedAt']=moment()[_0x536d('0xd')](_0x536d('0xe'));}if(_0x3651a9[_0x536d('0xb')](_0x536d('0xf'))){_0x3651a9['publishedAt']=moment()[_0x536d('0xd')](_0x536d('0xe'));}_0x17e13c(null,_0x3651a9);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index a61746b..7c24421 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 _0xe0c2=['localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','attributes','include','map','model','info','debug','catch','error','message','ShowSquareProject','then','stringify','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults'];(function(_0x21fb32,_0x149cc9){var _0x426acc=function(_0x1089c4){while(--_0x1089c4){_0x21fb32['push'](_0x21fb32['shift']());}};_0x426acc(++_0x149cc9);}(_0xe0c2,0xa6));var _0x2e0c=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0xe0c2[_0x161f59];return _0x3ffa0e;};'use strict';var _=require(_0x2e0c('0x0'));var Redis=require(_0x2e0c('0x1'));var db=require(_0x2e0c('0x2'))['db'];var logger=require(_0x2e0c('0x3'))(_0x2e0c('0x4'));var config=require(_0x2e0c('0x5'));config[_0x2e0c('0x6')]=_[_0x2e0c('0x7')](config[_0x2e0c('0x6')],{'host':_0x2e0c('0x8'),'port':0x18eb});var socket=require(_0x2e0c('0x9'))(new Redis(config[_0x2e0c('0x6')]));require(_0x2e0c('0xa'))[_0x2e0c('0xb')](socket);exports[_0x2e0c('0xc')]=function(_0x97ae41){var _0xbc6fbf=this;return new Promise(function(_0x62a9bd,_0x24e2fc){return db[_0x2e0c('0xd')]['findAll']({'raw':_0x97ae41[_0x2e0c('0xe')]?_0x97ae41[_0x2e0c('0xe')][_0x2e0c('0xf')]===undefined?!![]:![]:!![],'where':_0x97ae41[_0x2e0c('0xe')]?_0x97ae41['options'][_0x2e0c('0x10')]||null:null,'attributes':_0x97ae41[_0x2e0c('0xe')]?_0x97ae41[_0x2e0c('0xe')][_0x2e0c('0x11')]||null:null,'limit':_0x97ae41[_0x2e0c('0xe')]?_0x97ae41[_0x2e0c('0xe')]['limit']||null:null,'include':_0x97ae41[_0x2e0c('0xe')]?_0x97ae41['options'][_0x2e0c('0x12')]?_[_0x2e0c('0x13')](_0x97ae41[_0x2e0c('0xe')][_0x2e0c('0x12')],function(_0x479cf5){return{'model':db[_0x479cf5[_0x2e0c('0x14')]],'as':_0x479cf5['as'],'attributes':_0x479cf5[_0x2e0c('0x11')],'include':_0x479cf5[_0x2e0c('0x12')]?_['map'](_0x479cf5[_0x2e0c('0x12')],function(_0x4b171c){return{'model':db[_0x4b171c[_0x2e0c('0x14')]],'as':_0x4b171c['as'],'attributes':_0x4b171c[_0x2e0c('0x11')],'include':_0x4b171c[_0x2e0c('0x12')]?_[_0x2e0c('0x13')](_0x4b171c[_0x2e0c('0x12')],function(_0x529237){return{'model':db[_0x529237[_0x2e0c('0x14')]],'as':_0x529237['as'],'attributes':_0x529237['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fe004){logger[_0x2e0c('0x15')]('GetSquareProjects',_0x97ae41);logger[_0x2e0c('0x16')]('GetSquareProjects',_0x97ae41,JSON['stringify'](_0x2fe004));_0x62a9bd(_0x2fe004);})[_0x2e0c('0x17')](function(_0x231f3d){logger[_0x2e0c('0x18')](_0x2e0c('0xc'),_0x231f3d[_0x2e0c('0x19')],_0x97ae41);_0x24e2fc(_0xbc6fbf[_0x2e0c('0x18')](0x1f4,_0x231f3d[_0x2e0c('0x19')]));});});};exports[_0x2e0c('0x1a')]=function(_0x4995cc){var _0x5a28f5=this;return new Promise(function(_0xf6bc70,_0x3f6bdc){return db['SquareProject']['find']({'raw':_0x4995cc['options']?_0x4995cc[_0x2e0c('0xe')][_0x2e0c('0xf')]===undefined?!![]:![]:!![],'where':_0x4995cc[_0x2e0c('0xe')]?_0x4995cc[_0x2e0c('0xe')][_0x2e0c('0x10')]||null:null,'attributes':_0x4995cc[_0x2e0c('0xe')]?_0x4995cc[_0x2e0c('0xe')]['attributes']||null:null,'include':_0x4995cc[_0x2e0c('0xe')]?_0x4995cc['options'][_0x2e0c('0x12')]?_['map'](_0x4995cc[_0x2e0c('0xe')]['include'],function(_0x55871e){return{'model':db[_0x55871e[_0x2e0c('0x14')]],'as':_0x55871e['as'],'attributes':_0x55871e[_0x2e0c('0x11')],'include':_0x55871e['include']?_[_0x2e0c('0x13')](_0x55871e[_0x2e0c('0x12')],function(_0x2f2cc6){return{'model':db[_0x2f2cc6[_0x2e0c('0x14')]],'as':_0x2f2cc6['as'],'attributes':_0x2f2cc6[_0x2e0c('0x11')],'include':_0x2f2cc6[_0x2e0c('0x12')]?_[_0x2e0c('0x13')](_0x2f2cc6[_0x2e0c('0x12')],function(_0x569912){return{'model':db[_0x569912[_0x2e0c('0x14')]],'as':_0x569912['as'],'attributes':_0x569912[_0x2e0c('0x11')]};}):[]};}):[]};}):[]:[]})[_0x2e0c('0x1b')](function(_0x2d7ffc){logger[_0x2e0c('0x15')](_0x2e0c('0x1a'),_0x4995cc);logger[_0x2e0c('0x16')]('ShowSquareProject',_0x4995cc,JSON[_0x2e0c('0x1c')](_0x2d7ffc));_0xf6bc70(_0x2d7ffc);})[_0x2e0c('0x17')](function(_0x1a536f){logger[_0x2e0c('0x18')](_0x2e0c('0x1a'),_0x1a536f[_0x2e0c('0x19')],_0x4995cc);_0x3f6bdc(_0x5a28f5[_0x2e0c('0x18')](0x1f4,_0x1a536f[_0x2e0c('0x19')]));});});}; \ No newline at end of file +var _0xbf8b=['socket.io-emitter','./squareProject.socket','GetSquareProjects','options','where','limit','include','map','model','attributes','then','info','debug','stringify','catch','error','message','SquareProject','find','raw','ShowSquareProject','lodash','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults'];(function(_0x1dd210,_0x1bc0e){var _0x5ebc1b=function(_0x5ee674){while(--_0x5ee674){_0x1dd210['push'](_0x1dd210['shift']());}};_0x5ebc1b(++_0x1bc0e);}(_0xbf8b,0x85));var _0xbbf8=function(_0x73424b,_0x467692){_0x73424b=_0x73424b-0x0;var _0x43c9a5=_0xbf8b[_0x73424b];return _0x43c9a5;};'use strict';var _=require(_0xbbf8('0x0'));var Redis=require(_0xbbf8('0x1'));var db=require(_0xbbf8('0x2'))['db'];var logger=require(_0xbbf8('0x3'))(_0xbbf8('0x4'));var config=require('../../config/environment');config[_0xbbf8('0x5')]=_[_0xbbf8('0x6')](config[_0xbbf8('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xbbf8('0x7'))(new Redis(config[_0xbbf8('0x5')]));require(_0xbbf8('0x8'))['register'](socket);exports[_0xbbf8('0x9')]=function(_0x385dbb){var _0x3a755f=this;return new Promise(function(_0x2a0864,_0x11eaf){return db['SquareProject']['findAll']({'raw':_0x385dbb[_0xbbf8('0xa')]?_0x385dbb[_0xbbf8('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x385dbb[_0xbbf8('0xa')]?_0x385dbb[_0xbbf8('0xa')][_0xbbf8('0xb')]||null:null,'attributes':_0x385dbb['options']?_0x385dbb[_0xbbf8('0xa')]['attributes']||null:null,'limit':_0x385dbb[_0xbbf8('0xa')]?_0x385dbb[_0xbbf8('0xa')][_0xbbf8('0xc')]||null:null,'include':_0x385dbb[_0xbbf8('0xa')]?_0x385dbb[_0xbbf8('0xa')][_0xbbf8('0xd')]?_[_0xbbf8('0xe')](_0x385dbb[_0xbbf8('0xa')][_0xbbf8('0xd')],function(_0x13bbbb){return{'model':db[_0x13bbbb[_0xbbf8('0xf')]],'as':_0x13bbbb['as'],'attributes':_0x13bbbb[_0xbbf8('0x10')],'include':_0x13bbbb[_0xbbf8('0xd')]?_['map'](_0x13bbbb[_0xbbf8('0xd')],function(_0x3010ea){return{'model':db[_0x3010ea[_0xbbf8('0xf')]],'as':_0x3010ea['as'],'attributes':_0x3010ea['attributes'],'include':_0x3010ea[_0xbbf8('0xd')]?_[_0xbbf8('0xe')](_0x3010ea['include'],function(_0x105256){return{'model':db[_0x105256['model']],'as':_0x105256['as'],'attributes':_0x105256[_0xbbf8('0x10')]};}):[]};}):[]};}):[]:[]})[_0xbbf8('0x11')](function(_0x3638ef){logger[_0xbbf8('0x12')](_0xbbf8('0x9'),_0x385dbb);logger[_0xbbf8('0x13')](_0xbbf8('0x9'),_0x385dbb,JSON[_0xbbf8('0x14')](_0x3638ef));_0x2a0864(_0x3638ef);})[_0xbbf8('0x15')](function(_0x57a069){logger[_0xbbf8('0x16')](_0xbbf8('0x9'),_0x57a069[_0xbbf8('0x17')],_0x385dbb);_0x11eaf(_0x3a755f['error'](0x1f4,_0x57a069[_0xbbf8('0x17')]));});});};exports['ShowSquareProject']=function(_0x465718){var _0x2eb3a2=this;return new Promise(function(_0x3794f9,_0x13da24){return db[_0xbbf8('0x18')][_0xbbf8('0x19')]({'raw':_0x465718['options']?_0x465718[_0xbbf8('0xa')][_0xbbf8('0x1a')]===undefined?!![]:![]:!![],'where':_0x465718[_0xbbf8('0xa')]?_0x465718[_0xbbf8('0xa')][_0xbbf8('0xb')]||null:null,'attributes':_0x465718['options']?_0x465718[_0xbbf8('0xa')]['attributes']||null:null,'include':_0x465718[_0xbbf8('0xa')]?_0x465718['options'][_0xbbf8('0xd')]?_[_0xbbf8('0xe')](_0x465718[_0xbbf8('0xa')]['include'],function(_0x2a1cf4){return{'model':db[_0x2a1cf4['model']],'as':_0x2a1cf4['as'],'attributes':_0x2a1cf4[_0xbbf8('0x10')],'include':_0x2a1cf4['include']?_[_0xbbf8('0xe')](_0x2a1cf4[_0xbbf8('0xd')],function(_0x5cce51){return{'model':db[_0x5cce51['model']],'as':_0x5cce51['as'],'attributes':_0x5cce51[_0xbbf8('0x10')],'include':_0x5cce51[_0xbbf8('0xd')]?_['map'](_0x5cce51[_0xbbf8('0xd')],function(_0xd7b70b){return{'model':db[_0xd7b70b[_0xbbf8('0xf')]],'as':_0xd7b70b['as'],'attributes':_0xd7b70b[_0xbbf8('0x10')]};}):[]};}):[]};}):[]:[]})[_0xbbf8('0x11')](function(_0x168717){logger[_0xbbf8('0x12')](_0xbbf8('0x1b'),_0x465718);logger[_0xbbf8('0x13')](_0xbbf8('0x1b'),_0x465718,JSON[_0xbbf8('0x14')](_0x168717));_0x3794f9(_0x168717);})[_0xbbf8('0x15')](function(_0x5a1f46){logger[_0xbbf8('0x16')]('ShowSquareProject',_0x5a1f46['message'],_0x465718);_0x13da24(_0x2eb3a2[_0xbbf8('0x16')](0x1f4,_0x5a1f46[_0xbbf8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7c9dfc9..ce05963 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 _0xca9e=['removeListener','register','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xca9e,0xd3));var _0xeca9=function(_0x59dea7,_0x52bf4d){_0x59dea7=_0x59dea7-0x0;var _0x2f60d2=_0xca9e[_0x59dea7];return _0x2f60d2;};'use strict';var SquareProjectEvents=require(_0xeca9('0x0'));var events=[_0xeca9('0x1'),_0xeca9('0x2'),_0xeca9('0x3')];function createListener(_0x10463d,_0xfd87e2){return function(_0x2148b5){_0xfd87e2[_0xeca9('0x4')](_0x10463d,_0x2148b5);};}function removeListener(_0x3a63a7,_0x4b048a){return function(){SquareProjectEvents[_0xeca9('0x5')](_0x3a63a7,_0x4b048a);};}exports[_0xeca9('0x6')]=function(_0x22bb05){for(var _0xe7b330=0x0,_0x2553b4=events[_0xeca9('0x7')];_0xe7b330<_0x2553b4;_0xe7b330++){var _0x29d04a=events[_0xe7b330];var _0x3b9056=createListener(_0xeca9('0x8')+_0x29d04a,_0x22bb05);SquareProjectEvents['on'](_0x29d04a,_0x3b9056);}}; \ No newline at end of file +var _0x5b80=['save','update','removeListener','register','length','squareProject:'];(function(_0x256279,_0x10e2e6){var _0x523804=function(_0x2923a5){while(--_0x2923a5){_0x256279['push'](_0x256279['shift']());}};_0x523804(++_0x10e2e6);}(_0x5b80,0x150));var _0x05b8=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x5b80[_0x54d4a8];return _0x3b321b;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x05b8('0x0'),'remove',_0x05b8('0x1')];function createListener(_0x5d926c,_0x5add16){return function(_0xed2127){_0x5add16['emit'](_0x5d926c,_0xed2127);};}function removeListener(_0x4f306f,_0x28c21d){return function(){SquareProjectEvents[_0x05b8('0x2')](_0x4f306f,_0x28c21d);};}exports[_0x05b8('0x3')]=function(_0x541120){for(var _0x40ff44=0x0,_0xfd280f=events[_0x05b8('0x4')];_0x40ff44<_0xfd280f;_0x40ff44++){var _0x791d0a=events[_0x40ff44];var _0x2f8e63=createListener(_0x05b8('0x5')+_0x791d0a,_0x541120);SquareProjectEvents['on'](_0x791d0a,_0x2f8e63);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 24dbb53..05d3c7c 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 _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(_0x2d7edb,_0x547ac0){var _0x4347c0=function(_0x41818f){while(--_0x41818f){_0x2d7edb['push'](_0x2d7edb['shift']());}};_0x4347c0(++_0x547ac0);}(_0x1261,0x144));var _0x1126=function(_0x38dcfe,_0x1b9f72){_0x38dcfe=_0x38dcfe-0x0;var _0x1964d8=_0x1261[_0x38dcfe];return _0x1964d8;};'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 +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x5196d1,_0x2d5382){var _0x20eed6=function(_0x4cd346){while(--_0x4cd346){_0x5196d1['push'](_0x5196d1['shift']());}};_0x20eed6(++_0x2d5382);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 6172a66..3d5c614 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 _0x2bd8=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x2bd8,0x130));var _0x82bd=function(_0x57c92b,_0x1f9a82){_0x57c92b=_0x57c92b-0x0;var _0x427be2=_0x2bd8[_0x57c92b];return _0x427be2;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'callerid':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'extension':{'type':Sequelize[_0x82bd('0x1')]},'priority':{'type':Sequelize[_0x82bd('0x1')]},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x82bd('0x1')]},'saveName':{'type':Sequelize[_0x82bd('0x1')]},'filename':{'type':Sequelize[_0x82bd('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82bd('0x2')],'get':function(){var _0x77d7a9='';var _0x226f60=this[_0x82bd('0x3')]('savePath');if(_0x226f60){_0x77d7a9=_0x226f60[_0x82bd('0x4')](_0x226f60['lastIndexOf']('.'));}return _0x77d7a9;}}}; \ No newline at end of file +var _0x6aa7=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x24927c,_0x310be1){var _0x12acb5=function(_0xe49aa7){while(--_0xe49aa7){_0x24927c['push'](_0x24927c['shift']());}};_0x12acb5(++_0x310be1);}(_0x6aa7,0x178));var _0x76aa=function(_0x2825ff,_0x25b3db){_0x2825ff=_0x2825ff-0x0;var _0x5b2e3a=_0x6aa7[_0x2825ff];return _0x5b2e3a;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'callerid':{'type':Sequelize[_0x76aa('0x1')]},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'context':{'type':Sequelize[_0x76aa('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x1')]},'accountcode':{'type':Sequelize[_0x76aa('0x1')]},'dnid':{'type':Sequelize[_0x76aa('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x76aa('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x76aa('0x2')],'get':function(){var _0x36d12b='';var _0xa9b695=this['getDataValue'](_0x76aa('0x3'));if(_0xa9b695){_0x36d12b=_0xa9b695[_0x76aa('0x4')](_0xa9b695[_0x76aa('0x5')]('.'));}return _0x36d12b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 71a0dd5..3bfeeef 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 _0x7de4=['Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','then','destroy','error','name','send','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','show','keys','find','create','body','update','download','uniqueid','params','savePath','filename','format','existsSync','decryptFile','secrets','recording','SquareRecording\x20not\x20found','extname','unlink','message'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0x7de4,0x64));var _0x47de=function(_0x58c79c,_0x2592e2){_0x58c79c=_0x58c79c-0x0;var _0x7b8c9d=_0x7de4[_0x58c79c];return _0x7b8c9d;};'use strict';var emlformat=require(_0x47de('0x0'));var rimraf=require(_0x47de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x47de('0x2'));var BPromise=require(_0x47de('0x3'));var Mustache=require('mustache');var util=require(_0x47de('0x4'));var path=require('path');var sox=require(_0x47de('0x5'));var csv=require(_0x47de('0x6'));var ejs=require(_0x47de('0x7'));var fs=require('fs');var fs_extra=require(_0x47de('0x8'));var _=require(_0x47de('0x9'));var squel=require('squel');var crypto=require(_0x47de('0xa'));var jsforce=require(_0x47de('0xb'));var deskjs=require(_0x47de('0xc'));var toCsv=require(_0x47de('0x6'));var querystring=require(_0x47de('0xd'));var Papa=require(_0x47de('0xe'));var Redis=require('ioredis');var authService=require(_0x47de('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47de('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x47de('0x11'))(_0x47de('0x12'));var utils=require(_0x47de('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x47de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45f548,_0x43b6ef){_0x43b6ef=_0x43b6ef||0xcc;return function(_0x580025){if(_0x580025){return _0x45f548[_0x47de('0x15')](_0x43b6ef);}return _0x45f548['status'](_0x43b6ef)[_0x47de('0x16')]();};}function respondWithResult(_0x2732b3,_0x48a3e9){_0x48a3e9=_0x48a3e9||0xc8;return function(_0x139e9f){if(_0x139e9f){return _0x2732b3['status'](_0x48a3e9)[_0x47de('0x17')](_0x139e9f);}};}function respondWithFilteredResult(_0x7d8311,_0x4a4bb6){return function(_0x448020){if(_0x448020){var _0x50e332=typeof _0x4a4bb6['offset']===_0x47de('0x18')&&typeof _0x4a4bb6[_0x47de('0x19')]===_0x47de('0x18');var _0x3f8a45=_0x448020[_0x47de('0x1a')];var _0x2ac974=_0x50e332?0x0:_0x4a4bb6[_0x47de('0x1b')];var _0x401b25=_0x50e332?_0x448020[_0x47de('0x1a')]:_0x4a4bb6[_0x47de('0x1b')]+_0x4a4bb6[_0x47de('0x19')];var _0x1b5bec;if(_0x401b25>=_0x3f8a45){_0x401b25=_0x3f8a45;_0x1b5bec=0xc8;}else{_0x1b5bec=0xce;}_0x7d8311[_0x47de('0x1c')](_0x1b5bec);return _0x7d8311[_0x47de('0x1d')](_0x47de('0x1e'),_0x2ac974+'-'+_0x401b25+'/'+_0x3f8a45)[_0x47de('0x17')](_0x448020);}return null;};}function patchUpdates(_0x47eba0){return function(_0x4cc23a){try{jsonpatch[_0x47de('0x1f')](_0x4cc23a,_0x47eba0,!![]);}catch(_0x4f3a8c){return BPromise['reject'](_0x4f3a8c);}return _0x4cc23a['save']();};}function saveUpdates(_0x4801e0,_0x590cd7){return function(_0x18d98d){if(_0x18d98d){return _0x18d98d['update'](_0x4801e0)[_0x47de('0x20')](function(_0x1f26c7){return _0x1f26c7;});}return null;};}function removeEntity(_0x2fac05,_0x1c6b52){return function(_0xc836f9){if(_0xc836f9){return _0xc836f9[_0x47de('0x21')]()[_0x47de('0x20')](function(){_0x2fac05[_0x47de('0x1c')](0xcc)[_0x47de('0x16')]();});}};}function handleEntityNotFound(_0x3f5e8e,_0x4b14a6){return function(_0x44c774){if(!_0x44c774){_0x3f5e8e[_0x47de('0x15')](0x194);}return _0x44c774;};}function handleError(_0x4d3ddf,_0x4dbd7d){_0x4dbd7d=_0x4dbd7d||0x1f4;return function(_0x5da82a){logger[_0x47de('0x22')](_0x5da82a['stack']);if(_0x5da82a[_0x47de('0x23')]){delete _0x5da82a[_0x47de('0x23')];}_0x4d3ddf[_0x47de('0x1c')](_0x4dbd7d)[_0x47de('0x24')](_0x5da82a);};}exports['index']=function(_0x254d78,_0x559f6a){var _0x5caca7={},_0x9fbe8a={},_0x358d98={'count':0x0,'rows':[]};var _0x70d43d=_[_0x47de('0x25')](db['SquareRecording'][_0x47de('0x26')],function(_0x571eeb){return{'name':_0x571eeb[_0x47de('0x27')],'type':_0x571eeb[_0x47de('0x28')]['key']};});_0x9fbe8a[_0x47de('0x29')]=_['map'](_0x70d43d,_0x47de('0x23'));_0x9fbe8a['query']=_['keys'](_0x254d78[_0x47de('0x2a')]);_0x9fbe8a['filters']=_[_0x47de('0x2b')](_0x9fbe8a[_0x47de('0x29')],_0x9fbe8a[_0x47de('0x2a')]);_0x5caca7[_0x47de('0x2c')]=_['intersection'](_0x9fbe8a[_0x47de('0x29')],qs[_0x47de('0x2d')](_0x254d78[_0x47de('0x2a')][_0x47de('0x2d')]));_0x5caca7['attributes']=_0x5caca7[_0x47de('0x2c')][_0x47de('0x2e')]?_0x5caca7['attributes']:_0x9fbe8a[_0x47de('0x29')];if(!_0x254d78[_0x47de('0x2a')][_0x47de('0x2f')](_0x47de('0x30'))){_0x5caca7['limit']=qs[_0x47de('0x19')](_0x254d78[_0x47de('0x2a')]['limit']);_0x5caca7[_0x47de('0x1b')]=qs['offset'](_0x254d78['query']['offset']);}_0x5caca7[_0x47de('0x31')]=qs[_0x47de('0x32')](_0x254d78[_0x47de('0x2a')][_0x47de('0x32')]);_0x5caca7['where']=qs[_0x47de('0x33')](_[_0x47de('0x34')](_0x254d78[_0x47de('0x2a')],_0x9fbe8a['filters']),_0x70d43d);if(_0x254d78[_0x47de('0x2a')][_0x47de('0x35')]){_0x5caca7[_0x47de('0x36')]=_['merge'](_0x5caca7[_0x47de('0x36')],{'$or':_[_0x47de('0x25')](_0x70d43d,function(_0x31ae99){if(_0x31ae99[_0x47de('0x28')]!==_0x47de('0x37')){var _0x1232fc={};_0x1232fc[_0x31ae99['name']]={'$like':'%'+_0x254d78[_0x47de('0x2a')][_0x47de('0x35')]+'%'};return _0x1232fc;}})});}_0x5caca7=_[_0x47de('0x38')]({},_0x5caca7,_0x254d78[_0x47de('0x39')]);var _0x83db55={'where':_0x5caca7['where']};return db[_0x47de('0x3a')][_0x47de('0x1a')](_0x83db55)['then'](function(_0x296457){_0x358d98['count']=_0x296457;if(_0x254d78[_0x47de('0x2a')][_0x47de('0x3b')]){_0x5caca7[_0x47de('0x3c')]=[{'all':!![]}];}return db['SquareRecording'][_0x47de('0x3d')](_0x5caca7);})[_0x47de('0x20')](function(_0x15f287){_0x358d98[_0x47de('0x3e')]=_0x15f287;return _0x358d98;})[_0x47de('0x20')](respondWithFilteredResult(_0x559f6a,_0x5caca7))[_0x47de('0x3f')](handleError(_0x559f6a,null));};exports[_0x47de('0x40')]=function(_0x3c5652,_0x2a16ca){var _0x3be2e0={'raw':!![],'where':{'id':_0x3c5652['params']['id']}},_0x6f9f0={};_0x6f9f0[_0x47de('0x29')]=_[_0x47de('0x41')](db[_0x47de('0x3a')]['rawAttributes']);_0x6f9f0[_0x47de('0x2a')]=_[_0x47de('0x41')](_0x3c5652[_0x47de('0x2a')]);_0x6f9f0[_0x47de('0x33')]=_[_0x47de('0x2b')](_0x6f9f0[_0x47de('0x29')],_0x6f9f0[_0x47de('0x2a')]);_0x3be2e0[_0x47de('0x2c')]=_[_0x47de('0x2b')](_0x6f9f0['model'],qs['fields'](_0x3c5652[_0x47de('0x2a')]['fields']));_0x3be2e0[_0x47de('0x2c')]=_0x3be2e0['attributes']['length']?_0x3be2e0[_0x47de('0x2c')]:_0x6f9f0[_0x47de('0x29')];if(_0x3c5652['query'][_0x47de('0x3b')]){_0x3be2e0[_0x47de('0x3c')]=[{'all':!![]}];}_0x3be2e0=_[_0x47de('0x38')]({},_0x3be2e0,_0x3c5652[_0x47de('0x39')]);return db['SquareRecording'][_0x47de('0x42')](_0x3be2e0)[_0x47de('0x20')](handleEntityNotFound(_0x2a16ca,null))[_0x47de('0x20')](respondWithResult(_0x2a16ca,null))[_0x47de('0x3f')](handleError(_0x2a16ca,null));};exports[_0x47de('0x43')]=function(_0x135b38,_0x11116c){return db[_0x47de('0x3a')]['create'](_0x135b38[_0x47de('0x44')],{})[_0x47de('0x20')](respondWithResult(_0x11116c,0xc9))[_0x47de('0x3f')](handleError(_0x11116c,null));};exports[_0x47de('0x45')]=function(_0x3c6f20,_0x69d4a0){if(_0x3c6f20[_0x47de('0x44')]['id']){delete _0x3c6f20[_0x47de('0x44')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x3c6f20['params']['id']}})[_0x47de('0x20')](handleEntityNotFound(_0x69d4a0,null))[_0x47de('0x20')](saveUpdates(_0x3c6f20[_0x47de('0x44')],null))['then'](respondWithResult(_0x69d4a0,null))['catch'](handleError(_0x69d4a0,null));};exports[_0x47de('0x46')]=function(_0x480edc,_0x137381,_0x35d361){var _0x3d1183=require('../../components/encryptor');var _0xf74dab=![];var _0x55a6ca={};if(_0x480edc[_0x47de('0x2a')][_0x47de('0x28')]&&_0x480edc[_0x47de('0x2a')][_0x47de('0x28')]===_0x47de('0x47')){_0x55a6ca[_0x47de('0x47')]=_0x480edc[_0x47de('0x48')]['id'];}else{_0x55a6ca['id']=_0x480edc[_0x47de('0x48')]['id'];}return db[_0x47de('0x3a')][_0x47de('0x42')]({'where':_0x55a6ca,'attributes':['id',_0x47de('0x49'),_0x47de('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x137381,null))[_0x47de('0x20')](function(_0x277141){if(_0x277141){var _0x48278e=_0x277141[_0x47de('0x49')];var _0x1b7df1=util[_0x47de('0x4b')]('%s.cypher',_0x48278e);if(fs[_0x47de('0x4c')](_0x1b7df1)){_0xf74dab=!![];return _0x3d1183[_0x47de('0x4d')](_0x1b7df1,_0x48278e,config[_0x47de('0x4e')][_0x47de('0x4f')])['then'](function(){return _0x277141;});}return _0x277141;}})['then'](function(_0x5d3d7d){if(_0x5d3d7d){var _0x3c211e=_0x5d3d7d['savePath'];if(!fs[_0x47de('0x4c')](_0x3c211e)){throw new db['Sequelize']['ValidationError'](_0x47de('0x50'));}if(_0x5d3d7d[_0x47de('0x4a')]){return _0x137381['download'](_0x3c211e,_0x5d3d7d[_0x47de('0x4a')]+path[_0x47de('0x51')](_0x3c211e),function(){if(_0xf74dab){fs[_0x47de('0x52')](_0x3c211e);}});}else{return _0x137381[_0x47de('0x46')](_0x3c211e,function(_0x51cd2a){if(_0xf74dab){fs['unlink'](_0x3c211e);}});}}})[_0x47de('0x3f')](function(_0x280a60){if(_0x280a60[_0x47de('0x53')]==='SquareRecording\x20not\x20found'){_0x137381['status'](0x194)[_0x47de('0x24')](_0x47de('0x54'));}else{return handleError(_0x137381,null);}});};exports['destroy']=function(_0x57a4a3,_0x44ff50){return db[_0x47de('0x3a')][_0x47de('0x42')]({'where':{'id':_0x57a4a3[_0x47de('0x48')]['id']}})[_0x47de('0x20')](function(_0x1007b6){if(_[_0x47de('0x55')](_0x1007b6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1007b6;})[_0x47de('0x20')](function(_0x40e0ed){var _0x55b57f=_0x40e0ed[_0x47de('0x49')];logger[_0x47de('0x56')](_0x47de('0x57'),_0x55b57f);if(!_[_0x47de('0x55')](_0x40e0ed['savePath'])&&fs[_0x47de('0x4c')](_0x55b57f)){logger[_0x47de('0x56')](_0x47de('0x58')+_0x55b57f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x55b57f);}_0x55b57f=_0x55b57f+_0x47de('0x59');if(!_[_0x47de('0x55')](_0x40e0ed[_0x47de('0x49')])&&fs[_0x47de('0x4c')](_0x55b57f)){logger[_0x47de('0x56')](_0x47de('0x58')+_0x55b57f+_0x47de('0x5a'));fs[_0x47de('0x5b')](_0x55b57f);}return _0x40e0ed;})['then'](function(_0x18d153){if(!_0x18d153)throw new InternalError();return _0x18d153['destroy']();})['then'](function(){_0x44ff50[_0x47de('0x1c')](0xcc)[_0x47de('0x16')]();})['catch'](handleError(_0x44ff50,null));}; \ No newline at end of file +var _0x3e34=['zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','index','SquareRecording','rawAttributes','model','map','query','intersection','fields','attributes','nolimit','order','sort','where','pick','filters','merge','filter','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','download','type','uniqueid','format','%s.cypher','existsSync','decryptFile','recording','savePath','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','send','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format'];(function(_0x500dc8,_0x390247){var _0x2a3d59=function(_0x46b01f){while(--_0x46b01f){_0x500dc8['push'](_0x500dc8['shift']());}};_0x2a3d59(++_0x390247);}(_0x3e34,0x167));var _0x43e3=function(_0x388992,_0x9386b8){_0x388992=_0x388992-0x0;var _0x51b3dc=_0x3e34[_0x388992];return _0x51b3dc;};'use strict';var emlformat=require(_0x43e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e3('0x1'));var jsonpatch=require(_0x43e3('0x2'));var rp=require('request-promise');var moment=require(_0x43e3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x43e3('0x4'));var util=require('util');var path=require(_0x43e3('0x5'));var sox=require(_0x43e3('0x6'));var csv=require(_0x43e3('0x7'));var ejs=require(_0x43e3('0x8'));var fs=require('fs');var fs_extra=require(_0x43e3('0x9'));var _=require(_0x43e3('0xa'));var squel=require('squel');var crypto=require(_0x43e3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x43e3('0xc'));var toCsv=require(_0x43e3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x43e3('0xd'));var authService=require(_0x43e3('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x43e3('0xf'));var hardwareService=require(_0x43e3('0x10'));var logger=require(_0x43e3('0x11'))(_0x43e3('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x43e3('0x13'));var db=require(_0x43e3('0x14'))['db'];function respondWithStatusCode(_0x4d4506,_0x28d30f){_0x28d30f=_0x28d30f||0xcc;return function(_0x2b8594){if(_0x2b8594){return _0x4d4506[_0x43e3('0x15')](_0x28d30f);}return _0x4d4506[_0x43e3('0x16')](_0x28d30f)[_0x43e3('0x17')]();};}function respondWithResult(_0x30e786,_0x56857d){_0x56857d=_0x56857d||0xc8;return function(_0x13542d){if(_0x13542d){return _0x30e786['status'](_0x56857d)[_0x43e3('0x18')](_0x13542d);}};}function respondWithFilteredResult(_0x58f15e,_0x160fb0){return function(_0xc248f5){if(_0xc248f5){var _0x26cbe8=typeof _0x160fb0['offset']==='undefined'&&typeof _0x160fb0[_0x43e3('0x19')]===_0x43e3('0x1a');var _0x134aaa=_0xc248f5[_0x43e3('0x1b')];var _0x4769a3=_0x26cbe8?0x0:_0x160fb0[_0x43e3('0x1c')];var _0x549411=_0x26cbe8?_0xc248f5[_0x43e3('0x1b')]:_0x160fb0[_0x43e3('0x1c')]+_0x160fb0[_0x43e3('0x19')];var _0x328a68;if(_0x549411>=_0x134aaa){_0x549411=_0x134aaa;_0x328a68=0xc8;}else{_0x328a68=0xce;}_0x58f15e[_0x43e3('0x16')](_0x328a68);return _0x58f15e['set'](_0x43e3('0x1d'),_0x4769a3+'-'+_0x549411+'/'+_0x134aaa)[_0x43e3('0x18')](_0xc248f5);}return null;};}function patchUpdates(_0x3d28b6){return function(_0x2d7420){try{jsonpatch['apply'](_0x2d7420,_0x3d28b6,!![]);}catch(_0x132716){return BPromise[_0x43e3('0x1e')](_0x132716);}return _0x2d7420[_0x43e3('0x1f')]();};}function saveUpdates(_0x532a78,_0x2a8c5a){return function(_0x313205){if(_0x313205){return _0x313205[_0x43e3('0x20')](_0x532a78)[_0x43e3('0x21')](function(_0x54681a){return _0x54681a;});}return null;};}function removeEntity(_0x3babd5,_0x334f91){return function(_0x5f0b8f){if(_0x5f0b8f){return _0x5f0b8f[_0x43e3('0x22')]()[_0x43e3('0x21')](function(){_0x3babd5[_0x43e3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23cc51,_0x55781e){return function(_0x41fb76){if(!_0x41fb76){_0x23cc51[_0x43e3('0x15')](0x194);}return _0x41fb76;};}function handleError(_0x4e6210,_0x54d6de){_0x54d6de=_0x54d6de||0x1f4;return function(_0x2aee5c){logger[_0x43e3('0x23')](_0x2aee5c[_0x43e3('0x24')]);if(_0x2aee5c['name']){delete _0x2aee5c[_0x43e3('0x25')];}_0x4e6210[_0x43e3('0x16')](_0x54d6de)['send'](_0x2aee5c);};}exports[_0x43e3('0x26')]=function(_0x99fea3,_0x4d563f){var _0x5c8238={},_0x4f056a={},_0x35aece={'count':0x0,'rows':[]};var _0x4e6ca8=_['map'](db[_0x43e3('0x27')][_0x43e3('0x28')],function(_0x19e8af){return{'name':_0x19e8af['fieldName'],'type':_0x19e8af['type']['key']};});_0x4f056a[_0x43e3('0x29')]=_[_0x43e3('0x2a')](_0x4e6ca8,_0x43e3('0x25'));_0x4f056a['query']=_['keys'](_0x99fea3[_0x43e3('0x2b')]);_0x4f056a['filters']=_[_0x43e3('0x2c')](_0x4f056a[_0x43e3('0x29')],_0x4f056a[_0x43e3('0x2b')]);_0x5c8238['attributes']=_[_0x43e3('0x2c')](_0x4f056a['model'],qs[_0x43e3('0x2d')](_0x99fea3[_0x43e3('0x2b')][_0x43e3('0x2d')]));_0x5c8238[_0x43e3('0x2e')]=_0x5c8238[_0x43e3('0x2e')]['length']?_0x5c8238[_0x43e3('0x2e')]:_0x4f056a[_0x43e3('0x29')];if(!_0x99fea3[_0x43e3('0x2b')]['hasOwnProperty'](_0x43e3('0x2f'))){_0x5c8238[_0x43e3('0x19')]=qs[_0x43e3('0x19')](_0x99fea3[_0x43e3('0x2b')][_0x43e3('0x19')]);_0x5c8238[_0x43e3('0x1c')]=qs[_0x43e3('0x1c')](_0x99fea3[_0x43e3('0x2b')][_0x43e3('0x1c')]);}_0x5c8238[_0x43e3('0x30')]=qs['sort'](_0x99fea3[_0x43e3('0x2b')][_0x43e3('0x31')]);_0x5c8238[_0x43e3('0x32')]=qs['filters'](_[_0x43e3('0x33')](_0x99fea3['query'],_0x4f056a[_0x43e3('0x34')]),_0x4e6ca8);if(_0x99fea3['query']['filter']){_0x5c8238['where']=_[_0x43e3('0x35')](_0x5c8238[_0x43e3('0x32')],{'$or':_['map'](_0x4e6ca8,function(_0x1a9e9d){if(_0x1a9e9d['type']!=='VIRTUAL'){var _0x11f034={};_0x11f034[_0x1a9e9d[_0x43e3('0x25')]]={'$like':'%'+_0x99fea3[_0x43e3('0x2b')][_0x43e3('0x36')]+'%'};return _0x11f034;}})});}_0x5c8238=_[_0x43e3('0x35')]({},_0x5c8238,_0x99fea3[_0x43e3('0x37')]);var _0x39529e={'where':_0x5c8238[_0x43e3('0x32')]};return db[_0x43e3('0x27')][_0x43e3('0x1b')](_0x39529e)[_0x43e3('0x21')](function(_0x59a476){_0x35aece[_0x43e3('0x1b')]=_0x59a476;if(_0x99fea3['query'][_0x43e3('0x38')]){_0x5c8238['include']=[{'all':!![]}];}return db['SquareRecording'][_0x43e3('0x39')](_0x5c8238);})[_0x43e3('0x21')](function(_0x41df01){_0x35aece['rows']=_0x41df01;return _0x35aece;})['then'](respondWithFilteredResult(_0x4d563f,_0x5c8238))[_0x43e3('0x3a')](handleError(_0x4d563f,null));};exports[_0x43e3('0x3b')]=function(_0x59444e,_0x3c4a3f){var _0x3f22ea={'raw':!![],'where':{'id':_0x59444e[_0x43e3('0x3c')]['id']}},_0xe04c07={};_0xe04c07['model']=_[_0x43e3('0x3d')](db['SquareRecording']['rawAttributes']);_0xe04c07['query']=_[_0x43e3('0x3d')](_0x59444e[_0x43e3('0x2b')]);_0xe04c07[_0x43e3('0x34')]=_[_0x43e3('0x2c')](_0xe04c07[_0x43e3('0x29')],_0xe04c07[_0x43e3('0x2b')]);_0x3f22ea[_0x43e3('0x2e')]=_['intersection'](_0xe04c07[_0x43e3('0x29')],qs[_0x43e3('0x2d')](_0x59444e[_0x43e3('0x2b')]['fields']));_0x3f22ea[_0x43e3('0x2e')]=_0x3f22ea[_0x43e3('0x2e')]['length']?_0x3f22ea[_0x43e3('0x2e')]:_0xe04c07[_0x43e3('0x29')];if(_0x59444e['query'][_0x43e3('0x38')]){_0x3f22ea[_0x43e3('0x3e')]=[{'all':!![]}];}_0x3f22ea=_[_0x43e3('0x35')]({},_0x3f22ea,_0x59444e[_0x43e3('0x37')]);return db['SquareRecording'][_0x43e3('0x3f')](_0x3f22ea)['then'](handleEntityNotFound(_0x3c4a3f,null))[_0x43e3('0x21')](respondWithResult(_0x3c4a3f,null))[_0x43e3('0x3a')](handleError(_0x3c4a3f,null));};exports[_0x43e3('0x40')]=function(_0x1d2abf,_0x14020e){return db['SquareRecording'][_0x43e3('0x40')](_0x1d2abf[_0x43e3('0x41')],{})['then'](respondWithResult(_0x14020e,0xc9))[_0x43e3('0x3a')](handleError(_0x14020e,null));};exports['update']=function(_0x218549,_0x91cf68){if(_0x218549[_0x43e3('0x41')]['id']){delete _0x218549['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x218549['params']['id']}})[_0x43e3('0x21')](handleEntityNotFound(_0x91cf68,null))[_0x43e3('0x21')](saveUpdates(_0x218549[_0x43e3('0x41')],null))[_0x43e3('0x21')](respondWithResult(_0x91cf68,null))[_0x43e3('0x3a')](handleError(_0x91cf68,null));};exports[_0x43e3('0x42')]=function(_0x4f077e,_0x4aca6f,_0xfc31f6){var _0x23d0e4=require('../../components/encryptor');var _0x382a22=![];var _0x34861f={};if(_0x4f077e[_0x43e3('0x2b')][_0x43e3('0x43')]&&_0x4f077e['query'][_0x43e3('0x43')]==='uniqueid'){_0x34861f[_0x43e3('0x44')]=_0x4f077e[_0x43e3('0x3c')]['id'];}else{_0x34861f['id']=_0x4f077e[_0x43e3('0x3c')]['id'];}return db[_0x43e3('0x27')][_0x43e3('0x3f')]({'where':_0x34861f,'attributes':['id','savePath','filename'],'raw':!![]})[_0x43e3('0x21')](handleEntityNotFound(_0x4aca6f,null))[_0x43e3('0x21')](function(_0x487979){if(_0x487979){var _0x3d49a3=_0x487979['savePath'];var _0x1c8355=util[_0x43e3('0x45')](_0x43e3('0x46'),_0x3d49a3);if(fs[_0x43e3('0x47')](_0x1c8355)){_0x382a22=!![];return _0x23d0e4[_0x43e3('0x48')](_0x1c8355,_0x3d49a3,config['secrets'][_0x43e3('0x49')])[_0x43e3('0x21')](function(){return _0x487979;});}return _0x487979;}})['then'](function(_0x52b705){if(_0x52b705){var _0x105969=_0x52b705[_0x43e3('0x4a')];if(!fs['existsSync'](_0x105969)){throw new db['Sequelize'][(_0x43e3('0x4b'))](_0x43e3('0x4c'));}if(_0x52b705[_0x43e3('0x4d')]){return _0x4aca6f[_0x43e3('0x42')](_0x105969,_0x52b705[_0x43e3('0x4d')]+path[_0x43e3('0x4e')](_0x105969),function(){if(_0x382a22){fs[_0x43e3('0x4f')](_0x105969);}});}else{return _0x4aca6f[_0x43e3('0x42')](_0x105969,function(_0x59e6a8){if(_0x382a22){fs[_0x43e3('0x4f')](_0x105969);}});}}})[_0x43e3('0x3a')](function(_0xe6b7fe){if(_0xe6b7fe[_0x43e3('0x50')]===_0x43e3('0x4c')){_0x4aca6f['status'](0x194)[_0x43e3('0x51')]('Not\x20found');}else{return handleError(_0x4aca6f,null);}});};exports[_0x43e3('0x22')]=function(_0x24cc10,_0x313dce){return db['SquareRecording']['find']({'where':{'id':_0x24cc10[_0x43e3('0x3c')]['id']}})[_0x43e3('0x21')](function(_0x325fbf){if(_[_0x43e3('0x52')](_0x325fbf)){throw new ReferenceError(_0x43e3('0x53'));}return _0x325fbf;})[_0x43e3('0x21')](function(_0x220420){var _0xa437f0=_0x220420[_0x43e3('0x4a')];logger[_0x43e3('0x54')](_0x43e3('0x55'),_0xa437f0);if(!_[_0x43e3('0x52')](_0x220420[_0x43e3('0x4a')])&&fs[_0x43e3('0x47')](_0xa437f0)){logger[_0x43e3('0x54')](_0x43e3('0x56')+_0xa437f0+_0x43e3('0x57'));fs[_0x43e3('0x58')](_0xa437f0);}_0xa437f0=_0xa437f0+_0x43e3('0x59');if(!_[_0x43e3('0x52')](_0x220420['savePath'])&&fs[_0x43e3('0x47')](_0xa437f0)){logger[_0x43e3('0x54')](_0x43e3('0x56')+_0xa437f0+_0x43e3('0x57'));fs[_0x43e3('0x58')](_0xa437f0);}return _0x220420;})['then'](function(_0x5134c2){if(!_0x5134c2)throw new InternalError();return _0x5134c2[_0x43e3('0x22')]();})[_0x43e3('0x21')](function(){_0x313dce['status'](0xcc)[_0x43e3('0x17')]();})[_0x43e3('0x3a')](handleError(_0x313dce,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 050f5e0..85a6790 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 _0x323f=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings'];(function(_0x31ad07,_0x401156){var _0x57babf=function(_0x313446){while(--_0x313446){_0x31ad07['push'](_0x31ad07['shift']());}};_0x57babf(++_0x401156);}(_0x323f,0x1ee));var _0xf323=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x323f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));module[_0xf323('0x9')]=function(_0x371707,_0x5d7d60){return _0x371707[_0xf323('0xa')](_0xf323('0xb'),attributes,{'tableName':_0xf323('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ec2=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','square_recordings'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6ec2,0x78));var _0x26ec=function(_0xbbc9f1,_0x2d71b6){_0xbbc9f1=_0xbbc9f1-0x0;var _0x2b96f9=_0x6ec2[_0xbbc9f1];return _0x2b96f9;};'use strict';var _=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var logger=require(_0x26ec('0x2'))(_0x26ec('0x3'));var moment=require(_0x26ec('0x4'));var BPromise=require(_0x26ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26ec('0x6'));var rimraf=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var attributes=require(_0x26ec('0x9'));module[_0x26ec('0xa')]=function(_0x4ce209,_0x3b5955){return _0x4ce209['define']('SquareRecording',attributes,{'tableName':_0x26ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 14cf2f1..7de9c47 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 _0xd656=['jayson/promise','client','http','request','then','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','info','request\x20sent','result','SquareRecording','create','body','options','raw','CreateSquareRecording','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd656,0x172));var _0x6d65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd656[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d65('0x0'));var util=require(_0x6d65('0x1'));var moment=require(_0x6d65('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d65('0x3'));var fs=require('fs');var Redis=require(_0x6d65('0x4'));var db=require(_0x6d65('0x5'))['db'];var utils=require(_0x6d65('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6d65('0x7'));var client=jayson[_0x6d65('0x8')][_0x6d65('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x65cf99,_0x4fe182,_0x2014a0){return new BPromise(function(_0x1c457a,_0x1f4603){return client[_0x6d65('0xa')](_0x65cf99,_0x2014a0)[_0x6d65('0xb')](function(_0x1e2bfd){logger['info']('SquareRecording,\x20%s,\x20%s',_0x4fe182,'request\x20sent');logger[_0x6d65('0xc')](_0x6d65('0xd'),_0x4fe182,'request\x20sent',JSON[_0x6d65('0xe')](_0x1e2bfd));if(_0x1e2bfd[_0x6d65('0xf')]){if(_0x1e2bfd[_0x6d65('0xf')][_0x6d65('0x10')]===0x1f4){logger[_0x6d65('0xf')](_0x6d65('0x11'),_0x4fe182,_0x1e2bfd[_0x6d65('0xf')][_0x6d65('0x12')]);return _0x1f4603(_0x1e2bfd[_0x6d65('0xf')][_0x6d65('0x12')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x4fe182,_0x1e2bfd[_0x6d65('0xf')]['message']);return _0x1c457a(_0x1e2bfd[_0x6d65('0xf')]['message']);}else{logger[_0x6d65('0x13')]('SquareRecording,\x20%s,\x20%s',_0x4fe182,_0x6d65('0x14'));_0x1c457a(_0x1e2bfd[_0x6d65('0x15')][_0x6d65('0x12')]);}})['catch'](function(_0x52c49b){logger[_0x6d65('0xf')](_0x6d65('0x11'),_0x4fe182,_0x52c49b);_0x1f4603(_0x52c49b);});});}exports['CreateSquareRecording']=function(_0x2197ca){var _0x2457d7=this;return new Promise(function(_0xaf946b,_0x412da5){return db[_0x6d65('0x16')][_0x6d65('0x17')](_0x2197ca[_0x6d65('0x18')],{'raw':_0x2197ca[_0x6d65('0x19')]?_0x2197ca[_0x6d65('0x19')][_0x6d65('0x1a')]===undefined?!![]:![]:!![]})[_0x6d65('0xb')](function(_0x99028){logger[_0x6d65('0x13')](_0x6d65('0x1b'),_0x2197ca);logger[_0x6d65('0xc')](_0x6d65('0x1b'),_0x2197ca,JSON['stringify'](_0x99028));_0xaf946b(_0x99028);})[_0x6d65('0x1c')](function(_0x3711fd){logger[_0x6d65('0xf')](_0x6d65('0x1b'),_0x3711fd[_0x6d65('0x12')],_0x2197ca);_0x412da5(_0x2457d7[_0x6d65('0xf')](0x1f4,_0x3711fd[_0x6d65('0x12')]));});});}; \ No newline at end of file +var _0x3a48=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','info','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s'];(function(_0x51350d,_0x28b629){var _0x588af6=function(_0x4d8bbc){while(--_0x4d8bbc){_0x51350d['push'](_0x51350d['shift']());}};_0x588af6(++_0x28b629);}(_0x3a48,0x138));var _0x83a4=function(_0x8f752,_0x4b91f3){_0x8f752=_0x8f752-0x0;var _0x14b17b=_0x3a48[_0x8f752];return _0x14b17b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83a4('0x0'));var BPromise=require('bluebird');var rs=require(_0x83a4('0x1'));var fs=require('fs');var Redis=require(_0x83a4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x83a4('0x3'));var logger=require('../../config/logger')(_0x83a4('0x4'));var config=require(_0x83a4('0x5'));var jayson=require(_0x83a4('0x6'));var client=jayson[_0x83a4('0x7')][_0x83a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x105b8b,_0x435d92,_0x7fa3cd){return new BPromise(function(_0x49c061,_0x303b34){return client[_0x83a4('0x9')](_0x105b8b,_0x7fa3cd)[_0x83a4('0xa')](function(_0x94acb7){logger['info'](_0x83a4('0xb'),_0x435d92,'request\x20sent');logger[_0x83a4('0xc')](_0x83a4('0xd'),_0x435d92,_0x83a4('0xe'),JSON[_0x83a4('0xf')](_0x94acb7));if(_0x94acb7[_0x83a4('0x10')]){if(_0x94acb7[_0x83a4('0x10')][_0x83a4('0x11')]===0x1f4){logger[_0x83a4('0x10')]('SquareRecording,\x20%s,\x20%s',_0x435d92,_0x94acb7[_0x83a4('0x10')][_0x83a4('0x12')]);return _0x303b34(_0x94acb7[_0x83a4('0x10')]['message']);}logger[_0x83a4('0x10')](_0x83a4('0xb'),_0x435d92,_0x94acb7[_0x83a4('0x10')][_0x83a4('0x12')]);return _0x49c061(_0x94acb7['error'][_0x83a4('0x12')]);}else{logger['info'](_0x83a4('0xb'),_0x435d92,_0x83a4('0xe'));_0x49c061(_0x94acb7[_0x83a4('0x13')][_0x83a4('0x12')]);}})[_0x83a4('0x14')](function(_0x2905e6){logger[_0x83a4('0x10')](_0x83a4('0xb'),_0x435d92,_0x2905e6);_0x303b34(_0x2905e6);});});}exports[_0x83a4('0x15')]=function(_0x2ba3b7){var _0x3f0712=this;return new Promise(function(_0x4f0b0b,_0x4035fe){return db[_0x83a4('0x16')][_0x83a4('0x17')](_0x2ba3b7['body'],{'raw':_0x2ba3b7[_0x83a4('0x18')]?_0x2ba3b7[_0x83a4('0x18')][_0x83a4('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xe47758){logger[_0x83a4('0x1a')](_0x83a4('0x15'),_0x2ba3b7);logger[_0x83a4('0xc')]('CreateSquareRecording',_0x2ba3b7,JSON[_0x83a4('0xf')](_0xe47758));_0x4f0b0b(_0xe47758);})['catch'](function(_0x54f9dc){logger[_0x83a4('0x10')](_0x83a4('0x15'),_0x54f9dc[_0x83a4('0x12')],_0x2ba3b7);_0x4035fe(_0x3f0712[_0x83a4('0x10')](0x1f4,_0x54f9dc[_0x83a4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d1544f5..1d86205 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x10e76b,_0x325f50){var _0x5a0554=function(_0x5ba488){while(--_0x5ba488){_0x10e76b['push'](_0x10e76b['shift']());}};_0x5a0554(++_0x325f50);}(_0xe706,0xa3));var _0x6e70=function(_0x3f3026,_0x35d62a){_0x3f3026=_0x3f3026-0x0;var _0x4e87bf=_0xe706[_0x3f3026];return _0x4e87bf;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 4c022a1..b284b06 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 _0x6cd7=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x524466,_0x562434){var _0x34b878=function(_0x1820da){while(--_0x1820da){_0x524466['push'](_0x524466['shift']());}};_0x34b878(++_0x562434);}(_0x6cd7,0x79));var _0x76cd=function(_0x2498b5,_0x514ddb){_0x2498b5=_0x2498b5-0x0;var _0x5c48d8=_0x6cd7[_0x2498b5];return _0x5c48d8;};'use strict';var Sequelize=require(_0x76cd('0x0'));module[_0x76cd('0x1')]={'network':{'type':Sequelize[_0x76cd('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x76cd('0x2')]},'channel':{'type':Sequelize[_0x76cd('0x2')]},'language':{'type':Sequelize[_0x76cd('0x2')]},'type':{'type':Sequelize[_0x76cd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x76cd('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76cd('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x76cd('0x2')]},'callington':{'type':Sequelize[_0x76cd('0x2')]},'callingtns':{'type':Sequelize[_0x76cd('0x2')]},'dnid':{'type':Sequelize[_0x76cd('0x2')]},'rdnis':{'type':Sequelize[_0x76cd('0x2')]},'context':{'type':Sequelize[_0x76cd('0x2')]},'extension':{'type':Sequelize[_0x76cd('0x2')]},'priority':{'type':Sequelize[_0x76cd('0x2')]},'enhanced':{'type':Sequelize[_0x76cd('0x2')]},'accountcode':{'type':Sequelize[_0x76cd('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x76cd('0x2')]},'joinAt':{'type':Sequelize[_0x76cd('0x3')]},'leaveAt':{'type':Sequelize[_0x76cd('0x3')]},'bot':{'type':Sequelize[_0x76cd('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x0891=['STRING','DATE','BOOLEAN','exports'];(function(_0x518d8a,_0x3f386f){var _0x28aace=function(_0x1c085b){while(--_0x1c085b){_0x518d8a['push'](_0x518d8a['shift']());}};_0x28aace(++_0x3f386f);}(_0x0891,0x1db));var _0x1089=function(_0xd90d40,_0x2d275f){_0xd90d40=_0xd90d40-0x0;var _0x68ed58=_0x0891[_0xd90d40];return _0x68ed58;};'use strict';var Sequelize=require('sequelize');module[_0x1089('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x1089('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1089('0x1')]},'language':{'type':Sequelize[_0x1089('0x1')]},'type':{'type':Sequelize[_0x1089('0x1')]},'uniqueid':{'type':Sequelize[_0x1089('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1089('0x1')]},'calleridname':{'type':Sequelize[_0x1089('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x1089('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x1089('0x1')]},'context':{'type':Sequelize[_0x1089('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1089('0x1')]},'enhanced':{'type':Sequelize[_0x1089('0x1')]},'accountcode':{'type':Sequelize[_0x1089('0x1')]},'threadid':{'type':Sequelize[_0x1089('0x1')]},'project_name':{'type':Sequelize[_0x1089('0x1')]},'joinAt':{'type':Sequelize[_0x1089('0x2')]},'leaveAt':{'type':Sequelize[_0x1089('0x2')]},'bot':{'type':Sequelize[_0x1089('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 2668461..0e3887b 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 _0x10df=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','send','map','SquareReport','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','keys','includeAll','find','create','update','body','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x14c387,_0x1a4fed){var _0x2a62ee=function(_0x1d470c){while(--_0x1d470c){_0x14c387['push'](_0x14c387['shift']());}};_0x2a62ee(++_0x1a4fed);}(_0x10df,0x126));var _0xf10d=function(_0x250d2a,_0x2983be){_0x250d2a=_0x250d2a-0x0;var _0x5738fa=_0x10df[_0x250d2a];return _0x5738fa;};'use strict';var emlformat=require(_0xf10d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf10d('0x1'));var jsonpatch=require(_0xf10d('0x2'));var rp=require('request-promise');var moment=require(_0xf10d('0x3'));var BPromise=require(_0xf10d('0x4'));var Mustache=require('mustache');var util=require(_0xf10d('0x5'));var path=require(_0xf10d('0x6'));var sox=require(_0xf10d('0x7'));var csv=require(_0xf10d('0x8'));var ejs=require(_0xf10d('0x9'));var fs=require('fs');var fs_extra=require(_0xf10d('0xa'));var _=require(_0xf10d('0xb'));var squel=require('squel');var crypto=require(_0xf10d('0xc'));var jsforce=require(_0xf10d('0xd'));var deskjs=require(_0xf10d('0xe'));var toCsv=require(_0xf10d('0x8'));var querystring=require(_0xf10d('0xf'));var Papa=require(_0xf10d('0x10'));var Redis=require(_0xf10d('0x11'));var authService=require(_0xf10d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf10d('0x13'));var logger=require(_0xf10d('0x14'))('api');var utils=require(_0xf10d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf10d('0x16'));var db=require(_0xf10d('0x17'))['db'];function respondWithStatusCode(_0x51083f,_0x1382ed){_0x1382ed=_0x1382ed||0xcc;return function(_0x891d7c){if(_0x891d7c){return _0x51083f[_0xf10d('0x18')](_0x1382ed);}return _0x51083f[_0xf10d('0x19')](_0x1382ed)[_0xf10d('0x1a')]();};}function respondWithResult(_0x5cd398,_0x1911f8){_0x1911f8=_0x1911f8||0xc8;return function(_0x5d53b7){if(_0x5d53b7){return _0x5cd398[_0xf10d('0x19')](_0x1911f8)[_0xf10d('0x1b')](_0x5d53b7);}};}function respondWithFilteredResult(_0x27a4a2,_0x30d148){return function(_0x1e255d){if(_0x1e255d){var _0x4c31b6=typeof _0x30d148[_0xf10d('0x1c')]==='undefined'&&typeof _0x30d148[_0xf10d('0x1d')]===_0xf10d('0x1e');var _0x23efec=_0x1e255d[_0xf10d('0x1f')];var _0x217a67=_0x4c31b6?0x0:_0x30d148[_0xf10d('0x1c')];var _0x3a4052=_0x4c31b6?_0x1e255d[_0xf10d('0x1f')]:_0x30d148[_0xf10d('0x1c')]+_0x30d148[_0xf10d('0x1d')];var _0x271bb6;if(_0x3a4052>=_0x23efec){_0x3a4052=_0x23efec;_0x271bb6=0xc8;}else{_0x271bb6=0xce;}_0x27a4a2[_0xf10d('0x19')](_0x271bb6);return _0x27a4a2[_0xf10d('0x20')](_0xf10d('0x21'),_0x217a67+'-'+_0x3a4052+'/'+_0x23efec)[_0xf10d('0x1b')](_0x1e255d);}return null;};}function patchUpdates(_0x4cc422){return function(_0xdcb1ae){try{jsonpatch[_0xf10d('0x22')](_0xdcb1ae,_0x4cc422,!![]);}catch(_0x1bd2fe){return BPromise['reject'](_0x1bd2fe);}return _0xdcb1ae[_0xf10d('0x23')]();};}function saveUpdates(_0x3bfcf8,_0x58a8cc){return function(_0x4f84d0){if(_0x4f84d0){return _0x4f84d0['update'](_0x3bfcf8)[_0xf10d('0x24')](function(_0xf68cfd){return _0xf68cfd;});}return null;};}function removeEntity(_0x4a0973,_0x33b919){return function(_0x43be66){if(_0x43be66){return _0x43be66[_0xf10d('0x25')]()[_0xf10d('0x24')](function(){_0x4a0973[_0xf10d('0x19')](0xcc)[_0xf10d('0x1a')]();});}};}function handleEntityNotFound(_0x2f7c54,_0x27e658){return function(_0x38b33f){if(!_0x38b33f){_0x2f7c54['sendStatus'](0x194);}return _0x38b33f;};}function handleError(_0x3111b9,_0x559c64){_0x559c64=_0x559c64||0x1f4;return function(_0x48fbf1){logger[_0xf10d('0x26')](_0x48fbf1[_0xf10d('0x27')]);if(_0x48fbf1['name']){delete _0x48fbf1['name'];}_0x3111b9['status'](_0x559c64)[_0xf10d('0x28')](_0x48fbf1);};}exports['index']=function(_0x4e4c50,_0x50ca42){var _0x57d8d7={},_0x2efcc0={},_0x46d3d8={'count':0x0,'rows':[]};var _0x40ed0b=_[_0xf10d('0x29')](db[_0xf10d('0x2a')]['rawAttributes'],function(_0x4062d4){return{'name':_0x4062d4[_0xf10d('0x2b')],'type':_0x4062d4[_0xf10d('0x2c')][_0xf10d('0x2d')]};});_0x2efcc0[_0xf10d('0x2e')]=_[_0xf10d('0x29')](_0x40ed0b,_0xf10d('0x2f'));_0x2efcc0[_0xf10d('0x30')]=_['keys'](_0x4e4c50[_0xf10d('0x30')]);_0x2efcc0[_0xf10d('0x31')]=_[_0xf10d('0x32')](_0x2efcc0[_0xf10d('0x2e')],_0x2efcc0[_0xf10d('0x30')]);_0x57d8d7['attributes']=_[_0xf10d('0x32')](_0x2efcc0[_0xf10d('0x2e')],qs[_0xf10d('0x33')](_0x4e4c50['query']['fields']));_0x57d8d7[_0xf10d('0x34')]=_0x57d8d7['attributes'][_0xf10d('0x35')]?_0x57d8d7[_0xf10d('0x34')]:_0x2efcc0[_0xf10d('0x2e')];if(!_0x4e4c50[_0xf10d('0x30')][_0xf10d('0x36')](_0xf10d('0x37'))){_0x57d8d7['limit']=qs[_0xf10d('0x1d')](_0x4e4c50[_0xf10d('0x30')]['limit']);_0x57d8d7[_0xf10d('0x1c')]=qs[_0xf10d('0x1c')](_0x4e4c50['query'][_0xf10d('0x1c')]);}_0x57d8d7[_0xf10d('0x38')]=qs[_0xf10d('0x39')](_0x4e4c50[_0xf10d('0x30')]['sort']);_0x57d8d7[_0xf10d('0x3a')]=qs[_0xf10d('0x31')](_[_0xf10d('0x3b')](_0x4e4c50['query'],_0x2efcc0[_0xf10d('0x31')]),_0x40ed0b);if(_0x4e4c50[_0xf10d('0x30')][_0xf10d('0x3c')]){_0x57d8d7[_0xf10d('0x3a')]=_[_0xf10d('0x3d')](_0x57d8d7[_0xf10d('0x3a')],{'$or':_['map'](_0x40ed0b,function(_0x5a8a10){if(_0x5a8a10[_0xf10d('0x2c')]!=='VIRTUAL'){var _0x4440a3={};_0x4440a3[_0x5a8a10[_0xf10d('0x2f')]]={'$like':'%'+_0x4e4c50[_0xf10d('0x30')][_0xf10d('0x3c')]+'%'};return _0x4440a3;}})});}_0x57d8d7=_['merge']({},_0x57d8d7,_0x4e4c50[_0xf10d('0x3e')]);var _0x19702b={'where':_0x57d8d7[_0xf10d('0x3a')]};return db[_0xf10d('0x2a')][_0xf10d('0x1f')](_0x19702b)[_0xf10d('0x24')](function(_0x2aab6f){_0x46d3d8['count']=_0x2aab6f;if(_0x4e4c50['query']['includeAll']){_0x57d8d7[_0xf10d('0x3f')]=[{'all':!![]}];}return db['SquareReport'][_0xf10d('0x40')](_0x57d8d7);})[_0xf10d('0x24')](function(_0x518e4a){_0x46d3d8[_0xf10d('0x41')]=_0x518e4a;return _0x46d3d8;})[_0xf10d('0x24')](respondWithFilteredResult(_0x50ca42,_0x57d8d7))[_0xf10d('0x42')](handleError(_0x50ca42,null));};exports[_0xf10d('0x43')]=function(_0x5e83de,_0x361fd3){var _0x17c033={'raw':!![],'where':{'id':_0x5e83de['params']['id']}},_0x2736d3={};_0x2736d3[_0xf10d('0x2e')]=_['keys'](db[_0xf10d('0x2a')][_0xf10d('0x44')]);_0x2736d3[_0xf10d('0x30')]=_[_0xf10d('0x45')](_0x5e83de[_0xf10d('0x30')]);_0x2736d3['filters']=_[_0xf10d('0x32')](_0x2736d3[_0xf10d('0x2e')],_0x2736d3[_0xf10d('0x30')]);_0x17c033[_0xf10d('0x34')]=_[_0xf10d('0x32')](_0x2736d3[_0xf10d('0x2e')],qs[_0xf10d('0x33')](_0x5e83de[_0xf10d('0x30')][_0xf10d('0x33')]));_0x17c033[_0xf10d('0x34')]=_0x17c033[_0xf10d('0x34')]['length']?_0x17c033[_0xf10d('0x34')]:_0x2736d3['model'];if(_0x5e83de['query'][_0xf10d('0x46')]){_0x17c033['include']=[{'all':!![]}];}_0x17c033=_[_0xf10d('0x3d')]({},_0x17c033,_0x5e83de[_0xf10d('0x3e')]);return db[_0xf10d('0x2a')][_0xf10d('0x47')](_0x17c033)[_0xf10d('0x24')](handleEntityNotFound(_0x361fd3,null))[_0xf10d('0x24')](respondWithResult(_0x361fd3,null))[_0xf10d('0x42')](handleError(_0x361fd3,null));};exports['create']=function(_0x37ab41,_0x3a6b11){return db['SquareReport'][_0xf10d('0x48')](_0x37ab41['body'],{})['then'](respondWithResult(_0x3a6b11,0xc9))['catch'](handleError(_0x3a6b11,null));};exports[_0xf10d('0x49')]=function(_0x3e1674,_0x7bc088){if(_0x3e1674[_0xf10d('0x4a')]['id']){delete _0x3e1674[_0xf10d('0x4a')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x3e1674[_0xf10d('0x4b')]['id']}})[_0xf10d('0x24')](handleEntityNotFound(_0x7bc088,null))[_0xf10d('0x24')](saveUpdates(_0x3e1674['body'],null))['then'](respondWithResult(_0x7bc088,null))['catch'](handleError(_0x7bc088,null));};exports['destroy']=function(_0x178c57,_0xb54d72){return db[_0xf10d('0x2a')]['find']({'where':{'id':_0x178c57[_0xf10d('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb54d72,null))[_0xf10d('0x24')](removeEntity(_0xb54d72,null))[_0xf10d('0x42')](handleError(_0xb54d72,null));};exports['describe']=function(_0x4cf203,_0x3220d5){return db['SquareReport'][_0xf10d('0x4c')]()['then'](respondWithResult(_0x3220d5,null))[_0xf10d('0x42')](handleError(_0x3220d5,null));}; \ No newline at end of file +var _0x0ad4=['filters','pick','where','VIRTUAL','merge','count','includeAll','include','SquareReport','findAll','rows','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x0ad4,0x1bb));var _0x40ad=function(_0x3b47e9,_0x776909){_0x3b47e9=_0x3b47e9-0x0;var _0x4d2bb1=_0x0ad4[_0x3b47e9];return _0x4d2bb1;};'use strict';var emlformat=require(_0x40ad('0x0'));var rimraf=require(_0x40ad('0x1'));var zipdir=require(_0x40ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x40ad('0x4'));var util=require(_0x40ad('0x5'));var path=require(_0x40ad('0x6'));var sox=require(_0x40ad('0x7'));var csv=require(_0x40ad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40ad('0x9'));var _=require('lodash');var squel=require(_0x40ad('0xa'));var crypto=require('crypto');var jsforce=require(_0x40ad('0xb'));var deskjs=require(_0x40ad('0xc'));var toCsv=require(_0x40ad('0x8'));var querystring=require(_0x40ad('0xd'));var Papa=require(_0x40ad('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x40ad('0xf'));var as=require(_0x40ad('0x10'));var hardwareService=require(_0x40ad('0x11'));var logger=require(_0x40ad('0x12'))(_0x40ad('0x13'));var utils=require(_0x40ad('0x14'));var config=require(_0x40ad('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x40ad('0x16'))['db'];function respondWithStatusCode(_0x1bb6ae,_0xe10d54){_0xe10d54=_0xe10d54||0xcc;return function(_0xb252a1){if(_0xb252a1){return _0x1bb6ae['sendStatus'](_0xe10d54);}return _0x1bb6ae['status'](_0xe10d54)[_0x40ad('0x17')]();};}function respondWithResult(_0x2ebbe5,_0x341257){_0x341257=_0x341257||0xc8;return function(_0x215f1b){if(_0x215f1b){return _0x2ebbe5[_0x40ad('0x18')](_0x341257)[_0x40ad('0x19')](_0x215f1b);}};}function respondWithFilteredResult(_0x16e841,_0x38c706){return function(_0x20acb3){if(_0x20acb3){var _0x300da6=typeof _0x38c706[_0x40ad('0x1a')]===_0x40ad('0x1b')&&typeof _0x38c706['limit']===_0x40ad('0x1b');var _0x3059f3=_0x20acb3['count'];var _0x116e29=_0x300da6?0x0:_0x38c706[_0x40ad('0x1a')];var _0x5cf315=_0x300da6?_0x20acb3['count']:_0x38c706[_0x40ad('0x1a')]+_0x38c706[_0x40ad('0x1c')];var _0xa52c96;if(_0x5cf315>=_0x3059f3){_0x5cf315=_0x3059f3;_0xa52c96=0xc8;}else{_0xa52c96=0xce;}_0x16e841[_0x40ad('0x18')](_0xa52c96);return _0x16e841[_0x40ad('0x1d')](_0x40ad('0x1e'),_0x116e29+'-'+_0x5cf315+'/'+_0x3059f3)[_0x40ad('0x19')](_0x20acb3);}return null;};}function patchUpdates(_0x396654){return function(_0x559d00){try{jsonpatch[_0x40ad('0x1f')](_0x559d00,_0x396654,!![]);}catch(_0x34430d){return BPromise[_0x40ad('0x20')](_0x34430d);}return _0x559d00[_0x40ad('0x21')]();};}function saveUpdates(_0x423b24,_0x6d281c){return function(_0x185d20){if(_0x185d20){return _0x185d20[_0x40ad('0x22')](_0x423b24)[_0x40ad('0x23')](function(_0x4ab8c2){return _0x4ab8c2;});}return null;};}function removeEntity(_0x5858fe,_0x1d2bb4){return function(_0x2ce14c){if(_0x2ce14c){return _0x2ce14c[_0x40ad('0x24')]()[_0x40ad('0x23')](function(){_0x5858fe[_0x40ad('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5794a5,_0x530375){return function(_0x50c4d3){if(!_0x50c4d3){_0x5794a5['sendStatus'](0x194);}return _0x50c4d3;};}function handleError(_0x8a6089,_0x17b43e){_0x17b43e=_0x17b43e||0x1f4;return function(_0x509bf7){logger[_0x40ad('0x25')](_0x509bf7[_0x40ad('0x26')]);if(_0x509bf7[_0x40ad('0x27')]){delete _0x509bf7['name'];}_0x8a6089[_0x40ad('0x18')](_0x17b43e)[_0x40ad('0x28')](_0x509bf7);};}exports[_0x40ad('0x29')]=function(_0x3fd82e,_0x433e6d){var _0x52f77e={},_0x5ef6b9={},_0x525b71={'count':0x0,'rows':[]};var _0x43d23c=_[_0x40ad('0x2a')](db['SquareReport'][_0x40ad('0x2b')],function(_0x3ecacd){return{'name':_0x3ecacd['fieldName'],'type':_0x3ecacd['type']['key']};});_0x5ef6b9[_0x40ad('0x2c')]=_[_0x40ad('0x2a')](_0x43d23c,_0x40ad('0x27'));_0x5ef6b9[_0x40ad('0x2d')]=_[_0x40ad('0x2e')](_0x3fd82e[_0x40ad('0x2d')]);_0x5ef6b9['filters']=_[_0x40ad('0x2f')](_0x5ef6b9['model'],_0x5ef6b9['query']);_0x52f77e['attributes']=_['intersection'](_0x5ef6b9[_0x40ad('0x2c')],qs[_0x40ad('0x30')](_0x3fd82e[_0x40ad('0x2d')][_0x40ad('0x30')]));_0x52f77e[_0x40ad('0x31')]=_0x52f77e[_0x40ad('0x31')][_0x40ad('0x32')]?_0x52f77e['attributes']:_0x5ef6b9[_0x40ad('0x2c')];if(!_0x3fd82e['query']['hasOwnProperty'](_0x40ad('0x33'))){_0x52f77e['limit']=qs[_0x40ad('0x1c')](_0x3fd82e['query'][_0x40ad('0x1c')]);_0x52f77e[_0x40ad('0x1a')]=qs[_0x40ad('0x1a')](_0x3fd82e[_0x40ad('0x2d')][_0x40ad('0x1a')]);}_0x52f77e[_0x40ad('0x34')]=qs['sort'](_0x3fd82e[_0x40ad('0x2d')][_0x40ad('0x35')]);_0x52f77e['where']=qs[_0x40ad('0x36')](_[_0x40ad('0x37')](_0x3fd82e['query'],_0x5ef6b9[_0x40ad('0x36')]),_0x43d23c);if(_0x3fd82e[_0x40ad('0x2d')]['filter']){_0x52f77e[_0x40ad('0x38')]=_['merge'](_0x52f77e[_0x40ad('0x38')],{'$or':_[_0x40ad('0x2a')](_0x43d23c,function(_0x1d7f9a){if(_0x1d7f9a['type']!==_0x40ad('0x39')){var _0x222956={};_0x222956[_0x1d7f9a['name']]={'$like':'%'+_0x3fd82e[_0x40ad('0x2d')]['filter']+'%'};return _0x222956;}})});}_0x52f77e=_[_0x40ad('0x3a')]({},_0x52f77e,_0x3fd82e['options']);var _0x56ac79={'where':_0x52f77e['where']};return db['SquareReport'][_0x40ad('0x3b')](_0x56ac79)[_0x40ad('0x23')](function(_0x370c3d){_0x525b71[_0x40ad('0x3b')]=_0x370c3d;if(_0x3fd82e[_0x40ad('0x2d')][_0x40ad('0x3c')]){_0x52f77e[_0x40ad('0x3d')]=[{'all':!![]}];}return db[_0x40ad('0x3e')][_0x40ad('0x3f')](_0x52f77e);})[_0x40ad('0x23')](function(_0x26fe60){_0x525b71[_0x40ad('0x40')]=_0x26fe60;return _0x525b71;})[_0x40ad('0x23')](respondWithFilteredResult(_0x433e6d,_0x52f77e))['catch'](handleError(_0x433e6d,null));};exports['show']=function(_0xc53670,_0x5d29c9){var _0x1c7953={'raw':!![],'where':{'id':_0xc53670['params']['id']}},_0x1e73e7={};_0x1e73e7[_0x40ad('0x2c')]=_[_0x40ad('0x2e')](db['SquareReport'][_0x40ad('0x2b')]);_0x1e73e7['query']=_['keys'](_0xc53670[_0x40ad('0x2d')]);_0x1e73e7['filters']=_[_0x40ad('0x2f')](_0x1e73e7[_0x40ad('0x2c')],_0x1e73e7[_0x40ad('0x2d')]);_0x1c7953['attributes']=_[_0x40ad('0x2f')](_0x1e73e7[_0x40ad('0x2c')],qs[_0x40ad('0x30')](_0xc53670['query'][_0x40ad('0x30')]));_0x1c7953[_0x40ad('0x31')]=_0x1c7953[_0x40ad('0x31')][_0x40ad('0x32')]?_0x1c7953[_0x40ad('0x31')]:_0x1e73e7[_0x40ad('0x2c')];if(_0xc53670[_0x40ad('0x2d')][_0x40ad('0x3c')]){_0x1c7953[_0x40ad('0x3d')]=[{'all':!![]}];}_0x1c7953=_[_0x40ad('0x3a')]({},_0x1c7953,_0xc53670['options']);return db[_0x40ad('0x3e')][_0x40ad('0x41')](_0x1c7953)['then'](handleEntityNotFound(_0x5d29c9,null))[_0x40ad('0x23')](respondWithResult(_0x5d29c9,null))[_0x40ad('0x42')](handleError(_0x5d29c9,null));};exports[_0x40ad('0x43')]=function(_0x50271a,_0x31e459){return db[_0x40ad('0x3e')][_0x40ad('0x43')](_0x50271a[_0x40ad('0x44')],{})[_0x40ad('0x23')](respondWithResult(_0x31e459,0xc9))[_0x40ad('0x42')](handleError(_0x31e459,null));};exports[_0x40ad('0x22')]=function(_0x24114a,_0x1f55c0){if(_0x24114a[_0x40ad('0x44')]['id']){delete _0x24114a[_0x40ad('0x44')]['id'];}return db[_0x40ad('0x3e')][_0x40ad('0x41')]({'where':{'id':_0x24114a[_0x40ad('0x45')]['id']}})[_0x40ad('0x23')](handleEntityNotFound(_0x1f55c0,null))[_0x40ad('0x23')](saveUpdates(_0x24114a[_0x40ad('0x44')],null))[_0x40ad('0x23')](respondWithResult(_0x1f55c0,null))[_0x40ad('0x42')](handleError(_0x1f55c0,null));};exports[_0x40ad('0x24')]=function(_0xa79444,_0x3a2860){return db[_0x40ad('0x3e')][_0x40ad('0x41')]({'where':{'id':_0xa79444['params']['id']}})[_0x40ad('0x23')](handleEntityNotFound(_0x3a2860,null))[_0x40ad('0x23')](removeEntity(_0x3a2860,null))['catch'](handleError(_0x3a2860,null));};exports[_0x40ad('0x46')]=function(_0x439785,_0x523149){return db[_0x40ad('0x3e')]['describe']()[_0x40ad('0x23')](respondWithResult(_0x523149,null))[_0x40ad('0x42')](handleError(_0x523149,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ed4afd6..e7130ba 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 _0xdce1=['path','rimraf','../../config/environment','./squareReport.attributes','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','moment','bluebird','request-promise'];(function(_0x200535,_0x1499e8){var _0x39d3ba=function(_0x115d4a){while(--_0x115d4a){_0x200535['push'](_0x200535['shift']());}};_0x39d3ba(++_0x1499e8);}(_0xdce1,0x163));var _0x1dce=function(_0x1d6258,_0x1a2b27){_0x1d6258=_0x1d6258-0x0;var _0x88d8b9=_0xdce1[_0x1d6258];return _0x88d8b9;};'use strict';var _=require(_0x1dce('0x0'));var util=require(_0x1dce('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1dce('0x2'));var BPromise=require(_0x1dce('0x3'));var rp=require(_0x1dce('0x4'));var fs=require('fs');var path=require(_0x1dce('0x5'));var rimraf=require(_0x1dce('0x6'));var config=require(_0x1dce('0x7'));var attributes=require(_0x1dce('0x8'));module['exports']=function(_0x55811a,_0x294711){return _0x55811a[_0x1dce('0x9')]('SquareReport',attributes,{'tableName':_0x1dce('0xa'),'paranoid':![],'indexes':[{'name':_0x1dce('0xb'),'fields':[_0x1dce('0xc'),_0x1dce('0xd')]},{'name':_0x1dce('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a38=['project_name','leaveAt','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x1a38,0x112));var _0x81a3=function(_0x2c69a1,_0x201903){_0x2c69a1=_0x2c69a1-0x0;var _0x24bb91=_0x1a38[_0x2c69a1];return _0x24bb91;};'use strict';var _=require('lodash');var util=require(_0x81a3('0x0'));var logger=require('../../config/logger')(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require(_0x81a3('0x3'));var rp=require(_0x81a3('0x4'));var fs=require('fs');var path=require(_0x81a3('0x5'));var rimraf=require(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var attributes=require(_0x81a3('0x8'));module[_0x81a3('0x9')]=function(_0x55fb39,_0x2dc222){return _0x55fb39[_0x81a3('0xa')](_0x81a3('0xb'),attributes,{'tableName':_0x81a3('0xc'),'paranoid':![],'indexes':[{'name':_0x81a3('0xd'),'fields':[_0x81a3('0xe'),_0x81a3('0xf')]},{'name':_0x81a3('0x10'),'fields':[_0x81a3('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index c7e301e..07df83a 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 _0xbc4c=['../../config/utils','rpc','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareReport','create','options','raw','debug','UpdateSquareReport','SquareReport','body','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xbc4c,0x90));var _0xcbc4=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0xbc4c[_0x1c06f4];return _0x1a727e;};'use strict';var _=require(_0xcbc4('0x0'));var util=require(_0xcbc4('0x1'));var moment=require('moment');var BPromise=require(_0xcbc4('0x2'));var rs=require(_0xcbc4('0x3'));var fs=require('fs');var Redis=require(_0xcbc4('0x4'));var db=require(_0xcbc4('0x5'))['db'];var utils=require(_0xcbc4('0x6'));var logger=require('../../config/logger')(_0xcbc4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcbc4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d3f4f,_0x3d4068,_0x1d82e4){return new BPromise(function(_0x22d408,_0x270638){return client[_0xcbc4('0x9')](_0x3d3f4f,_0x1d82e4)[_0xcbc4('0xa')](function(_0x33c9e6){logger['info'](_0xcbc4('0xb'),_0x3d4068,_0xcbc4('0xc'));logger['debug'](_0xcbc4('0xd'),_0x3d4068,_0xcbc4('0xc'),JSON[_0xcbc4('0xe')](_0x33c9e6));if(_0x33c9e6[_0xcbc4('0xf')]){if(_0x33c9e6[_0xcbc4('0xf')][_0xcbc4('0x10')]===0x1f4){logger[_0xcbc4('0xf')](_0xcbc4('0xb'),_0x3d4068,_0x33c9e6[_0xcbc4('0xf')][_0xcbc4('0x11')]);return _0x270638(_0x33c9e6[_0xcbc4('0xf')][_0xcbc4('0x11')]);}logger[_0xcbc4('0xf')](_0xcbc4('0xb'),_0x3d4068,_0x33c9e6[_0xcbc4('0xf')][_0xcbc4('0x11')]);return _0x22d408(_0x33c9e6[_0xcbc4('0xf')][_0xcbc4('0x11')]);}else{logger[_0xcbc4('0x12')](_0xcbc4('0xb'),_0x3d4068,'request\x20sent');_0x22d408(_0x33c9e6['result'][_0xcbc4('0x11')]);}})[_0xcbc4('0x13')](function(_0x2a716f){logger[_0xcbc4('0xf')](_0xcbc4('0xb'),_0x3d4068,_0x2a716f);_0x270638(_0x2a716f);});});}exports[_0xcbc4('0x14')]=function(_0x20a928){var _0x12e1c4=this;return new Promise(function(_0x3d5646,_0x2ee585){return db['SquareReport'][_0xcbc4('0x15')](_0x20a928['body'],{'raw':_0x20a928[_0xcbc4('0x16')]?_0x20a928[_0xcbc4('0x16')][_0xcbc4('0x17')]===undefined?!![]:![]:!![]})[_0xcbc4('0xa')](function(_0xa86faf){logger[_0xcbc4('0x12')](_0xcbc4('0x14'),_0x20a928);logger[_0xcbc4('0x18')](_0xcbc4('0x14'),_0x20a928,JSON[_0xcbc4('0xe')](_0xa86faf));_0x3d5646(_0xa86faf);})[_0xcbc4('0x13')](function(_0x127fa5){logger['error'](_0xcbc4('0x14'),_0x127fa5[_0xcbc4('0x11')],_0x20a928);_0x2ee585(_0x12e1c4[_0xcbc4('0xf')](0x1f4,_0x127fa5[_0xcbc4('0x11')]));});});};exports[_0xcbc4('0x19')]=function(_0x1d55cf){var _0x4b31d2=this;return new Promise(function(_0x3024b4,_0x259870){return db[_0xcbc4('0x1a')]['update'](_0x1d55cf[_0xcbc4('0x1b')],{'raw':_0x1d55cf['options']?_0x1d55cf[_0xcbc4('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d55cf[_0xcbc4('0x16')]?_0x1d55cf[_0xcbc4('0x16')]['where']||null:null,'attributes':_0x1d55cf[_0xcbc4('0x16')]?_0x1d55cf['options'][_0xcbc4('0x1c')]||null:null,'limit':_0x1d55cf[_0xcbc4('0x16')]?_0x1d55cf[_0xcbc4('0x16')][_0xcbc4('0x1d')]||null:null})[_0xcbc4('0xa')](function(_0x2d5b7e){logger[_0xcbc4('0x12')](_0xcbc4('0x19'),_0x1d55cf);logger[_0xcbc4('0x18')]('UpdateSquareReport',_0x1d55cf,JSON['stringify'](_0x2d5b7e));_0x3024b4(_0x2d5b7e);})[_0xcbc4('0x13')](function(_0x595514){logger['error'](_0xcbc4('0x19'),_0x595514[_0xcbc4('0x11')],_0x1d55cf);_0x259870(_0x4b31d2[_0xcbc4('0xf')](0x1f4,_0x595514[_0xcbc4('0x11')]));});});}; \ No newline at end of file +var _0x5de1=['stringify','error','code','message','catch','CreateSquareReport','SquareReport','create','options','raw','body','attributes','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x5de1,0x9e));var _0x15de=function(_0x583d04,_0x8faa4d){_0x583d04=_0x583d04-0x0;var _0x51226b=_0x5de1[_0x583d04];return _0x51226b;};'use strict';var _=require(_0x15de('0x0'));var util=require(_0x15de('0x1'));var moment=require(_0x15de('0x2'));var BPromise=require(_0x15de('0x3'));var rs=require(_0x15de('0x4'));var fs=require('fs');var Redis=require(_0x15de('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x15de('0x6'));var logger=require('../../config/logger')(_0x15de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15de('0x8')][_0x15de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4513f0,_0x54979a,_0x5dd398){return new BPromise(function(_0x4b5bb3,_0x107696){return client['request'](_0x4513f0,_0x5dd398)[_0x15de('0xa')](function(_0x320a7b){logger[_0x15de('0xb')](_0x15de('0xc'),_0x54979a,'request\x20sent');logger[_0x15de('0xd')](_0x15de('0xe'),_0x54979a,_0x15de('0xf'),JSON[_0x15de('0x10')](_0x320a7b));if(_0x320a7b[_0x15de('0x11')]){if(_0x320a7b['error'][_0x15de('0x12')]===0x1f4){logger[_0x15de('0x11')]('SquareReport,\x20%s,\x20%s',_0x54979a,_0x320a7b['error'][_0x15de('0x13')]);return _0x107696(_0x320a7b['error'][_0x15de('0x13')]);}logger[_0x15de('0x11')]('SquareReport,\x20%s,\x20%s',_0x54979a,_0x320a7b[_0x15de('0x11')][_0x15de('0x13')]);return _0x4b5bb3(_0x320a7b[_0x15de('0x11')][_0x15de('0x13')]);}else{logger[_0x15de('0xb')](_0x15de('0xc'),_0x54979a,'request\x20sent');_0x4b5bb3(_0x320a7b['result'][_0x15de('0x13')]);}})[_0x15de('0x14')](function(_0x11c143){logger[_0x15de('0x11')](_0x15de('0xc'),_0x54979a,_0x11c143);_0x107696(_0x11c143);});});}exports[_0x15de('0x15')]=function(_0xfcd02){var _0x416152=this;return new Promise(function(_0x67f3be,_0x2427cb){return db[_0x15de('0x16')][_0x15de('0x17')](_0xfcd02['body'],{'raw':_0xfcd02[_0x15de('0x18')]?_0xfcd02[_0x15de('0x18')][_0x15de('0x19')]===undefined?!![]:![]:!![]})[_0x15de('0xa')](function(_0x2feaac){logger[_0x15de('0xb')](_0x15de('0x15'),_0xfcd02);logger[_0x15de('0xd')](_0x15de('0x15'),_0xfcd02,JSON[_0x15de('0x10')](_0x2feaac));_0x67f3be(_0x2feaac);})[_0x15de('0x14')](function(_0x245ed5){logger['error'](_0x15de('0x15'),_0x245ed5[_0x15de('0x13')],_0xfcd02);_0x2427cb(_0x416152[_0x15de('0x11')](0x1f4,_0x245ed5[_0x15de('0x13')]));});});};exports['UpdateSquareReport']=function(_0x5f39db){var _0x3635fc=this;return new Promise(function(_0x3be15c,_0x32b85c){return db['SquareReport']['update'](_0x5f39db[_0x15de('0x1a')],{'raw':_0x5f39db['options']?_0x5f39db[_0x15de('0x18')][_0x15de('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f39db[_0x15de('0x18')]?_0x5f39db[_0x15de('0x18')]['where']||null:null,'attributes':_0x5f39db[_0x15de('0x18')]?_0x5f39db[_0x15de('0x18')][_0x15de('0x1b')]||null:null,'limit':_0x5f39db['options']?_0x5f39db['options']['limit']||null:null})[_0x15de('0xa')](function(_0x40a525){logger[_0x15de('0xb')](_0x15de('0x1c'),_0x5f39db);logger[_0x15de('0xd')](_0x15de('0x1c'),_0x5f39db,JSON[_0x15de('0x10')](_0x40a525));_0x3be15c(_0x40a525);})[_0x15de('0x14')](function(_0x54a082){logger[_0x15de('0x11')](_0x15de('0x1c'),_0x54a082[_0x15de('0x13')],_0x5f39db);_0x32b85c(_0x3635fc[_0x15de('0x11')](0x1f4,_0x54a082[_0x15de('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9199168..5ba049c 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 _0x8941=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete','destroy','multer','util'];(function(_0xb4bb0e,_0x2b1dd1){var _0x4a72f6=function(_0x67aa08){while(--_0x67aa08){_0xb4bb0e['push'](_0xb4bb0e['shift']());}};_0x4a72f6(++_0x2b1dd1);}(_0x8941,0x163));var _0x1894=function(_0x2a8e08,_0x38ce17){_0x2a8e08=_0x2a8e08-0x0;var _0x249699=_0x8941[_0x2a8e08];return _0x249699;};'use strict';var multer=require(_0x1894('0x0'));var util=require(_0x1894('0x1'));var path=require(_0x1894('0x2'));var timeout=require(_0x1894('0x3'));var express=require(_0x1894('0x4'));var router=express[_0x1894('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1894('0x6'));var interaction=require(_0x1894('0x7'));var config=require(_0x1894('0x8'));var controller=require(_0x1894('0x9'));router[_0x1894('0xa')]('/',auth[_0x1894('0xb')](),controller[_0x1894('0xc')]);router[_0x1894('0xa')](_0x1894('0xd'),auth[_0x1894('0xb')](),controller['describe']);router['get']('/:id',auth[_0x1894('0xb')](),controller[_0x1894('0xe')]);router[_0x1894('0xf')]('/',auth[_0x1894('0xb')](),controller[_0x1894('0x10')]);router[_0x1894('0x11')]('/:id',auth[_0x1894('0xb')](),controller[_0x1894('0x12')]);router[_0x1894('0x13')]('/:id',auth[_0x1894('0xb')](),controller[_0x1894('0x14')]);module['exports']=router; \ No newline at end of file +var _0x42ec=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x5a829f,_0x5d66bd){var _0xc1048b=function(_0x290196){while(--_0x290196){_0x5a829f['push'](_0x5a829f['shift']());}};_0xc1048b(++_0x5d66bd);}(_0x42ec,0x79));var _0xc42e=function(_0x1d9fa5,_0x19f5a5){_0x1d9fa5=_0x1d9fa5-0x0;var _0x846175=_0x42ec[_0x1d9fa5];return _0x846175;};'use strict';var multer=require('multer');var util=require(_0xc42e('0x0'));var path=require(_0xc42e('0x1'));var timeout=require('connect-timeout');var express=require(_0xc42e('0x2'));var router=express[_0xc42e('0x3')]();var fs_extra=require(_0xc42e('0x4'));var auth=require(_0xc42e('0x5'));var interaction=require(_0xc42e('0x6'));var config=require(_0xc42e('0x7'));var controller=require('./squareReportDetail.controller');router[_0xc42e('0x8')]('/',auth[_0xc42e('0x9')](),controller[_0xc42e('0xa')]);router[_0xc42e('0x8')]('/describe',auth[_0xc42e('0x9')](),controller[_0xc42e('0xb')]);router[_0xc42e('0x8')](_0xc42e('0xc'),auth[_0xc42e('0x9')](),controller[_0xc42e('0xd')]);router[_0xc42e('0xe')]('/',auth['isAuthenticated'](),controller[_0xc42e('0xf')]);router[_0xc42e('0x10')](_0xc42e('0xc'),auth[_0xc42e('0x9')](),controller[_0xc42e('0x11')]);router[_0xc42e('0x12')](_0xc42e('0xc'),auth[_0xc42e('0x9')](),controller['destroy']);module[_0xc42e('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 17d8c86..37cc91a 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 _0x7eb1=['sequelize','exports','STRING'];(function(_0x4f55d2,_0x3b2ae2){var _0x47e17c=function(_0x17b16f){while(--_0x17b16f){_0x4f55d2['push'](_0x4f55d2['shift']());}};_0x47e17c(++_0x3b2ae2);}(_0x7eb1,0x165));var _0x17eb=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0x7eb1[_0xb6a965];return _0x51d37d;};'use strict';var Sequelize=require(_0x17eb('0x0'));module[_0x17eb('0x1')]={'uniqueid':{'type':Sequelize[_0x17eb('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x17eb('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x17eb('0x2')]},'callerid':{'type':Sequelize[_0x17eb('0x2')]}}; \ No newline at end of file +var _0x8442=['exports','STRING'];(function(_0x5aacb7,_0x5ef93b){var _0x5ec016=function(_0x11038a){while(--_0x11038a){_0x5aacb7['push'](_0x5aacb7['shift']());}};_0x5ec016(++_0x5ef93b);}(_0x8442,0x17a));var _0x2844=function(_0x52411b,_0xefe97f){_0x52411b=_0x52411b-0x0;var _0x1dbd2d=_0x8442[_0x52411b];return _0x1dbd2d;};'use strict';var Sequelize=require('sequelize');module[_0x2844('0x0')]={'uniqueid':{'type':Sequelize[_0x2844('0x1')]},'node':{'type':Sequelize[_0x2844('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x2844('0x1')]},'callerid':{'type':Sequelize[_0x2844('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c61c62d..558f510 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 _0xa3b7=['path','sox','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/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','SquareDetailsReport','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x275929,_0x2927e2){var _0x14624a=function(_0xa24d28){while(--_0xa24d28){_0x275929['push'](_0x275929['shift']());}};_0x14624a(++_0x2927e2);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0xa3b7[_0x32f26d];return _0x5d9ddc;};'use strict';var emlformat=require(_0x7a3b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7a3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a3b('0x2'));var moment=require(_0x7a3b('0x3'));var BPromise=require(_0x7a3b('0x4'));var Mustache=require(_0x7a3b('0x5'));var util=require(_0x7a3b('0x6'));var path=require(_0x7a3b('0x7'));var sox=require(_0x7a3b('0x8'));var csv=require('to-csv');var ejs=require(_0x7a3b('0x9'));var fs=require('fs');var fs_extra=require(_0x7a3b('0xa'));var _=require(_0x7a3b('0xb'));var squel=require(_0x7a3b('0xc'));var crypto=require(_0x7a3b('0xd'));var jsforce=require(_0x7a3b('0xe'));var deskjs=require(_0x7a3b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7a3b('0x10'));var Papa=require(_0x7a3b('0x11'));var Redis=require(_0x7a3b('0x12'));var authService=require(_0x7a3b('0x13'));var qs=require(_0x7a3b('0x14'));var as=require(_0x7a3b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a3b('0x16'))(_0x7a3b('0x17'));var utils=require(_0x7a3b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7a3b('0x19'));var db=require(_0x7a3b('0x1a'))['db'];function respondWithStatusCode(_0x5a5897,_0x2110d9){_0x2110d9=_0x2110d9||0xcc;return function(_0x12b073){if(_0x12b073){return _0x5a5897[_0x7a3b('0x1b')](_0x2110d9);}return _0x5a5897['status'](_0x2110d9)[_0x7a3b('0x1c')]();};}function respondWithResult(_0x4167d0,_0x346609){_0x346609=_0x346609||0xc8;return function(_0x4e27a9){if(_0x4e27a9){return _0x4167d0[_0x7a3b('0x1d')](_0x346609)[_0x7a3b('0x1e')](_0x4e27a9);}};}function respondWithFilteredResult(_0x530172,_0x335a43){return function(_0x312be6){if(_0x312be6){var _0x3267c5=typeof _0x335a43['offset']===_0x7a3b('0x1f')&&typeof _0x335a43[_0x7a3b('0x20')]==='undefined';var _0x444129=_0x312be6['count'];var _0x6de066=_0x3267c5?0x0:_0x335a43['offset'];var _0x27d5a1=_0x3267c5?_0x312be6[_0x7a3b('0x21')]:_0x335a43[_0x7a3b('0x22')]+_0x335a43[_0x7a3b('0x20')];var _0x58bb3a;if(_0x27d5a1>=_0x444129){_0x27d5a1=_0x444129;_0x58bb3a=0xc8;}else{_0x58bb3a=0xce;}_0x530172[_0x7a3b('0x1d')](_0x58bb3a);return _0x530172[_0x7a3b('0x23')](_0x7a3b('0x24'),_0x6de066+'-'+_0x27d5a1+'/'+_0x444129)[_0x7a3b('0x1e')](_0x312be6);}return null;};}function patchUpdates(_0x329123){return function(_0x1492d8){try{jsonpatch[_0x7a3b('0x25')](_0x1492d8,_0x329123,!![]);}catch(_0x3259f2){return BPromise[_0x7a3b('0x26')](_0x3259f2);}return _0x1492d8[_0x7a3b('0x27')]();};}function saveUpdates(_0x4622d5,_0x4138dc){return function(_0x4cfc79){if(_0x4cfc79){return _0x4cfc79[_0x7a3b('0x28')](_0x4622d5)['then'](function(_0x16410e){return _0x16410e;});}return null;};}function removeEntity(_0xaff1c2,_0x53b165){return function(_0x11f60b){if(_0x11f60b){return _0x11f60b[_0x7a3b('0x29')]()[_0x7a3b('0x2a')](function(){_0xaff1c2['status'](0xcc)[_0x7a3b('0x1c')]();});}};}function handleEntityNotFound(_0x2b8ee5,_0x285b78){return function(_0x22f15b){if(!_0x22f15b){_0x2b8ee5['sendStatus'](0x194);}return _0x22f15b;};}function handleError(_0x1b8965,_0x5950a4){_0x5950a4=_0x5950a4||0x1f4;return function(_0x599389){logger[_0x7a3b('0x2b')](_0x599389[_0x7a3b('0x2c')]);if(_0x599389[_0x7a3b('0x2d')]){delete _0x599389[_0x7a3b('0x2d')];}_0x1b8965[_0x7a3b('0x1d')](_0x5950a4)[_0x7a3b('0x2e')](_0x599389);};}exports[_0x7a3b('0x2f')]=function(_0x447252,_0x2224ed){var _0x440f90={},_0xaf37af={},_0x43653c={'count':0x0,'rows':[]};var _0x4c8d74=_['map'](db['SquareDetailsReport'][_0x7a3b('0x30')],function(_0x170464){return{'name':_0x170464[_0x7a3b('0x31')],'type':_0x170464[_0x7a3b('0x32')][_0x7a3b('0x33')]};});_0xaf37af[_0x7a3b('0x34')]=_[_0x7a3b('0x35')](_0x4c8d74,_0x7a3b('0x2d'));_0xaf37af[_0x7a3b('0x36')]=_[_0x7a3b('0x37')](_0x447252['query']);_0xaf37af[_0x7a3b('0x38')]=_[_0x7a3b('0x39')](_0xaf37af[_0x7a3b('0x34')],_0xaf37af['query']);_0x440f90[_0x7a3b('0x3a')]=_[_0x7a3b('0x39')](_0xaf37af[_0x7a3b('0x34')],qs[_0x7a3b('0x3b')](_0x447252[_0x7a3b('0x36')]['fields']));_0x440f90[_0x7a3b('0x3a')]=_0x440f90[_0x7a3b('0x3a')][_0x7a3b('0x3c')]?_0x440f90['attributes']:_0xaf37af[_0x7a3b('0x34')];if(!_0x447252[_0x7a3b('0x36')][_0x7a3b('0x3d')](_0x7a3b('0x3e'))){_0x440f90[_0x7a3b('0x20')]=qs[_0x7a3b('0x20')](_0x447252['query'][_0x7a3b('0x20')]);_0x440f90[_0x7a3b('0x22')]=qs[_0x7a3b('0x22')](_0x447252[_0x7a3b('0x36')]['offset']);}_0x440f90[_0x7a3b('0x3f')]=qs[_0x7a3b('0x40')](_0x447252[_0x7a3b('0x36')][_0x7a3b('0x40')]);_0x440f90[_0x7a3b('0x41')]=qs['filters'](_['pick'](_0x447252[_0x7a3b('0x36')],_0xaf37af['filters']),_0x4c8d74);if(_0x447252[_0x7a3b('0x36')][_0x7a3b('0x42')]){_0x440f90[_0x7a3b('0x41')]=_['merge'](_0x440f90['where'],{'$or':_[_0x7a3b('0x35')](_0x4c8d74,function(_0x556954){if(_0x556954[_0x7a3b('0x32')]!=='VIRTUAL'){var _0x3f68f1={};_0x3f68f1[_0x556954['name']]={'$like':'%'+_0x447252[_0x7a3b('0x36')][_0x7a3b('0x42')]+'%'};return _0x3f68f1;}})});}_0x440f90=_[_0x7a3b('0x43')]({},_0x440f90,_0x447252['options']);var _0x1c43b4={'where':_0x440f90[_0x7a3b('0x41')]};return db['SquareDetailsReport'][_0x7a3b('0x21')](_0x1c43b4)[_0x7a3b('0x2a')](function(_0x358ca8){_0x43653c[_0x7a3b('0x21')]=_0x358ca8;if(_0x447252[_0x7a3b('0x36')][_0x7a3b('0x44')]){_0x440f90[_0x7a3b('0x45')]=[{'all':!![]}];}return db[_0x7a3b('0x46')]['findAll'](_0x440f90);})[_0x7a3b('0x2a')](function(_0x4f81e9){_0x43653c[_0x7a3b('0x47')]=_0x4f81e9;return _0x43653c;})[_0x7a3b('0x2a')](respondWithFilteredResult(_0x2224ed,_0x440f90))['catch'](handleError(_0x2224ed,null));};exports[_0x7a3b('0x48')]=function(_0x2e5165,_0x1d795f){var _0x34aa36={'raw':!![],'where':{'id':_0x2e5165[_0x7a3b('0x49')]['id']}},_0x2c1cec={};_0x2c1cec[_0x7a3b('0x34')]=_[_0x7a3b('0x37')](db[_0x7a3b('0x46')]['rawAttributes']);_0x2c1cec[_0x7a3b('0x36')]=_[_0x7a3b('0x37')](_0x2e5165[_0x7a3b('0x36')]);_0x2c1cec[_0x7a3b('0x38')]=_[_0x7a3b('0x39')](_0x2c1cec[_0x7a3b('0x34')],_0x2c1cec[_0x7a3b('0x36')]);_0x34aa36[_0x7a3b('0x3a')]=_[_0x7a3b('0x39')](_0x2c1cec['model'],qs[_0x7a3b('0x3b')](_0x2e5165['query'][_0x7a3b('0x3b')]));_0x34aa36[_0x7a3b('0x3a')]=_0x34aa36[_0x7a3b('0x3a')]['length']?_0x34aa36['attributes']:_0x2c1cec[_0x7a3b('0x34')];if(_0x2e5165[_0x7a3b('0x36')]['includeAll']){_0x34aa36[_0x7a3b('0x45')]=[{'all':!![]}];}_0x34aa36=_[_0x7a3b('0x43')]({},_0x34aa36,_0x2e5165['options']);return db[_0x7a3b('0x46')][_0x7a3b('0x4a')](_0x34aa36)['then'](handleEntityNotFound(_0x1d795f,null))[_0x7a3b('0x2a')](respondWithResult(_0x1d795f,null))[_0x7a3b('0x4b')](handleError(_0x1d795f,null));};exports[_0x7a3b('0x4c')]=function(_0x57b1f4,_0x2603be){return db[_0x7a3b('0x46')][_0x7a3b('0x4c')](_0x57b1f4['body'],{})['then'](respondWithResult(_0x2603be,0xc9))[_0x7a3b('0x4b')](handleError(_0x2603be,null));};exports['update']=function(_0x2b9183,_0x17259c){if(_0x2b9183[_0x7a3b('0x4d')]['id']){delete _0x2b9183[_0x7a3b('0x4d')]['id'];}return db['SquareDetailsReport'][_0x7a3b('0x4a')]({'where':{'id':_0x2b9183[_0x7a3b('0x49')]['id']}})['then'](handleEntityNotFound(_0x17259c,null))['then'](saveUpdates(_0x2b9183[_0x7a3b('0x4d')],null))['then'](respondWithResult(_0x17259c,null))[_0x7a3b('0x4b')](handleError(_0x17259c,null));};exports[_0x7a3b('0x29')]=function(_0x501fbe,_0x580bfb){return db[_0x7a3b('0x46')]['find']({'where':{'id':_0x501fbe[_0x7a3b('0x49')]['id']}})[_0x7a3b('0x2a')](handleEntityNotFound(_0x580bfb,null))['then'](removeEntity(_0x580bfb,null))[_0x7a3b('0x4b')](handleError(_0x580bfb,null));};exports[_0x7a3b('0x4e')]=function(_0x4812fc,_0x236e96){return db['SquareDetailsReport'][_0x7a3b('0x4e')]()['then'](respondWithResult(_0x236e96,null))['catch'](handleError(_0x236e96,null));}; \ No newline at end of file +var _0xd4d5=['params','find','create','body','catch','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','then','includeAll','include','SquareDetailsReport','findAll','show'];(function(_0x16851c,_0x2f22fc){var _0x4cd143=function(_0x5bf761){while(--_0x5bf761){_0x16851c['push'](_0x16851c['shift']());}};_0x4cd143(++_0x2f22fc);}(_0xd4d5,0xee));var _0x5d4d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd4d5[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x5d4d('0x0'));var rimraf=require(_0x5d4d('0x1'));var zipdir=require(_0x5d4d('0x2'));var jsonpatch=require(_0x5d4d('0x3'));var rp=require(_0x5d4d('0x4'));var moment=require('moment');var BPromise=require(_0x5d4d('0x5'));var Mustache=require('mustache');var util=require(_0x5d4d('0x6'));var path=require('path');var sox=require(_0x5d4d('0x7'));var csv=require(_0x5d4d('0x8'));var ejs=require(_0x5d4d('0x9'));var fs=require('fs');var fs_extra=require(_0x5d4d('0xa'));var _=require(_0x5d4d('0xb'));var squel=require(_0x5d4d('0xc'));var crypto=require(_0x5d4d('0xd'));var jsforce=require(_0x5d4d('0xe'));var deskjs=require(_0x5d4d('0xf'));var toCsv=require(_0x5d4d('0x8'));var querystring=require(_0x5d4d('0x10'));var Papa=require(_0x5d4d('0x11'));var Redis=require(_0x5d4d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5d4d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d4d('0x14'));var logger=require(_0x5d4d('0x15'))(_0x5d4d('0x16'));var utils=require(_0x5d4d('0x17'));var config=require(_0x5d4d('0x18'));var licenseUtil=require(_0x5d4d('0x19'));var db=require(_0x5d4d('0x1a'))['db'];function respondWithStatusCode(_0x20f94a,_0x2db238){_0x2db238=_0x2db238||0xcc;return function(_0x5e0507){if(_0x5e0507){return _0x20f94a[_0x5d4d('0x1b')](_0x2db238);}return _0x20f94a['status'](_0x2db238)[_0x5d4d('0x1c')]();};}function respondWithResult(_0x3c111c,_0x1d63d1){_0x1d63d1=_0x1d63d1||0xc8;return function(_0x28bb9e){if(_0x28bb9e){return _0x3c111c['status'](_0x1d63d1)[_0x5d4d('0x1d')](_0x28bb9e);}};}function respondWithFilteredResult(_0x52926d,_0x3a6d23){return function(_0x1d637d){if(_0x1d637d){var _0x5aa333=typeof _0x3a6d23[_0x5d4d('0x1e')]===_0x5d4d('0x1f')&&typeof _0x3a6d23[_0x5d4d('0x20')]===_0x5d4d('0x1f');var _0x3ccd1a=_0x1d637d[_0x5d4d('0x21')];var _0x434032=_0x5aa333?0x0:_0x3a6d23[_0x5d4d('0x1e')];var _0x4cb48b=_0x5aa333?_0x1d637d['count']:_0x3a6d23['offset']+_0x3a6d23[_0x5d4d('0x20')];var _0x5d1af7;if(_0x4cb48b>=_0x3ccd1a){_0x4cb48b=_0x3ccd1a;_0x5d1af7=0xc8;}else{_0x5d1af7=0xce;}_0x52926d[_0x5d4d('0x22')](_0x5d1af7);return _0x52926d[_0x5d4d('0x23')]('Content-Range',_0x434032+'-'+_0x4cb48b+'/'+_0x3ccd1a)[_0x5d4d('0x1d')](_0x1d637d);}return null;};}function patchUpdates(_0x9be720){return function(_0x5350e5){try{jsonpatch[_0x5d4d('0x24')](_0x5350e5,_0x9be720,!![]);}catch(_0x397cb9){return BPromise[_0x5d4d('0x25')](_0x397cb9);}return _0x5350e5['save']();};}function saveUpdates(_0x3b47b0,_0x3eb828){return function(_0x1e7569){if(_0x1e7569){return _0x1e7569['update'](_0x3b47b0)['then'](function(_0x1dda9e){return _0x1dda9e;});}return null;};}function removeEntity(_0x3d407e,_0x4c6cd7){return function(_0xb5e5da){if(_0xb5e5da){return _0xb5e5da[_0x5d4d('0x26')]()['then'](function(){_0x3d407e['status'](0xcc)[_0x5d4d('0x1c')]();});}};}function handleEntityNotFound(_0x5b1bee,_0x478f4a){return function(_0x12a6ec){if(!_0x12a6ec){_0x5b1bee[_0x5d4d('0x1b')](0x194);}return _0x12a6ec;};}function handleError(_0x286cf0,_0x452b57){_0x452b57=_0x452b57||0x1f4;return function(_0x43e1e0){logger[_0x5d4d('0x27')](_0x43e1e0[_0x5d4d('0x28')]);if(_0x43e1e0[_0x5d4d('0x29')]){delete _0x43e1e0[_0x5d4d('0x29')];}_0x286cf0[_0x5d4d('0x22')](_0x452b57)['send'](_0x43e1e0);};}exports[_0x5d4d('0x2a')]=function(_0x5c8a3c,_0x1a33b4){var _0x50aae9={},_0x74a965={},_0x5bfa63={'count':0x0,'rows':[]};var _0x2b811d=_[_0x5d4d('0x2b')](db['SquareDetailsReport'][_0x5d4d('0x2c')],function(_0x290cf2){return{'name':_0x290cf2[_0x5d4d('0x2d')],'type':_0x290cf2[_0x5d4d('0x2e')][_0x5d4d('0x2f')]};});_0x74a965[_0x5d4d('0x30')]=_['map'](_0x2b811d,_0x5d4d('0x29'));_0x74a965[_0x5d4d('0x31')]=_[_0x5d4d('0x32')](_0x5c8a3c[_0x5d4d('0x31')]);_0x74a965[_0x5d4d('0x33')]=_['intersection'](_0x74a965[_0x5d4d('0x30')],_0x74a965[_0x5d4d('0x31')]);_0x50aae9[_0x5d4d('0x34')]=_[_0x5d4d('0x35')](_0x74a965[_0x5d4d('0x30')],qs[_0x5d4d('0x36')](_0x5c8a3c[_0x5d4d('0x31')][_0x5d4d('0x36')]));_0x50aae9['attributes']=_0x50aae9[_0x5d4d('0x34')][_0x5d4d('0x37')]?_0x50aae9[_0x5d4d('0x34')]:_0x74a965['model'];if(!_0x5c8a3c[_0x5d4d('0x31')][_0x5d4d('0x38')](_0x5d4d('0x39'))){_0x50aae9[_0x5d4d('0x20')]=qs[_0x5d4d('0x20')](_0x5c8a3c['query'][_0x5d4d('0x20')]);_0x50aae9[_0x5d4d('0x1e')]=qs['offset'](_0x5c8a3c[_0x5d4d('0x31')][_0x5d4d('0x1e')]);}_0x50aae9[_0x5d4d('0x3a')]=qs['sort'](_0x5c8a3c[_0x5d4d('0x31')]['sort']);_0x50aae9[_0x5d4d('0x3b')]=qs[_0x5d4d('0x33')](_[_0x5d4d('0x3c')](_0x5c8a3c[_0x5d4d('0x31')],_0x74a965[_0x5d4d('0x33')]),_0x2b811d);if(_0x5c8a3c[_0x5d4d('0x31')]['filter']){_0x50aae9['where']=_[_0x5d4d('0x3d')](_0x50aae9['where'],{'$or':_[_0x5d4d('0x2b')](_0x2b811d,function(_0x303952){if(_0x303952[_0x5d4d('0x2e')]!==_0x5d4d('0x3e')){var _0x212803={};_0x212803[_0x303952['name']]={'$like':'%'+_0x5c8a3c[_0x5d4d('0x31')][_0x5d4d('0x3f')]+'%'};return _0x212803;}})});}_0x50aae9=_[_0x5d4d('0x3d')]({},_0x50aae9,_0x5c8a3c['options']);var _0x5b04d8={'where':_0x50aae9[_0x5d4d('0x3b')]};return db['SquareDetailsReport'][_0x5d4d('0x21')](_0x5b04d8)[_0x5d4d('0x40')](function(_0x5b1439){_0x5bfa63[_0x5d4d('0x21')]=_0x5b1439;if(_0x5c8a3c['query'][_0x5d4d('0x41')]){_0x50aae9[_0x5d4d('0x42')]=[{'all':!![]}];}return db[_0x5d4d('0x43')][_0x5d4d('0x44')](_0x50aae9);})[_0x5d4d('0x40')](function(_0x51b499){_0x5bfa63['rows']=_0x51b499;return _0x5bfa63;})['then'](respondWithFilteredResult(_0x1a33b4,_0x50aae9))['catch'](handleError(_0x1a33b4,null));};exports[_0x5d4d('0x45')]=function(_0x163ad8,_0x9f7ff9){var _0x534dd0={'raw':!![],'where':{'id':_0x163ad8[_0x5d4d('0x46')]['id']}},_0xb409d3={};_0xb409d3['model']=_[_0x5d4d('0x32')](db[_0x5d4d('0x43')]['rawAttributes']);_0xb409d3[_0x5d4d('0x31')]=_[_0x5d4d('0x32')](_0x163ad8['query']);_0xb409d3[_0x5d4d('0x33')]=_['intersection'](_0xb409d3[_0x5d4d('0x30')],_0xb409d3[_0x5d4d('0x31')]);_0x534dd0[_0x5d4d('0x34')]=_[_0x5d4d('0x35')](_0xb409d3[_0x5d4d('0x30')],qs['fields'](_0x163ad8['query'][_0x5d4d('0x36')]));_0x534dd0[_0x5d4d('0x34')]=_0x534dd0['attributes'][_0x5d4d('0x37')]?_0x534dd0[_0x5d4d('0x34')]:_0xb409d3[_0x5d4d('0x30')];if(_0x163ad8[_0x5d4d('0x31')][_0x5d4d('0x41')]){_0x534dd0[_0x5d4d('0x42')]=[{'all':!![]}];}_0x534dd0=_[_0x5d4d('0x3d')]({},_0x534dd0,_0x163ad8['options']);return db[_0x5d4d('0x43')][_0x5d4d('0x47')](_0x534dd0)[_0x5d4d('0x40')](handleEntityNotFound(_0x9f7ff9,null))['then'](respondWithResult(_0x9f7ff9,null))['catch'](handleError(_0x9f7ff9,null));};exports[_0x5d4d('0x48')]=function(_0x35616b,_0x16666f){return db[_0x5d4d('0x43')][_0x5d4d('0x48')](_0x35616b[_0x5d4d('0x49')],{})[_0x5d4d('0x40')](respondWithResult(_0x16666f,0xc9))[_0x5d4d('0x4a')](handleError(_0x16666f,null));};exports[_0x5d4d('0x4b')]=function(_0x165460,_0x5a6a2a){if(_0x165460[_0x5d4d('0x49')]['id']){delete _0x165460[_0x5d4d('0x49')]['id'];}return db[_0x5d4d('0x43')][_0x5d4d('0x47')]({'where':{'id':_0x165460['params']['id']}})[_0x5d4d('0x40')](handleEntityNotFound(_0x5a6a2a,null))['then'](saveUpdates(_0x165460[_0x5d4d('0x49')],null))[_0x5d4d('0x40')](respondWithResult(_0x5a6a2a,null))[_0x5d4d('0x4a')](handleError(_0x5a6a2a,null));};exports['destroy']=function(_0x2b064a,_0x847054){return db['SquareDetailsReport'][_0x5d4d('0x47')]({'where':{'id':_0x2b064a['params']['id']}})[_0x5d4d('0x40')](handleEntityNotFound(_0x847054,null))[_0x5d4d('0x40')](removeEntity(_0x847054,null))['catch'](handleError(_0x847054,null));};exports[_0x5d4d('0x4c')]=function(_0x40b910,_0xac093d){return db[_0x5d4d('0x43')]['describe']()[_0x5d4d('0x40')](respondWithResult(_0xac093d,null))['catch'](handleError(_0xac093d,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 8112caa..e67e555 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 _0xf69f=['../../config/environment','exports','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2e64b2,_0x25433b){var _0x3fa4ea=function(_0x11692a){while(--_0x11692a){_0x2e64b2['push'](_0x2e64b2['shift']());}};_0x3fa4ea(++_0x25433b);}(_0xf69f,0x178));var _0xff69=function(_0x42edac,_0x541b3d){_0x42edac=_0x42edac-0x0;var _0x4cfd49=_0xf69f[_0x42edac];return _0x4cfd49;};'use strict';var _=require(_0xff69('0x0'));var util=require('util');var logger=require(_0xff69('0x1'))(_0xff69('0x2'));var moment=require(_0xff69('0x3'));var BPromise=require(_0xff69('0x4'));var rp=require(_0xff69('0x5'));var fs=require('fs');var path=require(_0xff69('0x6'));var rimraf=require(_0xff69('0x7'));var config=require(_0xff69('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0xff69('0x9')]=function(_0x151099,_0x2a9a47){return _0x151099['define'](_0xff69('0xa'),attributes,{'tableName':_0xff69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x229b=['path','rimraf','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x565ff5,_0x351f00){var _0x5815a6=function(_0x4674f3){while(--_0x4674f3){_0x565ff5['push'](_0x565ff5['shift']());}};_0x5815a6(++_0x351f00);}(_0x229b,0x17f));var _0xb229=function(_0x2adbcd,_0x12fb75){_0x2adbcd=_0x2adbcd-0x0;var _0x168a21=_0x229b[_0x2adbcd];return _0x168a21;};'use strict';var _=require(_0xb229('0x0'));var util=require(_0xb229('0x1'));var logger=require(_0xb229('0x2'))(_0xb229('0x3'));var moment=require(_0xb229('0x4'));var BPromise=require(_0xb229('0x5'));var rp=require(_0xb229('0x6'));var fs=require('fs');var path=require(_0xb229('0x7'));var rimraf=require(_0xb229('0x8'));var config=require('../../config/environment');var attributes=require(_0xb229('0x9'));module['exports']=function(_0x523a10,_0x3154e7){return _0x523a10[_0xb229('0xa')](_0xb229('0xb'),attributes,{'tableName':_0xb229('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 0812a44..11405eb 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 _0x6582=['../../config/utils','../../config/logger','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareDetailsReport','create','options','raw','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x6582,0x108));var _0x2658=function(_0xa3fa3,_0x328285){_0xa3fa3=_0xa3fa3-0x0;var _0x488dd4=_0x6582[_0xa3fa3];return _0x488dd4;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});}exports['CreateSquareDetailsReport']=function(_0x4eb90d){var _0x57337e=this;return new Promise(function(_0xf4193a,_0x260fc7){return db[_0x2658('0x16')][_0x2658('0x17')](_0x4eb90d['body'],{'raw':_0x4eb90d[_0x2658('0x18')]?_0x4eb90d[_0x2658('0x18')][_0x2658('0x19')]===undefined?!![]:![]:!![]})[_0x2658('0xb')](function(_0x23cf70){logger[_0x2658('0xc')]('CreateSquareDetailsReport',_0x4eb90d);logger[_0x2658('0xf')]('CreateSquareDetailsReport',_0x4eb90d,JSON['stringify'](_0x23cf70));_0xf4193a(_0x23cf70);})[_0x2658('0x15')](function(_0x132000){logger['error'](_0x2658('0x1a'),_0x132000['message'],_0x4eb90d);_0x260fc7(_0x57337e[_0x2658('0x11')](0x1f4,_0x132000[_0x2658('0x13')]));});});}; \ No newline at end of file +var _0x8e3f=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','stringify','lodash','util','moment'];(function(_0x491149,_0x1af21d){var _0x565d1a=function(_0x23cefa){while(--_0x23cefa){_0x491149['push'](_0x491149['shift']());}};_0x565d1a(++_0x1af21d);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['create'](_0x11d4cc[_0xf8e3('0x18')],{'raw':_0x11d4cc[_0xf8e3('0x19')]?_0x11d4cc[_0xf8e3('0x19')][_0xf8e3('0x1a')]===undefined?!![]:![]:!![]})[_0xf8e3('0xc')](function(_0x11c58e){logger[_0xf8e3('0xd')](_0xf8e3('0x16'),_0x11d4cc);logger['debug'](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x1b')](_0x11c58e));_0x2e27e3(_0x11c58e);})[_0xf8e3('0x15')](function(_0xccbcc0){logger['error'](_0xf8e3('0x16'),_0xccbcc0['message'],_0x11d4cc);_0x1337ae(_0x7a81c3[_0xf8e3('0x12')](0x1f4,_0xccbcc0[_0xf8e3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index ef6a27b..87bf779 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 _0xce47=['../../components/auth/service','./system.controller','get','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router'];(function(_0x3f7134,_0x2fb536){var _0x4777ce=function(_0x4804a2){while(--_0x4804a2){_0x3f7134['push'](_0x3f7134['shift']());}};_0x4777ce(++_0x2fb536);}(_0xce47,0x6a));var _0x7ce4=function(_0x1448a5,_0x1ad613){_0x1448a5=_0x1448a5-0x0;var _0x15dcc6=_0xce47[_0x1448a5];return _0x15dcc6;};'use strict';var express=require(_0x7ce4('0x0'));var router=express[_0x7ce4('0x1')]();var auth=require(_0x7ce4('0x2'));var controller=require(_0x7ce4('0x3'));router[_0x7ce4('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7ce4('0x4')](_0x7ce4('0x5'),auth[_0x7ce4('0x6')](),controller[_0x7ce4('0x7')]);module[_0x7ce4('0x8')]=router; \ No newline at end of file +var _0x8b08=['exports','Router','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x4d121d,_0x3fe733){var _0xffa031=function(_0x1fec1b){while(--_0x1fec1b){_0x4d121d['push'](_0x4d121d['shift']());}};_0xffa031(++_0x3fe733);}(_0x8b08,0xbe));var _0x88b0=function(_0x5f40af,_0x12227a){_0x5f40af=_0x5f40af-0x0;var _0x4cd2b3=_0x8b08[_0x5f40af];return _0x4cd2b3;};'use strict';var express=require('express');var router=express[_0x88b0('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x88b0('0x1'));router[_0x88b0('0x2')]('/',auth[_0x88b0('0x3')](),controller[_0x88b0('0x4')]);router[_0x88b0('0x2')](_0x88b0('0x5'),auth[_0x88b0('0x3')](),controller['killProcess']);module[_0x88b0('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 28b4cbc..0ccd2e0 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 _0x8dfa=['params','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','inspect','name','status','send','index','getAllData','then','json','catch','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x498577,_0x4b8af0){var _0x56f79a=function(_0x125774){while(--_0x125774){_0x498577['push'](_0x498577['shift']());}};_0x56f79a(++_0x4b8af0);}(_0x8dfa,0xbf));var _0xa8df=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x8dfa[_0x45d3f0];return _0x314b79;};'use strict';var info=require(_0xa8df('0x0'));var exec=require(_0xa8df('0x1'))[_0xa8df('0x2')];var logger=require(_0xa8df('0x3'))(_0xa8df('0x4'));var util=require(_0xa8df('0x5'));var BPromise=require(_0xa8df('0x6'));var _=require(_0xa8df('0x7'));function handleError(_0x5bb4d4,_0x91ac44,_0x28eba0){_0x91ac44=_0x91ac44||0x1f4;return function(_0x533ae4){logger[_0xa8df('0x8')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x28eba0,_0x91ac44,util[_0xa8df('0x9')](_0x533ae4,{'showHidden':![],'depth':null}));delete _0x533ae4[_0xa8df('0xa')];_0x5bb4d4[_0xa8df('0xb')](_0x91ac44)[_0xa8df('0xc')](_0x533ae4);};}exports[_0xa8df('0xd')]=function(_0x354709,_0xf7370){return info[_0xa8df('0xe')]()[_0xa8df('0xf')](function(_0x2e5491){return _0xf7370[_0xa8df('0xb')](0xc8)[_0xa8df('0x10')](_0x2e5491);})[_0xa8df('0x11')](function(_0x59946a){return _0xf7370[_0xa8df('0xb')](0x1f4)[_0xa8df('0x10')](_0x59946a);});};exports['killProcess']=function(_0x35b2ca,_0x42462e){var _0x5ef391=['components/import/cm'];return new BPromise(function(_0x46e54d,_0x52a54d){return exec(util['format'](_0xa8df('0x12'),_0x35b2ca[_0xa8df('0x13')]['pid']),function(_0x38bf70,_0x2c1fe5,_0x5738e7){if(_0x38bf70){return _0x52a54d(_0x38bf70);}return _0x46e54d(_0x2c1fe5);});})['then'](function(_0x1f9f64){var _0x2173c9=![];var _0xc15647=_0x1f9f64[_0xa8df('0x14')](/\n/);for(var _0x3c4538=0x0,_0x45e9d1=_0x5ef391[_0xa8df('0x15')];_0x3c4538<_0x45e9d1,_0x2173c9===![];_0x3c4538+=0x1){if(_0x1f9f64[_0xa8df('0x16')](_0x5ef391[_0x3c4538])>=0x0){_0x2173c9=!![];}}if(!_0x2173c9){throw new Error(util[_0xa8df('0x17')](_0xa8df('0x18'),_0x35b2ca[_0xa8df('0x13')][_0xa8df('0x19')]));}process[_0xa8df('0x1a')](_0x35b2ca['params'][_0xa8df('0x19')],_0xa8df('0x1b'));return _0x42462e[_0xa8df('0xb')](0xc8)[_0xa8df('0x10')]({'message':util[_0xa8df('0x17')](_0xa8df('0x1c'),_0x35b2ca[_0xa8df('0x13')][_0xa8df('0x19')])});})['catch'](handleError(_0x42462e,null,_0xa8df('0x1d')));}; \ No newline at end of file +var _0x89a8=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','index','status','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','then','split','length','indexOf','params','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','api','util','bluebird','lodash'];(function(_0x5e0e1e,_0xe4250b){var _0x55485f=function(_0x4d7afa){while(--_0x4d7afa){_0x5e0e1e['push'](_0x5e0e1e['shift']());}};_0x55485f(++_0xe4250b);}(_0x89a8,0xe4));var _0x889a=function(_0x183ad6,_0x5f06ab){_0x183ad6=_0x183ad6-0x0;var _0x8d60cb=_0x89a8[_0x183ad6];return _0x8d60cb;};'use strict';var info=require(_0x889a('0x0'));var exec=require('child_process')['exec'];var logger=require(_0x889a('0x1'))(_0x889a('0x2'));var util=require(_0x889a('0x3'));var BPromise=require(_0x889a('0x4'));var _=require(_0x889a('0x5'));function handleError(_0x3d21ef,_0x20897d,_0x3dca8d){_0x20897d=_0x20897d||0x1f4;return function(_0x5e8a09){logger[_0x889a('0x6')](_0x889a('0x7'),_0x3dca8d,_0x20897d,util[_0x889a('0x8')](_0x5e8a09,{'showHidden':![],'depth':null}));delete _0x5e8a09[_0x889a('0x9')];_0x3d21ef['status'](_0x20897d)['send'](_0x5e8a09);};}exports[_0x889a('0xa')]=function(_0x2bf9eb,_0x41f40d){return info['getAllData']()['then'](function(_0x23f174){return _0x41f40d[_0x889a('0xb')](0xc8)['json'](_0x23f174);})[_0x889a('0xc')](function(_0xff8ff5){return _0x41f40d[_0x889a('0xb')](0x1f4)[_0x889a('0xd')](_0xff8ff5);});};exports[_0x889a('0xe')]=function(_0x4a79f0,_0x195100){var _0x30b7ec=[_0x889a('0xf')];return new BPromise(function(_0x40a9e3,_0x233008){return exec(util[_0x889a('0x10')](_0x889a('0x11'),_0x4a79f0['params'][_0x889a('0x12')]),function(_0x550678,_0xcf3b9d,_0x4d59b8){if(_0x550678){return _0x233008(_0x550678);}return _0x40a9e3(_0xcf3b9d);});})[_0x889a('0x13')](function(_0x58f656){var _0x26f3ca=![];var _0x1a49ef=_0x58f656[_0x889a('0x14')](/\n/);for(var _0x2ff5ae=0x0,_0x2acd41=_0x30b7ec[_0x889a('0x15')];_0x2ff5ae<_0x2acd41,_0x26f3ca===![];_0x2ff5ae+=0x1){if(_0x58f656[_0x889a('0x16')](_0x30b7ec[_0x2ff5ae])>=0x0){_0x26f3ca=!![];}}if(!_0x26f3ca){throw new Error(util[_0x889a('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x4a79f0[_0x889a('0x17')]['pid']));}process[_0x889a('0x18')](_0x4a79f0[_0x889a('0x17')][_0x889a('0x12')],'SIGINT');return _0x195100['status'](0xc8)[_0x889a('0xd')]({'message':util[_0x889a('0x10')](_0x889a('0x19'),_0x4a79f0[_0x889a('0x17')][_0x889a('0x12')])});})[_0x889a('0xc')](handleError(_0x195100,null,_0x889a('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 0af8f76..754bbc2 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 _0xbd11=['express','Router','fs-extra','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbd11,0xc5));var _0x1bd1=function(_0x494c6f,_0x54dbe7){_0x494c6f=_0x494c6f-0x0;var _0x4c9c08=_0xbd11[_0x494c6f];return _0x4c9c08;};'use strict';var multer=require(_0x1bd1('0x0'));var util=require(_0x1bd1('0x1'));var path=require('path');var timeout=require(_0x1bd1('0x2'));var express=require(_0x1bd1('0x3'));var router=express[_0x1bd1('0x4')]();var fs_extra=require(_0x1bd1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1bd1('0x6'));var controller=require(_0x1bd1('0x7'));router[_0x1bd1('0x8')]('/',auth[_0x1bd1('0x9')](),controller[_0x1bd1('0xa')]);router[_0x1bd1('0x8')](_0x1bd1('0xb'),auth[_0x1bd1('0x9')](),controller[_0x1bd1('0xc')]);router[_0x1bd1('0xd')]('/',auth['isAuthenticated'](),controller[_0x1bd1('0xe')]);router[_0x1bd1('0xf')](_0x1bd1('0xb'),auth[_0x1bd1('0x9')](),controller[_0x1bd1('0x10')]);router[_0x1bd1('0x11')](_0x1bd1('0xb'),auth['isAuthenticated'](),controller[_0x1bd1('0x12')]);module[_0x1bd1('0x13')]=router; \ No newline at end of file +var _0x60ae=['post','create','put','update','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','get','/:id','show'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x60ae,0xb0));var _0xe60a=function(_0x545672,_0x589128){_0x545672=_0x545672-0x0;var _0x57920d=_0x60ae[_0x545672];return _0x57920d;};'use strict';var multer=require(_0xe60a('0x0'));var util=require('util');var path=require(_0xe60a('0x1'));var timeout=require(_0xe60a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe60a('0x3'));var auth=require(_0xe60a('0x4'));var interaction=require(_0xe60a('0x5'));var config=require('../../config/environment');var controller=require(_0xe60a('0x6'));router['get']('/',auth[_0xe60a('0x7')](),controller['index']);router[_0xe60a('0x8')](_0xe60a('0x9'),auth[_0xe60a('0x7')](),controller[_0xe60a('0xa')]);router[_0xe60a('0xb')]('/',auth['isAuthenticated'](),controller[_0xe60a('0xc')]);router[_0xe60a('0xd')](_0xe60a('0x9'),auth[_0xe60a('0x7')](),controller[_0xe60a('0xe')]);router['delete'](_0xe60a('0x9'),auth['isAuthenticated'](),controller[_0xe60a('0xf')]);module[_0xe60a('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 e7fc0a2..6c76d12 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 _0x09dd=['STRING','name','#0091EA','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09dd,0xb7));var _0xd09d=function(_0x2831cf,_0x24babf){_0x2831cf=_0x2831cf-0x0;var _0x5ec206=_0x09dd[_0x2831cf];return _0x5ec206;};'use strict';var Sequelize=require(_0xd09d('0x0'));module[_0xd09d('0x1')]={'name':{'type':Sequelize[_0xd09d('0x2')],'unique':_0xd09d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd09d('0x2')],'defaultValue':_0xd09d('0x4')},'description':{'type':Sequelize[_0xd09d('0x2')]}}; \ No newline at end of file +var _0x1cc3=['name','#0091EA','STRING','sequelize','exports'];(function(_0x4363a4,_0xb62037){var _0x190b82=function(_0x457569){while(--_0x457569){_0x4363a4['push'](_0x4363a4['shift']());}};_0x190b82(++_0xb62037);}(_0x1cc3,0x11b));var _0x31cc=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1cc3[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x31cc('0x0'));module[_0x31cc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x31cc('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x31cc('0x3')},'description':{'type':Sequelize[_0x31cc('0x4')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 307fc38..760bb2c 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 _0x80df=['fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Tags','end','sendStatus','error','stack','name','index','Tag','rawAttributes','type','key','map','query','filters','intersection','model'];(function(_0x410688,_0x57f21f){var _0xba6fd2=function(_0x523679){while(--_0x523679){_0x410688['push'](_0x410688['shift']());}};_0xba6fd2(++_0x57f21f);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf80d('0x0'));var rimraf=require(_0xf80d('0x1'));var zipdir=require(_0xf80d('0x2'));var jsonpatch=require(_0xf80d('0x3'));var rp=require('request-promise');var moment=require(_0xf80d('0x4'));var BPromise=require(_0xf80d('0x5'));var Mustache=require(_0xf80d('0x6'));var util=require(_0xf80d('0x7'));var path=require(_0xf80d('0x8'));var sox=require(_0xf80d('0x9'));var csv=require(_0xf80d('0xa'));var ejs=require(_0xf80d('0xb'));var fs=require('fs');var fs_extra=require(_0xf80d('0xc'));var _=require(_0xf80d('0xd'));var squel=require('squel');var crypto=require(_0xf80d('0xe'));var jsforce=require(_0xf80d('0xf'));var deskjs=require(_0xf80d('0x10'));var toCsv=require(_0xf80d('0xa'));var querystring=require(_0xf80d('0x11'));var Papa=require(_0xf80d('0x12'));var Redis=require(_0xf80d('0x13'));var authService=require(_0xf80d('0x14'));var qs=require(_0xf80d('0x15'));var as=require(_0xf80d('0x16'));var hardwareService=require(_0xf80d('0x17'));var logger=require(_0xf80d('0x18'))(_0xf80d('0x19'));var utils=require(_0xf80d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf80d('0x1b'))['db'];function respondWithStatusCode(_0x74ce36,_0x489bdf){_0x489bdf=_0x489bdf||0xcc;return function(_0x34e130){if(_0x34e130){return _0x74ce36['sendStatus'](_0x489bdf);}return _0x74ce36[_0xf80d('0x1c')](_0x489bdf)['end']();};}function respondWithResult(_0x4285de,_0x50c968){_0x50c968=_0x50c968||0xc8;return function(_0x3be9a9){if(_0x3be9a9){return _0x4285de[_0xf80d('0x1c')](_0x50c968)[_0xf80d('0x1d')](_0x3be9a9);}};}function respondWithFilteredResult(_0x1e1b08,_0x2098d6){return function(_0x45751c){if(_0x45751c){var _0x482043=typeof _0x2098d6[_0xf80d('0x1e')]===_0xf80d('0x1f')&&typeof _0x2098d6[_0xf80d('0x20')]===_0xf80d('0x1f');var _0x27b2ea=_0x45751c[_0xf80d('0x21')];var _0x1d104a=_0x482043?0x0:_0x2098d6[_0xf80d('0x1e')];var _0x2ea2c1=_0x482043?_0x45751c[_0xf80d('0x21')]:_0x2098d6[_0xf80d('0x1e')]+_0x2098d6[_0xf80d('0x20')];var _0x5392c5;if(_0x2ea2c1>=_0x27b2ea){_0x2ea2c1=_0x27b2ea;_0x5392c5=0xc8;}else{_0x5392c5=0xce;}_0x1e1b08[_0xf80d('0x1c')](_0x5392c5);return _0x1e1b08[_0xf80d('0x22')]('Content-Range',_0x1d104a+'-'+_0x2ea2c1+'/'+_0x27b2ea)[_0xf80d('0x1d')](_0x45751c);}return null;};}function patchUpdates(_0x539c80){return function(_0x3f3a2a){try{jsonpatch[_0xf80d('0x23')](_0x3f3a2a,_0x539c80,!![]);}catch(_0x2d5e46){return BPromise[_0xf80d('0x24')](_0x2d5e46);}return _0x3f3a2a[_0xf80d('0x25')]();};}function saveUpdates(_0x25d031,_0x446153){return function(_0x269859){if(_0x269859){return _0x269859[_0xf80d('0x26')](_0x25d031)[_0xf80d('0x27')](function(_0x33d58c){return _0x33d58c;});}return null;};}function removeEntity(_0x739968,_0x570c99){return function(_0x32ad42){if(_0x32ad42){return _0x32ad42[_0xf80d('0x28')]()['then'](function(){var _0x3353a3=_0x32ad42[_0xf80d('0x29')]({'plain':!![]});var _0x323540=_0xf80d('0x2a');return db['UserProfileResource'][_0xf80d('0x28')]({'where':{'type':_0x323540,'resourceId':_0x3353a3['id']}})[_0xf80d('0x27')](function(){return _0x32ad42;});})[_0xf80d('0x27')](function(){_0x739968[_0xf80d('0x1c')](0xcc)[_0xf80d('0x2b')]();});}};}function handleEntityNotFound(_0xde054a,_0x2fc429){return function(_0x68f2c6){if(!_0x68f2c6){_0xde054a[_0xf80d('0x2c')](0x194);}return _0x68f2c6;};}function handleError(_0x4d2579,_0xe940d6){_0xe940d6=_0xe940d6||0x1f4;return function(_0x1603a4){logger[_0xf80d('0x2d')](_0x1603a4[_0xf80d('0x2e')]);if(_0x1603a4[_0xf80d('0x2f')]){delete _0x1603a4[_0xf80d('0x2f')];}_0x4d2579[_0xf80d('0x1c')](_0xe940d6)['send'](_0x1603a4);};}exports[_0xf80d('0x30')]=function(_0x27887e,_0x214bff){var _0x435e23={},_0x5c3a1d={},_0x487d2c={'count':0x0,'rows':[]};var _0x2359f1=_['map'](db[_0xf80d('0x31')][_0xf80d('0x32')],function(_0x45f76a){return{'name':_0x45f76a['fieldName'],'type':_0x45f76a[_0xf80d('0x33')][_0xf80d('0x34')]};});_0x5c3a1d['model']=_[_0xf80d('0x35')](_0x2359f1,_0xf80d('0x2f'));_0x5c3a1d[_0xf80d('0x36')]=_['keys'](_0x27887e[_0xf80d('0x36')]);_0x5c3a1d[_0xf80d('0x37')]=_[_0xf80d('0x38')](_0x5c3a1d[_0xf80d('0x39')],_0x5c3a1d[_0xf80d('0x36')]);_0x435e23['attributes']=_[_0xf80d('0x38')](_0x5c3a1d['model'],qs[_0xf80d('0x3a')](_0x27887e[_0xf80d('0x36')][_0xf80d('0x3a')]));_0x435e23[_0xf80d('0x3b')]=_0x435e23['attributes'][_0xf80d('0x3c')]?_0x435e23[_0xf80d('0x3b')]:_0x5c3a1d[_0xf80d('0x39')];if(!_0x27887e[_0xf80d('0x36')]['hasOwnProperty'](_0xf80d('0x3d'))){_0x435e23[_0xf80d('0x20')]=qs[_0xf80d('0x20')](_0x27887e[_0xf80d('0x36')][_0xf80d('0x20')]);_0x435e23[_0xf80d('0x1e')]=qs[_0xf80d('0x1e')](_0x27887e[_0xf80d('0x36')]['offset']);}_0x435e23[_0xf80d('0x3e')]=qs[_0xf80d('0x3f')](_0x27887e[_0xf80d('0x36')]['sort']);_0x435e23[_0xf80d('0x40')]=qs['filters'](_[_0xf80d('0x41')](_0x27887e[_0xf80d('0x36')],_0x5c3a1d[_0xf80d('0x37')]),_0x2359f1);if(_0x27887e[_0xf80d('0x36')]['filter']){_0x435e23['where']=_['merge'](_0x435e23[_0xf80d('0x40')],{'$or':_[_0xf80d('0x35')](_0x2359f1,function(_0x2d0ee5){if(_0x2d0ee5[_0xf80d('0x33')]!==_0xf80d('0x42')){var _0x100dc7={};_0x100dc7[_0x2d0ee5['name']]={'$like':'%'+_0x27887e[_0xf80d('0x36')][_0xf80d('0x43')]+'%'};return _0x100dc7;}})});}_0x435e23=_[_0xf80d('0x44')]({},_0x435e23,_0x27887e['options']);var _0x14314a={'where':_0x435e23['where']};return db[_0xf80d('0x31')][_0xf80d('0x21')](_0x14314a)[_0xf80d('0x27')](function(_0x2cd371){_0x487d2c[_0xf80d('0x21')]=_0x2cd371;if(_0x27887e[_0xf80d('0x36')][_0xf80d('0x45')]){_0x435e23[_0xf80d('0x46')]=[{'all':!![]}];}return db[_0xf80d('0x31')][_0xf80d('0x47')](_0x435e23);})[_0xf80d('0x27')](function(_0x437e44){_0x487d2c[_0xf80d('0x48')]=_0x437e44;return _0x487d2c;})[_0xf80d('0x27')](respondWithFilteredResult(_0x214bff,_0x435e23))[_0xf80d('0x49')](handleError(_0x214bff,null));};exports[_0xf80d('0x4a')]=function(_0x43474d,_0x9da271){var _0x19b7eb={'raw':!![],'where':{'id':_0x43474d[_0xf80d('0x4b')]['id']}},_0x24c1e4={};_0x24c1e4[_0xf80d('0x39')]=_[_0xf80d('0x4c')](db[_0xf80d('0x31')][_0xf80d('0x32')]);_0x24c1e4['query']=_[_0xf80d('0x4c')](_0x43474d[_0xf80d('0x36')]);_0x24c1e4[_0xf80d('0x37')]=_[_0xf80d('0x38')](_0x24c1e4[_0xf80d('0x39')],_0x24c1e4['query']);_0x19b7eb[_0xf80d('0x3b')]=_[_0xf80d('0x38')](_0x24c1e4[_0xf80d('0x39')],qs[_0xf80d('0x3a')](_0x43474d[_0xf80d('0x36')][_0xf80d('0x3a')]));_0x19b7eb[_0xf80d('0x3b')]=_0x19b7eb[_0xf80d('0x3b')][_0xf80d('0x3c')]?_0x19b7eb[_0xf80d('0x3b')]:_0x24c1e4[_0xf80d('0x39')];if(_0x43474d[_0xf80d('0x36')][_0xf80d('0x45')]){_0x19b7eb[_0xf80d('0x46')]=[{'all':!![]}];}_0x19b7eb=_[_0xf80d('0x44')]({},_0x19b7eb,_0x43474d[_0xf80d('0x4d')]);return db[_0xf80d('0x31')]['find'](_0x19b7eb)[_0xf80d('0x27')](handleEntityNotFound(_0x9da271,null))[_0xf80d('0x27')](respondWithResult(_0x9da271,null))[_0xf80d('0x49')](handleError(_0x9da271,null));};exports['create']=function(_0x3e5cf6,_0x1088ca){return db['Tag']['create'](_0x3e5cf6[_0xf80d('0x4e')],{})['then'](function(_0xcb5fe7){var _0x24c70e=_0x3e5cf6[_0xf80d('0x4f')][_0xf80d('0x29')]({'plain':!![]});if(!_0x24c70e)throw new Error(_0xf80d('0x50'));if(_0x24c70e[_0xf80d('0x51')]===_0xf80d('0x4f')){var _0x114132=_0xcb5fe7[_0xf80d('0x29')]({'plain':!![]});var _0x1f20a2=_0xf80d('0x2a');return db[_0xf80d('0x52')]['find']({'where':{'name':_0x1f20a2,'userProfileId':_0x24c70e[_0xf80d('0x53')]},'raw':!![]})[_0xf80d('0x27')](function(_0x3c25d7){if(_0x3c25d7&&_0x3c25d7['autoAssociation']===0x0){return db[_0xf80d('0x54')][_0xf80d('0x55')]({'name':_0x114132['name'],'resourceId':_0x114132['id'],'type':_0x3c25d7[_0xf80d('0x2f')],'sectionId':_0x3c25d7['id']},{})[_0xf80d('0x27')](function(){return _0xcb5fe7;});}else{return _0xcb5fe7;}})['catch'](function(_0xee12ae){logger[_0xf80d('0x2d')](_0xf80d('0x56'),_0xee12ae);throw _0xee12ae;});}return _0xcb5fe7;})[_0xf80d('0x27')](respondWithResult(_0x1088ca,0xc9))['catch'](handleError(_0x1088ca,null));};exports[_0xf80d('0x26')]=function(_0x374985,_0x1a4c08){if(_0x374985['body']['id']){delete _0x374985[_0xf80d('0x4e')]['id'];}return db[_0xf80d('0x31')][_0xf80d('0x57')]({'where':{'id':_0x374985[_0xf80d('0x4b')]['id']}})[_0xf80d('0x27')](handleEntityNotFound(_0x1a4c08,null))[_0xf80d('0x27')](saveUpdates(_0x374985[_0xf80d('0x4e')],null))[_0xf80d('0x27')](respondWithResult(_0x1a4c08,null))[_0xf80d('0x49')](handleError(_0x1a4c08,null));};exports[_0xf80d('0x28')]=function(_0x543dba,_0x112342){return db[_0xf80d('0x31')][_0xf80d('0x57')]({'where':{'id':_0x543dba[_0xf80d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x112342,null))['then'](removeEntity(_0x112342,null))[_0xf80d('0x49')](handleError(_0x112342,null));}; \ No newline at end of file +var _0xaf93=['sort','where','filters','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','then','get','Tags','UserProfileResource','destroy','end','sendStatus','stack','name','index','Tag','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit'];(function(_0x4ff1ff,_0x2c2872){var _0x9afa87=function(_0x3db17b){while(--_0x3db17b){_0x4ff1ff['push'](_0x4ff1ff['shift']());}};_0x9afa87(++_0x2c2872);}(_0xaf93,0x151));var _0x3af9=function(_0x2e8e6e,_0x52bd47){_0x2e8e6e=_0x2e8e6e-0x0;var _0x461503=_0xaf93[_0x2e8e6e];return _0x461503;};'use strict';var emlformat=require(_0x3af9('0x0'));var rimraf=require(_0x3af9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3af9('0x2'));var moment=require(_0x3af9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3af9('0x4'));var util=require(_0x3af9('0x5'));var path=require(_0x3af9('0x6'));var sox=require(_0x3af9('0x7'));var csv=require(_0x3af9('0x8'));var ejs=require(_0x3af9('0x9'));var fs=require('fs');var fs_extra=require(_0x3af9('0xa'));var _=require('lodash');var squel=require(_0x3af9('0xb'));var crypto=require('crypto');var jsforce=require(_0x3af9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3af9('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3af9('0xe'));var qs=require(_0x3af9('0xf'));var as=require(_0x3af9('0x10'));var hardwareService=require(_0x3af9('0x11'));var logger=require('../../config/logger')(_0x3af9('0x12'));var utils=require(_0x3af9('0x13'));var config=require(_0x3af9('0x14'));var licenseUtil=require(_0x3af9('0x15'));var db=require(_0x3af9('0x16'))['db'];function respondWithStatusCode(_0xfa1410,_0x212f63){_0x212f63=_0x212f63||0xcc;return function(_0xa7b81f){if(_0xa7b81f){return _0xfa1410['sendStatus'](_0x212f63);}return _0xfa1410[_0x3af9('0x17')](_0x212f63)['end']();};}function respondWithResult(_0x152254,_0x222b6f){_0x222b6f=_0x222b6f||0xc8;return function(_0x1e4ebb){if(_0x1e4ebb){return _0x152254['status'](_0x222b6f)[_0x3af9('0x18')](_0x1e4ebb);}};}function respondWithFilteredResult(_0x1088fc,_0x37cb8b){return function(_0x4b2845){if(_0x4b2845){var _0x278e80=typeof _0x37cb8b[_0x3af9('0x19')]===_0x3af9('0x1a')&&typeof _0x37cb8b[_0x3af9('0x1b')]==='undefined';var _0x1d3410=_0x4b2845[_0x3af9('0x1c')];var _0x298135=_0x278e80?0x0:_0x37cb8b[_0x3af9('0x19')];var _0x314df2=_0x278e80?_0x4b2845['count']:_0x37cb8b[_0x3af9('0x19')]+_0x37cb8b[_0x3af9('0x1b')];var _0x1f9214;if(_0x314df2>=_0x1d3410){_0x314df2=_0x1d3410;_0x1f9214=0xc8;}else{_0x1f9214=0xce;}_0x1088fc[_0x3af9('0x17')](_0x1f9214);return _0x1088fc[_0x3af9('0x1d')]('Content-Range',_0x298135+'-'+_0x314df2+'/'+_0x1d3410)[_0x3af9('0x18')](_0x4b2845);}return null;};}function patchUpdates(_0x34eb91){return function(_0x449349){try{jsonpatch[_0x3af9('0x1e')](_0x449349,_0x34eb91,!![]);}catch(_0x3c1793){return BPromise[_0x3af9('0x1f')](_0x3c1793);}return _0x449349['save']();};}function saveUpdates(_0x4a88ea,_0x505e25){return function(_0x5e24e3){if(_0x5e24e3){return _0x5e24e3['update'](_0x4a88ea)[_0x3af9('0x20')](function(_0x5c1c8f){return _0x5c1c8f;});}return null;};}function removeEntity(_0x74c872,_0x307f9d){return function(_0x4b5a5c){if(_0x4b5a5c){return _0x4b5a5c['destroy']()['then'](function(){var _0x119e85=_0x4b5a5c[_0x3af9('0x21')]({'plain':!![]});var _0x22965b=_0x3af9('0x22');return db[_0x3af9('0x23')][_0x3af9('0x24')]({'where':{'type':_0x22965b,'resourceId':_0x119e85['id']}})[_0x3af9('0x20')](function(){return _0x4b5a5c;});})[_0x3af9('0x20')](function(){_0x74c872['status'](0xcc)[_0x3af9('0x25')]();});}};}function handleEntityNotFound(_0x574b71,_0x485754){return function(_0x177650){if(!_0x177650){_0x574b71[_0x3af9('0x26')](0x194);}return _0x177650;};}function handleError(_0x19643f,_0xf8840){_0xf8840=_0xf8840||0x1f4;return function(_0x374382){logger['error'](_0x374382[_0x3af9('0x27')]);if(_0x374382[_0x3af9('0x28')]){delete _0x374382[_0x3af9('0x28')];}_0x19643f['status'](_0xf8840)['send'](_0x374382);};}exports[_0x3af9('0x29')]=function(_0x1d022d,_0x8867c6){var _0x540969={},_0x4186d5={},_0x115673={'count':0x0,'rows':[]};var _0x1c923d=_['map'](db[_0x3af9('0x2a')][_0x3af9('0x2b')],function(_0x407572){return{'name':_0x407572['fieldName'],'type':_0x407572[_0x3af9('0x2c')][_0x3af9('0x2d')]};});_0x4186d5[_0x3af9('0x2e')]=_['map'](_0x1c923d,_0x3af9('0x28'));_0x4186d5[_0x3af9('0x2f')]=_['keys'](_0x1d022d[_0x3af9('0x2f')]);_0x4186d5['filters']=_[_0x3af9('0x30')](_0x4186d5['model'],_0x4186d5['query']);_0x540969[_0x3af9('0x31')]=_['intersection'](_0x4186d5[_0x3af9('0x2e')],qs[_0x3af9('0x32')](_0x1d022d[_0x3af9('0x2f')]['fields']));_0x540969['attributes']=_0x540969[_0x3af9('0x31')][_0x3af9('0x33')]?_0x540969['attributes']:_0x4186d5['model'];if(!_0x1d022d[_0x3af9('0x2f')]['hasOwnProperty'](_0x3af9('0x34'))){_0x540969[_0x3af9('0x1b')]=qs['limit'](_0x1d022d['query'][_0x3af9('0x1b')]);_0x540969[_0x3af9('0x19')]=qs[_0x3af9('0x19')](_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x19')]);}_0x540969['order']=qs['sort'](_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x35')]);_0x540969[_0x3af9('0x36')]=qs[_0x3af9('0x37')](_['pick'](_0x1d022d['query'],_0x4186d5[_0x3af9('0x37')]),_0x1c923d);if(_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x38')]){_0x540969['where']=_[_0x3af9('0x39')](_0x540969[_0x3af9('0x36')],{'$or':_[_0x3af9('0x3a')](_0x1c923d,function(_0x576c86){if(_0x576c86[_0x3af9('0x2c')]!=='VIRTUAL'){var _0x1f3ac9={};_0x1f3ac9[_0x576c86[_0x3af9('0x28')]]={'$like':'%'+_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x38')]+'%'};return _0x1f3ac9;}})});}_0x540969=_[_0x3af9('0x39')]({},_0x540969,_0x1d022d[_0x3af9('0x3b')]);var _0x43fd62={'where':_0x540969[_0x3af9('0x36')]};return db[_0x3af9('0x2a')][_0x3af9('0x1c')](_0x43fd62)[_0x3af9('0x20')](function(_0x4d7bd4){_0x115673[_0x3af9('0x1c')]=_0x4d7bd4;if(_0x1d022d[_0x3af9('0x2f')][_0x3af9('0x3c')]){_0x540969[_0x3af9('0x3d')]=[{'all':!![]}];}return db[_0x3af9('0x2a')][_0x3af9('0x3e')](_0x540969);})[_0x3af9('0x20')](function(_0x384a61){_0x115673[_0x3af9('0x3f')]=_0x384a61;return _0x115673;})[_0x3af9('0x20')](respondWithFilteredResult(_0x8867c6,_0x540969))[_0x3af9('0x40')](handleError(_0x8867c6,null));};exports[_0x3af9('0x41')]=function(_0x549274,_0x542580){var _0x461dd6={'raw':!![],'where':{'id':_0x549274[_0x3af9('0x42')]['id']}},_0x1daea4={};_0x1daea4[_0x3af9('0x2e')]=_[_0x3af9('0x43')](db[_0x3af9('0x2a')][_0x3af9('0x2b')]);_0x1daea4[_0x3af9('0x2f')]=_[_0x3af9('0x43')](_0x549274[_0x3af9('0x2f')]);_0x1daea4[_0x3af9('0x37')]=_[_0x3af9('0x30')](_0x1daea4[_0x3af9('0x2e')],_0x1daea4['query']);_0x461dd6[_0x3af9('0x31')]=_[_0x3af9('0x30')](_0x1daea4[_0x3af9('0x2e')],qs[_0x3af9('0x32')](_0x549274['query']['fields']));_0x461dd6[_0x3af9('0x31')]=_0x461dd6['attributes'][_0x3af9('0x33')]?_0x461dd6[_0x3af9('0x31')]:_0x1daea4[_0x3af9('0x2e')];if(_0x549274[_0x3af9('0x2f')]['includeAll']){_0x461dd6[_0x3af9('0x3d')]=[{'all':!![]}];}_0x461dd6=_[_0x3af9('0x39')]({},_0x461dd6,_0x549274[_0x3af9('0x3b')]);return db['Tag']['find'](_0x461dd6)[_0x3af9('0x20')](handleEntityNotFound(_0x542580,null))['then'](respondWithResult(_0x542580,null))['catch'](handleError(_0x542580,null));};exports['create']=function(_0x19bd47,_0x3bc784){return db[_0x3af9('0x2a')][_0x3af9('0x44')](_0x19bd47[_0x3af9('0x45')],{})[_0x3af9('0x20')](function(_0x442681){var _0x48377b=_0x19bd47[_0x3af9('0x46')][_0x3af9('0x21')]({'plain':!![]});if(!_0x48377b)throw new Error(_0x3af9('0x47'));if(_0x48377b[_0x3af9('0x48')]===_0x3af9('0x46')){var _0x1104d4=_0x442681['get']({'plain':!![]});var _0x1b4509=_0x3af9('0x22');return db[_0x3af9('0x49')][_0x3af9('0x4a')]({'where':{'name':_0x1b4509,'userProfileId':_0x48377b['userProfileId']},'raw':!![]})[_0x3af9('0x20')](function(_0x39d954){if(_0x39d954&&_0x39d954[_0x3af9('0x4b')]===0x0){return db[_0x3af9('0x23')]['create']({'name':_0x1104d4[_0x3af9('0x28')],'resourceId':_0x1104d4['id'],'type':_0x39d954[_0x3af9('0x28')],'sectionId':_0x39d954['id']},{})[_0x3af9('0x20')](function(){return _0x442681;});}else{return _0x442681;}})[_0x3af9('0x40')](function(_0x4c75b6){logger['error'](_0x3af9('0x4c'),_0x4c75b6);throw _0x4c75b6;});}return _0x442681;})[_0x3af9('0x20')](respondWithResult(_0x3bc784,0xc9))[_0x3af9('0x40')](handleError(_0x3bc784,null));};exports[_0x3af9('0x4d')]=function(_0x3f087a,_0x268820){if(_0x3f087a[_0x3af9('0x45')]['id']){delete _0x3f087a[_0x3af9('0x45')]['id'];}return db[_0x3af9('0x2a')][_0x3af9('0x4a')]({'where':{'id':_0x3f087a[_0x3af9('0x42')]['id']}})['then'](handleEntityNotFound(_0x268820,null))[_0x3af9('0x20')](saveUpdates(_0x3f087a[_0x3af9('0x45')],null))['then'](respondWithResult(_0x268820,null))['catch'](handleError(_0x268820,null));};exports[_0x3af9('0x24')]=function(_0x4b205f,_0x27f717){return db[_0x3af9('0x2a')]['find']({'where':{'id':_0x4b205f['params']['id']}})[_0x3af9('0x20')](handleEntityNotFound(_0x27f717,null))[_0x3af9('0x20')](removeEntity(_0x27f717,null))[_0x3af9('0x40')](handleError(_0x27f717,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 9484a06..41e53bf 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 _0x03cf=['util','../../config/logger','bluebird','path','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x03cf,0x64));var _0xf03c=function(_0x45cf40,_0x4e7072){_0x45cf40=_0x45cf40-0x0;var _0x55b97c=_0x03cf[_0x45cf40];return _0x55b97c;};'use strict';var _=require('lodash');var util=require(_0xf03c('0x0'));var logger=require(_0xf03c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf03c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf03c('0x3'));var rimraf=require('rimraf');var config=require(_0xf03c('0x4'));var attributes=require(_0xf03c('0x5'));module[_0xf03c('0x6')]=function(_0x4c2af5,_0x11841d){return _0x4c2af5[_0xf03c('0x7')](_0xf03c('0x8'),attributes,{'tableName':_0xf03c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b8a=['define','Tag','tools_tags','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x3b20ff,_0xffb334){var _0x59adbe=function(_0x24000d){while(--_0x24000d){_0x3b20ff['push'](_0x3b20ff['shift']());}};_0x59adbe(++_0xffb334);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4b8a[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xa4b8('0x0'));var logger=require('../../config/logger')(_0xa4b8('0x1'));var moment=require(_0xa4b8('0x2'));var BPromise=require(_0xa4b8('0x3'));var rp=require(_0xa4b8('0x4'));var fs=require('fs');var path=require(_0xa4b8('0x5'));var rimraf=require(_0xa4b8('0x6'));var config=require(_0xa4b8('0x7'));var attributes=require(_0xa4b8('0x8'));module[_0xa4b8('0x9')]=function(_0x719605,_0x2c9e45){return _0x719605[_0xa4b8('0xa')](_0xa4b8('0xb'),attributes,{'tableName':_0xa4b8('0xc'),'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 fec11e0..509ddb9 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 _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x54657e,_0x4fd727){var _0x507c51=function(_0x3693c7){while(--_0x3693c7){_0x54657e['push'](_0x54657e['shift']());}};_0x507c51(++_0x4fd727);}(_0x8ce3,0xc3));var _0x38ce=function(_0x5cb4f0,_0xb16665){_0x5cb4f0=_0x5cb4f0-0x0;var _0x22208=_0x8ce3[_0x5cb4f0];return _0x22208;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('Tag,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});} \ No newline at end of file +var _0xf021=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','then','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Tag,\x20%s,\x20%s','result','catch'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xf021,0x18f));var _0x1f02=function(_0x42f3e4,_0x2646fd){_0x42f3e4=_0x42f3e4-0x0;var _0x1d7aa6=_0xf021[_0x42f3e4];return _0x1d7aa6;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var moment=require(_0x1f02('0x2'));var BPromise=require(_0x1f02('0x3'));var rs=require(_0x1f02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f02('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f02('0x6'))(_0x1f02('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f02('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x383d0b,_0x257d6a,_0x2a6c50){return new BPromise(function(_0x4193d2,_0x1f1cec){return client['request'](_0x383d0b,_0x2a6c50)[_0x1f02('0x9')](function(_0x5dc295){logger['info']('Tag,\x20%s,\x20%s',_0x257d6a,_0x1f02('0xa'));logger[_0x1f02('0xb')](_0x1f02('0xc'),_0x257d6a,_0x1f02('0xa'),JSON[_0x1f02('0xd')](_0x5dc295));if(_0x5dc295['error']){if(_0x5dc295[_0x1f02('0xe')][_0x1f02('0xf')]===0x1f4){logger[_0x1f02('0xe')]('Tag,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x1f1cec(_0x5dc295[_0x1f02('0xe')]['message']);}logger['error']('Tag,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x4193d2(_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);}else{logger[_0x1f02('0x11')](_0x1f02('0x12'),_0x257d6a,_0x1f02('0xa'));_0x4193d2(_0x5dc295[_0x1f02('0x13')]['message']);}})[_0x1f02('0x14')](function(_0x5cca16){logger['error']('Tag,\x20%s,\x20%s',_0x257d6a,_0x5cca16);_0x1f1cec(_0x5cca16);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index f722078..aa3d967 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 c2cb40b..6e0275c 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 _0xb10b=['name','sequelize','STRING'];(function(_0x4af3f7,_0x1764e5){var _0x1841ef=function(_0x5d004d){while(--_0x5d004d){_0x4af3f7['push'](_0x4af3f7['shift']());}};_0x1841ef(++_0x1764e5);}(_0xb10b,0x12a));var _0xbb10=function(_0x49d7c8,_0x52d9a3){_0x49d7c8=_0x49d7c8-0x0;var _0x450089=_0xb10b[_0x49d7c8];return _0x450089;};'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 +var _0x2032=['name','exports','STRING'];(function(_0xb2c53c,_0x1219a7){var _0x236ceb=function(_0x5079d4){while(--_0x5079d4){_0xb2c53c['push'](_0xb2c53c['shift']());}};_0x236ceb(++_0x1219a7);}(_0x2032,0xd9));var _0x2203=function(_0x3ce70a,_0x344283){_0x3ce70a=_0x3ce70a-0x0;var _0x1d962d=_0x2032[_0x3ce70a];return _0x1d962d;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index f172c14..7439a33 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 _0x2d33=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','body','destroy','sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','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','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','end','getQueues','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','isValidChannel','add','capitalize','ids','remove','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','spread','removeAgents','Mail','transaction','Queue:remove','findOne','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x86527a,_0x2787c6){var _0x2f14b6=function(_0x4f1613){while(--_0x4f1613){_0x86527a['push'](_0x86527a['shift']());}};_0x2f14b6(++_0x2787c6);}(_0x2d33,0x12c));var _0x32d3=function(_0x2375f2,_0x4ca4e5){_0x2375f2=_0x2375f2-0x0;var _0x448a6f=_0x2d33[_0x2375f2];return _0x448a6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32d3('0x0'));var zipdir=require(_0x32d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32d3('0x2'));var moment=require('moment');var BPromise=require(_0x32d3('0x3'));var Mustache=require(_0x32d3('0x4'));var util=require(_0x32d3('0x5'));var path=require(_0x32d3('0x6'));var sox=require(_0x32d3('0x7'));var csv=require('to-csv');var ejs=require(_0x32d3('0x8'));var fs=require('fs');var fs_extra=require(_0x32d3('0x9'));var _=require(_0x32d3('0xa'));var squel=require(_0x32d3('0xb'));var crypto=require(_0x32d3('0xc'));var jsforce=require(_0x32d3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x32d3('0xe'));var Papa=require(_0x32d3('0xf'));var Redis=require(_0x32d3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x32d3('0x11'));var as=require(_0x32d3('0x12'));var hardwareService=require(_0x32d3('0x13'));var logger=require(_0x32d3('0x14'))(_0x32d3('0x15'));var utils=require(_0x32d3('0x16'));var config=require(_0x32d3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x32d3('0x18'))['db'];config['redis']=_[_0x32d3('0x19')](config[_0x32d3('0x1a')],{'host':_0x32d3('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32d3('0x1a')]));require(_0x32d3('0x1c'))[_0x32d3('0x1d')](socket);function respondWithStatusCode(_0x4e5b11,_0x4588bc){_0x4588bc=_0x4588bc||0xcc;return function(_0x41a711){if(_0x41a711){return _0x4e5b11[_0x32d3('0x1e')](_0x4588bc);}return _0x4e5b11[_0x32d3('0x1f')](_0x4588bc)['end']();};}function respondWithResult(_0xec3534,_0x588b95){_0x588b95=_0x588b95||0xc8;return function(_0x3a03b2){if(_0x3a03b2){return _0xec3534[_0x32d3('0x1f')](_0x588b95)[_0x32d3('0x20')](_0x3a03b2);}};}function respondWithFilteredResult(_0x81996d,_0x3cf638){return function(_0x4b5337){if(_0x4b5337){var _0x5c5c19=typeof _0x3cf638[_0x32d3('0x21')]===_0x32d3('0x22')&&typeof _0x3cf638[_0x32d3('0x23')]===_0x32d3('0x22');var _0x1b5132=_0x4b5337[_0x32d3('0x24')];var _0x2cc8a3=_0x5c5c19?0x0:_0x3cf638[_0x32d3('0x21')];var _0x51325c=_0x5c5c19?_0x4b5337['count']:_0x3cf638[_0x32d3('0x21')]+_0x3cf638[_0x32d3('0x23')];var _0x12b1a3;if(_0x51325c>=_0x1b5132){_0x51325c=_0x1b5132;_0x12b1a3=0xc8;}else{_0x12b1a3=0xce;}_0x81996d[_0x32d3('0x1f')](_0x12b1a3);return _0x81996d['set'](_0x32d3('0x25'),_0x2cc8a3+'-'+_0x51325c+'/'+_0x1b5132)[_0x32d3('0x20')](_0x4b5337);}return null;};}function patchUpdates(_0x56b58c){return function(_0x130651){try{jsonpatch[_0x32d3('0x26')](_0x130651,_0x56b58c,!![]);}catch(_0x4ad7dd){return BPromise[_0x32d3('0x27')](_0x4ad7dd);}return _0x130651[_0x32d3('0x28')]();};}function saveUpdates(_0xb72f01,_0x379206){return function(_0x4149fa){if(_0x4149fa){return _0x4149fa[_0x32d3('0x29')](_0xb72f01)[_0x32d3('0x2a')](function(_0x4bc6c7){return _0x4bc6c7;});}return null;};}function handleEntityNotFound(_0xbe69af,_0x179f12){return function(_0x34af96){if(!_0x34af96){_0xbe69af[_0x32d3('0x1e')](0x194);}return _0x34af96;};}function handleError(_0x1fd933,_0x31b72b){_0x31b72b=_0x31b72b||0x1f4;return function(_0x2d65a6){logger[_0x32d3('0x2b')](_0x2d65a6[_0x32d3('0x2c')]);if(_0x2d65a6[_0x32d3('0x2d')]){delete _0x2d65a6[_0x32d3('0x2d')];}_0x1fd933[_0x32d3('0x1f')](_0x31b72b)[_0x32d3('0x2e')](_0x2d65a6);};}exports['index']=function(_0x1c3f98,_0x25231b){var _0x1ae6eb={},_0x19f4c5={},_0x2558f9={'count':0x0,'rows':[]};var _0x2a0e1c=_[_0x32d3('0x2f')](db[_0x32d3('0x30')][_0x32d3('0x31')],function(_0x469fe2){return{'name':_0x469fe2[_0x32d3('0x32')],'type':_0x469fe2[_0x32d3('0x33')][_0x32d3('0x34')]};});_0x19f4c5[_0x32d3('0x35')]=_[_0x32d3('0x2f')](_0x2a0e1c,_0x32d3('0x2d'));_0x19f4c5[_0x32d3('0x36')]=_[_0x32d3('0x37')](_0x1c3f98[_0x32d3('0x36')]);_0x19f4c5[_0x32d3('0x38')]=_[_0x32d3('0x39')](_0x19f4c5[_0x32d3('0x35')],_0x19f4c5[_0x32d3('0x36')]);_0x1ae6eb[_0x32d3('0x3a')]=_[_0x32d3('0x39')](_0x19f4c5[_0x32d3('0x35')],qs[_0x32d3('0x3b')](_0x1c3f98[_0x32d3('0x36')]['fields']));_0x1ae6eb[_0x32d3('0x3a')]=_0x1ae6eb[_0x32d3('0x3a')][_0x32d3('0x3c')]?_0x1ae6eb[_0x32d3('0x3a')]:_0x19f4c5['model'];if(!_0x1c3f98[_0x32d3('0x36')][_0x32d3('0x3d')](_0x32d3('0x3e'))){_0x1ae6eb[_0x32d3('0x23')]=qs[_0x32d3('0x23')](_0x1c3f98[_0x32d3('0x36')][_0x32d3('0x23')]);_0x1ae6eb['offset']=qs[_0x32d3('0x21')](_0x1c3f98['query'][_0x32d3('0x21')]);}_0x1ae6eb[_0x32d3('0x3f')]=qs['sort'](_0x1c3f98['query'][_0x32d3('0x40')]);_0x1ae6eb[_0x32d3('0x41')]=qs[_0x32d3('0x38')](_[_0x32d3('0x42')](_0x1c3f98['query'],_0x19f4c5[_0x32d3('0x38')]),_0x2a0e1c);if(_0x1c3f98[_0x32d3('0x36')]['filter']){_0x1ae6eb['where']=_[_0x32d3('0x43')](_0x1ae6eb['where'],{'$or':_[_0x32d3('0x2f')](_0x2a0e1c,function(_0x53408e){if(_0x53408e[_0x32d3('0x33')]!==_0x32d3('0x44')){var _0x15070e={};_0x15070e[_0x53408e[_0x32d3('0x2d')]]={'$like':'%'+_0x1c3f98[_0x32d3('0x36')][_0x32d3('0x45')]+'%'};return _0x15070e;}})});}_0x1ae6eb=_['merge']({},_0x1ae6eb,_0x1c3f98['options']);var _0x1762b9={'where':_0x1ae6eb[_0x32d3('0x41')]};return db['Team'][_0x32d3('0x24')](_0x1762b9)[_0x32d3('0x2a')](function(_0x906c9e){_0x2558f9[_0x32d3('0x24')]=_0x906c9e;if(_0x1c3f98[_0x32d3('0x36')][_0x32d3('0x46')]){_0x1ae6eb[_0x32d3('0x47')]=[{'all':!![]}];}return db[_0x32d3('0x30')]['findAll'](_0x1ae6eb);})[_0x32d3('0x2a')](function(_0x33e638){_0x2558f9[_0x32d3('0x48')]=_0x33e638;return _0x2558f9;})[_0x32d3('0x2a')](respondWithFilteredResult(_0x25231b,_0x1ae6eb))[_0x32d3('0x49')](handleError(_0x25231b,null));};exports[_0x32d3('0x4a')]=function(_0x1daf0a,_0x3971a2){var _0x2d476a={'raw':![],'where':{'id':_0x1daf0a[_0x32d3('0x4b')]['id']}},_0x3a0f16={};_0x3a0f16[_0x32d3('0x35')]=_[_0x32d3('0x37')](db[_0x32d3('0x30')]['rawAttributes']);_0x3a0f16[_0x32d3('0x36')]=_['keys'](_0x1daf0a[_0x32d3('0x36')]);_0x3a0f16['filters']=_[_0x32d3('0x39')](_0x3a0f16[_0x32d3('0x35')],_0x3a0f16[_0x32d3('0x36')]);_0x2d476a['attributes']=_[_0x32d3('0x39')](_0x3a0f16['model'],qs[_0x32d3('0x3b')](_0x1daf0a['query'][_0x32d3('0x3b')]));_0x2d476a[_0x32d3('0x3a')]=_0x2d476a[_0x32d3('0x3a')][_0x32d3('0x3c')]?_0x2d476a[_0x32d3('0x3a')]:_0x3a0f16['model'];if(_0x1daf0a['query'][_0x32d3('0x46')]){_0x2d476a['include']=[{'all':!![]}];}_0x2d476a=_[_0x32d3('0x43')]({},_0x2d476a,_0x1daf0a[_0x32d3('0x4c')]);return db['Team']['find'](_0x2d476a)['then'](handleEntityNotFound(_0x3971a2,null))[_0x32d3('0x2a')](respondWithResult(_0x3971a2,null))[_0x32d3('0x49')](handleError(_0x3971a2,null));};exports['create']=function(_0x100075,_0x37ab88){return db['Team'][_0x32d3('0x4d')](_0x100075['body'],{})['then'](function(_0x29acab){var _0xd367a7=_0x100075[_0x32d3('0x4e')][_0x32d3('0x4f')]({'plain':!![]});if(!_0xd367a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd367a7[_0x32d3('0x50')]===_0x32d3('0x4e')){var _0x4afdb7=_0x29acab[_0x32d3('0x4f')]({'plain':!![]});var _0x46ee03='Teams';return db[_0x32d3('0x51')][_0x32d3('0x52')]({'where':{'name':_0x46ee03,'userProfileId':_0xd367a7[_0x32d3('0x53')]},'raw':!![]})[_0x32d3('0x2a')](function(_0x1d87cd){if(_0x1d87cd&&_0x1d87cd[_0x32d3('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4afdb7['name'],'resourceId':_0x4afdb7['id'],'type':_0x1d87cd[_0x32d3('0x2d')],'sectionId':_0x1d87cd['id']},{})['then'](function(){return _0x29acab;});}else{return _0x29acab;}})[_0x32d3('0x49')](function(_0x32b1c6){logger[_0x32d3('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32b1c6);throw _0x32b1c6;});}return _0x29acab;})[_0x32d3('0x2a')](respondWithResult(_0x37ab88,0xc9))['catch'](handleError(_0x37ab88,null));};exports[_0x32d3('0x29')]=function(_0x480a76,_0xcb9c24){if(_0x480a76[_0x32d3('0x55')]['id']){delete _0x480a76[_0x32d3('0x55')]['id'];}return db[_0x32d3('0x30')][_0x32d3('0x52')]({'where':{'id':_0x480a76[_0x32d3('0x4b')]['id']}})[_0x32d3('0x2a')](handleEntityNotFound(_0xcb9c24,null))['then'](saveUpdates(_0x480a76[_0x32d3('0x55')],null))['then'](respondWithResult(_0xcb9c24,null))[_0x32d3('0x49')](handleError(_0xcb9c24,null));};exports[_0x32d3('0x56')]=function(_0x38846d,_0x413a61){var _0x59ea84=_0x38846d[_0x32d3('0x4b')]['id'];var _0x25f2c3=[];return db[_0x32d3('0x57')]['transaction'](function(_0x3b2386){var _0x29aa80='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x59ea84;return db['sequelize'][_0x32d3('0x36')](_0x29aa80,{'type':db['Sequelize'][_0x32d3('0x58')][_0x32d3('0x59')],'raw':!![],'transaction':_0x3b2386})['then'](function(_0x10ab86){_0x25f2c3=_[_0x32d3('0x2f')](_0x10ab86,function(_0x372b8f){return Number(_0x372b8f[_0x32d3('0x5a')]);});})[_0x32d3('0x2a')](function(){var _0x157ac1=_0x32d3('0x5b')+_0x59ea84;return db[_0x32d3('0x57')][_0x32d3('0x36')](_0x157ac1,{'type':db[_0x32d3('0x5c')][_0x32d3('0x58')]['SELECT'],'raw':!![],'transaction':_0x3b2386});})['then'](function(_0x219854){var _0x496812=_['map'](_0x219854,function(_0x40a344){return Number(_0x40a344[_0x32d3('0x5d')]);});return db['UserVoiceQueue'][_0x32d3('0x56')]({'where':{'UserId':{'$in':_0x25f2c3},'VoiceQueueId':{'$in':_0x496812}},'transaction':_0x3b2386});})['then'](function(){var _0x49abcf='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x59ea84;return db[_0x32d3('0x57')][_0x32d3('0x36')](_0x49abcf,{'type':db[_0x32d3('0x5c')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3b2386});})['then'](function(_0x34150b){var _0x51359b=_[_0x32d3('0x2f')](_0x34150b,function(_0x1502f9){return Number(_0x1502f9['MailQueueId']);});return db[_0x32d3('0x5e')][_0x32d3('0x56')]({'where':{'UserId':{'$in':_0x25f2c3},'MailQueueId':{'$in':_0x51359b}},'transaction':_0x3b2386});})['then'](function(){var _0x470258=_0x32d3('0x5f')+_0x59ea84;return db['sequelize'][_0x32d3('0x36')](_0x470258,{'type':db['Sequelize'][_0x32d3('0x58')]['SELECT'],'raw':!![],'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(_0x495bcd){var _0x494de6=_[_0x32d3('0x2f')](_0x495bcd,function(_0x531146){return Number(_0x531146['SmsQueueId']);});return db[_0x32d3('0x60')][_0x32d3('0x56')]({'where':{'UserId':{'$in':_0x25f2c3},'SmsQueueId':{'$in':_0x494de6}},'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(){var _0x36c77f=_0x32d3('0x61')+_0x59ea84;return db[_0x32d3('0x57')][_0x32d3('0x36')](_0x36c77f,{'type':db['Sequelize'][_0x32d3('0x58')][_0x32d3('0x59')],'raw':!![],'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(_0x939ed6){var _0x56b119=_[_0x32d3('0x2f')](_0x939ed6,function(_0x30d0da){return Number(_0x30d0da[_0x32d3('0x62')]);});return db[_0x32d3('0x63')][_0x32d3('0x56')]({'where':{'UserId':{'$in':_0x25f2c3},'ChatQueueId':{'$in':_0x56b119}},'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(){var _0x5d7316=_0x32d3('0x64')+_0x59ea84;return db[_0x32d3('0x57')]['query'](_0x5d7316,{'type':db[_0x32d3('0x5c')][_0x32d3('0x58')][_0x32d3('0x59')],'raw':!![],'transaction':_0x3b2386});})['then'](function(_0x176d14){var _0x4a1a96=_['map'](_0x176d14,function(_0x3bff99){return Number(_0x3bff99[_0x32d3('0x65')]);});return db[_0x32d3('0x66')][_0x32d3('0x56')]({'where':{'UserId':{'$in':_0x25f2c3},'FaxQueueId':{'$in':_0x4a1a96}},'transaction':_0x3b2386});})['then'](function(){var _0x4f7aba=_0x32d3('0x67')+_0x59ea84;return db[_0x32d3('0x57')][_0x32d3('0x36')](_0x4f7aba,{'type':db[_0x32d3('0x5c')][_0x32d3('0x58')][_0x32d3('0x59')],'raw':!![],'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(_0x16e2df){var _0x3ff940=_[_0x32d3('0x2f')](_0x16e2df,function(_0x1aecd9){return Number(_0x1aecd9['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x32d3('0x56')]({'where':{'UserId':{'$in':_0x25f2c3},'OpenchannelQueueId':{'$in':_0x3ff940}},'transaction':_0x3b2386});})['then'](function(){var _0x2f0174=_0x32d3('0x68')+_0x59ea84;return db['sequelize'][_0x32d3('0x36')](_0x2f0174,{'type':db[_0x32d3('0x5c')][_0x32d3('0x58')]['SELECT'],'raw':!![],'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(_0x4257f4){var _0x40834e=_['map'](_0x4257f4,function(_0xa1fb96){return Number(_0xa1fb96[_0x32d3('0x69')]);});return db[_0x32d3('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x25f2c3},'WhatsappQueueId':{'$in':_0x40834e}},'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(){return db[_0x32d3('0x6b')][_0x32d3('0x52')]({'where':{'TeamId':_0x59ea84}});})[_0x32d3('0x2a')](function(_0x23dbee){if(_0x23dbee===null){return;}return db[_0x32d3('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x25f2c3},'VoicePrefixId':_0x23dbee[_0x32d3('0x6d')]},'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(){return db[_0x32d3('0x30')][_0x32d3('0x56')]({'where':{'id':_0x59ea84},'cascade':!![],'transaction':_0x3b2386});})[_0x32d3('0x2a')](function(_0x2dcc99){if(_0x2dcc99===0x0){_0x413a61[_0x32d3('0x1e')](0x194);}else{return db[_0x32d3('0x6e')]['destroy']({'where':{'type':'Teams','resourceId':_0x59ea84},'cascade':!![],'transaction':_0x3b2386})[_0x32d3('0x2a')](function(){_0x413a61[_0x32d3('0x1f')](0xcc)[_0x32d3('0x6f')]();});}})[_0x32d3('0x49')](function(_0x237ae6){_0x413a61[_0x32d3('0x1f')](0x1f4)[_0x32d3('0x2e')](_0x237ae6);});});};exports[_0x32d3('0x70')]=function(_0x5f586c,_0x5101e5,_0x465068){return db[_0x32d3('0x30')]['findOne']({'where':{'id':_0x5f586c[_0x32d3('0x4b')]['id']}})[_0x32d3('0x2a')](handleEntityNotFound(_0x5101e5,null))['then'](function(_0x19eabf){if(!_0x5f586c[_0x32d3('0x36')][_0x32d3('0x71')]||!utils['isValidChannel'](_0x5f586c[_0x32d3('0x36')]['channel'])){throw new db[(_0x32d3('0x5c'))][(_0x32d3('0x72'))](_0x32d3('0x73'));}var _0x30e505={};var _0x40b055={};_0x40b055[_0x32d3('0x35')]=_[_0x32d3('0x37')](db[_['capitalize'](_0x5f586c[_0x32d3('0x36')][_0x32d3('0x71')][_0x32d3('0x74')]())+_0x32d3('0x75')][_0x32d3('0x31')]);_0x40b055[_0x32d3('0x36')]=_['keys'](_0x5f586c[_0x32d3('0x36')]);_0x40b055[_0x32d3('0x38')]=_[_0x32d3('0x39')](_0x40b055['model'],_0x40b055[_0x32d3('0x36')]);_0x30e505['attributes']=_['intersection'](_0x40b055[_0x32d3('0x35')],qs[_0x32d3('0x3b')](_0x5f586c[_0x32d3('0x36')]['fields']));_0x30e505[_0x32d3('0x3a')]=_0x30e505['attributes'][_0x32d3('0x3c')]?_0x30e505[_0x32d3('0x3a')]:_0x40b055[_0x32d3('0x35')];_0x30e505[_0x32d3('0x23')]=qs[_0x32d3('0x23')](_0x5f586c[_0x32d3('0x36')][_0x32d3('0x23')]);_0x30e505[_0x32d3('0x21')]=qs[_0x32d3('0x21')](_0x5f586c['query']['offset']);_0x30e505[_0x32d3('0x3f')]=qs[_0x32d3('0x40')](_0x5f586c[_0x32d3('0x36')][_0x32d3('0x40')]);_0x30e505[_0x32d3('0x41')]=qs['filters'](_[_0x32d3('0x42')](_0x5f586c[_0x32d3('0x36')],_0x40b055[_0x32d3('0x38')]));_0x30e505=_[_0x32d3('0x43')]({},_0x30e505,_0x5f586c[_0x32d3('0x4c')]);return _0x19eabf['get'+_['capitalize'](_0x5f586c[_0x32d3('0x36')][_0x32d3('0x71')]['toLowerCase']())+_0x32d3('0x76')](_0x30e505);})[_0x32d3('0x2a')](respondWithResult(_0x5101e5,null))[_0x32d3('0x49')](handleError(_0x5101e5,null));};exports[_0x32d3('0x77')]=function(_0x111c61,_0x39083c,_0x293066){return db[_0x32d3('0x30')]['findOne']({'where':{'id':_0x111c61['params']['id']}})['then'](function(_0x2ed702){if(_0x2ed702){if(!_0x111c61[_0x32d3('0x55')][_0x32d3('0x71')]||!utils[_0x32d3('0x78')](_0x111c61[_0x32d3('0x55')]['channel'])){throw new db[(_0x32d3('0x5c'))][(_0x32d3('0x72'))](_0x32d3('0x73'));}return _0x2ed702[_0x32d3('0x79')+_[_0x32d3('0x7a')](_0x111c61[_0x32d3('0x55')][_0x32d3('0x71')][_0x32d3('0x74')]())+_0x32d3('0x76')](_0x111c61['body'][_0x32d3('0x7b')]);}return null;})[_0x32d3('0x2a')](handleEntityNotFound(_0x39083c,null))[_0x32d3('0x2a')](respondWithStatusCode(_0x39083c,null))['catch'](handleError(_0x39083c,null));};exports['removeQueues']=function(_0x1c5f6d,_0x1abec1,_0x17a518){return db[_0x32d3('0x30')]['findOne']({'where':{'id':_0x1c5f6d[_0x32d3('0x4b')]['id']}})[_0x32d3('0x2a')](function(_0x31518b){if(_0x31518b){if(!_0x1c5f6d[_0x32d3('0x36')]['channel']||!utils['isValidChannel'](_0x1c5f6d[_0x32d3('0x36')][_0x32d3('0x71')])){throw new db[(_0x32d3('0x5c'))]['ValidationError']('Unknown\x20channel');}return _0x31518b[_0x32d3('0x7c')+_[_0x32d3('0x7a')](_0x1c5f6d[_0x32d3('0x36')][_0x32d3('0x71')][_0x32d3('0x74')]())+'Queues'](_0x1c5f6d['query'][_0x32d3('0x7b')]);}return null;})[_0x32d3('0x2a')](handleEntityNotFound(_0x1abec1,null))['then'](respondWithStatusCode(_0x1abec1,null))['catch'](handleError(_0x1abec1,null));};exports['addAgents']=function(_0x259ef6,_0x4a2c34){var _0x2e3017=_[_0x32d3('0x7d')](_0x259ef6[_0x32d3('0x55')][_0x32d3('0x7b')])?_0x259ef6[_0x32d3('0x55')][_0x32d3('0x7b')]:[_0x259ef6[_0x32d3('0x55')][_0x32d3('0x7b')]];var _0x1a4ee2=_0x259ef6[_0x32d3('0x4b')]['id'];return db['Team'][_0x32d3('0x52')]({'where':{'id':_0x1a4ee2}})['then'](handleEntityNotFound(_0x4a2c34,null))[_0x32d3('0x2a')](function(_0x619615){if(_0x619615){var _0xa894b7=[_0x32d3('0x7e'),_0x32d3('0x7f'),'Mail',_0x32d3('0x80'),_0x32d3('0x81'),_0x32d3('0x82'),_0x32d3('0x83')];return db[_0x32d3('0x57')]['transaction'](function(_0x51677b){var _0x466bbf=_[_0x32d3('0x2f')](_0xa894b7,function(_0xd568b2){var _0x13339d={'attributes':['id',_0x32d3('0x2d')]};if(_0xd568b2===_0x32d3('0x7e')){_0x13339d[_0x32d3('0x84')]={'attributes':['penalty']};}return _0x619615[_0x32d3('0x4f')+_0xd568b2+_0x32d3('0x76')](_0x13339d)[_0x32d3('0x2a')](function(_0x375d7e){var _0x4874ab=_['map'](_0x375d7e,function(_0x35d963){var _0x3473ff=_[_0x32d3('0x2f')](_0x2e3017,function(_0x43b162){var _0x5420fb={'where':{'UserId':_0x43b162,[_0xd568b2+_0x32d3('0x85')]:_0x35d963['id']},'transaction':_0x51677b};if(_0xd568b2===_0x32d3('0x7e')){_0x5420fb[_0x32d3('0x19')]={'penalty':_0x35d963[_0x32d3('0x86')][_0x32d3('0x87')]};}return db[_0x32d3('0x88')+_0xd568b2+'Queue'][_0x32d3('0x89')](_0x5420fb)[_0x32d3('0x2a')](function(){socket[_0x32d3('0x8a')]('user'+_0xd568b2+_0x32d3('0x8b'),{'UserId':_0x43b162,[_0xd568b2+'QueueId']:_0x35d963['id']});if(_0xd568b2!=='Voice'){return;}return db[_0x32d3('0x88')][_0x32d3('0x8c')]({'where':{'id':_0x2e3017,'online':0x1},'attributes':['id',_0x32d3('0x2d'),_0x32d3('0x8d'),_0x32d3('0x8e'),_0x32d3('0x8f')],'raw':!![]})[_0x32d3('0x2a')](function(_0xf79f16){var _0x56fa27=_[_0x32d3('0x2f')](_0xf79f16,function(_0xd84796){return db[_0x32d3('0x90')][_0x32d3('0x91')]({'membername':_0xd84796[_0x32d3('0x2d')],'UserId':_0xd84796['id'],'queue_name':_0x35d963[_0x32d3('0x2d')],'VoiceQueueId':_0x35d963['id'],'interface':_[_0x32d3('0x92')](_0xd84796[_0x32d3('0x8f')])?util[_0x32d3('0x93')](_0x32d3('0x94'),_0xd84796[_0x32d3('0x2d')]):_0xd84796[_0x32d3('0x8f')],'paused':_0xd84796[_0x32d3('0x8e')]||![],'penalty':_0x35d963[_0x32d3('0x86')][_0x32d3('0x87')]},{'transaction':_0x51677b});});return Promise[_0x32d3('0x95')](_0x56fa27);});});});return Promise[_0x32d3('0x95')](_0x3473ff);});return Promise[_0x32d3('0x95')](_0x4874ab);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1a4ee2}})[_0x32d3('0x2a')](function(_0x47f60d){if(_0x47f60d){var _0x18559b=_[_0x32d3('0x2f')](_0x2e3017,function(_0xd24b84){db[_0x32d3('0x6c')][_0x32d3('0x91')]({'UserId':_0xd24b84,'VoicePrefixId':_0x47f60d['VoicePrefixId']});});return Promise[_0x32d3('0x95')](_0x18559b);}});});});return Promise['all'](_0x466bbf)[_0x32d3('0x2a')](function(){return _0x619615[_0x32d3('0x96')](_0x2e3017,{'transaction':_0x51677b})[_0x32d3('0x97')](function(_0x1a0ea8){return _0x1a0ea8;});});});}})[_0x32d3('0x2a')](respondWithResult(_0x4a2c34,null))[_0x32d3('0x49')](handleError(_0x4a2c34,null));};exports[_0x32d3('0x98')]=function(_0x2e4b8b,_0xd57172){var _0x4ca9e7=_[_0x32d3('0x7d')](_0x2e4b8b[_0x32d3('0x36')][_0x32d3('0x7b')])?_0x2e4b8b[_0x32d3('0x36')][_0x32d3('0x7b')]:[_0x2e4b8b[_0x32d3('0x36')][_0x32d3('0x7b')]];var _0x3031a6=_0x2e4b8b[_0x32d3('0x4b')]['id'];return db[_0x32d3('0x30')][_0x32d3('0x52')]({'where':{'id':_0x3031a6}})[_0x32d3('0x2a')](handleEntityNotFound(_0xd57172,null))[_0x32d3('0x2a')](function(_0x318144){if(_0x318144){var _0x4d69ff=[_0x32d3('0x7e'),'Chat',_0x32d3('0x99'),_0x32d3('0x80'),_0x32d3('0x81'),_0x32d3('0x82'),_0x32d3('0x83')];return db[_0x32d3('0x57')][_0x32d3('0x9a')](function(_0x508922){var _0x36a4e1=_[_0x32d3('0x2f')](_0x4d69ff,function(_0x2230dd){var _0x5408f3={'attributes':['id','name']};return _0x318144['get'+_0x2230dd+_0x32d3('0x76')](_0x5408f3)[_0x32d3('0x2a')](function(_0x27422a){var _0x7f4d41=_['map'](_0x27422a,function(_0x1c4aba){return _0x1c4aba[_0x32d3('0x98')](_0x4ca9e7,{'transaction':_0x508922})[_0x32d3('0x2a')](function(){var _0x2a5225=_[_0x32d3('0x2f')](_0x4ca9e7,function(_0x103fe1){socket[_0x32d3('0x8a')](_0x32d3('0x4e')+_0x2230dd+_0x32d3('0x9b'),{'UserId':Number(_0x103fe1),[_0x2230dd+_0x32d3('0x85')]:_0x1c4aba['id']});if(_0x2230dd!==_0x32d3('0x7e')){return;}return db[_0x32d3('0x90')][_0x32d3('0x56')]({'where':{'VoiceQueueId':_0x1c4aba['id'],'UserId':_0x103fe1},'transaction':_0x508922});});return Promise[_0x32d3('0x95')](_0x2a5225);});});return Promise[_0x32d3('0x95')](_0x7f4d41);});});return Promise[_0x32d3('0x95')](_0x36a4e1)[_0x32d3('0x2a')](function(){return _0x318144[_0x32d3('0x98')](_0x4ca9e7,{'transaction':_0x508922});})[_0x32d3('0x2a')](function(){return db['TeamVoicePrefix'][_0x32d3('0x9c')]({'where':{'teamId':_0x3031a6}})[_0x32d3('0x2a')](function(_0x270e51){if(_0x270e51){var _0x1aa2c7=_[_0x32d3('0x2f')](_0x4ca9e7,function(_0x2fbfba){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x2fbfba,'VoicePrefixId':_0x270e51[_0x32d3('0x6d')]}});});return Promise[_0x32d3('0x95')](_0x1aa2c7);}});});});}})['then'](respondWithStatusCode(_0xd57172,null))[_0x32d3('0x49')](handleError(_0xd57172,null));};exports[_0x32d3('0x9d')]=function(_0x5d3fea,_0x5a706f,_0x249c22){var _0x2487fd={};var _0xf66d8f={};var _0x43cbee;var _0x42d293;return db[_0x32d3('0x30')]['findOne']({'where':{'id':_0x5d3fea[_0x32d3('0x4b')]['id']}})[_0x32d3('0x2a')](handleEntityNotFound(_0x5a706f,null))[_0x32d3('0x2a')](function(_0xd6f36){if(_0xd6f36){_0x43cbee=_0xd6f36;_0xf66d8f[_0x32d3('0x35')]=_['keys'](db[_0x32d3('0x88')][_0x32d3('0x31')]);_0xf66d8f[_0x32d3('0x36')]=_['keys'](_0x5d3fea[_0x32d3('0x36')]);_0xf66d8f[_0x32d3('0x38')]=_[_0x32d3('0x39')](_0xf66d8f['model'],_0xf66d8f['query']);_0x2487fd[_0x32d3('0x3a')]=_['intersection'](_0xf66d8f[_0x32d3('0x35')],qs['fields'](_0x5d3fea[_0x32d3('0x36')]['fields']));_0x2487fd['attributes']=_0x2487fd[_0x32d3('0x3a')][_0x32d3('0x3c')]?_0x2487fd['attributes']:_0xf66d8f[_0x32d3('0x35')];_0x2487fd[_0x32d3('0x3f')]=qs['sort'](_0x5d3fea[_0x32d3('0x36')]['sort']);_0x2487fd[_0x32d3('0x41')]=qs[_0x32d3('0x38')](_[_0x32d3('0x42')](_0x5d3fea[_0x32d3('0x36')],_0xf66d8f[_0x32d3('0x38')]));if(_0x5d3fea[_0x32d3('0x36')]['filter']){_0x2487fd[_0x32d3('0x41')]=_[_0x32d3('0x43')](_0x2487fd[_0x32d3('0x41')],{'$or':_[_0x32d3('0x2f')](_0x2487fd['attributes'],function(_0x158414){var _0x42faf3={};_0x42faf3[_0x158414]={'$like':'%'+_0x5d3fea['query']['filter']+'%'};return _0x42faf3;})});}_0x2487fd=_[_0x32d3('0x43')]({},_0x2487fd,_0x5d3fea['options']);return _0x43cbee['getAgents'](_0x2487fd);}})['then'](function(_0x4c8cce){if(_0x4c8cce){_0x42d293=_0x4c8cce['length'];if(!_0x5d3fea[_0x32d3('0x36')]['hasOwnProperty'](_0x32d3('0x3e'))){_0x2487fd[_0x32d3('0x23')]=qs[_0x32d3('0x23')](_0x5d3fea[_0x32d3('0x36')]['limit']);_0x2487fd['offset']=qs[_0x32d3('0x21')](_0x5d3fea[_0x32d3('0x36')]['offset']);}return _0x43cbee[_0x32d3('0x9d')](_0x2487fd);}})['then'](function(_0x7c0e5a){if(_0x7c0e5a){return _0x7c0e5a?{'count':_0x42d293,'rows':_0x7c0e5a}:null;}})[_0x32d3('0x2a')](respondWithResult(_0x5a706f,null))['catch'](handleError(_0x5a706f,null));}; \ No newline at end of file +var _0xbb58=['SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','VoicePrefixId','Teams','end','getQueues','findOne','channel','ValidationError','capitalize','Queue','toLowerCase','Queues','isValidChannel','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','user','findAll','online','voicePause','interface','upsert','isNil','all','TeamVoicePrefix','UserVoicePrefix','spread','Sms','removeAgents','emit','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue'];(function(_0x49b4cf,_0x264502){var _0x41f9a5=function(_0x4b4b46){while(--_0x4b4b46){_0x49b4cf['push'](_0x49b4cf['shift']());}};_0x41f9a5(++_0x264502);}(_0xbb58,0x16e));var _0x8bb5=function(_0x124914,_0x667007){_0x124914=_0x124914-0x0;var _0x5bcca8=_0xbb58[_0x124914];return _0x5bcca8;};'use strict';var emlformat=require(_0x8bb5('0x0'));var rimraf=require(_0x8bb5('0x1'));var zipdir=require(_0x8bb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bb5('0x3'));var moment=require(_0x8bb5('0x4'));var BPromise=require(_0x8bb5('0x5'));var Mustache=require(_0x8bb5('0x6'));var util=require(_0x8bb5('0x7'));var path=require(_0x8bb5('0x8'));var sox=require('sox');var csv=require(_0x8bb5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bb5('0xa'));var _=require(_0x8bb5('0xb'));var squel=require('squel');var crypto=require(_0x8bb5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8bb5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8bb5('0xe'));var Papa=require(_0x8bb5('0xf'));var Redis=require(_0x8bb5('0x10'));var authService=require(_0x8bb5('0x11'));var qs=require(_0x8bb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bb5('0x13'));var logger=require(_0x8bb5('0x14'))(_0x8bb5('0x15'));var utils=require(_0x8bb5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8bb5('0x17'));var db=require(_0x8bb5('0x18'))['db'];config['redis']=_[_0x8bb5('0x19')](config[_0x8bb5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8bb5('0x1b'))(new Redis(config[_0x8bb5('0x1a')]));require(_0x8bb5('0x1c'))['register'](socket);function respondWithStatusCode(_0x2006f0,_0x157ce5){_0x157ce5=_0x157ce5||0xcc;return function(_0xb67c7d){if(_0xb67c7d){return _0x2006f0['sendStatus'](_0x157ce5);}return _0x2006f0[_0x8bb5('0x1d')](_0x157ce5)['end']();};}function respondWithResult(_0x17f59c,_0xf77bf3){_0xf77bf3=_0xf77bf3||0xc8;return function(_0x17f7e2){if(_0x17f7e2){return _0x17f59c['status'](_0xf77bf3)['json'](_0x17f7e2);}};}function respondWithFilteredResult(_0x40ddab,_0x3082d8){return function(_0x229b3f){if(_0x229b3f){var _0xadd1a7=typeof _0x3082d8[_0x8bb5('0x1e')]===_0x8bb5('0x1f')&&typeof _0x3082d8[_0x8bb5('0x20')]===_0x8bb5('0x1f');var _0x56f1a5=_0x229b3f[_0x8bb5('0x21')];var _0x113436=_0xadd1a7?0x0:_0x3082d8['offset'];var _0x2602bc=_0xadd1a7?_0x229b3f['count']:_0x3082d8[_0x8bb5('0x1e')]+_0x3082d8['limit'];var _0x2bb3ae;if(_0x2602bc>=_0x56f1a5){_0x2602bc=_0x56f1a5;_0x2bb3ae=0xc8;}else{_0x2bb3ae=0xce;}_0x40ddab[_0x8bb5('0x1d')](_0x2bb3ae);return _0x40ddab['set'](_0x8bb5('0x22'),_0x113436+'-'+_0x2602bc+'/'+_0x56f1a5)[_0x8bb5('0x23')](_0x229b3f);}return null;};}function patchUpdates(_0x37df93){return function(_0x4ffeab){try{jsonpatch['apply'](_0x4ffeab,_0x37df93,!![]);}catch(_0x15b789){return BPromise[_0x8bb5('0x24')](_0x15b789);}return _0x4ffeab[_0x8bb5('0x25')]();};}function saveUpdates(_0x51469d,_0x443244){return function(_0x4b2fa6){if(_0x4b2fa6){return _0x4b2fa6[_0x8bb5('0x26')](_0x51469d)[_0x8bb5('0x27')](function(_0x3f0a25){return _0x3f0a25;});}return null;};}function handleEntityNotFound(_0x2b0b0b,_0x4d60ad){return function(_0x14fdb4){if(!_0x14fdb4){_0x2b0b0b[_0x8bb5('0x28')](0x194);}return _0x14fdb4;};}function handleError(_0x42513e,_0x3ee4fd){_0x3ee4fd=_0x3ee4fd||0x1f4;return function(_0x4406d3){logger[_0x8bb5('0x29')](_0x4406d3[_0x8bb5('0x2a')]);if(_0x4406d3['name']){delete _0x4406d3[_0x8bb5('0x2b')];}_0x42513e[_0x8bb5('0x1d')](_0x3ee4fd)['send'](_0x4406d3);};}exports['index']=function(_0x5b59af,_0x825ae5){var _0x339dc1={},_0x37e654={},_0x463fe0={'count':0x0,'rows':[]};var _0x1e805d=_[_0x8bb5('0x2c')](db[_0x8bb5('0x2d')][_0x8bb5('0x2e')],function(_0x3ba44f){return{'name':_0x3ba44f[_0x8bb5('0x2f')],'type':_0x3ba44f[_0x8bb5('0x30')][_0x8bb5('0x31')]};});_0x37e654[_0x8bb5('0x32')]=_[_0x8bb5('0x2c')](_0x1e805d,_0x8bb5('0x2b'));_0x37e654[_0x8bb5('0x33')]=_[_0x8bb5('0x34')](_0x5b59af[_0x8bb5('0x33')]);_0x37e654[_0x8bb5('0x35')]=_[_0x8bb5('0x36')](_0x37e654[_0x8bb5('0x32')],_0x37e654[_0x8bb5('0x33')]);_0x339dc1[_0x8bb5('0x37')]=_[_0x8bb5('0x36')](_0x37e654[_0x8bb5('0x32')],qs[_0x8bb5('0x38')](_0x5b59af[_0x8bb5('0x33')]['fields']));_0x339dc1[_0x8bb5('0x37')]=_0x339dc1[_0x8bb5('0x37')][_0x8bb5('0x39')]?_0x339dc1[_0x8bb5('0x37')]:_0x37e654['model'];if(!_0x5b59af['query']['hasOwnProperty']('nolimit')){_0x339dc1[_0x8bb5('0x20')]=qs[_0x8bb5('0x20')](_0x5b59af['query'][_0x8bb5('0x20')]);_0x339dc1[_0x8bb5('0x1e')]=qs[_0x8bb5('0x1e')](_0x5b59af[_0x8bb5('0x33')][_0x8bb5('0x1e')]);}_0x339dc1[_0x8bb5('0x3a')]=qs[_0x8bb5('0x3b')](_0x5b59af[_0x8bb5('0x33')][_0x8bb5('0x3b')]);_0x339dc1[_0x8bb5('0x3c')]=qs[_0x8bb5('0x35')](_[_0x8bb5('0x3d')](_0x5b59af['query'],_0x37e654[_0x8bb5('0x35')]),_0x1e805d);if(_0x5b59af['query'][_0x8bb5('0x3e')]){_0x339dc1[_0x8bb5('0x3c')]=_[_0x8bb5('0x3f')](_0x339dc1[_0x8bb5('0x3c')],{'$or':_[_0x8bb5('0x2c')](_0x1e805d,function(_0x31ec20){if(_0x31ec20[_0x8bb5('0x30')]!==_0x8bb5('0x40')){var _0x28187c={};_0x28187c[_0x31ec20[_0x8bb5('0x2b')]]={'$like':'%'+_0x5b59af['query'][_0x8bb5('0x3e')]+'%'};return _0x28187c;}})});}_0x339dc1=_['merge']({},_0x339dc1,_0x5b59af[_0x8bb5('0x41')]);var _0x38c008={'where':_0x339dc1[_0x8bb5('0x3c')]};return db[_0x8bb5('0x2d')][_0x8bb5('0x21')](_0x38c008)['then'](function(_0x909455){_0x463fe0[_0x8bb5('0x21')]=_0x909455;if(_0x5b59af[_0x8bb5('0x33')][_0x8bb5('0x42')]){_0x339dc1[_0x8bb5('0x43')]=[{'all':!![]}];}return db['Team']['findAll'](_0x339dc1);})['then'](function(_0x2829cc){_0x463fe0[_0x8bb5('0x44')]=_0x2829cc;return _0x463fe0;})[_0x8bb5('0x27')](respondWithFilteredResult(_0x825ae5,_0x339dc1))[_0x8bb5('0x45')](handleError(_0x825ae5,null));};exports[_0x8bb5('0x46')]=function(_0x244bbb,_0x3f9950){var _0x5b2e32={'raw':![],'where':{'id':_0x244bbb['params']['id']}},_0x5e6f5d={};_0x5e6f5d[_0x8bb5('0x32')]=_[_0x8bb5('0x34')](db['Team'][_0x8bb5('0x2e')]);_0x5e6f5d[_0x8bb5('0x33')]=_[_0x8bb5('0x34')](_0x244bbb['query']);_0x5e6f5d['filters']=_[_0x8bb5('0x36')](_0x5e6f5d[_0x8bb5('0x32')],_0x5e6f5d[_0x8bb5('0x33')]);_0x5b2e32[_0x8bb5('0x37')]=_['intersection'](_0x5e6f5d[_0x8bb5('0x32')],qs[_0x8bb5('0x38')](_0x244bbb['query'][_0x8bb5('0x38')]));_0x5b2e32['attributes']=_0x5b2e32['attributes'][_0x8bb5('0x39')]?_0x5b2e32[_0x8bb5('0x37')]:_0x5e6f5d[_0x8bb5('0x32')];if(_0x244bbb[_0x8bb5('0x33')][_0x8bb5('0x42')]){_0x5b2e32[_0x8bb5('0x43')]=[{'all':!![]}];}_0x5b2e32=_['merge']({},_0x5b2e32,_0x244bbb[_0x8bb5('0x41')]);return db[_0x8bb5('0x2d')][_0x8bb5('0x47')](_0x5b2e32)[_0x8bb5('0x27')](handleEntityNotFound(_0x3f9950,null))[_0x8bb5('0x27')](respondWithResult(_0x3f9950,null))['catch'](handleError(_0x3f9950,null));};exports['create']=function(_0x5a079e,_0xe6a27d){return db[_0x8bb5('0x2d')][_0x8bb5('0x48')](_0x5a079e[_0x8bb5('0x49')],{})[_0x8bb5('0x27')](function(_0x3eb0a1){var _0x3fc826=_0x5a079e['user']['get']({'plain':!![]});if(!_0x3fc826)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fc826['role']==='user'){var _0x5c0c05=_0x3eb0a1[_0x8bb5('0x4a')]({'plain':!![]});var _0x1606c3='Teams';return db[_0x8bb5('0x4b')]['find']({'where':{'name':_0x1606c3,'userProfileId':_0x3fc826[_0x8bb5('0x4c')]},'raw':!![]})[_0x8bb5('0x27')](function(_0x34c82a){if(_0x34c82a&&_0x34c82a[_0x8bb5('0x4d')]===0x0){return db[_0x8bb5('0x4e')]['create']({'name':_0x5c0c05[_0x8bb5('0x2b')],'resourceId':_0x5c0c05['id'],'type':_0x34c82a['name'],'sectionId':_0x34c82a['id']},{})[_0x8bb5('0x27')](function(){return _0x3eb0a1;});}else{return _0x3eb0a1;}})[_0x8bb5('0x45')](function(_0x1972e4){logger[_0x8bb5('0x29')](_0x8bb5('0x4f'),_0x1972e4);throw _0x1972e4;});}return _0x3eb0a1;})[_0x8bb5('0x27')](respondWithResult(_0xe6a27d,0xc9))[_0x8bb5('0x45')](handleError(_0xe6a27d,null));};exports['update']=function(_0x306048,_0xbf52fe){if(_0x306048[_0x8bb5('0x49')]['id']){delete _0x306048[_0x8bb5('0x49')]['id'];}return db[_0x8bb5('0x2d')]['find']({'where':{'id':_0x306048[_0x8bb5('0x50')]['id']}})[_0x8bb5('0x27')](handleEntityNotFound(_0xbf52fe,null))[_0x8bb5('0x27')](saveUpdates(_0x306048[_0x8bb5('0x49')],null))[_0x8bb5('0x27')](respondWithResult(_0xbf52fe,null))['catch'](handleError(_0xbf52fe,null));};exports[_0x8bb5('0x51')]=function(_0x278e15,_0x1417ce){var _0x2e7a14=_0x278e15[_0x8bb5('0x50')]['id'];var _0x11da7f=[];return db[_0x8bb5('0x52')][_0x8bb5('0x53')](function(_0x24abbd){var _0x4691de=_0x8bb5('0x54')+_0x2e7a14;return db[_0x8bb5('0x52')][_0x8bb5('0x33')](_0x4691de,{'type':db['Sequelize'][_0x8bb5('0x55')][_0x8bb5('0x56')],'raw':!![],'transaction':_0x24abbd})[_0x8bb5('0x27')](function(_0x5a20f1){_0x11da7f=_['map'](_0x5a20f1,function(_0x11a622){return Number(_0x11a622[_0x8bb5('0x57')]);});})[_0x8bb5('0x27')](function(){var _0x17fc7d=_0x8bb5('0x58')+_0x2e7a14;return db[_0x8bb5('0x52')]['query'](_0x17fc7d,{'type':db[_0x8bb5('0x59')][_0x8bb5('0x55')][_0x8bb5('0x56')],'raw':!![],'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(_0x2a558f){var _0x436cfe=_[_0x8bb5('0x2c')](_0x2a558f,function(_0xb94c97){return Number(_0xb94c97[_0x8bb5('0x5a')]);});return db['UserVoiceQueue'][_0x8bb5('0x51')]({'where':{'UserId':{'$in':_0x11da7f},'VoiceQueueId':{'$in':_0x436cfe}},'transaction':_0x24abbd});})['then'](function(){var _0x1e6cf5=_0x8bb5('0x5b')+_0x2e7a14;return db[_0x8bb5('0x52')][_0x8bb5('0x33')](_0x1e6cf5,{'type':db[_0x8bb5('0x59')][_0x8bb5('0x55')]['SELECT'],'raw':!![],'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(_0x55fdb8){var _0x21cc13=_[_0x8bb5('0x2c')](_0x55fdb8,function(_0xcc517){return Number(_0xcc517[_0x8bb5('0x5c')]);});return db[_0x8bb5('0x5d')][_0x8bb5('0x51')]({'where':{'UserId':{'$in':_0x11da7f},'MailQueueId':{'$in':_0x21cc13}},'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(){var _0x3ceb6b=_0x8bb5('0x5e')+_0x2e7a14;return db[_0x8bb5('0x52')][_0x8bb5('0x33')](_0x3ceb6b,{'type':db[_0x8bb5('0x59')][_0x8bb5('0x55')][_0x8bb5('0x56')],'raw':!![],'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(_0x10db1b){var _0x2c435a=_['map'](_0x10db1b,function(_0x455732){return Number(_0x455732['SmsQueueId']);});return db[_0x8bb5('0x5f')][_0x8bb5('0x51')]({'where':{'UserId':{'$in':_0x11da7f},'SmsQueueId':{'$in':_0x2c435a}},'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(){var _0x2547de=_0x8bb5('0x60')+_0x2e7a14;return db[_0x8bb5('0x52')][_0x8bb5('0x33')](_0x2547de,{'type':db[_0x8bb5('0x59')][_0x8bb5('0x55')][_0x8bb5('0x56')],'raw':!![],'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(_0x10bec6){var _0x12a73a=_[_0x8bb5('0x2c')](_0x10bec6,function(_0x2ecbb1){return Number(_0x2ecbb1[_0x8bb5('0x61')]);});return db[_0x8bb5('0x62')]['destroy']({'where':{'UserId':{'$in':_0x11da7f},'ChatQueueId':{'$in':_0x12a73a}},'transaction':_0x24abbd});})['then'](function(){var _0x22e502=_0x8bb5('0x63')+_0x2e7a14;return db[_0x8bb5('0x52')][_0x8bb5('0x33')](_0x22e502,{'type':db[_0x8bb5('0x59')][_0x8bb5('0x55')][_0x8bb5('0x56')],'raw':!![],'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(_0x5a454f){var _0x23bc05=_['map'](_0x5a454f,function(_0x447f50){return Number(_0x447f50[_0x8bb5('0x64')]);});return db[_0x8bb5('0x65')][_0x8bb5('0x51')]({'where':{'UserId':{'$in':_0x11da7f},'FaxQueueId':{'$in':_0x23bc05}},'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(){var _0x39138c=_0x8bb5('0x66')+_0x2e7a14;return db[_0x8bb5('0x52')]['query'](_0x39138c,{'type':db[_0x8bb5('0x59')][_0x8bb5('0x55')][_0x8bb5('0x56')],'raw':!![],'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(_0x518209){var _0x421eba=_['map'](_0x518209,function(_0x304bfe){return Number(_0x304bfe['OpenchannelQueueId']);});return db[_0x8bb5('0x67')][_0x8bb5('0x51')]({'where':{'UserId':{'$in':_0x11da7f},'OpenchannelQueueId':{'$in':_0x421eba}},'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(){var _0x219ec5=_0x8bb5('0x68')+_0x2e7a14;return db['sequelize']['query'](_0x219ec5,{'type':db[_0x8bb5('0x59')][_0x8bb5('0x55')][_0x8bb5('0x56')],'raw':!![],'transaction':_0x24abbd});})['then'](function(_0x1b06ac){var _0xdeb7f8=_['map'](_0x1b06ac,function(_0x2607d6){return Number(_0x2607d6[_0x8bb5('0x69')]);});return db[_0x8bb5('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x11da7f},'WhatsappQueueId':{'$in':_0xdeb7f8}},'transaction':_0x24abbd});})['then'](function(){return db['TeamVoicePrefix'][_0x8bb5('0x47')]({'where':{'TeamId':_0x2e7a14}});})[_0x8bb5('0x27')](function(_0x4a386a){if(_0x4a386a===null){return;}return db['UserVoicePrefix'][_0x8bb5('0x51')]({'where':{'UserId':{'$in':_0x11da7f},'VoicePrefixId':_0x4a386a[_0x8bb5('0x6b')]},'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(){return db[_0x8bb5('0x2d')][_0x8bb5('0x51')]({'where':{'id':_0x2e7a14},'cascade':!![],'transaction':_0x24abbd});})[_0x8bb5('0x27')](function(_0x326323){if(_0x326323===0x0){_0x1417ce[_0x8bb5('0x28')](0x194);}else{return db[_0x8bb5('0x4e')][_0x8bb5('0x51')]({'where':{'type':_0x8bb5('0x6c'),'resourceId':_0x2e7a14},'cascade':!![],'transaction':_0x24abbd})[_0x8bb5('0x27')](function(){_0x1417ce['status'](0xcc)[_0x8bb5('0x6d')]();});}})[_0x8bb5('0x45')](function(_0x652089){_0x1417ce[_0x8bb5('0x1d')](0x1f4)['send'](_0x652089);});});};exports[_0x8bb5('0x6e')]=function(_0x474cf7,_0x3185bb,_0x19e352){return db[_0x8bb5('0x2d')][_0x8bb5('0x6f')]({'where':{'id':_0x474cf7[_0x8bb5('0x50')]['id']}})['then'](handleEntityNotFound(_0x3185bb,null))[_0x8bb5('0x27')](function(_0x1cfe25){if(!_0x474cf7[_0x8bb5('0x33')][_0x8bb5('0x70')]||!utils['isValidChannel'](_0x474cf7[_0x8bb5('0x33')][_0x8bb5('0x70')])){throw new db[(_0x8bb5('0x59'))][(_0x8bb5('0x71'))]('Unknown\x20channel');}var _0xd9607c={};var _0x320bc1={};_0x320bc1[_0x8bb5('0x32')]=_[_0x8bb5('0x34')](db[_[_0x8bb5('0x72')](_0x474cf7[_0x8bb5('0x33')][_0x8bb5('0x70')]['toLowerCase']())+_0x8bb5('0x73')]['rawAttributes']);_0x320bc1[_0x8bb5('0x33')]=_['keys'](_0x474cf7[_0x8bb5('0x33')]);_0x320bc1[_0x8bb5('0x35')]=_[_0x8bb5('0x36')](_0x320bc1[_0x8bb5('0x32')],_0x320bc1['query']);_0xd9607c[_0x8bb5('0x37')]=_[_0x8bb5('0x36')](_0x320bc1['model'],qs[_0x8bb5('0x38')](_0x474cf7['query'][_0x8bb5('0x38')]));_0xd9607c[_0x8bb5('0x37')]=_0xd9607c['attributes'][_0x8bb5('0x39')]?_0xd9607c[_0x8bb5('0x37')]:_0x320bc1[_0x8bb5('0x32')];_0xd9607c['limit']=qs[_0x8bb5('0x20')](_0x474cf7[_0x8bb5('0x33')][_0x8bb5('0x20')]);_0xd9607c[_0x8bb5('0x1e')]=qs['offset'](_0x474cf7['query']['offset']);_0xd9607c[_0x8bb5('0x3a')]=qs['sort'](_0x474cf7[_0x8bb5('0x33')]['sort']);_0xd9607c[_0x8bb5('0x3c')]=qs[_0x8bb5('0x35')](_[_0x8bb5('0x3d')](_0x474cf7[_0x8bb5('0x33')],_0x320bc1[_0x8bb5('0x35')]));_0xd9607c=_[_0x8bb5('0x3f')]({},_0xd9607c,_0x474cf7[_0x8bb5('0x41')]);return _0x1cfe25['get'+_['capitalize'](_0x474cf7[_0x8bb5('0x33')][_0x8bb5('0x70')][_0x8bb5('0x74')]())+_0x8bb5('0x75')](_0xd9607c);})[_0x8bb5('0x27')](respondWithResult(_0x3185bb,null))[_0x8bb5('0x45')](handleError(_0x3185bb,null));};exports['addQueues']=function(_0x188591,_0x4b8a20,_0x4f1b8a){return db[_0x8bb5('0x2d')][_0x8bb5('0x6f')]({'where':{'id':_0x188591['params']['id']}})[_0x8bb5('0x27')](function(_0x1f4180){if(_0x1f4180){if(!_0x188591[_0x8bb5('0x49')][_0x8bb5('0x70')]||!utils[_0x8bb5('0x76')](_0x188591['body'][_0x8bb5('0x70')])){throw new db['Sequelize'][(_0x8bb5('0x71'))](_0x8bb5('0x77'));}return _0x1f4180[_0x8bb5('0x78')+_[_0x8bb5('0x72')](_0x188591[_0x8bb5('0x49')]['channel'][_0x8bb5('0x74')]())+_0x8bb5('0x75')](_0x188591[_0x8bb5('0x49')][_0x8bb5('0x79')]);}return null;})[_0x8bb5('0x27')](handleEntityNotFound(_0x4b8a20,null))[_0x8bb5('0x27')](respondWithStatusCode(_0x4b8a20,null))[_0x8bb5('0x45')](handleError(_0x4b8a20,null));};exports[_0x8bb5('0x7a')]=function(_0x36989a,_0x7e88d5,_0x5ed817){return db[_0x8bb5('0x2d')][_0x8bb5('0x6f')]({'where':{'id':_0x36989a[_0x8bb5('0x50')]['id']}})['then'](function(_0x14cf09){if(_0x14cf09){if(!_0x36989a['query']['channel']||!utils[_0x8bb5('0x76')](_0x36989a['query'][_0x8bb5('0x70')])){throw new db[(_0x8bb5('0x59'))][(_0x8bb5('0x71'))](_0x8bb5('0x77'));}return _0x14cf09[_0x8bb5('0x7b')+_[_0x8bb5('0x72')](_0x36989a[_0x8bb5('0x33')][_0x8bb5('0x70')][_0x8bb5('0x74')]())+_0x8bb5('0x75')](_0x36989a[_0x8bb5('0x33')][_0x8bb5('0x79')]);}return null;})[_0x8bb5('0x27')](handleEntityNotFound(_0x7e88d5,null))[_0x8bb5('0x27')](respondWithStatusCode(_0x7e88d5,null))[_0x8bb5('0x45')](handleError(_0x7e88d5,null));};exports[_0x8bb5('0x7c')]=function(_0x18031a,_0x2a93fa){var _0xb2451=_[_0x8bb5('0x7d')](_0x18031a[_0x8bb5('0x49')][_0x8bb5('0x79')])?_0x18031a[_0x8bb5('0x49')][_0x8bb5('0x79')]:[_0x18031a['body']['ids']];var _0x5e982d=_0x18031a[_0x8bb5('0x50')]['id'];return db[_0x8bb5('0x2d')]['find']({'where':{'id':_0x5e982d}})[_0x8bb5('0x27')](handleEntityNotFound(_0x2a93fa,null))[_0x8bb5('0x27')](function(_0x3d1b00){if(_0x3d1b00){var _0x2271dd=[_0x8bb5('0x7e'),_0x8bb5('0x7f'),_0x8bb5('0x80'),'Sms',_0x8bb5('0x81'),_0x8bb5('0x82'),_0x8bb5('0x83')];return db[_0x8bb5('0x52')]['transaction'](function(_0x56044b){var _0x5929e9=_[_0x8bb5('0x2c')](_0x2271dd,function(_0x20229d){var _0x16e1f3={'attributes':['id',_0x8bb5('0x2b')]};if(_0x20229d===_0x8bb5('0x7e')){_0x16e1f3[_0x8bb5('0x84')]={'attributes':[_0x8bb5('0x85')]};}return _0x3d1b00[_0x8bb5('0x4a')+_0x20229d+_0x8bb5('0x75')](_0x16e1f3)[_0x8bb5('0x27')](function(_0xbaf508){var _0x4ebcc9=_[_0x8bb5('0x2c')](_0xbaf508,function(_0x31eb1c){var _0x479f6f=_[_0x8bb5('0x2c')](_0xb2451,function(_0x53f715){var _0x4b1266={'where':{'UserId':_0x53f715,[_0x20229d+_0x8bb5('0x86')]:_0x31eb1c['id']},'transaction':_0x56044b};if(_0x20229d===_0x8bb5('0x7e')){_0x4b1266['defaults']={'penalty':_0x31eb1c[_0x8bb5('0x87')]['penalty']};}return db[_0x8bb5('0x88')+_0x20229d+'Queue'][_0x8bb5('0x89')](_0x4b1266)[_0x8bb5('0x27')](function(){socket['emit'](_0x8bb5('0x8a')+_0x20229d+'Queue:save',{'UserId':_0x53f715,[_0x20229d+_0x8bb5('0x86')]:_0x31eb1c['id']});if(_0x20229d!==_0x8bb5('0x7e')){return;}return db[_0x8bb5('0x88')][_0x8bb5('0x8b')]({'where':{'id':_0xb2451,'online':0x1},'attributes':['id','name',_0x8bb5('0x8c'),_0x8bb5('0x8d'),_0x8bb5('0x8e')],'raw':!![]})[_0x8bb5('0x27')](function(_0x4c1171){var _0x583413=_[_0x8bb5('0x2c')](_0x4c1171,function(_0x1e0abb){return db['UserVoiceQueueRt'][_0x8bb5('0x8f')]({'membername':_0x1e0abb['name'],'UserId':_0x1e0abb['id'],'queue_name':_0x31eb1c[_0x8bb5('0x2b')],'VoiceQueueId':_0x31eb1c['id'],'interface':_[_0x8bb5('0x90')](_0x1e0abb['interface'])?util['format']('SIP/%s',_0x1e0abb[_0x8bb5('0x2b')]):_0x1e0abb[_0x8bb5('0x8e')],'paused':_0x1e0abb[_0x8bb5('0x8d')]||![],'penalty':_0x31eb1c[_0x8bb5('0x87')][_0x8bb5('0x85')]},{'transaction':_0x56044b});});return Promise[_0x8bb5('0x91')](_0x583413);});});});return Promise['all'](_0x479f6f);});return Promise['all'](_0x4ebcc9);})['then'](function(){return db[_0x8bb5('0x92')][_0x8bb5('0x6f')]({'where':{'teamId':_0x5e982d}})[_0x8bb5('0x27')](function(_0x465990){if(_0x465990){var _0x1b2881=_[_0x8bb5('0x2c')](_0xb2451,function(_0x67bbf4){db[_0x8bb5('0x93')]['upsert']({'UserId':_0x67bbf4,'VoicePrefixId':_0x465990[_0x8bb5('0x6b')]});});return Promise[_0x8bb5('0x91')](_0x1b2881);}});});});return Promise[_0x8bb5('0x91')](_0x5929e9)[_0x8bb5('0x27')](function(){return _0x3d1b00[_0x8bb5('0x7c')](_0xb2451,{'transaction':_0x56044b})[_0x8bb5('0x94')](function(_0x51a1b8){return _0x51a1b8;});});});}})[_0x8bb5('0x27')](respondWithResult(_0x2a93fa,null))[_0x8bb5('0x45')](handleError(_0x2a93fa,null));};exports['removeAgents']=function(_0x53d20f,_0x3275dd){var _0x113604=_['isArray'](_0x53d20f[_0x8bb5('0x33')][_0x8bb5('0x79')])?_0x53d20f[_0x8bb5('0x33')][_0x8bb5('0x79')]:[_0x53d20f[_0x8bb5('0x33')][_0x8bb5('0x79')]];var _0x1e6ed8=_0x53d20f[_0x8bb5('0x50')]['id'];return db[_0x8bb5('0x2d')][_0x8bb5('0x47')]({'where':{'id':_0x1e6ed8}})[_0x8bb5('0x27')](handleEntityNotFound(_0x3275dd,null))['then'](function(_0x2b2ba2){if(_0x2b2ba2){var _0x279226=[_0x8bb5('0x7e'),'Chat','Mail',_0x8bb5('0x95'),_0x8bb5('0x81'),_0x8bb5('0x82'),_0x8bb5('0x83')];return db[_0x8bb5('0x52')][_0x8bb5('0x53')](function(_0x33c135){var _0x31e53b=_['map'](_0x279226,function(_0x1b8a1b){var _0x2d07b3={'attributes':['id','name']};return _0x2b2ba2[_0x8bb5('0x4a')+_0x1b8a1b+_0x8bb5('0x75')](_0x2d07b3)[_0x8bb5('0x27')](function(_0x256145){var _0x48aab4=_[_0x8bb5('0x2c')](_0x256145,function(_0xe80f8f){return _0xe80f8f[_0x8bb5('0x96')](_0x113604,{'transaction':_0x33c135})['then'](function(){var _0x541ebf=_[_0x8bb5('0x2c')](_0x113604,function(_0x58900d){socket[_0x8bb5('0x97')](_0x8bb5('0x8a')+_0x1b8a1b+_0x8bb5('0x98'),{'UserId':Number(_0x58900d),[_0x1b8a1b+_0x8bb5('0x86')]:_0xe80f8f['id']});if(_0x1b8a1b!==_0x8bb5('0x7e')){return;}return db[_0x8bb5('0x99')][_0x8bb5('0x51')]({'where':{'VoiceQueueId':_0xe80f8f['id'],'UserId':_0x58900d},'transaction':_0x33c135});});return Promise[_0x8bb5('0x91')](_0x541ebf);});});return Promise['all'](_0x48aab4);});});return Promise[_0x8bb5('0x91')](_0x31e53b)[_0x8bb5('0x27')](function(){return _0x2b2ba2[_0x8bb5('0x96')](_0x113604,{'transaction':_0x33c135});})[_0x8bb5('0x27')](function(){return db[_0x8bb5('0x92')][_0x8bb5('0x6f')]({'where':{'teamId':_0x1e6ed8}})[_0x8bb5('0x27')](function(_0x311788){if(_0x311788){var _0xa5195a=_[_0x8bb5('0x2c')](_0x113604,function(_0x266e1a){db['UserVoicePrefix'][_0x8bb5('0x51')]({'where':{'UserId':_0x266e1a,'VoicePrefixId':_0x311788[_0x8bb5('0x6b')]}});});return Promise[_0x8bb5('0x91')](_0xa5195a);}});});});}})[_0x8bb5('0x27')](respondWithStatusCode(_0x3275dd,null))['catch'](handleError(_0x3275dd,null));};exports['getAgents']=function(_0x546601,_0x1a4867,_0x585be4){var _0x116153={};var _0x402045={};var _0x3cf690;var _0xa16e78;return db[_0x8bb5('0x2d')][_0x8bb5('0x6f')]({'where':{'id':_0x546601[_0x8bb5('0x50')]['id']}})[_0x8bb5('0x27')](handleEntityNotFound(_0x1a4867,null))['then'](function(_0x5a50fd){if(_0x5a50fd){_0x3cf690=_0x5a50fd;_0x402045[_0x8bb5('0x32')]=_[_0x8bb5('0x34')](db['User'][_0x8bb5('0x2e')]);_0x402045['query']=_[_0x8bb5('0x34')](_0x546601[_0x8bb5('0x33')]);_0x402045[_0x8bb5('0x35')]=_[_0x8bb5('0x36')](_0x402045[_0x8bb5('0x32')],_0x402045[_0x8bb5('0x33')]);_0x116153['attributes']=_[_0x8bb5('0x36')](_0x402045['model'],qs['fields'](_0x546601[_0x8bb5('0x33')]['fields']));_0x116153[_0x8bb5('0x37')]=_0x116153[_0x8bb5('0x37')][_0x8bb5('0x39')]?_0x116153[_0x8bb5('0x37')]:_0x402045[_0x8bb5('0x32')];_0x116153['order']=qs[_0x8bb5('0x3b')](_0x546601[_0x8bb5('0x33')][_0x8bb5('0x3b')]);_0x116153[_0x8bb5('0x3c')]=qs[_0x8bb5('0x35')](_[_0x8bb5('0x3d')](_0x546601[_0x8bb5('0x33')],_0x402045[_0x8bb5('0x35')]));if(_0x546601[_0x8bb5('0x33')][_0x8bb5('0x3e')]){_0x116153[_0x8bb5('0x3c')]=_[_0x8bb5('0x3f')](_0x116153[_0x8bb5('0x3c')],{'$or':_[_0x8bb5('0x2c')](_0x116153[_0x8bb5('0x37')],function(_0x25121e){var _0xf1de49={};_0xf1de49[_0x25121e]={'$like':'%'+_0x546601[_0x8bb5('0x33')]['filter']+'%'};return _0xf1de49;})});}_0x116153=_[_0x8bb5('0x3f')]({},_0x116153,_0x546601[_0x8bb5('0x41')]);return _0x3cf690[_0x8bb5('0x9a')](_0x116153);}})[_0x8bb5('0x27')](function(_0x6af7e9){if(_0x6af7e9){_0xa16e78=_0x6af7e9[_0x8bb5('0x39')];if(!_0x546601['query']['hasOwnProperty']('nolimit')){_0x116153[_0x8bb5('0x20')]=qs[_0x8bb5('0x20')](_0x546601[_0x8bb5('0x33')][_0x8bb5('0x20')]);_0x116153[_0x8bb5('0x1e')]=qs[_0x8bb5('0x1e')](_0x546601['query']['offset']);}return _0x3cf690[_0x8bb5('0x9a')](_0x116153);}})[_0x8bb5('0x27')](function(_0x192288){if(_0x192288){return _0x192288?{'count':_0xa16e78,'rows':_0x192288}:null;}})[_0x8bb5('0x27')](respondWithResult(_0x1a4867,null))['catch'](handleError(_0x1a4867,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8e3c683..6fd88c4 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 _0x12d2=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','remove','emit'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x12d2,0x173));var _0x212d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x12d2[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x212d('0x0'));var Team=require(_0x212d('0x1'))['db'][_0x212d('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x212d('0x3')](0x0);var events={'afterCreate':_0x212d('0x4'),'afterUpdate':'update','afterDestroy':_0x212d('0x5')};function emitEvent(_0xcdae68){return function(_0x96609d,_0x16403c,_0x2a397c){TeamEvents[_0x212d('0x6')](_0xcdae68+':'+_0x96609d['id'],_0x96609d);TeamEvents[_0x212d('0x6')](_0xcdae68,_0x96609d);_0x2a397c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x212d('0x7')](e,emitEvent(event));}}module[_0x212d('0x8')]=TeamEvents; \ No newline at end of file +var _0x4dba=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','exports'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x4dba,0xe0));var _0xa4db=function(_0x37431f,_0x23f310){_0x37431f=_0x37431f-0x0;var _0x2e2e3e=_0x4dba[_0x37431f];return _0x2e2e3e;};'use strict';var EventEmitter=require('events');var Team=require(_0xa4db('0x0'))['db'][_0xa4db('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xa4db('0x2')](0x0);var events={'afterCreate':_0xa4db('0x3'),'afterUpdate':_0xa4db('0x4'),'afterDestroy':_0xa4db('0x5')};function emitEvent(_0x20440d){return function(_0x39bd59,_0x64826,_0x5657c3){TeamEvents['emit'](_0x20440d+':'+_0x39bd59['id'],_0x39bd59);TeamEvents[_0xa4db('0x6')](_0x20440d,_0x39bd59);_0x5657c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xa4db('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index fd32162..1b16100 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 _0x8889=['then','setDataValue','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','map','all','catch','lodash','./team.attributes','Queues'];(function(_0x2c112f,_0x2cefd1){var _0x4b14c7=function(_0x349461){while(--_0x349461){_0x2c112f['push'](_0x2c112f['shift']());}};_0x4b14c7(++_0x2cefd1);}(_0x8889,0x19f));var _0x9888=function(_0x22f3a8,_0x1b0dc4){_0x22f3a8=_0x22f3a8-0x0;var _0x1c0669=_0x8889[_0x22f3a8];return _0x1c0669;};'use strict';var _=require(_0x9888('0x0'));var attributes=require(_0x9888('0x1'));function getQueuesByChannel(_0x158dce,_0x4af005){var _0x2e15ca='get'+_0x4af005+_0x9888('0x2');return _0x158dce[_0x2e15ca]()[_0x9888('0x3')](function(_0x29dac5){return _['map'](_0x29dac5,function(_0x43575d){_0x43575d[_0x9888('0x4')]('channel',_0x4af005);return _0x43575d;});})['catch'](function(_0x4cc355){throw _0x4cc355;});}module[_0x9888('0x5')]=function(_0x100d9f){return _0x100d9f[_0x9888('0x6')](_0x9888('0x7'),attributes,{'tableName':_0x9888('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5f27e9=this;var _0x4475ec=[_0x9888('0x9'),_0x9888('0xa'),_0x9888('0xb'),_0x9888('0xc'),_0x9888('0xd'),_0x9888('0xe'),_0x9888('0xf')];return Promise['resolve']()[_0x9888('0x3')](function(){var _0x528c98=_[_0x9888('0x10')](_0x4475ec,function(_0x3bc014){return getQueuesByChannel(_0x5f27e9,_0x3bc014);});return Promise[_0x9888('0x11')](_0x528c98);})[_0x9888('0x12')](function(_0xab315a){throw _0xab315a;});}}});}; \ No newline at end of file +var _0xa92f=['channel','catch','exports','define','Team','teams','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','all','get','Queues','then'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa92f,0x1bd));var _0xfa92=function(_0x43eafe,_0x54931a){_0x43eafe=_0x43eafe-0x0;var _0x31e2ce=_0xa92f[_0x43eafe];return _0x31e2ce;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x18e343,_0x14e43f){var _0x557283=_0xfa92('0x0')+_0x14e43f+_0xfa92('0x1');return _0x18e343[_0x557283]()[_0xfa92('0x2')](function(_0x1a04cc){return _['map'](_0x1a04cc,function(_0x515400){_0x515400['setDataValue'](_0xfa92('0x3'),_0x14e43f);return _0x515400;});})[_0xfa92('0x4')](function(_0x57bab2){throw _0x57bab2;});}module[_0xfa92('0x5')]=function(_0x3219f5){return _0x3219f5[_0xfa92('0x6')](_0xfa92('0x7'),attributes,{'tableName':_0xfa92('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2d59d9=this;var _0x2d6e33=['Chat',_0xfa92('0x9'),_0xfa92('0xa'),_0xfa92('0xb'),_0xfa92('0xc'),_0xfa92('0xd'),_0xfa92('0xe')];return Promise['resolve']()['then'](function(){var _0x35e09f=_['map'](_0x2d6e33,function(_0x5303ac){return getQueuesByChannel(_0x2d59d9,_0x5303ac);});return Promise[_0xfa92('0xf')](_0x35e09f);})[_0xfa92('0x4')](function(_0x153d2a){throw _0x153d2a;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 15cb50e..c601964 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 _0x9182=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Team,\x20%s,\x20%s','result','lodash'];(function(_0x39699e,_0x4d3d3d){var _0x327553=function(_0x564f67){while(--_0x564f67){_0x39699e['push'](_0x39699e['shift']());}};_0x327553(++_0x4d3d3d);}(_0x9182,0xe7));var _0x2918=function(_0x594632,_0x46d012){_0x594632=_0x594632-0x0;var _0x182b69=_0x9182[_0x594632];return _0x182b69;};'use strict';var _=require(_0x2918('0x0'));var util=require('util');var moment=require(_0x2918('0x1'));var BPromise=require('bluebird');var rs=require(_0x2918('0x2'));var fs=require('fs');var Redis=require(_0x2918('0x3'));var db=require(_0x2918('0x4'))['db'];var utils=require(_0x2918('0x5'));var logger=require(_0x2918('0x6'))(_0x2918('0x7'));var config=require(_0x2918('0x8'));var jayson=require(_0x2918('0x9'));var client=jayson[_0x2918('0xa')][_0x2918('0xb')]({'port':0x232a});config[_0x2918('0xc')]=_[_0x2918('0xd')](config[_0x2918('0xc')],{'host':_0x2918('0xe'),'port':0x18eb});var socket=require(_0x2918('0xf'))(new Redis(config[_0x2918('0xc')]));require(_0x2918('0x10'))[_0x2918('0x11')](socket);function respondWithRpcPromise(_0x51d734,_0x532907,_0x373134){return new BPromise(function(_0x2cc7ef,_0x1c6f91){return client[_0x2918('0x12')](_0x51d734,_0x373134)[_0x2918('0x13')](function(_0x3f600e){logger[_0x2918('0x14')]('Team,\x20%s,\x20%s',_0x532907,'request\x20sent');logger[_0x2918('0x15')](_0x2918('0x16'),_0x532907,_0x2918('0x17'),JSON['stringify'](_0x3f600e));if(_0x3f600e['error']){if(_0x3f600e[_0x2918('0x18')][_0x2918('0x19')]===0x1f4){logger[_0x2918('0x18')]('Team,\x20%s,\x20%s',_0x532907,_0x3f600e['error']['message']);return _0x1c6f91(_0x3f600e[_0x2918('0x18')][_0x2918('0x1a')]);}logger[_0x2918('0x18')](_0x2918('0x1b'),_0x532907,_0x3f600e[_0x2918('0x18')]['message']);return _0x2cc7ef(_0x3f600e[_0x2918('0x18')][_0x2918('0x1a')]);}else{logger[_0x2918('0x14')]('Team,\x20%s,\x20%s',_0x532907,_0x2918('0x17'));_0x2cc7ef(_0x3f600e[_0x2918('0x1c')][_0x2918('0x1a')]);}})['catch'](function(_0x7741ca){logger['error']('Team,\x20%s,\x20%s',_0x532907,_0x7741ca);_0x1c6f91(_0x7741ca);});});} \ No newline at end of file +var _0xba1e=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x364bb6,_0x14f1d1){var _0x2cfb5e=function(_0x3fba3c){while(--_0x3fba3c){_0x364bb6['push'](_0x364bb6['shift']());}};_0x2cfb5e(++_0x14f1d1);}(_0xba1e,0x100));var _0xeba1=function(_0x5c43e1,_0x4c1705){_0x5c43e1=_0x5c43e1-0x0;var _0x397fa7=_0xba1e[_0x5c43e1];return _0x397fa7;};'use strict';var _=require(_0xeba1('0x0'));var util=require(_0xeba1('0x1'));var moment=require(_0xeba1('0x2'));var BPromise=require(_0xeba1('0x3'));var rs=require(_0xeba1('0x4'));var fs=require('fs');var Redis=require(_0xeba1('0x5'));var db=require(_0xeba1('0x6'))['db'];var utils=require(_0xeba1('0x7'));var logger=require(_0xeba1('0x8'))('rpc');var config=require(_0xeba1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeba1('0xa')][_0xeba1('0xb')]({'port':0x232a});config['redis']=_[_0xeba1('0xc')](config[_0xeba1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xeba1('0xe'))(new Redis(config[_0xeba1('0xd')]));require('./team.socket')[_0xeba1('0xf')](socket);function respondWithRpcPromise(_0x14b8bc,_0x5ac446,_0x498f14){return new BPromise(function(_0x1a863b,_0x53a038){return client[_0xeba1('0x10')](_0x14b8bc,_0x498f14)[_0xeba1('0x11')](function(_0x41d4a0){logger[_0xeba1('0x12')](_0xeba1('0x13'),_0x5ac446,'request\x20sent');logger['debug'](_0xeba1('0x14'),_0x5ac446,_0xeba1('0x15'),JSON[_0xeba1('0x16')](_0x41d4a0));if(_0x41d4a0['error']){if(_0x41d4a0[_0xeba1('0x17')][_0xeba1('0x18')]===0x1f4){logger[_0xeba1('0x17')](_0xeba1('0x13'),_0x5ac446,_0x41d4a0[_0xeba1('0x17')]['message']);return _0x53a038(_0x41d4a0['error'][_0xeba1('0x19')]);}logger[_0xeba1('0x17')]('Team,\x20%s,\x20%s',_0x5ac446,_0x41d4a0[_0xeba1('0x17')][_0xeba1('0x19')]);return _0x1a863b(_0x41d4a0[_0xeba1('0x17')][_0xeba1('0x19')]);}else{logger['info'](_0xeba1('0x13'),_0x5ac446,_0xeba1('0x15'));_0x1a863b(_0x41d4a0[_0xeba1('0x1a')]['message']);}})[_0xeba1('0x1b')](function(_0x4815b5){logger[_0xeba1('0x17')](_0xeba1('0x13'),_0x5ac446,_0x4815b5);_0x53a038(_0x4815b5);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 01fd610..28ed4fd 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 _0x2391=['emit','removeListener','register','length','team:','remove','update'];(function(_0x3d1091,_0x39d0c8){var _0xcb3411=function(_0x383cba){while(--_0x383cba){_0x3d1091['push'](_0x3d1091['shift']());}};_0xcb3411(++_0x39d0c8);}(_0x2391,0xc9));var _0x1239=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x2391[_0xae7c2f];return _0x5d7001;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x1239('0x0'),_0x1239('0x1')];function createListener(_0x217d1b,_0x5741a0){return function(_0x13cd10){_0x5741a0[_0x1239('0x2')](_0x217d1b,_0x13cd10);};}function removeListener(_0x56555d,_0x644534){return function(){TeamEvents[_0x1239('0x3')](_0x56555d,_0x644534);};}exports[_0x1239('0x4')]=function(_0x4c05e2){for(var _0x9d510d=0x0,_0x2481a5=events[_0x1239('0x5')];_0x9d510d<_0x2481a5;_0x9d510d++){var _0x4c59a6=events[_0x9d510d];var _0x13764d=createListener(_0x1239('0x6')+_0x4c59a6,_0x4c05e2);TeamEvents['on'](_0x4c59a6,_0x13764d);}}; \ No newline at end of file +var _0x4af8=['emit','removeListener','length'];(function(_0x239193,_0x1585ef){var _0x4f51c3=function(_0x8eba2c){while(--_0x8eba2c){_0x239193['push'](_0x239193['shift']());}};_0x4f51c3(++_0x1585ef);}(_0x4af8,0x1ad));var _0x84af=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x4af8[_0x3635ce];return _0x97ecd0;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove','update'];function createListener(_0x10d2d2,_0xd9cfa1){return function(_0x1b876a){_0xd9cfa1[_0x84af('0x0')](_0x10d2d2,_0x1b876a);};}function removeListener(_0x482825,_0x294e04){return function(){TeamEvents[_0x84af('0x1')](_0x482825,_0x294e04);};}exports['register']=function(_0x37c4f9){for(var _0x3971f1=0x0,_0x550ee6=events[_0x84af('0x2')];_0x3971f1<_0x550ee6;_0x3971f1++){var _0x294bc8=events[_0x3971f1];var _0x483ecc=createListener('team:'+_0x294bc8,_0x37c4f9);TeamEvents['on'](_0x294bc8,_0x483ecc);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index bea2d01..fe826d8 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 _0xf6e8=['INTEGER','exports'];(function(_0x1a20ec,_0x27626c){var _0x3a2ec1=function(_0xb45d54){while(--_0xb45d54){_0x1a20ec['push'](_0x1a20ec['shift']());}};_0x3a2ec1(++_0x27626c);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x7f735,_0x53458f){_0x7f735=_0x7f735-0x0;var _0x5407c4=_0xf6e8[_0x7f735];return _0x5407c4;};'use strict';var Sequelize=require('sequelize');module[_0x8f6e('0x0')]={'TeamId':{'type':Sequelize[_0x8f6e('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x8f6e('0x1')]}}; \ No newline at end of file +var _0xf8aa=['INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf8aa,0x13b));var _0xaf8a=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xf8aa[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0xaf8a('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xaf8a('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 6ccbe2b..761b553 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 _0x0c19=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x0c19,0xf5));var _0x90c1=function(_0x2853b5,_0x3c8901){_0x2853b5=_0x2853b5-0x0;var _0x4604e5=_0x0c19[_0x2853b5];return _0x4604e5;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var logger=require(_0x90c1('0x2'))(_0x90c1('0x3'));var moment=require(_0x90c1('0x4'));var BPromise=require(_0x90c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90c1('0x6'));var rimraf=require(_0x90c1('0x7'));var config=require(_0x90c1('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0x90c1('0x9')]=function(_0xb605b6,_0x5434a1){return _0xb605b6[_0x90c1('0xa')](_0x90c1('0xb'),attributes,{'tableName':_0x90c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5269=['lodash','bluebird','request-promise','path','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x3460bb,_0x1320ba){var _0x56143a=function(_0x2537d3){while(--_0x2537d3){_0x3460bb['push'](_0x3460bb['shift']());}};_0x56143a(++_0x1320ba);}(_0x5269,0x150));var _0x9526=function(_0x42ca2c,_0x1822a6){_0x42ca2c=_0x42ca2c-0x0;var _0x4aa52a=_0x5269[_0x42ca2c];return _0x4aa52a;};'use strict';var _=require(_0x9526('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9526('0x1'));var rp=require(_0x9526('0x2'));var fs=require('fs');var path=require(_0x9526('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9526('0x4'));module['exports']=function(_0x15d394,_0x9cf5eb){return _0x15d394[_0x9526('0x5')](_0x9526('0x6'),attributes,{'tableName':_0x9526('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index f98e55e..ffde8e5 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3c39cb,_0x26f36e){var _0x248dd4=function(_0x299109){while(--_0x299109){_0x3c39cb['push'](_0x3c39cb['shift']());}};_0x248dd4(++_0x26f36e);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x13a459,_0x38fff4){var _0x58a81b=function(_0x1071bd){while(--_0x1071bd){_0x13a459['push'](_0x13a459['shift']());}};_0x58a81b(++_0x38fff4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 384b589..9768bae 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 _0x70f2=['exports'];(function(_0x442d5d,_0x248943){var _0x46ae86=function(_0x3d5f6f){while(--_0x3d5f6f){_0x442d5d['push'](_0x442d5d['shift']());}};_0x46ae86(++_0x248943);}(_0x70f2,0xb1));var _0x270f=function(_0x1f7626,_0x155ba1){_0x1f7626=_0x1f7626-0x0;var _0x3a672c=_0x70f2[_0x1f7626];return _0x3a672c;};'use strict';var Sequelize=require('sequelize');module[_0x270f('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x26f3=['INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26f3,0xe5));var _0x326f=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0x26f3[_0x529059];return _0x156bc2;};'use strict';var Sequelize=require(_0x326f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x326f('0x1')],'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 bac1fe5..b7c5cc8 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 _0x2bdb=['bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','../../config/logger','moment'];(function(_0x86c707,_0x11a9fb){var _0x11e132=function(_0x15968c){while(--_0x15968c){_0x86c707['push'](_0x86c707['shift']());}};_0x11e132(++_0x11a9fb);}(_0x2bdb,0x105));var _0xb2bd=function(_0x23774a,_0x4a5bed){_0x23774a=_0x23774a-0x0;var _0x29c41c=_0x2bdb[_0x23774a];return _0x29c41c;};'use strict';var _=require(_0xb2bd('0x0'));var util=require('util');var logger=require(_0xb2bd('0x1'))('api');var moment=require(_0xb2bd('0x2'));var BPromise=require(_0xb2bd('0x3'));var rp=require(_0xb2bd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2bd('0x5'));var config=require(_0xb2bd('0x6'));var attributes=require(_0xb2bd('0x7'));module[_0xb2bd('0x8')]=function(_0x461137,_0x2ef40b){return _0x461137[_0xb2bd('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0xb2bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79d8=['../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1d2d2c,_0x169b43){var _0xba3e4d=function(_0x181e0){while(--_0x181e0){_0x1d2d2c['push'](_0x1d2d2c['shift']());}};_0xba3e4d(++_0x169b43);}(_0x79d8,0x67));var _0x879d=function(_0x5dcd27,_0x419fbd){_0x5dcd27=_0x5dcd27-0x0;var _0x2c03a9=_0x79d8[_0x5dcd27];return _0x2c03a9;};'use strict';var _=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var logger=require(_0x879d('0x2'))(_0x879d('0x3'));var moment=require('moment');var BPromise=require(_0x879d('0x4'));var rp=require(_0x879d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879d('0x6'));var config=require(_0x879d('0x7'));var attributes=require(_0x879d('0x8'));module['exports']=function(_0x2d578e,_0x46ed21){return _0x2d578e[_0x879d('0x9')](_0x879d('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 41d4ae5..4482b21 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 _0x6953=['catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6953,0x91));var _0x3695=function(_0x415e6a,_0x283706){_0x415e6a=_0x415e6a-0x0;var _0x2d87d6=_0x6953[_0x415e6a];return _0x2d87d6;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3695('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3695('0x3'));var logger=require(_0x3695('0x4'))(_0x3695('0x5'));var config=require('../../config/environment');var jayson=require(_0x3695('0x6'));var client=jayson['client'][_0x3695('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14eb32,_0x912099,_0x1a4e75){return new BPromise(function(_0x301e46,_0x4e337b){return client[_0x3695('0x8')](_0x14eb32,_0x1a4e75)['then'](function(_0x1fcd43){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x912099,_0x3695('0x9'));logger['debug'](_0x3695('0xa'),_0x912099,_0x3695('0x9'),JSON[_0x3695('0xb')](_0x1fcd43));if(_0x1fcd43[_0x3695('0xc')]){if(_0x1fcd43[_0x3695('0xc')][_0x3695('0xd')]===0x1f4){logger['error'](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x4e337b(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}logger[_0x3695('0xc')](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x301e46(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}else{logger['info'](_0x3695('0xe'),_0x912099,_0x3695('0x9'));_0x301e46(_0x1fcd43[_0x3695('0x10')][_0x3695('0xf')]);}})[_0x3695('0x11')](function(_0x1973ee){logger[_0x3695('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x912099,_0x1973ee);_0x4e337b(_0x1973ee);});});} \ No newline at end of file +var _0xeed7=['code','TeamVoiceQueue,\x20%s,\x20%s','message','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x164e37,_0x5af1a7){var _0x279bc7=function(_0x3b560b){while(--_0x3b560b){_0x164e37['push'](_0x164e37['shift']());}};_0x279bc7(++_0x5af1a7);}(_0xeed7,0xdf));var _0x7eed=function(_0xf8cba6,_0x47a68d){_0xf8cba6=_0xf8cba6-0x0;var _0x189dbb=_0xeed7[_0xf8cba6];return _0x189dbb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7eed('0x0'));var BPromise=require(_0x7eed('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7eed('0x2'));var db=require(_0x7eed('0x3'))['db'];var utils=require(_0x7eed('0x4'));var logger=require(_0x7eed('0x5'))('rpc');var config=require(_0x7eed('0x6'));var jayson=require(_0x7eed('0x7'));var client=jayson['client'][_0x7eed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50ab76,_0x3438fa,_0x518cea){return new BPromise(function(_0x5847fd,_0x37c0af){return client[_0x7eed('0x9')](_0x50ab76,_0x518cea)[_0x7eed('0xa')](function(_0x4c8fa7){logger[_0x7eed('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3438fa,'request\x20sent');logger[_0x7eed('0xc')](_0x7eed('0xd'),_0x3438fa,_0x7eed('0xe'),JSON[_0x7eed('0xf')](_0x4c8fa7));if(_0x4c8fa7[_0x7eed('0x10')]){if(_0x4c8fa7[_0x7eed('0x10')][_0x7eed('0x11')]===0x1f4){logger[_0x7eed('0x10')](_0x7eed('0x12'),_0x3438fa,_0x4c8fa7['error'][_0x7eed('0x13')]);return _0x37c0af(_0x4c8fa7[_0x7eed('0x10')][_0x7eed('0x13')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x3438fa,_0x4c8fa7[_0x7eed('0x10')][_0x7eed('0x13')]);return _0x5847fd(_0x4c8fa7[_0x7eed('0x10')][_0x7eed('0x13')]);}else{logger[_0x7eed('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3438fa,'request\x20sent');_0x5847fd(_0x4c8fa7['result'][_0x7eed('0x13')]);}})['catch'](function(_0x545ca9){logger['error'](_0x7eed('0x12'),_0x3438fa,_0x545ca9);_0x37c0af(_0x545ca9);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 0c1e4c7..df34720 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 _0x11f3=['put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','post','create'];(function(_0xc61a03,_0x5641a2){var _0x3c1db5=function(_0x353af9){while(--_0x353af9){_0xc61a03['push'](_0xc61a03['shift']());}};_0x3c1db5(++_0x5641a2);}(_0x11f3,0x149));var _0x311f=function(_0x4a4403,_0xb4d8b8){_0x4a4403=_0x4a4403-0x0;var _0x1c1e6c=_0x11f3[_0x4a4403];return _0x1c1e6c;};'use strict';var multer=require(_0x311f('0x0'));var util=require(_0x311f('0x1'));var path=require(_0x311f('0x2'));var timeout=require('connect-timeout');var express=require(_0x311f('0x3'));var router=express['Router']();var fs_extra=require(_0x311f('0x4'));var auth=require(_0x311f('0x5'));var interaction=require(_0x311f('0x6'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0x311f('0x7')]('/',auth['isAuthenticated'](),controller[_0x311f('0x8')]);router[_0x311f('0x7')](_0x311f('0x9'),auth[_0x311f('0xa')](),controller['show']);router[_0x311f('0xb')]('/',auth[_0x311f('0xa')](),controller[_0x311f('0xc')]);router[_0x311f('0xd')](_0x311f('0x9'),auth['isAuthenticated'](),controller[_0x311f('0xe')]);router[_0x311f('0xf')](_0x311f('0x9'),auth[_0x311f('0xa')](),controller[_0x311f('0x10')]);module[_0x311f('0x11')]=router; \ No newline at end of file +var _0x6333=['./template.controller','get','/:id','isAuthenticated','update','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x13f4a4,_0x123d34){var _0x4dc23f=function(_0x47caf4){while(--_0x47caf4){_0x13f4a4['push'](_0x13f4a4['shift']());}};_0x4dc23f(++_0x123d34);}(_0x6333,0x83));var _0x3633=function(_0x5f1940,_0x3326f8){_0x5f1940=_0x5f1940-0x0;var _0x5c967d=_0x6333[_0x5f1940];return _0x5c967d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3633('0x0'));var express=require('express');var router=express[_0x3633('0x1')]();var fs_extra=require(_0x3633('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3633('0x3'));var config=require('../../config/environment');var controller=require(_0x3633('0x4'));router[_0x3633('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3633('0x5')](_0x3633('0x6'),auth[_0x3633('0x7')](),controller['show']);router['post']('/',auth[_0x3633('0x7')](),controller['create']);router['put'](_0x3633('0x6'),auth[_0x3633('0x7')](),controller[_0x3633('0x8')]);router['delete'](_0x3633('0x6'),auth[_0x3633('0x7')](),controller['destroy']);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 2acdaa7..1587d32 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 _0x2cf6=['exports','STRING','TEXT'];(function(_0x1c8ffd,_0x15d571){var _0x27963c=function(_0x13bce2){while(--_0x13bce2){_0x1c8ffd['push'](_0x1c8ffd['shift']());}};_0x27963c(++_0x15d571);}(_0x2cf6,0xcf));var _0x62cf=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x2cf6[_0x37756b];return _0x46efec;};'use strict';var Sequelize=require('sequelize');module[_0x62cf('0x0')]={'name':{'type':Sequelize[_0x62cf('0x1')]},'description':{'type':Sequelize[_0x62cf('0x1')]},'html':{'type':Sequelize[_0x62cf('0x2')]}}; \ No newline at end of file +var _0x0251=['exports','STRING'];(function(_0x39bb41,_0x166e47){var _0x2d8051=function(_0x5c0fa7){while(--_0x5c0fa7){_0x39bb41['push'](_0x39bb41['shift']());}};_0x2d8051(++_0x166e47);}(_0x0251,0x1ee));var _0x1025=function(_0x2d39ce,_0x51170b){_0x2d39ce=_0x2d39ce-0x0;var _0x3361c7=_0x0251[_0x2d39ce];return _0x3361c7;};'use strict';var Sequelize=require('sequelize');module[_0x1025('0x0')]={'name':{'type':Sequelize[_0x1025('0x1')]},'description':{'type':Sequelize[_0x1025('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 418e801..af3641a 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 _0x412d=['json','apply','reject','save','update','then','destroy','get','Templates','error','name','send','index','map','Template','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','params','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x412d,0x11f));var _0xd412=function(_0x305456,_0x5a48d6){_0x305456=_0x305456-0x0;var _0x21a435=_0x412d[_0x305456];return _0x21a435;};'use strict';var emlformat=require(_0xd412('0x0'));var rimraf=require(_0xd412('0x1'));var zipdir=require(_0xd412('0x2'));var jsonpatch=require(_0xd412('0x3'));var rp=require(_0xd412('0x4'));var moment=require(_0xd412('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd412('0x6'));var sox=require(_0xd412('0x7'));var csv=require(_0xd412('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd412('0x9'));var squel=require('squel');var crypto=require(_0xd412('0xa'));var jsforce=require(_0xd412('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd412('0x8'));var querystring=require('querystring');var Papa=require(_0xd412('0xc'));var Redis=require(_0xd412('0xd'));var authService=require(_0xd412('0xe'));var qs=require(_0xd412('0xf'));var as=require(_0xd412('0x10'));var hardwareService=require(_0xd412('0x11'));var logger=require(_0xd412('0x12'))(_0xd412('0x13'));var utils=require('../../config/utils');var config=require(_0xd412('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a8c76,_0x597a4b){_0x597a4b=_0x597a4b||0xcc;return function(_0x2a01ed){if(_0x2a01ed){return _0x1a8c76[_0xd412('0x15')](_0x597a4b);}return _0x1a8c76[_0xd412('0x16')](_0x597a4b)[_0xd412('0x17')]();};}function respondWithResult(_0x155935,_0xfb565c){_0xfb565c=_0xfb565c||0xc8;return function(_0x5c3a08){if(_0x5c3a08){return _0x155935[_0xd412('0x16')](_0xfb565c)['json'](_0x5c3a08);}};}function respondWithFilteredResult(_0x57ada1,_0x3e66c4){return function(_0x56a603){if(_0x56a603){var _0x210efd=typeof _0x3e66c4[_0xd412('0x18')]===_0xd412('0x19')&&typeof _0x3e66c4[_0xd412('0x1a')]==='undefined';var _0x3b6fcf=_0x56a603[_0xd412('0x1b')];var _0xcc9a01=_0x210efd?0x0:_0x3e66c4[_0xd412('0x18')];var _0x3ff544=_0x210efd?_0x56a603[_0xd412('0x1b')]:_0x3e66c4[_0xd412('0x18')]+_0x3e66c4[_0xd412('0x1a')];var _0x784f22;if(_0x3ff544>=_0x3b6fcf){_0x3ff544=_0x3b6fcf;_0x784f22=0xc8;}else{_0x784f22=0xce;}_0x57ada1['status'](_0x784f22);return _0x57ada1[_0xd412('0x1c')]('Content-Range',_0xcc9a01+'-'+_0x3ff544+'/'+_0x3b6fcf)[_0xd412('0x1d')](_0x56a603);}return null;};}function patchUpdates(_0x542ea7){return function(_0x1ebb5a){try{jsonpatch[_0xd412('0x1e')](_0x1ebb5a,_0x542ea7,!![]);}catch(_0x2676fc){return BPromise[_0xd412('0x1f')](_0x2676fc);}return _0x1ebb5a[_0xd412('0x20')]();};}function saveUpdates(_0x299380,_0x7e43b8){return function(_0x353c99){if(_0x353c99){return _0x353c99[_0xd412('0x21')](_0x299380)[_0xd412('0x22')](function(_0x4d3ae1){return _0x4d3ae1;});}return null;};}function removeEntity(_0x4cdcc7,_0x227433){return function(_0x350fb6){if(_0x350fb6){return _0x350fb6[_0xd412('0x23')]()['then'](function(){var _0x5b680e=_0x350fb6[_0xd412('0x24')]({'plain':!![]});var _0x34cb29=_0xd412('0x25');return db['UserProfileResource'][_0xd412('0x23')]({'where':{'type':_0x34cb29,'resourceId':_0x5b680e['id']}})['then'](function(){return _0x350fb6;});})[_0xd412('0x22')](function(){_0x4cdcc7[_0xd412('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c434,_0x210cdc){return function(_0x3d200a){if(!_0x3d200a){_0x50c434[_0xd412('0x15')](0x194);}return _0x3d200a;};}function handleError(_0x5c770d,_0x516f2a){_0x516f2a=_0x516f2a||0x1f4;return function(_0xfc9794){logger[_0xd412('0x26')](_0xfc9794['stack']);if(_0xfc9794[_0xd412('0x27')]){delete _0xfc9794[_0xd412('0x27')];}_0x5c770d['status'](_0x516f2a)[_0xd412('0x28')](_0xfc9794);};}exports[_0xd412('0x29')]=function(_0x210f92,_0x14f0a5){var _0x14ab87={},_0xc37624={},_0x2b8e15={'count':0x0,'rows':[]};var _0xc5c669=_[_0xd412('0x2a')](db[_0xd412('0x2b')]['rawAttributes'],function(_0x56a4c4){return{'name':_0x56a4c4[_0xd412('0x2c')],'type':_0x56a4c4[_0xd412('0x2d')][_0xd412('0x2e')]};});_0xc37624[_0xd412('0x2f')]=_[_0xd412('0x2a')](_0xc5c669,_0xd412('0x27'));_0xc37624[_0xd412('0x30')]=_[_0xd412('0x31')](_0x210f92[_0xd412('0x30')]);_0xc37624[_0xd412('0x32')]=_[_0xd412('0x33')](_0xc37624['model'],_0xc37624[_0xd412('0x30')]);_0x14ab87['attributes']=_[_0xd412('0x33')](_0xc37624[_0xd412('0x2f')],qs['fields'](_0x210f92[_0xd412('0x30')][_0xd412('0x34')]));_0x14ab87['attributes']=_0x14ab87[_0xd412('0x35')]['length']?_0x14ab87[_0xd412('0x35')]:_0xc37624[_0xd412('0x2f')];if(!_0x210f92[_0xd412('0x30')][_0xd412('0x36')](_0xd412('0x37'))){_0x14ab87[_0xd412('0x1a')]=qs[_0xd412('0x1a')](_0x210f92[_0xd412('0x30')]['limit']);_0x14ab87[_0xd412('0x18')]=qs['offset'](_0x210f92['query'][_0xd412('0x18')]);}_0x14ab87[_0xd412('0x38')]=qs[_0xd412('0x39')](_0x210f92['query'][_0xd412('0x39')]);_0x14ab87[_0xd412('0x3a')]=qs[_0xd412('0x32')](_[_0xd412('0x3b')](_0x210f92['query'],_0xc37624[_0xd412('0x32')]),_0xc5c669);if(_0x210f92['query']['filter']){_0x14ab87['where']=_['merge'](_0x14ab87[_0xd412('0x3a')],{'$or':_[_0xd412('0x2a')](_0xc5c669,function(_0x314c25){if(_0x314c25[_0xd412('0x2d')]!==_0xd412('0x3c')){var _0x339a0f={};_0x339a0f[_0x314c25[_0xd412('0x27')]]={'$like':'%'+_0x210f92[_0xd412('0x30')][_0xd412('0x3d')]+'%'};return _0x339a0f;}})});}_0x14ab87=_[_0xd412('0x3e')]({},_0x14ab87,_0x210f92[_0xd412('0x3f')]);var _0x1a1deb={'where':_0x14ab87[_0xd412('0x3a')]};return db['Template'][_0xd412('0x1b')](_0x1a1deb)[_0xd412('0x22')](function(_0x48f245){_0x2b8e15[_0xd412('0x1b')]=_0x48f245;if(_0x210f92[_0xd412('0x30')]['includeAll']){_0x14ab87[_0xd412('0x40')]=[{'all':!![]}];}return db[_0xd412('0x2b')][_0xd412('0x41')](_0x14ab87);})[_0xd412('0x22')](function(_0x4f125c){_0x2b8e15['rows']=_0x4f125c;return _0x2b8e15;})[_0xd412('0x22')](respondWithFilteredResult(_0x14f0a5,_0x14ab87))['catch'](handleError(_0x14f0a5,null));};exports['show']=function(_0x11c4ef,_0x417c6b){var _0x13e5be={'raw':!![],'where':{'id':_0x11c4ef[_0xd412('0x42')]['id']}},_0x25372f={};_0x25372f['model']=_['keys'](db['Template']['rawAttributes']);_0x25372f['query']=_['keys'](_0x11c4ef[_0xd412('0x30')]);_0x25372f[_0xd412('0x32')]=_[_0xd412('0x33')](_0x25372f[_0xd412('0x2f')],_0x25372f['query']);_0x13e5be[_0xd412('0x35')]=_[_0xd412('0x33')](_0x25372f[_0xd412('0x2f')],qs[_0xd412('0x34')](_0x11c4ef[_0xd412('0x30')][_0xd412('0x34')]));_0x13e5be[_0xd412('0x35')]=_0x13e5be[_0xd412('0x35')][_0xd412('0x43')]?_0x13e5be[_0xd412('0x35')]:_0x25372f[_0xd412('0x2f')];if(_0x11c4ef[_0xd412('0x30')][_0xd412('0x44')]){_0x13e5be['include']=[{'all':!![]}];}_0x13e5be=_[_0xd412('0x3e')]({},_0x13e5be,_0x11c4ef[_0xd412('0x3f')]);return db[_0xd412('0x2b')][_0xd412('0x45')](_0x13e5be)['then'](handleEntityNotFound(_0x417c6b,null))[_0xd412('0x22')](respondWithResult(_0x417c6b,null))[_0xd412('0x46')](handleError(_0x417c6b,null));};exports[_0xd412('0x47')]=function(_0x371898,_0x5e08ee){return db[_0xd412('0x2b')][_0xd412('0x47')](_0x371898[_0xd412('0x48')],{})[_0xd412('0x22')](function(_0x1d723c){var _0x10754f=_0x371898['user'][_0xd412('0x24')]({'plain':!![]});if(!_0x10754f)throw new Error(_0xd412('0x49'));if(_0x10754f[_0xd412('0x4a')]===_0xd412('0x4b')){var _0x3b064a=_0x1d723c[_0xd412('0x24')]({'plain':!![]});var _0x43dd61=_0xd412('0x25');return db[_0xd412('0x4c')]['find']({'where':{'name':_0x43dd61,'userProfileId':_0x10754f[_0xd412('0x4d')]},'raw':!![]})[_0xd412('0x22')](function(_0x1ebfa0){if(_0x1ebfa0&&_0x1ebfa0['autoAssociation']===0x0){return db[_0xd412('0x4e')][_0xd412('0x47')]({'name':_0x3b064a['name'],'resourceId':_0x3b064a['id'],'type':_0x1ebfa0[_0xd412('0x27')],'sectionId':_0x1ebfa0['id']},{})[_0xd412('0x22')](function(){return _0x1d723c;});}else{return _0x1d723c;}})[_0xd412('0x46')](function(_0x53556f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53556f);throw _0x53556f;});}return _0x1d723c;})[_0xd412('0x22')](respondWithResult(_0x5e08ee,0xc9))[_0xd412('0x46')](handleError(_0x5e08ee,null));};exports[_0xd412('0x21')]=function(_0x52e028,_0x3dac47){if(_0x52e028[_0xd412('0x48')]['id']){delete _0x52e028[_0xd412('0x48')]['id'];}return db[_0xd412('0x2b')][_0xd412('0x45')]({'where':{'id':_0x52e028[_0xd412('0x42')]['id']}})[_0xd412('0x22')](handleEntityNotFound(_0x3dac47,null))['then'](saveUpdates(_0x52e028[_0xd412('0x48')],null))[_0xd412('0x22')](respondWithResult(_0x3dac47,null))['catch'](handleError(_0x3dac47,null));};exports[_0xd412('0x23')]=function(_0x4cb2eb,_0x469661){return db[_0xd412('0x2b')][_0xd412('0x45')]({'where':{'id':_0x4cb2eb[_0xd412('0x42')]['id']}})[_0xd412('0x22')](handleEntityNotFound(_0x469661,null))['then'](removeEntity(_0x469661,null))[_0xd412('0x46')](handleError(_0x469661,null));}; \ No newline at end of file +var _0xd160=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','rawAttributes','include','find','catch','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','get','Templates','UserProfileResource','destroy','error','stack','name','send','map','Template','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x5465fc,_0x5be834){var _0x12991c=function(_0x3e97f7){while(--_0x3e97f7){_0x5465fc['push'](_0x5465fc['shift']());}};_0x12991c(++_0x5be834);}(_0xd160,0x1aa));var _0x0d16=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0xd160[_0x590a38];return _0xf36626;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d16('0x0'));var zipdir=require(_0x0d16('0x1'));var jsonpatch=require(_0x0d16('0x2'));var rp=require(_0x0d16('0x3'));var moment=require(_0x0d16('0x4'));var BPromise=require(_0x0d16('0x5'));var Mustache=require(_0x0d16('0x6'));var util=require(_0x0d16('0x7'));var path=require(_0x0d16('0x8'));var sox=require('sox');var csv=require(_0x0d16('0x9'));var ejs=require(_0x0d16('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d16('0xb'));var squel=require('squel');var crypto=require(_0x0d16('0xc'));var jsforce=require(_0x0d16('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0d16('0x9'));var querystring=require(_0x0d16('0xe'));var Papa=require('papaparse');var Redis=require(_0x0d16('0xf'));var authService=require(_0x0d16('0x10'));var qs=require(_0x0d16('0x11'));var as=require(_0x0d16('0x12'));var hardwareService=require(_0x0d16('0x13'));var logger=require(_0x0d16('0x14'))(_0x0d16('0x15'));var utils=require(_0x0d16('0x16'));var config=require(_0x0d16('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d16('0x18'))['db'];function respondWithStatusCode(_0x57f08b,_0x111297){_0x111297=_0x111297||0xcc;return function(_0x466ac6){if(_0x466ac6){return _0x57f08b[_0x0d16('0x19')](_0x111297);}return _0x57f08b[_0x0d16('0x1a')](_0x111297)[_0x0d16('0x1b')]();};}function respondWithResult(_0x1f22e7,_0x1bda77){_0x1bda77=_0x1bda77||0xc8;return function(_0x3d9ecd){if(_0x3d9ecd){return _0x1f22e7[_0x0d16('0x1a')](_0x1bda77)[_0x0d16('0x1c')](_0x3d9ecd);}};}function respondWithFilteredResult(_0x4d9a32,_0x3be84d){return function(_0x494599){if(_0x494599){var _0x47f075=typeof _0x3be84d['offset']==='undefined'&&typeof _0x3be84d[_0x0d16('0x1d')]==='undefined';var _0x29fd2e=_0x494599[_0x0d16('0x1e')];var _0x2cd746=_0x47f075?0x0:_0x3be84d[_0x0d16('0x1f')];var _0x42ba83=_0x47f075?_0x494599[_0x0d16('0x1e')]:_0x3be84d[_0x0d16('0x1f')]+_0x3be84d[_0x0d16('0x1d')];var _0x2d9f8f;if(_0x42ba83>=_0x29fd2e){_0x42ba83=_0x29fd2e;_0x2d9f8f=0xc8;}else{_0x2d9f8f=0xce;}_0x4d9a32[_0x0d16('0x1a')](_0x2d9f8f);return _0x4d9a32[_0x0d16('0x20')](_0x0d16('0x21'),_0x2cd746+'-'+_0x42ba83+'/'+_0x29fd2e)[_0x0d16('0x1c')](_0x494599);}return null;};}function patchUpdates(_0x40656b){return function(_0x1cb571){try{jsonpatch[_0x0d16('0x22')](_0x1cb571,_0x40656b,!![]);}catch(_0x1237ab){return BPromise['reject'](_0x1237ab);}return _0x1cb571[_0x0d16('0x23')]();};}function saveUpdates(_0x350b9f,_0x38d90d){return function(_0x439d27){if(_0x439d27){return _0x439d27[_0x0d16('0x24')](_0x350b9f)[_0x0d16('0x25')](function(_0x239fd6){return _0x239fd6;});}return null;};}function removeEntity(_0x2a0a06,_0x138990){return function(_0x5e2789){if(_0x5e2789){return _0x5e2789['destroy']()[_0x0d16('0x25')](function(){var _0x4b0c2c=_0x5e2789[_0x0d16('0x26')]({'plain':!![]});var _0x196497=_0x0d16('0x27');return db[_0x0d16('0x28')][_0x0d16('0x29')]({'where':{'type':_0x196497,'resourceId':_0x4b0c2c['id']}})[_0x0d16('0x25')](function(){return _0x5e2789;});})[_0x0d16('0x25')](function(){_0x2a0a06[_0x0d16('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280268,_0x5f5d8e){return function(_0x28075b){if(!_0x28075b){_0x280268[_0x0d16('0x19')](0x194);}return _0x28075b;};}function handleError(_0x47a607,_0x23b155){_0x23b155=_0x23b155||0x1f4;return function(_0x5a2d8d){logger[_0x0d16('0x2a')](_0x5a2d8d[_0x0d16('0x2b')]);if(_0x5a2d8d[_0x0d16('0x2c')]){delete _0x5a2d8d['name'];}_0x47a607[_0x0d16('0x1a')](_0x23b155)[_0x0d16('0x2d')](_0x5a2d8d);};}exports['index']=function(_0x54353b,_0x3cd88f){var _0x14080d={},_0x3c7b46={},_0x5b7af8={'count':0x0,'rows':[]};var _0x458d89=_[_0x0d16('0x2e')](db[_0x0d16('0x2f')]['rawAttributes'],function(_0x106fc4){return{'name':_0x106fc4[_0x0d16('0x30')],'type':_0x106fc4[_0x0d16('0x31')]['key']};});_0x3c7b46[_0x0d16('0x32')]=_['map'](_0x458d89,_0x0d16('0x2c'));_0x3c7b46[_0x0d16('0x33')]=_[_0x0d16('0x34')](_0x54353b[_0x0d16('0x33')]);_0x3c7b46[_0x0d16('0x35')]=_['intersection'](_0x3c7b46[_0x0d16('0x32')],_0x3c7b46[_0x0d16('0x33')]);_0x14080d[_0x0d16('0x36')]=_[_0x0d16('0x37')](_0x3c7b46[_0x0d16('0x32')],qs[_0x0d16('0x38')](_0x54353b[_0x0d16('0x33')]['fields']));_0x14080d[_0x0d16('0x36')]=_0x14080d['attributes'][_0x0d16('0x39')]?_0x14080d['attributes']:_0x3c7b46[_0x0d16('0x32')];if(!_0x54353b[_0x0d16('0x33')][_0x0d16('0x3a')](_0x0d16('0x3b'))){_0x14080d[_0x0d16('0x1d')]=qs[_0x0d16('0x1d')](_0x54353b[_0x0d16('0x33')][_0x0d16('0x1d')]);_0x14080d['offset']=qs[_0x0d16('0x1f')](_0x54353b[_0x0d16('0x33')][_0x0d16('0x1f')]);}_0x14080d[_0x0d16('0x3c')]=qs['sort'](_0x54353b[_0x0d16('0x33')][_0x0d16('0x3d')]);_0x14080d[_0x0d16('0x3e')]=qs[_0x0d16('0x35')](_[_0x0d16('0x3f')](_0x54353b[_0x0d16('0x33')],_0x3c7b46[_0x0d16('0x35')]),_0x458d89);if(_0x54353b['query'][_0x0d16('0x40')]){_0x14080d[_0x0d16('0x3e')]=_[_0x0d16('0x41')](_0x14080d[_0x0d16('0x3e')],{'$or':_['map'](_0x458d89,function(_0x434f70){if(_0x434f70['type']!==_0x0d16('0x42')){var _0x5c49ae={};_0x5c49ae[_0x434f70[_0x0d16('0x2c')]]={'$like':'%'+_0x54353b['query']['filter']+'%'};return _0x5c49ae;}})});}_0x14080d=_['merge']({},_0x14080d,_0x54353b[_0x0d16('0x43')]);var _0x20b747={'where':_0x14080d[_0x0d16('0x3e')]};return db[_0x0d16('0x2f')][_0x0d16('0x1e')](_0x20b747)['then'](function(_0x5df46c){_0x5b7af8[_0x0d16('0x1e')]=_0x5df46c;if(_0x54353b['query'][_0x0d16('0x44')]){_0x14080d['include']=[{'all':!![]}];}return db[_0x0d16('0x2f')]['findAll'](_0x14080d);})['then'](function(_0x3ef8bd){_0x5b7af8[_0x0d16('0x45')]=_0x3ef8bd;return _0x5b7af8;})[_0x0d16('0x25')](respondWithFilteredResult(_0x3cd88f,_0x14080d))['catch'](handleError(_0x3cd88f,null));};exports[_0x0d16('0x46')]=function(_0x30393b,_0x57f567){var _0xd5d28d={'raw':!![],'where':{'id':_0x30393b['params']['id']}},_0x36fc41={};_0x36fc41['model']=_[_0x0d16('0x34')](db[_0x0d16('0x2f')][_0x0d16('0x47')]);_0x36fc41[_0x0d16('0x33')]=_[_0x0d16('0x34')](_0x30393b[_0x0d16('0x33')]);_0x36fc41['filters']=_[_0x0d16('0x37')](_0x36fc41[_0x0d16('0x32')],_0x36fc41[_0x0d16('0x33')]);_0xd5d28d['attributes']=_[_0x0d16('0x37')](_0x36fc41[_0x0d16('0x32')],qs[_0x0d16('0x38')](_0x30393b[_0x0d16('0x33')]['fields']));_0xd5d28d[_0x0d16('0x36')]=_0xd5d28d['attributes']['length']?_0xd5d28d[_0x0d16('0x36')]:_0x36fc41['model'];if(_0x30393b[_0x0d16('0x33')]['includeAll']){_0xd5d28d[_0x0d16('0x48')]=[{'all':!![]}];}_0xd5d28d=_['merge']({},_0xd5d28d,_0x30393b['options']);return db[_0x0d16('0x2f')][_0x0d16('0x49')](_0xd5d28d)[_0x0d16('0x25')](handleEntityNotFound(_0x57f567,null))[_0x0d16('0x25')](respondWithResult(_0x57f567,null))[_0x0d16('0x4a')](handleError(_0x57f567,null));};exports[_0x0d16('0x4b')]=function(_0x363dd8,_0x2cec11){return db[_0x0d16('0x2f')][_0x0d16('0x4b')](_0x363dd8[_0x0d16('0x4c')],{})[_0x0d16('0x25')](function(_0x2ac2b6){var _0x3899c5=_0x363dd8[_0x0d16('0x4d')][_0x0d16('0x26')]({'plain':!![]});if(!_0x3899c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3899c5['role']===_0x0d16('0x4d')){var _0x4da030=_0x2ac2b6[_0x0d16('0x26')]({'plain':!![]});var _0x4fa0bf=_0x0d16('0x27');return db['UserProfileSection'][_0x0d16('0x49')]({'where':{'name':_0x4fa0bf,'userProfileId':_0x3899c5[_0x0d16('0x4e')]},'raw':!![]})[_0x0d16('0x25')](function(_0xc2feee){if(_0xc2feee&&_0xc2feee['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d16('0x4b')]({'name':_0x4da030['name'],'resourceId':_0x4da030['id'],'type':_0xc2feee[_0x0d16('0x2c')],'sectionId':_0xc2feee['id']},{})[_0x0d16('0x25')](function(){return _0x2ac2b6;});}else{return _0x2ac2b6;}})[_0x0d16('0x4a')](function(_0x46e6f5){logger[_0x0d16('0x2a')](_0x0d16('0x4f'),_0x46e6f5);throw _0x46e6f5;});}return _0x2ac2b6;})['then'](respondWithResult(_0x2cec11,0xc9))[_0x0d16('0x4a')](handleError(_0x2cec11,null));};exports[_0x0d16('0x24')]=function(_0x4248a5,_0x12f8b6){if(_0x4248a5[_0x0d16('0x4c')]['id']){delete _0x4248a5[_0x0d16('0x4c')]['id'];}return db[_0x0d16('0x2f')][_0x0d16('0x49')]({'where':{'id':_0x4248a5[_0x0d16('0x50')]['id']}})['then'](handleEntityNotFound(_0x12f8b6,null))[_0x0d16('0x25')](saveUpdates(_0x4248a5[_0x0d16('0x4c')],null))['then'](respondWithResult(_0x12f8b6,null))['catch'](handleError(_0x12f8b6,null));};exports[_0x0d16('0x29')]=function(_0xb8b737,_0x542ce8){return db[_0x0d16('0x2f')][_0x0d16('0x49')]({'where':{'id':_0xb8b737[_0x0d16('0x50')]['id']}})[_0x0d16('0x25')](handleEntityNotFound(_0x542ce8,null))['then'](removeEntity(_0x542ce8,null))[_0x0d16('0x4a')](handleError(_0x542ce8,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b7f634e..1c723d7 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 _0x7636=['request-promise','path','rimraf','../../config/environment','./template.attributes','tools_templates','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x498f2a,_0x1e7ab3){var _0xfab8a5=function(_0x285840){while(--_0x285840){_0x498f2a['push'](_0x498f2a['shift']());}};_0xfab8a5(++_0x1e7ab3);}(_0x7636,0x66));var _0x6763=function(_0x39fe3f,_0x38b8eb){_0x39fe3f=_0x39fe3f-0x0;var _0x50d483=_0x7636[_0x39fe3f];return _0x50d483;};'use strict';var _=require(_0x6763('0x0'));var util=require(_0x6763('0x1'));var logger=require(_0x6763('0x2'))(_0x6763('0x3'));var moment=require(_0x6763('0x4'));var BPromise=require(_0x6763('0x5'));var rp=require(_0x6763('0x6'));var fs=require('fs');var path=require(_0x6763('0x7'));var rimraf=require(_0x6763('0x8'));var config=require(_0x6763('0x9'));var attributes=require(_0x6763('0xa'));module['exports']=function(_0x625d72,_0x492b73){return _0x625d72['define']('Template',attributes,{'tableName':_0x6763('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6704=['../../config/environment','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x49c366,_0x4d4e8c){var _0x5b9b15=function(_0x4b024a){while(--_0x4b024a){_0x49c366['push'](_0x49c366['shift']());}};_0x5b9b15(++_0x4d4e8c);}(_0x6704,0x116));var _0x4670=function(_0x2c879e,_0x56bc2d){_0x2c879e=_0x2c879e-0x0;var _0x1f0034=_0x6704[_0x2c879e];return _0x1f0034;};'use strict';var _=require(_0x4670('0x0'));var util=require(_0x4670('0x1'));var logger=require(_0x4670('0x2'))(_0x4670('0x3'));var moment=require(_0x4670('0x4'));var BPromise=require(_0x4670('0x5'));var rp=require(_0x4670('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4670('0x7'));var config=require(_0x4670('0x8'));var attributes=require('./template.attributes');module[_0x4670('0x9')]=function(_0x1a57c9,_0x462eb5){return _0x1a57c9[_0x4670('0xa')](_0x4670('0xb'),attributes,{'tableName':_0x4670('0xc'),'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 8102c50..9b151da 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 _0xd597=['raw','where','attributes','limit','include','map','model','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetTemplate','findAll','options'];(function(_0x1e7d0c,_0x62948b){var _0x1224b3=function(_0x3d519c){while(--_0x3d519c){_0x1e7d0c['push'](_0x1e7d0c['shift']());}};_0x1224b3(++_0x62948b);}(_0xd597,0x94));var _0x7d59=function(_0x34c2f5,_0x40cf29){_0x34c2f5=_0x34c2f5-0x0;var _0x33a962=_0xd597[_0x34c2f5];return _0x33a962;};'use strict';var _=require(_0x7d59('0x0'));var util=require(_0x7d59('0x1'));var moment=require(_0x7d59('0x2'));var BPromise=require(_0x7d59('0x3'));var rs=require(_0x7d59('0x4'));var fs=require('fs');var Redis=require(_0x7d59('0x5'));var db=require(_0x7d59('0x6'))['db'];var utils=require(_0x7d59('0x7'));var logger=require(_0x7d59('0x8'))(_0x7d59('0x9'));var config=require(_0x7d59('0xa'));var jayson=require(_0x7d59('0xb'));var client=jayson[_0x7d59('0xc')][_0x7d59('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x510e87,_0x2b2c16,_0x2985a2){return new BPromise(function(_0x2b85a9,_0x328cdd){return client[_0x7d59('0xe')](_0x510e87,_0x2985a2)[_0x7d59('0xf')](function(_0x103089){logger['info'](_0x7d59('0x10'),_0x2b2c16,_0x7d59('0x11'));logger[_0x7d59('0x12')]('Template,\x20%s,\x20%s,\x20%s',_0x2b2c16,'request\x20sent',JSON[_0x7d59('0x13')](_0x103089));if(_0x103089[_0x7d59('0x14')]){if(_0x103089[_0x7d59('0x14')]['code']===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x2b2c16,_0x103089['error'][_0x7d59('0x15')]);return _0x328cdd(_0x103089[_0x7d59('0x14')]['message']);}logger['error'](_0x7d59('0x10'),_0x2b2c16,_0x103089[_0x7d59('0x14')][_0x7d59('0x15')]);return _0x2b85a9(_0x103089[_0x7d59('0x14')][_0x7d59('0x15')]);}else{logger['info'](_0x7d59('0x10'),_0x2b2c16,_0x7d59('0x11'));_0x2b85a9(_0x103089[_0x7d59('0x16')][_0x7d59('0x15')]);}})[_0x7d59('0x17')](function(_0x17aa27){logger[_0x7d59('0x14')](_0x7d59('0x10'),_0x2b2c16,_0x17aa27);_0x328cdd(_0x17aa27);});});}exports[_0x7d59('0x18')]=function(_0xb39529){var _0xf83016=this;return new Promise(function(_0x1dd719,_0x56002e){return db['Template'][_0x7d59('0x19')]({'raw':_0xb39529[_0x7d59('0x1a')]?_0xb39529[_0x7d59('0x1a')][_0x7d59('0x1b')]===undefined?!![]:![]:!![],'where':_0xb39529[_0x7d59('0x1a')]?_0xb39529[_0x7d59('0x1a')][_0x7d59('0x1c')]||null:null,'attributes':_0xb39529['options']?_0xb39529[_0x7d59('0x1a')][_0x7d59('0x1d')]||null:null,'limit':_0xb39529['options']?_0xb39529[_0x7d59('0x1a')][_0x7d59('0x1e')]||null:null,'include':_0xb39529[_0x7d59('0x1a')]?_0xb39529['options'][_0x7d59('0x1f')]?_[_0x7d59('0x20')](_0xb39529[_0x7d59('0x1a')][_0x7d59('0x1f')],function(_0x104a2c){return{'model':db[_0x104a2c[_0x7d59('0x21')]],'as':_0x104a2c['as'],'attributes':_0x104a2c[_0x7d59('0x1d')],'include':_0x104a2c[_0x7d59('0x1f')]?_[_0x7d59('0x20')](_0x104a2c[_0x7d59('0x1f')],function(_0x4d18d0){return{'model':db[_0x4d18d0[_0x7d59('0x21')]],'as':_0x4d18d0['as'],'attributes':_0x4d18d0[_0x7d59('0x1d')],'include':_0x4d18d0[_0x7d59('0x1f')]?_[_0x7d59('0x20')](_0x4d18d0[_0x7d59('0x1f')],function(_0x1b60e1){return{'model':db[_0x1b60e1['model']],'as':_0x1b60e1['as'],'attributes':_0x1b60e1[_0x7d59('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7d59('0xf')](function(_0x5331cb){logger[_0x7d59('0x22')](_0x7d59('0x18'),_0xb39529);logger[_0x7d59('0x12')](_0x7d59('0x18'),_0xb39529,JSON['stringify'](_0x5331cb));_0x1dd719(_0x5331cb);})[_0x7d59('0x17')](function(_0x35ab0b){logger[_0x7d59('0x14')](_0x7d59('0x18'),_0x35ab0b['message'],_0xb39529);_0x56002e(_0xf83016[_0x7d59('0x14')](0x1f4,_0x35ab0b[_0x7d59('0x15')]));});});}; \ No newline at end of file +var _0xdd76=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetTemplate','Template','findAll','raw','options','where','attributes','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xdd76,0x102));var _0x6dd7=function(_0x5ce488,_0x31892f){_0x5ce488=_0x5ce488-0x0;var _0x471d93=_0xdd76[_0x5ce488];return _0x471d93;};'use strict';var _=require(_0x6dd7('0x0'));var util=require(_0x6dd7('0x1'));var moment=require('moment');var BPromise=require(_0x6dd7('0x2'));var rs=require(_0x6dd7('0x3'));var fs=require('fs');var Redis=require(_0x6dd7('0x4'));var db=require(_0x6dd7('0x5'))['db'];var utils=require(_0x6dd7('0x6'));var logger=require(_0x6dd7('0x7'))('rpc');var config=require(_0x6dd7('0x8'));var jayson=require(_0x6dd7('0x9'));var client=jayson[_0x6dd7('0xa')][_0x6dd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x83df88,_0x561e61,_0x47f857){return new BPromise(function(_0x41498f,_0x3c37f5){return client[_0x6dd7('0xc')](_0x83df88,_0x47f857)[_0x6dd7('0xd')](function(_0x114110){logger[_0x6dd7('0xe')](_0x6dd7('0xf'),_0x561e61,_0x6dd7('0x10'));logger[_0x6dd7('0x11')](_0x6dd7('0x12'),_0x561e61,_0x6dd7('0x10'),JSON[_0x6dd7('0x13')](_0x114110));if(_0x114110[_0x6dd7('0x14')]){if(_0x114110[_0x6dd7('0x14')]['code']===0x1f4){logger[_0x6dd7('0x14')](_0x6dd7('0xf'),_0x561e61,_0x114110['error'][_0x6dd7('0x15')]);return _0x3c37f5(_0x114110[_0x6dd7('0x14')][_0x6dd7('0x15')]);}logger[_0x6dd7('0x14')](_0x6dd7('0xf'),_0x561e61,_0x114110[_0x6dd7('0x14')][_0x6dd7('0x15')]);return _0x41498f(_0x114110[_0x6dd7('0x14')][_0x6dd7('0x15')]);}else{logger[_0x6dd7('0xe')](_0x6dd7('0xf'),_0x561e61,_0x6dd7('0x10'));_0x41498f(_0x114110['result'][_0x6dd7('0x15')]);}})[_0x6dd7('0x16')](function(_0x74fe7c){logger['error'](_0x6dd7('0xf'),_0x561e61,_0x74fe7c);_0x3c37f5(_0x74fe7c);});});}exports[_0x6dd7('0x17')]=function(_0x7bc167){var _0x1f63c9=this;return new Promise(function(_0x22ceb7,_0x2d30a8){return db[_0x6dd7('0x18')][_0x6dd7('0x19')]({'raw':_0x7bc167['options']?_0x7bc167['options'][_0x6dd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x7bc167[_0x6dd7('0x1b')]?_0x7bc167['options'][_0x6dd7('0x1c')]||null:null,'attributes':_0x7bc167['options']?_0x7bc167[_0x6dd7('0x1b')][_0x6dd7('0x1d')]||null:null,'limit':_0x7bc167['options']?_0x7bc167[_0x6dd7('0x1b')]['limit']||null:null,'include':_0x7bc167[_0x6dd7('0x1b')]?_0x7bc167['options'][_0x6dd7('0x1e')]?_['map'](_0x7bc167[_0x6dd7('0x1b')][_0x6dd7('0x1e')],function(_0x55b72e){return{'model':db[_0x55b72e['model']],'as':_0x55b72e['as'],'attributes':_0x55b72e['attributes'],'include':_0x55b72e[_0x6dd7('0x1e')]?_['map'](_0x55b72e['include'],function(_0x4a9172){return{'model':db[_0x4a9172[_0x6dd7('0x1f')]],'as':_0x4a9172['as'],'attributes':_0x4a9172[_0x6dd7('0x1d')],'include':_0x4a9172[_0x6dd7('0x1e')]?_[_0x6dd7('0x20')](_0x4a9172[_0x6dd7('0x1e')],function(_0x4b2f4e){return{'model':db[_0x4b2f4e[_0x6dd7('0x1f')]],'as':_0x4b2f4e['as'],'attributes':_0x4b2f4e['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dd7('0xd')](function(_0x45e573){logger[_0x6dd7('0xe')](_0x6dd7('0x17'),_0x7bc167);logger[_0x6dd7('0x11')](_0x6dd7('0x17'),_0x7bc167,JSON['stringify'](_0x45e573));_0x22ceb7(_0x45e573);})[_0x6dd7('0x16')](function(_0x15a7ed){logger[_0x6dd7('0x14')](_0x6dd7('0x17'),_0x15a7ed[_0x6dd7('0x15')],_0x7bc167);_0x2d30a8(_0x1f63c9['error'](0x1f4,_0x15a7ed[_0x6dd7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 62d3746..781a1b7 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 _0xfbd6=['getActions','post','create','addAnyCondition','addAction','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions'];(function(_0x103ade,_0x55b552){var _0x3a132c=function(_0x560d2c){while(--_0x560d2c){_0x103ade['push'](_0x103ade['shift']());}};_0x3a132c(++_0x55b552);}(_0xfbd6,0x1b2));var _0x6fbd=function(_0x4b288b,_0x591743){_0x4b288b=_0x4b288b-0x0;var _0x27eab9=_0xfbd6[_0x4b288b];return _0x27eab9;};'use strict';var multer=require(_0x6fbd('0x0'));var util=require(_0x6fbd('0x1'));var path=require(_0x6fbd('0x2'));var timeout=require(_0x6fbd('0x3'));var express=require('express');var router=express[_0x6fbd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6fbd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6fbd('0x6'));var controller=require(_0x6fbd('0x7'));router[_0x6fbd('0x8')]('/',auth[_0x6fbd('0x9')](),controller['index']);router[_0x6fbd('0x8')](_0x6fbd('0xa'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0xb')]);router[_0x6fbd('0x8')](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0xd')]);router[_0x6fbd('0x8')](_0x6fbd('0xe'),auth[_0x6fbd('0x9')](),controller['getAnyConditions']);router[_0x6fbd('0x8')](_0x6fbd('0xf'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0x10')]);router[_0x6fbd('0x11')]('/',auth['isAuthenticated'](),controller[_0x6fbd('0x12')]);router[_0x6fbd('0x11')](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller['addAllCondition']);router['post']('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x6fbd('0x13')]);router[_0x6fbd('0x11')](_0x6fbd('0xf'),auth['isAuthenticated'](),controller[_0x6fbd('0x14')]);router[_0x6fbd('0x15')]('/:id',auth[_0x6fbd('0x9')](),controller[_0x6fbd('0x16')]);router[_0x6fbd('0x17')](_0x6fbd('0xa'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0a16=['get','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','index','isAuthenticated','show'];(function(_0x32504a,_0x475539){var _0x536848=function(_0x5d3040){while(--_0x5d3040){_0x32504a['push'](_0x32504a['shift']());}};_0x536848(++_0x475539);}(_0x0a16,0x160));var _0x60a1=function(_0x1bd3a2,_0x6b37a7){_0x1bd3a2=_0x1bd3a2-0x0;var _0x1bb4b7=_0x0a16[_0x1bd3a2];return _0x1bb4b7;};'use strict';var multer=require(_0x60a1('0x0'));var util=require(_0x60a1('0x1'));var path=require(_0x60a1('0x2'));var timeout=require(_0x60a1('0x3'));var express=require(_0x60a1('0x4'));var router=express['Router']();var fs_extra=require(_0x60a1('0x5'));var auth=require(_0x60a1('0x6'));var interaction=require(_0x60a1('0x7'));var config=require('../../config/environment');var controller=require(_0x60a1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x60a1('0x9')]);router['get']('/:id',auth[_0x60a1('0xa')](),controller[_0x60a1('0xb')]);router[_0x60a1('0xc')](_0x60a1('0xd'),auth[_0x60a1('0xa')](),controller['getAllConditions']);router[_0x60a1('0xc')](_0x60a1('0xe'),auth[_0x60a1('0xa')](),controller[_0x60a1('0xf')]);router['get'](_0x60a1('0x10'),auth[_0x60a1('0xa')](),controller[_0x60a1('0x11')]);router[_0x60a1('0x12')]('/',auth[_0x60a1('0xa')](),controller[_0x60a1('0x13')]);router[_0x60a1('0x12')](_0x60a1('0xd'),auth[_0x60a1('0xa')](),controller[_0x60a1('0x14')]);router[_0x60a1('0x12')]('/:id/any_conditions',auth[_0x60a1('0xa')](),controller[_0x60a1('0x15')]);router[_0x60a1('0x12')]('/:id/actions',auth[_0x60a1('0xa')](),controller['addAction']);router[_0x60a1('0x16')](_0x60a1('0x17'),auth[_0x60a1('0xa')](),controller[_0x60a1('0x18')]);router[_0x60a1('0x19')](_0x60a1('0x17'),auth[_0x60a1('0xa')](),controller[_0x60a1('0x1a')]);module[_0x60a1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 603acfa..09dc31e 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 _0xe89a=['STRING','BOOLEAN','sequelize'];(function(_0x47c3a4,_0x580f78){var _0x56ce6c=function(_0x4f4c7a){while(--_0x4f4c7a){_0x47c3a4['push'](_0x47c3a4['shift']());}};_0x56ce6c(++_0x580f78);}(_0xe89a,0x71));var _0xae89=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xe89a[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0xae89('0x0'));module['exports']={'name':{'type':Sequelize[_0xae89('0x1')]},'channel':{'type':Sequelize[_0xae89('0x1')]},'description':{'type':Sequelize[_0xae89('0x1')]},'status':{'type':Sequelize[_0xae89('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x35b5=['exports','STRING','BOOLEAN','sequelize'];(function(_0x12d56c,_0x5dc328){var _0x1cd00a=function(_0x481de7){while(--_0x481de7){_0x12d56c['push'](_0x12d56c['shift']());}};_0x1cd00a(++_0x5dc328);}(_0x35b5,0x137));var _0x535b=function(_0x524bcd,_0x3a0860){_0x524bcd=_0x524bcd-0x0;var _0x127f18=_0x35b5[_0x524bcd];return _0x127f18;};'use strict';var Sequelize=require(_0x535b('0x0'));module[_0x535b('0x1')]={'name':{'type':Sequelize[_0x535b('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x535b('0x2')]},'status':{'type':Sequelize[_0x535b('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 72a0292..91bfe94 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 _0x6655=['nolimit','getAnyConditions','pick','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','reject','update','then','get','Triggers','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','Trigger','include','findAll','rows','catch','show','params','length','includeAll','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','addAllCondition','TriggerAllId','TriggerAnyId','Condition','getAllConditions','findOne','options'];(function(_0x4b8fc4,_0x213d45){var _0x35fbef=function(_0x4ab1bb){while(--_0x4ab1bb){_0x4b8fc4['push'](_0x4b8fc4['shift']());}};_0x35fbef(++_0x213d45);}(_0x6655,0x1cd));var _0x5665=function(_0x21bf4b,_0x1f57d0){_0x21bf4b=_0x21bf4b-0x0;var _0x5964aa=_0x6655[_0x21bf4b];return _0x5964aa;};'use strict';var emlformat=require(_0x5665('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5665('0x1'));var jsonpatch=require(_0x5665('0x2'));var rp=require('request-promise');var moment=require(_0x5665('0x3'));var BPromise=require(_0x5665('0x4'));var Mustache=require('mustache');var util=require(_0x5665('0x5'));var path=require(_0x5665('0x6'));var sox=require('sox');var csv=require(_0x5665('0x7'));var ejs=require(_0x5665('0x8'));var fs=require('fs');var fs_extra=require(_0x5665('0x9'));var _=require(_0x5665('0xa'));var squel=require(_0x5665('0xb'));var crypto=require(_0x5665('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5665('0xd'));var toCsv=require(_0x5665('0x7'));var querystring=require(_0x5665('0xe'));var Papa=require('papaparse');var Redis=require(_0x5665('0xf'));var authService=require(_0x5665('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5665('0x11'));var logger=require('../../config/logger')(_0x5665('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5665('0x13'));var db=require(_0x5665('0x14'))['db'];function respondWithStatusCode(_0x5f2627,_0x2cb797){_0x2cb797=_0x2cb797||0xcc;return function(_0x3ab66b){if(_0x3ab66b){return _0x5f2627['sendStatus'](_0x2cb797);}return _0x5f2627[_0x5665('0x15')](_0x2cb797)[_0x5665('0x16')]();};}function respondWithResult(_0xef8e36,_0x1aa949){_0x1aa949=_0x1aa949||0xc8;return function(_0x2c2bbd){if(_0x2c2bbd){return _0xef8e36[_0x5665('0x15')](_0x1aa949)['json'](_0x2c2bbd);}};}function respondWithFilteredResult(_0x378232,_0x54da0d){return function(_0x491b20){if(_0x491b20){var _0x1a1f0b=typeof _0x54da0d[_0x5665('0x17')]==='undefined'&&typeof _0x54da0d[_0x5665('0x18')]===_0x5665('0x19');var _0x36be52=_0x491b20[_0x5665('0x1a')];var _0x1019f5=_0x1a1f0b?0x0:_0x54da0d[_0x5665('0x17')];var _0x3a0b9a=_0x1a1f0b?_0x491b20[_0x5665('0x1a')]:_0x54da0d['offset']+_0x54da0d['limit'];var _0x3a53a1;if(_0x3a0b9a>=_0x36be52){_0x3a0b9a=_0x36be52;_0x3a53a1=0xc8;}else{_0x3a53a1=0xce;}_0x378232[_0x5665('0x15')](_0x3a53a1);return _0x378232[_0x5665('0x1b')](_0x5665('0x1c'),_0x1019f5+'-'+_0x3a0b9a+'/'+_0x36be52)['json'](_0x491b20);}return null;};}function patchUpdates(_0x386123){return function(_0x4aea79){try{jsonpatch['apply'](_0x4aea79,_0x386123,!![]);}catch(_0x1ea614){return BPromise[_0x5665('0x1d')](_0x1ea614);}return _0x4aea79['save']();};}function saveUpdates(_0x5e371c,_0x3bdeb7){return function(_0xbe94e2){if(_0xbe94e2){return _0xbe94e2[_0x5665('0x1e')](_0x5e371c)[_0x5665('0x1f')](function(_0x33a0f3){return _0x33a0f3;});}return null;};}function removeEntity(_0x1196b1,_0x11e40c){return function(_0x5d764b){if(_0x5d764b){return _0x5d764b['destroy']()[_0x5665('0x1f')](function(){var _0x515449=_0x5d764b[_0x5665('0x20')]({'plain':!![]});var _0x4d07f3=_0x5665('0x21');return db[_0x5665('0x22')][_0x5665('0x23')]({'where':{'type':_0x4d07f3,'resourceId':_0x515449['id']}})['then'](function(){return _0x5d764b;});})['then'](function(){_0x1196b1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22bce3,_0x2d4e5a){return function(_0x57f421){if(!_0x57f421){_0x22bce3[_0x5665('0x24')](0x194);}return _0x57f421;};}function handleError(_0x3bbddb,_0x1e6402){_0x1e6402=_0x1e6402||0x1f4;return function(_0x127ba3){logger[_0x5665('0x25')](_0x127ba3[_0x5665('0x26')]);if(_0x127ba3[_0x5665('0x27')]){delete _0x127ba3[_0x5665('0x27')];}_0x3bbddb[_0x5665('0x15')](_0x1e6402)['send'](_0x127ba3);};}exports[_0x5665('0x28')]=function(_0x56c9ca,_0x17b8b7){var _0x50f261={},_0x4123af={},_0xa5cfa5={'count':0x0,'rows':[]};var _0x50e68b=_[_0x5665('0x29')](db['Trigger'][_0x5665('0x2a')],function(_0x3b0e21){return{'name':_0x3b0e21[_0x5665('0x2b')],'type':_0x3b0e21[_0x5665('0x2c')][_0x5665('0x2d')]};});_0x4123af[_0x5665('0x2e')]=_[_0x5665('0x29')](_0x50e68b,_0x5665('0x27'));_0x4123af['query']=_[_0x5665('0x2f')](_0x56c9ca[_0x5665('0x30')]);_0x4123af[_0x5665('0x31')]=_[_0x5665('0x32')](_0x4123af['model'],_0x4123af['query']);_0x50f261[_0x5665('0x33')]=_[_0x5665('0x32')](_0x4123af[_0x5665('0x2e')],qs[_0x5665('0x34')](_0x56c9ca[_0x5665('0x30')]['fields']));_0x50f261['attributes']=_0x50f261[_0x5665('0x33')]['length']?_0x50f261[_0x5665('0x33')]:_0x4123af[_0x5665('0x2e')];if(!_0x56c9ca[_0x5665('0x30')][_0x5665('0x35')]('nolimit')){_0x50f261[_0x5665('0x18')]=qs[_0x5665('0x18')](_0x56c9ca[_0x5665('0x30')]['limit']);_0x50f261[_0x5665('0x17')]=qs[_0x5665('0x17')](_0x56c9ca[_0x5665('0x30')][_0x5665('0x17')]);}_0x50f261[_0x5665('0x36')]=qs[_0x5665('0x37')](_0x56c9ca[_0x5665('0x30')]['sort']);_0x50f261[_0x5665('0x38')]=qs[_0x5665('0x31')](_['pick'](_0x56c9ca[_0x5665('0x30')],_0x4123af['filters']),_0x50e68b);if(_0x56c9ca['query']['filter']){_0x50f261['where']=_[_0x5665('0x39')](_0x50f261[_0x5665('0x38')],{'$or':_[_0x5665('0x29')](_0x50e68b,function(_0x4898df){if(_0x4898df['type']!=='VIRTUAL'){var _0x42c1d1={};_0x42c1d1[_0x4898df[_0x5665('0x27')]]={'$like':'%'+_0x56c9ca[_0x5665('0x30')][_0x5665('0x3a')]+'%'};return _0x42c1d1;}})});}_0x50f261=_[_0x5665('0x39')]({},_0x50f261,_0x56c9ca['options']);var _0x339a0a={'where':_0x50f261[_0x5665('0x38')]};return db[_0x5665('0x3b')]['count'](_0x339a0a)['then'](function(_0x185916){_0xa5cfa5[_0x5665('0x1a')]=_0x185916;if(_0x56c9ca[_0x5665('0x30')]['includeAll']){_0x50f261[_0x5665('0x3c')]=[{'all':!![]}];}return db[_0x5665('0x3b')][_0x5665('0x3d')](_0x50f261);})[_0x5665('0x1f')](function(_0x55231a){_0xa5cfa5[_0x5665('0x3e')]=_0x55231a;return _0xa5cfa5;})[_0x5665('0x1f')](respondWithFilteredResult(_0x17b8b7,_0x50f261))[_0x5665('0x3f')](handleError(_0x17b8b7,null));};exports[_0x5665('0x40')]=function(_0x3b939a,_0x3928c4){var _0x52ca45={'raw':![],'where':{'id':_0x3b939a[_0x5665('0x41')]['id']}},_0x2b8ba5={};_0x2b8ba5[_0x5665('0x2e')]=_[_0x5665('0x2f')](db[_0x5665('0x3b')][_0x5665('0x2a')]);_0x2b8ba5[_0x5665('0x30')]=_[_0x5665('0x2f')](_0x3b939a[_0x5665('0x30')]);_0x2b8ba5[_0x5665('0x31')]=_[_0x5665('0x32')](_0x2b8ba5[_0x5665('0x2e')],_0x2b8ba5[_0x5665('0x30')]);_0x52ca45[_0x5665('0x33')]=_[_0x5665('0x32')](_0x2b8ba5['model'],qs['fields'](_0x3b939a['query'][_0x5665('0x34')]));_0x52ca45[_0x5665('0x33')]=_0x52ca45[_0x5665('0x33')][_0x5665('0x42')]?_0x52ca45[_0x5665('0x33')]:_0x2b8ba5[_0x5665('0x2e')];if(_0x3b939a[_0x5665('0x30')][_0x5665('0x43')]){_0x52ca45[_0x5665('0x3c')]=[{'all':!![]}];}_0x52ca45=_[_0x5665('0x39')]({},_0x52ca45,_0x3b939a['options']);return db[_0x5665('0x3b')][_0x5665('0x44')](_0x52ca45)[_0x5665('0x1f')](handleEntityNotFound(_0x3928c4,null))['then'](respondWithResult(_0x3928c4,null))[_0x5665('0x3f')](handleError(_0x3928c4,null));};exports[_0x5665('0x45')]=function(_0xec2557,_0x53026a){return db[_0x5665('0x3b')][_0x5665('0x45')](_0xec2557['body'],{})[_0x5665('0x1f')](function(_0x1410ef){var _0x515fe7=_0xec2557[_0x5665('0x46')][_0x5665('0x20')]({'plain':!![]});if(!_0x515fe7)throw new Error(_0x5665('0x47'));if(_0x515fe7[_0x5665('0x48')]===_0x5665('0x46')){var _0x554f72=_0x1410ef[_0x5665('0x20')]({'plain':!![]});var _0x5e291f=_0x5665('0x21');return db[_0x5665('0x49')][_0x5665('0x44')]({'where':{'name':_0x5e291f,'userProfileId':_0x515fe7[_0x5665('0x4a')]},'raw':!![]})[_0x5665('0x1f')](function(_0x3c8d49){if(_0x3c8d49&&_0x3c8d49[_0x5665('0x4b')]===0x0){return db[_0x5665('0x22')][_0x5665('0x45')]({'name':_0x554f72[_0x5665('0x27')],'resourceId':_0x554f72['id'],'type':_0x3c8d49['name'],'sectionId':_0x3c8d49['id']},{})[_0x5665('0x1f')](function(){return _0x1410ef;});}else{return _0x1410ef;}})[_0x5665('0x3f')](function(_0x5f0a7a){logger[_0x5665('0x25')](_0x5665('0x4c'),_0x5f0a7a);throw _0x5f0a7a;});}return _0x1410ef;})[_0x5665('0x1f')](respondWithResult(_0x53026a,0xc9))[_0x5665('0x3f')](handleError(_0x53026a,null));};exports[_0x5665('0x1e')]=function(_0x44d462,_0x443760){if(_0x44d462[_0x5665('0x4d')]['id']){delete _0x44d462[_0x5665('0x4d')]['id'];}return db[_0x5665('0x3b')][_0x5665('0x44')]({'where':{'id':_0x44d462[_0x5665('0x41')]['id']}})['then'](handleEntityNotFound(_0x443760,null))[_0x5665('0x1f')](saveUpdates(_0x44d462[_0x5665('0x4d')],null))[_0x5665('0x1f')](respondWithResult(_0x443760,null))[_0x5665('0x3f')](handleError(_0x443760,null));};exports['destroy']=function(_0x1d095c,_0x44204a){return db[_0x5665('0x3b')][_0x5665('0x44')]({'where':{'id':_0x1d095c['params']['id']}})[_0x5665('0x1f')](handleEntityNotFound(_0x44204a,null))['then'](removeEntity(_0x44204a,null))[_0x5665('0x3f')](handleError(_0x44204a,null));};exports[_0x5665('0x4e')]=function(_0xd72d6a,_0x51b00c,_0x112c51){if(_0xd72d6a[_0x5665('0x4d')]['id']){delete _0xd72d6a[_0x5665('0x4d')]['id'];}return db[_0x5665('0x3b')][_0x5665('0x44')]({'where':{'id':_0xd72d6a[_0x5665('0x41')]['id']}})['then'](handleEntityNotFound(_0x51b00c,null))[_0x5665('0x1f')](function(_0x427c23){if(_0x427c23){_0xd72d6a[_0x5665('0x4d')][_0x5665('0x4f')]=_0x427c23['id'];return db['Condition'][_0x5665('0x45')](_0xd72d6a[_0x5665('0x4d')]);}})[_0x5665('0x1f')](respondWithResult(_0x51b00c,null))['catch'](handleError(_0x51b00c,null));};exports['addAnyCondition']=function(_0x2a7a04,_0x3ed7be,_0x22cf75){if(_0x2a7a04[_0x5665('0x4d')]['id']){delete _0x2a7a04[_0x5665('0x4d')]['id'];}return db[_0x5665('0x3b')][_0x5665('0x44')]({'where':{'id':_0x2a7a04[_0x5665('0x41')]['id']}})[_0x5665('0x1f')](handleEntityNotFound(_0x3ed7be,null))[_0x5665('0x1f')](function(_0x30fdf3){if(_0x30fdf3){_0x2a7a04['body'][_0x5665('0x50')]=_0x30fdf3['id'];return db[_0x5665('0x51')][_0x5665('0x45')](_0x2a7a04[_0x5665('0x4d')]);}})[_0x5665('0x1f')](respondWithResult(_0x3ed7be,null))[_0x5665('0x3f')](handleError(_0x3ed7be,null));};exports[_0x5665('0x52')]=function(_0x4bf3da,_0x59feed,_0x168684){var _0x1d37a4={};var _0x5aa66c={};var _0x193b41;var _0x144f15;return db[_0x5665('0x3b')][_0x5665('0x53')]({'where':{'id':_0x4bf3da[_0x5665('0x41')]['id']}})['then'](handleEntityNotFound(_0x59feed,null))[_0x5665('0x1f')](function(_0x32b5f4){if(_0x32b5f4){_0x193b41=_0x32b5f4;_0x5aa66c[_0x5665('0x2e')]=_[_0x5665('0x2f')](db[_0x5665('0x51')][_0x5665('0x2a')]);_0x5aa66c[_0x5665('0x30')]=_[_0x5665('0x2f')](_0x4bf3da[_0x5665('0x30')]);_0x5aa66c[_0x5665('0x31')]=_['intersection'](_0x5aa66c['model'],_0x5aa66c[_0x5665('0x30')]);_0x1d37a4[_0x5665('0x33')]=_[_0x5665('0x32')](_0x5aa66c['model'],qs['fields'](_0x4bf3da['query']['fields']));_0x1d37a4['attributes']=_0x1d37a4[_0x5665('0x33')][_0x5665('0x42')]?_0x1d37a4['attributes']:_0x5aa66c['model'];_0x1d37a4[_0x5665('0x36')]=qs[_0x5665('0x37')](_0x4bf3da[_0x5665('0x30')]['sort']);_0x1d37a4['where']=qs['filters'](_['pick'](_0x4bf3da[_0x5665('0x30')],_0x5aa66c[_0x5665('0x31')]));if(_0x4bf3da[_0x5665('0x30')]['filter']){_0x1d37a4[_0x5665('0x38')]=_[_0x5665('0x39')](_0x1d37a4['where'],{'$or':_[_0x5665('0x29')](_0x1d37a4[_0x5665('0x33')],function(_0x4026de){var _0xbd86aa={};_0xbd86aa[_0x4026de]={'$like':'%'+_0x4bf3da['query'][_0x5665('0x3a')]+'%'};return _0xbd86aa;})});}_0x1d37a4=_['merge']({},_0x1d37a4,_0x4bf3da[_0x5665('0x54')]);return _0x193b41['getAllConditions'](_0x1d37a4);}})[_0x5665('0x1f')](function(_0x5ae6e9){if(_0x5ae6e9){_0x144f15=_0x5ae6e9[_0x5665('0x42')];if(!_0x4bf3da[_0x5665('0x30')][_0x5665('0x35')](_0x5665('0x55'))){_0x1d37a4['limit']=qs[_0x5665('0x18')](_0x4bf3da[_0x5665('0x30')][_0x5665('0x18')]);_0x1d37a4['offset']=qs['offset'](_0x4bf3da[_0x5665('0x30')][_0x5665('0x17')]);}return _0x193b41[_0x5665('0x52')](_0x1d37a4);}})[_0x5665('0x1f')](function(_0xb5888e){if(_0xb5888e){return _0xb5888e?{'count':_0x144f15,'rows':_0xb5888e}:null;}})[_0x5665('0x1f')](respondWithResult(_0x59feed,null))[_0x5665('0x3f')](handleError(_0x59feed,null));};exports[_0x5665('0x56')]=function(_0x4e8b7e,_0xed0432,_0x2eadc3){var _0x2b78d9={};var _0x4b9105={};var _0x3074fa;var _0x1cf75b;return db[_0x5665('0x3b')][_0x5665('0x53')]({'where':{'id':_0x4e8b7e['params']['id']}})['then'](handleEntityNotFound(_0xed0432,null))['then'](function(_0x243f73){if(_0x243f73){_0x3074fa=_0x243f73;_0x4b9105[_0x5665('0x2e')]=_[_0x5665('0x2f')](db[_0x5665('0x51')][_0x5665('0x2a')]);_0x4b9105[_0x5665('0x30')]=_[_0x5665('0x2f')](_0x4e8b7e[_0x5665('0x30')]);_0x4b9105[_0x5665('0x31')]=_['intersection'](_0x4b9105[_0x5665('0x2e')],_0x4b9105['query']);_0x2b78d9[_0x5665('0x33')]=_['intersection'](_0x4b9105[_0x5665('0x2e')],qs['fields'](_0x4e8b7e[_0x5665('0x30')]['fields']));_0x2b78d9[_0x5665('0x33')]=_0x2b78d9[_0x5665('0x33')][_0x5665('0x42')]?_0x2b78d9[_0x5665('0x33')]:_0x4b9105[_0x5665('0x2e')];_0x2b78d9[_0x5665('0x36')]=qs[_0x5665('0x37')](_0x4e8b7e[_0x5665('0x30')][_0x5665('0x37')]);_0x2b78d9['where']=qs[_0x5665('0x31')](_[_0x5665('0x57')](_0x4e8b7e['query'],_0x4b9105[_0x5665('0x31')]));if(_0x4e8b7e['query'][_0x5665('0x3a')]){_0x2b78d9[_0x5665('0x38')]=_['merge'](_0x2b78d9[_0x5665('0x38')],{'$or':_[_0x5665('0x29')](_0x2b78d9[_0x5665('0x33')],function(_0x9e5dac){var _0x29e8a4={};_0x29e8a4[_0x9e5dac]={'$like':'%'+_0x4e8b7e[_0x5665('0x30')]['filter']+'%'};return _0x29e8a4;})});}_0x2b78d9=_[_0x5665('0x39')]({},_0x2b78d9,_0x4e8b7e[_0x5665('0x54')]);return _0x3074fa[_0x5665('0x56')](_0x2b78d9);}})['then'](function(_0x3013de){if(_0x3013de){_0x1cf75b=_0x3013de[_0x5665('0x42')];if(!_0x4e8b7e[_0x5665('0x30')][_0x5665('0x35')](_0x5665('0x55'))){_0x2b78d9[_0x5665('0x18')]=qs[_0x5665('0x18')](_0x4e8b7e[_0x5665('0x30')][_0x5665('0x18')]);_0x2b78d9['offset']=qs[_0x5665('0x17')](_0x4e8b7e['query']['offset']);}return _0x3074fa[_0x5665('0x56')](_0x2b78d9);}})[_0x5665('0x1f')](function(_0x1c0619){if(_0x1c0619){return _0x1c0619?{'count':_0x1cf75b,'rows':_0x1c0619}:null;}})[_0x5665('0x1f')](respondWithResult(_0xed0432,null))[_0x5665('0x3f')](handleError(_0xed0432,null));};exports[_0x5665('0x58')]=function(_0x3c0aaf,_0x401e2e,_0x36da4e){if(_0x3c0aaf[_0x5665('0x4d')]['id']){delete _0x3c0aaf['body']['id'];}return db[_0x5665('0x3b')]['find']({'where':{'id':_0x3c0aaf[_0x5665('0x41')]['id']}})[_0x5665('0x1f')](handleEntityNotFound(_0x401e2e,null))[_0x5665('0x1f')](function(_0x3b63bb){if(_0x3b63bb){_0x3c0aaf[_0x5665('0x4d')]['TriggerId']=_0x3b63bb['id'];return db[_0x5665('0x59')]['create'](_0x3c0aaf[_0x5665('0x4d')]);}})['then'](respondWithResult(_0x401e2e,null))[_0x5665('0x3f')](handleError(_0x401e2e,null));};exports[_0x5665('0x5a')]=function(_0x1af38b,_0x29043b,_0xf07bd1){var _0x397b64={};var _0x3b7532={};var _0x24e942;var _0x1c5939;return db[_0x5665('0x3b')]['findOne']({'where':{'id':_0x1af38b[_0x5665('0x41')]['id']}})['then'](handleEntityNotFound(_0x29043b,null))[_0x5665('0x1f')](function(_0xce46b){if(_0xce46b){_0x24e942=_0xce46b;_0x3b7532[_0x5665('0x2e')]=_[_0x5665('0x2f')](db[_0x5665('0x59')][_0x5665('0x2a')]);_0x3b7532[_0x5665('0x30')]=_[_0x5665('0x2f')](_0x1af38b[_0x5665('0x30')]);_0x3b7532[_0x5665('0x31')]=_[_0x5665('0x32')](_0x3b7532[_0x5665('0x2e')],_0x3b7532[_0x5665('0x30')]);_0x397b64['attributes']=_[_0x5665('0x32')](_0x3b7532['model'],qs[_0x5665('0x34')](_0x1af38b['query'][_0x5665('0x34')]));_0x397b64[_0x5665('0x33')]=_0x397b64[_0x5665('0x33')]['length']?_0x397b64['attributes']:_0x3b7532['model'];_0x397b64[_0x5665('0x36')]=qs[_0x5665('0x37')](_0x1af38b['query'][_0x5665('0x37')]);_0x397b64['where']=qs[_0x5665('0x31')](_[_0x5665('0x57')](_0x1af38b[_0x5665('0x30')],_0x3b7532[_0x5665('0x31')]));if(_0x1af38b[_0x5665('0x30')][_0x5665('0x3a')]){_0x397b64[_0x5665('0x38')]=_['merge'](_0x397b64[_0x5665('0x38')],{'$or':_[_0x5665('0x29')](_0x397b64['attributes'],function(_0x1e4f98){var _0x343af3={};_0x343af3[_0x1e4f98]={'$like':'%'+_0x1af38b[_0x5665('0x30')][_0x5665('0x3a')]+'%'};return _0x343af3;})});}_0x397b64=_[_0x5665('0x39')]({},_0x397b64,_0x1af38b[_0x5665('0x54')]);return _0x24e942[_0x5665('0x5a')](_0x397b64);}})[_0x5665('0x1f')](function(_0x3f9085){if(_0x3f9085){_0x1c5939=_0x3f9085[_0x5665('0x42')];if(!_0x1af38b[_0x5665('0x30')]['hasOwnProperty'](_0x5665('0x55'))){_0x397b64[_0x5665('0x18')]=qs['limit'](_0x1af38b[_0x5665('0x30')][_0x5665('0x18')]);_0x397b64['offset']=qs[_0x5665('0x17')](_0x1af38b[_0x5665('0x30')][_0x5665('0x17')]);}return _0x24e942[_0x5665('0x5a')](_0x397b64);}})[_0x5665('0x1f')](function(_0x19a176){if(_0x19a176){return _0x19a176?{'count':_0x1c5939,'rows':_0x19a176}:null;}})[_0x5665('0x1f')](respondWithResult(_0x29043b,null))['catch'](handleError(_0x29043b,null));}; \ No newline at end of file +var _0xb906=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb906,0x117));var _0x6b90=function(_0xb171db,_0x522c6f){_0xb171db=_0xb171db-0x0;var _0x5248e8=_0xb906[_0xb171db];return _0x5248e8;};'use strict';var emlformat=require(_0x6b90('0x0'));var rimraf=require(_0x6b90('0x1'));var zipdir=require(_0x6b90('0x2'));var jsonpatch=require(_0x6b90('0x3'));var rp=require(_0x6b90('0x4'));var moment=require(_0x6b90('0x5'));var BPromise=require(_0x6b90('0x6'));var Mustache=require(_0x6b90('0x7'));var util=require(_0x6b90('0x8'));var path=require(_0x6b90('0x9'));var sox=require(_0x6b90('0xa'));var csv=require(_0x6b90('0xb'));var ejs=require(_0x6b90('0xc'));var fs=require('fs');var fs_extra=require(_0x6b90('0xd'));var _=require(_0x6b90('0xe'));var squel=require(_0x6b90('0xf'));var crypto=require(_0x6b90('0x10'));var jsforce=require(_0x6b90('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x6b90('0xb'));var querystring=require(_0x6b90('0x12'));var Papa=require('papaparse');var Redis=require(_0x6b90('0x13'));var authService=require(_0x6b90('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6b90('0x15'));var hardwareService=require(_0x6b90('0x16'));var logger=require(_0x6b90('0x17'))(_0x6b90('0x18'));var utils=require(_0x6b90('0x19'));var config=require(_0x6b90('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b90('0x1b'))['db'];function respondWithStatusCode(_0x2514d1,_0x446d10){_0x446d10=_0x446d10||0xcc;return function(_0x1b1ca6){if(_0x1b1ca6){return _0x2514d1[_0x6b90('0x1c')](_0x446d10);}return _0x2514d1[_0x6b90('0x1d')](_0x446d10)[_0x6b90('0x1e')]();};}function respondWithResult(_0x315efd,_0x5591bc){_0x5591bc=_0x5591bc||0xc8;return function(_0xaad13a){if(_0xaad13a){return _0x315efd[_0x6b90('0x1d')](_0x5591bc)[_0x6b90('0x1f')](_0xaad13a);}};}function respondWithFilteredResult(_0x23c93c,_0x224292){return function(_0x47d84b){if(_0x47d84b){var _0x52a4e5=typeof _0x224292[_0x6b90('0x20')]===_0x6b90('0x21')&&typeof _0x224292[_0x6b90('0x22')]===_0x6b90('0x21');var _0x395b00=_0x47d84b[_0x6b90('0x23')];var _0x52ac99=_0x52a4e5?0x0:_0x224292[_0x6b90('0x20')];var _0x143b1c=_0x52a4e5?_0x47d84b['count']:_0x224292['offset']+_0x224292[_0x6b90('0x22')];var _0x11845e;if(_0x143b1c>=_0x395b00){_0x143b1c=_0x395b00;_0x11845e=0xc8;}else{_0x11845e=0xce;}_0x23c93c[_0x6b90('0x1d')](_0x11845e);return _0x23c93c['set'](_0x6b90('0x24'),_0x52ac99+'-'+_0x143b1c+'/'+_0x395b00)[_0x6b90('0x1f')](_0x47d84b);}return null;};}function patchUpdates(_0x51a8f9){return function(_0x4480d8){try{jsonpatch[_0x6b90('0x25')](_0x4480d8,_0x51a8f9,!![]);}catch(_0x2687e0){return BPromise[_0x6b90('0x26')](_0x2687e0);}return _0x4480d8[_0x6b90('0x27')]();};}function saveUpdates(_0x2b0b90,_0x2b6c7a){return function(_0x216905){if(_0x216905){return _0x216905[_0x6b90('0x28')](_0x2b0b90)[_0x6b90('0x29')](function(_0x199d8b){return _0x199d8b;});}return null;};}function removeEntity(_0x1fec9a,_0x48acac){return function(_0x13b0df){if(_0x13b0df){return _0x13b0df[_0x6b90('0x2a')]()[_0x6b90('0x29')](function(){var _0x3cf55b=_0x13b0df[_0x6b90('0x2b')]({'plain':!![]});var _0x3b5012=_0x6b90('0x2c');return db[_0x6b90('0x2d')]['destroy']({'where':{'type':_0x3b5012,'resourceId':_0x3cf55b['id']}})[_0x6b90('0x29')](function(){return _0x13b0df;});})[_0x6b90('0x29')](function(){_0x1fec9a[_0x6b90('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c2f44,_0x210e49){return function(_0x2491ba){if(!_0x2491ba){_0x2c2f44[_0x6b90('0x1c')](0x194);}return _0x2491ba;};}function handleError(_0x2b6253,_0x2ffed5){_0x2ffed5=_0x2ffed5||0x1f4;return function(_0x1403c5){logger[_0x6b90('0x2e')](_0x1403c5[_0x6b90('0x2f')]);if(_0x1403c5[_0x6b90('0x30')]){delete _0x1403c5[_0x6b90('0x30')];}_0x2b6253['status'](_0x2ffed5)[_0x6b90('0x31')](_0x1403c5);};}exports[_0x6b90('0x32')]=function(_0x52d47b,_0x35bacb){var _0x3a22f1={},_0xcab119={},_0x38702b={'count':0x0,'rows':[]};var _0x350ad0=_[_0x6b90('0x33')](db[_0x6b90('0x34')][_0x6b90('0x35')],function(_0x5ad162){return{'name':_0x5ad162['fieldName'],'type':_0x5ad162[_0x6b90('0x36')][_0x6b90('0x37')]};});_0xcab119[_0x6b90('0x38')]=_[_0x6b90('0x33')](_0x350ad0,_0x6b90('0x30'));_0xcab119['query']=_['keys'](_0x52d47b['query']);_0xcab119[_0x6b90('0x39')]=_['intersection'](_0xcab119['model'],_0xcab119[_0x6b90('0x3a')]);_0x3a22f1[_0x6b90('0x3b')]=_[_0x6b90('0x3c')](_0xcab119[_0x6b90('0x38')],qs['fields'](_0x52d47b[_0x6b90('0x3a')][_0x6b90('0x3d')]));_0x3a22f1[_0x6b90('0x3b')]=_0x3a22f1[_0x6b90('0x3b')][_0x6b90('0x3e')]?_0x3a22f1['attributes']:_0xcab119[_0x6b90('0x38')];if(!_0x52d47b[_0x6b90('0x3a')][_0x6b90('0x3f')](_0x6b90('0x40'))){_0x3a22f1[_0x6b90('0x22')]=qs['limit'](_0x52d47b[_0x6b90('0x3a')][_0x6b90('0x22')]);_0x3a22f1[_0x6b90('0x20')]=qs[_0x6b90('0x20')](_0x52d47b[_0x6b90('0x3a')]['offset']);}_0x3a22f1[_0x6b90('0x41')]=qs[_0x6b90('0x42')](_0x52d47b['query'][_0x6b90('0x42')]);_0x3a22f1[_0x6b90('0x43')]=qs[_0x6b90('0x39')](_[_0x6b90('0x44')](_0x52d47b['query'],_0xcab119[_0x6b90('0x39')]),_0x350ad0);if(_0x52d47b[_0x6b90('0x3a')]['filter']){_0x3a22f1[_0x6b90('0x43')]=_[_0x6b90('0x45')](_0x3a22f1[_0x6b90('0x43')],{'$or':_[_0x6b90('0x33')](_0x350ad0,function(_0x230ba5){if(_0x230ba5[_0x6b90('0x36')]!==_0x6b90('0x46')){var _0x3bd98e={};_0x3bd98e[_0x230ba5[_0x6b90('0x30')]]={'$like':'%'+_0x52d47b[_0x6b90('0x3a')][_0x6b90('0x47')]+'%'};return _0x3bd98e;}})});}_0x3a22f1=_['merge']({},_0x3a22f1,_0x52d47b[_0x6b90('0x48')]);var _0x50ec03={'where':_0x3a22f1['where']};return db[_0x6b90('0x34')][_0x6b90('0x23')](_0x50ec03)[_0x6b90('0x29')](function(_0x9432a7){_0x38702b[_0x6b90('0x23')]=_0x9432a7;if(_0x52d47b[_0x6b90('0x3a')][_0x6b90('0x49')]){_0x3a22f1[_0x6b90('0x4a')]=[{'all':!![]}];}return db[_0x6b90('0x34')][_0x6b90('0x4b')](_0x3a22f1);})[_0x6b90('0x29')](function(_0x226ce7){_0x38702b[_0x6b90('0x4c')]=_0x226ce7;return _0x38702b;})[_0x6b90('0x29')](respondWithFilteredResult(_0x35bacb,_0x3a22f1))[_0x6b90('0x4d')](handleError(_0x35bacb,null));};exports['show']=function(_0x41114c,_0x2a48c6){var _0x23262a={'raw':![],'where':{'id':_0x41114c[_0x6b90('0x4e')]['id']}},_0x50ec25={};_0x50ec25[_0x6b90('0x38')]=_[_0x6b90('0x4f')](db[_0x6b90('0x34')][_0x6b90('0x35')]);_0x50ec25[_0x6b90('0x3a')]=_[_0x6b90('0x4f')](_0x41114c[_0x6b90('0x3a')]);_0x50ec25[_0x6b90('0x39')]=_[_0x6b90('0x3c')](_0x50ec25['model'],_0x50ec25['query']);_0x23262a['attributes']=_[_0x6b90('0x3c')](_0x50ec25['model'],qs[_0x6b90('0x3d')](_0x41114c[_0x6b90('0x3a')][_0x6b90('0x3d')]));_0x23262a[_0x6b90('0x3b')]=_0x23262a[_0x6b90('0x3b')][_0x6b90('0x3e')]?_0x23262a[_0x6b90('0x3b')]:_0x50ec25[_0x6b90('0x38')];if(_0x41114c['query']['includeAll']){_0x23262a[_0x6b90('0x4a')]=[{'all':!![]}];}_0x23262a=_[_0x6b90('0x45')]({},_0x23262a,_0x41114c['options']);return db[_0x6b90('0x34')][_0x6b90('0x50')](_0x23262a)[_0x6b90('0x29')](handleEntityNotFound(_0x2a48c6,null))[_0x6b90('0x29')](respondWithResult(_0x2a48c6,null))[_0x6b90('0x4d')](handleError(_0x2a48c6,null));};exports[_0x6b90('0x51')]=function(_0xbc6b3d,_0x49f763){return db[_0x6b90('0x34')]['create'](_0xbc6b3d[_0x6b90('0x52')],{})[_0x6b90('0x29')](function(_0x12813b){var _0x58a92b=_0xbc6b3d[_0x6b90('0x53')]['get']({'plain':!![]});if(!_0x58a92b)throw new Error(_0x6b90('0x54'));if(_0x58a92b[_0x6b90('0x55')]===_0x6b90('0x53')){var _0x3c511d=_0x12813b[_0x6b90('0x2b')]({'plain':!![]});var _0x156d45=_0x6b90('0x2c');return db[_0x6b90('0x56')][_0x6b90('0x50')]({'where':{'name':_0x156d45,'userProfileId':_0x58a92b['userProfileId']},'raw':!![]})[_0x6b90('0x29')](function(_0x40a3fc){if(_0x40a3fc&&_0x40a3fc['autoAssociation']===0x0){return db[_0x6b90('0x2d')][_0x6b90('0x51')]({'name':_0x3c511d['name'],'resourceId':_0x3c511d['id'],'type':_0x40a3fc[_0x6b90('0x30')],'sectionId':_0x40a3fc['id']},{})[_0x6b90('0x29')](function(){return _0x12813b;});}else{return _0x12813b;}})['catch'](function(_0x39406e){logger[_0x6b90('0x2e')](_0x6b90('0x57'),_0x39406e);throw _0x39406e;});}return _0x12813b;})[_0x6b90('0x29')](respondWithResult(_0x49f763,0xc9))[_0x6b90('0x4d')](handleError(_0x49f763,null));};exports[_0x6b90('0x28')]=function(_0x5224c7,_0x3b2016){if(_0x5224c7['body']['id']){delete _0x5224c7[_0x6b90('0x52')]['id'];}return db[_0x6b90('0x34')][_0x6b90('0x50')]({'where':{'id':_0x5224c7[_0x6b90('0x4e')]['id']}})[_0x6b90('0x29')](handleEntityNotFound(_0x3b2016,null))['then'](saveUpdates(_0x5224c7[_0x6b90('0x52')],null))[_0x6b90('0x29')](respondWithResult(_0x3b2016,null))[_0x6b90('0x4d')](handleError(_0x3b2016,null));};exports[_0x6b90('0x2a')]=function(_0x20d528,_0x140d10){return db[_0x6b90('0x34')]['find']({'where':{'id':_0x20d528[_0x6b90('0x4e')]['id']}})['then'](handleEntityNotFound(_0x140d10,null))[_0x6b90('0x29')](removeEntity(_0x140d10,null))[_0x6b90('0x4d')](handleError(_0x140d10,null));};exports[_0x6b90('0x58')]=function(_0x231597,_0xf269b9,_0x50a049){if(_0x231597[_0x6b90('0x52')]['id']){delete _0x231597['body']['id'];}return db[_0x6b90('0x34')][_0x6b90('0x50')]({'where':{'id':_0x231597['params']['id']}})[_0x6b90('0x29')](handleEntityNotFound(_0xf269b9,null))['then'](function(_0x3328ae){if(_0x3328ae){_0x231597[_0x6b90('0x52')][_0x6b90('0x59')]=_0x3328ae['id'];return db[_0x6b90('0x5a')]['create'](_0x231597['body']);}})['then'](respondWithResult(_0xf269b9,null))[_0x6b90('0x4d')](handleError(_0xf269b9,null));};exports[_0x6b90('0x5b')]=function(_0x456de1,_0x3f4d72,_0x5972ff){if(_0x456de1[_0x6b90('0x52')]['id']){delete _0x456de1[_0x6b90('0x52')]['id'];}return db[_0x6b90('0x34')][_0x6b90('0x50')]({'where':{'id':_0x456de1['params']['id']}})[_0x6b90('0x29')](handleEntityNotFound(_0x3f4d72,null))[_0x6b90('0x29')](function(_0x41d124){if(_0x41d124){_0x456de1[_0x6b90('0x52')][_0x6b90('0x5c')]=_0x41d124['id'];return db[_0x6b90('0x5a')]['create'](_0x456de1[_0x6b90('0x52')]);}})['then'](respondWithResult(_0x3f4d72,null))[_0x6b90('0x4d')](handleError(_0x3f4d72,null));};exports[_0x6b90('0x5d')]=function(_0x29e9eb,_0x18a24d,_0x44f227){var _0x210bf6={};var _0x4d5416={};var _0xe72433;var _0x1e8fdb;return db[_0x6b90('0x34')][_0x6b90('0x5e')]({'where':{'id':_0x29e9eb[_0x6b90('0x4e')]['id']}})[_0x6b90('0x29')](handleEntityNotFound(_0x18a24d,null))[_0x6b90('0x29')](function(_0x484c73){if(_0x484c73){_0xe72433=_0x484c73;_0x4d5416['model']=_[_0x6b90('0x4f')](db['Condition'][_0x6b90('0x35')]);_0x4d5416['query']=_['keys'](_0x29e9eb[_0x6b90('0x3a')]);_0x4d5416[_0x6b90('0x39')]=_['intersection'](_0x4d5416[_0x6b90('0x38')],_0x4d5416[_0x6b90('0x3a')]);_0x210bf6['attributes']=_['intersection'](_0x4d5416[_0x6b90('0x38')],qs[_0x6b90('0x3d')](_0x29e9eb['query'][_0x6b90('0x3d')]));_0x210bf6[_0x6b90('0x3b')]=_0x210bf6[_0x6b90('0x3b')]['length']?_0x210bf6['attributes']:_0x4d5416[_0x6b90('0x38')];_0x210bf6[_0x6b90('0x41')]=qs[_0x6b90('0x42')](_0x29e9eb[_0x6b90('0x3a')][_0x6b90('0x42')]);_0x210bf6[_0x6b90('0x43')]=qs['filters'](_[_0x6b90('0x44')](_0x29e9eb[_0x6b90('0x3a')],_0x4d5416[_0x6b90('0x39')]));if(_0x29e9eb[_0x6b90('0x3a')]['filter']){_0x210bf6[_0x6b90('0x43')]=_[_0x6b90('0x45')](_0x210bf6[_0x6b90('0x43')],{'$or':_[_0x6b90('0x33')](_0x210bf6[_0x6b90('0x3b')],function(_0x3dc1d5){var _0x451055={};_0x451055[_0x3dc1d5]={'$like':'%'+_0x29e9eb[_0x6b90('0x3a')]['filter']+'%'};return _0x451055;})});}_0x210bf6=_['merge']({},_0x210bf6,_0x29e9eb[_0x6b90('0x48')]);return _0xe72433[_0x6b90('0x5d')](_0x210bf6);}})[_0x6b90('0x29')](function(_0x466491){if(_0x466491){_0x1e8fdb=_0x466491[_0x6b90('0x3e')];if(!_0x29e9eb['query']['hasOwnProperty'](_0x6b90('0x40'))){_0x210bf6[_0x6b90('0x22')]=qs[_0x6b90('0x22')](_0x29e9eb[_0x6b90('0x3a')][_0x6b90('0x22')]);_0x210bf6['offset']=qs[_0x6b90('0x20')](_0x29e9eb[_0x6b90('0x3a')][_0x6b90('0x20')]);}return _0xe72433[_0x6b90('0x5d')](_0x210bf6);}})[_0x6b90('0x29')](function(_0x5d1d64){if(_0x5d1d64){return _0x5d1d64?{'count':_0x1e8fdb,'rows':_0x5d1d64}:null;}})['then'](respondWithResult(_0x18a24d,null))[_0x6b90('0x4d')](handleError(_0x18a24d,null));};exports[_0x6b90('0x5f')]=function(_0x3ff2e8,_0x1722d3,_0x43654a){var _0x261d8c={};var _0x5676a1={};var _0x3295fb;var _0x395252;return db[_0x6b90('0x34')][_0x6b90('0x5e')]({'where':{'id':_0x3ff2e8[_0x6b90('0x4e')]['id']}})[_0x6b90('0x29')](handleEntityNotFound(_0x1722d3,null))['then'](function(_0x526b27){if(_0x526b27){_0x3295fb=_0x526b27;_0x5676a1[_0x6b90('0x38')]=_[_0x6b90('0x4f')](db[_0x6b90('0x5a')][_0x6b90('0x35')]);_0x5676a1[_0x6b90('0x3a')]=_[_0x6b90('0x4f')](_0x3ff2e8[_0x6b90('0x3a')]);_0x5676a1[_0x6b90('0x39')]=_[_0x6b90('0x3c')](_0x5676a1[_0x6b90('0x38')],_0x5676a1[_0x6b90('0x3a')]);_0x261d8c[_0x6b90('0x3b')]=_[_0x6b90('0x3c')](_0x5676a1['model'],qs[_0x6b90('0x3d')](_0x3ff2e8[_0x6b90('0x3a')][_0x6b90('0x3d')]));_0x261d8c[_0x6b90('0x3b')]=_0x261d8c[_0x6b90('0x3b')][_0x6b90('0x3e')]?_0x261d8c[_0x6b90('0x3b')]:_0x5676a1['model'];_0x261d8c['order']=qs[_0x6b90('0x42')](_0x3ff2e8['query']['sort']);_0x261d8c[_0x6b90('0x43')]=qs[_0x6b90('0x39')](_[_0x6b90('0x44')](_0x3ff2e8[_0x6b90('0x3a')],_0x5676a1[_0x6b90('0x39')]));if(_0x3ff2e8[_0x6b90('0x3a')][_0x6b90('0x47')]){_0x261d8c[_0x6b90('0x43')]=_[_0x6b90('0x45')](_0x261d8c['where'],{'$or':_[_0x6b90('0x33')](_0x261d8c[_0x6b90('0x3b')],function(_0x9d2c92){var _0x3a44ae={};_0x3a44ae[_0x9d2c92]={'$like':'%'+_0x3ff2e8[_0x6b90('0x3a')][_0x6b90('0x47')]+'%'};return _0x3a44ae;})});}_0x261d8c=_[_0x6b90('0x45')]({},_0x261d8c,_0x3ff2e8['options']);return _0x3295fb[_0x6b90('0x5f')](_0x261d8c);}})[_0x6b90('0x29')](function(_0x3473c5){if(_0x3473c5){_0x395252=_0x3473c5[_0x6b90('0x3e')];if(!_0x3ff2e8[_0x6b90('0x3a')][_0x6b90('0x3f')](_0x6b90('0x40'))){_0x261d8c[_0x6b90('0x22')]=qs[_0x6b90('0x22')](_0x3ff2e8['query'][_0x6b90('0x22')]);_0x261d8c['offset']=qs[_0x6b90('0x20')](_0x3ff2e8[_0x6b90('0x3a')]['offset']);}return _0x3295fb[_0x6b90('0x5f')](_0x261d8c);}})['then'](function(_0xd41fa5){if(_0xd41fa5){return _0xd41fa5?{'count':_0x395252,'rows':_0xd41fa5}:null;}})[_0x6b90('0x29')](respondWithResult(_0x1722d3,null))[_0x6b90('0x4d')](handleError(_0x1722d3,null));};exports['addAction']=function(_0x389aad,_0x50a14a,_0x2daebb){if(_0x389aad[_0x6b90('0x52')]['id']){delete _0x389aad[_0x6b90('0x52')]['id'];}return db[_0x6b90('0x34')][_0x6b90('0x50')]({'where':{'id':_0x389aad['params']['id']}})['then'](handleEntityNotFound(_0x50a14a,null))[_0x6b90('0x29')](function(_0x517123){if(_0x517123){_0x389aad[_0x6b90('0x52')][_0x6b90('0x60')]=_0x517123['id'];return db['Action'][_0x6b90('0x51')](_0x389aad[_0x6b90('0x52')]);}})[_0x6b90('0x29')](respondWithResult(_0x50a14a,null))[_0x6b90('0x4d')](handleError(_0x50a14a,null));};exports[_0x6b90('0x61')]=function(_0x243757,_0x4e8eed,_0x37a2de){var _0x543a28={};var _0x297c9e={};var _0x17c3fd;var _0x4a00b7;return db[_0x6b90('0x34')][_0x6b90('0x5e')]({'where':{'id':_0x243757[_0x6b90('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4e8eed,null))[_0x6b90('0x29')](function(_0x8e65e3){if(_0x8e65e3){_0x17c3fd=_0x8e65e3;_0x297c9e[_0x6b90('0x38')]=_[_0x6b90('0x4f')](db[_0x6b90('0x62')][_0x6b90('0x35')]);_0x297c9e[_0x6b90('0x3a')]=_[_0x6b90('0x4f')](_0x243757['query']);_0x297c9e['filters']=_[_0x6b90('0x3c')](_0x297c9e[_0x6b90('0x38')],_0x297c9e[_0x6b90('0x3a')]);_0x543a28[_0x6b90('0x3b')]=_[_0x6b90('0x3c')](_0x297c9e[_0x6b90('0x38')],qs['fields'](_0x243757[_0x6b90('0x3a')][_0x6b90('0x3d')]));_0x543a28[_0x6b90('0x3b')]=_0x543a28['attributes'][_0x6b90('0x3e')]?_0x543a28[_0x6b90('0x3b')]:_0x297c9e['model'];_0x543a28[_0x6b90('0x41')]=qs['sort'](_0x243757['query']['sort']);_0x543a28['where']=qs[_0x6b90('0x39')](_[_0x6b90('0x44')](_0x243757['query'],_0x297c9e[_0x6b90('0x39')]));if(_0x243757[_0x6b90('0x3a')][_0x6b90('0x47')]){_0x543a28['where']=_[_0x6b90('0x45')](_0x543a28[_0x6b90('0x43')],{'$or':_[_0x6b90('0x33')](_0x543a28[_0x6b90('0x3b')],function(_0x523624){var _0x31419a={};_0x31419a[_0x523624]={'$like':'%'+_0x243757['query']['filter']+'%'};return _0x31419a;})});}_0x543a28=_[_0x6b90('0x45')]({},_0x543a28,_0x243757[_0x6b90('0x48')]);return _0x17c3fd[_0x6b90('0x61')](_0x543a28);}})[_0x6b90('0x29')](function(_0x5bb663){if(_0x5bb663){_0x4a00b7=_0x5bb663[_0x6b90('0x3e')];if(!_0x243757[_0x6b90('0x3a')][_0x6b90('0x3f')](_0x6b90('0x40'))){_0x543a28['limit']=qs[_0x6b90('0x22')](_0x243757[_0x6b90('0x3a')][_0x6b90('0x22')]);_0x543a28[_0x6b90('0x20')]=qs[_0x6b90('0x20')](_0x243757[_0x6b90('0x3a')][_0x6b90('0x20')]);}return _0x17c3fd[_0x6b90('0x61')](_0x543a28);}})['then'](function(_0xe9c784){if(_0xe9c784){return _0xe9c784?{'count':_0x4a00b7,'rows':_0xe9c784}:null;}})[_0x6b90('0x29')](respondWithResult(_0x4e8eed,null))[_0x6b90('0x4d')](handleError(_0x4e8eed,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 1cd4dd6..fd5800f 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 _0x03ce=['api','bluebird','request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger'];(function(_0x34bfb7,_0x127cc8){var _0x422dfd=function(_0x4f5ef0){while(--_0x4f5ef0){_0x34bfb7['push'](_0x34bfb7['shift']());}};_0x422dfd(++_0x127cc8);}(_0x03ce,0x1a1));var _0xe03c=function(_0x4b10a6,_0x4f867a){_0x4b10a6=_0x4b10a6-0x0;var _0x1dd2fd=_0x03ce[_0x4b10a6];return _0x1dd2fd;};'use strict';var _=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var logger=require(_0xe03c('0x2'))(_0xe03c('0x3'));var moment=require('moment');var BPromise=require(_0xe03c('0x4'));var rp=require(_0xe03c('0x5'));var fs=require('fs');var path=require(_0xe03c('0x6'));var rimraf=require('rimraf');var config=require(_0xe03c('0x7'));var attributes=require(_0xe03c('0x8'));module[_0xe03c('0x9')]=function(_0x2c0e4b,_0x4340f0){return _0x2c0e4b[_0xe03c('0xa')](_0xe03c('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15cb=['exports','define','Trigger','tools_triggers','util','api','bluebird','request-promise','path','rimraf','./trigger.attributes'];(function(_0x200989,_0x42c55b){var _0x5a2166=function(_0x2dc992){while(--_0x2dc992){_0x200989['push'](_0x200989['shift']());}};_0x5a2166(++_0x42c55b);}(_0x15cb,0x16f));var _0xb15c=function(_0x2f5ceb,_0x5408e2){_0x2f5ceb=_0x2f5ceb-0x0;var _0x55541d=_0x15cb[_0x2f5ceb];return _0x55541d;};'use strict';var _=require('lodash');var util=require(_0xb15c('0x0'));var logger=require('../../config/logger')(_0xb15c('0x1'));var moment=require('moment');var BPromise=require(_0xb15c('0x2'));var rp=require(_0xb15c('0x3'));var fs=require('fs');var path=require(_0xb15c('0x4'));var rimraf=require(_0xb15c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb15c('0x6'));module[_0xb15c('0x7')]=function(_0x50ea76,_0x5a1b40){return _0x50ea76[_0xb15c('0x8')](_0xb15c('0x9'),attributes,{'tableName':_0xb15c('0xa'),'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 d4330db..ba266d6 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 _0x6bd2=['ShowTrigger','Trigger','find','raw','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','findAll','options','attributes','include','map','model','debug'];(function(_0x49c93b,_0x1a56b5){var _0x1cc6f0=function(_0x5707f7){while(--_0x5707f7){_0x49c93b['push'](_0x49c93b['shift']());}};_0x1cc6f0(++_0x1a56b5);}(_0x6bd2,0x12d));var _0x26bd=function(_0x3a6cb1,_0x4be29d){_0x3a6cb1=_0x3a6cb1-0x0;var _0x5b4b3f=_0x6bd2[_0x3a6cb1];return _0x5b4b3f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x26bd('0x0'));var BPromise=require('bluebird');var rs=require(_0x26bd('0x1'));var fs=require('fs');var Redis=require(_0x26bd('0x2'));var db=require(_0x26bd('0x3'))['db'];var utils=require(_0x26bd('0x4'));var logger=require(_0x26bd('0x5'))(_0x26bd('0x6'));var config=require(_0x26bd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x26bd('0x8')][_0x26bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x128f3e,_0xe48d01,_0x26041a){return new BPromise(function(_0x46bc42,_0x32fda7){return client['request'](_0x128f3e,_0x26041a)[_0x26bd('0xa')](function(_0x19a0e9){logger[_0x26bd('0xb')](_0x26bd('0xc'),_0xe48d01,_0x26bd('0xd'));logger['debug'](_0x26bd('0xe'),_0xe48d01,_0x26bd('0xd'),JSON[_0x26bd('0xf')](_0x19a0e9));if(_0x19a0e9['error']){if(_0x19a0e9[_0x26bd('0x10')][_0x26bd('0x11')]===0x1f4){logger[_0x26bd('0x10')](_0x26bd('0xc'),_0xe48d01,_0x19a0e9[_0x26bd('0x10')][_0x26bd('0x12')]);return _0x32fda7(_0x19a0e9[_0x26bd('0x10')][_0x26bd('0x12')]);}logger['error'](_0x26bd('0xc'),_0xe48d01,_0x19a0e9['error']['message']);return _0x46bc42(_0x19a0e9[_0x26bd('0x10')][_0x26bd('0x12')]);}else{logger[_0x26bd('0xb')](_0x26bd('0xc'),_0xe48d01,_0x26bd('0xd'));_0x46bc42(_0x19a0e9[_0x26bd('0x13')][_0x26bd('0x12')]);}})[_0x26bd('0x14')](function(_0x4940d9){logger[_0x26bd('0x10')](_0x26bd('0xc'),_0xe48d01,_0x4940d9);_0x32fda7(_0x4940d9);});});}exports[_0x26bd('0x15')]=function(_0x3a574d){var _0x168c9d=this;return new Promise(function(_0x2ceeec,_0x25aa9f){return db['Trigger'][_0x26bd('0x16')]({'raw':_0x3a574d[_0x26bd('0x17')]?_0x3a574d[_0x26bd('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3a574d['options']?_0x3a574d[_0x26bd('0x17')]['where']||null:null,'attributes':_0x3a574d[_0x26bd('0x17')]?_0x3a574d[_0x26bd('0x17')][_0x26bd('0x18')]||null:null,'limit':_0x3a574d[_0x26bd('0x17')]?_0x3a574d[_0x26bd('0x17')]['limit']||null:null,'include':_0x3a574d[_0x26bd('0x17')]?_0x3a574d[_0x26bd('0x17')][_0x26bd('0x19')]?_[_0x26bd('0x1a')](_0x3a574d['options'][_0x26bd('0x19')],function(_0x36318c){return{'model':db[_0x36318c[_0x26bd('0x1b')]],'as':_0x36318c['as'],'attributes':_0x36318c[_0x26bd('0x18')],'include':_0x36318c[_0x26bd('0x19')]?_[_0x26bd('0x1a')](_0x36318c['include'],function(_0x3059c3){return{'model':db[_0x3059c3[_0x26bd('0x1b')]],'as':_0x3059c3['as'],'attributes':_0x3059c3[_0x26bd('0x18')],'include':_0x3059c3[_0x26bd('0x19')]?_[_0x26bd('0x1a')](_0x3059c3[_0x26bd('0x19')],function(_0x209662){return{'model':db[_0x209662[_0x26bd('0x1b')]],'as':_0x209662['as'],'attributes':_0x209662[_0x26bd('0x18')]};}):[]};}):[]};}):[]:[]})[_0x26bd('0xa')](function(_0x251658){logger['info'](_0x26bd('0x15'),_0x3a574d);logger[_0x26bd('0x1c')](_0x26bd('0x15'),_0x3a574d,JSON['stringify'](_0x251658));_0x2ceeec(_0x251658);})[_0x26bd('0x14')](function(_0x6629ef){logger['error'](_0x26bd('0x15'),_0x6629ef[_0x26bd('0x12')],_0x3a574d);_0x25aa9f(_0x168c9d[_0x26bd('0x10')](0x1f4,_0x6629ef[_0x26bd('0x12')]));});});};exports[_0x26bd('0x1d')]=function(_0x4347c0){var _0x32bc4a=this;return new Promise(function(_0xc60ca8,_0x4105a3){return db[_0x26bd('0x1e')][_0x26bd('0x1f')]({'raw':_0x4347c0[_0x26bd('0x17')]?_0x4347c0[_0x26bd('0x17')][_0x26bd('0x20')]===undefined?!![]:![]:!![],'where':_0x4347c0[_0x26bd('0x17')]?_0x4347c0[_0x26bd('0x17')]['where']||null:null,'attributes':_0x4347c0[_0x26bd('0x17')]?_0x4347c0[_0x26bd('0x17')][_0x26bd('0x18')]||null:null,'include':_0x4347c0['options']?_0x4347c0[_0x26bd('0x17')][_0x26bd('0x19')]?_['map'](_0x4347c0['options'][_0x26bd('0x19')],function(_0x3c7cf6){return{'model':db[_0x3c7cf6[_0x26bd('0x1b')]],'as':_0x3c7cf6['as'],'attributes':_0x3c7cf6['attributes'],'include':_0x3c7cf6[_0x26bd('0x19')]?_['map'](_0x3c7cf6[_0x26bd('0x19')],function(_0x2bfdd6){return{'model':db[_0x2bfdd6['model']],'as':_0x2bfdd6['as'],'attributes':_0x2bfdd6[_0x26bd('0x18')],'include':_0x2bfdd6[_0x26bd('0x19')]?_[_0x26bd('0x1a')](_0x2bfdd6[_0x26bd('0x19')],function(_0x2348d8){return{'model':db[_0x2348d8['model']],'as':_0x2348d8['as'],'attributes':_0x2348d8[_0x26bd('0x18')]};}):[]};}):[]};}):[]:[]})[_0x26bd('0xa')](function(_0x24299d){logger[_0x26bd('0xb')](_0x26bd('0x1d'),_0x4347c0);logger[_0x26bd('0x1c')](_0x26bd('0x1d'),_0x4347c0,JSON[_0x26bd('0xf')](_0x24299d));_0xc60ca8(_0x24299d);})[_0x26bd('0x14')](function(_0x3a458a){logger[_0x26bd('0x10')]('ShowTrigger',_0x3a458a[_0x26bd('0x12')],_0x4347c0);_0x4105a3(_0x32bc4a[_0x26bd('0x10')](0x1f4,_0x3a458a[_0x26bd('0x12')]));});});}; \ No newline at end of file +var _0xb13e=['catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','ShowTrigger','find','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x1b87a6,_0x4b11a0){var _0x3f2b76=function(_0xb685ec){while(--_0xb685ec){_0x1b87a6['push'](_0x1b87a6['shift']());}};_0x3f2b76(++_0x4b11a0);}(_0xb13e,0xa3));var _0xeb13=function(_0x1beb63,_0x406f49){_0x1beb63=_0x1beb63-0x0;var _0x267c0b=_0xb13e[_0x1beb63];return _0x267c0b;};'use strict';var _=require(_0xeb13('0x0'));var util=require(_0xeb13('0x1'));var moment=require(_0xeb13('0x2'));var BPromise=require(_0xeb13('0x3'));var rs=require(_0xeb13('0x4'));var fs=require('fs');var Redis=require(_0xeb13('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb13('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xeb13('0x7'));var jayson=require(_0xeb13('0x8'));var client=jayson[_0xeb13('0x9')][_0xeb13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x171b81,_0x229cb9,_0x440db0){return new BPromise(function(_0x3c186b,_0x4ca715){return client[_0xeb13('0xb')](_0x171b81,_0x440db0)['then'](function(_0x38a3d9){logger['info'](_0xeb13('0xc'),_0x229cb9,_0xeb13('0xd'));logger[_0xeb13('0xe')](_0xeb13('0xf'),_0x229cb9,_0xeb13('0xd'),JSON[_0xeb13('0x10')](_0x38a3d9));if(_0x38a3d9[_0xeb13('0x11')]){if(_0x38a3d9['error'][_0xeb13('0x12')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x229cb9,_0x38a3d9['error'][_0xeb13('0x13')]);return _0x4ca715(_0x38a3d9[_0xeb13('0x11')]['message']);}logger[_0xeb13('0x11')](_0xeb13('0xc'),_0x229cb9,_0x38a3d9[_0xeb13('0x11')]['message']);return _0x3c186b(_0x38a3d9[_0xeb13('0x11')]['message']);}else{logger[_0xeb13('0x14')](_0xeb13('0xc'),_0x229cb9,_0xeb13('0xd'));_0x3c186b(_0x38a3d9[_0xeb13('0x15')][_0xeb13('0x13')]);}})[_0xeb13('0x16')](function(_0x20b29b){logger[_0xeb13('0x11')](_0xeb13('0xc'),_0x229cb9,_0x20b29b);_0x4ca715(_0x20b29b);});});}exports[_0xeb13('0x17')]=function(_0x116123){var _0x5d04e5=this;return new Promise(function(_0x3e9762,_0x423641){return db[_0xeb13('0x18')][_0xeb13('0x19')]({'raw':_0x116123[_0xeb13('0x1a')]?_0x116123[_0xeb13('0x1a')][_0xeb13('0x1b')]===undefined?!![]:![]:!![],'where':_0x116123['options']?_0x116123[_0xeb13('0x1a')]['where']||null:null,'attributes':_0x116123[_0xeb13('0x1a')]?_0x116123[_0xeb13('0x1a')][_0xeb13('0x1c')]||null:null,'limit':_0x116123['options']?_0x116123[_0xeb13('0x1a')][_0xeb13('0x1d')]||null:null,'include':_0x116123[_0xeb13('0x1a')]?_0x116123[_0xeb13('0x1a')][_0xeb13('0x1e')]?_[_0xeb13('0x1f')](_0x116123[_0xeb13('0x1a')][_0xeb13('0x1e')],function(_0x47c3a2){return{'model':db[_0x47c3a2[_0xeb13('0x20')]],'as':_0x47c3a2['as'],'attributes':_0x47c3a2[_0xeb13('0x1c')],'include':_0x47c3a2[_0xeb13('0x1e')]?_[_0xeb13('0x1f')](_0x47c3a2[_0xeb13('0x1e')],function(_0x11ef54){return{'model':db[_0x11ef54[_0xeb13('0x20')]],'as':_0x11ef54['as'],'attributes':_0x11ef54[_0xeb13('0x1c')],'include':_0x11ef54[_0xeb13('0x1e')]?_[_0xeb13('0x1f')](_0x11ef54[_0xeb13('0x1e')],function(_0xbcb3ef){return{'model':db[_0xbcb3ef[_0xeb13('0x20')]],'as':_0xbcb3ef['as'],'attributes':_0xbcb3ef['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x446994){logger[_0xeb13('0x14')](_0xeb13('0x17'),_0x116123);logger[_0xeb13('0xe')](_0xeb13('0x17'),_0x116123,JSON['stringify'](_0x446994));_0x3e9762(_0x446994);})[_0xeb13('0x16')](function(_0x1bb295){logger['error'](_0xeb13('0x17'),_0x1bb295[_0xeb13('0x13')],_0x116123);_0x423641(_0x5d04e5['error'](0x1f4,_0x1bb295[_0xeb13('0x13')]));});});};exports[_0xeb13('0x21')]=function(_0x5b6d73){var _0x241b5c=this;return new Promise(function(_0x362bd6,_0x5d9f28){return db[_0xeb13('0x18')][_0xeb13('0x22')]({'raw':_0x5b6d73[_0xeb13('0x1a')]?_0x5b6d73[_0xeb13('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5b6d73[_0xeb13('0x1a')]?_0x5b6d73[_0xeb13('0x1a')][_0xeb13('0x23')]||null:null,'attributes':_0x5b6d73[_0xeb13('0x1a')]?_0x5b6d73[_0xeb13('0x1a')]['attributes']||null:null,'include':_0x5b6d73[_0xeb13('0x1a')]?_0x5b6d73[_0xeb13('0x1a')]['include']?_['map'](_0x5b6d73[_0xeb13('0x1a')][_0xeb13('0x1e')],function(_0x19ce96){return{'model':db[_0x19ce96['model']],'as':_0x19ce96['as'],'attributes':_0x19ce96[_0xeb13('0x1c')],'include':_0x19ce96[_0xeb13('0x1e')]?_[_0xeb13('0x1f')](_0x19ce96[_0xeb13('0x1e')],function(_0x55ecb3){return{'model':db[_0x55ecb3['model']],'as':_0x55ecb3['as'],'attributes':_0x55ecb3[_0xeb13('0x1c')],'include':_0x55ecb3[_0xeb13('0x1e')]?_[_0xeb13('0x1f')](_0x55ecb3[_0xeb13('0x1e')],function(_0x455d8a){return{'model':db[_0x455d8a[_0xeb13('0x20')]],'as':_0x455d8a['as'],'attributes':_0x455d8a[_0xeb13('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xeb13('0x24')](function(_0x5e48d6){logger[_0xeb13('0x14')](_0xeb13('0x21'),_0x5b6d73);logger[_0xeb13('0xe')](_0xeb13('0x21'),_0x5b6d73,JSON[_0xeb13('0x10')](_0x5e48d6));_0x362bd6(_0x5e48d6);})[_0xeb13('0x16')](function(_0x1d94a3){logger[_0xeb13('0x11')]('ShowTrigger',_0x1d94a3[_0xeb13('0x13')],_0x5b6d73);_0x5d9f28(_0x241b5c[_0xeb13('0x11')](0x1f4,_0x1d94a3[_0xeb13('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index def67bf..643f70e 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 _0xfc3a=['update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','clone','put'];(function(_0x547206,_0x33c3da){var _0x5cb60b=function(_0x30d9b1){while(--_0x30d9b1){_0x547206['push'](_0x547206['shift']());}};_0x5cb60b(++_0x33c3da);}(_0xfc3a,0xde));var _0xafc3=function(_0x4bdad0,_0x359279){_0x4bdad0=_0x4bdad0-0x0;var _0x4eb0a2=_0xfc3a[_0x4bdad0];return _0x4eb0a2;};'use strict';var multer=require(_0xafc3('0x0'));var util=require(_0xafc3('0x1'));var path=require(_0xafc3('0x2'));var timeout=require(_0xafc3('0x3'));var express=require(_0xafc3('0x4'));var router=express[_0xafc3('0x5')]();var fs_extra=require(_0xafc3('0x6'));var auth=require(_0xafc3('0x7'));var interaction=require(_0xafc3('0x8'));var config=require(_0xafc3('0x9'));var controller=require(_0xafc3('0xa'));router['get']('/',auth[_0xafc3('0xb')](),controller[_0xafc3('0xc')]);router[_0xafc3('0xd')](_0xafc3('0xe'),auth[_0xafc3('0xb')](),controller[_0xafc3('0xf')]);router[_0xafc3('0x10')](_0xafc3('0x11'),auth[_0xafc3('0xb')](),controller[_0xafc3('0x12')]);router[_0xafc3('0x10')]('/',auth[_0xafc3('0xb')](),controller['create']);router[_0xafc3('0x13')](_0xafc3('0xe'),auth[_0xafc3('0xb')](),controller[_0xafc3('0x14')]);router['delete']('/:id',auth[_0xafc3('0xb')](),controller[_0xafc3('0x15')]);module['exports']=router; \ No newline at end of file +var _0xb455=['./trunk.controller','get','index','/:id','isAuthenticated','post','/:id/clone','clone','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0xc20a4a,_0x5e99d1){var _0xf9298e=function(_0x56892b){while(--_0x56892b){_0xc20a4a['push'](_0xc20a4a['shift']());}};_0xf9298e(++_0x5e99d1);}(_0xb455,0x185));var _0x5b45=function(_0x47be2e,_0x21eb4b){_0x47be2e=_0x47be2e-0x0;var _0xdc585b=_0xb455[_0x47be2e];return _0xdc585b;};'use strict';var multer=require(_0x5b45('0x0'));var util=require(_0x5b45('0x1'));var path=require(_0x5b45('0x2'));var timeout=require(_0x5b45('0x3'));var express=require('express');var router=express[_0x5b45('0x4')]();var fs_extra=require(_0x5b45('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5b45('0x6'));var config=require('../../config/environment');var controller=require(_0x5b45('0x7'));router[_0x5b45('0x8')]('/',auth['isAuthenticated'](),controller[_0x5b45('0x9')]);router[_0x5b45('0x8')](_0x5b45('0xa'),auth[_0x5b45('0xb')](),controller['show']);router[_0x5b45('0xc')](_0x5b45('0xd'),auth[_0x5b45('0xb')](),controller[_0x5b45('0xe')]);router[_0x5b45('0xc')]('/',auth[_0x5b45('0xb')](),controller['create']);router[_0x5b45('0xf')](_0x5b45('0xa'),auth['isAuthenticated'](),controller[_0x5b45('0x10')]);router['delete']('/:id',auth[_0x5b45('0xb')](),controller['destroy']);module[_0x5b45('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 700512c..1776515 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 _0x81aa=['getDataValue','split','rfc2833','info','inband','auto','nonat','update','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','INTEGER','always','accept','refuse','originate','uac','uas','active','passive','actpass','dynamic','update,nonat','BOOLEAN','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join'];(function(_0x2e6600,_0x385f2a){var _0x4d7785=function(_0x136ca9){while(--_0x136ca9){_0x2e6600['push'](_0x2e6600['shift']());}};_0x4d7785(++_0x385f2a);}(_0x81aa,0xd9));var _0xa81a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x81aa[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa81a('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x2'),'user',_0xa81a('0x3')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa81a('0x4')],'allowNull':![],'defaultValue':_0xa81a('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xa81a('0x6'),_0xa81a('0x7'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xa81a('0x8'),_0xa81a('0x9'))},'deny':{'type':Sequelize[_0xa81a('0x4')]},'permit':{'type':Sequelize[_0xa81a('0x4')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xa81a('0x4')],'defaultValue':_0xa81a('0xa'),'set':function(_0x4d5bbe){this['setDataValue'](_0xa81a('0xb'),_0x4d5bbe?_0x4d5bbe[_0xa81a('0xc')](','):null);},'get':function(){return this[_0xa81a('0xd')](_0xa81a('0xb'))?this[_0xa81a('0xd')](_0xa81a('0xb'))[_0xa81a('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0xf'),_0xa81a('0x10'),'shortinfo',_0xa81a('0x11'),_0xa81a('0x12')),'defaultValue':_0xa81a('0xf')},'directmedia':{'type':Sequelize[_0xa81a('0x1')]('yes','no',_0xa81a('0x13'),_0xa81a('0x14'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa81a('0x1')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xa81a('0x4')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xa81a('0x15'),'set':function(_0x2e9930){this[_0xa81a('0x16')](_0xa81a('0x17'),_0x2e9930?_0x2e9930[_0xa81a('0xc')](','):null);},'get':function(){return this[_0xa81a('0xd')](_0xa81a('0x17'))?this[_0xa81a('0xd')](_0xa81a('0x17'))[_0xa81a('0xe')](','):null;},'comment':_0xa81a('0x18')},'callgroup':{'type':Sequelize[_0xa81a('0x4')]},'namedcallgroup':{'type':Sequelize[_0xa81a('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xa81a('0x4')]},'language':{'type':Sequelize[_0xa81a('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa81a('0x4')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xa81a('0x19')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa81a('0x1a'),'set':function(_0x498000){this[_0xa81a('0x16')]('allow',_0x498000?_0x498000[_0xa81a('0xc')](';'):_0xa81a('0x1a'));},'get':function(){return this[_0xa81a('0xd')](_0xa81a('0x1b'))?this[_0xa81a('0xd')](_0xa81a('0x1b'))[_0xa81a('0xe')](';'):null;},'comment':_0xa81a('0x1c')},'autoframing':{'type':Sequelize[_0xa81a('0x1')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xa81a('0x1d'),'set':function(_0x59c61b){this[_0xa81a('0x16')](_0xa81a('0x1e'),_0x59c61b?_0x59c61b[_0xa81a('0xc')](','):null);},'get':function(){return this[_0xa81a('0xd')](_0xa81a('0x1e'))?this[_0xa81a('0xd')](_0xa81a('0x1e'))['split'](','):null;},'comment':_0xa81a('0x1f')},'trustrpid':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa81a('0x1')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no','never')},'promiscredir':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'useclientcode':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xa81a('0x4')]},'callerid':{'type':Sequelize[_0xa81a('0x4')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xa81a('0x4')]},'callcounter':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no'),'defaultValue':_0xa81a('0x20')},'busylevel':{'type':Sequelize[_0xa81a('0x21')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xa81a('0x20'),'no')},'allowsubscribe':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'allowtransfer':{'type':Sequelize[_0xa81a('0x1')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'subscribecontext':{'type':Sequelize[_0xa81a('0x4')]},'template':{'type':Sequelize[_0xa81a('0x4')]},'videosupport':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no',_0xa81a('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa81a('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xa81a('0x20'),'no')},'mailbox':{'type':Sequelize[_0xa81a('0x4')]},'session_timers':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x23'),_0xa81a('0x24'),_0xa81a('0x25'))},'session_expires':{'type':Sequelize[_0xa81a('0x21')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xa81a('0x26'),_0xa81a('0x27')),'defaultValue':_0xa81a('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xa81a('0x4')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xa81a('0x4')]},'fromuser':{'type':Sequelize[_0xa81a('0x4')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no'),'defaultValue':_0xa81a('0x20')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xa81a('0x4')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xa81a('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa81a('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa81a('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa81a('0x4')]},'callbackextension':{'type':Sequelize[_0xa81a('0x4')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xa81a('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0xa81a('0x4')]},'contactdeny':{'type':Sequelize[_0xa81a('0x4')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xa81a('0x4')]},'use_q850_reason':{'type':Sequelize[_0xa81a('0x4')]},'maxforwards':{'type':Sequelize[_0xa81a('0x21')](0xb)},'encryption':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa81a('0x20'),'no')},'force_avp':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xa81a('0x20'),'no')},'dtlsenable':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'dtlsverify':{'type':Sequelize[_0xa81a('0x1')]('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0xa81a('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa81a('0x4')]},'dtlsprivatekey':{'type':Sequelize[_0xa81a('0x4')]},'dtlscipher':{'type':Sequelize[_0xa81a('0x4')]},'dtlscafile':{'type':Sequelize[_0xa81a('0x4')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0xa81a('0x28'),_0xa81a('0x29'),_0xa81a('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa81a('0x4')]},'usereqphone':{'type':Sequelize[_0xa81a('0x1')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa81a('0x4')]},'recordofffeature':{'type':Sequelize[_0xa81a('0x4')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'subscribemwi':{'type':Sequelize[_0xa81a('0x1')](_0xa81a('0x20'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xa81a('0x4')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xa81a('0x4')]},'description':{'type':Sequelize[_0xa81a('0x4')]},'host':{'type':Sequelize[_0xa81a('0x4')],'defaultValue':_0xa81a('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0xa81a('0x20'),'no',_0xa81a('0x13'),_0xa81a('0x14'),_0xa81a('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xa81a('0x4')]},'active':{'type':Sequelize[_0xa81a('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa81a('0x4')],'defaultValue':'no'}}; \ No newline at end of file +var _0xe52b=['\x22\x22\x20<>','always','accept','originate','uac','uas','fingerprint','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','nonat','update','outgoing','yes','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER'];(function(_0x505afe,_0x3a23e9){var _0x4f38a6=function(_0x455d4e){while(--_0x455d4e){_0x505afe['push'](_0x505afe['shift']());}};_0x4f38a6(++_0x3a23e9);}(_0xe52b,0x1cf));var _0xbe52=function(_0x5bef39,_0x12095f){_0x5bef39=_0x5bef39-0x0;var _0x132ed8=_0xe52b[_0x5bef39];return _0x132ed8;};'use strict';var Sequelize=require(_0xbe52('0x0'));module[_0xbe52('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbe52('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x4'),'user',_0xbe52('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xbe52('0x6')],'allowNull':![],'defaultValue':_0xbe52('0x7')},'callingpres':{'type':Sequelize[_0xbe52('0x3')]('ALLOWED_NOT_SCREENED',_0xbe52('0x8'),_0xbe52('0x9'),'ALLOWED',_0xbe52('0xa'),_0xbe52('0xb'),_0xbe52('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0xbe52('0x6')]},'permit':{'type':Sequelize[_0xbe52('0x6')]},'secret':{'type':Sequelize[_0xbe52('0x6')]},'md5secret':{'type':Sequelize[_0xbe52('0x6')]},'remotesecret':{'type':Sequelize[_0xbe52('0x6')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbe52('0xd'),'set':function(_0x30bdb4){this[_0xbe52('0xe')](_0xbe52('0xf'),_0x30bdb4?_0x30bdb4[_0xbe52('0x10')](','):null);},'get':function(){return this[_0xbe52('0x11')](_0xbe52('0xf'))?this[_0xbe52('0x11')](_0xbe52('0xf'))['split'](','):null;},'comment':_0xbe52('0x12')},'dtmfmode':{'type':Sequelize[_0xbe52('0x3')]('rfc2833',_0xbe52('0x13'),_0xbe52('0x14'),_0xbe52('0x15'),_0xbe52('0x16')),'defaultValue':_0xbe52('0x17')},'directmedia':{'type':Sequelize[_0xbe52('0x3')]('yes','no',_0xbe52('0x18'),_0xbe52('0x19'),_0xbe52('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbe52('0x6')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xbe52('0x6')],'defaultValue':_0xbe52('0x1c'),'set':function(_0x3b3cb9){this['setDataValue'](_0xbe52('0x1d'),_0x3b3cb9?_0x3b3cb9['join'](','):null);},'get':function(){return this[_0xbe52('0x11')]('nat')?this[_0xbe52('0x11')](_0xbe52('0x1d'))[_0xbe52('0x1e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xbe52('0x6')]},'pickupgroup':{'type':Sequelize[_0xbe52('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xbe52('0x6')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbe52('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xbe52('0x6')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbe52('0x1f'),'set':function(_0x2d96a6){this[_0xbe52('0xe')](_0xbe52('0x20'),_0x2d96a6?_0x2d96a6['join'](';'):_0xbe52('0x1f'));},'get':function(){return this[_0xbe52('0x11')](_0xbe52('0x20'))?this['getDataValue'](_0xbe52('0x20'))[_0xbe52('0x1e')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xbe52('0x21'),'set':function(_0x310e70){this['setDataValue']('insecure',_0x310e70?_0x310e70[_0xbe52('0x10')](','):null);},'get':function(){return this[_0xbe52('0x11')](_0xbe52('0x22'))?this['getDataValue'](_0xbe52('0x22'))[_0xbe52('0x1e')](','):null;},'comment':_0xbe52('0x23')},'trustrpid':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no','never')},'promiscredir':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no')},'accountcode':{'type':Sequelize[_0xbe52('0x24')](0xb)},'setvar':{'type':Sequelize[_0xbe52('0x6')]},'callerid':{'type':Sequelize[_0xbe52('0x6')],'defaultValue':_0xbe52('0x25')},'amaflags':{'type':Sequelize[_0xbe52('0x6')]},'callcounter':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no'),'defaultValue':_0xbe52('0x1b')},'busylevel':{'type':Sequelize[_0xbe52('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xbe52('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0xbe52('0x6')]},'template':{'type':Sequelize[_0xbe52('0x6')]},'videosupport':{'type':Sequelize['ENUM'](_0xbe52('0x1b'),'no',_0xbe52('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbe52('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no')},'mailbox':{'type':Sequelize[_0xbe52('0x6')]},'session_timers':{'type':Sequelize['ENUM'](_0xbe52('0x27'),'refuse',_0xbe52('0x28'))},'session_expires':{'type':Sequelize[_0xbe52('0x24')](0xb)},'session_minse':{'type':Sequelize[_0xbe52('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbe52('0x29'),_0xbe52('0x2a')),'defaultValue':_0xbe52('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xbe52('0x6')]},'regexten':{'type':Sequelize[_0xbe52('0x6')]},'fromdomain':{'type':Sequelize[_0xbe52('0x6')]},'fromuser':{'type':Sequelize[_0xbe52('0x6')]},'port':{'type':Sequelize[_0xbe52('0x24')](0x5)},'qualify':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no'),'defaultValue':_0xbe52('0x1b')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbe52('0x6')]},'defaultuser':{'type':Sequelize[_0xbe52('0x6')]},'rtptimeout':{'type':Sequelize[_0xbe52('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbe52('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbe52('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbe52('0x6')]},'callbackextension':{'type':Sequelize[_0xbe52('0x6')]},'timert1':{'type':Sequelize[_0xbe52('0x24')](0xb)},'timerb':{'type':Sequelize[_0xbe52('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xbe52('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xbe52('0x6')]},'contactdeny':{'type':Sequelize[_0xbe52('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbe52('0x6')]},'use_q850_reason':{'type':Sequelize[_0xbe52('0x6')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbe52('0x3')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0xbe52('0x1b'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xbe52('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no',_0xbe52('0x2b'),_0xbe52('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xbe52('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xbe52('0x6')]},'dtlscipher':{'type':Sequelize[_0xbe52('0x6')]},'dtlscafile':{'type':Sequelize[_0xbe52('0x6')]},'dtlscapath':{'type':Sequelize[_0xbe52('0x6')]},'dtlssetup':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x2d'),'passive',_0xbe52('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbe52('0x6')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbe52('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xbe52('0x3')](_0xbe52('0x1b'),'no')},'vmexten':{'type':Sequelize[_0xbe52('0x6')]},'mohinterpret':{'type':Sequelize[_0xbe52('0x6')]},'mohsuggest':{'type':Sequelize[_0xbe52('0x6')]},'parkinglot':{'type':Sequelize[_0xbe52('0x6')]},'description':{'type':Sequelize[_0xbe52('0x6')]},'host':{'type':Sequelize[_0xbe52('0x6')],'defaultValue':_0xbe52('0x2f')},'canreinvite':{'type':Sequelize['ENUM'](_0xbe52('0x1b'),'no',_0xbe52('0x18'),_0xbe52('0x19'),_0xbe52('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbe52('0x6')]},'otherFields':{'type':Sequelize[_0xbe52('0x6')]},'active':{'type':Sequelize[_0xbe52('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbe52('0x6')],'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 ca7c2fa..ce8372f 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 _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','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','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4b84,0x1cc));var _0x44b8=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0x4b84[_0x33c603];return _0xae96f4;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,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(_0x5f511c,_0xbfed54){var _0x5d431b=function(_0xc15e1f){while(--_0xc15e1f){_0x5f511c['push'](_0x5f511c['shift']());}};_0x5d431b(++_0xbfed54);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1d34e9,_0x427ead){_0x1d34e9=_0x1d34e9-0x0;var _0x50896a=_0x8d0e[_0x1d34e9];return _0x50896a;};'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 e3d79e8..6e51f7e 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 _0x3afc=['Trunk','tools_trunks','../../config/logger','api','path','../../config/environment','./trunk.attributes','define'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x3afc,0x92));var _0xc3af=function(_0x50e88a,_0x1bff93){_0x50e88a=_0x50e88a-0x0;var _0x67b096=_0x3afc[_0x50e88a];return _0x67b096;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3af('0x0'))(_0xc3af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3af('0x2'));var rimraf=require('rimraf');var config=require(_0xc3af('0x3'));var attributes=require(_0xc3af('0x4'));module['exports']=function(_0x272eb2,_0x24cb73){return _0x272eb2[_0xc3af('0x5')](_0xc3af('0x6'),attributes,{'tableName':_0xc3af('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a91=['moment','bluebird','request-promise','./trunk.attributes','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x5edaf9,_0x1f6a59){var _0x1920d0=function(_0x4f21b7){while(--_0x4f21b7){_0x5edaf9['push'](_0x5edaf9['shift']());}};_0x1920d0(++_0x1f6a59);}(_0x7a91,0x164));var _0x17a9=function(_0x4e25fe,_0x24b0c2){_0x4e25fe=_0x4e25fe-0x0;var _0x17fc4d=_0x7a91[_0x4e25fe];return _0x17fc4d;};'use strict';var _=require(_0x17a9('0x0'));var util=require(_0x17a9('0x1'));var logger=require(_0x17a9('0x2'))(_0x17a9('0x3'));var moment=require(_0x17a9('0x4'));var BPromise=require(_0x17a9('0x5'));var rp=require(_0x17a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x17a9('0x7'));module['exports']=function(_0x22433e,_0x1a156e){return _0x22433e['define'](_0x17a9('0x8'),attributes,{'tableName':_0x17a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 6fba3e5..1c5536b 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 _0x5e3b=['catch','GetTrunk','Trunk','options','attributes','limit','include','model','map','debug','find','raw','ShowTrunk','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x5e3b,0x10d));var _0xb5e3=function(_0x2ebc3c,_0x3688f0){_0x2ebc3c=_0x2ebc3c-0x0;var _0x33c07e=_0x5e3b[_0x2ebc3c];return _0x33c07e;};'use strict';var _=require('lodash');var util=require(_0xb5e3('0x0'));var moment=require(_0xb5e3('0x1'));var BPromise=require(_0xb5e3('0x2'));var rs=require(_0xb5e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5e3('0x4'))['db'];var utils=require(_0xb5e3('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb5e3('0x6')][_0xb5e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5b81c2,_0x286e86,_0x47b219){return new BPromise(function(_0x2dbd07,_0x3885ee){return client[_0xb5e3('0x8')](_0x5b81c2,_0x47b219)[_0xb5e3('0x9')](function(_0x3deee3){logger[_0xb5e3('0xa')](_0xb5e3('0xb'),_0x286e86,_0xb5e3('0xc'));logger['debug'](_0xb5e3('0xd'),_0x286e86,_0xb5e3('0xc'),JSON[_0xb5e3('0xe')](_0x3deee3));if(_0x3deee3[_0xb5e3('0xf')]){if(_0x3deee3[_0xb5e3('0xf')][_0xb5e3('0x10')]===0x1f4){logger[_0xb5e3('0xf')](_0xb5e3('0xb'),_0x286e86,_0x3deee3[_0xb5e3('0xf')]['message']);return _0x3885ee(_0x3deee3['error'][_0xb5e3('0x11')]);}logger['error'](_0xb5e3('0xb'),_0x286e86,_0x3deee3[_0xb5e3('0xf')][_0xb5e3('0x11')]);return _0x2dbd07(_0x3deee3[_0xb5e3('0xf')][_0xb5e3('0x11')]);}else{logger['info'](_0xb5e3('0xb'),_0x286e86,_0xb5e3('0xc'));_0x2dbd07(_0x3deee3[_0xb5e3('0x12')][_0xb5e3('0x11')]);}})[_0xb5e3('0x13')](function(_0x1a608c){logger[_0xb5e3('0xf')](_0xb5e3('0xb'),_0x286e86,_0x1a608c);_0x3885ee(_0x1a608c);});});}exports[_0xb5e3('0x14')]=function(_0x3b09d1){var _0x292105=this;return new Promise(function(_0x5dcd62,_0x5e7854){return db[_0xb5e3('0x15')]['findAll']({'raw':_0x3b09d1['options']?_0x3b09d1['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b09d1[_0xb5e3('0x16')]?_0x3b09d1[_0xb5e3('0x16')]['where']||null:null,'attributes':_0x3b09d1['options']?_0x3b09d1[_0xb5e3('0x16')][_0xb5e3('0x17')]||null:null,'limit':_0x3b09d1[_0xb5e3('0x16')]?_0x3b09d1[_0xb5e3('0x16')][_0xb5e3('0x18')]||null:null,'include':_0x3b09d1[_0xb5e3('0x16')]?_0x3b09d1[_0xb5e3('0x16')][_0xb5e3('0x19')]?_['map'](_0x3b09d1[_0xb5e3('0x16')][_0xb5e3('0x19')],function(_0xe59ef1){return{'model':db[_0xe59ef1[_0xb5e3('0x1a')]],'as':_0xe59ef1['as'],'attributes':_0xe59ef1[_0xb5e3('0x17')],'include':_0xe59ef1[_0xb5e3('0x19')]?_['map'](_0xe59ef1[_0xb5e3('0x19')],function(_0x21f61e){return{'model':db[_0x21f61e[_0xb5e3('0x1a')]],'as':_0x21f61e['as'],'attributes':_0x21f61e[_0xb5e3('0x17')],'include':_0x21f61e[_0xb5e3('0x19')]?_[_0xb5e3('0x1b')](_0x21f61e[_0xb5e3('0x19')],function(_0x1f1546){return{'model':db[_0x1f1546[_0xb5e3('0x1a')]],'as':_0x1f1546['as'],'attributes':_0x1f1546['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5e3('0x9')](function(_0x4d8156){logger[_0xb5e3('0xa')](_0xb5e3('0x14'),_0x3b09d1);logger[_0xb5e3('0x1c')]('GetTrunk',_0x3b09d1,JSON['stringify'](_0x4d8156));_0x5dcd62(_0x4d8156);})[_0xb5e3('0x13')](function(_0x40b55a){logger[_0xb5e3('0xf')]('GetTrunk',_0x40b55a[_0xb5e3('0x11')],_0x3b09d1);_0x5e7854(_0x292105[_0xb5e3('0xf')](0x1f4,_0x40b55a['message']));});});};exports['ShowTrunk']=function(_0x334ec5){var _0x996a7e=this;return new Promise(function(_0x97d26e,_0x2263f6){return db[_0xb5e3('0x15')][_0xb5e3('0x1d')]({'raw':_0x334ec5[_0xb5e3('0x16')]?_0x334ec5['options'][_0xb5e3('0x1e')]===undefined?!![]:![]:!![],'where':_0x334ec5[_0xb5e3('0x16')]?_0x334ec5[_0xb5e3('0x16')]['where']||null:null,'attributes':_0x334ec5[_0xb5e3('0x16')]?_0x334ec5['options'][_0xb5e3('0x17')]||null:null,'include':_0x334ec5[_0xb5e3('0x16')]?_0x334ec5[_0xb5e3('0x16')][_0xb5e3('0x19')]?_[_0xb5e3('0x1b')](_0x334ec5['options'][_0xb5e3('0x19')],function(_0x2a3c02){return{'model':db[_0x2a3c02[_0xb5e3('0x1a')]],'as':_0x2a3c02['as'],'attributes':_0x2a3c02[_0xb5e3('0x17')],'include':_0x2a3c02[_0xb5e3('0x19')]?_[_0xb5e3('0x1b')](_0x2a3c02[_0xb5e3('0x19')],function(_0x17a18e){return{'model':db[_0x17a18e[_0xb5e3('0x1a')]],'as':_0x17a18e['as'],'attributes':_0x17a18e[_0xb5e3('0x17')],'include':_0x17a18e['include']?_[_0xb5e3('0x1b')](_0x17a18e[_0xb5e3('0x19')],function(_0x403b36){return{'model':db[_0x403b36['model']],'as':_0x403b36['as'],'attributes':_0x403b36[_0xb5e3('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb5e3('0x9')](function(_0x2816fa){logger['info'](_0xb5e3('0x1f'),_0x334ec5);logger['debug'](_0xb5e3('0x1f'),_0x334ec5,JSON[_0xb5e3('0xe')](_0x2816fa));_0x97d26e(_0x2816fa);})[_0xb5e3('0x13')](function(_0x35a776){logger[_0xb5e3('0xf')](_0xb5e3('0x1f'),_0x35a776[_0xb5e3('0x11')],_0x334ec5);_0x2263f6(_0x996a7e[_0xb5e3('0xf')](0x1f4,_0x35a776['message']));});});}; \ No newline at end of file +var _0x6e56=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','map','include','model','stringify','ShowTrunk','util','bluebird','randomstring'];(function(_0x1a83fc,_0x42d49c){var _0x3a18ca=function(_0x440c50){while(--_0x440c50){_0x1a83fc['push'](_0x1a83fc['shift']());}};_0x3a18ca(++_0x42d49c);}(_0x6e56,0x17d));var _0x66e5=function(_0x2f09f7,_0x461707){_0x2f09f7=_0x2f09f7-0x0;var _0x1b266c=_0x6e56[_0x2f09f7];return _0x1b266c;};'use strict';var _=require('lodash');var util=require(_0x66e5('0x0'));var moment=require('moment');var BPromise=require(_0x66e5('0x1'));var rs=require(_0x66e5('0x2'));var fs=require('fs');var Redis=require(_0x66e5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x66e5('0x4'));var logger=require(_0x66e5('0x5'))('rpc');var config=require(_0x66e5('0x6'));var jayson=require(_0x66e5('0x7'));var client=jayson['client'][_0x66e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x160946,_0x5beff2,_0x488d28){return new BPromise(function(_0x4029a0,_0x1c7784){return client[_0x66e5('0x9')](_0x160946,_0x488d28)[_0x66e5('0xa')](function(_0x5cb393){logger[_0x66e5('0xb')]('Trunk,\x20%s,\x20%s',_0x5beff2,'request\x20sent');logger[_0x66e5('0xc')](_0x66e5('0xd'),_0x5beff2,'request\x20sent',JSON['stringify'](_0x5cb393));if(_0x5cb393[_0x66e5('0xe')]){if(_0x5cb393[_0x66e5('0xe')][_0x66e5('0xf')]===0x1f4){logger[_0x66e5('0xe')](_0x66e5('0x10'),_0x5beff2,_0x5cb393[_0x66e5('0xe')][_0x66e5('0x11')]);return _0x1c7784(_0x5cb393['error'][_0x66e5('0x11')]);}logger[_0x66e5('0xe')](_0x66e5('0x10'),_0x5beff2,_0x5cb393[_0x66e5('0xe')]['message']);return _0x4029a0(_0x5cb393[_0x66e5('0xe')][_0x66e5('0x11')]);}else{logger[_0x66e5('0xb')](_0x66e5('0x10'),_0x5beff2,_0x66e5('0x12'));_0x4029a0(_0x5cb393[_0x66e5('0x13')]['message']);}})[_0x66e5('0x14')](function(_0x1ed47c){logger[_0x66e5('0xe')](_0x66e5('0x10'),_0x5beff2,_0x1ed47c);_0x1c7784(_0x1ed47c);});});}exports[_0x66e5('0x15')]=function(_0x3488ec){var _0x299a97=this;return new Promise(function(_0x52ad74,_0x1bfcdb){return db[_0x66e5('0x16')][_0x66e5('0x17')]({'raw':_0x3488ec[_0x66e5('0x18')]?_0x3488ec[_0x66e5('0x18')][_0x66e5('0x19')]===undefined?!![]:![]:!![],'where':_0x3488ec[_0x66e5('0x18')]?_0x3488ec[_0x66e5('0x18')]['where']||null:null,'attributes':_0x3488ec['options']?_0x3488ec['options'][_0x66e5('0x1a')]||null:null,'limit':_0x3488ec[_0x66e5('0x18')]?_0x3488ec[_0x66e5('0x18')]['limit']||null:null,'include':_0x3488ec[_0x66e5('0x18')]?_0x3488ec[_0x66e5('0x18')]['include']?_[_0x66e5('0x1b')](_0x3488ec[_0x66e5('0x18')][_0x66e5('0x1c')],function(_0x25df12){return{'model':db[_0x25df12['model']],'as':_0x25df12['as'],'attributes':_0x25df12[_0x66e5('0x1a')],'include':_0x25df12['include']?_['map'](_0x25df12[_0x66e5('0x1c')],function(_0x58609e){return{'model':db[_0x58609e[_0x66e5('0x1d')]],'as':_0x58609e['as'],'attributes':_0x58609e[_0x66e5('0x1a')],'include':_0x58609e[_0x66e5('0x1c')]?_[_0x66e5('0x1b')](_0x58609e[_0x66e5('0x1c')],function(_0xb5321a){return{'model':db[_0xb5321a[_0x66e5('0x1d')]],'as':_0xb5321a['as'],'attributes':_0xb5321a[_0x66e5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x66e5('0xa')](function(_0xe1d7c1){logger[_0x66e5('0xb')](_0x66e5('0x15'),_0x3488ec);logger['debug'](_0x66e5('0x15'),_0x3488ec,JSON[_0x66e5('0x1e')](_0xe1d7c1));_0x52ad74(_0xe1d7c1);})['catch'](function(_0xad1325){logger[_0x66e5('0xe')]('GetTrunk',_0xad1325[_0x66e5('0x11')],_0x3488ec);_0x1bfcdb(_0x299a97[_0x66e5('0xe')](0x1f4,_0xad1325[_0x66e5('0x11')]));});});};exports[_0x66e5('0x1f')]=function(_0xe8ff90){var _0x37a2ba=this;return new Promise(function(_0x18f5cf,_0x5edc5b){return db[_0x66e5('0x16')]['find']({'raw':_0xe8ff90['options']?_0xe8ff90[_0x66e5('0x18')][_0x66e5('0x19')]===undefined?!![]:![]:!![],'where':_0xe8ff90['options']?_0xe8ff90[_0x66e5('0x18')]['where']||null:null,'attributes':_0xe8ff90[_0x66e5('0x18')]?_0xe8ff90[_0x66e5('0x18')]['attributes']||null:null,'include':_0xe8ff90['options']?_0xe8ff90[_0x66e5('0x18')][_0x66e5('0x1c')]?_[_0x66e5('0x1b')](_0xe8ff90['options']['include'],function(_0x3c9228){return{'model':db[_0x3c9228['model']],'as':_0x3c9228['as'],'attributes':_0x3c9228['attributes'],'include':_0x3c9228[_0x66e5('0x1c')]?_[_0x66e5('0x1b')](_0x3c9228[_0x66e5('0x1c')],function(_0xa022fb){return{'model':db[_0xa022fb[_0x66e5('0x1d')]],'as':_0xa022fb['as'],'attributes':_0xa022fb[_0x66e5('0x1a')],'include':_0xa022fb['include']?_[_0x66e5('0x1b')](_0xa022fb[_0x66e5('0x1c')],function(_0x218438){return{'model':db[_0x218438[_0x66e5('0x1d')]],'as':_0x218438['as'],'attributes':_0x218438[_0x66e5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x66e5('0xa')](function(_0x2ed150){logger[_0x66e5('0xb')](_0x66e5('0x1f'),_0xe8ff90);logger[_0x66e5('0xc')](_0x66e5('0x1f'),_0xe8ff90,JSON[_0x66e5('0x1e')](_0x2ed150));_0x18f5cf(_0x2ed150);})['catch'](function(_0x4f5601){logger[_0x66e5('0xe')](_0x66e5('0x1f'),_0x4f5601[_0x66e5('0x11')],_0xe8ff90);_0x5edc5b(_0x37a2ba['error'](0x1f4,_0x4f5601[_0x66e5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index e321fbb..4154ea0 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 _0x942b=['isAuthenticated','update','exports','express','Router','../../components/auth/service','./user-setting.controller'];(function(_0x3284cd,_0x2e10a2){var _0xe92280=function(_0x398d2e){while(--_0x398d2e){_0x3284cd['push'](_0x3284cd['shift']());}};_0xe92280(++_0x2e10a2);}(_0x942b,0x13e));var _0xb942=function(_0x58c580,_0x5aaf23){_0x58c580=_0x58c580-0x0;var _0x175efe=_0x942b[_0x58c580];return _0x175efe;};'use strict';var express=require(_0xb942('0x0'));var router=express[_0xb942('0x1')]();var auth=require(_0xb942('0x2'));var controller=require(_0xb942('0x3'));router['put']('/:id',auth[_0xb942('0x4')](),controller[_0xb942('0x5')]);module[_0xb942('0x6')]=router; \ No newline at end of file +var _0xc79d=['./user-setting.controller','put','isAuthenticated','update','express','Router','../../components/auth/service'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xc79d,0xe4));var _0xdc79=function(_0x27409f,_0x1c2a13){_0x27409f=_0x27409f-0x0;var _0x4959cf=_0xc79d[_0x27409f];return _0x4959cf;};'use strict';var express=require(_0xdc79('0x0'));var router=express[_0xdc79('0x1')]();var auth=require(_0xdc79('0x2'));var controller=require(_0xdc79('0x3'));router[_0xdc79('0x4')]('/:id',auth[_0xdc79('0x5')](),controller[_0xdc79('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 542bd11..c46ef21 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 _0xf315=['sequelize','warning','info','exports','error','TEXT','DATE'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf315,0x196));var _0x5f31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf315[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5f31('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x5f31('0x1'),_0x5f31('0x2'),'debug'];module[_0x5f31('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x5f31('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x5f31('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x5f31('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0xe14c=['TEXT','DATE','INTEGER','UserId','sequelize','error','warning','debug','exports'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xe14c,0x187));var _0xce14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe14c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xce14('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xce14('0x1'),_0xce14('0x2'),'info',_0xce14('0x3')];module[_0xce14('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xce14('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xce14('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xce14('0x7')],'unique':_0xce14('0x8')}}; \ 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 a300eaf..4355efe 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 _0x80ce=['socket.io-emitter','redis','./user-setting.socket','localhost','json','update','then','error','stack','name','status','send','user','role','admin','params','UserSetting','find','body','catch','api','../../config/environment'];(function(_0x160abf,_0x5ab336){var _0x3636f9=function(_0x5ca575){while(--_0x5ca575){_0x160abf['push'](_0x160abf['shift']());}};_0x3636f9(++_0x5ab336);}(_0x80ce,0xae));var _0xe80c=function(_0x3bf8f0,_0x3976e0){_0x3bf8f0=_0x3bf8f0-0x0;var _0xc90ee7=_0x80ce[_0x3bf8f0];return _0xc90ee7;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require('../../config/logger')(_0xe80c('0x0'));var config=require(_0xe80c('0x1'));var db=require('../../mysqldb')['db'];var socket=require(_0xe80c('0x2'))(new Redis(config[_0xe80c('0x3')]));require(_0xe80c('0x4'))['register'](socket);config['redis']=_['defaults'](config[_0xe80c('0x3')],{'host':_0xe80c('0x5'),'port':0x18eb});function respondWithResult(_0x320a7e,_0x704aa3){_0x704aa3=_0x704aa3||0xc8;return function(_0x591a4a){if(_0x591a4a){return _0x320a7e['status'](_0x704aa3)[_0xe80c('0x6')](_0x591a4a);}};}function saveUpdates(_0x1d4902){return function(_0x59634e){if(_0x59634e){return _0x59634e[_0xe80c('0x7')](_0x1d4902)[_0xe80c('0x8')](function(_0x1338af){return _0x1338af;});}return null;};}function handleEntityNotFound(_0x3cfbeb){return function(_0x75b98f){if(!_0x75b98f){_0x3cfbeb['sendStatus'](0x194);}return _0x75b98f;};}function handleError(_0x514b92,_0x56eb15){_0x56eb15=_0x56eb15||0x1f4;return function(_0xa08bf1){logger[_0xe80c('0x9')](_0xa08bf1[_0xe80c('0xa')]);if(_0xa08bf1[_0xe80c('0xb')]){delete _0xa08bf1[_0xe80c('0xb')];}_0x514b92[_0xe80c('0xc')](_0x56eb15)[_0xe80c('0xd')](_0xa08bf1);};}exports[_0xe80c('0x7')]=function(_0x1de1ac,_0x3665a0){if(_0x1de1ac[_0xe80c('0xe')][_0xe80c('0xf')]!==_0xe80c('0x10'))throw new Error('Unauthorized');if(isNaN(Number(_0x1de1ac[_0xe80c('0x11')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xe80c('0x12')][_0xe80c('0x13')]({'where':{'id':_0x1de1ac[_0xe80c('0x11')]['id']}})['then'](handleEntityNotFound(_0x3665a0,null))[_0xe80c('0x8')](saveUpdates(_0x1de1ac[_0xe80c('0x14')],null))['then'](respondWithResult(_0x3665a0,null))[_0xe80c('0x15')](handleError(_0x3665a0,null));}; \ No newline at end of file +var _0x544f=['socket.io-emitter','./user-setting.socket','register','defaults','redis','json','then','sendStatus','error','stack','name','send','update','role','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','body','catch','lodash','api','../../config/environment','../../mysqldb'];(function(_0x1003eb,_0x2a01d5){var _0x1080bd=function(_0x7cf71c){while(--_0x7cf71c){_0x1003eb['push'](_0x1003eb['shift']());}};_0x1080bd(++_0x2a01d5);}(_0x544f,0x14c));var _0xf544=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x544f[_0x8b8564];return _0x360c61;};'use strict';var _=require(_0xf544('0x0'));var Redis=require('ioredis');var logger=require('../../config/logger')(_0xf544('0x1'));var config=require(_0xf544('0x2'));var db=require(_0xf544('0x3'))['db'];var socket=require(_0xf544('0x4'))(new Redis(config['redis']));require(_0xf544('0x5'))[_0xf544('0x6')](socket);config['redis']=_[_0xf544('0x7')](config[_0xf544('0x8')],{'host':'localhost','port':0x18eb});function respondWithResult(_0xdb52e7,_0x2ce041){_0x2ce041=_0x2ce041||0xc8;return function(_0x1749cc){if(_0x1749cc){return _0xdb52e7['status'](_0x2ce041)[_0xf544('0x9')](_0x1749cc);}};}function saveUpdates(_0x5f445c){return function(_0x258808){if(_0x258808){return _0x258808['update'](_0x5f445c)[_0xf544('0xa')](function(_0x4a042d){return _0x4a042d;});}return null;};}function handleEntityNotFound(_0x445fbe){return function(_0x47e00a){if(!_0x47e00a){_0x445fbe[_0xf544('0xb')](0x194);}return _0x47e00a;};}function handleError(_0x166f77,_0x28cac4){_0x28cac4=_0x28cac4||0x1f4;return function(_0x3c23d6){logger[_0xf544('0xc')](_0x3c23d6[_0xf544('0xd')]);if(_0x3c23d6[_0xf544('0xe')]){delete _0x3c23d6[_0xf544('0xe')];}_0x166f77['status'](_0x28cac4)[_0xf544('0xf')](_0x3c23d6);};}exports[_0xf544('0x10')]=function(_0x56c8d4,_0x4903e1){if(_0x56c8d4['user'][_0xf544('0x11')]!=='admin')throw new Error(_0xf544('0x12'));if(isNaN(Number(_0x56c8d4['params']['id'])))throw new Error(_0xf544('0x13'));return db['UserSetting'][_0xf544('0x14')]({'where':{'id':_0x56c8d4[_0xf544('0x15')]['id']}})[_0xf544('0xa')](handleEntityNotFound(_0x4903e1,null))['then'](saveUpdates(_0x56c8d4[_0xf544('0x16')],null))[_0xf544('0xa')](respondWithResult(_0x4903e1,null))[_0xf544('0x17')](handleError(_0x4903e1,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 41ee405..9fe68ef 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 _0x5439=['hasOwnProperty','hook','exports','events','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x12f384,_0x50043d){var _0xaff984=function(_0x3ff1d8){while(--_0x3ff1d8){_0x12f384['push'](_0x12f384['shift']());}};_0xaff984(++_0x50043d);}(_0x5439,0x1d9));var _0x9543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5439[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x9543('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x9543('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x9543('0x2')](0x0);var events={'afterCreate':_0x9543('0x3'),'afterUpdate':_0x9543('0x4'),'afterDestroy':_0x9543('0x5')};function emitEvent(_0x58e96e){return function(_0x3b2903,_0x4d120f,_0x544473){UserSettingEvents[_0x9543('0x6')](_0x58e96e+':'+_0x3b2903['id'],_0x3b2903);UserSettingEvents[_0x9543('0x6')](_0x58e96e,_0x3b2903);_0x544473(null);};}for(var e in events){if(events[_0x9543('0x7')](e)){var event=events[e];UserSetting[_0x9543('0x8')](e,emitEvent(event));}}module[_0x9543('0x9')]=UserSettingEvents; \ No newline at end of file +var _0xa900=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x232af6,_0x170b06){var _0x40871b=function(_0x4f7e44){while(--_0x4f7e44){_0x232af6['push'](_0x232af6['shift']());}};_0x40871b(++_0x170b06);}(_0xa900,0x1a3));var _0x0a90=function(_0xf74ddb,_0x8383bd){_0xf74ddb=_0xf74ddb-0x0;var _0x44e4cd=_0xa900[_0xf74ddb];return _0x44e4cd;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x0a90('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x0a90('0x1')](0x0);var events={'afterCreate':_0x0a90('0x2'),'afterUpdate':'update','afterDestroy':_0x0a90('0x3')};function emitEvent(_0x49b6e0){return function(_0x445937,_0x5f3130,_0x463190){UserSettingEvents[_0x0a90('0x4')](_0x49b6e0+':'+_0x445937['id'],_0x445937);UserSettingEvents[_0x0a90('0x4')](_0x49b6e0,_0x445937);_0x463190(null);};}for(var e in events){if(events[_0x0a90('0x5')](e)){var event=events[e];UserSetting[_0x0a90('0x6')](e,emitEvent(event));}}module[_0x0a90('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 95d0ff6..629b07e 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 _0x2b65=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x29ab13,_0x374b25){var _0xd01223=function(_0x1d9933){while(--_0x1d9933){_0x29ab13['push'](_0x29ab13['shift']());}};_0xd01223(++_0x374b25);}(_0x2b65,0x131));var _0x52b6=function(_0x119f6a,_0x594d77){_0x119f6a=_0x119f6a-0x0;var _0x4c00a3=_0x2b65[_0x119f6a];return _0x4c00a3;};'use strict';var attributes=require(_0x52b6('0x0'));module[_0x52b6('0x1')]=function(_0x9b1a2c){return _0x9b1a2c[_0x52b6('0x2')](_0x52b6('0x3'),attributes,{'tableName':_0x52b6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x141913){if(!_0x141913[_0x52b6('0x5')])_0x141913['clientSideLoggingEnabledSince']=null;else if(_0x141913[_0x52b6('0x6')]===null)_0x141913[_0x52b6('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x96cc=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x5a69ab,_0x610049){var _0x27f2f7=function(_0x452a0c){while(--_0x452a0c){_0x5a69ab['push'](_0x5a69ab['shift']());}};_0x27f2f7(++_0x610049);}(_0x96cc,0x16c));var _0xc96c=function(_0x324277,_0xa7681f){_0x324277=_0x324277-0x0;var _0x42965e=_0x96cc[_0x324277];return _0x42965e;};'use strict';var attributes=require(_0xc96c('0x0'));module['exports']=function(_0x15025f){return _0x15025f['define'](_0xc96c('0x1'),attributes,{'tableName':_0xc96c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x107043){if(!_0x107043[_0xc96c('0x3')])_0x107043[_0xc96c('0x4')]=null;else if(_0x107043[_0xc96c('0x4')]===null)_0x107043[_0xc96c('0x4')]=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 e615c65..f7fcc36 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 _0x940c=['user-setting:update','UserId','register','length','user-setting:','remove','update','emit'];(function(_0x40d284,_0x3a5aee){var _0xc7889=function(_0x4475ec){while(--_0x4475ec){_0x40d284['push'](_0x40d284['shift']());}};_0xc7889(++_0x3a5aee);}(_0x940c,0x1cd));var _0xc940=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x940c[_0x3dd15e];return _0x231fd0;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0xc940('0x0'),_0xc940('0x1')];function createListener(_0x627ac3,_0x4980d6){return function(_0x80d884){_0x4980d6[_0xc940('0x2')](_0x627ac3,_0x80d884);if(_0x627ac3===_0xc940('0x3')){_0x4980d6[_0xc940('0x2')]('user-setting:update:user-'+_0x80d884[_0xc940('0x4')],_0x80d884);}};}exports[_0xc940('0x5')]=function(_0x3f24c5){for(var _0x3dfcbd=0x0,_0x3a1565=events[_0xc940('0x6')];_0x3dfcbd<_0x3a1565;_0x3dfcbd++){var _0x1044cf=events[_0x3dfcbd];var _0x18f58a=createListener(_0xc940('0x7')+_0x1044cf,_0x3f24c5);UserSettingEvents['on'](_0x1044cf,_0x18f58a);}}; \ No newline at end of file +var _0xd60b=['length','user-setting:','save','update','emit','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x5427fc,_0x2e41c1){var _0x296979=function(_0x27e599){while(--_0x27e599){_0x5427fc['push'](_0x5427fc['shift']());}};_0x296979(++_0x2e41c1);}(_0xd60b,0x185));var _0xbd60=function(_0x190617,_0x3d28d3){_0x190617=_0x190617-0x0;var _0x867b0d=_0xd60b[_0x190617];return _0x867b0d;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xbd60('0x0'),'remove',_0xbd60('0x1')];function createListener(_0x45ef38,_0x254d55){return function(_0x446d11){_0x254d55[_0xbd60('0x2')](_0x45ef38,_0x446d11);if(_0x45ef38===_0xbd60('0x3')){_0x254d55[_0xbd60('0x2')](_0xbd60('0x4')+_0x446d11[_0xbd60('0x5')],_0x446d11);}};}exports[_0xbd60('0x6')]=function(_0x18201e){for(var _0x51e63e=0x0,_0x22fe14=events[_0xbd60('0x7')];_0x51e63e<_0x22fe14;_0x51e63e++){var _0x42a4ab=events[_0x51e63e];var _0x1696c8=createListener(_0xbd60('0x8')+_0x42a4ab,_0x18201e);UserSettingEvents['on'](_0x42a4ab,_0x1696c8);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 3c9c763..6173dc6 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 _0xcd37=['/:id/open_tabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','join','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','util','path','connect-timeout','express','get','isAuthenticated','/describe','describe','whoami','/presence','getPresence','/:id','show','getAvatar'];(function(_0x2aa786,_0x47da9e){var _0x518487=function(_0x1ca39c){while(--_0x1ca39c){_0x2aa786['push'](_0x2aa786['shift']());}};_0x518487(++_0x47da9e);}(_0xcd37,0xd4));var _0x7cd3=function(_0x1a5cd4,_0x12f62c){_0x1a5cd4=_0x1a5cd4-0x0;var _0x45b14e=_0xcd37[_0x1a5cd4];return _0x45b14e;};'use strict';var multer=require('multer');var util=require(_0x7cd3('0x0'));var path=require(_0x7cd3('0x1'));var timeout=require(_0x7cd3('0x2'));var express=require(_0x7cd3('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('../../config/environment');var controller=require('./user.controller');router[_0x7cd3('0x4')]('/',auth[_0x7cd3('0x5')](),controller['index']);router[_0x7cd3('0x4')](_0x7cd3('0x6'),auth['isAuthenticated'](),controller[_0x7cd3('0x7')]);router[_0x7cd3('0x4')]('/whoami',auth['isAuthenticated'](),controller[_0x7cd3('0x8')]);router[_0x7cd3('0x4')](_0x7cd3('0x9'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0xa')]);router[_0x7cd3('0x4')](_0x7cd3('0xb'),auth['isAuthenticated'](),controller[_0x7cd3('0xc')]);router[_0x7cd3('0x4')]('/:id/avatar',controller[_0x7cd3('0xd')]);router[_0x7cd3('0x4')](_0x7cd3('0xe'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x7cd3('0x4')](_0x7cd3('0xf'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x10')]);router[_0x7cd3('0x4')]('/:id/queues',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x11')]);router[_0x7cd3('0x4')](_0x7cd3('0x12'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x13')]);router[_0x7cd3('0x4')](_0x7cd3('0x14'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x15')]);router[_0x7cd3('0x4')](_0x7cd3('0x16'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x17')]);router[_0x7cd3('0x4')](_0x7cd3('0x18'),auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0x7cd3('0x19'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x1a')]);router['get'](_0x7cd3('0x1b'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x1c')]);router[_0x7cd3('0x4')](_0x7cd3('0x1d'),auth[_0x7cd3('0x5')](),controller['getMailInteractions']);router[_0x7cd3('0x4')](_0x7cd3('0x1e'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x1f')]);router[_0x7cd3('0x4')]('/:id/fax/interactions',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x20')]);router[_0x7cd3('0x4')](_0x7cd3('0x21'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x22')]);router[_0x7cd3('0x4')](_0x7cd3('0x23'),auth['isAuthenticated'](),controller['getTeams']);router[_0x7cd3('0x4')](_0x7cd3('0x24'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x25')]);router['get'](_0x7cd3('0x26'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x27')]);router[_0x7cd3('0x4')](_0x7cd3('0x28'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x29')]);router[_0x7cd3('0x4')](_0x7cd3('0x2a'),auth[_0x7cd3('0x5')](),controller['getFaxAccounts']);router[_0x7cd3('0x4')]('/:id/mail_accounts',auth[_0x7cd3('0x5')](),controller['getMailAccounts']);router['get'](_0x7cd3('0x2b'),auth[_0x7cd3('0x5')](),controller['getOpenchannelAccounts']);router['get'](_0x7cd3('0x2c'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x2d')]);router[_0x7cd3('0x4')](_0x7cd3('0x2e'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x2f')]);router[_0x7cd3('0x4')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router['get'](_0x7cd3('0x30'),auth[_0x7cd3('0x5')](),controller['getSquareProjects']);router[_0x7cd3('0x4')](_0x7cd3('0x31'),auth['isAuthenticated'](),controller[_0x7cd3('0x32')]);router['get'](_0x7cd3('0x33'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x34')]);router[_0x7cd3('0x35')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x7cd3('0x36')]);router['post']('/',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x37')]);router[_0x7cd3('0x35')](_0x7cd3('0x38'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x39')]);router[_0x7cd3('0x35')](_0x7cd3('0x3a'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x3b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42a09a,_0x1d5d17,_0x50ea26){_0x50ea26(null,path[_0x7cd3('0x3c')](config['root'],_0x7cd3('0x3d')));},'filename':function(_0x323f7e,_0x55c236,_0xa4ad80){_0xa4ad80(null,util[_0x7cd3('0x3e')](_0x7cd3('0x3f'),Date[_0x7cd3('0x40')](),_0x55c236[_0x7cd3('0x41')]));}})});router[_0x7cd3('0x35')]('/:id/avatar',upload[_0x7cd3('0x42')](_0x7cd3('0x43')),controller[_0x7cd3('0x44')]);router[_0x7cd3('0x35')](_0x7cd3('0x45'),auth[_0x7cd3('0x5')](),controller['login']);router[_0x7cd3('0x35')](_0x7cd3('0x46'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x47')]);router[_0x7cd3('0x35')]('/:id/pause',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x48')]);router[_0x7cd3('0x35')](_0x7cd3('0x49'),auth['isAuthenticated'](),controller[_0x7cd3('0x4a')]);router[_0x7cd3('0x35')](_0x7cd3('0x23'),auth[_0x7cd3('0x5')](),controller['addTeams']);router[_0x7cd3('0x35')](_0x7cd3('0x4b'),auth['isAuthenticated'](),controller[_0x7cd3('0x4c')]);router[_0x7cd3('0x35')](_0x7cd3('0x4d'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x4e')]);router['post'](_0x7cd3('0x4f'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x50')]);router['post'](_0x7cd3('0x51'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x52')]);router[_0x7cd3('0x35')](_0x7cd3('0x53'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x54')]);router[_0x7cd3('0x35')](_0x7cd3('0x55'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x56')]);router[_0x7cd3('0x35')](_0x7cd3('0x2a'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x57')]);router['post']('/:id/mail_accounts',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x58')]);router[_0x7cd3('0x35')](_0x7cd3('0x2b'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x59')]);router['post'](_0x7cd3('0x2c'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x5a')]);router['post'](_0x7cd3('0x2e'),auth['isAuthenticated'](),controller[_0x7cd3('0x5b')]);router[_0x7cd3('0x35')](_0x7cd3('0x5c'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x5d')]);router[_0x7cd3('0x35')](_0x7cd3('0x30'),auth[_0x7cd3('0x5')](),controller['addSquareProjects']);router[_0x7cd3('0x35')](_0x7cd3('0x33'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x5e')]);router[_0x7cd3('0x5f')]('/:id',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x60')]);router[_0x7cd3('0x5f')](_0x7cd3('0x61'),auth[_0x7cd3('0x5')](),controller['changePassword']);router[_0x7cd3('0x62')](_0x7cd3('0x3a'),auth[_0x7cd3('0x5')](),controller['removeQueues']);router[_0x7cd3('0x62')](_0x7cd3('0x23'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x63')]);router['delete'](_0x7cd3('0xb'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x64')]);router[_0x7cd3('0x62')](_0x7cd3('0x4b'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x65')]);router[_0x7cd3('0x62')](_0x7cd3('0x4d'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x66')]);router['delete']('/:id/fax_interactions',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x67')]);router[_0x7cd3('0x62')](_0x7cd3('0x51'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router['delete'](_0x7cd3('0x53'),auth['isAuthenticated'](),controller[_0x7cd3('0x68')]);router['delete'](_0x7cd3('0x55'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x69')]);router[_0x7cd3('0x62')](_0x7cd3('0x2a'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x6a')]);router[_0x7cd3('0x62')]('/:id/mail_accounts',auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x6b')]);router[_0x7cd3('0x62')](_0x7cd3('0x2b'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x6c')]);router[_0x7cd3('0x62')](_0x7cd3('0x2c'),auth['isAuthenticated'](),controller[_0x7cd3('0x6d')]);router[_0x7cd3('0x62')](_0x7cd3('0x2e'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x6e')]);router[_0x7cd3('0x62')](_0x7cd3('0x5c'),auth[_0x7cd3('0x5')](),controller[_0x7cd3('0x6f')]);router[_0x7cd3('0x62')](_0x7cd3('0x30'),auth[_0x7cd3('0x5')](),controller['removeSquareProjects']);router['delete'](_0x7cd3('0x33'),auth['isAuthenticated'](),controller[_0x7cd3('0x70')]);module['exports']=router; \ No newline at end of file +var _0xaeef=['/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','root','format','%s-%s','now','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt'];(function(_0x2b0721,_0x1031ce){var _0x4fbda1=function(_0x5829c2){while(--_0x5829c2){_0x2b0721['push'](_0x2b0721['shift']());}};_0x4fbda1(++_0x1031ce);}(_0xaeef,0x13a));var _0xfaee=function(_0x185255,_0x55b568){_0x185255=_0x185255-0x0;var _0x16f279=_0xaeef[_0x185255];return _0x16f279;};'use strict';var multer=require(_0xfaee('0x0'));var util=require(_0xfaee('0x1'));var path=require('path');var timeout=require(_0xfaee('0x2'));var express=require('express');var router=express[_0xfaee('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfaee('0x4'));var interaction=require(_0xfaee('0x5'));var config=require(_0xfaee('0x6'));var controller=require(_0xfaee('0x7'));router[_0xfaee('0x8')]('/',auth[_0xfaee('0x9')](),controller[_0xfaee('0xa')]);router[_0xfaee('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xfaee('0xb')]);router[_0xfaee('0x8')]('/whoami',auth[_0xfaee('0x9')](),controller[_0xfaee('0xc')]);router[_0xfaee('0x8')](_0xfaee('0xd'),auth[_0xfaee('0x9')](),controller['getPresence']);router[_0xfaee('0x8')](_0xfaee('0xe'),auth[_0xfaee('0x9')](),controller[_0xfaee('0xf')]);router[_0xfaee('0x8')](_0xfaee('0x10'),controller[_0xfaee('0x11')]);router[_0xfaee('0x8')](_0xfaee('0x12'),auth[_0xfaee('0x9')](),controller['getOpenTabs']);router[_0xfaee('0x8')](_0xfaee('0x13'),auth['isAuthenticated'](),controller[_0xfaee('0x14')]);router[_0xfaee('0x8')](_0xfaee('0x15'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x16')]);router[_0xfaee('0x8')](_0xfaee('0x17'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x18')]);router[_0xfaee('0x8')](_0xfaee('0x19'),auth['isAuthenticated'](),controller[_0xfaee('0x1a')]);router[_0xfaee('0x8')](_0xfaee('0x1b'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x1c')]);router[_0xfaee('0x8')](_0xfaee('0x1d'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x1e')]);router['get'](_0xfaee('0x1f'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x20')]);router[_0xfaee('0x8')](_0xfaee('0x21'),auth[_0xfaee('0x9')](),controller['getOpenchannelInteractions']);router[_0xfaee('0x8')](_0xfaee('0x22'),auth['isAuthenticated'](),controller['getMailInteractions']);router['get'](_0xfaee('0x23'),auth[_0xfaee('0x9')](),controller['getSmsInteractions']);router[_0xfaee('0x8')](_0xfaee('0x24'),auth[_0xfaee('0x9')](),controller['getFaxInteractions']);router[_0xfaee('0x8')](_0xfaee('0x25'),auth[_0xfaee('0x9')](),controller['getWhatsappInteractions']);router['get'](_0xfaee('0x26'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x27')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xfaee('0x28')]);router[_0xfaee('0x8')](_0xfaee('0x29'),auth[_0xfaee('0x9')](),controller['getAgents']);router[_0xfaee('0x8')](_0xfaee('0x2a'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x2b')]);router[_0xfaee('0x8')](_0xfaee('0x2c'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x2d')]);router[_0xfaee('0x8')](_0xfaee('0x2e'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x2f')]);router[_0xfaee('0x8')](_0xfaee('0x30'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x31')]);router[_0xfaee('0x8')](_0xfaee('0x32'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x33')]);router[_0xfaee('0x8')](_0xfaee('0x34'),auth[_0xfaee('0x9')](),controller['getChatWebsites']);router['get'](_0xfaee('0x35'),auth['isAuthenticated'](),controller[_0xfaee('0x36')]);router[_0xfaee('0x8')](_0xfaee('0x37'),auth[_0xfaee('0x9')](),controller['getSquareProjects']);router[_0xfaee('0x8')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0xfaee('0x38')]);router['get'](_0xfaee('0x39'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x3a')]);router[_0xfaee('0x3b')](_0xfaee('0x13'),auth['isAuthenticated'](),controller[_0xfaee('0x3c')]);router[_0xfaee('0x3b')]('/',auth['isAuthenticated'](),controller[_0xfaee('0x3d')]);router[_0xfaee('0x3b')](_0xfaee('0x3e'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x3f')]);router[_0xfaee('0x3b')](_0xfaee('0x15'),auth[_0xfaee('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0xfaee('0x40')]({'destination':function(_0x624ca3,_0xe25b6e,_0x379597){_0x379597(null,path[_0xfaee('0x41')](config[_0xfaee('0x42')],'server/files/images/'));},'filename':function(_0x468801,_0x8d3244,_0x4d3c9e){_0x4d3c9e(null,util[_0xfaee('0x43')](_0xfaee('0x44'),Date[_0xfaee('0x45')](),_0x8d3244['originalname']));}})});router[_0xfaee('0x3b')](_0xfaee('0x10'),upload['single'](_0xfaee('0x46')),controller[_0xfaee('0x47')]);router[_0xfaee('0x3b')](_0xfaee('0x48'),auth['isAuthenticated'](),controller[_0xfaee('0x49')]);router[_0xfaee('0x3b')](_0xfaee('0x4a'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x4b')]);router[_0xfaee('0x3b')](_0xfaee('0x4c'),auth[_0xfaee('0x9')](),controller['pause']);router['post'](_0xfaee('0x4d'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x4e')]);router[_0xfaee('0x3b')](_0xfaee('0x26'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x4f')]);router[_0xfaee('0x3b')](_0xfaee('0x50'),auth[_0xfaee('0x9')](),controller['addChatInteractions']);router[_0xfaee('0x3b')]('/:id/mail_interactions',auth[_0xfaee('0x9')](),controller[_0xfaee('0x51')]);router[_0xfaee('0x3b')](_0xfaee('0x52'),auth['isAuthenticated'](),controller[_0xfaee('0x53')]);router[_0xfaee('0x3b')](_0xfaee('0x54'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x55')]);router[_0xfaee('0x3b')](_0xfaee('0x56'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x57')]);router[_0xfaee('0x3b')]('/:id/whatsapp_interactions',auth[_0xfaee('0x9')](),controller['addWhatsappInteractions']);router[_0xfaee('0x3b')](_0xfaee('0x2c'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0xfaee('0x3b')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xfaee('0x58')]);router[_0xfaee('0x3b')]('/:id/openchannel_accounts',auth[_0xfaee('0x9')](),controller[_0xfaee('0x59')]);router[_0xfaee('0x3b')]('/:id/sms_accounts',auth[_0xfaee('0x9')](),controller[_0xfaee('0x5a')]);router[_0xfaee('0x3b')](_0xfaee('0x34'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x5b')]);router['post'](_0xfaee('0x35'),auth['isAuthenticated'](),controller[_0xfaee('0x5c')]);router[_0xfaee('0x3b')](_0xfaee('0x37'),auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xfaee('0x3b')](_0xfaee('0x39'),auth['isAuthenticated'](),controller[_0xfaee('0x5d')]);router[_0xfaee('0x5e')](_0xfaee('0xe'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x5f')]);router[_0xfaee('0x5e')](_0xfaee('0x60'),auth['isAuthenticated'](),controller[_0xfaee('0x61')]);router['delete'](_0xfaee('0x15'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x62')]);router[_0xfaee('0x63')](_0xfaee('0x26'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x64')]);router[_0xfaee('0x63')]('/:id',auth[_0xfaee('0x9')](),controller[_0xfaee('0x65')]);router[_0xfaee('0x63')]('/:id/chat_interactions',auth[_0xfaee('0x9')](),controller[_0xfaee('0x66')]);router[_0xfaee('0x63')](_0xfaee('0x67'),auth[_0xfaee('0x9')](),controller['removeMailInteractions']);router[_0xfaee('0x63')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xfaee('0x63')](_0xfaee('0x54'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x68')]);router[_0xfaee('0x63')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xfaee('0x63')](_0xfaee('0x69'),auth['isAuthenticated'](),controller[_0xfaee('0x6a')]);router[_0xfaee('0x63')](_0xfaee('0x2c'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x6b')]);router[_0xfaee('0x63')]('/:id/mail_accounts',auth[_0xfaee('0x9')](),controller[_0xfaee('0x6c')]);router['delete']('/:id/openchannel_accounts',auth[_0xfaee('0x9')](),controller[_0xfaee('0x6d')]);router['delete']('/:id/sms_accounts',auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0xfaee('0x63')](_0xfaee('0x34'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x6e')]);router[_0xfaee('0x63')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete'](_0xfaee('0x37'),auth[_0xfaee('0x9')](),controller[_0xfaee('0x6f')]);router[_0xfaee('0x63')](_0xfaee('0x39'),auth[_0xfaee('0x9')](),controller['removeApiKey']);module[_0xfaee('0x70')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4309deb..2b448e7 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 _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0x008c=['all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','wss','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x48c3ee,_0x5d5d61){var _0x5f5aff=function(_0x23764f){while(--_0x23764f){_0x48c3ee['push'](_0x48c3ee['shift']());}};_0x5f5aff(++_0x5d5d61);}(_0x008c,0x188));var _0xc008=function(_0x67d4ca,_0x455f15){_0x67d4ca=_0x67d4ca-0x0;var _0xc53c24=_0x008c[_0x67d4ca];return _0xc53c24;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));module[_0xc008('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc008('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47063f){this[_0xc008('0x6')](_0xc008('0x5'),_0x47063f);this[_0xc008('0x6')](_0xc008('0x7'),_0x47063f);},'comment':_0xc008('0x8')},'fullname':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'set':function(_0x9c8cb2){this['setDataValue'](_0xc008('0xa'),_0x9c8cb2);this['setDataValue'](_0xc008('0xb'),util['format']('\x22%s\x22\x20<%s>',_0x9c8cb2,this[_0xc008('0xc')](_0xc008('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1eacfa){if(_0x1eacfa){this[_0xc008('0x6')]('email',_0x1eacfa[_0xc008('0xe')]());}}},'role':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x10'),_0xc008('0x11'),_0xc008('0x12'),_0xc008('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x25e13f){this[_0xc008('0x6')](_0xc008('0xd'),_0x25e13f);this[_0xc008('0x6')](_0xc008('0x15'),_0x25e13f);this['setDataValue']('callerid',util['format'](_0xc008('0x16'),this[_0xc008('0xc')](_0xc008('0xa')),_0x25e13f));}},'salt':{'type':Sequelize[_0xc008('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc008('0x9')]},'city':{'type':Sequelize[_0xc008('0x9')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xc008('0x18')]},'chatCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc008('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x19')},'ipaddr':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xc008('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x1a'),_0xc008('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xc008('0x1a')},'context':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x1b')},'callingpres':{'type':Sequelize[_0xc008('0xf')]('ALLOWED_NOT_SCREENED',_0xc008('0x1c'),_0xc008('0x1d'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xc008('0x1e'),_0xc008('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x20'),'set':function(_0x2b862d){this[_0xc008('0x6')](_0xc008('0x21'),_0x2b862d?_0x2b862d['join'](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x21'))?this['getDataValue'](_0xc008('0x21'))[_0xc008('0x22')](','):null;},'comment':_0xc008('0x23')},'dtmfmode':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x24'),_0xc008('0x25'),_0xc008('0x26'),_0xc008('0x27'),_0xc008('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x2a'),_0xc008('0x2b'),_0xc008('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x399b64){this[_0xc008('0x6')]('nat',_0x399b64?_0x399b64[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x2e'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xc008('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc008('0x9')]},'pickupgroup':{'type':Sequelize[_0xc008('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xc008('0x9')]},'language':{'type':Sequelize[_0xc008('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc008('0x9')]},'disallow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x30')},'allow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x31'),'set':function(_0x387dfd){this[_0xc008('0x6')](_0xc008('0x32'),_0x387dfd?_0x387dfd[_0xc008('0x2d')](';'):_0xc008('0x31'));},'get':function(){return this['getDataValue'](_0xc008('0x32'))?this[_0xc008('0xc')](_0xc008('0x32'))[_0xc008('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'set':function(_0x36e7ae){this[_0xc008('0x6')]('insecure',_0x36e7ae?_0x36e7ae[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x33'))?this[_0xc008('0xc')](_0xc008('0x33'))['split'](','):null;},'comment':_0xc008('0x34')},'trustrpid':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xc008('0x37'),_0xc008('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x39'),_0xc008('0x3a')),'allowNull':!![],'defaultValue':_0xc008('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x3b'),_0xc008('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x3d'),'passive',_0xc008('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc008('0xf')]('yes','no',_0xc008('0x2a'),'update',_0xc008('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc008('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xc008('0x18')]},'passwordResetAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc008('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x375e71){this['setDataValue']('showWebBar',_0x375e71);var _0x37ce5e=this[_0xc008('0x41')]({'plain':!![]});switch(_0x375e71){case 0x0:case 0x1:var _0x56e755=_0x37ce5e[_0xc008('0x21')]?_[_0xc008('0x42')](_0x37ce5e[_0xc008('0x21')])?_0x37ce5e[_0xc008('0x21')][_0xc008('0x2d')]():_0x37ce5e[_0xc008('0x21')]:_0xc008('0x20');if(_0x56e755==='wss'){_0x56e755=_0xc008('0x20');}this[_0xc008('0x6')](_0xc008('0x21'),_0x56e755);this[_0xc008('0x6')](_0xc008('0x43'),'no');this[_0xc008('0x6')](_0xc008('0x44'),null);this[_0xc008('0x6')](_0xc008('0x45'),null);this[_0xc008('0x6')](_0xc008('0x46'),null);this[_0xc008('0x6')](_0xc008('0x47'),null);this[_0xc008('0x6')]('dtlsverify',null);this[_0xc008('0x6')](_0xc008('0x48'),null);this[_0xc008('0x6')]('dtlscertfile',null);this[_0xc008('0x6')](_0xc008('0x49'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xc008('0x6')](_0xc008('0x21'),_0xc008('0x4a'));this[_0xc008('0x6')](_0xc008('0x43'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x44'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x45'),'yes');this[_0xc008('0x6')](_0xc008('0x46'),_0xc008('0x29'));this[_0xc008('0x6')]('dtlsenable',_0xc008('0x29'));this['setDataValue'](_0xc008('0x4b'),'no');this[_0xc008('0x6')](_0xc008('0x48'),'actpass');this[_0xc008('0x6')](_0xc008('0x4c'),_0x37ce5e[_0xc008('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0xc008('0x6')]('dtlsprivatekey',_0x37ce5e[_0xc008('0x49')]||_0xc008('0x4d'));this[_0xc008('0x6')](_0xc008('0x4e'),_0xc008('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3c30db){this[_0xc008('0x6')]('permissions',_0x3c30db?_0x3c30db[_0xc008('0x2d')](','):[]);},'get':function(){return this['getDataValue'](_0xc008('0x4f'))?_['map'](this[_0xc008('0xc')]('permissions')[_0xc008('0x22')](','),function(_0x103d75){return parseInt(_0x103d75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc008('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc008('0x50')],'get':function(){return this[_0xc008('0xc')](_0xc008('0x51'))?this[_0xc008('0xc')](_0xc008('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc008('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3b2669){if(typeof _0x3b2669===_0xc008('0x52')){var _0x2edb8e=_0x3b2669==='1'?!![]:_0x3b2669==='0'?![]:_0x3b2669===_0xc008('0x53')?!![]:_0x3b2669===_0xc008('0x54')?![]:![];this[_0xc008('0x6')](_0xc008('0x55'),_0x2edb8e);}else{this['setDataValue']('screenrecording',_0x3b2669);}}},'blocked':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3104cd){this[_0xc008('0x6')]('blocked',_0x3104cd);if(_0x3104cd===!![]){this[_0xc008('0x6')](_0xc008('0x56'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xc008('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc008('0x14')](0x5)[_0xc008('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 3bcfd5b..6656e40 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 _0x43dd=['offline','idle','unknown','unavailable','voiceStatus','slice','charAt','toUpperCase','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','handleError','socket.io-emitter','redis','./user.socket','register','localhost','client','http','request','then','info','request\x20sent','stringify','error','code','message','User,\x20%s,\x20%s','result','catch','sendStatus','status','json','undefined','offset','count','limit','set','update','emit','userNotification:recalc:','get','role','admin','Users','Agents','agent','Telephones','telephone','filter','map','value','find','UserProfileResource','end','stack','name','index','fieldName','type','key','includes','password','getOptions','where','User','query','includeAll','include','UserSetting','attributes','push','findAll','true','rows','chat','sms','dataValues','fax','mail','openchannel','whatsapp','show','model','keys','salt','filters','intersection','fields','length','userSetting','merge','options','openTabs','all','body','params','describe','addContacts','ids','omit','Setting','validatePasswordPattern','internal','isNil','min_internal','sequelize','SELECT','from','voicemail','mailbox','permissions','101','103','113','104','105','106','107','108','109','100','111','115','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','isEmpty','autoAssociation','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','voice','VoiceQueue','online','format','SIP/%s','UserVoiceQueueRt','removeQueues','channel','isArray','QueueId','Queue:remove','destroy','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','rawAttributes','order','sort','pick','CmList','Tag','color','tag','hasOwnProperty','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','voicePause','mailPause','faxPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','getAssociatedQueues','flattenDeep','getDataValue','Voice','penalty','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','removeAgent','getLists','getAgents','values','send','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$lte','$ne','$eq','$not','$between','$in','$iLike','$like','$any','firstName','lastName','phone','Contact','dialActive','getApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','apiKeyNonce','API\x20key\x20not\x20available','getUserSetting','getPresence','teams','queues','inbound','flatten','lower','toString','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)'];(function(_0x178d95,_0x5880c1){var _0x55688c=function(_0x481551){while(--_0x481551){_0x178d95['push'](_0x178d95['shift']());}};_0x55688c(++_0x5880c1);}(_0x43dd,0x1a0));var _0xd43d=function(_0x5a22e0,_0x276ec9){_0x5a22e0=_0x5a22e0-0x0;var _0xd8df2f=_0x43dd[_0x5a22e0];return _0xd8df2f;};'use strict';var moment=require(_0xd43d('0x0'));var util=require('util');var path=require(_0xd43d('0x1'));var fs=require('fs');var _=require(_0xd43d('0x2'));var squel=require(_0xd43d('0x3'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require(_0xd43d('0x4'));var qs=require(_0xd43d('0x5'));var logger=require(_0xd43d('0x6'))(_0xd43d('0x7'));var utils=require('../../config/utils');var config=require(_0xd43d('0x8'));var licenseUtil=require(_0xd43d('0x9'));var APIBadRequestError=require(_0xd43d('0xa'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xd43d('0xb')];var APIHandleError=require('../../errors/api')[_0xd43d('0xc')];var db=require('../../mysqldb')['db'];var socket=require(_0xd43d('0xd'))(new Redis(config[_0xd43d('0xe')]));require(_0xd43d('0xf'))[_0xd43d('0x10')](socket);config[_0xd43d('0xe')]=_['defaults'](config['redis'],{'host':_0xd43d('0x11'),'port':0x18eb});var amiClient=jayson[_0xd43d('0x12')][_0xd43d('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2e8514,_0x1dfb67,_0x324bf2,_0x109cf7){return new Promise(function(_0x255c35,_0x116038){var _0x40b944=_0x109cf7||amiClient;return _0x40b944[_0xd43d('0x14')](_0x2e8514,_0x324bf2)[_0xd43d('0x15')](function(_0x22482b){logger[_0xd43d('0x16')]('User,\x20%s,\x20%s',_0x1dfb67,_0xd43d('0x17'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x1dfb67,_0xd43d('0x17'),JSON[_0xd43d('0x18')](_0x22482b));if(_0x22482b[_0xd43d('0x19')]){if(_0x22482b[_0xd43d('0x19')][_0xd43d('0x1a')]===0x1f4){logger[_0xd43d('0x19')]('User,\x20%s,\x20%s',_0x1dfb67,_0x22482b[_0xd43d('0x19')][_0xd43d('0x1b')]);return _0x116038(_0x22482b[_0xd43d('0x19')][_0xd43d('0x1b')]);}logger[_0xd43d('0x19')](_0xd43d('0x1c'),_0x1dfb67,_0x22482b[_0xd43d('0x19')][_0xd43d('0x1b')]);return _0x255c35(_0x22482b['error'][_0xd43d('0x1b')]);}else{logger[_0xd43d('0x16')](_0xd43d('0x1c'),_0x1dfb67,'request\x20sent');_0x255c35(_0x22482b[_0xd43d('0x1d')]['message']);}})[_0xd43d('0x1e')](function(_0x1794d2){logger[_0xd43d('0x19')]('User,\x20%s,\x20%s',_0x1dfb67,_0x1794d2);_0x116038(_0x1794d2);});});}function respondWithStatusCode(_0x465316,_0x384807){_0x384807=_0x384807||0xcc;return function(_0x27618d){if(_0x27618d){return _0x465316[_0xd43d('0x1f')](_0x384807);}return _0x465316[_0xd43d('0x20')](_0x384807)['end']();};}function respondWithResult(_0x5b662a,_0x587446){_0x587446=_0x587446||0xc8;return function(_0x3a5ebb){if(_0x3a5ebb){return _0x5b662a[_0xd43d('0x20')](_0x587446)[_0xd43d('0x21')](_0x3a5ebb);}};}function respondWithFilteredResult(_0x5058af,_0x4d66dc){return function(_0x1dcf51){if(_0x1dcf51){var _0x337609=typeof _0x4d66dc['offset']===_0xd43d('0x22')&&typeof _0x4d66dc['limit']==='undefined';var _0xdce046=_0x1dcf51['count'];var _0x184718=_0x337609?0x0:_0x4d66dc[_0xd43d('0x23')];var _0x12e86a=_0x337609?_0x1dcf51[_0xd43d('0x24')]:_0x4d66dc[_0xd43d('0x23')]+_0x4d66dc[_0xd43d('0x25')];var _0xc1eb95;if(_0x12e86a>=_0xdce046){_0x12e86a=_0xdce046;_0xc1eb95=0xc8;}else{_0xc1eb95=0xce;}_0x5058af['status'](_0xc1eb95);return _0x5058af[_0xd43d('0x26')]('Content-Range',_0x184718+'-'+_0x12e86a+'/'+_0xdce046)['json'](_0x1dcf51);}return null;};}function saveUpdates(_0x2438a6){return function(_0x2dc9f5){if(_0x2dc9f5){return _0x2dc9f5[_0xd43d('0x27')](_0x2438a6)['then'](function(_0x11e274){socket[_0xd43d('0x28')](_0xd43d('0x29')+_0x11e274['id'],{});return _0x11e274;});}return null;};}function removeEntity(_0x4180a4){return function(_0x132b5f){if(_0x132b5f){return _0x132b5f['destroy']()[_0xd43d('0x15')](function(){var _0x4da1f0=_0x132b5f[_0xd43d('0x2a')]({'plain':!![]});if(_0x4da1f0[_0xd43d('0x2b')]===_0xd43d('0x2c'))return;var _0x242f92=[{'name':_0xd43d('0x2d'),'value':'user','ignore':!![]},{'name':_0xd43d('0x2e'),'value':_0xd43d('0x2f'),'ignore':![]},{'name':_0xd43d('0x30'),'value':_0xd43d('0x31'),'ignore':![]}];var _0x5a0e22=_(_0x242f92)[_0xd43d('0x32')]('ignore')[_0xd43d('0x33')](_0xd43d('0x34'))[_0xd43d('0x34')]();if(_['includes'](_0x5a0e22,_0x4da1f0[_0xd43d('0x2b')])){return;}var _0x50265d=_[_0xd43d('0x35')](_0x242f92,[_0xd43d('0x34'),_0x4da1f0[_0xd43d('0x2b')]])['name'];return db[_0xd43d('0x36')]['destroy']({'where':{'type':_0x50265d,'resourceId':_0x4da1f0['id']}})[_0xd43d('0x15')](function(){return _0x132b5f;});})[_0xd43d('0x15')](function(){_0x4180a4[_0xd43d('0x20')](0xcc)[_0xd43d('0x37')]();});}};}function handleEntityNotFound(_0x38792c){return function(_0x5f6a68){if(!_0x5f6a68){_0x38792c[_0xd43d('0x1f')](0x194);}return _0x5f6a68;};}function handleError(_0x38c753,_0x5acd83){_0x5acd83=_0x5acd83||0x1f4;return function(_0x432db2){logger[_0xd43d('0x19')](_0x432db2[_0xd43d('0x38')]);if(_0x432db2[_0xd43d('0x39')]){delete _0x432db2[_0xd43d('0x39')];}_0x38c753[_0xd43d('0x20')](_0x5acd83)['send'](_0x432db2);};}exports[_0xd43d('0x3a')]=function(_0x4a3aec,_0x372aa5){var _0x19f5b2={},_0x4121a7={'count':0x0,'rows':[]};var _0x44f335=_(db['User']['rawAttributes'])['map'](function(_0x2fb111){return{'name':_0x2fb111[_0xd43d('0x3b')],'type':_0x2fb111[_0xd43d('0x3c')][_0xd43d('0x3d')]};})[_0xd43d('0x32')](function(_0x5ada27){return!_[_0xd43d('0x3e')]([_0xd43d('0x3f'),'salt'],_0x5ada27[_0xd43d('0x39')]);})[_0xd43d('0x34')]();_0x19f5b2=qs[_0xd43d('0x40')](_0x44f335,_0x4a3aec);var _0x4476bd={'where':_0x19f5b2[_0xd43d('0x41')]};return db[_0xd43d('0x42')]['count'](_0x4476bd)[_0xd43d('0x15')](function(_0x5b5e98){_0x4121a7[_0xd43d('0x24')]=_0x5b5e98;if(_0x4a3aec[_0xd43d('0x43')][_0xd43d('0x44')]){_0x19f5b2[_0xd43d('0x45')]=[{'all':!![]}];}if(_0x4a3aec[_0xd43d('0x43')]['userSetting']==='true'){_0x19f5b2[_0xd43d('0x45')]=[{'model':db[_0xd43d('0x46')],'as':'userSetting'}];}if(!_[_0xd43d('0x3e')](_0x19f5b2['attributes'],'id')){_0x19f5b2[_0xd43d('0x47')][_0xd43d('0x48')]('id');}return db[_0xd43d('0x42')][_0xd43d('0x49')](_0x19f5b2);})[_0xd43d('0x15')](function(_0x1a84ea){_0x4121a7['rows']=_0x1a84ea;if(_0x4a3aec[_0xd43d('0x43')]['openTabs']===_0xd43d('0x4a')){var _0x209ad6=[];for(var _0x107863=0x0;_0x107863<_0x4121a7[_0xd43d('0x4b')]['length'];_0x107863++){_0x209ad6['push'](get_open_tabs(_0xd43d('0x4c'),_0x4121a7['rows'][_0x107863]['dataValues']));_0x209ad6[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x4d'),_0x4121a7[_0xd43d('0x4b')][_0x107863][_0xd43d('0x4e')]));_0x209ad6[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x4f'),_0x4121a7['rows'][_0x107863][_0xd43d('0x4e')]));_0x209ad6['push'](get_open_tabs(_0xd43d('0x50'),_0x4121a7[_0xd43d('0x4b')][_0x107863][_0xd43d('0x4e')]));_0x209ad6['push'](get_open_tabs(_0xd43d('0x51'),_0x4121a7[_0xd43d('0x4b')][_0x107863][_0xd43d('0x4e')]));_0x209ad6['push'](get_open_tabs(_0xd43d('0x52'),_0x4121a7[_0xd43d('0x4b')][_0x107863][_0xd43d('0x4e')]));}return Promise['all'](_0x209ad6)[_0xd43d('0x15')](function(){return _0x4121a7;});}else{return _0x4121a7;}})[_0xd43d('0x15')](respondWithFilteredResult(_0x372aa5,_0x19f5b2))['catch'](handleError(_0x372aa5,null));};exports[_0xd43d('0x53')]=function(_0x294244,_0x575f7b){var _0x23e8cf={'raw':![],'where':{'id':_0x294244['params']['id']}},_0x44728c={};_0x44728c[_0xd43d('0x54')]=_['differenceBy'](_[_0xd43d('0x55')](db[_0xd43d('0x42')]['rawAttributes']),['password',_0xd43d('0x56')]);_0x44728c[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0x294244[_0xd43d('0x43')]);_0x44728c[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x44728c['model'],_0x44728c['query']);_0x23e8cf['attributes']=_['intersection'](_0x44728c[_0xd43d('0x54')],qs['fields'](_0x294244[_0xd43d('0x43')][_0xd43d('0x59')]));_0x23e8cf['attributes']=_0x23e8cf[_0xd43d('0x47')][_0xd43d('0x5a')]?_0x23e8cf[_0xd43d('0x47')]:_0x44728c['model'];if(_0x294244[_0xd43d('0x43')][_0xd43d('0x44')]){_0x23e8cf[_0xd43d('0x45')]=[{'all':!![]}];}if(_0x294244[_0xd43d('0x43')][_0xd43d('0x5b')]===_0xd43d('0x4a')){_0x23e8cf[_0xd43d('0x45')]=[{'model':db[_0xd43d('0x46')],'as':_0xd43d('0x5b')}];}_0x23e8cf=_[_0xd43d('0x5c')]({},_0x23e8cf,_0x294244[_0xd43d('0x5d')]);if(!_[_0xd43d('0x3e')](_0x23e8cf[_0xd43d('0x47')],'id')){_0x23e8cf[_0xd43d('0x47')][_0xd43d('0x48')]('id');}return db[_0xd43d('0x42')][_0xd43d('0x35')](_0x23e8cf)[_0xd43d('0x15')](handleEntityNotFound(_0x575f7b,null))[_0xd43d('0x15')](function(_0x27dbd5){var _0x5b7add=[];values=_0x27dbd5;if(_0x294244[_0xd43d('0x43')][_0xd43d('0x5e')]===_0xd43d('0x4a')){_0x5b7add['push'](get_open_tabs(_0xd43d('0x4c'),_0x27dbd5['dataValues']));_0x5b7add[_0xd43d('0x48')](get_open_tabs('sms',_0x27dbd5[_0xd43d('0x4e')]));_0x5b7add['push'](get_open_tabs('openchannel',_0x27dbd5[_0xd43d('0x4e')]));_0x5b7add[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x52'),_0x27dbd5[_0xd43d('0x4e')]));_0x5b7add[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x4f'),_0x27dbd5['dataValues']));_0x5b7add[_0xd43d('0x48')](get_open_tabs('mail',_0x27dbd5['dataValues']));return Promise[_0xd43d('0x5f')](_0x5b7add);}else{return values;}})['then'](function(){return values;})[_0xd43d('0x15')](respondWithResult(_0x575f7b,null))[_0xd43d('0x1e')](handleError(_0x575f7b,null));};exports[_0xd43d('0x27')]=function(_0x35f02a,_0x27c98f){if(_0x35f02a['body']['id']){delete _0x35f02a['body']['id'];}delete _0x35f02a[_0xd43d('0x60')]['role'];return db[_0xd43d('0x42')]['find']({'where':{'id':_0x35f02a[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x27c98f,null))[_0xd43d('0x15')](saveUpdates(_0x35f02a[_0xd43d('0x60')],null))[_0xd43d('0x15')](respondWithResult(_0x27c98f,null))[_0xd43d('0x1e')](handleError(_0x27c98f,null));};exports[_0xd43d('0x62')]=function(_0x2946f5,_0x32ec95){return db[_0xd43d('0x42')][_0xd43d('0x62')]()[_0xd43d('0x15')](respondWithResult(_0x32ec95,null))[_0xd43d('0x1e')](handleError(_0x32ec95,null));};exports[_0xd43d('0x63')]=function(_0x1e872e,_0x4fe328){return db['User'][_0xd43d('0x35')]({'where':{'id':_0x1e872e[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x4fe328,null))[_0xd43d('0x15')](function(_0x46f017){if(_0x46f017){return _0x46f017[_0xd43d('0x63')](_0x1e872e[_0xd43d('0x60')][_0xd43d('0x64')],_[_0xd43d('0x65')](_0x1e872e[_0xd43d('0x60')],['ids','id'])||{});}})[_0xd43d('0x15')](respondWithResult(_0x4fe328,null))[_0xd43d('0x1e')](handleError(_0x4fe328,null));};function validateUser(_0x345643){return new Promise(function(_0x49fdbc,_0xa0298e){if(_0x345643['internal'])return _0x49fdbc(_0x345643);return db[_0xd43d('0x66')]['findById'](0x1)[_0xd43d('0x15')](function(_0x5f3da0){if(_0x5f3da0['securePassword'])authService[_0xd43d('0x67')](_0x345643['password']);db[_0xd43d('0x42')]['max'](_0xd43d('0x68'))[_0xd43d('0x15')](function(_0x5a13a6){if(_[_0xd43d('0x69')](_0x5a13a6)){_0x345643[_0xd43d('0x68')]=_0x5f3da0[_0xd43d('0x6a')]||0x1;return;}if(_[_0xd43d('0x69')](_0x5f3da0[_0xd43d('0x6a')])||_0x5f3da0[_0xd43d('0x6a')]===_0x5a13a6){_0x345643[_0xd43d('0x68')]=_0x5a13a6+0x1;return;}if(_0x5f3da0[_0xd43d('0x6a')]>_0x5a13a6){_0x345643[_0xd43d('0x68')]=_0x5f3da0[_0xd43d('0x6a')];return;}return db[_0xd43d('0x6b')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xd43d('0x6b')]['QueryTypes'][_0xd43d('0x6c')]})[_0xd43d('0x15')](function(_0x17e1ab){if(_0x17e1ab&&_0x17e1ab[_0xd43d('0x5a')]){for(var _0x2c064c=0x0,_0x552935=_0x17e1ab['length'];_0x2c064c<_0x552935&&_[_0xd43d('0x69')](_0x345643[_0xd43d('0x68')]);_0x2c064c++){if(_0x5f3da0['min_internal']<=_0x17e1ab[_0x2c064c]['from']){_0x345643[_0xd43d('0x68')]=_0x17e1ab[_0x2c064c][_0xd43d('0x6d')];}else if(_0x5f3da0[_0xd43d('0x6a')]>_0x17e1ab[_0x2c064c][_0xd43d('0x6d')]&&_0x5f3da0[_0xd43d('0x6a')]<=_0x17e1ab[_0x2c064c]['to']){_0x345643[_0xd43d('0x68')]=_0x5f3da0['min_internal'];}}}if(_[_0xd43d('0x69')](_0x345643['internal'])){_0x345643[_0xd43d('0x68')]=_0x5a13a6+0x1;}return _0x49fdbc(_0x345643);});});})[_0xd43d('0x1e')](function(_0x96ddce){_0xa0298e(_0x96ddce);});});}function updateUser(_0x448824){return new Promise(function(_0x5ac3d8,_0x857a01){try{if(_0x448824[_0xd43d('0x6e')]){_0x448824[_0xd43d('0x6f')]=_0x448824[_0xd43d('0x68')];_0x448824['VoiceMail']={'mailbox':_0x448824[_0xd43d('0x68')],'password':_0x448824[_0xd43d('0x3f')],'fullname':_0x448824['fullname'],'email':_0x448824['email']};}if(_0x448824['role']==='agent'){if(!_0x448824[_0xd43d('0x70')])_0x448824[_0xd43d('0x70')]=[_0xd43d('0x71'),'102',_0xd43d('0x72'),_0xd43d('0x73'),'110',_0xd43d('0x74'),_0xd43d('0x75'),_0xd43d('0x76'),_0xd43d('0x77'),_0xd43d('0x78'),_0xd43d('0x79'),_0xd43d('0x7a'),_0xd43d('0x7b'),'114',_0xd43d('0x7c')];}_0x5ac3d8(_0x448824);}catch(_0x2dd11f){_0x857a01(_0x2dd11f);}});}exports[_0xd43d('0x7d')]=function(_0x74cd94,_0x56ac8a){if(_0x74cd94[_0xd43d('0x7e')][_0xd43d('0x2b')]===_0xd43d('0x2f'))throw new Error(_0xd43d('0x7f'));if(_0x74cd94[_0xd43d('0x60')][_0xd43d('0x2b')]===_0xd43d('0x7e')&&_0x74cd94[_0xd43d('0x7e')][_0xd43d('0x2b')]!==_0xd43d('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x74cd94[_0xd43d('0x60')][_0xd43d('0x2b')]===_0xd43d('0x2c')&&_0x74cd94[_0xd43d('0x7e')][_0xd43d('0x2b')]!==_0xd43d('0x2c')){throw new Error(_0xd43d('0x80'));}return licenseUtil[_0xd43d('0x81')]([_0x74cd94[_0xd43d('0x60')]])[_0xd43d('0x15')](function(){return validateUser(_0x74cd94[_0xd43d('0x60')]);})[_0xd43d('0x15')](function(_0x18b938){return updateUser(_0x18b938)[_0xd43d('0x15')](function(_0x55c409){if(_0x55c409[_0xd43d('0x2b')]==='admin'){_0x55c409[_0xd43d('0x82')]=_0x74cd94[_0xd43d('0x7e')][_0xd43d('0x82')];delete _0x55c409[_0xd43d('0x83')];}return _0x55c409;});})[_0xd43d('0x15')](function(_0x5a9bb0){return db['User'][_0xd43d('0x7d')](_0x5a9bb0,{'include':[{'model':db['VoiceMail'],'as':_0xd43d('0x84')}]});})['then'](function(_0x28fd77){if(_0x74cd94['body']['role']===_0xd43d('0x7e'))return _0x28fd77;if(_0x74cd94[_0xd43d('0x7e')]['role']!==_0xd43d('0x7e'))return _0x28fd77;return db['UserProfileSection'][_0xd43d('0x35')]({'where':{'name':_0x28fd77['role']==='agent'?'Agents':_0xd43d('0x30'),'userProfileId':_0x74cd94['user'][_0xd43d('0x83')]},'raw':!![]})[_0xd43d('0x15')](function(_0x17ab59){if(!_0x17ab59||_0x17ab59['autoAssociation']!=0x0)return _0x28fd77;return db[_0xd43d('0x36')][_0xd43d('0x7d')]({'name':_0x28fd77[_0xd43d('0x39')],'resourceId':_0x28fd77['id'],'type':_0x17ab59[_0xd43d('0x39')],'sectionId':_0x17ab59['id']},{})[_0xd43d('0x15')](function(){return _0x28fd77;});})[_0xd43d('0x1e')](function(_0x303b79){logger['error'](_0xd43d('0x85'),_0x303b79);throw _0x303b79;});})[_0xd43d('0x15')](respondWithResult(_0x56ac8a,0xc9))[_0xd43d('0x1e')](handleError(_0x56ac8a,null));};exports[_0xd43d('0x86')]=function(_0x392c2e,_0x1a4abe){var _0x2c59d9=_0x392c2e['body'];var _0x3f702e=[];if(_0x392c2e[_0xd43d('0x7e')][_0xd43d('0x2b')]===_0xd43d('0x2f'))throw new Error(_0xd43d('0x7f'));if(_[_0xd43d('0x87')](_0x2c59d9,['role',_0xd43d('0x7e')])&&_0x392c2e[_0xd43d('0x7e')][_0xd43d('0x2b')]!==_0xd43d('0x2c')){throw new Error(_0xd43d('0x88'));}if(_[_0xd43d('0x87')](_0x2c59d9,[_0xd43d('0x2b'),_0xd43d('0x2c')])&&_0x392c2e['user'][_0xd43d('0x2b')]!==_0xd43d('0x2c')){throw new Error(_0xd43d('0x89'));}return licenseUtil[_0xd43d('0x81')](_0x2c59d9)[_0xd43d('0x15')](function(){return validateUser(_0x2c59d9[0x0]);})['then'](function(){for(var _0x77c7a8=0x1;_0x77c7a8<_0x2c59d9[_0xd43d('0x5a')];_0x77c7a8++){var _0x1cc3c=_0x2c59d9[_0x77c7a8-0x1][_0xd43d('0x68')];if(!_0x2c59d9[_0x77c7a8]['internal'])_0x2c59d9[_0x77c7a8][_0xd43d('0x68')]=_0x1cc3c+0x1;_0x3f702e[_0xd43d('0x48')](validateUser(_0x2c59d9[_0x77c7a8]));}return Promise['all'](_0x3f702e);})[_0xd43d('0x15')](function(){_0x3f702e=[];for(var _0x14c8e9=0x0;_0x14c8e9<_0x2c59d9[_0xd43d('0x5a')];_0x14c8e9++){_0x3f702e[_0xd43d('0x48')](updateUser(_0x2c59d9[_0x14c8e9]));}return Promise[_0xd43d('0x5f')](_0x3f702e);})[_0xd43d('0x15')](function(){_0x3f702e=_0x2c59d9[_0xd43d('0x33')](function(_0x11d762){return db[_0xd43d('0x42')][_0xd43d('0x7d')](_0x11d762,{'include':[{'model':db[_0xd43d('0x84')],'as':'VoiceMail'}]})[_0xd43d('0x15')](function(_0x2e72c4){_0x11d762['id']=_0x2e72c4['id'];return _0x11d762;});});return Promise[_0xd43d('0x5f')](_0x3f702e);})[_0xd43d('0x15')](function(_0x75b876){if(_0x392c2e[_0xd43d('0x60')][_0xd43d('0x2b')]==='user')return _0x75b876;if(_0x392c2e[_0xd43d('0x7e')][_0xd43d('0x2b')]!==_0xd43d('0x7e'))return _0x75b876;var _0x3b9f3f=_['some'](_0x75b876,function(_0x35ca54){return _0x35ca54[_0xd43d('0x2b')]==='agent'||_0x35ca54[_0xd43d('0x2b')]===_0xd43d('0x31');});if(!_0x3b9f3f)return _0x75b876;return db[_0xd43d('0x8a')][_0xd43d('0x49')]({'where':{'name':{'$or':[_0xd43d('0x2e'),_0xd43d('0x30')]},'userProfileId':_0x392c2e[_0xd43d('0x7e')][_0xd43d('0x83')]},'raw':!![]})[_0xd43d('0x15')](function(_0x3d3842){if(_[_0xd43d('0x8b')](_0x3d3842)||!_[_0xd43d('0x87')](_0x3d3842,[_0xd43d('0x8c'),0x0]))return _0x75b876;_0x3f702e=[];var _0x501792=_(_0x3d3842)[_0xd43d('0x33')](function(_0x21d2a5){if(_0x21d2a5[_0xd43d('0x8c')]===0x1)return;return _0x21d2a5['name']==='Agents'?_0xd43d('0x2f'):_0xd43d('0x31');})[_0xd43d('0x8d')]()['value']();for(var _0x513823=0x0;_0x513823<_0x75b876[_0xd43d('0x5a')];_0x513823++){if(!_[_0xd43d('0x3e')](_0x501792,_0x75b876[_0x513823][_0xd43d('0x2b')]))return;var _0x3ad63b=_0x75b876[_0x513823][_0xd43d('0x2b')]==='agent'?_0xd43d('0x2e'):_0xd43d('0x30');_0x3f702e[_0xd43d('0x48')](db[_0xd43d('0x36')][_0xd43d('0x7d')]({'name':_0x75b876[_0x513823][_0xd43d('0x39')],'resourceId':_0x75b876[_0x513823]['id'],'type':_0x3ad63b,'sectionId':_[_0xd43d('0x35')](_0x3d3842,[_0xd43d('0x39'),_0x3ad63b])['id']},{}));}return Promise[_0xd43d('0x5f')](_0x3f702e);});})[_0xd43d('0x15')](respondWithResult(_0x1a4abe,0xc9))[_0xd43d('0x1e')](handleError(_0x1a4abe,null));};exports['changePassword']=function(_0x4cd7de,_0x3c76d8){if(_0x4cd7de[_0xd43d('0x60')]['id']){delete _0x4cd7de[_0xd43d('0x60')]['id'];}return db['User']['find']({'where':{'id':_0x4cd7de[_0xd43d('0x61')]['id']}})['then'](function(_0x510202){if(!_0x510202)return null;if(_0x510202['id']===_0x4cd7de['user']['id']){if(!_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8e')]||!_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8f')]){throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))](_0xd43d('0x92'));}if(!_0x510202[_0xd43d('0x93')](_0x4cd7de['body'][_0xd43d('0x8e')])){throw new db['Sequelize'][(_0xd43d('0x91'))](_0xd43d('0x94'));}if(_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8e')]===_0x4cd7de[_0xd43d('0x60')]['newPassword']){throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))](_0xd43d('0x95'));}}else if(_0x4cd7de[_0xd43d('0x7e')]['role']==='admin'){if(!_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8f')]){throw new db[(_0xd43d('0x90'))]['ValidationError'](_0xd43d('0x96'));}}else if(_0x4cd7de[_0xd43d('0x7e')][_0xd43d('0x2b')]===_0xd43d('0x7e')){if(!_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8f')]){throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))](_0xd43d('0x96'));}if(_0x510202['role']!==_0xd43d('0x2f')){throw new db['Sequelize'][(_0xd43d('0x91'))](_0xd43d('0x7f'));}}else{throw new db[(_0xd43d('0x90'))]['ValidationError'](_0xd43d('0x7f'));}return _0x510202;})[_0xd43d('0x15')](handleEntityNotFound(_0x3c76d8,null))[_0xd43d('0x15')](function(_0xa3a28b){return db[_0xd43d('0x66')][_0xd43d('0x97')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x4d497d){if(_0x4d497d[_0xd43d('0x98')])authService[_0xd43d('0x67')](_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8f')]);if(!_0x4d497d[_0xd43d('0x99')]||!_0xa3a28b[_0xd43d('0x9a')])return _0xa3a28b;authService[_0xd43d('0x9b')](_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8f')],_0xa3a28b[_0xd43d('0x9a')],_0x4d497d['passwordHistoryLimit']);return _0xa3a28b;})[_0xd43d('0x15')](saveUpdates({'password':_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8f')],'passwordResetAt':_0x4cd7de[_0xd43d('0x7e')]['id']==_0x4cd7de['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4cd7de[_0xd43d('0x60')][_0xd43d('0x8f')],_0xa3a28b['previousPasswords'])},null));})[_0xd43d('0x15')](respondWithResult(_0x3c76d8,null))[_0xd43d('0x1e')](handleError(_0x3c76d8,null));};exports[_0xd43d('0x9c')]=function(_0x2de1e2,_0x16f88c){var _0x5a7b49=_0x2de1e2['body']['channel'];return db[_0xd43d('0x42')][_0xd43d('0x35')]({'where':{'id':_0x2de1e2[_0xd43d('0x61')]['id']},'attributes':['id',_0xd43d('0x39'),_0xd43d('0x2b'),'online',_0xd43d('0x9d'),'voicePause',_0xd43d('0x9e')]})[_0xd43d('0x15')](handleEntityNotFound(_0x16f88c,null))[_0xd43d('0x15')](function(_0x151d03){if(_0x151d03){if(!utils[_0xd43d('0x9f')](_0x5a7b49)){throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))](_0xd43d('0xa0'));}return _0x151d03[_0xd43d('0xa1')+_[_0xd43d('0xa2')](_0x5a7b49[_0xd43d('0xa3')]())+_0xd43d('0xa4')](_0x2de1e2['body'][_0xd43d('0x64')],{'penalty':_0x2de1e2[_0xd43d('0x60')]['penalty']||0x0})[_0xd43d('0xa5')](function(_0x3b17a2){for(var _0x47cdbc=0x0;_0x47cdbc<_0x2de1e2['body']['ids']['length'];_0x47cdbc+=0x1){var _0x4c7a08={'UserId':Number(_0x2de1e2[_0xd43d('0x61')]['id'])};_0x4c7a08[_[_0xd43d('0xa2')](_0x5a7b49[_0xd43d('0xa3')]())+'QueueId']=Number(_0x2de1e2[_0xd43d('0x60')][_0xd43d('0x64')][_0x47cdbc]);socket[_0xd43d('0x28')](_0xd43d('0x7e')+_[_0xd43d('0xa2')](_0x5a7b49[_0xd43d('0xa3')]())+'Queue:save',_0x4c7a08);}return _0x3b17a2;})[_0xd43d('0x15')](function(){if(_0x5a7b49===_0xd43d('0xa6')){return db[_0xd43d('0xa7')][_0xd43d('0x49')]({'where':{'id':_0x2de1e2[_0xd43d('0x60')][_0xd43d('0x64')]||[]},'raw':!![],'attributes':['id',_0xd43d('0x39')]});}})[_0xd43d('0x15')](function(_0x33ca5a){var _0xef7ca9=_0x151d03[_0xd43d('0x2a')]({'plain':!![]});var _0x264190=[];if(_0x5a7b49===_0xd43d('0xa6')&&_0xef7ca9['role']===_0xd43d('0x2f')&&_0xef7ca9[_0xd43d('0xa8')]){for(let _0x4808e1=0x0;_0x4808e1<_0x33ca5a[_0xd43d('0x5a')];_0x4808e1+=0x1){_0x264190['push']({'membername':_0xef7ca9[_0xd43d('0x39')],'UserId':_0xef7ca9['id'],'queue_name':_0x33ca5a[_0x4808e1][_0xd43d('0x39')],'VoiceQueueId':_0x33ca5a[_0x4808e1]['id'],'interface':_[_0xd43d('0x69')](_0xef7ca9[_0xd43d('0x9e')])?util[_0xd43d('0xa9')](_0xd43d('0xaa'),_0xef7ca9[_0xd43d('0x39')]):_0xef7ca9['interface'],'paused':_0xef7ca9['voicePause']||![],'penalty':_0x2de1e2[_0xd43d('0x60')]['penalty']||0x0});}return Promise[_0xd43d('0x5f')](_0x264190[_0xd43d('0x33')](function(_0x3fc2a2){return db[_0xd43d('0xab')]['upsert'](_0x3fc2a2);}));}return _0x151d03;});}})[_0xd43d('0x15')](respondWithStatusCode(_0x16f88c,null))[_0xd43d('0x1e')](handleError(_0x16f88c,null));};exports[_0xd43d('0xac')]=function(_0x536e0f,_0x2e7e9d){var _0x4f9653,_0x4fc3c3;return db[_0xd43d('0x42')][_0xd43d('0x35')]({'where':{'id':_0x536e0f[_0xd43d('0x61')]['id']},'attributes':['id','name',_0xd43d('0x2b')]})[_0xd43d('0x15')](handleEntityNotFound(_0x2e7e9d,null))[_0xd43d('0x15')](function(_0x325c18){if(_0x325c18){_0x4f9653=_0x325c18;if(!_0x536e0f[_0xd43d('0x43')][_0xd43d('0xad')]||!utils[_0xd43d('0x9f')](_0x536e0f[_0xd43d('0x43')][_0xd43d('0xad')])){throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))]('Unknown\x20channel');}return _0x325c18['remove'+_[_0xd43d('0xa2')](_0x536e0f[_0xd43d('0x43')][_0xd43d('0xad')][_0xd43d('0xa3')]())+_0xd43d('0xa4')](_0x536e0f[_0xd43d('0x43')][_0xd43d('0x64')]);}})[_0xd43d('0x15')](function(_0xe2fa30){if(_[_0xd43d('0xae')](_0x536e0f[_0xd43d('0x43')][_0xd43d('0x64')])){for(var _0x327a48=0x0;_0x327a48<_0x536e0f[_0xd43d('0x43')][_0xd43d('0x64')][_0xd43d('0x5a')];_0x327a48+=0x1){_0x4fc3c3={'UserId':Number(_0x536e0f['params']['id'])};_0x4fc3c3[_[_0xd43d('0xa2')](_0x536e0f[_0xd43d('0x43')][_0xd43d('0xad')][_0xd43d('0xa3')]())+_0xd43d('0xaf')]=Number(_0x536e0f[_0xd43d('0x43')][_0xd43d('0x64')][_0x327a48]);socket[_0xd43d('0x28')](_0xd43d('0x7e')+_['capitalize'](_0x536e0f['query']['channel'][_0xd43d('0xa3')]())+'Queue:remove',_0x4fc3c3);}}else{_0x4fc3c3={'UserId':Number(_0x536e0f[_0xd43d('0x61')]['id'])};_0x4fc3c3[_[_0xd43d('0xa2')](_0x536e0f['query'][_0xd43d('0xad')][_0xd43d('0xa3')]())+_0xd43d('0xaf')]=Number(_0x536e0f[_0xd43d('0x43')][_0xd43d('0x64')]);socket[_0xd43d('0x28')]('user'+_[_0xd43d('0xa2')](_0x536e0f[_0xd43d('0x43')][_0xd43d('0xad')][_0xd43d('0xa3')]())+_0xd43d('0xb0'),_0x4fc3c3);}return _0xe2fa30;})[_0xd43d('0x15')](function(){if(_0x536e0f[_0xd43d('0x43')]['channel']===_0xd43d('0xa6')){return db['UserVoiceQueueRt'][_0xd43d('0xb1')]({'where':{'UserId':_0x536e0f['params']['id'],'VoiceQueueId':_0x536e0f[_0xd43d('0x43')]['ids']},'individualHooks':!![]})[_0xd43d('0x15')](function(){return _0x4f9653;});}return _0x4f9653;})['then'](respondWithStatusCode(_0x2e7e9d,null))[_0xd43d('0x1e')](handleError(_0x2e7e9d,null));};exports[_0xd43d('0xb2')]=function(_0x2a613a,_0x42b824){_0x2a613a[_0xd43d('0x60')][_0xd43d('0xb3')]=_0x2a613a[_0xd43d('0xb4')]['filename'];return db[_0xd43d('0x42')]['find']({'where':{'id':_0x2a613a['params']['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x42b824,null))[_0xd43d('0x15')](saveUpdates(_0x2a613a[_0xd43d('0x60')],null))[_0xd43d('0x15')](respondWithResult(_0x42b824,null))['catch'](handleError(_0x42b824,null));};exports[_0xd43d('0xb5')]=function(_0x493bb1,_0x3c0fb2){var _0xa3481f=path[_0xd43d('0xb6')](config[_0xd43d('0xb7')],_0xd43d('0xb8'));return db['User'][_0xd43d('0x35')]({'where':{'id':_0x493bb1[_0xd43d('0x61')]['id']},'attributes':['id',_0xd43d('0xb3')],'raw':!![]})[_0xd43d('0x15')](handleEntityNotFound(_0x3c0fb2,null))[_0xd43d('0x15')](function(_0x4c9833){if(_0x4c9833){if(_['isNil'](_0x4c9833['userpic'])){return _0x3c0fb2[_0xd43d('0xb9')](_0xa3481f);}else{if(!fs[_0xd43d('0xba')](path[_0xd43d('0xb6')](config['root'],_0xd43d('0xbb'),_0x4c9833[_0xd43d('0xb3')]))){return _0x3c0fb2['download'](_0xa3481f);}return _0x3c0fb2[_0xd43d('0xb9')](path[_0xd43d('0xb6')](config[_0xd43d('0xb7')],_0xd43d('0xbb'),_0x4c9833[_0xd43d('0xb3')]));}}})[_0xd43d('0x1e')](handleError(_0x3c0fb2,null));};exports[_0xd43d('0xbc')]=function(_0x1f15d3,_0xeeb16b){return db['User']['find']({'where':{'id':_0x1f15d3[_0xd43d('0x61')]['id']},'attributes':['id']})[_0xd43d('0x15')](handleEntityNotFound(_0xeeb16b,null))[_0xd43d('0x15')](function(_0x7b0ab3){var _0x204a85=[];values=_0x7b0ab3[_0xd43d('0x4e')];_0x204a85[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x4c'),_0x7b0ab3[_0xd43d('0x4e')]));_0x204a85[_0xd43d('0x48')](get_open_tabs('sms',_0x7b0ab3[_0xd43d('0x4e')]));_0x204a85[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x51'),_0x7b0ab3[_0xd43d('0x4e')]));_0x204a85[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x52'),_0x7b0ab3['dataValues']));_0x204a85[_0xd43d('0x48')](get_open_tabs('fax',_0x7b0ab3[_0xd43d('0x4e')]));_0x204a85[_0xd43d('0x48')](get_open_tabs(_0xd43d('0x50'),_0x7b0ab3[_0xd43d('0x4e')]));return Promise[_0xd43d('0x5f')](_0x204a85);})[_0xd43d('0x15')](function(_0x28d33f){if(_0x28d33f){var _0x32007c=_[_0xd43d('0x33')](values[_0xd43d('0xbd')],function(_0x546a54){return{'channel':_0xd43d('0xbe'),'id':_0x546a54['id'],'createdAt':_0x546a54[_0xd43d('0xbf')]};});var _0xaedd5d=_[_0xd43d('0x33')](values[_0xd43d('0xc0')],function(_0x2542e9){return{'channel':_0xd43d('0xc1'),'id':_0x2542e9['id'],'createdAt':_0x2542e9['createdAt']};});var _0x4915cf=_['map'](values[_0xd43d('0xc2')],function(_0x6447b8){return{'channel':'OPENCHANNEL','id':_0x6447b8['id'],'createdAt':_0x6447b8[_0xd43d('0xbf')]};});var _0x1cce98=_[_0xd43d('0x33')](values[_0xd43d('0xc3')],function(_0x55e0ae){return{'channel':'MAIL','id':_0x55e0ae['id'],'createdAt':_0x55e0ae[_0xd43d('0xbf')]};});var _0x3231fc=_[_0xd43d('0x33')](values[_0xd43d('0xc4')],function(_0x3a50a8){return{'channel':_0xd43d('0xc5'),'id':_0x3a50a8['id'],'createdAt':_0x3a50a8[_0xd43d('0xbf')]};});var _0x3838f1=_[_0xd43d('0x33')](values[_0xd43d('0xc6')],function(_0x37346d){return{'channel':_0xd43d('0xc7'),'id':_0x37346d['id'],'createdAt':_0x37346d['createdAt']};});var _0xf130e8=_[_0xd43d('0xc8')](_0x32007c,_0xaedd5d,_0x4915cf,_0x1cce98,_0x3231fc,_0x3838f1);var _0xbb3eff={'count':_0xf130e8[_0xd43d('0x5a')],'rows':_0xf130e8};return _0xbb3eff;}else return null;})['then'](respondWithResult(_0xeeb16b,null))['catch'](handleError(_0xeeb16b,null));};exports[_0xd43d('0xc9')]=function(_0x5d9bac,_0x2b52ee){var _0x1b0c70={};var _0x46f14c={};var _0x19e731;var _0xd3b9f2;return db[_0xd43d('0x42')]['findOne']({'where':{'id':_0x5d9bac[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x2b52ee,null))[_0xd43d('0x15')](function(_0x36382d){if(_0x36382d){_0x19e731=_0x36382d;_0x46f14c['model']=_[_0xd43d('0x55')](db[_0xd43d('0xca')][_0xd43d('0xcb')]);_0x46f14c[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0x5d9bac[_0xd43d('0x43')]);_0x46f14c[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x46f14c[_0xd43d('0x54')],_0x46f14c[_0xd43d('0x43')]);_0x1b0c70[_0xd43d('0x47')]=_[_0xd43d('0x58')](_0x46f14c['model'],qs['fields'](_0x5d9bac['query'][_0xd43d('0x59')]));_0x1b0c70[_0xd43d('0x47')]=_0x1b0c70[_0xd43d('0x47')]['length']?_0x1b0c70[_0xd43d('0x47')]:_0x46f14c[_0xd43d('0x54')];_0x1b0c70[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0x5d9bac['query']['sort']);_0x1b0c70[_0xd43d('0x41')]=qs['filters'](_[_0xd43d('0xce')](_0x5d9bac[_0xd43d('0x43')],_0x46f14c[_0xd43d('0x57')]));if(_0x5d9bac[_0xd43d('0x43')][_0xd43d('0x32')]){_0x1b0c70[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x1b0c70[_0xd43d('0x41')],{'$or':_['map'](_0x1b0c70[_0xd43d('0x47')],function(_0x28eacd){var _0x3f58f5={};_0x3f58f5[_0x28eacd]={'$like':'%'+_0x5d9bac[_0xd43d('0x43')][_0xd43d('0x32')]+'%'};return _0x3f58f5;})});}_0x1b0c70=_[_0xd43d('0x5c')]({},_0x1b0c70,_0x5d9bac[_0xd43d('0x5d')]);return _0x19e731[_0xd43d('0xc9')](_0x1b0c70);}})[_0xd43d('0x15')](function(_0x464393){if(_0x464393){_0xd3b9f2=_0x464393[_0xd43d('0x5a')];if(_0x5d9bac[_0xd43d('0x43')]['hasOwnProperty']('includeAll')){_0x1b0c70[_0xd43d('0x45')]=[{'model':db[_0xd43d('0xcf')],'as':'List','required':![]},{'model':db[_0xd43d('0xd0')],'as':'Tags','attributes':['id',_0xd43d('0x39'),_0xd43d('0xd1')],'where':_0x5d9bac['query'][_0xd43d('0xd2')]?{'id':_0x5d9bac[_0xd43d('0x43')][_0xd43d('0xd2')]}:undefined,'required':_0x5d9bac[_0xd43d('0x43')][_0xd43d('0xd2')]?!![]:![]}];}if(!_0x5d9bac[_0xd43d('0x43')][_0xd43d('0xd3')]('nolimit')){_0x1b0c70[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x5d9bac[_0xd43d('0x43')][_0xd43d('0x25')]);_0x1b0c70[_0xd43d('0x23')]=qs[_0xd43d('0x23')](_0x5d9bac[_0xd43d('0x43')][_0xd43d('0x23')]);}return _0x19e731['getContacts'](_0x1b0c70);}})[_0xd43d('0x15')](function(_0x35e73d){if(_0x35e73d){return _0x35e73d?{'count':_0xd3b9f2,'rows':_0x35e73d}:null;}})[_0xd43d('0x15')](respondWithResult(_0x2b52ee,null))[_0xd43d('0x1e')](handleError(_0x2b52ee,null));};exports[_0xd43d('0xd4')]=function(_0x57cf82,_0x41e65a){var _0x561b4f;var _0x414503={};var _0x2e2933;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x57cf82['params']['id']},'attributes':['id',_0xd43d('0x39'),'role']})[_0xd43d('0x15')](handleEntityNotFound(_0x41e65a,null))[_0xd43d('0x15')](function(_0x51c87f){if(!utils[_0xd43d('0x9f')](_0x57cf82[_0xd43d('0x43')][_0xd43d('0xad')])){throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))](_0xd43d('0xa0'));}_0x561b4f=_0x51c87f;var _0x1f58d1={};_0x1f58d1[_0xd43d('0x54')]=_[_0xd43d('0x55')](db[_[_0xd43d('0xa2')](_0x57cf82[_0xd43d('0x43')][_0xd43d('0xad')])+_0xd43d('0xd5')][_0xd43d('0xcb')]);_0x1f58d1[_0xd43d('0x43')]=_['keys'](_0x57cf82[_0xd43d('0x43')]);_0x1f58d1[_0xd43d('0x57')]=_['intersection'](_0x1f58d1[_0xd43d('0x54')],_0x1f58d1[_0xd43d('0x43')]);_0x414503['attributes']=_[_0xd43d('0x58')](_0x1f58d1[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x57cf82[_0xd43d('0x43')][_0xd43d('0x59')]));_0x414503[_0xd43d('0x47')]=_0x414503[_0xd43d('0x47')][_0xd43d('0x5a')]?_0x414503['attributes']:_0x1f58d1[_0xd43d('0x54')];_0x414503[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0x57cf82['query'][_0xd43d('0xcd')]);_0x414503['where']=qs['filters'](_[_0xd43d('0xce')](_0x57cf82[_0xd43d('0x43')],_0x1f58d1[_0xd43d('0x57')]));if(_0x57cf82[_0xd43d('0x43')][_0xd43d('0x32')]){_0x414503[_0xd43d('0x41')]=_['merge'](_0x414503[_0xd43d('0x41')],{'$or':_[_0xd43d('0x33')](_0x414503[_0xd43d('0x47')],function(_0x5b8f73){var _0x26b6b7={};_0x26b6b7[_0x5b8f73]={'$like':'%'+_0x57cf82['query'][_0xd43d('0x32')]+'%'};return _0x26b6b7;})});}_0x414503=_[_0xd43d('0x5c')]({},_0x414503,_0x57cf82[_0xd43d('0x5d')]);switch(_0x561b4f['role']){case _0xd43d('0x2c'):return db[_['capitalize'](_0x57cf82[_0xd43d('0x43')][_0xd43d('0xad')])+_0xd43d('0xd5')][_0xd43d('0x49')](_0x414503);case'user':case _0xd43d('0x2f'):return _0x561b4f[_0xd43d('0x2a')+_[_0xd43d('0xa2')](_0x57cf82['query'][_0xd43d('0xad')])+_0xd43d('0xa4')](_0x414503);default:throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))](_0xd43d('0xd6'));}})[_0xd43d('0x15')](function(_0x2bba41){_0x2e2933=_0x2bba41['length'];if(!_0x57cf82[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x414503[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x57cf82[_0xd43d('0x43')][_0xd43d('0x25')]);_0x414503[_0xd43d('0x23')]=qs[_0xd43d('0x23')](_0x57cf82[_0xd43d('0x43')][_0xd43d('0x23')]);}switch(_0x561b4f[_0xd43d('0x2b')]){case _0xd43d('0x2c'):return db[_[_0xd43d('0xa2')](_0x57cf82[_0xd43d('0x43')]['channel'])+_0xd43d('0xd5')][_0xd43d('0x49')](_0x414503);case _0xd43d('0x7e'):case _0xd43d('0x2f'):return _0x561b4f[_0xd43d('0x2a')+_['capitalize'](_0x57cf82[_0xd43d('0x43')][_0xd43d('0xad')])+'Queues'](_0x414503);}})[_0xd43d('0x15')](function(_0x4115ec){return{'count':_0x2e2933,'rows':_0x4115ec};})[_0xd43d('0x15')](respondWithResult(_0x41e65a,null))[_0xd43d('0x1e')](handleError(_0x41e65a,null));};exports[_0xd43d('0xd8')]=function(_0xf1cc2f,_0x5e069f){var _0x1ae0fe={};var _0x3d80b1={};var _0x5d57e9;var _0x7a921c;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0xf1cc2f[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x5e069f,null))[_0xd43d('0x15')](function(_0x23f3ce){if(_0x23f3ce){_0x5d57e9=_0x23f3ce;_0x3d80b1[_0xd43d('0x54')]=_['keys'](db[_0xd43d('0xab')]['rawAttributes']);_0x3d80b1[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0xf1cc2f[_0xd43d('0x43')]);_0x3d80b1[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x3d80b1[_0xd43d('0x54')],_0x3d80b1[_0xd43d('0x43')]);_0x1ae0fe['attributes']=_['intersection'](_0x3d80b1[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0xf1cc2f[_0xd43d('0x43')][_0xd43d('0x59')]));_0x1ae0fe['attributes']=_0x1ae0fe[_0xd43d('0x47')][_0xd43d('0x5a')]?_0x1ae0fe[_0xd43d('0x47')]:_0x3d80b1[_0xd43d('0x54')];_0x1ae0fe[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0xf1cc2f[_0xd43d('0x43')][_0xd43d('0xcd')]);_0x1ae0fe['where']=qs[_0xd43d('0x57')](_[_0xd43d('0xce')](_0xf1cc2f[_0xd43d('0x43')],_0x3d80b1[_0xd43d('0x57')]));if(_0xf1cc2f['query'][_0xd43d('0x32')]){_0x1ae0fe[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x1ae0fe['where'],{'$or':_[_0xd43d('0x33')](_0x1ae0fe['attributes'],function(_0x1c3c9b){var _0x41a298={};_0x41a298[_0x1c3c9b]={'$like':'%'+_0xf1cc2f['query']['filter']+'%'};return _0x41a298;})});}_0x1ae0fe=_[_0xd43d('0x5c')]({},_0x1ae0fe,_0xf1cc2f['options']);return _0x5d57e9[_0xd43d('0xd8')](_0x1ae0fe);}})[_0xd43d('0x15')](function(_0x1193c6){if(_0x1193c6){_0x7a921c=_0x1193c6['length'];if(!_0xf1cc2f[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x1ae0fe['limit']=qs[_0xd43d('0x25')](_0xf1cc2f[_0xd43d('0x43')][_0xd43d('0x25')]);_0x1ae0fe['offset']=qs['offset'](_0xf1cc2f[_0xd43d('0x43')]['offset']);}return _0x5d57e9[_0xd43d('0xd8')](_0x1ae0fe);}})[_0xd43d('0x15')](function(_0xbf6eb9){if(_0xbf6eb9){return _0xbf6eb9?{'count':_0x7a921c,'rows':_0xbf6eb9}:null;}})[_0xd43d('0x15')](respondWithResult(_0x5e069f,null))['catch'](handleError(_0x5e069f,null));};exports['getGroups']=function(_0x168318,_0x14db50){var _0x14736b={};var _0x5c5772={};var _0x4226b6;var _0x1fc2c6;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x168318['params']['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x14db50,null))['then'](function(_0x4c1c84){if(_0x4c1c84){_0x4226b6=_0x4c1c84;_0x5c5772[_0xd43d('0x54')]=_[_0xd43d('0x55')](db[_0xd43d('0xd9')]['rawAttributes']);_0x5c5772[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0x168318['query']);_0x5c5772[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x5c5772[_0xd43d('0x54')],_0x5c5772[_0xd43d('0x43')]);_0x14736b['attributes']=_[_0xd43d('0x58')](_0x5c5772[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x168318[_0xd43d('0x43')][_0xd43d('0x59')]));_0x14736b[_0xd43d('0x47')]=_0x14736b['attributes'][_0xd43d('0x5a')]?_0x14736b[_0xd43d('0x47')]:_0x5c5772['model'];_0x14736b[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0x168318[_0xd43d('0x43')][_0xd43d('0xcd')]);_0x14736b[_0xd43d('0x41')]=qs[_0xd43d('0x57')](_['pick'](_0x168318[_0xd43d('0x43')],_0x5c5772['filters']));if(_0x168318[_0xd43d('0x43')][_0xd43d('0x32')]){_0x14736b[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x14736b[_0xd43d('0x41')],{'$or':_[_0xd43d('0x33')](_0x14736b[_0xd43d('0x47')],function(_0x4d714f){var _0x2b10cd={};_0x2b10cd[_0x4d714f]={'$like':'%'+_0x168318[_0xd43d('0x43')]['filter']+'%'};return _0x2b10cd;})});}_0x14736b=_['merge']({},_0x14736b,_0x168318[_0xd43d('0x5d')]);return _0x4226b6['getGroups'](_0x14736b);}})['then'](function(_0x26bfc2){if(_0x26bfc2){_0x1fc2c6=_0x26bfc2[_0xd43d('0x5a')];if(!_0x168318[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x14736b[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x168318[_0xd43d('0x43')][_0xd43d('0x25')]);_0x14736b['offset']=qs[_0xd43d('0x23')](_0x168318[_0xd43d('0x43')]['offset']);}return _0x4226b6[_0xd43d('0xda')](_0x14736b);}})[_0xd43d('0x15')](function(_0x1ecd63){if(_0x1ecd63){return _0x1ecd63?{'count':_0x1fc2c6,'rows':_0x1ecd63}:null;}})[_0xd43d('0x15')](respondWithResult(_0x14db50,null))[_0xd43d('0x1e')](handleError(_0x14db50,null));};exports[_0xd43d('0xdb')]=function(_0x539ac8,_0x527ab3){var _0x3188fd={'raw':!![],'where':{}};var _0x582218={};var _0x4cd316={'count':0x0,'rows':[]};return db['User'][_0xd43d('0x97')]({'where':{'id':_0x539ac8[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x527ab3,null))[_0xd43d('0x15')](function(_0x8fa705){if(_0x8fa705){_0x582218[_0xd43d('0x54')]=_[_0xd43d('0x55')](db[_0xd43d('0xdc')][_0xd43d('0xcb')]);_0x582218[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0x539ac8[_0xd43d('0x43')]);_0x582218[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x582218[_0xd43d('0x54')],_0x582218[_0xd43d('0x43')]);_0x3188fd[_0xd43d('0x47')]=_[_0xd43d('0x58')](_0x582218[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x539ac8[_0xd43d('0x43')][_0xd43d('0x59')]));_0x3188fd[_0xd43d('0x47')]=_0x3188fd[_0xd43d('0x47')]['length']?_0x3188fd[_0xd43d('0x47')]:_0x582218[_0xd43d('0x54')];if(!_0x539ac8[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x3188fd[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x539ac8[_0xd43d('0x43')][_0xd43d('0x25')]);_0x3188fd[_0xd43d('0x23')]=qs['offset'](_0x539ac8['query'][_0xd43d('0x23')]);}_0x3188fd[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0x539ac8['query'][_0xd43d('0xcd')]);_0x3188fd[_0xd43d('0x41')]=qs[_0xd43d('0x57')](_[_0xd43d('0xce')](_0x539ac8['query'],_0x582218[_0xd43d('0x57')]));_0x3188fd[_0xd43d('0x41')][_0xd43d('0xdd')]=_0x8fa705['id'];if(_0x539ac8[_0xd43d('0x43')][_0xd43d('0x32')]){_0x3188fd[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x3188fd['where'],{'$or':_[_0xd43d('0x33')](_0x3188fd[_0xd43d('0x47')],function(_0x23ab4e){var _0x34c5f7={};_0x34c5f7[_0x23ab4e]={'$like':'%'+_0x539ac8[_0xd43d('0x43')]['filter']+'%'};return _0x34c5f7;})});}_0x3188fd=_[_0xd43d('0x5c')]({},_0x3188fd,_0x539ac8[_0xd43d('0x5d')]);return db[_0xd43d('0xdc')][_0xd43d('0x24')]({'where':_0x3188fd[_0xd43d('0x41')]})[_0xd43d('0x15')](function(_0x20866d){_0x4cd316[_0xd43d('0x24')]=_0x20866d;if(_0x539ac8['query'][_0xd43d('0x44')]){_0x3188fd[_0xd43d('0x45')]=[{'all':!![]}];}return db[_0xd43d('0xdc')][_0xd43d('0x49')](_0x3188fd);})[_0xd43d('0x15')](function(_0x5bdb79){_0x4cd316[_0xd43d('0x4b')]=_0x5bdb79;return _0x4cd316;});}})['then'](respondWithFilteredResult(_0x527ab3,_0x3188fd))[_0xd43d('0x1e')](handleError(_0x527ab3,null));};exports[_0xd43d('0xde')]=function(_0x160629,_0x42b62f){var _0x265603={'raw':!![],'where':{}};var _0x86373f={};var _0x140a13={'count':0x0,'rows':[]};return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x160629[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x42b62f,null))[_0xd43d('0x15')](function(_0x221bee){if(_0x221bee){_0x86373f[_0xd43d('0x54')]=_[_0xd43d('0x55')](db['ScreenRecording']['rawAttributes']);_0x86373f['query']=_[_0xd43d('0x55')](_0x160629[_0xd43d('0x43')]);_0x86373f[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x86373f['model'],_0x86373f[_0xd43d('0x43')]);_0x265603[_0xd43d('0x47')]=_[_0xd43d('0x58')](_0x86373f[_0xd43d('0x54')],qs['fields'](_0x160629['query'][_0xd43d('0x59')]));_0x265603[_0xd43d('0x47')]=_0x265603[_0xd43d('0x47')][_0xd43d('0x5a')]?_0x265603[_0xd43d('0x47')]:_0x86373f[_0xd43d('0x54')];if(!_0x160629['query']['hasOwnProperty'](_0xd43d('0xd7'))){_0x265603['limit']=qs[_0xd43d('0x25')](_0x160629[_0xd43d('0x43')]['limit']);_0x265603[_0xd43d('0x23')]=qs[_0xd43d('0x23')](_0x160629[_0xd43d('0x43')][_0xd43d('0x23')]);}_0x265603[_0xd43d('0xcc')]=qs['sort'](_0x160629['query'][_0xd43d('0xcd')]);_0x265603[_0xd43d('0x41')]=qs[_0xd43d('0x57')](_['pick'](_0x160629[_0xd43d('0x43')],_0x86373f['filters']));_0x265603['where'][_0xd43d('0xdd')]=_0x221bee['id'];if(_0x160629[_0xd43d('0x43')][_0xd43d('0x32')]){_0x265603[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x265603[_0xd43d('0x41')],{'$or':_[_0xd43d('0x33')](_0x265603['attributes'],function(_0x3304cb){var _0x123474={};_0x123474[_0x3304cb]={'$like':'%'+_0x160629[_0xd43d('0x43')][_0xd43d('0x32')]+'%'};return _0x123474;})});}_0x265603=_[_0xd43d('0x5c')]({},_0x265603,_0x160629[_0xd43d('0x5d')]);return db[_0xd43d('0xdf')][_0xd43d('0x24')]({'where':_0x265603[_0xd43d('0x41')]})[_0xd43d('0x15')](function(_0x302a2c){_0x140a13[_0xd43d('0x24')]=_0x302a2c;if(_0x160629[_0xd43d('0x43')][_0xd43d('0x44')]){_0x265603['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xd43d('0x49')](_0x265603);})[_0xd43d('0x15')](function(_0x280923){_0x140a13[_0xd43d('0x4b')]=_0x280923;return _0x140a13;});}})[_0xd43d('0x15')](respondWithFilteredResult(_0x42b62f,_0x265603))['catch'](handleError(_0x42b62f,null));};exports[_0xd43d('0xe0')]=function(_0x199180,_0x55bb3e){var _0x5856b3={};var _0x35fdb8={};var _0x3998da;var _0x321808;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x199180[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x55bb3e,null))[_0xd43d('0x15')](function(_0x276e36){if(_0x276e36){_0x3998da=_0x276e36;_0x35fdb8['model']=_[_0xd43d('0x55')](db['ChatInteraction']['rawAttributes']);_0x35fdb8[_0xd43d('0x43')]=_['keys'](_0x199180[_0xd43d('0x43')]);_0x35fdb8['filters']=_[_0xd43d('0x58')](_0x35fdb8[_0xd43d('0x54')],_0x35fdb8[_0xd43d('0x43')]);_0x5856b3[_0xd43d('0x47')]=_[_0xd43d('0x58')](_0x35fdb8[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x199180[_0xd43d('0x43')][_0xd43d('0x59')]));_0x5856b3[_0xd43d('0x47')]=_0x5856b3['attributes'][_0xd43d('0x5a')]?_0x5856b3[_0xd43d('0x47')]:_0x35fdb8[_0xd43d('0x54')];_0x5856b3[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0x199180['query'][_0xd43d('0xcd')]);_0x5856b3['where']=qs[_0xd43d('0x57')](_['pick'](_0x199180[_0xd43d('0x43')],_0x35fdb8[_0xd43d('0x57')]));if(_0x199180[_0xd43d('0x43')][_0xd43d('0x32')]){_0x5856b3[_0xd43d('0x41')]=_['merge'](_0x5856b3['where'],{'$or':_[_0xd43d('0x33')](_0x5856b3['attributes'],function(_0x1f27ca){var _0x2f74f8={};_0x2f74f8[_0x1f27ca]={'$like':'%'+_0x199180['query']['filter']+'%'};return _0x2f74f8;})});}_0x5856b3=_[_0xd43d('0x5c')]({},_0x5856b3,_0x199180[_0xd43d('0x5d')]);return _0x3998da[_0xd43d('0xe0')](_0x5856b3);}})[_0xd43d('0x15')](function(_0x41ae19){if(_0x41ae19){_0x321808=_0x41ae19[_0xd43d('0x5a')];if(!_0x199180[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x5856b3[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x199180['query'][_0xd43d('0x25')]);_0x5856b3[_0xd43d('0x23')]=qs[_0xd43d('0x23')](_0x199180[_0xd43d('0x43')][_0xd43d('0x23')]);}return _0x3998da[_0xd43d('0xe0')](_0x5856b3);}})[_0xd43d('0x15')](function(_0x2f1a32){if(_0x2f1a32){return _0x2f1a32?{'count':_0x321808,'rows':_0x2f1a32}:null;}})[_0xd43d('0x15')](respondWithResult(_0x55bb3e,null))['catch'](handleError(_0x55bb3e,null));};exports['getOpenchannelInteractions']=function(_0x6168e,_0x366f29){var _0x246bb9={};var _0x495655={};var _0x23ae75;var _0x4c4652;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x6168e[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x366f29,null))[_0xd43d('0x15')](function(_0x816445){if(_0x816445){_0x23ae75=_0x816445;_0x495655['model']=_[_0xd43d('0x55')](db[_0xd43d('0xe1')][_0xd43d('0xcb')]);_0x495655['query']=_[_0xd43d('0x55')](_0x6168e[_0xd43d('0x43')]);_0x495655[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x495655[_0xd43d('0x54')],_0x495655[_0xd43d('0x43')]);_0x246bb9[_0xd43d('0x47')]=_[_0xd43d('0x58')](_0x495655[_0xd43d('0x54')],qs['fields'](_0x6168e[_0xd43d('0x43')][_0xd43d('0x59')]));_0x246bb9[_0xd43d('0x47')]=_0x246bb9[_0xd43d('0x47')]['length']?_0x246bb9['attributes']:_0x495655['model'];_0x246bb9[_0xd43d('0xcc')]=qs['sort'](_0x6168e[_0xd43d('0x43')][_0xd43d('0xcd')]);_0x246bb9[_0xd43d('0x41')]=qs['filters'](_[_0xd43d('0xce')](_0x6168e[_0xd43d('0x43')],_0x495655[_0xd43d('0x57')]));if(_0x6168e[_0xd43d('0x43')][_0xd43d('0x32')]){_0x246bb9[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x246bb9[_0xd43d('0x41')],{'$or':_[_0xd43d('0x33')](_0x246bb9[_0xd43d('0x47')],function(_0x25b1e4){var _0x1bea7b={};_0x1bea7b[_0x25b1e4]={'$like':'%'+_0x6168e[_0xd43d('0x43')][_0xd43d('0x32')]+'%'};return _0x1bea7b;})});}_0x246bb9=_[_0xd43d('0x5c')]({},_0x246bb9,_0x6168e[_0xd43d('0x5d')]);return _0x23ae75[_0xd43d('0xe2')](_0x246bb9);}})[_0xd43d('0x15')](function(_0x5a4a73){if(_0x5a4a73){_0x4c4652=_0x5a4a73[_0xd43d('0x5a')];if(!_0x6168e[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x246bb9[_0xd43d('0x25')]=qs['limit'](_0x6168e[_0xd43d('0x43')][_0xd43d('0x25')]);_0x246bb9[_0xd43d('0x23')]=qs['offset'](_0x6168e[_0xd43d('0x43')][_0xd43d('0x23')]);}return _0x23ae75['getOpenchannelInteractions'](_0x246bb9);}})[_0xd43d('0x15')](function(_0x57a8eb){if(_0x57a8eb){return _0x57a8eb?{'count':_0x4c4652,'rows':_0x57a8eb}:null;}})['then'](respondWithResult(_0x366f29,null))[_0xd43d('0x1e')](handleError(_0x366f29,null));};exports['getMailInteractions']=function(_0x53d31e,_0x5b1583){var _0x324565={'raw':!![],'where':{}};var _0x223bc8={};var _0x1cf0ba={'count':0x0,'rows':[]};return db[_0xd43d('0x42')]['findOne']({'where':{'id':_0x53d31e[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x5b1583,null))[_0xd43d('0x15')](function(_0x2a81ab){if(_0x2a81ab){_0x223bc8['model']=_[_0xd43d('0x55')](db['MailInteraction'][_0xd43d('0xcb')]);_0x223bc8[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0x53d31e[_0xd43d('0x43')]);_0x223bc8[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x223bc8[_0xd43d('0x54')],_0x223bc8[_0xd43d('0x43')]);_0x324565[_0xd43d('0x47')]=_['intersection'](_0x223bc8[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x53d31e[_0xd43d('0x43')][_0xd43d('0x59')]));_0x324565[_0xd43d('0x47')]=_0x324565[_0xd43d('0x47')][_0xd43d('0x5a')]?_0x324565[_0xd43d('0x47')]:_0x223bc8[_0xd43d('0x54')];if(!_0x53d31e[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x324565[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x53d31e['query'][_0xd43d('0x25')]);_0x324565[_0xd43d('0x23')]=qs['offset'](_0x53d31e['query'][_0xd43d('0x23')]);}_0x324565['order']=qs[_0xd43d('0xcd')](_0x53d31e[_0xd43d('0x43')][_0xd43d('0xcd')]);_0x324565['where']=qs[_0xd43d('0x57')](_[_0xd43d('0xce')](_0x53d31e[_0xd43d('0x43')],_0x223bc8[_0xd43d('0x57')]));_0x324565[_0xd43d('0x41')][_0xd43d('0xdd')]=_0x2a81ab['id'];if(_0x53d31e[_0xd43d('0x43')][_0xd43d('0x32')]){_0x324565['where']=_[_0xd43d('0x5c')](_0x324565[_0xd43d('0x41')],{'$or':_['map'](_0x324565[_0xd43d('0x47')],function(_0x36e94b){var _0x14757d={};_0x14757d[_0x36e94b]={'$like':'%'+_0x53d31e[_0xd43d('0x43')][_0xd43d('0x32')]+'%'};return _0x14757d;})});}_0x324565=_[_0xd43d('0x5c')]({},_0x324565,_0x53d31e['options']);return db[_0xd43d('0xe3')][_0xd43d('0x24')]({'where':_0x324565[_0xd43d('0x41')]})['then'](function(_0x1daff7){_0x1cf0ba[_0xd43d('0x24')]=_0x1daff7;if(_0x53d31e['query'][_0xd43d('0x44')]){_0x324565[_0xd43d('0x45')]=[{'all':!![]}];}return db[_0xd43d('0xe3')][_0xd43d('0x49')](_0x324565);})[_0xd43d('0x15')](function(_0x3ab88c){_0x1cf0ba[_0xd43d('0x4b')]=_0x3ab88c;return _0x1cf0ba;});}})[_0xd43d('0x15')](respondWithFilteredResult(_0x5b1583,_0x324565))[_0xd43d('0x1e')](handleError(_0x5b1583,null));};exports[_0xd43d('0xe4')]=function(_0x36806d,_0x14593c){var _0x6997b0={};var _0x558f4f={};var _0x2b4fa7;var _0x58de46;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x36806d[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x14593c,null))[_0xd43d('0x15')](function(_0x98f049){if(_0x98f049){_0x2b4fa7=_0x98f049;_0x558f4f[_0xd43d('0x54')]=_[_0xd43d('0x55')](db[_0xd43d('0xe5')][_0xd43d('0xcb')]);_0x558f4f['query']=_[_0xd43d('0x55')](_0x36806d[_0xd43d('0x43')]);_0x558f4f['filters']=_[_0xd43d('0x58')](_0x558f4f[_0xd43d('0x54')],_0x558f4f['query']);_0x6997b0[_0xd43d('0x47')]=_[_0xd43d('0x58')](_0x558f4f[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x36806d[_0xd43d('0x43')][_0xd43d('0x59')]));_0x6997b0[_0xd43d('0x47')]=_0x6997b0[_0xd43d('0x47')]['length']?_0x6997b0['attributes']:_0x558f4f[_0xd43d('0x54')];_0x6997b0[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0x36806d['query']['sort']);_0x6997b0[_0xd43d('0x41')]=qs['filters'](_[_0xd43d('0xce')](_0x36806d[_0xd43d('0x43')],_0x558f4f[_0xd43d('0x57')]));if(_0x36806d['query'][_0xd43d('0x32')]){_0x6997b0[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x6997b0['where'],{'$or':_[_0xd43d('0x33')](_0x6997b0['attributes'],function(_0x488e15){var _0x40e9dd={};_0x40e9dd[_0x488e15]={'$like':'%'+_0x36806d['query']['filter']+'%'};return _0x40e9dd;})});}_0x6997b0=_['merge']({},_0x6997b0,_0x36806d[_0xd43d('0x5d')]);return _0x2b4fa7['getSmsInteractions'](_0x6997b0);}})[_0xd43d('0x15')](function(_0x4d3086){if(_0x4d3086){_0x58de46=_0x4d3086['length'];if(!_0x36806d['query'][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x6997b0[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x36806d[_0xd43d('0x43')][_0xd43d('0x25')]);_0x6997b0[_0xd43d('0x23')]=qs[_0xd43d('0x23')](_0x36806d[_0xd43d('0x43')][_0xd43d('0x23')]);}return _0x2b4fa7[_0xd43d('0xe4')](_0x6997b0);}})[_0xd43d('0x15')](function(_0x46d2af){if(_0x46d2af){return _0x46d2af?{'count':_0x58de46,'rows':_0x46d2af}:null;}})[_0xd43d('0x15')](respondWithResult(_0x14593c,null))[_0xd43d('0x1e')](handleError(_0x14593c,null));};exports[_0xd43d('0xe6')]=function(_0x1091c2,_0x36532d){var _0x2f8443={};var _0x3f2824={};var _0x2f184c;var _0x392180;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x1091c2[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x36532d,null))[_0xd43d('0x15')](function(_0x26c315){if(_0x26c315){_0x2f184c=_0x26c315;_0x3f2824[_0xd43d('0x54')]=_[_0xd43d('0x55')](db[_0xd43d('0xe7')]['rawAttributes']);_0x3f2824['query']=_['keys'](_0x1091c2[_0xd43d('0x43')]);_0x3f2824[_0xd43d('0x57')]=_['intersection'](_0x3f2824[_0xd43d('0x54')],_0x3f2824['query']);_0x2f8443['attributes']=_[_0xd43d('0x58')](_0x3f2824[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x1091c2['query'][_0xd43d('0x59')]));_0x2f8443[_0xd43d('0x47')]=_0x2f8443[_0xd43d('0x47')][_0xd43d('0x5a')]?_0x2f8443[_0xd43d('0x47')]:_0x3f2824['model'];_0x2f8443['order']=qs[_0xd43d('0xcd')](_0x1091c2[_0xd43d('0x43')][_0xd43d('0xcd')]);_0x2f8443[_0xd43d('0x41')]=qs['filters'](_[_0xd43d('0xce')](_0x1091c2['query'],_0x3f2824[_0xd43d('0x57')]));if(_0x1091c2[_0xd43d('0x43')][_0xd43d('0x32')]){_0x2f8443['where']=_[_0xd43d('0x5c')](_0x2f8443[_0xd43d('0x41')],{'$or':_['map'](_0x2f8443[_0xd43d('0x47')],function(_0x1aa4a4){var _0x3879a3={};_0x3879a3[_0x1aa4a4]={'$like':'%'+_0x1091c2[_0xd43d('0x43')][_0xd43d('0x32')]+'%'};return _0x3879a3;})});}_0x2f8443=_[_0xd43d('0x5c')]({},_0x2f8443,_0x1091c2[_0xd43d('0x5d')]);return _0x2f184c[_0xd43d('0xe6')](_0x2f8443);}})['then'](function(_0x395648){if(_0x395648){_0x392180=_0x395648[_0xd43d('0x5a')];if(!_0x1091c2[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x2f8443[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x1091c2[_0xd43d('0x43')][_0xd43d('0x25')]);_0x2f8443[_0xd43d('0x23')]=qs['offset'](_0x1091c2[_0xd43d('0x43')][_0xd43d('0x23')]);}return _0x2f184c['getFaxInteractions'](_0x2f8443);}})[_0xd43d('0x15')](function(_0x5ce004){if(_0x5ce004){return _0x5ce004?{'count':_0x392180,'rows':_0x5ce004}:null;}})[_0xd43d('0x15')](respondWithResult(_0x36532d,null))[_0xd43d('0x1e')](handleError(_0x36532d,null));};exports[_0xd43d('0xe8')]=function(_0x21fc69,_0x900a50){var _0x55dfdd={};var _0x5d76ab={};var _0x50586e;var _0x1d453d;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x21fc69[_0xd43d('0x61')]['id']}})['then'](handleEntityNotFound(_0x900a50,null))['then'](function(_0x4b5de2){if(_0x4b5de2){_0x50586e=_0x4b5de2;_0x5d76ab[_0xd43d('0x54')]=_['keys'](db[_0xd43d('0xe9')][_0xd43d('0xcb')]);_0x5d76ab[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0x21fc69[_0xd43d('0x43')]);_0x5d76ab[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x5d76ab[_0xd43d('0x54')],_0x5d76ab[_0xd43d('0x43')]);_0x55dfdd['attributes']=_[_0xd43d('0x58')](_0x5d76ab[_0xd43d('0x54')],qs['fields'](_0x21fc69[_0xd43d('0x43')][_0xd43d('0x59')]));_0x55dfdd['attributes']=_0x55dfdd['attributes'][_0xd43d('0x5a')]?_0x55dfdd[_0xd43d('0x47')]:_0x5d76ab[_0xd43d('0x54')];_0x55dfdd[_0xd43d('0xcc')]=qs['sort'](_0x21fc69[_0xd43d('0x43')]['sort']);_0x55dfdd[_0xd43d('0x41')]=qs[_0xd43d('0x57')](_[_0xd43d('0xce')](_0x21fc69[_0xd43d('0x43')],_0x5d76ab[_0xd43d('0x57')]));if(_0x21fc69[_0xd43d('0x43')][_0xd43d('0x32')]){_0x55dfdd[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x55dfdd['where'],{'$or':_[_0xd43d('0x33')](_0x55dfdd[_0xd43d('0x47')],function(_0x5b542d){var _0x1fec52={};_0x1fec52[_0x5b542d]={'$like':'%'+_0x21fc69[_0xd43d('0x43')]['filter']+'%'};return _0x1fec52;})});}_0x55dfdd=_['merge']({},_0x55dfdd,_0x21fc69['options']);return _0x50586e[_0xd43d('0xe8')](_0x55dfdd);}})['then'](function(_0x415314){if(_0x415314){_0x1d453d=_0x415314[_0xd43d('0x5a')];if(!_0x21fc69[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x55dfdd[_0xd43d('0x25')]=qs[_0xd43d('0x25')](_0x21fc69['query'][_0xd43d('0x25')]);_0x55dfdd[_0xd43d('0x23')]=qs[_0xd43d('0x23')](_0x21fc69[_0xd43d('0x43')]['offset']);}return _0x50586e[_0xd43d('0xe8')](_0x55dfdd);}})[_0xd43d('0x15')](function(_0xb9a17){if(_0xb9a17){return _0xb9a17?{'count':_0x1d453d,'rows':_0xb9a17}:null;}})['then'](respondWithResult(_0x900a50,null))[_0xd43d('0x1e')](handleError(_0x900a50,null));};exports['login']=function(_0x5e68e0,_0x470c62,_0x18806a){var _0x330a41;var _0x50c401;var _0x288cb8;var _0x56186d=!_[_0xd43d('0x69')](_0x5e68e0['params']['id'])?_0x5e68e0[_0xd43d('0x61')]['id']:!_['isNil'](_0x5e68e0[_0xd43d('0x7e')]['id'])?_0x5e68e0['user']['id']:null;return db[_0xd43d('0x42')][_0xd43d('0x35')]({'where':{'id':_0x56186d,'role':{'$or':[_0xd43d('0x2c'),_0xd43d('0x7e'),_0xd43d('0x2f')]}},'attributes':['id',_0xd43d('0x39'),'phone',_0xd43d('0xea'),_0xd43d('0x2b'),_0xd43d('0x68'),'loginInPause']})[_0xd43d('0x15')](function(_0x2712ff){if(_0x2712ff){if(_0x2712ff[_0xd43d('0x2b')]===_0xd43d('0x2f')){_0x330a41=_0x2712ff;if(_0x5e68e0[_0xd43d('0x60')][_0xd43d('0x9e')]){_0x288cb8=util[_0xd43d('0xa9')](_0xd43d('0xeb'),_0x330a41[_0x5e68e0[_0xd43d('0x60')][_0xd43d('0x9e')]]);}else if(_0x5e68e0[_0xd43d('0x60')]['intrf']){_0x288cb8=util[_0xd43d('0xa9')](_0xd43d('0xaa'),_0x5e68e0[_0xd43d('0x60')][_0xd43d('0xec')]);}else{_0x288cb8=util[_0xd43d('0xa9')](_0xd43d('0xaa'),_0x330a41[_0xd43d('0x39')]);}socket['to'](util[_0xd43d('0xa9')]('user:%s',_0x330a41[_0xd43d('0x39')]))[_0xd43d('0x28')](_0xd43d('0xed'),{'user':{'id':_0x330a41['id'],'name':_0x330a41[_0xd43d('0x39')]},'ip':_0x5e68e0[_0xd43d('0xee')]['x-forwarded-for']||_0x5e68e0[_0xd43d('0xef')][_0xd43d('0xf0')]||_0x5e68e0[_0xd43d('0xf1')][_0xd43d('0xf0')]||_0x5e68e0[_0xd43d('0xef')][_0xd43d('0xf1')][_0xd43d('0xf0')]});return db[_0xd43d('0xab')]['destroy']({'where':{'membername':_0x330a41[_0xd43d('0x39')]},'individualHooks':!![]});}}else{throw new db[(_0xd43d('0x90'))][(_0xd43d('0x91'))](_0xd43d('0xf2'));}})[_0xd43d('0x15')](function(){if(_0x330a41){return _0x330a41[_0xd43d('0xf3')]({'raw':!![]});}})['then'](function(_0x17933a){if(_0x330a41){if(_0x17933a){_0x50c401=_0x17933a;if(_0x50c401[_0xd43d('0x5a')]){var _0x4c2d81=_0x50c401[_0xd43d('0x33')](function(_0x1866e9){var _0x32527d={'membername':_0x330a41[_0xd43d('0x39')],'UserId':_0x330a41['id'],'queue_name':_0x1866e9['name'],'VoiceQueueId':_0x1866e9['id'],'interface':_0x288cb8,'paused':_0x330a41['loginInPause']||![],'penalty':_0x1866e9[_0xd43d('0xf4')]||0x0};return db['UserVoiceQueueRt'][_0xd43d('0xf5')](_0x32527d);});return Promise[_0xd43d('0x5f')](_0x4c2d81);}}}})['then'](function(){if(_0x330a41){return db[_0xd43d('0xf6')][_0xd43d('0x49')]({'where':{'membername':_0x330a41['name'],'exitAt':null}});}})[_0xd43d('0x15')](function(_0x12ec81){if(_0x330a41){var _0x315e76=[];_0x12ec81[_0xd43d('0xf7')](function(_0x13df57){_0x315e76[_0xd43d('0x48')](_0x13df57[_0xd43d('0x27')]({'exitAt':moment()[_0xd43d('0xa9')](_0xd43d('0xf8'))}));});return Promise['all'](_0x315e76);}})['then'](function(){if(_0x330a41){var _0x529977=[];var _0x2824c4=[];var _0x46fbc5=utils[_0xd43d('0xf9')]();var _0xf1824c={'membername':_0x330a41['name'],'interface':_0x288cb8,'enterAt':moment()[_0xd43d('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x330a41['role'],'internal':_0x330a41[_0xd43d('0x68')]};_0x46fbc5[_0xd43d('0xf7')](function(_0x5cd18f){_0x529977[_0xd43d('0x48')](_[_0xd43d('0x5c')]({'channel':_0x5cd18f,'type':_0xd43d('0xfa'),'data1':_0x5e68e0[_0xd43d('0x60')][_0xd43d('0xfb')],'data2':_0x288cb8},_0xf1824c));if(_0x330a41[_0xd43d('0x9d')]){_0x2824c4[_0xd43d('0x48')](_['merge']({'channel':_0x5cd18f,'type':'PAUSE','data1':'LOGININPAUSE'},_0xf1824c));}});return db[_0xd43d('0xf6')]['bulkCreate'](_0x529977['concat'](_0x2824c4),{'individualHooks':!![]});}})[_0xd43d('0x15')](function(){if(_0x330a41){return _0x330a41[_0xd43d('0x27')]({'online':!![],'lastLoginAt':moment()[_0xd43d('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x330a41[_0xd43d('0x9d')]||![],'mailPause':_0x330a41[_0xd43d('0x9d')]||![],'chatPause':_0x330a41[_0xd43d('0x9d')]||![],'faxPause':_0x330a41[_0xd43d('0x9d')]||![],'smsPause':_0x330a41['loginInPause']||![],'openchannelPause':_0x330a41[_0xd43d('0x9d')]||![],'whatsappPause':_0x330a41[_0xd43d('0x9d')]||![],'pauseType':_0x330a41[_0xd43d('0x9d')]?_0xd43d('0xfc'):null,'interface':_0x288cb8,'lastPauseAt':moment()[_0xd43d('0xa9')](_0xd43d('0xf8'))});}})[_0xd43d('0x15')](function(_0x142ecc){if(_0x5e68e0[_0xd43d('0xfd')]){return _0x18806a();}else{return Promise[_0xd43d('0xfe')](_0x142ecc)[_0xd43d('0x15')](respondWithResult(_0x470c62,null));}})[_0xd43d('0x1e')](handleError(_0x470c62,null));};exports[_0xd43d('0xff')]=function(_0x53c117,_0xe0061c){var _0x4d7f1d;return db['User'][_0xd43d('0x35')]({'where':{'id':_0x53c117[_0xd43d('0x61')]['id'],'role':_0xd43d('0x2f')},'attributes':['id','name',_0xd43d('0x2b')]})[_0xd43d('0x15')](handleEntityNotFound(_0xe0061c,null))[_0xd43d('0x15')](function(_0x4f2a1d){if(_0x4f2a1d){_0x4d7f1d=_0x4f2a1d;return db[_0xd43d('0xab')][_0xd43d('0xb1')]({'where':{'membername':_0x4d7f1d[_0xd43d('0x39')]},'individualHooks':!![]});}})[_0xd43d('0x15')](function(){return db['MemberReport'][_0xd43d('0x49')]({'where':{'membername':_0x4d7f1d[_0xd43d('0x39')],'exitAt':null}});})['then'](function(_0x3a2c05){var _0x62d789=[];_0x3a2c05[_0xd43d('0xf7')](function(_0x2cda30){_0x62d789[_0xd43d('0x48')](_0x2cda30[_0xd43d('0x27')]({'exitAt':moment()[_0xd43d('0xa9')](_0xd43d('0xf8'))}));});return Promise[_0xd43d('0x5f')](_0x62d789);})[_0xd43d('0x15')](function(){return _0x4d7f1d[_0xd43d('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xd43d('0x15')](respondWithResult(_0xe0061c,null))[_0xd43d('0x1e')](handleError(_0xe0061c,null));};exports[_0xd43d('0x100')]=function(_0x18d3b3,_0x45a119){var _0x1f8720;return db[_0xd43d('0xab')][_0xd43d('0x27')]({'paused':0x1},{'where':{'UserId':_0x18d3b3[_0xd43d('0x61')]['id']},'individualHooks':!![]})[_0xd43d('0x15')](function(){return db['User']['find']({'where':{'id':_0x18d3b3[_0xd43d('0x61')]['id'],'role':'agent'},'attributes':['id',_0xd43d('0x39'),_0xd43d('0x2b'),_0xd43d('0x68'),_0xd43d('0x9e'),_0xd43d('0xa8')]});})[_0xd43d('0x15')](handleEntityNotFound(_0x45a119,null))[_0xd43d('0x15')](function(_0x3835da){if(_0x3835da){_0x1f8720=_0x3835da;return respondWithRpcPromise(_0xd43d('0x101'),_0xd43d('0x100'),{'id':_0x1f8720['id'],'name':_0x1f8720[_0xd43d('0x39')],'pause':!![]});}})[_0xd43d('0x15')](function(){if(_0x1f8720){return db[_0xd43d('0xf6')][_0xd43d('0x49')]({'where':{'membername':_0x1f8720['name'],'type':_0xd43d('0x102'),'exitAt':null}});}})[_0xd43d('0x15')](function(_0x1bff1d){if(_0x1bff1d['length']){var _0x44f332=moment()[_0xd43d('0xa9')](_0xd43d('0xf8'));for(var _0x54516d=0x0,_0x4c3644=_0x1bff1d['length'];_0x54516d<_0x4c3644;_0x54516d++){_0x1bff1d[_0x54516d][_0xd43d('0x103')]({'exitAt':_0x44f332});}}})['then'](function(){var _0xc1abe=[];var _0x1d8bcb=utils[_0xd43d('0xf9')]();_0x1d8bcb[_0xd43d('0xf7')](function(_0x41d8b9){_0xc1abe[_0xd43d('0x48')]({'channel':_0x41d8b9,'membername':_0x1f8720['name'],'interface':_[_0xd43d('0x69')](_0x1f8720[_0xd43d('0x9e')])?util[_0xd43d('0xa9')](_0xd43d('0xaa'),_0x1f8720[_0xd43d('0x39')]):_0x1f8720['interface'],'type':_0xd43d('0x102'),'enterAt':moment()[_0xd43d('0xa9')](_0xd43d('0xf8')),'data1':_0x18d3b3[_0xd43d('0x60')]['type']||_0xd43d('0x104'),'role':_0x1f8720[_0xd43d('0x2b')],'internal':_0x1f8720[_0xd43d('0x68')]});});return db['MemberReport']['bulkCreate'](_0xc1abe,{'individualHooks':!![]});})['then'](function(){return _0x1f8720[_0xd43d('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x18d3b3[_0xd43d('0x60')][_0xd43d('0x3c')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xd43d('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd43d('0x15')](respondWithResult(_0x45a119,null))[_0xd43d('0x1e')](handleError(_0x45a119,null));};exports[_0xd43d('0x105')]=function(_0x4164bc,_0x196227){if(_0x4164bc[_0xd43d('0x60')][_0xd43d('0xad')]&&!utils[_0xd43d('0x9f')](_0x4164bc['body']['channel'])){throw new APIBadRequestError(util[_0xd43d('0xa9')](_0xd43d('0x106'),_0x4164bc[_0xd43d('0x60')]['channel']));}return db[_0xd43d('0x42')][_0xd43d('0x35')]({'where':{'id':_0x4164bc[_0xd43d('0x61')]['id']},'attributes':['id',_0xd43d('0x39'),_0xd43d('0x2b'),_0xd43d('0x68'),'interface',_0xd43d('0xa8'),_0xd43d('0x107'),_0xd43d('0x108'),'chatPause',_0xd43d('0x109'),'openchannelPause',_0xd43d('0x10a'),_0xd43d('0x10b'),_0xd43d('0x10c'),_0xd43d('0x10d')]})[_0xd43d('0x15')](function(_0x2e6298){if(!_0x2e6298){throw new APINotFoundError(util['format'](_0xd43d('0x10e'),_0x4164bc[_0xd43d('0x61')]['id']));}return _0x2e6298['unpause'](_0x4164bc[_0xd43d('0x60')][_0xd43d('0xad')]);})[_0xd43d('0x15')](respondWithResult(_0x196227,null))[_0xd43d('0x1e')](APIHandleError(_0x196227));};exports[_0xd43d('0x10f')]=function(_0x3b24e0,_0x22cb89){var _0x2950c6={};var _0x1cf937={};var _0x59739b;var _0x4a8ae1;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x3b24e0[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x22cb89,null))[_0xd43d('0x15')](function(_0x4e6258){if(_0x4e6258){_0x59739b=_0x4e6258;_0x1cf937[_0xd43d('0x54')]=_[_0xd43d('0x55')](db['Team'][_0xd43d('0xcb')]);_0x1cf937[_0xd43d('0x43')]=_[_0xd43d('0x55')](_0x3b24e0['query']);_0x1cf937[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x1cf937['model'],_0x1cf937['query']);_0x2950c6['attributes']=_['intersection'](_0x1cf937['model'],qs[_0xd43d('0x59')](_0x3b24e0['query'][_0xd43d('0x59')]));_0x2950c6[_0xd43d('0x47')]=_0x2950c6['attributes'][_0xd43d('0x5a')]?_0x2950c6['attributes']:_0x1cf937[_0xd43d('0x54')];_0x2950c6[_0xd43d('0xcc')]=qs[_0xd43d('0xcd')](_0x3b24e0[_0xd43d('0x43')][_0xd43d('0xcd')]);_0x2950c6[_0xd43d('0x41')]=qs['filters'](_[_0xd43d('0xce')](_0x3b24e0['query'],_0x1cf937[_0xd43d('0x57')]));if(_0x3b24e0['query'][_0xd43d('0x32')]){_0x2950c6[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x2950c6[_0xd43d('0x41')],{'$or':_[_0xd43d('0x33')](_0x2950c6[_0xd43d('0x47')],function(_0x39e2e9){var _0xe8f72d={};_0xe8f72d[_0x39e2e9]={'$like':'%'+_0x3b24e0['query'][_0xd43d('0x32')]+'%'};return _0xe8f72d;})});}_0x2950c6=_['merge']({},_0x2950c6,_0x3b24e0[_0xd43d('0x5d')]);return _0x59739b['getTeams'](_0x2950c6);}})[_0xd43d('0x15')](function(_0xcba350){if(_0xcba350){_0x4a8ae1=_0xcba350[_0xd43d('0x5a')];if(!_0x3b24e0[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0x2950c6['limit']=qs[_0xd43d('0x25')](_0x3b24e0[_0xd43d('0x43')][_0xd43d('0x25')]);_0x2950c6[_0xd43d('0x23')]=qs['offset'](_0x3b24e0[_0xd43d('0x43')][_0xd43d('0x23')]);}return _0x59739b['getTeams'](_0x2950c6);}})[_0xd43d('0x15')](function(_0x6c1721){if(_0x6c1721){return _0x6c1721?{'count':_0x4a8ae1,'rows':_0x6c1721}:null;}})[_0xd43d('0x15')](respondWithResult(_0x22cb89,null))[_0xd43d('0x1e')](handleError(_0x22cb89,null));};exports[_0xd43d('0x110')]=function(_0x183434,_0x2b4bdf){var _0x47654e=_0x183434[_0xd43d('0x61')]['id'];var _0x39b6a7=_0x183434[_0xd43d('0x60')]?_0x183434[_0xd43d('0x60')][_0xd43d('0x64')]:null;var _0x58e0a0=[];return Promise[_0xd43d('0xfe')]()[_0xd43d('0x15')](function(){if(!_0x39b6a7)throw new APIBadRequestError(_0xd43d('0x111'));})[_0xd43d('0x15')](function(){return db['User'][_0xd43d('0x97')]({'where':{'id':_0x47654e}});})[_0xd43d('0x15')](function(_0x34e992){if(!_0x34e992)throw new APINotFoundError(util[_0xd43d('0xa9')](_0xd43d('0x10e'),_0x183434[_0xd43d('0x61')]['id']));return db[_0xd43d('0x6b')][_0xd43d('0x112')](function(_0x1e1d7e){return _0x34e992[_0xd43d('0x110')](_0x39b6a7,{'transaction':_0x1e1d7e})['then'](function(){return db[_0xd43d('0x113')][_0xd43d('0x49')]({'where':{'id':{'$in':_0x39b6a7}}});})['then'](function(_0x223064){var _0x4153bc=_[_0xd43d('0x33')](_0x223064,function(_0x117092){return _0x117092[_0xd43d('0x114')]();});return Promise[_0xd43d('0x5f')](_0x4153bc);})[_0xd43d('0x15')](function(_0x17d13b){_0x58e0a0=_[_0xd43d('0x115')](_0x17d13b);var _0x63debc=_[_0xd43d('0x33')](_0x58e0a0,function(_0xccf1ec){return _0xccf1ec['addAgent'](_0x34e992['id'],{'transaction':_0x1e1d7e});});return Promise[_0xd43d('0x5f')](_0x63debc);})[_0xd43d('0x15')](function(){if(!_0x34e992['online'])return;var _0x10372d=_[_0xd43d('0x32')](_0x58e0a0,function(_0x478f89){return _0x478f89[_0xd43d('0x116')](_0xd43d('0xad'))===_0xd43d('0x117');});var _0x536d94=_[_0xd43d('0x33')](_0x10372d,function(_0x5e5027){return db[_0xd43d('0xab')]['upsert']({'membername':_0x34e992[_0xd43d('0x39')],'UserId':_0x34e992['id'],'queue_name':_0x5e5027[_0xd43d('0x39')],'VoiceQueueId':_0x5e5027['id'],'interface':_['isNil'](_0x34e992[_0xd43d('0x9e')])?util['format'](_0xd43d('0xaa'),_0x34e992[_0xd43d('0x39')]):_0x34e992[_0xd43d('0x9e')],'paused':_0x34e992[_0xd43d('0x107')]||![],'penalty':_0x34e992[_0xd43d('0x118')]},{'transaction':_0x1e1d7e});});return Promise[_0xd43d('0x5f')](_0x536d94);})[_0xd43d('0x15')](function(){return db[_0xd43d('0x119')]['findAll']({'where':{'teamId':{'$in':_0x39b6a7}}});})['then'](function(_0x384e16){var _0x5f2b1f=_[_0xd43d('0x33')](_0x384e16,function(_0x34c7db){return db[_0xd43d('0x11a')][_0xd43d('0x7d')]({'UserId':_0x34e992['id'],'VoicePrefixId':_0x34c7db[_0xd43d('0x11b')]},{'transaction':_0x1e1d7e});});return Promise['all'](_0x5f2b1f);});});})['then'](function(){for(var _0x22f9f0=0x0;_0x22f9f0<_0x58e0a0[_0xd43d('0x5a')];_0x22f9f0++){var _0x193828=_0x58e0a0[_0x22f9f0]['getDataValue'](_0xd43d('0xad'));var _0x265565=_0x193828+_0xd43d('0xaf');socket['emit']('user'+_0x193828+'Queue:save',{'UserId':_0x47654e,['queueField']:_0x58e0a0[_0x22f9f0]['id']});}})['then'](respondWithStatusCode(_0x2b4bdf,null))['catch'](APIHandleError(_0x2b4bdf));};exports['removeTeams']=function(_0x4be04f,_0x31a190){var _0xb4f0f9=_0x4be04f[_0xd43d('0x61')]['id'];var _0x8936db=null;if(_0x4be04f['query'][_0xd43d('0x64')]){_0x8936db=_[_0xd43d('0xae')](_0x4be04f['query'][_0xd43d('0x64')])?_0x4be04f[_0xd43d('0x43')][_0xd43d('0x64')]:[_0x4be04f['query'][_0xd43d('0x64')]];}var _0x4ca177=[];return Promise[_0xd43d('0xfe')]()[_0xd43d('0x15')](function(){if(!_0x8936db)throw new APIBadRequestError(_0xd43d('0x11c'));})[_0xd43d('0x15')](function(){return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0xb4f0f9}});})['then'](function(_0x1b6dc2){if(!_0x1b6dc2)throw new APINotFoundError(util[_0xd43d('0xa9')](_0xd43d('0x10e'),_0x4be04f[_0xd43d('0x61')]['id']));return db[_0xd43d('0x6b')][_0xd43d('0x112')](function(_0x1cc8f1){return _0x1b6dc2[_0xd43d('0x11d')](_0x8936db,{'transaction':_0x1cc8f1})[_0xd43d('0x15')](function(){return db[_0xd43d('0x113')][_0xd43d('0x49')]({'where':{'id':{'$in':_0x8936db}}});})[_0xd43d('0x15')](function(_0x4641c8){var _0x165877=_['map'](_0x4641c8,function(_0x11a320){return _0x11a320[_0xd43d('0x114')]();});return Promise[_0xd43d('0x5f')](_0x165877);})[_0xd43d('0x15')](function(_0x5bc378){_0x4ca177=_[_0xd43d('0x115')](_0x5bc378);var _0x3e95d4=_[_0xd43d('0x33')](_0x4ca177,function(_0x3242a5){return _0x3242a5[_0xd43d('0x11e')](_0x1b6dc2['id'],{'transaction':_0x1cc8f1});});return Promise[_0xd43d('0x5f')](_0x3e95d4);})['then'](function(){if(!_0x1b6dc2[_0xd43d('0xa8')])return;var _0x1c97fa=_['filter'](_0x4ca177,function(_0x12839b){return _0x12839b[_0xd43d('0x116')](_0xd43d('0xad'))===_0xd43d('0x117');});var _0x5c103a=_['map'](_0x1c97fa,function(_0xfaf667){return db[_0xd43d('0xab')][_0xd43d('0xb1')]({'where':{'VoiceQueueId':_0xfaf667['id'],'UserId':_0x1b6dc2['id']},'transaction':_0x1cc8f1});});return Promise[_0xd43d('0x5f')](_0x5c103a);})[_0xd43d('0x15')](function(){return db[_0xd43d('0x119')][_0xd43d('0x49')]({'where':{'teamId':{'$in':_0x8936db}}});})[_0xd43d('0x15')](function(_0x215cd1){var _0xe78f82=_[_0xd43d('0x33')](_0x215cd1,function(_0x4aad1f){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x1b6dc2['id'],'VoicePrefixId':_0x4aad1f[_0xd43d('0x11b')]}},{'transaction':_0x1cc8f1});});return Promise[_0xd43d('0x5f')](_0xe78f82);});});})['then'](function(){for(var _0x5a8916=0x0;_0x5a8916<_0x4ca177['length'];_0x5a8916++){var _0xeaccf8=_0x4ca177[_0x5a8916][_0xd43d('0x116')](_0xd43d('0xad'));var _0x3fc20c=_0xeaccf8+_0xd43d('0xaf');socket[_0xd43d('0x28')](_0xd43d('0x7e')+_0xeaccf8+_0xd43d('0xb0'),{'UserId':_0xb4f0f9,['queueField']:_0x4ca177[_0x5a8916]['id']});}})[_0xd43d('0x15')](respondWithStatusCode(_0x31a190,null))[_0xd43d('0x1e')](APIHandleError(_0x31a190));};exports[_0xd43d('0x11f')]=function(_0x36b7cc,_0x45b9cf){var _0xb692f5={};var _0x13cf4e={};var _0x3d5e9b;var _0x113387;return db['User']['findOne']({'where':{'id':_0x36b7cc[_0xd43d('0x61')]['id']}})['then'](handleEntityNotFound(_0x45b9cf,null))[_0xd43d('0x15')](function(_0x3324d5){if(_0x3324d5){_0x3d5e9b=_0x3324d5;_0x13cf4e[_0xd43d('0x54')]=_[_0xd43d('0x55')](db['CmList'][_0xd43d('0xcb')]);_0x13cf4e['query']=_[_0xd43d('0x55')](_0x36b7cc['query']);_0x13cf4e[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x13cf4e['model'],_0x13cf4e[_0xd43d('0x43')]);_0xb692f5[_0xd43d('0x47')]=_[_0xd43d('0x58')](_0x13cf4e[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x36b7cc[_0xd43d('0x43')][_0xd43d('0x59')]));_0xb692f5[_0xd43d('0x47')]=_0xb692f5[_0xd43d('0x47')]['length']?_0xb692f5[_0xd43d('0x47')]:_0x13cf4e[_0xd43d('0x54')];_0xb692f5[_0xd43d('0xcc')]=qs['sort'](_0x36b7cc[_0xd43d('0x43')][_0xd43d('0xcd')]);_0xb692f5['where']=qs['filters'](_[_0xd43d('0xce')](_0x36b7cc['query'],_0x13cf4e[_0xd43d('0x57')]));if(_0x36b7cc[_0xd43d('0x43')][_0xd43d('0x32')]){_0xb692f5[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0xb692f5['where'],{'$or':_[_0xd43d('0x33')](_0xb692f5['attributes'],function(_0x933abf){var _0x3f9346={};_0x3f9346[_0x933abf]={'$like':'%'+_0x36b7cc[_0xd43d('0x43')][_0xd43d('0x32')]+'%'};return _0x3f9346;})});}_0xb692f5=_[_0xd43d('0x5c')]({},_0xb692f5,_0x36b7cc[_0xd43d('0x5d')]);return _0x3d5e9b['getLists'](_0xb692f5);}})[_0xd43d('0x15')](function(_0x4b50ea){if(_0x4b50ea){_0x113387=_0x4b50ea['length'];if(!_0x36b7cc[_0xd43d('0x43')][_0xd43d('0xd3')](_0xd43d('0xd7'))){_0xb692f5['limit']=qs[_0xd43d('0x25')](_0x36b7cc[_0xd43d('0x43')][_0xd43d('0x25')]);_0xb692f5[_0xd43d('0x23')]=qs['offset'](_0x36b7cc[_0xd43d('0x43')][_0xd43d('0x23')]);}return _0x3d5e9b[_0xd43d('0x11f')](_0xb692f5);}})[_0xd43d('0x15')](function(_0xe3ef64){if(_0xe3ef64){return _0xe3ef64?{'count':_0x113387,'rows':_0xe3ef64}:null;}})[_0xd43d('0x15')](respondWithResult(_0x45b9cf,null))[_0xd43d('0x1e')](handleError(_0x45b9cf,null));};exports[_0xd43d('0x120')]=function(_0x211e15,_0x46968b){var _0x184acb={};var _0x540534={};var _0x385f48;return db[_0xd43d('0x42')][_0xd43d('0x97')]({'where':{'id':_0x211e15[_0xd43d('0x61')]['id']}})[_0xd43d('0x15')](handleEntityNotFound(_0x46968b,null))[_0xd43d('0x15')](function(_0x5a927c){if(_0x5a927c){_0x385f48=_0x5a927c;_0x540534[_0xd43d('0x54')]=_[_0xd43d('0x55')](db[_0xd43d('0x42')]['rawAttributes']);_0x540534['query']=_[_0xd43d('0x55')](_0x211e15['query']);_0x540534[_0xd43d('0x57')]=_[_0xd43d('0x58')](_0x540534[_0xd43d('0x54')],_0x540534[_0xd43d('0x43')]);_0x184acb[_0xd43d('0x47')]=_['intersection'](_0x540534[_0xd43d('0x54')],qs[_0xd43d('0x59')](_0x211e15['query'][_0xd43d('0x59')]));_0x184acb['attributes']=_0x184acb[_0xd43d('0x47')][_0xd43d('0x5a')]?_0x184acb[_0xd43d('0x47')]:_0x540534[_0xd43d('0x54')];_0x184acb['order']=qs['sort'](_0x211e15['query'][_0xd43d('0xcd')]);_0x184acb['where']=qs['filters'](_[_0xd43d('0xce')](_0x211e15[_0xd43d('0x43')],_0x540534['filters']));if(_0x211e15[_0xd43d('0x43')][_0xd43d('0x32')]){_0x184acb[_0xd43d('0x41')]=_[_0xd43d('0x5c')](_0x184acb['where'],{'$or':_[_0xd43d('0x33')](_0x184acb['attributes'],function(_0xe058e4){var _0x2d450f={};_0x2d450f[_0xe058e4]={'$like':'%'+_0x211e15[_0xd43d('0x43')][_0xd43d('0x32')]+'%'};return _0x2d450f;})});}_0x184acb['model']=db[_0xd43d('0x42')];_0x184acb['as']=_0xd43d('0x2e');_0x184acb=_[_0xd43d('0x5c')]({},_0x184acb,_0x211e15[_0xd43d('0x5d')]);return _0x385f48[_0xd43d('0xf3')]({'include':[_0x184acb]});}})['then'](function(_0x8ff07b){if(_0x8ff07b){var _0x2d2e42={},_0x1c6cf5=[];for(var _0x608e4a=0x0;_0x608e4a<_0x8ff07b[_0xd43d('0x5a')];_0x608e4a+=0x1){for(var _0x27c8a4=0x0,_0x3b6009;_0x27c8a4<_0x8ff07b[_0x608e4a][_0xd43d('0x2e')][_0xd43d('0x5a')];_0x27c8a4+=0x1){_0x3b6009=_0x8ff07b[_0x608e4a][_0xd43d('0x2e')][_0x27c8a4]['get']({'plain':!![]});_0x2d2e42[_0x3b6009['id']]=_0x3b6009;}}_0x2d2e42=_[_0xd43d('0x121')](_0x2d2e42);for(var _0x270aff=qs[_0xd43d('0x23')](_0x211e15[_0xd43d('0x43')]['offset']);_0x270aff<_0x2d2e42['length']&&_0x1c6cf5[_0xd43d('0x5a')]=_0x3e32fd){_0x914041=_0x3e32fd;_0x1bcab4=0xc8;}else{_0x1bcab4=0xce;}_0x3513df['status'](_0x1bcab4);return _0x3513df[_0x2cd5('0x26')](_0x2cd5('0x27'),_0xe39bfd+'-'+_0x914041+'/'+_0x3e32fd)[_0x2cd5('0x22')](_0x25589f);}return null;};}function saveUpdates(_0x2bf9c1){return function(_0x1fc371){if(_0x1fc371){return _0x1fc371['update'](_0x2bf9c1)[_0x2cd5('0x15')](function(_0x343586){socket['emit'](_0x2cd5('0x28')+_0x343586['id'],{});return _0x343586;});}return null;};}function removeEntity(_0x512cdd){return function(_0x2973f9){if(_0x2973f9){return _0x2973f9[_0x2cd5('0x29')]()[_0x2cd5('0x15')](function(){var _0xcf062d=_0x2973f9[_0x2cd5('0x2a')]({'plain':!![]});if(_0xcf062d['role']===_0x2cd5('0x2b'))return;var _0x3ad65b=[{'name':_0x2cd5('0x2c'),'value':_0x2cd5('0x2d'),'ignore':!![]},{'name':_0x2cd5('0x2e'),'value':_0x2cd5('0x2f'),'ignore':![]},{'name':_0x2cd5('0x30'),'value':'telephone','ignore':![]}];var _0xcc5f72=_(_0x3ad65b)[_0x2cd5('0x31')](_0x2cd5('0x32'))[_0x2cd5('0x33')]('value')['value']();if(_[_0x2cd5('0x34')](_0xcc5f72,_0xcf062d[_0x2cd5('0x35')])){return;}var _0x2a04f7=_['find'](_0x3ad65b,[_0x2cd5('0x36'),_0xcf062d[_0x2cd5('0x35')]])['name'];return db['UserProfileResource'][_0x2cd5('0x29')]({'where':{'type':_0x2a04f7,'resourceId':_0xcf062d['id']}})[_0x2cd5('0x15')](function(){return _0x2973f9;});})['then'](function(){_0x512cdd['status'](0xcc)[_0x2cd5('0x37')]();});}};}function handleEntityNotFound(_0x4f9a5a){return function(_0x478048){if(!_0x478048){_0x4f9a5a['sendStatus'](0x194);}return _0x478048;};}function handleError(_0x32ad25,_0x480ce8){_0x480ce8=_0x480ce8||0x1f4;return function(_0x45dff1){logger[_0x2cd5('0x1b')](_0x45dff1[_0x2cd5('0x38')]);if(_0x45dff1[_0x2cd5('0x39')]){delete _0x45dff1[_0x2cd5('0x39')];}_0x32ad25['status'](_0x480ce8)[_0x2cd5('0x3a')](_0x45dff1);};}exports[_0x2cd5('0x3b')]=function(_0x1522e3,_0x29f136){var _0x250e56={},_0xe51e73={'count':0x0,'rows':[]};var _0x21f398=_(db['User'][_0x2cd5('0x3c')])['map'](function(_0x66f604){return{'name':_0x66f604[_0x2cd5('0x3d')],'type':_0x66f604[_0x2cd5('0x3e')][_0x2cd5('0x3f')]};})[_0x2cd5('0x31')](function(_0x35aded){return!_['includes']([_0x2cd5('0x40'),_0x2cd5('0x41')],_0x35aded[_0x2cd5('0x39')]);})['value']();_0x250e56=qs[_0x2cd5('0x42')](_0x21f398,_0x1522e3);var _0x88109d={'where':_0x250e56[_0x2cd5('0x43')]};return db['User']['count'](_0x88109d)['then'](function(_0xfa9d97){_0xe51e73[_0x2cd5('0x44')]=_0xfa9d97;if(_0x1522e3['query'][_0x2cd5('0x45')]){_0x250e56[_0x2cd5('0x46')]=[{'all':!![]}];}if(_0x1522e3[_0x2cd5('0x47')][_0x2cd5('0x48')]===_0x2cd5('0x49')){_0x250e56['include']=[{'model':db[_0x2cd5('0x4a')],'as':_0x2cd5('0x48')}];}if(!_['includes'](_0x250e56[_0x2cd5('0x4b')],'id')){_0x250e56[_0x2cd5('0x4b')][_0x2cd5('0x4c')]('id');}return db[_0x2cd5('0x4d')][_0x2cd5('0x4e')](_0x250e56);})[_0x2cd5('0x15')](function(_0x2d43cc){_0xe51e73[_0x2cd5('0x4f')]=_0x2d43cc;if(_0x1522e3['query'][_0x2cd5('0x50')]===_0x2cd5('0x49')){var _0x18dbf5=[];for(var _0x4f73a6=0x0;_0x4f73a6<_0xe51e73[_0x2cd5('0x4f')][_0x2cd5('0x51')];_0x4f73a6++){_0x18dbf5[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x52'),_0xe51e73['rows'][_0x4f73a6][_0x2cd5('0x53')]));_0x18dbf5[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x54'),_0xe51e73[_0x2cd5('0x4f')][_0x4f73a6][_0x2cd5('0x53')]));_0x18dbf5[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x55'),_0xe51e73[_0x2cd5('0x4f')][_0x4f73a6][_0x2cd5('0x53')]));_0x18dbf5[_0x2cd5('0x4c')](get_open_tabs('mail',_0xe51e73[_0x2cd5('0x4f')][_0x4f73a6][_0x2cd5('0x53')]));_0x18dbf5['push'](get_open_tabs('openchannel',_0xe51e73[_0x2cd5('0x4f')][_0x4f73a6]['dataValues']));_0x18dbf5['push'](get_open_tabs('whatsapp',_0xe51e73[_0x2cd5('0x4f')][_0x4f73a6][_0x2cd5('0x53')]));}return Promise[_0x2cd5('0x56')](_0x18dbf5)[_0x2cd5('0x15')](function(){return _0xe51e73;});}else{return _0xe51e73;}})[_0x2cd5('0x15')](respondWithFilteredResult(_0x29f136,_0x250e56))[_0x2cd5('0x1f')](handleError(_0x29f136,null));};exports['show']=function(_0x420c66,_0x2b48bb){var _0x4e1cec={'raw':![],'where':{'id':_0x420c66[_0x2cd5('0x57')]['id']}},_0x70ca9a={};_0x70ca9a[_0x2cd5('0x58')]=_[_0x2cd5('0x59')](_[_0x2cd5('0x5a')](db['User'][_0x2cd5('0x3c')]),[_0x2cd5('0x40'),_0x2cd5('0x41')]);_0x70ca9a['query']=_[_0x2cd5('0x5a')](_0x420c66[_0x2cd5('0x47')]);_0x70ca9a[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x70ca9a[_0x2cd5('0x58')],_0x70ca9a[_0x2cd5('0x47')]);_0x4e1cec['attributes']=_[_0x2cd5('0x5c')](_0x70ca9a[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x420c66['query'][_0x2cd5('0x5d')]));_0x4e1cec['attributes']=_0x4e1cec[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x4e1cec[_0x2cd5('0x4b')]:_0x70ca9a[_0x2cd5('0x58')];if(_0x420c66[_0x2cd5('0x47')][_0x2cd5('0x45')]){_0x4e1cec[_0x2cd5('0x46')]=[{'all':!![]}];}if(_0x420c66[_0x2cd5('0x47')][_0x2cd5('0x48')]==='true'){_0x4e1cec[_0x2cd5('0x46')]=[{'model':db[_0x2cd5('0x4a')],'as':_0x2cd5('0x48')}];}_0x4e1cec=_[_0x2cd5('0x5e')]({},_0x4e1cec,_0x420c66[_0x2cd5('0x5f')]);if(!_[_0x2cd5('0x34')](_0x4e1cec[_0x2cd5('0x4b')],'id')){_0x4e1cec[_0x2cd5('0x4b')][_0x2cd5('0x4c')]('id');}return db['User'][_0x2cd5('0x60')](_0x4e1cec)[_0x2cd5('0x15')](handleEntityNotFound(_0x2b48bb,null))[_0x2cd5('0x15')](function(_0x45c7e0){var _0x309024=[];values=_0x45c7e0;if(_0x420c66[_0x2cd5('0x47')][_0x2cd5('0x50')]===_0x2cd5('0x49')){_0x309024[_0x2cd5('0x4c')](get_open_tabs('chat',_0x45c7e0[_0x2cd5('0x53')]));_0x309024[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x54'),_0x45c7e0['dataValues']));_0x309024[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x61'),_0x45c7e0[_0x2cd5('0x53')]));_0x309024[_0x2cd5('0x4c')](get_open_tabs('whatsapp',_0x45c7e0[_0x2cd5('0x53')]));_0x309024[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x55'),_0x45c7e0[_0x2cd5('0x53')]));_0x309024[_0x2cd5('0x4c')](get_open_tabs('mail',_0x45c7e0[_0x2cd5('0x53')]));return Promise[_0x2cd5('0x56')](_0x309024);}else{return values;}})[_0x2cd5('0x15')](function(){return values;})[_0x2cd5('0x15')](respondWithResult(_0x2b48bb,null))[_0x2cd5('0x1f')](handleError(_0x2b48bb,null));};exports['update']=function(_0x15d973,_0x3cb960){if(_0x15d973[_0x2cd5('0x62')]['id']){delete _0x15d973[_0x2cd5('0x62')]['id'];}delete _0x15d973[_0x2cd5('0x62')][_0x2cd5('0x35')];return db[_0x2cd5('0x4d')]['find']({'where':{'id':_0x15d973[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x3cb960,null))[_0x2cd5('0x15')](saveUpdates(_0x15d973[_0x2cd5('0x62')],null))[_0x2cd5('0x15')](respondWithResult(_0x3cb960,null))['catch'](handleError(_0x3cb960,null));};exports['describe']=function(_0x54b53b,_0xdabf8f){return db[_0x2cd5('0x4d')][_0x2cd5('0x63')]()['then'](respondWithResult(_0xdabf8f,null))['catch'](handleError(_0xdabf8f,null));};exports[_0x2cd5('0x64')]=function(_0x3f0d01,_0xbc0b76){return db['User'][_0x2cd5('0x60')]({'where':{'id':_0x3f0d01[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0xbc0b76,null))[_0x2cd5('0x15')](function(_0x363786){if(_0x363786){return _0x363786[_0x2cd5('0x64')](_0x3f0d01[_0x2cd5('0x62')][_0x2cd5('0x65')],_['omit'](_0x3f0d01[_0x2cd5('0x62')],[_0x2cd5('0x65'),'id'])||{});}})['then'](respondWithResult(_0xbc0b76,null))[_0x2cd5('0x1f')](handleError(_0xbc0b76,null));};function validateUser(_0x6843d3){return new Promise(function(_0x4f6389,_0x3ca0ef){if(_0x6843d3[_0x2cd5('0x66')])return _0x4f6389(_0x6843d3);return db[_0x2cd5('0x67')][_0x2cd5('0x68')](0x1)[_0x2cd5('0x15')](function(_0x10f17f){if(_0x10f17f[_0x2cd5('0x69')])authService[_0x2cd5('0x6a')](_0x6843d3['password']);db[_0x2cd5('0x4d')][_0x2cd5('0x6b')](_0x2cd5('0x66'))[_0x2cd5('0x15')](function(_0x59428f){if(_['isNil'](_0x59428f)){_0x6843d3[_0x2cd5('0x66')]=_0x10f17f['min_internal']||0x1;return;}if(_[_0x2cd5('0x6c')](_0x10f17f['min_internal'])||_0x10f17f['min_internal']===_0x59428f){_0x6843d3[_0x2cd5('0x66')]=_0x59428f+0x1;return;}if(_0x10f17f[_0x2cd5('0x6d')]>_0x59428f){_0x6843d3[_0x2cd5('0x66')]=_0x10f17f[_0x2cd5('0x6d')];return;}return db['sequelize'][_0x2cd5('0x47')](_0x2cd5('0x6e'),{'type':db[_0x2cd5('0x6f')]['QueryTypes'][_0x2cd5('0x70')]})[_0x2cd5('0x15')](function(_0x5c3950){if(_0x5c3950&&_0x5c3950[_0x2cd5('0x51')]){for(var _0x4e01b1=0x0,_0x2c06a0=_0x5c3950[_0x2cd5('0x51')];_0x4e01b1<_0x2c06a0&&_[_0x2cd5('0x6c')](_0x6843d3['internal']);_0x4e01b1++){if(_0x10f17f['min_internal']<=_0x5c3950[_0x4e01b1]['from']){_0x6843d3[_0x2cd5('0x66')]=_0x5c3950[_0x4e01b1][_0x2cd5('0x71')];}else if(_0x10f17f[_0x2cd5('0x6d')]>_0x5c3950[_0x4e01b1][_0x2cd5('0x71')]&&_0x10f17f['min_internal']<=_0x5c3950[_0x4e01b1]['to']){_0x6843d3[_0x2cd5('0x66')]=_0x10f17f[_0x2cd5('0x6d')];}}}if(_[_0x2cd5('0x6c')](_0x6843d3[_0x2cd5('0x66')])){_0x6843d3[_0x2cd5('0x66')]=_0x59428f+0x1;}return _0x4f6389(_0x6843d3);});});})[_0x2cd5('0x1f')](function(_0x398605){_0x3ca0ef(_0x398605);});});}function updateUser(_0x4ffccb){return new Promise(function(_0x23e4c4,_0x157861){try{if(_0x4ffccb[_0x2cd5('0x72')]){_0x4ffccb[_0x2cd5('0x73')]=_0x4ffccb[_0x2cd5('0x66')];_0x4ffccb[_0x2cd5('0x74')]={'mailbox':_0x4ffccb[_0x2cd5('0x66')],'password':_0x4ffccb[_0x2cd5('0x40')],'fullname':_0x4ffccb[_0x2cd5('0x75')],'email':_0x4ffccb[_0x2cd5('0x76')]};}if(_0x4ffccb[_0x2cd5('0x35')]==='agent'){if(!_0x4ffccb[_0x2cd5('0x77')])_0x4ffccb[_0x2cd5('0x77')]=[_0x2cd5('0x78'),'102','103','113','110','104',_0x2cd5('0x79'),_0x2cd5('0x7a'),_0x2cd5('0x7b'),_0x2cd5('0x7c'),_0x2cd5('0x7d'),'100',_0x2cd5('0x7e'),_0x2cd5('0x7f'),_0x2cd5('0x80')];}_0x23e4c4(_0x4ffccb);}catch(_0x343dfe){_0x157861(_0x343dfe);}});}exports[_0x2cd5('0x81')]=function(_0x97ae7f,_0x11eec7){if(_0x97ae7f[_0x2cd5('0x2d')]['role']===_0x2cd5('0x2f'))throw new Error(_0x2cd5('0x82'));if(_0x97ae7f[_0x2cd5('0x62')][_0x2cd5('0x35')]==='user'&&_0x97ae7f[_0x2cd5('0x2d')][_0x2cd5('0x35')]!==_0x2cd5('0x2b')){throw new Error(_0x2cd5('0x83'));}if(_0x97ae7f[_0x2cd5('0x62')]['role']===_0x2cd5('0x2b')&&_0x97ae7f[_0x2cd5('0x2d')][_0x2cd5('0x35')]!==_0x2cd5('0x2b')){throw new Error(_0x2cd5('0x84'));}return licenseUtil[_0x2cd5('0x85')]([_0x97ae7f[_0x2cd5('0x62')]])[_0x2cd5('0x15')](function(){return validateUser(_0x97ae7f[_0x2cd5('0x62')]);})[_0x2cd5('0x15')](function(_0x88aee6){return updateUser(_0x88aee6)[_0x2cd5('0x15')](function(_0x2da3a3){if(_0x2da3a3['role']==='admin'){_0x2da3a3[_0x2cd5('0x86')]=_0x97ae7f[_0x2cd5('0x2d')][_0x2cd5('0x86')];delete _0x2da3a3[_0x2cd5('0x87')];}return _0x2da3a3;});})['then'](function(_0x601c16){return db[_0x2cd5('0x4d')][_0x2cd5('0x81')](_0x601c16,{'include':[{'model':db[_0x2cd5('0x74')],'as':'VoiceMail'}]});})[_0x2cd5('0x15')](function(_0x32699c){if(_0x97ae7f[_0x2cd5('0x62')][_0x2cd5('0x35')]==='user')return _0x32699c;if(_0x97ae7f[_0x2cd5('0x2d')][_0x2cd5('0x35')]!==_0x2cd5('0x2d'))return _0x32699c;return db[_0x2cd5('0x88')][_0x2cd5('0x60')]({'where':{'name':_0x32699c[_0x2cd5('0x35')]===_0x2cd5('0x2f')?_0x2cd5('0x2e'):_0x2cd5('0x30'),'userProfileId':_0x97ae7f['user'][_0x2cd5('0x87')]},'raw':!![]})[_0x2cd5('0x15')](function(_0x6f2e25){if(!_0x6f2e25||_0x6f2e25[_0x2cd5('0x89')]!=0x0)return _0x32699c;return db['UserProfileResource'][_0x2cd5('0x81')]({'name':_0x32699c[_0x2cd5('0x39')],'resourceId':_0x32699c['id'],'type':_0x6f2e25[_0x2cd5('0x39')],'sectionId':_0x6f2e25['id']},{})['then'](function(){return _0x32699c;});})['catch'](function(_0x1029ef){logger[_0x2cd5('0x1b')](_0x2cd5('0x8a'),_0x1029ef);throw _0x1029ef;});})['then'](respondWithResult(_0x11eec7,0xc9))[_0x2cd5('0x1f')](handleError(_0x11eec7,null));};exports['bulkCreate']=function(_0x368bce,_0xec49ab){var _0x5b92ee=_0x368bce['body'];var _0x554b7b=[];if(_0x368bce['user'][_0x2cd5('0x35')]==='agent')throw new Error(_0x2cd5('0x82'));if(_[_0x2cd5('0x8b')](_0x5b92ee,[_0x2cd5('0x35'),_0x2cd5('0x2d')])&&_0x368bce[_0x2cd5('0x2d')][_0x2cd5('0x35')]!==_0x2cd5('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x2cd5('0x8b')](_0x5b92ee,[_0x2cd5('0x35'),_0x2cd5('0x2b')])&&_0x368bce[_0x2cd5('0x2d')][_0x2cd5('0x35')]!==_0x2cd5('0x2b')){throw new Error(_0x2cd5('0x8c'));}return licenseUtil[_0x2cd5('0x85')](_0x5b92ee)[_0x2cd5('0x15')](function(){return validateUser(_0x5b92ee[0x0]);})[_0x2cd5('0x15')](function(){for(var _0x39c4f7=0x1;_0x39c4f7<_0x5b92ee[_0x2cd5('0x51')];_0x39c4f7++){var _0x1451de=_0x5b92ee[_0x39c4f7-0x1]['internal'];if(!_0x5b92ee[_0x39c4f7][_0x2cd5('0x66')])_0x5b92ee[_0x39c4f7][_0x2cd5('0x66')]=_0x1451de+0x1;_0x554b7b[_0x2cd5('0x4c')](validateUser(_0x5b92ee[_0x39c4f7]));}return Promise[_0x2cd5('0x56')](_0x554b7b);})['then'](function(){_0x554b7b=[];for(var _0x33bef8=0x0;_0x33bef8<_0x5b92ee['length'];_0x33bef8++){_0x554b7b[_0x2cd5('0x4c')](updateUser(_0x5b92ee[_0x33bef8]));}return Promise[_0x2cd5('0x56')](_0x554b7b);})['then'](function(){_0x554b7b=_0x5b92ee[_0x2cd5('0x33')](function(_0x41f899){return db['User'][_0x2cd5('0x81')](_0x41f899,{'include':[{'model':db[_0x2cd5('0x74')],'as':_0x2cd5('0x74')}]})[_0x2cd5('0x15')](function(_0x31af07){_0x41f899['id']=_0x31af07['id'];return _0x41f899;});});return Promise[_0x2cd5('0x56')](_0x554b7b);})['then'](function(_0x155aa1){if(_0x368bce[_0x2cd5('0x62')]['role']===_0x2cd5('0x2d'))return _0x155aa1;if(_0x368bce['user']['role']!==_0x2cd5('0x2d'))return _0x155aa1;var _0x571de3=_['some'](_0x155aa1,function(_0x492c2a){return _0x492c2a['role']===_0x2cd5('0x2f')||_0x492c2a[_0x2cd5('0x35')]===_0x2cd5('0x8d');});if(!_0x571de3)return _0x155aa1;return db[_0x2cd5('0x88')][_0x2cd5('0x4e')]({'where':{'name':{'$or':[_0x2cd5('0x2e'),_0x2cd5('0x30')]},'userProfileId':_0x368bce[_0x2cd5('0x2d')][_0x2cd5('0x87')]},'raw':!![]})['then'](function(_0x5cf0ae){if(_[_0x2cd5('0x8e')](_0x5cf0ae)||!_[_0x2cd5('0x8b')](_0x5cf0ae,[_0x2cd5('0x89'),0x0]))return _0x155aa1;_0x554b7b=[];var _0x4282de=_(_0x5cf0ae)[_0x2cd5('0x33')](function(_0x17dd0c){if(_0x17dd0c[_0x2cd5('0x89')]===0x1)return;return _0x17dd0c[_0x2cd5('0x39')]===_0x2cd5('0x2e')?_0x2cd5('0x2f'):_0x2cd5('0x8d');})[_0x2cd5('0x8f')]()[_0x2cd5('0x36')]();for(var _0x1e4bc3=0x0;_0x1e4bc3<_0x155aa1[_0x2cd5('0x51')];_0x1e4bc3++){if(!_[_0x2cd5('0x34')](_0x4282de,_0x155aa1[_0x1e4bc3][_0x2cd5('0x35')]))return;var _0xea0bfd=_0x155aa1[_0x1e4bc3][_0x2cd5('0x35')]===_0x2cd5('0x2f')?_0x2cd5('0x2e'):_0x2cd5('0x30');_0x554b7b[_0x2cd5('0x4c')](db[_0x2cd5('0x90')][_0x2cd5('0x81')]({'name':_0x155aa1[_0x1e4bc3][_0x2cd5('0x39')],'resourceId':_0x155aa1[_0x1e4bc3]['id'],'type':_0xea0bfd,'sectionId':_[_0x2cd5('0x60')](_0x5cf0ae,['name',_0xea0bfd])['id']},{}));}return Promise[_0x2cd5('0x56')](_0x554b7b);});})[_0x2cd5('0x15')](respondWithResult(_0xec49ab,0xc9))['catch'](handleError(_0xec49ab,null));};exports[_0x2cd5('0x91')]=function(_0x5f4345,_0x3ea667){if(_0x5f4345[_0x2cd5('0x62')]['id']){delete _0x5f4345[_0x2cd5('0x62')]['id'];}return db[_0x2cd5('0x4d')][_0x2cd5('0x60')]({'where':{'id':_0x5f4345[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](function(_0x2e92c6){if(!_0x2e92c6)return null;if(_0x2e92c6['id']===_0x5f4345[_0x2cd5('0x2d')]['id']){if(!_0x5f4345[_0x2cd5('0x62')][_0x2cd5('0x92')]||!_0x5f4345[_0x2cd5('0x62')]['newPassword']){throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x2e92c6['authenticate'](_0x5f4345['body']['oldPassword'])){throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))](_0x2cd5('0x95'));}if(_0x5f4345[_0x2cd5('0x62')]['oldPassword']===_0x5f4345[_0x2cd5('0x62')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0x2cd5('0x96'));}}else if(_0x5f4345[_0x2cd5('0x2d')]['role']===_0x2cd5('0x2b')){if(!_0x5f4345['body'][_0x2cd5('0x97')]){throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))](_0x2cd5('0x98'));}}else if(_0x5f4345[_0x2cd5('0x2d')][_0x2cd5('0x35')]===_0x2cd5('0x2d')){if(!_0x5f4345[_0x2cd5('0x62')][_0x2cd5('0x97')]){throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x2e92c6[_0x2cd5('0x35')]!==_0x2cd5('0x2f')){throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))](_0x2cd5('0x82'));}}else{throw new db['Sequelize'][(_0x2cd5('0x94'))](_0x2cd5('0x82'));}return _0x2e92c6;})[_0x2cd5('0x15')](handleEntityNotFound(_0x3ea667,null))['then'](function(_0xb797bc){return db[_0x2cd5('0x67')]['findOne']({'attributes':['id','securePassword',_0x2cd5('0x99'),_0x2cd5('0x9a')]})['then'](function(_0x5b4e33){if(_0x5b4e33[_0x2cd5('0x69')])authService[_0x2cd5('0x6a')](_0x5f4345[_0x2cd5('0x62')]['newPassword']);if(!_0x5b4e33[_0x2cd5('0x99')]||!_0xb797bc['previousPasswords'])return _0xb797bc;authService[_0x2cd5('0x9b')](_0x5f4345[_0x2cd5('0x62')][_0x2cd5('0x97')],_0xb797bc[_0x2cd5('0x9c')],_0x5b4e33[_0x2cd5('0x9a')]);return _0xb797bc;})[_0x2cd5('0x15')](saveUpdates({'password':_0x5f4345['body'][_0x2cd5('0x97')],'passwordResetAt':_0x5f4345['user']['id']==_0x5f4345['params']['id']?moment():null,'previousPasswords':authService[_0x2cd5('0x9d')](_0x5f4345['body'][_0x2cd5('0x97')],_0xb797bc[_0x2cd5('0x9c')])},null));})[_0x2cd5('0x15')](respondWithResult(_0x3ea667,null))[_0x2cd5('0x1f')](handleError(_0x3ea667,null));};exports[_0x2cd5('0x9e')]=function(_0x226e6e,_0x21d53f){var _0x3379ee=_0x226e6e[_0x2cd5('0x62')][_0x2cd5('0x9f')];return db[_0x2cd5('0x4d')]['find']({'where':{'id':_0x226e6e[_0x2cd5('0x57')]['id']},'attributes':['id',_0x2cd5('0x39'),'role',_0x2cd5('0xa0'),'loginInPause',_0x2cd5('0xa1'),_0x2cd5('0xa2')]})['then'](handleEntityNotFound(_0x21d53f,null))[_0x2cd5('0x15')](function(_0xbb17a){if(_0xbb17a){if(!utils[_0x2cd5('0xa3')](_0x3379ee)){throw new db['Sequelize'][(_0x2cd5('0x94'))](_0x2cd5('0xa4'));}return _0xbb17a[_0x2cd5('0xa5')+_[_0x2cd5('0xa6')](_0x3379ee[_0x2cd5('0xa7')]())+'Queues'](_0x226e6e[_0x2cd5('0x62')][_0x2cd5('0x65')],{'penalty':_0x226e6e[_0x2cd5('0x62')]['penalty']||0x0})['spread'](function(_0x521956){for(var _0x1618d3=0x0;_0x1618d3<_0x226e6e[_0x2cd5('0x62')][_0x2cd5('0x65')][_0x2cd5('0x51')];_0x1618d3+=0x1){var _0x45df98={'UserId':Number(_0x226e6e['params']['id'])};_0x45df98[_[_0x2cd5('0xa6')](_0x3379ee[_0x2cd5('0xa7')]())+_0x2cd5('0xa8')]=Number(_0x226e6e[_0x2cd5('0x62')][_0x2cd5('0x65')][_0x1618d3]);socket['emit'](_0x2cd5('0x2d')+_['capitalize'](_0x3379ee['toLowerCase']())+_0x2cd5('0xa9'),_0x45df98);}return _0x521956;})['then'](function(){if(_0x3379ee===_0x2cd5('0xaa')){return db[_0x2cd5('0xab')]['findAll']({'where':{'id':_0x226e6e[_0x2cd5('0x62')]['ids']||[]},'raw':!![],'attributes':['id',_0x2cd5('0x39')]});}})[_0x2cd5('0x15')](function(_0x4223e2){var _0x24460b=_0xbb17a['get']({'plain':!![]});var _0x147caf=[];if(_0x3379ee===_0x2cd5('0xaa')&&_0x24460b[_0x2cd5('0x35')]===_0x2cd5('0x2f')&&_0x24460b[_0x2cd5('0xa0')]){for(let _0x32c03c=0x0;_0x32c03c<_0x4223e2[_0x2cd5('0x51')];_0x32c03c+=0x1){_0x147caf[_0x2cd5('0x4c')]({'membername':_0x24460b[_0x2cd5('0x39')],'UserId':_0x24460b['id'],'queue_name':_0x4223e2[_0x32c03c][_0x2cd5('0x39')],'VoiceQueueId':_0x4223e2[_0x32c03c]['id'],'interface':_[_0x2cd5('0x6c')](_0x24460b[_0x2cd5('0xa2')])?util['format'](_0x2cd5('0xac'),_0x24460b[_0x2cd5('0x39')]):_0x24460b[_0x2cd5('0xa2')],'paused':_0x24460b['voicePause']||![],'penalty':_0x226e6e[_0x2cd5('0x62')][_0x2cd5('0xad')]||0x0});}return Promise['all'](_0x147caf['map'](function(_0x5a3fa3){return db[_0x2cd5('0xae')][_0x2cd5('0xaf')](_0x5a3fa3);}));}return _0xbb17a;});}})[_0x2cd5('0x15')](respondWithStatusCode(_0x21d53f,null))[_0x2cd5('0x1f')](handleError(_0x21d53f,null));};exports[_0x2cd5('0xb0')]=function(_0x4e5fc9,_0xb01feb){var _0x355b7f,_0x495898;return db[_0x2cd5('0x4d')]['find']({'where':{'id':_0x4e5fc9[_0x2cd5('0x57')]['id']},'attributes':['id',_0x2cd5('0x39'),_0x2cd5('0x35')]})['then'](handleEntityNotFound(_0xb01feb,null))[_0x2cd5('0x15')](function(_0x288224){if(_0x288224){_0x355b7f=_0x288224;if(!_0x4e5fc9[_0x2cd5('0x47')]['channel']||!utils[_0x2cd5('0xa3')](_0x4e5fc9['query']['channel'])){throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))](_0x2cd5('0xa4'));}return _0x288224[_0x2cd5('0xb1')+_[_0x2cd5('0xa6')](_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x9f')][_0x2cd5('0xa7')]())+_0x2cd5('0xb2')](_0x4e5fc9[_0x2cd5('0x47')]['ids']);}})[_0x2cd5('0x15')](function(_0x229d31){if(_[_0x2cd5('0xb3')](_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x65')])){for(var _0x191ad3=0x0;_0x191ad3<_0x4e5fc9['query'][_0x2cd5('0x65')][_0x2cd5('0x51')];_0x191ad3+=0x1){_0x495898={'UserId':Number(_0x4e5fc9[_0x2cd5('0x57')]['id'])};_0x495898[_['capitalize'](_0x4e5fc9[_0x2cd5('0x47')]['channel']['toLowerCase']())+_0x2cd5('0xa8')]=Number(_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x65')][_0x191ad3]);socket[_0x2cd5('0xb4')](_0x2cd5('0x2d')+_[_0x2cd5('0xa6')](_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x9f')][_0x2cd5('0xa7')]())+'Queue:remove',_0x495898);}}else{_0x495898={'UserId':Number(_0x4e5fc9[_0x2cd5('0x57')]['id'])};_0x495898[_[_0x2cd5('0xa6')](_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x9f')][_0x2cd5('0xa7')]())+_0x2cd5('0xa8')]=Number(_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x65')]);socket[_0x2cd5('0xb4')](_0x2cd5('0x2d')+_[_0x2cd5('0xa6')](_0x4e5fc9['query'][_0x2cd5('0x9f')][_0x2cd5('0xa7')]())+'Queue:remove',_0x495898);}return _0x229d31;})['then'](function(){if(_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x9f')]==='voice'){return db['UserVoiceQueueRt'][_0x2cd5('0x29')]({'where':{'UserId':_0x4e5fc9[_0x2cd5('0x57')]['id'],'VoiceQueueId':_0x4e5fc9[_0x2cd5('0x47')][_0x2cd5('0x65')]},'individualHooks':!![]})[_0x2cd5('0x15')](function(){return _0x355b7f;});}return _0x355b7f;})['then'](respondWithStatusCode(_0xb01feb,null))['catch'](handleError(_0xb01feb,null));};exports[_0x2cd5('0xb5')]=function(_0x5c7b59,_0xbdc907){_0x5c7b59[_0x2cd5('0x62')][_0x2cd5('0xb6')]=_0x5c7b59[_0x2cd5('0xb7')][_0x2cd5('0xb8')];return db[_0x2cd5('0x4d')]['find']({'where':{'id':_0x5c7b59['params']['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0xbdc907,null))[_0x2cd5('0x15')](saveUpdates(_0x5c7b59[_0x2cd5('0x62')],null))[_0x2cd5('0x15')](respondWithResult(_0xbdc907,null))['catch'](handleError(_0xbdc907,null));};exports['getAvatar']=function(_0x21379c,_0x5cbd80){var _0xac1441=path[_0x2cd5('0xb9')](config['root'],_0x2cd5('0xba'));return db[_0x2cd5('0x4d')]['find']({'where':{'id':_0x21379c[_0x2cd5('0x57')]['id']},'attributes':['id',_0x2cd5('0xb6')],'raw':!![]})[_0x2cd5('0x15')](handleEntityNotFound(_0x5cbd80,null))[_0x2cd5('0x15')](function(_0x562498){if(_0x562498){if(_['isNil'](_0x562498['userpic'])){return _0x5cbd80['download'](_0xac1441);}else{if(!fs[_0x2cd5('0xbb')](path[_0x2cd5('0xb9')](config['root'],'server/files/images/',_0x562498[_0x2cd5('0xb6')]))){return _0x5cbd80[_0x2cd5('0xbc')](_0xac1441);}return _0x5cbd80[_0x2cd5('0xbc')](path[_0x2cd5('0xb9')](config[_0x2cd5('0xbd')],_0x2cd5('0xbe'),_0x562498['userpic']));}}})[_0x2cd5('0x1f')](handleError(_0x5cbd80,null));};exports['getOpenTabs']=function(_0x30c4d8,_0x4037ed){return db[_0x2cd5('0x4d')]['find']({'where':{'id':_0x30c4d8[_0x2cd5('0x57')]['id']},'attributes':['id']})[_0x2cd5('0x15')](handleEntityNotFound(_0x4037ed,null))[_0x2cd5('0x15')](function(_0x2dc8b3){var _0x5d48d0=[];values=_0x2dc8b3[_0x2cd5('0x53')];_0x5d48d0[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x52'),_0x2dc8b3[_0x2cd5('0x53')]));_0x5d48d0[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x54'),_0x2dc8b3['dataValues']));_0x5d48d0[_0x2cd5('0x4c')](get_open_tabs(_0x2cd5('0x61'),_0x2dc8b3[_0x2cd5('0x53')]));_0x5d48d0['push'](get_open_tabs('whatsapp',_0x2dc8b3[_0x2cd5('0x53')]));_0x5d48d0['push'](get_open_tabs('fax',_0x2dc8b3[_0x2cd5('0x53')]));_0x5d48d0['push'](get_open_tabs(_0x2cd5('0xbf'),_0x2dc8b3[_0x2cd5('0x53')]));return Promise[_0x2cd5('0x56')](_0x5d48d0);})[_0x2cd5('0x15')](function(_0x5d66c6){if(_0x5d66c6){var _0x8c7435=_['map'](values['ChatOpenTabs'],function(_0x569c6b){return{'channel':'CHAT','id':_0x569c6b['id'],'createdAt':_0x569c6b[_0x2cd5('0xc0')]};});var _0x11522c=_[_0x2cd5('0x33')](values[_0x2cd5('0xc1')],function(_0x5f0e4b){return{'channel':_0x2cd5('0xc2'),'id':_0x5f0e4b['id'],'createdAt':_0x5f0e4b[_0x2cd5('0xc0')]};});var _0xe2c00d=_['map'](values[_0x2cd5('0xc3')],function(_0x20874b){return{'channel':_0x2cd5('0xc4'),'id':_0x20874b['id'],'createdAt':_0x20874b['createdAt']};});var _0x416562=_[_0x2cd5('0x33')](values[_0x2cd5('0xc5')],function(_0x2c8b10){return{'channel':_0x2cd5('0xc6'),'id':_0x2c8b10['id'],'createdAt':_0x2c8b10[_0x2cd5('0xc0')]};});var _0x5fbe51=_[_0x2cd5('0x33')](values['SmsOpenTabs'],function(_0x4c418a){return{'channel':_0x2cd5('0xc7'),'id':_0x4c418a['id'],'createdAt':_0x4c418a[_0x2cd5('0xc0')]};});var _0x4f2104=_[_0x2cd5('0x33')](values[_0x2cd5('0xc8')],function(_0x429c2a){return{'channel':'WHATSAPP','id':_0x429c2a['id'],'createdAt':_0x429c2a['createdAt']};});var _0x54e5e7=_['concat'](_0x8c7435,_0x11522c,_0xe2c00d,_0x416562,_0x5fbe51,_0x4f2104);var _0x32aaee={'count':_0x54e5e7[_0x2cd5('0x51')],'rows':_0x54e5e7};return _0x32aaee;}else return null;})[_0x2cd5('0x15')](respondWithResult(_0x4037ed,null))['catch'](handleError(_0x4037ed,null));};exports[_0x2cd5('0xc9')]=function(_0x341b89,_0x1c6c76){var _0x2b3c17={};var _0x3acd5d={};var _0x4b5d1a;var _0x16398d;return db['User']['findOne']({'where':{'id':_0x341b89['params']['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x1c6c76,null))[_0x2cd5('0x15')](function(_0x3b9b31){if(_0x3b9b31){_0x4b5d1a=_0x3b9b31;_0x3acd5d[_0x2cd5('0x58')]=_['keys'](db['CmContact'][_0x2cd5('0x3c')]);_0x3acd5d[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x341b89[_0x2cd5('0x47')]);_0x3acd5d['filters']=_[_0x2cd5('0x5c')](_0x3acd5d[_0x2cd5('0x58')],_0x3acd5d[_0x2cd5('0x47')]);_0x2b3c17[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x3acd5d[_0x2cd5('0x58')],qs['fields'](_0x341b89[_0x2cd5('0x47')][_0x2cd5('0x5d')]));_0x2b3c17[_0x2cd5('0x4b')]=_0x2b3c17['attributes']['length']?_0x2b3c17[_0x2cd5('0x4b')]:_0x3acd5d[_0x2cd5('0x58')];_0x2b3c17[_0x2cd5('0xca')]=qs[_0x2cd5('0xcb')](_0x341b89[_0x2cd5('0x47')][_0x2cd5('0xcb')]);_0x2b3c17['where']=qs['filters'](_['pick'](_0x341b89[_0x2cd5('0x47')],_0x3acd5d['filters']));if(_0x341b89['query'][_0x2cd5('0x31')]){_0x2b3c17[_0x2cd5('0x43')]=_['merge'](_0x2b3c17[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x2b3c17['attributes'],function(_0x2d008c){var _0x5301f6={};_0x5301f6[_0x2d008c]={'$like':'%'+_0x341b89['query'][_0x2cd5('0x31')]+'%'};return _0x5301f6;})});}_0x2b3c17=_[_0x2cd5('0x5e')]({},_0x2b3c17,_0x341b89[_0x2cd5('0x5f')]);return _0x4b5d1a['getContacts'](_0x2b3c17);}})[_0x2cd5('0x15')](function(_0x4ae640){if(_0x4ae640){_0x16398d=_0x4ae640[_0x2cd5('0x51')];if(_0x341b89[_0x2cd5('0x47')][_0x2cd5('0xcc')](_0x2cd5('0x45'))){_0x2b3c17[_0x2cd5('0x46')]=[{'model':db[_0x2cd5('0xcd')],'as':_0x2cd5('0xce'),'required':![]},{'model':db[_0x2cd5('0xcf')],'as':_0x2cd5('0xd0'),'attributes':['id',_0x2cd5('0x39'),_0x2cd5('0xd1')],'where':_0x341b89[_0x2cd5('0x47')][_0x2cd5('0xd2')]?{'id':_0x341b89[_0x2cd5('0x47')][_0x2cd5('0xd2')]}:undefined,'required':_0x341b89['query'][_0x2cd5('0xd2')]?!![]:![]}];}if(!_0x341b89[_0x2cd5('0x47')][_0x2cd5('0xcc')]('nolimit')){_0x2b3c17[_0x2cd5('0x25')]=qs['limit'](_0x341b89[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x2b3c17[_0x2cd5('0x23')]=qs[_0x2cd5('0x23')](_0x341b89[_0x2cd5('0x47')][_0x2cd5('0x23')]);}return _0x4b5d1a[_0x2cd5('0xc9')](_0x2b3c17);}})[_0x2cd5('0x15')](function(_0x4c1a18){if(_0x4c1a18){return _0x4c1a18?{'count':_0x16398d,'rows':_0x4c1a18}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x1c6c76,null))[_0x2cd5('0x1f')](handleError(_0x1c6c76,null));};exports['getQueues']=function(_0x395931,_0x501488){var _0x14a427;var _0x19481d={};var _0x3e8dbd;return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0x395931[_0x2cd5('0x57')]['id']},'attributes':['id',_0x2cd5('0x39'),_0x2cd5('0x35')]})[_0x2cd5('0x15')](handleEntityNotFound(_0x501488,null))[_0x2cd5('0x15')](function(_0x43fd44){if(!utils[_0x2cd5('0xa3')](_0x395931[_0x2cd5('0x47')][_0x2cd5('0x9f')])){throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))](_0x2cd5('0xa4'));}_0x14a427=_0x43fd44;var _0xf7c9bf={};_0xf7c9bf[_0x2cd5('0x58')]=_['keys'](db[_[_0x2cd5('0xa6')](_0x395931['query'][_0x2cd5('0x9f')])+_0x2cd5('0xd4')][_0x2cd5('0x3c')]);_0xf7c9bf[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x395931[_0x2cd5('0x47')]);_0xf7c9bf[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0xf7c9bf[_0x2cd5('0x58')],_0xf7c9bf[_0x2cd5('0x47')]);_0x19481d['attributes']=_[_0x2cd5('0x5c')](_0xf7c9bf[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x395931['query'][_0x2cd5('0x5d')]));_0x19481d[_0x2cd5('0x4b')]=_0x19481d[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x19481d[_0x2cd5('0x4b')]:_0xf7c9bf['model'];_0x19481d[_0x2cd5('0xca')]=qs['sort'](_0x395931[_0x2cd5('0x47')]['sort']);_0x19481d['where']=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x395931[_0x2cd5('0x47')],_0xf7c9bf[_0x2cd5('0x5b')]));if(_0x395931[_0x2cd5('0x47')]['filter']){_0x19481d[_0x2cd5('0x43')]=_[_0x2cd5('0x5e')](_0x19481d[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x19481d[_0x2cd5('0x4b')],function(_0x2734fa){var _0x476e5f={};_0x476e5f[_0x2734fa]={'$like':'%'+_0x395931['query'][_0x2cd5('0x31')]+'%'};return _0x476e5f;})});}_0x19481d=_[_0x2cd5('0x5e')]({},_0x19481d,_0x395931[_0x2cd5('0x5f')]);switch(_0x14a427[_0x2cd5('0x35')]){case _0x2cd5('0x2b'):return db[_['capitalize'](_0x395931['query']['channel'])+'Queue'][_0x2cd5('0x4e')](_0x19481d);case _0x2cd5('0x2d'):case _0x2cd5('0x2f'):return _0x14a427['get'+_[_0x2cd5('0xa6')](_0x395931[_0x2cd5('0x47')][_0x2cd5('0x9f')])+'Queues'](_0x19481d);default:throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))]('Unknown\x20role');}})[_0x2cd5('0x15')](function(_0x416090){_0x3e8dbd=_0x416090[_0x2cd5('0x51')];if(!_0x395931[_0x2cd5('0x47')][_0x2cd5('0xcc')]('nolimit')){_0x19481d['limit']=qs[_0x2cd5('0x25')](_0x395931['query']['limit']);_0x19481d[_0x2cd5('0x23')]=qs[_0x2cd5('0x23')](_0x395931[_0x2cd5('0x47')][_0x2cd5('0x23')]);}switch(_0x14a427[_0x2cd5('0x35')]){case'admin':return db[_[_0x2cd5('0xa6')](_0x395931[_0x2cd5('0x47')][_0x2cd5('0x9f')])+'Queue']['findAll'](_0x19481d);case _0x2cd5('0x2d'):case _0x2cd5('0x2f'):return _0x14a427[_0x2cd5('0x2a')+_['capitalize'](_0x395931[_0x2cd5('0x47')][_0x2cd5('0x9f')])+_0x2cd5('0xb2')](_0x19481d);}})[_0x2cd5('0x15')](function(_0x2cac50){return{'count':_0x3e8dbd,'rows':_0x2cac50};})[_0x2cd5('0x15')](respondWithResult(_0x501488,null))[_0x2cd5('0x1f')](handleError(_0x501488,null));};exports[_0x2cd5('0xd6')]=function(_0x20b456,_0x3d43ed){var _0x51bb2f={};var _0x4a5d76={};var _0x12ba37;var _0x59c3fa;return db['User'][_0x2cd5('0xd3')]({'where':{'id':_0x20b456[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x3d43ed,null))[_0x2cd5('0x15')](function(_0x41c948){if(_0x41c948){_0x12ba37=_0x41c948;_0x4a5d76['model']=_[_0x2cd5('0x5a')](db[_0x2cd5('0xae')][_0x2cd5('0x3c')]);_0x4a5d76[_0x2cd5('0x47')]=_['keys'](_0x20b456['query']);_0x4a5d76[_0x2cd5('0x5b')]=_['intersection'](_0x4a5d76[_0x2cd5('0x58')],_0x4a5d76['query']);_0x51bb2f[_0x2cd5('0x4b')]=_['intersection'](_0x4a5d76[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x20b456[_0x2cd5('0x47')][_0x2cd5('0x5d')]));_0x51bb2f[_0x2cd5('0x4b')]=_0x51bb2f[_0x2cd5('0x4b')]['length']?_0x51bb2f[_0x2cd5('0x4b')]:_0x4a5d76[_0x2cd5('0x58')];_0x51bb2f[_0x2cd5('0xca')]=qs['sort'](_0x20b456[_0x2cd5('0x47')][_0x2cd5('0xcb')]);_0x51bb2f[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_['pick'](_0x20b456[_0x2cd5('0x47')],_0x4a5d76['filters']));if(_0x20b456[_0x2cd5('0x47')][_0x2cd5('0x31')]){_0x51bb2f['where']=_['merge'](_0x51bb2f['where'],{'$or':_[_0x2cd5('0x33')](_0x51bb2f[_0x2cd5('0x4b')],function(_0x2a4028){var _0x3f5613={};_0x3f5613[_0x2a4028]={'$like':'%'+_0x20b456['query'][_0x2cd5('0x31')]+'%'};return _0x3f5613;})});}_0x51bb2f=_[_0x2cd5('0x5e')]({},_0x51bb2f,_0x20b456[_0x2cd5('0x5f')]);return _0x12ba37[_0x2cd5('0xd6')](_0x51bb2f);}})[_0x2cd5('0x15')](function(_0x57b661){if(_0x57b661){_0x59c3fa=_0x57b661['length'];if(!_0x20b456[_0x2cd5('0x47')][_0x2cd5('0xcc')](_0x2cd5('0xd7'))){_0x51bb2f[_0x2cd5('0x25')]=qs[_0x2cd5('0x25')](_0x20b456[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x51bb2f['offset']=qs['offset'](_0x20b456[_0x2cd5('0x47')]['offset']);}return _0x12ba37[_0x2cd5('0xd6')](_0x51bb2f);}})['then'](function(_0x1013f0){if(_0x1013f0){return _0x1013f0?{'count':_0x59c3fa,'rows':_0x1013f0}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x3d43ed,null))[_0x2cd5('0x1f')](handleError(_0x3d43ed,null));};exports[_0x2cd5('0xd8')]=function(_0x14485f,_0x279b2d){var _0x1f1116={};var _0x32183d={};var _0x379302;var _0x20e3ae;return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0x14485f[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x279b2d,null))['then'](function(_0xa7cfa7){if(_0xa7cfa7){_0x379302=_0xa7cfa7;_0x32183d[_0x2cd5('0x58')]=_[_0x2cd5('0x5a')](db[_0x2cd5('0xd9')]['rawAttributes']);_0x32183d[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x14485f[_0x2cd5('0x47')]);_0x32183d[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x32183d[_0x2cd5('0x58')],_0x32183d[_0x2cd5('0x47')]);_0x1f1116[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x32183d[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x14485f[_0x2cd5('0x47')][_0x2cd5('0x5d')]));_0x1f1116['attributes']=_0x1f1116[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x1f1116[_0x2cd5('0x4b')]:_0x32183d[_0x2cd5('0x58')];_0x1f1116[_0x2cd5('0xca')]=qs[_0x2cd5('0xcb')](_0x14485f[_0x2cd5('0x47')]['sort']);_0x1f1116[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x14485f[_0x2cd5('0x47')],_0x32183d['filters']));if(_0x14485f[_0x2cd5('0x47')]['filter']){_0x1f1116[_0x2cd5('0x43')]=_['merge'](_0x1f1116[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x1f1116[_0x2cd5('0x4b')],function(_0x182849){var _0x585c24={};_0x585c24[_0x182849]={'$like':'%'+_0x14485f[_0x2cd5('0x47')][_0x2cd5('0x31')]+'%'};return _0x585c24;})});}_0x1f1116=_[_0x2cd5('0x5e')]({},_0x1f1116,_0x14485f[_0x2cd5('0x5f')]);return _0x379302[_0x2cd5('0xd8')](_0x1f1116);}})['then'](function(_0x2a8664){if(_0x2a8664){_0x20e3ae=_0x2a8664[_0x2cd5('0x51')];if(!_0x14485f[_0x2cd5('0x47')][_0x2cd5('0xcc')]('nolimit')){_0x1f1116['limit']=qs[_0x2cd5('0x25')](_0x14485f[_0x2cd5('0x47')]['limit']);_0x1f1116[_0x2cd5('0x23')]=qs[_0x2cd5('0x23')](_0x14485f['query'][_0x2cd5('0x23')]);}return _0x379302[_0x2cd5('0xd8')](_0x1f1116);}})[_0x2cd5('0x15')](function(_0x36e0ca){if(_0x36e0ca){return _0x36e0ca?{'count':_0x20e3ae,'rows':_0x36e0ca}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x279b2d,null))[_0x2cd5('0x1f')](handleError(_0x279b2d,null));};exports[_0x2cd5('0xda')]=function(_0x10bced,_0x1cf5d6){var _0x3c38ae={'raw':!![],'where':{}};var _0x34574e={};var _0x4ca597={'count':0x0,'rows':[]};return db[_0x2cd5('0x4d')]['findOne']({'where':{'id':_0x10bced['params']['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x1cf5d6,null))[_0x2cd5('0x15')](function(_0x42f8db){if(_0x42f8db){_0x34574e[_0x2cd5('0x58')]=_['keys'](db['VoiceRecording'][_0x2cd5('0x3c')]);_0x34574e[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x10bced[_0x2cd5('0x47')]);_0x34574e[_0x2cd5('0x5b')]=_['intersection'](_0x34574e[_0x2cd5('0x58')],_0x34574e[_0x2cd5('0x47')]);_0x3c38ae[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x34574e['model'],qs[_0x2cd5('0x5d')](_0x10bced[_0x2cd5('0x47')]['fields']));_0x3c38ae[_0x2cd5('0x4b')]=_0x3c38ae[_0x2cd5('0x4b')]['length']?_0x3c38ae['attributes']:_0x34574e[_0x2cd5('0x58')];if(!_0x10bced['query'][_0x2cd5('0xcc')](_0x2cd5('0xd7'))){_0x3c38ae[_0x2cd5('0x25')]=qs['limit'](_0x10bced[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x3c38ae[_0x2cd5('0x23')]=qs[_0x2cd5('0x23')](_0x10bced[_0x2cd5('0x47')]['offset']);}_0x3c38ae['order']=qs[_0x2cd5('0xcb')](_0x10bced[_0x2cd5('0x47')]['sort']);_0x3c38ae[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x10bced[_0x2cd5('0x47')],_0x34574e[_0x2cd5('0x5b')]));_0x3c38ae[_0x2cd5('0x43')][_0x2cd5('0xdb')]=_0x42f8db['id'];if(_0x10bced[_0x2cd5('0x47')]['filter']){_0x3c38ae[_0x2cd5('0x43')]=_['merge'](_0x3c38ae[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x3c38ae[_0x2cd5('0x4b')],function(_0x2b9a00){var _0xdba017={};_0xdba017[_0x2b9a00]={'$like':'%'+_0x10bced[_0x2cd5('0x47')]['filter']+'%'};return _0xdba017;})});}_0x3c38ae=_[_0x2cd5('0x5e')]({},_0x3c38ae,_0x10bced[_0x2cd5('0x5f')]);return db[_0x2cd5('0xdc')][_0x2cd5('0x44')]({'where':_0x3c38ae[_0x2cd5('0x43')]})['then'](function(_0x5a51a0){_0x4ca597[_0x2cd5('0x44')]=_0x5a51a0;if(_0x10bced[_0x2cd5('0x47')][_0x2cd5('0x45')]){_0x3c38ae[_0x2cd5('0x46')]=[{'all':!![]}];}return db[_0x2cd5('0xdc')][_0x2cd5('0x4e')](_0x3c38ae);})[_0x2cd5('0x15')](function(_0x14a71){_0x4ca597[_0x2cd5('0x4f')]=_0x14a71;return _0x4ca597;});}})[_0x2cd5('0x15')](respondWithFilteredResult(_0x1cf5d6,_0x3c38ae))[_0x2cd5('0x1f')](handleError(_0x1cf5d6,null));};exports[_0x2cd5('0xdd')]=function(_0x15184c,_0x2457bf){var _0x323425={'raw':!![],'where':{}};var _0x330411={};var _0x2a0d0d={'count':0x0,'rows':[]};return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0x15184c[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x2457bf,null))[_0x2cd5('0x15')](function(_0x1f93f2){if(_0x1f93f2){_0x330411['model']=_['keys'](db['ScreenRecording'][_0x2cd5('0x3c')]);_0x330411[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x15184c[_0x2cd5('0x47')]);_0x330411[_0x2cd5('0x5b')]=_['intersection'](_0x330411[_0x2cd5('0x58')],_0x330411['query']);_0x323425[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x330411[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x15184c[_0x2cd5('0x47')][_0x2cd5('0x5d')]));_0x323425[_0x2cd5('0x4b')]=_0x323425[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x323425[_0x2cd5('0x4b')]:_0x330411[_0x2cd5('0x58')];if(!_0x15184c[_0x2cd5('0x47')][_0x2cd5('0xcc')]('nolimit')){_0x323425[_0x2cd5('0x25')]=qs[_0x2cd5('0x25')](_0x15184c[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x323425['offset']=qs[_0x2cd5('0x23')](_0x15184c[_0x2cd5('0x47')]['offset']);}_0x323425[_0x2cd5('0xca')]=qs['sort'](_0x15184c[_0x2cd5('0x47')]['sort']);_0x323425[_0x2cd5('0x43')]=qs['filters'](_[_0x2cd5('0xd5')](_0x15184c[_0x2cd5('0x47')],_0x330411[_0x2cd5('0x5b')]));_0x323425[_0x2cd5('0x43')][_0x2cd5('0xdb')]=_0x1f93f2['id'];if(_0x15184c[_0x2cd5('0x47')]['filter']){_0x323425[_0x2cd5('0x43')]=_[_0x2cd5('0x5e')](_0x323425['where'],{'$or':_[_0x2cd5('0x33')](_0x323425[_0x2cd5('0x4b')],function(_0x53dd9b){var _0x4faf85={};_0x4faf85[_0x53dd9b]={'$like':'%'+_0x15184c[_0x2cd5('0x47')][_0x2cd5('0x31')]+'%'};return _0x4faf85;})});}_0x323425=_['merge']({},_0x323425,_0x15184c[_0x2cd5('0x5f')]);return db[_0x2cd5('0xde')][_0x2cd5('0x44')]({'where':_0x323425[_0x2cd5('0x43')]})[_0x2cd5('0x15')](function(_0x51f12d){_0x2a0d0d[_0x2cd5('0x44')]=_0x51f12d;if(_0x15184c[_0x2cd5('0x47')]['includeAll']){_0x323425[_0x2cd5('0x46')]=[{'all':!![]}];}return db[_0x2cd5('0xde')][_0x2cd5('0x4e')](_0x323425);})[_0x2cd5('0x15')](function(_0x3b7870){_0x2a0d0d[_0x2cd5('0x4f')]=_0x3b7870;return _0x2a0d0d;});}})[_0x2cd5('0x15')](respondWithFilteredResult(_0x2457bf,_0x323425))['catch'](handleError(_0x2457bf,null));};exports[_0x2cd5('0xdf')]=function(_0x4a6645,_0x5046c6){var _0x5133ec={};var _0x24afb5={};var _0x49d308;var _0x4ff609;return db['User']['findOne']({'where':{'id':_0x4a6645[_0x2cd5('0x57')]['id']}})['then'](handleEntityNotFound(_0x5046c6,null))['then'](function(_0x4ff3a0){if(_0x4ff3a0){_0x49d308=_0x4ff3a0;_0x24afb5[_0x2cd5('0x58')]=_[_0x2cd5('0x5a')](db['ChatInteraction'][_0x2cd5('0x3c')]);_0x24afb5[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x4a6645[_0x2cd5('0x47')]);_0x24afb5['filters']=_[_0x2cd5('0x5c')](_0x24afb5[_0x2cd5('0x58')],_0x24afb5[_0x2cd5('0x47')]);_0x5133ec[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x24afb5['model'],qs[_0x2cd5('0x5d')](_0x4a6645['query'][_0x2cd5('0x5d')]));_0x5133ec['attributes']=_0x5133ec[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x5133ec['attributes']:_0x24afb5[_0x2cd5('0x58')];_0x5133ec[_0x2cd5('0xca')]=qs[_0x2cd5('0xcb')](_0x4a6645['query'][_0x2cd5('0xcb')]);_0x5133ec[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x4a6645[_0x2cd5('0x47')],_0x24afb5[_0x2cd5('0x5b')]));if(_0x4a6645[_0x2cd5('0x47')][_0x2cd5('0x31')]){_0x5133ec[_0x2cd5('0x43')]=_[_0x2cd5('0x5e')](_0x5133ec['where'],{'$or':_['map'](_0x5133ec[_0x2cd5('0x4b')],function(_0x58bad8){var _0xf871ed={};_0xf871ed[_0x58bad8]={'$like':'%'+_0x4a6645[_0x2cd5('0x47')][_0x2cd5('0x31')]+'%'};return _0xf871ed;})});}_0x5133ec=_[_0x2cd5('0x5e')]({},_0x5133ec,_0x4a6645[_0x2cd5('0x5f')]);return _0x49d308['getChatInteractions'](_0x5133ec);}})[_0x2cd5('0x15')](function(_0x1adfbb){if(_0x1adfbb){_0x4ff609=_0x1adfbb[_0x2cd5('0x51')];if(!_0x4a6645[_0x2cd5('0x47')][_0x2cd5('0xcc')](_0x2cd5('0xd7'))){_0x5133ec[_0x2cd5('0x25')]=qs[_0x2cd5('0x25')](_0x4a6645['query'][_0x2cd5('0x25')]);_0x5133ec['offset']=qs[_0x2cd5('0x23')](_0x4a6645[_0x2cd5('0x47')][_0x2cd5('0x23')]);}return _0x49d308[_0x2cd5('0xdf')](_0x5133ec);}})[_0x2cd5('0x15')](function(_0x2497ad){if(_0x2497ad){return _0x2497ad?{'count':_0x4ff609,'rows':_0x2497ad}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x5046c6,null))[_0x2cd5('0x1f')](handleError(_0x5046c6,null));};exports['getOpenchannelInteractions']=function(_0x2c9053,_0x216d1c){var _0x330011={};var _0x95d17e={};var _0x1c432c;var _0x521962;return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0x2c9053['params']['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x216d1c,null))['then'](function(_0x31e307){if(_0x31e307){_0x1c432c=_0x31e307;_0x95d17e['model']=_[_0x2cd5('0x5a')](db['OpenchannelInteraction'][_0x2cd5('0x3c')]);_0x95d17e[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x2c9053[_0x2cd5('0x47')]);_0x95d17e[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x95d17e[_0x2cd5('0x58')],_0x95d17e[_0x2cd5('0x47')]);_0x330011[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x95d17e['model'],qs[_0x2cd5('0x5d')](_0x2c9053[_0x2cd5('0x47')]['fields']));_0x330011[_0x2cd5('0x4b')]=_0x330011[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x330011[_0x2cd5('0x4b')]:_0x95d17e[_0x2cd5('0x58')];_0x330011[_0x2cd5('0xca')]=qs[_0x2cd5('0xcb')](_0x2c9053[_0x2cd5('0x47')][_0x2cd5('0xcb')]);_0x330011[_0x2cd5('0x43')]=qs['filters'](_[_0x2cd5('0xd5')](_0x2c9053[_0x2cd5('0x47')],_0x95d17e[_0x2cd5('0x5b')]));if(_0x2c9053[_0x2cd5('0x47')][_0x2cd5('0x31')]){_0x330011['where']=_['merge'](_0x330011[_0x2cd5('0x43')],{'$or':_['map'](_0x330011[_0x2cd5('0x4b')],function(_0x12b1ba){var _0x1c90d5={};_0x1c90d5[_0x12b1ba]={'$like':'%'+_0x2c9053[_0x2cd5('0x47')]['filter']+'%'};return _0x1c90d5;})});}_0x330011=_[_0x2cd5('0x5e')]({},_0x330011,_0x2c9053[_0x2cd5('0x5f')]);return _0x1c432c['getOpenchannelInteractions'](_0x330011);}})[_0x2cd5('0x15')](function(_0x37b9ab){if(_0x37b9ab){_0x521962=_0x37b9ab['length'];if(!_0x2c9053[_0x2cd5('0x47')]['hasOwnProperty']('nolimit')){_0x330011[_0x2cd5('0x25')]=qs[_0x2cd5('0x25')](_0x2c9053[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x330011['offset']=qs['offset'](_0x2c9053[_0x2cd5('0x47')]['offset']);}return _0x1c432c[_0x2cd5('0xe0')](_0x330011);}})[_0x2cd5('0x15')](function(_0x158dde){if(_0x158dde){return _0x158dde?{'count':_0x521962,'rows':_0x158dde}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x216d1c,null))['catch'](handleError(_0x216d1c,null));};exports[_0x2cd5('0xe1')]=function(_0x3024d3,_0x4e36ee){var _0x469ecf={'raw':!![],'where':{}};var _0x34c30c={};var _0xb1f3b0={'count':0x0,'rows':[]};return db['User'][_0x2cd5('0xd3')]({'where':{'id':_0x3024d3[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x4e36ee,null))[_0x2cd5('0x15')](function(_0x3b2b57){if(_0x3b2b57){_0x34c30c[_0x2cd5('0x58')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x34c30c[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x3024d3[_0x2cd5('0x47')]);_0x34c30c[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x34c30c[_0x2cd5('0x58')],_0x34c30c['query']);_0x469ecf[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x34c30c['model'],qs[_0x2cd5('0x5d')](_0x3024d3['query'][_0x2cd5('0x5d')]));_0x469ecf[_0x2cd5('0x4b')]=_0x469ecf[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x469ecf[_0x2cd5('0x4b')]:_0x34c30c[_0x2cd5('0x58')];if(!_0x3024d3['query'][_0x2cd5('0xcc')](_0x2cd5('0xd7'))){_0x469ecf['limit']=qs[_0x2cd5('0x25')](_0x3024d3[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x469ecf[_0x2cd5('0x23')]=qs[_0x2cd5('0x23')](_0x3024d3['query'][_0x2cd5('0x23')]);}_0x469ecf['order']=qs[_0x2cd5('0xcb')](_0x3024d3['query']['sort']);_0x469ecf[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x3024d3['query'],_0x34c30c[_0x2cd5('0x5b')]));_0x469ecf[_0x2cd5('0x43')][_0x2cd5('0xdb')]=_0x3b2b57['id'];if(_0x3024d3[_0x2cd5('0x47')][_0x2cd5('0x31')]){_0x469ecf[_0x2cd5('0x43')]=_[_0x2cd5('0x5e')](_0x469ecf[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x469ecf[_0x2cd5('0x4b')],function(_0x4fe394){var _0x736c77={};_0x736c77[_0x4fe394]={'$like':'%'+_0x3024d3[_0x2cd5('0x47')][_0x2cd5('0x31')]+'%'};return _0x736c77;})});}_0x469ecf=_[_0x2cd5('0x5e')]({},_0x469ecf,_0x3024d3[_0x2cd5('0x5f')]);return db[_0x2cd5('0xe2')][_0x2cd5('0x44')]({'where':_0x469ecf[_0x2cd5('0x43')]})[_0x2cd5('0x15')](function(_0x9543a3){_0xb1f3b0[_0x2cd5('0x44')]=_0x9543a3;if(_0x3024d3['query'][_0x2cd5('0x45')]){_0x469ecf[_0x2cd5('0x46')]=[{'all':!![]}];}return db['MailInteraction'][_0x2cd5('0x4e')](_0x469ecf);})[_0x2cd5('0x15')](function(_0x15dd53){_0xb1f3b0[_0x2cd5('0x4f')]=_0x15dd53;return _0xb1f3b0;});}})[_0x2cd5('0x15')](respondWithFilteredResult(_0x4e36ee,_0x469ecf))[_0x2cd5('0x1f')](handleError(_0x4e36ee,null));};exports[_0x2cd5('0xe3')]=function(_0x3f821b,_0x23fb74){var _0x53b085={};var _0x7d9254={};var _0x4c29f1;var _0x2027a3;return db['User'][_0x2cd5('0xd3')]({'where':{'id':_0x3f821b['params']['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x23fb74,null))[_0x2cd5('0x15')](function(_0x53e58b){if(_0x53e58b){_0x4c29f1=_0x53e58b;_0x7d9254[_0x2cd5('0x58')]=_[_0x2cd5('0x5a')](db['SmsInteraction']['rawAttributes']);_0x7d9254[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x3f821b['query']);_0x7d9254[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x7d9254[_0x2cd5('0x58')],_0x7d9254[_0x2cd5('0x47')]);_0x53b085[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x7d9254[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x3f821b['query'][_0x2cd5('0x5d')]));_0x53b085['attributes']=_0x53b085[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x53b085[_0x2cd5('0x4b')]:_0x7d9254['model'];_0x53b085[_0x2cd5('0xca')]=qs['sort'](_0x3f821b[_0x2cd5('0x47')][_0x2cd5('0xcb')]);_0x53b085[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x3f821b[_0x2cd5('0x47')],_0x7d9254[_0x2cd5('0x5b')]));if(_0x3f821b['query'][_0x2cd5('0x31')]){_0x53b085[_0x2cd5('0x43')]=_[_0x2cd5('0x5e')](_0x53b085[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x53b085[_0x2cd5('0x4b')],function(_0x1ce3b9){var _0xaee194={};_0xaee194[_0x1ce3b9]={'$like':'%'+_0x3f821b['query'][_0x2cd5('0x31')]+'%'};return _0xaee194;})});}_0x53b085=_[_0x2cd5('0x5e')]({},_0x53b085,_0x3f821b[_0x2cd5('0x5f')]);return _0x4c29f1[_0x2cd5('0xe3')](_0x53b085);}})[_0x2cd5('0x15')](function(_0x12f562){if(_0x12f562){_0x2027a3=_0x12f562[_0x2cd5('0x51')];if(!_0x3f821b[_0x2cd5('0x47')]['hasOwnProperty']('nolimit')){_0x53b085[_0x2cd5('0x25')]=qs['limit'](_0x3f821b[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x53b085['offset']=qs[_0x2cd5('0x23')](_0x3f821b[_0x2cd5('0x47')][_0x2cd5('0x23')]);}return _0x4c29f1[_0x2cd5('0xe3')](_0x53b085);}})[_0x2cd5('0x15')](function(_0x38628c){if(_0x38628c){return _0x38628c?{'count':_0x2027a3,'rows':_0x38628c}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x23fb74,null))[_0x2cd5('0x1f')](handleError(_0x23fb74,null));};exports['getFaxInteractions']=function(_0x579ccb,_0x27e880){var _0x2b3bce={};var _0x5040fe={};var _0x13d2c7;var _0x4f5f47;return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0x579ccb[_0x2cd5('0x57')]['id']}})['then'](handleEntityNotFound(_0x27e880,null))[_0x2cd5('0x15')](function(_0x1f0d7f){if(_0x1f0d7f){_0x13d2c7=_0x1f0d7f;_0x5040fe['model']=_[_0x2cd5('0x5a')](db[_0x2cd5('0xe4')][_0x2cd5('0x3c')]);_0x5040fe[_0x2cd5('0x47')]=_['keys'](_0x579ccb[_0x2cd5('0x47')]);_0x5040fe[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x5040fe[_0x2cd5('0x58')],_0x5040fe['query']);_0x2b3bce[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x5040fe['model'],qs[_0x2cd5('0x5d')](_0x579ccb[_0x2cd5('0x47')]['fields']));_0x2b3bce[_0x2cd5('0x4b')]=_0x2b3bce[_0x2cd5('0x4b')]['length']?_0x2b3bce[_0x2cd5('0x4b')]:_0x5040fe[_0x2cd5('0x58')];_0x2b3bce[_0x2cd5('0xca')]=qs[_0x2cd5('0xcb')](_0x579ccb['query'][_0x2cd5('0xcb')]);_0x2b3bce[_0x2cd5('0x43')]=qs['filters'](_[_0x2cd5('0xd5')](_0x579ccb['query'],_0x5040fe[_0x2cd5('0x5b')]));if(_0x579ccb[_0x2cd5('0x47')][_0x2cd5('0x31')]){_0x2b3bce['where']=_['merge'](_0x2b3bce[_0x2cd5('0x43')],{'$or':_['map'](_0x2b3bce[_0x2cd5('0x4b')],function(_0xecf568){var _0x4ec26c={};_0x4ec26c[_0xecf568]={'$like':'%'+_0x579ccb[_0x2cd5('0x47')][_0x2cd5('0x31')]+'%'};return _0x4ec26c;})});}_0x2b3bce=_[_0x2cd5('0x5e')]({},_0x2b3bce,_0x579ccb[_0x2cd5('0x5f')]);return _0x13d2c7[_0x2cd5('0xe5')](_0x2b3bce);}})[_0x2cd5('0x15')](function(_0x52c724){if(_0x52c724){_0x4f5f47=_0x52c724['length'];if(!_0x579ccb[_0x2cd5('0x47')]['hasOwnProperty'](_0x2cd5('0xd7'))){_0x2b3bce['limit']=qs['limit'](_0x579ccb[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x2b3bce[_0x2cd5('0x23')]=qs['offset'](_0x579ccb[_0x2cd5('0x47')][_0x2cd5('0x23')]);}return _0x13d2c7[_0x2cd5('0xe5')](_0x2b3bce);}})[_0x2cd5('0x15')](function(_0x29067e){if(_0x29067e){return _0x29067e?{'count':_0x4f5f47,'rows':_0x29067e}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x27e880,null))[_0x2cd5('0x1f')](handleError(_0x27e880,null));};exports[_0x2cd5('0xe6')]=function(_0x443dd0,_0x25659c){var _0x9267e9={};var _0x5cf84f={};var _0x1d6527;var _0xaf61fa;return db[_0x2cd5('0x4d')]['findOne']({'where':{'id':_0x443dd0[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x25659c,null))['then'](function(_0x1b811c){if(_0x1b811c){_0x1d6527=_0x1b811c;_0x5cf84f[_0x2cd5('0x58')]=_['keys'](db[_0x2cd5('0xe7')]['rawAttributes']);_0x5cf84f[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x443dd0[_0x2cd5('0x47')]);_0x5cf84f[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x5cf84f[_0x2cd5('0x58')],_0x5cf84f[_0x2cd5('0x47')]);_0x9267e9[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x5cf84f['model'],qs[_0x2cd5('0x5d')](_0x443dd0[_0x2cd5('0x47')][_0x2cd5('0x5d')]));_0x9267e9[_0x2cd5('0x4b')]=_0x9267e9['attributes']['length']?_0x9267e9[_0x2cd5('0x4b')]:_0x5cf84f[_0x2cd5('0x58')];_0x9267e9[_0x2cd5('0xca')]=qs[_0x2cd5('0xcb')](_0x443dd0[_0x2cd5('0x47')][_0x2cd5('0xcb')]);_0x9267e9[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x443dd0['query'],_0x5cf84f[_0x2cd5('0x5b')]));if(_0x443dd0['query'][_0x2cd5('0x31')]){_0x9267e9[_0x2cd5('0x43')]=_['merge'](_0x9267e9[_0x2cd5('0x43')],{'$or':_['map'](_0x9267e9[_0x2cd5('0x4b')],function(_0x19803b){var _0x51fcc6={};_0x51fcc6[_0x19803b]={'$like':'%'+_0x443dd0[_0x2cd5('0x47')][_0x2cd5('0x31')]+'%'};return _0x51fcc6;})});}_0x9267e9=_[_0x2cd5('0x5e')]({},_0x9267e9,_0x443dd0[_0x2cd5('0x5f')]);return _0x1d6527[_0x2cd5('0xe6')](_0x9267e9);}})[_0x2cd5('0x15')](function(_0x449227){if(_0x449227){_0xaf61fa=_0x449227[_0x2cd5('0x51')];if(!_0x443dd0[_0x2cd5('0x47')]['hasOwnProperty'](_0x2cd5('0xd7'))){_0x9267e9[_0x2cd5('0x25')]=qs[_0x2cd5('0x25')](_0x443dd0[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x9267e9[_0x2cd5('0x23')]=qs[_0x2cd5('0x23')](_0x443dd0[_0x2cd5('0x47')][_0x2cd5('0x23')]);}return _0x1d6527['getWhatsappInteractions'](_0x9267e9);}})[_0x2cd5('0x15')](function(_0x5781b8){if(_0x5781b8){return _0x5781b8?{'count':_0xaf61fa,'rows':_0x5781b8}:null;}})['then'](respondWithResult(_0x25659c,null))[_0x2cd5('0x1f')](handleError(_0x25659c,null));};exports['login']=function(_0x22a664,_0x1554a7,_0x16ea0){var _0x47da72;var _0x3504e1;var _0x61e7c;var _0x3b2e05=!_[_0x2cd5('0x6c')](_0x22a664[_0x2cd5('0x57')]['id'])?_0x22a664[_0x2cd5('0x57')]['id']:!_['isNil'](_0x22a664['user']['id'])?_0x22a664[_0x2cd5('0x2d')]['id']:null;return db[_0x2cd5('0x4d')]['find']({'where':{'id':_0x3b2e05,'role':{'$or':[_0x2cd5('0x2b'),_0x2cd5('0x2d'),_0x2cd5('0x2f')]}},'attributes':['id',_0x2cd5('0x39'),_0x2cd5('0xe8'),_0x2cd5('0xe9'),'role',_0x2cd5('0x66'),'loginInPause']})[_0x2cd5('0x15')](function(_0x5bee0e){if(_0x5bee0e){if(_0x5bee0e[_0x2cd5('0x35')]===_0x2cd5('0x2f')){_0x47da72=_0x5bee0e;if(_0x22a664[_0x2cd5('0x62')][_0x2cd5('0xa2')]){_0x61e7c=util['format']('LOCAL/%s@from-sip/n',_0x47da72[_0x22a664[_0x2cd5('0x62')][_0x2cd5('0xa2')]]);}else if(_0x22a664['body'][_0x2cd5('0xea')]){_0x61e7c=util[_0x2cd5('0xeb')](_0x2cd5('0xac'),_0x22a664[_0x2cd5('0x62')][_0x2cd5('0xea')]);}else{_0x61e7c=util[_0x2cd5('0xeb')](_0x2cd5('0xac'),_0x47da72[_0x2cd5('0x39')]);}socket['to'](util[_0x2cd5('0xeb')](_0x2cd5('0xec'),_0x47da72[_0x2cd5('0x39')]))[_0x2cd5('0xb4')]('user:forcelogout',{'user':{'id':_0x47da72['id'],'name':_0x47da72[_0x2cd5('0x39')]},'ip':_0x22a664[_0x2cd5('0xed')][_0x2cd5('0xee')]||_0x22a664['connection'][_0x2cd5('0xef')]||_0x22a664[_0x2cd5('0xf0')]['remoteAddress']||_0x22a664[_0x2cd5('0xf1')]['socket'][_0x2cd5('0xef')]});return db[_0x2cd5('0xae')][_0x2cd5('0x29')]({'where':{'membername':_0x47da72[_0x2cd5('0x39')]},'individualHooks':!![]});}}else{throw new db[(_0x2cd5('0x93'))][(_0x2cd5('0x94'))](_0x2cd5('0xf2'));}})[_0x2cd5('0x15')](function(){if(_0x47da72){return _0x47da72['getVoiceQueues']({'raw':!![]});}})[_0x2cd5('0x15')](function(_0x2d5515){if(_0x47da72){if(_0x2d5515){_0x3504e1=_0x2d5515;if(_0x3504e1[_0x2cd5('0x51')]){var _0x166039=_0x3504e1['map'](function(_0x4323ea){var _0x176ba5={'membername':_0x47da72[_0x2cd5('0x39')],'UserId':_0x47da72['id'],'queue_name':_0x4323ea['name'],'VoiceQueueId':_0x4323ea['id'],'interface':_0x61e7c,'paused':_0x47da72[_0x2cd5('0xf3')]||![],'penalty':_0x4323ea[_0x2cd5('0xf4')]||0x0};return db[_0x2cd5('0xae')][_0x2cd5('0xaf')](_0x176ba5);});return Promise[_0x2cd5('0x56')](_0x166039);}}}})[_0x2cd5('0x15')](function(){if(_0x47da72){return db[_0x2cd5('0xf5')]['findAll']({'where':{'membername':_0x47da72[_0x2cd5('0x39')],'exitAt':null}});}})[_0x2cd5('0x15')](function(_0x8d7c05){if(_0x47da72){var _0x41096c=[];_0x8d7c05['forEach'](function(_0x3bc430){_0x41096c[_0x2cd5('0x4c')](_0x3bc430['update']({'exitAt':moment()['format'](_0x2cd5('0xf6'))}));});return Promise[_0x2cd5('0x56')](_0x41096c);}})['then'](function(){if(_0x47da72){var _0x30cc10=[];var _0x1ea868=[];var _0x22fe80=utils[_0x2cd5('0xf7')]();var _0x255b13={'membername':_0x47da72[_0x2cd5('0x39')],'interface':_0x61e7c,'enterAt':moment()[_0x2cd5('0xeb')](_0x2cd5('0xf6')),'role':_0x47da72[_0x2cd5('0x35')],'internal':_0x47da72[_0x2cd5('0x66')]};_0x22fe80[_0x2cd5('0xf8')](function(_0x1bebbe){_0x30cc10['push'](_[_0x2cd5('0x5e')]({'channel':_0x1bebbe,'type':_0x2cd5('0xf9'),'data1':_0x22a664['body'][_0x2cd5('0xfa')],'data2':_0x61e7c},_0x255b13));if(_0x47da72[_0x2cd5('0xf3')]){_0x1ea868[_0x2cd5('0x4c')](_[_0x2cd5('0x5e')]({'channel':_0x1bebbe,'type':'PAUSE','data1':_0x2cd5('0xfb')},_0x255b13));}});return db[_0x2cd5('0xf5')][_0x2cd5('0xfc')](_0x30cc10['concat'](_0x1ea868),{'individualHooks':!![]});}})[_0x2cd5('0x15')](function(){if(_0x47da72){return _0x47da72['update']({'online':!![],'lastLoginAt':moment()[_0x2cd5('0xeb')](_0x2cd5('0xf6')),'voicePause':_0x47da72[_0x2cd5('0xf3')]||![],'mailPause':_0x47da72[_0x2cd5('0xf3')]||![],'chatPause':_0x47da72[_0x2cd5('0xf3')]||![],'faxPause':_0x47da72['loginInPause']||![],'smsPause':_0x47da72[_0x2cd5('0xf3')]||![],'openchannelPause':_0x47da72['loginInPause']||![],'whatsappPause':_0x47da72[_0x2cd5('0xf3')]||![],'pauseType':_0x47da72[_0x2cd5('0xf3')]?_0x2cd5('0xfb'):null,'interface':_0x61e7c,'lastPauseAt':moment()[_0x2cd5('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0xda0d51){if(_0x22a664[_0x2cd5('0xfd')]){return _0x16ea0();}else{return Promise['resolve'](_0xda0d51)[_0x2cd5('0x15')](respondWithResult(_0x1554a7,null));}})[_0x2cd5('0x1f')](handleError(_0x1554a7,null));};exports[_0x2cd5('0xfe')]=function(_0xf082c4,_0x10ad9b){var _0x4330d3;return db[_0x2cd5('0x4d')][_0x2cd5('0x60')]({'where':{'id':_0xf082c4[_0x2cd5('0x57')]['id'],'role':_0x2cd5('0x2f')},'attributes':['id',_0x2cd5('0x39'),'role']})[_0x2cd5('0x15')](handleEntityNotFound(_0x10ad9b,null))['then'](function(_0xf062ee){if(_0xf062ee){_0x4330d3=_0xf062ee;return db[_0x2cd5('0xae')][_0x2cd5('0x29')]({'where':{'membername':_0x4330d3[_0x2cd5('0x39')]},'individualHooks':!![]});}})['then'](function(){return db[_0x2cd5('0xf5')][_0x2cd5('0x4e')]({'where':{'membername':_0x4330d3['name'],'exitAt':null}});})['then'](function(_0x4f5294){var _0x2ebdbc=[];_0x4f5294[_0x2cd5('0xf8')](function(_0x5ad644){_0x2ebdbc[_0x2cd5('0x4c')](_0x5ad644[_0x2cd5('0xff')]({'exitAt':moment()['format'](_0x2cd5('0xf6'))}));});return Promise[_0x2cd5('0x56')](_0x2ebdbc);})[_0x2cd5('0x15')](function(){return _0x4330d3[_0x2cd5('0xff')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2cd5('0x15')](respondWithResult(_0x10ad9b,null))['catch'](handleError(_0x10ad9b,null));};exports[_0x2cd5('0x100')]=function(_0x2ab052,_0x5ee178){var _0x5d8438;return db[_0x2cd5('0xae')][_0x2cd5('0xff')]({'paused':0x1},{'where':{'UserId':_0x2ab052[_0x2cd5('0x57')]['id']},'individualHooks':!![]})[_0x2cd5('0x15')](function(){return db['User'][_0x2cd5('0x60')]({'where':{'id':_0x2ab052[_0x2cd5('0x57')]['id'],'role':_0x2cd5('0x2f')},'attributes':['id',_0x2cd5('0x39'),'role',_0x2cd5('0x66'),_0x2cd5('0xa2'),_0x2cd5('0xa0')]});})[_0x2cd5('0x15')](handleEntityNotFound(_0x5ee178,null))['then'](function(_0xab2c62){if(_0xab2c62){_0x5d8438=_0xab2c62;return respondWithRpcPromise('QueuePause',_0x2cd5('0x100'),{'id':_0x5d8438['id'],'name':_0x5d8438[_0x2cd5('0x39')],'pause':!![]});}})[_0x2cd5('0x15')](function(){if(_0x5d8438){return db['MemberReport']['findAll']({'where':{'membername':_0x5d8438[_0x2cd5('0x39')],'type':_0x2cd5('0x101'),'exitAt':null}});}})['then'](function(_0x2aa58f){if(_0x2aa58f[_0x2cd5('0x51')]){var _0x4c6a6f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x246a11=0x0,_0x3cdcb2=_0x2aa58f[_0x2cd5('0x51')];_0x246a11<_0x3cdcb2;_0x246a11++){_0x2aa58f[_0x246a11]['updateAttributes']({'exitAt':_0x4c6a6f});}}})[_0x2cd5('0x15')](function(){var _0x1f9ff5=[];var _0x1dad92=utils[_0x2cd5('0xf7')]();_0x1dad92['forEach'](function(_0x10e2e0){_0x1f9ff5[_0x2cd5('0x4c')]({'channel':_0x10e2e0,'membername':_0x5d8438[_0x2cd5('0x39')],'interface':_[_0x2cd5('0x6c')](_0x5d8438['interface'])?util[_0x2cd5('0xeb')](_0x2cd5('0xac'),_0x5d8438[_0x2cd5('0x39')]):_0x5d8438[_0x2cd5('0xa2')],'type':_0x2cd5('0x101'),'enterAt':moment()[_0x2cd5('0xeb')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2ab052[_0x2cd5('0x62')]['type']||_0x2cd5('0x102'),'role':_0x5d8438[_0x2cd5('0x35')],'internal':_0x5d8438[_0x2cd5('0x66')]});});return db[_0x2cd5('0xf5')][_0x2cd5('0xfc')](_0x1f9ff5,{'individualHooks':!![]});})[_0x2cd5('0x15')](function(){return _0x5d8438[_0x2cd5('0xff')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2ab052[_0x2cd5('0x62')][_0x2cd5('0x3e')]||_0x2cd5('0x102'),'lastPauseAt':moment()[_0x2cd5('0xeb')](_0x2cd5('0xf6'))});})[_0x2cd5('0x15')](respondWithResult(_0x5ee178,null))[_0x2cd5('0x1f')](handleError(_0x5ee178,null));};exports[_0x2cd5('0x103')]=function(_0xc112c4,_0x5ced2d){if(_0xc112c4['body'][_0x2cd5('0x9f')]&&!utils['isValidChannel'](_0xc112c4['body'][_0x2cd5('0x9f')])){throw new APIBadRequestError(util[_0x2cd5('0xeb')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xc112c4[_0x2cd5('0x62')][_0x2cd5('0x9f')]));}return db[_0x2cd5('0x4d')][_0x2cd5('0x60')]({'where':{'id':_0xc112c4['params']['id']},'attributes':['id',_0x2cd5('0x39'),_0x2cd5('0x35'),'internal',_0x2cd5('0xa2'),_0x2cd5('0xa0'),_0x2cd5('0xa1'),_0x2cd5('0x104'),_0x2cd5('0x105'),_0x2cd5('0x106'),_0x2cd5('0x107'),_0x2cd5('0x108'),_0x2cd5('0x109'),_0x2cd5('0x10a'),_0x2cd5('0x10b')]})[_0x2cd5('0x15')](function(_0x1d7b26){if(!_0x1d7b26){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0xc112c4['params']['id']));}return _0x1d7b26[_0x2cd5('0x103')](_0xc112c4['body'][_0x2cd5('0x9f')]);})[_0x2cd5('0x15')](respondWithResult(_0x5ced2d,null))[_0x2cd5('0x1f')](APIHandleError(_0x5ced2d));};exports[_0x2cd5('0x10c')]=function(_0x555f93,_0x5e9893){var _0x52fff9={};var _0x16f8f8={};var _0x18abf0;var _0x3ec2ce;return db['User'][_0x2cd5('0xd3')]({'where':{'id':_0x555f93[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x5e9893,null))['then'](function(_0x176795){if(_0x176795){_0x18abf0=_0x176795;_0x16f8f8[_0x2cd5('0x58')]=_[_0x2cd5('0x5a')](db['Team']['rawAttributes']);_0x16f8f8[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x555f93['query']);_0x16f8f8[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x16f8f8[_0x2cd5('0x58')],_0x16f8f8[_0x2cd5('0x47')]);_0x52fff9['attributes']=_['intersection'](_0x16f8f8[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x555f93['query'][_0x2cd5('0x5d')]));_0x52fff9[_0x2cd5('0x4b')]=_0x52fff9[_0x2cd5('0x4b')]['length']?_0x52fff9[_0x2cd5('0x4b')]:_0x16f8f8[_0x2cd5('0x58')];_0x52fff9['order']=qs['sort'](_0x555f93['query'][_0x2cd5('0xcb')]);_0x52fff9[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0x555f93['query'],_0x16f8f8['filters']));if(_0x555f93[_0x2cd5('0x47')][_0x2cd5('0x31')]){_0x52fff9[_0x2cd5('0x43')]=_['merge'](_0x52fff9[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x52fff9['attributes'],function(_0x1c3f95){var _0x4e5457={};_0x4e5457[_0x1c3f95]={'$like':'%'+_0x555f93[_0x2cd5('0x47')][_0x2cd5('0x31')]+'%'};return _0x4e5457;})});}_0x52fff9=_[_0x2cd5('0x5e')]({},_0x52fff9,_0x555f93[_0x2cd5('0x5f')]);return _0x18abf0[_0x2cd5('0x10c')](_0x52fff9);}})['then'](function(_0xef07af){if(_0xef07af){_0x3ec2ce=_0xef07af[_0x2cd5('0x51')];if(!_0x555f93[_0x2cd5('0x47')][_0x2cd5('0xcc')](_0x2cd5('0xd7'))){_0x52fff9[_0x2cd5('0x25')]=qs[_0x2cd5('0x25')](_0x555f93[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x52fff9[_0x2cd5('0x23')]=qs['offset'](_0x555f93[_0x2cd5('0x47')][_0x2cd5('0x23')]);}return _0x18abf0['getTeams'](_0x52fff9);}})['then'](function(_0x2a5187){if(_0x2a5187){return _0x2a5187?{'count':_0x3ec2ce,'rows':_0x2a5187}:null;}})[_0x2cd5('0x15')](respondWithResult(_0x5e9893,null))['catch'](handleError(_0x5e9893,null));};exports['addTeams']=function(_0x6dc0d8,_0x480f40){var _0x108066=_0x6dc0d8[_0x2cd5('0x57')]['id'];var _0x2ba549=_0x6dc0d8['body']?_0x6dc0d8[_0x2cd5('0x62')][_0x2cd5('0x65')]:null;var _0x29be1e=[];return Promise[_0x2cd5('0x10d')]()[_0x2cd5('0x15')](function(){if(!_0x2ba549)throw new APIBadRequestError(_0x2cd5('0x10e'));})[_0x2cd5('0x15')](function(){return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0x108066}});})[_0x2cd5('0x15')](function(_0x212e4e){if(!_0x212e4e)throw new APINotFoundError(util[_0x2cd5('0xeb')](_0x2cd5('0x10f'),_0x6dc0d8[_0x2cd5('0x57')]['id']));return db['sequelize'][_0x2cd5('0x110')](function(_0x32e503){return _0x212e4e[_0x2cd5('0x111')](_0x2ba549,{'transaction':_0x32e503})[_0x2cd5('0x15')](function(){return db[_0x2cd5('0x112')]['findAll']({'where':{'id':{'$in':_0x2ba549}}});})[_0x2cd5('0x15')](function(_0x5de45c){var _0x4153f0=_[_0x2cd5('0x33')](_0x5de45c,function(_0x1766b8){return _0x1766b8[_0x2cd5('0x113')]();});return Promise[_0x2cd5('0x56')](_0x4153f0);})[_0x2cd5('0x15')](function(_0x1e40ae){_0x29be1e=_[_0x2cd5('0x114')](_0x1e40ae);var _0x11ece9=_[_0x2cd5('0x33')](_0x29be1e,function(_0x5c7c45){return _0x5c7c45[_0x2cd5('0x115')](_0x212e4e['id'],{'transaction':_0x32e503});});return Promise['all'](_0x11ece9);})[_0x2cd5('0x15')](function(){if(!_0x212e4e[_0x2cd5('0xa0')])return;var _0x3f8c99=_[_0x2cd5('0x31')](_0x29be1e,function(_0x46a2d0){return _0x46a2d0['getDataValue'](_0x2cd5('0x9f'))==='Voice';});var _0x447d29=_[_0x2cd5('0x33')](_0x3f8c99,function(_0x260ddd){return db[_0x2cd5('0xae')]['upsert']({'membername':_0x212e4e[_0x2cd5('0x39')],'UserId':_0x212e4e['id'],'queue_name':_0x260ddd[_0x2cd5('0x39')],'VoiceQueueId':_0x260ddd['id'],'interface':_[_0x2cd5('0x6c')](_0x212e4e['interface'])?util[_0x2cd5('0xeb')](_0x2cd5('0xac'),_0x212e4e[_0x2cd5('0x39')]):_0x212e4e['interface'],'paused':_0x212e4e[_0x2cd5('0xa1')]||![],'penalty':_0x212e4e[_0x2cd5('0xad')]},{'transaction':_0x32e503});});return Promise[_0x2cd5('0x56')](_0x447d29);})[_0x2cd5('0x15')](function(){return db[_0x2cd5('0x116')][_0x2cd5('0x4e')]({'where':{'teamId':{'$in':_0x2ba549}}});})[_0x2cd5('0x15')](function(_0x21b231){var _0x14dfb4=_[_0x2cd5('0x33')](_0x21b231,function(_0x492ae9){return db['UserVoicePrefix']['create']({'UserId':_0x212e4e['id'],'VoicePrefixId':_0x492ae9[_0x2cd5('0x117')]},{'transaction':_0x32e503});});return Promise[_0x2cd5('0x56')](_0x14dfb4);});});})[_0x2cd5('0x15')](function(){for(var _0x60ef66=0x0;_0x60ef66<_0x29be1e[_0x2cd5('0x51')];_0x60ef66++){var _0x458948=_0x29be1e[_0x60ef66]['getDataValue'](_0x2cd5('0x9f'));var _0x30ec0f=_0x458948+_0x2cd5('0xa8');socket[_0x2cd5('0xb4')](_0x2cd5('0x2d')+_0x458948+_0x2cd5('0xa9'),{'UserId':_0x108066,['queueField']:_0x29be1e[_0x60ef66]['id']});}})[_0x2cd5('0x15')](respondWithStatusCode(_0x480f40,null))['catch'](APIHandleError(_0x480f40));};exports[_0x2cd5('0x118')]=function(_0x3b6b73,_0x2356c9){var _0x4e28a4=_0x3b6b73[_0x2cd5('0x57')]['id'];var _0x14359a=null;if(_0x3b6b73[_0x2cd5('0x47')][_0x2cd5('0x65')]){_0x14359a=_[_0x2cd5('0xb3')](_0x3b6b73[_0x2cd5('0x47')][_0x2cd5('0x65')])?_0x3b6b73['query'][_0x2cd5('0x65')]:[_0x3b6b73[_0x2cd5('0x47')][_0x2cd5('0x65')]];}var _0x22b090=[];return Promise[_0x2cd5('0x10d')]()[_0x2cd5('0x15')](function(){if(!_0x14359a)throw new APIBadRequestError(_0x2cd5('0x119'));})[_0x2cd5('0x15')](function(){return db[_0x2cd5('0x4d')]['findOne']({'where':{'id':_0x4e28a4}});})['then'](function(_0xf38841){if(!_0xf38841)throw new APINotFoundError(util[_0x2cd5('0xeb')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3b6b73['params']['id']));return db[_0x2cd5('0x6f')][_0x2cd5('0x110')](function(_0x4e5368){return _0xf38841['removeTeams'](_0x14359a,{'transaction':_0x4e5368})['then'](function(){return db['Team'][_0x2cd5('0x4e')]({'where':{'id':{'$in':_0x14359a}}});})['then'](function(_0x5e6aef){var _0x58f1f9=_['map'](_0x5e6aef,function(_0x21b3cd){return _0x21b3cd[_0x2cd5('0x113')]();});return Promise[_0x2cd5('0x56')](_0x58f1f9);})[_0x2cd5('0x15')](function(_0x65dca4){_0x22b090=_[_0x2cd5('0x114')](_0x65dca4);var _0x38dee9=_['map'](_0x22b090,function(_0x18d55b){return _0x18d55b[_0x2cd5('0x11a')](_0xf38841['id'],{'transaction':_0x4e5368});});return Promise['all'](_0x38dee9);})['then'](function(){if(!_0xf38841['online'])return;var _0x4970a5=_['filter'](_0x22b090,function(_0x3611ed){return _0x3611ed[_0x2cd5('0x11b')](_0x2cd5('0x9f'))===_0x2cd5('0x11c');});var _0x13e202=_[_0x2cd5('0x33')](_0x4970a5,function(_0x56c63d){return db[_0x2cd5('0xae')][_0x2cd5('0x29')]({'where':{'VoiceQueueId':_0x56c63d['id'],'UserId':_0xf38841['id']},'transaction':_0x4e5368});});return Promise['all'](_0x13e202);})[_0x2cd5('0x15')](function(){return db['TeamVoicePrefix'][_0x2cd5('0x4e')]({'where':{'teamId':{'$in':_0x14359a}}});})[_0x2cd5('0x15')](function(_0x1241b3){var _0x3cb250=_[_0x2cd5('0x33')](_0x1241b3,function(_0x4a5451){return db[_0x2cd5('0x11d')][_0x2cd5('0x29')]({'where':{'UserId':_0xf38841['id'],'VoicePrefixId':_0x4a5451[_0x2cd5('0x117')]}},{'transaction':_0x4e5368});});return Promise[_0x2cd5('0x56')](_0x3cb250);});});})[_0x2cd5('0x15')](function(){for(var _0x2a41a9=0x0;_0x2a41a9<_0x22b090['length'];_0x2a41a9++){var _0x39a1ec=_0x22b090[_0x2a41a9][_0x2cd5('0x11b')](_0x2cd5('0x9f'));var _0x484cef=_0x39a1ec+_0x2cd5('0xa8');socket[_0x2cd5('0xb4')]('user'+_0x39a1ec+_0x2cd5('0x11e'),{'UserId':_0x4e28a4,['queueField']:_0x22b090[_0x2a41a9]['id']});}})[_0x2cd5('0x15')](respondWithStatusCode(_0x2356c9,null))[_0x2cd5('0x1f')](APIHandleError(_0x2356c9));};exports[_0x2cd5('0x11f')]=function(_0xf578a,_0x53e360){var _0x1db345={};var _0x456164={};var _0x379126;var _0x2ac6d7;return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0xf578a[_0x2cd5('0x57')]['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x53e360,null))[_0x2cd5('0x15')](function(_0x3d7a1f){if(_0x3d7a1f){_0x379126=_0x3d7a1f;_0x456164[_0x2cd5('0x58')]=_[_0x2cd5('0x5a')](db['CmList'][_0x2cd5('0x3c')]);_0x456164['query']=_['keys'](_0xf578a[_0x2cd5('0x47')]);_0x456164[_0x2cd5('0x5b')]=_['intersection'](_0x456164[_0x2cd5('0x58')],_0x456164[_0x2cd5('0x47')]);_0x1db345[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x456164[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0xf578a['query'][_0x2cd5('0x5d')]));_0x1db345['attributes']=_0x1db345[_0x2cd5('0x4b')][_0x2cd5('0x51')]?_0x1db345[_0x2cd5('0x4b')]:_0x456164[_0x2cd5('0x58')];_0x1db345[_0x2cd5('0xca')]=qs[_0x2cd5('0xcb')](_0xf578a[_0x2cd5('0x47')][_0x2cd5('0xcb')]);_0x1db345[_0x2cd5('0x43')]=qs[_0x2cd5('0x5b')](_[_0x2cd5('0xd5')](_0xf578a[_0x2cd5('0x47')],_0x456164['filters']));if(_0xf578a['query'][_0x2cd5('0x31')]){_0x1db345[_0x2cd5('0x43')]=_[_0x2cd5('0x5e')](_0x1db345[_0x2cd5('0x43')],{'$or':_[_0x2cd5('0x33')](_0x1db345[_0x2cd5('0x4b')],function(_0x3a0b0c){var _0x18d37d={};_0x18d37d[_0x3a0b0c]={'$like':'%'+_0xf578a['query'][_0x2cd5('0x31')]+'%'};return _0x18d37d;})});}_0x1db345=_[_0x2cd5('0x5e')]({},_0x1db345,_0xf578a[_0x2cd5('0x5f')]);return _0x379126[_0x2cd5('0x11f')](_0x1db345);}})[_0x2cd5('0x15')](function(_0x183ddb){if(_0x183ddb){_0x2ac6d7=_0x183ddb[_0x2cd5('0x51')];if(!_0xf578a[_0x2cd5('0x47')][_0x2cd5('0xcc')](_0x2cd5('0xd7'))){_0x1db345[_0x2cd5('0x25')]=qs[_0x2cd5('0x25')](_0xf578a[_0x2cd5('0x47')][_0x2cd5('0x25')]);_0x1db345[_0x2cd5('0x23')]=qs[_0x2cd5('0x23')](_0xf578a[_0x2cd5('0x47')]['offset']);}return _0x379126['getLists'](_0x1db345);}})[_0x2cd5('0x15')](function(_0x132020){if(_0x132020){return _0x132020?{'count':_0x2ac6d7,'rows':_0x132020}:null;}})['then'](respondWithResult(_0x53e360,null))[_0x2cd5('0x1f')](handleError(_0x53e360,null));};exports['getAgents']=function(_0x542685,_0x163911){var _0x5206ce={};var _0x59c59f={};var _0x506ec0;return db[_0x2cd5('0x4d')][_0x2cd5('0xd3')]({'where':{'id':_0x542685['params']['id']}})[_0x2cd5('0x15')](handleEntityNotFound(_0x163911,null))[_0x2cd5('0x15')](function(_0x3fe1f9){if(_0x3fe1f9){_0x506ec0=_0x3fe1f9;_0x59c59f[_0x2cd5('0x58')]=_[_0x2cd5('0x5a')](db[_0x2cd5('0x4d')][_0x2cd5('0x3c')]);_0x59c59f[_0x2cd5('0x47')]=_[_0x2cd5('0x5a')](_0x542685[_0x2cd5('0x47')]);_0x59c59f[_0x2cd5('0x5b')]=_[_0x2cd5('0x5c')](_0x59c59f[_0x2cd5('0x58')],_0x59c59f[_0x2cd5('0x47')]);_0x5206ce[_0x2cd5('0x4b')]=_[_0x2cd5('0x5c')](_0x59c59f[_0x2cd5('0x58')],qs[_0x2cd5('0x5d')](_0x542685[_0x2cd5('0x47')][_0x2cd5('0x5d')]));_0x5206ce[_0x2cd5('0x4b')]=_0x5206ce['attributes'][_0x2cd5('0x51')]?_0x5206ce[_0x2cd5('0x4b')]:_0x59c59f['model'];_0x5206ce['order']=qs[_0x2cd5('0xcb')](_0x542685[_0x2cd5('0x47')][_0x2cd5('0xcb')]);_0x5206ce['where']=qs['filters'](_[_0x2cd5('0xd5')](_0x542685[_0x2cd5('0x47')],_0x59c59f[_0x2cd5('0x5b')]));if(_0x542685['query']['filter']){_0x5206ce['where']=_[_0x2cd5('0x5e')](_0x5206ce[_0x2cd5('0x43')],{'$or':_['map'](_0x5206ce['attributes'],function(_0x7a8613){var _0x4ccf5e={};_0x4ccf5e[_0x7a8613]={'$like':'%'+_0x542685[_0x2cd5('0x47')]['filter']+'%'};return _0x4ccf5e;})});}_0x5206ce['model']=db['User'];_0x5206ce['as']=_0x2cd5('0x2e');_0x5206ce=_['merge']({},_0x5206ce,_0x542685[_0x2cd5('0x5f')]);return _0x506ec0['getVoiceQueues']({'include':[_0x5206ce]});}})[_0x2cd5('0x15')](function(_0x1e1d0e){if(_0x1e1d0e){var _0x411791={},_0x190d89=[];for(var _0x2c2fd0=0x0;_0x2c2fd0<_0x1e1d0e[_0x2cd5('0x51')];_0x2c2fd0+=0x1){for(var _0x176da5=0x0,_0x3000fc;_0x176da5<_0x1e1d0e[_0x2c2fd0][_0x2cd5('0x2e')][_0x2cd5('0x51')];_0x176da5+=0x1){_0x3000fc=_0x1e1d0e[_0x2c2fd0][_0x2cd5('0x2e')][_0x176da5][_0x2cd5('0x2a')]({'plain':!![]});_0x411791[_0x3000fc['id']]=_0x3000fc;}}_0x411791=_[_0x2cd5('0x120')](_0x411791);for(var _0x2d9386=qs['offset'](_0x542685[_0x2cd5('0x47')][_0x2cd5('0x23')]);_0x2d9386<_0x411791[_0x2cd5('0x51')]&&_0x190d89[_0x2cd5('0x51')]=_0x36d4cc['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x56bb('0x16')](function(){if(_0x8b1d44){return db[_0x56bb('0x25')][_0x56bb('0x45')]({'where':{'membername':_0x8b1d44[_0x56bb('0x22')]},'individualHooks':!![]});}})['then'](function(){if(_0x8b1d44){return _0x8b1d44['getVoiceQueues']({'raw':!![]});}})[_0x56bb('0x16')](function(_0xbcd927){if(_0x8b1d44){if(_0xbcd927){var _0xf7d790=[];_0x42e62b=_0xbcd927;if(_0x42e62b[_0x56bb('0x29')]){for(var _0x39f418=0x0;_0x39f418<_0x42e62b[_0x56bb('0x29')];_0x39f418++){_0xf7d790['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x8b1d44[_0x56bb('0x22')],'UserId':_0x8b1d44['id'],'queue_name':_0x42e62b[_0x39f418][_0x56bb('0x22')],'VoiceQueueId':_0x42e62b[_0x39f418]['id'],'interface':_0x31074d,'paused':_0x8b1d44[_0x56bb('0x4a')]||![],'penalty':_0x42e62b[_0x39f418]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x56bb('0x46')](_0xf7d790);}}}})['then'](function(){if(_0x8b1d44){return db[_0x56bb('0x33')][_0x56bb('0xd')]({'where':{'membername':_0x8b1d44[_0x56bb('0x22')],'exitAt':null}});}})['then'](function(_0x301278){if(_0x8b1d44){if(_0x301278&&_0x301278[_0x56bb('0x29')]){var _0x1e20c8=[];_0x301278['forEach'](function(_0x57b83e){_0x1e20c8[_0x56bb('0x2c')](_0x57b83e[_0x56bb('0x26')]({'exitAt':moment()[_0x56bb('0x28')](_0x56bb('0x2e'))}));});return BPromise[_0x56bb('0x46')](_0x1e20c8);}}})[_0x56bb('0x16')](function(){if(_0x8b1d44){var _0x2ecdcf=[];var _0x57911e=[];var _0x564f14=utils[_0x56bb('0x50')]();var _0x292c5f={'membername':_0x8b1d44[_0x56bb('0x22')],'interface':_0x31074d,'enterAt':moment()[_0x56bb('0x28')](_0x56bb('0x2e')),'role':_0x8b1d44[_0x56bb('0x23')],'internal':_0x8b1d44[_0x56bb('0x31')]};_0x564f14[_0x56bb('0x2b')](function(_0x42dac7){_0x2ecdcf[_0x56bb('0x2c')](_[_0x56bb('0x51')]({'channel':_0x42dac7,'type':_0x56bb('0x52'),'data1':_0x56bb('0x53'),'data2':_0x31074d},_0x292c5f));if(_0x8b1d44['loginInPause']){_0x57911e[_0x56bb('0x2c')](_[_0x56bb('0x51')]({'channel':_0x42dac7,'type':_0x56bb('0x27'),'data1':_0x56bb('0x54')},_0x292c5f));}});return db[_0x56bb('0x33')][_0x56bb('0x34')](_0x2ecdcf[_0x56bb('0x55')](_0x57911e),{'individualHooks':!![]});}})[_0x56bb('0x16')](function(){if(_0x8b1d44){return _0x8b1d44[_0x56bb('0x26')]({'online':!![],'lastLoginAt':moment()['format'](_0x56bb('0x2e')),'voicePause':_0x8b1d44[_0x56bb('0x4a')]||![],'mailPause':_0x8b1d44[_0x56bb('0x4a')]||![],'chatPause':_0x8b1d44[_0x56bb('0x4a')]||![],'faxPause':_0x8b1d44[_0x56bb('0x4a')]||![],'smsPause':_0x8b1d44[_0x56bb('0x4a')]||![],'openchannelPause':_0x8b1d44['loginInPause']||![],'pauseType':_0x8b1d44[_0x56bb('0x4a')]?_0x56bb('0x54'):null,'lastPauseAt':moment()[_0x56bb('0x28')](_0x56bb('0x2e')),'interface':_0x31074d});}})[_0x56bb('0x16')](function(_0x27a942){_0x178c04(_0x27a942);})[_0x56bb('0x20')](function(_0x343bac){_0x274d82(_0x2f753a[_0x56bb('0x1b')](0x1f4,_0x343bac[_0x56bb('0x1c')]));});});}; \ No newline at end of file +var _0x2594=['params','unpause','system','LogoutUser','destroy','forEach','all','LoginUser','mobile','phone','loginInPause','count','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../config/logger','../../config/environment','redis','defaults','localhost','./user.socket','register','User','findAll','options','where','attributes','limit','map','include','model','then','GetUser','debug','stringify','catch','error','message','ShowUser','info','name','internal','UserVoiceQueueRt','update','MemberReport','PAUSE','length','updateAttributes','push','isNil','format','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','role','bulkCreate','type','DEFAULT\x20PAUSE','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','interface','online','voicePause','mailPause','chatPause','openchannelPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found'];(function(_0x4690f1,_0x10f22f){var _0x5c2b55=function(_0x311b95){while(--_0x311b95){_0x4690f1['push'](_0x4690f1['shift']());}};_0x5c2b55(++_0x10f22f);}(_0x2594,0xba));var _0x4259=function(_0x102503,_0x5cf56f){_0x102503=_0x102503-0x0;var _0x957428=_0x2594[_0x102503];return _0x957428;};'use strict';var _=require(_0x4259('0x0'));var util=require(_0x4259('0x1'));var moment=require(_0x4259('0x2'));var BPromise=require(_0x4259('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4259('0x4'))('rpc');var config=require(_0x4259('0x5'));config[_0x4259('0x6')]=_[_0x4259('0x7')](config['redis'],{'host':_0x4259('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4259('0x6')]));require(_0x4259('0x9'))[_0x4259('0xa')](socket);exports['GetUser']=function(_0x1f25a4){var _0x571a59=this;return new Promise(function(_0x1ea46c,_0x2d44af){return db[_0x4259('0xb')][_0x4259('0xc')]({'raw':_0x1f25a4[_0x4259('0xd')]?_0x1f25a4[_0x4259('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x1f25a4[_0x4259('0xd')]?_0x1f25a4['options'][_0x4259('0xe')]||null:null,'attributes':_0x1f25a4[_0x4259('0xd')]?_0x1f25a4[_0x4259('0xd')][_0x4259('0xf')]||null:null,'limit':_0x1f25a4[_0x4259('0xd')]?_0x1f25a4[_0x4259('0xd')][_0x4259('0x10')]||null:null,'include':_0x1f25a4[_0x4259('0xd')]?_0x1f25a4['options']['include']?_[_0x4259('0x11')](_0x1f25a4[_0x4259('0xd')][_0x4259('0x12')],function(_0x413e06){return{'model':db[_0x413e06[_0x4259('0x13')]],'as':_0x413e06['as'],'attributes':_0x413e06[_0x4259('0xf')],'include':_0x413e06['include']?_[_0x4259('0x11')](_0x413e06['include'],function(_0x3ad69a){return{'model':db[_0x3ad69a[_0x4259('0x13')]],'as':_0x3ad69a['as'],'attributes':_0x3ad69a[_0x4259('0xf')],'include':_0x3ad69a[_0x4259('0x12')]?_[_0x4259('0x11')](_0x3ad69a[_0x4259('0x12')],function(_0x42c144){return{'model':db[_0x42c144[_0x4259('0x13')]],'as':_0x42c144['as'],'attributes':_0x42c144[_0x4259('0xf')]};}):[]};}):[]};}):[]:[]})[_0x4259('0x14')](function(_0xab4f0d){logger['info'](_0x4259('0x15'),_0x1f25a4);logger[_0x4259('0x16')]('GetUser',_0x1f25a4,JSON[_0x4259('0x17')](_0xab4f0d));_0x1ea46c(_0xab4f0d);})[_0x4259('0x18')](function(_0x48cb87){logger[_0x4259('0x19')]('GetUser',_0x48cb87[_0x4259('0x1a')],_0x1f25a4);_0x2d44af(_0x571a59[_0x4259('0x19')](0x1f4,_0x48cb87[_0x4259('0x1a')]));});});};exports[_0x4259('0x1b')]=function(_0x330b4c){var _0x2830fd=this;return new Promise(function(_0x14e104,_0x28e6cd){return db['User']['find']({'raw':_0x330b4c['options']?_0x330b4c['options']['raw']===undefined?!![]:![]:!![],'where':_0x330b4c['options']?_0x330b4c['options']['where']||null:null,'attributes':_0x330b4c[_0x4259('0xd')]?_0x330b4c[_0x4259('0xd')][_0x4259('0xf')]||null:null,'include':_0x330b4c[_0x4259('0xd')]?_0x330b4c[_0x4259('0xd')][_0x4259('0x12')]?_['map'](_0x330b4c[_0x4259('0xd')][_0x4259('0x12')],function(_0x3e0988){return{'model':db[_0x3e0988['model']],'as':_0x3e0988['as'],'attributes':_0x3e0988['attributes'],'include':_0x3e0988['include']?_[_0x4259('0x11')](_0x3e0988['include'],function(_0x1d5ed0){return{'model':db[_0x1d5ed0[_0x4259('0x13')]],'as':_0x1d5ed0['as'],'attributes':_0x1d5ed0[_0x4259('0xf')],'include':_0x1d5ed0[_0x4259('0x12')]?_[_0x4259('0x11')](_0x1d5ed0['include'],function(_0x49e89d){return{'model':db[_0x49e89d[_0x4259('0x13')]],'as':_0x49e89d['as'],'attributes':_0x49e89d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4259('0x14')](function(_0x2b8c50){logger[_0x4259('0x1c')](_0x4259('0x1b'),_0x330b4c);logger[_0x4259('0x16')](_0x4259('0x1b'),_0x330b4c,JSON[_0x4259('0x17')](_0x2b8c50));_0x14e104(_0x2b8c50);})[_0x4259('0x18')](function(_0x859be8){logger[_0x4259('0x19')]('ShowUser',_0x859be8[_0x4259('0x1a')],_0x330b4c);_0x28e6cd(_0x2830fd['error'](0x1f4,_0x859be8['message']));});});};exports['PauseUser']=function(_0x5385bf){var _0x3ed5ca=this;return new Promise(function(_0x19daaf,_0x3f0d3d){var _0x107b6f;return db[_0x4259('0xb')]['find']({'where':_0x5385bf[_0x4259('0xd')][_0x4259('0xe')]||{},'attributes':['id',_0x4259('0x1d'),'role',_0x4259('0x1e'),'interface']})[_0x4259('0x14')](function(_0x37d7c8){if(_0x37d7c8){_0x107b6f=_0x37d7c8;return db[_0x4259('0x1f')][_0x4259('0x20')]({'paused':0x1},{'where':{'UserId':_0x107b6f['id']},'individualHooks':!![]});}})[_0x4259('0x14')](function(){if(_0x107b6f){return db[_0x4259('0x21')][_0x4259('0xc')]({'where':{'membername':_0x107b6f[_0x4259('0x1d')],'type':_0x4259('0x22'),'exitAt':null}});}})[_0x4259('0x14')](function(_0x5d332d){if(_0x107b6f){if(_0x5d332d&&_0x5d332d['length']){var _0x20ac0c=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x412c67=0x0,_0x4b7ce6=_0x5d332d[_0x4259('0x23')];_0x412c67<_0x4b7ce6;_0x412c67++){_0x5d332d[_0x412c67][_0x4259('0x24')]({'exitAt':_0x20ac0c});}}}})[_0x4259('0x14')](function(){if(_0x107b6f){var _0x1f043e=[];var _0x378c4d=utils['getChannels']();_0x378c4d['forEach'](function(_0x1386e6){_0x1f043e[_0x4259('0x25')]({'channel':_0x1386e6,'membername':_0x107b6f[_0x4259('0x1d')],'interface':_[_0x4259('0x26')](_0x107b6f['interface'])?util[_0x4259('0x27')](_0x4259('0x28'),_0x107b6f[_0x4259('0x1d')]):_0x107b6f['interface'],'type':_0x4259('0x22'),'enterAt':moment()[_0x4259('0x27')](_0x4259('0x29')),'data1':_0x5385bf[_0x4259('0x2a')]['type']||'DEFAULT\x20PAUSE','role':_0x107b6f[_0x4259('0x2b')],'internal':_0x107b6f[_0x4259('0x1e')],'uniqueid':_0x5385bf['body']['uniqueid']||null});});return db[_0x4259('0x21')][_0x4259('0x2c')](_0x1f043e,{'individualHooks':!![]});}})[_0x4259('0x14')](function(){if(_0x107b6f){return _0x107b6f[_0x4259('0x20')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5385bf[_0x4259('0x2a')][_0x4259('0x2d')]||_0x4259('0x2e'),'lastPauseAt':moment()[_0x4259('0x27')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x4259('0x14')](function(_0x3e784f){_0x19daaf(_0x3e784f);})[_0x4259('0x18')](function(_0x20c921){_0x3f0d3d(_0x3ed5ca[_0x4259('0x19')](0x1f4,_0x20c921[_0x4259('0x1a')]));});});};exports['UnpauseUser']=function(_0x4a61e7){var _0x18f57b=this;return new Promise(function(_0x88c71c,_0x50f0f0){if(_0x4a61e7[_0x4259('0x2a')][_0x4259('0x2f')]&&!utils[_0x4259('0x30')](_0x4a61e7[_0x4259('0x2a')][_0x4259('0x2f')])){throw new Error(util[_0x4259('0x27')](_0x4259('0x31'),_0x4a61e7['body'][_0x4259('0x2f')]));}return db[_0x4259('0xb')][_0x4259('0x32')]({'where':_0x4a61e7[_0x4259('0xd')][_0x4259('0xe')]||{},'attributes':['id',_0x4259('0x1d'),_0x4259('0x2b'),_0x4259('0x1e'),_0x4259('0x33'),_0x4259('0x34'),_0x4259('0x35'),_0x4259('0x36'),_0x4259('0x37'),'faxPause',_0x4259('0x38'),'smsPause','whatsappPause',_0x4259('0x39'),_0x4259('0x3a')]})[_0x4259('0x14')](function(_0x527cd3){if(!_0x527cd3){throw new Error(util[_0x4259('0x27')](_0x4259('0x3b'),_0x4a61e7[_0x4259('0x3c')]['id']));}return _0x527cd3[_0x4259('0x3d')](_0x4a61e7[_0x4259('0x2a')][_0x4259('0x2f')],_0x4259('0x3e'));})['then'](function(_0x55f9fe){_0x88c71c(_0x55f9fe);})[_0x4259('0x18')](function(_0x4a8099){_0x50f0f0(_0x18f57b[_0x4259('0x19')](0x1f4,_0x4a8099[_0x4259('0x1a')]));});});};exports[_0x4259('0x3f')]=function(_0x52a4af){var _0x2550cb=this;return new Promise(function(_0x3ee440,_0x4c3fdb){var _0x3b7621;return db[_0x4259('0xb')][_0x4259('0x32')]({'where':_0x52a4af[_0x4259('0xd')][_0x4259('0xe')]||{},'attributes':['id',_0x4259('0x1d')]})['then'](function(_0x52c0ca){if(_0x52c0ca){_0x3b7621=_0x52c0ca;return db[_0x4259('0x1f')][_0x4259('0x40')]({'where':{'membername':_0x3b7621[_0x4259('0x1d')]},'individualHooks':!![]});}})[_0x4259('0x14')](function(){if(_0x3b7621){return db[_0x4259('0x21')][_0x4259('0xc')]({'where':{'membername':_0x3b7621[_0x4259('0x1d')],'exitAt':null}});}})['then'](function(_0x382467){if(_0x3b7621){if(_0x382467&&_0x382467[_0x4259('0x23')]){var _0x2a3998=[];_0x382467[_0x4259('0x41')](function(_0x5064e2){_0x2a3998[_0x4259('0x25')](_0x5064e2['update']({'exitAt':moment()[_0x4259('0x27')](_0x4259('0x29'))}));});return BPromise[_0x4259('0x42')](_0x2a3998);}}})[_0x4259('0x14')](function(){if(_0x3b7621){return _0x3b7621[_0x4259('0x20')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x4259('0x14')](function(_0x4b9225){_0x3ee440(_0x4b9225);})[_0x4259('0x18')](function(_0x2182d7){_0x4c3fdb(_0x2550cb[_0x4259('0x19')](0x1f4,_0x2182d7[_0x4259('0x1a')]));});});};exports[_0x4259('0x43')]=function(_0x52d491){var _0x321e41=this;return new Promise(function(_0x346b8d,_0xf7dd74){var _0x23bcb2;var _0x4e3420;var _0x4a9d2e;var _0x1d92e5;return db[_0x4259('0xb')][_0x4259('0x32')]({'where':_0x52d491['options'][_0x4259('0xe')]||{},'attributes':['id',_0x4259('0x1d'),_0x4259('0x2b'),_0x4259('0x44'),_0x4259('0x45'),_0x4259('0x1e'),_0x4259('0x46'),_0x4259('0x33')]})[_0x4259('0x14')](function(_0x4b2a1d){if(_0x4b2a1d){_0x23bcb2=_0x4b2a1d;_0x1d92e5=_0x52d491[_0x4259('0x2a')][_0x4259('0x33')]?_0x52d491[_0x4259('0x2a')]['interface']:util[_0x4259('0x27')]('SIP/%s',_0x23bcb2['name']);return db['User'][_0x4259('0x47')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x23bcb2['id']}}});}})[_0x4259('0x14')](function(_0x174174){if(_0x174174){_0x4a9d2e=_0x174174;return require('../../config/license/util')['getLicense']();}})['then'](function(_0x34cd3e){if(_0x34cd3e&&_0x34cd3e[_0x4259('0x48')]&&_0x4a9d2e>=_0x34cd3e['agents']){throw new Error(_0x4259('0x49'));}})[_0x4259('0x14')](function(){if(_0x23bcb2){return db['UserVoiceQueueRt'][_0x4259('0x40')]({'where':{'membername':_0x23bcb2[_0x4259('0x1d')]},'individualHooks':!![]});}})[_0x4259('0x14')](function(){if(_0x23bcb2){return _0x23bcb2[_0x4259('0x4a')]({'raw':!![]});}})[_0x4259('0x14')](function(_0x25c10c){if(_0x23bcb2){if(_0x25c10c){var _0x2843f4=[];_0x4e3420=_0x25c10c;if(_0x4e3420[_0x4259('0x23')]){for(var _0x1b1f61=0x0;_0x1b1f61<_0x4e3420[_0x4259('0x23')];_0x1b1f61++){_0x2843f4['push'](db[_0x4259('0x1f')]['upsert']({'membername':_0x23bcb2[_0x4259('0x1d')],'UserId':_0x23bcb2['id'],'queue_name':_0x4e3420[_0x1b1f61]['name'],'VoiceQueueId':_0x4e3420[_0x1b1f61]['id'],'interface':_0x1d92e5,'paused':_0x23bcb2[_0x4259('0x46')]||![],'penalty':_0x4e3420[_0x1b1f61][_0x4259('0x4b')]||0x0}));}return BPromise[_0x4259('0x42')](_0x2843f4);}}}})[_0x4259('0x14')](function(){if(_0x23bcb2){return db[_0x4259('0x21')][_0x4259('0xc')]({'where':{'membername':_0x23bcb2[_0x4259('0x1d')],'exitAt':null}});}})[_0x4259('0x14')](function(_0x3b1743){if(_0x23bcb2){if(_0x3b1743&&_0x3b1743['length']){var _0x2e7478=[];_0x3b1743['forEach'](function(_0x21e4cf){_0x2e7478['push'](_0x21e4cf[_0x4259('0x20')]({'exitAt':moment()['format'](_0x4259('0x29'))}));});return BPromise[_0x4259('0x42')](_0x2e7478);}}})[_0x4259('0x14')](function(){if(_0x23bcb2){var _0x382cdc=[];var _0x4e8a3b=[];var _0x133d67=utils[_0x4259('0x4c')]();var _0x2c4269={'membername':_0x23bcb2[_0x4259('0x1d')],'interface':_0x1d92e5,'enterAt':moment()[_0x4259('0x27')](_0x4259('0x29')),'role':_0x23bcb2[_0x4259('0x2b')],'internal':_0x23bcb2[_0x4259('0x1e')]};_0x133d67[_0x4259('0x41')](function(_0x32490f){_0x382cdc[_0x4259('0x25')](_[_0x4259('0x4d')]({'channel':_0x32490f,'type':_0x4259('0x4e'),'data1':_0x4259('0x4f'),'data2':_0x1d92e5},_0x2c4269));if(_0x23bcb2['loginInPause']){_0x4e8a3b[_0x4259('0x25')](_[_0x4259('0x4d')]({'channel':_0x32490f,'type':_0x4259('0x22'),'data1':_0x4259('0x50')},_0x2c4269));}});return db['MemberReport'][_0x4259('0x2c')](_0x382cdc[_0x4259('0x51')](_0x4e8a3b),{'individualHooks':!![]});}})[_0x4259('0x14')](function(){if(_0x23bcb2){return _0x23bcb2[_0x4259('0x20')]({'online':!![],'lastLoginAt':moment()[_0x4259('0x27')](_0x4259('0x29')),'voicePause':_0x23bcb2[_0x4259('0x46')]||![],'mailPause':_0x23bcb2['loginInPause']||![],'chatPause':_0x23bcb2[_0x4259('0x46')]||![],'faxPause':_0x23bcb2[_0x4259('0x46')]||![],'smsPause':_0x23bcb2['loginInPause']||![],'openchannelPause':_0x23bcb2[_0x4259('0x46')]||![],'pauseType':_0x23bcb2[_0x4259('0x46')]?_0x4259('0x50'):null,'lastPauseAt':moment()[_0x4259('0x27')](_0x4259('0x29')),'interface':_0x1d92e5});}})['then'](function(_0x38ec2b){_0x346b8d(_0x38ec2b);})[_0x4259('0x18')](function(_0x419b25){_0xf7dd74(_0x321e41[_0x4259('0x19')](0x1f4,_0x419b25['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 69a2556..244c7f8 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 _0xed13=['register','length','user:','./user.events','save','remove','update','emit','removeListener'];(function(_0x2fd12b,_0xfffe77){var _0x122863=function(_0x1d77ac){while(--_0x1d77ac){_0x2fd12b['push'](_0x2fd12b['shift']());}};_0x122863(++_0xfffe77);}(_0xed13,0x123));var _0x3ed1=function(_0x23a822,_0x111012){_0x23a822=_0x23a822-0x0;var _0x3b9e04=_0xed13[_0x23a822];return _0x3b9e04;};'use strict';var UserEvents=require(_0x3ed1('0x0'));var events=[_0x3ed1('0x1'),_0x3ed1('0x2'),_0x3ed1('0x3')];function createListener(_0xc9d446,_0x3ada9d){return function(_0x5a0a1e){_0x3ada9d[_0x3ed1('0x4')](_0xc9d446,_0x5a0a1e);};}function removeListener(_0x196498,_0x4e9f48){return function(){UserEvents[_0x3ed1('0x5')](_0x196498,_0x4e9f48);};}exports[_0x3ed1('0x6')]=function(_0x3f7276){for(var _0x4adabf=0x0,_0x20e31b=events[_0x3ed1('0x7')];_0x4adabf<_0x20e31b;_0x4adabf++){var _0x3b6c8b=events[_0x4adabf];var _0x24eac6=createListener(_0x3ed1('0x8')+_0x3b6c8b,_0x3f7276);UserEvents['on'](_0x3b6c8b,_0x24eac6);}}; \ No newline at end of file +var _0x464a=['register','user:','./user.events','save','update','emit','removeListener'];(function(_0x1cac97,_0x14901b){var _0xc47a1=function(_0xd30b64){while(--_0xd30b64){_0x1cac97['push'](_0x1cac97['shift']());}};_0xc47a1(++_0x14901b);}(_0x464a,0x8e));var _0xa464=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x464a[_0x501510];return _0x1e6ee5;};'use strict';var UserEvents=require(_0xa464('0x0'));var events=[_0xa464('0x1'),'remove',_0xa464('0x2')];function createListener(_0x7bb2b7,_0xad5183){return function(_0x3ca82c){_0xad5183[_0xa464('0x3')](_0x7bb2b7,_0x3ca82c);};}function removeListener(_0x109af6,_0x44f5d9){return function(){UserEvents[_0xa464('0x4')](_0x109af6,_0x44f5d9);};}exports[_0xa464('0x5')]=function(_0x53266c){for(var _0x558448=0x0,_0x532b24=events['length'];_0x558448<_0x532b24;_0x558448++){var _0x38cbd1=events[_0x558448];var _0x3afcfd=createListener(_0xa464('0x6')+_0x38cbd1,_0x53266c);UserEvents['on'](_0x38cbd1,_0x3afcfd);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 859cec1..4d03dc5 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3d0439,_0x570420){var _0x3d087a=function(_0x48a773){while(--_0x48a773){_0x3d0439['push'](_0x3d0439['shift']());}};_0x3d087a(++_0x570420);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xcb91[_0x498334];return _0x13bb70;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4cb396,_0x43ccc2){var _0x218286=function(_0x2553a4){while(--_0x2553a4){_0x4cb396['push'](_0x4cb396['shift']());}};_0x218286(++_0x43ccc2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 8383c9c..03a0d9d 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 _0x20d8=['exports'];(function(_0x1417c6,_0x194309){var _0x44db97=function(_0xa2a293){while(--_0xa2a293){_0x1417c6['push'](_0x1417c6['shift']());}};_0x44db97(++_0x194309);}(_0x20d8,0xbe));var _0x820d=function(_0xe4f0de,_0xfffafa){_0xe4f0de=_0xe4f0de-0x0;var _0x2e96ea=_0x20d8[_0xe4f0de];return _0x2e96ea;};'use strict';var Sequelize=require('sequelize');module[_0x820d('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e5e=['sequelize','INTEGER'];(function(_0x44e016,_0x2a4ac3){var _0x5bc0a0=function(_0x2e3b13){while(--_0x2e3b13){_0x44e016['push'](_0x44e016['shift']());}};_0x5bc0a0(++_0x2a4ac3);}(_0x3e5e,0x14c));var _0xe3e5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e5e[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xe3e5('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe3e5('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 eeb2b4e..3670d47 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 _0x5cec=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues'];(function(_0x168a2b,_0x382803){var _0x5ca109=function(_0x1fc5b6){while(--_0x1fc5b6){_0x168a2b['push'](_0x168a2b['shift']());}};_0x5ca109(++_0x382803);}(_0x5cec,0x150));var _0xc5ce=function(_0x25bf00,_0x43a2a2){_0x25bf00=_0x25bf00-0x0;var _0x585b04=_0x5cec[_0x25bf00];return _0x585b04;};'use strict';var _=require('lodash');var util=require(_0xc5ce('0x0'));var logger=require(_0xc5ce('0x1'))(_0xc5ce('0x2'));var moment=require(_0xc5ce('0x3'));var BPromise=require('bluebird');var rp=require(_0xc5ce('0x4'));var fs=require('fs');var path=require(_0xc5ce('0x5'));var rimraf=require(_0xc5ce('0x6'));var config=require(_0xc5ce('0x7'));var attributes=require(_0xc5ce('0x8'));module[_0xc5ce('0x9')]=function(_0x494c79,_0x382223){return _0x494c79[_0xc5ce('0xa')]('UserChatQueue',attributes,{'tableName':_0xc5ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9459=['define','user_has_chat_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports'];(function(_0x4d605b,_0x57f6ac){var _0x3fdc2c=function(_0x502183){while(--_0x502183){_0x4d605b['push'](_0x4d605b['shift']());}};_0x3fdc2c(++_0x57f6ac);}(_0x9459,0x1ba));var _0x9945=function(_0x50eb45,_0x3c4524){_0x50eb45=_0x50eb45-0x0;var _0x46d418=_0x9459[_0x50eb45];return _0x46d418;};'use strict';var _=require(_0x9945('0x0'));var util=require('util');var logger=require(_0x9945('0x1'))('api');var moment=require(_0x9945('0x2'));var BPromise=require(_0x9945('0x3'));var rp=require(_0x9945('0x4'));var fs=require('fs');var path=require(_0x9945('0x5'));var rimraf=require(_0x9945('0x6'));var config=require('../../config/environment');var attributes=require(_0x9945('0x7'));module[_0x9945('0x8')]=function(_0x181791,_0x363808){return _0x181791[_0x9945('0x9')]('UserChatQueue',attributes,{'tableName':_0x9945('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index a718d44..98c803a 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 _0x4af1=['then','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2b7384,_0x4246c4){var _0x1b2ab5=function(_0x12af81){while(--_0x12af81){_0x2b7384['push'](_0x2b7384['shift']());}};_0x1b2ab5(++_0x4246c4);}(_0x4af1,0x1ae));var _0x14af=function(_0x3959b6,_0x1c45a3){_0x3959b6=_0x3959b6-0x0;var _0x1615a9=_0x4af1[_0x3959b6];return _0x1615a9;};'use strict';var _=require(_0x14af('0x0'));var util=require('util');var moment=require(_0x14af('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14af('0x2'));var db=require(_0x14af('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x14af('0x4'))(_0x14af('0x5'));var config=require(_0x14af('0x6'));var jayson=require(_0x14af('0x7'));var client=jayson['client'][_0x14af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5728cf,_0x1b20b9,_0xccdbd3){return new BPromise(function(_0x1ca3ae,_0x36614b){return client[_0x14af('0x9')](_0x5728cf,_0xccdbd3)[_0x14af('0xa')](function(_0x138505){logger[_0x14af('0xb')](_0x14af('0xc'),_0x1b20b9,'request\x20sent');logger['debug'](_0x14af('0xd'),_0x1b20b9,_0x14af('0xe'),JSON[_0x14af('0xf')](_0x138505));if(_0x138505[_0x14af('0x10')]){if(_0x138505[_0x14af('0x10')][_0x14af('0x11')]===0x1f4){logger[_0x14af('0x10')](_0x14af('0xc'),_0x1b20b9,_0x138505[_0x14af('0x10')][_0x14af('0x12')]);return _0x36614b(_0x138505['error'][_0x14af('0x12')]);}logger['error'](_0x14af('0xc'),_0x1b20b9,_0x138505[_0x14af('0x10')][_0x14af('0x12')]);return _0x1ca3ae(_0x138505[_0x14af('0x10')][_0x14af('0x12')]);}else{logger[_0x14af('0xb')](_0x14af('0xc'),_0x1b20b9,_0x14af('0xe'));_0x1ca3ae(_0x138505['result']['message']);}})[_0x14af('0x13')](function(_0x4824f6){logger['error'](_0x14af('0xc'),_0x1b20b9,_0x4824f6);_0x36614b(_0x4824f6);});});} \ No newline at end of file +var _0x9ce9=['request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','UserChatQueue,\x20%s,\x20%s'];(function(_0x32e2ae,_0xa72369){var _0x2ae887=function(_0x3c7293){while(--_0x3c7293){_0x32e2ae['push'](_0x32e2ae['shift']());}};_0x2ae887(++_0xa72369);}(_0x9ce9,0x1cf));var _0x99ce=function(_0x5d8285,_0x2e40a4){_0x5d8285=_0x5d8285-0x0;var _0x3addc1=_0x9ce9[_0x5d8285];return _0x3addc1;};'use strict';var _=require(_0x99ce('0x0'));var util=require(_0x99ce('0x1'));var moment=require(_0x99ce('0x2'));var BPromise=require(_0x99ce('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99ce('0x4'));var db=require(_0x99ce('0x5'))['db'];var utils=require(_0x99ce('0x6'));var logger=require(_0x99ce('0x7'))(_0x99ce('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x99ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x380fc4,_0x2b1583,_0x789ef7){return new BPromise(function(_0x3a65a0,_0x35c87c){return client['request'](_0x380fc4,_0x789ef7)[_0x99ce('0xa')](function(_0x11fb9a){logger['info'](_0x99ce('0xb'),_0x2b1583,_0x99ce('0xc'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2b1583,_0x99ce('0xc'),JSON[_0x99ce('0xd')](_0x11fb9a));if(_0x11fb9a[_0x99ce('0xe')]){if(_0x11fb9a[_0x99ce('0xe')][_0x99ce('0xf')]===0x1f4){logger[_0x99ce('0xe')](_0x99ce('0xb'),_0x2b1583,_0x11fb9a['error']['message']);return _0x35c87c(_0x11fb9a[_0x99ce('0xe')][_0x99ce('0x10')]);}logger[_0x99ce('0xe')](_0x99ce('0xb'),_0x2b1583,_0x11fb9a[_0x99ce('0xe')][_0x99ce('0x10')]);return _0x3a65a0(_0x11fb9a[_0x99ce('0xe')][_0x99ce('0x10')]);}else{logger[_0x99ce('0x11')](_0x99ce('0xb'),_0x2b1583,'request\x20sent');_0x3a65a0(_0x11fb9a[_0x99ce('0x12')]['message']);}})['catch'](function(_0x5da8a2){logger[_0x99ce('0xe')](_0x99ce('0xb'),_0x2b1583,_0x5da8a2);_0x35c87c(_0x5da8a2);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 6a61a7b..6fddeaf 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3353f1,_0x45871d){var _0x30cd24=function(_0x2a5bf9){while(--_0x2a5bf9){_0x3353f1['push'](_0x3353f1['shift']());}};_0x30cd24(++_0x45871d);}(_0xe706,0xa3));var _0x6e70=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0xe706[_0x2a8860];return _0x2f47a4;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x31f308,_0x3db808){var _0x24faed=function(_0x55f55a){while(--_0x55f55a){_0x31f308['push'](_0x31f308['shift']());}};_0x24faed(++_0x3db808);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 16199c4..ef25bcc 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 _0x1136=['STRING','sequelize','INTEGER'];(function(_0x22090f,_0x15c96f){var _0x2bf641=function(_0x356d60){while(--_0x356d60){_0x22090f['push'](_0x22090f['shift']());}};_0x2bf641(++_0x15c96f);}(_0x1136,0x94));var _0x6113=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1136[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x6113('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6113('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6113('0x2')]}}; \ No newline at end of file +var _0xdf7b=['STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf7b,0xe1));var _0xbdf7=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0xdf7b[_0xb4cc12];return _0x8593b5;};'use strict';var Sequelize=require(_0xbdf7('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xbdf7('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 3305cfc..4f3dce0 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 _0x4f54=['bluebird','path','rimraf','../../config/environment','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x4f54,0x1a9));var _0x44f5=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4f54[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x44f5('0x0'));var util=require(_0x44f5('0x1'));var logger=require(_0x44f5('0x2'))('api');var moment=require(_0x44f5('0x3'));var BPromise=require(_0x44f5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44f5('0x5'));var rimraf=require(_0x44f5('0x6'));var config=require(_0x44f5('0x7'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x40cf52,_0x2c9ca2){return _0x40cf52[_0x44f5('0x8')](_0x44f5('0x9'),attributes,{'tableName':_0x44f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ad2=['../../config/logger','api','request-promise','path','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x1d5536,_0x2899ff){var _0x354395=function(_0x4d90f9){while(--_0x4d90f9){_0x1d5536['push'](_0x1d5536['shift']());}};_0x354395(++_0x2899ff);}(_0x1ad2,0xa3));var _0x21ad=function(_0x721e8b,_0x5e679d){_0x721e8b=_0x721e8b-0x0;var _0x3a0b53=_0x1ad2[_0x721e8b];return _0x3a0b53;};'use strict';var _=require(_0x21ad('0x0'));var util=require(_0x21ad('0x1'));var logger=require(_0x21ad('0x2'))(_0x21ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x21ad('0x4'));var fs=require('fs');var path=require(_0x21ad('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x21ad('0x6'));module[_0x21ad('0x7')]=function(_0x149ec7,_0x37c2f8){return _0x149ec7[_0x21ad('0x8')](_0x21ad('0x9'),attributes,{'tableName':_0x21ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index abb640d..de8892b 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 _0xb5bb=['request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0xb5bb,0x196));var _0xbb5b=function(_0x65312a,_0x2c9b79){_0x65312a=_0x65312a-0x0;var _0x19b9cc=_0xb5bb[_0x65312a];return _0x19b9cc;};'use strict';var _=require(_0xbb5b('0x0'));var util=require(_0xbb5b('0x1'));var moment=require(_0xbb5b('0x2'));var BPromise=require(_0xbb5b('0x3'));var rs=require(_0xbb5b('0x4'));var fs=require('fs');var Redis=require(_0xbb5b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb5b('0x6'));var logger=require(_0xbb5b('0x7'))(_0xbb5b('0x8'));var config=require(_0xbb5b('0x9'));var jayson=require(_0xbb5b('0xa'));var client=jayson[_0xbb5b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x88440e,_0x961e94,_0x116117){return new BPromise(function(_0x1db643,_0x52a4a2){return client[_0xbb5b('0xc')](_0x88440e,_0x116117)['then'](function(_0x1271f2){logger[_0xbb5b('0xd')](_0xbb5b('0xe'),_0x961e94,_0xbb5b('0xf'));logger['debug'](_0xbb5b('0x10'),_0x961e94,_0xbb5b('0xf'),JSON[_0xbb5b('0x11')](_0x1271f2));if(_0x1271f2['error']){if(_0x1271f2[_0xbb5b('0x12')]['code']===0x1f4){logger['error'](_0xbb5b('0xe'),_0x961e94,_0x1271f2['error']['message']);return _0x52a4a2(_0x1271f2[_0xbb5b('0x12')][_0xbb5b('0x13')]);}logger[_0xbb5b('0x12')](_0xbb5b('0xe'),_0x961e94,_0x1271f2['error'][_0xbb5b('0x13')]);return _0x1db643(_0x1271f2[_0xbb5b('0x12')]['message']);}else{logger['info'](_0xbb5b('0xe'),_0x961e94,'request\x20sent');_0x1db643(_0x1271f2[_0xbb5b('0x14')][_0xbb5b('0x13')]);}})[_0xbb5b('0x15')](function(_0x32d825){logger[_0xbb5b('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x961e94,_0x32d825);_0x52a4a2(_0x32d825);});});} \ No newline at end of file +var _0xfe5b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x19790f,_0x148594){var _0x3fc8c8=function(_0x51cec6){while(--_0x51cec6){_0x19790f['push'](_0x19790f['shift']());}};_0x3fc8c8(++_0x148594);}(_0xfe5b,0x138));var _0xbfe5=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xfe5b[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xbfe5('0x0'));var util=require(_0xbfe5('0x1'));var moment=require(_0xbfe5('0x2'));var BPromise=require(_0xbfe5('0x3'));var rs=require(_0xbfe5('0x4'));var fs=require('fs');var Redis=require(_0xbfe5('0x5'));var db=require(_0xbfe5('0x6'))['db'];var utils=require(_0xbfe5('0x7'));var logger=require(_0xbfe5('0x8'))(_0xbfe5('0x9'));var config=require(_0xbfe5('0xa'));var jayson=require(_0xbfe5('0xb'));var client=jayson['client'][_0xbfe5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e4a1e,_0x196400,_0x2e525e){return new BPromise(function(_0x4eb0c7,_0x433b5b){return client[_0xbfe5('0xd')](_0x2e4a1e,_0x2e525e)[_0xbfe5('0xe')](function(_0x240f1e){logger[_0xbfe5('0xf')](_0xbfe5('0x10'),_0x196400,'request\x20sent');logger[_0xbfe5('0x11')](_0xbfe5('0x12'),_0x196400,_0xbfe5('0x13'),JSON[_0xbfe5('0x14')](_0x240f1e));if(_0x240f1e[_0xbfe5('0x15')]){if(_0x240f1e[_0xbfe5('0x15')]['code']===0x1f4){logger['error'](_0xbfe5('0x10'),_0x196400,_0x240f1e[_0xbfe5('0x15')][_0xbfe5('0x16')]);return _0x433b5b(_0x240f1e[_0xbfe5('0x15')][_0xbfe5('0x16')]);}logger[_0xbfe5('0x15')](_0xbfe5('0x10'),_0x196400,_0x240f1e[_0xbfe5('0x15')][_0xbfe5('0x16')]);return _0x4eb0c7(_0x240f1e[_0xbfe5('0x15')][_0xbfe5('0x16')]);}else{logger[_0xbfe5('0xf')](_0xbfe5('0x10'),_0x196400,_0xbfe5('0x13'));_0x4eb0c7(_0x240f1e['result'][_0xbfe5('0x16')]);}})[_0xbfe5('0x17')](function(_0x47e45d){logger[_0xbfe5('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0x196400,_0x47e45d);_0x433b5b(_0x47e45d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e5f0839..5bb4629 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1fd50c,_0x2e89cc){var _0x5da449=function(_0x1cdacc){while(--_0x1cdacc){_0x1fd50c['push'](_0x1fd50c['shift']());}};_0x5da449(++_0x2e89cc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0xcb91[_0x2984d0];return _0x2885f2;};'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(_0x44c37d,_0x19119f){var _0x29e087=function(_0x327fca){while(--_0x327fca){_0x44c37d['push'](_0x44c37d['shift']());}};_0x29e087(++_0x19119f);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 41ed8f3..4189aee 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 _0x703b=['exports','INTEGER','sequelize'];(function(_0x44a024,_0x1a79a9){var _0x517023=function(_0x24ddaf){while(--_0x24ddaf){_0x44a024['push'](_0x44a024['shift']());}};_0x517023(++_0x1a79a9);}(_0x703b,0x1e2));var _0xb703=function(_0x2e66e7,_0x5d2284){_0x2e66e7=_0x2e66e7-0x0;var _0x2d9d8d=_0x703b[_0x2e66e7];return _0x2d9d8d;};'use strict';var Sequelize=require(_0xb703('0x0'));module[_0xb703('0x1')]={'penalty':{'type':Sequelize[_0xb703('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc903=['INTEGER','sequelize'];(function(_0x186b08,_0x345f8c){var _0x5bc727=function(_0x960727){while(--_0x960727){_0x186b08['push'](_0x186b08['shift']());}};_0x5bc727(++_0x345f8c);}(_0xc903,0x177));var _0x3c90=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xc903[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require(_0x3c90('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x3c90('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index cbf1b6b..2c12f15 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 _0x1a71=['path','rimraf','./userMailQueue.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1eb70a,_0x2b98fd){var _0x3482b4=function(_0x43d2f9){while(--_0x43d2f9){_0x1eb70a['push'](_0x1eb70a['shift']());}};_0x3482b4(++_0x2b98fd);}(_0x1a71,0x170));var _0x11a7=function(_0x5e4219,_0x2342a0){_0x5e4219=_0x5e4219-0x0;var _0x395815=_0x1a71[_0x5e4219];return _0x395815;};'use strict';var _=require('lodash');var util=require(_0x11a7('0x0'));var logger=require(_0x11a7('0x1'))(_0x11a7('0x2'));var moment=require(_0x11a7('0x3'));var BPromise=require(_0x11a7('0x4'));var rp=require(_0x11a7('0x5'));var fs=require('fs');var path=require(_0x11a7('0x6'));var rimraf=require(_0x11a7('0x7'));var config=require('../../config/environment');var attributes=require(_0x11a7('0x8'));module[_0x11a7('0x9')]=function(_0x3457ce,_0x4a67da){return _0x3457ce[_0x11a7('0xa')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc25=['request-promise','rimraf','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xfc25,0x18c));var _0x5fc2=function(_0x46647e,_0x29729a){_0x46647e=_0x46647e-0x0;var _0x3533c5=_0xfc25[_0x46647e];return _0x3533c5;};'use strict';var _=require(_0x5fc2('0x0'));var util=require('util');var logger=require(_0x5fc2('0x1'))('api');var moment=require(_0x5fc2('0x2'));var BPromise=require(_0x5fc2('0x3'));var rp=require(_0x5fc2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fc2('0x5'));var config=require('../../config/environment');var attributes=require(_0x5fc2('0x6'));module[_0x5fc2('0x7')]=function(_0x2083e6,_0x208dda){return _0x2083e6['define'](_0x5fc2('0x8'),attributes,{'tableName':_0x5fc2('0x9'),'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 6b3b0f9..023c7bd 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 _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(_0x41bfa9,_0xd1c833){var _0x3879fd=function(_0x4b1a74){while(--_0x4b1a74){_0x41bfa9['push'](_0x41bfa9['shift']());}};_0x3879fd(++_0xd1c833);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3c3e04,_0x17b113){var _0x14135b=function(_0x185aa8){while(--_0x185aa8){_0x3c3e04['push'](_0x3c3e04['shift']());}};_0x14135b(++_0x17b113);}(_0x34e8,0x12c));var _0x834e=function(_0x59d67e,_0x4effb9){_0x59d67e=_0x59d67e-0x0;var _0x470fd3=_0x34e8[_0x59d67e];return _0x470fd3;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 58371f7..eb941b8 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 _0x004b=['sendUserNotification','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x365aff,_0x12eba4){var _0x330231=function(_0x3542e9){while(--_0x3542e9){_0x365aff['push'](_0x365aff['shift']());}};_0x330231(++_0x12eba4);}(_0x004b,0x199));var _0xb004=function(_0x344d8d,_0x510fea){_0x344d8d=_0x344d8d-0x0;var _0x335c35=_0x004b[_0x344d8d];return _0x335c35;};'use strict';var multer=require('multer');var util=require(_0xb004('0x0'));var path=require(_0xb004('0x1'));var timeout=require(_0xb004('0x2'));var express=require(_0xb004('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb004('0x4'));var interaction=require(_0xb004('0x5'));var config=require(_0xb004('0x6'));var controller=require(_0xb004('0x7'));router[_0xb004('0x8')]('/',auth['isAuthenticated'](),controller[_0xb004('0x9')]);module[_0xb004('0xa')]=router; \ No newline at end of file +var _0xfa5b=['../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','express','Router','fs-extra'];(function(_0x599f50,_0x240490){var _0x3e0c27=function(_0x2c77e3){while(--_0x2c77e3){_0x599f50['push'](_0x599f50['shift']());}};_0x3e0c27(++_0x240490);}(_0xfa5b,0xde));var _0xbfa5=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xfa5b[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0xbfa5('0x0'));var util=require(_0xbfa5('0x1'));var path=require(_0xbfa5('0x2'));var timeout=require('connect-timeout');var express=require(_0xbfa5('0x3'));var router=express[_0xbfa5('0x4')]();var fs_extra=require(_0xbfa5('0x5'));var auth=require(_0xbfa5('0x6'));var interaction=require(_0xbfa5('0x7'));var config=require('../../config/environment');var controller=require(_0xbfa5('0x8'));router[_0xbfa5('0x9')]('/',auth[_0xbfa5('0xa')](),controller['sendUserNotification']);module[_0xbfa5('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 4d02777..1059a7b 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 _0x3a33=['BOOLEAN','sequelize','exports','STRING'];(function(_0x252874,_0x1d89a3){var _0x4c0201=function(_0x387ecb){while(--_0x387ecb){_0x252874['push'](_0x252874['shift']());}};_0x4c0201(++_0x1d89a3);}(_0x3a33,0x1ad));var _0x33a3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3a33[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0x33a3('0x0'));module[_0x33a3('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x33a3('0x2')]},'beep':{'type':Sequelize[_0x33a3('0x3')]}}; \ No newline at end of file +var _0x071f=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x382fba,_0x21bc5e){var _0x12fc0b=function(_0x2b6618){while(--_0x2b6618){_0x382fba['push'](_0x382fba['shift']());}};_0x12fc0b(++_0x21bc5e);}(_0x071f,0xb3));var _0xf071=function(_0x4a9ee4,_0x28c346){_0x4a9ee4=_0x4a9ee4-0x0;var _0x2810db=_0x071f[_0x4a9ee4];return _0x2810db;};'use strict';var Sequelize=require(_0xf071('0x0'));module[_0xf071('0x1')]={'body':{'type':Sequelize[_0xf071('0x2')]},'senderName':{'type':Sequelize[_0xf071('0x3')]},'recipientsId':{'type':Sequelize[_0xf071('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xf071('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 9e283b7..dd91586 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 _0xcf1a=['includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','recipient','userNotification:send','catch','text','Template','findOne','html','forEach','User','union','ids','queue','replace','push','all','map','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','whatsappqueue','team','some'];(function(_0x4512b9,_0x3c35b1){var _0x28b7b7=function(_0x22a192){while(--_0x22a192){_0x4512b9['push'](_0x4512b9['shift']());}};_0x28b7b7(++_0x3c35b1);}(_0xcf1a,0x1ce));var _0xacf1=function(_0x46f9fc,_0x30b951){_0x46f9fc=_0x46f9fc-0x0;var _0x4eca28=_0xcf1a[_0x46f9fc];return _0x4eca28;};'use strict';var emlformat=require(_0xacf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xacf1('0x1'));var jsonpatch=require(_0xacf1('0x2'));var rp=require(_0xacf1('0x3'));var moment=require('moment');var BPromise=require(_0xacf1('0x4'));var Mustache=require(_0xacf1('0x5'));var util=require('util');var path=require(_0xacf1('0x6'));var sox=require('sox');var csv=require(_0xacf1('0x7'));var ejs=require(_0xacf1('0x8'));var fs=require('fs');var fs_extra=require(_0xacf1('0x9'));var _=require(_0xacf1('0xa'));var squel=require(_0xacf1('0xb'));var crypto=require('crypto');var jsforce=require(_0xacf1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xacf1('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xacf1('0xe'));var qs=require(_0xacf1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacf1('0x10'));var logger=require(_0xacf1('0x11'))(_0xacf1('0x12'));var utils=require('../../config/utils');var config=require(_0xacf1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xacf1('0x14')]=_[_0xacf1('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xacf1('0x16'))(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x196de0,_0x5e19bf){_0x5e19bf=_0x5e19bf||0xcc;return function(_0x56fc4b){if(_0x56fc4b){return _0x196de0['sendStatus'](_0x5e19bf);}return _0x196de0[_0xacf1('0x17')](_0x5e19bf)[_0xacf1('0x18')]();};}function respondWithResult(_0x1f4868,_0x2831f8){_0x2831f8=_0x2831f8||0xc8;return function(_0x2d34cd){if(_0x2d34cd){return _0x1f4868[_0xacf1('0x17')](_0x2831f8)[_0xacf1('0x19')](_0x2d34cd);}};}function respondWithFilteredResult(_0x4a2fc2,_0x4ca078){return function(_0x5f2bf1){if(_0x5f2bf1){var _0x385bc1=typeof _0x4ca078[_0xacf1('0x1a')]===_0xacf1('0x1b')&&typeof _0x4ca078['limit']===_0xacf1('0x1b');var _0x400e5e=_0x5f2bf1['count'];var _0x4741da=_0x385bc1?0x0:_0x4ca078[_0xacf1('0x1a')];var _0x45d7d2=_0x385bc1?_0x5f2bf1[_0xacf1('0x1c')]:_0x4ca078[_0xacf1('0x1a')]+_0x4ca078[_0xacf1('0x1d')];var _0xb71a34;if(_0x45d7d2>=_0x400e5e){_0x45d7d2=_0x400e5e;_0xb71a34=0xc8;}else{_0xb71a34=0xce;}_0x4a2fc2['status'](_0xb71a34);return _0x4a2fc2[_0xacf1('0x1e')](_0xacf1('0x1f'),_0x4741da+'-'+_0x45d7d2+'/'+_0x400e5e)['json'](_0x5f2bf1);}return null;};}function patchUpdates(_0x546e90){return function(_0x5553a9){try{jsonpatch['apply'](_0x5553a9,_0x546e90,!![]);}catch(_0x1dfc8f){return BPromise['reject'](_0x1dfc8f);}return _0x5553a9[_0xacf1('0x20')]();};}function saveUpdates(_0x1bd282,_0x437dea){return function(_0x1cd846){if(_0x1cd846){return _0x1cd846['update'](_0x1bd282)[_0xacf1('0x21')](function(_0x40fd47){return _0x40fd47;});}return null;};}function removeEntity(_0x9713fe,_0x10a6b7){return function(_0x217707){if(_0x217707){return _0x217707['destroy']()['then'](function(){_0x9713fe[_0xacf1('0x17')](0xcc)[_0xacf1('0x18')]();});}};}function handleEntityNotFound(_0x2d7f90,_0x15bbd9){return function(_0x31a82a){if(!_0x31a82a){_0x2d7f90['sendStatus'](0x194);}return _0x31a82a;};}function handleError(_0x31d8e6,_0x5d5644){_0x5d5644=_0x5d5644||0x1f4;return function(_0x14b8a6){logger[_0xacf1('0x22')](_0x14b8a6[_0xacf1('0x23')]);if(_0x14b8a6[_0xacf1('0x24')]){delete _0x14b8a6[_0xacf1('0x24')];}_0x31d8e6[_0xacf1('0x17')](_0x5d5644)[_0xacf1('0x25')](_0x14b8a6);};}exports[_0xacf1('0x26')]=function(_0x1f1281,_0x422a17,_0x20bab6){if(!_0x1f1281[_0xacf1('0x27')]['hasOwnProperty']('text')&&!_0x1f1281[_0xacf1('0x27')][_0xacf1('0x28')](_0xacf1('0x29'))){throw new db[(_0xacf1('0x2a'))][(_0xacf1('0x2b'))](_0xacf1('0x2c'));}else{if(_0x1f1281[_0xacf1('0x27')]['hasOwnProperty'](_0xacf1('0x29'))&&!_0x1f1281[_0xacf1('0x27')][_0xacf1('0x28')](_0xacf1('0x2d'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x1f1281[_0xacf1('0x27')][_0xacf1('0x28')](_0xacf1('0x2e'))){throw new db[(_0xacf1('0x2a'))][(_0xacf1('0x2b'))](_0xacf1('0x2f'));}else{try{var _0x3e6af6=JSON[_0xacf1('0x30')](_0x1f1281['body'][_0xacf1('0x2e')]);}catch(_0x81b1cc){logger['error'](_0x81b1cc);throw new db[(_0xacf1('0x2a'))][(_0xacf1('0x2b'))](_0xacf1('0x31'));}var _0x3f2c7a=['chatqueue',_0xacf1('0x32'),'mailqueue','openchannelqueue','smsqueue','voicequeue',_0xacf1('0x33'),_0xacf1('0x34'),'user'];if(_[_0xacf1('0x35')](_0x3e6af6,function(_0x26917d){return!_[_0xacf1('0x36')](_0x3f2c7a,_0x26917d[_0xacf1('0x37')]['toLowerCase']());})){throw new db['Sequelize'][(_0xacf1('0x2b'))](_0xacf1('0x38'));}}}var _0x4f94d9={};_0x4f94d9[_0xacf1('0x39')]=_0x1f1281[_0xacf1('0x27')][_0xacf1('0x28')](_0xacf1('0x39'))?_0x1f1281['body'][_0xacf1('0x39')]:_0x1f1281[_0xacf1('0x3a')][_0xacf1('0x3b')];_0x4f94d9[_0xacf1('0x3c')]=_[_0xacf1('0x3d')](_0x1f1281[_0xacf1('0x27')][_0xacf1('0x3c')])?null:_0x1f1281[_0xacf1('0x27')][_0xacf1('0x3c')];_0x4f94d9[_0xacf1('0x3e')]=_0x1f1281[_0xacf1('0x27')][_0xacf1('0x3e')]||![];_0x4f94d9[_0xacf1('0x3f')]=_0x1f1281[_0xacf1('0x3a')]['id'];return getContent(_0x1f1281['body'])[_0xacf1('0x21')](function(_0xaf5a2d){_0x4f94d9[_0xacf1('0x27')]=_0xaf5a2d;return getRecipients(_0x3e6af6);})[_0xacf1('0x21')](function(_0x214775){_0x4f94d9[_0xacf1('0x40')]=_[_0xacf1('0x41')](_0x214775)[_0xacf1('0x42')](',');return db[_0xacf1('0x43')][_0xacf1('0x44')](function(_0x324a8c){return db['UserNotification'][_0xacf1('0x45')](_0x4f94d9,{'raw':!![],'transaction':_0x324a8c})['then'](function(_0x7608db){var _0xf7ea35={'sender':_0x4f94d9[_0xacf1('0x39')],'description':_0x4f94d9['recipientsDescription'],'content':_0x4f94d9['body'],'beep':_0x4f94d9['beep']};_0x214775['forEach'](function(_0x3405c3){_0xf7ea35[_0xacf1('0x46')]=_0x3405c3;socket['emit'](_0xacf1('0x47'),_0xf7ea35);});return _0x7608db;});});})['then'](respondWithResult(_0x422a17,0xc9))[_0xacf1('0x48')](handleError(_0x422a17,null));};function getContent(_0x5c50d4){return new BPromise(function(_0x7b78b5,_0x2439e8){if(_0x5c50d4[_0xacf1('0x49')]){_0x7b78b5(_0x5c50d4[_0xacf1('0x49')]);return;}return db[_0xacf1('0x4a')][_0xacf1('0x4b')]({'attributes':['html'],'where':{'id':_0x5c50d4[_0xacf1('0x29')]},'raw':!![]})['then'](function(_0x1e5c7b){if(!_0x1e5c7b)throw new db[(_0xacf1('0x2a'))][(_0xacf1('0x2b'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x353855=Mustache['render'](_0x1e5c7b[_0xacf1('0x4c')],_0x5c50d4[_0xacf1('0x2d')]);_0x7b78b5(_0x353855);})[_0xacf1('0x48')](function(_0x52849c){_0x2439e8(_0x52849c);});});}function getRecipients(_0x4f2e90){return new BPromise(function(_0x8f890f,_0x13b22b){var _0x16ee15=[];var _0x62c7d3=[];_0x4f2e90[_0xacf1('0x4d')](function(_0x27351b){var _0x4f9e68=_['startCase'](_0x27351b['model']['toLowerCase']());if(_0x4f9e68===_0xacf1('0x4e')){_0x16ee15=_[_0xacf1('0x4f')](_0x16ee15,_0x27351b[_0xacf1('0x50')]);}else{if(_[_0xacf1('0x36')](_0x4f9e68,_0xacf1('0x51')))_0x4f9e68=_0x4f9e68[_0xacf1('0x52')]('queue','Queue');_0x27351b[_0xacf1('0x50')][_0xacf1('0x4d')](function(_0x176c62){_0x62c7d3[_0xacf1('0x53')](getAgents(_0x4f9e68,_0x176c62));});}});return BPromise[_0xacf1('0x54')](_0x62c7d3)[_0xacf1('0x21')](function(_0x3fe30f){_0x16ee15=_['union'](_0x16ee15,_['flatten'](_0x3fe30f));_0x8f890f(_0x16ee15);})['catch'](function(_0x381879){_0x13b22b(_0x381879);});});}function getAgents(_0x3c1187,_0x2e8e9c){return new BPromise(function(_0x3340b9,_0x438313){return db[_0x3c1187][_0xacf1('0x4b')]({'where':{'id':_0x2e8e9c}})[_0xacf1('0x21')](function(_0x397170){return _0x397170['getAgents']({'attributes':['id'],'raw':!![]})[_0xacf1('0x21')](function(_0x3545c1){var _0x587710=_[_0xacf1('0x55')](_0x3545c1,'id');_0x3340b9(_0x587710);});})['catch'](function(_0x3b3241){_0x438313(_0x3b3241);});});} \ No newline at end of file +var _0x508a=['ValidationError','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','beep','sortBy','join','transaction','create','forEach','emit','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','queue','replace','Queue','push','all','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view'];(function(_0x19042e,_0x9b8a76){var _0x2253c7=function(_0x52f51d){while(--_0x52f51d){_0x19042e['push'](_0x19042e['shift']());}};_0x2253c7(++_0x9b8a76);}(_0x508a,0x8c));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa508('0x0'));var rimraf=require(_0xa508('0x1'));var zipdir=require(_0xa508('0x2'));var jsonpatch=require(_0xa508('0x3'));var rp=require(_0xa508('0x4'));var moment=require('moment');var BPromise=require(_0xa508('0x5'));var Mustache=require(_0xa508('0x6'));var util=require(_0xa508('0x7'));var path=require(_0xa508('0x8'));var sox=require('sox');var csv=require(_0xa508('0x9'));var ejs=require(_0xa508('0xa'));var fs=require('fs');var fs_extra=require(_0xa508('0xb'));var _=require(_0xa508('0xc'));var squel=require(_0xa508('0xd'));var crypto=require(_0xa508('0xe'));var jsforce=require(_0xa508('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa508('0x9'));var querystring=require(_0xa508('0x10'));var Papa=require(_0xa508('0x11'));var Redis=require(_0xa508('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa508('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa508('0x14'));var logger=require(_0xa508('0x15'))(_0xa508('0x16'));var utils=require(_0xa508('0x17'));var config=require(_0xa508('0x18'));var licenseUtil=require(_0xa508('0x19'));var db=require('../../mysqldb')['db'];config[_0xa508('0x1a')]=_[_0xa508('0x1b')](config[_0xa508('0x1a')],{'host':_0xa508('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa508('0x1a')]));require('./userNotification.socket')[_0xa508('0x1d')](socket);function respondWithStatusCode(_0x44cd94,_0x178332){_0x178332=_0x178332||0xcc;return function(_0x479c48){if(_0x479c48){return _0x44cd94[_0xa508('0x1e')](_0x178332);}return _0x44cd94[_0xa508('0x1f')](_0x178332)[_0xa508('0x20')]();};}function respondWithResult(_0xbbc67b,_0xf5e9fd){_0xf5e9fd=_0xf5e9fd||0xc8;return function(_0x5c276f){if(_0x5c276f){return _0xbbc67b[_0xa508('0x1f')](_0xf5e9fd)[_0xa508('0x21')](_0x5c276f);}};}function respondWithFilteredResult(_0x1e3132,_0xa8aa81){return function(_0x45fd8e){if(_0x45fd8e){var _0x92d51c=typeof _0xa8aa81['offset']==='undefined'&&typeof _0xa8aa81[_0xa508('0x22')]===_0xa508('0x23');var _0xc1af3b=_0x45fd8e['count'];var _0x541f2b=_0x92d51c?0x0:_0xa8aa81[_0xa508('0x24')];var _0x27e32f=_0x92d51c?_0x45fd8e[_0xa508('0x25')]:_0xa8aa81[_0xa508('0x24')]+_0xa8aa81[_0xa508('0x22')];var _0x2ad22f;if(_0x27e32f>=_0xc1af3b){_0x27e32f=_0xc1af3b;_0x2ad22f=0xc8;}else{_0x2ad22f=0xce;}_0x1e3132[_0xa508('0x1f')](_0x2ad22f);return _0x1e3132[_0xa508('0x26')](_0xa508('0x27'),_0x541f2b+'-'+_0x27e32f+'/'+_0xc1af3b)['json'](_0x45fd8e);}return null;};}function patchUpdates(_0xe3e2cf){return function(_0x57ac14){try{jsonpatch[_0xa508('0x28')](_0x57ac14,_0xe3e2cf,!![]);}catch(_0x3b7a0d){return BPromise[_0xa508('0x29')](_0x3b7a0d);}return _0x57ac14[_0xa508('0x2a')]();};}function saveUpdates(_0x2877e3,_0x40d79e){return function(_0xbaf74b){if(_0xbaf74b){return _0xbaf74b[_0xa508('0x2b')](_0x2877e3)[_0xa508('0x2c')](function(_0x24937a){return _0x24937a;});}return null;};}function removeEntity(_0x36a99f,_0x131d02){return function(_0x385272){if(_0x385272){return _0x385272[_0xa508('0x2d')]()[_0xa508('0x2c')](function(){_0x36a99f[_0xa508('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ede06,_0x422827){return function(_0x50f7be){if(!_0x50f7be){_0x3ede06[_0xa508('0x1e')](0x194);}return _0x50f7be;};}function handleError(_0x6b29f1,_0x23bfb7){_0x23bfb7=_0x23bfb7||0x1f4;return function(_0x404a5b){logger[_0xa508('0x2e')](_0x404a5b[_0xa508('0x2f')]);if(_0x404a5b[_0xa508('0x30')]){delete _0x404a5b['name'];}_0x6b29f1['status'](_0x23bfb7)[_0xa508('0x31')](_0x404a5b);};}exports[_0xa508('0x32')]=function(_0x33474a,_0x9617a1,_0x4e7bc6){if(!_0x33474a['body'][_0xa508('0x33')](_0xa508('0x34'))&&!_0x33474a[_0xa508('0x35')][_0xa508('0x33')]('TemplateId')){throw new db[(_0xa508('0x36'))]['ValidationError'](_0xa508('0x37'));}else{if(_0x33474a[_0xa508('0x35')]['hasOwnProperty'](_0xa508('0x38'))&&!_0x33474a[_0xa508('0x35')][_0xa508('0x33')](_0xa508('0x39'))){throw new db[(_0xa508('0x36'))][(_0xa508('0x3a'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x33474a[_0xa508('0x35')][_0xa508('0x33')](_0xa508('0x3b'))){throw new db['Sequelize'][(_0xa508('0x3a'))](_0xa508('0x3c'));}else{try{var _0x18dfe4=JSON[_0xa508('0x3d')](_0x33474a[_0xa508('0x35')]['recipients']);}catch(_0x2d4502){logger[_0xa508('0x2e')](_0x2d4502);throw new db[(_0xa508('0x36'))][(_0xa508('0x3a'))](_0xa508('0x3e'));}var _0x152a17=[_0xa508('0x3f'),'faxqueue',_0xa508('0x40'),_0xa508('0x41'),_0xa508('0x42'),'voicequeue',_0xa508('0x43'),'team',_0xa508('0x44')];if(_[_0xa508('0x45')](_0x18dfe4,function(_0x5b6a6b){return!_[_0xa508('0x46')](_0x152a17,_0x5b6a6b[_0xa508('0x47')][_0xa508('0x48')]());})){throw new db[(_0xa508('0x36'))][(_0xa508('0x3a'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x2dc1d3={};_0x2dc1d3[_0xa508('0x49')]=_0x33474a[_0xa508('0x35')][_0xa508('0x33')](_0xa508('0x49'))?_0x33474a[_0xa508('0x35')][_0xa508('0x49')]:_0x33474a[_0xa508('0x44')][_0xa508('0x4a')];_0x2dc1d3['recipientsDescription']=_['isEmpty'](_0x33474a[_0xa508('0x35')][_0xa508('0x4b')])?null:_0x33474a[_0xa508('0x35')]['recipientsDescription'];_0x2dc1d3[_0xa508('0x4c')]=_0x33474a[_0xa508('0x35')][_0xa508('0x4c')]||![];_0x2dc1d3['SenderId']=_0x33474a['user']['id'];return getContent(_0x33474a[_0xa508('0x35')])[_0xa508('0x2c')](function(_0x2c63d7){_0x2dc1d3[_0xa508('0x35')]=_0x2c63d7;return getRecipients(_0x18dfe4);})[_0xa508('0x2c')](function(_0x889233){_0x2dc1d3['recipientsId']=_[_0xa508('0x4d')](_0x889233)[_0xa508('0x4e')](',');return db['sequelize'][_0xa508('0x4f')](function(_0x216c64){return db['UserNotification'][_0xa508('0x50')](_0x2dc1d3,{'raw':!![],'transaction':_0x216c64})[_0xa508('0x2c')](function(_0x568193){var _0x4d9232={'sender':_0x2dc1d3['senderName'],'description':_0x2dc1d3[_0xa508('0x4b')],'content':_0x2dc1d3['body'],'beep':_0x2dc1d3['beep']};_0x889233[_0xa508('0x51')](function(_0x1898e3){_0x4d9232['recipient']=_0x1898e3;socket[_0xa508('0x52')]('userNotification:send',_0x4d9232);});return _0x568193;});});})[_0xa508('0x2c')](respondWithResult(_0x9617a1,0xc9))[_0xa508('0x53')](handleError(_0x9617a1,null));};function getContent(_0x453203){return new BPromise(function(_0x37ede7,_0x3e4955){if(_0x453203['text']){_0x37ede7(_0x453203[_0xa508('0x34')]);return;}return db[_0xa508('0x54')][_0xa508('0x55')]({'attributes':['html'],'where':{'id':_0x453203[_0xa508('0x38')]},'raw':!![]})[_0xa508('0x2c')](function(_0x33c17c){if(!_0x33c17c)throw new db[(_0xa508('0x36'))]['ValidationError'](_0xa508('0x56'));var _0x4f000=Mustache[_0xa508('0x57')](_0x33c17c[_0xa508('0x58')],_0x453203[_0xa508('0x39')]);_0x37ede7(_0x4f000);})[_0xa508('0x53')](function(_0x78ac39){_0x3e4955(_0x78ac39);});});}function getRecipients(_0x203ba2){return new BPromise(function(_0x25d7d4,_0x319a55){var _0x5d7c13=[];var _0x2f8157=[];_0x203ba2['forEach'](function(_0x364410){var _0x1503a2=_[_0xa508('0x59')](_0x364410[_0xa508('0x47')][_0xa508('0x48')]());if(_0x1503a2===_0xa508('0x5a')){_0x5d7c13=_[_0xa508('0x5b')](_0x5d7c13,_0x364410[_0xa508('0x5c')]);}else{if(_[_0xa508('0x46')](_0x1503a2,_0xa508('0x5d')))_0x1503a2=_0x1503a2[_0xa508('0x5e')](_0xa508('0x5d'),_0xa508('0x5f'));_0x364410['ids']['forEach'](function(_0x2a2472){_0x2f8157[_0xa508('0x60')](getAgents(_0x1503a2,_0x2a2472));});}});return BPromise[_0xa508('0x61')](_0x2f8157)[_0xa508('0x2c')](function(_0x52f98f){_0x5d7c13=_[_0xa508('0x5b')](_0x5d7c13,_['flatten'](_0x52f98f));_0x25d7d4(_0x5d7c13);})[_0xa508('0x53')](function(_0x357d27){_0x319a55(_0x357d27);});});}function getAgents(_0x4785fc,_0x5a20a8){return new BPromise(function(_0x596c16,_0x43183c){return db[_0x4785fc]['findOne']({'where':{'id':_0x5a20a8}})['then'](function(_0x2a8649){return _0x2a8649[_0xa508('0x62')]({'attributes':['id'],'raw':!![]})[_0xa508('0x2c')](function(_0x56aa31){var _0x1c6139=_['map'](_0x56aa31,'id');_0x596c16(_0x1c6139);});})[_0xa508('0x53')](function(_0x35aaa9){_0x43183c(_0x35aaa9);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index bfe3c27..5a2a518 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 _0x8491=['setMaxListeners','save','update','emit','hasOwnProperty','../../mysqldb','UserNotification'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8491,0xf3));var _0x1849=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x8491[_0x243b59];return _0x3e1676;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x1849('0x0'))['db'][_0x1849('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1849('0x2')](0x0);var events={'afterCreate':_0x1849('0x3'),'afterUpdate':_0x1849('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d441b){return function(_0x2b6d5e,_0x2a1d46,_0x24e754){UserNotificationEvents[_0x1849('0x5')](_0x1d441b+':'+_0x2b6d5e['id'],_0x2b6d5e);UserNotificationEvents[_0x1849('0x5')](_0x1d441b,_0x2b6d5e);_0x24e754(null);};}for(var e in events){if(events[_0x1849('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x23da=['hook','events','../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x23da,0x1c3));var _0xa23d=function(_0x20a737,_0x23e878){_0x20a737=_0x20a737-0x0;var _0x1bd213=_0x23da[_0x20a737];return _0x1bd213;};'use strict';var EventEmitter=require(_0xa23d('0x0'));var UserNotification=require(_0xa23d('0x1'))['db'][_0xa23d('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa23d('0x3')](0x0);var events={'afterCreate':_0xa23d('0x4'),'afterUpdate':'update','afterDestroy':_0xa23d('0x5')};function emitEvent(_0x577a0d){return function(_0x334f03,_0x4c19e8,_0x5be959){UserNotificationEvents[_0xa23d('0x6')](_0x577a0d+':'+_0x334f03['id'],_0x334f03);UserNotificationEvents[_0xa23d('0x6')](_0x577a0d,_0x334f03);_0x5be959(null);};}for(var e in events){if(events[_0xa23d('0x7')](e)){var event=events[e];UserNotification[_0xa23d('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 6463e38..336d54d 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 _0x75cf=['exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x75cf,0x156));var _0xf75c=function(_0x568a4b,_0x513782){_0x568a4b=_0x568a4b-0x0;var _0x5ba3d8=_0x75cf[_0x568a4b];return _0x5ba3d8;};'use strict';var _=require('lodash');var util=require(_0xf75c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf75c('0x1'));var BPromise=require(_0xf75c('0x2'));var rp=require(_0xf75c('0x3'));var fs=require('fs');var path=require(_0xf75c('0x4'));var rimraf=require(_0xf75c('0x5'));var config=require(_0xf75c('0x6'));var attributes=require(_0xf75c('0x7'));module[_0xf75c('0x8')]=function(_0x3a33a3,_0xcedd91){return _0x3a33a3[_0xf75c('0x9')](_0xf75c('0xa'),attributes,{'tableName':_0xf75c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf75c('0xc'),'collate':_0xf75c('0xd')});}; \ No newline at end of file +var _0x87a3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','userNotifications'];(function(_0x963633,_0x4e1444){var _0x49bed0=function(_0x165602){while(--_0x165602){_0x963633['push'](_0x963633['shift']());}};_0x49bed0(++_0x4e1444);}(_0x87a3,0x18e));var _0x387a=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x87a3[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x387a('0x0'));var util=require(_0x387a('0x1'));var logger=require(_0x387a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x387a('0x3'));var config=require(_0x387a('0x4'));var attributes=require(_0x387a('0x5'));module['exports']=function(_0x12d924,_0x549810){return _0x12d924[_0x387a('0x6')](_0x387a('0x7'),attributes,{'tableName':_0x387a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x387a('0x9'),'collate':_0x387a('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 2c9b2f8..00f4325 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 _0x95c0=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x4383e9,_0xa4b307){var _0x355405=function(_0x545b5b){while(--_0x545b5b){_0x4383e9['push'](_0x4383e9['shift']());}};_0x355405(++_0xa4b307);}(_0x95c0,0x1dd));var _0x095c=function(_0x34114f,_0x31ab33){_0x34114f=_0x34114f-0x0;var _0xff5ee9=_0x95c0[_0x34114f];return _0xff5ee9;};'use strict';var _=require(_0x095c('0x0'));var util=require(_0x095c('0x1'));var moment=require(_0x095c('0x2'));var BPromise=require(_0x095c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x095c('0x4'));var db=require(_0x095c('0x5'))['db'];var utils=require(_0x095c('0x6'));var logger=require(_0x095c('0x7'))(_0x095c('0x8'));var config=require(_0x095c('0x9'));var jayson=require(_0x095c('0xa'));var client=jayson[_0x095c('0xb')]['http']({'port':0x232a});config[_0x095c('0xc')]=_[_0x095c('0xd')](config[_0x095c('0xc')],{'host':_0x095c('0xe'),'port':0x18eb});var socket=require(_0x095c('0xf'))(new Redis(config[_0x095c('0xc')]));require(_0x095c('0x10'))[_0x095c('0x11')](socket);function respondWithRpcPromise(_0x1dbf02,_0x5db2c0,_0x33b3ed){return new BPromise(function(_0x501709,_0x2dc54d){return client[_0x095c('0x12')](_0x1dbf02,_0x33b3ed)[_0x095c('0x13')](function(_0x2cb6c7){logger[_0x095c('0x14')]('UserNotification,\x20%s,\x20%s',_0x5db2c0,_0x095c('0x15'));logger['debug'](_0x095c('0x16'),_0x5db2c0,_0x095c('0x15'),JSON[_0x095c('0x17')](_0x2cb6c7));if(_0x2cb6c7[_0x095c('0x18')]){if(_0x2cb6c7['error'][_0x095c('0x19')]===0x1f4){logger[_0x095c('0x18')](_0x095c('0x1a'),_0x5db2c0,_0x2cb6c7['error'][_0x095c('0x1b')]);return _0x2dc54d(_0x2cb6c7['error'][_0x095c('0x1b')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x5db2c0,_0x2cb6c7[_0x095c('0x18')]['message']);return _0x501709(_0x2cb6c7[_0x095c('0x18')][_0x095c('0x1b')]);}else{logger['info'](_0x095c('0x1a'),_0x5db2c0,_0x095c('0x15'));_0x501709(_0x2cb6c7[_0x095c('0x1c')]['message']);}})[_0x095c('0x1d')](function(_0x24d39e){logger[_0x095c('0x18')]('UserNotification,\x20%s,\x20%s',_0x5db2c0,_0x24d39e);_0x2dc54d(_0x24d39e);});});} \ No newline at end of file +var _0xeefd=['localhost','socket.io-emitter','./userNotification.socket','register','request','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserNotification,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis'];(function(_0x20008a,_0x362490){var _0x5d0f1c=function(_0x122ecf){while(--_0x122ecf){_0x20008a['push'](_0x20008a['shift']());}};_0x5d0f1c(++_0x362490);}(_0xeefd,0xf7));var _0xdeef=function(_0x44a7c0,_0x338bdc){_0x44a7c0=_0x44a7c0-0x0;var _0x179be0=_0xeefd[_0x44a7c0];return _0x179be0;};'use strict';var _=require(_0xdeef('0x0'));var util=require('util');var moment=require(_0xdeef('0x1'));var BPromise=require(_0xdeef('0x2'));var rs=require(_0xdeef('0x3'));var fs=require('fs');var Redis=require(_0xdeef('0x4'));var db=require(_0xdeef('0x5'))['db'];var utils=require(_0xdeef('0x6'));var logger=require(_0xdeef('0x7'))(_0xdeef('0x8'));var config=require(_0xdeef('0x9'));var jayson=require(_0xdeef('0xa'));var client=jayson[_0xdeef('0xb')]['http']({'port':0x232a});config['redis']=_[_0xdeef('0xc')](config[_0xdeef('0xd')],{'host':_0xdeef('0xe'),'port':0x18eb});var socket=require(_0xdeef('0xf'))(new Redis(config[_0xdeef('0xd')]));require(_0xdeef('0x10'))[_0xdeef('0x11')](socket);function respondWithRpcPromise(_0x324b19,_0x3289c4,_0x2fda8e){return new BPromise(function(_0x3c363e,_0x5c7db6){return client[_0xdeef('0x12')](_0x324b19,_0x2fda8e)['then'](function(_0x506147){logger[_0xdeef('0x13')]('UserNotification,\x20%s,\x20%s',_0x3289c4,_0xdeef('0x14'));logger[_0xdeef('0x15')](_0xdeef('0x16'),_0x3289c4,_0xdeef('0x14'),JSON[_0xdeef('0x17')](_0x506147));if(_0x506147[_0xdeef('0x18')]){if(_0x506147[_0xdeef('0x18')][_0xdeef('0x19')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x3289c4,_0x506147[_0xdeef('0x18')][_0xdeef('0x1a')]);return _0x5c7db6(_0x506147['error']['message']);}logger[_0xdeef('0x18')]('UserNotification,\x20%s,\x20%s',_0x3289c4,_0x506147['error'][_0xdeef('0x1a')]);return _0x3c363e(_0x506147[_0xdeef('0x18')][_0xdeef('0x1a')]);}else{logger['info'](_0xdeef('0x1b'),_0x3289c4,_0xdeef('0x14'));_0x3c363e(_0x506147['result'][_0xdeef('0x1a')]);}})[_0xdeef('0x1c')](function(_0x10439f){logger[_0xdeef('0x18')](_0xdeef('0x1b'),_0x3289c4,_0x10439f);_0x5c7db6(_0x10439f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index cd7a692..f599a46 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 _0xa0da=['userNotification:','save','remove','update','emit','removeListener','register'];(function(_0x3d9b50,_0x579185){var _0x41a93d=function(_0x55e2a3){while(--_0x55e2a3){_0x3d9b50['push'](_0x3d9b50['shift']());}};_0x41a93d(++_0x579185);}(_0xa0da,0x104));var _0xaa0d=function(_0x59ec5f,_0x379563){_0x59ec5f=_0x59ec5f-0x0;var _0x455b03=_0xa0da[_0x59ec5f];return _0x455b03;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xaa0d('0x0'),_0xaa0d('0x1'),_0xaa0d('0x2')];function createListener(_0x21821a,_0x302309){return function(_0x582fb3){_0x302309[_0xaa0d('0x3')](_0x21821a,_0x582fb3);};}function removeListener(_0x2c3747,_0x45c51c){return function(){UserNotificationEvents[_0xaa0d('0x4')](_0x2c3747,_0x45c51c);};}exports[_0xaa0d('0x5')]=function(_0x5cb3fc){for(var _0x29af55=0x0,_0xb38480=events['length'];_0x29af55<_0xb38480;_0x29af55++){var _0x2f9f4a=events[_0x29af55];var _0x5de311=createListener(_0xaa0d('0x6')+_0x2f9f4a,_0x5cb3fc);UserNotificationEvents['on'](_0x2f9f4a,_0x5de311);}}; \ No newline at end of file +var _0x7702=['register','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x376f79,_0x9cf283){var _0x3f3656=function(_0x5e30e0){while(--_0x5e30e0){_0x376f79['push'](_0x376f79['shift']());}};_0x3f3656(++_0x9cf283);}(_0x7702,0x1d6));var _0x2770=function(_0x322b26,_0x231176){_0x322b26=_0x322b26-0x0;var _0x4c510b=_0x7702[_0x322b26];return _0x4c510b;};'use strict';var UserNotificationEvents=require(_0x2770('0x0'));var events=[_0x2770('0x1'),_0x2770('0x2'),_0x2770('0x3')];function createListener(_0x594305,_0x163089){return function(_0x55fcce){_0x163089[_0x2770('0x4')](_0x594305,_0x55fcce);};}function removeListener(_0x32963f,_0x49a5c2){return function(){UserNotificationEvents[_0x2770('0x5')](_0x32963f,_0x49a5c2);};}exports[_0x2770('0x6')]=function(_0x5b3023){for(var _0x2b0f39=0x0,_0x4dca6e=events['length'];_0x2b0f39<_0x4dca6e;_0x2b0f39++){var _0x468271=events[_0x2b0f39];var _0x4f8a41=createListener('userNotification:'+_0x468271,_0x5b3023);UserNotificationEvents['on'](_0x468271,_0x4f8a41);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 505bbf9..b618bec 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1a68fd,_0x4475c7){var _0x4d6437=function(_0x342a36){while(--_0x342a36){_0x1a68fd['push'](_0x1a68fd['shift']());}};_0x4d6437(++_0x4475c7);}(_0x70e0,0x17b));var _0x070e=function(_0x401a5a,_0x5bab2b){_0x401a5a=_0x401a5a-0x0;var _0x16cbb8=_0x70e0[_0x401a5a];return _0x16cbb8;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x538eed,_0x2ca541){var _0x2a8bf9=function(_0x500dea){while(--_0x500dea){_0x538eed['push'](_0x538eed['shift']());}};_0x2a8bf9(++_0x2ca541);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 2eb56f1..f5918ad 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 _0xab2e=['exports','INTEGER','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xab2e,0x188));var _0xeab2=function(_0x244cef,_0xbce3ec){_0x244cef=_0x244cef-0x0;var _0x32139b=_0xab2e[_0x244cef];return _0x32139b;};'use strict';var Sequelize=require(_0xeab2('0x0'));module[_0xeab2('0x1')]={'penalty':{'type':Sequelize[_0xeab2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b6d=['INTEGER','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b6d,0xe7));var _0xd1b6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b6d[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0xd1b6('0x0')]={'penalty':{'type':Sequelize[_0xd1b6('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 3212683..e621855 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 _0xbbd7=['path','rimraf','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird'];(function(_0x54c613,_0x5674bc){var _0x5dacd0=function(_0x588f5c){while(--_0x588f5c){_0x54c613['push'](_0x54c613['shift']());}};_0x5dacd0(++_0x5674bc);}(_0xbbd7,0x15a));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7bbd('0x0'));var util=require('util');var logger=require(_0x7bbd('0x1'))('api');var moment=require(_0x7bbd('0x2'));var BPromise=require(_0x7bbd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7bbd('0x4'));var rimraf=require(_0x7bbd('0x5'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x7bbd('0x6')]=function(_0x1740b5,_0x301cb3){return _0x1740b5[_0x7bbd('0x7')](_0x7bbd('0x8'),attributes,{'tableName':_0x7bbd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09d6=['UserOpenchannelQueue','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define'];(function(_0x24d996,_0x1194e1){var _0x2d1700=function(_0x24668f){while(--_0x24668f){_0x24d996['push'](_0x24d996['shift']());}};_0x2d1700(++_0x1194e1);}(_0x09d6,0xfe));var _0x609d=function(_0x9ac7cc,_0x45f6f9){_0x9ac7cc=_0x9ac7cc-0x0;var _0x2f43dd=_0x09d6[_0x9ac7cc];return _0x2f43dd;};'use strict';var _=require(_0x609d('0x0'));var util=require(_0x609d('0x1'));var logger=require(_0x609d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x609d('0x3'));var rp=require(_0x609d('0x4'));var fs=require('fs');var path=require(_0x609d('0x5'));var rimraf=require(_0x609d('0x6'));var config=require('../../config/environment');var attributes=require(_0x609d('0x7'));module[_0x609d('0x8')]=function(_0x9adee4,_0x3b34e9){return _0x9adee4[_0x609d('0x9')](_0x609d('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index ef8f9f3..2cb94f2 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 _0xf5e6=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x155178,_0x5be4f3){var _0xa4b069=function(_0x592307){while(--_0x592307){_0x155178['push'](_0x155178['shift']());}};_0xa4b069(++_0x5be4f3);}(_0xf5e6,0x127));var _0x6f5e=function(_0x357681,_0x7447cc){_0x357681=_0x357681-0x0;var _0xa009ba=_0xf5e6[_0x357681];return _0xa009ba;};'use strict';var _=require(_0x6f5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6f5e('0x1'));var rs=require(_0x6f5e('0x2'));var fs=require('fs');var Redis=require(_0x6f5e('0x3'));var db=require(_0x6f5e('0x4'))['db'];var utils=require(_0x6f5e('0x5'));var logger=require(_0x6f5e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6f5e('0x7'));var client=jayson[_0x6f5e('0x8')][_0x6f5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31fb33,_0x394c18,_0x548f90){return new BPromise(function(_0x58426c,_0x454f1d){return client[_0x6f5e('0xa')](_0x31fb33,_0x548f90)[_0x6f5e('0xb')](function(_0x17fd25){logger[_0x6f5e('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x394c18,_0x6f5e('0xd'));logger['debug'](_0x6f5e('0xe'),_0x394c18,_0x6f5e('0xd'),JSON[_0x6f5e('0xf')](_0x17fd25));if(_0x17fd25[_0x6f5e('0x10')]){if(_0x17fd25[_0x6f5e('0x10')]['code']===0x1f4){logger[_0x6f5e('0x10')](_0x6f5e('0x11'),_0x394c18,_0x17fd25[_0x6f5e('0x10')]['message']);return _0x454f1d(_0x17fd25['error']['message']);}logger[_0x6f5e('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x394c18,_0x17fd25[_0x6f5e('0x10')][_0x6f5e('0x12')]);return _0x58426c(_0x17fd25[_0x6f5e('0x10')]['message']);}else{logger[_0x6f5e('0xc')](_0x6f5e('0x11'),_0x394c18,_0x6f5e('0xd'));_0x58426c(_0x17fd25['result'][_0x6f5e('0x12')]);}})[_0x6f5e('0x13')](function(_0x131403){logger[_0x6f5e('0x10')](_0x6f5e('0x11'),_0x394c18,_0x131403);_0x454f1d(_0x131403);});});} \ No newline at end of file +var _0x7233=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7233,0x185));var _0x3723=function(_0x2b49ad,_0x5cea43){_0x2b49ad=_0x2b49ad-0x0;var _0x124d59=_0x7233[_0x2b49ad];return _0x124d59;};'use strict';var _=require(_0x3723('0x0'));var util=require(_0x3723('0x1'));var moment=require(_0x3723('0x2'));var BPromise=require(_0x3723('0x3'));var rs=require(_0x3723('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3723('0x5'))['db'];var utils=require(_0x3723('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3723('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3723('0x8')][_0x3723('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14501d,_0x75c4b6,_0x105ae7){return new BPromise(function(_0x593ae3,_0x5b4db7){return client['request'](_0x14501d,_0x105ae7)[_0x3723('0xa')](function(_0x76a2f5){logger[_0x3723('0xb')](_0x3723('0xc'),_0x75c4b6,_0x3723('0xd'));logger[_0x3723('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x75c4b6,_0x3723('0xd'),JSON[_0x3723('0xf')](_0x76a2f5));if(_0x76a2f5['error']){if(_0x76a2f5['error'][_0x3723('0x10')]===0x1f4){logger[_0x3723('0x11')](_0x3723('0xc'),_0x75c4b6,_0x76a2f5[_0x3723('0x11')][_0x3723('0x12')]);return _0x5b4db7(_0x76a2f5[_0x3723('0x11')][_0x3723('0x12')]);}logger[_0x3723('0x11')](_0x3723('0xc'),_0x75c4b6,_0x76a2f5[_0x3723('0x11')][_0x3723('0x12')]);return _0x593ae3(_0x76a2f5[_0x3723('0x11')][_0x3723('0x12')]);}else{logger[_0x3723('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x75c4b6,_0x3723('0xd'));_0x593ae3(_0x76a2f5[_0x3723('0x13')][_0x3723('0x12')]);}})[_0x3723('0x14')](function(_0x4a920f){logger['error'](_0x3723('0xc'),_0x75c4b6,_0x4a920f);_0x5b4db7(_0x4a920f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 5fc6784..0a33f39 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 _0xa914=['../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','delete','destroy','removeSections','removeResources','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x458888,_0x496905){var _0x285c22=function(_0x53e0f7){while(--_0x53e0f7){_0x458888['push'](_0x458888['shift']());}};_0x285c22(++_0x496905);}(_0xa914,0x108));var _0x4a91=function(_0x13ec2b,_0x40b664){_0x13ec2b=_0x13ec2b-0x0;var _0x1fb3f4=_0xa914[_0x13ec2b];return _0x1fb3f4;};'use strict';var multer=require('multer');var util=require(_0x4a91('0x0'));var path=require('path');var timeout=require(_0x4a91('0x1'));var express=require(_0x4a91('0x2'));var router=express[_0x4a91('0x3')]();var fs_extra=require(_0x4a91('0x4'));var auth=require(_0x4a91('0x5'));var interaction=require(_0x4a91('0x6'));var config=require(_0x4a91('0x7'));var controller=require(_0x4a91('0x8'));router['get']('/',auth[_0x4a91('0x9')](),controller[_0x4a91('0xa')]);router[_0x4a91('0xb')](_0x4a91('0xc'),auth[_0x4a91('0x9')](),controller[_0x4a91('0xd')]);router['get'](_0x4a91('0xe'),auth[_0x4a91('0x9')](),controller[_0x4a91('0xf')]);router['get'](_0x4a91('0x10'),auth[_0x4a91('0x9')](),controller['getSections']);router['get'](_0x4a91('0x11'),auth[_0x4a91('0x9')](),controller[_0x4a91('0x12')]);router[_0x4a91('0x13')]('/',auth[_0x4a91('0x9')](),controller[_0x4a91('0x14')]);router[_0x4a91('0x13')](_0x4a91('0x15'),auth[_0x4a91('0x9')](),controller['clone']);router[_0x4a91('0x13')](_0x4a91('0x10'),auth[_0x4a91('0x9')](),controller[_0x4a91('0x16')]);router[_0x4a91('0x13')](_0x4a91('0x11'),auth[_0x4a91('0x9')](),controller[_0x4a91('0x17')]);router[_0x4a91('0x18')](_0x4a91('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x4a91('0x19')]('/:id',auth[_0x4a91('0x9')](),controller[_0x4a91('0x1a')]);router[_0x4a91('0x19')](_0x4a91('0x10'),auth['isAuthenticated'](),controller[_0x4a91('0x1b')]);router[_0x4a91('0x19')](_0x4a91('0x11'),auth[_0x4a91('0x9')](),controller[_0x4a91('0x1c')]);module[_0x4a91('0x1d')]=router; \ No newline at end of file +var _0x11fc=['removeResources','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','removeSections'];(function(_0x27ded3,_0x349778){var _0x1c6e69=function(_0x281831){while(--_0x281831){_0x27ded3['push'](_0x27ded3['shift']());}};_0x1c6e69(++_0x349778);}(_0x11fc,0x187));var _0xc11f=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x11fc[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0xc11f('0x0'));var path=require(_0xc11f('0x1'));var timeout=require(_0xc11f('0x2'));var express=require(_0xc11f('0x3'));var router=express['Router']();var fs_extra=require(_0xc11f('0x4'));var auth=require(_0xc11f('0x5'));var interaction=require(_0xc11f('0x6'));var config=require(_0xc11f('0x7'));var controller=require(_0xc11f('0x8'));router[_0xc11f('0x9')]('/',auth[_0xc11f('0xa')](),controller['index']);router[_0xc11f('0x9')](_0xc11f('0xb'),auth['isAuthenticated'](),controller[_0xc11f('0xc')]);router[_0xc11f('0x9')](_0xc11f('0xd'),auth[_0xc11f('0xa')](),controller[_0xc11f('0xe')]);router[_0xc11f('0x9')](_0xc11f('0xf'),auth['isAuthenticated'](),controller[_0xc11f('0x10')]);router[_0xc11f('0x9')](_0xc11f('0x11'),auth[_0xc11f('0xa')](),controller[_0xc11f('0x12')]);router[_0xc11f('0x13')]('/',auth[_0xc11f('0xa')](),controller[_0xc11f('0x14')]);router['post'](_0xc11f('0x15'),auth[_0xc11f('0xa')](),controller[_0xc11f('0x16')]);router[_0xc11f('0x13')](_0xc11f('0xf'),auth[_0xc11f('0xa')](),controller[_0xc11f('0x17')]);router['post'](_0xc11f('0x11'),auth[_0xc11f('0xa')](),controller[_0xc11f('0x18')]);router[_0xc11f('0x19')]('/:id',auth[_0xc11f('0xa')](),controller[_0xc11f('0x1a')]);router['delete'](_0xc11f('0xd'),auth[_0xc11f('0xa')](),controller['destroy']);router[_0xc11f('0x1b')](_0xc11f('0xf'),auth[_0xc11f('0xa')](),controller[_0xc11f('0x1c')]);router[_0xc11f('0x1b')]('/:id/resources',auth[_0xc11f('0xa')](),controller[_0xc11f('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 2ee0ec3..10d0dad 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 _0xd22f=['split','BOOLEAN','exports','STRING','name','crudPermissions','join','getDataValue'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd22f,0xa2));var _0xfd22=function(_0x542578,_0x1e4be4){_0x542578=_0x542578-0x0;var _0x35fa76=_0xd22f[_0x542578];return _0x35fa76;};'use strict';var Sequelize=require('sequelize');module[_0xfd22('0x0')]={'name':{'type':Sequelize[_0xfd22('0x1')],'allowNull':![],'unique':_0xfd22('0x2')},'crudPermissions':{'type':Sequelize[_0xfd22('0x1')],'set':function(_0x4142b6){this['setDataValue'](_0xfd22('0x3'),_0x4142b6?_0x4142b6[_0xfd22('0x4')](''):[]);},'get':function(){return this[_0xfd22('0x5')]('crudPermissions')?this[_0xfd22('0x5')](_0xfd22('0x3'))[_0xfd22('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xfd22('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xfd22('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xfd22('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xfd22('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfd22('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x217d=['setDataValue','crudPermissions','join','getDataValue','BOOLEAN','sequelize','STRING','name'];(function(_0x322177,_0x4a29c4){var _0x357c57=function(_0x5114c9){while(--_0x5114c9){_0x322177['push'](_0x322177['shift']());}};_0x357c57(++_0x4a29c4);}(_0x217d,0x1c5));var _0xd217=function(_0x4d251b,_0x4028d5){_0x4d251b=_0x4d251b-0x0;var _0x53b1e3=_0x217d[_0x4d251b];return _0x53b1e3;};'use strict';var Sequelize=require(_0xd217('0x0'));module['exports']={'name':{'type':Sequelize[_0xd217('0x1')],'allowNull':![],'unique':_0xd217('0x2')},'crudPermissions':{'type':Sequelize[_0xd217('0x1')],'set':function(_0x2aaf36){this[_0xd217('0x3')](_0xd217('0x4'),_0x2aaf36?_0x2aaf36[_0xd217('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xd217('0x4'))?this[_0xd217('0x6')](_0xd217('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd217('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd217('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd217('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd217('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd217('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd217('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 32dca03..a9b7ed1 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 _0xbe51=['each','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','push','UserProfileResource','findOne','forEach','resourceId','Plugin','addResources','sequelize','userProfileId','bulkCreate','removeResources','getResources','section','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','UserProfile','fieldName','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','includeAll','options','create','clone','find','get','omit','createdAt','updatedAt','crudPermissions','body','transaction','UserProfileSection','autoAssociation','sectionId','Resources','describe','addSections'];(function(_0x25a0f2,_0x27badc){var _0x166eff=function(_0x5bd8db){while(--_0x5bd8db){_0x25a0f2['push'](_0x25a0f2['shift']());}};_0x166eff(++_0x27badc);}(_0xbe51,0x1e2));var _0x1be5=function(_0x46f9ca,_0x25a771){_0x46f9ca=_0x46f9ca-0x0;var _0x49b0b4=_0xbe51[_0x46f9ca];return _0x49b0b4;};'use strict';var emlformat=require(_0x1be5('0x0'));var rimraf=require(_0x1be5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1be5('0x2'));var rp=require('request-promise');var moment=require(_0x1be5('0x3'));var BPromise=require(_0x1be5('0x4'));var Mustache=require(_0x1be5('0x5'));var util=require(_0x1be5('0x6'));var path=require(_0x1be5('0x7'));var sox=require(_0x1be5('0x8'));var csv=require(_0x1be5('0x9'));var ejs=require(_0x1be5('0xa'));var fs=require('fs');var fs_extra=require(_0x1be5('0xb'));var _=require(_0x1be5('0xc'));var squel=require(_0x1be5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1be5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1be5('0xf'));var Papa=require(_0x1be5('0x10'));var Redis=require('ioredis');var authService=require(_0x1be5('0x11'));var qs=require(_0x1be5('0x12'));var as=require(_0x1be5('0x13'));var hardwareService=require(_0x1be5('0x14'));var logger=require(_0x1be5('0x15'))(_0x1be5('0x16'));var utils=require(_0x1be5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1be5('0x18'));var db=require('../../mysqldb')['db'];config[_0x1be5('0x19')]=_[_0x1be5('0x1a')](config[_0x1be5('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1be5('0x1b'))(new Redis(config['redis']));require(_0x1be5('0x1c'))[_0x1be5('0x1d')](socket);function respondWithStatusCode(_0x1c909a,_0x13de43){_0x13de43=_0x13de43||0xcc;return function(_0x1b4d73){if(_0x1b4d73){return _0x1c909a[_0x1be5('0x1e')](_0x13de43);}return _0x1c909a[_0x1be5('0x1f')](_0x13de43)['end']();};}function respondWithResult(_0x45c2cf,_0x2c7368){_0x2c7368=_0x2c7368||0xc8;return function(_0xf1d912){if(_0xf1d912){return _0x45c2cf[_0x1be5('0x1f')](_0x2c7368)[_0x1be5('0x20')](_0xf1d912);}};}function respondWithFilteredResult(_0x292659,_0x497320){return function(_0x3a1fe3){if(_0x3a1fe3){var _0x4e777a=typeof _0x497320[_0x1be5('0x21')]===_0x1be5('0x22')&&typeof _0x497320['limit']==='undefined';var _0x5b776c=_0x3a1fe3[_0x1be5('0x23')];var _0x3c4056=_0x4e777a?0x0:_0x497320[_0x1be5('0x21')];var _0x377371=_0x4e777a?_0x3a1fe3[_0x1be5('0x23')]:_0x497320['offset']+_0x497320[_0x1be5('0x24')];var _0x554426;if(_0x377371>=_0x5b776c){_0x377371=_0x5b776c;_0x554426=0xc8;}else{_0x554426=0xce;}_0x292659['status'](_0x554426);return _0x292659[_0x1be5('0x25')](_0x1be5('0x26'),_0x3c4056+'-'+_0x377371+'/'+_0x5b776c)[_0x1be5('0x20')](_0x3a1fe3);}return null;};}function patchUpdates(_0x1d3526){return function(_0x46c66a){try{jsonpatch[_0x1be5('0x27')](_0x46c66a,_0x1d3526,!![]);}catch(_0xd3fc84){return BPromise[_0x1be5('0x28')](_0xd3fc84);}return _0x46c66a['save']();};}function saveUpdates(_0x1e7b4e,_0x4166e3){return function(_0x139988){if(_0x139988){return _0x139988[_0x1be5('0x29')](_0x1e7b4e)[_0x1be5('0x2a')](function(_0x162e7c){return _0x162e7c;});}return null;};}function removeEntity(_0x8465ff,_0x1dacfd){return function(_0x47b57c){if(_0x47b57c){return _0x47b57c[_0x1be5('0x2b')]()['then'](function(){_0x8465ff[_0x1be5('0x1f')](0xcc)[_0x1be5('0x2c')]();});}};}function handleEntityNotFound(_0x236d7c,_0x2d5498){return function(_0x59beb3){if(!_0x59beb3){_0x236d7c[_0x1be5('0x1e')](0x194);}return _0x59beb3;};}function handleError(_0xadf381,_0x89c0ee){_0x89c0ee=_0x89c0ee||0x1f4;return function(_0x1de91f){logger[_0x1be5('0x2d')](_0x1de91f['stack']);if(_0x1de91f[_0x1be5('0x2e')]){delete _0x1de91f[_0x1be5('0x2e')];}_0xadf381[_0x1be5('0x1f')](_0x89c0ee)[_0x1be5('0x2f')](_0x1de91f);};}exports[_0x1be5('0x30')]=function(_0x5cd51b,_0x35a336){var _0x303f6f={},_0x9fbfa9={},_0x3ab053={'count':0x0,'rows':[]};var _0x58685b=_[_0x1be5('0x31')](db[_0x1be5('0x32')]['rawAttributes'],function(_0x3da528){return{'name':_0x3da528[_0x1be5('0x33')],'type':_0x3da528['type']['key']};});_0x9fbfa9[_0x1be5('0x34')]=_[_0x1be5('0x31')](_0x58685b,_0x1be5('0x2e'));_0x9fbfa9[_0x1be5('0x35')]=_['keys'](_0x5cd51b[_0x1be5('0x35')]);_0x9fbfa9[_0x1be5('0x36')]=_[_0x1be5('0x37')](_0x9fbfa9[_0x1be5('0x34')],_0x9fbfa9[_0x1be5('0x35')]);_0x303f6f['attributes']=_[_0x1be5('0x37')](_0x9fbfa9[_0x1be5('0x34')],qs['fields'](_0x5cd51b[_0x1be5('0x35')]['fields']));_0x303f6f['attributes']=_0x303f6f[_0x1be5('0x38')][_0x1be5('0x39')]?_0x303f6f[_0x1be5('0x38')]:_0x9fbfa9['model'];if(!_0x5cd51b[_0x1be5('0x35')]['hasOwnProperty'](_0x1be5('0x3a'))){_0x303f6f[_0x1be5('0x24')]=qs[_0x1be5('0x24')](_0x5cd51b[_0x1be5('0x35')]['limit']);_0x303f6f[_0x1be5('0x21')]=qs[_0x1be5('0x21')](_0x5cd51b[_0x1be5('0x35')][_0x1be5('0x21')]);}_0x303f6f[_0x1be5('0x3b')]=qs[_0x1be5('0x3c')](_0x5cd51b[_0x1be5('0x35')][_0x1be5('0x3c')]);_0x303f6f[_0x1be5('0x3d')]=qs['filters'](_['pick'](_0x5cd51b['query'],_0x9fbfa9[_0x1be5('0x36')]),_0x58685b);if(_0x5cd51b[_0x1be5('0x35')][_0x1be5('0x3e')]){_0x303f6f['where']=_[_0x1be5('0x3f')](_0x303f6f['where'],{'$or':_[_0x1be5('0x31')](_0x58685b,function(_0x21df7c){if(_0x21df7c[_0x1be5('0x40')]!==_0x1be5('0x41')){var _0x978767={};_0x978767[_0x21df7c[_0x1be5('0x2e')]]={'$like':'%'+_0x5cd51b[_0x1be5('0x35')][_0x1be5('0x3e')]+'%'};return _0x978767;}})});}_0x303f6f=_[_0x1be5('0x3f')]({},_0x303f6f,_0x5cd51b['options']);var _0x3aa908={'where':_0x303f6f['where']};return db[_0x1be5('0x32')][_0x1be5('0x23')](_0x3aa908)[_0x1be5('0x2a')](function(_0x3fd64c){_0x3ab053[_0x1be5('0x23')]=_0x3fd64c;if(_0x5cd51b[_0x1be5('0x35')]['includeAll']){_0x303f6f[_0x1be5('0x42')]=[{'all':!![]}];}return db[_0x1be5('0x32')][_0x1be5('0x43')](_0x303f6f);})[_0x1be5('0x2a')](function(_0x1a21ca){_0x3ab053[_0x1be5('0x44')]=_0x1a21ca;return _0x3ab053;})['then'](respondWithFilteredResult(_0x35a336,_0x303f6f))[_0x1be5('0x45')](handleError(_0x35a336,null));};exports[_0x1be5('0x46')]=function(_0x49cf9d,_0x27958a){var _0x46707c={'raw':![],'where':{'id':_0x49cf9d[_0x1be5('0x47')]['id']}},_0x375040={};_0x375040[_0x1be5('0x34')]=_[_0x1be5('0x48')](db[_0x1be5('0x32')][_0x1be5('0x49')]);_0x375040[_0x1be5('0x35')]=_[_0x1be5('0x48')](_0x49cf9d['query']);_0x375040['filters']=_['intersection'](_0x375040[_0x1be5('0x34')],_0x375040[_0x1be5('0x35')]);_0x46707c[_0x1be5('0x38')]=_[_0x1be5('0x37')](_0x375040['model'],qs[_0x1be5('0x4a')](_0x49cf9d['query'][_0x1be5('0x4a')]));_0x46707c[_0x1be5('0x38')]=_0x46707c[_0x1be5('0x38')]['length']?_0x46707c['attributes']:_0x375040[_0x1be5('0x34')];if(_0x49cf9d['query'][_0x1be5('0x4b')]){_0x46707c[_0x1be5('0x42')]=[{'all':!![]}];}_0x46707c=_[_0x1be5('0x3f')]({},_0x46707c,_0x49cf9d[_0x1be5('0x4c')]);return db['UserProfile']['find'](_0x46707c)['then'](handleEntityNotFound(_0x27958a,null))[_0x1be5('0x2a')](respondWithResult(_0x27958a,null))['catch'](handleError(_0x27958a,null));};exports[_0x1be5('0x4d')]=function(_0x4fb89e,_0x22af08){return db['UserProfile']['create'](_0x4fb89e['body'],{})[_0x1be5('0x2a')](respondWithResult(_0x22af08,0xc9))[_0x1be5('0x45')](handleError(_0x22af08,null));};exports[_0x1be5('0x4e')]=function(_0x5868ac,_0x1e7a12){var _0x4c9beb={'where':{'id':_0x5868ac['params']['id']}},_0x46ce1d={};_0x46ce1d[_0x1be5('0x34')]=_[_0x1be5('0x48')](db['UserProfile'][_0x1be5('0x49')]);_0x4c9beb[_0x1be5('0x38')]=_[_0x1be5('0x37')](_0x46ce1d[_0x1be5('0x34')],qs['fields'](_0x5868ac['query'][_0x1be5('0x4a')]));_0x4c9beb[_0x1be5('0x38')]=_0x4c9beb[_0x1be5('0x38')][_0x1be5('0x39')]?_0x4c9beb[_0x1be5('0x38')]:_0x46ce1d[_0x1be5('0x34')];if(_0x5868ac[_0x1be5('0x35')][_0x1be5('0x4b')]){_0x4c9beb['include']=[{'all':!![]}];}_0x4c9beb=_[_0x1be5('0x3f')]({},_0x4c9beb,_0x5868ac[_0x1be5('0x4c')]);return db[_0x1be5('0x32')][_0x1be5('0x4f')](_0x4c9beb)[_0x1be5('0x2a')](handleEntityNotFound(_0x1e7a12,null))[_0x1be5('0x2a')](function(_0x431d71){if(_0x431d71){var _0x509aec=_0x431d71[_0x1be5('0x50')]({'plain':!![]});_0x509aec=qs[_0x1be5('0x51')](_0x509aec,['id',_0x1be5('0x52'),_0x1be5('0x53'),_0x1be5('0x54')]);_0x5868ac[_0x1be5('0x55')]=_['omit'](_0x5868ac[_0x1be5('0x55')],['id',_0x1be5('0x52'),_0x1be5('0x53')]);return db['sequelize'][_0x1be5('0x56')](function(_0xf9a7c3){return db[_0x1be5('0x32')][_0x1be5('0x4d')](_['merge'](_0x509aec,_0x5868ac[_0x1be5('0x55')]),{'include':_0x5868ac[_0x1be5('0x35')][_0x1be5('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0xf9a7c3})['then'](function(_0x512b52){var _0x576260=_0x512b52[_0x1be5('0x50')]({'plain':!![]});return db[_0x1be5('0x57')][_0x1be5('0x43')]({'where':{'userProfileId':_0x5868ac[_0x1be5('0x47')]['id']},'raw':!![]})[_0x1be5('0x2a')](function(_0x17b295){if(_0x17b295){return BPromise['each'](_0x17b295,function(_0x12f033){return new BPromise(function(_0x324346,_0x1e9442){if(_0x12f033[_0x1be5('0x58')]===null||_0x12f033['autoAssociation']===0x1)_0x324346(null);return db['UserProfileResource'][_0x1be5('0x43')]({'where':{'sectionId':_0x12f033['id']},'raw':!![]})[_0x1be5('0x2a')](function(_0x15c330){var _0x4e4bd4=_[_0x1be5('0x31')](_0x15c330,function(_0x4b5a8c){return qs['omit'](_0x4b5a8c,['id',_0x1be5('0x52'),_0x1be5('0x53'),_0x1be5('0x59')]);});_0x324346(_0x4e4bd4);})['catch'](function(_0x3f1ca4){_0x1e9442(_0x3f1ca4);});})[_0x1be5('0x2a')](function(_0xa04881){var _0xb7857d=qs[_0x1be5('0x51')](_0x12f033,['id',_0x1be5('0x52'),'updatedAt']);_0xb7857d['userProfileId']=_0x576260['id'];if(_0xa04881)_0xb7857d['Resources']=_0xa04881;return _0xb7857d;})['then'](function(_0x8459ac){return db[_0x1be5('0x57')][_0x1be5('0x4d')](_0x8459ac,{'include':[{'model':db['UserProfileResource'],'as':_0x1be5('0x5a')}],'raw':!![],'transaction':_0xf9a7c3});});})['then'](function(){return _0x576260;});}});});});}})[_0x1be5('0x2a')](respondWithResult(_0x1e7a12,0xc9))[_0x1be5('0x45')](handleError(_0x1e7a12,null));};exports['update']=function(_0x54eba1,_0x2649dc){if(_0x54eba1[_0x1be5('0x55')]['id']){delete _0x54eba1[_0x1be5('0x55')]['id'];}return db[_0x1be5('0x32')][_0x1be5('0x4f')]({'where':{'id':_0x54eba1['params']['id']}})['then'](handleEntityNotFound(_0x2649dc,null))[_0x1be5('0x2a')](saveUpdates(_0x54eba1[_0x1be5('0x55')],null))[_0x1be5('0x2a')](respondWithResult(_0x2649dc,null))[_0x1be5('0x45')](handleError(_0x2649dc,null));};exports[_0x1be5('0x2b')]=function(_0x5eac00,_0x52b9bc){return db[_0x1be5('0x32')][_0x1be5('0x4f')]({'where':{'id':_0x5eac00['params']['id']}})[_0x1be5('0x2a')](handleEntityNotFound(_0x52b9bc,null))[_0x1be5('0x2a')](removeEntity(_0x52b9bc,null))['catch'](handleError(_0x52b9bc,null));};exports['describe']=function(_0x32a75b,_0x3f69f4){return db[_0x1be5('0x32')][_0x1be5('0x5b')]()['then'](respondWithResult(_0x3f69f4,null))[_0x1be5('0x45')](handleError(_0x3f69f4,null));};exports[_0x1be5('0x5c')]=function(_0x165709,_0x165184){var _0x5b286f=_0x165709[_0x1be5('0x55')];return db[_0x1be5('0x32')][_0x1be5('0x4f')]({'where':{'id':_0x165709[_0x1be5('0x47')]['id']}})['then'](handleEntityNotFound(_0x165184,null))[_0x1be5('0x2a')](function(_0xe68e1a){if(_0xe68e1a){return db['sequelize'][_0x1be5('0x56')](function(_0x2e12e0){return db['UserProfileSection'][_0x1be5('0x2b')]({'where':{'userProfileId':_0x165709[_0x1be5('0x47')]['id'],'sectionId':_[_0x1be5('0x31')](_0x5b286f,function(_0x21b77d){return _0x21b77d[_0x1be5('0x59')];})},'transaction':_0x2e12e0})['then'](function(){var _0x143a6f=_[_0x1be5('0x31')](_0x5b286f,function(_0x2fb4ec){_0x2fb4ec['userProfileId']=_0x165709[_0x1be5('0x47')]['id'];return _0x2fb4ec;});var _0x31ff14=[];return BPromise[_0x1be5('0x5d')](_0x143a6f,function(_0x200d92){return db[_0x1be5('0x57')]['create'](_0x200d92,{'include':[{'model':db['UserProfileResource'],'as':_0x1be5('0x5a')}],'raw':!![],'transaction':_0x2e12e0})['then'](function(_0x15b330){_0x31ff14['push'](_0x15b330[_0x1be5('0x50')]({'plain':!![]}));});})['then'](function(){return _0x31ff14;});});});}})[_0x1be5('0x2a')](function(_0x3c4235){return _0x3c4235;})['then'](respondWithResult(_0x165184,null))[_0x1be5('0x45')](handleError(_0x165184,null));};exports[_0x1be5('0x5e')]=function(_0x212f9b,_0x19bc1c){var _0x11a184;return db[_0x1be5('0x32')][_0x1be5('0x4f')]({'where':{'id':_0x212f9b[_0x1be5('0x47')]['id']},'attributes':['id',_0x1be5('0x2e')]})[_0x1be5('0x2a')](handleEntityNotFound(_0x19bc1c,null))[_0x1be5('0x2a')](function(_0x1774ea){if(_0x1774ea){_0x11a184=_0x1774ea;return db[_0x1be5('0x57')]['destroy']({'where':{'userProfileId':_0x212f9b[_0x1be5('0x47')]['id'],'sectionId':_0x212f9b[_0x1be5('0x35')][_0x1be5('0x5f')]}});}})[_0x1be5('0x2a')](function(){return _0x11a184;})[_0x1be5('0x2a')](respondWithStatusCode(_0x19bc1c,null))['catch'](handleError(_0x19bc1c,null));};exports[_0x1be5('0x60')]=function(_0xc9f7df,_0x5103db){var _0x578c50=[];var _0x33582b=[];return db['UserProfileSection'][_0x1be5('0x43')]({'where':{'userProfileId':_0xc9f7df[_0x1be5('0x47')]['id']},'raw':!![]})[_0x1be5('0x2a')](function(_0x82bd80){_0x578c50=_[_0x1be5('0x3e')](_0x82bd80,function(_0x141e9b){return _0x141e9b[_0x1be5('0x61')]===0x1||_['includes']([0x3eb,0x709],_0x141e9b['sectionId']);});if(!_[_0x1be5('0x62')](_0x578c50)){return _[_0x1be5('0x31')](_0x578c50,function(_0x598e7e){return _0x598e7e['sectionId'];});}else{return;}})[_0x1be5('0x2a')](function(_0x9242a4){if(_0x9242a4)_0x33582b=_0x9242a4;if(_['includes'](_0x33582b,0x64)){var _0xeaae3=_['find'](_0x578c50,{'sectionId':0x64});return hasDefaultDashboard(_0xeaae3)[_0x1be5('0x2a')](function(_0x461657){return _[_0x1be5('0x31')](_0x578c50,function(_0x213062){if(_0x213062[_0x1be5('0x59')]===0x64){_0x213062['subsections']=_0x461657;}return _0x213062;});});}else{return;}})[_0x1be5('0x2a')](function(_0x96d839){if(_0x96d839)_0x578c50=_0x96d839;if(_[_0x1be5('0x63')](_0x33582b,0x3eb)){var _0x17c057=_['find'](_0x578c50,{'sectionId':0x3eb});return getCustomDashboards(_0x17c057)[_0x1be5('0x2a')](function(_0x11984f){return _[_0x1be5('0x31')](_0x578c50,function(_0x38e392){if(_0x17c057[_0x1be5('0x61')]){if(_0x38e392[_0x1be5('0x59')]===0x3eb){_0x38e392[_0x1be5('0x64')]=_0x11984f;}}else{if(_0x38e392[_0x1be5('0x59')]===0x64){_0x38e392[_0x1be5('0x64')]=_0x11984f;}}return _0x38e392;});});}else{return;}})['then'](function(_0x3a270b){if(_0x3a270b)_0x578c50=_0x3a270b;if(_[_0x1be5('0x63')](_0x33582b,0x709)){var _0x6d9dcd=_[_0x1be5('0x4f')](_0x578c50,{'sectionId':0x709});return getPlugins(_0x6d9dcd)['then'](function(_0x41a33f){if(_0x6d9dcd['enabled']){return _[_0x1be5('0x31')](_0x578c50,function(_0x5f0bd6){if(_0x5f0bd6[_0x1be5('0x59')]===0x709){_0x5f0bd6[_0x1be5('0x64')]=_0x41a33f;}return _0x5f0bd6;});}else{var _0x3c944c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x41a33f};var _0x20df32=_['map'](_0x578c50);_0x20df32[_0x1be5('0x65')](_0x3c944c);return _0x20df32;}});}else{return;}})[_0x1be5('0x2a')](function(_0x1e545d){if(_0x1e545d)_0x578c50=_0x1e545d;return _[_0x1be5('0x3e')](_0x578c50,[_0x1be5('0x61'),0x1]);})['then'](respondWithResult(_0x5103db,null))['catch'](handleError(_0x5103db,null));};function hasDefaultDashboard(_0x1963c2){var _0x1df2f7=[0x65];return new BPromise(function(_0xc2c6fb,_0x48c4e){try{if(_0x1963c2[_0x1be5('0x58')]){_0xc2c6fb(_0x1df2f7);}else{return db[_0x1be5('0x66')][_0x1be5('0x67')]({'where':{'sectionId':_0x1963c2['id']},'raw':!![]})[_0x1be5('0x2a')](function(_0x4a6bb9){_0x4a6bb9?_0xc2c6fb(_0x1df2f7):_0xc2c6fb();});}}catch(_0x25775b){_0x48c4e(_0x25775b);}});}function getCustomDashboards(_0x1af53f){var _0x1a3179=[];return new BPromise(function(_0x377f42,_0x1a39da){try{if(_0x1af53f[_0x1be5('0x58')]){return db['Dashboard']['findAll']({'raw':!![]})[_0x1be5('0x2a')](function(_0x267ac1){_0x267ac1[_0x1be5('0x68')](function(_0x2c3635){_0x1a3179[_0x1be5('0x65')](_0x2c3635['id']+0x1869f);});_0x377f42(_0x1a3179);});}else{return db[_0x1be5('0x66')]['findAll']({'where':{'sectionId':_0x1af53f['id']},'raw':!![]})[_0x1be5('0x2a')](function(_0x374e72){_0x374e72['forEach'](function(_0x302a8c){_0x1a3179[_0x1be5('0x65')](_0x302a8c[_0x1be5('0x69')]+0x1869f);});_0x377f42(_0x1a3179);});}}catch(_0x3633ec){_0x1a39da(_0x3633ec);}});}function getPlugins(_0x5bc4cf){var _0x104b10=[];return new BPromise(function(_0x4e6adc,_0x1803fe){try{if(_0x5bc4cf[_0x1be5('0x58')]){return db[_0x1be5('0x6a')][_0x1be5('0x43')]({'raw':!![]})[_0x1be5('0x2a')](function(_0x194cb7){_0x194cb7[_0x1be5('0x68')](function(_0x4162dd){_0x104b10[_0x1be5('0x65')](_0x4162dd['id']+0x15b38);});_0x4e6adc(_0x104b10);});}else{return db[_0x1be5('0x66')][_0x1be5('0x43')]({'where':{'sectionId':_0x5bc4cf['id']},'raw':!![]})[_0x1be5('0x2a')](function(_0x5655d0){_0x5655d0[_0x1be5('0x68')](function(_0x2a943){_0x104b10[_0x1be5('0x65')](_0x2a943['resourceId']+0x15b38);});_0x4e6adc(_0x104b10);});}}catch(_0x50993c){_0x1803fe(_0x50993c);}});}exports[_0x1be5('0x6b')]=function(_0x125126,_0xcf4bf1){return db['UserProfile'][_0x1be5('0x4f')]({'where':{'id':_0x125126[_0x1be5('0x47')]['id']}})['then'](handleEntityNotFound(_0xcf4bf1,null))[_0x1be5('0x2a')](function(_0x380f86){if(_0x380f86){return db[_0x1be5('0x6c')][_0x1be5('0x56')](function(_0x2ece75){return db['UserProfileSection'][_0x1be5('0x43')]({'where':{'userProfileId':_0x125126[_0x1be5('0x47')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xaa89de){if(_0xaa89de){return db['UserProfileSection'][_0x1be5('0x2b')]({'where':{'userProfileId':_0x125126[_0x1be5('0x47')]['id'],'id':_['map'](_0xaa89de,function(_0x2c15fa){return _0x2c15fa['id'];})},'transaction':_0x2ece75});}})['then'](function(_0x2dfef8){var _0x265b38=_[_0x1be5('0x31')](_0x125126[_0x1be5('0x55')],function(_0x39a648){_0x39a648[_0x1be5('0x6d')]=_0x125126[_0x1be5('0x47')]['id'];return _0x39a648;});return db[_0x1be5('0x57')][_0x1be5('0x6e')](_0x265b38,{'raw':!![],'transaction':_0x2ece75});})[_0x1be5('0x2a')](function(_0x219966){var _0x55fcc4=_['filter'](_[_0x1be5('0x31')](_0x219966,function(_0x3cb181){return _0x3cb181[_0x1be5('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x55fcc4){return db['UserProfileSection'][_0x1be5('0x43')]({'where':{'userProfileId':_0x125126['params']['id'],'sectionId':_[_0x1be5('0x31')](_0x55fcc4,function(_0x38e7ef){return _0x38e7ef[_0x1be5('0x59')];})},'attributes':['id',_0x1be5('0x59')],'raw':!![]})[_0x1be5('0x2a')](function(_0x482196){var _0x2fd261=_[_0x1be5('0x31')](_0x125126[_0x1be5('0x55')],function(_0x47e2f6){_0x47e2f6['userProfileId']=_0x125126['params']['id'];return _0x47e2f6;});return db['UserProfileResource'][_0x1be5('0x6e')](_0x2fd261,{'raw':!![],'transaction':_0x2ece75});});}})[_0x1be5('0x45')](handleError(_0xcf4bf1,null));});}})[_0x1be5('0x2a')](function(_0xff6dbb){var _0x3d2359=_['map'](_0xff6dbb,function(_0x9adc58){return _0x9adc58[_0x1be5('0x50')]({'plain':!![]});});})[_0x1be5('0x2a')](respondWithResult(_0xcf4bf1,null))['catch'](handleError(_0xcf4bf1,null));};exports['removeResources']=function(_0x3cd823,_0x5c924a,_0x3eafe6){return db[_0x1be5('0x32')][_0x1be5('0x4f')]({'where':{'id':_0x3cd823[_0x1be5('0x47')]['id']}})[_0x1be5('0x2a')](handleEntityNotFound(_0x5c924a,null))[_0x1be5('0x2a')](function(_0x12179f){if(_0x12179f){return _0x12179f[_0x1be5('0x6f')](_0x3cd823[_0x1be5('0x35')][_0x1be5('0x5f')]);}})[_0x1be5('0x2a')](respondWithStatusCode(_0x5c924a,null))[_0x1be5('0x45')](handleError(_0x5c924a,null));};exports[_0x1be5('0x70')]=function(_0xdb04db,_0x285160){var _0x1bc6b7={};if(!_0xdb04db[_0x1be5('0x35')][_0x1be5('0x71')])throw new Error('Missing\x20section\x20parameter');if(!_0xdb04db[_0x1be5('0x35')][_0x1be5('0x72')](_0x1be5('0x3a'))){_0x1bc6b7[_0x1be5('0x24')]=qs['limit'](_0xdb04db['query']['limit']);_0x1bc6b7[_0x1be5('0x21')]=qs[_0x1be5('0x21')](_0xdb04db['query'][_0x1be5('0x21')]);}return db[_0x1be5('0x32')][_0x1be5('0x4f')]({'where':{'id':_0xdb04db[_0x1be5('0x47')]['id']}})[_0x1be5('0x2a')](function(_0x551777){if(!_0x551777)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0xdb04db[_0x1be5('0x47')]['id']);return db[_0x1be5('0x32')][_0x1be5('0x70')](_0xdb04db);})[_0x1be5('0x2a')](respondWithFilteredResult(_0x285160,_0x1bc6b7))['catch'](handleError(_0x285160,null));}; \ No newline at end of file +var _0x585e=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./userProfile.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','clone','get','updatedAt','crudPermissions','body','omit','createdAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','map','sectionId','userProfileId','Resources','describe','push','removeSections','ids','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','sequelize','bulkCreate','removeResources','section','Missing\x20section\x20parameter','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x376220,_0x11ee33){var _0x45b21c=function(_0x2b1d02){while(--_0x2b1d02){_0x376220['push'](_0x376220['shift']());}};_0x45b21c(++_0x11ee33);}(_0x585e,0x1c2));var _0xe585=function(_0xfae676,_0x1953e4){_0xfae676=_0xfae676-0x0;var _0xe65564=_0x585e[_0xfae676];return _0xe65564;};'use strict';var emlformat=require(_0xe585('0x0'));var rimraf=require(_0xe585('0x1'));var zipdir=require(_0xe585('0x2'));var jsonpatch=require(_0xe585('0x3'));var rp=require(_0xe585('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe585('0x5'));var util=require(_0xe585('0x6'));var path=require('path');var sox=require(_0xe585('0x7'));var csv=require(_0xe585('0x8'));var ejs=require(_0xe585('0x9'));var fs=require('fs');var fs_extra=require(_0xe585('0xa'));var _=require(_0xe585('0xb'));var squel=require(_0xe585('0xc'));var crypto=require(_0xe585('0xd'));var jsforce=require(_0xe585('0xe'));var deskjs=require(_0xe585('0xf'));var toCsv=require(_0xe585('0x8'));var querystring=require(_0xe585('0x10'));var Papa=require(_0xe585('0x11'));var Redis=require(_0xe585('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe585('0x13'));var as=require(_0xe585('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe585('0x15'))('api');var utils=require(_0xe585('0x16'));var config=require(_0xe585('0x17'));var licenseUtil=require(_0xe585('0x18'));var db=require(_0xe585('0x19'))['db'];config['redis']=_[_0xe585('0x1a')](config[_0xe585('0x1b')],{'host':_0xe585('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe585('0x1b')]));require(_0xe585('0x1d'))[_0xe585('0x1e')](socket);function respondWithStatusCode(_0x419c6b,_0x1ce5ee){_0x1ce5ee=_0x1ce5ee||0xcc;return function(_0x491820){if(_0x491820){return _0x419c6b[_0xe585('0x1f')](_0x1ce5ee);}return _0x419c6b['status'](_0x1ce5ee)['end']();};}function respondWithResult(_0x2c9830,_0x11fe2b){_0x11fe2b=_0x11fe2b||0xc8;return function(_0x55b8f2){if(_0x55b8f2){return _0x2c9830[_0xe585('0x20')](_0x11fe2b)[_0xe585('0x21')](_0x55b8f2);}};}function respondWithFilteredResult(_0x56c57f,_0x13296e){return function(_0x119a94){if(_0x119a94){var _0x1bc3df=typeof _0x13296e[_0xe585('0x22')]===_0xe585('0x23')&&typeof _0x13296e[_0xe585('0x24')]==='undefined';var _0x453875=_0x119a94[_0xe585('0x25')];var _0x57ddee=_0x1bc3df?0x0:_0x13296e[_0xe585('0x22')];var _0xa8b0a4=_0x1bc3df?_0x119a94[_0xe585('0x25')]:_0x13296e['offset']+_0x13296e[_0xe585('0x24')];var _0x495990;if(_0xa8b0a4>=_0x453875){_0xa8b0a4=_0x453875;_0x495990=0xc8;}else{_0x495990=0xce;}_0x56c57f['status'](_0x495990);return _0x56c57f['set'](_0xe585('0x26'),_0x57ddee+'-'+_0xa8b0a4+'/'+_0x453875)['json'](_0x119a94);}return null;};}function patchUpdates(_0x455af1){return function(_0x402b5c){try{jsonpatch[_0xe585('0x27')](_0x402b5c,_0x455af1,!![]);}catch(_0x16aa43){return BPromise[_0xe585('0x28')](_0x16aa43);}return _0x402b5c[_0xe585('0x29')]();};}function saveUpdates(_0x32d91a,_0x8ffde3){return function(_0x331951){if(_0x331951){return _0x331951[_0xe585('0x2a')](_0x32d91a)[_0xe585('0x2b')](function(_0x30dd09){return _0x30dd09;});}return null;};}function removeEntity(_0x404b6c,_0x556fd5){return function(_0x35b453){if(_0x35b453){return _0x35b453[_0xe585('0x2c')]()[_0xe585('0x2b')](function(){_0x404b6c[_0xe585('0x20')](0xcc)[_0xe585('0x2d')]();});}};}function handleEntityNotFound(_0x4fb923,_0x18dc04){return function(_0x23e65d){if(!_0x23e65d){_0x4fb923['sendStatus'](0x194);}return _0x23e65d;};}function handleError(_0x5a34ce,_0x2f4f33){_0x2f4f33=_0x2f4f33||0x1f4;return function(_0x30862c){logger[_0xe585('0x2e')](_0x30862c[_0xe585('0x2f')]);if(_0x30862c[_0xe585('0x30')]){delete _0x30862c[_0xe585('0x30')];}_0x5a34ce[_0xe585('0x20')](_0x2f4f33)[_0xe585('0x31')](_0x30862c);};}exports[_0xe585('0x32')]=function(_0x8d1a2b,_0x4dbb7e){var _0x160594={},_0x90c92c={},_0x274adf={'count':0x0,'rows':[]};var _0x385be4=_['map'](db[_0xe585('0x33')][_0xe585('0x34')],function(_0x20f1e6){return{'name':_0x20f1e6[_0xe585('0x35')],'type':_0x20f1e6[_0xe585('0x36')][_0xe585('0x37')]};});_0x90c92c['model']=_['map'](_0x385be4,_0xe585('0x30'));_0x90c92c['query']=_[_0xe585('0x38')](_0x8d1a2b[_0xe585('0x39')]);_0x90c92c['filters']=_[_0xe585('0x3a')](_0x90c92c[_0xe585('0x3b')],_0x90c92c['query']);_0x160594[_0xe585('0x3c')]=_[_0xe585('0x3a')](_0x90c92c[_0xe585('0x3b')],qs[_0xe585('0x3d')](_0x8d1a2b[_0xe585('0x39')][_0xe585('0x3d')]));_0x160594[_0xe585('0x3c')]=_0x160594['attributes'][_0xe585('0x3e')]?_0x160594[_0xe585('0x3c')]:_0x90c92c[_0xe585('0x3b')];if(!_0x8d1a2b[_0xe585('0x39')][_0xe585('0x3f')](_0xe585('0x40'))){_0x160594[_0xe585('0x24')]=qs[_0xe585('0x24')](_0x8d1a2b[_0xe585('0x39')][_0xe585('0x24')]);_0x160594['offset']=qs[_0xe585('0x22')](_0x8d1a2b[_0xe585('0x39')][_0xe585('0x22')]);}_0x160594[_0xe585('0x41')]=qs[_0xe585('0x42')](_0x8d1a2b[_0xe585('0x39')][_0xe585('0x42')]);_0x160594[_0xe585('0x43')]=qs[_0xe585('0x44')](_[_0xe585('0x45')](_0x8d1a2b[_0xe585('0x39')],_0x90c92c['filters']),_0x385be4);if(_0x8d1a2b['query']['filter']){_0x160594[_0xe585('0x43')]=_['merge'](_0x160594['where'],{'$or':_['map'](_0x385be4,function(_0x43777b){if(_0x43777b['type']!==_0xe585('0x46')){var _0x1178a6={};_0x1178a6[_0x43777b['name']]={'$like':'%'+_0x8d1a2b[_0xe585('0x39')][_0xe585('0x47')]+'%'};return _0x1178a6;}})});}_0x160594=_['merge']({},_0x160594,_0x8d1a2b[_0xe585('0x48')]);var _0x962037={'where':_0x160594['where']};return db[_0xe585('0x33')]['count'](_0x962037)[_0xe585('0x2b')](function(_0x1008b6){_0x274adf[_0xe585('0x25')]=_0x1008b6;if(_0x8d1a2b[_0xe585('0x39')][_0xe585('0x49')]){_0x160594[_0xe585('0x4a')]=[{'all':!![]}];}return db[_0xe585('0x33')][_0xe585('0x4b')](_0x160594);})[_0xe585('0x2b')](function(_0x1bcc46){_0x274adf[_0xe585('0x4c')]=_0x1bcc46;return _0x274adf;})[_0xe585('0x2b')](respondWithFilteredResult(_0x4dbb7e,_0x160594))[_0xe585('0x4d')](handleError(_0x4dbb7e,null));};exports[_0xe585('0x4e')]=function(_0x557a92,_0x1e234e){var _0x13ea8c={'raw':![],'where':{'id':_0x557a92[_0xe585('0x4f')]['id']}},_0x9dd119={};_0x9dd119[_0xe585('0x3b')]=_[_0xe585('0x38')](db[_0xe585('0x33')][_0xe585('0x34')]);_0x9dd119['query']=_[_0xe585('0x38')](_0x557a92[_0xe585('0x39')]);_0x9dd119[_0xe585('0x44')]=_[_0xe585('0x3a')](_0x9dd119[_0xe585('0x3b')],_0x9dd119[_0xe585('0x39')]);_0x13ea8c['attributes']=_['intersection'](_0x9dd119[_0xe585('0x3b')],qs[_0xe585('0x3d')](_0x557a92['query'][_0xe585('0x3d')]));_0x13ea8c[_0xe585('0x3c')]=_0x13ea8c['attributes'][_0xe585('0x3e')]?_0x13ea8c[_0xe585('0x3c')]:_0x9dd119[_0xe585('0x3b')];if(_0x557a92[_0xe585('0x39')][_0xe585('0x49')]){_0x13ea8c[_0xe585('0x4a')]=[{'all':!![]}];}_0x13ea8c=_[_0xe585('0x50')]({},_0x13ea8c,_0x557a92[_0xe585('0x48')]);return db[_0xe585('0x33')][_0xe585('0x51')](_0x13ea8c)[_0xe585('0x2b')](handleEntityNotFound(_0x1e234e,null))[_0xe585('0x2b')](respondWithResult(_0x1e234e,null))[_0xe585('0x4d')](handleError(_0x1e234e,null));};exports[_0xe585('0x52')]=function(_0x2f5cfb,_0x29f5f1){return db['UserProfile'][_0xe585('0x52')](_0x2f5cfb['body'],{})['then'](respondWithResult(_0x29f5f1,0xc9))[_0xe585('0x4d')](handleError(_0x29f5f1,null));};exports[_0xe585('0x53')]=function(_0x3ca15c,_0xce765e){var _0x2929fc={'where':{'id':_0x3ca15c[_0xe585('0x4f')]['id']}},_0x3edc8c={};_0x3edc8c['model']=_[_0xe585('0x38')](db[_0xe585('0x33')]['rawAttributes']);_0x2929fc[_0xe585('0x3c')]=_[_0xe585('0x3a')](_0x3edc8c[_0xe585('0x3b')],qs['fields'](_0x3ca15c['query']['fields']));_0x2929fc['attributes']=_0x2929fc[_0xe585('0x3c')][_0xe585('0x3e')]?_0x2929fc['attributes']:_0x3edc8c[_0xe585('0x3b')];if(_0x3ca15c[_0xe585('0x39')][_0xe585('0x49')]){_0x2929fc[_0xe585('0x4a')]=[{'all':!![]}];}_0x2929fc=_['merge']({},_0x2929fc,_0x3ca15c[_0xe585('0x48')]);return db[_0xe585('0x33')]['find'](_0x2929fc)[_0xe585('0x2b')](handleEntityNotFound(_0xce765e,null))[_0xe585('0x2b')](function(_0x2f142a){if(_0x2f142a){var _0x5db5fc=_0x2f142a[_0xe585('0x54')]({'plain':!![]});_0x5db5fc=qs['omit'](_0x5db5fc,['id','createdAt',_0xe585('0x55'),_0xe585('0x56')]);_0x3ca15c[_0xe585('0x57')]=_[_0xe585('0x58')](_0x3ca15c[_0xe585('0x57')],['id',_0xe585('0x59'),'updatedAt']);return db['sequelize'][_0xe585('0x5a')](function(_0x1203a0){return db[_0xe585('0x33')][_0xe585('0x52')](_['merge'](_0x5db5fc,_0x3ca15c['body']),{'include':_0x3ca15c[_0xe585('0x39')][_0xe585('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x1203a0})['then'](function(_0x2f235e){var _0x55562b=_0x2f235e[_0xe585('0x54')]({'plain':!![]});return db[_0xe585('0x5b')][_0xe585('0x4b')]({'where':{'userProfileId':_0x3ca15c[_0xe585('0x4f')]['id']},'raw':!![]})[_0xe585('0x2b')](function(_0x46c51){if(_0x46c51){return BPromise[_0xe585('0x5c')](_0x46c51,function(_0x3b0669){return new BPromise(function(_0x5e4367,_0x157c45){if(_0x3b0669[_0xe585('0x5d')]===null||_0x3b0669[_0xe585('0x5d')]===0x1)_0x5e4367(null);return db[_0xe585('0x5e')][_0xe585('0x4b')]({'where':{'sectionId':_0x3b0669['id']},'raw':!![]})[_0xe585('0x2b')](function(_0x2db1b4){var _0x5228d7=_[_0xe585('0x5f')](_0x2db1b4,function(_0xcb94a){return qs[_0xe585('0x58')](_0xcb94a,['id',_0xe585('0x59'),_0xe585('0x55'),_0xe585('0x60')]);});_0x5e4367(_0x5228d7);})[_0xe585('0x4d')](function(_0x59f23b){_0x157c45(_0x59f23b);});})[_0xe585('0x2b')](function(_0x1a3e95){var _0x112449=qs[_0xe585('0x58')](_0x3b0669,['id',_0xe585('0x59'),_0xe585('0x55')]);_0x112449[_0xe585('0x61')]=_0x55562b['id'];if(_0x1a3e95)_0x112449[_0xe585('0x62')]=_0x1a3e95;return _0x112449;})[_0xe585('0x2b')](function(_0x37eb6f){return db['UserProfileSection'][_0xe585('0x52')](_0x37eb6f,{'include':[{'model':db[_0xe585('0x5e')],'as':_0xe585('0x62')}],'raw':!![],'transaction':_0x1203a0});});})['then'](function(){return _0x55562b;});}});});});}})['then'](respondWithResult(_0xce765e,0xc9))[_0xe585('0x4d')](handleError(_0xce765e,null));};exports[_0xe585('0x2a')]=function(_0x5c2fac,_0x47ddae){if(_0x5c2fac['body']['id']){delete _0x5c2fac[_0xe585('0x57')]['id'];}return db[_0xe585('0x33')][_0xe585('0x51')]({'where':{'id':_0x5c2fac[_0xe585('0x4f')]['id']}})[_0xe585('0x2b')](handleEntityNotFound(_0x47ddae,null))[_0xe585('0x2b')](saveUpdates(_0x5c2fac[_0xe585('0x57')],null))[_0xe585('0x2b')](respondWithResult(_0x47ddae,null))['catch'](handleError(_0x47ddae,null));};exports[_0xe585('0x2c')]=function(_0x102b82,_0x15ff80){return db['UserProfile'][_0xe585('0x51')]({'where':{'id':_0x102b82[_0xe585('0x4f')]['id']}})['then'](handleEntityNotFound(_0x15ff80,null))[_0xe585('0x2b')](removeEntity(_0x15ff80,null))[_0xe585('0x4d')](handleError(_0x15ff80,null));};exports[_0xe585('0x63')]=function(_0x18d9c9,_0x57a0d5){return db[_0xe585('0x33')][_0xe585('0x63')]()[_0xe585('0x2b')](respondWithResult(_0x57a0d5,null))[_0xe585('0x4d')](handleError(_0x57a0d5,null));};exports['addSections']=function(_0x168696,_0x2f155a){var _0x182164=_0x168696[_0xe585('0x57')];return db[_0xe585('0x33')][_0xe585('0x51')]({'where':{'id':_0x168696['params']['id']}})[_0xe585('0x2b')](handleEntityNotFound(_0x2f155a,null))[_0xe585('0x2b')](function(_0x5005de){if(_0x5005de){return db['sequelize'][_0xe585('0x5a')](function(_0x5436fe){return db[_0xe585('0x5b')][_0xe585('0x2c')]({'where':{'userProfileId':_0x168696['params']['id'],'sectionId':_[_0xe585('0x5f')](_0x182164,function(_0x5c93b0){return _0x5c93b0[_0xe585('0x60')];})},'transaction':_0x5436fe})['then'](function(){var _0x248e9f=_['map'](_0x182164,function(_0x480d81){_0x480d81['userProfileId']=_0x168696[_0xe585('0x4f')]['id'];return _0x480d81;});var _0x2bc55a=[];return BPromise[_0xe585('0x5c')](_0x248e9f,function(_0x5f4363){return db['UserProfileSection'][_0xe585('0x52')](_0x5f4363,{'include':[{'model':db['UserProfileResource'],'as':_0xe585('0x62')}],'raw':!![],'transaction':_0x5436fe})[_0xe585('0x2b')](function(_0x1f0a76){_0x2bc55a[_0xe585('0x64')](_0x1f0a76[_0xe585('0x54')]({'plain':!![]}));});})[_0xe585('0x2b')](function(){return _0x2bc55a;});});});}})[_0xe585('0x2b')](function(_0x24587c){return _0x24587c;})[_0xe585('0x2b')](respondWithResult(_0x2f155a,null))[_0xe585('0x4d')](handleError(_0x2f155a,null));};exports[_0xe585('0x65')]=function(_0x3531e1,_0x679c51){var _0x2323db;return db[_0xe585('0x33')][_0xe585('0x51')]({'where':{'id':_0x3531e1['params']['id']},'attributes':['id',_0xe585('0x30')]})[_0xe585('0x2b')](handleEntityNotFound(_0x679c51,null))[_0xe585('0x2b')](function(_0xc2417b){if(_0xc2417b){_0x2323db=_0xc2417b;return db[_0xe585('0x5b')][_0xe585('0x2c')]({'where':{'userProfileId':_0x3531e1['params']['id'],'sectionId':_0x3531e1[_0xe585('0x39')][_0xe585('0x66')]}});}})[_0xe585('0x2b')](function(){return _0x2323db;})[_0xe585('0x2b')](respondWithStatusCode(_0x679c51,null))[_0xe585('0x4d')](handleError(_0x679c51,null));};exports['getSections']=function(_0x14fc0d,_0x4320c6){var _0x2953fe=[];var _0x437fc0=[];return db[_0xe585('0x5b')][_0xe585('0x4b')]({'where':{'userProfileId':_0x14fc0d[_0xe585('0x4f')]['id']},'raw':!![]})['then'](function(_0x1763e5){_0x2953fe=_[_0xe585('0x47')](_0x1763e5,function(_0x26a1ed){return _0x26a1ed[_0xe585('0x67')]===0x1||_['includes']([0x3eb,0x709],_0x26a1ed[_0xe585('0x60')]);});if(!_[_0xe585('0x68')](_0x2953fe)){return _[_0xe585('0x5f')](_0x2953fe,function(_0x4bf678){return _0x4bf678[_0xe585('0x60')];});}else{return;}})[_0xe585('0x2b')](function(_0x2357d8){if(_0x2357d8)_0x437fc0=_0x2357d8;if(_[_0xe585('0x69')](_0x437fc0,0x64)){var _0x555741=_[_0xe585('0x51')](_0x2953fe,{'sectionId':0x64});return hasDefaultDashboard(_0x555741)[_0xe585('0x2b')](function(_0x25cc7f){return _[_0xe585('0x5f')](_0x2953fe,function(_0xd84ec){if(_0xd84ec[_0xe585('0x60')]===0x64){_0xd84ec[_0xe585('0x6a')]=_0x25cc7f;}return _0xd84ec;});});}else{return;}})['then'](function(_0x206e23){if(_0x206e23)_0x2953fe=_0x206e23;if(_[_0xe585('0x69')](_0x437fc0,0x3eb)){var _0x3db7f0=_[_0xe585('0x51')](_0x2953fe,{'sectionId':0x3eb});return getCustomDashboards(_0x3db7f0)['then'](function(_0x1fdb6e){return _['map'](_0x2953fe,function(_0x40d0b5){if(_0x3db7f0[_0xe585('0x67')]){if(_0x40d0b5[_0xe585('0x60')]===0x3eb){_0x40d0b5[_0xe585('0x6a')]=_0x1fdb6e;}}else{if(_0x40d0b5['sectionId']===0x64){_0x40d0b5[_0xe585('0x6a')]=_0x1fdb6e;}}return _0x40d0b5;});});}else{return;}})[_0xe585('0x2b')](function(_0x14e6ed){if(_0x14e6ed)_0x2953fe=_0x14e6ed;if(_['includes'](_0x437fc0,0x709)){var _0x2d1a42=_[_0xe585('0x51')](_0x2953fe,{'sectionId':0x709});return getPlugins(_0x2d1a42)[_0xe585('0x2b')](function(_0x155030){if(_0x2d1a42[_0xe585('0x67')]){return _[_0xe585('0x5f')](_0x2953fe,function(_0x4b4cc4){if(_0x4b4cc4[_0xe585('0x60')]===0x709){_0x4b4cc4['subsections']=_0x155030;}return _0x4b4cc4;});}else{var _0xa09abe={'sectionId':0x76c,'enabled':0x1,'subsections':_0x155030};var _0x152923=_[_0xe585('0x5f')](_0x2953fe);_0x152923[_0xe585('0x64')](_0xa09abe);return _0x152923;}});}else{return;}})['then'](function(_0x5849b7){if(_0x5849b7)_0x2953fe=_0x5849b7;return _[_0xe585('0x47')](_0x2953fe,[_0xe585('0x67'),0x1]);})[_0xe585('0x2b')](respondWithResult(_0x4320c6,null))['catch'](handleError(_0x4320c6,null));};function hasDefaultDashboard(_0x25d9c9){var _0x40d8bd=[0x65];return new BPromise(function(_0x1ae2a0,_0x17c453){try{if(_0x25d9c9[_0xe585('0x5d')]){_0x1ae2a0(_0x40d8bd);}else{return db[_0xe585('0x5e')][_0xe585('0x6b')]({'where':{'sectionId':_0x25d9c9['id']},'raw':!![]})[_0xe585('0x2b')](function(_0x112c8e){_0x112c8e?_0x1ae2a0(_0x40d8bd):_0x1ae2a0();});}}catch(_0x55e4d1){_0x17c453(_0x55e4d1);}});}function getCustomDashboards(_0x408384){var _0x1d7fdb=[];return new BPromise(function(_0x20e6ba,_0x54978a){try{if(_0x408384[_0xe585('0x5d')]){return db[_0xe585('0x6c')][_0xe585('0x4b')]({'raw':!![]})[_0xe585('0x2b')](function(_0x4e3440){_0x4e3440[_0xe585('0x6d')](function(_0x1ac3c8){_0x1d7fdb[_0xe585('0x64')](_0x1ac3c8['id']+0x1869f);});_0x20e6ba(_0x1d7fdb);});}else{return db[_0xe585('0x5e')][_0xe585('0x4b')]({'where':{'sectionId':_0x408384['id']},'raw':!![]})[_0xe585('0x2b')](function(_0x1ff088){_0x1ff088[_0xe585('0x6d')](function(_0x1f2828){_0x1d7fdb[_0xe585('0x64')](_0x1f2828[_0xe585('0x6e')]+0x1869f);});_0x20e6ba(_0x1d7fdb);});}}catch(_0x4b3a76){_0x54978a(_0x4b3a76);}});}function getPlugins(_0x376045){var _0x2aade6=[];return new BPromise(function(_0x178d5d,_0x201f12){try{if(_0x376045[_0xe585('0x5d')]){return db[_0xe585('0x6f')][_0xe585('0x4b')]({'raw':!![]})[_0xe585('0x2b')](function(_0xe55082){_0xe55082[_0xe585('0x6d')](function(_0x5046a4){_0x2aade6[_0xe585('0x64')](_0x5046a4['id']+0x15b38);});_0x178d5d(_0x2aade6);});}else{return db[_0xe585('0x5e')][_0xe585('0x4b')]({'where':{'sectionId':_0x376045['id']},'raw':!![]})[_0xe585('0x2b')](function(_0x45ecea){_0x45ecea[_0xe585('0x6d')](function(_0x304a71){_0x2aade6[_0xe585('0x64')](_0x304a71[_0xe585('0x6e')]+0x15b38);});_0x178d5d(_0x2aade6);});}}catch(_0x1c6d6d){_0x201f12(_0x1c6d6d);}});}exports['addResources']=function(_0x198e3a,_0x2a42d0){return db[_0xe585('0x33')][_0xe585('0x51')]({'where':{'id':_0x198e3a[_0xe585('0x4f')]['id']}})[_0xe585('0x2b')](handleEntityNotFound(_0x2a42d0,null))[_0xe585('0x2b')](function(_0x5e9894){if(_0x5e9894){return db[_0xe585('0x70')][_0xe585('0x5a')](function(_0x3d2c87){return db[_0xe585('0x5b')]['findAll']({'where':{'userProfileId':_0x198e3a['params']['id']},'attributes':['id'],'raw':!![]})[_0xe585('0x2b')](function(_0xef885f){if(_0xef885f){return db[_0xe585('0x5b')][_0xe585('0x2c')]({'where':{'userProfileId':_0x198e3a[_0xe585('0x4f')]['id'],'id':_['map'](_0xef885f,function(_0x593aec){return _0x593aec['id'];})},'transaction':_0x3d2c87});}})[_0xe585('0x2b')](function(_0x45d3f5){var _0x22a9b1=_[_0xe585('0x5f')](_0x198e3a[_0xe585('0x57')],function(_0x384c68){_0x384c68[_0xe585('0x61')]=_0x198e3a[_0xe585('0x4f')]['id'];return _0x384c68;});return db[_0xe585('0x5b')][_0xe585('0x71')](_0x22a9b1,{'raw':!![],'transaction':_0x3d2c87});})[_0xe585('0x2b')](function(_0x42146d){var _0xc42c68=_['filter'](_['map'](_0x42146d,function(_0x349bde){return _0x349bde[_0xe585('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0xc42c68){return db[_0xe585('0x5b')][_0xe585('0x4b')]({'where':{'userProfileId':_0x198e3a[_0xe585('0x4f')]['id'],'sectionId':_['map'](_0xc42c68,function(_0x2b8fdb){return _0x2b8fdb[_0xe585('0x60')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xe585('0x2b')](function(_0x161d82){var _0x3076a4=_['map'](_0x198e3a[_0xe585('0x57')],function(_0x32371d){_0x32371d[_0xe585('0x61')]=_0x198e3a[_0xe585('0x4f')]['id'];return _0x32371d;});return db[_0xe585('0x5e')]['bulkCreate'](_0x3076a4,{'raw':!![],'transaction':_0x3d2c87});});}})[_0xe585('0x4d')](handleError(_0x2a42d0,null));});}})[_0xe585('0x2b')](function(_0x3e7740){var _0x10e17c=_['map'](_0x3e7740,function(_0x25466d){return _0x25466d[_0xe585('0x54')]({'plain':!![]});});})[_0xe585('0x2b')](respondWithResult(_0x2a42d0,null))[_0xe585('0x4d')](handleError(_0x2a42d0,null));};exports[_0xe585('0x72')]=function(_0x69781a,_0x8f0da8,_0x350253){return db[_0xe585('0x33')][_0xe585('0x51')]({'where':{'id':_0x69781a[_0xe585('0x4f')]['id']}})[_0xe585('0x2b')](handleEntityNotFound(_0x8f0da8,null))[_0xe585('0x2b')](function(_0x483eee){if(_0x483eee){return _0x483eee[_0xe585('0x72')](_0x69781a['query'][_0xe585('0x66')]);}})[_0xe585('0x2b')](respondWithStatusCode(_0x8f0da8,null))[_0xe585('0x4d')](handleError(_0x8f0da8,null));};exports['getResources']=function(_0x59ebd3,_0x7558a){var _0x3d5716={};if(!_0x59ebd3[_0xe585('0x39')][_0xe585('0x73')])throw new Error(_0xe585('0x74'));if(!_0x59ebd3[_0xe585('0x39')][_0xe585('0x3f')]('nolimit')){_0x3d5716[_0xe585('0x24')]=qs[_0xe585('0x24')](_0x59ebd3[_0xe585('0x39')][_0xe585('0x24')]);_0x3d5716[_0xe585('0x22')]=qs[_0xe585('0x22')](_0x59ebd3[_0xe585('0x39')][_0xe585('0x22')]);}return db['UserProfile'][_0xe585('0x51')]({'where':{'id':_0x59ebd3[_0xe585('0x4f')]['id']}})[_0xe585('0x2b')](function(_0x35108a){if(!_0x35108a)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x59ebd3['params']['id']);return db[_0xe585('0x33')][_0xe585('0x75')](_0x59ebd3);})[_0xe585('0x2b')](respondWithFilteredResult(_0x7558a,_0x3d5716))[_0xe585('0x4d')](handleError(_0x7558a,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 330b596..5aef789 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 _0xdfb1=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x311aad,_0x54d658){var _0x1779bd=function(_0x2520fb){while(--_0x2520fb){_0x311aad['push'](_0x311aad['shift']());}};_0x1779bd(++_0x54d658);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x19e18a,_0xe86938){_0x19e18a=_0x19e18a-0x0;var _0x30efe7=_0xdfb1[_0x19e18a];return _0x30efe7;};'use strict';var EventEmitter=require(_0x1dfb('0x0'));var UserProfile=require(_0x1dfb('0x1'))['db'][_0x1dfb('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1dfb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1dfb('0x4'),'afterDestroy':_0x1dfb('0x5')};function emitEvent(_0x19dc0c){return function(_0xc67a54,_0x57f6eb,_0x51ad43){UserProfileEvents['emit'](_0x19dc0c+':'+_0xc67a54['id'],_0xc67a54);UserProfileEvents[_0x1dfb('0x6')](_0x19dc0c,_0xc67a54);_0x51ad43(null);};}for(var e in events){if(events[_0x1dfb('0x7')](e)){var event=events[e];UserProfile[_0x1dfb('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x6050=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','hasOwnProperty'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x6050,0x196));var _0x0605=function(_0x39f6c7,_0x320c40){_0x39f6c7=_0x39f6c7-0x0;var _0x222586=_0x6050[_0x39f6c7];return _0x222586;};'use strict';var EventEmitter=require(_0x0605('0x0'));var UserProfile=require(_0x0605('0x1'))['db'][_0x0605('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0605('0x3')](0x0);var events={'afterCreate':_0x0605('0x4'),'afterUpdate':_0x0605('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22d595){return function(_0x4576f4,_0x43403d,_0x5797b0){UserProfileEvents['emit'](_0x22d595+':'+_0x4576f4['id'],_0x4576f4);UserProfileEvents['emit'](_0x22d595,_0x4576f4);_0x5797b0(null);};}for(var e in events){if(events[_0x0605('0x6')](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 862e357..f288802 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 _0x1155=['pauses','Pause','scheduler','Schedule','sounds','Sound','templates','triggers','Trigger','trunks','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','foreignKey','forEach','merge','options','includeAll','include','default','DefaultReports','custom','CustomReports','rows','ids','extraQueryConditions','count','CmContact','Tag','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','catch','model','name','resolve','UserProfileResource','map','AnalyticExtractedReport','type','toLowerCase','squareprojects','SquareProject','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','contacts','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','Campaign','MailQueue','mailaccounts','MailAccount','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','zohoaccounts','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard'];(function(_0x295849,_0x42b3eb){var _0x27d8d4=function(_0x375ae0){while(--_0x375ae0){_0x295849['push'](_0x295849['shift']());}};_0x27d8d4(++_0x42b3eb);}(_0x1155,0x1cb));var _0x5115=function(_0x25c99,_0x3c5c59){_0x25c99=_0x25c99-0x0;var _0x1f45f6=_0x1155[_0x25c99];return _0x1f45f6;};'use strict';var _=require(_0x5115('0x0'));var attributes=require(_0x5115('0x1'));var qs=require(_0x5115('0x2'));var squel=require(_0x5115('0x3'));module[_0x5115('0x4')]=function(_0x18e9cf){var _0xa404bf=_0x18e9cf[_0x5115('0x5')];function _0x198f94(_0x4fce29,_0x237aab){return new Promise(function(_0x12ed01,_0x17a269){if(!_0x237aab)return _0x12ed01(null);var _0x57fb27=_0x237aab['filter']?{[_0x237aab[_0x5115('0x6')][_0x5115('0x7')]]:_0x237aab['filter'][_0x5115('0x8')]}:undefined;return _0xa404bf[_0x4fce29][_0x5115('0x9')]({'where':_0x57fb27,'raw':!![]})[_0x5115('0xa')](function(_0x831ebf){_0x237aab[_0x5115('0xb')]=_['map'](_0x831ebf,'id');_0x12ed01(_0x237aab);})[_0x5115('0xc')](function(_0x567b1d){_0x17a269(_0x567b1d);});});}function _0x32d9c7(_0x51fb9e,_0x377837){return new Promise(function(_0x1a4419,_0x575803){var _0x42a8f8=_0x51fb9e[_0x5115('0x6')]?{[_0x51fb9e[_0x5115('0x6')][_0x5115('0x7')]]:_0x51fb9e[_0x5115('0x6')]['value']}:undefined;return _0xa404bf[_0x51fb9e[_0x5115('0xd')]]['findAll']({'where':_0x42a8f8,'raw':!![]})[_0x5115('0xa')](function(_0x277171){_0x377837[_0x5115('0xb')]=_['map'](_0x277171,function(_0x22bb56){return _0x22bb56[_0x5115('0xe')];});_0x1a4419(_0x377837);})[_0x5115('0xc')](function(_0x395573){_0x575803(_0x395573);});});}function _0x2fc743(_0x554c61,_0x1f9675,_0x172a1e){if(!_0x1f9675)return Promise[_0x5115('0xf')](null);return new Promise(function(_0x135974,_0x51f399){return _0xa404bf[_0x5115('0x10')][_0x5115('0x9')]({'where':{'sectionId':_0x1f9675['id']},'raw':!![]})[_0x5115('0xa')](function(_0x5d4b05){if(_0x554c61[_0x5115('0x7')]&&_0x554c61['field']!=='id'){_0x1f9675[_0x5115('0xb')]=_[_0x5115('0x11')](_0x5d4b05,function(_0x575dfa){return _0x575dfa[_0x554c61['field']];});}else{if(_0x172a1e===_0x5115('0x12')){_0x1f9675[_0x5115('0xb')]=_[_0x5115('0x11')](_0x5d4b05,function(_0x4c5efe){return{'id':_0x4c5efe['resourceId'],'type':_0x4c5efe[_0x5115('0x13')]};});}else{_0x1f9675['associatedResources']=_[_0x5115('0x11')](_0x5d4b05,function(_0x20382b){return _0x20382b['resourceId'];});}}_0x135974(_0x1f9675);})['catch'](function(_0x3f0fae){_0x51f399(_0x3f0fae);});});}function _0x1b46a7(_0x3e302c,_0x47dbbd){var _0x2c165c={'parentSections':[]};switch(_0x3e302c[_0x5115('0x14')]()){case _0x5115('0x15'):_0x2c165c['childModel']=_0x5115('0x16');break;case'odbc':_0x2c165c[_0x5115('0x17')]=_0x5115('0x18');break;case _0x5115('0x19'):_0x2c165c['childModel']=_0x5115('0x1a');_0x2c165c[_0x5115('0x1b')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x5115('0x1c')}];break;case'projects':_0x2c165c[_0x5115('0x17')]='JscriptyProject';break;case _0x5115('0x1d'):_0x2c165c[_0x5115('0x17')]='CmContact';_0x2c165c[_0x5115('0x1b')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case'lists':_0x2c165c[_0x5115('0x17')]=_0x5115('0x1e');break;case _0x5115('0x1f'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x20');break;case _0x5115('0x21'):_0x2c165c[_0x5115('0x17')]='CmCustomField';break;case _0x5115('0x22'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x23');break;case _0x5115('0x24'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x25');break;case _0x5115('0x26'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x27');break;case'faxaccounts':_0x2c165c[_0x5115('0x17')]='FaxAccount';break;case _0x5115('0x28'):case _0x5115('0x29'):case _0x5115('0x2a'):_0x2c165c[_0x5115('0x17')]='VoiceExtension';break;case _0x5115('0x2b'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x2c');break;case _0x5115('0x2d'):_0x2c165c['childModel']=_0x5115('0x2e');break;case _0x5115('0x2f'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x30');_0x2c165c[_0x5115('0x1b')]=[{'name':_0x5115('0x31'),'field':_0x5115('0xe'),'foreignKey':_0x5115('0x32'),'model':_0x5115('0x33'),'filter':{'field':'role','value':[_0x5115('0x34')]}},{'name':_0x5115('0x35'),'field':_0x5115('0xe'),'foreignKey':_0x5115('0x32'),'model':_0x5115('0x33'),'filter':{'field':_0x5115('0x36'),'value':[_0x5115('0x37')]}},{'name':'VoiceQueues','field':_0x5115('0xe'),'foreignKey':_0x5115('0x38'),'model':_0x5115('0x39'),'filter':{'field':_0x5115('0x13'),'value':['inbound']}},{'name':_0x5115('0x3a'),'field':_0x5115('0xe'),'foreignKey':_0x5115('0x38'),'model':_0x5115('0x39'),'filter':{'field':_0x5115('0x13'),'value':['outbound']}}];break;case _0x5115('0x3b'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x3c');break;case _0x5115('0x3d'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x3e');break;case _0x5115('0x3f'):_0x2c165c['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x2c165c[_0x5115('0x17')]=_0x5115('0x40');break;case'mailqueues':_0x2c165c['childModel']=_0x5115('0x41');break;case _0x5115('0x42'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x43');break;case'mailsubstatuses':_0x2c165c[_0x5115('0x17')]='MailSubstatus';break;case'openchannelqueues':_0x2c165c[_0x5115('0x17')]=_0x5115('0x44');break;case _0x5115('0x45'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x46');break;case _0x5115('0x47'):_0x2c165c[_0x5115('0x17')]='SmsQueue';break;case'smsaccounts':_0x2c165c[_0x5115('0x17')]='SmsAccount';break;case _0x5115('0x48'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x49');break;case'whatsappaccounts':_0x2c165c[_0x5115('0x17')]=_0x5115('0x4a');break;case _0x5115('0x4b'):_0x2c165c[_0x5115('0x17')]='Team';break;case _0x5115('0x4c'):case _0x5115('0x4d'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x39');if(_0x47dbbd){_0x2c165c['parentSections']=[{'name':'VoiceQueues'},{'name':_0x5115('0x3a')}];}break;case _0x5115('0x4e'):case _0x5115('0x4f'):case _0x5115('0x50'):_0x2c165c[_0x5115('0x17')]='User';if(_0x47dbbd){_0x2c165c[_0x5115('0x1b')]=[{'name':_0x5115('0x51'),'filter':{'field':'role','value':[_0x5115('0x52'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x5115('0x35')}];}break;case _0x5115('0x53'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x54');break;case _0x5115('0x55'):_0x2c165c[_0x5115('0x17')]='SalesforceAccount';break;case _0x5115('0x56'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x57');break;case _0x5115('0x58'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x59');break;case'deskaccounts':_0x2c165c[_0x5115('0x17')]='DeskAccount';break;case _0x5115('0x5a'):_0x2c165c[_0x5115('0x17')]='ZohoAccount';break;case _0x5115('0x5b'):_0x2c165c['childModel']=_0x5115('0x33');break;case _0x5115('0x5c'):_0x2c165c[_0x5115('0x17')]='CannedAnswer';break;case'dispositions':_0x2c165c[_0x5115('0x17')]=_0x5115('0x5d');break;case _0x5115('0x5e'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x5f');break;case'intervals':_0x2c165c[_0x5115('0x17')]='Interval';break;case _0x5115('0x60'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x61');break;case _0x5115('0x62'):_0x2c165c['childModel']=_0x5115('0x63');break;case _0x5115('0x64'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x65');break;case'tags':_0x2c165c[_0x5115('0x17')]='Tag';break;case _0x5115('0x66'):_0x2c165c['childModel']='Template';break;case _0x5115('0x67'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x68');break;case _0x5115('0x69'):_0x2c165c[_0x5115('0x17')]='Trunk';break;case'variables':_0x2c165c[_0x5115('0x17')]=_0x5115('0x6a');break;case _0x5115('0x6b'):_0x2c165c['childModel']=_0x5115('0x6c');break;case _0x5115('0x6d'):_0x2c165c['childModel']=_0x5115('0x12');_0x2c165c[_0x5115('0x1b')]=[{'name':_0x5115('0x6e'),'field':'id','foreignKey':_0x5115('0x6f')}];break;case _0x5115('0x70'):_0x2c165c[_0x5115('0x17')]=_0x5115('0x71');break;}return _0x2c165c;}function _0x58cb21(_0xe31ec4,_0x262a33){var _0x2df691=_0xe31ec4[_0x5115('0x72')](0x0)[_0x5115('0x73')]()+_0xe31ec4[_0x5115('0x74')](0x1);var _0x18d56c={'type':_0xa404bf[_0x5115('0x75')][_0x5115('0x76')][_0x5115('0x77')],'raw':!![]};return new Promise(function(_0x2fe509,_0x2bafb2){var _0x32c0b4=squel[_0x5115('0x78')]()[_0x5115('0x7')]('ui.'+_0x2df691+_0x5115('0x79'),'id')[_0x5115('0x7')](_0x5115('0x7a'))[_0x5115('0x7b')]('user_has_'+_0xe31ec4+'_interactions','ui')[_0x5115('0x7c')](_0x5115('0x7d'),_0x262a33['id']);return _0xa404bf[_0x5115('0x7e')][_0x5115('0x7f')](_0x32c0b4[_0x5115('0x80')](),_0x18d56c)[_0x5115('0xa')](function(_0x5dc672){_0x262a33[_0x2df691+_0x5115('0x81')]=_0x5dc672;_0x2fe509(_0x5dc672);})[_0x5115('0xc')](function(_0x5c3d1b){_0x2bafb2(_0x5c3d1b);});});}return _0x18e9cf[_0x5115('0x82')]('UserProfile',attributes,{'tableName':_0x5115('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4840a8){var _0x21bd68={'raw':_0x4840a8[_0x5115('0x7f')][_0x5115('0x84')],'where':{}};var _0x5cf6c5={};var _0x38b06f={'count':0x0,'rows':[]};var _0x2628a0=_0x4840a8[_0x5115('0x7f')][_0x5115('0x85')];var _0x1c246a=_0x4840a8[_0x5115('0x7f')][_0x5115('0x86')]||![];var _0x3b2702=_0x1b46a7(_0x2628a0,_0x1c246a);if(!_0x3b2702['childModel'])throw new Error(_0x5115('0x87')+_0x2628a0+'\x27');var _0x5bbc60=[{'name':_0x2628a0}];if(!_[_0x5115('0x88')](_0x3b2702[_0x5115('0x1b')]))_0x5bbc60=_0x3b2702[_0x5115('0x1b')];var _0x2f2fa6=[];for(var _0x3d9b78=0x0;_0x3d9b78<_0x5bbc60[_0x5115('0x89')];_0x3d9b78++){_0x2f2fa6[_0x5115('0x8a')](_0xa404bf[_0x5115('0x8b')][_0x5115('0x8c')]({'where':{'userProfileId':_0x4840a8[_0x5115('0x8d')]['id'],'name':_0x5bbc60[_0x3d9b78][_0x5115('0xe')]},'raw':!![]}));}return Promise[_0x5115('0x8e')](_0x2f2fa6)[_0x5115('0xa')](function(_0x11d6c7){var _0x393bc7=_[_0x5115('0x6')](_0x11d6c7,function(_0x2442bf){return _0x2442bf?_0x2442bf:undefined;});var _0x50267e=_[_0x5115('0x6')](_0x5bbc60,['ignore',!![]]);var _0x59ffc=_[_0x5115('0x88')](_0x393bc7)&&_[_0x5115('0x88')](_0x50267e)?null:_['union'](_0x50267e,_0x393bc7);if(!_0x59ffc)return null;var _0x557b6f=[];for(var _0x130c24=0x0;_0x130c24<_0x59ffc[_0x5115('0x89')];_0x130c24++){var _0x594fa=_['find'](_0x5bbc60,function(_0x3c25a8){return _0x59ffc[_0x130c24]?_0x3c25a8[_0x5115('0xe')]===_0x59ffc[_0x130c24][_0x5115('0xe')]:null;});if(_0x594fa){if(_0x59ffc[_0x130c24]['ignore']){_0x557b6f[_0x5115('0x8a')](_0x198f94(_0x3b2702[_0x5115('0x17')],_0x59ffc[_0x130c24]));}else{if(!_0x59ffc[_0x130c24][_0x5115('0x8f')]){_0x557b6f[_0x5115('0x8a')](_0x2fc743(_0x594fa,_0x59ffc[_0x130c24],_0x3b2702[_0x5115('0x17')]));}else{if(_0x594fa[_0x5115('0xd')]){_0x557b6f[_0x5115('0x8a')](_0x32d9c7(_0x594fa,_0x59ffc[_0x130c24]));}}}}}return Promise[_0x5115('0x8e')](_0x557b6f);})['then'](function(_0x1a54e2){var _0x55e8c3=_0x1a54e2;var _0xa4e8d0=null;if(_0x55e8c3){_0xa4e8d0=_0x55e8c3[_0x5115('0x89')]===0x1?_0x55e8c3[0x0]:null;}if(!_0xa4e8d0&&!_0x55e8c3)return _0x38b06f;var _0x35e62e=_0xa404bf[_0x3b2702['childModel']][_0x5115('0x90')];_0x5cf6c5[_0x5115('0xd')]=_[_0x5115('0x91')](_0x35e62e);_0x5cf6c5['query']=_[_0x5115('0x91')](_0x4840a8['query']);_0x5cf6c5[_0x5115('0x92')]=_[_0x5115('0x93')](_0x5cf6c5[_0x5115('0xd')],_0x5cf6c5[_0x5115('0x7f')]);_0x21bd68[_0x5115('0x94')]=_['intersection'](_0x5cf6c5['model'],qs['fields'](_0x4840a8[_0x5115('0x7f')][_0x5115('0x95')]));_0x21bd68[_0x5115('0x94')]=_0x21bd68[_0x5115('0x94')]['length']?_0x21bd68['attributes']:_0x5cf6c5[_0x5115('0xd')];if(!_0x4840a8[_0x5115('0x7f')][_0x5115('0x96')](_0x5115('0x97'))){_0x21bd68[_0x5115('0x98')]=qs[_0x5115('0x98')](_0x4840a8[_0x5115('0x7f')][_0x5115('0x98')]);_0x21bd68[_0x5115('0x99')]=qs['offset'](_0x4840a8[_0x5115('0x7f')][_0x5115('0x99')]);}_0x21bd68[_0x5115('0x9a')]=qs[_0x5115('0x9b')](_0x4840a8[_0x5115('0x7f')][_0x5115('0x9b')]);_0x21bd68[_0x5115('0x7c')]=qs[_0x5115('0x92')](_[_0x5115('0x9c')](_0x4840a8[_0x5115('0x7f')],_0x5cf6c5[_0x5115('0x92')]));if(_0x4840a8[_0x5115('0x7f')]['filter']){_0x21bd68[_0x5115('0x7c')]=_['merge'](_0x21bd68[_0x5115('0x7c')],{'$or':_[_0x5115('0x11')](_0x35e62e,function(_0x9b731f){if(_0x9b731f[_0x5115('0x13')][_0x5115('0x9d')]!=='VIRTUAL'){var _0x1d6201={};_0x1d6201[_0x9b731f[_0x5115('0x7')]]={'$like':'%'+_0x4840a8['query'][_0x5115('0x6')]+'%'};return _0x1d6201;}})});}var _0xb56d65=[];var _0x3fb1a3=null;var _0x5e9300={};if(_0xa4e8d0){_0x3fb1a3=_[_0x5115('0x8c')](_0x5bbc60,[_0x5115('0xe'),_0xa4e8d0[_0x5115('0xe')]]);if(_0x3fb1a3[_0x5115('0x7')]){_0x5e9300={};if(_0x3b2702[_0x5115('0x17')]===_0x5115('0x12')){_0x5e9300[_0x3fb1a3[_0x5115('0x9e')]]=_['map'](_0xa4e8d0[_0x5115('0xb')],'id');}else{_0x5e9300[_0x3fb1a3[_0x5115('0x9e')]]=_0xa4e8d0[_0x5115('0xb')];}_0xb56d65[_0x5115('0x8a')](_0x5e9300);}else{_0x21bd68[_0x5115('0x7c')]['id']=_0xa4e8d0['associatedResources'];}}else{for(var _0x4a6e19=0x0;_0x4a6e19<_0x55e8c3[_0x5115('0x89')];_0x4a6e19++){_0x3fb1a3=_[_0x5115('0x8c')](_0x5bbc60,[_0x5115('0xe'),_0x55e8c3[_0x4a6e19][_0x5115('0xe')]]);if(_0x3fb1a3[_0x5115('0x7')]){_0x5e9300={};_0x5e9300[_0x3fb1a3[_0x5115('0x9e')]]=_0x55e8c3[_0x4a6e19][_0x5115('0xb')];_0xb56d65['push'](_0x5e9300);}else{if(!_0x21bd68[_0x5115('0x7c')]['id'])_0x21bd68[_0x5115('0x7c')]['id']=[];_0x55e8c3[_0x4a6e19][_0x5115('0xb')][_0x5115('0x9f')](function(_0x5daf9d){_0x21bd68['where']['id']['push'](_0x5daf9d);});}}}if(!_['isEmpty'](_0xb56d65)){_0x21bd68[_0x5115('0x7c')]=_[_0x5115('0xa0')](_0x21bd68[_0x5115('0x7c')],{'$and':{'$or':_0xb56d65}});}_0x21bd68=_[_0x5115('0xa0')]({},_0x21bd68,_0x4840a8[_0x5115('0xa1')]);if(_0xa4e8d0&&!_0xa4e8d0['autoAssociation']&&_0x3b2702[_0x5115('0x17')]===_0x5115('0x12')){if(_0x4840a8[_0x5115('0x7f')][_0x5115('0xa2')]){_0x21bd68[_0x5115('0xa3')]=[{'all':!![]}];}return _0xa404bf[_0x3b2702[_0x5115('0x17')]][_0x5115('0x9')](_0x21bd68)['then'](function(_0x27a9af){var _0x5108e1=[];_0x27a9af['forEach'](function(_0x1d779e){var _0x4a0d10;switch(_0x1d779e['reportType']){case _0x5115('0xa4'):_0x4a0d10=_[_0x5115('0x8c')](_0xa4e8d0[_0x5115('0xb')],function(_0x11f6cb){return _0x11f6cb['id']===_0x1d779e[_0x5115('0x6f')]&&_0x11f6cb[_0x5115('0x13')]===_0x5115('0xa5');});break;case _0x5115('0xa6'):_0x4a0d10=_['find'](_0xa4e8d0[_0x5115('0xb')],function(_0x11a246){return _0x11a246['id']===_0x1d779e[_0x5115('0x6f')]&&_0x11a246[_0x5115('0x13')]===_0x5115('0xa7');});break;}if(_0x4a0d10)_0x5108e1[_0x5115('0x8a')](_0x1d779e);});_0x38b06f['count']=_0x5108e1[_0x5115('0x89')];_0x38b06f[_0x5115('0xa8')]=_0x5108e1;return _0x38b06f;});}else{if(!_['isEmpty'](_0x4840a8[_0x5115('0x7f')]['ids'])){_0x21bd68[_0x5115('0x7c')]['id']=_0x21bd68[_0x5115('0x7c')]['id']?_[_0x5115('0x93')](_0x21bd68[_0x5115('0x7c')]['id'],_0x4840a8[_0x5115('0x7f')]['ids']):_0x4840a8[_0x5115('0x7f')][_0x5115('0xa9')];if(_0x4840a8[_0x5115('0x7f')]['customSorting']){_0x21bd68[_0x5115('0x9a')]=_0x4840a8[_0x5115('0x7f')]['customSorting'];}}if(_0x4840a8[_0x5115('0x7f')]['extraQueryConditions']){_0x21bd68[_0x5115('0x7c')]=_[_0x5115('0xa0')](_0x21bd68[_0x5115('0x7c')],{'$and':_0x4840a8['query'][_0x5115('0xaa')]});}return _0xa404bf[_0x3b2702['childModel']][_0x5115('0xab')]({'where':_0x21bd68['where']})[_0x5115('0xa')](function(_0x576bd6){_0x38b06f[_0x5115('0xab')]=_0x576bd6;if(_0x4840a8[_0x5115('0x7f')][_0x5115('0xa2')]){if(_0x3b2702[_0x5115('0x17')]===_0x5115('0xac')){_0x21bd68[_0x5115('0xa3')]=[{'model':_0xa404bf[_0x5115('0xad')],'as':_0x5115('0xae'),'attributes':['id',_0x5115('0xe'),_0x5115('0xaf')],'required':_0x4840a8['query']['tag']?!![]:![]},{'model':_0xa404bf[_0x5115('0xad')],'as':'ThroughTags','attributes':['id',_0x5115('0xe'),_0x5115('0xaf')],'through':_0x4840a8[_0x5115('0x7f')][_0x5115('0xb0')]?{'attributes':[],'where':{'TagId':_0x4840a8['query']['tag']||undefined}}:{},'required':_0x4840a8[_0x5115('0x7f')][_0x5115('0xb0')]?!![]:![]}];}else{_0x21bd68['include']=[{'all':!![]}];}}return _0xa404bf[_0x3b2702[_0x5115('0x17')]]['findAll'](_0x21bd68);})['then'](function(_0x1cbea4){_0x38b06f[_0x5115('0xa8')]=_0x1cbea4;if(_0x2628a0===_0x5115('0x31')&&_0x4840a8[_0x5115('0x7f')][_0x5115('0xb1')]===_0x5115('0xb2')){var _0x913907=[];for(var _0x5b399f=0x0;_0x5b399f<_0x38b06f[_0x5115('0xa8')][_0x5115('0x89')];_0x5b399f++){_0x913907['push'](_0x58cb21(_0x5115('0xb3'),_0x38b06f[_0x5115('0xa8')][_0x5b399f][_0x5115('0xb4')]));_0x913907[_0x5115('0x8a')](_0x58cb21(_0x5115('0xb5'),_0x38b06f['rows'][_0x5b399f][_0x5115('0xb4')]));_0x913907['push'](_0x58cb21(_0x5115('0xb6'),_0x38b06f['rows'][_0x5b399f]['dataValues']));_0x913907[_0x5115('0x8a')](_0x58cb21(_0x5115('0xb7'),_0x38b06f[_0x5115('0xa8')][_0x5b399f][_0x5115('0xb4')]));_0x913907['push'](_0x58cb21('openchannel',_0x38b06f[_0x5115('0xa8')][_0x5b399f]['dataValues']));_0x913907[_0x5115('0x8a')](_0x58cb21(_0x5115('0xb8'),_0x38b06f['rows'][_0x5b399f]['dataValues']));}return Promise['all'](_0x913907)[_0x5115('0xa')](function(){return _0x38b06f;});}return _0x38b06f;});}});}}});}; \ No newline at end of file +var _0xf364=['Tag','templates','Template','triggers','trunks','Trunk','variables','Variable','extractedreports','Reports','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','InteractionId','from','user_has_','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','Invalid\x20section\x20\x27','push','find','params','all','isEmpty','union','length','ignore','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','AnalyticExtractedReport','include','reportType','default','reportId','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','includeAll','tag','ThroughTags','color','openTabs','true','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','findAll','then','associatedResources','map','value','model','name','catch','UserProfileResource','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','projectName','projects','contacts','CmContact','Lists','lists','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','User','telephone','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailAccount','mailsubstatuses','openchannelqueues','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','Users','admin','user','Telephones','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','Sound','tags'];(function(_0xdd3910,_0x11a2a5){var _0x530012=function(_0x4b57e6){while(--_0x4b57e6){_0xdd3910['push'](_0xdd3910['shift']());}};_0x530012(++_0x11a2a5);}(_0xf364,0x111));var _0x4f36=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf364[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x4f36('0x0'));var attributes=require(_0x4f36('0x1'));var qs=require(_0x4f36('0x2'));var squel=require(_0x4f36('0x3'));module[_0x4f36('0x4')]=function(_0x4894bb){var _0x30d69a=_0x4894bb[_0x4f36('0x5')];function _0x294d29(_0x3041cb,_0x5f0e79){return new Promise(function(_0x1a5bfa,_0x2485f2){if(!_0x5f0e79)return _0x1a5bfa(null);var _0x14434f=_0x5f0e79[_0x4f36('0x6')]?{[_0x5f0e79[_0x4f36('0x6')][_0x4f36('0x7')]]:_0x5f0e79['filter']['value']}:undefined;return _0x30d69a[_0x3041cb][_0x4f36('0x8')]({'where':_0x14434f,'raw':!![]})[_0x4f36('0x9')](function(_0x18fca4){_0x5f0e79[_0x4f36('0xa')]=_[_0x4f36('0xb')](_0x18fca4,'id');_0x1a5bfa(_0x5f0e79);})['catch'](function(_0x1ffc77){_0x2485f2(_0x1ffc77);});});}function _0x2401ba(_0x1d9a5c,_0x281cec){return new Promise(function(_0x222e1d,_0xa86038){var _0x2de05d=_0x1d9a5c[_0x4f36('0x6')]?{[_0x1d9a5c['filter'][_0x4f36('0x7')]]:_0x1d9a5c[_0x4f36('0x6')][_0x4f36('0xc')]}:undefined;return _0x30d69a[_0x1d9a5c[_0x4f36('0xd')]][_0x4f36('0x8')]({'where':_0x2de05d,'raw':!![]})[_0x4f36('0x9')](function(_0x1f245d){_0x281cec[_0x4f36('0xa')]=_[_0x4f36('0xb')](_0x1f245d,function(_0x3540c3){return _0x3540c3[_0x4f36('0xe')];});_0x222e1d(_0x281cec);})[_0x4f36('0xf')](function(_0x1b7310){_0xa86038(_0x1b7310);});});}function _0x324d68(_0x3206a7,_0x12fb31,_0x26e640){if(!_0x12fb31)return Promise['resolve'](null);return new Promise(function(_0x37e633,_0x3203ca){return _0x30d69a[_0x4f36('0x10')][_0x4f36('0x8')]({'where':{'sectionId':_0x12fb31['id']},'raw':!![]})[_0x4f36('0x9')](function(_0x292a43){if(_0x3206a7[_0x4f36('0x7')]&&_0x3206a7[_0x4f36('0x7')]!=='id'){_0x12fb31['associatedResources']=_[_0x4f36('0xb')](_0x292a43,function(_0x1bf877){return _0x1bf877[_0x3206a7['field']];});}else{if(_0x26e640==='AnalyticExtractedReport'){_0x12fb31[_0x4f36('0xa')]=_[_0x4f36('0xb')](_0x292a43,function(_0x1a7e37){return{'id':_0x1a7e37[_0x4f36('0x11')],'type':_0x1a7e37['type']};});}else{_0x12fb31[_0x4f36('0xa')]=_[_0x4f36('0xb')](_0x292a43,function(_0x234ca7){return _0x234ca7[_0x4f36('0x11')];});}}_0x37e633(_0x12fb31);})['catch'](function(_0x1fb9f1){_0x3203ca(_0x1fb9f1);});});}function _0x4b00ce(_0x25d114,_0x595550){var _0x4c6adf={'parentSections':[]};switch(_0x25d114[_0x4f36('0x12')]()){case _0x4f36('0x13'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x15');break;case _0x4f36('0x16'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x17');break;case _0x4f36('0x18'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x19');_0x4c6adf[_0x4f36('0x1a')]=[{'name':'SquareProjects','field':_0x4f36('0xe'),'foreignKey':_0x4f36('0x1b')}];break;case _0x4f36('0x1c'):_0x4c6adf[_0x4f36('0x14')]='JscriptyProject';break;case _0x4f36('0x1d'):_0x4c6adf['childModel']=_0x4f36('0x1e');_0x4c6adf[_0x4f36('0x1a')]=[{'name':_0x4f36('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x4f36('0x20'):_0x4c6adf[_0x4f36('0x14')]='CmList';break;case _0x4f36('0x21'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x22');break;case _0x4f36('0x23'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x24');break;case'chatqueues':_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x25');break;case _0x4f36('0x26'):_0x4c6adf[_0x4f36('0x14')]='ChatWebsite';break;case _0x4f36('0x27'):_0x4c6adf['childModel']=_0x4f36('0x28');break;case _0x4f36('0x29'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x2a');break;case'inboundroutes':case _0x4f36('0x2b'):case _0x4f36('0x2c'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x2d');break;case _0x4f36('0x2e'):_0x4c6adf[_0x4f36('0x14')]='VoiceContext';break;case _0x4f36('0x2f'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x30');break;case _0x4f36('0x31'):_0x4c6adf['childModel']=_0x4f36('0x32');_0x4c6adf['parentSections']=[{'name':_0x4f36('0x33'),'field':'name','foreignKey':_0x4f36('0x34'),'model':'User','filter':{'field':_0x4f36('0x35'),'value':['agent']}},{'name':'Telephones','field':_0x4f36('0xe'),'foreignKey':'membername','model':_0x4f36('0x36'),'filter':{'field':_0x4f36('0x35'),'value':[_0x4f36('0x37')]}},{'name':_0x4f36('0x38'),'field':_0x4f36('0xe'),'foreignKey':'queue','model':_0x4f36('0x39'),'filter':{'field':_0x4f36('0x3a'),'value':[_0x4f36('0x3b')]}},{'name':_0x4f36('0x3c'),'field':_0x4f36('0xe'),'foreignKey':_0x4f36('0x3d'),'model':'VoiceQueue','filter':{'field':_0x4f36('0x3a'),'value':[_0x4f36('0x3e')]}}];break;case _0x4f36('0x3f'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x40');break;case'chanspies':_0x4c6adf[_0x4f36('0x14')]='VoiceChanSpy';break;case _0x4f36('0x41'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x42');break;case _0x4f36('0x43'):_0x4c6adf['childModel']=_0x4f36('0x44');break;case _0x4f36('0x45'):_0x4c6adf['childModel']='MailQueue';break;case'mailaccounts':_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x46');break;case _0x4f36('0x47'):_0x4c6adf[_0x4f36('0x14')]='MailSubstatus';break;case _0x4f36('0x48'):_0x4c6adf['childModel']='OpenchannelQueue';break;case'openchannelaccounts':_0x4c6adf[_0x4f36('0x14')]='OpenchannelAccount';break;case _0x4f36('0x49'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x4a');break;case _0x4f36('0x4b'):_0x4c6adf[_0x4f36('0x14')]='SmsAccount';break;case _0x4f36('0x4c'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x4d');break;case _0x4f36('0x4e'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x4f');break;case _0x4f36('0x50'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x51');break;case _0x4f36('0x52'):case _0x4f36('0x53'):_0x4c6adf[_0x4f36('0x14')]='VoiceQueue';if(_0x595550){_0x4c6adf[_0x4f36('0x1a')]=[{'name':_0x4f36('0x38')},{'name':_0x4f36('0x3c')}];}break;case'users':case'agents':case'telephones':_0x4c6adf['childModel']=_0x4f36('0x36');if(_0x595550){_0x4c6adf[_0x4f36('0x1a')]=[{'name':_0x4f36('0x54'),'filter':{'field':_0x4f36('0x35'),'value':[_0x4f36('0x55'),_0x4f36('0x56')]},'ignore':!![]},{'name':_0x4f36('0x33')},{'name':_0x4f36('0x57')}];}break;case _0x4f36('0x58'):_0x4c6adf[_0x4f36('0x14')]='ZendeskAccount';break;case _0x4f36('0x59'):_0x4c6adf['childModel']=_0x4f36('0x5a');break;case'freshdeskaccounts':_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x5b');break;case _0x4f36('0x5c'):_0x4c6adf[_0x4f36('0x14')]='SugarcrmAccount';break;case _0x4f36('0x5d'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x5e');break;case'zohoaccounts':_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x5f');break;case _0x4f36('0x60'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x36');break;case'cannedanswers':_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x61');break;case _0x4f36('0x62'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x63');break;case _0x4f36('0x64'):_0x4c6adf['childModel']=_0x4f36('0x65');break;case'intervals':_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x66');break;case _0x4f36('0x67'):_0x4c6adf['childModel']=_0x4f36('0x68');break;case _0x4f36('0x69'):_0x4c6adf['childModel']=_0x4f36('0x6a');break;case'sounds':_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x6b');break;case _0x4f36('0x6c'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x6d');break;case _0x4f36('0x6e'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x6f');break;case _0x4f36('0x70'):_0x4c6adf['childModel']='Trigger';break;case _0x4f36('0x71'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x72');break;case _0x4f36('0x73'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x74');break;case'plugins':_0x4c6adf[_0x4f36('0x14')]='Plugin';break;case _0x4f36('0x75'):_0x4c6adf['childModel']='AnalyticExtractedReport';_0x4c6adf['parentSections']=[{'name':_0x4f36('0x76'),'field':'id','foreignKey':'reportId'}];break;case _0x4f36('0x77'):_0x4c6adf[_0x4f36('0x14')]=_0x4f36('0x78');break;}return _0x4c6adf;}function _0x397619(_0x53a4fd,_0x1deab1){var _0x47ad16=_0x53a4fd[_0x4f36('0x79')](0x0)[_0x4f36('0x7a')]()+_0x53a4fd[_0x4f36('0x7b')](0x1);var _0x2cab09={'type':_0x30d69a['Sequelize'][_0x4f36('0x7c')][_0x4f36('0x7d')],'raw':!![]};return new Promise(function(_0xf9d9af,_0x400245){var _0x6a02e5=squel[_0x4f36('0x7e')]()[_0x4f36('0x7')]('ui.'+_0x47ad16+_0x4f36('0x7f'),'id')['field']('ui.createdAt')[_0x4f36('0x80')](_0x4f36('0x81')+_0x53a4fd+'_interactions','ui')[_0x4f36('0x82')]('ui.UserId\x20=\x20?',_0x1deab1['id']);return _0x30d69a[_0x4f36('0x83')][_0x4f36('0x84')](_0x6a02e5[_0x4f36('0x85')](),_0x2cab09)[_0x4f36('0x9')](function(_0x20ddb8){_0x1deab1[_0x47ad16+_0x4f36('0x86')]=_0x20ddb8;_0xf9d9af(_0x20ddb8);})[_0x4f36('0xf')](function(_0x24c72e){_0x400245(_0x24c72e);});});}return _0x4894bb[_0x4f36('0x87')](_0x4f36('0x88'),attributes,{'tableName':_0x4f36('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x40751d){var _0x4f3375={'raw':_0x40751d[_0x4f36('0x84')][_0x4f36('0x8a')],'where':{}};var _0x4489ad={};var _0xa61ab0={'count':0x0,'rows':[]};var _0x478adc=_0x40751d['query']['section'];var _0x148c7b=_0x40751d[_0x4f36('0x84')][_0x4f36('0x8b')]||![];var _0x2df894=_0x4b00ce(_0x478adc,_0x148c7b);if(!_0x2df894[_0x4f36('0x14')])throw new Error(_0x4f36('0x8c')+_0x478adc+'\x27');var _0x1fbff4=[{'name':_0x478adc}];if(!_['isEmpty'](_0x2df894[_0x4f36('0x1a')]))_0x1fbff4=_0x2df894[_0x4f36('0x1a')];var _0x1d52dd=[];for(var _0x1c2ea1=0x0;_0x1c2ea1<_0x1fbff4['length'];_0x1c2ea1++){_0x1d52dd[_0x4f36('0x8d')](_0x30d69a['UserProfileSection'][_0x4f36('0x8e')]({'where':{'userProfileId':_0x40751d[_0x4f36('0x8f')]['id'],'name':_0x1fbff4[_0x1c2ea1][_0x4f36('0xe')]},'raw':!![]}));}return Promise[_0x4f36('0x90')](_0x1d52dd)['then'](function(_0x27d4b8){var _0x98ae5=_[_0x4f36('0x6')](_0x27d4b8,function(_0x1cceac){return _0x1cceac?_0x1cceac:undefined;});var _0x32c479=_[_0x4f36('0x6')](_0x1fbff4,['ignore',!![]]);var _0x430f93=_[_0x4f36('0x91')](_0x98ae5)&&_['isEmpty'](_0x32c479)?null:_[_0x4f36('0x92')](_0x32c479,_0x98ae5);if(!_0x430f93)return null;var _0x4d23a7=[];for(var _0xdc4677=0x0;_0xdc4677<_0x430f93[_0x4f36('0x93')];_0xdc4677++){var _0x4ab3ba=_[_0x4f36('0x8e')](_0x1fbff4,function(_0x5d80c8){return _0x430f93[_0xdc4677]?_0x5d80c8['name']===_0x430f93[_0xdc4677][_0x4f36('0xe')]:null;});if(_0x4ab3ba){if(_0x430f93[_0xdc4677][_0x4f36('0x94')]){_0x4d23a7['push'](_0x294d29(_0x2df894[_0x4f36('0x14')],_0x430f93[_0xdc4677]));}else{if(!_0x430f93[_0xdc4677][_0x4f36('0x95')]){_0x4d23a7[_0x4f36('0x8d')](_0x324d68(_0x4ab3ba,_0x430f93[_0xdc4677],_0x2df894[_0x4f36('0x14')]));}else{if(_0x4ab3ba[_0x4f36('0xd')]){_0x4d23a7[_0x4f36('0x8d')](_0x2401ba(_0x4ab3ba,_0x430f93[_0xdc4677]));}}}}}return Promise[_0x4f36('0x90')](_0x4d23a7);})[_0x4f36('0x9')](function(_0x23a42f){var _0x402a94=_0x23a42f;var _0x58a92c=null;if(_0x402a94){_0x58a92c=_0x402a94[_0x4f36('0x93')]===0x1?_0x402a94[0x0]:null;}if(!_0x58a92c&&!_0x402a94)return _0xa61ab0;var _0x518c50=_0x30d69a[_0x2df894[_0x4f36('0x14')]][_0x4f36('0x96')];_0x4489ad[_0x4f36('0xd')]=_['keys'](_0x518c50);_0x4489ad[_0x4f36('0x84')]=_[_0x4f36('0x97')](_0x40751d[_0x4f36('0x84')]);_0x4489ad[_0x4f36('0x98')]=_['intersection'](_0x4489ad['model'],_0x4489ad['query']);_0x4f3375[_0x4f36('0x99')]=_[_0x4f36('0x9a')](_0x4489ad['model'],qs[_0x4f36('0x9b')](_0x40751d[_0x4f36('0x84')][_0x4f36('0x9b')]));_0x4f3375[_0x4f36('0x99')]=_0x4f3375[_0x4f36('0x99')]['length']?_0x4f3375[_0x4f36('0x99')]:_0x4489ad[_0x4f36('0xd')];if(!_0x40751d[_0x4f36('0x84')][_0x4f36('0x9c')]('nolimit')){_0x4f3375['limit']=qs[_0x4f36('0x9d')](_0x40751d[_0x4f36('0x84')]['limit']);_0x4f3375[_0x4f36('0x9e')]=qs['offset'](_0x40751d[_0x4f36('0x84')][_0x4f36('0x9e')]);}_0x4f3375[_0x4f36('0x9f')]=qs[_0x4f36('0xa0')](_0x40751d[_0x4f36('0x84')][_0x4f36('0xa0')]);_0x4f3375[_0x4f36('0x82')]=qs[_0x4f36('0x98')](_[_0x4f36('0xa1')](_0x40751d['query'],_0x4489ad[_0x4f36('0x98')]));if(_0x40751d['query'][_0x4f36('0x6')]){_0x4f3375['where']=_[_0x4f36('0xa2')](_0x4f3375[_0x4f36('0x82')],{'$or':_[_0x4f36('0xb')](_0x518c50,function(_0x1e1270){if(_0x1e1270[_0x4f36('0x3a')][_0x4f36('0xa3')]!==_0x4f36('0xa4')){var _0x271bfe={};_0x271bfe[_0x1e1270[_0x4f36('0x7')]]={'$like':'%'+_0x40751d[_0x4f36('0x84')][_0x4f36('0x6')]+'%'};return _0x271bfe;}})});}var _0x5dae1e=[];var _0x1262f8=null;var _0x398ed0={};if(_0x58a92c){_0x1262f8=_[_0x4f36('0x8e')](_0x1fbff4,[_0x4f36('0xe'),_0x58a92c[_0x4f36('0xe')]]);if(_0x1262f8[_0x4f36('0x7')]){_0x398ed0={};if(_0x2df894[_0x4f36('0x14')]==='AnalyticExtractedReport'){_0x398ed0[_0x1262f8['foreignKey']]=_[_0x4f36('0xb')](_0x58a92c[_0x4f36('0xa')],'id');}else{_0x398ed0[_0x1262f8[_0x4f36('0xa5')]]=_0x58a92c[_0x4f36('0xa')];}_0x5dae1e[_0x4f36('0x8d')](_0x398ed0);}else{_0x4f3375[_0x4f36('0x82')]['id']=_0x58a92c[_0x4f36('0xa')];}}else{for(var _0x5aafc1=0x0;_0x5aafc1<_0x402a94[_0x4f36('0x93')];_0x5aafc1++){_0x1262f8=_['find'](_0x1fbff4,['name',_0x402a94[_0x5aafc1][_0x4f36('0xe')]]);if(_0x1262f8['field']){_0x398ed0={};_0x398ed0[_0x1262f8[_0x4f36('0xa5')]]=_0x402a94[_0x5aafc1][_0x4f36('0xa')];_0x5dae1e[_0x4f36('0x8d')](_0x398ed0);}else{if(!_0x4f3375['where']['id'])_0x4f3375['where']['id']=[];_0x402a94[_0x5aafc1][_0x4f36('0xa')][_0x4f36('0xa6')](function(_0xea85f4){_0x4f3375[_0x4f36('0x82')]['id'][_0x4f36('0x8d')](_0xea85f4);});}}}if(!_['isEmpty'](_0x5dae1e)){_0x4f3375[_0x4f36('0x82')]=_[_0x4f36('0xa2')](_0x4f3375['where'],{'$and':{'$or':_0x5dae1e}});}_0x4f3375=_[_0x4f36('0xa2')]({},_0x4f3375,_0x40751d[_0x4f36('0xa7')]);if(_0x58a92c&&!_0x58a92c['autoAssociation']&&_0x2df894['childModel']===_0x4f36('0xa8')){if(_0x40751d['query']['includeAll']){_0x4f3375[_0x4f36('0xa9')]=[{'all':!![]}];}return _0x30d69a[_0x2df894[_0x4f36('0x14')]][_0x4f36('0x8')](_0x4f3375)[_0x4f36('0x9')](function(_0x89aee9){var _0x47f42d=[];_0x89aee9[_0x4f36('0xa6')](function(_0x4640b1){var _0x14fb5e;switch(_0x4640b1[_0x4f36('0xaa')]){case _0x4f36('0xab'):_0x14fb5e=_['find'](_0x58a92c[_0x4f36('0xa')],function(_0x28b40e){return _0x28b40e['id']===_0x4640b1[_0x4f36('0xac')]&&_0x28b40e[_0x4f36('0x3a')]===_0x4f36('0xad');});break;case _0x4f36('0xae'):_0x14fb5e=_[_0x4f36('0x8e')](_0x58a92c[_0x4f36('0xa')],function(_0x1d2570){return _0x1d2570['id']===_0x4640b1[_0x4f36('0xac')]&&_0x1d2570[_0x4f36('0x3a')]==='CustomReports';});break;}if(_0x14fb5e)_0x47f42d[_0x4f36('0x8d')](_0x4640b1);});_0xa61ab0[_0x4f36('0xaf')]=_0x47f42d[_0x4f36('0x93')];_0xa61ab0[_0x4f36('0xb0')]=_0x47f42d;return _0xa61ab0;});}else{if(!_[_0x4f36('0x91')](_0x40751d[_0x4f36('0x84')][_0x4f36('0xb1')])){_0x4f3375[_0x4f36('0x82')]['id']=_0x4f3375['where']['id']?_[_0x4f36('0x9a')](_0x4f3375[_0x4f36('0x82')]['id'],_0x40751d[_0x4f36('0x84')][_0x4f36('0xb1')]):_0x40751d[_0x4f36('0x84')][_0x4f36('0xb1')];if(_0x40751d['query']['customSorting']){_0x4f3375[_0x4f36('0x9f')]=_0x40751d[_0x4f36('0x84')][_0x4f36('0xb2')];}}if(_0x40751d[_0x4f36('0x84')]['extraQueryConditions']){_0x4f3375['where']=_[_0x4f36('0xa2')](_0x4f3375[_0x4f36('0x82')],{'$and':_0x40751d[_0x4f36('0x84')][_0x4f36('0xb3')]});}return _0x30d69a[_0x2df894[_0x4f36('0x14')]][_0x4f36('0xaf')]({'where':_0x4f3375[_0x4f36('0x82')]})[_0x4f36('0x9')](function(_0x4c7a71){_0xa61ab0[_0x4f36('0xaf')]=_0x4c7a71;if(_0x40751d[_0x4f36('0x84')][_0x4f36('0xb4')]){if(_0x2df894[_0x4f36('0x14')]===_0x4f36('0x1e')){_0x4f3375[_0x4f36('0xa9')]=[{'model':_0x30d69a['Tag'],'as':'Tags','attributes':['id',_0x4f36('0xe'),'color'],'required':_0x40751d['query'][_0x4f36('0xb5')]?!![]:![]},{'model':_0x30d69a[_0x4f36('0x6d')],'as':_0x4f36('0xb6'),'attributes':['id',_0x4f36('0xe'),_0x4f36('0xb7')],'through':_0x40751d[_0x4f36('0x84')][_0x4f36('0xb5')]?{'attributes':[],'where':{'TagId':_0x40751d[_0x4f36('0x84')][_0x4f36('0xb5')]||undefined}}:{},'required':_0x40751d['query']['tag']?!![]:![]}];}else{_0x4f3375[_0x4f36('0xa9')]=[{'all':!![]}];}}return _0x30d69a[_0x2df894[_0x4f36('0x14')]]['findAll'](_0x4f3375);})[_0x4f36('0x9')](function(_0x37db0f){_0xa61ab0[_0x4f36('0xb0')]=_0x37db0f;if(_0x478adc===_0x4f36('0x33')&&_0x40751d[_0x4f36('0x84')][_0x4f36('0xb8')]===_0x4f36('0xb9')){var _0x2dd044=[];for(var _0x3bd468=0x0;_0x3bd468<_0xa61ab0[_0x4f36('0xb0')][_0x4f36('0x93')];_0x3bd468++){_0x2dd044['push'](_0x397619('chat',_0xa61ab0[_0x4f36('0xb0')][_0x3bd468][_0x4f36('0xba')]));_0x2dd044[_0x4f36('0x8d')](_0x397619(_0x4f36('0xbb'),_0xa61ab0[_0x4f36('0xb0')][_0x3bd468][_0x4f36('0xba')]));_0x2dd044['push'](_0x397619(_0x4f36('0xbc'),_0xa61ab0['rows'][_0x3bd468][_0x4f36('0xba')]));_0x2dd044[_0x4f36('0x8d')](_0x397619(_0x4f36('0xbd'),_0xa61ab0[_0x4f36('0xb0')][_0x3bd468][_0x4f36('0xba')]));_0x2dd044[_0x4f36('0x8d')](_0x397619(_0x4f36('0xbe'),_0xa61ab0[_0x4f36('0xb0')][_0x3bd468]['dataValues']));_0x2dd044['push'](_0x397619('whatsapp',_0xa61ab0[_0x4f36('0xb0')][_0x3bd468][_0x4f36('0xba')]));}return Promise[_0x4f36('0x90')](_0x2dd044)[_0x4f36('0x9')](function(){return _0xa61ab0;});}return _0xa61ab0;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 0f8fc96..2f34bf0 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 _0xb5dd=['socket.io-emitter','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x509ce7,_0x5d320a){var _0x21a745=function(_0x3b2131){while(--_0x3b2131){_0x509ce7['push'](_0x509ce7['shift']());}};_0x21a745(++_0x5d320a);}(_0xb5dd,0xd9));var _0xdb5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdb5d('0x0'));var util=require(_0xdb5d('0x1'));var moment=require(_0xdb5d('0x2'));var BPromise=require(_0xdb5d('0x3'));var rs=require(_0xdb5d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb5d('0x5'))['db'];var utils=require(_0xdb5d('0x6'));var logger=require(_0xdb5d('0x7'))('rpc');var config=require(_0xdb5d('0x8'));var jayson=require(_0xdb5d('0x9'));var client=jayson[_0xdb5d('0xa')][_0xdb5d('0xb')]({'port':0x232a});config[_0xdb5d('0xc')]=_[_0xdb5d('0xd')](config[_0xdb5d('0xc')],{'host':_0xdb5d('0xe'),'port':0x18eb});var socket=require(_0xdb5d('0xf'))(new Redis(config[_0xdb5d('0xc')]));require('./userProfile.socket')[_0xdb5d('0x10')](socket);function respondWithRpcPromise(_0x288b8f,_0x2a0f4a,_0x4fb3ab){return new BPromise(function(_0x541c31,_0xeb1c09){return client[_0xdb5d('0x11')](_0x288b8f,_0x4fb3ab)[_0xdb5d('0x12')](function(_0x56eb05){logger['info'](_0xdb5d('0x13'),_0x2a0f4a,_0xdb5d('0x14'));logger[_0xdb5d('0x15')](_0xdb5d('0x16'),_0x2a0f4a,_0xdb5d('0x14'),JSON[_0xdb5d('0x17')](_0x56eb05));if(_0x56eb05[_0xdb5d('0x18')]){if(_0x56eb05['error'][_0xdb5d('0x19')]===0x1f4){logger[_0xdb5d('0x18')](_0xdb5d('0x13'),_0x2a0f4a,_0x56eb05['error'][_0xdb5d('0x1a')]);return _0xeb1c09(_0x56eb05[_0xdb5d('0x18')][_0xdb5d('0x1a')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x2a0f4a,_0x56eb05[_0xdb5d('0x18')]['message']);return _0x541c31(_0x56eb05[_0xdb5d('0x18')][_0xdb5d('0x1a')]);}else{logger[_0xdb5d('0x1b')](_0xdb5d('0x13'),_0x2a0f4a,_0xdb5d('0x14'));_0x541c31(_0x56eb05[_0xdb5d('0x1c')][_0xdb5d('0x1a')]);}})['catch'](function(_0x21e981){logger['error'](_0xdb5d('0x13'),_0x2a0f4a,_0x21e981);_0xeb1c09(_0x21e981);});});} \ No newline at end of file +var _0xa848=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x309dd7,_0x24adc3){var _0x40431e=function(_0x3cbd20){while(--_0x3cbd20){_0x309dd7['push'](_0x309dd7['shift']());}};_0x40431e(++_0x24adc3);}(_0xa848,0x99));var _0x8a84=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa848[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var moment=require(_0x8a84('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a84('0x3'));var fs=require('fs');var Redis=require(_0x8a84('0x4'));var db=require(_0x8a84('0x5'))['db'];var utils=require(_0x8a84('0x6'));var logger=require(_0x8a84('0x7'))(_0x8a84('0x8'));var config=require(_0x8a84('0x9'));var jayson=require(_0x8a84('0xa'));var client=jayson[_0x8a84('0xb')][_0x8a84('0xc')]({'port':0x232a});config[_0x8a84('0xd')]=_[_0x8a84('0xe')](config[_0x8a84('0xd')],{'host':_0x8a84('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a84('0xd')]));require(_0x8a84('0x10'))[_0x8a84('0x11')](socket);function respondWithRpcPromise(_0x47e2f6,_0x2d023b,_0xcd8e1c){return new BPromise(function(_0x398075,_0x305e65){return client[_0x8a84('0x12')](_0x47e2f6,_0xcd8e1c)[_0x8a84('0x13')](function(_0x53533e){logger[_0x8a84('0x14')](_0x8a84('0x15'),_0x2d023b,_0x8a84('0x16'));logger[_0x8a84('0x17')](_0x8a84('0x18'),_0x2d023b,'request\x20sent',JSON[_0x8a84('0x19')](_0x53533e));if(_0x53533e[_0x8a84('0x1a')]){if(_0x53533e[_0x8a84('0x1a')]['code']===0x1f4){logger[_0x8a84('0x1a')](_0x8a84('0x15'),_0x2d023b,_0x53533e[_0x8a84('0x1a')]['message']);return _0x305e65(_0x53533e[_0x8a84('0x1a')][_0x8a84('0x1b')]);}logger['error'](_0x8a84('0x15'),_0x2d023b,_0x53533e[_0x8a84('0x1a')][_0x8a84('0x1b')]);return _0x398075(_0x53533e[_0x8a84('0x1a')]['message']);}else{logger[_0x8a84('0x14')](_0x8a84('0x15'),_0x2d023b,_0x8a84('0x16'));_0x398075(_0x53533e[_0x8a84('0x1c')][_0x8a84('0x1b')]);}})[_0x8a84('0x1d')](function(_0x5bd7d9){logger[_0x8a84('0x1a')]('UserProfile,\x20%s,\x20%s',_0x2d023b,_0x5bd7d9);_0x305e65(_0x5bd7d9);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 112d609..2fc977e 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 _0x0289=['length','userProfile:','./userProfile.events','remove','update','emit','removeListener','register'];(function(_0x1b575f,_0x20d688){var _0x56bbd2=function(_0x214c19){while(--_0x214c19){_0x1b575f['push'](_0x1b575f['shift']());}};_0x56bbd2(++_0x20d688);}(_0x0289,0x1c2));var _0x9028=function(_0x233e6f,_0x4019ac){_0x233e6f=_0x233e6f-0x0;var _0x1deeb0=_0x0289[_0x233e6f];return _0x1deeb0;};'use strict';var UserProfileEvents=require(_0x9028('0x0'));var events=['save',_0x9028('0x1'),_0x9028('0x2')];function createListener(_0x39bc12,_0x459b8b){return function(_0x3da78a){_0x459b8b[_0x9028('0x3')](_0x39bc12,_0x3da78a);};}function removeListener(_0x276396,_0x10560a){return function(){UserProfileEvents[_0x9028('0x4')](_0x276396,_0x10560a);};}exports[_0x9028('0x5')]=function(_0xc2cd7b){for(var _0xa8f2bf=0x0,_0x2270c3=events[_0x9028('0x6')];_0xa8f2bf<_0x2270c3;_0xa8f2bf++){var _0x539026=events[_0xa8f2bf];var _0x230d53=createListener(_0x9028('0x7')+_0x539026,_0xc2cd7b);UserProfileEvents['on'](_0x539026,_0x230d53);}}; \ No newline at end of file +var _0x3aa9=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x3aa9,0xf4));var _0x93aa=function(_0xe53051,_0x50e3a1){_0xe53051=_0xe53051-0x0;var _0x3c6cbf=_0x3aa9[_0xe53051];return _0x3c6cbf;};'use strict';var UserProfileEvents=require(_0x93aa('0x0'));var events=[_0x93aa('0x1'),_0x93aa('0x2'),_0x93aa('0x3')];function createListener(_0x3f7038,_0xc55004){return function(_0x37a6df){_0xc55004['emit'](_0x3f7038,_0x37a6df);};}function removeListener(_0x431afb,_0x4f961b){return function(){UserProfileEvents[_0x93aa('0x4')](_0x431afb,_0x4f961b);};}exports[_0x93aa('0x5')]=function(_0x50c159){for(var _0xb3c4ab=0x0,_0x270dc4=events[_0x93aa('0x6')];_0xb3c4ab<_0x270dc4;_0xb3c4ab++){var _0x4b870b=events[_0xb3c4ab];var _0x52ec9c=createListener(_0x93aa('0x7')+_0x4b870b,_0x50c159);UserProfileEvents['on'](_0x4b870b,_0x52ec9c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 474a409..2fa0f32 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 _0x609d=['destroy','exports','path','connect-timeout','express','fs-extra','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','/:id','show','create','delete'];(function(_0x34f9f0,_0xa63711){var _0x52bcd1=function(_0x1d8cbd){while(--_0x1d8cbd){_0x34f9f0['push'](_0x34f9f0['shift']());}};_0x52bcd1(++_0xa63711);}(_0x609d,0x6b));var _0xd609=function(_0x1dac4f,_0x36a9b3){_0x1dac4f=_0x1dac4f-0x0;var _0x5cf734=_0x609d[_0x1dac4f];return _0x5cf734;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd609('0x0'));var timeout=require(_0xd609('0x1'));var express=require(_0xd609('0x2'));var router=express['Router']();var fs_extra=require(_0xd609('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd609('0x4'));var controller=require(_0xd609('0x5'));router[_0xd609('0x6')]('/',auth[_0xd609('0x7')](),controller['index']);router[_0xd609('0x6')](_0xd609('0x8'),auth[_0xd609('0x7')](),controller['describe']);router[_0xd609('0x6')](_0xd609('0x9'),auth[_0xd609('0x7')](),controller[_0xd609('0xa')]);router['post']('/',auth[_0xd609('0x7')](),controller[_0xd609('0xb')]);router['put'](_0xd609('0x9'),auth[_0xd609('0x7')](),controller['update']);router[_0xd609('0xc')](_0xd609('0x9'),auth[_0xd609('0x7')](),controller[_0xd609('0xd')]);module[_0xd609('0xe')]=router; \ No newline at end of file +var _0x4327=['/describe','describe','/:id','create','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4327,0x19a));var _0x7432=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0x4327[_0x4c06ac];return _0x2333cb;};'use strict';var multer=require('multer');var util=require(_0x7432('0x0'));var path=require(_0x7432('0x1'));var timeout=require(_0x7432('0x2'));var express=require(_0x7432('0x3'));var router=express[_0x7432('0x4')]();var fs_extra=require(_0x7432('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7432('0x6'));var config=require('../../config/environment');var controller=require(_0x7432('0x7'));router[_0x7432('0x8')]('/',auth[_0x7432('0x9')](),controller['index']);router[_0x7432('0x8')](_0x7432('0xa'),auth[_0x7432('0x9')](),controller[_0x7432('0xb')]);router[_0x7432('0x8')](_0x7432('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7432('0x9')](),controller[_0x7432('0xd')]);router['put'](_0x7432('0xc'),auth[_0x7432('0x9')](),controller['update']);router[_0x7432('0xe')](_0x7432('0xc'),auth[_0x7432('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e847022..06d2903 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 _0x96eb=['exports','STRING','sequelize'];(function(_0x449b81,_0x4b2a6f){var _0xb9b60c=function(_0x2e9e0a){while(--_0x2e9e0a){_0x449b81['push'](_0x449b81['shift']());}};_0xb9b60c(++_0x4b2a6f);}(_0x96eb,0xa7));var _0xb96e=function(_0xba43be,_0x187eed){_0xba43be=_0xba43be-0x0;var _0x1753ba=_0x96eb[_0xba43be];return _0x1753ba;};'use strict';var Sequelize=require(_0xb96e('0x0'));module[_0xb96e('0x1')]={'name':{'type':Sequelize[_0xb96e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xb96e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1802=['STRING','sequelize','exports'];(function(_0x2330ff,_0x364387){var _0xa44e1a=function(_0x181f67){while(--_0x181f67){_0x2330ff['push'](_0x2330ff['shift']());}};_0xa44e1a(++_0x364387);}(_0x1802,0x8b));var _0x2180=function(_0x1c144d,_0x4ab8cb){_0x1c144d=_0x1c144d-0x0;var _0x46481e=_0x1802[_0x1c144d];return _0x46481e;};'use strict';var Sequelize=require(_0x2180('0x0'));module[_0x2180('0x1')]={'name':{'type':Sequelize[_0x2180('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2180('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6435faf..e9a8f94 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 _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','UserProfileResource','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x0598,0x92));var _0x8059=function(_0x2b3864,_0xbf55fc){_0x2b3864=_0x2b3864-0x0;var _0x342436=_0x0598[_0x2b3864];return _0x342436;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['UserProfileResource']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['UserProfileResource'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,null));}; \ No newline at end of file +var _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','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','sendStatus','end','status'];(function(_0x41e9d6,_0xfcf42f){var _0x2ed1e8=function(_0x29b21c){while(--_0x29b21c){_0x41e9d6['push'](_0x41e9d6['shift']());}};_0x2ed1e8(++_0xfcf42f);}(_0x2542,0x169));var _0x2254=function(_0x4b1516,_0x74bce2){_0x4b1516=_0x4b1516-0x0;var _0x292645=_0x2542[_0x4b1516];return _0x292645;};'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'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['UserProfileResource'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};exports[_0x2254('0x4d')]=function(_0x4ba6ef,_0x4cc18a){return db[_0x2254('0x2c')][_0x2254('0x4d')]()['then'](respondWithResult(_0x4cc18a,null))[_0x2254('0x45')](handleError(_0x4cc18a,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 5b7aa8b..e032ba7 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 _0xc894=['rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x49c9ce,_0xcc94b9){var _0x3a3b7a=function(_0x5cbe95){while(--_0x5cbe95){_0x49c9ce['push'](_0x49c9ce['shift']());}};_0x3a3b7a(++_0xcc94b9);}(_0xc894,0x159));var _0x4c89=function(_0x17f13c,_0x2e84e4){_0x17f13c=_0x17f13c-0x0;var _0x44c316=_0xc894[_0x17f13c];return _0x44c316;};'use strict';var _=require(_0x4c89('0x0'));var util=require(_0x4c89('0x1'));var logger=require(_0x4c89('0x2'))(_0x4c89('0x3'));var moment=require('moment');var BPromise=require(_0x4c89('0x4'));var rp=require(_0x4c89('0x5'));var fs=require('fs');var path=require(_0x4c89('0x6'));var rimraf=require(_0x4c89('0x7'));var config=require(_0x4c89('0x8'));var attributes=require('./userProfileResource.attributes');module[_0x4c89('0x9')]=function(_0x240bae,_0x530034){return _0x240bae[_0x4c89('0xa')](_0x4c89('0xb'),attributes,{'tableName':_0x4c89('0xc'),'paranoid':![],'indexes':[{'name':_0x4c89('0xd'),'fields':[_0x4c89('0xe'),_0x4c89('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x389f=['rimraf','../../config/environment','exports','UserProfileResource','user_profile_has_resources','sectionId','lodash','api','moment','request-promise'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x389f,0x92));var _0xf389=function(_0x5c21f8,_0x1307b8){_0x5c21f8=_0x5c21f8-0x0;var _0x1f6bd4=_0x389f[_0x5c21f8];return _0x1f6bd4;};'use strict';var _=require(_0xf389('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf389('0x1'));var moment=require(_0xf389('0x2'));var BPromise=require('bluebird');var rp=require(_0xf389('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf389('0x4'));var config=require(_0xf389('0x5'));var attributes=require('./userProfileResource.attributes');module[_0xf389('0x6')]=function(_0x32d066,_0x5160ec){return _0x32d066['define'](_0xf389('0x7'),attributes,{'tableName':_0xf389('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xf389('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0bf31a1..0ef284d 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 _0xbacf=['request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbacf,0x188));var _0xfbac=function(_0x3c7d53,_0x2826d0){_0x3c7d53=_0x3c7d53-0x0;var _0x2c8387=_0xbacf[_0x3c7d53];return _0x2c8387;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbac('0x0'));var BPromise=require(_0xfbac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbac('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfbac('0x3'))(_0xfbac('0x4'));var config=require('../../config/environment');var jayson=require(_0xfbac('0x5'));var client=jayson[_0xfbac('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6a57,_0x44907b,_0x1a47bc){return new BPromise(function(_0x2fa60d,_0x579843){return client[_0xfbac('0x7')](_0x5b6a57,_0x1a47bc)[_0xfbac('0x8')](function(_0x1eed76){logger[_0xfbac('0x9')](_0xfbac('0xa'),_0x44907b,'request\x20sent');logger[_0xfbac('0xb')](_0xfbac('0xc'),_0x44907b,_0xfbac('0xd'),JSON[_0xfbac('0xe')](_0x1eed76));if(_0x1eed76[_0xfbac('0xf')]){if(_0x1eed76[_0xfbac('0xf')][_0xfbac('0x10')]===0x1f4){logger[_0xfbac('0xf')](_0xfbac('0xa'),_0x44907b,_0x1eed76[_0xfbac('0xf')]['message']);return _0x579843(_0x1eed76[_0xfbac('0xf')]['message']);}logger[_0xfbac('0xf')](_0xfbac('0xa'),_0x44907b,_0x1eed76[_0xfbac('0xf')][_0xfbac('0x11')]);return _0x2fa60d(_0x1eed76['error'][_0xfbac('0x11')]);}else{logger['info'](_0xfbac('0xa'),_0x44907b,_0xfbac('0xd'));_0x2fa60d(_0x1eed76['result']['message']);}})[_0xfbac('0x12')](function(_0xe86f9e){logger[_0xfbac('0xf')](_0xfbac('0xa'),_0x44907b,_0xe86f9e);_0x579843(_0xe86f9e);});});} \ No newline at end of file +var _0x5b6a=['../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x5b6a,0x66));var _0xa5b6=function(_0x5dd351,_0x19ebc5){_0x5dd351=_0x5dd351-0x0;var _0x1fbdba=_0x5b6a[_0x5dd351];return _0x1fbdba;};'use strict';var _=require('lodash');var util=require(_0xa5b6('0x0'));var moment=require(_0xa5b6('0x1'));var BPromise=require(_0xa5b6('0x2'));var rs=require(_0xa5b6('0x3'));var fs=require('fs');var Redis=require(_0xa5b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5b6('0x5'));var logger=require(_0xa5b6('0x6'))(_0xa5b6('0x7'));var config=require(_0xa5b6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa5b6('0x9')][_0xa5b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1df9b6,_0x2d28db,_0x4f9df2){return new BPromise(function(_0x4d4ca0,_0x2c9d9c){return client[_0xa5b6('0xb')](_0x1df9b6,_0x4f9df2)[_0xa5b6('0xc')](function(_0x47e91b){logger[_0xa5b6('0xd')](_0xa5b6('0xe'),_0x2d28db,'request\x20sent');logger['debug'](_0xa5b6('0xf'),_0x2d28db,'request\x20sent',JSON[_0xa5b6('0x10')](_0x47e91b));if(_0x47e91b[_0xa5b6('0x11')]){if(_0x47e91b[_0xa5b6('0x11')][_0xa5b6('0x12')]===0x1f4){logger[_0xa5b6('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x2d28db,_0x47e91b[_0xa5b6('0x11')][_0xa5b6('0x13')]);return _0x2c9d9c(_0x47e91b[_0xa5b6('0x11')][_0xa5b6('0x13')]);}logger['error'](_0xa5b6('0xe'),_0x2d28db,_0x47e91b[_0xa5b6('0x11')]['message']);return _0x4d4ca0(_0x47e91b[_0xa5b6('0x11')]['message']);}else{logger[_0xa5b6('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x2d28db,'request\x20sent');_0x4d4ca0(_0x47e91b[_0xa5b6('0x14')][_0xa5b6('0x13')]);}})[_0xa5b6('0x15')](function(_0x3ffa1d){logger[_0xa5b6('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x2d28db,_0x3ffa1d);_0x2c9d9c(_0x3ffa1d);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 62ba3df..558e563 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 _0x52c2=['describe','/:id','post','create','put','multer','util','path','connect-timeout','get','isAuthenticated','/describe'];(function(_0xadda7a,_0xb14562){var _0x34b07a=function(_0x238419){while(--_0x238419){_0xadda7a['push'](_0xadda7a['shift']());}};_0x34b07a(++_0xb14562);}(_0x52c2,0x1d9));var _0x252c=function(_0x1e6622,_0x102bc4){_0x1e6622=_0x1e6622-0x0;var _0x20c415=_0x52c2[_0x1e6622];return _0x20c415;};'use strict';var multer=require(_0x252c('0x0'));var util=require(_0x252c('0x1'));var path=require(_0x252c('0x2'));var timeout=require(_0x252c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x252c('0x4')]('/',auth[_0x252c('0x5')](),controller['index']);router['get'](_0x252c('0x6'),auth[_0x252c('0x5')](),controller[_0x252c('0x7')]);router['get'](_0x252c('0x8'),auth[_0x252c('0x5')](),controller['show']);router[_0x252c('0x9')]('/',auth['isAuthenticated'](),controller[_0x252c('0xa')]);router[_0x252c('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x252c('0x8'),auth[_0x252c('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa29a=['delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x5ee981,_0x33a837){var _0x4e5a9b=function(_0x595c32){while(--_0x595c32){_0x5ee981['push'](_0x5ee981['shift']());}};_0x4e5a9b(++_0x33a837);}(_0xa29a,0xa3));var _0xaa29=function(_0x194c31,_0x3db07c){_0x194c31=_0x194c31-0x0;var _0x5829a2=_0xa29a[_0x194c31];return _0x5829a2;};'use strict';var multer=require(_0xaa29('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaa29('0x1'));var router=express['Router']();var fs_extra=require(_0xaa29('0x2'));var auth=require(_0xaa29('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xaa29('0x4'));var controller=require(_0xaa29('0x5'));router[_0xaa29('0x6')]('/',auth[_0xaa29('0x7')](),controller[_0xaa29('0x8')]);router[_0xaa29('0x6')](_0xaa29('0x9'),auth[_0xaa29('0x7')](),controller[_0xaa29('0xa')]);router[_0xaa29('0x6')](_0xaa29('0xb'),auth[_0xaa29('0x7')](),controller[_0xaa29('0xc')]);router[_0xaa29('0xd')]('/',auth[_0xaa29('0x7')](),controller[_0xaa29('0xe')]);router[_0xaa29('0xf')](_0xaa29('0xb'),auth[_0xaa29('0x7')](),controller[_0xaa29('0x10')]);router[_0xaa29('0x11')]('/:id',auth[_0xaa29('0x7')](),controller[_0xaa29('0x12')]);module[_0xaa29('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6a0a52f..a7c8955 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 _0x8603=['BOOLEAN','crudPermissions','getDataValue','split','exports','STRING'];(function(_0x36d8ba,_0x1d4331){var _0x9a80a6=function(_0x3def03){while(--_0x3def03){_0x36d8ba['push'](_0x36d8ba['shift']());}};_0x9a80a6(++_0x1d4331);}(_0x8603,0x190));var _0x3860=function(_0x5c1b26,_0x356a45){_0x5c1b26=_0x5c1b26-0x0;var _0x5253de=_0x8603[_0x5c1b26];return _0x5253de;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x3860('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3860('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3860('0x1')],'set':function(_0x2f56a3){this['setDataValue'](_0x3860('0x3'),_0x2f56a3?_0x2f56a3['join'](''):[]);},'get':function(){return this[_0x3860('0x4')](_0x3860('0x3'))?this[_0x3860('0x4')](_0x3860('0x3'))[_0x3860('0x5')](''):[];}}}; \ No newline at end of file +var _0x4483=['BOOLEAN','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x22386d,_0x5411ac){var _0x209a3f=function(_0x62615f){while(--_0x62615f){_0x22386d['push'](_0x22386d['shift']());}};_0x209a3f(++_0x5411ac);}(_0x4483,0x1a3));var _0x3448=function(_0x2675ba,_0x26b003){_0x2675ba=_0x2675ba-0x0;var _0x16e18b=_0x4483[_0x2675ba];return _0x16e18b;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'name':{'type':Sequelize[_0x3448('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3448('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3448('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3448('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3448('0x2')],'set':function(_0xef1a93){this['setDataValue'](_0x3448('0x5'),_0xef1a93?_0xef1a93[_0x3448('0x6')](''):[]);},'get':function(){return this[_0x3448('0x7')](_0x3448('0x5'))?this[_0x3448('0x7')](_0x3448('0x5'))[_0x3448('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e2e0c96..75dc223 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 _0xa856=['rows','catch','show','params','find','create','body','describe','eml-format','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','UserProfileSection','count','includeAll','include'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa856,0x120));var _0x6a85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa856[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x6a85('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6a85('0x1'));var sox=require(_0x6a85('0x2'));var csv=require(_0x6a85('0x3'));var ejs=require(_0x6a85('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a85('0x5'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6a85('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x6a85('0x3'));var querystring=require(_0x6a85('0x7'));var Papa=require('papaparse');var Redis=require(_0x6a85('0x8'));var authService=require(_0x6a85('0x9'));var qs=require(_0x6a85('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a85('0xb'))(_0x6a85('0xc'));var utils=require(_0x6a85('0xd'));var config=require(_0x6a85('0xe'));var licenseUtil=require(_0x6a85('0xf'));var db=require(_0x6a85('0x10'))['db'];function respondWithStatusCode(_0x4306db,_0x5072f3){_0x5072f3=_0x5072f3||0xcc;return function(_0x10dfa1){if(_0x10dfa1){return _0x4306db['sendStatus'](_0x5072f3);}return _0x4306db[_0x6a85('0x11')](_0x5072f3)[_0x6a85('0x12')]();};}function respondWithResult(_0x4548fd,_0x27d38f){_0x27d38f=_0x27d38f||0xc8;return function(_0x45ba63){if(_0x45ba63){return _0x4548fd[_0x6a85('0x11')](_0x27d38f)['json'](_0x45ba63);}};}function respondWithFilteredResult(_0x3327d3,_0x44226c){return function(_0x915772){if(_0x915772){var _0x54f324=typeof _0x44226c['offset']===_0x6a85('0x13')&&typeof _0x44226c[_0x6a85('0x14')]===_0x6a85('0x13');var _0x5a8383=_0x915772['count'];var _0x1c6381=_0x54f324?0x0:_0x44226c['offset'];var _0x4cbb5c=_0x54f324?_0x915772['count']:_0x44226c[_0x6a85('0x15')]+_0x44226c['limit'];var _0x3d671e;if(_0x4cbb5c>=_0x5a8383){_0x4cbb5c=_0x5a8383;_0x3d671e=0xc8;}else{_0x3d671e=0xce;}_0x3327d3[_0x6a85('0x11')](_0x3d671e);return _0x3327d3[_0x6a85('0x16')](_0x6a85('0x17'),_0x1c6381+'-'+_0x4cbb5c+'/'+_0x5a8383)[_0x6a85('0x18')](_0x915772);}return null;};}function patchUpdates(_0x34f805){return function(_0x11faf5){try{jsonpatch[_0x6a85('0x19')](_0x11faf5,_0x34f805,!![]);}catch(_0x54146e){return BPromise[_0x6a85('0x1a')](_0x54146e);}return _0x11faf5[_0x6a85('0x1b')]();};}function saveUpdates(_0x26d0d2,_0x3a2f54){return function(_0x2e584e){if(_0x2e584e){return _0x2e584e[_0x6a85('0x1c')](_0x26d0d2)['then'](function(_0x2cb9fa){return _0x2cb9fa;});}return null;};}function removeEntity(_0x34fdbe,_0x5d07a9){return function(_0x49045e){if(_0x49045e){return _0x49045e[_0x6a85('0x1d')]()[_0x6a85('0x1e')](function(){_0x34fdbe[_0x6a85('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0cde,_0x6a943c){return function(_0x37f5ed){if(!_0x37f5ed){_0x1c0cde[_0x6a85('0x1f')](0x194);}return _0x37f5ed;};}function handleError(_0x1dac13,_0x2ae300){_0x2ae300=_0x2ae300||0x1f4;return function(_0x1d7f7c){logger[_0x6a85('0x20')](_0x1d7f7c[_0x6a85('0x21')]);if(_0x1d7f7c['name']){delete _0x1d7f7c[_0x6a85('0x22')];}_0x1dac13[_0x6a85('0x11')](_0x2ae300)[_0x6a85('0x23')](_0x1d7f7c);};}exports['index']=function(_0x5838cb,_0x43ae97){var _0x51366e={},_0x57ac51={},_0x852271={'count':0x0,'rows':[]};var _0x185a3d=_[_0x6a85('0x24')](db['UserProfileSection'][_0x6a85('0x25')],function(_0x5f46c8){return{'name':_0x5f46c8[_0x6a85('0x26')],'type':_0x5f46c8[_0x6a85('0x27')][_0x6a85('0x28')]};});_0x57ac51['model']=_[_0x6a85('0x24')](_0x185a3d,'name');_0x57ac51[_0x6a85('0x29')]=_[_0x6a85('0x2a')](_0x5838cb[_0x6a85('0x29')]);_0x57ac51['filters']=_[_0x6a85('0x2b')](_0x57ac51[_0x6a85('0x2c')],_0x57ac51[_0x6a85('0x29')]);_0x51366e[_0x6a85('0x2d')]=_['intersection'](_0x57ac51['model'],qs[_0x6a85('0x2e')](_0x5838cb[_0x6a85('0x29')][_0x6a85('0x2e')]));_0x51366e[_0x6a85('0x2d')]=_0x51366e[_0x6a85('0x2d')][_0x6a85('0x2f')]?_0x51366e[_0x6a85('0x2d')]:_0x57ac51[_0x6a85('0x2c')];if(!_0x5838cb[_0x6a85('0x29')][_0x6a85('0x30')](_0x6a85('0x31'))){_0x51366e[_0x6a85('0x14')]=qs['limit'](_0x5838cb['query'][_0x6a85('0x14')]);_0x51366e[_0x6a85('0x15')]=qs[_0x6a85('0x15')](_0x5838cb[_0x6a85('0x29')][_0x6a85('0x15')]);}_0x51366e[_0x6a85('0x32')]=qs['sort'](_0x5838cb[_0x6a85('0x29')][_0x6a85('0x33')]);_0x51366e['where']=qs[_0x6a85('0x34')](_['pick'](_0x5838cb[_0x6a85('0x29')],_0x57ac51['filters']),_0x185a3d);if(_0x5838cb[_0x6a85('0x29')][_0x6a85('0x35')]){_0x51366e[_0x6a85('0x36')]=_[_0x6a85('0x37')](_0x51366e[_0x6a85('0x36')],{'$or':_[_0x6a85('0x24')](_0x185a3d,function(_0x54647c){if(_0x54647c[_0x6a85('0x27')]!==_0x6a85('0x38')){var _0x4b97d3={};_0x4b97d3[_0x54647c[_0x6a85('0x22')]]={'$like':'%'+_0x5838cb[_0x6a85('0x29')][_0x6a85('0x35')]+'%'};return _0x4b97d3;}})});}_0x51366e=_[_0x6a85('0x37')]({},_0x51366e,_0x5838cb[_0x6a85('0x39')]);var _0x5924c8={'where':_0x51366e['where']};return db[_0x6a85('0x3a')][_0x6a85('0x3b')](_0x5924c8)[_0x6a85('0x1e')](function(_0x119093){_0x852271['count']=_0x119093;if(_0x5838cb[_0x6a85('0x29')][_0x6a85('0x3c')]){_0x51366e[_0x6a85('0x3d')]=[{'all':!![]}];}return db[_0x6a85('0x3a')]['findAll'](_0x51366e);})['then'](function(_0x4d9644){_0x852271[_0x6a85('0x3e')]=_0x4d9644;return _0x852271;})[_0x6a85('0x1e')](respondWithFilteredResult(_0x43ae97,_0x51366e))[_0x6a85('0x3f')](handleError(_0x43ae97,null));};exports[_0x6a85('0x40')]=function(_0x193b9d,_0x5cac9d){var _0x4948bf={'raw':![],'where':{'id':_0x193b9d[_0x6a85('0x41')]['id']}},_0x29798e={};_0x29798e['model']=_[_0x6a85('0x2a')](db['UserProfileSection'][_0x6a85('0x25')]);_0x29798e[_0x6a85('0x29')]=_[_0x6a85('0x2a')](_0x193b9d['query']);_0x29798e[_0x6a85('0x34')]=_[_0x6a85('0x2b')](_0x29798e[_0x6a85('0x2c')],_0x29798e[_0x6a85('0x29')]);_0x4948bf[_0x6a85('0x2d')]=_[_0x6a85('0x2b')](_0x29798e[_0x6a85('0x2c')],qs[_0x6a85('0x2e')](_0x193b9d[_0x6a85('0x29')][_0x6a85('0x2e')]));_0x4948bf[_0x6a85('0x2d')]=_0x4948bf['attributes'][_0x6a85('0x2f')]?_0x4948bf[_0x6a85('0x2d')]:_0x29798e[_0x6a85('0x2c')];if(_0x193b9d['query']['includeAll']){_0x4948bf[_0x6a85('0x3d')]=[{'all':!![]}];}_0x4948bf=_[_0x6a85('0x37')]({},_0x4948bf,_0x193b9d['options']);return db[_0x6a85('0x3a')][_0x6a85('0x42')](_0x4948bf)['then'](handleEntityNotFound(_0x5cac9d,null))[_0x6a85('0x1e')](respondWithResult(_0x5cac9d,null))[_0x6a85('0x3f')](handleError(_0x5cac9d,null));};exports['create']=function(_0x4a3fe1,_0x1f23d8){return db[_0x6a85('0x3a')][_0x6a85('0x43')](_0x4a3fe1['body'],{})['then'](respondWithResult(_0x1f23d8,0xc9))['catch'](handleError(_0x1f23d8,null));};exports[_0x6a85('0x1c')]=function(_0x42478a,_0x4105e7){if(_0x42478a[_0x6a85('0x44')]['id']){delete _0x42478a['body']['id'];}return db[_0x6a85('0x3a')]['find']({'where':{'id':_0x42478a['params']['id']}})[_0x6a85('0x1e')](handleEntityNotFound(_0x4105e7,null))[_0x6a85('0x1e')](saveUpdates(_0x42478a['body'],null))[_0x6a85('0x1e')](respondWithResult(_0x4105e7,null))['catch'](handleError(_0x4105e7,null));};exports[_0x6a85('0x1d')]=function(_0x354bc5,_0x1b83da){return db[_0x6a85('0x3a')]['find']({'where':{'id':_0x354bc5[_0x6a85('0x41')]['id']}})[_0x6a85('0x1e')](handleEntityNotFound(_0x1b83da,null))[_0x6a85('0x1e')](removeEntity(_0x1b83da,null))[_0x6a85('0x3f')](handleError(_0x1b83da,null));};exports[_0x6a85('0x45')]=function(_0x95cc83,_0x252e15){return db['UserProfileSection'][_0x6a85('0x45')]()['then'](respondWithResult(_0x252e15,null))[_0x6a85('0x3f')](handleError(_0x252e15,null));}; \ No newline at end of file +var _0x55e1=['body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','end','status','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','UserProfileSection','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create'];(function(_0x1df940,_0x35e6ed){var _0x3224ea=function(_0x2a378b){while(--_0x2a378b){_0x1df940['push'](_0x1df940['shift']());}};_0x3224ea(++_0x35e6ed);}(_0x55e1,0xde));var _0x155e=function(_0x577f37,_0x513ae5){_0x577f37=_0x577f37-0x0;var _0x5e7920=_0x55e1[_0x577f37];return _0x5e7920;};'use strict';var emlformat=require(_0x155e('0x0'));var rimraf=require(_0x155e('0x1'));var zipdir=require(_0x155e('0x2'));var jsonpatch=require(_0x155e('0x3'));var rp=require('request-promise');var moment=require(_0x155e('0x4'));var BPromise=require(_0x155e('0x5'));var Mustache=require(_0x155e('0x6'));var util=require(_0x155e('0x7'));var path=require(_0x155e('0x8'));var sox=require(_0x155e('0x9'));var csv=require(_0x155e('0xa'));var ejs=require(_0x155e('0xb'));var fs=require('fs');var fs_extra=require(_0x155e('0xc'));var _=require(_0x155e('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x155e('0xe'));var toCsv=require(_0x155e('0xa'));var querystring=require(_0x155e('0xf'));var Papa=require(_0x155e('0x10'));var Redis=require(_0x155e('0x11'));var authService=require(_0x155e('0x12'));var qs=require(_0x155e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x155e('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x155e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bb1df,_0x168aef){_0x168aef=_0x168aef||0xcc;return function(_0x2f0e92){if(_0x2f0e92){return _0x3bb1df['sendStatus'](_0x168aef);}return _0x3bb1df['status'](_0x168aef)[_0x155e('0x16')]();};}function respondWithResult(_0xf293ea,_0x4c881b){_0x4c881b=_0x4c881b||0xc8;return function(_0x445869){if(_0x445869){return _0xf293ea[_0x155e('0x17')](_0x4c881b)['json'](_0x445869);}};}function respondWithFilteredResult(_0x3729b3,_0x276f09){return function(_0x1a69c6){if(_0x1a69c6){var _0x41ac04=typeof _0x276f09[_0x155e('0x18')]==='undefined'&&typeof _0x276f09[_0x155e('0x19')]===_0x155e('0x1a');var _0x329193=_0x1a69c6[_0x155e('0x1b')];var _0x23bee6=_0x41ac04?0x0:_0x276f09[_0x155e('0x18')];var _0x2eec44=_0x41ac04?_0x1a69c6[_0x155e('0x1b')]:_0x276f09[_0x155e('0x18')]+_0x276f09[_0x155e('0x19')];var _0x231a2d;if(_0x2eec44>=_0x329193){_0x2eec44=_0x329193;_0x231a2d=0xc8;}else{_0x231a2d=0xce;}_0x3729b3['status'](_0x231a2d);return _0x3729b3['set']('Content-Range',_0x23bee6+'-'+_0x2eec44+'/'+_0x329193)[_0x155e('0x1c')](_0x1a69c6);}return null;};}function patchUpdates(_0x4d5b14){return function(_0x3cc6cb){try{jsonpatch[_0x155e('0x1d')](_0x3cc6cb,_0x4d5b14,!![]);}catch(_0x4bb47f){return BPromise[_0x155e('0x1e')](_0x4bb47f);}return _0x3cc6cb[_0x155e('0x1f')]();};}function saveUpdates(_0x21e719,_0x4b03ec){return function(_0x4f9658){if(_0x4f9658){return _0x4f9658[_0x155e('0x20')](_0x21e719)[_0x155e('0x21')](function(_0x21fd80){return _0x21fd80;});}return null;};}function removeEntity(_0x195114,_0x5a35c6){return function(_0x2bf02f){if(_0x2bf02f){return _0x2bf02f[_0x155e('0x22')]()[_0x155e('0x21')](function(){_0x195114[_0x155e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4451a7,_0x3383c2){return function(_0x383bfc){if(!_0x383bfc){_0x4451a7[_0x155e('0x23')](0x194);}return _0x383bfc;};}function handleError(_0x168001,_0x5a96e1){_0x5a96e1=_0x5a96e1||0x1f4;return function(_0x4d1582){logger[_0x155e('0x24')](_0x4d1582['stack']);if(_0x4d1582[_0x155e('0x25')]){delete _0x4d1582[_0x155e('0x25')];}_0x168001[_0x155e('0x17')](_0x5a96e1)[_0x155e('0x26')](_0x4d1582);};}exports[_0x155e('0x27')]=function(_0x3d024d,_0x398e27){var _0x132fbf={},_0x468691={},_0x49d73a={'count':0x0,'rows':[]};var _0x186f0c=_['map'](db[_0x155e('0x28')][_0x155e('0x29')],function(_0x554be8){return{'name':_0x554be8[_0x155e('0x2a')],'type':_0x554be8['type'][_0x155e('0x2b')]};});_0x468691[_0x155e('0x2c')]=_[_0x155e('0x2d')](_0x186f0c,_0x155e('0x25'));_0x468691[_0x155e('0x2e')]=_[_0x155e('0x2f')](_0x3d024d[_0x155e('0x2e')]);_0x468691[_0x155e('0x30')]=_[_0x155e('0x31')](_0x468691['model'],_0x468691['query']);_0x132fbf[_0x155e('0x32')]=_[_0x155e('0x31')](_0x468691[_0x155e('0x2c')],qs[_0x155e('0x33')](_0x3d024d['query']['fields']));_0x132fbf[_0x155e('0x32')]=_0x132fbf[_0x155e('0x32')][_0x155e('0x34')]?_0x132fbf[_0x155e('0x32')]:_0x468691[_0x155e('0x2c')];if(!_0x3d024d['query'][_0x155e('0x35')](_0x155e('0x36'))){_0x132fbf[_0x155e('0x19')]=qs[_0x155e('0x19')](_0x3d024d['query'][_0x155e('0x19')]);_0x132fbf[_0x155e('0x18')]=qs['offset'](_0x3d024d['query'][_0x155e('0x18')]);}_0x132fbf['order']=qs[_0x155e('0x37')](_0x3d024d[_0x155e('0x2e')][_0x155e('0x37')]);_0x132fbf['where']=qs['filters'](_[_0x155e('0x38')](_0x3d024d[_0x155e('0x2e')],_0x468691[_0x155e('0x30')]),_0x186f0c);if(_0x3d024d[_0x155e('0x2e')][_0x155e('0x39')]){_0x132fbf['where']=_[_0x155e('0x3a')](_0x132fbf[_0x155e('0x3b')],{'$or':_[_0x155e('0x2d')](_0x186f0c,function(_0x5f4281){if(_0x5f4281[_0x155e('0x3c')]!==_0x155e('0x3d')){var _0x29c040={};_0x29c040[_0x5f4281[_0x155e('0x25')]]={'$like':'%'+_0x3d024d['query'][_0x155e('0x39')]+'%'};return _0x29c040;}})});}_0x132fbf=_[_0x155e('0x3a')]({},_0x132fbf,_0x3d024d[_0x155e('0x3e')]);var _0xb0a5cd={'where':_0x132fbf[_0x155e('0x3b')]};return db[_0x155e('0x28')][_0x155e('0x1b')](_0xb0a5cd)[_0x155e('0x21')](function(_0x4071c4){_0x49d73a[_0x155e('0x1b')]=_0x4071c4;if(_0x3d024d[_0x155e('0x2e')][_0x155e('0x3f')]){_0x132fbf[_0x155e('0x40')]=[{'all':!![]}];}return db[_0x155e('0x28')][_0x155e('0x41')](_0x132fbf);})[_0x155e('0x21')](function(_0x2985c1){_0x49d73a['rows']=_0x2985c1;return _0x49d73a;})[_0x155e('0x21')](respondWithFilteredResult(_0x398e27,_0x132fbf))['catch'](handleError(_0x398e27,null));};exports[_0x155e('0x42')]=function(_0x18c71f,_0x6309ec){var _0x5a8537={'raw':![],'where':{'id':_0x18c71f['params']['id']}},_0x32034e={};_0x32034e[_0x155e('0x2c')]=_[_0x155e('0x2f')](db['UserProfileSection'][_0x155e('0x29')]);_0x32034e[_0x155e('0x2e')]=_[_0x155e('0x2f')](_0x18c71f[_0x155e('0x2e')]);_0x32034e[_0x155e('0x30')]=_[_0x155e('0x31')](_0x32034e['model'],_0x32034e['query']);_0x5a8537[_0x155e('0x32')]=_[_0x155e('0x31')](_0x32034e['model'],qs['fields'](_0x18c71f[_0x155e('0x2e')][_0x155e('0x33')]));_0x5a8537['attributes']=_0x5a8537[_0x155e('0x32')][_0x155e('0x34')]?_0x5a8537[_0x155e('0x32')]:_0x32034e[_0x155e('0x2c')];if(_0x18c71f[_0x155e('0x2e')][_0x155e('0x3f')]){_0x5a8537[_0x155e('0x40')]=[{'all':!![]}];}_0x5a8537=_[_0x155e('0x3a')]({},_0x5a8537,_0x18c71f[_0x155e('0x3e')]);return db[_0x155e('0x28')][_0x155e('0x43')](_0x5a8537)[_0x155e('0x21')](handleEntityNotFound(_0x6309ec,null))[_0x155e('0x21')](respondWithResult(_0x6309ec,null))[_0x155e('0x44')](handleError(_0x6309ec,null));};exports[_0x155e('0x45')]=function(_0x5cd610,_0x470e3d){return db['UserProfileSection']['create'](_0x5cd610[_0x155e('0x46')],{})['then'](respondWithResult(_0x470e3d,0xc9))[_0x155e('0x44')](handleError(_0x470e3d,null));};exports[_0x155e('0x20')]=function(_0x1c8ae2,_0x4dd24a){if(_0x1c8ae2[_0x155e('0x46')]['id']){delete _0x1c8ae2[_0x155e('0x46')]['id'];}return db[_0x155e('0x28')][_0x155e('0x43')]({'where':{'id':_0x1c8ae2[_0x155e('0x47')]['id']}})[_0x155e('0x21')](handleEntityNotFound(_0x4dd24a,null))['then'](saveUpdates(_0x1c8ae2['body'],null))[_0x155e('0x21')](respondWithResult(_0x4dd24a,null))[_0x155e('0x44')](handleError(_0x4dd24a,null));};exports['destroy']=function(_0x2e1fbe,_0x3c9cc){return db[_0x155e('0x28')][_0x155e('0x43')]({'where':{'id':_0x2e1fbe[_0x155e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c9cc,null))[_0x155e('0x21')](removeEntity(_0x3c9cc,null))[_0x155e('0x44')](handleError(_0x3c9cc,null));};exports['describe']=function(_0x3592d8,_0x519983){return db['UserProfileSection'][_0x155e('0x48')]()[_0x155e('0x21')](respondWithResult(_0x519983,null))['catch'](handleError(_0x519983,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 6720760..16d699c 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 _0x529e=['define','UserProfileSection','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x1b9d79,_0x1073dd){var _0x56b5f7=function(_0x157a1c){while(--_0x157a1c){_0x1b9d79['push'](_0x1b9d79['shift']());}};_0x56b5f7(++_0x1073dd);}(_0x529e,0x1b7));var _0xe529=function(_0x3ef8bc,_0x124fc8){_0x3ef8bc=_0x3ef8bc-0x0;var _0x120b89=_0x529e[_0x3ef8bc];return _0x120b89;};'use strict';var _=require(_0xe529('0x0'));var util=require(_0xe529('0x1'));var logger=require(_0xe529('0x2'))('api');var moment=require(_0xe529('0x3'));var BPromise=require(_0xe529('0x4'));var rp=require(_0xe529('0x5'));var fs=require('fs');var path=require(_0xe529('0x6'));var rimraf=require(_0xe529('0x7'));var config=require(_0xe529('0x8'));var attributes=require(_0xe529('0x9'));module[_0xe529('0xa')]=function(_0x32f00d,_0x499db7){return _0x32f00d[_0xe529('0xb')](_0xe529('0xc'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xe529('0xd'),_0xe529('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x58cb=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x4ad09b,_0x5c13ad){var _0x4c7f5d=function(_0x89c1c7){while(--_0x89c1c7){_0x4ad09b['push'](_0x4ad09b['shift']());}};_0x4c7f5d(++_0x5c13ad);}(_0x58cb,0x1cf));var _0xb58c=function(_0x5aad6f,_0x239fcd){_0x5aad6f=_0x5aad6f-0x0;var _0x5f0c0c=_0x58cb[_0x5aad6f];return _0x5f0c0c;};'use strict';var _=require(_0xb58c('0x0'));var util=require(_0xb58c('0x1'));var logger=require(_0xb58c('0x2'))(_0xb58c('0x3'));var moment=require(_0xb58c('0x4'));var BPromise=require('bluebird');var rp=require(_0xb58c('0x5'));var fs=require('fs');var path=require(_0xb58c('0x6'));var rimraf=require(_0xb58c('0x7'));var config=require(_0xb58c('0x8'));var attributes=require(_0xb58c('0x9'));module[_0xb58c('0xa')]=function(_0x58c737,_0x2b0767){return _0x58c737[_0xb58c('0xb')](_0xb58c('0xc'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xb58c('0xd'),'fields':[_0xb58c('0xe'),_0xb58c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 09d3e71..e23deb6 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 _0x4209=['http','request','info','request\x20sent','debug','stringify','error','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4209,0x11c));var _0x9420=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0x4209[_0x2534cf];return _0x221461;};'use strict';var _=require(_0x9420('0x0'));var util=require(_0x9420('0x1'));var moment=require('moment');var BPromise=require(_0x9420('0x2'));var rs=require(_0x9420('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9420('0x4'))['db'];var utils=require(_0x9420('0x5'));var logger=require(_0x9420('0x6'))(_0x9420('0x7'));var config=require(_0x9420('0x8'));var jayson=require(_0x9420('0x9'));var client=jayson['client'][_0x9420('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d64d7,_0x37b985,_0xd27452){return new BPromise(function(_0x540ab8,_0x688091){return client[_0x9420('0xb')](_0x2d64d7,_0xd27452)['then'](function(_0x1e9bbd){logger[_0x9420('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x37b985,_0x9420('0xd'));logger[_0x9420('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x37b985,_0x9420('0xd'),JSON[_0x9420('0xf')](_0x1e9bbd));if(_0x1e9bbd[_0x9420('0x10')]){if(_0x1e9bbd['error']['code']===0x1f4){logger[_0x9420('0x10')](_0x9420('0x11'),_0x37b985,_0x1e9bbd['error'][_0x9420('0x12')]);return _0x688091(_0x1e9bbd[_0x9420('0x10')][_0x9420('0x12')]);}logger[_0x9420('0x10')](_0x9420('0x11'),_0x37b985,_0x1e9bbd[_0x9420('0x10')][_0x9420('0x12')]);return _0x540ab8(_0x1e9bbd['error'][_0x9420('0x12')]);}else{logger[_0x9420('0xc')](_0x9420('0x11'),_0x37b985,_0x9420('0xd'));_0x540ab8(_0x1e9bbd[_0x9420('0x13')][_0x9420('0x12')]);}})[_0x9420('0x14')](function(_0x11671f){logger[_0x9420('0x10')](_0x9420('0x11'),_0x37b985,_0x11671f);_0x688091(_0x11671f);});});} \ No newline at end of file +var _0x57e3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x305896,_0x491635){var _0x534c12=function(_0x38af68){while(--_0x38af68){_0x305896['push'](_0x305896['shift']());}};_0x534c12(++_0x491635);}(_0x57e3,0x1b0));var _0x357e=function(_0x1d1252,_0x42ee51){_0x1d1252=_0x1d1252-0x0;var _0x5685f3=_0x57e3[_0x1d1252];return _0x5685f3;};'use strict';var _=require('lodash');var util=require(_0x357e('0x0'));var moment=require(_0x357e('0x1'));var BPromise=require(_0x357e('0x2'));var rs=require(_0x357e('0x3'));var fs=require('fs');var Redis=require(_0x357e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x357e('0x5'));var logger=require(_0x357e('0x6'))(_0x357e('0x7'));var config=require(_0x357e('0x8'));var jayson=require(_0x357e('0x9'));var client=jayson[_0x357e('0xa')][_0x357e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x559b2c,_0x514704,_0x1b72d0){return new BPromise(function(_0x17be7b,_0x335664){return client['request'](_0x559b2c,_0x1b72d0)[_0x357e('0xc')](function(_0x3df4aa){logger[_0x357e('0xd')](_0x357e('0xe'),_0x514704,_0x357e('0xf'));logger[_0x357e('0x10')](_0x357e('0x11'),_0x514704,_0x357e('0xf'),JSON['stringify'](_0x3df4aa));if(_0x3df4aa[_0x357e('0x12')]){if(_0x3df4aa['error'][_0x357e('0x13')]===0x1f4){logger['error'](_0x357e('0xe'),_0x514704,_0x3df4aa[_0x357e('0x12')][_0x357e('0x14')]);return _0x335664(_0x3df4aa[_0x357e('0x12')]['message']);}logger[_0x357e('0x12')](_0x357e('0xe'),_0x514704,_0x3df4aa[_0x357e('0x12')]['message']);return _0x17be7b(_0x3df4aa[_0x357e('0x12')][_0x357e('0x14')]);}else{logger[_0x357e('0xd')](_0x357e('0xe'),_0x514704,_0x357e('0xf'));_0x17be7b(_0x3df4aa[_0x357e('0x15')][_0x357e('0x14')]);}})[_0x357e('0x16')](function(_0x468b8e){logger[_0x357e('0x12')](_0x357e('0xe'),_0x514704,_0x468b8e);_0x335664(_0x468b8e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0613ec8..ddd203a 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x500e16,_0x30ec9a){var _0x54f1d1=function(_0x80d24b){while(--_0x80d24b){_0x500e16['push'](_0x500e16['shift']());}};_0x54f1d1(++_0x30ec9a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xb837f5,_0x3f80a9){var _0x357368=function(_0x432e64){while(--_0x432e64){_0xb837f5['push'](_0xb837f5['shift']());}};_0x357368(++_0x3f80a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index cce154d..e75e3c6 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 _0x0ae6=['exports','INTEGER'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0x0ae6,0x15e));var _0x60ae=function(_0x41bd0f,_0x197a5c){_0x41bd0f=_0x41bd0f-0x0;var _0x29c163=_0x0ae6[_0x41bd0f];return _0x29c163;};'use strict';var Sequelize=require('sequelize');module[_0x60ae('0x0')]={'penalty':{'type':Sequelize[_0x60ae('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1247=['sequelize','exports'];(function(_0x11e076,_0x3698b8){var _0x5ba162=function(_0x328179){while(--_0x328179){_0x11e076['push'](_0x11e076['shift']());}};_0x5ba162(++_0x3698b8);}(_0x1247,0xb6));var _0x7124=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0x1247[_0x15942a];return _0x36a9fb;};'use strict';var Sequelize=require(_0x7124('0x0'));module[_0x7124('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 466d021..7c119ff 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 _0x50a5=['util','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x50a5,0xd1));var _0x550a=function(_0x36c266,_0x3c467e){_0x36c266=_0x36c266-0x0;var _0x50ca86=_0x50a5[_0x36c266];return _0x50ca86;};'use strict';var _=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x550a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x550a('0x3'));var config=require(_0x550a('0x4'));var attributes=require(_0x550a('0x5'));module[_0x550a('0x6')]=function(_0x402f66,_0x3b3c29){return _0x402f66[_0x550a('0x7')](_0x550a('0x8'),attributes,{'tableName':_0x550a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe785=['util','api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0xef743f,_0x1ef50a){var _0x14411e=function(_0x5737d9){while(--_0x5737d9){_0xef743f['push'](_0xef743f['shift']());}};_0x14411e(++_0x1ef50a);}(_0xe785,0x128));var _0x5e78=function(_0x400dab,_0x466833){_0x400dab=_0x400dab-0x0;var _0x4f6c81=_0xe785[_0x400dab];return _0x4f6c81;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var logger=require('../../config/logger')(_0x5e78('0x2'));var moment=require(_0x5e78('0x3'));var BPromise=require(_0x5e78('0x4'));var rp=require(_0x5e78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e78('0x6'));var attributes=require(_0x5e78('0x7'));module[_0x5e78('0x8')]=function(_0x135552,_0x502114){return _0x135552['define'](_0x5e78('0x9'),attributes,{'tableName':_0x5e78('0xa'),'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 534dd44..2a4507a 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 _0x7784=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3dc74b,_0x3c5944){var _0x464fe2=function(_0x5149e1){while(--_0x5149e1){_0x3dc74b['push'](_0x3dc74b['shift']());}};_0x464fe2(++_0x3c5944);}(_0x7784,0xc2));var _0x4778=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7784[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4778('0x0'));var util=require('util');var moment=require(_0x4778('0x1'));var BPromise=require(_0x4778('0x2'));var rs=require(_0x4778('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4778('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4778('0x5'))(_0x4778('0x6'));var config=require(_0x4778('0x7'));var jayson=require(_0x4778('0x8'));var client=jayson[_0x4778('0x9')][_0x4778('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eeb24,_0x4f8ddc,_0x48f607){return new BPromise(function(_0x1cb380,_0x3b8c52){return client[_0x4778('0xb')](_0x3eeb24,_0x48f607)[_0x4778('0xc')](function(_0x31f6bb){logger[_0x4778('0xd')](_0x4778('0xe'),_0x4f8ddc,_0x4778('0xf'));logger[_0x4778('0x10')](_0x4778('0x11'),_0x4f8ddc,_0x4778('0xf'),JSON[_0x4778('0x12')](_0x31f6bb));if(_0x31f6bb[_0x4778('0x13')]){if(_0x31f6bb[_0x4778('0x13')]['code']===0x1f4){logger[_0x4778('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x4f8ddc,_0x31f6bb[_0x4778('0x13')][_0x4778('0x14')]);return _0x3b8c52(_0x31f6bb[_0x4778('0x13')][_0x4778('0x14')]);}logger['error'](_0x4778('0xe'),_0x4f8ddc,_0x31f6bb[_0x4778('0x13')][_0x4778('0x14')]);return _0x1cb380(_0x31f6bb[_0x4778('0x13')][_0x4778('0x14')]);}else{logger[_0x4778('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4f8ddc,_0x4778('0xf'));_0x1cb380(_0x31f6bb[_0x4778('0x15')][_0x4778('0x14')]);}})[_0x4778('0x16')](function(_0x1da8b4){logger['error'](_0x4778('0xe'),_0x4f8ddc,_0x1da8b4);_0x3b8c52(_0x1da8b4);});});} \ No newline at end of file +var _0x60a4=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2de941,_0x36eb54){var _0x1320a7=function(_0xbc6613){while(--_0xbc6613){_0x2de941['push'](_0x2de941['shift']());}};_0x1320a7(++_0x36eb54);}(_0x60a4,0x13c));var _0x460a=function(_0x9664b9,_0x51d10e){_0x9664b9=_0x9664b9-0x0;var _0x420c36=_0x60a4[_0x9664b9];return _0x420c36;};'use strict';var _=require(_0x460a('0x0'));var util=require(_0x460a('0x1'));var moment=require('moment');var BPromise=require(_0x460a('0x2'));var rs=require(_0x460a('0x3'));var fs=require('fs');var Redis=require(_0x460a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x460a('0x5'))(_0x460a('0x6'));var config=require(_0x460a('0x7'));var jayson=require(_0x460a('0x8'));var client=jayson[_0x460a('0x9')][_0x460a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5d023,_0x34b0ab,_0x181076){return new BPromise(function(_0x4e0903,_0x3de5c6){return client[_0x460a('0xb')](_0xe5d023,_0x181076)[_0x460a('0xc')](function(_0x3a70f6){logger[_0x460a('0xd')](_0x460a('0xe'),_0x34b0ab,_0x460a('0xf'));logger[_0x460a('0x10')](_0x460a('0x11'),_0x34b0ab,_0x460a('0xf'),JSON[_0x460a('0x12')](_0x3a70f6));if(_0x3a70f6[_0x460a('0x13')]){if(_0x3a70f6[_0x460a('0x13')][_0x460a('0x14')]===0x1f4){logger[_0x460a('0x13')](_0x460a('0xe'),_0x34b0ab,_0x3a70f6[_0x460a('0x13')][_0x460a('0x15')]);return _0x3de5c6(_0x3a70f6[_0x460a('0x13')][_0x460a('0x15')]);}logger[_0x460a('0x13')](_0x460a('0xe'),_0x34b0ab,_0x3a70f6['error'][_0x460a('0x15')]);return _0x4e0903(_0x3a70f6[_0x460a('0x13')][_0x460a('0x15')]);}else{logger[_0x460a('0xd')](_0x460a('0xe'),_0x34b0ab,_0x460a('0xf'));_0x4e0903(_0x3a70f6[_0x460a('0x16')]['message']);}})[_0x460a('0x17')](function(_0xa54cea){logger[_0x460a('0x13')](_0x460a('0xe'),_0x34b0ab,_0xa54cea);_0x3de5c6(_0xa54cea);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index a43fb10..24a2b89 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 _0xc1ec=['exports','INTEGER','sequelize'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0xc1ec,0xf2));var _0xcc1e=function(_0x4e0004,_0x47e0f2){_0x4e0004=_0x4e0004-0x0;var _0x15f523=_0xc1ec[_0x4e0004];return _0x15f523;};'use strict';var Sequelize=require(_0xcc1e('0x0'));module[_0xcc1e('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xcc1e('0x2')]}}; \ No newline at end of file +var _0x3c49=['INTEGER','sequelize','exports'];(function(_0x1179e1,_0x1ac78a){var _0x1370ad=function(_0x5aada3){while(--_0x5aada3){_0x1179e1['push'](_0x1179e1['shift']());}};_0x1370ad(++_0x1ac78a);}(_0x3c49,0x1c0));var _0x93c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x3c49[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x93c4('0x0'));module[_0x93c4('0x1')]={'UserId':{'type':Sequelize[_0x93c4('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x93c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 6c5fbe1..165e9b8 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(_0x587e10,_0x23a053){var _0xd541ea=function(_0x97f45){while(--_0x97f45){_0x587e10['push'](_0x587e10['shift']());}};_0xd541ea(++_0x23a053);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x23e9a0,_0x564042){var _0x19beb6=function(_0x511e67){while(--_0x511e67){_0x23e9a0['push'](_0x23e9a0['shift']());}};_0x19beb6(++_0x564042);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 cf3df7d..532bb30 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1ff67e,_0x57e3c3){var _0x4343b6=function(_0x59b76c){while(--_0x59b76c){_0x1ff67e['push'](_0x1ff67e['shift']());}};_0x4343b6(++_0x57e3c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xbccf5b,_0x27757c){var _0x6dcb74=function(_0x37d64b){while(--_0x37d64b){_0xbccf5b['push'](_0xbccf5b['shift']());}};_0x6dcb74(++_0x27757c);}(_0x70e0,0x17b));var _0x070e=function(_0x524ae1,_0x46a992){_0x524ae1=_0x524ae1-0x0;var _0x2cf59a=_0x70e0[_0x524ae1];return _0x2cf59a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 1c4a047..16c1b6e 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 _0xbe3c=['sequelize','exports','INTEGER'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0xbe3c,0x1bf));var _0xcbe3=function(_0x394bfe,_0x28c909){_0x394bfe=_0x394bfe-0x0;var _0x4ccaa4=_0xbe3c[_0x394bfe];return _0x4ccaa4;};'use strict';var Sequelize=require(_0xcbe3('0x0'));module[_0xcbe3('0x1')]={'penalty':{'type':Sequelize[_0xcbe3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0ede=['INTEGER','sequelize'];(function(_0xd90dae,_0x57da84){var _0x4c0a06=function(_0x527fb7){while(--_0x527fb7){_0xd90dae['push'](_0xd90dae['shift']());}};_0x4c0a06(++_0x57da84);}(_0x0ede,0x12b));var _0xe0ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ede[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe0ed('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe0ed('0x1')],'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 e172a1b..df6e60e 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 _0x7487=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x27a7f8,_0x1f48b7){var _0x121b88=function(_0x125a58){while(--_0x125a58){_0x27a7f8['push'](_0x27a7f8['shift']());}};_0x121b88(++_0x1f48b7);}(_0x7487,0x1ed));var _0x7748=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x7487[_0x424501];return _0xb719af;};'use strict';var _=require(_0x7748('0x0'));var util=require(_0x7748('0x1'));var logger=require(_0x7748('0x2'))(_0x7748('0x3'));var moment=require(_0x7748('0x4'));var BPromise=require(_0x7748('0x5'));var rp=require(_0x7748('0x6'));var fs=require('fs');var path=require(_0x7748('0x7'));var rimraf=require(_0x7748('0x8'));var config=require(_0x7748('0x9'));var attributes=require(_0x7748('0xa'));module['exports']=function(_0x35a806,_0x192274){return _0x35a806[_0x7748('0xb')](_0x7748('0xc'),attributes,{'tableName':_0x7748('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x148b=['define','user_has_voice_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','exports'];(function(_0x30ec2b,_0x497650){var _0x1d1e89=function(_0x45e2b3){while(--_0x45e2b3){_0x30ec2b['push'](_0x30ec2b['shift']());}};_0x1d1e89(++_0x497650);}(_0x148b,0xd3));var _0xb148=function(_0x438675,_0x406389){_0x438675=_0x438675-0x0;var _0xd37c26=_0x148b[_0x438675];return _0xd37c26;};'use strict';var _=require(_0xb148('0x0'));var util=require('util');var logger=require(_0xb148('0x1'))('api');var moment=require(_0xb148('0x2'));var BPromise=require(_0xb148('0x3'));var rp=require(_0xb148('0x4'));var fs=require('fs');var path=require(_0xb148('0x5'));var rimraf=require(_0xb148('0x6'));var config=require('../../config/environment');var attributes=require(_0xb148('0x7'));module[_0xb148('0x8')]=function(_0x203753,_0x46d0b6){return _0x203753[_0xb148('0x9')]('UserVoiceQueue',attributes,{'tableName':_0xb148('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 3b2363e..af09d1b 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 _0xb692=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserVoiceQueue,\x20%s,\x20%s','result','catch'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xb692,0x1e3));var _0x2b69=function(_0x2c3aed,_0xa4011f){_0x2c3aed=_0x2c3aed-0x0;var _0x473dc4=_0xb692[_0x2c3aed];return _0x473dc4;};'use strict';var _=require(_0x2b69('0x0'));var util=require('util');var moment=require(_0x2b69('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b69('0x2'));var fs=require('fs');var Redis=require(_0x2b69('0x3'));var db=require(_0x2b69('0x4'))['db'];var utils=require(_0x2b69('0x5'));var logger=require(_0x2b69('0x6'))(_0x2b69('0x7'));var config=require(_0x2b69('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2b69('0x9')][_0x2b69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18ebb5,_0x1f44bc,_0x3e6817){return new BPromise(function(_0x345666,_0x527047){return client[_0x2b69('0xb')](_0x18ebb5,_0x3e6817)[_0x2b69('0xc')](function(_0x5365aa){logger[_0x2b69('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1f44bc,_0x2b69('0xe'));logger[_0x2b69('0xf')](_0x2b69('0x10'),_0x1f44bc,_0x2b69('0xe'),JSON[_0x2b69('0x11')](_0x5365aa));if(_0x5365aa['error']){if(_0x5365aa[_0x2b69('0x12')]['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1f44bc,_0x5365aa[_0x2b69('0x12')][_0x2b69('0x13')]);return _0x527047(_0x5365aa[_0x2b69('0x12')]['message']);}logger[_0x2b69('0x12')](_0x2b69('0x14'),_0x1f44bc,_0x5365aa[_0x2b69('0x12')][_0x2b69('0x13')]);return _0x345666(_0x5365aa[_0x2b69('0x12')][_0x2b69('0x13')]);}else{logger[_0x2b69('0xd')](_0x2b69('0x14'),_0x1f44bc,_0x2b69('0xe'));_0x345666(_0x5365aa[_0x2b69('0x15')][_0x2b69('0x13')]);}})[_0x2b69('0x16')](function(_0xe5de8d){logger[_0x2b69('0x12')](_0x2b69('0x14'),_0x1f44bc,_0xe5de8d);_0x527047(_0xe5de8d);});});} \ No newline at end of file +var _0x5229=['http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0x5229,0xd5));var _0x9522=function(_0x4a3b1c,_0x2de96b){_0x4a3b1c=_0x4a3b1c-0x0;var _0x1ccec4=_0x5229[_0x4a3b1c];return _0x1ccec4;};'use strict';var _=require(_0x9522('0x0'));var util=require(_0x9522('0x1'));var moment=require(_0x9522('0x2'));var BPromise=require(_0x9522('0x3'));var rs=require(_0x9522('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9522('0x5'))['db'];var utils=require(_0x9522('0x6'));var logger=require(_0x9522('0x7'))(_0x9522('0x8'));var config=require(_0x9522('0x9'));var jayson=require(_0x9522('0xa'));var client=jayson[_0x9522('0xb')][_0x9522('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x448faa,_0x3b9018,_0x3c5e14){return new BPromise(function(_0x25d1d3,_0x236d2d){return client[_0x9522('0xd')](_0x448faa,_0x3c5e14)[_0x9522('0xe')](function(_0x4cd2d3){logger['info'](_0x9522('0xf'),_0x3b9018,_0x9522('0x10'));logger['debug'](_0x9522('0x11'),_0x3b9018,_0x9522('0x10'),JSON[_0x9522('0x12')](_0x4cd2d3));if(_0x4cd2d3['error']){if(_0x4cd2d3[_0x9522('0x13')][_0x9522('0x14')]===0x1f4){logger[_0x9522('0x13')](_0x9522('0xf'),_0x3b9018,_0x4cd2d3['error'][_0x9522('0x15')]);return _0x236d2d(_0x4cd2d3[_0x9522('0x13')][_0x9522('0x15')]);}logger[_0x9522('0x13')](_0x9522('0xf'),_0x3b9018,_0x4cd2d3[_0x9522('0x13')]['message']);return _0x25d1d3(_0x4cd2d3['error'][_0x9522('0x15')]);}else{logger[_0x9522('0x16')](_0x9522('0xf'),_0x3b9018,_0x9522('0x10'));_0x25d1d3(_0x4cd2d3[_0x9522('0x17')][_0x9522('0x15')]);}})[_0x9522('0x18')](function(_0x4761ff){logger[_0x9522('0x13')](_0x9522('0xf'),_0x3b9018,_0x4761ff);_0x236d2d(_0x4761ff);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 14a930f..3b87cb3 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f73b6,_0x4bd13c){var _0x67a444=function(_0x397463){while(--_0x397463){_0x4f73b6['push'](_0x4f73b6['shift']());}};_0x67a444(++_0x4bd13c);}(_0xe706,0xa3));var _0x6e70=function(_0x2906e6,_0x5ccd59){_0x2906e6=_0x2906e6-0x0;var _0x12517a=_0xe706[_0x2906e6];return _0x12517a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4ba2ba,_0x2f1015){var _0x143ce5=function(_0x232303){while(--_0x232303){_0x4ba2ba['push'](_0x4ba2ba['shift']());}};_0x143ce5(++_0x2f1015);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcb91[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index aa57c6c..7b9a0e0 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 _0x4ed0=['queue_interface','sequelize','INTEGER','STRING','Required\x20by\x20Asterisk'];(function(_0xec3fac,_0x232243){var _0x4f6c69=function(_0x395c09){while(--_0x395c09){_0xec3fac['push'](_0xec3fac['shift']());}};_0x4f6c69(++_0x232243);}(_0x4ed0,0x79));var _0x04ed=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4ed0[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x04ed('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x04ed('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x04ed('0x2')],'allowNull':![],'comment':_0x04ed('0x3')},'UserId':{'type':Sequelize[_0x04ed('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x04ed('0x4'),'comment':_0x04ed('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x04ed('0x2')],'allowNull':![],'unique':_0x04ed('0x4'),'comment':_0x04ed('0x3')},'penalty':{'type':Sequelize[_0x04ed('0x1')](0xb),'defaultValue':0x0,'comment':_0x04ed('0x3')},'paused':{'type':Sequelize[_0x04ed('0x1')](0xb),'defaultValue':0x0,'comment':_0x04ed('0x3')}}; \ No newline at end of file +var _0xca8b=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xca8b,0x130));var _0xbca8=function(_0x4323cd,_0x2fa2ba){_0x4323cd=_0x4323cd-0x0;var _0x2f0fbe=_0xca8b[_0x4323cd];return _0x2f0fbe;};'use strict';var Sequelize=require(_0xbca8('0x0'));module[_0xbca8('0x1')]={'uniqueid':{'type':Sequelize[_0xbca8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xbca8('0x3')],'allowNull':![],'comment':_0xbca8('0x4')},'UserId':{'type':Sequelize[_0xbca8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbca8('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xbca8('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xbca8('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xbca8('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xbca8('0x2')](0xb),'defaultValue':0x0,'comment':_0xbca8('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8f7d639..a7ccaef 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 _0x7da7=['UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x7da7,0xb8));var _0x77da=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x7da7[_0x1b7368];return _0x25d54c;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x77da('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x77da('0x1'),'afterUpdate':_0x77da('0x2'),'afterDestroy':_0x77da('0x3')};function emitEvent(_0x210af){return function(_0x3be2e3,_0x374128,_0x5307b0){UserVoiceQueueRtEvents[_0x77da('0x4')](_0x210af+':'+_0x3be2e3['id'],_0x3be2e3);UserVoiceQueueRtEvents[_0x77da('0x4')](_0x210af,_0x3be2e3);_0x5307b0(null);};}for(var e in events){if(events[_0x77da('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x77da('0x6')](e,emitEvent(event));}}module[_0x77da('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x7944=['remove','emit','hasOwnProperty','exports','events','UserVoiceQueueRt','setMaxListeners','update'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x7944,0xec));var _0x4794=function(_0x43131d,_0x2db0c4){_0x43131d=_0x43131d-0x0;var _0x27918b=_0x7944[_0x43131d];return _0x27918b;};'use strict';var EventEmitter=require(_0x4794('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x4794('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4794('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4794('0x3'),'afterDestroy':_0x4794('0x4')};function emitEvent(_0xe7266f){return function(_0x563464,_0x8cbd97,_0x40189b){UserVoiceQueueRtEvents[_0x4794('0x5')](_0xe7266f+':'+_0x563464['id'],_0x563464);UserVoiceQueueRtEvents[_0x4794('0x5')](_0xe7266f,_0x563464);_0x40189b(null);};}for(var e in events){if(events[_0x4794('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4794('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index d95e44e..b5600f0 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 _0x2fb2=['path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','request-promise'];(function(_0x4e5edd,_0x35647f){var _0x474e15=function(_0x181f18){while(--_0x181f18){_0x4e5edd['push'](_0x4e5edd['shift']());}};_0x474e15(++_0x35647f);}(_0x2fb2,0x1b5));var _0x22fb=function(_0x35f7bb,_0x92b5cf){_0x35f7bb=_0x35f7bb-0x0;var _0x418aab=_0x2fb2[_0x35f7bb];return _0x418aab;};'use strict';var _=require(_0x22fb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x22fb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x22fb('0x2'));var fs=require('fs');var path=require(_0x22fb('0x3'));var rimraf=require(_0x22fb('0x4'));var config=require('../../config/environment');var attributes=require(_0x22fb('0x5'));module[_0x22fb('0x6')]=function(_0x45eac1,_0x2f34aa){return _0x45eac1[_0x22fb('0x7')](_0x22fb('0x8'),attributes,{'tableName':_0x22fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7aa=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','UserVoiceQueueRt','lodash','util','../../config/logger','api'];(function(_0xbfa304,_0x4974ec){var _0x428cda=function(_0xb5643f){while(--_0xb5643f){_0xbfa304['push'](_0xbfa304['shift']());}};_0x428cda(++_0x4974ec);}(_0xb7aa,0x146));var _0xab7a=function(_0xd92e0f,_0x4c28de){_0xd92e0f=_0xd92e0f-0x0;var _0x408a33=_0xb7aa[_0xd92e0f];return _0x408a33;};'use strict';var _=require(_0xab7a('0x0'));var util=require(_0xab7a('0x1'));var logger=require(_0xab7a('0x2'))(_0xab7a('0x3'));var moment=require('moment');var BPromise=require(_0xab7a('0x4'));var rp=require(_0xab7a('0x5'));var fs=require('fs');var path=require(_0xab7a('0x6'));var rimraf=require(_0xab7a('0x7'));var config=require(_0xab7a('0x8'));var attributes=require(_0xab7a('0x9'));module['exports']=function(_0x27ea3f,_0x18540a){return _0x27ea3f['define'](_0xab7a('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','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 199a8ed..9d4b6d2 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 _0x557b=['UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','literal','outboundQueuePauses','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x557b,0x12d));var _0xb557=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x557b[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xb557('0x0'));var util=require('util');var moment=require(_0xb557('0x1'));var BPromise=require(_0xb557('0x2'));var rs=require(_0xb557('0x3'));var fs=require('fs');var Redis=require(_0xb557('0x4'));var db=require(_0xb557('0x5'))['db'];var utils=require(_0xb557('0x6'));var logger=require(_0xb557('0x7'))(_0xb557('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb557('0x9')]({'port':0x232a});config[_0xb557('0xa')]=_[_0xb557('0xb')](config[_0xb557('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb557('0xc'))(new Redis(config[_0xb557('0xa')]));require(_0xb557('0xd'))[_0xb557('0xe')](socket);function respondWithRpcPromise(_0x2b7909,_0xadc8f9,_0x894726){return new BPromise(function(_0x5155b8,_0x2ec9ea){return client[_0xb557('0xf')](_0x2b7909,_0x894726)[_0xb557('0x10')](function(_0x3d4b30){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0xadc8f9,_0xb557('0x11'));logger[_0xb557('0x12')](_0xb557('0x13'),_0xadc8f9,_0xb557('0x11'),JSON[_0xb557('0x14')](_0x3d4b30));if(_0x3d4b30[_0xb557('0x15')]){if(_0x3d4b30['error'][_0xb557('0x16')]===0x1f4){logger[_0xb557('0x15')](_0xb557('0x17'),_0xadc8f9,_0x3d4b30[_0xb557('0x15')]['message']);return _0x2ec9ea(_0x3d4b30[_0xb557('0x15')][_0xb557('0x18')]);}logger['error'](_0xb557('0x17'),_0xadc8f9,_0x3d4b30[_0xb557('0x15')]['message']);return _0x5155b8(_0x3d4b30[_0xb557('0x15')][_0xb557('0x18')]);}else{logger['info'](_0xb557('0x17'),_0xadc8f9,_0xb557('0x11'));_0x5155b8(_0x3d4b30[_0xb557('0x19')][_0xb557('0x18')]);}})[_0xb557('0x1a')](function(_0x128365){logger[_0xb557('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xadc8f9,_0x128365);_0x2ec9ea(_0x128365);});});}exports[_0xb557('0x1b')]=function(_0x54e0a9){var _0x1355e4=this;return new Promise(function(_0x4b60a2,_0x5acf56){return db[_0xb557('0x1c')]['findAll']({'raw':_0x54e0a9[_0xb557('0x1d')]?_0x54e0a9[_0xb557('0x1d')][_0xb557('0x1e')]===undefined?!![]:![]:!![],'where':_0x54e0a9[_0xb557('0x1d')]?_0x54e0a9[_0xb557('0x1d')][_0xb557('0x1f')]||null:null,'attributes':[[db[_0xb557('0x20')]['fn']('COUNT',db[_0xb557('0x20')]['fn']('IF',db[_0xb557('0x20')][_0xb557('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0xb557('0x22')]]})['then'](function(_0xe35ac7){logger[_0xb557('0x23')]('GetVoiceQueueRtPauses',_0x54e0a9);logger['debug'](_0xb557('0x1b'),_0x54e0a9,JSON[_0xb557('0x14')](_0xe35ac7));_0x4b60a2(_0xe35ac7);})['catch'](function(_0x155c43){logger[_0xb557('0x15')](_0xb557('0x1b'),_0x155c43[_0xb557('0x18')],_0x54e0a9);_0x5acf56(_0x1355e4[_0xb557('0x15')](0x1f4,_0x155c43[_0xb557('0x18')]));});});}; \ No newline at end of file +var _0x8bd1=['../../config/utils','rpc','client','http','redis','defaults','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','ioredis'];(function(_0x515984,_0x45b651){var _0x42eed1=function(_0x4ca639){while(--_0x4ca639){_0x515984['push'](_0x515984['shift']());}};_0x42eed1(++_0x45b651);}(_0x8bd1,0xcf));var _0x18bd=function(_0x3f8431,_0x1490cb){_0x3f8431=_0x3f8431-0x0;var _0x3de1c5=_0x8bd1[_0x3f8431];return _0x3de1c5;};'use strict';var _=require(_0x18bd('0x0'));var util=require(_0x18bd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18bd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x18bd('0x3'));var logger=require('../../config/logger')(_0x18bd('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x18bd('0x5')][_0x18bd('0x6')]({'port':0x232a});config[_0x18bd('0x7')]=_[_0x18bd('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x18bd('0x9'))(new Redis(config[_0x18bd('0x7')]));require('./userVoiceQueueRt.socket')[_0x18bd('0xa')](socket);function respondWithRpcPromise(_0x2f04cc,_0x5b9961,_0x321d48){return new BPromise(function(_0x1813ee,_0x1e9bc4){return client[_0x18bd('0xb')](_0x2f04cc,_0x321d48)[_0x18bd('0xc')](function(_0x2aedeb){logger[_0x18bd('0xd')](_0x18bd('0xe'),_0x5b9961,'request\x20sent');logger[_0x18bd('0xf')](_0x18bd('0x10'),_0x5b9961,_0x18bd('0x11'),JSON[_0x18bd('0x12')](_0x2aedeb));if(_0x2aedeb['error']){if(_0x2aedeb['error'][_0x18bd('0x13')]===0x1f4){logger[_0x18bd('0x14')](_0x18bd('0xe'),_0x5b9961,_0x2aedeb['error'][_0x18bd('0x15')]);return _0x1e9bc4(_0x2aedeb[_0x18bd('0x14')][_0x18bd('0x15')]);}logger['error'](_0x18bd('0xe'),_0x5b9961,_0x2aedeb[_0x18bd('0x14')][_0x18bd('0x15')]);return _0x1813ee(_0x2aedeb[_0x18bd('0x14')][_0x18bd('0x15')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5b9961,'request\x20sent');_0x1813ee(_0x2aedeb[_0x18bd('0x16')]['message']);}})[_0x18bd('0x17')](function(_0x1250b7){logger[_0x18bd('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5b9961,_0x1250b7);_0x1e9bc4(_0x1250b7);});});}exports['GetVoiceQueueRtPauses']=function(_0x4ec95e){var _0x345e9a=this;return new Promise(function(_0x1c1f8f,_0x105e55){return db[_0x18bd('0x18')][_0x18bd('0x19')]({'raw':_0x4ec95e[_0x18bd('0x1a')]?_0x4ec95e['options'][_0x18bd('0x1b')]===undefined?!![]:![]:!![],'where':_0x4ec95e['options']?_0x4ec95e[_0x18bd('0x1a')][_0x18bd('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x18bd('0x1d'),db['sequelize']['fn']('IF',db[_0x18bd('0x1e')][_0x18bd('0x1f')](_0x18bd('0x20')))),_0x18bd('0x21')]]})[_0x18bd('0xc')](function(_0x110c9f){logger['info']('GetVoiceQueueRtPauses',_0x4ec95e);logger['debug'](_0x18bd('0x22'),_0x4ec95e,JSON['stringify'](_0x110c9f));_0x1c1f8f(_0x110c9f);})['catch'](function(_0x17b5d6){logger[_0x18bd('0x14')](_0x18bd('0x22'),_0x17b5d6[_0x18bd('0x15')],_0x4ec95e);_0x105e55(_0x345e9a[_0x18bd('0x14')](0x1f4,_0x17b5d6[_0x18bd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1bd5b83..f07002e 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 _0x0fcd=['removeListener','register','userVoiceQueueRt:','save','remove','update'];(function(_0x54937e,_0x46b8bf){var _0x397639=function(_0x273217){while(--_0x273217){_0x54937e['push'](_0x54937e['shift']());}};_0x397639(++_0x46b8bf);}(_0x0fcd,0x129));var _0xd0fc=function(_0x5b9b56,_0x1dd1cc){_0x5b9b56=_0x5b9b56-0x0;var _0x3360a1=_0x0fcd[_0x5b9b56];return _0x3360a1;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xd0fc('0x0'),_0xd0fc('0x1'),_0xd0fc('0x2')];function createListener(_0x7d13c6,_0x3e8013){return function(_0x1a3aa8){_0x3e8013['emit'](_0x7d13c6,_0x1a3aa8);};}function removeListener(_0x46c92d,_0x3552fc){return function(){UserVoiceQueueRtEvents[_0xd0fc('0x3')](_0x46c92d,_0x3552fc);};}exports[_0xd0fc('0x4')]=function(_0x5507ff){for(var _0x32b1c5=0x0,_0x5d93cc=events['length'];_0x32b1c5<_0x5d93cc;_0x32b1c5++){var _0x5ad581=events[_0x32b1c5];var _0x5e42a1=createListener(_0xd0fc('0x5')+_0x5ad581,_0x5507ff);UserVoiceQueueRtEvents['on'](_0x5ad581,_0x5e42a1);}}; \ No newline at end of file +var _0xf693=['userVoiceQueueRt:','save','remove','update','emit','removeListener','register','length'];(function(_0x29cd03,_0x4a8f10){var _0x52bad3=function(_0x1f7208){while(--_0x1f7208){_0x29cd03['push'](_0x29cd03['shift']());}};_0x52bad3(++_0x4a8f10);}(_0xf693,0x181));var _0x3f69=function(_0x2c8a44,_0x6f65f7){_0x2c8a44=_0x2c8a44-0x0;var _0x4788e5=_0xf693[_0x2c8a44];return _0x4788e5;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x3f69('0x0'),_0x3f69('0x1'),_0x3f69('0x2')];function createListener(_0x250a1d,_0x339d06){return function(_0x3dcdd6){_0x339d06[_0x3f69('0x3')](_0x250a1d,_0x3dcdd6);};}function removeListener(_0x527646,_0xf2fdd8){return function(){UserVoiceQueueRtEvents[_0x3f69('0x4')](_0x527646,_0xf2fdd8);};}exports[_0x3f69('0x5')]=function(_0x489d4d){for(var _0x3e4c37=0x0,_0x45461a=events[_0x3f69('0x6')];_0x3e4c37<_0x45461a;_0x3e4c37++){var _0x32544e=events[_0x3e4c37];var _0x1ac268=createListener(_0x3f69('0x7')+_0x32544e,_0x489d4d);UserVoiceQueueRtEvents['on'](_0x32544e,_0x1ac268);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index f91f571..5274563 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54c439,_0x5227c0){var _0x491626=function(_0x27cdfd){while(--_0x27cdfd){_0x54c439['push'](_0x54c439['shift']());}};_0x491626(++_0x5227c0);}(_0xe706,0xa3));var _0x6e70=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0xe706[_0x11ca63];return _0x41f1f6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ae860,_0x1045c9){var _0x5b7481=function(_0x5967de){while(--_0x5967de){_0x2ae860['push'](_0x2ae860['shift']());}};_0x5b7481(++_0x1045c9);}(_0xe706,0xa3));var _0x6e70=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xe706[_0x409353];return _0x4f4b59;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 41a3609..2001edd 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 _0x6744=['INTEGER'];(function(_0x261db1,_0x10ceb4){var _0x426a93=function(_0x29ae48){while(--_0x29ae48){_0x261db1['push'](_0x261db1['shift']());}};_0x426a93(++_0x10ceb4);}(_0x6744,0xbb));var _0x4674=function(_0x3f6d18,_0xa53e0d){_0x3f6d18=_0x3f6d18-0x0;var _0x9cd6a1=_0x6744[_0x3f6d18];return _0x9cd6a1;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x4674('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x50d6=['INTEGER','sequelize'];(function(_0x252609,_0x24a2ba){var _0x33dca3=function(_0x12aeb6){while(--_0x12aeb6){_0x252609['push'](_0x252609['shift']());}};_0x33dca3(++_0x24a2ba);}(_0x50d6,0xc5));var _0x650d=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x50d6[_0x555b2f];return _0x81c0a6;};'use strict';var Sequelize=require(_0x650d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x650d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 971e1dd..2c612e6 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 _0x3841=['api','moment','bluebird','request-promise','path','./userWhatsappQueue.attributes','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger'];(function(_0x22660a,_0x25c004){var _0x3192a0=function(_0x474d10){while(--_0x474d10){_0x22660a['push'](_0x22660a['shift']());}};_0x3192a0(++_0x25c004);}(_0x3841,0x97));var _0x1384=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x3841[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x1384('0x0'));var util=require(_0x1384('0x1'));var logger=require(_0x1384('0x2'))(_0x1384('0x3'));var moment=require(_0x1384('0x4'));var BPromise=require(_0x1384('0x5'));var rp=require(_0x1384('0x6'));var fs=require('fs');var path=require(_0x1384('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1384('0x8'));module['exports']=function(_0x2c4946,_0x4208fc){return _0x2c4946['define'](_0x1384('0x9'),attributes,{'tableName':_0x1384('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2864=['UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x4aab2,_0x2d1d97){var _0xa8c776=function(_0x33ff8b){while(--_0x33ff8b){_0x4aab2['push'](_0x4aab2['shift']());}};_0xa8c776(++_0x2d1d97);}(_0x2864,0x1c4));var _0x4286=function(_0x121d9e,_0x11b966){_0x121d9e=_0x121d9e-0x0;var _0x5df466=_0x2864[_0x121d9e];return _0x5df466;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4286('0x0'))(_0x4286('0x1'));var moment=require(_0x4286('0x2'));var BPromise=require('bluebird');var rp=require(_0x4286('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4286('0x4'));var config=require(_0x4286('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0x4286('0x6')]=function(_0xd8dcbe,_0x117d1b){return _0xd8dcbe['define'](_0x4286('0x7'),attributes,{'tableName':_0x4286('0x8'),'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 4460ef7..9876765 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 _0x476d=['error','code','message','result','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1e5c55,_0x158ace){var _0x1cb71d=function(_0x54f440){while(--_0x54f440){_0x1e5c55['push'](_0x1e5c55['shift']());}};_0x1cb71d(++_0x158ace);}(_0x476d,0x1cc));var _0xd476=function(_0x5c9475,_0xe72afb){_0x5c9475=_0x5c9475-0x0;var _0x5942cb=_0x476d[_0x5c9475];return _0x5942cb;};'use strict';var _=require('lodash');var util=require(_0xd476('0x0'));var moment=require('moment');var BPromise=require(_0xd476('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd476('0x2'))['db'];var utils=require(_0xd476('0x3'));var logger=require(_0xd476('0x4'))(_0xd476('0x5'));var config=require('../../config/environment');var jayson=require(_0xd476('0x6'));var client=jayson[_0xd476('0x7')][_0xd476('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e180b,_0xc6fbf,_0x411891){return new BPromise(function(_0x167602,_0x5c0ec4){return client[_0xd476('0x9')](_0x5e180b,_0x411891)['then'](function(_0x1f02c7){logger[_0xd476('0xa')](_0xd476('0xb'),_0xc6fbf,_0xd476('0xc'));logger[_0xd476('0xd')](_0xd476('0xe'),_0xc6fbf,_0xd476('0xc'),JSON['stringify'](_0x1f02c7));if(_0x1f02c7[_0xd476('0xf')]){if(_0x1f02c7[_0xd476('0xf')][_0xd476('0x10')]===0x1f4){logger[_0xd476('0xf')](_0xd476('0xb'),_0xc6fbf,_0x1f02c7[_0xd476('0xf')][_0xd476('0x11')]);return _0x5c0ec4(_0x1f02c7[_0xd476('0xf')][_0xd476('0x11')]);}logger[_0xd476('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0xc6fbf,_0x1f02c7[_0xd476('0xf')][_0xd476('0x11')]);return _0x167602(_0x1f02c7[_0xd476('0xf')][_0xd476('0x11')]);}else{logger[_0xd476('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0xc6fbf,_0xd476('0xc'));_0x167602(_0x1f02c7[_0xd476('0x12')][_0xd476('0x11')]);}})['catch'](function(_0x5828e5){logger[_0xd476('0xf')](_0xd476('0xb'),_0xc6fbf,_0x5828e5);_0x5c0ec4(_0x5828e5);});});} \ No newline at end of file +var _0x21a7=['jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x153e7d,_0x10a35f){var _0x3c22dd=function(_0x4d33f6){while(--_0x4d33f6){_0x153e7d['push'](_0x153e7d['shift']());}};_0x3c22dd(++_0x10a35f);}(_0x21a7,0x1ea));var _0x721a=function(_0x3e4c75,_0x37bf42){_0x3e4c75=_0x3e4c75-0x0;var _0x20d400=_0x21a7[_0x3e4c75];return _0x20d400;};'use strict';var _=require(_0x721a('0x0'));var util=require(_0x721a('0x1'));var moment=require('moment');var BPromise=require(_0x721a('0x2'));var rs=require(_0x721a('0x3'));var fs=require('fs');var Redis=require(_0x721a('0x4'));var db=require(_0x721a('0x5'))['db'];var utils=require(_0x721a('0x6'));var logger=require(_0x721a('0x7'))(_0x721a('0x8'));var config=require(_0x721a('0x9'));var jayson=require(_0x721a('0xa'));var client=jayson[_0x721a('0xb')][_0x721a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ee288,_0x2a2f19,_0x3e0551){return new BPromise(function(_0x332119,_0x7af624){return client[_0x721a('0xd')](_0x4ee288,_0x3e0551)[_0x721a('0xe')](function(_0x38cb3c){logger[_0x721a('0xf')](_0x721a('0x10'),_0x2a2f19,_0x721a('0x11'));logger[_0x721a('0x12')](_0x721a('0x13'),_0x2a2f19,_0x721a('0x11'),JSON[_0x721a('0x14')](_0x38cb3c));if(_0x38cb3c[_0x721a('0x15')]){if(_0x38cb3c[_0x721a('0x15')]['code']===0x1f4){logger[_0x721a('0x15')](_0x721a('0x10'),_0x2a2f19,_0x38cb3c[_0x721a('0x15')]['message']);return _0x7af624(_0x38cb3c['error'][_0x721a('0x16')]);}logger[_0x721a('0x15')](_0x721a('0x10'),_0x2a2f19,_0x38cb3c[_0x721a('0x15')][_0x721a('0x16')]);return _0x332119(_0x38cb3c[_0x721a('0x15')][_0x721a('0x16')]);}else{logger[_0x721a('0xf')](_0x721a('0x10'),_0x2a2f19,_0x721a('0x11'));_0x332119(_0x38cb3c[_0x721a('0x17')][_0x721a('0x16')]);}})[_0x721a('0x18')](function(_0xf2245c){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2a2f19,_0xf2245c);_0x7af624(_0xf2245c);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index e7b1a7d..48dbffe 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 _0xf9f7=['Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x581b73,_0x4fa43c){_0x581b73=_0x581b73-0x0;var _0x3ea0ec=_0xf9f7[_0x581b73];return _0x3ea0ec;};'use strict';var multer=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var path=require(_0x7f9f('0x2'));var timeout=require(_0x7f9f('0x3'));var express=require(_0x7f9f('0x4'));var router=express[_0x7f9f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7f9f('0x6'));var config=require(_0x7f9f('0x7'));var controller=require(_0x7f9f('0x8'));router[_0x7f9f('0x9')]('/',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0xb')]);router['get'](_0x7f9f('0xc'),auth[_0x7f9f('0xa')](),controller[_0x7f9f('0xd')]);router[_0x7f9f('0xe')]('/',auth[_0x7f9f('0xa')](),controller['create']);router[_0x7f9f('0xf')](_0x7f9f('0xc'),auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x10')]);router[_0x7f9f('0x11')](_0x7f9f('0xc'),auth[_0x7f9f('0xa')](),controller['destroy']);module[_0x7f9f('0x12')]=router; \ No newline at end of file +var _0xcb57=['../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','/:id','show','post','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x2f3a6b,_0x12a1ba){var _0x2ded4c=function(_0x4d6622){while(--_0x4d6622){_0x2f3a6b['push'](_0x2f3a6b['shift']());}};_0x2ded4c(++_0x12a1ba);}(_0xcb57,0xa1));var _0x7cb5=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xcb57[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0x7cb5('0x0'));var util=require(_0x7cb5('0x1'));var path=require('path');var timeout=require(_0x7cb5('0x2'));var express=require('express');var router=express[_0x7cb5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7cb5('0x4'));var interaction=require(_0x7cb5('0x5'));var config=require('../../config/environment');var controller=require(_0x7cb5('0x6'));router[_0x7cb5('0x7')]('/',auth[_0x7cb5('0x8')](),controller['index']);router[_0x7cb5('0x7')](_0x7cb5('0x9'),auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xa')]);router[_0x7cb5('0xb')]('/',auth[_0x7cb5('0x8')](),controller['create']);router['put']('/:id',auth[_0x7cb5('0x8')](),controller['update']);router[_0x7cb5('0xc')]('/:id',auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xd')]);module[_0x7cb5('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 7f98270..436680c 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 _0x8b2d=['STRING'];(function(_0x5717fa,_0x4c0526){var _0xcfcaa3=function(_0x239180){while(--_0x239180){_0x5717fa['push'](_0x5717fa['shift']());}};_0xcfcaa3(++_0x4c0526);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x17cdcc,_0x29d5de){_0x17cdcc=_0x17cdcc-0x0;var _0x38f5f6=_0x8b2d[_0x17cdcc];return _0x38f5f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd8b2('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd8b2('0x0')]}}; \ No newline at end of file +var _0x8e0e=['STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8e0e,0x176));var _0xe8e0=function(_0x21d19,_0x59a7b0){_0x21d19=_0x21d19-0x0;var _0xa181b5=_0x8e0e[_0x21d19];return _0xa181b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe8e0('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe8e0('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 163e0a0..ef53686 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 _0xc96c=['pick','merge','type','filter','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','create','error','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','Variable','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where'];(function(_0x40f392,_0x1d4381){var _0x534ceb=function(_0x11de50){while(--_0x11de50){_0x40f392['push'](_0x40f392['shift']());}};_0x534ceb(++_0x1d4381);}(_0xc96c,0x169));var _0xcc96=function(_0x106fed,_0x3d8337){_0x106fed=_0x106fed-0x0;var _0x39e37d=_0xc96c[_0x106fed];return _0x39e37d;};'use strict';var emlformat=require(_0xcc96('0x0'));var rimraf=require(_0xcc96('0x1'));var zipdir=require(_0xcc96('0x2'));var jsonpatch=require(_0xcc96('0x3'));var rp=require('request-promise');var moment=require(_0xcc96('0x4'));var BPromise=require(_0xcc96('0x5'));var Mustache=require(_0xcc96('0x6'));var util=require(_0xcc96('0x7'));var path=require(_0xcc96('0x8'));var sox=require(_0xcc96('0x9'));var csv=require(_0xcc96('0xa'));var ejs=require(_0xcc96('0xb'));var fs=require('fs');var fs_extra=require(_0xcc96('0xc'));var _=require(_0xcc96('0xd'));var squel=require(_0xcc96('0xe'));var crypto=require(_0xcc96('0xf'));var jsforce=require(_0xcc96('0x10'));var deskjs=require(_0xcc96('0x11'));var toCsv=require(_0xcc96('0xa'));var querystring=require(_0xcc96('0x12'));var Papa=require(_0xcc96('0x13'));var Redis=require(_0xcc96('0x14'));var authService=require(_0xcc96('0x15'));var qs=require(_0xcc96('0x16'));var as=require(_0xcc96('0x17'));var hardwareService=require(_0xcc96('0x18'));var logger=require('../../config/logger')(_0xcc96('0x19'));var utils=require(_0xcc96('0x1a'));var config=require(_0xcc96('0x1b'));var licenseUtil=require(_0xcc96('0x1c'));var db=require(_0xcc96('0x1d'))['db'];function respondWithStatusCode(_0x4c04d3,_0x5443b5){_0x5443b5=_0x5443b5||0xcc;return function(_0x233ccc){if(_0x233ccc){return _0x4c04d3[_0xcc96('0x1e')](_0x5443b5);}return _0x4c04d3[_0xcc96('0x1f')](_0x5443b5)[_0xcc96('0x20')]();};}function respondWithResult(_0x3076ce,_0x61f948){_0x61f948=_0x61f948||0xc8;return function(_0x3582a4){if(_0x3582a4){return _0x3076ce[_0xcc96('0x1f')](_0x61f948)[_0xcc96('0x21')](_0x3582a4);}};}function respondWithFilteredResult(_0x10f4ff,_0x3b7a47){return function(_0x2d0c98){if(_0x2d0c98){var _0x1bc9ab=typeof _0x3b7a47[_0xcc96('0x22')]===_0xcc96('0x23')&&typeof _0x3b7a47[_0xcc96('0x24')]===_0xcc96('0x23');var _0x181e68=_0x2d0c98[_0xcc96('0x25')];var _0x2598ae=_0x1bc9ab?0x0:_0x3b7a47[_0xcc96('0x22')];var _0x3fc938=_0x1bc9ab?_0x2d0c98[_0xcc96('0x25')]:_0x3b7a47[_0xcc96('0x22')]+_0x3b7a47['limit'];var _0x25bb95;if(_0x3fc938>=_0x181e68){_0x3fc938=_0x181e68;_0x25bb95=0xc8;}else{_0x25bb95=0xce;}_0x10f4ff[_0xcc96('0x1f')](_0x25bb95);return _0x10f4ff[_0xcc96('0x26')]('Content-Range',_0x2598ae+'-'+_0x3fc938+'/'+_0x181e68)[_0xcc96('0x21')](_0x2d0c98);}return null;};}function patchUpdates(_0x49b00c){return function(_0x1ab79d){try{jsonpatch[_0xcc96('0x27')](_0x1ab79d,_0x49b00c,!![]);}catch(_0x52b7e9){return BPromise[_0xcc96('0x28')](_0x52b7e9);}return _0x1ab79d[_0xcc96('0x29')]();};}function saveUpdates(_0x1798ae,_0x477311){return function(_0x3cf85f){if(_0x3cf85f){return _0x3cf85f[_0xcc96('0x2a')](_0x1798ae)[_0xcc96('0x2b')](function(_0x694eb){return _0x694eb;});}return null;};}function removeEntity(_0x1f4753,_0xce1883){return function(_0x2251f0){if(_0x2251f0){return _0x2251f0[_0xcc96('0x2c')]()[_0xcc96('0x2b')](function(){var _0x58bd90=_0x2251f0[_0xcc96('0x2d')]({'plain':!![]});var _0x49c682='Variables';return db[_0xcc96('0x2e')]['destroy']({'where':{'type':_0x49c682,'resourceId':_0x58bd90['id']}})['then'](function(){return _0x2251f0;});})['then'](function(){_0x1f4753[_0xcc96('0x1f')](0xcc)[_0xcc96('0x20')]();});}};}function handleEntityNotFound(_0x5cce75,_0x456b92){return function(_0x15af65){if(!_0x15af65){_0x5cce75[_0xcc96('0x1e')](0x194);}return _0x15af65;};}function handleError(_0x4b0bab,_0x459800){_0x459800=_0x459800||0x1f4;return function(_0x36d6f7){logger['error'](_0x36d6f7[_0xcc96('0x2f')]);if(_0x36d6f7[_0xcc96('0x30')]){delete _0x36d6f7['name'];}_0x4b0bab[_0xcc96('0x1f')](_0x459800)[_0xcc96('0x31')](_0x36d6f7);};}exports['index']=function(_0xc6e33f,_0x491fa5){var _0x435ac8={},_0x2a2ac9={},_0x2c8707={'count':0x0,'rows':[]};var _0x1e551b=_['map'](db[_0xcc96('0x32')]['rawAttributes'],function(_0x4baf3e){return{'name':_0x4baf3e[_0xcc96('0x33')],'type':_0x4baf3e['type'][_0xcc96('0x34')]};});_0x2a2ac9[_0xcc96('0x35')]=_['map'](_0x1e551b,_0xcc96('0x30'));_0x2a2ac9['query']=_[_0xcc96('0x36')](_0xc6e33f[_0xcc96('0x37')]);_0x2a2ac9[_0xcc96('0x38')]=_[_0xcc96('0x39')](_0x2a2ac9[_0xcc96('0x35')],_0x2a2ac9[_0xcc96('0x37')]);_0x435ac8[_0xcc96('0x3a')]=_[_0xcc96('0x39')](_0x2a2ac9['model'],qs['fields'](_0xc6e33f[_0xcc96('0x37')][_0xcc96('0x3b')]));_0x435ac8[_0xcc96('0x3a')]=_0x435ac8[_0xcc96('0x3a')]['length']?_0x435ac8[_0xcc96('0x3a')]:_0x2a2ac9[_0xcc96('0x35')];if(!_0xc6e33f['query'][_0xcc96('0x3c')]('nolimit')){_0x435ac8['limit']=qs[_0xcc96('0x24')](_0xc6e33f[_0xcc96('0x37')][_0xcc96('0x24')]);_0x435ac8[_0xcc96('0x22')]=qs['offset'](_0xc6e33f[_0xcc96('0x37')][_0xcc96('0x22')]);}_0x435ac8[_0xcc96('0x3d')]=qs[_0xcc96('0x3e')](_0xc6e33f[_0xcc96('0x37')]['sort']);_0x435ac8[_0xcc96('0x3f')]=qs[_0xcc96('0x38')](_[_0xcc96('0x40')](_0xc6e33f[_0xcc96('0x37')],_0x2a2ac9[_0xcc96('0x38')]),_0x1e551b);if(_0xc6e33f[_0xcc96('0x37')]['filter']){_0x435ac8[_0xcc96('0x3f')]=_[_0xcc96('0x41')](_0x435ac8[_0xcc96('0x3f')],{'$or':_['map'](_0x1e551b,function(_0x3e9898){if(_0x3e9898[_0xcc96('0x42')]!=='VIRTUAL'){var _0x1a3e2d={};_0x1a3e2d[_0x3e9898[_0xcc96('0x30')]]={'$like':'%'+_0xc6e33f[_0xcc96('0x37')][_0xcc96('0x43')]+'%'};return _0x1a3e2d;}})});}_0x435ac8=_[_0xcc96('0x41')]({},_0x435ac8,_0xc6e33f['options']);var _0x15bd6b={'where':_0x435ac8[_0xcc96('0x3f')]};return db[_0xcc96('0x32')][_0xcc96('0x25')](_0x15bd6b)[_0xcc96('0x2b')](function(_0x55aa7a){_0x2c8707['count']=_0x55aa7a;if(_0xc6e33f['query']['includeAll']){_0x435ac8['include']=[{'all':!![]}];}return db['Variable'][_0xcc96('0x44')](_0x435ac8);})[_0xcc96('0x2b')](function(_0x23e7f9){_0x2c8707[_0xcc96('0x45')]=_0x23e7f9;return _0x2c8707;})['then'](respondWithFilteredResult(_0x491fa5,_0x435ac8))[_0xcc96('0x46')](handleError(_0x491fa5,null));};exports[_0xcc96('0x47')]=function(_0x59ef51,_0x4208a2){var _0x36a66b={'raw':!![],'where':{'id':_0x59ef51[_0xcc96('0x48')]['id']}},_0x2e9ccf={};_0x2e9ccf['model']=_['keys'](db[_0xcc96('0x32')][_0xcc96('0x49')]);_0x2e9ccf['query']=_[_0xcc96('0x36')](_0x59ef51[_0xcc96('0x37')]);_0x2e9ccf[_0xcc96('0x38')]=_[_0xcc96('0x39')](_0x2e9ccf[_0xcc96('0x35')],_0x2e9ccf['query']);_0x36a66b[_0xcc96('0x3a')]=_['intersection'](_0x2e9ccf[_0xcc96('0x35')],qs[_0xcc96('0x3b')](_0x59ef51[_0xcc96('0x37')][_0xcc96('0x3b')]));_0x36a66b[_0xcc96('0x3a')]=_0x36a66b['attributes'][_0xcc96('0x4a')]?_0x36a66b['attributes']:_0x2e9ccf['model'];if(_0x59ef51[_0xcc96('0x37')][_0xcc96('0x4b')]){_0x36a66b[_0xcc96('0x4c')]=[{'all':!![]}];}_0x36a66b=_['merge']({},_0x36a66b,_0x59ef51['options']);return db[_0xcc96('0x32')][_0xcc96('0x4d')](_0x36a66b)['then'](handleEntityNotFound(_0x4208a2,null))[_0xcc96('0x2b')](respondWithResult(_0x4208a2,null))['catch'](handleError(_0x4208a2,null));};exports['create']=function(_0x337e4e,_0x23eab1){return db[_0xcc96('0x32')]['create'](_0x337e4e[_0xcc96('0x4e')],{})[_0xcc96('0x2b')](function(_0x4b2d47){var _0x2be37b=_0x337e4e[_0xcc96('0x4f')][_0xcc96('0x2d')]({'plain':!![]});if(!_0x2be37b)throw new Error(_0xcc96('0x50'));if(_0x2be37b['role']==='user'){var _0x5055a5=_0x4b2d47[_0xcc96('0x2d')]({'plain':!![]});var _0x3eb5af=_0xcc96('0x51');return db[_0xcc96('0x52')]['find']({'where':{'name':_0x3eb5af,'userProfileId':_0x2be37b['userProfileId']},'raw':!![]})[_0xcc96('0x2b')](function(_0x1d4589){if(_0x1d4589&&_0x1d4589['autoAssociation']===0x0){return db['UserProfileResource'][_0xcc96('0x53')]({'name':_0x5055a5[_0xcc96('0x30')],'resourceId':_0x5055a5['id'],'type':_0x1d4589[_0xcc96('0x30')],'sectionId':_0x1d4589['id']},{})[_0xcc96('0x2b')](function(){return _0x4b2d47;});}else{return _0x4b2d47;}})['catch'](function(_0x4655fa){logger[_0xcc96('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4655fa);throw _0x4655fa;});}return _0x4b2d47;})['then'](respondWithResult(_0x23eab1,0xc9))[_0xcc96('0x46')](handleError(_0x23eab1,null));};exports[_0xcc96('0x2a')]=function(_0x5254a3,_0x10e9e5){if(_0x5254a3[_0xcc96('0x4e')]['id']){delete _0x5254a3[_0xcc96('0x4e')]['id'];}return db[_0xcc96('0x32')][_0xcc96('0x4d')]({'where':{'id':_0x5254a3[_0xcc96('0x48')]['id']}})[_0xcc96('0x2b')](handleEntityNotFound(_0x10e9e5,null))[_0xcc96('0x2b')](saveUpdates(_0x5254a3[_0xcc96('0x4e')],null))['then'](respondWithResult(_0x10e9e5,null))['catch'](handleError(_0x10e9e5,null));};exports['destroy']=function(_0x5b64fb,_0x513d7e){return db[_0xcc96('0x32')]['find']({'where':{'id':_0x5b64fb['params']['id']}})['then'](handleEntityNotFound(_0x513d7e,null))[_0xcc96('0x2b')](removeEntity(_0x513d7e,null))[_0xcc96('0x46')](handleError(_0x513d7e,null));}; \ No newline at end of file +var _0x06cd=['reject','save','then','Variables','error','stack','name','send','index','Variable','rawAttributes','fieldName','key','model','map','keys','query','attributes','fields','length','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x1e4855,_0x5cf952){var _0x5bed51=function(_0xf8c6d9){while(--_0xf8c6d9){_0x1e4855['push'](_0x1e4855['shift']());}};_0x5bed51(++_0x5cf952);}(_0x06cd,0x134));var _0xd06c=function(_0x233b11,_0x4b8cdf){_0x233b11=_0x233b11-0x0;var _0x12959a=_0x06cd[_0x233b11];return _0x12959a;};'use strict';var emlformat=require(_0xd06c('0x0'));var rimraf=require(_0xd06c('0x1'));var zipdir=require(_0xd06c('0x2'));var jsonpatch=require(_0xd06c('0x3'));var rp=require('request-promise');var moment=require(_0xd06c('0x4'));var BPromise=require(_0xd06c('0x5'));var Mustache=require(_0xd06c('0x6'));var util=require(_0xd06c('0x7'));var path=require(_0xd06c('0x8'));var sox=require(_0xd06c('0x9'));var csv=require(_0xd06c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd06c('0xb'));var _=require(_0xd06c('0xc'));var squel=require(_0xd06c('0xd'));var crypto=require(_0xd06c('0xe'));var jsforce=require(_0xd06c('0xf'));var deskjs=require(_0xd06c('0x10'));var toCsv=require(_0xd06c('0xa'));var querystring=require(_0xd06c('0x11'));var Papa=require(_0xd06c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd06c('0x13'));var as=require(_0xd06c('0x14'));var hardwareService=require(_0xd06c('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xd06c('0x16'));var config=require(_0xd06c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd06c('0x18'))['db'];function respondWithStatusCode(_0x1c7a78,_0x330c05){_0x330c05=_0x330c05||0xcc;return function(_0x30b2d9){if(_0x30b2d9){return _0x1c7a78[_0xd06c('0x19')](_0x330c05);}return _0x1c7a78[_0xd06c('0x1a')](_0x330c05)[_0xd06c('0x1b')]();};}function respondWithResult(_0x1a7b27,_0x575036){_0x575036=_0x575036||0xc8;return function(_0x308f6d){if(_0x308f6d){return _0x1a7b27[_0xd06c('0x1a')](_0x575036)[_0xd06c('0x1c')](_0x308f6d);}};}function respondWithFilteredResult(_0x2102cd,_0x12cb50){return function(_0x245fe4){if(_0x245fe4){var _0x508ebc=typeof _0x12cb50[_0xd06c('0x1d')]===_0xd06c('0x1e')&&typeof _0x12cb50[_0xd06c('0x1f')]==='undefined';var _0x4b1491=_0x245fe4['count'];var _0x4ab1f4=_0x508ebc?0x0:_0x12cb50[_0xd06c('0x1d')];var _0x1799d1=_0x508ebc?_0x245fe4[_0xd06c('0x20')]:_0x12cb50[_0xd06c('0x1d')]+_0x12cb50[_0xd06c('0x1f')];var _0x1357b0;if(_0x1799d1>=_0x4b1491){_0x1799d1=_0x4b1491;_0x1357b0=0xc8;}else{_0x1357b0=0xce;}_0x2102cd['status'](_0x1357b0);return _0x2102cd[_0xd06c('0x21')](_0xd06c('0x22'),_0x4ab1f4+'-'+_0x1799d1+'/'+_0x4b1491)[_0xd06c('0x1c')](_0x245fe4);}return null;};}function patchUpdates(_0x201d84){return function(_0x7611d0){try{jsonpatch[_0xd06c('0x23')](_0x7611d0,_0x201d84,!![]);}catch(_0x231831){return BPromise[_0xd06c('0x24')](_0x231831);}return _0x7611d0[_0xd06c('0x25')]();};}function saveUpdates(_0xbd8fc2,_0x4f2ff0){return function(_0x4dafd6){if(_0x4dafd6){return _0x4dafd6['update'](_0xbd8fc2)[_0xd06c('0x26')](function(_0x5293a4){return _0x5293a4;});}return null;};}function removeEntity(_0x32406a,_0x172dd3){return function(_0x5ca19d){if(_0x5ca19d){return _0x5ca19d['destroy']()[_0xd06c('0x26')](function(){var _0x222599=_0x5ca19d['get']({'plain':!![]});var _0x5c0a43=_0xd06c('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x5c0a43,'resourceId':_0x222599['id']}})[_0xd06c('0x26')](function(){return _0x5ca19d;});})[_0xd06c('0x26')](function(){_0x32406a[_0xd06c('0x1a')](0xcc)[_0xd06c('0x1b')]();});}};}function handleEntityNotFound(_0x444f7b,_0x2a222e){return function(_0x397fa5){if(!_0x397fa5){_0x444f7b['sendStatus'](0x194);}return _0x397fa5;};}function handleError(_0x4d325c,_0x54133b){_0x54133b=_0x54133b||0x1f4;return function(_0x176613){logger[_0xd06c('0x28')](_0x176613[_0xd06c('0x29')]);if(_0x176613['name']){delete _0x176613[_0xd06c('0x2a')];}_0x4d325c[_0xd06c('0x1a')](_0x54133b)[_0xd06c('0x2b')](_0x176613);};}exports[_0xd06c('0x2c')]=function(_0x2e5ec9,_0x5a5556){var _0x1865d2={},_0x3fff32={},_0x135db0={'count':0x0,'rows':[]};var _0x28a826=_['map'](db[_0xd06c('0x2d')][_0xd06c('0x2e')],function(_0x499f22){return{'name':_0x499f22[_0xd06c('0x2f')],'type':_0x499f22['type'][_0xd06c('0x30')]};});_0x3fff32[_0xd06c('0x31')]=_[_0xd06c('0x32')](_0x28a826,_0xd06c('0x2a'));_0x3fff32['query']=_[_0xd06c('0x33')](_0x2e5ec9[_0xd06c('0x34')]);_0x3fff32['filters']=_['intersection'](_0x3fff32[_0xd06c('0x31')],_0x3fff32[_0xd06c('0x34')]);_0x1865d2[_0xd06c('0x35')]=_['intersection'](_0x3fff32[_0xd06c('0x31')],qs[_0xd06c('0x36')](_0x2e5ec9[_0xd06c('0x34')][_0xd06c('0x36')]));_0x1865d2[_0xd06c('0x35')]=_0x1865d2[_0xd06c('0x35')][_0xd06c('0x37')]?_0x1865d2['attributes']:_0x3fff32[_0xd06c('0x31')];if(!_0x2e5ec9['query']['hasOwnProperty']('nolimit')){_0x1865d2['limit']=qs[_0xd06c('0x1f')](_0x2e5ec9[_0xd06c('0x34')][_0xd06c('0x1f')]);_0x1865d2[_0xd06c('0x1d')]=qs[_0xd06c('0x1d')](_0x2e5ec9['query']['offset']);}_0x1865d2['order']=qs[_0xd06c('0x38')](_0x2e5ec9[_0xd06c('0x34')][_0xd06c('0x38')]);_0x1865d2[_0xd06c('0x39')]=qs[_0xd06c('0x3a')](_[_0xd06c('0x3b')](_0x2e5ec9[_0xd06c('0x34')],_0x3fff32[_0xd06c('0x3a')]),_0x28a826);if(_0x2e5ec9[_0xd06c('0x34')][_0xd06c('0x3c')]){_0x1865d2['where']=_[_0xd06c('0x3d')](_0x1865d2[_0xd06c('0x39')],{'$or':_[_0xd06c('0x32')](_0x28a826,function(_0x53aff6){if(_0x53aff6[_0xd06c('0x3e')]!==_0xd06c('0x3f')){var _0x61b580={};_0x61b580[_0x53aff6[_0xd06c('0x2a')]]={'$like':'%'+_0x2e5ec9[_0xd06c('0x34')][_0xd06c('0x3c')]+'%'};return _0x61b580;}})});}_0x1865d2=_['merge']({},_0x1865d2,_0x2e5ec9[_0xd06c('0x40')]);var _0x2f3b94={'where':_0x1865d2[_0xd06c('0x39')]};return db[_0xd06c('0x2d')][_0xd06c('0x20')](_0x2f3b94)['then'](function(_0x51df70){_0x135db0['count']=_0x51df70;if(_0x2e5ec9[_0xd06c('0x34')]['includeAll']){_0x1865d2[_0xd06c('0x41')]=[{'all':!![]}];}return db[_0xd06c('0x2d')][_0xd06c('0x42')](_0x1865d2);})[_0xd06c('0x26')](function(_0x4fc984){_0x135db0[_0xd06c('0x43')]=_0x4fc984;return _0x135db0;})[_0xd06c('0x26')](respondWithFilteredResult(_0x5a5556,_0x1865d2))['catch'](handleError(_0x5a5556,null));};exports['show']=function(_0x5a260c,_0x467358){var _0x59b50c={'raw':!![],'where':{'id':_0x5a260c[_0xd06c('0x44')]['id']}},_0x290084={};_0x290084[_0xd06c('0x31')]=_[_0xd06c('0x33')](db[_0xd06c('0x2d')][_0xd06c('0x2e')]);_0x290084[_0xd06c('0x34')]=_[_0xd06c('0x33')](_0x5a260c[_0xd06c('0x34')]);_0x290084['filters']=_['intersection'](_0x290084[_0xd06c('0x31')],_0x290084[_0xd06c('0x34')]);_0x59b50c[_0xd06c('0x35')]=_[_0xd06c('0x45')](_0x290084[_0xd06c('0x31')],qs[_0xd06c('0x36')](_0x5a260c['query'][_0xd06c('0x36')]));_0x59b50c[_0xd06c('0x35')]=_0x59b50c['attributes']['length']?_0x59b50c[_0xd06c('0x35')]:_0x290084[_0xd06c('0x31')];if(_0x5a260c[_0xd06c('0x34')][_0xd06c('0x46')]){_0x59b50c[_0xd06c('0x41')]=[{'all':!![]}];}_0x59b50c=_['merge']({},_0x59b50c,_0x5a260c['options']);return db['Variable'][_0xd06c('0x47')](_0x59b50c)[_0xd06c('0x26')](handleEntityNotFound(_0x467358,null))['then'](respondWithResult(_0x467358,null))['catch'](handleError(_0x467358,null));};exports[_0xd06c('0x48')]=function(_0x3ed90a,_0x56032b){return db[_0xd06c('0x2d')][_0xd06c('0x48')](_0x3ed90a[_0xd06c('0x49')],{})[_0xd06c('0x26')](function(_0x49d4a2){var _0x220d83=_0x3ed90a[_0xd06c('0x4a')]['get']({'plain':!![]});if(!_0x220d83)throw new Error(_0xd06c('0x4b'));if(_0x220d83[_0xd06c('0x4c')]===_0xd06c('0x4a')){var _0x589e8c=_0x49d4a2[_0xd06c('0x4d')]({'plain':!![]});var _0x2a721d=_0xd06c('0x27');return db[_0xd06c('0x4e')]['find']({'where':{'name':_0x2a721d,'userProfileId':_0x220d83[_0xd06c('0x4f')]},'raw':!![]})[_0xd06c('0x26')](function(_0x3a9bd9){if(_0x3a9bd9&&_0x3a9bd9[_0xd06c('0x50')]===0x0){return db[_0xd06c('0x51')][_0xd06c('0x48')]({'name':_0x589e8c[_0xd06c('0x2a')],'resourceId':_0x589e8c['id'],'type':_0x3a9bd9[_0xd06c('0x2a')],'sectionId':_0x3a9bd9['id']},{})[_0xd06c('0x26')](function(){return _0x49d4a2;});}else{return _0x49d4a2;}})[_0xd06c('0x52')](function(_0x44fede){logger[_0xd06c('0x28')](_0xd06c('0x53'),_0x44fede);throw _0x44fede;});}return _0x49d4a2;})[_0xd06c('0x26')](respondWithResult(_0x56032b,0xc9))[_0xd06c('0x52')](handleError(_0x56032b,null));};exports[_0xd06c('0x54')]=function(_0x5ed203,_0x521457){if(_0x5ed203[_0xd06c('0x49')]['id']){delete _0x5ed203[_0xd06c('0x49')]['id'];}return db[_0xd06c('0x2d')][_0xd06c('0x47')]({'where':{'id':_0x5ed203[_0xd06c('0x44')]['id']}})['then'](handleEntityNotFound(_0x521457,null))[_0xd06c('0x26')](saveUpdates(_0x5ed203['body'],null))[_0xd06c('0x26')](respondWithResult(_0x521457,null))[_0xd06c('0x52')](handleError(_0x521457,null));};exports[_0xd06c('0x55')]=function(_0xe18195,_0x3dd271){return db[_0xd06c('0x2d')][_0xd06c('0x47')]({'where':{'id':_0xe18195['params']['id']}})[_0xd06c('0x26')](handleEntityNotFound(_0x3dd271,null))['then'](removeEntity(_0x3dd271,null))[_0xd06c('0x52')](handleError(_0x3dd271,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index b4d969d..57afb2f 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 _0x7535=['exports','define','tools_variables','lodash','util','../../config/logger','api','path','rimraf','./variable.attributes'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7535,0x193));var _0x5753=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x7535[_0x1f8053];return _0x174fd8;};'use strict';var _=require(_0x5753('0x0'));var util=require(_0x5753('0x1'));var logger=require(_0x5753('0x2'))(_0x5753('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5753('0x4'));var rimraf=require(_0x5753('0x5'));var config=require('../../config/environment');var attributes=require(_0x5753('0x6'));module[_0x5753('0x7')]=function(_0x2caa19,_0x1a1efe){return _0x2caa19[_0x5753('0x8')]('Variable',attributes,{'tableName':_0x5753('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ee2=['path','../../config/environment','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49a385,_0x1e1956){var _0x5b6e29=function(_0x200257){while(--_0x200257){_0x49a385['push'](_0x49a385['shift']());}};_0x5b6e29(++_0x1e1956);}(_0x5ee2,0x12e));var _0x25ee=function(_0x426c79,_0x46480a){_0x426c79=_0x426c79-0x0;var _0x1d3ac0=_0x5ee2[_0x426c79];return _0x1d3ac0;};'use strict';var _=require(_0x25ee('0x0'));var util=require('util');var logger=require(_0x25ee('0x1'))(_0x25ee('0x2'));var moment=require(_0x25ee('0x3'));var BPromise=require(_0x25ee('0x4'));var rp=require(_0x25ee('0x5'));var fs=require('fs');var path=require(_0x25ee('0x6'));var rimraf=require('rimraf');var config=require(_0x25ee('0x7'));var attributes=require('./variable.attributes');module['exports']=function(_0x1d7bd5,_0x5675f9){return _0x1d7bd5[_0x25ee('0x8')](_0x25ee('0x9'),attributes,{'tableName':_0x25ee('0xa'),'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 fb99017..74b2b2b 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x347c14,_0xf2472f){var _0x46deb8=function(_0x34d287){while(--_0x34d287){_0x347c14['push'](_0x347c14['shift']());}};_0x46deb8(++_0xf2472f);}(_0x55ca,0x126));var _0xa55c=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x55ca[_0x1857d0];return _0x3e3c46;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _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(_0xbc7ea,_0x4d3f90){var _0xadc703=function(_0x8309cf){while(--_0x8309cf){_0xbc7ea['push'](_0xbc7ea['shift']());}};_0xadc703(++_0x4d3f90);}(_0x8ef6,0xf2));var _0x68ef=function(_0x347523,_0x3bfd5a){_0x347523=_0x347523-0x0;var _0x221940=_0x8ef6[_0x347523];return _0x221940;};'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 8988a1d..6ab4365 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 _0x72a5=['/migrations','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull'];(function(_0x598f21,_0x122523){var _0x127aab=function(_0x1860b8){while(--_0x1860b8){_0x598f21['push'](_0x598f21['shift']());}};_0x127aab(++_0x122523);}(_0x72a5,0x143));var _0x572a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72a5[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x572a('0x0'));var router=express[_0x572a('0x1')]();var auth=require(_0x572a('0x2'));var controller=require(_0x572a('0x3'));router[_0x572a('0x4')]('/',controller['index']);router[_0x572a('0x4')](_0x572a('0x5'),auth[_0x572a('0x6')](),auth[_0x572a('0x7')](),controller[_0x572a('0x8')]);router[_0x572a('0x4')](_0x572a('0x9'),auth[_0x572a('0x6')](),auth[_0x572a('0x7')](),controller[_0x572a('0xa')]);router[_0x572a('0x4')](_0x572a('0xb'),auth[_0x572a('0x6')](),auth[_0x572a('0x7')](),controller[_0x572a('0xc')]);router[_0x572a('0x4')]('/restart',auth[_0x572a('0x6')](),controller['restart']);router[_0x572a('0x4')](_0x572a('0xd'),controller['migrations']);module['exports']=router; \ No newline at end of file +var _0x7748=['exports','Router','../../components/auth/service','./version.controller','get','index','canUpdate','fetch','/reset','isAuthenticated','reset','pull','restart','/migrations','migrations'];(function(_0x3b4c9b,_0x68954f){var _0x499d19=function(_0x45f980){while(--_0x45f980){_0x3b4c9b['push'](_0x3b4c9b['shift']());}};_0x499d19(++_0x68954f);}(_0x7748,0x1c3));var _0x8774=function(_0x5d7d16,_0x4b5b15){_0x5d7d16=_0x5d7d16-0x0;var _0x290664=_0x7748[_0x5d7d16];return _0x290664;};'use strict';var express=require('express');var router=express[_0x8774('0x0')]();var auth=require(_0x8774('0x1'));var controller=require(_0x8774('0x2'));router[_0x8774('0x3')]('/',controller[_0x8774('0x4')]);router[_0x8774('0x3')]('/fetch',auth['isAuthenticated'](),auth[_0x8774('0x5')](),controller[_0x8774('0x6')]);router['get'](_0x8774('0x7'),auth[_0x8774('0x8')](),auth['canUpdate'](),controller[_0x8774('0x9')]);router[_0x8774('0x3')]('/pull',auth[_0x8774('0x8')](),auth[_0x8774('0x5')](),controller[_0x8774('0xa')]);router[_0x8774('0x3')]('/restart',auth[_0x8774('0x8')](),controller[_0x8774('0xb')]);router['get'](_0x8774('0xc'),controller[_0x8774('0xd')]);module[_0x8774('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 8da1369..488993a 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 _0x99f7=['update','simple-git','index','exports','query','latest','fetch','2.0.0','status','json','origin','master','info','git\x20fetch','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','root','server','migrations','length','replace','.js','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x99f7,0x12c));var _0x799f=function(_0x3994a8,_0x3da48f){_0x3994a8=_0x3994a8-0x0;var _0x4433f4=_0x99f7[_0x3994a8];return _0x4433f4;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x799f('0x0'))(module,_0x799f('0x1'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x799f('0x2')];var db=require(_0x799f('0x3'))['db'];var config=require(_0x799f('0x4'));var pm2=require(_0x799f('0x5'));var logger=require('../../config/logger')(_0x799f('0x6'));var git=require(_0x799f('0x7'))(config['root']);exports[_0x799f('0x8')]=function(_0x1c9261,_0x486c32){var _0x29fae2={'current':module[_0x799f('0x9')]['version'],'phonebar':0x2};if(_0x1c9261[_0x799f('0xa')]&&_0x1c9261[_0x799f('0xa')][_0x799f('0xb')]){return git[_0x799f('0xc')]()['tags'](function(_0x4ac029,_0x37478d){_0x29fae2['latest']=(_0x4ac029?module[_0x799f('0x9')]['version']:_0x37478d[_0x799f('0xb')])||_0x799f('0xd');return _0x486c32[_0x799f('0xe')](0xc8)['json'](_0x29fae2);});}else{return _0x486c32[_0x799f('0xe')](0xc8)[_0x799f('0xf')](_0x29fae2);}};exports[_0x799f('0xc')]=function(_0x5de7d5,_0x4c7bf9){return git['fetch']([_0x799f('0x10'),_0x799f('0x11')],function(_0x369030){if(_0x369030){logger['error'](_0x369030);return _0x4c7bf9[_0x799f('0xe')](0x1f4)['json'](_0x369030);}logger[_0x799f('0x12')](_0x799f('0x13'));return _0x4c7bf9[_0x799f('0xe')](0xc8)[_0x799f('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x799f('0x14')]=function(_0x163c4c,_0x29bf65){return git[_0x799f('0x14')]([_0x799f('0x15'),_0x799f('0x16')],function(_0x25e8e1){if(_0x25e8e1){logger[_0x799f('0x17')](_0x25e8e1);return _0x29bf65['status'](0x1f4)['json'](_0x25e8e1);}logger[_0x799f('0x12')](_0x799f('0x18'));return _0x29bf65[_0x799f('0xe')](0xc8)[_0x799f('0xf')]({'output':'git\x20reset\x20--hard'});});};exports[_0x799f('0x19')]=function(_0x1775c0,_0x442a2a){exec(_0x799f('0x1a'),function(_0xf66f7d,_0x2c2726,_0x320b67){logger[_0x799f('0x12')](_0x2c2726);logger['info'](_0x320b67);if(_0xf66f7d){logger['error'](_0xf66f7d);return _0x442a2a[_0x799f('0xe')](0x1f4)['json'](_0xf66f7d);}return _0x442a2a[_0x799f('0xe')](0xc8)[_0x799f('0xf')]({'output':_0x2c2726});});};exports['restart']=function(_0x297a92,_0x531141){return pm2['restart'](_0x799f('0x1b'))[_0x799f('0x1c')](function(_0xc20427){logger[_0x799f('0x12')](_0x799f('0x1d'),_0xc20427);return _0x531141[_0x799f('0xe')](0xc8)[_0x799f('0xf')]({'output':_0x799f('0x1e')});})[_0x799f('0x1f')](function(_0x588378){logger[_0x799f('0x17')](_0x588378);return _0x531141[_0x799f('0xe')](0x1f4)[_0x799f('0xf')](_0x588378);});};exports['migrations']=function(_0x99779a,_0x4e5312){var _0x369d30=fs[_0x799f('0x20')](path[_0x799f('0x21')](config[_0x799f('0x22')],_0x799f('0x23'),_0x799f('0x24')));var _0x2f8262=[];for(var _0x48dcbd=0x0;_0x48dcbd<_0x369d30[_0x799f('0x25')];_0x48dcbd++){var _0x115bdd=_0x369d30[_0x48dcbd][_0x799f('0x26')](_0x799f('0x27'),'');if(compareVersions(module[_0x799f('0x9')]['version'],_0x115bdd)===-0x1){_0x2f8262['push'](_0x115bdd);}}if(_0x2f8262['length']){var _0x34c958=_0x2f8262[_0x799f('0x28')](compareVersions);var _0x44ca0a=new Umzug({'storage':_0x799f('0x29'),'storageOptions':{'model':db[_0x799f('0x2a')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x799f('0x29')][_0x799f('0x2b')](),db[_0x799f('0x29')]['constructor'],function(){throw new Error(_0x799f('0x2c'));}],'path':path[_0x799f('0x21')](config[_0x799f('0x22')],'server',_0x799f('0x24')),'pattern':/\.js$/}});_0x44ca0a['up']({'migrations':_[_0x799f('0x2d')](_0x34c958,function(_0x5cc3fc){return _0x5cc3fc+'.js';})})[_0x799f('0x1c')](function(){return _0x4e5312[_0x799f('0xe')](0xc8)[_0x799f('0xf')]({'output':_0x799f('0x2e')+module[_0x799f('0x9')][_0x799f('0x1')]+_0x799f('0x2f')+_[_0x799f('0x30')](_0x34c958),'migrations':_[_0x799f('0x21')](_0x34c958)});})[_0x799f('0x1f')](function(_0x1e0bfe){if(_0x1e0bfe instanceof db['sequelize'][_0x799f('0x31')]){return _0x4e5312[_0x799f('0xe')](0xc8)[_0x799f('0xf')]({'output':_0x799f('0x32')});}else{return _0x4e5312[_0x799f('0xe')](0x1f4)['json'](_0x1e0bfe);}});}else{return _0x4e5312[_0x799f('0xe')](0xc8)['json']({'output':_0x799f('0x32')});}}; \ No newline at end of file +var _0x9ce9=['umzug','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','root','exports','query','latest','tags','2.0.0','status','fetch','origin','master','info','git\x20fetch','json','--hard','git\x20reset\x20--hard','pull','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','migrations','readdirSync','join','server','length','replace','.js','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9ce9,0xe6));var _0x99ce=function(_0x4d08a2,_0x4364f0){_0x4d08a2=_0x4d08a2-0x0;var _0x19f095=_0x9ce9[_0x4d08a2];return _0x19f095;};'use strict';var Umzug=require(_0x99ce('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x99ce('0x1'));var compareVersions=require(_0x99ce('0x2'));var exec=require(_0x99ce('0x3'))[_0x99ce('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x99ce('0x5'));var pm2=require('../../config/pm2');var logger=require(_0x99ce('0x6'))(_0x99ce('0x7'));var git=require('simple-git')(config[_0x99ce('0x8')]);exports['index']=function(_0x46fa48,_0x238c39){var _0x2aff90={'current':module[_0x99ce('0x9')][_0x99ce('0x1')],'phonebar':0x2};if(_0x46fa48[_0x99ce('0xa')]&&_0x46fa48['query'][_0x99ce('0xb')]){return git['fetch']()[_0x99ce('0xc')](function(_0x2f00b8,_0x5be934){_0x2aff90[_0x99ce('0xb')]=(_0x2f00b8?module['exports'][_0x99ce('0x1')]:_0x5be934[_0x99ce('0xb')])||_0x99ce('0xd');return _0x238c39['status'](0xc8)['json'](_0x2aff90);});}else{return _0x238c39[_0x99ce('0xe')](0xc8)['json'](_0x2aff90);}};exports[_0x99ce('0xf')]=function(_0x4cfe81,_0x43e63c){return git['fetch']([_0x99ce('0x10'),_0x99ce('0x11')],function(_0x2bb3de){if(_0x2bb3de){logger['error'](_0x2bb3de);return _0x43e63c[_0x99ce('0xe')](0x1f4)['json'](_0x2bb3de);}logger[_0x99ce('0x12')](_0x99ce('0x13'));return _0x43e63c[_0x99ce('0xe')](0xc8)[_0x99ce('0x14')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x4e6bb3,_0xda811a){return git['reset']([_0x99ce('0x15'),'FETCH_HEAD'],function(_0x15a91a){if(_0x15a91a){logger['error'](_0x15a91a);return _0xda811a[_0x99ce('0xe')](0x1f4)[_0x99ce('0x14')](_0x15a91a);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xda811a[_0x99ce('0xe')](0xc8)['json']({'output':_0x99ce('0x16')});});};exports[_0x99ce('0x17')]=function(_0x277b3d,_0x12bb50){exec('npm\x20install\x20--production',function(_0x5b0088,_0x24e09f,_0x3790a7){logger['info'](_0x24e09f);logger[_0x99ce('0x12')](_0x3790a7);if(_0x5b0088){logger[_0x99ce('0x18')](_0x5b0088);return _0x12bb50[_0x99ce('0xe')](0x1f4)['json'](_0x5b0088);}return _0x12bb50[_0x99ce('0xe')](0xc8)[_0x99ce('0x14')]({'output':_0x24e09f});});};exports[_0x99ce('0x19')]=function(_0x1e4929,_0x356af7){return pm2['restart'](_0x99ce('0x1a'))[_0x99ce('0x1b')](function(_0x399e84){logger[_0x99ce('0x12')](_0x99ce('0x1c'),_0x399e84);return _0x356af7[_0x99ce('0xe')](0xc8)[_0x99ce('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x4fbe9e){logger['error'](_0x4fbe9e);return _0x356af7[_0x99ce('0xe')](0x1f4)[_0x99ce('0x14')](_0x4fbe9e);});};exports[_0x99ce('0x1d')]=function(_0x4f29fe,_0x2cde65){var _0x3f17a1=fs[_0x99ce('0x1e')](path[_0x99ce('0x1f')](config[_0x99ce('0x8')],_0x99ce('0x20'),_0x99ce('0x1d')));var _0x5d8e8c=[];for(var _0x222fca=0x0;_0x222fca<_0x3f17a1[_0x99ce('0x21')];_0x222fca++){var _0x5ebe7e=_0x3f17a1[_0x222fca][_0x99ce('0x22')](_0x99ce('0x23'),'');if(compareVersions(module[_0x99ce('0x9')]['version'],_0x5ebe7e)===-0x1){_0x5d8e8c['push'](_0x5ebe7e);}}if(_0x5d8e8c[_0x99ce('0x21')]){var _0x500a05=_0x5d8e8c[_0x99ce('0x24')](compareVersions);var _0x16692d=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x99ce('0x25')],'modelName':_0x99ce('0x25'),'columnName':_0x99ce('0x1')},'migrations':{'params':[db[_0x99ce('0x26')][_0x99ce('0x27')](),db['sequelize'][_0x99ce('0x28')],function(){throw new Error(_0x99ce('0x29'));}],'path':path[_0x99ce('0x1f')](config[_0x99ce('0x8')],_0x99ce('0x20'),_0x99ce('0x1d')),'pattern':/\.js$/}});_0x16692d['up']({'migrations':_['map'](_0x500a05,function(_0x316ed7){return _0x316ed7+_0x99ce('0x23');})})[_0x99ce('0x1b')](function(){return _0x2cde65[_0x99ce('0xe')](0xc8)[_0x99ce('0x14')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x99ce('0x9')][_0x99ce('0x1')]+_0x99ce('0x2a')+_[_0x99ce('0x2b')](_0x500a05),'migrations':_[_0x99ce('0x1f')](_0x500a05)});})['catch'](function(_0x360ac1){if(_0x360ac1 instanceof db[_0x99ce('0x26')][_0x99ce('0x2c')]){return _0x2cde65[_0x99ce('0xe')](0xc8)['json']({'output':_0x99ce('0x2d')});}else{return _0x2cde65[_0x99ce('0xe')](0x1f4)[_0x99ce('0x14')](_0x360ac1);}});}else{return _0x2cde65[_0x99ce('0xe')](0xc8)['json']({'output':_0x99ce('0x2d')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ea47cad..cdf83f7 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 _0x77bc=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','put','destroy','exports','multer'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x77bc,0x14f));var _0xc77b=function(_0x1a3c6c,_0x38e6d4){_0x1a3c6c=_0x1a3c6c-0x0;var _0x3246c3=_0x77bc[_0x1a3c6c];return _0x3246c3;};'use strict';var multer=require(_0xc77b('0x0'));var util=require(_0xc77b('0x1'));var path=require('path');var timeout=require(_0xc77b('0x2'));var express=require(_0xc77b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc77b('0x4'));var interaction=require(_0xc77b('0x5'));var config=require(_0xc77b('0x6'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xc77b('0x7')](),controller[_0xc77b('0x8')]);router[_0xc77b('0x9')](_0xc77b('0xa'),auth[_0xc77b('0x7')](),controller['describe']);router[_0xc77b('0x9')](_0xc77b('0xb'),auth[_0xc77b('0x7')](),controller[_0xc77b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc77b('0xd')](_0xc77b('0xb'),auth[_0xc77b('0x7')](),controller['update']);router['delete'](_0xc77b('0xb'),auth[_0xc77b('0x7')](),controller[_0xc77b('0xe')]);module[_0xc77b('0xf')]=router; \ No newline at end of file +var _0x3f64=['/:id','show','post','create','update','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x18ada6,_0x3b385a){var _0x3d5cfd=function(_0x236de5){while(--_0x236de5){_0x18ada6['push'](_0x18ada6['shift']());}};_0x3d5cfd(++_0x3b385a);}(_0x3f64,0xf0));var _0x43f6=function(_0x546cb5,_0x2509cb){_0x546cb5=_0x546cb5-0x0;var _0x37e9e5=_0x3f64[_0x546cb5];return _0x37e9e5;};'use strict';var multer=require(_0x43f6('0x0'));var util=require('util');var path=require(_0x43f6('0x1'));var timeout=require(_0x43f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x43f6('0x3'));var auth=require(_0x43f6('0x4'));var interaction=require(_0x43f6('0x5'));var config=require(_0x43f6('0x6'));var controller=require(_0x43f6('0x7'));router['get']('/',auth[_0x43f6('0x8')](),controller['index']);router[_0x43f6('0x9')](_0x43f6('0xa'),auth[_0x43f6('0x8')](),controller[_0x43f6('0xb')]);router[_0x43f6('0x9')](_0x43f6('0xc'),auth[_0x43f6('0x8')](),controller[_0x43f6('0xd')]);router[_0x43f6('0xe')]('/',auth['isAuthenticated'](),controller[_0x43f6('0xf')]);router['put'](_0x43f6('0xc'),auth['isAuthenticated'](),controller[_0x43f6('0x10')]);router['delete'](_0x43f6('0xc'),auth[_0x43f6('0x8')](),controller['destroy']);module[_0x43f6('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 4a53e79..dbd27a9 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 _0x6b19=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x469a2d,_0x53bcbe){var _0x148147=function(_0xe46eea){while(--_0xe46eea){_0x469a2d['push'](_0x469a2d['shift']());}};_0x148147(++_0x53bcbe);}(_0x6b19,0xf4));var _0x96b1=function(_0x329daf,_0x1d55d2){_0x329daf=_0x329daf-0x0;var _0x5b4c04=_0x6b19[_0x329daf];return _0x5b4c04;};'use strict';var Sequelize=require(_0x96b1('0x0'));module['exports']={'type':{'type':Sequelize[_0x96b1('0x1')]},'uniqueid':{'type':Sequelize[_0x96b1('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x96b1('0x1')]},'queue':{'type':Sequelize[_0x96b1('0x1')]},'interface':{'type':Sequelize[_0x96b1('0x1')]},'membername':{'type':Sequelize[_0x96b1('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x96b1('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x96b1('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x96b1('0x3')]},'agentcomplete':{'type':Sequelize[_0x96b1('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x96b1('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x96b1('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x96b1('0x3')]},'reason':{'type':Sequelize[_0x96b1('0x1')]},'lastevent':{'type':Sequelize[_0x96b1('0x1')]},'channel':{'type':Sequelize[_0x96b1('0x1')]},'channelstate':{'type':Sequelize[_0x96b1('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x96b1('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x96b1('0x1')]},'priority':{'type':Sequelize[_0x96b1('0x1')]},'destchannel':{'type':Sequelize[_0x96b1('0x1')]},'destchannelstate':{'type':Sequelize[_0x96b1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x96b1('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x96b1('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x96b1('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x96b1('0x1')]},'destlanguage':{'type':Sequelize[_0x96b1('0x1')]},'destaccountcode':{'type':Sequelize[_0x96b1('0x1')]},'destcontext':{'type':Sequelize[_0x96b1('0x1')]},'destexten':{'type':Sequelize[_0x96b1('0x1')]},'destpriority':{'type':Sequelize[_0x96b1('0x1')]},'destuniqueid':{'type':Sequelize[_0x96b1('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x96b1('0x1')]},'transfer':{'type':Sequelize[_0x96b1('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x96b1('0x1')],'comment':_0x96b1('0x5')},'transferexten':{'type':Sequelize[_0x96b1('0x1')]},'transferuniqueid':{'type':Sequelize[_0x96b1('0x1')]},'agententerreason':{'type':Sequelize[_0x96b1('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x80e0=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','BOOLEAN'];(function(_0x5ea376,_0x5ee400){var _0x2b1525=function(_0x201175){while(--_0x201175){_0x5ea376['push'](_0x5ea376['shift']());}};_0x2b1525(++_0x5ee400);}(_0x80e0,0x9d));var _0x080e=function(_0x3b4404,_0x328390){_0x3b4404=_0x3b4404-0x0;var _0x540ce6=_0x80e0[_0x3b4404];return _0x540ce6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x080e('0x0')]},'uniqueid':{'type':Sequelize[_0x080e('0x0')]},'calleridnum':{'type':Sequelize[_0x080e('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x080e('0x0')]},'interface':{'type':Sequelize[_0x080e('0x0')]},'membername':{'type':Sequelize[_0x080e('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x080e('0x1')]},'agentcompleteAt':{'type':Sequelize[_0x080e('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0x080e('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x080e('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x080e('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x080e('0x3')]},'reason':{'type':Sequelize[_0x080e('0x0')]},'lastevent':{'type':Sequelize[_0x080e('0x0')]},'channel':{'type':Sequelize[_0x080e('0x0')]},'channelstate':{'type':Sequelize[_0x080e('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x080e('0x0')]},'language':{'type':Sequelize[_0x080e('0x0')]},'accountcode':{'type':Sequelize[_0x080e('0x0')]},'context':{'type':Sequelize[_0x080e('0x0')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x080e('0x0')]},'destchannelstate':{'type':Sequelize[_0x080e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x080e('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x080e('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x080e('0x0')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x080e('0x0')]},'destpriority':{'type':Sequelize[_0x080e('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x080e('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x080e('0x4')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x080e('0x0')]},'agententerreason':{'type':Sequelize[_0x080e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index a4bef52..cb8112b 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 da9ff01..7715ec1 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 _0xa6bb=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa6bb,0x12c));var _0xba6b=function(_0x1fe67f,_0x274220){_0x1fe67f=_0x1fe67f-0x0;var _0x3a04a5=_0xa6bb[_0x1fe67f];return _0x3a04a5;};'use strict';var _=require('lodash');var util=require(_0xba6b('0x0'));var logger=require(_0xba6b('0x1'))(_0xba6b('0x2'));var moment=require(_0xba6b('0x3'));var BPromise=require(_0xba6b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba6b('0x5'));var config=require(_0xba6b('0x6'));var attributes=require(_0xba6b('0x7'));module[_0xba6b('0x8')]=function(_0x517d10,_0x4cc381){return _0x517d10[_0xba6b('0x9')](_0xba6b('0xa'),attributes,{'tableName':_0xba6b('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ec6=['../../config/environment','exports','define','report_agent','destuniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2eba04,_0x32d3d2){var _0xa7a505=function(_0xdc6583){while(--_0xdc6583){_0x2eba04['push'](_0x2eba04['shift']());}};_0xa7a505(++_0x32d3d2);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x470854,_0x5b795a){_0x470854=_0x470854-0x0;var _0x28562d=_0x0ec6[_0x470854];return _0x28562d;};'use strict';var _=require(_0x60ec('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x60ec('0x1'));var moment=require(_0x60ec('0x2'));var BPromise=require(_0x60ec('0x3'));var rp=require(_0x60ec('0x4'));var fs=require('fs');var path=require(_0x60ec('0x5'));var rimraf=require(_0x60ec('0x6'));var config=require(_0x60ec('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x60ec('0x8')]=function(_0xb4a258,_0x1d8fb5){return _0xb4a258[_0x60ec('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x60ec('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x60ec('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index ff3d60b..3bca110 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 _0x8c43=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','then','UpdateVoiceAgentReport','update','where','attributes','limit','debug'];(function(_0x4ad42a,_0x2fac7e){var _0x19248c=function(_0x2b6973){while(--_0x2b6973){_0x4ad42a['push'](_0x4ad42a['shift']());}};_0x19248c(++_0x2fac7e);}(_0x8c43,0x69));var _0x38c4=function(_0x5360fe,_0x1c3dc9){_0x5360fe=_0x5360fe-0x0;var _0x2b305d=_0x8c43[_0x5360fe];return _0x2b305d;};'use strict';var _=require(_0x38c4('0x0'));var util=require(_0x38c4('0x1'));var moment=require(_0x38c4('0x2'));var BPromise=require(_0x38c4('0x3'));var rs=require(_0x38c4('0x4'));var fs=require('fs');var Redis=require(_0x38c4('0x5'));var db=require(_0x38c4('0x6'))['db'];var utils=require(_0x38c4('0x7'));var logger=require(_0x38c4('0x8'))(_0x38c4('0x9'));var config=require('../../config/environment');var jayson=require(_0x38c4('0xa'));var client=jayson[_0x38c4('0xb')][_0x38c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x275828,_0xc0f41,_0x3a3d25){return new BPromise(function(_0x367773,_0x48f96a){return client[_0x38c4('0xd')](_0x275828,_0x3a3d25)['then'](function(_0x53954d){logger[_0x38c4('0xe')](_0x38c4('0xf'),_0xc0f41,_0x38c4('0x10'));logger['debug'](_0x38c4('0x11'),_0xc0f41,_0x38c4('0x10'),JSON[_0x38c4('0x12')](_0x53954d));if(_0x53954d[_0x38c4('0x13')]){if(_0x53954d['error']['code']===0x1f4){logger[_0x38c4('0x13')](_0x38c4('0xf'),_0xc0f41,_0x53954d[_0x38c4('0x13')][_0x38c4('0x14')]);return _0x48f96a(_0x53954d[_0x38c4('0x13')][_0x38c4('0x14')]);}logger['error'](_0x38c4('0xf'),_0xc0f41,_0x53954d[_0x38c4('0x13')]['message']);return _0x367773(_0x53954d['error']['message']);}else{logger[_0x38c4('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0xc0f41,_0x38c4('0x10'));_0x367773(_0x53954d[_0x38c4('0x15')][_0x38c4('0x14')]);}})[_0x38c4('0x16')](function(_0x27416d){logger[_0x38c4('0x13')](_0x38c4('0xf'),_0xc0f41,_0x27416d);_0x48f96a(_0x27416d);});});}exports[_0x38c4('0x17')]=function(_0x3ebae7){var _0x313793=this;return new Promise(function(_0x1c54f9,_0x5d7d8d){return db[_0x38c4('0x18')]['create'](_0x3ebae7[_0x38c4('0x19')],{'raw':_0x3ebae7[_0x38c4('0x1a')]?_0x3ebae7['options'][_0x38c4('0x1b')]===undefined?!![]:![]:!![]})[_0x38c4('0x1c')](function(_0x58ecdf){logger[_0x38c4('0xe')](_0x38c4('0x17'),_0x3ebae7);logger['debug'](_0x38c4('0x17'),_0x3ebae7,JSON['stringify'](_0x58ecdf));_0x1c54f9(_0x58ecdf);})[_0x38c4('0x16')](function(_0x2f8093){logger[_0x38c4('0x13')](_0x38c4('0x17'),_0x2f8093[_0x38c4('0x14')],_0x3ebae7);_0x5d7d8d(_0x313793['error'](0x1f4,_0x2f8093[_0x38c4('0x14')]));});});};exports[_0x38c4('0x1d')]=function(_0x1235c9){var _0x40644a=this;return new Promise(function(_0x462722,_0x3dabaa){return db[_0x38c4('0x18')][_0x38c4('0x1e')](_0x1235c9[_0x38c4('0x19')],{'raw':_0x1235c9[_0x38c4('0x1a')]?_0x1235c9[_0x38c4('0x1a')][_0x38c4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1235c9['options']?_0x1235c9['options'][_0x38c4('0x1f')]||null:null,'attributes':_0x1235c9[_0x38c4('0x1a')]?_0x1235c9[_0x38c4('0x1a')][_0x38c4('0x20')]||null:null,'limit':_0x1235c9[_0x38c4('0x1a')]?_0x1235c9[_0x38c4('0x1a')][_0x38c4('0x21')]||null:null})[_0x38c4('0x1c')](function(_0x304350){logger[_0x38c4('0xe')](_0x38c4('0x1d'),_0x1235c9);logger[_0x38c4('0x22')]('UpdateVoiceAgentReport',_0x1235c9,JSON[_0x38c4('0x12')](_0x304350));_0x462722(_0x304350);})[_0x38c4('0x16')](function(_0x36cf33){logger[_0x38c4('0x13')](_0x38c4('0x1d'),_0x36cf33['message'],_0x1235c9);_0x3dabaa(_0x40644a[_0x38c4('0x13')](0x1f4,_0x36cf33[_0x38c4('0x14')]));});});}; \ No newline at end of file +var _0x7e5e=['VoiceAgentReport,\x20%s,\x20%s','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','catch','update','where','attributes','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7e5e,0x12c));var _0xe7e5=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0x7e5e[_0x8b631b];return _0x3e6832;};'use strict';var _=require(_0xe7e5('0x0'));var util=require(_0xe7e5('0x1'));var moment=require(_0xe7e5('0x2'));var BPromise=require(_0xe7e5('0x3'));var rs=require(_0xe7e5('0x4'));var fs=require('fs');var Redis=require(_0xe7e5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7e5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe7e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe7e5('0x8')][_0xe7e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b2807,_0x1baae7,_0x3996b1){return new BPromise(function(_0x255aa1,_0x4e556e){return client[_0xe7e5('0xa')](_0x1b2807,_0x3996b1)[_0xe7e5('0xb')](function(_0xef4ec6){logger[_0xe7e5('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x1baae7,_0xe7e5('0xd'));logger[_0xe7e5('0xe')](_0xe7e5('0xf'),_0x1baae7,'request\x20sent',JSON[_0xe7e5('0x10')](_0xef4ec6));if(_0xef4ec6[_0xe7e5('0x11')]){if(_0xef4ec6[_0xe7e5('0x11')][_0xe7e5('0x12')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x1baae7,_0xef4ec6[_0xe7e5('0x11')][_0xe7e5('0x13')]);return _0x4e556e(_0xef4ec6['error'][_0xe7e5('0x13')]);}logger[_0xe7e5('0x11')](_0xe7e5('0x14'),_0x1baae7,_0xef4ec6['error'][_0xe7e5('0x13')]);return _0x255aa1(_0xef4ec6[_0xe7e5('0x11')][_0xe7e5('0x13')]);}else{logger[_0xe7e5('0xc')](_0xe7e5('0x14'),_0x1baae7,_0xe7e5('0xd'));_0x255aa1(_0xef4ec6[_0xe7e5('0x15')]['message']);}})['catch'](function(_0x37369c){logger[_0xe7e5('0x11')](_0xe7e5('0x14'),_0x1baae7,_0x37369c);_0x4e556e(_0x37369c);});});}exports[_0xe7e5('0x16')]=function(_0x126cb9){var _0x1b2e61=this;return new Promise(function(_0x4d9f1e,_0x494264){return db[_0xe7e5('0x17')][_0xe7e5('0x18')](_0x126cb9[_0xe7e5('0x19')],{'raw':_0x126cb9[_0xe7e5('0x1a')]?_0x126cb9['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x52b042){logger[_0xe7e5('0xc')](_0xe7e5('0x16'),_0x126cb9);logger[_0xe7e5('0xe')](_0xe7e5('0x16'),_0x126cb9,JSON[_0xe7e5('0x10')](_0x52b042));_0x4d9f1e(_0x52b042);})[_0xe7e5('0x1b')](function(_0x1ce58a){logger[_0xe7e5('0x11')]('CreateVoiceAgentReport',_0x1ce58a[_0xe7e5('0x13')],_0x126cb9);_0x494264(_0x1b2e61[_0xe7e5('0x11')](0x1f4,_0x1ce58a[_0xe7e5('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x310e07){var _0x532897=this;return new Promise(function(_0x5cf45f,_0x557acf){return db['VoiceAgentReport'][_0xe7e5('0x1c')](_0x310e07[_0xe7e5('0x19')],{'raw':_0x310e07[_0xe7e5('0x1a')]?_0x310e07[_0xe7e5('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310e07['options']?_0x310e07[_0xe7e5('0x1a')][_0xe7e5('0x1d')]||null:null,'attributes':_0x310e07[_0xe7e5('0x1a')]?_0x310e07['options'][_0xe7e5('0x1e')]||null:null,'limit':_0x310e07[_0xe7e5('0x1a')]?_0x310e07['options']['limit']||null:null})[_0xe7e5('0xb')](function(_0x27218c){logger[_0xe7e5('0xc')](_0xe7e5('0x1f'),_0x310e07);logger[_0xe7e5('0xe')]('UpdateVoiceAgentReport',_0x310e07,JSON[_0xe7e5('0x10')](_0x27218c));_0x5cf45f(_0x27218c);})[_0xe7e5('0x1b')](function(_0x2e2398){logger[_0xe7e5('0x11')]('UpdateVoiceAgentReport',_0x2e2398[_0xe7e5('0x13')],_0x310e07);_0x557acf(_0x532897[_0xe7e5('0x11')](0x1f4,_0x2e2398[_0xe7e5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 4edcdb3..2943caf 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 _0x24ca=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0x24ca[_0x1fb4e1];return _0x22d1b0;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xb')]);router[_0xa24c('0x9')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller['describe']);router[_0xa24c('0x9')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller['show']);router[_0xa24c('0xe')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xd'),auth['isAuthenticated'](),controller[_0xa24c('0x13')]);module[_0xa24c('0x14')]=router; \ No newline at end of file +var _0x3e74=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x6a3c13,_0x4dadfa){var _0xa352d2=function(_0x2a7ee2){while(--_0x2a7ee2){_0x6a3c13['push'](_0x6a3c13['shift']());}};_0xa352d2(++_0x4dadfa);}(_0x3e74,0x175));var _0x43e7=function(_0x19ff29,_0x48efd5){_0x19ff29=_0x19ff29-0x0;var _0x59c991=_0x3e74[_0x19ff29];return _0x59c991;};'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['post']('/',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index bc37189..2e9b78f 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 _0x1541=['outbound-fax','dialer','STRING','DATE','INTEGER','exports','ENUM','internal','outbound','inbound-fax'];(function(_0x20290e,_0xc12a56){var _0x38ea59=function(_0x23671d){while(--_0x23671d){_0x20290e['push'](_0x20290e['shift']());}};_0x38ea59(++_0xc12a56);}(_0x1541,0xb9));var _0x1154=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x1541[_0x51fe5f];return _0x4abce9;};'use strict';var Sequelize=require('sequelize');module[_0x1154('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1154('0x1')]('inbound',_0x1154('0x2'),_0x1154('0x3'),_0x1154('0x4'),_0x1154('0x5'),_0x1154('0x6'))},'tag':{'type':Sequelize[_0x1154('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x1154('0x7')]},'callerid':{'type':Sequelize[_0x1154('0x7')]},'channel':{'type':Sequelize[_0x1154('0x7')]},'destinationchannel':{'type':Sequelize[_0x1154('0x7')]},'lastapplication':{'type':Sequelize[_0x1154('0x7')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x1154('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x1154('0x9')]},'billableseconds':{'type':Sequelize[_0x1154('0x9')]},'mohtime':{'type':Sequelize[_0x1154('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1154('0x7')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1154('0x7')]},'userDisposition':{'type':Sequelize[_0x1154('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x1154('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x1154('0x7')]},'note':{'type':Sequelize[_0x1154('0x7')]},'prefix':{'type':Sequelize[_0x1154('0x7')]},'routeid':{'type':Sequelize[_0x1154('0x9')]},'sipcallid':{'type':Sequelize[_0x1154('0x7')]}}; \ No newline at end of file +var _0xd4a2=['DATE','INTEGER','sequelize','ENUM','internal','inbound-fax','dialer','STRING','TEXT'];(function(_0x5387d2,_0x423d70){var _0x338b1e=function(_0x24c0e5){while(--_0x24c0e5){_0x5387d2['push'](_0x5387d2['shift']());}};_0x338b1e(++_0x423d70);}(_0xd4a2,0x173));var _0x2d4a=function(_0x55b82d,_0x47e6fe){_0x55b82d=_0x55b82d-0x0;var _0x104239=_0xd4a2[_0x55b82d];return _0x104239;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2d4a('0x1')]('inbound',_0x2d4a('0x2'),'outbound',_0x2d4a('0x3'),'outbound-fax',_0x2d4a('0x4'))},'tag':{'type':Sequelize[_0x2d4a('0x5')]},'accountcode':{'type':Sequelize[_0x2d4a('0x5')]},'source':{'type':Sequelize[_0x2d4a('0x5')]},'destination':{'type':Sequelize[_0x2d4a('0x5')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x2d4a('0x5')]},'channel':{'type':Sequelize[_0x2d4a('0x5')]},'destinationchannel':{'type':Sequelize[_0x2d4a('0x5')]},'lastapplication':{'type':Sequelize[_0x2d4a('0x5')]},'lastdata':{'type':Sequelize[_0x2d4a('0x6')]},'starttime':{'type':Sequelize[_0x2d4a('0x7')]},'systemanswertime':{'type':Sequelize[_0x2d4a('0x7')]},'answertime':{'type':Sequelize[_0x2d4a('0x7')]},'endtime':{'type':Sequelize[_0x2d4a('0x7')]},'duration':{'type':Sequelize[_0x2d4a('0x8')]},'billableseconds':{'type':Sequelize[_0x2d4a('0x8')]},'mohtime':{'type':Sequelize[_0x2d4a('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x2d4a('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x2d4a('0x5')]},'userThirdDisposition':{'type':Sequelize[_0x2d4a('0x5')]},'note':{'type':Sequelize[_0x2d4a('0x5')]},'prefix':{'type':Sequelize[_0x2d4a('0x5')]},'routeid':{'type':Sequelize[_0x2d4a('0x8')]},'sipcallid':{'type':Sequelize[_0x2d4a('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index fc4356a..4814046 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x2fbfe9,_0xc34d85){var _0x2835f2=function(_0x4e93f9){while(--_0x4e93f9){_0x2fbfe9['push'](_0x2fbfe9['shift']());}};_0x2835f2(++_0xc34d85);}(_0x0b0e,0x187));var _0xe0b0=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x0b0e[_0x36bff5];return _0x80ade5;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0xadb5,0xad));var _0x5adb=function(_0x5255cd,_0x24743f){_0x5255cd=_0x5255cd-0x0;var _0x27a6d2=_0xadb5[_0x5255cd];return _0x27a6d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 21d3903..c8305c5 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 _0xa1aa=['moment','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x5c2980,_0x8bd37a){var _0x1ee1c4=function(_0x243147){while(--_0x243147){_0x5c2980['push'](_0x5c2980['shift']());}};_0x1ee1c4(++_0x8bd37a);}(_0xa1aa,0x81));var _0xaa1a=function(_0x35250c,_0x56d6fc){_0x35250c=_0x35250c-0x0;var _0x42b939=_0xa1aa[_0x35250c];return _0x42b939;};'use strict';var _=require(_0xaa1a('0x0'));var util=require(_0xaa1a('0x1'));var logger=require(_0xaa1a('0x2'))('api');var moment=require(_0xaa1a('0x3'));var BPromise=require(_0xaa1a('0x4'));var rp=require(_0xaa1a('0x5'));var fs=require('fs');var path=require(_0xaa1a('0x6'));var rimraf=require(_0xaa1a('0x7'));var config=require('../../config/environment');var attributes=require(_0xaa1a('0x8'));module[_0xaa1a('0x9')]=function(_0x4d916c,_0x1cd007){return _0x4d916c[_0xaa1a('0xa')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xaa1a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2dd8=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2dd8,0x83));var _0x82dd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2dd8[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x82dd('0x0'));var util=require('util');var logger=require(_0x82dd('0x1'))(_0x82dd('0x2'));var moment=require(_0x82dd('0x3'));var BPromise=require(_0x82dd('0x4'));var rp=require(_0x82dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82dd('0x6'));var config=require('../../config/environment');var attributes=require(_0x82dd('0x7'));module['exports']=function(_0x4a9b77,_0x1fe9db){return _0x4a9b77[_0x82dd('0x8')](_0x82dd('0x9'),attributes,{'tableName':_0x82dd('0xa'),'paranoid':![],'indexes':[{'fields':[_0x82dd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 0fc0996..d379ef2 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 _0xba46=['raw','limit','UpdateVoiceCallReport','lodash','moment','bluebird','ioredis','rpc','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map','model','CreateVoiceCallReport','body'];(function(_0x395718,_0x20322d){var _0x3028b8=function(_0x416f5c){while(--_0x416f5c){_0x395718['push'](_0x395718['shift']());}};_0x3028b8(++_0x20322d);}(_0xba46,0xc3));var _0x6ba4=function(_0x4069ef,_0x641bf6){_0x4069ef=_0x4069ef-0x0;var _0x4d7607=_0xba46[_0x4069ef];return _0x4d7607;};'use strict';var _=require(_0x6ba4('0x0'));var util=require('util');var moment=require(_0x6ba4('0x1'));var BPromise=require(_0x6ba4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ba4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6ba4('0x4'));var config=require(_0x6ba4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6ba4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f75d9,_0x3812e9,_0x41a179){return new BPromise(function(_0x1b9b0f,_0x1a1cc0){return client[_0x6ba4('0x7')](_0x3f75d9,_0x41a179)[_0x6ba4('0x8')](function(_0x48322b){logger[_0x6ba4('0x9')](_0x6ba4('0xa'),_0x3812e9,'request\x20sent');logger[_0x6ba4('0xb')](_0x6ba4('0xc'),_0x3812e9,_0x6ba4('0xd'),JSON[_0x6ba4('0xe')](_0x48322b));if(_0x48322b[_0x6ba4('0xf')]){if(_0x48322b[_0x6ba4('0xf')]['code']===0x1f4){logger[_0x6ba4('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x3812e9,_0x48322b[_0x6ba4('0xf')][_0x6ba4('0x10')]);return _0x1a1cc0(_0x48322b['error'][_0x6ba4('0x10')]);}logger[_0x6ba4('0xf')](_0x6ba4('0xa'),_0x3812e9,_0x48322b[_0x6ba4('0xf')][_0x6ba4('0x10')]);return _0x1b9b0f(_0x48322b[_0x6ba4('0xf')][_0x6ba4('0x10')]);}else{logger[_0x6ba4('0x9')](_0x6ba4('0xa'),_0x3812e9,_0x6ba4('0xd'));_0x1b9b0f(_0x48322b['result'][_0x6ba4('0x10')]);}})[_0x6ba4('0x11')](function(_0x2d51a1){logger[_0x6ba4('0xf')](_0x6ba4('0xa'),_0x3812e9,_0x2d51a1);_0x1a1cc0(_0x2d51a1);});});}exports[_0x6ba4('0x12')]=function(_0x172215){var _0x532c6f=this;return new Promise(function(_0x1e6c4a,_0x319b16){return db[_0x6ba4('0x13')][_0x6ba4('0x14')]({'raw':_0x172215[_0x6ba4('0x15')]?_0x172215[_0x6ba4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x172215[_0x6ba4('0x15')]?_0x172215[_0x6ba4('0x15')][_0x6ba4('0x16')]||null:null,'attributes':_0x172215['options']?_0x172215[_0x6ba4('0x15')][_0x6ba4('0x17')]||null:null,'limit':_0x172215['options']?_0x172215['options']['limit']||null:null,'include':_0x172215[_0x6ba4('0x15')]?_0x172215['options'][_0x6ba4('0x18')]?_[_0x6ba4('0x19')](_0x172215['options'][_0x6ba4('0x18')],function(_0x1ec686){return{'model':db[_0x1ec686['model']],'as':_0x1ec686['as'],'attributes':_0x1ec686[_0x6ba4('0x17')],'include':_0x1ec686[_0x6ba4('0x18')]?_['map'](_0x1ec686['include'],function(_0x250819){return{'model':db[_0x250819[_0x6ba4('0x1a')]],'as':_0x250819['as'],'attributes':_0x250819['attributes'],'include':_0x250819[_0x6ba4('0x18')]?_[_0x6ba4('0x19')](_0x250819['include'],function(_0x19b12f){return{'model':db[_0x19b12f[_0x6ba4('0x1a')]],'as':_0x19b12f['as'],'attributes':_0x19b12f[_0x6ba4('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6ba4('0x8')](function(_0x4c8b09){logger[_0x6ba4('0x9')](_0x6ba4('0x12'),_0x172215);logger[_0x6ba4('0xb')]('GetVoiceCallReport',_0x172215,JSON[_0x6ba4('0xe')](_0x4c8b09));_0x1e6c4a(_0x4c8b09);})['catch'](function(_0x1f15a4){logger['error']('GetVoiceCallReport',_0x1f15a4[_0x6ba4('0x10')],_0x172215);_0x319b16(_0x532c6f[_0x6ba4('0xf')](0x1f4,_0x1f15a4[_0x6ba4('0x10')]));});});};exports[_0x6ba4('0x1b')]=function(_0x3590d9){var _0x4551dd=this;return new Promise(function(_0x1eaea7,_0x481fe3){return db[_0x6ba4('0x13')]['create'](_0x3590d9[_0x6ba4('0x1c')],{'raw':_0x3590d9[_0x6ba4('0x15')]?_0x3590d9[_0x6ba4('0x15')][_0x6ba4('0x1d')]===undefined?!![]:![]:!![]})[_0x6ba4('0x8')](function(_0x24a8e5){logger[_0x6ba4('0x9')](_0x6ba4('0x1b'),_0x3590d9);logger[_0x6ba4('0xb')]('CreateVoiceCallReport',_0x3590d9,JSON[_0x6ba4('0xe')](_0x24a8e5));_0x1eaea7(_0x24a8e5);})[_0x6ba4('0x11')](function(_0x2d4d9c){logger['error']('CreateVoiceCallReport',_0x2d4d9c[_0x6ba4('0x10')],_0x3590d9);_0x481fe3(_0x4551dd['error'](0x1f4,_0x2d4d9c['message']));});});};exports['UpdateVoiceCallReport']=function(_0x4f633c){var _0x2787d8=this;return new Promise(function(_0x4e7ec6,_0x33c0a4){return db[_0x6ba4('0x13')]['update'](_0x4f633c['body'],{'raw':_0x4f633c[_0x6ba4('0x15')]?_0x4f633c[_0x6ba4('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f633c[_0x6ba4('0x15')]?_0x4f633c[_0x6ba4('0x15')][_0x6ba4('0x16')]||null:null,'attributes':_0x4f633c['options']?_0x4f633c[_0x6ba4('0x15')][_0x6ba4('0x17')]||null:null,'limit':_0x4f633c[_0x6ba4('0x15')]?_0x4f633c[_0x6ba4('0x15')][_0x6ba4('0x1e')]||null:null})[_0x6ba4('0x8')](function(_0x1b633e){logger[_0x6ba4('0x9')](_0x6ba4('0x1f'),_0x4f633c);logger[_0x6ba4('0xb')](_0x6ba4('0x1f'),_0x4f633c,JSON[_0x6ba4('0xe')](_0x1b633e));_0x4e7ec6(_0x1b633e);})[_0x6ba4('0x11')](function(_0x9a84ff){logger['error'](_0x6ba4('0x1f'),_0x9a84ff[_0x6ba4('0x10')],_0x4f633c);_0x33c0a4(_0x2787d8[_0x6ba4('0xf')](0x1f4,_0x9a84ff['message']));});});}; \ No newline at end of file +var _0xd4ec=['http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','model','map','CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','body','where','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0x1ba82b,_0x220fa9){var _0x29232a=function(_0x18b9e0){while(--_0x18b9e0){_0x1ba82b['push'](_0x1ba82b['shift']());}};_0x29232a(++_0x220fa9);}(_0xd4ec,0x1d5));var _0xcd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcd4e('0x0'));var moment=require(_0xcd4e('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd4e('0x2'));var fs=require('fs');var Redis=require(_0xcd4e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd4e('0x4'))(_0xcd4e('0x5'));var config=require('../../config/environment');var jayson=require(_0xcd4e('0x6'));var client=jayson['client'][_0xcd4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54a07f,_0x4f0c1a,_0x17547d){return new BPromise(function(_0x3db21c,_0x51b703){return client['request'](_0x54a07f,_0x17547d)[_0xcd4e('0x8')](function(_0x1c68ad){logger['info'](_0xcd4e('0x9'),_0x4f0c1a,_0xcd4e('0xa'));logger[_0xcd4e('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4f0c1a,_0xcd4e('0xa'),JSON[_0xcd4e('0xc')](_0x1c68ad));if(_0x1c68ad[_0xcd4e('0xd')]){if(_0x1c68ad[_0xcd4e('0xd')][_0xcd4e('0xe')]===0x1f4){logger[_0xcd4e('0xd')](_0xcd4e('0x9'),_0x4f0c1a,_0x1c68ad[_0xcd4e('0xd')][_0xcd4e('0xf')]);return _0x51b703(_0x1c68ad[_0xcd4e('0xd')][_0xcd4e('0xf')]);}logger[_0xcd4e('0xd')](_0xcd4e('0x9'),_0x4f0c1a,_0x1c68ad[_0xcd4e('0xd')][_0xcd4e('0xf')]);return _0x3db21c(_0x1c68ad[_0xcd4e('0xd')][_0xcd4e('0xf')]);}else{logger[_0xcd4e('0x10')](_0xcd4e('0x9'),_0x4f0c1a,_0xcd4e('0xa'));_0x3db21c(_0x1c68ad[_0xcd4e('0x11')]['message']);}})[_0xcd4e('0x12')](function(_0x4a8ce1){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x4f0c1a,_0x4a8ce1);_0x51b703(_0x4a8ce1);});});}exports[_0xcd4e('0x13')]=function(_0x2d27e7){var _0x3373f7=this;return new Promise(function(_0xd6dd97,_0x25e560){return db[_0xcd4e('0x14')][_0xcd4e('0x15')]({'raw':_0x2d27e7[_0xcd4e('0x16')]?_0x2d27e7[_0xcd4e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2d27e7[_0xcd4e('0x16')]?_0x2d27e7[_0xcd4e('0x16')]['where']||null:null,'attributes':_0x2d27e7[_0xcd4e('0x16')]?_0x2d27e7[_0xcd4e('0x16')][_0xcd4e('0x17')]||null:null,'limit':_0x2d27e7[_0xcd4e('0x16')]?_0x2d27e7['options'][_0xcd4e('0x18')]||null:null,'include':_0x2d27e7['options']?_0x2d27e7['options'][_0xcd4e('0x19')]?_['map'](_0x2d27e7['options']['include'],function(_0xf5fe09){return{'model':db[_0xf5fe09[_0xcd4e('0x1a')]],'as':_0xf5fe09['as'],'attributes':_0xf5fe09[_0xcd4e('0x17')],'include':_0xf5fe09[_0xcd4e('0x19')]?_[_0xcd4e('0x1b')](_0xf5fe09['include'],function(_0x2389bf){return{'model':db[_0x2389bf[_0xcd4e('0x1a')]],'as':_0x2389bf['as'],'attributes':_0x2389bf[_0xcd4e('0x17')],'include':_0x2389bf[_0xcd4e('0x19')]?_[_0xcd4e('0x1b')](_0x2389bf[_0xcd4e('0x19')],function(_0x456b9e){return{'model':db[_0x456b9e[_0xcd4e('0x1a')]],'as':_0x456b9e['as'],'attributes':_0x456b9e[_0xcd4e('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcd4e('0x8')](function(_0x27304e){logger[_0xcd4e('0x10')](_0xcd4e('0x13'),_0x2d27e7);logger[_0xcd4e('0xb')](_0xcd4e('0x13'),_0x2d27e7,JSON[_0xcd4e('0xc')](_0x27304e));_0xd6dd97(_0x27304e);})['catch'](function(_0x1f20c9){logger[_0xcd4e('0xd')](_0xcd4e('0x13'),_0x1f20c9[_0xcd4e('0xf')],_0x2d27e7);_0x25e560(_0x3373f7['error'](0x1f4,_0x1f20c9[_0xcd4e('0xf')]));});});};exports[_0xcd4e('0x1c')]=function(_0x2858a2){var _0x3983cb=this;return new Promise(function(_0x54ec2b,_0x5331d8){return db['VoiceCallReport'][_0xcd4e('0x1d')](_0x2858a2['body'],{'raw':_0x2858a2[_0xcd4e('0x16')]?_0x2858a2[_0xcd4e('0x16')][_0xcd4e('0x1e')]===undefined?!![]:![]:!![]})[_0xcd4e('0x8')](function(_0x47193f){logger[_0xcd4e('0x10')](_0xcd4e('0x1c'),_0x2858a2);logger[_0xcd4e('0xb')]('CreateVoiceCallReport',_0x2858a2,JSON[_0xcd4e('0xc')](_0x47193f));_0x54ec2b(_0x47193f);})[_0xcd4e('0x12')](function(_0x5a70e3){logger[_0xcd4e('0xd')](_0xcd4e('0x1c'),_0x5a70e3[_0xcd4e('0xf')],_0x2858a2);_0x5331d8(_0x3983cb['error'](0x1f4,_0x5a70e3[_0xcd4e('0xf')]));});});};exports[_0xcd4e('0x1f')]=function(_0x17e5ca){var _0x3164d2=this;return new Promise(function(_0x2526ae,_0x11f783){return db[_0xcd4e('0x14')]['update'](_0x17e5ca[_0xcd4e('0x20')],{'raw':_0x17e5ca[_0xcd4e('0x16')]?_0x17e5ca['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e5ca[_0xcd4e('0x16')]?_0x17e5ca[_0xcd4e('0x16')][_0xcd4e('0x21')]||null:null,'attributes':_0x17e5ca[_0xcd4e('0x16')]?_0x17e5ca['options'][_0xcd4e('0x17')]||null:null,'limit':_0x17e5ca['options']?_0x17e5ca[_0xcd4e('0x16')][_0xcd4e('0x18')]||null:null})[_0xcd4e('0x8')](function(_0x385e5f){logger[_0xcd4e('0x10')]('UpdateVoiceCallReport',_0x17e5ca);logger['debug'](_0xcd4e('0x1f'),_0x17e5ca,JSON['stringify'](_0x385e5f));_0x2526ae(_0x385e5f);})[_0xcd4e('0x12')](function(_0x3e6538){logger[_0xcd4e('0xd')](_0xcd4e('0x1f'),_0x3e6538[_0xcd4e('0xf')],_0x17e5ca);_0x11f783(_0x3164d2['error'](0x1f4,_0x3e6538['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 5ee39ae..419a5e0 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 _0xf281=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','show','post','create','/:id','update','multer','util'];(function(_0x36bce6,_0x1bf9e8){var _0x730855=function(_0x4c437e){while(--_0x4c437e){_0x36bce6['push'](_0x36bce6['shift']());}};_0x730855(++_0x1bf9e8);}(_0xf281,0xa6));var _0x1f28=function(_0x5e81e0,_0x13152f){_0x5e81e0=_0x5e81e0-0x0;var _0x5c8de0=_0xf281[_0x5e81e0];return _0x5c8de0;};'use strict';var multer=require(_0x1f28('0x0'));var util=require(_0x1f28('0x1'));var path=require('path');var timeout=require(_0x1f28('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1f28('0x3'));var interaction=require(_0x1f28('0x4'));var config=require(_0x1f28('0x5'));var controller=require(_0x1f28('0x6'));router[_0x1f28('0x7')]('/',auth[_0x1f28('0x8')](),controller['index']);router[_0x1f28('0x7')]('/:id',auth[_0x1f28('0x8')](),controller[_0x1f28('0x9')]);router[_0x1f28('0xa')]('/',auth[_0x1f28('0x8')](),controller[_0x1f28('0xb')]);router['put'](_0x1f28('0xc'),auth[_0x1f28('0x8')](),controller[_0x1f28('0xd')]);router['delete'](_0x1f28('0xc'),auth[_0x1f28('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8ec3=['get','isAuthenticated','index','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x8ec3,0xed));var _0x38ec=function(_0x203ea1,_0xe48b1a){_0x203ea1=_0x203ea1-0x0;var _0x2aec25=_0x8ec3[_0x203ea1];return _0x2aec25;};'use strict';var multer=require(_0x38ec('0x0'));var util=require(_0x38ec('0x1'));var path=require(_0x38ec('0x2'));var timeout=require(_0x38ec('0x3'));var express=require(_0x38ec('0x4'));var router=express[_0x38ec('0x5')]();var fs_extra=require(_0x38ec('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x38ec('0x7'));var config=require(_0x38ec('0x8'));var controller=require(_0x38ec('0x9'));router[_0x38ec('0xa')]('/',auth[_0x38ec('0xb')](),controller[_0x38ec('0xc')]);router['get']('/:id',auth[_0x38ec('0xb')](),controller['show']);router[_0x38ec('0xd')]('/',auth[_0x38ec('0xb')](),controller[_0x38ec('0xe')]);router[_0x38ec('0xf')](_0x38ec('0x10'),auth[_0x38ec('0xb')](),controller[_0x38ec('0x11')]);router['delete'](_0x38ec('0x10'),auth[_0x38ec('0xb')](),controller['destroy']);module[_0x38ec('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index b8f4e28..13ce8ac 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 _0xff61=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x512238,_0x3c2cee){var _0x1e5af8=function(_0x2c22cf){while(--_0x2c22cf){_0x512238['push'](_0x512238['shift']());}};_0x1e5af8(++_0x3c2cee);}(_0xff61,0xb5));var _0x1ff6=function(_0x312743,_0x5cc455){_0x312743=_0x312743-0x0;var _0x41d1b4=_0xff61[_0x312743];return _0x41d1b4;};'use strict';var Sequelize=require(_0x1ff6('0x0'));module[_0x1ff6('0x1')]={'name':{'type':Sequelize[_0x1ff6('0x2')]},'prefix':{'type':Sequelize[_0x1ff6('0x2')],'unique':_0x1ff6('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x1ff6('0x2')],'set':function(_0x2843c2){this[_0x1ff6('0x4')](_0x1ff6('0x5'),_0x2843c2?_0x2843c2[_0x1ff6('0x6')](''):[]);},'get':function(){return this[_0x1ff6('0x7')]('options')?this[_0x1ff6('0x7')](_0x1ff6('0x5'))[_0x1ff6('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x1ff6('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8182=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x8182,0xd4));var _0x2818=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x8182[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x2818('0x0'));module[_0x2818('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x2818('0x2')],'unique':_0x2818('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x541095){this[_0x2818('0x4')](_0x2818('0x5'),_0x541095?_0x541095[_0x2818('0x6')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x2818('0x7')](_0x2818('0x5'))[_0x2818('0x8')](''):[];}},'auth':{'type':Sequelize[_0x2818('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x2818('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2818('0x2')]},'description':{'type':Sequelize[_0x2818('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 42f1740..57b35b5 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 _0x57f8=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','error','name','send','index','map','VoiceChanSpy','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5938a9,_0x16ac25){var _0x37e630=function(_0x59acd4){while(--_0x59acd4){_0x5938a9['push'](_0x5938a9['shift']());}};_0x37e630(++_0x16ac25);}(_0x57f8,0x198));var _0x857f=function(_0x50c96f,_0x2ee009){_0x50c96f=_0x50c96f-0x0;var _0x38fcf2=_0x57f8[_0x50c96f];return _0x38fcf2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];function respondWithStatusCode(_0x533631,_0x2e1eda){_0x2e1eda=_0x2e1eda||0xcc;return function(_0x2d5e26){if(_0x2d5e26){return _0x533631[_0x857f('0x1b')](_0x2e1eda);}return _0x533631[_0x857f('0x1c')](_0x2e1eda)[_0x857f('0x1d')]();};}function respondWithResult(_0x4a25ec,_0x4bc590){_0x4bc590=_0x4bc590||0xc8;return function(_0x3b09d9){if(_0x3b09d9){return _0x4a25ec['status'](_0x4bc590)[_0x857f('0x1e')](_0x3b09d9);}};}function respondWithFilteredResult(_0x4ac81f,_0x1d47bf){return function(_0x134a4f){if(_0x134a4f){var _0x5c3a69=typeof _0x1d47bf[_0x857f('0x1f')]===_0x857f('0x20')&&typeof _0x1d47bf[_0x857f('0x21')]===_0x857f('0x20');var _0x279e74=_0x134a4f[_0x857f('0x22')];var _0x1a9ef8=_0x5c3a69?0x0:_0x1d47bf[_0x857f('0x1f')];var _0x1014ca=_0x5c3a69?_0x134a4f[_0x857f('0x22')]:_0x1d47bf[_0x857f('0x1f')]+_0x1d47bf['limit'];var _0x1729d8;if(_0x1014ca>=_0x279e74){_0x1014ca=_0x279e74;_0x1729d8=0xc8;}else{_0x1729d8=0xce;}_0x4ac81f[_0x857f('0x1c')](_0x1729d8);return _0x4ac81f['set'](_0x857f('0x23'),_0x1a9ef8+'-'+_0x1014ca+'/'+_0x279e74)[_0x857f('0x1e')](_0x134a4f);}return null;};}function patchUpdates(_0x377587){return function(_0x484035){try{jsonpatch['apply'](_0x484035,_0x377587,!![]);}catch(_0x12ee77){return BPromise[_0x857f('0x24')](_0x12ee77);}return _0x484035[_0x857f('0x25')]();};}function saveUpdates(_0x4fa031,_0x118237){return function(_0x17a98e){if(_0x17a98e){return _0x17a98e[_0x857f('0x26')](_0x4fa031)['then'](function(_0x1961ea){return _0x1961ea;});}return null;};}function removeEntity(_0x14a8ce,_0x50bfb7){return function(_0x3bc543){if(_0x3bc543){return _0x3bc543[_0x857f('0x27')]()[_0x857f('0x28')](function(){var _0x44ff23=_0x3bc543[_0x857f('0x29')]({'plain':!![]});var _0x3b23a7=_0x857f('0x2a');return db[_0x857f('0x2b')][_0x857f('0x27')]({'where':{'type':_0x3b23a7,'resourceId':_0x44ff23['id']}})[_0x857f('0x28')](function(){return _0x3bc543;});})[_0x857f('0x28')](function(){_0x14a8ce[_0x857f('0x1c')](0xcc)[_0x857f('0x1d')]();});}};}function handleEntityNotFound(_0x46761e,_0x570905){return function(_0x17e415){if(!_0x17e415){_0x46761e[_0x857f('0x1b')](0x194);}return _0x17e415;};}function handleError(_0x23afb8,_0x2c5792){_0x2c5792=_0x2c5792||0x1f4;return function(_0x58c2de){logger[_0x857f('0x2c')](_0x58c2de['stack']);if(_0x58c2de[_0x857f('0x2d')]){delete _0x58c2de[_0x857f('0x2d')];}_0x23afb8[_0x857f('0x1c')](_0x2c5792)[_0x857f('0x2e')](_0x58c2de);};}exports[_0x857f('0x2f')]=function(_0x464e8f,_0x1c4fff){var _0xe79241={},_0x17e7b6={},_0x41f832={'count':0x0,'rows':[]};var _0x24adc2=_[_0x857f('0x30')](db[_0x857f('0x31')]['rawAttributes'],function(_0x3078cf){return{'name':_0x3078cf[_0x857f('0x32')],'type':_0x3078cf['type'][_0x857f('0x33')]};});_0x17e7b6[_0x857f('0x34')]=_['map'](_0x24adc2,_0x857f('0x2d'));_0x17e7b6[_0x857f('0x35')]=_['keys'](_0x464e8f[_0x857f('0x35')]);_0x17e7b6[_0x857f('0x36')]=_[_0x857f('0x37')](_0x17e7b6[_0x857f('0x34')],_0x17e7b6['query']);_0xe79241['attributes']=_[_0x857f('0x37')](_0x17e7b6[_0x857f('0x34')],qs['fields'](_0x464e8f[_0x857f('0x35')]['fields']));_0xe79241[_0x857f('0x38')]=_0xe79241[_0x857f('0x38')][_0x857f('0x39')]?_0xe79241[_0x857f('0x38')]:_0x17e7b6[_0x857f('0x34')];if(!_0x464e8f['query']['hasOwnProperty'](_0x857f('0x3a'))){_0xe79241['limit']=qs[_0x857f('0x21')](_0x464e8f[_0x857f('0x35')][_0x857f('0x21')]);_0xe79241['offset']=qs[_0x857f('0x1f')](_0x464e8f[_0x857f('0x35')][_0x857f('0x1f')]);}_0xe79241[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x464e8f[_0x857f('0x35')][_0x857f('0x3c')]);_0xe79241['where']=qs[_0x857f('0x36')](_[_0x857f('0x3d')](_0x464e8f[_0x857f('0x35')],_0x17e7b6[_0x857f('0x36')]),_0x24adc2);if(_0x464e8f[_0x857f('0x35')][_0x857f('0x3e')]){_0xe79241[_0x857f('0x3f')]=_['merge'](_0xe79241[_0x857f('0x3f')],{'$or':_[_0x857f('0x30')](_0x24adc2,function(_0xcd5959){if(_0xcd5959[_0x857f('0x40')]!==_0x857f('0x41')){var _0x1c119f={};_0x1c119f[_0xcd5959['name']]={'$like':'%'+_0x464e8f[_0x857f('0x35')][_0x857f('0x3e')]+'%'};return _0x1c119f;}})});}_0xe79241=_[_0x857f('0x42')]({},_0xe79241,_0x464e8f[_0x857f('0x43')]);var _0x3938ee={'where':_0xe79241[_0x857f('0x3f')]};return db[_0x857f('0x31')][_0x857f('0x22')](_0x3938ee)['then'](function(_0x40fb37){_0x41f832[_0x857f('0x22')]=_0x40fb37;if(_0x464e8f[_0x857f('0x35')][_0x857f('0x44')]){_0xe79241[_0x857f('0x45')]=[{'all':!![]}];}return db[_0x857f('0x31')][_0x857f('0x46')](_0xe79241);})[_0x857f('0x28')](function(_0xb4d7c2){_0x41f832[_0x857f('0x47')]=_0xb4d7c2;return _0x41f832;})[_0x857f('0x28')](respondWithFilteredResult(_0x1c4fff,_0xe79241))[_0x857f('0x48')](handleError(_0x1c4fff,null));};exports[_0x857f('0x49')]=function(_0x376f71,_0x5d4c2a){var _0xe0e078={'raw':![],'where':{'id':_0x376f71[_0x857f('0x4a')]['id']}},_0x5b2baa={};_0x5b2baa[_0x857f('0x34')]=_[_0x857f('0x4b')](db[_0x857f('0x31')][_0x857f('0x4c')]);_0x5b2baa[_0x857f('0x35')]=_[_0x857f('0x4b')](_0x376f71[_0x857f('0x35')]);_0x5b2baa[_0x857f('0x36')]=_[_0x857f('0x37')](_0x5b2baa[_0x857f('0x34')],_0x5b2baa['query']);_0xe0e078['attributes']=_[_0x857f('0x37')](_0x5b2baa['model'],qs[_0x857f('0x4d')](_0x376f71['query'][_0x857f('0x4d')]));_0xe0e078[_0x857f('0x38')]=_0xe0e078[_0x857f('0x38')][_0x857f('0x39')]?_0xe0e078[_0x857f('0x38')]:_0x5b2baa[_0x857f('0x34')];if(_0x376f71[_0x857f('0x35')][_0x857f('0x44')]){_0xe0e078['include']=[{'all':!![]}];}_0xe0e078=_[_0x857f('0x42')]({},_0xe0e078,_0x376f71[_0x857f('0x43')]);return db[_0x857f('0x31')][_0x857f('0x4e')](_0xe0e078)['then'](handleEntityNotFound(_0x5d4c2a,null))[_0x857f('0x28')](respondWithResult(_0x5d4c2a,null))[_0x857f('0x48')](handleError(_0x5d4c2a,null));};exports[_0x857f('0x4f')]=function(_0x736ef6,_0x67563){return db['VoiceChanSpy'][_0x857f('0x4f')](_0x736ef6[_0x857f('0x50')],{})['then'](function(_0xfd1679){var _0x847879=_0x736ef6['user'][_0x857f('0x29')]({'plain':!![]});if(!_0x847879)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x847879[_0x857f('0x51')]===_0x857f('0x52')){var _0x446fe9=_0xfd1679[_0x857f('0x29')]({'plain':!![]});var _0x58bf27=_0x857f('0x2a');return db[_0x857f('0x53')][_0x857f('0x4e')]({'where':{'name':_0x58bf27,'userProfileId':_0x847879[_0x857f('0x54')]},'raw':!![]})[_0x857f('0x28')](function(_0x4f9d24){if(_0x4f9d24&&_0x4f9d24[_0x857f('0x55')]===0x0){return db[_0x857f('0x2b')][_0x857f('0x4f')]({'name':_0x446fe9[_0x857f('0x2d')],'resourceId':_0x446fe9['id'],'type':_0x4f9d24[_0x857f('0x2d')],'sectionId':_0x4f9d24['id']},{})[_0x857f('0x28')](function(){return _0xfd1679;});}else{return _0xfd1679;}})[_0x857f('0x48')](function(_0x59164a){logger[_0x857f('0x2c')](_0x857f('0x56'),_0x59164a);throw _0x59164a;});}return _0xfd1679;})[_0x857f('0x28')](respondWithResult(_0x67563,0xc9))[_0x857f('0x48')](handleError(_0x67563,null));};exports[_0x857f('0x26')]=function(_0x153e4e,_0x4bb5fc){if(_0x153e4e[_0x857f('0x50')]['id']){delete _0x153e4e[_0x857f('0x50')]['id'];}return db[_0x857f('0x31')][_0x857f('0x4e')]({'where':{'id':_0x153e4e[_0x857f('0x4a')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x4bb5fc,null))[_0x857f('0x28')](saveUpdates(_0x153e4e[_0x857f('0x50')],null))['then'](respondWithResult(_0x4bb5fc,null))['catch'](handleError(_0x4bb5fc,null));};exports[_0x857f('0x27')]=function(_0x477653,_0x14b2ff){return db[_0x857f('0x31')][_0x857f('0x4e')]({'where':{'id':_0x477653[_0x857f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14b2ff,null))[_0x857f('0x28')](removeEntity(_0x14b2ff,null))[_0x857f('0x48')](handleError(_0x14b2ff,null));}; \ No newline at end of file +var _0x3750=['rawAttributes','filters','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','error','stack','name','send','map','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','VoiceChanSpy','include','findAll','catch','show'];(function(_0x250ac7,_0x414536){var _0x213306=function(_0x194715){while(--_0x194715){_0x250ac7['push'](_0x250ac7['shift']());}};_0x213306(++_0x414536);}(_0x3750,0xbb));var _0x0375=function(_0x3f8743,_0x33973f){_0x3f8743=_0x3f8743-0x0;var _0x1f844c=_0x3750[_0x3f8743];return _0x1f844c;};'use strict';var emlformat=require(_0x0375('0x0'));var rimraf=require(_0x0375('0x1'));var zipdir=require(_0x0375('0x2'));var jsonpatch=require(_0x0375('0x3'));var rp=require(_0x0375('0x4'));var moment=require('moment');var BPromise=require(_0x0375('0x5'));var Mustache=require(_0x0375('0x6'));var util=require('util');var path=require(_0x0375('0x7'));var sox=require(_0x0375('0x8'));var csv=require(_0x0375('0x9'));var ejs=require(_0x0375('0xa'));var fs=require('fs');var fs_extra=require(_0x0375('0xb'));var _=require(_0x0375('0xc'));var squel=require('squel');var crypto=require(_0x0375('0xd'));var jsforce=require(_0x0375('0xe'));var deskjs=require(_0x0375('0xf'));var toCsv=require(_0x0375('0x9'));var querystring=require(_0x0375('0x10'));var Papa=require(_0x0375('0x11'));var Redis=require('ioredis');var authService=require(_0x0375('0x12'));var qs=require(_0x0375('0x13'));var as=require(_0x0375('0x14'));var hardwareService=require(_0x0375('0x15'));var logger=require(_0x0375('0x16'))(_0x0375('0x17'));var utils=require(_0x0375('0x18'));var config=require(_0x0375('0x19'));var licenseUtil=require(_0x0375('0x1a'));var db=require(_0x0375('0x1b'))['db'];function respondWithStatusCode(_0x45418c,_0x8484d0){_0x8484d0=_0x8484d0||0xcc;return function(_0x48f8c3){if(_0x48f8c3){return _0x45418c[_0x0375('0x1c')](_0x8484d0);}return _0x45418c['status'](_0x8484d0)[_0x0375('0x1d')]();};}function respondWithResult(_0x577a4d,_0x3ae443){_0x3ae443=_0x3ae443||0xc8;return function(_0x54e289){if(_0x54e289){return _0x577a4d[_0x0375('0x1e')](_0x3ae443)[_0x0375('0x1f')](_0x54e289);}};}function respondWithFilteredResult(_0xe0be44,_0x42df58){return function(_0x1b928c){if(_0x1b928c){var _0x12d950=typeof _0x42df58[_0x0375('0x20')]===_0x0375('0x21')&&typeof _0x42df58[_0x0375('0x22')]==='undefined';var _0x4b5869=_0x1b928c['count'];var _0x35d83c=_0x12d950?0x0:_0x42df58['offset'];var _0x561bf2=_0x12d950?_0x1b928c[_0x0375('0x23')]:_0x42df58[_0x0375('0x20')]+_0x42df58[_0x0375('0x22')];var _0x4ffc43;if(_0x561bf2>=_0x4b5869){_0x561bf2=_0x4b5869;_0x4ffc43=0xc8;}else{_0x4ffc43=0xce;}_0xe0be44[_0x0375('0x1e')](_0x4ffc43);return _0xe0be44[_0x0375('0x24')]('Content-Range',_0x35d83c+'-'+_0x561bf2+'/'+_0x4b5869)['json'](_0x1b928c);}return null;};}function patchUpdates(_0x5ee87e){return function(_0x300629){try{jsonpatch['apply'](_0x300629,_0x5ee87e,!![]);}catch(_0x10d4eb){return BPromise[_0x0375('0x25')](_0x10d4eb);}return _0x300629[_0x0375('0x26')]();};}function saveUpdates(_0x34891c,_0x1a714a){return function(_0x5251af){if(_0x5251af){return _0x5251af[_0x0375('0x27')](_0x34891c)[_0x0375('0x28')](function(_0x3810c0){return _0x3810c0;});}return null;};}function removeEntity(_0x5b9927,_0x1a0bfd){return function(_0x3c884d){if(_0x3c884d){return _0x3c884d[_0x0375('0x29')]()[_0x0375('0x28')](function(){var _0x4d5236=_0x3c884d[_0x0375('0x2a')]({'plain':!![]});var _0x256426='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x256426,'resourceId':_0x4d5236['id']}})['then'](function(){return _0x3c884d;});})[_0x0375('0x28')](function(){_0x5b9927[_0x0375('0x1e')](0xcc)[_0x0375('0x1d')]();});}};}function handleEntityNotFound(_0x527204,_0x240a45){return function(_0x56b316){if(!_0x56b316){_0x527204[_0x0375('0x1c')](0x194);}return _0x56b316;};}function handleError(_0x2f07ec,_0x818ebe){_0x818ebe=_0x818ebe||0x1f4;return function(_0x43273c){logger[_0x0375('0x2b')](_0x43273c[_0x0375('0x2c')]);if(_0x43273c[_0x0375('0x2d')]){delete _0x43273c['name'];}_0x2f07ec[_0x0375('0x1e')](_0x818ebe)[_0x0375('0x2e')](_0x43273c);};}exports['index']=function(_0x17a4eb,_0x550de3){var _0x2ddeb6={},_0x129416={},_0x50122d={'count':0x0,'rows':[]};var _0x414d58=_[_0x0375('0x2f')](db['VoiceChanSpy']['rawAttributes'],function(_0x411f8c){return{'name':_0x411f8c[_0x0375('0x30')],'type':_0x411f8c[_0x0375('0x31')]['key']};});_0x129416['model']=_[_0x0375('0x2f')](_0x414d58,_0x0375('0x2d'));_0x129416[_0x0375('0x32')]=_[_0x0375('0x33')](_0x17a4eb[_0x0375('0x32')]);_0x129416['filters']=_['intersection'](_0x129416['model'],_0x129416['query']);_0x2ddeb6['attributes']=_[_0x0375('0x34')](_0x129416[_0x0375('0x35')],qs[_0x0375('0x36')](_0x17a4eb[_0x0375('0x32')][_0x0375('0x36')]));_0x2ddeb6['attributes']=_0x2ddeb6[_0x0375('0x37')][_0x0375('0x38')]?_0x2ddeb6['attributes']:_0x129416[_0x0375('0x35')];if(!_0x17a4eb[_0x0375('0x32')][_0x0375('0x39')](_0x0375('0x3a'))){_0x2ddeb6[_0x0375('0x22')]=qs[_0x0375('0x22')](_0x17a4eb[_0x0375('0x32')][_0x0375('0x22')]);_0x2ddeb6['offset']=qs[_0x0375('0x20')](_0x17a4eb[_0x0375('0x32')][_0x0375('0x20')]);}_0x2ddeb6[_0x0375('0x3b')]=qs[_0x0375('0x3c')](_0x17a4eb[_0x0375('0x32')]['sort']);_0x2ddeb6[_0x0375('0x3d')]=qs['filters'](_['pick'](_0x17a4eb[_0x0375('0x32')],_0x129416['filters']),_0x414d58);if(_0x17a4eb[_0x0375('0x32')]['filter']){_0x2ddeb6[_0x0375('0x3d')]=_[_0x0375('0x3e')](_0x2ddeb6['where'],{'$or':_['map'](_0x414d58,function(_0x196ca3){if(_0x196ca3[_0x0375('0x31')]!==_0x0375('0x3f')){var _0x963231={};_0x963231[_0x196ca3[_0x0375('0x2d')]]={'$like':'%'+_0x17a4eb['query'][_0x0375('0x40')]+'%'};return _0x963231;}})});}_0x2ddeb6=_[_0x0375('0x3e')]({},_0x2ddeb6,_0x17a4eb[_0x0375('0x41')]);var _0x287a2e={'where':_0x2ddeb6[_0x0375('0x3d')]};return db[_0x0375('0x42')][_0x0375('0x23')](_0x287a2e)['then'](function(_0x230ec3){_0x50122d[_0x0375('0x23')]=_0x230ec3;if(_0x17a4eb[_0x0375('0x32')]['includeAll']){_0x2ddeb6[_0x0375('0x43')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x0375('0x44')](_0x2ddeb6);})[_0x0375('0x28')](function(_0x1e1ea2){_0x50122d['rows']=_0x1e1ea2;return _0x50122d;})[_0x0375('0x28')](respondWithFilteredResult(_0x550de3,_0x2ddeb6))[_0x0375('0x45')](handleError(_0x550de3,null));};exports[_0x0375('0x46')]=function(_0x583baa,_0x34cccc){var _0xa471a5={'raw':![],'where':{'id':_0x583baa['params']['id']}},_0x4109fb={};_0x4109fb[_0x0375('0x35')]=_['keys'](db[_0x0375('0x42')][_0x0375('0x47')]);_0x4109fb['query']=_['keys'](_0x583baa['query']);_0x4109fb[_0x0375('0x48')]=_[_0x0375('0x34')](_0x4109fb[_0x0375('0x35')],_0x4109fb['query']);_0xa471a5[_0x0375('0x37')]=_['intersection'](_0x4109fb['model'],qs[_0x0375('0x36')](_0x583baa['query'][_0x0375('0x36')]));_0xa471a5[_0x0375('0x37')]=_0xa471a5[_0x0375('0x37')][_0x0375('0x38')]?_0xa471a5[_0x0375('0x37')]:_0x4109fb['model'];if(_0x583baa[_0x0375('0x32')][_0x0375('0x49')]){_0xa471a5[_0x0375('0x43')]=[{'all':!![]}];}_0xa471a5=_['merge']({},_0xa471a5,_0x583baa[_0x0375('0x41')]);return db[_0x0375('0x42')][_0x0375('0x4a')](_0xa471a5)['then'](handleEntityNotFound(_0x34cccc,null))['then'](respondWithResult(_0x34cccc,null))[_0x0375('0x45')](handleError(_0x34cccc,null));};exports[_0x0375('0x4b')]=function(_0x40b6a9,_0x3360a4){return db[_0x0375('0x42')][_0x0375('0x4b')](_0x40b6a9[_0x0375('0x4c')],{})[_0x0375('0x28')](function(_0x18e3b5){var _0x55442b=_0x40b6a9[_0x0375('0x4d')][_0x0375('0x2a')]({'plain':!![]});if(!_0x55442b)throw new Error(_0x0375('0x4e'));if(_0x55442b[_0x0375('0x4f')]===_0x0375('0x4d')){var _0x36c00d=_0x18e3b5[_0x0375('0x2a')]({'plain':!![]});var _0x57cdbf=_0x0375('0x50');return db['UserProfileSection'][_0x0375('0x4a')]({'where':{'name':_0x57cdbf,'userProfileId':_0x55442b[_0x0375('0x51')]},'raw':!![]})[_0x0375('0x28')](function(_0x1aad20){if(_0x1aad20&&_0x1aad20[_0x0375('0x52')]===0x0){return db[_0x0375('0x53')]['create']({'name':_0x36c00d['name'],'resourceId':_0x36c00d['id'],'type':_0x1aad20[_0x0375('0x2d')],'sectionId':_0x1aad20['id']},{})[_0x0375('0x28')](function(){return _0x18e3b5;});}else{return _0x18e3b5;}})[_0x0375('0x45')](function(_0x2ce641){logger[_0x0375('0x2b')](_0x0375('0x54'),_0x2ce641);throw _0x2ce641;});}return _0x18e3b5;})[_0x0375('0x28')](respondWithResult(_0x3360a4,0xc9))['catch'](handleError(_0x3360a4,null));};exports[_0x0375('0x27')]=function(_0x1e2bc9,_0x43e9ca){if(_0x1e2bc9[_0x0375('0x4c')]['id']){delete _0x1e2bc9[_0x0375('0x4c')]['id'];}return db[_0x0375('0x42')][_0x0375('0x4a')]({'where':{'id':_0x1e2bc9[_0x0375('0x55')]['id']}})[_0x0375('0x28')](handleEntityNotFound(_0x43e9ca,null))[_0x0375('0x28')](saveUpdates(_0x1e2bc9['body'],null))['then'](respondWithResult(_0x43e9ca,null))['catch'](handleError(_0x43e9ca,null));};exports[_0x0375('0x29')]=function(_0xfbbd28,_0x1aee6c){return db['VoiceChanSpy']['find']({'where':{'id':_0xfbbd28[_0x0375('0x55')]['id']}})[_0x0375('0x28')](handleEntityNotFound(_0x1aee6c,null))[_0x0375('0x28')](removeEntity(_0x1aee6c,null))[_0x0375('0x45')](handleError(_0x1aee6c,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 62a31f0..3f8df75 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 _0x0f5a=['recordingFormat','auth','Authenticate','password','ChanSpy','name','options','join','StopMixMonitor','length','internal','findAll','agent','then','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','util','./voiceChanSpy.attributes','from-sip','format','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a'];(function(_0x6983f6,_0x315906){var _0x53c499=function(_0x402536){while(--_0x402536){_0x6983f6['push'](_0x6983f6['shift']());}};_0x53c499(++_0x315906);}(_0x0f5a,0x99));var _0xa0f5=function(_0x1f5834,_0x421950){_0x1f5834=_0x1f5834-0x0;var _0x418e31=_0x0f5a[_0x1f5834];return _0x418e31;};'use strict';var _=require('lodash');var util=require(_0xa0f5('0x0'));var BPromise=require('bluebird');var attributes=require(_0xa0f5('0x1'));var getUserApplications=function(_0x273271,_0x567780,_0xdf5ade){var _0x27a6e0=0x1;var _0x2bb3ff=[];var _0x20b896={'context':_0x567780['context']||_0xa0f5('0x2'),'exten':util[_0xa0f5('0x3')]('%s%s',_0x273271['prefix'],_0xdf5ade),'type':_0xa0f5('0x4'),'isApp':![],'ChanSpyId':_0x273271['id'],'UserId':_0x567780['id']};_0x2bb3ff[_0xa0f5('0x5')](_[_0xa0f5('0x6')]({'app':_0xa0f5('0x7'),'appdata':util['format'](_0xa0f5('0x8'),'chanspy'),'priority':_0x27a6e0++},_0x20b896));if(_0x273271[_0xa0f5('0x9')]){_0x2bb3ff[_0xa0f5('0x5')](_[_0xa0f5('0x6')]({'app':_0xa0f5('0xa'),'appdata':util[_0xa0f5('0x3')](_0xa0f5('0xb'),_0x273271[_0xa0f5('0xc')]),'priority':_0x27a6e0++},_0x20b896));}if(_0x273271[_0xa0f5('0xd')]){_0x2bb3ff['push'](_['merge']({'app':_0xa0f5('0xe'),'appdata':_0x273271[_0xa0f5('0xf')],'priority':_0x27a6e0++},_0x20b896));}_0x2bb3ff['push'](_['merge']({'app':_0xa0f5('0x10'),'appdata':util[_0xa0f5('0x3')]('SIP/%s,%s',_0x567780[_0xa0f5('0x11')],_0x273271['options']?_0x273271[_0xa0f5('0x12')][_0xa0f5('0x13')](''):''),'priority':_0x27a6e0++},_0x20b896));if(_0x273271['record']){_0x2bb3ff[_0xa0f5('0x5')](_[_0xa0f5('0x6')]({'app':_0xa0f5('0x14'),'priority':_0x27a6e0++},_0x20b896));}return _0x2bb3ff;};var getChanSpyApplications=function(_0x33dcd3,_0x5806b3){var _0x1c78b6=[];for(var _0x2cf2b7=0x0,_0x478f66=0x1;_0x2cf2b7<_0x5806b3[_0xa0f5('0x15')];_0x2cf2b7++,_0x478f66=0x1){_0x1c78b6=_0x1c78b6['concat'](getUserApplications(_0x33dcd3,_0x5806b3[_0x2cf2b7],_0x5806b3[_0x2cf2b7][_0xa0f5('0x16')]));if(_0x5806b3[_0x2cf2b7][_0xa0f5('0x16')]!=_0x5806b3[_0x2cf2b7][_0xa0f5('0x11')]){_0x1c78b6=_0x1c78b6['concat'](getUserApplications(_0x33dcd3,_0x5806b3[_0x2cf2b7],_0x5806b3[_0x2cf2b7][_0xa0f5('0x11')]));}}return _0x1c78b6;};var getChanSpyPromise=function(_0x165e48,_0x177a63){return new BPromise(function(_0x16b948,_0x3dc478){return _0x165e48['User'][_0xa0f5('0x17')]({'attributes':['id',_0xa0f5('0x11'),_0xa0f5('0x16')],'where':{'role':_0xa0f5('0x18'),'chanspy':!![]},'raw':!![]})[_0xa0f5('0x19')](function(_0x240459){if(_0x240459){return _0x16b948(getChanSpyApplications(_0x177a63,_0x240459));}return _0x16b948([]);})['catch'](function(_0x15585e){_0x3dc478(_0x15585e);});});};module[_0xa0f5('0x1a')]=function(_0x405b27,_0xdde8ec){var _0x385232=_0x405b27['models'];return _0x405b27['define'](_0xa0f5('0x1b'),attributes,{'tableName':_0xa0f5('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xbe94f2,_0x2ae02d,_0x2efaac){return getChanSpyPromise(_0x385232,_0xbe94f2)['then'](function(_0x161ccc){if(_0x161ccc&&_0x161ccc[_0xa0f5('0x15')]){return _0x385232[_0xa0f5('0x1d')][_0xa0f5('0x1e')](_0x161ccc);}})['then'](function(){_0x2efaac();})[_0xa0f5('0x1f')](function(_0x3b3d4b){_0x2efaac(_0x3b3d4b);});},'afterUpdate':function(_0x28d7f8,_0x318eff,_0x43efb5){return _0x385232['VoiceExtension'][_0xa0f5('0x20')]({'where':{'ChanSpyId':_0x28d7f8['id']}})[_0xa0f5('0x19')](function(){return getChanSpyPromise(_0x385232,_0x28d7f8);})['then'](function(_0x16c5d0){if(_0x16c5d0&&_0x16c5d0[_0xa0f5('0x15')]){return _0x385232[_0xa0f5('0x1d')][_0xa0f5('0x1e')](_0x16c5d0);}})['then'](function(){_0x43efb5();})[_0xa0f5('0x1f')](function(_0x5c8076){_0x43efb5(_0x5c8076);});},'afterDestroy':function(_0x26d857,_0xb7651f,_0x4cbd22){return _0x385232[_0xa0f5('0x1d')]['destroy']({'where':{'ChanSpyId':_0x26d857['id']}})[_0xa0f5('0x19')](function(){_0x4cbd22();})[_0xa0f5('0x1f')](function(_0x2ae165){_0x4cbd22(_0x2ae165);});}}});}; \ No newline at end of file +var _0xe0f0=['concat','internal','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','then','length','VoiceExtension','destroy','bulkCreate','util','bluebird','./voiceChanSpy.attributes','from-sip','format','prefix','system','push','merge','Set','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','name','options','join','StopMixMonitor'];(function(_0x47ea7c,_0x380b23){var _0x101bff=function(_0x635aaf){while(--_0x635aaf){_0x47ea7c['push'](_0x47ea7c['shift']());}};_0x101bff(++_0x380b23);}(_0xe0f0,0x77));var _0x0e0f=function(_0xf8d80e,_0x36533e){_0xf8d80e=_0xf8d80e-0x0;var _0x57324c=_0xe0f0[_0xf8d80e];return _0x57324c;};'use strict';var _=require('lodash');var util=require(_0x0e0f('0x0'));var BPromise=require(_0x0e0f('0x1'));var attributes=require(_0x0e0f('0x2'));var getUserApplications=function(_0x577d3d,_0xc8dadd,_0x38e25b){var _0x492871=0x1;var _0x5ee12f=[];var _0x2855da={'context':_0xc8dadd['context']||_0x0e0f('0x3'),'exten':util[_0x0e0f('0x4')]('%s%s',_0x577d3d[_0x0e0f('0x5')],_0x38e25b),'type':_0x0e0f('0x6'),'isApp':![],'ChanSpyId':_0x577d3d['id'],'UserId':_0xc8dadd['id']};_0x5ee12f[_0x0e0f('0x7')](_[_0x0e0f('0x8')]({'app':_0x0e0f('0x9'),'appdata':util[_0x0e0f('0x4')]('CDR(type)=%s',_0x0e0f('0xa')),'priority':_0x492871++},_0x2855da));if(_0x577d3d[_0x0e0f('0xb')]){_0x5ee12f[_0x0e0f('0x7')](_[_0x0e0f('0x8')]({'app':_0x0e0f('0xc'),'appdata':util[_0x0e0f('0x4')]('${UNIQUEID}.%s,a',_0x577d3d[_0x0e0f('0xd')]),'priority':_0x492871++},_0x2855da));}if(_0x577d3d[_0x0e0f('0xe')]){_0x5ee12f['push'](_['merge']({'app':_0x0e0f('0xf'),'appdata':_0x577d3d['password'],'priority':_0x492871++},_0x2855da));}_0x5ee12f['push'](_[_0x0e0f('0x8')]({'app':_0x0e0f('0x10'),'appdata':util[_0x0e0f('0x4')]('SIP/%s,%s',_0xc8dadd[_0x0e0f('0x11')],_0x577d3d[_0x0e0f('0x12')]?_0x577d3d[_0x0e0f('0x12')][_0x0e0f('0x13')](''):''),'priority':_0x492871++},_0x2855da));if(_0x577d3d[_0x0e0f('0xb')]){_0x5ee12f['push'](_[_0x0e0f('0x8')]({'app':_0x0e0f('0x14'),'priority':_0x492871++},_0x2855da));}return _0x5ee12f;};var getChanSpyApplications=function(_0x1e1486,_0x4caf08){var _0x26ac95=[];for(var _0x367cfe=0x0,_0x4693db=0x1;_0x367cfe<_0x4caf08['length'];_0x367cfe++,_0x4693db=0x1){_0x26ac95=_0x26ac95[_0x0e0f('0x15')](getUserApplications(_0x1e1486,_0x4caf08[_0x367cfe],_0x4caf08[_0x367cfe][_0x0e0f('0x16')]));if(_0x4caf08[_0x367cfe][_0x0e0f('0x16')]!=_0x4caf08[_0x367cfe][_0x0e0f('0x11')]){_0x26ac95=_0x26ac95[_0x0e0f('0x15')](getUserApplications(_0x1e1486,_0x4caf08[_0x367cfe],_0x4caf08[_0x367cfe][_0x0e0f('0x11')]));}}return _0x26ac95;};var getChanSpyPromise=function(_0x5545e8,_0x11d6e8){return new BPromise(function(_0x314031,_0x59dbb8){return _0x5545e8['User'][_0x0e0f('0x17')]({'attributes':['id','name',_0x0e0f('0x16')],'where':{'role':_0x0e0f('0x18'),'chanspy':!![]},'raw':!![]})['then'](function(_0x3a66d7){if(_0x3a66d7){return _0x314031(getChanSpyApplications(_0x11d6e8,_0x3a66d7));}return _0x314031([]);})[_0x0e0f('0x19')](function(_0x2d87e4){_0x59dbb8(_0x2d87e4);});});};module['exports']=function(_0x9cd311,_0x3ffbde){var _0xe58a86=_0x9cd311[_0x0e0f('0x1a')];return _0x9cd311[_0x0e0f('0x1b')](_0x0e0f('0x1c'),attributes,{'tableName':_0x0e0f('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f163f,_0x25b7be,_0x39be66){return getChanSpyPromise(_0xe58a86,_0x4f163f)[_0x0e0f('0x1e')](function(_0x57be43){if(_0x57be43&&_0x57be43[_0x0e0f('0x1f')]){return _0xe58a86[_0x0e0f('0x20')]['bulkCreate'](_0x57be43);}})[_0x0e0f('0x1e')](function(){_0x39be66();})['catch'](function(_0x100947){_0x39be66(_0x100947);});},'afterUpdate':function(_0x31fa08,_0x25ccf0,_0x567c74){return _0xe58a86[_0x0e0f('0x20')][_0x0e0f('0x21')]({'where':{'ChanSpyId':_0x31fa08['id']}})[_0x0e0f('0x1e')](function(){return getChanSpyPromise(_0xe58a86,_0x31fa08);})[_0x0e0f('0x1e')](function(_0x44f521){if(_0x44f521&&_0x44f521['length']){return _0xe58a86[_0x0e0f('0x20')][_0x0e0f('0x22')](_0x44f521);}})[_0x0e0f('0x1e')](function(){_0x567c74();})[_0x0e0f('0x19')](function(_0x39b0c9){_0x567c74(_0x39b0c9);});},'afterDestroy':function(_0x2cb95d,_0x4538e3,_0x15e6d2){return _0xe58a86[_0x0e0f('0x20')][_0x0e0f('0x21')]({'where':{'ChanSpyId':_0x2cb95d['id']}})[_0x0e0f('0x1e')](function(){_0x15e6d2();})[_0x0e0f('0x19')](function(_0x2c3f85){_0x15e6d2(_0x2c3f85);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index cbf9fba..e6a0d9c 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 _0x2750=['jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42f39e,_0x57e797){var _0xd152de=function(_0x3309ee){while(--_0x3309ee){_0x42f39e['push'](_0x42f39e['shift']());}};_0xd152de(++_0x57e797);}(_0x2750,0x13b));var _0x0275=function(_0x2dc5b8,_0x5e954e){_0x2dc5b8=_0x2dc5b8-0x0;var _0x5e35e6=_0x2750[_0x2dc5b8];return _0x5e35e6;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var moment=require(_0x0275('0x1'));var BPromise=require(_0x0275('0x2'));var rs=require(_0x0275('0x3'));var fs=require('fs');var Redis=require(_0x0275('0x4'));var db=require(_0x0275('0x5'))['db'];var utils=require(_0x0275('0x6'));var logger=require(_0x0275('0x7'))(_0x0275('0x8'));var config=require(_0x0275('0x9'));var jayson=require(_0x0275('0xa'));var client=jayson['client'][_0x0275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2421fd,_0x2fa0eb,_0x2e4b5c){return new BPromise(function(_0x4dffd1,_0x1f7c4a){return client[_0x0275('0xc')](_0x2421fd,_0x2e4b5c)[_0x0275('0xd')](function(_0x5e0e4a){logger['info'](_0x0275('0xe'),_0x2fa0eb,'request\x20sent');logger[_0x0275('0xf')](_0x0275('0x10'),_0x2fa0eb,_0x0275('0x11'),JSON[_0x0275('0x12')](_0x5e0e4a));if(_0x5e0e4a[_0x0275('0x13')]){if(_0x5e0e4a['error'][_0x0275('0x14')]===0x1f4){logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a['error']['message']);return _0x1f7c4a(_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);}logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);return _0x4dffd1(_0x5e0e4a['error'][_0x0275('0x15')]);}else{logger[_0x0275('0x16')]('VoiceChanSpy,\x20%s,\x20%s',_0x2fa0eb,_0x0275('0x11'));_0x4dffd1(_0x5e0e4a[_0x0275('0x17')]['message']);}})[_0x0275('0x18')](function(_0x31c76b){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x2fa0eb,_0x31c76b);_0x1f7c4a(_0x31c76b);});});} \ No newline at end of file +var _0xd52a=['../../config/environment','request','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3f7db6,_0x40efe2){var _0x415e96=function(_0x4b9182){while(--_0x4b9182){_0x3f7db6['push'](_0x3f7db6['shift']());}};_0x415e96(++_0x40efe2);}(_0xd52a,0xca));var _0xad52=function(_0x4d53ec,_0x50cfcb){_0x4d53ec=_0x4d53ec-0x0;var _0x1213e6=_0xd52a[_0x4d53ec];return _0x1213e6;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index fc0e517..75a78a0 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 _0xb869=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','show','create','/:id','delete','destroy'];(function(_0x205293,_0x3d2c60){var _0x13579b=function(_0x24112b){while(--_0x24112b){_0x205293['push'](_0x205293['shift']());}};_0x13579b(++_0x3d2c60);}(_0xb869,0x111));var _0x9b86=function(_0x4cd99c,_0xe4afeb){_0x4cd99c=_0x4cd99c-0x0;var _0x1db5f7=_0xb869[_0x4cd99c];return _0x1db5f7;};'use strict';var multer=require(_0x9b86('0x0'));var util=require(_0x9b86('0x1'));var path=require(_0x9b86('0x2'));var timeout=require(_0x9b86('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9b86('0x4'));var auth=require(_0x9b86('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9b86('0x6'));var controller=require(_0x9b86('0x7'));router['get']('/',auth[_0x9b86('0x8')](),controller['index']);router[_0x9b86('0x9')]('/:id',auth[_0x9b86('0x8')](),controller[_0x9b86('0xa')]);router['post']('/',auth[_0x9b86('0x8')](),controller[_0x9b86('0xb')]);router['put'](_0x9b86('0xc'),auth[_0x9b86('0x8')](),controller['update']);router[_0x9b86('0xd')](_0x9b86('0xc'),auth[_0x9b86('0x8')](),controller[_0x9b86('0xe')]);module[_0x9b86('0xf')]=router; \ No newline at end of file +var _0x71d8=['/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','show','post','create','put'];(function(_0x38f06b,_0x31bae2){var _0x59898f=function(_0x4fb72d){while(--_0x4fb72d){_0x38f06b['push'](_0x38f06b['shift']());}};_0x59898f(++_0x31bae2);}(_0x71d8,0x112));var _0x871d=function(_0x5a51bd,_0x151f35){_0x5a51bd=_0x5a51bd-0x0;var _0x46fa44=_0x71d8[_0x5a51bd];return _0x46fa44;};'use strict';var multer=require('multer');var util=require(_0x871d('0x0'));var path=require(_0x871d('0x1'));var timeout=require(_0x871d('0x2'));var express=require(_0x871d('0x3'));var router=express[_0x871d('0x4')]();var fs_extra=require(_0x871d('0x5'));var auth=require(_0x871d('0x6'));var interaction=require(_0x871d('0x7'));var config=require('../../config/environment');var controller=require(_0x871d('0x8'));router[_0x871d('0x9')]('/',auth[_0x871d('0xa')](),controller['index']);router['get']('/:id',auth[_0x871d('0xa')](),controller[_0x871d('0xb')]);router[_0x871d('0xc')]('/',auth[_0x871d('0xa')](),controller[_0x871d('0xd')]);router[_0x871d('0xe')](_0x871d('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x871d('0xa')](),controller[_0x871d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index b47a06e..7d4a0c2 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 _0xfb7d=['name','BOOLEAN','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xfb7d,0x86));var _0xdfb7=function(_0xc4cfe7,_0x46a417){_0xc4cfe7=_0xc4cfe7-0x0;var _0xff684e=_0xfb7d[_0xc4cfe7];return _0xff684e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdfb7('0x0')],'unique':_0xdfb7('0x1')},'description':{'type':Sequelize[_0xdfb7('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xdfb7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa046=['name','STRING','BOOLEAN','sequelize'];(function(_0x3c4958,_0x450ef9){var _0x46bd11=function(_0x232e5b){while(--_0x232e5b){_0x3c4958['push'](_0x3c4958['shift']());}};_0x46bd11(++_0x450ef9);}(_0xa046,0x15b));var _0x6a04=function(_0x58eda0,_0x198e51){_0x58eda0=_0x58eda0-0x0;var _0x4bb7f8=_0xa046[_0x58eda0];return _0x4bb7f8;};'use strict';var Sequelize=require(_0x6a04('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6a04('0x1')},'description':{'type':Sequelize[_0x6a04('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6a04('0x3')],'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 afd1bcd..7b36e4d 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 _0x3810=['rows','show','params','fields','find','create','body','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','writeFileSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','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/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','code','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','Contexts','name','send','index','VoiceContext','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','sort','where','pick','filter','map','merge','options','includeAll','include','findAll'];(function(_0x21219e,_0x30021e){var _0xf37857=function(_0x539f55){while(--_0x539f55){_0x21219e['push'](_0x21219e['shift']());}};_0xf37857(++_0x30021e);}(_0x3810,0x82));var _0x0381=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x3810[_0x4fbb86];return _0xb141fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0381('0x0'));var jsonpatch=require(_0x0381('0x1'));var rp=require(_0x0381('0x2'));var moment=require(_0x0381('0x3'));var BPromise=require(_0x0381('0x4'));var Mustache=require(_0x0381('0x5'));var util=require('util');var path=require(_0x0381('0x6'));var sox=require(_0x0381('0x7'));var csv=require('to-csv');var ejs=require(_0x0381('0x8'));var fs=require('fs');var fs_extra=require(_0x0381('0x9'));var _=require(_0x0381('0xa'));var squel=require(_0x0381('0xb'));var crypto=require(_0x0381('0xc'));var jsforce=require(_0x0381('0xd'));var deskjs=require(_0x0381('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0381('0xf'));var Papa=require(_0x0381('0x10'));var Redis=require(_0x0381('0x11'));var authService=require(_0x0381('0x12'));var qs=require(_0x0381('0x13'));var as=require(_0x0381('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0381('0x15'))(_0x0381('0x16'));var utils=require(_0x0381('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0381('0x18'));var db=require(_0x0381('0x19'))['db'];var jayson=require(_0x0381('0x1a'));var client=jayson[_0x0381('0x1b')][_0x0381('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4ee22f,_0x370254,_0x31a60d,_0x2f912c){return new BPromise(function(_0x32bec4,_0x1a5104){var _0x4192e=_0x2f912c||client;return _0x4192e[_0x0381('0x1d')](_0x4ee22f,_0x31a60d)[_0x0381('0x1e')](function(_0x4d933b){logger[_0x0381('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x370254,_0x0381('0x20'));logger['debug'](_0x0381('0x21'),_0x370254,_0x0381('0x20'),JSON['stringify'](_0x4d933b));if(_0x4d933b['error']){if(_0x4d933b['error'][_0x0381('0x22')]===0x1f4){logger[_0x0381('0x23')](_0x0381('0x24'),_0x370254,_0x4d933b[_0x0381('0x23')]['message']);return _0x1a5104(_0x4d933b[_0x0381('0x23')]['message']);}logger[_0x0381('0x23')]('VoiceContext,\x20%s,\x20%s',_0x370254,_0x4d933b['error']['message']);return _0x32bec4(_0x4d933b[_0x0381('0x23')][_0x0381('0x25')]);}else{logger[_0x0381('0x1f')](_0x0381('0x24'),_0x370254,_0x0381('0x20'));_0x32bec4(_0x4d933b[_0x0381('0x26')][_0x0381('0x25')]);}})[_0x0381('0x27')](function(_0x4f8c79){logger['error'](_0x0381('0x24'),_0x370254,_0x4f8c79);_0x1a5104(_0x4f8c79);});});}function respondWithStatusCode(_0x3d9d42,_0x2fd3cf){_0x2fd3cf=_0x2fd3cf||0xcc;return function(_0x16a135){if(_0x16a135){return _0x3d9d42[_0x0381('0x28')](_0x2fd3cf);}return _0x3d9d42['status'](_0x2fd3cf)[_0x0381('0x29')]();};}function respondWithResult(_0x22cdb6,_0x18ee77){_0x18ee77=_0x18ee77||0xc8;return function(_0x7bfc74){if(_0x7bfc74){return _0x22cdb6['status'](_0x18ee77)[_0x0381('0x2a')](_0x7bfc74);}};}function respondWithFilteredResult(_0x2e9baf,_0x5abc4a){return function(_0x46fb1b){if(_0x46fb1b){var _0x5db608=typeof _0x5abc4a[_0x0381('0x2b')]===_0x0381('0x2c')&&typeof _0x5abc4a[_0x0381('0x2d')]===_0x0381('0x2c');var _0xa96ae1=_0x46fb1b[_0x0381('0x2e')];var _0x4f96ed=_0x5db608?0x0:_0x5abc4a[_0x0381('0x2b')];var _0x5f1494=_0x5db608?_0x46fb1b['count']:_0x5abc4a[_0x0381('0x2b')]+_0x5abc4a[_0x0381('0x2d')];var _0x319989;if(_0x5f1494>=_0xa96ae1){_0x5f1494=_0xa96ae1;_0x319989=0xc8;}else{_0x319989=0xce;}_0x2e9baf[_0x0381('0x2f')](_0x319989);return _0x2e9baf[_0x0381('0x30')](_0x0381('0x31'),_0x4f96ed+'-'+_0x5f1494+'/'+_0xa96ae1)[_0x0381('0x2a')](_0x46fb1b);}return null;};}function patchUpdates(_0x2b1437){return function(_0x3e90db){try{jsonpatch[_0x0381('0x32')](_0x3e90db,_0x2b1437,!![]);}catch(_0x5e5c31){return BPromise[_0x0381('0x33')](_0x5e5c31);}return _0x3e90db[_0x0381('0x34')]();};}function saveUpdates(_0x24b12e,_0x4bf346){return function(_0x35f1cf){if(_0x35f1cf){return _0x35f1cf[_0x0381('0x35')](_0x24b12e)['then'](function(_0x44a3c8){return _0x44a3c8;});}return null;};}function removeEntity(_0x19ab1a,_0x23372f){return function(_0x2ce10e){if(_0x2ce10e){return _0x2ce10e[_0x0381('0x36')]()[_0x0381('0x1e')](function(){var _0x5c6332=_0x2ce10e['get']({'plain':!![]});var _0x43bdc2=_0x0381('0x37');return db['UserProfileResource'][_0x0381('0x36')]({'where':{'type':_0x43bdc2,'resourceId':_0x5c6332['id']}})['then'](function(){return _0x2ce10e;});})[_0x0381('0x1e')](function(){_0x19ab1a[_0x0381('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380d6f,_0x1593e8){return function(_0x2a73b4){if(!_0x2a73b4){_0x380d6f[_0x0381('0x28')](0x194);}return _0x2a73b4;};}function handleError(_0x2de3f0,_0x1e1ecd){_0x1e1ecd=_0x1e1ecd||0x1f4;return function(_0x45e848){logger['error'](_0x45e848['stack']);if(_0x45e848[_0x0381('0x38')]){delete _0x45e848[_0x0381('0x38')];}_0x2de3f0[_0x0381('0x2f')](_0x1e1ecd)[_0x0381('0x39')](_0x45e848);};}exports[_0x0381('0x3a')]=function(_0x2096f6,_0x4bdcdf){var _0x47f738={},_0x2f914a={},_0x18aa70={'count':0x0,'rows':[]};var _0x215792=_['map'](db[_0x0381('0x3b')][_0x0381('0x3c')],function(_0x36e0dc){return{'name':_0x36e0dc['fieldName'],'type':_0x36e0dc[_0x0381('0x3d')][_0x0381('0x3e')]};});_0x2f914a['model']=_['map'](_0x215792,_0x0381('0x38'));_0x2f914a[_0x0381('0x3f')]=_[_0x0381('0x40')](_0x2096f6[_0x0381('0x3f')]);_0x2f914a[_0x0381('0x41')]=_[_0x0381('0x42')](_0x2f914a[_0x0381('0x43')],_0x2f914a[_0x0381('0x3f')]);_0x47f738[_0x0381('0x44')]=_[_0x0381('0x42')](_0x2f914a[_0x0381('0x43')],qs['fields'](_0x2096f6['query']['fields']));_0x47f738[_0x0381('0x44')]=_0x47f738[_0x0381('0x44')][_0x0381('0x45')]?_0x47f738['attributes']:_0x2f914a['model'];if(!_0x2096f6[_0x0381('0x3f')]['hasOwnProperty']('nolimit')){_0x47f738[_0x0381('0x2d')]=qs[_0x0381('0x2d')](_0x2096f6['query']['limit']);_0x47f738[_0x0381('0x2b')]=qs[_0x0381('0x2b')](_0x2096f6['query'][_0x0381('0x2b')]);}_0x47f738['order']=qs[_0x0381('0x46')](_0x2096f6[_0x0381('0x3f')]['sort']);_0x47f738[_0x0381('0x47')]=qs[_0x0381('0x41')](_[_0x0381('0x48')](_0x2096f6['query'],_0x2f914a[_0x0381('0x41')]),_0x215792);if(_0x2096f6[_0x0381('0x3f')][_0x0381('0x49')]){_0x47f738[_0x0381('0x47')]=_['merge'](_0x47f738['where'],{'$or':_[_0x0381('0x4a')](_0x215792,function(_0x3176ca){if(_0x3176ca[_0x0381('0x3d')]!=='VIRTUAL'){var _0x3bcf01={};_0x3bcf01[_0x3176ca[_0x0381('0x38')]]={'$like':'%'+_0x2096f6['query']['filter']+'%'};return _0x3bcf01;}})});}_0x47f738=_[_0x0381('0x4b')]({},_0x47f738,_0x2096f6[_0x0381('0x4c')]);var _0x17582b={'where':_0x47f738[_0x0381('0x47')]};return db[_0x0381('0x3b')]['count'](_0x17582b)['then'](function(_0x2400db){_0x18aa70['count']=_0x2400db;if(_0x2096f6[_0x0381('0x3f')][_0x0381('0x4d')]){_0x47f738[_0x0381('0x4e')]=[{'all':!![]}];}return db[_0x0381('0x3b')][_0x0381('0x4f')](_0x47f738);})[_0x0381('0x1e')](function(_0x149053){_0x18aa70[_0x0381('0x50')]=_0x149053;return _0x18aa70;})[_0x0381('0x1e')](respondWithFilteredResult(_0x4bdcdf,_0x47f738))['catch'](handleError(_0x4bdcdf,null));};exports[_0x0381('0x51')]=function(_0x348305,_0x1c4e57){var _0xa347c4={'raw':![],'where':{'id':_0x348305[_0x0381('0x52')]['id']}},_0x5d523b={};_0x5d523b[_0x0381('0x43')]=_['keys'](db[_0x0381('0x3b')][_0x0381('0x3c')]);_0x5d523b[_0x0381('0x3f')]=_[_0x0381('0x40')](_0x348305['query']);_0x5d523b[_0x0381('0x41')]=_[_0x0381('0x42')](_0x5d523b[_0x0381('0x43')],_0x5d523b[_0x0381('0x3f')]);_0xa347c4[_0x0381('0x44')]=_[_0x0381('0x42')](_0x5d523b[_0x0381('0x43')],qs[_0x0381('0x53')](_0x348305['query'][_0x0381('0x53')]));_0xa347c4['attributes']=_0xa347c4[_0x0381('0x44')][_0x0381('0x45')]?_0xa347c4[_0x0381('0x44')]:_0x5d523b[_0x0381('0x43')];if(_0x348305['query'][_0x0381('0x4d')]){_0xa347c4['include']=[{'all':!![]}];}_0xa347c4=_[_0x0381('0x4b')]({},_0xa347c4,_0x348305['options']);return db[_0x0381('0x3b')][_0x0381('0x54')](_0xa347c4)[_0x0381('0x1e')](handleEntityNotFound(_0x1c4e57,null))[_0x0381('0x1e')](respondWithResult(_0x1c4e57,null))[_0x0381('0x27')](handleError(_0x1c4e57,null));};exports['create']=function(_0x4fe1fa,_0x545b89,_0x5b1673){var _0x5dd4fb;return db[_0x0381('0x3b')][_0x0381('0x55')](_0x4fe1fa[_0x0381('0x56')],{'raw':!![]})[_0x0381('0x1e')](function(_0x9fe322){_0x5dd4fb=_0x9fe322;return db['VoiceContext'][_0x0381('0x4f')]({'raw':!![]});})[_0x0381('0x1e')](function(_0x14e3b8){var _0x4e7e48=fs['readFileSync'](path['join'](config[_0x0381('0x57')],_0x0381('0x58')),_0x0381('0x59'));var _0x1143c6=ejs[_0x0381('0x5a')](_0x4e7e48,{'contexts':_0x14e3b8||[]});fs['writeFileSync'](_0x0381('0x5b'),_0x1143c6);})['then'](function(){return respondWithRpcPromise(_0x0381('0x5c'),_0x0381('0x55'),{'module':_0x0381('0x5d')});})[_0x0381('0x1e')](function(){var _0x5d4ab2=_0x4fe1fa[_0x0381('0x5e')][_0x0381('0x5f')]({'plain':!![]});if(!_0x5d4ab2)throw new Error(_0x0381('0x60'));if(_0x5d4ab2[_0x0381('0x61')]===_0x0381('0x5e')){var _0x1c63af=_0x5dd4fb[_0x0381('0x5f')]({'plain':!![]});return db[_0x0381('0x62')][_0x0381('0x54')]({'where':{'name':_0x0381('0x37'),'userProfileId':_0x5d4ab2[_0x0381('0x63')]},'raw':!![]})['then'](function(_0x29d906){if(_0x29d906&&_0x29d906[_0x0381('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c63af[_0x0381('0x38')],'resourceId':_0x1c63af['id'],'type':_0x29d906[_0x0381('0x38')],'sectionId':_0x29d906['id']},{})[_0x0381('0x1e')](function(){return _0x5dd4fb;});}else{return _0x5dd4fb;}})['catch'](function(_0x9ab7e3){logger[_0x0381('0x23')](_0x0381('0x65'),_0x9ab7e3);throw _0x9ab7e3;});}return _0x5dd4fb;})[_0x0381('0x1e')](respondWithResult(_0x545b89,0xc9))[_0x0381('0x27')](handleError(_0x545b89,null));};exports[_0x0381('0x35')]=function(_0x53c8ae,_0x207b96,_0xd0e140){var _0x1402e7;return db['VoiceContext'][_0x0381('0x54')]({'where':{'id':_0x53c8ae['params']['id']}})['then'](handleEntityNotFound(_0x207b96,null))[_0x0381('0x1e')](saveUpdates(_0x53c8ae[_0x0381('0x56')],null))[_0x0381('0x1e')](function(_0x51aaf1){if(_0x51aaf1){_0x1402e7=_0x51aaf1;return db[_0x0381('0x3b')]['findAll']({'raw':!![]});}})['then'](function(_0x557a44){var _0x3b8e31=fs[_0x0381('0x66')](path[_0x0381('0x67')](config['root'],_0x0381('0x58')),'utf8');var _0x241f79=ejs[_0x0381('0x5a')](_0x3b8e31,{'contexts':_0x557a44||[]});fs[_0x0381('0x68')](_0x0381('0x5b'),_0x241f79);})['then'](function(){return respondWithRpcPromise(_0x0381('0x5c'),_0x0381('0x35'),{'module':_0x0381('0x5d')});})[_0x0381('0x1e')](function(){return _0x1402e7;})[_0x0381('0x1e')](respondWithResult(_0x207b96,null))[_0x0381('0x27')](handleError(_0x207b96,null));};exports[_0x0381('0x36')]=function(_0x16a94d,_0x1c2acd,_0x49b6e7){var _0x21f75a;return db['VoiceContext'][_0x0381('0x54')]({'where':{'id':_0x16a94d['params']['id']}})[_0x0381('0x1e')](handleEntityNotFound(_0x1c2acd,null))['then'](removeEntity(_0x1c2acd,null))['then'](function(){return db[_0x0381('0x3b')][_0x0381('0x4f')]({'raw':!![]});})[_0x0381('0x1e')](function(_0x122ebc){var _0x1acbcf=fs[_0x0381('0x66')](path[_0x0381('0x67')](config[_0x0381('0x57')],_0x0381('0x58')),_0x0381('0x59'));var _0x14aa24=ejs['render'](_0x1acbcf,{'contexts':_0x122ebc});fs[_0x0381('0x68')](_0x0381('0x5b'),_0x14aa24);return respondWithRpcPromise(_0x0381('0x5c'),_0x0381('0x36'),{'module':_0x0381('0x5d')});})[_0x0381('0x27')](handleError(_0x1c2acd,null));}; \ No newline at end of file +var _0x7260=['update','readFileSync','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','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/environment','../../config/license/util','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','get','UserProfileResource','end','sendStatus','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','findAll','join','root','utf8','render','writeFileSync','Reload','chan_sip.so','user','role','UserProfileSection','Contexts','userProfileId','autoAssociation'];(function(_0x4b0648,_0x1995d8){var _0x7f6e8d=function(_0x151c81){while(--_0x151c81){_0x4b0648['push'](_0x4b0648['shift']());}};_0x7f6e8d(++_0x1995d8);}(_0x7260,0x1a5));var _0x0726=function(_0x1f4810,_0x581faf){_0x1f4810=_0x1f4810-0x0;var _0xc269ea=_0x7260[_0x1f4810];return _0xc269ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0726('0x0'));var zipdir=require(_0x0726('0x1'));var jsonpatch=require(_0x0726('0x2'));var rp=require(_0x0726('0x3'));var moment=require('moment');var BPromise=require(_0x0726('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0726('0x5'));var sox=require(_0x0726('0x6'));var csv=require(_0x0726('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0726('0x8'));var _=require('lodash');var squel=require(_0x0726('0x9'));var crypto=require(_0x0726('0xa'));var jsforce=require(_0x0726('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0726('0xc'));var Papa=require(_0x0726('0xd'));var Redis=require(_0x0726('0xe'));var authService=require(_0x0726('0xf'));var qs=require(_0x0726('0x10'));var as=require(_0x0726('0x11'));var hardwareService=require(_0x0726('0x12'));var logger=require(_0x0726('0x13'))(_0x0726('0x14'));var utils=require(_0x0726('0x15'));var config=require(_0x0726('0x16'));var licenseUtil=require(_0x0726('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0726('0x18'));var client=jayson[_0x0726('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf13d,_0x3ff874,_0x7dc56,_0xdcce48){return new BPromise(function(_0x64f500,_0x5644d5){var _0x5ae3a0=_0xdcce48||client;return _0x5ae3a0['request'](_0x1cf13d,_0x7dc56)[_0x0726('0x1a')](function(_0x5cac2c){logger[_0x0726('0x1b')](_0x0726('0x1c'),_0x3ff874,'request\x20sent');logger['debug'](_0x0726('0x1d'),_0x3ff874,'request\x20sent',JSON[_0x0726('0x1e')](_0x5cac2c));if(_0x5cac2c[_0x0726('0x1f')]){if(_0x5cac2c[_0x0726('0x1f')][_0x0726('0x20')]===0x1f4){logger['error'](_0x0726('0x1c'),_0x3ff874,_0x5cac2c[_0x0726('0x1f')][_0x0726('0x21')]);return _0x5644d5(_0x5cac2c[_0x0726('0x1f')][_0x0726('0x21')]);}logger[_0x0726('0x1f')](_0x0726('0x1c'),_0x3ff874,_0x5cac2c[_0x0726('0x1f')][_0x0726('0x21')]);return _0x64f500(_0x5cac2c[_0x0726('0x1f')][_0x0726('0x21')]);}else{logger[_0x0726('0x1b')](_0x0726('0x1c'),_0x3ff874,_0x0726('0x22'));_0x64f500(_0x5cac2c[_0x0726('0x23')][_0x0726('0x21')]);}})[_0x0726('0x24')](function(_0x1c3300){logger[_0x0726('0x1f')](_0x0726('0x1c'),_0x3ff874,_0x1c3300);_0x5644d5(_0x1c3300);});});}function respondWithStatusCode(_0x4c9966,_0x4479c2){_0x4479c2=_0x4479c2||0xcc;return function(_0x1267c7){if(_0x1267c7){return _0x4c9966['sendStatus'](_0x4479c2);}return _0x4c9966[_0x0726('0x25')](_0x4479c2)['end']();};}function respondWithResult(_0x390fd6,_0x30ec5a){_0x30ec5a=_0x30ec5a||0xc8;return function(_0x59b0d4){if(_0x59b0d4){return _0x390fd6['status'](_0x30ec5a)[_0x0726('0x26')](_0x59b0d4);}};}function respondWithFilteredResult(_0x302b49,_0x4cfe52){return function(_0x1ceec6){if(_0x1ceec6){var _0x1040b7=typeof _0x4cfe52[_0x0726('0x27')]==='undefined'&&typeof _0x4cfe52[_0x0726('0x28')]===_0x0726('0x29');var _0x572db3=_0x1ceec6[_0x0726('0x2a')];var _0x182331=_0x1040b7?0x0:_0x4cfe52[_0x0726('0x27')];var _0x3d1fd1=_0x1040b7?_0x1ceec6[_0x0726('0x2a')]:_0x4cfe52[_0x0726('0x27')]+_0x4cfe52[_0x0726('0x28')];var _0x5421a8;if(_0x3d1fd1>=_0x572db3){_0x3d1fd1=_0x572db3;_0x5421a8=0xc8;}else{_0x5421a8=0xce;}_0x302b49[_0x0726('0x25')](_0x5421a8);return _0x302b49[_0x0726('0x2b')](_0x0726('0x2c'),_0x182331+'-'+_0x3d1fd1+'/'+_0x572db3)['json'](_0x1ceec6);}return null;};}function patchUpdates(_0x37d53c){return function(_0x2d9c81){try{jsonpatch[_0x0726('0x2d')](_0x2d9c81,_0x37d53c,!![]);}catch(_0x1b5b17){return BPromise[_0x0726('0x2e')](_0x1b5b17);}return _0x2d9c81[_0x0726('0x2f')]();};}function saveUpdates(_0x5b1a9e,_0x43b2cb){return function(_0x33cb35){if(_0x33cb35){return _0x33cb35['update'](_0x5b1a9e)[_0x0726('0x1a')](function(_0xe1e208){return _0xe1e208;});}return null;};}function removeEntity(_0xc5eb0c,_0x1a3821){return function(_0x2f0f67){if(_0x2f0f67){return _0x2f0f67['destroy']()['then'](function(){var _0x560f3b=_0x2f0f67[_0x0726('0x30')]({'plain':!![]});var _0x34f68b='Contexts';return db[_0x0726('0x31')]['destroy']({'where':{'type':_0x34f68b,'resourceId':_0x560f3b['id']}})[_0x0726('0x1a')](function(){return _0x2f0f67;});})[_0x0726('0x1a')](function(){_0xc5eb0c[_0x0726('0x25')](0xcc)[_0x0726('0x32')]();});}};}function handleEntityNotFound(_0x6112b,_0x331a34){return function(_0x58a04e){if(!_0x58a04e){_0x6112b[_0x0726('0x33')](0x194);}return _0x58a04e;};}function handleError(_0x55691d,_0x4d16e0){_0x4d16e0=_0x4d16e0||0x1f4;return function(_0x547e15){logger[_0x0726('0x1f')](_0x547e15['stack']);if(_0x547e15[_0x0726('0x34')]){delete _0x547e15[_0x0726('0x34')];}_0x55691d[_0x0726('0x25')](_0x4d16e0)[_0x0726('0x35')](_0x547e15);};}exports[_0x0726('0x36')]=function(_0x33bd75,_0x3576e9){var _0x28baac={},_0x318d33={},_0x592cce={'count':0x0,'rows':[]};var _0x553baa=_[_0x0726('0x37')](db[_0x0726('0x38')]['rawAttributes'],function(_0x262efd){return{'name':_0x262efd[_0x0726('0x39')],'type':_0x262efd[_0x0726('0x3a')][_0x0726('0x3b')]};});_0x318d33[_0x0726('0x3c')]=_[_0x0726('0x37')](_0x553baa,_0x0726('0x34'));_0x318d33[_0x0726('0x3d')]=_[_0x0726('0x3e')](_0x33bd75[_0x0726('0x3d')]);_0x318d33[_0x0726('0x3f')]=_['intersection'](_0x318d33['model'],_0x318d33[_0x0726('0x3d')]);_0x28baac[_0x0726('0x40')]=_[_0x0726('0x41')](_0x318d33[_0x0726('0x3c')],qs['fields'](_0x33bd75[_0x0726('0x3d')][_0x0726('0x42')]));_0x28baac[_0x0726('0x40')]=_0x28baac[_0x0726('0x40')][_0x0726('0x43')]?_0x28baac[_0x0726('0x40')]:_0x318d33[_0x0726('0x3c')];if(!_0x33bd75['query'][_0x0726('0x44')]('nolimit')){_0x28baac[_0x0726('0x28')]=qs[_0x0726('0x28')](_0x33bd75[_0x0726('0x3d')][_0x0726('0x28')]);_0x28baac[_0x0726('0x27')]=qs[_0x0726('0x27')](_0x33bd75[_0x0726('0x3d')][_0x0726('0x27')]);}_0x28baac['order']=qs['sort'](_0x33bd75[_0x0726('0x3d')][_0x0726('0x45')]);_0x28baac[_0x0726('0x46')]=qs[_0x0726('0x3f')](_[_0x0726('0x47')](_0x33bd75[_0x0726('0x3d')],_0x318d33[_0x0726('0x3f')]),_0x553baa);if(_0x33bd75[_0x0726('0x3d')][_0x0726('0x48')]){_0x28baac[_0x0726('0x46')]=_[_0x0726('0x49')](_0x28baac[_0x0726('0x46')],{'$or':_[_0x0726('0x37')](_0x553baa,function(_0x3bbddf){if(_0x3bbddf[_0x0726('0x3a')]!==_0x0726('0x4a')){var _0x551545={};_0x551545[_0x3bbddf['name']]={'$like':'%'+_0x33bd75[_0x0726('0x3d')][_0x0726('0x48')]+'%'};return _0x551545;}})});}_0x28baac=_[_0x0726('0x49')]({},_0x28baac,_0x33bd75[_0x0726('0x4b')]);var _0x13c3c8={'where':_0x28baac[_0x0726('0x46')]};return db[_0x0726('0x38')][_0x0726('0x2a')](_0x13c3c8)['then'](function(_0x4f9b2d){_0x592cce[_0x0726('0x2a')]=_0x4f9b2d;if(_0x33bd75[_0x0726('0x3d')][_0x0726('0x4c')]){_0x28baac[_0x0726('0x4d')]=[{'all':!![]}];}return db[_0x0726('0x38')]['findAll'](_0x28baac);})[_0x0726('0x1a')](function(_0xaa908b){_0x592cce[_0x0726('0x4e')]=_0xaa908b;return _0x592cce;})[_0x0726('0x1a')](respondWithFilteredResult(_0x3576e9,_0x28baac))[_0x0726('0x24')](handleError(_0x3576e9,null));};exports[_0x0726('0x4f')]=function(_0x458474,_0x255ed5){var _0x3aece4={'raw':![],'where':{'id':_0x458474[_0x0726('0x50')]['id']}},_0x30f245={};_0x30f245['model']=_[_0x0726('0x3e')](db['VoiceContext'][_0x0726('0x51')]);_0x30f245[_0x0726('0x3d')]=_[_0x0726('0x3e')](_0x458474[_0x0726('0x3d')]);_0x30f245['filters']=_['intersection'](_0x30f245[_0x0726('0x3c')],_0x30f245[_0x0726('0x3d')]);_0x3aece4['attributes']=_[_0x0726('0x41')](_0x30f245[_0x0726('0x3c')],qs['fields'](_0x458474[_0x0726('0x3d')]['fields']));_0x3aece4[_0x0726('0x40')]=_0x3aece4['attributes']['length']?_0x3aece4[_0x0726('0x40')]:_0x30f245[_0x0726('0x3c')];if(_0x458474['query']['includeAll']){_0x3aece4[_0x0726('0x4d')]=[{'all':!![]}];}_0x3aece4=_[_0x0726('0x49')]({},_0x3aece4,_0x458474[_0x0726('0x4b')]);return db[_0x0726('0x38')][_0x0726('0x52')](_0x3aece4)[_0x0726('0x1a')](handleEntityNotFound(_0x255ed5,null))[_0x0726('0x1a')](respondWithResult(_0x255ed5,null))[_0x0726('0x24')](handleError(_0x255ed5,null));};exports[_0x0726('0x53')]=function(_0x408e52,_0xf35fd0,_0x6ddbd9){var _0x38ae89;return db[_0x0726('0x38')]['create'](_0x408e52[_0x0726('0x54')],{'raw':!![]})[_0x0726('0x1a')](function(_0x4dddde){_0x38ae89=_0x4dddde;return db[_0x0726('0x38')][_0x0726('0x55')]({'raw':!![]});})[_0x0726('0x1a')](function(_0xcb1f0b){var _0x1f0c80=fs['readFileSync'](path[_0x0726('0x56')](config[_0x0726('0x57')],'server/files/templates/context.ejs'),_0x0726('0x58'));var _0x1ad4d4=ejs[_0x0726('0x59')](_0x1f0c80,{'contexts':_0xcb1f0b||[]});fs[_0x0726('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1ad4d4);})[_0x0726('0x1a')](function(){return respondWithRpcPromise(_0x0726('0x5b'),_0x0726('0x53'),{'module':_0x0726('0x5c')});})['then'](function(){var _0x2fef3f=_0x408e52[_0x0726('0x5d')][_0x0726('0x30')]({'plain':!![]});if(!_0x2fef3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fef3f[_0x0726('0x5e')]===_0x0726('0x5d')){var _0x53658e=_0x38ae89[_0x0726('0x30')]({'plain':!![]});return db[_0x0726('0x5f')][_0x0726('0x52')]({'where':{'name':_0x0726('0x60'),'userProfileId':_0x2fef3f[_0x0726('0x61')]},'raw':!![]})[_0x0726('0x1a')](function(_0x2109f3){if(_0x2109f3&&_0x2109f3[_0x0726('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x53658e[_0x0726('0x34')],'resourceId':_0x53658e['id'],'type':_0x2109f3[_0x0726('0x34')],'sectionId':_0x2109f3['id']},{})[_0x0726('0x1a')](function(){return _0x38ae89;});}else{return _0x38ae89;}})[_0x0726('0x24')](function(_0x550444){logger[_0x0726('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x550444);throw _0x550444;});}return _0x38ae89;})[_0x0726('0x1a')](respondWithResult(_0xf35fd0,0xc9))[_0x0726('0x24')](handleError(_0xf35fd0,null));};exports[_0x0726('0x63')]=function(_0x81e968,_0x147866,_0x293cd4){var _0x179ca8;return db['VoiceContext'][_0x0726('0x52')]({'where':{'id':_0x81e968[_0x0726('0x50')]['id']}})[_0x0726('0x1a')](handleEntityNotFound(_0x147866,null))['then'](saveUpdates(_0x81e968[_0x0726('0x54')],null))['then'](function(_0x494ff2){if(_0x494ff2){_0x179ca8=_0x494ff2;return db[_0x0726('0x38')][_0x0726('0x55')]({'raw':!![]});}})[_0x0726('0x1a')](function(_0x418d76){var _0x6ef6c4=fs[_0x0726('0x64')](path['join'](config[_0x0726('0x57')],_0x0726('0x65')),_0x0726('0x58'));var _0x1e0ece=ejs[_0x0726('0x59')](_0x6ef6c4,{'contexts':_0x418d76||[]});fs[_0x0726('0x5a')](_0x0726('0x66'),_0x1e0ece);})[_0x0726('0x1a')](function(){return respondWithRpcPromise(_0x0726('0x5b'),'update',{'module':_0x0726('0x5c')});})[_0x0726('0x1a')](function(){return _0x179ca8;})[_0x0726('0x1a')](respondWithResult(_0x147866,null))[_0x0726('0x24')](handleError(_0x147866,null));};exports[_0x0726('0x67')]=function(_0x1067c4,_0x401618,_0x1bb50d){var _0x106b8e;return db[_0x0726('0x38')]['find']({'where':{'id':_0x1067c4[_0x0726('0x50')]['id']}})[_0x0726('0x1a')](handleEntityNotFound(_0x401618,null))['then'](removeEntity(_0x401618,null))[_0x0726('0x1a')](function(){return db[_0x0726('0x38')][_0x0726('0x55')]({'raw':!![]});})[_0x0726('0x1a')](function(_0x5eea04){var _0x5899bd=fs[_0x0726('0x64')](path['join'](config[_0x0726('0x57')],_0x0726('0x65')),_0x0726('0x58'));var _0x2e161b=ejs[_0x0726('0x59')](_0x5899bd,{'contexts':_0x5eea04});fs['writeFileSync'](_0x0726('0x66'),_0x2e161b);return respondWithRpcPromise('Reload',_0x0726('0x67'),{'module':_0x0726('0x5c')});})[_0x0726('0x24')](handleError(_0x401618,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 614ddbc..7c86dd6 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 _0x0ffd=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x3686f3,_0x310a35){var _0x885aa7=function(_0x5888ca){while(--_0x5888ca){_0x3686f3['push'](_0x3686f3['shift']());}};_0x885aa7(++_0x310a35);}(_0x0ffd,0x19a));var _0xd0ff=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x0ffd[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xd0ff('0x0'));var util=require(_0xd0ff('0x1'));var logger=require(_0xd0ff('0x2'))(_0xd0ff('0x3'));var moment=require(_0xd0ff('0x4'));var BPromise=require(_0xd0ff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd0ff('0x7'));var attributes=require('./voiceContext.attributes');module[_0xd0ff('0x8')]=function(_0x20a8cb,_0x305d4a){return _0x20a8cb[_0xd0ff('0x9')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x228d=['../../config/environment','exports','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x228d,0x87));var _0xd228=function(_0x264eeb,_0xc05998){_0x264eeb=_0x264eeb-0x0;var _0xa45c83=_0x228d[_0x264eeb];return _0xa45c83;};'use strict';var _=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var logger=require(_0xd228('0x2'))(_0xd228('0x3'));var moment=require(_0xd228('0x4'));var BPromise=require(_0xd228('0x5'));var rp=require(_0xd228('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd228('0x7'));var config=require(_0xd228('0x8'));var attributes=require('./voiceContext.attributes');module[_0xd228('0x9')]=function(_0x50490d,_0x5530c4){return _0x50490d['define']('VoiceContext',attributes,{'tableName':_0xd228('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 7251923..5ee4f1f 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 _0x48ac=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis'];(function(_0x5bd954,_0x1329ad){var _0x468b4a=function(_0x4fd901){while(--_0x4fd901){_0x5bd954['push'](_0x5bd954['shift']());}};_0x468b4a(++_0x1329ad);}(_0x48ac,0xe0));var _0xc48a=function(_0x1842ee,_0x1be98c){_0x1842ee=_0x1842ee-0x0;var _0x5ef83a=_0x48ac[_0x1842ee];return _0x5ef83a;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var moment=require('moment');var BPromise=require(_0xc48a('0x1'));var rs=require(_0xc48a('0x2'));var fs=require('fs');var Redis=require(_0xc48a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc48a('0x4'));var logger=require(_0xc48a('0x5'))(_0xc48a('0x6'));var config=require(_0xc48a('0x7'));var jayson=require(_0xc48a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5df462,_0x5cffd4,_0x1e1e1a){return new BPromise(function(_0xf0c31b,_0x2c3285){return client['request'](_0x5df462,_0x1e1e1a)[_0xc48a('0x9')](function(_0x43461a){logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,_0xc48a('0xc'));logger[_0xc48a('0xd')](_0xc48a('0xe'),_0x5cffd4,_0xc48a('0xc'),JSON[_0xc48a('0xf')](_0x43461a));if(_0x43461a[_0xc48a('0x10')]){if(_0x43461a[_0xc48a('0x10')]['code']===0x1f4){logger[_0xc48a('0x10')](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')]['message']);return _0x2c3285(_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);}logger['error'](_0xc48a('0xb'),_0x5cffd4,_0x43461a[_0xc48a('0x10')][_0xc48a('0x11')]);return _0xf0c31b(_0x43461a['error'][_0xc48a('0x11')]);}else{logger[_0xc48a('0xa')](_0xc48a('0xb'),_0x5cffd4,'request\x20sent');_0xf0c31b(_0x43461a[_0xc48a('0x12')][_0xc48a('0x11')]);}})['catch'](function(_0x5c319b){logger[_0xc48a('0x10')]('VoiceContext,\x20%s,\x20%s',_0x5cffd4,_0x5c319b);_0x2c3285(_0x5c319b);});});} \ No newline at end of file +var _0x9f95=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash'];(function(_0x182b27,_0x2bfd08){var _0x13e1d3=function(_0x5e0198){while(--_0x5e0198){_0x182b27['push'](_0x182b27['shift']());}};_0x13e1d3(++_0x2bfd08);}(_0x9f95,0x97));var _0x59f9=function(_0x154d88,_0x485504){_0x154d88=_0x154d88-0x0;var _0x5f2793=_0x9f95[_0x154d88];return _0x5f2793;};'use strict';var _=require(_0x59f9('0x0'));var util=require('util');var moment=require(_0x59f9('0x1'));var BPromise=require(_0x59f9('0x2'));var rs=require(_0x59f9('0x3'));var fs=require('fs');var Redis=require(_0x59f9('0x4'));var db=require(_0x59f9('0x5'))['db'];var utils=require(_0x59f9('0x6'));var logger=require(_0x59f9('0x7'))('rpc');var config=require(_0x59f9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x59f9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556d82,_0x38e904,_0x2707ec){return new BPromise(function(_0x910eaa,_0x13a2ad){return client[_0x59f9('0xa')](_0x556d82,_0x2707ec)['then'](function(_0x3d7ccb){logger['info'](_0x59f9('0xb'),_0x38e904,'request\x20sent');logger[_0x59f9('0xc')](_0x59f9('0xd'),_0x38e904,'request\x20sent',JSON[_0x59f9('0xe')](_0x3d7ccb));if(_0x3d7ccb[_0x59f9('0xf')]){if(_0x3d7ccb[_0x59f9('0xf')]['code']===0x1f4){logger[_0x59f9('0xf')](_0x59f9('0xb'),_0x38e904,_0x3d7ccb[_0x59f9('0xf')][_0x59f9('0x10')]);return _0x13a2ad(_0x3d7ccb[_0x59f9('0xf')]['message']);}logger[_0x59f9('0xf')](_0x59f9('0xb'),_0x38e904,_0x3d7ccb['error'][_0x59f9('0x10')]);return _0x910eaa(_0x3d7ccb['error'][_0x59f9('0x10')]);}else{logger['info'](_0x59f9('0xb'),_0x38e904,_0x59f9('0x11'));_0x910eaa(_0x3d7ccb['result'][_0x59f9('0x10')]);}})[_0x59f9('0x12')](function(_0x109e4f){logger[_0x59f9('0xf')](_0x59f9('0xb'),_0x38e904,_0x109e4f);_0x13a2ad(_0x109e4f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b9d0cf6..6e4d56b 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 _0x38f5=['destroy','util','path','express','Router','fs-extra','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','describe','show','create','put','/:id','delete'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x38f5,0x89));var _0x538f=function(_0x124961,_0xff7908){_0x124961=_0x124961-0x0;var _0x5d2182=_0x38f5[_0x124961];return _0x5d2182;};'use strict';var multer=require('multer');var util=require(_0x538f('0x0'));var path=require(_0x538f('0x1'));var timeout=require('connect-timeout');var express=require(_0x538f('0x2'));var router=express[_0x538f('0x3')]();var fs_extra=require(_0x538f('0x4'));var auth=require(_0x538f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x538f('0x6'));router[_0x538f('0x7')]('/',auth[_0x538f('0x8')](),controller[_0x538f('0x9')]);router[_0x538f('0x7')]('/describe',auth[_0x538f('0x8')](),controller[_0x538f('0xa')]);router['get']('/:id',auth[_0x538f('0x8')](),controller[_0x538f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x538f('0xc')]);router[_0x538f('0xd')](_0x538f('0xe'),auth[_0x538f('0x8')](),controller['update']);router[_0x538f('0xf')](_0x538f('0xe'),auth[_0x538f('0x8')](),controller[_0x538f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7a2c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x4c51f2,_0x4ef78e){_0x4c51f2=_0x4c51f2-0x0;var _0x4d5f5b=_0x7a2c[_0x4c51f2];return _0x4d5f5b;};'use strict';var multer=require(_0xc7a2('0x0'));var util=require('util');var path=require(_0xc7a2('0x1'));var timeout=require(_0xc7a2('0x2'));var express=require(_0xc7a2('0x3'));var router=express[_0xc7a2('0x4')]();var fs_extra=require(_0xc7a2('0x5'));var auth=require(_0xc7a2('0x6'));var interaction=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var controller=require('./voiceDialReport.controller');router[_0xc7a2('0x9')]('/',auth[_0xc7a2('0xa')](),controller['index']);router['get']('/describe',auth[_0xc7a2('0xa')](),controller[_0xc7a2('0xb')]);router[_0xc7a2('0x9')](_0xc7a2('0xc'),auth['isAuthenticated'](),controller[_0xc7a2('0xd')]);router[_0xc7a2('0xe')]('/',auth[_0xc7a2('0xa')](),controller['create']);router[_0xc7a2('0xf')]('/:id',auth[_0xc7a2('0xa')](),controller[_0xc7a2('0x10')]);router[_0xc7a2('0x11')]('/:id',auth[_0xc7a2('0xa')](),controller[_0xc7a2('0x12')]);module[_0xc7a2('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 4f3b4b4..8b3f120 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 _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x372b48,_0x48ed7a){var _0x2d615d=function(_0x1f4f94){while(--_0x1f4f94){_0x372b48['push'](_0x372b48['shift']());}};_0x2d615d(++_0x48ed7a);}(_0x55ca,0x126));var _0xa55c=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x55ca[_0x5e2751];return _0x139a39;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file +var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x27ab9d,_0x583f97){var _0x575fb0=function(_0x5a7bff){while(--_0x5a7bff){_0x27ab9d['push'](_0x27ab9d['shift']());}};_0x575fb0(++_0x583f97);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x24ca[_0x2c1dcd];return _0x158ce5;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ee9894a..989fe25 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 _0xa49a=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','include','findAll','catch','show','params','includeAll','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xa49a,0x1ee));var _0xaa49=function(_0xd36a51,_0x37b0d0){_0xd36a51=_0xd36a51-0x0;var _0x18295d=_0xa49a[_0xd36a51];return _0x18295d;};'use strict';var emlformat=require(_0xaa49('0x0'));var rimraf=require(_0xaa49('0x1'));var zipdir=require(_0xaa49('0x2'));var jsonpatch=require(_0xaa49('0x3'));var rp=require(_0xaa49('0x4'));var moment=require(_0xaa49('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaa49('0x6'));var util=require(_0xaa49('0x7'));var path=require(_0xaa49('0x8'));var sox=require('sox');var csv=require(_0xaa49('0x9'));var ejs=require(_0xaa49('0xa'));var fs=require('fs');var fs_extra=require(_0xaa49('0xb'));var _=require(_0xaa49('0xc'));var squel=require(_0xaa49('0xd'));var crypto=require('crypto');var jsforce=require(_0xaa49('0xe'));var deskjs=require(_0xaa49('0xf'));var toCsv=require(_0xaa49('0x9'));var querystring=require(_0xaa49('0x10'));var Papa=require('papaparse');var Redis=require(_0xaa49('0x11'));var authService=require(_0xaa49('0x12'));var qs=require(_0xaa49('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa49('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xaa49('0x15'));var config=require(_0xaa49('0x16'));var licenseUtil=require(_0xaa49('0x17'));var db=require(_0xaa49('0x18'))['db'];function respondWithStatusCode(_0x18a742,_0x439258){_0x439258=_0x439258||0xcc;return function(_0x35b094){if(_0x35b094){return _0x18a742[_0xaa49('0x19')](_0x439258);}return _0x18a742[_0xaa49('0x1a')](_0x439258)['end']();};}function respondWithResult(_0x2f959b,_0x2fdb7e){_0x2fdb7e=_0x2fdb7e||0xc8;return function(_0x475964){if(_0x475964){return _0x2f959b[_0xaa49('0x1a')](_0x2fdb7e)['json'](_0x475964);}};}function respondWithFilteredResult(_0x46b3f3,_0x2a1f1c){return function(_0x2ca84f){if(_0x2ca84f){var _0x21e3ec=typeof _0x2a1f1c[_0xaa49('0x1b')]===_0xaa49('0x1c')&&typeof _0x2a1f1c[_0xaa49('0x1d')]===_0xaa49('0x1c');var _0x562fcf=_0x2ca84f['count'];var _0x20b9d3=_0x21e3ec?0x0:_0x2a1f1c[_0xaa49('0x1b')];var _0x256ddd=_0x21e3ec?_0x2ca84f[_0xaa49('0x1e')]:_0x2a1f1c[_0xaa49('0x1b')]+_0x2a1f1c['limit'];var _0x51ab6d;if(_0x256ddd>=_0x562fcf){_0x256ddd=_0x562fcf;_0x51ab6d=0xc8;}else{_0x51ab6d=0xce;}_0x46b3f3[_0xaa49('0x1a')](_0x51ab6d);return _0x46b3f3[_0xaa49('0x1f')](_0xaa49('0x20'),_0x20b9d3+'-'+_0x256ddd+'/'+_0x562fcf)[_0xaa49('0x21')](_0x2ca84f);}return null;};}function patchUpdates(_0x1b41a2){return function(_0x4b25df){try{jsonpatch['apply'](_0x4b25df,_0x1b41a2,!![]);}catch(_0x22fbb7){return BPromise[_0xaa49('0x22')](_0x22fbb7);}return _0x4b25df[_0xaa49('0x23')]();};}function saveUpdates(_0xa5e294,_0x25713f){return function(_0x596740){if(_0x596740){return _0x596740[_0xaa49('0x24')](_0xa5e294)[_0xaa49('0x25')](function(_0x5e663a){return _0x5e663a;});}return null;};}function removeEntity(_0x25dbe3,_0x2ca68e){return function(_0x469932){if(_0x469932){return _0x469932[_0xaa49('0x26')]()[_0xaa49('0x25')](function(){_0x25dbe3[_0xaa49('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148c3e,_0x5da9f1){return function(_0x4a2e07){if(!_0x4a2e07){_0x148c3e[_0xaa49('0x19')](0x194);}return _0x4a2e07;};}function handleError(_0x4d6bac,_0x4f49b7){_0x4f49b7=_0x4f49b7||0x1f4;return function(_0x44215e){logger['error'](_0x44215e[_0xaa49('0x27')]);if(_0x44215e[_0xaa49('0x28')]){delete _0x44215e[_0xaa49('0x28')];}_0x4d6bac[_0xaa49('0x1a')](_0x4f49b7)[_0xaa49('0x29')](_0x44215e);};}exports[_0xaa49('0x2a')]=function(_0x246362,_0x30353d){var _0x5d4d5f={},_0x10496e={},_0x1cd33a={'count':0x0,'rows':[]};var _0x171010=_[_0xaa49('0x2b')](db[_0xaa49('0x2c')][_0xaa49('0x2d')],function(_0x5eb7ea){return{'name':_0x5eb7ea['fieldName'],'type':_0x5eb7ea[_0xaa49('0x2e')][_0xaa49('0x2f')]};});_0x10496e[_0xaa49('0x30')]=_[_0xaa49('0x2b')](_0x171010,_0xaa49('0x28'));_0x10496e[_0xaa49('0x31')]=_[_0xaa49('0x32')](_0x246362[_0xaa49('0x31')]);_0x10496e[_0xaa49('0x33')]=_[_0xaa49('0x34')](_0x10496e[_0xaa49('0x30')],_0x10496e['query']);_0x5d4d5f[_0xaa49('0x35')]=_['intersection'](_0x10496e['model'],qs['fields'](_0x246362[_0xaa49('0x31')][_0xaa49('0x36')]));_0x5d4d5f[_0xaa49('0x35')]=_0x5d4d5f[_0xaa49('0x35')][_0xaa49('0x37')]?_0x5d4d5f[_0xaa49('0x35')]:_0x10496e['model'];if(!_0x246362[_0xaa49('0x31')][_0xaa49('0x38')]('nolimit')){_0x5d4d5f[_0xaa49('0x1d')]=qs[_0xaa49('0x1d')](_0x246362['query']['limit']);_0x5d4d5f[_0xaa49('0x1b')]=qs['offset'](_0x246362[_0xaa49('0x31')]['offset']);}_0x5d4d5f['order']=qs['sort'](_0x246362[_0xaa49('0x31')][_0xaa49('0x39')]);_0x5d4d5f[_0xaa49('0x3a')]=qs[_0xaa49('0x33')](_['pick'](_0x246362[_0xaa49('0x31')],_0x10496e[_0xaa49('0x33')]),_0x171010);if(_0x246362[_0xaa49('0x31')][_0xaa49('0x3b')]){_0x5d4d5f[_0xaa49('0x3a')]=_['merge'](_0x5d4d5f[_0xaa49('0x3a')],{'$or':_[_0xaa49('0x2b')](_0x171010,function(_0x18d715){if(_0x18d715[_0xaa49('0x2e')]!==_0xaa49('0x3c')){var _0x383e52={};_0x383e52[_0x18d715['name']]={'$like':'%'+_0x246362[_0xaa49('0x31')][_0xaa49('0x3b')]+'%'};return _0x383e52;}})});}_0x5d4d5f=_['merge']({},_0x5d4d5f,_0x246362['options']);var _0x4784f0={'where':_0x5d4d5f[_0xaa49('0x3a')]};return db[_0xaa49('0x2c')][_0xaa49('0x1e')](_0x4784f0)[_0xaa49('0x25')](function(_0x5bcc39){_0x1cd33a[_0xaa49('0x1e')]=_0x5bcc39;if(_0x246362[_0xaa49('0x31')]['includeAll']){_0x5d4d5f[_0xaa49('0x3d')]=[{'all':!![]}];}return db[_0xaa49('0x2c')][_0xaa49('0x3e')](_0x5d4d5f);})['then'](function(_0x64ca19){_0x1cd33a['rows']=_0x64ca19;return _0x1cd33a;})['then'](respondWithFilteredResult(_0x30353d,_0x5d4d5f))[_0xaa49('0x3f')](handleError(_0x30353d,null));};exports[_0xaa49('0x40')]=function(_0x3cacf5,_0x27e0b9){var _0x103967={'raw':!![],'where':{'id':_0x3cacf5[_0xaa49('0x41')]['id']}},_0x496f1f={};_0x496f1f['model']=_[_0xaa49('0x32')](db['VoiceDialReport']['rawAttributes']);_0x496f1f[_0xaa49('0x31')]=_[_0xaa49('0x32')](_0x3cacf5[_0xaa49('0x31')]);_0x496f1f['filters']=_['intersection'](_0x496f1f[_0xaa49('0x30')],_0x496f1f['query']);_0x103967[_0xaa49('0x35')]=_[_0xaa49('0x34')](_0x496f1f[_0xaa49('0x30')],qs[_0xaa49('0x36')](_0x3cacf5[_0xaa49('0x31')][_0xaa49('0x36')]));_0x103967['attributes']=_0x103967['attributes'][_0xaa49('0x37')]?_0x103967['attributes']:_0x496f1f[_0xaa49('0x30')];if(_0x3cacf5[_0xaa49('0x31')][_0xaa49('0x42')]){_0x103967['include']=[{'all':!![]}];}_0x103967=_[_0xaa49('0x43')]({},_0x103967,_0x3cacf5[_0xaa49('0x44')]);return db[_0xaa49('0x2c')][_0xaa49('0x45')](_0x103967)[_0xaa49('0x25')](handleEntityNotFound(_0x27e0b9,null))[_0xaa49('0x25')](respondWithResult(_0x27e0b9,null))[_0xaa49('0x3f')](handleError(_0x27e0b9,null));};exports[_0xaa49('0x46')]=function(_0x42f2cf,_0x1977ca){return db[_0xaa49('0x2c')][_0xaa49('0x46')](_0x42f2cf[_0xaa49('0x47')],{})[_0xaa49('0x25')](respondWithResult(_0x1977ca,0xc9))[_0xaa49('0x3f')](handleError(_0x1977ca,null));};exports[_0xaa49('0x24')]=function(_0x57edca,_0x58c4bc){if(_0x57edca[_0xaa49('0x47')]['id']){delete _0x57edca[_0xaa49('0x47')]['id'];}return db[_0xaa49('0x2c')][_0xaa49('0x45')]({'where':{'id':_0x57edca['params']['id']}})[_0xaa49('0x25')](handleEntityNotFound(_0x58c4bc,null))[_0xaa49('0x25')](saveUpdates(_0x57edca[_0xaa49('0x47')],null))['then'](respondWithResult(_0x58c4bc,null))['catch'](handleError(_0x58c4bc,null));};exports[_0xaa49('0x26')]=function(_0x167371,_0x5e85ae){return db[_0xaa49('0x2c')][_0xaa49('0x45')]({'where':{'id':_0x167371[_0xaa49('0x41')]['id']}})[_0xaa49('0x25')](handleEntityNotFound(_0x5e85ae,null))[_0xaa49('0x25')](removeEntity(_0x5e85ae,null))[_0xaa49('0x3f')](handleError(_0x5e85ae,null));};exports[_0xaa49('0x48')]=function(_0x2be814,_0x414c04){return db['VoiceDialReport'][_0xaa49('0x48')]()['then'](respondWithResult(_0x414c04,null))[_0xaa49('0x3f')](handleError(_0x414c04,null));}; \ No newline at end of file +var _0x82ee=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x1b2808,_0x35a0dc){var _0x2ca622=function(_0x43a52c){while(--_0x43a52c){_0x1b2808['push'](_0x1b2808['shift']());}};_0x2ca622(++_0x35a0dc);}(_0x82ee,0xc0));var _0xe82e=function(_0x103c87,_0x5ac407){_0x103c87=_0x103c87-0x0;var _0x2c1d1b=_0x82ee[_0x103c87];return _0x2c1d1b;};'use strict';var emlformat=require(_0xe82e('0x0'));var rimraf=require(_0xe82e('0x1'));var zipdir=require(_0xe82e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe82e('0x3'));var Mustache=require(_0xe82e('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe82e('0x5'));var csv=require(_0xe82e('0x6'));var ejs=require(_0xe82e('0x7'));var fs=require('fs');var fs_extra=require(_0xe82e('0x8'));var _=require(_0xe82e('0x9'));var squel=require(_0xe82e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe82e('0xb'));var toCsv=require(_0xe82e('0x6'));var querystring=require(_0xe82e('0xc'));var Papa=require(_0xe82e('0xd'));var Redis=require('ioredis');var authService=require(_0xe82e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe82e('0xf'));var hardwareService=require(_0xe82e('0x10'));var logger=require(_0xe82e('0x11'))(_0xe82e('0x12'));var utils=require(_0xe82e('0x13'));var config=require(_0xe82e('0x14'));var licenseUtil=require(_0xe82e('0x15'));var db=require(_0xe82e('0x16'))['db'];function respondWithStatusCode(_0x265112,_0x2cfaab){_0x2cfaab=_0x2cfaab||0xcc;return function(_0x29b647){if(_0x29b647){return _0x265112[_0xe82e('0x17')](_0x2cfaab);}return _0x265112[_0xe82e('0x18')](_0x2cfaab)[_0xe82e('0x19')]();};}function respondWithResult(_0x562e94,_0x260223){_0x260223=_0x260223||0xc8;return function(_0x3ceabc){if(_0x3ceabc){return _0x562e94[_0xe82e('0x18')](_0x260223)[_0xe82e('0x1a')](_0x3ceabc);}};}function respondWithFilteredResult(_0x12c290,_0x1126c3){return function(_0x125183){if(_0x125183){var _0x5d66a4=typeof _0x1126c3[_0xe82e('0x1b')]===_0xe82e('0x1c')&&typeof _0x1126c3[_0xe82e('0x1d')]===_0xe82e('0x1c');var _0x307c0a=_0x125183['count'];var _0x3ea88d=_0x5d66a4?0x0:_0x1126c3[_0xe82e('0x1b')];var _0xf77efd=_0x5d66a4?_0x125183['count']:_0x1126c3[_0xe82e('0x1b')]+_0x1126c3[_0xe82e('0x1d')];var _0x2c89b5;if(_0xf77efd>=_0x307c0a){_0xf77efd=_0x307c0a;_0x2c89b5=0xc8;}else{_0x2c89b5=0xce;}_0x12c290['status'](_0x2c89b5);return _0x12c290['set'](_0xe82e('0x1e'),_0x3ea88d+'-'+_0xf77efd+'/'+_0x307c0a)['json'](_0x125183);}return null;};}function patchUpdates(_0x2142cc){return function(_0x7acf5e){try{jsonpatch[_0xe82e('0x1f')](_0x7acf5e,_0x2142cc,!![]);}catch(_0x57ae73){return BPromise[_0xe82e('0x20')](_0x57ae73);}return _0x7acf5e['save']();};}function saveUpdates(_0x5f0860,_0xa77bbc){return function(_0x1ca697){if(_0x1ca697){return _0x1ca697[_0xe82e('0x21')](_0x5f0860)[_0xe82e('0x22')](function(_0x2bf65b){return _0x2bf65b;});}return null;};}function removeEntity(_0x32720b,_0x27c4a1){return function(_0x1e11d7){if(_0x1e11d7){return _0x1e11d7[_0xe82e('0x23')]()[_0xe82e('0x22')](function(){_0x32720b[_0xe82e('0x18')](0xcc)[_0xe82e('0x19')]();});}};}function handleEntityNotFound(_0x1f9d8d,_0x3fc530){return function(_0x4dff09){if(!_0x4dff09){_0x1f9d8d[_0xe82e('0x17')](0x194);}return _0x4dff09;};}function handleError(_0x333268,_0x5558b4){_0x5558b4=_0x5558b4||0x1f4;return function(_0x5d86a7){logger[_0xe82e('0x24')](_0x5d86a7[_0xe82e('0x25')]);if(_0x5d86a7[_0xe82e('0x26')]){delete _0x5d86a7[_0xe82e('0x26')];}_0x333268[_0xe82e('0x18')](_0x5558b4)[_0xe82e('0x27')](_0x5d86a7);};}exports[_0xe82e('0x28')]=function(_0x313afe,_0x2c789d){var _0x13892c={},_0x23e418={},_0x455f52={'count':0x0,'rows':[]};var _0x1667d9=_['map'](db[_0xe82e('0x29')][_0xe82e('0x2a')],function(_0x3d1dc8){return{'name':_0x3d1dc8[_0xe82e('0x2b')],'type':_0x3d1dc8[_0xe82e('0x2c')][_0xe82e('0x2d')]};});_0x23e418[_0xe82e('0x2e')]=_[_0xe82e('0x2f')](_0x1667d9,_0xe82e('0x26'));_0x23e418[_0xe82e('0x30')]=_[_0xe82e('0x31')](_0x313afe[_0xe82e('0x30')]);_0x23e418[_0xe82e('0x32')]=_[_0xe82e('0x33')](_0x23e418[_0xe82e('0x2e')],_0x23e418[_0xe82e('0x30')]);_0x13892c[_0xe82e('0x34')]=_[_0xe82e('0x33')](_0x23e418[_0xe82e('0x2e')],qs[_0xe82e('0x35')](_0x313afe[_0xe82e('0x30')][_0xe82e('0x35')]));_0x13892c['attributes']=_0x13892c[_0xe82e('0x34')][_0xe82e('0x36')]?_0x13892c['attributes']:_0x23e418['model'];if(!_0x313afe[_0xe82e('0x30')]['hasOwnProperty'](_0xe82e('0x37'))){_0x13892c[_0xe82e('0x1d')]=qs[_0xe82e('0x1d')](_0x313afe[_0xe82e('0x30')][_0xe82e('0x1d')]);_0x13892c['offset']=qs['offset'](_0x313afe['query'][_0xe82e('0x1b')]);}_0x13892c[_0xe82e('0x38')]=qs[_0xe82e('0x39')](_0x313afe[_0xe82e('0x30')][_0xe82e('0x39')]);_0x13892c[_0xe82e('0x3a')]=qs[_0xe82e('0x32')](_[_0xe82e('0x3b')](_0x313afe[_0xe82e('0x30')],_0x23e418[_0xe82e('0x32')]),_0x1667d9);if(_0x313afe['query'][_0xe82e('0x3c')]){_0x13892c[_0xe82e('0x3a')]=_[_0xe82e('0x3d')](_0x13892c['where'],{'$or':_[_0xe82e('0x2f')](_0x1667d9,function(_0x1f67a3){if(_0x1f67a3[_0xe82e('0x2c')]!==_0xe82e('0x3e')){var _0x5a6882={};_0x5a6882[_0x1f67a3[_0xe82e('0x26')]]={'$like':'%'+_0x313afe[_0xe82e('0x30')][_0xe82e('0x3c')]+'%'};return _0x5a6882;}})});}_0x13892c=_[_0xe82e('0x3d')]({},_0x13892c,_0x313afe['options']);var _0x13b222={'where':_0x13892c[_0xe82e('0x3a')]};return db['VoiceDialReport']['count'](_0x13b222)[_0xe82e('0x22')](function(_0x3f77bb){_0x455f52['count']=_0x3f77bb;if(_0x313afe['query'][_0xe82e('0x3f')]){_0x13892c[_0xe82e('0x40')]=[{'all':!![]}];}return db[_0xe82e('0x29')][_0xe82e('0x41')](_0x13892c);})[_0xe82e('0x22')](function(_0x399095){_0x455f52[_0xe82e('0x42')]=_0x399095;return _0x455f52;})['then'](respondWithFilteredResult(_0x2c789d,_0x13892c))[_0xe82e('0x43')](handleError(_0x2c789d,null));};exports[_0xe82e('0x44')]=function(_0x206fa9,_0x262439){var _0xa96fa0={'raw':!![],'where':{'id':_0x206fa9[_0xe82e('0x45')]['id']}},_0x4f59d7={};_0x4f59d7[_0xe82e('0x2e')]=_[_0xe82e('0x31')](db[_0xe82e('0x29')][_0xe82e('0x2a')]);_0x4f59d7['query']=_[_0xe82e('0x31')](_0x206fa9[_0xe82e('0x30')]);_0x4f59d7[_0xe82e('0x32')]=_[_0xe82e('0x33')](_0x4f59d7[_0xe82e('0x2e')],_0x4f59d7[_0xe82e('0x30')]);_0xa96fa0[_0xe82e('0x34')]=_[_0xe82e('0x33')](_0x4f59d7['model'],qs[_0xe82e('0x35')](_0x206fa9['query'][_0xe82e('0x35')]));_0xa96fa0['attributes']=_0xa96fa0[_0xe82e('0x34')][_0xe82e('0x36')]?_0xa96fa0[_0xe82e('0x34')]:_0x4f59d7[_0xe82e('0x2e')];if(_0x206fa9[_0xe82e('0x30')][_0xe82e('0x3f')]){_0xa96fa0[_0xe82e('0x40')]=[{'all':!![]}];}_0xa96fa0=_[_0xe82e('0x3d')]({},_0xa96fa0,_0x206fa9['options']);return db[_0xe82e('0x29')]['find'](_0xa96fa0)[_0xe82e('0x22')](handleEntityNotFound(_0x262439,null))[_0xe82e('0x22')](respondWithResult(_0x262439,null))[_0xe82e('0x43')](handleError(_0x262439,null));};exports[_0xe82e('0x46')]=function(_0x10bdc9,_0x6ced76){return db[_0xe82e('0x29')][_0xe82e('0x46')](_0x10bdc9['body'],{})[_0xe82e('0x22')](respondWithResult(_0x6ced76,0xc9))[_0xe82e('0x43')](handleError(_0x6ced76,null));};exports[_0xe82e('0x21')]=function(_0x42b167,_0x2ee07e){if(_0x42b167[_0xe82e('0x47')]['id']){delete _0x42b167[_0xe82e('0x47')]['id'];}return db[_0xe82e('0x29')][_0xe82e('0x48')]({'where':{'id':_0x42b167[_0xe82e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ee07e,null))['then'](saveUpdates(_0x42b167[_0xe82e('0x47')],null))[_0xe82e('0x22')](respondWithResult(_0x2ee07e,null))[_0xe82e('0x43')](handleError(_0x2ee07e,null));};exports[_0xe82e('0x23')]=function(_0x3eddd7,_0x4e62c0){return db['VoiceDialReport'][_0xe82e('0x48')]({'where':{'id':_0x3eddd7[_0xe82e('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e62c0,null))[_0xe82e('0x22')](removeEntity(_0x4e62c0,null))[_0xe82e('0x43')](handleError(_0x4e62c0,null));};exports[_0xe82e('0x49')]=function(_0x5c527e,_0x293fb8){return db[_0xe82e('0x29')][_0xe82e('0x49')]()['then'](respondWithResult(_0x293fb8,null))[_0xe82e('0x43')](handleError(_0x293fb8,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9e45f9c..bf63c13 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 _0xeaaa=['uniqueid','lodash','util','../../config/logger','api','request-promise','../../config/environment','define','VoiceDialReport'];(function(_0x5cdb33,_0x2de0be){var _0x496ba6=function(_0x29d8c1){while(--_0x29d8c1){_0x5cdb33['push'](_0x5cdb33['shift']());}};_0x496ba6(++_0x2de0be);}(_0xeaaa,0x13c));var _0xaeaa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeaaa[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xaeaa('0x0'));var util=require(_0xaeaa('0x1'));var logger=require(_0xaeaa('0x2'))(_0xaeaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaeaa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaeaa('0x5'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x18318d,_0x1d1d6c){return _0x18318d[_0xaeaa('0x6')](_0xaeaa('0x7'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xaeaa('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbb=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceDialReport','report_dial'];(function(_0x4e3006,_0x338ef5){var _0x215bda=function(_0x29f761){while(--_0x29f761){_0x4e3006['push'](_0x4e3006['shift']());}};_0x215bda(++_0x338ef5);}(_0x7fbb,0x71));var _0xb7fb=function(_0x3c3168,_0x2f9f9c){_0x3c3168=_0x3c3168-0x0;var _0x34a321=_0x7fbb[_0x3c3168];return _0x34a321;};'use strict';var _=require(_0xb7fb('0x0'));var util=require(_0xb7fb('0x1'));var logger=require(_0xb7fb('0x2'))(_0xb7fb('0x3'));var moment=require(_0xb7fb('0x4'));var BPromise=require(_0xb7fb('0x5'));var rp=require(_0xb7fb('0x6'));var fs=require('fs');var path=require(_0xb7fb('0x7'));var rimraf=require(_0xb7fb('0x8'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0xb7fb('0x9')]=function(_0x27dd57,_0x30207a){return _0x27dd57[_0xb7fb('0xa')](_0xb7fb('0xb'),attributes,{'tableName':_0xb7fb('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb7fb('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 0f7f6ac..76df010 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 _0x67d3=['error','message','result','CreateVoiceDialReport','create','options','raw','stringify','catch','VoiceDialReport','update','body','where','attributes','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1cd8e9,_0x5428a6){var _0x1e9867=function(_0x323749){while(--_0x323749){_0x1cd8e9['push'](_0x1cd8e9['shift']());}};_0x1e9867(++_0x5428a6);}(_0x67d3,0x159));var _0x367d=function(_0x1d28c6,_0x264bef){_0x1d28c6=_0x1d28c6-0x0;var _0x2e8d38=_0x67d3[_0x1d28c6];return _0x2e8d38;};'use strict';var _=require(_0x367d('0x0'));var util=require(_0x367d('0x1'));var moment=require('moment');var BPromise=require(_0x367d('0x2'));var rs=require(_0x367d('0x3'));var fs=require('fs');var Redis=require(_0x367d('0x4'));var db=require(_0x367d('0x5'))['db'];var utils=require(_0x367d('0x6'));var logger=require('../../config/logger')(_0x367d('0x7'));var config=require(_0x367d('0x8'));var jayson=require(_0x367d('0x9'));var client=jayson['client'][_0x367d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fd447,_0x120992,_0x4e1661){return new BPromise(function(_0x179578,_0x5c775f){return client[_0x367d('0xb')](_0x4fd447,_0x4e1661)[_0x367d('0xc')](function(_0x389233){logger[_0x367d('0xd')](_0x367d('0xe'),_0x120992,'request\x20sent');logger[_0x367d('0xf')](_0x367d('0x10'),_0x120992,_0x367d('0x11'),JSON['stringify'](_0x389233));if(_0x389233[_0x367d('0x12')]){if(_0x389233[_0x367d('0x12')]['code']===0x1f4){logger[_0x367d('0x12')](_0x367d('0xe'),_0x120992,_0x389233[_0x367d('0x12')][_0x367d('0x13')]);return _0x5c775f(_0x389233['error'][_0x367d('0x13')]);}logger[_0x367d('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x120992,_0x389233[_0x367d('0x12')]['message']);return _0x179578(_0x389233['error'][_0x367d('0x13')]);}else{logger[_0x367d('0xd')](_0x367d('0xe'),_0x120992,'request\x20sent');_0x179578(_0x389233[_0x367d('0x14')][_0x367d('0x13')]);}})['catch'](function(_0x14064f){logger[_0x367d('0x12')](_0x367d('0xe'),_0x120992,_0x14064f);_0x5c775f(_0x14064f);});});}exports[_0x367d('0x15')]=function(_0x58089f){var _0x25cad6=this;return new Promise(function(_0x58ef23,_0x361cb4){return db['VoiceDialReport'][_0x367d('0x16')](_0x58089f['body'],{'raw':_0x58089f[_0x367d('0x17')]?_0x58089f['options'][_0x367d('0x18')]===undefined?!![]:![]:!![]})[_0x367d('0xc')](function(_0x30669c){logger[_0x367d('0xd')](_0x367d('0x15'),_0x58089f);logger[_0x367d('0xf')](_0x367d('0x15'),_0x58089f,JSON[_0x367d('0x19')](_0x30669c));_0x58ef23(_0x30669c);})[_0x367d('0x1a')](function(_0x427dbd){logger[_0x367d('0x12')](_0x367d('0x15'),_0x427dbd['message'],_0x58089f);_0x361cb4(_0x25cad6['error'](0x1f4,_0x427dbd['message']));});});};exports['UpdateVoiceDialReport']=function(_0x4d0201){var _0x189003=this;return new Promise(function(_0x4c7859,_0x1dbe27){return db[_0x367d('0x1b')][_0x367d('0x1c')](_0x4d0201[_0x367d('0x1d')],{'raw':_0x4d0201[_0x367d('0x17')]?_0x4d0201['options'][_0x367d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d0201[_0x367d('0x17')]?_0x4d0201[_0x367d('0x17')][_0x367d('0x1e')]||null:null,'attributes':_0x4d0201[_0x367d('0x17')]?_0x4d0201[_0x367d('0x17')][_0x367d('0x1f')]||null:null,'limit':_0x4d0201[_0x367d('0x17')]?_0x4d0201[_0x367d('0x17')]['limit']||null:null})[_0x367d('0xc')](function(_0x420ffc){logger[_0x367d('0xd')](_0x367d('0x20'),_0x4d0201);logger['debug'](_0x367d('0x20'),_0x4d0201,JSON['stringify'](_0x420ffc));_0x4c7859(_0x420ffc);})['catch'](function(_0x38ab76){logger[_0x367d('0x12')](_0x367d('0x20'),_0x38ab76['message'],_0x4d0201);_0x1dbe27(_0x189003[_0x367d('0x12')](0x1f4,_0x38ab76[_0x367d('0x13')]));});});}; \ No newline at end of file +var _0xd8e8=['message','result','VoiceDialReport','CreateVoiceDialReport','stringify','UpdateVoiceDialReport','body','options','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','debug','error','code'];(function(_0x52121d,_0x1d1704){var _0x448627=function(_0x495bf0){while(--_0x495bf0){_0x52121d['push'](_0x52121d['shift']());}};_0x448627(++_0x1d1704);}(_0xd8e8,0x168));var _0x8d8e=function(_0x3620f1,_0x44ea5b){_0x3620f1=_0x3620f1-0x0;var _0x2e3dcc=_0xd8e8[_0x3620f1];return _0x2e3dcc;};'use strict';var _=require(_0x8d8e('0x0'));var util=require(_0x8d8e('0x1'));var moment=require(_0x8d8e('0x2'));var BPromise=require(_0x8d8e('0x3'));var rs=require(_0x8d8e('0x4'));var fs=require('fs');var Redis=require(_0x8d8e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d8e('0x6'));var logger=require(_0x8d8e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8d8e('0x8'));var client=jayson[_0x8d8e('0x9')][_0x8d8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562cdb,_0x58a7b3,_0x151fa7){return new BPromise(function(_0x5ae18c,_0x104269){return client['request'](_0x562cdb,_0x151fa7)[_0x8d8e('0xb')](function(_0x2a8f52){logger[_0x8d8e('0xc')](_0x8d8e('0xd'),_0x58a7b3,'request\x20sent');logger[_0x8d8e('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x58a7b3,'request\x20sent',JSON['stringify'](_0x2a8f52));if(_0x2a8f52[_0x8d8e('0xf')]){if(_0x2a8f52[_0x8d8e('0xf')][_0x8d8e('0x10')]===0x1f4){logger['error'](_0x8d8e('0xd'),_0x58a7b3,_0x2a8f52[_0x8d8e('0xf')][_0x8d8e('0x11')]);return _0x104269(_0x2a8f52[_0x8d8e('0xf')][_0x8d8e('0x11')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x58a7b3,_0x2a8f52['error']['message']);return _0x5ae18c(_0x2a8f52[_0x8d8e('0xf')][_0x8d8e('0x11')]);}else{logger[_0x8d8e('0xc')](_0x8d8e('0xd'),_0x58a7b3,'request\x20sent');_0x5ae18c(_0x2a8f52[_0x8d8e('0x12')][_0x8d8e('0x11')]);}})['catch'](function(_0x3341f2){logger[_0x8d8e('0xf')](_0x8d8e('0xd'),_0x58a7b3,_0x3341f2);_0x104269(_0x3341f2);});});}exports['CreateVoiceDialReport']=function(_0x4b09da){var _0x2700b2=this;return new Promise(function(_0x1c14c2,_0x293e60){return db[_0x8d8e('0x13')]['create'](_0x4b09da['body'],{'raw':_0x4b09da['options']?_0x4b09da['options']['raw']===undefined?!![]:![]:!![]})[_0x8d8e('0xb')](function(_0xe73bb0){logger[_0x8d8e('0xc')](_0x8d8e('0x14'),_0x4b09da);logger[_0x8d8e('0xe')](_0x8d8e('0x14'),_0x4b09da,JSON[_0x8d8e('0x15')](_0xe73bb0));_0x1c14c2(_0xe73bb0);})['catch'](function(_0x978cec){logger[_0x8d8e('0xf')](_0x8d8e('0x14'),_0x978cec[_0x8d8e('0x11')],_0x4b09da);_0x293e60(_0x2700b2['error'](0x1f4,_0x978cec[_0x8d8e('0x11')]));});});};exports[_0x8d8e('0x16')]=function(_0x2237d4){var _0x40aad0=this;return new Promise(function(_0x504df9,_0x588781){return db['VoiceDialReport']['update'](_0x2237d4[_0x8d8e('0x17')],{'raw':_0x2237d4[_0x8d8e('0x18')]?_0x2237d4[_0x8d8e('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2237d4['options']?_0x2237d4[_0x8d8e('0x18')][_0x8d8e('0x19')]||null:null,'attributes':_0x2237d4[_0x8d8e('0x18')]?_0x2237d4[_0x8d8e('0x18')][_0x8d8e('0x1a')]||null:null,'limit':_0x2237d4['options']?_0x2237d4['options'][_0x8d8e('0x1b')]||null:null})['then'](function(_0x28ab46){logger[_0x8d8e('0xc')](_0x8d8e('0x16'),_0x2237d4);logger[_0x8d8e('0xe')]('UpdateVoiceDialReport',_0x2237d4,JSON['stringify'](_0x28ab46));_0x504df9(_0x28ab46);})[_0x8d8e('0x1c')](function(_0x3d256f){logger['error']('UpdateVoiceDialReport',_0x3d256f[_0x8d8e('0x11')],_0x2237d4);_0x588781(_0x40aad0[_0x8d8e('0xf')](0x1f4,_0x3d256f[_0x8d8e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index cf44153..cd1a7dc 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 _0x4d14=['isAuthenticated','index','get','/:id','show','post','/:id/applications','put','update','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller'];(function(_0x4d315c,_0x31bcc2){var _0x3d299d=function(_0xdf8e86){while(--_0xdf8e86){_0x4d315c['push'](_0x4d315c['shift']());}};_0x3d299d(++_0x31bcc2);}(_0x4d14,0x191));var _0x44d1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4d14[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x44d1('0x0'));var util=require('util');var path=require(_0x44d1('0x1'));var timeout=require(_0x44d1('0x2'));var express=require('express');var router=express[_0x44d1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x44d1('0x4'));var interaction=require(_0x44d1('0x5'));var config=require('../../config/environment');var controller=require(_0x44d1('0x6'));router['get']('/',auth[_0x44d1('0x7')](),controller[_0x44d1('0x8')]);router[_0x44d1('0x9')](_0x44d1('0xa'),auth[_0x44d1('0x7')](),controller[_0x44d1('0xb')]);router[_0x44d1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x44d1('0xc')](_0x44d1('0xd'),auth[_0x44d1('0x7')](),controller['addApplications']);router[_0x44d1('0xe')](_0x44d1('0xa'),auth[_0x44d1('0x7')](),controller[_0x44d1('0xf')]);router['delete'](_0x44d1('0xa'),auth[_0x44d1('0x7')](),controller['destroy']);module[_0x44d1('0x10')]=router; \ No newline at end of file +var _0x83ca=['index','/:id','show','post','create','/:id/applications','addApplications','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x83ca,0x69));var _0xa83c=function(_0x35d62c,_0x36f33c){_0x35d62c=_0x35d62c-0x0;var _0xfff963=_0x83ca[_0x35d62c];return _0xfff963;};'use strict';var multer=require(_0xa83c('0x0'));var util=require(_0xa83c('0x1'));var path=require(_0xa83c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa83c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa83c('0x4'));var config=require(_0xa83c('0x5'));var controller=require(_0xa83c('0x6'));router[_0xa83c('0x7')]('/',auth[_0xa83c('0x8')](),controller[_0xa83c('0x9')]);router[_0xa83c('0x7')](_0xa83c('0xa'),auth[_0xa83c('0x8')](),controller[_0xa83c('0xb')]);router[_0xa83c('0xc')]('/',auth['isAuthenticated'](),controller[_0xa83c('0xd')]);router[_0xa83c('0xc')](_0xa83c('0xe'),auth[_0xa83c('0x8')](),controller[_0xa83c('0xf')]);router['put'](_0xa83c('0xa'),auth[_0xa83c('0x8')](),controller['update']);router[_0xa83c('0x10')](_0xa83c('0xa'),auth['isAuthenticated'](),controller[_0xa83c('0x11')]);module[_0xa83c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 49817dc..b274984 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 _0xae94=['exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0xae94,0x186));var _0x4ae9=function(_0x270318,_0x958092){_0x270318=_0x270318-0x0;var _0x2fa0b9=_0xae94[_0x270318];return _0x2fa0b9;};'use strict';var Sequelize=require('sequelize');module[_0x4ae9('0x0')]={'context':{'type':Sequelize[_0x4ae9('0x1')],'allowNull':![],'unique':_0x4ae9('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4ae9('0x1')],'allowNull':![],'unique':_0x4ae9('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x4ae9('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x4ae9('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4ae9('0x3')](_0x4ae9('0x4'),_0x4ae9('0x5'),_0x4ae9('0x6'),'inbound-fax','outbound-fax',_0x4ae9('0x7'),_0x4ae9('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x4ae9('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4ae9('0x9')},'IntervalId':{'type':Sequelize[_0x4ae9('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4ae9('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4ae9('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x4ae9('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x4ae9('0x1')],'defaultValue':_0x4ae9('0xc')},'answer':{'type':Sequelize[_0x4ae9('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x42792c){return this[_0x4ae9('0xd')](_0x4ae9('0xe'));}},'alias':{'type':Sequelize[_0x4ae9('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xec07=['outbound','inbound-fax','system','any','*,*,*,*','INTEGER','wav','BOOLEAN','VIRTUAL','getDataValue','exten','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x308c6a,_0xe04d64){var _0x257b4d=function(_0x31125c){while(--_0x31125c){_0x308c6a['push'](_0x308c6a['shift']());}};_0x257b4d(++_0xe04d64);}(_0xec07,0x1b4));var _0x7ec0=function(_0x2856ba,_0x5b16cd){_0x2856ba=_0x2856ba-0x0;var _0x267f55=_0xec07[_0x2856ba];return _0x267f55;};'use strict';var Sequelize=require('sequelize');module[_0x7ec0('0x0')]={'context':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':![],'unique':_0x7ec0('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':![],'unique':_0x7ec0('0x2')},'priority':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x7ec0('0x2')},'tag':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':![],'defaultValue':_0x7ec0('0x3')},'appdata':{'type':Sequelize[_0x7ec0('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7ec0('0x4')](_0x7ec0('0x5'),_0x7ec0('0x6'),'internal',_0x7ec0('0x7'),'outbound-fax',_0x7ec0('0x8'),_0x7ec0('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x7ec0('0x1')]},'interval':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':![],'defaultValue':_0x7ec0('0xa')},'IntervalId':{'type':Sequelize[_0x7ec0('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7ec0('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7ec0('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x7ec0('0xc')},'answer':{'type':Sequelize[_0x7ec0('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7ec0('0xe')],'get':function(_0x445095){return this[_0x7ec0('0xf')](_0x7ec0('0x10'));}},'alias':{'type':Sequelize[_0x7ec0('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index a4c3f80..41d137b 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 _0xef0e=['userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','inbound','OutboundRoutes','InternalRoutes','internal','filter','value','includes','type','name','then','end','error','send','index','map','VoiceExtension','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','outbound','startsWith','exten','concat','user','UserProfileSection'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0xef0e,0xd3));var _0xeef0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xef0e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xeef0('0x0'));var Redis=require(_0xeef0('0x1'));var qs=require(_0xeef0('0x2'));var logger=require(_0xeef0('0x3'))(_0xeef0('0x4'));var config=require(_0xeef0('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xeef0('0x6')](config[_0xeef0('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xeef0('0x8'))(new Redis(config[_0xeef0('0x7')]));require(_0xeef0('0x9'))[_0xeef0('0xa')](socket);function respondWithStatusCode(_0x580b88,_0x5c3b85){_0x5c3b85=_0x5c3b85||0xcc;return function(_0x3136a8){if(_0x3136a8){return _0x580b88[_0xeef0('0xb')](_0x5c3b85);}return _0x580b88[_0xeef0('0xc')](_0x5c3b85)['end']();};}function respondWithResult(_0x571af4,_0x31a1e7){_0x31a1e7=_0x31a1e7||0xc8;return function(_0x42a8bb){if(_0x42a8bb){return _0x571af4['status'](_0x31a1e7)[_0xeef0('0xd')](_0x42a8bb);}};}function respondWithFilteredResult(_0x1d4389,_0x154c1a){return function(_0x7b0277){if(_0x7b0277){var _0x51fede=typeof _0x154c1a[_0xeef0('0xe')]===_0xeef0('0xf')&&typeof _0x154c1a[_0xeef0('0x10')]===_0xeef0('0xf');var _0x23c589=_0x7b0277[_0xeef0('0x11')];var _0xf3951=_0x51fede?0x0:_0x154c1a['offset'];var _0x2f08ae=_0x51fede?_0x7b0277['count']:_0x154c1a['offset']+_0x154c1a[_0xeef0('0x10')];var _0x419edd;if(_0x2f08ae>=_0x23c589){_0x2f08ae=_0x23c589;_0x419edd=0xc8;}else{_0x419edd=0xce;}_0x1d4389[_0xeef0('0xc')](_0x419edd);return _0x1d4389[_0xeef0('0x12')](_0xeef0('0x13'),_0xf3951+'-'+_0x2f08ae+'/'+_0x23c589)[_0xeef0('0xd')](_0x7b0277);}return null;};}function removeEntity(_0x42e725){return function(_0x42626f){if(_0x42626f){return _0x42626f[_0xeef0('0x14')]()['then'](function(){var _0x1e55e4=_0x42626f[_0xeef0('0x15')]({'plain':!![]});var _0x18aa1d=[{'name':'InboundRoutes','value':_0xeef0('0x16'),'ignore':![]},{'name':_0xeef0('0x17'),'value':'outbound','ignore':![]},{'name':_0xeef0('0x18'),'value':_0xeef0('0x19'),'ignore':![]}];var _0x2ec950=_(_0x18aa1d)[_0xeef0('0x1a')]('ignore')['map'](_0xeef0('0x1b'))[_0xeef0('0x1b')]();if(_[_0xeef0('0x1c')](_0x2ec950,_0x1e55e4[_0xeef0('0x1d')])){return;}var _0x2dc272=_['find'](_0x18aa1d,[_0xeef0('0x1b'),_0x1e55e4[_0xeef0('0x1d')]])[_0xeef0('0x1e')];return db['UserProfileResource']['destroy']({'where':{'type':_0x2dc272,'resourceId':_0x1e55e4['id']}})[_0xeef0('0x1f')](function(){return _0x42626f;});})['then'](function(){_0x42e725[_0xeef0('0xc')](0xcc)[_0xeef0('0x20')]();});}};}function handleEntityNotFound(_0x25145e){return function(_0x23e9ec){if(!_0x23e9ec){_0x25145e[_0xeef0('0xb')](0x194);}return _0x23e9ec;};}function handleError(_0x38026e,_0x3a3c67){_0x3a3c67=_0x3a3c67||0x1f4;return function(_0xd61acc){logger[_0xeef0('0x21')](_0xd61acc['stack']);if(_0xd61acc[_0xeef0('0x1e')]){delete _0xd61acc[_0xeef0('0x1e')];}_0x38026e['status'](_0x3a3c67)[_0xeef0('0x22')](_0xd61acc);};}exports[_0xeef0('0x23')]=function(_0xe2a355,_0x259d84){var _0x41b2e7={},_0x2534a8={},_0x346afe={'count':0x0,'rows':[]};var _0x5a460b=_[_0xeef0('0x24')](db[_0xeef0('0x25')]['rawAttributes'],function(_0x123bdc){return{'name':_0x123bdc[_0xeef0('0x26')],'type':_0x123bdc[_0xeef0('0x1d')][_0xeef0('0x27')]};});_0x2534a8[_0xeef0('0x28')]=_[_0xeef0('0x24')](_0x5a460b,_0xeef0('0x1e'));_0x2534a8[_0xeef0('0x29')]=_[_0xeef0('0x2a')](_0xe2a355[_0xeef0('0x29')]);_0x2534a8[_0xeef0('0x2b')]=_[_0xeef0('0x2c')](_0x2534a8[_0xeef0('0x28')],_0x2534a8[_0xeef0('0x29')]);_0x41b2e7[_0xeef0('0x2d')]=_[_0xeef0('0x2c')](_0x2534a8[_0xeef0('0x28')],qs[_0xeef0('0x2e')](_0xe2a355['query'][_0xeef0('0x2e')]));_0x41b2e7[_0xeef0('0x2d')]=_0x41b2e7[_0xeef0('0x2d')]['length']?_0x41b2e7[_0xeef0('0x2d')]:_0x2534a8[_0xeef0('0x28')];if(!_0xe2a355['query'][_0xeef0('0x2f')](_0xeef0('0x30'))){_0x41b2e7[_0xeef0('0x10')]=qs['limit'](_0xe2a355[_0xeef0('0x29')][_0xeef0('0x10')]);_0x41b2e7['offset']=qs[_0xeef0('0xe')](_0xe2a355[_0xeef0('0x29')][_0xeef0('0xe')]);}_0x41b2e7[_0xeef0('0x31')]=qs['sort'](_0xe2a355[_0xeef0('0x29')]['sort']);_0x41b2e7[_0xeef0('0x32')]=qs[_0xeef0('0x2b')](_['pick'](_0xe2a355[_0xeef0('0x29')],_0x2534a8[_0xeef0('0x2b')]),_0x5a460b);if(_0xe2a355[_0xeef0('0x29')][_0xeef0('0x1a')]){_0x41b2e7[_0xeef0('0x32')]=_[_0xeef0('0x33')](_0x41b2e7[_0xeef0('0x32')],{'$or':_[_0xeef0('0x24')](_0x5a460b,function(_0x1c227c){if(_0x1c227c[_0xeef0('0x1d')]!==_0xeef0('0x34')){var _0x4bd0b1={};_0x4bd0b1[_0x1c227c[_0xeef0('0x1e')]]={'$like':'%'+_0xe2a355[_0xeef0('0x29')][_0xeef0('0x1a')]+'%'};return _0x4bd0b1;}})});}_0x41b2e7=_[_0xeef0('0x33')]({},_0x41b2e7,_0xe2a355[_0xeef0('0x35')]);var _0x2a009f={'where':_0x41b2e7['where']};return db[_0xeef0('0x25')][_0xeef0('0x11')](_0x2a009f)['then'](function(_0x2b2496){_0x346afe[_0xeef0('0x11')]=_0x2b2496;if(_0xe2a355[_0xeef0('0x29')]['includeAll']){_0x41b2e7[_0xeef0('0x36')]=[{'all':!![]}];}return db['VoiceExtension'][_0xeef0('0x37')](_0x41b2e7);})[_0xeef0('0x1f')](function(_0x48f1c2){_0x346afe[_0xeef0('0x38')]=_0x48f1c2;return _0x346afe;})[_0xeef0('0x1f')](respondWithFilteredResult(_0x259d84,_0x41b2e7))[_0xeef0('0x39')](handleError(_0x259d84,null));};exports[_0xeef0('0x3a')]=function(_0x31539f,_0x41bd06){var _0x1ad367={'raw':![],'where':{'id':_0x31539f[_0xeef0('0x3b')]['id']}},_0x251821={};_0x251821['model']=_['keys'](db['VoiceExtension']['rawAttributes']);_0x251821['query']=_[_0xeef0('0x2a')](_0x31539f[_0xeef0('0x29')]);_0x251821[_0xeef0('0x2b')]=_[_0xeef0('0x2c')](_0x251821[_0xeef0('0x28')],_0x251821[_0xeef0('0x29')]);_0x1ad367['attributes']=_['intersection'](_0x251821[_0xeef0('0x28')],qs[_0xeef0('0x2e')](_0x31539f[_0xeef0('0x29')][_0xeef0('0x2e')]));_0x1ad367[_0xeef0('0x2d')]=_0x1ad367[_0xeef0('0x2d')][_0xeef0('0x3c')]?_0x1ad367[_0xeef0('0x2d')]:_0x251821['model'];if(_0x31539f['query'][_0xeef0('0x3d')]){_0x1ad367['include']=[{'all':!![]}];}_0x1ad367=_[_0xeef0('0x33')]({},_0x1ad367,_0x31539f[_0xeef0('0x35')]);return db[_0xeef0('0x25')][_0xeef0('0x3e')](_0x1ad367)['then'](handleEntityNotFound(_0x41bd06,null))[_0xeef0('0x1f')](respondWithResult(_0x41bd06,null))[_0xeef0('0x39')](handleError(_0x41bd06,null));};exports[_0xeef0('0x14')]=function(_0x16c4cd,_0x3c6814){return db[_0xeef0('0x25')][_0xeef0('0x3e')]({'where':{'id':_0x16c4cd[_0xeef0('0x3b')]['id']}})[_0xeef0('0x1f')](handleEntityNotFound(_0x3c6814,null))[_0xeef0('0x1f')](removeEntity(_0x3c6814,null))[_0xeef0('0x39')](handleError(_0x3c6814,null));};exports[_0xeef0('0x3f')]=function(_0x1ac03b,_0x252c56){if(_0x1ac03b[_0xeef0('0x40')][_0xeef0('0x1d')]===_0xeef0('0x41')&&!_[_0xeef0('0x42')](_0x1ac03b[_0xeef0('0x40')][_0xeef0('0x43')],'_')){_0x1ac03b[_0xeef0('0x40')][_0xeef0('0x43')]='_'[_0xeef0('0x44')](_0x1ac03b['body']['exten']);}return db[_0xeef0('0x25')][_0xeef0('0x3f')](_0x1ac03b['body'],{'raw':![]})[_0xeef0('0x1f')](function(_0x9700eb){var _0x54d44f=_0x1ac03b[_0xeef0('0x45')][_0xeef0('0x15')]({'plain':!![]});if(!_0x54d44f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54d44f['role']==='user'){var _0x1639ef=_0x9700eb[_0xeef0('0x15')]({'plain':!![]});var _0xf7499=[{'name':'InboundRoutes','value':_0xeef0('0x16')},{'name':_0xeef0('0x17'),'value':'outbound'},{'name':_0xeef0('0x18'),'value':_0xeef0('0x19')}];var _0x313a1f=_['find'](_0xf7499,[_0xeef0('0x1b'),_0x1639ef[_0xeef0('0x1d')]])['name'];return db[_0xeef0('0x46')][_0xeef0('0x3e')]({'where':{'name':_0x313a1f,'userProfileId':_0x54d44f[_0xeef0('0x47')]},'raw':!![]})[_0xeef0('0x1f')](function(_0xee2796){if(_0xee2796&&_0xee2796['autoAssociation']===0x0){return db[_0xeef0('0x48')][_0xeef0('0x3f')]({'name':_0x1639ef[_0xeef0('0x1e')],'resourceId':_0x1639ef['id'],'type':_0xee2796[_0xeef0('0x1e')],'sectionId':_0xee2796['id']},{})[_0xeef0('0x1f')](function(){return _0x9700eb;});}else{return _0x9700eb;}})['catch'](function(_0x13051a){logger[_0xeef0('0x21')](_0xeef0('0x49'),_0x13051a);throw _0x13051a;});}return _0x9700eb;})[_0xeef0('0x1f')](respondWithResult(_0x252c56,0xc9))[_0xeef0('0x39')](handleError(_0x252c56,null));};exports[_0xeef0('0x4a')]=function(_0x1eb05d,_0x3bcd16){if(_0x1eb05d['body']['id']){delete _0x1eb05d[_0xeef0('0x40')]['id'];}return db[_0xeef0('0x25')]['find']({'where':{'id':_0x1eb05d[_0xeef0('0x3b')]['id']}})[_0xeef0('0x1f')](handleEntityNotFound(_0x3bcd16,null))[_0xeef0('0x1f')](function(_0x1151e4){if(_0x1151e4){return db['VoiceExtension'][_0xeef0('0x4a')](_[_0xeef0('0x4b')](_0x1eb05d['body'],['exten',_0xeef0('0x4c'),'description',_0xeef0('0x4d'),_0xeef0('0x4e'),_0xeef0('0x4f'),_0xeef0('0x50')]),{'where':{'context':_0x1151e4[_0xeef0('0x4c')],'exten':_0x1151e4['exten']},'individualHooks':!![]})[_0xeef0('0x1f')](function(_0x1eba53){return _0x1eba53;});}return null;})['then'](respondWithStatusCode(_0x3bcd16,null))[_0xeef0('0x39')](handleError(_0x3bcd16,null));};exports[_0xeef0('0x51')]=function(_0x3f8346,_0x573803){var _0x51e95c=_0x3f8346[_0xeef0('0x3b')]['id'];var _0x567228=_0x3f8346[_0xeef0('0x40')];var _0x32bc82=0xc8;var _0x2f58b9=null;return db[_0xeef0('0x52')][_0xeef0('0x53')]({'isolationLevel':db['sequelize'][_0xeef0('0x54')]['ISOLATION_LEVELS'][_0xeef0('0x55')]},function(_0x68ba0f){return db['VoiceExtension'][_0xeef0('0x56')]({'where':{'id':_0x51e95c},'transaction':_0x68ba0f})[_0xeef0('0x1f')](function(_0x585154){if(_0x585154){return db[_0xeef0('0x25')][_0xeef0('0x14')]({'where':{'VoiceExtensionId':_0x51e95c},'transaction':_0x68ba0f})[_0xeef0('0x1f')](function(){var _0x461feb=_[_0xeef0('0x24')](_0x567228,function(_0x205073){_0x205073[_0xeef0('0x57')]=_0x51e95c;_0x205073[_0xeef0('0x58')]=!![];return _0x205073;});return _0x585154['createRouting'](_0x461feb);})['then'](function(_0x1819da){return db['VoiceExtension'][_0xeef0('0x59')](_0x1819da,{'transaction':_0x68ba0f});});}else{_0x32bc82=0x194;_0x2f58b9=[];}});})[_0xeef0('0x1f')](function(){if(_0x32bc82!==0x194){return db['VoiceExtension'][_0xeef0('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x51e95c},'order':_0xeef0('0x5b')})[_0xeef0('0x1f')](function(_0x3f2249){_0x2f58b9=_0x3f2249;});}})['catch'](function(_0xc517e){_0x32bc82=0x1f4;logger[_0xeef0('0x21')](_0xc517e[_0xeef0('0x5c')]);if(_0xc517e[_0xeef0('0x1e')]){delete _0xc517e[_0xeef0('0x1e')];}_0x2f58b9=_0xc517e;})[_0xeef0('0x5d')](function(){if(_0x2f58b9===null){_0x573803['sendStatus'](_0x32bc82);}else{if(_0x32bc82===0x1f4){_0x573803[_0xeef0('0xc')](_0x32bc82)[_0xeef0('0x22')](_0x2f58b9);}else{_0x573803[_0xeef0('0xc')](_0x32bc82)[_0xeef0('0xd')](_0x2f58b9);}}});}; \ No newline at end of file +var _0x63ac=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','destroy','VoiceExtensionId','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','offset','undefined','count','set','json','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','type','UserProfileResource','stack','name','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','startsWith','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','value','userProfileId','autoAssociation','error'];(function(_0x2329e4,_0x343cdb){var _0x978cc=function(_0x4e961e){while(--_0x4e961e){_0x2329e4['push'](_0x2329e4['shift']());}};_0x978cc(++_0x343cdb);}(_0x63ac,0x129));var _0xc63a=function(_0x1e0d54,_0x46fbec){_0x1e0d54=_0x1e0d54-0x0;var _0x244204=_0x63ac[_0x1e0d54];return _0x244204;};'use strict';var _=require(_0xc63a('0x0'));var Redis=require(_0xc63a('0x1'));var qs=require(_0xc63a('0x2'));var logger=require('../../config/logger')(_0xc63a('0x3'));var config=require(_0xc63a('0x4'));var db=require(_0xc63a('0x5'))['db'];config['redis']=_[_0xc63a('0x6')](config[_0xc63a('0x7')],{'host':_0xc63a('0x8'),'port':0x18eb});var socket=require(_0xc63a('0x9'))(new Redis(config[_0xc63a('0x7')]));require(_0xc63a('0xa'))[_0xc63a('0xb')](socket);function respondWithStatusCode(_0x2dc304,_0x24feb9){_0x24feb9=_0x24feb9||0xcc;return function(_0x2b8090){if(_0x2b8090){return _0x2dc304[_0xc63a('0xc')](_0x24feb9);}return _0x2dc304['status'](_0x24feb9)[_0xc63a('0xd')]();};}function respondWithResult(_0xd9346e,_0x1d4ca5){_0x1d4ca5=_0x1d4ca5||0xc8;return function(_0x17ec7e){if(_0x17ec7e){return _0xd9346e[_0xc63a('0xe')](_0x1d4ca5)['json'](_0x17ec7e);}};}function respondWithFilteredResult(_0x2d663f,_0x5f2775){return function(_0x23cd27){if(_0x23cd27){var _0x3e5059=typeof _0x5f2775[_0xc63a('0xf')]===_0xc63a('0x10')&&typeof _0x5f2775['limit']===_0xc63a('0x10');var _0x182c4b=_0x23cd27[_0xc63a('0x11')];var _0x569947=_0x3e5059?0x0:_0x5f2775[_0xc63a('0xf')];var _0x3c42df=_0x3e5059?_0x23cd27[_0xc63a('0x11')]:_0x5f2775['offset']+_0x5f2775['limit'];var _0x5352ee;if(_0x3c42df>=_0x182c4b){_0x3c42df=_0x182c4b;_0x5352ee=0xc8;}else{_0x5352ee=0xce;}_0x2d663f[_0xc63a('0xe')](_0x5352ee);return _0x2d663f[_0xc63a('0x12')]('Content-Range',_0x569947+'-'+_0x3c42df+'/'+_0x182c4b)[_0xc63a('0x13')](_0x23cd27);}return null;};}function removeEntity(_0x516f73){return function(_0x4abdee){if(_0x4abdee){return _0x4abdee['destroy']()[_0xc63a('0x14')](function(){var _0x3942b5=_0x4abdee[_0xc63a('0x15')]({'plain':!![]});var _0xc91522=[{'name':_0xc63a('0x16'),'value':_0xc63a('0x17'),'ignore':![]},{'name':_0xc63a('0x18'),'value':_0xc63a('0x19'),'ignore':![]},{'name':_0xc63a('0x1a'),'value':_0xc63a('0x1b'),'ignore':![]}];var _0x299c23=_(_0xc91522)[_0xc63a('0x1c')]('ignore')[_0xc63a('0x1d')]('value')['value']();if(_['includes'](_0x299c23,_0x3942b5[_0xc63a('0x1e')])){return;}var _0x3521a3=_['find'](_0xc91522,['value',_0x3942b5['type']])['name'];return db[_0xc63a('0x1f')]['destroy']({'where':{'type':_0x3521a3,'resourceId':_0x3942b5['id']}})[_0xc63a('0x14')](function(){return _0x4abdee;});})[_0xc63a('0x14')](function(){_0x516f73[_0xc63a('0xe')](0xcc)[_0xc63a('0xd')]();});}};}function handleEntityNotFound(_0xc85ac8){return function(_0x2cd596){if(!_0x2cd596){_0xc85ac8[_0xc63a('0xc')](0x194);}return _0x2cd596;};}function handleError(_0x101a76,_0x41c012){_0x41c012=_0x41c012||0x1f4;return function(_0x34743b){logger['error'](_0x34743b[_0xc63a('0x20')]);if(_0x34743b['name']){delete _0x34743b[_0xc63a('0x21')];}_0x101a76[_0xc63a('0xe')](_0x41c012)['send'](_0x34743b);};}exports[_0xc63a('0x22')]=function(_0x21a339,_0x2d3934){var _0x3852c0={},_0x2c8ca8={},_0x45cac1={'count':0x0,'rows':[]};var _0x161ed2=_[_0xc63a('0x1d')](db[_0xc63a('0x23')][_0xc63a('0x24')],function(_0x343d50){return{'name':_0x343d50[_0xc63a('0x25')],'type':_0x343d50[_0xc63a('0x1e')][_0xc63a('0x26')]};});_0x2c8ca8[_0xc63a('0x27')]=_[_0xc63a('0x1d')](_0x161ed2,'name');_0x2c8ca8['query']=_[_0xc63a('0x28')](_0x21a339[_0xc63a('0x29')]);_0x2c8ca8[_0xc63a('0x2a')]=_[_0xc63a('0x2b')](_0x2c8ca8[_0xc63a('0x27')],_0x2c8ca8[_0xc63a('0x29')]);_0x3852c0['attributes']=_['intersection'](_0x2c8ca8[_0xc63a('0x27')],qs['fields'](_0x21a339[_0xc63a('0x29')][_0xc63a('0x2c')]));_0x3852c0[_0xc63a('0x2d')]=_0x3852c0['attributes'][_0xc63a('0x2e')]?_0x3852c0['attributes']:_0x2c8ca8[_0xc63a('0x27')];if(!_0x21a339[_0xc63a('0x29')]['hasOwnProperty'](_0xc63a('0x2f'))){_0x3852c0['limit']=qs['limit'](_0x21a339[_0xc63a('0x29')]['limit']);_0x3852c0[_0xc63a('0xf')]=qs['offset'](_0x21a339[_0xc63a('0x29')]['offset']);}_0x3852c0[_0xc63a('0x30')]=qs['sort'](_0x21a339[_0xc63a('0x29')][_0xc63a('0x31')]);_0x3852c0[_0xc63a('0x32')]=qs[_0xc63a('0x2a')](_['pick'](_0x21a339['query'],_0x2c8ca8[_0xc63a('0x2a')]),_0x161ed2);if(_0x21a339[_0xc63a('0x29')]['filter']){_0x3852c0[_0xc63a('0x32')]=_[_0xc63a('0x33')](_0x3852c0['where'],{'$or':_[_0xc63a('0x1d')](_0x161ed2,function(_0x204fce){if(_0x204fce[_0xc63a('0x1e')]!==_0xc63a('0x34')){var _0x44ee3a={};_0x44ee3a[_0x204fce[_0xc63a('0x21')]]={'$like':'%'+_0x21a339[_0xc63a('0x29')][_0xc63a('0x1c')]+'%'};return _0x44ee3a;}})});}_0x3852c0=_[_0xc63a('0x33')]({},_0x3852c0,_0x21a339[_0xc63a('0x35')]);var _0x262e86={'where':_0x3852c0[_0xc63a('0x32')]};return db['VoiceExtension']['count'](_0x262e86)[_0xc63a('0x14')](function(_0x8642ea){_0x45cac1[_0xc63a('0x11')]=_0x8642ea;if(_0x21a339[_0xc63a('0x29')]['includeAll']){_0x3852c0[_0xc63a('0x36')]=[{'all':!![]}];}return db['VoiceExtension'][_0xc63a('0x37')](_0x3852c0);})['then'](function(_0x40dd4a){_0x45cac1[_0xc63a('0x38')]=_0x40dd4a;return _0x45cac1;})[_0xc63a('0x14')](respondWithFilteredResult(_0x2d3934,_0x3852c0))[_0xc63a('0x39')](handleError(_0x2d3934,null));};exports['show']=function(_0x339ed4,_0x158348){var _0x55765f={'raw':![],'where':{'id':_0x339ed4[_0xc63a('0x3a')]['id']}},_0x3dff52={};_0x3dff52['model']=_[_0xc63a('0x28')](db[_0xc63a('0x23')][_0xc63a('0x24')]);_0x3dff52[_0xc63a('0x29')]=_['keys'](_0x339ed4[_0xc63a('0x29')]);_0x3dff52[_0xc63a('0x2a')]=_['intersection'](_0x3dff52[_0xc63a('0x27')],_0x3dff52[_0xc63a('0x29')]);_0x55765f[_0xc63a('0x2d')]=_[_0xc63a('0x2b')](_0x3dff52[_0xc63a('0x27')],qs['fields'](_0x339ed4[_0xc63a('0x29')][_0xc63a('0x2c')]));_0x55765f[_0xc63a('0x2d')]=_0x55765f[_0xc63a('0x2d')]['length']?_0x55765f[_0xc63a('0x2d')]:_0x3dff52['model'];if(_0x339ed4[_0xc63a('0x29')][_0xc63a('0x3b')]){_0x55765f[_0xc63a('0x36')]=[{'all':!![]}];}_0x55765f=_[_0xc63a('0x33')]({},_0x55765f,_0x339ed4[_0xc63a('0x35')]);return db[_0xc63a('0x23')][_0xc63a('0x3c')](_0x55765f)[_0xc63a('0x14')](handleEntityNotFound(_0x158348,null))[_0xc63a('0x14')](respondWithResult(_0x158348,null))[_0xc63a('0x39')](handleError(_0x158348,null));};exports['destroy']=function(_0x367aef,_0xe59aa5){return db['VoiceExtension']['find']({'where':{'id':_0x367aef[_0xc63a('0x3a')]['id']}})[_0xc63a('0x14')](handleEntityNotFound(_0xe59aa5,null))[_0xc63a('0x14')](removeEntity(_0xe59aa5,null))[_0xc63a('0x39')](handleError(_0xe59aa5,null));};exports[_0xc63a('0x3d')]=function(_0x5d077a,_0x488c95){if(_0x5d077a[_0xc63a('0x3e')][_0xc63a('0x1e')]===_0xc63a('0x19')&&!_[_0xc63a('0x3f')](_0x5d077a['body'][_0xc63a('0x40')],'_')){_0x5d077a['body'][_0xc63a('0x40')]='_'['concat'](_0x5d077a[_0xc63a('0x3e')]['exten']);}return db[_0xc63a('0x23')][_0xc63a('0x3d')](_0x5d077a[_0xc63a('0x3e')],{'raw':![]})[_0xc63a('0x14')](function(_0xc37cf5){var _0x11ab64=_0x5d077a['user']['get']({'plain':!![]});if(!_0x11ab64)throw new Error(_0xc63a('0x41'));if(_0x11ab64['role']===_0xc63a('0x42')){var _0x37d8f2=_0xc37cf5[_0xc63a('0x15')]({'plain':!![]});var _0x43a610=[{'name':_0xc63a('0x16'),'value':'inbound'},{'name':_0xc63a('0x18'),'value':_0xc63a('0x19')},{'name':'InternalRoutes','value':_0xc63a('0x1b')}];var _0xc69cb0=_[_0xc63a('0x3c')](_0x43a610,[_0xc63a('0x43'),_0x37d8f2[_0xc63a('0x1e')]])[_0xc63a('0x21')];return db['UserProfileSection'][_0xc63a('0x3c')]({'where':{'name':_0xc69cb0,'userProfileId':_0x11ab64[_0xc63a('0x44')]},'raw':!![]})[_0xc63a('0x14')](function(_0x5bed53){if(_0x5bed53&&_0x5bed53[_0xc63a('0x45')]===0x0){return db['UserProfileResource'][_0xc63a('0x3d')]({'name':_0x37d8f2[_0xc63a('0x21')],'resourceId':_0x37d8f2['id'],'type':_0x5bed53['name'],'sectionId':_0x5bed53['id']},{})[_0xc63a('0x14')](function(){return _0xc37cf5;});}else{return _0xc37cf5;}})[_0xc63a('0x39')](function(_0x31e06a){logger[_0xc63a('0x46')](_0xc63a('0x47'),_0x31e06a);throw _0x31e06a;});}return _0xc37cf5;})[_0xc63a('0x14')](respondWithResult(_0x488c95,0xc9))[_0xc63a('0x39')](handleError(_0x488c95,null));};exports[_0xc63a('0x48')]=function(_0x25a873,_0x5b7761){if(_0x25a873['body']['id']){delete _0x25a873[_0xc63a('0x3e')]['id'];}return db[_0xc63a('0x23')][_0xc63a('0x3c')]({'where':{'id':_0x25a873[_0xc63a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5b7761,null))[_0xc63a('0x14')](function(_0x5bcc2a){if(_0x5bcc2a){return db[_0xc63a('0x23')][_0xc63a('0x48')](_['pick'](_0x25a873[_0xc63a('0x3e')],[_0xc63a('0x40'),_0xc63a('0x49'),_0xc63a('0x4a'),_0xc63a('0x4b'),_0xc63a('0x4c'),_0xc63a('0x4d'),_0xc63a('0x4e')]),{'where':{'context':_0x5bcc2a['context'],'exten':_0x5bcc2a['exten']},'individualHooks':!![]})[_0xc63a('0x14')](function(_0x193f6f){return _0x193f6f;});}return null;})['then'](respondWithStatusCode(_0x5b7761,null))[_0xc63a('0x39')](handleError(_0x5b7761,null));};exports['addApplications']=function(_0x2326a5,_0x3bf76b){var _0x5befec=_0x2326a5[_0xc63a('0x3a')]['id'];var _0x409ed7=_0x2326a5[_0xc63a('0x3e')];var _0x102a91=0xc8;var _0x1ccaaa=null;return db[_0xc63a('0x4f')][_0xc63a('0x50')]({'isolationLevel':db['sequelize'][_0xc63a('0x51')][_0xc63a('0x52')][_0xc63a('0x53')]},function(_0x3d4d5d){return db['VoiceExtension'][_0xc63a('0x54')]({'where':{'id':_0x5befec},'transaction':_0x3d4d5d})[_0xc63a('0x14')](function(_0x2bdaf8){if(_0x2bdaf8){return db[_0xc63a('0x23')][_0xc63a('0x55')]({'where':{'VoiceExtensionId':_0x5befec},'transaction':_0x3d4d5d})[_0xc63a('0x14')](function(){var _0x55e05b=_[_0xc63a('0x1d')](_0x409ed7,function(_0x52e582){_0x52e582[_0xc63a('0x56')]=_0x5befec;_0x52e582['isApp']=!![];return _0x52e582;});return _0x2bdaf8[_0xc63a('0x57')](_0x55e05b);})[_0xc63a('0x14')](function(_0x37a6fe){return db[_0xc63a('0x23')][_0xc63a('0x58')](_0x37a6fe,{'transaction':_0x3d4d5d});});}else{_0x102a91=0x194;_0x1ccaaa=[];}});})['then'](function(){if(_0x102a91!==0x194){return db[_0xc63a('0x23')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x5befec},'order':_0xc63a('0x59')})['then'](function(_0x162d3d){_0x1ccaaa=_0x162d3d;});}})[_0xc63a('0x39')](function(_0x46b7ab){_0x102a91=0x1f4;logger[_0xc63a('0x46')](_0x46b7ab[_0xc63a('0x20')]);if(_0x46b7ab['name']){delete _0x46b7ab[_0xc63a('0x21')];}_0x1ccaaa=_0x46b7ab;})[_0xc63a('0x5a')](function(){if(_0x1ccaaa===null){_0x3bf76b[_0xc63a('0xc')](_0x102a91);}else{if(_0x102a91===0x1f4){_0x3bf76b[_0xc63a('0xe')](_0x102a91)[_0xc63a('0x5b')](_0x1ccaaa);}else{_0x3bf76b[_0xc63a('0xe')](_0x102a91)['json'](_0x1ccaaa);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 3e43830..ccd30bd 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 _0xdeb6=['exports','events','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x2a4fe2,_0x3ec53a){var _0x225c4a=function(_0x1eccfa){while(--_0x1eccfa){_0x2a4fe2['push'](_0x2a4fe2['shift']());}};_0x225c4a(++_0x3ec53a);}(_0xdeb6,0xf7));var _0x6deb=function(_0x52ea48,_0x14f622){_0x52ea48=_0x52ea48-0x0;var _0x1f8e44=_0xdeb6[_0x52ea48];return _0x1f8e44;};'use strict';var EventEmitter=require(_0x6deb('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6deb('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6deb('0x2')};function emitEvent(_0x3545a0){return function(_0x50ec11,_0x32a05f,_0x33e391){VoiceExtensionEvents[_0x6deb('0x3')](_0x3545a0+':'+_0x50ec11['id'],_0x50ec11);VoiceExtensionEvents[_0x6deb('0x3')](_0x3545a0,_0x50ec11);_0x33e391(null);};}for(var e in events){if(events[_0x6deb('0x4')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x6deb('0x5')]=VoiceExtensionEvents; \ No newline at end of file +var _0x2926=['hook','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2926,0x109));var _0x6292=function(_0x5b406e,_0xcd06bc){_0x5b406e=_0x5b406e-0x0;var _0xe7d242=_0x2926[_0x5b406e];return _0xe7d242;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x6292('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6292('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6292('0x2'),'afterDestroy':_0x6292('0x3')};function emitEvent(_0x2cd83f){return function(_0x5e7589,_0xad9a70,_0x55ddf7){VoiceExtensionEvents[_0x6292('0x4')](_0x2cd83f+':'+_0x5e7589['id'],_0x5e7589);VoiceExtensionEvents[_0x6292('0x4')](_0x2cd83f,_0x5e7589);_0x55ddf7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x6292('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 455351e..38fa12f 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 _0x6dc0=['recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','name','trunk','split','phone','prefix','${EXTEN:','param','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','length','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','catch','VoiceExtension','voice_extensions','then','Hangup','lodash','exports','models','type','CDR(type)=','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','context','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty'];(function(_0x56d3d5,_0x3f1630){var _0xb33e60=function(_0x415846){while(--_0x415846){_0x56d3d5['push'](_0x56d3d5['shift']());}};_0xb33e60(++_0x3f1630);}(_0x6dc0,0x18c));var _0x06dc=function(_0x3d9115,_0x3aa7e7){_0x3d9115=_0x3d9115-0x0;var _0x4b6b7d=_0x6dc0[_0x3d9115];return _0x4b6b7d;};'use strict';var _=require(_0x06dc('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x06dc('0x1')]=function(_0x4772d8){var _0x4434e2=_0x4772d8[_0x06dc('0x2')];function _0x414760(_0x4bc609){var _0x4effcf=0x2;var _0x2cad0f=[{'type':_0x4bc609[_0x06dc('0x3')],'app':'Set','appdata':_0x06dc('0x4')+_0x4bc609[_0x06dc('0x3')],'context':_0x4bc609['context'],'exten':_0x4bc609[_0x06dc('0x5')],'priority':_0x4effcf++,'VoiceExtensionId':_0x4bc609['id']},{'type':_0x4bc609['type'],'app':_0x4bc609[_0x06dc('0x6')]?_0x06dc('0x7'):_0x06dc('0x8'),'appdata':_0x4bc609[_0x06dc('0x6')]?_0x06dc('0x9')+_0x4bc609['alias']:_0x06dc('0xa'),'context':_0x4bc609['context'],'exten':_0x4bc609[_0x06dc('0x5')],'priority':_0x4effcf++,'VoiceExtensionId':_0x4bc609['id']}];if(_0x4bc609[_0x06dc('0x3')]==='inbound'){_0x2cad0f[_0x06dc('0xb')]({'type':_0x06dc('0xc'),'app':_0x06dc('0x7'),'appdata':_0x06dc('0xd')+_0x4bc609['id'],'context':_0x4bc609['context'],'exten':_0x4bc609[_0x06dc('0x5')],'priority':_0x4effcf++,'VoiceExtensionId':_0x4bc609['id']});}_0x2cad0f[_0x06dc('0xb')]({'type':_0x4bc609[_0x06dc('0x3')],'app':_0x06dc('0x7'),'appdata':_0x06dc('0xe'),'context':_0x4bc609['context'],'exten':_0x4bc609[_0x06dc('0x5')],'priority':_0x4effcf++,'VoiceExtensionId':_0x4bc609['id']},{'type':_0x4bc609[_0x06dc('0x3')],'app':_0x06dc('0x7'),'appdata':_0x06dc('0xf'),'context':_0x4bc609[_0x06dc('0x10')],'exten':_0x4bc609[_0x06dc('0x5')],'priority':_0x4effcf++,'VoiceExtensionId':_0x4bc609['id']},{'type':_0x4bc609[_0x06dc('0x3')],'app':'Set','appdata':_0x06dc('0x11'),'context':_0x4bc609[_0x06dc('0x10')],'exten':_0x4bc609[_0x06dc('0x5')],'priority':_0x4effcf++,'VoiceExtensionId':_0x4bc609['id']});return _0x2cad0f;}function _0x5bc9d9(_0x2229cd){var _0x46a57c=0x2;var _0x9621a5=[{'type':_0x06dc('0x12'),'app':_0x06dc('0x7'),'appdata':_0x06dc('0x13'),'context':_0x2229cd[_0x06dc('0x10')],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':'outbound','app':_0x2229cd[_0x06dc('0x6')]?'Set':_0x06dc('0x8'),'appdata':_0x2229cd['alias']?_0x06dc('0x9')+_0x2229cd[_0x06dc('0x6')]:_0x06dc('0xa'),'context':_0x2229cd[_0x06dc('0x10')],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x2229cd['cutdigits']?'${EXTEN:'+_0x2229cd[_0x06dc('0x14')]+'}':_0x06dc('0x15')),'context':_0x2229cd['context'],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':_0x06dc('0x12'),'app':_0x06dc('0x7'),'appdata':_0x06dc('0xd')+_0x2229cd['id'],'context':_0x2229cd['context'],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':_0x06dc('0x12'),'app':_0x06dc('0x16'),'appdata':_0x06dc('0x17')+(_0x46a57c+0x2)+_0x06dc('0x18')+(_0x46a57c+0x1)+')','context':_0x2229cd['context'],'exten':_0x2229cd['exten'],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':_0x06dc('0x12'),'app':_0x06dc('0x7'),'appdata':_0x2229cd[_0x06dc('0x14')]?_0x06dc('0x19')+_0x2229cd['cutdigits']+'}':_0x06dc('0x1a'),'context':_0x2229cd[_0x06dc('0x10')],'exten':_0x2229cd['exten'],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':'outbound','app':_0x06dc('0x7'),'appdata':_0x06dc('0xe'),'context':_0x2229cd['context'],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':'outbound','app':_0x06dc('0x7'),'appdata':_0x06dc('0xf'),'context':_0x2229cd[_0x06dc('0x10')],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':_0x06dc('0x12'),'app':_0x06dc('0x7'),'appdata':_0x06dc('0x11'),'context':_0x2229cd[_0x06dc('0x10')],'exten':_0x2229cd['exten'],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':_0x06dc('0x12'),'app':_0x06dc('0x7'),'appdata':_0x06dc('0x1b')+_0x2229cd['id'],'context':_0x2229cd[_0x06dc('0x10')],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']}];if(_0x2229cd[_0x06dc('0x1c')](_0x06dc('0x1d'))&&_0x2229cd[_0x06dc('0x1d')]!=='none'){_0x9621a5['push']({'type':'outbound','app':_0x06dc('0x7'),'appdata':_0x06dc('0x1e'),'context':_0x2229cd['context'],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']},{'type':_0x06dc('0x12'),'app':_0x06dc('0x7'),'appdata':_0x06dc('0x1f')+_0x2229cd[_0x06dc('0x1d')]||_0x06dc('0x20'),'context':_0x2229cd['context'],'exten':_0x2229cd[_0x06dc('0x5')],'priority':_0x46a57c++,'VoiceExtensionId':_0x2229cd['id']});}return _0x9621a5;}function _0x5480ce(_0x374828,_0x51fd61){var _0x5f216a=[{'name':'trunk','param':0x0},{'name':_0x06dc('0x21'),'param':0x1},{'name':_0x06dc('0x22'),'param':0x2},{'name':_0x06dc('0x23'),'param':0x3}];var _0x3bd4a6={};var _0x478fab=_0x51fd61['split'](',');var _0x463a56=[];for(var _0x3a1d6d=0x0;_0x3a1d6d<_0x5f216a['length'];_0x3a1d6d++){switch(_0x5f216a[_0x3a1d6d][_0x06dc('0x24')]){case _0x06dc('0x25'):_0x3bd4a6[_0x06dc('0x25')]=_0x478fab[_0x5f216a[_0x3a1d6d]['param']][_0x06dc('0x26')]('/')[0x1];_0x3bd4a6[_0x06dc('0x27')]=_0x478fab[_0x5f216a[_0x3a1d6d]['param']][_0x06dc('0x26')]('/')[0x2];_0x3bd4a6['prefix']=_0x3bd4a6['phone']?_0x3bd4a6[_0x06dc('0x27')][_0x06dc('0x26')]('$')[0x0]:undefined;_0x3bd4a6['phone']=_0x374828['cutdigits']?(_0x3bd4a6[_0x06dc('0x28')]||'')+_0x06dc('0x29')+_0x374828['cutdigits']+'}':(_0x3bd4a6[_0x06dc('0x28')]||'')+_0x06dc('0x15');_0x463a56[_0x5f216a[_0x3a1d6d][_0x06dc('0x2a')]]=[_0x06dc('0x2b'),_0x3bd4a6[_0x06dc('0x25')],_0x3bd4a6[_0x06dc('0x27')]][_0x06dc('0x2c')]('/');break;case _0x06dc('0x22'):_0x3bd4a6['options']=_0x478fab[_0x5f216a[_0x3a1d6d][_0x06dc('0x2a')]];if(_0x374828['recordingFormat']!=='none'){if(_0x3bd4a6[_0x06dc('0x22')][_0x06dc('0x2d')](_0x06dc('0x2e'))<0x0){_0x3bd4a6[_0x06dc('0x22')]+=_0x06dc('0x2e');}}else{_0x3bd4a6[_0x06dc('0x22')]=_0x3bd4a6[_0x06dc('0x22')][_0x06dc('0x2f')]('U(xcally-mixmonitor-context)','');}_0x463a56[_0x5f216a[_0x3a1d6d][_0x06dc('0x2a')]]=_0x3bd4a6[_0x06dc('0x22')];break;default:_0x463a56[_0x5f216a[_0x3a1d6d][_0x06dc('0x2a')]]=_0x478fab[_0x5f216a[_0x3a1d6d]['param']];}}return _0x463a56[_0x06dc('0x2c')](',');}function _0x17ecc8(_0x5f06d0,_0x5d3ad0,_0x29ef68){return new Promise(function(_0x263ade,_0x1bc696){var _0x390d19=[];if(_[_0x06dc('0x30')](_0x5d3ad0))return _0x263ade(_0x390d19);_0x4434e2[_0x06dc('0x31')][_0x06dc('0x32')]({'attributes':['id',_0x06dc('0x33'),_0x06dc('0x34')],'raw':!![]})['then'](function(_0x2ed193){for(var _0x1ae98e=0x0,_0x472eed=0x0;_0x1ae98e<_0x5d3ad0[_0x06dc('0x35')];_0x1ae98e++,_0x472eed=0x0){var _0x2ed760=_0x5d3ad0[_0x1ae98e];var _0x49458f=[];var _0x1e04a6=[];delete _0x2ed760['id'];if(_0x2ed760[_0x06dc('0x33')]!==_0x06dc('0x36')){_0x2ed760[_0x06dc('0x37')]=[_0x2ed760['interval']];}else{_0x2ed760[_0x06dc('0x37')]=_0x2ed760[_0x06dc('0x34')]?_[_0x06dc('0x38')](_[_0x06dc('0x39')](_0x2ed193,{'IntervalId':_0x2ed760[_0x06dc('0x34')]}),_0x06dc('0x33')):[];}_0x2ed760[_0x06dc('0x10')]=_0x5f06d0[_0x06dc('0x10')];_0x2ed760[_0x06dc('0x5')]=_0x5f06d0['exten'];if(_0x2ed760['type'])_0x2ed760['type']=_0x2ed760[_0x06dc('0x3')][_0x06dc('0x3a')]();if(_0x5f06d0[_0x06dc('0x3')]==='outbound'){if(_0x2ed760[_0x06dc('0x1c')]('tag')&&_0x2ed760[_0x06dc('0x3b')]&&_0x2ed760[_0x06dc('0x3b')]!=='--'){_0x49458f[_0x06dc('0xb')]({'type':_0x2ed760['type']['toLowerCase'](),'app':'Set','appdata':_0x06dc('0x3c')+_0x2ed760[_0x06dc('0x3b')],'context':_0x5f06d0[_0x06dc('0x10')],'exten':_0x5f06d0['exten'],'priority':_0x2ed760[_0x06dc('0x37')]['length']+_0x29ef68+_0x472eed++,'VoiceExtensionId':_0x5f06d0['id']});}_0x49458f[_0x06dc('0xb')]({'type':_0x2ed760[_0x06dc('0x3')][_0x06dc('0x3a')](),'app':_0x06dc('0x16'),'appdata':_0x06dc('0x3d')+(_0x2ed760['callerID']?'Set(CALLERID(all)='+_0x2ed760[_0x06dc('0x3e')]+')':_0x06dc('0x3f')),'context':_0x5f06d0[_0x06dc('0x10')],'exten':_0x5f06d0['exten'],'priority':_0x2ed760['intervals'][_0x06dc('0x35')]+_0x29ef68+_0x472eed++,'VoiceExtensionId':_0x5f06d0['id']});}else{if(_0x2ed760[_0x06dc('0x1c')](_0x06dc('0x40'))){if([_0x06dc('0x41'),_0x06dc('0x42')][_0x06dc('0x43')](_0x2ed760['app']['toLowerCase']())&&_0x2ed760[_0x06dc('0x44')]!==_0x06dc('0x45')){if(_0x2ed760[_0x06dc('0x40')]){_0x49458f[_0x06dc('0xb')]({'type':_0x2ed760[_0x06dc('0x3')][_0x06dc('0x3a')](),'app':_0x06dc('0x16'),'appdata':_0x06dc('0x46'),'context':_0x5f06d0[_0x06dc('0x10')],'exten':_0x5f06d0['exten'],'priority':_0x2ed760[_0x06dc('0x37')]['length']+_0x29ef68+_0x472eed++,'VoiceExtensionId':_0x5f06d0['id']});_0x49458f[_0x06dc('0xb')]({'type':_0x2ed760[_0x06dc('0x3')]['toLowerCase'](),'app':_0x06dc('0x7'),'appdata':_0x06dc('0x47'),'context':_0x5f06d0[_0x06dc('0x10')],'exten':_0x5f06d0[_0x06dc('0x5')],'priority':_0x2ed760[_0x06dc('0x37')][_0x06dc('0x35')]+_0x29ef68+_0x472eed++,'VoiceExtensionId':_0x5f06d0['id']});}else{_0x49458f['push']({'type':_0x2ed760[_0x06dc('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0x06dc('0x48'),'context':_0x5f06d0[_0x06dc('0x10')],'exten':_0x5f06d0[_0x06dc('0x5')],'priority':_0x2ed760['intervals'][_0x06dc('0x35')]+_0x29ef68+_0x472eed++,'VoiceExtensionId':_0x5f06d0['id']});_0x49458f['push']({'type':_0x2ed760['type']['toLowerCase'](),'app':_0x06dc('0x7'),'appdata':_0x06dc('0x49'),'context':_0x5f06d0[_0x06dc('0x10')],'exten':_0x5f06d0[_0x06dc('0x5')],'priority':_0x2ed760['intervals'][_0x06dc('0x35')]+_0x29ef68+_0x472eed++,'VoiceExtensionId':_0x5f06d0['id']});}}}}for(var _0x4ccb18=0x0;_0x4ccb18<_0x2ed760[_0x06dc('0x37')][_0x06dc('0x35')];_0x4ccb18++){var _0x47898f=_0x29ef68+_0x2ed760[_0x06dc('0x37')][_0x06dc('0x35')];var _0x143b71=_0x4ccb18===_0x2ed760[_0x06dc('0x37')][_0x06dc('0x35')]-0x1?_0x29ef68+_0x49458f[_0x06dc('0x35')]+_0x1e04a6[_0x06dc('0x35')]+0x2:_0x29ef68+_0x4ccb18+0x1;_0x49458f[_0x06dc('0x4a')](_0x4ccb18,0x0,{'type':_0x5f06d0[_0x06dc('0x3')],'app':_0x06dc('0x4b'),'appdata':_0x2ed760[_0x06dc('0x37')][_0x4ccb18]+'?'+_0x5f06d0['context']+',${EXTEN},'+_0x47898f+':'+_0x5f06d0[_0x06dc('0x10')]+',${EXTEN},'+_0x143b71,'exten':_0x5f06d0[_0x06dc('0x5')],'context':_0x5f06d0[_0x06dc('0x10')],'priority':_0x29ef68+_0x4ccb18,'VoiceExtensionId':_0x5f06d0['id']});}if(_0x2ed760['appType']===_0x06dc('0x4c'))_0x2ed760['appdata']=_0x5480ce(_0x5f06d0,_0x2ed760[_0x06dc('0x4d')]);_0x2ed760[_0x06dc('0x4e')]=_0x49458f[_0x06dc('0x35')]?_[_0x06dc('0x4f')](_0x49458f)[_0x06dc('0x4e')]+0x1:_0x29ef68;_0x390d19=_['concat'](_0x390d19,_0x49458f,[_0x2ed760],_0x1e04a6);_0x29ef68=_['last'](_0x390d19)[_0x06dc('0x4e')]+0x1;}return _0x263ade(_0x390d19);})[_0x06dc('0x50')](function(_0x159bf3){_0x1bc696(_0x159bf3);});});}return _0x4772d8['define'](_0x06dc('0x51'),attributes,{'tableName':_0x06dc('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x34feb9){var _0x543cc8=this['get']({'plain':!![]});var _0x50c403=_0x543cc8['type']==='outbound'?_0x5bc9d9(_0x543cc8):_0x414760(_0x543cc8);return _0x17ecc8(_0x543cc8,_0x34feb9,_[_0x06dc('0x4f')](_0x50c403)[_0x06dc('0x4e')]+0x1)[_0x06dc('0x53')](function(_0xf67f62){var _0x1c1918=_['concat'](_0x50c403,_0xf67f62);_0x1c1918[_0x06dc('0xb')]({'type':_0x543cc8[_0x06dc('0x3')],'app':_0x06dc('0x54'),'exten':_0x543cc8[_0x06dc('0x5')],'context':_0x543cc8[_0x06dc('0x10')],'priority':_[_0x06dc('0x4f')](_0x1c1918)['priority']+0x1,'VoiceExtensionId':_0x543cc8['id']});return _0x1c1918;});}}});}; \ No newline at end of file +var _0xb71d=['interval','IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','get','then','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','context','alias','NoOp','No\x20alias\x20set','exten','inbound','Set','CDR(routeid)=','push','type','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','options','url','split','length','name','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xb71d,0xc0));var _0xdb71=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb71d[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xdb71('0x0'));var attributes=require(_0xdb71('0x1'));module[_0xdb71('0x2')]=function(_0xa51c1f){var _0x1d747d=_0xa51c1f[_0xdb71('0x3')];function _0x52f5c3(_0x45f52e){var _0x5ec3b6=0x2;var _0x1d6029=[{'type':_0x45f52e['type'],'app':'Set','appdata':_0xdb71('0x4')+_0x45f52e['type'],'context':_0x45f52e[_0xdb71('0x5')],'exten':_0x45f52e['exten'],'priority':_0x5ec3b6++,'VoiceExtensionId':_0x45f52e['id']},{'type':_0x45f52e['type'],'app':_0x45f52e[_0xdb71('0x6')]?'Set':_0xdb71('0x7'),'appdata':_0x45f52e[_0xdb71('0x6')]?'CDR(routeAlias)='+_0x45f52e[_0xdb71('0x6')]:_0xdb71('0x8'),'context':_0x45f52e[_0xdb71('0x5')],'exten':_0x45f52e[_0xdb71('0x9')],'priority':_0x5ec3b6++,'VoiceExtensionId':_0x45f52e['id']}];if(_0x45f52e['type']===_0xdb71('0xa')){_0x1d6029['push']({'type':_0xdb71('0xa'),'app':_0xdb71('0xb'),'appdata':_0xdb71('0xc')+_0x45f52e['id'],'context':_0x45f52e[_0xdb71('0x5')],'exten':_0x45f52e['exten'],'priority':_0x5ec3b6++,'VoiceExtensionId':_0x45f52e['id']});}_0x1d6029[_0xdb71('0xd')]({'type':_0x45f52e['type'],'app':_0xdb71('0xb'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x45f52e[_0xdb71('0x5')],'exten':_0x45f52e[_0xdb71('0x9')],'priority':_0x5ec3b6++,'VoiceExtensionId':_0x45f52e['id']},{'type':_0x45f52e[_0xdb71('0xe')],'app':'Set','appdata':_0xdb71('0xf'),'context':_0x45f52e[_0xdb71('0x5')],'exten':_0x45f52e[_0xdb71('0x9')],'priority':_0x5ec3b6++,'VoiceExtensionId':_0x45f52e['id']},{'type':_0x45f52e[_0xdb71('0xe')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x45f52e[_0xdb71('0x5')],'exten':_0x45f52e['exten'],'priority':_0x5ec3b6++,'VoiceExtensionId':_0x45f52e['id']});return _0x1d6029;}function _0x1b5315(_0x427b67){var _0xe441b2=0x2;var _0x2f2a86=[{'type':_0xdb71('0x10'),'app':'Set','appdata':_0xdb71('0x11'),'context':_0x427b67[_0xdb71('0x5')],'exten':_0x427b67['exten'],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':_0x427b67[_0xdb71('0x6')]?_0xdb71('0xb'):_0xdb71('0x7'),'appdata':_0x427b67['alias']?_0xdb71('0x12')+_0x427b67[_0xdb71('0x6')]:'No\x20alias\x20set','context':_0x427b67['context'],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':_0xdb71('0xb'),'appdata':_0xdb71('0x13')+(_0x427b67[_0xdb71('0x14')]?_0xdb71('0x15')+_0x427b67[_0xdb71('0x14')]+'}':_0xdb71('0x16')),'context':_0x427b67[_0xdb71('0x5')],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':_0xdb71('0xb'),'appdata':'CDR(routeid)='+_0x427b67['id'],'context':_0x427b67[_0xdb71('0x5')],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':'outbound','app':_0xdb71('0x17'),'appdata':_0xdb71('0x18')+(_0xe441b2+0x2)+_0xdb71('0x19')+(_0xe441b2+0x1)+')','context':_0x427b67['context'],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':_0xdb71('0xb'),'appdata':_0x427b67[_0xdb71('0x14')]?_0xdb71('0x1a')+_0x427b67[_0xdb71('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x427b67[_0xdb71('0x5')],'exten':_0x427b67['exten'],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':_0xdb71('0xb'),'appdata':_0xdb71('0x1b'),'context':_0x427b67['context'],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':_0xdb71('0xb'),'appdata':_0xdb71('0xf'),'context':_0x427b67['context'],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':_0xdb71('0xb'),'appdata':'MONITOR_OPTIONS=ab','context':_0x427b67[_0xdb71('0x5')],'exten':_0x427b67['exten'],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':_0xdb71('0x10'),'app':'Set','appdata':_0xdb71('0x1c')+_0x427b67['id'],'context':_0x427b67[_0xdb71('0x5')],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']}];if(_0x427b67[_0xdb71('0x1d')](_0xdb71('0x1e'))&&_0x427b67[_0xdb71('0x1e')]!==_0xdb71('0x1f')){_0x2f2a86[_0xdb71('0xd')]({'type':_0xdb71('0x10'),'app':_0xdb71('0xb'),'appdata':_0xdb71('0x20'),'context':_0x427b67[_0xdb71('0x5')],'exten':_0x427b67['exten'],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']},{'type':'outbound','app':'Set','appdata':_0xdb71('0x21')+_0x427b67[_0xdb71('0x1e')]||'wav','context':_0x427b67['context'],'exten':_0x427b67[_0xdb71('0x9')],'priority':_0xe441b2++,'VoiceExtensionId':_0x427b67['id']});}return _0x2f2a86;}function _0x18d9d7(_0x31bee5,_0x28a339){var _0x1cb96b=[{'name':_0xdb71('0x22'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xdb71('0x23'),'param':0x2},{'name':_0xdb71('0x24'),'param':0x3}];var _0x1c4a5b={};var _0x305e92=_0x28a339[_0xdb71('0x25')](',');var _0x9914a0=[];for(var _0x413d89=0x0;_0x413d89<_0x1cb96b[_0xdb71('0x26')];_0x413d89++){switch(_0x1cb96b[_0x413d89][_0xdb71('0x27')]){case _0xdb71('0x22'):_0x1c4a5b['trunk']=_0x305e92[_0x1cb96b[_0x413d89][_0xdb71('0x28')]]['split']('/')[0x1];_0x1c4a5b[_0xdb71('0x29')]=_0x305e92[_0x1cb96b[_0x413d89][_0xdb71('0x28')]]['split']('/')[0x2];_0x1c4a5b[_0xdb71('0x2a')]=_0x1c4a5b[_0xdb71('0x29')]?_0x1c4a5b[_0xdb71('0x29')][_0xdb71('0x25')]('$')[0x0]:undefined;_0x1c4a5b['phone']=_0x31bee5[_0xdb71('0x14')]?(_0x1c4a5b[_0xdb71('0x2a')]||'')+_0xdb71('0x15')+_0x31bee5['cutdigits']+'}':(_0x1c4a5b[_0xdb71('0x2a')]||'')+_0xdb71('0x16');_0x9914a0[_0x1cb96b[_0x413d89][_0xdb71('0x28')]]=['SIP',_0x1c4a5b[_0xdb71('0x22')],_0x1c4a5b[_0xdb71('0x29')]][_0xdb71('0x2b')]('/');break;case _0xdb71('0x23'):_0x1c4a5b[_0xdb71('0x23')]=_0x305e92[_0x1cb96b[_0x413d89][_0xdb71('0x28')]];if(_0x31bee5[_0xdb71('0x1e')]!=='none'){if(_0x1c4a5b[_0xdb71('0x23')][_0xdb71('0x2c')](_0xdb71('0x2d'))<0x0){_0x1c4a5b[_0xdb71('0x23')]+=_0xdb71('0x2d');}}else{_0x1c4a5b[_0xdb71('0x23')]=_0x1c4a5b[_0xdb71('0x23')]['replace'](_0xdb71('0x2d'),'');}_0x9914a0[_0x1cb96b[_0x413d89][_0xdb71('0x28')]]=_0x1c4a5b[_0xdb71('0x23')];break;default:_0x9914a0[_0x1cb96b[_0x413d89][_0xdb71('0x28')]]=_0x305e92[_0x1cb96b[_0x413d89][_0xdb71('0x28')]];}}return _0x9914a0[_0xdb71('0x2b')](',');}function _0x562238(_0x1f7c5c,_0x29a03b,_0x1eb16d){return new Promise(function(_0x4c1a7b,_0x1a6f20){var _0x3c1507=[];if(_[_0xdb71('0x2e')](_0x29a03b))return _0x4c1a7b(_0x3c1507);_0x1d747d[_0xdb71('0x2f')]['findAll']({'attributes':['id',_0xdb71('0x30'),_0xdb71('0x31')],'raw':!![]})['then'](function(_0x3f3e72){for(var _0x52fe8d=0x0,_0x9f5a6=0x0;_0x52fe8d<_0x29a03b[_0xdb71('0x26')];_0x52fe8d++,_0x9f5a6=0x0){var _0x4729af=_0x29a03b[_0x52fe8d];var _0x253e1b=[];var _0xd79c3c=[];delete _0x4729af['id'];if(_0x4729af[_0xdb71('0x30')]!==_0xdb71('0x32')){_0x4729af[_0xdb71('0x33')]=[_0x4729af[_0xdb71('0x30')]];}else{_0x4729af[_0xdb71('0x33')]=_0x4729af[_0xdb71('0x31')]?_[_0xdb71('0x34')](_[_0xdb71('0x35')](_0x3f3e72,{'IntervalId':_0x4729af[_0xdb71('0x31')]}),_0xdb71('0x30')):[];}_0x4729af[_0xdb71('0x5')]=_0x1f7c5c[_0xdb71('0x5')];_0x4729af['exten']=_0x1f7c5c[_0xdb71('0x9')];if(_0x4729af[_0xdb71('0xe')])_0x4729af[_0xdb71('0xe')]=_0x4729af[_0xdb71('0xe')][_0xdb71('0x36')]();if(_0x1f7c5c[_0xdb71('0xe')]===_0xdb71('0x10')){if(_0x4729af['hasOwnProperty'](_0xdb71('0x37'))&&_0x4729af['tag']&&_0x4729af[_0xdb71('0x37')]!=='--'){_0x253e1b[_0xdb71('0xd')]({'type':_0x4729af['type']['toLowerCase'](),'app':'Set','appdata':'CDR(tag)='+_0x4729af[_0xdb71('0x37')],'context':_0x1f7c5c[_0xdb71('0x5')],'exten':_0x1f7c5c['exten'],'priority':_0x4729af[_0xdb71('0x33')][_0xdb71('0x26')]+_0x1eb16d+_0x9f5a6++,'VoiceExtensionId':_0x1f7c5c['id']});}_0x253e1b['push']({'type':_0x4729af[_0xdb71('0xe')][_0xdb71('0x36')](),'app':'ExecIf','appdata':_0xdb71('0x38')+(_0x4729af[_0xdb71('0x39')]?'Set(CALLERID(all)='+_0x4729af['callerID']+')':_0xdb71('0x3a')),'context':_0x1f7c5c['context'],'exten':_0x1f7c5c[_0xdb71('0x9')],'priority':_0x4729af[_0xdb71('0x33')]['length']+_0x1eb16d+_0x9f5a6++,'VoiceExtensionId':_0x1f7c5c['id']});}else{if(_0x4729af['hasOwnProperty'](_0xdb71('0x3b'))){if(['queue','playback'][_0xdb71('0x3c')](_0x4729af[_0xdb71('0x3d')]['toLowerCase']())&&_0x4729af[_0xdb71('0x3e')]!==_0xdb71('0x3f')){if(_0x4729af[_0xdb71('0x3b')]){_0x253e1b[_0xdb71('0xd')]({'type':_0x4729af['type'][_0xdb71('0x36')](),'app':'ExecIf','appdata':_0xdb71('0x40'),'context':_0x1f7c5c['context'],'exten':_0x1f7c5c[_0xdb71('0x9')],'priority':_0x4729af['intervals'][_0xdb71('0x26')]+_0x1eb16d+_0x9f5a6++,'VoiceExtensionId':_0x1f7c5c['id']});_0x253e1b[_0xdb71('0xd')]({'type':_0x4729af[_0xdb71('0xe')][_0xdb71('0x36')](),'app':_0xdb71('0xb'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1f7c5c[_0xdb71('0x5')],'exten':_0x1f7c5c[_0xdb71('0x9')],'priority':_0x4729af[_0xdb71('0x33')]['length']+_0x1eb16d+_0x9f5a6++,'VoiceExtensionId':_0x1f7c5c['id']});}else{_0x253e1b[_0xdb71('0xd')]({'type':_0x4729af['type'][_0xdb71('0x36')](),'app':_0xdb71('0x17'),'appdata':_0xdb71('0x41'),'context':_0x1f7c5c[_0xdb71('0x5')],'exten':_0x1f7c5c[_0xdb71('0x9')],'priority':_0x4729af[_0xdb71('0x33')][_0xdb71('0x26')]+_0x1eb16d+_0x9f5a6++,'VoiceExtensionId':_0x1f7c5c['id']});_0x253e1b[_0xdb71('0xd')]({'type':_0x4729af[_0xdb71('0xe')]['toLowerCase'](),'app':_0xdb71('0xb'),'appdata':_0xdb71('0x42'),'context':_0x1f7c5c[_0xdb71('0x5')],'exten':_0x1f7c5c[_0xdb71('0x9')],'priority':_0x4729af[_0xdb71('0x33')]['length']+_0x1eb16d+_0x9f5a6++,'VoiceExtensionId':_0x1f7c5c['id']});}}}}for(var _0x119e6d=0x0;_0x119e6d<_0x4729af['intervals'][_0xdb71('0x26')];_0x119e6d++){var _0x3e43ae=_0x1eb16d+_0x4729af[_0xdb71('0x33')]['length'];var _0x410415=_0x119e6d===_0x4729af[_0xdb71('0x33')][_0xdb71('0x26')]-0x1?_0x1eb16d+_0x253e1b['length']+_0xd79c3c[_0xdb71('0x26')]+0x2:_0x1eb16d+_0x119e6d+0x1;_0x253e1b['splice'](_0x119e6d,0x0,{'type':_0x1f7c5c[_0xdb71('0xe')],'app':_0xdb71('0x43'),'appdata':_0x4729af[_0xdb71('0x33')][_0x119e6d]+'?'+_0x1f7c5c['context']+',${EXTEN},'+_0x3e43ae+':'+_0x1f7c5c['context']+_0xdb71('0x44')+_0x410415,'exten':_0x1f7c5c[_0xdb71('0x9')],'context':_0x1f7c5c['context'],'priority':_0x1eb16d+_0x119e6d,'VoiceExtensionId':_0x1f7c5c['id']});}if(_0x4729af[_0xdb71('0x3e')]===_0xdb71('0x45'))_0x4729af[_0xdb71('0x46')]=_0x18d9d7(_0x1f7c5c,_0x4729af[_0xdb71('0x46')]);_0x4729af[_0xdb71('0x47')]=_0x253e1b[_0xdb71('0x26')]?_['last'](_0x253e1b)[_0xdb71('0x47')]+0x1:_0x1eb16d;_0x3c1507=_[_0xdb71('0x48')](_0x3c1507,_0x253e1b,[_0x4729af],_0xd79c3c);_0x1eb16d=_[_0xdb71('0x49')](_0x3c1507)[_0xdb71('0x47')]+0x1;}return _0x4c1a7b(_0x3c1507);})[_0xdb71('0x4a')](function(_0x233df6){_0x1a6f20(_0x233df6);});});}return _0xa51c1f[_0xdb71('0x4b')](_0xdb71('0x4c'),attributes,{'tableName':_0xdb71('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3f8e34){var _0x39d1f6=this[_0xdb71('0x4e')]({'plain':!![]});var _0x41635d=_0x39d1f6[_0xdb71('0xe')]==='outbound'?_0x1b5315(_0x39d1f6):_0x52f5c3(_0x39d1f6);return _0x562238(_0x39d1f6,_0x3f8e34,_[_0xdb71('0x49')](_0x41635d)[_0xdb71('0x47')]+0x1)[_0xdb71('0x4f')](function(_0xf00bf5){var _0x242764=_[_0xdb71('0x48')](_0x41635d,_0xf00bf5);_0x242764['push']({'type':_0x39d1f6[_0xdb71('0xe')],'app':'Hangup','exten':_0x39d1f6[_0xdb71('0x9')],'context':_0x39d1f6[_0xdb71('0x5')],'priority':_[_0xdb71('0x49')](_0x242764)[_0xdb71('0x47')]+0x1,'VoiceExtensionId':_0x39d1f6['id']});return _0x242764;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ab94e66..3fe2d13 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 _0x3d4b=['findAll','options','where','limit','include','map','model','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceExtension','VoiceExtension'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x3d4b,0xf3));var _0xb3d4=function(_0x3bc72d,_0x5aaa33){_0x3bc72d=_0x3bc72d-0x0;var _0x3b7fbf=_0x3d4b[_0x3bc72d];return _0x3b7fbf;};'use strict';var _=require(_0xb3d4('0x0'));var util=require(_0xb3d4('0x1'));var moment=require('moment');var BPromise=require(_0xb3d4('0x2'));var rs=require(_0xb3d4('0x3'));var fs=require('fs');var Redis=require(_0xb3d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3d4('0x5'));var logger=require(_0xb3d4('0x6'))(_0xb3d4('0x7'));var config=require(_0xb3d4('0x8'));var jayson=require(_0xb3d4('0x9'));var client=jayson[_0xb3d4('0xa')][_0xb3d4('0xb')]({'port':0x232a});config[_0xb3d4('0xc')]=_[_0xb3d4('0xd')](config[_0xb3d4('0xc')],{'host':_0xb3d4('0xe'),'port':0x18eb});var socket=require(_0xb3d4('0xf'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xb3d4('0x10')](socket);function respondWithRpcPromise(_0xc35991,_0x365958,_0x28f0f9){return new BPromise(function(_0x4a5565,_0x3a8832){return client[_0xb3d4('0x11')](_0xc35991,_0x28f0f9)[_0xb3d4('0x12')](function(_0x2550c5){logger[_0xb3d4('0x13')](_0xb3d4('0x14'),_0x365958,_0xb3d4('0x15'));logger[_0xb3d4('0x16')](_0xb3d4('0x17'),_0x365958,'request\x20sent',JSON['stringify'](_0x2550c5));if(_0x2550c5[_0xb3d4('0x18')]){if(_0x2550c5[_0xb3d4('0x18')][_0xb3d4('0x19')]===0x1f4){logger['error'](_0xb3d4('0x14'),_0x365958,_0x2550c5[_0xb3d4('0x18')]['message']);return _0x3a8832(_0x2550c5[_0xb3d4('0x18')][_0xb3d4('0x1a')]);}logger['error'](_0xb3d4('0x14'),_0x365958,_0x2550c5['error']['message']);return _0x4a5565(_0x2550c5[_0xb3d4('0x18')]['message']);}else{logger[_0xb3d4('0x13')](_0xb3d4('0x14'),_0x365958,_0xb3d4('0x15'));_0x4a5565(_0x2550c5[_0xb3d4('0x1b')][_0xb3d4('0x1a')]);}})['catch'](function(_0x45b5e8){logger[_0xb3d4('0x18')](_0xb3d4('0x14'),_0x365958,_0x45b5e8);_0x3a8832(_0x45b5e8);});});}exports[_0xb3d4('0x1c')]=function(_0x1f4823){var _0x12c996=this;return new Promise(function(_0x5706e8,_0x4ceff6){return db[_0xb3d4('0x1d')][_0xb3d4('0x1e')]({'raw':_0x1f4823['options']?_0x1f4823['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f4823[_0xb3d4('0x1f')]?_0x1f4823[_0xb3d4('0x1f')][_0xb3d4('0x20')]||null:null,'attributes':_0x1f4823[_0xb3d4('0x1f')]?_0x1f4823['options']['attributes']||null:null,'limit':_0x1f4823[_0xb3d4('0x1f')]?_0x1f4823['options'][_0xb3d4('0x21')]||null:null,'include':_0x1f4823['options']?_0x1f4823['options'][_0xb3d4('0x22')]?_[_0xb3d4('0x23')](_0x1f4823[_0xb3d4('0x1f')]['include'],function(_0x249636){return{'model':db[_0x249636['model']],'as':_0x249636['as'],'attributes':_0x249636['attributes'],'include':_0x249636[_0xb3d4('0x22')]?_['map'](_0x249636[_0xb3d4('0x22')],function(_0x3db429){return{'model':db[_0x3db429[_0xb3d4('0x24')]],'as':_0x3db429['as'],'attributes':_0x3db429['attributes'],'include':_0x3db429['include']?_[_0xb3d4('0x23')](_0x3db429[_0xb3d4('0x22')],function(_0x8e84af){return{'model':db[_0x8e84af['model']],'as':_0x8e84af['as'],'attributes':_0x8e84af['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11e4cc){logger[_0xb3d4('0x13')](_0xb3d4('0x1c'),_0x1f4823);logger['debug'](_0xb3d4('0x1c'),_0x1f4823,JSON[_0xb3d4('0x25')](_0x11e4cc));_0x5706e8(_0x11e4cc);})[_0xb3d4('0x26')](function(_0x5a3fe7){logger[_0xb3d4('0x18')](_0xb3d4('0x1c'),_0x5a3fe7['message'],_0x1f4823);_0x4ceff6(_0x12c996[_0xb3d4('0x18')](0x1f4,_0x5a3fe7['message']));});});}; \ No newline at end of file +var _0xecb2=['request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x2d4dc7,_0x66d24b){var _0x5552e4=function(_0x5988fd){while(--_0x5988fd){_0x2d4dc7['push'](_0x2d4dc7['shift']());}};_0x5552e4(++_0x66d24b);}(_0xecb2,0xf6));var _0x2ecb=function(_0x3b44e2,_0x32c155){_0x3b44e2=_0x3b44e2-0x0;var _0x83323=_0xecb2[_0x3b44e2];return _0x83323;};'use strict';var _=require(_0x2ecb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ecb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ecb('0x2'))['db'];var utils=require(_0x2ecb('0x3'));var logger=require(_0x2ecb('0x4'))(_0x2ecb('0x5'));var config=require(_0x2ecb('0x6'));var jayson=require(_0x2ecb('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2ecb('0x8')](config[_0x2ecb('0x9')],{'host':_0x2ecb('0xa'),'port':0x18eb});var socket=require(_0x2ecb('0xb'))(new Redis(config[_0x2ecb('0x9')]));require('./voiceExtension.socket')[_0x2ecb('0xc')](socket);function respondWithRpcPromise(_0x46d2c7,_0x35755,_0x500735){return new BPromise(function(_0x1e213c,_0x442482){return client[_0x2ecb('0xd')](_0x46d2c7,_0x500735)[_0x2ecb('0xe')](function(_0x9f045a){logger['info'](_0x2ecb('0xf'),_0x35755,_0x2ecb('0x10'));logger[_0x2ecb('0x11')](_0x2ecb('0x12'),_0x35755,_0x2ecb('0x10'),JSON[_0x2ecb('0x13')](_0x9f045a));if(_0x9f045a[_0x2ecb('0x14')]){if(_0x9f045a['error'][_0x2ecb('0x15')]===0x1f4){logger[_0x2ecb('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x35755,_0x9f045a[_0x2ecb('0x14')][_0x2ecb('0x16')]);return _0x442482(_0x9f045a[_0x2ecb('0x14')][_0x2ecb('0x16')]);}logger[_0x2ecb('0x14')](_0x2ecb('0xf'),_0x35755,_0x9f045a[_0x2ecb('0x14')][_0x2ecb('0x16')]);return _0x1e213c(_0x9f045a[_0x2ecb('0x14')]['message']);}else{logger[_0x2ecb('0x17')](_0x2ecb('0xf'),_0x35755,'request\x20sent');_0x1e213c(_0x9f045a[_0x2ecb('0x18')]['message']);}})[_0x2ecb('0x19')](function(_0x3319ec){logger[_0x2ecb('0x14')](_0x2ecb('0xf'),_0x35755,_0x3319ec);_0x442482(_0x3319ec);});});}exports[_0x2ecb('0x1a')]=function(_0x46e471){var _0x15a1cb=this;return new Promise(function(_0x586728,_0x8ff004){return db[_0x2ecb('0x1b')][_0x2ecb('0x1c')]({'raw':_0x46e471['options']?_0x46e471[_0x2ecb('0x1d')][_0x2ecb('0x1e')]===undefined?!![]:![]:!![],'where':_0x46e471['options']?_0x46e471['options'][_0x2ecb('0x1f')]||null:null,'attributes':_0x46e471['options']?_0x46e471[_0x2ecb('0x1d')][_0x2ecb('0x20')]||null:null,'limit':_0x46e471[_0x2ecb('0x1d')]?_0x46e471[_0x2ecb('0x1d')][_0x2ecb('0x21')]||null:null,'include':_0x46e471['options']?_0x46e471['options'][_0x2ecb('0x22')]?_['map'](_0x46e471[_0x2ecb('0x1d')][_0x2ecb('0x22')],function(_0x45249b){return{'model':db[_0x45249b[_0x2ecb('0x23')]],'as':_0x45249b['as'],'attributes':_0x45249b[_0x2ecb('0x20')],'include':_0x45249b[_0x2ecb('0x22')]?_[_0x2ecb('0x24')](_0x45249b[_0x2ecb('0x22')],function(_0x28ee7a){return{'model':db[_0x28ee7a[_0x2ecb('0x23')]],'as':_0x28ee7a['as'],'attributes':_0x28ee7a[_0x2ecb('0x20')],'include':_0x28ee7a[_0x2ecb('0x22')]?_[_0x2ecb('0x24')](_0x28ee7a[_0x2ecb('0x22')],function(_0x75c8cb){return{'model':db[_0x75c8cb[_0x2ecb('0x23')]],'as':_0x75c8cb['as'],'attributes':_0x75c8cb[_0x2ecb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2ecb('0xe')](function(_0x294ff5){logger[_0x2ecb('0x17')](_0x2ecb('0x1a'),_0x46e471);logger[_0x2ecb('0x11')]('GetVoiceExtension',_0x46e471,JSON['stringify'](_0x294ff5));_0x586728(_0x294ff5);})[_0x2ecb('0x19')](function(_0x3c97d1){logger[_0x2ecb('0x14')](_0x2ecb('0x1a'),_0x3c97d1['message'],_0x46e471);_0x8ff004(_0x15a1cb[_0x2ecb('0x14')](0x1f4,_0x3c97d1[_0x2ecb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 861bc77..8d56025 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x1cb9,0x14e));var _0x91cb=function(_0xcb1772,_0x41e367){_0xcb1772=_0xcb1772-0x0;var _0x59df76=_0x1cb9[_0xcb1772];return _0x59df76;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x95b163,_0x17944d){var _0x53f64a=function(_0x117745){while(--_0x117745){_0x95b163['push'](_0x95b163['shift']());}};_0x53f64a(++_0x17944d);}(_0x7a54,0x106));var _0x47a5=function(_0x55a136,_0x13e614){_0x55a136=_0x55a136-0x0;var _0x3b5850=_0x7a54[_0x55a136];return _0x3b5850;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 3f8c7bc..69603c7 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 _0x583c=['fs-extra','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show','getMessages','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x4f5dd9,_0x30b8c5){var _0x3c8624=function(_0x3d7f06){while(--_0x3d7f06){_0x4f5dd9['push'](_0x4f5dd9['shift']());}};_0x3c8624(++_0x30b8c5);}(_0x583c,0x12b));var _0xc583=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x583c[_0xa28b1a];return _0x4c9b78;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var fs_extra=require(_0xc583('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc583('0x6'));var controller=require(_0xc583('0x7'));router['get']('/',auth[_0xc583('0x8')](),controller[_0xc583('0x9')]);router[_0xc583('0xa')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xa')]('/:id/messages',auth[_0xc583('0x8')](),controller[_0xc583('0xd')]);router[_0xc583('0xe')]('/',auth[_0xc583('0x8')](),controller[_0xc583('0xf')]);router['put'](_0xc583('0xb'),auth[_0xc583('0x8')](),controller['update']);router[_0xc583('0x10')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0x11')]);module[_0xc583('0x12')]=router; \ No newline at end of file +var _0x4325=['get','/:id/messages','getMessages','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','/:id','show'];(function(_0x46eefb,_0x48a544){var _0x20f686=function(_0x1226b1){while(--_0x1226b1){_0x46eefb['push'](_0x46eefb['shift']());}};_0x20f686(++_0x48a544);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var path=require('path');var timeout=require(_0x5432('0x2'));var express=require(_0x5432('0x3'));var router=express[_0x5432('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var controller=require(_0x5432('0x7'));router['get']('/',auth[_0x5432('0x8')](),controller[_0x5432('0x9')]);router['get'](_0x5432('0xa'),auth['isAuthenticated'](),controller[_0x5432('0xb')]);router[_0x5432('0xc')](_0x5432('0xd'),auth[_0x5432('0x8')](),controller[_0x5432('0xe')]);router['post']('/',auth[_0x5432('0x8')](),controller['create']);router[_0x5432('0xf')](_0x5432('0xa'),auth[_0x5432('0x8')](),controller[_0x5432('0x10')]);router['delete']('/:id',auth[_0x5432('0x8')](),controller[_0x5432('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 26f1d04..866c9aa 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 _0xaeeb=['yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xaeeb,0xf2));var _0xbaee=function(_0x4329c5,_0x4bfad6){_0x4329c5=_0x4329c5-0x0;var _0x285b58=_0xaeeb[_0x4329c5];return _0x285b58;};'use strict';var Sequelize=require(_0xbaee('0x0'));module[_0xbaee('0x1')]={'customer_id':{'type':Sequelize[_0xbaee('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xbaee('0x3'),'unique':_0xbaee('0x4')},'mailbox':{'type':Sequelize[_0xbaee('0x2')],'defaultValue':'','allowNull':![],'unique':_0xbaee('0x4')},'password':{'type':Sequelize[_0xbaee('0x2')]},'fullname':{'type':Sequelize[_0xbaee('0x2')]},'email':{'type':Sequelize[_0xbaee('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4ece74){this[_0xbaee('0x5')](_0xbaee('0x6'),typeof _0x4ece74===_0xbaee('0x7')&&_0x4ece74[_0xbaee('0x8')]()?_0x4ece74[_0xbaee('0x8')]():null);}},'pager':{'type':Sequelize[_0xbaee('0x2')]},'tz':{'type':Sequelize[_0xbaee('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xbaee('0x9')](_0xbaee('0xa'),'no'),'defaultValue':_0xbaee('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xbaee('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xbaee('0x2')]},'callback':{'type':Sequelize[_0xbaee('0x2')]},'review':{'type':Sequelize[_0xbaee('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xbaee('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xbaee('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xbaee('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbaee('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xbaee('0x9')](_0xbaee('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xbaee('0xa'),'no'),'defaultValue':_0xbaee('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xbaee('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xbaee('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbaee('0x9')]('yes','no'),'defaultValue':_0xbaee('0xa'),'allowNull':![]},'stamp':{'type':_0xbaee('0xb')},'emailsubject':{'type':Sequelize[_0xbaee('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xbaee('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xbaee('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xbaee('0xd')],'get':function(){return this[_0xbaee('0xe')](_0xbaee('0xf'))+_0xbaee('0x10')+this[_0xbaee('0xe')](_0xbaee('0x11'));}}}; \ No newline at end of file +var _0xc5fc=['INTEGER','VIRTUAL','getDataValue','fullname','mailbox','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x151547,_0x100dd4){var _0x182f02=function(_0x52ac5f){while(--_0x52ac5f){_0x151547['push'](_0x151547['shift']());}};_0x182f02(++_0x100dd4);}(_0xc5fc,0xe2));var _0xcc5f=function(_0x309206,_0x5a30c9){_0x309206=_0x309206-0x0;var _0x484ef9=_0xc5fc[_0x309206];return _0x484ef9;};'use strict';var Sequelize=require('sequelize');module[_0xcc5f('0x0')]={'customer_id':{'type':Sequelize[_0xcc5f('0x1')]},'context':{'type':Sequelize[_0xcc5f('0x1')],'defaultValue':_0xcc5f('0x2'),'unique':_0xcc5f('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xcc5f('0x1')]},'fullname':{'type':Sequelize[_0xcc5f('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x22962a){this['setDataValue'](_0xcc5f('0x4'),typeof _0x22962a===_0xcc5f('0x5')&&_0x22962a[_0xcc5f('0x6')]()?_0x22962a[_0xcc5f('0x6')]():null);}},'pager':{'type':Sequelize[_0xcc5f('0x1')]},'tz':{'type':Sequelize[_0xcc5f('0x1')],'defaultValue':_0xcc5f('0x7')},'attach':{'type':Sequelize[_0xcc5f('0x8')](_0xcc5f('0x9'),'no'),'defaultValue':_0xcc5f('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xcc5f('0x8')](_0xcc5f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xcc5f('0x1')]},'callback':{'type':Sequelize[_0xcc5f('0x1')]},'review':{'type':Sequelize['ENUM'](_0xcc5f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xcc5f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xcc5f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xcc5f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xcc5f('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xcc5f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xcc5f('0x8')](_0xcc5f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xcc5f('0x8')](_0xcc5f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xcc5f('0x8')](_0xcc5f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xcc5f('0x8')](_0xcc5f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xcc5f('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xcc5f('0xb')},'emailsubject':{'type':Sequelize[_0xcc5f('0x1')]},'emailbody':{'type':Sequelize[_0xcc5f('0x1')]},'maxsecs':{'type':Sequelize[_0xcc5f('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xcc5f('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xcc5f('0xd')],'get':function(){return this[_0xcc5f('0xe')](_0xcc5f('0xf'))+'\x20-\x20'+this[_0xcc5f('0xe')](_0xcc5f('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 0f6a41a..f54fbc9 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 _0xee5b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','where','pick','merge','VIRTUAL','filter','options','VoiceMail','includeAll','include','rows','catch','show','params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','nolimit','sort','findAndCountAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1873f1,_0x5633c9){_0x1873f1=_0x1873f1-0x0;var _0x70f58e=_0xee5b[_0x1873f1];return _0x70f58e;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];function respondWithStatusCode(_0xcef158,_0x48f771){_0x48f771=_0x48f771||0xcc;return function(_0x14e032){if(_0x14e032){return _0xcef158['sendStatus'](_0x48f771);}return _0xcef158[_0xbee5('0x17')](_0x48f771)[_0xbee5('0x18')]();};}function respondWithResult(_0x8a268f,_0x593ecb){_0x593ecb=_0x593ecb||0xc8;return function(_0x5092f2){if(_0x5092f2){return _0x8a268f[_0xbee5('0x17')](_0x593ecb)['json'](_0x5092f2);}};}function respondWithFilteredResult(_0x40afcb,_0x5426c9){return function(_0x1a24bd){if(_0x1a24bd){var _0x141878=typeof _0x5426c9[_0xbee5('0x19')]==='undefined'&&typeof _0x5426c9[_0xbee5('0x1a')]===_0xbee5('0x1b');var _0x5a0ae5=_0x1a24bd[_0xbee5('0x1c')];var _0x538460=_0x141878?0x0:_0x5426c9[_0xbee5('0x19')];var _0x3c3f4e=_0x141878?_0x1a24bd[_0xbee5('0x1c')]:_0x5426c9[_0xbee5('0x19')]+_0x5426c9[_0xbee5('0x1a')];var _0xa50ec9;if(_0x3c3f4e>=_0x5a0ae5){_0x3c3f4e=_0x5a0ae5;_0xa50ec9=0xc8;}else{_0xa50ec9=0xce;}_0x40afcb[_0xbee5('0x17')](_0xa50ec9);return _0x40afcb[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x538460+'-'+_0x3c3f4e+'/'+_0x5a0ae5)[_0xbee5('0x1f')](_0x1a24bd);}return null;};}function patchUpdates(_0x35d7d3){return function(_0x40a06){try{jsonpatch[_0xbee5('0x20')](_0x40a06,_0x35d7d3,!![]);}catch(_0x47af8e){return BPromise['reject'](_0x47af8e);}return _0x40a06[_0xbee5('0x21')]();};}function saveUpdates(_0x48bfb5,_0x205491){return function(_0x117cb3){if(_0x117cb3){return _0x117cb3[_0xbee5('0x22')](_0x48bfb5)[_0xbee5('0x23')](function(_0x3f23c5){return _0x3f23c5;});}return null;};}function removeEntity(_0xb665df,_0x359ccf){return function(_0x3cfa8d){if(_0x3cfa8d){return _0x3cfa8d[_0xbee5('0x24')]()['then'](function(){var _0x5b43b3=_0x3cfa8d['get']({'plain':!![]});var _0x519473='Voicemails';return db[_0xbee5('0x25')][_0xbee5('0x24')]({'where':{'type':_0x519473,'resourceId':_0x5b43b3['id']}})[_0xbee5('0x23')](function(){return _0x3cfa8d;});})[_0xbee5('0x23')](function(){_0xb665df[_0xbee5('0x17')](0xcc)[_0xbee5('0x18')]();});}};}function handleEntityNotFound(_0x3c8643,_0x4e9a79){return function(_0x36b50f){if(!_0x36b50f){_0x3c8643[_0xbee5('0x26')](0x194);}return _0x36b50f;};}function handleError(_0x179d14,_0x39da95){_0x39da95=_0x39da95||0x1f4;return function(_0x1a8bcc){logger['error'](_0x1a8bcc[_0xbee5('0x27')]);if(_0x1a8bcc[_0xbee5('0x28')]){delete _0x1a8bcc[_0xbee5('0x28')];}_0x179d14[_0xbee5('0x17')](_0x39da95)[_0xbee5('0x29')](_0x1a8bcc);};}exports[_0xbee5('0x2a')]=function(_0x34b7df,_0x36e8bb){var _0x2ccb91={},_0x59c2e4={},_0x22df5f={'count':0x0,'rows':[]};var _0x5b10a6=_[_0xbee5('0x2b')](db['VoiceMail'][_0xbee5('0x2c')],function(_0x52dad9){return{'name':_0x52dad9[_0xbee5('0x2d')],'type':_0x52dad9['type'][_0xbee5('0x2e')]};});_0x59c2e4[_0xbee5('0x2f')]=_[_0xbee5('0x2b')](_0x5b10a6,_0xbee5('0x28'));_0x59c2e4['query']=_[_0xbee5('0x30')](_0x34b7df[_0xbee5('0x31')]);_0x59c2e4[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x59c2e4['model'],_0x59c2e4[_0xbee5('0x31')]);_0x2ccb91[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x59c2e4[_0xbee5('0x2f')],qs['fields'](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x35')]));_0x2ccb91[_0xbee5('0x34')]=_0x2ccb91[_0xbee5('0x34')]['length']?_0x2ccb91[_0xbee5('0x34')]:_0x59c2e4['model'];if(!_0x34b7df[_0xbee5('0x31')]['hasOwnProperty']('nolimit')){_0x2ccb91['limit']=qs[_0xbee5('0x1a')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2ccb91[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x19')]);}_0x2ccb91[_0xbee5('0x36')]=qs['sort'](_0x34b7df[_0xbee5('0x31')]['sort']);_0x2ccb91[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_[_0xbee5('0x38')](_0x34b7df[_0xbee5('0x31')],_0x59c2e4['filters']),_0x5b10a6);if(_0x34b7df[_0xbee5('0x31')]['filter']){_0x2ccb91['where']=_[_0xbee5('0x39')](_0x2ccb91[_0xbee5('0x37')],{'$or':_[_0xbee5('0x2b')](_0x5b10a6,function(_0x1974f2){if(_0x1974f2['type']!==_0xbee5('0x3a')){var _0x2819e2={};_0x2819e2[_0x1974f2[_0xbee5('0x28')]]={'$like':'%'+_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x2819e2;}})});}_0x2ccb91=_[_0xbee5('0x39')]({},_0x2ccb91,_0x34b7df[_0xbee5('0x3c')]);var _0x297294={'where':_0x2ccb91[_0xbee5('0x37')]};return db[_0xbee5('0x3d')]['count'](_0x297294)[_0xbee5('0x23')](function(_0x371015){_0x22df5f['count']=_0x371015;if(_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x2ccb91[_0xbee5('0x3f')]=[{'all':!![]}];}return db[_0xbee5('0x3d')]['findAll'](_0x2ccb91);})['then'](function(_0x4b4641){_0x22df5f[_0xbee5('0x40')]=_0x4b4641;return _0x22df5f;})[_0xbee5('0x23')](respondWithFilteredResult(_0x36e8bb,_0x2ccb91))[_0xbee5('0x41')](handleError(_0x36e8bb,null));};exports[_0xbee5('0x42')]=function(_0x4012fd,_0x3f5441){var _0x41cea0={'raw':!![],'where':{'id':_0x4012fd[_0xbee5('0x43')]['id']}},_0x2c4464={};_0x2c4464['model']=_['keys'](db[_0xbee5('0x3d')]['rawAttributes']);_0x2c4464[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x4012fd['query']);_0x2c4464[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x2c4464['model'],_0x2c4464['query']);_0x41cea0[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x2c4464['model'],qs[_0xbee5('0x35')](_0x4012fd[_0xbee5('0x31')]['fields']));_0x41cea0[_0xbee5('0x34')]=_0x41cea0[_0xbee5('0x34')][_0xbee5('0x44')]?_0x41cea0[_0xbee5('0x34')]:_0x2c4464[_0xbee5('0x2f')];if(_0x4012fd[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x41cea0['include']=[{'all':!![]}];}_0x41cea0=_[_0xbee5('0x39')]({},_0x41cea0,_0x4012fd[_0xbee5('0x3c')]);return db[_0xbee5('0x3d')][_0xbee5('0x45')](_0x41cea0)['then'](handleEntityNotFound(_0x3f5441,null))[_0xbee5('0x23')](respondWithResult(_0x3f5441,null))[_0xbee5('0x41')](handleError(_0x3f5441,null));};exports[_0xbee5('0x46')]=function(_0x4aa21a,_0x44d4b1){return db[_0xbee5('0x3d')]['create'](_0x4aa21a['body'],{})['then'](function(_0x3a27bb){var _0x501167=_0x4aa21a[_0xbee5('0x47')][_0xbee5('0x48')]({'plain':!![]});if(!_0x501167)throw new Error(_0xbee5('0x49'));if(_0x501167[_0xbee5('0x4a')]===_0xbee5('0x47')){var _0x296fc8=_0x3a27bb['get']({'plain':!![]});var _0x24274d=_0xbee5('0x4b');return db[_0xbee5('0x4c')][_0xbee5('0x45')]({'where':{'name':_0x24274d,'userProfileId':_0x501167['userProfileId']},'raw':!![]})[_0xbee5('0x23')](function(_0x594dcf){if(_0x594dcf&&_0x594dcf[_0xbee5('0x4d')]===0x0){return db[_0xbee5('0x25')][_0xbee5('0x46')]({'name':_0x296fc8[_0xbee5('0x28')],'resourceId':_0x296fc8['id'],'type':_0x594dcf[_0xbee5('0x28')],'sectionId':_0x594dcf['id']},{})[_0xbee5('0x23')](function(){return _0x3a27bb;});}else{return _0x3a27bb;}})[_0xbee5('0x41')](function(_0x35f1d1){logger[_0xbee5('0x4e')](_0xbee5('0x4f'),_0x35f1d1);throw _0x35f1d1;});}return _0x3a27bb;})[_0xbee5('0x23')](respondWithResult(_0x44d4b1,0xc9))[_0xbee5('0x41')](handleError(_0x44d4b1,null));};exports[_0xbee5('0x22')]=function(_0x359738,_0x37cf74){if(_0x359738['body']['id']){delete _0x359738[_0xbee5('0x50')]['id'];}return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x359738['params']['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0x37cf74,null))[_0xbee5('0x23')](saveUpdates(_0x359738[_0xbee5('0x50')],null))['then'](respondWithResult(_0x37cf74,null))[_0xbee5('0x41')](handleError(_0x37cf74,null));};exports['destroy']=function(_0x131c45,_0x4ee645){return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x131c45[_0xbee5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee645,null))['then'](removeEntity(_0x4ee645,null))['catch'](handleError(_0x4ee645,null));};exports[_0xbee5('0x51')]=function(_0x684cd4,_0xbc3da7,_0x5b1a05){return db[_0xbee5('0x3d')]['findOne']({'where':{'id':_0x684cd4[_0xbee5('0x43')]['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0xbc3da7,null))[_0xbee5('0x23')](function(_0x5cc68d){var _0x154d44;var _0x2c0958={},_0x1c6f52={};_0x1c6f52[_0xbee5('0x2f')]=_[_0xbee5('0x30')](db[_0xbee5('0x52')][_0xbee5('0x2c')]);_0x1c6f52[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x684cd4[_0xbee5('0x31')]);_0x1c6f52[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x1c6f52[_0xbee5('0x2f')],_0x1c6f52[_0xbee5('0x31')]);_0x2c0958[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x1c6f52[_0xbee5('0x2f')],qs['fields'](_0x684cd4[_0xbee5('0x31')]['fields']));_0x2c0958['attributes']=_0x2c0958[_0xbee5('0x34')][_0xbee5('0x44')]?_0x2c0958['attributes']:_0x1c6f52['model'];if(!_0x684cd4[_0xbee5('0x31')]['hasOwnProperty'](_0xbee5('0x53'))){_0x2c0958[_0xbee5('0x1a')]=qs['limit'](_0x684cd4[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2c0958[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x684cd4['query'][_0xbee5('0x19')]);}_0x2c0958['order']=qs[_0xbee5('0x54')](_0x684cd4[_0xbee5('0x31')]['sort']);_0x2c0958[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_['pick'](_0x684cd4[_0xbee5('0x31')],_0x1c6f52[_0xbee5('0x32')]));if(_0x684cd4['query'][_0xbee5('0x3b')]){_0x2c0958['where']=_[_0xbee5('0x39')](_0x2c0958['where'],{'$or':_[_0xbee5('0x2b')](_0x2c0958['attributes'],function(_0x541414){var _0x3120f5={};_0x3120f5[_0x541414]={'$like':'%'+_0x684cd4[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x3120f5;})});}_0x2c0958[_0xbee5('0x37')]=_[_0xbee5('0x39')](_0x2c0958[_0xbee5('0x37')],{'mailboxuser':_0x5cc68d['mailbox']});_0x2c0958=_[_0xbee5('0x39')]({},_0x2c0958,_0x684cd4[_0xbee5('0x3c')]);return db[_0xbee5('0x52')][_0xbee5('0x55')](_0x2c0958)[_0xbee5('0x23')](respondWithFilteredResult(_0xbc3da7,_0x2c0958));})[_0xbee5('0x41')](handleError(_0xbc3da7,null));}; \ No newline at end of file +var _0x7af2=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','getMessages','findOne','VoiceMailMessage','rawAttributes','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create'];(function(_0x225afd,_0x162f77){var _0x206fa4=function(_0x310e16){while(--_0x310e16){_0x225afd['push'](_0x225afd['shift']());}};_0x206fa4(++_0x162f77);}(_0x7af2,0x119));var _0x27af=function(_0x51e285,_0x5e35e7){_0x51e285=_0x51e285-0x0;var _0x3da75f=_0x7af2[_0x51e285];return _0x3da75f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];function respondWithStatusCode(_0x49a883,_0x406340){_0x406340=_0x406340||0xcc;return function(_0x203501){if(_0x203501){return _0x49a883[_0x27af('0x17')](_0x406340);}return _0x49a883[_0x27af('0x18')](_0x406340)[_0x27af('0x19')]();};}function respondWithResult(_0x1edb50,_0x234825){_0x234825=_0x234825||0xc8;return function(_0x3da435){if(_0x3da435){return _0x1edb50[_0x27af('0x18')](_0x234825)[_0x27af('0x1a')](_0x3da435);}};}function respondWithFilteredResult(_0x30f675,_0x9c2d4b){return function(_0x2d7800){if(_0x2d7800){var _0x3102c4=typeof _0x9c2d4b[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x9c2d4b[_0x27af('0x1d')]===_0x27af('0x1c');var _0x58583a=_0x2d7800[_0x27af('0x1e')];var _0x31d702=_0x3102c4?0x0:_0x9c2d4b['offset'];var _0x4e6e2f=_0x3102c4?_0x2d7800[_0x27af('0x1e')]:_0x9c2d4b[_0x27af('0x1b')]+_0x9c2d4b[_0x27af('0x1d')];var _0x31573a;if(_0x4e6e2f>=_0x58583a){_0x4e6e2f=_0x58583a;_0x31573a=0xc8;}else{_0x31573a=0xce;}_0x30f675[_0x27af('0x18')](_0x31573a);return _0x30f675['set'](_0x27af('0x1f'),_0x31d702+'-'+_0x4e6e2f+'/'+_0x58583a)[_0x27af('0x1a')](_0x2d7800);}return null;};}function patchUpdates(_0xcb4b90){return function(_0x5e7c19){try{jsonpatch[_0x27af('0x20')](_0x5e7c19,_0xcb4b90,!![]);}catch(_0x2eec5f){return BPromise[_0x27af('0x21')](_0x2eec5f);}return _0x5e7c19['save']();};}function saveUpdates(_0x2dce2b,_0x2460f4){return function(_0x30720b){if(_0x30720b){return _0x30720b[_0x27af('0x22')](_0x2dce2b)[_0x27af('0x23')](function(_0x396156){return _0x396156;});}return null;};}function removeEntity(_0x43dd9e,_0x35b36d){return function(_0x2e1bb0){if(_0x2e1bb0){return _0x2e1bb0['destroy']()['then'](function(){var _0x4b8fe6=_0x2e1bb0[_0x27af('0x24')]({'plain':!![]});var _0x4feaf1=_0x27af('0x25');return db[_0x27af('0x26')]['destroy']({'where':{'type':_0x4feaf1,'resourceId':_0x4b8fe6['id']}})[_0x27af('0x23')](function(){return _0x2e1bb0;});})[_0x27af('0x23')](function(){_0x43dd9e[_0x27af('0x18')](0xcc)[_0x27af('0x19')]();});}};}function handleEntityNotFound(_0x39b8ee,_0x3ca40e){return function(_0x775d4e){if(!_0x775d4e){_0x39b8ee['sendStatus'](0x194);}return _0x775d4e;};}function handleError(_0x14d5fc,_0x250d5b){_0x250d5b=_0x250d5b||0x1f4;return function(_0xadd38e){logger[_0x27af('0x27')](_0xadd38e[_0x27af('0x28')]);if(_0xadd38e[_0x27af('0x29')]){delete _0xadd38e[_0x27af('0x29')];}_0x14d5fc[_0x27af('0x18')](_0x250d5b)[_0x27af('0x2a')](_0xadd38e);};}exports[_0x27af('0x2b')]=function(_0x205e41,_0x4f4955){var _0x15e867={},_0x14b2e7={},_0x3800a1={'count':0x0,'rows':[]};var _0x575887=_[_0x27af('0x2c')](db[_0x27af('0x2d')]['rawAttributes'],function(_0x51bc97){return{'name':_0x51bc97[_0x27af('0x2e')],'type':_0x51bc97[_0x27af('0x2f')]['key']};});_0x14b2e7[_0x27af('0x30')]=_[_0x27af('0x2c')](_0x575887,_0x27af('0x29'));_0x14b2e7[_0x27af('0x31')]=_[_0x27af('0x32')](_0x205e41[_0x27af('0x31')]);_0x14b2e7[_0x27af('0x33')]=_[_0x27af('0x34')](_0x14b2e7[_0x27af('0x30')],_0x14b2e7[_0x27af('0x31')]);_0x15e867[_0x27af('0x35')]=_['intersection'](_0x14b2e7['model'],qs[_0x27af('0x36')](_0x205e41[_0x27af('0x31')]['fields']));_0x15e867[_0x27af('0x35')]=_0x15e867[_0x27af('0x35')]['length']?_0x15e867[_0x27af('0x35')]:_0x14b2e7[_0x27af('0x30')];if(!_0x205e41[_0x27af('0x31')][_0x27af('0x37')](_0x27af('0x38'))){_0x15e867['limit']=qs[_0x27af('0x1d')](_0x205e41[_0x27af('0x31')]['limit']);_0x15e867['offset']=qs[_0x27af('0x1b')](_0x205e41[_0x27af('0x31')][_0x27af('0x1b')]);}_0x15e867[_0x27af('0x39')]=qs[_0x27af('0x3a')](_0x205e41[_0x27af('0x31')]['sort']);_0x15e867[_0x27af('0x3b')]=qs['filters'](_[_0x27af('0x3c')](_0x205e41[_0x27af('0x31')],_0x14b2e7[_0x27af('0x33')]),_0x575887);if(_0x205e41[_0x27af('0x31')][_0x27af('0x3d')]){_0x15e867['where']=_[_0x27af('0x3e')](_0x15e867[_0x27af('0x3b')],{'$or':_[_0x27af('0x2c')](_0x575887,function(_0x3faebd){if(_0x3faebd[_0x27af('0x2f')]!==_0x27af('0x3f')){var _0x415d9f={};_0x415d9f[_0x3faebd[_0x27af('0x29')]]={'$like':'%'+_0x205e41[_0x27af('0x31')][_0x27af('0x3d')]+'%'};return _0x415d9f;}})});}_0x15e867=_[_0x27af('0x3e')]({},_0x15e867,_0x205e41[_0x27af('0x40')]);var _0x24ee9b={'where':_0x15e867[_0x27af('0x3b')]};return db['VoiceMail'][_0x27af('0x1e')](_0x24ee9b)[_0x27af('0x23')](function(_0x44534b){_0x3800a1[_0x27af('0x1e')]=_0x44534b;if(_0x205e41['query'][_0x27af('0x41')]){_0x15e867['include']=[{'all':!![]}];}return db['VoiceMail'][_0x27af('0x42')](_0x15e867);})[_0x27af('0x23')](function(_0x279f99){_0x3800a1[_0x27af('0x43')]=_0x279f99;return _0x3800a1;})[_0x27af('0x23')](respondWithFilteredResult(_0x4f4955,_0x15e867))[_0x27af('0x44')](handleError(_0x4f4955,null));};exports[_0x27af('0x45')]=function(_0x26eb28,_0x2269e8){var _0x100fcb={'raw':!![],'where':{'id':_0x26eb28[_0x27af('0x46')]['id']}},_0x1e3c35={};_0x1e3c35['model']=_[_0x27af('0x32')](db[_0x27af('0x2d')]['rawAttributes']);_0x1e3c35['query']=_[_0x27af('0x32')](_0x26eb28[_0x27af('0x31')]);_0x1e3c35[_0x27af('0x33')]=_[_0x27af('0x34')](_0x1e3c35[_0x27af('0x30')],_0x1e3c35['query']);_0x100fcb[_0x27af('0x35')]=_['intersection'](_0x1e3c35[_0x27af('0x30')],qs[_0x27af('0x36')](_0x26eb28[_0x27af('0x31')][_0x27af('0x36')]));_0x100fcb[_0x27af('0x35')]=_0x100fcb[_0x27af('0x35')][_0x27af('0x47')]?_0x100fcb['attributes']:_0x1e3c35['model'];if(_0x26eb28[_0x27af('0x31')]['includeAll']){_0x100fcb[_0x27af('0x48')]=[{'all':!![]}];}_0x100fcb=_[_0x27af('0x3e')]({},_0x100fcb,_0x26eb28[_0x27af('0x40')]);return db[_0x27af('0x2d')][_0x27af('0x49')](_0x100fcb)[_0x27af('0x23')](handleEntityNotFound(_0x2269e8,null))[_0x27af('0x23')](respondWithResult(_0x2269e8,null))['catch'](handleError(_0x2269e8,null));};exports[_0x27af('0x4a')]=function(_0xc7e2a8,_0x20e180){return db[_0x27af('0x2d')][_0x27af('0x4a')](_0xc7e2a8['body'],{})[_0x27af('0x23')](function(_0x25f960){var _0x28ba64=_0xc7e2a8['user']['get']({'plain':!![]});if(!_0x28ba64)throw new Error(_0x27af('0x4b'));if(_0x28ba64[_0x27af('0x4c')]===_0x27af('0x4d')){var _0x5be44f=_0x25f960['get']({'plain':!![]});var _0x2fad23='Voicemails';return db[_0x27af('0x4e')][_0x27af('0x49')]({'where':{'name':_0x2fad23,'userProfileId':_0x28ba64[_0x27af('0x4f')]},'raw':!![]})[_0x27af('0x23')](function(_0x38aa14){if(_0x38aa14&&_0x38aa14[_0x27af('0x50')]===0x0){return db[_0x27af('0x26')][_0x27af('0x4a')]({'name':_0x5be44f[_0x27af('0x29')],'resourceId':_0x5be44f['id'],'type':_0x38aa14[_0x27af('0x29')],'sectionId':_0x38aa14['id']},{})[_0x27af('0x23')](function(){return _0x25f960;});}else{return _0x25f960;}})['catch'](function(_0x76ed78){logger[_0x27af('0x27')](_0x27af('0x51'),_0x76ed78);throw _0x76ed78;});}return _0x25f960;})[_0x27af('0x23')](respondWithResult(_0x20e180,0xc9))[_0x27af('0x44')](handleError(_0x20e180,null));};exports[_0x27af('0x22')]=function(_0x20c155,_0x31eaa9){if(_0x20c155['body']['id']){delete _0x20c155[_0x27af('0x52')]['id'];}return db['VoiceMail'][_0x27af('0x49')]({'where':{'id':_0x20c155[_0x27af('0x46')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x31eaa9,null))['then'](saveUpdates(_0x20c155[_0x27af('0x52')],null))['then'](respondWithResult(_0x31eaa9,null))[_0x27af('0x44')](handleError(_0x31eaa9,null));};exports[_0x27af('0x53')]=function(_0x4769ff,_0x5bf8b0){return db[_0x27af('0x2d')]['find']({'where':{'id':_0x4769ff[_0x27af('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bf8b0,null))[_0x27af('0x23')](removeEntity(_0x5bf8b0,null))[_0x27af('0x44')](handleError(_0x5bf8b0,null));};exports[_0x27af('0x54')]=function(_0x571064,_0x4bc851,_0x5eab7d){return db[_0x27af('0x2d')][_0x27af('0x55')]({'where':{'id':_0x571064[_0x27af('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bc851,null))[_0x27af('0x23')](function(_0x306c56){var _0x6761d4;var _0x34c855={},_0x299f63={};_0x299f63[_0x27af('0x30')]=_['keys'](db[_0x27af('0x56')][_0x27af('0x57')]);_0x299f63[_0x27af('0x31')]=_[_0x27af('0x32')](_0x571064['query']);_0x299f63[_0x27af('0x33')]=_['intersection'](_0x299f63[_0x27af('0x30')],_0x299f63[_0x27af('0x31')]);_0x34c855['attributes']=_[_0x27af('0x34')](_0x299f63[_0x27af('0x30')],qs['fields'](_0x571064['query'][_0x27af('0x36')]));_0x34c855[_0x27af('0x35')]=_0x34c855[_0x27af('0x35')]['length']?_0x34c855[_0x27af('0x35')]:_0x299f63[_0x27af('0x30')];if(!_0x571064['query'][_0x27af('0x37')](_0x27af('0x38'))){_0x34c855['limit']=qs['limit'](_0x571064[_0x27af('0x31')][_0x27af('0x1d')]);_0x34c855['offset']=qs['offset'](_0x571064[_0x27af('0x31')][_0x27af('0x1b')]);}_0x34c855[_0x27af('0x39')]=qs[_0x27af('0x3a')](_0x571064[_0x27af('0x31')][_0x27af('0x3a')]);_0x34c855[_0x27af('0x3b')]=qs['filters'](_['pick'](_0x571064[_0x27af('0x31')],_0x299f63[_0x27af('0x33')]));if(_0x571064[_0x27af('0x31')][_0x27af('0x3d')]){_0x34c855[_0x27af('0x3b')]=_[_0x27af('0x3e')](_0x34c855[_0x27af('0x3b')],{'$or':_[_0x27af('0x2c')](_0x34c855[_0x27af('0x35')],function(_0x13c9ff){var _0x444f21={};_0x444f21[_0x13c9ff]={'$like':'%'+_0x571064[_0x27af('0x31')][_0x27af('0x3d')]+'%'};return _0x444f21;})});}_0x34c855[_0x27af('0x3b')]=_[_0x27af('0x3e')](_0x34c855[_0x27af('0x3b')],{'mailboxuser':_0x306c56[_0x27af('0x58')]});_0x34c855=_['merge']({},_0x34c855,_0x571064[_0x27af('0x40')]);return db[_0x27af('0x56')]['findAndCountAll'](_0x34c855)[_0x27af('0x23')](respondWithFilteredResult(_0x4bc851,_0x34c855));})[_0x27af('0x44')](handleError(_0x4bc851,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9fe74c3..cc393f0 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 _0x9036=['bluebird','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','util','../../config/logger','api'];(function(_0x24a4bd,_0x2d1d58){var _0x5b9a74=function(_0x55dad6){while(--_0x55dad6){_0x24a4bd['push'](_0x24a4bd['shift']());}};_0x5b9a74(++_0x2d1d58);}(_0x9036,0x17e));var _0x6903=function(_0x2092c6,_0x3f2c53){_0x2092c6=_0x2092c6-0x0;var _0x20fadc=_0x9036[_0x2092c6];return _0x20fadc;};'use strict';var _=require('lodash');var util=require(_0x6903('0x0'));var logger=require(_0x6903('0x1'))(_0x6903('0x2'));var moment=require('moment');var BPromise=require(_0x6903('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6903('0x4'));var config=require('../../config/environment');var attributes=require(_0x6903('0x5'));module[_0x6903('0x6')]=function(_0x591e6e,_0x10853e){return _0x591e6e[_0x6903('0x7')](_0x6903('0x8'),attributes,{'tableName':_0x6903('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x6903('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbdf4=['define','mailbox_context','mailbox','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x392582,_0x3f19da){var _0x2b7456=function(_0x38df41){while(--_0x38df41){_0x392582['push'](_0x392582['shift']());}};_0x2b7456(++_0x3f19da);}(_0xbdf4,0x99));var _0x4bdf=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xbdf4[_0x28aea5];return _0x6a55f9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4bdf('0x0'))(_0x4bdf('0x1'));var moment=require('moment');var BPromise=require(_0x4bdf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bdf('0x3'));var rimraf=require(_0x4bdf('0x4'));var config=require(_0x4bdf('0x5'));var attributes=require('./voiceMail.attributes');module[_0x4bdf('0x6')]=function(_0x4fe705,_0x429d7d){return _0x4fe705[_0x4bdf('0x7')]('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4bdf('0x8'),'fields':[_0x4bdf('0x9'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 305e6ff..985ff08 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 _0xf7c5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2416ed,_0x379229){var _0x1f9c33=function(_0x3ac24c){while(--_0x3ac24c){_0x2416ed['push'](_0x2416ed['shift']());}};_0x1f9c33(++_0x379229);}(_0xf7c5,0x129));var _0x5f7c=function(_0x59ed8c,_0x497c0f){_0x59ed8c=_0x59ed8c-0x0;var _0x2ae760=_0xf7c5[_0x59ed8c];return _0x2ae760;};'use strict';var _=require(_0x5f7c('0x0'));var util=require(_0x5f7c('0x1'));var moment=require(_0x5f7c('0x2'));var BPromise=require(_0x5f7c('0x3'));var rs=require(_0x5f7c('0x4'));var fs=require('fs');var Redis=require(_0x5f7c('0x5'));var db=require(_0x5f7c('0x6'))['db'];var utils=require(_0x5f7c('0x7'));var logger=require(_0x5f7c('0x8'))(_0x5f7c('0x9'));var config=require(_0x5f7c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5f7c('0xb')][_0x5f7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54e9fb,_0x5dee90,_0x167615){return new BPromise(function(_0xdd2ee8,_0xe32503){return client['request'](_0x54e9fb,_0x167615)['then'](function(_0x108759){logger[_0x5f7c('0xd')](_0x5f7c('0xe'),_0x5dee90,_0x5f7c('0xf'));logger['debug'](_0x5f7c('0x10'),_0x5dee90,_0x5f7c('0xf'),JSON[_0x5f7c('0x11')](_0x108759));if(_0x108759[_0x5f7c('0x12')]){if(_0x108759[_0x5f7c('0x12')][_0x5f7c('0x13')]===0x1f4){logger['error'](_0x5f7c('0xe'),_0x5dee90,_0x108759[_0x5f7c('0x12')][_0x5f7c('0x14')]);return _0xe32503(_0x108759[_0x5f7c('0x12')][_0x5f7c('0x14')]);}logger['error'](_0x5f7c('0xe'),_0x5dee90,_0x108759[_0x5f7c('0x12')][_0x5f7c('0x14')]);return _0xdd2ee8(_0x108759[_0x5f7c('0x12')]['message']);}else{logger['info'](_0x5f7c('0xe'),_0x5dee90,_0x5f7c('0xf'));_0xdd2ee8(_0x108759[_0x5f7c('0x15')][_0x5f7c('0x14')]);}})[_0x5f7c('0x16')](function(_0x360d2f){logger['error']('VoiceMail,\x20%s,\x20%s',_0x5dee90,_0x360d2f);_0xe32503(_0x360d2f);});});} \ No newline at end of file +var _0x1fcf=['info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceMail,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x1fcf,0x158));var _0xf1fc=function(_0x3e7b67,_0x2f6f3f){_0x3e7b67=_0x3e7b67-0x0;var _0x40de5f=_0x1fcf[_0x3e7b67];return _0x40de5f;};'use strict';var _=require(_0xf1fc('0x0'));var util=require(_0xf1fc('0x1'));var moment=require(_0xf1fc('0x2'));var BPromise=require(_0xf1fc('0x3'));var rs=require(_0xf1fc('0x4'));var fs=require('fs');var Redis=require(_0xf1fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1fc('0x6'));var logger=require(_0xf1fc('0x7'))(_0xf1fc('0x8'));var config=require(_0xf1fc('0x9'));var jayson=require(_0xf1fc('0xa'));var client=jayson[_0xf1fc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47de05,_0x350e8f,_0x48f132){return new BPromise(function(_0x365e87,_0x2ecc9f){return client[_0xf1fc('0xc')](_0x47de05,_0x48f132)['then'](function(_0xb2c495){logger[_0xf1fc('0xd')]('VoiceMail,\x20%s,\x20%s',_0x350e8f,'request\x20sent');logger[_0xf1fc('0xe')](_0xf1fc('0xf'),_0x350e8f,_0xf1fc('0x10'),JSON['stringify'](_0xb2c495));if(_0xb2c495[_0xf1fc('0x11')]){if(_0xb2c495[_0xf1fc('0x11')]['code']===0x1f4){logger[_0xf1fc('0x11')](_0xf1fc('0x12'),_0x350e8f,_0xb2c495['error'][_0xf1fc('0x13')]);return _0x2ecc9f(_0xb2c495[_0xf1fc('0x11')][_0xf1fc('0x13')]);}logger[_0xf1fc('0x11')](_0xf1fc('0x12'),_0x350e8f,_0xb2c495['error'][_0xf1fc('0x13')]);return _0x365e87(_0xb2c495[_0xf1fc('0x11')][_0xf1fc('0x13')]);}else{logger['info'](_0xf1fc('0x12'),_0x350e8f,_0xf1fc('0x10'));_0x365e87(_0xb2c495['result']['message']);}})[_0xf1fc('0x14')](function(_0xa41ccd){logger[_0xf1fc('0x11')](_0xf1fc('0x12'),_0x350e8f,_0xa41ccd);_0x2ecc9f(_0xa41ccd);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 2a653d8..caa2bc3 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 _0xe643=['get','index','isAuthenticated','show','/:id/download','download','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./voiceMailMessage.controller'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe643,0x1b0));var _0x3e64=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe643[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3e64('0x0'));var util=require(_0x3e64('0x1'));var path=require(_0x3e64('0x2'));var timeout=require(_0x3e64('0x3'));var express=require(_0x3e64('0x4'));var router=express['Router']();var fs_extra=require(_0x3e64('0x5'));var auth=require(_0x3e64('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e64('0x7'));router[_0x3e64('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e64('0x9')]);router[_0x3e64('0x8')]('/:id',auth[_0x3e64('0xa')](),controller[_0x3e64('0xb')]);router['get'](_0x3e64('0xc'),auth[_0x3e64('0xa')](),controller[_0x3e64('0xd')]);router[_0x3e64('0xe')]('/',auth[_0x3e64('0xa')](),controller[_0x3e64('0xf')]);router[_0x3e64('0x10')]('/:id',auth[_0x3e64('0xa')](),controller[_0x3e64('0x11')]);router[_0x3e64('0x12')](_0x3e64('0x13'),auth[_0x3e64('0xa')](),controller[_0x3e64('0x14')]);module[_0x3e64('0x15')]=router; \ No newline at end of file +var _0x7ebe=['isAuthenticated','index','get','/:id','download','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x49693f,_0x4d994f){var _0x1b0f6e=function(_0x4b2c16){while(--_0x4b2c16){_0x49693f['push'](_0x49693f['shift']());}};_0x1b0f6e(++_0x4d994f);}(_0x7ebe,0x68));var _0xe7eb=function(_0x2fe875,_0x418807){_0x2fe875=_0x2fe875-0x0;var _0x33b8c5=_0x7ebe[_0x2fe875];return _0x33b8c5;};'use strict';var multer=require(_0xe7eb('0x0'));var util=require('util');var path=require(_0xe7eb('0x1'));var timeout=require(_0xe7eb('0x2'));var express=require(_0xe7eb('0x3'));var router=express[_0xe7eb('0x4')]();var fs_extra=require(_0xe7eb('0x5'));var auth=require(_0xe7eb('0x6'));var interaction=require(_0xe7eb('0x7'));var config=require(_0xe7eb('0x8'));var controller=require(_0xe7eb('0x9'));router['get']('/',auth[_0xe7eb('0xa')](),controller[_0xe7eb('0xb')]);router[_0xe7eb('0xc')](_0xe7eb('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe7eb('0xc')]('/:id/download',auth[_0xe7eb('0xa')](),controller[_0xe7eb('0xe')]);router['post']('/',auth[_0xe7eb('0xa')](),controller['create']);router[_0xe7eb('0xf')](_0xe7eb('0xd'),auth['isAuthenticated'](),controller[_0xe7eb('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe7eb('0x11')]);module[_0xe7eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ac57737..a28e540 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 _0x14b5=['TIMESTAMP','literal','sequelize','exports','INTEGER','STRING','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14b5,0x1bb));var _0x514b=function(_0x5c42fb,_0x5e1a07){_0x5c42fb=_0x5c42fb-0x0;var _0x5d7701=_0x14b5[_0x5c42fb];return _0x5d7701;};'use strict';var Sequelize=require(_0x514b('0x0'));module[_0x514b('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x24c5a8){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x514b('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x514b('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x514b('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x514b('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x514b('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x514b('0x3')],'defaultValue':''},'stamp':{'type':_0x514b('0x5'),'defaultValue':Sequelize[_0x514b('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xbeb3=['getDataValue','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL'];(function(_0x161c02,_0x214d43){var _0x35ca3e=function(_0x4223c0){while(--_0x4223c0){_0x161c02['push'](_0x161c02['shift']());}};_0x35ca3e(++_0x214d43);}(_0xbeb3,0xbb));var _0x3beb=function(_0x45c61e,_0x59694d){_0x45c61e=_0x45c61e-0x0;var _0x19033c=_0xbeb3[_0x45c61e];return _0x19033c;};'use strict';var Sequelize=require(_0x3beb('0x0'));module['exports']={'name':{'type':Sequelize[_0x3beb('0x1')],'get':function(_0xf91e5a){return this[_0x3beb('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3beb('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3beb('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3beb('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3beb('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x3beb('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x3beb('0x4')](_0x3beb('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x3beb('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3beb('0x3')],'defaultValue':''},'stamp':{'type':_0x3beb('0x6'),'defaultValue':Sequelize[_0x3beb('0x7')](_0x3beb('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 4d0c550..f22ce9f 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 _0x47b1=['ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceMailMessage','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','download','recording','msg_id'];(function(_0x2cc37c,_0x45a5d9){var _0x300cf1=function(_0x592e3f){while(--_0x592e3f){_0x2cc37c['push'](_0x2cc37c['shift']());}};_0x300cf1(++_0x45a5d9);}(_0x47b1,0xfb));var _0x147b=function(_0x15e7ea,_0x58254f){_0x15e7ea=_0x15e7ea-0x0;var _0x2c1e17=_0x47b1[_0x15e7ea];return _0x2c1e17;};'use strict';var emlformat=require(_0x147b('0x0'));var rimraf=require(_0x147b('0x1'));var zipdir=require(_0x147b('0x2'));var jsonpatch=require(_0x147b('0x3'));var rp=require(_0x147b('0x4'));var moment=require(_0x147b('0x5'));var BPromise=require(_0x147b('0x6'));var Mustache=require(_0x147b('0x7'));var util=require(_0x147b('0x8'));var path=require('path');var sox=require(_0x147b('0x9'));var csv=require('to-csv');var ejs=require(_0x147b('0xa'));var fs=require('fs');var fs_extra=require(_0x147b('0xb'));var _=require(_0x147b('0xc'));var squel=require(_0x147b('0xd'));var crypto=require(_0x147b('0xe'));var jsforce=require(_0x147b('0xf'));var deskjs=require(_0x147b('0x10'));var toCsv=require(_0x147b('0x11'));var querystring=require(_0x147b('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x147b('0x13'));var as=require(_0x147b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x147b('0x15'))(_0x147b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17f3b1,_0x24493b){_0x24493b=_0x24493b||0xcc;return function(_0x181527){if(_0x181527){return _0x17f3b1['sendStatus'](_0x24493b);}return _0x17f3b1[_0x147b('0x17')](_0x24493b)[_0x147b('0x18')]();};}function respondWithResult(_0x1d8f51,_0x1d7aec){_0x1d7aec=_0x1d7aec||0xc8;return function(_0x292b09){if(_0x292b09){return _0x1d8f51['status'](_0x1d7aec)[_0x147b('0x19')](_0x292b09);}};}function respondWithFilteredResult(_0x49fa9b,_0x3983cf){return function(_0x8f23e4){if(_0x8f23e4){var _0x4c584a=typeof _0x3983cf[_0x147b('0x1a')]===_0x147b('0x1b')&&typeof _0x3983cf[_0x147b('0x1c')]==='undefined';var _0x4e353b=_0x8f23e4['count'];var _0x174bd0=_0x4c584a?0x0:_0x3983cf[_0x147b('0x1a')];var _0x562596=_0x4c584a?_0x8f23e4[_0x147b('0x1d')]:_0x3983cf[_0x147b('0x1a')]+_0x3983cf[_0x147b('0x1c')];var _0x529b7c;if(_0x562596>=_0x4e353b){_0x562596=_0x4e353b;_0x529b7c=0xc8;}else{_0x529b7c=0xce;}_0x49fa9b['status'](_0x529b7c);return _0x49fa9b[_0x147b('0x1e')](_0x147b('0x1f'),_0x174bd0+'-'+_0x562596+'/'+_0x4e353b)[_0x147b('0x19')](_0x8f23e4);}return null;};}function patchUpdates(_0x32ab15){return function(_0x260252){try{jsonpatch[_0x147b('0x20')](_0x260252,_0x32ab15,!![]);}catch(_0x5a8dd4){return BPromise[_0x147b('0x21')](_0x5a8dd4);}return _0x260252[_0x147b('0x22')]();};}function saveUpdates(_0x2cb628,_0x16dfd7){return function(_0x3639c1){if(_0x3639c1){return _0x3639c1[_0x147b('0x23')](_0x2cb628)[_0x147b('0x24')](function(_0x3d87cb){return _0x3d87cb;});}return null;};}function removeEntity(_0x4c2a35,_0xedb254){return function(_0x133054){if(_0x133054){return _0x133054[_0x147b('0x25')]()[_0x147b('0x24')](function(){_0x4c2a35[_0x147b('0x17')](0xcc)[_0x147b('0x18')]();});}};}function handleEntityNotFound(_0x2c39d7,_0x2b24f1){return function(_0x2ccab8){if(!_0x2ccab8){_0x2c39d7[_0x147b('0x26')](0x194);}return _0x2ccab8;};}function handleError(_0x2bf7ab,_0x4648cc){_0x4648cc=_0x4648cc||0x1f4;return function(_0x2aa3a1){logger[_0x147b('0x27')](_0x2aa3a1[_0x147b('0x28')]);if(_0x2aa3a1[_0x147b('0x29')]){delete _0x2aa3a1[_0x147b('0x29')];}_0x2bf7ab[_0x147b('0x17')](_0x4648cc)[_0x147b('0x2a')](_0x2aa3a1);};}exports['index']=function(_0x2b3008,_0x2f05cc){var _0x31179c={},_0x208035={},_0x13c7b1={'count':0x0,'rows':[]};var _0x3ff2ed=_[_0x147b('0x2b')](db[_0x147b('0x2c')]['rawAttributes'],function(_0x1a2d89){return{'name':_0x1a2d89['fieldName'],'type':_0x1a2d89[_0x147b('0x2d')][_0x147b('0x2e')]};});_0x208035[_0x147b('0x2f')]=_['differenceBy'](_[_0x147b('0x2b')](_0x3ff2ed,_0x147b('0x29')),[_0x147b('0x29')]);_0x208035[_0x147b('0x30')]=_['keys'](_0x2b3008[_0x147b('0x30')]);_0x208035[_0x147b('0x31')]=_[_0x147b('0x32')](_0x208035[_0x147b('0x2f')],_0x208035[_0x147b('0x30')]);_0x31179c['attributes']=_[_0x147b('0x32')](_0x208035[_0x147b('0x2f')],qs[_0x147b('0x33')](_0x2b3008[_0x147b('0x30')][_0x147b('0x33')]));_0x31179c['attributes']=_0x31179c[_0x147b('0x34')][_0x147b('0x35')]?_0x31179c['attributes']:_0x208035[_0x147b('0x2f')];if(!_0x2b3008[_0x147b('0x30')][_0x147b('0x36')](_0x147b('0x37'))){_0x31179c[_0x147b('0x1c')]=qs['limit'](_0x2b3008[_0x147b('0x30')][_0x147b('0x1c')]);_0x31179c[_0x147b('0x1a')]=qs[_0x147b('0x1a')](_0x2b3008[_0x147b('0x30')][_0x147b('0x1a')]);}_0x31179c[_0x147b('0x38')]=qs['sort'](_0x2b3008['query']['sort']);_0x31179c[_0x147b('0x39')]=qs[_0x147b('0x31')](_[_0x147b('0x3a')](_0x2b3008['query'],_0x208035[_0x147b('0x31')]),_0x3ff2ed);if(_0x2b3008['query'][_0x147b('0x3b')]){_0x31179c[_0x147b('0x39')]=_[_0x147b('0x3c')](_0x31179c['where'],{'$or':_[_0x147b('0x2b')](_0x3ff2ed,function(_0x31bd0c){if(_0x31bd0c['type']!==_0x147b('0x3d')){var _0x288f86={};_0x288f86[_0x31bd0c[_0x147b('0x29')]]={'$like':'%'+_0x2b3008[_0x147b('0x30')][_0x147b('0x3b')]+'%'};return _0x288f86;}})});}_0x31179c=_[_0x147b('0x3c')]({},_0x31179c,_0x2b3008[_0x147b('0x3e')]);var _0x3187d0={'where':_0x31179c[_0x147b('0x39')]};return db[_0x147b('0x2c')][_0x147b('0x1d')](_0x3187d0)['then'](function(_0x32423c){_0x13c7b1[_0x147b('0x1d')]=_0x32423c;if(_0x2b3008['query'][_0x147b('0x3f')]){_0x31179c[_0x147b('0x40')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x147b('0x41')](_0x31179c);})['then'](function(_0x5dc24a){_0x13c7b1[_0x147b('0x42')]=_0x5dc24a;return _0x13c7b1;})[_0x147b('0x24')](respondWithFilteredResult(_0x2f05cc,_0x31179c))['catch'](handleError(_0x2f05cc,null));};exports['show']=function(_0x2e3238,_0x279bab){var _0xc86225={'raw':!![],'where':{'id':_0x2e3238[_0x147b('0x43')]['id']}},_0xb1a52b={};_0xb1a52b[_0x147b('0x2f')]=_[_0x147b('0x44')](db[_0x147b('0x2c')][_0x147b('0x45')]);_0xb1a52b[_0x147b('0x30')]=_[_0x147b('0x44')](_0x2e3238[_0x147b('0x30')]);_0xb1a52b['filters']=_[_0x147b('0x32')](_0xb1a52b['model'],_0xb1a52b[_0x147b('0x30')]);_0xc86225[_0x147b('0x34')]=_[_0x147b('0x32')](_0xb1a52b[_0x147b('0x2f')],qs[_0x147b('0x33')](_0x2e3238[_0x147b('0x30')]['fields']));_0xc86225['attributes']=_0xc86225[_0x147b('0x34')][_0x147b('0x35')]?_0xc86225[_0x147b('0x34')]:_0xb1a52b[_0x147b('0x2f')];if(_0x2e3238[_0x147b('0x30')][_0x147b('0x3f')]){_0xc86225[_0x147b('0x40')]=[{'all':!![]}];}_0xc86225=_[_0x147b('0x3c')]({},_0xc86225,_0x2e3238[_0x147b('0x3e')]);return db[_0x147b('0x2c')][_0x147b('0x46')](_0xc86225)[_0x147b('0x24')](handleEntityNotFound(_0x279bab,null))[_0x147b('0x24')](respondWithResult(_0x279bab,null))[_0x147b('0x47')](handleError(_0x279bab,null));};exports[_0x147b('0x48')]=function(_0x460947,_0x1efc46){return db['VoiceMailMessage'][_0x147b('0x48')](_0x460947[_0x147b('0x49')],{})[_0x147b('0x24')](respondWithResult(_0x1efc46,0xc9))['catch'](handleError(_0x1efc46,null));};exports[_0x147b('0x23')]=function(_0x244495,_0x5bbed1){if(_0x244495[_0x147b('0x49')]['id']){delete _0x244495[_0x147b('0x49')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x244495[_0x147b('0x43')]['id']}})[_0x147b('0x24')](handleEntityNotFound(_0x5bbed1,null))[_0x147b('0x24')](saveUpdates(_0x244495[_0x147b('0x49')],null))[_0x147b('0x24')](respondWithResult(_0x5bbed1,null))[_0x147b('0x47')](handleError(_0x5bbed1,null));};exports['destroy']=function(_0x2fa15a,_0x14e7b4){return db[_0x147b('0x2c')]['find']({'where':{'id':_0x2fa15a[_0x147b('0x43')]['id']}})[_0x147b('0x24')](handleEntityNotFound(_0x14e7b4,null))[_0x147b('0x24')](removeEntity(_0x14e7b4,null))[_0x147b('0x47')](handleError(_0x14e7b4,null));};exports[_0x147b('0x4a')]=function(_0x29e2cd,_0x3ce6fc,_0x541a13){return db[_0x147b('0x2c')]['find']({'where':{'id':_0x29e2cd[_0x147b('0x43')]['id']},'attributes':['id',_0x147b('0x4b'),_0x147b('0x4c')]})[_0x147b('0x24')](handleEntityNotFound(_0x3ce6fc,null))[_0x147b('0x24')](function(_0x1f2d74){if(_0x1f2d74){if(!_0x1f2d74[_0x147b('0x4b')]){throw new db['Sequelize'][(_0x147b('0x4d'))](_0x147b('0x4e'));}var _0x34f45f={'Content-Type':_0x147b('0x4f'),'Content-Disposition':'attachment'};if(_0x1f2d74[_0x147b('0x4c')]){_0x34f45f[_0x147b('0x50')]=_0x147b('0x51')+_0x1f2d74[_0x147b('0x4c')]+'.wav\x22';}_0x3ce6fc[_0x147b('0x1e')](_0x34f45f);return _0x3ce6fc[_0x147b('0x2a')](new Buffer(_0x1f2d74[_0x147b('0x4b')]));}})[_0x147b('0x47')](handleError(_0x3ce6fc,null));}; \ No newline at end of file +var _0x16c2=['length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','options','VoiceMailMessage','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','download','params','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes'];(function(_0x57ebba,_0x3d08d9){var _0x304f8a=function(_0x16fd83){while(--_0x16fd83){_0x57ebba['push'](_0x57ebba['shift']());}};_0x304f8a(++_0x3d08d9);}(_0x16c2,0x15e));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x216c('0x0'));var rimraf=require(_0x216c('0x1'));var zipdir=require(_0x216c('0x2'));var jsonpatch=require(_0x216c('0x3'));var rp=require(_0x216c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x216c('0x5'));var util=require('util');var path=require(_0x216c('0x6'));var sox=require(_0x216c('0x7'));var csv=require(_0x216c('0x8'));var ejs=require(_0x216c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x216c('0xa'));var squel=require(_0x216c('0xb'));var crypto=require(_0x216c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x216c('0xd'));var toCsv=require(_0x216c('0x8'));var querystring=require(_0x216c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x216c('0xf'));var qs=require(_0x216c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x216c('0x11'))(_0x216c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x216c('0x13'));var db=require(_0x216c('0x14'))['db'];function respondWithStatusCode(_0x1d2878,_0x437a12){_0x437a12=_0x437a12||0xcc;return function(_0x335e9f){if(_0x335e9f){return _0x1d2878[_0x216c('0x15')](_0x437a12);}return _0x1d2878['status'](_0x437a12)['end']();};}function respondWithResult(_0x438b6e,_0x353573){_0x353573=_0x353573||0xc8;return function(_0x1212f8){if(_0x1212f8){return _0x438b6e[_0x216c('0x16')](_0x353573)['json'](_0x1212f8);}};}function respondWithFilteredResult(_0x52f0c2,_0x194ea2){return function(_0x413368){if(_0x413368){var _0xf40df4=typeof _0x194ea2['offset']==='undefined'&&typeof _0x194ea2[_0x216c('0x17')]===_0x216c('0x18');var _0x554e54=_0x413368['count'];var _0x3732ff=_0xf40df4?0x0:_0x194ea2['offset'];var _0x24daff=_0xf40df4?_0x413368[_0x216c('0x19')]:_0x194ea2[_0x216c('0x1a')]+_0x194ea2[_0x216c('0x17')];var _0x5a822a;if(_0x24daff>=_0x554e54){_0x24daff=_0x554e54;_0x5a822a=0xc8;}else{_0x5a822a=0xce;}_0x52f0c2[_0x216c('0x16')](_0x5a822a);return _0x52f0c2[_0x216c('0x1b')](_0x216c('0x1c'),_0x3732ff+'-'+_0x24daff+'/'+_0x554e54)[_0x216c('0x1d')](_0x413368);}return null;};}function patchUpdates(_0x1a3382){return function(_0x3590ab){try{jsonpatch[_0x216c('0x1e')](_0x3590ab,_0x1a3382,!![]);}catch(_0x4b419e){return BPromise[_0x216c('0x1f')](_0x4b419e);}return _0x3590ab[_0x216c('0x20')]();};}function saveUpdates(_0x38d039,_0x55cf51){return function(_0xcd71bf){if(_0xcd71bf){return _0xcd71bf[_0x216c('0x21')](_0x38d039)[_0x216c('0x22')](function(_0x2a972a){return _0x2a972a;});}return null;};}function removeEntity(_0x2a9aad,_0x31ecab){return function(_0x48a6ea){if(_0x48a6ea){return _0x48a6ea[_0x216c('0x23')]()[_0x216c('0x22')](function(){_0x2a9aad[_0x216c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c29ac,_0x2b51d2){return function(_0x3654e3){if(!_0x3654e3){_0x2c29ac['sendStatus'](0x194);}return _0x3654e3;};}function handleError(_0x4ac73d,_0x20da78){_0x20da78=_0x20da78||0x1f4;return function(_0x4bf694){logger[_0x216c('0x24')](_0x4bf694['stack']);if(_0x4bf694[_0x216c('0x25')]){delete _0x4bf694[_0x216c('0x25')];}_0x4ac73d['status'](_0x20da78)[_0x216c('0x26')](_0x4bf694);};}exports[_0x216c('0x27')]=function(_0xa61245,_0x3714f5){var _0x1970d5={},_0x30ea2c={},_0x20bf40={'count':0x0,'rows':[]};var _0x511279=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x523727){return{'name':_0x523727[_0x216c('0x28')],'type':_0x523727[_0x216c('0x29')][_0x216c('0x2a')]};});_0x30ea2c[_0x216c('0x2b')]=_[_0x216c('0x2c')](_['map'](_0x511279,_0x216c('0x25')),[_0x216c('0x25')]);_0x30ea2c[_0x216c('0x2d')]=_[_0x216c('0x2e')](_0xa61245[_0x216c('0x2d')]);_0x30ea2c[_0x216c('0x2f')]=_[_0x216c('0x30')](_0x30ea2c[_0x216c('0x2b')],_0x30ea2c[_0x216c('0x2d')]);_0x1970d5['attributes']=_[_0x216c('0x30')](_0x30ea2c[_0x216c('0x2b')],qs['fields'](_0xa61245[_0x216c('0x2d')]['fields']));_0x1970d5[_0x216c('0x31')]=_0x1970d5[_0x216c('0x31')][_0x216c('0x32')]?_0x1970d5[_0x216c('0x31')]:_0x30ea2c['model'];if(!_0xa61245[_0x216c('0x2d')][_0x216c('0x33')](_0x216c('0x34'))){_0x1970d5[_0x216c('0x17')]=qs[_0x216c('0x17')](_0xa61245[_0x216c('0x2d')][_0x216c('0x17')]);_0x1970d5[_0x216c('0x1a')]=qs['offset'](_0xa61245[_0x216c('0x2d')][_0x216c('0x1a')]);}_0x1970d5[_0x216c('0x35')]=qs['sort'](_0xa61245[_0x216c('0x2d')]['sort']);_0x1970d5[_0x216c('0x36')]=qs['filters'](_[_0x216c('0x37')](_0xa61245[_0x216c('0x2d')],_0x30ea2c[_0x216c('0x2f')]),_0x511279);if(_0xa61245[_0x216c('0x2d')][_0x216c('0x38')]){_0x1970d5[_0x216c('0x36')]=_[_0x216c('0x39')](_0x1970d5[_0x216c('0x36')],{'$or':_[_0x216c('0x3a')](_0x511279,function(_0x3d0cae){if(_0x3d0cae['type']!=='VIRTUAL'){var _0x22ac61={};_0x22ac61[_0x3d0cae[_0x216c('0x25')]]={'$like':'%'+_0xa61245[_0x216c('0x2d')]['filter']+'%'};return _0x22ac61;}})});}_0x1970d5=_[_0x216c('0x39')]({},_0x1970d5,_0xa61245[_0x216c('0x3b')]);var _0x4153c8={'where':_0x1970d5[_0x216c('0x36')]};return db['VoiceMailMessage'][_0x216c('0x19')](_0x4153c8)['then'](function(_0x4bf6f2){_0x20bf40[_0x216c('0x19')]=_0x4bf6f2;if(_0xa61245[_0x216c('0x2d')]['includeAll']){_0x1970d5['include']=[{'all':!![]}];}return db[_0x216c('0x3c')][_0x216c('0x3d')](_0x1970d5);})[_0x216c('0x22')](function(_0x4c5947){_0x20bf40[_0x216c('0x3e')]=_0x4c5947;return _0x20bf40;})[_0x216c('0x22')](respondWithFilteredResult(_0x3714f5,_0x1970d5))[_0x216c('0x3f')](handleError(_0x3714f5,null));};exports[_0x216c('0x40')]=function(_0x3d69ad,_0x562ac4){var _0x52de45={'raw':!![],'where':{'id':_0x3d69ad['params']['id']}},_0x2547fd={};_0x2547fd[_0x216c('0x2b')]=_[_0x216c('0x2e')](db[_0x216c('0x3c')][_0x216c('0x41')]);_0x2547fd[_0x216c('0x2d')]=_[_0x216c('0x2e')](_0x3d69ad[_0x216c('0x2d')]);_0x2547fd[_0x216c('0x2f')]=_[_0x216c('0x30')](_0x2547fd[_0x216c('0x2b')],_0x2547fd[_0x216c('0x2d')]);_0x52de45[_0x216c('0x31')]=_[_0x216c('0x30')](_0x2547fd[_0x216c('0x2b')],qs['fields'](_0x3d69ad[_0x216c('0x2d')]['fields']));_0x52de45[_0x216c('0x31')]=_0x52de45[_0x216c('0x31')][_0x216c('0x32')]?_0x52de45['attributes']:_0x2547fd[_0x216c('0x2b')];if(_0x3d69ad[_0x216c('0x2d')][_0x216c('0x42')]){_0x52de45[_0x216c('0x43')]=[{'all':!![]}];}_0x52de45=_[_0x216c('0x39')]({},_0x52de45,_0x3d69ad['options']);return db[_0x216c('0x3c')][_0x216c('0x44')](_0x52de45)['then'](handleEntityNotFound(_0x562ac4,null))[_0x216c('0x22')](respondWithResult(_0x562ac4,null))[_0x216c('0x3f')](handleError(_0x562ac4,null));};exports[_0x216c('0x45')]=function(_0x3f4a2f,_0xde0823){return db['VoiceMailMessage'][_0x216c('0x45')](_0x3f4a2f['body'],{})[_0x216c('0x22')](respondWithResult(_0xde0823,0xc9))[_0x216c('0x3f')](handleError(_0xde0823,null));};exports[_0x216c('0x21')]=function(_0x29f10a,_0x295d93){if(_0x29f10a['body']['id']){delete _0x29f10a[_0x216c('0x46')]['id'];}return db[_0x216c('0x3c')][_0x216c('0x44')]({'where':{'id':_0x29f10a['params']['id']}})[_0x216c('0x22')](handleEntityNotFound(_0x295d93,null))['then'](saveUpdates(_0x29f10a[_0x216c('0x46')],null))[_0x216c('0x22')](respondWithResult(_0x295d93,null))[_0x216c('0x3f')](handleError(_0x295d93,null));};exports[_0x216c('0x23')]=function(_0x4769d2,_0x5c77dd){return db[_0x216c('0x3c')][_0x216c('0x44')]({'where':{'id':_0x4769d2['params']['id']}})['then'](handleEntityNotFound(_0x5c77dd,null))[_0x216c('0x22')](removeEntity(_0x5c77dd,null))[_0x216c('0x3f')](handleError(_0x5c77dd,null));};exports[_0x216c('0x47')]=function(_0x1495cf,_0x508409,_0x4af90a){return db['VoiceMailMessage'][_0x216c('0x44')]({'where':{'id':_0x1495cf[_0x216c('0x48')]['id']},'attributes':['id','recording',_0x216c('0x49')]})[_0x216c('0x22')](handleEntityNotFound(_0x508409,null))[_0x216c('0x22')](function(_0x237fb4){if(_0x237fb4){if(!_0x237fb4[_0x216c('0x4a')]){throw new db[(_0x216c('0x4b'))]['ValidationError'](_0x216c('0x4c'));}var _0x50da03={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x237fb4[_0x216c('0x49')]){_0x50da03[_0x216c('0x4d')]=_0x216c('0x4e')+_0x237fb4['msg_id']+_0x216c('0x4f');}_0x508409[_0x216c('0x1b')](_0x50da03);return _0x508409['send'](new Buffer(_0x237fb4[_0x216c('0x4a')]));}})[_0x216c('0x3f')](handleError(_0x508409,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 372fa37..9c5c5a9 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 _0x0fab=['dir','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0fab,0x17a));var _0xb0fa=function(_0x4adda4,_0x1957ed){_0x4adda4=_0x4adda4-0x0;var _0x301057=_0x0fab[_0x4adda4];return _0x301057;};'use strict';var _=require(_0xb0fa('0x0'));var util=require('util');var logger=require(_0xb0fa('0x1'))(_0xb0fa('0x2'));var moment=require(_0xb0fa('0x3'));var BPromise=require(_0xb0fa('0x4'));var rp=require(_0xb0fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb0fa('0x6'));var config=require(_0xb0fa('0x7'));var attributes=require(_0xb0fa('0x8'));module['exports']=function(_0x355355,_0x53632e){return _0x355355[_0xb0fa('0x9')](_0xb0fa('0xa'),attributes,{'tableName':_0xb0fa('0xb'),'paranoid':![],'indexes':[{'name':_0xb0fa('0xc'),'fields':[_0xb0fa('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd2d2=['../../config/environment','exports','define','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0xd2d2,0xcb));var _0x2d2d=function(_0xe939c7,_0x4fa485){_0xe939c7=_0xe939c7-0x0;var _0x3e2d40=_0xd2d2[_0xe939c7];return _0x3e2d40;};'use strict';var _=require(_0x2d2d('0x0'));var util=require('util');var logger=require(_0x2d2d('0x1'))(_0x2d2d('0x2'));var moment=require(_0x2d2d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d2d('0x4'));var fs=require('fs');var path=require(_0x2d2d('0x5'));var rimraf=require('rimraf');var config=require(_0x2d2d('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x2d2d('0x7')]=function(_0x8115a1,_0x3f762a){return _0x8115a1[_0x2d2d('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x2d2d('0x9'),'paranoid':![],'indexes':[{'name':_0x2d2d('0xa'),'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 df79fa5..9809c84 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 _0x5d02=['request\x20sent','error','code','message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0xe80a60,_0x482e2b){var _0x2cca08=function(_0x31c4da){while(--_0x31c4da){_0xe80a60['push'](_0xe80a60['shift']());}};_0x2cca08(++_0x482e2b);}(_0x5d02,0x10e));var _0x25d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x25d0('0x0'));var util=require(_0x25d0('0x1'));var moment=require(_0x25d0('0x2'));var BPromise=require('bluebird');var rs=require(_0x25d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25d0('0x4'))['db'];var utils=require(_0x25d0('0x5'));var logger=require(_0x25d0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x25d0('0x7'));var client=jayson[_0x25d0('0x8')][_0x25d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f902b,_0x6f599f,_0x41a49c){return new BPromise(function(_0x16134b,_0x9f4d6d){return client[_0x25d0('0xa')](_0x1f902b,_0x41a49c)[_0x25d0('0xb')](function(_0x7f8041){logger[_0x25d0('0xc')](_0x25d0('0xd'),_0x6f599f,'request\x20sent');logger['debug'](_0x25d0('0xe'),_0x6f599f,_0x25d0('0xf'),JSON['stringify'](_0x7f8041));if(_0x7f8041[_0x25d0('0x10')]){if(_0x7f8041['error'][_0x25d0('0x11')]===0x1f4){logger[_0x25d0('0x10')](_0x25d0('0xd'),_0x6f599f,_0x7f8041[_0x25d0('0x10')][_0x25d0('0x12')]);return _0x9f4d6d(_0x7f8041[_0x25d0('0x10')]['message']);}logger[_0x25d0('0x10')](_0x25d0('0xd'),_0x6f599f,_0x7f8041[_0x25d0('0x10')][_0x25d0('0x12')]);return _0x16134b(_0x7f8041[_0x25d0('0x10')][_0x25d0('0x12')]);}else{logger['info'](_0x25d0('0xd'),_0x6f599f,_0x25d0('0xf'));_0x16134b(_0x7f8041['result']['message']);}})['catch'](function(_0xa7a9fc){logger[_0x25d0('0x10')](_0x25d0('0xd'),_0x6f599f,_0xa7a9fc);_0x9f4d6d(_0xa7a9fc);});});} \ No newline at end of file +var _0x30b7=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x57a5f6,_0x651ad0){var _0x1a8187=function(_0x1166b0){while(--_0x1166b0){_0x57a5f6['push'](_0x57a5f6['shift']());}};_0x1a8187(++_0x651ad0);}(_0x30b7,0x112));var _0x730b=function(_0x33ce4d,_0x579f63){_0x33ce4d=_0x33ce4d-0x0;var _0x50a21f=_0x30b7[_0x33ce4d];return _0x50a21f;};'use strict';var _=require(_0x730b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x730b('0x1'));var fs=require('fs');var Redis=require(_0x730b('0x2'));var db=require(_0x730b('0x3'))['db'];var utils=require(_0x730b('0x4'));var logger=require(_0x730b('0x5'))(_0x730b('0x6'));var config=require(_0x730b('0x7'));var jayson=require(_0x730b('0x8'));var client=jayson[_0x730b('0x9')][_0x730b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57f6fc,_0x2c0559,_0x127afd){return new BPromise(function(_0x31bbf6,_0x5c75ee){return client[_0x730b('0xb')](_0x57f6fc,_0x127afd)[_0x730b('0xc')](function(_0x453a39){logger[_0x730b('0xd')](_0x730b('0xe'),_0x2c0559,_0x730b('0xf'));logger[_0x730b('0x10')](_0x730b('0x11'),_0x2c0559,_0x730b('0xf'),JSON[_0x730b('0x12')](_0x453a39));if(_0x453a39[_0x730b('0x13')]){if(_0x453a39['error'][_0x730b('0x14')]===0x1f4){logger['error'](_0x730b('0xe'),_0x2c0559,_0x453a39[_0x730b('0x13')][_0x730b('0x15')]);return _0x5c75ee(_0x453a39[_0x730b('0x13')]['message']);}logger[_0x730b('0x13')](_0x730b('0xe'),_0x2c0559,_0x453a39[_0x730b('0x13')]['message']);return _0x31bbf6(_0x453a39[_0x730b('0x13')][_0x730b('0x15')]);}else{logger[_0x730b('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x2c0559,'request\x20sent');_0x31bbf6(_0x453a39[_0x730b('0x16')]['message']);}})[_0x730b('0x17')](function(_0x4e53be){logger[_0x730b('0x13')](_0x730b('0xe'),_0x2c0559,_0x4e53be);_0x5c75ee(_0x4e53be);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index a2351c5..2db127d 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 _0x778d=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','index','get','show','/:id/sounds','getSounds','create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2','multer','path','connect-timeout'];(function(_0x395097,_0x6babd0){var _0x19f253=function(_0x4ba8fa){while(--_0x4ba8fa){_0x395097['push'](_0x395097['shift']());}};_0x19f253(++_0x6babd0);}(_0x778d,0x189));var _0xd778=function(_0x458938,_0x1bf9f2){_0x458938=_0x458938-0x0;var _0x584ebe=_0x778d[_0x458938];return _0x584ebe;};'use strict';var multer=require(_0xd778('0x0'));var util=require('util');var path=require(_0xd778('0x1'));var timeout=require(_0xd778('0x2'));var express=require(_0xd778('0x3'));var router=express[_0xd778('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd778('0x5'));var interaction=require(_0xd778('0x6'));var config=require('../../config/environment');var controller=require(_0xd778('0x7'));router['get']('/',auth[_0xd778('0x8')](),controller[_0xd778('0x9')]);router[_0xd778('0xa')]('/:id',auth[_0xd778('0x8')](),controller[_0xd778('0xb')]);router['get'](_0xd778('0xc'),auth[_0xd778('0x8')](),controller[_0xd778('0xd')]);router['post']('/',auth[_0xd778('0x8')](),controller[_0xd778('0xe')]);router['post'](_0xd778('0xc'),auth[_0xd778('0x8')](),controller[_0xd778('0xf')]);router[_0xd778('0x10')](_0xd778('0x11'),auth[_0xd778('0x8')](),controller[_0xd778('0x12')]);router[_0xd778('0x13')](_0xd778('0x11'),auth['isAuthenticated'](),controller[_0xd778('0x14')]);router[_0xd778('0x13')](_0xd778('0x15'),auth['isAuthenticated'](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0x6f32=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','post','create','/:id/sounds','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound'];(function(_0x31e69d,_0x2701f3){var _0x58c569=function(_0x2e3f62){while(--_0x2e3f62){_0x31e69d['push'](_0x31e69d['shift']());}};_0x58c569(++_0x2701f3);}(_0x6f32,0x19e));var _0x26f3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6f32[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x26f3('0x0'));var util=require('util');var path=require(_0x26f3('0x1'));var timeout=require(_0x26f3('0x2'));var express=require(_0x26f3('0x3'));var router=express['Router']();var fs_extra=require(_0x26f3('0x4'));var auth=require(_0x26f3('0x5'));var interaction=require(_0x26f3('0x6'));var config=require(_0x26f3('0x7'));var controller=require(_0x26f3('0x8'));router[_0x26f3('0x9')]('/',auth[_0x26f3('0xa')](),controller['index']);router[_0x26f3('0x9')](_0x26f3('0xb'),auth[_0x26f3('0xa')](),controller[_0x26f3('0xc')]);router[_0x26f3('0x9')]('/:id/sounds',auth[_0x26f3('0xa')](),controller['getSounds']);router[_0x26f3('0xd')]('/',auth[_0x26f3('0xa')](),controller[_0x26f3('0xe')]);router[_0x26f3('0xd')](_0x26f3('0xf'),auth[_0x26f3('0xa')](),controller[_0x26f3('0x10')]);router[_0x26f3('0x11')](_0x26f3('0xb'),auth[_0x26f3('0xa')](),controller[_0x26f3('0x12')]);router[_0x26f3('0x13')]('/:id',auth[_0x26f3('0xa')](),controller[_0x26f3('0x14')]);router[_0x26f3('0x13')](_0x26f3('0x15'),auth['isAuthenticated'](),controller[_0x26f3('0x16')]);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 fa5305d..dffe24a 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 _0x2d52=['custom','mp3nb','quietmp3','files','alpha','TIMESTAMP','sequelize','STRING','name','ENUM'];(function(_0x54ee0f,_0x4a86b1){var _0x417f93=function(_0x1a3235){while(--_0x1a3235){_0x54ee0f['push'](_0x54ee0f['shift']());}};_0x417f93(++_0x4a86b1);}(_0x2d52,0x1be));var _0x22d5=function(_0x56ac6a,_0x35ed04){_0x56ac6a=_0x56ac6a-0x0;var _0x169575=_0x2d52[_0x56ac6a];return _0x169575;};'use strict';var Sequelize=require(_0x22d5('0x0'));module['exports']={'name':{'type':Sequelize[_0x22d5('0x1')],'allowNull':![],'unique':_0x22d5('0x2')},'mode':{'type':Sequelize[_0x22d5('0x3')](_0x22d5('0x4'),'files',_0x22d5('0x5'),'quietmp3nb',_0x22d5('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x22d5('0x7')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x22d5('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x22d5('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x22d5('0x8')},'format':{'type':Sequelize[_0x22d5('0x1')],'allowNull':!![]},'stamp':{'type':_0x22d5('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x610a=['STRING','ENUM','custom','files','quietmp3nb','alpha','TIMESTAMP','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x610a,0x178));var _0xa610=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x610a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa610('0x0'));module[_0xa610('0x1')]={'name':{'type':Sequelize[_0xa610('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xa610('0x3')](_0xa610('0x4'),_0xa610('0x5'),'mp3nb',_0xa610('0x6'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0xa610('0x5')},'directory':{'type':Sequelize[_0xa610('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xa610('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa610('0x7')},'format':{'type':Sequelize[_0xa610('0x2')],'allowNull':!![]},'stamp':{'type':_0xa610('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 871d920..1524330 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 _0x1ade=['model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','find','body','create','sequelize','transaction','files','directory','join','root','mode','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','server/files/sounds/converted','%s.%s','basename','extname','save_name','converted_format','server/files/moh','format','symlinkSync','removeSound','findOne','id2','createdAt','getSounds','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','type','key'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x1ade,0x194));var _0xe1ad=function(_0x962edb,_0x5dd356){_0x962edb=_0x962edb-0x0;var _0x359dcf=_0x1ade[_0x962edb];return _0x359dcf;};'use strict';var emlformat=require(_0xe1ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe1ad('0x1'));var jsonpatch=require(_0xe1ad('0x2'));var rp=require(_0xe1ad('0x3'));var moment=require(_0xe1ad('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe1ad('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe1ad('0x6'));var csv=require(_0xe1ad('0x7'));var ejs=require(_0xe1ad('0x8'));var fs=require('fs');var fs_extra=require(_0xe1ad('0x9'));var _=require(_0xe1ad('0xa'));var squel=require('squel');var crypto=require(_0xe1ad('0xb'));var jsforce=require(_0xe1ad('0xc'));var deskjs=require(_0xe1ad('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe1ad('0xe'));var Papa=require(_0xe1ad('0xf'));var Redis=require(_0xe1ad('0x10'));var authService=require(_0xe1ad('0x11'));var qs=require(_0xe1ad('0x12'));var as=require(_0xe1ad('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe1ad('0x14'));var utils=require(_0xe1ad('0x15'));var config=require(_0xe1ad('0x16'));var licenseUtil=require(_0xe1ad('0x17'));var db=require(_0xe1ad('0x18'))['db'];function respondWithStatusCode(_0x25f54a,_0x40c98a){_0x40c98a=_0x40c98a||0xcc;return function(_0x405187){if(_0x405187){return _0x25f54a[_0xe1ad('0x19')](_0x40c98a);}return _0x25f54a[_0xe1ad('0x1a')](_0x40c98a)['end']();};}function respondWithResult(_0xc31b46,_0x565ea7){_0x565ea7=_0x565ea7||0xc8;return function(_0xe4a06){if(_0xe4a06){return _0xc31b46[_0xe1ad('0x1a')](_0x565ea7)[_0xe1ad('0x1b')](_0xe4a06);}};}function respondWithFilteredResult(_0x239067,_0x290fcf){return function(_0x234cb0){if(_0x234cb0){var _0x1b0d67=typeof _0x290fcf[_0xe1ad('0x1c')]==='undefined'&&typeof _0x290fcf[_0xe1ad('0x1d')]===_0xe1ad('0x1e');var _0x2da4f4=_0x234cb0['count'];var _0x5614da=_0x1b0d67?0x0:_0x290fcf[_0xe1ad('0x1c')];var _0x7ded48=_0x1b0d67?_0x234cb0[_0xe1ad('0x1f')]:_0x290fcf[_0xe1ad('0x1c')]+_0x290fcf[_0xe1ad('0x1d')];var _0x49fd3a;if(_0x7ded48>=_0x2da4f4){_0x7ded48=_0x2da4f4;_0x49fd3a=0xc8;}else{_0x49fd3a=0xce;}_0x239067['status'](_0x49fd3a);return _0x239067[_0xe1ad('0x20')](_0xe1ad('0x21'),_0x5614da+'-'+_0x7ded48+'/'+_0x2da4f4)[_0xe1ad('0x1b')](_0x234cb0);}return null;};}function patchUpdates(_0x54145d){return function(_0xed9efb){try{jsonpatch[_0xe1ad('0x22')](_0xed9efb,_0x54145d,!![]);}catch(_0x6ebab2){return BPromise[_0xe1ad('0x23')](_0x6ebab2);}return _0xed9efb[_0xe1ad('0x24')]();};}function saveUpdates(_0x3f9a75,_0x4c29c8){return function(_0x3c1ff7){if(_0x3c1ff7){return _0x3c1ff7[_0xe1ad('0x25')](_0x3f9a75)[_0xe1ad('0x26')](function(_0x3e49f7){return _0x3e49f7;});}return null;};}function removeEntity(_0x56f7e5,_0x3f876b){return function(_0x574c8b){if(_0x574c8b){return _0x574c8b['destroy']()[_0xe1ad('0x26')](function(){var _0x362a40=_0x574c8b[_0xe1ad('0x27')]({'plain':!![]});var _0x9f2f50=_0xe1ad('0x28');return db[_0xe1ad('0x29')][_0xe1ad('0x2a')]({'where':{'type':_0x9f2f50,'resourceId':_0x362a40['id']}})[_0xe1ad('0x26')](function(){return _0x574c8b;});})[_0xe1ad('0x26')](function(){_0x56f7e5[_0xe1ad('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x560788,_0x9a106a){return function(_0x15ba3a){if(!_0x15ba3a){_0x560788[_0xe1ad('0x19')](0x194);}return _0x15ba3a;};}function handleError(_0x1824ac,_0x1486f0){_0x1486f0=_0x1486f0||0x1f4;return function(_0x5e6cb2){logger[_0xe1ad('0x2b')](_0x5e6cb2[_0xe1ad('0x2c')]);if(_0x5e6cb2[_0xe1ad('0x2d')]){delete _0x5e6cb2['name'];}_0x1824ac[_0xe1ad('0x1a')](_0x1486f0)['send'](_0x5e6cb2);};}exports[_0xe1ad('0x2e')]=function(_0x1f2f78,_0x788dc3){var _0x52b0b4={},_0x469b27={},_0x325d98={'count':0x0,'rows':[]};var _0xd9e3c9=_[_0xe1ad('0x2f')](db[_0xe1ad('0x30')][_0xe1ad('0x31')],function(_0x3cc17f){return{'name':_0x3cc17f['fieldName'],'type':_0x3cc17f[_0xe1ad('0x32')][_0xe1ad('0x33')]};});_0x469b27[_0xe1ad('0x34')]=_[_0xe1ad('0x2f')](_0xd9e3c9,_0xe1ad('0x2d'));_0x469b27['query']=_[_0xe1ad('0x35')](_0x1f2f78['query']);_0x469b27[_0xe1ad('0x36')]=_[_0xe1ad('0x37')](_0x469b27[_0xe1ad('0x34')],_0x469b27[_0xe1ad('0x38')]);_0x52b0b4[_0xe1ad('0x39')]=_[_0xe1ad('0x37')](_0x469b27[_0xe1ad('0x34')],qs[_0xe1ad('0x3a')](_0x1f2f78[_0xe1ad('0x38')][_0xe1ad('0x3a')]));_0x52b0b4[_0xe1ad('0x39')]=_0x52b0b4[_0xe1ad('0x39')][_0xe1ad('0x3b')]?_0x52b0b4[_0xe1ad('0x39')]:_0x469b27['model'];if(!_0x1f2f78[_0xe1ad('0x38')]['hasOwnProperty']('nolimit')){_0x52b0b4[_0xe1ad('0x1d')]=qs[_0xe1ad('0x1d')](_0x1f2f78[_0xe1ad('0x38')][_0xe1ad('0x1d')]);_0x52b0b4[_0xe1ad('0x1c')]=qs[_0xe1ad('0x1c')](_0x1f2f78[_0xe1ad('0x38')][_0xe1ad('0x1c')]);}_0x52b0b4[_0xe1ad('0x3c')]=qs['sort'](_0x1f2f78[_0xe1ad('0x38')][_0xe1ad('0x3d')]);delete _0x1f2f78[_0xe1ad('0x38')][_0xe1ad('0x3d')];_0x52b0b4[_0xe1ad('0x3e')]=qs['filters'](_[_0xe1ad('0x3f')](_0x1f2f78[_0xe1ad('0x38')],_0x469b27[_0xe1ad('0x36')]),_0xd9e3c9);if(_0x1f2f78[_0xe1ad('0x38')][_0xe1ad('0x40')]){_0x52b0b4[_0xe1ad('0x3e')]=_[_0xe1ad('0x41')](_0x52b0b4[_0xe1ad('0x3e')],{'$or':_[_0xe1ad('0x2f')](_0xd9e3c9,function(_0x4b16a2){if(_0x4b16a2[_0xe1ad('0x32')]!=='VIRTUAL'){var _0xb110af={};_0xb110af[_0x4b16a2[_0xe1ad('0x2d')]]={'$like':'%'+_0x1f2f78['query'][_0xe1ad('0x40')]+'%'};return _0xb110af;}})});}_0x52b0b4=_[_0xe1ad('0x41')]({},_0x52b0b4,_0x1f2f78[_0xe1ad('0x42')]);var _0x203014={'where':_0x52b0b4[_0xe1ad('0x3e')]};return db[_0xe1ad('0x30')][_0xe1ad('0x1f')](_0x203014)['then'](function(_0x42c1d7){_0x325d98[_0xe1ad('0x1f')]=_0x42c1d7;if(_0x1f2f78[_0xe1ad('0x38')][_0xe1ad('0x43')]){_0x52b0b4['include']=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x52b0b4);})['then'](function(_0x2a2d63){_0x325d98[_0xe1ad('0x44')]=_0x2a2d63;return _0x325d98;})['then'](respondWithFilteredResult(_0x788dc3,_0x52b0b4))[_0xe1ad('0x45')](handleError(_0x788dc3,null));};exports[_0xe1ad('0x46')]=function(_0x35a923,_0x3a2c47){var _0x3f590e={'raw':![],'where':{'id':_0x35a923[_0xe1ad('0x47')]['id']}},_0x56e84b={};_0x56e84b['model']=_[_0xe1ad('0x35')](db[_0xe1ad('0x30')]['rawAttributes']);_0x56e84b[_0xe1ad('0x38')]=_['keys'](_0x35a923[_0xe1ad('0x38')]);_0x56e84b[_0xe1ad('0x36')]=_[_0xe1ad('0x37')](_0x56e84b[_0xe1ad('0x34')],_0x56e84b[_0xe1ad('0x38')]);_0x3f590e[_0xe1ad('0x39')]=_[_0xe1ad('0x37')](_0x56e84b['model'],qs[_0xe1ad('0x3a')](_0x35a923[_0xe1ad('0x38')][_0xe1ad('0x3a')]));_0x3f590e[_0xe1ad('0x39')]=_0x3f590e['attributes'][_0xe1ad('0x3b')]?_0x3f590e[_0xe1ad('0x39')]:_0x56e84b[_0xe1ad('0x34')];if(_0x35a923[_0xe1ad('0x38')][_0xe1ad('0x43')]){_0x3f590e['include']=[{'all':!![]}];}_0x3f590e=_[_0xe1ad('0x41')]({},_0x3f590e,_0x35a923[_0xe1ad('0x42')]);return db['VoiceMusicOnHold'][_0xe1ad('0x48')](_0x3f590e)[_0xe1ad('0x26')](handleEntityNotFound(_0x3a2c47,null))['then'](respondWithResult(_0x3a2c47,null))[_0xe1ad('0x45')](handleError(_0x3a2c47,null));};exports[_0xe1ad('0x25')]=function(_0x1c462b,_0x197c4d){if(_0x1c462b[_0xe1ad('0x49')]['id']){delete _0x1c462b[_0xe1ad('0x49')]['id'];}return db[_0xe1ad('0x30')][_0xe1ad('0x48')]({'where':{'id':_0x1c462b[_0xe1ad('0x47')]['id']}})[_0xe1ad('0x26')](handleEntityNotFound(_0x197c4d,null))['then'](saveUpdates(_0x1c462b[_0xe1ad('0x49')],null))[_0xe1ad('0x26')](respondWithResult(_0x197c4d,null))[_0xe1ad('0x45')](handleError(_0x197c4d,null));};exports[_0xe1ad('0x4a')]=function(_0x9e13e7,_0x528f42,_0x17dd27){return db[_0xe1ad('0x4b')][_0xe1ad('0x4c')](function(_0x35df93){if(_0x9e13e7['body']['mode']===_0xe1ad('0x4d')){_0x9e13e7[_0xe1ad('0x49')][_0xe1ad('0x4e')]=path[_0xe1ad('0x4f')](config[_0xe1ad('0x50')],'server/files/moh',_0x9e13e7[_0xe1ad('0x49')][_0xe1ad('0x2d')]);}return db['VoiceMusicOnHold']['create'](_0x9e13e7['body'],{'transaction':_0x35df93})[_0xe1ad('0x26')](function(_0xd6e3c7){if(_0x9e13e7[_0xe1ad('0x49')][_0xe1ad('0x51')]===_0xe1ad('0x4d')){fs[_0xe1ad('0x52')](_0xd6e3c7[_0xe1ad('0x4e')],parseInt(_0xe1ad('0x53'),0x8));}var _0x187016=_0x9e13e7[_0xe1ad('0x54')][_0xe1ad('0x27')]({'plain':!![]});if(!_0x187016)throw new Error(_0xe1ad('0x55'));if(_0x187016[_0xe1ad('0x56')]===_0xe1ad('0x54')){var _0x2f2bb0=_0xd6e3c7['get']({'plain':!![]});return db[_0xe1ad('0x57')][_0xe1ad('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x187016[_0xe1ad('0x58')]},'raw':!![]})[_0xe1ad('0x26')](function(_0x4674cc){if(_0x4674cc&&_0x4674cc[_0xe1ad('0x59')]===0x0){return db[_0xe1ad('0x29')][_0xe1ad('0x4a')]({'name':_0x2f2bb0[_0xe1ad('0x2d')],'resourceId':_0x2f2bb0['id'],'type':_0x4674cc[_0xe1ad('0x2d')],'sectionId':_0x4674cc['id']},{})[_0xe1ad('0x26')](function(){return _0xd6e3c7;});}else{return _0xd6e3c7;}})['catch'](function(_0x461592){logger[_0xe1ad('0x2b')](_0xe1ad('0x5a'),_0x461592);});}return _0xd6e3c7;});})[_0xe1ad('0x26')](respondWithResult(_0x528f42,0xc9))[_0xe1ad('0x45')](handleError(_0x528f42,null));};exports[_0xe1ad('0x2a')]=function(_0x3402a2,_0x4da0cf,_0xcfe59d){var _0x5534f8;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3402a2['params']['id']}})[_0xe1ad('0x26')](function(_0xa2cebe){if(_0xa2cebe){return db[_0xe1ad('0x4b')][_0xe1ad('0x4c')](function(_0x410685){return _0xa2cebe['destroy']({'transaction':_0x410685,'raw':!![]})[_0xe1ad('0x26')](function(_0x55daa8){if(_0x55daa8[_0xe1ad('0x4e')]){fs['readdirSync'](_0x55daa8[_0xe1ad('0x4e')])[_0xe1ad('0x5b')](function(_0x2d25bc){fs[_0xe1ad('0x5c')](path[_0xe1ad('0x4f')](_0x55daa8[_0xe1ad('0x4e')],_0x2d25bc));});fs[_0xe1ad('0x5d')](_0x55daa8['directory']);}return _0x55daa8;});})[_0xe1ad('0x45')](function(_0x1c485c){throw new db[(_0xe1ad('0x5e'))][(_0xe1ad('0x5f'))](_0x1c485c[_0xe1ad('0x60')]);});}})[_0xe1ad('0x26')](handleEntityNotFound(_0x4da0cf,null))[_0xe1ad('0x26')](removeEntity(_0x4da0cf,null))[_0xe1ad('0x45')](handleError(_0x4da0cf,null));};exports[_0xe1ad('0x61')]=function(_0x4b673a,_0x1990e0,_0x2dc8d4){return db['sequelize'][_0xe1ad('0x4c')](function(_0x1c3b39){var _0x1bcd9b;return db[_0xe1ad('0x30')][_0xe1ad('0x48')]({'where':{'id':_0x4b673a[_0xe1ad('0x47')]['id']}})[_0xe1ad('0x26')](function(_0x1a642a){if(_0x1a642a){_0x1bcd9b=_0x1a642a;return _0x1a642a[_0xe1ad('0x61')](_0x4b673a[_0xe1ad('0x49')]['id'],{'transaction':_0x1c3b39});}})[_0xe1ad('0x26')](function(_0xf57545){if(_0xf57545){return db[_0xe1ad('0x62')]['findOne']({'where':{'id':_0x4b673a['body']['id']},'attributes':['id',_0xe1ad('0x2d'),'save_name','converted_format','createdAt'],'raw':!![]});}})[_0xe1ad('0x26')](function(_0x11f0ec){if(_0x11f0ec){var _0x1af831=path[_0xe1ad('0x4f')](config[_0xe1ad('0x50')],_0xe1ad('0x63'),util['format'](_0xe1ad('0x64'),path[_0xe1ad('0x65')](_0x11f0ec['save_name'],path[_0xe1ad('0x66')](_0x11f0ec[_0xe1ad('0x67')])),_0x11f0ec[_0xe1ad('0x68')]));var _0x36b4ab=path[_0xe1ad('0x4f')](config['root'],_0xe1ad('0x69'),_0x1bcd9b[_0xe1ad('0x2d')],util[_0xe1ad('0x6a')](_0xe1ad('0x64'),_0x11f0ec[_0xe1ad('0x2d')],_0x11f0ec[_0xe1ad('0x68')]));fs[_0xe1ad('0x6b')](_0x1af831,_0x36b4ab);return _0x11f0ec;}})[_0xe1ad('0x45')](function(_0x5a5494){throw new db['Sequelize'][(_0xe1ad('0x5f'))](_0x5a5494[_0xe1ad('0x60')]);});})[_0xe1ad('0x26')](handleEntityNotFound(_0x1990e0,null))[_0xe1ad('0x26')](respondWithResult(_0x1990e0,0xc9))[_0xe1ad('0x45')](handleError(_0x1990e0,null));};exports[_0xe1ad('0x6c')]=function(_0x31de9,_0x489feb,_0x3ce11e){return db['sequelize'][_0xe1ad('0x4c')](function(_0x29f588){var _0x1800ff;return db['VoiceMusicOnHold'][_0xe1ad('0x6d')]({'where':{'id':_0x31de9[_0xe1ad('0x47')]['id']}})[_0xe1ad('0x26')](handleEntityNotFound(_0x489feb,null))[_0xe1ad('0x26')](function(_0x286339){if(_0x286339){_0x1800ff=_0x286339;return _0x286339['removeSound'](_0x31de9[_0xe1ad('0x47')][_0xe1ad('0x6e')]);}})[_0xe1ad('0x26')](function(_0x1470df){if(_0x1470df){return db[_0xe1ad('0x62')][_0xe1ad('0x6d')]({'where':{'id':_0x31de9['params'][_0xe1ad('0x6e')]},'attributes':['id',_0xe1ad('0x2d'),_0xe1ad('0x67'),_0xe1ad('0x68'),_0xe1ad('0x6f')],'raw':!![]});}})[_0xe1ad('0x26')](function(_0x4ef8b6){if(_0x4ef8b6){fs[_0xe1ad('0x5c')](path[_0xe1ad('0x4f')](_0x1800ff[_0xe1ad('0x4e')],util[_0xe1ad('0x6a')]('%s.%s',_0x4ef8b6[_0xe1ad('0x2d')],_0x4ef8b6['converted_format'])));return _0x4ef8b6;}})[_0xe1ad('0x45')](function(_0x4ea0f5){throw new db[(_0xe1ad('0x5e'))][(_0xe1ad('0x5f'))](_0x4ea0f5[_0xe1ad('0x60')]);});})[_0xe1ad('0x26')](handleEntityNotFound(_0x489feb,null))[_0xe1ad('0x26')](respondWithStatusCode(_0x489feb,0xcc))[_0xe1ad('0x45')](handleError(_0x489feb,null));};exports[_0xe1ad('0x70')]=function(_0x92c185,_0x388f77,_0x28bc4c){var _0x3884df={};var _0x30d3c4={};var _0xcafa52;var _0x3e90ab;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x92c185['params']['id']}})[_0xe1ad('0x26')](handleEntityNotFound(_0x388f77,null))[_0xe1ad('0x26')](function(_0x3e0c22){if(_0x3e0c22){_0xcafa52=_0x3e0c22;_0x30d3c4[_0xe1ad('0x34')]=_[_0xe1ad('0x35')](db[_0xe1ad('0x62')][_0xe1ad('0x31')]);_0x30d3c4['query']=_[_0xe1ad('0x35')](_0x92c185[_0xe1ad('0x38')]);_0x30d3c4['filters']=_['intersection'](_0x30d3c4['model'],_0x30d3c4[_0xe1ad('0x38')]);_0x3884df[_0xe1ad('0x39')]=_[_0xe1ad('0x37')](_0x30d3c4['model'],qs[_0xe1ad('0x3a')](_0x92c185[_0xe1ad('0x38')][_0xe1ad('0x3a')]));_0x3884df[_0xe1ad('0x39')]=_0x3884df[_0xe1ad('0x39')][_0xe1ad('0x3b')]?_0x3884df[_0xe1ad('0x39')]:_0x30d3c4[_0xe1ad('0x34')];_0x3884df[_0xe1ad('0x3c')]=qs[_0xe1ad('0x3d')](_0x92c185[_0xe1ad('0x38')][_0xe1ad('0x3d')]);_0x3884df[_0xe1ad('0x3e')]=qs[_0xe1ad('0x36')](_[_0xe1ad('0x3f')](_0x92c185['query'],_0x30d3c4[_0xe1ad('0x36')]));if(_0x92c185[_0xe1ad('0x38')]['filter']){_0x3884df[_0xe1ad('0x3e')]=_[_0xe1ad('0x41')](_0x3884df[_0xe1ad('0x3e')],{'$or':_[_0xe1ad('0x2f')](_0x3884df[_0xe1ad('0x39')],function(_0x48c9a2){var _0x442372={};_0x442372[_0x48c9a2]={'$like':'%'+_0x92c185['query']['filter']+'%'};return _0x442372;})});}_0x3884df=_[_0xe1ad('0x41')]({},_0x3884df,_0x92c185[_0xe1ad('0x42')]);return _0xcafa52['getSounds'](_0x3884df);}})[_0xe1ad('0x26')](function(_0x4a55e4){if(_0x4a55e4){_0x3e90ab=_0x4a55e4[_0xe1ad('0x3b')];if(!_0x92c185['query']['hasOwnProperty'](_0xe1ad('0x71'))){_0x3884df[_0xe1ad('0x1d')]=qs[_0xe1ad('0x1d')](_0x92c185['query'][_0xe1ad('0x1d')]);_0x3884df[_0xe1ad('0x1c')]=qs['offset'](_0x92c185[_0xe1ad('0x38')]['offset']);}return _0xcafa52[_0xe1ad('0x70')](_0x3884df);}})['then'](function(_0x3a5ff3){if(_0x3a5ff3){return _0x3a5ff3?{'count':_0x3e90ab,'rows':_0x3a5ff3}:null;}})[_0xe1ad('0x26')](respondWithResult(_0x388f77,null))['catch'](handleError(_0x388f77,null));}; \ No newline at end of file +var _0xcf58=['update','body','find','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','converted_format','createdAt','format','%s.%s','basename','extname','save_name','symlinkSync','message','removeSound','findOne','id2','getSounds','nolimit','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','undefined','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','get','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','VoiceMusicOnHold','includeAll','include','findAll','catch','params','keys','options'];(function(_0x2bb0ba,_0x4b7711){var _0x208065=function(_0x1d9930){while(--_0x1d9930){_0x2bb0ba['push'](_0x2bb0ba['shift']());}};_0x208065(++_0x4b7711);}(_0xcf58,0x9f));var _0x8cf5=function(_0x2a4ddb,_0x5d3a73){_0x2a4ddb=_0x2a4ddb-0x0;var _0x139808=_0xcf58[_0x2a4ddb];return _0x139808;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cf5('0x0'));var zipdir=require(_0x8cf5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8cf5('0x2'));var moment=require(_0x8cf5('0x3'));var BPromise=require(_0x8cf5('0x4'));var Mustache=require('mustache');var util=require(_0x8cf5('0x5'));var path=require(_0x8cf5('0x6'));var sox=require(_0x8cf5('0x7'));var csv=require(_0x8cf5('0x8'));var ejs=require(_0x8cf5('0x9'));var fs=require('fs');var fs_extra=require(_0x8cf5('0xa'));var _=require(_0x8cf5('0xb'));var squel=require(_0x8cf5('0xc'));var crypto=require(_0x8cf5('0xd'));var jsforce=require(_0x8cf5('0xe'));var deskjs=require(_0x8cf5('0xf'));var toCsv=require(_0x8cf5('0x8'));var querystring=require(_0x8cf5('0x10'));var Papa=require(_0x8cf5('0x11'));var Redis=require(_0x8cf5('0x12'));var authService=require(_0x8cf5('0x13'));var qs=require(_0x8cf5('0x14'));var as=require(_0x8cf5('0x15'));var hardwareService=require(_0x8cf5('0x16'));var logger=require('../../config/logger')(_0x8cf5('0x17'));var utils=require(_0x8cf5('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8cf5('0x19'))['db'];function respondWithStatusCode(_0x505af7,_0x42f569){_0x42f569=_0x42f569||0xcc;return function(_0x4dc098){if(_0x4dc098){return _0x505af7[_0x8cf5('0x1a')](_0x42f569);}return _0x505af7[_0x8cf5('0x1b')](_0x42f569)['end']();};}function respondWithResult(_0x7a4f1e,_0x10cc0c){_0x10cc0c=_0x10cc0c||0xc8;return function(_0x22ad1b){if(_0x22ad1b){return _0x7a4f1e['status'](_0x10cc0c)['json'](_0x22ad1b);}};}function respondWithFilteredResult(_0x1ec711,_0x37edc7){return function(_0x192ef6){if(_0x192ef6){var _0x492da3=typeof _0x37edc7['offset']===_0x8cf5('0x1c')&&typeof _0x37edc7['limit']===_0x8cf5('0x1c');var _0x55efd6=_0x192ef6[_0x8cf5('0x1d')];var _0x1d17bf=_0x492da3?0x0:_0x37edc7[_0x8cf5('0x1e')];var _0x480497=_0x492da3?_0x192ef6[_0x8cf5('0x1d')]:_0x37edc7[_0x8cf5('0x1e')]+_0x37edc7['limit'];var _0x3cb9ef;if(_0x480497>=_0x55efd6){_0x480497=_0x55efd6;_0x3cb9ef=0xc8;}else{_0x3cb9ef=0xce;}_0x1ec711[_0x8cf5('0x1b')](_0x3cb9ef);return _0x1ec711[_0x8cf5('0x1f')](_0x8cf5('0x20'),_0x1d17bf+'-'+_0x480497+'/'+_0x55efd6)[_0x8cf5('0x21')](_0x192ef6);}return null;};}function patchUpdates(_0x18af83){return function(_0x5b4a3f){try{jsonpatch[_0x8cf5('0x22')](_0x5b4a3f,_0x18af83,!![]);}catch(_0xd0720e){return BPromise[_0x8cf5('0x23')](_0xd0720e);}return _0x5b4a3f[_0x8cf5('0x24')]();};}function saveUpdates(_0x3e6cc4,_0xf94618){return function(_0x35d1e8){if(_0x35d1e8){return _0x35d1e8['update'](_0x3e6cc4)['then'](function(_0x1f34df){return _0x1f34df;});}return null;};}function removeEntity(_0x2e9e7f,_0xb56f52){return function(_0x250fc7){if(_0x250fc7){return _0x250fc7[_0x8cf5('0x25')]()[_0x8cf5('0x26')](function(){var _0x49e30b=_0x250fc7[_0x8cf5('0x27')]({'plain':!![]});var _0x247911='MusicOnHolds';return db['UserProfileResource'][_0x8cf5('0x25')]({'where':{'type':_0x247911,'resourceId':_0x49e30b['id']}})[_0x8cf5('0x26')](function(){return _0x250fc7;});})['then'](function(){_0x2e9e7f['status'](0xcc)[_0x8cf5('0x28')]();});}};}function handleEntityNotFound(_0xfc91f7,_0x2115ec){return function(_0x1f229c){if(!_0x1f229c){_0xfc91f7['sendStatus'](0x194);}return _0x1f229c;};}function handleError(_0x51c2ab,_0x51da07){_0x51da07=_0x51da07||0x1f4;return function(_0x49b7aa){logger[_0x8cf5('0x29')](_0x49b7aa[_0x8cf5('0x2a')]);if(_0x49b7aa[_0x8cf5('0x2b')]){delete _0x49b7aa[_0x8cf5('0x2b')];}_0x51c2ab[_0x8cf5('0x1b')](_0x51da07)['send'](_0x49b7aa);};}exports[_0x8cf5('0x2c')]=function(_0x37852e,_0x491b84){var _0x39483e={},_0x408723={},_0x311a34={'count':0x0,'rows':[]};var _0x4677e3=_[_0x8cf5('0x2d')](db['VoiceMusicOnHold'][_0x8cf5('0x2e')],function(_0x3fd145){return{'name':_0x3fd145[_0x8cf5('0x2f')],'type':_0x3fd145[_0x8cf5('0x30')][_0x8cf5('0x31')]};});_0x408723[_0x8cf5('0x32')]=_['map'](_0x4677e3,_0x8cf5('0x2b'));_0x408723[_0x8cf5('0x33')]=_['keys'](_0x37852e[_0x8cf5('0x33')]);_0x408723[_0x8cf5('0x34')]=_['intersection'](_0x408723['model'],_0x408723['query']);_0x39483e[_0x8cf5('0x35')]=_[_0x8cf5('0x36')](_0x408723['model'],qs[_0x8cf5('0x37')](_0x37852e[_0x8cf5('0x33')][_0x8cf5('0x37')]));_0x39483e['attributes']=_0x39483e[_0x8cf5('0x35')][_0x8cf5('0x38')]?_0x39483e[_0x8cf5('0x35')]:_0x408723[_0x8cf5('0x32')];if(!_0x37852e['query'][_0x8cf5('0x39')]('nolimit')){_0x39483e['limit']=qs[_0x8cf5('0x3a')](_0x37852e['query'][_0x8cf5('0x3a')]);_0x39483e[_0x8cf5('0x1e')]=qs[_0x8cf5('0x1e')](_0x37852e['query'][_0x8cf5('0x1e')]);}_0x39483e['order']=qs[_0x8cf5('0x3b')](_0x37852e[_0x8cf5('0x33')]['sort']);delete _0x37852e[_0x8cf5('0x33')][_0x8cf5('0x3b')];_0x39483e[_0x8cf5('0x3c')]=qs[_0x8cf5('0x34')](_[_0x8cf5('0x3d')](_0x37852e[_0x8cf5('0x33')],_0x408723['filters']),_0x4677e3);if(_0x37852e[_0x8cf5('0x33')][_0x8cf5('0x3e')]){_0x39483e[_0x8cf5('0x3c')]=_[_0x8cf5('0x3f')](_0x39483e[_0x8cf5('0x3c')],{'$or':_[_0x8cf5('0x2d')](_0x4677e3,function(_0x1907ad){if(_0x1907ad[_0x8cf5('0x30')]!==_0x8cf5('0x40')){var _0x344202={};_0x344202[_0x1907ad[_0x8cf5('0x2b')]]={'$like':'%'+_0x37852e['query'][_0x8cf5('0x3e')]+'%'};return _0x344202;}})});}_0x39483e=_[_0x8cf5('0x3f')]({},_0x39483e,_0x37852e['options']);var _0x428e44={'where':_0x39483e[_0x8cf5('0x3c')]};return db[_0x8cf5('0x41')][_0x8cf5('0x1d')](_0x428e44)[_0x8cf5('0x26')](function(_0x1c54f7){_0x311a34[_0x8cf5('0x1d')]=_0x1c54f7;if(_0x37852e[_0x8cf5('0x33')][_0x8cf5('0x42')]){_0x39483e[_0x8cf5('0x43')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x8cf5('0x44')](_0x39483e);})['then'](function(_0x10c22e){_0x311a34['rows']=_0x10c22e;return _0x311a34;})[_0x8cf5('0x26')](respondWithFilteredResult(_0x491b84,_0x39483e))[_0x8cf5('0x45')](handleError(_0x491b84,null));};exports['show']=function(_0x2f7e62,_0x349eca){var _0x5461dd={'raw':![],'where':{'id':_0x2f7e62[_0x8cf5('0x46')]['id']}},_0x3b770c={};_0x3b770c[_0x8cf5('0x32')]=_[_0x8cf5('0x47')](db['VoiceMusicOnHold'][_0x8cf5('0x2e')]);_0x3b770c[_0x8cf5('0x33')]=_[_0x8cf5('0x47')](_0x2f7e62[_0x8cf5('0x33')]);_0x3b770c['filters']=_[_0x8cf5('0x36')](_0x3b770c[_0x8cf5('0x32')],_0x3b770c['query']);_0x5461dd[_0x8cf5('0x35')]=_[_0x8cf5('0x36')](_0x3b770c[_0x8cf5('0x32')],qs[_0x8cf5('0x37')](_0x2f7e62[_0x8cf5('0x33')][_0x8cf5('0x37')]));_0x5461dd[_0x8cf5('0x35')]=_0x5461dd[_0x8cf5('0x35')][_0x8cf5('0x38')]?_0x5461dd[_0x8cf5('0x35')]:_0x3b770c['model'];if(_0x2f7e62[_0x8cf5('0x33')][_0x8cf5('0x42')]){_0x5461dd[_0x8cf5('0x43')]=[{'all':!![]}];}_0x5461dd=_[_0x8cf5('0x3f')]({},_0x5461dd,_0x2f7e62[_0x8cf5('0x48')]);return db[_0x8cf5('0x41')]['find'](_0x5461dd)[_0x8cf5('0x26')](handleEntityNotFound(_0x349eca,null))['then'](respondWithResult(_0x349eca,null))['catch'](handleError(_0x349eca,null));};exports[_0x8cf5('0x49')]=function(_0x2f6228,_0xa7ce69){if(_0x2f6228[_0x8cf5('0x4a')]['id']){delete _0x2f6228[_0x8cf5('0x4a')]['id'];}return db[_0x8cf5('0x41')][_0x8cf5('0x4b')]({'where':{'id':_0x2f6228['params']['id']}})['then'](handleEntityNotFound(_0xa7ce69,null))['then'](saveUpdates(_0x2f6228[_0x8cf5('0x4a')],null))[_0x8cf5('0x26')](respondWithResult(_0xa7ce69,null))[_0x8cf5('0x45')](handleError(_0xa7ce69,null));};exports[_0x8cf5('0x4c')]=function(_0xc2b281,_0x4f7b65,_0x5776b9){return db[_0x8cf5('0x4d')][_0x8cf5('0x4e')](function(_0x258075){if(_0xc2b281['body'][_0x8cf5('0x4f')]===_0x8cf5('0x50')){_0xc2b281[_0x8cf5('0x4a')][_0x8cf5('0x51')]=path[_0x8cf5('0x52')](config[_0x8cf5('0x53')],_0x8cf5('0x54'),_0xc2b281[_0x8cf5('0x4a')][_0x8cf5('0x2b')]);}return db[_0x8cf5('0x41')][_0x8cf5('0x4c')](_0xc2b281[_0x8cf5('0x4a')],{'transaction':_0x258075})[_0x8cf5('0x26')](function(_0x477988){if(_0xc2b281[_0x8cf5('0x4a')][_0x8cf5('0x4f')]===_0x8cf5('0x50')){fs['mkdirSync'](_0x477988[_0x8cf5('0x51')],parseInt(_0x8cf5('0x55'),0x8));}var _0x3e6e64=_0xc2b281[_0x8cf5('0x56')]['get']({'plain':!![]});if(!_0x3e6e64)throw new Error(_0x8cf5('0x57'));if(_0x3e6e64[_0x8cf5('0x58')]===_0x8cf5('0x56')){var _0x2df63c=_0x477988[_0x8cf5('0x27')]({'plain':!![]});return db[_0x8cf5('0x59')][_0x8cf5('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x3e6e64[_0x8cf5('0x5a')]},'raw':!![]})[_0x8cf5('0x26')](function(_0x4c669c){if(_0x4c669c&&_0x4c669c[_0x8cf5('0x5b')]===0x0){return db[_0x8cf5('0x5c')][_0x8cf5('0x4c')]({'name':_0x2df63c[_0x8cf5('0x2b')],'resourceId':_0x2df63c['id'],'type':_0x4c669c[_0x8cf5('0x2b')],'sectionId':_0x4c669c['id']},{})[_0x8cf5('0x26')](function(){return _0x477988;});}else{return _0x477988;}})['catch'](function(_0x2c2d25){logger[_0x8cf5('0x29')](_0x8cf5('0x5d'),_0x2c2d25);});}return _0x477988;});})['then'](respondWithResult(_0x4f7b65,0xc9))[_0x8cf5('0x45')](handleError(_0x4f7b65,null));};exports[_0x8cf5('0x25')]=function(_0x30151a,_0x4386f5,_0x4bbb77){var _0x1d79ec;return db[_0x8cf5('0x41')][_0x8cf5('0x4b')]({'where':{'id':_0x30151a[_0x8cf5('0x46')]['id']}})[_0x8cf5('0x26')](function(_0x350801){if(_0x350801){return db[_0x8cf5('0x4d')][_0x8cf5('0x4e')](function(_0xb10b95){return _0x350801[_0x8cf5('0x25')]({'transaction':_0xb10b95,'raw':!![]})[_0x8cf5('0x26')](function(_0x242948){if(_0x242948[_0x8cf5('0x51')]){fs[_0x8cf5('0x5e')](_0x242948[_0x8cf5('0x51')])[_0x8cf5('0x5f')](function(_0x3fdd5e){fs[_0x8cf5('0x60')](path[_0x8cf5('0x52')](_0x242948[_0x8cf5('0x51')],_0x3fdd5e));});fs[_0x8cf5('0x61')](_0x242948[_0x8cf5('0x51')]);}return _0x242948;});})['catch'](function(_0x5a0295){throw new db[(_0x8cf5('0x62'))][(_0x8cf5('0x63'))](_0x5a0295['message']);});}})['then'](handleEntityNotFound(_0x4386f5,null))[_0x8cf5('0x26')](removeEntity(_0x4386f5,null))[_0x8cf5('0x45')](handleError(_0x4386f5,null));};exports['addSound']=function(_0x20e172,_0x9f098e,_0x27da6b){return db[_0x8cf5('0x4d')]['transaction'](function(_0x4b52af){var _0x2dc33f;return db['VoiceMusicOnHold'][_0x8cf5('0x4b')]({'where':{'id':_0x20e172[_0x8cf5('0x46')]['id']}})[_0x8cf5('0x26')](function(_0x101f2c){if(_0x101f2c){_0x2dc33f=_0x101f2c;return _0x101f2c[_0x8cf5('0x64')](_0x20e172[_0x8cf5('0x4a')]['id'],{'transaction':_0x4b52af});}})[_0x8cf5('0x26')](function(_0x5600a6){if(_0x5600a6){return db[_0x8cf5('0x65')]['findOne']({'where':{'id':_0x20e172['body']['id']},'attributes':['id',_0x8cf5('0x2b'),'save_name',_0x8cf5('0x66'),_0x8cf5('0x67')],'raw':!![]});}})[_0x8cf5('0x26')](function(_0x35198e){if(_0x35198e){var _0xca79c6=path[_0x8cf5('0x52')](config[_0x8cf5('0x53')],'server/files/sounds/converted',util[_0x8cf5('0x68')](_0x8cf5('0x69'),path[_0x8cf5('0x6a')](_0x35198e['save_name'],path[_0x8cf5('0x6b')](_0x35198e[_0x8cf5('0x6c')])),_0x35198e[_0x8cf5('0x66')]));var _0x1494ad=path[_0x8cf5('0x52')](config[_0x8cf5('0x53')],'server/files/moh',_0x2dc33f[_0x8cf5('0x2b')],util['format'](_0x8cf5('0x69'),_0x35198e[_0x8cf5('0x2b')],_0x35198e[_0x8cf5('0x66')]));fs[_0x8cf5('0x6d')](_0xca79c6,_0x1494ad);return _0x35198e;}})[_0x8cf5('0x45')](function(_0x2b4c5d){throw new db[(_0x8cf5('0x62'))][(_0x8cf5('0x63'))](_0x2b4c5d[_0x8cf5('0x6e')]);});})[_0x8cf5('0x26')](handleEntityNotFound(_0x9f098e,null))[_0x8cf5('0x26')](respondWithResult(_0x9f098e,0xc9))['catch'](handleError(_0x9f098e,null));};exports[_0x8cf5('0x6f')]=function(_0x9b87c7,_0x15c717,_0x371536){return db[_0x8cf5('0x4d')][_0x8cf5('0x4e')](function(_0x1ae86e){var _0x7cc65c;return db['VoiceMusicOnHold'][_0x8cf5('0x70')]({'where':{'id':_0x9b87c7[_0x8cf5('0x46')]['id']}})['then'](handleEntityNotFound(_0x15c717,null))['then'](function(_0x48deed){if(_0x48deed){_0x7cc65c=_0x48deed;return _0x48deed[_0x8cf5('0x6f')](_0x9b87c7['params']['id2']);}})['then'](function(_0x225bda){if(_0x225bda){return db[_0x8cf5('0x65')]['findOne']({'where':{'id':_0x9b87c7[_0x8cf5('0x46')][_0x8cf5('0x71')]},'attributes':['id','name',_0x8cf5('0x6c'),_0x8cf5('0x66'),_0x8cf5('0x67')],'raw':!![]});}})[_0x8cf5('0x26')](function(_0x6d8428){if(_0x6d8428){fs['unlinkSync'](path['join'](_0x7cc65c[_0x8cf5('0x51')],util[_0x8cf5('0x68')](_0x8cf5('0x69'),_0x6d8428[_0x8cf5('0x2b')],_0x6d8428['converted_format'])));return _0x6d8428;}})[_0x8cf5('0x45')](function(_0x5ae0ba){throw new db['Sequelize'][(_0x8cf5('0x63'))](_0x5ae0ba[_0x8cf5('0x6e')]);});})[_0x8cf5('0x26')](handleEntityNotFound(_0x15c717,null))['then'](respondWithStatusCode(_0x15c717,0xcc))[_0x8cf5('0x45')](handleError(_0x15c717,null));};exports[_0x8cf5('0x72')]=function(_0x1a6882,_0x44f86b,_0x382bf3){var _0x37cd23={};var _0x12e152={};var _0x32bdf3;var _0x553076;return db[_0x8cf5('0x41')][_0x8cf5('0x70')]({'where':{'id':_0x1a6882[_0x8cf5('0x46')]['id']}})[_0x8cf5('0x26')](handleEntityNotFound(_0x44f86b,null))[_0x8cf5('0x26')](function(_0x38305c){if(_0x38305c){_0x32bdf3=_0x38305c;_0x12e152[_0x8cf5('0x32')]=_[_0x8cf5('0x47')](db[_0x8cf5('0x65')]['rawAttributes']);_0x12e152[_0x8cf5('0x33')]=_[_0x8cf5('0x47')](_0x1a6882[_0x8cf5('0x33')]);_0x12e152[_0x8cf5('0x34')]=_[_0x8cf5('0x36')](_0x12e152[_0x8cf5('0x32')],_0x12e152[_0x8cf5('0x33')]);_0x37cd23['attributes']=_[_0x8cf5('0x36')](_0x12e152[_0x8cf5('0x32')],qs[_0x8cf5('0x37')](_0x1a6882['query'][_0x8cf5('0x37')]));_0x37cd23[_0x8cf5('0x35')]=_0x37cd23[_0x8cf5('0x35')][_0x8cf5('0x38')]?_0x37cd23[_0x8cf5('0x35')]:_0x12e152['model'];_0x37cd23['order']=qs[_0x8cf5('0x3b')](_0x1a6882[_0x8cf5('0x33')]['sort']);_0x37cd23['where']=qs[_0x8cf5('0x34')](_['pick'](_0x1a6882[_0x8cf5('0x33')],_0x12e152[_0x8cf5('0x34')]));if(_0x1a6882[_0x8cf5('0x33')][_0x8cf5('0x3e')]){_0x37cd23[_0x8cf5('0x3c')]=_['merge'](_0x37cd23[_0x8cf5('0x3c')],{'$or':_['map'](_0x37cd23['attributes'],function(_0x44b846){var _0x3aa16e={};_0x3aa16e[_0x44b846]={'$like':'%'+_0x1a6882[_0x8cf5('0x33')][_0x8cf5('0x3e')]+'%'};return _0x3aa16e;})});}_0x37cd23=_[_0x8cf5('0x3f')]({},_0x37cd23,_0x1a6882['options']);return _0x32bdf3[_0x8cf5('0x72')](_0x37cd23);}})[_0x8cf5('0x26')](function(_0x3e9ae2){if(_0x3e9ae2){_0x553076=_0x3e9ae2['length'];if(!_0x1a6882['query']['hasOwnProperty'](_0x8cf5('0x73'))){_0x37cd23[_0x8cf5('0x3a')]=qs['limit'](_0x1a6882['query']['limit']);_0x37cd23[_0x8cf5('0x1e')]=qs[_0x8cf5('0x1e')](_0x1a6882[_0x8cf5('0x33')][_0x8cf5('0x1e')]);}return _0x32bdf3[_0x8cf5('0x72')](_0x37cd23);}})[_0x8cf5('0x26')](function(_0x336929){if(_0x336929){return _0x336929?{'count':_0x553076,'rows':_0x336929}:null;}})[_0x8cf5('0x26')](respondWithResult(_0x44f86b,null))[_0x8cf5('0x45')](handleError(_0x44f86b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 47bb9fa..4cb1e19 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 _0x8669=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','voice_musiconhold','lodash','util','../../config/logger'];(function(_0xb0d77b,_0x31954e){var _0x472815=function(_0x549e13){while(--_0x549e13){_0xb0d77b['push'](_0xb0d77b['shift']());}};_0x472815(++_0x31954e);}(_0x8669,0x75));var _0x9866=function(_0x526635,_0x3ed5d4){_0x526635=_0x526635-0x0;var _0xd0a1c7=_0x8669[_0x526635];return _0xd0a1c7;};'use strict';var _=require(_0x9866('0x0'));var util=require(_0x9866('0x1'));var logger=require(_0x9866('0x2'))(_0x9866('0x3'));var moment=require(_0x9866('0x4'));var BPromise=require(_0x9866('0x5'));var rp=require(_0x9866('0x6'));var fs=require('fs');var path=require(_0x9866('0x7'));var rimraf=require(_0x9866('0x8'));var config=require(_0x9866('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x201418,_0x1fa219){return _0x201418[_0x9866('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x9866('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x406f=['rimraf','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api','bluebird'];(function(_0x3955f0,_0x1b7306){var _0x36d5f4=function(_0x3bac38){while(--_0x3bac38){_0x3955f0['push'](_0x3955f0['shift']());}};_0x36d5f4(++_0x1b7306);}(_0x406f,0xcb));var _0xf406=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x406f[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0xf406('0x0'));var util=require(_0xf406('0x1'));var logger=require('../../config/logger')(_0xf406('0x2'));var moment=require('moment');var BPromise=require(_0xf406('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf406('0x4'));var config=require('../../config/environment');var attributes=require(_0xf406('0x5'));module['exports']=function(_0xe16864,_0x5bd5a0){return _0xe16864[_0xf406('0x6')](_0xf406('0x7'),attributes,{'tableName':_0xf406('0x8'),'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 5828329..0609cb4 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(_0x1c149f,_0x42b311){var _0x17c5e=function(_0x4daf05){while(--_0x4daf05){_0x1c149f['push'](_0x1c149f['shift']());}};_0x17c5e(++_0x42b311);}(_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 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5f3a9c,_0x52b8f1){var _0x1541c1=function(_0x282662){while(--_0x282662){_0x5f3a9c['push'](_0x5f3a9c['shift']());}};_0x1541c1(++_0x52b8f1);}(_0x70e0,0x17b));var _0x070e=function(_0x152b46,_0x2b2dc4){_0x152b46=_0x152b46-0x0;var _0x191c62=_0x70e0[_0x152b46];return _0x191c62;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index e89e3ad..92e72cd 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 _0xb42d=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voicePrefix.controller','isAuthenticated','index','get','/:id','show','getAgents','/:id/teams','getTeams','/:id/users','addAgents','post','addTeams','put','delete','removeAgents','removeTeams','exports','multer'];(function(_0x266129,_0x11cf5c){var _0x5124bf=function(_0x366498){while(--_0x366498){_0x266129['push'](_0x266129['shift']());}};_0x5124bf(++_0x11cf5c);}(_0xb42d,0x1ed));var _0xdb42=function(_0x450ca5,_0x397450){_0x450ca5=_0x450ca5-0x0;var _0x56ff90=_0xb42d[_0x450ca5];return _0x56ff90;};'use strict';var multer=require(_0xdb42('0x0'));var util=require(_0xdb42('0x1'));var path=require(_0xdb42('0x2'));var timeout=require(_0xdb42('0x3'));var express=require(_0xdb42('0x4'));var router=express[_0xdb42('0x5')]();var fs_extra=require(_0xdb42('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdb42('0x7'));var config=require('../../config/environment');var controller=require(_0xdb42('0x8'));router['get']('/',auth[_0xdb42('0x9')](),controller[_0xdb42('0xa')]);router[_0xdb42('0xb')]('/describe',auth[_0xdb42('0x9')](),controller['describe']);router[_0xdb42('0xb')](_0xdb42('0xc'),auth[_0xdb42('0x9')](),controller[_0xdb42('0xd')]);router[_0xdb42('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xdb42('0xe')]);router[_0xdb42('0xb')](_0xdb42('0xf'),auth[_0xdb42('0x9')](),controller[_0xdb42('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xdb42('0x11'),auth[_0xdb42('0x9')](),controller[_0xdb42('0x12')]);router[_0xdb42('0x13')](_0xdb42('0xf'),auth[_0xdb42('0x9')](),controller[_0xdb42('0x14')]);router[_0xdb42('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdb42('0x16')](_0xdb42('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xdb42('0x11'),auth[_0xdb42('0x9')](),controller[_0xdb42('0x17')]);router[_0xdb42('0x16')]('/:id/teams',auth[_0xdb42('0x9')](),controller[_0xdb42('0x18')]);module[_0xdb42('0x19')]=router; \ No newline at end of file +var _0xde64=['delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','/:id/users','/:id/teams','getTeams','post','create','addAgents','put'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xde64,0x17c));var _0x4de6=function(_0xd6c494,_0x38b375){_0xd6c494=_0xd6c494-0x0;var _0x4eb926=_0xde64[_0xd6c494];return _0x4eb926;};'use strict';var multer=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var path=require(_0x4de6('0x2'));var timeout=require(_0x4de6('0x3'));var express=require(_0x4de6('0x4'));var router=express[_0x4de6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4de6('0x6'));var interaction=require(_0x4de6('0x7'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x4de6('0x8')]('/',auth[_0x4de6('0x9')](),controller['index']);router['get'](_0x4de6('0xa'),auth[_0x4de6('0x9')](),controller[_0x4de6('0xb')]);router[_0x4de6('0x8')](_0x4de6('0xc'),auth[_0x4de6('0x9')](),controller['show']);router[_0x4de6('0x8')](_0x4de6('0xd'),auth[_0x4de6('0x9')](),controller['getAgents']);router[_0x4de6('0x8')](_0x4de6('0xe'),auth[_0x4de6('0x9')](),controller[_0x4de6('0xf')]);router[_0x4de6('0x10')]('/',auth['isAuthenticated'](),controller[_0x4de6('0x11')]);router[_0x4de6('0x10')](_0x4de6('0xd'),auth['isAuthenticated'](),controller[_0x4de6('0x12')]);router[_0x4de6('0x10')](_0x4de6('0xe'),auth[_0x4de6('0x9')](),controller['addTeams']);router[_0x4de6('0x13')](_0x4de6('0xc'),auth[_0x4de6('0x9')](),controller['update']);router[_0x4de6('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4de6('0x15')]);router[_0x4de6('0x14')](_0x4de6('0xd'),auth[_0x4de6('0x9')](),controller[_0x4de6('0x16')]);router[_0x4de6('0x14')](_0x4de6('0xe'),auth['isAuthenticated'](),controller[_0x4de6('0x17')]);module[_0x4de6('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index e02cdf5..27d182c 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 _0xfadd=['INTEGER','sequelize','STRING','system-','getDataValue','name'];(function(_0x481b72,_0x50df3f){var _0x123573=function(_0x301e4e){while(--_0x301e4e){_0x481b72['push'](_0x481b72['shift']());}};_0x123573(++_0x50df3f);}(_0xfadd,0x1b7));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdfad('0x0'));module['exports']={'name':{'type':Sequelize[_0xdfad('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f547c){return _0xdfad('0x2')+this[_0xdfad('0x3')](_0xdfad('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xdfad('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xdfad('0x5')]}}; \ No newline at end of file +var _0x7644=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x3f5b1b,_0x5e8454){var _0x16689f=function(_0x106552){while(--_0x106552){_0x3f5b1b['push'](_0x3f5b1b['shift']());}};_0x16689f(++_0x5e8454);}(_0x7644,0xe2));var _0x4764=function(_0x4aab0c,_0x16c399){_0x4aab0c=_0x4aab0c-0x0;var _0x14528c=_0x7644[_0x4aab0c];return _0x14528c;};'use strict';var Sequelize=require(_0x4764('0x0'));module[_0x4764('0x1')]={'name':{'type':Sequelize[_0x4764('0x2')],'allowNull':![],'unique':_0x4764('0x3')},'prefix':{'type':Sequelize[_0x4764('0x4')],'get':function(_0x486a0e){return _0x4764('0x5')+this[_0x4764('0x6')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x4764('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x4764('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 67ee077..2bfca37 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 _0x3266=['index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','emit','userVoicePrefix:save','ids','removeAgents','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','getTeams','Team','interface','Agents','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0x3266,0x6a));var _0x6326=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x3266[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];config[_0x6326('0x1c')]=_['defaults'](config['redis'],{'host':_0x6326('0x1d'),'port':0x18eb});var socket=require(_0x6326('0x1e'))(new Redis(config['redis']));require(_0x6326('0x1f'))['register'](socket);function respondWithStatusCode(_0x2d2d9b,_0x20dcc6){_0x20dcc6=_0x20dcc6||0xcc;return function(_0x3d6ac0){if(_0x3d6ac0){return _0x2d2d9b[_0x6326('0x20')](_0x20dcc6);}return _0x2d2d9b[_0x6326('0x21')](_0x20dcc6)[_0x6326('0x22')]();};}function respondWithResult(_0x55923a,_0x1104c5){_0x1104c5=_0x1104c5||0xc8;return function(_0x518e6f){if(_0x518e6f){return _0x55923a['status'](_0x1104c5)['json'](_0x518e6f);}};}function respondWithFilteredResult(_0x51e7b9,_0x5d402d){return function(_0x58e960){if(_0x58e960){var _0xdf5ced=typeof _0x5d402d[_0x6326('0x23')]===_0x6326('0x24')&&typeof _0x5d402d['limit']==='undefined';var _0x954ed5=_0x58e960[_0x6326('0x25')];var _0x272b5c=_0xdf5ced?0x0:_0x5d402d[_0x6326('0x23')];var _0x3c08db=_0xdf5ced?_0x58e960[_0x6326('0x25')]:_0x5d402d[_0x6326('0x23')]+_0x5d402d['limit'];var _0x22307f;if(_0x3c08db>=_0x954ed5){_0x3c08db=_0x954ed5;_0x22307f=0xc8;}else{_0x22307f=0xce;}_0x51e7b9['status'](_0x22307f);return _0x51e7b9[_0x6326('0x26')](_0x6326('0x27'),_0x272b5c+'-'+_0x3c08db+'/'+_0x954ed5)[_0x6326('0x28')](_0x58e960);}return null;};}function patchUpdates(_0x24fb78){return function(_0x43cdfc){try{jsonpatch[_0x6326('0x29')](_0x43cdfc,_0x24fb78,!![]);}catch(_0x225555){return BPromise[_0x6326('0x2a')](_0x225555);}return _0x43cdfc[_0x6326('0x2b')]();};}function saveUpdates(_0x2d0d00,_0x34954b){return function(_0x4933e1){if(_0x4933e1){return _0x4933e1[_0x6326('0x2c')](_0x2d0d00)[_0x6326('0x2d')](function(_0x575701){return _0x575701;});}return null;};}function removeEntity(_0x4e272b,_0x4d28fd){return function(_0x405474){if(_0x405474){return _0x405474['destroy']()[_0x6326('0x2d')](function(){var _0x1a48da=_0x405474['get']({'plain':!![]});var _0x15e33d=_0x6326('0x2e');return db[_0x6326('0x2f')][_0x6326('0x30')]({'where':{'type':_0x15e33d,'resourceId':_0x1a48da['id']}})[_0x6326('0x2d')](function(){return _0x405474;});})[_0x6326('0x2d')](function(){_0x4e272b[_0x6326('0x21')](0xcc)[_0x6326('0x22')]();});}};}function handleEntityNotFound(_0x461e0f,_0x127744){return function(_0x4980f6){if(!_0x4980f6){_0x461e0f[_0x6326('0x20')](0x194);}return _0x4980f6;};}function handleError(_0x331772,_0x134524){_0x134524=_0x134524||0x1f4;return function(_0x2e0445){logger[_0x6326('0x31')](_0x2e0445['stack']);if(_0x2e0445[_0x6326('0x32')]){delete _0x2e0445[_0x6326('0x32')];}_0x331772[_0x6326('0x21')](_0x134524)['send'](_0x2e0445);};}exports[_0x6326('0x33')]=function(_0x4d7807,_0x4e703a){var _0xfb6b62={},_0x7ac8d9={},_0x160a12={'count':0x0,'rows':[]};var _0x103b1c=_[_0x6326('0x34')](db[_0x6326('0x35')][_0x6326('0x36')],function(_0x46c803){return{'name':_0x46c803[_0x6326('0x37')],'type':_0x46c803[_0x6326('0x38')][_0x6326('0x39')]};});_0x7ac8d9[_0x6326('0x3a')]=_['map'](_0x103b1c,_0x6326('0x32'));_0x7ac8d9[_0x6326('0x3b')]=_['keys'](_0x4d7807[_0x6326('0x3b')]);_0x7ac8d9[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x7ac8d9['model'],_0x7ac8d9[_0x6326('0x3b')]);_0xfb6b62['attributes']=_['intersection'](_0x7ac8d9[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x4d7807[_0x6326('0x3b')]['fields']));_0xfb6b62[_0x6326('0x3f')]=_0xfb6b62['attributes'][_0x6326('0x40')]?_0xfb6b62['attributes']:_0x7ac8d9[_0x6326('0x3a')];if(!_0x4d7807[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0xfb6b62[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x4d7807['query'][_0x6326('0x43')]);_0xfb6b62[_0x6326('0x23')]=qs['offset'](_0x4d7807[_0x6326('0x3b')]['offset']);}_0xfb6b62['order']=qs[_0x6326('0x44')](_0x4d7807[_0x6326('0x3b')][_0x6326('0x44')]);_0xfb6b62[_0x6326('0x45')]=qs[_0x6326('0x3c')](_[_0x6326('0x46')](_0x4d7807['query'],_0x7ac8d9['filters']),_0x103b1c);if(_0x4d7807[_0x6326('0x3b')]['filter']){_0xfb6b62[_0x6326('0x45')]=_['merge'](_0xfb6b62[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x103b1c,function(_0x335feb){if(_0x335feb[_0x6326('0x38')]!==_0x6326('0x47')){var _0x1b754d={};_0x1b754d[_0x335feb[_0x6326('0x32')]]={'$like':'%'+_0x4d7807[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x1b754d;}})});}_0xfb6b62=_[_0x6326('0x49')]({},_0xfb6b62,_0x4d7807[_0x6326('0x4a')]);var _0x5d36b1={'where':_0xfb6b62[_0x6326('0x45')]};return db['VoicePrefix'][_0x6326('0x25')](_0x5d36b1)[_0x6326('0x2d')](function(_0x16fc33){_0x160a12[_0x6326('0x25')]=_0x16fc33;if(_0x4d7807['query'][_0x6326('0x4b')]){_0xfb6b62[_0x6326('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6326('0x4d')](_0xfb6b62);})[_0x6326('0x2d')](function(_0x7a5057){_0x160a12[_0x6326('0x4e')]=_0x7a5057;return _0x160a12;})['then'](respondWithFilteredResult(_0x4e703a,_0xfb6b62))[_0x6326('0x4f')](handleError(_0x4e703a,null));};exports[_0x6326('0x50')]=function(_0x231e15,_0x28504f){var _0x44d852={'raw':![],'where':{'id':_0x231e15[_0x6326('0x51')]['id']}},_0x165953={};_0x165953['model']=_[_0x6326('0x52')](db[_0x6326('0x35')][_0x6326('0x36')]);_0x165953[_0x6326('0x3b')]=_['keys'](_0x231e15[_0x6326('0x3b')]);_0x165953['filters']=_[_0x6326('0x3d')](_0x165953[_0x6326('0x3a')],_0x165953[_0x6326('0x3b')]);_0x44d852[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x165953['model'],qs[_0x6326('0x3e')](_0x231e15['query']['fields']));_0x44d852[_0x6326('0x3f')]=_0x44d852[_0x6326('0x3f')]['length']?_0x44d852[_0x6326('0x3f')]:_0x165953[_0x6326('0x3a')];if(_0x231e15[_0x6326('0x3b')][_0x6326('0x4b')]){_0x44d852[_0x6326('0x4c')]=[{'all':!![]}];}_0x44d852=_['merge']({},_0x44d852,_0x231e15['options']);return db[_0x6326('0x35')][_0x6326('0x53')](_0x44d852)[_0x6326('0x2d')](handleEntityNotFound(_0x28504f,null))[_0x6326('0x2d')](respondWithResult(_0x28504f,null))[_0x6326('0x4f')](handleError(_0x28504f,null));};exports[_0x6326('0x30')]=function(_0xdc4522,_0x55bcd6){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0xdc4522[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x55bcd6,null))[_0x6326('0x2d')](removeEntity(_0x55bcd6,null))['catch'](handleError(_0x55bcd6,null));};exports[_0x6326('0x54')]=function(_0x55537a,_0x216972){return db[_0x6326('0x35')]['describe']()[_0x6326('0x2d')](respondWithResult(_0x216972,null))['catch'](handleError(_0x216972,null));};exports[_0x6326('0x55')]=function(_0x202fd3,_0x2ee8df){var _0x35400e;return db['sequelize'][_0x6326('0x56')](function(_0xbe6b3e){return db['VoicePrefix'][_0x6326('0x55')](_0x202fd3[_0x6326('0x57')],{'transaction':_0xbe6b3e})[_0x6326('0x2d')](function(_0x4a42ae){_0x35400e=_0x4a42ae[_0x6326('0x58')]({'plain':!![]});return db[_0x6326('0x59')]['find']({'where':{'id':_0x35400e[_0x6326('0x5a')]},'raw':!![]})['then'](function(_0x1f1463){return createVoicePrefixExtensions(_0x35400e,_0x1f1463,_0xbe6b3e);});});})[_0x6326('0x2d')](function(){var _0x3e9825=_0x202fd3[_0x6326('0x5b')][_0x6326('0x58')]({'plain':!![]});if(!_0x3e9825)throw new Error(_0x6326('0x5c'));if(_0x3e9825[_0x6326('0x5d')]==='user'){var _0x51adce=_0x35400e;return db['UserProfileSection'][_0x6326('0x53')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9825[_0x6326('0x5e')]},'raw':!![]})[_0x6326('0x2d')](function(_0xcae454){if(_0xcae454&&_0xcae454[_0x6326('0x5f')]===0x0){return db[_0x6326('0x2f')]['create']({'name':_0x51adce[_0x6326('0x32')],'resourceId':_0x51adce['id'],'type':_0xcae454[_0x6326('0x32')],'sectionId':_0xcae454['id']},{})['then'](function(){return _0x35400e;});}else{return _0x35400e;}})[_0x6326('0x4f')](function(_0xdeba28){logger[_0x6326('0x31')](_0x6326('0x60'),_0xdeba28);throw _0xdeba28;});}return _0x35400e;})[_0x6326('0x2d')](respondWithResult(_0x2ee8df,null))[_0x6326('0x4f')](handleError(_0x2ee8df,null));};function Extension(_0x320d43,_0x2f624f,_0x2c7a8d,_0x37506f){this['context']=_0x6326('0x61');this[_0x6326('0x62')]=_0x320d43;this[_0x6326('0x63')]=_0x2c7a8d;this[_0x6326('0x38')]='system';this['description']=_0x6326('0x64');this[_0x6326('0x65')]=_0x2f624f;this[_0x6326('0x66')]=_0x37506f;}function createVoicePrefixExtensions(_0x10f54b,_0x3ac39d,_0x54a9eb){return new BPromise(function(_0x4cec50,_0x13fc10){var _0x447b34=new Extension(formatPrefixName(_0x10f54b[_0x6326('0x67')]),0x1,_0x6326('0x68'),'Voice\x20Prefix');_0x447b34[_0x6326('0x69')]=_0x10f54b['id'];return db[_0x6326('0x59')][_0x6326('0x55')](_0x447b34,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x4197d6){var _0xc8f404=_0x4197d6['get']({'plain':!![]});var _0x2bc08a=_['map'](addVoicePrefixExtensions(_0x10f54b,_0x3ac39d),function(_0x4877c8){_0x4877c8[_0x6326('0x5a')]=_0xc8f404['id'];_0x4877c8['VoicePrefixId']=_0x10f54b['id'];return _0x4877c8;});return db[_0x6326('0x59')][_0x6326('0x6a')](_0x2bc08a,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x3b6de7){if(!_0x3b6de7){return _0x13fc10(_0x6326('0x6b'));}else{return _0x4cec50(_0x3b6de7);}})[_0x6326('0x4f')](function(_0x1e8d86){return _0x13fc10(_0x1e8d86);});});;});};function addVoicePrefixExtensions(_0x75e3a7,_0xa2928e){var _0x3f5e2e=[];var _0x53ff60=formatPrefixName(_0x75e3a7[_0x6326('0x67')]);_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x2,_0x6326('0x6d'),_0x6326('0x6e')+_0x75e3a7[_0x6326('0x32')]));if(_0x75e3a7['callerIdAll']){_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,_0x6326('0x6d'),_0x6326('0x6f')+_0x75e3a7[_0x6326('0x70')]));}else{_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,'NoOp',_0x6326('0x71')));}_0x3f5e2e['push'](new Extension(_0x53ff60,0x4,'goto',_0xa2928e[_0x6326('0x72')]+','+_0x6326('0x73')+(0x8+_0x75e3a7[_0x6326('0x32')][_0x6326('0x40')])+'}'+','+0x1));return _0x3f5e2e;}function formatPrefixName(_0x4fd921){var _0x4fbede='_';for(var _0x5cadb2=0x0;_0x5cadb2<_0x4fd921['length'];_0x5cadb2++){if(_0x4fd921[_0x6326('0x74')](_0x5cadb2)=='-'){_0x4fbede+=_0x4fd921['charAt'](_0x5cadb2);}else{_0x4fbede+='['+_0x4fd921[_0x6326('0x74')](_0x5cadb2)+']';}}_0x4fbede+='.';return _0x4fbede;}exports[_0x6326('0x2c')]=function(_0x54730e,_0x4c1d7e,_0x5401cf){var _0x5e86bc=_0x54730e['body'];_0x5e86bc[_0x6326('0x67')]='system-'+_0x5e86bc['name']+'-';return db['sequelize']['transaction'](function(_0x19916e){return db['VoicePrefix'][_0x6326('0x2c')](_0x5e86bc,{'where':{'id':_0x5e86bc['id']},'transaction':_0x19916e})[_0x6326('0x2d')](function(){return db['VoiceExtension'][_0x6326('0x30')]({'where':{'VoicePrefixId':_0x5e86bc['id']},'transaction':_0x19916e})['then'](function(){return db[_0x6326('0x59')][_0x6326('0x53')]({'where':{'id':_0x5e86bc[_0x6326('0x5a')]},'raw':!![]})[_0x6326('0x2d')](function(_0x339838){return createVoicePrefixExtensions(_0x5e86bc,_0x339838,_0x19916e);});});});})[_0x6326('0x2d')](function(){return db[_0x6326('0x35')][_0x6326('0x75')](_0x5e86bc['id']);})[_0x6326('0x2d')](respondWithResult(_0x4c1d7e,null))[_0x6326('0x4f')](handleError(_0x4c1d7e,null));};exports[_0x6326('0x76')]=function(_0x19cc2b,_0x3bc5f3,_0x27a505){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0x19cc2b[_0x6326('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bc5f3,null))['then'](function(_0x543792){if(_0x543792){return _0x543792['addAgents'](_0x19cc2b[_0x6326('0x57')]['ids'],_['omit'](_0x19cc2b['body'],['ids','id'])||{})['spread'](function(_0x5a1a9f){for(var _0xe845d6=0x0;_0xe845d6<_0x19cc2b[_0x6326('0x57')]['ids'][_0x6326('0x40')];_0xe845d6+=0x1){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':Number(_0x19cc2b['body'][_0x6326('0x79')][_0xe845d6]),'VoicePrefixId':Number(_0x19cc2b[_0x6326('0x51')]['id'])});}return _0x5a1a9f;});}})[_0x6326('0x2d')](respondWithResult(_0x3bc5f3,null))[_0x6326('0x4f')](handleError(_0x3bc5f3,null));};exports[_0x6326('0x7a')]=function(_0x483813,_0x3bff09,_0x4aec22){return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x483813['params']['id']}})['then'](handleEntityNotFound(_0x3bff09,null))['then'](function(_0x491f2e){if(_0x491f2e){return _0x491f2e['removeAgents'](_0x483813['query']['ids'])[_0x6326('0x2d')](function(){if(_[_0x6326('0x7b')](_0x483813[_0x6326('0x3b')][_0x6326('0x79')])){for(var _0x590e06=0x0;_0x590e06<_0x483813['query']['ids'][_0x6326('0x40')];_0x590e06+=0x1){socket[_0x6326('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x483813[_0x6326('0x3b')]['ids'][_0x590e06]),'VoicePrefixId':Number(_0x483813['params']['id'])});}}else{socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':Number(_0x483813[_0x6326('0x3b')][_0x6326('0x79')]),'VoicePrefixId':Number(_0x483813[_0x6326('0x51')]['id'])});}});}})[_0x6326('0x2d')](respondWithStatusCode(_0x3bff09,null))[_0x6326('0x4f')](handleError(_0x3bff09,null));};exports['getAgents']=function(_0x5afd24,_0x4c8bde,_0x1ec0ef){var _0x5223f4={};var _0x48631a={};var _0xaea64f;var _0x429c41;return db['VoicePrefix'][_0x6326('0x7d')]({'where':{'id':_0x5afd24['params']['id']}})['then'](handleEntityNotFound(_0x4c8bde,null))[_0x6326('0x2d')](function(_0xbca686){if(_0xbca686){_0xaea64f=_0xbca686;_0x48631a['model']=_['keys'](db[_0x6326('0x7e')][_0x6326('0x36')]);_0x48631a[_0x6326('0x3b')]=_[_0x6326('0x52')](_0x5afd24['query']);_0x48631a['filters']=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],_0x48631a[_0x6326('0x3b')]);_0x5223f4[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x5afd24[_0x6326('0x3b')]['fields']));_0x5223f4[_0x6326('0x3f')]=_0x5223f4['attributes'][_0x6326('0x40')]?_0x5223f4[_0x6326('0x3f')]:_0x48631a[_0x6326('0x3a')];_0x5223f4[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x5afd24[_0x6326('0x3b')]['sort']);_0x5223f4[_0x6326('0x45')]=qs[_0x6326('0x3c')](_['pick'](_0x5afd24[_0x6326('0x3b')],_0x48631a[_0x6326('0x3c')]));if(_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]){_0x5223f4[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5223f4[_0x6326('0x45')],{'$or':_['map'](_0x5223f4[_0x6326('0x3f')],function(_0x21ccbf){var _0x458a7e={};_0x458a7e[_0x21ccbf]={'$like':'%'+_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x458a7e;})});}_0x5223f4=_['merge']({},_0x5223f4,_0x5afd24[_0x6326('0x4a')]);return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})['then'](function(_0x411fe5){if(_0x411fe5){_0x429c41=_0x411fe5[_0x6326('0x40')];if(!_0x5afd24[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5223f4[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x5afd24[_0x6326('0x3b')]['limit']);_0x5223f4[_0x6326('0x23')]=qs[_0x6326('0x23')](_0x5afd24[_0x6326('0x3b')][_0x6326('0x23')]);}return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})[_0x6326('0x2d')](function(_0xcb5683){if(_0xcb5683){return _0xcb5683?{'count':_0x429c41,'rows':_0xcb5683}:null;}})['then'](respondWithResult(_0x4c8bde,null))[_0x6326('0x4f')](handleError(_0x4c8bde,null));};exports['getTeams']=function(_0x44cea5,_0x57e6ad,_0x3a9312){var _0x5b251f={};var _0x2b885b={};var _0xda3005;var _0x29682b;return db[_0x6326('0x35')][_0x6326('0x7d')]({'where':{'id':_0x44cea5[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x57e6ad,null))['then'](function(_0x1da431){if(_0x1da431){_0xda3005=_0x1da431;_0x2b885b[_0x6326('0x3a')]=_[_0x6326('0x52')](db['Team'][_0x6326('0x36')]);_0x2b885b['query']=_[_0x6326('0x52')](_0x44cea5[_0x6326('0x3b')]);_0x2b885b[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x2b885b[_0x6326('0x3a')],_0x2b885b[_0x6326('0x3b')]);_0x5b251f[_0x6326('0x3f')]=_['intersection'](_0x2b885b[_0x6326('0x3a')],qs['fields'](_0x44cea5[_0x6326('0x3b')][_0x6326('0x3e')]));_0x5b251f[_0x6326('0x3f')]=_0x5b251f[_0x6326('0x3f')]['length']?_0x5b251f['attributes']:_0x2b885b[_0x6326('0x3a')];_0x5b251f[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x44cea5[_0x6326('0x3b')]['sort']);_0x5b251f[_0x6326('0x45')]=qs['filters'](_['pick'](_0x44cea5[_0x6326('0x3b')],_0x2b885b[_0x6326('0x3c')]));if(_0x44cea5[_0x6326('0x3b')][_0x6326('0x48')]){_0x5b251f[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5b251f[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x5b251f[_0x6326('0x3f')],function(_0x3884db){var _0x5ccb35={};_0x5ccb35[_0x3884db]={'$like':'%'+_0x44cea5['query'][_0x6326('0x48')]+'%'};return _0x5ccb35;})});}_0x5b251f=_['merge']({},_0x5b251f,_0x44cea5[_0x6326('0x4a')]);return _0xda3005['getTeams'](_0x5b251f);}})['then'](function(_0x10d3c6){if(_0x10d3c6){_0x29682b=_0x10d3c6[_0x6326('0x40')];if(!_0x44cea5[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5b251f[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x44cea5[_0x6326('0x3b')]['limit']);_0x5b251f['offset']=qs[_0x6326('0x23')](_0x44cea5['query'][_0x6326('0x23')]);}return _0xda3005[_0x6326('0x81')](_0x5b251f);}})['then'](function(_0x5c57e5){if(_0x5c57e5){return _0x5c57e5?{'count':_0x29682b,'rows':_0x5c57e5}:null;}})[_0x6326('0x2d')](respondWithResult(_0x57e6ad,null))['catch'](handleError(_0x57e6ad,null));};exports['addTeams']=function(_0x50d766,_0x4f45a6,_0x3a9a9e){var _0x22c60d=_0x50d766[_0x6326('0x57')][_0x6326('0x79')];var _0x26f784;return db[_0x6326('0x82')]['findAll']({'where':{'id':_0x22c60d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0x6326('0x83')],'raw':!![]}]})[_0x6326('0x2d')](function(_0x215db1){if(_0x215db1){_0x26f784=_0x215db1;var _0x2a9f5c=_['flatMap'](_0x215db1,function(_0x20f5ea){var _0x293f72=_0x20f5ea['get']({'plain':!![]});return _0x293f72[_0x6326('0x84')];});return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x50d766[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](function(_0x5d4b0a){return db['sequelize'][_0x6326('0x56')](function(_0xf912fe){return _0x5d4b0a[_0x6326('0x85')](_0x22c60d,{'transaction':_0xf912fe})['then'](function(){return BPromise[_0x6326('0x86')](_0x26f784,function(_0x464914){return db[_0x6326('0x87')]['upsert']({'TeamId':_0x464914['id'],'VoicePrefixId':_0x50d766[_0x6326('0x51')]['id']},{'transaction':_0xf912fe});});})['then'](function(){return BPromise[_0x6326('0x86')](_0x2a9f5c,function(_0x5a7b49){return db[_0x6326('0x88')][_0x6326('0x89')]({'where':{'UserId':_0x5a7b49['id'],'VoicePrefixId':_0x50d766['params']['id']},'transaction':_0xf912fe});});})[_0x6326('0x2d')](function(){_0x2a9f5c[_0x6326('0x8a')](function(_0x38d8c8){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':_0x38d8c8['id'],'VoicePrefixId':_0x5d4b0a['id']});});});});});}})[_0x6326('0x2d')](respondWithStatusCode(_0x4f45a6,null))[_0x6326('0x4f')](handleError(_0x4f45a6,null));};exports[_0x6326('0x8b')]=function(_0x43dc1e,_0x26ea69,_0x1a4b94){return db[_0x6326('0x82')][_0x6326('0x4d')]({'where':{'id':_0x43dc1e['query'][_0x6326('0x79')]},'attributes':['id'],'include':[{'model':db[_0x6326('0x7e')],'as':_0x6326('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x26ea69,null))['then'](function(_0x489226){var _0x5db6b3=_[_0x6326('0x34')](_0x489226,'id');var _0x5135df=[];var _0x4c15d2=[];var _0xd9c385=squel['select']();_0xd9c385['field'](_0x6326('0x8c'))['from'](_0x6326('0x8d'),'tq')[_0x6326('0x8e')](_0x6326('0x8f'),'ut',_0x6326('0x90'))[_0x6326('0x45')](_0x6326('0x91'),_0x43dc1e[_0x6326('0x51')]['id']);for(var _0x26391c=0x0;_0x26391c<_0x489226[_0x6326('0x40')];_0x26391c+=0x1){let _0x1adcbc=_0x489226[_0x26391c];for(var _0x46bece=0x0;_0x46bece<_0x1adcbc[_0x6326('0x84')][_0x6326('0x40')];_0x46bece+=0x1){let _0x30d31a=_0x1adcbc[_0x6326('0x84')][_0x46bece];var _0x3ec241=_0xd9c385[_0x6326('0x92')]();_0x3ec241[_0x6326('0x45')](_0x6326('0x93'),_0x30d31a['id']);_0x4c15d2[_0x6326('0x6c')](db['sequelize'][_0x6326('0x3b')](_0x3ec241[_0x6326('0x94')](),{'type':db[_0x6326('0x95')][_0x6326('0x96')][_0x6326('0x97')]})[_0x6326('0x2d')](function(_0x292657){if(_0x292657[_0x6326('0x40')]===0x1){return _0x30d31a['id'];}else{var _0x909cce=_[_0x6326('0x98')](_['map'](_0x292657,_0x6326('0x99')),function(_0x4b493a){return _[_0x6326('0x9a')](_0x5db6b3,_0x4b493a);});if(_0x909cce){return _0x30d31a['id'];}}}));}}return BPromise[_0x6326('0x9b')](_0x4c15d2)['then'](function(_0x2b98a4){_0x5135df=_(_0x5135df)[_0x6326('0x9c')](_0x2b98a4)['compact']()['value']();return db[_0x6326('0x35')]['find']({'where':{'id':_0x43dc1e[_0x6326('0x51')]['id']}})['then'](function(_0x4a470e){return db[_0x6326('0x95')][_0x6326('0x56')](function(_0x298a11){return _0x4a470e[_0x6326('0x8b')](_0x43dc1e[_0x6326('0x3b')][_0x6326('0x79')],{'transaction':_0x298a11})[_0x6326('0x2d')](function(){if(!_['isEmpty'](_0x5135df)){return _0x4a470e['removeAgents'](_0x5135df,{'transaction':_0x298a11});}})[_0x6326('0x2d')](function(){_0x5135df[_0x6326('0x8a')](function(_0x42d1db){socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':_0x42d1db,'VoicePrefixId':_0x4a470e['id']});});});});});});})['then'](respondWithStatusCode(_0x26ea69,null))[_0x6326('0x4f')](handleError(_0x26ea69,null));}; \ No newline at end of file +var _0x63a5=['merge','VIRTUAL','options','includeAll','include','VoicePrefix','findAll','rows','catch','show','params','rawAttributes','keys','find','describe','create','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','exten','app','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','charAt','system-','transaction','findById','addAgents','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x56fb80,_0x3d67de){var _0x17691b=function(_0x1bfd74){while(--_0x1bfd74){_0x56fb80['push'](_0x56fb80['shift']());}};_0x17691b(++_0x3d67de);}(_0x63a5,0x18e));var _0x563a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x63a5[_0x51020b];return _0x371e47;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];config[_0x563a('0x19')]=_[_0x563a('0x1a')](config[_0x563a('0x19')],{'host':_0x563a('0x1b'),'port':0x18eb});var socket=require(_0x563a('0x1c'))(new Redis(config[_0x563a('0x19')]));require('./voicePrefix.socket')[_0x563a('0x1d')](socket);function respondWithStatusCode(_0x3045ac,_0x8c3727){_0x8c3727=_0x8c3727||0xcc;return function(_0x26987f){if(_0x26987f){return _0x3045ac['sendStatus'](_0x8c3727);}return _0x3045ac['status'](_0x8c3727)[_0x563a('0x1e')]();};}function respondWithResult(_0x2ad667,_0x5b291f){_0x5b291f=_0x5b291f||0xc8;return function(_0x2ade24){if(_0x2ade24){return _0x2ad667[_0x563a('0x1f')](_0x5b291f)[_0x563a('0x20')](_0x2ade24);}};}function respondWithFilteredResult(_0x9c2f77,_0x4f947d){return function(_0x598693){if(_0x598693){var _0xe3d2bd=typeof _0x4f947d[_0x563a('0x21')]===_0x563a('0x22')&&typeof _0x4f947d['limit']==='undefined';var _0x52b99a=_0x598693['count'];var _0x40916a=_0xe3d2bd?0x0:_0x4f947d[_0x563a('0x21')];var _0x26061f=_0xe3d2bd?_0x598693[_0x563a('0x23')]:_0x4f947d['offset']+_0x4f947d['limit'];var _0x3930f0;if(_0x26061f>=_0x52b99a){_0x26061f=_0x52b99a;_0x3930f0=0xc8;}else{_0x3930f0=0xce;}_0x9c2f77[_0x563a('0x1f')](_0x3930f0);return _0x9c2f77[_0x563a('0x24')](_0x563a('0x25'),_0x40916a+'-'+_0x26061f+'/'+_0x52b99a)[_0x563a('0x20')](_0x598693);}return null;};}function patchUpdates(_0x2dc7e2){return function(_0x44b460){try{jsonpatch[_0x563a('0x26')](_0x44b460,_0x2dc7e2,!![]);}catch(_0x506491){return BPromise[_0x563a('0x27')](_0x506491);}return _0x44b460['save']();};}function saveUpdates(_0x44e2c1,_0xd3e0ae){return function(_0x3a36a4){if(_0x3a36a4){return _0x3a36a4[_0x563a('0x28')](_0x44e2c1)[_0x563a('0x29')](function(_0x1682ee){return _0x1682ee;});}return null;};}function removeEntity(_0x3642b3,_0x173990){return function(_0x4de4c3){if(_0x4de4c3){return _0x4de4c3[_0x563a('0x2a')]()[_0x563a('0x29')](function(){var _0x2311f2=_0x4de4c3[_0x563a('0x2b')]({'plain':!![]});var _0xce8165=_0x563a('0x2c');return db[_0x563a('0x2d')][_0x563a('0x2a')]({'where':{'type':_0xce8165,'resourceId':_0x2311f2['id']}})[_0x563a('0x29')](function(){return _0x4de4c3;});})[_0x563a('0x29')](function(){_0x3642b3[_0x563a('0x1f')](0xcc)[_0x563a('0x1e')]();});}};}function handleEntityNotFound(_0x1bdfb0,_0x7696c2){return function(_0x579cb5){if(!_0x579cb5){_0x1bdfb0[_0x563a('0x2e')](0x194);}return _0x579cb5;};}function handleError(_0x3c16d0,_0x2257e1){_0x2257e1=_0x2257e1||0x1f4;return function(_0x4aaa3d){logger[_0x563a('0x2f')](_0x4aaa3d[_0x563a('0x30')]);if(_0x4aaa3d[_0x563a('0x31')]){delete _0x4aaa3d[_0x563a('0x31')];}_0x3c16d0[_0x563a('0x1f')](_0x2257e1)[_0x563a('0x32')](_0x4aaa3d);};}exports[_0x563a('0x33')]=function(_0x4a2d28,_0x2418ae){var _0x24ec9d={},_0x4259f6={},_0x2ea6c2={'count':0x0,'rows':[]};var _0x1a77b8=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4e5c46){return{'name':_0x4e5c46[_0x563a('0x34')],'type':_0x4e5c46[_0x563a('0x35')][_0x563a('0x36')]};});_0x4259f6[_0x563a('0x37')]=_[_0x563a('0x38')](_0x1a77b8,_0x563a('0x31'));_0x4259f6['query']=_['keys'](_0x4a2d28[_0x563a('0x39')]);_0x4259f6[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],_0x4259f6[_0x563a('0x39')]);_0x24ec9d[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x4a2d28[_0x563a('0x39')][_0x563a('0x3d')]));_0x24ec9d[_0x563a('0x3c')]=_0x24ec9d[_0x563a('0x3c')][_0x563a('0x3e')]?_0x24ec9d[_0x563a('0x3c')]:_0x4259f6[_0x563a('0x37')];if(!_0x4a2d28['query'][_0x563a('0x3f')](_0x563a('0x40'))){_0x24ec9d[_0x563a('0x41')]=qs['limit'](_0x4a2d28[_0x563a('0x39')]['limit']);_0x24ec9d[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x4a2d28['query']['offset']);}_0x24ec9d[_0x563a('0x42')]=qs['sort'](_0x4a2d28[_0x563a('0x39')][_0x563a('0x43')]);_0x24ec9d[_0x563a('0x44')]=qs[_0x563a('0x3a')](_['pick'](_0x4a2d28['query'],_0x4259f6[_0x563a('0x3a')]),_0x1a77b8);if(_0x4a2d28['query'][_0x563a('0x45')]){_0x24ec9d[_0x563a('0x44')]=_[_0x563a('0x46')](_0x24ec9d[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x1a77b8,function(_0x38fab5){if(_0x38fab5[_0x563a('0x35')]!==_0x563a('0x47')){var _0x4c71df={};_0x4c71df[_0x38fab5[_0x563a('0x31')]]={'$like':'%'+_0x4a2d28['query'][_0x563a('0x45')]+'%'};return _0x4c71df;}})});}_0x24ec9d=_[_0x563a('0x46')]({},_0x24ec9d,_0x4a2d28[_0x563a('0x48')]);var _0x2d3800={'where':_0x24ec9d['where']};return db['VoicePrefix']['count'](_0x2d3800)[_0x563a('0x29')](function(_0x1255da){_0x2ea6c2[_0x563a('0x23')]=_0x1255da;if(_0x4a2d28[_0x563a('0x39')][_0x563a('0x49')]){_0x24ec9d[_0x563a('0x4a')]=[{'all':!![]}];}return db[_0x563a('0x4b')][_0x563a('0x4c')](_0x24ec9d);})[_0x563a('0x29')](function(_0x433353){_0x2ea6c2[_0x563a('0x4d')]=_0x433353;return _0x2ea6c2;})[_0x563a('0x29')](respondWithFilteredResult(_0x2418ae,_0x24ec9d))[_0x563a('0x4e')](handleError(_0x2418ae,null));};exports[_0x563a('0x4f')]=function(_0x144e15,_0x456d27){var _0x4643c4={'raw':![],'where':{'id':_0x144e15[_0x563a('0x50')]['id']}},_0x21bafb={};_0x21bafb['model']=_['keys'](db[_0x563a('0x4b')][_0x563a('0x51')]);_0x21bafb[_0x563a('0x39')]=_[_0x563a('0x52')](_0x144e15[_0x563a('0x39')]);_0x21bafb[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],_0x21bafb['query']);_0x4643c4['attributes']=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x144e15[_0x563a('0x39')][_0x563a('0x3d')]));_0x4643c4[_0x563a('0x3c')]=_0x4643c4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x4643c4['attributes']:_0x21bafb[_0x563a('0x37')];if(_0x144e15[_0x563a('0x39')]['includeAll']){_0x4643c4[_0x563a('0x4a')]=[{'all':!![]}];}_0x4643c4=_['merge']({},_0x4643c4,_0x144e15[_0x563a('0x48')]);return db[_0x563a('0x4b')][_0x563a('0x53')](_0x4643c4)['then'](handleEntityNotFound(_0x456d27,null))[_0x563a('0x29')](respondWithResult(_0x456d27,null))[_0x563a('0x4e')](handleError(_0x456d27,null));};exports[_0x563a('0x2a')]=function(_0x39c104,_0x6fe8a9){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x39c104[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x6fe8a9,null))[_0x563a('0x29')](removeEntity(_0x6fe8a9,null))[_0x563a('0x4e')](handleError(_0x6fe8a9,null));};exports[_0x563a('0x54')]=function(_0x406d4a,_0x497469){return db['VoicePrefix'][_0x563a('0x54')]()[_0x563a('0x29')](respondWithResult(_0x497469,null))[_0x563a('0x4e')](handleError(_0x497469,null));};exports['create']=function(_0x5ae08f,_0x13530f){var _0x1fc4d2;return db['sequelize']['transaction'](function(_0x51e142){return db[_0x563a('0x4b')][_0x563a('0x55')](_0x5ae08f[_0x563a('0x56')],{'transaction':_0x51e142})[_0x563a('0x29')](function(_0x8d3997){_0x1fc4d2=_0x8d3997[_0x563a('0x2b')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x1fc4d2[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x4453b2){return createVoicePrefixExtensions(_0x1fc4d2,_0x4453b2,_0x51e142);});});})[_0x563a('0x29')](function(){var _0x3e993e=_0x5ae08f[_0x563a('0x58')][_0x563a('0x2b')]({'plain':!![]});if(!_0x3e993e)throw new Error(_0x563a('0x59'));if(_0x3e993e[_0x563a('0x5a')]==='user'){var _0x22cc91=_0x1fc4d2;return db[_0x563a('0x5b')]['find']({'where':{'name':_0x563a('0x2c'),'userProfileId':_0x3e993e[_0x563a('0x5c')]},'raw':!![]})[_0x563a('0x29')](function(_0x2afa8c){if(_0x2afa8c&&_0x2afa8c[_0x563a('0x5d')]===0x0){return db[_0x563a('0x2d')][_0x563a('0x55')]({'name':_0x22cc91[_0x563a('0x31')],'resourceId':_0x22cc91['id'],'type':_0x2afa8c[_0x563a('0x31')],'sectionId':_0x2afa8c['id']},{})[_0x563a('0x29')](function(){return _0x1fc4d2;});}else{return _0x1fc4d2;}})['catch'](function(_0x1926f1){logger[_0x563a('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1926f1);throw _0x1926f1;});}return _0x1fc4d2;})['then'](respondWithResult(_0x13530f,null))[_0x563a('0x4e')](handleError(_0x13530f,null));};function Extension(_0x709bfd,_0x579d61,_0x19edc3,_0x59e371){this[_0x563a('0x5e')]=_0x563a('0x5f');this[_0x563a('0x60')]=_0x709bfd;this[_0x563a('0x61')]=_0x19edc3;this[_0x563a('0x35')]='system';this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x579d61;this[_0x563a('0x62')]=_0x59e371;}function createVoicePrefixExtensions(_0x5141d5,_0x111444,_0x496b6a){return new BPromise(function(_0x2a82cf,_0x3f2750){var _0xbe3343=new Extension(formatPrefixName(_0x5141d5[_0x563a('0x63')]),0x1,_0x563a('0x64'),'Voice\x20Prefix');_0xbe3343[_0x563a('0x65')]=_0x5141d5['id'];return db['VoiceExtension']['create'](_0xbe3343,{'transaction':_0x496b6a})[_0x563a('0x29')](function(_0x3b7993){var _0x409f3c=_0x3b7993[_0x563a('0x2b')]({'plain':!![]});var _0x1c8ad7=_['map'](addVoicePrefixExtensions(_0x5141d5,_0x111444),function(_0x10eb03){_0x10eb03[_0x563a('0x57')]=_0x409f3c['id'];_0x10eb03[_0x563a('0x65')]=_0x5141d5['id'];return _0x10eb03;});return db[_0x563a('0x66')][_0x563a('0x67')](_0x1c8ad7,{'transaction':_0x496b6a})['then'](function(_0xac578c){if(!_0xac578c){return _0x3f2750('Extensions\x20creation\x20failed');}else{return _0x2a82cf(_0xac578c);}})[_0x563a('0x4e')](function(_0x201c9d){return _0x3f2750(_0x201c9d);});});;});};function addVoicePrefixExtensions(_0x47d6cd,_0x34dd59){var _0x30bf2b=[];var _0x18a26b=formatPrefixName(_0x47d6cd[_0x563a('0x63')]);_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x2,_0x563a('0x69'),_0x563a('0x6a')+_0x47d6cd[_0x563a('0x31')]));if(_0x47d6cd['callerIdAll']){_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x69'),_0x563a('0x6b')+_0x47d6cd[_0x563a('0x6c')]));}else{_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x64'),_0x563a('0x6d')));}_0x30bf2b['push'](new Extension(_0x18a26b,0x4,_0x563a('0x6e'),_0x34dd59['context']+','+'${EXTEN:'+(0x8+_0x47d6cd['name'][_0x563a('0x3e')])+'}'+','+0x1));return _0x30bf2b;}function formatPrefixName(_0x4e4e60){var _0x529587='_';for(var _0x30d775=0x0;_0x30d775<_0x4e4e60[_0x563a('0x3e')];_0x30d775++){if(_0x4e4e60[_0x563a('0x6f')](_0x30d775)=='-'){_0x529587+=_0x4e4e60[_0x563a('0x6f')](_0x30d775);}else{_0x529587+='['+_0x4e4e60[_0x563a('0x6f')](_0x30d775)+']';}}_0x529587+='.';return _0x529587;}exports['update']=function(_0x4814b3,_0x4c9ad7,_0x39b8f8){var _0x8b2e10=_0x4814b3[_0x563a('0x56')];_0x8b2e10[_0x563a('0x63')]=_0x563a('0x70')+_0x8b2e10[_0x563a('0x31')]+'-';return db['sequelize'][_0x563a('0x71')](function(_0x43b2f1){return db['VoicePrefix'][_0x563a('0x28')](_0x8b2e10,{'where':{'id':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')]['destroy']({'where':{'VoicePrefixId':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')][_0x563a('0x53')]({'where':{'id':_0x8b2e10[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x229690){return createVoicePrefixExtensions(_0x8b2e10,_0x229690,_0x43b2f1);});});});})[_0x563a('0x29')](function(){return db[_0x563a('0x4b')][_0x563a('0x72')](_0x8b2e10['id']);})[_0x563a('0x29')](respondWithResult(_0x4c9ad7,null))['catch'](handleError(_0x4c9ad7,null));};exports['addAgents']=function(_0x4346fe,_0x598a91,_0x46beba){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x4346fe[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x598a91,null))[_0x563a('0x29')](function(_0x3f66be){if(_0x3f66be){return _0x3f66be[_0x563a('0x73')](_0x4346fe[_0x563a('0x56')][_0x563a('0x74')],_['omit'](_0x4346fe[_0x563a('0x56')],['ids','id'])||{})[_0x563a('0x75')](function(_0x441933){for(var _0x54c512=0x0;_0x54c512<_0x4346fe[_0x563a('0x56')]['ids'][_0x563a('0x3e')];_0x54c512+=0x1){socket[_0x563a('0x76')]('userVoicePrefix:save',{'UserId':Number(_0x4346fe[_0x563a('0x56')][_0x563a('0x74')][_0x54c512]),'VoicePrefixId':Number(_0x4346fe[_0x563a('0x50')]['id'])});}return _0x441933;});}})[_0x563a('0x29')](respondWithResult(_0x598a91,null))['catch'](handleError(_0x598a91,null));};exports[_0x563a('0x77')]=function(_0x31faef,_0x17000b,_0x3cdfc1){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x31faef[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x17000b,null))[_0x563a('0x29')](function(_0x238ae4){if(_0x238ae4){return _0x238ae4['removeAgents'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])[_0x563a('0x29')](function(){if(_['isArray'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])){for(var _0x3dc800=0x0;_0x3dc800<_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x563a('0x3e')];_0x3dc800+=0x1){socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x3dc800]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}}else{socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef['query'][_0x563a('0x74')]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x17000b,null))[_0x563a('0x4e')](handleError(_0x17000b,null));};exports[_0x563a('0x79')]=function(_0x1ecca5,_0x162ab6,_0xf3ed04){var _0x44cbb4={};var _0x3a00b8={};var _0x9b753b;var _0x41898f;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x1ecca5[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x162ab6,null))[_0x563a('0x29')](function(_0x4c5547){if(_0x4c5547){_0x9b753b=_0x4c5547;_0x3a00b8['model']=_['keys'](db[_0x563a('0x7b')][_0x563a('0x51')]);_0x3a00b8[_0x563a('0x39')]=_[_0x563a('0x52')](_0x1ecca5[_0x563a('0x39')]);_0x3a00b8[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x3a00b8[_0x563a('0x37')],_0x3a00b8[_0x563a('0x39')]);_0x44cbb4[_0x563a('0x3c')]=_['intersection'](_0x3a00b8[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x3d')]));_0x44cbb4[_0x563a('0x3c')]=_0x44cbb4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x44cbb4[_0x563a('0x3c')]:_0x3a00b8[_0x563a('0x37')];_0x44cbb4[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x43')]);_0x44cbb4['where']=qs[_0x563a('0x3a')](_[_0x563a('0x7c')](_0x1ecca5[_0x563a('0x39')],_0x3a00b8[_0x563a('0x3a')]));if(_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]){_0x44cbb4[_0x563a('0x44')]=_['merge'](_0x44cbb4[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x44cbb4[_0x563a('0x3c')],function(_0x562120){var _0x1e3b8c={};_0x1e3b8c[_0x562120]={'$like':'%'+_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]+'%'};return _0x1e3b8c;})});}_0x44cbb4=_[_0x563a('0x46')]({},_0x44cbb4,_0x1ecca5[_0x563a('0x48')]);return _0x9b753b[_0x563a('0x79')](_0x44cbb4);}})['then'](function(_0x2d46f5){if(_0x2d46f5){_0x41898f=_0x2d46f5[_0x563a('0x3e')];if(!_0x1ecca5[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x44cbb4['limit']=qs[_0x563a('0x41')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x41')]);_0x44cbb4[_0x563a('0x21')]=qs['offset'](_0x1ecca5[_0x563a('0x39')][_0x563a('0x21')]);}return _0x9b753b['getAgents'](_0x44cbb4);}})['then'](function(_0x458a21){if(_0x458a21){return _0x458a21?{'count':_0x41898f,'rows':_0x458a21}:null;}})[_0x563a('0x29')](respondWithResult(_0x162ab6,null))[_0x563a('0x4e')](handleError(_0x162ab6,null));};exports[_0x563a('0x7d')]=function(_0x241361,_0x31a58e,_0x1e324a){var _0x38857b={};var _0x43b6a2={};var _0x2385eb;var _0x36fe22;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x241361[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x31a58e,null))['then'](function(_0x1dc77d){if(_0x1dc77d){_0x2385eb=_0x1dc77d;_0x43b6a2[_0x563a('0x37')]=_['keys'](db[_0x563a('0x7e')][_0x563a('0x51')]);_0x43b6a2[_0x563a('0x39')]=_[_0x563a('0x52')](_0x241361[_0x563a('0x39')]);_0x43b6a2[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],_0x43b6a2['query']);_0x38857b[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x241361[_0x563a('0x39')]['fields']));_0x38857b[_0x563a('0x3c')]=_0x38857b['attributes']['length']?_0x38857b[_0x563a('0x3c')]:_0x43b6a2[_0x563a('0x37')];_0x38857b[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x241361['query'][_0x563a('0x43')]);_0x38857b[_0x563a('0x44')]=qs['filters'](_[_0x563a('0x7c')](_0x241361['query'],_0x43b6a2[_0x563a('0x3a')]));if(_0x241361[_0x563a('0x39')][_0x563a('0x45')]){_0x38857b[_0x563a('0x44')]=_[_0x563a('0x46')](_0x38857b[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x38857b[_0x563a('0x3c')],function(_0x372e43){var _0x484953={};_0x484953[_0x372e43]={'$like':'%'+_0x241361[_0x563a('0x39')]['filter']+'%'};return _0x484953;})});}_0x38857b=_['merge']({},_0x38857b,_0x241361[_0x563a('0x48')]);return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x44859c){if(_0x44859c){_0x36fe22=_0x44859c[_0x563a('0x3e')];if(!_0x241361[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x38857b[_0x563a('0x41')]=qs[_0x563a('0x41')](_0x241361[_0x563a('0x39')]['limit']);_0x38857b[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x241361['query'][_0x563a('0x21')]);}return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x38601a){if(_0x38601a){return _0x38601a?{'count':_0x36fe22,'rows':_0x38601a}:null;}})[_0x563a('0x29')](respondWithResult(_0x31a58e,null))[_0x563a('0x4e')](handleError(_0x31a58e,null));};exports['addTeams']=function(_0x10c81e,_0x4928de,_0x95bb77){var _0x33d74b=_0x10c81e[_0x563a('0x56')]['ids'];var _0x2d9810;return db['Team'][_0x563a('0x4c')]({'where':{'id':_0x33d74b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x563a('0x7f'),'attributes':['id',_0x563a('0x31'),_0x563a('0x80'),_0x563a('0x81'),_0x563a('0x82')],'raw':!![]}]})[_0x563a('0x29')](function(_0x2d2cb9){if(_0x2d2cb9){_0x2d9810=_0x2d2cb9;var _0x2c4b52=_[_0x563a('0x83')](_0x2d2cb9,function(_0x5c8df5){var _0x579601=_0x5c8df5[_0x563a('0x2b')]({'plain':!![]});return _0x579601[_0x563a('0x7f')];});return db['VoicePrefix'][_0x563a('0x53')]({'where':{'id':_0x10c81e[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x1ebdd0){return db[_0x563a('0x84')][_0x563a('0x71')](function(_0x2a3bdd){return _0x1ebdd0['addTeams'](_0x33d74b,{'transaction':_0x2a3bdd})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2d9810,function(_0x28bbe5){return db[_0x563a('0x86')]['upsert']({'TeamId':_0x28bbe5['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},{'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2c4b52,function(_0x150fd6){return db[_0x563a('0x87')][_0x563a('0x88')]({'where':{'UserId':_0x150fd6['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){_0x2c4b52[_0x563a('0x89')](function(_0x3f78b7){socket[_0x563a('0x76')](_0x563a('0x8a'),{'UserId':_0x3f78b7['id'],'VoicePrefixId':_0x1ebdd0['id']});});});});});}})[_0x563a('0x29')](respondWithStatusCode(_0x4928de,null))[_0x563a('0x4e')](handleError(_0x4928de,null));};exports[_0x563a('0x8b')]=function(_0x115188,_0x713637,_0x12bb1b){return db[_0x563a('0x7e')][_0x563a('0x4c')]({'where':{'id':_0x115188[_0x563a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x563a('0x7b')],'as':_0x563a('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x563a('0x29')](handleEntityNotFound(_0x713637,null))[_0x563a('0x29')](function(_0xb9cbc9){var _0x42831f=_[_0x563a('0x38')](_0xb9cbc9,'id');var _0x5385e0=[];var _0x1d0ed4=[];var _0x14bc9e=squel[_0x563a('0x8c')]();_0x14bc9e[_0x563a('0x8d')](_0x563a('0x8e'))['from'](_0x563a('0x8f'),'tq')['join'](_0x563a('0x90'),'ut',_0x563a('0x91'))[_0x563a('0x44')]('VoicePrefixId\x20=\x20?',_0x115188[_0x563a('0x50')]['id']);for(var _0x25e5d1=0x0;_0x25e5d1<_0xb9cbc9[_0x563a('0x3e')];_0x25e5d1+=0x1){let _0x5ba698=_0xb9cbc9[_0x25e5d1];for(var _0x2dadc1=0x0;_0x2dadc1<_0x5ba698[_0x563a('0x7f')]['length'];_0x2dadc1+=0x1){let _0x55f64e=_0x5ba698[_0x563a('0x7f')][_0x2dadc1];var _0x41d0df=_0x14bc9e['clone']();_0x41d0df['where'](_0x563a('0x92'),_0x55f64e['id']);_0x1d0ed4['push'](db[_0x563a('0x84')][_0x563a('0x39')](_0x41d0df[_0x563a('0x93')](),{'type':db[_0x563a('0x84')][_0x563a('0x94')][_0x563a('0x95')]})[_0x563a('0x29')](function(_0xc24817){if(_0xc24817[_0x563a('0x3e')]===0x1){return _0x55f64e['id'];}else{var _0xd04cd=_[_0x563a('0x96')](_['map'](_0xc24817,'TeamId'),function(_0x571a84){return _[_0x563a('0x97')](_0x42831f,_0x571a84);});if(_0xd04cd){return _0x55f64e['id'];}}}));}}return BPromise[_0x563a('0x98')](_0x1d0ed4)[_0x563a('0x29')](function(_0x5244e5){_0x5385e0=_(_0x5385e0)['union'](_0x5244e5)[_0x563a('0x99')]()[_0x563a('0x9a')]();return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x115188[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x23e33f){return db['sequelize'][_0x563a('0x71')](function(_0x25049d){return _0x23e33f[_0x563a('0x8b')](_0x115188[_0x563a('0x39')][_0x563a('0x74')],{'transaction':_0x25049d})[_0x563a('0x29')](function(){if(!_[_0x563a('0x9b')](_0x5385e0)){return _0x23e33f[_0x563a('0x77')](_0x5385e0,{'transaction':_0x25049d});}})[_0x563a('0x29')](function(){_0x5385e0[_0x563a('0x89')](function(_0x482d21){socket[_0x563a('0x76')]('userVoicePrefix:remove',{'UserId':_0x482d21,'VoicePrefixId':_0x23e33f['id']});});});});});});})[_0x563a('0x29')](respondWithStatusCode(_0x713637,null))[_0x563a('0x4e')](handleError(_0x713637,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index d1aa9e8..768e128 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 _0xd744=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5a51c1,_0x394c67){var _0x38f5fb=function(_0xa5d3d0){while(--_0xa5d3d0){_0x5a51c1['push'](_0x5a51c1['shift']());}};_0x38f5fb(++_0x394c67);}(_0xd744,0x1da));var _0x4d74=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd744[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x4d74('0x0'));var VoicePrefix=require(_0x4d74('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4d74('0x2')](0x0);var events={'afterCreate':_0x4d74('0x3'),'afterUpdate':_0x4d74('0x4'),'afterDestroy':_0x4d74('0x5')};function emitEvent(_0x2da50f){return function(_0x4edd3c,_0x1e0ab8,_0x139e14){VoicePrefixEvents[_0x4d74('0x6')](_0x2da50f+':'+_0x4edd3c['id'],_0x4edd3c);VoicePrefixEvents[_0x4d74('0x6')](_0x2da50f,_0x4edd3c);_0x139e14(null);};}for(var e in events){if(events[_0x4d74('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x4d74('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xea34=['VoicePrefix','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x42e750,_0x261350){var _0x43ef6c=function(_0x1ad725){while(--_0x1ad725){_0x42e750['push'](_0x42e750['shift']());}};_0x43ef6c(++_0x261350);}(_0xea34,0x139));var _0x4ea3=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xea34[_0xaa6a4];return _0xdc31a4;};'use strict';var EventEmitter=require(_0x4ea3('0x0'));var VoicePrefix=require(_0x4ea3('0x1'))['db'][_0x4ea3('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4ea3('0x3'),'afterDestroy':_0x4ea3('0x4')};function emitEvent(_0x1f8ba1){return function(_0x2be81f,_0x4fb701,_0x34aa69){VoicePrefixEvents[_0x4ea3('0x5')](_0x1f8ba1+':'+_0x2be81f['id'],_0x2be81f);VoicePrefixEvents['emit'](_0x1f8ba1,_0x2be81f);_0x34aa69(null);};}for(var e in events){if(events[_0x4ea3('0x6')](e)){var event=events[e];VoicePrefix[_0x4ea3('0x7')](e,emitEvent(event));}}module[_0x4ea3('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 740e452..691f100 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 _0x2299=['rimraf','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a589,_0x12dafc){var _0x7a0a2=function(_0x1f5bdf){while(--_0x1f5bdf){_0x5a589['push'](_0x5a589['shift']());}};_0x7a0a2(++_0x12dafc);}(_0x2299,0x9f));var _0x9229=function(_0x4a3dba,_0x535fd5){_0x4a3dba=_0x4a3dba-0x0;var _0x20ae69=_0x2299[_0x4a3dba];return _0x20ae69;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9229('0x0'))(_0x9229('0x1'));var moment=require(_0x9229('0x2'));var BPromise=require(_0x9229('0x3'));var rp=require(_0x9229('0x4'));var fs=require('fs');var path=require(_0x9229('0x5'));var rimraf=require(_0x9229('0x6'));var config=require('../../config/environment');var attributes=require(_0x9229('0x7'));module['exports']=function(_0x3e0b45,_0x5b2076){return _0x3e0b45[_0x9229('0x8')](_0x9229('0x9'),attributes,{'tableName':_0x9229('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53e4=['bluebird','path','../../config/environment','./voicePrefix.attributes','exports','voice_prefixes','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53e4,0x13e));var _0x453e=function(_0x3e9b06,_0x417393){_0x3e9b06=_0x3e9b06-0x0;var _0x442af8=_0x53e4[_0x3e9b06];return _0x442af8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x453e('0x0'));var moment=require(_0x453e('0x1'));var BPromise=require(_0x453e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x453e('0x3'));var rimraf=require('rimraf');var config=require(_0x453e('0x4'));var attributes=require(_0x453e('0x5'));module[_0x453e('0x6')]=function(_0x1e4326,_0x421977){return _0x1e4326['define']('VoicePrefix',attributes,{'tableName':_0x453e('0x7'),'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 99e7c76..0aa7ec4 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 _0xc17d=['redis','./voicePrefix.socket','register','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','VoicePrefix,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults'];(function(_0x172470,_0x13d752){var _0x1378f8=function(_0x5e44cd){while(--_0x5e44cd){_0x172470['push'](_0x172470['shift']());}};_0x1378f8(++_0x13d752);}(_0xc17d,0x96));var _0xdc17=function(_0x11fba6,_0x2cbd16){_0x11fba6=_0x11fba6-0x0;var _0x413cea=_0xc17d[_0x11fba6];return _0x413cea;};'use strict';var _=require(_0xdc17('0x0'));var util=require(_0xdc17('0x1'));var moment=require(_0xdc17('0x2'));var BPromise=require(_0xdc17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc17('0x4'));var db=require(_0xdc17('0x5'))['db'];var utils=require(_0xdc17('0x6'));var logger=require(_0xdc17('0x7'))('rpc');var config=require(_0xdc17('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc17('0x9')]({'port':0x232a});config['redis']=_[_0xdc17('0xa')](config[_0xdc17('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc17('0xb')]));require(_0xdc17('0xc'))[_0xdc17('0xd')](socket);function respondWithRpcPromise(_0x390f83,_0x4de837,_0x25c33f){return new BPromise(function(_0x300874,_0x33340c){return client['request'](_0x390f83,_0x25c33f)[_0xdc17('0xe')](function(_0x40208b){logger[_0xdc17('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x4de837,_0xdc17('0x10'));logger['debug'](_0xdc17('0x11'),_0x4de837,_0xdc17('0x10'),JSON['stringify'](_0x40208b));if(_0x40208b[_0xdc17('0x12')]){if(_0x40208b[_0xdc17('0x12')]['code']===0x1f4){logger[_0xdc17('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x4de837,_0x40208b[_0xdc17('0x12')][_0xdc17('0x13')]);return _0x33340c(_0x40208b['error'][_0xdc17('0x13')]);}logger[_0xdc17('0x12')](_0xdc17('0x14'),_0x4de837,_0x40208b[_0xdc17('0x12')][_0xdc17('0x13')]);return _0x300874(_0x40208b[_0xdc17('0x12')]['message']);}else{logger[_0xdc17('0xf')](_0xdc17('0x14'),_0x4de837,_0xdc17('0x10'));_0x300874(_0x40208b[_0xdc17('0x15')][_0xdc17('0x13')]);}})[_0xdc17('0x16')](function(_0x5802d4){logger[_0xdc17('0x12')](_0xdc17('0x14'),_0x4de837,_0x5802d4);_0x33340c(_0x5802d4);});});} \ No newline at end of file +var _0x1a38=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1a38,0xb0));var _0x81a3=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0x1a38[_0xe6e78c];return _0x2a09c8;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81a3('0x3'))['db'];var utils=require(_0x81a3('0x4'));var logger=require(_0x81a3('0x5'))(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var jayson=require(_0x81a3('0x8'));var client=jayson[_0x81a3('0x9')][_0x81a3('0xa')]({'port':0x232a});config[_0x81a3('0xb')]=_[_0x81a3('0xc')](config[_0x81a3('0xb')],{'host':_0x81a3('0xd'),'port':0x18eb});var socket=require(_0x81a3('0xe'))(new Redis(config['redis']));require(_0x81a3('0xf'))[_0x81a3('0x10')](socket);function respondWithRpcPromise(_0x3ece9a,_0x10f4c5,_0x3fd4fe){return new BPromise(function(_0x4a7f3a,_0xeef25e){return client[_0x81a3('0x11')](_0x3ece9a,_0x3fd4fe)[_0x81a3('0x12')](function(_0x516492){logger['info'](_0x81a3('0x13'),_0x10f4c5,_0x81a3('0x14'));logger[_0x81a3('0x15')](_0x81a3('0x16'),_0x10f4c5,_0x81a3('0x14'),JSON[_0x81a3('0x17')](_0x516492));if(_0x516492[_0x81a3('0x18')]){if(_0x516492[_0x81a3('0x18')][_0x81a3('0x19')]===0x1f4){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492[_0x81a3('0x18')]['message']);return _0xeef25e(_0x516492[_0x81a3('0x18')][_0x81a3('0x1a')]);}logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492['error'][_0x81a3('0x1a')]);return _0x4a7f3a(_0x516492[_0x81a3('0x18')]['message']);}else{logger[_0x81a3('0x1b')]('VoicePrefix,\x20%s,\x20%s',_0x10f4c5,'request\x20sent');_0x4a7f3a(_0x516492[_0x81a3('0x1c')][_0x81a3('0x1a')]);}})[_0x81a3('0x1d')](function(_0x18c316){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x18c316);_0xeef25e(_0x18c316);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d7200c3..5d583c1 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 _0x6ea9=['update','emit','removeListener','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x364040,_0x2661d5){var _0x4328dc=function(_0x29a477){while(--_0x29a477){_0x364040['push'](_0x364040['shift']());}};_0x4328dc(++_0x2661d5);}(_0x6ea9,0x89));var _0x96ea=function(_0x24550d,_0x41c8d8){_0x24550d=_0x24550d-0x0;var _0x54cb91=_0x6ea9[_0x24550d];return _0x54cb91;};'use strict';var VoicePrefixEvents=require(_0x96ea('0x0'));var events=[_0x96ea('0x1'),_0x96ea('0x2'),_0x96ea('0x3')];function createListener(_0x119bb1,_0x4cb27d){return function(_0x1fb6c1){_0x4cb27d[_0x96ea('0x4')](_0x119bb1,_0x1fb6c1);};}function removeListener(_0x2d4d41,_0x4de4d5){return function(){VoicePrefixEvents[_0x96ea('0x5')](_0x2d4d41,_0x4de4d5);};}exports['register']=function(_0x32cf31){for(var _0x54e1b1=0x0,_0x124a0d=events['length'];_0x54e1b1<_0x124a0d;_0x54e1b1++){var _0x5cd8f3=events[_0x54e1b1];var _0x1504a9=createListener(_0x96ea('0x6')+_0x5cd8f3,_0x32cf31);VoicePrefixEvents['on'](_0x5cd8f3,_0x1504a9);}}; \ No newline at end of file +var _0x570f=['register','length','./voicePrefix.events','save','remove','emit','removeListener'];(function(_0x40e114,_0x278b52){var _0x2e9542=function(_0x36b70){while(--_0x36b70){_0x40e114['push'](_0x40e114['shift']());}};_0x2e9542(++_0x278b52);}(_0x570f,0x152));var _0xf570=function(_0x22893c,_0x2d1ab9){_0x22893c=_0x22893c-0x0;var _0x58dc82=_0x570f[_0x22893c];return _0x58dc82;};'use strict';var VoicePrefixEvents=require(_0xf570('0x0'));var events=[_0xf570('0x1'),_0xf570('0x2'),'update'];function createListener(_0x49c496,_0x1904b3){return function(_0x3f4fef){_0x1904b3[_0xf570('0x3')](_0x49c496,_0x3f4fef);};}function removeListener(_0x22c270,_0x140bb4){return function(){VoicePrefixEvents[_0xf570('0x4')](_0x22c270,_0x140bb4);};}exports[_0xf570('0x5')]=function(_0x5ce063){for(var _0x2ec4ba=0x0,_0x47c534=events[_0xf570('0x6')];_0x2ec4ba<_0x47c534;_0x2ec4ba++){var _0x5910a8=events[_0x2ec4ba];var _0x2575c0=createListener('voicePrefix:'+_0x5910a8,_0x5ce063);VoicePrefixEvents['on'](_0x5910a8,_0x2575c0);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index e5c6d27..2e5579f 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(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb10b,0x12a));var _0xbb10=function(_0x18b56f,_0x2d8823){_0x18b56f=_0x18b56f-0x0;var _0x4df0e0=_0xb10b[_0x18b56f];return _0x4df0e0;};'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(_0x464eb8,_0x581b99){var _0x4f3483=function(_0x41f74b){while(--_0x41f74b){_0x464eb8['push'](_0x464eb8['shift']());}};_0x4f3483(++_0x581b99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 9b6022a..4069bda 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 _0xc8a2=['rrordered','setDataValue','strategy','getDataValue','booked','roundrobin','progressive','power','INTEGER','yes','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\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)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','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','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom'];(function(_0xd9fc84,_0xfbefba){var _0x4562f6=function(_0x1659e5){while(--_0x1659e5){_0xd9fc84['push'](_0xd9fc84['shift']());}};_0x4562f6(++_0xfbefba);}(_0xc8a2,0x197));var _0x2c8a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc8a2[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0x2c8a('0x0')]={'name':{'type':Sequelize[_0x2c8a('0x1')],'allowNull':![],'unique':_0x2c8a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x4'),_0x2c8a('0x5')),'allowNull':![],'defaultValue':_0x2c8a('0x4')},'musiconhold':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':_0x2c8a('0x6')},'announce':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x2c8a('0x3')]('rr',_0x2c8a('0x7'),_0x2c8a('0x8'),_0x2c8a('0x9'),_0x2c8a('0xa'),_0x2c8a('0xb'),'linear',_0x2c8a('0xc'),_0x2c8a('0xd')),'allowNull':![],'defaultValue':_0x2c8a('0x7'),'set':function(_0xbedf8d){this[_0x2c8a('0xe')](_0x2c8a('0xf'),_0xbedf8d?_0xbedf8d:_0x2c8a('0xb'));},'get':function(){var _0x5664e6=this[_0x2c8a('0x10')]('type');var _0x37ad58=this['getDataValue']('dialMethod');var _0x45b7b0=this[_0x2c8a('0x10')](_0x2c8a('0xf'));if(_0x5664e6===_0x2c8a('0x4')){return _0x45b7b0;}if(_0x37ad58==='booked'&&_0x45b7b0===_0x2c8a('0xb')||_0x37ad58===_0x2c8a('0x11')&&_0x45b7b0===_0x2c8a('0x12')){return _0x45b7b0;}if(_0x37ad58===_0x2c8a('0x13')||_0x37ad58==='predictive'||_0x37ad58===_0x2c8a('0x14')){return _0x45b7b0;}return null;}},'servicelevel':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2c8a('0x15')](0xb)},'timeout':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2c8a('0x1')]},'weight':{'type':Sequelize[_0x2c8a('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no'),'defaultValue':_0x2c8a('0x16')},'autopause':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2c8a('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x2c8a('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x2c8a('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x2c8a('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x2c8a('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2c8a('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2c8a('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2c8a('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x2c8a('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2c8a('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2c8a('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2c8a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x2c8a('0x1')]},'queue_quantity2':{'type':Sequelize[_0x2c8a('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x2c8a('0x1')]},'queue_less_than':{'type':Sequelize[_0x2c8a('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x97a1ee){this[_0x2c8a('0xe')](_0x2c8a('0x17'),_0x97a1ee?_0x97a1ee[_0x2c8a('0x18')](','):[]);},'get':function(){return this[_0x2c8a('0x10')](_0x2c8a('0x17'))?this['getDataValue'](_0x2c8a('0x17'))[_0x2c8a('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':_0x2c8a('0x16'),'set':function(_0x154e9d){this[_0x2c8a('0xe')]('joinempty',_0x154e9d?_0x154e9d[_0x2c8a('0x18')](','):undefined);},'get':function(){return this[_0x2c8a('0x10')](_0x2c8a('0x1a'))?this['getDataValue'](_0x2c8a('0x1a'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':'no','set':function(_0x1c5783){this[_0x2c8a('0xe')](_0x2c8a('0x1b'),_0x1c5783?_0x1c5783['join'](','):undefined);},'get':function(){return this[_0x2c8a('0x10')](_0x2c8a('0x1b'))?this[_0x2c8a('0x10')](_0x2c8a('0x1b'))[_0x2c8a('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x2c8a('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':0x0,'set':function(_0x3bfd43){this[_0x2c8a('0xe')]('acw',_0x3bfd43);if(_0x3bfd43){if(this['getDataValue']('wrapuptime')<0x2){this[_0x2c8a('0xe')](_0x2c8a('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2c8a('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':0x0,'comment':_0x2c8a('0x1e')},'dialMethod':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x1f'),_0x2c8a('0x13'),_0x2c8a('0x14'),'predictive','booked'),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x2c8a('0x15')](0x4)[_0x2c8a('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2c8a('0x21')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x2c8a('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x2c8a('0x22')](0x2)[_0x2c8a('0x20')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2c8a('0x23')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x2c8a('0x24'),_0x2c8a('0x25')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x2c8a('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2c8a('0x26')},'dialPredictiveInterval':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2c8a('0x27')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2c8a('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x2c8a('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c8a('0x28')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x2c8a('0x29'),'comment':_0x2c8a('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c8a('0x2b')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x2c8a('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2c8a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c8a('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2c8a('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c8a('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c8a('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2c8a('0x15')](0x5)[_0x2c8a('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c8a('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2c8a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2c8a('0x15')](0x5)[_0x2c8a('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c8a('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2c8a('0x32')},'dialPrefix':{'type':Sequelize[_0x2c8a('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2c8a('0x3')](_0x2c8a('0x33'),_0x2c8a('0x34'),'onlyIfOpen'),'defaultValue':_0x2c8a('0x33')},'dialAMDActive':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x2c8a('0x15')](0x9)[_0x2c8a('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x2c8a('0x15')](0x9)[_0x2c8a('0x20')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2c8a('0x15')](0x9)[_0x2c8a('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2c8a('0x35')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2c8a('0x36')},'dialAMDMinWordLength':{'type':Sequelize[_0x2c8a('0x15')](0x9)[_0x2c8a('0x20')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x2c8a('0x20')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2c8a('0x37')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2c8a('0x15')](0x5)[_0x2c8a('0x20')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2c8a('0x38')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2c8a('0x15')](0x9)[_0x2c8a('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2c8a('0x39')},'dialRecallMeTimeout':{'type':Sequelize[_0x2c8a('0x15')](0x5)[_0x2c8a('0x20')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2c8a('0x3a')},'dialRecallInQueue':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':0x0,'comment':_0x2c8a('0x3b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2c8a('0x3')]('DESC',_0x2c8a('0x3c')),'defaultValue':_0x2c8a('0x3d')},'dialQueueProject2':{'type':Sequelize[_0x2c8a('0x1')],'comment':_0x2c8a('0x2c')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x2c8a('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2c8a('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2c8a('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c8a('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2c8a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x2c8a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2c8a('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c8a('0x40')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2c8a('0x15')](0x5)[_0x2c8a('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2c8a('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2c8a('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c8a('0x41')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2c8a('0x15')](0x5)[_0x2c8a('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c8a('0x42')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2c8a('0x15')],'allowNull':!![],'comment':_0x2c8a('0x43')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x23b684){if(!_0x23b684)this['setDataValue'](_0x2c8a('0x44'),null);this[_0x2c8a('0xe')](_0x2c8a('0x45'),_0x23b684);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2c8a('0x15')](0x3)[_0x2c8a('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x2c8a('0x20')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x2c8a('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0x4ac6=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','rrmemory','linear','rrordered','ringall','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','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).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x4ac6,0xba));var _0x64ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ac6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x64ac('0x0'));module[_0x64ac('0x1')]={'name':{'type':Sequelize[_0x64ac('0x2')],'allowNull':![],'unique':_0x64ac('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x5'),_0x64ac('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':_0x64ac('0x7')},'announce':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x64ac('0x4')]('rr','ringall',_0x64ac('0x8'),_0x64ac('0x9'),'random',_0x64ac('0xa'),_0x64ac('0xb'),'wrandom',_0x64ac('0xc')),'allowNull':![],'defaultValue':_0x64ac('0xd'),'set':function(_0x3d3b65){this[_0x64ac('0xe')]('strategy',_0x3d3b65?_0x3d3b65:_0x64ac('0xa'));},'get':function(){var _0x245208=this[_0x64ac('0xf')](_0x64ac('0x10'));var _0xd69966=this[_0x64ac('0xf')](_0x64ac('0x11'));var _0x3cda85=this[_0x64ac('0xf')](_0x64ac('0x12'));if(_0x245208===_0x64ac('0x5')){return _0x3cda85;}if(_0xd69966===_0x64ac('0x13')&&_0x3cda85===_0x64ac('0xa')||_0xd69966==='booked'&&_0x3cda85===_0x64ac('0x14')){return _0x3cda85;}if(_0xd69966===_0x64ac('0x15')||_0xd69966===_0x64ac('0x16')||_0xd69966===_0x64ac('0x17')){return _0x3cda85;}return null;}},'servicelevel':{'type':Sequelize[_0x64ac('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x64ac('0x18')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x64ac('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x64ac('0x2')]},'weight':{'type':Sequelize[_0x64ac('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no'),'defaultValue':_0x64ac('0x19')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x64ac('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x64ac('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x64ac('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x64ac('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x64ac('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x64ac('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x64ac('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x64ac('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x64ac('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x64ac('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x64ac('0x19'),'no'),'defaultValue':_0x64ac('0x19')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x64ac('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x64ac('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x64ac('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x64ac('0x2')]},'queue_youarenext':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x64ac('0x2')]},'queue_quantity1':{'type':Sequelize[_0x64ac('0x2')]},'queue_quantity2':{'type':Sequelize[_0x64ac('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x3db1f0){this[_0x64ac('0xe')]('periodic_announce',_0x3db1f0?_0x3db1f0[_0x64ac('0x1c')](','):[]);},'get':function(){return this[_0x64ac('0xf')](_0x64ac('0x1d'))?this[_0x64ac('0xf')]('periodic_announce')[_0x64ac('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':_0x64ac('0x19'),'set':function(_0x1661a7){this[_0x64ac('0xe')](_0x64ac('0x1f'),_0x1661a7?_0x1661a7['join'](','):undefined);},'get':function(){return this[_0x64ac('0xf')](_0x64ac('0x1f'))?this[_0x64ac('0xf')](_0x64ac('0x1f'))[_0x64ac('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':'no','set':function(_0x30f55d){this[_0x64ac('0xe')](_0x64ac('0x20'),_0x30f55d?_0x30f55d['join'](','):undefined);},'get':function(){return this[_0x64ac('0xf')](_0x64ac('0x20'))?this['getDataValue'](_0x64ac('0x20'))[_0x64ac('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x64ac('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x64ac('0x4')](_0x64ac('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x64ac('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':0x0,'set':function(_0x2f9ea9){this['setDataValue'](_0x64ac('0x22'),_0x2f9ea9);if(_0x2f9ea9){if(this[_0x64ac('0xf')](_0x64ac('0x23'))<0x2){this[_0x64ac('0xe')](_0x64ac('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x64ac('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':0x0,'comment':_0x64ac('0x24')},'dialMethod':{'type':Sequelize['ENUM'](_0x64ac('0x25'),_0x64ac('0x15'),_0x64ac('0x17'),'predictive','booked'),'defaultValue':_0x64ac('0x15'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x64ac('0x18')](0x4)[_0x64ac('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x64ac('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x64ac('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x64ac('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x64ac('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x64ac('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x64ac('0x4')]('agentBusyFactor',_0x64ac('0x2a')),'defaultValue':_0x64ac('0x2a'),'comment':_0x64ac('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x64ac('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x64ac('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x64ac('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x64ac('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':_0x64ac('0x2e'),'comment':_0x64ac('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x64ac('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64ac('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x64ac('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64ac('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x64ac('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64ac('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x64ac('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x64ac('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x64ac('0x18')](0x5)[_0x64ac('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64ac('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x64ac('0x36')},'dialTimezone':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':_0x64ac('0x37')},'dialPrefix':{'type':Sequelize[_0x64ac('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x64ac('0x38'),'never',_0x64ac('0x39')),'defaultValue':_0x64ac('0x38')},'dialAMDActive':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':0x0,'comment':_0x64ac('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x64ac('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x64ac('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x64ac('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x64ac('0x18')](0x9)[_0x64ac('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x64ac('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x64ac('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x64ac('0x18')](0x9)[_0x64ac('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x64ac('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x64ac('0x18')](0x9)[_0x64ac('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x64ac('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x64ac('0x18')](0x9)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x64ac('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x64ac('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x64ac('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x64ac('0x18')](0x9)[_0x64ac('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x64ac('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':0x0,'comment':_0x64ac('0x42')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x64ac('0x43'),_0x64ac('0x44')),'defaultValue':_0x64ac('0x43')},'dialQueueProject2':{'type':Sequelize[_0x64ac('0x2')],'comment':_0x64ac('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x64ac('0x45')},'dialCutDigit':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x64ac('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x64ac('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x64ac('0x18')](0x5)[_0x64ac('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64ac('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x64ac('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64ac('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x64ac('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64ac('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64ac('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x64ac('0x18')](0x5)[_0x64ac('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64ac('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x64ac('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64ac('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x64ac('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64ac('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x64ac('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':![],'comment':_0x64ac('0x4f'),'set':function(_0x56e793){if(!_0x56e793)this[_0x64ac('0xe')](_0x64ac('0x50'),null);this[_0x64ac('0xe')](_0x64ac('0x51'),_0x56e793);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x64ac('0x18')](0x3)[_0x64ac('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x64ac('0x21')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index bc471c2..97b383a 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 _0x1134=['phone','scheduledAt','ContactId','select','CmListId','ListId','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)','onlyIfOpen','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','CmHopperBlack','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','keys','include','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','params','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','Team','getTeams','addTeams','teams','Agents','online','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','compact','isEmpty','removeAgents','addAgents','spread','push','format','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery'];(function(_0x264447,_0x425b41){var _0x1346c8=function(_0x406c3d){while(--_0x406c3d){_0x264447['push'](_0x264447['shift']());}};_0x1346c8(++_0x425b41);}(_0x1134,0x19c));var _0x4113=function(_0x3d34b5,_0x1c57d1){_0x3d34b5=_0x3d34b5-0x0;var _0x25682e=_0x1134[_0x3d34b5];return _0x25682e;};'use strict';var emlformat=require(_0x4113('0x0'));var rimraf=require(_0x4113('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4113('0x2'));var rp=require(_0x4113('0x3'));var moment=require('moment');var BPromise=require(_0x4113('0x4'));var Mustache=require(_0x4113('0x5'));var util=require('util');var path=require(_0x4113('0x6'));var sox=require('sox');var csv=require(_0x4113('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4113('0x8'));var _=require('lodash');var squel=require(_0x4113('0x9'));var crypto=require(_0x4113('0xa'));var jsforce=require(_0x4113('0xb'));var deskjs=require(_0x4113('0xc'));var toCsv=require(_0x4113('0x7'));var querystring=require(_0x4113('0xd'));var Papa=require(_0x4113('0xe'));var Redis=require(_0x4113('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4113('0x10'));var as=require(_0x4113('0x11'));var hardwareService=require(_0x4113('0x12'));var logger=require(_0x4113('0x13'))(_0x4113('0x14'));var utils=require(_0x4113('0x15'));var config=require(_0x4113('0x16'));var licenseUtil=require(_0x4113('0x17'));var db=require(_0x4113('0x18'))['db'];config[_0x4113('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4113('0x1a'))(new Redis(config[_0x4113('0x19')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x40f01e,_0x5d9801){_0x5d9801=_0x5d9801||0xcc;return function(_0x34123d){if(_0x34123d){return _0x40f01e['sendStatus'](_0x5d9801);}return _0x40f01e['status'](_0x5d9801)[_0x4113('0x1b')]();};}function respondWithResult(_0xe88992,_0x2f8952){_0x2f8952=_0x2f8952||0xc8;return function(_0x3de530){if(_0x3de530){return _0xe88992[_0x4113('0x1c')](_0x2f8952)[_0x4113('0x1d')](_0x3de530);}};}function respondWithFilteredResult(_0x405849,_0xa7f33d){return function(_0x1051d4){if(_0x1051d4){var _0x1cd9ae=typeof _0xa7f33d['offset']===_0x4113('0x1e')&&typeof _0xa7f33d[_0x4113('0x1f')]===_0x4113('0x1e');var _0x1d40ba=_0x1051d4[_0x4113('0x20')];var _0x9608c3=_0x1cd9ae?0x0:_0xa7f33d[_0x4113('0x21')];var _0x4cdffc=_0x1cd9ae?_0x1051d4[_0x4113('0x20')]:_0xa7f33d['offset']+_0xa7f33d[_0x4113('0x1f')];var _0x2776a6;if(_0x4cdffc>=_0x1d40ba){_0x4cdffc=_0x1d40ba;_0x2776a6=0xc8;}else{_0x2776a6=0xce;}_0x405849['status'](_0x2776a6);return _0x405849['set'](_0x4113('0x22'),_0x9608c3+'-'+_0x4cdffc+'/'+_0x1d40ba)['json'](_0x1051d4);}return null;};}function patchUpdates(_0x149d1a){return function(_0x1a9167){try{jsonpatch[_0x4113('0x23')](_0x1a9167,_0x149d1a,!![]);}catch(_0x5a85be){return BPromise[_0x4113('0x24')](_0x5a85be);}return _0x1a9167[_0x4113('0x25')]();};}function saveUpdates(_0x349b33,_0x1f095c){return function(_0x34ee93){if(_0x34ee93){return _0x34ee93[_0x4113('0x26')](_0x349b33)[_0x4113('0x27')](function(_0x1c498a){return _0x1c498a;});}return null;};}function removeEntity(_0x122102,_0xc73743){return function(_0x22f1ce){if(_0x22f1ce){return _0x22f1ce[_0x4113('0x28')]()['then'](function(){var _0x44b317=_0x22f1ce[_0x4113('0x29')]({'plain':!![]});var _0x54cf93=[{'name':_0x4113('0x2a'),'value':_0x4113('0x2b'),'ignore':![]},{'name':_0x4113('0x2c'),'value':_0x4113('0x2d'),'ignore':![]}];var _0x2d9cc6=_(_0x54cf93)[_0x4113('0x2e')](_0x4113('0x2f'))[_0x4113('0x30')](_0x4113('0x31'))[_0x4113('0x31')]();if(_[_0x4113('0x32')](_0x2d9cc6,_0x44b317[_0x4113('0x33')])){return;}var _0x25e422=_[_0x4113('0x34')](_0x54cf93,['value',_0x44b317[_0x4113('0x33')]])[_0x4113('0x35')];return db['UserProfileResource'][_0x4113('0x28')]({'where':{'type':_0x25e422,'resourceId':_0x44b317['id']}})[_0x4113('0x27')](function(){return _0x22f1ce;});})[_0x4113('0x27')](function(){_0x122102[_0x4113('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fac56,_0x237740){return function(_0x20ae1d){if(!_0x20ae1d){_0x3fac56[_0x4113('0x36')](0x194);}return _0x20ae1d;};}function handleError(_0x372594,_0x2b0d22){_0x2b0d22=_0x2b0d22||0x1f4;return function(_0x4637b0){logger[_0x4113('0x37')](_0x4637b0[_0x4113('0x38')]);if(_0x4637b0['name']){delete _0x4637b0[_0x4113('0x35')];}_0x372594['status'](_0x2b0d22)[_0x4113('0x39')](_0x4637b0);};}exports[_0x4113('0x3a')]=function(_0xd42ebb,_0xe69b3e){var _0x91464d={},_0x453d70={},_0x4bbda1={'count':0x0,'rows':[]};var _0x1f63ec=_['map'](db[_0x4113('0x3b')][_0x4113('0x3c')],function(_0x227498){return{'name':_0x227498['fieldName'],'type':_0x227498[_0x4113('0x33')]['key']};});_0x453d70[_0x4113('0x3d')]=_['map'](_0x1f63ec,_0x4113('0x35'));_0x453d70[_0x4113('0x3e')]=_['keys'](_0xd42ebb['query']);_0x453d70[_0x4113('0x3f')]=_[_0x4113('0x40')](_0x453d70[_0x4113('0x3d')],_0x453d70['query']);_0x91464d['attributes']=_[_0x4113('0x40')](_0x453d70[_0x4113('0x3d')],qs[_0x4113('0x41')](_0xd42ebb[_0x4113('0x3e')][_0x4113('0x41')]));_0x91464d['attributes']=_0x91464d[_0x4113('0x42')][_0x4113('0x43')]?_0x91464d[_0x4113('0x42')]:_0x453d70['model'];if(!_0xd42ebb[_0x4113('0x3e')][_0x4113('0x44')](_0x4113('0x45'))){_0x91464d['limit']=qs[_0x4113('0x1f')](_0xd42ebb['query'][_0x4113('0x1f')]);_0x91464d['offset']=qs[_0x4113('0x21')](_0xd42ebb[_0x4113('0x3e')][_0x4113('0x21')]);}_0x91464d[_0x4113('0x46')]=qs[_0x4113('0x47')](_0xd42ebb[_0x4113('0x3e')][_0x4113('0x47')]);_0x91464d[_0x4113('0x48')]=qs['filters'](_[_0x4113('0x49')](_0xd42ebb[_0x4113('0x3e')],_0x453d70['filters']),_0x1f63ec);if(_0xd42ebb[_0x4113('0x3e')]['filter']){_0x91464d['where']=_[_0x4113('0x4a')](_0x91464d['where'],{'$or':_[_0x4113('0x30')](_0x1f63ec,function(_0x48dfd2){if(_0x48dfd2['type']!==_0x4113('0x4b')){var _0x564958={};_0x564958[_0x48dfd2[_0x4113('0x35')]]={'$like':'%'+_0xd42ebb[_0x4113('0x3e')]['filter']+'%'};return _0x564958;}})});}_0x91464d=_['merge']({},_0x91464d,_0xd42ebb[_0x4113('0x4c')]);var _0x3a5af1={'where':_0x91464d[_0x4113('0x48')]};return db[_0x4113('0x3b')]['count'](_0x3a5af1)[_0x4113('0x27')](function(_0x242b0e){_0x4bbda1['count']=_0x242b0e;if(_0xd42ebb['query'][_0x4113('0x4d')]){_0x91464d['include']=[{'all':!![]}];}return db[_0x4113('0x3b')][_0x4113('0x4e')](_0x91464d);})[_0x4113('0x27')](function(_0x14722b){_0x4bbda1['rows']=_0x14722b;return _0x4bbda1;})[_0x4113('0x27')](respondWithFilteredResult(_0xe69b3e,_0x91464d))['catch'](handleError(_0xe69b3e,null));};exports['show']=function(_0x362a72,_0x2986f1){var _0x5a4cec={'raw':![],'where':{'id':_0x362a72['params']['id']}},_0x1971fb={};_0x1971fb[_0x4113('0x3d')]=_[_0x4113('0x4f')](db[_0x4113('0x3b')]['rawAttributes']);_0x1971fb[_0x4113('0x3e')]=_[_0x4113('0x4f')](_0x362a72[_0x4113('0x3e')]);_0x1971fb[_0x4113('0x3f')]=_[_0x4113('0x40')](_0x1971fb[_0x4113('0x3d')],_0x1971fb[_0x4113('0x3e')]);_0x5a4cec[_0x4113('0x42')]=_['intersection'](_0x1971fb['model'],qs[_0x4113('0x41')](_0x362a72['query']['fields']));_0x5a4cec['attributes']=_0x5a4cec[_0x4113('0x42')][_0x4113('0x43')]?_0x5a4cec[_0x4113('0x42')]:_0x1971fb['model'];if(_0x362a72[_0x4113('0x3e')][_0x4113('0x4d')]){_0x5a4cec[_0x4113('0x50')]=[{'all':!![]}];}_0x5a4cec=_['merge']({},_0x5a4cec,_0x362a72[_0x4113('0x4c')]);return db[_0x4113('0x3b')][_0x4113('0x34')](_0x5a4cec)[_0x4113('0x27')](handleEntityNotFound(_0x2986f1,null))[_0x4113('0x27')](respondWithResult(_0x2986f1,null))['catch'](handleError(_0x2986f1,null));};exports[_0x4113('0x51')]=function(_0x92e99,_0x5b4a21){return db['VoiceQueue']['create'](_0x92e99['body'],{})['then'](function(_0x7e2f12){var _0x3aec2e=_0x92e99[_0x4113('0x52')]['get']({'plain':!![]});if(!_0x3aec2e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aec2e['role']==='user'){var _0xe19d11=_0x7e2f12[_0x4113('0x29')]({'plain':!![]});var _0x398052=[{'name':'VoiceQueues','value':_0x4113('0x2b')},{'name':_0x4113('0x2c'),'value':'outbound'}];var _0x272685=_[_0x4113('0x34')](_0x398052,[_0x4113('0x31'),_0xe19d11['type']])[_0x4113('0x35')];return db[_0x4113('0x53')][_0x4113('0x34')]({'where':{'name':_0x272685,'userProfileId':_0x3aec2e[_0x4113('0x54')]},'raw':!![]})[_0x4113('0x27')](function(_0x1f793e){if(_0x1f793e&&_0x1f793e[_0x4113('0x55')]===0x0){return db[_0x4113('0x56')]['create']({'name':_0xe19d11[_0x4113('0x35')],'resourceId':_0xe19d11['id'],'type':_0x1f793e[_0x4113('0x35')],'sectionId':_0x1f793e['id']},{})['then'](function(){return _0x7e2f12;});}else{return _0x7e2f12;}})[_0x4113('0x57')](function(_0x5042fb){logger[_0x4113('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5042fb);throw _0x5042fb;});}return _0x7e2f12;})[_0x4113('0x27')](respondWithResult(_0x5b4a21,0xc9))[_0x4113('0x57')](handleError(_0x5b4a21,null));};exports['clone']=function(_0x20a842,_0x4500af){var _0x2cab5e={'where':{'id':_0x20a842['params']['id']}},_0x4a56ad={};_0x4a56ad['model']=_[_0x4113('0x4f')](db[_0x4113('0x3b')][_0x4113('0x3c')]);_0x2cab5e[_0x4113('0x42')]=_[_0x4113('0x40')](_0x4a56ad[_0x4113('0x3d')],qs['fields'](_0x20a842[_0x4113('0x3e')]['fields']));_0x2cab5e[_0x4113('0x42')]=_0x2cab5e[_0x4113('0x42')][_0x4113('0x43')]?_0x2cab5e[_0x4113('0x42')]:_0x4a56ad[_0x4113('0x3d')];if(_0x20a842[_0x4113('0x3e')]['includeAll']){_0x2cab5e[_0x4113('0x50')]=[{'all':!![]}];}_0x2cab5e=_['merge']({},_0x2cab5e,_0x20a842[_0x4113('0x4c')]);return db[_0x4113('0x3b')][_0x4113('0x34')](_0x2cab5e)[_0x4113('0x27')](handleEntityNotFound(_0x4500af,null))[_0x4113('0x27')](function(_0x4b509b){if(_0x4b509b){var _0x42e621=_0x4b509b[_0x4113('0x29')]({'plain':!![]});_0x42e621=qs[_0x4113('0x58')](_0x42e621,['id',_0x4113('0x59'),_0x4113('0x5a')]);_0x20a842['body']=_[_0x4113('0x58')](_0x20a842[_0x4113('0x5b')],['id',_0x4113('0x59'),'updatedAt']);return db[_0x4113('0x3b')]['create'](_[_0x4113('0x4a')](_0x42e621,_0x20a842[_0x4113('0x5b')]),{'include':_0x20a842['query'][_0x4113('0x4d')]?[{'all':!![]}]:undefined})[_0x4113('0x27')](function(_0x2c4975){var _0x370984=_0x20a842['user'][_0x4113('0x29')]({'plain':!![]});if(!_0x370984)throw new Error(_0x4113('0x5c'));if(_0x370984[_0x4113('0x5d')]===_0x4113('0x52')){var _0x383db2=_0x2c4975[_0x4113('0x29')]({'plain':!![]});var _0x16d007=[{'name':_0x4113('0x2a'),'value':_0x4113('0x2b')},{'name':'QueueCampaigns','value':'outbound'}];var _0x58843f=_[_0x4113('0x34')](_0x16d007,[_0x4113('0x31'),_0x383db2[_0x4113('0x33')]])[_0x4113('0x35')];return db[_0x4113('0x53')][_0x4113('0x34')]({'where':{'name':_0x58843f,'userProfileId':_0x370984['userProfileId']},'raw':!![]})['then'](function(_0x218196){if(_0x218196&&_0x218196['autoAssociation']===0x0){return db[_0x4113('0x56')]['create']({'name':_0x383db2['name'],'resourceId':_0x383db2['id'],'type':_0x218196[_0x4113('0x35')],'sectionId':_0x218196['id']},{})[_0x4113('0x27')](function(){return _0x2c4975;});}else{return _0x2c4975;}})[_0x4113('0x57')](function(_0x194322){logger[_0x4113('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x194322);throw _0x194322;});}return _0x2c4975;});}})[_0x4113('0x27')](respondWithResult(_0x4500af,0xc9))[_0x4113('0x57')](handleError(_0x4500af,null));};exports['update']=function(_0x4b0b87,_0x26c321){if(_0x4b0b87['body']['id']){delete _0x4b0b87[_0x4113('0x5b')]['id'];}return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x4b0b87['params']['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x26c321,null))[_0x4113('0x27')](saveUpdates(_0x4b0b87[_0x4113('0x5b')],null))[_0x4113('0x27')](respondWithResult(_0x26c321,null))[_0x4113('0x57')](handleError(_0x26c321,null));};exports[_0x4113('0x28')]=function(_0x4fb6b2,_0x4d25a3){return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x4fb6b2['params']['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x4d25a3,null))[_0x4113('0x27')](removeEntity(_0x4d25a3,null))[_0x4113('0x57')](handleError(_0x4d25a3,null));};exports[_0x4113('0x5e')]=function(_0x1d9ed0,_0x2b54b5,_0x4c32d0){var _0x5dde6c={'raw':![],'where':{}};var _0x1f0052={};var _0x4dc148={'count':0x0,'rows':[]};return db[_0x4113('0x3b')][_0x4113('0x5f')]({'where':{'id':_0x1d9ed0['params']['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x2b54b5,null))['then'](function(_0x396956){if(_0x396956){_0x1f0052[_0x4113('0x3d')]=_[_0x4113('0x4f')](db[_0x4113('0x60')]['rawAttributes']);_0x1f0052[_0x4113('0x3e')]=_[_0x4113('0x4f')](_0x1d9ed0[_0x4113('0x3e')]);_0x1f0052[_0x4113('0x3f')]=_['intersection'](_0x1f0052[_0x4113('0x3d')],_0x1f0052['query']);_0x5dde6c[_0x4113('0x42')]=_['intersection'](_0x1f0052[_0x4113('0x3d')],qs['fields'](_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x41')]));_0x5dde6c[_0x4113('0x42')]=_0x5dde6c[_0x4113('0x42')][_0x4113('0x43')]?_0x5dde6c[_0x4113('0x42')]:_0x1f0052['model'];if(!_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x44')]('nolimit')){_0x5dde6c[_0x4113('0x1f')]=qs[_0x4113('0x1f')](_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x1f')]);_0x5dde6c[_0x4113('0x21')]=qs[_0x4113('0x21')](_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x21')]);}_0x5dde6c[_0x4113('0x46')]=qs[_0x4113('0x47')](_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x47')]);_0x5dde6c[_0x4113('0x48')]=qs[_0x4113('0x3f')](_['pick'](_0x1d9ed0[_0x4113('0x3e')],_0x1f0052[_0x4113('0x3f')]));_0x5dde6c[_0x4113('0x48')][_0x4113('0x61')]=_0x396956['id'];if(_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x2e')]){_0x5dde6c['where']=_[_0x4113('0x4a')](_0x5dde6c[_0x4113('0x48')],{'$or':_[_0x4113('0x30')](_0x5dde6c[_0x4113('0x42')],function(_0x4ae296){var _0x49e8f2={};_0x49e8f2[_0x4ae296]={'$like':'%'+_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x2e')]+'%'};return _0x49e8f2;})});}_0x5dde6c=_[_0x4113('0x4a')]({},_0x5dde6c,_0x1d9ed0[_0x4113('0x4c')]);return db['CmHopper']['count']({'where':_0x5dde6c['where']})[_0x4113('0x27')](function(_0x2004ac){_0x4dc148[_0x4113('0x20')]=_0x2004ac;if(_0x1d9ed0[_0x4113('0x3e')][_0x4113('0x4d')]){_0x5dde6c[_0x4113('0x50')]=[{'all':!![]}];}return db[_0x4113('0x60')][_0x4113('0x4e')](_0x5dde6c);})[_0x4113('0x27')](function(_0x6926a6){_0x4dc148['rows']=_0x6926a6;return _0x4dc148;});}})[_0x4113('0x27')](respondWithFilteredResult(_0x2b54b5,_0x5dde6c))['catch'](handleError(_0x2b54b5,null));};exports[_0x4113('0x62')]=function(_0x2024ae,_0x48fbf8,_0x88c37b){var _0x454a34={'raw':!![],'where':{}};var _0x518982={};var _0x25a4ab={'count':0x0,'rows':[]};return db[_0x4113('0x3b')]['findOne']({'where':{'id':_0x2024ae[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x48fbf8,null))[_0x4113('0x27')](function(_0x23aeb3){if(_0x23aeb3){_0x518982[_0x4113('0x3d')]=_[_0x4113('0x4f')](db[_0x4113('0x64')][_0x4113('0x3c')]);_0x518982[_0x4113('0x3e')]=_['keys'](_0x2024ae[_0x4113('0x3e')]);_0x518982['filters']=_[_0x4113('0x40')](_0x518982[_0x4113('0x3d')],_0x518982[_0x4113('0x3e')]);_0x454a34[_0x4113('0x42')]=_[_0x4113('0x40')](_0x518982['model'],qs[_0x4113('0x41')](_0x2024ae['query'][_0x4113('0x41')]));_0x454a34['attributes']=_0x454a34[_0x4113('0x42')][_0x4113('0x43')]?_0x454a34[_0x4113('0x42')]:_0x518982['model'];if(!_0x2024ae[_0x4113('0x3e')][_0x4113('0x44')](_0x4113('0x45'))){_0x454a34[_0x4113('0x1f')]=qs[_0x4113('0x1f')](_0x2024ae['query'][_0x4113('0x1f')]);_0x454a34['offset']=qs[_0x4113('0x21')](_0x2024ae['query'][_0x4113('0x21')]);}_0x454a34[_0x4113('0x46')]=qs[_0x4113('0x47')](_0x2024ae[_0x4113('0x3e')][_0x4113('0x47')]);_0x454a34[_0x4113('0x48')]=qs[_0x4113('0x3f')](_['pick'](_0x2024ae[_0x4113('0x3e')],_0x518982[_0x4113('0x3f')]));_0x454a34[_0x4113('0x48')][_0x4113('0x61')]=_0x23aeb3['id'];if(_0x2024ae['query'][_0x4113('0x2e')]){_0x454a34[_0x4113('0x48')]=_[_0x4113('0x4a')](_0x454a34[_0x4113('0x48')],{'$or':_[_0x4113('0x30')](_0x454a34['attributes'],function(_0x4e554c){var _0x59f360={};_0x59f360[_0x4e554c]={'$like':'%'+_0x2024ae[_0x4113('0x3e')]['filter']+'%'};return _0x59f360;})});}_0x454a34=_[_0x4113('0x4a')]({},_0x454a34,_0x2024ae[_0x4113('0x4c')]);return db[_0x4113('0x64')][_0x4113('0x20')]({'where':_0x454a34[_0x4113('0x48')]})[_0x4113('0x27')](function(_0x2f5f82){_0x25a4ab[_0x4113('0x20')]=_0x2f5f82;if(_0x2024ae[_0x4113('0x3e')][_0x4113('0x4d')]){_0x454a34['include']=[{'all':!![]}];}return db[_0x4113('0x64')][_0x4113('0x4e')](_0x454a34);})[_0x4113('0x27')](function(_0x45b022){_0x25a4ab['rows']=_0x45b022;return _0x25a4ab;});}})[_0x4113('0x27')](respondWithFilteredResult(_0x48fbf8,_0x454a34))[_0x4113('0x57')](handleError(_0x48fbf8,null));};exports[_0x4113('0x65')]=function(_0x57d940,_0x359358,_0x1baf78){var _0x339d26={'raw':!![],'where':{}};var _0x4909e0={};var _0x5f3c5a={'count':0x0,'rows':[]};return db[_0x4113('0x3b')][_0x4113('0x5f')]({'where':{'id':_0x57d940[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x359358,null))[_0x4113('0x27')](function(_0x434423){if(_0x434423){_0x4909e0[_0x4113('0x3d')]=_[_0x4113('0x4f')](db[_0x4113('0x66')][_0x4113('0x3c')]);_0x4909e0['query']=_[_0x4113('0x4f')](_0x57d940[_0x4113('0x3e')]);_0x4909e0[_0x4113('0x3f')]=_[_0x4113('0x40')](_0x4909e0[_0x4113('0x3d')],_0x4909e0[_0x4113('0x3e')]);_0x339d26[_0x4113('0x42')]=_[_0x4113('0x40')](_0x4909e0['model'],qs[_0x4113('0x41')](_0x57d940[_0x4113('0x3e')][_0x4113('0x41')]));_0x339d26['attributes']=_0x339d26[_0x4113('0x42')]['length']?_0x339d26[_0x4113('0x42')]:_0x4909e0['model'];if(!_0x57d940[_0x4113('0x3e')][_0x4113('0x44')](_0x4113('0x45'))){_0x339d26['limit']=qs[_0x4113('0x1f')](_0x57d940[_0x4113('0x3e')]['limit']);_0x339d26[_0x4113('0x21')]=qs[_0x4113('0x21')](_0x57d940[_0x4113('0x3e')]['offset']);}_0x339d26['order']=qs[_0x4113('0x47')](_0x57d940['query'][_0x4113('0x47')]);_0x339d26[_0x4113('0x48')]=qs[_0x4113('0x3f')](_[_0x4113('0x49')](_0x57d940[_0x4113('0x3e')],_0x4909e0[_0x4113('0x3f')]));_0x339d26['where'][_0x4113('0x61')]=_0x434423['id'];if(_0x57d940[_0x4113('0x3e')][_0x4113('0x2e')]){_0x339d26[_0x4113('0x48')]=_[_0x4113('0x4a')](_0x339d26['where'],{'$or':_[_0x4113('0x30')](_0x339d26[_0x4113('0x42')],function(_0x443ec4){var _0x1efdd0={};_0x1efdd0[_0x443ec4]={'$like':'%'+_0x57d940[_0x4113('0x3e')]['filter']+'%'};return _0x1efdd0;})});}_0x339d26=_['merge']({},_0x339d26,_0x57d940[_0x4113('0x4c')]);return db['CmHopperFinal'][_0x4113('0x20')]({'where':_0x339d26[_0x4113('0x48')]})[_0x4113('0x27')](function(_0x2df31d){_0x5f3c5a['count']=_0x2df31d;if(_0x57d940[_0x4113('0x3e')][_0x4113('0x4d')]){_0x339d26['include']=[{'all':!![]}];}return db[_0x4113('0x66')][_0x4113('0x4e')](_0x339d26);})[_0x4113('0x27')](function(_0x367fed){_0x5f3c5a['rows']=_0x367fed;return _0x5f3c5a;});}})[_0x4113('0x27')](respondWithFilteredResult(_0x359358,_0x339d26))[_0x4113('0x57')](handleError(_0x359358,null));};exports[_0x4113('0x67')]=function(_0x4d17b1,_0x4e3037,_0x5663b5){var _0x45a819={'raw':!![],'where':{}};var _0x74dfb7={};var _0x341ba6={'count':0x0,'rows':[]};return db[_0x4113('0x3b')][_0x4113('0x5f')]({'where':{'id':_0x4d17b1[_0x4113('0x63')]['id']}})['then'](handleEntityNotFound(_0x4e3037,null))[_0x4113('0x27')](function(_0x20715c){if(_0x20715c){_0x74dfb7[_0x4113('0x3d')]=_[_0x4113('0x4f')](db['CmHopperBlack'][_0x4113('0x3c')]);_0x74dfb7['query']=_[_0x4113('0x4f')](_0x4d17b1[_0x4113('0x3e')]);_0x74dfb7[_0x4113('0x3f')]=_[_0x4113('0x40')](_0x74dfb7[_0x4113('0x3d')],_0x74dfb7[_0x4113('0x3e')]);_0x45a819[_0x4113('0x42')]=_['intersection'](_0x74dfb7[_0x4113('0x3d')],qs[_0x4113('0x41')](_0x4d17b1['query']['fields']));_0x45a819[_0x4113('0x42')]=_0x45a819['attributes']['length']?_0x45a819['attributes']:_0x74dfb7[_0x4113('0x3d')];if(!_0x4d17b1['query'][_0x4113('0x44')](_0x4113('0x45'))){_0x45a819[_0x4113('0x1f')]=qs[_0x4113('0x1f')](_0x4d17b1[_0x4113('0x3e')]['limit']);_0x45a819['offset']=qs[_0x4113('0x21')](_0x4d17b1[_0x4113('0x3e')]['offset']);}_0x45a819[_0x4113('0x46')]=qs['sort'](_0x4d17b1['query'][_0x4113('0x47')]);_0x45a819['where']=qs[_0x4113('0x3f')](_[_0x4113('0x49')](_0x4d17b1[_0x4113('0x3e')],_0x74dfb7['filters']));_0x45a819['where'][_0x4113('0x61')]=_0x20715c['id'];if(_0x4d17b1[_0x4113('0x3e')][_0x4113('0x2e')]){_0x45a819[_0x4113('0x48')]=_[_0x4113('0x4a')](_0x45a819['where'],{'$or':_[_0x4113('0x30')](_0x45a819[_0x4113('0x42')],function(_0x24daa2){var _0x5819ea={};_0x5819ea[_0x24daa2]={'$like':'%'+_0x4d17b1[_0x4113('0x3e')][_0x4113('0x2e')]+'%'};return _0x5819ea;})});}_0x45a819=_[_0x4113('0x4a')]({},_0x45a819,_0x4d17b1[_0x4113('0x4c')]);return db['CmHopperBlack'][_0x4113('0x20')]({'where':_0x45a819[_0x4113('0x48')]})[_0x4113('0x27')](function(_0x3f1f18){_0x341ba6[_0x4113('0x20')]=_0x3f1f18;if(_0x4d17b1['query'][_0x4113('0x4d')]){_0x45a819[_0x4113('0x50')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x45a819);})[_0x4113('0x27')](function(_0x4f0383){_0x341ba6['rows']=_0x4f0383;return _0x341ba6;});}})[_0x4113('0x27')](respondWithFilteredResult(_0x4e3037,_0x45a819))[_0x4113('0x57')](handleError(_0x4e3037,null));};exports['getTeams']=function(_0x10d63a,_0x55696a,_0x58e0f7){var _0x321721={};var _0x175652={};var _0x422a64;var _0x10284a;return db[_0x4113('0x3b')][_0x4113('0x5f')]({'where':{'id':_0x10d63a[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x55696a,null))['then'](function(_0x5a870d){if(_0x5a870d){_0x422a64=_0x5a870d;_0x175652['model']=_['keys'](db[_0x4113('0x68')][_0x4113('0x3c')]);_0x175652[_0x4113('0x3e')]=_[_0x4113('0x4f')](_0x10d63a['query']);_0x175652[_0x4113('0x3f')]=_['intersection'](_0x175652[_0x4113('0x3d')],_0x175652[_0x4113('0x3e')]);_0x321721[_0x4113('0x42')]=_[_0x4113('0x40')](_0x175652['model'],qs[_0x4113('0x41')](_0x10d63a[_0x4113('0x3e')][_0x4113('0x41')]));_0x321721['attributes']=_0x321721[_0x4113('0x42')][_0x4113('0x43')]?_0x321721['attributes']:_0x175652[_0x4113('0x3d')];_0x321721[_0x4113('0x46')]=qs[_0x4113('0x47')](_0x10d63a[_0x4113('0x3e')][_0x4113('0x47')]);_0x321721[_0x4113('0x48')]=qs['filters'](_[_0x4113('0x49')](_0x10d63a['query'],_0x175652['filters']));if(_0x10d63a['query'][_0x4113('0x2e')]){_0x321721[_0x4113('0x48')]=_[_0x4113('0x4a')](_0x321721[_0x4113('0x48')],{'$or':_[_0x4113('0x30')](_0x321721[_0x4113('0x42')],function(_0x58229d){var _0x2049ae={};_0x2049ae[_0x58229d]={'$like':'%'+_0x10d63a[_0x4113('0x3e')][_0x4113('0x2e')]+'%'};return _0x2049ae;})});}_0x321721=_[_0x4113('0x4a')]({},_0x321721,_0x10d63a[_0x4113('0x4c')]);return _0x422a64['getTeams'](_0x321721);}})[_0x4113('0x27')](function(_0x4b2497){if(_0x4b2497){_0x10284a=_0x4b2497['length'];if(!_0x10d63a[_0x4113('0x3e')][_0x4113('0x44')](_0x4113('0x45'))){_0x321721[_0x4113('0x1f')]=qs['limit'](_0x10d63a[_0x4113('0x3e')]['limit']);_0x321721['offset']=qs[_0x4113('0x21')](_0x10d63a[_0x4113('0x3e')][_0x4113('0x21')]);}return _0x422a64[_0x4113('0x69')](_0x321721);}})['then'](function(_0x21a077){if(_0x21a077){return _0x21a077?{'count':_0x10284a,'rows':_0x21a077}:null;}})[_0x4113('0x27')](respondWithResult(_0x55696a,null))['catch'](handleError(_0x55696a,null));};exports[_0x4113('0x6a')]=function(_0x193160,_0x4326aa,_0x50b567){var _0x25f5dc=_0x193160[_0x4113('0x5b')][_0x4113('0x6b')];var _0x173de8=_[_0x4113('0x30')](_0x25f5dc,'id');return db[_0x4113('0x68')]['findAll']({'where':{'id':_0x173de8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4113('0x6c'),'attributes':['id',_0x4113('0x35'),_0x4113('0x6d'),'voicePause','interface'],'raw':!![]}]})[_0x4113('0x27')](function(_0x5d47ab){if(_0x5d47ab){var _0x1a553a=_[_0x4113('0x6e')](_0x5d47ab,function(_0x34b928){var _0x2dad42=_0x34b928['get']({'plain':!![]});_0x2dad42[_0x4113('0x6c')][_0x4113('0x6f')](function(_0x1fe279){_0x1fe279[_0x4113('0x70')]=_[_0x4113('0x34')](_0x25f5dc,{'id':_0x2dad42['id']})[_0x4113('0x70')];});return _0x2dad42[_0x4113('0x6c')];});return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x193160[_0x4113('0x63')]['id']}})['then'](function(_0x2faec1){return db[_0x4113('0x71')]['transaction'](function(_0x2d968f){return _0x2faec1['addTeams'](_0x173de8,{'transaction':_0x2d968f})[_0x4113('0x27')](function(){return BPromise[_0x4113('0x72')](_0x25f5dc,function(_0x5f53e0){return db[_0x4113('0x73')][_0x4113('0x74')]({'TeamId':_0x5f53e0['id'],'VoiceQueueId':_0x193160[_0x4113('0x63')]['id'],'penalty':_0x5f53e0[_0x4113('0x70')]},{'transaction':_0x2d968f});});})[_0x4113('0x27')](function(){return BPromise[_0x4113('0x72')](_0x1a553a,function(_0x440258){return db['UserVoiceQueue'][_0x4113('0x75')]({'where':{'UserId':_0x440258['id'],'VoiceQueueId':_0x193160['params']['id']},'defaults':{'penalty':_0x440258[_0x4113('0x70')]},'transaction':_0x2d968f});});})[_0x4113('0x27')](function(){return BPromise[_0x4113('0x72')](_['filter'](_0x1a553a,{'online':!![]}),function(_0x189e8c){return db[_0x4113('0x76')]['upsert']({'membername':_0x189e8c['name'],'UserId':_0x189e8c['id'],'queue_name':_0x2faec1['name'],'VoiceQueueId':_0x2faec1['id'],'interface':_[_0x4113('0x77')](_0x189e8c[_0x4113('0x78')])?util['format'](_0x4113('0x79'),_0x189e8c[_0x4113('0x35')]):_0x189e8c['interface'],'paused':_0x189e8c[_0x4113('0x7a')]||![],'penalty':_0x189e8c[_0x4113('0x70')]},{'transaction':_0x2d968f});});})[_0x4113('0x27')](function(){_0x1a553a[_0x4113('0x6f')](function(_0x330ad3){socket[_0x4113('0x7b')](_0x4113('0x7c'),{'UserId':_0x330ad3['id'],'VoiceQueueId':_0x2faec1['id']});});});});});}})['then'](respondWithStatusCode(_0x4326aa,null))['catch'](handleError(_0x4326aa,null));};exports[_0x4113('0x7d')]=function(_0x1e268c,_0x10d804,_0x3ebd05){return db[_0x4113('0x68')][_0x4113('0x4e')]({'where':{'id':_0x1e268c['query'][_0x4113('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4113('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x4113('0x27')](handleEntityNotFound(_0x10d804,null))[_0x4113('0x27')](function(_0x11307c){var _0x478b0b=_[_0x4113('0x30')](_0x11307c,'id');var _0x1c9b4c=[];var _0x54576e=[];var _0x980f3=squel['select']();_0x980f3[_0x4113('0x7f')](_0x4113('0x80'))[_0x4113('0x81')](_0x4113('0x82'),'tq')[_0x4113('0x83')](_0x4113('0x84'),'ut',_0x4113('0x85'))[_0x4113('0x48')](_0x4113('0x86'),_0x1e268c[_0x4113('0x63')]['id']);for(var _0x259532=0x0;_0x259532<_0x11307c['length'];_0x259532+=0x1){let _0x3eb288=_0x11307c[_0x259532];for(var _0x2b33e3=0x0;_0x2b33e3<_0x3eb288[_0x4113('0x6c')][_0x4113('0x43')];_0x2b33e3+=0x1){let _0x528024=_0x3eb288[_0x4113('0x6c')][_0x2b33e3];var _0x260732=_0x980f3[_0x4113('0x87')]();_0x260732['where'](_0x4113('0x88'),_0x528024['id']);_0x54576e['push'](db['sequelize'][_0x4113('0x3e')](_0x260732[_0x4113('0x89')](),{'type':db[_0x4113('0x71')][_0x4113('0x8a')][_0x4113('0x8b')]})['then'](function(_0x3190df){if(_0x3190df[_0x4113('0x43')]===0x1){return _0x528024['id'];}else{var _0x2163fb=_[_0x4113('0x8c')](_[_0x4113('0x30')](_0x3190df,'TeamId'),function(_0x1f9e82){return _[_0x4113('0x32')](_0x478b0b,_0x1f9e82);});if(_0x2163fb){return _0x528024['id'];}}}));}}return BPromise[_0x4113('0x8d')](_0x54576e)[_0x4113('0x27')](function(_0x280ad4){_0x1c9b4c=_(_0x1c9b4c)['union'](_0x280ad4)[_0x4113('0x8e')]()[_0x4113('0x31')]();return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x1e268c[_0x4113('0x63')]['id']}})['then'](function(_0x3d25f4){return db[_0x4113('0x71')]['transaction'](function(_0x2d420b){return _0x3d25f4['removeTeams'](_0x1e268c['query'][_0x4113('0x7e')],{'transaction':_0x2d420b})[_0x4113('0x27')](function(){if(!_[_0x4113('0x8f')](_0x1c9b4c)){return _0x3d25f4[_0x4113('0x90')](_0x1c9b4c,{'transaction':_0x2d420b})['then'](function(){return db[_0x4113('0x76')][_0x4113('0x28')]({'where':{'VoiceQueueId':_0x1e268c[_0x4113('0x63')]['id'],'UserId':_0x1c9b4c},'transaction':_0x2d420b});});}})[_0x4113('0x27')](function(){_0x1c9b4c[_0x4113('0x6f')](function(_0x23ba1f){socket['emit']('userVoiceQueue:remove',{'UserId':_0x23ba1f,'VoiceQueueId':_0x3d25f4['id']});});});});});});})[_0x4113('0x27')](respondWithStatusCode(_0x10d804,null))[_0x4113('0x57')](handleError(_0x10d804,null));};exports[_0x4113('0x91')]=function(_0x3fb3dc,_0x42a204,_0x17ad60){var _0x1cbfb3,_0xa154f8;return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x3fb3dc[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x42a204,null))[_0x4113('0x27')](function(_0x447446){if(_0x447446){_0xa154f8=_0x447446;return _0x447446[_0x4113('0x91')](_0x3fb3dc['body'][_0x4113('0x7e')],_['omit'](_0x3fb3dc[_0x4113('0x5b')],['ids','id'])||{})[_0x4113('0x92')](function(_0x103671){for(var _0x386229=0x0;_0x386229<_0x3fb3dc[_0x4113('0x5b')]['ids'][_0x4113('0x43')];_0x386229+=0x1){socket[_0x4113('0x7b')](_0x4113('0x7c'),{'UserId':Number(_0x3fb3dc[_0x4113('0x5b')]['ids'][_0x386229]),'VoiceQueueId':Number(_0x3fb3dc['params']['id'])});}return _0x103671;});}})['then'](function(_0x1bbbfa){_0x1cbfb3=_0x1bbbfa||[];if(_0xa154f8){return db['User']['findAll']({'where':{'id':_0x3fb3dc[_0x4113('0x5b')][_0x4113('0x7e')]},'attributes':['id',_0x4113('0x35'),_0x4113('0x6d'),_0x4113('0x7a'),'interface'],'raw':!![]});}})[_0x4113('0x27')](function(_0x290269){if(!_['isEmpty'](_0x290269)){var _0x2bf108=[];for(var _0x8751b9=0x0;_0x8751b9<_0x290269[_0x4113('0x43')];_0x8751b9++){if(_0x290269[_0x8751b9]['online']){_0x2bf108[_0x4113('0x93')](db['UserVoiceQueueRt'][_0x4113('0x74')]({'membername':_0x290269[_0x8751b9][_0x4113('0x35')],'UserId':_0x290269[_0x8751b9]['id'],'queue_name':_0xa154f8[_0x4113('0x35')],'VoiceQueueId':_0xa154f8['id'],'interface':_[_0x4113('0x77')](_0x290269[_0x8751b9][_0x4113('0x78')])?util[_0x4113('0x94')](_0x4113('0x79'),_0x290269[_0x8751b9][_0x4113('0x35')]):_0x290269[_0x8751b9][_0x4113('0x78')],'paused':_0x290269[_0x8751b9]['voicePause']||![],'penalty':_0x3fb3dc[_0x4113('0x5b')][_0x4113('0x70')]||0x0}));}}return BPromise[_0x4113('0x8d')](_0x2bf108);}})[_0x4113('0x27')](function(){return _0x1cbfb3;})['then'](respondWithResult(_0x42a204,null))[_0x4113('0x57')](handleError(_0x42a204,null));};exports['removeAgents']=function(_0x52445d,_0x57998e,_0xba6ace){return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x52445d[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x57998e,null))[_0x4113('0x27')](function(_0x227e08){if(_0x227e08){return _0x227e08[_0x4113('0x90')](_0x52445d[_0x4113('0x3e')][_0x4113('0x7e')])[_0x4113('0x27')](function(){if(_['isArray'](_0x52445d[_0x4113('0x3e')][_0x4113('0x7e')])){for(var _0x299570=0x0;_0x299570<_0x52445d[_0x4113('0x3e')][_0x4113('0x7e')]['length'];_0x299570+=0x1){socket[_0x4113('0x7b')](_0x4113('0x95'),{'UserId':Number(_0x52445d[_0x4113('0x3e')][_0x4113('0x7e')][_0x299570]),'VoiceQueueId':Number(_0x52445d['params']['id'])});}}else{socket[_0x4113('0x7b')](_0x4113('0x95'),{'UserId':Number(_0x52445d[_0x4113('0x3e')]['ids']),'VoiceQueueId':Number(_0x52445d[_0x4113('0x63')]['id'])});}});}})[_0x4113('0x27')](function(_0x5201dd){return db[_0x4113('0x76')]['destroy']({'where':{'VoiceQueueId':_0x52445d[_0x4113('0x63')]['id'],'UserId':_0x52445d[_0x4113('0x3e')][_0x4113('0x7e')]}})[_0x4113('0x27')](function(){return _0x5201dd;});})[_0x4113('0x27')](respondWithStatusCode(_0x57998e,null))[_0x4113('0x57')](handleError(_0x57998e,null));};exports['getAgents']=function(_0x46c7d9,_0x1c1d7f,_0x423d2d){var _0x821056={};var _0x152626={};var _0x5c7955;var _0x2ae4ee;return db[_0x4113('0x3b')][_0x4113('0x5f')]({'where':{'id':_0x46c7d9[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x1c1d7f,null))[_0x4113('0x27')](function(_0x54004b){if(_0x54004b){_0x5c7955=_0x54004b;_0x152626[_0x4113('0x3d')]=_[_0x4113('0x4f')](db['User'][_0x4113('0x3c')]);_0x152626['query']=_[_0x4113('0x4f')](_0x46c7d9[_0x4113('0x3e')]);_0x152626[_0x4113('0x3f')]=_[_0x4113('0x40')](_0x152626[_0x4113('0x3d')],_0x152626['query']);_0x821056[_0x4113('0x42')]=_[_0x4113('0x40')](_0x152626[_0x4113('0x3d')],qs[_0x4113('0x41')](_0x46c7d9[_0x4113('0x3e')][_0x4113('0x41')]));_0x821056[_0x4113('0x42')]=_0x821056[_0x4113('0x42')][_0x4113('0x43')]?_0x821056['attributes']:_0x152626[_0x4113('0x3d')];_0x821056[_0x4113('0x46')]=qs[_0x4113('0x47')](_0x46c7d9[_0x4113('0x3e')]['sort']);_0x821056['where']=qs[_0x4113('0x3f')](_['pick'](_0x46c7d9[_0x4113('0x3e')],_0x152626[_0x4113('0x3f')]));if(_0x46c7d9['query'][_0x4113('0x2e')]){_0x821056[_0x4113('0x48')]=_[_0x4113('0x4a')](_0x821056[_0x4113('0x48')],{'$or':_[_0x4113('0x30')](_0x821056[_0x4113('0x42')],function(_0x33f4ba){var _0x56912e={};_0x56912e[_0x33f4ba]={'$like':'%'+_0x46c7d9['query'][_0x4113('0x2e')]+'%'};return _0x56912e;})});}_0x821056=_[_0x4113('0x4a')]({},_0x821056,_0x46c7d9[_0x4113('0x4c')]);return _0x5c7955[_0x4113('0x96')](_0x821056);}})[_0x4113('0x27')](function(_0x56698d){if(_0x56698d){_0x2ae4ee=_0x56698d['length'];if(!_0x46c7d9[_0x4113('0x3e')]['hasOwnProperty'](_0x4113('0x45'))){_0x821056[_0x4113('0x1f')]=qs[_0x4113('0x1f')](_0x46c7d9['query']['limit']);_0x821056[_0x4113('0x21')]=qs[_0x4113('0x21')](_0x46c7d9[_0x4113('0x3e')][_0x4113('0x21')]);}return _0x5c7955[_0x4113('0x96')](_0x821056);}})[_0x4113('0x27')](function(_0x5f07be){if(_0x5f07be){return _0x5f07be?{'count':_0x2ae4ee,'rows':_0x5f07be}:null;}})['then'](respondWithResult(_0x1c1d7f,null))[_0x4113('0x57')](handleError(_0x1c1d7f,null));};exports[_0x4113('0x97')]=function(_0x387983,_0x3057c1,_0x5872a5){var _0x52cfd2={};var _0x5c4f2c={};var _0x53b595;var _0x529aaa;return db[_0x4113('0x3b')]['findOne']({'where':{'id':_0x387983[_0x4113('0x63')]['id']}})['then'](handleEntityNotFound(_0x3057c1,null))['then'](function(_0x11ffa6){if(_0x11ffa6){_0x53b595=_0x11ffa6;_0x5c4f2c[_0x4113('0x3d')]=_[_0x4113('0x4f')](db[_0x4113('0x76')][_0x4113('0x3c')]);_0x5c4f2c[_0x4113('0x3e')]=_[_0x4113('0x4f')](_0x387983[_0x4113('0x3e')]);_0x5c4f2c['filters']=_[_0x4113('0x40')](_0x5c4f2c[_0x4113('0x3d')],_0x5c4f2c[_0x4113('0x3e')]);_0x52cfd2[_0x4113('0x42')]=_[_0x4113('0x40')](_0x5c4f2c['model'],qs[_0x4113('0x41')](_0x387983['query'][_0x4113('0x41')]));_0x52cfd2[_0x4113('0x42')]=_0x52cfd2[_0x4113('0x42')][_0x4113('0x43')]?_0x52cfd2[_0x4113('0x42')]:_0x5c4f2c[_0x4113('0x3d')];_0x52cfd2['order']=qs[_0x4113('0x47')](_0x387983['query'][_0x4113('0x47')]);_0x52cfd2[_0x4113('0x48')]=qs[_0x4113('0x3f')](_[_0x4113('0x49')](_0x387983['query'],_0x5c4f2c['filters']));if(_0x387983[_0x4113('0x3e')]['filter']){_0x52cfd2[_0x4113('0x48')]=_[_0x4113('0x4a')](_0x52cfd2['where'],{'$or':_['map'](_0x52cfd2[_0x4113('0x42')],function(_0x2b0739){var _0x5007b1={};_0x5007b1[_0x2b0739]={'$like':'%'+_0x387983[_0x4113('0x3e')]['filter']+'%'};return _0x5007b1;})});}_0x52cfd2=_['merge']({},_0x52cfd2,_0x387983[_0x4113('0x4c')]);return _0x53b595['getMembers'](_0x52cfd2);}})[_0x4113('0x27')](function(_0x5f0325){if(_0x5f0325){_0x529aaa=_0x5f0325[_0x4113('0x43')];if(!_0x387983['query'][_0x4113('0x44')](_0x4113('0x45'))){_0x52cfd2[_0x4113('0x1f')]=qs[_0x4113('0x1f')](_0x387983[_0x4113('0x3e')][_0x4113('0x1f')]);_0x52cfd2[_0x4113('0x21')]=qs['offset'](_0x387983['query'][_0x4113('0x21')]);}return _0x53b595[_0x4113('0x97')](_0x52cfd2);}})[_0x4113('0x27')](function(_0x5c10bd){return _0x5c10bd?{'count':_0x529aaa,'rows':_0x5c10bd}:null;})[_0x4113('0x27')](respondWithResult(_0x3057c1,null))[_0x4113('0x57')](handleError(_0x3057c1,null));};exports[_0x4113('0x98')]=function(_0x351321,_0x4f1868,_0x253693){var _0x35a762={};var _0x8b5f0b={};var _0x3af1ad;var _0x175b58;return db[_0x4113('0x3b')][_0x4113('0x5f')]({'where':{'id':_0x351321['params']['id']}})['then'](handleEntityNotFound(_0x4f1868,null))['then'](function(_0x14538c){if(_0x14538c){_0x3af1ad=_0x14538c;_0x8b5f0b['model']=_[_0x4113('0x4f')](db[_0x4113('0x99')][_0x4113('0x3c')]);_0x8b5f0b['query']=_[_0x4113('0x4f')](_0x351321[_0x4113('0x3e')]);_0x8b5f0b[_0x4113('0x3f')]=_['intersection'](_0x8b5f0b[_0x4113('0x3d')],_0x8b5f0b[_0x4113('0x3e')]);_0x35a762[_0x4113('0x42')]=_[_0x4113('0x40')](_0x8b5f0b['model'],qs[_0x4113('0x41')](_0x351321[_0x4113('0x3e')]['fields']));_0x35a762['attributes']=_0x35a762['attributes'][_0x4113('0x43')]?_0x35a762[_0x4113('0x42')]:_0x8b5f0b['model'];_0x35a762[_0x4113('0x46')]=qs[_0x4113('0x47')](_0x351321[_0x4113('0x3e')][_0x4113('0x47')]);_0x35a762[_0x4113('0x48')]=qs[_0x4113('0x3f')](_[_0x4113('0x49')](_0x351321[_0x4113('0x3e')],_0x8b5f0b['filters']));if(_0x351321[_0x4113('0x3e')][_0x4113('0x2e')]){_0x35a762[_0x4113('0x48')]=_['merge'](_0x35a762[_0x4113('0x48')],{'$or':_[_0x4113('0x30')](_0x35a762[_0x4113('0x42')],function(_0x1e2e69){var _0x3f5739={};_0x3f5739[_0x1e2e69]={'$like':'%'+_0x351321[_0x4113('0x3e')][_0x4113('0x2e')]+'%'};return _0x3f5739;})});}_0x35a762=_[_0x4113('0x4a')]({},_0x35a762,_0x351321['options']);return _0x3af1ad[_0x4113('0x98')](_0x35a762);}})[_0x4113('0x27')](function(_0x31e57e){if(_0x31e57e){_0x175b58=_0x31e57e[_0x4113('0x43')];if(!_0x351321[_0x4113('0x3e')][_0x4113('0x44')](_0x4113('0x45'))){_0x35a762['limit']=qs[_0x4113('0x1f')](_0x351321[_0x4113('0x3e')][_0x4113('0x1f')]);_0x35a762[_0x4113('0x21')]=qs[_0x4113('0x21')](_0x351321['query']['offset']);}return _0x3af1ad['getLists'](_0x35a762);}})['then'](function(_0x2379fb){if(_0x2379fb){return _0x2379fb?{'count':_0x175b58,'rows':_0x2379fb}:null;}})[_0x4113('0x27')](respondWithResult(_0x4f1868,null))[_0x4113('0x57')](handleError(_0x4f1868,null));};exports['addLists']=function(_0x9a91cb,_0x5711f6,_0x566233){var _0x4d2ced=moment()[_0x4113('0x94')](_0x4113('0x9a'));var _0x44fda7,_0x1845ec;return db[_0x4113('0x3b')]['find']({'where':{'id':_0x9a91cb[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x5711f6,null))[_0x4113('0x27')](function(_0x10027f){if(_0x10027f){_0x1845ec=_0x10027f;return _0x10027f[_0x4113('0x9b')](_0x9a91cb[_0x4113('0x5b')][_0x4113('0x7e')],_[_0x4113('0x58')](_0x9a91cb[_0x4113('0x5b')],[_0x4113('0x7e'),'id'])||{});}return null;})[_0x4113('0x92')](function(_0x19e6cb){var _0x1bc578;_0x44fda7=_0x19e6cb||[];var _0x392348=[];if(_0x19e6cb){for(var _0x5b0d96=0x0;_0x5b0d96<_0x19e6cb['length'];_0x5b0d96+=0x1){var _0x47a52b=_0x19e6cb[_0x5b0d96][_0x4113('0x29')]({'plain':!![]});_0x1845ec['dialCheckDuplicateType']=_0x9a91cb[_0x4113('0x5b')][_0x4113('0x9c')]?_0x9a91cb['body'][_0x4113('0x9c')]:_0x1845ec[_0x4113('0x9c')];switch(_0x1845ec[_0x4113('0x9c')]){case'always':_0x1bc578=squel[_0x4113('0x9d')]()[_0x4113('0x9e')](_0x4113('0x9f'))[_0x4113('0xa0')]([_0x4113('0xa1'),_0x4113('0xa2'),_0x4113('0xa3'),'ListId',_0x4113('0x61'),_0x4113('0x59'),'updatedAt'],squel[_0x4113('0xa4')]()[_0x4113('0x7f')](_0x4113('0xa1'),_0x4113('0xa1'))[_0x4113('0x7f')]('\x27'+_0x4d2ced+'\x27',_0x4113('0xa2'))[_0x4113('0x7f')]('id','ContactId')['field'](_0x47a52b[_0x4113('0xa5')][_0x4113('0x89')](),_0x4113('0xa6'))['field'](_0x9a91cb['params']['id'][_0x4113('0x89')](),_0x4113('0x61'))[_0x4113('0x7f')]('\x27'+_0x4d2ced+'\x27',_0x4113('0x59'))[_0x4113('0x7f')]('\x27'+_0x4d2ced+'\x27',_0x4113('0x5a'))[_0x4113('0x81')](_0x4113('0xa7'))[_0x4113('0x48')](_0x4113('0xa8'))[_0x4113('0x48')](_0x4113('0xa9'),_0x47a52b['CmListId'][_0x4113('0x89')]())[_0x4113('0x48')](_0x4113('0xaa'))[_0x4113('0x48')](_0x4113('0xab'),squel[_0x4113('0xa4')]()[_0x4113('0x7f')](_0x4113('0xac'))[_0x4113('0x81')](_0x4113('0xad'))[_0x4113('0x48')]('VoiceQueueId\x20=\x20?',_0x9a91cb[_0x4113('0x63')]['id'][_0x4113('0x89')]()))['where'](_0x4113('0xab'),squel['select']()[_0x4113('0x7f')](_0x4113('0xae'))[_0x4113('0x81')](_0x4113('0x9f'))[_0x4113('0x48')](_0x4113('0x86'),_0x9a91cb[_0x4113('0x63')]['id'][_0x4113('0x89')]())))['toString']();break;case _0x4113('0xaf'):_0x1bc578=squel[_0x4113('0x9d')]()[_0x4113('0x9e')](_0x4113('0x9f'))[_0x4113('0xa0')]([_0x4113('0xa1'),_0x4113('0xa2'),'ContactId',_0x4113('0xa6'),_0x4113('0x61'),'createdAt',_0x4113('0x5a')],squel[_0x4113('0xa4')]()[_0x4113('0x7f')](_0x4113('0xa1'),'phone')['field']('\x27'+_0x4d2ced+'\x27','scheduledAt')[_0x4113('0x7f')]('id','ContactId')[_0x4113('0x7f')](_0x47a52b[_0x4113('0xa5')][_0x4113('0x89')](),_0x4113('0xa6'))[_0x4113('0x7f')](_0x9a91cb[_0x4113('0x63')]['id'][_0x4113('0x89')](),_0x4113('0x61'))[_0x4113('0x7f')]('\x27'+_0x4d2ced+'\x27',_0x4113('0x59'))[_0x4113('0x7f')]('\x27'+_0x4d2ced+'\x27','updatedAt')[_0x4113('0x81')](_0x4113('0xa7'))['where'](_0x4113('0xa8'))[_0x4113('0x48')](_0x4113('0xa9'),_0x47a52b['CmListId']['toString']())[_0x4113('0x48')](_0x4113('0xaa'))['where'](_0x4113('0xab'),squel[_0x4113('0xa4')]()[_0x4113('0x7f')]('COALESCE(phone,\x27\x27)')[_0x4113('0x81')]('cm_hopper')[_0x4113('0x48')](_0x4113('0x86'),_0x9a91cb[_0x4113('0x63')]['id'][_0x4113('0x89')]())))[_0x4113('0x89')]();break;default:_0x1bc578=squel[_0x4113('0x9d')]()[_0x4113('0x9e')](_0x4113('0x9f'))[_0x4113('0xa0')](['phone',_0x4113('0xa2'),'ContactId','ListId','VoiceQueueId',_0x4113('0x59'),_0x4113('0x5a')],squel[_0x4113('0xa4')]()[_0x4113('0x7f')](_0x4113('0xa1'),_0x4113('0xa1'))['field']('\x27'+_0x4d2ced+'\x27',_0x4113('0xa2'))[_0x4113('0x7f')]('id',_0x4113('0xa3'))['field'](_0x47a52b['CmListId']['toString'](),'ListId')[_0x4113('0x7f')](_0x9a91cb['params']['id']['toString'](),_0x4113('0x61'))['field']('\x27'+_0x4d2ced+'\x27','createdAt')[_0x4113('0x7f')]('\x27'+_0x4d2ced+'\x27',_0x4113('0x5a'))[_0x4113('0x81')](_0x4113('0xa7'))[_0x4113('0x48')](_0x4113('0xa8'))[_0x4113('0x48')](_0x4113('0xa9'),_0x47a52b[_0x4113('0xa5')][_0x4113('0x89')]())[_0x4113('0x48')](_0x4113('0xaa')))['toString']();}_0x392348['push'](db[_0x4113('0x71')][_0x4113('0x3e')](_0x1bc578));}return BPromise[_0x4113('0x8d')](_0x392348);}})[_0x4113('0x27')](function(){var _0x109263=[];var _0xdf2b91=squel['insert']()[_0x4113('0x9e')](_0x4113('0xb0'))[_0x4113('0xa0')]([_0x4113('0xb1'),_0x4113('0xa1'),_0x4113('0xb2'),_0x4113('0x59'),_0x4113('0x5a')],squel['select']()['field'](_0x4113('0xb3'))[_0x4113('0x7f')]('ci.item')['field']('ci.OrderBy+1')['field']('\x27'+_0x4d2ced+'\x27','createdAt')[_0x4113('0x7f')]('\x27'+_0x4d2ced+'\x27',_0x4113('0x5a'))['from'](_0x4113('0xb4'),'ci')['join']('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x4113('0x48')](_0x4113('0xb5'),_0x4d2ced)[_0x4113('0x48')](_0x4113('0xb6'),_0x4113('0xb7')))['toString']();_0x109263[_0x4113('0x93')](db['sequelize']['query'](_0xdf2b91));return BPromise[_0x4113('0x8d')](_0x109263);})[_0x4113('0x27')](function(){return _0x44fda7;})[_0x4113('0x27')](respondWithResult(_0x5711f6,null))['catch'](handleError(_0x5711f6,null));};exports[_0x4113('0xb8')]=function(_0x353018,_0x5e2551,_0x1930f3){return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x353018['params']['id']}})['then'](handleEntityNotFound(_0x5e2551,null))[_0x4113('0x27')](function(_0x152346){if(_0x152346){return _0x152346[_0x4113('0xb8')](_0x353018[_0x4113('0x3e')]['ids']);}})[_0x4113('0x27')](function(_0x410132){if(_0x410132){return db[_0x4113('0x60')][_0x4113('0x28')]({'where':{'ListId':_0x353018[_0x4113('0x3e')][_0x4113('0x7e')],'VoiceQueueId':_0x353018[_0x4113('0x63')]['id']}})[_0x4113('0x27')](function(){return _0x410132;});}})['then'](respondWithStatusCode(_0x5e2551,null))['catch'](handleError(_0x5e2551,null));};exports[_0x4113('0xb9')]=function(_0x404a6e,_0x41178d,_0x65ac51){var _0x36456c={};var _0x1c3bbe={};var _0x44b2cc;var _0x1a614c;return db[_0x4113('0x3b')][_0x4113('0x5f')]({'where':{'id':_0x404a6e[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x41178d,null))[_0x4113('0x27')](function(_0x3c4846){if(_0x3c4846){_0x44b2cc=_0x3c4846;_0x1c3bbe[_0x4113('0x3d')]=_['keys'](db[_0x4113('0x99')][_0x4113('0x3c')]);_0x1c3bbe[_0x4113('0x3e')]=_['keys'](_0x404a6e[_0x4113('0x3e')]);_0x1c3bbe[_0x4113('0x3f')]=_[_0x4113('0x40')](_0x1c3bbe[_0x4113('0x3d')],_0x1c3bbe[_0x4113('0x3e')]);_0x36456c['attributes']=_[_0x4113('0x40')](_0x1c3bbe['model'],qs[_0x4113('0x41')](_0x404a6e[_0x4113('0x3e')]['fields']));_0x36456c['attributes']=_0x36456c[_0x4113('0x42')][_0x4113('0x43')]?_0x36456c[_0x4113('0x42')]:_0x1c3bbe[_0x4113('0x3d')];_0x36456c[_0x4113('0x46')]=qs['sort'](_0x404a6e['query'][_0x4113('0x47')]);_0x36456c['where']=qs[_0x4113('0x3f')](_[_0x4113('0x49')](_0x404a6e['query'],_0x1c3bbe[_0x4113('0x3f')]));if(_0x404a6e[_0x4113('0x3e')][_0x4113('0x2e')]){_0x36456c[_0x4113('0x48')]=_[_0x4113('0x4a')](_0x36456c['where'],{'$or':_[_0x4113('0x30')](_0x36456c['attributes'],function(_0x45a5d3){var _0x120f37={};_0x120f37[_0x45a5d3]={'$like':'%'+_0x404a6e[_0x4113('0x3e')][_0x4113('0x2e')]+'%'};return _0x120f37;})});}_0x36456c=_[_0x4113('0x4a')]({},_0x36456c,_0x404a6e[_0x4113('0x4c')]);return _0x44b2cc[_0x4113('0xb9')](_0x36456c);}})[_0x4113('0x27')](function(_0x3076fd){if(_0x3076fd){_0x1a614c=_0x3076fd['length'];if(!_0x404a6e['query']['hasOwnProperty'](_0x4113('0x45'))){_0x36456c[_0x4113('0x1f')]=qs[_0x4113('0x1f')](_0x404a6e['query'][_0x4113('0x1f')]);_0x36456c[_0x4113('0x21')]=qs[_0x4113('0x21')](_0x404a6e[_0x4113('0x3e')][_0x4113('0x21')]);}return _0x44b2cc[_0x4113('0xb9')](_0x36456c);}})[_0x4113('0x27')](function(_0x195b00){if(_0x195b00){return _0x195b00?{'count':_0x1a614c,'rows':_0x195b00}:null;}})[_0x4113('0x27')](respondWithResult(_0x41178d,null))[_0x4113('0x57')](handleError(_0x41178d,null));};exports[_0x4113('0xba')]=function(_0x1d6a99,_0x20dc4c,_0x1878ca){var _0x3b2db8,_0x47bab3;return db['VoiceQueue'][_0x4113('0x34')]({'where':{'id':_0x1d6a99['params']['id']}})['then'](handleEntityNotFound(_0x20dc4c,null))[_0x4113('0x27')](function(_0x331df7){if(_0x331df7){_0x47bab3=_0x331df7;return _0x331df7['addBlackLists'](_0x1d6a99['body'][_0x4113('0x7e')],_['omit'](_0x1d6a99[_0x4113('0x5b')],[_0x4113('0x7e'),'id'])||{});}return null;})[_0x4113('0x92')](function(_0x58c3e5){var _0x5ea49b;_0x3b2db8=_0x58c3e5||[];var _0x146481=[];if(_0x58c3e5){for(var _0x49dc41=0x0;_0x49dc41<_0x58c3e5[_0x4113('0x43')];_0x49dc41+=0x1){var _0x35b845=_0x58c3e5[_0x49dc41][_0x4113('0x29')]({'plain':!![]});_0x5ea49b=squel['insert']()[_0x4113('0x9e')](_0x4113('0xbb'))[_0x4113('0xa0')]([_0x4113('0xa1'),'ContactId',_0x4113('0xa6'),_0x4113('0x61'),_0x4113('0x59'),_0x4113('0x5a')],squel['select']()[_0x4113('0x7f')](_0x4113('0xa1'),'phone')['field']('id','ContactId')[_0x4113('0x7f')](_0x35b845[_0x4113('0xa5')][_0x4113('0x89')](),'ListId')[_0x4113('0x7f')](_0x1d6a99[_0x4113('0x63')]['id']['toString'](),_0x4113('0x61'))[_0x4113('0x7f')]('NOW()',_0x4113('0x59'))['field'](_0x4113('0xbc'),'updatedAt')[_0x4113('0x81')](_0x4113('0xa7'))[_0x4113('0x48')]('deletedAt\x20IS\x20NULL')[_0x4113('0x48')](_0x4113('0xa9'),_0x35b845[_0x4113('0xa5')][_0x4113('0x89')]())[_0x4113('0x48')](_0x4113('0xaa')))[_0x4113('0x89')]();_0x146481[_0x4113('0x93')](db[_0x4113('0x71')]['query'](_0x5ea49b));}return BPromise[_0x4113('0x8d')](_0x146481);}})[_0x4113('0x27')](function(){return _0x3b2db8;})[_0x4113('0x27')](respondWithResult(_0x20dc4c,null))['catch'](handleError(_0x20dc4c,null));};exports[_0x4113('0xbd')]=function(_0x36c5c2,_0x171776,_0x707f8b){return db[_0x4113('0x3b')][_0x4113('0x34')]({'where':{'id':_0x36c5c2[_0x4113('0x63')]['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x171776,null))[_0x4113('0x27')](function(_0x3e2065){if(_0x3e2065){return _0x3e2065[_0x4113('0xbd')](_0x36c5c2[_0x4113('0x3e')][_0x4113('0x7e')]);}})[_0x4113('0x27')](function(_0x5b7927){if(_0x5b7927){return db[_0x4113('0xbe')][_0x4113('0x28')]({'where':{'ListId':_0x36c5c2[_0x4113('0x3e')][_0x4113('0x7e')],'VoiceQueueId':_0x36c5c2[_0x4113('0x63')]['id']}})[_0x4113('0x27')](function(){return _0x5b7927;});}})[_0x4113('0x27')](respondWithStatusCode(_0x171776,null))[_0x4113('0x57')](handleError(_0x171776,null));}; \ No newline at end of file +var _0xb0e5=['CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','CmListId','toString','ListId','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)','onlyIfOpen','into','push','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','findAll','catch','params','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','createdAt','autoAssociation','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','rows','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','emit','removeTeams','ids','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','SELECT','every','all','union','isEmpty','UserVoiceQueueRt','addAgents','omit','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists'];(function(_0x352e74,_0x333cd4){var _0x22569c=function(_0x5a433c){while(--_0x5a433c){_0x352e74['push'](_0x352e74['shift']());}};_0x22569c(++_0x333cd4);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x3165ab,_0x49ab2b){_0x3165ab=_0x3165ab-0x0;var _0x1b49d4=_0xb0e5[_0x3165ab];return _0x1b49d4;};'use strict';var emlformat=require(_0x5b0e('0x0'));var rimraf=require(_0x5b0e('0x1'));var zipdir=require(_0x5b0e('0x2'));var jsonpatch=require(_0x5b0e('0x3'));var rp=require(_0x5b0e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b0e('0x5'));var util=require('util');var path=require(_0x5b0e('0x6'));var sox=require('sox');var csv=require(_0x5b0e('0x7'));var ejs=require(_0x5b0e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b0e('0x9'));var crypto=require(_0x5b0e('0xa'));var jsforce=require(_0x5b0e('0xb'));var deskjs=require(_0x5b0e('0xc'));var toCsv=require(_0x5b0e('0x7'));var querystring=require(_0x5b0e('0xd'));var Papa=require(_0x5b0e('0xe'));var Redis=require(_0x5b0e('0xf'));var authService=require(_0x5b0e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5b0e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5b0e('0x12'));var utils=require(_0x5b0e('0x13'));var config=require(_0x5b0e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b0e('0x15'))['db'];config['redis']=_['defaults'](config[_0x5b0e('0x16')],{'host':_0x5b0e('0x17'),'port':0x18eb});var socket=require(_0x5b0e('0x18'))(new Redis(config[_0x5b0e('0x16')]));require(_0x5b0e('0x19'))[_0x5b0e('0x1a')](socket);function respondWithStatusCode(_0x3d2606,_0x10d243){_0x10d243=_0x10d243||0xcc;return function(_0x1e961b){if(_0x1e961b){return _0x3d2606[_0x5b0e('0x1b')](_0x10d243);}return _0x3d2606[_0x5b0e('0x1c')](_0x10d243)[_0x5b0e('0x1d')]();};}function respondWithResult(_0x3fe6cc,_0x438563){_0x438563=_0x438563||0xc8;return function(_0x650ade){if(_0x650ade){return _0x3fe6cc[_0x5b0e('0x1c')](_0x438563)[_0x5b0e('0x1e')](_0x650ade);}};}function respondWithFilteredResult(_0x22036a,_0x18e4d8){return function(_0x3c876a){if(_0x3c876a){var _0x295714=typeof _0x18e4d8[_0x5b0e('0x1f')]==='undefined'&&typeof _0x18e4d8['limit']===_0x5b0e('0x20');var _0x211053=_0x3c876a[_0x5b0e('0x21')];var _0x4d26a7=_0x295714?0x0:_0x18e4d8['offset'];var _0x26908b=_0x295714?_0x3c876a['count']:_0x18e4d8[_0x5b0e('0x1f')]+_0x18e4d8[_0x5b0e('0x22')];var _0x10cc05;if(_0x26908b>=_0x211053){_0x26908b=_0x211053;_0x10cc05=0xc8;}else{_0x10cc05=0xce;}_0x22036a[_0x5b0e('0x1c')](_0x10cc05);return _0x22036a['set']('Content-Range',_0x4d26a7+'-'+_0x26908b+'/'+_0x211053)['json'](_0x3c876a);}return null;};}function patchUpdates(_0x497aa2){return function(_0x4384a9){try{jsonpatch[_0x5b0e('0x23')](_0x4384a9,_0x497aa2,!![]);}catch(_0x3662fc){return BPromise[_0x5b0e('0x24')](_0x3662fc);}return _0x4384a9[_0x5b0e('0x25')]();};}function saveUpdates(_0x496624,_0x35b954){return function(_0x566d7d){if(_0x566d7d){return _0x566d7d[_0x5b0e('0x26')](_0x496624)[_0x5b0e('0x27')](function(_0x22f0fd){return _0x22f0fd;});}return null;};}function removeEntity(_0x4a2abf,_0x341476){return function(_0x2cc27c){if(_0x2cc27c){return _0x2cc27c[_0x5b0e('0x28')]()[_0x5b0e('0x27')](function(){var _0x3b9321=_0x2cc27c[_0x5b0e('0x29')]({'plain':!![]});var _0x1e8971=[{'name':_0x5b0e('0x2a'),'value':_0x5b0e('0x2b'),'ignore':![]},{'name':_0x5b0e('0x2c'),'value':_0x5b0e('0x2d'),'ignore':![]}];var _0x3587e7=_(_0x1e8971)[_0x5b0e('0x2e')](_0x5b0e('0x2f'))[_0x5b0e('0x30')](_0x5b0e('0x31'))['value']();if(_[_0x5b0e('0x32')](_0x3587e7,_0x3b9321[_0x5b0e('0x33')])){return;}var _0x36fe50=_[_0x5b0e('0x34')](_0x1e8971,[_0x5b0e('0x31'),_0x3b9321['type']])[_0x5b0e('0x35')];return db[_0x5b0e('0x36')][_0x5b0e('0x28')]({'where':{'type':_0x36fe50,'resourceId':_0x3b9321['id']}})[_0x5b0e('0x27')](function(){return _0x2cc27c;});})[_0x5b0e('0x27')](function(){_0x4a2abf[_0x5b0e('0x1c')](0xcc)[_0x5b0e('0x1d')]();});}};}function handleEntityNotFound(_0x506d0c,_0x154f0d){return function(_0x2ff8f8){if(!_0x2ff8f8){_0x506d0c['sendStatus'](0x194);}return _0x2ff8f8;};}function handleError(_0x1f03b3,_0xae2102){_0xae2102=_0xae2102||0x1f4;return function(_0x13747d){logger[_0x5b0e('0x37')](_0x13747d[_0x5b0e('0x38')]);if(_0x13747d[_0x5b0e('0x35')]){delete _0x13747d[_0x5b0e('0x35')];}_0x1f03b3[_0x5b0e('0x1c')](_0xae2102)[_0x5b0e('0x39')](_0x13747d);};}exports[_0x5b0e('0x3a')]=function(_0x34c7fc,_0x5c6fe4){var _0x414d13={},_0xf1eed9={},_0x39719e={'count':0x0,'rows':[]};var _0x3d04ce=_[_0x5b0e('0x30')](db[_0x5b0e('0x3b')][_0x5b0e('0x3c')],function(_0x147662){return{'name':_0x147662[_0x5b0e('0x3d')],'type':_0x147662[_0x5b0e('0x33')][_0x5b0e('0x3e')]};});_0xf1eed9['model']=_[_0x5b0e('0x30')](_0x3d04ce,'name');_0xf1eed9[_0x5b0e('0x3f')]=_[_0x5b0e('0x40')](_0x34c7fc['query']);_0xf1eed9[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0xf1eed9[_0x5b0e('0x43')],_0xf1eed9[_0x5b0e('0x3f')]);_0x414d13['attributes']=_[_0x5b0e('0x42')](_0xf1eed9[_0x5b0e('0x43')],qs[_0x5b0e('0x44')](_0x34c7fc[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0x414d13[_0x5b0e('0x45')]=_0x414d13[_0x5b0e('0x45')]['length']?_0x414d13[_0x5b0e('0x45')]:_0xf1eed9['model'];if(!_0x34c7fc[_0x5b0e('0x3f')][_0x5b0e('0x46')](_0x5b0e('0x47'))){_0x414d13[_0x5b0e('0x22')]=qs[_0x5b0e('0x22')](_0x34c7fc[_0x5b0e('0x3f')][_0x5b0e('0x22')]);_0x414d13[_0x5b0e('0x1f')]=qs[_0x5b0e('0x1f')](_0x34c7fc['query'][_0x5b0e('0x1f')]);}_0x414d13[_0x5b0e('0x48')]=qs[_0x5b0e('0x49')](_0x34c7fc[_0x5b0e('0x3f')][_0x5b0e('0x49')]);_0x414d13['where']=qs['filters'](_[_0x5b0e('0x4a')](_0x34c7fc[_0x5b0e('0x3f')],_0xf1eed9[_0x5b0e('0x41')]),_0x3d04ce);if(_0x34c7fc[_0x5b0e('0x3f')]['filter']){_0x414d13[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x414d13['where'],{'$or':_[_0x5b0e('0x30')](_0x3d04ce,function(_0x438afb){if(_0x438afb[_0x5b0e('0x33')]!=='VIRTUAL'){var _0x7d1af0={};_0x7d1af0[_0x438afb[_0x5b0e('0x35')]]={'$like':'%'+_0x34c7fc[_0x5b0e('0x3f')]['filter']+'%'};return _0x7d1af0;}})});}_0x414d13=_[_0x5b0e('0x4c')]({},_0x414d13,_0x34c7fc[_0x5b0e('0x4d')]);var _0x40c3a4={'where':_0x414d13['where']};return db[_0x5b0e('0x3b')]['count'](_0x40c3a4)[_0x5b0e('0x27')](function(_0x2f5c5e){_0x39719e[_0x5b0e('0x21')]=_0x2f5c5e;if(_0x34c7fc[_0x5b0e('0x3f')][_0x5b0e('0x4e')]){_0x414d13['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x5b0e('0x4f')](_0x414d13);})[_0x5b0e('0x27')](function(_0x546ae3){_0x39719e['rows']=_0x546ae3;return _0x39719e;})[_0x5b0e('0x27')](respondWithFilteredResult(_0x5c6fe4,_0x414d13))[_0x5b0e('0x50')](handleError(_0x5c6fe4,null));};exports['show']=function(_0x2af26b,_0x3543fa){var _0x132863={'raw':![],'where':{'id':_0x2af26b[_0x5b0e('0x51')]['id']}},_0x5afcac={};_0x5afcac['model']=_[_0x5b0e('0x40')](db[_0x5b0e('0x3b')][_0x5b0e('0x3c')]);_0x5afcac[_0x5b0e('0x3f')]=_['keys'](_0x2af26b['query']);_0x5afcac[_0x5b0e('0x41')]=_['intersection'](_0x5afcac[_0x5b0e('0x43')],_0x5afcac['query']);_0x132863[_0x5b0e('0x45')]=_[_0x5b0e('0x42')](_0x5afcac[_0x5b0e('0x43')],qs[_0x5b0e('0x44')](_0x2af26b[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0x132863[_0x5b0e('0x45')]=_0x132863['attributes'][_0x5b0e('0x52')]?_0x132863[_0x5b0e('0x45')]:_0x5afcac[_0x5b0e('0x43')];if(_0x2af26b[_0x5b0e('0x3f')][_0x5b0e('0x4e')]){_0x132863[_0x5b0e('0x53')]=[{'all':!![]}];}_0x132863=_[_0x5b0e('0x4c')]({},_0x132863,_0x2af26b['options']);return db[_0x5b0e('0x3b')][_0x5b0e('0x34')](_0x132863)[_0x5b0e('0x27')](handleEntityNotFound(_0x3543fa,null))[_0x5b0e('0x27')](respondWithResult(_0x3543fa,null))[_0x5b0e('0x50')](handleError(_0x3543fa,null));};exports[_0x5b0e('0x54')]=function(_0x510c92,_0x51c7f0){return db[_0x5b0e('0x3b')][_0x5b0e('0x54')](_0x510c92['body'],{})['then'](function(_0x4fbcec){var _0xd7b35=_0x510c92[_0x5b0e('0x55')]['get']({'plain':!![]});if(!_0xd7b35)throw new Error(_0x5b0e('0x56'));if(_0xd7b35[_0x5b0e('0x57')]==='user'){var _0x3b0d97=_0x4fbcec[_0x5b0e('0x29')]({'plain':!![]});var _0x404061=[{'name':_0x5b0e('0x2a'),'value':_0x5b0e('0x2b')},{'name':'QueueCampaigns','value':_0x5b0e('0x2d')}];var _0x1bcc1b=_[_0x5b0e('0x34')](_0x404061,[_0x5b0e('0x31'),_0x3b0d97[_0x5b0e('0x33')]])[_0x5b0e('0x35')];return db[_0x5b0e('0x58')][_0x5b0e('0x34')]({'where':{'name':_0x1bcc1b,'userProfileId':_0xd7b35[_0x5b0e('0x59')]},'raw':!![]})[_0x5b0e('0x27')](function(_0x20e3db){if(_0x20e3db&&_0x20e3db['autoAssociation']===0x0){return db['UserProfileResource'][_0x5b0e('0x54')]({'name':_0x3b0d97['name'],'resourceId':_0x3b0d97['id'],'type':_0x20e3db[_0x5b0e('0x35')],'sectionId':_0x20e3db['id']},{})[_0x5b0e('0x27')](function(){return _0x4fbcec;});}else{return _0x4fbcec;}})['catch'](function(_0x3bfc09){logger['error'](_0x5b0e('0x5a'),_0x3bfc09);throw _0x3bfc09;});}return _0x4fbcec;})[_0x5b0e('0x27')](respondWithResult(_0x51c7f0,0xc9))[_0x5b0e('0x50')](handleError(_0x51c7f0,null));};exports[_0x5b0e('0x5b')]=function(_0x17eb31,_0x29fab9){var _0xf8c5d1={'where':{'id':_0x17eb31[_0x5b0e('0x51')]['id']}},_0x382a1b={};_0x382a1b[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db[_0x5b0e('0x3b')][_0x5b0e('0x3c')]);_0xf8c5d1[_0x5b0e('0x45')]=_[_0x5b0e('0x42')](_0x382a1b[_0x5b0e('0x43')],qs[_0x5b0e('0x44')](_0x17eb31[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0xf8c5d1['attributes']=_0xf8c5d1[_0x5b0e('0x45')]['length']?_0xf8c5d1[_0x5b0e('0x45')]:_0x382a1b['model'];if(_0x17eb31[_0x5b0e('0x3f')][_0x5b0e('0x4e')]){_0xf8c5d1[_0x5b0e('0x53')]=[{'all':!![]}];}_0xf8c5d1=_['merge']({},_0xf8c5d1,_0x17eb31[_0x5b0e('0x4d')]);return db[_0x5b0e('0x3b')][_0x5b0e('0x34')](_0xf8c5d1)['then'](handleEntityNotFound(_0x29fab9,null))[_0x5b0e('0x27')](function(_0x571d1c){if(_0x571d1c){var _0x5cef4f=_0x571d1c[_0x5b0e('0x29')]({'plain':!![]});_0x5cef4f=qs['omit'](_0x5cef4f,['id','createdAt',_0x5b0e('0x5c')]);_0x17eb31[_0x5b0e('0x5d')]=_['omit'](_0x17eb31[_0x5b0e('0x5d')],['id',_0x5b0e('0x5e'),'updatedAt']);return db[_0x5b0e('0x3b')][_0x5b0e('0x54')](_[_0x5b0e('0x4c')](_0x5cef4f,_0x17eb31[_0x5b0e('0x5d')]),{'include':_0x17eb31[_0x5b0e('0x3f')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x35de63){var _0x309e61=_0x17eb31[_0x5b0e('0x55')][_0x5b0e('0x29')]({'plain':!![]});if(!_0x309e61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x309e61[_0x5b0e('0x57')]===_0x5b0e('0x55')){var _0x3f7645=_0x35de63[_0x5b0e('0x29')]({'plain':!![]});var _0x5b9582=[{'name':'VoiceQueues','value':_0x5b0e('0x2b')},{'name':_0x5b0e('0x2c'),'value':'outbound'}];var _0x83fd1d=_[_0x5b0e('0x34')](_0x5b9582,[_0x5b0e('0x31'),_0x3f7645[_0x5b0e('0x33')]])[_0x5b0e('0x35')];return db[_0x5b0e('0x58')][_0x5b0e('0x34')]({'where':{'name':_0x83fd1d,'userProfileId':_0x309e61['userProfileId']},'raw':!![]})[_0x5b0e('0x27')](function(_0x22f63a){if(_0x22f63a&&_0x22f63a[_0x5b0e('0x5f')]===0x0){return db[_0x5b0e('0x36')]['create']({'name':_0x3f7645[_0x5b0e('0x35')],'resourceId':_0x3f7645['id'],'type':_0x22f63a[_0x5b0e('0x35')],'sectionId':_0x22f63a['id']},{})[_0x5b0e('0x27')](function(){return _0x35de63;});}else{return _0x35de63;}})[_0x5b0e('0x50')](function(_0x257509){logger['error'](_0x5b0e('0x5a'),_0x257509);throw _0x257509;});}return _0x35de63;});}})[_0x5b0e('0x27')](respondWithResult(_0x29fab9,0xc9))['catch'](handleError(_0x29fab9,null));};exports['update']=function(_0x41c2a2,_0xabe7c3){if(_0x41c2a2['body']['id']){delete _0x41c2a2[_0x5b0e('0x5d')]['id'];}return db[_0x5b0e('0x3b')][_0x5b0e('0x34')]({'where':{'id':_0x41c2a2[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0xabe7c3,null))['then'](saveUpdates(_0x41c2a2['body'],null))[_0x5b0e('0x27')](respondWithResult(_0xabe7c3,null))[_0x5b0e('0x50')](handleError(_0xabe7c3,null));};exports[_0x5b0e('0x28')]=function(_0x8230bb,_0x39c29f){return db[_0x5b0e('0x3b')]['find']({'where':{'id':_0x8230bb[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x39c29f,null))[_0x5b0e('0x27')](removeEntity(_0x39c29f,null))[_0x5b0e('0x50')](handleError(_0x39c29f,null));};exports[_0x5b0e('0x60')]=function(_0xe588e7,_0x2c34b9,_0x133f30){var _0x263d06={'raw':![],'where':{}};var _0x2736de={};var _0x32f319={'count':0x0,'rows':[]};return db[_0x5b0e('0x3b')][_0x5b0e('0x61')]({'where':{'id':_0xe588e7[_0x5b0e('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c34b9,null))[_0x5b0e('0x27')](function(_0x4e5b8f){if(_0x4e5b8f){_0x2736de[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db[_0x5b0e('0x62')]['rawAttributes']);_0x2736de['query']=_[_0x5b0e('0x40')](_0xe588e7[_0x5b0e('0x3f')]);_0x2736de[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0x2736de[_0x5b0e('0x43')],_0x2736de[_0x5b0e('0x3f')]);_0x263d06['attributes']=_[_0x5b0e('0x42')](_0x2736de[_0x5b0e('0x43')],qs['fields'](_0xe588e7['query'][_0x5b0e('0x44')]));_0x263d06[_0x5b0e('0x45')]=_0x263d06[_0x5b0e('0x45')]['length']?_0x263d06['attributes']:_0x2736de[_0x5b0e('0x43')];if(!_0xe588e7[_0x5b0e('0x3f')]['hasOwnProperty'](_0x5b0e('0x47'))){_0x263d06[_0x5b0e('0x22')]=qs[_0x5b0e('0x22')](_0xe588e7['query'][_0x5b0e('0x22')]);_0x263d06[_0x5b0e('0x1f')]=qs[_0x5b0e('0x1f')](_0xe588e7[_0x5b0e('0x3f')][_0x5b0e('0x1f')]);}_0x263d06['order']=qs['sort'](_0xe588e7[_0x5b0e('0x3f')][_0x5b0e('0x49')]);_0x263d06[_0x5b0e('0x4b')]=qs[_0x5b0e('0x41')](_['pick'](_0xe588e7['query'],_0x2736de[_0x5b0e('0x41')]));_0x263d06[_0x5b0e('0x4b')][_0x5b0e('0x63')]=_0x4e5b8f['id'];if(_0xe588e7['query'][_0x5b0e('0x2e')]){_0x263d06[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x263d06[_0x5b0e('0x4b')],{'$or':_[_0x5b0e('0x30')](_0x263d06[_0x5b0e('0x45')],function(_0x5396ef){var _0xaf8310={};_0xaf8310[_0x5396ef]={'$like':'%'+_0xe588e7['query']['filter']+'%'};return _0xaf8310;})});}_0x263d06=_[_0x5b0e('0x4c')]({},_0x263d06,_0xe588e7[_0x5b0e('0x4d')]);return db['CmHopper'][_0x5b0e('0x21')]({'where':_0x263d06[_0x5b0e('0x4b')]})[_0x5b0e('0x27')](function(_0x436478){_0x32f319[_0x5b0e('0x21')]=_0x436478;if(_0xe588e7[_0x5b0e('0x3f')][_0x5b0e('0x4e')]){_0x263d06[_0x5b0e('0x53')]=[{'all':!![]}];}return db[_0x5b0e('0x62')][_0x5b0e('0x4f')](_0x263d06);})[_0x5b0e('0x27')](function(_0x325b38){_0x32f319['rows']=_0x325b38;return _0x32f319;});}})[_0x5b0e('0x27')](respondWithFilteredResult(_0x2c34b9,_0x263d06))['catch'](handleError(_0x2c34b9,null));};exports[_0x5b0e('0x64')]=function(_0x2f9e15,_0x55d8e2,_0x2ae341){var _0x1510a9={'raw':!![],'where':{}};var _0x2b4b2b={};var _0x36a736={'count':0x0,'rows':[]};return db[_0x5b0e('0x3b')][_0x5b0e('0x61')]({'where':{'id':_0x2f9e15['params']['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x55d8e2,null))[_0x5b0e('0x27')](function(_0x4446fd){if(_0x4446fd){_0x2b4b2b[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db[_0x5b0e('0x65')][_0x5b0e('0x3c')]);_0x2b4b2b[_0x5b0e('0x3f')]=_[_0x5b0e('0x40')](_0x2f9e15['query']);_0x2b4b2b[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0x2b4b2b['model'],_0x2b4b2b['query']);_0x1510a9[_0x5b0e('0x45')]=_[_0x5b0e('0x42')](_0x2b4b2b[_0x5b0e('0x43')],qs['fields'](_0x2f9e15[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0x1510a9[_0x5b0e('0x45')]=_0x1510a9[_0x5b0e('0x45')][_0x5b0e('0x52')]?_0x1510a9[_0x5b0e('0x45')]:_0x2b4b2b[_0x5b0e('0x43')];if(!_0x2f9e15['query'][_0x5b0e('0x46')](_0x5b0e('0x47'))){_0x1510a9[_0x5b0e('0x22')]=qs['limit'](_0x2f9e15[_0x5b0e('0x3f')][_0x5b0e('0x22')]);_0x1510a9[_0x5b0e('0x1f')]=qs[_0x5b0e('0x1f')](_0x2f9e15[_0x5b0e('0x3f')][_0x5b0e('0x1f')]);}_0x1510a9['order']=qs[_0x5b0e('0x49')](_0x2f9e15[_0x5b0e('0x3f')]['sort']);_0x1510a9[_0x5b0e('0x4b')]=qs['filters'](_[_0x5b0e('0x4a')](_0x2f9e15[_0x5b0e('0x3f')],_0x2b4b2b[_0x5b0e('0x41')]));_0x1510a9[_0x5b0e('0x4b')]['VoiceQueueId']=_0x4446fd['id'];if(_0x2f9e15[_0x5b0e('0x3f')][_0x5b0e('0x2e')]){_0x1510a9[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x1510a9[_0x5b0e('0x4b')],{'$or':_[_0x5b0e('0x30')](_0x1510a9['attributes'],function(_0x54b330){var _0x17a4fc={};_0x17a4fc[_0x54b330]={'$like':'%'+_0x2f9e15[_0x5b0e('0x3f')][_0x5b0e('0x2e')]+'%'};return _0x17a4fc;})});}_0x1510a9=_['merge']({},_0x1510a9,_0x2f9e15[_0x5b0e('0x4d')]);return db[_0x5b0e('0x65')][_0x5b0e('0x21')]({'where':_0x1510a9['where']})[_0x5b0e('0x27')](function(_0x5cafe2){_0x36a736[_0x5b0e('0x21')]=_0x5cafe2;if(_0x2f9e15[_0x5b0e('0x3f')][_0x5b0e('0x4e')]){_0x1510a9[_0x5b0e('0x53')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5b0e('0x4f')](_0x1510a9);})['then'](function(_0x588078){_0x36a736['rows']=_0x588078;return _0x36a736;});}})[_0x5b0e('0x27')](respondWithFilteredResult(_0x55d8e2,_0x1510a9))['catch'](handleError(_0x55d8e2,null));};exports['getHopperFinals']=function(_0x34b020,_0xd965ae,_0x207a5a){var _0x11ebbb={'raw':!![],'where':{}};var _0x50511a={};var _0x4cbb46={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5b0e('0x61')]({'where':{'id':_0x34b020[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0xd965ae,null))[_0x5b0e('0x27')](function(_0x2bc2de){if(_0x2bc2de){_0x50511a[_0x5b0e('0x43')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x50511a['query']=_['keys'](_0x34b020[_0x5b0e('0x3f')]);_0x50511a[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0x50511a[_0x5b0e('0x43')],_0x50511a[_0x5b0e('0x3f')]);_0x11ebbb[_0x5b0e('0x45')]=_['intersection'](_0x50511a['model'],qs[_0x5b0e('0x44')](_0x34b020[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0x11ebbb[_0x5b0e('0x45')]=_0x11ebbb[_0x5b0e('0x45')]['length']?_0x11ebbb[_0x5b0e('0x45')]:_0x50511a['model'];if(!_0x34b020[_0x5b0e('0x3f')]['hasOwnProperty'](_0x5b0e('0x47'))){_0x11ebbb['limit']=qs[_0x5b0e('0x22')](_0x34b020[_0x5b0e('0x3f')]['limit']);_0x11ebbb[_0x5b0e('0x1f')]=qs[_0x5b0e('0x1f')](_0x34b020[_0x5b0e('0x3f')][_0x5b0e('0x1f')]);}_0x11ebbb[_0x5b0e('0x48')]=qs['sort'](_0x34b020[_0x5b0e('0x3f')][_0x5b0e('0x49')]);_0x11ebbb[_0x5b0e('0x4b')]=qs[_0x5b0e('0x41')](_[_0x5b0e('0x4a')](_0x34b020['query'],_0x50511a[_0x5b0e('0x41')]));_0x11ebbb[_0x5b0e('0x4b')][_0x5b0e('0x63')]=_0x2bc2de['id'];if(_0x34b020[_0x5b0e('0x3f')][_0x5b0e('0x2e')]){_0x11ebbb[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x11ebbb[_0x5b0e('0x4b')],{'$or':_[_0x5b0e('0x30')](_0x11ebbb['attributes'],function(_0x4b3ec7){var _0x5e62b6={};_0x5e62b6[_0x4b3ec7]={'$like':'%'+_0x34b020[_0x5b0e('0x3f')][_0x5b0e('0x2e')]+'%'};return _0x5e62b6;})});}_0x11ebbb=_[_0x5b0e('0x4c')]({},_0x11ebbb,_0x34b020[_0x5b0e('0x4d')]);return db[_0x5b0e('0x66')][_0x5b0e('0x21')]({'where':_0x11ebbb[_0x5b0e('0x4b')]})[_0x5b0e('0x27')](function(_0x58bc4a){_0x4cbb46[_0x5b0e('0x21')]=_0x58bc4a;if(_0x34b020['query']['includeAll']){_0x11ebbb[_0x5b0e('0x53')]=[{'all':!![]}];}return db[_0x5b0e('0x66')]['findAll'](_0x11ebbb);})[_0x5b0e('0x27')](function(_0x437c0d){_0x4cbb46[_0x5b0e('0x67')]=_0x437c0d;return _0x4cbb46;});}})['then'](respondWithFilteredResult(_0xd965ae,_0x11ebbb))[_0x5b0e('0x50')](handleError(_0xd965ae,null));};exports[_0x5b0e('0x68')]=function(_0x1c99db,_0x306537,_0xd5c351){var _0x419ad0={'raw':!![],'where':{}};var _0x3b14d4={};var _0x3eb1f3={'count':0x0,'rows':[]};return db[_0x5b0e('0x3b')][_0x5b0e('0x61')]({'where':{'id':_0x1c99db['params']['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x306537,null))[_0x5b0e('0x27')](function(_0x359210){if(_0x359210){_0x3b14d4[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db['CmHopperBlack'][_0x5b0e('0x3c')]);_0x3b14d4[_0x5b0e('0x3f')]=_['keys'](_0x1c99db['query']);_0x3b14d4[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0x3b14d4[_0x5b0e('0x43')],_0x3b14d4[_0x5b0e('0x3f')]);_0x419ad0['attributes']=_['intersection'](_0x3b14d4['model'],qs[_0x5b0e('0x44')](_0x1c99db[_0x5b0e('0x3f')]['fields']));_0x419ad0[_0x5b0e('0x45')]=_0x419ad0[_0x5b0e('0x45')][_0x5b0e('0x52')]?_0x419ad0['attributes']:_0x3b14d4[_0x5b0e('0x43')];if(!_0x1c99db[_0x5b0e('0x3f')][_0x5b0e('0x46')](_0x5b0e('0x47'))){_0x419ad0[_0x5b0e('0x22')]=qs[_0x5b0e('0x22')](_0x1c99db[_0x5b0e('0x3f')][_0x5b0e('0x22')]);_0x419ad0[_0x5b0e('0x1f')]=qs['offset'](_0x1c99db['query'][_0x5b0e('0x1f')]);}_0x419ad0[_0x5b0e('0x48')]=qs[_0x5b0e('0x49')](_0x1c99db[_0x5b0e('0x3f')][_0x5b0e('0x49')]);_0x419ad0[_0x5b0e('0x4b')]=qs[_0x5b0e('0x41')](_['pick'](_0x1c99db[_0x5b0e('0x3f')],_0x3b14d4['filters']));_0x419ad0[_0x5b0e('0x4b')][_0x5b0e('0x63')]=_0x359210['id'];if(_0x1c99db['query'][_0x5b0e('0x2e')]){_0x419ad0[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x419ad0['where'],{'$or':_['map'](_0x419ad0['attributes'],function(_0x43d561){var _0x512602={};_0x512602[_0x43d561]={'$like':'%'+_0x1c99db[_0x5b0e('0x3f')]['filter']+'%'};return _0x512602;})});}_0x419ad0=_[_0x5b0e('0x4c')]({},_0x419ad0,_0x1c99db['options']);return db[_0x5b0e('0x69')]['count']({'where':_0x419ad0['where']})[_0x5b0e('0x27')](function(_0x6c9577){_0x3eb1f3[_0x5b0e('0x21')]=_0x6c9577;if(_0x1c99db['query'][_0x5b0e('0x4e')]){_0x419ad0['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x5b0e('0x4f')](_0x419ad0);})[_0x5b0e('0x27')](function(_0x492f3e){_0x3eb1f3['rows']=_0x492f3e;return _0x3eb1f3;});}})[_0x5b0e('0x27')](respondWithFilteredResult(_0x306537,_0x419ad0))[_0x5b0e('0x50')](handleError(_0x306537,null));};exports[_0x5b0e('0x6a')]=function(_0x380eab,_0x3493f1,_0x24d150){var _0x10baef={};var _0x52c633={};var _0xab1552;var _0x5cdfc9;return db[_0x5b0e('0x3b')]['findOne']({'where':{'id':_0x380eab[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x3493f1,null))[_0x5b0e('0x27')](function(_0x285d95){if(_0x285d95){_0xab1552=_0x285d95;_0x52c633[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db[_0x5b0e('0x6b')]['rawAttributes']);_0x52c633['query']=_[_0x5b0e('0x40')](_0x380eab[_0x5b0e('0x3f')]);_0x52c633[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0x52c633[_0x5b0e('0x43')],_0x52c633[_0x5b0e('0x3f')]);_0x10baef[_0x5b0e('0x45')]=_[_0x5b0e('0x42')](_0x52c633[_0x5b0e('0x43')],qs[_0x5b0e('0x44')](_0x380eab[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0x10baef['attributes']=_0x10baef[_0x5b0e('0x45')][_0x5b0e('0x52')]?_0x10baef[_0x5b0e('0x45')]:_0x52c633[_0x5b0e('0x43')];_0x10baef[_0x5b0e('0x48')]=qs[_0x5b0e('0x49')](_0x380eab['query'][_0x5b0e('0x49')]);_0x10baef[_0x5b0e('0x4b')]=qs[_0x5b0e('0x41')](_[_0x5b0e('0x4a')](_0x380eab[_0x5b0e('0x3f')],_0x52c633['filters']));if(_0x380eab['query'][_0x5b0e('0x2e')]){_0x10baef[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x10baef['where'],{'$or':_['map'](_0x10baef[_0x5b0e('0x45')],function(_0x52a552){var _0x486843={};_0x486843[_0x52a552]={'$like':'%'+_0x380eab[_0x5b0e('0x3f')]['filter']+'%'};return _0x486843;})});}_0x10baef=_[_0x5b0e('0x4c')]({},_0x10baef,_0x380eab[_0x5b0e('0x4d')]);return _0xab1552[_0x5b0e('0x6a')](_0x10baef);}})['then'](function(_0x1511ea){if(_0x1511ea){_0x5cdfc9=_0x1511ea[_0x5b0e('0x52')];if(!_0x380eab[_0x5b0e('0x3f')]['hasOwnProperty']('nolimit')){_0x10baef['limit']=qs[_0x5b0e('0x22')](_0x380eab[_0x5b0e('0x3f')][_0x5b0e('0x22')]);_0x10baef['offset']=qs[_0x5b0e('0x1f')](_0x380eab[_0x5b0e('0x3f')][_0x5b0e('0x1f')]);}return _0xab1552[_0x5b0e('0x6a')](_0x10baef);}})['then'](function(_0x48eb7a){if(_0x48eb7a){return _0x48eb7a?{'count':_0x5cdfc9,'rows':_0x48eb7a}:null;}})[_0x5b0e('0x27')](respondWithResult(_0x3493f1,null))[_0x5b0e('0x50')](handleError(_0x3493f1,null));};exports[_0x5b0e('0x6c')]=function(_0xdca35d,_0x30bf0e,_0x476caf){var _0x15c464=_0xdca35d[_0x5b0e('0x5d')][_0x5b0e('0x6d')];var _0x4627da=_[_0x5b0e('0x30')](_0x15c464,'id');return db[_0x5b0e('0x6b')]['findAll']({'where':{'id':_0x4627da},'attributes':['id'],'include':[{'model':db[_0x5b0e('0x6e')],'as':'Agents','attributes':['id',_0x5b0e('0x35'),_0x5b0e('0x6f'),_0x5b0e('0x70'),_0x5b0e('0x71')],'raw':!![]}]})[_0x5b0e('0x27')](function(_0x11c705){if(_0x11c705){var _0x4b9959=_[_0x5b0e('0x72')](_0x11c705,function(_0xa0e49b){var _0x3f43fa=_0xa0e49b[_0x5b0e('0x29')]({'plain':!![]});_0x3f43fa[_0x5b0e('0x73')][_0x5b0e('0x74')](function(_0x458527){_0x458527[_0x5b0e('0x75')]=_[_0x5b0e('0x34')](_0x15c464,{'id':_0x3f43fa['id']})[_0x5b0e('0x75')];});return _0x3f43fa[_0x5b0e('0x73')];});return db[_0x5b0e('0x3b')][_0x5b0e('0x34')]({'where':{'id':_0xdca35d[_0x5b0e('0x51')]['id']}})['then'](function(_0x339e3f){return db[_0x5b0e('0x76')][_0x5b0e('0x77')](function(_0x5b2920){return _0x339e3f[_0x5b0e('0x6c')](_0x4627da,{'transaction':_0x5b2920})[_0x5b0e('0x27')](function(){return BPromise['each'](_0x15c464,function(_0x198ec1){return db[_0x5b0e('0x78')][_0x5b0e('0x79')]({'TeamId':_0x198ec1['id'],'VoiceQueueId':_0xdca35d['params']['id'],'penalty':_0x198ec1[_0x5b0e('0x75')]},{'transaction':_0x5b2920});});})[_0x5b0e('0x27')](function(){return BPromise[_0x5b0e('0x7a')](_0x4b9959,function(_0x530f9e){return db[_0x5b0e('0x7b')][_0x5b0e('0x7c')]({'where':{'UserId':_0x530f9e['id'],'VoiceQueueId':_0xdca35d[_0x5b0e('0x51')]['id']},'defaults':{'penalty':_0x530f9e[_0x5b0e('0x75')]},'transaction':_0x5b2920});});})[_0x5b0e('0x27')](function(){return BPromise[_0x5b0e('0x7a')](_[_0x5b0e('0x2e')](_0x4b9959,{'online':!![]}),function(_0x45cae3){return db['UserVoiceQueueRt'][_0x5b0e('0x79')]({'membername':_0x45cae3[_0x5b0e('0x35')],'UserId':_0x45cae3['id'],'queue_name':_0x339e3f[_0x5b0e('0x35')],'VoiceQueueId':_0x339e3f['id'],'interface':_[_0x5b0e('0x7d')](_0x45cae3['interface'])?util[_0x5b0e('0x7e')](_0x5b0e('0x7f'),_0x45cae3['name']):_0x45cae3[_0x5b0e('0x71')],'paused':_0x45cae3[_0x5b0e('0x70')]||![],'penalty':_0x45cae3['penalty']},{'transaction':_0x5b2920});});})[_0x5b0e('0x27')](function(){_0x4b9959[_0x5b0e('0x74')](function(_0x169209){socket[_0x5b0e('0x80')]('userVoiceQueue:save',{'UserId':_0x169209['id'],'VoiceQueueId':_0x339e3f['id']});});});});});}})[_0x5b0e('0x27')](respondWithStatusCode(_0x30bf0e,null))[_0x5b0e('0x50')](handleError(_0x30bf0e,null));};exports[_0x5b0e('0x81')]=function(_0x5279ec,_0x3aae96,_0x41e897){return db[_0x5b0e('0x6b')][_0x5b0e('0x4f')]({'where':{'id':_0x5279ec[_0x5b0e('0x3f')][_0x5b0e('0x82')]},'attributes':['id'],'include':[{'model':db[_0x5b0e('0x6e')],'as':_0x5b0e('0x73'),'attributes':['id'],'raw':!![]}]})[_0x5b0e('0x27')](handleEntityNotFound(_0x3aae96,null))['then'](function(_0x1c419e){var _0x3fe95b=_[_0x5b0e('0x30')](_0x1c419e,'id');var _0x1cb223=[];var _0xa75474=[];var _0x51ef8a=squel['select']();_0x51ef8a[_0x5b0e('0x83')]('tq.TeamId')['from']('team_has_voice_queues','tq')[_0x5b0e('0x84')](_0x5b0e('0x85'),'ut',_0x5b0e('0x86'))[_0x5b0e('0x4b')](_0x5b0e('0x87'),_0x5279ec[_0x5b0e('0x51')]['id']);for(var _0x1035ab=0x0;_0x1035ab<_0x1c419e[_0x5b0e('0x52')];_0x1035ab+=0x1){let _0x76398d=_0x1c419e[_0x1035ab];for(var _0x3b6f39=0x0;_0x3b6f39<_0x76398d[_0x5b0e('0x73')][_0x5b0e('0x52')];_0x3b6f39+=0x1){let _0x12f439=_0x76398d[_0x5b0e('0x73')][_0x3b6f39];var _0x1eb9fc=_0x51ef8a['clone']();_0x1eb9fc[_0x5b0e('0x4b')]('ut.UserId\x20=\x20?',_0x12f439['id']);_0xa75474['push'](db['sequelize'][_0x5b0e('0x3f')](_0x1eb9fc['toString'](),{'type':db[_0x5b0e('0x76')]['QueryTypes'][_0x5b0e('0x88')]})[_0x5b0e('0x27')](function(_0x270b40){if(_0x270b40[_0x5b0e('0x52')]===0x1){return _0x12f439['id'];}else{var _0x5a88b4=_[_0x5b0e('0x89')](_['map'](_0x270b40,'TeamId'),function(_0x3d3bc8){return _[_0x5b0e('0x32')](_0x3fe95b,_0x3d3bc8);});if(_0x5a88b4){return _0x12f439['id'];}}}));}}return BPromise[_0x5b0e('0x8a')](_0xa75474)['then'](function(_0x4c2496){_0x1cb223=_(_0x1cb223)[_0x5b0e('0x8b')](_0x4c2496)['compact']()[_0x5b0e('0x31')]();return db[_0x5b0e('0x3b')][_0x5b0e('0x34')]({'where':{'id':_0x5279ec[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](function(_0x1e3c48){return db[_0x5b0e('0x76')]['transaction'](function(_0x45f27c){return _0x1e3c48[_0x5b0e('0x81')](_0x5279ec['query'][_0x5b0e('0x82')],{'transaction':_0x45f27c})[_0x5b0e('0x27')](function(){if(!_[_0x5b0e('0x8c')](_0x1cb223)){return _0x1e3c48['removeAgents'](_0x1cb223,{'transaction':_0x45f27c})['then'](function(){return db[_0x5b0e('0x8d')][_0x5b0e('0x28')]({'where':{'VoiceQueueId':_0x5279ec[_0x5b0e('0x51')]['id'],'UserId':_0x1cb223},'transaction':_0x45f27c});});}})[_0x5b0e('0x27')](function(){_0x1cb223[_0x5b0e('0x74')](function(_0x29b8ba){socket[_0x5b0e('0x80')]('userVoiceQueue:remove',{'UserId':_0x29b8ba,'VoiceQueueId':_0x1e3c48['id']});});});});});});})[_0x5b0e('0x27')](respondWithStatusCode(_0x3aae96,null))[_0x5b0e('0x50')](handleError(_0x3aae96,null));};exports['addAgents']=function(_0x56c3f1,_0x308892,_0x34a812){var _0x27eb1d,_0xc09e5c;return db['VoiceQueue'][_0x5b0e('0x34')]({'where':{'id':_0x56c3f1['params']['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x308892,null))[_0x5b0e('0x27')](function(_0x2e49de){if(_0x2e49de){_0xc09e5c=_0x2e49de;return _0x2e49de[_0x5b0e('0x8e')](_0x56c3f1['body'][_0x5b0e('0x82')],_[_0x5b0e('0x8f')](_0x56c3f1[_0x5b0e('0x5d')],[_0x5b0e('0x82'),'id'])||{})['spread'](function(_0x4d86a1){for(var _0x171c57=0x0;_0x171c57<_0x56c3f1[_0x5b0e('0x5d')][_0x5b0e('0x82')]['length'];_0x171c57+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x56c3f1['body'][_0x5b0e('0x82')][_0x171c57]),'VoiceQueueId':Number(_0x56c3f1[_0x5b0e('0x51')]['id'])});}return _0x4d86a1;});}})['then'](function(_0x5f34af){_0x27eb1d=_0x5f34af||[];if(_0xc09e5c){return db[_0x5b0e('0x6e')][_0x5b0e('0x4f')]({'where':{'id':_0x56c3f1[_0x5b0e('0x5d')][_0x5b0e('0x82')]},'attributes':['id',_0x5b0e('0x35'),_0x5b0e('0x6f'),'voicePause',_0x5b0e('0x71')],'raw':!![]});}})[_0x5b0e('0x27')](function(_0xd1301e){if(!_[_0x5b0e('0x8c')](_0xd1301e)){var _0x3ce2e2=[];for(var _0x3137c2=0x0;_0x3137c2<_0xd1301e[_0x5b0e('0x52')];_0x3137c2++){if(_0xd1301e[_0x3137c2][_0x5b0e('0x6f')]){_0x3ce2e2['push'](db[_0x5b0e('0x8d')]['upsert']({'membername':_0xd1301e[_0x3137c2][_0x5b0e('0x35')],'UserId':_0xd1301e[_0x3137c2]['id'],'queue_name':_0xc09e5c[_0x5b0e('0x35')],'VoiceQueueId':_0xc09e5c['id'],'interface':_[_0x5b0e('0x7d')](_0xd1301e[_0x3137c2]['interface'])?util['format'](_0x5b0e('0x7f'),_0xd1301e[_0x3137c2][_0x5b0e('0x35')]):_0xd1301e[_0x3137c2][_0x5b0e('0x71')],'paused':_0xd1301e[_0x3137c2][_0x5b0e('0x70')]||![],'penalty':_0x56c3f1['body'][_0x5b0e('0x75')]||0x0}));}}return BPromise[_0x5b0e('0x8a')](_0x3ce2e2);}})[_0x5b0e('0x27')](function(){return _0x27eb1d;})[_0x5b0e('0x27')](respondWithResult(_0x308892,null))[_0x5b0e('0x50')](handleError(_0x308892,null));};exports[_0x5b0e('0x90')]=function(_0x1999b6,_0x26f323,_0x1819fe){return db[_0x5b0e('0x3b')]['find']({'where':{'id':_0x1999b6['params']['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x26f323,null))[_0x5b0e('0x27')](function(_0x5a013a){if(_0x5a013a){return _0x5a013a[_0x5b0e('0x90')](_0x1999b6[_0x5b0e('0x3f')][_0x5b0e('0x82')])[_0x5b0e('0x27')](function(){if(_[_0x5b0e('0x91')](_0x1999b6[_0x5b0e('0x3f')][_0x5b0e('0x82')])){for(var _0x341071=0x0;_0x341071<_0x1999b6[_0x5b0e('0x3f')][_0x5b0e('0x82')][_0x5b0e('0x52')];_0x341071+=0x1){socket['emit'](_0x5b0e('0x92'),{'UserId':Number(_0x1999b6[_0x5b0e('0x3f')][_0x5b0e('0x82')][_0x341071]),'VoiceQueueId':Number(_0x1999b6[_0x5b0e('0x51')]['id'])});}}else{socket[_0x5b0e('0x80')](_0x5b0e('0x92'),{'UserId':Number(_0x1999b6[_0x5b0e('0x3f')][_0x5b0e('0x82')]),'VoiceQueueId':Number(_0x1999b6[_0x5b0e('0x51')]['id'])});}});}})[_0x5b0e('0x27')](function(_0x1942f7){return db[_0x5b0e('0x8d')][_0x5b0e('0x28')]({'where':{'VoiceQueueId':_0x1999b6[_0x5b0e('0x51')]['id'],'UserId':_0x1999b6[_0x5b0e('0x3f')][_0x5b0e('0x82')]}})[_0x5b0e('0x27')](function(){return _0x1942f7;});})[_0x5b0e('0x27')](respondWithStatusCode(_0x26f323,null))[_0x5b0e('0x50')](handleError(_0x26f323,null));};exports[_0x5b0e('0x93')]=function(_0x5df012,_0x3c3ee1,_0x574665){var _0x465168={};var _0xe2fe33={};var _0x375a9f;var _0x200858;return db['VoiceQueue'][_0x5b0e('0x61')]({'where':{'id':_0x5df012['params']['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x3c3ee1,null))[_0x5b0e('0x27')](function(_0xfa3930){if(_0xfa3930){_0x375a9f=_0xfa3930;_0xe2fe33[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db[_0x5b0e('0x6e')]['rawAttributes']);_0xe2fe33[_0x5b0e('0x3f')]=_[_0x5b0e('0x40')](_0x5df012[_0x5b0e('0x3f')]);_0xe2fe33[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0xe2fe33[_0x5b0e('0x43')],_0xe2fe33[_0x5b0e('0x3f')]);_0x465168['attributes']=_[_0x5b0e('0x42')](_0xe2fe33[_0x5b0e('0x43')],qs['fields'](_0x5df012['query']['fields']));_0x465168['attributes']=_0x465168[_0x5b0e('0x45')][_0x5b0e('0x52')]?_0x465168[_0x5b0e('0x45')]:_0xe2fe33[_0x5b0e('0x43')];_0x465168[_0x5b0e('0x48')]=qs[_0x5b0e('0x49')](_0x5df012['query'][_0x5b0e('0x49')]);_0x465168[_0x5b0e('0x4b')]=qs['filters'](_[_0x5b0e('0x4a')](_0x5df012[_0x5b0e('0x3f')],_0xe2fe33[_0x5b0e('0x41')]));if(_0x5df012[_0x5b0e('0x3f')][_0x5b0e('0x2e')]){_0x465168[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x465168[_0x5b0e('0x4b')],{'$or':_[_0x5b0e('0x30')](_0x465168[_0x5b0e('0x45')],function(_0x291622){var _0x190f10={};_0x190f10[_0x291622]={'$like':'%'+_0x5df012['query'][_0x5b0e('0x2e')]+'%'};return _0x190f10;})});}_0x465168=_[_0x5b0e('0x4c')]({},_0x465168,_0x5df012[_0x5b0e('0x4d')]);return _0x375a9f[_0x5b0e('0x93')](_0x465168);}})[_0x5b0e('0x27')](function(_0x13d5fb){if(_0x13d5fb){_0x200858=_0x13d5fb[_0x5b0e('0x52')];if(!_0x5df012['query'][_0x5b0e('0x46')](_0x5b0e('0x47'))){_0x465168['limit']=qs['limit'](_0x5df012['query']['limit']);_0x465168[_0x5b0e('0x1f')]=qs[_0x5b0e('0x1f')](_0x5df012[_0x5b0e('0x3f')][_0x5b0e('0x1f')]);}return _0x375a9f[_0x5b0e('0x93')](_0x465168);}})[_0x5b0e('0x27')](function(_0x40cad3){if(_0x40cad3){return _0x40cad3?{'count':_0x200858,'rows':_0x40cad3}:null;}})[_0x5b0e('0x27')](respondWithResult(_0x3c3ee1,null))[_0x5b0e('0x50')](handleError(_0x3c3ee1,null));};exports[_0x5b0e('0x94')]=function(_0x254d54,_0x240102,_0x11ff13){var _0x38dd85={};var _0x5e0ea8={};var _0x1854ef;var _0x2ced9a;return db[_0x5b0e('0x3b')][_0x5b0e('0x61')]({'where':{'id':_0x254d54[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x240102,null))[_0x5b0e('0x27')](function(_0xee25e5){if(_0xee25e5){_0x1854ef=_0xee25e5;_0x5e0ea8[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db[_0x5b0e('0x8d')][_0x5b0e('0x3c')]);_0x5e0ea8[_0x5b0e('0x3f')]=_['keys'](_0x254d54['query']);_0x5e0ea8['filters']=_['intersection'](_0x5e0ea8['model'],_0x5e0ea8[_0x5b0e('0x3f')]);_0x38dd85['attributes']=_['intersection'](_0x5e0ea8[_0x5b0e('0x43')],qs[_0x5b0e('0x44')](_0x254d54['query'][_0x5b0e('0x44')]));_0x38dd85[_0x5b0e('0x45')]=_0x38dd85[_0x5b0e('0x45')][_0x5b0e('0x52')]?_0x38dd85[_0x5b0e('0x45')]:_0x5e0ea8['model'];_0x38dd85[_0x5b0e('0x48')]=qs['sort'](_0x254d54[_0x5b0e('0x3f')][_0x5b0e('0x49')]);_0x38dd85[_0x5b0e('0x4b')]=qs[_0x5b0e('0x41')](_['pick'](_0x254d54[_0x5b0e('0x3f')],_0x5e0ea8[_0x5b0e('0x41')]));if(_0x254d54[_0x5b0e('0x3f')][_0x5b0e('0x2e')]){_0x38dd85[_0x5b0e('0x4b')]=_[_0x5b0e('0x4c')](_0x38dd85[_0x5b0e('0x4b')],{'$or':_[_0x5b0e('0x30')](_0x38dd85[_0x5b0e('0x45')],function(_0x291dc9){var _0x4b2cec={};_0x4b2cec[_0x291dc9]={'$like':'%'+_0x254d54[_0x5b0e('0x3f')][_0x5b0e('0x2e')]+'%'};return _0x4b2cec;})});}_0x38dd85=_['merge']({},_0x38dd85,_0x254d54[_0x5b0e('0x4d')]);return _0x1854ef['getMembers'](_0x38dd85);}})[_0x5b0e('0x27')](function(_0x484d60){if(_0x484d60){_0x2ced9a=_0x484d60['length'];if(!_0x254d54[_0x5b0e('0x3f')][_0x5b0e('0x46')](_0x5b0e('0x47'))){_0x38dd85['limit']=qs['limit'](_0x254d54[_0x5b0e('0x3f')][_0x5b0e('0x22')]);_0x38dd85[_0x5b0e('0x1f')]=qs[_0x5b0e('0x1f')](_0x254d54['query']['offset']);}return _0x1854ef['getMembers'](_0x38dd85);}})['then'](function(_0xcc07ca){return _0xcc07ca?{'count':_0x2ced9a,'rows':_0xcc07ca}:null;})[_0x5b0e('0x27')](respondWithResult(_0x240102,null))[_0x5b0e('0x50')](handleError(_0x240102,null));};exports[_0x5b0e('0x95')]=function(_0x24002e,_0x790290,_0x37fa22){var _0x246ae8={};var _0x325666={};var _0x225d55;var _0x2b2b24;return db[_0x5b0e('0x3b')][_0x5b0e('0x61')]({'where':{'id':_0x24002e[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x790290,null))[_0x5b0e('0x27')](function(_0x185adc){if(_0x185adc){_0x225d55=_0x185adc;_0x325666['model']=_[_0x5b0e('0x40')](db[_0x5b0e('0x96')]['rawAttributes']);_0x325666['query']=_[_0x5b0e('0x40')](_0x24002e['query']);_0x325666[_0x5b0e('0x41')]=_[_0x5b0e('0x42')](_0x325666[_0x5b0e('0x43')],_0x325666['query']);_0x246ae8[_0x5b0e('0x45')]=_[_0x5b0e('0x42')](_0x325666['model'],qs['fields'](_0x24002e[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0x246ae8[_0x5b0e('0x45')]=_0x246ae8['attributes'][_0x5b0e('0x52')]?_0x246ae8[_0x5b0e('0x45')]:_0x325666['model'];_0x246ae8['order']=qs[_0x5b0e('0x49')](_0x24002e[_0x5b0e('0x3f')][_0x5b0e('0x49')]);_0x246ae8[_0x5b0e('0x4b')]=qs[_0x5b0e('0x41')](_['pick'](_0x24002e[_0x5b0e('0x3f')],_0x325666[_0x5b0e('0x41')]));if(_0x24002e[_0x5b0e('0x3f')][_0x5b0e('0x2e')]){_0x246ae8[_0x5b0e('0x4b')]=_['merge'](_0x246ae8[_0x5b0e('0x4b')],{'$or':_[_0x5b0e('0x30')](_0x246ae8[_0x5b0e('0x45')],function(_0x1dc7a9){var _0x4cd540={};_0x4cd540[_0x1dc7a9]={'$like':'%'+_0x24002e[_0x5b0e('0x3f')][_0x5b0e('0x2e')]+'%'};return _0x4cd540;})});}_0x246ae8=_[_0x5b0e('0x4c')]({},_0x246ae8,_0x24002e[_0x5b0e('0x4d')]);return _0x225d55[_0x5b0e('0x95')](_0x246ae8);}})[_0x5b0e('0x27')](function(_0x55c6bb){if(_0x55c6bb){_0x2b2b24=_0x55c6bb[_0x5b0e('0x52')];if(!_0x24002e[_0x5b0e('0x3f')][_0x5b0e('0x46')](_0x5b0e('0x47'))){_0x246ae8[_0x5b0e('0x22')]=qs[_0x5b0e('0x22')](_0x24002e[_0x5b0e('0x3f')]['limit']);_0x246ae8[_0x5b0e('0x1f')]=qs[_0x5b0e('0x1f')](_0x24002e[_0x5b0e('0x3f')][_0x5b0e('0x1f')]);}return _0x225d55[_0x5b0e('0x95')](_0x246ae8);}})[_0x5b0e('0x27')](function(_0x3ae9f2){if(_0x3ae9f2){return _0x3ae9f2?{'count':_0x2b2b24,'rows':_0x3ae9f2}:null;}})[_0x5b0e('0x27')](respondWithResult(_0x790290,null))['catch'](handleError(_0x790290,null));};exports[_0x5b0e('0x97')]=function(_0x3f1d16,_0x17d3db,_0x4fad7c){var _0x5b4ec2=moment()[_0x5b0e('0x7e')](_0x5b0e('0x98'));var _0x235f98,_0x3f6702;return db['VoiceQueue'][_0x5b0e('0x34')]({'where':{'id':_0x3f1d16[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x17d3db,null))[_0x5b0e('0x27')](function(_0x3e3cad){if(_0x3e3cad){_0x3f6702=_0x3e3cad;return _0x3e3cad[_0x5b0e('0x97')](_0x3f1d16[_0x5b0e('0x5d')][_0x5b0e('0x82')],_['omit'](_0x3f1d16[_0x5b0e('0x5d')],[_0x5b0e('0x82'),'id'])||{});}return null;})[_0x5b0e('0x99')](function(_0x4fae36){var _0x3f1d8f;_0x235f98=_0x4fae36||[];var _0x3151ce=[];if(_0x4fae36){for(var _0x8591a7=0x0;_0x8591a7<_0x4fae36[_0x5b0e('0x52')];_0x8591a7+=0x1){var _0x3b9eda=_0x4fae36[_0x8591a7][_0x5b0e('0x29')]({'plain':!![]});_0x3f6702[_0x5b0e('0x9a')]=_0x3f1d16[_0x5b0e('0x5d')]['dialCheckDuplicateType']?_0x3f1d16[_0x5b0e('0x5d')][_0x5b0e('0x9a')]:_0x3f6702['dialCheckDuplicateType'];switch(_0x3f6702[_0x5b0e('0x9a')]){case _0x5b0e('0x9b'):_0x3f1d8f=squel[_0x5b0e('0x9c')]()['into'](_0x5b0e('0x9d'))[_0x5b0e('0x9e')]([_0x5b0e('0x9f'),_0x5b0e('0xa0'),_0x5b0e('0xa1'),'ListId',_0x5b0e('0x63'),'createdAt','updatedAt'],squel[_0x5b0e('0xa2')]()['field']('phone','phone')[_0x5b0e('0x83')]('\x27'+_0x5b4ec2+'\x27',_0x5b0e('0xa0'))[_0x5b0e('0x83')]('id',_0x5b0e('0xa1'))[_0x5b0e('0x83')](_0x3b9eda[_0x5b0e('0xa3')][_0x5b0e('0xa4')](),_0x5b0e('0xa5'))[_0x5b0e('0x83')](_0x3f1d16[_0x5b0e('0x51')]['id'][_0x5b0e('0xa4')](),'VoiceQueueId')[_0x5b0e('0x83')]('\x27'+_0x5b4ec2+'\x27','createdAt')['field']('\x27'+_0x5b4ec2+'\x27','updatedAt')[_0x5b0e('0xa6')](_0x5b0e('0xa7'))[_0x5b0e('0x4b')](_0x5b0e('0xa8'))['where'](_0x5b0e('0xa9'),_0x3b9eda['CmListId'][_0x5b0e('0xa4')]())[_0x5b0e('0x4b')](_0x5b0e('0xaa'))[_0x5b0e('0x4b')](_0x5b0e('0xab'),squel['select']()[_0x5b0e('0x83')](_0x5b0e('0xac'))[_0x5b0e('0xa6')](_0x5b0e('0xad'))[_0x5b0e('0x4b')](_0x5b0e('0x87'),_0x3f1d16[_0x5b0e('0x51')]['id'][_0x5b0e('0xa4')]()))[_0x5b0e('0x4b')](_0x5b0e('0xab'),squel['select']()[_0x5b0e('0x83')](_0x5b0e('0xae'))['from'](_0x5b0e('0x9d'))[_0x5b0e('0x4b')](_0x5b0e('0x87'),_0x3f1d16[_0x5b0e('0x51')]['id'][_0x5b0e('0xa4')]())))['toString']();break;case _0x5b0e('0xaf'):_0x3f1d8f=squel['insert']()[_0x5b0e('0xb0')](_0x5b0e('0x9d'))[_0x5b0e('0x9e')]([_0x5b0e('0x9f'),_0x5b0e('0xa0'),_0x5b0e('0xa1'),_0x5b0e('0xa5'),_0x5b0e('0x63'),_0x5b0e('0x5e'),_0x5b0e('0x5c')],squel[_0x5b0e('0xa2')]()[_0x5b0e('0x83')](_0x5b0e('0x9f'),_0x5b0e('0x9f'))['field']('\x27'+_0x5b4ec2+'\x27',_0x5b0e('0xa0'))[_0x5b0e('0x83')]('id',_0x5b0e('0xa1'))['field'](_0x3b9eda[_0x5b0e('0xa3')][_0x5b0e('0xa4')](),_0x5b0e('0xa5'))[_0x5b0e('0x83')](_0x3f1d16[_0x5b0e('0x51')]['id']['toString'](),'VoiceQueueId')[_0x5b0e('0x83')]('\x27'+_0x5b4ec2+'\x27',_0x5b0e('0x5e'))[_0x5b0e('0x83')]('\x27'+_0x5b4ec2+'\x27','updatedAt')[_0x5b0e('0xa6')](_0x5b0e('0xa7'))['where'](_0x5b0e('0xa8'))['where'](_0x5b0e('0xa9'),_0x3b9eda[_0x5b0e('0xa3')][_0x5b0e('0xa4')]())[_0x5b0e('0x4b')](_0x5b0e('0xaa'))[_0x5b0e('0x4b')](_0x5b0e('0xab'),squel[_0x5b0e('0xa2')]()[_0x5b0e('0x83')](_0x5b0e('0xae'))[_0x5b0e('0xa6')](_0x5b0e('0x9d'))[_0x5b0e('0x4b')](_0x5b0e('0x87'),_0x3f1d16['params']['id'][_0x5b0e('0xa4')]())))['toString']();break;default:_0x3f1d8f=squel['insert']()[_0x5b0e('0xb0')](_0x5b0e('0x9d'))[_0x5b0e('0x9e')]([_0x5b0e('0x9f'),_0x5b0e('0xa0'),_0x5b0e('0xa1'),_0x5b0e('0xa5'),'VoiceQueueId',_0x5b0e('0x5e'),_0x5b0e('0x5c')],squel['select']()[_0x5b0e('0x83')](_0x5b0e('0x9f'),_0x5b0e('0x9f'))[_0x5b0e('0x83')]('\x27'+_0x5b4ec2+'\x27',_0x5b0e('0xa0'))[_0x5b0e('0x83')]('id',_0x5b0e('0xa1'))['field'](_0x3b9eda[_0x5b0e('0xa3')][_0x5b0e('0xa4')](),'ListId')[_0x5b0e('0x83')](_0x3f1d16['params']['id'][_0x5b0e('0xa4')](),_0x5b0e('0x63'))['field']('\x27'+_0x5b4ec2+'\x27',_0x5b0e('0x5e'))[_0x5b0e('0x83')]('\x27'+_0x5b4ec2+'\x27','updatedAt')[_0x5b0e('0xa6')](_0x5b0e('0xa7'))[_0x5b0e('0x4b')](_0x5b0e('0xa8'))['where'](_0x5b0e('0xa9'),_0x3b9eda[_0x5b0e('0xa3')][_0x5b0e('0xa4')]())[_0x5b0e('0x4b')](_0x5b0e('0xaa')))[_0x5b0e('0xa4')]();}_0x3151ce[_0x5b0e('0xb1')](db['sequelize']['query'](_0x3f1d8f));}return BPromise[_0x5b0e('0x8a')](_0x3151ce);}})['then'](function(){var _0x254e04=[];var _0x25ea56=squel[_0x5b0e('0x9c')]()[_0x5b0e('0xb0')](_0x5b0e('0xb2'))['fromQuery']([_0x5b0e('0xb3'),_0x5b0e('0x9f'),_0x5b0e('0xb4'),_0x5b0e('0x5e'),_0x5b0e('0x5c')],squel[_0x5b0e('0xa2')]()[_0x5b0e('0x83')](_0x5b0e('0xb5'))[_0x5b0e('0x83')]('ci.item')[_0x5b0e('0x83')](_0x5b0e('0xb6'))[_0x5b0e('0x83')]('\x27'+_0x5b4ec2+'\x27',_0x5b0e('0x5e'))['field']('\x27'+_0x5b4ec2+'\x27',_0x5b0e('0x5c'))[_0x5b0e('0xa6')](_0x5b0e('0xb7'),'ci')[_0x5b0e('0x84')](_0x5b0e('0x9d'),'h','h.ContactId=ci.CmContactId')[_0x5b0e('0x4b')](_0x5b0e('0xb8'),_0x5b4ec2)[_0x5b0e('0x4b')](_0x5b0e('0xb9'),_0x5b0e('0xba')))['toString']();_0x254e04['push'](db[_0x5b0e('0x76')][_0x5b0e('0x3f')](_0x25ea56));return BPromise[_0x5b0e('0x8a')](_0x254e04);})[_0x5b0e('0x27')](function(){return _0x235f98;})[_0x5b0e('0x27')](respondWithResult(_0x17d3db,null))[_0x5b0e('0x50')](handleError(_0x17d3db,null));};exports[_0x5b0e('0xbb')]=function(_0xb4cb7d,_0x164be8,_0x2a1425){return db['VoiceQueue'][_0x5b0e('0x34')]({'where':{'id':_0xb4cb7d[_0x5b0e('0x51')]['id']}})['then'](handleEntityNotFound(_0x164be8,null))['then'](function(_0x4450c6){if(_0x4450c6){return _0x4450c6[_0x5b0e('0xbb')](_0xb4cb7d[_0x5b0e('0x3f')]['ids']);}})[_0x5b0e('0x27')](function(_0x28fe3c){if(_0x28fe3c){return db[_0x5b0e('0x62')]['destroy']({'where':{'ListId':_0xb4cb7d['query'][_0x5b0e('0x82')],'VoiceQueueId':_0xb4cb7d[_0x5b0e('0x51')]['id']}})['then'](function(){return _0x28fe3c;});}})[_0x5b0e('0x27')](respondWithStatusCode(_0x164be8,null))[_0x5b0e('0x50')](handleError(_0x164be8,null));};exports['getBlackLists']=function(_0x2f1e9a,_0x13cd8e,_0xcc00c4){var _0x370ec3={};var _0x1040c1={};var _0x4e48d3;var _0x543928;return db[_0x5b0e('0x3b')][_0x5b0e('0x61')]({'where':{'id':_0x2f1e9a[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x13cd8e,null))[_0x5b0e('0x27')](function(_0x4f8e83){if(_0x4f8e83){_0x4e48d3=_0x4f8e83;_0x1040c1[_0x5b0e('0x43')]=_[_0x5b0e('0x40')](db['CmList']['rawAttributes']);_0x1040c1[_0x5b0e('0x3f')]=_['keys'](_0x2f1e9a[_0x5b0e('0x3f')]);_0x1040c1['filters']=_[_0x5b0e('0x42')](_0x1040c1[_0x5b0e('0x43')],_0x1040c1[_0x5b0e('0x3f')]);_0x370ec3[_0x5b0e('0x45')]=_[_0x5b0e('0x42')](_0x1040c1['model'],qs[_0x5b0e('0x44')](_0x2f1e9a[_0x5b0e('0x3f')][_0x5b0e('0x44')]));_0x370ec3['attributes']=_0x370ec3[_0x5b0e('0x45')][_0x5b0e('0x52')]?_0x370ec3[_0x5b0e('0x45')]:_0x1040c1[_0x5b0e('0x43')];_0x370ec3[_0x5b0e('0x48')]=qs['sort'](_0x2f1e9a['query'][_0x5b0e('0x49')]);_0x370ec3[_0x5b0e('0x4b')]=qs['filters'](_[_0x5b0e('0x4a')](_0x2f1e9a[_0x5b0e('0x3f')],_0x1040c1[_0x5b0e('0x41')]));if(_0x2f1e9a[_0x5b0e('0x3f')]['filter']){_0x370ec3['where']=_[_0x5b0e('0x4c')](_0x370ec3[_0x5b0e('0x4b')],{'$or':_[_0x5b0e('0x30')](_0x370ec3[_0x5b0e('0x45')],function(_0x5262ee){var _0x1d225f={};_0x1d225f[_0x5262ee]={'$like':'%'+_0x2f1e9a[_0x5b0e('0x3f')][_0x5b0e('0x2e')]+'%'};return _0x1d225f;})});}_0x370ec3=_[_0x5b0e('0x4c')]({},_0x370ec3,_0x2f1e9a[_0x5b0e('0x4d')]);return _0x4e48d3[_0x5b0e('0xbc')](_0x370ec3);}})[_0x5b0e('0x27')](function(_0x130b1f){if(_0x130b1f){_0x543928=_0x130b1f[_0x5b0e('0x52')];if(!_0x2f1e9a[_0x5b0e('0x3f')][_0x5b0e('0x46')](_0x5b0e('0x47'))){_0x370ec3[_0x5b0e('0x22')]=qs[_0x5b0e('0x22')](_0x2f1e9a[_0x5b0e('0x3f')][_0x5b0e('0x22')]);_0x370ec3[_0x5b0e('0x1f')]=qs['offset'](_0x2f1e9a[_0x5b0e('0x3f')][_0x5b0e('0x1f')]);}return _0x4e48d3[_0x5b0e('0xbc')](_0x370ec3);}})[_0x5b0e('0x27')](function(_0x21ec37){if(_0x21ec37){return _0x21ec37?{'count':_0x543928,'rows':_0x21ec37}:null;}})[_0x5b0e('0x27')](respondWithResult(_0x13cd8e,null))[_0x5b0e('0x50')](handleError(_0x13cd8e,null));};exports[_0x5b0e('0xbd')]=function(_0x1cc034,_0x2f118d,_0x175647){var _0x5f3174,_0xde1ca0;return db[_0x5b0e('0x3b')][_0x5b0e('0x34')]({'where':{'id':_0x1cc034[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x2f118d,null))[_0x5b0e('0x27')](function(_0x2e19b8){if(_0x2e19b8){_0xde1ca0=_0x2e19b8;return _0x2e19b8['addBlackLists'](_0x1cc034[_0x5b0e('0x5d')][_0x5b0e('0x82')],_['omit'](_0x1cc034[_0x5b0e('0x5d')],[_0x5b0e('0x82'),'id'])||{});}return null;})[_0x5b0e('0x99')](function(_0x962820){var _0x1f57c7;_0x5f3174=_0x962820||[];var _0x2e802d=[];if(_0x962820){for(var _0xfa74d5=0x0;_0xfa74d5<_0x962820[_0x5b0e('0x52')];_0xfa74d5+=0x1){var _0x1507ca=_0x962820[_0xfa74d5][_0x5b0e('0x29')]({'plain':!![]});_0x1f57c7=squel[_0x5b0e('0x9c')]()[_0x5b0e('0xb0')](_0x5b0e('0xbe'))['fromQuery']([_0x5b0e('0x9f'),_0x5b0e('0xa1'),_0x5b0e('0xa5'),'VoiceQueueId',_0x5b0e('0x5e'),_0x5b0e('0x5c')],squel['select']()[_0x5b0e('0x83')](_0x5b0e('0x9f'),'phone')[_0x5b0e('0x83')]('id',_0x5b0e('0xa1'))[_0x5b0e('0x83')](_0x1507ca[_0x5b0e('0xa3')][_0x5b0e('0xa4')](),_0x5b0e('0xa5'))[_0x5b0e('0x83')](_0x1cc034[_0x5b0e('0x51')]['id'][_0x5b0e('0xa4')](),_0x5b0e('0x63'))['field'](_0x5b0e('0xbf'),_0x5b0e('0x5e'))['field'](_0x5b0e('0xbf'),_0x5b0e('0x5c'))[_0x5b0e('0xa6')](_0x5b0e('0xa7'))[_0x5b0e('0x4b')](_0x5b0e('0xa8'))[_0x5b0e('0x4b')]('ListId\x20=\x20?',_0x1507ca[_0x5b0e('0xa3')][_0x5b0e('0xa4')]())[_0x5b0e('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0x5b0e('0xa4')]();_0x2e802d['push'](db[_0x5b0e('0x76')][_0x5b0e('0x3f')](_0x1f57c7));}return BPromise[_0x5b0e('0x8a')](_0x2e802d);}})[_0x5b0e('0x27')](function(){return _0x5f3174;})[_0x5b0e('0x27')](respondWithResult(_0x2f118d,null))[_0x5b0e('0x50')](handleError(_0x2f118d,null));};exports['removeBlackLists']=function(_0x460f19,_0x537693,_0x449478){return db[_0x5b0e('0x3b')][_0x5b0e('0x34')]({'where':{'id':_0x460f19['params']['id']}})[_0x5b0e('0x27')](handleEntityNotFound(_0x537693,null))[_0x5b0e('0x27')](function(_0x3672e3){if(_0x3672e3){return _0x3672e3[_0x5b0e('0xc0')](_0x460f19[_0x5b0e('0x3f')][_0x5b0e('0x82')]);}})['then'](function(_0x562a74){if(_0x562a74){return db[_0x5b0e('0x69')][_0x5b0e('0x28')]({'where':{'ListId':_0x460f19[_0x5b0e('0x3f')]['ids'],'VoiceQueueId':_0x460f19[_0x5b0e('0x51')]['id']}})[_0x5b0e('0x27')](function(){return _0x562a74;});}})['then'](respondWithStatusCode(_0x537693,null))[_0x5b0e('0x50')](handleError(_0x537693,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 22cd3ba..4683aa6 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 _0x5de0=['emit','hasOwnProperty','hook','exports','setMaxListeners','remove'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x5de0,0xc4));var _0x05de=function(_0xd94b0,_0x4d6540){_0xd94b0=_0xd94b0-0x0;var _0x31e542=_0x5de0[_0xd94b0];return _0x31e542;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x05de('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x05de('0x1')};function emitEvent(_0x5b5f4e){return function(_0x55b61e,_0x452138,_0x5613c5){VoiceQueueEvents[_0x05de('0x2')](_0x5b5f4e+':'+_0x55b61e['id'],_0x55b61e);VoiceQueueEvents[_0x05de('0x2')](_0x5b5f4e,_0x55b61e);_0x5613c5(null);};}for(var e in events){if(events[_0x05de('0x3')](e)){var event=events[e];VoiceQueue[_0x05de('0x4')](e,emitEvent(event));}}module[_0x05de('0x5')]=VoiceQueueEvents; \ No newline at end of file +var _0x6673=['emit','hasOwnProperty','../../mysqldb','VoiceQueue','save','update'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x6673,0x1a6));var _0x3667=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6673[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x3667('0x0'))['db'][_0x3667('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3667('0x2'),'afterUpdate':_0x3667('0x3'),'afterDestroy':'remove'};function emitEvent(_0xf191af){return function(_0x31219e,_0x5acefd,_0x54f076){VoiceQueueEvents[_0x3667('0x4')](_0xf191af+':'+_0x31219e['id'],_0x31219e);VoiceQueueEvents[_0x3667('0x4')](_0xf191af,_0x31219e);_0x54f076(null);};}for(var e in events){if(events[_0x3667('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 6076649..f3b2db5 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x381f4d,_0x58594f){var _0x5db7b3=function(_0x7e45b7){while(--_0x7e45b7){_0x381f4d['push'](_0x381f4d['shift']());}};_0x5db7b3(++_0x58594f);}(_0xedd9,0xfc));var _0x9edd=function(_0x2300fc,_0x21dc92){_0x2300fc=_0x2300fc-0x0;var _0x12de70=_0xedd9[_0x2300fc];return _0x12de70;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x6b35a7,_0x2926c5){var _0xdae0cb=function(_0x131ae7){while(--_0x131ae7){_0x6b35a7['push'](_0x6b35a7['shift']());}};_0xdae0cb(++_0x2926c5);}(_0xedd9,0xfc));var _0x9edd=function(_0x17b929,_0x4d5c37){_0x17b929=_0x17b929-0x0;var _0x496010=_0xedd9[_0x17b929];return _0x496010;};'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':'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 becfca4..bacb3c0 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 _0x45b8=['./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','findAll','options','where','attributes','include','map','model','info','GetVoiceQueue','debug','ShowVoiceQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3361e2,_0x32139f){var _0x4a4e76=function(_0x320548){while(--_0x320548){_0x3361e2['push'](_0x3361e2['shift']());}};_0x4a4e76(++_0x32139f);}(_0x45b8,0x103));var _0x845b=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x45b8[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x845b('0x0'));var util=require(_0x845b('0x1'));var moment=require(_0x845b('0x2'));var BPromise=require(_0x845b('0x3'));var rs=require(_0x845b('0x4'));var fs=require('fs');var Redis=require(_0x845b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x845b('0x6'));var logger=require(_0x845b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x845b('0x8'));var client=jayson['client'][_0x845b('0x9')]({'port':0x232a});config[_0x845b('0xa')]=_[_0x845b('0xb')](config[_0x845b('0xa')],{'host':_0x845b('0xc'),'port':0x18eb});var socket=require(_0x845b('0xd'))(new Redis(config[_0x845b('0xa')]));require(_0x845b('0xe'))['register'](socket);function respondWithRpcPromise(_0x507b44,_0x54e724,_0x160f04){return new BPromise(function(_0x3c9ed2,_0x36f332){return client[_0x845b('0xf')](_0x507b44,_0x160f04)[_0x845b('0x10')](function(_0x2369de){logger['info'](_0x845b('0x11'),_0x54e724,_0x845b('0x12'));logger['debug'](_0x845b('0x13'),_0x54e724,_0x845b('0x12'),JSON[_0x845b('0x14')](_0x2369de));if(_0x2369de[_0x845b('0x15')]){if(_0x2369de[_0x845b('0x15')][_0x845b('0x16')]===0x1f4){logger[_0x845b('0x15')](_0x845b('0x11'),_0x54e724,_0x2369de['error'][_0x845b('0x17')]);return _0x36f332(_0x2369de[_0x845b('0x15')][_0x845b('0x17')]);}logger[_0x845b('0x15')](_0x845b('0x11'),_0x54e724,_0x2369de[_0x845b('0x15')][_0x845b('0x17')]);return _0x3c9ed2(_0x2369de[_0x845b('0x15')]['message']);}else{logger['info'](_0x845b('0x11'),_0x54e724,_0x845b('0x12'));_0x3c9ed2(_0x2369de[_0x845b('0x18')][_0x845b('0x17')]);}})[_0x845b('0x19')](function(_0x21ab70){logger[_0x845b('0x15')](_0x845b('0x11'),_0x54e724,_0x21ab70);_0x36f332(_0x21ab70);});});}exports['GetVoiceQueue']=function(_0x33e7a8){var _0x597d44=this;return new Promise(function(_0x5f486c,_0x10f2ab){return db[_0x845b('0x1a')][_0x845b('0x1b')]({'raw':_0x33e7a8[_0x845b('0x1c')]?_0x33e7a8['options']['raw']===undefined?!![]:![]:!![],'where':_0x33e7a8['options']?_0x33e7a8['options'][_0x845b('0x1d')]||null:null,'attributes':_0x33e7a8[_0x845b('0x1c')]?_0x33e7a8['options'][_0x845b('0x1e')]||null:null,'limit':_0x33e7a8[_0x845b('0x1c')]?_0x33e7a8[_0x845b('0x1c')]['limit']||null:null,'include':_0x33e7a8[_0x845b('0x1c')]?_0x33e7a8[_0x845b('0x1c')][_0x845b('0x1f')]?_[_0x845b('0x20')](_0x33e7a8[_0x845b('0x1c')]['include'],function(_0x2deb69){return{'model':db[_0x2deb69[_0x845b('0x21')]],'as':_0x2deb69['as'],'attributes':_0x2deb69[_0x845b('0x1e')],'include':_0x2deb69[_0x845b('0x1f')]?_[_0x845b('0x20')](_0x2deb69[_0x845b('0x1f')],function(_0x5d1e8a){return{'model':db[_0x5d1e8a['model']],'as':_0x5d1e8a['as'],'attributes':_0x5d1e8a[_0x845b('0x1e')],'include':_0x5d1e8a[_0x845b('0x1f')]?_[_0x845b('0x20')](_0x5d1e8a[_0x845b('0x1f')],function(_0x345dc5){return{'model':db[_0x345dc5[_0x845b('0x21')]],'as':_0x345dc5['as'],'attributes':_0x345dc5[_0x845b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43a4cb){logger[_0x845b('0x22')](_0x845b('0x23'),_0x33e7a8);logger[_0x845b('0x24')](_0x845b('0x23'),_0x33e7a8,JSON[_0x845b('0x14')](_0x43a4cb));_0x5f486c(_0x43a4cb);})[_0x845b('0x19')](function(_0x9849f4){logger[_0x845b('0x15')]('GetVoiceQueue',_0x9849f4[_0x845b('0x17')],_0x33e7a8);_0x10f2ab(_0x597d44[_0x845b('0x15')](0x1f4,_0x9849f4[_0x845b('0x17')]));});});};exports[_0x845b('0x25')]=function(_0x457cf2){var _0x275ee5=this;return new Promise(function(_0x1f82ab,_0xa6a2d7){return db[_0x845b('0x1a')]['find']({'raw':_0x457cf2[_0x845b('0x1c')]?_0x457cf2[_0x845b('0x1c')][_0x845b('0x26')]===undefined?!![]:![]:!![],'where':_0x457cf2[_0x845b('0x1c')]?_0x457cf2[_0x845b('0x1c')][_0x845b('0x1d')]||null:null,'attributes':_0x457cf2[_0x845b('0x1c')]?_0x457cf2['options']['attributes']||null:null,'include':_0x457cf2[_0x845b('0x1c')]?_0x457cf2[_0x845b('0x1c')]['include']?_[_0x845b('0x20')](_0x457cf2['options'][_0x845b('0x1f')],function(_0x2e9c2b){return{'model':db[_0x2e9c2b['model']],'as':_0x2e9c2b['as'],'attributes':_0x2e9c2b[_0x845b('0x1e')],'include':_0x2e9c2b[_0x845b('0x1f')]?_['map'](_0x2e9c2b[_0x845b('0x1f')],function(_0x2f9f03){return{'model':db[_0x2f9f03[_0x845b('0x21')]],'as':_0x2f9f03['as'],'attributes':_0x2f9f03['attributes'],'include':_0x2f9f03['include']?_[_0x845b('0x20')](_0x2f9f03[_0x845b('0x1f')],function(_0x9ff3bf){return{'model':db[_0x9ff3bf[_0x845b('0x21')]],'as':_0x9ff3bf['as'],'attributes':_0x9ff3bf[_0x845b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x845b('0x10')](function(_0xf73d2){logger[_0x845b('0x22')](_0x845b('0x25'),_0x457cf2);logger[_0x845b('0x24')](_0x845b('0x25'),_0x457cf2,JSON[_0x845b('0x14')](_0xf73d2));_0x1f82ab(_0xf73d2);})[_0x845b('0x19')](function(_0x3867eb){logger[_0x845b('0x15')](_0x845b('0x25'),_0x3867eb['message'],_0x457cf2);_0xa6a2d7(_0x275ee5['error'](0x1f4,_0x3867eb[_0x845b('0x17')]));});});}; \ No newline at end of file +var _0xb3db=['redis','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','limit','include','model','attributes','map','stringify','ShowVoiceQueue','find','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','localhost','socket.io-emitter'];(function(_0x3359b1,_0xa6fe2d){var _0x13b60d=function(_0x5db9e1){while(--_0x5db9e1){_0x3359b1['push'](_0x3359b1['shift']());}};_0x13b60d(++_0xa6fe2d);}(_0xb3db,0x93));var _0xbb3d=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0xb3db[_0x356e8d];return _0x39e65a;};'use strict';var _=require('lodash');var util=require(_0xbb3d('0x0'));var moment=require(_0xbb3d('0x1'));var BPromise=require(_0xbb3d('0x2'));var rs=require(_0xbb3d('0x3'));var fs=require('fs');var Redis=require(_0xbb3d('0x4'));var db=require(_0xbb3d('0x5'))['db'];var utils=require(_0xbb3d('0x6'));var logger=require(_0xbb3d('0x7'))('rpc');var config=require(_0xbb3d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbb3d('0x9')][_0xbb3d('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xbb3d('0xb'),'port':0x18eb});var socket=require(_0xbb3d('0xc'))(new Redis(config[_0xbb3d('0xd')]));require(_0xbb3d('0xe'))['register'](socket);function respondWithRpcPromise(_0x48c9b3,_0x28915b,_0x15190f){return new BPromise(function(_0x11a6ee,_0x550e68){return client[_0xbb3d('0xf')](_0x48c9b3,_0x15190f)[_0xbb3d('0x10')](function(_0x87eb2a){logger['info'](_0xbb3d('0x11'),_0x28915b,_0xbb3d('0x12'));logger['debug'](_0xbb3d('0x13'),_0x28915b,_0xbb3d('0x12'),JSON['stringify'](_0x87eb2a));if(_0x87eb2a['error']){if(_0x87eb2a[_0xbb3d('0x14')][_0xbb3d('0x15')]===0x1f4){logger[_0xbb3d('0x14')](_0xbb3d('0x11'),_0x28915b,_0x87eb2a[_0xbb3d('0x14')][_0xbb3d('0x16')]);return _0x550e68(_0x87eb2a[_0xbb3d('0x14')]['message']);}logger[_0xbb3d('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x28915b,_0x87eb2a[_0xbb3d('0x14')][_0xbb3d('0x16')]);return _0x11a6ee(_0x87eb2a[_0xbb3d('0x14')][_0xbb3d('0x16')]);}else{logger[_0xbb3d('0x17')](_0xbb3d('0x11'),_0x28915b,'request\x20sent');_0x11a6ee(_0x87eb2a[_0xbb3d('0x18')][_0xbb3d('0x16')]);}})[_0xbb3d('0x19')](function(_0x489096){logger[_0xbb3d('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x28915b,_0x489096);_0x550e68(_0x489096);});});}exports[_0xbb3d('0x1a')]=function(_0x43bbd8){var _0x53cbbd=this;return new Promise(function(_0x124f73,_0x608a2e){return db['VoiceQueue'][_0xbb3d('0x1b')]({'raw':_0x43bbd8[_0xbb3d('0x1c')]?_0x43bbd8['options'][_0xbb3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x43bbd8[_0xbb3d('0x1c')]?_0x43bbd8['options'][_0xbb3d('0x1e')]||null:null,'attributes':_0x43bbd8[_0xbb3d('0x1c')]?_0x43bbd8[_0xbb3d('0x1c')]['attributes']||null:null,'limit':_0x43bbd8[_0xbb3d('0x1c')]?_0x43bbd8[_0xbb3d('0x1c')][_0xbb3d('0x1f')]||null:null,'include':_0x43bbd8[_0xbb3d('0x1c')]?_0x43bbd8[_0xbb3d('0x1c')]['include']?_['map'](_0x43bbd8['options'][_0xbb3d('0x20')],function(_0x55f487){return{'model':db[_0x55f487[_0xbb3d('0x21')]],'as':_0x55f487['as'],'attributes':_0x55f487[_0xbb3d('0x22')],'include':_0x55f487['include']?_[_0xbb3d('0x23')](_0x55f487['include'],function(_0x135dbf){return{'model':db[_0x135dbf[_0xbb3d('0x21')]],'as':_0x135dbf['as'],'attributes':_0x135dbf['attributes'],'include':_0x135dbf[_0xbb3d('0x20')]?_[_0xbb3d('0x23')](_0x135dbf[_0xbb3d('0x20')],function(_0x3528ce){return{'model':db[_0x3528ce['model']],'as':_0x3528ce['as'],'attributes':_0x3528ce['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb3d('0x10')](function(_0x5cde43){logger[_0xbb3d('0x17')]('GetVoiceQueue',_0x43bbd8);logger['debug'](_0xbb3d('0x1a'),_0x43bbd8,JSON[_0xbb3d('0x24')](_0x5cde43));_0x124f73(_0x5cde43);})[_0xbb3d('0x19')](function(_0x156486){logger['error'](_0xbb3d('0x1a'),_0x156486[_0xbb3d('0x16')],_0x43bbd8);_0x608a2e(_0x53cbbd['error'](0x1f4,_0x156486[_0xbb3d('0x16')]));});});};exports[_0xbb3d('0x25')]=function(_0x134bd1){var _0x5180e6=this;return new Promise(function(_0x56ad46,_0x3cdc51){return db['VoiceQueue'][_0xbb3d('0x26')]({'raw':_0x134bd1[_0xbb3d('0x1c')]?_0x134bd1['options'][_0xbb3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x134bd1[_0xbb3d('0x1c')]?_0x134bd1[_0xbb3d('0x1c')][_0xbb3d('0x1e')]||null:null,'attributes':_0x134bd1[_0xbb3d('0x1c')]?_0x134bd1[_0xbb3d('0x1c')][_0xbb3d('0x22')]||null:null,'include':_0x134bd1[_0xbb3d('0x1c')]?_0x134bd1[_0xbb3d('0x1c')][_0xbb3d('0x20')]?_[_0xbb3d('0x23')](_0x134bd1['options'][_0xbb3d('0x20')],function(_0x5ca99c){return{'model':db[_0x5ca99c['model']],'as':_0x5ca99c['as'],'attributes':_0x5ca99c[_0xbb3d('0x22')],'include':_0x5ca99c[_0xbb3d('0x20')]?_[_0xbb3d('0x23')](_0x5ca99c['include'],function(_0x62b3b1){return{'model':db[_0x62b3b1[_0xbb3d('0x21')]],'as':_0x62b3b1['as'],'attributes':_0x62b3b1[_0xbb3d('0x22')],'include':_0x62b3b1['include']?_[_0xbb3d('0x23')](_0x62b3b1[_0xbb3d('0x20')],function(_0x2c834c){return{'model':db[_0x2c834c[_0xbb3d('0x21')]],'as':_0x2c834c['as'],'attributes':_0x2c834c[_0xbb3d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbb3d('0x10')](function(_0x41ae35){logger[_0xbb3d('0x17')]('ShowVoiceQueue',_0x134bd1);logger[_0xbb3d('0x27')]('ShowVoiceQueue',_0x134bd1,JSON[_0xbb3d('0x24')](_0x41ae35));_0x56ad46(_0x41ae35);})[_0xbb3d('0x19')](function(_0x4b6ca1){logger[_0xbb3d('0x14')]('ShowVoiceQueue',_0x4b6ca1[_0xbb3d('0x16')],_0x134bd1);_0x3cdc51(_0x5180e6[_0xbb3d('0x14')](0x1f4,_0x4b6ca1[_0xbb3d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index cab2db7..681b82b 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 _0xc0dc=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','emit'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc0dc,0x162));var _0xcc0d=function(_0x66f289,_0x5c6baf){_0x66f289=_0x66f289-0x0;var _0x14b3e1=_0xc0dc[_0x66f289];return _0x14b3e1;};'use strict';var VoiceQueueEvents=require(_0xcc0d('0x0'));var events=[_0xcc0d('0x1'),'remove','update'];function createListener(_0x2f30dc,_0xcec81a){return function(_0x1de009){_0xcec81a[_0xcc0d('0x2')](_0x2f30dc,_0x1de009);};}function removeListener(_0x28998f,_0x568a2b){return function(){VoiceQueueEvents[_0xcc0d('0x3')](_0x28998f,_0x568a2b);};}exports[_0xcc0d('0x4')]=function(_0x4a10b5){for(var _0x3cb91a=0x0,_0x2c5927=events[_0xcc0d('0x5')];_0x3cb91a<_0x2c5927;_0x3cb91a++){var _0x51ba24=events[_0x3cb91a];var _0x1341da=createListener(_0xcc0d('0x6')+_0x51ba24,_0x4a10b5);VoiceQueueEvents['on'](_0x51ba24,_0x1341da);}}; \ No newline at end of file +var _0x34d9=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4c71f0,_0x52151f){var _0x2ceb53=function(_0x882b0e){while(--_0x882b0e){_0x4c71f0['push'](_0x4c71f0['shift']());}};_0x2ceb53(++_0x52151f);}(_0x34d9,0x19f));var _0x934d=function(_0x47dc3c,_0x3585ab){_0x47dc3c=_0x47dc3c-0x0;var _0x242bd9=_0x34d9[_0x47dc3c];return _0x242bd9;};'use strict';var VoiceQueueEvents=require(_0x934d('0x0'));var events=[_0x934d('0x1'),_0x934d('0x2'),_0x934d('0x3')];function createListener(_0x23af29,_0x394e26){return function(_0x50b8e5){_0x394e26[_0x934d('0x4')](_0x23af29,_0x50b8e5);};}function removeListener(_0x74b085,_0x3d5592){return function(){VoiceQueueEvents[_0x934d('0x5')](_0x74b085,_0x3d5592);};}exports[_0x934d('0x6')]=function(_0x7950b6){for(var _0x4acc94=0x0,_0x49230c=events[_0x934d('0x7')];_0x4acc94<_0x49230c;_0x4acc94++){var _0x1287b9=events[_0x4acc94];var _0x1493a9=createListener(_0x934d('0x8')+_0x1287b9,_0x7950b6);VoiceQueueEvents['on'](_0x1287b9,_0x1493a9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 259fd50..88539c5 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 _0x9700=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','isAuthenticated','describe','/index','/:id','show','post','create','delete','destroy','exports','util'];(function(_0xfc84ed,_0x32ee8a){var _0xb5fba1=function(_0x1e3938){while(--_0x1e3938){_0xfc84ed['push'](_0xfc84ed['shift']());}};_0xb5fba1(++_0x32ee8a);}(_0x9700,0xaa));var _0x0970=function(_0x58d608,_0x44b47b){_0x58d608=_0x58d608-0x0;var _0x48eebb=_0x9700[_0x58d608];return _0x48eebb;};'use strict';var multer=require('multer');var util=require(_0x0970('0x0'));var path=require('path');var timeout=require(_0x0970('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0970('0x2'));var auth=require(_0x0970('0x3'));var interaction=require(_0x0970('0x4'));var config=require(_0x0970('0x5'));var controller=require(_0x0970('0x6'));router[_0x0970('0x7')]('/',auth['isAuthenticated'](),controller[_0x0970('0x8')]);router[_0x0970('0x7')]('/describe',auth[_0x0970('0x9')](),controller[_0x0970('0xa')]);router[_0x0970('0x7')](_0x0970('0xb'),auth[_0x0970('0x9')](),controller['getVoiceQueuesReport']);router[_0x0970('0x7')](_0x0970('0xc'),auth[_0x0970('0x9')](),controller[_0x0970('0xd')]);router[_0x0970('0xe')]('/',auth[_0x0970('0x9')](),controller[_0x0970('0xf')]);router['put'](_0x0970('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x0970('0x10')](_0x0970('0xc'),auth[_0x0970('0x9')](),controller[_0x0970('0x11')]);module[_0x0970('0x12')]=router; \ No newline at end of file +var _0x8a44=['put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create'];(function(_0x85cb49,_0x50a08a){var _0x52f463=function(_0x3e816b){while(--_0x3e816b){_0x85cb49['push'](_0x85cb49['shift']());}};_0x52f463(++_0x50a08a);}(_0x8a44,0x18a));var _0x48a4=function(_0x48f768,_0x21b043){_0x48f768=_0x48f768-0x0;var _0x267fad=_0x8a44[_0x48f768];return _0x267fad;};'use strict';var multer=require(_0x48a4('0x0'));var util=require(_0x48a4('0x1'));var path=require(_0x48a4('0x2'));var timeout=require(_0x48a4('0x3'));var express=require(_0x48a4('0x4'));var router=express[_0x48a4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x48a4('0x6'));var config=require(_0x48a4('0x7'));var controller=require(_0x48a4('0x8'));router[_0x48a4('0x9')]('/',auth[_0x48a4('0xa')](),controller[_0x48a4('0xb')]);router[_0x48a4('0x9')](_0x48a4('0xc'),auth['isAuthenticated'](),controller[_0x48a4('0xd')]);router[_0x48a4('0x9')](_0x48a4('0xe'),auth[_0x48a4('0xa')](),controller[_0x48a4('0xf')]);router[_0x48a4('0x9')](_0x48a4('0x10'),auth['isAuthenticated'](),controller[_0x48a4('0x11')]);router[_0x48a4('0x12')]('/',auth[_0x48a4('0xa')](),controller[_0x48a4('0x13')]);router[_0x48a4('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x48a4('0x15')]);router['delete'](_0x48a4('0x10'),auth[_0x48a4('0xa')](),controller['destroy']);module[_0x48a4('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ea4d15a..c0f4faa 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 _0x7c1d=['queuecallerjoinAt','format','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x261a95,_0x5c1633){var _0x59f6a8=function(_0xeb8c0d){while(--_0xeb8c0d){_0x261a95['push'](_0x261a95['shift']());}};_0x59f6a8(++_0x5c1633);}(_0x7c1d,0x168));var _0xd7c1=function(_0x4311d9,_0x76b165){_0x4311d9=_0x4311d9-0x0;var _0x33c36a=_0x7c1d[_0x4311d9];return _0x33c36a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd7c1('0x0')]={'type':{'type':Sequelize[_0xd7c1('0x1')]},'uniqueid':{'type':Sequelize[_0xd7c1('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd7c1('0x1')]},'queue':{'type':Sequelize[_0xd7c1('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xd7c1('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xd7c1('0x2')],'set':function(_0x383aef){var _0x5bb79c=moment(_0x383aef);var _0x47d72d=moment(this['getDataValue'](_0xd7c1('0x3')))[_0xd7c1('0x4')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5cb25a=_0x5bb79c['diff'](_0x47d72d,'seconds');this[_0xd7c1('0x5')](_0xd7c1('0x6'),_0x383aef);this[_0xd7c1('0x5')](_0xd7c1('0x7'),_0x5cb25a||null);}},'position':{'type':Sequelize[_0xd7c1('0x8')]},'count':{'type':Sequelize[_0xd7c1('0x8')]},'queuecallerabandon':{'type':Sequelize[_0xd7c1('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xd7c1('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xd7c1('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd7c1('0x2')]},'queuecallerexit':{'type':Sequelize[_0xd7c1('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xd7c1('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xd7c1('0x1')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xd7c1('0x8')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd7c1('0x1')]},'connectedlinename':{'type':Sequelize[_0xd7c1('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd7c1('0x1')]},'exten':{'type':Sequelize[_0xd7c1('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xd7c1('0x8')]},'mohtime':{'type':Sequelize[_0xd7c1('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd7c1('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd7c1('0x1')]},'transfer':{'type':Sequelize[_0xd7c1('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd7c1('0x1')],'comment':_0xd7c1('0xa')},'transferexten':{'type':Sequelize[_0xd7c1('0x1')]},'transferuniqueid':{'type':Sequelize[_0xd7c1('0x1')]},'disposition':{'type':Sequelize[_0xd7c1('0x1')]},'secondDisposition':{'type':Sequelize[_0xd7c1('0x1')]},'thirdDisposition':{'type':Sequelize[_0xd7c1('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xd7c1('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3ee9=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x3ee9,0x146));var _0x93ee=function(_0x39a1d7,_0x4d037f){_0x39a1d7=_0x39a1d7-0x0;var _0x4742e2=_0x3ee9[_0x39a1d7];return _0x4742e2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x93ee('0x0'));module[_0x93ee('0x1')]={'type':{'type':Sequelize[_0x93ee('0x2')]},'uniqueid':{'type':Sequelize[_0x93ee('0x2')]},'calleridnum':{'type':Sequelize[_0x93ee('0x2')]},'calleridname':{'type':Sequelize[_0x93ee('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x93ee('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x93ee('0x3')],'set':function(_0xc5be82){var _0x258a67=moment(_0xc5be82);var _0x6bd162=moment(this[_0x93ee('0x4')](_0x93ee('0x5')))[_0x93ee('0x6')](_0x93ee('0x7'));var _0x58126d=_0x258a67[_0x93ee('0x8')](_0x6bd162,_0x93ee('0x9'));this['setDataValue']('queuecallerleaveAt',_0xc5be82);this[_0x93ee('0xa')](_0x93ee('0xb'),_0x58126d||null);}},'position':{'type':Sequelize[_0x93ee('0xc')]},'count':{'type':Sequelize[_0x93ee('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x93ee('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x93ee('0x3')]},'queuecallerexit':{'type':Sequelize[_0x93ee('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x93ee('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x93ee('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x93ee('0xc')]},'channel':{'type':Sequelize[_0x93ee('0x2')]},'connectedlinenum':{'type':Sequelize[_0x93ee('0x2')]},'connectedlinename':{'type':Sequelize[_0x93ee('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x93ee('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x93ee('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x93ee('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x93ee('0x2')]},'transfer':{'type':Sequelize[_0x93ee('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x93ee('0x2')],'comment':_0x93ee('0xe')},'transferexten':{'type':Sequelize[_0x93ee('0x2')]},'transferuniqueid':{'type':Sequelize[_0x93ee('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x93ee('0x2')]},'thirdDisposition':{'type':Sequelize[_0x93ee('0x2')]},'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 6cdc22b..4d1fa4c 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 _0x662c=['nolimit','pick','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','json','offset','limit','count','status','set','apply','update','then','destroy','error','stack','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','VIRTUAL','name','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','getVoiceQueuesReport','hasOwnProperty'];(function(_0x2e7b6e,_0x399033){var _0x209ef0=function(_0x339c88){while(--_0x339c88){_0x2e7b6e['push'](_0x2e7b6e['shift']());}};_0x209ef0(++_0x399033);}(_0x662c,0x132));var _0xc662=function(_0x11c045,_0x215060){_0x11c045=_0x11c045-0x0;var _0x457230=_0x662c[_0x11c045];return _0x457230;};'use strict';var emlformat=require(_0xc662('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc662('0x1'));var jsonpatch=require(_0xc662('0x2'));var rp=require('request-promise');var moment=require(_0xc662('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc662('0x4'));var util=require(_0xc662('0x5'));var path=require(_0xc662('0x6'));var sox=require(_0xc662('0x7'));var csv=require(_0xc662('0x8'));var ejs=require(_0xc662('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc662('0xa'));var squel=require(_0xc662('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc662('0xc'));var Papa=require(_0xc662('0xd'));var Redis=require('ioredis');var authService=require(_0xc662('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc662('0xf'));var logger=require(_0xc662('0x10'))(_0xc662('0x11'));var utils=require('../../config/utils');var config=require(_0xc662('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc662('0x13'))['db'];config['redis']=_[_0xc662('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc662('0x15'))(new Redis(config['redis']));require(_0xc662('0x16'))[_0xc662('0x17')](socket);function respondWithStatusCode(_0x169400,_0x13a6d2){_0x13a6d2=_0x13a6d2||0xcc;return function(_0x5bd0ab){if(_0x5bd0ab){return _0x169400[_0xc662('0x18')](_0x13a6d2);}return _0x169400['status'](_0x13a6d2)['end']();};}function respondWithResult(_0x253ddd,_0x1fb671){_0x1fb671=_0x1fb671||0xc8;return function(_0x1a1013){if(_0x1a1013){return _0x253ddd['status'](_0x1fb671)[_0xc662('0x19')](_0x1a1013);}};}function respondWithFilteredResult(_0x361aca,_0x524b68){return function(_0x20b81e){if(_0x20b81e){var _0x3fb998=typeof _0x524b68[_0xc662('0x1a')]==='undefined'&&typeof _0x524b68[_0xc662('0x1b')]==='undefined';var _0x1aced4=_0x20b81e[_0xc662('0x1c')];var _0x455a88=_0x3fb998?0x0:_0x524b68[_0xc662('0x1a')];var _0x377ae5=_0x3fb998?_0x20b81e[_0xc662('0x1c')]:_0x524b68[_0xc662('0x1a')]+_0x524b68[_0xc662('0x1b')];var _0x40f0d8;if(_0x377ae5>=_0x1aced4){_0x377ae5=_0x1aced4;_0x40f0d8=0xc8;}else{_0x40f0d8=0xce;}_0x361aca[_0xc662('0x1d')](_0x40f0d8);return _0x361aca[_0xc662('0x1e')]('Content-Range',_0x455a88+'-'+_0x377ae5+'/'+_0x1aced4)[_0xc662('0x19')](_0x20b81e);}return null;};}function patchUpdates(_0x2752ac){return function(_0x4e5b30){try{jsonpatch[_0xc662('0x1f')](_0x4e5b30,_0x2752ac,!![]);}catch(_0x3646cd){return BPromise['reject'](_0x3646cd);}return _0x4e5b30['save']();};}function saveUpdates(_0x34d534,_0xb60693){return function(_0x268c42){if(_0x268c42){return _0x268c42[_0xc662('0x20')](_0x34d534)[_0xc662('0x21')](function(_0x4e15ec){return _0x4e15ec;});}return null;};}function removeEntity(_0x2e232d,_0x533d24){return function(_0x3dbcd2){if(_0x3dbcd2){return _0x3dbcd2[_0xc662('0x22')]()[_0xc662('0x21')](function(){_0x2e232d[_0xc662('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b742,_0x4d7d2e){return function(_0x183eed){if(!_0x183eed){_0x35b742[_0xc662('0x18')](0x194);}return _0x183eed;};}function handleError(_0x4fb5fd,_0x58220a){_0x58220a=_0x58220a||0x1f4;return function(_0x3b0aba){logger[_0xc662('0x23')](_0x3b0aba[_0xc662('0x24')]);if(_0x3b0aba['name']){delete _0x3b0aba['name'];}_0x4fb5fd[_0xc662('0x1d')](_0x58220a)[_0xc662('0x25')](_0x3b0aba);};}exports[_0xc662('0x26')]=function(_0x464285,_0x533057){var _0x400f94={},_0x41b274={},_0x5af0c5={'count':0x0,'rows':[]};var _0xd76666=_[_0xc662('0x27')](db[_0xc662('0x28')][_0xc662('0x29')],function(_0x2cac62){return{'name':_0x2cac62[_0xc662('0x2a')],'type':_0x2cac62[_0xc662('0x2b')][_0xc662('0x2c')]};});_0x41b274[_0xc662('0x2d')]=_[_0xc662('0x27')](_0xd76666,'name');_0x41b274[_0xc662('0x2e')]=_[_0xc662('0x2f')](_0x464285[_0xc662('0x2e')]);_0x41b274[_0xc662('0x30')]=_[_0xc662('0x31')](_0x41b274['model'],_0x41b274['query']);_0x400f94['attributes']=_[_0xc662('0x31')](_0x41b274['model'],qs[_0xc662('0x32')](_0x464285[_0xc662('0x2e')][_0xc662('0x32')]));_0x400f94[_0xc662('0x33')]=_0x400f94['attributes']['length']?_0x400f94[_0xc662('0x33')]:_0x41b274['model'];if(!_0x464285[_0xc662('0x2e')]['hasOwnProperty']('nolimit')){_0x400f94[_0xc662('0x1b')]=qs[_0xc662('0x1b')](_0x464285[_0xc662('0x2e')][_0xc662('0x1b')]);_0x400f94['offset']=qs[_0xc662('0x1a')](_0x464285[_0xc662('0x2e')]['offset']);}_0x400f94[_0xc662('0x34')]=qs[_0xc662('0x35')](_0x464285['query']['sort']);_0x400f94[_0xc662('0x36')]=qs[_0xc662('0x30')](_['pick'](_0x464285[_0xc662('0x2e')],_0x41b274[_0xc662('0x30')]),_0xd76666);if(_0x464285['query']['filter']){_0x400f94['where']=_['merge'](_0x400f94[_0xc662('0x36')],{'$or':_['map'](_0xd76666,function(_0xa61284){if(_0xa61284[_0xc662('0x2b')]!==_0xc662('0x37')){var _0x147be8={};_0x147be8[_0xa61284[_0xc662('0x38')]]={'$like':'%'+_0x464285[_0xc662('0x2e')][_0xc662('0x39')]+'%'};return _0x147be8;}})});}_0x400f94=_[_0xc662('0x3a')]({},_0x400f94,_0x464285[_0xc662('0x3b')]);var _0x53e26d={'where':_0x400f94[_0xc662('0x36')]};return db[_0xc662('0x28')]['count'](_0x53e26d)[_0xc662('0x21')](function(_0x3668ca){_0x5af0c5[_0xc662('0x1c')]=_0x3668ca;if(_0x464285['query']['includeAll']){_0x400f94[_0xc662('0x3c')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xc662('0x3d')](_0x400f94);})[_0xc662('0x21')](function(_0x21df8b){_0x5af0c5[_0xc662('0x3e')]=_0x21df8b;return _0x5af0c5;})['then'](respondWithFilteredResult(_0x533057,_0x400f94))[_0xc662('0x3f')](handleError(_0x533057,null));};exports[_0xc662('0x40')]=function(_0x4f3559,_0x39e4eb){var _0x489e97={'raw':![],'where':{'id':_0x4f3559[_0xc662('0x41')]['id']}},_0xa76765={};_0xa76765[_0xc662('0x2d')]=_[_0xc662('0x2f')](db['VoiceQueueReport'][_0xc662('0x29')]);_0xa76765[_0xc662('0x2e')]=_[_0xc662('0x2f')](_0x4f3559[_0xc662('0x2e')]);_0xa76765[_0xc662('0x30')]=_[_0xc662('0x31')](_0xa76765[_0xc662('0x2d')],_0xa76765[_0xc662('0x2e')]);_0x489e97[_0xc662('0x33')]=_[_0xc662('0x31')](_0xa76765[_0xc662('0x2d')],qs[_0xc662('0x32')](_0x4f3559[_0xc662('0x2e')]['fields']));_0x489e97['attributes']=_0x489e97['attributes'][_0xc662('0x42')]?_0x489e97[_0xc662('0x33')]:_0xa76765[_0xc662('0x2d')];if(_0x4f3559[_0xc662('0x2e')][_0xc662('0x43')]){_0x489e97[_0xc662('0x3c')]=[{'all':!![]}];}_0x489e97=_['merge']({},_0x489e97,_0x4f3559[_0xc662('0x3b')]);return db['VoiceQueueReport']['find'](_0x489e97)['then'](handleEntityNotFound(_0x39e4eb,null))[_0xc662('0x21')](respondWithResult(_0x39e4eb,null))[_0xc662('0x3f')](handleError(_0x39e4eb,null));};exports[_0xc662('0x44')]=function(_0x4753f3,_0x5f78a6){return db[_0xc662('0x28')][_0xc662('0x44')](_0x4753f3['body'],{})[_0xc662('0x21')](respondWithResult(_0x5f78a6,0xc9))[_0xc662('0x3f')](handleError(_0x5f78a6,null));};exports[_0xc662('0x20')]=function(_0x4a373c,_0x2be140){if(_0x4a373c[_0xc662('0x45')]['id']){delete _0x4a373c[_0xc662('0x45')]['id'];}return db[_0xc662('0x28')][_0xc662('0x46')]({'where':{'id':_0x4a373c[_0xc662('0x41')]['id']}})[_0xc662('0x21')](handleEntityNotFound(_0x2be140,null))[_0xc662('0x21')](saveUpdates(_0x4a373c[_0xc662('0x45')],null))['then'](respondWithResult(_0x2be140,null))[_0xc662('0x3f')](handleError(_0x2be140,null));};exports[_0xc662('0x22')]=function(_0x519ecd,_0x5a7842){return db['VoiceQueueReport'][_0xc662('0x46')]({'where':{'id':_0x519ecd[_0xc662('0x41')]['id']}})[_0xc662('0x21')](handleEntityNotFound(_0x5a7842,null))[_0xc662('0x21')](removeEntity(_0x5a7842,null))[_0xc662('0x3f')](handleError(_0x5a7842,null));};exports[_0xc662('0x47')]=function(_0x390f7a,_0x3d906b){return db[_0xc662('0x28')][_0xc662('0x47')]()['then'](respondWithResult(_0x3d906b,null))[_0xc662('0x3f')](handleError(_0x3d906b,null));};exports[_0xc662('0x48')]=function(_0x5c1438,_0xf9e174){var _0x10afd3={},_0x45aebe={},_0x54755e={'count':0x0,'rows':[]};_0x45aebe[_0xc662('0x2d')]=_[_0xc662('0x2f')](db[_0xc662('0x28')][_0xc662('0x29')]);_0x45aebe[_0xc662('0x2e')]=_[_0xc662('0x2f')](_0x5c1438[_0xc662('0x2e')]);_0x45aebe['filters']=_[_0xc662('0x31')](_0x45aebe[_0xc662('0x2d')],_0x45aebe['query']);_0x10afd3['attributes']=_[_0xc662('0x31')](_0x45aebe[_0xc662('0x2d')],qs[_0xc662('0x32')](_0x5c1438[_0xc662('0x2e')][_0xc662('0x32')]));_0x10afd3['attributes']=_0x10afd3[_0xc662('0x33')][_0xc662('0x42')]?_0x10afd3[_0xc662('0x33')]:_0x45aebe[_0xc662('0x2d')];if(!_0x5c1438[_0xc662('0x2e')][_0xc662('0x49')](_0xc662('0x4a'))){_0x10afd3[_0xc662('0x1b')]=qs[_0xc662('0x1b')](_0x5c1438[_0xc662('0x2e')][_0xc662('0x1b')]);_0x10afd3[_0xc662('0x1a')]=qs['offset'](_0x5c1438[_0xc662('0x2e')][_0xc662('0x1a')]);}_0x10afd3[_0xc662('0x34')]=qs[_0xc662('0x35')](_0x5c1438['query'][_0xc662('0x35')]);_0x10afd3[_0xc662('0x36')]=qs[_0xc662('0x30')](_[_0xc662('0x4b')](_0x5c1438[_0xc662('0x2e')],_0x45aebe['filters']));if(_0x5c1438[_0xc662('0x2e')][_0xc662('0x39')]){_0x10afd3[_0xc662('0x36')]=_[_0xc662('0x3a')](_0x10afd3[_0xc662('0x36')],{'$or':_[_0xc662('0x27')](_0x10afd3[_0xc662('0x33')],function(_0x1ab872){var _0x4b42ad={};_0x4b42ad[_0x1ab872]={'$like':'%'+_0x5c1438['query'][_0xc662('0x39')]+'%'};return _0x4b42ad;})});}_0x10afd3=_['merge']({},_0x10afd3,_0x5c1438[_0xc662('0x3b')]);var _0xfd3644={'where':_0x10afd3[_0xc662('0x36')]};return db[_0xc662('0x28')][_0xc662('0x1c')](_0xfd3644)[_0xc662('0x21')](function(_0x401fde){_0x54755e[_0xc662('0x1c')]=_0x401fde;if(_0x5c1438[_0xc662('0x2e')][_0xc662('0x43')]){_0x10afd3[_0xc662('0x3c')]=[{'all':!![]}];}return db[_0xc662('0x28')][_0xc662('0x3d')](_0x10afd3);})[_0xc662('0x21')](function(_0x13b56a){_0x54755e['rows']=_0x13b56a;return _0x54755e;})[_0xc662('0x21')](respondWithFilteredResult(_0xf9e174,_0x10afd3,'getVoiceQueuesReport'))[_0xc662('0x3f')](handleError(_0xf9e174,null,_0xc662('0x48')));}; \ No newline at end of file +var _0x2a78=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','register','status','end','offset','undefined','count','json','save','then','destroy','sendStatus','error','name','send','index','VoiceQueueReport','rawAttributes','fieldName','key','keys','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','catch','show','find','create','body','update','params','describe','getVoiceQueuesReport','rows','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x2a074f,_0x29fb77){var _0x3452a8=function(_0x297511){while(--_0x297511){_0x2a074f['push'](_0x2a074f['shift']());}};_0x3452a8(++_0x29fb77);}(_0x2a78,0x174));var _0x82a7=function(_0x50e1c3,_0x88f63c){_0x50e1c3=_0x50e1c3-0x0;var _0x31ac77=_0x2a78[_0x50e1c3];return _0x31ac77;};'use strict';var emlformat=require(_0x82a7('0x0'));var rimraf=require(_0x82a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82a7('0x2'));var rp=require('request-promise');var moment=require(_0x82a7('0x3'));var BPromise=require(_0x82a7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x82a7('0x5'));var sox=require(_0x82a7('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82a7('0x7'));var _=require(_0x82a7('0x8'));var squel=require(_0x82a7('0x9'));var crypto=require('crypto');var jsforce=require(_0x82a7('0xa'));var deskjs=require(_0x82a7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x82a7('0xc'));var Papa=require(_0x82a7('0xd'));var Redis=require(_0x82a7('0xe'));var authService=require(_0x82a7('0xf'));var qs=require(_0x82a7('0x10'));var as=require(_0x82a7('0x11'));var hardwareService=require(_0x82a7('0x12'));var logger=require(_0x82a7('0x13'))(_0x82a7('0x14'));var utils=require('../../config/utils');var config=require(_0x82a7('0x15'));var licenseUtil=require(_0x82a7('0x16'));var db=require('../../mysqldb')['db'];config[_0x82a7('0x17')]=_[_0x82a7('0x18')](config[_0x82a7('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82a7('0x17')]));require('./voiceQueueReport.socket')[_0x82a7('0x19')](socket);function respondWithStatusCode(_0x58b790,_0x317b55){_0x317b55=_0x317b55||0xcc;return function(_0x2e4f44){if(_0x2e4f44){return _0x58b790['sendStatus'](_0x317b55);}return _0x58b790[_0x82a7('0x1a')](_0x317b55)[_0x82a7('0x1b')]();};}function respondWithResult(_0x5218af,_0x6cd872){_0x6cd872=_0x6cd872||0xc8;return function(_0x109948){if(_0x109948){return _0x5218af[_0x82a7('0x1a')](_0x6cd872)['json'](_0x109948);}};}function respondWithFilteredResult(_0x5a5ca4,_0x481121){return function(_0x179e26){if(_0x179e26){var _0x36a073=typeof _0x481121[_0x82a7('0x1c')]===_0x82a7('0x1d')&&typeof _0x481121['limit']===_0x82a7('0x1d');var _0xd1dd52=_0x179e26[_0x82a7('0x1e')];var _0x782b1=_0x36a073?0x0:_0x481121['offset'];var _0x30bc4b=_0x36a073?_0x179e26[_0x82a7('0x1e')]:_0x481121['offset']+_0x481121['limit'];var _0x1ec3f5;if(_0x30bc4b>=_0xd1dd52){_0x30bc4b=_0xd1dd52;_0x1ec3f5=0xc8;}else{_0x1ec3f5=0xce;}_0x5a5ca4[_0x82a7('0x1a')](_0x1ec3f5);return _0x5a5ca4['set']('Content-Range',_0x782b1+'-'+_0x30bc4b+'/'+_0xd1dd52)[_0x82a7('0x1f')](_0x179e26);}return null;};}function patchUpdates(_0x5b2298){return function(_0x30f4db){try{jsonpatch['apply'](_0x30f4db,_0x5b2298,!![]);}catch(_0x13e858){return BPromise['reject'](_0x13e858);}return _0x30f4db[_0x82a7('0x20')]();};}function saveUpdates(_0x2e9159,_0x1d00bf){return function(_0x40b34a){if(_0x40b34a){return _0x40b34a['update'](_0x2e9159)[_0x82a7('0x21')](function(_0x503b8d){return _0x503b8d;});}return null;};}function removeEntity(_0x10789d,_0x3d0741){return function(_0x8c4274){if(_0x8c4274){return _0x8c4274[_0x82a7('0x22')]()[_0x82a7('0x21')](function(){_0x10789d[_0x82a7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b60ef,_0x3e2626){return function(_0x21aa95){if(!_0x21aa95){_0x5b60ef[_0x82a7('0x23')](0x194);}return _0x21aa95;};}function handleError(_0x23e81f,_0x67ae6f){_0x67ae6f=_0x67ae6f||0x1f4;return function(_0x10a27c){logger[_0x82a7('0x24')](_0x10a27c['stack']);if(_0x10a27c[_0x82a7('0x25')]){delete _0x10a27c['name'];}_0x23e81f['status'](_0x67ae6f)[_0x82a7('0x26')](_0x10a27c);};}exports[_0x82a7('0x27')]=function(_0x33ba7f,_0x329314){var _0x46e588={},_0x24b5c5={},_0x2f5248={'count':0x0,'rows':[]};var _0x411b90=_['map'](db[_0x82a7('0x28')][_0x82a7('0x29')],function(_0x17d4bf){return{'name':_0x17d4bf[_0x82a7('0x2a')],'type':_0x17d4bf['type'][_0x82a7('0x2b')]};});_0x24b5c5['model']=_['map'](_0x411b90,_0x82a7('0x25'));_0x24b5c5['query']=_[_0x82a7('0x2c')](_0x33ba7f['query']);_0x24b5c5['filters']=_[_0x82a7('0x2d')](_0x24b5c5[_0x82a7('0x2e')],_0x24b5c5['query']);_0x46e588[_0x82a7('0x2f')]=_[_0x82a7('0x2d')](_0x24b5c5[_0x82a7('0x2e')],qs['fields'](_0x33ba7f[_0x82a7('0x30')][_0x82a7('0x31')]));_0x46e588['attributes']=_0x46e588[_0x82a7('0x2f')][_0x82a7('0x32')]?_0x46e588[_0x82a7('0x2f')]:_0x24b5c5[_0x82a7('0x2e')];if(!_0x33ba7f[_0x82a7('0x30')][_0x82a7('0x33')](_0x82a7('0x34'))){_0x46e588[_0x82a7('0x35')]=qs[_0x82a7('0x35')](_0x33ba7f[_0x82a7('0x30')][_0x82a7('0x35')]);_0x46e588[_0x82a7('0x1c')]=qs[_0x82a7('0x1c')](_0x33ba7f[_0x82a7('0x30')][_0x82a7('0x1c')]);}_0x46e588[_0x82a7('0x36')]=qs[_0x82a7('0x37')](_0x33ba7f[_0x82a7('0x30')][_0x82a7('0x37')]);_0x46e588[_0x82a7('0x38')]=qs[_0x82a7('0x39')](_[_0x82a7('0x3a')](_0x33ba7f[_0x82a7('0x30')],_0x24b5c5['filters']),_0x411b90);if(_0x33ba7f['query'][_0x82a7('0x3b')]){_0x46e588[_0x82a7('0x38')]=_['merge'](_0x46e588[_0x82a7('0x38')],{'$or':_[_0x82a7('0x3c')](_0x411b90,function(_0x54c0e4){if(_0x54c0e4[_0x82a7('0x3d')]!==_0x82a7('0x3e')){var _0x533ee2={};_0x533ee2[_0x54c0e4[_0x82a7('0x25')]]={'$like':'%'+_0x33ba7f['query']['filter']+'%'};return _0x533ee2;}})});}_0x46e588=_[_0x82a7('0x3f')]({},_0x46e588,_0x33ba7f[_0x82a7('0x40')]);var _0x1bfdac={'where':_0x46e588[_0x82a7('0x38')]};return db[_0x82a7('0x28')]['count'](_0x1bfdac)['then'](function(_0x2ca7fb){_0x2f5248[_0x82a7('0x1e')]=_0x2ca7fb;if(_0x33ba7f[_0x82a7('0x30')][_0x82a7('0x41')]){_0x46e588[_0x82a7('0x42')]=[{'all':!![]}];}return db[_0x82a7('0x28')]['findAll'](_0x46e588);})[_0x82a7('0x21')](function(_0x4c1c69){_0x2f5248['rows']=_0x4c1c69;return _0x2f5248;})['then'](respondWithFilteredResult(_0x329314,_0x46e588))[_0x82a7('0x43')](handleError(_0x329314,null));};exports[_0x82a7('0x44')]=function(_0x3d890b,_0x2d47e2){var _0x50672b={'raw':![],'where':{'id':_0x3d890b['params']['id']}},_0x1037a0={};_0x1037a0['model']=_[_0x82a7('0x2c')](db[_0x82a7('0x28')][_0x82a7('0x29')]);_0x1037a0['query']=_[_0x82a7('0x2c')](_0x3d890b[_0x82a7('0x30')]);_0x1037a0[_0x82a7('0x39')]=_[_0x82a7('0x2d')](_0x1037a0[_0x82a7('0x2e')],_0x1037a0[_0x82a7('0x30')]);_0x50672b[_0x82a7('0x2f')]=_[_0x82a7('0x2d')](_0x1037a0[_0x82a7('0x2e')],qs[_0x82a7('0x31')](_0x3d890b['query'][_0x82a7('0x31')]));_0x50672b[_0x82a7('0x2f')]=_0x50672b[_0x82a7('0x2f')][_0x82a7('0x32')]?_0x50672b[_0x82a7('0x2f')]:_0x1037a0['model'];if(_0x3d890b['query'][_0x82a7('0x41')]){_0x50672b[_0x82a7('0x42')]=[{'all':!![]}];}_0x50672b=_['merge']({},_0x50672b,_0x3d890b[_0x82a7('0x40')]);return db['VoiceQueueReport'][_0x82a7('0x45')](_0x50672b)[_0x82a7('0x21')](handleEntityNotFound(_0x2d47e2,null))[_0x82a7('0x21')](respondWithResult(_0x2d47e2,null))[_0x82a7('0x43')](handleError(_0x2d47e2,null));};exports[_0x82a7('0x46')]=function(_0x9a896f,_0x1b1037){return db[_0x82a7('0x28')]['create'](_0x9a896f[_0x82a7('0x47')],{})[_0x82a7('0x21')](respondWithResult(_0x1b1037,0xc9))[_0x82a7('0x43')](handleError(_0x1b1037,null));};exports[_0x82a7('0x48')]=function(_0x26ab79,_0x144a7b){if(_0x26ab79[_0x82a7('0x47')]['id']){delete _0x26ab79[_0x82a7('0x47')]['id'];}return db['VoiceQueueReport'][_0x82a7('0x45')]({'where':{'id':_0x26ab79[_0x82a7('0x49')]['id']}})[_0x82a7('0x21')](handleEntityNotFound(_0x144a7b,null))[_0x82a7('0x21')](saveUpdates(_0x26ab79[_0x82a7('0x47')],null))['then'](respondWithResult(_0x144a7b,null))[_0x82a7('0x43')](handleError(_0x144a7b,null));};exports['destroy']=function(_0x28e9e4,_0x1ef9b4){return db[_0x82a7('0x28')][_0x82a7('0x45')]({'where':{'id':_0x28e9e4[_0x82a7('0x49')]['id']}})[_0x82a7('0x21')](handleEntityNotFound(_0x1ef9b4,null))[_0x82a7('0x21')](removeEntity(_0x1ef9b4,null))['catch'](handleError(_0x1ef9b4,null));};exports[_0x82a7('0x4a')]=function(_0x2c09d2,_0x80836a){return db[_0x82a7('0x28')][_0x82a7('0x4a')]()[_0x82a7('0x21')](respondWithResult(_0x80836a,null))['catch'](handleError(_0x80836a,null));};exports[_0x82a7('0x4b')]=function(_0x4b6aeb,_0x472422){var _0x3405e1={},_0x555eab={},_0x4044f8={'count':0x0,'rows':[]};_0x555eab[_0x82a7('0x2e')]=_['keys'](db[_0x82a7('0x28')]['rawAttributes']);_0x555eab[_0x82a7('0x30')]=_[_0x82a7('0x2c')](_0x4b6aeb[_0x82a7('0x30')]);_0x555eab[_0x82a7('0x39')]=_[_0x82a7('0x2d')](_0x555eab[_0x82a7('0x2e')],_0x555eab['query']);_0x3405e1[_0x82a7('0x2f')]=_[_0x82a7('0x2d')](_0x555eab[_0x82a7('0x2e')],qs[_0x82a7('0x31')](_0x4b6aeb[_0x82a7('0x30')][_0x82a7('0x31')]));_0x3405e1[_0x82a7('0x2f')]=_0x3405e1[_0x82a7('0x2f')]['length']?_0x3405e1[_0x82a7('0x2f')]:_0x555eab['model'];if(!_0x4b6aeb[_0x82a7('0x30')][_0x82a7('0x33')](_0x82a7('0x34'))){_0x3405e1[_0x82a7('0x35')]=qs[_0x82a7('0x35')](_0x4b6aeb[_0x82a7('0x30')][_0x82a7('0x35')]);_0x3405e1[_0x82a7('0x1c')]=qs[_0x82a7('0x1c')](_0x4b6aeb[_0x82a7('0x30')]['offset']);}_0x3405e1[_0x82a7('0x36')]=qs['sort'](_0x4b6aeb[_0x82a7('0x30')][_0x82a7('0x37')]);_0x3405e1[_0x82a7('0x38')]=qs['filters'](_[_0x82a7('0x3a')](_0x4b6aeb['query'],_0x555eab[_0x82a7('0x39')]));if(_0x4b6aeb[_0x82a7('0x30')][_0x82a7('0x3b')]){_0x3405e1[_0x82a7('0x38')]=_[_0x82a7('0x3f')](_0x3405e1[_0x82a7('0x38')],{'$or':_[_0x82a7('0x3c')](_0x3405e1['attributes'],function(_0x1cd0fb){var _0x38aa12={};_0x38aa12[_0x1cd0fb]={'$like':'%'+_0x4b6aeb[_0x82a7('0x30')]['filter']+'%'};return _0x38aa12;})});}_0x3405e1=_[_0x82a7('0x3f')]({},_0x3405e1,_0x4b6aeb[_0x82a7('0x40')]);var _0x35d198={'where':_0x3405e1[_0x82a7('0x38')]};return db[_0x82a7('0x28')][_0x82a7('0x1e')](_0x35d198)[_0x82a7('0x21')](function(_0x2520d2){_0x4044f8['count']=_0x2520d2;if(_0x4b6aeb['query']['includeAll']){_0x3405e1[_0x82a7('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x3405e1);})['then'](function(_0x3ea43a){_0x4044f8[_0x82a7('0x4c')]=_0x3ea43a;return _0x4044f8;})[_0x82a7('0x21')](respondWithFilteredResult(_0x472422,_0x3405e1,_0x82a7('0x4b')))[_0x82a7('0x43')](handleError(_0x472422,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 6c8df1a..6e3bd49 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 _0xdcc3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove'];(function(_0x542975,_0x3a655e){var _0x2d1e69=function(_0x3bfc64){while(--_0x3bfc64){_0x542975['push'](_0x542975['shift']());}};_0x2d1e69(++_0x3a655e);}(_0xdcc3,0x1ee));var _0x3dcc=function(_0x33b2f5,_0x34e74b){_0x33b2f5=_0x33b2f5-0x0;var _0x51b93a=_0xdcc3[_0x33b2f5];return _0x51b93a;};'use strict';var EventEmitter=require(_0x3dcc('0x0'));var VoiceQueueReport=require(_0x3dcc('0x1'))['db'][_0x3dcc('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3dcc('0x3')](0x0);var events={'afterCreate':_0x3dcc('0x4'),'afterUpdate':'update','afterDestroy':_0x3dcc('0x5')};function emitEvent(_0x4c0576){return function(_0x854a7a,_0x4bb203,_0x195c2c){VoiceQueueReportEvents['emit'](_0x4c0576+':'+_0x854a7a['id'],_0x854a7a);VoiceQueueReportEvents[_0x3dcc('0x6')](_0x4c0576,_0x854a7a);_0x195c2c(null);};}for(var e in events){if(events[_0x3dcc('0x7')](e)){var event=events[e];VoiceQueueReport[_0x3dcc('0x8')](e,emitEvent(event));}}module[_0x3dcc('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x9673=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x34d4b0,_0x966fe1){var _0x57c491=function(_0x50e6e0){while(--_0x50e6e0){_0x34d4b0['push'](_0x34d4b0['shift']());}};_0x57c491(++_0x966fe1);}(_0x9673,0x9e));var _0x3967=function(_0x564b73,_0x51cd68){_0x564b73=_0x564b73-0x0;var _0x41d141=_0x9673[_0x564b73];return _0x41d141;};'use strict';var EventEmitter=require(_0x3967('0x0'));var VoiceQueueReport=require(_0x3967('0x1'))['db'][_0x3967('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3967('0x3')](0x0);var events={'afterCreate':_0x3967('0x4'),'afterUpdate':_0x3967('0x5'),'afterDestroy':_0x3967('0x6')};function emitEvent(_0x2459d2){return function(_0x4e8833,_0x217edd,_0xf048d7){VoiceQueueReportEvents[_0x3967('0x7')](_0x2459d2+':'+_0x4e8833['id'],_0x4e8833);VoiceQueueReportEvents[_0x3967('0x7')](_0x2459d2,_0x4e8833);_0xf048d7(null);};}for(var e in events){if(events[_0x3967('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x3967('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 01d0ed1..812c364 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 _0x55b0=['moment','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x2b7ec2,_0x2e2688){var _0xb6d9d1=function(_0x4282a5){while(--_0x4282a5){_0x2b7ec2['push'](_0x2b7ec2['shift']());}};_0xb6d9d1(++_0x2e2688);}(_0x55b0,0x88));var _0x055b=function(_0x53af78,_0x4ae9e3){_0x53af78=_0x53af78-0x0;var _0x4c8738=_0x55b0[_0x53af78];return _0x4c8738;};'use strict';var _=require(_0x055b('0x0'));var util=require(_0x055b('0x1'));var logger=require(_0x055b('0x2'))(_0x055b('0x3'));var moment=require(_0x055b('0x4'));var BPromise=require(_0x055b('0x5'));var rp=require(_0x055b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x055b('0x7'));var attributes=require(_0x055b('0x8'));module['exports']=function(_0x1f44af,_0x46e0ec){return _0x1f44af[_0x055b('0x9')](_0x055b('0xa'),attributes,{'tableName':_0x055b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x055b('0xc')]},{'fields':[_0x055b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3d4=['request-promise','path','rimraf','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x17a3b3,_0x55e4e9){var _0x1d9729=function(_0x2832a2){while(--_0x2832a2){_0x17a3b3['push'](_0x17a3b3['shift']());}};_0x1d9729(++_0x55e4e9);}(_0xe3d4,0x112));var _0x4e3d=function(_0x58b14b,_0x5ab912){_0x58b14b=_0x58b14b-0x0;var _0x5aec73=_0xe3d4[_0x58b14b];return _0x5aec73;};'use strict';var _=require(_0x4e3d('0x0'));var util=require(_0x4e3d('0x1'));var logger=require(_0x4e3d('0x2'))(_0x4e3d('0x3'));var moment=require(_0x4e3d('0x4'));var BPromise=require(_0x4e3d('0x5'));var rp=require(_0x4e3d('0x6'));var fs=require('fs');var path=require(_0x4e3d('0x7'));var rimraf=require(_0x4e3d('0x8'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x4e3d('0x9')]=function(_0x5834ee,_0x2fb53f){return _0x5834ee['define'](_0x4e3d('0xa'),attributes,{'tableName':_0x4e3d('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4e3d('0xc')]},{'fields':[_0x4e3d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 32a01d1..052f052 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 _0x3b98=['request','then','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueueReport,\x20%s,\x20%s','result','VoiceQueueReport','findAll','options','raw','where','limit','map','include','attributes','model','info','GetVoiceQueueReport','catch','CreateVoiceQueueReport','body','debug','UpdateVoiceQueueReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x3b98,0x8f));var _0x83b9=function(_0x495f97,_0x5ed0a7){_0x495f97=_0x495f97-0x0;var _0x54b979=_0x3b98[_0x495f97];return _0x54b979;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x83b9('0x0'));var rs=require(_0x83b9('0x1'));var fs=require('fs');var Redis=require(_0x83b9('0x2'));var db=require(_0x83b9('0x3'))['db'];var utils=require(_0x83b9('0x4'));var logger=require(_0x83b9('0x5'))(_0x83b9('0x6'));var config=require(_0x83b9('0x7'));var jayson=require(_0x83b9('0x8'));var client=jayson[_0x83b9('0x9')][_0x83b9('0xa')]({'port':0x232a});config[_0x83b9('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x83b9('0xc'))(new Redis(config[_0x83b9('0xb')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x539e7c,_0xa28753,_0x4975b3){return new BPromise(function(_0x514a0f,_0x340672){return client[_0x83b9('0xd')](_0x539e7c,_0x4975b3)[_0x83b9('0xe')](function(_0x39cf70){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0xa28753,_0x83b9('0xf'));logger['debug'](_0x83b9('0x10'),_0xa28753,'request\x20sent',JSON[_0x83b9('0x11')](_0x39cf70));if(_0x39cf70['error']){if(_0x39cf70[_0x83b9('0x12')]['code']===0x1f4){logger[_0x83b9('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0xa28753,_0x39cf70[_0x83b9('0x12')][_0x83b9('0x13')]);return _0x340672(_0x39cf70[_0x83b9('0x12')]['message']);}logger[_0x83b9('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0xa28753,_0x39cf70[_0x83b9('0x12')][_0x83b9('0x13')]);return _0x514a0f(_0x39cf70[_0x83b9('0x12')][_0x83b9('0x13')]);}else{logger['info'](_0x83b9('0x14'),_0xa28753,_0x83b9('0xf'));_0x514a0f(_0x39cf70[_0x83b9('0x15')][_0x83b9('0x13')]);}})['catch'](function(_0x4682e2){logger[_0x83b9('0x12')](_0x83b9('0x14'),_0xa28753,_0x4682e2);_0x340672(_0x4682e2);});});}exports['GetVoiceQueueReport']=function(_0x55e250){var _0x2a0626=this;return new Promise(function(_0x304f7d,_0x5ce23c){return db[_0x83b9('0x16')][_0x83b9('0x17')]({'raw':_0x55e250[_0x83b9('0x18')]?_0x55e250[_0x83b9('0x18')][_0x83b9('0x19')]===undefined?!![]:![]:!![],'where':_0x55e250['options']?_0x55e250[_0x83b9('0x18')][_0x83b9('0x1a')]||null:null,'attributes':_0x55e250[_0x83b9('0x18')]?_0x55e250[_0x83b9('0x18')]['attributes']||null:null,'limit':_0x55e250[_0x83b9('0x18')]?_0x55e250[_0x83b9('0x18')][_0x83b9('0x1b')]||null:null,'include':_0x55e250['options']?_0x55e250[_0x83b9('0x18')]['include']?_[_0x83b9('0x1c')](_0x55e250[_0x83b9('0x18')][_0x83b9('0x1d')],function(_0x3d80a8){return{'model':db[_0x3d80a8['model']],'as':_0x3d80a8['as'],'attributes':_0x3d80a8[_0x83b9('0x1e')],'include':_0x3d80a8[_0x83b9('0x1d')]?_[_0x83b9('0x1c')](_0x3d80a8[_0x83b9('0x1d')],function(_0x3a8040){return{'model':db[_0x3a8040[_0x83b9('0x1f')]],'as':_0x3a8040['as'],'attributes':_0x3a8040[_0x83b9('0x1e')],'include':_0x3a8040[_0x83b9('0x1d')]?_[_0x83b9('0x1c')](_0x3a8040[_0x83b9('0x1d')],function(_0x6ceec2){return{'model':db[_0x6ceec2['model']],'as':_0x6ceec2['as'],'attributes':_0x6ceec2[_0x83b9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x83b9('0xe')](function(_0x51b51f){logger[_0x83b9('0x20')](_0x83b9('0x21'),_0x55e250);logger['debug'](_0x83b9('0x21'),_0x55e250,JSON[_0x83b9('0x11')](_0x51b51f));_0x304f7d(_0x51b51f);})[_0x83b9('0x22')](function(_0x289c88){logger['error'](_0x83b9('0x21'),_0x289c88[_0x83b9('0x13')],_0x55e250);_0x5ce23c(_0x2a0626['error'](0x1f4,_0x289c88[_0x83b9('0x13')]));});});};exports[_0x83b9('0x23')]=function(_0x30bf23){var _0x1a4d77=this;return new Promise(function(_0x105fbb,_0x37d7c5){return db[_0x83b9('0x16')]['create'](_0x30bf23[_0x83b9('0x24')],{'raw':_0x30bf23[_0x83b9('0x18')]?_0x30bf23[_0x83b9('0x18')][_0x83b9('0x19')]===undefined?!![]:![]:!![]})[_0x83b9('0xe')](function(_0x2c93ff){logger[_0x83b9('0x20')](_0x83b9('0x23'),_0x30bf23);logger[_0x83b9('0x25')](_0x83b9('0x23'),_0x30bf23,JSON[_0x83b9('0x11')](_0x2c93ff));_0x105fbb(_0x2c93ff);})['catch'](function(_0x3faaf7){logger[_0x83b9('0x12')]('CreateVoiceQueueReport',_0x3faaf7[_0x83b9('0x13')],_0x30bf23);_0x37d7c5(_0x1a4d77[_0x83b9('0x12')](0x1f4,_0x3faaf7[_0x83b9('0x13')]));});});};exports['UpdateVoiceQueueReport']=function(_0x6facc6){var _0x400f18=this;return new Promise(function(_0x21a828,_0x242a66){return db[_0x83b9('0x16')]['update'](_0x6facc6[_0x83b9('0x24')],{'raw':_0x6facc6[_0x83b9('0x18')]?_0x6facc6[_0x83b9('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6facc6[_0x83b9('0x18')]?_0x6facc6[_0x83b9('0x18')]['where']||null:null,'attributes':_0x6facc6['options']?_0x6facc6['options']['attributes']||null:null,'limit':_0x6facc6[_0x83b9('0x18')]?_0x6facc6[_0x83b9('0x18')]['limit']||null:null})['then'](function(_0x43d2c4){logger[_0x83b9('0x20')](_0x83b9('0x26'),_0x6facc6);logger['debug']('UpdateVoiceQueueReport',_0x6facc6,JSON[_0x83b9('0x11')](_0x43d2c4));_0x21a828(_0x43d2c4);})[_0x83b9('0x22')](function(_0xadecf9){logger[_0x83b9('0x12')](_0x83b9('0x26'),_0xadecf9[_0x83b9('0x13')],_0x6facc6);_0x242a66(_0x400f18[_0x83b9('0x12')](0x1f4,_0xadecf9['message']));});});}; \ No newline at end of file +var _0xd4ea=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','update','body','UpdateVoiceQueueReport','util','bluebird'];(function(_0x47d709,_0x4294fb){var _0x4eac31=function(_0x277328){while(--_0x277328){_0x47d709['push'](_0x47d709['shift']());}};_0x4eac31(++_0x4294fb);}(_0xd4ea,0x132));var _0xad4e=function(_0x2fc83d,_0x418055){_0x2fc83d=_0x2fc83d-0x0;var _0x40fa14=_0xd4ea[_0x2fc83d];return _0x40fa14;};'use strict';var _=require('lodash');var util=require(_0xad4e('0x0'));var moment=require('moment');var BPromise=require(_0xad4e('0x1'));var rs=require(_0xad4e('0x2'));var fs=require('fs');var Redis=require(_0xad4e('0x3'));var db=require(_0xad4e('0x4'))['db'];var utils=require(_0xad4e('0x5'));var logger=require('../../config/logger')(_0xad4e('0x6'));var config=require(_0xad4e('0x7'));var jayson=require(_0xad4e('0x8'));var client=jayson[_0xad4e('0x9')][_0xad4e('0xa')]({'port':0x232a});config[_0xad4e('0xb')]=_[_0xad4e('0xc')](config[_0xad4e('0xb')],{'host':_0xad4e('0xd'),'port':0x18eb});var socket=require(_0xad4e('0xe'))(new Redis(config[_0xad4e('0xb')]));require(_0xad4e('0xf'))[_0xad4e('0x10')](socket);function respondWithRpcPromise(_0xfd1795,_0x91cb9e,_0x31795a){return new BPromise(function(_0x410d67,_0x54064a){return client['request'](_0xfd1795,_0x31795a)[_0xad4e('0x11')](function(_0xf76a89){logger[_0xad4e('0x12')](_0xad4e('0x13'),_0x91cb9e,_0xad4e('0x14'));logger[_0xad4e('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x91cb9e,_0xad4e('0x14'),JSON[_0xad4e('0x16')](_0xf76a89));if(_0xf76a89['error']){if(_0xf76a89[_0xad4e('0x17')][_0xad4e('0x18')]===0x1f4){logger['error'](_0xad4e('0x13'),_0x91cb9e,_0xf76a89[_0xad4e('0x17')][_0xad4e('0x19')]);return _0x54064a(_0xf76a89[_0xad4e('0x17')][_0xad4e('0x19')]);}logger['error'](_0xad4e('0x13'),_0x91cb9e,_0xf76a89['error'][_0xad4e('0x19')]);return _0x410d67(_0xf76a89[_0xad4e('0x17')][_0xad4e('0x19')]);}else{logger[_0xad4e('0x12')](_0xad4e('0x13'),_0x91cb9e,_0xad4e('0x14'));_0x410d67(_0xf76a89[_0xad4e('0x1a')]['message']);}})[_0xad4e('0x1b')](function(_0x3efdd3){logger[_0xad4e('0x17')](_0xad4e('0x13'),_0x91cb9e,_0x3efdd3);_0x54064a(_0x3efdd3);});});}exports['GetVoiceQueueReport']=function(_0x50f718){var _0x141833=this;return new Promise(function(_0x2b3f68,_0x526be1){return db[_0xad4e('0x1c')][_0xad4e('0x1d')]({'raw':_0x50f718[_0xad4e('0x1e')]?_0x50f718[_0xad4e('0x1e')][_0xad4e('0x1f')]===undefined?!![]:![]:!![],'where':_0x50f718['options']?_0x50f718[_0xad4e('0x1e')][_0xad4e('0x20')]||null:null,'attributes':_0x50f718[_0xad4e('0x1e')]?_0x50f718[_0xad4e('0x1e')][_0xad4e('0x21')]||null:null,'limit':_0x50f718[_0xad4e('0x1e')]?_0x50f718[_0xad4e('0x1e')][_0xad4e('0x22')]||null:null,'include':_0x50f718['options']?_0x50f718[_0xad4e('0x1e')]['include']?_['map'](_0x50f718['options'][_0xad4e('0x23')],function(_0x855cfe){return{'model':db[_0x855cfe['model']],'as':_0x855cfe['as'],'attributes':_0x855cfe[_0xad4e('0x21')],'include':_0x855cfe['include']?_[_0xad4e('0x24')](_0x855cfe[_0xad4e('0x23')],function(_0x1b3ba1){return{'model':db[_0x1b3ba1[_0xad4e('0x25')]],'as':_0x1b3ba1['as'],'attributes':_0x1b3ba1[_0xad4e('0x21')],'include':_0x1b3ba1[_0xad4e('0x23')]?_[_0xad4e('0x24')](_0x1b3ba1['include'],function(_0xe418c4){return{'model':db[_0xe418c4[_0xad4e('0x25')]],'as':_0xe418c4['as'],'attributes':_0xe418c4[_0xad4e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xad4e('0x11')](function(_0x3cad92){logger[_0xad4e('0x12')](_0xad4e('0x26'),_0x50f718);logger[_0xad4e('0x15')](_0xad4e('0x26'),_0x50f718,JSON[_0xad4e('0x16')](_0x3cad92));_0x2b3f68(_0x3cad92);})['catch'](function(_0xf98e0d){logger['error'](_0xad4e('0x26'),_0xf98e0d[_0xad4e('0x19')],_0x50f718);_0x526be1(_0x141833[_0xad4e('0x17')](0x1f4,_0xf98e0d['message']));});});};exports[_0xad4e('0x27')]=function(_0x50e3d6){var _0x4d71be=this;return new Promise(function(_0x4ffb6a,_0x16cfeb){return db[_0xad4e('0x1c')][_0xad4e('0x28')](_0x50e3d6['body'],{'raw':_0x50e3d6['options']?_0x50e3d6[_0xad4e('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xad4e('0x11')](function(_0x758c9b){logger['info'](_0xad4e('0x27'),_0x50e3d6);logger[_0xad4e('0x15')]('CreateVoiceQueueReport',_0x50e3d6,JSON[_0xad4e('0x16')](_0x758c9b));_0x4ffb6a(_0x758c9b);})[_0xad4e('0x1b')](function(_0x3e7fd2){logger[_0xad4e('0x17')](_0xad4e('0x27'),_0x3e7fd2['message'],_0x50e3d6);_0x16cfeb(_0x4d71be[_0xad4e('0x17')](0x1f4,_0x3e7fd2[_0xad4e('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0x30758d){var _0xe6f5f6=this;return new Promise(function(_0x323475,_0xd15bd8){return db['VoiceQueueReport'][_0xad4e('0x29')](_0x30758d[_0xad4e('0x2a')],{'raw':_0x30758d['options']?_0x30758d[_0xad4e('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30758d[_0xad4e('0x1e')]?_0x30758d[_0xad4e('0x1e')][_0xad4e('0x20')]||null:null,'attributes':_0x30758d[_0xad4e('0x1e')]?_0x30758d['options'][_0xad4e('0x21')]||null:null,'limit':_0x30758d[_0xad4e('0x1e')]?_0x30758d[_0xad4e('0x1e')][_0xad4e('0x22')]||null:null})[_0xad4e('0x11')](function(_0x31119b){logger[_0xad4e('0x12')](_0xad4e('0x2b'),_0x30758d);logger[_0xad4e('0x15')]('UpdateVoiceQueueReport',_0x30758d,JSON['stringify'](_0x31119b));_0x323475(_0x31119b);})['catch'](function(_0x2e2d55){logger[_0xad4e('0x17')](_0xad4e('0x2b'),_0x2e2d55[_0xad4e('0x19')],_0x30758d);_0xd15bd8(_0xe6f5f6[_0xad4e('0x17')](0x1f4,_0x2e2d55['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e6ef287..ea66d5a 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 _0x799b=['length','voiceQueueReport:','./voiceQueueReport.events','update','emit','removeListener'];(function(_0x3e8b47,_0x503f70){var _0x3200c0=function(_0x1d2575){while(--_0x1d2575){_0x3e8b47['push'](_0x3e8b47['shift']());}};_0x3200c0(++_0x503f70);}(_0x799b,0x8c));var _0xb799=function(_0x2b0088,_0x27508e){_0x2b0088=_0x2b0088-0x0;var _0x395c3c=_0x799b[_0x2b0088];return _0x395c3c;};'use strict';var VoiceQueueReportEvents=require(_0xb799('0x0'));var events=['save','remove',_0xb799('0x1')];function createListener(_0x539b08,_0x437846){return function(_0x41bafc){_0x437846[_0xb799('0x2')](_0x539b08,_0x41bafc);};}function removeListener(_0x1dda29,_0x4fdc5b){return function(){VoiceQueueReportEvents[_0xb799('0x3')](_0x1dda29,_0x4fdc5b);};}exports['register']=function(_0x7398b7){for(var _0x4e3ab0=0x0,_0x171d59=events[_0xb799('0x4')];_0x4e3ab0<_0x171d59;_0x4e3ab0++){var _0x3e0c35=events[_0x4e3ab0];var _0x2012e1=createListener(_0xb799('0x5')+_0x3e0c35,_0x7398b7);VoiceQueueReportEvents['on'](_0x3e0c35,_0x2012e1);}}; \ No newline at end of file +var _0xef89=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x432d63,_0x3930ec){var _0x55b113=function(_0x1f5e50){while(--_0x1f5e50){_0x432d63['push'](_0x432d63['shift']());}};_0x55b113(++_0x3930ec);}(_0xef89,0xf6));var _0x9ef8=function(_0x110c50,_0x1e95e1){_0x110c50=_0x110c50-0x0;var _0x55a421=_0xef89[_0x110c50];return _0x55a421;};'use strict';var VoiceQueueReportEvents=require(_0x9ef8('0x0'));var events=[_0x9ef8('0x1'),_0x9ef8('0x2'),_0x9ef8('0x3')];function createListener(_0x3e7801,_0x55687c){return function(_0x1e8bb8){_0x55687c[_0x9ef8('0x4')](_0x3e7801,_0x1e8bb8);};}function removeListener(_0xe27981,_0x1f2b75){return function(){VoiceQueueReportEvents[_0x9ef8('0x5')](_0xe27981,_0x1f2b75);};}exports['register']=function(_0x1698c3){for(var _0x5d40f7=0x0,_0x4bf5bf=events['length'];_0x5d40f7<_0x4bf5bf;_0x5d40f7++){var _0x8fceb6=events[_0x5d40f7];var _0x36c546=createListener(_0x9ef8('0x6')+_0x8fceb6,_0x1698c3);VoiceQueueReportEvents['on'](_0x8fceb6,_0x36c546);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 4973da3..587624b 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 _0xe5af=['path','Router','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','exports','util'];(function(_0x54e84d,_0xe1acd8){var _0x405413=function(_0x2ee518){while(--_0x2ee518){_0x54e84d['push'](_0x54e84d['shift']());}};_0x405413(++_0xe1acd8);}(_0xe5af,0xff));var _0xfe5a=function(_0x4c4a18,_0x35be2c){_0x4c4a18=_0x4c4a18-0x0;var _0x51a123=_0xe5af[_0x4c4a18];return _0x51a123;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfe5a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x3'));var config=require(_0xfe5a('0x4'));var controller=require(_0xfe5a('0x5'));router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x8')]);router[_0xfe5a('0x6')]('/:id',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0xa')]('/',auth['isAuthenticated'](),controller[_0xfe5a('0xb')]);router['put'](_0xfe5a('0xc'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xd')]);router[_0xfe5a('0xe')](_0xfe5a('0xc'),auth[_0xfe5a('0x7')](),controller['destroy']);module[_0xfe5a('0xf')]=router; \ No newline at end of file +var _0xe586=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0xe586,0xc8));var _0x6e58=function(_0x1bf08e,_0x5561d6){_0x1bf08e=_0x1bf08e-0x0;var _0x45865d=_0xe586[_0x1bf08e];return _0x45865d;};'use strict';var multer=require(_0x6e58('0x0'));var util=require(_0x6e58('0x1'));var path=require(_0x6e58('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e58('0x3'));var router=express[_0x6e58('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6e58('0x5'));var interaction=require(_0x6e58('0x6'));var config=require(_0x6e58('0x7'));var controller=require(_0x6e58('0x8'));router[_0x6e58('0x9')]('/',auth[_0x6e58('0xa')](),controller[_0x6e58('0xb')]);router[_0x6e58('0x9')](_0x6e58('0xc'),auth[_0x6e58('0xa')](),controller[_0x6e58('0xd')]);router[_0x6e58('0xe')]('/',auth['isAuthenticated'](),controller[_0x6e58('0xf')]);router[_0x6e58('0x10')](_0x6e58('0xc'),auth[_0x6e58('0xa')](),controller[_0x6e58('0x11')]);router[_0x6e58('0x12')]('/:id',auth[_0x6e58('0xa')](),controller[_0x6e58('0x13')]);module[_0x6e58('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6fe6b9e..cbd3cfd 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 _0x108e=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING'];(function(_0x4c1c57,_0x37c83e){var _0xaa8d9b=function(_0x11db53){while(--_0x11db53){_0x4c1c57['push'](_0x4c1c57['shift']());}};_0xaa8d9b(++_0x37c83e);}(_0x108e,0x141));var _0xe108=function(_0x1d9e8e,_0x4fc39b){_0x1d9e8e=_0x1d9e8e-0x0;var _0x2dc867=_0x108e[_0x1d9e8e];return _0x2dc867;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe108('0x0'));module[_0xe108('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xe108('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe108('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe108('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe108('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe108('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe108('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe108('0x3')],'allowNull':![],'defaultValue':moment()[_0xe108('0x4')](_0xe108('0x5'))}}; \ No newline at end of file +var _0x4489=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING','DATE'];(function(_0x4ec8be,_0x569fbf){var _0x4dbf34=function(_0x4dbe4c){while(--_0x4dbe4c){_0x4ec8be['push'](_0x4ec8be['shift']());}};_0x4dbf34(++_0x569fbf);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9448('0x0'));var moment=require(_0x9448('0x1'));module['exports']={'time':{'type':Sequelize[_0x9448('0x2')]},'callid':{'type':Sequelize[_0x9448('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9448('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9448('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9448('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9448('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x9448('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e4d036f..be3d02f 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 _0x61ce=['save','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VoiceQueuesLog','findAll','catch','show','params','keys','include','options','find','create','body','update','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','set','apply','reject'];(function(_0x5512da,_0x3c32ea){var _0x4b87ba=function(_0x639ef7){while(--_0x639ef7){_0x5512da['push'](_0x5512da['shift']());}};_0x4b87ba(++_0x3c32ea);}(_0x61ce,0xb4));var _0xe61c=function(_0xe15a20,_0x2a56e6){_0xe15a20=_0xe15a20-0x0;var _0x25ab39=_0x61ce[_0xe15a20];return _0x25ab39;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe61c('0x0'));var jsonpatch=require(_0xe61c('0x1'));var rp=require(_0xe61c('0x2'));var moment=require(_0xe61c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe61c('0x4'));var util=require(_0xe61c('0x5'));var path=require(_0xe61c('0x6'));var sox=require('sox');var csv=require(_0xe61c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe61c('0x8'));var squel=require(_0xe61c('0x9'));var crypto=require(_0xe61c('0xa'));var jsforce=require(_0xe61c('0xb'));var deskjs=require(_0xe61c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe61c('0xd'));var Papa=require(_0xe61c('0xe'));var Redis=require(_0xe61c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe61c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe61c('0x11'));var utils=require(_0xe61c('0x12'));var config=require(_0xe61c('0x13'));var licenseUtil=require(_0xe61c('0x14'));var db=require(_0xe61c('0x15'))['db'];function respondWithStatusCode(_0x309be1,_0x51a8be){_0x51a8be=_0x51a8be||0xcc;return function(_0x1192cf){if(_0x1192cf){return _0x309be1['sendStatus'](_0x51a8be);}return _0x309be1[_0xe61c('0x16')](_0x51a8be)[_0xe61c('0x17')]();};}function respondWithResult(_0x58a8b3,_0x5c5f41){_0x5c5f41=_0x5c5f41||0xc8;return function(_0x137a3c){if(_0x137a3c){return _0x58a8b3['status'](_0x5c5f41)[_0xe61c('0x18')](_0x137a3c);}};}function respondWithFilteredResult(_0x4fea47,_0x374d04){return function(_0x503952){if(_0x503952){var _0x107ab3=typeof _0x374d04['offset']==='undefined'&&typeof _0x374d04['limit']==='undefined';var _0x435467=_0x503952[_0xe61c('0x19')];var _0x3516ba=_0x107ab3?0x0:_0x374d04[_0xe61c('0x1a')];var _0x4477c6=_0x107ab3?_0x503952[_0xe61c('0x19')]:_0x374d04['offset']+_0x374d04['limit'];var _0x43b174;if(_0x4477c6>=_0x435467){_0x4477c6=_0x435467;_0x43b174=0xc8;}else{_0x43b174=0xce;}_0x4fea47[_0xe61c('0x16')](_0x43b174);return _0x4fea47[_0xe61c('0x1b')]('Content-Range',_0x3516ba+'-'+_0x4477c6+'/'+_0x435467)['json'](_0x503952);}return null;};}function patchUpdates(_0x9b8033){return function(_0x288abe){try{jsonpatch[_0xe61c('0x1c')](_0x288abe,_0x9b8033,!![]);}catch(_0x29bd2d){return BPromise[_0xe61c('0x1d')](_0x29bd2d);}return _0x288abe[_0xe61c('0x1e')]();};}function saveUpdates(_0x4497ad,_0x2eddce){return function(_0x2e68f0){if(_0x2e68f0){return _0x2e68f0['update'](_0x4497ad)['then'](function(_0x35838e){return _0x35838e;});}return null;};}function removeEntity(_0x34539e,_0x3c5880){return function(_0xeda499){if(_0xeda499){return _0xeda499[_0xe61c('0x1f')]()[_0xe61c('0x20')](function(){_0x34539e[_0xe61c('0x16')](0xcc)[_0xe61c('0x17')]();});}};}function handleEntityNotFound(_0x44a2a2,_0x4ce83b){return function(_0x2b41c8){if(!_0x2b41c8){_0x44a2a2[_0xe61c('0x21')](0x194);}return _0x2b41c8;};}function handleError(_0xfc2428,_0xe125ec){_0xe125ec=_0xe125ec||0x1f4;return function(_0x374962){logger[_0xe61c('0x22')](_0x374962[_0xe61c('0x23')]);if(_0x374962[_0xe61c('0x24')]){delete _0x374962[_0xe61c('0x24')];}_0xfc2428[_0xe61c('0x16')](_0xe125ec)[_0xe61c('0x25')](_0x374962);};}exports[_0xe61c('0x26')]=function(_0x20ab68,_0x52fbca){var _0x28e226={},_0x35b142={},_0x5dabe5={'count':0x0,'rows':[]};var _0x2064f7=_[_0xe61c('0x27')](db['VoiceQueuesLog'][_0xe61c('0x28')],function(_0x5811e5){return{'name':_0x5811e5['fieldName'],'type':_0x5811e5[_0xe61c('0x29')]['key']};});_0x35b142[_0xe61c('0x2a')]=_[_0xe61c('0x27')](_0x2064f7,_0xe61c('0x24'));_0x35b142[_0xe61c('0x2b')]=_['keys'](_0x20ab68['query']);_0x35b142[_0xe61c('0x2c')]=_[_0xe61c('0x2d')](_0x35b142[_0xe61c('0x2a')],_0x35b142[_0xe61c('0x2b')]);_0x28e226[_0xe61c('0x2e')]=_[_0xe61c('0x2d')](_0x35b142['model'],qs[_0xe61c('0x2f')](_0x20ab68[_0xe61c('0x2b')]['fields']));_0x28e226[_0xe61c('0x2e')]=_0x28e226[_0xe61c('0x2e')][_0xe61c('0x30')]?_0x28e226['attributes']:_0x35b142[_0xe61c('0x2a')];if(!_0x20ab68[_0xe61c('0x2b')][_0xe61c('0x31')](_0xe61c('0x32'))){_0x28e226['limit']=qs[_0xe61c('0x33')](_0x20ab68[_0xe61c('0x2b')][_0xe61c('0x33')]);_0x28e226[_0xe61c('0x1a')]=qs[_0xe61c('0x1a')](_0x20ab68[_0xe61c('0x2b')]['offset']);}_0x28e226[_0xe61c('0x34')]=qs[_0xe61c('0x35')](_0x20ab68['query'][_0xe61c('0x35')]);_0x28e226[_0xe61c('0x36')]=qs[_0xe61c('0x2c')](_[_0xe61c('0x37')](_0x20ab68['query'],_0x35b142[_0xe61c('0x2c')]),_0x2064f7);if(_0x20ab68['query'][_0xe61c('0x38')]){_0x28e226[_0xe61c('0x36')]=_[_0xe61c('0x39')](_0x28e226[_0xe61c('0x36')],{'$or':_['map'](_0x2064f7,function(_0x5f5833){if(_0x5f5833[_0xe61c('0x29')]!=='VIRTUAL'){var _0xe6da5b={};_0xe6da5b[_0x5f5833['name']]={'$like':'%'+_0x20ab68['query'][_0xe61c('0x38')]+'%'};return _0xe6da5b;}})});}_0x28e226=_[_0xe61c('0x39')]({},_0x28e226,_0x20ab68['options']);var _0x430422={'where':_0x28e226['where']};return db[_0xe61c('0x3a')][_0xe61c('0x19')](_0x430422)['then'](function(_0x2fa3ba){_0x5dabe5['count']=_0x2fa3ba;if(_0x20ab68[_0xe61c('0x2b')]['includeAll']){_0x28e226['include']=[{'all':!![]}];}return db[_0xe61c('0x3a')][_0xe61c('0x3b')](_0x28e226);})[_0xe61c('0x20')](function(_0x174da9){_0x5dabe5['rows']=_0x174da9;return _0x5dabe5;})[_0xe61c('0x20')](respondWithFilteredResult(_0x52fbca,_0x28e226))[_0xe61c('0x3c')](handleError(_0x52fbca,null));};exports[_0xe61c('0x3d')]=function(_0x3b2062,_0x3735fd){var _0x184978={'raw':!![],'where':{'id':_0x3b2062[_0xe61c('0x3e')]['id']}},_0x3b7ed5={};_0x3b7ed5[_0xe61c('0x2a')]=_['keys'](db[_0xe61c('0x3a')][_0xe61c('0x28')]);_0x3b7ed5['query']=_[_0xe61c('0x3f')](_0x3b2062['query']);_0x3b7ed5['filters']=_[_0xe61c('0x2d')](_0x3b7ed5[_0xe61c('0x2a')],_0x3b7ed5[_0xe61c('0x2b')]);_0x184978[_0xe61c('0x2e')]=_['intersection'](_0x3b7ed5['model'],qs['fields'](_0x3b2062[_0xe61c('0x2b')][_0xe61c('0x2f')]));_0x184978['attributes']=_0x184978[_0xe61c('0x2e')][_0xe61c('0x30')]?_0x184978[_0xe61c('0x2e')]:_0x3b7ed5[_0xe61c('0x2a')];if(_0x3b2062[_0xe61c('0x2b')]['includeAll']){_0x184978[_0xe61c('0x40')]=[{'all':!![]}];}_0x184978=_[_0xe61c('0x39')]({},_0x184978,_0x3b2062[_0xe61c('0x41')]);return db[_0xe61c('0x3a')][_0xe61c('0x42')](_0x184978)[_0xe61c('0x20')](handleEntityNotFound(_0x3735fd,null))[_0xe61c('0x20')](respondWithResult(_0x3735fd,null))[_0xe61c('0x3c')](handleError(_0x3735fd,null));};exports[_0xe61c('0x43')]=function(_0x583e6a,_0x2f104b){return db[_0xe61c('0x3a')][_0xe61c('0x43')](_0x583e6a[_0xe61c('0x44')],{})[_0xe61c('0x20')](respondWithResult(_0x2f104b,0xc9))[_0xe61c('0x3c')](handleError(_0x2f104b,null));};exports[_0xe61c('0x45')]=function(_0x1d3a4d,_0x221109){if(_0x1d3a4d[_0xe61c('0x44')]['id']){delete _0x1d3a4d['body']['id'];}return db[_0xe61c('0x3a')][_0xe61c('0x42')]({'where':{'id':_0x1d3a4d[_0xe61c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x221109,null))[_0xe61c('0x20')](saveUpdates(_0x1d3a4d[_0xe61c('0x44')],null))[_0xe61c('0x20')](respondWithResult(_0x221109,null))[_0xe61c('0x3c')](handleError(_0x221109,null));};exports[_0xe61c('0x1f')]=function(_0x2cd61a,_0x42c0dc){return db[_0xe61c('0x3a')][_0xe61c('0x42')]({'where':{'id':_0x2cd61a[_0xe61c('0x3e')]['id']}})[_0xe61c('0x20')](handleEntityNotFound(_0x42c0dc,null))['then'](removeEntity(_0x42c0dc,null))[_0xe61c('0x3c')](handleError(_0x42c0dc,null));}; \ No newline at end of file +var _0x1ed2=['sort','where','pick','type','filter','merge','options','then','include','rows','params','keys','rawAttributes','includeAll','find','catch','create','body','eml-format','zip-dir','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','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','stack','index','VoiceQueuesLog','fieldName','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5dee95,_0x2fa257){var _0x4ea175=function(_0xf14dda){while(--_0xf14dda){_0x5dee95['push'](_0x5dee95['shift']());}};_0x4ea175(++_0x2fa257);}(_0x1ed2,0x136));var _0x21ed=function(_0x4346aa,_0x1e597e){_0x4346aa=_0x4346aa-0x0;var _0x31a809=_0x1ed2[_0x4346aa];return _0x31a809;};'use strict';var emlformat=require(_0x21ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x21ed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21ed('0x2'));var Mustache=require(_0x21ed('0x3'));var util=require(_0x21ed('0x4'));var path=require(_0x21ed('0x5'));var sox=require(_0x21ed('0x6'));var csv=require(_0x21ed('0x7'));var ejs=require(_0x21ed('0x8'));var fs=require('fs');var fs_extra=require(_0x21ed('0x9'));var _=require(_0x21ed('0xa'));var squel=require(_0x21ed('0xb'));var crypto=require('crypto');var jsforce=require(_0x21ed('0xc'));var deskjs=require(_0x21ed('0xd'));var toCsv=require(_0x21ed('0x7'));var querystring=require(_0x21ed('0xe'));var Papa=require(_0x21ed('0xf'));var Redis=require(_0x21ed('0x10'));var authService=require(_0x21ed('0x11'));var qs=require(_0x21ed('0x12'));var as=require(_0x21ed('0x13'));var hardwareService=require(_0x21ed('0x14'));var logger=require('../../config/logger')(_0x21ed('0x15'));var utils=require('../../config/utils');var config=require(_0x21ed('0x16'));var licenseUtil=require(_0x21ed('0x17'));var db=require(_0x21ed('0x18'))['db'];function respondWithStatusCode(_0x577c4a,_0x239ca9){_0x239ca9=_0x239ca9||0xcc;return function(_0x31da59){if(_0x31da59){return _0x577c4a[_0x21ed('0x19')](_0x239ca9);}return _0x577c4a['status'](_0x239ca9)[_0x21ed('0x1a')]();};}function respondWithResult(_0x293f0d,_0x151ed8){_0x151ed8=_0x151ed8||0xc8;return function(_0x5bff9b){if(_0x5bff9b){return _0x293f0d[_0x21ed('0x1b')](_0x151ed8)[_0x21ed('0x1c')](_0x5bff9b);}};}function respondWithFilteredResult(_0x3b81aa,_0x40a444){return function(_0x328cb5){if(_0x328cb5){var _0x107172=typeof _0x40a444[_0x21ed('0x1d')]===_0x21ed('0x1e')&&typeof _0x40a444[_0x21ed('0x1f')]==='undefined';var _0x3481a9=_0x328cb5[_0x21ed('0x20')];var _0x1a94e2=_0x107172?0x0:_0x40a444[_0x21ed('0x1d')];var _0xa1f98=_0x107172?_0x328cb5['count']:_0x40a444[_0x21ed('0x1d')]+_0x40a444[_0x21ed('0x1f')];var _0x4357fe;if(_0xa1f98>=_0x3481a9){_0xa1f98=_0x3481a9;_0x4357fe=0xc8;}else{_0x4357fe=0xce;}_0x3b81aa['status'](_0x4357fe);return _0x3b81aa[_0x21ed('0x21')](_0x21ed('0x22'),_0x1a94e2+'-'+_0xa1f98+'/'+_0x3481a9)[_0x21ed('0x1c')](_0x328cb5);}return null;};}function patchUpdates(_0x588ecc){return function(_0x1dc280){try{jsonpatch['apply'](_0x1dc280,_0x588ecc,!![]);}catch(_0x162799){return BPromise[_0x21ed('0x23')](_0x162799);}return _0x1dc280['save']();};}function saveUpdates(_0x4501ca,_0x5721b7){return function(_0x4858d8){if(_0x4858d8){return _0x4858d8[_0x21ed('0x24')](_0x4501ca)['then'](function(_0x4366cc){return _0x4366cc;});}return null;};}function removeEntity(_0x1e11d6,_0x92e3de){return function(_0x10e94c){if(_0x10e94c){return _0x10e94c[_0x21ed('0x25')]()['then'](function(){_0x1e11d6[_0x21ed('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40337d,_0x40cb49){return function(_0x17e74b){if(!_0x17e74b){_0x40337d[_0x21ed('0x19')](0x194);}return _0x17e74b;};}function handleError(_0x46ceb6,_0x37712d){_0x37712d=_0x37712d||0x1f4;return function(_0x427da0){logger['error'](_0x427da0[_0x21ed('0x26')]);if(_0x427da0['name']){delete _0x427da0['name'];}_0x46ceb6['status'](_0x37712d)['send'](_0x427da0);};}exports[_0x21ed('0x27')]=function(_0xd876c0,_0x50abda){var _0x3060a3={},_0x2cb4ee={},_0x2c8d2d={'count':0x0,'rows':[]};var _0x2a44d3=_['map'](db[_0x21ed('0x28')]['rawAttributes'],function(_0x333d7a){return{'name':_0x333d7a[_0x21ed('0x29')],'type':_0x333d7a['type'][_0x21ed('0x2a')]};});_0x2cb4ee[_0x21ed('0x2b')]=_[_0x21ed('0x2c')](_0x2a44d3,_0x21ed('0x2d'));_0x2cb4ee[_0x21ed('0x2e')]=_['keys'](_0xd876c0[_0x21ed('0x2e')]);_0x2cb4ee[_0x21ed('0x2f')]=_[_0x21ed('0x30')](_0x2cb4ee[_0x21ed('0x2b')],_0x2cb4ee[_0x21ed('0x2e')]);_0x3060a3[_0x21ed('0x31')]=_[_0x21ed('0x30')](_0x2cb4ee['model'],qs['fields'](_0xd876c0[_0x21ed('0x2e')][_0x21ed('0x32')]));_0x3060a3[_0x21ed('0x31')]=_0x3060a3[_0x21ed('0x31')][_0x21ed('0x33')]?_0x3060a3['attributes']:_0x2cb4ee['model'];if(!_0xd876c0[_0x21ed('0x2e')][_0x21ed('0x34')](_0x21ed('0x35'))){_0x3060a3[_0x21ed('0x1f')]=qs[_0x21ed('0x1f')](_0xd876c0['query'][_0x21ed('0x1f')]);_0x3060a3['offset']=qs[_0x21ed('0x1d')](_0xd876c0[_0x21ed('0x2e')][_0x21ed('0x1d')]);}_0x3060a3[_0x21ed('0x36')]=qs[_0x21ed('0x37')](_0xd876c0[_0x21ed('0x2e')][_0x21ed('0x37')]);_0x3060a3[_0x21ed('0x38')]=qs[_0x21ed('0x2f')](_[_0x21ed('0x39')](_0xd876c0[_0x21ed('0x2e')],_0x2cb4ee['filters']),_0x2a44d3);if(_0xd876c0[_0x21ed('0x2e')]['filter']){_0x3060a3['where']=_['merge'](_0x3060a3[_0x21ed('0x38')],{'$or':_[_0x21ed('0x2c')](_0x2a44d3,function(_0x4e01d1){if(_0x4e01d1[_0x21ed('0x3a')]!=='VIRTUAL'){var _0x3a33bf={};_0x3a33bf[_0x4e01d1[_0x21ed('0x2d')]]={'$like':'%'+_0xd876c0[_0x21ed('0x2e')][_0x21ed('0x3b')]+'%'};return _0x3a33bf;}})});}_0x3060a3=_[_0x21ed('0x3c')]({},_0x3060a3,_0xd876c0[_0x21ed('0x3d')]);var _0x39c9bd={'where':_0x3060a3[_0x21ed('0x38')]};return db[_0x21ed('0x28')][_0x21ed('0x20')](_0x39c9bd)[_0x21ed('0x3e')](function(_0x2d7ff9){_0x2c8d2d['count']=_0x2d7ff9;if(_0xd876c0[_0x21ed('0x2e')]['includeAll']){_0x3060a3[_0x21ed('0x3f')]=[{'all':!![]}];}return db[_0x21ed('0x28')]['findAll'](_0x3060a3);})['then'](function(_0x28dfa1){_0x2c8d2d[_0x21ed('0x40')]=_0x28dfa1;return _0x2c8d2d;})[_0x21ed('0x3e')](respondWithFilteredResult(_0x50abda,_0x3060a3))['catch'](handleError(_0x50abda,null));};exports['show']=function(_0x16b25e,_0x30531f){var _0x33e12c={'raw':!![],'where':{'id':_0x16b25e[_0x21ed('0x41')]['id']}},_0x5ecb13={};_0x5ecb13[_0x21ed('0x2b')]=_[_0x21ed('0x42')](db['VoiceQueuesLog'][_0x21ed('0x43')]);_0x5ecb13[_0x21ed('0x2e')]=_[_0x21ed('0x42')](_0x16b25e[_0x21ed('0x2e')]);_0x5ecb13[_0x21ed('0x2f')]=_[_0x21ed('0x30')](_0x5ecb13['model'],_0x5ecb13[_0x21ed('0x2e')]);_0x33e12c[_0x21ed('0x31')]=_[_0x21ed('0x30')](_0x5ecb13[_0x21ed('0x2b')],qs[_0x21ed('0x32')](_0x16b25e[_0x21ed('0x2e')][_0x21ed('0x32')]));_0x33e12c[_0x21ed('0x31')]=_0x33e12c[_0x21ed('0x31')]['length']?_0x33e12c['attributes']:_0x5ecb13['model'];if(_0x16b25e[_0x21ed('0x2e')][_0x21ed('0x44')]){_0x33e12c['include']=[{'all':!![]}];}_0x33e12c=_[_0x21ed('0x3c')]({},_0x33e12c,_0x16b25e[_0x21ed('0x3d')]);return db[_0x21ed('0x28')][_0x21ed('0x45')](_0x33e12c)['then'](handleEntityNotFound(_0x30531f,null))[_0x21ed('0x3e')](respondWithResult(_0x30531f,null))[_0x21ed('0x46')](handleError(_0x30531f,null));};exports[_0x21ed('0x47')]=function(_0x13d581,_0x27dae7){return db[_0x21ed('0x28')]['create'](_0x13d581[_0x21ed('0x48')],{})[_0x21ed('0x3e')](respondWithResult(_0x27dae7,0xc9))[_0x21ed('0x46')](handleError(_0x27dae7,null));};exports[_0x21ed('0x24')]=function(_0x18b040,_0x24102a){if(_0x18b040[_0x21ed('0x48')]['id']){delete _0x18b040['body']['id'];}return db[_0x21ed('0x28')][_0x21ed('0x45')]({'where':{'id':_0x18b040[_0x21ed('0x41')]['id']}})['then'](handleEntityNotFound(_0x24102a,null))[_0x21ed('0x3e')](saveUpdates(_0x18b040[_0x21ed('0x48')],null))['then'](respondWithResult(_0x24102a,null))['catch'](handleError(_0x24102a,null));};exports[_0x21ed('0x25')]=function(_0x258d2e,_0x4db602){return db[_0x21ed('0x28')]['find']({'where':{'id':_0x258d2e[_0x21ed('0x41')]['id']}})[_0x21ed('0x3e')](handleEntityNotFound(_0x4db602,null))[_0x21ed('0x3e')](removeEntity(_0x4db602,null))['catch'](handleError(_0x4db602,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 65606e7..3e6ff41 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 _0x2ce1=['rimraf','../../config/environment','exports','VoiceQueuesLog','event_dtm','event','dtm','api','moment','bluebird','request-promise'];(function(_0x2f5b3e,_0x4e7ed1){var _0x2c3b0c=function(_0x1b7237){while(--_0x1b7237){_0x2f5b3e['push'](_0x2f5b3e['shift']());}};_0x2c3b0c(++_0x4e7ed1);}(_0x2ce1,0x8b));var _0x12ce=function(_0x2b6fef,_0x15ea7e){_0x2b6fef=_0x2b6fef-0x0;var _0x4d81a4=_0x2ce1[_0x2b6fef];return _0x4d81a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x12ce('0x0'));var moment=require(_0x12ce('0x1'));var BPromise=require(_0x12ce('0x2'));var rp=require(_0x12ce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12ce('0x4'));var config=require(_0x12ce('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x12ce('0x6')]=function(_0x15aa00,_0x36562a){return _0x15aa00['define'](_0x12ce('0x7'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x12ce('0x8'),'fields':[_0x12ce('0x9'),_0x12ce('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x39c1=['./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x39c1,0x1e1));var _0x139c=function(_0x184a07,_0x21f49c){_0x184a07=_0x184a07-0x0;var _0x39326d=_0x39c1[_0x184a07];return _0x39326d;};'use strict';var _=require('lodash');var util=require(_0x139c('0x0'));var logger=require(_0x139c('0x1'))(_0x139c('0x2'));var moment=require(_0x139c('0x3'));var BPromise=require(_0x139c('0x4'));var rp=require(_0x139c('0x5'));var fs=require('fs');var path=require(_0x139c('0x6'));var rimraf=require(_0x139c('0x7'));var config=require(_0x139c('0x8'));var attributes=require(_0x139c('0x9'));module[_0x139c('0xa')]=function(_0x2e01b9,_0x2c964b){return _0x2e01b9[_0x139c('0xb')](_0x139c('0xc'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x139c('0xd'),'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 3e03b92..21ad0cf 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 _0x5dad=['../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x28b7a2,_0x40aa58){var _0x404e08=function(_0x5e2894){while(--_0x5e2894){_0x28b7a2['push'](_0x28b7a2['shift']());}};_0x404e08(++_0x40aa58);}(_0x5dad,0x128));var _0xd5da=function(_0x164eb6,_0x44039a){_0x164eb6=_0x164eb6-0x0;var _0x254a09=_0x5dad[_0x164eb6];return _0x254a09;};'use strict';var _=require(_0xd5da('0x0'));var util=require(_0xd5da('0x1'));var moment=require(_0xd5da('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd5da('0x4'));var logger=require(_0xd5da('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd5da('0x6'));var client=jayson[_0xd5da('0x7')][_0xd5da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x353542,_0x1a3536,_0x2cc03d){return new BPromise(function(_0x1900fe,_0x479e8c){return client[_0xd5da('0x9')](_0x353542,_0x2cc03d)['then'](function(_0x4fb71a){logger[_0xd5da('0xa')](_0xd5da('0xb'),_0x1a3536,_0xd5da('0xc'));logger['debug'](_0xd5da('0xd'),_0x1a3536,_0xd5da('0xc'),JSON[_0xd5da('0xe')](_0x4fb71a));if(_0x4fb71a['error']){if(_0x4fb71a[_0xd5da('0xf')][_0xd5da('0x10')]===0x1f4){logger[_0xd5da('0xf')](_0xd5da('0xb'),_0x1a3536,_0x4fb71a[_0xd5da('0xf')][_0xd5da('0x11')]);return _0x479e8c(_0x4fb71a['error'][_0xd5da('0x11')]);}logger['error'](_0xd5da('0xb'),_0x1a3536,_0x4fb71a[_0xd5da('0xf')]['message']);return _0x1900fe(_0x4fb71a['error'][_0xd5da('0x11')]);}else{logger[_0xd5da('0xa')](_0xd5da('0xb'),_0x1a3536,_0xd5da('0xc'));_0x1900fe(_0x4fb71a[_0xd5da('0x12')]['message']);}})[_0xd5da('0x13')](function(_0x15c96c){logger[_0xd5da('0xf')](_0xd5da('0xb'),_0x1a3536,_0x15c96c);_0x479e8c(_0x15c96c);});});} \ No newline at end of file +var _0x1326=['jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x1eb59c,_0x4f65aa){var _0x13e334=function(_0x25264b){while(--_0x25264b){_0x1eb59c['push'](_0x1eb59c['shift']());}};_0x13e334(++_0x4f65aa);}(_0x1326,0x101));var _0x6132=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x1326[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x6132('0x0'));var util=require('util');var moment=require(_0x6132('0x1'));var BPromise=require('bluebird');var rs=require(_0x6132('0x2'));var fs=require('fs');var Redis=require(_0x6132('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6132('0x4'));var logger=require('../../config/logger')(_0x6132('0x5'));var config=require(_0x6132('0x6'));var jayson=require(_0x6132('0x7'));var client=jayson[_0x6132('0x8')][_0x6132('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4be761,_0x46182f,_0xc0bb49){return new BPromise(function(_0x5e676c,_0x3c7a23){return client[_0x6132('0xa')](_0x4be761,_0xc0bb49)[_0x6132('0xb')](function(_0x23b5a4){logger['info'](_0x6132('0xc'),_0x46182f,'request\x20sent');logger['debug'](_0x6132('0xd'),_0x46182f,_0x6132('0xe'),JSON[_0x6132('0xf')](_0x23b5a4));if(_0x23b5a4['error']){if(_0x23b5a4[_0x6132('0x10')][_0x6132('0x11')]===0x1f4){logger[_0x6132('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x46182f,_0x23b5a4['error'][_0x6132('0x12')]);return _0x3c7a23(_0x23b5a4[_0x6132('0x10')][_0x6132('0x12')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x46182f,_0x23b5a4['error'][_0x6132('0x12')]);return _0x5e676c(_0x23b5a4['error'][_0x6132('0x12')]);}else{logger[_0x6132('0x13')](_0x6132('0xc'),_0x46182f,_0x6132('0xe'));_0x5e676c(_0x23b5a4[_0x6132('0x14')][_0x6132('0x12')]);}})[_0x6132('0x15')](function(_0x3c92a0){logger[_0x6132('0x10')](_0x6132('0xc'),_0x46182f,_0x3c92a0);_0x3c7a23(_0x3c92a0);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d10bd4a..b45f4ae 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 _0x7e7c=['index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','update','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x7e7c,0xa0));var _0xc7e7=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x7e7c[_0x4b174a];return _0x3cd7bf;};'use strict';var multer=require(_0xc7e7('0x0'));var util=require(_0xc7e7('0x1'));var path=require(_0xc7e7('0x2'));var timeout=require(_0xc7e7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc7e7('0x4'));var config=require('../../config/environment');var controller=require(_0xc7e7('0x5'));router[_0xc7e7('0x6')]('/',auth[_0xc7e7('0x7')](),controller[_0xc7e7('0x8')]);router[_0xc7e7('0x6')](_0xc7e7('0x9'),auth[_0xc7e7('0x7')](),controller[_0xc7e7('0xa')]);router['get'](_0xc7e7('0xb'),auth[_0xc7e7('0x7')](),controller[_0xc7e7('0xc')]);router['get'](_0xc7e7('0xd'),auth[_0xc7e7('0x7')](),controller[_0xc7e7('0xe')]);router[_0xc7e7('0x6')](_0xc7e7('0xf'),controller[_0xc7e7('0x10')]);router[_0xc7e7('0x6')](_0xc7e7('0x11'),auth[_0xc7e7('0x7')](),controller[_0xc7e7('0x12')]);router[_0xc7e7('0x13')]('/',auth[_0xc7e7('0x7')](),controller[_0xc7e7('0x14')]);router[_0xc7e7('0x13')]('/:id/transcribe',auth[_0xc7e7('0x7')](),controller['runTranscribe']);router['put']('/:id',auth[_0xc7e7('0x7')](),controller[_0xc7e7('0x15')]);router['delete'](_0xc7e7('0xb'),auth['isAuthenticated'](),controller[_0xc7e7('0x16')]);module[_0xc7e7('0x17')]=router; \ No newline at end of file +var _0x6689=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','/:id','/:id/download','download','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x6689,0x133));var _0x9668=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6689[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9668('0x0'));var util=require(_0x9668('0x1'));var path=require(_0x9668('0x2'));var timeout=require(_0x9668('0x3'));var express=require(_0x9668('0x4'));var router=express['Router']();var fs_extra=require(_0x9668('0x5'));var auth=require(_0x9668('0x6'));var interaction=require(_0x9668('0x7'));var config=require(_0x9668('0x8'));var controller=require(_0x9668('0x9'));router['get']('/',auth[_0x9668('0xa')](),controller[_0x9668('0xb')]);router[_0x9668('0xc')](_0x9668('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x9668('0xc')](_0x9668('0xe'),auth[_0x9668('0xa')](),controller['show']);router['get'](_0x9668('0xf'),auth[_0x9668('0xa')](),controller[_0x9668('0x10')]);router['get']('/:id/downloads',controller['downloads']);router[_0x9668('0xc')]('/:id/transcribe',auth[_0x9668('0xa')](),controller[_0x9668('0x11')]);router[_0x9668('0x12')]('/',auth[_0x9668('0xa')](),controller[_0x9668('0x13')]);router[_0x9668('0x12')](_0x9668('0x14'),auth[_0x9668('0xa')](),controller[_0x9668('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9668('0x16')]);router[_0x9668('0x17')](_0x9668('0xe'),auth[_0x9668('0xa')](),controller[_0x9668('0x18')]);module[_0x9668('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 19bf8d2..62ec67d 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(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 2bd4639..544929e 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 _0x7a69=['Not\x20found','downloads','MD5','sequelize','$and','push','value','secrets','recording','unlink','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribeAccountId','Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','fileText','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../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','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','body','describe','../../components/encryptor','uniqueid','format','%s.cypher','decryptFile','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname'];(function(_0x4a1412,_0x2b6ee8){var _0x2cc456=function(_0x2cf4a4){while(--_0x2cf4a4){_0x4a1412['push'](_0x4a1412['shift']());}};_0x2cc456(++_0x2b6ee8);}(_0x7a69,0xca));var _0x97a6=function(_0x6a9a88,_0x125ac8){_0x6a9a88=_0x6a9a88-0x0;var _0x1f8abd=_0x7a69[_0x6a9a88];return _0x1f8abd;};'use strict';var emlformat=require(_0x97a6('0x0'));var rimraf=require(_0x97a6('0x1'));var zipdir=require(_0x97a6('0x2'));var jsonpatch=require(_0x97a6('0x3'));var rp=require(_0x97a6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x97a6('0x5'));var util=require(_0x97a6('0x6'));var path=require('path');var sox=require(_0x97a6('0x7'));var csv=require('to-csv');var ejs=require(_0x97a6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97a6('0x9'));var squel=require(_0x97a6('0xa'));var crypto=require(_0x97a6('0xb'));var jsforce=require(_0x97a6('0xc'));var deskjs=require(_0x97a6('0xd'));var toCsv=require(_0x97a6('0xe'));var querystring=require(_0x97a6('0xf'));var Papa=require(_0x97a6('0x10'));var AWS=require(_0x97a6('0x11'));var uuidv4=require(_0x97a6('0x12'));var Redis=require('ioredis');var authService=require(_0x97a6('0x13'));var qs=require(_0x97a6('0x14'));var as=require(_0x97a6('0x15'));var hardwareService=require(_0x97a6('0x16'));var logger=require(_0x97a6('0x17'))(_0x97a6('0x18'));var utils=require(_0x97a6('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x97a6('0x1a'));var db=require(_0x97a6('0x1b'))['db'];function respondWithStatusCode(_0xcb8f1,_0x284e47){_0x284e47=_0x284e47||0xcc;return function(_0x48efd4){if(_0x48efd4){return _0xcb8f1[_0x97a6('0x1c')](_0x284e47);}return _0xcb8f1[_0x97a6('0x1d')](_0x284e47)['end']();};}function respondWithResult(_0x1f157b,_0x48b6ba){_0x48b6ba=_0x48b6ba||0xc8;return function(_0x1abb55){if(_0x1abb55){return _0x1f157b[_0x97a6('0x1d')](_0x48b6ba)[_0x97a6('0x1e')](_0x1abb55);}};}function respondWithFilteredResult(_0x3f73b6,_0x5dc299){return function(_0x5f1447){if(_0x5f1447){var _0x11ba22=typeof _0x5dc299['offset']===_0x97a6('0x1f')&&typeof _0x5dc299['limit']===_0x97a6('0x1f');var _0x30043c=_0x5f1447[_0x97a6('0x20')];var _0x51e3bc=_0x11ba22?0x0:_0x5dc299[_0x97a6('0x21')];var _0x389f33=_0x11ba22?_0x5f1447['count']:_0x5dc299[_0x97a6('0x21')]+_0x5dc299[_0x97a6('0x22')];var _0x60cef4;if(_0x389f33>=_0x30043c){_0x389f33=_0x30043c;_0x60cef4=0xc8;}else{_0x60cef4=0xce;}_0x3f73b6['status'](_0x60cef4);return _0x3f73b6[_0x97a6('0x23')](_0x97a6('0x24'),_0x51e3bc+'-'+_0x389f33+'/'+_0x30043c)[_0x97a6('0x1e')](_0x5f1447);}return null;};}function patchUpdates(_0x238295){return function(_0x463389){try{jsonpatch[_0x97a6('0x25')](_0x463389,_0x238295,!![]);}catch(_0x201bfc){return BPromise[_0x97a6('0x26')](_0x201bfc);}return _0x463389['save']();};}function saveUpdates(_0x63e5b4,_0x4939aa){return function(_0x2a5206){if(_0x2a5206){return _0x2a5206[_0x97a6('0x27')](_0x63e5b4)[_0x97a6('0x28')](function(_0x2e9cd7){return _0x2e9cd7;});}return null;};}function removeEntity(_0x250505,_0x56db4d){return function(_0x11eac6){if(_0x11eac6){return _0x11eac6[_0x97a6('0x29')]()[_0x97a6('0x28')](function(){_0x250505[_0x97a6('0x1d')](0xcc)[_0x97a6('0x2a')]();});}};}function handleEntityNotFound(_0x508cfc,_0x209a7c){return function(_0x117200){if(!_0x117200){_0x508cfc['sendStatus'](0x194);}return _0x117200;};}function handleError(_0x3a509c,_0x1aece8){_0x1aece8=_0x1aece8||0x1f4;return function(_0x36188a){logger[_0x97a6('0x2b')](_0x36188a[_0x97a6('0x2c')]);if(_0x36188a[_0x97a6('0x2d')]){delete _0x36188a[_0x97a6('0x2d')];}_0x3a509c[_0x97a6('0x1d')](_0x1aece8)[_0x97a6('0x2e')](_0x36188a);};}exports[_0x97a6('0x2f')]=function(_0x49cce4,_0x57f29b){var _0x53d8da={},_0x40121b={},_0x395daf={'count':0x0,'rows':[]};var _0xd0d440=_[_0x97a6('0x30')](db[_0x97a6('0x31')][_0x97a6('0x32')],function(_0x482e26){return{'name':_0x482e26[_0x97a6('0x33')],'type':_0x482e26[_0x97a6('0x34')][_0x97a6('0x35')]};});_0x40121b[_0x97a6('0x36')]=_[_0x97a6('0x37')](_[_0x97a6('0x30')](_0xd0d440,_0x97a6('0x2d')),['format']);_0x40121b[_0x97a6('0x38')]=_[_0x97a6('0x39')](_0x49cce4[_0x97a6('0x38')]);_0x40121b[_0x97a6('0x3a')]=_[_0x97a6('0x3b')](_0x40121b[_0x97a6('0x36')],_0x40121b[_0x97a6('0x38')]);_0x53d8da[_0x97a6('0x3c')]=_[_0x97a6('0x3b')](_0x40121b[_0x97a6('0x36')],qs[_0x97a6('0x3d')](_0x49cce4[_0x97a6('0x38')][_0x97a6('0x3d')]));_0x53d8da[_0x97a6('0x3c')]=_0x53d8da[_0x97a6('0x3c')]['length']?_0x53d8da[_0x97a6('0x3c')]:_0x40121b['model'];if(!_0x49cce4[_0x97a6('0x38')][_0x97a6('0x3e')](_0x97a6('0x3f'))){_0x53d8da[_0x97a6('0x22')]=qs[_0x97a6('0x22')](_0x49cce4[_0x97a6('0x38')]['limit']);_0x53d8da[_0x97a6('0x21')]=qs[_0x97a6('0x21')](_0x49cce4[_0x97a6('0x38')][_0x97a6('0x21')]);}_0x53d8da['order']=qs['sort'](_0x49cce4[_0x97a6('0x38')][_0x97a6('0x40')]);_0x53d8da[_0x97a6('0x41')]=qs['filters'](_[_0x97a6('0x42')](_0x49cce4['query'],_0x40121b[_0x97a6('0x3a')]),_0xd0d440);if(_0x49cce4[_0x97a6('0x38')][_0x97a6('0x43')]){_0x53d8da[_0x97a6('0x41')]=_[_0x97a6('0x44')](_0x53d8da['where'],{'$or':_[_0x97a6('0x30')](_0xd0d440,function(_0x5c2af9){if(_0x5c2af9[_0x97a6('0x34')]!==_0x97a6('0x45')){var _0x5d0a34={};_0x5d0a34[_0x5c2af9[_0x97a6('0x2d')]]={'$like':'%'+_0x49cce4[_0x97a6('0x38')][_0x97a6('0x43')]+'%'};return _0x5d0a34;}})});}_0x53d8da=_['merge']({},_0x53d8da,_0x49cce4['options']);var _0x70440c={'where':_0x53d8da[_0x97a6('0x41')]};return db[_0x97a6('0x31')][_0x97a6('0x20')](_0x70440c)[_0x97a6('0x28')](function(_0x55b1fe){_0x395daf[_0x97a6('0x20')]=_0x55b1fe;if(_0x49cce4['query'][_0x97a6('0x46')]){_0x53d8da[_0x97a6('0x47')]=[{'all':!![]}];}return db[_0x97a6('0x31')]['findAll'](_0x53d8da);})[_0x97a6('0x28')](function(_0x538dca){_0x395daf[_0x97a6('0x48')]=_0x538dca;return _0x395daf;})['then'](respondWithFilteredResult(_0x57f29b,_0x53d8da))[_0x97a6('0x49')](handleError(_0x57f29b,null));};exports[_0x97a6('0x4a')]=function(_0x339567,_0x4ffed0){var _0xf19ce={'raw':![],'where':{'id':_0x339567[_0x97a6('0x4b')]['id']}},_0x552201={};_0x552201[_0x97a6('0x36')]=_[_0x97a6('0x39')](db[_0x97a6('0x31')]['rawAttributes']);_0x552201[_0x97a6('0x38')]=_[_0x97a6('0x39')](_0x339567[_0x97a6('0x38')]);_0x552201[_0x97a6('0x3a')]=_[_0x97a6('0x3b')](_0x552201[_0x97a6('0x36')],_0x552201[_0x97a6('0x38')]);_0xf19ce[_0x97a6('0x3c')]=_['intersection'](_0x552201[_0x97a6('0x36')],qs['fields'](_0x339567[_0x97a6('0x38')][_0x97a6('0x3d')]));_0xf19ce[_0x97a6('0x3c')]=_0xf19ce['attributes']['length']?_0xf19ce[_0x97a6('0x3c')]:_0x552201[_0x97a6('0x36')];if(_0x339567['query'][_0x97a6('0x46')]){_0xf19ce[_0x97a6('0x47')]=[{'all':!![]}];}_0xf19ce=_[_0x97a6('0x44')]({},_0xf19ce,_0x339567['options']);return db['VoiceRecording'][_0x97a6('0x4c')](_0xf19ce)['then'](handleEntityNotFound(_0x4ffed0,null))[_0x97a6('0x28')](respondWithResult(_0x4ffed0,null))[_0x97a6('0x49')](handleError(_0x4ffed0,null));};exports[_0x97a6('0x4d')]=function(_0x3cfa7b,_0x490910){return db[_0x97a6('0x31')][_0x97a6('0x4d')](_0x3cfa7b['body'],{})[_0x97a6('0x28')](respondWithResult(_0x490910,0xc9))['catch'](handleError(_0x490910,null));};exports[_0x97a6('0x27')]=function(_0x25d55c,_0x45240c){if(_0x25d55c[_0x97a6('0x4e')]['id']){delete _0x25d55c[_0x97a6('0x4e')]['id'];}return db[_0x97a6('0x31')][_0x97a6('0x4c')]({'where':{'id':_0x25d55c[_0x97a6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45240c,null))[_0x97a6('0x28')](saveUpdates(_0x25d55c[_0x97a6('0x4e')],null))[_0x97a6('0x28')](respondWithResult(_0x45240c,null))[_0x97a6('0x49')](handleError(_0x45240c,null));};exports[_0x97a6('0x4f')]=function(_0x521a2b,_0x31766e){return db[_0x97a6('0x31')]['describe']()[_0x97a6('0x28')](respondWithResult(_0x31766e,null))[_0x97a6('0x49')](handleError(_0x31766e,null));};exports['download']=function(_0x2d4fb8,_0x24ba4d,_0x1b5a37){var _0x3eb854=require(_0x97a6('0x50'));var _0x2d8546=![];var _0x47a319={};if(_0x2d4fb8[_0x97a6('0x38')]['type']&&_0x2d4fb8[_0x97a6('0x38')][_0x97a6('0x34')]===_0x97a6('0x51')){_0x47a319[_0x97a6('0x51')]=_0x2d4fb8[_0x97a6('0x4b')]['id'];}else{_0x47a319['id']=_0x2d4fb8[_0x97a6('0x4b')]['id'];}return db[_0x97a6('0x31')][_0x97a6('0x4c')]({'where':_0x47a319,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x24ba4d,null))['then'](function(_0x1a5591){if(_0x1a5591){var _0x2c388c=_0x1a5591['value'];var _0x57df5c=util[_0x97a6('0x52')](_0x97a6('0x53'),_0x2c388c);if(fs['existsSync'](_0x57df5c)){_0x2d8546=!![];return _0x3eb854[_0x97a6('0x54')](_0x57df5c,_0x2c388c,config['secrets']['recording'])[_0x97a6('0x28')](function(){return _0x1a5591;});}return _0x1a5591;}})[_0x97a6('0x28')](function(_0x1f4c86){if(_0x1f4c86){var _0x3b78d9=_0x1f4c86['value'];if(!fs[_0x97a6('0x55')](_0x3b78d9)){throw new db[(_0x97a6('0x56'))][(_0x97a6('0x57'))](_0x97a6('0x58'));}if(_0x1f4c86[_0x97a6('0x59')]){return _0x24ba4d[_0x97a6('0x5a')](_0x3b78d9,_0x1f4c86[_0x97a6('0x59')]+path[_0x97a6('0x5b')](_0x3b78d9),function(){if(_0x2d8546){fs['unlink'](_0x3b78d9);}});}else{return _0x24ba4d[_0x97a6('0x5a')](_0x3b78d9,function(_0x4e8afd){if(_0x2d8546){fs['unlink'](_0x3b78d9);}});}}})[_0x97a6('0x49')](function(_0x16ebd0){if(_0x16ebd0['message']===_0x97a6('0x58')){_0x24ba4d[_0x97a6('0x1d')](0x194)[_0x97a6('0x2e')](_0x97a6('0x5c'));}else{return handleError(_0x24ba4d,null);}});};exports[_0x97a6('0x5d')]=function(_0x59929f,_0x57518f,_0x42e30b){var _0xe39d3e=require(_0x97a6('0x50'));var _0x4e4333=![];var _0x14efb8={'$and':[db['sequelize'][_0x97a6('0x41')](db['sequelize']['fn'](_0x97a6('0x5e'),db[_0x97a6('0x5f')]['col'](_0x97a6('0x51'))),_0x59929f[_0x97a6('0x38')]['token'])]};if(_0x59929f['query'][_0x97a6('0x34')]&&_0x59929f[_0x97a6('0x38')]['type']===_0x97a6('0x51')){_0x14efb8[_0x97a6('0x60')][_0x97a6('0x61')]({'uniqueid':_0x59929f[_0x97a6('0x4b')]['id']});}else{_0x14efb8[_0x97a6('0x60')][_0x97a6('0x61')]({'id':_0x59929f[_0x97a6('0x4b')]['id']});}return db[_0x97a6('0x31')][_0x97a6('0x4c')]({'where':_0x14efb8,'attributes':['id',_0x97a6('0x62')],'raw':!![]})[_0x97a6('0x28')](handleEntityNotFound(_0x57518f,null))[_0x97a6('0x28')](function(_0x1fa9cd){if(_0x1fa9cd){var _0x20937c=util[_0x97a6('0x52')](_0x97a6('0x53'),_0x1fa9cd[_0x97a6('0x62')]);if(fs[_0x97a6('0x55')](_0x20937c)){_0x4e4333=!![];return _0xe39d3e[_0x97a6('0x54')](_0x20937c,_0x1fa9cd[_0x97a6('0x62')],config[_0x97a6('0x63')][_0x97a6('0x64')])['then'](function(){return _0x1fa9cd;});}return _0x1fa9cd;}})[_0x97a6('0x28')](function(_0x2704ad){if(_0x2704ad){if(!fs[_0x97a6('0x55')](_0x2704ad[_0x97a6('0x62')])){throw new db['Sequelize']['ValidationError'](_0x97a6('0x58'));}if(_0x2704ad[_0x97a6('0x59')]){return _0x57518f[_0x97a6('0x5a')](_0x2704ad[_0x97a6('0x62')],_0x2704ad[_0x97a6('0x59')]+path['extname'](_0x2704ad['value']),function(){if(_0x4e4333){fs[_0x97a6('0x65')](_0x2704ad['value']);}});}else{return _0x57518f['download'](_0x2704ad[_0x97a6('0x62')],function(_0x4395a9){if(_0x4e4333){fs[_0x97a6('0x65')](_0x2704ad[_0x97a6('0x62')]);}});}}})[_0x97a6('0x49')](handleError(_0x57518f,null));};exports[_0x97a6('0x29')]=function(_0x572738,_0x272899){return db['VoiceRecording'][_0x97a6('0x4c')]({'where':{'id':_0x572738[_0x97a6('0x4b')]['id']}})[_0x97a6('0x28')](function(_0xe0da74){if(_[_0x97a6('0x66')](_0xe0da74)){throw new ReferenceError(_0x97a6('0x67'));}return _0xe0da74;})['then'](function(_0x34e769){var _0x252ad4=_0x34e769['value'];logger[_0x97a6('0x68')](_0x97a6('0x69'),_0x252ad4);if(!_['isNil'](_0x34e769['value'])&&fs[_0x97a6('0x55')](_0x252ad4)){logger['info'](_0x97a6('0x6a')+_0x252ad4+_0x97a6('0x6b'));fs[_0x97a6('0x6c')](_0x252ad4);}_0x252ad4=_0x252ad4+'.cypher';if(!_[_0x97a6('0x66')](_0x34e769[_0x97a6('0x62')])&&fs[_0x97a6('0x55')](_0x252ad4)){logger[_0x97a6('0x68')](_0x97a6('0x6a')+_0x252ad4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x252ad4);}return _0x34e769;})[_0x97a6('0x28')](function(_0x2001f0){if(!_0x2001f0)throw new InternalError();return _0x2001f0['destroy']();})['then'](function(){_0x272899['status'](0xcc)[_0x97a6('0x2a')]();})[_0x97a6('0x49')](handleError(_0x272899,null));};function getBucketslist(_0x4a4121,_0x75fc9a,_0x5d17d2){return new Promise(function(_0x17686d,_0x241626){var _0x4495f7=new AWS['S3']({'accessKeyId':_0x75fc9a,'secretAccessKey':_0x4a4121,'region':_0x5d17d2});_0x4495f7[_0x97a6('0x6d')]({},function(_0x3e9f09,_0x5a8664){if(_0x3e9f09){return _0x241626(_0x3e9f09);}else{return _0x17686d(_0x5a8664);}});});}function createBucket(_0x4322be,_0x40ec6e,_0x56ae1d,_0x47739d){return new Promise(function(_0x1669f9,_0x55c169){var _0x14a748=new AWS['S3']({'accessKeyId':_0x40ec6e,'secretAccessKey':_0x4322be,'region':_0x56ae1d});_0x14a748[_0x97a6('0x6e')]({'Bucket':_0x47739d},function(_0x6dce04,_0x1395e3){if(_0x6dce04){return _0x55c169(_0x6dce04);}else{return _0x1669f9(_0x1395e3);}});});}function uploadFile(_0x410399,_0x1f648a,_0x5a84ec,_0x50c34b,_0x38e578,_0x31172a){return new Promise(function(_0x4dd0db,_0x158395){var _0x281df0=new AWS['S3']({'accessKeyId':_0x1f648a,'secretAccessKey':_0x410399,'region':_0x5a84ec});_0x281df0['upload']({'Bucket':_0x50c34b,'Key':_0x38e578,'Body':_0x31172a},function(_0x16e029,_0x358998){if(_0x16e029){return _0x158395(_0x16e029);}else{return _0x4dd0db(_0x358998);}});});}function startTranscribe(_0x33a8eb,_0x16a266,_0x1860e0,_0x322d2c,_0x3fee45,_0x4ad907){return new Promise(function(_0x5404d8,_0xee0f26){var _0x29d463=new AWS['TranscribeService']({'accessKeyId':_0x16a266,'secretAccessKey':_0x33a8eb,'region':_0x1860e0});_0x29d463['startTranscriptionJob']({'TranscriptionJobName':_0x322d2c,'LanguageCode':_0x3fee45,'Media':{'MediaFileUri':_0x4ad907}},function(_0x5b5bb4,_0x7df775){if(_0x5b5bb4){return _0xee0f26(_0x5b5bb4);}else{return _0x5404d8(_0x7df775);}});});}function transcribe(_0x491b10,_0x9e9b8f,_0x50c9a9,_0x4a56b6,_0x301e82,_0x49c07e,_0x190f24){return new Promise(function(_0x1dfa4f,_0x35e6d6){var _0x599b11={};logger[_0x97a6('0x68')](util['format'](_0x97a6('0x6f'),_0x491b10,_0x301e82));return uploadFile(_0x9e9b8f,_0x50c9a9,_0x4a56b6,_0x301e82,path[_0x97a6('0x70')](_0x49c07e),fs['readFileSync'](_0x49c07e))[_0x97a6('0x28')](function(_0x4fa717){logger['info'](util[_0x97a6('0x52')](_0x97a6('0x71'),_0x491b10,_0x301e82,_0x4fa717[_0x97a6('0x72')]));_0x599b11[_0x97a6('0x73')]=_0x4fa717['Bucket'];_0x599b11[_0x97a6('0x74')]=_0x4fa717[_0x97a6('0x72')];logger[_0x97a6('0x68')](util[_0x97a6('0x52')](_0x97a6('0x75'),_0x491b10));return startTranscribe(_0x9e9b8f,_0x50c9a9,_0x4a56b6,uuidv4(),_0x190f24,_0x4fa717[_0x97a6('0x72')]);})[_0x97a6('0x28')](function(_0x2b5a27){logger[_0x97a6('0x68')](util[_0x97a6('0x52')](_0x97a6('0x76'),_0x491b10,_0x2b5a27['TranscriptionJob']['TranscriptionJobName']));_0x599b11['transcribeName']=_0x2b5a27[_0x97a6('0x77')][_0x97a6('0x78')];_0x599b11[_0x97a6('0x79')]=_0x2b5a27[_0x97a6('0x77')][_0x97a6('0x7a')];return _0x1dfa4f(_0x599b11);})[_0x97a6('0x49')](function(_0x59c82c){return _0x35e6d6(_0x59c82c);});});}exports[_0x97a6('0x7b')]=function(_0x244910,_0x5c9ff6,_0x24ef15){var _0x21085f;var _0x5949fb;var _0x3739d8;var _0x5087a9=require('../../components/encryptor');return db['VoiceRecording'][_0x97a6('0x7c')]({'where':{'id':_0x244910[_0x97a6('0x4b')]['id']}})['then'](function(_0x396846){if(_0x396846){var _0x58c53e=util['format'](_0x97a6('0x53'),_0x396846[_0x97a6('0x62')]);if(fs[_0x97a6('0x55')](_0x58c53e)){cypher=!![];return _0x5087a9[_0x97a6('0x54')](_0x58c53e,_0x396846[_0x97a6('0x62')],config[_0x97a6('0x63')][_0x97a6('0x64')])[_0x97a6('0x28')](function(){return _0x396846;});}return _0x396846;}})['then'](function(_0x3ce21a){if(!_0x3ce21a){throw new db['Sequelize'][(_0x97a6('0x57'))]('Voice\x20Recording\x20not\x20found');}_0x5949fb=_0x3ce21a;return db[_0x97a6('0x7d')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x5c9ff6,null))[_0x97a6('0x28')](function(_0x389e27){if(_0x389e27){_0x21085f=_0x389e27;if(!_0x21085f['transcribe']||!_0x21085f[_0x97a6('0x7e')]||!_0x21085f['transcribeRegion']||!_0x21085f['language']||!_0x21085f['bucket']){throw new db[(_0x97a6('0x56'))][(_0x97a6('0x57'))](_0x97a6('0x7f'));}if(_0x244910['body']['runSentiment']&&(!_0x21085f['sentiment']||!_0x21085f[_0x97a6('0x80')]||!_0x21085f[_0x97a6('0x81')]||!_0x21085f[_0x97a6('0x82')]||!_0x21085f[_0x97a6('0x73')])){throw new db['Sequelize'][(_0x97a6('0x57'))](_0x97a6('0x83'));}return db[_0x97a6('0x84')][_0x97a6('0x7c')]({'where':{'id':_0x21085f[_0x97a6('0x7e')]}});}})['then'](function(_0x5f1b59){if(!_0x5f1b59){throw new db[(_0x97a6('0x56'))][(_0x97a6('0x57'))](_0x97a6('0x85'));}if(!_0x5f1b59[_0x97a6('0x86')]||!_0x5f1b59[_0x97a6('0x87')]){throw new db['Sequelize'][(_0x97a6('0x57'))]('Cloud\x20Provider\x20not\x20configured');}_0x3739d8=_0x5f1b59;return getBucketslist(_0x3739d8[_0x97a6('0x86')],_0x3739d8[_0x97a6('0x87')],_0x21085f['transcribeRegion']);})[_0x97a6('0x28')](function(_0x56c414){if(_0x56c414&&_0x56c414[_0x97a6('0x88')]){var _0x3768a4=_[_0x97a6('0x4c')](_0x56c414['Buckets'],function(_0xbd9f9c){return _0xbd9f9c[_0x97a6('0x89')]===_0x21085f[_0x97a6('0x73')];});if(!_0x3768a4){logger[_0x97a6('0x68')](util[_0x97a6('0x52')](_0x97a6('0x8a'),_0x244910[_0x97a6('0x4b')]['id'],_0x21085f['bucket']));return createBucket(_0x3739d8[_0x97a6('0x86')],_0x3739d8['data2'],_0x21085f['transcribeRegion'],_0x21085f[_0x97a6('0x73')]);}logger['info'](util[_0x97a6('0x52')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x244910[_0x97a6('0x4b')]['id'],_0x21085f[_0x97a6('0x73')]));return;}})[_0x97a6('0x28')](function(_0x1bcb30){if(_0x5949fb['transcribeStatus']==='NEW'){return transcribe(_0x244910[_0x97a6('0x4b')]['id'],_0x3739d8[_0x97a6('0x86')],_0x3739d8[_0x97a6('0x87')],_0x21085f[_0x97a6('0x8b')],_0x21085f['bucket'],_0x5949fb['value'],_0x21085f[_0x97a6('0x82')]);}else{logger[_0x97a6('0x68')](util[_0x97a6('0x52')](_0x97a6('0x8c'),_0x244910['params']['id']));return{'transcribeStatus':_0x97a6('0x8d')};}})[_0x97a6('0x28')](function(_0x53fa39){if(_0x53fa39){_0x53fa39[_0x97a6('0x8e')]=_0x244910[_0x97a6('0x4e')][_0x97a6('0x8f')];return _0x5949fb['updateAttributes'](_0x53fa39);}})[_0x97a6('0x28')](respondWithResult(_0x5c9ff6,null))['catch'](handleError(_0x5c9ff6,null));};function writeFile(_0x19d476,_0x39a1b1){return new Promise(function(_0x145383,_0x2e7871){fs[_0x97a6('0x90')](_0x39a1b1,_0x19d476,function(_0xa14f52,_0xb93fb7){if(_0xa14f52){return _0x2e7871(_0xa14f52);}else{return _0x145383(_0xb93fb7);}});});}exports['downloadTranscribe']=function(_0x254ecb,_0x2adf49,_0x11b5e1){return db[_0x97a6('0x31')][_0x97a6('0x7c')]({'where':{'id':_0x254ecb['params']['id']}})[_0x97a6('0x28')](handleEntityNotFound(_0x2adf49))[_0x97a6('0x28')](function(_0x97fd4f){if(_0x97fd4f&&_0x97fd4f['fileText']){var _0x45f475=_0x97fd4f[_0x97a6('0x91')];var _0x1aa043=config[_0x97a6('0x92')]+'/server/files/transcribes/transcribe_'+_0x97fd4f['id']+'.txt';if(fs[_0x97a6('0x55')](_0x1aa043)){return _0x1aa043;}return writeFile(_0x45f475,_0x1aa043)['then'](function(){return _0x1aa043;});}else{throw new db[(_0x97a6('0x56'))][(_0x97a6('0x57'))]('Transcript\x20not\x20available');}})['then'](function(_0xfd171f){return _0x2adf49[_0x97a6('0x5a')](_0xfd171f);})[_0x97a6('0x49')](handleError(_0x2adf49));}; \ No newline at end of file +var _0x258f=['differenceBy','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','VoiceRecording','includeAll','include','findAll','catch','show','params','fields','create','body','find','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','push','$and','format','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','upload','TranscribeService','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model'];(function(_0x41d364,_0xdfdc1a){var _0x5ace98=function(_0x5f1194){while(--_0x5f1194){_0x41d364['push'](_0x41d364['shift']());}};_0x5ace98(++_0xdfdc1a);}(_0x258f,0xee));var _0xf258=function(_0x5ef6b5,_0xd19d38){_0x5ef6b5=_0x5ef6b5-0x0;var _0x27c362=_0x258f[_0x5ef6b5];return _0x27c362;};'use strict';var emlformat=require(_0xf258('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf258('0x1'));var jsonpatch=require(_0xf258('0x2'));var rp=require(_0xf258('0x3'));var moment=require(_0xf258('0x4'));var BPromise=require(_0xf258('0x5'));var Mustache=require('mustache');var util=require(_0xf258('0x6'));var path=require('path');var sox=require(_0xf258('0x7'));var csv=require(_0xf258('0x8'));var ejs=require(_0xf258('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf258('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf258('0xb'));var toCsv=require(_0xf258('0x8'));var querystring=require('querystring');var Papa=require(_0xf258('0xc'));var AWS=require(_0xf258('0xd'));var uuidv4=require(_0xf258('0xe'));var Redis=require(_0xf258('0xf'));var authService=require(_0xf258('0x10'));var qs=require(_0xf258('0x11'));var as=require(_0xf258('0x12'));var hardwareService=require(_0xf258('0x13'));var logger=require(_0xf258('0x14'))(_0xf258('0x15'));var utils=require('../../config/utils');var config=require(_0xf258('0x16'));var licenseUtil=require(_0xf258('0x17'));var db=require(_0xf258('0x18'))['db'];function respondWithStatusCode(_0xdefe97,_0x2b49c7){_0x2b49c7=_0x2b49c7||0xcc;return function(_0x74b64e){if(_0x74b64e){return _0xdefe97[_0xf258('0x19')](_0x2b49c7);}return _0xdefe97[_0xf258('0x1a')](_0x2b49c7)['end']();};}function respondWithResult(_0x34e537,_0x519ae6){_0x519ae6=_0x519ae6||0xc8;return function(_0x4241ec){if(_0x4241ec){return _0x34e537['status'](_0x519ae6)[_0xf258('0x1b')](_0x4241ec);}};}function respondWithFilteredResult(_0x36593a,_0x39fa0f){return function(_0x39f5a5){if(_0x39f5a5){var _0x1f7c20=typeof _0x39fa0f['offset']===_0xf258('0x1c')&&typeof _0x39fa0f[_0xf258('0x1d')]===_0xf258('0x1c');var _0xa49025=_0x39f5a5[_0xf258('0x1e')];var _0x1e9c91=_0x1f7c20?0x0:_0x39fa0f[_0xf258('0x1f')];var _0x1487f8=_0x1f7c20?_0x39f5a5[_0xf258('0x1e')]:_0x39fa0f[_0xf258('0x1f')]+_0x39fa0f['limit'];var _0x215241;if(_0x1487f8>=_0xa49025){_0x1487f8=_0xa49025;_0x215241=0xc8;}else{_0x215241=0xce;}_0x36593a[_0xf258('0x1a')](_0x215241);return _0x36593a[_0xf258('0x20')](_0xf258('0x21'),_0x1e9c91+'-'+_0x1487f8+'/'+_0xa49025)['json'](_0x39f5a5);}return null;};}function patchUpdates(_0x4f6717){return function(_0x50ec7c){try{jsonpatch['apply'](_0x50ec7c,_0x4f6717,!![]);}catch(_0xd281fb){return BPromise[_0xf258('0x22')](_0xd281fb);}return _0x50ec7c[_0xf258('0x23')]();};}function saveUpdates(_0x518b10,_0x231792){return function(_0x32eab5){if(_0x32eab5){return _0x32eab5[_0xf258('0x24')](_0x518b10)[_0xf258('0x25')](function(_0x3d25fd){return _0x3d25fd;});}return null;};}function removeEntity(_0x398ec3,_0x17489e){return function(_0x366c10){if(_0x366c10){return _0x366c10[_0xf258('0x26')]()[_0xf258('0x25')](function(){_0x398ec3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dd3d2,_0x1ee27f){return function(_0x760054){if(!_0x760054){_0x4dd3d2[_0xf258('0x19')](0x194);}return _0x760054;};}function handleError(_0x235bba,_0x1b4141){_0x1b4141=_0x1b4141||0x1f4;return function(_0x412338){logger['error'](_0x412338[_0xf258('0x27')]);if(_0x412338['name']){delete _0x412338[_0xf258('0x28')];}_0x235bba[_0xf258('0x1a')](_0x1b4141)[_0xf258('0x29')](_0x412338);};}exports[_0xf258('0x2a')]=function(_0x1dfa99,_0xdb23c6){var _0x2cbf24={},_0x84d0ef={},_0x14e894={'count':0x0,'rows':[]};var _0x492cbf=_[_0xf258('0x2b')](db['VoiceRecording']['rawAttributes'],function(_0x2c67c4){return{'name':_0x2c67c4[_0xf258('0x2c')],'type':_0x2c67c4[_0xf258('0x2d')][_0xf258('0x2e')]};});_0x84d0ef[_0xf258('0x2f')]=_[_0xf258('0x30')](_[_0xf258('0x2b')](_0x492cbf,_0xf258('0x28')),['format']);_0x84d0ef[_0xf258('0x31')]=_[_0xf258('0x32')](_0x1dfa99[_0xf258('0x31')]);_0x84d0ef[_0xf258('0x33')]=_[_0xf258('0x34')](_0x84d0ef[_0xf258('0x2f')],_0x84d0ef[_0xf258('0x31')]);_0x2cbf24[_0xf258('0x35')]=_[_0xf258('0x34')](_0x84d0ef[_0xf258('0x2f')],qs['fields'](_0x1dfa99[_0xf258('0x31')]['fields']));_0x2cbf24[_0xf258('0x35')]=_0x2cbf24[_0xf258('0x35')][_0xf258('0x36')]?_0x2cbf24[_0xf258('0x35')]:_0x84d0ef[_0xf258('0x2f')];if(!_0x1dfa99[_0xf258('0x31')]['hasOwnProperty'](_0xf258('0x37'))){_0x2cbf24[_0xf258('0x1d')]=qs[_0xf258('0x1d')](_0x1dfa99[_0xf258('0x31')][_0xf258('0x1d')]);_0x2cbf24[_0xf258('0x1f')]=qs['offset'](_0x1dfa99[_0xf258('0x31')][_0xf258('0x1f')]);}_0x2cbf24[_0xf258('0x38')]=qs['sort'](_0x1dfa99['query'][_0xf258('0x39')]);_0x2cbf24[_0xf258('0x3a')]=qs['filters'](_[_0xf258('0x3b')](_0x1dfa99[_0xf258('0x31')],_0x84d0ef[_0xf258('0x33')]),_0x492cbf);if(_0x1dfa99[_0xf258('0x31')]['filter']){_0x2cbf24[_0xf258('0x3a')]=_[_0xf258('0x3c')](_0x2cbf24[_0xf258('0x3a')],{'$or':_[_0xf258('0x2b')](_0x492cbf,function(_0x3ef5dd){if(_0x3ef5dd[_0xf258('0x2d')]!==_0xf258('0x3d')){var _0x1e240c={};_0x1e240c[_0x3ef5dd['name']]={'$like':'%'+_0x1dfa99[_0xf258('0x31')][_0xf258('0x3e')]+'%'};return _0x1e240c;}})});}_0x2cbf24=_[_0xf258('0x3c')]({},_0x2cbf24,_0x1dfa99['options']);var _0x55ea75={'where':_0x2cbf24[_0xf258('0x3a')]};return db[_0xf258('0x3f')][_0xf258('0x1e')](_0x55ea75)['then'](function(_0x256f3d){_0x14e894[_0xf258('0x1e')]=_0x256f3d;if(_0x1dfa99[_0xf258('0x31')][_0xf258('0x40')]){_0x2cbf24[_0xf258('0x41')]=[{'all':!![]}];}return db[_0xf258('0x3f')][_0xf258('0x42')](_0x2cbf24);})['then'](function(_0x29cca0){_0x14e894['rows']=_0x29cca0;return _0x14e894;})[_0xf258('0x25')](respondWithFilteredResult(_0xdb23c6,_0x2cbf24))[_0xf258('0x43')](handleError(_0xdb23c6,null));};exports[_0xf258('0x44')]=function(_0x1a8b15,_0x24462d){var _0x4a5235={'raw':![],'where':{'id':_0x1a8b15[_0xf258('0x45')]['id']}},_0x18e652={};_0x18e652[_0xf258('0x2f')]=_['keys'](db[_0xf258('0x3f')]['rawAttributes']);_0x18e652['query']=_[_0xf258('0x32')](_0x1a8b15[_0xf258('0x31')]);_0x18e652[_0xf258('0x33')]=_['intersection'](_0x18e652['model'],_0x18e652[_0xf258('0x31')]);_0x4a5235['attributes']=_[_0xf258('0x34')](_0x18e652[_0xf258('0x2f')],qs[_0xf258('0x46')](_0x1a8b15[_0xf258('0x31')]['fields']));_0x4a5235[_0xf258('0x35')]=_0x4a5235[_0xf258('0x35')][_0xf258('0x36')]?_0x4a5235[_0xf258('0x35')]:_0x18e652[_0xf258('0x2f')];if(_0x1a8b15[_0xf258('0x31')][_0xf258('0x40')]){_0x4a5235[_0xf258('0x41')]=[{'all':!![]}];}_0x4a5235=_[_0xf258('0x3c')]({},_0x4a5235,_0x1a8b15['options']);return db[_0xf258('0x3f')]['find'](_0x4a5235)[_0xf258('0x25')](handleEntityNotFound(_0x24462d,null))[_0xf258('0x25')](respondWithResult(_0x24462d,null))[_0xf258('0x43')](handleError(_0x24462d,null));};exports[_0xf258('0x47')]=function(_0x11986a,_0x213d84){return db[_0xf258('0x3f')]['create'](_0x11986a[_0xf258('0x48')],{})[_0xf258('0x25')](respondWithResult(_0x213d84,0xc9))['catch'](handleError(_0x213d84,null));};exports['update']=function(_0x48eb98,_0xf687f4){if(_0x48eb98['body']['id']){delete _0x48eb98[_0xf258('0x48')]['id'];}return db[_0xf258('0x3f')][_0xf258('0x49')]({'where':{'id':_0x48eb98[_0xf258('0x45')]['id']}})[_0xf258('0x25')](handleEntityNotFound(_0xf687f4,null))[_0xf258('0x25')](saveUpdates(_0x48eb98[_0xf258('0x48')],null))['then'](respondWithResult(_0xf687f4,null))[_0xf258('0x43')](handleError(_0xf687f4,null));};exports['describe']=function(_0x95125f,_0x17d7aa){return db[_0xf258('0x3f')]['describe']()['then'](respondWithResult(_0x17d7aa,null))['catch'](handleError(_0x17d7aa,null));};exports[_0xf258('0x4a')]=function(_0x32cfba,_0x14b16a,_0x38e23d){var _0x2f49b2=require(_0xf258('0x4b'));var _0x3b08e7=![];var _0x2bafb9={};if(_0x32cfba[_0xf258('0x31')][_0xf258('0x2d')]&&_0x32cfba[_0xf258('0x31')][_0xf258('0x2d')]===_0xf258('0x4c')){_0x2bafb9[_0xf258('0x4c')]=_0x32cfba[_0xf258('0x45')]['id'];}else{_0x2bafb9['id']=_0x32cfba[_0xf258('0x45')]['id'];}return db['VoiceRecording'][_0xf258('0x49')]({'where':_0x2bafb9,'attributes':['id','value'],'raw':!![]})[_0xf258('0x25')](handleEntityNotFound(_0x14b16a,null))['then'](function(_0x3a75f7){if(_0x3a75f7){var _0x2b401f=_0x3a75f7[_0xf258('0x4d')];var _0x9023f8=util['format'](_0xf258('0x4e'),_0x2b401f);if(fs['existsSync'](_0x9023f8)){_0x3b08e7=!![];return _0x2f49b2[_0xf258('0x4f')](_0x9023f8,_0x2b401f,config[_0xf258('0x50')][_0xf258('0x51')])['then'](function(){return _0x3a75f7;});}return _0x3a75f7;}})[_0xf258('0x25')](function(_0xc3aa77){if(_0xc3aa77){var _0x19c013=_0xc3aa77[_0xf258('0x4d')];if(!fs[_0xf258('0x52')](_0x19c013)){throw new db[(_0xf258('0x53'))][(_0xf258('0x54'))](_0xf258('0x55'));}if(_0xc3aa77[_0xf258('0x56')]){return _0x14b16a[_0xf258('0x4a')](_0x19c013,_0xc3aa77['filename']+path[_0xf258('0x57')](_0x19c013),function(){if(_0x3b08e7){fs['unlink'](_0x19c013);}});}else{return _0x14b16a[_0xf258('0x4a')](_0x19c013,function(_0x34bcd6){if(_0x3b08e7){fs[_0xf258('0x58')](_0x19c013);}});}}})['catch'](function(_0x1186d7){if(_0x1186d7['message']===_0xf258('0x55')){_0x14b16a[_0xf258('0x1a')](0x194)[_0xf258('0x29')](_0xf258('0x59'));}else{return handleError(_0x14b16a,null);}});};exports[_0xf258('0x5a')]=function(_0x475e2d,_0x9fbfbd,_0x56f6b8){var _0x336660=require('../../components/encryptor');var _0xf18b3c=![];var _0x416c08={'$and':[db[_0xf258('0x5b')]['where'](db[_0xf258('0x5b')]['fn'](_0xf258('0x5c'),db[_0xf258('0x5b')]['col'](_0xf258('0x4c'))),_0x475e2d[_0xf258('0x31')]['token'])]};if(_0x475e2d[_0xf258('0x31')][_0xf258('0x2d')]&&_0x475e2d[_0xf258('0x31')][_0xf258('0x2d')]==='uniqueid'){_0x416c08['$and'][_0xf258('0x5d')]({'uniqueid':_0x475e2d[_0xf258('0x45')]['id']});}else{_0x416c08[_0xf258('0x5e')][_0xf258('0x5d')]({'id':_0x475e2d['params']['id']});}return db['VoiceRecording'][_0xf258('0x49')]({'where':_0x416c08,'attributes':['id',_0xf258('0x4d')],'raw':!![]})[_0xf258('0x25')](handleEntityNotFound(_0x9fbfbd,null))[_0xf258('0x25')](function(_0x2b5889){if(_0x2b5889){var _0x27a7ed=util[_0xf258('0x5f')](_0xf258('0x4e'),_0x2b5889[_0xf258('0x4d')]);if(fs[_0xf258('0x52')](_0x27a7ed)){_0xf18b3c=!![];return _0x336660[_0xf258('0x4f')](_0x27a7ed,_0x2b5889['value'],config[_0xf258('0x50')][_0xf258('0x51')])['then'](function(){return _0x2b5889;});}return _0x2b5889;}})[_0xf258('0x25')](function(_0x30c1ef){if(_0x30c1ef){if(!fs[_0xf258('0x52')](_0x30c1ef[_0xf258('0x4d')])){throw new db['Sequelize'][(_0xf258('0x54'))](_0xf258('0x55'));}if(_0x30c1ef['filename']){return _0x9fbfbd['download'](_0x30c1ef['value'],_0x30c1ef[_0xf258('0x56')]+path['extname'](_0x30c1ef[_0xf258('0x4d')]),function(){if(_0xf18b3c){fs[_0xf258('0x58')](_0x30c1ef['value']);}});}else{return _0x9fbfbd[_0xf258('0x4a')](_0x30c1ef['value'],function(_0x12af6a){if(_0xf18b3c){fs[_0xf258('0x58')](_0x30c1ef[_0xf258('0x4d')]);}});}}})[_0xf258('0x43')](handleError(_0x9fbfbd,null));};exports['destroy']=function(_0x3f3eae,_0x32fe3b){return db[_0xf258('0x3f')][_0xf258('0x49')]({'where':{'id':_0x3f3eae[_0xf258('0x45')]['id']}})[_0xf258('0x25')](function(_0x4a0091){if(_[_0xf258('0x60')](_0x4a0091)){throw new ReferenceError(_0xf258('0x61'));}return _0x4a0091;})['then'](function(_0x19c795){var _0x3d7f40=_0x19c795[_0xf258('0x4d')];logger[_0xf258('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x3d7f40);if(!_[_0xf258('0x60')](_0x19c795['value'])&&fs[_0xf258('0x52')](_0x3d7f40)){logger[_0xf258('0x62')](_0xf258('0x63')+_0x3d7f40+_0xf258('0x64'));fs['unlinkSync'](_0x3d7f40);}_0x3d7f40=_0x3d7f40+_0xf258('0x65');if(!_[_0xf258('0x60')](_0x19c795['value'])&&fs[_0xf258('0x52')](_0x3d7f40)){logger['info'](_0xf258('0x63')+_0x3d7f40+_0xf258('0x64'));fs[_0xf258('0x66')](_0x3d7f40);}return _0x19c795;})['then'](function(_0x4f34fb){if(!_0x4f34fb)throw new InternalError();return _0x4f34fb[_0xf258('0x26')]();})[_0xf258('0x25')](function(){_0x32fe3b[_0xf258('0x1a')](0xcc)['end']();})[_0xf258('0x43')](handleError(_0x32fe3b,null));};function getBucketslist(_0xcd626c,_0x5b9348,_0x28677b){return new Promise(function(_0x43a5bb,_0x465f02){var _0x18e21c=new AWS['S3']({'accessKeyId':_0x5b9348,'secretAccessKey':_0xcd626c,'region':_0x28677b});_0x18e21c[_0xf258('0x67')]({},function(_0x11916c,_0x2f3ccb){if(_0x11916c){return _0x465f02(_0x11916c);}else{return _0x43a5bb(_0x2f3ccb);}});});}function createBucket(_0x29af3e,_0x5eeef6,_0xe7f8fd,_0x398955){return new Promise(function(_0xf2981f,_0x504d4e){var _0x30bf5a=new AWS['S3']({'accessKeyId':_0x5eeef6,'secretAccessKey':_0x29af3e,'region':_0xe7f8fd});_0x30bf5a['createBucket']({'Bucket':_0x398955},function(_0x3b8598,_0x3ae08f){if(_0x3b8598){return _0x504d4e(_0x3b8598);}else{return _0xf2981f(_0x3ae08f);}});});}function uploadFile(_0xb3d356,_0x289967,_0x3aa9a1,_0x5320c4,_0x1b1900,_0x26b52e){return new Promise(function(_0x367df8,_0x647f65){var _0x3b38ce=new AWS['S3']({'accessKeyId':_0x289967,'secretAccessKey':_0xb3d356,'region':_0x3aa9a1});_0x3b38ce[_0xf258('0x68')]({'Bucket':_0x5320c4,'Key':_0x1b1900,'Body':_0x26b52e},function(_0x22d822,_0x1d9ee9){if(_0x22d822){return _0x647f65(_0x22d822);}else{return _0x367df8(_0x1d9ee9);}});});}function startTranscribe(_0x2c3b4a,_0x37d7c2,_0x21fae1,_0x2f73ca,_0x1b4981,_0x2c431f){return new Promise(function(_0x33bac5,_0x5d9e60){var _0x5ca74a=new AWS[(_0xf258('0x69'))]({'accessKeyId':_0x37d7c2,'secretAccessKey':_0x2c3b4a,'region':_0x21fae1});_0x5ca74a['startTranscriptionJob']({'TranscriptionJobName':_0x2f73ca,'LanguageCode':_0x1b4981,'Media':{'MediaFileUri':_0x2c431f}},function(_0x7ac192,_0x1f88dd){if(_0x7ac192){return _0x5d9e60(_0x7ac192);}else{return _0x33bac5(_0x1f88dd);}});});}function transcribe(_0x5509ec,_0x18d628,_0x39f29f,_0x33107a,_0x542cb0,_0x5f829,_0x454052){return new Promise(function(_0x1ce6c7,_0x56270e){var _0x278311={};logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5509ec,_0x542cb0));return uploadFile(_0x18d628,_0x39f29f,_0x33107a,_0x542cb0,path['basename'](_0x5f829),fs[_0xf258('0x6a')](_0x5f829))['then'](function(_0x33c3c1){logger[_0xf258('0x62')](util[_0xf258('0x5f')](_0xf258('0x6b'),_0x5509ec,_0x542cb0,_0x33c3c1[_0xf258('0x6c')]));_0x278311['bucket']=_0x33c3c1[_0xf258('0x6d')];_0x278311[_0xf258('0x6e')]=_0x33c3c1['Location'];logger['info'](util[_0xf258('0x5f')](_0xf258('0x6f'),_0x5509ec));return startTranscribe(_0x18d628,_0x39f29f,_0x33107a,uuidv4(),_0x454052,_0x33c3c1[_0xf258('0x6c')]);})[_0xf258('0x25')](function(_0x543d93){logger[_0xf258('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x5509ec,_0x543d93[_0xf258('0x70')][_0xf258('0x71')]));_0x278311['transcribeName']=_0x543d93[_0xf258('0x70')]['TranscriptionJobName'];_0x278311[_0xf258('0x72')]=_0x543d93['TranscriptionJob'][_0xf258('0x73')];return _0x1ce6c7(_0x278311);})[_0xf258('0x43')](function(_0x5c1c6a){return _0x56270e(_0x5c1c6a);});});}exports['runTranscribe']=function(_0x6ec3d5,_0x38cec1,_0x21ae78){var _0x5cce28;var _0x4e8d8e;var _0x4f14d4;var _0x15781f=require(_0xf258('0x4b'));return db[_0xf258('0x3f')]['findOne']({'where':{'id':_0x6ec3d5['params']['id']}})[_0xf258('0x25')](function(_0x2f5575){if(_0x2f5575){var _0xd31b3=util[_0xf258('0x5f')](_0xf258('0x4e'),_0x2f5575[_0xf258('0x4d')]);if(fs['existsSync'](_0xd31b3)){cypher=!![];return _0x15781f[_0xf258('0x4f')](_0xd31b3,_0x2f5575['value'],config[_0xf258('0x50')]['recording'])[_0xf258('0x25')](function(){return _0x2f5575;});}return _0x2f5575;}})[_0xf258('0x25')](function(_0x1f479b){if(!_0x1f479b){throw new db[(_0xf258('0x53'))][(_0xf258('0x54'))](_0xf258('0x74'));}_0x4e8d8e=_0x1f479b;return db[_0xf258('0x75')][_0xf258('0x76')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x38cec1,null))[_0xf258('0x25')](function(_0x256a78){if(_0x256a78){_0x5cce28=_0x256a78;if(!_0x5cce28[_0xf258('0x77')]||!_0x5cce28[_0xf258('0x78')]||!_0x5cce28[_0xf258('0x79')]||!_0x5cce28[_0xf258('0x7a')]||!_0x5cce28[_0xf258('0x7b')]){throw new db[(_0xf258('0x53'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x6ec3d5[_0xf258('0x48')][_0xf258('0x7c')]&&(!_0x5cce28['sentiment']||!_0x5cce28[_0xf258('0x7d')]||!_0x5cce28[_0xf258('0x7e')]||!_0x5cce28['language']||!_0x5cce28[_0xf258('0x7b')])){throw new db['Sequelize'][(_0xf258('0x54'))](_0xf258('0x7f'));}return db['CloudProvider'][_0xf258('0x76')]({'where':{'id':_0x5cce28['transcribeAccountId']}});}})['then'](function(_0x2f289a){if(!_0x2f289a){throw new db[(_0xf258('0x53'))]['ValidationError'](_0xf258('0x80'));}if(!_0x2f289a['data1']||!_0x2f289a[_0xf258('0x81')]){throw new db[(_0xf258('0x53'))][(_0xf258('0x54'))](_0xf258('0x82'));}_0x4f14d4=_0x2f289a;return getBucketslist(_0x4f14d4['data1'],_0x4f14d4[_0xf258('0x81')],_0x5cce28[_0xf258('0x79')]);})[_0xf258('0x25')](function(_0x4e415a){if(_0x4e415a&&_0x4e415a[_0xf258('0x83')]){var _0x4781e5=_[_0xf258('0x49')](_0x4e415a[_0xf258('0x83')],function(_0x53b43b){return _0x53b43b['Name']===_0x5cce28['bucket'];});if(!_0x4781e5){logger[_0xf258('0x62')](util[_0xf258('0x5f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x6ec3d5[_0xf258('0x45')]['id'],_0x5cce28['bucket']));return createBucket(_0x4f14d4[_0xf258('0x84')],_0x4f14d4[_0xf258('0x81')],_0x5cce28[_0xf258('0x79')],_0x5cce28[_0xf258('0x7b')]);}logger[_0xf258('0x62')](util['format'](_0xf258('0x85'),_0x6ec3d5[_0xf258('0x45')]['id'],_0x5cce28[_0xf258('0x7b')]));return;}})['then'](function(_0x57bddf){if(_0x4e8d8e[_0xf258('0x72')]===_0xf258('0x86')){return transcribe(_0x6ec3d5[_0xf258('0x45')]['id'],_0x4f14d4['data1'],_0x4f14d4[_0xf258('0x81')],_0x5cce28['transcribeRegion'],_0x5cce28[_0xf258('0x7b')],_0x4e8d8e['value'],_0x5cce28['language']);}else{logger[_0xf258('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x6ec3d5[_0xf258('0x45')]['id']));return{'transcribeStatus':_0xf258('0x87')};}})[_0xf258('0x25')](function(_0x5c2339){if(_0x5c2339){_0x5c2339['tempSentiment']=_0x6ec3d5[_0xf258('0x48')][_0xf258('0x7c')];return _0x4e8d8e[_0xf258('0x88')](_0x5c2339);}})['then'](respondWithResult(_0x38cec1,null))['catch'](handleError(_0x38cec1,null));};function writeFile(_0x2c6389,_0x4b4da8){return new Promise(function(_0x20ccbe,_0x2f16d8){fs[_0xf258('0x89')](_0x4b4da8,_0x2c6389,function(_0x39f3b6,_0x3ec0b9){if(_0x39f3b6){return _0x2f16d8(_0x39f3b6);}else{return _0x20ccbe(_0x3ec0b9);}});});}exports[_0xf258('0x8a')]=function(_0x4cd127,_0x50681a,_0x1c8151){return db['VoiceRecording'][_0xf258('0x76')]({'where':{'id':_0x4cd127[_0xf258('0x45')]['id']}})[_0xf258('0x25')](handleEntityNotFound(_0x50681a))[_0xf258('0x25')](function(_0x405eb8){if(_0x405eb8&&_0x405eb8[_0xf258('0x8b')]){var _0x1a0bfa=_0x405eb8[_0xf258('0x8b')];var _0x2e0830=config[_0xf258('0x8c')]+_0xf258('0x8d')+_0x405eb8['id']+_0xf258('0x8e');if(fs[_0xf258('0x52')](_0x2e0830)){return _0x2e0830;}return writeFile(_0x1a0bfa,_0x2e0830)[_0xf258('0x25')](function(){return _0x2e0830;});}else{throw new db[(_0xf258('0x53'))]['ValidationError']('Transcript\x20not\x20available');}})['then'](function(_0x73e856){return _0x50681a[_0xf258('0x4a')](_0x73e856);})[_0xf258('0x43')](handleError(_0x50681a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 8101694..a4e233b 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 _0x8c99=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x19d19c,_0x1f05da){var _0x849751=function(_0x11d43a){while(--_0x11d43a){_0x19d19c['push'](_0x19d19c['shift']());}};_0x849751(++_0x1f05da);}(_0x8c99,0x1a8));var _0x98c9=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x8c99[_0x2405bc];return _0x5272d4;};'use strict';var attributes=require(_0x98c9('0x0'));module[_0x98c9('0x1')]=function(_0x3edaed,_0xd3ac76){return _0x3edaed[_0x98c9('0x2')](_0x98c9('0x3'),attributes,{'tableName':_0x98c9('0x4'),'paranoid':![],'indexes':[{'name':_0x98c9('0x5'),'fields':[_0x98c9('0x5')]},{'name':_0x98c9('0x6'),'fields':[_0x98c9('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd51f=['./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','transcribeStatus'];(function(_0xf7aef6,_0x1adb5b){var _0x4ea124=function(_0x12fd1e){while(--_0x12fd1e){_0xf7aef6['push'](_0xf7aef6['shift']());}};_0x4ea124(++_0x1adb5b);}(_0xd51f,0xf0));var _0xfd51=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd51f[_0x122ef9];return _0x42fba0;};'use strict';var attributes=require(_0xfd51('0x0'));module[_0xfd51('0x1')]=function(_0x487db5,_0x270095){return _0x487db5[_0xfd51('0x2')]('VoiceRecording',attributes,{'tableName':_0xfd51('0x3'),'paranoid':![],'indexes':[{'name':_0xfd51('0x4'),'fields':['uniqueid']},{'name':_0xfd51('0x5'),'fields':[_0xfd51('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 16cd707..985408b 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 _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x250a3d,_0x1ab9b9){var _0x583740=function(_0x3ada43){while(--_0x3ada43){_0x250a3d['push'](_0x250a3d['shift']());}};_0x583740(++_0x1ab9b9);}(_0x1623,0xab));var _0x3162=function(_0x501fe4,_0x3c68b4){_0x501fe4=_0x501fe4-0x0;var _0xd72436=_0x1623[_0x501fe4];return _0xd72436;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')](_0x1eed46[_0x3162('0x19')],{'raw':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1b')]||null:null,'attributes':_0x1eed46[_0x3162('0x1a')]?_0x1eed46['options']['attributes']||null:null,'limit':_0x1eed46[_0x3162('0x1a')]?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1c')]||null:null})[_0x3162('0xa')](function(_0x31b27b){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger[_0x3162('0xc')]('UpdateVoiceRecording',_0x1eed46,JSON[_0x3162('0xf')](_0x31b27b));_0x4b2bf3(_0x31b27b);})[_0x3162('0x15')](function(_0x3919e7){logger[_0x3162('0x10')](_0x3162('0x16'),_0x3919e7[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97[_0x3162('0x10')](0x1f4,_0x3919e7[_0x3162('0x13')]));});});};exports[_0x3162('0x1d')]=function(_0x356c5d){var _0x8fa09f=this;return new Promise(function(_0x2f62d7,_0x1c03a4){var _0x48de45=require(_0x3162('0x1e'));var _0x552469;return db[_0x3162('0x1f')][_0x3162('0x20')]({'attributes':['id',_0x3162('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x4903e7){_0x552469=_0x4903e7;return db[_0x3162('0x17')][_0x3162('0x22')](_0x356c5d[_0x3162('0x19')]);})[_0x3162('0xa')](function(_0x2f88ec){if(_0x552469['callRecordingEncryption']&&fs[_0x3162('0x23')](_0x2f88ec['value'])){var _0xf11765=util[_0x3162('0x24')](_0x3162('0x25'),_0x2f88ec[_0x3162('0x26')]);return _0x48de45[_0x3162('0x27')](_0x2f88ec[_0x3162('0x26')],_0xf11765,config[_0x3162('0x28')][_0x3162('0x29')])['then'](function(){fs[_0x3162('0x2a')](_0x2f88ec[_0x3162('0x26')]);logger['info'](_0x3162('0x2b'));return _0x2f88ec;});}return _0x2f88ec;})[_0x3162('0xa')](function(_0x528340){logger['info'](_0x3162('0x1d'),_0x356c5d);logger['debug'](_0x3162('0x1d'),_0x356c5d,JSON[_0x3162('0xf')](_0x528340));_0x2f62d7(_0x528340);})[_0x3162('0x15')](function(_0x551442){logger['error'](_0x3162('0x1d'),_0x551442[_0x3162('0x13')],_0x356c5d);_0x1c03a4(_0x8fa09f['error'](0x1f4,_0x551442[_0x3162('0x13')]));});});}; \ No newline at end of file +var _0x57ca=['update','body','options','where','limit','then','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording'];(function(_0x4c366e,_0x41cfdf){var _0x1089f9=function(_0x2e3ba5){while(--_0x2e3ba5){_0x4c366e['push'](_0x4c366e['shift']());}};_0x1089f9(++_0x41cfdf);}(_0x57ca,0x108));var _0xa57c=function(_0x3b45a2,_0x1e63e6){_0x3b45a2=_0x3b45a2-0x0;var _0x4efc4d=_0x57ca[_0x3b45a2];return _0x4efc4d;};'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')]('VoiceRecording,\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')]('VoiceRecording,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}exports[_0xa57c('0x15')]=function(_0x3d781d){var _0x93462c=this;return new Promise(function(_0xe3d505,_0x1fd0d8){return db[_0xa57c('0x16')][_0xa57c('0x17')](_0x3d781d[_0xa57c('0x18')],{'raw':_0x3d781d['options']?_0x3d781d[_0xa57c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d781d['options']?_0x3d781d[_0xa57c('0x19')][_0xa57c('0x1a')]||null:null,'attributes':_0x3d781d[_0xa57c('0x19')]?_0x3d781d[_0xa57c('0x19')]['attributes']||null:null,'limit':_0x3d781d[_0xa57c('0x19')]?_0x3d781d[_0xa57c('0x19')][_0xa57c('0x1b')]||null:null})[_0xa57c('0x1c')](function(_0x3bb969){logger[_0xa57c('0xc')](_0xa57c('0x15'),_0x3d781d);logger[_0xa57c('0x1d')](_0xa57c('0x15'),_0x3d781d,JSON[_0xa57c('0x1e')](_0x3bb969));_0xe3d505(_0x3bb969);})[_0xa57c('0x14')](function(_0x1e7f7a){logger[_0xa57c('0xf')](_0xa57c('0x15'),_0x1e7f7a[_0xa57c('0x12')],_0x3d781d);_0x1fd0d8(_0x93462c['error'](0x1f4,_0x1e7f7a[_0xa57c('0x12')]));});});};exports[_0xa57c('0x1f')]=function(_0x27884d){var _0x5228b9=this;return new Promise(function(_0x315ad7,_0x1e8e45){var _0x8ee1c0=require(_0xa57c('0x20'));var _0x337f97;return db[_0xa57c('0x21')]['findOne']({'attributes':['id',_0xa57c('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x54a18b){_0x337f97=_0x54a18b;return db[_0xa57c('0x16')][_0xa57c('0x23')](_0x27884d['body']);})[_0xa57c('0x1c')](function(_0x1ef331){if(_0x337f97[_0xa57c('0x22')]&&fs['existsSync'](_0x1ef331[_0xa57c('0x24')])){var _0x58d46f=util[_0xa57c('0x25')]('%s.cypher',_0x1ef331[_0xa57c('0x24')]);return _0x8ee1c0['encryptFile'](_0x1ef331[_0xa57c('0x24')],_0x58d46f,config['secrets'][_0xa57c('0x26')])[_0xa57c('0x1c')](function(){fs[_0xa57c('0x27')](_0x1ef331[_0xa57c('0x24')]);logger[_0xa57c('0xc')](_0xa57c('0x28'));return _0x1ef331;});}return _0x1ef331;})[_0xa57c('0x1c')](function(_0x5aa91e){logger[_0xa57c('0xc')]('CreateVoiceRecording',_0x27884d);logger[_0xa57c('0x1d')](_0xa57c('0x1f'),_0x27884d,JSON[_0xa57c('0x1e')](_0x5aa91e));_0x315ad7(_0x5aa91e);})['catch'](function(_0x289174){logger['error'](_0xa57c('0x1f'),_0x289174['message'],_0x27884d);_0x1e8e45(_0x5228b9[_0xa57c('0xf')](0x1f4,_0x289174['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index ab9c6f4..a49e390 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 _0xe163=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0xe163,0xbb));var _0x3e16=function(_0x288b73,_0x2d3661){_0x288b73=_0x288b73-0x0;var _0x5d94a9=_0xe163[_0x288b73];return _0x5d94a9;};'use strict';var multer=require('multer');var util=require(_0x3e16('0x0'));var path=require(_0x3e16('0x1'));var timeout=require(_0x3e16('0x2'));var express=require(_0x3e16('0x3'));var router=express[_0x3e16('0x4')]();var fs_extra=require(_0x3e16('0x5'));var auth=require(_0x3e16('0x6'));var interaction=require(_0x3e16('0x7'));var config=require(_0x3e16('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x3e16('0x9')]('/',auth[_0x3e16('0xa')](),controller[_0x3e16('0xb')]);router[_0x3e16('0x9')](_0x3e16('0xc'),auth['isAuthenticated'](),controller[_0x3e16('0xd')]);router[_0x3e16('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3e16('0xe')]);router['post']('/',auth[_0x3e16('0xa')](),controller['create']);router[_0x3e16('0xf')](_0x3e16('0x10'),auth[_0x3e16('0xa')](),controller[_0x3e16('0x11')]);router[_0x3e16('0x12')](_0x3e16('0x10'),auth[_0x3e16('0xa')](),controller[_0x3e16('0x13')]);module[_0x3e16('0x14')]=router; \ No newline at end of file +var _0xa61e=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2517a2,_0x40e665){var _0x4a3719=function(_0xac9e22){while(--_0xac9e22){_0x2517a2['push'](_0x2517a2['shift']());}};_0x4a3719(++_0x40e665);}(_0xa61e,0x1c7));var _0xea61=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa61e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xea61('0x0'));var util=require(_0xea61('0x1'));var path=require(_0xea61('0x2'));var timeout=require(_0xea61('0x3'));var express=require(_0xea61('0x4'));var router=express[_0xea61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xea61('0x6'));var interaction=require(_0xea61('0x7'));var config=require(_0xea61('0x8'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xea61('0x9')]);router[_0xea61('0xa')](_0xea61('0xb'),auth[_0xea61('0xc')](),controller[_0xea61('0xd')]);router['get'](_0xea61('0xe'),auth[_0xea61('0xc')](),controller[_0xea61('0xf')]);router[_0xea61('0x10')]('/',auth[_0xea61('0xc')](),controller[_0xea61('0x11')]);router[_0xea61('0x12')](_0xea61('0xe'),auth[_0xea61('0xc')](),controller['update']);router[_0xea61('0x13')]('/:id',auth[_0xea61('0xc')](),controller[_0xea61('0x14')]);module[_0xea61('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 31b0350..a221c41 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 _0xdafc=['Yes','sequelize','moment','exports','STRING'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xdafc,0x1b4));var _0xcdaf=function(_0x2a93ba,_0x47b97e){_0x2a93ba=_0x2a93ba-0x0;var _0x4b1f3d=_0xdafc[_0x2a93ba];return _0x4b1f3d;};'use strict';var Sequelize=require(_0xcdaf('0x0'));var moment=require(_0xcdaf('0x1'));module[_0xcdaf('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize[_0xcdaf('0x3')]},'transfererchannel':{'type':Sequelize[_0xcdaf('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xcdaf('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xcdaf('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xcdaf('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xcdaf('0x3')]},'transfereechannel':{'type':Sequelize[_0xcdaf('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xcdaf('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xcdaf('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xcdaf('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xcdaf('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xcdaf('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xcdaf('0x4'),'No')},'context':{'type':Sequelize[_0xcdaf('0x3')]},'extension':{'type':Sequelize[_0xcdaf('0x3')]}}; \ No newline at end of file +var _0x0c19=['blind','STRING','Yes','exports','ENUM'];(function(_0x22a69a,_0x574dcc){var _0xbae8e6=function(_0x461086){while(--_0x461086){_0x22a69a['push'](_0x22a69a['shift']());}};_0xbae8e6(++_0x574dcc);}(_0x0c19,0xda));var _0x90c1=function(_0x2d1ce0,_0x268590){_0x2d1ce0=_0x2d1ce0-0x0;var _0x278281=_0x0c19[_0x2d1ce0];return _0x278281;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x90c1('0x0')]={'type':{'type':Sequelize[_0x90c1('0x1')](_0x90c1('0x2'),'attended')},'result':{'type':Sequelize[_0x90c1('0x3')]},'transfererchannel':{'type':Sequelize[_0x90c1('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x90c1('0x3')]},'transferercalleridname':{'type':Sequelize[_0x90c1('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x90c1('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x90c1('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x90c1('0x3')]},'transferercontext':{'type':Sequelize[_0x90c1('0x3')]},'transfererexten':{'type':Sequelize[_0x90c1('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x90c1('0x3')]},'transfereechannel':{'type':Sequelize[_0x90c1('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x90c1('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x90c1('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x90c1('0x3')]},'transfereeexten':{'type':Sequelize[_0x90c1('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x90c1('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x90c1('0x4'),'No')},'context':{'type':Sequelize[_0x90c1('0x3')]},'extension':{'type':Sequelize[_0x90c1('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 5cfb896..df356d2 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 _0x2e10=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceTransferReport','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x2e10,0xf5));var _0x02e1=function(_0x364d46,_0x28b842){_0x364d46=_0x364d46-0x0;var _0x37e333=_0x2e10[_0x364d46];return _0x37e333;};'use strict';var emlformat=require(_0x02e1('0x0'));var rimraf=require(_0x02e1('0x1'));var zipdir=require(_0x02e1('0x2'));var jsonpatch=require(_0x02e1('0x3'));var rp=require(_0x02e1('0x4'));var moment=require(_0x02e1('0x5'));var BPromise=require(_0x02e1('0x6'));var Mustache=require(_0x02e1('0x7'));var util=require('util');var path=require(_0x02e1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x02e1('0x9'));var fs=require('fs');var fs_extra=require(_0x02e1('0xa'));var _=require(_0x02e1('0xb'));var squel=require(_0x02e1('0xc'));var crypto=require(_0x02e1('0xd'));var jsforce=require(_0x02e1('0xe'));var deskjs=require(_0x02e1('0xf'));var toCsv=require(_0x02e1('0x10'));var querystring=require(_0x02e1('0x11'));var Papa=require(_0x02e1('0x12'));var Redis=require('ioredis');var authService=require(_0x02e1('0x13'));var qs=require(_0x02e1('0x14'));var as=require(_0x02e1('0x15'));var hardwareService=require(_0x02e1('0x16'));var logger=require(_0x02e1('0x17'))(_0x02e1('0x18'));var utils=require(_0x02e1('0x19'));var config=require(_0x02e1('0x1a'));var licenseUtil=require(_0x02e1('0x1b'));var db=require(_0x02e1('0x1c'))['db'];function respondWithStatusCode(_0x21772e,_0x5b3a1a){_0x5b3a1a=_0x5b3a1a||0xcc;return function(_0x2c440c){if(_0x2c440c){return _0x21772e[_0x02e1('0x1d')](_0x5b3a1a);}return _0x21772e['status'](_0x5b3a1a)[_0x02e1('0x1e')]();};}function respondWithResult(_0x2ae3c0,_0x59c241){_0x59c241=_0x59c241||0xc8;return function(_0x32a79f){if(_0x32a79f){return _0x2ae3c0[_0x02e1('0x1f')](_0x59c241)[_0x02e1('0x20')](_0x32a79f);}};}function respondWithFilteredResult(_0x29d955,_0x366723){return function(_0x25543e){if(_0x25543e){var _0x58dd17=typeof _0x366723[_0x02e1('0x21')]==='undefined'&&typeof _0x366723['limit']===_0x02e1('0x22');var _0x2e30bb=_0x25543e[_0x02e1('0x23')];var _0x132071=_0x58dd17?0x0:_0x366723[_0x02e1('0x21')];var _0x35039e=_0x58dd17?_0x25543e[_0x02e1('0x23')]:_0x366723[_0x02e1('0x21')]+_0x366723[_0x02e1('0x24')];var _0x26ff93;if(_0x35039e>=_0x2e30bb){_0x35039e=_0x2e30bb;_0x26ff93=0xc8;}else{_0x26ff93=0xce;}_0x29d955[_0x02e1('0x1f')](_0x26ff93);return _0x29d955[_0x02e1('0x25')](_0x02e1('0x26'),_0x132071+'-'+_0x35039e+'/'+_0x2e30bb)['json'](_0x25543e);}return null;};}function patchUpdates(_0x2e019c){return function(_0x234437){try{jsonpatch[_0x02e1('0x27')](_0x234437,_0x2e019c,!![]);}catch(_0x10413e){return BPromise['reject'](_0x10413e);}return _0x234437['save']();};}function saveUpdates(_0x1d25ab,_0x2783dd){return function(_0x3d969f){if(_0x3d969f){return _0x3d969f[_0x02e1('0x28')](_0x1d25ab)[_0x02e1('0x29')](function(_0x5cebb5){return _0x5cebb5;});}return null;};}function removeEntity(_0x5a6443,_0x31c7a4){return function(_0x2f748a){if(_0x2f748a){return _0x2f748a[_0x02e1('0x2a')]()['then'](function(){_0x5a6443[_0x02e1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8d7bc0,_0x284c74){return function(_0x12d1cc){if(!_0x12d1cc){_0x8d7bc0['sendStatus'](0x194);}return _0x12d1cc;};}function handleError(_0x59d1ef,_0x2fd0aa){_0x2fd0aa=_0x2fd0aa||0x1f4;return function(_0x23a486){logger[_0x02e1('0x2b')](_0x23a486[_0x02e1('0x2c')]);if(_0x23a486[_0x02e1('0x2d')]){delete _0x23a486[_0x02e1('0x2d')];}_0x59d1ef[_0x02e1('0x1f')](_0x2fd0aa)[_0x02e1('0x2e')](_0x23a486);};}exports[_0x02e1('0x2f')]=function(_0x4e98f6,_0x3368e1){var _0x1ccba7={},_0x4c112e={},_0x3d325e={'count':0x0,'rows':[]};var _0x15f30f=_[_0x02e1('0x30')](db['VoiceTransferReport']['rawAttributes'],function(_0x22b467){return{'name':_0x22b467[_0x02e1('0x31')],'type':_0x22b467[_0x02e1('0x32')][_0x02e1('0x33')]};});_0x4c112e[_0x02e1('0x34')]=_[_0x02e1('0x30')](_0x15f30f,_0x02e1('0x2d'));_0x4c112e[_0x02e1('0x35')]=_[_0x02e1('0x36')](_0x4e98f6[_0x02e1('0x35')]);_0x4c112e[_0x02e1('0x37')]=_[_0x02e1('0x38')](_0x4c112e[_0x02e1('0x34')],_0x4c112e[_0x02e1('0x35')]);_0x1ccba7['attributes']=_[_0x02e1('0x38')](_0x4c112e[_0x02e1('0x34')],qs[_0x02e1('0x39')](_0x4e98f6[_0x02e1('0x35')]['fields']));_0x1ccba7[_0x02e1('0x3a')]=_0x1ccba7[_0x02e1('0x3a')]['length']?_0x1ccba7[_0x02e1('0x3a')]:_0x4c112e[_0x02e1('0x34')];if(!_0x4e98f6[_0x02e1('0x35')][_0x02e1('0x3b')](_0x02e1('0x3c'))){_0x1ccba7[_0x02e1('0x24')]=qs[_0x02e1('0x24')](_0x4e98f6['query']['limit']);_0x1ccba7[_0x02e1('0x21')]=qs[_0x02e1('0x21')](_0x4e98f6[_0x02e1('0x35')][_0x02e1('0x21')]);}_0x1ccba7[_0x02e1('0x3d')]=qs[_0x02e1('0x3e')](_0x4e98f6[_0x02e1('0x35')][_0x02e1('0x3e')]);_0x1ccba7[_0x02e1('0x3f')]=qs[_0x02e1('0x37')](_[_0x02e1('0x40')](_0x4e98f6[_0x02e1('0x35')],_0x4c112e[_0x02e1('0x37')]),_0x15f30f);if(_0x4e98f6[_0x02e1('0x35')][_0x02e1('0x41')]){_0x1ccba7[_0x02e1('0x3f')]=_[_0x02e1('0x42')](_0x1ccba7['where'],{'$or':_[_0x02e1('0x30')](_0x15f30f,function(_0x5477cc){if(_0x5477cc[_0x02e1('0x32')]!==_0x02e1('0x43')){var _0x2a719f={};_0x2a719f[_0x5477cc[_0x02e1('0x2d')]]={'$like':'%'+_0x4e98f6['query'][_0x02e1('0x41')]+'%'};return _0x2a719f;}})});}_0x1ccba7=_[_0x02e1('0x42')]({},_0x1ccba7,_0x4e98f6['options']);var _0x10bc5f={'where':_0x1ccba7['where']};return db[_0x02e1('0x44')][_0x02e1('0x23')](_0x10bc5f)[_0x02e1('0x29')](function(_0x40e963){_0x3d325e[_0x02e1('0x23')]=_0x40e963;if(_0x4e98f6[_0x02e1('0x35')][_0x02e1('0x45')]){_0x1ccba7[_0x02e1('0x46')]=[{'all':!![]}];}return db[_0x02e1('0x44')][_0x02e1('0x47')](_0x1ccba7);})[_0x02e1('0x29')](function(_0x291057){_0x3d325e[_0x02e1('0x48')]=_0x291057;return _0x3d325e;})[_0x02e1('0x29')](respondWithFilteredResult(_0x3368e1,_0x1ccba7))[_0x02e1('0x49')](handleError(_0x3368e1,null));};exports[_0x02e1('0x4a')]=function(_0x450219,_0x154029){var _0x5c3c86={'raw':!![],'where':{'id':_0x450219[_0x02e1('0x4b')]['id']}},_0x468d1b={};_0x468d1b['model']=_[_0x02e1('0x36')](db[_0x02e1('0x44')]['rawAttributes']);_0x468d1b[_0x02e1('0x35')]=_['keys'](_0x450219[_0x02e1('0x35')]);_0x468d1b[_0x02e1('0x37')]=_[_0x02e1('0x38')](_0x468d1b['model'],_0x468d1b[_0x02e1('0x35')]);_0x5c3c86[_0x02e1('0x3a')]=_['intersection'](_0x468d1b[_0x02e1('0x34')],qs[_0x02e1('0x39')](_0x450219[_0x02e1('0x35')][_0x02e1('0x39')]));_0x5c3c86['attributes']=_0x5c3c86[_0x02e1('0x3a')][_0x02e1('0x4c')]?_0x5c3c86[_0x02e1('0x3a')]:_0x468d1b[_0x02e1('0x34')];if(_0x450219[_0x02e1('0x35')][_0x02e1('0x45')]){_0x5c3c86[_0x02e1('0x46')]=[{'all':!![]}];}_0x5c3c86=_[_0x02e1('0x42')]({},_0x5c3c86,_0x450219[_0x02e1('0x4d')]);return db[_0x02e1('0x44')][_0x02e1('0x4e')](_0x5c3c86)[_0x02e1('0x29')](handleEntityNotFound(_0x154029,null))[_0x02e1('0x29')](respondWithResult(_0x154029,null))[_0x02e1('0x49')](handleError(_0x154029,null));};exports[_0x02e1('0x4f')]=function(_0x3d70e4,_0x107a17){return db[_0x02e1('0x44')][_0x02e1('0x4f')](_0x3d70e4[_0x02e1('0x50')],{})[_0x02e1('0x29')](respondWithResult(_0x107a17,0xc9))[_0x02e1('0x49')](handleError(_0x107a17,null));};exports['update']=function(_0x4edf0e,_0x27d2c8){if(_0x4edf0e[_0x02e1('0x50')]['id']){delete _0x4edf0e['body']['id'];}return db['VoiceTransferReport'][_0x02e1('0x4e')]({'where':{'id':_0x4edf0e[_0x02e1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27d2c8,null))[_0x02e1('0x29')](saveUpdates(_0x4edf0e['body'],null))[_0x02e1('0x29')](respondWithResult(_0x27d2c8,null))[_0x02e1('0x49')](handleError(_0x27d2c8,null));};exports[_0x02e1('0x2a')]=function(_0x30619d,_0x4117cc){return db[_0x02e1('0x44')][_0x02e1('0x4e')]({'where':{'id':_0x30619d[_0x02e1('0x4b')]['id']}})[_0x02e1('0x29')](handleEntityNotFound(_0x4117cc,null))[_0x02e1('0x29')](removeEntity(_0x4117cc,null))[_0x02e1('0x49')](handleError(_0x4117cc,null));};exports['describe']=function(_0x561f3c,_0x1dc9dc){return db['VoiceTransferReport'][_0x02e1('0x51')]()[_0x02e1('0x29')](respondWithResult(_0x1dc9dc,null))[_0x02e1('0x49')](handleError(_0x1dc9dc,null));}; \ No newline at end of file +var _0x38bc=['then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','VoiceTransferReport','findAll','catch','show','fields','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update'];(function(_0x33cf30,_0x1d61c8){var _0x4ea338=function(_0x1f44b2){while(--_0x1f44b2){_0x33cf30['push'](_0x33cf30['shift']());}};_0x4ea338(++_0x1d61c8);}(_0x38bc,0x70));var _0xc38b=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x38bc[_0x5cb1af];return _0x8d7940;};'use strict';var emlformat=require(_0xc38b('0x0'));var rimraf=require(_0xc38b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc38b('0x2'));var rp=require(_0xc38b('0x3'));var moment=require(_0xc38b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc38b('0x5'));var path=require(_0xc38b('0x6'));var sox=require(_0xc38b('0x7'));var csv=require(_0xc38b('0x8'));var ejs=require(_0xc38b('0x9'));var fs=require('fs');var fs_extra=require(_0xc38b('0xa'));var _=require('lodash');var squel=require(_0xc38b('0xb'));var crypto=require(_0xc38b('0xc'));var jsforce=require(_0xc38b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc38b('0xe'));var Papa=require('papaparse');var Redis=require(_0xc38b('0xf'));var authService=require(_0xc38b('0x10'));var qs=require(_0xc38b('0x11'));var as=require(_0xc38b('0x12'));var hardwareService=require(_0xc38b('0x13'));var logger=require(_0xc38b('0x14'))(_0xc38b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc38b('0x16'));var db=require(_0xc38b('0x17'))['db'];function respondWithStatusCode(_0x165eaf,_0x2e022f){_0x2e022f=_0x2e022f||0xcc;return function(_0x299c91){if(_0x299c91){return _0x165eaf['sendStatus'](_0x2e022f);}return _0x165eaf[_0xc38b('0x18')](_0x2e022f)['end']();};}function respondWithResult(_0x515115,_0xcd8418){_0xcd8418=_0xcd8418||0xc8;return function(_0x10644f){if(_0x10644f){return _0x515115['status'](_0xcd8418)[_0xc38b('0x19')](_0x10644f);}};}function respondWithFilteredResult(_0x24a3cd,_0x11085a){return function(_0x115daf){if(_0x115daf){var _0x5f23a4=typeof _0x11085a[_0xc38b('0x1a')]===_0xc38b('0x1b')&&typeof _0x11085a[_0xc38b('0x1c')]===_0xc38b('0x1b');var _0x2f3647=_0x115daf[_0xc38b('0x1d')];var _0x48717b=_0x5f23a4?0x0:_0x11085a[_0xc38b('0x1a')];var _0x4247b7=_0x5f23a4?_0x115daf[_0xc38b('0x1d')]:_0x11085a[_0xc38b('0x1a')]+_0x11085a['limit'];var _0x123af1;if(_0x4247b7>=_0x2f3647){_0x4247b7=_0x2f3647;_0x123af1=0xc8;}else{_0x123af1=0xce;}_0x24a3cd[_0xc38b('0x18')](_0x123af1);return _0x24a3cd['set'](_0xc38b('0x1e'),_0x48717b+'-'+_0x4247b7+'/'+_0x2f3647)[_0xc38b('0x19')](_0x115daf);}return null;};}function patchUpdates(_0x34a002){return function(_0x8f1129){try{jsonpatch['apply'](_0x8f1129,_0x34a002,!![]);}catch(_0x23a723){return BPromise[_0xc38b('0x1f')](_0x23a723);}return _0x8f1129[_0xc38b('0x20')]();};}function saveUpdates(_0x56c145,_0x15f5b6){return function(_0x132ef8){if(_0x132ef8){return _0x132ef8[_0xc38b('0x21')](_0x56c145)[_0xc38b('0x22')](function(_0x4eff88){return _0x4eff88;});}return null;};}function removeEntity(_0x178644,_0x398d66){return function(_0x23a345){if(_0x23a345){return _0x23a345['destroy']()['then'](function(){_0x178644[_0xc38b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c28d4,_0x1b681d){return function(_0x5d6147){if(!_0x5d6147){_0x2c28d4[_0xc38b('0x23')](0x194);}return _0x5d6147;};}function handleError(_0x5b95bb,_0xe3ebc6){_0xe3ebc6=_0xe3ebc6||0x1f4;return function(_0x3e360b){logger[_0xc38b('0x24')](_0x3e360b[_0xc38b('0x25')]);if(_0x3e360b[_0xc38b('0x26')]){delete _0x3e360b[_0xc38b('0x26')];}_0x5b95bb[_0xc38b('0x18')](_0xe3ebc6)[_0xc38b('0x27')](_0x3e360b);};}exports[_0xc38b('0x28')]=function(_0x5b7759,_0x3f68cf){var _0x4720a7={},_0x4328c1={},_0x2e63f6={'count':0x0,'rows':[]};var _0x3c4584=_[_0xc38b('0x29')](db['VoiceTransferReport'][_0xc38b('0x2a')],function(_0x362d9b){return{'name':_0x362d9b['fieldName'],'type':_0x362d9b[_0xc38b('0x2b')][_0xc38b('0x2c')]};});_0x4328c1[_0xc38b('0x2d')]=_[_0xc38b('0x29')](_0x3c4584,_0xc38b('0x26'));_0x4328c1['query']=_['keys'](_0x5b7759['query']);_0x4328c1['filters']=_[_0xc38b('0x2e')](_0x4328c1[_0xc38b('0x2d')],_0x4328c1[_0xc38b('0x2f')]);_0x4720a7[_0xc38b('0x30')]=_[_0xc38b('0x2e')](_0x4328c1[_0xc38b('0x2d')],qs['fields'](_0x5b7759[_0xc38b('0x2f')]['fields']));_0x4720a7[_0xc38b('0x30')]=_0x4720a7[_0xc38b('0x30')][_0xc38b('0x31')]?_0x4720a7[_0xc38b('0x30')]:_0x4328c1['model'];if(!_0x5b7759['query'][_0xc38b('0x32')](_0xc38b('0x33'))){_0x4720a7['limit']=qs[_0xc38b('0x1c')](_0x5b7759[_0xc38b('0x2f')][_0xc38b('0x1c')]);_0x4720a7[_0xc38b('0x1a')]=qs[_0xc38b('0x1a')](_0x5b7759[_0xc38b('0x2f')][_0xc38b('0x1a')]);}_0x4720a7[_0xc38b('0x34')]=qs[_0xc38b('0x35')](_0x5b7759[_0xc38b('0x2f')][_0xc38b('0x35')]);_0x4720a7[_0xc38b('0x36')]=qs['filters'](_[_0xc38b('0x37')](_0x5b7759[_0xc38b('0x2f')],_0x4328c1[_0xc38b('0x38')]),_0x3c4584);if(_0x5b7759[_0xc38b('0x2f')][_0xc38b('0x39')]){_0x4720a7['where']=_['merge'](_0x4720a7['where'],{'$or':_[_0xc38b('0x29')](_0x3c4584,function(_0x45beea){if(_0x45beea[_0xc38b('0x2b')]!==_0xc38b('0x3a')){var _0x156f28={};_0x156f28[_0x45beea[_0xc38b('0x26')]]={'$like':'%'+_0x5b7759[_0xc38b('0x2f')][_0xc38b('0x39')]+'%'};return _0x156f28;}})});}_0x4720a7=_[_0xc38b('0x3b')]({},_0x4720a7,_0x5b7759[_0xc38b('0x3c')]);var _0x3b4987={'where':_0x4720a7['where']};return db['VoiceTransferReport'][_0xc38b('0x1d')](_0x3b4987)['then'](function(_0x17d152){_0x2e63f6[_0xc38b('0x1d')]=_0x17d152;if(_0x5b7759['query'][_0xc38b('0x3d')]){_0x4720a7['include']=[{'all':!![]}];}return db[_0xc38b('0x3e')][_0xc38b('0x3f')](_0x4720a7);})[_0xc38b('0x22')](function(_0x2225cc){_0x2e63f6['rows']=_0x2225cc;return _0x2e63f6;})[_0xc38b('0x22')](respondWithFilteredResult(_0x3f68cf,_0x4720a7))[_0xc38b('0x40')](handleError(_0x3f68cf,null));};exports[_0xc38b('0x41')]=function(_0x49caaf,_0x4394e7){var _0x2e3d85={'raw':!![],'where':{'id':_0x49caaf['params']['id']}},_0x57eee1={};_0x57eee1['model']=_['keys'](db[_0xc38b('0x3e')][_0xc38b('0x2a')]);_0x57eee1['query']=_['keys'](_0x49caaf['query']);_0x57eee1[_0xc38b('0x38')]=_[_0xc38b('0x2e')](_0x57eee1[_0xc38b('0x2d')],_0x57eee1['query']);_0x2e3d85['attributes']=_[_0xc38b('0x2e')](_0x57eee1['model'],qs['fields'](_0x49caaf['query'][_0xc38b('0x42')]));_0x2e3d85[_0xc38b('0x30')]=_0x2e3d85[_0xc38b('0x30')]['length']?_0x2e3d85[_0xc38b('0x30')]:_0x57eee1[_0xc38b('0x2d')];if(_0x49caaf[_0xc38b('0x2f')][_0xc38b('0x3d')]){_0x2e3d85['include']=[{'all':!![]}];}_0x2e3d85=_[_0xc38b('0x3b')]({},_0x2e3d85,_0x49caaf[_0xc38b('0x3c')]);return db['VoiceTransferReport'][_0xc38b('0x43')](_0x2e3d85)['then'](handleEntityNotFound(_0x4394e7,null))[_0xc38b('0x22')](respondWithResult(_0x4394e7,null))[_0xc38b('0x40')](handleError(_0x4394e7,null));};exports[_0xc38b('0x44')]=function(_0x3f836a,_0x42b0a3){return db[_0xc38b('0x3e')][_0xc38b('0x44')](_0x3f836a[_0xc38b('0x45')],{})[_0xc38b('0x22')](respondWithResult(_0x42b0a3,0xc9))['catch'](handleError(_0x42b0a3,null));};exports[_0xc38b('0x21')]=function(_0x5be59c,_0x5035f4){if(_0x5be59c['body']['id']){delete _0x5be59c[_0xc38b('0x45')]['id'];}return db[_0xc38b('0x3e')][_0xc38b('0x43')]({'where':{'id':_0x5be59c[_0xc38b('0x46')]['id']}})['then'](handleEntityNotFound(_0x5035f4,null))['then'](saveUpdates(_0x5be59c[_0xc38b('0x45')],null))[_0xc38b('0x22')](respondWithResult(_0x5035f4,null))[_0xc38b('0x40')](handleError(_0x5035f4,null));};exports[_0xc38b('0x47')]=function(_0x4e871a,_0x21b08b){return db[_0xc38b('0x3e')]['find']({'where':{'id':_0x4e871a[_0xc38b('0x46')]['id']}})[_0xc38b('0x22')](handleEntityNotFound(_0x21b08b,null))[_0xc38b('0x22')](removeEntity(_0x21b08b,null))[_0xc38b('0x40')](handleError(_0x21b08b,null));};exports[_0xc38b('0x48')]=function(_0x491990,_0x31e746){return db[_0xc38b('0x3e')]['describe']()[_0xc38b('0x22')](respondWithResult(_0x31e746,null))['catch'](handleError(_0x31e746,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 23af014..769ed34 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 _0xbafb=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24d672,_0x3cd107){var _0xe2c7aa=function(_0x249851){while(--_0x249851){_0x24d672['push'](_0x24d672['shift']());}};_0xe2c7aa(++_0x3cd107);}(_0xbafb,0x1de));var _0xbbaf=function(_0xe60eaa,_0x37bdd7){_0xe60eaa=_0xe60eaa-0x0;var _0xb75f1f=_0xbafb[_0xe60eaa];return _0xb75f1f;};'use strict';var _=require(_0xbbaf('0x0'));var util=require('util');var logger=require(_0xbbaf('0x1'))(_0xbbaf('0x2'));var moment=require(_0xbbaf('0x3'));var BPromise=require(_0xbbaf('0x4'));var rp=require(_0xbbaf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbaf('0x6'));var config=require(_0xbbaf('0x7'));var attributes=require(_0xbbaf('0x8'));module[_0xbbaf('0x9')]=function(_0x18801c,_0x27e2b7){return _0x18801c[_0xbbaf('0xa')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec89=['bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','util','../../config/logger','api'];(function(_0x2bc40f,_0x12cdfa){var _0x446741=function(_0x40facb){while(--_0x40facb){_0x2bc40f['push'](_0x2bc40f['shift']());}};_0x446741(++_0x12cdfa);}(_0xec89,0x1b5));var _0x9ec8=function(_0x5689cc,_0xa649a8){_0x5689cc=_0x5689cc-0x0;var _0x589beb=_0xec89[_0x5689cc];return _0x589beb;};'use strict';var _=require('lodash');var util=require(_0x9ec8('0x0'));var logger=require(_0x9ec8('0x1'))(_0x9ec8('0x2'));var moment=require('moment');var BPromise=require(_0x9ec8('0x3'));var rp=require(_0x9ec8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ec8('0x5'));var config=require(_0x9ec8('0x6'));var attributes=require(_0x9ec8('0x7'));module[_0x9ec8('0x8')]=function(_0x1036b9,_0x15fa41){return _0x1036b9['define'](_0x9ec8('0x9'),attributes,{'tableName':_0x9ec8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 96c2d44..1dcd44a 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 _0x3c5d=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceTransferReport','create','options','raw','util','moment','bluebird'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x3c5d,0x69));var _0xd3c5=function(_0x4a58fc,_0x82163c){_0x4a58fc=_0x4a58fc-0x0;var _0x44f439=_0x3c5d[_0x4a58fc];return _0x44f439;};'use strict';var _=require('lodash');var util=require(_0xd3c5('0x0'));var moment=require(_0xd3c5('0x1'));var BPromise=require(_0xd3c5('0x2'));var rs=require(_0xd3c5('0x3'));var fs=require('fs');var Redis=require(_0xd3c5('0x4'));var db=require(_0xd3c5('0x5'))['db'];var utils=require(_0xd3c5('0x6'));var logger=require('../../config/logger')(_0xd3c5('0x7'));var config=require('../../config/environment');var jayson=require(_0xd3c5('0x8'));var client=jayson[_0xd3c5('0x9')][_0xd3c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b9ab3,_0x25b3f6,_0x4ce531){return new BPromise(function(_0x45b087,_0x5641a9){return client[_0xd3c5('0xb')](_0x5b9ab3,_0x4ce531)[_0xd3c5('0xc')](function(_0x555907){logger['info'](_0xd3c5('0xd'),_0x25b3f6,_0xd3c5('0xe'));logger[_0xd3c5('0xf')](_0xd3c5('0x10'),_0x25b3f6,'request\x20sent',JSON[_0xd3c5('0x11')](_0x555907));if(_0x555907[_0xd3c5('0x12')]){if(_0x555907[_0xd3c5('0x12')]['code']===0x1f4){logger[_0xd3c5('0x12')](_0xd3c5('0xd'),_0x25b3f6,_0x555907['error'][_0xd3c5('0x13')]);return _0x5641a9(_0x555907[_0xd3c5('0x12')][_0xd3c5('0x13')]);}logger[_0xd3c5('0x12')](_0xd3c5('0xd'),_0x25b3f6,_0x555907['error'][_0xd3c5('0x13')]);return _0x45b087(_0x555907['error'][_0xd3c5('0x13')]);}else{logger[_0xd3c5('0x14')](_0xd3c5('0xd'),_0x25b3f6,'request\x20sent');_0x45b087(_0x555907[_0xd3c5('0x15')][_0xd3c5('0x13')]);}})[_0xd3c5('0x16')](function(_0x337154){logger['error'](_0xd3c5('0xd'),_0x25b3f6,_0x337154);_0x5641a9(_0x337154);});});}exports[_0xd3c5('0x17')]=function(_0x190784){var _0x9cd484=this;return new Promise(function(_0x164378,_0x978e81){return db['VoiceTransferReport'][_0xd3c5('0x18')](_0x190784['body'],{'raw':_0x190784[_0xd3c5('0x19')]?_0x190784[_0xd3c5('0x19')][_0xd3c5('0x1a')]===undefined?!![]:![]:!![]})[_0xd3c5('0xc')](function(_0x91790b){logger[_0xd3c5('0x14')]('CreateVoiceTransferReport',_0x190784);logger['debug'](_0xd3c5('0x17'),_0x190784,JSON[_0xd3c5('0x11')](_0x91790b));_0x164378(_0x91790b);})[_0xd3c5('0x16')](function(_0x328c13){logger[_0xd3c5('0x12')](_0xd3c5('0x17'),_0x328c13[_0xd3c5('0x13')],_0x190784);_0x978e81(_0x9cd484[_0xd3c5('0x12')](0x1f4,_0x328c13['message']));});});}; \ No newline at end of file +var _0x9924=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x9924,0x164));var _0x4992=function(_0x2f91de,_0x1ffedc){_0x2f91de=_0x2f91de-0x0;var _0xa226de=_0x9924[_0x2f91de];return _0xa226de;};'use strict';var _=require(_0x4992('0x0'));var util=require(_0x4992('0x1'));var moment=require(_0x4992('0x2'));var BPromise=require(_0x4992('0x3'));var rs=require(_0x4992('0x4'));var fs=require('fs');var Redis=require(_0x4992('0x5'));var db=require(_0x4992('0x6'))['db'];var utils=require(_0x4992('0x7'));var logger=require(_0x4992('0x8'))(_0x4992('0x9'));var config=require(_0x4992('0xa'));var jayson=require(_0x4992('0xb'));var client=jayson['client'][_0x4992('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14899e,_0x4bdc10,_0x1e59ef){return new BPromise(function(_0x545448,_0x239511){return client[_0x4992('0xd')](_0x14899e,_0x1e59ef)['then'](function(_0xf75155){logger[_0x4992('0xe')](_0x4992('0xf'),_0x4bdc10,'request\x20sent');logger[_0x4992('0x10')](_0x4992('0x11'),_0x4bdc10,'request\x20sent',JSON[_0x4992('0x12')](_0xf75155));if(_0xf75155[_0x4992('0x13')]){if(_0xf75155['error'][_0x4992('0x14')]===0x1f4){logger[_0x4992('0x13')](_0x4992('0xf'),_0x4bdc10,_0xf75155[_0x4992('0x13')][_0x4992('0x15')]);return _0x239511(_0xf75155[_0x4992('0x13')][_0x4992('0x15')]);}logger['error'](_0x4992('0xf'),_0x4bdc10,_0xf75155[_0x4992('0x13')]['message']);return _0x545448(_0xf75155[_0x4992('0x13')][_0x4992('0x15')]);}else{logger[_0x4992('0xe')](_0x4992('0xf'),_0x4bdc10,_0x4992('0x16'));_0x545448(_0xf75155['result'][_0x4992('0x15')]);}})['catch'](function(_0x47ba56){logger[_0x4992('0x13')](_0x4992('0xf'),_0x4bdc10,_0x47ba56);_0x239511(_0x47ba56);});});}exports[_0x4992('0x17')]=function(_0xd66dcf){var _0x35f770=this;return new Promise(function(_0x18017d,_0x31b8da){return db[_0x4992('0x18')][_0x4992('0x19')](_0xd66dcf[_0x4992('0x1a')],{'raw':_0xd66dcf[_0x4992('0x1b')]?_0xd66dcf['options'][_0x4992('0x1c')]===undefined?!![]:![]:!![]})[_0x4992('0x1d')](function(_0x1ba04f){logger[_0x4992('0xe')](_0x4992('0x17'),_0xd66dcf);logger[_0x4992('0x10')](_0x4992('0x17'),_0xd66dcf,JSON[_0x4992('0x12')](_0x1ba04f));_0x18017d(_0x1ba04f);})[_0x4992('0x1e')](function(_0x50b59d){logger['error'](_0x4992('0x17'),_0x50b59d[_0x4992('0x15')],_0xd66dcf);_0x31b8da(_0x35f770[_0x4992('0x13')](0x1f4,_0x50b59d['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 2d8fbd0..98f8d05 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 _0x34e8=['/unhold','unhold','/calls','calls','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','hold'];(function(_0x5c8811,_0x4f77d5){var _0x2c0941=function(_0x30e2bc){while(--_0x30e2bc){_0x5c8811['push'](_0x5c8811['shift']());}};_0x2c0941(++_0x4f77d5);}(_0x34e8,0x12c));var _0x834e=function(_0x3ff183,_0x12266e){_0x3ff183=_0x3ff183-0x0;var _0x5b4d9c=_0x34e8[_0x3ff183];return _0x5b4d9c;};'use strict';var express=require(_0x834e('0x0'));var router=express[_0x834e('0x1')]();var auth=require(_0x834e('0x2'));var controller=require(_0x834e('0x3'));router['post'](_0x834e('0x4'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x7')]);router[_0x834e('0x8')](_0x834e('0x9'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0xa')]);router['post'](_0x834e('0xb'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xc')]);router[_0x834e('0x8')](_0x834e('0xd'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xe')]);router[_0x834e('0x8')](_0x834e('0xf'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x10')]);router[_0x834e('0x8')](_0x834e('0x11'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0x12')]);router[_0x834e('0x8')]('/transfer',auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x13')]);module[_0x834e('0x14')]=router; \ No newline at end of file +var _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x4c566d,_0x55d066){var _0x33fd32=function(_0x452ec3){while(--_0x452ec3){_0x4c566d['push'](_0x4c566d['shift']());}};_0x33fd32(++_0x55d066);}(_0x00bb,0x1d8));var _0xb00b=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x00bb[_0x484e36];return _0xafc85d;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 332b67a..410cb42 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 _0xaa88=['callNumber','format','user:%s','catch','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','sessionId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','defaults','localhost','socket.io-emitter','redis','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','error','name','status','send','NotFound','then','code','message','User','findOne','agent','all','filter','UserId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId'];(function(_0x164f86,_0x1cb029){var _0x33504a=function(_0x43dc0c){while(--_0x43dc0c){_0x164f86['push'](_0x164f86['shift']());}};_0x33504a(++_0x1cb029);}(_0xaa88,0x137));var _0x8aa8=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xaa88[_0x43941d];return _0x27b82a;};'use strict';var path=require(_0x8aa8('0x0'));var fs=require('fs');var _=require(_0x8aa8('0x1'));var db=require(_0x8aa8('0x2'))['db'];var config=require(_0x8aa8('0x3'));var util=require('util');var BPromise=require(_0x8aa8('0x4'));var jayson=require(_0x8aa8('0x5'));var amiClient=jayson[_0x8aa8('0x6')][_0x8aa8('0x7')]({'port':0x232a});var logger=require(_0x8aa8('0x8'))(_0x8aa8('0x9'));var Redis=require('ioredis');config['redis']=_[_0x8aa8('0xa')](config['redis'],{'host':_0x8aa8('0xb'),'port':0x18eb});var io=require(_0x8aa8('0xc'))(new Redis(config[_0x8aa8('0xd')]));var Schema=require(_0x8aa8('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8aa8('0xf')]},'callNumber':{'type':_0x8aa8('0x10'),'required':[!![],_0x8aa8('0x11')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x8aa8('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x8aa8('0x12'),'required':[!![],_0x8aa8('0xf')]},'sessionId':{'type':_0x8aa8('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8aa8('0xf')]},'sessionId':{'type':_0x8aa8('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8aa8('0xf')]},'sessionId':{'type':_0x8aa8('0x10'),'required':[!![],_0x8aa8('0x13')]},'transferNumber':{'type':'string','required':[!![],_0x8aa8('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x8aa8('0x12'),'required':[!![],_0x8aa8('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8aa8('0x12'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8aa8('0x12'),'required':[!![],_0x8aa8('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x8aa8('0x12'),'required':[!![],_0x8aa8('0xf')]}});function emit(_0x42a6a4,_0x3778f4,_0x1bdd39){logger[_0x8aa8('0x15')](_0x42a6a4,_0x3778f4,JSON[_0x8aa8('0x16')](_0x1bdd39));io['to'](_0x42a6a4)['emit'](_0x3778f4,_0x1bdd39);}function handleError(_0x4843f5){return function(_0x2c1b9a){console['log']('handleError:',_0x2c1b9a,_0x2c1b9a instanceof RangeError);logger[_0x8aa8('0x17')](_0x2c1b9a['stack']);if(_0x2c1b9a instanceof RangeError){if(_0x2c1b9a[_0x8aa8('0x18')]){delete _0x2c1b9a[_0x8aa8('0x18')];}_0x4843f5[_0x8aa8('0x19')](0x194)[_0x8aa8('0x1a')](_0x2c1b9a);}else{if(_0x2c1b9a['name']){delete _0x2c1b9a[_0x8aa8('0x18')];}_0x4843f5[_0x8aa8('0x19')](0x1f4)[_0x8aa8('0x1a')](_0x2c1b9a);}};}function checkError(){return function(_0x10f11c){if(!_0x10f11c){throw new RangeError(_0x8aa8('0x1b'));}return _0x10f11c;};}function respondWithRpcPromise(_0x34f1b7,_0x5d9b62){return new BPromise(function(_0x26cf63,_0x4cc455){var _0x1fdadd=amiClient;return _0x1fdadd['request'](_0x34f1b7,_0x5d9b62)[_0x8aa8('0x1c')](function(_0x557e4e){if(_0x557e4e[_0x8aa8('0x17')]){if(_0x557e4e[_0x8aa8('0x17')][_0x8aa8('0x1d')]===0x1f4){return _0x4cc455(_0x557e4e['error'][_0x8aa8('0x1e')]);}return _0x26cf63(_0x557e4e[_0x8aa8('0x17')][_0x8aa8('0x1e')]);}else{_0x26cf63(_0x557e4e['result']);}})['catch'](function(_0x2d1508){_0x4cc455(_0x2d1508);});});}function getAgent(_0x44e2d8){return db[_0x8aa8('0x1f')][_0x8aa8('0x20')]({'where':{'id':_0x44e2d8,'role':_0x8aa8('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x2bc34a,_0x49d561){return new BPromise(function(_0x2a0ff2,_0xe7768){var _0x15ff33=respondWithRpcPromise('VoiceChannels');var _0x4c5c5c=getAgent(_0x2bc34a);Promise[_0x8aa8('0x22')]([_0x15ff33,_0x4c5c5c])['then'](function(_0x385208){var _0x14be8b=_0x385208[0x0];var _0x39e892=_0x385208[0x1];var _0x240203=_[_0x8aa8('0x23')](_0x14be8b['rows'],function(_0x267f4c){return _0x267f4c[_0x8aa8('0x24')]==_0x39e892['id']&&_0x267f4c['sessionId']==_0x49d561;});if(_0x240203[_0x8aa8('0x25')]==0x1){_0x2a0ff2(_0x39e892);}else{_0xe7768(new RangeError(_0x8aa8('0x26')+_0x49d561+_0x8aa8('0x27')));}});});}exports['originate']=function(_0x28182b,_0x3a0dce){logger[_0x8aa8('0x15')](_0x8aa8('0x28'),_0x28182b[_0x8aa8('0x29')]);var _0x356be7=originateValidation[_0x8aa8('0xe')](_0x28182b[_0x8aa8('0x29')]);if(_0x356be7[_0x8aa8('0x25')]>0x0){return _0x3a0dce[_0x8aa8('0x19')](0x190)[_0x8aa8('0x2a')](_0x356be7);}var _0x5bf1a7=_0x28182b['body'][_0x8aa8('0x2b')];var _0x1270ff=_0x28182b[_0x8aa8('0x29')][_0x8aa8('0x2c')];var _0xbe7639=_0x28182b[_0x8aa8('0x29')]['callerId'];var _0x4b8118=_0x28182b[_0x8aa8('0x29')]['callbackUrl'];return getAgent(_0x5bf1a7)[_0x8aa8('0x1c')](function(_0x2c5c84){logger[_0x8aa8('0x15')]('entityFound:',_0x2c5c84[_0x8aa8('0x18')]);emit(util[_0x8aa8('0x2d')](_0x8aa8('0x2e'),_0x2c5c84['name']),'webbar:originate',{'callNumber':_0x1270ff,'callerId':_0xbe7639,'callbackUrl':_0x4b8118});return _0x3a0dce[_0x8aa8('0x19')](0xc8)[_0x8aa8('0x2a')]({'error':![],'message':'originate\x20executed!'});})[_0x8aa8('0x2f')](handleError(_0x3a0dce));};exports[_0x8aa8('0x30')]=function(_0x5c65fe,_0x3bbdd5){logger['info']('hangup\x20fired:',_0x5c65fe[_0x8aa8('0x29')]);var _0x5537ff=hangupValidation[_0x8aa8('0xe')](_0x5c65fe[_0x8aa8('0x29')]);if(_0x5537ff[_0x8aa8('0x25')]>0x0){return _0x3bbdd5[_0x8aa8('0x19')](0x190)['json'](_0x5537ff);}var _0x14264d=_0x5c65fe[_0x8aa8('0x29')]['userId'];var _0x40867c=_0x5c65fe[_0x8aa8('0x29')]['sessionId'];return getAgent(_0x14264d)[_0x8aa8('0x1c')](function(_0x3c6115){logger[_0x8aa8('0x15')](_0x8aa8('0x31'),_0x3c6115[_0x8aa8('0x18')]);emit(util[_0x8aa8('0x2d')](_0x8aa8('0x2e'),_0x3c6115[_0x8aa8('0x18')]),_0x8aa8('0x32'),{'sessionId':_0x40867c});return _0x3bbdd5[_0x8aa8('0x19')](0xc8)[_0x8aa8('0x2a')]({'error':![],'message':_0x8aa8('0x33')});})[_0x8aa8('0x2f')](handleError(_0x3bbdd5));};exports[_0x8aa8('0x34')]=function(_0x335953,_0x21b0b6){logger['info'](_0x8aa8('0x35'),_0x335953['body']);var _0x4833c0=answerValidation['validate'](_0x335953[_0x8aa8('0x29')]);if(_0x4833c0['length']>0x0){return _0x21b0b6['status'](0x190)[_0x8aa8('0x2a')](_0x4833c0);}var _0x4da4d8=_0x335953[_0x8aa8('0x29')]['userId'];var _0x5a132a=_0x335953[_0x8aa8('0x29')][_0x8aa8('0x36')];return getAgent(_0x4da4d8)[_0x8aa8('0x1c')](function(_0x3762cd){logger[_0x8aa8('0x15')](_0x8aa8('0x31'),_0x3762cd[_0x8aa8('0x18')]);emit(util['format'](_0x8aa8('0x2e'),_0x3762cd['name']),_0x8aa8('0x37'),{'sessionId':_0x5a132a});return _0x21b0b6[_0x8aa8('0x19')](0xc8)[_0x8aa8('0x2a')]({'error':![],'message':_0x8aa8('0x38')});})[_0x8aa8('0x2f')](handleError(_0x21b0b6));};exports[_0x8aa8('0x39')]=function(_0x5adcda,_0x56e13f){logger[_0x8aa8('0x15')](_0x8aa8('0x3a'),_0x5adcda['body']);var _0x35eeea=holdValidation[_0x8aa8('0xe')](_0x5adcda[_0x8aa8('0x29')]);if(_0x35eeea['length']>0x0){return _0x56e13f['status'](0x190)['json'](_0x35eeea);}var _0x4e05e7=_0x5adcda[_0x8aa8('0x29')][_0x8aa8('0x2b')];var _0x4ebe29=_0x5adcda[_0x8aa8('0x29')][_0x8aa8('0x36')];return getAgent(_0x4e05e7)[_0x8aa8('0x1c')](function(_0x1aa1b6){logger[_0x8aa8('0x15')](_0x8aa8('0x31'),_0x1aa1b6['name']);emit(util['format'](_0x8aa8('0x2e'),_0x1aa1b6['name']),_0x8aa8('0x3b'),{'sessionId':_0x4ebe29});return _0x56e13f['status'](0xc8)[_0x8aa8('0x2a')]({'error':![],'message':_0x8aa8('0x3c')});})[_0x8aa8('0x2f')](handleError(_0x56e13f));};exports[_0x8aa8('0x3d')]=function(_0x36de37,_0x22b35d){logger[_0x8aa8('0x15')](_0x8aa8('0x3e'),_0x36de37[_0x8aa8('0x29')]);var _0x850854=unholdValidation[_0x8aa8('0xe')](_0x36de37[_0x8aa8('0x29')]);if(_0x850854['length']>0x0){return _0x22b35d[_0x8aa8('0x19')](0x190)['json'](_0x850854);}var _0x4d8865=_0x36de37['body'][_0x8aa8('0x2b')];var _0x490e6a=_0x36de37[_0x8aa8('0x29')][_0x8aa8('0x36')];return getAgent(_0x4d8865)[_0x8aa8('0x1c')](function(_0x4d4dc3){logger[_0x8aa8('0x15')](_0x8aa8('0x31'),_0x4d4dc3[_0x8aa8('0x18')]);emit(util[_0x8aa8('0x2d')]('user:%s',_0x4d4dc3['name']),_0x8aa8('0x3f'),{'sessionId':_0x490e6a});return _0x22b35d[_0x8aa8('0x19')](0xc8)[_0x8aa8('0x2a')]({'error':![],'message':_0x8aa8('0x40')});})['catch'](handleError(_0x22b35d));};exports['calls']=function(_0x396ac5,_0x1bd389){logger[_0x8aa8('0x15')]('calls\x20fired:',_0x1bd389[_0x8aa8('0x29')]);var _0x3a814f=callsValidation['validate'](_0x396ac5['body']);if(_0x3a814f['length']>0x0){return _0x1bd389['status'](0x190)[_0x8aa8('0x2a')](_0x3a814f);}var _0x4ab098=_0x396ac5[_0x8aa8('0x29')][_0x8aa8('0x2b')];var _0x57d247=respondWithRpcPromise('VoiceChannels');var _0x2725c5=getAgent(_0x4ab098);return Promise[_0x8aa8('0x22')]([_0x57d247,_0x2725c5])['then'](function(_0x58830e){var _0x4da935=_0x58830e[0x0];var _0x3d2076=_0x58830e[0x1];var _0x1050e9=_['filter'](_0x4da935['rows'],function(_0x20feaf){return _0x20feaf[_0x8aa8('0x24')]==_0x3d2076['id'];});return _0x1bd389['status'](0xc8)[_0x8aa8('0x2a')]({'count':_0x1050e9[_0x8aa8('0x25')],'rows':_0x1050e9});})['catch'](handleError(_0x1bd389));};exports[_0x8aa8('0x41')]=function(_0x5dddbb,_0x29dfb3){logger['info'](_0x8aa8('0x42'),_0x5dddbb[_0x8aa8('0x29')]);var _0x3e105e=conferenceValidation[_0x8aa8('0xe')](_0x5dddbb[_0x8aa8('0x29')]);if(_0x3e105e['length']>0x0){return _0x29dfb3[_0x8aa8('0x19')](0x190)[_0x8aa8('0x2a')](_0x3e105e);}var _0x3fc8ce=_0x5dddbb[_0x8aa8('0x29')]['userId'];return getAgent(_0x3fc8ce)[_0x8aa8('0x1c')](function(_0xfe073d){logger['info'](_0x8aa8('0x31'),_0xfe073d[_0x8aa8('0x18')]);emit(util[_0x8aa8('0x2d')](_0x8aa8('0x2e'),_0xfe073d[_0x8aa8('0x18')]),_0x8aa8('0x43'));return _0x29dfb3[_0x8aa8('0x19')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x29dfb3));};exports[_0x8aa8('0x44')]=function(_0x3396fe,_0x3b7b2f){logger[_0x8aa8('0x15')](_0x8aa8('0x45'),_0x3396fe[_0x8aa8('0x29')]);var _0xffab23=transferValidation[_0x8aa8('0xe')](_0x3396fe[_0x8aa8('0x29')]);if(_0xffab23[_0x8aa8('0x25')]>0x0){return _0x3b7b2f[_0x8aa8('0x19')](0x190)[_0x8aa8('0x2a')](_0xffab23);}var _0x1c62bf=_0x3396fe[_0x8aa8('0x29')][_0x8aa8('0x2b')];var _0x36523a=_0x3396fe[_0x8aa8('0x29')][_0x8aa8('0x36')];var _0x28cf8a=_0x3396fe['body'][_0x8aa8('0x46')];return getAgent(_0x1c62bf)[_0x8aa8('0x1c')](function(_0x1bf485){logger[_0x8aa8('0x15')](_0x8aa8('0x31'),_0x1bf485[_0x8aa8('0x18')]);emit(util[_0x8aa8('0x2d')](_0x8aa8('0x2e'),_0x1bf485[_0x8aa8('0x18')]),'webbar:transfer',{'sessionId':_0x36523a,'transferNumber':_0x28cf8a});return _0x3b7b2f[_0x8aa8('0x19')](0xc8)[_0x8aa8('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0x8aa8('0x2f')](handleError(_0x3b7b2f));}; \ No newline at end of file +var _0xc788=['all','filter','rows','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','user:%s','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','error','name','send','status','NotFound','request','then','code','message','result','catch','findOne','agent','VoiceChannels'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xc788,0xc4));var _0x8c78=function(_0x4dda69,_0x2a0fe4){_0x4dda69=_0x4dda69-0x0;var _0x9014a9=_0xc788[_0x4dda69];return _0x9014a9;};'use strict';var path=require(_0x8c78('0x0'));var fs=require('fs');var _=require(_0x8c78('0x1'));var db=require(_0x8c78('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x8c78('0x3'));var jayson=require(_0x8c78('0x4'));var amiClient=jayson[_0x8c78('0x5')][_0x8c78('0x6')]({'port':0x232a});var logger=require(_0x8c78('0x7'))('webbarapi');var Redis=require(_0x8c78('0x8'));config[_0x8c78('0x9')]=_[_0x8c78('0xa')](config[_0x8c78('0x9')],{'host':_0x8c78('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8c78('0x9')]));var Schema=require(_0x8c78('0xc'));var originateValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]},'callNumber':{'type':_0x8c78('0xf'),'required':[!![],_0x8c78('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x8c78('0xf')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x8c78('0xf'),'required':[!![],_0x8c78('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]},'sessionId':{'type':_0x8c78('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8c78('0xd'),'required':[!![],_0x8c78('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8c78('0xe')]}});function emit(_0x293cfe,_0x57ad11,_0x45b85f){logger[_0x8c78('0x12')](_0x293cfe,_0x57ad11,JSON[_0x8c78('0x13')](_0x45b85f));io['to'](_0x293cfe)[_0x8c78('0x14')](_0x57ad11,_0x45b85f);}function handleError(_0x2a982c){return function(_0x461eff){console['log']('handleError:',_0x461eff,_0x461eff instanceof RangeError);logger[_0x8c78('0x15')](_0x461eff['stack']);if(_0x461eff instanceof RangeError){if(_0x461eff['name']){delete _0x461eff[_0x8c78('0x16')];}_0x2a982c['status'](0x194)[_0x8c78('0x17')](_0x461eff);}else{if(_0x461eff[_0x8c78('0x16')]){delete _0x461eff['name'];}_0x2a982c[_0x8c78('0x18')](0x1f4)['send'](_0x461eff);}};}function checkError(){return function(_0x2dba52){if(!_0x2dba52){throw new RangeError(_0x8c78('0x19'));}return _0x2dba52;};}function respondWithRpcPromise(_0x5a254d,_0xd1ae4d){return new BPromise(function(_0x188cc3,_0x499603){var _0x2bc595=amiClient;return _0x2bc595[_0x8c78('0x1a')](_0x5a254d,_0xd1ae4d)[_0x8c78('0x1b')](function(_0x9581c6){if(_0x9581c6[_0x8c78('0x15')]){if(_0x9581c6[_0x8c78('0x15')][_0x8c78('0x1c')]===0x1f4){return _0x499603(_0x9581c6[_0x8c78('0x15')][_0x8c78('0x1d')]);}return _0x188cc3(_0x9581c6['error'][_0x8c78('0x1d')]);}else{_0x188cc3(_0x9581c6[_0x8c78('0x1e')]);}})[_0x8c78('0x1f')](function(_0x49cccb){_0x499603(_0x49cccb);});});}function getAgent(_0x331bfe){return db['User'][_0x8c78('0x20')]({'where':{'id':_0x331bfe,'role':_0x8c78('0x21')}})[_0x8c78('0x1b')](checkError());}function getAgentCheckSession(_0x496c51,_0x583a74){return new BPromise(function(_0x2568d5,_0x4be49d){var _0x20b128=respondWithRpcPromise(_0x8c78('0x22'));var _0x394c1d=getAgent(_0x496c51);Promise[_0x8c78('0x23')]([_0x20b128,_0x394c1d])[_0x8c78('0x1b')](function(_0x2ab5cc){var _0x5ba7d4=_0x2ab5cc[0x0];var _0x1c3039=_0x2ab5cc[0x1];var _0x51add6=_[_0x8c78('0x24')](_0x5ba7d4[_0x8c78('0x25')],function(_0xb69c52){return _0xb69c52['UserId']==_0x1c3039['id']&&_0xb69c52[_0x8c78('0x26')]==_0x583a74;});if(_0x51add6[_0x8c78('0x27')]==0x1){_0x2568d5(_0x1c3039);}else{_0x4be49d(new RangeError('sessionId\x20'+_0x583a74+_0x8c78('0x28')));}});});}exports[_0x8c78('0x29')]=function(_0x32bc1f,_0x487a4c){logger[_0x8c78('0x12')](_0x8c78('0x2a'),_0x32bc1f[_0x8c78('0x2b')]);var _0x5348ab=originateValidation[_0x8c78('0xc')](_0x32bc1f[_0x8c78('0x2b')]);if(_0x5348ab['length']>0x0){return _0x487a4c[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x5348ab);}var _0x3a9372=_0x32bc1f[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0x5b5429=_0x32bc1f[_0x8c78('0x2b')][_0x8c78('0x2e')];var _0x201a43=_0x32bc1f[_0x8c78('0x2b')]['callerId'];var _0x3e9bf1=_0x32bc1f[_0x8c78('0x2b')][_0x8c78('0x2f')];return getAgent(_0x3a9372)[_0x8c78('0x1b')](function(_0x34481a){logger['info'](_0x8c78('0x30'),_0x34481a[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')]('user:%s',_0x34481a[_0x8c78('0x16')]),_0x8c78('0x32'),{'callNumber':_0x5b5429,'callerId':_0x201a43,'callbackUrl':_0x3e9bf1});return _0x487a4c['status'](0xc8)[_0x8c78('0x2c')]({'error':![],'message':'originate\x20executed!'});})[_0x8c78('0x1f')](handleError(_0x487a4c));};exports[_0x8c78('0x33')]=function(_0x245f62,_0x157b81){logger['info'](_0x8c78('0x34'),_0x245f62['body']);var _0x3b8f4f=hangupValidation[_0x8c78('0xc')](_0x245f62[_0x8c78('0x2b')]);if(_0x3b8f4f['length']>0x0){return _0x157b81['status'](0x190)[_0x8c78('0x2c')](_0x3b8f4f);}var _0x25d143=_0x245f62[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0x2eb3ef=_0x245f62[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0x25d143)[_0x8c78('0x1b')](function(_0x1f0a2b){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x1f0a2b[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')]('user:%s',_0x1f0a2b[_0x8c78('0x16')]),_0x8c78('0x35'),{'sessionId':_0x2eb3ef});return _0x157b81['status'](0xc8)['json']({'error':![],'message':_0x8c78('0x36')});})[_0x8c78('0x1f')](handleError(_0x157b81));};exports['answer']=function(_0x224c4b,_0x57ff42){logger['info'](_0x8c78('0x37'),_0x224c4b[_0x8c78('0x2b')]);var _0x57e2c7=answerValidation[_0x8c78('0xc')](_0x224c4b[_0x8c78('0x2b')]);if(_0x57e2c7[_0x8c78('0x27')]>0x0){return _0x57ff42[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x57e2c7);}var _0x4e4880=_0x224c4b['body'][_0x8c78('0x2d')];var _0x2f6a6b=_0x224c4b[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0x4e4880)[_0x8c78('0x1b')](function(_0x460821){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x460821[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')](_0x8c78('0x38'),_0x460821['name']),_0x8c78('0x39'),{'sessionId':_0x2f6a6b});return _0x57ff42[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'error':![],'message':_0x8c78('0x3a')});})[_0x8c78('0x1f')](handleError(_0x57ff42));};exports['hold']=function(_0x356e47,_0x4588cd){logger[_0x8c78('0x12')](_0x8c78('0x3b'),_0x356e47[_0x8c78('0x2b')]);var _0x5cc829=holdValidation[_0x8c78('0xc')](_0x356e47['body']);if(_0x5cc829['length']>0x0){return _0x4588cd[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x5cc829);}var _0x61e20=_0x356e47['body'][_0x8c78('0x2d')];var _0xc6ba23=_0x356e47[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0x61e20)[_0x8c78('0x1b')](function(_0x38083e){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x38083e[_0x8c78('0x16')]);emit(util['format'](_0x8c78('0x38'),_0x38083e[_0x8c78('0x16')]),_0x8c78('0x3c'),{'sessionId':_0xc6ba23});return _0x4588cd[_0x8c78('0x18')](0xc8)['json']({'error':![],'message':_0x8c78('0x3d')});})[_0x8c78('0x1f')](handleError(_0x4588cd));};exports[_0x8c78('0x3e')]=function(_0x431125,_0x53e75c){logger[_0x8c78('0x12')](_0x8c78('0x3f'),_0x431125[_0x8c78('0x2b')]);var _0x551e0f=unholdValidation[_0x8c78('0xc')](_0x431125['body']);if(_0x551e0f[_0x8c78('0x27')]>0x0){return _0x53e75c[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x551e0f);}var _0xa87aba=_0x431125[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0xf68e0=_0x431125[_0x8c78('0x2b')][_0x8c78('0x26')];return getAgent(_0xa87aba)[_0x8c78('0x1b')](function(_0x23e568){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x23e568[_0x8c78('0x16')]);emit(util['format'](_0x8c78('0x38'),_0x23e568[_0x8c78('0x16')]),_0x8c78('0x40'),{'sessionId':_0xf68e0});return _0x53e75c[_0x8c78('0x18')](0xc8)['json']({'error':![],'message':_0x8c78('0x41')});})[_0x8c78('0x1f')](handleError(_0x53e75c));};exports[_0x8c78('0x42')]=function(_0x2b9b18,_0x40025d){logger[_0x8c78('0x12')]('calls\x20fired:',_0x40025d[_0x8c78('0x2b')]);var _0x42a34e=callsValidation['validate'](_0x2b9b18[_0x8c78('0x2b')]);if(_0x42a34e['length']>0x0){return _0x40025d[_0x8c78('0x18')](0x190)[_0x8c78('0x2c')](_0x42a34e);}var _0x257533=_0x2b9b18[_0x8c78('0x2b')][_0x8c78('0x2d')];var _0x35cf85=respondWithRpcPromise(_0x8c78('0x22'));var _0x49fa4c=getAgent(_0x257533);return Promise[_0x8c78('0x23')]([_0x35cf85,_0x49fa4c])[_0x8c78('0x1b')](function(_0x4e77a9){var _0x110e7b=_0x4e77a9[0x0];var _0x3529aa=_0x4e77a9[0x1];var _0x577361=_[_0x8c78('0x24')](_0x110e7b[_0x8c78('0x25')],function(_0x3e2160){return _0x3e2160[_0x8c78('0x43')]==_0x3529aa['id'];});return _0x40025d[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'count':_0x577361[_0x8c78('0x27')],'rows':_0x577361});})[_0x8c78('0x1f')](handleError(_0x40025d));};exports[_0x8c78('0x44')]=function(_0x1b3600,_0x25b8bc){logger[_0x8c78('0x12')](_0x8c78('0x45'),_0x1b3600[_0x8c78('0x2b')]);var _0x50ae7d=conferenceValidation[_0x8c78('0xc')](_0x1b3600['body']);if(_0x50ae7d[_0x8c78('0x27')]>0x0){return _0x25b8bc['status'](0x190)['json'](_0x50ae7d);}var _0x57a4b1=_0x1b3600[_0x8c78('0x2b')]['userId'];return getAgent(_0x57a4b1)['then'](function(_0x502991){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0x502991[_0x8c78('0x16')]);emit(util[_0x8c78('0x31')]('user:%s',_0x502991[_0x8c78('0x16')]),_0x8c78('0x46'));return _0x25b8bc[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'error':![],'message':_0x8c78('0x47')});})[_0x8c78('0x1f')](handleError(_0x25b8bc));};exports[_0x8c78('0x48')]=function(_0x54d561,_0x25c255){logger[_0x8c78('0x12')](_0x8c78('0x49'),_0x54d561[_0x8c78('0x2b')]);var _0x3e1ee0=transferValidation[_0x8c78('0xc')](_0x54d561['body']);if(_0x3e1ee0[_0x8c78('0x27')]>0x0){return _0x25c255['status'](0x190)[_0x8c78('0x2c')](_0x3e1ee0);}var _0x28d1a7=_0x54d561[_0x8c78('0x2b')]['userId'];var _0x97df9c=_0x54d561[_0x8c78('0x2b')][_0x8c78('0x26')];var _0x4fa0b0=_0x54d561[_0x8c78('0x2b')][_0x8c78('0x4a')];return getAgent(_0x28d1a7)['then'](function(_0xbfafd1){logger[_0x8c78('0x12')](_0x8c78('0x30'),_0xbfafd1['name']);emit(util[_0x8c78('0x31')](_0x8c78('0x38'),_0xbfafd1[_0x8c78('0x16')]),_0x8c78('0x4b'),{'sessionId':_0x97df9c,'transferNumber':_0x4fa0b0});return _0x25c255[_0x8c78('0x18')](0xc8)[_0x8c78('0x2c')]({'error':![],'message':_0x8c78('0x4c')});})[_0x8c78('0x1f')](handleError(_0x25c255));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d99138a..edd3683 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 _0x14a0=['update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','put','/:id'];(function(_0x379a70,_0x367de6){var _0x3ddaa4=function(_0x5a2582){while(--_0x5a2582){_0x379a70['push'](_0x379a70['shift']());}};_0x3ddaa4(++_0x367de6);}(_0x14a0,0x8e));var _0x014a=function(_0x310a07,_0x4a74ed){_0x310a07=_0x310a07-0x0;var _0x5a5570=_0x14a0[_0x310a07];return _0x5a5570;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['getAnswers']);router[_0x014a('0x8')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0x8')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0x13')]);router[_0x014a('0x12')]('/:id/dispositions',auth[_0x014a('0x9')](),controller[_0x014a('0x14')]);router['post'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['addAnswer']);router[_0x014a('0x12')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x15')]);router[_0x014a('0x12')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x16')]);router[_0x014a('0x12')](_0x014a('0x17'),controller[_0x014a('0x18')]);router[_0x014a('0x12')](_0x014a('0x19'),auth[_0x014a('0x9')](),controller['send']);router[_0x014a('0x1a')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1c')]);router[_0x014a('0x1d')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1e')]);router[_0x014a('0x1d')]('/:id/dispositions',auth[_0x014a('0x9')](),controller['removeDispositions']);router[_0x014a('0x1d')](_0x014a('0xd'),auth[_0x014a('0x9')](),controller[_0x014a('0x1f')]);router[_0x014a('0x1d')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x20')]);module[_0x014a('0x21')]=router; \ No newline at end of file +var _0x4975=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addAnswer','/:id/users','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeDispositions','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x252101,_0x517621){var _0x5a888f=function(_0x2effb1){while(--_0x2effb1){_0x252101['push'](_0x252101['shift']());}};_0x5a888f(++_0x517621);}(_0x4975,0x86));var _0x5497=function(_0xe46498,_0x18fb01){_0xe46498=_0xe46498-0x0;var _0x39c32f=_0x4975[_0xe46498];return _0x39c32f;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0xa')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0xa')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller['getAnswers']);router['get']('/:id/users',auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router[_0x5497('0xa')](_0x5497('0x15'),auth[_0x5497('0xd')](),controller[_0x5497('0x16')]);router[_0x5497('0x17')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x18')]);router[_0x5497('0x17')]('/:id/dispositions',auth[_0x5497('0xd')](),controller['addDisposition']);router[_0x5497('0x17')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller[_0x5497('0x19')]);router[_0x5497('0x17')](_0x5497('0x1a'),auth[_0x5497('0xd')](),controller['addAgents']);router['post'](_0x5497('0x15'),auth[_0x5497('0xd')](),controller[_0x5497('0x1b')]);router['post'](_0x5497('0x1c'),controller[_0x5497('0x1d')]);router[_0x5497('0x17')](_0x5497('0x1e'),auth[_0x5497('0xd')](),controller[_0x5497('0x1f')]);router[_0x5497('0x20')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x21')]);router[_0x5497('0x22')]('/:id',auth[_0x5497('0xd')](),controller['destroy']);router[_0x5497('0x22')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x23')]);router[_0x5497('0x22')](_0x5497('0x13'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x5497('0x22')](_0x5497('0x1a'),auth[_0x5497('0xd')](),controller[_0x5497('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 99d7b16..668f2b6 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 _0x6f97=['STRING','generate','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x330db3,_0xd05ab4){var _0xaf2ae=function(_0x555ed9){while(--_0x555ed9){_0x330db3['push'](_0x330db3['shift']());}};_0xaf2ae(++_0xd05ab4);}(_0x6f97,0xcf));var _0x76f9=function(_0x2ea174,_0xb3181){_0x2ea174=_0x2ea174-0x0;var _0x5987c7=_0x6f97[_0x2ea174];return _0x5987c7;};'use strict';var Sequelize=require(_0x76f9('0x0'));var rs=require(_0x76f9('0x1'));module[_0x76f9('0x2')]={'name':{'type':Sequelize[_0x76f9('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x76f9('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x76f9('0x3')],'defaultValue':function(){return rs[_0x76f9('0x4')]();}},'phone':{'type':Sequelize[_0x76f9('0x3')]},'type':{'type':Sequelize['ENUM'](_0x76f9('0x5'),_0x76f9('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x76f9('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x76f9('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x76f9('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x76f9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x76f9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x76f9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x76f9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x76f9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x76f9('0x9')],'comment':_0x76f9('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x76f9('0xb'),'set':function(_0x2b42bc){if(!_0x2b42bc){this[_0x76f9('0xc')](_0x76f9('0xd'),null);}this[_0x76f9('0xc')](_0x76f9('0xe'),_0x2b42bc);}},'description':{'type':Sequelize[_0x76f9('0x3')]}}; \ No newline at end of file +var _0x34d4=['mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x34d4,0x88));var _0x434d=function(_0x190d8b,_0x173ef5){_0x190d8b=_0x190d8b-0x0;var _0x51e469=_0x34d4[_0x190d8b];return _0x51e469;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x434d('0x0'));module[_0x434d('0x1')]={'name':{'type':Sequelize[_0x434d('0x2')],'unique':_0x434d('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x434d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x434d('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x434d('0x2')],'defaultValue':function(){return rs[_0x434d('0x4')]();}},'phone':{'type':Sequelize[_0x434d('0x2')]},'type':{'type':Sequelize[_0x434d('0x5')]('twilio','sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x434d('0x2')]},'authToken':{'type':Sequelize[_0x434d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x434d('0x6')],'defaultValue':function(){return _0x434d('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x434d('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x434d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x434d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x434d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x434d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x434d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x434d('0x9')],'comment':_0x434d('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x434d('0x8')],'defaultValue':![],'comment':_0x434d('0xb'),'set':function(_0x2ac528){if(!_0x2ac528){this[_0x434d('0xc')](_0x434d('0xd'),null);}this[_0x434d('0xc')](_0x434d('0xe'),_0x2ac528);}},'description':{'type':Sequelize[_0x434d('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index dfb1280..4b7b461 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 _0x420d=['request-promise','moment','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./whatsappAccount.socket','http','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','sendStatus','status','json','undefined','count','offset','set','Content-Range','reject','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','Transaction','ISOLATION_LEVELS','findOne','WhatsappApplication','bulkCreate','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','messageId','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','stringify','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','user','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x52a453,_0x3f2a89){var _0x109605=function(_0x20660e){while(--_0x20660e){_0x52a453['push'](_0x52a453['shift']());}};_0x109605(++_0x3f2a89);}(_0x420d,0xc1));var _0xd420=function(_0x5482f4,_0x150cac){_0x5482f4=_0x5482f4-0x0;var _0x42d1ec=_0x420d[_0x5482f4];return _0x42d1ec;};'use strict';var emlformat=require(_0xd420('0x0'));var rimraf=require(_0xd420('0x1'));var zipdir=require(_0xd420('0x2'));var jsonpatch=require(_0xd420('0x3'));var rp=require(_0xd420('0x4'));var moment=require(_0xd420('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd420('0x6'));var util=require(_0xd420('0x7'));var path=require('path');var sox=require(_0xd420('0x8'));var csv=require(_0xd420('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd420('0xa'));var _=require('lodash');var squel=require(_0xd420('0xb'));var crypto=require(_0xd420('0xc'));var jsforce=require(_0xd420('0xd'));var deskjs=require(_0xd420('0xe'));var toCsv=require(_0xd420('0x9'));var querystring=require(_0xd420('0xf'));var Papa=require(_0xd420('0x10'));var Redis=require(_0xd420('0x11'));var authService=require(_0xd420('0x12'));var qs=require(_0xd420('0x13'));var as=require(_0xd420('0x14'));var hardwareService=require(_0xd420('0x15'));var logger=require(_0xd420('0x16'))(_0xd420('0x17'));var utils=require(_0xd420('0x18'));var config=require(_0xd420('0x19'));var licenseUtil=require(_0xd420('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd420('0x1b')]=_[_0xd420('0x1c')](config['redis'],{'host':_0xd420('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd420('0x1b')]));require(_0xd420('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xd420('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x17283e,_0x102071,_0x5d091a,_0x4b4320){return new BPromise(function(_0x4fdf14,_0x4cc32d){var _0xa22a92=_0x4b4320||client;return _0xa22a92['request'](_0x17283e,_0x5d091a)[_0xd420('0x20')](function(_0x46a269){logger[_0xd420('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x102071,_0xd420('0x22'));logger[_0xd420('0x23')](_0xd420('0x24'),_0x102071,_0xd420('0x22'),JSON['stringify'](_0x46a269));if(_0x46a269[_0xd420('0x25')]){if(_0x46a269[_0xd420('0x25')][_0xd420('0x26')]===0x1f4){logger['error'](_0xd420('0x27'),_0x102071,_0x46a269['error'][_0xd420('0x28')]);return _0x4cc32d(_0x46a269[_0xd420('0x25')][_0xd420('0x28')]);}logger['error'](_0xd420('0x27'),_0x102071,_0x46a269[_0xd420('0x25')][_0xd420('0x28')]);return _0x4fdf14(_0x46a269[_0xd420('0x25')][_0xd420('0x28')]);}else{logger[_0xd420('0x21')](_0xd420('0x27'),_0x102071,_0xd420('0x22'));_0x4fdf14(_0x46a269['result'][_0xd420('0x28')]);}})['catch'](function(_0x1f43c2){logger[_0xd420('0x25')](_0xd420('0x27'),_0x102071,_0x1f43c2);_0x4cc32d(_0x1f43c2);});});}function respondWithStatusCode(_0x133d71,_0x562e2d){_0x562e2d=_0x562e2d||0xcc;return function(_0x3c8046){if(_0x3c8046){return _0x133d71[_0xd420('0x29')](_0x562e2d);}return _0x133d71[_0xd420('0x2a')](_0x562e2d)['end']();};}function respondWithResult(_0x411fc7,_0x5e7006){_0x5e7006=_0x5e7006||0xc8;return function(_0x4881e4){if(_0x4881e4){return _0x411fc7[_0xd420('0x2a')](_0x5e7006)[_0xd420('0x2b')](_0x4881e4);}};}function respondWithFilteredResult(_0x4b3bee,_0x536b1b){return function(_0x182b09){if(_0x182b09){var _0x47a031=typeof _0x536b1b['offset']===_0xd420('0x2c')&&typeof _0x536b1b['limit']==='undefined';var _0x1d9b5e=_0x182b09[_0xd420('0x2d')];var _0x15076e=_0x47a031?0x0:_0x536b1b[_0xd420('0x2e')];var _0x34743f=_0x47a031?_0x182b09['count']:_0x536b1b['offset']+_0x536b1b['limit'];var _0x2087aa;if(_0x34743f>=_0x1d9b5e){_0x34743f=_0x1d9b5e;_0x2087aa=0xc8;}else{_0x2087aa=0xce;}_0x4b3bee[_0xd420('0x2a')](_0x2087aa);return _0x4b3bee[_0xd420('0x2f')](_0xd420('0x30'),_0x15076e+'-'+_0x34743f+'/'+_0x1d9b5e)['json'](_0x182b09);}return null;};}function patchUpdates(_0x5e47b2){return function(_0x52aae1){try{jsonpatch['apply'](_0x52aae1,_0x5e47b2,!![]);}catch(_0x32c12d){return BPromise[_0xd420('0x31')](_0x32c12d);}return _0x52aae1['save']();};}function saveUpdates(_0x1df44d,_0x24006d){return function(_0xbae244){if(_0xbae244){return _0xbae244['update'](_0x1df44d)[_0xd420('0x20')](function(_0x4f6064){return _0x4f6064;});}return null;};}function removeEntity(_0x1cc642,_0x13102b){return function(_0x58757a){if(_0x58757a){return _0x58757a[_0xd420('0x32')]()[_0xd420('0x20')](function(){var _0x562f5c=_0x58757a[_0xd420('0x33')]({'plain':!![]});var _0x58d485=_0xd420('0x34');return db[_0xd420('0x35')][_0xd420('0x32')]({'where':{'type':_0x58d485,'resourceId':_0x562f5c['id']}})[_0xd420('0x20')](function(){return _0x58757a;});})[_0xd420('0x20')](function(){_0x1cc642[_0xd420('0x2a')](0xcc)[_0xd420('0x36')]();});}};}function handleEntityNotFound(_0x2c8e06,_0x45b8ab){return function(_0x16c87b){if(!_0x16c87b){_0x2c8e06[_0xd420('0x29')](0x194);}return _0x16c87b;};}function handleError(_0x3a5689,_0x1d03e2){_0x1d03e2=_0x1d03e2||0x1f4;return function(_0x31c562){logger[_0xd420('0x25')](_0x31c562[_0xd420('0x37')]);if(_0x31c562[_0xd420('0x38')]){delete _0x31c562[_0xd420('0x38')];}_0x3a5689[_0xd420('0x2a')](_0x1d03e2)[_0xd420('0x39')](_0x31c562);};}exports[_0xd420('0x3a')]=function(_0x2bb60d,_0x401ff6){var _0x59eb79={'include':[{'model':db[_0xd420('0x3b')],'as':'mandatoryDispositionPause'}]},_0x554cec={},_0x972ca5={'count':0x0,'rows':[]};var _0x21ae66=_[_0xd420('0x3c')](db[_0xd420('0x3d')][_0xd420('0x3e')],function(_0x146374){return{'name':_0x146374[_0xd420('0x3f')],'type':_0x146374[_0xd420('0x40')]['key']};});_0x554cec[_0xd420('0x41')]=_[_0xd420('0x3c')](_0x21ae66,_0xd420('0x38'));_0x554cec[_0xd420('0x42')]=_['keys'](_0x2bb60d[_0xd420('0x42')]);_0x554cec[_0xd420('0x43')]=_['intersection'](_0x554cec['model'],_0x554cec['query']);_0x59eb79[_0xd420('0x44')]=_[_0xd420('0x45')](_0x554cec['model'],qs['fields'](_0x2bb60d['query'][_0xd420('0x46')]));_0x59eb79[_0xd420('0x44')]=_0x59eb79[_0xd420('0x44')][_0xd420('0x47')]?_0x59eb79[_0xd420('0x44')]:_0x554cec[_0xd420('0x41')];if(!_0x2bb60d[_0xd420('0x42')][_0xd420('0x48')](_0xd420('0x49'))){_0x59eb79[_0xd420('0x4a')]=qs[_0xd420('0x4a')](_0x2bb60d[_0xd420('0x42')][_0xd420('0x4a')]);_0x59eb79[_0xd420('0x2e')]=qs[_0xd420('0x2e')](_0x2bb60d[_0xd420('0x42')][_0xd420('0x2e')]);}_0x59eb79['order']=qs[_0xd420('0x4b')](_0x2bb60d[_0xd420('0x42')][_0xd420('0x4b')]);_0x59eb79[_0xd420('0x4c')]=qs[_0xd420('0x43')](_[_0xd420('0x4d')](_0x2bb60d[_0xd420('0x42')],_0x554cec[_0xd420('0x43')]),_0x21ae66);if(_0x2bb60d[_0xd420('0x42')][_0xd420('0x4e')]){_0x59eb79[_0xd420('0x4c')]=_[_0xd420('0x4f')](_0x59eb79['where'],{'$or':_[_0xd420('0x3c')](_0x21ae66,function(_0xf6fde3){if(_0xf6fde3['type']!==_0xd420('0x50')){var _0xf386eb={};_0xf386eb[_0xf6fde3[_0xd420('0x38')]]={'$like':'%'+_0x2bb60d['query']['filter']+'%'};return _0xf386eb;}})});}_0x59eb79=_[_0xd420('0x4f')]({},_0x59eb79,_0x2bb60d[_0xd420('0x51')]);var _0x21dc19={'where':_0x59eb79[_0xd420('0x4c')]};return db[_0xd420('0x3d')][_0xd420('0x2d')](_0x21dc19)[_0xd420('0x20')](function(_0xe43c15){_0x972ca5[_0xd420('0x2d')]=_0xe43c15;if(_0x2bb60d[_0xd420('0x42')][_0xd420('0x52')]){_0x59eb79[_0xd420('0x53')]=[{'all':!![]}];}return db[_0xd420('0x3d')][_0xd420('0x54')](_0x59eb79);})[_0xd420('0x20')](function(_0x42a572){_0x972ca5[_0xd420('0x55')]=_0x42a572;return _0x972ca5;})['then'](respondWithFilteredResult(_0x401ff6,_0x59eb79))[_0xd420('0x56')](handleError(_0x401ff6,null));};exports[_0xd420('0x57')]=function(_0x243689,_0x1611d8){var _0x59921e={'raw':![],'where':{'id':_0x243689[_0xd420('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xd420('0x59')}]},_0x1bb799={};_0x1bb799['model']=_[_0xd420('0x5a')](db[_0xd420('0x3d')][_0xd420('0x3e')]);_0x1bb799[_0xd420('0x42')]=_[_0xd420('0x5a')](_0x243689[_0xd420('0x42')]);_0x1bb799[_0xd420('0x43')]=_[_0xd420('0x45')](_0x1bb799['model'],_0x1bb799['query']);_0x59921e[_0xd420('0x44')]=_[_0xd420('0x45')](_0x1bb799['model'],qs[_0xd420('0x46')](_0x243689[_0xd420('0x42')][_0xd420('0x46')]));_0x59921e['attributes']=_0x59921e['attributes'][_0xd420('0x47')]?_0x59921e[_0xd420('0x44')]:_0x1bb799[_0xd420('0x41')];if(_0x243689[_0xd420('0x42')][_0xd420('0x52')]){_0x59921e[_0xd420('0x53')]=[{'all':!![]}];}_0x59921e=_[_0xd420('0x4f')]({},_0x59921e,_0x243689['options']);return db[_0xd420('0x3d')]['find'](_0x59921e)['then'](handleEntityNotFound(_0x1611d8,null))[_0xd420('0x20')](respondWithResult(_0x1611d8,null))[_0xd420('0x56')](handleError(_0x1611d8,null));};exports['create']=function(_0x230378,_0x4b5b14){return db[_0xd420('0x3d')][_0xd420('0x5b')](_0x230378['body'],{})[_0xd420('0x20')](function(_0x5f3267){var _0x24c79a=_0x230378['user'][_0xd420('0x33')]({'plain':!![]});if(!_0x24c79a)throw new Error(_0xd420('0x5c'));if(_0x24c79a[_0xd420('0x5d')]==='user'){var _0x44a446=_0x5f3267[_0xd420('0x33')]({'plain':!![]});var _0xf13f03='WhatsappAccounts';return db['UserProfileSection'][_0xd420('0x5e')]({'where':{'name':_0xf13f03,'userProfileId':_0x24c79a[_0xd420('0x5f')]},'raw':!![]})[_0xd420('0x20')](function(_0x50a070){if(_0x50a070&&_0x50a070[_0xd420('0x60')]===0x0){return db[_0xd420('0x35')][_0xd420('0x5b')]({'name':_0x44a446[_0xd420('0x38')],'resourceId':_0x44a446['id'],'type':_0x50a070[_0xd420('0x38')],'sectionId':_0x50a070['id']},{})['then'](function(){return _0x5f3267;});}else{return _0x5f3267;}})[_0xd420('0x56')](function(_0x511556){logger[_0xd420('0x25')](_0xd420('0x61'),_0x511556);throw _0x511556;});}return _0x5f3267;})[_0xd420('0x20')](respondWithResult(_0x4b5b14,0xc9))[_0xd420('0x56')](handleError(_0x4b5b14,null));};exports[_0xd420('0x62')]=function(_0x99ad94,_0x5f02b0){if(_0x99ad94['body']['id']){delete _0x99ad94['body']['id'];}return db[_0xd420('0x3d')][_0xd420('0x5e')]({'where':{'id':_0x99ad94[_0xd420('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xd420('0x59')}]})[_0xd420('0x20')](handleEntityNotFound(_0x5f02b0,null))['then'](saveUpdates(_0x99ad94[_0xd420('0x63')],null))['then'](respondWithResult(_0x5f02b0,null))['catch'](handleError(_0x5f02b0,null));};exports[_0xd420('0x32')]=function(_0x3d5ee3,_0x4a7690){return db[_0xd420('0x3d')][_0xd420('0x5e')]({'where':{'id':_0x3d5ee3[_0xd420('0x58')]['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x4a7690,null))[_0xd420('0x20')](removeEntity(_0x4a7690,null))[_0xd420('0x56')](handleError(_0x4a7690,null));};exports[_0xd420('0x64')]=function(_0x3bd701,_0x48d585){return db['WhatsappAccount'][_0xd420('0x64')]()[_0xd420('0x20')](respondWithResult(_0x48d585,null))[_0xd420('0x56')](handleError(_0x48d585,null));};exports[_0xd420('0x65')]=function(_0x262687,_0x285f45,_0x33847a){if(_0x262687['body']['id']){delete _0x262687[_0xd420('0x63')]['id'];}return db['WhatsappAccount'][_0xd420('0x5e')]({'where':{'id':_0x262687[_0xd420('0x58')]['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x285f45,null))['then'](function(_0x547dbd){if(_0x547dbd){_0x262687['body'][_0xd420('0x66')]=_0x547dbd['id'];return db[_0xd420('0x67')][_0xd420('0x5b')](_0x262687[_0xd420('0x63')]);}})['then'](respondWithResult(_0x285f45,null))[_0xd420('0x56')](handleError(_0x285f45,null));};exports[_0xd420('0x68')]=function(_0x5494f6,_0x3545c4,_0x20dd08){var _0x37b7a9={'raw':![],'where':{}};var _0x289868={};var _0x460a20={'count':0x0,'rows':[]};return db[_0xd420('0x3d')]['findOne']({'where':{'id':_0x5494f6[_0xd420('0x58')]['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x3545c4,null))['then'](function(_0xe2a586){if(_0xe2a586){_0x289868[_0xd420('0x41')]=_[_0xd420('0x5a')](db[_0xd420('0x67')][_0xd420('0x3e')]);_0x289868[_0xd420('0x42')]=_[_0xd420('0x5a')](_0x5494f6[_0xd420('0x42')]);_0x289868[_0xd420('0x43')]=_['intersection'](_0x289868[_0xd420('0x41')],_0x289868[_0xd420('0x42')]);_0x37b7a9[_0xd420('0x44')]=_[_0xd420('0x45')](_0x289868[_0xd420('0x41')],qs[_0xd420('0x46')](_0x5494f6[_0xd420('0x42')][_0xd420('0x46')]));_0x37b7a9[_0xd420('0x44')]=_0x37b7a9[_0xd420('0x44')][_0xd420('0x47')]?_0x37b7a9[_0xd420('0x44')]:_0x289868['model'];if(!_0x5494f6['query'][_0xd420('0x48')](_0xd420('0x49'))){_0x37b7a9['limit']=qs[_0xd420('0x4a')](_0x5494f6[_0xd420('0x42')][_0xd420('0x4a')]);_0x37b7a9['offset']=qs[_0xd420('0x2e')](_0x5494f6[_0xd420('0x42')]['offset']);}_0x37b7a9[_0xd420('0x69')]=qs['sort'](_0x5494f6[_0xd420('0x42')][_0xd420('0x4b')]);_0x37b7a9[_0xd420('0x4c')]=qs[_0xd420('0x43')](_[_0xd420('0x4d')](_0x5494f6[_0xd420('0x42')],_0x289868['filters']));_0x37b7a9[_0xd420('0x4c')][_0xd420('0x66')]=_0xe2a586['id'];if(_0x5494f6[_0xd420('0x42')][_0xd420('0x4e')]){_0x37b7a9[_0xd420('0x4c')]=_[_0xd420('0x4f')](_0x37b7a9[_0xd420('0x4c')],{'$or':_[_0xd420('0x3c')](_0x37b7a9[_0xd420('0x44')],function(_0x337808){var _0x554748={};_0x554748[_0x337808]={'$like':'%'+_0x5494f6[_0xd420('0x42')][_0xd420('0x4e')]+'%'};return _0x554748;})});}_0x37b7a9=_['merge']({},_0x37b7a9,_0x5494f6[_0xd420('0x51')]);return db[_0xd420('0x67')][_0xd420('0x2d')]({'where':_0x37b7a9[_0xd420('0x4c')]})['then'](function(_0x5ad1cd){_0x460a20[_0xd420('0x2d')]=_0x5ad1cd;if(_0x5494f6[_0xd420('0x42')]['includeAll']){_0x37b7a9[_0xd420('0x53')]=[{'all':!![]}];}return db[_0xd420('0x67')][_0xd420('0x54')](_0x37b7a9);})[_0xd420('0x20')](function(_0x2bf313){_0x460a20[_0xd420('0x55')]=_0x2bf313;return _0x460a20;});}})['then'](respondWithFilteredResult(_0x3545c4,_0x37b7a9))['catch'](handleError(_0x3545c4,null));};exports[_0xd420('0x6a')]=function(_0x2716e5,_0x5a5fc2,_0x24ee8c){return db[_0xd420('0x3d')][_0xd420('0x5e')]({'where':{'id':_0x2716e5[_0xd420('0x58')]['id']}})['then'](handleEntityNotFound(_0x5a5fc2,null))[_0xd420('0x20')](function(_0x1f93c4){if(_0x1f93c4){return _0x1f93c4[_0xd420('0x6a')](_0x2716e5[_0xd420('0x42')][_0xd420('0x6b')]);}})[_0xd420('0x20')](respondWithStatusCode(_0x5a5fc2,null))[_0xd420('0x56')](handleError(_0x5a5fc2,null));};exports[_0xd420('0x6c')]=function(_0x5b8451,_0x1c6eea,_0x153d6d){if(_0x5b8451[_0xd420('0x63')]['id']){delete _0x5b8451[_0xd420('0x63')]['id'];}return db[_0xd420('0x3d')][_0xd420('0x5e')]({'where':{'id':_0x5b8451['params']['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x1c6eea,null))[_0xd420('0x20')](function(_0x50fd31){if(_0x50fd31){_0x5b8451[_0xd420('0x63')][_0xd420('0x66')]=_0x50fd31['id'];return db[_0xd420('0x6d')][_0xd420('0x5b')](_0x5b8451['body']);}})[_0xd420('0x20')](respondWithResult(_0x1c6eea,null))[_0xd420('0x56')](handleError(_0x1c6eea,null));};exports['getAnswers']=function(_0x208584,_0x4d1d86,_0x34774b){var _0x5a6bcb={'raw':![],'where':{}};var _0x41f069={};var _0x34ed8c={'count':0x0,'rows':[]};return db[_0xd420('0x3d')]['findOne']({'where':{'id':_0x208584[_0xd420('0x58')]['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x4d1d86,null))[_0xd420('0x20')](function(_0x29295b){if(_0x29295b){_0x41f069[_0xd420('0x41')]=_['keys'](db[_0xd420('0x6d')][_0xd420('0x3e')]);_0x41f069['query']=_[_0xd420('0x5a')](_0x208584[_0xd420('0x42')]);_0x41f069[_0xd420('0x43')]=_[_0xd420('0x45')](_0x41f069[_0xd420('0x41')],_0x41f069[_0xd420('0x42')]);_0x5a6bcb['attributes']=_[_0xd420('0x45')](_0x41f069[_0xd420('0x41')],qs['fields'](_0x208584['query']['fields']));_0x5a6bcb['attributes']=_0x5a6bcb[_0xd420('0x44')][_0xd420('0x47')]?_0x5a6bcb[_0xd420('0x44')]:_0x41f069[_0xd420('0x41')];if(!_0x208584['query'][_0xd420('0x48')](_0xd420('0x49'))){_0x5a6bcb[_0xd420('0x4a')]=qs[_0xd420('0x4a')](_0x208584['query'][_0xd420('0x4a')]);_0x5a6bcb['offset']=qs[_0xd420('0x2e')](_0x208584[_0xd420('0x42')]['offset']);}_0x5a6bcb[_0xd420('0x69')]=qs[_0xd420('0x4b')](_0x208584[_0xd420('0x42')]['sort']);_0x5a6bcb[_0xd420('0x4c')]=qs['filters'](_[_0xd420('0x4d')](_0x208584[_0xd420('0x42')],_0x41f069['filters']));_0x5a6bcb[_0xd420('0x4c')][_0xd420('0x66')]=_0x29295b['id'];if(_0x208584[_0xd420('0x42')][_0xd420('0x4e')]){_0x5a6bcb[_0xd420('0x4c')]=_[_0xd420('0x4f')](_0x5a6bcb['where'],{'$or':_['map'](_0x5a6bcb['attributes'],function(_0x466863){var _0x4fa994={};_0x4fa994[_0x466863]={'$like':'%'+_0x208584[_0xd420('0x42')][_0xd420('0x4e')]+'%'};return _0x4fa994;})});}_0x5a6bcb=_[_0xd420('0x4f')]({},_0x5a6bcb,_0x208584['options']);return db[_0xd420('0x6d')][_0xd420('0x2d')]({'where':_0x5a6bcb[_0xd420('0x4c')]})[_0xd420('0x20')](function(_0x23a995){_0x34ed8c[_0xd420('0x2d')]=_0x23a995;if(_0x208584[_0xd420('0x42')]['includeAll']){_0x5a6bcb[_0xd420('0x53')]=[{'all':!![]}];}return db[_0xd420('0x6d')][_0xd420('0x54')](_0x5a6bcb);})[_0xd420('0x20')](function(_0x4745d7){_0x34ed8c['rows']=_0x4745d7;return _0x34ed8c;});}})[_0xd420('0x20')](respondWithFilteredResult(_0x4d1d86,_0x5a6bcb))['catch'](handleError(_0x4d1d86,null));};exports[_0xd420('0x6e')]=function(_0x2154f2,_0x5288d3,_0x136fae){return db['WhatsappAccount']['find']({'where':{'id':_0x2154f2['params']['id']}})['then'](handleEntityNotFound(_0x5288d3,null))[_0xd420('0x20')](function(_0x10ff12){if(_0x10ff12){return _0x10ff12['removeAnswers'](_0x2154f2[_0xd420('0x42')][_0xd420('0x6b')]);}})[_0xd420('0x20')](respondWithStatusCode(_0x5288d3,null))[_0xd420('0x56')](handleError(_0x5288d3,null));};exports[_0xd420('0x6f')]=function(_0x4472f8,_0x405046,_0x504ae1){return db[_0xd420('0x3d')][_0xd420('0x5e')]({'where':{'id':_0x4472f8[_0xd420('0x58')]['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x405046,null))[_0xd420('0x20')](function(_0x17bbae){if(_0x17bbae){return _0x17bbae[_0xd420('0x6f')](_0x4472f8[_0xd420('0x63')][_0xd420('0x6b')],_[_0xd420('0x70')](_0x4472f8[_0xd420('0x63')],[_0xd420('0x6b'),'id'])||{})[_0xd420('0x71')](function(_0x494ffe){for(var _0x24157d=0x0;_0x24157d<_0x4472f8['body']['ids'][_0xd420('0x47')];_0x24157d+=0x1){socket[_0xd420('0x72')](_0xd420('0x73'),{'UserId':Number(_0x4472f8[_0xd420('0x63')][_0xd420('0x6b')][_0x24157d]),'WhatsappAccountId':Number(_0x4472f8['params']['id'])});}return _0x494ffe;});}})['then'](respondWithResult(_0x405046,null))[_0xd420('0x56')](handleError(_0x405046,null));};exports[_0xd420('0x74')]=function(_0x17b63e,_0x579108,_0x2cb05c){return db[_0xd420('0x3d')]['find']({'where':{'id':_0x17b63e[_0xd420('0x58')]['id']}})['then'](handleEntityNotFound(_0x579108,null))[_0xd420('0x20')](function(_0x361d26){if(_0x361d26){return _0x361d26[_0xd420('0x74')](_0x17b63e['query'][_0xd420('0x6b')])[_0xd420('0x20')](function(){if(_[_0xd420('0x75')](_0x17b63e[_0xd420('0x42')]['ids'])){for(var _0x48c7c1=0x0;_0x48c7c1<_0x17b63e['query'][_0xd420('0x6b')][_0xd420('0x47')];_0x48c7c1+=0x1){socket['emit'](_0xd420('0x76'),{'UserId':Number(_0x17b63e[_0xd420('0x42')][_0xd420('0x6b')][_0x48c7c1]),'WhatsappAccountId':Number(_0x17b63e[_0xd420('0x58')]['id'])});}}else{socket[_0xd420('0x72')](_0xd420('0x76'),{'UserId':Number(_0x17b63e[_0xd420('0x42')][_0xd420('0x6b')]),'WhatsappAccountId':Number(_0x17b63e[_0xd420('0x58')]['id'])});}});}})[_0xd420('0x20')](respondWithStatusCode(_0x579108,null))['catch'](handleError(_0x579108,null));};exports[_0xd420('0x77')]=function(_0x160e3b,_0x1f5435,_0x240a80){var _0x2863a3={};var _0x63f141={};var _0x3218f2;var _0x55cd55;return db[_0xd420('0x3d')]['findOne']({'where':{'id':_0x160e3b[_0xd420('0x58')]['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x1f5435,null))[_0xd420('0x20')](function(_0x189f74){if(_0x189f74){_0x3218f2=_0x189f74;_0x63f141[_0xd420('0x41')]=_[_0xd420('0x5a')](db[_0xd420('0x78')]['rawAttributes']);_0x63f141['query']=_[_0xd420('0x5a')](_0x160e3b[_0xd420('0x42')]);_0x63f141[_0xd420('0x43')]=_[_0xd420('0x45')](_0x63f141['model'],_0x63f141[_0xd420('0x42')]);_0x2863a3[_0xd420('0x44')]=_[_0xd420('0x45')](_0x63f141[_0xd420('0x41')],qs[_0xd420('0x46')](_0x160e3b[_0xd420('0x42')][_0xd420('0x46')]));_0x2863a3['attributes']=_0x2863a3[_0xd420('0x44')]['length']?_0x2863a3['attributes']:_0x63f141[_0xd420('0x41')];_0x2863a3[_0xd420('0x69')]=qs[_0xd420('0x4b')](_0x160e3b['query'][_0xd420('0x4b')]);_0x2863a3[_0xd420('0x4c')]=qs[_0xd420('0x43')](_[_0xd420('0x4d')](_0x160e3b[_0xd420('0x42')],_0x63f141[_0xd420('0x43')]));if(_0x160e3b[_0xd420('0x42')][_0xd420('0x4e')]){_0x2863a3[_0xd420('0x4c')]=_['merge'](_0x2863a3['where'],{'$or':_[_0xd420('0x3c')](_0x2863a3[_0xd420('0x44')],function(_0x2d76ed){var _0x2b48eb={};_0x2b48eb[_0x2d76ed]={'$like':'%'+_0x160e3b[_0xd420('0x42')][_0xd420('0x4e')]+'%'};return _0x2b48eb;})});}_0x2863a3=_[_0xd420('0x4f')]({},_0x2863a3,_0x160e3b[_0xd420('0x51')]);return _0x3218f2[_0xd420('0x77')](_0x2863a3);}})['then'](function(_0x3e8de4){if(_0x3e8de4){_0x55cd55=_0x3e8de4[_0xd420('0x47')];if(!_0x160e3b[_0xd420('0x42')]['hasOwnProperty'](_0xd420('0x49'))){_0x2863a3[_0xd420('0x4a')]=qs['limit'](_0x160e3b[_0xd420('0x42')][_0xd420('0x4a')]);_0x2863a3[_0xd420('0x2e')]=qs['offset'](_0x160e3b[_0xd420('0x42')][_0xd420('0x2e')]);}return _0x3218f2['getAgents'](_0x2863a3);}})[_0xd420('0x20')](function(_0x65e0c6){if(_0x65e0c6){return _0x65e0c6?{'count':_0x55cd55,'rows':_0x65e0c6}:null;}})[_0xd420('0x20')](respondWithResult(_0x1f5435,null))[_0xd420('0x56')](handleError(_0x1f5435,null));};exports['addApplications']=function(_0x330328,_0x4c880a){var _0x38dd69=_0x330328[_0xd420('0x58')]['id'];var _0x1465ad=_0x330328[_0xd420('0x63')];var _0x21bfbc=0xc8;var _0x220122=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xd420('0x79')][_0xd420('0x7a')][_0xd420('0x7b')]['READ_COMMITTED']},function(_0x1b82a5){return db['WhatsappAccount'][_0xd420('0x7c')]({'where':{'id':_0x38dd69},'transaction':_0x1b82a5})[_0xd420('0x20')](function(_0x40ee4c){if(_0x40ee4c){return db[_0xd420('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x38dd69},'transaction':_0x1b82a5})[_0xd420('0x20')](function(){var _0x19b492=_['map'](_0x1465ad,function(_0x1cb291){_0x1cb291['WhatsappAccountId']=_0x38dd69;return _0x1cb291;});return db[_0xd420('0x7d')][_0xd420('0x7e')](_0x19b492,{'transaction':_0x1b82a5});});}else{_0x21bfbc=0x194;_0x220122=[];}});})[_0xd420('0x20')](function(){if(_0x21bfbc!==0x194){return db[_0xd420('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x38dd69},'order':'priority'})[_0xd420('0x20')](function(_0x1367c8){_0x220122=_0x1367c8;});}})['catch'](function(_0xdf031d){_0x21bfbc=0x1f4;logger[_0xd420('0x25')](_0xdf031d[_0xd420('0x37')]);if(_0xdf031d['name']){delete _0xdf031d[_0xd420('0x38')];}_0x220122=_0xdf031d;})[_0xd420('0x7f')](function(){if(_0x220122===null){_0x4c880a[_0xd420('0x29')](_0x21bfbc);}else{if(_0x21bfbc===0x1f4){_0x4c880a[_0xd420('0x2a')](_0x21bfbc)[_0xd420('0x39')](_0x220122);}else{_0x4c880a[_0xd420('0x2a')](_0x21bfbc)[_0xd420('0x2b')](_0x220122);}}});};exports['getApplications']=function(_0x21b25b,_0x22d722,_0x14ef1f){var _0x37d4d1={};var _0x5f3de3={};var _0xe59b4b;var _0x48fb73;return db[_0xd420('0x3d')]['findOne']({'where':{'id':_0x21b25b['params']['id']}})[_0xd420('0x20')](handleEntityNotFound(_0x22d722,null))[_0xd420('0x20')](function(_0x17e635){if(_0x17e635){_0xe59b4b=_0x17e635;_0x5f3de3[_0xd420('0x41')]=_[_0xd420('0x5a')](db['WhatsappApplication'][_0xd420('0x3e')]);_0x5f3de3[_0xd420('0x42')]=_[_0xd420('0x5a')](_0x21b25b['query']);_0x5f3de3[_0xd420('0x43')]=_[_0xd420('0x45')](_0x5f3de3[_0xd420('0x41')],_0x5f3de3['query']);_0x37d4d1['attributes']=_[_0xd420('0x45')](_0x5f3de3[_0xd420('0x41')],qs[_0xd420('0x46')](_0x21b25b[_0xd420('0x42')][_0xd420('0x46')]));_0x37d4d1[_0xd420('0x44')]=_0x37d4d1[_0xd420('0x44')][_0xd420('0x47')]?_0x37d4d1[_0xd420('0x44')]:_0x5f3de3[_0xd420('0x41')];_0x37d4d1[_0xd420('0x69')]=qs[_0xd420('0x4b')](_0x21b25b[_0xd420('0x42')][_0xd420('0x4b')]);_0x37d4d1[_0xd420('0x4c')]=qs[_0xd420('0x43')](_[_0xd420('0x4d')](_0x21b25b[_0xd420('0x42')],_0x5f3de3[_0xd420('0x43')]));if(_0x21b25b[_0xd420('0x42')][_0xd420('0x4e')]){_0x37d4d1[_0xd420('0x4c')]=_[_0xd420('0x4f')](_0x37d4d1['where'],{'$or':_[_0xd420('0x3c')](_0x37d4d1[_0xd420('0x44')],function(_0x15041f){var _0x14a1b5={};_0x14a1b5[_0x15041f]={'$like':'%'+_0x21b25b[_0xd420('0x42')][_0xd420('0x4e')]+'%'};return _0x14a1b5;})});}_0x37d4d1=_[_0xd420('0x4f')]({},_0x37d4d1,_0x21b25b[_0xd420('0x51')]);return _0xe59b4b[_0xd420('0x80')](_0x37d4d1);}})[_0xd420('0x20')](function(_0x2b9a59){if(_0x2b9a59){_0x48fb73=_0x2b9a59['length'];if(!_0x21b25b[_0xd420('0x42')][_0xd420('0x48')](_0xd420('0x49'))){_0x37d4d1[_0xd420('0x4a')]=qs['limit'](_0x21b25b[_0xd420('0x42')][_0xd420('0x4a')]);_0x37d4d1[_0xd420('0x2e')]=qs[_0xd420('0x2e')](_0x21b25b[_0xd420('0x42')][_0xd420('0x2e')]);}return _0xe59b4b[_0xd420('0x80')](_0x37d4d1);}})[_0xd420('0x20')](function(_0x379cda){if(_0x379cda){return _0x379cda?{'count':_0x48fb73,'rows':_0x379cda}:null;}})['then'](respondWithResult(_0x22d722,null))[_0xd420('0x56')](handleError(_0x22d722,null));};exports[_0xd420('0x81')]=function(_0x4bcdc5,_0x4c3968,_0x1e4784){var _0x3f62d7={'channel':_0xd420('0x82')};var _0x3584bf=[];var _0xfd58e5=[];var _0x8355ff={};return db[_0xd420('0x3d')]['find']({'where':{'id':_0x4bcdc5['params']['id']},'include':[{'model':db[_0xd420('0x7d')],'as':_0xd420('0x83')}]})[_0xd420('0x20')](handleEntityNotFound(_0x4c3968,null))[_0xd420('0x20')](function(_0x2ada63){_0x3f62d7[_0xd420('0x84')]=_0x2ada63;if(_0x3f62d7[_0xd420('0x84')]&&_0x3f62d7['account'][_0xd420('0x40')]===_0xd420('0x85')&&_0x4bcdc5[_0xd420('0x63')][_0xd420('0x86')]){if(_0x4bcdc5[_0xd420('0x63')][_0xd420('0x86')][_0xd420('0x47')]===0x0)return;if(_0x4bcdc5[_0xd420('0x63')][_0xd420('0x86')][0x0][_0xd420('0x87')]!==_0xd420('0x88'))return;return db['WhatsappMessage'][_0xd420('0x62')]({'read':!![],'readAt':_0x4bcdc5[_0xd420('0x63')][_0xd420('0x86')][0x0]['timestamp']},{'where':{'messageId':_0x4bcdc5[_0xd420('0x63')][_0xd420('0x86')][0x0]['message_id']},'individualHooks':!![]})[_0xd420('0x20')](function(_0x25c0c4){return _0x4c3968[_0xd420('0x2a')](0xc8)[_0xd420('0x2b')](_0x25c0c4);});}_0x3f62d7[_0xd420('0x89')]=_[_0xd420('0x8a')](_0x2ada63[_0xd420('0x83')],[_0xd420('0x8b')],[_0xd420('0x8c')]);if(_0x3f62d7[_0xd420('0x84')][_0xd420('0x83')]){delete _0x3f62d7[_0xd420('0x84')][_0xd420('0x83')];}return db[_0xd420('0x8d')]['describe']()[_0xd420('0x20')](function(_0x5a10fd){if(!_0x5a10fd){throw new db[(_0xd420('0x8e'))][(_0xd420('0x8f'))](_0xd420('0x90'));}_0x3584bf=_[_0xd420('0x91')](_['keys'](_0x5a10fd),['createdAt',_0xd420('0x92')]);_0xfd58e5=_['difference'](_[_0xd420('0x5a')](_0x5a10fd),[_0xd420('0x93'),_0xd420('0x92'),_0xd420('0x94'),_0xd420('0x95')]);_0x3f62d7[_0xd420('0x63')]={'mapKey':_0xd420('0x96')};if(_0x3f62d7[_0xd420('0x84')]&&_0x3f62d7['account'][_0xd420('0x40')]===_0xd420('0x97')){_0x3f62d7['body'][_0xd420('0x98')]=_0x4bcdc5[_0xd420('0x63')][_0xd420('0x99')][_0xd420('0x9a')]('whatsapp:','');_0x3f62d7[_0xd420('0x63')]['body']=_0x4bcdc5[_0xd420('0x63')][_0xd420('0x9b')];_0x3f62d7['body'][_0xd420('0x9c')]=_0x4bcdc5[_0xd420('0x63')]['MessageSid'];}if(_0x3f62d7[_0xd420('0x84')]&&_0x3f62d7[_0xd420('0x84')]['type']===_0xd420('0x85')){_0x3f62d7[_0xd420('0x63')][_0xd420('0x98')]=_0x4bcdc5[_0xd420('0x63')][_0xd420('0x9d')][0x0]['from'];_0x3f62d7['body'][_0xd420('0x63')]=_0x4bcdc5[_0xd420('0x63')][_0xd420('0x9d')][0x0][_0xd420('0x28')][_0xd420('0x63')];_0x3f62d7[_0xd420('0x63')][_0xd420('0x9c')]=_0x4bcdc5[_0xd420('0x63')][_0xd420('0x9d')][0x0]['message_id'];}if(_0x3f62d7[_0xd420('0x63')]['id']){delete _0x3f62d7[_0xd420('0x63')]['id'];}if(_[_0xd420('0x9e')](_0x3f62d7[_0xd420('0x63')][_0xd420('0x98')])){throw new db['Sequelize'][(_0xd420('0x8f'))]('from\x20is\x20mandatory');}if(_[_0xd420('0x9e')](_0x3f62d7[_0xd420('0x63')][_0xd420('0x63')])||_0x3f62d7['body'][_0xd420('0x63')]===''){throw new db[(_0xd420('0x8e'))][(_0xd420('0x8f'))](_0xd420('0x9f'));}if(_['isNil'](_0x3f62d7['body'][_0xd420('0xa0')])){throw new db[(_0xd420('0x8e'))][(_0xd420('0x8f'))](_0xd420('0xa1')+_0xfd58e5);}if(!_[_0xd420('0xa2')](_0xfd58e5,_0x3f62d7['body'][_0xd420('0xa0')])){throw new db['Sequelize'][(_0xd420('0x8f'))](_0xd420('0xa3')+_0xfd58e5);}_0x8355ff[_0x3f62d7[_0xd420('0x63')][_0xd420('0xa0')]]=_0x3f62d7[_0xd420('0x63')]['from'];return db[_0xd420('0xa4')][_0xd420('0x5e')]({'where':{'id':_0x3f62d7[_0xd420('0x84')][_0xd420('0x95')]},'include':[{'model':db[_0xd420('0x8d')],'as':_0xd420('0xa5'),'where':_0x8355ff,'limit':0x1,'order':[[_0xd420('0x92'),_0xd420('0xa6')]]}]});})[_0xd420('0x20')](handleEntityNotFound(_0x4c3968,null))[_0xd420('0x20')](function(_0x8f2edf){if(_0x8f2edf){_0x3f62d7[_0xd420('0xa7')]=_[_0xd420('0x70')](_0x8f2edf,[_0xd420('0xa5')]);if(_0x8f2edf[_0xd420('0xa5')]['length']){return _0x8f2edf[_0xd420('0xa5')][0x0];}var _0x22dab6=_[_0xd420('0x1c')](_0x3f62d7[_0xd420('0x63')],{'firstName':_0x3f62d7[_0xd420('0x63')]['from'],'ListId':_0x8f2edf['id']});_0x22dab6[_0x3f62d7[_0xd420('0x63')][_0xd420('0xa0')]]=_0x3f62d7[_0xd420('0x63')]['from'];return db['CmContact'][_0xd420('0x5b')](_0x22dab6,{'fields':_0x3584bf,'raw':!![]});}})[_0xd420('0x20')](handleEntityNotFound(_0x4c3968,null))[_0xd420('0x20')](function(_0x3ac76d){if(_0x3ac76d){_0x3f62d7[_0xd420('0xa8')]=_0x3ac76d;var _0x14e4dc={'ContactId':_0x3ac76d['id'],'phone':_0x3f62d7['body'][_0xd420('0x98')],'WhatsappAccountId':_0x4bcdc5[_0xd420('0x58')]['id']};var _0x3e8752={'ContactId':_0x3ac76d['id'],'WhatsappAccountId':_0x4bcdc5[_0xd420('0x58')]['id'],'closed':![]};return db[_0xd420('0xa9')][_0xd420('0x5e')]({'where':_0x3e8752})[_0xd420('0x20')](function(_0x19e254){if(_0x19e254){return[_0x19e254,![]];}return db['WhatsappInteraction'][_0xd420('0x5b')](_0x14e4dc)['then'](function(_0x3982cb){return[_0x3982cb,!![]];});});}})[_0xd420('0x71')](function(_0x5b8ac4,_0x33759e){_0x3f62d7['interaction']=_0x5b8ac4[_0xd420('0x33')]({'plain':!![]});_0x3f62d7[_0xd420('0xaa')]['created']=![];if(_0x33759e){if(_0x3f62d7['account'][_0xd420('0xab')]){_0x3f62d7[_0xd420('0x89')][_0xd420('0xac')]({'id':0x0,'priority':_0x3f62d7[_0xd420('0x89')][_0xd420('0x47')]+0x1,'app':_0xd420('0xad'),'appdata':_0xd420('0xae'),'interval':_0xd420('0xaf')});}_0x3f62d7['interaction'][_0xd420('0xb0')]=!![];}return db[_0xd420('0xb1')]['create']({'phone':_0x3f62d7[_0xd420('0x63')][_0xd420('0x98')],'messageId':_0x3f62d7[_0xd420('0x63')][_0xd420('0x9c')],'body':_0x3f62d7['body'][_0xd420('0x63')],'WhatsappAccountId':_0x4bcdc5[_0xd420('0x58')]['id'],'WhatsappInteractionId':_0x5b8ac4['id'],'direction':'in','ContactId':_0x5b8ac4[_0xd420('0xb2')],'AttachmentId':_0x3f62d7['body'][_0xd420('0xb3')]});})[_0xd420('0x20')](function(_0x57e4c1){_0x3f62d7['message']=_0x57e4c1;if(_0x3f62d7[_0xd420('0xaa')][_0xd420('0xb4')]){return db[_0xd420('0x78')]['find']({'attributes':['id',_0xd420('0x38')],'where':{'id':_0x3f62d7[_0xd420('0xaa')]['UserId']}})[_0xd420('0x20')](function(_0x537962){if(_0x537962){_0x3f62d7[_0xd420('0x89')][_0xd420('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x537962['name']+','+(_0x3f62d7[_0xd420('0x84')][_0xd420('0xb6')]||0xa),'interval':_0xd420('0xaf')});}return respondWithRpcPromise(_0xd420('0xb7'),_0xd420('0xb8'),_0x3f62d7);});}return respondWithRpcPromise(_0xd420('0xb7'),_0xd420('0xb8'),_0x3f62d7);})[_0xd420('0x20')](function(_0xaefaac){if(_0xaefaac){var _0x504305=0xc8;var _0x484dee=_0xd420('0xb9');logger[_0xd420('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x484dee,_0x504305,'entity\x20found');logger[_0xd420('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x484dee,_0x504305,_0xd420('0xba'),JSON[_0xd420('0xbb')](_0xaefaac));if(_0x3f62d7['account'][_0xd420('0x40')]===_0xd420('0x97')){return _0x4c3968[_0xd420('0x2a')](_0x504305)[_0xd420('0x2f')](_0xd420('0xbc'),_0xd420('0xbd'))[_0xd420('0x39')](_0xd420('0xbe'));}else{return _0x4c3968['status'](_0x504305)['json'](_0xaefaac);}}});})[_0xd420('0x56')](handleError(_0x4c3968,null));};exports[_0xd420('0x39')]=function(_0x29cd65,_0x191e04,_0x29e4e0){var _0x5015a1,_0x444acd,_0x3c7d5c;if(_[_0xd420('0x9e')](_0x29cd65[_0xd420('0x63')][_0xd420('0x63')])||_0x29cd65[_0xd420('0x63')][_0xd420('0x63')]===''){throw new db[(_0xd420('0x8e'))]['ValidationError'](_0xd420('0x9f'));}if(_[_0xd420('0x9e')](_0x29cd65[_0xd420('0x63')]['to'])){throw new db[(_0xd420('0x8e'))]['ValidationError'](_0xd420('0xbf'));}_0x5015a1=_0x29cd65[_0xd420('0x63')]['to'];return db[_0xd420('0x3d')][_0xd420('0x5e')]({'where':{'id':_0x29cd65[_0xd420('0x58')]['id']},'include':[{'model':db[_0xd420('0xa4')],'as':_0xd420('0xc0'),'include':[{'model':db['CmContact'],'as':_0xd420('0xa5'),'where':{'mobile':_0x5015a1},'limit':0x1,'order':[['updatedAt',_0xd420('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x191e04,null))['then'](function(_0x5c9586){if(_0x5c9586&&_0x5c9586[_0xd420('0xc0')]){_0x444acd=_0x5c9586[_0xd420('0x33')]({'plain':!![]});if(_0x444acd['List']&&_0x444acd[_0xd420('0xc0')][_0xd420('0xa5')][_0xd420('0x47')]){return _0x444acd[_0xd420('0xc0')]['Contacts'][0x0];}return db[_0xd420('0x8d')][_0xd420('0x5b')](_[_0xd420('0x1c')](_0x29cd65[_0xd420('0x63')],{'firstName':_0x5015a1,'mobile':_0x5015a1,'phone':_0x5015a1,'ListId':_0x444acd[_0xd420('0x95')]}));}})[_0xd420('0x20')](handleEntityNotFound(_0x191e04,null))[_0xd420('0x20')](function(_0x49342d){if(_0x49342d){_0x3c7d5c=_0x49342d;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x3c7d5c['id'],'closed':![],'WhatsappAccountId':_0x444acd['id']}})['then'](function(_0x1509fe){if(_0x1509fe){return[_0x1509fe,![]];}return db[_0xd420('0xa9')][_0xd420('0x5b')]({'UserId':_0x29cd65[_0xd420('0xc1')]['id'],'ContactId':_0x3c7d5c['id'],'WhatsappAccountId':_0x444acd['id'],'phone':_0x5015a1,'firstMsgDirection':_0xd420('0xc2'),'Messages':[_[_0xd420('0x4f')](_0x29cd65[_0xd420('0x63')],{'read':![],'body':_0x29cd65[_0xd420('0x63')][_0xd420('0x63')],'phone':_0x5015a1,'WhatsappAccountId':_0x444acd['id'],'UserId':_0x29cd65[_0xd420('0xc1')]['id'],'ContactId':_0x3c7d5c['id']})]},{'include':[{'model':db[_0xd420('0xb1')],'as':_0xd420('0xc3')}]})['then'](function(_0x1f5e06){return[_0x1f5e06,!![]];});});}})[_0xd420('0x71')](function(_0x50a970,_0xb9cab4){if(_0xb9cab4){return _0x50a970;}return db['WhatsappMessage'][_0xd420('0x5b')](_[_0xd420('0x4f')](_0x29cd65[_0xd420('0x63')],{'read':![],'body':_0x29cd65[_0xd420('0x63')][_0xd420('0x63')],'phone':_0x5015a1,'WhatsappAccountId':_0x444acd['id'],'WhatsappInteractionId':_0x50a970['id'],'UserId':_0x29cd65[_0xd420('0xc1')]['id'],'ContactId':_0x3c7d5c['id']}))[_0xd420('0x20')](function(_0x303b96){_0x50a970[_0xd420('0xc4')][_0xd420('0xc3')]=[];_0x50a970[_0xd420('0xc4')][_0xd420('0xc3')][_0xd420('0xac')](_0x303b96[_0xd420('0xc4')]);return _0x50a970;});})[_0xd420('0x20')](respondWithResult(_0x191e04,null))[_0xd420('0x56')](handleError(_0x191e04,null));}; \ No newline at end of file +var _0x14ed=['Transaction','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','json','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','mobile','twilio','from','whatsapp:','Body','messageId','MessageSid','notifications','isNil','Sequelize','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','Contacts','defaults','contact','WhatsappInteraction','spread','interaction','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','client','request','then','info','request\x20sent','debug','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','map','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','getAgents','User','addApplications','sequelize','transaction'];(function(_0x311f12,_0x447e2c){var _0x509d98=function(_0xc9e360){while(--_0xc9e360){_0x311f12['push'](_0x311f12['shift']());}};_0x509d98(++_0x447e2c);}(_0x14ed,0x1c1));var _0xd14e=function(_0x28ca12,_0x4e023b){_0x28ca12=_0x28ca12-0x0;var _0x352f8b=_0x14ed[_0x28ca12];return _0x352f8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd14e('0x0'));var zipdir=require(_0xd14e('0x1'));var jsonpatch=require(_0xd14e('0x2'));var rp=require('request-promise');var moment=require(_0xd14e('0x3'));var BPromise=require(_0xd14e('0x4'));var Mustache=require(_0xd14e('0x5'));var util=require('util');var path=require(_0xd14e('0x6'));var sox=require(_0xd14e('0x7'));var csv=require('to-csv');var ejs=require(_0xd14e('0x8'));var fs=require('fs');var fs_extra=require(_0xd14e('0x9'));var _=require(_0xd14e('0xa'));var squel=require('squel');var crypto=require(_0xd14e('0xb'));var jsforce=require(_0xd14e('0xc'));var deskjs=require(_0xd14e('0xd'));var toCsv=require(_0xd14e('0xe'));var querystring=require(_0xd14e('0xf'));var Papa=require(_0xd14e('0x10'));var Redis=require(_0xd14e('0x11'));var authService=require(_0xd14e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd14e('0x13'))(_0xd14e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd14e('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd14e('0x16')],{'host':_0xd14e('0x17'),'port':0x18eb});var socket=require(_0xd14e('0x18'))(new Redis(config[_0xd14e('0x16')]));require(_0xd14e('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd14e('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x37395d,_0x271442,_0x12ca08,_0x59b072){return new BPromise(function(_0x3c8407,_0xf1aa81){var _0x3a5526=_0x59b072||client;return _0x3a5526[_0xd14e('0x1b')](_0x37395d,_0x12ca08)[_0xd14e('0x1c')](function(_0x155ea4){logger[_0xd14e('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x271442,_0xd14e('0x1e'));logger[_0xd14e('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x271442,'request\x20sent',JSON[_0xd14e('0x20')](_0x155ea4));if(_0x155ea4[_0xd14e('0x21')]){if(_0x155ea4['error']['code']===0x1f4){logger[_0xd14e('0x21')](_0xd14e('0x22'),_0x271442,_0x155ea4[_0xd14e('0x21')][_0xd14e('0x23')]);return _0xf1aa81(_0x155ea4[_0xd14e('0x21')][_0xd14e('0x23')]);}logger[_0xd14e('0x21')](_0xd14e('0x22'),_0x271442,_0x155ea4[_0xd14e('0x21')][_0xd14e('0x23')]);return _0x3c8407(_0x155ea4[_0xd14e('0x21')][_0xd14e('0x23')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x271442,_0xd14e('0x1e'));_0x3c8407(_0x155ea4[_0xd14e('0x24')][_0xd14e('0x23')]);}})[_0xd14e('0x25')](function(_0x1454a9){logger[_0xd14e('0x21')](_0xd14e('0x22'),_0x271442,_0x1454a9);_0xf1aa81(_0x1454a9);});});}function respondWithStatusCode(_0x23ae6b,_0x158f2e){_0x158f2e=_0x158f2e||0xcc;return function(_0x424738){if(_0x424738){return _0x23ae6b[_0xd14e('0x26')](_0x158f2e);}return _0x23ae6b[_0xd14e('0x27')](_0x158f2e)[_0xd14e('0x28')]();};}function respondWithResult(_0x5f9a38,_0xe57df6){_0xe57df6=_0xe57df6||0xc8;return function(_0x2b78ad){if(_0x2b78ad){return _0x5f9a38['status'](_0xe57df6)['json'](_0x2b78ad);}};}function respondWithFilteredResult(_0x3284ee,_0x5f4a79){return function(_0x233464){if(_0x233464){var _0x2c07e8=typeof _0x5f4a79[_0xd14e('0x29')]==='undefined'&&typeof _0x5f4a79[_0xd14e('0x2a')]===_0xd14e('0x2b');var _0x1a3e86=_0x233464[_0xd14e('0x2c')];var _0x3ca6d2=_0x2c07e8?0x0:_0x5f4a79[_0xd14e('0x29')];var _0x2a270b=_0x2c07e8?_0x233464[_0xd14e('0x2c')]:_0x5f4a79[_0xd14e('0x29')]+_0x5f4a79[_0xd14e('0x2a')];var _0x395f99;if(_0x2a270b>=_0x1a3e86){_0x2a270b=_0x1a3e86;_0x395f99=0xc8;}else{_0x395f99=0xce;}_0x3284ee[_0xd14e('0x27')](_0x395f99);return _0x3284ee[_0xd14e('0x2d')](_0xd14e('0x2e'),_0x3ca6d2+'-'+_0x2a270b+'/'+_0x1a3e86)['json'](_0x233464);}return null;};}function patchUpdates(_0x4d8723){return function(_0x3a5a0e){try{jsonpatch[_0xd14e('0x2f')](_0x3a5a0e,_0x4d8723,!![]);}catch(_0x3eeb86){return BPromise['reject'](_0x3eeb86);}return _0x3a5a0e[_0xd14e('0x30')]();};}function saveUpdates(_0x470ef6,_0x4fcd0c){return function(_0x44be58){if(_0x44be58){return _0x44be58[_0xd14e('0x31')](_0x470ef6)[_0xd14e('0x1c')](function(_0x2a5d92){return _0x2a5d92;});}return null;};}function removeEntity(_0x58de18,_0x39ccf0){return function(_0x2b0c1c){if(_0x2b0c1c){return _0x2b0c1c['destroy']()[_0xd14e('0x1c')](function(){var _0x24c13b=_0x2b0c1c[_0xd14e('0x32')]({'plain':!![]});var _0x2131e3=_0xd14e('0x33');return db[_0xd14e('0x34')][_0xd14e('0x35')]({'where':{'type':_0x2131e3,'resourceId':_0x24c13b['id']}})[_0xd14e('0x1c')](function(){return _0x2b0c1c;});})[_0xd14e('0x1c')](function(){_0x58de18['status'](0xcc)[_0xd14e('0x28')]();});}};}function handleEntityNotFound(_0x79f63f,_0x2947a2){return function(_0xc6c345){if(!_0xc6c345){_0x79f63f[_0xd14e('0x26')](0x194);}return _0xc6c345;};}function handleError(_0x1cabe3,_0x4958d6){_0x4958d6=_0x4958d6||0x1f4;return function(_0x5a4605){logger['error'](_0x5a4605[_0xd14e('0x36')]);if(_0x5a4605[_0xd14e('0x37')]){delete _0x5a4605[_0xd14e('0x37')];}_0x1cabe3[_0xd14e('0x27')](_0x4958d6)[_0xd14e('0x38')](_0x5a4605);};}exports[_0xd14e('0x39')]=function(_0x20ce9f,_0x5ebc5e){var _0x2a02e6={'include':[{'model':db[_0xd14e('0x3a')],'as':_0xd14e('0x3b')}]},_0x15a421={},_0x37d745={'count':0x0,'rows':[]};var _0x59335d=_['map'](db[_0xd14e('0x3c')][_0xd14e('0x3d')],function(_0x320256){return{'name':_0x320256[_0xd14e('0x3e')],'type':_0x320256[_0xd14e('0x3f')][_0xd14e('0x40')]};});_0x15a421[_0xd14e('0x41')]=_['map'](_0x59335d,'name');_0x15a421[_0xd14e('0x42')]=_[_0xd14e('0x43')](_0x20ce9f['query']);_0x15a421[_0xd14e('0x44')]=_[_0xd14e('0x45')](_0x15a421[_0xd14e('0x41')],_0x15a421[_0xd14e('0x42')]);_0x2a02e6['attributes']=_[_0xd14e('0x45')](_0x15a421[_0xd14e('0x41')],qs[_0xd14e('0x46')](_0x20ce9f[_0xd14e('0x42')][_0xd14e('0x46')]));_0x2a02e6[_0xd14e('0x47')]=_0x2a02e6[_0xd14e('0x47')][_0xd14e('0x48')]?_0x2a02e6[_0xd14e('0x47')]:_0x15a421[_0xd14e('0x41')];if(!_0x20ce9f[_0xd14e('0x42')]['hasOwnProperty'](_0xd14e('0x49'))){_0x2a02e6[_0xd14e('0x2a')]=qs[_0xd14e('0x2a')](_0x20ce9f[_0xd14e('0x42')][_0xd14e('0x2a')]);_0x2a02e6[_0xd14e('0x29')]=qs[_0xd14e('0x29')](_0x20ce9f['query']['offset']);}_0x2a02e6[_0xd14e('0x4a')]=qs[_0xd14e('0x4b')](_0x20ce9f['query'][_0xd14e('0x4b')]);_0x2a02e6['where']=qs[_0xd14e('0x44')](_['pick'](_0x20ce9f['query'],_0x15a421['filters']),_0x59335d);if(_0x20ce9f[_0xd14e('0x42')][_0xd14e('0x4c')]){_0x2a02e6['where']=_[_0xd14e('0x4d')](_0x2a02e6[_0xd14e('0x4e')],{'$or':_['map'](_0x59335d,function(_0x593137){if(_0x593137['type']!==_0xd14e('0x4f')){var _0x10632c={};_0x10632c[_0x593137[_0xd14e('0x37')]]={'$like':'%'+_0x20ce9f[_0xd14e('0x42')][_0xd14e('0x4c')]+'%'};return _0x10632c;}})});}_0x2a02e6=_[_0xd14e('0x4d')]({},_0x2a02e6,_0x20ce9f[_0xd14e('0x50')]);var _0x4f75b6={'where':_0x2a02e6['where']};return db['WhatsappAccount'][_0xd14e('0x2c')](_0x4f75b6)['then'](function(_0x57c112){_0x37d745[_0xd14e('0x2c')]=_0x57c112;if(_0x20ce9f[_0xd14e('0x42')][_0xd14e('0x51')]){_0x2a02e6[_0xd14e('0x52')]=[{'all':!![]}];}return db[_0xd14e('0x3c')][_0xd14e('0x53')](_0x2a02e6);})[_0xd14e('0x1c')](function(_0x2d4493){_0x37d745[_0xd14e('0x54')]=_0x2d4493;return _0x37d745;})[_0xd14e('0x1c')](respondWithFilteredResult(_0x5ebc5e,_0x2a02e6))[_0xd14e('0x25')](handleError(_0x5ebc5e,null));};exports[_0xd14e('0x55')]=function(_0x5c61b7,_0x3a1323){var _0x3d3aaf={'raw':![],'where':{'id':_0x5c61b7['params']['id']},'include':[{'model':db[_0xd14e('0x3a')],'as':_0xd14e('0x3b')}]},_0x278b75={};_0x278b75[_0xd14e('0x41')]=_[_0xd14e('0x43')](db[_0xd14e('0x3c')][_0xd14e('0x3d')]);_0x278b75[_0xd14e('0x42')]=_[_0xd14e('0x43')](_0x5c61b7[_0xd14e('0x42')]);_0x278b75['filters']=_[_0xd14e('0x45')](_0x278b75['model'],_0x278b75[_0xd14e('0x42')]);_0x3d3aaf[_0xd14e('0x47')]=_[_0xd14e('0x45')](_0x278b75[_0xd14e('0x41')],qs[_0xd14e('0x46')](_0x5c61b7[_0xd14e('0x42')][_0xd14e('0x46')]));_0x3d3aaf['attributes']=_0x3d3aaf[_0xd14e('0x47')]['length']?_0x3d3aaf['attributes']:_0x278b75[_0xd14e('0x41')];if(_0x5c61b7[_0xd14e('0x42')][_0xd14e('0x51')]){_0x3d3aaf[_0xd14e('0x52')]=[{'all':!![]}];}_0x3d3aaf=_[_0xd14e('0x4d')]({},_0x3d3aaf,_0x5c61b7[_0xd14e('0x50')]);return db[_0xd14e('0x3c')][_0xd14e('0x56')](_0x3d3aaf)[_0xd14e('0x1c')](handleEntityNotFound(_0x3a1323,null))[_0xd14e('0x1c')](respondWithResult(_0x3a1323,null))[_0xd14e('0x25')](handleError(_0x3a1323,null));};exports[_0xd14e('0x57')]=function(_0x56d566,_0x5863a6){return db['WhatsappAccount']['create'](_0x56d566['body'],{})[_0xd14e('0x1c')](function(_0x649cf0){var _0x44bd3d=_0x56d566[_0xd14e('0x58')][_0xd14e('0x32')]({'plain':!![]});if(!_0x44bd3d)throw new Error(_0xd14e('0x59'));if(_0x44bd3d['role']===_0xd14e('0x58')){var _0x293cbd=_0x649cf0['get']({'plain':!![]});var _0x36c2d5='WhatsappAccounts';return db[_0xd14e('0x5a')]['find']({'where':{'name':_0x36c2d5,'userProfileId':_0x44bd3d[_0xd14e('0x5b')]},'raw':!![]})[_0xd14e('0x1c')](function(_0x2f553d){if(_0x2f553d&&_0x2f553d[_0xd14e('0x5c')]===0x0){return db[_0xd14e('0x34')][_0xd14e('0x57')]({'name':_0x293cbd[_0xd14e('0x37')],'resourceId':_0x293cbd['id'],'type':_0x2f553d[_0xd14e('0x37')],'sectionId':_0x2f553d['id']},{})[_0xd14e('0x1c')](function(){return _0x649cf0;});}else{return _0x649cf0;}})[_0xd14e('0x25')](function(_0x224f57){logger[_0xd14e('0x21')](_0xd14e('0x5d'),_0x224f57);throw _0x224f57;});}return _0x649cf0;})[_0xd14e('0x1c')](respondWithResult(_0x5863a6,0xc9))[_0xd14e('0x25')](handleError(_0x5863a6,null));};exports[_0xd14e('0x31')]=function(_0x4fe7b6,_0x192363){if(_0x4fe7b6['body']['id']){delete _0x4fe7b6[_0xd14e('0x5e')]['id'];}return db[_0xd14e('0x3c')][_0xd14e('0x56')]({'where':{'id':_0x4fe7b6[_0xd14e('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0xd14e('0x3b')}]})[_0xd14e('0x1c')](handleEntityNotFound(_0x192363,null))[_0xd14e('0x1c')](saveUpdates(_0x4fe7b6[_0xd14e('0x5e')],null))[_0xd14e('0x1c')](respondWithResult(_0x192363,null))[_0xd14e('0x25')](handleError(_0x192363,null));};exports['destroy']=function(_0x37d3d1,_0x3cd28b){return db[_0xd14e('0x3c')][_0xd14e('0x56')]({'where':{'id':_0x37d3d1[_0xd14e('0x5f')]['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x3cd28b,null))[_0xd14e('0x1c')](removeEntity(_0x3cd28b,null))[_0xd14e('0x25')](handleError(_0x3cd28b,null));};exports['describe']=function(_0x21c435,_0x81f290){return db[_0xd14e('0x3c')][_0xd14e('0x60')]()[_0xd14e('0x1c')](respondWithResult(_0x81f290,null))[_0xd14e('0x25')](handleError(_0x81f290,null));};exports[_0xd14e('0x61')]=function(_0x24721f,_0x540469,_0x59425f){if(_0x24721f['body']['id']){delete _0x24721f[_0xd14e('0x5e')]['id'];}return db['WhatsappAccount'][_0xd14e('0x56')]({'where':{'id':_0x24721f[_0xd14e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x540469,null))[_0xd14e('0x1c')](function(_0x43a579){if(_0x43a579){_0x24721f[_0xd14e('0x5e')][_0xd14e('0x62')]=_0x43a579['id'];return db[_0xd14e('0x63')]['create'](_0x24721f[_0xd14e('0x5e')]);}})['then'](respondWithResult(_0x540469,null))[_0xd14e('0x25')](handleError(_0x540469,null));};exports[_0xd14e('0x64')]=function(_0x7cced6,_0x3ec2f4,_0x22918b){var _0x320bb5={'raw':![],'where':{}};var _0x3d48eb={};var _0x2d34bd={'count':0x0,'rows':[]};return db[_0xd14e('0x3c')][_0xd14e('0x65')]({'where':{'id':_0x7cced6['params']['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x3ec2f4,null))[_0xd14e('0x1c')](function(_0x5443d8){if(_0x5443d8){_0x3d48eb['model']=_[_0xd14e('0x43')](db[_0xd14e('0x63')][_0xd14e('0x3d')]);_0x3d48eb[_0xd14e('0x42')]=_[_0xd14e('0x43')](_0x7cced6[_0xd14e('0x42')]);_0x3d48eb['filters']=_['intersection'](_0x3d48eb[_0xd14e('0x41')],_0x3d48eb[_0xd14e('0x42')]);_0x320bb5[_0xd14e('0x47')]=_[_0xd14e('0x45')](_0x3d48eb[_0xd14e('0x41')],qs[_0xd14e('0x46')](_0x7cced6[_0xd14e('0x42')]['fields']));_0x320bb5[_0xd14e('0x47')]=_0x320bb5['attributes'][_0xd14e('0x48')]?_0x320bb5[_0xd14e('0x47')]:_0x3d48eb['model'];if(!_0x7cced6[_0xd14e('0x42')][_0xd14e('0x66')](_0xd14e('0x49'))){_0x320bb5[_0xd14e('0x2a')]=qs[_0xd14e('0x2a')](_0x7cced6[_0xd14e('0x42')][_0xd14e('0x2a')]);_0x320bb5[_0xd14e('0x29')]=qs[_0xd14e('0x29')](_0x7cced6[_0xd14e('0x42')]['offset']);}_0x320bb5['order']=qs[_0xd14e('0x4b')](_0x7cced6[_0xd14e('0x42')][_0xd14e('0x4b')]);_0x320bb5[_0xd14e('0x4e')]=qs[_0xd14e('0x44')](_[_0xd14e('0x67')](_0x7cced6[_0xd14e('0x42')],_0x3d48eb['filters']));_0x320bb5[_0xd14e('0x4e')][_0xd14e('0x62')]=_0x5443d8['id'];if(_0x7cced6['query'][_0xd14e('0x4c')]){_0x320bb5[_0xd14e('0x4e')]=_[_0xd14e('0x4d')](_0x320bb5[_0xd14e('0x4e')],{'$or':_[_0xd14e('0x68')](_0x320bb5['attributes'],function(_0x3e1cf0){var _0x269c63={};_0x269c63[_0x3e1cf0]={'$like':'%'+_0x7cced6[_0xd14e('0x42')][_0xd14e('0x4c')]+'%'};return _0x269c63;})});}_0x320bb5=_[_0xd14e('0x4d')]({},_0x320bb5,_0x7cced6[_0xd14e('0x50')]);return db['Disposition'][_0xd14e('0x2c')]({'where':_0x320bb5['where']})[_0xd14e('0x1c')](function(_0x858130){_0x2d34bd[_0xd14e('0x2c')]=_0x858130;if(_0x7cced6[_0xd14e('0x42')]['includeAll']){_0x320bb5['include']=[{'all':!![]}];}return db[_0xd14e('0x63')][_0xd14e('0x53')](_0x320bb5);})[_0xd14e('0x1c')](function(_0x43ab61){_0x2d34bd[_0xd14e('0x54')]=_0x43ab61;return _0x2d34bd;});}})[_0xd14e('0x1c')](respondWithFilteredResult(_0x3ec2f4,_0x320bb5))[_0xd14e('0x25')](handleError(_0x3ec2f4,null));};exports[_0xd14e('0x69')]=function(_0x2db9cd,_0x3cd8a5,_0x49ba4c){return db[_0xd14e('0x3c')][_0xd14e('0x56')]({'where':{'id':_0x2db9cd[_0xd14e('0x5f')]['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x3cd8a5,null))['then'](function(_0x4084e4){if(_0x4084e4){return _0x4084e4[_0xd14e('0x69')](_0x2db9cd[_0xd14e('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x3cd8a5,null))[_0xd14e('0x25')](handleError(_0x3cd8a5,null));};exports[_0xd14e('0x6a')]=function(_0x25c0d4,_0x549296,_0x265835){if(_0x25c0d4[_0xd14e('0x5e')]['id']){delete _0x25c0d4[_0xd14e('0x5e')]['id'];}return db['WhatsappAccount'][_0xd14e('0x56')]({'where':{'id':_0x25c0d4[_0xd14e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x549296,null))[_0xd14e('0x1c')](function(_0x1cdabf){if(_0x1cdabf){_0x25c0d4['body'][_0xd14e('0x62')]=_0x1cdabf['id'];return db[_0xd14e('0x6b')]['create'](_0x25c0d4['body']);}})[_0xd14e('0x1c')](respondWithResult(_0x549296,null))['catch'](handleError(_0x549296,null));};exports[_0xd14e('0x6c')]=function(_0x5c5f7a,_0x462be9,_0x16bc68){var _0x239c14={'raw':![],'where':{}};var _0x3db2ad={};var _0x242266={'count':0x0,'rows':[]};return db[_0xd14e('0x3c')][_0xd14e('0x65')]({'where':{'id':_0x5c5f7a['params']['id']}})['then'](handleEntityNotFound(_0x462be9,null))[_0xd14e('0x1c')](function(_0x362c68){if(_0x362c68){_0x3db2ad[_0xd14e('0x41')]=_[_0xd14e('0x43')](db[_0xd14e('0x6b')]['rawAttributes']);_0x3db2ad[_0xd14e('0x42')]=_[_0xd14e('0x43')](_0x5c5f7a[_0xd14e('0x42')]);_0x3db2ad[_0xd14e('0x44')]=_[_0xd14e('0x45')](_0x3db2ad[_0xd14e('0x41')],_0x3db2ad['query']);_0x239c14[_0xd14e('0x47')]=_[_0xd14e('0x45')](_0x3db2ad[_0xd14e('0x41')],qs[_0xd14e('0x46')](_0x5c5f7a[_0xd14e('0x42')][_0xd14e('0x46')]));_0x239c14[_0xd14e('0x47')]=_0x239c14[_0xd14e('0x47')]['length']?_0x239c14[_0xd14e('0x47')]:_0x3db2ad[_0xd14e('0x41')];if(!_0x5c5f7a[_0xd14e('0x42')][_0xd14e('0x66')](_0xd14e('0x49'))){_0x239c14[_0xd14e('0x2a')]=qs['limit'](_0x5c5f7a[_0xd14e('0x42')][_0xd14e('0x2a')]);_0x239c14[_0xd14e('0x29')]=qs[_0xd14e('0x29')](_0x5c5f7a[_0xd14e('0x42')]['offset']);}_0x239c14['order']=qs['sort'](_0x5c5f7a[_0xd14e('0x42')][_0xd14e('0x4b')]);_0x239c14[_0xd14e('0x4e')]=qs[_0xd14e('0x44')](_[_0xd14e('0x67')](_0x5c5f7a[_0xd14e('0x42')],_0x3db2ad['filters']));_0x239c14['where'][_0xd14e('0x62')]=_0x362c68['id'];if(_0x5c5f7a[_0xd14e('0x42')][_0xd14e('0x4c')]){_0x239c14['where']=_['merge'](_0x239c14['where'],{'$or':_[_0xd14e('0x68')](_0x239c14[_0xd14e('0x47')],function(_0x118b28){var _0xe2e142={};_0xe2e142[_0x118b28]={'$like':'%'+_0x5c5f7a[_0xd14e('0x42')]['filter']+'%'};return _0xe2e142;})});}_0x239c14=_[_0xd14e('0x4d')]({},_0x239c14,_0x5c5f7a[_0xd14e('0x50')]);return db[_0xd14e('0x6b')][_0xd14e('0x2c')]({'where':_0x239c14[_0xd14e('0x4e')]})[_0xd14e('0x1c')](function(_0xa63690){_0x242266[_0xd14e('0x2c')]=_0xa63690;if(_0x5c5f7a[_0xd14e('0x42')]['includeAll']){_0x239c14[_0xd14e('0x52')]=[{'all':!![]}];}return db[_0xd14e('0x6b')][_0xd14e('0x53')](_0x239c14);})[_0xd14e('0x1c')](function(_0x465012){_0x242266[_0xd14e('0x54')]=_0x465012;return _0x242266;});}})[_0xd14e('0x1c')](respondWithFilteredResult(_0x462be9,_0x239c14))[_0xd14e('0x25')](handleError(_0x462be9,null));};exports[_0xd14e('0x6d')]=function(_0x2aa874,_0x2c5a1b,_0x2b8494){return db[_0xd14e('0x3c')][_0xd14e('0x56')]({'where':{'id':_0x2aa874[_0xd14e('0x5f')]['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x2c5a1b,null))['then'](function(_0x12c70d){if(_0x12c70d){return _0x12c70d[_0xd14e('0x6d')](_0x2aa874[_0xd14e('0x42')][_0xd14e('0x6e')]);}})['then'](respondWithStatusCode(_0x2c5a1b,null))[_0xd14e('0x25')](handleError(_0x2c5a1b,null));};exports[_0xd14e('0x6f')]=function(_0x1dbeeb,_0x1b5811,_0x5b7447){return db[_0xd14e('0x3c')][_0xd14e('0x56')]({'where':{'id':_0x1dbeeb[_0xd14e('0x5f')]['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x1b5811,null))[_0xd14e('0x1c')](function(_0x53a133){if(_0x53a133){return _0x53a133['addAgents'](_0x1dbeeb['body'][_0xd14e('0x6e')],_[_0xd14e('0x70')](_0x1dbeeb[_0xd14e('0x5e')],['ids','id'])||{})['spread'](function(_0x2ba6a3){for(var _0x14a76d=0x0;_0x14a76d<_0x1dbeeb[_0xd14e('0x5e')][_0xd14e('0x6e')][_0xd14e('0x48')];_0x14a76d+=0x1){socket[_0xd14e('0x71')](_0xd14e('0x72'),{'UserId':Number(_0x1dbeeb['body'][_0xd14e('0x6e')][_0x14a76d]),'WhatsappAccountId':Number(_0x1dbeeb[_0xd14e('0x5f')]['id'])});}return _0x2ba6a3;});}})['then'](respondWithResult(_0x1b5811,null))[_0xd14e('0x25')](handleError(_0x1b5811,null));};exports[_0xd14e('0x73')]=function(_0x12dacb,_0x323727,_0x364089){return db[_0xd14e('0x3c')][_0xd14e('0x56')]({'where':{'id':_0x12dacb[_0xd14e('0x5f')]['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x323727,null))[_0xd14e('0x1c')](function(_0x22b06e){if(_0x22b06e){return _0x22b06e[_0xd14e('0x73')](_0x12dacb[_0xd14e('0x42')]['ids'])['then'](function(){if(_['isArray'](_0x12dacb['query']['ids'])){for(var _0x199355=0x0;_0x199355<_0x12dacb['query'][_0xd14e('0x6e')][_0xd14e('0x48')];_0x199355+=0x1){socket[_0xd14e('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x12dacb[_0xd14e('0x42')]['ids'][_0x199355]),'WhatsappAccountId':Number(_0x12dacb['params']['id'])});}}else{socket[_0xd14e('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x12dacb[_0xd14e('0x42')][_0xd14e('0x6e')]),'WhatsappAccountId':Number(_0x12dacb[_0xd14e('0x5f')]['id'])});}});}})[_0xd14e('0x1c')](respondWithStatusCode(_0x323727,null))['catch'](handleError(_0x323727,null));};exports[_0xd14e('0x74')]=function(_0x58fa1a,_0x987d85,_0x3c394e){var _0xb8c015={};var _0x46d845={};var _0x262a19;var _0x539a8e;return db[_0xd14e('0x3c')][_0xd14e('0x65')]({'where':{'id':_0x58fa1a[_0xd14e('0x5f')]['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x987d85,null))[_0xd14e('0x1c')](function(_0x1dda6c){if(_0x1dda6c){_0x262a19=_0x1dda6c;_0x46d845[_0xd14e('0x41')]=_[_0xd14e('0x43')](db[_0xd14e('0x75')][_0xd14e('0x3d')]);_0x46d845[_0xd14e('0x42')]=_[_0xd14e('0x43')](_0x58fa1a[_0xd14e('0x42')]);_0x46d845[_0xd14e('0x44')]=_[_0xd14e('0x45')](_0x46d845['model'],_0x46d845[_0xd14e('0x42')]);_0xb8c015[_0xd14e('0x47')]=_[_0xd14e('0x45')](_0x46d845[_0xd14e('0x41')],qs[_0xd14e('0x46')](_0x58fa1a[_0xd14e('0x42')][_0xd14e('0x46')]));_0xb8c015[_0xd14e('0x47')]=_0xb8c015['attributes'][_0xd14e('0x48')]?_0xb8c015['attributes']:_0x46d845[_0xd14e('0x41')];_0xb8c015[_0xd14e('0x4a')]=qs['sort'](_0x58fa1a[_0xd14e('0x42')][_0xd14e('0x4b')]);_0xb8c015['where']=qs[_0xd14e('0x44')](_[_0xd14e('0x67')](_0x58fa1a[_0xd14e('0x42')],_0x46d845[_0xd14e('0x44')]));if(_0x58fa1a[_0xd14e('0x42')][_0xd14e('0x4c')]){_0xb8c015[_0xd14e('0x4e')]=_[_0xd14e('0x4d')](_0xb8c015[_0xd14e('0x4e')],{'$or':_['map'](_0xb8c015['attributes'],function(_0x3efb7e){var _0x3929ff={};_0x3929ff[_0x3efb7e]={'$like':'%'+_0x58fa1a[_0xd14e('0x42')][_0xd14e('0x4c')]+'%'};return _0x3929ff;})});}_0xb8c015=_['merge']({},_0xb8c015,_0x58fa1a[_0xd14e('0x50')]);return _0x262a19[_0xd14e('0x74')](_0xb8c015);}})[_0xd14e('0x1c')](function(_0x5efb19){if(_0x5efb19){_0x539a8e=_0x5efb19[_0xd14e('0x48')];if(!_0x58fa1a[_0xd14e('0x42')][_0xd14e('0x66')](_0xd14e('0x49'))){_0xb8c015[_0xd14e('0x2a')]=qs[_0xd14e('0x2a')](_0x58fa1a[_0xd14e('0x42')][_0xd14e('0x2a')]);_0xb8c015[_0xd14e('0x29')]=qs[_0xd14e('0x29')](_0x58fa1a['query'][_0xd14e('0x29')]);}return _0x262a19['getAgents'](_0xb8c015);}})[_0xd14e('0x1c')](function(_0x274517){if(_0x274517){return _0x274517?{'count':_0x539a8e,'rows':_0x274517}:null;}})[_0xd14e('0x1c')](respondWithResult(_0x987d85,null))['catch'](handleError(_0x987d85,null));};exports[_0xd14e('0x76')]=function(_0x49301b,_0x42e371){var _0x44cfa4=_0x49301b[_0xd14e('0x5f')]['id'];var _0x2a9136=_0x49301b[_0xd14e('0x5e')];var _0x5e9418=0xc8;var _0x15f369=null;return db[_0xd14e('0x77')][_0xd14e('0x78')]({'isolationLevel':db[_0xd14e('0x77')][_0xd14e('0x79')]['ISOLATION_LEVELS'][_0xd14e('0x7a')]},function(_0x1152f2){return db[_0xd14e('0x3c')]['findOne']({'where':{'id':_0x44cfa4},'transaction':_0x1152f2})[_0xd14e('0x1c')](function(_0x2ca1c2){if(_0x2ca1c2){return db[_0xd14e('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x44cfa4},'transaction':_0x1152f2})[_0xd14e('0x1c')](function(){var _0x18676c=_['map'](_0x2a9136,function(_0x587b42){_0x587b42[_0xd14e('0x62')]=_0x44cfa4;return _0x587b42;});return db[_0xd14e('0x7b')]['bulkCreate'](_0x18676c,{'transaction':_0x1152f2});});}else{_0x5e9418=0x194;_0x15f369=[];}});})[_0xd14e('0x1c')](function(){if(_0x5e9418!==0x194){return db[_0xd14e('0x7b')][_0xd14e('0x7c')]({'where':{'WhatsappAccountId':_0x44cfa4},'order':_0xd14e('0x7d')})['then'](function(_0x8d1594){_0x15f369=_0x8d1594;});}})[_0xd14e('0x25')](function(_0x3f497e){_0x5e9418=0x1f4;logger['error'](_0x3f497e['stack']);if(_0x3f497e['name']){delete _0x3f497e[_0xd14e('0x37')];}_0x15f369=_0x3f497e;})[_0xd14e('0x7e')](function(){if(_0x15f369===null){_0x42e371[_0xd14e('0x26')](_0x5e9418);}else{if(_0x5e9418===0x1f4){_0x42e371[_0xd14e('0x27')](_0x5e9418)[_0xd14e('0x38')](_0x15f369);}else{_0x42e371[_0xd14e('0x27')](_0x5e9418)[_0xd14e('0x7f')](_0x15f369);}}});};exports[_0xd14e('0x80')]=function(_0x51e98a,_0x1f9142,_0x16a176){var _0x148e31={};var _0x2dfdaf={};var _0x237e91;var _0x12c446;return db[_0xd14e('0x3c')]['findOne']({'where':{'id':_0x51e98a[_0xd14e('0x5f')]['id']}})[_0xd14e('0x1c')](handleEntityNotFound(_0x1f9142,null))['then'](function(_0x5e5e7f){if(_0x5e5e7f){_0x237e91=_0x5e5e7f;_0x2dfdaf['model']=_['keys'](db[_0xd14e('0x7b')][_0xd14e('0x3d')]);_0x2dfdaf[_0xd14e('0x42')]=_['keys'](_0x51e98a[_0xd14e('0x42')]);_0x2dfdaf['filters']=_['intersection'](_0x2dfdaf[_0xd14e('0x41')],_0x2dfdaf[_0xd14e('0x42')]);_0x148e31[_0xd14e('0x47')]=_[_0xd14e('0x45')](_0x2dfdaf[_0xd14e('0x41')],qs[_0xd14e('0x46')](_0x51e98a[_0xd14e('0x42')][_0xd14e('0x46')]));_0x148e31[_0xd14e('0x47')]=_0x148e31[_0xd14e('0x47')][_0xd14e('0x48')]?_0x148e31[_0xd14e('0x47')]:_0x2dfdaf[_0xd14e('0x41')];_0x148e31[_0xd14e('0x4a')]=qs[_0xd14e('0x4b')](_0x51e98a[_0xd14e('0x42')]['sort']);_0x148e31[_0xd14e('0x4e')]=qs[_0xd14e('0x44')](_['pick'](_0x51e98a[_0xd14e('0x42')],_0x2dfdaf[_0xd14e('0x44')]));if(_0x51e98a[_0xd14e('0x42')][_0xd14e('0x4c')]){_0x148e31['where']=_['merge'](_0x148e31['where'],{'$or':_[_0xd14e('0x68')](_0x148e31[_0xd14e('0x47')],function(_0x51a1af){var _0x10377c={};_0x10377c[_0x51a1af]={'$like':'%'+_0x51e98a[_0xd14e('0x42')][_0xd14e('0x4c')]+'%'};return _0x10377c;})});}_0x148e31=_['merge']({},_0x148e31,_0x51e98a['options']);return _0x237e91[_0xd14e('0x80')](_0x148e31);}})[_0xd14e('0x1c')](function(_0x52172b){if(_0x52172b){_0x12c446=_0x52172b[_0xd14e('0x48')];if(!_0x51e98a[_0xd14e('0x42')][_0xd14e('0x66')](_0xd14e('0x49'))){_0x148e31[_0xd14e('0x2a')]=qs[_0xd14e('0x2a')](_0x51e98a[_0xd14e('0x42')][_0xd14e('0x2a')]);_0x148e31[_0xd14e('0x29')]=qs[_0xd14e('0x29')](_0x51e98a[_0xd14e('0x42')][_0xd14e('0x29')]);}return _0x237e91['getApplications'](_0x148e31);}})[_0xd14e('0x1c')](function(_0x4774fc){if(_0x4774fc){return _0x4774fc?{'count':_0x12c446,'rows':_0x4774fc}:null;}})[_0xd14e('0x1c')](respondWithResult(_0x1f9142,null))[_0xd14e('0x25')](handleError(_0x1f9142,null));};exports[_0xd14e('0x81')]=function(_0x376e9e,_0x4db824,_0x19eace){var _0x1fb68e={'channel':'whatsapp'};var _0x20fe48=[];var _0x497929=[];var _0x34b8cd={};return db['WhatsappAccount'][_0xd14e('0x56')]({'where':{'id':_0x376e9e[_0xd14e('0x5f')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xd14e('0x82')}]})[_0xd14e('0x1c')](handleEntityNotFound(_0x4db824,null))[_0xd14e('0x1c')](function(_0x456296){_0x1fb68e[_0xd14e('0x83')]=_0x456296;if(_0x1fb68e[_0xd14e('0x83')]&&_0x1fb68e['account'][_0xd14e('0x3f')]===_0xd14e('0x84')&&_0x376e9e[_0xd14e('0x5e')][_0xd14e('0x85')]){if(_0x376e9e[_0xd14e('0x5e')][_0xd14e('0x85')][_0xd14e('0x48')]===0x0)return;if(_0x376e9e[_0xd14e('0x5e')]['statuses'][0x0][_0xd14e('0x86')]!==_0xd14e('0x87'))return;return db[_0xd14e('0x88')][_0xd14e('0x31')]({'read':!![],'readAt':_0x376e9e[_0xd14e('0x5e')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x376e9e[_0xd14e('0x5e')][_0xd14e('0x85')][0x0][_0xd14e('0x89')]},'individualHooks':!![]})[_0xd14e('0x1c')](function(_0x4d43e5){return _0x4db824['status'](0xc8)[_0xd14e('0x7f')](_0x4d43e5);});}_0x1fb68e[_0xd14e('0x8a')]=_['orderBy'](_0x456296[_0xd14e('0x82')],[_0xd14e('0x7d')],[_0xd14e('0x8b')]);if(_0x1fb68e['account'][_0xd14e('0x82')]){delete _0x1fb68e['account'][_0xd14e('0x82')];}return db[_0xd14e('0x8c')]['describe']()[_0xd14e('0x1c')](function(_0x1eda59){if(!_0x1eda59){throw new db['Sequelize'][(_0xd14e('0x8d'))](_0xd14e('0x8e'));}_0x20fe48=_[_0xd14e('0x8f')](_['keys'](_0x1eda59),['createdAt',_0xd14e('0x90')]);_0x497929=_['difference'](_[_0xd14e('0x43')](_0x1eda59),[_0xd14e('0x91'),_0xd14e('0x90'),'CompanyId','ListId']);_0x1fb68e['body']={'mapKey':_0xd14e('0x92')};if(_0x1fb68e[_0xd14e('0x83')]&&_0x1fb68e['account'][_0xd14e('0x3f')]===_0xd14e('0x93')){_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x94')]=_0x376e9e[_0xd14e('0x5e')]['From']['replace'](_0xd14e('0x95'),'');_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x5e')]=_0x376e9e[_0xd14e('0x5e')][_0xd14e('0x96')];_0x1fb68e['body'][_0xd14e('0x97')]=_0x376e9e[_0xd14e('0x5e')][_0xd14e('0x98')];}if(_0x1fb68e[_0xd14e('0x83')]&&_0x1fb68e[_0xd14e('0x83')]['type']===_0xd14e('0x84')){_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x94')]=_0x376e9e[_0xd14e('0x5e')][_0xd14e('0x99')][0x0][_0xd14e('0x94')];_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x5e')]=_0x376e9e['body'][_0xd14e('0x99')][0x0][_0xd14e('0x23')][_0xd14e('0x5e')];_0x1fb68e[_0xd14e('0x5e')]['messageId']=_0x376e9e[_0xd14e('0x5e')][_0xd14e('0x99')][0x0]['message_id'];}if(_0x1fb68e[_0xd14e('0x5e')]['id']){delete _0x1fb68e['body']['id'];}if(_[_0xd14e('0x9a')](_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x94')])){throw new db[(_0xd14e('0x9b'))][(_0xd14e('0x8d'))]('from\x20is\x20mandatory');}if(_[_0xd14e('0x9a')](_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x5e')])||_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x5e')]===''){throw new db[(_0xd14e('0x9b'))][(_0xd14e('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd14e('0x9a')](_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x9c')])){throw new db[(_0xd14e('0x9b'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x497929);}if(!_[_0xd14e('0x9d')](_0x497929,_0x1fb68e['body']['mapKey'])){throw new db[(_0xd14e('0x9b'))][(_0xd14e('0x8d'))](_0xd14e('0x9e')+_0x497929);}_0x34b8cd[_0x1fb68e[_0xd14e('0x5e')]['mapKey']]=_0x1fb68e['body'][_0xd14e('0x94')];return db[_0xd14e('0x9f')][_0xd14e('0x56')]({'where':{'id':_0x1fb68e[_0xd14e('0x83')][_0xd14e('0xa0')]},'include':[{'model':db[_0xd14e('0x8c')],'as':'Contacts','where':_0x34b8cd,'limit':0x1,'order':[[_0xd14e('0x90'),_0xd14e('0xa1')]]}]});})[_0xd14e('0x1c')](handleEntityNotFound(_0x4db824,null))['then'](function(_0x1b09ec){if(_0x1b09ec){_0x1fb68e['list']=_[_0xd14e('0x70')](_0x1b09ec,['Contacts']);if(_0x1b09ec[_0xd14e('0xa2')][_0xd14e('0x48')]){return _0x1b09ec['Contacts'][0x0];}var _0x3cf04f=_[_0xd14e('0xa3')](_0x1fb68e[_0xd14e('0x5e')],{'firstName':_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x94')],'ListId':_0x1b09ec['id']});_0x3cf04f[_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x9c')]]=_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x94')];return db['CmContact']['create'](_0x3cf04f,{'fields':_0x20fe48,'raw':!![]});}})[_0xd14e('0x1c')](handleEntityNotFound(_0x4db824,null))[_0xd14e('0x1c')](function(_0x3a8419){if(_0x3a8419){_0x1fb68e[_0xd14e('0xa4')]=_0x3a8419;var _0x4ddf93={'ContactId':_0x3a8419['id'],'phone':_0x1fb68e['body'][_0xd14e('0x94')],'WhatsappAccountId':_0x376e9e[_0xd14e('0x5f')]['id']};var _0x44bf15={'ContactId':_0x3a8419['id'],'WhatsappAccountId':_0x376e9e['params']['id'],'closed':![]};return db[_0xd14e('0xa5')][_0xd14e('0x56')]({'where':_0x44bf15})[_0xd14e('0x1c')](function(_0x24f60b){if(_0x24f60b){return[_0x24f60b,![]];}return db[_0xd14e('0xa5')]['create'](_0x4ddf93)[_0xd14e('0x1c')](function(_0x5e37b3){return[_0x5e37b3,!![]];});});}})[_0xd14e('0xa6')](function(_0x3240d1,_0xccea4e){_0x1fb68e[_0xd14e('0xa7')]=_0x3240d1[_0xd14e('0x32')]({'plain':!![]});_0x1fb68e[_0xd14e('0xa7')]['created']=![];if(_0xccea4e){if(_0x1fb68e[_0xd14e('0x83')]['autoclose']){_0x1fb68e[_0xd14e('0x8a')][_0xd14e('0xa8')]({'id':0x0,'priority':_0x1fb68e[_0xd14e('0x8a')][_0xd14e('0x48')]+0x1,'app':'close','appdata':_0xd14e('0xa9'),'interval':_0xd14e('0xaa')});}_0x1fb68e['interaction']['created']=!![];}return db['WhatsappMessage'][_0xd14e('0x57')]({'phone':_0x1fb68e[_0xd14e('0x5e')]['from'],'messageId':_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x97')],'body':_0x1fb68e[_0xd14e('0x5e')][_0xd14e('0x5e')],'WhatsappAccountId':_0x376e9e[_0xd14e('0x5f')]['id'],'WhatsappInteractionId':_0x3240d1['id'],'direction':'in','ContactId':_0x3240d1[_0xd14e('0xab')],'AttachmentId':_0x1fb68e['body'][_0xd14e('0xac')]});})['then'](function(_0x36e1b9){_0x1fb68e[_0xd14e('0x23')]=_0x36e1b9;if(_0x1fb68e['interaction'][_0xd14e('0xad')]){return db['User'][_0xd14e('0x56')]({'attributes':['id',_0xd14e('0x37')],'where':{'id':_0x1fb68e[_0xd14e('0xa7')][_0xd14e('0xad')]}})[_0xd14e('0x1c')](function(_0x153b35){if(_0x153b35){_0x1fb68e[_0xd14e('0x8a')][_0xd14e('0xae')]({'id':0x0,'priority':0x0,'app':_0xd14e('0xaf'),'appdata':_0x153b35['name']+','+(_0x1fb68e['account'][_0xd14e('0xb0')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd14e('0xb1'),_0xd14e('0xb2'),_0x1fb68e);});}return respondWithRpcPromise(_0xd14e('0xb1'),_0xd14e('0xb2'),_0x1fb68e);})[_0xd14e('0x1c')](function(_0x1331e2){if(_0x1331e2){var _0x5b2c3a=0xc8;var _0x24401e=_0xd14e('0xb3');logger[_0xd14e('0x1d')](_0xd14e('0xb4'),_0x24401e,_0x5b2c3a,_0xd14e('0xb5'));logger[_0xd14e('0x1f')](_0xd14e('0xb6'),_0x24401e,_0x5b2c3a,'entity\x20found',JSON[_0xd14e('0x20')](_0x1331e2));if(_0x1fb68e[_0xd14e('0x83')][_0xd14e('0x3f')]===_0xd14e('0x93')){return _0x4db824[_0xd14e('0x27')](_0x5b2c3a)[_0xd14e('0x2d')](_0xd14e('0xb7'),_0xd14e('0xb8'))[_0xd14e('0x38')](_0xd14e('0xb9'));}else{return _0x4db824[_0xd14e('0x27')](_0x5b2c3a)[_0xd14e('0x7f')](_0x1331e2);}}});})['catch'](handleError(_0x4db824,null));};exports[_0xd14e('0x38')]=function(_0x2bfc41,_0x379bc9,_0x54d685){var _0x526622,_0x1c7a24,_0xb9464;if(_[_0xd14e('0x9a')](_0x2bfc41[_0xd14e('0x5e')]['body'])||_0x2bfc41[_0xd14e('0x5e')][_0xd14e('0x5e')]===''){throw new db[(_0xd14e('0x9b'))][(_0xd14e('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2bfc41[_0xd14e('0x5e')]['to'])){throw new db['Sequelize']['ValidationError'](_0xd14e('0xba'));}_0x526622=_0x2bfc41[_0xd14e('0x5e')]['to'];return db[_0xd14e('0x3c')][_0xd14e('0x56')]({'where':{'id':_0x2bfc41[_0xd14e('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xd14e('0xbb'),'include':[{'model':db[_0xd14e('0x8c')],'as':_0xd14e('0xa2'),'where':{'mobile':_0x526622},'limit':0x1,'order':[['updatedAt',_0xd14e('0xa1')]]}]}]})[_0xd14e('0x1c')](handleEntityNotFound(_0x379bc9,null))['then'](function(_0x1370a4){if(_0x1370a4&&_0x1370a4[_0xd14e('0xbb')]){_0x1c7a24=_0x1370a4[_0xd14e('0x32')]({'plain':!![]});if(_0x1c7a24['List']&&_0x1c7a24['List'][_0xd14e('0xa2')][_0xd14e('0x48')]){return _0x1c7a24[_0xd14e('0xbb')]['Contacts'][0x0];}return db[_0xd14e('0x8c')][_0xd14e('0x57')](_[_0xd14e('0xa3')](_0x2bfc41['body'],{'firstName':_0x526622,'mobile':_0x526622,'phone':_0x526622,'ListId':_0x1c7a24[_0xd14e('0xa0')]}));}})['then'](handleEntityNotFound(_0x379bc9,null))[_0xd14e('0x1c')](function(_0x9e3c5e){if(_0x9e3c5e){_0xb9464=_0x9e3c5e;return db[_0xd14e('0xa5')][_0xd14e('0x56')]({'where':{'ContactId':_0xb9464['id'],'closed':![],'WhatsappAccountId':_0x1c7a24['id']}})[_0xd14e('0x1c')](function(_0x342949){if(_0x342949){return[_0x342949,![]];}return db['WhatsappInteraction'][_0xd14e('0x57')]({'UserId':_0x2bfc41['user']['id'],'ContactId':_0xb9464['id'],'WhatsappAccountId':_0x1c7a24['id'],'phone':_0x526622,'firstMsgDirection':'out','Messages':[_['merge'](_0x2bfc41[_0xd14e('0x5e')],{'read':![],'body':_0x2bfc41['body'][_0xd14e('0x5e')],'phone':_0x526622,'WhatsappAccountId':_0x1c7a24['id'],'UserId':_0x2bfc41['user']['id'],'ContactId':_0xb9464['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xd14e('0xbc')}]})[_0xd14e('0x1c')](function(_0x402889){return[_0x402889,!![]];});});}})[_0xd14e('0xa6')](function(_0x371a02,_0x1135e8){if(_0x1135e8){return _0x371a02;}return db['WhatsappMessage'][_0xd14e('0x57')](_[_0xd14e('0x4d')](_0x2bfc41[_0xd14e('0x5e')],{'read':![],'body':_0x2bfc41['body'][_0xd14e('0x5e')],'phone':_0x526622,'WhatsappAccountId':_0x1c7a24['id'],'WhatsappInteractionId':_0x371a02['id'],'UserId':_0x2bfc41[_0xd14e('0x58')]['id'],'ContactId':_0xb9464['id']}))['then'](function(_0x5e90e2){_0x371a02[_0xd14e('0xbd')][_0xd14e('0xbc')]=[];_0x371a02[_0xd14e('0xbd')][_0xd14e('0xbc')][_0xd14e('0xa8')](_0x5e90e2[_0xd14e('0xbd')]);return _0x371a02;});})[_0xd14e('0x1c')](respondWithResult(_0x379bc9,null))[_0xd14e('0x25')](handleError(_0x379bc9,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 5e14bfc..99ac5dd 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 _0x2d42=['save','remove','emit','hasOwnProperty','WhatsappAccount'];(function(_0x535183,_0x470580){var _0x471bd5=function(_0x235e50){while(--_0x235e50){_0x535183['push'](_0x535183['shift']());}};_0x471bd5(++_0x470580);}(_0x2d42,0xc2));var _0x22d4=function(_0x301690,_0x3da4d7){_0x301690=_0x301690-0x0;var _0x257ce8=_0x2d42[_0x301690];return _0x257ce8;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x22d4('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x22d4('0x1'),'afterUpdate':'update','afterDestroy':_0x22d4('0x2')};function emitEvent(_0x19cf1f){return function(_0x15e897,_0x3a6726,_0x472602){WhatsappAccountEvents[_0x22d4('0x3')](_0x19cf1f+':'+_0x15e897['id'],_0x15e897);WhatsappAccountEvents[_0x22d4('0x3')](_0x19cf1f,_0x15e897);_0x472602(null);};}for(var e in events){if(events[_0x22d4('0x4')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x62a5=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','hasOwnProperty','hook','exports','events'];(function(_0x4a4f11,_0x38f319){var _0x26f6aa=function(_0x5e05e2){while(--_0x5e05e2){_0x4a4f11['push'](_0x4a4f11['shift']());}};_0x26f6aa(++_0x38f319);}(_0x62a5,0x1c1));var _0x562a=function(_0x540970,_0x331765){_0x540970=_0x540970-0x0;var _0x414a90=_0x62a5[_0x540970];return _0x414a90;};'use strict';var EventEmitter=require(_0x562a('0x0'));var WhatsappAccount=require(_0x562a('0x1'))['db'][_0x562a('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x562a('0x3')](0x0);var events={'afterCreate':_0x562a('0x4'),'afterUpdate':_0x562a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4eec88){return function(_0x34793b,_0x134da4,_0x2e4101){WhatsappAccountEvents['emit'](_0x4eec88+':'+_0x34793b['id'],_0x34793b);WhatsappAccountEvents['emit'](_0x4eec88,_0x34793b);_0x2e4101(null);};}for(var e in events){if(events[_0x562a('0x6')](e)){var event=events[e];WhatsappAccount[_0x562a('0x7')](e,emitEvent(event));}}module[_0x562a('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 5522f0e..8d969e6 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 _0xeb6b=['moment','request-promise','path','rimraf','../../config/environment','exports','WhatsappAccount','lodash'];(function(_0x4fc583,_0x1c9563){var _0x3b884d=function(_0xe8ac6f){while(--_0xe8ac6f){_0x4fc583['push'](_0x4fc583['shift']());}};_0x3b884d(++_0x1c9563);}(_0xeb6b,0x14f));var _0xbeb6=function(_0x1916cf,_0x4d371b){_0x1916cf=_0x1916cf-0x0;var _0x49caf2=_0xeb6b[_0x1916cf];return _0x49caf2;};'use strict';var _=require(_0xbeb6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbeb6('0x1'));var BPromise=require('bluebird');var rp=require(_0xbeb6('0x2'));var fs=require('fs');var path=require(_0xbeb6('0x3'));var rimraf=require(_0xbeb6('0x4'));var config=require(_0xbeb6('0x5'));var attributes=require('./whatsappAccount.attributes');module[_0xbeb6('0x6')]=function(_0x5f4590,_0x1fe8e5){return _0x5f4590['define'](_0xbeb6('0x7'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeedf=['moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api'];(function(_0x1fcce7,_0x4408af){var _0x228f51=function(_0x1cd731){while(--_0x1cd731){_0x1fcce7['push'](_0x1fcce7['shift']());}};_0x228f51(++_0x4408af);}(_0xeedf,0x14c));var _0xfeed=function(_0x1fa001,_0x38748c){_0x1fa001=_0x1fa001-0x0;var _0x52f717=_0xeedf[_0x1fa001];return _0x52f717;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))(_0xfeed('0x3'));var moment=require(_0xfeed('0x4'));var BPromise=require(_0xfeed('0x5'));var rp=require(_0xfeed('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfeed('0x7'));var config=require('../../config/environment');var attributes=require(_0xfeed('0x8'));module['exports']=function(_0x418132,_0x597d96){return _0x418132[_0xfeed('0x9')](_0xfeed('0xa'),attributes,{'tableName':_0xfeed('0xb'),'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 9583579..7cf1022 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 _0x51cf=['info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','raw','options','where','attributes','map','include','model','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','then'];(function(_0x29edfd,_0x2eab43){var _0x556e8b=function(_0x7309fe){while(--_0x7309fe){_0x29edfd['push'](_0x29edfd['shift']());}};_0x556e8b(++_0x2eab43);}(_0x51cf,0x16a));var _0xf51c=function(_0x34c47b,_0x1bf56d){_0x34c47b=_0x34c47b-0x0;var _0x1afb18=_0x51cf[_0x34c47b];return _0x1afb18;};'use strict';var _=require(_0xf51c('0x0'));var util=require(_0xf51c('0x1'));var moment=require(_0xf51c('0x2'));var BPromise=require(_0xf51c('0x3'));var rs=require(_0xf51c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf51c('0x5'))['db'];var utils=require(_0xf51c('0x6'));var logger=require('../../config/logger')(_0xf51c('0x7'));var config=require(_0xf51c('0x8'));var jayson=require(_0xf51c('0x9'));var client=jayson[_0xf51c('0xa')][_0xf51c('0xb')]({'port':0x232a});config[_0xf51c('0xc')]=_[_0xf51c('0xd')](config[_0xf51c('0xc')],{'host':_0xf51c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf51c('0xc')]));require(_0xf51c('0xf'))[_0xf51c('0x10')](socket);function respondWithRpcPromise(_0x4fc319,_0x7c431d,_0x23885b){return new BPromise(function(_0x334fd2,_0x200a4c){return client['request'](_0x4fc319,_0x23885b)[_0xf51c('0x11')](function(_0x522440){logger[_0xf51c('0x12')](_0xf51c('0x13'),_0x7c431d,_0xf51c('0x14'));logger[_0xf51c('0x15')](_0xf51c('0x16'),_0x7c431d,_0xf51c('0x14'),JSON[_0xf51c('0x17')](_0x522440));if(_0x522440[_0xf51c('0x18')]){if(_0x522440[_0xf51c('0x18')][_0xf51c('0x19')]===0x1f4){logger[_0xf51c('0x18')](_0xf51c('0x13'),_0x7c431d,_0x522440[_0xf51c('0x18')][_0xf51c('0x1a')]);return _0x200a4c(_0x522440[_0xf51c('0x18')][_0xf51c('0x1a')]);}logger[_0xf51c('0x18')](_0xf51c('0x13'),_0x7c431d,_0x522440[_0xf51c('0x18')]['message']);return _0x334fd2(_0x522440[_0xf51c('0x18')][_0xf51c('0x1a')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x7c431d,_0xf51c('0x14'));_0x334fd2(_0x522440[_0xf51c('0x1b')][_0xf51c('0x1a')]);}})['catch'](function(_0x28a9ab){logger[_0xf51c('0x18')](_0xf51c('0x13'),_0x7c431d,_0x28a9ab);_0x200a4c(_0x28a9ab);});});}exports[_0xf51c('0x1c')]=function(_0x9401b9){var _0x3a6f75=this;return new Promise(function(_0x593a32,_0x44244d){return db[_0xf51c('0x1d')]['find']({'raw':_0x9401b9['options']?_0x9401b9['options'][_0xf51c('0x1e')]===undefined?!![]:![]:!![],'where':_0x9401b9['options']?_0x9401b9[_0xf51c('0x1f')][_0xf51c('0x20')]||null:null,'attributes':_0x9401b9['options']?_0x9401b9['options'][_0xf51c('0x21')]||null:null,'include':_0x9401b9[_0xf51c('0x1f')]?_0x9401b9[_0xf51c('0x1f')]['include']?_[_0xf51c('0x22')](_0x9401b9[_0xf51c('0x1f')][_0xf51c('0x23')],function(_0x13a58b){return{'model':db[_0x13a58b[_0xf51c('0x24')]],'as':_0x13a58b['as'],'attributes':_0x13a58b[_0xf51c('0x21')],'include':_0x13a58b[_0xf51c('0x23')]?_[_0xf51c('0x22')](_0x13a58b['include'],function(_0x1fe9d8){return{'model':db[_0x1fe9d8['model']],'as':_0x1fe9d8['as'],'attributes':_0x1fe9d8[_0xf51c('0x21')],'include':_0x1fe9d8[_0xf51c('0x23')]?_[_0xf51c('0x22')](_0x1fe9d8[_0xf51c('0x23')],function(_0x229fa1){return{'model':db[_0x229fa1[_0xf51c('0x24')]],'as':_0x229fa1['as'],'attributes':_0x229fa1[_0xf51c('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf51c('0x11')](function(_0x3a07fb){logger[_0xf51c('0x12')](_0xf51c('0x1c'),_0x9401b9);logger[_0xf51c('0x15')](_0xf51c('0x1c'),_0x9401b9,JSON['stringify'](_0x3a07fb));_0x593a32(_0x3a07fb);})[_0xf51c('0x25')](function(_0x560a40){logger[_0xf51c('0x18')](_0xf51c('0x1c'),_0x560a40['message'],_0x9401b9);_0x44244d(_0x3a6f75[_0xf51c('0x18')](0x1f4,_0x560a40['message']));});});}; \ No newline at end of file +var _0x5b18=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','include','map','model','attributes','then','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1f99a0,_0x42fab3){var _0xdcb9d4=function(_0x5ef69e){while(--_0x5ef69e){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0xdcb9d4(++_0x42fab3);}(_0x5b18,0xb4));var _0x85b1=function(_0x5185cf,_0x18e620){_0x5185cf=_0x5185cf-0x0;var _0x53a6b5=_0x5b18[_0x5185cf];return _0x53a6b5;};'use strict';var _=require(_0x85b1('0x0'));var util=require('util');var moment=require(_0x85b1('0x1'));var BPromise=require('bluebird');var rs=require(_0x85b1('0x2'));var fs=require('fs');var Redis=require(_0x85b1('0x3'));var db=require(_0x85b1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x85b1('0x5'))(_0x85b1('0x6'));var config=require(_0x85b1('0x7'));var jayson=require(_0x85b1('0x8'));var client=jayson[_0x85b1('0x9')]['http']({'port':0x232a});config[_0x85b1('0xa')]=_[_0x85b1('0xb')](config[_0x85b1('0xa')],{'host':_0x85b1('0xc'),'port':0x18eb});var socket=require(_0x85b1('0xd'))(new Redis(config[_0x85b1('0xa')]));require(_0x85b1('0xe'))[_0x85b1('0xf')](socket);function respondWithRpcPromise(_0x1c05fb,_0x22df51,_0x3a6cb8){return new BPromise(function(_0x48d640,_0x5241c1){return client[_0x85b1('0x10')](_0x1c05fb,_0x3a6cb8)['then'](function(_0x2cf0ab){logger[_0x85b1('0x11')](_0x85b1('0x12'),_0x22df51,_0x85b1('0x13'));logger[_0x85b1('0x14')](_0x85b1('0x15'),_0x22df51,'request\x20sent',JSON[_0x85b1('0x16')](_0x2cf0ab));if(_0x2cf0ab[_0x85b1('0x17')]){if(_0x2cf0ab[_0x85b1('0x17')]['code']===0x1f4){logger['error'](_0x85b1('0x12'),_0x22df51,_0x2cf0ab['error'][_0x85b1('0x18')]);return _0x5241c1(_0x2cf0ab[_0x85b1('0x17')][_0x85b1('0x18')]);}logger[_0x85b1('0x17')](_0x85b1('0x12'),_0x22df51,_0x2cf0ab['error'][_0x85b1('0x18')]);return _0x48d640(_0x2cf0ab[_0x85b1('0x17')][_0x85b1('0x18')]);}else{logger['info'](_0x85b1('0x12'),_0x22df51,_0x85b1('0x13'));_0x48d640(_0x2cf0ab[_0x85b1('0x19')]['message']);}})[_0x85b1('0x1a')](function(_0x57cc12){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x22df51,_0x57cc12);_0x5241c1(_0x57cc12);});});}exports[_0x85b1('0x1b')]=function(_0x19e876){var _0xc10628=this;return new Promise(function(_0x1af368,_0xde53f3){return db[_0x85b1('0x1c')][_0x85b1('0x1d')]({'raw':_0x19e876[_0x85b1('0x1e')]?_0x19e876['options']['raw']===undefined?!![]:![]:!![],'where':_0x19e876[_0x85b1('0x1e')]?_0x19e876['options'][_0x85b1('0x1f')]||null:null,'attributes':_0x19e876['options']?_0x19e876[_0x85b1('0x1e')]['attributes']||null:null,'include':_0x19e876[_0x85b1('0x1e')]?_0x19e876['options'][_0x85b1('0x20')]?_[_0x85b1('0x21')](_0x19e876[_0x85b1('0x1e')]['include'],function(_0x5a3a8c){return{'model':db[_0x5a3a8c[_0x85b1('0x22')]],'as':_0x5a3a8c['as'],'attributes':_0x5a3a8c[_0x85b1('0x23')],'include':_0x5a3a8c[_0x85b1('0x20')]?_[_0x85b1('0x21')](_0x5a3a8c[_0x85b1('0x20')],function(_0x56af9e){return{'model':db[_0x56af9e[_0x85b1('0x22')]],'as':_0x56af9e['as'],'attributes':_0x56af9e['attributes'],'include':_0x56af9e[_0x85b1('0x20')]?_[_0x85b1('0x21')](_0x56af9e[_0x85b1('0x20')],function(_0xfb3f9b){return{'model':db[_0xfb3f9b[_0x85b1('0x22')]],'as':_0xfb3f9b['as'],'attributes':_0xfb3f9b[_0x85b1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x85b1('0x24')](function(_0x383fba){logger['info'](_0x85b1('0x1b'),_0x19e876);logger[_0x85b1('0x14')](_0x85b1('0x1b'),_0x19e876,JSON[_0x85b1('0x16')](_0x383fba));_0x1af368(_0x383fba);})[_0x85b1('0x1a')](function(_0x32fa34){logger[_0x85b1('0x17')](_0x85b1('0x1b'),_0x32fa34[_0x85b1('0x18')],_0x19e876);_0xde53f3(_0xc10628[_0x85b1('0x17')](0x1f4,_0x32fa34[_0x85b1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index b1b67c5..8f026bd 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 _0x8591=['save','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x8591,0x157));var _0x1859=function(_0x59a7c1,_0x1391c6){_0x59a7c1=_0x59a7c1-0x0;var _0x536272=_0x8591[_0x59a7c1];return _0x536272;};'use strict';var WhatsappAccountEvents=require(_0x1859('0x0'));var events=[_0x1859('0x1'),'remove',_0x1859('0x2')];function createListener(_0x45b764,_0x38b823){return function(_0x331707){_0x38b823[_0x1859('0x3')](_0x45b764,_0x331707);};}function removeListener(_0x152d59,_0x58e157){return function(){WhatsappAccountEvents[_0x1859('0x4')](_0x152d59,_0x58e157);};}exports[_0x1859('0x5')]=function(_0x277f21){for(var _0xfaa3e4=0x0,_0x5d320f=events[_0x1859('0x6')];_0xfaa3e4<_0x5d320f;_0xfaa3e4++){var _0x4cb8d7=events[_0xfaa3e4];var _0x3192ef=createListener(_0x1859('0x7')+_0x4cb8d7,_0x277f21);WhatsappAccountEvents['on'](_0x4cb8d7,_0x3192ef);}}; \ No newline at end of file +var _0x4127=['whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener','register','length'];(function(_0x1aa840,_0x348832){var _0x4ccc95=function(_0x5a5382){while(--_0x5a5382){_0x1aa840['push'](_0x1aa840['shift']());}};_0x4ccc95(++_0x348832);}(_0x4127,0xc9));var _0x7412=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4127[_0x311c35];return _0x5cc50c;};'use strict';var WhatsappAccountEvents=require(_0x7412('0x0'));var events=[_0x7412('0x1'),'remove',_0x7412('0x2')];function createListener(_0x575f2e,_0x54fe42){return function(_0x352544){_0x54fe42[_0x7412('0x3')](_0x575f2e,_0x352544);};}function removeListener(_0xf0a485,_0x19d90b){return function(){WhatsappAccountEvents[_0x7412('0x4')](_0xf0a485,_0x19d90b);};}exports[_0x7412('0x5')]=function(_0x1909f2){for(var _0x2554c7=0x0,_0xbca320=events[_0x7412('0x6')];_0x2554c7<_0xbca320;_0x2554c7++){var _0x51f3f0=events[_0x2554c7];var _0x23eaed=createListener(_0x7412('0x7')+_0x51f3f0,_0x1909f2);WhatsappAccountEvents['on'](_0x51f3f0,_0x23eaed);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 183ed58..620a10d 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 _0x3c8a=['index','/:id','show','post','create','put','update','delete','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x3c8a,0xe1));var _0xa3c8=function(_0xe61544,_0x30b2d2){_0xe61544=_0xe61544-0x0;var _0x58cc3e=_0x3c8a[_0xe61544];return _0x58cc3e;};'use strict';var multer=require(_0xa3c8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa3c8('0x1'));var router=express['Router']();var fs_extra=require(_0xa3c8('0x2'));var auth=require(_0xa3c8('0x3'));var interaction=require(_0xa3c8('0x4'));var config=require(_0xa3c8('0x5'));var controller=require(_0xa3c8('0x6'));router[_0xa3c8('0x7')]('/',auth[_0xa3c8('0x8')](),controller[_0xa3c8('0x9')]);router['get'](_0xa3c8('0xa'),auth['isAuthenticated'](),controller[_0xa3c8('0xb')]);router[_0xa3c8('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3c8('0xd')]);router[_0xa3c8('0xe')]('/:id',auth[_0xa3c8('0x8')](),controller[_0xa3c8('0xf')]);router[_0xa3c8('0x10')](_0xa3c8('0xa'),auth[_0xa3c8('0x8')](),controller['destroy']);module[_0xa3c8('0x11')]=router; \ No newline at end of file +var _0xbb4c=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappApplication.controller','index','/:id','isAuthenticated','show','post','create','update','destroy','exports'];(function(_0x363018,_0x4b7931){var _0x22d1cb=function(_0x2f80b3){while(--_0x2f80b3){_0x363018['push'](_0x363018['shift']());}};_0x22d1cb(++_0x4b7931);}(_0xbb4c,0x1e0));var _0xcbb4=function(_0x49fda7,_0x1d84db){_0x49fda7=_0x49fda7-0x0;var _0x4c6f1f=_0xbb4c[_0x49fda7];return _0x4c6f1f;};'use strict';var multer=require('multer');var util=require(_0xcbb4('0x0'));var path=require(_0xcbb4('0x1'));var timeout=require(_0xcbb4('0x2'));var express=require(_0xcbb4('0x3'));var router=express['Router']();var fs_extra=require(_0xcbb4('0x4'));var auth=require(_0xcbb4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcbb4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xcbb4('0x7')]);router['get'](_0xcbb4('0x8'),auth[_0xcbb4('0x9')](),controller[_0xcbb4('0xa')]);router[_0xcbb4('0xb')]('/',auth[_0xcbb4('0x9')](),controller[_0xcbb4('0xc')]);router['put']('/:id',auth[_0xcbb4('0x9')](),controller[_0xcbb4('0xd')]);router['delete'](_0xcbb4('0x8'),auth['isAuthenticated'](),controller[_0xcbb4('0xe')]);module[_0xcbb4('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 314c461..ba16cff 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 _0x82d9=['noop','TEXT','exports','STRING'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0x82d9,0x132));var _0x982d=function(_0x2039c8,_0x2996c6){_0x2039c8=_0x2039c8-0x0;var _0x22474f=_0x82d9[_0x2039c8];return _0x22474f;};'use strict';var Sequelize=require('sequelize');module[_0x982d('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x982d('0x1')],'allowNull':![],'defaultValue':_0x982d('0x2')},'appdata':{'type':Sequelize[_0x982d('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x982d('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1db2=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x62c646,_0xa08641){var _0x2385f3=function(_0x45b92b){while(--_0x45b92b){_0x62c646['push'](_0x62c646['shift']());}};_0x2385f3(++_0xa08641);}(_0x1db2,0xf4));var _0x21db=function(_0x4561c0,_0x55e47f){_0x4561c0=_0x4561c0-0x0;var _0x39c192=_0x1db2[_0x4561c0];return _0x39c192;};'use strict';var Sequelize=require(_0x21db('0x0'));module[_0x21db('0x1')]={'priority':{'type':Sequelize[_0x21db('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x21db('0x3')],'allowNull':![],'defaultValue':_0x21db('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x21db('0x3')]},'interval':{'type':Sequelize[_0x21db('0x3')],'defaultValue':_0x21db('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 4deb067..274a885 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 _0xd6f9=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','catch','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xd6f9[_0x3d78d7];return _0x4b6784;};'use strict';var emlformat=require(_0x9d6f('0x0'));var rimraf=require(_0x9d6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d6f('0x2'));var moment=require(_0x9d6f('0x3'));var BPromise=require(_0x9d6f('0x4'));var Mustache=require(_0x9d6f('0x5'));var util=require('util');var path=require(_0x9d6f('0x6'));var sox=require(_0x9d6f('0x7'));var csv=require(_0x9d6f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d6f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9d6f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9d6f('0xb'));var toCsv=require(_0x9d6f('0x8'));var querystring=require(_0x9d6f('0xc'));var Papa=require(_0x9d6f('0xd'));var Redis=require(_0x9d6f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d6f('0xf'));var logger=require(_0x9d6f('0x10'))(_0x9d6f('0x11'));var utils=require(_0x9d6f('0x12'));var config=require(_0x9d6f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d6f('0x14'))['db'];function respondWithStatusCode(_0x736008,_0x29ce37){_0x29ce37=_0x29ce37||0xcc;return function(_0x2e19a5){if(_0x2e19a5){return _0x736008[_0x9d6f('0x15')](_0x29ce37);}return _0x736008['status'](_0x29ce37)[_0x9d6f('0x16')]();};}function respondWithResult(_0x2da36f,_0x34e8dd){_0x34e8dd=_0x34e8dd||0xc8;return function(_0x3916f1){if(_0x3916f1){return _0x2da36f[_0x9d6f('0x17')](_0x34e8dd)['json'](_0x3916f1);}};}function respondWithFilteredResult(_0x149557,_0x2f927a){return function(_0x41546b){if(_0x41546b){var _0x509713=typeof _0x2f927a['offset']===_0x9d6f('0x18')&&typeof _0x2f927a[_0x9d6f('0x19')]===_0x9d6f('0x18');var _0x251ce5=_0x41546b['count'];var _0x433555=_0x509713?0x0:_0x2f927a[_0x9d6f('0x1a')];var _0x556ac7=_0x509713?_0x41546b[_0x9d6f('0x1b')]:_0x2f927a[_0x9d6f('0x1a')]+_0x2f927a[_0x9d6f('0x19')];var _0x4e9598;if(_0x556ac7>=_0x251ce5){_0x556ac7=_0x251ce5;_0x4e9598=0xc8;}else{_0x4e9598=0xce;}_0x149557[_0x9d6f('0x17')](_0x4e9598);return _0x149557[_0x9d6f('0x1c')](_0x9d6f('0x1d'),_0x433555+'-'+_0x556ac7+'/'+_0x251ce5)['json'](_0x41546b);}return null;};}function patchUpdates(_0x3ce2ca){return function(_0x339b40){try{jsonpatch[_0x9d6f('0x1e')](_0x339b40,_0x3ce2ca,!![]);}catch(_0x9fa1b5){return BPromise[_0x9d6f('0x1f')](_0x9fa1b5);}return _0x339b40['save']();};}function saveUpdates(_0x770eab,_0x312de5){return function(_0x3e9ad3){if(_0x3e9ad3){return _0x3e9ad3[_0x9d6f('0x20')](_0x770eab)['then'](function(_0x16175d){return _0x16175d;});}return null;};}function removeEntity(_0x21f538,_0x367d48){return function(_0x2a13dc){if(_0x2a13dc){return _0x2a13dc[_0x9d6f('0x21')]()[_0x9d6f('0x22')](function(){_0x21f538[_0x9d6f('0x17')](0xcc)[_0x9d6f('0x16')]();});}};}function handleEntityNotFound(_0x6d51d8,_0x10ec7a){return function(_0x233c17){if(!_0x233c17){_0x6d51d8['sendStatus'](0x194);}return _0x233c17;};}function handleError(_0x6b51a5,_0x44aee2){_0x44aee2=_0x44aee2||0x1f4;return function(_0x3c2714){logger['error'](_0x3c2714[_0x9d6f('0x23')]);if(_0x3c2714['name']){delete _0x3c2714[_0x9d6f('0x24')];}_0x6b51a5[_0x9d6f('0x17')](_0x44aee2)[_0x9d6f('0x25')](_0x3c2714);};}exports[_0x9d6f('0x26')]=function(_0x4b25a5,_0x4f343e){var _0x51ade6={},_0x545b0c={},_0x162126={'count':0x0,'rows':[]};var _0x410c8c=_[_0x9d6f('0x27')](db[_0x9d6f('0x28')][_0x9d6f('0x29')],function(_0x489185){return{'name':_0x489185[_0x9d6f('0x2a')],'type':_0x489185[_0x9d6f('0x2b')][_0x9d6f('0x2c')]};});_0x545b0c[_0x9d6f('0x2d')]=_[_0x9d6f('0x27')](_0x410c8c,_0x9d6f('0x24'));_0x545b0c[_0x9d6f('0x2e')]=_[_0x9d6f('0x2f')](_0x4b25a5[_0x9d6f('0x2e')]);_0x545b0c[_0x9d6f('0x30')]=_[_0x9d6f('0x31')](_0x545b0c[_0x9d6f('0x2d')],_0x545b0c[_0x9d6f('0x2e')]);_0x51ade6[_0x9d6f('0x32')]=_['intersection'](_0x545b0c[_0x9d6f('0x2d')],qs['fields'](_0x4b25a5['query'][_0x9d6f('0x33')]));_0x51ade6[_0x9d6f('0x32')]=_0x51ade6[_0x9d6f('0x32')][_0x9d6f('0x34')]?_0x51ade6[_0x9d6f('0x32')]:_0x545b0c[_0x9d6f('0x2d')];if(!_0x4b25a5[_0x9d6f('0x2e')][_0x9d6f('0x35')](_0x9d6f('0x36'))){_0x51ade6[_0x9d6f('0x19')]=qs[_0x9d6f('0x19')](_0x4b25a5[_0x9d6f('0x2e')]['limit']);_0x51ade6[_0x9d6f('0x1a')]=qs[_0x9d6f('0x1a')](_0x4b25a5[_0x9d6f('0x2e')][_0x9d6f('0x1a')]);}_0x51ade6[_0x9d6f('0x37')]=qs[_0x9d6f('0x38')](_0x4b25a5[_0x9d6f('0x2e')][_0x9d6f('0x38')]);_0x51ade6['where']=qs[_0x9d6f('0x30')](_[_0x9d6f('0x39')](_0x4b25a5['query'],_0x545b0c[_0x9d6f('0x30')]),_0x410c8c);if(_0x4b25a5['query'][_0x9d6f('0x3a')]){_0x51ade6[_0x9d6f('0x3b')]=_['merge'](_0x51ade6[_0x9d6f('0x3b')],{'$or':_[_0x9d6f('0x27')](_0x410c8c,function(_0x39ad4b){if(_0x39ad4b['type']!==_0x9d6f('0x3c')){var _0x54c8dc={};_0x54c8dc[_0x39ad4b[_0x9d6f('0x24')]]={'$like':'%'+_0x4b25a5[_0x9d6f('0x2e')][_0x9d6f('0x3a')]+'%'};return _0x54c8dc;}})});}_0x51ade6=_[_0x9d6f('0x3d')]({},_0x51ade6,_0x4b25a5[_0x9d6f('0x3e')]);var _0x1d6c08={'where':_0x51ade6['where']};return db[_0x9d6f('0x28')][_0x9d6f('0x1b')](_0x1d6c08)['then'](function(_0x2fb805){_0x162126[_0x9d6f('0x1b')]=_0x2fb805;if(_0x4b25a5[_0x9d6f('0x2e')][_0x9d6f('0x3f')]){_0x51ade6[_0x9d6f('0x40')]=[{'all':!![]}];}return db[_0x9d6f('0x28')][_0x9d6f('0x41')](_0x51ade6);})[_0x9d6f('0x22')](function(_0x3a19f8){_0x162126[_0x9d6f('0x42')]=_0x3a19f8;return _0x162126;})[_0x9d6f('0x22')](respondWithFilteredResult(_0x4f343e,_0x51ade6))['catch'](handleError(_0x4f343e,null));};exports['show']=function(_0x254703,_0x4992cd){var _0x175b80={'raw':!![],'where':{'id':_0x254703[_0x9d6f('0x43')]['id']}},_0x5602f9={};_0x5602f9['model']=_[_0x9d6f('0x2f')](db['WhatsappApplication'][_0x9d6f('0x29')]);_0x5602f9['query']=_['keys'](_0x254703['query']);_0x5602f9[_0x9d6f('0x30')]=_[_0x9d6f('0x31')](_0x5602f9['model'],_0x5602f9[_0x9d6f('0x2e')]);_0x175b80[_0x9d6f('0x32')]=_['intersection'](_0x5602f9[_0x9d6f('0x2d')],qs[_0x9d6f('0x33')](_0x254703[_0x9d6f('0x2e')][_0x9d6f('0x33')]));_0x175b80[_0x9d6f('0x32')]=_0x175b80['attributes'][_0x9d6f('0x34')]?_0x175b80[_0x9d6f('0x32')]:_0x5602f9[_0x9d6f('0x2d')];if(_0x254703[_0x9d6f('0x2e')][_0x9d6f('0x3f')]){_0x175b80[_0x9d6f('0x40')]=[{'all':!![]}];}_0x175b80=_[_0x9d6f('0x3d')]({},_0x175b80,_0x254703[_0x9d6f('0x3e')]);return db[_0x9d6f('0x28')]['find'](_0x175b80)[_0x9d6f('0x22')](handleEntityNotFound(_0x4992cd,null))[_0x9d6f('0x22')](respondWithResult(_0x4992cd,null))[_0x9d6f('0x44')](handleError(_0x4992cd,null));};exports[_0x9d6f('0x45')]=function(_0x17ca02,_0x12611c){return db['WhatsappApplication'][_0x9d6f('0x45')](_0x17ca02[_0x9d6f('0x46')],{})[_0x9d6f('0x22')](respondWithResult(_0x12611c,0xc9))['catch'](handleError(_0x12611c,null));};exports['update']=function(_0x42c209,_0x4ef463){if(_0x42c209[_0x9d6f('0x46')]['id']){delete _0x42c209[_0x9d6f('0x46')]['id'];}return db[_0x9d6f('0x28')][_0x9d6f('0x47')]({'where':{'id':_0x42c209[_0x9d6f('0x43')]['id']}})[_0x9d6f('0x22')](handleEntityNotFound(_0x4ef463,null))[_0x9d6f('0x22')](saveUpdates(_0x42c209[_0x9d6f('0x46')],null))[_0x9d6f('0x22')](respondWithResult(_0x4ef463,null))[_0x9d6f('0x44')](handleError(_0x4ef463,null));};exports[_0x9d6f('0x21')]=function(_0x388d31,_0x40842a){return db[_0x9d6f('0x28')][_0x9d6f('0x47')]({'where':{'id':_0x388d31[_0x9d6f('0x43')]['id']}})[_0x9d6f('0x22')](handleEntityNotFound(_0x40842a,null))[_0x9d6f('0x22')](removeEntity(_0x40842a,null))[_0x9d6f('0x44')](handleError(_0x40842a,null));}; \ No newline at end of file +var _0xa057=['keys','length','includeAll','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','error','stack','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','params'];(function(_0x352b44,_0x4a91a1){var _0x3e8baa=function(_0xed4bc3){while(--_0xed4bc3){_0x352b44['push'](_0x352b44['shift']());}};_0x3e8baa(++_0x4a91a1);}(_0xa057,0x123));var _0x7a05=function(_0x249c09,_0x1fc428){_0x249c09=_0x249c09-0x0;var _0x3ddabd=_0xa057[_0x249c09];return _0x3ddabd;};'use strict';var emlformat=require(_0x7a05('0x0'));var rimraf=require(_0x7a05('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a05('0x2'));var rp=require(_0x7a05('0x3'));var moment=require(_0x7a05('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a05('0x5'));var util=require(_0x7a05('0x6'));var path=require('path');var sox=require(_0x7a05('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a05('0x8'));var _=require(_0x7a05('0x9'));var squel=require(_0x7a05('0xa'));var crypto=require('crypto');var jsforce=require(_0x7a05('0xb'));var deskjs=require(_0x7a05('0xc'));var toCsv=require(_0x7a05('0xd'));var querystring=require('querystring');var Papa=require(_0x7a05('0xe'));var Redis=require(_0x7a05('0xf'));var authService=require(_0x7a05('0x10'));var qs=require(_0x7a05('0x11'));var as=require(_0x7a05('0x12'));var hardwareService=require(_0x7a05('0x13'));var logger=require('../../config/logger')(_0x7a05('0x14'));var utils=require(_0x7a05('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7a05('0x16'))['db'];function respondWithStatusCode(_0x4552be,_0x54c353){_0x54c353=_0x54c353||0xcc;return function(_0x5e9da4){if(_0x5e9da4){return _0x4552be['sendStatus'](_0x54c353);}return _0x4552be[_0x7a05('0x17')](_0x54c353)[_0x7a05('0x18')]();};}function respondWithResult(_0x3eac61,_0x2d4ba6){_0x2d4ba6=_0x2d4ba6||0xc8;return function(_0x31c140){if(_0x31c140){return _0x3eac61[_0x7a05('0x17')](_0x2d4ba6)[_0x7a05('0x19')](_0x31c140);}};}function respondWithFilteredResult(_0x26a9d8,_0x482f49){return function(_0x49d016){if(_0x49d016){var _0x37d394=typeof _0x482f49[_0x7a05('0x1a')]==='undefined'&&typeof _0x482f49[_0x7a05('0x1b')]===_0x7a05('0x1c');var _0x4cfd13=_0x49d016[_0x7a05('0x1d')];var _0x449d86=_0x37d394?0x0:_0x482f49[_0x7a05('0x1a')];var _0x5a9477=_0x37d394?_0x49d016['count']:_0x482f49[_0x7a05('0x1a')]+_0x482f49['limit'];var _0xe4263a;if(_0x5a9477>=_0x4cfd13){_0x5a9477=_0x4cfd13;_0xe4263a=0xc8;}else{_0xe4263a=0xce;}_0x26a9d8[_0x7a05('0x17')](_0xe4263a);return _0x26a9d8['set']('Content-Range',_0x449d86+'-'+_0x5a9477+'/'+_0x4cfd13)['json'](_0x49d016);}return null;};}function patchUpdates(_0x2acc80){return function(_0x296177){try{jsonpatch[_0x7a05('0x1e')](_0x296177,_0x2acc80,!![]);}catch(_0x288581){return BPromise['reject'](_0x288581);}return _0x296177[_0x7a05('0x1f')]();};}function saveUpdates(_0x391ecf,_0x3e9ef2){return function(_0x593c1b){if(_0x593c1b){return _0x593c1b[_0x7a05('0x20')](_0x391ecf)[_0x7a05('0x21')](function(_0x2278ce){return _0x2278ce;});}return null;};}function removeEntity(_0x352571,_0x1b62de){return function(_0x472bdd){if(_0x472bdd){return _0x472bdd[_0x7a05('0x22')]()[_0x7a05('0x21')](function(){_0x352571[_0x7a05('0x17')](0xcc)[_0x7a05('0x18')]();});}};}function handleEntityNotFound(_0x2c2390,_0x4beb4a){return function(_0x591ab5){if(!_0x591ab5){_0x2c2390['sendStatus'](0x194);}return _0x591ab5;};}function handleError(_0x39fb1c,_0x172d79){_0x172d79=_0x172d79||0x1f4;return function(_0x124697){logger[_0x7a05('0x23')](_0x124697[_0x7a05('0x24')]);if(_0x124697[_0x7a05('0x25')]){delete _0x124697[_0x7a05('0x25')];}_0x39fb1c[_0x7a05('0x17')](_0x172d79)[_0x7a05('0x26')](_0x124697);};}exports['index']=function(_0x49e37b,_0x20a4f2){var _0x57e4e2={},_0x4f26bc={},_0x2cd660={'count':0x0,'rows':[]};var _0x2ceb54=_[_0x7a05('0x27')](db[_0x7a05('0x28')][_0x7a05('0x29')],function(_0x57f237){return{'name':_0x57f237[_0x7a05('0x2a')],'type':_0x57f237[_0x7a05('0x2b')][_0x7a05('0x2c')]};});_0x4f26bc['model']=_[_0x7a05('0x27')](_0x2ceb54,_0x7a05('0x25'));_0x4f26bc[_0x7a05('0x2d')]=_['keys'](_0x49e37b[_0x7a05('0x2d')]);_0x4f26bc[_0x7a05('0x2e')]=_[_0x7a05('0x2f')](_0x4f26bc[_0x7a05('0x30')],_0x4f26bc['query']);_0x57e4e2[_0x7a05('0x31')]=_['intersection'](_0x4f26bc[_0x7a05('0x30')],qs[_0x7a05('0x32')](_0x49e37b['query'][_0x7a05('0x32')]));_0x57e4e2[_0x7a05('0x31')]=_0x57e4e2[_0x7a05('0x31')]['length']?_0x57e4e2[_0x7a05('0x31')]:_0x4f26bc[_0x7a05('0x30')];if(!_0x49e37b['query'][_0x7a05('0x33')](_0x7a05('0x34'))){_0x57e4e2['limit']=qs['limit'](_0x49e37b[_0x7a05('0x2d')][_0x7a05('0x1b')]);_0x57e4e2['offset']=qs[_0x7a05('0x1a')](_0x49e37b[_0x7a05('0x2d')][_0x7a05('0x1a')]);}_0x57e4e2[_0x7a05('0x35')]=qs['sort'](_0x49e37b[_0x7a05('0x2d')][_0x7a05('0x36')]);_0x57e4e2[_0x7a05('0x37')]=qs[_0x7a05('0x2e')](_['pick'](_0x49e37b['query'],_0x4f26bc[_0x7a05('0x2e')]),_0x2ceb54);if(_0x49e37b['query'][_0x7a05('0x38')]){_0x57e4e2['where']=_['merge'](_0x57e4e2[_0x7a05('0x37')],{'$or':_[_0x7a05('0x27')](_0x2ceb54,function(_0xfee54a){if(_0xfee54a[_0x7a05('0x2b')]!==_0x7a05('0x39')){var _0x708610={};_0x708610[_0xfee54a[_0x7a05('0x25')]]={'$like':'%'+_0x49e37b[_0x7a05('0x2d')][_0x7a05('0x38')]+'%'};return _0x708610;}})});}_0x57e4e2=_[_0x7a05('0x3a')]({},_0x57e4e2,_0x49e37b['options']);var _0x51e5a3={'where':_0x57e4e2[_0x7a05('0x37')]};return db[_0x7a05('0x28')][_0x7a05('0x1d')](_0x51e5a3)[_0x7a05('0x21')](function(_0x56391c){_0x2cd660[_0x7a05('0x1d')]=_0x56391c;if(_0x49e37b[_0x7a05('0x2d')]['includeAll']){_0x57e4e2[_0x7a05('0x3b')]=[{'all':!![]}];}return db[_0x7a05('0x28')][_0x7a05('0x3c')](_0x57e4e2);})[_0x7a05('0x21')](function(_0x10b64a){_0x2cd660[_0x7a05('0x3d')]=_0x10b64a;return _0x2cd660;})[_0x7a05('0x21')](respondWithFilteredResult(_0x20a4f2,_0x57e4e2))[_0x7a05('0x3e')](handleError(_0x20a4f2,null));};exports['show']=function(_0x411f47,_0x1ab496){var _0x255d61={'raw':!![],'where':{'id':_0x411f47[_0x7a05('0x3f')]['id']}},_0x487e85={};_0x487e85[_0x7a05('0x30')]=_[_0x7a05('0x40')](db[_0x7a05('0x28')]['rawAttributes']);_0x487e85[_0x7a05('0x2d')]=_['keys'](_0x411f47['query']);_0x487e85[_0x7a05('0x2e')]=_[_0x7a05('0x2f')](_0x487e85['model'],_0x487e85[_0x7a05('0x2d')]);_0x255d61[_0x7a05('0x31')]=_[_0x7a05('0x2f')](_0x487e85[_0x7a05('0x30')],qs[_0x7a05('0x32')](_0x411f47[_0x7a05('0x2d')][_0x7a05('0x32')]));_0x255d61[_0x7a05('0x31')]=_0x255d61[_0x7a05('0x31')][_0x7a05('0x41')]?_0x255d61[_0x7a05('0x31')]:_0x487e85[_0x7a05('0x30')];if(_0x411f47[_0x7a05('0x2d')][_0x7a05('0x42')]){_0x255d61[_0x7a05('0x3b')]=[{'all':!![]}];}_0x255d61=_['merge']({},_0x255d61,_0x411f47[_0x7a05('0x43')]);return db[_0x7a05('0x28')][_0x7a05('0x44')](_0x255d61)[_0x7a05('0x21')](handleEntityNotFound(_0x1ab496,null))['then'](respondWithResult(_0x1ab496,null))[_0x7a05('0x3e')](handleError(_0x1ab496,null));};exports[_0x7a05('0x45')]=function(_0x18c7fa,_0x906d08){return db['WhatsappApplication'][_0x7a05('0x45')](_0x18c7fa['body'],{})[_0x7a05('0x21')](respondWithResult(_0x906d08,0xc9))[_0x7a05('0x3e')](handleError(_0x906d08,null));};exports['update']=function(_0x380877,_0x1b5b6a){if(_0x380877[_0x7a05('0x46')]['id']){delete _0x380877['body']['id'];}return db[_0x7a05('0x28')][_0x7a05('0x44')]({'where':{'id':_0x380877[_0x7a05('0x3f')]['id']}})[_0x7a05('0x21')](handleEntityNotFound(_0x1b5b6a,null))['then'](saveUpdates(_0x380877[_0x7a05('0x46')],null))['then'](respondWithResult(_0x1b5b6a,null))[_0x7a05('0x3e')](handleError(_0x1b5b6a,null));};exports[_0x7a05('0x22')]=function(_0x22e141,_0x10fda2){return db[_0x7a05('0x28')][_0x7a05('0x44')]({'where':{'id':_0x22e141[_0x7a05('0x3f')]['id']}})[_0x7a05('0x21')](handleEntityNotFound(_0x10fda2,null))[_0x7a05('0x21')](removeEntity(_0x10fda2,null))[_0x7a05('0x3e')](handleError(_0x10fda2,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 563ddb0..a1503ba 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 _0xb7a8=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x23ed37,_0x5e7786){var _0x4685f2=function(_0x530e31){while(--_0x530e31){_0x23ed37['push'](_0x23ed37['shift']());}};_0x4685f2(++_0x5e7786);}(_0xb7a8,0xec));var _0x8b7a=function(_0x54331a,_0x1c66cf){_0x54331a=_0x54331a-0x0;var _0x3dfb79=_0xb7a8[_0x54331a];return _0x3dfb79;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))('api');var moment=require(_0x8b7a('0x2'));var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var attributes=require(_0x8b7a('0x7'));module[_0x8b7a('0x8')]=function(_0x1d61f3,_0x42e4c1){return _0x1d61f3[_0x8b7a('0x9')](_0x8b7a('0xa'),attributes,{'tableName':_0x8b7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b7a('0xc'),'collate':_0x8b7a('0xd')});}; \ No newline at end of file +var _0xfd28=['moment','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x20e07d,_0x40856b){var _0x6de9fb=function(_0x480562){while(--_0x480562){_0x20e07d['push'](_0x20e07d['shift']());}};_0x6de9fb(++_0x40856b);}(_0xfd28,0x148));var _0x8fd2=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0xfd28[_0x318840];return _0x223da4;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var logger=require(_0x8fd2('0x1'))('api');var moment=require(_0x8fd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x8fd2('0x3'));var fs=require('fs');var path=require(_0x8fd2('0x4'));var rimraf=require(_0x8fd2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fd2('0x6'));module[_0x8fd2('0x7')]=function(_0x2ee87e,_0x36178a){return _0x2ee87e[_0x8fd2('0x8')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8fd2('0x9'),'collate':_0x8fd2('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 4406acc..8b27d65 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 _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1c7305,_0x35f822){var _0x188819=function(_0x432b2d){while(--_0x432b2d){_0x1c7305['push'](_0x1c7305['shift']());}};_0x188819(++_0x35f822);}(_0x81bd,0x7c));var _0xd81b=function(_0x433c11,_0x509a13){_0x433c11=_0x433c11-0x0;var _0x1bbb06=_0x81bd[_0x433c11];return _0x1bbb06;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});} \ No newline at end of file +var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x6b8e6,_0x5b5b8d){var _0x11e8d9=function(_0x27609b){while(--_0x27609b){_0x6b8e6['push'](_0x6b8e6['shift']());}};_0x11e8d9(++_0x5b5b8d);}(_0x2d17,0x17e));var _0x72d1=function(_0x4320cd,_0x142d9a){_0x4320cd=_0x4320cd-0x0;var _0x3f8915=_0x2d17[_0x4320cd];return _0x3f8915;};'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});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 8236c53..9865bd2 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 _0xfb65=['/:id/tags','tracked','addTags','put','whatsapp','update','delete','destroy','removeTags','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage'];(function(_0x5170a1,_0x9d1f87){var _0x3733bf=function(_0x20167d){while(--_0x20167d){_0x5170a1['push'](_0x5170a1['shift']());}};_0x3733bf(++_0x9d1f87);}(_0xfb65,0x82));var _0x5fb6=function(_0x373eab,_0x53165e){_0x373eab=_0x373eab-0x0;var _0x2ca5c3=_0xfb65[_0x373eab];return _0x2ca5c3;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0x8')]('/:id/messages',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xe')]);router['get'](_0x5fb6('0xf'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x10')]);router[_0x5fb6('0x11')]('/',auth[_0x5fb6('0xa')](),controller['create']);router[_0x5fb6('0x11')](_0x5fb6('0x12'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x13')]);router[_0x5fb6('0x11')](_0x5fb6('0x14'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')]('whatsapp','whatsappinteraction:addtags'),controller[_0x5fb6('0x16')]);router[_0x5fb6('0x17')]('/:id',auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:update'),controller[_0x5fb6('0x19')]);router[_0x5fb6('0x1a')](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),interaction[_0x5fb6('0x15')](_0x5fb6('0x18'),'whatsappinteraction:destroy'),controller[_0x5fb6('0x1b')]);router['delete'](_0x5fb6('0x14'),auth['isAuthenticated'](),controller[_0x5fb6('0x1c')]);module[_0x5fb6('0x1d')]=router; \ No newline at end of file +var _0xc492=['describe','/:id','/:id/download','download','post','create','/:id/messages','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0xc492,0xd7));var _0x2c49=function(_0x505149,_0x335360){_0x505149=_0x505149-0x0;var _0x467996=_0xc492[_0x505149];return _0x467996;};'use strict';var multer=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var path=require(_0x2c49('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c49('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x2c49('0x6')]('/',auth['isAuthenticated'](),controller[_0x2c49('0x7')]);router[_0x2c49('0x6')]('/describe',auth[_0x2c49('0x8')](),controller[_0x2c49('0x9')]);router[_0x2c49('0x6')](_0x2c49('0xa'),auth[_0x2c49('0x8')](),controller['show']);router[_0x2c49('0x6')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x2c49('0xb'),auth['isAuthenticated'](),controller[_0x2c49('0xc')]);router[_0x2c49('0xd')]('/',auth['isAuthenticated'](),controller[_0x2c49('0xe')]);router[_0x2c49('0xd')](_0x2c49('0xf'),auth[_0x2c49('0x8')](),controller[_0x2c49('0x10')]);router[_0x2c49('0xd')]('/:id/tags',auth[_0x2c49('0x8')](),interaction[_0x2c49('0x11')](_0x2c49('0x12'),_0x2c49('0x13')),controller[_0x2c49('0x14')]);router['put'](_0x2c49('0xa'),auth[_0x2c49('0x8')](),interaction[_0x2c49('0x11')](_0x2c49('0x12'),_0x2c49('0x15')),controller[_0x2c49('0x16')]);router[_0x2c49('0x17')](_0x2c49('0xa'),auth[_0x2c49('0x8')](),interaction[_0x2c49('0x11')]('whatsapp',_0x2c49('0x18')),controller[_0x2c49('0x19')]);router[_0x2c49('0x17')](_0x2c49('0x1a'),auth['isAuthenticated'](),controller[_0x2c49('0x1b')]);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 d43dba7..5872f4c 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 _0x8375=['BOOLEAN','DATE','STRING','ENUM','out','moment','exports'];(function(_0x18aeeb,_0x312739){var _0x5af9d1=function(_0x40d526){while(--_0x40d526){_0x18aeeb['push'](_0x18aeeb['shift']());}};_0x5af9d1(++_0x312739);}(_0x8375,0x132));var _0x5837=function(_0x3feee7,_0x4b358b){_0x3feee7=_0x3feee7-0x0;var _0x125e00=_0x8375[_0x3feee7];return _0x125e00;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5837('0x0'));module[_0x5837('0x1')]={'closed':{'type':Sequelize[_0x5837('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5837('0x3')]},'disposition':{'type':Sequelize[_0x5837('0x4')]},'secondDisposition':{'type':Sequelize[_0x5837('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5837('0x4')]},'phone':{'type':Sequelize[_0x5837('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x5837('0x5')]('in',_0x5837('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5837('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5837('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5837('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5c1f=['STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x245cab,_0x565284){var _0x144703=function(_0xcbc535){while(--_0xcbc535){_0x245cab['push'](_0x245cab['shift']());}};_0x144703(++_0x565284);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x5c1f[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0xf5c1('0x0'));var moment=require('moment');module[_0xf5c1('0x1')]={'closed':{'type':Sequelize[_0xf5c1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf5c1('0x3')]},'secondDisposition':{'type':Sequelize[_0xf5c1('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf5c1('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xf5c1('0x4')]('in',_0xf5c1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf5c1('0x4')]('in',_0xf5c1('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf5c1('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index a13334b..7bb34fa 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 _0x9f5f=['firstName','lastName','Attachment','Messages','createdAt','direction','read','Owner','get','mkdirSync','Whatsapp','Account','N.A.','toString','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','out','secret','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','rimraf','moment','bluebird','util','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','then','destroy','error','stack','name','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','whatsapp','query','user','show','params','model','keys','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','create','body','update','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','User','fullname','push','Contact'];(function(_0x52f09a,_0x208285){var _0x35588d=function(_0x1f8c8e){while(--_0x1f8c8e){_0x52f09a['push'](_0x52f09a['shift']());}};_0x35588d(++_0x208285);}(_0x9f5f,0x197));var _0xf9f5=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x9f5f[_0x11005e];return _0x29338f;};'use strict';var rimraf=require(_0xf9f5('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf9f5('0x1'));var BPromise=require(_0xf9f5('0x2'));var util=require(_0xf9f5('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xf9f5('0x4'));var qs=require(_0xf9f5('0x5'));var pdf=require('../../components/export/pdf');var logger=require(_0xf9f5('0x6'))(_0xf9f5('0x7'));var config=require(_0xf9f5('0x8'));var db=require(_0xf9f5('0x9'))['db'];config['redis']=_[_0xf9f5('0xa')](config[_0xf9f5('0xb')],{'host':_0xf9f5('0xc'),'port':0x18eb});var socket=require(_0xf9f5('0xd'))(new Redis(config[_0xf9f5('0xb')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1161b4,_0x418c74){_0x418c74=_0x418c74||0xcc;return function(_0x4192d7){if(_0x4192d7){return _0x1161b4[_0xf9f5('0xe')](_0x418c74);}return _0x1161b4[_0xf9f5('0xf')](_0x418c74)[_0xf9f5('0x10')]();};}function respondWithResult(_0x33ed2f,_0x59dbb7){_0x59dbb7=_0x59dbb7||0xc8;return function(_0x24a40d){if(_0x24a40d){return _0x33ed2f[_0xf9f5('0xf')](_0x59dbb7)[_0xf9f5('0x11')](_0x24a40d);}};}function respondWithFilteredResult(_0x1a76ea,_0x2a444f){return function(_0x47d5f7){if(_0x47d5f7){var _0x4929a6=typeof _0x2a444f['offset']==='undefined'&&typeof _0x2a444f[_0xf9f5('0x12')]===_0xf9f5('0x13');var _0x2a84b6=_0x47d5f7[_0xf9f5('0x14')];var _0x26565e=_0x4929a6?0x0:_0x2a444f['offset'];var _0xba90d6=_0x4929a6?_0x47d5f7[_0xf9f5('0x14')]:_0x2a444f[_0xf9f5('0x15')]+_0x2a444f[_0xf9f5('0x12')];var _0x353777;if(_0xba90d6>=_0x2a84b6){_0xba90d6=_0x2a84b6;_0x353777=0xc8;}else{_0x353777=0xce;}_0x1a76ea['status'](_0x353777);return _0x1a76ea['set'](_0xf9f5('0x16'),_0x26565e+'-'+_0xba90d6+'/'+_0x2a84b6)[_0xf9f5('0x11')](_0x47d5f7);}return null;};}function saveUpdates(_0x56ae55){return function(_0x167632){if(_0x167632){return _0x167632['update'](_0x56ae55)[_0xf9f5('0x17')](function(_0x46e6f1){return _0x46e6f1;});}return null;};}function removeEntity(_0x307f84){return function(_0x98581c){if(_0x98581c){return _0x98581c[_0xf9f5('0x18')]()[_0xf9f5('0x17')](function(){_0x307f84[_0xf9f5('0xf')](0xcc)[_0xf9f5('0x10')]();});}};}function handleEntityNotFound(_0x407c09){return function(_0x2267c4){if(!_0x2267c4){_0x407c09['sendStatus'](0x194);}return _0x2267c4;};}function handleError(_0x5f3e04,_0x530636){_0x530636=_0x530636||0x1f4;return function(_0x268994){logger[_0xf9f5('0x19')](_0x268994[_0xf9f5('0x1a')]);if(_0x268994[_0xf9f5('0x1b')]){delete _0x268994[_0xf9f5('0x1b')];}_0x5f3e04[_0xf9f5('0xf')](_0x530636)['send'](_0x268994);};}exports[_0xf9f5('0x1c')]=function(_0x43272d,_0x2ccd6e){var _0x132caa={};var _0x57ddad=_['map'](db[_0xf9f5('0x1d')][_0xf9f5('0x1e')],function(_0x3efaf3){return{'name':_0x3efaf3[_0xf9f5('0x1f')],'type':_0x3efaf3[_0xf9f5('0x20')][_0xf9f5('0x21')]};});_0x132caa=qs[_0xf9f5('0x22')](_0x57ddad,_0x43272d);return interaction['findAll'](_0xf9f5('0x23'),_0x43272d[_0xf9f5('0x24')],_0x43272d[_0xf9f5('0x25')],_0x132caa,_0x57ddad)[_0xf9f5('0x17')](respondWithFilteredResult(_0x2ccd6e,_0x132caa))['catch'](handleError(_0x2ccd6e,null));};exports[_0xf9f5('0x26')]=function(_0x5ef848,_0x4232ae){var _0x47f70d={'raw':![],'where':{'id':_0x5ef848[_0xf9f5('0x27')]['id']}},_0x55b046={};_0x55b046[_0xf9f5('0x28')]=_[_0xf9f5('0x29')](db['WhatsappInteraction'][_0xf9f5('0x1e')]);_0x55b046['query']=_[_0xf9f5('0x29')](_0x5ef848[_0xf9f5('0x24')]);_0x55b046[_0xf9f5('0x2a')]=_['intersection'](_0x55b046[_0xf9f5('0x28')],_0x55b046[_0xf9f5('0x24')]);_0x47f70d[_0xf9f5('0x2b')]=_[_0xf9f5('0x2c')](_0x55b046[_0xf9f5('0x28')],qs[_0xf9f5('0x2d')](_0x5ef848[_0xf9f5('0x24')][_0xf9f5('0x2d')]));_0x47f70d['attributes']=_0x47f70d[_0xf9f5('0x2b')]['length']?_0x47f70d[_0xf9f5('0x2b')]:_0x55b046['model'];if(_0x5ef848['query'][_0xf9f5('0x2e')]){_0x47f70d['include']=[{'all':!![]}];}_0x47f70d=_[_0xf9f5('0x2f')]({},_0x47f70d,_0x5ef848[_0xf9f5('0x30')]);return db[_0xf9f5('0x1d')][_0xf9f5('0x31')](_0x47f70d)[_0xf9f5('0x17')](handleEntityNotFound(_0x4232ae,null))[_0xf9f5('0x17')](respondWithResult(_0x4232ae,null))[_0xf9f5('0x32')](handleError(_0x4232ae,null));};exports[_0xf9f5('0x33')]=function(_0x431002,_0x5112dc){return db[_0xf9f5('0x1d')][_0xf9f5('0x33')](_0x431002[_0xf9f5('0x34')],{})[_0xf9f5('0x17')](respondWithResult(_0x5112dc,0xc9))[_0xf9f5('0x32')](handleError(_0x5112dc,null));};exports[_0xf9f5('0x35')]=function(_0x7856b3,_0x154704){if(_0x7856b3[_0xf9f5('0x34')]['id']){delete _0x7856b3['body']['id'];}return db[_0xf9f5('0x1d')][_0xf9f5('0x31')]({'where':{'id':_0x7856b3[_0xf9f5('0x27')]['id']}})['then'](handleEntityNotFound(_0x154704,null))['then'](saveUpdates(_0x7856b3[_0xf9f5('0x34')],null))['then'](respondWithResult(_0x154704,null))[_0xf9f5('0x32')](handleError(_0x154704,null));};exports[_0xf9f5('0x18')]=function(_0x172ba0,_0x4d255c){return db[_0xf9f5('0x1d')][_0xf9f5('0x31')]({'where':{'id':_0x172ba0['params']['id']}})[_0xf9f5('0x17')](handleEntityNotFound(_0x4d255c,null))[_0xf9f5('0x17')](removeEntity(_0x4d255c,null))['catch'](handleError(_0x4d255c,null));};exports[_0xf9f5('0x36')]=function(_0x172995,_0x18887b){return db['WhatsappInteraction'][_0xf9f5('0x36')]()[_0xf9f5('0x17')](respondWithResult(_0x18887b,null))[_0xf9f5('0x32')](handleError(_0x18887b,null));};exports[_0xf9f5('0x37')]=function(_0x1631bb,_0xffbb4c){return db[_0xf9f5('0x38')][_0xf9f5('0x31')]({'where':{'id':_0x1631bb['params']['id']}})[_0xf9f5('0x17')](handleEntityNotFound(_0xffbb4c,null))['then'](function(_0x3001c5){if(_0x3001c5){return _0x3001c5[_0xf9f5('0x37')](_0x1631bb['body'][_0xf9f5('0x39')],_[_0xf9f5('0x3a')](_0x1631bb[_0xf9f5('0x34')],['ids','id'])||{});}})[_0xf9f5('0x17')](respondWithResult(_0xffbb4c,null))[_0xf9f5('0x32')](handleError(_0xffbb4c,null));};exports[_0xf9f5('0x3b')]=function(_0x207b65,_0x449c8a){var _0xc5baac={'raw':![],'where':{}};var _0x57e764={};var _0x1a7d30={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xf9f5('0x3c')]({'where':{'id':_0x207b65[_0xf9f5('0x27')]['id']}})['then'](handleEntityNotFound(_0x449c8a,null))[_0xf9f5('0x17')](function(_0x57e0e9){if(_0x57e0e9){_0x57e764[_0xf9f5('0x28')]=_[_0xf9f5('0x29')](db[_0xf9f5('0x38')][_0xf9f5('0x1e')]);_0x57e764['query']=_[_0xf9f5('0x29')](_0x207b65['query']);_0x57e764[_0xf9f5('0x2a')]=_[_0xf9f5('0x2c')](_0x57e764[_0xf9f5('0x28')],_0x57e764['query']);_0xc5baac[_0xf9f5('0x2b')]=_['intersection'](_0x57e764['model'],qs[_0xf9f5('0x2d')](_0x207b65['query'][_0xf9f5('0x2d')]));_0xc5baac[_0xf9f5('0x2b')]=_0xc5baac[_0xf9f5('0x2b')][_0xf9f5('0x3d')]?_0xc5baac[_0xf9f5('0x2b')]:_0x57e764[_0xf9f5('0x28')];if(!_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x3e')](_0xf9f5('0x3f'))){_0xc5baac[_0xf9f5('0x12')]=qs[_0xf9f5('0x12')](_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x12')]);_0xc5baac[_0xf9f5('0x15')]=qs[_0xf9f5('0x15')](_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x15')]);}_0xc5baac['order']=qs['sort'](_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x40')]);_0xc5baac[_0xf9f5('0x41')]=qs[_0xf9f5('0x2a')](_[_0xf9f5('0x42')](_0x207b65[_0xf9f5('0x24')],_0x57e764[_0xf9f5('0x2a')]));_0xc5baac[_0xf9f5('0x41')][_0xf9f5('0x43')]=_0x57e0e9['id'];if(_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x44')]){_0xc5baac[_0xf9f5('0x41')]=_[_0xf9f5('0x2f')](_0xc5baac[_0xf9f5('0x41')],{'$or':_[_0xf9f5('0x45')](_0xc5baac[_0xf9f5('0x2b')],function(_0x430ba9){var _0x1b3e5b={};_0x1b3e5b[_0x430ba9]={'$like':'%'+_0x207b65[_0xf9f5('0x24')]['filter']+'%'};return _0x1b3e5b;})});}if(_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x46')]){var _0x589688=_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x46')][_0xf9f5('0x47')](',');var _0x3fe902={};_0x3fe902[_0x589688[0x0]]={'$gte':moment(_0x589688[0x1])[_0xf9f5('0x48')](_0xf9f5('0x49'))};_0xc5baac[_0xf9f5('0x41')]=_[_0xf9f5('0x2f')](_0xc5baac['where'],_0x3fe902);}_0xc5baac=_['merge']({},_0xc5baac,_0x207b65[_0xf9f5('0x30')]);return db[_0xf9f5('0x38')]['count']({'where':_0xc5baac[_0xf9f5('0x41')]})[_0xf9f5('0x17')](function(_0x2bd250){_0x1a7d30[_0xf9f5('0x14')]=_0x2bd250;if(_0x207b65[_0xf9f5('0x24')][_0xf9f5('0x2e')]){_0xc5baac[_0xf9f5('0x4a')]=[{'all':!![]}];}return db[_0xf9f5('0x38')]['findAll'](_0xc5baac);})[_0xf9f5('0x17')](function(_0x945862){_0x1a7d30[_0xf9f5('0x4b')]=_0x945862;return _0x1a7d30;});}})[_0xf9f5('0x17')](respondWithFilteredResult(_0x449c8a,_0xc5baac))['catch'](handleError(_0x449c8a,null));};exports[_0xf9f5('0x4c')]=function(_0x4e0084,_0x73f3c1){return db[_0xf9f5('0x1d')]['find']({'where':{'id':_0x4e0084[_0xf9f5('0x27')]['id']}})[_0xf9f5('0x17')](handleEntityNotFound(_0x73f3c1,null))['then'](function(_0x29092e){if(_0x29092e){return _0x29092e[_0xf9f5('0x4d')](_0x4e0084[_0xf9f5('0x34')][_0xf9f5('0x39')],_[_0xf9f5('0x3a')](_0x4e0084[_0xf9f5('0x34')],['ids','id'])||{})[_0xf9f5('0x4e')](function(){return db[_0xf9f5('0x4f')]['findAll']({'attributes':['id',_0xf9f5('0x1b'),_0xf9f5('0x50')],'where':{'id':_0x4e0084[_0xf9f5('0x34')][_0xf9f5('0x39')]}});})[_0xf9f5('0x17')](function(_0x272bdc){socket[_0xf9f5('0x51')](_0xf9f5('0x52'),{'id':Number(_0x4e0084[_0xf9f5('0x27')]['id']),'tags':_0x272bdc||[]});return{'id':Number(_0x4e0084['params']['id']),'tags':_0x272bdc||[]};});}})['then'](respondWithResult(_0x73f3c1,null))[_0xf9f5('0x32')](handleError(_0x73f3c1,null));};exports['removeTags']=function(_0x110ac2,_0x5016f1){return db[_0xf9f5('0x1d')]['find']({'where':{'id':_0x110ac2[_0xf9f5('0x27')]['id']}})[_0xf9f5('0x17')](handleEntityNotFound(_0x5016f1,null))['then'](function(_0xc47cae){if(_0xc47cae){return _0xc47cae[_0xf9f5('0x53')](_0x110ac2[_0xf9f5('0x24')]['ids']);}})[_0xf9f5('0x17')](respondWithStatusCode(_0x5016f1,null))[_0xf9f5('0x32')](handleError(_0x5016f1,null));};exports[_0xf9f5('0x54')]=function(_0x5d43d8,_0x3fe617){var _0x855fb8=moment()[_0xf9f5('0x55')]()['toString']();var _0x42d454=path[_0xf9f5('0x56')](config[_0xf9f5('0x57')],'server','files',_0xf9f5('0x58'));var _0x30065c=path[_0xf9f5('0x56')](config[_0xf9f5('0x57')],_0xf9f5('0x59'),_0xf9f5('0x5a'),_0xf9f5('0x5b'));var _0x239aa3=path[_0xf9f5('0x56')](_0x42d454,_0x855fb8);var _0x41d398=util[_0xf9f5('0x48')](_0xf9f5('0x5c'),_0x5d43d8[_0xf9f5('0x27')]['id'],_0x855fb8);var _0x17406c=path['join'](_0x42d454,_0x41d398);var _0x2c55a3=[];_0x2c55a3['push']({'model':db[_0xf9f5('0x5d')],'as':_0xf9f5('0x5d'),'attributes':['id',_0xf9f5('0x5e')],'raw':!![]});_0x2c55a3[_0xf9f5('0x5f')]({'model':db['CmContact'],'as':_0xf9f5('0x60'),'attributes':['id',_0xf9f5('0x61'),_0xf9f5('0x62')],'raw':!![]});if(_0x5d43d8[_0xf9f5('0x24')][_0xf9f5('0x5b')]){_0x2c55a3[_0xf9f5('0x5f')]({'model':db['Attachment'],'as':_0xf9f5('0x63'),'raw':!![]});}var _0x1b2fcd=[{'model':db[_0xf9f5('0x38')],'as':_0xf9f5('0x64'),'attributes':['id',_0xf9f5('0x34'),_0xf9f5('0x65'),_0xf9f5('0x66'),'secret',_0xf9f5('0x67')],'include':_0x2c55a3}];_0x1b2fcd[_0xf9f5('0x5f')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id','name']});_0x1b2fcd[_0xf9f5('0x5f')]({'model':db[_0xf9f5('0x5d')],'as':_0xf9f5('0x68'),'attributes':['id',_0xf9f5('0x5e')]});return db[_0xf9f5('0x1d')][_0xf9f5('0x31')]({'where':{'id':_0x5d43d8[_0xf9f5('0x27')]['id']},'include':_0x1b2fcd})[_0xf9f5('0x17')](handleEntityNotFound(_0x3fe617,null))[_0xf9f5('0x17')](function(_0x1b84ca){if(_0x1b84ca){var _0x3ed86b=_0x1b84ca[_0xf9f5('0x69')]({'plain':!![]});fs[_0xf9f5('0x6a')](_0x239aa3);var _0x2efb30={'channel':_0xf9f5('0x6b'),'account':_0x3ed86b[_0xf9f5('0x6c')]['name'],'agent':_0x3ed86b[_0xf9f5('0x68')]?_0x3ed86b[_0xf9f5('0x68')]['fullname']:_0xf9f5('0x6d'),'createdAt':moment(_0x3ed86b[_0xf9f5('0x65')])[_0xf9f5('0x48')](_0xf9f5('0x49'))[_0xf9f5('0x6e')](),'closedAt':_0x3ed86b[_0xf9f5('0x6f')]?moment(_0x3ed86b[_0xf9f5('0x70')])[_0xf9f5('0x48')](_0xf9f5('0x49'))[_0xf9f5('0x6e')]():'','disposition':_0x3ed86b[_0xf9f5('0x71')],'messages':_(_0x3ed86b[_0xf9f5('0x64')])[_0xf9f5('0x44')]({'secret':![]})[_0xf9f5('0x45')](function(_0x17a5f9){if(_0x17a5f9[_0xf9f5('0x63')]){var _0x50f240=path[_0xf9f5('0x56')](_0x30065c,_0x17a5f9[_0xf9f5('0x63')][_0xf9f5('0x72')]);if(fs[_0xf9f5('0x73')](_0x50f240)){fs['createReadStream'](_0x50f240)[_0xf9f5('0x74')](fs[_0xf9f5('0x75')](path[_0xf9f5('0x56')](_0x239aa3,_0x17a5f9[_0xf9f5('0x63')][_0xf9f5('0x72')])));}}return{'date':moment(_0x17a5f9['createdAt'])['format'](_0xf9f5('0x49'))[_0xf9f5('0x6e')](),'sender':_0x17a5f9[_0xf9f5('0x66')]===_0xf9f5('0x76')?_0x17a5f9[_0xf9f5('0x5d')]?_0x17a5f9[_0xf9f5('0x5d')]['fullname']:'System':_0x17a5f9[_0xf9f5('0x60')][_0xf9f5('0x61')]+(_0x17a5f9[_0xf9f5('0x60')]['lastName']?'\x20'+_0x17a5f9[_0xf9f5('0x60')][_0xf9f5('0x62')]:''),'body':_0x17a5f9[_0xf9f5('0x63')]?_0x17a5f9['Attachment'][_0xf9f5('0x72')]:_0x17a5f9[_0xf9f5('0x34')],'direction':_0x17a5f9[_0xf9f5('0x66')]===_0xf9f5('0x76')?'A':'C','secret':_0x17a5f9[_0xf9f5('0x77')],'read':_0x17a5f9[_0xf9f5('0x67')],'attachment':_0x17a5f9[_0xf9f5('0x63')]};})[_0xf9f5('0x78')]()};return ejs[_0xf9f5('0x79')](path[_0xf9f5('0x56')](config[_0xf9f5('0x57')],'server',_0xf9f5('0x7a'),'downloadInteraction.ejs'),{'interaction':_0x2efb30})[_0xf9f5('0x17')](function(_0x965db8){var _0x884713=path['join'](_0x239aa3,_0xf9f5('0x7b')+_0x3ed86b['id']+'-'+_0x855fb8+_0xf9f5('0x7c'));var _0x138347={'path':_0x884713,'channel':_0xf9f5('0x6b'),'interactionId':_0x3ed86b['id']};return pdf[_0xf9f5('0x7d')](_0x965db8,_0x138347);})[_0xf9f5('0x17')](function(){return new BPromise(function(_0x18b2dc,_0xcde186){zipdir(_0x239aa3,{'saveTo':_0x17406c},function(_0x39996c,_0x5c38bc){if(_0x39996c)return _0xcde186(_0x39996c);return _0x18b2dc(_0x5c38bc);});})['then'](function(){return new BPromise(function(_0x10f04f,_0x93098d){rimraf(_0x239aa3,function(_0x1edc35){if(_0x1edc35)_0x93098d(_0x1edc35);return _0x10f04f();});});})['then'](function(){return _0x3fe617[_0xf9f5('0x54')](_0x17406c,_0x41d398,function(_0x316ed1){if(_0x316ed1){console['log']('err',_0x316ed1);}else{fs['unlinkSync'](_0x17406c);}});});});}else{return _0x3fe617[_0xf9f5('0xe')](0xc8);}})[_0xf9f5('0x32')](handleError(_0x3fe617,null));}; \ No newline at end of file +var _0x34ea=['map','rawAttributes','key','getOptions','whatsapp','query','user','catch','show','params','model','keys','WhatsappInteraction','filters','intersection','fields','attributes','includeAll','include','merge','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','spread','Tag','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','CmContact','Contact','lastName','push','Attachment','Messages','createdAt','direction','read','Account','Owner','get','mkdirSync','Whatsapp','N.A.','format','toString','closed','closedAt','createReadStream','pipe','out','System','firstName','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','zip-dir','bluebird','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','update','then','destroy','error','stack','name','index'];(function(_0x17e5ca,_0x544706){var _0x4c0e7c=function(_0x255f8c){while(--_0x255f8c){_0x17e5ca['push'](_0x17e5ca['shift']());}};_0x4c0e7c(++_0x544706);}(_0x34ea,0x148));var _0xa34e=function(_0x38838e,_0xe095fb){_0x38838e=_0x38838e-0x0;var _0x42efcf=_0x34ea[_0x38838e];return _0x42efcf;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa34e('0x0'));var moment=require('moment');var BPromise=require(_0xa34e('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa34e('0x2'));var Redis=require(_0xa34e('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0xa34e('0x4'));var pdf=require(_0xa34e('0x5'));var logger=require('../../config/logger')(_0xa34e('0x6'));var config=require(_0xa34e('0x7'));var db=require('../../mysqldb')['db'];config[_0xa34e('0x8')]=_['defaults'](config[_0xa34e('0x8')],{'host':_0xa34e('0x9'),'port':0x18eb});var socket=require(_0xa34e('0xa'))(new Redis(config[_0xa34e('0x8')]));require(_0xa34e('0xb'))['register'](socket);function respondWithStatusCode(_0xd1aa56,_0x48e93b){_0x48e93b=_0x48e93b||0xcc;return function(_0xdf1fd4){if(_0xdf1fd4){return _0xd1aa56[_0xa34e('0xc')](_0x48e93b);}return _0xd1aa56['status'](_0x48e93b)[_0xa34e('0xd')]();};}function respondWithResult(_0x356918,_0x5caf6d){_0x5caf6d=_0x5caf6d||0xc8;return function(_0x459d4d){if(_0x459d4d){return _0x356918['status'](_0x5caf6d)['json'](_0x459d4d);}};}function respondWithFilteredResult(_0x2fedcc,_0x2d9464){return function(_0x4b70a9){if(_0x4b70a9){var _0xd10cc9=typeof _0x2d9464[_0xa34e('0xe')]===_0xa34e('0xf')&&typeof _0x2d9464[_0xa34e('0x10')]===_0xa34e('0xf');var _0x125a05=_0x4b70a9[_0xa34e('0x11')];var _0xb8d330=_0xd10cc9?0x0:_0x2d9464[_0xa34e('0xe')];var _0x43d898=_0xd10cc9?_0x4b70a9[_0xa34e('0x11')]:_0x2d9464[_0xa34e('0xe')]+_0x2d9464['limit'];var _0x15b7a0;if(_0x43d898>=_0x125a05){_0x43d898=_0x125a05;_0x15b7a0=0xc8;}else{_0x15b7a0=0xce;}_0x2fedcc[_0xa34e('0x12')](_0x15b7a0);return _0x2fedcc[_0xa34e('0x13')](_0xa34e('0x14'),_0xb8d330+'-'+_0x43d898+'/'+_0x125a05)[_0xa34e('0x15')](_0x4b70a9);}return null;};}function saveUpdates(_0x599a66){return function(_0x789def){if(_0x789def){return _0x789def[_0xa34e('0x16')](_0x599a66)[_0xa34e('0x17')](function(_0x3300bf){return _0x3300bf;});}return null;};}function removeEntity(_0x15e320){return function(_0x424c6e){if(_0x424c6e){return _0x424c6e[_0xa34e('0x18')]()[_0xa34e('0x17')](function(){_0x15e320[_0xa34e('0x12')](0xcc)[_0xa34e('0xd')]();});}};}function handleEntityNotFound(_0x3be1ec){return function(_0xe3ac00){if(!_0xe3ac00){_0x3be1ec['sendStatus'](0x194);}return _0xe3ac00;};}function handleError(_0x3fca6b,_0x5e3af2){_0x5e3af2=_0x5e3af2||0x1f4;return function(_0x30662d){logger[_0xa34e('0x19')](_0x30662d[_0xa34e('0x1a')]);if(_0x30662d[_0xa34e('0x1b')]){delete _0x30662d['name'];}_0x3fca6b[_0xa34e('0x12')](_0x5e3af2)['send'](_0x30662d);};}exports[_0xa34e('0x1c')]=function(_0xb1d50,_0xa3b5cc){var _0x228b98={};var _0x25bfcc=_[_0xa34e('0x1d')](db['WhatsappInteraction'][_0xa34e('0x1e')],function(_0x13de08){return{'name':_0x13de08['fieldName'],'type':_0x13de08['type'][_0xa34e('0x1f')]};});_0x228b98=qs[_0xa34e('0x20')](_0x25bfcc,_0xb1d50);return interaction['findAll'](_0xa34e('0x21'),_0xb1d50[_0xa34e('0x22')],_0xb1d50[_0xa34e('0x23')],_0x228b98,_0x25bfcc)[_0xa34e('0x17')](respondWithFilteredResult(_0xa3b5cc,_0x228b98))[_0xa34e('0x24')](handleError(_0xa3b5cc,null));};exports[_0xa34e('0x25')]=function(_0x32da26,_0x1e84c0){var _0x4078ab={'raw':![],'where':{'id':_0x32da26[_0xa34e('0x26')]['id']}},_0x3059e8={};_0x3059e8[_0xa34e('0x27')]=_[_0xa34e('0x28')](db[_0xa34e('0x29')][_0xa34e('0x1e')]);_0x3059e8[_0xa34e('0x22')]=_[_0xa34e('0x28')](_0x32da26[_0xa34e('0x22')]);_0x3059e8[_0xa34e('0x2a')]=_[_0xa34e('0x2b')](_0x3059e8[_0xa34e('0x27')],_0x3059e8['query']);_0x4078ab['attributes']=_[_0xa34e('0x2b')](_0x3059e8['model'],qs[_0xa34e('0x2c')](_0x32da26[_0xa34e('0x22')][_0xa34e('0x2c')]));_0x4078ab[_0xa34e('0x2d')]=_0x4078ab[_0xa34e('0x2d')]['length']?_0x4078ab[_0xa34e('0x2d')]:_0x3059e8['model'];if(_0x32da26[_0xa34e('0x22')][_0xa34e('0x2e')]){_0x4078ab[_0xa34e('0x2f')]=[{'all':!![]}];}_0x4078ab=_[_0xa34e('0x30')]({},_0x4078ab,_0x32da26['options']);return db[_0xa34e('0x29')][_0xa34e('0x31')](_0x4078ab)[_0xa34e('0x17')](handleEntityNotFound(_0x1e84c0,null))[_0xa34e('0x17')](respondWithResult(_0x1e84c0,null))[_0xa34e('0x24')](handleError(_0x1e84c0,null));};exports['create']=function(_0x182948,_0x3b17b7){return db['WhatsappInteraction'][_0xa34e('0x32')](_0x182948[_0xa34e('0x33')],{})[_0xa34e('0x17')](respondWithResult(_0x3b17b7,0xc9))['catch'](handleError(_0x3b17b7,null));};exports['update']=function(_0x16951d,_0x25af8f){if(_0x16951d[_0xa34e('0x33')]['id']){delete _0x16951d[_0xa34e('0x33')]['id'];}return db[_0xa34e('0x29')][_0xa34e('0x31')]({'where':{'id':_0x16951d[_0xa34e('0x26')]['id']}})[_0xa34e('0x17')](handleEntityNotFound(_0x25af8f,null))[_0xa34e('0x17')](saveUpdates(_0x16951d[_0xa34e('0x33')],null))[_0xa34e('0x17')](respondWithResult(_0x25af8f,null))['catch'](handleError(_0x25af8f,null));};exports[_0xa34e('0x18')]=function(_0x4803eb,_0x4a7892){return db['WhatsappInteraction'][_0xa34e('0x31')]({'where':{'id':_0x4803eb[_0xa34e('0x26')]['id']}})['then'](handleEntityNotFound(_0x4a7892,null))[_0xa34e('0x17')](removeEntity(_0x4a7892,null))[_0xa34e('0x24')](handleError(_0x4a7892,null));};exports[_0xa34e('0x34')]=function(_0x312988,_0x276461){return db[_0xa34e('0x29')][_0xa34e('0x34')]()[_0xa34e('0x17')](respondWithResult(_0x276461,null))[_0xa34e('0x24')](handleError(_0x276461,null));};exports[_0xa34e('0x35')]=function(_0x8ba847,_0x255ab4){return db[_0xa34e('0x36')][_0xa34e('0x31')]({'where':{'id':_0x8ba847[_0xa34e('0x26')]['id']}})[_0xa34e('0x17')](handleEntityNotFound(_0x255ab4,null))[_0xa34e('0x17')](function(_0x1610d4){if(_0x1610d4){return _0x1610d4[_0xa34e('0x35')](_0x8ba847['body'][_0xa34e('0x37')],_[_0xa34e('0x38')](_0x8ba847[_0xa34e('0x33')],[_0xa34e('0x37'),'id'])||{});}})[_0xa34e('0x17')](respondWithResult(_0x255ab4,null))['catch'](handleError(_0x255ab4,null));};exports[_0xa34e('0x39')]=function(_0x4994b7,_0x261c49){var _0x5770a1={'raw':![],'where':{}};var _0x181314={};var _0x59b666={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x4994b7[_0xa34e('0x26')]['id']}})[_0xa34e('0x17')](handleEntityNotFound(_0x261c49,null))[_0xa34e('0x17')](function(_0x59b164){if(_0x59b164){_0x181314[_0xa34e('0x27')]=_[_0xa34e('0x28')](db[_0xa34e('0x36')][_0xa34e('0x1e')]);_0x181314[_0xa34e('0x22')]=_['keys'](_0x4994b7[_0xa34e('0x22')]);_0x181314['filters']=_[_0xa34e('0x2b')](_0x181314['model'],_0x181314['query']);_0x5770a1[_0xa34e('0x2d')]=_[_0xa34e('0x2b')](_0x181314['model'],qs['fields'](_0x4994b7['query'][_0xa34e('0x2c')]));_0x5770a1[_0xa34e('0x2d')]=_0x5770a1[_0xa34e('0x2d')]['length']?_0x5770a1['attributes']:_0x181314['model'];if(!_0x4994b7[_0xa34e('0x22')][_0xa34e('0x3a')](_0xa34e('0x3b'))){_0x5770a1['limit']=qs[_0xa34e('0x10')](_0x4994b7[_0xa34e('0x22')][_0xa34e('0x10')]);_0x5770a1[_0xa34e('0xe')]=qs['offset'](_0x4994b7[_0xa34e('0x22')][_0xa34e('0xe')]);}_0x5770a1[_0xa34e('0x3c')]=qs[_0xa34e('0x3d')](_0x4994b7[_0xa34e('0x22')][_0xa34e('0x3d')]);_0x5770a1[_0xa34e('0x3e')]=qs[_0xa34e('0x2a')](_[_0xa34e('0x3f')](_0x4994b7['query'],_0x181314[_0xa34e('0x2a')]));_0x5770a1['where'][_0xa34e('0x40')]=_0x59b164['id'];if(_0x4994b7[_0xa34e('0x22')][_0xa34e('0x41')]){_0x5770a1[_0xa34e('0x3e')]=_[_0xa34e('0x30')](_0x5770a1[_0xa34e('0x3e')],{'$or':_[_0xa34e('0x1d')](_0x5770a1['attributes'],function(_0x35c97c){var _0x1609fc={};_0x1609fc[_0x35c97c]={'$like':'%'+_0x4994b7['query'][_0xa34e('0x41')]+'%'};return _0x1609fc;})});}if(_0x4994b7[_0xa34e('0x22')][_0xa34e('0x42')]){var _0x56d5d5=_0x4994b7[_0xa34e('0x22')]['$gte']['split'](',');var _0x32207c={};_0x32207c[_0x56d5d5[0x0]]={'$gte':moment(_0x56d5d5[0x1])['format'](_0xa34e('0x43'))};_0x5770a1[_0xa34e('0x3e')]=_['merge'](_0x5770a1['where'],_0x32207c);}_0x5770a1=_['merge']({},_0x5770a1,_0x4994b7[_0xa34e('0x44')]);return db[_0xa34e('0x36')]['count']({'where':_0x5770a1[_0xa34e('0x3e')]})[_0xa34e('0x17')](function(_0x3e4fc1){_0x59b666[_0xa34e('0x11')]=_0x3e4fc1;if(_0x4994b7[_0xa34e('0x22')][_0xa34e('0x2e')]){_0x5770a1[_0xa34e('0x2f')]=[{'all':!![]}];}return db[_0xa34e('0x36')]['findAll'](_0x5770a1);})[_0xa34e('0x17')](function(_0x213b23){_0x59b666[_0xa34e('0x45')]=_0x213b23;return _0x59b666;});}})[_0xa34e('0x17')](respondWithFilteredResult(_0x261c49,_0x5770a1))[_0xa34e('0x24')](handleError(_0x261c49,null));};exports[_0xa34e('0x46')]=function(_0x2e11c2,_0x1578a1){return db['WhatsappInteraction'][_0xa34e('0x31')]({'where':{'id':_0x2e11c2[_0xa34e('0x26')]['id']}})[_0xa34e('0x17')](handleEntityNotFound(_0x1578a1,null))[_0xa34e('0x17')](function(_0x4680a2){if(_0x4680a2){return _0x4680a2['setTags'](_0x2e11c2[_0xa34e('0x33')]['ids'],_[_0xa34e('0x38')](_0x2e11c2[_0xa34e('0x33')],[_0xa34e('0x37'),'id'])||{})[_0xa34e('0x47')](function(){return db[_0xa34e('0x48')][_0xa34e('0x49')]({'attributes':['id',_0xa34e('0x1b'),'color'],'where':{'id':_0x2e11c2[_0xa34e('0x33')][_0xa34e('0x37')]}});})['then'](function(_0x194325){socket[_0xa34e('0x4a')](_0xa34e('0x4b'),{'id':Number(_0x2e11c2[_0xa34e('0x26')]['id']),'tags':_0x194325||[]});return{'id':Number(_0x2e11c2['params']['id']),'tags':_0x194325||[]};});}})[_0xa34e('0x17')](respondWithResult(_0x1578a1,null))[_0xa34e('0x24')](handleError(_0x1578a1,null));};exports[_0xa34e('0x4c')]=function(_0x1d50db,_0x5a6cea){return db[_0xa34e('0x29')][_0xa34e('0x31')]({'where':{'id':_0x1d50db[_0xa34e('0x26')]['id']}})['then'](handleEntityNotFound(_0x5a6cea,null))[_0xa34e('0x17')](function(_0x35334d){if(_0x35334d){return _0x35334d[_0xa34e('0x4c')](_0x1d50db[_0xa34e('0x22')][_0xa34e('0x37')]);}})[_0xa34e('0x17')](respondWithStatusCode(_0x5a6cea,null))[_0xa34e('0x24')](handleError(_0x5a6cea,null));};exports[_0xa34e('0x4d')]=function(_0x360413,_0x2e03d9){var _0x59386f=moment()[_0xa34e('0x4e')]()['toString']();var _0x599c51=path['join'](config[_0xa34e('0x4f')],_0xa34e('0x50'),_0xa34e('0x51'),_0xa34e('0x52'));var _0x484640=path[_0xa34e('0x53')](config[_0xa34e('0x4f')],_0xa34e('0x50'),_0xa34e('0x51'),_0xa34e('0x54'));var _0x1b06c9=path[_0xa34e('0x53')](_0x599c51,_0x59386f);var _0xbcc7ee=util['format'](_0xa34e('0x55'),_0x360413[_0xa34e('0x26')]['id'],_0x59386f);var _0x516583=path['join'](_0x599c51,_0xbcc7ee);var _0x3c6c81=[];_0x3c6c81['push']({'model':db[_0xa34e('0x56')],'as':'User','attributes':['id',_0xa34e('0x57')],'raw':!![]});_0x3c6c81['push']({'model':db[_0xa34e('0x58')],'as':_0xa34e('0x59'),'attributes':['id','firstName',_0xa34e('0x5a')],'raw':!![]});if(_0x360413[_0xa34e('0x22')]['attachments']){_0x3c6c81[_0xa34e('0x5b')]({'model':db[_0xa34e('0x5c')],'as':_0xa34e('0x5c'),'raw':!![]});}var _0x4b2df0=[{'model':db[_0xa34e('0x36')],'as':_0xa34e('0x5d'),'attributes':['id',_0xa34e('0x33'),_0xa34e('0x5e'),_0xa34e('0x5f'),'secret',_0xa34e('0x60')],'include':_0x3c6c81}];_0x4b2df0[_0xa34e('0x5b')]({'model':db['WhatsappAccount'],'as':_0xa34e('0x61'),'attributes':['id',_0xa34e('0x1b')]});_0x4b2df0[_0xa34e('0x5b')]({'model':db[_0xa34e('0x56')],'as':_0xa34e('0x62'),'attributes':['id',_0xa34e('0x57')]});return db[_0xa34e('0x29')][_0xa34e('0x31')]({'where':{'id':_0x360413[_0xa34e('0x26')]['id']},'include':_0x4b2df0})[_0xa34e('0x17')](handleEntityNotFound(_0x2e03d9,null))['then'](function(_0x3d2dbf){if(_0x3d2dbf){var _0x445049=_0x3d2dbf[_0xa34e('0x63')]({'plain':!![]});fs[_0xa34e('0x64')](_0x1b06c9);var _0x313734={'channel':_0xa34e('0x65'),'account':_0x445049['Account'][_0xa34e('0x1b')],'agent':_0x445049[_0xa34e('0x62')]?_0x445049[_0xa34e('0x62')]['fullname']:_0xa34e('0x66'),'createdAt':moment(_0x445049['createdAt'])[_0xa34e('0x67')](_0xa34e('0x43'))[_0xa34e('0x68')](),'closedAt':_0x445049[_0xa34e('0x69')]?moment(_0x445049[_0xa34e('0x6a')])[_0xa34e('0x67')](_0xa34e('0x43'))[_0xa34e('0x68')]():'','disposition':_0x445049['disposition'],'messages':_(_0x445049[_0xa34e('0x5d')])[_0xa34e('0x41')]({'secret':![]})[_0xa34e('0x1d')](function(_0x15fddf){if(_0x15fddf[_0xa34e('0x5c')]){var _0x5d2900=path[_0xa34e('0x53')](_0x484640,_0x15fddf[_0xa34e('0x5c')]['basename']);if(fs['existsSync'](_0x5d2900)){fs[_0xa34e('0x6b')](_0x5d2900)[_0xa34e('0x6c')](fs['createWriteStream'](path[_0xa34e('0x53')](_0x1b06c9,_0x15fddf[_0xa34e('0x5c')]['basename'])));}}return{'date':moment(_0x15fddf[_0xa34e('0x5e')])[_0xa34e('0x67')](_0xa34e('0x43'))[_0xa34e('0x68')](),'sender':_0x15fddf[_0xa34e('0x5f')]===_0xa34e('0x6d')?_0x15fddf[_0xa34e('0x56')]?_0x15fddf['User'][_0xa34e('0x57')]:_0xa34e('0x6e'):_0x15fddf[_0xa34e('0x59')][_0xa34e('0x6f')]+(_0x15fddf[_0xa34e('0x59')]['lastName']?'\x20'+_0x15fddf[_0xa34e('0x59')]['lastName']:''),'body':_0x15fddf['Attachment']?_0x15fddf[_0xa34e('0x5c')]['basename']:_0x15fddf[_0xa34e('0x33')],'direction':_0x15fddf['direction']===_0xa34e('0x6d')?'A':'C','secret':_0x15fddf['secret'],'read':_0x15fddf['read'],'attachment':_0x15fddf[_0xa34e('0x5c')]};})[_0xa34e('0x70')]()};return ejs[_0xa34e('0x71')](path['join'](config[_0xa34e('0x4f')],_0xa34e('0x50'),'views',_0xa34e('0x72')),{'interaction':_0x313734})[_0xa34e('0x17')](function(_0x17cfb9){var _0x3c374b=path[_0xa34e('0x53')](_0x1b06c9,'transcript-'+_0x445049['id']+'-'+_0x59386f+_0xa34e('0x73'));var _0x208e3d={'path':_0x3c374b,'channel':_0xa34e('0x65'),'interactionId':_0x445049['id']};return pdf[_0xa34e('0x74')](_0x17cfb9,_0x208e3d);})['then'](function(){return new BPromise(function(_0x22c0c8,_0x4d0406){zipdir(_0x1b06c9,{'saveTo':_0x516583},function(_0x1859db,_0x9b7e3a){if(_0x1859db)return _0x4d0406(_0x1859db);return _0x22c0c8(_0x9b7e3a);});})[_0xa34e('0x17')](function(){return new BPromise(function(_0x3e1845,_0x1c8ced){rimraf(_0x1b06c9,function(_0x35d0c2){if(_0x35d0c2)_0x1c8ced(_0x35d0c2);return _0x3e1845();});});})[_0xa34e('0x17')](function(){return _0x2e03d9[_0xa34e('0x4d')](_0x516583,_0xbcc7ee,function(_0xe17b0b){if(_0xe17b0b){console[_0xa34e('0x75')](_0xa34e('0x76'),_0xe17b0b);}else{fs['unlinkSync'](_0x516583);}});});});}else{return _0x2e03d9[_0xa34e('0xc')](0xc8);}})[_0xa34e('0x24')](handleError(_0x2e03d9,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index cdd6890..77f342e 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 _0xc831=['then','length','emit','hasOwnProperty','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map'];(function(_0x58a364,_0x3439f6){var _0x409b74=function(_0xff5c15){while(--_0xff5c15){_0x58a364['push'](_0x58a364['shift']());}};_0x409b74(++_0x3439f6);}(_0xc831,0x103));var _0x1c83=function(_0x479fe0,_0x590886){_0x479fe0=_0x479fe0-0x0;var _0x2e5a27=_0xc831[_0x479fe0];return _0x2e5a27;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x1c83('0x0'))['db'][_0x1c83('0x1')];var WhatsappMessage=require(_0x1c83('0x0'))['db'][_0x1c83('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1c83('0x3')](0x0);var events={'afterCreate':_0x1c83('0x4'),'afterUpdate':_0x1c83('0x5'),'afterDestroy':_0x1c83('0x6')};function emitEvent(_0x1a2a48){return function(_0x1c0cde,_0x4fb4c3,_0x5682fb){_0x1c0cde[_0x1c83('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1ce77e){_0x1c0cde[_0x1c83('0x8')](_0x1c83('0x9'),_0x1ce77e[_0x1c83('0xa')](function(_0x282313){return{'id':_0x282313['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1c0cde['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1c83('0xb')](function(_0x405dfe){_0x1c0cde['setDataValue']('unreadMessages',_0x405dfe[_0x1c83('0xc')]);WhatsappInteractionEvents[_0x1c83('0xd')](_0x1a2a48+':'+_0x1c0cde['id'],_0x1c0cde);WhatsappInteractionEvents[_0x1c83('0xd')](_0x1a2a48,_0x1c0cde);_0x5682fb(null);})['catch'](_0x5682fb(null));};}for(var e in events){if(events[_0x1c83('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xb6b1=['emit','catch','hasOwnProperty','hook','events','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xb6b1[_0x50a004];return _0x5e9992;};'use strict';var EventEmitter=require(_0x1b6b('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x1b6b('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x1b6b('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1b6b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b6b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a2c45){return function(_0xb1a61e,_0x2c4040,_0xdbbe22){_0xb1a61e['getUsers']({'attributes':['id'],'raw':!![]})[_0x1b6b('0x5')](function(_0x51cfed){_0xb1a61e[_0x1b6b('0x6')]('Users',_0x51cfed[_0x1b6b('0x7')](function(_0x3496b5){return{'id':_0x3496b5['id']};}));return WhatsappMessage[_0x1b6b('0x8')]({'where':{'WhatsappInteractionId':_0xb1a61e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1b6b('0x5')](function(_0x5249cd){_0xb1a61e['setDataValue'](_0x1b6b('0x9'),_0x5249cd[_0x1b6b('0xa')]);WhatsappInteractionEvents[_0x1b6b('0xb')](_0x2a2c45+':'+_0xb1a61e['id'],_0xb1a61e);WhatsappInteractionEvents[_0x1b6b('0xb')](_0x2a2c45,_0xb1a61e);_0xdbbe22(null);})[_0x1b6b('0xc')](_0xdbbe22(null));};}for(var e in events){if(events[_0x1b6b('0xd')](e)){var event=events[e];WhatsappInteraction[_0x1b6b('0xe')](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 d26045e..7380917 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 _0x85ae=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x5f1ec3,_0x12fca2){var _0x5dae01=function(_0x2dbcfb){while(--_0x2dbcfb){_0x5f1ec3['push'](_0x5f1ec3['shift']());}};_0x5dae01(++_0x12fca2);}(_0x85ae,0x10f));var _0xe85a=function(_0x426cb5,_0x319a6c){_0x426cb5=_0x426cb5-0x0;var _0x5cb742=_0x85ae[_0x426cb5];return _0x5cb742;};'use strict';var _=require(_0xe85a('0x0'));var util=require(_0xe85a('0x1'));var logger=require('../../config/logger')(_0xe85a('0x2'));var moment=require(_0xe85a('0x3'));var BPromise=require(_0xe85a('0x4'));var rp=require(_0xe85a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe85a('0x6'));var config=require(_0xe85a('0x7'));var attributes=require(_0xe85a('0x8'));module['exports']=function(_0x237c31,_0x1983b2){return _0x237c31[_0xe85a('0x9')](_0xe85a('0xa'),attributes,{'tableName':_0xe85a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a431a,_0x493035,_0x1e40b9){if(_0x1a431a[_0xe85a('0xc')](_0xe85a('0xd'))){_0x1a431a[_0xe85a('0xe')]=moment()[_0xe85a('0xf')](_0xe85a('0x10'));}_0x1e40b9(null,_0x1a431a);}}});}; \ No newline at end of file +var _0x37da=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','WhatsappInteraction','changed','closedAt'];(function(_0x27f978,_0x124108){var _0x1d4513=function(_0x28734c){while(--_0x28734c){_0x27f978['push'](_0x27f978['shift']());}};_0x1d4513(++_0x124108);}(_0x37da,0x11f));var _0xa37d=function(_0x58e874,_0x55fac7){_0x58e874=_0x58e874-0x0;var _0x2f3a5e=_0x37da[_0x58e874];return _0x2f3a5e;};'use strict';var _=require(_0xa37d('0x0'));var util=require(_0xa37d('0x1'));var logger=require(_0xa37d('0x2'))(_0xa37d('0x3'));var moment=require(_0xa37d('0x4'));var BPromise=require(_0xa37d('0x5'));var rp=require(_0xa37d('0x6'));var fs=require('fs');var path=require(_0xa37d('0x7'));var rimraf=require('rimraf');var config=require(_0xa37d('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0xa37d('0x9')]=function(_0x1fb908,_0x1d7c51){return _0x1fb908['define'](_0xa37d('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1edb69,_0x7cdc72,_0x229d3c){if(_0x1edb69[_0xa37d('0xb')]('closed')){_0x1edb69[_0xa37d('0xc')]=moment()[_0xa37d('0xd')](_0xa37d('0xe'));}_0x229d3c(null,_0x1edb69);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 00517ec..0ad5154 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 _0xded1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','update','body','options','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x2d3567,_0x154bd3){var _0x554fcf=function(_0x18a7db){while(--_0x18a7db){_0x2d3567['push'](_0x2d3567['shift']());}};_0x554fcf(++_0x154bd3);}(_0xded1,0x160));var _0x1ded=function(_0x275951,_0x24de53){_0x275951=_0x275951-0x0;var _0x24f26e=_0xded1[_0x275951];return _0x24f26e;};'use strict';var _=require(_0x1ded('0x0'));var util=require(_0x1ded('0x1'));var moment=require(_0x1ded('0x2'));var BPromise=require(_0x1ded('0x3'));var rs=require(_0x1ded('0x4'));var fs=require('fs');var Redis=require(_0x1ded('0x5'));var db=require(_0x1ded('0x6'))['db'];var utils=require(_0x1ded('0x7'));var logger=require(_0x1ded('0x8'))('rpc');var config=require(_0x1ded('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1ded('0xa')][_0x1ded('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1ded('0xc')],{'host':_0x1ded('0xd'),'port':0x18eb});var socket=require(_0x1ded('0xe'))(new Redis(config['redis']));require(_0x1ded('0xf'))[_0x1ded('0x10')](socket);function respondWithRpcPromise(_0xcf6a2c,_0x3bcdcd,_0x581c92){return new BPromise(function(_0x452465,_0x2cdac9){return client[_0x1ded('0x11')](_0xcf6a2c,_0x581c92)[_0x1ded('0x12')](function(_0xb259cc){logger['info'](_0x1ded('0x13'),_0x3bcdcd,_0x1ded('0x14'));logger[_0x1ded('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3bcdcd,_0x1ded('0x14'),JSON[_0x1ded('0x16')](_0xb259cc));if(_0xb259cc[_0x1ded('0x17')]){if(_0xb259cc[_0x1ded('0x17')][_0x1ded('0x18')]===0x1f4){logger[_0x1ded('0x17')](_0x1ded('0x13'),_0x3bcdcd,_0xb259cc['error']['message']);return _0x2cdac9(_0xb259cc['error'][_0x1ded('0x19')]);}logger[_0x1ded('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x3bcdcd,_0xb259cc[_0x1ded('0x17')][_0x1ded('0x19')]);return _0x452465(_0xb259cc[_0x1ded('0x17')][_0x1ded('0x19')]);}else{logger[_0x1ded('0x1a')]('WhatsappInteraction,\x20%s,\x20%s',_0x3bcdcd,_0x1ded('0x14'));_0x452465(_0xb259cc[_0x1ded('0x1b')][_0x1ded('0x19')]);}})[_0x1ded('0x1c')](function(_0x2aeaa9){logger[_0x1ded('0x17')](_0x1ded('0x13'),_0x3bcdcd,_0x2aeaa9);_0x2cdac9(_0x2aeaa9);});});}exports['UpdateWhatsappInteraction']=function(_0x386da3){var _0x58379f=this;return new Promise(function(_0x239a69,_0x24147d){return db['WhatsappInteraction'][_0x1ded('0x1d')](_0x386da3[_0x1ded('0x1e')],{'raw':_0x386da3[_0x1ded('0x1f')]?_0x386da3[_0x1ded('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x386da3[_0x1ded('0x1f')]?_0x386da3[_0x1ded('0x1f')][_0x1ded('0x20')]||null:null,'attributes':_0x386da3[_0x1ded('0x1f')]?_0x386da3['options'][_0x1ded('0x21')]||null:null,'limit':_0x386da3['options']?_0x386da3['options'][_0x1ded('0x22')]||null:null})[_0x1ded('0x12')](function(_0x479f42){logger['info'](_0x1ded('0x23'),_0x386da3);logger[_0x1ded('0x15')](_0x1ded('0x23'),_0x386da3,JSON[_0x1ded('0x16')](_0x479f42));_0x239a69(_0x479f42);})['catch'](function(_0x4dba93){logger['error'](_0x1ded('0x23'),_0x4dba93['message'],_0x386da3);_0x24147d(_0x58379f[_0x1ded('0x17')](0x1f4,_0x4dba93[_0x1ded('0x19')]));});});};exports[_0x1ded('0x24')]=function(_0x48d1d4){return new Promise(function(_0x2b25fc,_0x36eb3e){return db[_0x1ded('0x25')][_0x1ded('0x26')]({'where':_0x48d1d4[_0x1ded('0x1f')]?_0x48d1d4[_0x1ded('0x1f')][_0x1ded('0x20')]||null:null})[_0x1ded('0x12')](function(_0x4c06a3){if(_0x4c06a3){return _0x4c06a3[_0x1ded('0x27')](_0x48d1d4['body'][_0x1ded('0x28')],_[_0x1ded('0x29')](_0x48d1d4[_0x1ded('0x1e')],[_0x1ded('0x28'),'id'])||{});}})[_0x1ded('0x2a')](function(_0x37f139){logger[_0x1ded('0x1a')](_0x1ded('0x2b'),_0x48d1d4);logger[_0x1ded('0x15')](_0x1ded('0x2b'),_0x48d1d4,JSON[_0x1ded('0x16')](_0x37f139));_0x2b25fc(_0x37f139);})[_0x1ded('0x1c')](function(_0x3365bf){logger[_0x1ded('0x17')](_0x1ded('0x2b'),_0x3365bf[_0x1ded('0x19')],_0x48d1d4);_0x36eb3e(_this['error'](0x1f4,_0x3365bf[_0x1ded('0x19')]));});});}; \ No newline at end of file +var _0x2912=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','find','addTags','omit','AddTags','lodash'];(function(_0x3202f4,_0x263c7a){var _0x126e05=function(_0x52fd2e){while(--_0x52fd2e){_0x3202f4['push'](_0x3202f4['shift']());}};_0x126e05(++_0x263c7a);}(_0x2912,0x8f));var _0x2291=function(_0x18bd57,_0x5571d4){_0x18bd57=_0x18bd57-0x0;var _0x597bc6=_0x2912[_0x18bd57];return _0x597bc6;};'use strict';var _=require(_0x2291('0x0'));var util=require('util');var moment=require(_0x2291('0x1'));var BPromise=require('bluebird');var rs=require(_0x2291('0x2'));var fs=require('fs');var Redis=require(_0x2291('0x3'));var db=require(_0x2291('0x4'))['db'];var utils=require(_0x2291('0x5'));var logger=require('../../config/logger')(_0x2291('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x2291('0x7')]=_[_0x2291('0x8')](config['redis'],{'host':_0x2291('0x9'),'port':0x18eb});var socket=require(_0x2291('0xa'))(new Redis(config['redis']));require(_0x2291('0xb'))['register'](socket);function respondWithRpcPromise(_0x2a3a60,_0x7c0174,_0x434a85){return new BPromise(function(_0x43791d,_0x3b9b43){return client[_0x2291('0xc')](_0x2a3a60,_0x434a85)[_0x2291('0xd')](function(_0x499452){logger['info'](_0x2291('0xe'),_0x7c0174,'request\x20sent');logger[_0x2291('0xf')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x7c0174,'request\x20sent',JSON[_0x2291('0x10')](_0x499452));if(_0x499452[_0x2291('0x11')]){if(_0x499452[_0x2291('0x11')][_0x2291('0x12')]===0x1f4){logger[_0x2291('0x11')](_0x2291('0xe'),_0x7c0174,_0x499452['error'][_0x2291('0x13')]);return _0x3b9b43(_0x499452[_0x2291('0x11')][_0x2291('0x13')]);}logger[_0x2291('0x11')](_0x2291('0xe'),_0x7c0174,_0x499452[_0x2291('0x11')][_0x2291('0x13')]);return _0x43791d(_0x499452[_0x2291('0x11')][_0x2291('0x13')]);}else{logger[_0x2291('0x14')](_0x2291('0xe'),_0x7c0174,_0x2291('0x15'));_0x43791d(_0x499452['result'][_0x2291('0x13')]);}})[_0x2291('0x16')](function(_0x5a54b4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x7c0174,_0x5a54b4);_0x3b9b43(_0x5a54b4);});});}exports[_0x2291('0x17')]=function(_0x2f55d1){var _0x50e87b=this;return new Promise(function(_0x45d009,_0x127e06){return db[_0x2291('0x18')][_0x2291('0x19')](_0x2f55d1[_0x2291('0x1a')],{'raw':_0x2f55d1['options']?_0x2f55d1[_0x2291('0x1b')][_0x2291('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f55d1[_0x2291('0x1b')]?_0x2f55d1[_0x2291('0x1b')][_0x2291('0x1d')]||null:null,'attributes':_0x2f55d1['options']?_0x2f55d1[_0x2291('0x1b')][_0x2291('0x1e')]||null:null,'limit':_0x2f55d1[_0x2291('0x1b')]?_0x2f55d1[_0x2291('0x1b')]['limit']||null:null})[_0x2291('0xd')](function(_0x407af5){logger['info'](_0x2291('0x17'),_0x2f55d1);logger[_0x2291('0xf')](_0x2291('0x17'),_0x2f55d1,JSON[_0x2291('0x10')](_0x407af5));_0x45d009(_0x407af5);})[_0x2291('0x16')](function(_0x2ab460){logger[_0x2291('0x11')](_0x2291('0x17'),_0x2ab460[_0x2291('0x13')],_0x2f55d1);_0x127e06(_0x50e87b[_0x2291('0x11')](0x1f4,_0x2ab460[_0x2291('0x13')]));});});};exports[_0x2291('0x1f')]=function(_0x10f09b){return new Promise(function(_0x3909fb,_0x1beda8){return db[_0x2291('0x18')][_0x2291('0x20')]({'where':_0x10f09b[_0x2291('0x1b')]?_0x10f09b[_0x2291('0x1b')][_0x2291('0x1d')]||null:null})['then'](function(_0x5b7a47){if(_0x5b7a47){return _0x5b7a47[_0x2291('0x21')](_0x10f09b['body']['ids'],_[_0x2291('0x22')](_0x10f09b[_0x2291('0x1a')],['ids','id'])||{});}})['spread'](function(_0x57f383){logger[_0x2291('0x14')](_0x2291('0x23'),_0x10f09b);logger['debug'](_0x2291('0x23'),_0x10f09b,JSON[_0x2291('0x10')](_0x57f383));_0x3909fb(_0x57f383);})[_0x2291('0x16')](function(_0xba4201){logger[_0x2291('0x11')](_0x2291('0x23'),_0xba4201[_0x2291('0x13')],_0x10f09b);_0x1beda8(_this['error'](0x1f4,_0xba4201[_0x2291('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ff45abf..f438fb3 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 _0xf823=['emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save','update'];(function(_0xb9c476,_0x4100f2){var _0x59e38f=function(_0x2e83b8){while(--_0x2e83b8){_0xb9c476['push'](_0xb9c476['shift']());}};_0x59e38f(++_0x4100f2);}(_0xf823,0x1ee));var _0x3f82=function(_0x4e2216,_0x525b11){_0x4e2216=_0x4e2216-0x0;var _0x17b205=_0xf823[_0x4e2216];return _0x17b205;};'use strict';var WhatsappInteractionEvents=require(_0x3f82('0x0'));var events=[_0x3f82('0x1'),'remove',_0x3f82('0x2')];function createListener(_0x58241e,_0x41193c){return function(_0x321ca4){_0x41193c[_0x3f82('0x3')](_0x58241e,_0x321ca4);};}function removeListener(_0x566039,_0x97925e){return function(){WhatsappInteractionEvents['removeListener'](_0x566039,_0x97925e);};}exports[_0x3f82('0x4')]=function(_0xedb55c){for(var _0xf59306=0x0,_0x1f78b7=events[_0x3f82('0x5')];_0xf59306<_0x1f78b7;_0xf59306++){var _0x39494c=events[_0xf59306];var _0x4605e8=createListener(_0x3f82('0x6')+_0x39494c,_0xedb55c);WhatsappInteractionEvents['on'](_0x39494c,_0x4605e8);}}; \ No newline at end of file +var _0x3938=['emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x8467d2,_0x220f89){var _0x5a24d2=function(_0x485517){while(--_0x485517){_0x8467d2['push'](_0x8467d2['shift']());}};_0x5a24d2(++_0x220f89);}(_0x3938,0x124));var _0x8393=function(_0x4733d0,_0x2a9f24){_0x4733d0=_0x4733d0-0x0;var _0x416827=_0x3938[_0x4733d0];return _0x416827;};'use strict';var WhatsappInteractionEvents=require(_0x8393('0x0'));var events=[_0x8393('0x1'),_0x8393('0x2'),_0x8393('0x3')];function createListener(_0x40d020,_0x5573e9){return function(_0x58d89c){_0x5573e9[_0x8393('0x4')](_0x40d020,_0x58d89c);};}function removeListener(_0x4a73f9,_0x62afd){return function(){WhatsappInteractionEvents[_0x8393('0x5')](_0x4a73f9,_0x62afd);};}exports['register']=function(_0x352a00){for(var _0x5e1f55=0x0,_0x300b4d=events[_0x8393('0x6')];_0x5e1f55<_0x300b4d;_0x5e1f55++){var _0x5d3671=events[_0x5e1f55];var _0x4d3f07=createListener(_0x8393('0x7')+_0x5d3671,_0x352a00);WhatsappInteractionEvents['on'](_0x5d3671,_0x4d3f07);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index c3a8a3b..608952f 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 _0x91b2=['get','isAuthenticated','index','/describe','describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller'];(function(_0x22ad6e,_0x4a4492){var _0x4f3362=function(_0xbd8479){while(--_0xbd8479){_0x22ad6e['push'](_0x22ad6e['shift']());}};_0x4f3362(++_0x4a4492);}(_0x91b2,0xbb));var _0x291b=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x91b2[_0x23c6f2];return _0x4c270b;};'use strict';var multer=require('multer');var util=require(_0x291b('0x0'));var path=require('path');var timeout=require(_0x291b('0x1'));var express=require(_0x291b('0x2'));var router=express[_0x291b('0x3')]();var fs_extra=require(_0x291b('0x4'));var auth=require(_0x291b('0x5'));var interaction=require(_0x291b('0x6'));var config=require(_0x291b('0x7'));var controller=require(_0x291b('0x8'));router[_0x291b('0x9')]('/',auth[_0x291b('0xa')](),controller[_0x291b('0xb')]);router[_0x291b('0x9')](_0x291b('0xc'),auth[_0x291b('0xa')](),controller[_0x291b('0xd')]);router[_0x291b('0x9')]('/:id',auth[_0x291b('0xa')](),controller[_0x291b('0xe')]);router[_0x291b('0xf')]('/',auth[_0x291b('0xa')](),interaction[_0x291b('0x10')](_0x291b('0x11'),_0x291b('0x12')),controller[_0x291b('0x13')]);router['post'](_0x291b('0x14'),controller[_0x291b('0x15')]);router[_0x291b('0x16')](_0x291b('0x17'),auth['isAuthenticated'](),controller[_0x291b('0x18')]);router[_0x291b('0x16')]('/:id/accept',auth[_0x291b('0xa')](),controller['accept']);router[_0x291b('0x16')]('/:id/reject',auth[_0x291b('0xa')](),controller['reject']);router[_0x291b('0x19')]('/:id',auth[_0x291b('0xa')](),controller[_0x291b('0x1a')]);module[_0x291b('0x1b')]=router; \ No newline at end of file +var _0x8eba=['isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','create','post','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get'];(function(_0x4df71b,_0x400413){var _0x5518af=function(_0x45b7a4){while(--_0x45b7a4){_0x4df71b['push'](_0x4df71b['shift']());}};_0x5518af(++_0x400413);}(_0x8eba,0x147));var _0xa8eb=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x8eba[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require('multer');var util=require(_0xa8eb('0x0'));var path=require(_0xa8eb('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8eb('0x2'));var router=express['Router']();var fs_extra=require(_0xa8eb('0x3'));var auth=require(_0xa8eb('0x4'));var interaction=require(_0xa8eb('0x5'));var config=require(_0xa8eb('0x6'));var controller=require(_0xa8eb('0x7'));router[_0xa8eb('0x8')]('/',auth[_0xa8eb('0x9')](),controller[_0xa8eb('0xa')]);router[_0xa8eb('0x8')](_0xa8eb('0xb'),auth[_0xa8eb('0x9')](),controller[_0xa8eb('0xc')]);router[_0xa8eb('0x8')](_0xa8eb('0xd'),auth[_0xa8eb('0x9')](),controller[_0xa8eb('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa8eb('0xf')](_0xa8eb('0x10'),'whatsappmessage:create'),controller[_0xa8eb('0x11')]);router[_0xa8eb('0x12')](_0xa8eb('0x13'),controller['status']);router[_0xa8eb('0x14')](_0xa8eb('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa8eb('0x14')](_0xa8eb('0x15'),auth['isAuthenticated'](),controller[_0xa8eb('0x16')]);router['put'](_0xa8eb('0x17'),auth[_0xa8eb('0x9')](),controller[_0xa8eb('0x18')]);router[_0xa8eb('0x19')](_0xa8eb('0xd'),auth['isAuthenticated'](),controller[_0xa8eb('0x1a')]);module[_0xa8eb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 6f91ed8..328be09 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 _0x7553=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7553,0x1c3));var _0x3755=function(_0x4c644c,_0x1a5d4f){_0x4c644c=_0x4c644c-0x0;var _0x18b89e=_0x7553[_0x4c644c];return _0x18b89e;};'use strict';var Sequelize=require(_0x3755('0x0'));module[_0x3755('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3755('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3755('0x4')]('in','out'),'defaultValue':_0x3755('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3755('0x6')](0xbe)},'phone':{'type':Sequelize[_0x3755('0x6')]},'readAt':{'type':Sequelize[_0x3755('0x7')]},'secret':{'type':Sequelize[_0x3755('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3755('0x8')]}}; \ No newline at end of file +var _0xf013=['BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x54658b,_0x17f44b){var _0x181564=function(_0xa393ca){while(--_0xa393ca){_0x54658b['push'](_0x54658b['shift']());}};_0x181564(++_0x17f44b);}(_0xf013,0x118));var _0x3f01=function(_0x3b0a94,_0x1702a2){_0x3b0a94=_0x3b0a94-0x0;var _0x4d5f54=_0xf013[_0x3b0a94];return _0x4d5f54;};'use strict';var Sequelize=require(_0x3f01('0x0'));module[_0x3f01('0x1')]={'body':{'type':Sequelize[_0x3f01('0x2')](_0x3f01('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3f01('0x4')]('in','out'),'defaultValue':_0x3f01('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3f01('0x6')](0xbe)},'phone':{'type':Sequelize[_0x3f01('0x6')]},'readAt':{'type':Sequelize[_0x3f01('0x7')]},'secret':{'type':Sequelize[_0x3f01('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3f01('0x6')]},'providerResponse':{'type':Sequelize[_0x3f01('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 23f80eb..d3a0daa 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 _0xb971=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','isNil','read1stAt','[WHATSAPPMESSAGE: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','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','get','WhatsappInteractionId','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','WhatsappMessage,\x20%s,\x20%s','error','message','info','result','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','destroy','name','send','index','WhatsappMessage','rawAttributes','fieldName'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0xb971,0x176));var _0x1b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb971[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1b97('0x0'));var rp=require('request-promise');var moment=require(_0x1b97('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1b97('0x2'));var util=require('util');var path=require(_0x1b97('0x3'));var sox=require(_0x1b97('0x4'));var csv=require(_0x1b97('0x5'));var ejs=require(_0x1b97('0x6'));var fs=require('fs');var fs_extra=require(_0x1b97('0x7'));var _=require(_0x1b97('0x8'));var squel=require(_0x1b97('0x9'));var crypto=require(_0x1b97('0xa'));var jsforce=require(_0x1b97('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1b97('0x5'));var querystring=require(_0x1b97('0xc'));var Papa=require(_0x1b97('0xd'));var Redis=require(_0x1b97('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1b97('0xf'));var as=require(_0x1b97('0x10'));var hardwareService=require(_0x1b97('0x11'));var logger=require(_0x1b97('0x12'))(_0x1b97('0x13'));var utils=require(_0x1b97('0x14'));var config=require(_0x1b97('0x15'));var licenseUtil=require(_0x1b97('0x16'));var db=require(_0x1b97('0x17'))['db'];config[_0x1b97('0x18')]=_[_0x1b97('0x19')](config[_0x1b97('0x18')],{'host':_0x1b97('0x1a'),'port':0x18eb});var socket=require(_0x1b97('0x1b'))(new Redis(config[_0x1b97('0x18')]));require('./whatsappMessage.socket')[_0x1b97('0x1c')](socket);var jayson=require(_0x1b97('0x1d'));var client=jayson[_0x1b97('0x1e')][_0x1b97('0x1f')]({'port':0x232c});var client9002=jayson[_0x1b97('0x1e')][_0x1b97('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x22bdf8,_0x13c6c3,_0x1edfc0,_0x3b8102){return new BPromise(function(_0x4930c7,_0x5ae73a){var _0x93e42c=_0x3b8102||client;return _0x93e42c[_0x1b97('0x20')](_0x22bdf8,_0x1edfc0)[_0x1b97('0x21')](function(_0x52b57){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x13c6c3,_0x1b97('0x22'));logger[_0x1b97('0x23')](_0x1b97('0x24'),_0x13c6c3,'request\x20sent',JSON[_0x1b97('0x25')](_0x52b57));if(_0x52b57['error']){if(_0x52b57['error'][_0x1b97('0x26')]===0x1f4){logger['error'](_0x1b97('0x27'),_0x13c6c3,_0x52b57[_0x1b97('0x28')][_0x1b97('0x29')]);return _0x5ae73a(_0x52b57[_0x1b97('0x28')][_0x1b97('0x29')]);}logger[_0x1b97('0x28')](_0x1b97('0x27'),_0x13c6c3,_0x52b57[_0x1b97('0x28')]['message']);return _0x4930c7(_0x52b57['error'][_0x1b97('0x29')]);}else{logger[_0x1b97('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x13c6c3,_0x1b97('0x22'));_0x4930c7(_0x52b57[_0x1b97('0x2b')][_0x1b97('0x29')]);}})['catch'](function(_0x25037f){logger[_0x1b97('0x28')](_0x1b97('0x27'),_0x13c6c3,_0x25037f);_0x5ae73a(_0x25037f);});});}function respondWithStatusCode(_0xa2aaa,_0x263cd2){_0x263cd2=_0x263cd2||0xcc;return function(_0x4e5628){if(_0x4e5628){return _0xa2aaa[_0x1b97('0x2c')](_0x263cd2);}return _0xa2aaa[_0x1b97('0x2d')](_0x263cd2)[_0x1b97('0x2e')]();};}function respondWithResult(_0x4735c8,_0x3e5ac0){_0x3e5ac0=_0x3e5ac0||0xc8;return function(_0x2a1cf0){if(_0x2a1cf0){return _0x4735c8[_0x1b97('0x2d')](_0x3e5ac0)['json'](_0x2a1cf0);}};}function respondWithFilteredResult(_0xc66a33,_0x2f5eab){return function(_0x1dc5b6){if(_0x1dc5b6){var _0x4f0dae=typeof _0x2f5eab['offset']===_0x1b97('0x2f')&&typeof _0x2f5eab[_0x1b97('0x30')]===_0x1b97('0x2f');var _0x9af2c0=_0x1dc5b6['count'];var _0x3828c7=_0x4f0dae?0x0:_0x2f5eab[_0x1b97('0x31')];var _0x15e8af=_0x4f0dae?_0x1dc5b6[_0x1b97('0x32')]:_0x2f5eab[_0x1b97('0x31')]+_0x2f5eab[_0x1b97('0x30')];var _0x556560;if(_0x15e8af>=_0x9af2c0){_0x15e8af=_0x9af2c0;_0x556560=0xc8;}else{_0x556560=0xce;}_0xc66a33[_0x1b97('0x2d')](_0x556560);return _0xc66a33[_0x1b97('0x33')](_0x1b97('0x34'),_0x3828c7+'-'+_0x15e8af+'/'+_0x9af2c0)[_0x1b97('0x35')](_0x1dc5b6);}return null;};}function patchUpdates(_0x4bf613){return function(_0x83c3a8){try{jsonpatch['apply'](_0x83c3a8,_0x4bf613,!![]);}catch(_0x444863){return BPromise[_0x1b97('0x36')](_0x444863);}return _0x83c3a8[_0x1b97('0x37')]();};}function saveUpdates(_0x56a59b,_0x3c1403){return function(_0x547b25){if(_0x547b25){return _0x547b25[_0x1b97('0x38')](_0x56a59b)[_0x1b97('0x21')](function(_0x4db6c2){return _0x4db6c2;});}return null;};}function removeEntity(_0x551743,_0x375321){return function(_0x11db8b){if(_0x11db8b){return _0x11db8b[_0x1b97('0x39')]()[_0x1b97('0x21')](function(){_0x551743['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed935,_0x36bf53){return function(_0x4736df){if(!_0x4736df){_0x2ed935[_0x1b97('0x2c')](0x194);}return _0x4736df;};}function handleError(_0x182b73,_0x2c81ad){_0x2c81ad=_0x2c81ad||0x1f4;return function(_0x455da8){logger['error'](_0x455da8['stack']);if(_0x455da8[_0x1b97('0x3a')]){delete _0x455da8[_0x1b97('0x3a')];}_0x182b73[_0x1b97('0x2d')](_0x2c81ad)[_0x1b97('0x3b')](_0x455da8);};}exports[_0x1b97('0x3c')]=function(_0x1f4847,_0x2e8591){var _0x2fbbe3={},_0x4cf569={},_0x38b01a={'count':0x0,'rows':[]};var _0x37e2ac=_['map'](db[_0x1b97('0x3d')][_0x1b97('0x3e')],function(_0x2c40c1){return{'name':_0x2c40c1[_0x1b97('0x3f')],'type':_0x2c40c1['type'][_0x1b97('0x40')]};});_0x4cf569[_0x1b97('0x41')]=_[_0x1b97('0x42')](_0x37e2ac,_0x1b97('0x3a'));_0x4cf569[_0x1b97('0x43')]=_[_0x1b97('0x44')](_0x1f4847[_0x1b97('0x43')]);_0x4cf569[_0x1b97('0x45')]=_[_0x1b97('0x46')](_0x4cf569[_0x1b97('0x41')],_0x4cf569['query']);_0x2fbbe3[_0x1b97('0x47')]=_[_0x1b97('0x46')](_0x4cf569['model'],qs[_0x1b97('0x48')](_0x1f4847['query'][_0x1b97('0x48')]));_0x2fbbe3[_0x1b97('0x47')]=_0x2fbbe3[_0x1b97('0x47')][_0x1b97('0x49')]?_0x2fbbe3[_0x1b97('0x47')]:_0x4cf569['model'];if(!_0x1f4847[_0x1b97('0x43')][_0x1b97('0x4a')](_0x1b97('0x4b'))){_0x2fbbe3[_0x1b97('0x30')]=qs[_0x1b97('0x30')](_0x1f4847[_0x1b97('0x43')][_0x1b97('0x30')]);_0x2fbbe3[_0x1b97('0x31')]=qs[_0x1b97('0x31')](_0x1f4847[_0x1b97('0x43')][_0x1b97('0x31')]);}_0x2fbbe3[_0x1b97('0x4c')]=qs[_0x1b97('0x4d')](_0x1f4847[_0x1b97('0x43')]['sort']);_0x2fbbe3[_0x1b97('0x4e')]=qs[_0x1b97('0x45')](_[_0x1b97('0x4f')](_0x1f4847[_0x1b97('0x43')],_0x4cf569['filters']),_0x37e2ac);if(_0x1f4847['query'][_0x1b97('0x50')]){_0x2fbbe3[_0x1b97('0x4e')]=_['merge'](_0x2fbbe3['where'],{'$or':_['map'](_0x37e2ac,function(_0xf7d310){if(_0xf7d310[_0x1b97('0x51')]!==_0x1b97('0x52')){var _0x2b2263={};_0x2b2263[_0xf7d310['name']]={'$like':'%'+_0x1f4847['query'][_0x1b97('0x50')]+'%'};return _0x2b2263;}})});}_0x2fbbe3=_[_0x1b97('0x53')]({},_0x2fbbe3,_0x1f4847[_0x1b97('0x54')]);var _0x123d6e={'where':_0x2fbbe3[_0x1b97('0x4e')]};return db[_0x1b97('0x3d')][_0x1b97('0x32')](_0x123d6e)[_0x1b97('0x21')](function(_0x218c3e){_0x38b01a[_0x1b97('0x32')]=_0x218c3e;if(_0x1f4847[_0x1b97('0x43')][_0x1b97('0x55')]){_0x2fbbe3[_0x1b97('0x56')]=[{'all':!![]}];}return db[_0x1b97('0x3d')]['findAll'](_0x2fbbe3);})[_0x1b97('0x21')](function(_0x5ae588){_0x38b01a[_0x1b97('0x57')]=_0x5ae588;return _0x38b01a;})[_0x1b97('0x21')](respondWithFilteredResult(_0x2e8591,_0x2fbbe3))[_0x1b97('0x58')](handleError(_0x2e8591,null));};exports[_0x1b97('0x59')]=function(_0x196c9a,_0xb931c1){var _0xda46f9={'raw':!![],'where':{'id':_0x196c9a[_0x1b97('0x5a')]['id']}},_0x89e491={};_0x89e491[_0x1b97('0x41')]=_[_0x1b97('0x44')](db['WhatsappMessage'][_0x1b97('0x3e')]);_0x89e491[_0x1b97('0x43')]=_[_0x1b97('0x44')](_0x196c9a[_0x1b97('0x43')]);_0x89e491[_0x1b97('0x45')]=_['intersection'](_0x89e491['model'],_0x89e491[_0x1b97('0x43')]);_0xda46f9[_0x1b97('0x47')]=_[_0x1b97('0x46')](_0x89e491[_0x1b97('0x41')],qs[_0x1b97('0x48')](_0x196c9a[_0x1b97('0x43')][_0x1b97('0x48')]));_0xda46f9[_0x1b97('0x47')]=_0xda46f9[_0x1b97('0x47')][_0x1b97('0x49')]?_0xda46f9[_0x1b97('0x47')]:_0x89e491[_0x1b97('0x41')];if(_0x196c9a[_0x1b97('0x43')][_0x1b97('0x55')]){_0xda46f9[_0x1b97('0x56')]=[{'all':!![]}];}_0xda46f9=_[_0x1b97('0x53')]({},_0xda46f9,_0x196c9a[_0x1b97('0x54')]);return db['WhatsappMessage'][_0x1b97('0x5b')](_0xda46f9)[_0x1b97('0x21')](handleEntityNotFound(_0xb931c1,null))[_0x1b97('0x21')](respondWithResult(_0xb931c1,null))[_0x1b97('0x58')](handleError(_0xb931c1,null));};exports[_0x1b97('0x5c')]=function(_0x4d8dee,_0xc08f51){return db[_0x1b97('0x3d')][_0x1b97('0x5c')](_0x4d8dee[_0x1b97('0x5d')],{})['then'](respondWithResult(_0xc08f51,0xc9))[_0x1b97('0x58')](handleError(_0xc08f51,null));};exports[_0x1b97('0x38')]=function(_0x1279b5,_0xef9cf1){if(_0x1279b5[_0x1b97('0x5d')]['id']){delete _0x1279b5[_0x1b97('0x5d')]['id'];}return db[_0x1b97('0x3d')][_0x1b97('0x5b')]({'where':{'id':_0x1279b5[_0x1b97('0x5a')]['id']}})[_0x1b97('0x21')](handleEntityNotFound(_0xef9cf1,null))[_0x1b97('0x21')](saveUpdates(_0x1279b5[_0x1b97('0x5d')],null))['then'](respondWithResult(_0xef9cf1,null))['catch'](handleError(_0xef9cf1,null));};exports[_0x1b97('0x39')]=function(_0x3b7e60,_0x572f3a){return db[_0x1b97('0x3d')]['find']({'where':{'id':_0x3b7e60[_0x1b97('0x5a')]['id']}})['then'](handleEntityNotFound(_0x572f3a,null))['then'](removeEntity(_0x572f3a,null))[_0x1b97('0x58')](handleError(_0x572f3a,null));};exports[_0x1b97('0x5e')]=function(_0x1f6489,_0x503f08){return db[_0x1b97('0x3d')][_0x1b97('0x5e')]()[_0x1b97('0x21')](respondWithResult(_0x503f08,null))[_0x1b97('0x58')](handleError(_0x503f08,null));};var interaction_log=require(_0x1b97('0x12'))(_0x1b97('0x5f'));exports['accept']=function(_0x245e7a,_0x1c9eee,_0xf07d7d){var _0x160fa7={'agent':{},'channel':_0x1b97('0x60')};if(_0x245e7a[_0x1b97('0x5d')]['id']){delete _0x245e7a['body']['id'];}_0x245e7a[_0x1b97('0x5d')][_0x1b97('0x61')]=!![];_0x245e7a['body'][_0x1b97('0x62')]=moment()[_0x1b97('0x63')](_0x1b97('0x64'));_0x245e7a['body'][_0x1b97('0x65')]=_0x245e7a[_0x1b97('0x5d')]['UserId']||_0x245e7a[_0x1b97('0x66')]['id'];_0x160fa7[_0x1b97('0x67')]['id']=_0x245e7a['body']['UserId'];return db[_0x1b97('0x3d')]['find']({'where':{'id':_0x245e7a[_0x1b97('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1c9eee,null))[_0x1b97('0x21')](saveUpdates(_0x245e7a[_0x1b97('0x5d')],null))[_0x1b97('0x21')](function(_0x51275c){if(_0x51275c){_0x160fa7[_0x1b97('0x29')]=_0x51275c['get']({'plain':!![]});return db[_0x1b97('0x68')]['find']({'where':{'id':_0x51275c['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1c9eee,null))[_0x1b97('0x21')](function(_0x28ad23){if(_0x28ad23){return _0x28ad23[_0x1b97('0x38')]({'UserId':_0x245e7a[_0x1b97('0x5d')]['UserId'],'read1stAt':_[_0x1b97('0x69')](_0x28ad23[_0x1b97('0x6a')])?moment()['format'](_0x1b97('0x64')):undefined});}return null;})[_0x1b97('0x21')](function(_0x43d17d){if(_0x43d17d){_0x160fa7['interaction']=_0x43d17d['get']({'plain':!![]});interaction_log[_0x1b97('0x2a')](_0x1b97('0x6b'),_0x245e7a[_0x1b97('0x66')]['id'],_0x245e7a[_0x1b97('0x66')][_0x1b97('0x3a')],_0x245e7a['user']['role'],_0x160fa7['interaction']['id'],_0x245e7a[_0x1b97('0x5d')]?JSON[_0x1b97('0x25')](_0x245e7a[_0x1b97('0x5d')]):_0x1b97('0x6c'));return respondWithRpcPromise(_0x1b97('0x6d'),_0x1b97('0x6e'),_0x160fa7);}return null;})[_0x1b97('0x21')](function(_0x72c35c){var _0x27cd18=_0x1b97('0x6f')+_0x72c35c[_0x1b97('0x29')][_0x1b97('0x70')];return db[_0x1b97('0x71')][_0x1b97('0x43')](_0x27cd18,{'type':db[_0x1b97('0x72')][_0x1b97('0x73')][_0x1b97('0x74')],'raw':!![]})[_0x1b97('0x21')](function(_0x2f2d90){return _0x2f2d90;});})[_0x1b97('0x21')](function(_0x24615a){if(_0x24615a){_0x160fa7['message'][_0x1b97('0x75')]=_0x24615a[0x0];if(!_0x245e7a['body']['UserId'])return;return db[_0x1b97('0x76')][_0x1b97('0x5b')]({'where':{'id':_0x245e7a[_0x1b97('0x5d')][_0x1b97('0x65')],'role':_0x1b97('0x67')},'attributes':['id',_0x1b97('0x3a'),_0x1b97('0x77'),_0x1b97('0x78'),_0x1b97('0x79')],'raw':!![]});}return null;})[_0x1b97('0x21')](function(_0x35454c){if(!_0x35454c)return null;_0x160fa7[_0x1b97('0x29')]['agent']=_0x35454c;return _0x160fa7;})['then'](function(_0xc8d1e7){if(_0xc8d1e7){if(_0x245e7a['body'][_0x1b97('0x7a')]){_0x160fa7[_0x1b97('0x29')][_0x1b97('0x7b')]=util[_0x1b97('0x63')](_0x1b97('0x7c'),_0x245e7a['user'][_0x1b97('0x3a')]);_0x160fa7[_0x1b97('0x29')][_0x1b97('0x7d')]=_0x160fa7['channel'];_0x160fa7[_0x1b97('0x29')][_0x1b97('0x7e')]=_0x160fa7[_0x1b97('0x7d')];_0x160fa7[_0x1b97('0x29')][_0x1b97('0x7f')]=_0x1b97('0x80');return respondWithRpcPromise('EventManager',_0x1b97('0x81'),{'event':_0x1b97('0x82'),'message':_0x160fa7[_0x1b97('0x29')]},client9002)[_0x1b97('0x21')](function(){return _0x160fa7;});}return _0x160fa7;}return null;})[_0x1b97('0x21')](respondWithResult(_0x1c9eee,null))[_0x1b97('0x58')](handleError(_0x1c9eee,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x1b97('0x36')]=function(_0x16565a,_0x204559,_0x4284fc){var _0x299c56={'agent':{},'channel':_0x1b97('0x60')};if(_0x16565a[_0x1b97('0x5d')]['id']){delete _0x16565a[_0x1b97('0x5d')]['id'];}_0x16565a[_0x1b97('0x5d')][_0x1b97('0x65')]=_0x16565a[_0x1b97('0x5d')][_0x1b97('0x65')]||_0x16565a[_0x1b97('0x66')]['id'];_0x299c56['agent']['id']=_0x16565a[_0x1b97('0x5d')][_0x1b97('0x65')];return db[_0x1b97('0x3d')][_0x1b97('0x5b')]({'where':{'id':_0x16565a[_0x1b97('0x5a')]['id'],'UserId':null}})[_0x1b97('0x21')](handleEntityNotFound(_0x204559,null))[_0x1b97('0x21')](function(_0x2c9927){if(_0x2c9927){_0x299c56[_0x1b97('0x29')]=_0x2c9927[_0x1b97('0x83')]({'plain':!![]});return db[_0x1b97('0x68')][_0x1b97('0x5b')]({'where':{'id':_0x2c9927[_0x1b97('0x84')]}});}return null;})['then'](handleEntityNotFound(_0x204559,null))[_0x1b97('0x21')](function(_0x66ec0e){if(_0x66ec0e){_0x299c56[_0x1b97('0x85')]=_0x66ec0e['get']({'plain':!![]});interaction_log[_0x1b97('0x2a')](_0x1b97('0x86'),_0x16565a[_0x1b97('0x66')]['id'],_0x16565a[_0x1b97('0x66')][_0x1b97('0x3a')],_0x16565a[_0x1b97('0x66')]['role'],_0x299c56['interaction']['id'],_0x16565a[_0x1b97('0x5d')]?JSON[_0x1b97('0x25')](_0x16565a[_0x1b97('0x5d')]):_0x1b97('0x6c'));return respondWithRpcPromise(_0x1b97('0x87'),_0x1b97('0x88'),_0x299c56);}return null;})['then'](function(_0x512de8){var _0x4e129a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x512de8[_0x1b97('0x29')][_0x1b97('0x70')];return db[_0x1b97('0x71')][_0x1b97('0x43')](_0x4e129a,{'type':db[_0x1b97('0x72')][_0x1b97('0x73')][_0x1b97('0x74')],'raw':!![]})[_0x1b97('0x21')](function(_0x26b63a){return _0x26b63a;});})[_0x1b97('0x21')](function(_0x5c68f1){if(_0x5c68f1){_0x299c56[_0x1b97('0x29')]['contact']=_0x5c68f1[0x0];if(!_0x16565a[_0x1b97('0x5d')][_0x1b97('0x65')])return;return db[_0x1b97('0x76')][_0x1b97('0x5b')]({'where':{'id':_0x16565a[_0x1b97('0x5d')][_0x1b97('0x65')],'role':_0x1b97('0x67')},'attributes':['id',_0x1b97('0x3a'),_0x1b97('0x77'),_0x1b97('0x78'),_0x1b97('0x79')],'raw':!![]});}return null;})[_0x1b97('0x21')](function(_0x3259c9){if(!_0x3259c9)return null;_0x299c56[_0x1b97('0x29')][_0x1b97('0x67')]=_0x3259c9;return _0x299c56;})[_0x1b97('0x21')](function(_0x4b28c6){if(_0x4b28c6){_0x4b28c6['message'][_0x1b97('0x7b')]=util[_0x1b97('0x63')]('SIP/%s',_0x16565a[_0x1b97('0x66')][_0x1b97('0x3a')]);_0x4b28c6['message'][_0x1b97('0x7d')]=_0x299c56[_0x1b97('0x7d')];_0x4b28c6['message'][_0x1b97('0x7e')]=_0x299c56[_0x1b97('0x7d')];_0x4b28c6[_0x1b97('0x29')]['event']=_0x1b97('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x4b28c6['message']},client9002);return _0x299c56;}return null;})[_0x1b97('0x21')](respondWithResult(_0x204559,null))['catch'](handleError(_0x204559,null));};exports[_0x1b97('0x2d')]=function(_0x1da4ee,_0x4007f2,_0x2d8c1f){if(_0x1da4ee[_0x1b97('0x5d')]['id']){delete _0x1da4ee[_0x1b97('0x5d')]['id'];}var _0x556197;return db['WhatsappMessage'][_0x1b97('0x5b')]({'where':{'id':_0x1da4ee[_0x1b97('0x5a')]['id']}})[_0x1b97('0x21')](handleEntityNotFound(_0x4007f2,null))['then'](function(_0x31f853){if(_0x31f853){_0x556197=_0x31f853;return db[_0x1b97('0x89')][_0x1b97('0x5b')]({'where':{'id':_0x31f853['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x4007f2,null))[_0x1b97('0x21')](function(_0x55b0bc){if(_0x55b0bc){logger[_0x1b97('0x23')](_0x1b97('0x8a'),'status',_0x1b97('0x8b'),_0x55b0bc[_0x1b97('0x51')],util['inspect'](_0x1da4ee[_0x1b97('0x5d')],{'showHidden':![],'depth':null}));switch(_0x55b0bc[_0x1b97('0x51')]){case _0x1b97('0x8c'):if(_0x1da4ee[_0x1b97('0x5d')][_0x1b97('0x8d')]&&_0x1da4ee[_0x1b97('0x5d')][_0x1b97('0x8d')]===_0x556197[_0x1b97('0x8e')]&&_0x1da4ee[_0x1b97('0x5d')][_0x1b97('0x8f')]&&_0x1da4ee[_0x1b97('0x5d')][_0x1b97('0x8f')]==='read'){return _0x556197[_0x1b97('0x38')]({'read':!![]});}else{logger[_0x1b97('0x28')](_0x1b97('0x90'),_0x1b97('0x2d'),_0x1b97('0x8c'),util[_0x1b97('0x91')](_0x1da4ee[_0x1b97('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x556197;}})[_0x1b97('0x21')](respondWithResult(_0x4007f2,null))[_0x1b97('0x58')](handleError(_0x4007f2,null));}; \ No newline at end of file +var _0x3383=['[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','fullname','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','WhatsappMessage','fieldName','type','key','model','map','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','create','body','find','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','../../config/logger','WhatsappInteraction'];(function(_0x34c849,_0x4693c1){var _0x4eb562=function(_0x1326a3){while(--_0x1326a3){_0x34c849['push'](_0x34c849['shift']());}};_0x4eb562(++_0x4693c1);}(_0x3383,0x120));var _0x3338=function(_0x22b3de,_0x367444){_0x22b3de=_0x22b3de-0x0;var _0x39cacc=_0x3383[_0x22b3de];return _0x39cacc;};'use strict';var emlformat=require(_0x3338('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3338('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3338('0x2'));var Mustache=require(_0x3338('0x3'));var util=require(_0x3338('0x4'));var path=require(_0x3338('0x5'));var sox=require(_0x3338('0x6'));var csv=require(_0x3338('0x7'));var ejs=require(_0x3338('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3338('0x9'));var squel=require(_0x3338('0xa'));var crypto=require(_0x3338('0xb'));var jsforce=require(_0x3338('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3338('0x7'));var querystring=require(_0x3338('0xd'));var Papa=require('papaparse');var Redis=require(_0x3338('0xe'));var authService=require(_0x3338('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3338('0x10'));var logger=require('../../config/logger')(_0x3338('0x11'));var utils=require('../../config/utils');var config=require(_0x3338('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3338('0x13'))['db'];config[_0x3338('0x14')]=_['defaults'](config[_0x3338('0x14')],{'host':_0x3338('0x15'),'port':0x18eb});var socket=require(_0x3338('0x16'))(new Redis(config[_0x3338('0x14')]));require(_0x3338('0x17'))[_0x3338('0x18')](socket);var jayson=require(_0x3338('0x19'));var client=jayson[_0x3338('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0x3338('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4c02f1,_0x10f623,_0x30f00d,_0x5afaf8){return new BPromise(function(_0x6c94fc,_0x4efb03){var _0xc25e6a=_0x5afaf8||client;return _0xc25e6a[_0x3338('0x1c')](_0x4c02f1,_0x30f00d)['then'](function(_0x5f0baf){logger[_0x3338('0x1d')](_0x3338('0x1e'),_0x10f623,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x10f623,_0x3338('0x1f'),JSON[_0x3338('0x20')](_0x5f0baf));if(_0x5f0baf[_0x3338('0x21')]){if(_0x5f0baf[_0x3338('0x21')][_0x3338('0x22')]===0x1f4){logger[_0x3338('0x21')](_0x3338('0x1e'),_0x10f623,_0x5f0baf[_0x3338('0x21')][_0x3338('0x23')]);return _0x4efb03(_0x5f0baf[_0x3338('0x21')][_0x3338('0x23')]);}logger[_0x3338('0x21')](_0x3338('0x1e'),_0x10f623,_0x5f0baf[_0x3338('0x21')][_0x3338('0x23')]);return _0x6c94fc(_0x5f0baf[_0x3338('0x21')][_0x3338('0x23')]);}else{logger[_0x3338('0x1d')](_0x3338('0x1e'),_0x10f623,_0x3338('0x1f'));_0x6c94fc(_0x5f0baf['result'][_0x3338('0x23')]);}})[_0x3338('0x24')](function(_0x4f90f0){logger[_0x3338('0x21')](_0x3338('0x1e'),_0x10f623,_0x4f90f0);_0x4efb03(_0x4f90f0);});});}function respondWithStatusCode(_0x14e7f3,_0x3ffa73){_0x3ffa73=_0x3ffa73||0xcc;return function(_0x220256){if(_0x220256){return _0x14e7f3['sendStatus'](_0x3ffa73);}return _0x14e7f3[_0x3338('0x25')](_0x3ffa73)[_0x3338('0x26')]();};}function respondWithResult(_0x1661dc,_0x5e6d20){_0x5e6d20=_0x5e6d20||0xc8;return function(_0x261365){if(_0x261365){return _0x1661dc['status'](_0x5e6d20)['json'](_0x261365);}};}function respondWithFilteredResult(_0x5f1c5f,_0x46a1e3){return function(_0x2611cc){if(_0x2611cc){var _0x37af2b=typeof _0x46a1e3[_0x3338('0x27')]==='undefined'&&typeof _0x46a1e3[_0x3338('0x28')]===_0x3338('0x29');var _0x59064f=_0x2611cc['count'];var _0x47ff68=_0x37af2b?0x0:_0x46a1e3['offset'];var _0x5f2a83=_0x37af2b?_0x2611cc[_0x3338('0x2a')]:_0x46a1e3['offset']+_0x46a1e3['limit'];var _0x5741f5;if(_0x5f2a83>=_0x59064f){_0x5f2a83=_0x59064f;_0x5741f5=0xc8;}else{_0x5741f5=0xce;}_0x5f1c5f[_0x3338('0x25')](_0x5741f5);return _0x5f1c5f[_0x3338('0x2b')](_0x3338('0x2c'),_0x47ff68+'-'+_0x5f2a83+'/'+_0x59064f)[_0x3338('0x2d')](_0x2611cc);}return null;};}function patchUpdates(_0x50ebe0){return function(_0x27b57f){try{jsonpatch[_0x3338('0x2e')](_0x27b57f,_0x50ebe0,!![]);}catch(_0x426762){return BPromise[_0x3338('0x2f')](_0x426762);}return _0x27b57f[_0x3338('0x30')]();};}function saveUpdates(_0x292310,_0x134f66){return function(_0x3a4147){if(_0x3a4147){return _0x3a4147[_0x3338('0x31')](_0x292310)[_0x3338('0x32')](function(_0x410e60){return _0x410e60;});}return null;};}function removeEntity(_0xdbcb4b,_0x3fb353){return function(_0x4600eb){if(_0x4600eb){return _0x4600eb[_0x3338('0x33')]()[_0x3338('0x32')](function(){_0xdbcb4b[_0x3338('0x25')](0xcc)[_0x3338('0x26')]();});}};}function handleEntityNotFound(_0xaf5e23,_0x537f3c){return function(_0x40aa2e){if(!_0x40aa2e){_0xaf5e23[_0x3338('0x34')](0x194);}return _0x40aa2e;};}function handleError(_0x5a8dbf,_0x311609){_0x311609=_0x311609||0x1f4;return function(_0x34d309){logger[_0x3338('0x21')](_0x34d309['stack']);if(_0x34d309[_0x3338('0x35')]){delete _0x34d309[_0x3338('0x35')];}_0x5a8dbf[_0x3338('0x25')](_0x311609)[_0x3338('0x36')](_0x34d309);};}exports[_0x3338('0x37')]=function(_0x3fb78c,_0x54b97b){var _0x53bcf8={},_0x60fbba={},_0x13e4aa={'count':0x0,'rows':[]};var _0x3db67b=_['map'](db[_0x3338('0x38')]['rawAttributes'],function(_0x5a295a){return{'name':_0x5a295a[_0x3338('0x39')],'type':_0x5a295a[_0x3338('0x3a')][_0x3338('0x3b')]};});_0x60fbba[_0x3338('0x3c')]=_[_0x3338('0x3d')](_0x3db67b,_0x3338('0x35'));_0x60fbba[_0x3338('0x3e')]=_['keys'](_0x3fb78c[_0x3338('0x3e')]);_0x60fbba['filters']=_[_0x3338('0x3f')](_0x60fbba['model'],_0x60fbba['query']);_0x53bcf8['attributes']=_[_0x3338('0x3f')](_0x60fbba[_0x3338('0x3c')],qs['fields'](_0x3fb78c[_0x3338('0x3e')]['fields']));_0x53bcf8[_0x3338('0x40')]=_0x53bcf8[_0x3338('0x40')][_0x3338('0x41')]?_0x53bcf8[_0x3338('0x40')]:_0x60fbba[_0x3338('0x3c')];if(!_0x3fb78c[_0x3338('0x3e')][_0x3338('0x42')](_0x3338('0x43'))){_0x53bcf8[_0x3338('0x28')]=qs[_0x3338('0x28')](_0x3fb78c[_0x3338('0x3e')][_0x3338('0x28')]);_0x53bcf8[_0x3338('0x27')]=qs[_0x3338('0x27')](_0x3fb78c['query'][_0x3338('0x27')]);}_0x53bcf8[_0x3338('0x44')]=qs['sort'](_0x3fb78c['query'][_0x3338('0x45')]);_0x53bcf8[_0x3338('0x46')]=qs[_0x3338('0x47')](_['pick'](_0x3fb78c[_0x3338('0x3e')],_0x60fbba['filters']),_0x3db67b);if(_0x3fb78c[_0x3338('0x3e')]['filter']){_0x53bcf8[_0x3338('0x46')]=_[_0x3338('0x48')](_0x53bcf8['where'],{'$or':_[_0x3338('0x3d')](_0x3db67b,function(_0x5d9409){if(_0x5d9409[_0x3338('0x3a')]!=='VIRTUAL'){var _0x9d71c1={};_0x9d71c1[_0x5d9409[_0x3338('0x35')]]={'$like':'%'+_0x3fb78c[_0x3338('0x3e')]['filter']+'%'};return _0x9d71c1;}})});}_0x53bcf8=_[_0x3338('0x48')]({},_0x53bcf8,_0x3fb78c[_0x3338('0x49')]);var _0x86d194={'where':_0x53bcf8[_0x3338('0x46')]};return db[_0x3338('0x38')]['count'](_0x86d194)['then'](function(_0x5aa2b5){_0x13e4aa[_0x3338('0x2a')]=_0x5aa2b5;if(_0x3fb78c[_0x3338('0x3e')][_0x3338('0x4a')]){_0x53bcf8[_0x3338('0x4b')]=[{'all':!![]}];}return db[_0x3338('0x38')][_0x3338('0x4c')](_0x53bcf8);})['then'](function(_0x276b2b){_0x13e4aa[_0x3338('0x4d')]=_0x276b2b;return _0x13e4aa;})[_0x3338('0x32')](respondWithFilteredResult(_0x54b97b,_0x53bcf8))[_0x3338('0x24')](handleError(_0x54b97b,null));};exports[_0x3338('0x4e')]=function(_0x583c4e,_0x9315c){var _0x4fe380={'raw':!![],'where':{'id':_0x583c4e[_0x3338('0x4f')]['id']}},_0x19793e={};_0x19793e[_0x3338('0x3c')]=_[_0x3338('0x50')](db[_0x3338('0x38')][_0x3338('0x51')]);_0x19793e[_0x3338('0x3e')]=_[_0x3338('0x50')](_0x583c4e['query']);_0x19793e[_0x3338('0x47')]=_['intersection'](_0x19793e[_0x3338('0x3c')],_0x19793e[_0x3338('0x3e')]);_0x4fe380[_0x3338('0x40')]=_['intersection'](_0x19793e[_0x3338('0x3c')],qs[_0x3338('0x52')](_0x583c4e[_0x3338('0x3e')][_0x3338('0x52')]));_0x4fe380[_0x3338('0x40')]=_0x4fe380[_0x3338('0x40')][_0x3338('0x41')]?_0x4fe380['attributes']:_0x19793e[_0x3338('0x3c')];if(_0x583c4e[_0x3338('0x3e')][_0x3338('0x4a')]){_0x4fe380[_0x3338('0x4b')]=[{'all':!![]}];}_0x4fe380=_['merge']({},_0x4fe380,_0x583c4e[_0x3338('0x49')]);return db[_0x3338('0x38')]['find'](_0x4fe380)[_0x3338('0x32')](handleEntityNotFound(_0x9315c,null))['then'](respondWithResult(_0x9315c,null))[_0x3338('0x24')](handleError(_0x9315c,null));};exports[_0x3338('0x53')]=function(_0x371d00,_0x583497){return db[_0x3338('0x38')][_0x3338('0x53')](_0x371d00[_0x3338('0x54')],{})[_0x3338('0x32')](respondWithResult(_0x583497,0xc9))[_0x3338('0x24')](handleError(_0x583497,null));};exports[_0x3338('0x31')]=function(_0x15d931,_0x31ba54){if(_0x15d931[_0x3338('0x54')]['id']){delete _0x15d931[_0x3338('0x54')]['id'];}return db['WhatsappMessage'][_0x3338('0x55')]({'where':{'id':_0x15d931[_0x3338('0x4f')]['id']}})[_0x3338('0x32')](handleEntityNotFound(_0x31ba54,null))['then'](saveUpdates(_0x15d931['body'],null))['then'](respondWithResult(_0x31ba54,null))[_0x3338('0x24')](handleError(_0x31ba54,null));};exports['destroy']=function(_0xa8f2cd,_0x2906f4){return db[_0x3338('0x38')][_0x3338('0x55')]({'where':{'id':_0xa8f2cd[_0x3338('0x4f')]['id']}})[_0x3338('0x32')](handleEntityNotFound(_0x2906f4,null))[_0x3338('0x32')](removeEntity(_0x2906f4,null))[_0x3338('0x24')](handleError(_0x2906f4,null));};exports['describe']=function(_0x959ba0,_0x4aea1e){return db[_0x3338('0x38')]['describe']()[_0x3338('0x32')](respondWithResult(_0x4aea1e,null))[_0x3338('0x24')](handleError(_0x4aea1e,null));};var interaction_log=require('../../config/logger')(_0x3338('0x56'));exports[_0x3338('0x57')]=function(_0x4554c4,_0x4e8210,_0x897ca9){var _0x3ff980={'agent':{},'channel':_0x3338('0x58')};if(_0x4554c4[_0x3338('0x54')]['id']){delete _0x4554c4[_0x3338('0x54')]['id'];}_0x4554c4[_0x3338('0x54')][_0x3338('0x59')]=!![];_0x4554c4[_0x3338('0x54')][_0x3338('0x5a')]=moment()['format'](_0x3338('0x5b'));_0x4554c4[_0x3338('0x54')][_0x3338('0x5c')]=_0x4554c4[_0x3338('0x54')][_0x3338('0x5c')]||_0x4554c4[_0x3338('0x5d')]['id'];_0x3ff980[_0x3338('0x5e')]['id']=_0x4554c4[_0x3338('0x54')]['UserId'];return db[_0x3338('0x38')][_0x3338('0x55')]({'where':{'id':_0x4554c4[_0x3338('0x4f')]['id'],'UserId':null}})[_0x3338('0x32')](handleEntityNotFound(_0x4e8210,null))[_0x3338('0x32')](saveUpdates(_0x4554c4[_0x3338('0x54')],null))[_0x3338('0x32')](function(_0x8f5331){if(_0x8f5331){_0x3ff980[_0x3338('0x23')]=_0x8f5331[_0x3338('0x5f')]({'plain':!![]});return db['WhatsappInteraction'][_0x3338('0x55')]({'where':{'id':_0x8f5331[_0x3338('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x4e8210,null))[_0x3338('0x32')](function(_0x2f5749){if(_0x2f5749){return _0x2f5749[_0x3338('0x31')]({'UserId':_0x4554c4[_0x3338('0x54')]['UserId'],'read1stAt':_['isNil'](_0x2f5749[_0x3338('0x61')])?moment()[_0x3338('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3338('0x32')](function(_0xd9d955){if(_0xd9d955){_0x3ff980['interaction']=_0xd9d955[_0x3338('0x5f')]({'plain':!![]});interaction_log[_0x3338('0x1d')](_0x3338('0x63'),_0x4554c4[_0x3338('0x5d')]['id'],_0x4554c4[_0x3338('0x5d')]['name'],_0x4554c4[_0x3338('0x5d')][_0x3338('0x64')],_0x3ff980[_0x3338('0x65')]['id'],_0x4554c4[_0x3338('0x54')]?JSON[_0x3338('0x20')](_0x4554c4['body']):_0x3338('0x66'));return respondWithRpcPromise('AcceptMessage',_0x3338('0x67'),_0x3ff980);}return null;})['then'](function(_0x30fd93){var _0x2d1126=_0x3338('0x68')+_0x30fd93[_0x3338('0x23')][_0x3338('0x69')];return db['sequelize'][_0x3338('0x3e')](_0x2d1126,{'type':db[_0x3338('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3338('0x32')](function(_0x261fc0){return _0x261fc0;});})[_0x3338('0x32')](function(_0xfa1161){if(_0xfa1161){_0x3ff980[_0x3338('0x23')][_0x3338('0x6b')]=_0xfa1161[0x0];if(!_0x4554c4[_0x3338('0x54')][_0x3338('0x5c')])return;return db[_0x3338('0x6c')][_0x3338('0x55')]({'where':{'id':_0x4554c4[_0x3338('0x54')][_0x3338('0x5c')],'role':_0x3338('0x5e')},'attributes':['id',_0x3338('0x35'),'fullname',_0x3338('0x6d'),_0x3338('0x6e')],'raw':!![]});}return null;})[_0x3338('0x32')](function(_0x1e0772){if(!_0x1e0772)return null;_0x3ff980[_0x3338('0x23')]['agent']=_0x1e0772;return _0x3ff980;})['then'](function(_0x4d98be){if(_0x4d98be){if(_0x4554c4['body'][_0x3338('0x6f')]){_0x3ff980['message'][_0x3338('0x70')]=util['format'](_0x3338('0x71'),_0x4554c4[_0x3338('0x5d')][_0x3338('0x35')]);_0x3ff980[_0x3338('0x23')][_0x3338('0x72')]=_0x3ff980[_0x3338('0x72')];_0x3ff980[_0x3338('0x23')][_0x3338('0x73')]=_0x3ff980[_0x3338('0x72')];_0x3ff980['message'][_0x3338('0x74')]=_0x3338('0x57');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x3338('0x75'),'message':_0x3ff980[_0x3338('0x23')]},client9002)['then'](function(){return _0x3ff980;});}return _0x3ff980;}return null;})[_0x3338('0x32')](respondWithResult(_0x4e8210,null))[_0x3338('0x24')](handleError(_0x4e8210,null));};var interaction_log=require(_0x3338('0x76'))(_0x3338('0x56'));exports[_0x3338('0x2f')]=function(_0x3e414c,_0x23d75a,_0x29c83b){var _0x56b63d={'agent':{},'channel':'whatsapp'};if(_0x3e414c[_0x3338('0x54')]['id']){delete _0x3e414c[_0x3338('0x54')]['id'];}_0x3e414c[_0x3338('0x54')][_0x3338('0x5c')]=_0x3e414c[_0x3338('0x54')][_0x3338('0x5c')]||_0x3e414c[_0x3338('0x5d')]['id'];_0x56b63d[_0x3338('0x5e')]['id']=_0x3e414c[_0x3338('0x54')][_0x3338('0x5c')];return db['WhatsappMessage'][_0x3338('0x55')]({'where':{'id':_0x3e414c[_0x3338('0x4f')]['id'],'UserId':null}})[_0x3338('0x32')](handleEntityNotFound(_0x23d75a,null))[_0x3338('0x32')](function(_0x102eaf){if(_0x102eaf){_0x56b63d[_0x3338('0x23')]=_0x102eaf[_0x3338('0x5f')]({'plain':!![]});return db[_0x3338('0x77')][_0x3338('0x55')]({'where':{'id':_0x102eaf[_0x3338('0x60')]}});}return null;})[_0x3338('0x32')](handleEntityNotFound(_0x23d75a,null))[_0x3338('0x32')](function(_0x2125b5){if(_0x2125b5){_0x56b63d[_0x3338('0x65')]=_0x2125b5[_0x3338('0x5f')]({'plain':!![]});interaction_log[_0x3338('0x1d')](_0x3338('0x78'),_0x3e414c['user']['id'],_0x3e414c[_0x3338('0x5d')][_0x3338('0x35')],_0x3e414c['user']['role'],_0x56b63d[_0x3338('0x65')]['id'],_0x3e414c[_0x3338('0x54')]?JSON[_0x3338('0x20')](_0x3e414c[_0x3338('0x54')]):'null');return respondWithRpcPromise(_0x3338('0x79'),'rejectMessage',_0x56b63d);}return null;})[_0x3338('0x32')](function(_0x3844c3){var _0x2a4412='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3844c3[_0x3338('0x23')][_0x3338('0x69')];return db['sequelize'][_0x3338('0x3e')](_0x2a4412,{'type':db['Sequelize']['QueryTypes'][_0x3338('0x7a')],'raw':!![]})[_0x3338('0x32')](function(_0x80ba1f){return _0x80ba1f;});})[_0x3338('0x32')](function(_0xce623e){if(_0xce623e){_0x56b63d[_0x3338('0x23')]['contact']=_0xce623e[0x0];if(!_0x3e414c['body'][_0x3338('0x5c')])return;return db['User'][_0x3338('0x55')]({'where':{'id':_0x3e414c[_0x3338('0x54')][_0x3338('0x5c')],'role':_0x3338('0x5e')},'attributes':['id',_0x3338('0x35'),_0x3338('0x7b'),_0x3338('0x6d'),_0x3338('0x6e')],'raw':!![]});}return null;})[_0x3338('0x32')](function(_0x373b24){if(!_0x373b24)return null;_0x56b63d[_0x3338('0x23')][_0x3338('0x5e')]=_0x373b24;return _0x56b63d;})[_0x3338('0x32')](function(_0x42b770){if(_0x42b770){_0x42b770[_0x3338('0x23')]['interface']=util['format']('SIP/%s',_0x3e414c[_0x3338('0x5d')][_0x3338('0x35')]);_0x42b770['message'][_0x3338('0x72')]=_0x56b63d[_0x3338('0x72')];_0x42b770['message'][_0x3338('0x73')]=_0x56b63d[_0x3338('0x72')];_0x42b770['message']['event']=_0x3338('0x2f');respondWithRpcPromise('EventManager','EventManager',{'event':_0x3338('0x7c'),'message':_0x42b770['message']},client9002);return _0x56b63d;}return null;})['then'](respondWithResult(_0x23d75a,null))[_0x3338('0x24')](handleError(_0x23d75a,null));};exports[_0x3338('0x25')]=function(_0x477014,_0x415cb7,_0x561ec4){if(_0x477014['body']['id']){delete _0x477014[_0x3338('0x54')]['id'];}var _0x1c6aea;return db['WhatsappMessage'][_0x3338('0x55')]({'where':{'id':_0x477014[_0x3338('0x4f')]['id']}})['then'](handleEntityNotFound(_0x415cb7,null))[_0x3338('0x32')](function(_0x3b16f4){if(_0x3b16f4){_0x1c6aea=_0x3b16f4;return db[_0x3338('0x7d')]['find']({'where':{'id':_0x3b16f4[_0x3338('0x7e')]}});}})[_0x3338('0x32')](handleEntityNotFound(_0x415cb7,null))[_0x3338('0x32')](function(_0x332ef1){if(_0x332ef1){logger[_0x3338('0x7f')](_0x3338('0x80'),_0x3338('0x25'),_0x3338('0x81'),_0x332ef1[_0x3338('0x3a')],util[_0x3338('0x82')](_0x477014[_0x3338('0x54')],{'showHidden':![],'depth':null}));switch(_0x332ef1[_0x3338('0x3a')]){case'twilio':if(_0x477014['body']['MessageSid']&&_0x477014[_0x3338('0x54')][_0x3338('0x83')]===_0x1c6aea[_0x3338('0x84')]&&_0x477014['body'][_0x3338('0x85')]&&_0x477014['body']['MessageStatus']===_0x3338('0x59')){return _0x1c6aea[_0x3338('0x31')]({'read':!![]});}else{logger[_0x3338('0x21')](_0x3338('0x86'),_0x3338('0x25'),_0x3338('0x87'),util[_0x3338('0x82')](_0x477014['body'],{'showHidden':![],'depth':null}));}break;}return _0x1c6aea;}})[_0x3338('0x32')](respondWithResult(_0x415cb7,null))[_0x3338('0x24')](handleError(_0x415cb7,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index bf95e2e..c387fbe 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 _0x7be1=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x21f4b4,_0x75e2e9){var _0x140890=function(_0x394129){while(--_0x394129){_0x21f4b4['push'](_0x21f4b4['shift']());}};_0x140890(++_0x75e2e9);}(_0x7be1,0x165));var _0x17be=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0x7be1[_0x5111a9];return _0x59a15a;};'use strict';var EventEmitter=require(_0x17be('0x0'));var WhatsappMessage=require(_0x17be('0x1'))['db'][_0x17be('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17be('0x3'),'afterUpdate':_0x17be('0x4'),'afterDestroy':_0x17be('0x5')};function emitEvent(_0x16fccf){return function(_0x2bc9ed,_0x4b46fd,_0x4feea7){WhatsappMessageEvents['emit'](_0x16fccf+':'+_0x2bc9ed['id'],_0x2bc9ed);WhatsappMessageEvents[_0x17be('0x6')](_0x16fccf,_0x2bc9ed);_0x4feea7(null);};}for(var e in events){if(events[_0x17be('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x17be('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7be1=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x442071,_0x39787c){var _0x301ab0=function(_0x23945c){while(--_0x23945c){_0x442071['push'](_0x442071['shift']());}};_0x301ab0(++_0x39787c);}(_0x7be1,0x165));var _0x17be=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x7be1[_0x4aba15];return _0x1c8122;};'use strict';var EventEmitter=require(_0x17be('0x0'));var WhatsappMessage=require(_0x17be('0x1'))['db'][_0x17be('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17be('0x3'),'afterUpdate':_0x17be('0x4'),'afterDestroy':_0x17be('0x5')};function emitEvent(_0x16fccf){return function(_0x2bc9ed,_0x4b46fd,_0x4feea7){WhatsappMessageEvents['emit'](_0x16fccf+':'+_0x2bc9ed['id'],_0x2bc9ed);WhatsappMessageEvents[_0x17be('0x6')](_0x16fccf,_0x2bc9ed);_0x4feea7(null);};}for(var e in events){if(events[_0x17be('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x17be('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 8e905c5..6f3116b 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 _0x70c2=['message_id','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses'];(function(_0x51a929,_0x5ef0db){var _0x405bf8=function(_0x2a5856){while(--_0x2a5856){_0x51a929['push'](_0x51a929['shift']());}};_0x405bf8(++_0x5ef0db);}(_0x70c2,0xb8));var _0x270c=function(_0x5ec218,_0x23d2fc){_0x5ec218=_0x5ec218-0x0;var _0x21e6da=_0x70c2[_0x5ec218];return _0x21e6da;};'use strict';var _=require(_0x270c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x270c('0x1'));var moment=require(_0x270c('0x2'));var BPromise=require(_0x270c('0x3'));var rp=require(_0x270c('0x4'));var fetch=require(_0x270c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x270c('0x6'));var config=require(_0x270c('0x7'));var attributes=require(_0x270c('0x8'));module['exports']=function(_0x5e0df7,_0x1e79ee){return _0x5e0df7[_0x270c('0x9')]('WhatsappMessage',attributes,{'tableName':_0x270c('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x270c('0xb')]},{'name':_0x270c('0xc'),'fields':[_0x270c('0xd')],'type':_0x270c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x469b58,_0x72f92f,_0x4539c1){var _0x505d93=_0x5e0df7[_0x270c('0xf')];var _0x10850f=_0x469b58[_0x270c('0x10')]({'plain':!![]});if(_0x10850f[_0x270c('0x11')][_0x270c('0x12')]()==='in'||_0x10850f[_0x270c('0x11')][_0x270c('0x12')]()===_0x270c('0x13')&&!_0x10850f[_0x270c('0x14')]&&!_[_0x270c('0x15')](_0x10850f[_0x270c('0x16')])){_0x505d93[_0x270c('0x17')]['findOne']({'where':{'id':_0x10850f[_0x270c('0x18')]}})['then'](function(_0x17865a){if(_0x17865a){_0x17865a[_0x270c('0x19')]({'lastMsgAt':_0x10850f[_0x270c('0x1a')],'lastMsgDirection':_0x10850f[_0x270c('0x11')][_0x270c('0x12')]()});}})[_0x270c('0x1b')](function(_0x3ab2a3){console[_0x270c('0x1c')](_0x3ab2a3);});}if(_0x10850f[_0x270c('0x11')]===_0x270c('0x13')&&!_0x10850f[_0x270c('0x14')]){var _0x5876d2;_0x505d93[_0x270c('0x1d')][_0x270c('0x1e')]({'where':{'id':_0x10850f[_0x270c('0x1f')]},'raw':!![]})[_0x270c('0x20')](function(_0x2e2688){_0x5876d2=_0x2e2688;if(_0x5876d2&&_0x5876d2[_0x270c('0x21')]){switch(_0x5876d2[_0x270c('0x21')]){case _0x270c('0x22'):var _0x43b76e=require(_0x270c('0x22'));if(_0x5876d2[_0x270c('0x23')]&&_0x5876d2[_0x270c('0x24')]&&_0x5876d2['phone']){var _0x3673f4=new _0x43b76e(_0x5876d2[_0x270c('0x23')],_0x5876d2[_0x270c('0x24')]);_0x3673f4[_0x270c('0x25')][_0x270c('0x26')]({'body':_0x10850f[_0x270c('0xd')],'to':_0x270c('0x27')+_0x10850f[_0x270c('0x28')],'from':_0x270c('0x27')+_0x5876d2['phone'],'statusCallback':_0x5876d2[_0x270c('0x29')]+_0x270c('0x2a')+_0x10850f['id']+_0x270c('0x2b')+_0x5876d2[_0x270c('0x2c')]})['then'](function(_0x1f582e){if(_0x1f582e[_0x270c('0x2d')]){return _0x469b58[_0x270c('0x19')]({'messageId':_0x1f582e[_0x270c('0x2d')]});}})[_0x270c('0x1b')](function(_0x59dc95){logger[_0x270c('0x1c')](_0x270c('0x2e'),_0x270c('0x2f'),_0x270c('0x22'),util['inspect'](_0x59dc95,{'showHidden':![],'depth':null}));});}else{logger[_0x270c('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x270c('0x22'),_0x270c('0x30'));}break;case'sinch':var _0x10df54=_0x5876d2[_0x270c('0x23')];var _0x383410=_0x5876d2[_0x270c('0x24')];var _0xe4547e=_0x5876d2[_0x270c('0x31')]+_0x270c('0x32')+_0x10df54+'/messages/';var _0x18b7b0={'to':[_0x10850f[_0x270c('0x28')]],'message':{'type':_0x270c('0x33'),'text':_0x10850f[_0x270c('0xd')]}};var _0x2aa301={'method':_0x270c('0x34'),'uri':_0xe4547e,'headers':{'Authorization':_0x270c('0x35')+_0x383410,'Content-Type':_0x270c('0x36')},'body':_0x18b7b0,'json':!![]};rp(_0x2aa301)[_0x270c('0x20')](function(_0x5d0b0a){if(_0x5d0b0a[_0x270c('0x37')][0x0][_0x270c('0x38')]){return _0x469b58[_0x270c('0x19')]({'messageId':_0x5d0b0a[_0x270c('0x37')][0x0][_0x270c('0x38')]});}})[_0x270c('0x1b')](function(_0xaefcd9){logger['err'](_0x270c('0x39'),_0xaefcd9);});break;}}})[_0x270c('0x3a')](function(){_0x4539c1();});}else{_0x4539c1();}}},'charset':'utf8mb4','collate':_0x270c('0x3b')});}; \ No newline at end of file +var _0x4e41=['inspect','sinch','baseUrl','/whatsapp/v1/','phone','text','POST','application/json','statuses','message_id','catch','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','whatsapp:','remote','/api/whatsapp/messages/','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate'];(function(_0x657a68,_0x4ef12e){var _0x483b44=function(_0x16d1a5){while(--_0x16d1a5){_0x657a68['push'](_0x657a68['shift']());}};_0x483b44(++_0x4ef12e);}(_0x4e41,0xf7));var _0x14e4=function(_0x488fc6,_0x362d94){_0x488fc6=_0x488fc6-0x0;var _0x2dad83=_0x4e41[_0x488fc6];return _0x2dad83;};'use strict';var _=require(_0x14e4('0x0'));var util=require('util');var logger=require(_0x14e4('0x1'))('api');var moment=require(_0x14e4('0x2'));var BPromise=require(_0x14e4('0x3'));var rp=require(_0x14e4('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x14e4('0x5'));var rimraf=require(_0x14e4('0x6'));var config=require(_0x14e4('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x14e4('0x8')]=function(_0x356a86,_0x14d392){return _0x356a86[_0x14e4('0x9')](_0x14e4('0xa'),attributes,{'tableName':_0x14e4('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x14e4('0xc')]},{'name':_0x14e4('0xd'),'fields':[_0x14e4('0xe')],'type':_0x14e4('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f3d45,_0xfdf54b,_0x24b1c4){var _0x4d0730=_0x356a86[_0x14e4('0x10')];var _0x5aca38=_0x1f3d45[_0x14e4('0x11')]({'plain':!![]});if(_0x5aca38[_0x14e4('0x12')][_0x14e4('0x13')]()==='in'||_0x5aca38['direction'][_0x14e4('0x13')]()===_0x14e4('0x14')&&!_0x5aca38[_0x14e4('0x15')]&&!_[_0x14e4('0x16')](_0x5aca38[_0x14e4('0x17')])){_0x4d0730[_0x14e4('0x18')][_0x14e4('0x19')]({'where':{'id':_0x5aca38[_0x14e4('0x1a')]}})[_0x14e4('0x1b')](function(_0x40b1c5){if(_0x40b1c5){_0x40b1c5[_0x14e4('0x1c')]({'lastMsgAt':_0x5aca38['createdAt'],'lastMsgDirection':_0x5aca38['direction'][_0x14e4('0x13')]()});}})['catch'](function(_0x2136e2){console[_0x14e4('0x1d')](_0x2136e2);});}if(_0x5aca38['direction']==='out'&&!_0x5aca38[_0x14e4('0x15')]){var _0x4502de;_0x4d0730[_0x14e4('0x1e')][_0x14e4('0x1f')]({'where':{'id':_0x5aca38[_0x14e4('0x20')]},'raw':!![]})[_0x14e4('0x1b')](function(_0x68f3f1){_0x4502de=_0x68f3f1;if(_0x4502de&&_0x4502de[_0x14e4('0x21')]){switch(_0x4502de[_0x14e4('0x21')]){case _0x14e4('0x22'):var _0x24fae8=require(_0x14e4('0x22'));if(_0x4502de['accountSid']&&_0x4502de['authToken']&&_0x4502de['phone']){var _0x6dc9d8=new _0x24fae8(_0x4502de[_0x14e4('0x23')],_0x4502de[_0x14e4('0x24')]);_0x6dc9d8['messages']['create']({'body':_0x5aca38[_0x14e4('0xe')],'to':_0x14e4('0x25')+_0x5aca38['phone'],'from':_0x14e4('0x25')+_0x4502de['phone'],'statusCallback':_0x4502de[_0x14e4('0x26')]+_0x14e4('0x27')+_0x5aca38['id']+'/status?token='+_0x4502de['token']})[_0x14e4('0x1b')](function(_0x1b776b){if(_0x1b776b[_0x14e4('0x28')]){return _0x1f3d45['update']({'messageId':_0x1b776b['sid']});}})['catch'](function(_0x4ff3d9){logger[_0x14e4('0x1d')](_0x14e4('0x29'),_0x14e4('0x2a'),'twilio',util[_0x14e4('0x2b')](_0x4ff3d9,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x14e4('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x14e4('0x2c'):var _0x5de84e=_0x4502de[_0x14e4('0x23')];var _0x617154=_0x4502de[_0x14e4('0x24')];var _0x43dd33=_0x4502de[_0x14e4('0x2d')]+_0x14e4('0x2e')+_0x5de84e+'/messages/';var _0x157efb={'to':[_0x5aca38[_0x14e4('0x2f')]],'message':{'type':_0x14e4('0x30'),'text':_0x5aca38[_0x14e4('0xe')]}};var _0x3c5e78={'method':_0x14e4('0x31'),'uri':_0x43dd33,'headers':{'Authorization':'Bearer\x20'+_0x617154,'Content-Type':_0x14e4('0x32')},'body':_0x157efb,'json':!![]};rp(_0x3c5e78)[_0x14e4('0x1b')](function(_0x3beea0){if(_0x3beea0['statuses'][0x0]['message_id']){return _0x1f3d45['update']({'messageId':_0x3beea0[_0x14e4('0x33')][0x0][_0x14e4('0x34')]});}})[_0x14e4('0x35')](function(_0x7348a8){logger[_0x14e4('0x36')](_0x14e4('0x37'),_0x7348a8);});break;}}})[_0x14e4('0x38')](function(){_0x24b1c4();});}else{_0x24b1c4();}}},'charset':'utf8mb4','collate':_0x14e4('0x39')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 187131e..b579d3d 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 _0xde91=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','WhatsappMessage,\x20%s,\x20%s','error','message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','catch'];(function(_0x5c7db9,_0x18b63c){var _0x2d49f8=function(_0xa3e92f){while(--_0xa3e92f){_0x5c7db9['push'](_0x5c7db9['shift']());}};_0x2d49f8(++_0x18b63c);}(_0xde91,0x7c));var _0x1de9=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0xde91[_0xccf869];return _0x21a9db;};'use strict';var _=require('lodash');var util=require(_0x1de9('0x0'));var moment=require(_0x1de9('0x1'));var BPromise=require(_0x1de9('0x2'));var rs=require(_0x1de9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1de9('0x4'));var logger=require(_0x1de9('0x5'))(_0x1de9('0x6'));var config=require('../../config/environment');var jayson=require(_0x1de9('0x7'));var client=jayson[_0x1de9('0x8')][_0x1de9('0x9')]({'port':0x232a});config[_0x1de9('0xa')]=_[_0x1de9('0xb')](config[_0x1de9('0xa')],{'host':_0x1de9('0xc'),'port':0x18eb});var socket=require(_0x1de9('0xd'))(new Redis(config[_0x1de9('0xa')]));require(_0x1de9('0xe'))['register'](socket);function respondWithRpcPromise(_0x852eda,_0x40c950,_0x3a8fc0){return new BPromise(function(_0x586ead,_0x369ec2){return client['request'](_0x852eda,_0x3a8fc0)[_0x1de9('0xf')](function(_0x4eb59e){logger[_0x1de9('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x40c950,_0x1de9('0x11'));logger['debug'](_0x1de9('0x12'),_0x40c950,_0x1de9('0x11'),JSON[_0x1de9('0x13')](_0x4eb59e));if(_0x4eb59e['error']){if(_0x4eb59e['error'][_0x1de9('0x14')]===0x1f4){logger['error'](_0x1de9('0x15'),_0x40c950,_0x4eb59e[_0x1de9('0x16')][_0x1de9('0x17')]);return _0x369ec2(_0x4eb59e[_0x1de9('0x16')]['message']);}logger[_0x1de9('0x16')](_0x1de9('0x15'),_0x40c950,_0x4eb59e[_0x1de9('0x16')][_0x1de9('0x17')]);return _0x586ead(_0x4eb59e['error'][_0x1de9('0x17')]);}else{logger[_0x1de9('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x40c950,_0x1de9('0x11'));_0x586ead(_0x4eb59e[_0x1de9('0x18')][_0x1de9('0x17')]);}})['catch'](function(_0xda7301){logger[_0x1de9('0x16')](_0x1de9('0x15'),_0x40c950,_0xda7301);_0x369ec2(_0xda7301);});});}exports[_0x1de9('0x19')]=function(_0x9d4291){var _0x288802=this;return new Promise(function(_0x503eb9,_0x4a0137){return db[_0x1de9('0x1a')][_0x1de9('0x1b')](_0x9d4291['body'],{'raw':_0x9d4291[_0x1de9('0x1c')]?_0x9d4291[_0x1de9('0x1c')][_0x1de9('0x1d')]===undefined?!![]:![]:!![]})[_0x1de9('0xf')](function(_0x47a7fc){logger['info'](_0x1de9('0x19'),_0x9d4291);logger['debug'](_0x1de9('0x19'),_0x9d4291,JSON['stringify'](_0x47a7fc));_0x503eb9(_0x47a7fc);})[_0x1de9('0x1e')](function(_0x4626c1){logger[_0x1de9('0x16')](_0x1de9('0x19'),_0x4626c1['message'],_0x9d4291);_0x4a0137(_0x288802[_0x1de9('0x16')](0x1f4,_0x4626c1['message']));});});}; \ No newline at end of file +var _0xd10a=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','WhatsappMessage','create','body','options','CreateWhatsappMessage','stringify','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then'];(function(_0x45a097,_0x326b37){var _0x2cad46=function(_0x1e03e5){while(--_0x1e03e5){_0x45a097['push'](_0x45a097['shift']());}};_0x2cad46(++_0x326b37);}(_0xd10a,0x9a));var _0xad10=function(_0x5d1ad6,_0x193b0e){_0x5d1ad6=_0x5d1ad6-0x0;var _0x36a5bc=_0xd10a[_0x5d1ad6];return _0x36a5bc;};'use strict';var _=require('lodash');var util=require(_0xad10('0x0'));var moment=require(_0xad10('0x1'));var BPromise=require(_0xad10('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad10('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad10('0x4'));var logger=require(_0xad10('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad10('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xad10('0x7')]=_['defaults'](config[_0xad10('0x7')],{'host':_0xad10('0x8'),'port':0x18eb});var socket=require(_0xad10('0x9'))(new Redis(config['redis']));require(_0xad10('0xa'))[_0xad10('0xb')](socket);function respondWithRpcPromise(_0x45b931,_0x17ef2c,_0x1fd126){return new BPromise(function(_0xd0d2f5,_0x122e48){return client[_0xad10('0xc')](_0x45b931,_0x1fd126)[_0xad10('0xd')](function(_0x40859f){logger[_0xad10('0xe')](_0xad10('0xf'),_0x17ef2c,_0xad10('0x10'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x17ef2c,_0xad10('0x10'),JSON['stringify'](_0x40859f));if(_0x40859f[_0xad10('0x11')]){if(_0x40859f['error'][_0xad10('0x12')]===0x1f4){logger['error'](_0xad10('0xf'),_0x17ef2c,_0x40859f[_0xad10('0x11')][_0xad10('0x13')]);return _0x122e48(_0x40859f[_0xad10('0x11')][_0xad10('0x13')]);}logger['error'](_0xad10('0xf'),_0x17ef2c,_0x40859f['error'][_0xad10('0x13')]);return _0xd0d2f5(_0x40859f[_0xad10('0x11')][_0xad10('0x13')]);}else{logger[_0xad10('0xe')]('WhatsappMessage,\x20%s,\x20%s',_0x17ef2c,_0xad10('0x10'));_0xd0d2f5(_0x40859f[_0xad10('0x14')]['message']);}})[_0xad10('0x15')](function(_0x1cb6ee){logger[_0xad10('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x17ef2c,_0x1cb6ee);_0x122e48(_0x1cb6ee);});});}exports['CreateWhatsappMessage']=function(_0x4d718f){var _0x49709b=this;return new Promise(function(_0x4adb6a,_0x3c9c77){return db[_0xad10('0x16')][_0xad10('0x17')](_0x4d718f[_0xad10('0x18')],{'raw':_0x4d718f['options']?_0x4d718f[_0xad10('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xad10('0xd')](function(_0x3e14a9){logger[_0xad10('0xe')](_0xad10('0x1a'),_0x4d718f);logger['debug'](_0xad10('0x1a'),_0x4d718f,JSON[_0xad10('0x1b')](_0x3e14a9));_0x4adb6a(_0x3e14a9);})[_0xad10('0x15')](function(_0x54b95d){logger[_0xad10('0x11')]('CreateWhatsappMessage',_0x54b95d[_0xad10('0x13')],_0x4d718f);_0x3c9c77(_0x49709b['error'](0x1f4,_0x54b95d[_0xad10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 1a922fa..e4ecb4c 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 _0x6d21=['./whatsappMessage.events','remove','update','removeListener','register','length','whatsappMessage:'];(function(_0x5bcb07,_0x37e0a5){var _0x35e9c8=function(_0x4b13e3){while(--_0x4b13e3){_0x5bcb07['push'](_0x5bcb07['shift']());}};_0x35e9c8(++_0x37e0a5);}(_0x6d21,0x157));var _0x16d2=function(_0x28a668,_0x2c5a16){_0x28a668=_0x28a668-0x0;var _0xa65337=_0x6d21[_0x28a668];return _0xa65337;};'use strict';var WhatsappMessageEvents=require(_0x16d2('0x0'));var events=['save',_0x16d2('0x1'),_0x16d2('0x2')];function createListener(_0xbf137f,_0xcf375d){return function(_0x504c59){_0xcf375d['emit'](_0xbf137f,_0x504c59);};}function removeListener(_0x52fdae,_0x31f876){return function(){WhatsappMessageEvents[_0x16d2('0x3')](_0x52fdae,_0x31f876);};}exports[_0x16d2('0x4')]=function(_0x14fece){for(var _0x4e28f7=0x0,_0x3ea1fd=events[_0x16d2('0x5')];_0x4e28f7<_0x3ea1fd;_0x4e28f7++){var _0x19ddd5=events[_0x4e28f7];var _0xab931b=createListener(_0x16d2('0x6')+_0x19ddd5,_0x14fece);WhatsappMessageEvents['on'](_0x19ddd5,_0xab931b);}}; \ No newline at end of file +var _0xc8cd=['./whatsappMessage.events','removeListener','register','length'];(function(_0xebb690,_0x386fdd){var _0x5a3385=function(_0x3a97b7){while(--_0x3a97b7){_0xebb690['push'](_0xebb690['shift']());}};_0x5a3385(++_0x386fdd);}(_0xc8cd,0xe8));var _0xdc8c=function(_0x39dd2b,_0x56a975){_0x39dd2b=_0x39dd2b-0x0;var _0x5b82bd=_0xc8cd[_0x39dd2b];return _0x5b82bd;};'use strict';var WhatsappMessageEvents=require(_0xdc8c('0x0'));var events=['save','remove','update'];function createListener(_0x505519,_0x2a45a7){return function(_0x3aeb3c){_0x2a45a7['emit'](_0x505519,_0x3aeb3c);};}function removeListener(_0x254b4a,_0x4c4694){return function(){WhatsappMessageEvents[_0xdc8c('0x1')](_0x254b4a,_0x4c4694);};}exports[_0xdc8c('0x2')]=function(_0x1b32f1){for(var _0x2c6266=0x0,_0x1c1f75=events[_0xdc8c('0x3')];_0x2c6266<_0x1c1f75;_0x2c6266++){var _0x5c90c1=events[_0x2c6266];var _0x129ab9=createListener('whatsappMessage:'+_0x5c90c1,_0x1b32f1);WhatsappMessageEvents['on'](_0x5c90c1,_0x129ab9);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index f6dbbf4..9006749 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 _0x63bd=['get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','destroy','delete','removeTeams','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','isAuthenticated','/describe','describe'];(function(_0x33f6a9,_0x5e195c){var _0x36df01=function(_0x2225d9){while(--_0x2225d9){_0x33f6a9['push'](_0x33f6a9['shift']());}};_0x36df01(++_0x5e195c);}(_0x63bd,0x163));var _0xd63b=function(_0x14b72d,_0x5e7687){_0x14b72d=_0x14b72d-0x0;var _0x23809d=_0x63bd[_0x14b72d];return _0x23809d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd63b('0x0'));var express=require(_0xd63b('0x1'));var router=express[_0xd63b('0x2')]();var fs_extra=require(_0xd63b('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd63b('0x4'));var controller=require(_0xd63b('0x5'));router['get']('/',auth[_0xd63b('0x6')](),controller['index']);router['get'](_0xd63b('0x7'),auth[_0xd63b('0x6')](),controller[_0xd63b('0x8')]);router[_0xd63b('0x9')](_0xd63b('0xa'),auth['isAuthenticated'](),controller[_0xd63b('0xb')]);router[_0xd63b('0x9')](_0xd63b('0xc'),auth[_0xd63b('0x6')](),controller[_0xd63b('0xd')]);router[_0xd63b('0x9')](_0xd63b('0xe'),auth[_0xd63b('0x6')](),controller[_0xd63b('0xf')]);router['get'](_0xd63b('0x10'),auth[_0xd63b('0x6')](),controller[_0xd63b('0x11')]);router[_0xd63b('0x12')]('/',auth[_0xd63b('0x6')](),controller['create']);router[_0xd63b('0x12')](_0xd63b('0xe'),auth['isAuthenticated'](),controller[_0xd63b('0x13')]);router[_0xd63b('0x12')](_0xd63b('0x10'),auth[_0xd63b('0x6')](),controller[_0xd63b('0x14')]);router['put'](_0xd63b('0xa'),auth[_0xd63b('0x6')](),controller['update']);router['delete'](_0xd63b('0xa'),auth[_0xd63b('0x6')](),controller[_0xd63b('0x15')]);router[_0xd63b('0x16')](_0xd63b('0xe'),auth[_0xd63b('0x6')](),controller[_0xd63b('0x17')]);router[_0xd63b('0x16')](_0xd63b('0x10'),auth[_0xd63b('0x6')](),controller[_0xd63b('0x18')]);module[_0xd63b('0x19')]=router; \ No newline at end of file +var _0x5ee0=['multer','connect-timeout','express','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x3f48e0,_0x453a44){var _0x2333e1=function(_0x4b540a){while(--_0x4b540a){_0x3f48e0['push'](_0x3f48e0['shift']());}};_0x2333e1(++_0x453a44);}(_0x5ee0,0x129));var _0x05ee=function(_0x4293c7,_0xd224fa){_0x4293c7=_0x4293c7-0x0;var _0x371b9a=_0x5ee0[_0x4293c7];return _0x371b9a;};'use strict';var multer=require(_0x05ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x05ee('0x1'));var express=require(_0x05ee('0x2'));var router=express['Router']();var fs_extra=require(_0x05ee('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x05ee('0x4'));var controller=require(_0x05ee('0x5'));router[_0x05ee('0x6')]('/',auth[_0x05ee('0x7')](),controller[_0x05ee('0x8')]);router[_0x05ee('0x6')](_0x05ee('0x9'),auth[_0x05ee('0x7')](),controller[_0x05ee('0xa')]);router[_0x05ee('0x6')](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller[_0x05ee('0xc')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x05ee('0xd')]);router['get']('/:id/teams',auth[_0x05ee('0x7')](),controller[_0x05ee('0xe')]);router[_0x05ee('0x6')](_0x05ee('0xf'),auth[_0x05ee('0x7')](),controller['getAgents']);router[_0x05ee('0x10')]('/',auth[_0x05ee('0x7')](),controller['create']);router[_0x05ee('0x10')](_0x05ee('0x11'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x12')]);router[_0x05ee('0x10')](_0x05ee('0xf'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x13')]);router[_0x05ee('0x14')](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x15')]);router[_0x05ee('0x16')](_0x05ee('0xb'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x17')]);router[_0x05ee('0x16')]('/:id/teams',auth[_0x05ee('0x7')](),controller[_0x05ee('0x18')]);router['delete'](_0x05ee('0xf'),auth[_0x05ee('0x7')](),controller[_0x05ee('0x19')]);module[_0x05ee('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 aab09be..d6ff62f 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 _0x4899=['beepall','roundrobin','sequelize','STRING','INTEGER','rrmemory'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x4899,0x74));var _0x9489=function(_0x430a0c,_0x4a97e0){_0x430a0c=_0x430a0c-0x0;var _0x885281=_0x4899[_0x430a0c];return _0x885281;};'use strict';var Sequelize=require(_0x9489('0x0'));module['exports']={'name':{'type':Sequelize[_0x9489('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9489('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9489('0x3'),_0x9489('0x4'),_0x9489('0x5'))},'description':{'type':Sequelize[_0x9489('0x1')]}}; \ No newline at end of file +var _0x136c=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING','sequelize','exports'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x136c,0x1d2));var _0xc136=function(_0x3f6ba0,_0x34330f){_0x3f6ba0=_0x3f6ba0-0x0;var _0x107411=_0x136c[_0x3f6ba0];return _0x107411;};'use strict';var Sequelize=require(_0xc136('0x0'));module[_0xc136('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc136('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xc136('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc136('0x4')](_0xc136('0x5'),_0xc136('0x6'),_0xc136('0x7'))},'description':{'type':Sequelize[_0xc136('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index cdfef77..aa406dd 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 _0x0cc7=['spread','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','WhatsappQueues','UserProfileResource','end','sendStatus','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','get','UserWhatsappQueue','pick','WhatsappQueueId','User','findAndCountAll','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','whatsappPause','getTeams','addTeams','Team','Agents','online','voicePause','flatMap','transaction','forEach','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','userWhatsappQueue:remove','addAgents'];(function(_0x4932a6,_0x530e29){var _0x3b45b9=function(_0x1d1eb7){while(--_0x1d1eb7){_0x4932a6['push'](_0x4932a6['shift']());}};_0x3b45b9(++_0x530e29);}(_0x0cc7,0x12d));var _0x70cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0cc7[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x70cc('0x0'));var rimraf=require(_0x70cc('0x1'));var zipdir=require(_0x70cc('0x2'));var jsonpatch=require(_0x70cc('0x3'));var rp=require('request-promise');var moment=require(_0x70cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x70cc('0x5'));var util=require('util');var path=require(_0x70cc('0x6'));var sox=require(_0x70cc('0x7'));var csv=require('to-csv');var ejs=require(_0x70cc('0x8'));var fs=require('fs');var fs_extra=require(_0x70cc('0x9'));var _=require(_0x70cc('0xa'));var squel=require(_0x70cc('0xb'));var crypto=require(_0x70cc('0xc'));var jsforce=require(_0x70cc('0xd'));var deskjs=require(_0x70cc('0xe'));var toCsv=require(_0x70cc('0xf'));var querystring=require(_0x70cc('0x10'));var Papa=require(_0x70cc('0x11'));var Redis=require(_0x70cc('0x12'));var authService=require(_0x70cc('0x13'));var qs=require(_0x70cc('0x14'));var as=require(_0x70cc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70cc('0x16'))('api');var utils=require(_0x70cc('0x17'));var config=require(_0x70cc('0x18'));var licenseUtil=require(_0x70cc('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x70cc('0x1a')](config[_0x70cc('0x1b')],{'host':_0x70cc('0x1c'),'port':0x18eb});var socket=require(_0x70cc('0x1d'))(new Redis(config[_0x70cc('0x1b')]));require(_0x70cc('0x1e'))[_0x70cc('0x1f')](socket);function respondWithStatusCode(_0x4e4e1c,_0x204b5b){_0x204b5b=_0x204b5b||0xcc;return function(_0x55afba){if(_0x55afba){return _0x4e4e1c['sendStatus'](_0x204b5b);}return _0x4e4e1c[_0x70cc('0x20')](_0x204b5b)['end']();};}function respondWithResult(_0x55c250,_0x4d7cdd){_0x4d7cdd=_0x4d7cdd||0xc8;return function(_0x34eea1){if(_0x34eea1){return _0x55c250[_0x70cc('0x20')](_0x4d7cdd)[_0x70cc('0x21')](_0x34eea1);}};}function respondWithFilteredResult(_0x1acf31,_0x43ce5a){return function(_0x11fcee){if(_0x11fcee){var _0x25bc2d=typeof _0x43ce5a[_0x70cc('0x22')]===_0x70cc('0x23')&&typeof _0x43ce5a['limit']===_0x70cc('0x23');var _0x58a51e=_0x11fcee[_0x70cc('0x24')];var _0xe21716=_0x25bc2d?0x0:_0x43ce5a['offset'];var _0x2e6128=_0x25bc2d?_0x11fcee[_0x70cc('0x24')]:_0x43ce5a[_0x70cc('0x22')]+_0x43ce5a[_0x70cc('0x25')];var _0x311319;if(_0x2e6128>=_0x58a51e){_0x2e6128=_0x58a51e;_0x311319=0xc8;}else{_0x311319=0xce;}_0x1acf31[_0x70cc('0x20')](_0x311319);return _0x1acf31[_0x70cc('0x26')](_0x70cc('0x27'),_0xe21716+'-'+_0x2e6128+'/'+_0x58a51e)[_0x70cc('0x21')](_0x11fcee);}return null;};}function patchUpdates(_0x488bc6){return function(_0x4cc709){try{jsonpatch['apply'](_0x4cc709,_0x488bc6,!![]);}catch(_0x78ccce){return BPromise[_0x70cc('0x28')](_0x78ccce);}return _0x4cc709[_0x70cc('0x29')]();};}function saveUpdates(_0x5c0a0b,_0x310c3d){return function(_0x16aaa9){if(_0x16aaa9){return _0x16aaa9[_0x70cc('0x2a')](_0x5c0a0b)[_0x70cc('0x2b')](function(_0x4567b5){return _0x4567b5;});}return null;};}function removeEntity(_0x37f462,_0xa1b866){return function(_0xb67f21){if(_0xb67f21){return _0xb67f21[_0x70cc('0x2c')]()[_0x70cc('0x2b')](function(){var _0x5f232c=_0xb67f21['get']({'plain':!![]});var _0x21aead=_0x70cc('0x2d');return db[_0x70cc('0x2e')][_0x70cc('0x2c')]({'where':{'type':_0x21aead,'resourceId':_0x5f232c['id']}})[_0x70cc('0x2b')](function(){return _0xb67f21;});})['then'](function(){_0x37f462[_0x70cc('0x20')](0xcc)[_0x70cc('0x2f')]();});}};}function handleEntityNotFound(_0x213cbd,_0x142941){return function(_0x5d7a2b){if(!_0x5d7a2b){_0x213cbd[_0x70cc('0x30')](0x194);}return _0x5d7a2b;};}function handleError(_0x5476f3,_0x270b60){_0x270b60=_0x270b60||0x1f4;return function(_0x47b53b){logger[_0x70cc('0x31')](_0x47b53b[_0x70cc('0x32')]);if(_0x47b53b[_0x70cc('0x33')]){delete _0x47b53b[_0x70cc('0x33')];}_0x5476f3[_0x70cc('0x20')](_0x270b60)['send'](_0x47b53b);};}exports[_0x70cc('0x34')]=function(_0x4e2aa0,_0x45256d){var _0x29f0a8={},_0x3b16b0={},_0x34b3f9={'count':0x0,'rows':[]};var _0x2336c8=_[_0x70cc('0x35')](db[_0x70cc('0x36')][_0x70cc('0x37')],function(_0x59121b){return{'name':_0x59121b[_0x70cc('0x38')],'type':_0x59121b[_0x70cc('0x39')][_0x70cc('0x3a')]};});_0x3b16b0[_0x70cc('0x3b')]=_[_0x70cc('0x35')](_0x2336c8,'name');_0x3b16b0['query']=_[_0x70cc('0x3c')](_0x4e2aa0[_0x70cc('0x3d')]);_0x3b16b0[_0x70cc('0x3e')]=_['intersection'](_0x3b16b0[_0x70cc('0x3b')],_0x3b16b0[_0x70cc('0x3d')]);_0x29f0a8[_0x70cc('0x3f')]=_[_0x70cc('0x40')](_0x3b16b0['model'],qs[_0x70cc('0x41')](_0x4e2aa0['query'][_0x70cc('0x41')]));_0x29f0a8[_0x70cc('0x3f')]=_0x29f0a8['attributes'][_0x70cc('0x42')]?_0x29f0a8[_0x70cc('0x3f')]:_0x3b16b0[_0x70cc('0x3b')];if(!_0x4e2aa0['query'][_0x70cc('0x43')](_0x70cc('0x44'))){_0x29f0a8[_0x70cc('0x25')]=qs['limit'](_0x4e2aa0[_0x70cc('0x3d')]['limit']);_0x29f0a8['offset']=qs['offset'](_0x4e2aa0[_0x70cc('0x3d')]['offset']);}_0x29f0a8[_0x70cc('0x45')]=qs[_0x70cc('0x46')](_0x4e2aa0[_0x70cc('0x3d')][_0x70cc('0x46')]);_0x29f0a8['where']=qs['filters'](_['pick'](_0x4e2aa0[_0x70cc('0x3d')],_0x3b16b0['filters']),_0x2336c8);if(_0x4e2aa0['query']['filter']){_0x29f0a8[_0x70cc('0x47')]=_[_0x70cc('0x48')](_0x29f0a8[_0x70cc('0x47')],{'$or':_[_0x70cc('0x35')](_0x2336c8,function(_0x1fa222){if(_0x1fa222[_0x70cc('0x39')]!=='VIRTUAL'){var _0x30b3ea={};_0x30b3ea[_0x1fa222[_0x70cc('0x33')]]={'$like':'%'+_0x4e2aa0[_0x70cc('0x3d')][_0x70cc('0x49')]+'%'};return _0x30b3ea;}})});}_0x29f0a8=_['merge']({},_0x29f0a8,_0x4e2aa0[_0x70cc('0x4a')]);var _0x328dcd={'where':_0x29f0a8[_0x70cc('0x47')]};return db['WhatsappQueue'][_0x70cc('0x24')](_0x328dcd)[_0x70cc('0x2b')](function(_0x1ebebe){_0x34b3f9['count']=_0x1ebebe;if(_0x4e2aa0[_0x70cc('0x3d')][_0x70cc('0x4b')]){_0x29f0a8[_0x70cc('0x4c')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x70cc('0x4d')](_0x29f0a8);})[_0x70cc('0x2b')](function(_0x1b7539){_0x34b3f9['rows']=_0x1b7539;return _0x34b3f9;})['then'](respondWithFilteredResult(_0x45256d,_0x29f0a8))[_0x70cc('0x4e')](handleError(_0x45256d,null));};exports[_0x70cc('0x4f')]=function(_0xbc92ba,_0x56b6d6){var _0x216dcc={'raw':!![],'where':{'id':_0xbc92ba[_0x70cc('0x50')]['id']}},_0x39f8df={};_0x39f8df[_0x70cc('0x3b')]=_[_0x70cc('0x3c')](db[_0x70cc('0x36')][_0x70cc('0x37')]);_0x39f8df[_0x70cc('0x3d')]=_[_0x70cc('0x3c')](_0xbc92ba[_0x70cc('0x3d')]);_0x39f8df[_0x70cc('0x3e')]=_['intersection'](_0x39f8df[_0x70cc('0x3b')],_0x39f8df['query']);_0x216dcc[_0x70cc('0x3f')]=_[_0x70cc('0x40')](_0x39f8df[_0x70cc('0x3b')],qs[_0x70cc('0x41')](_0xbc92ba[_0x70cc('0x3d')][_0x70cc('0x41')]));_0x216dcc['attributes']=_0x216dcc[_0x70cc('0x3f')]['length']?_0x216dcc['attributes']:_0x39f8df[_0x70cc('0x3b')];if(_0xbc92ba['query'][_0x70cc('0x4b')]){_0x216dcc[_0x70cc('0x4c')]=[{'all':!![]}];}_0x216dcc=_['merge']({},_0x216dcc,_0xbc92ba[_0x70cc('0x4a')]);return db[_0x70cc('0x36')][_0x70cc('0x51')](_0x216dcc)[_0x70cc('0x2b')](handleEntityNotFound(_0x56b6d6,null))['then'](respondWithResult(_0x56b6d6,null))['catch'](handleError(_0x56b6d6,null));};exports[_0x70cc('0x52')]=function(_0x219573,_0x2d3ff7){return db[_0x70cc('0x36')][_0x70cc('0x52')](_0x219573[_0x70cc('0x53')],{})['then'](function(_0x43164c){var _0xbc6709=_0x219573['user']['get']({'plain':!![]});if(!_0xbc6709)throw new Error(_0x70cc('0x54'));if(_0xbc6709[_0x70cc('0x55')]===_0x70cc('0x56')){var _0x978fdd=_0x43164c['get']({'plain':!![]});var _0x31c712='WhatsappQueues';return db[_0x70cc('0x57')]['find']({'where':{'name':_0x31c712,'userProfileId':_0xbc6709[_0x70cc('0x58')]},'raw':!![]})['then'](function(_0x2907c2){if(_0x2907c2&&_0x2907c2[_0x70cc('0x59')]===0x0){return db[_0x70cc('0x2e')][_0x70cc('0x52')]({'name':_0x978fdd[_0x70cc('0x33')],'resourceId':_0x978fdd['id'],'type':_0x2907c2[_0x70cc('0x33')],'sectionId':_0x2907c2['id']},{})[_0x70cc('0x2b')](function(){return _0x43164c;});}else{return _0x43164c;}})['catch'](function(_0x3bff88){logger[_0x70cc('0x31')](_0x70cc('0x5a'),_0x3bff88);throw _0x3bff88;});}return _0x43164c;})[_0x70cc('0x2b')](respondWithResult(_0x2d3ff7,0xc9))['catch'](handleError(_0x2d3ff7,null));};exports[_0x70cc('0x2a')]=function(_0x4ad779,_0x4ac342){if(_0x4ad779['body']['id']){delete _0x4ad779[_0x70cc('0x53')]['id'];}return db[_0x70cc('0x36')][_0x70cc('0x51')]({'where':{'id':_0x4ad779[_0x70cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x4ac342,null))[_0x70cc('0x2b')](saveUpdates(_0x4ad779[_0x70cc('0x53')],null))[_0x70cc('0x2b')](respondWithResult(_0x4ac342,null))[_0x70cc('0x4e')](handleError(_0x4ac342,null));};exports[_0x70cc('0x2c')]=function(_0x1d4bc8,_0x5146c1){return db['WhatsappQueue']['find']({'where':{'id':_0x1d4bc8[_0x70cc('0x50')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x5146c1,null))[_0x70cc('0x2b')](removeEntity(_0x5146c1,null))[_0x70cc('0x4e')](handleError(_0x5146c1,null));};exports[_0x70cc('0x5b')]=function(_0x50630c,_0x483f16){return db[_0x70cc('0x36')]['describe']()[_0x70cc('0x2b')](respondWithResult(_0x483f16,null))['catch'](handleError(_0x483f16,null));};exports[_0x70cc('0x5c')]=function(_0x30bce5,_0x1a52ca,_0x1a499f){var _0x23f9d4={'raw':!![],'where':{}},_0x3d3b1c={},_0x32ecfa;return db[_0x70cc('0x36')][_0x70cc('0x5d')]({'where':{'id':_0x30bce5['params']['id']}})['then'](handleEntityNotFound(_0x1a52ca,null))[_0x70cc('0x2b')](function(_0x15edb7){if(_0x15edb7){_0x32ecfa=_0x15edb7[_0x70cc('0x5e')]({'plain':!![]});_0x3d3b1c[_0x70cc('0x3b')]=_[_0x70cc('0x3c')](db[_0x70cc('0x5f')][_0x70cc('0x37')]);_0x3d3b1c[_0x70cc('0x3d')]=_[_0x70cc('0x3c')](_0x30bce5['query']);_0x3d3b1c['filters']=_[_0x70cc('0x40')](_0x3d3b1c[_0x70cc('0x3b')],_0x3d3b1c[_0x70cc('0x3d')]);_0x23f9d4['attributes']=_['intersection'](_0x3d3b1c[_0x70cc('0x3b')],qs[_0x70cc('0x41')](_0x30bce5['query'][_0x70cc('0x41')]));_0x23f9d4[_0x70cc('0x3f')]=_0x23f9d4[_0x70cc('0x3f')][_0x70cc('0x42')]?_0x23f9d4[_0x70cc('0x3f')]:_0x3d3b1c[_0x70cc('0x3b')];if(!_0x30bce5[_0x70cc('0x3d')][_0x70cc('0x43')]('nolimit')){_0x23f9d4['limit']=qs['limit'](_0x30bce5['query'][_0x70cc('0x25')]);_0x23f9d4[_0x70cc('0x22')]=qs[_0x70cc('0x22')](_0x30bce5['query'][_0x70cc('0x22')]);}_0x23f9d4[_0x70cc('0x45')]=qs[_0x70cc('0x46')](_0x30bce5[_0x70cc('0x3d')][_0x70cc('0x46')]);_0x23f9d4[_0x70cc('0x47')]=qs[_0x70cc('0x3e')](_[_0x70cc('0x60')](_0x30bce5[_0x70cc('0x3d')],_0x3d3b1c[_0x70cc('0x3e')]));_0x23f9d4[_0x70cc('0x47')][_0x70cc('0x61')]=_0x15edb7['id'];if(_0x30bce5[_0x70cc('0x3d')][_0x70cc('0x49')]){_0x23f9d4[_0x70cc('0x47')]=_[_0x70cc('0x48')](_0x23f9d4[_0x70cc('0x47')],{'$or':_[_0x70cc('0x35')](_0x23f9d4[_0x70cc('0x3f')],function(_0x3437f6){var _0x9f2df7={};_0x9f2df7[_0x3437f6]={'$like':'%'+_0x30bce5['query']['filter']+'%'};return _0x9f2df7;})});}_0x23f9d4=_['merge']({},_0x23f9d4,_0x30bce5['options']);return db[_0x70cc('0x5f')][_0x70cc('0x4d')](_0x23f9d4);}})[_0x70cc('0x2b')](function(_0xbacb98){if(_0xbacb98){return db[_0x70cc('0x62')][_0x70cc('0x63')]({'where':{'id':_['map'](_0xbacb98,'UserId'),'role':_0x70cc('0x64')},'attributes':['id',_0x70cc('0x33'),'whatsappPause',_0x70cc('0x65'),_0x70cc('0x66')]});}})['then'](function(_0x27fd1e){if(_0x27fd1e){return{'count':_0x27fd1e[_0x70cc('0x24')],'rows':_[_0x70cc('0x35')](_0x27fd1e[_0x70cc('0x67')],function(_0x14fbab){return{'membername':_0x14fbab['name'],'UserId':_0x14fbab['id'],'queue_name':_0x32ecfa[_0x70cc('0x33')],'WhatsappQueueId':_0x32ecfa['id'],'interface':util[_0x70cc('0x68')](_0x70cc('0x69'),_0x70cc('0x6a'),_0x14fbab[_0x70cc('0x33')]),'penalty':0x0,'paused':_0x14fbab[_0x70cc('0x6b')],'createdAt':_0x14fbab[_0x70cc('0x66')],'updatedAt':_0x14fbab[_0x70cc('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x70cc('0x2b')](respondWithFilteredResult(_0x1a52ca,_0x23f9d4))[_0x70cc('0x4e')](handleError(_0x1a52ca,null));};exports[_0x70cc('0x6c')]=function(_0x5a33b2,_0x4d1d9c,_0x356ef2){var _0x343ed3={};var _0x56fe8a={};var _0x50b7f8;var _0x3abca1;return db[_0x70cc('0x36')][_0x70cc('0x5d')]({'where':{'id':_0x5a33b2[_0x70cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d1d9c,null))['then'](function(_0x2c622e){if(_0x2c622e){_0x50b7f8=_0x2c622e;_0x56fe8a[_0x70cc('0x3b')]=_[_0x70cc('0x3c')](db['Team'][_0x70cc('0x37')]);_0x56fe8a['query']=_['keys'](_0x5a33b2['query']);_0x56fe8a[_0x70cc('0x3e')]=_[_0x70cc('0x40')](_0x56fe8a[_0x70cc('0x3b')],_0x56fe8a['query']);_0x343ed3[_0x70cc('0x3f')]=_['intersection'](_0x56fe8a[_0x70cc('0x3b')],qs[_0x70cc('0x41')](_0x5a33b2[_0x70cc('0x3d')]['fields']));_0x343ed3[_0x70cc('0x3f')]=_0x343ed3[_0x70cc('0x3f')][_0x70cc('0x42')]?_0x343ed3[_0x70cc('0x3f')]:_0x56fe8a[_0x70cc('0x3b')];_0x343ed3[_0x70cc('0x45')]=qs['sort'](_0x5a33b2[_0x70cc('0x3d')][_0x70cc('0x46')]);_0x343ed3[_0x70cc('0x47')]=qs['filters'](_[_0x70cc('0x60')](_0x5a33b2[_0x70cc('0x3d')],_0x56fe8a['filters']));if(_0x5a33b2[_0x70cc('0x3d')]['filter']){_0x343ed3['where']=_[_0x70cc('0x48')](_0x343ed3[_0x70cc('0x47')],{'$or':_['map'](_0x343ed3[_0x70cc('0x3f')],function(_0x27a7f6){var _0x1f56c0={};_0x1f56c0[_0x27a7f6]={'$like':'%'+_0x5a33b2[_0x70cc('0x3d')][_0x70cc('0x49')]+'%'};return _0x1f56c0;})});}_0x343ed3=_[_0x70cc('0x48')]({},_0x343ed3,_0x5a33b2[_0x70cc('0x4a')]);return _0x50b7f8[_0x70cc('0x6c')](_0x343ed3);}})[_0x70cc('0x2b')](function(_0x3cf879){if(_0x3cf879){_0x3abca1=_0x3cf879[_0x70cc('0x42')];if(!_0x5a33b2[_0x70cc('0x3d')][_0x70cc('0x43')](_0x70cc('0x44'))){_0x343ed3[_0x70cc('0x25')]=qs[_0x70cc('0x25')](_0x5a33b2[_0x70cc('0x3d')][_0x70cc('0x25')]);_0x343ed3[_0x70cc('0x22')]=qs['offset'](_0x5a33b2[_0x70cc('0x3d')]['offset']);}return _0x50b7f8[_0x70cc('0x6c')](_0x343ed3);}})[_0x70cc('0x2b')](function(_0x5c4051){if(_0x5c4051){return _0x5c4051?{'count':_0x3abca1,'rows':_0x5c4051}:null;}})[_0x70cc('0x2b')](respondWithResult(_0x4d1d9c,null))[_0x70cc('0x4e')](handleError(_0x4d1d9c,null));};exports[_0x70cc('0x6d')]=function(_0x88897,_0x2d2f58,_0x45f247){var _0x54b18f=_0x88897[_0x70cc('0x53')]['ids'];return db[_0x70cc('0x6e')]['findAll']({'where':{'id':_0x54b18f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x70cc('0x6f'),'attributes':['id',_0x70cc('0x33'),_0x70cc('0x70'),_0x70cc('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x276682){if(_0x276682){var _0x1de5e2=_[_0x70cc('0x72')](_0x276682,function(_0xdcef69){var _0x375788=_0xdcef69[_0x70cc('0x5e')]({'plain':!![]});return _0x375788[_0x70cc('0x6f')];});return db[_0x70cc('0x36')][_0x70cc('0x51')]({'where':{'id':_0x88897['params']['id']}})[_0x70cc('0x2b')](function(_0x365e17){return db['sequelize'][_0x70cc('0x73')](function(_0x3837bc){return _0x365e17[_0x70cc('0x6d')](_0x54b18f,{'transaction':_0x3837bc})[_0x70cc('0x2b')](function(){return BPromise['each'](_0x1de5e2,function(_0x3854db){return db[_0x70cc('0x5f')]['findOrCreate']({'where':{'UserId':_0x3854db['id'],'WhatsappQueueId':_0x88897['params']['id']},'transaction':_0x3837bc});});})[_0x70cc('0x2b')](function(){_0x1de5e2[_0x70cc('0x74')](function(_0x19bcfa){socket['emit'](_0x70cc('0x75'),{'UserId':_0x19bcfa['id'],'WhatsappQueueId':_0x365e17['id']});});});});});}})[_0x70cc('0x2b')](respondWithStatusCode(_0x2d2f58,null))[_0x70cc('0x4e')](handleError(_0x2d2f58,null));};exports[_0x70cc('0x76')]=function(_0x162bbe,_0x58f50f,_0xccfc20){return db[_0x70cc('0x6e')]['findAll']({'where':{'id':_0x162bbe['query'][_0x70cc('0x77')]},'attributes':['id'],'include':[{'model':db[_0x70cc('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x70cc('0x2b')](handleEntityNotFound(_0x58f50f,null))[_0x70cc('0x2b')](function(_0x1a5ad4){var _0x2a5986=_['map'](_0x1a5ad4,'id');var _0x3c4d88=[];var _0x5969ae=[];var _0x17e626=squel[_0x70cc('0x78')]();_0x17e626[_0x70cc('0x79')](_0x70cc('0x7a'))[_0x70cc('0x7b')](_0x70cc('0x7c'),'tq')['join'](_0x70cc('0x7d'),'ut',_0x70cc('0x7e'))[_0x70cc('0x47')](_0x70cc('0x7f'),_0x162bbe[_0x70cc('0x50')]['id']);for(var _0x3fc226=0x0;_0x3fc226<_0x1a5ad4[_0x70cc('0x42')];_0x3fc226+=0x1){let _0x56ad6f=_0x1a5ad4[_0x3fc226];for(var _0x8c61d=0x0;_0x8c61d<_0x56ad6f[_0x70cc('0x6f')][_0x70cc('0x42')];_0x8c61d+=0x1){let _0x534df5=_0x56ad6f[_0x70cc('0x6f')][_0x8c61d];var _0x2b937b=_0x17e626[_0x70cc('0x80')]();_0x2b937b['where'](_0x70cc('0x81'),_0x534df5['id']);_0x5969ae[_0x70cc('0x82')](db[_0x70cc('0x83')][_0x70cc('0x3d')](_0x2b937b[_0x70cc('0x84')](),{'type':db['sequelize'][_0x70cc('0x85')][_0x70cc('0x86')]})[_0x70cc('0x2b')](function(_0x57d8f6){if(_0x57d8f6[_0x70cc('0x42')]===0x1){return _0x534df5['id'];}else{var _0x2ff116=_[_0x70cc('0x87')](_[_0x70cc('0x35')](_0x57d8f6,_0x70cc('0x88')),function(_0x3082bd){return _[_0x70cc('0x89')](_0x2a5986,_0x3082bd);});if(_0x2ff116){return _0x534df5['id'];}}}));}}return BPromise[_0x70cc('0x8a')](_0x5969ae)[_0x70cc('0x2b')](function(_0x2eeef9){_0x3c4d88=_(_0x3c4d88)['union'](_0x2eeef9)[_0x70cc('0x8b')]()['value']();return db[_0x70cc('0x36')][_0x70cc('0x51')]({'where':{'id':_0x162bbe[_0x70cc('0x50')]['id']}})[_0x70cc('0x2b')](function(_0x3f5586){return db[_0x70cc('0x83')]['transaction'](function(_0x4d217a){return _0x3f5586[_0x70cc('0x76')](_0x162bbe[_0x70cc('0x3d')]['ids'],{'transaction':_0x4d217a})[_0x70cc('0x2b')](function(){if(!_[_0x70cc('0x8c')](_0x3c4d88)){return _0x3f5586['removeAgents'](_0x3c4d88,{'transaction':_0x4d217a});}})[_0x70cc('0x2b')](function(){_0x3c4d88['forEach'](function(_0x2e86ef){socket['emit'](_0x70cc('0x8d'),{'UserId':_0x2e86ef,'WhatsappQueueId':_0x3f5586['id']});});});});});});})[_0x70cc('0x2b')](respondWithStatusCode(_0x58f50f,null))[_0x70cc('0x4e')](handleError(_0x58f50f,null));};exports[_0x70cc('0x8e')]=function(_0x435d01,_0x301e6f,_0x4e1801){return db[_0x70cc('0x36')][_0x70cc('0x51')]({'where':{'id':_0x435d01[_0x70cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x301e6f,null))[_0x70cc('0x2b')](function(_0xdf3ed5){if(_0xdf3ed5){return _0xdf3ed5['addAgents'](_0x435d01['body'][_0x70cc('0x77')],_['omit'](_0x435d01[_0x70cc('0x53')],[_0x70cc('0x77'),'id'])||{})[_0x70cc('0x8f')](function(_0x4d9773){for(var _0x2aeba7=0x0;_0x2aeba7<_0x435d01[_0x70cc('0x53')][_0x70cc('0x77')][_0x70cc('0x42')];_0x2aeba7+=0x1){socket[_0x70cc('0x90')](_0x70cc('0x75'),{'UserId':Number(_0x435d01[_0x70cc('0x53')][_0x70cc('0x77')][_0x2aeba7]),'WhatsappQueueId':Number(_0x435d01[_0x70cc('0x50')]['id'])});}return _0x4d9773;});}})['then'](respondWithResult(_0x301e6f,null))['catch'](handleError(_0x301e6f,null));};exports[_0x70cc('0x91')]=function(_0x3e353d,_0x4f17bb,_0x53f466){return db[_0x70cc('0x36')][_0x70cc('0x51')]({'where':{'id':_0x3e353d[_0x70cc('0x50')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x4f17bb,null))[_0x70cc('0x2b')](function(_0x312263){if(_0x312263){return _0x312263[_0x70cc('0x91')](_0x3e353d[_0x70cc('0x3d')][_0x70cc('0x77')])[_0x70cc('0x2b')](function(){if(_[_0x70cc('0x92')](_0x3e353d['query']['ids'])){for(var _0x5d5946=0x0;_0x5d5946<_0x3e353d['query']['ids'][_0x70cc('0x42')];_0x5d5946+=0x1){socket[_0x70cc('0x90')](_0x70cc('0x8d'),{'UserId':Number(_0x3e353d[_0x70cc('0x3d')][_0x70cc('0x77')][_0x5d5946]),'WhatsappQueueId':Number(_0x3e353d[_0x70cc('0x50')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x3e353d[_0x70cc('0x3d')][_0x70cc('0x77')]),'WhatsappQueueId':Number(_0x3e353d['params']['id'])});}});}})[_0x70cc('0x2b')](respondWithStatusCode(_0x4f17bb,null))[_0x70cc('0x4e')](handleError(_0x4f17bb,null));};exports['getAgents']=function(_0x3c53f5,_0x35252e,_0x3d19c8){var _0x276f60={};var _0x58ed8b={};var _0x246594;var _0x549af7;return db[_0x70cc('0x36')][_0x70cc('0x5d')]({'where':{'id':_0x3c53f5[_0x70cc('0x50')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x35252e,null))['then'](function(_0x2de3ee){if(_0x2de3ee){_0x246594=_0x2de3ee;_0x58ed8b[_0x70cc('0x3b')]=_[_0x70cc('0x3c')](db[_0x70cc('0x62')]['rawAttributes']);_0x58ed8b[_0x70cc('0x3d')]=_[_0x70cc('0x3c')](_0x3c53f5[_0x70cc('0x3d')]);_0x58ed8b[_0x70cc('0x3e')]=_['intersection'](_0x58ed8b[_0x70cc('0x3b')],_0x58ed8b['query']);_0x276f60['attributes']=_[_0x70cc('0x40')](_0x58ed8b[_0x70cc('0x3b')],qs[_0x70cc('0x41')](_0x3c53f5[_0x70cc('0x3d')][_0x70cc('0x41')]));_0x276f60[_0x70cc('0x3f')]=_0x276f60[_0x70cc('0x3f')][_0x70cc('0x42')]?_0x276f60[_0x70cc('0x3f')]:_0x58ed8b['model'];_0x276f60[_0x70cc('0x45')]=qs[_0x70cc('0x46')](_0x3c53f5[_0x70cc('0x3d')][_0x70cc('0x46')]);_0x276f60['where']=qs[_0x70cc('0x3e')](_[_0x70cc('0x60')](_0x3c53f5[_0x70cc('0x3d')],_0x58ed8b['filters']));if(_0x3c53f5[_0x70cc('0x3d')]['filter']){_0x276f60[_0x70cc('0x47')]=_[_0x70cc('0x48')](_0x276f60[_0x70cc('0x47')],{'$or':_[_0x70cc('0x35')](_0x276f60['attributes'],function(_0x1ed96a){var _0x3b3d7b={};_0x3b3d7b[_0x1ed96a]={'$like':'%'+_0x3c53f5[_0x70cc('0x3d')][_0x70cc('0x49')]+'%'};return _0x3b3d7b;})});}_0x276f60=_[_0x70cc('0x48')]({},_0x276f60,_0x3c53f5['options']);return _0x246594[_0x70cc('0x93')](_0x276f60);}})[_0x70cc('0x2b')](function(_0x336046){if(_0x336046){_0x549af7=_0x336046['length'];if(!_0x3c53f5[_0x70cc('0x3d')][_0x70cc('0x43')](_0x70cc('0x44'))){_0x276f60[_0x70cc('0x25')]=qs[_0x70cc('0x25')](_0x3c53f5['query']['limit']);_0x276f60[_0x70cc('0x22')]=qs[_0x70cc('0x22')](_0x3c53f5[_0x70cc('0x3d')][_0x70cc('0x22')]);}return _0x246594[_0x70cc('0x93')](_0x276f60);}})[_0x70cc('0x2b')](function(_0x3a6583){if(_0x3a6583){return _0x3a6583?{'count':_0x549af7,'rows':_0x3a6583}:null;}})[_0x70cc('0x2b')](respondWithResult(_0x35252e,null))['catch'](handleError(_0x35252e,null));}; \ No newline at end of file +var _0x49e3=['filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','WhatsappQueueId','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','UserWhatsappQueue','findOrCreate','forEach','emit','userWhatsappQueue:save','User','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick'];(function(_0x30dd41,_0x3b3016){var _0x4cc433=function(_0x7e7586){while(--_0x7e7586){_0x30dd41['push'](_0x30dd41['shift']());}};_0x4cc433(++_0x3b3016);}(_0x49e3,0xd7));var _0x349e=function(_0x4a9cc,_0x1e37a4){_0x4a9cc=_0x4a9cc-0x0;var _0x1bf672=_0x49e3[_0x4a9cc];return _0x1bf672;};'use strict';var emlformat=require(_0x349e('0x0'));var rimraf=require(_0x349e('0x1'));var zipdir=require(_0x349e('0x2'));var jsonpatch=require(_0x349e('0x3'));var rp=require(_0x349e('0x4'));var moment=require(_0x349e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x349e('0x6'));var util=require(_0x349e('0x7'));var path=require(_0x349e('0x8'));var sox=require('sox');var csv=require(_0x349e('0x9'));var ejs=require(_0x349e('0xa'));var fs=require('fs');var fs_extra=require(_0x349e('0xb'));var _=require('lodash');var squel=require(_0x349e('0xc'));var crypto=require(_0x349e('0xd'));var jsforce=require(_0x349e('0xe'));var deskjs=require(_0x349e('0xf'));var toCsv=require(_0x349e('0x9'));var querystring=require(_0x349e('0x10'));var Papa=require('papaparse');var Redis=require(_0x349e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x349e('0x12'));var logger=require(_0x349e('0x13'))(_0x349e('0x14'));var utils=require(_0x349e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x349e('0x16'));var db=require(_0x349e('0x17'))['db'];config[_0x349e('0x18')]=_[_0x349e('0x19')](config[_0x349e('0x18')],{'host':_0x349e('0x1a'),'port':0x18eb});var socket=require(_0x349e('0x1b'))(new Redis(config['redis']));require(_0x349e('0x1c'))[_0x349e('0x1d')](socket);function respondWithStatusCode(_0x1e5fe3,_0x252ae7){_0x252ae7=_0x252ae7||0xcc;return function(_0xe79f3f){if(_0xe79f3f){return _0x1e5fe3['sendStatus'](_0x252ae7);}return _0x1e5fe3[_0x349e('0x1e')](_0x252ae7)[_0x349e('0x1f')]();};}function respondWithResult(_0x2eede6,_0x5337f2){_0x5337f2=_0x5337f2||0xc8;return function(_0x17e2ae){if(_0x17e2ae){return _0x2eede6[_0x349e('0x1e')](_0x5337f2)[_0x349e('0x20')](_0x17e2ae);}};}function respondWithFilteredResult(_0x443253,_0x3a72b0){return function(_0x34d895){if(_0x34d895){var _0x2d9d44=typeof _0x3a72b0['offset']===_0x349e('0x21')&&typeof _0x3a72b0[_0x349e('0x22')]==='undefined';var _0x242d6d=_0x34d895[_0x349e('0x23')];var _0x231339=_0x2d9d44?0x0:_0x3a72b0['offset'];var _0x445341=_0x2d9d44?_0x34d895['count']:_0x3a72b0['offset']+_0x3a72b0[_0x349e('0x22')];var _0x4693c4;if(_0x445341>=_0x242d6d){_0x445341=_0x242d6d;_0x4693c4=0xc8;}else{_0x4693c4=0xce;}_0x443253[_0x349e('0x1e')](_0x4693c4);return _0x443253['set'](_0x349e('0x24'),_0x231339+'-'+_0x445341+'/'+_0x242d6d)[_0x349e('0x20')](_0x34d895);}return null;};}function patchUpdates(_0x259314){return function(_0x6442c5){try{jsonpatch[_0x349e('0x25')](_0x6442c5,_0x259314,!![]);}catch(_0x332b8b){return BPromise[_0x349e('0x26')](_0x332b8b);}return _0x6442c5['save']();};}function saveUpdates(_0xb041b4,_0x10c253){return function(_0x18150f){if(_0x18150f){return _0x18150f[_0x349e('0x27')](_0xb041b4)[_0x349e('0x28')](function(_0x28e244){return _0x28e244;});}return null;};}function removeEntity(_0x103652,_0x4e9c82){return function(_0x20d254){if(_0x20d254){return _0x20d254[_0x349e('0x29')]()[_0x349e('0x28')](function(){var _0x21db23=_0x20d254[_0x349e('0x2a')]({'plain':!![]});var _0x4a3783='WhatsappQueues';return db[_0x349e('0x2b')][_0x349e('0x29')]({'where':{'type':_0x4a3783,'resourceId':_0x21db23['id']}})[_0x349e('0x28')](function(){return _0x20d254;});})['then'](function(){_0x103652['status'](0xcc)[_0x349e('0x1f')]();});}};}function handleEntityNotFound(_0xcd983,_0x2c7f9b){return function(_0x5c29e6){if(!_0x5c29e6){_0xcd983['sendStatus'](0x194);}return _0x5c29e6;};}function handleError(_0x455d8e,_0x2cec11){_0x2cec11=_0x2cec11||0x1f4;return function(_0xe3f67){logger[_0x349e('0x2c')](_0xe3f67[_0x349e('0x2d')]);if(_0xe3f67[_0x349e('0x2e')]){delete _0xe3f67[_0x349e('0x2e')];}_0x455d8e[_0x349e('0x1e')](_0x2cec11)[_0x349e('0x2f')](_0xe3f67);};}exports['index']=function(_0x4c5545,_0x104fd5){var _0x5529dd={},_0x2f1482={},_0x54c5d5={'count':0x0,'rows':[]};var _0x18bce2=_[_0x349e('0x30')](db[_0x349e('0x31')][_0x349e('0x32')],function(_0x214c87){return{'name':_0x214c87[_0x349e('0x33')],'type':_0x214c87[_0x349e('0x34')]['key']};});_0x2f1482[_0x349e('0x35')]=_['map'](_0x18bce2,'name');_0x2f1482['query']=_[_0x349e('0x36')](_0x4c5545[_0x349e('0x37')]);_0x2f1482[_0x349e('0x38')]=_[_0x349e('0x39')](_0x2f1482['model'],_0x2f1482['query']);_0x5529dd[_0x349e('0x3a')]=_[_0x349e('0x39')](_0x2f1482[_0x349e('0x35')],qs['fields'](_0x4c5545['query'][_0x349e('0x3b')]));_0x5529dd['attributes']=_0x5529dd[_0x349e('0x3a')]['length']?_0x5529dd['attributes']:_0x2f1482['model'];if(!_0x4c5545[_0x349e('0x37')][_0x349e('0x3c')](_0x349e('0x3d'))){_0x5529dd[_0x349e('0x22')]=qs[_0x349e('0x22')](_0x4c5545[_0x349e('0x37')][_0x349e('0x22')]);_0x5529dd['offset']=qs[_0x349e('0x3e')](_0x4c5545[_0x349e('0x37')]['offset']);}_0x5529dd[_0x349e('0x3f')]=qs[_0x349e('0x40')](_0x4c5545[_0x349e('0x37')]['sort']);_0x5529dd[_0x349e('0x41')]=qs[_0x349e('0x38')](_[_0x349e('0x42')](_0x4c5545[_0x349e('0x37')],_0x2f1482['filters']),_0x18bce2);if(_0x4c5545['query'][_0x349e('0x43')]){_0x5529dd[_0x349e('0x41')]=_[_0x349e('0x44')](_0x5529dd['where'],{'$or':_['map'](_0x18bce2,function(_0x273788){if(_0x273788[_0x349e('0x34')]!=='VIRTUAL'){var _0x24d635={};_0x24d635[_0x273788[_0x349e('0x2e')]]={'$like':'%'+_0x4c5545['query']['filter']+'%'};return _0x24d635;}})});}_0x5529dd=_[_0x349e('0x44')]({},_0x5529dd,_0x4c5545[_0x349e('0x45')]);var _0x95f1c4={'where':_0x5529dd[_0x349e('0x41')]};return db[_0x349e('0x31')]['count'](_0x95f1c4)[_0x349e('0x28')](function(_0x4cd836){_0x54c5d5[_0x349e('0x23')]=_0x4cd836;if(_0x4c5545[_0x349e('0x37')][_0x349e('0x46')]){_0x5529dd['include']=[{'all':!![]}];}return db[_0x349e('0x31')][_0x349e('0x47')](_0x5529dd);})[_0x349e('0x28')](function(_0x2b9a22){_0x54c5d5[_0x349e('0x48')]=_0x2b9a22;return _0x54c5d5;})[_0x349e('0x28')](respondWithFilteredResult(_0x104fd5,_0x5529dd))[_0x349e('0x49')](handleError(_0x104fd5,null));};exports[_0x349e('0x4a')]=function(_0x4f2bb7,_0x50a573){var _0x3ee727={'raw':!![],'where':{'id':_0x4f2bb7[_0x349e('0x4b')]['id']}},_0x3d0c76={};_0x3d0c76['model']=_[_0x349e('0x36')](db[_0x349e('0x31')][_0x349e('0x32')]);_0x3d0c76[_0x349e('0x37')]=_[_0x349e('0x36')](_0x4f2bb7['query']);_0x3d0c76[_0x349e('0x38')]=_[_0x349e('0x39')](_0x3d0c76['model'],_0x3d0c76[_0x349e('0x37')]);_0x3ee727['attributes']=_[_0x349e('0x39')](_0x3d0c76[_0x349e('0x35')],qs[_0x349e('0x3b')](_0x4f2bb7['query'][_0x349e('0x3b')]));_0x3ee727[_0x349e('0x3a')]=_0x3ee727[_0x349e('0x3a')][_0x349e('0x4c')]?_0x3ee727[_0x349e('0x3a')]:_0x3d0c76[_0x349e('0x35')];if(_0x4f2bb7['query'][_0x349e('0x46')]){_0x3ee727[_0x349e('0x4d')]=[{'all':!![]}];}_0x3ee727=_[_0x349e('0x44')]({},_0x3ee727,_0x4f2bb7[_0x349e('0x45')]);return db[_0x349e('0x31')][_0x349e('0x4e')](_0x3ee727)[_0x349e('0x28')](handleEntityNotFound(_0x50a573,null))[_0x349e('0x28')](respondWithResult(_0x50a573,null))['catch'](handleError(_0x50a573,null));};exports[_0x349e('0x4f')]=function(_0xabb49f,_0x2531b9){return db[_0x349e('0x31')][_0x349e('0x4f')](_0xabb49f[_0x349e('0x50')],{})[_0x349e('0x28')](function(_0x1a0757){var _0x3ecd83=_0xabb49f[_0x349e('0x51')]['get']({'plain':!![]});if(!_0x3ecd83)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ecd83['role']===_0x349e('0x51')){var _0xd8905=_0x1a0757[_0x349e('0x2a')]({'plain':!![]});var _0x2d4094='WhatsappQueues';return db[_0x349e('0x52')][_0x349e('0x4e')]({'where':{'name':_0x2d4094,'userProfileId':_0x3ecd83['userProfileId']},'raw':!![]})[_0x349e('0x28')](function(_0xab4fb4){if(_0xab4fb4&&_0xab4fb4[_0x349e('0x53')]===0x0){return db[_0x349e('0x2b')]['create']({'name':_0xd8905[_0x349e('0x2e')],'resourceId':_0xd8905['id'],'type':_0xab4fb4['name'],'sectionId':_0xab4fb4['id']},{})['then'](function(){return _0x1a0757;});}else{return _0x1a0757;}})[_0x349e('0x49')](function(_0x5b66eb){logger[_0x349e('0x2c')](_0x349e('0x54'),_0x5b66eb);throw _0x5b66eb;});}return _0x1a0757;})['then'](respondWithResult(_0x2531b9,0xc9))[_0x349e('0x49')](handleError(_0x2531b9,null));};exports[_0x349e('0x27')]=function(_0x485ed5,_0x1d083c){if(_0x485ed5[_0x349e('0x50')]['id']){delete _0x485ed5['body']['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x485ed5[_0x349e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d083c,null))[_0x349e('0x28')](saveUpdates(_0x485ed5[_0x349e('0x50')],null))['then'](respondWithResult(_0x1d083c,null))[_0x349e('0x49')](handleError(_0x1d083c,null));};exports[_0x349e('0x29')]=function(_0x3b0565,_0x3b50f2){return db['WhatsappQueue']['find']({'where':{'id':_0x3b0565[_0x349e('0x4b')]['id']}})[_0x349e('0x28')](handleEntityNotFound(_0x3b50f2,null))[_0x349e('0x28')](removeEntity(_0x3b50f2,null))[_0x349e('0x49')](handleError(_0x3b50f2,null));};exports[_0x349e('0x55')]=function(_0x16c48a,_0x260625){return db[_0x349e('0x31')][_0x349e('0x55')]()['then'](respondWithResult(_0x260625,null))[_0x349e('0x49')](handleError(_0x260625,null));};exports[_0x349e('0x56')]=function(_0x12b35b,_0x31db6d,_0x4a3bed){var _0x140aac={'raw':!![],'where':{}},_0x2a34f8={},_0x3ad6a3;return db[_0x349e('0x31')][_0x349e('0x57')]({'where':{'id':_0x12b35b[_0x349e('0x4b')]['id']}})[_0x349e('0x28')](handleEntityNotFound(_0x31db6d,null))[_0x349e('0x28')](function(_0x2c63f0){if(_0x2c63f0){_0x3ad6a3=_0x2c63f0[_0x349e('0x2a')]({'plain':!![]});_0x2a34f8[_0x349e('0x35')]=_['keys'](db['UserWhatsappQueue']['rawAttributes']);_0x2a34f8[_0x349e('0x37')]=_['keys'](_0x12b35b['query']);_0x2a34f8[_0x349e('0x38')]=_[_0x349e('0x39')](_0x2a34f8[_0x349e('0x35')],_0x2a34f8[_0x349e('0x37')]);_0x140aac['attributes']=_[_0x349e('0x39')](_0x2a34f8[_0x349e('0x35')],qs[_0x349e('0x3b')](_0x12b35b[_0x349e('0x37')][_0x349e('0x3b')]));_0x140aac[_0x349e('0x3a')]=_0x140aac['attributes'][_0x349e('0x4c')]?_0x140aac[_0x349e('0x3a')]:_0x2a34f8['model'];if(!_0x12b35b[_0x349e('0x37')][_0x349e('0x3c')](_0x349e('0x3d'))){_0x140aac[_0x349e('0x22')]=qs[_0x349e('0x22')](_0x12b35b[_0x349e('0x37')]['limit']);_0x140aac['offset']=qs[_0x349e('0x3e')](_0x12b35b[_0x349e('0x37')][_0x349e('0x3e')]);}_0x140aac[_0x349e('0x3f')]=qs[_0x349e('0x40')](_0x12b35b['query'][_0x349e('0x40')]);_0x140aac['where']=qs[_0x349e('0x38')](_[_0x349e('0x42')](_0x12b35b[_0x349e('0x37')],_0x2a34f8['filters']));_0x140aac[_0x349e('0x41')][_0x349e('0x58')]=_0x2c63f0['id'];if(_0x12b35b[_0x349e('0x37')][_0x349e('0x43')]){_0x140aac['where']=_[_0x349e('0x44')](_0x140aac['where'],{'$or':_[_0x349e('0x30')](_0x140aac['attributes'],function(_0x277145){var _0x1c57fd={};_0x1c57fd[_0x277145]={'$like':'%'+_0x12b35b[_0x349e('0x37')]['filter']+'%'};return _0x1c57fd;})});}_0x140aac=_[_0x349e('0x44')]({},_0x140aac,_0x12b35b[_0x349e('0x45')]);return db['UserWhatsappQueue']['findAll'](_0x140aac);}})[_0x349e('0x28')](function(_0x3f5733){if(_0x3f5733){return db['User'][_0x349e('0x59')]({'where':{'id':_[_0x349e('0x30')](_0x3f5733,_0x349e('0x5a')),'role':'agent'},'attributes':['id',_0x349e('0x2e'),_0x349e('0x5b'),_0x349e('0x5c'),_0x349e('0x5d')]});}})[_0x349e('0x28')](function(_0x1e16d4){if(_0x1e16d4){return{'count':_0x1e16d4[_0x349e('0x23')],'rows':_[_0x349e('0x30')](_0x1e16d4[_0x349e('0x48')],function(_0x221c98){return{'membername':_0x221c98[_0x349e('0x2e')],'UserId':_0x221c98['id'],'queue_name':_0x3ad6a3[_0x349e('0x2e')],'WhatsappQueueId':_0x3ad6a3['id'],'interface':util[_0x349e('0x5e')](_0x349e('0x5f'),_0x349e('0x60'),_0x221c98[_0x349e('0x2e')]),'penalty':0x0,'paused':_0x221c98[_0x349e('0x5b')],'createdAt':_0x221c98['createdAt'],'updatedAt':_0x221c98[_0x349e('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x349e('0x28')](respondWithFilteredResult(_0x31db6d,_0x140aac))[_0x349e('0x49')](handleError(_0x31db6d,null));};exports[_0x349e('0x61')]=function(_0x478687,_0x19ced1,_0x4b72ce){var _0x4fe151={};var _0x15034b={};var _0x5293b1;var _0x47117c;return db[_0x349e('0x31')][_0x349e('0x57')]({'where':{'id':_0x478687[_0x349e('0x4b')]['id']}})[_0x349e('0x28')](handleEntityNotFound(_0x19ced1,null))[_0x349e('0x28')](function(_0x333453){if(_0x333453){_0x5293b1=_0x333453;_0x15034b['model']=_[_0x349e('0x36')](db[_0x349e('0x62')][_0x349e('0x32')]);_0x15034b[_0x349e('0x37')]=_[_0x349e('0x36')](_0x478687[_0x349e('0x37')]);_0x15034b[_0x349e('0x38')]=_[_0x349e('0x39')](_0x15034b[_0x349e('0x35')],_0x15034b['query']);_0x4fe151[_0x349e('0x3a')]=_[_0x349e('0x39')](_0x15034b[_0x349e('0x35')],qs[_0x349e('0x3b')](_0x478687[_0x349e('0x37')][_0x349e('0x3b')]));_0x4fe151['attributes']=_0x4fe151[_0x349e('0x3a')][_0x349e('0x4c')]?_0x4fe151['attributes']:_0x15034b['model'];_0x4fe151[_0x349e('0x3f')]=qs[_0x349e('0x40')](_0x478687['query'][_0x349e('0x40')]);_0x4fe151[_0x349e('0x41')]=qs['filters'](_[_0x349e('0x42')](_0x478687[_0x349e('0x37')],_0x15034b[_0x349e('0x38')]));if(_0x478687[_0x349e('0x37')]['filter']){_0x4fe151[_0x349e('0x41')]=_[_0x349e('0x44')](_0x4fe151[_0x349e('0x41')],{'$or':_[_0x349e('0x30')](_0x4fe151[_0x349e('0x3a')],function(_0x28550c){var _0x322cd2={};_0x322cd2[_0x28550c]={'$like':'%'+_0x478687['query']['filter']+'%'};return _0x322cd2;})});}_0x4fe151=_[_0x349e('0x44')]({},_0x4fe151,_0x478687[_0x349e('0x45')]);return _0x5293b1[_0x349e('0x61')](_0x4fe151);}})[_0x349e('0x28')](function(_0x27ca5d){if(_0x27ca5d){_0x47117c=_0x27ca5d['length'];if(!_0x478687['query']['hasOwnProperty'](_0x349e('0x3d'))){_0x4fe151[_0x349e('0x22')]=qs['limit'](_0x478687['query']['limit']);_0x4fe151['offset']=qs['offset'](_0x478687[_0x349e('0x37')][_0x349e('0x3e')]);}return _0x5293b1['getTeams'](_0x4fe151);}})[_0x349e('0x28')](function(_0x27e3e3){if(_0x27e3e3){return _0x27e3e3?{'count':_0x47117c,'rows':_0x27e3e3}:null;}})[_0x349e('0x28')](respondWithResult(_0x19ced1,null))[_0x349e('0x49')](handleError(_0x19ced1,null));};exports['addTeams']=function(_0x5ce136,_0x1ff281,_0x5dde52){var _0x3cb9c8=_0x5ce136[_0x349e('0x50')][_0x349e('0x63')];return db[_0x349e('0x62')][_0x349e('0x47')]({'where':{'id':_0x3cb9c8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x349e('0x64'),'attributes':['id',_0x349e('0x2e'),_0x349e('0x65'),_0x349e('0x66'),_0x349e('0x67')],'raw':!![]}]})[_0x349e('0x28')](function(_0x1625da){if(_0x1625da){var _0xcc7da5=_[_0x349e('0x68')](_0x1625da,function(_0x54a402){var _0x4aaba7=_0x54a402['get']({'plain':!![]});return _0x4aaba7[_0x349e('0x64')];});return db[_0x349e('0x31')][_0x349e('0x4e')]({'where':{'id':_0x5ce136[_0x349e('0x4b')]['id']}})[_0x349e('0x28')](function(_0xf51bac){return db[_0x349e('0x69')][_0x349e('0x6a')](function(_0x2ca2db){return _0xf51bac[_0x349e('0x6b')](_0x3cb9c8,{'transaction':_0x2ca2db})[_0x349e('0x28')](function(){return BPromise['each'](_0xcc7da5,function(_0xfe20db){return db[_0x349e('0x6c')][_0x349e('0x6d')]({'where':{'UserId':_0xfe20db['id'],'WhatsappQueueId':_0x5ce136['params']['id']},'transaction':_0x2ca2db});});})[_0x349e('0x28')](function(){_0xcc7da5[_0x349e('0x6e')](function(_0x5c4ca7){socket[_0x349e('0x6f')](_0x349e('0x70'),{'UserId':_0x5c4ca7['id'],'WhatsappQueueId':_0xf51bac['id']});});});});});}})[_0x349e('0x28')](respondWithStatusCode(_0x1ff281,null))[_0x349e('0x49')](handleError(_0x1ff281,null));};exports['removeTeams']=function(_0x197400,_0x20e35d,_0x49be32){return db['Team'][_0x349e('0x47')]({'where':{'id':_0x197400[_0x349e('0x37')][_0x349e('0x63')]},'attributes':['id'],'include':[{'model':db[_0x349e('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x20e35d,null))['then'](function(_0x3ef608){var _0x4e66c8=_['map'](_0x3ef608,'id');var _0x389f92=[];var _0x2cce8a=[];var _0x118bf7=squel['select']();_0x118bf7[_0x349e('0x72')](_0x349e('0x73'))[_0x349e('0x74')](_0x349e('0x75'),'tq')[_0x349e('0x76')](_0x349e('0x77'),'ut',_0x349e('0x78'))['where'](_0x349e('0x79'),_0x197400[_0x349e('0x4b')]['id']);for(var _0x59f00c=0x0;_0x59f00c<_0x3ef608[_0x349e('0x4c')];_0x59f00c+=0x1){let _0x391420=_0x3ef608[_0x59f00c];for(var _0x426ee0=0x0;_0x426ee0<_0x391420[_0x349e('0x64')]['length'];_0x426ee0+=0x1){let _0x43f7e3=_0x391420[_0x349e('0x64')][_0x426ee0];var _0xc10df6=_0x118bf7[_0x349e('0x7a')]();_0xc10df6[_0x349e('0x41')](_0x349e('0x7b'),_0x43f7e3['id']);_0x2cce8a[_0x349e('0x7c')](db[_0x349e('0x69')]['query'](_0xc10df6[_0x349e('0x7d')](),{'type':db['sequelize'][_0x349e('0x7e')][_0x349e('0x7f')]})[_0x349e('0x28')](function(_0x14e9c9){if(_0x14e9c9[_0x349e('0x4c')]===0x1){return _0x43f7e3['id'];}else{var _0x26716c=_['every'](_['map'](_0x14e9c9,_0x349e('0x80')),function(_0x11da26){return _[_0x349e('0x81')](_0x4e66c8,_0x11da26);});if(_0x26716c){return _0x43f7e3['id'];}}}));}}return BPromise[_0x349e('0x82')](_0x2cce8a)[_0x349e('0x28')](function(_0x31bf82){_0x389f92=_(_0x389f92)[_0x349e('0x83')](_0x31bf82)['compact']()['value']();return db[_0x349e('0x31')][_0x349e('0x4e')]({'where':{'id':_0x197400['params']['id']}})['then'](function(_0x5a7618){return db[_0x349e('0x69')]['transaction'](function(_0x1f0a9d){return _0x5a7618[_0x349e('0x84')](_0x197400[_0x349e('0x37')][_0x349e('0x63')],{'transaction':_0x1f0a9d})[_0x349e('0x28')](function(){if(!_[_0x349e('0x85')](_0x389f92)){return _0x5a7618['removeAgents'](_0x389f92,{'transaction':_0x1f0a9d});}})['then'](function(){_0x389f92[_0x349e('0x6e')](function(_0x152189){socket[_0x349e('0x6f')](_0x349e('0x86'),{'UserId':_0x152189,'WhatsappQueueId':_0x5a7618['id']});});});});});});})[_0x349e('0x28')](respondWithStatusCode(_0x20e35d,null))[_0x349e('0x49')](handleError(_0x20e35d,null));};exports[_0x349e('0x87')]=function(_0x3719de,_0x1469e1,_0x86a822){return db[_0x349e('0x31')][_0x349e('0x4e')]({'where':{'id':_0x3719de['params']['id']}})[_0x349e('0x28')](handleEntityNotFound(_0x1469e1,null))[_0x349e('0x28')](function(_0x32799b){if(_0x32799b){return _0x32799b[_0x349e('0x87')](_0x3719de[_0x349e('0x50')][_0x349e('0x63')],_[_0x349e('0x88')](_0x3719de[_0x349e('0x50')],[_0x349e('0x63'),'id'])||{})[_0x349e('0x89')](function(_0x525694){for(var _0x148f74=0x0;_0x148f74<_0x3719de[_0x349e('0x50')][_0x349e('0x63')][_0x349e('0x4c')];_0x148f74+=0x1){socket[_0x349e('0x6f')](_0x349e('0x70'),{'UserId':Number(_0x3719de['body']['ids'][_0x148f74]),'WhatsappQueueId':Number(_0x3719de['params']['id'])});}return _0x525694;});}})[_0x349e('0x28')](respondWithResult(_0x1469e1,null))[_0x349e('0x49')](handleError(_0x1469e1,null));};exports[_0x349e('0x8a')]=function(_0x247bf3,_0x1ec21e,_0x494f43){return db[_0x349e('0x31')][_0x349e('0x4e')]({'where':{'id':_0x247bf3['params']['id']}})[_0x349e('0x28')](handleEntityNotFound(_0x1ec21e,null))[_0x349e('0x28')](function(_0x38500a){if(_0x38500a){return _0x38500a[_0x349e('0x8a')](_0x247bf3[_0x349e('0x37')][_0x349e('0x63')])[_0x349e('0x28')](function(){if(_[_0x349e('0x8b')](_0x247bf3['query'][_0x349e('0x63')])){for(var _0x17d122=0x0;_0x17d122<_0x247bf3[_0x349e('0x37')]['ids'][_0x349e('0x4c')];_0x17d122+=0x1){socket[_0x349e('0x6f')](_0x349e('0x86'),{'UserId':Number(_0x247bf3[_0x349e('0x37')][_0x349e('0x63')][_0x17d122]),'WhatsappQueueId':Number(_0x247bf3[_0x349e('0x4b')]['id'])});}}else{socket[_0x349e('0x6f')](_0x349e('0x86'),{'UserId':Number(_0x247bf3[_0x349e('0x37')][_0x349e('0x63')]),'WhatsappQueueId':Number(_0x247bf3[_0x349e('0x4b')]['id'])});}});}})[_0x349e('0x28')](respondWithStatusCode(_0x1ec21e,null))[_0x349e('0x49')](handleError(_0x1ec21e,null));};exports['getAgents']=function(_0x30fa5f,_0x309058,_0x480d53){var _0x1d05b0={};var _0x405ed8={};var _0x1c2333;var _0x2918d1;return db[_0x349e('0x31')]['findOne']({'where':{'id':_0x30fa5f[_0x349e('0x4b')]['id']}})[_0x349e('0x28')](handleEntityNotFound(_0x309058,null))[_0x349e('0x28')](function(_0x17d556){if(_0x17d556){_0x1c2333=_0x17d556;_0x405ed8[_0x349e('0x35')]=_['keys'](db['User'][_0x349e('0x32')]);_0x405ed8[_0x349e('0x37')]=_[_0x349e('0x36')](_0x30fa5f[_0x349e('0x37')]);_0x405ed8['filters']=_[_0x349e('0x39')](_0x405ed8[_0x349e('0x35')],_0x405ed8[_0x349e('0x37')]);_0x1d05b0[_0x349e('0x3a')]=_[_0x349e('0x39')](_0x405ed8[_0x349e('0x35')],qs[_0x349e('0x3b')](_0x30fa5f[_0x349e('0x37')][_0x349e('0x3b')]));_0x1d05b0['attributes']=_0x1d05b0[_0x349e('0x3a')][_0x349e('0x4c')]?_0x1d05b0[_0x349e('0x3a')]:_0x405ed8[_0x349e('0x35')];_0x1d05b0['order']=qs['sort'](_0x30fa5f[_0x349e('0x37')][_0x349e('0x40')]);_0x1d05b0[_0x349e('0x41')]=qs[_0x349e('0x38')](_[_0x349e('0x42')](_0x30fa5f[_0x349e('0x37')],_0x405ed8[_0x349e('0x38')]));if(_0x30fa5f['query'][_0x349e('0x43')]){_0x1d05b0[_0x349e('0x41')]=_[_0x349e('0x44')](_0x1d05b0[_0x349e('0x41')],{'$or':_[_0x349e('0x30')](_0x1d05b0[_0x349e('0x3a')],function(_0x3e9b26){var _0x4c27fd={};_0x4c27fd[_0x3e9b26]={'$like':'%'+_0x30fa5f[_0x349e('0x37')][_0x349e('0x43')]+'%'};return _0x4c27fd;})});}_0x1d05b0=_[_0x349e('0x44')]({},_0x1d05b0,_0x30fa5f['options']);return _0x1c2333[_0x349e('0x8c')](_0x1d05b0);}})[_0x349e('0x28')](function(_0x126e26){if(_0x126e26){_0x2918d1=_0x126e26[_0x349e('0x4c')];if(!_0x30fa5f[_0x349e('0x37')][_0x349e('0x3c')](_0x349e('0x3d'))){_0x1d05b0[_0x349e('0x22')]=qs[_0x349e('0x22')](_0x30fa5f[_0x349e('0x37')][_0x349e('0x22')]);_0x1d05b0[_0x349e('0x3e')]=qs['offset'](_0x30fa5f['query']['offset']);}return _0x1c2333[_0x349e('0x8c')](_0x1d05b0);}})['then'](function(_0xec52a7){if(_0xec52a7){return _0xec52a7?{'count':_0x2918d1,'rows':_0xec52a7}:null;}})[_0x349e('0x28')](respondWithResult(_0x309058,null))['catch'](handleError(_0x309058,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 2f9ec40..02d88e4 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 _0x5ed1=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty','events'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5ed1,0x127));var _0x15ed=function(_0x188703,_0x596b26){_0x188703=_0x188703-0x0;var _0x1a0c81=_0x5ed1[_0x188703];return _0x1a0c81;};'use strict';var EventEmitter=require(_0x15ed('0x0'));var WhatsappQueue=require(_0x15ed('0x1'))['db'][_0x15ed('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x15ed('0x3')](0x0);var events={'afterCreate':_0x15ed('0x4'),'afterUpdate':_0x15ed('0x5'),'afterDestroy':'remove'};function emitEvent(_0x408fb2){return function(_0x37510b,_0x15b582,_0x1382c7){WhatsappQueueEvents['emit'](_0x408fb2+':'+_0x37510b['id'],_0x37510b);WhatsappQueueEvents[_0x15ed('0x6')](_0x408fb2,_0x37510b);_0x1382c7(null);};}for(var e in events){if(events[_0x15ed('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x45e0=['remove','emit','../../mysqldb','WhatsappQueue','setMaxListeners','save','update'];(function(_0x2be63a,_0x44d8b5){var _0x2bd7c2=function(_0x130e8a){while(--_0x130e8a){_0x2be63a['push'](_0x2be63a['shift']());}};_0x2bd7c2(++_0x44d8b5);}(_0x45e0,0xfe));var _0x045e=function(_0x306b81,_0x10044d){_0x306b81=_0x306b81-0x0;var _0x1da0aa=_0x45e0[_0x306b81];return _0x1da0aa;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x045e('0x0'))['db'][_0x045e('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x045e('0x2')](0x0);var events={'afterCreate':_0x045e('0x3'),'afterUpdate':_0x045e('0x4'),'afterDestroy':_0x045e('0x5')};function emitEvent(_0x542e67){return function(_0x255c9e,_0x343d45,_0x2fa09b){WhatsappQueueEvents[_0x045e('0x6')](_0x542e67+':'+_0x255c9e['id'],_0x255c9e);WhatsappQueueEvents['emit'](_0x542e67,_0x255c9e);_0x2fa09b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 79f5130..98ac038 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 _0x4e6c=['request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x103a4b,_0x3f35f4){var _0x32a502=function(_0x5b7308){while(--_0x5b7308){_0x103a4b['push'](_0x103a4b['shift']());}};_0x32a502(++_0x3f35f4);}(_0x4e6c,0xdf));var _0xc4e6=function(_0x54f896,_0x25990f){_0x54f896=_0x54f896-0x0;var _0x2275b8=_0x4e6c[_0x54f896];return _0x2275b8;};'use strict';var _=require(_0xc4e6('0x0'));var util=require(_0xc4e6('0x1'));var logger=require(_0xc4e6('0x2'))('api');var moment=require(_0xc4e6('0x3'));var BPromise=require(_0xc4e6('0x4'));var rp=require(_0xc4e6('0x5'));var fs=require('fs');var path=require(_0xc4e6('0x6'));var rimraf=require(_0xc4e6('0x7'));var config=require('../../config/environment');var attributes=require(_0xc4e6('0x8'));module[_0xc4e6('0x9')]=function(_0x2969c2,_0xf6eac7){return _0x2969c2[_0xc4e6('0xa')]('WhatsappQueue',attributes,{'tableName':_0xc4e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4eb=['api','bluebird','request-promise','path','../../config/environment','define','whatsapp_queues','lodash'];(function(_0x22e056,_0x2cc7bd){var _0x20d872=function(_0x47b125){while(--_0x47b125){_0x22e056['push'](_0x22e056['shift']());}};_0x20d872(++_0x2cc7bd);}(_0xd4eb,0x1c7));var _0xbd4e=function(_0x1923e2,_0x35c0af){_0x1923e2=_0x1923e2-0x0;var _0x162d36=_0xd4eb[_0x1923e2];return _0x162d36;};'use strict';var _=require(_0xbd4e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbd4e('0x1'));var moment=require('moment');var BPromise=require(_0xbd4e('0x2'));var rp=require(_0xbd4e('0x3'));var fs=require('fs');var path=require(_0xbd4e('0x4'));var rimraf=require('rimraf');var config=require(_0xbd4e('0x5'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x254d81,_0x3cc6ab){return _0x254d81[_0xbd4e('0x6')]('WhatsappQueue',attributes,{'tableName':_0xbd4e('0x7'),'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 decf6c0..28fff90 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 _0xaef5=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','lodash','util'];(function(_0x57dfe8,_0x29e73d){var _0x431923=function(_0x955e29){while(--_0x955e29){_0x57dfe8['push'](_0x57dfe8['shift']());}};_0x431923(++_0x29e73d);}(_0xaef5,0x16f));var _0x5aef=function(_0x13cb25,_0x1e299a){_0x13cb25=_0x13cb25-0x0;var _0x1afbbb=_0xaef5[_0x13cb25];return _0x1afbbb;};'use strict';var _=require(_0x5aef('0x0'));var util=require(_0x5aef('0x1'));var moment=require(_0x5aef('0x2'));var BPromise=require(_0x5aef('0x3'));var rs=require(_0x5aef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5aef('0x5'));var logger=require('../../config/logger')(_0x5aef('0x6'));var config=require(_0x5aef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5aef('0x8')][_0x5aef('0x9')]({'port':0x232a});config[_0x5aef('0xa')]=_[_0x5aef('0xb')](config[_0x5aef('0xa')],{'host':_0x5aef('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5aef('0xa')]));require(_0x5aef('0xd'))[_0x5aef('0xe')](socket);function respondWithRpcPromise(_0x1a3ba6,_0x34b208,_0xc4e036){return new BPromise(function(_0x681df9,_0x133f16){return client[_0x5aef('0xf')](_0x1a3ba6,_0xc4e036)[_0x5aef('0x10')](function(_0x542f62){logger[_0x5aef('0x11')](_0x5aef('0x12'),_0x34b208,'request\x20sent');logger[_0x5aef('0x13')](_0x5aef('0x14'),_0x34b208,_0x5aef('0x15'),JSON[_0x5aef('0x16')](_0x542f62));if(_0x542f62['error']){if(_0x542f62[_0x5aef('0x17')][_0x5aef('0x18')]===0x1f4){logger[_0x5aef('0x17')](_0x5aef('0x12'),_0x34b208,_0x542f62['error']['message']);return _0x133f16(_0x542f62[_0x5aef('0x17')][_0x5aef('0x19')]);}logger[_0x5aef('0x17')](_0x5aef('0x12'),_0x34b208,_0x542f62['error']['message']);return _0x681df9(_0x542f62[_0x5aef('0x17')][_0x5aef('0x19')]);}else{logger['info'](_0x5aef('0x12'),_0x34b208,_0x5aef('0x15'));_0x681df9(_0x542f62[_0x5aef('0x1a')]['message']);}})[_0x5aef('0x1b')](function(_0x28205a){logger[_0x5aef('0x17')](_0x5aef('0x12'),_0x34b208,_0x28205a);_0x133f16(_0x28205a);});});}exports[_0x5aef('0x1c')]=function(_0x9bc986){var _0xadb4de=this;return new Promise(function(_0x325998,_0xaf6ab0){return db[_0x5aef('0x1d')][_0x5aef('0x1e')]({'raw':_0x9bc986[_0x5aef('0x1f')]?_0x9bc986[_0x5aef('0x1f')][_0x5aef('0x20')]===undefined?!![]:![]:!![],'where':_0x9bc986[_0x5aef('0x1f')]?_0x9bc986[_0x5aef('0x1f')][_0x5aef('0x21')]||null:null,'attributes':_0x9bc986[_0x5aef('0x1f')]?_0x9bc986[_0x5aef('0x1f')][_0x5aef('0x22')]||null:null,'limit':_0x9bc986['options']?_0x9bc986[_0x5aef('0x1f')][_0x5aef('0x23')]||null:null,'include':_0x9bc986[_0x5aef('0x1f')]?_0x9bc986[_0x5aef('0x1f')][_0x5aef('0x24')]?_['map'](_0x9bc986[_0x5aef('0x1f')][_0x5aef('0x24')],function(_0x4ca2b7){return{'model':db[_0x4ca2b7['model']],'as':_0x4ca2b7['as'],'attributes':_0x4ca2b7[_0x5aef('0x22')],'include':_0x4ca2b7[_0x5aef('0x24')]?_[_0x5aef('0x25')](_0x4ca2b7[_0x5aef('0x24')],function(_0x2bd8d0){return{'model':db[_0x2bd8d0['model']],'as':_0x2bd8d0['as'],'attributes':_0x2bd8d0[_0x5aef('0x22')],'include':_0x2bd8d0[_0x5aef('0x24')]?_[_0x5aef('0x25')](_0x2bd8d0['include'],function(_0x30b057){return{'model':db[_0x30b057[_0x5aef('0x26')]],'as':_0x30b057['as'],'attributes':_0x30b057[_0x5aef('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5aef('0x10')](function(_0x2a3395){logger[_0x5aef('0x11')]('GetWhatsappQueue',_0x9bc986);logger['debug'](_0x5aef('0x1c'),_0x9bc986,JSON[_0x5aef('0x16')](_0x2a3395));_0x325998(_0x2a3395);})[_0x5aef('0x1b')](function(_0x4ce3fc){logger[_0x5aef('0x17')](_0x5aef('0x1c'),_0x4ce3fc[_0x5aef('0x19')],_0x9bc986);_0xaf6ab0(_0xadb4de['error'](0x1f4,_0x4ce3fc[_0x5aef('0x19')]));});});};exports[_0x5aef('0x27')]=function(_0x3206a6){var _0x40e082=this;return new Promise(function(_0x49046a,_0x2facf6){return db['WhatsappQueue'][_0x5aef('0x28')]({'raw':_0x3206a6[_0x5aef('0x1f')]?_0x3206a6[_0x5aef('0x1f')][_0x5aef('0x20')]===undefined?!![]:![]:!![],'where':_0x3206a6['options']?_0x3206a6[_0x5aef('0x1f')][_0x5aef('0x21')]||null:null,'attributes':_0x3206a6[_0x5aef('0x1f')]?_0x3206a6['options']['attributes']||null:null,'include':_0x3206a6[_0x5aef('0x1f')]?_0x3206a6[_0x5aef('0x1f')][_0x5aef('0x24')]?_[_0x5aef('0x25')](_0x3206a6[_0x5aef('0x1f')]['include'],function(_0x200984){return{'model':db[_0x200984[_0x5aef('0x26')]],'as':_0x200984['as'],'attributes':_0x200984[_0x5aef('0x22')],'include':_0x200984[_0x5aef('0x24')]?_[_0x5aef('0x25')](_0x200984[_0x5aef('0x24')],function(_0x3e2674){return{'model':db[_0x3e2674[_0x5aef('0x26')]],'as':_0x3e2674['as'],'attributes':_0x3e2674[_0x5aef('0x22')],'include':_0x3e2674['include']?_[_0x5aef('0x25')](_0x3e2674[_0x5aef('0x24')],function(_0x3f281e){return{'model':db[_0x3f281e[_0x5aef('0x26')]],'as':_0x3f281e['as'],'attributes':_0x3f281e[_0x5aef('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bc1e9){logger[_0x5aef('0x11')](_0x5aef('0x27'),_0x3206a6);logger[_0x5aef('0x13')](_0x5aef('0x27'),_0x3206a6,JSON[_0x5aef('0x16')](_0x1bc1e9));_0x49046a(_0x1bc1e9);})[_0x5aef('0x1b')](function(_0x5195f5){logger[_0x5aef('0x17')](_0x5aef('0x27'),_0x5195f5[_0x5aef('0x19')],_0x3206a6);_0x2facf6(_0x40e082[_0x5aef('0x17')](0x1f4,_0x5195f5['message']));});});}; \ No newline at end of file +var _0xbd87=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappQueue.socket','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','include','map','model','attributes','find','where','ShowWhatsappQueue','moment','bluebird','ioredis','../../mysqldb'];(function(_0x44edab,_0xe13e47){var _0x3b8ba7=function(_0x267762){while(--_0x267762){_0x44edab['push'](_0x44edab['shift']());}};_0x3b8ba7(++_0xe13e47);}(_0xbd87,0x140));var _0x7bd8=function(_0x13013a,_0x2ff754){_0x13013a=_0x13013a-0x0;var _0x5ef930=_0xbd87[_0x13013a];return _0x5ef930;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7bd8('0x0'));var BPromise=require(_0x7bd8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bd8('0x2'));var db=require(_0x7bd8('0x3'))['db'];var utils=require(_0x7bd8('0x4'));var logger=require(_0x7bd8('0x5'))(_0x7bd8('0x6'));var config=require(_0x7bd8('0x7'));var jayson=require(_0x7bd8('0x8'));var client=jayson[_0x7bd8('0x9')][_0x7bd8('0xa')]({'port':0x232a});config[_0x7bd8('0xb')]=_[_0x7bd8('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7bd8('0xd'))['register'](socket);function respondWithRpcPromise(_0x3539e8,_0x388626,_0x38dddd){return new BPromise(function(_0x1189cf,_0x5b9093){return client['request'](_0x3539e8,_0x38dddd)[_0x7bd8('0xe')](function(_0x43181d){logger[_0x7bd8('0xf')](_0x7bd8('0x10'),_0x388626,_0x7bd8('0x11'));logger[_0x7bd8('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x388626,_0x7bd8('0x11'),JSON[_0x7bd8('0x13')](_0x43181d));if(_0x43181d[_0x7bd8('0x14')]){if(_0x43181d[_0x7bd8('0x14')][_0x7bd8('0x15')]===0x1f4){logger['error'](_0x7bd8('0x10'),_0x388626,_0x43181d[_0x7bd8('0x14')][_0x7bd8('0x16')]);return _0x5b9093(_0x43181d[_0x7bd8('0x14')][_0x7bd8('0x16')]);}logger[_0x7bd8('0x14')](_0x7bd8('0x10'),_0x388626,_0x43181d[_0x7bd8('0x14')][_0x7bd8('0x16')]);return _0x1189cf(_0x43181d[_0x7bd8('0x14')][_0x7bd8('0x16')]);}else{logger['info'](_0x7bd8('0x10'),_0x388626,_0x7bd8('0x11'));_0x1189cf(_0x43181d['result']['message']);}})[_0x7bd8('0x17')](function(_0x6e34be){logger[_0x7bd8('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x388626,_0x6e34be);_0x5b9093(_0x6e34be);});});}exports[_0x7bd8('0x18')]=function(_0x34b2ae){var _0x2fabb5=this;return new Promise(function(_0x4243b2,_0x1a39a1){return db[_0x7bd8('0x19')][_0x7bd8('0x1a')]({'raw':_0x34b2ae['options']?_0x34b2ae[_0x7bd8('0x1b')][_0x7bd8('0x1c')]===undefined?!![]:![]:!![],'where':_0x34b2ae['options']?_0x34b2ae[_0x7bd8('0x1b')]['where']||null:null,'attributes':_0x34b2ae['options']?_0x34b2ae[_0x7bd8('0x1b')]['attributes']||null:null,'limit':_0x34b2ae['options']?_0x34b2ae[_0x7bd8('0x1b')]['limit']||null:null,'include':_0x34b2ae['options']?_0x34b2ae['options'][_0x7bd8('0x1d')]?_[_0x7bd8('0x1e')](_0x34b2ae[_0x7bd8('0x1b')][_0x7bd8('0x1d')],function(_0x5a73fa){return{'model':db[_0x5a73fa[_0x7bd8('0x1f')]],'as':_0x5a73fa['as'],'attributes':_0x5a73fa['attributes'],'include':_0x5a73fa[_0x7bd8('0x1d')]?_['map'](_0x5a73fa[_0x7bd8('0x1d')],function(_0x441a2f){return{'model':db[_0x441a2f[_0x7bd8('0x1f')]],'as':_0x441a2f['as'],'attributes':_0x441a2f[_0x7bd8('0x20')],'include':_0x441a2f[_0x7bd8('0x1d')]?_['map'](_0x441a2f[_0x7bd8('0x1d')],function(_0x2431fb){return{'model':db[_0x2431fb[_0x7bd8('0x1f')]],'as':_0x2431fb['as'],'attributes':_0x2431fb[_0x7bd8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d0264){logger[_0x7bd8('0xf')](_0x7bd8('0x18'),_0x34b2ae);logger[_0x7bd8('0x12')](_0x7bd8('0x18'),_0x34b2ae,JSON['stringify'](_0x3d0264));_0x4243b2(_0x3d0264);})[_0x7bd8('0x17')](function(_0x38ff45){logger[_0x7bd8('0x14')](_0x7bd8('0x18'),_0x38ff45[_0x7bd8('0x16')],_0x34b2ae);_0x1a39a1(_0x2fabb5[_0x7bd8('0x14')](0x1f4,_0x38ff45[_0x7bd8('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x314350){var _0xcb04ef=this;return new Promise(function(_0x51cdc5,_0x2c7c95){return db[_0x7bd8('0x19')][_0x7bd8('0x21')]({'raw':_0x314350[_0x7bd8('0x1b')]?_0x314350['options']['raw']===undefined?!![]:![]:!![],'where':_0x314350['options']?_0x314350[_0x7bd8('0x1b')][_0x7bd8('0x22')]||null:null,'attributes':_0x314350['options']?_0x314350['options'][_0x7bd8('0x20')]||null:null,'include':_0x314350[_0x7bd8('0x1b')]?_0x314350[_0x7bd8('0x1b')][_0x7bd8('0x1d')]?_['map'](_0x314350[_0x7bd8('0x1b')][_0x7bd8('0x1d')],function(_0x2ba66b){return{'model':db[_0x2ba66b[_0x7bd8('0x1f')]],'as':_0x2ba66b['as'],'attributes':_0x2ba66b[_0x7bd8('0x20')],'include':_0x2ba66b[_0x7bd8('0x1d')]?_[_0x7bd8('0x1e')](_0x2ba66b[_0x7bd8('0x1d')],function(_0x3f6f3d){return{'model':db[_0x3f6f3d['model']],'as':_0x3f6f3d['as'],'attributes':_0x3f6f3d[_0x7bd8('0x20')],'include':_0x3f6f3d[_0x7bd8('0x1d')]?_[_0x7bd8('0x1e')](_0x3f6f3d[_0x7bd8('0x1d')],function(_0x2e7461){return{'model':db[_0x2e7461[_0x7bd8('0x1f')]],'as':_0x2e7461['as'],'attributes':_0x2e7461[_0x7bd8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x241973){logger[_0x7bd8('0xf')](_0x7bd8('0x23'),_0x314350);logger['debug'](_0x7bd8('0x23'),_0x314350,JSON[_0x7bd8('0x13')](_0x241973));_0x51cdc5(_0x241973);})[_0x7bd8('0x17')](function(_0x5cdd7d){logger['error'](_0x7bd8('0x23'),_0x5cdd7d[_0x7bd8('0x16')],_0x314350);_0x2c7c95(_0xcb04ef[_0x7bd8('0x14')](0x1f4,_0x5cdd7d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index fb77cc7..f17db2e 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 _0x0cbf=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','update','emit'];(function(_0x912378,_0x174a85){var _0xe21478=function(_0x22993){while(--_0x22993){_0x912378['push'](_0x912378['shift']());}};_0xe21478(++_0x174a85);}(_0x0cbf,0x1a4));var _0xf0cb=function(_0xc1ccd6,_0x545a34){_0xc1ccd6=_0xc1ccd6-0x0;var _0x2cdb1a=_0x0cbf[_0xc1ccd6];return _0x2cdb1a;};'use strict';var WhatsappQueueEvents=require(_0xf0cb('0x0'));var events=[_0xf0cb('0x1'),'remove',_0xf0cb('0x2')];function createListener(_0xa54b08,_0xb7f952){return function(_0xf977b6){_0xb7f952[_0xf0cb('0x3')](_0xa54b08,_0xf977b6);};}function removeListener(_0x502e3e,_0x3fcd3a){return function(){WhatsappQueueEvents[_0xf0cb('0x4')](_0x502e3e,_0x3fcd3a);};}exports[_0xf0cb('0x5')]=function(_0x449424){for(var _0x2e8cf7=0x0,_0xf1cc9a=events[_0xf0cb('0x6')];_0x2e8cf7<_0xf1cc9a;_0x2e8cf7++){var _0x544ca6=events[_0x2e8cf7];var _0x3ac9cb=createListener(_0xf0cb('0x7')+_0x544ca6,_0x449424);WhatsappQueueEvents['on'](_0x544ca6,_0x3ac9cb);}}; \ No newline at end of file +var _0xffc8=['./whatsappQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffc8,0x142));var _0x8ffc=function(_0x3a0da2,_0x3710d4){_0x3a0da2=_0x3a0da2-0x0;var _0x1f0c34=_0xffc8[_0x3a0da2];return _0x1f0c34;};'use strict';var WhatsappQueueEvents=require(_0x8ffc('0x0'));var events=['save',_0x8ffc('0x1'),_0x8ffc('0x2')];function createListener(_0x12d6ef,_0x402b6e){return function(_0x11cc60){_0x402b6e[_0x8ffc('0x3')](_0x12d6ef,_0x11cc60);};}function removeListener(_0x46912b,_0x263f43){return function(){WhatsappQueueEvents[_0x8ffc('0x4')](_0x46912b,_0x263f43);};}exports[_0x8ffc('0x5')]=function(_0x1db98d){for(var _0x28c3c5=0x0,_0x486484=events[_0x8ffc('0x6')];_0x28c3c5<_0x486484;_0x28c3c5++){var _0x8e94a0=events[_0x28c3c5];var _0x2c14c6=createListener('whatsappQueue:'+_0x8e94a0,_0x1db98d);WhatsappQueueEvents['on'](_0x8e94a0,_0x2c14c6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 91a4779..212cae0 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 _0x7f88=['destroy','exports','multer','util','path','express','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0x5837b1,_0x54229a){var _0x490d8b=function(_0x3af82d){while(--_0x3af82d){_0x5837b1['push'](_0x5837b1['shift']());}};_0x490d8b(++_0x54229a);}(_0x7f88,0x17e));var _0x87f8=function(_0x130376,_0x4d7d9d){_0x130376=_0x130376-0x0;var _0x6a495b=_0x7f88[_0x130376];return _0x6a495b;};'use strict';var multer=require(_0x87f8('0x0'));var util=require(_0x87f8('0x1'));var path=require(_0x87f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x87f8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x87f8('0x4'));var config=require('../../config/environment');var controller=require(_0x87f8('0x5'));router[_0x87f8('0x6')]('/',auth[_0x87f8('0x7')](),controller[_0x87f8('0x8')]);router[_0x87f8('0x6')](_0x87f8('0x9'),auth[_0x87f8('0x7')](),controller[_0x87f8('0xa')]);router[_0x87f8('0x6')](_0x87f8('0xb'),auth[_0x87f8('0x7')](),controller['show']);router[_0x87f8('0xc')]('/',auth[_0x87f8('0x7')](),controller[_0x87f8('0xd')]);router[_0x87f8('0xe')](_0x87f8('0xb'),auth['isAuthenticated'](),controller[_0x87f8('0xf')]);router[_0x87f8('0x10')](_0x87f8('0xb'),auth[_0x87f8('0x7')](),controller[_0x87f8('0x11')]);module[_0x87f8('0x12')]=router; \ No newline at end of file +var _0x2e26=['./whatsappQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f59e3,_0x4a1e85){var _0x15ab10=function(_0xfe0b8a){while(--_0xfe0b8a){_0x3f59e3['push'](_0x3f59e3['shift']());}};_0x15ab10(++_0x4a1e85);}(_0x2e26,0xc1));var _0x62e2=function(_0x40a6a5,_0x12ad6b){_0x40a6a5=_0x40a6a5-0x0;var _0x43da72=_0x2e26[_0x40a6a5];return _0x43da72;};'use strict';var multer=require(_0x62e2('0x0'));var util=require('util');var path=require(_0x62e2('0x1'));var timeout=require(_0x62e2('0x2'));var express=require(_0x62e2('0x3'));var router=express['Router']();var fs_extra=require(_0x62e2('0x4'));var auth=require(_0x62e2('0x5'));var interaction=require(_0x62e2('0x6'));var config=require('../../config/environment');var controller=require(_0x62e2('0x7'));router[_0x62e2('0x8')]('/',auth['isAuthenticated'](),controller[_0x62e2('0x9')]);router['get']('/describe',auth[_0x62e2('0xa')](),controller[_0x62e2('0xb')]);router[_0x62e2('0x8')](_0x62e2('0xc'),auth[_0x62e2('0xa')](),controller[_0x62e2('0xd')]);router[_0x62e2('0xe')]('/',auth[_0x62e2('0xa')](),controller[_0x62e2('0xf')]);router[_0x62e2('0x10')]('/:id',auth[_0x62e2('0xa')](),controller['update']);router[_0x62e2('0x11')]('/:id',auth[_0x62e2('0xa')](),controller[_0x62e2('0x12')]);module[_0x62e2('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 3fa84a7..fc9d7da 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4a8f2c,_0xf102ef){var _0x20b4a9=function(_0x77f3ae){while(--_0x77f3ae){_0x4a8f2c['push'](_0x4a8f2c['shift']());}};_0x20b4a9(++_0xf102ef);}(_0x7a54,0x106));var _0x47a5=function(_0x254990,_0x45f80e){_0x254990=_0x254990-0x0;var _0x120b22=_0x7a54[_0x254990];return _0x120b22;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x263c73,_0x38d5ae){var _0x170402=function(_0x28ac26){while(--_0x28ac26){_0x263c73['push'](_0x263c73['shift']());}};_0x170402(++_0x38d5ae);}(_0x7a54,0x106));var _0x47a5=function(_0x2a5959,_0x27378b){_0x2a5959=_0x2a5959-0x0;var _0x384f37=_0x7a54[_0x2a5959];return _0x384f37;};'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 e551210..c2cfe82 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 _0xa5fa=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','rows','catch','show','params','fields','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x9a9f23,_0x2be6a0){var _0x423e5a=function(_0x4f0ba7){while(--_0x4f0ba7){_0x9a9f23['push'](_0x9a9f23['shift']());}};_0x423e5a(++_0x2be6a0);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x5ba2c8,_0x5826ef){_0x5ba2c8=_0x5ba2c8-0x0;var _0x6c177f=_0xa5fa[_0x5ba2c8];return _0x6c177f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];function respondWithStatusCode(_0x9aeae9,_0x252ae0){_0x252ae0=_0x252ae0||0xcc;return function(_0x48d1d3){if(_0x48d1d3){return _0x9aeae9[_0xaa5f('0x17')](_0x252ae0);}return _0x9aeae9['status'](_0x252ae0)[_0xaa5f('0x18')]();};}function respondWithResult(_0x23f872,_0x31eabc){_0x31eabc=_0x31eabc||0xc8;return function(_0x19aa27){if(_0x19aa27){return _0x23f872[_0xaa5f('0x19')](_0x31eabc)['json'](_0x19aa27);}};}function respondWithFilteredResult(_0x4fc828,_0x1f37fb){return function(_0x291042){if(_0x291042){var _0xb0bfb6=typeof _0x1f37fb[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x1f37fb[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x28407c=_0x291042[_0xaa5f('0x1d')];var _0x3d874f=_0xb0bfb6?0x0:_0x1f37fb[_0xaa5f('0x1a')];var _0x1019e8=_0xb0bfb6?_0x291042['count']:_0x1f37fb[_0xaa5f('0x1a')]+_0x1f37fb[_0xaa5f('0x1c')];var _0x1cbab5;if(_0x1019e8>=_0x28407c){_0x1019e8=_0x28407c;_0x1cbab5=0xc8;}else{_0x1cbab5=0xce;}_0x4fc828[_0xaa5f('0x19')](_0x1cbab5);return _0x4fc828[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x3d874f+'-'+_0x1019e8+'/'+_0x28407c)[_0xaa5f('0x20')](_0x291042);}return null;};}function patchUpdates(_0x194691){return function(_0x2d8fc3){try{jsonpatch[_0xaa5f('0x21')](_0x2d8fc3,_0x194691,!![]);}catch(_0x40c223){return BPromise[_0xaa5f('0x22')](_0x40c223);}return _0x2d8fc3[_0xaa5f('0x23')]();};}function saveUpdates(_0x5238a8,_0x1e917d){return function(_0x57082c){if(_0x57082c){return _0x57082c[_0xaa5f('0x24')](_0x5238a8)[_0xaa5f('0x25')](function(_0x561381){return _0x561381;});}return null;};}function removeEntity(_0x1baa2e,_0x1032ce){return function(_0x5b9f0b){if(_0x5b9f0b){return _0x5b9f0b[_0xaa5f('0x26')]()[_0xaa5f('0x25')](function(){_0x1baa2e[_0xaa5f('0x19')](0xcc)[_0xaa5f('0x18')]();});}};}function handleEntityNotFound(_0x1f66c0,_0xacbded){return function(_0x3d7bca){if(!_0x3d7bca){_0x1f66c0[_0xaa5f('0x17')](0x194);}return _0x3d7bca;};}function handleError(_0x51eb55,_0x2445a6){_0x2445a6=_0x2445a6||0x1f4;return function(_0x3a66e8){logger[_0xaa5f('0x27')](_0x3a66e8['stack']);if(_0x3a66e8[_0xaa5f('0x28')]){delete _0x3a66e8[_0xaa5f('0x28')];}_0x51eb55[_0xaa5f('0x19')](_0x2445a6)['send'](_0x3a66e8);};}exports[_0xaa5f('0x29')]=function(_0x479f29,_0x5990d2){var _0x27d1a4={},_0x50998f={},_0x1bffec={'count':0x0,'rows':[]};var _0x4e0ec9=_['map'](db['WhatsappQueueReport'][_0xaa5f('0x2a')],function(_0x4ddebd){return{'name':_0x4ddebd[_0xaa5f('0x2b')],'type':_0x4ddebd[_0xaa5f('0x2c')]['key']};});_0x50998f['model']=_[_0xaa5f('0x2d')](_0x4e0ec9,'name');_0x50998f[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0x479f29['query']);_0x50998f[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x50998f[_0xaa5f('0x32')],_0x50998f['query']);_0x27d1a4[_0xaa5f('0x33')]=_[_0xaa5f('0x31')](_0x50998f['model'],qs['fields'](_0x479f29['query']['fields']));_0x27d1a4[_0xaa5f('0x33')]=_0x27d1a4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x27d1a4[_0xaa5f('0x33')]:_0x50998f[_0xaa5f('0x32')];if(!_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x35')]('nolimit')){_0x27d1a4[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x1c')]);_0x27d1a4[_0xaa5f('0x1a')]=qs[_0xaa5f('0x1a')](_0x479f29['query'][_0xaa5f('0x1a')]);}_0x27d1a4[_0xaa5f('0x36')]=qs[_0xaa5f('0x37')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x37')]);_0x27d1a4['where']=qs['filters'](_[_0xaa5f('0x38')](_0x479f29[_0xaa5f('0x2e')],_0x50998f[_0xaa5f('0x30')]),_0x4e0ec9);if(_0x479f29[_0xaa5f('0x2e')]['filter']){_0x27d1a4[_0xaa5f('0x39')]=_[_0xaa5f('0x3a')](_0x27d1a4[_0xaa5f('0x39')],{'$or':_[_0xaa5f('0x2d')](_0x4e0ec9,function(_0x37db88){if(_0x37db88[_0xaa5f('0x2c')]!==_0xaa5f('0x3b')){var _0x2c4d29={};_0x2c4d29[_0x37db88[_0xaa5f('0x28')]]={'$like':'%'+_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3c')]+'%'};return _0x2c4d29;}})});}_0x27d1a4=_['merge']({},_0x27d1a4,_0x479f29[_0xaa5f('0x3d')]);var _0x2562ce={'where':_0x27d1a4[_0xaa5f('0x39')]};return db[_0xaa5f('0x3e')][_0xaa5f('0x1d')](_0x2562ce)[_0xaa5f('0x25')](function(_0x1fb572){_0x1bffec[_0xaa5f('0x1d')]=_0x1fb572;if(_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3f')]){_0x27d1a4['include']=[{'all':!![]}];}return db[_0xaa5f('0x3e')]['findAll'](_0x27d1a4);})[_0xaa5f('0x25')](function(_0x21f4bc){_0x1bffec[_0xaa5f('0x40')]=_0x21f4bc;return _0x1bffec;})['then'](respondWithFilteredResult(_0x5990d2,_0x27d1a4))[_0xaa5f('0x41')](handleError(_0x5990d2,null));};exports[_0xaa5f('0x42')]=function(_0xe49f8,_0x528b08){var _0x12a8e4={'raw':!![],'where':{'id':_0xe49f8[_0xaa5f('0x43')]['id']}},_0x179be8={};_0x179be8[_0xaa5f('0x32')]=_['keys'](db[_0xaa5f('0x3e')][_0xaa5f('0x2a')]);_0x179be8[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0xe49f8[_0xaa5f('0x2e')]);_0x179be8[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x179be8[_0xaa5f('0x32')],_0x179be8['query']);_0x12a8e4[_0xaa5f('0x33')]=_['intersection'](_0x179be8[_0xaa5f('0x32')],qs['fields'](_0xe49f8[_0xaa5f('0x2e')][_0xaa5f('0x44')]));_0x12a8e4['attributes']=_0x12a8e4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x12a8e4[_0xaa5f('0x33')]:_0x179be8['model'];if(_0xe49f8['query']['includeAll']){_0x12a8e4[_0xaa5f('0x45')]=[{'all':!![]}];}_0x12a8e4=_['merge']({},_0x12a8e4,_0xe49f8[_0xaa5f('0x3d')]);return db[_0xaa5f('0x3e')][_0xaa5f('0x46')](_0x12a8e4)[_0xaa5f('0x25')](handleEntityNotFound(_0x528b08,null))['then'](respondWithResult(_0x528b08,null))[_0xaa5f('0x41')](handleError(_0x528b08,null));};exports[_0xaa5f('0x47')]=function(_0x3c6a17,_0x231ad1){return db[_0xaa5f('0x3e')][_0xaa5f('0x47')](_0x3c6a17[_0xaa5f('0x48')],{})[_0xaa5f('0x25')](respondWithResult(_0x231ad1,0xc9))[_0xaa5f('0x41')](handleError(_0x231ad1,null));};exports[_0xaa5f('0x24')]=function(_0x3ea553,_0x2de737){if(_0x3ea553[_0xaa5f('0x48')]['id']){delete _0x3ea553[_0xaa5f('0x48')]['id'];}return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x3ea553['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x2de737,null))[_0xaa5f('0x25')](saveUpdates(_0x3ea553[_0xaa5f('0x48')],null))[_0xaa5f('0x25')](respondWithResult(_0x2de737,null))[_0xaa5f('0x41')](handleError(_0x2de737,null));};exports[_0xaa5f('0x26')]=function(_0x32bbed,_0x4aa556){return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x32bbed[_0xaa5f('0x43')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x4aa556,null))['then'](removeEntity(_0x4aa556,null))[_0xaa5f('0x41')](handleError(_0x4aa556,null));};exports[_0xaa5f('0x49')]=function(_0x36c4aa,_0x575803){return db['WhatsappQueueReport']['describe']()['then'](respondWithResult(_0x575803,null))['catch'](handleError(_0x575803,null));}; \ No newline at end of file +var _0x3de3=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','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','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','keys','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','destroy','describe'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3de3,0x1ce));var _0x33de=function(_0xcc3326,_0x3dcac8){_0xcc3326=_0xcc3326-0x0;var _0x331743=_0x3de3[_0xcc3326];return _0x331743;};'use strict';var emlformat=require(_0x33de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33de('0x1'));var jsonpatch=require(_0x33de('0x2'));var rp=require('request-promise');var moment=require(_0x33de('0x3'));var BPromise=require(_0x33de('0x4'));var Mustache=require(_0x33de('0x5'));var util=require(_0x33de('0x6'));var path=require('path');var sox=require(_0x33de('0x7'));var csv=require(_0x33de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33de('0x9'));var _=require('lodash');var squel=require(_0x33de('0xa'));var crypto=require(_0x33de('0xb'));var jsforce=require(_0x33de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33de('0x8'));var querystring=require(_0x33de('0xd'));var Papa=require(_0x33de('0xe'));var Redis=require('ioredis');var authService=require(_0x33de('0xf'));var qs=require(_0x33de('0x10'));var as=require(_0x33de('0x11'));var hardwareService=require(_0x33de('0x12'));var logger=require(_0x33de('0x13'))(_0x33de('0x14'));var utils=require(_0x33de('0x15'));var config=require(_0x33de('0x16'));var licenseUtil=require(_0x33de('0x17'));var db=require(_0x33de('0x18'))['db'];function respondWithStatusCode(_0x27d1d8,_0x5170ad){_0x5170ad=_0x5170ad||0xcc;return function(_0x6b1a4c){if(_0x6b1a4c){return _0x27d1d8[_0x33de('0x19')](_0x5170ad);}return _0x27d1d8['status'](_0x5170ad)['end']();};}function respondWithResult(_0x4164ab,_0x22bda8){_0x22bda8=_0x22bda8||0xc8;return function(_0x2b3748){if(_0x2b3748){return _0x4164ab[_0x33de('0x1a')](_0x22bda8)['json'](_0x2b3748);}};}function respondWithFilteredResult(_0x11e6b5,_0x1b1166){return function(_0x522ba0){if(_0x522ba0){var _0x4ff69f=typeof _0x1b1166[_0x33de('0x1b')]===_0x33de('0x1c')&&typeof _0x1b1166[_0x33de('0x1d')]==='undefined';var _0x2db887=_0x522ba0[_0x33de('0x1e')];var _0x52cfa0=_0x4ff69f?0x0:_0x1b1166[_0x33de('0x1b')];var _0x201ff3=_0x4ff69f?_0x522ba0['count']:_0x1b1166['offset']+_0x1b1166[_0x33de('0x1d')];var _0x52d718;if(_0x201ff3>=_0x2db887){_0x201ff3=_0x2db887;_0x52d718=0xc8;}else{_0x52d718=0xce;}_0x11e6b5[_0x33de('0x1a')](_0x52d718);return _0x11e6b5[_0x33de('0x1f')](_0x33de('0x20'),_0x52cfa0+'-'+_0x201ff3+'/'+_0x2db887)[_0x33de('0x21')](_0x522ba0);}return null;};}function patchUpdates(_0xc4f1a4){return function(_0x40a8e6){try{jsonpatch[_0x33de('0x22')](_0x40a8e6,_0xc4f1a4,!![]);}catch(_0x493263){return BPromise['reject'](_0x493263);}return _0x40a8e6[_0x33de('0x23')]();};}function saveUpdates(_0x5af3fa,_0x8acd8d){return function(_0x4cd8db){if(_0x4cd8db){return _0x4cd8db[_0x33de('0x24')](_0x5af3fa)[_0x33de('0x25')](function(_0x575e88){return _0x575e88;});}return null;};}function removeEntity(_0x2dbcf2,_0x5cd77e){return function(_0x67d040){if(_0x67d040){return _0x67d040['destroy']()[_0x33de('0x25')](function(){_0x2dbcf2[_0x33de('0x1a')](0xcc)[_0x33de('0x26')]();});}};}function handleEntityNotFound(_0x5b79d7,_0x3bdba4){return function(_0x2d206b){if(!_0x2d206b){_0x5b79d7[_0x33de('0x19')](0x194);}return _0x2d206b;};}function handleError(_0x5cd31e,_0x34fba3){_0x34fba3=_0x34fba3||0x1f4;return function(_0x5585a2){logger['error'](_0x5585a2[_0x33de('0x27')]);if(_0x5585a2[_0x33de('0x28')]){delete _0x5585a2[_0x33de('0x28')];}_0x5cd31e[_0x33de('0x1a')](_0x34fba3)[_0x33de('0x29')](_0x5585a2);};}exports[_0x33de('0x2a')]=function(_0x3f22fb,_0x1b4703){var _0x59bc3b={},_0x5ae0e8={},_0x2755e6={'count':0x0,'rows':[]};var _0x1420d2=_[_0x33de('0x2b')](db[_0x33de('0x2c')][_0x33de('0x2d')],function(_0x20f393){return{'name':_0x20f393[_0x33de('0x2e')],'type':_0x20f393['type'][_0x33de('0x2f')]};});_0x5ae0e8[_0x33de('0x30')]=_[_0x33de('0x2b')](_0x1420d2,_0x33de('0x28'));_0x5ae0e8['query']=_[_0x33de('0x31')](_0x3f22fb[_0x33de('0x32')]);_0x5ae0e8['filters']=_['intersection'](_0x5ae0e8['model'],_0x5ae0e8[_0x33de('0x32')]);_0x59bc3b[_0x33de('0x33')]=_['intersection'](_0x5ae0e8[_0x33de('0x30')],qs['fields'](_0x3f22fb['query'][_0x33de('0x34')]));_0x59bc3b[_0x33de('0x33')]=_0x59bc3b[_0x33de('0x33')][_0x33de('0x35')]?_0x59bc3b[_0x33de('0x33')]:_0x5ae0e8[_0x33de('0x30')];if(!_0x3f22fb[_0x33de('0x32')][_0x33de('0x36')]('nolimit')){_0x59bc3b[_0x33de('0x1d')]=qs['limit'](_0x3f22fb[_0x33de('0x32')]['limit']);_0x59bc3b['offset']=qs[_0x33de('0x1b')](_0x3f22fb[_0x33de('0x32')][_0x33de('0x1b')]);}_0x59bc3b[_0x33de('0x37')]=qs[_0x33de('0x38')](_0x3f22fb[_0x33de('0x32')]['sort']);_0x59bc3b[_0x33de('0x39')]=qs[_0x33de('0x3a')](_[_0x33de('0x3b')](_0x3f22fb[_0x33de('0x32')],_0x5ae0e8[_0x33de('0x3a')]),_0x1420d2);if(_0x3f22fb[_0x33de('0x32')][_0x33de('0x3c')]){_0x59bc3b['where']=_[_0x33de('0x3d')](_0x59bc3b[_0x33de('0x39')],{'$or':_[_0x33de('0x2b')](_0x1420d2,function(_0x3e11eb){if(_0x3e11eb[_0x33de('0x3e')]!==_0x33de('0x3f')){var _0x1126b6={};_0x1126b6[_0x3e11eb['name']]={'$like':'%'+_0x3f22fb[_0x33de('0x32')][_0x33de('0x3c')]+'%'};return _0x1126b6;}})});}_0x59bc3b=_[_0x33de('0x3d')]({},_0x59bc3b,_0x3f22fb[_0x33de('0x40')]);var _0x23c2c4={'where':_0x59bc3b[_0x33de('0x39')]};return db['WhatsappQueueReport'][_0x33de('0x1e')](_0x23c2c4)['then'](function(_0x13dedd){_0x2755e6[_0x33de('0x1e')]=_0x13dedd;if(_0x3f22fb['query'][_0x33de('0x41')]){_0x59bc3b[_0x33de('0x42')]=[{'all':!![]}];}return db[_0x33de('0x2c')][_0x33de('0x43')](_0x59bc3b);})[_0x33de('0x25')](function(_0x4251e3){_0x2755e6[_0x33de('0x44')]=_0x4251e3;return _0x2755e6;})[_0x33de('0x25')](respondWithFilteredResult(_0x1b4703,_0x59bc3b))[_0x33de('0x45')](handleError(_0x1b4703,null));};exports['show']=function(_0x5101b9,_0x417d9b){var _0x1f75f7={'raw':!![],'where':{'id':_0x5101b9[_0x33de('0x46')]['id']}},_0x20d04f={};_0x20d04f['model']=_[_0x33de('0x31')](db['WhatsappQueueReport']['rawAttributes']);_0x20d04f[_0x33de('0x32')]=_[_0x33de('0x31')](_0x5101b9[_0x33de('0x32')]);_0x20d04f[_0x33de('0x3a')]=_[_0x33de('0x47')](_0x20d04f[_0x33de('0x30')],_0x20d04f[_0x33de('0x32')]);_0x1f75f7['attributes']=_[_0x33de('0x47')](_0x20d04f['model'],qs[_0x33de('0x34')](_0x5101b9['query'][_0x33de('0x34')]));_0x1f75f7[_0x33de('0x33')]=_0x1f75f7['attributes'][_0x33de('0x35')]?_0x1f75f7[_0x33de('0x33')]:_0x20d04f[_0x33de('0x30')];if(_0x5101b9['query']['includeAll']){_0x1f75f7[_0x33de('0x42')]=[{'all':!![]}];}_0x1f75f7=_[_0x33de('0x3d')]({},_0x1f75f7,_0x5101b9['options']);return db['WhatsappQueueReport'][_0x33de('0x48')](_0x1f75f7)['then'](handleEntityNotFound(_0x417d9b,null))['then'](respondWithResult(_0x417d9b,null))['catch'](handleError(_0x417d9b,null));};exports[_0x33de('0x49')]=function(_0x2d6001,_0x9a816c){return db[_0x33de('0x2c')]['create'](_0x2d6001['body'],{})[_0x33de('0x25')](respondWithResult(_0x9a816c,0xc9))[_0x33de('0x45')](handleError(_0x9a816c,null));};exports['update']=function(_0x1d016b,_0xc23633){if(_0x1d016b[_0x33de('0x4a')]['id']){delete _0x1d016b[_0x33de('0x4a')]['id'];}return db[_0x33de('0x2c')]['find']({'where':{'id':_0x1d016b[_0x33de('0x46')]['id']}})[_0x33de('0x25')](handleEntityNotFound(_0xc23633,null))['then'](saveUpdates(_0x1d016b[_0x33de('0x4a')],null))[_0x33de('0x25')](respondWithResult(_0xc23633,null))[_0x33de('0x45')](handleError(_0xc23633,null));};exports[_0x33de('0x4b')]=function(_0xbbb376,_0x40f1b7){return db[_0x33de('0x2c')][_0x33de('0x48')]({'where':{'id':_0xbbb376[_0x33de('0x46')]['id']}})[_0x33de('0x25')](handleEntityNotFound(_0x40f1b7,null))['then'](removeEntity(_0x40f1b7,null))[_0x33de('0x45')](handleError(_0x40f1b7,null));};exports[_0x33de('0x4c')]=function(_0x2e2cd7,_0x464502){return db[_0x33de('0x2c')][_0x33de('0x4c')]()[_0x33de('0x25')](respondWithResult(_0x464502,null))['catch'](handleError(_0x464502,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 306559f..0d1a3e0 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 _0xebe4=['bluebird','request-promise','path','rimraf','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger','api','moment'];(function(_0x20aa7b,_0x342186){var _0x4c7c18=function(_0x3d3c31){while(--_0x3d3c31){_0x20aa7b['push'](_0x20aa7b['shift']());}};_0x4c7c18(++_0x342186);}(_0xebe4,0x194));var _0x4ebe=function(_0x2ebc40,_0x58293a){_0x2ebc40=_0x2ebc40-0x0;var _0x3ac10f=_0xebe4[_0x2ebc40];return _0x3ac10f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ebe('0x0'))(_0x4ebe('0x1'));var moment=require(_0x4ebe('0x2'));var BPromise=require(_0x4ebe('0x3'));var rp=require(_0x4ebe('0x4'));var fs=require('fs');var path=require(_0x4ebe('0x5'));var rimraf=require(_0x4ebe('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x4ebe('0x7')]=function(_0x148509,_0x13f517){return _0x148509['define'](_0x4ebe('0x8'),attributes,{'tableName':_0x4ebe('0x9'),'paranoid':![],'indexes':[{'name':_0x4ebe('0xa'),'fields':[_0x4ebe('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28d8=['moment','bluebird','request-promise','path','exports','define','report_whatsapp_queue','uniqueid','lodash','util','api'];(function(_0x1844ed,_0x28db6a){var _0x5edbc0=function(_0x417f3e){while(--_0x417f3e){_0x1844ed['push'](_0x1844ed['shift']());}};_0x5edbc0(++_0x28db6a);}(_0x28d8,0xef));var _0x828d=function(_0x20fb36,_0x4891cf){_0x20fb36=_0x20fb36-0x0;var _0x53040c=_0x28d8[_0x20fb36];return _0x53040c;};'use strict';var _=require(_0x828d('0x0'));var util=require(_0x828d('0x1'));var logger=require('../../config/logger')(_0x828d('0x2'));var moment=require(_0x828d('0x3'));var BPromise=require(_0x828d('0x4'));var rp=require(_0x828d('0x5'));var fs=require('fs');var path=require(_0x828d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x828d('0x7')]=function(_0x4d7afc,_0x5cbbd6){return _0x4d7afc[_0x828d('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x828d('0x9'),'paranoid':![],'indexes':[{'name':_0x828d('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 70084de..712df57 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 _0x7694=['stringify','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','debug','catch','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1db2e6,_0x1cf62e){var _0x140211=function(_0x2e290e){while(--_0x2e290e){_0x1db2e6['push'](_0x1db2e6['shift']());}};_0x140211(++_0x1cf62e);}(_0x7694,0x88));var _0x4769=function(_0x15079a,_0xc12b1a){_0x15079a=_0x15079a-0x0;var _0x1daf40=_0x7694[_0x15079a];return _0x1daf40;};'use strict';var _=require(_0x4769('0x0'));var util=require('util');var moment=require(_0x4769('0x1'));var BPromise=require('bluebird');var rs=require(_0x4769('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4769('0x3'))['db'];var utils=require(_0x4769('0x4'));var logger=require(_0x4769('0x5'))(_0x4769('0x6'));var config=require(_0x4769('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4769('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b3cd6,_0x500c45,_0x309f9a){return new BPromise(function(_0x390810,_0x174c07){return client['request'](_0x3b3cd6,_0x309f9a)[_0x4769('0x9')](function(_0x427205){logger[_0x4769('0xa')](_0x4769('0xb'),_0x500c45,_0x4769('0xc'));logger['debug'](_0x4769('0xd'),_0x500c45,_0x4769('0xc'),JSON[_0x4769('0xe')](_0x427205));if(_0x427205[_0x4769('0xf')]){if(_0x427205['error']['code']===0x1f4){logger[_0x4769('0xf')](_0x4769('0xb'),_0x500c45,_0x427205['error'][_0x4769('0x10')]);return _0x174c07(_0x427205[_0x4769('0xf')]['message']);}logger[_0x4769('0xf')](_0x4769('0xb'),_0x500c45,_0x427205['error'][_0x4769('0x10')]);return _0x390810(_0x427205[_0x4769('0xf')][_0x4769('0x10')]);}else{logger[_0x4769('0xa')]('WhatsappQueueReport,\x20%s,\x20%s',_0x500c45,_0x4769('0xc'));_0x390810(_0x427205[_0x4769('0x11')][_0x4769('0x10')]);}})['catch'](function(_0x323d77){logger['error'](_0x4769('0xb'),_0x500c45,_0x323d77);_0x174c07(_0x323d77);});});}exports[_0x4769('0x12')]=function(_0x3b224d){var _0x38dd25=this;return new Promise(function(_0x547f72,_0x349c5f){return db[_0x4769('0x13')]['create'](_0x3b224d[_0x4769('0x14')],{'raw':_0x3b224d[_0x4769('0x15')]?_0x3b224d[_0x4769('0x15')][_0x4769('0x16')]===undefined?!![]:![]:!![]})[_0x4769('0x9')](function(_0x3906a8){logger['info'](_0x4769('0x12'),_0x3b224d);logger[_0x4769('0x17')](_0x4769('0x12'),_0x3b224d,JSON['stringify'](_0x3906a8));_0x547f72(_0x3906a8);})[_0x4769('0x18')](function(_0x18fa8a){logger[_0x4769('0xf')](_0x4769('0x12'),_0x18fa8a['message'],_0x3b224d);_0x349c5f(_0x38dd25[_0x4769('0xf')](0x1f4,_0x18fa8a[_0x4769('0x10')]));});});};exports[_0x4769('0x19')]=function(_0x4444b2){var _0x292e81=this;return new Promise(function(_0x141b80,_0x23fa4d){return db[_0x4769('0x13')][_0x4769('0x1a')](_0x4444b2[_0x4769('0x14')],{'raw':_0x4444b2[_0x4769('0x15')]?_0x4444b2[_0x4769('0x15')][_0x4769('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4444b2['options']?_0x4444b2[_0x4769('0x15')][_0x4769('0x1b')]||null:null,'attributes':_0x4444b2['options']?_0x4444b2[_0x4769('0x15')][_0x4769('0x1c')]||null:null,'limit':_0x4444b2[_0x4769('0x15')]?_0x4444b2[_0x4769('0x15')][_0x4769('0x1d')]||null:null})[_0x4769('0x9')](function(_0x326e70){logger[_0x4769('0xa')]('UpdateWhatsappQueueReport',_0x4444b2);logger[_0x4769('0x17')](_0x4769('0x19'),_0x4444b2,JSON[_0x4769('0xe')](_0x326e70));_0x141b80(_0x326e70);})[_0x4769('0x18')](function(_0x60bc19){logger[_0x4769('0xf')](_0x4769('0x19'),_0x60bc19['message'],_0x4444b2);_0x23fa4d(_0x292e81[_0x4769('0xf')](0x1f4,_0x60bc19[_0x4769('0x10')]));});});}; \ No newline at end of file +var _0x6095=['stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','create','body','options','info','debug','CreateWhatsappQueueReport','WhatsappQueueReport','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6095,0x17d));var _0x5609=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x6095[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x5609('0x0'));var util=require(_0x5609('0x1'));var moment=require('moment');var BPromise=require(_0x5609('0x2'));var rs=require(_0x5609('0x3'));var fs=require('fs');var Redis=require(_0x5609('0x4'));var db=require(_0x5609('0x5'))['db'];var utils=require(_0x5609('0x6'));var logger=require(_0x5609('0x7'))('rpc');var config=require(_0x5609('0x8'));var jayson=require(_0x5609('0x9'));var client=jayson[_0x5609('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27a198,_0x12c621,_0x54b471){return new BPromise(function(_0x468634,_0x392e03){return client[_0x5609('0xb')](_0x27a198,_0x54b471)[_0x5609('0xc')](function(_0x4669a2){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x12c621,_0x5609('0xd'));logger['debug'](_0x5609('0xe'),_0x12c621,'request\x20sent',JSON[_0x5609('0xf')](_0x4669a2));if(_0x4669a2[_0x5609('0x10')]){if(_0x4669a2['error'][_0x5609('0x11')]===0x1f4){logger[_0x5609('0x10')](_0x5609('0x12'),_0x12c621,_0x4669a2[_0x5609('0x10')][_0x5609('0x13')]);return _0x392e03(_0x4669a2[_0x5609('0x10')][_0x5609('0x13')]);}logger[_0x5609('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x12c621,_0x4669a2[_0x5609('0x10')][_0x5609('0x13')]);return _0x468634(_0x4669a2[_0x5609('0x10')]['message']);}else{logger['info'](_0x5609('0x12'),_0x12c621,_0x5609('0xd'));_0x468634(_0x4669a2[_0x5609('0x14')][_0x5609('0x13')]);}})[_0x5609('0x15')](function(_0x516156){logger[_0x5609('0x10')](_0x5609('0x12'),_0x12c621,_0x516156);_0x392e03(_0x516156);});});}exports['CreateWhatsappQueueReport']=function(_0x163a2f){var _0x39156f=this;return new Promise(function(_0x450802,_0xc087e){return db['WhatsappQueueReport'][_0x5609('0x16')](_0x163a2f[_0x5609('0x17')],{'raw':_0x163a2f[_0x5609('0x18')]?_0x163a2f[_0x5609('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x5609('0xc')](function(_0x518eef){logger[_0x5609('0x19')]('CreateWhatsappQueueReport',_0x163a2f);logger[_0x5609('0x1a')](_0x5609('0x1b'),_0x163a2f,JSON[_0x5609('0xf')](_0x518eef));_0x450802(_0x518eef);})[_0x5609('0x15')](function(_0x3586cf){logger['error'](_0x5609('0x1b'),_0x3586cf[_0x5609('0x13')],_0x163a2f);_0xc087e(_0x39156f[_0x5609('0x10')](0x1f4,_0x3586cf[_0x5609('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x48de65){var _0x6ebc5=this;return new Promise(function(_0x3f2a9b,_0xc37746){return db[_0x5609('0x1c')]['update'](_0x48de65[_0x5609('0x17')],{'raw':_0x48de65[_0x5609('0x18')]?_0x48de65['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48de65[_0x5609('0x18')]?_0x48de65['options'][_0x5609('0x1d')]||null:null,'attributes':_0x48de65[_0x5609('0x18')]?_0x48de65[_0x5609('0x18')][_0x5609('0x1e')]||null:null,'limit':_0x48de65[_0x5609('0x18')]?_0x48de65[_0x5609('0x18')][_0x5609('0x1f')]||null:null})[_0x5609('0xc')](function(_0x495ef0){logger[_0x5609('0x19')](_0x5609('0x20'),_0x48de65);logger[_0x5609('0x1a')]('UpdateWhatsappQueueReport',_0x48de65,JSON[_0x5609('0xf')](_0x495ef0));_0x3f2a9b(_0x495ef0);})[_0x5609('0x15')](function(_0x15aa76){logger['error'](_0x5609('0x20'),_0x15aa76[_0x5609('0x13')],_0x48de65);_0xc37746(_0x6ebc5['error'](0x1f4,_0x15aa76['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4ddde94..c3be8c7 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 _0xb753=['show','post','create','put','update','delete','destroy','exports','multer','path','Router','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x539af7,_0x23dea2){var _0x4f201a=function(_0x43ea34){while(--_0x43ea34){_0x539af7['push'](_0x539af7['shift']());}};_0x4f201a(++_0x23dea2);}(_0xb753,0x112));var _0x3b75=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0xb753[_0x874cf1];return _0x233579;};'use strict';var multer=require(_0x3b75('0x0'));var util=require('util');var path=require(_0x3b75('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3b75('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b75('0x3'));var controller=require(_0x3b75('0x4'));router[_0x3b75('0x5')]('/',auth[_0x3b75('0x6')](),controller[_0x3b75('0x7')]);router[_0x3b75('0x5')](_0x3b75('0x8'),auth['isAuthenticated'](),controller[_0x3b75('0x9')]);router[_0x3b75('0x5')](_0x3b75('0xa'),auth['isAuthenticated'](),controller[_0x3b75('0xb')]);router[_0x3b75('0xc')]('/',auth[_0x3b75('0x6')](),controller[_0x3b75('0xd')]);router[_0x3b75('0xe')](_0x3b75('0xa'),auth[_0x3b75('0x6')](),controller[_0x3b75('0xf')]);router[_0x3b75('0x10')](_0x3b75('0xa'),auth[_0x3b75('0x6')](),controller[_0x3b75('0x11')]);module[_0x3b75('0x12')]=router; \ No newline at end of file +var _0xc21b=['post','put','destroy','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x140bc2,_0x5757c0){var _0x135824=function(_0x495b16){while(--_0x495b16){_0x140bc2['push'](_0x140bc2['shift']());}};_0x135824(++_0x5757c0);}(_0xc21b,0x1b3));var _0xbc21=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xc21b[_0x1fd675];return _0x16b554;};'use strict';var multer=require(_0xbc21('0x0'));var util=require('util');var path=require(_0xbc21('0x1'));var timeout=require('connect-timeout');var express=require(_0xbc21('0x2'));var router=express['Router']();var fs_extra=require(_0xbc21('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbc21('0x4'));var config=require(_0xbc21('0x5'));var controller=require(_0xbc21('0x6'));router[_0xbc21('0x7')]('/',auth[_0xbc21('0x8')](),controller['index']);router[_0xbc21('0x7')](_0xbc21('0x9'),auth[_0xbc21('0x8')](),controller[_0xbc21('0xa')]);router[_0xbc21('0x7')](_0xbc21('0xb'),auth[_0xbc21('0x8')](),controller[_0xbc21('0xc')]);router[_0xbc21('0xd')]('/',auth[_0xbc21('0x8')](),controller['create']);router[_0xbc21('0xe')](_0xbc21('0xb'),auth[_0xbc21('0x8')](),controller['update']);router['delete'](_0xbc21('0xb'),auth[_0xbc21('0x8')](),controller[_0xbc21('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 9f7ca4c..f2d0606 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 _0xd48a=['agent','queue','DATE','sequelize','STRING','ENUM','account'];(function(_0x2c2c63,_0x4239f9){var _0x55cefe=function(_0x45799c){while(--_0x45799c){_0x2c2c63['push'](_0x2c2c63['shift']());}};_0x55cefe(++_0x4239f9);}(_0xd48a,0x96));var _0xad48=function(_0x199392,_0xd6d352){_0x199392=_0x199392-0x0;var _0x1d62a5=_0xd48a[_0x199392];return _0x1d62a5;};'use strict';var Sequelize=require(_0xad48('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xad48('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xad48('0x2')](_0xad48('0x3'),_0xad48('0x4'),_0xad48('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xad48('0x6')]}}; \ No newline at end of file +var _0x2f56=['exports','STRING','ENUM','agent','queue','DATE','sequelize'];(function(_0x190e77,_0x433ee5){var _0x2d39c5=function(_0x297baf){while(--_0x297baf){_0x190e77['push'](_0x190e77['shift']());}};_0x2d39c5(++_0x433ee5);}(_0x2f56,0xb5));var _0x62f5=function(_0x41c91d,_0x1e1904){_0x41c91d=_0x41c91d-0x0;var _0x5dd81f=_0x2f56[_0x41c91d];return _0x5dd81f;};'use strict';var Sequelize=require(_0x62f5('0x0'));module[_0x62f5('0x1')]={'uniqueid':{'type':Sequelize[_0x62f5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x62f5('0x3')]('account',_0x62f5('0x4'),_0x62f5('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x62f5('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f89e666..a1c7a0a 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 _0xda27=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','sendStatus','error','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0xda27,0x1cf));var _0x7da2=function(_0x4956f2,_0xb602ca){_0x4956f2=_0x4956f2-0x0;var _0x1da579=_0xda27[_0x4956f2];return _0x1da579;};'use strict';var emlformat=require(_0x7da2('0x0'));var rimraf=require(_0x7da2('0x1'));var zipdir=require(_0x7da2('0x2'));var jsonpatch=require(_0x7da2('0x3'));var rp=require(_0x7da2('0x4'));var moment=require(_0x7da2('0x5'));var BPromise=require(_0x7da2('0x6'));var Mustache=require('mustache');var util=require(_0x7da2('0x7'));var path=require(_0x7da2('0x8'));var sox=require(_0x7da2('0x9'));var csv=require('to-csv');var ejs=require(_0x7da2('0xa'));var fs=require('fs');var fs_extra=require(_0x7da2('0xb'));var _=require(_0x7da2('0xc'));var squel=require('squel');var crypto=require(_0x7da2('0xd'));var jsforce=require(_0x7da2('0xe'));var deskjs=require(_0x7da2('0xf'));var toCsv=require(_0x7da2('0x10'));var querystring=require(_0x7da2('0x11'));var Papa=require(_0x7da2('0x12'));var Redis=require(_0x7da2('0x13'));var authService=require(_0x7da2('0x14'));var qs=require(_0x7da2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7da2('0x16'));var logger=require(_0x7da2('0x17'))(_0x7da2('0x18'));var utils=require(_0x7da2('0x19'));var config=require(_0x7da2('0x1a'));var licenseUtil=require(_0x7da2('0x1b'));var db=require(_0x7da2('0x1c'))['db'];function respondWithStatusCode(_0x5ef6c8,_0x584711){_0x584711=_0x584711||0xcc;return function(_0x458131){if(_0x458131){return _0x5ef6c8['sendStatus'](_0x584711);}return _0x5ef6c8['status'](_0x584711)['end']();};}function respondWithResult(_0x5c87a9,_0xb206ca){_0xb206ca=_0xb206ca||0xc8;return function(_0x58ecf3){if(_0x58ecf3){return _0x5c87a9[_0x7da2('0x1d')](_0xb206ca)[_0x7da2('0x1e')](_0x58ecf3);}};}function respondWithFilteredResult(_0x221c79,_0x564fec){return function(_0x4d250a){if(_0x4d250a){var _0x1b8a8a=typeof _0x564fec[_0x7da2('0x1f')]===_0x7da2('0x20')&&typeof _0x564fec[_0x7da2('0x21')]===_0x7da2('0x20');var _0x52a51b=_0x4d250a['count'];var _0x211bcf=_0x1b8a8a?0x0:_0x564fec['offset'];var _0x40e307=_0x1b8a8a?_0x4d250a[_0x7da2('0x22')]:_0x564fec[_0x7da2('0x1f')]+_0x564fec[_0x7da2('0x21')];var _0x30134a;if(_0x40e307>=_0x52a51b){_0x40e307=_0x52a51b;_0x30134a=0xc8;}else{_0x30134a=0xce;}_0x221c79[_0x7da2('0x1d')](_0x30134a);return _0x221c79['set'](_0x7da2('0x23'),_0x211bcf+'-'+_0x40e307+'/'+_0x52a51b)['json'](_0x4d250a);}return null;};}function patchUpdates(_0x59fa78){return function(_0x53f10f){try{jsonpatch['apply'](_0x53f10f,_0x59fa78,!![]);}catch(_0x421fdf){return BPromise[_0x7da2('0x24')](_0x421fdf);}return _0x53f10f[_0x7da2('0x25')]();};}function saveUpdates(_0x1071a2,_0x118734){return function(_0x391d29){if(_0x391d29){return _0x391d29[_0x7da2('0x26')](_0x1071a2)['then'](function(_0x1eefc4){return _0x1eefc4;});}return null;};}function removeEntity(_0x18d41c,_0x316f2f){return function(_0x735454){if(_0x735454){return _0x735454['destroy']()[_0x7da2('0x27')](function(){_0x18d41c[_0x7da2('0x1d')](0xcc)[_0x7da2('0x28')]();});}};}function handleEntityNotFound(_0x4926e7,_0x34dfc0){return function(_0x3e5628){if(!_0x3e5628){_0x4926e7[_0x7da2('0x29')](0x194);}return _0x3e5628;};}function handleError(_0x2a422c,_0x2896fc){_0x2896fc=_0x2896fc||0x1f4;return function(_0x2e6c36){logger[_0x7da2('0x2a')](_0x2e6c36['stack']);if(_0x2e6c36[_0x7da2('0x2b')]){delete _0x2e6c36[_0x7da2('0x2b')];}_0x2a422c[_0x7da2('0x1d')](_0x2896fc)[_0x7da2('0x2c')](_0x2e6c36);};}exports[_0x7da2('0x2d')]=function(_0x31d41f,_0x42e4f2){var _0x490378={},_0x1e715c={},_0x32d5aa={'count':0x0,'rows':[]};var _0x9acbc4=_[_0x7da2('0x2e')](db[_0x7da2('0x2f')]['rawAttributes'],function(_0x513254){return{'name':_0x513254[_0x7da2('0x30')],'type':_0x513254[_0x7da2('0x31')][_0x7da2('0x32')]};});_0x1e715c[_0x7da2('0x33')]=_[_0x7da2('0x2e')](_0x9acbc4,_0x7da2('0x2b'));_0x1e715c[_0x7da2('0x34')]=_[_0x7da2('0x35')](_0x31d41f[_0x7da2('0x34')]);_0x1e715c[_0x7da2('0x36')]=_[_0x7da2('0x37')](_0x1e715c[_0x7da2('0x33')],_0x1e715c[_0x7da2('0x34')]);_0x490378[_0x7da2('0x38')]=_[_0x7da2('0x37')](_0x1e715c[_0x7da2('0x33')],qs[_0x7da2('0x39')](_0x31d41f[_0x7da2('0x34')][_0x7da2('0x39')]));_0x490378[_0x7da2('0x38')]=_0x490378[_0x7da2('0x38')][_0x7da2('0x3a')]?_0x490378[_0x7da2('0x38')]:_0x1e715c[_0x7da2('0x33')];if(!_0x31d41f[_0x7da2('0x34')][_0x7da2('0x3b')](_0x7da2('0x3c'))){_0x490378[_0x7da2('0x21')]=qs[_0x7da2('0x21')](_0x31d41f['query'][_0x7da2('0x21')]);_0x490378[_0x7da2('0x1f')]=qs[_0x7da2('0x1f')](_0x31d41f[_0x7da2('0x34')][_0x7da2('0x1f')]);}_0x490378[_0x7da2('0x3d')]=qs['sort'](_0x31d41f[_0x7da2('0x34')][_0x7da2('0x3e')]);_0x490378[_0x7da2('0x3f')]=qs[_0x7da2('0x36')](_[_0x7da2('0x40')](_0x31d41f[_0x7da2('0x34')],_0x1e715c[_0x7da2('0x36')]),_0x9acbc4);if(_0x31d41f[_0x7da2('0x34')][_0x7da2('0x41')]){_0x490378[_0x7da2('0x3f')]=_[_0x7da2('0x42')](_0x490378[_0x7da2('0x3f')],{'$or':_['map'](_0x9acbc4,function(_0x25f583){if(_0x25f583[_0x7da2('0x31')]!==_0x7da2('0x43')){var _0x11edb3={};_0x11edb3[_0x25f583['name']]={'$like':'%'+_0x31d41f[_0x7da2('0x34')][_0x7da2('0x41')]+'%'};return _0x11edb3;}})});}_0x490378=_[_0x7da2('0x42')]({},_0x490378,_0x31d41f[_0x7da2('0x44')]);var _0x4b50ee={'where':_0x490378[_0x7da2('0x3f')]};return db[_0x7da2('0x2f')]['count'](_0x4b50ee)[_0x7da2('0x27')](function(_0x122f98){_0x32d5aa[_0x7da2('0x22')]=_0x122f98;if(_0x31d41f[_0x7da2('0x34')][_0x7da2('0x45')]){_0x490378[_0x7da2('0x46')]=[{'all':!![]}];}return db[_0x7da2('0x2f')]['findAll'](_0x490378);})[_0x7da2('0x27')](function(_0x2eec60){_0x32d5aa[_0x7da2('0x47')]=_0x2eec60;return _0x32d5aa;})['then'](respondWithFilteredResult(_0x42e4f2,_0x490378))['catch'](handleError(_0x42e4f2,null));};exports['show']=function(_0x16f399,_0x4db764){var _0x9fcf92={'raw':!![],'where':{'id':_0x16f399[_0x7da2('0x48')]['id']}},_0x24fb50={};_0x24fb50['model']=_[_0x7da2('0x35')](db[_0x7da2('0x2f')][_0x7da2('0x49')]);_0x24fb50[_0x7da2('0x34')]=_['keys'](_0x16f399[_0x7da2('0x34')]);_0x24fb50[_0x7da2('0x36')]=_[_0x7da2('0x37')](_0x24fb50['model'],_0x24fb50[_0x7da2('0x34')]);_0x9fcf92['attributes']=_['intersection'](_0x24fb50[_0x7da2('0x33')],qs[_0x7da2('0x39')](_0x16f399[_0x7da2('0x34')]['fields']));_0x9fcf92['attributes']=_0x9fcf92[_0x7da2('0x38')][_0x7da2('0x3a')]?_0x9fcf92[_0x7da2('0x38')]:_0x24fb50[_0x7da2('0x33')];if(_0x16f399['query'][_0x7da2('0x45')]){_0x9fcf92[_0x7da2('0x46')]=[{'all':!![]}];}_0x9fcf92=_['merge']({},_0x9fcf92,_0x16f399['options']);return db['WhatsappTransferReport'][_0x7da2('0x4a')](_0x9fcf92)[_0x7da2('0x27')](handleEntityNotFound(_0x4db764,null))[_0x7da2('0x27')](respondWithResult(_0x4db764,null))[_0x7da2('0x4b')](handleError(_0x4db764,null));};exports[_0x7da2('0x4c')]=function(_0x53be03,_0x4785da){return db[_0x7da2('0x2f')][_0x7da2('0x4c')](_0x53be03[_0x7da2('0x4d')],{})[_0x7da2('0x27')](respondWithResult(_0x4785da,0xc9))[_0x7da2('0x4b')](handleError(_0x4785da,null));};exports[_0x7da2('0x26')]=function(_0x4fbc13,_0x4cf84d){if(_0x4fbc13['body']['id']){delete _0x4fbc13[_0x7da2('0x4d')]['id'];}return db['WhatsappTransferReport'][_0x7da2('0x4a')]({'where':{'id':_0x4fbc13[_0x7da2('0x48')]['id']}})[_0x7da2('0x27')](handleEntityNotFound(_0x4cf84d,null))[_0x7da2('0x27')](saveUpdates(_0x4fbc13['body'],null))[_0x7da2('0x27')](respondWithResult(_0x4cf84d,null))[_0x7da2('0x4b')](handleError(_0x4cf84d,null));};exports[_0x7da2('0x4e')]=function(_0x1c3719,_0x22d5e2){return db[_0x7da2('0x2f')][_0x7da2('0x4a')]({'where':{'id':_0x1c3719[_0x7da2('0x48')]['id']}})[_0x7da2('0x27')](handleEntityNotFound(_0x22d5e2,null))['then'](removeEntity(_0x22d5e2,null))[_0x7da2('0x4b')](handleError(_0x22d5e2,null));};exports['describe']=function(_0x10416f,_0x582add){return db[_0x7da2('0x2f')][_0x7da2('0x4f')]()[_0x7da2('0x27')](respondWithResult(_0x582add,null))[_0x7da2('0x4b')](handleError(_0x582add,null));}; \ No newline at end of file +var _0xb6f3=['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','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','length','nolimit','order','sort','pick','merge','where','type','includeAll','WhatsappTransferReport','findAll','rows','catch','show','keys','fields','include','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x12fe4a,_0x1fec10){var _0x32b496=function(_0x59bee2){while(--_0x59bee2){_0x12fe4a['push'](_0x12fe4a['shift']());}};_0x32b496(++_0x1fec10);}(_0xb6f3,0x12a));var _0x3b6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb6f3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3b6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b6f('0x1'));var jsonpatch=require(_0x3b6f('0x2'));var rp=require(_0x3b6f('0x3'));var moment=require(_0x3b6f('0x4'));var BPromise=require(_0x3b6f('0x5'));var Mustache=require(_0x3b6f('0x6'));var util=require(_0x3b6f('0x7'));var path=require(_0x3b6f('0x8'));var sox=require('sox');var csv=require(_0x3b6f('0x9'));var ejs=require(_0x3b6f('0xa'));var fs=require('fs');var fs_extra=require(_0x3b6f('0xb'));var _=require(_0x3b6f('0xc'));var squel=require(_0x3b6f('0xd'));var crypto=require(_0x3b6f('0xe'));var jsforce=require(_0x3b6f('0xf'));var deskjs=require(_0x3b6f('0x10'));var toCsv=require(_0x3b6f('0x9'));var querystring=require('querystring');var Papa=require(_0x3b6f('0x11'));var Redis=require(_0x3b6f('0x12'));var authService=require(_0x3b6f('0x13'));var qs=require(_0x3b6f('0x14'));var as=require(_0x3b6f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b6f('0x16'))(_0x3b6f('0x17'));var utils=require(_0x3b6f('0x18'));var config=require(_0x3b6f('0x19'));var licenseUtil=require(_0x3b6f('0x1a'));var db=require(_0x3b6f('0x1b'))['db'];function respondWithStatusCode(_0x83193e,_0x319b8d){_0x319b8d=_0x319b8d||0xcc;return function(_0x20ec95){if(_0x20ec95){return _0x83193e[_0x3b6f('0x1c')](_0x319b8d);}return _0x83193e['status'](_0x319b8d)[_0x3b6f('0x1d')]();};}function respondWithResult(_0x32d01e,_0x4c55c4){_0x4c55c4=_0x4c55c4||0xc8;return function(_0x2142f4){if(_0x2142f4){return _0x32d01e[_0x3b6f('0x1e')](_0x4c55c4)[_0x3b6f('0x1f')](_0x2142f4);}};}function respondWithFilteredResult(_0x34626a,_0xa2a93e){return function(_0x5b4b03){if(_0x5b4b03){var _0x2e4e3c=typeof _0xa2a93e[_0x3b6f('0x20')]===_0x3b6f('0x21')&&typeof _0xa2a93e['limit']===_0x3b6f('0x21');var _0x7f0f2c=_0x5b4b03[_0x3b6f('0x22')];var _0x1a08ee=_0x2e4e3c?0x0:_0xa2a93e['offset'];var _0x308f94=_0x2e4e3c?_0x5b4b03['count']:_0xa2a93e[_0x3b6f('0x20')]+_0xa2a93e[_0x3b6f('0x23')];var _0x207055;if(_0x308f94>=_0x7f0f2c){_0x308f94=_0x7f0f2c;_0x207055=0xc8;}else{_0x207055=0xce;}_0x34626a['status'](_0x207055);return _0x34626a[_0x3b6f('0x24')]('Content-Range',_0x1a08ee+'-'+_0x308f94+'/'+_0x7f0f2c)[_0x3b6f('0x1f')](_0x5b4b03);}return null;};}function patchUpdates(_0xd42561){return function(_0x3a583f){try{jsonpatch[_0x3b6f('0x25')](_0x3a583f,_0xd42561,!![]);}catch(_0x11b750){return BPromise['reject'](_0x11b750);}return _0x3a583f['save']();};}function saveUpdates(_0x115e2e,_0x46d0d6){return function(_0x90d9ff){if(_0x90d9ff){return _0x90d9ff[_0x3b6f('0x26')](_0x115e2e)[_0x3b6f('0x27')](function(_0x54a055){return _0x54a055;});}return null;};}function removeEntity(_0x3a7f06,_0x2f34a9){return function(_0x2e6619){if(_0x2e6619){return _0x2e6619[_0x3b6f('0x28')]()[_0x3b6f('0x27')](function(){_0x3a7f06[_0x3b6f('0x1e')](0xcc)[_0x3b6f('0x1d')]();});}};}function handleEntityNotFound(_0x2c7daa,_0x5ca62e){return function(_0x4a6cce){if(!_0x4a6cce){_0x2c7daa['sendStatus'](0x194);}return _0x4a6cce;};}function handleError(_0x1070bb,_0x2a348c){_0x2a348c=_0x2a348c||0x1f4;return function(_0x41a52f){logger[_0x3b6f('0x29')](_0x41a52f[_0x3b6f('0x2a')]);if(_0x41a52f[_0x3b6f('0x2b')]){delete _0x41a52f[_0x3b6f('0x2b')];}_0x1070bb[_0x3b6f('0x1e')](_0x2a348c)[_0x3b6f('0x2c')](_0x41a52f);};}exports[_0x3b6f('0x2d')]=function(_0x4568bd,_0x2a43e5){var _0x4ab7d0={},_0x5bb6e3={},_0x2dab4c={'count':0x0,'rows':[]};var _0x5b4e67=_[_0x3b6f('0x2e')](db['WhatsappTransferReport'][_0x3b6f('0x2f')],function(_0x566ef1){return{'name':_0x566ef1[_0x3b6f('0x30')],'type':_0x566ef1['type'][_0x3b6f('0x31')]};});_0x5bb6e3[_0x3b6f('0x32')]=_[_0x3b6f('0x2e')](_0x5b4e67,_0x3b6f('0x2b'));_0x5bb6e3[_0x3b6f('0x33')]=_['keys'](_0x4568bd[_0x3b6f('0x33')]);_0x5bb6e3[_0x3b6f('0x34')]=_['intersection'](_0x5bb6e3[_0x3b6f('0x32')],_0x5bb6e3['query']);_0x4ab7d0[_0x3b6f('0x35')]=_[_0x3b6f('0x36')](_0x5bb6e3['model'],qs['fields'](_0x4568bd['query']['fields']));_0x4ab7d0[_0x3b6f('0x35')]=_0x4ab7d0[_0x3b6f('0x35')][_0x3b6f('0x37')]?_0x4ab7d0['attributes']:_0x5bb6e3['model'];if(!_0x4568bd[_0x3b6f('0x33')]['hasOwnProperty'](_0x3b6f('0x38'))){_0x4ab7d0['limit']=qs[_0x3b6f('0x23')](_0x4568bd[_0x3b6f('0x33')]['limit']);_0x4ab7d0['offset']=qs[_0x3b6f('0x20')](_0x4568bd[_0x3b6f('0x33')][_0x3b6f('0x20')]);}_0x4ab7d0[_0x3b6f('0x39')]=qs[_0x3b6f('0x3a')](_0x4568bd[_0x3b6f('0x33')]['sort']);_0x4ab7d0['where']=qs[_0x3b6f('0x34')](_[_0x3b6f('0x3b')](_0x4568bd[_0x3b6f('0x33')],_0x5bb6e3['filters']),_0x5b4e67);if(_0x4568bd['query']['filter']){_0x4ab7d0['where']=_[_0x3b6f('0x3c')](_0x4ab7d0[_0x3b6f('0x3d')],{'$or':_[_0x3b6f('0x2e')](_0x5b4e67,function(_0x58785d){if(_0x58785d[_0x3b6f('0x3e')]!=='VIRTUAL'){var _0x3c51ef={};_0x3c51ef[_0x58785d['name']]={'$like':'%'+_0x4568bd[_0x3b6f('0x33')]['filter']+'%'};return _0x3c51ef;}})});}_0x4ab7d0=_[_0x3b6f('0x3c')]({},_0x4ab7d0,_0x4568bd['options']);var _0x279662={'where':_0x4ab7d0['where']};return db['WhatsappTransferReport'][_0x3b6f('0x22')](_0x279662)[_0x3b6f('0x27')](function(_0x3c2c60){_0x2dab4c[_0x3b6f('0x22')]=_0x3c2c60;if(_0x4568bd[_0x3b6f('0x33')][_0x3b6f('0x3f')]){_0x4ab7d0['include']=[{'all':!![]}];}return db[_0x3b6f('0x40')][_0x3b6f('0x41')](_0x4ab7d0);})[_0x3b6f('0x27')](function(_0x436526){_0x2dab4c[_0x3b6f('0x42')]=_0x436526;return _0x2dab4c;})['then'](respondWithFilteredResult(_0x2a43e5,_0x4ab7d0))[_0x3b6f('0x43')](handleError(_0x2a43e5,null));};exports[_0x3b6f('0x44')]=function(_0x128b4d,_0xe16ede){var _0x5a28b5={'raw':!![],'where':{'id':_0x128b4d['params']['id']}},_0x5da8f6={};_0x5da8f6[_0x3b6f('0x32')]=_[_0x3b6f('0x45')](db['WhatsappTransferReport'][_0x3b6f('0x2f')]);_0x5da8f6['query']=_['keys'](_0x128b4d[_0x3b6f('0x33')]);_0x5da8f6[_0x3b6f('0x34')]=_[_0x3b6f('0x36')](_0x5da8f6[_0x3b6f('0x32')],_0x5da8f6[_0x3b6f('0x33')]);_0x5a28b5[_0x3b6f('0x35')]=_[_0x3b6f('0x36')](_0x5da8f6[_0x3b6f('0x32')],qs['fields'](_0x128b4d['query'][_0x3b6f('0x46')]));_0x5a28b5[_0x3b6f('0x35')]=_0x5a28b5[_0x3b6f('0x35')][_0x3b6f('0x37')]?_0x5a28b5[_0x3b6f('0x35')]:_0x5da8f6[_0x3b6f('0x32')];if(_0x128b4d['query'][_0x3b6f('0x3f')]){_0x5a28b5[_0x3b6f('0x47')]=[{'all':!![]}];}_0x5a28b5=_[_0x3b6f('0x3c')]({},_0x5a28b5,_0x128b4d[_0x3b6f('0x48')]);return db[_0x3b6f('0x40')][_0x3b6f('0x49')](_0x5a28b5)[_0x3b6f('0x27')](handleEntityNotFound(_0xe16ede,null))[_0x3b6f('0x27')](respondWithResult(_0xe16ede,null))[_0x3b6f('0x43')](handleError(_0xe16ede,null));};exports[_0x3b6f('0x4a')]=function(_0x64b611,_0x3e2819){return db[_0x3b6f('0x40')][_0x3b6f('0x4a')](_0x64b611[_0x3b6f('0x4b')],{})[_0x3b6f('0x27')](respondWithResult(_0x3e2819,0xc9))[_0x3b6f('0x43')](handleError(_0x3e2819,null));};exports[_0x3b6f('0x26')]=function(_0x1d8519,_0x400575){if(_0x1d8519[_0x3b6f('0x4b')]['id']){delete _0x1d8519[_0x3b6f('0x4b')]['id'];}return db[_0x3b6f('0x40')]['find']({'where':{'id':_0x1d8519[_0x3b6f('0x4c')]['id']}})[_0x3b6f('0x27')](handleEntityNotFound(_0x400575,null))[_0x3b6f('0x27')](saveUpdates(_0x1d8519[_0x3b6f('0x4b')],null))[_0x3b6f('0x27')](respondWithResult(_0x400575,null))[_0x3b6f('0x43')](handleError(_0x400575,null));};exports[_0x3b6f('0x28')]=function(_0x108fb9,_0xe68a31){return db[_0x3b6f('0x40')]['find']({'where':{'id':_0x108fb9['params']['id']}})[_0x3b6f('0x27')](handleEntityNotFound(_0xe68a31,null))[_0x3b6f('0x27')](removeEntity(_0xe68a31,null))[_0x3b6f('0x43')](handleError(_0xe68a31,null));};exports[_0x3b6f('0x4d')]=function(_0x338e3f,_0x280eab){return db['WhatsappTransferReport'][_0x3b6f('0x4d')]()['then'](respondWithResult(_0x280eab,null))['catch'](handleError(_0x280eab,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 9d4871f..d22df9a 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 _0x29be=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x52f125,_0x1c0f45){var _0x3a6dd7=function(_0x199357){while(--_0x199357){_0x52f125['push'](_0x52f125['shift']());}};_0x3a6dd7(++_0x1c0f45);}(_0x29be,0x6f));var _0xe29b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x29be[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xe29b('0x0'));var util=require(_0xe29b('0x1'));var logger=require(_0xe29b('0x2'))('api');var moment=require(_0xe29b('0x3'));var BPromise=require('bluebird');var rp=require(_0xe29b('0x4'));var fs=require('fs');var path=require(_0xe29b('0x5'));var rimraf=require(_0xe29b('0x6'));var config=require(_0xe29b('0x7'));var attributes=require(_0xe29b('0x8'));module['exports']=function(_0x4eb344,_0x35416a){return _0x4eb344['define'](_0xe29b('0x9'),attributes,{'tableName':_0xe29b('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe29b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x848b=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x41c6b1,_0x2e8836){var _0x59cd90=function(_0x435998){while(--_0x435998){_0x41c6b1['push'](_0x41c6b1['shift']());}};_0x59cd90(++_0x2e8836);}(_0x848b,0x166));var _0xb848=function(_0x2e7b0e,_0x310750){_0x2e7b0e=_0x2e7b0e-0x0;var _0x2a7670=_0x848b[_0x2e7b0e];return _0x2a7670;};'use strict';var _=require(_0xb848('0x0'));var util=require(_0xb848('0x1'));var logger=require(_0xb848('0x2'))('api');var moment=require(_0xb848('0x3'));var BPromise=require('bluebird');var rp=require(_0xb848('0x4'));var fs=require('fs');var path=require(_0xb848('0x5'));var rimraf=require(_0xb848('0x6'));var config=require(_0xb848('0x7'));var attributes=require(_0xb848('0x8'));module[_0xb848('0x9')]=function(_0x206675,_0x52a586){return _0x206675['define'](_0xb848('0xa'),attributes,{'tableName':_0xb848('0xb'),'paranoid':![],'indexes':[{'name':_0xb848('0xc'),'fields':[_0xb848('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 4e9dbe9..0cedc52 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 _0xb3f4=['debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x479f2d,_0x48a132){var _0x2bed93=function(_0x5404fc){while(--_0x5404fc){_0x479f2d['push'](_0x479f2d['shift']());}};_0x2bed93(++_0x48a132);}(_0xb3f4,0x1ce));var _0x4b3f=function(_0x32bac9,_0x432085){_0x32bac9=_0x32bac9-0x0;var _0x17b889=_0xb3f4[_0x32bac9];return _0x17b889;};'use strict';var _=require(_0x4b3f('0x0'));var util=require(_0x4b3f('0x1'));var moment=require(_0x4b3f('0x2'));var BPromise=require(_0x4b3f('0x3'));var rs=require(_0x4b3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b3f('0x5'))['db'];var utils=require(_0x4b3f('0x6'));var logger=require('../../config/logger')(_0x4b3f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b3f('0x8'));var client=jayson[_0x4b3f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14e071,_0x5d8760,_0x5e0ace){return new BPromise(function(_0x55f822,_0xf985fa){return client['request'](_0x14e071,_0x5e0ace)[_0x4b3f('0xa')](function(_0x5df79d){logger['info'](_0x4b3f('0xb'),_0x5d8760,_0x4b3f('0xc'));logger[_0x4b3f('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5d8760,'request\x20sent',JSON[_0x4b3f('0xe')](_0x5df79d));if(_0x5df79d['error']){if(_0x5df79d[_0x4b3f('0xf')][_0x4b3f('0x10')]===0x1f4){logger[_0x4b3f('0xf')](_0x4b3f('0xb'),_0x5d8760,_0x5df79d[_0x4b3f('0xf')][_0x4b3f('0x11')]);return _0xf985fa(_0x5df79d[_0x4b3f('0xf')][_0x4b3f('0x11')]);}logger[_0x4b3f('0xf')](_0x4b3f('0xb'),_0x5d8760,_0x5df79d[_0x4b3f('0xf')][_0x4b3f('0x11')]);return _0x55f822(_0x5df79d['error'][_0x4b3f('0x11')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x5d8760,_0x4b3f('0xc'));_0x55f822(_0x5df79d['result'][_0x4b3f('0x11')]);}})[_0x4b3f('0x12')](function(_0x590ed6){logger[_0x4b3f('0xf')](_0x4b3f('0xb'),_0x5d8760,_0x590ed6);_0xf985fa(_0x590ed6);});});} \ No newline at end of file +var _0x1af9=['error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x85ce2b,_0x501701){var _0x4f066a=function(_0x32ff63){while(--_0x32ff63){_0x85ce2b['push'](_0x85ce2b['shift']());}};_0x4f066a(++_0x501701);}(_0x1af9,0x97));var _0x91af=function(_0x5d1e4e,_0x2e901f){_0x5d1e4e=_0x5d1e4e-0x0;var _0x4f60e8=_0x1af9[_0x5d1e4e];return _0x4f60e8;};'use strict';var _=require('lodash');var util=require(_0x91af('0x0'));var moment=require(_0x91af('0x1'));var BPromise=require(_0x91af('0x2'));var rs=require(_0x91af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91af('0x4'))['db'];var utils=require(_0x91af('0x5'));var logger=require(_0x91af('0x6'))(_0x91af('0x7'));var config=require('../../config/environment');var jayson=require(_0x91af('0x8'));var client=jayson[_0x91af('0x9')][_0x91af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6567bd,_0x9c507,_0x5ca68e){return new BPromise(function(_0x182a10,_0x3398d2){return client[_0x91af('0xb')](_0x6567bd,_0x5ca68e)[_0x91af('0xc')](function(_0x202f57){logger[_0x91af('0xd')](_0x91af('0xe'),_0x9c507,'request\x20sent');logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x9c507,_0x91af('0xf'),JSON[_0x91af('0x10')](_0x202f57));if(_0x202f57[_0x91af('0x11')]){if(_0x202f57[_0x91af('0x11')][_0x91af('0x12')]===0x1f4){logger[_0x91af('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x9c507,_0x202f57[_0x91af('0x11')][_0x91af('0x13')]);return _0x3398d2(_0x202f57[_0x91af('0x11')]['message']);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x9c507,_0x202f57[_0x91af('0x11')]['message']);return _0x182a10(_0x202f57[_0x91af('0x11')]['message']);}else{logger['info'](_0x91af('0xe'),_0x9c507,_0x91af('0xf'));_0x182a10(_0x202f57[_0x91af('0x14')][_0x91af('0x13')]);}})['catch'](function(_0x1f3d0c){logger['error'](_0x91af('0xe'),_0x9c507,_0x1f3d0c);_0x3398d2(_0x1f3d0c);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 8bfb925..a759ff4 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04f1=['start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','join','Offline\x20apps:','None','log','App\x20Ready!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/environment','./config/logger','app','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','info'];(function(_0x1ed354,_0x4bb5be){var _0x532757=function(_0x574f3e){while(--_0x574f3e){_0x1ed354['push'](_0x1ed354['shift']());}};_0x532757(++_0x4bb5be);}(_0x04f1,0x92));var _0x104f=function(_0x377544,_0x341f6d){_0x377544=_0x377544-0x0;var _0x6c0370=_0x04f1[_0x377544];return _0x6c0370;};'use strict';var _=require(_0x104f('0x0'));var db=require(_0x104f('0x1'))['db'];var seedDb=require(_0x104f('0x2'));var checkLicense=require('./config/license');var rpc=require('./rpc');var config=require(_0x104f('0x3'));var logger=require(_0x104f('0x4'))(_0x104f('0x5'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x104f('0x6'));var provider=require(_0x104f('0x7'));function main(){return db[_0x104f('0x8')][_0x104f('0x9')]()['then'](function(){if(config[_0x104f('0xa')]){return seedDb[_0x104f('0xb')]();}})[_0x104f('0xc')](function(){return checkLicense[_0x104f('0xb')]();})['then'](function(){return rpc['listen']();})[_0x104f('0xc')](function(_0x2635d6){logger[_0x104f('0xd')](_0x2635d6);return chat[_0x104f('0xe')]();})[_0x104f('0xc')](function(){return whatsapp[_0x104f('0xe')]();})[_0x104f('0xc')](function(){return schedule[_0x104f('0xe')]();})[_0x104f('0xc')](function(){return transcribe[_0x104f('0xe')]();})['then'](function(){return provider[_0x104f('0xe')]();})[_0x104f('0xc')](function(_0x149a32){logger[_0x104f('0xd')](_0x149a32);return pm2[_0x104f('0xe')](pm2Config);})[_0x104f('0xc')](function(_0x2f7e46){var _0x373b4f=_0x2f7e46[_0x104f('0xf')](function(_0x67d2be){return typeof _0x67d2be[_0x104f('0x10')]===_0x104f('0x11')&&_0x67d2be[_0x104f('0x10')]>=0x0;});if(_0x373b4f[_0x104f('0x12')]>0x0){throw new Error(_0x373b4f['length']+_0x104f('0x13')+_[_0x104f('0x14')](_0x373b4f,function(_0x4699d6){return'\x22'+_0x4699d6[_0x104f('0x15')]['name']+'\x22';}));}logger[_0x104f('0xd')](_0x104f('0x16'),_['map'](_[_0x104f('0xf')](_0x2f7e46,{'status':_0x104f('0x17')}),'name')[_0x104f('0x18')]());logger[_0x104f('0xd')](_0x104f('0x19'),_[_0x104f('0x14')](_[_0x104f('0xf')](_0x2f7e46,function(_0x1defa3){return _0x1defa3['status']!==_0x104f('0x17');}),'name')['join']()||_0x104f('0x1a'));console[_0x104f('0x1b')](_0x104f('0x1c'));})['catch'](function(_0x58ff02){console[_0x104f('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x58ff02);logger[_0x104f('0x1d')](_0x104f('0x1e'),_0x58ff02);process[_0x104f('0x1f')](0x1);});}main(); \ No newline at end of file +var _0x94ba=['join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online'];(function(_0x73c130,_0x5f532f){var _0x3bd9b4=function(_0x56cac8){while(--_0x56cac8){_0x73c130['push'](_0x73c130['shift']());}};_0x3bd9b4(++_0x5f532f);}(_0x94ba,0xbe));var _0xa94b=function(_0x13b70f,_0x5c1116){_0x13b70f=_0x13b70f-0x0;var _0x51427c=_0x94ba[_0x13b70f];return _0x51427c;};'use strict';var _=require(_0xa94b('0x0'));var db=require(_0xa94b('0x1'))['db'];var seedDb=require(_0xa94b('0x2'));var checkLicense=require(_0xa94b('0x3'));var rpc=require(_0xa94b('0x4'));var config=require('./config/environment');var logger=require(_0xa94b('0x5'))('app');var pm2=require(_0xa94b('0x6'));var pm2Config=require(_0xa94b('0x7'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xa94b('0x8'));var transcribe=require(_0xa94b('0x9'));var provider=require(_0xa94b('0xa'));function main(){return db[_0xa94b('0xb')]['sync']()[_0xa94b('0xc')](function(){if(config[_0xa94b('0xd')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xa94b('0xe')]();})[_0xa94b('0xc')](function(){return rpc[_0xa94b('0xf')]();})['then'](function(_0x30bdd2){logger[_0xa94b('0x10')](_0x30bdd2);return chat[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(){return whatsapp[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(){return schedule['start']();})[_0xa94b('0xc')](function(){return transcribe[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(){return provider[_0xa94b('0x11')]();})[_0xa94b('0xc')](function(_0xfc303c){logger[_0xa94b('0x10')](_0xfc303c);return pm2[_0xa94b('0x11')](pm2Config);})['then'](function(_0x38d344){var _0x1e5f23=_0x38d344['filter'](function(_0xea3a9f){return typeof _0xea3a9f['exitCode']==='number'&&_0xea3a9f['exitCode']>=0x0;});if(_0x1e5f23[_0xa94b('0x12')]>0x0){throw new Error(_0x1e5f23[_0xa94b('0x12')]+_0xa94b('0x13')+_[_0xa94b('0x14')](_0x1e5f23,function(_0x15d9d8){return'\x22'+_0x15d9d8[_0xa94b('0x15')][_0xa94b('0x16')]+'\x22';}));}logger[_0xa94b('0x10')](_0xa94b('0x17'),_[_0xa94b('0x14')](_[_0xa94b('0x18')](_0x38d344,{'status':_0xa94b('0x19')}),_0xa94b('0x16'))[_0xa94b('0x1a')]());logger[_0xa94b('0x10')](_0xa94b('0x1b'),_[_0xa94b('0x14')](_[_0xa94b('0x18')](_0x38d344,function(_0x44f20f){return _0x44f20f[_0xa94b('0x1c')]!==_0xa94b('0x19');}),'name')[_0xa94b('0x1a')]()||_0xa94b('0x1d'));console[_0xa94b('0x1e')](_0xa94b('0x1f'));})[_0xa94b('0x20')](function(_0x2524f9){console[_0xa94b('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2524f9);logger[_0xa94b('0x21')](_0xa94b('0x22'),_0x2524f9);process[_0xa94b('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 80cae20..7a216d9 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 _0x008c=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','sign','session','payload','options','promisify','verify','randomBytes','hex','floor','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','name','userpic','permissions','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','interface','userProfileId','privacyEnabled','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','unmanaged','json','headers','startsWith','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x008c,0x188));var _0xc008=function(_0x2041a4,_0x55946d){_0x2041a4=_0x2041a4-0x0;var _0x5464b8=_0x008c[_0x2041a4];return _0x5464b8;};'use strict';var db=require(_0xc008('0x0'))['db'];var config=require(_0xc008('0x1'));var hardwareConf=require(_0xc008('0x2'));var licenseUtil=require(_0xc008('0x3'));var encryptor=require(_0xc008('0x4'));var _=require('lodash');var jwt=require(_0xc008('0x5'));var expressJwt=require(_0xc008('0x6'));var compose=require(_0xc008('0x7'));var basicAuth=require(_0xc008('0x8'));var crypto=require(_0xc008('0x9'));var BPromise=require(_0xc008('0xa'));var util=require(_0xc008('0xb'));var moment=require(_0xc008('0xc'));var validateJwt=expressJwt({'secret':config[_0xc008('0xd')]['session']});var userAttributes=['id',_0xc008('0xe'),'fullname',_0xc008('0xf'),'internal','email',_0xc008('0x10'),_0xc008('0x11'),'md5secret','voicePause','chatPause',_0xc008('0x12'),_0xc008('0x13'),'smsPause',_0xc008('0x14'),_0xc008('0x15'),_0xc008('0x16'),_0xc008('0x17'),_0xc008('0x18'),_0xc008('0x19'),_0xc008('0x1a'),'passwordResetAt','alias',_0xc008('0x1b'),'phoneBarAutoAnswerDelay',_0xc008('0x1c'),_0xc008('0x1d'),_0xc008('0x1e'),_0xc008('0x1f'),_0xc008('0x20'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xc008('0x21'),_0xc008('0x22'),_0xc008('0x23'),_0xc008('0x24'),'settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0xc008('0x25'),_0xc008('0x26'),'selectRecallMeCampaign',_0xc008('0x27'),'chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer',_0xc008('0x28'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xc008('0x29')];exports[_0xc008('0x2a')]=function(){return this[_0xc008('0x2b')](!![])[_0xc008('0x2c')](function(_0x11cc75,_0x110128,_0x4f43e2){if(_0x11cc75[_0xc008('0x2d')]){_0x4f43e2();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x11cc75[_0xc008('0x2e')]['id']},'attributes':['id',_0xc008('0x2f'),_0xc008('0x30')],'raw':!![]})[_0xc008('0x31')](function(_0x5410f5){if(_0x5410f5&&_0x5410f5['closed']){return _0x110128['status'](_0x5410f5[_0xc008('0x30')]===_0xc008('0x32')?0x195:0x193)[_0xc008('0x33')]({'message':_0x5410f5[_0xc008('0x30')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0x4f43e2();}})['catch'](function(_0x4caaf4){_0x4f43e2(_0x4caaf4);});}});};exports[_0xc008('0x2b')]=function isAuthenticated(_0x29ba43){return compose()[_0xc008('0x2c')](function(_0x529961,_0x24c14c,_0x32390d){var _0x209591;if(_0x529961[_0xc008('0x34')]['authorization']){if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],'Basic')){var _0x539766=basicAuth(_0x529961);db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'name':_0x539766[_0xc008('0xf')]}})[_0xc008('0x31')](function(_0x1de04b){if(!_0x1de04b||!_0x1de04b[_0xc008('0x38')](_0x539766[_0xc008('0x39')])){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x3b')});}_0x529961[_0xc008('0x2d')]={'id':_0x1de04b['id']};_0x32390d();})[_0xc008('0x3c')](function(_0x596ee8){_0x32390d(_0x596ee8);});}else if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],_0xc008('0x3d'))){validateJwt(_0x529961,_0x24c14c,_0x32390d);}else{if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}}}else if(_0x529961[_0xc008('0x3f')][_0xc008('0x40')]){try{var _0x7cfbc5={'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};verifyJwt(_0x529961['query'][_0xc008('0x40')],_0x7cfbc5)[_0xc008('0x31')](function(_0x459df4){return db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x459df4[_0xc008('0x42')]}})[_0xc008('0x31')](function(_0x5d0e06){_0x209591=_0x5d0e06;return db[_0xc008('0x43')][_0xc008('0x44')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc008('0x45')],'raw':!![]});})[_0xc008('0x31')](function(_0x5e38d5){if(!_0x209591||!_[_0xc008('0x46')](_0x209591[_0xc008('0x47')],_0x459df4[_0xc008('0x48')])){return _0x24c14c['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x209591[_0xc008('0x49')]){return _0x24c14c['status'](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}if(_0x209591[_0xc008('0x4b')]){if(_0x5e38d5[_0xc008('0x45')]>0x0){if(moment(_0x209591[_0xc008('0x4c')])[_0xc008('0x4d')](_0x5e38d5[_0xc008('0x45')],_0xc008('0x4e'))>moment()){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}else{return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}_0x529961['user']={'id':_0x209591['id']};_0x32390d();});})[_0xc008('0x3c')](function(){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});});}catch(_0x49a16d){_0x32390d(_0x49a16d);}}else if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}})[_0xc008('0x2c')](function(_0x2d142d,_0x5706bb,_0x398cdd){if(_0x2d142d[_0xc008('0x2d')]){db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x2d142d[_0xc008('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0xf4cc4b){if(!_0xf4cc4b){return _0x5706bb[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x4f')});}_0x2d142d['user']=_0xf4cc4b;_0x398cdd();})[_0xc008('0x3c')](function(_0xe37446){_0x398cdd(_0xe37446);});}else if(_0x29ba43){_0x398cdd();}else{return _0x5706bb[_0xc008('0x3a')](0x194)['json']({'message':_0xc008('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc008('0x2c')](function(_0x5d3a72,_0x46fa8f,_0x213014){return licenseUtil['getLicense']()[_0xc008('0x31')](function(_0x24ba0f){if(_0x24ba0f[_0xc008('0x51')]){_0x213014();}else{return _0x46fa8f['status'](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x44fc5d){_0x213014(_0x44fc5d);});});};exports[_0xc008('0x53')]=function isWebrtcLicence(){return compose()[_0xc008('0x2c')](function(_0x59ca2b,_0x47cafa,_0x5283a8){return licenseUtil[_0xc008('0x54')]()[_0xc008('0x31')](function(_0x103a83){if(_0x103a83[_0xc008('0x55')]){_0x5283a8();}else{return _0x47cafa[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x572593){_0x5283a8(_0x572593);});});};exports['isMiddleware']=function(_0x516e43,_0x2d5a49,_0x2651cf){_0x516e43[_0xc008('0x56')]=!![];return _0x2651cf();};exports['signToken']=function signToken(_0x28bc33){return signJwt(_0x28bc33);};exports[_0xc008('0x57')]=function(_0x17ab1a,_0x1c2c50){if(!_0x17ab1a[_0xc008('0x2d')]){return _0x1c2c50[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x58')});}var _0x3fd7d9={'payload':{'id':_0x17ab1a[_0xc008('0x2d')]['id'],'role':_0x17ab1a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3fd7d9)[_0xc008('0x31')](function(_0x51cb14){_0x1c2c50[_0xc008('0x59')](_0xc008('0x5a'),_0x51cb14);_0x1c2c50[_0xc008('0x5b')]('/dashboards/general');})[_0xc008('0x3c')](function(_0x32b435){return _0x1c2c50[_0xc008('0x3a')](0x1f4)[_0xc008('0x5c')](_0x32b435);});};exports[_0xc008('0x5d')]=function(_0x51105f){if(_[_0xc008('0x5e')](_0x51105f[_0xc008('0x47')])||_['isNil'](_0x51105f[_0xc008('0x5f')])){return null;}else{return createJwt(_0x51105f);}};exports[_0xc008('0x60')]=function(_0x5b5fbf){_0x5b5fbf['apiKeyNonce']=generateNonce();_0x5b5fbf[_0xc008('0x5f')]=generateIssuedAt();return createJwt(_0x5b5fbf);};exports[_0xc008('0x61')]=function(_0x20947b,_0x30d0aa){var _0x14b6a0=_0x20947b['query']['apikey'];if(_0x14b6a0){var _0x34b72a={'nonce':_0x30d0aa['apiKeyNonce'],'iat':_0x30d0aa[_0xc008('0x5f')],'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};return verifyJwt(_0x14b6a0,_0x34b72a)[_0xc008('0x31')](function(){return generateApiKey(_0x30d0aa);});}else{throw{'message':_0xc008('0x62')};}};exports[_0xc008('0x63')]=function(_0x49d8b0){var _0x2ea742=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2ea742[_0xc008('0x64')](_0x49d8b0))throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0xc008('0x67'));return;};exports['validatePasswordHistory']=function(_0x41fae3,_0x4fdab4,_0x535e6e){var _0x5dbfca=encryptor[_0xc008('0x68')](_0x4fdab4)[_0xc008('0x69')](',');for(var _0x5dfb69=0x0;_0x5dfb69<_0x535e6e;_0x5dfb69++){if(!_0x5dbfca[_0x5dfb69])break;if(_0x41fae3['toLowerCase']()===_0x5dbfca[_0x5dfb69][_0xc008('0x6a')]()){var _0x2d8361=util[_0xc008('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x535e6e);if(_0x535e6e===0x1){_0x2d8361=_0xc008('0x6c');}throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0x2d8361);}}return;};exports[_0xc008('0x6d')]=function(_0x5baff1,_0x4022dd){var _0x4eaa6d=_0x4022dd?encryptor[_0xc008('0x68')](_0x4022dd)[_0xc008('0x69')](','):[];if(_0x4eaa6d[_0xc008('0x6e')]===0x5){_0x4eaa6d[_0xc008('0x6f')](-0x1,0x1);}_0x4eaa6d[_0xc008('0x70')](_0x5baff1);return encryptor[_0xc008('0x71')](_0x4eaa6d['join'](','));};function signJwt(_0x375e71){var _0x570001=BPromise['promisify'](jwt[_0xc008('0x72')],{'context':jwt});var _0x30aa1e=_0x375e71['secret']||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x3e373e,_0x4517c0){_0x570001(_0x375e71[_0xc008('0x74')],_0x30aa1e,_0x375e71[_0xc008('0x75')])[_0xc008('0x31')](function(_0x57ce9a){_0x3e373e(_0x57ce9a);})[_0xc008('0x3c')](function(_0x462e1e){_0x4517c0(_0x462e1e);});});}function verifyJwt(_0x3bfb15,_0x2a60e6,_0xb3ca0f){var _0x167425=BPromise[_0xc008('0x76')](jwt[_0xc008('0x77')],{'context':jwt});var _0xbc430a=_0xb3ca0f||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x2b5eb6,_0x131b81){_0x167425(_0x3bfb15,_0xbc430a,_0x2a60e6)[_0xc008('0x31')](function(_0x4e0251){_0x2b5eb6(_0x4e0251);})[_0xc008('0x3c')](function(_0x2e5467){_0x131b81(_0x2e5467);});});}function generateNonce(){return crypto[_0xc008('0x78')](0x10)['toString'](_0xc008('0x79'));}function generateIssuedAt(){return Math[_0xc008('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1a03fd){var _0x2a4c2b={'payload':{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd[_0xc008('0x47')]},'options':{'algorithm':_0xc008('0x7b'),'subject':_0x1a03fd['id'][_0xc008('0x7c')](),'issuer':hardwareConf[_0xc008('0x41')](),'audience':hardwareConf[_0xc008('0x41')]()}};return signJwt(_0x2a4c2b)[_0xc008('0x31')](function(_0x1b059b){return{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd['apiKeyNonce'],'token':_0x1b059b};});} \ No newline at end of file +var _0x6aa7=['smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','find','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','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','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','HS512','toString','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','util','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6aa7,0x178));var _0x76aa=function(_0x47525a,_0x47f391){_0x47525a=_0x47525a-0x0;var _0x396031=_0x6aa7[_0x47525a];return _0x396031;};'use strict';var db=require(_0x76aa('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x76aa('0x1'));var licenseUtil=require(_0x76aa('0x2'));var encryptor=require(_0x76aa('0x3'));var _=require(_0x76aa('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x76aa('0x5'));var compose=require(_0x76aa('0x6'));var basicAuth=require(_0x76aa('0x7'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x76aa('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x76aa('0x9')][_0x76aa('0xa')]});var userAttributes=['id',_0x76aa('0xb'),'fullname',_0x76aa('0xc'),_0x76aa('0xd'),_0x76aa('0xe'),'userpic',_0x76aa('0xf'),_0x76aa('0x10'),_0x76aa('0x11'),_0x76aa('0x12'),_0x76aa('0x13'),_0x76aa('0x14'),_0x76aa('0x15'),_0x76aa('0x16'),_0x76aa('0x17'),_0x76aa('0x18'),'lastLoginAt',_0x76aa('0x19'),'crudPermissions',_0x76aa('0x1a'),_0x76aa('0x1b'),_0x76aa('0x1c'),_0x76aa('0x1d'),_0x76aa('0x1e'),'phoneBarDnd','phoneBarEnableRecording',_0x76aa('0x1f'),'phoneBarEnableSettings',_0x76aa('0x20'),_0x76aa('0x21'),'phoneBarRemoteControl',_0x76aa('0x22'),'hotdesk',_0x76aa('0x23'),'userProfileId',_0x76aa('0x24'),_0x76aa('0x25'),_0x76aa('0x26'),_0x76aa('0x27'),_0x76aa('0x28'),_0x76aa('0x29'),'ignorePauseForPreviewCalls','selectRecallMeCampaign',_0x76aa('0x2a'),_0x76aa('0x2b'),_0x76aa('0x2c'),_0x76aa('0x2d'),_0x76aa('0x2e'),_0x76aa('0x2f'),_0x76aa('0x30'),_0x76aa('0x31'),_0x76aa('0x32'),'faxAutoanswerDelay',_0x76aa('0x33'),_0x76aa('0x34')];exports[_0x76aa('0x35')]=function(){return this['isAuthenticated'](!![])[_0x76aa('0x36')](function(_0x189cb6,_0x31252f,_0x2bd2c6){if(_0x189cb6[_0x76aa('0x37')]){_0x2bd2c6();}else{return db[_0x76aa('0x38')][_0x76aa('0x39')]({'where':{'id':_0x189cb6[_0x76aa('0x3a')]['id']},'attributes':['id',_0x76aa('0x3b'),_0x76aa('0x3c')],'raw':!![]})[_0x76aa('0x3d')](function(_0x26b75e){if(_0x26b75e&&_0x26b75e[_0x76aa('0x3b')]){return _0x31252f['status'](_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?0x195:0x193)[_0x76aa('0x3f')]({'message':_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?_0x76aa('0x40'):_0x76aa('0x41')});}else{_0x2bd2c6();}})[_0x76aa('0x42')](function(_0xd12a99){_0x2bd2c6(_0xd12a99);});}});};exports[_0x76aa('0x43')]=function isAuthenticated(_0x545b06){return compose()[_0x76aa('0x36')](function(_0x5a8030,_0x994550,_0x365ff8){var _0x2dec94;if(_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')]){if(_[_0x76aa('0x46')](_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')],_0x76aa('0x47'))){var _0x3ea05a=basicAuth(_0x5a8030);db['User'][_0x76aa('0x48')]({'where':{'name':_0x3ea05a[_0x76aa('0xc')]}})[_0x76aa('0x3d')](function(_0x928ccf){if(!_0x928ccf||!_0x928ccf[_0x76aa('0x49')](_0x3ea05a[_0x76aa('0x4a')])){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x4c')});}_0x5a8030[_0x76aa('0x37')]={'id':_0x928ccf['id']};_0x365ff8();})['catch'](function(_0x2ee338){_0x365ff8(_0x2ee338);});}else if(_['startsWith'](_0x5a8030[_0x76aa('0x44')]['authorization'],_0x76aa('0x4d'))){validateJwt(_0x5a8030,_0x994550,_0x365ff8);}else{if(_0x545b06){_0x365ff8();}else{return _0x994550['status'](0x193)['json']({'message':_0x76aa('0x4e')});}}}else if(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')]){try{var _0x37dfab={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')],_0x37dfab)[_0x76aa('0x3d')](function(_0x23e2fd){return db[_0x76aa('0x51')]['find']({'where':{'id':_0x23e2fd[_0x76aa('0x52')]}})['then'](function(_0x5086f5){_0x2dec94=_0x5086f5;return db[_0x76aa('0x53')][_0x76aa('0x39')]({'where':{'id':0x1},'attributes':[_0x76aa('0x54'),_0x76aa('0x55')],'raw':!![]});})['then'](function(_0x401c07){if(!_0x2dec94||!_[_0x76aa('0x56')](_0x2dec94[_0x76aa('0x57')],_0x23e2fd['nonce'])){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x58')});}if(_0x2dec94[_0x76aa('0x59')]){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}if(_0x2dec94[_0x76aa('0x5b')]){if(_0x401c07[_0x76aa('0x55')]>0x0){if(moment(_0x2dec94['blockedAt'])[_0x76aa('0x5c')](_0x401c07[_0x76aa('0x55')],_0x76aa('0x5d'))>moment()){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}}else{return _0x994550['status'](0x191)['json']({'message':_0x76aa('0x5a')});}}_0x5a8030[_0x76aa('0x37')]={'id':_0x2dec94['id']};_0x365ff8();});})[_0x76aa('0x42')](function(){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x5a')});});}catch(_0x403084){_0x365ff8(_0x403084);}}else if(_0x545b06){_0x365ff8();}else{return _0x994550[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x4e')});}})['use'](function(_0x13dafe,_0x556f59,_0xbb3136){if(_0x13dafe['user']){db['User']['find']({'where':{'id':_0x13dafe[_0x76aa('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5cf314){if(!_0x5cf314){return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5e')});}_0x13dafe[_0x76aa('0x37')]=_0x5cf314;_0xbb3136();})[_0x76aa('0x42')](function(_0x27a52e){_0xbb3136(_0x27a52e);});}else if(_0x545b06){_0xbb3136();}else{return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5f')});}});};exports[_0x76aa('0x60')]=function canUpdate(){return compose()[_0x76aa('0x36')](function(_0x3800a4,_0x47a308,_0x2f695c){return licenseUtil[_0x76aa('0x61')]()['then'](function(_0x2d3441){if(_0x2d3441['update']){_0x2f695c();}else{return _0x47a308[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})[_0x76aa('0x42')](function(_0x2d0bc4){_0x2f695c(_0x2d0bc4);});});};exports[_0x76aa('0x63')]=function isWebrtcLicence(){return compose()[_0x76aa('0x36')](function(_0x165858,_0xb8d052,_0x3946bd){return licenseUtil['getLicense']()[_0x76aa('0x3d')](function(_0x4b8f12){if(_0x4b8f12[_0x76aa('0x64')]){_0x3946bd();}else{return _0xb8d052[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})['catch'](function(_0x5a3d9c){_0x3946bd(_0x5a3d9c);});});};exports[_0x76aa('0x65')]=function(_0x54b673,_0x8660a4,_0x302a0c){_0x54b673[_0x76aa('0x65')]=!![];return _0x302a0c();};exports[_0x76aa('0x66')]=function signToken(_0x30c577){return signJwt(_0x30c577);};exports[_0x76aa('0x67')]=function(_0x5b567b,_0x564546){if(!_0x5b567b[_0x76aa('0x37')]){return _0x564546[_0x76aa('0x4b')](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x68')});}var _0x18c679={'payload':{'id':_0x5b567b[_0x76aa('0x37')]['id'],'role':_0x5b567b['user'][_0x76aa('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x18c679)[_0x76aa('0x3d')](function(_0x26db69){_0x564546['cookie'](_0x76aa('0x69'),_0x26db69);_0x564546['redirect'](_0x76aa('0x6a'));})['catch'](function(_0x339b0d){return _0x564546[_0x76aa('0x4b')](0x1f4)[_0x76aa('0x6b')](_0x339b0d);});};exports[_0x76aa('0x6c')]=function(_0x37a4d9){if(_[_0x76aa('0x6d')](_0x37a4d9[_0x76aa('0x57')])||_['isNil'](_0x37a4d9[_0x76aa('0x6e')])){return null;}else{return createJwt(_0x37a4d9);}};exports['generateApiKey']=function(_0x3ee32){_0x3ee32[_0x76aa('0x57')]=generateNonce();_0x3ee32[_0x76aa('0x6e')]=generateIssuedAt();return createJwt(_0x3ee32);};exports[_0x76aa('0x6f')]=function(_0x3fa7ec,_0x28f8aa){var _0x336024=_0x3fa7ec['query'][_0x76aa('0x50')];if(_0x336024){var _0x281f73={'nonce':_0x28f8aa[_0x76aa('0x57')],'iat':_0x28f8aa[_0x76aa('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x76aa('0x70')]()};return verifyJwt(_0x336024,_0x281f73)[_0x76aa('0x3d')](function(){return generateApiKey(_0x28f8aa);});}else{throw{'message':_0x76aa('0x71')};}};exports[_0x76aa('0x72')]=function(_0x2027f8){var _0xf7732=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xf7732['test'](_0x2027f8))throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x76aa('0x75'));return;};exports[_0x76aa('0x76')]=function(_0x3967f3,_0x2fdc4f,_0x37babe){var _0x51893b=encryptor['decryptString'](_0x2fdc4f)[_0x76aa('0x77')](',');for(var _0x3b0d8a=0x0;_0x3b0d8a<_0x37babe;_0x3b0d8a++){if(!_0x51893b[_0x3b0d8a])break;if(_0x3967f3['toLowerCase']()===_0x51893b[_0x3b0d8a][_0x76aa('0x78')]()){var _0x1e6f3c=util['format'](_0x76aa('0x79'),_0x37babe);if(_0x37babe===0x1){_0x1e6f3c=_0x76aa('0x7a');}throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x1e6f3c);}}return;};exports[_0x76aa('0x7b')]=function(_0x1f5010,_0x3376ec){var _0x30573a=_0x3376ec?encryptor[_0x76aa('0x7c')](_0x3376ec)['split'](','):[];if(_0x30573a[_0x76aa('0x7d')]===0x5){_0x30573a['splice'](-0x1,0x1);}_0x30573a[_0x76aa('0x7e')](_0x1f5010);return encryptor[_0x76aa('0x7f')](_0x30573a[_0x76aa('0x80')](','));};function signJwt(_0x16cc85){var _0x343cf1=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x82')],{'context':jwt});var _0x431d1c=_0x16cc85[_0x76aa('0x83')]||config['secrets'][_0x76aa('0xa')];return new BPromise(function(_0x3d4025,_0x5c542b){_0x343cf1(_0x16cc85[_0x76aa('0x84')],_0x431d1c,_0x16cc85[_0x76aa('0x85')])[_0x76aa('0x3d')](function(_0x3d6d10){_0x3d4025(_0x3d6d10);})[_0x76aa('0x42')](function(_0x5546b6){_0x5c542b(_0x5546b6);});});}function verifyJwt(_0x364d05,_0x4d3ad0,_0x35bd2b){var _0x35881c=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x86')],{'context':jwt});var _0x3a82fe=_0x35bd2b||config[_0x76aa('0x9')][_0x76aa('0xa')];return new BPromise(function(_0x4a37f1,_0x9ea0af){_0x35881c(_0x364d05,_0x3a82fe,_0x4d3ad0)[_0x76aa('0x3d')](function(_0x543c1d){_0x4a37f1(_0x543c1d);})['catch'](function(_0x40429c){_0x9ea0af(_0x40429c);});});}function generateNonce(){return crypto[_0x76aa('0x87')](0x10)['toString'](_0x76aa('0x88'));}function generateIssuedAt(){return Math[_0x76aa('0x89')](Date[_0x76aa('0x8a')]()/0x3e8)['toString']();}function createJwt(_0x446073){var _0x47f733={'payload':{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')]},'options':{'algorithm':_0x76aa('0x8b'),'subject':_0x446073['id'][_0x76aa('0x8c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x47f733)[_0x76aa('0x3d')](function(_0x4dfeb3){return{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')],'token':_0x4dfeb3};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 3595f19..c1b97cd 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['findOne','slice','fieldType','keys','type','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','clause','rows','catch','describe','startsWith','cf_','map','CmCustomField'];(function(_0x51df00,_0x4ac573){var _0x198328=function(_0x24e0ec){while(--_0x24e0ec){_0x51df00['push'](_0x51df00['shift']());}};_0x198328(++_0x4ac573);}(_0x757a,0xde));var _0xa757=function(_0x1f85f9,_0x2e0536){_0x1f85f9=_0x1f85f9-0x0;var _0x4daab4=_0x757a[_0x1f85f9];return _0x4daab4;};'use strict';var _=require('lodash');var sqlUtils=require(_0xa757('0x0'));var db=require(_0xa757('0x1'))['db'];exports['findAll']=function(_0x5c03c3,_0x5709ed,_0x32be3b,_0x1721c6){var _0x1c2932={'count':0x0,'rows':[]};var _0x453d07=sqlUtils[_0xa757('0x2')](_0x5709ed,_0x5c03c3);if(_0x453d07){return Promise[_0xa757('0x3')](_0x1c2932);}var _0x5edca8=sqlUtils[_0xa757('0x4')]();var _0x4343b6={};var _0x53be0e=![];var _0x2930fa=![];return Promise[_0xa757('0x3')]()[_0xa757('0x5')](function(){if(_0x5c03c3[_0xa757('0x6')]){return sqlUtils[_0xa757('0x7')](_0x5c03c3['search'],_0x1721c6);}else{return sqlUtils[_0xa757('0x8')](_0x5c03c3,_0x1721c6);}})[_0xa757('0x5')](function(_0x32f0ec){_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xa')]);_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xb')]);_0x5edca8['where'](_0x32f0ec['filter']);_0x5edca8['where'](_0x32f0ec['user']['clause']);_0x4343b6=_0x32f0ec[_0xa757('0xc')];_0x2930fa=_0x32f0ec['user']['skip'];return sqlUtils[_0xa757('0xd')](_0x5709ed,_0x5c03c3,_0x2930fa);})['then'](function(_0x481508){_0x5edca8[_0xa757('0x9')](_0x481508);var _0x1b670e=_0x5c03c3[_0xa757('0x6')]?_0x4343b6[_0xa757('0xe')]:_0x5c03c3[_0xa757('0xf')];_0x53be0e=_0x1b670e?!![]:![];return sqlUtils[_0xa757('0x10')](_0x5edca8,_0x1b670e);})[_0xa757('0x5')](function(_0x2f7947){_0x1c2932[_0xa757('0x11')]=_0x2f7947;if(_0x1c2932[_0xa757('0x11')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x5edca8,_0x5c03c3[_0xa757('0xb')],_0x32be3b,_0x53be0e,_0x4343b6[_0xa757('0x12')],_0x2930fa);})[_0xa757('0x5')](function(_0x4d9f58){if(!_0x4d9f58){return[];}return sqlUtils['getFilteredContacts'](_0x4d9f58,_0x5c03c3,_0x32be3b);})[_0xa757('0x5')](function(_0x468d45){_0x1c2932[_0xa757('0x13')]=_0x468d45;return _0x1c2932;})[_0xa757('0x14')](function(_0x27f4ba){throw _0x27f4ba;});};exports[_0xa757('0x15')]=function(){var _0x4bd137={};var _0x58954=[];return db['CmContact'][_0xa757('0x15')]()[_0xa757('0x5')](function(_0x14014c){_0x4bd137=_0x14014c;var _0x2c9ec6=Object['keys'](_0x4bd137)['filter'](function(_0x40ec48){return _[_0xa757('0x16')](_0x40ec48,_0xa757('0x17'))?_0x40ec48:undefined;});var _0x8d121f=_0x2c9ec6[_0xa757('0x18')](function(_0x40562f){return db[_0xa757('0x19')][_0xa757('0x1a')]({'where':{'id':_0x40562f[_0xa757('0x1b')](0x3)},'raw':!![]});});return Promise['all'](_0x8d121f);})[_0xa757('0x5')](function(_0x59e9d4){for(var _0x422e9e=0x0;_0x422e9e<_0x59e9d4['length'];_0x422e9e++){if(_0x59e9d4[_0x422e9e]){var _0x40551d=_0xa757('0x17')+_0x59e9d4[_0x422e9e]['id'];_0x4bd137[_0x40551d][_0xa757('0x1c')]=_0x59e9d4[_0x422e9e]['type'];}}_0x58954=_[_0xa757('0x18')](Object[_0xa757('0x1d')](_0x4bd137),function(_0x471e84){return{'name':_0x471e84,'type':_0x4bd137[_0x471e84][_0xa757('0x1e')]};});return _0x58954;})['catch'](function(_0x449a7d){throw _0x449a7d;});}; \ No newline at end of file +var _0x2032=['map','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','user','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','describe','CmContact','filter','startsWith','cf_'];(function(_0x499e6e,_0x2eaa05){var _0x19924d=function(_0x10a98c){while(--_0x10a98c){_0x499e6e['push'](_0x499e6e['shift']());}};_0x19924d(++_0x2eaa05);}(_0x2032,0xd9));var _0x2203=function(_0x582ee7,_0x2cc99b){_0x582ee7=_0x582ee7-0x0;var _0x18b061=_0x2032[_0x582ee7];return _0x18b061;};'use strict';var _=require('lodash');var sqlUtils=require(_0x2203('0x0'));var db=require(_0x2203('0x1'))['db'];exports[_0x2203('0x2')]=function(_0x4c28da,_0x486390,_0x228a29,_0x4b4c7f){var _0x46c49a={'count':0x0,'rows':[]};var _0x880dcd=sqlUtils[_0x2203('0x3')](_0x486390,_0x4c28da);if(_0x880dcd){return Promise[_0x2203('0x4')](_0x46c49a);}var _0x3f7ba1=sqlUtils[_0x2203('0x5')]();var _0x2e0f63={};var _0x2676aa=![];var _0x18c4d6=![];return Promise[_0x2203('0x4')]()[_0x2203('0x6')](function(){if(_0x4c28da['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x4c28da[_0x2203('0x7')],_0x4b4c7f);}else{return sqlUtils['parseQueryParameters'](_0x4c28da,_0x4b4c7f);}})[_0x2203('0x6')](function(_0x2972f3){_0x3f7ba1[_0x2203('0x8')](_0x2972f3['default']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['fields']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['filter']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3[_0x2203('0x9')]['clause']);_0x2e0f63=_0x2972f3['tags'];_0x18c4d6=_0x2972f3['user']['skip'];return sqlUtils['checkListsRestrictions'](_0x486390,_0x4c28da,_0x18c4d6);})[_0x2203('0x6')](function(_0x538b30){_0x3f7ba1['where'](_0x538b30);var _0x21a3af=_0x4c28da[_0x2203('0x7')]?_0x2e0f63[_0x2203('0xa')]:_0x4c28da[_0x2203('0xb')];_0x2676aa=_0x21a3af?!![]:![];return sqlUtils[_0x2203('0xc')](_0x3f7ba1,_0x21a3af);})[_0x2203('0x6')](function(_0x2c36e6){_0x46c49a[_0x2203('0xd')]=_0x2c36e6;if(_0x46c49a[_0x2203('0xd')]===0x0){return;}return sqlUtils[_0x2203('0xe')](_0x3f7ba1,_0x4c28da['fields'],_0x228a29,_0x2676aa,_0x2e0f63[_0x2203('0xf')],_0x18c4d6);})[_0x2203('0x6')](function(_0x4893ff){if(!_0x4893ff){return[];}return sqlUtils[_0x2203('0x10')](_0x4893ff,_0x4c28da,_0x228a29);})[_0x2203('0x6')](function(_0x4aeb9f){_0x46c49a[_0x2203('0x11')]=_0x4aeb9f;return _0x46c49a;})['catch'](function(_0x2904ba){throw _0x2904ba;});};exports[_0x2203('0x12')]=function(){var _0x3c8c34={};var _0x3b4034=[];return db[_0x2203('0x13')][_0x2203('0x12')]()['then'](function(_0x13d3f7){_0x3c8c34=_0x13d3f7;var _0x50822b=Object['keys'](_0x3c8c34)[_0x2203('0x14')](function(_0x496d82){return _[_0x2203('0x15')](_0x496d82,_0x2203('0x16'))?_0x496d82:undefined;});var _0x5d4c4e=_0x50822b[_0x2203('0x17')](function(_0x5e29cd){return db['CmCustomField'][_0x2203('0x18')]({'where':{'id':_0x5e29cd[_0x2203('0x19')](0x3)},'raw':!![]});});return Promise[_0x2203('0x1a')](_0x5d4c4e);})[_0x2203('0x6')](function(_0x1244f4){for(var _0x3114ef=0x0;_0x3114ef<_0x1244f4[_0x2203('0x1b')];_0x3114ef++){if(_0x1244f4[_0x3114ef]){var _0x250349='cf_'+_0x1244f4[_0x3114ef]['id'];_0x3c8c34[_0x250349][_0x2203('0x1c')]=_0x1244f4[_0x3114ef][_0x2203('0x1d')];}}_0x3b4034=_[_0x2203('0x17')](Object['keys'](_0x3c8c34),function(_0xb2071b){return{'name':_0xb2071b,'type':_0x3c8c34[_0xb2071b][_0x2203('0x1d')]};});return _0x3b4034;})['catch'](function(_0xd6e109){throw _0xd6e109;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 3934ae2..11f11a3 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae7b=['.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','value','start','Tag','map','tags','clause','and','User','user','uc.UserId\x20=\x20?','skip','keys','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','agent','c.ListId\x20IS\x20NULL','group','c.id','limit','offset','order','DESC','subqry.','from','findAll','color','Sequelize','query','toString','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','SELECT','sequelize','exports','lodash','squel','../parsers/advancedSearch','../../mysqldb','search','ListId','autocomplete','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags'];(function(_0x3b9ce8,_0x245259){var _0x5ebe70=function(_0x3283d0){while(--_0x3283d0){_0x3b9ce8['push'](_0x3b9ce8['shift']());}};_0x5ebe70(++_0x245259);}(_0xae7b,0xbe));var _0xbae7=function(_0x298be3,_0x2ebf8f){_0x298be3=_0x298be3-0x0;var _0x286f11=_0xae7b[_0x298be3];return _0x286f11;};'use strict';var _=require(_0xbae7('0x0'));var squel=require(_0xbae7('0x1'));var as=require(_0xbae7('0x2'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0xbae7('0x3'))['db'];function skipContactsQuery(_0x2da494,_0x1847f0){var _0xc0d4b9=![];if(_0x2da494['role']==='agent'&&!_0x1847f0[_0xbae7('0x4')]&&!_0x1847f0[_0xbae7('0x5')]&&_0x1847f0[_0xbae7('0x6')]!=='true'){_0xc0d4b9=!![];}return _0xc0d4b9;}function getContactsSubquery(){return squel[_0xbae7('0x7')]()['from'](_0xbae7('0x8'),'c')[_0xbae7('0x9')](_0xbae7('0xa'));}function applyJoinClauses(_0x4dba83,_0x1b4162){var _0x554592=_0x1b4162?'c':_0xbae7('0xb');_0x4dba83[_0xbae7('0xc')](_0xbae7('0xd'),'uc',_0xbae7('0xe')+_0x554592+'.id')[_0xbae7('0xc')](_0xbae7('0xf'),'ct','ct.CmContactId\x20=\x20'+_0x554592+_0xbae7('0x10'))['left_join'](_0xbae7('0x11'),'t',_0xbae7('0x12'));return _0x4dba83;}function addFieldsToQuery(_0x5b1abe,_0x4800d4,_0x44bdbb,_0x66c04b,_0x43e4ca){var _0x25d1a=_0x43e4ca?'c':'subqry';if(!_0x4800d4){_0x4800d4=['id',_0xbae7('0x13'),'lastName','phone',_0xbae7('0x14'),_0xbae7('0x15'),_0xbae7('0x16'),_0xbae7('0x5'),_0xbae7('0x17'),_0xbae7('0x18'),'updatedAt',_0xbae7('0x19'),_0xbae7('0x1a')];}var _0x99d88=_0x44bdbb&&_0x43e4ca||!_0x44bdbb&&!_0x43e4ca;if(_0x66c04b){_0x99d88=_0x66c04b&&_0x43e4ca||!_0x66c04b&&!_0x43e4ca;}_0x4800d4[_0xbae7('0x1b')](function(_0x1fc9fb){if(_0x1fc9fb==='TagIds'){if(_0x99d88){_0x5b1abe['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1fc9fb);}else if(_0x44bdbb||_0x66c04b){_0x5b1abe[_0xbae7('0x1c')](_0x25d1a+'.'+_0x1fc9fb);}}else{_0x5b1abe[_0xbae7('0x1c')](_0x25d1a+'.'+_0x1fc9fb);}});return _0x5b1abe;}function getSqlClauses(){var _0x2e7a3c={'default':squel[_0xbae7('0x1d')](),'fields':squel[_0xbae7('0x1d')](),'filter':squel['expr'](),'tags':{'clause':squel[_0xbae7('0x1d')](),'ids':null},'user':{'clause':squel[_0xbae7('0x1d')](),'skip':![]}};return _0x2e7a3c;}function parseTagParameter(_0x34a82b){var _0x169bfb=squel[_0xbae7('0x1d')]();if(_0x34a82b){var _0x502f06=utils[_0xbae7('0x1e')](_0x34a82b);_0x502f06[_0xbae7('0x1b')](function(_0x361271){_0x169bfb['or'](_0xbae7('0x1f'),'%,'+_0x361271+',%');});}return _0x169bfb;}function parseSearchFilter(_0xb5d7f3){var _0x384ea6=squel[_0xbae7('0x1d')]();if(_0xb5d7f3){var _0x5c0245=_0xb5d7f3['replace']('\x5c','\x5c\x5c')[_0xbae7('0x20')](/'/g,'\x27\x27');if(_0x5c0245[_0xbae7('0x21')]('\x20')[_0xbae7('0x22')]>0x1){_0x384ea6['or'](_0xbae7('0x23'),qs[_0xbae7('0x24')](_0x5c0245),null);}else{if(qs[_0xbae7('0x25')](_0x5c0245)){_0x384ea6['or'](_0xbae7('0x26'),_0x5c0245+'%');_0x384ea6['or'](_0xbae7('0x27'),_0x5c0245+'%');_0x384ea6['or'](_0xbae7('0x28'),_0x5c0245+'%');_0x384ea6['or'](_0xbae7('0x29'),_0x5c0245+'%');}else if(qs[_0xbae7('0x2a')](_0x5c0245)){_0x384ea6['or'](_0xbae7('0x2b'),_0x5c0245+'%');}else{_0x384ea6['or']('c.firstName\x20LIKE\x20?','%'+_0x5c0245+'%');_0x384ea6['or']('c.lastName\x20LIKE\x20?','%'+_0x5c0245+'%');_0x384ea6['or']('c.email\x20LIKE\x20?','%'+_0x5c0245+'%');}}}return _0x384ea6;}function parseAdvancedSearchFilter(_0xa60a1c,_0x105a50){var _0x203848=getSqlClauses();var _0x12dd23=as[_0xbae7('0x2c')](_0xa60a1c);var _0x2d8202=_0x12dd23['sqlOperator'];for(var _0x5d702f=0x0;_0x5d702f<_0x12dd23[_0xbae7('0x2d')][_0xbae7('0x22')];_0x5d702f++){var _0x34feff=_0x12dd23[_0xbae7('0x2d')][_0x5d702f];var _0xcee3dd='c';var _0x2ddce5=_['find'](_0x105a50,[_0xbae7('0x2e'),_0x34feff[_0xbae7('0x1c')]]);if(_0x2ddce5){if(_0x34feff[_0xbae7('0x1c')]===_0xbae7('0x2f')||_0x2ddce5[_0xbae7('0x30')]===_0xbae7('0x31')){_0x34feff[_0xbae7('0x32')]=_0xbae7('0x33');}var _0x2846ce=as[_0xbae7('0x34')](_0xcee3dd,_0x2ddce5[_0xbae7('0x35')],_0x34feff);_0x203848[_0xbae7('0x36')][_0x2d8202](_0x2846ce['text'],_0x2846ce[_0xbae7('0x37')][_0xbae7('0x38')],_0x2846ce[_0xbae7('0x37')]['end']);}else{if(_0x34feff[_0xbae7('0x1c')]===_0xbae7('0x39')){var _0x5c417e=_0x34feff[_0xbae7('0x37')][_0xbae7('0x21')](',')[_0xbae7('0x3a')](function(_0xfbedad){return Number(_0xfbedad);});var _0x41aab0=parseTagParameter(_0x5c417e);_0x203848[_0xbae7('0x3b')][_0xbae7('0x3c')][_0xbae7('0x3d')](_0x41aab0);_0x203848[_0xbae7('0x3b')]['ids']=_0x5c417e;}else if(_0x34feff['field']===_0xbae7('0x3e')){_0x203848[_0xbae7('0x3f')]['clause'][_0xbae7('0x3d')](_0xbae7('0x40'),_0x34feff[_0xbae7('0x37')]);_0x203848[_0xbae7('0x3f')][_0xbae7('0x41')]=!![];}}}return _0x203848;}function parseModelFields(_0x112178,_0x133b81){var _0x45a2f8=squel['expr']();var _0x49f146=_(_0x112178)[_0xbae7('0x42')]()['map'](function(_0xc6f1c5){return _['some'](_0x133b81,[_0xbae7('0x2e'),_0xc6f1c5])?_0xc6f1c5:undefined;})[_0xbae7('0x43')]()[_0xbae7('0x37')]();if(_0x112178[_0xbae7('0x44')]){_0x49f146[_0xbae7('0x45')](_0xbae7('0x44'));}if(_0x49f146['length']>0x0){_0x49f146[_0xbae7('0x1b')](function(_0x4fa0ba){if(_0x4fa0ba==='ListId'){_0x45a2f8[_0xbae7('0x3d')](_0xbae7('0x46'),[][_0xbae7('0x47')](_0x112178[_0x4fa0ba]));}else if(_0x4fa0ba===_0xbae7('0x44')){var _0x32592c='%'+_0x112178[_0x4fa0ba]+'%';_0x45a2f8['and'](_0xbae7('0x48'),_0x32592c);}else{_0x45a2f8[_0xbae7('0x3d')]('c.'+_0x4fa0ba+_0xbae7('0x49'),_0x112178[_0x4fa0ba]);}});}return _0x45a2f8;}function parseQueryParameters(_0x2fe398,_0x18e20d){var _0x5047b0=getSqlClauses();return Promise[_0xbae7('0x4a')]()['then'](function(){return parseModelFields(_0x2fe398,_0x18e20d);})[_0xbae7('0x4b')](function(_0x3760fe){_0x5047b0[_0xbae7('0x4c')][_0xbae7('0x3d')](_0x3760fe);return parseTagParameter(_0x2fe398[_0xbae7('0x4d')]);})['then'](function(_0x41b647){_0x5047b0[_0xbae7('0x3b')][_0xbae7('0x3c')][_0xbae7('0x3d')](_0x41b647);return parseSearchFilter(_0x2fe398[_0xbae7('0x4e')]);})[_0xbae7('0x4b')](function(_0x300ffe){_0x5047b0['filter']=_0x300ffe;return _0x5047b0;});}function checkListsRestrictions(_0xa31bae,_0x38d6ae,_0x116aed){var _0x2b6790=squel[_0xbae7('0x1d')]();return Promise[_0xbae7('0x4a')]()['then'](function(){if(_0x38d6ae['search']&&_0xa31bae[_0xbae7('0x4f')]===_0xbae7('0x50')&&!_0x116aed){return _0xa31bae['getLists']({'attributes':['id'],'raw':!![]});}})[_0xbae7('0x4b')](function(_0x324043){if(_0x324043){if(_0x324043[_0xbae7('0x22')]===0x0){_0x2b6790[_0xbae7('0x3d')](_0xbae7('0x51'));}else{_0x2b6790['and'](_0xbae7('0x46'),_[_0xbae7('0x3a')](_0x324043,'id'));}}})[_0xbae7('0x4b')](function(){return _0x2b6790;});}function buildContactsQuery(_0x3c1543,_0x5d7e7a,_0xfc541f,_0x2881bc,_0x23ad3d,_0x45a41a){if(_0x5d7e7a){_0x5d7e7a=_0xfc541f['attributes'];}_0x3c1543=addFieldsToQuery(_0x3c1543,_0x5d7e7a,_0x2881bc,_0x45a41a,!![]);var _0x11722e=squel[_0xbae7('0x7')]();_0x11722e=addFieldsToQuery(_0x11722e,_0x5d7e7a,_0x2881bc,_0x45a41a,![]);if(_0x2881bc||_0x45a41a){_0x3c1543=applyJoinClauses(_0x3c1543,!![]);_0x3c1543[_0xbae7('0x52')](_0xbae7('0x53'));if(_0xfc541f['limit']){_0x11722e[_0xbae7('0x54')](_0xfc541f[_0xbae7('0x54')]);}if(_0xfc541f[_0xbae7('0x55')]){_0x11722e[_0xbae7('0x55')](_0xfc541f[_0xbae7('0x55')]);}}else{_0x11722e=applyJoinClauses(_0x11722e,![]);_0x11722e['group']('subqry.id');if(_0xfc541f['limit']){_0x3c1543[_0xbae7('0x54')](_0xfc541f[_0xbae7('0x54')]);}if(_0xfc541f[_0xbae7('0x55')]){_0x3c1543[_0xbae7('0x55')](_0xfc541f[_0xbae7('0x55')]);}}_0x11722e['having'](_0x23ad3d);if(_0xfc541f['order']){_0xfc541f[_0xbae7('0x56')][_0xbae7('0x1b')](function(_0x45a4c7){_0x3c1543['order']('c.'+_0x45a4c7[0x0],_0x45a4c7[0x1]===_0xbae7('0x57')?![]:!![]);_0x11722e[_0xbae7('0x56')](_0xbae7('0x58')+_0x45a4c7[0x0],_0x45a4c7[0x1]===_0xbae7('0x57')?![]:!![]);});}_0x11722e[_0xbae7('0x59')](_0x3c1543,'subqry');return _0x11722e;}function getFilteredContacts(_0x2ccd2c){var _0x59ac8a=[];return db[_0xbae7('0x39')][_0xbae7('0x5a')]({'attributes':['id',_0xbae7('0x2e'),_0xbae7('0x5b')],'raw':!![]})[_0xbae7('0x4b')](function(_0x12891d){_0x59ac8a=_['keyBy'](_0x12891d,'id');var _0x1af08a={'type':db[_0xbae7('0x5c')]['QueryTypes']['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xbae7('0x5d')](_0x2ccd2c[_0xbae7('0x5e')](),_0x1af08a);})[_0xbae7('0x4b')](function(_0x38952c){_0x38952c[_0xbae7('0x1b')](function(_0x17424d){if(_0x17424d['TagIds']){_0x17424d[_0xbae7('0x5f')]=[];_0x17424d[_0xbae7('0x1a')][_0xbae7('0x21')](',')[_0xbae7('0x1b')](function(_0x49f170){_0x17424d[_0xbae7('0x5f')][_0xbae7('0x45')](_0x59ac8a[_0x49f170]);});}delete _0x17424d['TagIds'];});return _0x38952c;});}function countFilteredContacts(_0x12c09e,_0x3bd80a){var _0x5b265d=_0x12c09e['clone']();_0x5b265d[_0xbae7('0x1c')](_0xbae7('0x60'));_0x5b265d=applyJoinClauses(_0x5b265d,!![]);_0x12c09e[_0xbae7('0x52')](_0xbae7('0x53'));var _0x371ca1=utils[_0xbae7('0x1e')](_0x3bd80a);if(!_[_0xbae7('0x61')](_0x371ca1)){_0x5b265d[_0xbae7('0x9')](_0xbae7('0x62'),_0x371ca1);}var _0x16d1e5={'type':db['Sequelize'][_0xbae7('0x63')][_0xbae7('0x64')],'raw':!![]};return db[_0xbae7('0x65')][_0xbae7('0x5d')](_0x5b265d[_0xbae7('0x5e')](),_0x16d1e5)[_0xbae7('0x4b')](function(_0x52a2b4){return _0x52a2b4[0x0][_0xbae7('0x60')];});}module[_0xbae7('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x35ff=['lastName','phone','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','forEach','TagIds','field','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','default','value','start','Tag','map','clause','and','user','uc.UserId\x20=\x20?','skip','some','name','compact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','tag','filter','resolve','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','having','order','DESC','findAll','Sequelize','QueryTypes','SELECT','CmContact','toString','Tags','COUNT(*)','getSelectedTags','isEmpty','sequelize','query','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId'];(function(_0x243fd3,_0x25e8d3){var _0x1575b7=function(_0x44d893){while(--_0x44d893){_0x243fd3['push'](_0x243fd3['shift']());}};_0x1575b7(++_0x25e8d3);}(_0x35ff,0xb3));var _0xf35f=function(_0x3f9e9a,_0xf9eed){_0x3f9e9a=_0x3f9e9a-0x0;var _0x2e5e11=_0x35ff[_0x3f9e9a];return _0x2e5e11;};'use strict';var _=require('lodash');var squel=require(_0xf35f('0x0'));var as=require(_0xf35f('0x1'));var qs=require('../parsers/qs');var utils=require(_0xf35f('0x2'));var db=require(_0xf35f('0x3'))['db'];function skipContactsQuery(_0x5f5d5f,_0x3531ae){var _0x481b60=![];if(_0x5f5d5f[_0xf35f('0x4')]===_0xf35f('0x5')&&!_0x3531ae[_0xf35f('0x6')]&&!_0x3531ae[_0xf35f('0x7')]&&_0x3531ae[_0xf35f('0x8')]!==_0xf35f('0x9')){_0x481b60=!![];}return _0x481b60;}function getContactsSubquery(){return squel['select']()[_0xf35f('0xa')](_0xf35f('0xb'),'c')[_0xf35f('0xc')](_0xf35f('0xd'));}function applyJoinClauses(_0x5ad244,_0x406771){var _0x30fa2d=_0x406771?'c':_0xf35f('0xe');_0x5ad244[_0xf35f('0xf')](_0xf35f('0x10'),'uc',_0xf35f('0x11')+_0x30fa2d+_0xf35f('0x12'))['left_join'](_0xf35f('0x13'),'ct',_0xf35f('0x14')+_0x30fa2d+_0xf35f('0x12'))[_0xf35f('0xf')](_0xf35f('0x15'),'t',_0xf35f('0x16'));return _0x5ad244;}function addFieldsToQuery(_0x26588a,_0x295701,_0x5b38be,_0x2f6645,_0x47b652){var _0xe29ff7=_0x47b652?'c':_0xf35f('0xe');if(!_0x295701){_0x295701=['id','firstName',_0xf35f('0x17'),_0xf35f('0x18'),_0xf35f('0x19'),_0xf35f('0x1a'),_0xf35f('0x1b'),'ListId',_0xf35f('0x1c'),_0xf35f('0x1d'),_0xf35f('0x1e'),_0xf35f('0x1f'),'TagIds'];}var _0x7c0c72=_0x5b38be&&_0x47b652||!_0x5b38be&&!_0x47b652;if(_0x2f6645){_0x7c0c72=_0x2f6645&&_0x47b652||!_0x2f6645&&!_0x47b652;}_0x295701[_0xf35f('0x20')](function(_0x3c76ee){if(_0x3c76ee===_0xf35f('0x21')){if(_0x7c0c72){_0x26588a[_0xf35f('0x22')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3c76ee);}else if(_0x5b38be||_0x2f6645){_0x26588a[_0xf35f('0x22')](_0xe29ff7+'.'+_0x3c76ee);}}else{_0x26588a[_0xf35f('0x22')](_0xe29ff7+'.'+_0x3c76ee);}});return _0x26588a;}function getSqlClauses(){var _0x210a97={'default':squel[_0xf35f('0x23')](),'fields':squel[_0xf35f('0x23')](),'filter':squel[_0xf35f('0x23')](),'tags':{'clause':squel[_0xf35f('0x23')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x210a97;}function parseTagParameter(_0x111519){var _0x27459a=squel['expr']();if(_0x111519){var _0x319a63=utils['getSelectedTags'](_0x111519);_0x319a63[_0xf35f('0x20')](function(_0x559807){_0x27459a['or'](_0xf35f('0x24'),'%,'+_0x559807+',%');});}return _0x27459a;}function parseSearchFilter(_0x31ac01){var _0x43e723=squel['expr']();if(_0x31ac01){var _0x27e223=_0x31ac01[_0xf35f('0x25')]('\x5c','\x5c\x5c')[_0xf35f('0x25')](/'/g,'\x27\x27');if(_0x27e223[_0xf35f('0x26')]('\x20')[_0xf35f('0x27')]>0x1){_0x43e723['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x27e223),null);}else{if(qs[_0xf35f('0x28')](_0x27e223)){_0x43e723['or'](_0xf35f('0x29'),_0x27e223+'%');_0x43e723['or'](_0xf35f('0x2a'),_0x27e223+'%');_0x43e723['or'](_0xf35f('0x2b'),_0x27e223+'%');_0x43e723['or'](_0xf35f('0x2c'),_0x27e223+'%');}else if(qs['isEmail'](_0x27e223)){_0x43e723['or'](_0xf35f('0x2d'),_0x27e223+'%');}else{_0x43e723['or']('c.firstName\x20LIKE\x20?','%'+_0x27e223+'%');_0x43e723['or'](_0xf35f('0x2e'),'%'+_0x27e223+'%');_0x43e723['or'](_0xf35f('0x2d'),'%'+_0x27e223+'%');}}}return _0x43e723;}function parseAdvancedSearchFilter(_0x5282b2,_0x3e2ce9){var _0x3f88dc=getSqlClauses();var _0x24f82e=as[_0xf35f('0x2f')](_0x5282b2);var _0x4593c6=_0x24f82e[_0xf35f('0x30')];for(var _0xdc93a5=0x0;_0xdc93a5<_0x24f82e[_0xf35f('0x31')][_0xf35f('0x27')];_0xdc93a5++){var _0x2054a3=_0x24f82e[_0xf35f('0x31')][_0xdc93a5];var _0x399d63='c';var _0xeac473=_[_0xf35f('0x32')](_0x3e2ce9,['name',_0x2054a3[_0xf35f('0x22')]]);if(_0xeac473){if(_0x2054a3[_0xf35f('0x22')]===_0xf35f('0x33')||_0xeac473[_0xf35f('0x34')]===_0xf35f('0x35')){_0x2054a3[_0xf35f('0x36')]=_0xf35f('0x37');}var _0x338ad7=as[_0xf35f('0x38')](_0x399d63,_0xeac473['type'],_0x2054a3);_0x3f88dc[_0xf35f('0x39')][_0x4593c6](_0x338ad7['text'],_0x338ad7[_0xf35f('0x3a')][_0xf35f('0x3b')],_0x338ad7[_0xf35f('0x3a')]['end']);}else{if(_0x2054a3[_0xf35f('0x22')]===_0xf35f('0x3c')){var _0x3d69af=_0x2054a3[_0xf35f('0x3a')][_0xf35f('0x26')](',')[_0xf35f('0x3d')](function(_0x196006){return Number(_0x196006);});var _0x1fa443=parseTagParameter(_0x3d69af);_0x3f88dc['tags'][_0xf35f('0x3e')][_0xf35f('0x3f')](_0x1fa443);_0x3f88dc['tags']['ids']=_0x3d69af;}else if(_0x2054a3['field']==='User'){_0x3f88dc[_0xf35f('0x40')]['clause'][_0xf35f('0x3f')](_0xf35f('0x41'),_0x2054a3[_0xf35f('0x3a')]);_0x3f88dc[_0xf35f('0x40')][_0xf35f('0x42')]=!![];}}}return _0x3f88dc;}function parseModelFields(_0x24b1b2,_0x119f65){var _0x4c6b78=squel[_0xf35f('0x23')]();var _0x386036=_(_0x24b1b2)['keys']()['map'](function(_0x3df6cf){return _[_0xf35f('0x43')](_0x119f65,[_0xf35f('0x44'),_0x3df6cf])?_0x3df6cf:undefined;})[_0xf35f('0x45')]()[_0xf35f('0x3a')]();if(_0x24b1b2['Contact']){_0x386036[_0xf35f('0x46')]('Contact');}if(_0x386036['length']>0x0){_0x386036[_0xf35f('0x20')](function(_0x5de59e){if(_0x5de59e===_0xf35f('0x7')){_0x4c6b78[_0xf35f('0x3f')](_0xf35f('0x47'),[][_0xf35f('0x48')](_0x24b1b2[_0x5de59e]));}else if(_0x5de59e==='Contact'){var _0x223be5='%'+_0x24b1b2[_0x5de59e]+'%';_0x4c6b78[_0xf35f('0x3f')](_0xf35f('0x49'),_0x223be5);}else{_0x4c6b78[_0xf35f('0x3f')]('c.'+_0x5de59e+'\x20=\x20?',_0x24b1b2[_0x5de59e]);}});}return _0x4c6b78;}function parseQueryParameters(_0x53ce73,_0x2abdb4){var _0x3fb1bd=getSqlClauses();return Promise['resolve']()[_0xf35f('0x4a')](function(){return parseModelFields(_0x53ce73,_0x2abdb4);})['then'](function(_0x23e6d9){_0x3fb1bd[_0xf35f('0x4b')][_0xf35f('0x3f')](_0x23e6d9);return parseTagParameter(_0x53ce73[_0xf35f('0x4c')]);})[_0xf35f('0x4a')](function(_0x499fa3){_0x3fb1bd['tags']['clause']['and'](_0x499fa3);return parseSearchFilter(_0x53ce73[_0xf35f('0x4d')]);})[_0xf35f('0x4a')](function(_0x1b8b96){_0x3fb1bd[_0xf35f('0x4d')]=_0x1b8b96;return _0x3fb1bd;});}function checkListsRestrictions(_0x3e150b,_0x16bcb1,_0x499285){var _0x26eda3=squel[_0xf35f('0x23')]();return Promise[_0xf35f('0x4e')]()[_0xf35f('0x4a')](function(){if(_0x16bcb1[_0xf35f('0x6')]&&_0x3e150b[_0xf35f('0x4')]===_0xf35f('0x5')&&!_0x499285){return _0x3e150b['getLists']({'attributes':['id'],'raw':!![]});}})[_0xf35f('0x4a')](function(_0x12b8b8){if(_0x12b8b8){if(_0x12b8b8[_0xf35f('0x27')]===0x0){_0x26eda3[_0xf35f('0x3f')](_0xf35f('0x4f'));}else{_0x26eda3[_0xf35f('0x3f')](_0xf35f('0x47'),_['map'](_0x12b8b8,'id'));}}})[_0xf35f('0x4a')](function(){return _0x26eda3;});}function buildContactsQuery(_0x2f2c88,_0x4d49ea,_0x49aa7e,_0x5e7a01,_0x7a9be,_0x244b80){if(_0x4d49ea){_0x4d49ea=_0x49aa7e[_0xf35f('0x50')];}_0x2f2c88=addFieldsToQuery(_0x2f2c88,_0x4d49ea,_0x5e7a01,_0x244b80,!![]);var _0x48fb8c=squel[_0xf35f('0x51')]();_0x48fb8c=addFieldsToQuery(_0x48fb8c,_0x4d49ea,_0x5e7a01,_0x244b80,![]);if(_0x5e7a01||_0x244b80){_0x2f2c88=applyJoinClauses(_0x2f2c88,!![]);_0x2f2c88[_0xf35f('0x52')](_0xf35f('0x53'));if(_0x49aa7e[_0xf35f('0x54')]){_0x48fb8c[_0xf35f('0x54')](_0x49aa7e['limit']);}if(_0x49aa7e[_0xf35f('0x55')]){_0x48fb8c['offset'](_0x49aa7e[_0xf35f('0x55')]);}}else{_0x48fb8c=applyJoinClauses(_0x48fb8c,![]);_0x48fb8c[_0xf35f('0x52')]('subqry.id');if(_0x49aa7e[_0xf35f('0x54')]){_0x2f2c88['limit'](_0x49aa7e[_0xf35f('0x54')]);}if(_0x49aa7e[_0xf35f('0x55')]){_0x2f2c88[_0xf35f('0x55')](_0x49aa7e[_0xf35f('0x55')]);}}_0x48fb8c[_0xf35f('0x56')](_0x7a9be);if(_0x49aa7e[_0xf35f('0x57')]){_0x49aa7e[_0xf35f('0x57')][_0xf35f('0x20')](function(_0x41d545){_0x2f2c88[_0xf35f('0x57')]('c.'+_0x41d545[0x0],_0x41d545[0x1]===_0xf35f('0x58')?![]:!![]);_0x48fb8c[_0xf35f('0x57')]('subqry.'+_0x41d545[0x0],_0x41d545[0x1]===_0xf35f('0x58')?![]:!![]);});}_0x48fb8c[_0xf35f('0xa')](_0x2f2c88,_0xf35f('0xe'));return _0x48fb8c;}function getFilteredContacts(_0x1d2555){var _0x93cad6=[];return db[_0xf35f('0x3c')][_0xf35f('0x59')]({'attributes':['id',_0xf35f('0x44'),'color'],'raw':!![]})[_0xf35f('0x4a')](function(_0x183a57){_0x93cad6=_['keyBy'](_0x183a57,'id');var _0x4504ba={'type':db[_0xf35f('0x5a')][_0xf35f('0x5b')][_0xf35f('0x5c')],'model':db[_0xf35f('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x1d2555[_0xf35f('0x5e')](),_0x4504ba);})[_0xf35f('0x4a')](function(_0x40e405){_0x40e405[_0xf35f('0x20')](function(_0x474d62){if(_0x474d62['TagIds']){_0x474d62[_0xf35f('0x5f')]=[];_0x474d62[_0xf35f('0x21')][_0xf35f('0x26')](',')[_0xf35f('0x20')](function(_0x11e4f3){_0x474d62[_0xf35f('0x5f')][_0xf35f('0x46')](_0x93cad6[_0x11e4f3]);});}delete _0x474d62[_0xf35f('0x21')];});return _0x40e405;});}function countFilteredContacts(_0xd0760c,_0x56ce27){var _0x465493=_0xd0760c['clone']();_0x465493['field'](_0xf35f('0x60'));_0x465493=applyJoinClauses(_0x465493,!![]);_0xd0760c[_0xf35f('0x52')](_0xf35f('0x53'));var _0x369226=utils[_0xf35f('0x61')](_0x56ce27);if(!_[_0xf35f('0x62')](_0x369226)){_0x465493[_0xf35f('0xc')]('t.id\x20IN\x20?',_0x369226);}var _0x19313d={'type':db[_0xf35f('0x5a')][_0xf35f('0x5b')][_0xf35f('0x5c')],'raw':!![]};return db[_0xf35f('0x63')][_0xf35f('0x64')](_0x465493[_0xf35f('0x5e')](),_0x19313d)[_0xf35f('0x4a')](function(_0x3748d7){return _0x3748d7[0x0][_0xf35f('0x60')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index e26e23c..31e463c 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 _0xea42=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','write','end','final','close','unlink','createDecipher','data','binary','encryptString','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xea42,0x18c));var _0x2ea4=function(_0x15dba5,_0x13e360){_0x15dba5=_0x15dba5-0x0;var _0x1d0f8d=_0xea42[_0x15dba5];return _0x1d0f8d;};'use strict';var crypto=require(_0x2ea4('0x0'));var fs=require('fs');var BPromise=require(_0x2ea4('0x1'));var _=require(_0x2ea4('0x2'));var config=require(_0x2ea4('0x3'));var logger=require(_0x2ea4('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2ea4('0x5')][_0x2ea4('0x6')],'algorithm':_0x2ea4('0x7')};const fileOptions={'algorithm':_0x2ea4('0x8')};if(config[_0x2ea4('0x9')]&&config[_0x2ea4('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x2ea4('0x9')][_0x2ea4('0xa')]);if(isSupported){fileOptions[_0x2ea4('0xa')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x2ea4('0xb')](config[_0x2ea4('0x9')][_0x2ea4('0xa')],_0x2ea4('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1cd968){return AES_SUPPORTED_RX[_0x2ea4('0xd')](_0x1cd968);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x2ea4('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x5c169d){return getSupportedCiphers()[_0x2ea4('0xf')](_0x5c169d)>-0x1;}function combineOptions(_0x216ac1){var _0x4c0f5c={};for(var _0x350009 in fileOptions){if(fileOptions[_0x2ea4('0x10')](_0x350009)){_0x4c0f5c[_0x350009]=fileOptions[_0x350009];}}if(_0x216ac1){for(var _0x3f94ac in _0x216ac1){if(_0x216ac1[_0x2ea4('0x10')](_0x3f94ac)){_0x4c0f5c[_0x3f94ac]=_0x216ac1[_0x3f94ac];}}}return _0x4c0f5c;}exports['encryptFile']=function(_0x52f070,_0x3f8fbf,_0x187cd5,_0x4b8060){return new BPromise(function(_0x19026e,_0x2c92a0){_0x4b8060=combineOptions(_0x4b8060);var _0x1d934e=new Buffer(_0x187cd5);var _0x749319=fs[_0x2ea4('0x11')](_0x52f070);var _0x3ec0cc=fs[_0x2ea4('0x12')](_0x3f8fbf);var _0x52b6f1=crypto[_0x2ea4('0x13')](_0x4b8060[_0x2ea4('0xa')],_0x1d934e);_0x749319['on']('data',function(_0x3b4ce0){var _0x260cc9=new Buffer(_0x52b6f1[_0x2ea4('0x14')](_0x3b4ce0),'binary');_0x3ec0cc[_0x2ea4('0x15')](_0x260cc9);});_0x749319['on'](_0x2ea4('0x16'),function(){try{var _0x35c459=new Buffer(_0x52b6f1[_0x2ea4('0x17')]('binary'),'binary');_0x3ec0cc['write'](_0x35c459);_0x3ec0cc[_0x2ea4('0x16')]();_0x3ec0cc['on'](_0x2ea4('0x18'),function(){return _0x19026e(_0x3f8fbf);});}catch(_0x54aaa7){fs[_0x2ea4('0x19')](_0x3f8fbf);return _0x2c92a0(_0x54aaa7);}});});};exports['decryptFile']=function(_0x2a08c4,_0x483850,_0x929078,_0x20b513){return new BPromise(function(_0x3d029e,_0x59e04c){_0x20b513=combineOptions(_0x20b513);var _0x1d442f=new Buffer(_0x929078);var _0x205e8e=fs['createReadStream'](_0x2a08c4);var _0xdecfa1=fs[_0x2ea4('0x12')](_0x483850);var _0x304a68=crypto[_0x2ea4('0x1a')](_0x20b513[_0x2ea4('0xa')],_0x1d442f);_0x205e8e['on'](_0x2ea4('0x1b'),function(_0x5146d4){var _0x298dcc=new Buffer(_0x304a68[_0x2ea4('0x14')](_0x5146d4),_0x2ea4('0x1c'));_0xdecfa1[_0x2ea4('0x15')](_0x298dcc);});_0x205e8e['on']('end',function(){try{var _0x571e2d=new Buffer(_0x304a68[_0x2ea4('0x17')](_0x2ea4('0x1c')),_0x2ea4('0x1c'));_0xdecfa1[_0x2ea4('0x15')](_0x571e2d);_0xdecfa1[_0x2ea4('0x16')]();_0xdecfa1['on'](_0x2ea4('0x18'),function(){return _0x3d029e(_0x483850);});}catch(_0x527c7f){fs['unlink'](_0x483850);return _0x59e04c(_0x527c7f);}});});};exports[_0x2ea4('0x1d')]=function(_0x3bce61,_0x217239,_0xa5b49c){var _0x423c7f=_0xa5b49c||stringOptions[_0x2ea4('0xa')];var _0x2fcae8=_0x217239||stringOptions[_0x2ea4('0x1e')];var _0x5ec846=crypto[_0x2ea4('0x13')](_0x423c7f,_0x2fcae8);var _0x1ab749=_0x5ec846[_0x2ea4('0x14')](_0x3bce61,'utf8',_0x2ea4('0x1f'));_0x1ab749+=_0x5ec846['final']('base64');return _0x1ab749;};exports[_0x2ea4('0x20')]=function(_0x574b06,_0x29488b,_0x1fc8db){var _0x444bde=_0x1fc8db||stringOptions[_0x2ea4('0xa')];var _0x3bba3d=_0x29488b||stringOptions[_0x2ea4('0x1e')];var _0x40aec8=crypto[_0x2ea4('0x1a')](_0x444bde,_0x3bba3d);var _0x20e468=_0x40aec8[_0x2ea4('0x14')](_0x574b06,_0x2ea4('0x1f'),_0x2ea4('0x21'));_0x20e468+=_0x40aec8[_0x2ea4('0x17')](_0x2ea4('0x21'));return _0x20e468;}; \ No newline at end of file +var _0x0982=['base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','write','end','final','binary','unlink','decryptFile','createWriteStream','createDecipher','encryptString','secret','update','utf8'];(function(_0x13d411,_0x12f761){var _0x534940=function(_0x1db671){while(--_0x1db671){_0x13d411['push'](_0x13d411['shift']());}};_0x534940(++_0x12f761);}(_0x0982,0xce));var _0x2098=function(_0x4c7d2b,_0x3a7ea7){_0x4c7d2b=_0x4c7d2b-0x0;var _0x436dca=_0x0982[_0x4c7d2b];return _0x436dca;};'use strict';var crypto=require(_0x2098('0x0'));var fs=require('fs');var BPromise=require(_0x2098('0x1'));var _=require(_0x2098('0x2'));var config=require(_0x2098('0x3'));var logger=require(_0x2098('0x4'))(_0x2098('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x2098('0x6')};const fileOptions={'algorithm':_0x2098('0x7')};if(config[_0x2098('0x8')]&&config[_0x2098('0x8')][_0x2098('0x9')]){var isSupported=isAlgorithmSupported(config[_0x2098('0x8')][_0x2098('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x2098('0x8')][_0x2098('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x2098('0x8')][_0x2098('0x9')],_0x2098('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x3652b3){return AES_SUPPORTED_RX[_0x2098('0xb')](_0x3652b3);}function getSupportedCiphers(){return crypto[_0x2098('0xc')]()[_0x2098('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x502b80){return getSupportedCiphers()[_0x2098('0xe')](_0x502b80)>-0x1;}function combineOptions(_0x452fe9){var _0x4ab2f2={};for(var _0x57e181 in fileOptions){if(fileOptions[_0x2098('0xf')](_0x57e181)){_0x4ab2f2[_0x57e181]=fileOptions[_0x57e181];}}if(_0x452fe9){for(var _0x28c587 in _0x452fe9){if(_0x452fe9[_0x2098('0xf')](_0x28c587)){_0x4ab2f2[_0x28c587]=_0x452fe9[_0x28c587];}}}return _0x4ab2f2;}exports[_0x2098('0x10')]=function(_0x48f138,_0x16a270,_0x7c9683,_0x22d369){return new BPromise(function(_0x1b2cfc,_0x2d8173){_0x22d369=combineOptions(_0x22d369);var _0x483c52=new Buffer(_0x7c9683);var _0x459c0d=fs[_0x2098('0x11')](_0x48f138);var _0x26efc3=fs['createWriteStream'](_0x16a270);var _0x4700d5=crypto[_0x2098('0x12')](_0x22d369[_0x2098('0x9')],_0x483c52);_0x459c0d['on'](_0x2098('0x13'),function(_0x4fedc1){var _0xa35f84=new Buffer(_0x4700d5['update'](_0x4fedc1),'binary');_0x26efc3[_0x2098('0x14')](_0xa35f84);});_0x459c0d['on'](_0x2098('0x15'),function(){try{var _0x1d7c8d=new Buffer(_0x4700d5[_0x2098('0x16')](_0x2098('0x17')),'binary');_0x26efc3[_0x2098('0x14')](_0x1d7c8d);_0x26efc3[_0x2098('0x15')]();_0x26efc3['on']('close',function(){return _0x1b2cfc(_0x16a270);});}catch(_0x34c419){fs[_0x2098('0x18')](_0x16a270);return _0x2d8173(_0x34c419);}});});};exports[_0x2098('0x19')]=function(_0x5c66af,_0x2c01f0,_0xe59efa,_0x4615ab){return new BPromise(function(_0x110216,_0x445783){_0x4615ab=combineOptions(_0x4615ab);var _0xdc717b=new Buffer(_0xe59efa);var _0x5a2ef1=fs[_0x2098('0x11')](_0x5c66af);var _0x56b9ee=fs[_0x2098('0x1a')](_0x2c01f0);var _0x1ef56d=crypto[_0x2098('0x1b')](_0x4615ab[_0x2098('0x9')],_0xdc717b);_0x5a2ef1['on'](_0x2098('0x13'),function(_0x1938b7){var _0x54104f=new Buffer(_0x1ef56d['update'](_0x1938b7),_0x2098('0x17'));_0x56b9ee[_0x2098('0x14')](_0x54104f);});_0x5a2ef1['on'](_0x2098('0x15'),function(){try{var _0x5d16de=new Buffer(_0x1ef56d['final'](_0x2098('0x17')),_0x2098('0x17'));_0x56b9ee[_0x2098('0x14')](_0x5d16de);_0x56b9ee[_0x2098('0x15')]();_0x56b9ee['on']('close',function(){return _0x110216(_0x2c01f0);});}catch(_0x205332){fs[_0x2098('0x18')](_0x2c01f0);return _0x445783(_0x205332);}});});};exports[_0x2098('0x1c')]=function(_0x3f81c1,_0x113677,_0x1819c4){var _0x609ed7=_0x1819c4||stringOptions['algorithm'];var _0x1966fe=_0x113677||stringOptions[_0x2098('0x1d')];var _0x442c68=crypto['createCipher'](_0x609ed7,_0x1966fe);var _0x9d216f=_0x442c68[_0x2098('0x1e')](_0x3f81c1,_0x2098('0x1f'),_0x2098('0x20'));_0x9d216f+=_0x442c68[_0x2098('0x16')](_0x2098('0x20'));return _0x9d216f;};exports[_0x2098('0x21')]=function(_0x32590e,_0x3ed9a9,_0x3fd178){var _0xbe5e2d=_0x3fd178||stringOptions['algorithm'];var _0x31325a=_0x3ed9a9||stringOptions[_0x2098('0x1d')];var _0x4fec57=crypto[_0x2098('0x1b')](_0xbe5e2d,_0x31325a);var _0x18039b=_0x4fec57['update'](_0x32590e,_0x2098('0x20'),_0x2098('0x1f'));_0x18039b+=_0x4fec57[_0x2098('0x16')]('utf8');return _0x18039b;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 16f14f4..49b9aa0 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 _0xcb0f=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','length','range','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','zip'];(function(_0x53c941,_0x581f38){var _0x4781da=function(_0x42184a){while(--_0x42184a){_0x53c941['push'](_0x53c941['shift']());}};_0x4781da(++_0x581f38);}(_0xcb0f,0x186));var _0xfcb0=function(_0x469d8e,_0x2e2a11){_0x469d8e=_0x469d8e-0x0;var _0x5973dc=_0xcb0f[_0x469d8e];return _0x5973dc;};'use strict';var util=require(_0xfcb0('0x0'));var path=require(_0xfcb0('0x1'));var _=require(_0xfcb0('0x2'));var csv=require(_0xfcb0('0x3'));var fs=require('fs');var BPromise=require(_0xfcb0('0x4'));var zipdir=require(_0xfcb0('0x5'));var rimraf=require('rimraf');var db=require(_0xfcb0('0x6'))['db'];var dbH=require(_0xfcb0('0x6'))[_0xfcb0('0x7')];var logger=require(_0xfcb0('0x8'))(_0xfcb0('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xfcb0('0xa')][0x2]);var QUERY=process[_0xfcb0('0xa')][0x3];var PATH=process[_0xfcb0('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd62e9b,_0x1904c8){var _0x434aae={'status':_0xd62e9b};var _0x440100={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1904c8){_0x434aae[_0xfcb0('0xb')]=_0x1904c8;}return db[_0xfcb0('0xc')][_0xfcb0('0xd')](_0x434aae,_0x440100);}function main(){var _0x1b4816=0x1388;var _0x2efce0;logger[_0xfcb0('0xe')](util[_0xfcb0('0xf')](_0xfcb0('0x10'),EXTRACTED_REPORT_ID,_0xfcb0('0x11')));return db['Setting'][_0xfcb0('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfcb0('0x13'),_0xfcb0('0x14')]})[_0xfcb0('0x15')](function(_0x1a02bb){if(_0x1a02bb){_0x2efce0=_0x1a02bb;_0x1b4816=_0x2efce0[_0xfcb0('0x14')]||0x1388;}})[_0xfcb0('0x15')](function(){return dbH[_0xfcb0('0x16')]['query'](util[_0xfcb0('0xf')](_0xfcb0('0x17'),QUERY),{'type':dbH[_0xfcb0('0x16')][_0xfcb0('0x18')]['SELECT']});})[_0xfcb0('0x15')](function(_0x41c1a3){if(!_0x41c1a3[0x0][_0xfcb0('0x19')]){return analyticExtractedReport('Empty');}var _0x1bbc87=[];var _0x693285=0x0;if(_0x2efce0[_0xfcb0('0x13')]){if(_0x41c1a3&&_0x41c1a3[_0xfcb0('0x1a')]){var _0x567015=_[_0xfcb0('0x1b')](_0x41c1a3[0x0][_0xfcb0('0x19')]/_0x1b4816);var _0x2cb53f=Number[_0xfcb0('0x1c')](_0x41c1a3[0x0][_0xfcb0('0x19')]/_0x1b4816)?_0x41c1a3[0x0][_0xfcb0('0x19')]%_0x1b4816:0x0;_0x567015['forEach'](function(_0x62ea8a){if(_0x62ea8a>0x0){_0x693285+=_0x1b4816;}_0x1bbc87[_0xfcb0('0x1d')](dbH[_0xfcb0('0x16')][_0xfcb0('0x1e')](util[_0xfcb0('0xf')](_0xfcb0('0x1f'),QUERY,_0x1b4816,_0x693285),{'type':dbH['sequelize'][_0xfcb0('0x18')]['SELECT']}));});if(_0x2cb53f>0x0){_0x693285+=_0x1b4816;_0x1bbc87[_0xfcb0('0x1d')](dbH['sequelize'][_0xfcb0('0x1e')](util[_0xfcb0('0xf')](_0xfcb0('0x1f'),QUERY,_0x2cb53f,_0x693285),{'type':dbH[_0xfcb0('0x16')][_0xfcb0('0x18')]['SELECT']}));}}}else{_0x1bbc87['push'](dbH[_0xfcb0('0x16')][_0xfcb0('0x1e')](QUERY,{'type':dbH[_0xfcb0('0x16')]['QueryTypes'][_0xfcb0('0x20')]}));}var _0x5302df=path[_0xfcb0('0x21')](PATH);var _0x4f1be2=path['basename'](PATH,_0xfcb0('0x22'));var _0x240619=_0x2efce0[_0xfcb0('0x13')]&&_0x1bbc87[_0xfcb0('0x1a')]>0x1;var _0x273f7e=[];if(!fs[_0xfcb0('0x23')](path[_0xfcb0('0x24')](_0x5302df,_0x4f1be2))&&_0x240619){fs[_0xfcb0('0x25')](path[_0xfcb0('0x24')](_0x5302df,_0x4f1be2));}return BPromise['each'](_0x1bbc87,function(_0x164354){_0x273f7e[_0xfcb0('0x1d')](_0x164354);})[_0xfcb0('0x15')](function(){for(var _0x36bb98=0x0;_0x36bb98<_0x273f7e[_0xfcb0('0x1a')];_0x36bb98+=0x1){var _0x2f0de0;var _0x32cb2d=_0x273f7e[_0x36bb98];if(_0x240619){_0x2f0de0=path['join'](_0x5302df,_0x4f1be2,util[_0xfcb0('0xf')](_0xfcb0('0x26'),_0x4f1be2,_0x36bb98,_0xfcb0('0x27')));}else{_0x2f0de0=path[_0xfcb0('0x24')](_0x5302df,util[_0xfcb0('0xf')](_0xfcb0('0x28'),_0x4f1be2,_0xfcb0('0x27')));}fs['writeFileSync'](_0x2f0de0,csv(_0x32cb2d));}})[_0xfcb0('0x15')](function(){if(_0x240619){return new Promise(function(_0x54bd17){zipdir(path[_0xfcb0('0x24')](_0x5302df,_0x4f1be2),{'saveTo':path['join'](_0x5302df,util[_0xfcb0('0xf')](_0xfcb0('0x28'),_0x4f1be2,_0xfcb0('0x29')))},function(_0x37e290,_0x138640){rimraf(path[_0xfcb0('0x24')](_0x5302df,_0x4f1be2),function(){});_0x54bd17('zip\x20finished');});});}})[_0xfcb0('0x15')](function(){logger[_0xfcb0('0xe')](util[_0xfcb0('0xf')](_0xfcb0('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xfcb0('0x2b'),_0x240619?util['format'](_0xfcb0('0x28'),_0x4f1be2,_0x240619?_0xfcb0('0x29'):_0xfcb0('0x27')):null);});})[_0xfcb0('0x2c')](function(_0x132d91){logger[_0xfcb0('0xe')](util[_0xfcb0('0xf')](_0xfcb0('0x2d'),EXTRACTED_REPORT_ID,_0xfcb0('0x11')),util['inspect'](_0x132d91,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfcb0('0x2e'));})[_0xfcb0('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9940=['../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','sequelize','format','SELECT','then','num','length','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Completed','catch','Failed','exit','util','to-csv','bluebird','rimraf','../../mysqldb','dbH'];(function(_0x51c9ea,_0x2cb9bb){var _0x19410f=function(_0x4dba34){while(--_0x4dba34){_0x51c9ea['push'](_0x51c9ea['shift']());}};_0x19410f(++_0x2cb9bb);}(_0x9940,0xdb));var _0x0994=function(_0x5c105b,_0x388b0f){_0x5c105b=_0x5c105b-0x0;var _0xf1cd09=_0x9940[_0x5c105b];return _0xf1cd09;};'use strict';var util=require(_0x0994('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x0994('0x1'));var fs=require('fs');var BPromise=require(_0x0994('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x0994('0x3'));var db=require(_0x0994('0x4'))['db'];var dbH=require(_0x0994('0x4'))[_0x0994('0x5')];var logger=require(_0x0994('0x6'))(_0x0994('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x0994('0x8')][0x2]);var QUERY=process[_0x0994('0x8')][0x3];var PATH=process[_0x0994('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2de31c,_0x4a3ab2){var _0x4ffabb={'status':_0x2de31c};var _0x17931d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a3ab2){_0x4ffabb[_0x0994('0x9')]=_0x4a3ab2;}return db[_0x0994('0xa')][_0x0994('0xb')](_0x4ffabb,_0x17931d);}function main(){var _0x8c8623=0x1388;var _0x564b83;logger[_0x0994('0xc')](util['format'](_0x0994('0xd'),EXTRACTED_REPORT_ID,_0x0994('0xe')));return db[_0x0994('0xf')][_0x0994('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0994('0x11'),_0x0994('0x12')]})['then'](function(_0x257f35){if(_0x257f35){_0x564b83=_0x257f35;_0x8c8623=_0x564b83[_0x0994('0x12')]||0x1388;}})['then'](function(){return dbH[_0x0994('0x13')]['query'](util[_0x0994('0x14')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0994('0x13')]['QueryTypes'][_0x0994('0x15')]});})[_0x0994('0x16')](function(_0x57b23b){if(!_0x57b23b[0x0][_0x0994('0x17')]){return analyticExtractedReport('Empty');}var _0x2b3beb=[];var _0x2de4ab=0x0;if(_0x564b83['split']){if(_0x57b23b&&_0x57b23b[_0x0994('0x18')]){var _0x40c539=_['range'](_0x57b23b[0x0][_0x0994('0x17')]/_0x8c8623);var _0x3ca60d=Number[_0x0994('0x19')](_0x57b23b[0x0][_0x0994('0x17')]/_0x8c8623)?_0x57b23b[0x0][_0x0994('0x17')]%_0x8c8623:0x0;_0x40c539[_0x0994('0x1a')](function(_0x595b62){if(_0x595b62>0x0){_0x2de4ab+=_0x8c8623;}_0x2b3beb['push'](dbH['sequelize'][_0x0994('0x1b')](util[_0x0994('0x14')](_0x0994('0x1c'),QUERY,_0x8c8623,_0x2de4ab),{'type':dbH[_0x0994('0x13')][_0x0994('0x1d')][_0x0994('0x15')]}));});if(_0x3ca60d>0x0){_0x2de4ab+=_0x8c8623;_0x2b3beb['push'](dbH[_0x0994('0x13')][_0x0994('0x1b')](util[_0x0994('0x14')](_0x0994('0x1c'),QUERY,_0x3ca60d,_0x2de4ab),{'type':dbH[_0x0994('0x13')][_0x0994('0x1d')]['SELECT']}));}}}else{_0x2b3beb[_0x0994('0x1e')](dbH[_0x0994('0x13')][_0x0994('0x1b')](QUERY,{'type':dbH[_0x0994('0x13')][_0x0994('0x1d')][_0x0994('0x15')]}));}var _0x3b3682=path['dirname'](PATH);var _0x4cdc30=path['basename'](PATH,_0x0994('0x1f'));var _0x558ca0=_0x564b83['split']&&_0x2b3beb['length']>0x1;var _0x22f44a=[];if(!fs[_0x0994('0x20')](path[_0x0994('0x21')](_0x3b3682,_0x4cdc30))&&_0x558ca0){fs[_0x0994('0x22')](path[_0x0994('0x21')](_0x3b3682,_0x4cdc30));}return BPromise[_0x0994('0x23')](_0x2b3beb,function(_0x49ea85){_0x22f44a['push'](_0x49ea85);})[_0x0994('0x16')](function(){for(var _0x328051=0x0;_0x328051<_0x22f44a[_0x0994('0x18')];_0x328051+=0x1){var _0x2f5107;var _0xba4ec=_0x22f44a[_0x328051];if(_0x558ca0){_0x2f5107=path[_0x0994('0x21')](_0x3b3682,_0x4cdc30,util[_0x0994('0x14')](_0x0994('0x24'),_0x4cdc30,_0x328051,_0x0994('0x25')));}else{_0x2f5107=path[_0x0994('0x21')](_0x3b3682,util['format'](_0x0994('0x26'),_0x4cdc30,_0x0994('0x25')));}fs['writeFileSync'](_0x2f5107,csv(_0xba4ec));}})['then'](function(){if(_0x558ca0){return new Promise(function(_0x38ee7e){zipdir(path[_0x0994('0x21')](_0x3b3682,_0x4cdc30),{'saveTo':path[_0x0994('0x21')](_0x3b3682,util[_0x0994('0x14')](_0x0994('0x26'),_0x4cdc30,_0x0994('0x27')))},function(_0x1ee025,_0x17b468){rimraf(path['join'](_0x3b3682,_0x4cdc30),function(){});_0x38ee7e(_0x0994('0x28'));});});}})[_0x0994('0x16')](function(){logger['info'](util[_0x0994('0x14')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0994('0x29'),_0x558ca0?util[_0x0994('0x14')]('%s.%s',_0x4cdc30,_0x558ca0?_0x0994('0x27'):_0x0994('0x25')):null);});})[_0x0994('0x2a')](function(_0x1ff405){logger[_0x0994('0xc')](util[_0x0994('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x1ff405,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0994('0x2b'));})['finally'](function(){process[_0x0994('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index fa310bb..282c424 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 _0x92bc=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','body','concat','chunk','keys','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','header','pageBreak','before','margin','\x20/\x20','footer','black','num','Empty','Setting','split','splitSizePdf','then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','pdf'];(function(_0x2bdb7a,_0x3c00ad){var _0x1da3bf=function(_0x29b184){while(--_0x29b184){_0x2bdb7a['push'](_0x2bdb7a['shift']());}};_0x1da3bf(++_0x3c00ad);}(_0x92bc,0x134));var _0xc92b=function(_0x270125,_0x1c6105){_0x270125=_0x270125-0x0;var _0x46addc=_0x92bc[_0x270125];return _0x46addc;};'use strict';var _=require(_0xc92b('0x0'));var fs=require('fs');var util=require(_0xc92b('0x1'));var path=require(_0xc92b('0x2'));var moment=require(_0xc92b('0x3'));var htmlToPdfmake=require(_0xc92b('0x4'));var PdfPrinter=require(_0xc92b('0x5'));var zipdir=require(_0xc92b('0x6'));var rimraf=require(_0xc92b('0x7'));var JSDOM=require(_0xc92b('0x8'))[_0xc92b('0x9')];var window=new JSDOM('')[_0xc92b('0xa')];var BPromise=require(_0xc92b('0xb'));var db=require(_0xc92b('0xc'))['db'];var dbH=require(_0xc92b('0xc'))[_0xc92b('0xd')];var logger=require(_0xc92b('0xe'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc92b('0xf')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xc92b('0xf')][0x5];var FORMAT=_0xc92b('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3cab98,_0x57f2f4){var _0x4c5c95={'status':_0x3cab98};var _0x33c0d9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57f2f4){_0x4c5c95[_0xc92b('0x11')]=_0x57f2f4;}return db[_0xc92b('0x12')][_0xc92b('0x13')](_0x4c5c95,_0x33c0d9);}function getHeaders(_0x2f1118){return _[_0xc92b('0x14')](_0x2f1118,function(_0x152c82){return{'text':_0x152c82,'style':_0xc92b('0x15')};});}function getRows(_0x55db2a,_0x6a2e93){return _[_0xc92b('0x14')](_0x6a2e93,function(_0x27c2c2){return _(_0x27c2c2)['pick'](_0x55db2a)['map'](function(_0x5d7958){return _0x5d7958?_[_0xc92b('0x16')](_0x5d7958):'';})[_0xc92b('0x17')]();});}function createTable(_0x250685,_0x27efa2){var _0x176a9d={'widths':_[_0xc92b('0x18')](Array(_0x250685[_0xc92b('0x19')]),0x91),'heights':function(_0x133e3f){return _0x133e3f===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x40c645=getHeaders(_0x250685);_0x176a9d[_0xc92b('0x1a')]['push'](_0x40c645);var _0x506abb=getRows(_0x250685,_0x27efa2);_0x176a9d[_0xc92b('0x1a')]=_0x176a9d[_0xc92b('0x1a')][_0xc92b('0x1b')](_0x506abb);return _0x176a9d;}function createTables(_0x77716){var _0x45d961=[];var _0x5c11ac=_[_0xc92b('0x1c')](Object[_0xc92b('0x1d')](_0x77716[0x0]),0x5);_0x5c11ac[_0xc92b('0x1e')](function(_0xcc2bdd){_0x45d961[_0xc92b('0x1f')](createTable(_0xcc2bdd,_0x77716));});return _0x45d961;}function getPDFDocDefinition(_0x3b0fff){var _0x57dc60=util['format'](_0xc92b('0x20'),NAME,EXTRACTED_REPORT[_0xc92b('0x21')],moment(EXTRACTED_REPORT[_0xc92b('0x22')])[_0xc92b('0x23')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xc92b('0x23')](FORMAT));var _0x5a44c4=[];for(var _0x4cc72d=0x0;_0x4cc72d<_0x3b0fff[_0xc92b('0x19')];_0x4cc72d++){var _0x196451=[];if(_0x4cc72d===0x0){_0x196451[_0xc92b('0x1f')]({'text':_0x57dc60,'style':_0xc92b('0x24')});}var _0x559748={'table':_0x3b0fff[_0x4cc72d]};if(_0x4cc72d>0x0){_0x559748[_0xc92b('0x25')]=_0xc92b('0x26');_0x559748[_0xc92b('0x27')]=[0x0,0x46,0x0,0x0];}_0x196451['push'](_0x559748);_0x5a44c4[_0xc92b('0x1f')](_0x196451);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5a44c4,'footer':function(_0x44b6b2,_0x506b88){return{'text':_0x44b6b2[_0xc92b('0x16')]()+_0xc92b('0x28')+_0x506b88,'style':_0xc92b('0x29')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc92b('0x2a')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2fe257){var _0x357af2=0x1388;var _0x41dc28;if(!_0x2fe257[0x0][_0xc92b('0x2b')]){return analyticExtractedReport(_0xc92b('0x2c'));}return db[_0xc92b('0x2d')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc92b('0x2e'),_0xc92b('0x2f')]})[_0xc92b('0x30')](function(_0xdee5af){if(_0xdee5af){_0x41dc28=_0xdee5af;_0x357af2=_0x41dc28['splitSizePdf']||0x3e8;}})['then'](function(){var _0xacdf23=[];var _0x369599=0x0;if(_0x41dc28[_0xc92b('0x2e')]){if(_0x2fe257&&_0x2fe257[_0xc92b('0x19')]){var _0x5b6af4=_['range'](_0x2fe257[0x0][_0xc92b('0x2b')]/_0x357af2);var _0x4f3d88=Number[_0xc92b('0x31')](_0x2fe257[0x0]['num']/_0x357af2)?_0x2fe257[0x0]['num']%_0x357af2:0x0;_0x5b6af4['forEach'](function(_0x46dc2a){if(_0x46dc2a>0x0){_0x369599+=_0x357af2;}_0xacdf23[_0xc92b('0x1f')](dbH[_0xc92b('0x32')][_0xc92b('0x33')](util['format'](_0xc92b('0x34'),QUERY,_0x357af2,_0x369599),{'type':dbH[_0xc92b('0x32')]['QueryTypes']['SELECT']}));});if(_0x4f3d88>0x0){_0x369599+=_0x357af2;_0xacdf23[_0xc92b('0x1f')](dbH[_0xc92b('0x32')][_0xc92b('0x33')](util['format'](_0xc92b('0x34'),QUERY,_0x4f3d88,_0x369599),{'type':dbH[_0xc92b('0x32')][_0xc92b('0x35')][_0xc92b('0x36')]}));}}}else{_0xacdf23['push'](dbH[_0xc92b('0x32')][_0xc92b('0x33')](QUERY,{'type':dbH[_0xc92b('0x32')]['QueryTypes']['SELECT']}));}var _0x28b981=path[_0xc92b('0x37')](PATH);var _0x139ef3=path[_0xc92b('0x38')](PATH,_0xc92b('0x39'));var _0x490f00=_0x41dc28[_0xc92b('0x2e')]&&_0xacdf23['length']>0x1;var _0x2d6278=[];if(!fs[_0xc92b('0x3a')](path[_0xc92b('0x3b')](_0x28b981,_0x139ef3))&&_0x490f00){fs[_0xc92b('0x3c')](path[_0xc92b('0x3b')](_0x28b981,_0x139ef3));}return BPromise[_0xc92b('0x3d')](_0xacdf23,function(_0x523dc5){_0x2d6278[_0xc92b('0x1f')](_0x523dc5);})[_0xc92b('0x30')](function(){var _0x43e06d=[];for(var _0xf5fa5a=0x0;_0xf5fa5a<_0x2d6278[_0xc92b('0x19')];_0xf5fa5a+=0x1){var _0x768eb=_0x2d6278[_0xf5fa5a];var _0xfc3da1=createTables(_[_0xc92b('0x3e')](_0x768eb));var _0x531ed5;var _0x379e54=getPDFDocDefinition(_0xfc3da1);var _0x167d39=getPDFPrinter();var _0x33f259=_0x167d39[_0xc92b('0x3f')](_0x379e54);if(_0x490f00){_0x531ed5=path[_0xc92b('0x3b')](_0x28b981,_0x139ef3,util['format']('%s%d.%s',_0x139ef3,_0xf5fa5a,'pdf'));}else{_0x531ed5=path['join'](_0x28b981,util[_0xc92b('0x23')](_0xc92b('0x40'),_0x139ef3,'pdf'));}_0x43e06d[_0xc92b('0x1f')](writePDFDocument(_0x33f259,_0x531ed5));}return Promise['all'](_0x43e06d);})[_0xc92b('0x30')](function(){if(_0x490f00){return new Promise(function(_0xf49ab7){zipdir(path[_0xc92b('0x3b')](_0x28b981,_0x139ef3),{'saveTo':path[_0xc92b('0x3b')](_0x28b981,util[_0xc92b('0x23')](_0xc92b('0x40'),_0x139ef3,_0xc92b('0x41')))},function(){rimraf(path['join'](_0x28b981,_0x139ef3),function(){});_0xf49ab7(_0xc92b('0x42'));});});}})['then'](function(){if(!_0x490f00)return;rimraf(path['join'](_0x28b981,_0x139ef3),function(){});})[_0xc92b('0x30')](function(){logger[_0xc92b('0x43')](util[_0xc92b('0x23')](_0xc92b('0x44'),EXTRACTED_REPORT_ID,_0xc92b('0x45')));return analyticExtractedReport(_0xc92b('0x46'),_0x490f00?util['format'](_0xc92b('0x40'),_0x139ef3,_0x490f00?'zip':_0xc92b('0x47')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc92b('0x43')](util[_0xc92b('0x23')](_0xc92b('0x48'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0xc92b('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc92b('0x30')](function(_0x4ae416){EXTRACTED_REPORT=_0x4ae416;return dbH[_0xc92b('0x32')][_0xc92b('0x33')](util['format'](_0xc92b('0x4a'),QUERY),{'type':dbH[_0xc92b('0x32')][_0xc92b('0x35')][_0xc92b('0x36')]});})['then'](extractReport)[_0xc92b('0x4b')](function(_0x5b8eba){logger[_0xc92b('0x43')](util[_0xc92b('0x23')](_0xc92b('0x4c'),EXTRACTED_REPORT_ID,_0xc92b('0x45')),util[_0xc92b('0x4d')](_0x5b8eba,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc92b('0x4e'));})[_0xc92b('0x4f')](function(){process[_0xc92b('0x50')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3b5070=new PdfPrinter({'Arial':{'normal':__dirname+_0xc92b('0x51'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xc92b('0x52')}});return _0x3b5070;}function getPDFDocDefinitionFromHTML(_0x29204b,_0x2d8c3a){var _0x5a57b2=util['format'](_0xc92b('0x53'),_0x2d8c3a[_0xc92b('0x54')],_0x2d8c3a['interactionId']);var _0x4b0335=moment()[_0xc92b('0x23')]('YYYY-MM-DD')['toString']();var _0x2b076c=htmlToPdfmake(_0x29204b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2b076c],'defaultStyle':{'font':_0xc92b('0x55')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc92b('0x56'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc92b('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xc92b('0x57'),'style':'header'}];},'footer':function(_0x2db201,_0x3ebf2c){return[{'text':util[_0xc92b('0x23')](_0xc92b('0x58'),_0x5a57b2,_0x2db201,_0x3ebf2c,_0x4b0335),'style':_0xc92b('0x29')}];}};}function writePDFDocument(_0x36a30a,_0x408dd0){return new Promise(function(_0x5960cf,_0x23edf6){var _0xa76de8=_0x36a30a[_0xc92b('0x59')](fs[_0xc92b('0x5a')](_0x408dd0));_0xa76de8['on'](_0xc92b('0x5b'),function(){_0x5960cf('finish');});_0xa76de8['on'](_0xc92b('0x5c'),function(_0x12706f){_0x23edf6(_0x12706f);});_0x36a30a[_0xc92b('0x5d')]();});}exports[_0xc92b('0x5e')]=function(_0x18229e,_0x587a16){var _0x556662=getPDFPrinter();var _0x2951ac=getPDFDocDefinitionFromHTML(_0x18229e,_0x587a16);var _0x4ea6fc=_0x556662[_0xc92b('0x3f')](_0x2951ac);return writePDFDocument(_0x4ea6fc,_0x587a16[_0xc92b('0x2')])[_0xc92b('0x4b')](function(_0x1a9bc3){throw _0x1a9bc3;});}; \ No newline at end of file +var _0xfef3=['/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','path','lodash','util','moment','pdfmake/src/printer','jsdom','window','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','auto','body','push','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Setting','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s.%s','pdf','all','zip\x20finished','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','catch','PDF','/fonts/arial-bold.ttf'];(function(_0x7e3bb8,_0x27c048){var _0x44c887=function(_0x55d7c6){while(--_0x55d7c6){_0x7e3bb8['push'](_0x7e3bb8['shift']());}};_0x44c887(++_0x27c048);}(_0xfef3,0x1b2));var _0x3fef=function(_0x2dbbf2,_0x34c336){_0x2dbbf2=_0x2dbbf2-0x0;var _0x2b40ce=_0xfef3[_0x2dbbf2];return _0x2b40ce;};'use strict';var _=require(_0x3fef('0x0'));var fs=require('fs');var util=require(_0x3fef('0x1'));var path=require('path');var moment=require(_0x3fef('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x3fef('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x3fef('0x4'))['JSDOM'];var window=new JSDOM('')[_0x3fef('0x5')];var BPromise=require(_0x3fef('0x6'));var db=require(_0x3fef('0x7'))['db'];var dbH=require(_0x3fef('0x7'))[_0x3fef('0x8')];var logger=require('../../config/logger')(_0x3fef('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x3fef('0xa')][0x2]);var QUERY=process[_0x3fef('0xa')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x3fef('0xa')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x358935,_0xa92c4){var _0x13f118={'status':_0x358935};var _0x3b4e6c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa92c4){_0x13f118[_0x3fef('0xb')]=_0xa92c4;}return db[_0x3fef('0xc')][_0x3fef('0xd')](_0x13f118,_0x3b4e6c);}function getHeaders(_0x48a960){return _[_0x3fef('0xe')](_0x48a960,function(_0x233263){return{'text':_0x233263,'style':_0x3fef('0xf')};});}function getRows(_0xbb207e,_0x3be5f5){return _[_0x3fef('0xe')](_0x3be5f5,function(_0x745f2f){return _(_0x745f2f)['pick'](_0xbb207e)[_0x3fef('0xe')](function(_0x50f74d){return _0x50f74d?_[_0x3fef('0x10')](_0x50f74d):'';})[_0x3fef('0x11')]();});}function createTable(_0x1e62d4,_0x385631){var _0x1fe8c8={'widths':_[_0x3fef('0x12')](Array(_0x1e62d4[_0x3fef('0x13')]),0x91),'heights':function(_0x48c018){return _0x48c018===0x0?_0x3fef('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2cac9b=getHeaders(_0x1e62d4);_0x1fe8c8[_0x3fef('0x15')][_0x3fef('0x16')](_0x2cac9b);var _0x3222b3=getRows(_0x1e62d4,_0x385631);_0x1fe8c8[_0x3fef('0x15')]=_0x1fe8c8[_0x3fef('0x15')][_0x3fef('0x17')](_0x3222b3);return _0x1fe8c8;}function createTables(_0x131573){var _0x203978=[];var _0x3ae518=_['chunk'](Object['keys'](_0x131573[0x0]),0x5);_0x3ae518[_0x3fef('0x18')](function(_0x127d60){_0x203978['push'](createTable(_0x127d60,_0x131573));});return _0x203978;}function getPDFDocDefinition(_0x5847b0){var _0x457cf=util[_0x3fef('0x19')](_0x3fef('0x1a'),NAME,EXTRACTED_REPORT[_0x3fef('0x1b')],moment(EXTRACTED_REPORT[_0x3fef('0x1c')])[_0x3fef('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x3fef('0x1d')])[_0x3fef('0x19')](FORMAT));var _0x3e86c0=[];for(var _0xfbfc16=0x0;_0xfbfc16<_0x5847b0[_0x3fef('0x13')];_0xfbfc16++){var _0x434a1a=[];if(_0xfbfc16===0x0){_0x434a1a[_0x3fef('0x16')]({'text':_0x457cf,'style':_0x3fef('0x1e')});}var _0x3afdcd={'table':_0x5847b0[_0xfbfc16]};if(_0xfbfc16>0x0){_0x3afdcd[_0x3fef('0x1f')]=_0x3fef('0x20');_0x3afdcd[_0x3fef('0x21')]=[0x0,0x46,0x0,0x0];}_0x434a1a[_0x3fef('0x16')](_0x3afdcd);_0x3e86c0['push'](_0x434a1a);}return{'pageSize':'A4','pageOrientation':_0x3fef('0x22'),'content':_0x3e86c0,'footer':function(_0x3512b9,_0x30c3f3){return{'text':_0x3512b9[_0x3fef('0x10')]()+_0x3fef('0x23')+_0x30c3f3,'style':_0x3fef('0x24')};},'defaultStyle':{'font':_0x3fef('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3fef('0x26')},'footer':{'alignment':_0x3fef('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x414a59){var _0xc48fb2=0x1388;var _0x575ab1;if(!_0x414a59[0x0][_0x3fef('0x28')]){return analyticExtractedReport('Empty');}return db[_0x3fef('0x29')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3fef('0x2a'),_0x3fef('0x2b')]})['then'](function(_0x2ffe17){if(_0x2ffe17){_0x575ab1=_0x2ffe17;_0xc48fb2=_0x575ab1[_0x3fef('0x2b')]||0x3e8;}})[_0x3fef('0x2c')](function(){var _0x34b04f=[];var _0x412e36=0x0;if(_0x575ab1[_0x3fef('0x2a')]){if(_0x414a59&&_0x414a59['length']){var _0x232cf5=_[_0x3fef('0x2d')](_0x414a59[0x0][_0x3fef('0x28')]/_0xc48fb2);var _0x26f46a=Number[_0x3fef('0x2e')](_0x414a59[0x0]['num']/_0xc48fb2)?_0x414a59[0x0][_0x3fef('0x28')]%_0xc48fb2:0x0;_0x232cf5[_0x3fef('0x18')](function(_0x3fefdb){if(_0x3fefdb>0x0){_0x412e36+=_0xc48fb2;}_0x34b04f[_0x3fef('0x16')](dbH[_0x3fef('0x2f')][_0x3fef('0x30')](util['format'](_0x3fef('0x31'),QUERY,_0xc48fb2,_0x412e36),{'type':dbH[_0x3fef('0x2f')][_0x3fef('0x32')][_0x3fef('0x33')]}));});if(_0x26f46a>0x0){_0x412e36+=_0xc48fb2;_0x34b04f['push'](dbH[_0x3fef('0x2f')][_0x3fef('0x30')](util[_0x3fef('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x26f46a,_0x412e36),{'type':dbH[_0x3fef('0x2f')][_0x3fef('0x32')][_0x3fef('0x33')]}));}}}else{_0x34b04f[_0x3fef('0x16')](dbH[_0x3fef('0x2f')]['query'](QUERY,{'type':dbH[_0x3fef('0x2f')][_0x3fef('0x32')][_0x3fef('0x33')]}));}var _0x438e29=path['dirname'](PATH);var _0x2ec29c=path['basename'](PATH,_0x3fef('0x34'));var _0x4dca6a=_0x575ab1['split']&&_0x34b04f[_0x3fef('0x13')]>0x1;var _0x278d3d=[];if(!fs[_0x3fef('0x35')](path[_0x3fef('0x36')](_0x438e29,_0x2ec29c))&&_0x4dca6a){fs[_0x3fef('0x37')](path[_0x3fef('0x36')](_0x438e29,_0x2ec29c));}return BPromise[_0x3fef('0x38')](_0x34b04f,function(_0x28cdac){_0x278d3d[_0x3fef('0x16')](_0x28cdac);})['then'](function(){var _0xe47321=[];for(var _0x5a9f19=0x0;_0x5a9f19<_0x278d3d[_0x3fef('0x13')];_0x5a9f19+=0x1){var _0x59fdde=_0x278d3d[_0x5a9f19];var _0x26832d=createTables(_[_0x3fef('0x39')](_0x59fdde));var _0x2bb43e;var _0x137a0b=getPDFDocDefinition(_0x26832d);var _0x29f34d=getPDFPrinter();var _0x13a888=_0x29f34d[_0x3fef('0x3a')](_0x137a0b);if(_0x4dca6a){_0x2bb43e=path['join'](_0x438e29,_0x2ec29c,util[_0x3fef('0x19')]('%s%d.%s',_0x2ec29c,_0x5a9f19,'pdf'));}else{_0x2bb43e=path[_0x3fef('0x36')](_0x438e29,util[_0x3fef('0x19')](_0x3fef('0x3b'),_0x2ec29c,_0x3fef('0x3c')));}_0xe47321[_0x3fef('0x16')](writePDFDocument(_0x13a888,_0x2bb43e));}return Promise[_0x3fef('0x3d')](_0xe47321);})[_0x3fef('0x2c')](function(){if(_0x4dca6a){return new Promise(function(_0x32ee78){zipdir(path[_0x3fef('0x36')](_0x438e29,_0x2ec29c),{'saveTo':path['join'](_0x438e29,util[_0x3fef('0x19')](_0x3fef('0x3b'),_0x2ec29c,'zip'))},function(){rimraf(path[_0x3fef('0x36')](_0x438e29,_0x2ec29c),function(){});_0x32ee78(_0x3fef('0x3e'));});});}})[_0x3fef('0x2c')](function(){if(!_0x4dca6a)return;rimraf(path[_0x3fef('0x36')](_0x438e29,_0x2ec29c),function(){});})[_0x3fef('0x2c')](function(){logger['info'](util[_0x3fef('0x19')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x3fef('0x3f'),_0x4dca6a?util[_0x3fef('0x19')](_0x3fef('0x3b'),_0x2ec29c,_0x4dca6a?_0x3fef('0x40'):_0x3fef('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3fef('0x41')](util['format'](_0x3fef('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x3fef('0xc')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3fef('0x2c')](function(_0x111eb4){EXTRACTED_REPORT=_0x111eb4;return dbH[_0x3fef('0x2f')][_0x3fef('0x30')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3fef('0x2f')]['QueryTypes'][_0x3fef('0x33')]});})[_0x3fef('0x2c')](extractReport)[_0x3fef('0x43')](function(_0x3b95a2){logger['info'](util[_0x3fef('0x19')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3fef('0x44')),util['inspect'](_0x3b95a2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x36fd40=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x3fef('0x45'),'italics':__dirname+_0x3fef('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x36fd40;}function getPDFDocDefinitionFromHTML(_0x21ce37,_0x3fe2e4){var _0x2112cb=util[_0x3fef('0x19')](_0x3fef('0x47'),_0x3fe2e4[_0x3fef('0x48')],_0x3fe2e4[_0x3fef('0x49')]);var _0x345472=moment()[_0x3fef('0x19')](_0x3fef('0x4a'))[_0x3fef('0x10')]();var _0xa0a7da=htmlToPdfmake(_0x21ce37,{'window':window,'tableAutoSize':!![]});return{'content':[_0xa0a7da],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3fef('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3fef('0x4b')}},'header':function(){return[{'text':_0x3fef('0x4c'),'style':'header'}];},'footer':function(_0x3226f4,_0x1d5cfb){return[{'text':util[_0x3fef('0x19')](_0x3fef('0x4d'),_0x2112cb,_0x3226f4,_0x1d5cfb,_0x345472),'style':_0x3fef('0x24')}];}};}function writePDFDocument(_0x1eb22c,_0x45b320){return new Promise(function(_0xf35ee1,_0x107b37){var _0x5c4c2b=_0x1eb22c[_0x3fef('0x4e')](fs[_0x3fef('0x4f')](_0x45b320));_0x5c4c2b['on'](_0x3fef('0x50'),function(){_0xf35ee1('finish');});_0x5c4c2b['on'](_0x3fef('0x51'),function(_0x29dfe7){_0x107b37(_0x29dfe7);});_0x1eb22c[_0x3fef('0x52')]();});}exports['createPdfFromHTML']=function(_0x4510c9,_0x285a0e){var _0x135085=getPDFPrinter();var _0xec40d1=getPDFDocDefinitionFromHTML(_0x4510c9,_0x285a0e);var _0x5cd868=_0x135085['createPdfKitDocument'](_0xec40d1);return writePDFDocument(_0x5cd868,_0x285a0e[_0x3fef('0x53')])[_0x3fef('0x43')](function(_0x680364){throw _0x680364;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 9c6a8d8..30b05ff 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 _0x5554=['XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','existsSync','join','each','length','xlsx','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','finally','path','bluebird','zip-dir','../../mysqldb','analytics','argv','savename','update','info','format'];(function(_0xc9f288,_0x53b220){var _0x2b3aec=function(_0x516b2b){while(--_0x516b2b){_0xc9f288['push'](_0xc9f288['shift']());}};_0x2b3aec(++_0x53b220);}(_0x5554,0x167));var _0x4555=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x5554[_0x1fc122];return _0xa2cb13;};'use strict';var util=require('util');var path=require(_0x4555('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x4555('0x1'));var zipdir=require(_0x4555('0x2'));var rimraf=require('rimraf');var db=require(_0x4555('0x3'))['db'];var dbH=require(_0x4555('0x3'))['dbH'];var logger=require('../../config/logger')(_0x4555('0x4'));var EXTRACTED_REPORT_ID=Number(process[_0x4555('0x5')][0x2]);var QUERY=process[_0x4555('0x5')][0x3];var PATH=process[_0x4555('0x5')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b1d78,_0x58426c){var _0x5397fb={'status':_0x2b1d78};var _0x32278b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x58426c){_0x5397fb[_0x4555('0x6')]=_0x58426c;}return db['AnalyticExtractedReport'][_0x4555('0x7')](_0x5397fb,_0x32278b);}function main(){var _0x399b19=0x1388;var _0x144e1b;logger[_0x4555('0x8')](util[_0x4555('0x9')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4555('0xa')));return db[_0x4555('0xb')][_0x4555('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4555('0xd'),_0x4555('0xe')]})[_0x4555('0xf')](function(_0x165e48){if(_0x165e48){_0x144e1b=_0x165e48;_0x399b19=_0x144e1b['splitSizeXlsx']||0x1388;}})[_0x4555('0xf')](function(){return dbH[_0x4555('0x10')][_0x4555('0x11')](util[_0x4555('0x9')](_0x4555('0x12'),QUERY),{'type':dbH[_0x4555('0x10')][_0x4555('0x13')]['SELECT']});})['then'](function(_0x15d809){if(!_0x15d809[0x0]['num']){return analyticExtractedReport('Empty');}var _0x29fddc=[];var _0x365e82=0x0;if(_0x144e1b[_0x4555('0xd')]){if(_0x15d809&&_0x15d809['length']){var _0x45610d=_['range'](_0x15d809[0x0]['num']/_0x399b19);var _0x5193f8=Number[_0x4555('0x14')](_0x15d809[0x0]['num']/_0x399b19)?_0x15d809[0x0]['num']%_0x399b19:0x0;_0x45610d[_0x4555('0x15')](function(_0x4e45df){if(_0x4e45df>0x0){_0x365e82+=_0x399b19;}_0x29fddc[_0x4555('0x16')](dbH[_0x4555('0x10')][_0x4555('0x11')](util[_0x4555('0x9')](_0x4555('0x17'),QUERY,_0x399b19,_0x365e82),{'type':dbH[_0x4555('0x10')][_0x4555('0x13')][_0x4555('0x18')]}));});if(_0x5193f8>0x0){_0x365e82+=_0x399b19;_0x29fddc['push'](dbH['sequelize'][_0x4555('0x11')](util[_0x4555('0x9')](_0x4555('0x17'),QUERY,_0x5193f8,_0x365e82),{'type':dbH[_0x4555('0x10')][_0x4555('0x13')][_0x4555('0x18')]}));}}}else{_0x29fddc[_0x4555('0x16')](dbH[_0x4555('0x10')][_0x4555('0x11')](QUERY,{'type':dbH[_0x4555('0x10')][_0x4555('0x13')][_0x4555('0x18')]}));}var _0x21ed69=path[_0x4555('0x19')](PATH);var _0x156041=path['basename'](PATH,_0x4555('0x1a'));var _0x2ca76d=_0x144e1b['split']&&_0x29fddc['length']>0x1;var _0x1e3916=[];if(!fs[_0x4555('0x1b')](path['join'](_0x21ed69,_0x156041))&&_0x2ca76d){fs['mkdirSync'](path[_0x4555('0x1c')](_0x21ed69,_0x156041));}return BPromise[_0x4555('0x1d')](_0x29fddc,function(_0x604786){_0x1e3916[_0x4555('0x16')](_0x604786);})[_0x4555('0xf')](function(){for(var _0x32941e=0x0;_0x32941e<_0x1e3916[_0x4555('0x1e')];_0x32941e+=0x1){var _0x57d714;var _0x334a4d=_0x1e3916[_0x32941e];if(_0x2ca76d){_0x57d714=path['join'](_0x21ed69,_0x156041,util['format']('%s%d.%s',_0x156041,_0x32941e,_0x4555('0x1f')));}else{_0x57d714=path[_0x4555('0x1c')](_0x21ed69,util[_0x4555('0x9')]('%s.%s',_0x156041,_0x4555('0x1f')));}fs['writeFileSync'](_0x57d714,json2xls(_0x334a4d),_0x4555('0x20'));}})[_0x4555('0xf')](function(){if(_0x2ca76d){return new Promise(function(_0x2ae764){zipdir(path[_0x4555('0x1c')](_0x21ed69,_0x156041),{'saveTo':path['join'](_0x21ed69,util[_0x4555('0x9')](_0x4555('0x21'),_0x156041,_0x4555('0x22')))},function(_0x1a5b41,_0x1fba54){rimraf(path['join'](_0x21ed69,_0x156041),function(){});_0x2ae764(_0x4555('0x23'));});});}})[_0x4555('0xf')](function(){logger[_0x4555('0x8')](util[_0x4555('0x9')](_0x4555('0x24'),EXTRACTED_REPORT_ID,_0x4555('0xa')));return analyticExtractedReport(_0x4555('0x25'),_0x2ca76d?util[_0x4555('0x9')](_0x4555('0x21'),_0x156041,_0x2ca76d?'zip':_0x4555('0x1f')):null);});})[_0x4555('0x26')](function(_0x9f72b0){logger['info'](util[_0x4555('0x9')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4555('0xa')),util[_0x4555('0x27')](_0x9f72b0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4555('0x28')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2785=['join','mkdirSync','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','.xlsx','split','length'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x2785,0x1be));var _0x5278=function(_0x488dd0,_0x1e0044){_0x488dd0=_0x488dd0-0x0;var _0xb0577d=_0x2785[_0x488dd0];return _0xb0577d;};'use strict';var util=require(_0x5278('0x0'));var path=require(_0x5278('0x1'));var _=require(_0x5278('0x2'));var fs=require('fs');var json2xls=require(_0x5278('0x3'));var BPromise=require(_0x5278('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x5278('0x5'));var db=require(_0x5278('0x6'))['db'];var dbH=require(_0x5278('0x6'))[_0x5278('0x7')];var logger=require(_0x5278('0x8'))(_0x5278('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x5278('0xa')][0x2]);var QUERY=process[_0x5278('0xa')][0x3];var PATH=process[_0x5278('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5308da,_0x2c24d3){var _0x189432={'status':_0x5308da};var _0x4cbf8d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c24d3){_0x189432[_0x5278('0xb')]=_0x2c24d3;}return db[_0x5278('0xc')]['update'](_0x189432,_0x4cbf8d);}function main(){var _0x543194=0x1388;var _0x32b6f6;logger[_0x5278('0xd')](util[_0x5278('0xe')](_0x5278('0xf'),EXTRACTED_REPORT_ID,_0x5278('0x10')));return db[_0x5278('0x11')][_0x5278('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5278('0x13')]})[_0x5278('0x14')](function(_0x168a38){if(_0x168a38){_0x32b6f6=_0x168a38;_0x543194=_0x32b6f6[_0x5278('0x13')]||0x1388;}})[_0x5278('0x14')](function(){return dbH[_0x5278('0x15')][_0x5278('0x16')](util[_0x5278('0xe')](_0x5278('0x17'),QUERY),{'type':dbH[_0x5278('0x15')][_0x5278('0x18')]['SELECT']});})[_0x5278('0x14')](function(_0x30bdc7){if(!_0x30bdc7[0x0][_0x5278('0x19')]){return analyticExtractedReport(_0x5278('0x1a'));}var _0x32c8f3=[];var _0x205ba7=0x0;if(_0x32b6f6['split']){if(_0x30bdc7&&_0x30bdc7['length']){var _0x23aa05=_[_0x5278('0x1b')](_0x30bdc7[0x0][_0x5278('0x19')]/_0x543194);var _0x5749cd=Number['isInteger'](_0x30bdc7[0x0]['num']/_0x543194)?_0x30bdc7[0x0]['num']%_0x543194:0x0;_0x23aa05['forEach'](function(_0x68c36b){if(_0x68c36b>0x0){_0x205ba7+=_0x543194;}_0x32c8f3[_0x5278('0x1c')](dbH[_0x5278('0x15')][_0x5278('0x16')](util[_0x5278('0xe')](_0x5278('0x1d'),QUERY,_0x543194,_0x205ba7),{'type':dbH[_0x5278('0x15')][_0x5278('0x18')][_0x5278('0x1e')]}));});if(_0x5749cd>0x0){_0x205ba7+=_0x543194;_0x32c8f3[_0x5278('0x1c')](dbH[_0x5278('0x15')]['query'](util[_0x5278('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5749cd,_0x205ba7),{'type':dbH[_0x5278('0x15')][_0x5278('0x18')]['SELECT']}));}}}else{_0x32c8f3[_0x5278('0x1c')](dbH[_0x5278('0x15')][_0x5278('0x16')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x5278('0x1e')]}));}var _0x509aac=path['dirname'](PATH);var _0x110491=path['basename'](PATH,_0x5278('0x1f'));var _0x5b2d83=_0x32b6f6[_0x5278('0x20')]&&_0x32c8f3[_0x5278('0x21')]>0x1;var _0x40f4cf=[];if(!fs['existsSync'](path[_0x5278('0x22')](_0x509aac,_0x110491))&&_0x5b2d83){fs[_0x5278('0x23')](path[_0x5278('0x22')](_0x509aac,_0x110491));}return BPromise[_0x5278('0x24')](_0x32c8f3,function(_0x4399da){_0x40f4cf[_0x5278('0x1c')](_0x4399da);})[_0x5278('0x14')](function(){for(var _0x3119b3=0x0;_0x3119b3<_0x40f4cf['length'];_0x3119b3+=0x1){var _0x580a9e;var _0x543193=_0x40f4cf[_0x3119b3];if(_0x5b2d83){_0x580a9e=path[_0x5278('0x22')](_0x509aac,_0x110491,util['format']('%s%d.%s',_0x110491,_0x3119b3,_0x5278('0x25')));}else{_0x580a9e=path[_0x5278('0x22')](_0x509aac,util[_0x5278('0xe')](_0x5278('0x26'),_0x110491,_0x5278('0x25')));}fs[_0x5278('0x27')](_0x580a9e,json2xls(_0x543193),_0x5278('0x28'));}})[_0x5278('0x14')](function(){if(_0x5b2d83){return new Promise(function(_0x11073b){zipdir(path[_0x5278('0x22')](_0x509aac,_0x110491),{'saveTo':path[_0x5278('0x22')](_0x509aac,util[_0x5278('0xe')](_0x5278('0x26'),_0x110491,_0x5278('0x29')))},function(_0x4e65a8,_0x5e46bd){rimraf(path[_0x5278('0x22')](_0x509aac,_0x110491),function(){});_0x11073b(_0x5278('0x2a'));});});}})[_0x5278('0x14')](function(){logger[_0x5278('0xd')](util[_0x5278('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5278('0x10')));return analyticExtractedReport('Completed',_0x5b2d83?util[_0x5278('0xe')](_0x5278('0x26'),_0x110491,_0x5b2d83?_0x5278('0x29'):_0x5278('0x25')):null);});})[_0x5278('0x2b')](function(_0x1b5250){logger[_0x5278('0xd')](util[_0x5278('0xe')](_0x5278('0x2c'),EXTRACTED_REPORT_ID,_0x5278('0x10')),util[_0x5278('0x2d')](_0x1b5250,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5278('0x2e'));})[_0x5278('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index bcf2f3b..b69519f 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 _0x2a4e=['${EXTEN}','ExecIf','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:'];(function(_0x527f07,_0x4495ac){var _0x3e2d92=function(_0x4aece2){while(--_0x4aece2){_0x527f07['push'](_0x527f07['shift']());}};_0x3e2d92(++_0x4495ac);}(_0x2a4e,0x104));var _0xe2a4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2a4e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe2a4('0x0'));var util=require(_0xe2a4('0x1'));function rewrite(_0x443ca6,_0x4920aa){var _0x5a1f4b=this;return _0x443ca6[_0xe2a4('0x2')][_0xe2a4('0x3')][_0xe2a4('0x4')]({'raw':!![]})[_0xe2a4('0x5')](function(_0x583de5){_0x5a1f4b[_0xe2a4('0x6')]=_0x583de5;return _0x443ca6[_0xe2a4('0x2')][_0xe2a4('0x7')][_0xe2a4('0x4')]({'where':{'IntervalId':_0x4920aa[_0xe2a4('0x8')]},'raw':!![]});})[_0xe2a4('0x5')](function(_0x4633ef){return _0x443ca6[_0xe2a4('0x2')][_0xe2a4('0x7')][_0xe2a4('0x4')]({'where':{'exten':{'$in':_[_0xe2a4('0x9')](_[_0xe2a4('0xa')](_0x4633ef,_0xe2a4('0xb')))}},'order':[{'raw':_0xe2a4('0xc')}],'raw':!![]});})[_0xe2a4('0x5')](function(_0x5df800){var _0x518cfd=_['filter'](_0x5df800,{'priority':'1'});var _0x599c90=_['filter'](_0x5df800,{'isApp':0x1});var _0x3ab1d5=_[_0xe2a4('0xd')](_0x599c90,_0xe2a4('0xb'));var _0x4bcf96=['queue',_0xe2a4('0xe')];var _0x25ec2c=[];var _0x257ef4=[];for(var _0x106fe7 in _0x3ab1d5){if(_0x3ab1d5[_0xe2a4('0xf')](_0x106fe7)){_0x5a1f4b[_0xe2a4('0x10')]=0x2;_0x5a1f4b[_0xe2a4('0x11')]=[];_0x5a1f4b[_0xe2a4('0x12')]=_[_0xe2a4('0x13')](_0x518cfd,{'exten':_0x3ab1d5[_0x106fe7][0x0]['exten']});_0x5a1f4b['extensions'][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':util[_0xe2a4('0x17')](_0xe2a4('0x18'),_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')]),'context':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x19')],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b[_0xe2a4('0x10')]++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});if(_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')]===_0xe2a4('0x1b')){_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x1c')+_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')],'context':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x19')],'exten':_0x3ab1d5[_0x106fe7][0x0]['exten'],'priority':_0x5a1f4b[_0xe2a4('0x10')]++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0]['VoiceExtensionId']});}else if(_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')]===_0xe2a4('0x1d')){if(_0x5a1f4b[_0xe2a4('0x12')]){_0x5a1f4b['extensions'][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0]['type'],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x1e')+(_0x5a1f4b['extension']['cutdigits']?_0xe2a4('0x1f')+_0x5a1f4b[_0xe2a4('0x12')]['cutdigits']+'}':_0xe2a4('0x20')),'context':_0x3ab1d5[_0x106fe7][0x0]['context'],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b['priority']++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});}_0x5a1f4b['extensions']['push']({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x1c')+_0x3ab1d5[_0x106fe7][0x0]['VoiceExtensionId'],'context':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x19')],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b[_0xe2a4('0x10')]++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0]['VoiceExtensionId']});var _0x36a1a8=_0x5a1f4b[_0xe2a4('0x10')]++;_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x36a1a8+0x2)+_0xe2a4('0x22')+(_0x36a1a8+0x1)+')','context':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x19')],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x36a1a8,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0]['VoiceExtensionId']});if(_0x5a1f4b[_0xe2a4('0x12')]){_0x5a1f4b['extensions']['push']({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0x5a1f4b[_0xe2a4('0x12')][_0xe2a4('0x23')]?_0xe2a4('0x24')+_0x5a1f4b['extension'][_0xe2a4('0x23')]+'}':'CDR(prefix)=noprefix','context':_0x3ab1d5[_0x106fe7][0x0]['context'],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b[_0xe2a4('0x10')]++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0]['VoiceExtensionId']});}_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x25')+_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')],'context':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x19')],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b[_0xe2a4('0x10')]++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});if(_0x5a1f4b['extension']&&_0x5a1f4b[_0xe2a4('0x12')][_0xe2a4('0xf')](_0xe2a4('0x26'))&&_0x5a1f4b[_0xe2a4('0x12')]['recordingFormat']!=='none'){_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':'Set','appdata':_0xe2a4('0x27'),'context':_0x3ab1d5[_0x106fe7][0x0]['context'],'exten':_0x3ab1d5[_0x106fe7][0x0]['exten'],'priority':_0x5a1f4b[_0xe2a4('0x10')]++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0]['VoiceExtensionId']});_0x5a1f4b['extensions'][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x28')+_0x5a1f4b[_0xe2a4('0x12')][_0xe2a4('0x26')]||_0xe2a4('0x29'),'context':_0x3ab1d5[_0x106fe7][0x0]['context'],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b['priority']++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0]['VoiceExtensionId']});}}_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x2a'),'context':_0x3ab1d5[_0x106fe7][0x0]['context'],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b['priority']++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':'Set','appdata':_0xe2a4('0x2b'),'context':_0x3ab1d5[_0x106fe7][0x0]['context'],'exten':_0x3ab1d5[_0x106fe7][0x0]['exten'],'priority':_0x5a1f4b[_0xe2a4('0x10')]++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x2c'),'context':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x19')],'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'priority':_0x5a1f4b['priority']++,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});for(var _0xe07f98=0x0,_0x7e8b6c=0x0;_0xe07f98<_0x3ab1d5[_0x106fe7]['length'];_0xe07f98+=0x1,_0x7e8b6c=0x0){var _0x184095=_0x3ab1d5[_0x106fe7][_0xe07f98];if(_0x184095[_0xe2a4('0x15')]){_0x184095[_0xe2a4('0x15')]=_0x184095['type'][_0xe2a4('0x2d')]();}var _0x41b788=[];var _0x3b84b9=[];delete _0x184095['id'];delete _0x184095[_0xe2a4('0x2e')];delete _0x184095[_0xe2a4('0x2f')];var _0x594b6c=_0x184095[_0xe2a4('0x30')]!==_0xe2a4('0x31')?[_0x184095[_0xe2a4('0x30')]]:_0x184095[_0xe2a4('0x8')]?_[_0xe2a4('0xa')](_['filter'](_0x5a1f4b['intervals'],{'IntervalId':_0x184095['IntervalId']}),_0xe2a4('0x30')):[];if(_0x184095[_0xe2a4('0xf')]('tag')){if(_0x184095['tag']&&_0x184095[_0xe2a4('0x32')]!=='--'){_0x41b788[_0xe2a4('0x14')]({'type':_0x184095[_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x33')+_0x184095[_0xe2a4('0x32')],'context':_0x184095[_0xe2a4('0x19')],'exten':_0x184095[_0xe2a4('0xb')],'priority':_0x594b6c[_0xe2a4('0x34')]+_0x5a1f4b[_0xe2a4('0x10')]+_0x7e8b6c++,'VoiceExtensionId':_0x184095['VoiceExtensionId']});}}if(_0x184095[_0xe2a4('0x15')]==='outbound'&&_0x184095[_0xe2a4('0xf')](_0xe2a4('0x35'))){if(_0x184095[_0xe2a4('0x35')]){_0x41b788[_0xe2a4('0x14')]({'type':_0x184095['type'],'app':_0xe2a4('0x21'),'appdata':_0xe2a4('0x36')+_0x184095[_0xe2a4('0x35')]+')','context':_0x184095[_0xe2a4('0x19')],'exten':_0x184095[_0xe2a4('0xb')],'priority':_0x594b6c[_0xe2a4('0x34')]+_0x5a1f4b[_0xe2a4('0x10')]+_0x7e8b6c++,'VoiceExtensionId':_0x184095[_0xe2a4('0x1a')]});}else{_0x41b788[_0xe2a4('0x14')]({'type':_0x184095[_0xe2a4('0x15')],'app':_0xe2a4('0x21'),'appdata':_0xe2a4('0x37'),'context':_0x184095['context'],'exten':_0x184095['exten'],'priority':_0x594b6c[_0xe2a4('0x34')]+_0x5a1f4b[_0xe2a4('0x10')]+_0x7e8b6c++,'VoiceExtensionId':_0x184095[_0xe2a4('0x1a')]});}}if(_0x184095[_0xe2a4('0xf')](_0xe2a4('0x38'))){if(_0x4bcf96['indexOf'](_0x184095[_0xe2a4('0x39')]['toLowerCase']())>=0x0&&_0x184095['appType']!==_0xe2a4('0x3a')){if(_0x184095[_0xe2a4('0x38')]){_0x41b788[_0xe2a4('0x14')]({'type':_0x184095['type'],'app':_0xe2a4('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x184095[_0xe2a4('0x19')],'exten':_0x184095[_0xe2a4('0xb')],'priority':_0x594b6c['length']+_0x5a1f4b['priority']+_0x7e8b6c++,'VoiceExtensionId':_0x184095[_0xe2a4('0x1a')]});_0x41b788[_0xe2a4('0x14')]({'type':_0x184095[_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x3b'),'context':_0x184095['context'],'exten':_0x184095[_0xe2a4('0xb')],'priority':_0x594b6c[_0xe2a4('0x34')]+_0x5a1f4b[_0xe2a4('0x10')]+_0x7e8b6c++,'VoiceExtensionId':_0x184095['VoiceExtensionId']});}else{_0x41b788['push']({'type':_0x184095[_0xe2a4('0x15')],'app':_0xe2a4('0x21'),'appdata':_0xe2a4('0x3c'),'context':_0x184095['context'],'exten':_0x184095['exten'],'priority':_0x594b6c['length']+_0x5a1f4b[_0xe2a4('0x10')]+_0x7e8b6c++,'VoiceExtensionId':_0x184095[_0xe2a4('0x1a')]});_0x41b788['push']({'type':_0x184095[_0xe2a4('0x15')],'app':_0xe2a4('0x16'),'appdata':_0xe2a4('0x3d'),'context':_0x184095[_0xe2a4('0x19')],'exten':_0x184095[_0xe2a4('0xb')],'priority':_0x594b6c[_0xe2a4('0x34')]+_0x5a1f4b[_0xe2a4('0x10')]+_0x7e8b6c++,'VoiceExtensionId':_0x184095[_0xe2a4('0x1a')]});}}}for(var _0x34961f=0x0;_0x34961f<_0x594b6c[_0xe2a4('0x34')];_0x34961f+=0x1){var _0x565162=_0x5a1f4b[_0xe2a4('0x10')]+_0x594b6c[_0xe2a4('0x34')];var _0x491375=_0x34961f===_0x594b6c[_0xe2a4('0x34')]-0x1?_0x5a1f4b[_0xe2a4('0x10')]+_0x41b788[_0xe2a4('0x34')]+_0x3b84b9[_0xe2a4('0x34')]+0x2:_0x5a1f4b[_0xe2a4('0x10')]+_0x34961f+0x1;_0x41b788['splice'](_0x34961f,0x0,{'type':_0x184095[_0xe2a4('0x15')],'app':_0xe2a4('0x3e'),'appdata':_0x594b6c[_0x34961f]+'?'+_0x184095[_0xe2a4('0x19')]+_0xe2a4('0x3f')+_0x565162+':'+_0x184095['context']+',${EXTEN},'+_0x491375,'exten':_0x184095[_0xe2a4('0xb')],'context':_0x184095[_0xe2a4('0x19')],'priority':_0x5a1f4b['priority']+_0x34961f,'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});}_0x184095[_0xe2a4('0x10')]=_0x41b788[_0xe2a4('0x34')]?_['last'](_0x41b788)['priority']+0x1:_0x5a1f4b[_0xe2a4('0x10')];_0x5a1f4b[_0xe2a4('0x10')]=(_0x3b84b9[_0xe2a4('0x34')]?_[_0xe2a4('0x40')](_0x3b84b9)[_0xe2a4('0x10')]:_0x184095[_0xe2a4('0x10')])+0x1;_0x5a1f4b['extensions']=_[_0xe2a4('0x41')](_0x5a1f4b['extensions'],_0x41b788,[_0x184095],_0x3b84b9);}_0x5a1f4b[_0xe2a4('0x11')][_0xe2a4('0x14')]({'type':_0x3ab1d5[_0x106fe7][0x0]['type'],'app':_0xe2a4('0x42'),'exten':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0xb')],'context':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x19')],'priority':_0x5a1f4b['priority'],'VoiceExtensionId':_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]});_0x25ec2c[_0xe2a4('0x14')](_0x3ab1d5[_0x106fe7][0x0][_0xe2a4('0x1a')]);_0x257ef4=_[_0xe2a4('0x41')](_0x257ef4,_0x5a1f4b[_0xe2a4('0x11')]);}}return _0x443ca6[_0xe2a4('0x43')](function(_0x5ee503){return _0x443ca6[_0xe2a4('0x2')][_0xe2a4('0x7')][_0xe2a4('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x25ec2c}},'transaction':_0x5ee503})[_0xe2a4('0x5')](function(_0x1808d2){return _0x443ca6[_0xe2a4('0x2')][_0xe2a4('0x7')][_0xe2a4('0x45')](_[_0xe2a4('0x46')](_0x257ef4,_0xe2a4('0x10')),{'transaction':_0x5ee503});});});})[_0xe2a4('0x47')](function(_0x56e5e8){console[_0xe2a4('0x48')](_0x56e5e8);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x48d2=['transaction','bulkCreate','sortBy','catch','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority','extensions','extension','push','type','format','context','VoiceExtensionId','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','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','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat'];(function(_0x4a654c,_0x1d09b9){var _0x51ee7f=function(_0x2c4aa5){while(--_0x2c4aa5){_0x4a654c['push'](_0x4a654c['shift']());}};_0x51ee7f(++_0x1d09b9);}(_0x48d2,0x93));var _0x248d=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x48d2[_0x38b14f];return _0x22a324;};'use strict';var _=require(_0x248d('0x0'));var util=require(_0x248d('0x1'));function rewrite(_0x36ad93,_0x2c4688){var _0x38a443=this;return _0x36ad93[_0x248d('0x2')][_0x248d('0x3')][_0x248d('0x4')]({'raw':!![]})[_0x248d('0x5')](function(_0x35279f){_0x38a443[_0x248d('0x6')]=_0x35279f;return _0x36ad93[_0x248d('0x2')][_0x248d('0x7')]['findAll']({'where':{'IntervalId':_0x2c4688[_0x248d('0x8')]},'raw':!![]});})[_0x248d('0x5')](function(_0x1a09dc){return _0x36ad93[_0x248d('0x2')][_0x248d('0x7')][_0x248d('0x4')]({'where':{'exten':{'$in':_[_0x248d('0x9')](_[_0x248d('0xa')](_0x1a09dc,_0x248d('0xb')))}},'order':[{'raw':_0x248d('0xc')}],'raw':!![]});})[_0x248d('0x5')](function(_0x40ea9a){var _0x3f7e46=_[_0x248d('0xd')](_0x40ea9a,{'priority':'1'});var _0x62db1f=_['filter'](_0x40ea9a,{'isApp':0x1});var _0x22b0e5=_[_0x248d('0xe')](_0x62db1f,_0x248d('0xb'));var _0x2c2dd0=['queue',_0x248d('0xf')];var _0x105bff=[];var _0x38c84f=[];for(var _0x3aac99 in _0x22b0e5){if(_0x22b0e5['hasOwnProperty'](_0x3aac99)){_0x38a443[_0x248d('0x10')]=0x2;_0x38a443[_0x248d('0x11')]=[];_0x38a443[_0x248d('0x12')]=_['find'](_0x3f7e46,{'exten':_0x22b0e5[_0x3aac99][0x0]['exten']});_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':'Set','appdata':util[_0x248d('0x15')]('CDR(type)=%s',_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')]),'context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});if(_0x22b0e5[_0x3aac99][0x0]['type']==='inbound'){_0x38a443['extensions'][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':_0x248d('0x19')+_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')],'context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0]['exten'],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});}else if(_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')]===_0x248d('0x1a')){if(_0x38a443['extension']){_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0]['type'],'app':'Set','appdata':_0x248d('0x1b')+(_0x38a443[_0x248d('0x12')][_0x248d('0x1c')]?_0x248d('0x1d')+_0x38a443['extension']['cutdigits']+'}':_0x248d('0x1e')),'context':_0x22b0e5[_0x3aac99][0x0]['context'],'exten':_0x22b0e5[_0x3aac99][0x0]['exten'],'priority':_0x38a443['priority']++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0]['VoiceExtensionId']});}_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':_0x248d('0x19')+_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')],'context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443['priority']++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});var _0x4393a5=_0x38a443[_0x248d('0x10')]++;_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x1f'),'appdata':_0x248d('0x20')+(_0x4393a5+0x2)+_0x248d('0x21')+(_0x4393a5+0x1)+')','context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0]['exten'],'priority':_0x4393a5,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});if(_0x38a443[_0x248d('0x12')]){_0x38a443['extensions'][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':_0x38a443[_0x248d('0x12')][_0x248d('0x1c')]?_0x248d('0x22')+_0x38a443[_0x248d('0x12')][_0x248d('0x1c')]+'}':_0x248d('0x23'),'context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443['priority']++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});}_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')],'context':_0x22b0e5[_0x3aac99][0x0]['context'],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});if(_0x38a443[_0x248d('0x12')]&&_0x38a443[_0x248d('0x12')][_0x248d('0x24')](_0x248d('0x25'))&&_0x38a443['extension']['recordingFormat']!==_0x248d('0x26')){_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':_0x248d('0x27'),'context':_0x22b0e5[_0x3aac99][0x0]['context'],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x38a443['extension'][_0x248d('0x25')]||'wav','context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});}}_0x38a443['extensions']['push']({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':_0x248d('0x28'),'context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0]['type'],'app':_0x248d('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0]['exten'],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});_0x38a443['extensions'][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':_0x248d('0x29'),'context':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x16')],'exten':_0x22b0e5[_0x3aac99][0x0][_0x248d('0xb')],'priority':_0x38a443[_0x248d('0x10')]++,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});for(var _0x550a09=0x0,_0x3f481b=0x0;_0x550a09<_0x22b0e5[_0x3aac99]['length'];_0x550a09+=0x1,_0x3f481b=0x0){var _0x209d98=_0x22b0e5[_0x3aac99][_0x550a09];if(_0x209d98[_0x248d('0x14')]){_0x209d98[_0x248d('0x14')]=_0x209d98[_0x248d('0x14')][_0x248d('0x2a')]();}var _0x36ebc7=[];var _0x2dc6c8=[];delete _0x209d98['id'];delete _0x209d98[_0x248d('0x2b')];delete _0x209d98[_0x248d('0x2c')];var _0x3b4ca4=_0x209d98[_0x248d('0x2d')]!==_0x248d('0x2e')?[_0x209d98[_0x248d('0x2d')]]:_0x209d98[_0x248d('0x8')]?_['map'](_[_0x248d('0xd')](_0x38a443[_0x248d('0x6')],{'IntervalId':_0x209d98[_0x248d('0x8')]}),_0x248d('0x2d')):[];if(_0x209d98['hasOwnProperty']('tag')){if(_0x209d98[_0x248d('0x2f')]&&_0x209d98['tag']!=='--'){_0x36ebc7[_0x248d('0x13')]({'type':_0x209d98['type'],'app':_0x248d('0x18'),'appdata':_0x248d('0x30')+_0x209d98['tag'],'context':_0x209d98[_0x248d('0x16')],'exten':_0x209d98['exten'],'priority':_0x3b4ca4[_0x248d('0x31')]+_0x38a443['priority']+_0x3f481b++,'VoiceExtensionId':_0x209d98['VoiceExtensionId']});}}if(_0x209d98[_0x248d('0x14')]===_0x248d('0x1a')&&_0x209d98[_0x248d('0x24')](_0x248d('0x32'))){if(_0x209d98['callerID']){_0x36ebc7[_0x248d('0x13')]({'type':_0x209d98['type'],'app':_0x248d('0x1f'),'appdata':_0x248d('0x33')+_0x209d98['callerID']+')','context':_0x209d98[_0x248d('0x16')],'exten':_0x209d98[_0x248d('0xb')],'priority':_0x3b4ca4[_0x248d('0x31')]+_0x38a443[_0x248d('0x10')]+_0x3f481b++,'VoiceExtensionId':_0x209d98['VoiceExtensionId']});}else{_0x36ebc7[_0x248d('0x13')]({'type':_0x209d98[_0x248d('0x14')],'app':_0x248d('0x1f'),'appdata':_0x248d('0x34'),'context':_0x209d98[_0x248d('0x16')],'exten':_0x209d98[_0x248d('0xb')],'priority':_0x3b4ca4[_0x248d('0x31')]+_0x38a443[_0x248d('0x10')]+_0x3f481b++,'VoiceExtensionId':_0x209d98[_0x248d('0x17')]});}}if(_0x209d98[_0x248d('0x24')](_0x248d('0x35'))){if(_0x2c2dd0[_0x248d('0x36')](_0x209d98[_0x248d('0x37')][_0x248d('0x2a')]())>=0x0&&_0x209d98['appType']!==_0x248d('0x38')){if(_0x209d98['answer']){_0x36ebc7['push']({'type':_0x209d98[_0x248d('0x14')],'app':_0x248d('0x1f'),'appdata':_0x248d('0x39'),'context':_0x209d98[_0x248d('0x16')],'exten':_0x209d98[_0x248d('0xb')],'priority':_0x3b4ca4[_0x248d('0x31')]+_0x38a443[_0x248d('0x10')]+_0x3f481b++,'VoiceExtensionId':_0x209d98[_0x248d('0x17')]});_0x36ebc7[_0x248d('0x13')]({'type':_0x209d98['type'],'app':'Set','appdata':_0x248d('0x3a'),'context':_0x209d98['context'],'exten':_0x209d98[_0x248d('0xb')],'priority':_0x3b4ca4['length']+_0x38a443[_0x248d('0x10')]+_0x3f481b++,'VoiceExtensionId':_0x209d98[_0x248d('0x17')]});}else{_0x36ebc7[_0x248d('0x13')]({'type':_0x209d98[_0x248d('0x14')],'app':_0x248d('0x1f'),'appdata':_0x248d('0x3b'),'context':_0x209d98[_0x248d('0x16')],'exten':_0x209d98[_0x248d('0xb')],'priority':_0x3b4ca4[_0x248d('0x31')]+_0x38a443['priority']+_0x3f481b++,'VoiceExtensionId':_0x209d98[_0x248d('0x17')]});_0x36ebc7['push']({'type':_0x209d98[_0x248d('0x14')],'app':_0x248d('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x209d98['context'],'exten':_0x209d98[_0x248d('0xb')],'priority':_0x3b4ca4[_0x248d('0x31')]+_0x38a443[_0x248d('0x10')]+_0x3f481b++,'VoiceExtensionId':_0x209d98[_0x248d('0x17')]});}}}for(var _0x452f1c=0x0;_0x452f1c<_0x3b4ca4[_0x248d('0x31')];_0x452f1c+=0x1){var _0x312937=_0x38a443[_0x248d('0x10')]+_0x3b4ca4[_0x248d('0x31')];var _0x166e97=_0x452f1c===_0x3b4ca4[_0x248d('0x31')]-0x1?_0x38a443[_0x248d('0x10')]+_0x36ebc7[_0x248d('0x31')]+_0x2dc6c8[_0x248d('0x31')]+0x2:_0x38a443[_0x248d('0x10')]+_0x452f1c+0x1;_0x36ebc7[_0x248d('0x3c')](_0x452f1c,0x0,{'type':_0x209d98[_0x248d('0x14')],'app':_0x248d('0x3d'),'appdata':_0x3b4ca4[_0x452f1c]+'?'+_0x209d98[_0x248d('0x16')]+_0x248d('0x3e')+_0x312937+':'+_0x209d98[_0x248d('0x16')]+_0x248d('0x3e')+_0x166e97,'exten':_0x209d98[_0x248d('0xb')],'context':_0x209d98[_0x248d('0x16')],'priority':_0x38a443[_0x248d('0x10')]+_0x452f1c,'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});}_0x209d98[_0x248d('0x10')]=_0x36ebc7[_0x248d('0x31')]?_[_0x248d('0x3f')](_0x36ebc7)[_0x248d('0x10')]+0x1:_0x38a443[_0x248d('0x10')];_0x38a443[_0x248d('0x10')]=(_0x2dc6c8[_0x248d('0x31')]?_[_0x248d('0x3f')](_0x2dc6c8)[_0x248d('0x10')]:_0x209d98['priority'])+0x1;_0x38a443[_0x248d('0x11')]=_['concat'](_0x38a443[_0x248d('0x11')],_0x36ebc7,[_0x209d98],_0x2dc6c8);}_0x38a443[_0x248d('0x11')][_0x248d('0x13')]({'type':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x14')],'app':_0x248d('0x40'),'exten':_0x22b0e5[_0x3aac99][0x0]['exten'],'context':_0x22b0e5[_0x3aac99][0x0]['context'],'priority':_0x38a443[_0x248d('0x10')],'VoiceExtensionId':_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]});_0x105bff[_0x248d('0x13')](_0x22b0e5[_0x3aac99][0x0][_0x248d('0x17')]);_0x38c84f=_[_0x248d('0x41')](_0x38c84f,_0x38a443[_0x248d('0x11')]);}}return _0x36ad93[_0x248d('0x42')](function(_0x1162bb){return _0x36ad93['models'][_0x248d('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x105bff}},'transaction':_0x1162bb})[_0x248d('0x5')](function(_0x56e418){return _0x36ad93[_0x248d('0x2')][_0x248d('0x7')][_0x248d('0x43')](_[_0x248d('0x44')](_0x38c84f,_0x248d('0x10')),{'transaction':_0x1162bb});});});})[_0x248d('0x45')](function(_0x4abb0){console[_0x248d('0x46')](_0x4abb0);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 71d9386..5c97e28 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 _0x8aee=['Missing\x20socket_timestamp\x20parameter!','error','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','push','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','str','\x20=\x20?','id\x20IN\x20?','outbound','dialCheckDuplicateType','CmList','then','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','BlackLists','Campaign','findAll','Lists','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8aee,0x189));var _0xe8ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aee[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0xe8ae('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0xe8ae('0x1'));var Papa=require(_0xe8ae('0x2'));var Redis=require(_0xe8ae('0x3'));var db=require(_0xe8ae('0x4'))['db'];var config=require(_0xe8ae('0x5'));var logger=require(_0xe8ae('0x6'))('api');config['redis']=_['defaults'](config[_0xe8ae('0x7')],{'host':_0xe8ae('0x8'),'port':0x18eb});var socket=require(_0xe8ae('0x9'))(new Redis(config[_0xe8ae('0x7')]));require(_0xe8ae('0xa'))[_0xe8ae('0xb')](socket);try{if(!process[_0xe8ae('0xc')][0x2]||process[_0xe8ae('0xc')][0x2]===_0xe8ae('0xd')||process[_0xe8ae('0xc')][0x2]===_0xe8ae('0xe')){throw new Error(_0xe8ae('0xf'));}var FILEPATH=process[_0xe8ae('0xc')][0x2];if(!process['argv'][0x3]||process[_0xe8ae('0xc')][0x3]===_0xe8ae('0xd')||process[_0xe8ae('0xc')][0x3]==='null'||!process['argv'][0x4]||process[_0xe8ae('0xc')][0x4]==='undefined'||process[_0xe8ae('0xc')][0x4]===_0xe8ae('0xe')){throw new Error(_0xe8ae('0x10'));}var FIELDS=_['zipObject'](process[_0xe8ae('0xc')][0x3][_0xe8ae('0x11')](','),process[_0xe8ae('0xc')][0x4]['split'](','));if(!process[_0xe8ae('0xc')][0x5]||process[_0xe8ae('0xc')][0x5]===_0xe8ae('0xd')||process['argv'][0x5]===_0xe8ae('0xe')){throw new Error(_0xe8ae('0x12'));}var LISTID=process[_0xe8ae('0xc')][0x5];var COMPANYID=process[_0xe8ae('0xc')][0x6]&&process[_0xe8ae('0xc')][0x6]!==_0xe8ae('0xd')&&process['argv'][0x6]!==_0xe8ae('0xe')?process[_0xe8ae('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xe8ae('0xc')][0x7]!==_0xe8ae('0xd')&&process[_0xe8ae('0xc')][0x7]!=='null'?process[_0xe8ae('0xc')][0x7]:null;if(!process[_0xe8ae('0xc')][0x8]||process['argv'][0x8]===_0xe8ae('0xd')||process[_0xe8ae('0xc')][0x8]===_0xe8ae('0xe')){throw new Error(_0xe8ae('0x13'));}var SOCKET_TIMESTAMP=process[_0xe8ae('0xc')][0x8];}catch(_0xa44ab3){logger[_0xe8ae('0x14')](_0xa44ab3);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(_0x3c36a8,_0xc64bdc,_0x23981e,_0x1accfc){var _0x4ed764={'message':_0xc64bdc};_0x4ed764[_0x3c36a8]=!![];if(_0x23981e){_0x4ed764['contact']=_0x23981e;}if(_0x1accfc){_0x4ed764[_0xe8ae('0x15')]=_0x1accfc;}return _0x4ed764;}function isEmail(_0x2742b8){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))*$/[_0xe8ae('0x16')](_0x2742b8);}function checkRow(_0x25d94b,_0x45aa93,_0x1e77df){return new BPromise(function(_0x37c0db,_0x481bd6){if(_['isNil'](_0x25d94b)){return _0x481bd6(handleCheckRowError('error',_0xe8ae('0x17'),null,_0x1e77df));}if(_0x25d94b[_0xe8ae('0x18')]&&_0x25d94b[_0xe8ae('0x18')][_0xe8ae('0x19')]){var _0x2f53c9=_['map'](_0x25d94b[_0xe8ae('0x18')],'message')[_0xe8ae('0x1a')](';');return _0x481bd6(handleCheckRowError(_0xe8ae('0x14'),_0x2f53c9,null,_0x1e77df));}var _0x13077e={};for(var _0x7777c9 in FIELDS){if(FIELDS['hasOwnProperty'](_0x7777c9)&&FIELDS[_0x7777c9]){_0x13077e[_0x7777c9]=_0x25d94b[_0xe8ae('0x1b')][0x0][FIELDS[_0x7777c9]]||_0x25d94b[_0xe8ae('0x1b')][0x0]['\ufeff'+FIELDS[_0x7777c9]];}}if(!_0x13077e[_0xe8ae('0x1c')]){return _0x481bd6(handleCheckRowError(_0xe8ae('0x14'),_0xe8ae('0x1d'),null,_0x1e77df));}if(!_0x13077e['phone']){return _0x481bd6(handleCheckRowError(_0xe8ae('0x14'),_0xe8ae('0x1e'),null,_0x1e77df));}if(_0x13077e[_0xe8ae('0x1f')]){var _0x21274f=moment(_0x13077e[_0xe8ae('0x1f')],_0xe8ae('0x20'));if(!_0x21274f[_0xe8ae('0x21')]()){return _0x481bd6(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1e77df));}}if(_0x13077e[_0xe8ae('0x22')]){if(!isEmail(_0x13077e[_0xe8ae('0x22')])){return _0x481bd6(handleCheckRowError(_0xe8ae('0x14'),_0xe8ae('0x23'),null,_0x1e77df));}}_0x13077e[_0xe8ae('0x24')]=LISTID;_0x13077e[_0xe8ae('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe8ae('0x19')]&&_0x45aa93){var _0x1b14ba={};for(var _0x5a475c=0x0,_0x3c5d68=DUPLICATES[_0xe8ae('0x19')];_0x5a475c<_0x3c5d68;_0x5a475c+=0x1){_0x1b14ba[DUPLICATES[_0x5a475c]]=_0x13077e[DUPLICATES[_0x5a475c]];}var _0x4a9775=_[_0xe8ae('0x26')](_0x45aa93,_0x1b14ba);if(_0x4a9775){return _0x481bd6(handleCheckRowError(_0xe8ae('0x27'),_0xe8ae('0x28'),_0x4a9775,_0x1e77df));}}return db['CmContact'][_0xe8ae('0x29')](_0x13077e,{'raw':!![],'hooks':![],'fields':_[_0xe8ae('0x2a')](_0x13077e)})['then'](function(_0x4db7eb){if(DUPLICATES&&DUPLICATES[_0xe8ae('0x19')]&&_0x45aa93){_0x45aa93[_0xe8ae('0x2b')](_['pick'](_0x13077e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4db7eb['id'];return _0x37c0db();})[_0xe8ae('0x2c')](function(_0x15e3a1){return _0x481bd6(handleCheckRowError(_0xe8ae('0x14'),_0xe8ae('0x2d')+(_0x15e3a1[_0xe8ae('0x2e')]||JSON[_0xe8ae('0x2f')](_0x15e3a1)),null,_0x1e77df));});});}function checkHopper(){function _0x21f3f5(){return function(_0x40b342){logger['error'](_0xe8ae('0x30'),'checkHopper',util[_0xe8ae('0x31')](_0x40b342,{'showHidden':![],'depth':null}));};}var _0x5c2d14=function(_0x3732f4,_0x2bb3bf){var _0x27b6f6=squel[_0xe8ae('0x32')]()[_0xe8ae('0x33')](_0xe8ae('0x34'))[_0xe8ae('0x35')]([_0xe8ae('0x36'),'scheduledAt',_0xe8ae('0x37'),_0xe8ae('0x24'),_0x2bb3bf,_0xe8ae('0x38'),_0xe8ae('0x39')],squel[_0xe8ae('0x3a')]()[_0xe8ae('0x3b')](_0xe8ae('0x36'),'phone')[_0xe8ae('0x3b')](_0xe8ae('0x3c'),_0xe8ae('0x3d'))[_0xe8ae('0x3b')]('id',_0xe8ae('0x37'))[_0xe8ae('0x3b')](LISTID[_0xe8ae('0x3e')](),_0xe8ae('0x24'))[_0xe8ae('0x3b')](_0x3732f4['id'][_0xe8ae('0x3e')](),_0x2bb3bf)[_0xe8ae('0x3b')](_0xe8ae('0x3c'),_0xe8ae('0x38'))[_0xe8ae('0x3b')](_0xe8ae('0x3c'),_0xe8ae('0x39'))[_0xe8ae('0x3f')](_0xe8ae('0x40'))[_0xe8ae('0x41')](_0xe8ae('0x42'))['where'](_0xe8ae('0x43'),LISTID[_0xe8ae('0x3e')]())[_0xe8ae('0x41')](_0xe8ae('0x44'))['where'](_0xe8ae('0x45'),squel['select']()[_0xe8ae('0x3b')](_0xe8ae('0x36'))[_0xe8ae('0x3f')](_0xe8ae('0x34'))[_0xe8ae('0x41')](_0x2bb3bf+'\x20=\x20?',_0x3732f4['id'][_0xe8ae('0x3e')]())))[_0xe8ae('0x3e')]();return _0x27b6f6;};var _0x295666=function(_0x2e112d,_0x804da2){var _0x3abd38=squel[_0xe8ae('0x32')]()[_0xe8ae('0x33')](_0xe8ae('0x34'))[_0xe8ae('0x35')](['phone',_0xe8ae('0x3d'),_0xe8ae('0x37'),_0xe8ae('0x24'),_0x804da2,_0xe8ae('0x38'),_0xe8ae('0x39')],squel[_0xe8ae('0x3a')]()[_0xe8ae('0x3b')](_0xe8ae('0x36'),_0xe8ae('0x36'))['field'](_0xe8ae('0x3c'),_0xe8ae('0x3d'))[_0xe8ae('0x3b')]('id','ContactId')['field'](LISTID['toString'](),'ListId')[_0xe8ae('0x3b')](_0x2e112d['id'][_0xe8ae('0x3e')](),_0x804da2)[_0xe8ae('0x3b')](_0xe8ae('0x3c'),'createdAt')[_0xe8ae('0x3b')](_0xe8ae('0x3c'),_0xe8ae('0x39'))['from'](_0xe8ae('0x40'))['where'](_0xe8ae('0x42'))[_0xe8ae('0x41')](_0xe8ae('0x43'),LISTID[_0xe8ae('0x3e')]())[_0xe8ae('0x41')]('id\x20IN\x20?',squel[_0xe8ae('0x46')](hopperContacts))[_0xe8ae('0x41')](_0xe8ae('0x44'))[_0xe8ae('0x41')](_0xe8ae('0x45'),squel[_0xe8ae('0x3a')]()[_0xe8ae('0x3b')]('calleridnum')[_0xe8ae('0x3f')]('cm_hopper_final')[_0xe8ae('0x41')](_0x804da2+_0xe8ae('0x47'),_0x2e112d['id'][_0xe8ae('0x3e')]()))['where'](_0xe8ae('0x45'),squel[_0xe8ae('0x3a')]()[_0xe8ae('0x3b')](_0xe8ae('0x36'))[_0xe8ae('0x3f')](_0xe8ae('0x34'))[_0xe8ae('0x41')](_0x804da2+_0xe8ae('0x47'),_0x2e112d['id'][_0xe8ae('0x3e')]())))[_0xe8ae('0x3e')]();return _0x3abd38;};function _0x2c2896(_0x17c330,_0x3ed0cf){var _0x1483b1=squel[_0xe8ae('0x32')]()['into'](_0xe8ae('0x34'))['fromQuery']([_0xe8ae('0x36'),_0xe8ae('0x3d'),'ContactId',_0xe8ae('0x24'),_0x3ed0cf,'createdAt',_0xe8ae('0x39')],squel[_0xe8ae('0x3a')]()[_0xe8ae('0x3b')](_0xe8ae('0x36'),_0xe8ae('0x36'))[_0xe8ae('0x3b')](_0xe8ae('0x3c'),_0xe8ae('0x3d'))[_0xe8ae('0x3b')]('id',_0xe8ae('0x37'))[_0xe8ae('0x3b')](LISTID[_0xe8ae('0x3e')](),_0xe8ae('0x24'))[_0xe8ae('0x3b')](_0x17c330['id'][_0xe8ae('0x3e')](),_0x3ed0cf)[_0xe8ae('0x3b')]('NOW()',_0xe8ae('0x38'))['field'](_0xe8ae('0x3c'),_0xe8ae('0x39'))[_0xe8ae('0x3f')](_0xe8ae('0x40'))[_0xe8ae('0x41')](_0xe8ae('0x42'))[_0xe8ae('0x41')](_0xe8ae('0x43'),LISTID[_0xe8ae('0x3e')]())[_0xe8ae('0x41')](_0xe8ae('0x48'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xe8ae('0x3e')]();return _0x1483b1;}function _0x547939(_0x4cccd7,_0x1f0519){var _0x6fe160=squel['insert']()[_0xe8ae('0x33')]('cm_hopper_black')[_0xe8ae('0x35')]([_0xe8ae('0x36'),_0xe8ae('0x37'),'ListId',_0x1f0519,_0xe8ae('0x38'),_0xe8ae('0x39')],squel[_0xe8ae('0x3a')]()['field'](_0xe8ae('0x36'),'phone')[_0xe8ae('0x3b')]('id',_0xe8ae('0x37'))[_0xe8ae('0x3b')](LISTID[_0xe8ae('0x3e')](),_0xe8ae('0x24'))['field'](_0x4cccd7['id'][_0xe8ae('0x3e')](),_0x1f0519)[_0xe8ae('0x3b')](_0xe8ae('0x3c'),_0xe8ae('0x38'))['field'](_0xe8ae('0x3c'),_0xe8ae('0x39'))[_0xe8ae('0x3f')](_0xe8ae('0x40'))[_0xe8ae('0x41')]('deletedAt\x20IS\x20NULL')[_0xe8ae('0x41')](_0xe8ae('0x43'),LISTID[_0xe8ae('0x3e')]())[_0xe8ae('0x41')](_0xe8ae('0x48'),squel[_0xe8ae('0x46')](hopperContacts))[_0xe8ae('0x41')](_0xe8ae('0x44')))['toString']();return _0x6fe160;}return db['VoiceQueue']['findAll']({'where':{'type':_0xe8ae('0x49')},'attributes':['id',_0xe8ae('0x4a')],'include':[{'model':db[_0xe8ae('0x4b')],'as':'Lists','where':{'id':LISTID}}]})[_0xe8ae('0x4c')](function(_0x401bd9){var _0x24c1bc=[];if(_0x401bd9){var _0x5d246d;for(var _0x3596b5=0x0,_0x1e5a8c;_0x3596b5<_0x401bd9['length'];_0x3596b5+=0x1){_0x1e5a8c=_0x401bd9[_0x3596b5][_0xe8ae('0x4d')]({'plain':!![]});switch(_0x1e5a8c[_0xe8ae('0x4a')]){case _0xe8ae('0x4e'):_0x24c1bc[_0xe8ae('0x2b')](db[_0xe8ae('0x4f')][_0xe8ae('0x50')](_0x295666(_0x1e5a8c,'VoiceQueueId'))[_0xe8ae('0x4c')](function(){})[_0xe8ae('0x2c')](_0x21f3f5()));break;case _0xe8ae('0x51'):_0x24c1bc[_0xe8ae('0x2b')](db[_0xe8ae('0x4f')][_0xe8ae('0x50')](_0x5c2d14(_0x1e5a8c,_0xe8ae('0x52')))[_0xe8ae('0x4c')](function(){})['catch'](_0x21f3f5()));break;default:_0x24c1bc['push'](db['sequelize']['query'](_0x2c2896(_0x1e5a8c,_0xe8ae('0x52')))[_0xe8ae('0x4c')](function(){})[_0xe8ae('0x2c')](_0x21f3f5()));}}}return _0x24c1bc;})[_0xe8ae('0x53')]()[_0xe8ae('0x4c')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0xe8ae('0x49')},'attributes':['id'],'include':[{'model':db[_0xe8ae('0x4b')],'as':_0xe8ae('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x6e8b66){var _0x4bfde2=[];if(_0x6e8b66){var _0x4155ae;for(var _0x40c9b0=0x0,_0x4760cd;_0x40c9b0<_0x6e8b66['length'];_0x40c9b0+=0x1){_0x4760cd=_0x6e8b66[_0x40c9b0][_0xe8ae('0x4d')]({'plain':!![]});_0x4bfde2[_0xe8ae('0x2b')](db[_0xe8ae('0x4f')][_0xe8ae('0x50')](_0x547939(_0x4760cd,'VoiceQueueId'))[_0xe8ae('0x4c')](function(){})[_0xe8ae('0x2c')](_0x21f3f5()));}}return _0x4bfde2;})[_0xe8ae('0x53')]();})['then'](function(){return db[_0xe8ae('0x55')][_0xe8ae('0x56')]({'attributes':['id',_0xe8ae('0x4a')],'include':[{'model':db['CmList'],'as':_0xe8ae('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x1bb127){var _0xc89034=[];if(_0x1bb127){for(var _0x5db3e5=0x0,_0x17094a;_0x5db3e5<_0x1bb127['length'];_0x5db3e5+=0x1){_0x17094a=_0x1bb127[_0x5db3e5]['get']({'plain':!![]});switch(_0x17094a[_0xe8ae('0x4a')]){case _0xe8ae('0x4e'):_0xc89034[_0xe8ae('0x2b')](db[_0xe8ae('0x4f')]['query'](_0x295666(_0x17094a,_0xe8ae('0x58')))[_0xe8ae('0x4c')](function(){})[_0xe8ae('0x2c')](_0x21f3f5()));break;case _0xe8ae('0x51'):_0xc89034[_0xe8ae('0x2b')](db[_0xe8ae('0x4f')]['query'](_0x5c2d14(_0x17094a,_0xe8ae('0x58')))[_0xe8ae('0x4c')](function(){})[_0xe8ae('0x2c')](_0x21f3f5()));break;default:_0xc89034['push'](db[_0xe8ae('0x4f')][_0xe8ae('0x50')](_0x2c2896(_0x17094a,'CampaignId'))[_0xe8ae('0x4c')](function(){})[_0xe8ae('0x2c')](_0x21f3f5()));}}}return _0xc89034;})[_0xe8ae('0x53')]();})['then'](function(){return db[_0xe8ae('0x55')][_0xe8ae('0x56')]({'attributes':['id'],'include':[{'model':db[_0xe8ae('0x4b')],'as':_0xe8ae('0x54'),'where':{'id':LISTID}}]})[_0xe8ae('0x4c')](function(_0x45590e){var _0x54b2d4=[];if(_0x45590e){for(var _0x519bfb=0x0,_0x40e0cf;_0x519bfb<_0x45590e[_0xe8ae('0x19')];_0x519bfb+=0x1){_0x40e0cf=_0x45590e[_0x519bfb]['get']({'plain':!![]});_0x54b2d4['push'](db[_0xe8ae('0x4f')]['query'](_0x547939(_0x40e0cf,_0xe8ae('0x58')))[_0xe8ae('0x4c')](function(){})[_0xe8ae('0x2c')](_0x21f3f5()));}}return _0x54b2d4;})[_0xe8ae('0x53')]();})[_0xe8ae('0x2c')](function(_0x1c2767){logger[_0xe8ae('0x14')]('cmContact,\x20%s,\x20%s',_0xe8ae('0x59'),_0x1c2767[_0xe8ae('0x2e')]);});}var processPromises=function(_0x2ac271){return BPromise[_0xe8ae('0x53')](promises)[_0xe8ae('0x4c')](function(_0x4fde9b){})[_0xe8ae('0x2c')](function(_0x1ae9e7){logger[_0xe8ae('0x14')](_0xe8ae('0x5a'),JSON[_0xe8ae('0x2f')](_0x1ae9e7));})[_0xe8ae('0x5b')](function(){socket[_0xe8ae('0x5c')](_0xe8ae('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2ac271){return _0x2ac271[_0xe8ae('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xe8ae('0x4c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xe8ae('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xe8ae('0x5f')](FILEPATH);}catch(_0x4fb2c1){logger[_0xe8ae('0x14')](_0xe8ae('0x60'),JSON['stringify'](_0x4fb2c1));}finally{process['exit'](0x0);}});};process['on'](_0xe8ae('0x61'),function(){logger[_0xe8ae('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0xe8ae('0x4c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe8ae('0x11')](',');return db['CmContact'][_0xe8ae('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x365ade){var _0x119a70=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe8ae('0x63')](_0x119a70,{'header':!![],'skipEmptyLines':!![],'step':function(_0x17b746,_0x44a78c){total+=0x1;var _0x471755=total;promises['push'](checkRow(_0x17b746,_0x365ade,_0x471755)[_0xe8ae('0x4c')](function(){success+=0x1;})['catch'](function(_0x747e03){if(_0x747e03['error']){errors+=0x1;delete _0x747e03['error'];}else if(_0x747e03[_0xe8ae('0x27')]){duplicates+=0x1;delete _0x747e03[_0xe8ae('0x27')];}rows[_0xe8ae('0x2b')](_0x747e03);}));if(total%0xc8===0x0){_0x44a78c['pause']();return processPromises(_0x44a78c);}},'complete':function(){return processPromises()['then'](function(){logger[_0xe8ae('0x62')](_0xe8ae('0x64'));endCsv();});},'error':function(_0x20eb04,_0x221b0e){logger['info'](_0xe8ae('0x65'),JSON['stringify'](_0x20eb04));endCsv();}});})[_0xe8ae('0x2c')](function(_0x15525c){logger[_0xe8ae('0x14')](_0xe8ae('0x66'),JSON[_0xe8ae('0x2f')](_0x15525c));});}main(); \ No newline at end of file +var _0x586b=['always','sequelize','query','catch','onlyIfOpen','VoiceQueueId','all','Campaign','CampaignId','generalCheckHopper','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','field','NOW()','toString','createdAt','updatedAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','calleridnum','str','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get'];(function(_0x1bfeb2,_0x4dc855){var _0x828deb=function(_0x26e386){while(--_0x26e386){_0x1bfeb2['push'](_0x1bfeb2['shift']());}};_0x828deb(++_0x4dc855);}(_0x586b,0x1db));var _0xb586=function(_0x2552c4,_0x11dbaa){_0x2552c4=_0x2552c4-0x0;var _0x4e3220=_0x586b[_0x2552c4];return _0x4e3220;};'use strict';var BPromise=require(_0xb586('0x0'));var util=require(_0xb586('0x1'));var _=require(_0xb586('0x2'));var fs=require('fs');var squel=require(_0xb586('0x3'));var Papa=require(_0xb586('0x4'));var Redis=require(_0xb586('0x5'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xb586('0x6'));config[_0xb586('0x7')]=_['defaults'](config[_0xb586('0x7')],{'host':_0xb586('0x8'),'port':0x18eb});var socket=require(_0xb586('0x9'))(new Redis(config['redis']));require(_0xb586('0xa'))[_0xb586('0xb')](socket);try{if(!process[_0xb586('0xc')][0x2]||process[_0xb586('0xc')][0x2]===_0xb586('0xd')||process[_0xb586('0xc')][0x2]===_0xb586('0xe')){throw new Error(_0xb586('0xf'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0xb586('0xc')][0x3]===_0xb586('0xd')||process[_0xb586('0xc')][0x3]===_0xb586('0xe')||!process['argv'][0x4]||process[_0xb586('0xc')][0x4]===_0xb586('0xd')||process[_0xb586('0xc')][0x4]===_0xb586('0xe')){throw new Error(_0xb586('0x10'));}var FIELDS=_[_0xb586('0x11')](process[_0xb586('0xc')][0x3][_0xb586('0x12')](','),process[_0xb586('0xc')][0x4][_0xb586('0x12')](','));if(!process[_0xb586('0xc')][0x5]||process[_0xb586('0xc')][0x5]===_0xb586('0xd')||process[_0xb586('0xc')][0x5]==='null'){throw new Error(_0xb586('0x13'));}var LISTID=process[_0xb586('0xc')][0x5];var COMPANYID=process[_0xb586('0xc')][0x6]&&process[_0xb586('0xc')][0x6]!==_0xb586('0xd')&&process[_0xb586('0xc')][0x6]!==_0xb586('0xe')?process[_0xb586('0xc')][0x6]:null;var DUPLICATES=process[_0xb586('0xc')][0x7]&&process[_0xb586('0xc')][0x7]!==_0xb586('0xd')&&process[_0xb586('0xc')][0x7]!==_0xb586('0xe')?process['argv'][0x7]:null;if(!process[_0xb586('0xc')][0x8]||process['argv'][0x8]===_0xb586('0xd')||process[_0xb586('0xc')][0x8]===_0xb586('0xe')){throw new Error(_0xb586('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xe8429a){logger[_0xb586('0x15')](_0xe8429a);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(_0x143d9a,_0x52da20,_0x43ca21,_0x5be122){var _0x18d5fb={'message':_0x52da20};_0x18d5fb[_0x143d9a]=!![];if(_0x43ca21){_0x18d5fb[_0xb586('0x16')]=_0x43ca21;}if(_0x5be122){_0x18d5fb['index']=_0x5be122;}return _0x18d5fb;}function isEmail(_0x260254){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))*$/[_0xb586('0x17')](_0x260254);}function checkRow(_0x2aa0a8,_0x35fe3d,_0x4edad9){return new BPromise(function(_0x193853,_0x411e3e){if(_[_0xb586('0x18')](_0x2aa0a8)){return _0x411e3e(handleCheckRowError(_0xb586('0x15'),_0xb586('0x19'),null,_0x4edad9));}if(_0x2aa0a8[_0xb586('0x1a')]&&_0x2aa0a8[_0xb586('0x1a')][_0xb586('0x1b')]){var _0x1b7e50=_[_0xb586('0x1c')](_0x2aa0a8['errors'],_0xb586('0x1d'))[_0xb586('0x1e')](';');return _0x411e3e(handleCheckRowError(_0xb586('0x15'),_0x1b7e50,null,_0x4edad9));}var _0x4fbdee={};for(var _0x2137d1 in FIELDS){if(FIELDS[_0xb586('0x1f')](_0x2137d1)&&FIELDS[_0x2137d1]){_0x4fbdee[_0x2137d1]=_0x2aa0a8[_0xb586('0x20')][0x0][FIELDS[_0x2137d1]]||_0x2aa0a8[_0xb586('0x20')][0x0]['\ufeff'+FIELDS[_0x2137d1]];}}if(!_0x4fbdee[_0xb586('0x21')]){return _0x411e3e(handleCheckRowError(_0xb586('0x15'),_0xb586('0x22'),null,_0x4edad9));}if(!_0x4fbdee[_0xb586('0x23')]){return _0x411e3e(handleCheckRowError('error',_0xb586('0x24'),null,_0x4edad9));}if(_0x4fbdee[_0xb586('0x25')]){var _0x3fa683=moment(_0x4fbdee[_0xb586('0x25')],_0xb586('0x26'));if(!_0x3fa683[_0xb586('0x27')]()){return _0x411e3e(handleCheckRowError(_0xb586('0x15'),_0xb586('0x28'),null,_0x4edad9));}}if(_0x4fbdee[_0xb586('0x29')]){if(!isEmail(_0x4fbdee['email'])){return _0x411e3e(handleCheckRowError(_0xb586('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x4edad9));}}_0x4fbdee[_0xb586('0x2a')]=LISTID;_0x4fbdee[_0xb586('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb586('0x1b')]&&_0x35fe3d){var _0x228b0b={};for(var _0x457608=0x0,_0x19e3bd=DUPLICATES[_0xb586('0x1b')];_0x457608<_0x19e3bd;_0x457608+=0x1){_0x228b0b[DUPLICATES[_0x457608]]=_0x4fbdee[DUPLICATES[_0x457608]];}var _0x3e79db=_[_0xb586('0x2c')](_0x35fe3d,_0x228b0b);if(_0x3e79db){return _0x411e3e(handleCheckRowError('duplicate',_0xb586('0x2d'),_0x3e79db,_0x4edad9));}}return db[_0xb586('0x2e')][_0xb586('0x2f')](_0x4fbdee,{'raw':!![],'hooks':![],'fields':_[_0xb586('0x30')](_0x4fbdee)})[_0xb586('0x31')](function(_0x31e64f){if(DUPLICATES&&DUPLICATES[_0xb586('0x1b')]&&_0x35fe3d){_0x35fe3d[_0xb586('0x32')](_['pick'](_0x4fbdee,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x31e64f['id'];return _0x193853();})['catch'](function(_0x2a2ad8){return _0x411e3e(handleCheckRowError('error',_0xb586('0x33')+(_0x2a2ad8[_0xb586('0x1d')]||JSON['stringify'](_0x2a2ad8)),null,_0x4edad9));});});}function checkHopper(){function _0x9fe803(){return function(_0x96dfe6){logger[_0xb586('0x15')](_0xb586('0x34'),_0xb586('0x35'),util[_0xb586('0x36')](_0x96dfe6,{'showHidden':![],'depth':null}));};}var _0xc2302=function(_0x238543,_0x3b665e){var _0x56eb51=squel[_0xb586('0x37')]()[_0xb586('0x38')]('cm_hopper')[_0xb586('0x39')](['phone',_0xb586('0x3a'),_0xb586('0x3b'),_0xb586('0x2a'),_0x3b665e,'createdAt','updatedAt'],squel['select']()[_0xb586('0x3c')]('phone',_0xb586('0x23'))[_0xb586('0x3c')](_0xb586('0x3d'),'scheduledAt')[_0xb586('0x3c')]('id',_0xb586('0x3b'))[_0xb586('0x3c')](LISTID[_0xb586('0x3e')](),'ListId')['field'](_0x238543['id']['toString'](),_0x3b665e)[_0xb586('0x3c')](_0xb586('0x3d'),_0xb586('0x3f'))['field'](_0xb586('0x3d'),_0xb586('0x40'))[_0xb586('0x41')](_0xb586('0x42'))[_0xb586('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0xb586('0x44'),LISTID[_0xb586('0x3e')]())[_0xb586('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0xb586('0x43')](_0xb586('0x45'),squel[_0xb586('0x46')]()['field']('phone')['from'](_0xb586('0x47'))[_0xb586('0x43')](_0x3b665e+_0xb586('0x48'),_0x238543['id']['toString']())))[_0xb586('0x3e')]();return _0x56eb51;};var _0x42f27a=function(_0x26b507,_0xbcb94b){var _0x20a7ef=squel[_0xb586('0x37')]()[_0xb586('0x38')](_0xb586('0x47'))[_0xb586('0x39')]([_0xb586('0x23'),_0xb586('0x3a'),'ContactId',_0xb586('0x2a'),_0xbcb94b,'createdAt',_0xb586('0x40')],squel[_0xb586('0x46')]()['field'](_0xb586('0x23'),_0xb586('0x23'))[_0xb586('0x3c')](_0xb586('0x3d'),_0xb586('0x3a'))[_0xb586('0x3c')]('id',_0xb586('0x3b'))[_0xb586('0x3c')](LISTID['toString'](),'ListId')[_0xb586('0x3c')](_0x26b507['id'][_0xb586('0x3e')](),_0xbcb94b)[_0xb586('0x3c')](_0xb586('0x3d'),'createdAt')[_0xb586('0x3c')]('NOW()',_0xb586('0x40'))['from'](_0xb586('0x42'))[_0xb586('0x43')](_0xb586('0x49'))['where'](_0xb586('0x44'),LISTID[_0xb586('0x3e')]())[_0xb586('0x43')](_0xb586('0x4a'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xb586('0x43')](_0xb586('0x45'),squel[_0xb586('0x46')]()[_0xb586('0x3c')](_0xb586('0x4b'))[_0xb586('0x41')]('cm_hopper_final')[_0xb586('0x43')](_0xbcb94b+'\x20=\x20?',_0x26b507['id'][_0xb586('0x3e')]()))['where'](_0xb586('0x45'),squel[_0xb586('0x46')]()[_0xb586('0x3c')](_0xb586('0x23'))['from'](_0xb586('0x47'))['where'](_0xbcb94b+_0xb586('0x48'),_0x26b507['id'][_0xb586('0x3e')]())))[_0xb586('0x3e')]();return _0x20a7ef;};function _0x4d4d11(_0x3d9015,_0x26cb43){var _0xa5b2a=squel[_0xb586('0x37')]()[_0xb586('0x38')](_0xb586('0x47'))[_0xb586('0x39')](['phone',_0xb586('0x3a'),'ContactId',_0xb586('0x2a'),_0x26cb43,_0xb586('0x3f'),_0xb586('0x40')],squel[_0xb586('0x46')]()[_0xb586('0x3c')](_0xb586('0x23'),'phone')[_0xb586('0x3c')](_0xb586('0x3d'),_0xb586('0x3a'))[_0xb586('0x3c')]('id',_0xb586('0x3b'))[_0xb586('0x3c')](LISTID[_0xb586('0x3e')](),'ListId')[_0xb586('0x3c')](_0x3d9015['id'][_0xb586('0x3e')](),_0x26cb43)[_0xb586('0x3c')]('NOW()',_0xb586('0x3f'))[_0xb586('0x3c')]('NOW()',_0xb586('0x40'))[_0xb586('0x41')](_0xb586('0x42'))[_0xb586('0x43')](_0xb586('0x49'))[_0xb586('0x43')](_0xb586('0x44'),LISTID['toString']())[_0xb586('0x43')](_0xb586('0x4a'),squel[_0xb586('0x4c')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb586('0x3e')]();return _0xa5b2a;}function _0x271a2b(_0x2fd984,_0x4ed41c){var _0x54a425=squel[_0xb586('0x37')]()[_0xb586('0x38')](_0xb586('0x4d'))[_0xb586('0x39')]([_0xb586('0x23'),_0xb586('0x3b'),_0xb586('0x2a'),_0x4ed41c,_0xb586('0x3f'),_0xb586('0x40')],squel[_0xb586('0x46')]()['field'](_0xb586('0x23'),_0xb586('0x23'))[_0xb586('0x3c')]('id','ContactId')['field'](LISTID[_0xb586('0x3e')](),_0xb586('0x2a'))[_0xb586('0x3c')](_0x2fd984['id']['toString'](),_0x4ed41c)[_0xb586('0x3c')](_0xb586('0x3d'),_0xb586('0x3f'))[_0xb586('0x3c')](_0xb586('0x3d'),_0xb586('0x40'))['from']('cm_contacts')[_0xb586('0x43')](_0xb586('0x49'))[_0xb586('0x43')](_0xb586('0x44'),LISTID[_0xb586('0x3e')]())[_0xb586('0x43')](_0xb586('0x4a'),squel['str'](hopperContacts))[_0xb586('0x43')](_0xb586('0x4e')))[_0xb586('0x3e')]();return _0x54a425;}return db[_0xb586('0x4f')][_0xb586('0x50')]({'where':{'type':'outbound'},'attributes':['id',_0xb586('0x51')],'include':[{'model':db[_0xb586('0x52')],'as':_0xb586('0x53'),'where':{'id':LISTID}}]})[_0xb586('0x31')](function(_0x447c88){var _0x40bbb3=[];if(_0x447c88){var _0x375254;for(var _0xf74f3=0x0,_0x423b47;_0xf74f3<_0x447c88[_0xb586('0x1b')];_0xf74f3+=0x1){_0x423b47=_0x447c88[_0xf74f3][_0xb586('0x54')]({'plain':!![]});switch(_0x423b47[_0xb586('0x51')]){case _0xb586('0x55'):_0x40bbb3['push'](db[_0xb586('0x56')][_0xb586('0x57')](_0x42f27a(_0x423b47,'VoiceQueueId'))[_0xb586('0x31')](function(){})[_0xb586('0x58')](_0x9fe803()));break;case _0xb586('0x59'):_0x40bbb3[_0xb586('0x32')](db[_0xb586('0x56')]['query'](_0xc2302(_0x423b47,_0xb586('0x5a')))['then'](function(){})['catch'](_0x9fe803()));break;default:_0x40bbb3[_0xb586('0x32')](db[_0xb586('0x56')][_0xb586('0x57')](_0x4d4d11(_0x423b47,_0xb586('0x5a')))['then'](function(){})[_0xb586('0x58')](_0x9fe803()));}}}return _0x40bbb3;})[_0xb586('0x5b')]()[_0xb586('0x31')](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xb586('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb586('0x31')](function(_0x21d544){var _0x8befbb=[];if(_0x21d544){var _0x4acaf0;for(var _0x1b4a83=0x0,_0x287d30;_0x1b4a83<_0x21d544['length'];_0x1b4a83+=0x1){_0x287d30=_0x21d544[_0x1b4a83]['get']({'plain':!![]});_0x8befbb[_0xb586('0x32')](db['sequelize'][_0xb586('0x57')](_0x271a2b(_0x287d30,_0xb586('0x5a')))[_0xb586('0x31')](function(){})[_0xb586('0x58')](_0x9fe803()));}}return _0x8befbb;})['all']();})[_0xb586('0x31')](function(){return db[_0xb586('0x5c')][_0xb586('0x50')]({'attributes':['id',_0xb586('0x51')],'include':[{'model':db['CmList'],'as':_0xb586('0x53'),'where':{'id':LISTID}}]})[_0xb586('0x31')](function(_0x2a3be8){var _0x14e222=[];if(_0x2a3be8){for(var _0x2e23e1=0x0,_0x912967;_0x2e23e1<_0x2a3be8['length'];_0x2e23e1+=0x1){_0x912967=_0x2a3be8[_0x2e23e1][_0xb586('0x54')]({'plain':!![]});switch(_0x912967[_0xb586('0x51')]){case'always':_0x14e222['push'](db['sequelize'][_0xb586('0x57')](_0x42f27a(_0x912967,_0xb586('0x5d')))[_0xb586('0x31')](function(){})[_0xb586('0x58')](_0x9fe803()));break;case _0xb586('0x59'):_0x14e222[_0xb586('0x32')](db[_0xb586('0x56')][_0xb586('0x57')](_0xc2302(_0x912967,'CampaignId'))[_0xb586('0x31')](function(){})[_0xb586('0x58')](_0x9fe803()));break;default:_0x14e222[_0xb586('0x32')](db[_0xb586('0x56')][_0xb586('0x57')](_0x4d4d11(_0x912967,_0xb586('0x5d')))['then'](function(){})[_0xb586('0x58')](_0x9fe803()));}}}return _0x14e222;})[_0xb586('0x5b')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb586('0x31')](function(_0x15019f){var _0x483ac7=[];if(_0x15019f){for(var _0x3994f0=0x0,_0x397168;_0x3994f0<_0x15019f[_0xb586('0x1b')];_0x3994f0+=0x1){_0x397168=_0x15019f[_0x3994f0][_0xb586('0x54')]({'plain':!![]});_0x483ac7['push'](db[_0xb586('0x56')][_0xb586('0x57')](_0x271a2b(_0x397168,_0xb586('0x5d')))[_0xb586('0x31')](function(){})['catch'](_0x9fe803()));}}return _0x483ac7;})['all']();})[_0xb586('0x58')](function(_0x125430){logger[_0xb586('0x15')]('cmContact,\x20%s,\x20%s',_0xb586('0x5e'),_0x125430[_0xb586('0x1d')]);});}var processPromises=function(_0x55ffeb){return BPromise[_0xb586('0x5b')](promises)[_0xb586('0x31')](function(_0x660f90){})[_0xb586('0x58')](function(_0x584893){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xb586('0x5f')](_0x584893));})[_0xb586('0x60')](function(){socket[_0xb586('0x61')](_0xb586('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x55ffeb){return _0x55ffeb[_0xb586('0x63')]();}});};var endCsv=function(){return BPromise[_0xb586('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xb586('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb586('0x65')](FILEPATH);}catch(_0xaf2d7f){logger[_0xb586('0x15')](_0xb586('0x66'),JSON[_0xb586('0x5f')](_0xaf2d7f));}finally{process[_0xb586('0x67')](0x0);}});};process['on'](_0xb586('0x68'),function(){logger[_0xb586('0x69')](_0xb586('0x6a'));endCsv();});function main(){return BPromise[_0xb586('0x64')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb586('0x12')](',');return db[_0xb586('0x2e')][_0xb586('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb586('0x31')](function(_0x388b4){var _0x5eb443=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb586('0x6b')](_0x5eb443,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5695c8,_0xe56a5b){total+=0x1;var _0x1a3cc8=total;promises[_0xb586('0x32')](checkRow(_0x5695c8,_0x388b4,_0x1a3cc8)[_0xb586('0x31')](function(){success+=0x1;})['catch'](function(_0xef97d5){if(_0xef97d5['error']){errors+=0x1;delete _0xef97d5['error'];}else if(_0xef97d5[_0xb586('0x6c')]){duplicates+=0x1;delete _0xef97d5[_0xb586('0x6c')];}rows[_0xb586('0x32')](_0xef97d5);}));if(total%0xc8===0x0){_0xe56a5b['pause']();return processPromises(_0xe56a5b);}},'complete':function(){return processPromises()['then'](function(){logger[_0xb586('0x69')](_0xb586('0x6d'));endCsv();});},'error':function(_0x1ab5c2,_0x1ba891){logger['info'](_0xb586('0x6e'),JSON[_0xb586('0x5f')](_0x1ab5c2));endCsv();}});})[_0xb586('0x58')](function(_0x1c0d0b){logger[_0xb586('0x15')](_0xb586('0x6f'),JSON[_0xb586('0x5f')](_0x1c0d0b));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 87234bf..fc9debe 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 _0x2b59=['cm_contacts.createdAt\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','UserId','recallme','createdAt','from','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','sequelize','query','catch','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','writeFileSync','parse','createReadStream','rows','data','find','_description','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','description','SystemRow','appendFileSync','emit','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(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','contactTypeId','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','bluebird','moment','squel','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','length','push','all','AdditionalPhones','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','fields','join','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2b59,0x1de));var _0x92b5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2b59[_0x2641f9];return _0x585741;};'use strict';var fs=require('fs');var path=require(_0x92b5('0x0'));var _=require(_0x92b5('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x92b5('0x2'));var moment=require(_0x92b5('0x3'));var squel=require(_0x92b5('0x4'));var Redis=require('ioredis');var db=require(_0x92b5('0x5'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0x92b5('0x6'))(_0x92b5('0x7'));config[_0x92b5('0x8')]=_[_0x92b5('0x9')](config[_0x92b5('0x8')],{'host':_0x92b5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x92b5('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x92b5('0xb')](_0x92b5('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x92b5('0xc'));function isEmail(_0x5a1447){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))*$/[_0x92b5('0xd')](_0x5a1447);}function selectNotIn(_0x315384,_0x56283f,_0x2554ae,_0x321b20,_0x26d2c4){return squel[_0x92b5('0xe')]()[_0x92b5('0xf')](_0x92b5('0x10'))['from'](_0x321b20)['join'](_0x56283f,null,_0x56283f+_0x92b5('0x11')+_0x321b20+'.'+_0x2554ae)['where'](_0x321b20+'.'+_0x2554ae+_0x92b5('0x12')+_0x315384+'.'+_0x2554ae)[_0x92b5('0x13')](_0x56283f+_0x92b5('0x14')+_0x26d2c4['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x220bd6,_0x519d7f){promisesAdditionalPhones=[];return db[_0x92b5('0x15')][_0x92b5('0x16')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x92b5('0x17')](function(_0xb12c25){if(_0xb12c25!==null){var _0x283f6e=[];for(var _0x3c6cbb=0x0;_0x3c6cbb<_0xb12c25[_0x92b5('0x18')];_0x3c6cbb++){var _0x5005e9=_0xb12c25[_0x3c6cbb];_0x283f6e[_0x92b5('0x19')](insertAdditionalPhones(_0x5005e9));}}Promise[_0x92b5('0x1a')](_0x283f6e)[_0x92b5('0x17')](function(){_0x220bd6({'val':0x1});});});});}function insertAdditionalPhones(_0xdd0f34){return new Promise(function(_0x28025f,_0x2fca5f){var _0x10241b=_0xdd0f34[_0x92b5('0x1b')];var _0x2e385d=_0x10241b[_0x92b5('0x1c')](';');var _0x2e2a64=[];orderBy=0x0;for(var _0x5e47b2=0x0;_0x5e47b2<_0x2e385d[_0x92b5('0x18')];_0x5e47b2++){_0x2e2a64[_0x92b5('0x19')](splitAdditionalPhone(_0xdd0f34['id'],_0x2e385d[_0x5e47b2]));}Promise['all'](_0x2e2a64)['then'](function(){_0x28025f({'val':_0x2e385d[_0x92b5('0x18')]});});});}function splitAdditionalPhone(_0x1f6aa7,_0x9d4b9d){return new Promise(function(_0x54ebab,_0x9dcb07){var _0x5cc170=_0x9d4b9d[_0x92b5('0x1c')](':');var _0x35e79f=_0x5cc170[0x0];var _0x17bb07=_0x5cc170[0x1];if(!_['isNil'](_0x17bb07)){var _0x2de28d=_0x17bb07[_0x92b5('0x1c')]('|');var _0x4248c5=[];for(var _0x30d468=0x0;_0x30d468<_0x2de28d[_0x92b5('0x18')];_0x30d468++){if(_0x2de28d[_0x30d468]!==''){var _0x546892=_[_0x92b5('0x1d')](promisesAdditionalPhones,{'contactId':_0x1f6aa7,'phone':_0x2de28d[_0x30d468]});if(_0x546892[_0x92b5('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0x92b5('0x19')]({'contactId':_0x1f6aa7,'contactTypeId':_0x35e79f,'phone':_0x2de28d[_0x30d468],'orderBy':orderBy});}}}_0x54ebab({'ok':0x1});}else _0x54ebab({'res':0x0});});}function createAdditionalPhone(_0x128d34,_0x3a92e0,_0x11f84a,_0x4612c8){var _0x4ea7c0='';var _0x323398='';var _0x3be293=_0x11f84a[_0x92b5('0x1c')]('§');_0x4ea7c0=_0x3be293[0x0];if(_0x3be293['length']==0x2)_0x323398=_0x3be293[0x1];return new Promise(function(_0x55ce25,_0x2aa651){return db[_0x92b5('0x1e')][_0x92b5('0x1f')]({'where':{'CmContactId':_0x128d34,'item':_0x4ea7c0}})['then'](function(_0x47d10d){if(_0x47d10d){return db[_0x92b5('0x1e')][_0x92b5('0x20')]({'ItemTypeId':_0x3a92e0,'description':_0x323398,'OrderBy':_0x4612c8},{'where':{'CmContactId':_0x128d34,'item':_0x4ea7c0}})[_0x92b5('0x17')](function(_0x2c5629){_0x55ce25({'res':_0x92b5('0x21')});});}else{return db['CmContactHasItem'][_0x92b5('0x22')]({'CmContactId':_0x128d34,'item':_0x4ea7c0,'description':_0x323398,'ItemTypeId':_0x3a92e0,'OrderBy':_0x4612c8,'ItemClass':_0x92b5('0x23')})['then'](function(_0x368665){_0x55ce25({'res':'inserted'});});}});});}function insertCmHopper(_0x503a6b,_0x31e2cc,_0x3a4ead,_0x504185,_0x942679){var _0x23be1b=[_0x92b5('0x24'),_0x92b5('0x25'),_0x92b5('0x26'),_0x92b5('0x27'),_0x31e2cc+'.'+_0x504185,_0x92b5('0x28'),_0x92b5('0x29'),_0x92b5('0x2a'),_0x92b5('0x2b'),'\x22'+_0x942679+'\x22'];return squel[_0x92b5('0x2c')]()[_0x92b5('0x2d')](_0x92b5('0x2e'))[_0x92b5('0x2f')]([_0x92b5('0x10'),_0x92b5('0x30'),_0x92b5('0x31'),_0x92b5('0x32'),_0x504185,'createdAt',_0x92b5('0x33'),_0x92b5('0x34'),'UserId','recallme'],squel['select']()[_0x92b5('0x35')](_0x23be1b)['from'](_0x31e2cc)[_0x92b5('0x36')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x31e2cc+_0x92b5('0x37'))[_0x92b5('0x36')](_0x3a4ead,null,_0x3a4ead+_0x92b5('0x11')+_0x31e2cc+'.'+_0x504185)[_0x92b5('0x13')](_0x31e2cc+'.CmListId\x20=\x20?',_0x503a6b)[_0x92b5('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x92b5('0x13')](_0x92b5('0x38'),selectNotIn(_0x31e2cc,_0x3a4ead,_0x504185,_0x92b5('0x2e'),[_0x92b5('0x39'),_0x92b5('0x3a')]))[_0x92b5('0x13')](_0x92b5('0x38'),selectNotIn(_0x31e2cc,_0x3a4ead,_0x504185,'cm_hopper',[_0x92b5('0x39')])))['toString']();}function insertCmHopperBlack(_0x432c4c,_0x7c4b22,_0x469bc8,_0x405a20){var _0x375b14=[_0x92b5('0x24'),'cm_contacts.id','cm_contacts.ListId',_0x7c4b22+'.'+_0x405a20,'cm_contacts.createdAt',_0x92b5('0x29')];return squel['insert']()[_0x92b5('0x2d')]('cm_hopper_black')['fromQuery'](['phone',_0x92b5('0x31'),_0x92b5('0x32'),_0x405a20,'createdAt',_0x92b5('0x33')],squel[_0x92b5('0xe')]()[_0x92b5('0x35')](_0x375b14)['from'](_0x7c4b22)[_0x92b5('0x36')](_0x92b5('0x3b'),null,_0x92b5('0x3c')+_0x7c4b22+_0x92b5('0x37'))[_0x92b5('0x36')](_0x469bc8,null,_0x469bc8+_0x92b5('0x11')+_0x7c4b22+'.'+_0x405a20)[_0x92b5('0x13')](_0x7c4b22+_0x92b5('0x3d'),_0x432c4c)[_0x92b5('0x13')](_0x92b5('0x3e'),NOW)[_0x92b5('0x13')](_0x92b5('0x38'),squel[_0x92b5('0xe')]()['field'](_0x92b5('0x10'))['from'](_0x92b5('0x3f'))[_0x92b5('0x13')](_0x92b5('0x40'),_0x432c4c)[_0x92b5('0x13')](_0x405a20+_0x92b5('0x12')+_0x7c4b22+'.'+_0x405a20)))[_0x92b5('0x41')]();}function insertTzCmHopper(_0x1d2cd6,_0x1eb69c,_0x481789,_0x3bcc45,_0x5db526,_0x57424d){var _0x2d8f72=['cm_contacts.phone',_0x92b5('0x42')+_0x57424d+'.offset-cm_contacts.utcOffset\x20minute)',_0x92b5('0x26'),_0x92b5('0x27'),_0x1eb69c+'.'+_0x3bcc45,'cm_contacts.createdAt',_0x92b5('0x29'),_0x92b5('0x2a'),_0x92b5('0x2b'),'\x22'+_0x5db526+'\x22'];var _0x31dfd8=squel['insert']()[_0x92b5('0x2d')]('cm_hopper')[_0x92b5('0x2f')]([_0x92b5('0x10'),_0x92b5('0x30'),'ContactId','ListId',_0x3bcc45,'createdAt',_0x92b5('0x33'),_0x92b5('0x34'),_0x92b5('0x43'),_0x92b5('0x44')],squel[_0x92b5('0xe')]()[_0x92b5('0x35')](_0x2d8f72)['from'](_0x1eb69c)[_0x92b5('0x36')](_0x92b5('0x3b'),null,_0x92b5('0x3c')+_0x1eb69c+_0x92b5('0x37'))[_0x92b5('0x36')](_0x481789,null,_0x481789+_0x92b5('0x11')+_0x1eb69c+'.'+_0x3bcc45)[_0x92b5('0x36')](_0x57424d,null,_0x57424d+'.id\x20=\x20'+_0x1eb69c+'.'+_0x3bcc45)[_0x92b5('0x13')](_0x1eb69c+_0x92b5('0x3d'),_0x1d2cd6)[_0x92b5('0x13')](_0x92b5('0x3e'),NOW)[_0x92b5('0x13')](_0x92b5('0x38'),selectNotIn(_0x1eb69c,_0x481789,_0x3bcc45,_0x92b5('0x2e'),[_0x92b5('0x39'),'\x22onlyIfOpen\x22']))['where'](_0x92b5('0x38'),selectNotIn(_0x1eb69c,_0x481789,_0x3bcc45,_0x92b5('0x2e'),['\x22always\x22'])))[_0x92b5('0x41')]();return _0x31dfd8;}function insertTzCmHopperBlack(_0x4d411f,_0x1fe4ff,_0xcbc9db,_0xbc149e){var _0x44458b=[_0x92b5('0x24'),_0x92b5('0x26'),_0x92b5('0x27'),_0x1fe4ff+'.'+_0xbc149e,_0x92b5('0x28'),'cm_contacts.updatedAt'];return squel[_0x92b5('0x2c')]()[_0x92b5('0x2d')](_0x92b5('0x3f'))[_0x92b5('0x2f')]([_0x92b5('0x10'),_0x92b5('0x31'),_0x92b5('0x32'),_0xbc149e,_0x92b5('0x45'),'updatedAt'],squel[_0x92b5('0xe')]()[_0x92b5('0x35')](_0x44458b)[_0x92b5('0x46')](_0x1fe4ff)['join']('cm_contacts',null,_0x92b5('0x3c')+_0x1fe4ff+_0x92b5('0x37'))['join'](_0xcbc9db,null,_0xcbc9db+_0x92b5('0x11')+_0x1fe4ff+'.'+_0xbc149e)[_0x92b5('0x13')](_0x1fe4ff+_0x92b5('0x3d'),_0x4d411f)['where'](_0x92b5('0x3e'),NOW)[_0x92b5('0x13')](_0x92b5('0x38'),squel['select']()[_0x92b5('0xf')](_0x92b5('0x10'))[_0x92b5('0x46')](_0x92b5('0x3f'))[_0x92b5('0x13')](_0x92b5('0x40'),_0x4d411f)['where'](_0xbc149e+_0x92b5('0x12')+_0x1fe4ff+'.'+_0xbc149e)))[_0x92b5('0x41')]();}function insertCmHopperAdditionalPhones(_0x176efb){var _0x4e9ce2=[_0x92b5('0x47'),_0x92b5('0x48'),_0x92b5('0x49'),_0x92b5('0x4a'),_0x92b5('0x4b')];return squel[_0x92b5('0x2c')]()['into'](_0x92b5('0x4c'))['fromQuery']([_0x92b5('0x4d'),_0x92b5('0x10'),_0x92b5('0x4e'),'createdAt',_0x92b5('0x33')],squel['select']()[_0x92b5('0x35')](_0x4e9ce2)[_0x92b5('0x46')](_0x92b5('0x2e'))[_0x92b5('0x36')](_0x92b5('0x3b'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0x92b5('0x4f'),null,_0x92b5('0x50'))[_0x92b5('0x13')]('cm_hopper.ListId\x20=\x20?',_0x176efb)[_0x92b5('0x13')](_0x92b5('0x3e'),NOW))[_0x92b5('0x41')]();}function insertCmContact(_0x2aec4b,_0x3b32da,_0x1d740b,_0x1dcb7d){var _0x2fec00=_['concat'](_[_0x92b5('0x51')](_0x1dcb7d),[_0x92b5('0x32'),'CompanyId',_0x92b5('0x45'),_0x92b5('0x33')]);return squel[_0x92b5('0x2c')]()[_0x92b5('0x2d')]('cm_contacts')[_0x92b5('0x2f')](_0x2fec00,squel['select']()[_0x92b5('0x35')](_0x2fec00)[_0x92b5('0x46')](_0x3b32da)[_0x92b5('0x13')]('('+_0x1d740b['join'](',')+_0x92b5('0x52'),squel[_0x92b5('0xe')]()['fields'](_0x1d740b)[_0x92b5('0x46')]('cm_contacts')[_0x92b5('0x13')](_0x92b5('0x40'),_0x2aec4b)[_0x92b5('0x13')](_0x92b5('0x53')))['where'](_0x92b5('0x54'),squel[_0x92b5('0xe')]()[_0x92b5('0xf')]('MIN(id)',_0x92b5('0x55'))['from'](_0x3b32da)[_0x92b5('0x56')](_0x1d740b[_0x92b5('0x36')](','))))[_0x92b5('0x41')]();}function handleStop(){logger[_0x92b5('0x57')](_0x92b5('0x58'));stopped=!![];}function handleUncaughtException(_0x317ce0){logger[_0x92b5('0x59')](_0x317ce0[_0x92b5('0x5a')]);process[_0x92b5('0x5b')](0x1);}function handleError(_0x5de7f1,_0x31179a){stats[_0x92b5('0x5c')]['push']({'name':_0x31179a['code'],'message':_0x31179a[_0x92b5('0x5a')],'row':_0x5de7f1});}function handleQuery(_0x207e11){logger[_0x92b5('0x57')](_0x207e11);return db[_0x92b5('0x5d')][_0x92b5('0x5e')](_0x207e11)['spread'](function(_0x8bba93){results[_0x92b5('0x19')](_0x8bba93);})[_0x92b5('0x5f')](function(_0x440853){logger[_0x92b5('0x59')](_0x440853[_0x92b5('0x5a')]);});}function updateTzCampaigns(_0x26bdde){return new Promise(function(_0x5584fd,_0x4ee01a){var _0x1073c8=squel[_0x92b5('0xe')]()[_0x92b5('0x35')](['campaigns.id','campaigns.dialTimezone'])[_0x92b5('0x46')](_0x92b5('0x60'))[_0x92b5('0x36')](_0x92b5('0x61'),null,_0x92b5('0x62'))['where'](_0x92b5('0x63')+_0x26bdde);db[_0x92b5('0x5d')][_0x92b5('0x5e')](_0x1073c8[_0x92b5('0x41')]())[_0x92b5('0x64')](function(_0x53e7ad){var _0x3548ae=[];for(var _0x2882db=0x0;_0x2882db<_0x53e7ad['length'];_0x2882db++){_0x3548ae[_0x92b5('0x19')](getTimezoneData(_0x53e7ad[_0x2882db],tmp_campaigns));}BPromise['all'](_0x3548ae)[_0x92b5('0x17')](function(){_0x5584fd({'val':0x1});});})[_0x92b5('0x5f')](function(_0xc7c293){logger[_0x92b5('0x59')](_0xc7c293[_0x92b5('0x5a')]);_0x5584fd({'val':0x0});});});}function updateTzVoiceQueues(_0x5138ee){return new Promise(function(_0x100cc8,_0x6cc50){var _0x339b9b=squel[_0x92b5('0xe')]()[_0x92b5('0x35')]([_0x92b5('0x65'),_0x92b5('0x66')])[_0x92b5('0x46')]('voice_queues')[_0x92b5('0x36')](_0x92b5('0x67'),null,_0x92b5('0x68'))[_0x92b5('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x5138ee);db[_0x92b5('0x5d')][_0x92b5('0x5e')](_0x339b9b['toString']())['spread'](function(_0x6127f5){var _0x63cb69=[];for(var _0x4d28ea=0x0;_0x4d28ea<_0x6127f5[_0x92b5('0x18')];_0x4d28ea++){_0x63cb69['push'](getTimezoneData(_0x6127f5[_0x4d28ea],tmp_voice_queues));}BPromise[_0x92b5('0x1a')](_0x63cb69)['then'](function(){_0x100cc8({'val':0x1});});})['catch'](function(_0x193ebc){logger['error'](_0x193ebc['message']);_0x100cc8({'val':0x0});});});}function getTimezoneData(_0x37df02,_0x304571){return new Promise(function(_0x27758c,_0x171248){var _0xc57d02=shared[_0x92b5('0x69')];var _0x1b839b=_0xc57d02[_0x37df02[_0x92b5('0x6a')]];if(_[_0x92b5('0x6b')](_0x1b839b)){_0x27758c({'ret':0x1});}else{var _0x5acaa5=_0x1b839b[_0x92b5('0x6c')];var _0x53722f=squel[_0x92b5('0x2c')]()[_0x92b5('0x2d')](_0x304571)['set']('id',_0x37df02['id'])[_0x92b5('0x6d')](_0x92b5('0x6e'),_0x5acaa5)[_0x92b5('0x6d')](_0x92b5('0x6a'),_0x37df02[_0x92b5('0x6a')])[_0x92b5('0x41')]();return db[_0x92b5('0x5d')][_0x92b5('0x5e')](_0x53722f)[_0x92b5('0x64')](function(_0x1ea56a){_0x27758c({'ret':0x1});})[_0x92b5('0x5f')](function(_0x50f90b){logger[_0x92b5('0x59')](_0x50f90b[_0x92b5('0x5a')]);_0x171248({'ret':0x1});});}});}function handleTZQuery(_0x15b0cf){logger[_0x92b5('0x57')](_0x15b0cf);return db[_0x92b5('0x5d')]['query'](_0x15b0cf)[_0x92b5('0x64')](function(_0x556391){})[_0x92b5('0x5f')](function(_0x43bea7){logger['error'](_0x43bea7[_0x92b5('0x5a')]);});}function main(_0x3819da,_0x58e13e,_0x3c7945,_0x6f0690){logger[_0x92b5('0x57')](_0x92b5('0x6f'),_0x3819da,JSON[_0x92b5('0x70')](_0x58e13e));process[_0x92b5('0x71')](_0x92b5('0x72'));var _0xf04dd8=_0x58e13e[_0x92b5('0x73')];var _0x18d083=_[_0x92b5('0x74')](_0xf04dd8);var _0x2d4115=_0x58e13e[_0x92b5('0x75')];var _0x5f2adc=path[_0x92b5('0x36')](config[_0x92b5('0x76')],_0x92b5('0x77'),_0x2d4115+_0x92b5('0x78'));hasTZ=_[_0x92b5('0x51')](_0xf04dd8)[_0x92b5('0x79')](_0x92b5('0x6a'));var _0x1749e2=_[_0x92b5('0x51')](_0xf04dd8)[_0x92b5('0x36')]();logger[_0x92b5('0x57')](_0x92b5('0x7a'),_0x1749e2);db[_0x92b5('0x7b')][_0x92b5('0x16')]({'raw':!![],'attributes':['id',_0x92b5('0x7c')]})[_0x92b5('0x17')](function(_0x402341){for(var _0x53c00e=0x0;_0x53c00e<_0x402341[_0x92b5('0x18')];_0x53c00e++){if(_0x402341[_0x53c00e][_0x92b5('0x7c')]in _0xf04dd8){contactItemTypes[_0x92b5('0x19')](_0x402341[_0x53c00e]);delete _0x18d083[_0x402341[_0x53c00e][_0x92b5('0x7c')]];hasAdditionalPhones=!![];}for(var _0x1fe065 in _0xf04dd8){if(_0x402341[_0x53c00e]['name']+'_description'===_0x1fe065){phoneDescriptions['push']({'itemTypeId':_0x402341[_0x53c00e]['id'],'description':_0x1fe065});delete _0x18d083[_0x1fe065];}}}if(hasAdditionalPhones)_0x18d083[_0x92b5('0x1b')]='';var _0x115e69=_['keys'](_0x18d083)[_0x92b5('0x36')]();logger[_0x92b5('0x57')]('header',_0x115e69);fs[_0x92b5('0x7d')](_0x5f2adc,_0x115e69+'\x0a');Papa[_0x92b5('0x7e')](fs[_0x92b5('0x7f')](_0x3819da),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ad9bc,_0xffdc0b){try{for(var _0x3a5ed0=0x0,_0x2083d9=[];_0x3a5ed0<_0x1ad9bc['data'][_0x92b5('0x18')];_0x3a5ed0++){stats[_0x92b5('0x80')]+=0x1;if(_0x1ad9bc['errors'][_0x3a5ed0]){handleError(_0x1ad9bc[_0x92b5('0x81')][_0x3a5ed0],_0x1ad9bc[_0x92b5('0x5c')][_0x3a5ed0]);}else{var _0x4f590d=[];var _0xf35b96=[];var _0x1df54e={};for(var _0x35c069 in _0xf04dd8){let _0x2c4046=contactItemTypes[_0x92b5('0x82')](_0x1105fe=>_0x1105fe['name']===_0x35c069);let _0x546b2c=contactItemTypes[_0x92b5('0x82')](_0x5c1715=>_0x5c1715[_0x92b5('0x7c')]+_0x92b5('0x83')===_0x35c069);if(_[_0x92b5('0x6b')](_0x2c4046)&&_[_0x92b5('0x6b')](_0x546b2c)){if(_0xf04dd8[_0x92b5('0x84')](_0x35c069)){if(_0x1ad9bc['data'][_0x3a5ed0][_0xf04dd8[_0x35c069]]){var _0x1cd4a6=_[_0x92b5('0x85')](_0x1ad9bc['data'][_0x3a5ed0][_0xf04dd8[_0x35c069]][_0x92b5('0x86')](/"/g,'\x27'));switch(_0x35c069){case _0x92b5('0x30'):var _0x42d38c=moment(_0x1cd4a6,_0x92b5('0xc'),!![]);if(_0x42d38c['isValid']()){_0x2083d9[_0x92b5('0x19')]('\x22'+_0x1cd4a6+'\x22');}else{_0x4f590d[_0x92b5('0x19')](_0x92b5('0x87'));}break;case _0x92b5('0x34'):var _0x20c643=parseInt(_0x1cd4a6);_0x1cd4a6=_[_0x92b5('0x88')](_0x20c643)||_0x20c643<0x0||_0x20c643>0x4?_0x6f0690?0x3:0x2:_0x20c643;_0x2083d9[_0x92b5('0x19')]('\x22'+_0x1cd4a6+'\x22');break;case _0x92b5('0x43'):var _0x35a554=parseInt(_0x1cd4a6);if(_[_0x92b5('0x89')](_0x35a554)&&_[_0x92b5('0x79')](_0x3c7945,_0x35a554)){_0x2083d9[_0x92b5('0x19')]('\x22'+_0x35a554+'\x22');}else{_0x4f590d[_0x92b5('0x19')](_0x92b5('0x8a'));}break;case _0x92b5('0x8b'):if(isEmail(_0x1cd4a6)){_0x2083d9[_0x92b5('0x19')]('\x22'+_0x1cd4a6+'\x22');}else{_0x4f590d[_0x92b5('0x19')](_0x92b5('0x8c'));}break;case _0x92b5('0x8d'):var _0x3628b0=moment(_0x1cd4a6,_0x92b5('0x8e'),!![]);if(_0x3628b0[_0x92b5('0x8f')]()){_0x2083d9['push']('\x22'+_0x1cd4a6+'\x22');}else{_0x4f590d[_0x92b5('0x19')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x92b5('0x6a'):var _0x4987d1=shared[_0x92b5('0x69')];var _0x3577bd=_0x4987d1[_0x1cd4a6];if(!_[_0x92b5('0x6b')](_0x3577bd)){var _0x577265=_0x3577bd[_0x92b5('0x6c')];_0x2083d9[_0x92b5('0x19')]('\x22'+_0x1cd4a6+'\x22');_0x2083d9[_0x92b5('0x19')]('\x22'+_0x577265+'\x22');}break;default:_0x2083d9['push']('\x22'+_0x1cd4a6+'\x22');}}else{switch(_0x35c069){case _0x92b5('0x90'):case _0x92b5('0x10'):_0x4f590d[_0x92b5('0x19')](_0x35c069+'\x20not\x20specified');break;default:_0x2083d9[_0x92b5('0x19')]('\x22\x22');}}}}else{var _0x51d883='';if(!_[_0x92b5('0x6b')](_0x2c4046)){if(!_0x1df54e[_0x92b5('0x84')](_0x2c4046['id'])){if(!_[_0x92b5('0x6b')](_0x1ad9bc[_0x92b5('0x81')][_0x3a5ed0][_0xf04dd8[_0x35c069]])){var _0x1cd4a6=_[_0x92b5('0x85')](_0x1ad9bc[_0x92b5('0x81')][_0x3a5ed0][_0xf04dd8[_0x35c069]][_0x92b5('0x86')](/"/g,'\x27'));var _0x375471=phoneDescriptions['find'](_0x345c39=>_0x345c39['itemTypeId']===_0x2c4046['id']);if(!_[_0x92b5('0x6b')](_0x375471)){var _0x450283=_[_0x92b5('0x85')](_0x1ad9bc['data'][_0x3a5ed0][_0xf04dd8[_0x375471[_0x92b5('0x91')]]][_0x92b5('0x86')](/"/g,'\x27'));if(!_[_0x92b5('0x6b')](_0x450283))_0x1cd4a6=_0x1cd4a6+'§'+_0x450283;}if(_0x51d883=='')_0x51d883=_0x1cd4a6;else _0x51d883+='|'+_0x1cd4a6;}_0xf35b96[_0x92b5('0x19')](_0x2c4046['id']+':'+_0x51d883);_0x1df54e[_0x2c4046['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2083d9[_0x92b5('0x19')]('\x22'+_0xf35b96[_0x92b5('0x36')](';')+'\x22');}if(_0x4f590d[_0x92b5('0x18')]){handleError(_0x1ad9bc['data'][_0x3a5ed0],{'code':_0x92b5('0x92'),'message':_0x4f590d[_0x92b5('0x36')]()});}else{fs[_0x92b5('0x93')](_0x5f2adc,_0x2083d9['join']()+'\x0a');}_0x2083d9=[];}if(!(stats['rows']%0xc8)){socket[_0x92b5('0x94')](_0x92b5('0x95')+_0x2d4115,stats);stats[_0x92b5('0x5c')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0xffdc0b['abort']();}}catch(_0x4783cc){handleError(_0x1ad9bc[_0x92b5('0x81')][_0x3a5ed0],{'code':_0x92b5('0x96'),'message':_0x4783cc[_0x92b5('0x5a')]});logger[_0x92b5('0x59')](_0x92b5('0x97'),_0x4783cc[_0x92b5('0x5a')]);}},'complete':function(){try{var _0x13d902=[];var _0x84de3b=[];var _0x24eab2=_0x92b5('0x3b');if(_0x58e13e[_0x92b5('0x98')]&&_0x58e13e[_0x92b5('0x98')][_0x92b5('0x18')]){_0x24eab2=_0x92b5('0x99')+_0x2d4115;_0x13d902[_0x92b5('0x19')](_0x92b5('0x9a')+_0x24eab2+_0x92b5('0x9b'));}tmp_campaigns=_0x92b5('0x9c')+_0x2d4115;tmp_voice_queues='voice_queues_'+_0x2d4115;_0x84de3b['push'](_0x92b5('0x9a')+tmp_campaigns+_0x92b5('0x9d'));_0x84de3b[_0x92b5('0x19')](_0x92b5('0x9a')+tmp_voice_queues+_0x92b5('0x9d'));BPromise[_0x92b5('0x9e')](_0x84de3b,handleTZQuery)[_0x92b5('0x17')](function(_0x471a04){updateTzCampaigns(_0x58e13e['ListId'])['then'](function(_0x27d8c3){updateTzVoiceQueues(_0x58e13e[_0x92b5('0x32')])[_0x92b5('0x17')](function(_0x2406e4){if(hasTZ)_0x115e69=_0x115e69['replace']('dialTimezone','dialTimezone,utcOffset');var _0x6b4dfe=util[_0x92b5('0xb')](_0x92b5('0x9f'),_0x5f2adc,_0x24eab2,_0x115e69,_0x58e13e['ListId'],_0x58e13e['CompanyId']||null,NOW,NOW);if(_[_0x92b5('0x6b')](_0xf04dd8[_0x92b5('0x30')])){_0x6b4dfe+=',\x20scheduledAt\x20=\x20NOW()';}_0x13d902['push'](_0x6b4dfe);if(_0x58e13e[_0x92b5('0x98')]&&_0x58e13e[_0x92b5('0x98')][_0x92b5('0x18')]){_0x13d902[_0x92b5('0x19')](insertCmContact(_0x58e13e[_0x92b5('0x32')],_0x24eab2,_0x58e13e['duplicates'],_0xf04dd8));_0x13d902[_0x92b5('0x19')]('DROP\x20TABLE\x20'+_0x24eab2+';');}BPromise['each'](_0x13d902,handleQuery)['then'](function(_0x21d386){BPromise[_0x92b5('0x1a')]([handleAdditionalPhones()])[_0x92b5('0x17')](function(){_0x13d902=[];for(var _0x2ce952=0x0;_0x2ce952\x20\x20');}var _0x1d3ad3=path[_0x92b5('0x36')](config[_0x92b5('0x76')],_0x92b5('0x77'),process[_0x92b5('0xab')][0x2]);if(!fs[_0x92b5('0xac')](_0x1d3ad3)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x254719={};try{_0x254719=JSON['parse'](process[_0x92b5('0xab')][0x3]);if(!_0x254719[_0x92b5('0x73')]){throw new Error(_0x92b5('0xad'));}if(!_0x254719[_0x92b5('0x73')][_0x92b5('0x10')]){throw new Error(_0x92b5('0xae'));}if(!_0x254719[_0x92b5('0x73')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x1a38b5=0x0;if(_0x254719[_0x92b5('0x73')]['UserId']){_0x1a38b5=0x1;}if(!_0x254719['ListId']){throw new Error(_0x92b5('0xaf'));}}catch(_0xf2f566){throw new Error(_0x92b5('0xb0'));}var _0x5cb4e3=[];try{_0x5cb4e3=_['map'](JSON[_0x92b5('0x7e')](process[_0x92b5('0xab')][0x4]),'id');}catch(_0x4a9d6b){logger[_0x92b5('0x57')](_0x92b5('0xb1'));}main(_0x1d3ad3,_0x254719,_0x5cb4e3,_0x1a38b5);}validate();process['on'](_0x92b5('0xb2'),handleStop);process['on'](_0x92b5('0xb3'),handleUncaughtException); \ No newline at end of file +var _0xed35=['from','join','.id\x20=\x20','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','length','all','then','split','push','isNil','filter','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','insert','cm_hopper','ContactId','ListId','createdAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','where','cm_contacts.ListId','cm_hopper_black','fromQuery','updatedAt','fields','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','cm_contacts.UserId','into','scheduledat','UserId','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','errors','code','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','main','start','binding','clone','socket_timestamp','root','server/files/tmp','includes','header','ContactItemType','findAll','name','_description','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','timezones','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','duplicates','affectedRows','unlink','exit','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','ioredis','../../../mysqldb','../../../config/environment/shared','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone'];(function(_0x2821d2,_0x5c2205){var _0x1c41b0=function(_0x2a50d4){while(--_0x2a50d4){_0x2821d2['push'](_0x2821d2['shift']());}};_0x1c41b0(++_0x5c2205);}(_0xed35,0xaa));var _0x5ed3=function(_0x119b2,_0x4f9a59){_0x119b2=_0x119b2-0x0;var _0x2cc0b2=_0xed35[_0x119b2];return _0x2cc0b2;};'use strict';var fs=require('fs');var path=require(_0x5ed3('0x0'));var _=require(_0x5ed3('0x1'));var Papa=require('papaparse');var util=require(_0x5ed3('0x2'));var BPromise=require(_0x5ed3('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x5ed3('0x4'));var db=require(_0x5ed3('0x5'))['db'];var config=require('../../../config/environment');var shared=require(_0x5ed3('0x6'));var logger=require('../../../config/logger')('import');config[_0x5ed3('0x7')]=_['defaults'](config[_0x5ed3('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ed3('0x8'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5ed3('0x9')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5ed3('0x9')](_0x5ed3('0xa'));function isEmail(_0x3f1779){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))*$/[_0x5ed3('0xb')](_0x3f1779);}function selectNotIn(_0x2e530c,_0x39f945,_0x452256,_0x60c458,_0x19dcc3){return squel[_0x5ed3('0xc')]()[_0x5ed3('0xd')](_0x5ed3('0xe'))[_0x5ed3('0xf')](_0x60c458)[_0x5ed3('0x10')](_0x39f945,null,_0x39f945+_0x5ed3('0x11')+_0x60c458+'.'+_0x452256)['where'](_0x60c458+'.'+_0x452256+_0x5ed3('0x12')+_0x2e530c+'.'+_0x452256)['where'](_0x39f945+_0x5ed3('0x13')+_0x19dcc3['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x43c519,_0x22d04f){promisesAdditionalPhones=[];return db[_0x5ed3('0x14')]['findAll']({'raw':!![],'attributes':['id',_0x5ed3('0x15')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x70b7b2){if(_0x70b7b2!==null){var _0x3901ea=[];for(var _0x168fb7=0x0;_0x168fb7<_0x70b7b2[_0x5ed3('0x16')];_0x168fb7++){var _0x3ee252=_0x70b7b2[_0x168fb7];_0x3901ea['push'](insertAdditionalPhones(_0x3ee252));}}Promise[_0x5ed3('0x17')](_0x3901ea)[_0x5ed3('0x18')](function(){_0x43c519({'val':0x1});});});});}function insertAdditionalPhones(_0x5cc744){return new Promise(function(_0x28514a,_0x108e54){var _0x22ab37=_0x5cc744[_0x5ed3('0x15')];var _0x25bb86=_0x22ab37[_0x5ed3('0x19')](';');var _0x2e732f=[];orderBy=0x0;for(var _0x634b57=0x0;_0x634b57<_0x25bb86[_0x5ed3('0x16')];_0x634b57++){_0x2e732f[_0x5ed3('0x1a')](splitAdditionalPhone(_0x5cc744['id'],_0x25bb86[_0x634b57]));}Promise[_0x5ed3('0x17')](_0x2e732f)[_0x5ed3('0x18')](function(){_0x28514a({'val':_0x25bb86[_0x5ed3('0x16')]});});});}function splitAdditionalPhone(_0x2d6aad,_0x39ee6f){return new Promise(function(_0x41aa37,_0x3fec94){var _0x4fc41a=_0x39ee6f[_0x5ed3('0x19')](':');var _0x31afc2=_0x4fc41a[0x0];var _0x16b1fb=_0x4fc41a[0x1];if(!_[_0x5ed3('0x1b')](_0x16b1fb)){var _0x5d3b36=_0x16b1fb[_0x5ed3('0x19')]('|');var _0x2660d8=[];for(var _0x368691=0x0;_0x368691<_0x5d3b36[_0x5ed3('0x16')];_0x368691++){if(_0x5d3b36[_0x368691]!==''){var _0xeaf4ce=_[_0x5ed3('0x1c')](promisesAdditionalPhones,{'contactId':_0x2d6aad,'phone':_0x5d3b36[_0x368691]});if(_0xeaf4ce[_0x5ed3('0x16')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2d6aad,'contactTypeId':_0x31afc2,'phone':_0x5d3b36[_0x368691],'orderBy':orderBy});}}}_0x41aa37({'ok':0x1});}else _0x41aa37({'res':0x0});});}function createAdditionalPhone(_0x1ca46b,_0x514656,_0x41a6a2,_0x2e9cfa){var _0x59c0ed='';var _0x194aa3='';var _0x1dfca4=_0x41a6a2[_0x5ed3('0x19')]('§');_0x59c0ed=_0x1dfca4[0x0];if(_0x1dfca4[_0x5ed3('0x16')]==0x2)_0x194aa3=_0x1dfca4[0x1];return new Promise(function(_0x447e4e,_0x2be361){return db['CmContactHasItem'][_0x5ed3('0x1d')]({'where':{'CmContactId':_0x1ca46b,'item':_0x59c0ed}})[_0x5ed3('0x18')](function(_0x3e3d24){if(_0x3e3d24){return db[_0x5ed3('0x1e')][_0x5ed3('0x1f')]({'ItemTypeId':_0x514656,'description':_0x194aa3,'OrderBy':_0x2e9cfa},{'where':{'CmContactId':_0x1ca46b,'item':_0x59c0ed}})[_0x5ed3('0x18')](function(_0x43ecd1){_0x447e4e({'res':_0x5ed3('0x20')});});}else{return db[_0x5ed3('0x1e')][_0x5ed3('0x21')]({'CmContactId':_0x1ca46b,'item':_0x59c0ed,'description':_0x194aa3,'ItemTypeId':_0x514656,'OrderBy':_0x2e9cfa,'ItemClass':_0x5ed3('0x22')})[_0x5ed3('0x18')](function(_0x5d1ad3){_0x447e4e({'res':_0x5ed3('0x23')});});}});});}function insertCmHopper(_0x51385f,_0x2dfec2,_0xcd9f45,_0x5ea714,_0x43caec){var _0x4b5741=[_0x5ed3('0x24'),_0x5ed3('0x25'),_0x5ed3('0x26'),'cm_contacts.ListId',_0x2dfec2+'.'+_0x5ea714,_0x5ed3('0x27'),_0x5ed3('0x28'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x43caec+'\x22'];return squel[_0x5ed3('0x29')]()['into'](_0x5ed3('0x2a'))['fromQuery']([_0x5ed3('0xe'),'scheduledat',_0x5ed3('0x2b'),_0x5ed3('0x2c'),_0x5ea714,_0x5ed3('0x2d'),'updatedAt',_0x5ed3('0x2e'),'UserId',_0x5ed3('0x2f')],squel[_0x5ed3('0xc')]()['fields'](_0x4b5741)[_0x5ed3('0xf')](_0x2dfec2)['join'](_0x5ed3('0x30'),null,_0x5ed3('0x31')+_0x2dfec2+_0x5ed3('0x32'))[_0x5ed3('0x10')](_0xcd9f45,null,_0xcd9f45+_0x5ed3('0x11')+_0x2dfec2+'.'+_0x5ea714)['where'](_0x2dfec2+_0x5ed3('0x33'),_0x51385f)['where'](_0x5ed3('0x34'),NOW)['where'](_0x5ed3('0x35'),selectNotIn(_0x2dfec2,_0xcd9f45,_0x5ea714,_0x5ed3('0x2a'),[_0x5ed3('0x36'),_0x5ed3('0x37')]))[_0x5ed3('0x38')](_0x5ed3('0x35'),selectNotIn(_0x2dfec2,_0xcd9f45,_0x5ea714,'cm_hopper',[_0x5ed3('0x36')])))['toString']();}function insertCmHopperBlack(_0x235325,_0xa992b0,_0xfd85da,_0x2bddf7){var _0x2e619b=['cm_contacts.phone',_0x5ed3('0x26'),_0x5ed3('0x39'),_0xa992b0+'.'+_0x2bddf7,_0x5ed3('0x27'),_0x5ed3('0x28')];return squel[_0x5ed3('0x29')]()['into'](_0x5ed3('0x3a'))[_0x5ed3('0x3b')]([_0x5ed3('0xe'),'ContactId',_0x5ed3('0x2c'),_0x2bddf7,_0x5ed3('0x2d'),_0x5ed3('0x3c')],squel['select']()[_0x5ed3('0x3d')](_0x2e619b)[_0x5ed3('0xf')](_0xa992b0)[_0x5ed3('0x10')](_0x5ed3('0x30'),null,_0x5ed3('0x31')+_0xa992b0+_0x5ed3('0x32'))['join'](_0xfd85da,null,_0xfd85da+_0x5ed3('0x11')+_0xa992b0+'.'+_0x2bddf7)[_0x5ed3('0x38')](_0xa992b0+_0x5ed3('0x33'),_0x235325)[_0x5ed3('0x38')](_0x5ed3('0x34'),NOW)[_0x5ed3('0x38')](_0x5ed3('0x35'),squel['select']()['field'](_0x5ed3('0xe'))[_0x5ed3('0xf')]('cm_hopper_black')['where'](_0x5ed3('0x3e'),_0x235325)[_0x5ed3('0x38')](_0x2bddf7+_0x5ed3('0x12')+_0xa992b0+'.'+_0x2bddf7)))[_0x5ed3('0x3f')]();}function insertTzCmHopper(_0x28aec8,_0x890015,_0x3da067,_0x375997,_0x5ee540,_0x23378b){var _0x147a7d=[_0x5ed3('0x24'),_0x5ed3('0x40')+_0x23378b+_0x5ed3('0x41'),'cm_contacts.id','cm_contacts.ListId',_0x890015+'.'+_0x375997,_0x5ed3('0x27'),'cm_contacts.updatedAt',_0x5ed3('0x42'),_0x5ed3('0x43'),'\x22'+_0x5ee540+'\x22'];var _0x122fce=squel['insert']()[_0x5ed3('0x44')](_0x5ed3('0x2a'))['fromQuery']([_0x5ed3('0xe'),_0x5ed3('0x45'),_0x5ed3('0x2b'),_0x5ed3('0x2c'),_0x375997,_0x5ed3('0x2d'),_0x5ed3('0x3c'),'priority',_0x5ed3('0x46'),_0x5ed3('0x2f')],squel[_0x5ed3('0xc')]()[_0x5ed3('0x3d')](_0x147a7d)[_0x5ed3('0xf')](_0x890015)[_0x5ed3('0x10')](_0x5ed3('0x30'),null,_0x5ed3('0x31')+_0x890015+'.CmListId')[_0x5ed3('0x10')](_0x3da067,null,_0x3da067+_0x5ed3('0x11')+_0x890015+'.'+_0x375997)['join'](_0x23378b,null,_0x23378b+_0x5ed3('0x11')+_0x890015+'.'+_0x375997)[_0x5ed3('0x38')](_0x890015+_0x5ed3('0x33'),_0x28aec8)[_0x5ed3('0x38')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5ed3('0x38')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x890015,_0x3da067,_0x375997,_0x5ed3('0x2a'),[_0x5ed3('0x36'),_0x5ed3('0x37')]))[_0x5ed3('0x38')](_0x5ed3('0x35'),selectNotIn(_0x890015,_0x3da067,_0x375997,_0x5ed3('0x2a'),[_0x5ed3('0x36')])))[_0x5ed3('0x3f')]();return _0x122fce;}function insertTzCmHopperBlack(_0x14ce6c,_0x36300b,_0x22cec4,_0x1545f1){var _0x383830=[_0x5ed3('0x24'),'cm_contacts.id',_0x5ed3('0x39'),_0x36300b+'.'+_0x1545f1,_0x5ed3('0x27'),_0x5ed3('0x28')];return squel[_0x5ed3('0x29')]()[_0x5ed3('0x44')]('cm_hopper_black')['fromQuery']([_0x5ed3('0xe'),'ContactId',_0x5ed3('0x2c'),_0x1545f1,_0x5ed3('0x2d'),_0x5ed3('0x3c')],squel['select']()[_0x5ed3('0x3d')](_0x383830)[_0x5ed3('0xf')](_0x36300b)[_0x5ed3('0x10')](_0x5ed3('0x30'),null,_0x5ed3('0x31')+_0x36300b+_0x5ed3('0x32'))[_0x5ed3('0x10')](_0x22cec4,null,_0x22cec4+_0x5ed3('0x11')+_0x36300b+'.'+_0x1545f1)['where'](_0x36300b+_0x5ed3('0x33'),_0x14ce6c)['where'](_0x5ed3('0x34'),NOW)[_0x5ed3('0x38')](_0x5ed3('0x35'),squel[_0x5ed3('0xc')]()[_0x5ed3('0xd')](_0x5ed3('0xe'))[_0x5ed3('0xf')](_0x5ed3('0x3a'))[_0x5ed3('0x38')](_0x5ed3('0x3e'),_0x14ce6c)['where'](_0x1545f1+_0x5ed3('0x12')+_0x36300b+'.'+_0x1545f1)))[_0x5ed3('0x3f')]();}function insertCmHopperAdditionalPhones(_0x2df691){var _0x20a4ab=[_0x5ed3('0x47'),_0x5ed3('0x48'),_0x5ed3('0x49'),'cm_contact_has_items.createdAt',_0x5ed3('0x4a')];return squel['insert']()['into'](_0x5ed3('0x4b'))[_0x5ed3('0x3b')]([_0x5ed3('0x4c'),_0x5ed3('0xe'),_0x5ed3('0x4d'),_0x5ed3('0x2d'),'updatedAt'],squel['select']()[_0x5ed3('0x3d')](_0x20a4ab)['from'](_0x5ed3('0x2a'))['join'](_0x5ed3('0x30'),null,_0x5ed3('0x4e'))[_0x5ed3('0x10')]('cm_contact_has_items',null,_0x5ed3('0x4f'))['where']('cm_hopper.ListId\x20=\x20?',_0x2df691)[_0x5ed3('0x38')](_0x5ed3('0x34'),NOW))['toString']();}function insertCmContact(_0x32add0,_0xbe7208,_0x115291,_0xc4d6f){var _0x316f53=_['concat'](_[_0x5ed3('0x50')](_0xc4d6f),['ListId',_0x5ed3('0x51'),_0x5ed3('0x2d'),_0x5ed3('0x3c')]);return squel['insert']()['into'](_0x5ed3('0x30'))[_0x5ed3('0x3b')](_0x316f53,squel[_0x5ed3('0xc')]()[_0x5ed3('0x3d')](_0x316f53)[_0x5ed3('0xf')](_0xbe7208)['where']('('+_0x115291[_0x5ed3('0x10')](',')+_0x5ed3('0x52'),squel[_0x5ed3('0xc')]()[_0x5ed3('0x3d')](_0x115291)[_0x5ed3('0xf')](_0x5ed3('0x30'))['where'](_0x5ed3('0x3e'),_0x32add0)[_0x5ed3('0x38')](_0x5ed3('0x53')))[_0x5ed3('0x38')](_0x5ed3('0x54'),squel[_0x5ed3('0xc')]()[_0x5ed3('0xd')](_0x5ed3('0x55'),'min_id')[_0x5ed3('0xf')](_0xbe7208)[_0x5ed3('0x56')](_0x115291[_0x5ed3('0x10')](','))))[_0x5ed3('0x3f')]();}function handleStop(){logger[_0x5ed3('0x57')](_0x5ed3('0x58'));stopped=!![];}function handleUncaughtException(_0x5f10b4){logger[_0x5ed3('0x59')](_0x5f10b4[_0x5ed3('0x5a')]);process['exit'](0x1);}function handleError(_0x5576bd,_0x1a6c84){stats[_0x5ed3('0x5b')]['push']({'name':_0x1a6c84[_0x5ed3('0x5c')],'message':_0x1a6c84['message'],'row':_0x5576bd});}function handleQuery(_0x46d64a){logger[_0x5ed3('0x57')](_0x46d64a);return db['sequelize'][_0x5ed3('0x5d')](_0x46d64a)[_0x5ed3('0x5e')](function(_0x5a54b5){results[_0x5ed3('0x1a')](_0x5a54b5);})[_0x5ed3('0x5f')](function(_0x4a9b8a){logger[_0x5ed3('0x59')](_0x4a9b8a[_0x5ed3('0x5a')]);});}function updateTzCampaigns(_0x557244){return new Promise(function(_0xee1a2f,_0x198568){var _0x325ffe=squel[_0x5ed3('0xc')]()[_0x5ed3('0x3d')]([_0x5ed3('0x60'),_0x5ed3('0x61')])[_0x5ed3('0xf')](_0x5ed3('0x62'))[_0x5ed3('0x10')](_0x5ed3('0x63'),null,_0x5ed3('0x64'))[_0x5ed3('0x38')]('campaigns_has_cm_lists.CmListId='+_0x557244);db[_0x5ed3('0x65')][_0x5ed3('0x5d')](_0x325ffe[_0x5ed3('0x3f')]())[_0x5ed3('0x5e')](function(_0x1f514d){var _0x5c9a6e=[];for(var _0x1b0131=0x0;_0x1b0131<_0x1f514d[_0x5ed3('0x16')];_0x1b0131++){_0x5c9a6e[_0x5ed3('0x1a')](getTimezoneData(_0x1f514d[_0x1b0131],tmp_campaigns));}BPromise[_0x5ed3('0x17')](_0x5c9a6e)['then'](function(){_0xee1a2f({'val':0x1});});})[_0x5ed3('0x5f')](function(_0x35fc3b){logger[_0x5ed3('0x59')](_0x35fc3b['message']);_0xee1a2f({'val':0x0});});});}function updateTzVoiceQueues(_0x11e2ce){return new Promise(function(_0x134787,_0x36f9ff){var _0xc614d6=squel['select']()[_0x5ed3('0x3d')]([_0x5ed3('0x66'),_0x5ed3('0x67')])[_0x5ed3('0xf')]('voice_queues')['join'](_0x5ed3('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x5ed3('0x38')](_0x5ed3('0x69')+_0x11e2ce);db['sequelize']['query'](_0xc614d6[_0x5ed3('0x3f')]())[_0x5ed3('0x5e')](function(_0x2b8d04){var _0x3dde02=[];for(var _0x1f87ee=0x0;_0x1f87ee<_0x2b8d04[_0x5ed3('0x16')];_0x1f87ee++){_0x3dde02[_0x5ed3('0x1a')](getTimezoneData(_0x2b8d04[_0x1f87ee],tmp_voice_queues));}BPromise['all'](_0x3dde02)[_0x5ed3('0x18')](function(){_0x134787({'val':0x1});});})[_0x5ed3('0x5f')](function(_0x3b6f88){logger[_0x5ed3('0x59')](_0x3b6f88[_0x5ed3('0x5a')]);_0x134787({'val':0x0});});});}function getTimezoneData(_0x46dfa0,_0x886750){return new Promise(function(_0x45e016,_0x16cd63){var _0x4fb49c=shared['timezones'];var _0x30cb87=_0x4fb49c[_0x46dfa0[_0x5ed3('0x6a')]];if(_['isNil'](_0x30cb87)){_0x45e016({'ret':0x1});}else{var _0x2481a8=_0x30cb87[_0x5ed3('0x6b')];var _0x1b5657=squel['insert']()['into'](_0x886750)[_0x5ed3('0x6c')]('id',_0x46dfa0['id'])['set'](_0x5ed3('0x6d'),_0x2481a8)['set'](_0x5ed3('0x6a'),_0x46dfa0['dialTimezone'])[_0x5ed3('0x3f')]();return db['sequelize'][_0x5ed3('0x5d')](_0x1b5657)[_0x5ed3('0x5e')](function(_0x1aefcb){_0x45e016({'ret':0x1});})['catch'](function(_0x589e86){logger[_0x5ed3('0x59')](_0x589e86[_0x5ed3('0x5a')]);_0x16cd63({'ret':0x1});});}});}function handleTZQuery(_0x1b1133){logger[_0x5ed3('0x57')](_0x1b1133);return db[_0x5ed3('0x65')][_0x5ed3('0x5d')](_0x1b1133)[_0x5ed3('0x5e')](function(_0x45a8cc){})[_0x5ed3('0x5f')](function(_0x5e4910){logger[_0x5ed3('0x59')](_0x5e4910[_0x5ed3('0x5a')]);});}function main(_0x108827,_0x5448bb,_0x12e38c,_0x4a8c73){logger[_0x5ed3('0x57')](_0x5ed3('0x6e'),_0x108827,JSON['stringify'](_0x5448bb));process['send'](_0x5ed3('0x6f'));var _0x417111=_0x5448bb[_0x5ed3('0x70')];var _0x41ea4d=_[_0x5ed3('0x71')](_0x417111);var _0x1fde68=_0x5448bb[_0x5ed3('0x72')];var _0x378318=path[_0x5ed3('0x10')](config[_0x5ed3('0x73')],_0x5ed3('0x74'),_0x1fde68+'.csv');hasTZ=_[_0x5ed3('0x50')](_0x417111)[_0x5ed3('0x75')]('dialTimezone');var _0x2bbe21=_[_0x5ed3('0x50')](_0x417111)[_0x5ed3('0x10')]();logger[_0x5ed3('0x57')](_0x5ed3('0x76'),_0x2bbe21);db[_0x5ed3('0x77')][_0x5ed3('0x78')]({'raw':!![],'attributes':['id','name']})[_0x5ed3('0x18')](function(_0x3c2a0c){for(var _0x29f1db=0x0;_0x29f1db<_0x3c2a0c[_0x5ed3('0x16')];_0x29f1db++){if(_0x3c2a0c[_0x29f1db][_0x5ed3('0x79')]in _0x417111){contactItemTypes[_0x5ed3('0x1a')](_0x3c2a0c[_0x29f1db]);delete _0x41ea4d[_0x3c2a0c[_0x29f1db][_0x5ed3('0x79')]];hasAdditionalPhones=!![];}for(var _0x4d7942 in _0x417111){if(_0x3c2a0c[_0x29f1db][_0x5ed3('0x79')]+_0x5ed3('0x7a')===_0x4d7942){phoneDescriptions['push']({'itemTypeId':_0x3c2a0c[_0x29f1db]['id'],'description':_0x4d7942});delete _0x41ea4d[_0x4d7942];}}}if(hasAdditionalPhones)_0x41ea4d[_0x5ed3('0x15')]='';var _0x39818a=_[_0x5ed3('0x50')](_0x41ea4d)['join']();logger[_0x5ed3('0x57')](_0x5ed3('0x76'),_0x39818a);fs['writeFileSync'](_0x378318,_0x39818a+'\x0a');Papa[_0x5ed3('0x7b')](fs[_0x5ed3('0x7c')](_0x108827),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c3aba,_0x3d36c3){try{for(var _0x58fe6b=0x0,_0x8fd71e=[];_0x58fe6b<_0x3c3aba[_0x5ed3('0x7d')][_0x5ed3('0x16')];_0x58fe6b++){stats[_0x5ed3('0x7e')]+=0x1;if(_0x3c3aba[_0x5ed3('0x5b')][_0x58fe6b]){handleError(_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b],_0x3c3aba[_0x5ed3('0x5b')][_0x58fe6b]);}else{var _0xb215a0=[];var _0x4c713d=[];var _0xaa5633={};for(var _0xe8b2a in _0x417111){let _0x15a9c4=contactItemTypes[_0x5ed3('0x7f')](_0x1936cb=>_0x1936cb[_0x5ed3('0x79')]===_0xe8b2a);let _0x40bb83=contactItemTypes[_0x5ed3('0x7f')](_0x3c200a=>_0x3c200a['name']+_0x5ed3('0x7a')===_0xe8b2a);if(_[_0x5ed3('0x1b')](_0x15a9c4)&&_[_0x5ed3('0x1b')](_0x40bb83)){if(_0x417111[_0x5ed3('0x80')](_0xe8b2a)){if(_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b][_0x417111[_0xe8b2a]]){var _0x176ead=_[_0x5ed3('0x81')](_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b][_0x417111[_0xe8b2a]][_0x5ed3('0x82')](/"/g,'\x27'));switch(_0xe8b2a){case _0x5ed3('0x45'):var _0x448226=moment(_0x176ead,_0x5ed3('0xa'),!![]);if(_0x448226[_0x5ed3('0x83')]()){_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x176ead+'\x22');}else{_0xb215a0['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x5ed3('0x2e'):var _0x367440=parseInt(_0x176ead);_0x176ead=_[_0x5ed3('0x84')](_0x367440)||_0x367440<0x0||_0x367440>0x4?_0x4a8c73?0x3:0x2:_0x367440;_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x176ead+'\x22');break;case _0x5ed3('0x46'):var _0x5b770b=parseInt(_0x176ead);if(_[_0x5ed3('0x85')](_0x5b770b)&&_[_0x5ed3('0x75')](_0x12e38c,_0x5b770b)){_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x5b770b+'\x22');}else{_0xb215a0[_0x5ed3('0x1a')](_0x5ed3('0x86'));}break;case _0x5ed3('0x87'):if(isEmail(_0x176ead)){_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x176ead+'\x22');}else{_0xb215a0[_0x5ed3('0x1a')]('email\x20wrong\x20format');}break;case _0x5ed3('0x88'):var _0x19d37f=moment(_0x176ead,_0x5ed3('0x89'),!![]);if(_0x19d37f[_0x5ed3('0x83')]()){_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x176ead+'\x22');}else{_0xb215a0[_0x5ed3('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x5ed3('0x6a'):var _0x6021e3=shared[_0x5ed3('0x8a')];var _0x8edaa5=_0x6021e3[_0x176ead];if(!_[_0x5ed3('0x1b')](_0x8edaa5)){var _0x4bdba1=_0x8edaa5[_0x5ed3('0x6b')];_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x176ead+'\x22');_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x4bdba1+'\x22');}break;default:_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x176ead+'\x22');}}else{switch(_0xe8b2a){case _0x5ed3('0x8b'):case _0x5ed3('0xe'):_0xb215a0[_0x5ed3('0x1a')](_0xe8b2a+_0x5ed3('0x8c'));break;default:_0x8fd71e[_0x5ed3('0x1a')]('\x22\x22');}}}}else{var _0x459a54='';if(!_['isNil'](_0x15a9c4)){if(!_0xaa5633[_0x5ed3('0x80')](_0x15a9c4['id'])){if(!_['isNil'](_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b][_0x417111[_0xe8b2a]])){var _0x176ead=_[_0x5ed3('0x81')](_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b][_0x417111[_0xe8b2a]][_0x5ed3('0x82')](/"/g,'\x27'));var _0x1f3985=phoneDescriptions[_0x5ed3('0x7f')](_0x53a37a=>_0x53a37a[_0x5ed3('0x8d')]===_0x15a9c4['id']);if(!_[_0x5ed3('0x1b')](_0x1f3985)){var _0x37982d=_[_0x5ed3('0x81')](_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b][_0x417111[_0x1f3985[_0x5ed3('0x8e')]]]['replace'](/"/g,'\x27'));if(!_[_0x5ed3('0x1b')](_0x37982d))_0x176ead=_0x176ead+'§'+_0x37982d;}if(_0x459a54=='')_0x459a54=_0x176ead;else _0x459a54+='|'+_0x176ead;}_0x4c713d['push'](_0x15a9c4['id']+':'+_0x459a54);_0xaa5633[_0x15a9c4['id']]=0x1;}}}}if(hasAdditionalPhones){_0x8fd71e[_0x5ed3('0x1a')]('\x22'+_0x4c713d[_0x5ed3('0x10')](';')+'\x22');}if(_0xb215a0['length']){handleError(_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b],{'code':_0x5ed3('0x8f'),'message':_0xb215a0[_0x5ed3('0x10')]()});}else{fs[_0x5ed3('0x90')](_0x378318,_0x8fd71e[_0x5ed3('0x10')]()+'\x0a');}_0x8fd71e=[];}if(!(stats[_0x5ed3('0x7e')]%0xc8)){socket[_0x5ed3('0x91')](_0x5ed3('0x92')+_0x1fde68,stats);stats[_0x5ed3('0x5b')]=[];}}if(stopped){logger['info'](_0x5ed3('0x93'));_0x3d36c3[_0x5ed3('0x94')]();}}catch(_0x5ef009){handleError(_0x3c3aba[_0x5ed3('0x7d')][_0x58fe6b],{'code':_0x5ed3('0x95'),'message':_0x5ef009['message']});logger[_0x5ed3('0x59')](_0x5ed3('0x96'),_0x5ef009[_0x5ed3('0x5a')]);}},'complete':function(){try{var _0x25ed0f=[];var _0x3f4a31=[];var _0x46cda1=_0x5ed3('0x30');if(_0x5448bb['duplicates']&&_0x5448bb['duplicates'][_0x5ed3('0x16')]){_0x46cda1=_0x5ed3('0x97')+_0x1fde68;_0x25ed0f['push'](_0x5ed3('0x98')+_0x46cda1+_0x5ed3('0x99'));}tmp_campaigns=_0x5ed3('0x9a')+_0x1fde68;tmp_voice_queues=_0x5ed3('0x9b')+_0x1fde68;_0x3f4a31[_0x5ed3('0x1a')](_0x5ed3('0x98')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3f4a31[_0x5ed3('0x1a')](_0x5ed3('0x98')+tmp_voice_queues+_0x5ed3('0x9c'));BPromise[_0x5ed3('0x9d')](_0x3f4a31,handleTZQuery)[_0x5ed3('0x18')](function(_0x2be5ec){updateTzCampaigns(_0x5448bb[_0x5ed3('0x2c')])['then'](function(_0x4797ec){updateTzVoiceQueues(_0x5448bb[_0x5ed3('0x2c')])[_0x5ed3('0x18')](function(_0x134d1e){if(hasTZ)_0x39818a=_0x39818a['replace']('dialTimezone',_0x5ed3('0x9e'));var _0x3d6f3c=util[_0x5ed3('0x9')]('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',_0x378318,_0x46cda1,_0x39818a,_0x5448bb['ListId'],_0x5448bb[_0x5ed3('0x51')]||null,NOW,NOW);if(_['isNil'](_0x417111[_0x5ed3('0x45')])){_0x3d6f3c+=_0x5ed3('0x9f');}_0x25ed0f[_0x5ed3('0x1a')](_0x3d6f3c);if(_0x5448bb['duplicates']&&_0x5448bb['duplicates'][_0x5ed3('0x16')]){_0x25ed0f['push'](insertCmContact(_0x5448bb[_0x5ed3('0x2c')],_0x46cda1,_0x5448bb['duplicates'],_0x417111));_0x25ed0f[_0x5ed3('0x1a')](_0x5ed3('0xa0')+_0x46cda1+';');}BPromise['each'](_0x25ed0f,handleQuery)[_0x5ed3('0x18')](function(_0x38a2e7){BPromise[_0x5ed3('0x17')]([handleAdditionalPhones()])[_0x5ed3('0x18')](function(){_0x25ed0f=[];for(var _0x5bc39c=0x0;_0x5bc39c\x20\x20','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash'];(function(_0x15fa1e,_0x181d83){var _0x57d74e=function(_0x368501){while(--_0x368501){_0x15fa1e['push'](_0x15fa1e['shift']());}};_0x57d74e(++_0x181d83);}(_0xce2e,0x1d8));var _0xece2=function(_0x4f020a,_0x35332a){_0x4f020a=_0x4f020a-0x0;var _0x50fc71=_0xce2e[_0x4f020a];return _0x50fc71;};'use strict';var fs=require('fs');var path=require(_0xece2('0x0'));var _=require(_0xece2('0x1'));var Papa=require(_0xece2('0x2'));var util=require(_0xece2('0x3'));var BPromise=require(_0xece2('0x4'));var moment=require(_0xece2('0x5'));var squel=require(_0xece2('0x6'));var Redis=require('ioredis');var db=require(_0xece2('0x7'))['db'];var config=require(_0xece2('0x8'));var logger=require(_0xece2('0x9'))(_0xece2('0xa'));config['redis']=_['defaults'](config[_0xece2('0xb')],{'host':_0xece2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xece2('0xd')](_0xece2('0xe'));var tempTableName=_0xece2('0xf')+moment()['format'](_0xece2('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x590f78){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x590f78);}function selectNotIn(_0x11c133,_0x34e72c,_0x5ea2d6,_0x229d2f,_0x333afa){return squel[_0xece2('0x11')]()['field']('phone')[_0xece2('0x12')](_0x229d2f)[_0xece2('0x13')](_0x34e72c,null,_0x34e72c+_0xece2('0x14')+_0x229d2f+'.'+_0x5ea2d6)[_0xece2('0x15')](_0x229d2f+'.'+_0x5ea2d6+'\x20=\x20'+_0x11c133+'.'+_0x5ea2d6)['where'](_0x34e72c+'.dialCheckDuplicateType\x20IN\x20('+_0x333afa[_0xece2('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xa6adef,_0x1350c8){promisesAdditionalPhones=[];promisesContact=[];return db[_0xece2('0x16')][_0xece2('0x17')]('select\x20*\x20from\x20'+tempTableName)[_0xece2('0x18')](function(_0x3f5874){if(_0x3f5874!==null){var _0x2e3ae8=[];for(var _0xe53a6=0x0;_0xe53a6<_0x3f5874[_0xece2('0x19')];_0xe53a6++){var _0x414359=_0x3f5874[_0xe53a6];if(!_['isNil'](_0x414359[_0xece2('0x1a')])){if(!_[_0xece2('0x1b')](_0x414359[_0xece2('0x1c')]))_0x2e3ae8[_0xece2('0x1d')](insertAdditionalPhones(_0x414359));promisesContact[_0xece2('0x1d')]({'contact':_0x414359});}}}Promise[_0xece2('0x1e')](_0x2e3ae8)[_0xece2('0x1f')](function(){_0xa6adef({'val':0x1});});})[_0xece2('0x20')](function(_0x41c7eb){logger[_0xece2('0x21')](_0x41c7eb[_0xece2('0x22')]);});});}function insertAdditionalPhones(_0x2eebe2){return new Promise(function(_0x235ae0,_0x1c2a67){var _0x2c2ed7=_0x2eebe2[_0xece2('0x1c')];if(_[_0xece2('0x1b')](_0x2c2ed7))_0x1c2a67({'val':0x0});else{var _0x5438b3=_0x2c2ed7['split'](';');var _0x27c58f=[];orderBy=0x0;for(var _0x2cdc3b=0x0;_0x2cdc3b<_0x5438b3[_0xece2('0x19')];_0x2cdc3b++){_0x27c58f[_0xece2('0x1d')](splitAdditionalPhone(_0x2eebe2['id'],_0x5438b3[_0x2cdc3b]));}Promise[_0xece2('0x1e')](_0x27c58f)[_0xece2('0x1f')](function(){_0x235ae0({'val':_0x5438b3[_0xece2('0x19')]});});}});}function splitAdditionalPhone(_0x36a099,_0x57a693){return new Promise(function(_0x4ed2f7,_0x2af4b7){var _0x398549=_0x57a693['split'](':');var _0x24b3d5=_0x398549[0x0];var _0x4751e1=_0x398549[0x1];if(_0x4751e1!==''){var _0x5db5af=_0x4751e1[_0xece2('0x23')]('|');var _0xb236a2=[];for(var _0x26756f=0x0;_0x26756f<_0x5db5af['length'];_0x26756f++){if(_0x5db5af[_0x26756f]!==''){var _0x4f0409=_[_0xece2('0x24')](promisesAdditionalPhones,{'contactId':_0x36a099,'phone':_0x5db5af[_0x26756f]});if(_0x4f0409['length']==0x0){orderBy++;promisesAdditionalPhones[_0xece2('0x1d')]({'contactId':_0x36a099,'contactTypeId':_0x24b3d5,'phone':_0x5db5af[_0x26756f],'orderBy':orderBy});}}}_0x4ed2f7({'ok':0x1});}else _0x4ed2f7({'res':0x0});});}function createAdditionalPhone(_0x1bd740,_0x68570d,_0x57650d,_0x258874){var _0x2151a2='';var _0x5eaaae='';var _0x1a88c7=_0x57650d['split']('§');_0x2151a2=_0x1a88c7[0x0];if(_0x1a88c7[_0xece2('0x19')]==0x2)_0x5eaaae=_0x1a88c7[0x1];return new Promise(function(_0x2f32a2,_0x23c850){return db['CmContactHasItem'][_0xece2('0x25')]({'where':{'CmContactId':_0x1bd740,'item':_0x2151a2}})[_0xece2('0x1f')](function(_0x40ec57){if(_0x40ec57){return db[_0xece2('0x26')][_0xece2('0x27')]({'ItemTypeId':_0x68570d,'description':_0x5eaaae,'OrderBy':_0x258874},{'where':{'CmContactId':_0x1bd740,'item':_0x2151a2}})[_0xece2('0x1f')](function(_0x4c608a){_0x2f32a2({'res':_0xece2('0x28')});});}else{return db[_0xece2('0x26')]['create']({'CmContactId':_0x1bd740,'item':_0x2151a2,'ItemTypeId':_0x68570d,'description':_0x5eaaae,'OrderBy':_0x258874,'ItemClass':_0xece2('0x29')})[_0xece2('0x1f')](function(_0x532ae5){_0x2f32a2({'res':_0xece2('0x2a')});});}});});}function updateContact(_0xdc2036){return new Promise(function(_0x2f9adf,_0xcde6a8){var _0x3720ef=_0xdc2036['id'];delete _0xdc2036['id'];return db[_0xece2('0x2b')][_0xece2('0x27')](_0xdc2036,{'where':{'id':_0x3720ef}})['then'](function(_0x3e4e0a){updatedRows+=0x1;return db[_0xece2('0x2c')][_0xece2('0x27')]({'phone':_0xdc2036[_0xece2('0x1a')]},{'where':{'ContactId':_0x3720ef}})['then'](function(_0xa421a4){_0x2f9adf({'ret':'OK'});});});});}function insertCmHopper(_0x4594d2,_0xbb20d4,_0x5a92d0,_0x5da6f5,_0x22dd8c){var _0x1992df=['cm_contacts.phone',_0xece2('0x2d'),'cm_contacts.id',_0xece2('0x2e'),_0xbb20d4+'.'+_0x5da6f5,'cm_contacts.createdAt',_0xece2('0x2f'),'cm_contacts.priority',_0xece2('0x30'),'\x22'+_0x22dd8c+'\x22'];return squel[_0xece2('0x31')]()[_0xece2('0x32')](_0xece2('0x33'))[_0xece2('0x34')]([_0xece2('0x1a'),_0xece2('0x35'),_0xece2('0x36'),_0xece2('0x37'),_0x5da6f5,_0xece2('0x38'),_0xece2('0x39'),_0xece2('0x3a'),_0xece2('0x3b'),'recallme'],squel[_0xece2('0x11')]()[_0xece2('0x3c')](_0x1992df)[_0xece2('0x12')](_0xbb20d4)['join']('cm_contacts',null,_0xece2('0x3d')+_0xbb20d4+'.CmListId')[_0xece2('0x13')](_0x5a92d0,null,_0x5a92d0+_0xece2('0x14')+_0xbb20d4+'.'+_0x5da6f5)[_0xece2('0x15')](_0xbb20d4+_0xece2('0x3e'),_0x4594d2)[_0xece2('0x15')](_0xece2('0x3f'),NOW)[_0xece2('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xbb20d4,_0x5a92d0,_0x5da6f5,'cm_hopper',[_0xece2('0x40'),_0xece2('0x41')]))[_0xece2('0x15')](_0xece2('0x42'),selectNotIn(_0xbb20d4,_0x5a92d0,_0x5da6f5,'cm_hopper',[_0xece2('0x40')])))[_0xece2('0x43')]();}function insertCmHopperBlack(_0xbd84dd,_0x2007a3,_0x1ef602,_0x219b4f){var _0x3e8e30=['cm_contacts.phone',_0xece2('0x44'),_0xece2('0x2e'),_0x2007a3+'.'+_0x219b4f,_0xece2('0x45'),_0xece2('0x2f')];return squel[_0xece2('0x31')]()[_0xece2('0x32')](_0xece2('0x46'))['fromQuery']([_0xece2('0x1a'),_0xece2('0x36'),_0xece2('0x37'),_0x219b4f,_0xece2('0x38'),_0xece2('0x39')],squel[_0xece2('0x11')]()[_0xece2('0x3c')](_0x3e8e30)[_0xece2('0x12')](_0x2007a3)[_0xece2('0x13')](_0xece2('0x47'),null,_0xece2('0x3d')+_0x2007a3+_0xece2('0x48'))[_0xece2('0x13')](_0x1ef602,null,_0x1ef602+'.id\x20=\x20'+_0x2007a3+'.'+_0x219b4f)[_0xece2('0x15')](_0x2007a3+'.CmListId\x20=\x20?',_0xbd84dd)[_0xece2('0x15')](_0xece2('0x3f'),NOW)[_0xece2('0x15')](_0xece2('0x42'),squel[_0xece2('0x11')]()[_0xece2('0x49')](_0xece2('0x1a'))[_0xece2('0x12')](_0xece2('0x46'))['where']('ListId\x20=\x20?',_0xbd84dd)[_0xece2('0x15')](_0x219b4f+_0xece2('0x4a'),_0x2007a3+'.'+_0x219b4f)))[_0xece2('0x43')]();}function insertCmHopperAdditionalPhones(_0x20d1cc){var _0x3d11d1=[_0xece2('0x4b'),_0xece2('0x4c'),_0xece2('0x4d'),_0xece2('0x4e'),_0xece2('0x4f')];return squel['insert']()[_0xece2('0x32')](_0xece2('0x50'))['fromQuery']([_0xece2('0x51'),_0xece2('0x1a'),_0xece2('0x52'),_0xece2('0x38'),_0xece2('0x39')],squel[_0xece2('0x11')]()['fields'](_0x3d11d1)['from'](_0xece2('0x33'))['join'](_0xece2('0x47'),null,_0xece2('0x53'))[_0xece2('0x13')](_0xece2('0x54'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xece2('0x15')](_0xece2('0x55'),_0x20d1cc)[_0xece2('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xece2('0x43')]();}function insertCmContact(_0x522e9a,_0x44d472,_0x59fcd5,_0x446891){var _0x12b06d=_['concat'](_[_0xece2('0x56')](_0x446891),[_0xece2('0x37'),'CompanyId',_0xece2('0x38'),_0xece2('0x39')]);return squel[_0xece2('0x31')]()[_0xece2('0x32')](_0xece2('0x47'))[_0xece2('0x34')](_0x12b06d,squel['select']()['fields'](_0x12b06d)[_0xece2('0x12')](_0x44d472)[_0xece2('0x15')]('('+_0x59fcd5[_0xece2('0x13')](',')+_0xece2('0x57'),squel[_0xece2('0x11')]()[_0xece2('0x3c')](_0x59fcd5)[_0xece2('0x12')](_0xece2('0x47'))['where'](_0xece2('0x58'),_0x522e9a))[_0xece2('0x15')](_0xece2('0x59'),squel['select']()['field'](_0xece2('0x5a'),_0xece2('0x5b'))[_0xece2('0x12')](_0x44d472)['group'](_0x59fcd5['join'](','))))[_0xece2('0x43')]();}function handleStop(){logger[_0xece2('0x5c')](_0xece2('0x5d'));stopped=!![];}function handleUncaughtException(_0x27290d){logger[_0xece2('0x21')](_0x27290d[_0xece2('0x22')]);process[_0xece2('0x5e')](0x1);}function handleError(_0x2976fd,_0xc1f4c1){stats[_0xece2('0x5f')][_0xece2('0x1d')]({'name':_0xc1f4c1['code'],'message':_0xc1f4c1[_0xece2('0x22')],'row':_0x2976fd});}function handleQuery(_0x50069a){logger[_0xece2('0x5c')](_0x50069a);return db[_0xece2('0x16')]['query'](_0x50069a)['spread'](function(_0x1eb02f){results[_0xece2('0x1d')](_0x1eb02f);})[_0xece2('0x20')](function(_0x1bf7ba){logger[_0xece2('0x21')](_0x1bf7ba[_0xece2('0x22')]);});}function main(_0x6eb976,_0x27ac0f,_0x2a5bd0,_0x45729a){logger[_0xece2('0x5c')](_0xece2('0x60'),_0x6eb976,JSON[_0xece2('0x61')](_0x27ac0f));process[_0xece2('0x62')](_0xece2('0x63'));var _0x2b93e9=_0x27ac0f[_0xece2('0x64')];var _0x3052ef=_[_0xece2('0x65')](_0x2b93e9);var _0x233bcc=_0x27ac0f[_0xece2('0x66')];var _0x1261ce=path[_0xece2('0x13')](config[_0xece2('0x67')],_0xece2('0x68'),_0x233bcc+_0xece2('0x69'));logger[_0xece2('0x5c')](_0xece2('0x6a'),_0x27ac0f);db[_0xece2('0x6b')][_0xece2('0x6c')]({'raw':!![],'attributes':['id',_0xece2('0x6d')]})['then'](function(_0x45ac58){for(var _0x3e3aef=0x0;_0x3e3aef<_0x45ac58[_0xece2('0x19')];_0x3e3aef++){if(_0x45ac58[_0x3e3aef][_0xece2('0x6d')]in _0x2b93e9){contactItemTypes['push'](_0x45ac58[_0x3e3aef]);delete _0x3052ef[_0x45ac58[_0x3e3aef][_0xece2('0x6d')]];hasAdditionalPhones=!![];}for(var _0x47e498 in _0x2b93e9){if(_0x45ac58[_0x3e3aef][_0xece2('0x6d')]+_0xece2('0x6e')===_0x47e498){phoneDescriptions[_0xece2('0x1d')]({'itemTypeId':_0x45ac58[_0x3e3aef]['id'],'description':_0x47e498});delete _0x3052ef[_0x47e498];}}}if(hasAdditionalPhones)_0x3052ef['AdditionalPhones']='';var _0x5306f5=_[_0xece2('0x56')](_0x3052ef)[_0xece2('0x13')]();logger[_0xece2('0x5c')](_0xece2('0x6f'),_0x5306f5);fs[_0xece2('0x70')](_0x1261ce,_0x5306f5+'\x0a');Papa[_0xece2('0x71')](fs['createReadStream'](_0x6eb976),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4df654,_0x5c4e21){try{for(var _0x453a28=0x0,_0x3ed0a2=[];_0x453a28<_0x4df654[_0xece2('0x72')][_0xece2('0x19')];_0x453a28++){stats[_0xece2('0x73')]+=0x1;if(_0x4df654[_0xece2('0x5f')][_0x453a28]){handleError(_0x4df654[_0xece2('0x72')][_0x453a28],_0x4df654[_0xece2('0x5f')][_0x453a28]);}else{var _0x2202bd=[];var _0x86b02a=[];var _0x365292={};for(var _0x5e4a8c in _0x2b93e9){let _0x7e566d=contactItemTypes[_0xece2('0x74')](_0x5c6c8c=>_0x5c6c8c[_0xece2('0x6d')]===_0x5e4a8c);let _0x2b1306=contactItemTypes['find'](_0x3961f9=>_0x3961f9['name']+_0xece2('0x6e')===_0x5e4a8c);if(_[_0xece2('0x1b')](_0x7e566d)&&_[_0xece2('0x1b')](_0x2b1306)){if(_0x2b93e9['hasOwnProperty'](_0x5e4a8c)){if(_0x4df654[_0xece2('0x72')][_0x453a28][_0x2b93e9[_0x5e4a8c]]){var _0x1386f9=_[_0xece2('0x75')](_0x4df654['data'][_0x453a28][_0x2b93e9[_0x5e4a8c]][_0xece2('0x76')](/"/g,'\x27'));switch(_0x5e4a8c){case _0xece2('0x35'):var _0x4b903d=moment(_0x1386f9,_0xece2('0xe'),!![]);if(_0x4b903d[_0xece2('0x77')]()){_0x3ed0a2[_0xece2('0x1d')]('\x22'+_0x1386f9+'\x22');}else{_0x2202bd[_0xece2('0x1d')](_0xece2('0x78'));}break;case'priority':var _0x13b604=parseInt(_0x1386f9);_0x1386f9=_[_0xece2('0x79')](_0x13b604)||_0x13b604<0x0||_0x13b604>0x4?_0x45729a?0x3:0x2:_0x13b604;_0x3ed0a2[_0xece2('0x1d')]('\x22'+_0x1386f9+'\x22');break;case'UserId':var _0x313136=parseInt(_0x1386f9);if(_[_0xece2('0x7a')](_0x313136)&&_[_0xece2('0x7b')](_0x2a5bd0,_0x313136)){_0x3ed0a2[_0xece2('0x1d')]('\x22'+_0x313136+'\x22');}else{_0x2202bd['push'](_0xece2('0x7c'));}break;case _0xece2('0x7d'):if(isEmail(_0x1386f9)){_0x3ed0a2[_0xece2('0x1d')]('\x22'+_0x1386f9+'\x22');}else{_0x2202bd[_0xece2('0x1d')](_0xece2('0x7e'));}break;case _0xece2('0x7f'):var _0xe99cfd=moment(_0x1386f9,_0xece2('0x80'),!![]);if(_0xe99cfd['isValid']()){_0x3ed0a2[_0xece2('0x1d')]('\x22'+_0x1386f9+'\x22');}else{_0x2202bd['push'](_0xece2('0x81'));}break;default:_0x3ed0a2['push']('\x22'+_0x1386f9+'\x22');}}else{switch(_0x5e4a8c){case'firstName':case _0xece2('0x1a'):_0x2202bd[_0xece2('0x1d')](_0x5e4a8c+'\x20not\x20specified');break;default:_0x3ed0a2[_0xece2('0x1d')]('\x22\x22');}}}}else{var _0x9d73d='';if(!_['isNil'](_0x7e566d)){if(!_0x365292[_0xece2('0x82')](_0x7e566d['id'])){for(var _0x25092b=0x0;_0x25092b<_0x2b93e9[_0x5e4a8c][_0xece2('0x19')];_0x25092b++){var _0x1386f9=_[_0xece2('0x75')](_0x4df654[_0xece2('0x72')][_0x453a28][_0x2b93e9[_0x5e4a8c][_0x25092b]]['replace'](/"/g,'\x27'));var _0x4bf8fc=phoneDescriptions[_0xece2('0x74')](_0x208b84=>_0x208b84[_0xece2('0x83')]===_0x7e566d['id']);if(!_[_0xece2('0x1b')](_0x4bf8fc)){var _0x339495=_[_0xece2('0x75')](_0x4df654[_0xece2('0x72')][_0x453a28][_0x2b93e9[_0x4bf8fc[_0xece2('0x84')]][0x0]][_0xece2('0x76')](/"/g,'\x27'));if(!_[_0xece2('0x1b')](_0x339495))_0x1386f9=_0x1386f9+'§'+_0x339495;}if(_0x9d73d=='')_0x9d73d=_0x1386f9;else _0x9d73d+='|'+_0x1386f9;}_0x86b02a[_0xece2('0x1d')](_0x7e566d['id']+':'+_0x9d73d);_0x365292[_0x7e566d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3ed0a2[_0xece2('0x1d')]('\x22'+_0x86b02a[_0xece2('0x13')](';')+'\x22');}if(_0x2202bd[_0xece2('0x19')]){handleError(_0x4df654[_0xece2('0x72')][_0x453a28],{'code':_0xece2('0x85'),'message':_0x2202bd[_0xece2('0x13')]()});}else{fs[_0xece2('0x86')](_0x1261ce,_0x3ed0a2[_0xece2('0x13')]()+'\x0a');}_0x3ed0a2=[];}if(!(stats['rows']%0xc8)){socket[_0xece2('0x87')](_0xece2('0x88')+_0x233bcc,stats);stats[_0xece2('0x5f')]=[];}}if(stopped){logger[_0xece2('0x5c')](_0xece2('0x89'));_0x5c4e21[_0xece2('0x8a')]();}}catch(_0x571835){handleError(_0x4df654['data'][_0x453a28],{'code':'SystemError','message':_0x571835['message']});logger[_0xece2('0x21')](_0xece2('0x8b'),_0x571835[_0xece2('0x22')]);}},'complete':function(){try{var _0x2c463a=[];var _0x27fde3=tempTableName;_0x2c463a['push'](_0xece2('0x8c')+_0x27fde3+_0xece2('0x8d'));logger[_0xece2('0x5c')](_0xece2('0x8e'),contactItemTypes[_0xece2('0x19')]);var _0x12f58a=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1261ce,_0x27fde3,_0x5306f5,_0x27ac0f[_0xece2('0x37')],_0x27ac0f[_0xece2('0x8f')]||null,NOW,NOW);if(_[_0xece2('0x1b')](_0x2b93e9[_0xece2('0x35')])){_0x12f58a+=_0xece2('0x90');}_0x2c463a[_0xece2('0x1d')](_0x12f58a);BPromise[_0xece2('0x91')](_0x2c463a,handleQuery)[_0xece2('0x1f')](function(_0x3468b0){BPromise['all']([handleAdditionalPhones()])[_0xece2('0x1f')](function(){_0x2c463a=[];for(var _0x37c5fa=0x0;_0x37c5fa_0x2b901d[_0x33bd('0x69')]===_0x248150);let _0x178d92=contactItemTypes[_0x33bd('0x70')](_0x46aa98=>_0x46aa98['name']+_0x33bd('0x71')===_0x248150);if(_['isNil'](_0x8e94f1)&&_[_0x33bd('0x1f')](_0x178d92)){if(_0x59bfdc['hasOwnProperty'](_0x248150)){if(_0xbf0e0e[_0x33bd('0x6f')][_0x30880a][_0x59bfdc[_0x248150]]){var _0x5e02c4=_[_0x33bd('0x72')](_0xbf0e0e['data'][_0x30880a][_0x59bfdc[_0x248150]][_0x33bd('0x73')](/"/g,'\x27'));switch(_0x248150){case _0x33bd('0x38'):var _0x5b4b07=moment(_0x5e02c4,_0x33bd('0xf'),!![]);if(_0x5b4b07[_0x33bd('0x74')]()){_0x24ddb8['push']('\x22'+_0x5e02c4+'\x22');}else{_0x5f2b2a['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x33bd('0x3c'):var _0x5c394a=parseInt(_0x5e02c4);_0x5e02c4=_[_0x33bd('0x75')](_0x5c394a)||_0x5c394a<0x0||_0x5c394a>0x4?_0x7a4d87?0x3:0x2:_0x5c394a;_0x24ddb8[_0x33bd('0x21')]('\x22'+_0x5e02c4+'\x22');break;case _0x33bd('0x76'):var _0x316cd7=parseInt(_0x5e02c4);if(_[_0x33bd('0x77')](_0x316cd7)&&_['includes'](_0x11ffdf,_0x316cd7)){_0x24ddb8[_0x33bd('0x21')]('\x22'+_0x316cd7+'\x22');}else{_0x5f2b2a[_0x33bd('0x21')]('agent\x20not\x20exists');}break;case _0x33bd('0x78'):if(isEmail(_0x5e02c4)){_0x24ddb8[_0x33bd('0x21')]('\x22'+_0x5e02c4+'\x22');}else{_0x5f2b2a[_0x33bd('0x21')](_0x33bd('0x79'));}break;case'dateOfBirth':var _0x2da555=moment(_0x5e02c4,'YYYY-MM-DD',!![]);if(_0x2da555['isValid']()){_0x24ddb8[_0x33bd('0x21')]('\x22'+_0x5e02c4+'\x22');}else{_0x5f2b2a['push'](_0x33bd('0x7a'));}break;default:_0x24ddb8[_0x33bd('0x21')]('\x22'+_0x5e02c4+'\x22');}}else{switch(_0x248150){case'firstName':case _0x33bd('0x15'):_0x5f2b2a['push'](_0x248150+_0x33bd('0x7b'));break;default:_0x24ddb8[_0x33bd('0x21')]('\x22\x22');}}}}else{var _0x1e5e22='';if(!_[_0x33bd('0x1f')](_0x8e94f1)){if(!_0x2f99de[_0x33bd('0x7c')](_0x8e94f1['id'])){for(var _0x5cbdf3=0x0;_0x5cbdf3<_0x59bfdc[_0x248150]['length'];_0x5cbdf3++){var _0x5e02c4=_[_0x33bd('0x72')](_0xbf0e0e['data'][_0x30880a][_0x59bfdc[_0x248150][_0x5cbdf3]][_0x33bd('0x73')](/"/g,'\x27'));var _0x4b7a14=phoneDescriptions[_0x33bd('0x70')](_0x59c083=>_0x59c083['itemTypeId']===_0x8e94f1['id']);if(!_[_0x33bd('0x1f')](_0x4b7a14)){var _0x58a388=_[_0x33bd('0x72')](_0xbf0e0e['data'][_0x30880a][_0x59bfdc[_0x4b7a14[_0x33bd('0x7d')]][0x0]][_0x33bd('0x73')](/"/g,'\x27'));if(!_['isNil'](_0x58a388))_0x5e02c4=_0x5e02c4+'§'+_0x58a388;}if(_0x1e5e22=='')_0x1e5e22=_0x5e02c4;else _0x1e5e22+='|'+_0x5e02c4;}_0x18ea18['push'](_0x8e94f1['id']+':'+_0x1e5e22);_0x2f99de[_0x8e94f1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x24ddb8[_0x33bd('0x21')]('\x22'+_0x18ea18[_0x33bd('0x17')](';')+'\x22');}if(_0x5f2b2a['length']){handleError(_0xbf0e0e[_0x33bd('0x6f')][_0x30880a],{'code':_0x33bd('0x7e'),'message':_0x5f2b2a['join']()});}else{fs['appendFileSync'](_0x2ccd4b,_0x24ddb8[_0x33bd('0x17')]()+'\x0a');}_0x24ddb8=[];}if(!(stats[_0x33bd('0x6d')]%0xc8)){socket[_0x33bd('0x7f')](_0x33bd('0x80')+_0x4d5209,stats);stats[_0x33bd('0x6e')]=[];}}if(stopped){logger['info'](_0x33bd('0x81'));_0xc607f3[_0x33bd('0x82')]();}}catch(_0x162ee1){handleError(_0xbf0e0e[_0x33bd('0x6f')][_0x30880a],{'code':_0x33bd('0x83'),'message':_0x162ee1[_0x33bd('0x25')]});logger[_0x33bd('0x5b')]('step',_0x162ee1[_0x33bd('0x25')]);}},'complete':function(){try{var _0x521cfe=[];var _0x481761=tempTableName;_0x521cfe[_0x33bd('0x21')](_0x33bd('0x84')+_0x481761+_0x33bd('0x85'));logger[_0x33bd('0x5a')]('CIS\x20len',contactItemTypes[_0x33bd('0x1e')]);var _0x318769=util[_0x33bd('0xe')]('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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2ccd4b,_0x481761,_0x179912,_0x148258[_0x33bd('0x3a')],_0x148258[_0x33bd('0x55')]||null,NOW,NOW);if(_['isNil'](_0x59bfdc[_0x33bd('0x38')])){_0x318769+=_0x33bd('0x86');}_0x521cfe['push'](_0x318769);BPromise['each'](_0x521cfe,handleQuery)['then'](function(_0x5b6c87){BPromise[_0x33bd('0x22')]([handleAdditionalPhones()])[_0x33bd('0x23')](function(){_0x521cfe=[];for(var _0x42d37f=0x0;_0x42d37f\x20\x20');}var _0x1eee88=path['join'](config[_0x33bd('0x64')],_0x33bd('0x65'),process[_0x33bd('0x8f')][0x2]);if(!fs[_0x33bd('0x90')](_0x1eee88)){throw new Error(_0x33bd('0x91'));}var _0xf028f3={};try{_0xf028f3=JSON[_0x33bd('0x92')](process['argv'][0x3]);if(!_0xf028f3[_0x33bd('0x93')]){throw new Error(_0x33bd('0x94'));}var _0x85f2d2=0x0;if(_0xf028f3[_0x33bd('0x93')][_0x33bd('0x76')]){_0x85f2d2=0x1;}if(!_0xf028f3['ListId']){throw new Error(_0x33bd('0x95'));}}catch(_0x4b3f14){throw new Error(_0x33bd('0x96'));}var _0x2e6fcb=[];try{_0x2e6fcb=_['map'](JSON[_0x33bd('0x92')](process['argv'][0x4]),'id');}catch(_0x548a90){logger[_0x33bd('0x5a')](_0x33bd('0x97'));}main(_0x1eee88,_0xf028f3,_0x2e6fcb,_0x85f2d2);}validate();process['on'](_0x33bd('0x98'),handleStop);process['on'](_0x33bd('0x99'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index a0d03ef..e965291 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 _0xd2b0=['duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','destexten','Queue','queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','uniqueid','starttime','answertime','Complete\x20Time','endtime'];(function(_0x1b0c48,_0xc692ef){var _0x1daae9=function(_0xb3a7d6){while(--_0xb3a7d6){_0x1b0c48['push'](_0x1b0c48['shift']());}};_0x1daae9(++_0xc692ef);}(_0xd2b0,0x137));var _0x0d2b=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xd2b0[_0x2aec52];return _0x3b8835;};'use strict';exports[_0x0d2b('0x0')]=function(_0x24ce04,_0x517614){var _0x2a9f76=[{'type':_0x0d2b('0x1'),'content':_0x0d2b('0x2'),'variableName':null}];switch(_0x24ce04[_0x0d2b('0x3')]()){case _0x0d2b('0x4'):switch(_0x517614[_0x0d2b('0x3')]()){case _0x0d2b('0x5'):_0x2a9f76[_0x0d2b('0x6')]({'type':_0x0d2b('0x7'),'content':'','variableName':'queue'});_0x2a9f76[_0x0d2b('0x6')]({'type':'variable','content':'','variableName':'calleridnum'});break;case _0x0d2b('0x8'):_0x2a9f76[_0x0d2b('0x6')]({'type':_0x0d2b('0x1'),'content':_0x0d2b('0x9'),'variableName':null});_0x2a9f76[_0x0d2b('0x6')]({'type':_0x0d2b('0x7'),'content':'','variableName':_0x0d2b('0xa')});break;}}return _0x2a9f76;};exports[_0x0d2b('0xb')]=function(_0x57a6e2,_0x299046){var _0x1875c3=[];switch(_0x57a6e2[_0x0d2b('0x3')]()){case'voice':switch(_0x299046[_0x0d2b('0x3')]()){case _0x0d2b('0x5'):_0x1875c3=[{'type':'string','content':_0x0d2b('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x0d2b('0xd'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':'calleridnum'},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0xe'),'keyType':'variable','variableName':_0x0d2b('0xf')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0x10')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x11'),'keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0x12')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x13'),'keyType':'variable','variableName':'uniqueid'},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x14'),'keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0x15')},{'type':'string','content':_0x0d2b('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x17'),'keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0x18')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x19'),'keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0xa')},{'type':'string','content':_0x0d2b('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x1b'),'keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0x15')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x1c'),'keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0x1d')},{'type':_0x0d2b('0xd'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0x0d2b('0x1e')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x1f'),'keyType':_0x0d2b('0x7'),'variableName':'holdtime'},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x20'),'keyType':_0x0d2b('0x7'),'variableName':_0x0d2b('0x21')}];break;case'outbound':_0x1875c3=[{'type':_0x0d2b('0x1'),'content':_0x0d2b('0xc'),'variableName':null},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x22'),'keyType':'variable','keyContent':'','variableName':_0x0d2b('0xa')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x23'),'keyType':_0x0d2b('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x13'),'keyType':_0x0d2b('0x7'),'keyContent':'','variableName':_0x0d2b('0x24')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x14'),'keyType':_0x0d2b('0x7'),'keyContent':'','variableName':_0x0d2b('0x25')},{'type':_0x0d2b('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x0d2b('0xd'),'content':'','key':'Answer\x20Time','keyType':_0x0d2b('0x7'),'keyContent':'','variableName':_0x0d2b('0x26')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x27'),'keyType':_0x0d2b('0x7'),'keyContent':'','variableName':_0x0d2b('0x28')},{'type':_0x0d2b('0xd'),'content':'','key':'Duration','keyType':_0x0d2b('0x7'),'keyContent':'','variableName':_0x0d2b('0x29')},{'type':_0x0d2b('0xd'),'content':'','key':_0x0d2b('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x0d2b('0x2b')}];break;}}return _0x1875c3;}; \ No newline at end of file +var _0x2184=['queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable'];(function(_0x34afde,_0x2acf3e){var _0x23d006=function(_0x1e1525){while(--_0x1e1525){_0x34afde['push'](_0x34afde['shift']());}};_0x23d006(++_0x2acf3e);}(_0x2184,0x178));var _0x4218=function(_0x25c56c,_0x46e5c4){_0x25c56c=_0x25c56c-0x0;var _0x2d923d=_0x2184[_0x25c56c];return _0x2d923d;};'use strict';exports[_0x4218('0x0')]=function(_0x4e8f9a,_0x59a3e6){var _0x195830=[{'type':_0x4218('0x1'),'content':_0x4218('0x2'),'variableName':null}];switch(_0x4e8f9a[_0x4218('0x3')]()){case _0x4218('0x4'):switch(_0x59a3e6['toLowerCase']()){case _0x4218('0x5'):_0x195830[_0x4218('0x6')]({'type':_0x4218('0x7'),'content':'','variableName':_0x4218('0x8')});_0x195830[_0x4218('0x6')]({'type':_0x4218('0x7'),'content':'','variableName':_0x4218('0x9')});break;case _0x4218('0xa'):_0x195830[_0x4218('0x6')]({'type':_0x4218('0x1'),'content':_0x4218('0xb'),'variableName':null});_0x195830[_0x4218('0x6')]({'type':'variable','content':'','variableName':_0x4218('0xc')});break;}}return _0x195830;};exports['getDescriptions']=function(_0x52f5ed,_0x4d24a8){var _0x654daf=[];switch(_0x52f5ed[_0x4218('0x3')]()){case'voice':switch(_0x4d24a8[_0x4218('0x3')]()){case _0x4218('0x5'):_0x654daf=[{'type':_0x4218('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0xe'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0x9')},{'type':_0x4218('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x4218('0x7'),'variableName':_0x4218('0xf')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x10'),'keyType':'variable','variableName':_0x4218('0x11')},{'type':'keyValue','content':'','key':'Queue','keyType':_0x4218('0x7'),'variableName':_0x4218('0x8')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x12'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0x13')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x14'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0x15')},{'type':_0x4218('0x1'),'content':_0x4218('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x17'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0x18')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x19'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0xc')},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x1a'),'keyType':_0x4218('0x7'),'variableName':'agentcalledAt'},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x1b'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0x1c')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x1d'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0x1e')},{'type':'keyValue','content':'','key':_0x4218('0x1f'),'keyType':'variable','variableName':_0x4218('0x20')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x21'),'keyType':_0x4218('0x7'),'variableName':_0x4218('0x22')}];break;case _0x4218('0xa'):_0x654daf=[{'type':_0x4218('0x1'),'content':_0x4218('0x23'),'variableName':null},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x24'),'keyType':_0x4218('0x7'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x25'),'keyType':'variable','keyContent':'','variableName':_0x4218('0x26')},{'type':'keyValue','content':'','key':_0x4218('0x12'),'keyType':'variable','keyContent':'','variableName':_0x4218('0x13')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x14'),'keyType':_0x4218('0x7'),'keyContent':'','variableName':_0x4218('0x27')},{'type':_0x4218('0x1'),'content':_0x4218('0x28')},{'type':'keyValue','content':'','key':_0x4218('0x29'),'keyType':_0x4218('0x7'),'keyContent':'','variableName':_0x4218('0x2a')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x2b'),'keyType':_0x4218('0x7'),'keyContent':'','variableName':_0x4218('0x2c')},{'type':_0x4218('0xd'),'content':'','key':'Duration','keyType':_0x4218('0x7'),'keyContent':'','variableName':_0x4218('0x2d')},{'type':_0x4218('0xd'),'content':'','key':_0x4218('0x2e'),'keyType':_0x4218('0x7'),'keyContent':'','variableName':_0x4218('0x2f')}];break;}}return _0x654daf;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 86aa72e..6141540 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 _0xf3c4=['catch','tracked','query','clone','body','omit','html','phone','mobile','updateUser','lodash','./utils','findAll','resolve','getInteractionsQuery','then','search','parseQueryParameters','where','contact','default','user','having','tags','checkAccountsRestrictions','group','i.id','count','clause','order','forEach','DESC','closed','getClosedOrderClause'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xf3c4,0x1c4));var _0x4f3c=function(_0x1ef0ee,_0x2b260a){_0x1ef0ee=_0x1ef0ee-0x0;var _0x1af4e8=_0xf3c4[_0x1ef0ee];return _0x1af4e8;};'use strict';var _=require(_0x4f3c('0x0'));var sqlUtils=require('./sql-utils');var utils=require(_0x4f3c('0x1'));exports[_0x4f3c('0x2')]=function(_0x3cebf2,_0x36bc6a,_0x2677f9,_0x20e023,_0x1e33e7){var _0x56425c={'count':0x0,'rows':[]};var _0x276696=sqlUtils['skipInteractionsQuery'](_0x3cebf2,_0x2677f9,_0x36bc6a);if(_0x276696){return Promise[_0x4f3c('0x3')](_0x56425c);}var _0x1816b4=sqlUtils[_0x4f3c('0x4')](_0x3cebf2);var _0x214306={};return Promise[_0x4f3c('0x3')]()[_0x4f3c('0x5')](function(){if(_0x36bc6a[_0x4f3c('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x36bc6a[_0x4f3c('0x6')],_0x1e33e7);}else{return sqlUtils[_0x4f3c('0x7')](_0x3cebf2,_0x36bc6a,_0x1e33e7);}})['then'](function(_0x431868){_0x1816b4[_0x4f3c('0x8')](_0x431868['body']);_0x1816b4['where'](_0x431868[_0x4f3c('0x9')]);_0x1816b4[_0x4f3c('0x8')](_0x431868[_0x4f3c('0xa')]);_0x1816b4[_0x4f3c('0x8')](_0x431868['fields']);_0x1816b4[_0x4f3c('0x8')](_0x431868['filter']);_0x1816b4[_0x4f3c('0x8')](_0x431868[_0x4f3c('0xb')]);_0x1816b4[_0x4f3c('0xc')](_0x431868['read']);_0x214306=_0x431868[_0x4f3c('0xd')];return sqlUtils[_0x4f3c('0xe')](_0x3cebf2,_0x2677f9,_0x36bc6a);})[_0x4f3c('0x5')](function(_0x453b3a){_0x1816b4['where'](_0x453b3a);_0x1816b4[_0x4f3c('0xf')](_0x4f3c('0x10'));var _0x345332=_0x36bc6a[_0x4f3c('0x6')]?_0x214306['ids']:_0x36bc6a['tag'];return sqlUtils['countFilteredInteractions'](_0x1816b4,_0x345332);})['then'](function(_0x2ae3d0){_0x56425c[_0x4f3c('0x11')]=_0x2ae3d0['length'];if(_0x56425c[_0x4f3c('0x11')]===0x0){return[];}_0x1816b4['having'](_0x214306[_0x4f3c('0x12')]);if(_0x20e023[_0x4f3c('0x13')]){_0x20e023[_0x4f3c('0x13')][_0x4f3c('0x14')](function(_0x39ded9){var _0x1afe0d=_0x39ded9[0x0]==='contactName'?_0x39ded9[0x0]:'i.'+_0x39ded9[0x0];_0x1816b4[_0x4f3c('0x13')](_0x1afe0d,_0x39ded9[0x1]===_0x4f3c('0x15')?![]:!![]);if(_0x39ded9[0x0]===_0x4f3c('0x16')){var _0x192648=sqlUtils[_0x4f3c('0x17')](_0x3cebf2,_0x36bc6a);_0x1816b4[_0x4f3c('0x13')](_0x192648,_0x39ded9[0x1]===_0x4f3c('0x15')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x3cebf2,_0x1816b4,_0x36bc6a,_0x20e023);})['then'](function(_0x5c3032){_0x56425c['rows']=_0x5c3032;return _0x56425c;})[_0x4f3c('0x18')](function(_0xe25094){throw _0xe25094;});};exports[_0x4f3c('0x19')]=function(_0x20c84f,_0x1435ee){return function(_0x65ac2b,_0x37cffc,_0x2a6b86){var _0x69f728=_0x65ac2b[_0x4f3c('0xb')];var _0x1f6ee5={};var _0x3c9af3=_0x65ac2b[_0x4f3c('0x1a')];if(_0x1f6ee5){_0x1f6ee5=_[_0x4f3c('0x1b')](_0x65ac2b[_0x4f3c('0x1c')]);_0x1f6ee5=_[_0x4f3c('0x1d')](_0x1f6ee5,[_0x4f3c('0x1c'),_0x4f3c('0x1e'),_0x4f3c('0x1f'),'fax',_0x4f3c('0x20')]);}utils[_0x4f3c('0x21')](_0x69f728,_0x1f6ee5,_0x3c9af3,_0x20c84f,_0x1435ee);_0x2a6b86(null);};}; \ No newline at end of file +var _0xd70e=['default','fields','filter','user','having','tags','checkAccountsRestrictions','group','i.id','search','tag','countFilteredInteractions','length','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','rows','clone','omit','body','html','phone','fax','mobile','updateUser','lodash','./sql-utils','findAll','skipInteractionsQuery','resolve','then','parseAdvancedSearchFilter','where'];(function(_0xe17fa4,_0x5e9a7d){var _0x51c079=function(_0x4b8a81){while(--_0x4b8a81){_0xe17fa4['push'](_0xe17fa4['shift']());}};_0x51c079(++_0x5e9a7d);}(_0xd70e,0x90));var _0xed70=function(_0x2d3281,_0x541875){_0x2d3281=_0x2d3281-0x0;var _0x5bc166=_0xd70e[_0x2d3281];return _0x5bc166;};'use strict';var _=require(_0xed70('0x0'));var sqlUtils=require(_0xed70('0x1'));var utils=require('./utils');exports[_0xed70('0x2')]=function(_0x213081,_0x20bc34,_0x43765c,_0x35a7e9,_0x31ab8d){var _0x5bb84f={'count':0x0,'rows':[]};var _0x871f8e=sqlUtils[_0xed70('0x3')](_0x213081,_0x43765c,_0x20bc34);if(_0x871f8e){return Promise['resolve'](_0x5bb84f);}var _0x5351d4=sqlUtils['getInteractionsQuery'](_0x213081);var _0x20f1d7={};return Promise[_0xed70('0x4')]()[_0xed70('0x5')](function(){if(_0x20bc34['search']){return sqlUtils[_0xed70('0x6')](_0x20bc34['search'],_0x31ab8d);}else{return sqlUtils['parseQueryParameters'](_0x213081,_0x20bc34,_0x31ab8d);}})['then'](function(_0x1da898){_0x5351d4[_0xed70('0x7')](_0x1da898['body']);_0x5351d4[_0xed70('0x7')](_0x1da898['contact']);_0x5351d4['where'](_0x1da898[_0xed70('0x8')]);_0x5351d4['where'](_0x1da898[_0xed70('0x9')]);_0x5351d4['where'](_0x1da898[_0xed70('0xa')]);_0x5351d4[_0xed70('0x7')](_0x1da898[_0xed70('0xb')]);_0x5351d4[_0xed70('0xc')](_0x1da898['read']);_0x20f1d7=_0x1da898[_0xed70('0xd')];return sqlUtils[_0xed70('0xe')](_0x213081,_0x43765c,_0x20bc34);})[_0xed70('0x5')](function(_0x37682f){_0x5351d4['where'](_0x37682f);_0x5351d4[_0xed70('0xf')](_0xed70('0x10'));var _0x1fdb60=_0x20bc34[_0xed70('0x11')]?_0x20f1d7['ids']:_0x20bc34[_0xed70('0x12')];return sqlUtils[_0xed70('0x13')](_0x5351d4,_0x1fdb60);})[_0xed70('0x5')](function(_0x25352c){_0x5bb84f['count']=_0x25352c[_0xed70('0x14')];if(_0x5bb84f['count']===0x0){return[];}_0x5351d4[_0xed70('0xc')](_0x20f1d7[_0xed70('0x15')]);if(_0x35a7e9[_0xed70('0x16')]){_0x35a7e9[_0xed70('0x16')][_0xed70('0x17')](function(_0x15d080){var _0x70dd=_0x15d080[0x0]===_0xed70('0x18')?_0x15d080[0x0]:'i.'+_0x15d080[0x0];_0x5351d4['order'](_0x70dd,_0x15d080[0x1]===_0xed70('0x19')?![]:!![]);if(_0x15d080[0x0]===_0xed70('0x1a')){var _0x181b9e=sqlUtils[_0xed70('0x1b')](_0x213081,_0x20bc34);_0x5351d4['order'](_0x181b9e,_0x15d080[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0xed70('0x1c')](_0x213081,_0x5351d4,_0x20bc34,_0x35a7e9);})[_0xed70('0x5')](function(_0x33dabe){_0x5bb84f[_0xed70('0x1d')]=_0x33dabe;return _0x5bb84f;})['catch'](function(_0x15b636){throw _0x15b636;});};exports['tracked']=function(_0x412a87,_0x20a080){return function(_0x4e0e51,_0x456884,_0x5d9f87){var _0x2d41c6=_0x4e0e51[_0xed70('0xb')];var _0x2f8f30={};var _0x158a68=_0x4e0e51['query'];if(_0x2f8f30){_0x2f8f30=_[_0xed70('0x1e')](_0x4e0e51['body']);_0x2f8f30=_[_0xed70('0x1f')](_0x2f8f30,[_0xed70('0x20'),_0xed70('0x21'),_0xed70('0x22'),_0xed70('0x23'),_0xed70('0x24')]);}utils[_0xed70('0x25')](_0x2d41c6,_0x2f8f30,_0x158a68,_0x412a87,_0x20a080);_0x5d9f87(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index afd9d26..9e3db64 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4058=['a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','expr','getSelectedTags','forEach','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','whatsapp','includes','fax','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','value','start','end','read','and','Contact','operator','split','contact','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','text','tags','clause','ids','User','$substring','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','compact','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','then','fields','tag','filter','capitalize','Websites','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','i.substatus','closed','Interaction','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','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','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','findOne','enableEmailPreview','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','field','name','color','tools_tags','getInteractionFK','select','ui.','from','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0x4058,0x129));var _0x8405=function(_0x3da9ef,_0x4c4ae3){_0x3da9ef=_0x3da9ef-0x0;var _0x1a176e=_0x4058[_0x3da9ef];return _0x1a176e;};'use strict';var _=require(_0x8405('0x0'));var squel=require(_0x8405('0x1'));var as=require(_0x8405('0x2'));var qs=require(_0x8405('0x3'));var updateInteraction=require(_0x8405('0x4'))[_0x8405('0x5')];var utils=require(_0x8405('0x6'));var db=require(_0x8405('0x7'))['db'];function skipInteractionsQuery(_0xf8c24c,_0x4948b2,_0x5ebf0e){var _0x57fb07=![];var _0x1db7ea=utils[_0x8405('0x8')](_0xf8c24c);if(_0x4948b2[_0x8405('0x9')]===_0x8405('0xa')&&!_0x5ebf0e[_0x8405('0xb')]&&!_0x5ebf0e[_0x1db7ea]){_0x57fb07=!![];}return _0x57fb07;}function getTagsQuery(){return squel['select']()[_0x8405('0xc')]('id')[_0x8405('0xc')](_0x8405('0xd'))['field'](_0x8405('0xe'))['from'](_0x8405('0xf'));}function getUsersQuery(_0xb442,_0x50344e){var _0xff90a4=utils[_0x8405('0x10')](_0xb442);var _0x5b94d5='user_has_'+_0xb442+'_interactions';var _0x4e5124=squel[_0x8405('0x11')]()['field']('u.id')['field']('u.fullname')['field'](_0x8405('0x12')+_0xff90a4)[_0x8405('0x13')](_0x5b94d5,'ui')['left_join'](_0x8405('0x14'),'u',_0x8405('0x15'));if(_0x50344e[_0x8405('0x16')]>0x0){_0x4e5124[_0x8405('0x17')]('ui.'+_0xff90a4+_0x8405('0x18'),_[_0x8405('0x19')](_0x50344e,'id'));}return _0x4e5124;}function getInteractionsQuery(_0x8ef1fb){var _0x30cef7=utils[_0x8405('0x1a')](_0x8ef1fb);var _0x15a189=utils[_0x8405('0x8')](_0x8ef1fb);var _0x358633=utils[_0x8405('0x10')](_0x8ef1fb);return squel[_0x8405('0x11')]()[_0x8405('0x13')](_0x30cef7[_0x8405('0x1b')],'i')[_0x8405('0x1c')](_0x8405('0x1d'),'c',_0x8405('0x1e'))[_0x8405('0x1c')](_0x8405('0x14'),'o',_0x8405('0x1f'))[_0x8405('0x1c')](_0x30cef7[_0x8405('0x20')],'a',_0x8405('0x21')+_0x15a189)[_0x8405('0x1c')](_0x30cef7[_0x8405('0x22')],'me',_0x8405('0x23')+_0x358633+_0x8405('0x24'))[_0x8405('0x1c')](_0x30cef7['interactionsTags'],'it','it.'+_0x358633+_0x8405('0x24'))[_0x8405('0x1c')](_0x8405('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x5e3849={'body':squel['expr'](),'contact':squel[_0x8405('0x25')](),'default':squel['expr'](),'fields':squel[_0x8405('0x25')](),'filter':squel[_0x8405('0x25')](),'read':squel[_0x8405('0x25')](),'tags':{'clause':squel[_0x8405('0x25')](),'ids':null},'user':squel[_0x8405('0x25')]()};return _0x5e3849;}function parseTagParameter(_0x3e5b4c){var _0x102b85=squel[_0x8405('0x25')]();if(_0x3e5b4c){var _0x44b495=utils[_0x8405('0x26')](_0x3e5b4c);_0x44b495[_0x8405('0x27')](function(_0x293789){_0x102b85['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x293789+',%');});}return _0x102b85;}function parseReadParameter(_0x132c0f){var _0x51396d='';if(_0x132c0f){_0x51396d='unreadMessages\x20{OPERATOR}\x200';if(_0x132c0f==='1'){_0x51396d=_0x51396d[_0x8405('0x28')](_0x8405('0x29'),'=');}else{_0x51396d=_0x51396d[_0x8405('0x28')](_0x8405('0x29'),'>');}}return _0x51396d;}function parseSearchFilter(_0x458dbd,_0x16fa59){var _0x45fd8f=squel[_0x8405('0x25')]();if(_0x16fa59){var _0x7e216b=_0x16fa59[_0x8405('0x28')]('\x5c','\x5c\x5c')[_0x8405('0x28')](/'/g,'\x27\x27');if(qs[_0x8405('0x2a')](_0x7e216b)){_0x45fd8f['or'](_0x8405('0x2b'),_0x7e216b+'%');if(['sms',_0x8405('0x2c')][_0x8405('0x2d')](_0x458dbd)){_0x45fd8f['or']('i.phone\x20LIKE\x20?',_0x7e216b+'%');}else if(_0x458dbd===_0x8405('0x2e')){_0x45fd8f['or'](_0x8405('0x2f'),_0x7e216b+'%');}else if(_0x458dbd===_0x8405('0x30')){_0x45fd8f['or']('i.from\x20LIKE\x20?',_0x7e216b+'%');}}else if(_0x458dbd===_0x8405('0x31')&&qs[_0x8405('0x32')](_0x7e216b)){_0x45fd8f['or'](_0x8405('0x33'),_0x7e216b+'%');}else{if(_0x458dbd==='mail'){_0x45fd8f['or'](_0x8405('0x34'),qs[_0x8405('0x35')](_0x7e216b))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8405('0x35')](_0x7e216b));}else{if(_0x458dbd!=='fax'){_0x45fd8f['or'](_0x8405('0x36'),qs[_0x8405('0x35')](_0x7e216b));}_0x45fd8f['or'](_0x8405('0x37'),_0x7e216b+'%');}}}return _0x45fd8f;}function parseAdvancedSearchFilter(_0xe8de32,_0xafcc64){var _0x2b0929=getSqlClauses();var _0x146329=as[_0x8405('0x38')](_0xe8de32);var _0x1ae1c4=_0x146329[_0x8405('0x39')];for(var _0x2ddb8d=0x0;_0x2ddb8d<_0x146329[_0x8405('0x3a')]['length'];_0x2ddb8d++){var _0x23ef27=_0x146329['conditions'][_0x2ddb8d];var _0x47fbb0='i';var _0x39f2a8=_[_0x8405('0x3b')](_0xafcc64,['name',_0x23ef27[_0x8405('0xc')]]);if(_0x39f2a8){var _0x4349d2=as[_0x8405('0x3c')](_0x47fbb0,_0x39f2a8[_0x8405('0x3d')],_0x23ef27);_0x2b0929[_0x8405('0x3e')][_0x1ae1c4](_0x4349d2['text'],_0x4349d2[_0x8405('0x3f')][_0x8405('0x40')],_0x4349d2[_0x8405('0x3f')][_0x8405('0x41')]);}else{switch(_0x23ef27[_0x8405('0xc')]){case'unreadMessages':var _0x349143=parseReadParameter(_0x23ef27[_0x8405('0x3f')]);_0x2b0929[_0x8405('0x42')][_0x8405('0x43')](_0x349143);break;case _0x8405('0x44'):if(_0x23ef27[_0x8405('0x45')]==='$substring'){if(_0x23ef27[_0x8405('0x3f')][_0x8405('0x46')]('\x20')[_0x8405('0x16')]>0x1){_0x2b0929[_0x8405('0x47')][_0x1ae1c4](_0x8405('0x48'),qs[_0x8405('0x35')](_0x23ef27[_0x8405('0x3f')]),null);}else{var _0x4f3692='%'+_0x23ef27[_0x8405('0x3f')]+'%';_0x2b0929['contact'][_0x1ae1c4](_0x8405('0x49'),_0x4f3692,_0x4f3692,_0x4f3692);}}else{_0x39f2a8=_[_0x8405('0x3b')](_0xafcc64,['name',_0x8405('0x4a')]);_0x23ef27[_0x8405('0xc')]=_0x8405('0x4a');_0x4349d2=as[_0x8405('0x3c')](_0x47fbb0,_0x39f2a8[_0x8405('0x3d')],_0x23ef27);_0x2b0929[_0x8405('0x47')][_0x1ae1c4](_0x4349d2[_0x8405('0x4b')],_0x4349d2[_0x8405('0x3f')][_0x8405('0x40')],_0x4349d2[_0x8405('0x3f')]['end']);}break;case'Tag':var _0x18103f=_0x23ef27['value'][_0x8405('0x46')](',')[_0x8405('0x19')](function(_0x10e974){return Number(_0x10e974);});var _0x4af50f=parseTagParameter(_0x18103f);_0x2b0929[_0x8405('0x4c')][_0x8405('0x4d')]['and'](_0x4af50f);_0x2b0929[_0x8405('0x4c')][_0x8405('0x4e')]=_0x18103f;break;case _0x8405('0x4f'):if(_0x23ef27[_0x8405('0x45')]===_0x8405('0x50')){_0x2b0929[_0x8405('0x51')][_0x1ae1c4](_0x8405('0x52'),'%'+_0x23ef27['value']+'%',null);}else{_0x39f2a8=_['find'](_0xafcc64,['name',_0x8405('0x53')]);_0x23ef27[_0x8405('0xc')]=_0x8405('0x53');_0x4349d2=as[_0x8405('0x3c')](_0x47fbb0,_0x39f2a8['type'],_0x23ef27);_0x2b0929['user'][_0x1ae1c4](_0x4349d2[_0x8405('0x4b')],_0x4349d2[_0x8405('0x3f')][_0x8405('0x40')],_0x4349d2[_0x8405('0x3f')][_0x8405('0x41')]);}break;case _0x8405('0x54'):case _0x8405('0x55'):_0x4349d2=as[_0x8405('0x3c')]('me',null,_0x23ef27);_0x2b0929['body'][_0x1ae1c4](_0x4349d2[_0x8405('0x4b')],_0x4349d2['value'][_0x8405('0x40')],_0x4349d2[_0x8405('0x3f')][_0x8405('0x41')]);break;}}}return _0x2b0929;}function parseModelFields(_0x3e0861,_0x9a0ffe,_0x664cc9){var _0x192091=utils[_0x8405('0x8')](_0x3e0861);var _0x5f0c29=squel[_0x8405('0x25')]();var _0x1cc41f=_(_0x9a0ffe)[_0x8405('0x56')]()[_0x8405('0x19')](function(_0x5d733d){return _['some'](_0x664cc9,[_0x8405('0xd'),_0x5d733d])?_0x5d733d:undefined;})[_0x8405('0x57')]()[_0x8405('0x3f')]();if(_0x1cc41f[_0x8405('0x16')]>0x0){_0x1cc41f[_0x8405('0x27')](function(_0xf79cd8){if(_0xf79cd8===_0x192091){_0x5f0c29[_0x8405('0x43')]('i.'+_0x192091+'\x20IN\x20?',[]['concat'](_0x9a0ffe[_0xf79cd8]));}else if(_0xf79cd8===_0x8405('0x58')){var _0x4db367=JSON[_0x8405('0x59')](_0x9a0ffe[_0xf79cd8])[_0x8405('0x5a')];var _0x41400c=JSON['parse'](_0x9a0ffe[_0xf79cd8])['$lte'];_0x5f0c29[_0x8405('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4db367,_0x41400c);}else{if(_0x9a0ffe[_0xf79cd8]===_0x8405('0x5b')){_0x5f0c29[_0x8405('0x43')]('i.'+_0xf79cd8+_0x8405('0x5c'));}else{_0x5f0c29[_0x8405('0x43')]('i.'+_0xf79cd8+_0x8405('0x5d'),_0x9a0ffe[_0xf79cd8]);}}});}return _0x5f0c29;}function parseQueryParameters(_0x302abc,_0x1f720c,_0x22d117){var _0x3c0e6d=getSqlClauses();return Promise['resolve']()[_0x8405('0x5e')](function(){return parseModelFields(_0x302abc,_0x1f720c,_0x22d117);})[_0x8405('0x5e')](function(_0x39503f){_0x3c0e6d[_0x8405('0x5f')]['and'](_0x39503f);return parseReadParameter(_0x1f720c[_0x8405('0x42')]);})[_0x8405('0x5e')](function(_0x47760c){_0x3c0e6d[_0x8405('0x42')][_0x8405('0x43')](_0x47760c);return parseTagParameter(_0x1f720c[_0x8405('0x60')]);})['then'](function(_0x428140){_0x3c0e6d[_0x8405('0x4c')][_0x8405('0x4d')]['and'](_0x428140);return parseSearchFilter(_0x302abc,_0x1f720c[_0x8405('0x61')]);})[_0x8405('0x5e')](function(_0x99d4c3){_0x3c0e6d[_0x8405('0x61')]=_0x99d4c3;return _0x3c0e6d;});}function checkAccountsRestrictions(_0x9b3747,_0x3bbdc5,_0x283dcb){var _0x29b944=utils[_0x8405('0x8')](_0x9b3747);var _0x18a255='get'+_[_0x8405('0x62')](_0x9b3747)+(_0x9b3747==='chat'?_0x8405('0x63'):'Accounts');var _0x259383=squel[_0x8405('0x25')]();return Promise[_0x8405('0x64')]()[_0x8405('0x5e')](function(){if(_0x283dcb[_0x8405('0xb')]&&_0x3bbdc5['role']===_0x8405('0xa')){return _0x3bbdc5[_0x18a255]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x58fe94){if(_0x58fe94){if(_0x58fe94[_0x8405('0x16')]===0x0){_0x259383['and']('i.'+_0x29b944+_0x8405('0x5c'));}else{_0x259383[_0x8405('0x43')]('i.'+_0x29b944+_0x8405('0x18'),_['map'](_0x58fe94,'id'));}}else if(!_0x283dcb[_0x29b944]){_0x259383[_0x8405('0x43')]('i.'+_0x29b944+_0x8405('0x65'));}})[_0x8405('0x5e')](function(){return _0x259383;});}function getClosedOrderClause(_0x1f5c6e,_0x4662e5){var _0x378a61='';var _0x485af5=[_0x8405('0x66'),_0x8405('0x67'),_0x8405('0x68')];if(_0x1f5c6e==='mail'){_0x485af5['unshift'](_0x8405('0x69'));}if(_0x4662e5[_0x8405('0x6a')]==='0'&&_0x1f5c6e===_0x8405('0x31')){_0x378a61=_0x8405('0x69');}else{if(_0x4662e5[_0x8405('0x6a')]==='1'){_0x485af5['shift']();}_0x378a61='CONCAT_WS(\x27\x27,\x20'+_0x485af5['join'](',\x20')+')';}return _0x378a61;}function getFilteredInteractions(_0xef22de,_0x14a39b,_0x2ef75f,_0x3da720){var _0x3d4d55=utils[_0x8405('0x10')](_0xef22de);var _0x1a4861=_[_0x8405('0x62')](_0xef22de)+_0x8405('0x6b');var _0x23d94e=[];var _0xee56d=getTagsQuery();var _0x2a4d26={'type':db['Sequelize'][_0x8405('0x6c')][_0x8405('0x6d')],'raw':!![]};var _0x50c8e2=[];var _0x2b87ba=[];return db[_0x8405('0x6e')][_0x8405('0x6f')](_0xee56d[_0x8405('0x70')](),_0x2a4d26)[_0x8405('0x5e')](function(_0x4449bf){_0x23d94e=_[_0x8405('0x71')](_0x4449bf,'id');_0x2a4d26=_[_0x8405('0x72')](_0x2a4d26,{'model':db[_0x1a4861],'mapToModel':!![],'nest':!![]});if(_0x2ef75f[_0x8405('0x5f')]){_0x3da720['attributes'][_0x8405('0x27')](function(_0x4732dc){_0x14a39b[_0x8405('0xc')]('i.'+_0x4732dc);});}else{_0x14a39b['field'](_0x8405('0x73'),_0x8405('0x74'));_0x14a39b[_0x8405('0xc')](_0x8405('0x75'),_0x8405('0x76'));_0x14a39b['field'](_0x8405('0x77'),_0x8405('0x78'));if(_0xef22de===_0x8405('0x31')){_0x14a39b[_0x8405('0xc')](_0x8405('0x79'),_0x8405('0x7a'));_0x14a39b[_0x8405('0xc')](_0x8405('0x7b'),_0x8405('0x7c'));_0x14a39b['field'](_0x8405('0x7d'));_0x14a39b['field'](_0x8405('0x7e'));_0x14a39b[_0x8405('0xc')]('i.updatedAt');_0x14a39b['field']('i.closed');_0x14a39b['field'](_0x8405('0x7f'));_0x14a39b['field'](_0x8405('0x80'));_0x14a39b[_0x8405('0xc')](_0x8405('0x81'));_0x14a39b[_0x8405('0xc')](_0x8405('0x82'));_0x14a39b[_0x8405('0xc')](_0x8405('0x83'));_0x14a39b['field'](_0x8405('0x68'));_0x14a39b[_0x8405('0xc')]('i.secondDisposition');_0x14a39b['field']('i.thirdDisposition');_0x14a39b['field']('i.substatus');_0x14a39b['field'](_0x8405('0x84'));_0x14a39b[_0x8405('0xc')](_0x8405('0x85'));_0x14a39b[_0x8405('0xc')](_0x8405('0x86'));_0x14a39b['field'](_0x8405('0x87'));}else if(_0xef22de===_0x8405('0x30')){_0x14a39b[_0x8405('0xc')](_0x8405('0x88'),_0x8405('0x7c'));}else{_0x14a39b['field'](_0x8405('0x89'),_0x8405('0x7c'));}if(_0xef22de!==_0x8405('0x31')){_0x14a39b[_0x8405('0xc')](_0x8405('0x8a'));}_0x14a39b[_0x8405('0xc')](_0x8405('0x8b'),_0x8405('0x8c'));_0x14a39b['field'](_0x8405('0x8d'),_0x8405('0x8e'));_0x14a39b[_0x8405('0xc')](_0x8405('0x8f'),_0x8405('0x90'));_0x14a39b[_0x8405('0xc')](_0x8405('0x91'),_0x8405('0x92'));_0x14a39b[_0x8405('0xc')](_0x8405('0x93'),_0x8405('0x94'));_0x14a39b[_0x8405('0xc')](_0x8405('0x95'),_0x8405('0x96'));_0x14a39b[_0x8405('0xc')](_0x8405('0x97'),'Owner.fullname');_0x14a39b[_0x8405('0xc')](_0x8405('0x98'),_0x8405('0x99'));_0x14a39b['field'](_0x8405('0x9a'),_0x8405('0x9b'));}if(_0x3da720[_0x8405('0x9c')]){_0x14a39b[_0x8405('0x9c')](_0x3da720[_0x8405('0x9c')]);}if(_0x3da720[_0x8405('0x9d')]){_0x14a39b[_0x8405('0x9d')](_0x3da720[_0x8405('0x9d')]);}return db[_0x8405('0x6e')][_0x8405('0x6f')](_0x14a39b['toString'](),_0x2a4d26);})['then'](function(_0x467dcb){_0x50c8e2=_0x467dcb;var _0x468604=getUsersQuery(_0xef22de,_0x50c8e2);return db['sequelize'][_0x8405('0x6f')](_0x468604[_0x8405('0x70')](),_0x2a4d26);})[_0x8405('0x5e')](function(_0x4ae432){_0x2b87ba=_['groupBy'](_0x4ae432,_0x3d4d55);if(_0xef22de==='mail'){return db['Setting'][_0x8405('0x9e')]({'attributes':[_0x8405('0x9f')],'raw':!![]});}})[_0x8405('0x5e')](function(_0x5d6680){var _0x372e53=_0x5d6680?_0x5d6680[_0x8405('0x9f')]:undefined;var _0x44be49=_0x50c8e2[_0x8405('0x19')](function(_0x496893){return updateInteraction(_0x496893,_0x23d94e,_0x2b87ba,_0x372e53);});return Promise['all'](_0x44be49);});}function countFilteredInteractions(_0x31b673,_0x1f6114){var _0x5c588b=_0x31b673[_0x8405('0xa0')]();_0x5c588b[_0x8405('0xc')](_0x8405('0xa1'));_0x5c588b['field'](_0x8405('0x73'),_0x8405('0x74'));var _0x23022d=utils[_0x8405('0x26')](_0x1f6114);if(!_[_0x8405('0xa2')](_0x23022d)){_0x5c588b[_0x8405('0x17')](_0x8405('0xa3'),_0x23022d);}var _0x2ca863={'type':db[_0x8405('0xa4')][_0x8405('0x6c')]['SELECT'],'raw':!![]};return db[_0x8405('0x6e')][_0x8405('0x6f')](_0x5c588b[_0x8405('0x70')](),_0x2ca863);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x1339=['Setting','enableEmailPreview','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','getSelectedTags','where','t.id\x20IN\x20?','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','interactionsTags','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','{OPERATOR}','replace','i.id\x20LIKE\x20?','sms','includes','fax','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','type','default','text','value','start','unreadMessages','read','and','Contact','operator','$substring','contact','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','Tag','split','map','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','body','end','keys','some','compact','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','resolve','then','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','sequelize','query','keyBy','merge','fields','attributes','forEach','a.key','Account.key','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy'];(function(_0x2acc80,_0xb5eed4){var _0x3a4e77=function(_0x1f7e4f){while(--_0x1f7e4f){_0x2acc80['push'](_0x2acc80['shift']());}};_0x3a4e77(++_0xb5eed4);}(_0x1339,0x1ed));var _0x9133=function(_0x1b98b2,_0x330d50){_0x1b98b2=_0x1b98b2-0x0;var _0x43b463=_0x1339[_0x1b98b2];return _0x43b463;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x9133('0x0'));var qs=require(_0x9133('0x1'));var updateInteraction=require(_0x9133('0x2'))[_0x9133('0x3')];var utils=require(_0x9133('0x4'));var db=require(_0x9133('0x5'))['db'];function skipInteractionsQuery(_0x176e80,_0x110c51,_0x558345){var _0x578643=![];var _0x855473=utils[_0x9133('0x6')](_0x176e80);if(_0x110c51['role']===_0x9133('0x7')&&!_0x558345[_0x9133('0x8')]&&!_0x558345[_0x855473]){_0x578643=!![];}return _0x578643;}function getTagsQuery(){return squel[_0x9133('0x9')]()[_0x9133('0xa')]('id')[_0x9133('0xa')](_0x9133('0xb'))[_0x9133('0xa')](_0x9133('0xc'))[_0x9133('0xd')](_0x9133('0xe'));}function getUsersQuery(_0x4c4517,_0x3f9650){var _0x3533fa=utils[_0x9133('0xf')](_0x4c4517);var _0x452481=_0x9133('0x10')+_0x4c4517+_0x9133('0x11');var _0x5ef6b5=squel[_0x9133('0x9')]()[_0x9133('0xa')]('u.id')['field'](_0x9133('0x12'))['field'](_0x9133('0x13')+_0x3533fa)[_0x9133('0xd')](_0x452481,'ui')[_0x9133('0x14')](_0x9133('0x15'),'u',_0x9133('0x16'));if(_0x3f9650[_0x9133('0x17')]>0x0){_0x5ef6b5['where'](_0x9133('0x13')+_0x3533fa+_0x9133('0x18'),_['map'](_0x3f9650,'id'));}return _0x5ef6b5;}function getInteractionsQuery(_0x28ffcb){var _0xa46eb1=utils[_0x9133('0x19')](_0x28ffcb);var _0x427663=utils['getAccountFK'](_0x28ffcb);var _0x1f3484=utils['getInteractionFK'](_0x28ffcb);return squel[_0x9133('0x9')]()['from'](_0xa46eb1[_0x9133('0x1a')],'i')[_0x9133('0x14')]('cm_contacts','c',_0x9133('0x1b'))['left_join'](_0x9133('0x15'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xa46eb1[_0x9133('0x1c')],'a','a.id\x20=\x20i.'+_0x427663)[_0x9133('0x14')](_0xa46eb1['messages'],'me','me.'+_0x1f3484+'\x20=\x20i.id')[_0x9133('0x14')](_0xa46eb1[_0x9133('0x1d')],'it','it.'+_0x1f3484+_0x9133('0x1e'))[_0x9133('0x14')](_0x9133('0xe'),'t',_0x9133('0x1f'));}function getSqlClauses(){var _0x4f26e8={'body':squel[_0x9133('0x20')](),'contact':squel['expr'](),'default':squel[_0x9133('0x20')](),'fields':squel[_0x9133('0x20')](),'filter':squel[_0x9133('0x20')](),'read':squel[_0x9133('0x20')](),'tags':{'clause':squel[_0x9133('0x20')](),'ids':null},'user':squel[_0x9133('0x20')]()};return _0x4f26e8;}function parseTagParameter(_0x294332){var _0x313d43=squel[_0x9133('0x20')]();if(_0x294332){var _0x46050b=utils['getSelectedTags'](_0x294332);_0x46050b['forEach'](function(_0x477bf1){_0x313d43['or'](_0x9133('0x21'),'%,'+_0x477bf1+',%');});}return _0x313d43;}function parseReadParameter(_0x428e18){var _0x348486='';if(_0x428e18){_0x348486='unreadMessages\x20{OPERATOR}\x200';if(_0x428e18==='1'){_0x348486=_0x348486['replace'](_0x9133('0x22'),'=');}else{_0x348486=_0x348486[_0x9133('0x23')](_0x9133('0x22'),'>');}}return _0x348486;}function parseSearchFilter(_0x26d351,_0x390f50){var _0x88326c=squel['expr']();if(_0x390f50){var _0x58afe0=_0x390f50['replace']('\x5c','\x5c\x5c')[_0x9133('0x23')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x58afe0)){_0x88326c['or'](_0x9133('0x24'),_0x58afe0+'%');if([_0x9133('0x25'),'whatsapp'][_0x9133('0x26')](_0x26d351)){_0x88326c['or']('i.phone\x20LIKE\x20?',_0x58afe0+'%');}else if(_0x26d351===_0x9133('0x27')){_0x88326c['or'](_0x9133('0x28'),_0x58afe0+'%');}else if(_0x26d351===_0x9133('0x29')){_0x88326c['or']('i.from\x20LIKE\x20?',_0x58afe0+'%');}}else if(_0x26d351===_0x9133('0x2a')&&qs[_0x9133('0x2b')](_0x58afe0)){_0x88326c['or'](_0x9133('0x2c'),_0x58afe0+'%');}else{if(_0x26d351==='mail'){_0x88326c['or'](_0x9133('0x2d'),qs[_0x9133('0x2e')](_0x58afe0))['or'](_0x9133('0x2f'),qs['getFullTextValue'](_0x58afe0));}else{if(_0x26d351!==_0x9133('0x27')){_0x88326c['or'](_0x9133('0x30'),qs[_0x9133('0x2e')](_0x58afe0));}_0x88326c['or'](_0x9133('0x31'),_0x58afe0+'%');}}}return _0x88326c;}function parseAdvancedSearchFilter(_0x5e4d5e,_0x3ccd89){var _0xea26a3=getSqlClauses();var _0x56719e=as[_0x9133('0x32')](_0x5e4d5e);var _0x2d256a=_0x56719e[_0x9133('0x33')];for(var _0x2763f3=0x0;_0x2763f3<_0x56719e[_0x9133('0x34')][_0x9133('0x17')];_0x2763f3++){var _0x3e02d1=_0x56719e[_0x9133('0x34')][_0x2763f3];var _0x4172e3='i';var _0x335217=_[_0x9133('0x35')](_0x3ccd89,['name',_0x3e02d1[_0x9133('0xa')]]);if(_0x335217){var _0x2c2e16=as['buildExpression'](_0x4172e3,_0x335217[_0x9133('0x36')],_0x3e02d1);_0xea26a3[_0x9133('0x37')][_0x2d256a](_0x2c2e16[_0x9133('0x38')],_0x2c2e16[_0x9133('0x39')][_0x9133('0x3a')],_0x2c2e16[_0x9133('0x39')]['end']);}else{switch(_0x3e02d1['field']){case _0x9133('0x3b'):var _0x1eed2a=parseReadParameter(_0x3e02d1[_0x9133('0x39')]);_0xea26a3[_0x9133('0x3c')][_0x9133('0x3d')](_0x1eed2a);break;case _0x9133('0x3e'):if(_0x3e02d1[_0x9133('0x3f')]===_0x9133('0x40')){if(_0x3e02d1[_0x9133('0x39')]['split']('\x20')[_0x9133('0x17')]>0x1){_0xea26a3[_0x9133('0x41')][_0x2d256a](_0x9133('0x42'),qs[_0x9133('0x2e')](_0x3e02d1[_0x9133('0x39')]),null);}else{var _0x4c045e='%'+_0x3e02d1[_0x9133('0x39')]+'%';_0xea26a3[_0x9133('0x41')][_0x2d256a](_0x9133('0x43'),_0x4c045e,_0x4c045e,_0x4c045e);}}else{_0x335217=_[_0x9133('0x35')](_0x3ccd89,['name',_0x9133('0x44')]);_0x3e02d1[_0x9133('0xa')]=_0x9133('0x44');_0x2c2e16=as[_0x9133('0x45')](_0x4172e3,_0x335217[_0x9133('0x36')],_0x3e02d1);_0xea26a3[_0x9133('0x41')][_0x2d256a](_0x2c2e16[_0x9133('0x38')],_0x2c2e16['value'][_0x9133('0x3a')],_0x2c2e16['value']['end']);}break;case _0x9133('0x46'):var _0x1d564f=_0x3e02d1[_0x9133('0x39')][_0x9133('0x47')](',')[_0x9133('0x48')](function(_0x2d2bf7){return Number(_0x2d2bf7);});var _0x344120=parseTagParameter(_0x1d564f);_0xea26a3[_0x9133('0x49')][_0x9133('0x4a')]['and'](_0x344120);_0xea26a3[_0x9133('0x49')][_0x9133('0x4b')]=_0x1d564f;break;case _0x9133('0x4c'):if(_0x3e02d1['operator']==='$substring'){_0xea26a3[_0x9133('0x4d')][_0x2d256a](_0x9133('0x4e'),'%'+_0x3e02d1['value']+'%',null);}else{_0x335217=_[_0x9133('0x35')](_0x3ccd89,[_0x9133('0xb'),_0x9133('0x4f')]);_0x3e02d1[_0x9133('0xa')]=_0x9133('0x4f');_0x2c2e16=as['buildExpression'](_0x4172e3,_0x335217[_0x9133('0x36')],_0x3e02d1);_0xea26a3[_0x9133('0x4d')][_0x2d256a](_0x2c2e16[_0x9133('0x38')],_0x2c2e16['value'][_0x9133('0x3a')],_0x2c2e16[_0x9133('0x39')]['end']);}break;case'body':case _0x9133('0x50'):_0x2c2e16=as[_0x9133('0x45')]('me',null,_0x3e02d1);_0xea26a3[_0x9133('0x51')][_0x2d256a](_0x2c2e16[_0x9133('0x38')],_0x2c2e16[_0x9133('0x39')][_0x9133('0x3a')],_0x2c2e16[_0x9133('0x39')][_0x9133('0x52')]);break;}}}return _0xea26a3;}function parseModelFields(_0x23f134,_0xf07fbb,_0x3d6a49){var _0x2e4d97=utils['getAccountFK'](_0x23f134);var _0x4dc5ee=squel[_0x9133('0x20')]();var _0x4dc2f3=_(_0xf07fbb)[_0x9133('0x53')]()[_0x9133('0x48')](function(_0x6fbb11){return _[_0x9133('0x54')](_0x3d6a49,['name',_0x6fbb11])?_0x6fbb11:undefined;})[_0x9133('0x55')]()[_0x9133('0x39')]();if(_0x4dc2f3[_0x9133('0x17')]>0x0){_0x4dc2f3['forEach'](function(_0x2b0413){if(_0x2b0413===_0x2e4d97){_0x4dc5ee[_0x9133('0x3d')]('i.'+_0x2e4d97+_0x9133('0x18'),[]['concat'](_0xf07fbb[_0x2b0413]));}else if(_0x2b0413===_0x9133('0x56')){var _0x4f7b1e=JSON[_0x9133('0x57')](_0xf07fbb[_0x2b0413])[_0x9133('0x58')];var _0x304673=JSON[_0x9133('0x57')](_0xf07fbb[_0x2b0413])['$lte'];_0x4dc5ee['and'](_0x9133('0x59'),_0x4f7b1e,_0x304673);}else{if(_0xf07fbb[_0x2b0413]===_0x9133('0x5a')){_0x4dc5ee[_0x9133('0x3d')]('i.'+_0x2b0413+_0x9133('0x5b'));}else{_0x4dc5ee[_0x9133('0x3d')]('i.'+_0x2b0413+'\x20=\x20?',_0xf07fbb[_0x2b0413]);}}});}return _0x4dc5ee;}function parseQueryParameters(_0x554bb9,_0x33599b,_0x16f889){var _0x4abefd=getSqlClauses();return Promise[_0x9133('0x5c')]()[_0x9133('0x5d')](function(){return parseModelFields(_0x554bb9,_0x33599b,_0x16f889);})['then'](function(_0x508303){_0x4abefd['fields'][_0x9133('0x3d')](_0x508303);return parseReadParameter(_0x33599b['read']);})[_0x9133('0x5d')](function(_0x3c11b9){_0x4abefd[_0x9133('0x3c')][_0x9133('0x3d')](_0x3c11b9);return parseTagParameter(_0x33599b['tag']);})[_0x9133('0x5d')](function(_0x5e2536){_0x4abefd[_0x9133('0x49')][_0x9133('0x4a')][_0x9133('0x3d')](_0x5e2536);return parseSearchFilter(_0x554bb9,_0x33599b[_0x9133('0x5e')]);})[_0x9133('0x5d')](function(_0x3534bf){_0x4abefd['filter']=_0x3534bf;return _0x4abefd;});}function checkAccountsRestrictions(_0x55bc61,_0x50a657,_0xdb0dfa){var _0x204878=utils[_0x9133('0x6')](_0x55bc61);var _0x54a330=_0x9133('0x5f')+_[_0x9133('0x60')](_0x55bc61)+(_0x55bc61===_0x9133('0x61')?_0x9133('0x62'):_0x9133('0x63'));var _0x356103=squel[_0x9133('0x20')]();return Promise[_0x9133('0x5c')]()['then'](function(){if(_0xdb0dfa[_0x9133('0x8')]&&_0x50a657['role']===_0x9133('0x7')){return _0x50a657[_0x54a330]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x3a77be){if(_0x3a77be){if(_0x3a77be[_0x9133('0x17')]===0x0){_0x356103['and']('i.'+_0x204878+'\x20IS\x20NULL');}else{_0x356103[_0x9133('0x3d')]('i.'+_0x204878+_0x9133('0x18'),_[_0x9133('0x48')](_0x3a77be,'id'));}}else if(!_0xdb0dfa[_0x204878]){_0x356103[_0x9133('0x3d')]('i.'+_0x204878+_0x9133('0x64'));}})[_0x9133('0x5d')](function(){return _0x356103;});}function getClosedOrderClause(_0x3bd06b,_0x161938){var _0x13d5f4='';var _0x2e6e5c=[_0x9133('0x65'),'i.secondDisposition',_0x9133('0x66')];if(_0x3bd06b==='mail'){_0x2e6e5c[_0x9133('0x67')](_0x9133('0x68'));}if(_0x161938[_0x9133('0x69')]==='0'&&_0x3bd06b===_0x9133('0x2a')){_0x13d5f4=_0x9133('0x68');}else{if(_0x161938['closed']==='1'){_0x2e6e5c[_0x9133('0x6a')]();}_0x13d5f4=_0x9133('0x6b')+_0x2e6e5c[_0x9133('0x6c')](',\x20')+')';}return _0x13d5f4;}function getFilteredInteractions(_0x239f71,_0x47e968,_0x584bb7,_0x149626){var _0xcfcae2=utils[_0x9133('0xf')](_0x239f71);var _0x49be9d=_['capitalize'](_0x239f71)+_0x9133('0x6d');var _0x142d8e=[];var _0x23e4d1=getTagsQuery();var _0xeecd28={'type':db[_0x9133('0x6e')][_0x9133('0x6f')]['SELECT'],'raw':!![]};var _0x290f81=[];var _0x43566d=[];return db[_0x9133('0x70')][_0x9133('0x71')](_0x23e4d1['toString'](),_0xeecd28)[_0x9133('0x5d')](function(_0x54ddcd){_0x142d8e=_[_0x9133('0x72')](_0x54ddcd,'id');_0xeecd28=_[_0x9133('0x73')](_0xeecd28,{'model':db[_0x49be9d],'mapToModel':!![],'nest':!![]});if(_0x584bb7[_0x9133('0x74')]){_0x149626[_0x9133('0x75')][_0x9133('0x76')](function(_0x5a2c0d){_0x47e968[_0x9133('0xa')]('i.'+_0x5a2c0d);});}else{_0x47e968[_0x9133('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9133('0x3b'));_0x47e968[_0x9133('0xa')](_0x9133('0x77'),_0x9133('0x78'));_0x47e968[_0x9133('0xa')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x239f71==='mail'){_0x47e968[_0x9133('0xa')](_0x9133('0x79'),_0x9133('0x7a'));_0x47e968['field'](_0x9133('0x7b'),_0x9133('0x7c'));_0x47e968[_0x9133('0xa')](_0x9133('0x7d'));_0x47e968[_0x9133('0xa')](_0x9133('0x7e'));_0x47e968[_0x9133('0xa')](_0x9133('0x7f'));_0x47e968['field'](_0x9133('0x80'));_0x47e968[_0x9133('0xa')]('i.closedAt');_0x47e968[_0x9133('0xa')]('i.attach');_0x47e968[_0x9133('0xa')](_0x9133('0x81'));_0x47e968[_0x9133('0xa')](_0x9133('0x82'));_0x47e968[_0x9133('0xa')]('i.subject');_0x47e968[_0x9133('0xa')](_0x9133('0x66'));_0x47e968[_0x9133('0xa')](_0x9133('0x83'));_0x47e968['field'](_0x9133('0x65'));_0x47e968[_0x9133('0xa')](_0x9133('0x68'));_0x47e968[_0x9133('0xa')](_0x9133('0x84'));_0x47e968[_0x9133('0xa')](_0x9133('0x85'));_0x47e968[_0x9133('0xa')](_0x9133('0x86'));_0x47e968[_0x9133('0xa')](_0x9133('0x87'));}else if(_0x239f71==='openchannel'){_0x47e968[_0x9133('0xa')](_0x9133('0x88'),_0x9133('0x7c'));}else{_0x47e968[_0x9133('0xa')]('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',_0x9133('0x7c'));}if(_0x239f71!=='mail'){_0x47e968[_0x9133('0xa')](_0x9133('0x89'));}_0x47e968[_0x9133('0xa')]('c.firstName',_0x9133('0x8a'));_0x47e968[_0x9133('0xa')](_0x9133('0x8b'),'Contact.lastName');_0x47e968[_0x9133('0xa')](_0x9133('0x8c'),'Contact.email');_0x47e968[_0x9133('0xa')](_0x9133('0x8d'),_0x9133('0x8e'));_0x47e968['field'](_0x9133('0x8f'),'Contact.mobile');_0x47e968[_0x9133('0xa')](_0x9133('0x90'),_0x9133('0x91'));_0x47e968['field'](_0x9133('0x92'),'Owner.fullname');_0x47e968[_0x9133('0xa')](_0x9133('0x93'),_0x9133('0x94'));_0x47e968[_0x9133('0xa')](_0x9133('0x95'),_0x9133('0x96'));}if(_0x149626[_0x9133('0x97')]){_0x47e968[_0x9133('0x97')](_0x149626['limit']);}if(_0x149626[_0x9133('0x98')]){_0x47e968[_0x9133('0x98')](_0x149626[_0x9133('0x98')]);}return db[_0x9133('0x70')][_0x9133('0x71')](_0x47e968['toString'](),_0xeecd28);})[_0x9133('0x5d')](function(_0x1056d0){_0x290f81=_0x1056d0;var _0x1b66d0=getUsersQuery(_0x239f71,_0x290f81);return db[_0x9133('0x70')]['query'](_0x1b66d0[_0x9133('0x99')](),_0xeecd28);})['then'](function(_0x29a1d9){_0x43566d=_[_0x9133('0x9a')](_0x29a1d9,_0xcfcae2);if(_0x239f71===_0x9133('0x2a')){return db[_0x9133('0x9b')]['findOne']({'attributes':[_0x9133('0x9c')],'raw':!![]});}})[_0x9133('0x5d')](function(_0x6a9bbe){var _0x1e4db3=_0x6a9bbe?_0x6a9bbe[_0x9133('0x9c')]:undefined;var _0x4c02db=_0x290f81['map'](function(_0x52899b){return updateInteraction(_0x52899b,_0x142d8e,_0x43566d,_0x1e4db3);});return Promise['all'](_0x4c02db);});}function countFilteredInteractions(_0x47643b,_0xe6ceff){var _0x3d2f60=_0x47643b['clone']();_0x3d2f60[_0x9133('0xa')](_0x9133('0x9d'));_0x3d2f60[_0x9133('0xa')](_0x9133('0x9e'),_0x9133('0x3b'));var _0x572b77=utils[_0x9133('0x9f')](_0xe6ceff);if(!_['isEmpty'](_0x572b77)){_0x3d2f60[_0x9133('0xa0')](_0x9133('0xa1'),_0x572b77);}var _0x1faead={'type':db[_0x9133('0x6e')][_0x9133('0x6f')]['SELECT'],'raw':!![]};return db[_0x9133('0x70')][_0x9133('0x71')](_0x3d2f60[_0x9133('0x99')](),_0x1faead);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 5905d09..3834680 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bce=['then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','abandoned','UserId','disposition','unmanaged','total','MailMessage','out','plainBody','-id'];(function(_0xc8349,_0x1bbffe){var _0x1c342d=function(_0xfae706){while(--_0xfae706){_0xc8349['push'](_0xc8349['shift']());}};_0x1c342d(++_0x1bbffe);}(_0x4bce,0x174));var _0xe4bc=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x4bce[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var db=require(_0xe4bc('0x0'))['db'];function getInteractionUsers(_0xd0d9e7,_0x103b59){return new Promise(function(_0x2bdb7f,_0x875093){try{var _0x1151fc=[];if(_0x103b59[_0xd0d9e7]){_0x1151fc=_0x103b59[_0xd0d9e7][_0xe4bc('0x1')](function(_0xabab3){return{'id':_0xabab3['id'],'fullname':_0xabab3[_0xe4bc('0x2')]};});}return _0x2bdb7f(_0x1151fc);}catch(_0x121ce8){_0x875093(_0x121ce8);}});}function getInteractionTags(_0x2b6671,_0x78dce5){var _0x4570b0=[];if(_0x2b6671){_0x2b6671[_0xe4bc('0x3')](',')[_0xe4bc('0x4')](function(_0x4d1033){_0x4570b0[_0xe4bc('0x5')](_0x78dce5[_0x4d1033]);});}return _0x4570b0;}function updateWaitingCounter(_0x4f8652){if(_0x4f8652[_0xe4bc('0x6')]){_0x4f8652[_0xe4bc('0x6')]-=0x1;}}function updateInteractionCounters(_0x592827){_0x592827[_0xe4bc('0x6')]=0x0;_0x592827[_0xe4bc('0x7')]=0x0;_0x592827[_0xe4bc('0x8')]=0x0;_0x592827['unmanaged']=0x0;_0x592827[_0xe4bc('0x9')]=0x0;_0x592827['total']=0x0;if(_0x592827['closed']){if(_0x592827['disposition']===_0xe4bc('0x9')){_0x592827[_0xe4bc('0x9')]+=0x1;updateWaitingCounter(_0x592827);}if(_0x592827[_0xe4bc('0xa')]){_0x592827['answered']+=0x1;if(_0x592827[_0xe4bc('0x7')]){_0x592827[_0xe4bc('0x7')]-=0x1;}}else{if(_0x592827[_0xe4bc('0xb')]){_0x592827[_0xe4bc('0xc')]+=0x1;updateWaitingCounter(_0x592827);}}}else{if(!_0x592827[_0xe4bc('0xa')]){_0x592827['waiting']+=0x1;}if(_0x592827[_0xe4bc('0xa')]){_0x592827[_0xe4bc('0x7')]+=0x1;updateWaitingCounter(_0x592827);}}_0x592827[_0xe4bc('0xd')]+=0x1;return _0x592827;}function getLastMessageText(_0x28f9e8){return db[_0xe4bc('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x28f9e8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe4bc('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe4bc('0x10')],'order':_0xe4bc('0x11'),'raw':!![]})[_0xe4bc('0x12')](function(_0x58ce7a){if(_0x58ce7a&&_0x58ce7a[_0xe4bc('0x10')]){_0x28f9e8[_0xe4bc('0x13')]=_[_0xe4bc('0x14')](_0x58ce7a[_0xe4bc('0x10')]);}return _0x28f9e8;})[_0xe4bc('0x15')](function(_0x58e842){throw _0x58e842;});}exports[_0xe4bc('0x16')]=function(_0x555d60,_0x47baaa,_0x5b1b67,_0xaa90d2){return new Promise(function(_0x5bab19,_0x5275e3){return getInteractionUsers(_0x555d60['id'],_0x5b1b67)['then'](function(_0x5a6bfc){_0x555d60[_0xe4bc('0x17')]=_0x5a6bfc;return getInteractionTags(_0x555d60[_0xe4bc('0x18')],_0x47baaa);})[_0xe4bc('0x12')](function(_0x5b6e35){_0x555d60[_0xe4bc('0x19')]=_0x5b6e35;delete _0x555d60[_0xe4bc('0x18')];return updateInteractionCounters(_0x555d60);})[_0xe4bc('0x12')](function(_0x238c53){if(_0xaa90d2){return getLastMessageText(_0x238c53);}else{return _0x238c53;}})['then'](function(_0x177bc5){_0x5bab19(_0x177bc5);})['catch'](function(_0x579272){_0x5275e3(_0x579272);});});}; \ No newline at end of file +var _0x384b=['UserId','total','MailMessage','findOne','plainBody','-id','lastMsgText','trimStart','catch','updateInteraction','then','Users','TagIds','../../mysqldb','map','split','forEach','waiting','talking','answered','unmanaged','abandoned','disposition'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x384b,0x1f0));var _0xb384=function(_0x591e54,_0x4fcdb9){_0x591e54=_0x591e54-0x0;var _0x42d198=_0x384b[_0x591e54];return _0x42d198;};'use strict';var _=require('lodash');var db=require(_0xb384('0x0'))['db'];function getInteractionUsers(_0x22f227,_0x2e7dcf){return new Promise(function(_0x3c9e48,_0x322fbe){try{var _0x71c9e9=[];if(_0x2e7dcf[_0x22f227]){_0x71c9e9=_0x2e7dcf[_0x22f227][_0xb384('0x1')](function(_0x213949){return{'id':_0x213949['id'],'fullname':_0x213949['fullname']};});}return _0x3c9e48(_0x71c9e9);}catch(_0x2e59a4){_0x322fbe(_0x2e59a4);}});}function getInteractionTags(_0x5c862b,_0x1e805f){var _0x130ecf=[];if(_0x5c862b){_0x5c862b[_0xb384('0x2')](',')[_0xb384('0x3')](function(_0x5f008b){_0x130ecf['push'](_0x1e805f[_0x5f008b]);});}return _0x130ecf;}function updateWaitingCounter(_0x4dec4d){if(_0x4dec4d[_0xb384('0x4')]){_0x4dec4d[_0xb384('0x4')]-=0x1;}}function updateInteractionCounters(_0x6a67cb){_0x6a67cb['waiting']=0x0;_0x6a67cb[_0xb384('0x5')]=0x0;_0x6a67cb[_0xb384('0x6')]=0x0;_0x6a67cb[_0xb384('0x7')]=0x0;_0x6a67cb[_0xb384('0x8')]=0x0;_0x6a67cb['total']=0x0;if(_0x6a67cb['closed']){if(_0x6a67cb[_0xb384('0x9')]===_0xb384('0x8')){_0x6a67cb[_0xb384('0x8')]+=0x1;updateWaitingCounter(_0x6a67cb);}if(_0x6a67cb[_0xb384('0xa')]){_0x6a67cb['answered']+=0x1;if(_0x6a67cb['talking']){_0x6a67cb[_0xb384('0x5')]-=0x1;}}else{if(_0x6a67cb['disposition']){_0x6a67cb['unmanaged']+=0x1;updateWaitingCounter(_0x6a67cb);}}}else{if(!_0x6a67cb[_0xb384('0xa')]){_0x6a67cb[_0xb384('0x4')]+=0x1;}if(_0x6a67cb[_0xb384('0xa')]){_0x6a67cb[_0xb384('0x5')]+=0x1;updateWaitingCounter(_0x6a67cb);}}_0x6a67cb[_0xb384('0xb')]+=0x1;return _0x6a67cb;}function getLastMessageText(_0x449e8a){return db[_0xb384('0xc')][_0xb384('0xd')]({'where':{'$and':[{'MailInteractionId':_0x449e8a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb384('0xe')],'order':_0xb384('0xf'),'raw':!![]})['then'](function(_0x341942){if(_0x341942&&_0x341942[_0xb384('0xe')]){_0x449e8a[_0xb384('0x10')]=_[_0xb384('0x11')](_0x341942[_0xb384('0xe')]);}return _0x449e8a;})[_0xb384('0x12')](function(_0xe4fbb1){throw _0xe4fbb1;});}exports[_0xb384('0x13')]=function(_0x1f509b,_0x5d1052,_0x142af3,_0x1b70cd){return new Promise(function(_0x148420,_0x3d8dbe){return getInteractionUsers(_0x1f509b['id'],_0x142af3)[_0xb384('0x14')](function(_0x4bcbf3){_0x1f509b[_0xb384('0x15')]=_0x4bcbf3;return getInteractionTags(_0x1f509b[_0xb384('0x16')],_0x5d1052);})[_0xb384('0x14')](function(_0x156747){_0x1f509b['Tags']=_0x156747;delete _0x1f509b[_0xb384('0x16')];return updateInteractionCounters(_0x1f509b);})['then'](function(_0x610d7){if(_0x1b70cd){return getLastMessageText(_0x610d7);}else{return _0x610d7;}})[_0xb384('0x14')](function(_0x254559){_0x148420(_0x254559);})['catch'](function(_0x4e6874){_0x3d8dbe(_0x4e6874);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index f85615b..92328bf 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b91=['user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','error','lodash','../../mysqldb','../../config/logger','sms-interactions','chat-interactions','capitalize','Website','Account','InteractionId','upperFirst','unknown','chat','websites','_interactions','_messages'];(function(_0x596064,_0x5c7f39){var _0x3f8142=function(_0x4d5f7b){while(--_0x4d5f7b){_0x596064['push'](_0x596064['shift']());}};_0x3f8142(++_0x5c7f39);}(_0x5b91,0x87));var _0x15b9=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x5b91[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0x15b9('0x0'));var db=require(_0x15b9('0x1'))['db'];var loggers={'openchannel':require(_0x15b9('0x2'))('openchannel-interactions'),'mail':require(_0x15b9('0x2'))('mail-interactions'),'fax':require(_0x15b9('0x2'))('fax-interactions'),'sms':require(_0x15b9('0x2'))(_0x15b9('0x3')),'chat':require('../../config/logger')(_0x15b9('0x4')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x1c5cc1){return _[_0x15b9('0x5')](_0x1c5cc1)+(_0x1c5cc1==='chat'?_0x15b9('0x6'):_0x15b9('0x7'))+'Id';}function getInteractionFK(_0x1cca8f){return _[_0x15b9('0x5')](_0x1cca8f)+_0x15b9('0x8');}function getInteractionId(_0x55b465,_0x3a8be5,_0x3cb970){if(_0x55b465&&_0x55b465[_[_0x15b9('0x9')](_0x3cb970)+_0x15b9('0x8')]){return _0x55b465[_[_0x15b9('0x9')](_0x3cb970)+_0x15b9('0x8')];}else if(_0x55b465&&_0x55b465['id']){return _0x55b465['id'];}else if(_0x3a8be5&&_0x3a8be5['id']){return _0x3a8be5['id'];}else{return _0x15b9('0xa');}}function getInteractionsTables(_0x424cfa){return{'accounts':_0x424cfa+'_'+(_0x424cfa===_0x15b9('0xb')?_0x15b9('0xc'):'accounts'),'interactions':_0x424cfa+_0x15b9('0xd'),'interactionsTags':_0x424cfa+'_interaction_has_tags','messages':_0x424cfa+_0x15b9('0xe'),'userInteractions':_0x15b9('0xf')+_0x424cfa+_0x15b9('0xd')};}function getSelectedTags(_0x3878f0){var _0x44d84f=[];if(_0x3878f0){_0x44d84f=Array[_0x15b9('0x10')](_0x3878f0)?_0x3878f0:[_0x3878f0];}return _0x44d84f;}function log(_0x24c611,_0x1c08d9,_0x4c0b36,_0x34d374,_0x503c57,_0x3ad245){loggers[_0x503c57[_0x15b9('0x11')]()][_0x24c611](_0x15b9('0x12'),_0x3ad245[_0x15b9('0x13')](),_0x1c08d9?_0x1c08d9['id']:null,_0x1c08d9?_0x1c08d9[_0x15b9('0x14')]:null,_0x1c08d9?_0x1c08d9[_0x15b9('0x15')]:null,getInteractionId(_0x4c0b36,_0x34d374,_0x503c57),_0x4c0b36?JSON[_0x15b9('0x16')](_0x4c0b36):'null');}function updateUser(_0x5e79a6,_0x52e504,_0x329568,_0x2f41ef,_0x105464){db[_['upperFirst'](_0x2f41ef)+_0x15b9('0x17')][_0x15b9('0x18')]({'where':{'id':getInteractionId(_0x52e504,_0x329568,_0x2f41ef)}})[_0x15b9('0x19')](function(_0x2163f8){if(_0x2163f8){return _0x2163f8[_0x15b9('0x1a')]({'UserId':_0x5e79a6?_0x5e79a6['id']:null});}})[_0x15b9('0x19')](function(_0x37a653){if(_0x37a653){log(_0x15b9('0x1b'),_0x5e79a6,_0x52e504,_0x329568,_0x2f41ef,_0x105464);}})[_0x15b9('0x1c')](function(){log(_0x15b9('0x1d'),_0x5e79a6,_0x52e504,_0x329568,_0x2f41ef,_0x105464);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xce30=['unknown','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','null','upperFirst','Interaction','findOne','then','update','catch','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId'];(function(_0x2042c2,_0xe3a18){var _0x5a61bc=function(_0xa0e5f1){while(--_0xa0e5f1){_0x2042c2['push'](_0x2042c2['shift']());}};_0x5a61bc(++_0xe3a18);}(_0xce30,0x1e3));var _0x0ce3=function(_0x247ada,_0x1e4bef){_0x247ada=_0x247ada-0x0;var _0x4c15fa=_0xce30[_0x247ada];return _0x4c15fa;};'use strict';var _=require(_0x0ce3('0x0'));var db=require(_0x0ce3('0x1'))['db'];var loggers={'openchannel':require(_0x0ce3('0x2'))(_0x0ce3('0x3')),'mail':require(_0x0ce3('0x2'))(_0x0ce3('0x4')),'fax':require(_0x0ce3('0x2'))(_0x0ce3('0x5')),'sms':require(_0x0ce3('0x2'))(_0x0ce3('0x6')),'chat':require(_0x0ce3('0x2'))('chat-interactions'),'whatsapp':require(_0x0ce3('0x2'))(_0x0ce3('0x7'))};function getAccountFK(_0x627927){return _[_0x0ce3('0x8')](_0x627927)+(_0x627927===_0x0ce3('0x9')?_0x0ce3('0xa'):_0x0ce3('0xb'))+'Id';}function getInteractionFK(_0x367364){return _[_0x0ce3('0x8')](_0x367364)+'InteractionId';}function getInteractionId(_0x1639df,_0x5ef59e,_0x217b97){if(_0x1639df&&_0x1639df[_['upperFirst'](_0x217b97)+_0x0ce3('0xc')]){return _0x1639df[_['upperFirst'](_0x217b97)+'InteractionId'];}else if(_0x1639df&&_0x1639df['id']){return _0x1639df['id'];}else if(_0x5ef59e&&_0x5ef59e['id']){return _0x5ef59e['id'];}else{return _0x0ce3('0xd');}}function getInteractionsTables(_0x28ecdb){return{'accounts':_0x28ecdb+'_'+(_0x28ecdb===_0x0ce3('0x9')?'websites':'accounts'),'interactions':_0x28ecdb+_0x0ce3('0xe'),'interactionsTags':_0x28ecdb+_0x0ce3('0xf'),'messages':_0x28ecdb+_0x0ce3('0x10'),'userInteractions':_0x0ce3('0x11')+_0x28ecdb+'_interactions'};}function getSelectedTags(_0x4d8ba3){var _0x542ea3=[];if(_0x4d8ba3){_0x542ea3=Array[_0x0ce3('0x12')](_0x4d8ba3)?_0x4d8ba3:[_0x4d8ba3];}return _0x542ea3;}function log(_0x131a8f,_0x4da5c8,_0x4fadba,_0x348b3e,_0x1aca77,_0xf252df){loggers[_0x1aca77[_0x0ce3('0x13')]()][_0x131a8f](_0x0ce3('0x14'),_0xf252df[_0x0ce3('0x15')](),_0x4da5c8?_0x4da5c8['id']:null,_0x4da5c8?_0x4da5c8[_0x0ce3('0x16')]:null,_0x4da5c8?_0x4da5c8['role']:null,getInteractionId(_0x4fadba,_0x348b3e,_0x1aca77),_0x4fadba?JSON['stringify'](_0x4fadba):_0x0ce3('0x17'));}function updateUser(_0x512548,_0x2bbb5a,_0x2eeea8,_0x413868,_0x6884ae){db[_[_0x0ce3('0x18')](_0x413868)+_0x0ce3('0x19')][_0x0ce3('0x1a')]({'where':{'id':getInteractionId(_0x2bbb5a,_0x2eeea8,_0x413868)}})[_0x0ce3('0x1b')](function(_0x304697){if(_0x304697){return _0x304697[_0x0ce3('0x1c')]({'UserId':_0x512548?_0x512548['id']:null});}})[_0x0ce3('0x1b')](function(_0xb08dff){if(_0xb08dff){log('info',_0x512548,_0x2bbb5a,_0x2eeea8,_0x413868,_0x6884ae);}})[_0x0ce3('0x1d')](function(){log(_0x0ce3('0x1e'),_0x512548,_0x2bbb5a,_0x2eeea8,_0x413868,_0x6884ae);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index ac49d37..b2c1bb2 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 _0x5432=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware'];(function(_0x2cc437,_0xa4845e){var _0x52258a=function(_0x4d43fd){while(--_0x4d43fd){_0x2cc437['push'](_0x2cc437['shift']());}};_0x52258a(++_0xa4845e);}(_0x5432,0xc8));var _0x2543=function(_0x1ab730,_0x8ca705){_0x1ab730=_0x1ab730-0x0;var _0x105bb6=_0x5432[_0x1ab730];return _0x105bb6;};'use strict';var crypto=require(_0x2543('0x0'));var util=require(_0x2543('0x1'));var compose=require(_0x2543('0x2'));var db=require(_0x2543('0x3'))['db'];var config=require(_0x2543('0x4'));function getValueFromLicense(_0x436249,_0x1ce931){if(_0x436249&&_0x1ce931){if(_0x1ce931[_0x2543('0x5')]&&_0x1ce931[_0x2543('0x6')]){var _0x337443=_0x1ce931[_0x2543('0x5')];var _0x36f85e=_0x1ce931[_0x2543('0x6')];var _0x5325b3=_0x337443[_0x2543('0x7')]('-')[0x4];var _0x989700=_0x337443[_0x2543('0x7')]('-')[0x0];var _0x9d3609=crypto[_0x2543('0x8')](_0x2543('0x9'),util[_0x2543('0xa')](_0x2543('0xb'),_0x5325b3,_0x337443,_0x989700));var _0x596913=_0x9d3609[_0x2543('0xc')](_0x36f85e,_0x2543('0xd'),'utf8');_0x596913+=_0x9d3609[_0x2543('0xe')](_0x2543('0xf'));var _0x5eef94=JSON[_0x2543('0x10')](_0x596913);return _0x5eef94[_0x2543('0x11')](_0x436249)?_0x5eef94[_0x436249]:null;}}return null;}function isLimit(_0x1a9349,_0xc85a26,_0x1f5aa8,_0x54ea21){var _0x32bf98=_0xc85a26;return compose()[_0x2543('0x12')](function(_0xf982fb,_0x5f3d01,_0x45e9f5){return db[_0x2543('0x13')][_0x2543('0x14')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x595477){var _0x1a6d2a=getValueFromLicense(_0x1a9349,_0x595477);return _0x1a6d2a?_0x1a6d2a:_0x32bf98;})[_0x2543('0x15')](function(_0x514c69){_0x32bf98=_0x514c69;return _0x1f5aa8[_0x2543('0x16')](_0x54ea21);})['then'](function(_0x353c7f){if(_0x353c7f>=_0x32bf98){return _0x5f3d01[_0x2543('0x17')](0x193)['json']({'message':util[_0x2543('0xa')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1a9349)});}_0x45e9f5();})[_0x2543('0x18')](function(_0x5181cf){_0x45e9f5(_0x5181cf);});});}function isUserLimit(){return isLimit(_0x2543('0x19'),0x1,db['User'],{'where':{'$or':[{'role':_0x2543('0x1a')},{'role':_0x2543('0x1b')}]}});}exports[_0x2543('0x1c')]=isUserLimit; \ No newline at end of file +var _0xf151=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','hasOwnProperty','use','License','findOne','then','count'];(function(_0x1b103a,_0x3ae0f3){var _0x241579=function(_0x535c47){while(--_0x535c47){_0x1b103a['push'](_0x1b103a['shift']());}};_0x241579(++_0x3ae0f3);}(_0xf151,0x1c2));var _0x1f15=function(_0x4b470a,_0x2b65bd){_0x4b470a=_0x4b470a-0x0;var _0x5d519b=_0xf151[_0x4b470a];return _0x5d519b;};'use strict';var crypto=require(_0x1f15('0x0'));var util=require(_0x1f15('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5d3d2a,_0x5989ec){if(_0x5d3d2a&&_0x5989ec){if(_0x5989ec[_0x1f15('0x2')]&&_0x5989ec[_0x1f15('0x3')]){var _0x2c3044=_0x5989ec['data1'];var _0x1730f3=_0x5989ec[_0x1f15('0x3')];var _0x5758d1=_0x2c3044[_0x1f15('0x4')]('-')[0x4];var _0x3c4bc0=_0x2c3044[_0x1f15('0x4')]('-')[0x0];var _0x38b787=crypto[_0x1f15('0x5')](_0x1f15('0x6'),util[_0x1f15('0x7')](_0x1f15('0x8'),_0x5758d1,_0x2c3044,_0x3c4bc0));var _0x3f5311=_0x38b787[_0x1f15('0x9')](_0x1730f3,_0x1f15('0xa'),'utf8');_0x3f5311+=_0x38b787['final'](_0x1f15('0xb'));var _0x295492=JSON['parse'](_0x3f5311);return _0x295492[_0x1f15('0xc')](_0x5d3d2a)?_0x295492[_0x5d3d2a]:null;}}return null;}function isLimit(_0x213353,_0x5ddc85,_0x45f594,_0x3cf3ce){var _0x36e004=_0x5ddc85;return compose()[_0x1f15('0xd')](function(_0x10e198,_0x156a3d,_0xe1371d){return db[_0x1f15('0xe')][_0x1f15('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x1f15('0x10')](function(_0x1759eb){var _0x482da2=getValueFromLicense(_0x213353,_0x1759eb);return _0x482da2?_0x482da2:_0x36e004;})[_0x1f15('0x10')](function(_0x3cd5c5){_0x36e004=_0x3cd5c5;return _0x45f594[_0x1f15('0x11')](_0x3cf3ce);})[_0x1f15('0x10')](function(_0x57ddd7){if(_0x57ddd7>=_0x36e004){return _0x156a3d['status'](0x193)[_0x1f15('0x12')]({'message':util[_0x1f15('0x7')](_0x1f15('0x13'),_0x213353)});}_0xe1371d();})[_0x1f15('0x14')](function(_0x1c5a44){_0xe1371d(_0x1c5a44);});});}function isUserLimit(){return isLimit(_0x1f15('0x15'),0x1,db[_0x1f15('0x16')],{'where':{'$or':[{'role':_0x1f15('0x17')},{'role':_0x1f15('0x18')}]}});}exports[_0x1f15('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 08bdc22..590d1ef 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 _0xcc4e=['split','length','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','operator','$eq','$between','value','includes','$gt','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','$in','NOT\x20IN\x20?','<>\x20?','$endsWith','LIKE\x20?','$lt','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','DATE','utcOffset','add','minutes','seconds','lodash','sqlOperator','[$or]','[$and]','replace'];(function(_0x55ad58,_0x44c12f){var _0x471b98=function(_0x52a1cd){while(--_0x52a1cd){_0x55ad58['push'](_0x55ad58['shift']());}};_0x471b98(++_0x44c12f);}(_0xcc4e,0x91));var _0xecc4=function(_0x413a10,_0x484258){_0x413a10=_0x413a10-0x0;var _0x2fcc77=_0xcc4e[_0x413a10];return _0x2fcc77;};'use strict';var _=require(_0xecc4('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x14a46a){var _0x5397c0={'conditions':[]};_0x5397c0[_0xecc4('0x1')]=_['startsWith'](_0x14a46a,_0xecc4('0x2'))?'or':'and';var _0x1bd010=_0x14a46a['replace'](_0xecc4('0x3'),'')[_0xecc4('0x4')]('[$or]','')[_0xecc4('0x5')]('||');for(var _0x3729f8=0x0;_0x3729f8<_0x1bd010[_0xecc4('0x6')];_0x3729f8++){var _0x562a7a=_0x1bd010[_0x3729f8][_0xecc4('0x5')](':=');var _0x4dcad5=_0x562a7a[0x0];var _0x564dca=_0x562a7a['slice'](0x1);_0x564dca[_0xecc4('0x7')](function(_0x1856df){var _0x369749=_0x1856df[_0xecc4('0x5')]('[')[_0xecc4('0x8')]();var _0x50a62b=_0x1856df[_0xecc4('0x9')](/\[(.*?)\]/g);_0x50a62b[_0xecc4('0x7')](function(_0x123203){var _0x3d9e0c=_0x123203[_0xecc4('0x5')]('[')[_0xecc4('0xa')](function(_0x5047d6){return _0x5047d6[_0xecc4('0xb')](']')>-0x1;})[_0xecc4('0xc')](function(_0x3dcebe){return _0x3dcebe['split'](']')[0x0];})[0x0];_0x5397c0[_0xecc4('0xd')][_0xecc4('0xe')]({'field':_0x4dcad5,'operator':_0x369749,'value':_0x3d9e0c});});});}return _0x5397c0;};exports[_0xecc4('0xf')]=function(_0x2031e3,_0x2cc53a,_0x595608){var _0xd2b25={};if(_0x2cc53a==='DATE'){if(_0x595608[_0xecc4('0x10')]===_0xecc4('0x11')){_0x595608[_0xecc4('0x10')]=_0xecc4('0x12');_0x595608[_0xecc4('0x13')]+=','+_0x595608['value'];}else if(_[_0xecc4('0x14')]([_0xecc4('0x15'),'$lte'],_0x595608['operator'])){_0x595608[_0xecc4('0x13')]=moment(_0x595608[_0xecc4('0x13')])['add'](0x1,_0xecc4('0x16'))[_0xecc4('0x17')](_0xecc4('0x18'));}}if(_0x595608[_0xecc4('0x19')]){_0x2cc53a=_0x595608[_0xecc4('0x19')];_0xd2b25[_0xecc4('0x1a')]=_0xecc4('0x1b')+_0x2031e3+'.'+_0x595608[_0xecc4('0x1c')]+'\x20AS\x20'+_0x595608['castTo']+')\x20'+parseOperator(_0x595608[_0xecc4('0x10')]);}else{_0xd2b25[_0xecc4('0x1a')]=_0x2031e3+'.'+_0x595608[_0xecc4('0x1c')]+'\x20'+parseOperator(_0x595608[_0xecc4('0x10')]);}if(_[_0xecc4('0x14')]([_0xecc4('0x1d'),_0xecc4('0x1e')],_0x595608['operator']))_0xd2b25['text']='('+_0xd2b25[_0xecc4('0x1a')]+_0xecc4('0x1f')+_0x2031e3+'.'+_0x595608[_0xecc4('0x1c')]+'\x20IS\x20NULL)';_0xd2b25[_0xecc4('0x13')]=parseValue(_0x2cc53a,_0x595608['operator'],_0x595608[_0xecc4('0x13')]);return _0xd2b25;};function parseOperator(_0x1cedb8){var _0xf7f084;switch(_0x1cedb8){case _0xecc4('0x20'):_0xf7f084='IN\x20?';break;case _0xecc4('0x1e'):_0xf7f084=_0xecc4('0x21');break;case _0xecc4('0x11'):_0xf7f084='=\x20?';break;case _0xecc4('0x1d'):_0xf7f084=_0xecc4('0x22');break;case'$substring':case'$startsWith':case _0xecc4('0x23'):_0xf7f084=_0xecc4('0x24');break;case _0xecc4('0x25'):_0xf7f084='<\x20?';break;case'$gt':_0xf7f084='>\x20?';break;case _0xecc4('0x26'):_0xf7f084=_0xecc4('0x27');break;case _0xecc4('0x28'):_0xf7f084=_0xecc4('0x29');break;case _0xecc4('0x12'):_0xf7f084=_0xecc4('0x2a');break;}return _0xf7f084;}function parseValue(_0x469975,_0x105e4f,_0x1e6775){var _0xad50fe={'start':undefined,'end':undefined};switch(_0x105e4f){case _0xecc4('0x20'):case _0xecc4('0x1e'):_0xad50fe[_0xecc4('0x2b')]=_0x1e6775[_0xecc4('0x5')](',');break;case _0xecc4('0x2c'):_0xad50fe[_0xecc4('0x2b')]='%'+_0x1e6775+'%';break;case'$startsWith':_0xad50fe[_0xecc4('0x2b')]=_0x1e6775+'%';break;case _0xecc4('0x23'):_0xad50fe[_0xecc4('0x2b')]='%'+_0x1e6775;break;case _0xecc4('0x12'):var _0xf66be3=_0x1e6775[_0xecc4('0x5')](',');var _0x1e6775=_0xf66be3[_0xecc4('0x8')]();var _0x1b9776=_0xf66be3['pop']();if(_0x469975===_0xecc4('0x2d')){_0x1e6775=moment(_0x1e6775)['utcOffset'](0x0,!![])[_0xecc4('0x17')]();_0x1b9776=moment(_0x1b9776)[_0xecc4('0x2e')](0x0,!![])[_0xecc4('0x2f')](0x17,'hours')['add'](0x3b,_0xecc4('0x30'))[_0xecc4('0x2f')](0x3b,_0xecc4('0x31'))[_0xecc4('0x17')]();}_0xad50fe={'start':_0x1e6775,'end':_0x1b9776};break;default:_0xad50fe[_0xecc4('0x2b')]=_0x1e6775;break;}return _0xad50fe;} \ No newline at end of file +var _0x2a2f=['YYYY-MM-DD','castTo','text','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$ne','<\x20?','$gt','>\x20?','<=\x20?','BETWEEN\x20?\x20AND\x20?','$substring','start','$startsWith','$endsWith','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','add','days','format'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x2a2f,0x1d1));var _0xf2a2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2a2f[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf2a2('0x0'));var moment=require(_0xf2a2('0x1'));exports[_0xf2a2('0x2')]=function(_0x41ab1a){var _0x1b27b9={'conditions':[]};_0x1b27b9[_0xf2a2('0x3')]=_[_0xf2a2('0x4')](_0x41ab1a,'[$or]')?'or':_0xf2a2('0x5');var _0x44f460=_0x41ab1a[_0xf2a2('0x6')](_0xf2a2('0x7'),'')['replace'](_0xf2a2('0x8'),'')[_0xf2a2('0x9')]('||');for(var _0x406f79=0x0;_0x406f79<_0x44f460[_0xf2a2('0xa')];_0x406f79++){var _0x3a8549=_0x44f460[_0x406f79][_0xf2a2('0x9')](':=');var _0x520905=_0x3a8549[0x0];var _0x22cce5=_0x3a8549[_0xf2a2('0xb')](0x1);_0x22cce5[_0xf2a2('0xc')](function(_0x5332df){var _0x147984=_0x5332df[_0xf2a2('0x9')]('[')[_0xf2a2('0xd')]();var _0x137109=_0x5332df[_0xf2a2('0xe')](/\[(.*?)\]/g);_0x137109[_0xf2a2('0xc')](function(_0x2d7fb2){var _0x3fb97e=_0x2d7fb2['split']('[')['filter'](function(_0x27fabf){return _0x27fabf[_0xf2a2('0xf')](']')>-0x1;})[_0xf2a2('0x10')](function(_0x3cd5b3){return _0x3cd5b3['split'](']')[0x0];})[0x0];_0x1b27b9[_0xf2a2('0x11')][_0xf2a2('0x12')]({'field':_0x520905,'operator':_0x147984,'value':_0x3fb97e});});});}return _0x1b27b9;};exports[_0xf2a2('0x13')]=function(_0x314374,_0x4ad74c,_0x22482e){var _0x2cdddd={};if(_0x4ad74c===_0xf2a2('0x14')){if(_0x22482e[_0xf2a2('0x15')]===_0xf2a2('0x16')){_0x22482e[_0xf2a2('0x15')]=_0xf2a2('0x17');_0x22482e[_0xf2a2('0x18')]+=','+_0x22482e[_0xf2a2('0x18')];}else if(_[_0xf2a2('0x19')](['$gt',_0xf2a2('0x1a')],_0x22482e[_0xf2a2('0x15')])){_0x22482e[_0xf2a2('0x18')]=moment(_0x22482e[_0xf2a2('0x18')])[_0xf2a2('0x1b')](0x1,_0xf2a2('0x1c'))[_0xf2a2('0x1d')](_0xf2a2('0x1e'));}}if(_0x22482e[_0xf2a2('0x1f')]){_0x4ad74c=_0x22482e['castTo'];_0x2cdddd[_0xf2a2('0x20')]='CAST('+_0x314374+'.'+_0x22482e[_0xf2a2('0x21')]+_0xf2a2('0x22')+_0x22482e[_0xf2a2('0x1f')]+')\x20'+parseOperator(_0x22482e[_0xf2a2('0x15')]);}else{_0x2cdddd['text']=_0x314374+'.'+_0x22482e[_0xf2a2('0x21')]+'\x20'+parseOperator(_0x22482e['operator']);}if(_[_0xf2a2('0x19')](['$ne',_0xf2a2('0x23')],_0x22482e[_0xf2a2('0x15')]))_0x2cdddd[_0xf2a2('0x20')]='('+_0x2cdddd[_0xf2a2('0x20')]+_0xf2a2('0x24')+_0x314374+'.'+_0x22482e[_0xf2a2('0x21')]+_0xf2a2('0x25');_0x2cdddd[_0xf2a2('0x18')]=parseValue(_0x4ad74c,_0x22482e['operator'],_0x22482e[_0xf2a2('0x18')]);return _0x2cdddd;};function parseOperator(_0x534e4a){var _0x439825;switch(_0x534e4a){case _0xf2a2('0x26'):_0x439825='IN\x20?';break;case _0xf2a2('0x23'):_0x439825=_0xf2a2('0x27');break;case'$eq':_0x439825='=\x20?';break;case _0xf2a2('0x28'):_0x439825='<>\x20?';break;case'$substring':case'$startsWith':case'$endsWith':_0x439825='LIKE\x20?';break;case'$lt':_0x439825=_0xf2a2('0x29');break;case _0xf2a2('0x2a'):_0x439825=_0xf2a2('0x2b');break;case _0xf2a2('0x1a'):_0x439825=_0xf2a2('0x2c');break;case'$gte':_0x439825='>=\x20?';break;case _0xf2a2('0x17'):_0x439825=_0xf2a2('0x2d');break;}return _0x439825;}function parseValue(_0xb6a7a,_0x147289,_0x4f269f){var _0x3e60ba={'start':undefined,'end':undefined};switch(_0x147289){case _0xf2a2('0x26'):case _0xf2a2('0x23'):_0x3e60ba['start']=_0x4f269f[_0xf2a2('0x9')](',');break;case _0xf2a2('0x2e'):_0x3e60ba[_0xf2a2('0x2f')]='%'+_0x4f269f+'%';break;case _0xf2a2('0x30'):_0x3e60ba[_0xf2a2('0x2f')]=_0x4f269f+'%';break;case _0xf2a2('0x31'):_0x3e60ba[_0xf2a2('0x2f')]='%'+_0x4f269f;break;case'$between':var _0x251477=_0x4f269f[_0xf2a2('0x9')](',');var _0x4f269f=_0x251477[_0xf2a2('0xd')]();var _0x2ab207=_0x251477[_0xf2a2('0x32')]();if(_0xb6a7a===_0xf2a2('0x14')){_0x4f269f=moment(_0x4f269f)[_0xf2a2('0x33')](0x0,!![])[_0xf2a2('0x1d')]();_0x2ab207=moment(_0x2ab207)['utcOffset'](0x0,!![])[_0xf2a2('0x1b')](0x17,_0xf2a2('0x34'))[_0xf2a2('0x1b')](0x3b,_0xf2a2('0x35'))[_0xf2a2('0x1b')](0x3b,_0xf2a2('0x36'))[_0xf2a2('0x1d')]();}_0x3e60ba={'start':_0x4f269f,'end':_0x2ab207};break;default:_0x3e60ba['start']=_0x4f269f;break;}return _0x3e60ba;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index adfec41..da124ba 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 _0x7dfd=['col','unsigned','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','getFullTextValue','replace','match','push','join','getOptions','query','$id','model','intersection','fields','attributes','offset','order','where','object','filter','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','substr','DESC'];(function(_0x25f4c1,_0xb8af38){var _0x498b1e=function(_0xa98742){while(--_0xa98742){_0x25f4c1['push'](_0x25f4c1['shift']());}};_0x498b1e(++_0xb8af38);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var sequelize=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2d48e6){var _0x346f5f=['ne'];try{var _0x28c3c9=JSON[_0xd7df('0x3')](_0x2d48e6);var _0x38eee7=Object[_0xd7df('0x4')](_0x28c3c9)[0x0];return _0x346f5f[_0xd7df('0x5')](_0x38eee7);}catch(_0x65a0b6){return![];}}function getOperatorValue(_0x3304f9){var _0x36cf0f=JSON[_0xd7df('0x3')](_0x3304f9);var _0x354ea7=Object[_0xd7df('0x4')](_0x36cf0f)[0x0];var _0x2c48a4=_0x36cf0f[_0x354ea7];return{['$'+_0x354ea7]:_0x2c48a4};}exports['fields']=function(_0xab6742){var _0xb3557a=null;if(_0xab6742){_0xb3557a=_0xab6742[_0xd7df('0x6')](',');}return _0xb3557a;};exports[_0xd7df('0x7')]=function(_0x5e59c3,_0x32c5b5){var _0x532c14={};if(!_[_0xd7df('0x8')](_0x5e59c3)){_['forOwn'](_0x5e59c3,function(_0x394d32,_0x82f1c0){try{if(_0x32c5b5){var _0x28d358=_[_0xd7df('0x9')](_0x32c5b5,{'name':_0x82f1c0})||{};if(hasSequelizeOperator(_0x394d32)){_0x532c14[_0x82f1c0]=getOperatorValue(_0x394d32);}else if(_0x28d358[_0xd7df('0xa')]===_0xd7df('0xb')&&_[_0xd7df('0xc')](_0x394d32)){var _0x3da618=JSON[_0xd7df('0x3')](_0x394d32);var _0x4d6f17={'$gte':moment(moment(_0x3da618[_0xd7df('0xd')])[_0xd7df('0xe')](_0xd7df('0xf')))[_0xd7df('0x10')]()[_0xd7df('0xe')](),'$lte':moment(moment(_0x3da618[_0xd7df('0x11')])[_0xd7df('0xe')]('YYYY-MM-DD'))[_0xd7df('0x10')]()[_0xd7df('0x12')](0x1,'s')['format']()};_0x532c14[_0x82f1c0]=_0x4d6f17;}else if(_0x28d358[_0xd7df('0x13')]===_0xd7df('0x14')){_0x532c14[_0x82f1c0]=_0x394d32;}else{_0x532c14[_0x82f1c0]=_['isArray'](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}else{_0x532c14[_0x82f1c0]=_[_0xd7df('0x15')](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}catch(_0x5210e5){_0x532c14[_0x82f1c0]=_0x394d32[_0xd7df('0x6')](',');}});}return _0x532c14;};exports[_0xd7df('0x16')]=function(_0x3cea3){_0x3cea3=parseInt(_0x3cea3,0xa);if(!_0x3cea3||_0x3cea3<0x0){_0x3cea3=LIMIT_VALUE;}return _0x3cea3;};exports['offset']=function(_0x96d86e){_0x96d86e=parseInt(_0x96d86e,0xa);if(!_0x96d86e||_0x96d86e<0x0){_0x96d86e=0x0;}return _0x96d86e;};exports[_0xd7df('0x17')]=function(_0x4e1985){var _0x5acb0a,_0x4188af=null;if(_0x4e1985){_0x5acb0a=_0x4e1985['split'](',');_0x4188af=_[_0xd7df('0x18')](_0x5acb0a,function(_0x5ab737){if(_0x5ab737[_0xd7df('0x19')]('-')===0x0){return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize['col'](_0xd7df('0x1a')),'unsigned'):_0x5ab737[_0xd7df('0x1c')](0x1),_0xd7df('0x1d')];}else{return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize[_0xd7df('0x1e')](_0xd7df('0x1a')),_0xd7df('0x1f')):_0x5ab737,'ASC'];}});}return _0x4188af;};exports['omit']=function(_0x36f2bd,_0x38db14){if(_[_0xd7df('0x8')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x15')](_0x36f2bd)){for(var _0x13f190=0x0;_0x13f190<_0x36f2bd[_0xd7df('0x20')];_0x13f190+=0x1){_0x36f2bd[_0x13f190]=this[_0xd7df('0x21')](_0x36f2bd[_0x13f190],_0x38db14);}return _0x36f2bd;}if(!_[_0xd7df('0x22')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x23')](_0x38db14)){_0x38db14=[_0x38db14];}if(!_['isArray'](_0x38db14)){return _0x36f2bd;}for(var _0xe53f53=0x0;_0xe53f53<_0x38db14[_0xd7df('0x20')];_0xe53f53+=0x1){_[_0xd7df('0x24')](_0x36f2bd,_0x38db14[_0xe53f53]);}for(var _0x29f0e8 in _0x36f2bd){if(_0x36f2bd[_0xd7df('0x25')](_0x29f0e8)){_0x36f2bd[_0x29f0e8]=this[_0xd7df('0x21')](_0x36f2bd[_0x29f0e8],_0x38db14);}}return _0x36f2bd;};exports[_0xd7df('0x26')]=function(_0x36de76){return _0x36de76['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x58584d){return _0x58584d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xd7df('0x27')]=function(_0x4e87cd){var _0xd366b=[];_0x4e87cd[_0xd7df('0x6')](/[ ,]+/)['forEach'](function(_0x3ef553){_0x3ef553=_0x3ef553[_0xd7df('0x28')](/([^:]")"+/g,'$1');_0x3ef553='+'+_0x3ef553+'*';var _0x4fe918=/[ `!@#$%^&*()_\-?~]/;if(_0x3ef553[_0xd7df('0x29')](_0x4fe918))_0x3ef553='\x22'+_0x3ef553+'\x22';_0xd366b[_0xd7df('0x2a')](_0x3ef553);});return _0xd366b[_0xd7df('0x2b')]('\x20');};exports[_0xd7df('0x2c')]=function(_0x40f965,_0x3304c4,_0x5a658f){var _0x428b4b={},_0x149813={};if(_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')]){_0x3304c4[_0xd7df('0x2d')]['id']=_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];delete _0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];}_0x428b4b[_0xd7df('0x2f')]=_[_0xd7df('0x18')](_0x40f965,'name');_0x428b4b['query']=_[_0xd7df('0x4')](_0x3304c4['query']);_0x428b4b[_0xd7df('0x7')]=_[_0xd7df('0x30')](_0x428b4b[_0xd7df('0x2f')],_0x428b4b[_0xd7df('0x2d')]);_0x149813['attributes']=_['intersection'](_0x428b4b['model'],this[_0xd7df('0x31')](_0x3304c4[_0xd7df('0x2d')]['fields']));_0x149813[_0xd7df('0x32')]=_0x149813[_0xd7df('0x32')][_0xd7df('0x20')]?_0x149813[_0xd7df('0x32')]:_0x428b4b['model'];if(!_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x25')]('nolimit')){_0x149813[_0xd7df('0x16')]=this['limit'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x16')]);_0x149813[_0xd7df('0x33')]=this['offset'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x33')]);}_0x149813[_0xd7df('0x34')]=this[_0xd7df('0x17')](_0x3304c4['query'][_0xd7df('0x17')]);_0x149813[_0xd7df('0x35')]=this[_0xd7df('0x7')](_['pick'](_0x3304c4[_0xd7df('0x2d')],_0x428b4b[_0xd7df('0x7')]),_0x40f965);if(_0x3304c4[_0xd7df('0x2d')]['filter']){var _0x80019d=_0x40f965;var _0x445467=_0x3304c4['query']['filter'];if(typeof _0x445467===_0xd7df('0x36')){_0x80019d=_[_0xd7df('0x37')](_0x40f965,function(_0x6a024a){return _['includes'](_0x445467['columns'],_0x6a024a[_0xd7df('0x13')]);});_0x445467=_0x445467['value'];}_0x149813[_0xd7df('0x35')]=_['merge'](_0x149813['where'],{'$or':_[_0xd7df('0x18')](_0x80019d,function(_0x579d0f){if(_0x579d0f[_0xd7df('0xa')]!==_0xd7df('0x38')){if(_0x5a658f){return sequelize[_0xd7df('0x35')](sequelize['fn'](_0xd7df('0x39'),sequelize[_0xd7df('0x1e')](_0x579d0f[_0xd7df('0x13')])),{'$like':sequelize['fn'](_0xd7df('0x39'),'%'+_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x37')]+'%')});}else{var _0x5b3179={};_0x5b3179[_0x579d0f[_0xd7df('0x13')]]={'$like':'%'+_0x3304c4['query'][_0xd7df('0x37')]+'%'};return _0x5b3179;}}})});}_0x149813=_[_0xd7df('0x3a')]({},_0x149813,_0x3304c4[_0xd7df('0x3b')]);return _0x149813;}; \ No newline at end of file +var _0x84e7=['cast','col','substr','DESC','priority','ASC','omit','length','isObject','isString','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','join','$id','query','model','intersection','attributes','hasOwnProperty','nolimit','order','where','object','filter','columns','name','value','map','VIRTUAL','lower','merge','sequelize','moment','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','parse','$gte','YYYY-MM-DD','utc','format','$lte','subtract','isArray','limit','offset','sort','indexOf'];(function(_0x18e84d,_0x593b65){var _0x479ad2=function(_0x3e66c8){while(--_0x3e66c8){_0x18e84d['push'](_0x18e84d['shift']());}};_0x479ad2(++_0x593b65);}(_0x84e7,0x122));var _0x784e=function(_0x3f5530,_0x1b3bde){_0x3f5530=_0x3f5530-0x0;var _0x4c93bc=_0x84e7[_0x3f5530];return _0x4c93bc;};'use strict';var _=require('lodash');var sequelize=require(_0x784e('0x0'));var moment=require(_0x784e('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5861e2){var _0x3548d2=['ne'];try{var _0x2c1d96=JSON['parse'](_0x5861e2);var _0x45e3ad=Object[_0x784e('0x2')](_0x2c1d96)[0x0];return _0x3548d2[_0x784e('0x3')](_0x45e3ad);}catch(_0xdc7692){return![];}}function getOperatorValue(_0x42993b){var _0x133296=JSON['parse'](_0x42993b);var _0x3cbdd1=Object['keys'](_0x133296)[0x0];var _0xfaa170=_0x133296[_0x3cbdd1];return{['$'+_0x3cbdd1]:_0xfaa170};}exports[_0x784e('0x4')]=function(_0x59a97d){var _0x18be55=null;if(_0x59a97d){_0x18be55=_0x59a97d[_0x784e('0x5')](',');}return _0x18be55;};exports[_0x784e('0x6')]=function(_0x3ddd55,_0x4ac061){var _0x4ae056={};if(!_[_0x784e('0x7')](_0x3ddd55)){_[_0x784e('0x8')](_0x3ddd55,function(_0x17b71f,_0x2fd1b5){try{if(_0x4ac061){var _0x5389cd=_[_0x784e('0x9')](_0x4ac061,{'name':_0x2fd1b5})||{};if(hasSequelizeOperator(_0x17b71f)){_0x4ae056[_0x2fd1b5]=getOperatorValue(_0x17b71f);}else if(_0x5389cd[_0x784e('0xa')]===_0x784e('0xb')&&_[_0x784e('0xc')](_0x17b71f)){var _0x40e0d1=JSON[_0x784e('0xd')](_0x17b71f);var _0x59e179={'$gte':moment(moment(_0x40e0d1[_0x784e('0xe')])['format'](_0x784e('0xf')))[_0x784e('0x10')]()[_0x784e('0x11')](),'$lte':moment(moment(_0x40e0d1[_0x784e('0x12')])[_0x784e('0x11')](_0x784e('0xf')))[_0x784e('0x10')]()[_0x784e('0x13')](0x1,'s')[_0x784e('0x11')]()};_0x4ae056[_0x2fd1b5]=_0x59e179;}else if(_0x5389cd['name']==='uniqueid'){_0x4ae056[_0x2fd1b5]=_0x17b71f;}else{_0x4ae056[_0x2fd1b5]=_[_0x784e('0x14')](_0x17b71f)?_0x17b71f:JSON[_0x784e('0xd')](_0x17b71f);}}else{_0x4ae056[_0x2fd1b5]=_[_0x784e('0x14')](_0x17b71f)?_0x17b71f:JSON[_0x784e('0xd')](_0x17b71f);}}catch(_0x3ac83){_0x4ae056[_0x2fd1b5]=_0x17b71f[_0x784e('0x5')](',');}});}return _0x4ae056;};exports[_0x784e('0x15')]=function(_0x504ebf){_0x504ebf=parseInt(_0x504ebf,0xa);if(!_0x504ebf||_0x504ebf<0x0){_0x504ebf=LIMIT_VALUE;}return _0x504ebf;};exports[_0x784e('0x16')]=function(_0x285ddd){_0x285ddd=parseInt(_0x285ddd,0xa);if(!_0x285ddd||_0x285ddd<0x0){_0x285ddd=0x0;}return _0x285ddd;};exports[_0x784e('0x17')]=function(_0xa417c2){var _0x440cd6,_0x42f894=null;if(_0xa417c2){_0x440cd6=_0xa417c2[_0x784e('0x5')](',');_0x42f894=_['map'](_0x440cd6,function(_0x5add8f){if(_0x5add8f[_0x784e('0x18')]('-')===0x0){return[_0x5add8f==='priority'?sequelize[_0x784e('0x19')](sequelize[_0x784e('0x1a')]('priority'),'unsigned'):_0x5add8f[_0x784e('0x1b')](0x1),_0x784e('0x1c')];}else{return[_0x5add8f===_0x784e('0x1d')?sequelize[_0x784e('0x19')](sequelize['col']('priority'),'unsigned'):_0x5add8f,_0x784e('0x1e')];}});}return _0x42f894;};exports[_0x784e('0x1f')]=function(_0x47f5c2,_0xc225cf){if(_['isEmpty'](_0x47f5c2)){return _0x47f5c2;}if(_[_0x784e('0x14')](_0x47f5c2)){for(var _0x59f315=0x0;_0x59f315<_0x47f5c2[_0x784e('0x20')];_0x59f315+=0x1){_0x47f5c2[_0x59f315]=this[_0x784e('0x1f')](_0x47f5c2[_0x59f315],_0xc225cf);}return _0x47f5c2;}if(!_[_0x784e('0x21')](_0x47f5c2)){return _0x47f5c2;}if(_[_0x784e('0x22')](_0xc225cf)){_0xc225cf=[_0xc225cf];}if(!_['isArray'](_0xc225cf)){return _0x47f5c2;}for(var _0x3668ed=0x0;_0x3668ed<_0xc225cf[_0x784e('0x20')];_0x3668ed+=0x1){_[_0x784e('0x23')](_0x47f5c2,_0xc225cf[_0x3668ed]);}for(var _0x2def08 in _0x47f5c2){if(_0x47f5c2['hasOwnProperty'](_0x2def08)){_0x47f5c2[_0x2def08]=this[_0x784e('0x1f')](_0x47f5c2[_0x2def08],_0xc225cf);}}return _0x47f5c2;};exports[_0x784e('0x24')]=function(_0x5f3da2){return _0x5f3da2['match'](RegExp(_0x784e('0x25')))?!![]:![];};exports[_0x784e('0x26')]=function(_0x17a278){return _0x17a278[_0x784e('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x784e('0x28')]=function(_0x294a75){var _0x150757=[];_0x294a75[_0x784e('0x5')](/[ ,]+/)[_0x784e('0x29')](function(_0x2e18d6){_0x2e18d6=_0x2e18d6[_0x784e('0x2a')](/([^:]")"+/g,'$1');_0x2e18d6='+'+_0x2e18d6+'*';var _0x8ccdae=/[ `!@#$%^&*()_\-?~]/;if(_0x2e18d6[_0x784e('0x27')](_0x8ccdae))_0x2e18d6='\x22'+_0x2e18d6+'\x22';_0x150757[_0x784e('0x2b')](_0x2e18d6);});return _0x150757[_0x784e('0x2c')]('\x20');};exports['getOptions']=function(_0x32e399,_0x4ea50b,_0xc66635){var _0x14bb3b={},_0x14547a={};if(_0x4ea50b['query'][_0x784e('0x2d')]){_0x4ea50b['query']['id']=_0x4ea50b[_0x784e('0x2e')][_0x784e('0x2d')];delete _0x4ea50b['query'][_0x784e('0x2d')];}_0x14bb3b[_0x784e('0x2f')]=_['map'](_0x32e399,'name');_0x14bb3b[_0x784e('0x2e')]=_[_0x784e('0x2')](_0x4ea50b[_0x784e('0x2e')]);_0x14bb3b[_0x784e('0x6')]=_[_0x784e('0x30')](_0x14bb3b['model'],_0x14bb3b[_0x784e('0x2e')]);_0x14547a[_0x784e('0x31')]=_['intersection'](_0x14bb3b[_0x784e('0x2f')],this['fields'](_0x4ea50b['query']['fields']));_0x14547a[_0x784e('0x31')]=_0x14547a[_0x784e('0x31')]['length']?_0x14547a[_0x784e('0x31')]:_0x14bb3b[_0x784e('0x2f')];if(!_0x4ea50b[_0x784e('0x2e')][_0x784e('0x32')](_0x784e('0x33'))){_0x14547a[_0x784e('0x15')]=this['limit'](_0x4ea50b['query'][_0x784e('0x15')]);_0x14547a[_0x784e('0x16')]=this['offset'](_0x4ea50b['query']['offset']);}_0x14547a[_0x784e('0x34')]=this[_0x784e('0x17')](_0x4ea50b['query'][_0x784e('0x17')]);_0x14547a[_0x784e('0x35')]=this[_0x784e('0x6')](_['pick'](_0x4ea50b[_0x784e('0x2e')],_0x14bb3b['filters']),_0x32e399);if(_0x4ea50b[_0x784e('0x2e')]['filter']){var _0x412ef4=_0x32e399;var _0x14c36b=_0x4ea50b['query']['filter'];if(typeof _0x14c36b===_0x784e('0x36')){_0x412ef4=_[_0x784e('0x37')](_0x32e399,function(_0xa2ed54){return _['includes'](_0x14c36b[_0x784e('0x38')],_0xa2ed54[_0x784e('0x39')]);});_0x14c36b=_0x14c36b[_0x784e('0x3a')];}_0x14547a[_0x784e('0x35')]=_['merge'](_0x14547a[_0x784e('0x35')],{'$or':_[_0x784e('0x3b')](_0x412ef4,function(_0x48d0f0){if(_0x48d0f0['type']!==_0x784e('0x3c')){if(_0xc66635){return sequelize[_0x784e('0x35')](sequelize['fn'](_0x784e('0x3d'),sequelize[_0x784e('0x1a')](_0x48d0f0[_0x784e('0x39')])),{'$like':sequelize['fn']('lower','%'+_0x4ea50b['query']['filter']+'%')});}else{var _0x1c824a={};_0x1c824a[_0x48d0f0[_0x784e('0x39')]]={'$like':'%'+_0x4ea50b[_0x784e('0x2e')][_0x784e('0x37')]+'%'};return _0x1c824a;}}})});}_0x14547a=_[_0x784e('0x3e')]({},_0x14547a,_0x4ea50b['options']);return _0x14547a;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index dbc2346..e2a8d37 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6995=['smsPause','voicePause','whatsappPause','filter','length','idle','unknown','ringing','voiceStatus','pause','every','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','request','Agents','then','error','result','merge','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','findOne','getAgents','flatten','map','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','find','globalStatus','getSortedAgentsIdsByStatus','split','order','startsWith','ASC','substring','indexOf','internal','validateSortParameter','sort','DESC','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','faxPause','chatCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','routealias','omit','filterAgentAttributes','lodash','jayson/promise','client','http','chatPause','mailPause','openchannelPause'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x6995,0xfb));var _0x5699=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6995[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5699('0x0'));var jayson=require(_0x5699('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x5699('0x2')][_0x5699('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x5699('0x3')]({'port':0x232c});function isAgentPaused(_0x5dbdc7,_0x4a7a77){var _0x2623d2=[_0x5dbdc7[_0x5699('0x4')],_0x5dbdc7['faxPause'],_0x5dbdc7[_0x5699('0x5')],_0x5dbdc7[_0x5699('0x6')],_0x5dbdc7[_0x5699('0x7')],_0x5dbdc7[_0x5699('0x8')],_0x5dbdc7[_0x5699('0x9')]];if(!_0x4a7a77)return _['every'](_0x2623d2);var _0x2d96b3=_[_0x5699('0xa')](_0x2623d2);return _0x2d96b3[_0x5699('0xb')]>0x0&&_0x2d96b3['length']<_0x2623d2[_0x5699('0xb')]?!![]:![];}function isIdle(_0x418743){return _0x418743===_0x5699('0xc')||_0x418743===_0x5699('0xd')||_0x418743==='unavailable'||_0x418743===_0x5699('0xe')||_['isNil'](_0x418743);}function isAgentIdle(_0x2b3b25){if(_0x2b3b25[_0x5699('0xf')]!==_0x5699('0xc')&&_0x2b3b25[_0x5699('0x8')]){_0x2b3b25[_0x5699('0xf')]=_0x5699('0x10');return![];}return _[_0x5699('0x11')]([_0x2b3b25[_0x5699('0x12')],_0x2b3b25[_0x5699('0x13')],_0x2b3b25[_0x5699('0x14')],_0x2b3b25['openchannelStatus'],_0x2b3b25[_0x5699('0x15')],_0x2b3b25[_0x5699('0xf')],_0x2b3b25[_0x5699('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x5699('0x17')](_0x5699('0x18'),{})[_0x5699('0x19')](function(_0x235c59){if(_0x235c59[_0x5699('0x1a')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x4af3a2=_0x235c59[_0x5699('0x1b')];return routingClient[_0x5699('0x17')](_0x5699('0x18'),{})['then'](function(_0x41e09d){if(_0x41e09d[_0x5699('0x1a')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x44283c=_0x41e09d[_0x5699('0x1b')];return _[_0x5699('0x1c')]({},_0x4af3a2,_0x44283c);});})['catch'](function(_0x312ee4){throw _0x312ee4;});}exports[_0x5699('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x153b2e){var _0x5bef02=_0x5699('0xd');if(isAgentPaused(_0x153b2e))_0x5bef02=_0x5699('0x10');else if(isAgentPaused(_0x153b2e,!![]))_0x5bef02=_0x5699('0x1e');else if(isAgentIdle(_0x153b2e))_0x5bef02=_0x5699('0xc');else _0x5bef02=_0x5699('0x1f');return _0x5bef02;}exports[_0x5699('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x1f3503,_0x19ac3e){var _0x380b17=_[_0x5699('0x21')](_0x1f3503)?_0x1f3503:[_0x1f3503];var _0x1e4123=_[_0x5699('0x22')](_0x19ac3e)+_0x5699('0x23');var _0x28fb49=_['map'](_0x380b17,function(_0x3b7689){return db[_0x1e4123][_0x5699('0x24')]({'where':{'id':_0x3b7689}})[_0x5699('0x19')](function(_0x20a845){if(!_0x20a845)return[];return _0x20a845[_0x5699('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x28fb49)[_0x5699('0x19')](function(_0xf52e1b){var _0x537278=_(_0xf52e1b)[_0x5699('0x26')]()[_0x5699('0x27')]('id')['uniq']()[_0x5699('0x28')]();return _0x537278;});}exports[_0x5699('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x16e69c,_0x2327b1,_0x26dd25){try{if(_0x2327b1[_0x5699('0xb')]>0x0){_0x16e69c=_0x16e69c[_0x5699('0xa')](function(_0x235a21){return _0x2327b1[_0x5699('0x2a')](_0x235a21['id']);});}var _0x14421e=_0x16e69c[_0x5699('0xa')](function(_0x4d674f){var _0x257ac8=_0x5699('0x1f');if(isAgentIdle(_0x4d674f)){_0x257ac8=_0x5699('0xc');}return _0x257ac8===_0x26dd25;});return _[_0x5699('0x27')](_0x14421e,'id');}catch(_0x1e14a1){throw _0x1e14a1;}}exports[_0x5699('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x107435,_0x4b1377,_0x202bb3){return Promise[_0x5699('0x2c')]()['then'](function(){if(_0x4b1377[_0x5699('0xb')]>0x0){_0x107435=_0x107435[_0x5699('0xa')](function(_0x42a454){return _0x4b1377['includes'](_0x42a454['id']);});}return _0x107435;})[_0x5699('0x19')](function(){return db['User'][_0x5699('0x2d')]({'attributes':['id',_0x5699('0x2e'),_0x5699('0x2f'),_0x5699('0x4'),'faxPause','mailPause','openchannelPause','smsPause',_0x5699('0x8'),_0x5699('0x9'),'pauseType'],'where':{'id':{'$in':_[_0x5699('0x27')](_0x107435,'id')}},'raw':!![]});})[_0x5699('0x19')](function(_0x3d04ad){return _0x3d04ad['map'](function(_0x330721){var _0x1a5788=_[_0x5699('0x30')](_0x107435,['id',_0x330721['id']]);var _0x15f130=filterAgentAttributes(_0x1a5788);_[_0x5699('0x1c')](_0x330721,_0x15f130);_0x330721[_0x5699('0x31')]=getAgentStatus(_0x330721);return _0x330721;});})[_0x5699('0x19')](function(_0x1f0a7f){var _0x23fdcd=sortAgentsByStatus(_0x1f0a7f,_0x202bb3);return _[_0x5699('0x27')](_0x23fdcd,'id');})['catch'](function(_0x2048a3){throw _0x2048a3;});}exports[_0x5699('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x14f985){var _0x10de3a={'fields':[],'order':null};var _0x1e5f59=_0x14f985[_0x5699('0x33')](',');_0x10de3a['fields']=_[_0x5699('0xa')](_0x1e5f59,function(_0x14f102){if(!_0x14f102[_0x5699('0x2a')](_0x5699('0x31'))){return!![];}_0x10de3a[_0x5699('0x34')]=_[_0x5699('0x35')](_0x14f102,'-')?'DESC':_0x5699('0x36');return![];});return _0x10de3a;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x1749e6){if(_0x1749e6[_0x5699('0x2a')](_0x5699('0x2f'))&&!_0x1749e6['includes']('internal')){var _0x209ee7=_0x1749e6[_0x5699('0x37')](0x0,_0x1749e6[_0x5699('0x38')](_0x5699('0x2f')));_0x1749e6+=','+_0x209ee7+_0x5699('0x39');}return _0x1749e6;}exports[_0x5699('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x41f224,_0x32ab16){var _0x27d40c=_0x41f224[_0x5699('0x3b')](function(_0x1bfbb9,_0x1081a7){if(_0x1bfbb9[_0x5699('0x31')]===_0x1081a7[_0x5699('0x31')]){if(_0x1bfbb9[_0x5699('0x31')]===_0x5699('0x10')){if(_0x32ab16===_0x5699('0x3c')){return(_0x1bfbb9[_0x5699('0x3d')]||'')<(_0x1081a7[_0x5699('0x3d')]||'')||_0x1bfbb9[_0x5699('0x2f')]['toLowerCase']()>_0x1081a7[_0x5699('0x2f')][_0x5699('0x3e')]()?0x1:-0x1;}else{return(_0x1bfbb9['pauseType']||'')<(_0x1081a7[_0x5699('0x3d')]||'')||_0x1bfbb9[_0x5699('0x2f')][_0x5699('0x3e')]()>_0x1081a7[_0x5699('0x2f')][_0x5699('0x3e')]()?-0x1:0x1;}}else{if(_0x32ab16==='DESC'){return _0x1bfbb9[_0x5699('0x2f')][_0x5699('0x3e')]()<_0x1081a7[_0x5699('0x2f')][_0x5699('0x3e')]()?0x1:-0x1;}else{return _0x1bfbb9[_0x5699('0x2f')][_0x5699('0x3e')]()<_0x1081a7[_0x5699('0x2f')][_0x5699('0x3e')]()?-0x1:0x1;}}}else{if(_0x32ab16===_0x5699('0x3c')){return _0x1bfbb9[_0x5699('0x31')]<_0x1081a7[_0x5699('0x31')]?0x1:-0x1;}else{return _0x1bfbb9[_0x5699('0x31')]<_0x1081a7[_0x5699('0x31')]?-0x1:0x1;}}});return _0x27d40c;}exports[_0x5699('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x2edc9f){var _0x59181f=['userpic',_0x5699('0x40'),_0x5699('0x41'),'lastPauseAt',_0x5699('0x3d'),'lastPauseAt','internal','address',_0x5699('0x4'),'openchannelPause',_0x5699('0x5'),'smsPause',_0x5699('0x9'),_0x5699('0x42'),_0x5699('0x8'),_0x5699('0x43'),'openchannelCapacity','mailCapacity',_0x5699('0x44'),_0x5699('0x45'),_0x5699('0x46'),'chatCurrentCapacity',_0x5699('0x47'),'mailCurrentCapacity',_0x5699('0x48'),'whatsappCurrentCapacity',_0x5699('0x49'),_0x5699('0x12'),_0x5699('0x4a'),_0x5699('0x14'),_0x5699('0x15'),_0x5699('0x16'),_0x5699('0x13'),'voiceStatus',_0x5699('0x4b'),_0x5699('0x4c'),'mailStatusTime',_0x5699('0x4d'),_0x5699('0x4e'),_0x5699('0x4f'),'voiceStatusTime',_0x5699('0x50'),_0x5699('0x51'),_0x5699('0x52'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0x5699('0x53')];var _0x5592d8=[_0x5699('0x4'),_0x5699('0x6'),_0x5699('0x5'),'smsPause',_0x5699('0x9'),'faxPause',_0x5699('0x8'),'online'];var _0x1b1da7=_(_0x2edc9f)[_0x5699('0x54')](_0x5592d8)['pick'](_0x59181f)[_0x5699('0x28')]();return _0x1b1da7;}exports[_0x5699('0x55')]=filterAgentAttributes; \ No newline at end of file +var _0x06fd=['uniq','value','getAgentIdsByQueues','includes','User','findAll','name','pauseType','find','catch','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname','substring','indexOf','internal','validateSortParameter','sort','globalStatus','toLowerCase','userpic','lastLoginAt','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','online','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','result','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','busy','startCase','Queue','map','findOne','getAgents','flatten'];(function(_0x40b343,_0x464279){var _0xc875fd=function(_0x1a857f){while(--_0x1a857f){_0x40b343['push'](_0x40b343['shift']());}};_0xc875fd(++_0x464279);}(_0x06fd,0x1a3));var _0xd06f=function(_0x585219,_0x23ba0b){_0x585219=_0x585219-0x0;var _0x32c6fe=_0x06fd[_0x585219];return _0x32c6fe;};'use strict';var _=require(_0xd06f('0x0'));var jayson=require(_0xd06f('0x1'));var db=require(_0xd06f('0x2'))['db'];var amiClient=jayson[_0xd06f('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xd06f('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x25420f,_0x19aca9){var _0x29bf06=[_0x25420f[_0xd06f('0x4')],_0x25420f[_0xd06f('0x5')],_0x25420f[_0xd06f('0x6')],_0x25420f[_0xd06f('0x7')],_0x25420f[_0xd06f('0x8')],_0x25420f[_0xd06f('0x9')],_0x25420f[_0xd06f('0xa')]];if(!_0x19aca9)return _[_0xd06f('0xb')](_0x29bf06);var _0x3c9ab3=_[_0xd06f('0xc')](_0x29bf06);return _0x3c9ab3[_0xd06f('0xd')]>0x0&&_0x3c9ab3[_0xd06f('0xd')]<_0x29bf06[_0xd06f('0xd')]?!![]:![];}function isIdle(_0x180033){return _0x180033===_0xd06f('0xe')||_0x180033===_0xd06f('0xf')||_0x180033===_0xd06f('0x10')||_0x180033===_0xd06f('0x11')||_[_0xd06f('0x12')](_0x180033);}function isAgentIdle(_0x47ac7a){if(_0x47ac7a[_0xd06f('0x13')]!==_0xd06f('0xe')&&_0x47ac7a['voicePause']){_0x47ac7a[_0xd06f('0x13')]=_0xd06f('0x14');return![];}return _[_0xd06f('0xb')]([_0x47ac7a[_0xd06f('0x15')],_0x47ac7a[_0xd06f('0x16')],_0x47ac7a[_0xd06f('0x17')],_0x47ac7a[_0xd06f('0x18')],_0x47ac7a[_0xd06f('0x19')],_0x47ac7a['voiceStatus'],_0x47ac7a[_0xd06f('0x1a')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xd06f('0x1b'),{})['then'](function(_0x1cc73b){if(_0x1cc73b['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x19f999=_0x1cc73b[_0xd06f('0x1c')];return routingClient[_0xd06f('0x1d')](_0xd06f('0x1b'),{})[_0xd06f('0x1e')](function(_0x118fd7){if(_0x118fd7[_0xd06f('0x1f')]){throw new Error(_0xd06f('0x20'));}var _0x3005a6=_0x118fd7['result'];return _[_0xd06f('0x21')]({},_0x19f999,_0x3005a6);});})['catch'](function(_0x235586){throw _0x235586;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x44defc){var _0x23f20f=_0xd06f('0xf');if(isAgentPaused(_0x44defc))_0x23f20f=_0xd06f('0x14');else if(isAgentPaused(_0x44defc,!![]))_0x23f20f='*pause';else if(isAgentIdle(_0x44defc))_0x23f20f=_0xd06f('0xe');else _0x23f20f=_0xd06f('0x22');return _0x23f20f;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x110c69,_0x530181){var _0x4d6f8f=_['isArray'](_0x110c69)?_0x110c69:[_0x110c69];var _0xb685bd=_[_0xd06f('0x23')](_0x530181)+_0xd06f('0x24');var _0x4dd146=_[_0xd06f('0x25')](_0x4d6f8f,function(_0x13b7a2){return db[_0xb685bd][_0xd06f('0x26')]({'where':{'id':_0x13b7a2}})['then'](function(_0x5f2e7f){if(!_0x5f2e7f)return[];return _0x5f2e7f[_0xd06f('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x4dd146)[_0xd06f('0x1e')](function(_0x3a9d52){var _0x439085=_(_0x3a9d52)[_0xd06f('0x28')]()[_0xd06f('0x25')]('id')[_0xd06f('0x29')]()[_0xd06f('0x2a')]();return _0x439085;});}exports[_0xd06f('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3802a2,_0x40c7e7,_0x1ca6a3){try{if(_0x40c7e7[_0xd06f('0xd')]>0x0){_0x3802a2=_0x3802a2[_0xd06f('0xc')](function(_0x175651){return _0x40c7e7[_0xd06f('0x2c')](_0x175651['id']);});}var _0x30d3dd=_0x3802a2[_0xd06f('0xc')](function(_0x3917be){var _0x177441=_0xd06f('0x22');if(isAgentIdle(_0x3917be)){_0x177441=_0xd06f('0xe');}return _0x177441===_0x1ca6a3;});return _['map'](_0x30d3dd,'id');}catch(_0x5545b0){throw _0x5545b0;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4c63f3,_0x14d2c0,_0x3b77db){return Promise['resolve']()[_0xd06f('0x1e')](function(){if(_0x14d2c0[_0xd06f('0xd')]>0x0){_0x4c63f3=_0x4c63f3[_0xd06f('0xc')](function(_0x231ef8){return _0x14d2c0[_0xd06f('0x2c')](_0x231ef8['id']);});}return _0x4c63f3;})[_0xd06f('0x1e')](function(){return db[_0xd06f('0x2d')][_0xd06f('0x2e')]({'attributes':['id',_0xd06f('0x2f'),'fullname','chatPause',_0xd06f('0x5'),_0xd06f('0x6'),_0xd06f('0x7'),_0xd06f('0x8'),_0xd06f('0x9'),_0xd06f('0xa'),_0xd06f('0x30')],'where':{'id':{'$in':_[_0xd06f('0x25')](_0x4c63f3,'id')}},'raw':!![]});})[_0xd06f('0x1e')](function(_0x5268c7){return _0x5268c7['map'](function(_0x4c14d1){var _0x20750b=_[_0xd06f('0x31')](_0x4c63f3,['id',_0x4c14d1['id']]);var _0x594dae=filterAgentAttributes(_0x20750b);_[_0xd06f('0x21')](_0x4c14d1,_0x594dae);_0x4c14d1['globalStatus']=getAgentStatus(_0x4c14d1);return _0x4c14d1;});})['then'](function(_0x1dd2a4){var _0x53f646=sortAgentsByStatus(_0x1dd2a4,_0x3b77db);return _[_0xd06f('0x25')](_0x53f646,'id');})[_0xd06f('0x32')](function(_0x48a55d){throw _0x48a55d;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4b739d){var _0x4538bd={'fields':[],'order':null};var _0x2d8e58=_0x4b739d[_0xd06f('0x33')](',');_0x4538bd[_0xd06f('0x34')]=_['filter'](_0x2d8e58,function(_0x193045){if(!_0x193045[_0xd06f('0x2c')]('globalStatus')){return!![];}_0x4538bd[_0xd06f('0x35')]=_[_0xd06f('0x36')](_0x193045,'-')?_0xd06f('0x37'):_0xd06f('0x38');return![];});return _0x4538bd;}exports[_0xd06f('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x207d25){if(_0x207d25[_0xd06f('0x2c')](_0xd06f('0x3a'))&&!_0x207d25[_0xd06f('0x2c')]('internal')){var _0x3a3ebf=_0x207d25[_0xd06f('0x3b')](0x0,_0x207d25[_0xd06f('0x3c')](_0xd06f('0x3a')));_0x207d25+=','+_0x3a3ebf+_0xd06f('0x3d');}return _0x207d25;}exports[_0xd06f('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x1d2909,_0x397593){var _0x5d7fb3=_0x1d2909[_0xd06f('0x3f')](function(_0x215a8b,_0x1de5e3){if(_0x215a8b[_0xd06f('0x40')]===_0x1de5e3['globalStatus']){if(_0x215a8b['globalStatus']===_0xd06f('0x14')){if(_0x397593===_0xd06f('0x37')){return(_0x215a8b[_0xd06f('0x30')]||'')<(_0x1de5e3[_0xd06f('0x30')]||'')||_0x215a8b['fullname'][_0xd06f('0x41')]()>_0x1de5e3[_0xd06f('0x3a')][_0xd06f('0x41')]()?0x1:-0x1;}else{return(_0x215a8b['pauseType']||'')<(_0x1de5e3[_0xd06f('0x30')]||'')||_0x215a8b[_0xd06f('0x3a')][_0xd06f('0x41')]()>_0x1de5e3[_0xd06f('0x3a')][_0xd06f('0x41')]()?-0x1:0x1;}}else{if(_0x397593===_0xd06f('0x37')){return _0x215a8b[_0xd06f('0x3a')][_0xd06f('0x41')]()<_0x1de5e3[_0xd06f('0x3a')]['toLowerCase']()?0x1:-0x1;}else{return _0x215a8b[_0xd06f('0x3a')][_0xd06f('0x41')]()<_0x1de5e3['fullname'][_0xd06f('0x41')]()?-0x1:0x1;}}}else{if(_0x397593===_0xd06f('0x37')){return _0x215a8b[_0xd06f('0x40')]<_0x1de5e3[_0xd06f('0x40')]?0x1:-0x1;}else{return _0x215a8b[_0xd06f('0x40')]<_0x1de5e3['globalStatus']?-0x1:0x1;}}});return _0x5d7fb3;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x2a1a8f){var _0x51b593=[_0xd06f('0x42'),'online',_0xd06f('0x43'),'lastPauseAt',_0xd06f('0x30'),'lastPauseAt',_0xd06f('0x3d'),_0xd06f('0x44'),'chatPause','openchannelPause',_0xd06f('0x6'),_0xd06f('0x8'),_0xd06f('0xa'),_0xd06f('0x5'),_0xd06f('0x9'),_0xd06f('0x45'),'openchannelCapacity',_0xd06f('0x46'),_0xd06f('0x47'),_0xd06f('0x48'),_0xd06f('0x49'),_0xd06f('0x4a'),_0xd06f('0x4b'),_0xd06f('0x4c'),_0xd06f('0x4d'),_0xd06f('0x4e'),'faxCurrentCapacity',_0xd06f('0x15'),_0xd06f('0x18'),_0xd06f('0x17'),_0xd06f('0x19'),'whatsappStatus',_0xd06f('0x16'),_0xd06f('0x13'),_0xd06f('0x4f'),_0xd06f('0x50'),'mailStatusTime',_0xd06f('0x51'),_0xd06f('0x52'),'faxStatusTime',_0xd06f('0x53'),_0xd06f('0x54'),_0xd06f('0x55'),_0xd06f('0x56'),'phoneBarEnableScreenRecordingByAgent',_0xd06f('0x57'),_0xd06f('0x58')];var _0x5c8e9e=[_0xd06f('0x4'),_0xd06f('0x7'),'mailPause',_0xd06f('0x8'),'whatsappPause','faxPause','voicePause',_0xd06f('0x59')];var _0x5286d7=_(_0x2a1a8f)['omit'](_0x5c8e9e)[_0xd06f('0x5a')](_0x51b593)['value']();return _0x5286d7;}exports[_0xd06f('0x5b')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index b31b945..b102b1b 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x5d6b41,_0x3d1c8f){var _0x1c2dd6=function(_0x48d601){while(--_0x48d601){_0x5d6b41['push'](_0x5d6b41['shift']());}};_0x1c2dd6(++_0x3d1c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x1da7f8,_0x3f70aa){var _0x1b11e3=function(_0x1f21e9){while(--_0x1f21e9){_0x1da7f8['push'](_0x1da7f8['shift']());}};_0x1b11e3(++_0x3f70aa);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index a460fee..b36656e 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 _0xbdac=['keys','length','family','IPv4','internal','concat','mac','127.0.0.1','getFirstInterface','cpus','map','model','md5','update','digest','hex','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbdac,0x75));var _0xcbda=function(_0x4250c8,_0x29ff1b){_0x4250c8=_0x4250c8-0x0;var _0x19be14=_0xbdac[_0x4250c8];return _0x19be14;};'use strict';var _=require(_0xcbda('0x0'));var os=require('os');var crypto=require(_0xcbda('0x1'));var machine=require(_0xcbda('0x2'));var exec=require(_0xcbda('0x3'))[_0xcbda('0x4')];var config=require('../environment');function getInterfaces(){var _0xb7b835=[];var _0x4fb100=os[_0xcbda('0x5')]();var _0x223717=_[_0xcbda('0x6')](_[_0xcbda('0x7')](_0x4fb100));for(var _0x249fd5=0x0;_0x249fd5<_0x223717[_0xcbda('0x8')];_0x249fd5++){var _0x25cc00=_0x4fb100[_0x223717[_0x249fd5]]['filter'](function(_0x329a8c){return _0x329a8c[_0xcbda('0x9')]===_0xcbda('0xa')&&_0x329a8c[_0xcbda('0xb')]===![];});_0xb7b835=_0xb7b835[_0xcbda('0xc')](_0x25cc00);}return _0xb7b835;}function getFirstInterface(){var _0x1814b7=_['head'](getInterfaces());return{'macAddress':_0x1814b7&&_0x1814b7[_0xcbda('0xd')]?_0x1814b7[_0xcbda('0xd')]:'00:00:00:00:00:00','ipAddress':_0x1814b7&&_0x1814b7['address']?_0x1814b7['address']:_0xcbda('0xe')};}exports[_0xcbda('0xf')]=getFirstInterface;function getCPUhash(){var _0x50730f=_[_0xcbda('0x6')](os[_0xcbda('0x10')]()[_0xcbda('0x11')](function(_0x57d897){return _0x57d897[_0xcbda('0x12')];}))['join'](':');return crypto['createHash'](_0xcbda('0x13'))[_0xcbda('0x14')](_0x50730f)[_0xcbda('0x15')](_0xcbda('0x16'));}exports['getUuid']=function(){var _0xad7d43=os['platform']();var _0x2d1df0=/[0-9a-f-]{36}/;if(config[_0xcbda('0x17')]&&_0x2d1df0['test'](config[_0xcbda('0x17')])){return config[_0xcbda('0x17')];}else if(_0xad7d43===_0xcbda('0x18')){return exec(_0xcbda('0x19'),{'encoding':'utf8'})[_0xcbda('0x1a')]('\x0d\x0a','');}else{var _0x3d93c4=getFirstInterface();var _0x376dcd=getCPUhash();var _0xdcbd80=_0x376dcd+'|'+os[_0xcbda('0x1b')]()+'|'+_0x3d93c4[_0xcbda('0x1c')]+'|'+_0x3d93c4['ipAddress'];var _0x3d1c4c=crypto[_0xcbda('0x1d')]('md5')[_0xcbda('0x14')](_0xdcbd80)[_0xcbda('0x15')]('hex');return _0x3d1c4c[_0xcbda('0x1e')](0x0,0x8)+'-'+_0x3d1c4c['substring'](0x8,0xc)+'-'+_0x3d1c4c[_0xcbda('0x1e')](0xc,0x10)+'-'+_0x3d1c4c[_0xcbda('0x1e')](0x10,0x14)+'-'+_0x3d1c4c[_0xcbda('0x1e')](0x14);}}; \ No newline at end of file +var _0x4825=['digest','hex','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','model','md5','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','update'];(function(_0x22eb10,_0x143e98){var _0x258100=function(_0x3d3cbb){while(--_0x3d3cbb){_0x22eb10['push'](_0x22eb10['shift']());}};_0x258100(++_0x143e98);}(_0x4825,0x93));var _0x5482=function(_0x46a653,_0x59833e){_0x46a653=_0x46a653-0x0;var _0x386df4=_0x4825[_0x46a653];return _0x386df4;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x5482('0x0'));var machine=require(_0x5482('0x1'));var exec=require(_0x5482('0x2'))[_0x5482('0x3')];var config=require(_0x5482('0x4'));function getInterfaces(){var _0x8e6891=[];var _0x4de0b2=os[_0x5482('0x5')]();var _0x458780=_[_0x5482('0x6')](_[_0x5482('0x7')](_0x4de0b2));for(var _0x2cefe5=0x0;_0x2cefe5<_0x458780[_0x5482('0x8')];_0x2cefe5++){var _0x5d89c8=_0x4de0b2[_0x458780[_0x2cefe5]][_0x5482('0x9')](function(_0x162123){return _0x162123[_0x5482('0xa')]===_0x5482('0xb')&&_0x162123[_0x5482('0xc')]===![];});_0x8e6891=_0x8e6891[_0x5482('0xd')](_0x5d89c8);}return _0x8e6891;}function getFirstInterface(){var _0x4abaa2=_['head'](getInterfaces());return{'macAddress':_0x4abaa2&&_0x4abaa2[_0x5482('0xe')]?_0x4abaa2[_0x5482('0xe')]:_0x5482('0xf'),'ipAddress':_0x4abaa2&&_0x4abaa2[_0x5482('0x10')]?_0x4abaa2[_0x5482('0x10')]:'127.0.0.1'};}exports[_0x5482('0x11')]=getFirstInterface;function getCPUhash(){var _0x505db9=_['orderBy'](os['cpus']()['map'](function(_0x49bf25){return _0x49bf25[_0x5482('0x12')];}))['join'](':');return crypto['createHash'](_0x5482('0x13'))['update'](_0x505db9)['digest']('hex');}exports[_0x5482('0x14')]=function(){var _0x5ac86b=os[_0x5482('0x15')]();var _0x40ca0f=/[0-9a-f-]{36}/;if(config[_0x5482('0x16')]&&_0x40ca0f[_0x5482('0x17')](config[_0x5482('0x16')])){return config[_0x5482('0x16')];}else if(_0x5ac86b===_0x5482('0x18')){return exec(_0x5482('0x19'),{'encoding':_0x5482('0x1a')})[_0x5482('0x1b')]('\x0d\x0a','');}else{var _0x4bb706=getFirstInterface();var _0x12efc9=getCPUhash();var _0x4ca3cb=_0x12efc9+'|'+os[_0x5482('0x1c')]()+'|'+_0x4bb706[_0x5482('0x1d')]+'|'+_0x4bb706[_0x5482('0x1e')];var _0xea067b=crypto[_0x5482('0x1f')]('md5')[_0x5482('0x20')](_0x4ca3cb)[_0x5482('0x21')](_0x5482('0x22'));return _0xea067b['substring'](0x0,0x8)+'-'+_0xea067b['substring'](0x8,0xc)+'-'+_0xea067b[_0x5482('0x23')](0xc,0x10)+'-'+_0xea067b[_0x5482('0x23')](0x10,0x14)+'-'+_0xea067b[_0x5482('0x23')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index fb96ff1..943e1ee 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 _0x093e=['getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','message','finally'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x093e,0xc9));var _0xe093=function(_0x4b4dbd,_0x2ba28a){_0x4b4dbd=_0x4b4dbd-0x0;var _0x591334=_0x093e[_0x4b4dbd];return _0x591334;};'use strict';var util=require(_0xe093('0x0'));var moment=require(_0xe093('0x1'));var rp=require('request-promise');var BPromise=require(_0xe093('0x2'));var pkginfo=require(_0xe093('0x3'))(module,_0xe093('0x4'));var db=require(_0xe093('0x5'))['db'];var encryptor=require(_0xe093('0x6'));var hardware=require(_0xe093('0x7'));var logger=require(_0xe093('0x8'))(_0xe093('0x9'));var HOST=_0xe093('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x33087f){return new BPromise(function(_0xec5851,_0x115a7a){var _0x348026=util[_0xe093('0xb')](_0xe093('0xc'),HOST,_0x33087f,module['exports']['version']);if(oldToken){_0x348026=util[_0xe093('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x33087f,module[_0xe093('0xd')][_0xe093('0x4')],oldToken);}var _0x51243c={'uri':_0x348026,'method':_0xe093('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x51243c)[_0xe093('0xf')](function(_0xbf92fc){_0xec5851(_0xbf92fc);})[_0xe093('0x10')](function(_0x2d55ad){_0x115a7a(_0x2d55ad);});});}function manageLicense(_0x38cf8a,_0x598ce4){var _0xdf65d6=_0x598ce4[_0xe093('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0xdf65d6[_0xe093('0x12')]!==_0x38cf8a&&!_0xdf65d6[_0xe093('0x13')]){oldToken=_0xdf65d6['data1'];}httpRequest(_0x38cf8a)[_0xe093('0xf')](function(_0x13c68d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x13c68d[_0xe093('0x14')]){isOldTokenSent=![];if(!_0xdf65d6[_0xe093('0x9')]&&_0xdf65d6['license']!=_0x13c68d['license']||_0xdf65d6[_0xe093('0x9')]&&_0xdf65d6[_0xe093('0x13')]){logger[_0xe093('0x15')](_0xe093('0x16'));}if(_0xdf65d6[_0xe093('0x9')]&&!_0xdf65d6['data2']&&_0xdf65d6[_0xe093('0x9')]!=_0x13c68d[_0xe093('0x9')]){logger['info'](_0xe093('0x17'));}if(_0xdf65d6['license']&&!_0xdf65d6[_0xe093('0x13')]&&_0xdf65d6[_0xe093('0x9')]==_0x13c68d['license']){return _0x598ce4;}return _0x598ce4[_0xe093('0x18')]({'data1':_0x38cf8a,'data2':null,'license':_0x13c68d['license']});}else{if(_0x13c68d[_0xe093('0x9')]||_0xdf65d6[_0xe093('0x9')]){if(!_0xdf65d6[_0xe093('0x13')]){if(_0xdf65d6[_0xe093('0x12')]==_0x38cf8a){GRAY_PERIOD_REASON='Disabled';logger[_0xe093('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0xe093('0x15')](_0xe093('0x19'),_0xdf65d6[_0xe093('0x12')],_0x38cf8a);}logger[_0xe093('0x15')](_0xe093('0x1a'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xe093('0xb')](_0xe093('0x1b')));return _0x598ce4[_0xe093('0x18')]({'data2':encryptor['encryptString'](moment()[_0xe093('0xb')](_0xe093('0x1b')))});}else{if(moment()['diff'](encryptor['decryptString'](_0xdf65d6[_0xe093('0x13')]),_0xe093('0x1c'))>DAYS){logger[_0xe093('0x15')](_0xe093('0x1d'),moment()['format'](_0xe093('0x1b')));isOldTokenSent=![];return _0x598ce4[_0xe093('0x18')]({'data1':_0x38cf8a,'data2':null,'license':null});}}}else{if(_0xdf65d6['data1']!=_0x38cf8a){logger[_0xe093('0x15')](_0xe093('0x19'),_0xdf65d6[_0xe093('0x12')],_0x38cf8a);return _0x598ce4['update']({'data1':_0x38cf8a,'data2':null,'license':null});}}}return _0x598ce4;})['then'](function(_0x14d853){_0x598ce4=_0x14d853;})[_0xe093('0x10')](function(_0x12e132){logger[_0xe093('0x1e')](_0x12e132[_0xe093('0x1f')]);})[_0xe093('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xe093('0x21')](),_0x598ce4);},TIME);});}function defaultLicense(){var _0x55211f=hardware[_0xe093('0x21')]();if(_0x55211f){return db[_0xe093('0x22')][_0xe093('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x55211f}})[_0xe093('0x24')](function(_0x51c6f3,_0x297fc3){logger[_0xe093('0x15')](_0xe093('0x25'),_0x55211f);manageLicense(_0x55211f,_0x51c6f3);})[_0xe093('0x10')](function(_0x1223ec){logger[_0xe093('0x1e')](_0x1223ec[_0xe093('0x1f')]);});}}exports[_0xe093('0x26')]=defaultLicense; \ No newline at end of file +var _0xe321=['data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get'];(function(_0x1d6e7c,_0x39a942){var _0x4b07fb=function(_0x2ad5a8){while(--_0x2ad5a8){_0x1d6e7c['push'](_0x1d6e7c['shift']());}};_0x4b07fb(++_0x39a942);}(_0xe321,0xbd));var _0x1e32=function(_0x4d1406,_0x5c7a2c){_0x4d1406=_0x4d1406-0x0;var _0x2858e9=_0xe321[_0x4d1406];return _0x2858e9;};'use strict';var util=require(_0x1e32('0x0'));var moment=require('moment');var rp=require(_0x1e32('0x1'));var BPromise=require(_0x1e32('0x2'));var pkginfo=require(_0x1e32('0x3'))(module,_0x1e32('0x4'));var db=require(_0x1e32('0x5'))['db'];var encryptor=require(_0x1e32('0x6'));var hardware=require(_0x1e32('0x7'));var logger=require('../logger')(_0x1e32('0x8'));var HOST=_0x1e32('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x47e275){return new BPromise(function(_0x2a94cd,_0x378783){var _0x1d2710=util[_0x1e32('0xa')](_0x1e32('0xb'),HOST,_0x47e275,module[_0x1e32('0xc')][_0x1e32('0x4')]);if(oldToken){_0x1d2710=util[_0x1e32('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x47e275,module[_0x1e32('0xc')][_0x1e32('0x4')],oldToken);}var _0x307e3b={'uri':_0x1d2710,'method':_0x1e32('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x307e3b)[_0x1e32('0xe')](function(_0x172ccb){_0x2a94cd(_0x172ccb);})['catch'](function(_0x3ae798){_0x378783(_0x3ae798);});});}function manageLicense(_0x499e8f,_0x28a8bb){var _0x46b362=_0x28a8bb[_0x1e32('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x46b362[_0x1e32('0x10')]!==_0x499e8f&&!_0x46b362['data2']){oldToken=_0x46b362['data1'];}httpRequest(_0x499e8f)[_0x1e32('0xe')](function(_0x279f06){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x279f06['active']){isOldTokenSent=![];if(!_0x46b362[_0x1e32('0x8')]&&_0x46b362[_0x1e32('0x8')]!=_0x279f06['license']||_0x46b362['license']&&_0x46b362[_0x1e32('0x11')]){logger[_0x1e32('0x12')](_0x1e32('0x13'));}if(_0x46b362['license']&&!_0x46b362[_0x1e32('0x11')]&&_0x46b362[_0x1e32('0x8')]!=_0x279f06[_0x1e32('0x8')]){logger['info'](_0x1e32('0x14'));}if(_0x46b362[_0x1e32('0x8')]&&!_0x46b362[_0x1e32('0x11')]&&_0x46b362[_0x1e32('0x8')]==_0x279f06[_0x1e32('0x8')]){return _0x28a8bb;}return _0x28a8bb[_0x1e32('0x15')]({'data1':_0x499e8f,'data2':null,'license':_0x279f06[_0x1e32('0x8')]});}else{if(_0x279f06['license']||_0x46b362[_0x1e32('0x8')]){if(!_0x46b362[_0x1e32('0x11')]){if(_0x46b362[_0x1e32('0x10')]==_0x499e8f){GRAY_PERIOD_REASON=_0x1e32('0x16');logger[_0x1e32('0x12')](_0x1e32('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x1e32('0x12')](_0x1e32('0x18'),_0x46b362[_0x1e32('0x10')],_0x499e8f);}logger[_0x1e32('0x12')](_0x1e32('0x19'),GRAY_PERIOD_REASON[_0x1e32('0x1a')](),moment()[_0x1e32('0xa')](_0x1e32('0x1b')));return _0x28a8bb[_0x1e32('0x15')]({'data2':encryptor[_0x1e32('0x1c')](moment()[_0x1e32('0xa')](_0x1e32('0x1b')))});}else{if(moment()[_0x1e32('0x1d')](encryptor[_0x1e32('0x1e')](_0x46b362[_0x1e32('0x11')]),_0x1e32('0x1f'))>DAYS){logger[_0x1e32('0x12')](_0x1e32('0x20'),moment()[_0x1e32('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x28a8bb[_0x1e32('0x15')]({'data1':_0x499e8f,'data2':null,'license':null});}}}else{if(_0x46b362[_0x1e32('0x10')]!=_0x499e8f){logger[_0x1e32('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x46b362['data1'],_0x499e8f);return _0x28a8bb[_0x1e32('0x15')]({'data1':_0x499e8f,'data2':null,'license':null});}}}return _0x28a8bb;})[_0x1e32('0xe')](function(_0x3343ff){_0x28a8bb=_0x3343ff;})[_0x1e32('0x21')](function(_0x2a031f){logger[_0x1e32('0x22')](_0x2a031f[_0x1e32('0x23')]);})[_0x1e32('0x24')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x28a8bb);},TIME);});}function defaultLicense(){var _0x7df4c0=hardware[_0x1e32('0x25')]();if(_0x7df4c0){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x7df4c0}})[_0x1e32('0x26')](function(_0xdc2b7,_0x4e3f8d){logger['info'](_0x1e32('0x27'),_0x7df4c0);manageLicense(_0x7df4c0,_0xdc2b7);})[_0x1e32('0x21')](function(_0x367074){logger[_0x1e32('0x22')](_0x367074[_0x1e32('0x23')]);});}}exports[_0x1e32('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index ac11ca4..5c140d7 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 _0x3043=['parse','machineUuid','gray','deadline','add','days','changed','disabled','message','User','findAll','role','sequelize','col','count','user','telephone','users','telephones','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0x3043,0x19a));var _0x3304=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3043[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x3304('0x0'));var _=require('lodash');var moment=require(_0x3304('0x1'));var BPromise=require(_0x3304('0x2'));var hardware=require(_0x3304('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x3304('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3304('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3304('0x6'),'machineUuid':hardware[_0x3304('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x3304('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2f57cf){return new BPromise(function(_0x48d100,_0x38341e){return db[_0x3304('0x8')][_0x3304('0x9')](_[_0x3304('0xa')](_0x2f57cf,{'raw':!![],'where':{'id':0x1}}))[_0x3304('0xb')](function(_0x24fcf6){return checkLicense(_0x24fcf6,null);})[_0x3304('0xb')](function(_0x24c7a9){_0x48d100(_0x24c7a9);return;})[_0x3304('0xc')](function(_0x258183){_0x38341e(_0x258183);});});}function checkLicense(_0x51fb40,_0x4411c0){if(!_0x51fb40){demoLicense[_0x3304('0xd')]=_0x51fb40[_0x3304('0xe')];return demoLicense;}try{var _0x464a21=_0x4411c0||_0x51fb40[_0x3304('0xf')];if(_[_0x3304('0x10')](_0x464a21)){throw new Error(_0x3304('0x11'));}var _0x52da4f=_0x51fb40[_0x3304('0xe')];var _0x5ef4fc=_0x51fb40[_0x3304('0x12')];var _0x1e8b4e=_0x52da4f[_0x3304('0x13')]('-')[0x4];var _0x34e027=_0x52da4f[_0x3304('0x13')]('-')[0x0];var _0x242b3f=encryptor[_0x3304('0x14')](_0x464a21,util['format'](_0x3304('0x15'),_0x1e8b4e,_0x52da4f,_0x34e027));var _0x5a121c=JSON[_0x3304('0x16')](_0x242b3f);_0x5a121c['demo']=![];_0x5a121c['uuid']=_0x52da4f;_0x5a121c[_0x3304('0x17')]=hardware['getUuid']();if(_0x5ef4fc){var _0x2599f9=encryptor[_0x3304('0x14')](_0x5ef4fc);_0x5a121c[_0x3304('0x18')]=_0x2599f9;_0x5a121c[_0x3304('0x19')]=moment(_0x2599f9)[_0x3304('0x1a')](0x7,_0x3304('0x1b'))['format']();_0x5a121c['grayReason']=_0x5a121c['uuid']!=_0x5a121c[_0x3304('0x17')]?_0x3304('0x1c'):_0x3304('0x1d');}return _0x5a121c;}catch(_0x50ba7d){breakingLicense[_0x3304('0xd')]=_0x51fb40['data1'];breakingLicense['message']=_0x50ba7d[_0x3304('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x21c987,_0x2268c7){getLicense()[_0x3304('0xb')](function(_0x455bf2){return db[_0x3304('0x1f')][_0x3304('0x20')]({'attributes':[_0x3304('0x21'),[db['sequelize']['fn']('COUNT',db[_0x3304('0x22')][_0x3304('0x23')](_0x3304('0x21'))),_0x3304('0x24')]],'group':'role','where':{'role':{'$or':['admin',_0x3304('0x25'),_0x3304('0x26')]}},'raw':!![]})['then'](function(_0x53792a){var _0x1de01f={'user':_0x455bf2[_0x3304('0x27')]||0x0,'telephone':_0x455bf2[_0x3304('0x28')]||0x0};_0x53792a[_0x3304('0x29')](function(_0x24e064){var _0x55ae73=_0x24e064['role']===_0x3304('0x2a')?_0x3304('0x25'):_0x24e064[_0x3304('0x21')];_0x1de01f[_0x55ae73]-=_0x24e064['count'];if(_0x1de01f[_0x55ae73]<0x0)_0x1de01f[_0x55ae73]=0x0;});_0x21c987(_0x1de01f);return;});})['catch'](function(_0x4958e3){_0x2268c7(_0x4958e3);});});}function checkUserLimits(_0x3c6f29){return new BPromise(function(_0x354528,_0x3ebbb0){getLimits()[_0x3304('0xb')](function(_0x203349){var _0x1df2a9=_[_0x3304('0x2b')](_[_0x3304('0x2c')](_0x3c6f29,_0x3304('0x21')),[_0x3304('0x2a'),'user',_0x3304('0x26')]);var _0x47da4c=(_0x1df2a9[_0x3304('0x2a')]||0x0)+(_0x1df2a9[_0x3304('0x25')]||0x0);var _0xc0879e=_0x1df2a9[_0x3304('0x26')]||0x0;if(_0x47da4c>_0x203349[_0x3304('0x25')])return _0x3ebbb0(_0x3304('0x2d'));if(_0xc0879e>_0x203349[_0x3304('0x26')])return _0x3ebbb0(_0x3304('0x2e'));return _0x354528();})[_0x3304('0xc')](function(_0x4b7b5f){_0x3ebbb0(_0x4b7b5f);});});}module[_0x3304('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xf078=['changed','disabled','message','User','findAll','sequelize','COUNT','col','role','count','admin','user','telephone','users','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','exports','lodash','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','parse','demo','machineUuid','gray','deadline','add','format'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xf078,0x17b));var _0x8f07=function(_0x1af5af,_0x36cdfa){_0x1af5af=_0x1af5af-0x0;var _0x1cd64f=_0xf078[_0x1af5af];return _0x1cd64f;};'use strict';var util=require('util');var _=require(_0x8f07('0x0'));var moment=require('moment');var BPromise=require(_0x8f07('0x1'));var hardware=require('./hardware');var encryptor=require(_0x8f07('0x2'));var db=require(_0x8f07('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8f07('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8f07('0x5'),'machineUuid':hardware[_0x8f07('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8f07('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x8f07('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x26c7c4){return new BPromise(function(_0x14df0c,_0x3d8a00){return db[_0x8f07('0x7')][_0x8f07('0x8')](_['defaults'](_0x26c7c4,{'raw':!![],'where':{'id':0x1}}))[_0x8f07('0x9')](function(_0x5bbb21){return checkLicense(_0x5bbb21,null);})['then'](function(_0x5a2cdc){_0x14df0c(_0x5a2cdc);return;})[_0x8f07('0xa')](function(_0x5e7fc9){_0x3d8a00(_0x5e7fc9);});});}function checkLicense(_0x54da18,_0x16e89e){if(!_0x54da18){demoLicense[_0x8f07('0xb')]=_0x54da18[_0x8f07('0xc')];return demoLicense;}try{var _0x254bc0=_0x16e89e||_0x54da18[_0x8f07('0xd')];if(_[_0x8f07('0xe')](_0x254bc0)){throw new Error(_0x8f07('0xf'));}var _0x1a3498=_0x54da18[_0x8f07('0xc')];var _0x42e4f8=_0x54da18[_0x8f07('0x10')];var _0x1626b0=_0x1a3498[_0x8f07('0x11')]('-')[0x4];var _0x500a21=_0x1a3498[_0x8f07('0x11')]('-')[0x0];var _0x519f35=encryptor[_0x8f07('0x12')](_0x254bc0,util['format']('%s:%s:%s',_0x1626b0,_0x1a3498,_0x500a21));var _0x5ae239=JSON[_0x8f07('0x13')](_0x519f35);_0x5ae239[_0x8f07('0x14')]=![];_0x5ae239[_0x8f07('0xb')]=_0x1a3498;_0x5ae239[_0x8f07('0x15')]=hardware[_0x8f07('0x6')]();if(_0x42e4f8){var _0xec86a2=encryptor[_0x8f07('0x12')](_0x42e4f8);_0x5ae239[_0x8f07('0x16')]=_0xec86a2;_0x5ae239[_0x8f07('0x17')]=moment(_0xec86a2)[_0x8f07('0x18')](0x7,'days')[_0x8f07('0x19')]();_0x5ae239['grayReason']=_0x5ae239[_0x8f07('0xb')]!=_0x5ae239[_0x8f07('0x15')]?_0x8f07('0x1a'):_0x8f07('0x1b');}return _0x5ae239;}catch(_0x46bee2){breakingLicense[_0x8f07('0xb')]=_0x54da18[_0x8f07('0xc')];breakingLicense[_0x8f07('0x1c')]=_0x46bee2['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xf440f,_0x35ccda){getLicense()['then'](function(_0x22a5bb){return db[_0x8f07('0x1d')][_0x8f07('0x1e')]({'attributes':['role',[db[_0x8f07('0x1f')]['fn'](_0x8f07('0x20'),db[_0x8f07('0x1f')][_0x8f07('0x21')](_0x8f07('0x22'))),_0x8f07('0x23')]],'group':'role','where':{'role':{'$or':[_0x8f07('0x24'),_0x8f07('0x25'),_0x8f07('0x26')]}},'raw':!![]})[_0x8f07('0x9')](function(_0xabcad2){var _0x174683={'user':_0x22a5bb[_0x8f07('0x27')]||0x0,'telephone':_0x22a5bb[_0x8f07('0x28')]||0x0};_0xabcad2[_0x8f07('0x29')](function(_0x25444d){var _0x57452c=_0x25444d['role']===_0x8f07('0x24')?_0x8f07('0x25'):_0x25444d[_0x8f07('0x22')];_0x174683[_0x57452c]-=_0x25444d[_0x8f07('0x23')];if(_0x174683[_0x57452c]<0x0)_0x174683[_0x57452c]=0x0;});_0xf440f(_0x174683);return;});})[_0x8f07('0xa')](function(_0x1c8a09){_0x35ccda(_0x1c8a09);});});}function checkUserLimits(_0x37ab8b){return new BPromise(function(_0x455cff,_0x197487){getLimits()[_0x8f07('0x9')](function(_0x324379){var _0x5a9401=_['pick'](_[_0x8f07('0x2a')](_0x37ab8b,_0x8f07('0x22')),[_0x8f07('0x24'),_0x8f07('0x25'),_0x8f07('0x26')]);var _0x48b413=(_0x5a9401[_0x8f07('0x24')]||0x0)+(_0x5a9401[_0x8f07('0x25')]||0x0);var _0x56da54=_0x5a9401[_0x8f07('0x26')]||0x0;if(_0x48b413>_0x324379[_0x8f07('0x25')])return _0x197487(_0x8f07('0x2b'));if(_0x56da54>_0x324379[_0x8f07('0x26')])return _0x197487('License\x20limit\x20reached\x20for\x20telephones');return _0x455cff();})[_0x8f07('0xa')](function(_0x2db1bb){_0x197487(_0x2db1bb);});});}module[_0x8f07('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 e034953..2a80c8a 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 _0xe5af=['http://localhost:9000','myappanuglar-secret','secret'];(function(_0x460a7c,_0x518a6d){var _0x1d4593=function(_0x3a8246){while(--_0x3a8246){_0x460a7c['push'](_0x460a7c['shift']());}};_0x1d4593(++_0x518a6d);}(_0xe5af,0x9c));var _0xfe5a=function(_0x814257,_0x5403ed){_0x814257=_0x814257-0x0;var _0x4f9aa0=_0xe5af[_0x814257];return _0x4f9aa0;};'use strict';module['exports']={'DOMAIN':_0xfe5a('0x0'),'SESSION_SECRET':_0xfe5a('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfe5a('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xbbbc=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x422076,_0x113ecb){var _0x32907c=function(_0x5c89a0){while(--_0x5c89a0){_0x422076['push'](_0x422076['shift']());}};_0x32907c(++_0x113ecb);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x4bd501,_0x2fdba6){_0x4bd501=_0x4bd501-0x0;var _0x38d73c=_0xbbbc[_0x4bd501];return _0x38d73c;};'use strict';module[_0xcbbb('0x0')]={'DOMAIN':_0xcbbb('0x1'),'SESSION_SECRET':_0xcbbb('0x2'),'GOOGLE_ID':_0xcbbb('0x3'),'GOOGLE_SECRET':_0xcbbb('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 4fd3724..25a4027 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedc9=['../utils/loggers','fileLogger','exports'];(function(_0x3d4fa6,_0x5d2c63){var _0x5f46fd=function(_0x3bb493){while(--_0x3bb493){_0x3d4fa6['push'](_0x3d4fa6['shift']());}};_0x5f46fd(++_0x5d2c63);}(_0xedc9,0x1e0));var _0x9edc=function(_0xc9a48e,_0x4d3e72){_0xc9a48e=_0xc9a48e-0x0;var _0x419127=_0xedc9[_0xc9a48e];return _0x419127;};'use strict';var fileLogger=require(_0x9edc('0x0'))[_0x9edc('0x1')];module[_0x9edc('0x2')]=fileLogger; \ No newline at end of file +var _0xe2a2=['exports'];(function(_0x1d21b0,_0x1a185c){var _0x518c95=function(_0xee6d1){while(--_0xee6d1){_0x1d21b0['push'](_0x1d21b0['shift']());}};_0x518c95(++_0x1a185c);}(_0xe2a2,0x10f));var _0x2e2a=function(_0x40603f,_0x4af822){_0x40603f=_0x40603f-0x0;var _0x3f8a7e=_0xe2a2[_0x40603f];return _0x3f8a7e;};'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module[_0x2e2a('0x0')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 5420352..81a37e5 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 _0x73ac=['join','../../services/ami/index.js','../../services/agi/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','ami'];(function(_0x27412f,_0x14604d){var _0x26f881=function(_0x465f38){while(--_0x465f38){_0x27412f['push'](_0x27412f['shift']());}};_0x26f881(++_0x14604d);}(_0x73ac,0xdf));var _0xc73a=function(_0x47bff7,_0x52b59a){_0x47bff7=_0x47bff7-0x0;var _0xbf563f=_0x73ac[_0x47bff7];return _0xbf563f;};'use strict';var path=require(_0xc73a('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xc73a('0x1'),'script':path[_0xc73a('0x2')](__dirname,_0xc73a('0x3'))},{'name':'agi','script':path['join'](__dirname,_0xc73a('0x4'))},{'name':'email','script':path[_0xc73a('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xc73a('0x5'),'script':path[_0xc73a('0x2')](__dirname,_0xc73a('0x6'))},{'name':'xdr','script':path['join'](__dirname,_0xc73a('0x7'))}]};module[_0xc73a('0x8')]=config; \ No newline at end of file +var _0x1a88=['../../services/routing/index.js','xdr','path','express','join','../../services/express/index.js','ami','agi','../../services/agi/index.js','email','routing'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0x1a88,0xde));var _0x81a8=function(_0x476e1b,_0x492975){_0x476e1b=_0x476e1b-0x0;var _0xa002c6=_0x1a88[_0x476e1b];return _0xa002c6;};'use strict';var path=require(_0x81a8('0x0'));var os=require('os');var config={'apps':[{'name':_0x81a8('0x1'),'script':path[_0x81a8('0x2')](__dirname,_0x81a8('0x3'))},{'name':_0x81a8('0x4'),'script':path[_0x81a8('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x81a8('0x5'),'script':path[_0x81a8('0x2')](__dirname,_0x81a8('0x6'))},{'name':_0x81a8('0x7'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x81a8('0x8'),'script':path[_0x81a8('0x2')](__dirname,_0x81a8('0x9'))},{'name':_0x81a8('0xa'),'script':path[_0x81a8('0x2')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index e52162d..534f982 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 _0x0fb4=['saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x0fb4,0x1e1));var _0x40fb=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x0fb4[_0x38fb0d];return _0x30a5d6;};'use strict';var pm2=require(_0x40fb('0x0'));var BPromise=require(_0x40fb('0x1'));var config=require(_0x40fb('0x2'));function connect(){return new BPromise(function(_0x44f2cd,_0x231e22){return pm2[_0x40fb('0x3')](function(_0x4be04f){if(_0x4be04f){return _0x231e22(_0x4be04f);}return _0x44f2cd(_0x40fb('0x4'));});});};exports['start']=function(_0x433c91){return connect()[_0x40fb('0x5')](function(){return new BPromise(function(_0x286659,_0x505190){return pm2[_0x40fb('0x6')](_0x433c91,function(_0x3d68fd,_0x37cb9d){if(_0x3d68fd){return _0x505190(_0x3d68fd);}pm2[_0x40fb('0x7')]();return _0x286659(_0x37cb9d);});});});};exports[_0x40fb('0x8')]=function(_0x2e8451){return connect()['then'](function(){return new BPromise(function(_0x392e79,_0x16b6a8){return pm2[_0x40fb('0x8')](_0x2e8451,function(_0x238c28,_0x57e49b){if(_0x238c28){return _0x16b6a8(_0x238c28);}pm2[_0x40fb('0x7')]();return _0x392e79(_0x57e49b);});});});};exports[_0x40fb('0x9')]=function(_0x5581b3){return connect()[_0x40fb('0x5')](function(){return new BPromise(function(_0x382bad,_0x552646){return pm2[_0x40fb('0x9')](_0x5581b3,function(_0x44dade,_0x3df991){if(_0x44dade){return _0x552646(_0x44dade);}pm2[_0x40fb('0x7')]();return _0x382bad(_0x3df991);});});});};exports[_0x40fb('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x565c03,_0x26a5e7){return pm2[_0x40fb('0xa')](function(_0xd45a3f,_0xf171b3){if(_0xd45a3f){return _0x26a5e7(_0xd45a3f);}pm2[_0x40fb('0x7')]();return _0x565c03(_0xf171b3);});});});};exports[_0x40fb('0xb')]=function(_0x6a3e9){return connect()['then'](function(){return new BPromise(function(_0x2ec48c,_0x49514b){return pm2[_0x40fb('0xb')](_0x6a3e9,function(_0x14ae1e,_0x46a41f){if(_0x14ae1e){return _0x49514b(_0x14ae1e);}pm2[_0x40fb('0x7')]();return _0x2ec48c(_0x46a41f);});});});};exports[_0x40fb('0xc')]=function(_0x26b2c1){return connect()[_0x40fb('0x5')](function(){return new BPromise(function(_0x334f98,_0x3381f1){return pm2[_0x40fb('0xc')](_0x26b2c1,function(_0x1d9b86,_0xc04485){if(_0x1d9b86){return _0x3381f1(_0x1d9b86);}pm2[_0x40fb('0x7')]();return _0x334f98(_0xc04485);});});});};exports['dump']=function(){return connect()[_0x40fb('0x5')](function(){return new BPromise(function(_0x1524ee,_0x23ce0b){return pm2[_0x40fb('0xd')](function(_0x1293b9){if(_0x1293b9){return _0x23ce0b(_0x1293b9);}return _0x1524ee(_0x40fb('0xe'));});});});}; \ No newline at end of file +var _0x8d16=['list','describe','delete','dump','pm2','bluebird','./config','start','then','stop','disconnect','restart'];(function(_0x3ed980,_0x45311d){var _0x4489d9=function(_0x536e79){while(--_0x536e79){_0x3ed980['push'](_0x3ed980['shift']());}};_0x4489d9(++_0x45311d);}(_0x8d16,0x1c0));var _0x68d1=function(_0x3ac8b4,_0x4bdc96){_0x3ac8b4=_0x3ac8b4-0x0;var _0x533904=_0x8d16[_0x3ac8b4];return _0x533904;};'use strict';var pm2=require(_0x68d1('0x0'));var BPromise=require(_0x68d1('0x1'));var config=require(_0x68d1('0x2'));function connect(){return new BPromise(function(_0x54ef74,_0x21ab22){return pm2['connect'](function(_0x788161){if(_0x788161){return _0x21ab22(_0x788161);}return _0x54ef74('connected');});});};exports[_0x68d1('0x3')]=function(_0x37474a){return connect()[_0x68d1('0x4')](function(){return new BPromise(function(_0x24fdea,_0x36699c){return pm2[_0x68d1('0x3')](_0x37474a,function(_0xdc5e2c,_0x4896a7){if(_0xdc5e2c){return _0x36699c(_0xdc5e2c);}pm2['disconnect']();return _0x24fdea(_0x4896a7);});});});};exports[_0x68d1('0x5')]=function(_0xa364f6){return connect()['then'](function(){return new BPromise(function(_0x2056f5,_0x2eff6a){return pm2[_0x68d1('0x5')](_0xa364f6,function(_0x3cf541,_0x59a87f){if(_0x3cf541){return _0x2eff6a(_0x3cf541);}pm2[_0x68d1('0x6')]();return _0x2056f5(_0x59a87f);});});});};exports['restart']=function(_0xd65a42){return connect()[_0x68d1('0x4')](function(){return new BPromise(function(_0x4fce5c,_0x11c603){return pm2[_0x68d1('0x7')](_0xd65a42,function(_0x588498,_0x2cdf73){if(_0x588498){return _0x11c603(_0x588498);}pm2[_0x68d1('0x6')]();return _0x4fce5c(_0x2cdf73);});});});};exports[_0x68d1('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0xbc4b9e,_0x3a9eeb){return pm2[_0x68d1('0x8')](function(_0x239e27,_0x5a388c){if(_0x239e27){return _0x3a9eeb(_0x239e27);}pm2[_0x68d1('0x6')]();return _0xbc4b9e(_0x5a388c);});});});};exports['describe']=function(_0x32aa8b){return connect()[_0x68d1('0x4')](function(){return new BPromise(function(_0xb22c2e,_0x1edb65){return pm2[_0x68d1('0x9')](_0x32aa8b,function(_0x568565,_0x3b8d9e){if(_0x568565){return _0x1edb65(_0x568565);}pm2['disconnect']();return _0xb22c2e(_0x3b8d9e);});});});};exports[_0x68d1('0xa')]=function(_0x2ebf81){return connect()[_0x68d1('0x4')](function(){return new BPromise(function(_0x2b37ad,_0x3e9cde){return pm2[_0x68d1('0xa')](_0x2ebf81,function(_0x6b5d4d,_0x4d8e0e){if(_0x6b5d4d){return _0x3e9cde(_0x6b5d4d);}pm2[_0x68d1('0x6')]();return _0x2b37ad(_0x4d8e0e);});});});};exports[_0x68d1('0xb')]=function(){return connect()[_0x68d1('0x4')](function(){return new BPromise(function(_0x594a3e,_0x5a0ffc){return pm2[_0x68d1('0xb')](function(_0x58dc00){if(_0x58dc00){return _0x5a0ffc(_0x58dc00);}return _0x594a3e('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index d9a021d..b48cf13 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 _0x327c=['length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','socket.io-emitter','find','then','chatTimeout','findAll','lastMsgAt','minutes'];(function(_0xe3262a,_0x27730b){var _0x28c6fd=function(_0x3559b1){while(--_0x3559b1){_0xe3262a['push'](_0xe3262a['shift']());}};_0x28c6fd(++_0x27730b);}(_0x327c,0x17a));var _0xc327=function(_0x405fa0,_0x4a4387){_0x405fa0=_0x405fa0-0x0;var _0x5ec0d5=_0x327c[_0x405fa0];return _0x5ec0d5;};'use strict';var _=require('lodash');var moment=require(_0xc327('0x0'));var Redis=require(_0xc327('0x1'));var util=require(_0xc327('0x2'));var config=require(_0xc327('0x3'));var db=require(_0xc327('0x4'))['db'];var logger=require(_0xc327('0x5'))('schedule');config[_0xc327('0x6')]=_['defaults'](config[_0xc327('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc327('0x7'))(new Redis(config[_0xc327('0x6')]));function closeInteractions(){var _0x3938ab=0x0;var _0x43b1c9=[];return db['Setting'][_0xc327('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xc327('0x9')](function(_0x86864f){_0x3938ab=_0x86864f[_0xc327('0xa')];if(_0x3938ab){return db['ChatInteraction'][_0xc327('0xb')]({'raw':!![],'attributes':['id',_0xc327('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x86864f[_0xc327('0xa')],_0xc327('0xd'))}}});}else{return[];}})[_0xc327('0x9')](function(_0x31a9a8){if(_0x31a9a8&&_0x31a9a8[_0xc327('0xe')]){_0x43b1c9=_[_0xc327('0xf')](_0x31a9a8||[],'id');logger['info'](_0xc327('0x10'),_0x43b1c9[_0xc327('0x11')]());return db['ChatInteraction'][_0xc327('0x12')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xc327('0x13')](_0xc327('0x14'))},{'where':{'id':_0x43b1c9}});}})[_0xc327('0x9')](function(){if(_0x43b1c9&&_0x43b1c9[_0xc327('0xe')]){logger[_0xc327('0x15')](_0xc327('0x16'),_0x43b1c9[_0xc327('0x11')]());for(var _0x47d47e=0x0;_0x47d47e<_0x43b1c9[_0xc327('0xe')];_0x47d47e++){io[_0xc327('0x17')](_0xc327('0x18'),{'id':_0x43b1c9[_0x47d47e],'closed':!![]});}}})['catch'](function(_0x1d6fa3){logger['error'](_0xc327('0x19'),_0x1d6fa3?util[_0xc327('0x1a')](_0x1d6fa3,{'showHidden':![],'depth':null}):'');});}exports[_0xc327('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe3ec=['../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','findAll','subtract','then','length','info','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment'];(function(_0x178866,_0x573968){var _0x20fa01=function(_0x5f2763){while(--_0x5f2763){_0x178866['push'](_0x178866['shift']());}};_0x20fa01(++_0x573968);}(_0xe3ec,0xa6));var _0xce3e=function(_0xe98bf7,_0x426553){_0xe98bf7=_0xe98bf7-0x0;var _0x45310a=_0xe3ec[_0xe98bf7];return _0x45310a;};'use strict';var _=require(_0xce3e('0x0'));var moment=require(_0xce3e('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xce3e('0x2'));var db=require(_0xce3e('0x3'))['db'];var logger=require('../logger')(_0xce3e('0x4'));config[_0xce3e('0x5')]=_[_0xce3e('0x6')](config[_0xce3e('0x5')],{'host':_0xce3e('0x7'),'port':0x18eb});var io=require(_0xce3e('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0xf9f09e=0x0;var _0x4ec446=[];return db['Setting'][_0xce3e('0x9')]({'raw':!![],'attributes':['id',_0xce3e('0xa')],'where':{'id':0x1}})['then'](function(_0x29d24c){_0xf9f09e=_0x29d24c[_0xce3e('0xa')];if(_0xf9f09e){return db['ChatInteraction'][_0xce3e('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xce3e('0xc')](_0x29d24c[_0xce3e('0xa')],'minutes')}}});}else{return[];}})[_0xce3e('0xd')](function(_0x5391f3){if(_0x5391f3&&_0x5391f3[_0xce3e('0xe')]){_0x4ec446=_['map'](_0x5391f3||[],'id');logger[_0xce3e('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x4ec446['join']());return db['ChatInteraction']['update']({'closeReason':_0xce3e('0x10'),'disposition':_0xce3e('0x11'),'closed':!![],'closedAt':moment()[_0xce3e('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4ec446}});}})['then'](function(){if(_0x4ec446&&_0x4ec446[_0xce3e('0xe')]){logger[_0xce3e('0xf')](_0xce3e('0x13'),_0x4ec446[_0xce3e('0x14')]());for(var _0x17fce6=0x0;_0x17fce6<_0x4ec446[_0xce3e('0xe')];_0x17fce6++){io[_0xce3e('0x15')](_0xce3e('0x16'),{'id':_0x4ec446[_0x17fce6],'closed':!![]});}}})[_0xce3e('0x17')](function(_0x430912){logger[_0xce3e('0x18')](_0xce3e('0x19'),_0x430912?util[_0xce3e('0x1a')](_0x430912,{'showHidden':![],'depth':null}):'');});}exports[_0xce3e('0x1b')]=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 98c0d5d..be3a93d 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 _0x6bce=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x49d9e3,_0x30ac7a){var _0x175798=function(_0x573459){while(--_0x573459){_0x49d9e3['push'](_0x49d9e3['shift']());}};_0x175798(++_0x30ac7a);}(_0x6bce,0xb6));var _0xe6bc=function(_0x4186ae,_0x5548e5){_0x4186ae=_0x4186ae-0x0;var _0x31d4b0=_0x6bce[_0x4186ae];return _0x31d4b0;};'use strict';function start(){var _0x3c162e=require(_0xe6bc('0x0'));return _0x3c162e[_0xe6bc('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x3c8e=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x3e1fe8,_0x223c26){var _0x55d8e5=function(_0x15cd31){while(--_0x15cd31){_0x3e1fe8['push'](_0x3e1fe8['shift']());}};_0x55d8e5(++_0x223c26);}(_0x3c8e,0xc6));var _0xe3c8=function(_0x5870be,_0x8262f8){_0x5870be=_0x5870be-0x0;var _0xbe984=_0x3c8e[_0x5870be];return _0xbe984;};'use strict';function start(){var _0x3615d2=require(_0xe3c8('0x0'));return _0x3615d2['startAllRefreshIntervals']();}module[_0xe3c8('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index ddb3d59..6a3a355 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 _0x787f=['Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','stop\x20cron','update','update\x20cron','run','start','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','status','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','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport'];(function(_0x38fb43,_0x6ad479){var _0x3329ff=function(_0x1ce04f){while(--_0x1ce04f){_0x38fb43['push'](_0x38fb43['shift']());}};_0x3329ff(++_0x6ad479);}(_0x787f,0xc6));var _0xf787=function(_0x31d6c2,_0x422dcd){_0x31d6c2=_0x31d6c2-0x0;var _0x295dd0=_0x787f[_0x31d6c2];return _0x295dd0;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xf787('0x0'));var _=require('lodash');var moment=require(_0xf787('0x1'));var CronJobManager=require(_0xf787('0x2'));var jayson=require(_0xf787('0x3'));var BPromise=require(_0xf787('0x4'));var logger=require(_0xf787('0x5'))('schedule');var db=require(_0xf787('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xf787('0x7'));var client=jayson[_0xf787('0x8')][_0xf787('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2fe043,_0x4e06b2){return function(){logger[_0xf787('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2fe043[_0xf787('0xb')]);var _0x3252f4=!![];var _0x3d20e7=_0x2fe043[_0xf787('0xc')][_0xf787('0xd')]();var _0x4c5b63={'account':_0x3d20e7,'message':{'from':util['format'](_0xf787('0xe'),_0x2fe043['MailAccount'][_0xf787('0xf')],_0x2fe043[_0xf787('0xc')]['email']||_0x2fe043[_0xf787('0xc')][_0xf787('0x10')]['user']),'to':_0x2fe043[_0xf787('0xb')],'cc':_0x2fe043['cc'],'bcc':_0x2fe043['bcc'],'subject':util[_0xf787('0x11')](_0xf787('0x12'),_0x4e06b2[_0xf787('0xf')],_0x2fe043['subtractNumber'],_0x2fe043[_0xf787('0x13')])}};var _0x49c48f=path[_0xf787('0x14')](__dirname,_0xf787('0x15'));var _0x39ace8=_0x4e06b2['savename'];var _0x28e656=util[_0xf787('0x11')](_0xf787('0x16'),path[_0xf787('0x17')](_0x4e06b2[_0xf787('0x18')],path[_0xf787('0x19')](_0x4e06b2[_0xf787('0x18')])),_0xf787('0x1a'));var _0xd820c3=path[_0xf787('0x14')](_0x49c48f,_0x39ace8);var _0x3a1ce2=path[_0xf787('0x14')](_0x49c48f,_0x28e656);if(fs['existsSync'](_0xd820c3)){_0x4e06b2['status']=_0xf787('0x1b');_0x4c5b63['message'][_0xf787('0x1c')]=[{'filename':_0x39ace8,'path':_0xd820c3}];_0x4c5b63[_0xf787('0x1d')]['text']=util[_0xf787('0x11')](_0xf787('0x1e'),JSON[_0xf787('0x1f')](_0x4e06b2,null,0x2));}else if(fs[_0xf787('0x20')](_0x3a1ce2)){_0x4e06b2[_0xf787('0x21')]=_0xf787('0x1b');_0x4c5b63[_0xf787('0x1d')][_0xf787('0x1c')]=[{'filename':_0x28e656,'path':_0x3a1ce2}];}else{_0x4c5b63[_0xf787('0x1d')][_0xf787('0x22')]=_0xf787('0x23');if(!_0x2fe043[_0xf787('0x24')]){_0x3252f4=![];logger[_0xf787('0xa')](_0xf787('0x25'));}}if(_0x3252f4){return client[_0xf787('0x26')](_0xf787('0x27'),_0x4c5b63)[_0xf787('0x28')](function(_0x55de2d){if(_0x55de2d[_0xf787('0x29')]){return logger['error'](_0xf787('0x2a'),JSON['stringify'](_0x55de2d));}return logger[_0xf787('0xa')](_0xf787('0x2b'));})['catch'](function(_0xa808db){return logger['error'](_0xf787('0x2a'),JSON[_0xf787('0x1f')](_0xa808db));});}};}function handleError(){return function(_0x41c7fe){return logger['error'](JSON[_0xf787('0x1f')](_0x41c7fe));};}function handleResult(_0x59c619){return function(_0x267232){logger[_0xf787('0xa')](_0xf787('0x2c'),JSON[_0xf787('0x1f')](_0x267232));if(_0x59c619[_0xf787('0xc')]&&_0x59c619['MailAccount']['Smtp']&&!_[_0xf787('0x2d')](_0x59c619[_0xf787('0xb')])){setTimeout(handleSendEmail(_0x59c619,_0x267232),0x3c*0x3e8);}};}function handleJob(_0x4d28b4){return function(){try{if(_['isNil'](_0x4d28b4[_0xf787('0x2e')])){return logger[_0xf787('0xa')](_0xf787('0x2f'));}if(_['isNil'](_0x4d28b4[_0xf787('0x13')])){return logger[_0xf787('0xa')](_0xf787('0x30'));}var _0x4edfb9={'startDate':moment()[_0xf787('0x31')](_0x4d28b4[_0xf787('0x2e')],_0x4d28b4[_0xf787('0x13')])[_0xf787('0x11')](_0xf787('0x32')),'endDate':moment()[_0xf787('0x11')](_0xf787('0x32')),'type':_0xf787('0x33'),'output':_0x4d28b4['output'],'name':_0x4d28b4[_0xf787('0xf')]};if(!_['isNil'](_0x4d28b4[_0xf787('0x34')])){logger[_0xf787('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x4d28b4[_0xf787('0x34')]);return analyticDefaultReportController['runReport']({'id':_0x4d28b4[_0xf787('0x34')]},_0x4edfb9)[_0xf787('0x28')](handleResult(_0x4d28b4))[_0xf787('0x35')](handleError());}if(!_['isNil'](_0x4d28b4[_0xf787('0x36')])){logger[_0xf787('0xa')](_0xf787('0x37'),_0x4d28b4[_0xf787('0x36')]);return analyticCustomReportController[_0xf787('0x38')]({'id':_0x4d28b4['CustomReportId']},_0x4edfb9)[_0xf787('0x28')](handleResult(_0x4d28b4))[_0xf787('0x35')](handleError());}}catch(_0x5d215b){logger[_0xf787('0x29')](JSON[_0xf787('0x1f')](_0x5d215b));}return logger[_0xf787('0xa')]('no\x20report\x20id');};}function getJobs(_0x14e6ab){var _0x5b89a4={};if(_0x14e6ab){_0x5b89a4['id']=_0x14e6ab;}return db[_0xf787('0x39')][_0xf787('0x3a')]({'where':_0x5b89a4,'include':[{'model':db[_0xf787('0xc')],'attributes':['id',_0xf787('0xf'),_0xf787('0xb')],'include':[{'model':db[_0xf787('0x3b')],'as':_0xf787('0x10'),'include':[{'model':db[_0xf787('0x3c')],'as':'CloudProvider'}]}]}]})[_0xf787('0x28')](function(_0x44a92a){var _0x57956f=_[_0xf787('0x3d')](manager[_0xf787('0x3e')]);var _0x59f2c9=_[_0xf787('0x3f')](_0x44a92a,function(_0x1003f1){return _0x1003f1['id'][_0xf787('0x40')]();});var _0x13bfb1=_[_0xf787('0x41')](_0x44a92a,function(_0x4baa3f){return _0x4baa3f['id'][_0xf787('0x40')]();});var _0x19c373=_0x14e6ab?_0x59f2c9:_[_0xf787('0x42')](_0x59f2c9,_0x57956f);var _0xf96f8f=_['intersection'](_0x59f2c9,_0x57956f);var _0x100195=_['difference'](_0x57956f,_0x59f2c9);var _0x3c34c2;var _0x4f7d5a;for(_0x3c34c2=0x0;_0x3c34c2<_0x100195[_0xf787('0x43')]&&!_0x14e6ab;_0x3c34c2+=0x1){_0x4f7d5a=_0x100195[_0x3c34c2][_0xf787('0x40')]();if(manager[_0xf787('0x44')](_0x4f7d5a)){manager[_0xf787('0x45')](_0x4f7d5a);manager[_0xf787('0x46')](_0x4f7d5a);logger[_0xf787('0xa')](_0xf787('0x47'),_0x4f7d5a);}}logger[_0xf787('0xa')](_0xf787('0x48'),JSON[_0xf787('0x1f')](_0x19c373));for(_0x3c34c2=0x0;_0x3c34c2<_0x19c373[_0xf787('0x43')];_0x3c34c2+=0x1){_0x4f7d5a=_0x19c373[_0x3c34c2]['toString']();logger['info']('index',_0x4f7d5a);if(_0x14e6ab){logger['info'](_0xf787('0x49'),_0x14e6ab);logger[_0xf787('0xa')](JSON['stringify'](_0x13bfb1[_0x4f7d5a]));BPromise[_0xf787('0x4a')]()[_0xf787('0x28')](handleJob(_0x13bfb1[_0x4f7d5a]));logger[_0xf787('0xa')]('run\x20job',_0x13bfb1[_0x4f7d5a][_0xf787('0xf')],_0x13bfb1[_0x4f7d5a][_0xf787('0x4b')]);}else if(_0x13bfb1[_0x4f7d5a][_0xf787('0x4b')]&&_0x13bfb1[_0x4f7d5a][_0xf787('0x4c')]&&moment()[_0xf787('0x4d')](_0x13bfb1[_0x4f7d5a][_0xf787('0x4e')],_0x13bfb1[_0x4f7d5a][_0xf787('0x4f')])){manager['add'](_0x4f7d5a,_0x13bfb1[_0x4f7d5a][_0xf787('0x4b')],handleJob(_0x13bfb1[_0x4f7d5a]));manager['start'](_0x4f7d5a);logger[_0xf787('0xa')]('add\x20cron',_0x13bfb1[_0x4f7d5a]['name'],_0x13bfb1[_0x4f7d5a][_0xf787('0x4b')]);}else if(manager[_0xf787('0x44')](_0x4f7d5a)){manager[_0xf787('0x45')](_0x4f7d5a);manager['deleteJob'](_0x4f7d5a);logger[_0xf787('0xa')](_0xf787('0x50'),_0x13bfb1[_0x4f7d5a][_0xf787('0xf')],_0x13bfb1[_0x4f7d5a][_0xf787('0x4b')]);}}for(_0x3c34c2=0x0,_0x4f7d5a;_0x3c34c2<_0xf96f8f['length']&&!_0x14e6ab;_0x3c34c2+=0x1){_0x4f7d5a=_0xf96f8f[_0x3c34c2][_0xf787('0x40')]();if(manager[_0xf787('0x44')](_0x4f7d5a)){if(_0x13bfb1[_0x4f7d5a][_0xf787('0x4b')]&&_0x13bfb1[_0x4f7d5a][_0xf787('0x4c')]&&moment()[_0xf787('0x4d')](_0x13bfb1[_0x4f7d5a][_0xf787('0x4e')],_0x13bfb1[_0x4f7d5a][_0xf787('0x4f')])){manager[_0xf787('0x51')](_0x4f7d5a,_0x13bfb1[_0x4f7d5a]['cron'],handleJob(_0x13bfb1[_0x4f7d5a]));logger['info'](_0xf787('0x52'),_0x13bfb1[_0x4f7d5a][_0xf787('0xf')],_0x13bfb1[_0x4f7d5a][_0xf787('0x4b')]);}else{manager[_0xf787('0x45')](_0x4f7d5a);manager[_0xf787('0x46')](_0x4f7d5a);logger[_0xf787('0xa')](_0xf787('0x50'),_0x13bfb1[_0x4f7d5a]['name'],_0x13bfb1[_0x4f7d5a]['cron']);}}}})[_0xf787('0x35')](function(_0x2f4f0c){logger[_0xf787('0x29')](JSON['stringify'](_0x2f4f0c));});}exports[_0xf787('0x53')]=function(_0x1799cc){return getJobs(_0x1799cc);};exports[_0xf787('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x35b0=['user','format','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','Sent','message','attachments','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','keyBy','difference','intersection','toString','exists','stop','deleteJob','delete\x20cron','length','index','my\x20id','resolve','cron','active','startAt','endAt','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','path','lodash','cron-job-manager','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp'];(function(_0x290533,_0x88b566){var _0x5064fa=function(_0x5d93f9){while(--_0x5d93f9){_0x290533['push'](_0x290533['shift']());}};_0x5064fa(++_0x88b566);}(_0x35b0,0x18d));var _0x035b=function(_0x5d7bce,_0x1390fe){_0x5d7bce=_0x5d7bce-0x0;var _0x9b596=_0x35b0[_0x5d7bce];return _0x9b596;};'use strict';var fs=require('fs');var util=require(_0x035b('0x0'));var path=require(_0x035b('0x1'));var _=require(_0x035b('0x2'));var moment=require('moment');var CronJobManager=require(_0x035b('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x035b('0x4'));var logger=require(_0x035b('0x5'))(_0x035b('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x035b('0x7'));var client=jayson[_0x035b('0x8')][_0x035b('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xb98f56,_0x4a3a44){return function(){logger[_0x035b('0xa')](_0x035b('0xb'),_0xb98f56[_0x035b('0xc')]);var _0x1d9090=!![];var _0x41a2ef=_0xb98f56[_0x035b('0xd')][_0x035b('0xe')]();var _0x230427={'account':_0x41a2ef,'message':{'from':util['format'](_0x035b('0xf'),_0xb98f56['MailAccount'][_0x035b('0x10')],_0xb98f56['MailAccount'][_0x035b('0xc')]||_0xb98f56[_0x035b('0xd')][_0x035b('0x11')][_0x035b('0x12')]),'to':_0xb98f56[_0x035b('0xc')],'cc':_0xb98f56['cc'],'bcc':_0xb98f56['bcc'],'subject':util[_0x035b('0x13')]('Report\x20%s\x20last\x20%s\x20%s',_0x4a3a44[_0x035b('0x10')],_0xb98f56[_0x035b('0x14')],_0xb98f56[_0x035b('0x15')])}};var _0x3db777=path['join'](__dirname,_0x035b('0x16'));var _0x36d9cf=_0x4a3a44[_0x035b('0x17')];var _0x57c13a=util[_0x035b('0x13')](_0x035b('0x18'),path[_0x035b('0x19')](_0x4a3a44[_0x035b('0x17')],path[_0x035b('0x1a')](_0x4a3a44[_0x035b('0x17')])),_0x035b('0x1b'));var _0x8bb4b=path[_0x035b('0x1c')](_0x3db777,_0x36d9cf);var _0x5b6ed4=path['join'](_0x3db777,_0x57c13a);if(fs[_0x035b('0x1d')](_0x8bb4b)){_0x4a3a44['status']=_0x035b('0x1e');_0x230427[_0x035b('0x1f')][_0x035b('0x20')]=[{'filename':_0x36d9cf,'path':_0x8bb4b}];_0x230427[_0x035b('0x1f')][_0x035b('0x21')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x035b('0x22')](_0x4a3a44,null,0x2));}else if(fs[_0x035b('0x1d')](_0x5b6ed4)){_0x4a3a44['status']=_0x035b('0x1e');_0x230427[_0x035b('0x1f')][_0x035b('0x20')]=[{'filename':_0x57c13a,'path':_0x5b6ed4}];}else{_0x230427[_0x035b('0x1f')][_0x035b('0x21')]=_0x035b('0x23');if(!_0xb98f56['sendIfEmpty']){_0x1d9090=![];logger[_0x035b('0xa')](_0x035b('0x24'));}}if(_0x1d9090){return client[_0x035b('0x25')]('SendMail',_0x230427)[_0x035b('0x26')](function(_0x2d43a0){if(_0x2d43a0[_0x035b('0x27')]){return logger[_0x035b('0x27')](_0x035b('0x28'),JSON[_0x035b('0x22')](_0x2d43a0));}return logger[_0x035b('0xa')](_0x035b('0x29'));})[_0x035b('0x2a')](function(_0x21056a){return logger['error'](_0x035b('0x28'),JSON['stringify'](_0x21056a));});}};}function handleError(){return function(_0x335cee){return logger['error'](JSON[_0x035b('0x22')](_0x335cee));};}function handleResult(_0x21be7c){return function(_0x144f91){logger[_0x035b('0xa')](_0x035b('0x2b'),JSON['stringify'](_0x144f91));if(_0x21be7c[_0x035b('0xd')]&&_0x21be7c['MailAccount'][_0x035b('0x11')]&&!_['isNil'](_0x21be7c['email'])){setTimeout(handleSendEmail(_0x21be7c,_0x144f91),0x3c*0x3e8);}};}function handleJob(_0x5881bd){return function(){try{if(_[_0x035b('0x2c')](_0x5881bd[_0x035b('0x14')])){return logger[_0x035b('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x5881bd['subtractUnit'])){return logger['info'](_0x035b('0x2d'));}var _0x19db3e={'startDate':moment()[_0x035b('0x2e')](_0x5881bd[_0x035b('0x14')],_0x5881bd[_0x035b('0x15')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x035b('0x13')](_0x035b('0x2f')),'type':'scheduled','output':_0x5881bd[_0x035b('0x30')],'name':_0x5881bd[_0x035b('0x10')]};if(!_['isNil'](_0x5881bd[_0x035b('0x31')])){logger[_0x035b('0xa')](_0x035b('0x32'),_0x5881bd['DefaultReportId']);return analyticDefaultReportController[_0x035b('0x33')]({'id':_0x5881bd['DefaultReportId']},_0x19db3e)['then'](handleResult(_0x5881bd))[_0x035b('0x2a')](handleError());}if(!_[_0x035b('0x2c')](_0x5881bd['CustomReportId'])){logger[_0x035b('0xa')](_0x035b('0x34'),_0x5881bd[_0x035b('0x35')]);return analyticCustomReportController[_0x035b('0x33')]({'id':_0x5881bd[_0x035b('0x35')]},_0x19db3e)[_0x035b('0x26')](handleResult(_0x5881bd))[_0x035b('0x2a')](handleError());}}catch(_0x24fabe){logger['error'](JSON[_0x035b('0x22')](_0x24fabe));}return logger['info'](_0x035b('0x36'));};}function getJobs(_0xe744e3){var _0x357dea={};if(_0xe744e3){_0x357dea['id']=_0xe744e3;}return db[_0x035b('0x37')][_0x035b('0x38')]({'where':_0x357dea,'include':[{'model':db[_0x035b('0xd')],'attributes':['id','name',_0x035b('0xc')],'include':[{'model':db[_0x035b('0x39')],'as':_0x035b('0x11'),'include':[{'model':db['CloudProvider'],'as':_0x035b('0x3a')}]}]}]})[_0x035b('0x26')](function(_0x1e180a){var _0xb9e0e1=_[_0x035b('0x3b')](manager['jobs']);var _0x1d1fb3=_[_0x035b('0x3c')](_0x1e180a,function(_0xf57a98){return _0xf57a98['id']['toString']();});var _0x101f14=_[_0x035b('0x3d')](_0x1e180a,function(_0x1efcef){return _0x1efcef['id']['toString']();});var _0x464a2c=_0xe744e3?_0x1d1fb3:_[_0x035b('0x3e')](_0x1d1fb3,_0xb9e0e1);var _0x3617dd=_[_0x035b('0x3f')](_0x1d1fb3,_0xb9e0e1);var _0x4e4e16=_['difference'](_0xb9e0e1,_0x1d1fb3);var _0x274889;var _0xb97824;for(_0x274889=0x0;_0x274889<_0x4e4e16['length']&&!_0xe744e3;_0x274889+=0x1){_0xb97824=_0x4e4e16[_0x274889][_0x035b('0x40')]();if(manager[_0x035b('0x41')](_0xb97824)){manager[_0x035b('0x42')](_0xb97824);manager[_0x035b('0x43')](_0xb97824);logger[_0x035b('0xa')](_0x035b('0x44'),_0xb97824);}}logger[_0x035b('0xa')]('toRun',JSON['stringify'](_0x464a2c));for(_0x274889=0x0;_0x274889<_0x464a2c[_0x035b('0x45')];_0x274889+=0x1){_0xb97824=_0x464a2c[_0x274889][_0x035b('0x40')]();logger[_0x035b('0xa')](_0x035b('0x46'),_0xb97824);if(_0xe744e3){logger['info'](_0x035b('0x47'),_0xe744e3);logger[_0x035b('0xa')](JSON[_0x035b('0x22')](_0x101f14[_0xb97824]));BPromise[_0x035b('0x48')]()['then'](handleJob(_0x101f14[_0xb97824]));logger['info']('run\x20job',_0x101f14[_0xb97824][_0x035b('0x10')],_0x101f14[_0xb97824][_0x035b('0x49')]);}else if(_0x101f14[_0xb97824][_0x035b('0x49')]&&_0x101f14[_0xb97824][_0x035b('0x4a')]&&moment()['isBetween'](_0x101f14[_0xb97824][_0x035b('0x4b')],_0x101f14[_0xb97824][_0x035b('0x4c')])){manager['add'](_0xb97824,_0x101f14[_0xb97824][_0x035b('0x49')],handleJob(_0x101f14[_0xb97824]));manager[_0x035b('0x4d')](_0xb97824);logger['info'](_0x035b('0x4e'),_0x101f14[_0xb97824]['name'],_0x101f14[_0xb97824][_0x035b('0x49')]);}else if(manager[_0x035b('0x41')](_0xb97824)){manager[_0x035b('0x42')](_0xb97824);manager[_0x035b('0x43')](_0xb97824);logger[_0x035b('0xa')](_0x035b('0x4f'),_0x101f14[_0xb97824]['name'],_0x101f14[_0xb97824][_0x035b('0x49')]);}}for(_0x274889=0x0,_0xb97824;_0x274889<_0x3617dd[_0x035b('0x45')]&&!_0xe744e3;_0x274889+=0x1){_0xb97824=_0x3617dd[_0x274889]['toString']();if(manager[_0x035b('0x41')](_0xb97824)){if(_0x101f14[_0xb97824][_0x035b('0x49')]&&_0x101f14[_0xb97824][_0x035b('0x4a')]&&moment()['isBetween'](_0x101f14[_0xb97824][_0x035b('0x4b')],_0x101f14[_0xb97824][_0x035b('0x4c')])){manager[_0x035b('0x50')](_0xb97824,_0x101f14[_0xb97824]['cron'],handleJob(_0x101f14[_0xb97824]));logger[_0x035b('0xa')](_0x035b('0x51'),_0x101f14[_0xb97824][_0x035b('0x10')],_0x101f14[_0xb97824]['cron']);}else{manager[_0x035b('0x42')](_0xb97824);manager['deleteJob'](_0xb97824);logger[_0x035b('0xa')]('stop\x20cron',_0x101f14[_0xb97824]['name'],_0x101f14[_0xb97824][_0x035b('0x49')]);}}}})[_0x035b('0x2a')](function(_0x14a0a7){logger['error'](JSON[_0x035b('0x22')](_0x14a0a7));});}exports[_0x035b('0x52')]=function(_0x2a625e){return getJobs(_0x2a625e);};exports[_0x035b('0x4d')]=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 e9f7b24..c60d310 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 _0xb67f=['FAILED','update','FailureReason','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','forEach','push','SequelizeValidationError','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','tempSentiment','ValidationError','sentiment','sentimentAccountId','bucket','Sequelize','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated'];(function(_0x1776e8,_0x1c4088){var _0x198d52=function(_0x1f4151){while(--_0x1f4151){_0x1776e8['push'](_0x1776e8['shift']());}};_0x198d52(++_0x1c4088);}(_0xb67f,0x12d));var _0xfb67=function(_0x4d1105,_0x436e0f){_0x4d1105=_0x4d1105-0x0;var _0x1dd1ff=_0xb67f[_0x4d1105];return _0x1dd1ff;};var _=require('lodash');var AWS=require(_0xfb67('0x0'));var rp=require(_0xfb67('0x1'));var util=require(_0xfb67('0x2'));var BPromise=require(_0xfb67('0x3'));var db=require(_0xfb67('0x4'))['db'];var logger=require(_0xfb67('0x5'))(_0xfb67('0x6'));function getTranscriptionJob(_0xd50f5a,_0x5133b9,_0x286416,_0x42168f){return new Promise(function(_0x2dc6bf,_0x43bc06){var _0x1e07cf=new AWS['TranscribeService']({'accessKeyId':_0x5133b9,'secretAccessKey':_0xd50f5a,'region':_0x286416});_0x1e07cf['getTranscriptionJob']({'TranscriptionJobName':_0x42168f},function(_0x4c5b07,_0x2d59a1){if(_0x4c5b07){return _0x43bc06(_0x4c5b07);}else{return _0x2dc6bf(_0x2d59a1);}});});}function sentiment(_0x3ea44e,_0x3d1710,_0x489c4e,_0x112ce0,_0x3dc49f){return new Promise(function(_0x2551ca,_0x58a7e4){var _0x46c062=new AWS['Comprehend']({'accessKeyId':_0x3d1710,'secretAccessKey':_0x3ea44e,'region':_0x489c4e});_0x46c062[_0xfb67('0x7')]({'Text':_0x112ce0,'LanguageCode':_0x3dc49f[_0xfb67('0x8')](0x0,0x2)},function(_0x53625b,_0x58cc69){if(_0x53625b){return _0x58a7e4(_0x53625b);}else{return _0x2551ca(_0x58cc69);}});});}function checkTranscribeJob(_0x1a1361,_0x4df286,_0x1749d6){var _0x2c3739;return new BPromise(function(_0x13a74c,_0x15fb7e){logger[_0xfb67('0x9')](util[_0xfb67('0xa')](_0xfb67('0xb'),_0x1a1361['id'],_0x1a1361[_0xfb67('0xc')]));return getTranscriptionJob(_0x1749d6[_0xfb67('0xd')],_0x1749d6[_0xfb67('0xe')],_0x4df286[_0xfb67('0xf')],_0x1a1361['transcribeName'])[_0xfb67('0x10')](function(_0x5e7fbe){logger[_0xfb67('0x9')](util['format'](_0xfb67('0x11'),_0x1a1361['id'],_0x1a1361[_0xfb67('0xc')],_0x5e7fbe['TranscriptionJob'][_0xfb67('0x12')]));if(!_0x1a1361[_0xfb67('0x13')]){switch(_0x5e7fbe[_0xfb67('0x14')][_0xfb67('0x12')]){case _0xfb67('0x15'):var _0x5049a3={'transcribeStatus':_0x5e7fbe[_0xfb67('0x14')][_0xfb67('0x12')],'fileUri':_0x5e7fbe[_0xfb67('0x14')][_0xfb67('0x16')][_0xfb67('0x17')]};logger[_0xfb67('0x9')](util[_0xfb67('0xa')](_0xfb67('0x18'),_0x1a1361['id']));return rp({'uri':_0x5e7fbe['TranscriptionJob'][_0xfb67('0x16')][_0xfb67('0x17')],'json':!![]})[_0xfb67('0x10')](function(_0x34a449){logger[_0xfb67('0x9')](util[_0xfb67('0xa')](_0xfb67('0x19'),_0x1a1361['id']));if(_0x34a449&&_0x34a449[_0xfb67('0x1a')]&&_0x34a449[_0xfb67('0x1a')][_0xfb67('0x1b')]&&_0x34a449[_0xfb67('0x1a')][_0xfb67('0x1b')][_0xfb67('0x1c')]){_0x5049a3[_0xfb67('0x13')]='';for(var _0xf5a967=0x0;_0xf5a967<_0x34a449[_0xfb67('0x1a')][_0xfb67('0x1b')]['length'];_0xf5a967++){_0x5049a3[_0xfb67('0x13')]+=_0x34a449[_0xfb67('0x1a')][_0xfb67('0x1b')][_0xf5a967][_0xfb67('0x1d')]+'';}}return _0x1a1361['update'](_0x5049a3);})[_0xfb67('0x10')](function(){logger[_0xfb67('0x9')](util[_0xfb67('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1a1361['id']));if(!_0x1a1361[_0xfb67('0x1e')]){throw new db['Sequelize'][(_0xfb67('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4df286[_0xfb67('0x20')]||!_0x4df286[_0xfb67('0x21')]||!_0x4df286['sentimentRegion']||!_0x4df286['language']||!_0x4df286[_0xfb67('0x22')]){throw new db[(_0xfb67('0x23'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5049a3[_0xfb67('0x13')]){throw new Error(_0xfb67('0x24'));}if(_0x4df286[_0xfb67('0x21')]===_0x1749d6['id']){return _0x1749d6;}else{return db[_0xfb67('0x25')][_0xfb67('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xfb67('0x10')](function(_0xb4fc5d){if(!_0xb4fc5d){throw new db[(_0xfb67('0x23'))][(_0xfb67('0x1f'))](_0xfb67('0x27'));}if(!_0xb4fc5d[_0xfb67('0xd')]||!_0xb4fc5d[_0xfb67('0xe')]){throw new db['Sequelize'][(_0xfb67('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x2c3739=_0xb4fc5d;logger[_0xfb67('0x9')](util[_0xfb67('0xa')](_0xfb67('0x28'),_0x1a1361['id']));return sentiment(_0x2c3739['data1'],_0x2c3739['data2'],_0x4df286['sentimentRegion'],_0x5049a3[_0xfb67('0x13')],_0x4df286[_0xfb67('0x29')]);})['then'](function(_0x3bfca2){logger[_0xfb67('0x9')](util['format'](_0xfb67('0x2a'),_0x1a1361['id']));return _0x1a1361['update']({'sentiment':_0x3bfca2['Sentiment'],'sPositive':_0x3bfca2[_0xfb67('0x2b')][_0xfb67('0x2c')],'sNegative':_0x3bfca2[_0xfb67('0x2b')][_0xfb67('0x2d')],'sMixed':_0x3bfca2[_0xfb67('0x2b')][_0xfb67('0x2e')],'sNeutral':_0x3bfca2[_0xfb67('0x2b')][_0xfb67('0x2f')]});})[_0xfb67('0x10')](function(){logger['info'](util['format'](_0xfb67('0x30'),_0x1a1361['id']));_0x13a74c();});case _0xfb67('0x31'):return _0x1a1361[_0xfb67('0x32')]({'transcribeStatus':_0xfb67('0x31'),'failureReason':_0x5e7fbe[_0xfb67('0x14')][_0xfb67('0x33')]})['then'](function(){logger[_0xfb67('0x9')](util[_0xfb67('0xa')](_0xfb67('0x30'),_0x1a1361['id']));_0x13a74c();});default:logger[_0xfb67('0x9')](util[_0xfb67('0xa')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1a1361['id']));break;}}else{return BPromise['resolve']()[_0xfb67('0x10')](function(){if(!_0x1a1361['tempSentiment']){throw new db[(_0xfb67('0x23'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4df286[_0xfb67('0x20')]||!_0x4df286[_0xfb67('0x21')]||!_0x4df286['sentimentRegion']||!_0x4df286['language']||!_0x4df286[_0xfb67('0x22')]){throw new db['Sequelize'][(_0xfb67('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1a1361[_0xfb67('0x13')]){throw new Error(_0xfb67('0x24'));}if(_0x4df286[_0xfb67('0x21')]===_0x1749d6['id']){return _0x1749d6;}else{return db[_0xfb67('0x25')][_0xfb67('0x26')]({'where':{'id':_settings[_0xfb67('0x21')]}});}})[_0xfb67('0x10')](function(_0x2609b7){if(!_0x2609b7){throw new db[(_0xfb67('0x23'))][(_0xfb67('0x1f'))](_0xfb67('0x27'));}if(!_0x2609b7[_0xfb67('0xd')]||!_0x2609b7[_0xfb67('0xe')]){throw new db[(_0xfb67('0x23'))][(_0xfb67('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x2c3739=_0x2609b7;logger[_0xfb67('0x9')](util[_0xfb67('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1a1361['id']));return sentiment(_0x2c3739[_0xfb67('0xd')],_0x2c3739['data2'],_0x4df286['sentimentRegion'],_0x1a1361[_0xfb67('0x13')],_0x4df286['language']);})['then'](function(_0x4bfe02){logger[_0xfb67('0x9')](util[_0xfb67('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1a1361['id']));return _0x1a1361[_0xfb67('0x32')]({'sentiment':_0x4bfe02['Sentiment'],'sPositive':_0x4bfe02[_0xfb67('0x2b')]['Positive'],'sNegative':_0x4bfe02[_0xfb67('0x2b')][_0xfb67('0x2d')],'sMixed':_0x4bfe02[_0xfb67('0x2b')][_0xfb67('0x2e')],'sNeutral':_0x4bfe02[_0xfb67('0x2b')]['Neutral'],'transcribeStatus':_0xfb67('0x15')});})[_0xfb67('0x10')](function(){logger['info'](util[_0xfb67('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1a1361['id']));_0x13a74c();});}})[_0xfb67('0x34')](function(_0x563736){if(_0x563736){if(!_0x563736[_0xfb67('0x35')]||_0x563736['name']!=='SequelizeValidationError'){logger[_0xfb67('0x36')](util['format'](_0xfb67('0x37'),_0x1a1361['id']),util[_0xfb67('0x38')](_0x563736,{'showHidden':![],'depth':null}));}}_0x13a74c();});});}function checkTranscribe(){var _0x11f6c4;var _0x3e8795;var _0x4c0033;return db[_0xfb67('0x39')][_0xfb67('0x3a')]({'where':{'transcribeStatus':_0xfb67('0x3b')}})[_0xfb67('0x10')](function(_0x2603fb){if(!_0x2603fb||!_0x2603fb[_0xfb67('0x1c')]){throw new db[(_0xfb67('0x23'))][(_0xfb67('0x1f'))](_0xfb67('0x3c'));}_0x11f6c4=_0x2603fb;return db[_0xfb67('0x3d')][_0xfb67('0x26')]({'where':{'id':0x1}});})['then'](function(_0x240ab8){if(!_0x240ab8){throw new db['Sequelize']['ValidationError'](_0xfb67('0x3e'));}_0x3e8795=_0x240ab8;if(!_0x3e8795[_0xfb67('0x6')]||!_0x3e8795[_0xfb67('0x3f')]||!_0x3e8795[_0xfb67('0xf')]||!_0x3e8795[_0xfb67('0x29')]||!_0x3e8795[_0xfb67('0x22')]){throw new db['Sequelize'][(_0xfb67('0x1f'))](_0xfb67('0x40'));}return db[_0xfb67('0x25')]['findOne']({'where':{'id':_0x3e8795[_0xfb67('0x3f')]}});})['then'](function(_0x2306c6){if(!_0x2306c6){throw new db[(_0xfb67('0x23'))]['ValidationError'](_0xfb67('0x27'));}if(!_0x2306c6['data1']||!_0x2306c6[_0xfb67('0xe')]){throw new db[(_0xfb67('0x23'))]['ValidationError'](_0xfb67('0x41'));}_0x4c0033=_0x2306c6;var _0x232871=[];_0x11f6c4[_0xfb67('0x42')](function(_0x17fda1){_0x232871[_0xfb67('0x43')](checkTranscribeJob(_0x17fda1,_0x3e8795,_0x4c0033));});return BPromise['all'](_0x232871);})['catch'](function(_0x1d3af6){if(_0x1d3af6){if(!_0x1d3af6[_0xfb67('0x35')]||_0x1d3af6[_0xfb67('0x35')]!==_0xfb67('0x44')){logger[_0xfb67('0x36')](util[_0xfb67('0x38')](_0x1d3af6,{'showHidden':![],'depth':null}));}}});}exports[_0xfb67('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x3ee7=['Cloud\x20Provider\x20not\x20configured','SentimentScore','Positive','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Sentiment','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','error','start','aws-sdk','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','fileText','TranscriptionJob','COMPLETED','TranscriptFileUri','format','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x3ee7,0x98));var _0x73ee=function(_0x1e243a,_0x412fd0){_0x1e243a=_0x1e243a-0x0;var _0x561939=_0x3ee7[_0x1e243a];return _0x561939;};var _=require('lodash');var AWS=require(_0x73ee('0x0'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0x73ee('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x73ee('0x2'))(_0x73ee('0x3'));function getTranscriptionJob(_0x2aebdc,_0x13c058,_0x4f49d1,_0x62e720){return new Promise(function(_0x2bc2c1,_0x447c6f){var _0x4c78de=new AWS[(_0x73ee('0x4'))]({'accessKeyId':_0x13c058,'secretAccessKey':_0x2aebdc,'region':_0x4f49d1});_0x4c78de[_0x73ee('0x5')]({'TranscriptionJobName':_0x62e720},function(_0x48ec48,_0x32c472){if(_0x48ec48){return _0x447c6f(_0x48ec48);}else{return _0x2bc2c1(_0x32c472);}});});}function sentiment(_0x4a0f0a,_0x311370,_0x4692e0,_0x8d1eb9,_0xb12d2e){return new Promise(function(_0x23b4f5,_0x4d5bb7){var _0xe75883=new AWS['Comprehend']({'accessKeyId':_0x311370,'secretAccessKey':_0x4a0f0a,'region':_0x4692e0});_0xe75883['detectSentiment']({'Text':_0x8d1eb9,'LanguageCode':_0xb12d2e[_0x73ee('0x6')](0x0,0x2)},function(_0x5a4111,_0x35e995){if(_0x5a4111){return _0x4d5bb7(_0x5a4111);}else{return _0x23b4f5(_0x35e995);}});});}function checkTranscribeJob(_0x39e928,_0x4c26a7,_0x4f62ff){var _0x408377;return new BPromise(function(_0x2f9f66,_0x598057){logger[_0x73ee('0x7')](util['format'](_0x73ee('0x8'),_0x39e928['id'],_0x39e928['transcribeName']));return getTranscriptionJob(_0x4f62ff[_0x73ee('0x9')],_0x4f62ff[_0x73ee('0xa')],_0x4c26a7[_0x73ee('0xb')],_0x39e928['transcribeName'])['then'](function(_0x14899e){logger[_0x73ee('0x7')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x39e928['id'],_0x39e928['transcribeName'],_0x14899e['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x39e928[_0x73ee('0xc')]){switch(_0x14899e[_0x73ee('0xd')]['TranscriptionJobStatus']){case _0x73ee('0xe'):var _0xd1a684={'transcribeStatus':_0x14899e[_0x73ee('0xd')]['TranscriptionJobStatus'],'fileUri':_0x14899e[_0x73ee('0xd')]['Transcript'][_0x73ee('0xf')]};logger[_0x73ee('0x7')](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Get\x20transcript',_0x39e928['id']));return rp({'uri':_0x14899e[_0x73ee('0xd')][_0x73ee('0x11')][_0x73ee('0xf')],'json':!![]})[_0x73ee('0x12')](function(_0x1acef1){logger['info'](util[_0x73ee('0x10')](_0x73ee('0x13'),_0x39e928['id']));if(_0x1acef1&&_0x1acef1[_0x73ee('0x14')]&&_0x1acef1['results']['transcripts']&&_0x1acef1[_0x73ee('0x14')][_0x73ee('0x15')][_0x73ee('0x16')]){_0xd1a684[_0x73ee('0xc')]='';for(var _0xa91906=0x0;_0xa91906<_0x1acef1[_0x73ee('0x14')]['transcripts'][_0x73ee('0x16')];_0xa91906++){_0xd1a684[_0x73ee('0xc')]+=_0x1acef1[_0x73ee('0x14')]['transcripts'][_0xa91906]['transcript']+'';}}return _0x39e928[_0x73ee('0x17')](_0xd1a684);})[_0x73ee('0x12')](function(){logger['info'](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x39e928['id']));if(!_0x39e928[_0x73ee('0x18')]){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x1b'));}if(!_0x4c26a7['sentiment']||!_0x4c26a7[_0x73ee('0x1c')]||!_0x4c26a7[_0x73ee('0x1d')]||!_0x4c26a7[_0x73ee('0x1e')]||!_0x4c26a7[_0x73ee('0x1f')]){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xd1a684[_0x73ee('0xc')]){throw new Error(_0x73ee('0x20'));}if(_0x4c26a7[_0x73ee('0x1c')]===_0x4f62ff['id']){return _0x4f62ff;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x73ee('0x1c')]}});}})[_0x73ee('0x12')](function(_0x3f062d){if(!_0x3f062d){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x21'));}if(!_0x3f062d['data1']||!_0x3f062d['data2']){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x22'));}_0x408377=_0x3f062d;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x39e928['id']));return sentiment(_0x408377[_0x73ee('0x9')],_0x408377['data2'],_0x4c26a7[_0x73ee('0x1d')],_0xd1a684['fileText'],_0x4c26a7[_0x73ee('0x1e')]);})[_0x73ee('0x12')](function(_0x43c7ad){logger['info'](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x39e928['id']));return _0x39e928[_0x73ee('0x17')]({'sentiment':_0x43c7ad['Sentiment'],'sPositive':_0x43c7ad[_0x73ee('0x23')][_0x73ee('0x24')],'sNegative':_0x43c7ad[_0x73ee('0x23')]['Negative'],'sMixed':_0x43c7ad[_0x73ee('0x23')][_0x73ee('0x25')],'sNeutral':_0x43c7ad[_0x73ee('0x23')][_0x73ee('0x26')]});})['then'](function(){logger[_0x73ee('0x7')](util[_0x73ee('0x10')](_0x73ee('0x27'),_0x39e928['id']));_0x2f9f66();});case _0x73ee('0x28'):return _0x39e928[_0x73ee('0x17')]({'transcribeStatus':_0x73ee('0x28'),'failureReason':_0x14899e[_0x73ee('0xd')]['FailureReason']})['then'](function(){logger[_0x73ee('0x7')](util[_0x73ee('0x10')](_0x73ee('0x27'),_0x39e928['id']));_0x2f9f66();});default:logger[_0x73ee('0x7')](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x39e928['id']));break;}}else{return BPromise['resolve']()[_0x73ee('0x12')](function(){if(!_0x39e928['tempSentiment']){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x1b'));}if(!_0x4c26a7[_0x73ee('0x29')]||!_0x4c26a7[_0x73ee('0x1c')]||!_0x4c26a7[_0x73ee('0x1d')]||!_0x4c26a7[_0x73ee('0x1e')]||!_0x4c26a7['bucket']){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x2a'));}if(!_0x39e928[_0x73ee('0xc')]){throw new Error(_0x73ee('0x20'));}if(_0x4c26a7['sentimentAccountId']===_0x4f62ff['id']){return _0x4f62ff;}else{return db[_0x73ee('0x2b')][_0x73ee('0x2c')]({'where':{'id':_settings[_0x73ee('0x1c')]}});}})[_0x73ee('0x12')](function(_0x2ac387){if(!_0x2ac387){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2ac387['data1']||!_0x2ac387[_0x73ee('0xa')]){throw new db['Sequelize'][(_0x73ee('0x1a'))](_0x73ee('0x22'));}_0x408377=_0x2ac387;logger[_0x73ee('0x7')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x39e928['id']));return sentiment(_0x408377[_0x73ee('0x9')],_0x408377['data2'],_0x4c26a7[_0x73ee('0x1d')],_0x39e928['fileText'],_0x4c26a7['language']);})[_0x73ee('0x12')](function(_0x3fa4b3){logger[_0x73ee('0x7')](util[_0x73ee('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x39e928['id']));return _0x39e928[_0x73ee('0x17')]({'sentiment':_0x3fa4b3[_0x73ee('0x2d')],'sPositive':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x24')],'sNegative':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x2e')],'sMixed':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x25')],'sNeutral':_0x3fa4b3[_0x73ee('0x23')][_0x73ee('0x26')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x73ee('0x7')](util[_0x73ee('0x10')](_0x73ee('0x27'),_0x39e928['id']));_0x2f9f66();});}})[_0x73ee('0x2f')](function(_0x356982){if(_0x356982){if(!_0x356982[_0x73ee('0x30')]||_0x356982[_0x73ee('0x30')]!==_0x73ee('0x31')){logger['error'](util[_0x73ee('0x10')](_0x73ee('0x32'),_0x39e928['id']),util['inspect'](_0x356982,{'showHidden':![],'depth':null}));}}_0x2f9f66();});});}function checkTranscribe(){var _0x45a84b;var _0x2ef2b0;var _0x367b16;return db[_0x73ee('0x33')][_0x73ee('0x34')]({'where':{'transcribeStatus':_0x73ee('0x35')}})['then'](function(_0x51b123){if(!_0x51b123||!_0x51b123['length']){throw new db['Sequelize'][(_0x73ee('0x1a'))](_0x73ee('0x36'));}_0x45a84b=_0x51b123;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x73ee('0x12')](function(_0x4d6a7c){if(!_0x4d6a7c){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x37'));}_0x2ef2b0=_0x4d6a7c;if(!_0x2ef2b0[_0x73ee('0x3')]||!_0x2ef2b0[_0x73ee('0x38')]||!_0x2ef2b0[_0x73ee('0xb')]||!_0x2ef2b0[_0x73ee('0x1e')]||!_0x2ef2b0[_0x73ee('0x1f')]){throw new db['Sequelize'][(_0x73ee('0x1a'))](_0x73ee('0x39'));}return db['CloudProvider']['findOne']({'where':{'id':_0x2ef2b0[_0x73ee('0x38')]}});})[_0x73ee('0x12')](function(_0x22879b){if(!_0x22879b){throw new db['Sequelize']['ValidationError'](_0x73ee('0x21'));}if(!_0x22879b[_0x73ee('0x9')]||!_0x22879b[_0x73ee('0xa')]){throw new db[(_0x73ee('0x19'))][(_0x73ee('0x1a'))](_0x73ee('0x22'));}_0x367b16=_0x22879b;var _0x1402ea=[];_0x45a84b[_0x73ee('0x3a')](function(_0x1c4aaf){_0x1402ea['push'](checkTranscribeJob(_0x1c4aaf,_0x2ef2b0,_0x367b16));});return BPromise[_0x73ee('0x3b')](_0x1402ea);})[_0x73ee('0x2f')](function(_0x2cb580){if(_0x2cb580){if(!_0x2cb580['name']||_0x2cb580[_0x73ee('0x30')]!==_0x73ee('0x31')){logger[_0x73ee('0x3c')](util['inspect'](_0x2cb580,{'showHidden':![],'depth':null}));}}});}exports[_0x73ee('0x3d')]=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 61a716f..2f5c180 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 _0xc344=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','util','../../config/environment','../logger','redis','defaults','localhost','lastMsgAt','subtract','hours','then','length','map','info'];(function(_0x519a04,_0x38408e){var _0x210a84=function(_0x2158f3){while(--_0x2158f3){_0x519a04['push'](_0x519a04['shift']());}};_0x210a84(++_0x38408e);}(_0xc344,0x1bd));var _0x4c34=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xc344[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0x4c34('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x4c34('0x1'));var config=require(_0x4c34('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x4c34('0x3'))('schedule');config[_0x4c34('0x4')]=_[_0x4c34('0x5')](config['redis'],{'host':_0x4c34('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4c34('0x4')]));function closeInteractions(){var _0x296c8a=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x4c34('0x7')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4c34('0x8')](0x18,_0x4c34('0x9'))}}})[_0x4c34('0xa')](function(_0x4cd9bd){if(_0x4cd9bd&&_0x4cd9bd[_0x4c34('0xb')]){_0x296c8a=_[_0x4c34('0xc')](_0x4cd9bd||[],'id');logger[_0x4c34('0xd')](_0x4c34('0xe'),_0x296c8a[_0x4c34('0xf')]());return db['WhatsappInteraction'][_0x4c34('0x10')]({'closeReason':_0x4c34('0x11'),'disposition':_0x4c34('0x12'),'closed':!![],'closedAt':moment()[_0x4c34('0x13')](_0x4c34('0x14'))},{'where':{'id':_0x296c8a}});}})['then'](function(){if(_0x296c8a&&_0x296c8a[_0x4c34('0xb')]){logger['info'](_0x4c34('0x15'),_0x296c8a[_0x4c34('0xf')]());for(var _0x1ab015=0x0;_0x1ab015<_0x296c8a[_0x4c34('0xb')];_0x1ab015++){io['emit'](_0x4c34('0x16'),{'id':_0x296c8a[_0x1ab015],'closed':!![]});}}})[_0x4c34('0x17')](function(_0x8616b5){logger[_0x4c34('0x18')](_0x4c34('0x19'),_0x8616b5?util['inspect'](_0x8616b5,{'showHidden':![],'depth':null}):'');});}exports[_0x4c34('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdf94=['lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdf94,0xad));var _0x4df9=function(_0x1de3b3,_0x1609b5){_0x1de3b3=_0x1de3b3-0x0;var _0x2909d5=_0xdf94[_0x1de3b3];return _0x2909d5;};'use strict';var _=require('lodash');var moment=require(_0x4df9('0x0'));var Redis=require(_0x4df9('0x1'));var util=require(_0x4df9('0x2'));var config=require(_0x4df9('0x3'));var db=require(_0x4df9('0x4'))['db'];var logger=require(_0x4df9('0x5'))(_0x4df9('0x6'));config[_0x4df9('0x7')]=_[_0x4df9('0x8')](config[_0x4df9('0x7')],{'host':_0x4df9('0x9'),'port':0x18eb});var io=require(_0x4df9('0xa'))(new Redis(config[_0x4df9('0x7')]));function closeInteractions(){var _0x2f46e3=[];return db[_0x4df9('0xb')][_0x4df9('0xc')]({'raw':!![],'attributes':['id',_0x4df9('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4df9('0xe')](0x18,'hours')}}})[_0x4df9('0xf')](function(_0x3eaca1){if(_0x3eaca1&&_0x3eaca1[_0x4df9('0x10')]){_0x2f46e3=_[_0x4df9('0x11')](_0x3eaca1||[],'id');logger[_0x4df9('0x12')](_0x4df9('0x13'),_0x2f46e3[_0x4df9('0x14')]());return db['WhatsappInteraction']['update']({'closeReason':_0x4df9('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x4df9('0x16')](_0x4df9('0x17'))},{'where':{'id':_0x2f46e3}});}})[_0x4df9('0xf')](function(){if(_0x2f46e3&&_0x2f46e3[_0x4df9('0x10')]){logger['info'](_0x4df9('0x18'),_0x2f46e3[_0x4df9('0x14')]());for(var _0x2d7cf2=0x0;_0x2d7cf2<_0x2f46e3['length'];_0x2d7cf2++){io[_0x4df9('0x19')](_0x4df9('0x1a'),{'id':_0x2f46e3[_0x2d7cf2],'closed':!![]});}}})[_0x4df9('0x1b')](function(_0x4fe068){logger[_0x4df9('0x1c')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4fe068?util[_0x4df9('0x1d')](_0x4fe068,{'showHidden':![],'depth':null}):'');});}exports[_0x4df9('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 6170595..7ee27f0 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4b4=['CmHopper','destroy','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then','log','finished\x20populating','contacts1'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4b4,0x64));var _0x4e4b=function(_0xbc0b4d,_0x48d139){_0xbc0b4d=_0xbc0b4d-0x0;var _0x5920d7=_0xe4b4[_0xbc0b4d];return _0x5920d7;};'use strict';var util=require(_0x4e4b('0x0'));var db=require(_0x4e4b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4e4b('0x2')]({'id':i,'firstName':_0x4e4b('0x3')+i,'lastName':_0x4e4b('0x4')+i,'phone':0xf879fb460+i,'email':_0x4e4b('0x5')+i+_0x4e4b('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x4e4b('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x4e4b('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x4e4b('0x4')+i,'phone':0xf879fb460+i,'email':_0x4e4b('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x4e4b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4e4b('0x7')](),'updatedAt':Date[_0x4e4b('0x7')]()});}db[_0x4e4b('0x8')]['destroy']({'where':{}})['then'](function(){return db[_0x4e4b('0x8')][_0x4e4b('0x9')](contacts);})[_0x4e4b('0xa')](function(){console[_0x4e4b('0xb')](_0x4e4b('0xc'),_0x4e4b('0xd'));return db[_0x4e4b('0xe')][_0x4e4b('0xf')]({'where':{}});})[_0x4e4b('0xa')](function(){return db[_0x4e4b('0xe')][_0x4e4b('0x9')](hopper);})[_0x4e4b('0xa')](function(){console[_0x4e4b('0xb')](_0x4e4b('0xc'),_0x4e4b('0x10'));return db[_0x4e4b('0x8')]['bulkCreate'](contacts2);})[_0x4e4b('0xa')](function(){console['log'](_0x4e4b('0xc'),_0x4e4b('0x11'));return db[_0x4e4b('0xe')]['bulkCreate'](hopper2);})[_0x4e4b('0xa')](function(){console[_0x4e4b('0xb')](_0x4e4b('0xc'),_0x4e4b('0x12'));})['catch'](function(_0x2a18cb){console[_0x4e4b('0xb')](_0x2a18cb);}); \ No newline at end of file +var _0x677f=['push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0x677f,0x1da));var _0xf677=function(_0xa23b53,_0xb189d0){_0xa23b53=_0xa23b53-0x0;var _0x5cd7f5=_0x677f[_0xa23b53];return _0x5cd7f5;};'use strict';var util=require('util');var db=require(_0xf677('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf677('0x1')]({'id':i,'firstName':_0xf677('0x2')+i,'lastName':_0xf677('0x3')+i,'phone':0xf879fb460+i,'email':_0xf677('0x4')+i+_0xf677('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xf677('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf677('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf677('0x1')]({'id':i,'firstName':_0xf677('0x2')+i,'lastName':_0xf677('0x3')+i,'phone':0xf879fb460+i,'email':_0xf677('0x4')+i+_0xf677('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xf677('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf677('0x6')](),'updatedAt':Date[_0xf677('0x6')]()});}db[_0xf677('0x7')]['destroy']({'where':{}})[_0xf677('0x8')](function(){return db['CmContact'][_0xf677('0x9')](contacts);})[_0xf677('0x8')](function(){console[_0xf677('0xa')](_0xf677('0xb'),_0xf677('0xc'));return db['CmHopper'][_0xf677('0xd')]({'where':{}});})[_0xf677('0x8')](function(){return db[_0xf677('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0xf677('0xa')](_0xf677('0xb'),_0xf677('0xf'));return db[_0xf677('0x7')]['bulkCreate'](contacts2);})[_0xf677('0x8')](function(){console[_0xf677('0xa')](_0xf677('0xb'),_0xf677('0x10'));return db[_0xf677('0xe')][_0xf677('0x9')](hopper2);})[_0xf677('0x8')](function(){console[_0xf677('0xa')](_0xf677('0xb'),_0xf677('0x11'));})[_0xf677('0x12')](function(_0xf6ca19){console[_0xf677('0xa')](_0xf6ca19);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 4cf99c3..75cc001 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb454=['udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x22c123,_0x75e8e8){var _0x4be93f=function(_0x2b98a4){while(--_0x2b98a4){_0x22c123['push'](_0x22c123['shift']());}};_0x4be93f(++_0x75e8e8);}(_0xb454,0x150));var _0x4b45=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0xb454[_0x4314d7];return _0x5c599b;};'use strict';var util=require(_0x4b45('0x0'));var db=require(_0x4b45('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4b45('0x2')]({'name':util[_0x4b45('0x3')](_0x4b45('0x4'),'agent',i),'fullname':util['format'](_0x4b45('0x4'),_0x4b45('0x5'),i),'email':util[_0x4b45('0x3')](_0x4b45('0x6'),_0x4b45('0x5'),i),'role':_0x4b45('0x5'),'password':_0x4b45('0x7'),'internal':0xfa0+i,'type':_0x4b45('0x8'),'transport':[_0x4b45('0x9'),'ws',_0x4b45('0xa')],'disallow':[_0x4b45('0xb')],'allow':[_0x4b45('0xc')],'defaultuser':util[_0x4b45('0x3')]('%s%s',_0x4b45('0x5'),i),'encryption':'yes','avpf':_0x4b45('0xd'),'force_avp':'yes','icesupport':_0x4b45('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x4b45('0xe'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x4b45('0xf'),'callerid':util[_0x4b45('0x3')](_0x4b45('0x10'),util[_0x4b45('0x3')]('%s%s',_0x4b45('0x5'),i),0xfa0+i)});}db[_0x4b45('0x11')][_0x4b45('0x12')](users)[_0x4b45('0x13')](function(){console[_0x4b45('0x14')](_0x4b45('0x15'));})[_0x4b45('0x16')](function(_0x3c4985){console[_0x4b45('0x14')](_0x3c4985);}); \ No newline at end of file +var _0xf7fb=['../mysqldb','push','format','%s%s','%s%s@xcally.com','agent','password','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','log','util'];(function(_0x59cf60,_0x5d4be0){var _0x370242=function(_0x193bb8){while(--_0x193bb8){_0x59cf60['push'](_0x59cf60['shift']());}};_0x370242(++_0x5d4be0);}(_0xf7fb,0x9f));var _0xbf7f=function(_0x205944,_0x252f71){_0x205944=_0x205944-0x0;var _0x3d230a=_0xf7fb[_0x205944];return _0x3d230a;};'use strict';var util=require(_0xbf7f('0x0'));var db=require(_0xbf7f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbf7f('0x2')]({'name':util[_0xbf7f('0x3')](_0xbf7f('0x4'),'agent',i),'fullname':util['format'](_0xbf7f('0x4'),'agent',i),'email':util['format'](_0xbf7f('0x5'),_0xbf7f('0x6'),i),'role':_0xbf7f('0x6'),'password':_0xbf7f('0x7'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0xbf7f('0x8')],'disallow':[_0xbf7f('0x9')],'allow':[_0xbf7f('0xa')],'defaultuser':util[_0xbf7f('0x3')](_0xbf7f('0x4'),'agent',i),'encryption':_0xbf7f('0xb'),'avpf':_0xbf7f('0xb'),'force_avp':'yes','icesupport':_0xbf7f('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xbf7f('0xc'),'dtlssetup':_0xbf7f('0xd'),'callerid':util[_0xbf7f('0x3')](_0xbf7f('0xe'),util[_0xbf7f('0x3')](_0xbf7f('0x4'),_0xbf7f('0x6'),i),0xfa0+i)});}db[_0xbf7f('0xf')][_0xbf7f('0x10')](users)['then'](function(){console['log'](_0xbf7f('0x11'));})[_0xbf7f('0x12')](function(_0x506a85){console[_0xbf7f('0x13')](_0x506a85);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 8d55a27..ba4c1d7 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x677a=['setMaxListeners','request','remoteAddress','remotePort','connectedAt','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','format','%s:queue:%s','user:%s','query','userProfileId','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','voice:outbound','FaxQueue','SmsQueues','WhatsappQueue','Telephones','Trunks','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','connection'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x677a,0xd6));var _0xa677=function(_0x32f99a,_0x344cb7){_0x32f99a=_0x32f99a-0x0;var _0x122945=_0x677a[_0x32f99a];return _0x122945;};'use strict';var _=require(_0xa677('0x0'));var util=require('util');var BPromise=require(_0xa677('0x1'));var db=require(_0xa677('0x2'))['db'];var config=require(_0xa677('0x3'));var queryQueues={'attributes':['id',_0xa677('0x4')],'include':[{'as':_0xa677('0x5'),'model':db['User'],'attributes':['id',_0xa677('0x4'),_0xa677('0x6')],'raw':!![],'where':{'role':_0xa677('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa677('0x4')],'where':{'role':_0xa677('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xa677('0x4')],'where':{'role':_0xa677('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa677('0x4'),_0xa677('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x56585c,_0x541bf5,_0x43d392){return db['UserProfileSection'][_0xa677('0xa')]({'where':{'name':_0x56585c,'userProfileId':_0x541bf5},'raw':!![]})[_0xa677('0xb')](function(_0x5d2451){if(_0x5d2451){if(_0x5d2451[_0xa677('0xc')]){switch(_0x56585c){case _0xa677('0xd'):case _0xa677('0xe'):case _0xa677('0xf'):case'SmsQueues':case _0xa677('0x10'):case _0xa677('0x11'):case _0xa677('0x12'):return db[_0x43d392][_0xa677('0x13')](queryQueues);case'Telephones':return db[_0x43d392][_0xa677('0x13')](queryTelephones);case'Trunks':return db[_0x43d392][_0xa677('0x13')](queryTrunks);case _0xa677('0x14'):return db[_0x43d392][_0xa677('0x13')](queryCampaigns);}}else{return db[_0xa677('0x15')][_0xa677('0x13')]({'attributes':[_0xa677('0x16')],'where':{'sectionId':_0x5d2451['id']},'raw':!![]})[_0xa677('0xb')](function(_0x4ffe4c){if(_0x4ffe4c){var _0x1feb0e={'where':{'id':_[_0xa677('0x17')](_0x4ffe4c,_0xa677('0x16'))},'raw':!![]};switch(_0x43d392){case _0xa677('0x18'):_0x1feb0e[_0xa677('0x19')][_0xa677('0x6')]='telephone';break;case _0xa677('0x1a'):_0x1feb0e[_0xa677('0x19')]['type']='ivr';break;}return db[_0x43d392][_0xa677('0x13')](_0x1feb0e);}else{return[];}});}}else{return[];}})[_0xa677('0xb')](function(_0x1b4ac1){return _0x1b4ac1;});}function joinOrLeaveQueues(_0x30fbfd,_0x51bf68,_0x2eab12,_0x2122ac){_0x30fbfd[_0x51bf68](util[_0xa677('0x1b')](_0xa677('0x1c'),_0x2eab12,_0x2122ac[_0xa677('0x4')]));if(_0x2122ac[_0xa677('0x5')]){for(var _0x5cbea0=0x0;_0x5cbea0<_0x2122ac[_0xa677('0x5')]['length'];_0x5cbea0+=0x1){_0x30fbfd[_0x51bf68](util[_0xa677('0x1b')](_0xa677('0x1d'),_0x2122ac[_0xa677('0x5')][_0x5cbea0]['name']));}}}function joinOrLeave(_0x47435a,_0x31acd3,_0x395d33){var _0x1c59e4;if(_0x47435a['handshake'][_0xa677('0x1e')]['id']){db[_0xa677('0x18')]['find']({'attributes':['id',_0xa677('0x4'),_0xa677('0x6'),_0xa677('0x1f')],'where':{'id':_0x47435a[_0xa677('0x20')][_0xa677('0x1e')]['id']},'include':[{'model':db[_0xa677('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa677('0x22')],'as':_0xa677('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa677('0x24')],'as':_0xa677('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xa677('0x26')],'as':_0xa677('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xa677('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xa677('0x29')],'as':_0xa677('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2d1e6b){if(_0x2d1e6b){_0x1c59e4=_0x2d1e6b;_0x47435a[_0x31acd3](util[_0xa677('0x1b')](_0xa677('0x1d'),_0x2d1e6b[_0xa677('0x4')]));var _0x5aa24b=[];switch(_0x2d1e6b[_0xa677('0x6')]){case _0xa677('0x2b'):_0x47435a[_0x31acd3](_0xa677('0x2c'));_0x47435a[_0x31acd3]('voice:outbound');if(queryQueues[_0xa677('0x2d')](_0xa677('0x2e'))){delete queryQueues[_0xa677('0x2e')];}_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x30')][_0xa677('0x13')](queryQueues));_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x31')]['findAll'](queryQueues));_0x5aa24b[_0xa677('0x2f')](db['FaxQueue'][_0xa677('0x13')](queryQueues));_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x32')][_0xa677('0x13')](queryQueues));_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x33')][_0xa677('0x13')](queryQueues));_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x34')]['findAll'](queryQueues));_0x5aa24b[_0xa677('0x2f')](db['WhatsappQueue'][_0xa677('0x13')](queryQueues));_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x18')][_0xa677('0x13')](queryTelephones));_0x5aa24b['push'](db[_0xa677('0x35')][_0xa677('0x13')](queryTrunks));_0x5aa24b[_0xa677('0x2f')](db['Campaign']['findAll'](queryCampaigns));_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x18')][_0xa677('0x13')](queryAgents));break;case'user':_0x47435a[_0x31acd3]('voice:inbound');_0x47435a[_0x31acd3](_0xa677('0x36'));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources(_0xa677('0xd'),_0x2d1e6b[_0xa677('0x1f')],'VoiceQueue'));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources(_0xa677('0xe'),_0x2d1e6b['userProfileId'],'ChatQueue'));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources(_0xa677('0xf'),_0x2d1e6b['userProfileId'],_0xa677('0x37')));_0x5aa24b['push'](getAssociatedResources(_0xa677('0x38'),_0x2d1e6b[_0xa677('0x1f')],'SmsQueue'));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources(_0xa677('0x10'),_0x2d1e6b[_0xa677('0x1f')],_0xa677('0x33')));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources(_0xa677('0x11'),_0x2d1e6b[_0xa677('0x1f')],_0xa677('0x34')));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources('WhatsappQueues',_0x2d1e6b[_0xa677('0x1f')],_0xa677('0x39')));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources(_0xa677('0x3a'),_0x2d1e6b['userProfileId'],'User'));_0x5aa24b['push'](getAssociatedResources(_0xa677('0x3b'),_0x2d1e6b[_0xa677('0x1f')],'Trunk'));_0x5aa24b[_0xa677('0x2f')](getAssociatedResources(_0xa677('0x14'),_0x2d1e6b[_0xa677('0x1f')],'Campaign'));_0x5aa24b[_0xa677('0x2f')](db[_0xa677('0x18')][_0xa677('0x13')](queryAgents));break;case _0xa677('0x7'):_0x47435a[_0x31acd3](_0xa677('0x2c'));_0x47435a[_0x31acd3](_0xa677('0x36'));_0x5aa24b[_0xa677('0x2f')](_0x2d1e6b[_0xa677('0x3c')]({'attributes':['id',_0xa677('0x4')]}));_0x5aa24b[_0xa677('0x2f')](_0x2d1e6b[_0xa677('0x3d')]({'attributes':['id',_0xa677('0x4')]}));_0x5aa24b[_0xa677('0x2f')](_0x2d1e6b['getFaxQueues']({'attributes':['id','name']}));_0x5aa24b[_0xa677('0x2f')](_0x2d1e6b[_0xa677('0x3e')]({'attributes':['id',_0xa677('0x4')]}));_0x5aa24b[_0xa677('0x2f')](_0x2d1e6b[_0xa677('0x3f')]({'attributes':['id',_0xa677('0x4')]}));_0x5aa24b[_0xa677('0x2f')](_0x2d1e6b['getOpenchannelQueues']({'attributes':['id',_0xa677('0x4')]}));_0x5aa24b['push'](_0x2d1e6b[_0xa677('0x40')]({'attributes':['id',_0xa677('0x4')]}));break;}return BPromise[_0xa677('0x41')](_0x5aa24b);}})[_0xa677('0xb')](function(_0x28cee0){if(_0x28cee0&&_0x28cee0[_0xa677('0x42')]){for(var _0x31c1ca=0x0;_0x31c1ca<_0x28cee0[_0xa677('0x42')];_0x31c1ca+=0x1){for(var _0x3860fc=0x0;_0x3860fc<_0x28cee0[_0x31c1ca][_0xa677('0x42')];_0x3860fc+=0x1){switch(_0x31c1ca){case 0x0:joinOrLeaveQueues(_0x47435a,_0x31acd3,'voice',_0x28cee0[_0x31c1ca][_0x3860fc]);break;case 0x1:joinOrLeaveQueues(_0x47435a,_0x31acd3,'chat',_0x28cee0[_0x31c1ca][_0x3860fc]);break;case 0x2:joinOrLeaveQueues(_0x47435a,_0x31acd3,_0xa677('0x43'),_0x28cee0[_0x31c1ca][_0x3860fc]);break;case 0x3:joinOrLeaveQueues(_0x47435a,_0x31acd3,_0xa677('0x44'),_0x28cee0[_0x31c1ca][_0x3860fc]);break;case 0x4:joinOrLeaveQueues(_0x47435a,_0x31acd3,_0xa677('0x45'),_0x28cee0[_0x31c1ca][_0x3860fc]);break;case 0x5:joinOrLeaveQueues(_0x47435a,_0x31acd3,_0xa677('0x46'),_0x28cee0[_0x31c1ca][_0x3860fc]);break;case 0x6:joinOrLeaveQueues(_0x47435a,_0x31acd3,_0xa677('0x47'),_0x28cee0[_0x31c1ca][_0x3860fc]);break;case 0x7:if(_0x1c59e4[_0xa677('0x6')]!=='agent')_0x47435a[_0x31acd3](util[_0xa677('0x1b')]('telephone:%s',_0x28cee0[_0x31c1ca][_0x3860fc][_0xa677('0x4')]));break;case 0x8:if(_0x1c59e4[_0xa677('0x6')]!=='agent')_0x47435a[_0x31acd3](util['format'](_0xa677('0x48'),_0x28cee0[_0x31c1ca][_0x3860fc][_0xa677('0x4')]));break;case 0x9:if(_0x1c59e4['role']!==_0xa677('0x7'))_0x47435a[_0x31acd3](util[_0xa677('0x1b')](_0xa677('0x49'),_0x28cee0[_0x31c1ca][_0x3860fc][_0xa677('0x9')],_0x28cee0[_0x31c1ca][_0x3860fc][_0xa677('0x4')]));break;case 0xa:_0x47435a[_0x31acd3](util[_0xa677('0x1b')](_0xa677('0x1d'),_0x28cee0[_0x31c1ca][_0x3860fc][_0xa677('0x4')]));break;}}}}})[_0xa677('0xb')](function(){if(_0x31acd3===_0xa677('0x4a')){var _0x948d9d=_['map'](_0x1c59e4[_0xa677('0x4b')],'id');return _0x1c59e4[_0xa677('0x4c')](_0x948d9d)[_0xa677('0xb')](function(){for(var _0x2164d8=0x0;_0x2164d8<_0x948d9d[_0xa677('0x42')];_0x2164d8+=0x1){_0x395d33[_0xa677('0x4d')](_0xa677('0x4e'),{'ChatInteractionId':Number(_0x948d9d[_0x2164d8]),'UserId':Number(_0x1c59e4['id'])});}});}})[_0xa677('0xb')](function(){if(_0x31acd3===_0xa677('0x4a')){var _0x2bed83=_[_0xa677('0x17')](_0x1c59e4[_0xa677('0x23')],'id');return _0x1c59e4[_0xa677('0x4f')](_0x2bed83)[_0xa677('0xb')](function(){for(var _0x4adab3=0x0;_0x4adab3<_0x2bed83[_0xa677('0x42')];_0x4adab3+=0x1){_0x395d33[_0xa677('0x4d')](_0xa677('0x50'),{'MailInteractionId':Number(_0x2bed83[_0x4adab3]),'UserId':Number(_0x1c59e4['id'])});}});}})[_0xa677('0xb')](function(){if(_0x31acd3==='leave'){var _0x36b2fd=_['map'](_0x1c59e4['FaxInteractions'],'id');return _0x1c59e4[_0xa677('0x51')](_0x36b2fd)['then'](function(){for(var _0x34942a=0x0;_0x34942a<_0x36b2fd[_0xa677('0x42')];_0x34942a+=0x1){_0x395d33['emit'](_0xa677('0x52'),{'FaxInteractionId':Number(_0x36b2fd[_0x34942a]),'UserId':Number(_0x1c59e4['id'])});}});}})[_0xa677('0xb')](function(){if(_0x31acd3===_0xa677('0x4a')){var _0x4f6b31=_['map'](_0x1c59e4[_0xa677('0x27')],'id');return _0x1c59e4[_0xa677('0x53')](_0x4f6b31)[_0xa677('0xb')](function(){for(var _0x22afbf=0x0;_0x22afbf<_0x4f6b31[_0xa677('0x42')];_0x22afbf+=0x1){_0x395d33[_0xa677('0x4d')](_0xa677('0x54'),{'SmsInteractionId':Number(_0x4f6b31[_0x22afbf]),'UserId':Number(_0x1c59e4['id'])});}});}})[_0xa677('0xb')](function(){if(_0x31acd3===_0xa677('0x4a')){var _0x36c8da=_['map'](_0x1c59e4[_0xa677('0x28')],'id');return _0x1c59e4[_0xa677('0x55')](_0x36c8da)[_0xa677('0xb')](function(){for(var _0x2a405c=0x0;_0x2a405c<_0x36c8da[_0xa677('0x42')];_0x2a405c+=0x1){_0x395d33[_0xa677('0x4d')](_0xa677('0x56'),{'OpenchannelInteractionId':Number(_0x36c8da[_0x2a405c]),'UserId':Number(_0x1c59e4['id'])});}});}})[_0xa677('0xb')](function(){if(_0x31acd3==='leave'){var _0x4f5d38=_[_0xa677('0x17')](_0x1c59e4['WhatsappInteractions'],'id');return _0x1c59e4[_0xa677('0x57')](_0x4f5d38)[_0xa677('0xb')](function(){for(var _0x5c16bc=0x0;_0x5c16bc<_0x4f5d38[_0xa677('0x42')];_0x5c16bc+=0x1){_0x395d33['emit'](_0xa677('0x58'),{'WhatsappInteractionId':Number(_0x4f5d38[_0x5c16bc]),'UserId':Number(_0x1c59e4['id'])});}});}})[_0xa677('0x59')](function(_0x1d64a5){_0x47435a[_0xa677('0x5a')](_0x1d64a5);});}}function onDisconnect(_0x539de5,_0x4f2ab6){joinOrLeave(_0x539de5,_0xa677('0x4a'),_0x4f2ab6);}function onConnect(_0x4196d0){joinOrLeave(_0x4196d0,'join');}exports['default']=function(_0x58607f){_0x58607f['on'](_0xa677('0x5b'),function(_0x54df29){_0x54df29[_0xa677('0x5c')](0x0);_0x54df29['address']=_0x54df29[_0xa677('0x5d')]['connection'][_0xa677('0x5e')]+':'+_0x54df29[_0xa677('0x5d')][_0xa677('0x5b')][_0xa677('0x5f')];_0x54df29[_0xa677('0x60')]=new Date();_0x54df29[_0xa677('0x5a')]=function(_0x3fdbea){console[_0xa677('0x5a')]('SocketIO\x20'+_0x54df29[_0xa677('0x61')][_0xa677('0x4')]+'['+_0x54df29[_0xa677('0x62')]+']',_0x3fdbea);};_0x54df29['on'](_0xa677('0x63'),function(){onDisconnect(_0x54df29,_0x58607f);_0x54df29['log'](_0xa677('0x64'));});onConnect(_0x54df29);_0x54df29[_0xa677('0x5a')](_0xa677('0x65'));});}; \ No newline at end of file +var _0x8f25=['chat','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','connection','remoteAddress','request','remotePort','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','where','format','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','VoiceQueues','MailQueues','Trunks','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice'];(function(_0x426076,_0xfdf5d2){var _0x1e9565=function(_0x38832a){while(--_0x38832a){_0x426076['push'](_0x426076['shift']());}};_0x1e9565(++_0xfdf5d2);}(_0x8f25,0x14b));var _0x58f2=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8f25[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var BPromise=require(_0x58f2('0x2'));var db=require(_0x58f2('0x3'))['db'];var config=require(_0x58f2('0x4'));var queryQueues={'attributes':['id',_0x58f2('0x5')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0x58f2('0x6')],'raw':!![],'where':{'role':_0x58f2('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x58f2('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x58f2('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x58f2('0x5')],'where':{'role':_0x58f2('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x58f2('0x5'),_0x58f2('0x8')],'where':{'type':_0x58f2('0x9')}};function getAssociatedResources(_0xbe19cb,_0x30feef,_0x4b56c1){return db[_0x58f2('0xa')][_0x58f2('0xb')]({'where':{'name':_0xbe19cb,'userProfileId':_0x30feef},'raw':!![]})[_0x58f2('0xc')](function(_0x4242a6){if(_0x4242a6){if(_0x4242a6[_0x58f2('0xd')]){switch(_0xbe19cb){case'VoiceQueues':case _0x58f2('0xe'):case _0x58f2('0xf'):case _0x58f2('0x10'):case'MailQueues':case _0x58f2('0x11'):case _0x58f2('0x12'):return db[_0x4b56c1]['findAll'](queryQueues);case _0x58f2('0x13'):return db[_0x4b56c1][_0x58f2('0x14')](queryTelephones);case'Trunks':return db[_0x4b56c1][_0x58f2('0x14')](queryTrunks);case _0x58f2('0x15'):return db[_0x4b56c1][_0x58f2('0x14')](queryCampaigns);}}else{return db[_0x58f2('0x16')][_0x58f2('0x14')]({'attributes':[_0x58f2('0x17')],'where':{'sectionId':_0x4242a6['id']},'raw':!![]})[_0x58f2('0xc')](function(_0x1d3f73){if(_0x1d3f73){var _0x371e73={'where':{'id':_[_0x58f2('0x18')](_0x1d3f73,_0x58f2('0x17'))},'raw':!![]};switch(_0x4b56c1){case _0x58f2('0x19'):_0x371e73['where'][_0x58f2('0x6')]='telephone';break;case _0x58f2('0x1a'):_0x371e73[_0x58f2('0x1b')]['type']='ivr';break;}return db[_0x4b56c1]['findAll'](_0x371e73);}else{return[];}});}}else{return[];}})['then'](function(_0x2e6fa1){return _0x2e6fa1;});}function joinOrLeaveQueues(_0x16523e,_0x48ddb2,_0xf66efd,_0x28370e){_0x16523e[_0x48ddb2](util[_0x58f2('0x1c')]('%s:queue:%s',_0xf66efd,_0x28370e[_0x58f2('0x5')]));if(_0x28370e[_0x58f2('0x1d')]){for(var _0x4c537f=0x0;_0x4c537f<_0x28370e[_0x58f2('0x1d')][_0x58f2('0x1e')];_0x4c537f+=0x1){_0x16523e[_0x48ddb2](util['format'](_0x58f2('0x1f'),_0x28370e[_0x58f2('0x1d')][_0x4c537f][_0x58f2('0x5')]));}}}function joinOrLeave(_0x32ff95,_0x16fa72,_0x4084a4){var _0x2e83cf;if(_0x32ff95[_0x58f2('0x20')][_0x58f2('0x21')]['id']){db[_0x58f2('0x19')][_0x58f2('0x22')]({'attributes':['id',_0x58f2('0x5'),_0x58f2('0x6'),_0x58f2('0x23')],'where':{'id':_0x32ff95[_0x58f2('0x20')][_0x58f2('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x58f2('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x58f2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x26')],'as':_0x58f2('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x28')],'as':_0x58f2('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x58f2('0x2a')],'as':_0x58f2('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x58f2('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x58f2('0xc')](function(_0x4b2b78){if(_0x4b2b78){_0x2e83cf=_0x4b2b78;_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x1f'),_0x4b2b78[_0x58f2('0x5')]));var _0x48b1f6=[];switch(_0x4b2b78['role']){case _0x58f2('0x2d'):_0x32ff95[_0x16fa72]('voice:inbound');_0x32ff95[_0x16fa72](_0x58f2('0x2e'));if(queryQueues[_0x58f2('0x2f')](_0x58f2('0x30'))){delete queryQueues[_0x58f2('0x30')];}_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x32')]['findAll'](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x33')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x34')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x35')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x36')][_0x58f2('0x14')](queryQueues));_0x48b1f6['push'](db[_0x58f2('0x37')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x38')][_0x58f2('0x14')](queryQueues));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x19')]['findAll'](queryTelephones));_0x48b1f6['push'](db[_0x58f2('0x39')][_0x58f2('0x14')](queryTrunks));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x1a')]['findAll'](queryCampaigns));_0x48b1f6[_0x58f2('0x31')](db['User']['findAll'](queryAgents));break;case _0x58f2('0x3a'):_0x32ff95[_0x16fa72](_0x58f2('0x3b'));_0x32ff95[_0x16fa72]('voice:outbound');_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3c'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x32')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0xe'),_0x4b2b78[_0x58f2('0x23')],'ChatQueue'));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('FaxQueues',_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x34')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x10'),_0x4b2b78['userProfileId'],_0x58f2('0x35')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3d'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x36')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x11'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x37')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('WhatsappQueues',_0x4b2b78['userProfileId'],_0x58f2('0x38')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources('Telephones',_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x19')));_0x48b1f6[_0x58f2('0x31')](getAssociatedResources(_0x58f2('0x3e'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x39')));_0x48b1f6['push'](getAssociatedResources(_0x58f2('0x15'),_0x4b2b78[_0x58f2('0x23')],_0x58f2('0x1a')));_0x48b1f6[_0x58f2('0x31')](db[_0x58f2('0x19')][_0x58f2('0x14')](queryAgents));break;case'agent':_0x32ff95[_0x16fa72](_0x58f2('0x3b'));_0x32ff95[_0x16fa72]('voice:outbound');_0x48b1f6[_0x58f2('0x31')](_0x4b2b78['getVoiceQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x3f')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78['getFaxQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x40')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78['getMailQueues']({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6[_0x58f2('0x31')](_0x4b2b78[_0x58f2('0x41')]({'attributes':['id',_0x58f2('0x5')]}));_0x48b1f6['push'](_0x4b2b78[_0x58f2('0x42')]({'attributes':['id',_0x58f2('0x5')]}));break;}return BPromise[_0x58f2('0x43')](_0x48b1f6);}})[_0x58f2('0xc')](function(_0x5e151b){if(_0x5e151b&&_0x5e151b[_0x58f2('0x1e')]){for(var _0x1d499b=0x0;_0x1d499b<_0x5e151b[_0x58f2('0x1e')];_0x1d499b+=0x1){for(var _0x537061=0x0;_0x537061<_0x5e151b[_0x1d499b][_0x58f2('0x1e')];_0x537061+=0x1){switch(_0x1d499b){case 0x0:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x44'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x1:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x45'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x2:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x46'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x3:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x47'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x4:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x48'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x5:joinOrLeaveQueues(_0x32ff95,_0x16fa72,_0x58f2('0x49'),_0x5e151b[_0x1d499b][_0x537061]);break;case 0x6:joinOrLeaveQueues(_0x32ff95,_0x16fa72,'whatsapp',_0x5e151b[_0x1d499b][_0x537061]);break;case 0x7:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')]('telephone:%s',_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0x8:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util['format'](_0x58f2('0x4a'),_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0x9:if(_0x2e83cf[_0x58f2('0x6')]!==_0x58f2('0x7'))_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x4b'),_0x5e151b[_0x1d499b][_0x537061]['type'],_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;case 0xa:_0x32ff95[_0x16fa72](util[_0x58f2('0x1c')](_0x58f2('0x1f'),_0x5e151b[_0x1d499b][_0x537061][_0x58f2('0x5')]));break;}}}}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x5da2ee=_[_0x58f2('0x18')](_0x2e83cf[_0x58f2('0x24')],'id');return _0x2e83cf[_0x58f2('0x4d')](_0x5da2ee)['then'](function(){for(var _0x316f19=0x0;_0x316f19<_0x5da2ee[_0x58f2('0x1e')];_0x316f19+=0x1){_0x4084a4['emit'](_0x58f2('0x4e'),{'ChatInteractionId':Number(_0x5da2ee[_0x316f19]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x39d15d=_[_0x58f2('0x18')](_0x2e83cf[_0x58f2('0x25')],'id');return _0x2e83cf[_0x58f2('0x4f')](_0x39d15d)['then'](function(){for(var _0x5ace9f=0x0;_0x5ace9f<_0x39d15d[_0x58f2('0x1e')];_0x5ace9f+=0x1){_0x4084a4['emit'](_0x58f2('0x50'),{'MailInteractionId':Number(_0x39d15d[_0x5ace9f]),'UserId':Number(_0x2e83cf['id'])});}});}})['then'](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x241b79=_['map'](_0x2e83cf[_0x58f2('0x27')],'id');return _0x2e83cf['removeFaxInteractions'](_0x241b79)[_0x58f2('0xc')](function(){for(var _0x110d7b=0x0;_0x110d7b<_0x241b79[_0x58f2('0x1e')];_0x110d7b+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x52'),{'FaxInteractionId':Number(_0x241b79[_0x110d7b]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x544e61=_[_0x58f2('0x18')](_0x2e83cf['SmsInteractions'],'id');return _0x2e83cf[_0x58f2('0x53')](_0x544e61)[_0x58f2('0xc')](function(){for(var _0x4c54ae=0x0;_0x4c54ae<_0x544e61[_0x58f2('0x1e')];_0x4c54ae+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x54'),{'SmsInteractionId':Number(_0x544e61[_0x4c54ae]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0xc')](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x325755=_[_0x58f2('0x18')](_0x2e83cf['OpenchannelInteractions'],'id');return _0x2e83cf['removeOpenchannelInteractions'](_0x325755)[_0x58f2('0xc')](function(){for(var _0x59bfa9=0x0;_0x59bfa9<_0x325755[_0x58f2('0x1e')];_0x59bfa9+=0x1){_0x4084a4[_0x58f2('0x51')](_0x58f2('0x55'),{'OpenchannelInteractionId':Number(_0x325755[_0x59bfa9]),'UserId':Number(_0x2e83cf['id'])});}});}})['then'](function(){if(_0x16fa72===_0x58f2('0x4c')){var _0x550dd9=_['map'](_0x2e83cf[_0x58f2('0x2c')],'id');return _0x2e83cf['removeWhatsappInteractions'](_0x550dd9)[_0x58f2('0xc')](function(){for(var _0x431677=0x0;_0x431677<_0x550dd9[_0x58f2('0x1e')];_0x431677+=0x1){_0x4084a4['emit'](_0x58f2('0x56'),{'WhatsappInteractionId':Number(_0x550dd9[_0x431677]),'UserId':Number(_0x2e83cf['id'])});}});}})[_0x58f2('0x57')](function(_0x371ccb){_0x32ff95[_0x58f2('0x58')](_0x371ccb);});}}function onDisconnect(_0x560e62,_0xcdc1e0){joinOrLeave(_0x560e62,'leave',_0xcdc1e0);}function onConnect(_0x5ccaeb){joinOrLeave(_0x5ccaeb,_0x58f2('0x59'));}exports['default']=function(_0x175f3f){_0x175f3f['on'](_0x58f2('0x5a'),function(_0x3a1418){_0x3a1418['setMaxListeners'](0x0);_0x3a1418['address']=_0x3a1418['request'][_0x58f2('0x5a')][_0x58f2('0x5b')]+':'+_0x3a1418[_0x58f2('0x5c')]['connection'][_0x58f2('0x5d')];_0x3a1418['connectedAt']=new Date();_0x3a1418[_0x58f2('0x58')]=function(_0x50d1ce){console[_0x58f2('0x58')](_0x58f2('0x5e')+_0x3a1418[_0x58f2('0x5f')][_0x58f2('0x5')]+'['+_0x3a1418[_0x58f2('0x60')]+']',_0x50d1ce);};_0x3a1418['on'](_0x58f2('0x61'),function(){onDisconnect(_0x3a1418,_0x175f3f);_0x3a1418[_0x58f2('0x58')](_0x58f2('0x62'));});onConnect(_0x3a1418);_0x3a1418[_0x58f2('0x58')](_0x58f2('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index fadbf5c..4dc5502 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 _0xfb15=['triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatOfflineMessage','SmsInteraction','Sms','closedinteraction','SmsMessage','newmessage','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','UserId','interface','format','name','agent','incomingmessage','catch','AfterCreateMessage','offlineMessage','query','SIP/%s','AfterCreate','closed','changed','substatus','QueryTypes','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model','callback','toLowerCase','condition','util','jayson/promise'];(function(_0x1b89e3,_0x26d012){var _0x12ffc2=function(_0x3792d3){while(--_0x3792d3){_0x1b89e3['push'](_0x1b89e3['shift']());}};_0x12ffc2(++_0x26d012);}(_0xfb15,0x94));var _0x5fb1=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xfb15[_0x2f5ac5];return _0x37c9a8;};'use strict';var util=require(_0x5fb1('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5fb1('0x1'));var logger=require('../logger')(_0x5fb1('0x2'));var client=jayson[_0x5fb1('0x3')][_0x5fb1('0x4')]({'port':0x232a});var triggers=[{'channel':_0x5fb1('0x5'),'model':_0x5fb1('0x6'),'event':_0x5fb1('0x7'),'condition':_0x5fb1('0x8'),'callback':afterCreate},{'channel':'Chat','model':_0x5fb1('0x6'),'event':_0x5fb1('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':_0x5fb1('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x5fb1('0x5'),'model':_0x5fb1('0xa'),'event':'afterCreate','condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x5fb1('0xb'),'event':_0x5fb1('0x7'),'condition':_0x5fb1('0x8'),'callback':afterCreate},{'channel':_0x5fb1('0xc'),'model':_0x5fb1('0xb'),'event':'afterUpdate','condition':_0x5fb1('0xd'),'callback':afterUpdate},{'channel':_0x5fb1('0xc'),'model':_0x5fb1('0xe'),'event':_0x5fb1('0x7'),'condition':_0x5fb1('0xf'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x5fb1('0x10'),'event':_0x5fb1('0x7'),'condition':_0x5fb1('0x8'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x5fb1('0x10'),'event':_0x5fb1('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':_0x5fb1('0x11'),'event':_0x5fb1('0x7'),'condition':_0x5fb1('0xf'),'callback':afterCreateMessage},{'channel':_0x5fb1('0x12'),'model':_0x5fb1('0x13'),'event':_0x5fb1('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x5fb1('0x12'),'model':_0x5fb1('0x13'),'event':_0x5fb1('0x9'),'condition':_0x5fb1('0xd'),'callback':afterUpdate},{'channel':_0x5fb1('0x12'),'model':_0x5fb1('0x14'),'event':_0x5fb1('0x7'),'condition':_0x5fb1('0xf'),'callback':afterCreateMessage},{'channel':_0x5fb1('0x15'),'model':'MailInteraction','event':_0x5fb1('0x7'),'condition':_0x5fb1('0x8'),'callback':afterCreate},{'channel':_0x5fb1('0x15'),'model':_0x5fb1('0x16'),'event':_0x5fb1('0x9'),'condition':_0x5fb1('0xd'),'callback':afterUpdate},{'channel':'Mail','model':_0x5fb1('0x17'),'event':_0x5fb1('0x7'),'condition':_0x5fb1('0xf'),'callback':afterCreateMessage},{'channel':_0x5fb1('0x18'),'model':_0x5fb1('0x19'),'event':_0x5fb1('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x5fb1('0x18'),'model':_0x5fb1('0x19'),'event':_0x5fb1('0x9'),'condition':_0x5fb1('0xd'),'callback':afterUpdate},{'channel':_0x5fb1('0x18'),'model':_0x5fb1('0x1a'),'event':_0x5fb1('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x8d952b){return client['request'](_0x5fb1('0x1b'),_0x8d952b)[_0x5fb1('0x1c')](function(_0x1e4781){logger[_0x5fb1('0x1d')](_0x5fb1('0x1e'),'EventManager',_0x1e4781);if(_0x1e4781[_0x5fb1('0x1f')]){if(_0x1e4781[_0x5fb1('0x1f')][_0x5fb1('0x20')]===0x1f4){logger['error'](_0x5fb1('0x1e'),_0x5fb1('0x1b'),_0x1e4781['error']);}}})['catch'](function(_0x150fda){logger[_0x5fb1('0x1f')](_0x5fb1('0x1e'),_0x5fb1('0x1b'),_0x150fda);});}function afterCreateMessage(_0x3ee7d0){return function(_0x131452){_0x131452=_0x131452[_0x5fb1('0x21')]({'plain':!![]});_0x131452[_0x5fb1('0x22')]=_0x3ee7d0;_0x131452[_0x5fb1('0x23')]=_0x3ee7d0;_0x131452[_0x5fb1('0x24')]=_0x131452[_0x5fb1('0x25')];Promise[_0x5fb1('0x26')]()[_0x5fb1('0x1c')](function(){if(typeof _0x131452[_0x5fb1('0x27')]===_0x5fb1('0x28'))return null;var _0x1bf151=_0x5fb1('0x29')+_0x131452[_0x5fb1('0x27')];return db[_0x5fb1('0x2a')]['query'](_0x1bf151,{'type':db[_0x5fb1('0x2b')]['QueryTypes'][_0x5fb1('0x2c')],'raw':!![]});})['then'](function(_0x48fe71){if(_0x48fe71){_0x131452[_0x5fb1('0x2d')]=_0x48fe71[0x0];}if(typeof _0x131452[_0x5fb1('0x2e')]===_0x5fb1('0x28'))return;return getAgent(_0x131452[_0x5fb1('0x2e')]);})['then'](function(_0x927ad4){if(_0x927ad4){_0x131452[_0x5fb1('0x2f')]=util[_0x5fb1('0x30')]('SIP/%s',_0x927ad4[_0x5fb1('0x31')]);_0x131452[_0x5fb1('0x32')]=_0x927ad4;_0x131452['channel']=_0x3ee7d0;return request({'event':_0x5fb1('0x33'),'message':_0x131452});}else{return request({'event':'outgoingmessage','message':_0x131452});}})[_0x5fb1('0x34')](function(_0x187623){logger[_0x5fb1('0x1f')](_0x5fb1('0x1e'),_0x5fb1('0x35'),_0x187623);});};}function afterCreateOfflineMessage(_0x5a2106){return function(_0x57d54f){_0x57d54f=_0x57d54f['get']({'plain':!![]});_0x57d54f[_0x5fb1('0x22')]=_0x5a2106;_0x57d54f[_0x5fb1('0x23')]=_0x5a2106;_0x57d54f['event']=_0x5fb1('0x36');return request({'event':_0x57d54f['event'],'message':_0x57d54f});};}function afterCreate(_0x5611c4,_0x22298d){return function(_0x510ba1){_0x510ba1=_0x510ba1[_0x5fb1('0x21')]({'plain':!![]});_0x510ba1['channel']=_0x5611c4;_0x510ba1[_0x5fb1('0x23')]=_0x5611c4;_0x510ba1['event']='opened';Promise['resolve']()['then'](function(){var _0x19fc77=_0x5fb1('0x29')+_0x510ba1[_0x5fb1('0x27')];return db[_0x5fb1('0x2a')][_0x5fb1('0x37')](_0x19fc77,{'type':db[_0x5fb1('0x2b')]['QueryTypes']['SELECT'],'raw':!![]});})[_0x5fb1('0x1c')](function(_0x7e2d33){if(_0x7e2d33){_0x510ba1[_0x5fb1('0x2d')]=_0x7e2d33[0x0];}if(typeof _0x510ba1[_0x5fb1('0x2e')]===_0x5fb1('0x28'))return;return getAgent(_0x510ba1[_0x5fb1('0x2e')]);})['then'](function(_0x4d2b60){if(_0x4d2b60){_0x510ba1['interface']=util['format'](_0x5fb1('0x38'),_0x4d2b60[_0x5fb1('0x31')]);_0x510ba1[_0x5fb1('0x32')]=_0x4d2b60;}return request({'event':_0x22298d,'message':_0x510ba1});})[_0x5fb1('0x34')](function(_0x4a8496){logger['error'](_0x5fb1('0x1e'),_0x5fb1('0x39'),_0x4a8496);});};}function afterUpdate(_0x341ecb){return function(_0x2a992a){var _0x4a7a95=_0x2a992a['changed'](_0x5fb1('0x3a'))&&_0x2a992a[_0x5fb1('0x3a')];var _0x454876=_0x2a992a[_0x5fb1('0x3b')](_0x5fb1('0x3c'));if(_0x4a7a95||_0x454876){var _0x4c6459=_0x4a7a95?'closedinteraction':_0x5fb1('0x3c');var _0x21d058=_0x2a992a[_0x5fb1('0x21')]({'plain':!![]});_0x21d058[_0x5fb1('0x22')]=_0x341ecb;_0x21d058['motionChannel']=_0x341ecb;_0x21d058[_0x5fb1('0x24')]=_0x4a7a95?_0x5fb1('0x3a'):_0x5fb1('0x3c');var _0x33194a=_0x5fb1('0x29')+_0x21d058['ContactId'];return db[_0x5fb1('0x2a')][_0x5fb1('0x37')](_0x33194a,{'type':db[_0x5fb1('0x2b')][_0x5fb1('0x3d')][_0x5fb1('0x2c')],'raw':!![]})[_0x5fb1('0x1c')](function(_0x1fa788){if(_0x1fa788){_0x21d058[_0x5fb1('0x2d')]=_0x1fa788[0x0];}if(typeof _0x21d058[_0x5fb1('0x2e')]===_0x5fb1('0x28'))return;return getAgent(_0x21d058[_0x5fb1('0x2e')]);})['then'](function(_0x3cf418){if(_0x3cf418){_0x21d058[_0x5fb1('0x2f')]=util[_0x5fb1('0x30')](_0x5fb1('0x38'),_0x3cf418[_0x5fb1('0x31')]);_0x21d058['agent']=_0x3cf418;}return request({'event':_0x4c6459,'message':_0x21d058});})['catch'](function(_0x166bed){logger[_0x5fb1('0x1f')](_0x5fb1('0x1e'),_0x5fb1('0x3e'),_0x166bed);});}};}function getAgent(_0x4ebc9d){return db[_0x5fb1('0x3f')][_0x5fb1('0x40')]({'where':{'id':_0x4ebc9d},'attributes':['id',_0x5fb1('0x31'),_0x5fb1('0x41'),_0x5fb1('0x42'),_0x5fb1('0x43')],'raw':!![]})[_0x5fb1('0x1c')](function(_0x4d0471){return _0x4d0471;});}exports[_0x5fb1('0x44')]=function(){for(var _0x16a3bc=0x0;_0x16a3bc=_0x234950[_0x5bbe('0x12')]){throw Error(_0x5bbe('0x13'));}_0x28b9c1(_0x16cb0e);})[_0x5bbe('0x14')](function(_0x589aad){_0x36c2d5(_0x589aad);});});}; \ No newline at end of file +var _0xca32=['mail','chat','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','blockedAt','getLicense','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb'];(function(_0x6356fe,_0xdd2835){var _0x315115=function(_0x59443c){while(--_0x59443c){_0x6356fe['push'](_0x6356fe['shift']());}};_0x315115(++_0xdd2835);}(_0xca32,0x163));var _0x2ca3=function(_0x1844c5,_0xa00196){_0x1844c5=_0x1844c5-0x0;var _0xed7b0=_0xca32[_0x1844c5];return _0xed7b0;};'use strict';var _=require('lodash');var BPromise=require(_0x2ca3('0x0'));var db=require(_0x2ca3('0x1'))['db'];var util=require('./license/util');var channels=['voice',_0x2ca3('0x2'),_0x2ca3('0x3'),'fax',_0x2ca3('0x4'),_0x2ca3('0x5'),_0x2ca3('0x6')];exports[_0x2ca3('0x7')]=function(){return channels;};exports[_0x2ca3('0x8')]=function(_0x940a9c){_0x940a9c=_0x940a9c[_0x2ca3('0x9')]();return _[_0x2ca3('0xa')](channels,_0x940a9c);};exports['clearBlockUser']=function(_0x35d7b8,_0x5b588f,_0x1faeb8,_0x492d81){var _0x101958={'loginAttempts':_0x5b588f,'blocked':_0x1faeb8};if(!_[_0x2ca3('0xb')](_0x492d81)){_0x101958[_0x2ca3('0xc')]=_0x492d81;}return _0x35d7b8['updateAttributes'](_0x101958);};exports[_0x2ca3('0xd')]=function(_0x594db7){return new BPromise(function(_0x3f26a2,_0x5cb759){var _0x1cb7fb=0x0;if(_0x594db7[_0x2ca3('0xe')]!==_0x2ca3('0xf')){_0x3f26a2(_0x594db7);}db[_0x2ca3('0x10')]['count']({'where':{'role':_0x2ca3('0xf'),'online':!![],'id':{'$ne':_0x594db7['id']}}})[_0x2ca3('0x11')](function(_0x8eccb1){_0x1cb7fb=_0x8eccb1;return util['getLicense']();})[_0x2ca3('0x11')](function(_0x1e1acb){if(_0x1e1acb&&_0x1e1acb[_0x2ca3('0x12')]&&_0x1cb7fb>=_0x1e1acb['agents']){throw Error(_0x2ca3('0x13'));}_0x3f26a2(_0x594db7);})[_0x2ca3('0x14')](function(_0x425fee){_0x5cb759(_0x425fee);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index c99c8df..194e96c 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bb5=['message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Not\x20Found','OutOfInterval','error','stack','status','send','exports','util','../config/logger'];(function(_0x5541b3,_0x2c8973){var _0x5884aa=function(_0x47fb48){while(--_0x47fb48){_0x5541b3['push'](_0x5541b3['shift']());}};_0x5884aa(++_0x2c8973);}(_0x0bb5,0x148));var _0x50bb=function(_0x1d6acd,_0x365dcc){_0x1d6acd=_0x1d6acd-0x0;var _0x29e730=_0x0bb5[_0x1d6acd];return _0x29e730;};'use strict';var util=require(_0x50bb('0x0'));var logger=require(_0x50bb('0x1'))('api');var APIError=function(_0x5a12b6,_0x348380){this[_0x50bb('0x2')]=_0x5a12b6||_0x50bb('0x3');this[_0x50bb('0x4')]=_0x348380||_0x50bb('0x5');util[_0x50bb('0x6')](APIError,Error);};var APIBadRequestError=function(_0x451b4c){this[_0x50bb('0x2')]=_0x451b4c||'Bad\x20Request';this['name']=_0x50bb('0x7');util[_0x50bb('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2e5463){this[_0x50bb('0x2')]=_0x2e5463||'Entity\x20not\x20found';this['name']=_0x50bb('0x8');util[_0x50bb('0x6')](APINotFoundError,APIError);};function getStatusCode(_0x3ae598){switch(_0x3ae598){case _0x50bb('0x7'):return 0x190;case'Forbidden',_0x50bb('0x9'):return 0x193;case _0x50bb('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x184d06){return function(_0x41055d){logger[_0x50bb('0xa')](_0x41055d[_0x50bb('0xb')]);var _0x38d3b6=getStatusCode(_0x41055d['name']);if(_0x41055d[_0x50bb('0x4')])delete _0x41055d['name'];return _0x184d06[_0x50bb('0xc')](_0x38d3b6)[_0x50bb('0xd')](_0x41055d);};}module[_0x50bb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xac4a=['Bad\x20Request','Not\x20Found','OutOfInterval','error','name','send','exports','util','../config/logger','api','message','Error','inherits'];(function(_0x56b8ea,_0x3f1221){var _0x3a4c07=function(_0x2397c8){while(--_0x2397c8){_0x56b8ea['push'](_0x56b8ea['shift']());}};_0x3a4c07(++_0x3f1221);}(_0xac4a,0x13f));var _0xaac4=function(_0x4454c0,_0x8eb2e4){_0x4454c0=_0x4454c0-0x0;var _0x347efa=_0xac4a[_0x4454c0];return _0x347efa;};'use strict';var util=require(_0xaac4('0x0'));var logger=require(_0xaac4('0x1'))(_0xaac4('0x2'));var APIError=function(_0x132fc3,_0x38f4f4){this[_0xaac4('0x3')]=_0x132fc3||'Internal\x20Server\x20Error';this['name']=_0x38f4f4||_0xaac4('0x4');util[_0xaac4('0x5')](APIError,Error);};var APIBadRequestError=function(_0x32d34c){this['message']=_0x32d34c||_0xaac4('0x6');this['name']=_0xaac4('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x1e4283){this[_0xaac4('0x3')]=_0x1e4283||'Entity\x20not\x20found';this['name']=_0xaac4('0x7');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x452573){switch(_0x452573){case'Bad\x20Request':return 0x190;case'Forbidden',_0xaac4('0x8'):return 0x193;case _0xaac4('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x38d1d0){return function(_0x5f393e){logger[_0xaac4('0x9')](_0x5f393e['stack']);var _0x508e14=getStatusCode(_0x5f393e[_0xaac4('0xa')]);if(_0x5f393e[_0xaac4('0xa')])delete _0x5f393e[_0xaac4('0xa')];return _0x38d1d0['status'](_0x508e14)[_0xaac4('0xb')](_0x5f393e);};}module[_0xaac4('0xc')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 5abffed..d483959 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee24=['json','send','exports','404','status','render'];(function(_0x5680d1,_0x22eb8e){var _0x5b1d61=function(_0x1b2838){while(--_0x1b2838){_0x5680d1['push'](_0x5680d1['shift']());}};_0x5b1d61(++_0x22eb8e);}(_0xee24,0x80));var _0x4ee2=function(_0x39e144,_0x4b4847){_0x39e144=_0x39e144-0x0;var _0x5ba205=_0xee24[_0x39e144];return _0x5ba205;};'use strict';module[_0x4ee2('0x0')][0x194]=function pageNotFound(_0x1e08cf,_0x105ea5){var _0xf57b5b=_0x4ee2('0x1');var _0x265212=0x194;var _0x21f009={'status':_0x265212};_0x105ea5[_0x4ee2('0x2')](_0x21f009[_0x4ee2('0x2')]);_0x105ea5[_0x4ee2('0x3')](_0xf57b5b,{},function(_0xf85ce7,_0x59b1d0){if(_0xf85ce7){return _0x105ea5['status'](_0x21f009[_0x4ee2('0x2')])[_0x4ee2('0x4')](_0x21f009);}_0x105ea5[_0x4ee2('0x5')](_0x59b1d0);});}; \ No newline at end of file +var _0x0427=['render','json','send','status'];(function(_0x270ebc,_0x1b53de){var _0x49bf42=function(_0x14cfb6){while(--_0x14cfb6){_0x270ebc['push'](_0x270ebc['shift']());}};_0x49bf42(++_0x1b53de);}(_0x0427,0x137));var _0x7042=function(_0x43663a,_0x43c7c9){_0x43663a=_0x43663a-0x0;var _0x42d222=_0x0427[_0x43663a];return _0x42d222;};'use strict';module['exports'][0x194]=function pageNotFound(_0x56348a,_0x1295ad){var _0x1fe4cf='404';var _0x2afd71=0x194;var _0x7c5b2d={'status':_0x2afd71};_0x1295ad[_0x7042('0x0')](_0x7c5b2d[_0x7042('0x0')]);_0x1295ad[_0x7042('0x1')](_0x1fe4cf,{},function(_0x343a69,_0x2c7c32){if(_0x343a69){return _0x1295ad['status'](_0x7c5b2d[_0x7042('0x0')])[_0x7042('0x2')](_0x7c5b2d);}_0x1295ad[_0x7042('0x3')](_0x2c7c32);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 1b8e635..e4ae54c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68d1=['Teams','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailbox','VoiceMailMessage','mailboxuser','QueueCalls','uniqueid','Contact','ContactId','CloudProvider','CloudProviderId','restrict','MailAccountId','Smtp','Dispositions','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','MailInteractionId','ChatWebsiteId','ChatOfflineMessageId','MailQueue','TagId','Dashboard','Items','FaxAccountId','Answers','Exntensions','user_has_fax_accounts','FaxApplication','FaxQueue','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelQueue','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','ChatApplication','Agent','ChatMessage','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','chat_group_has_users','Website','CompanyId','Phones','OpenchannelInteractions','SmsInteractions','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','Queue','Condition','All','OneAll','AutomationAllId','Any','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyCondition','Actions','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','DescriptionId','Field','VariableId','SugarcrmAccount','Subject','Description','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowAccount','FromId','SessionId','ProjectId','SquareProject','VoiceQueues','team_has_chat_queues','ChatQueues','team_has_sms_queues','TeamVoicePrefix','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','UserProfile','userProfileId','UserProfileSection','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','Imap','exports','../config/environment','lodash','jstz','determine','sequelize','motion2','xcall','127.0.0.1','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','xC@LL1234','mysql','utf8mb4','name','database','options','username','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../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','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','ChatGroup','Contacts','cm_user_has_contacts','belongsToMany','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoicePrefixes','MailQueues','ChatQueue','FaxQueues','SmsQueue','SmsQueues','UserSmsQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists'];(function(_0x30d758,_0x3bd738){var _0x25c1d0=function(_0x95ce2e){while(--_0x95ce2e){_0x30d758['push'](_0x30d758['shift']());}};_0x25c1d0(++_0x3bd738);}(_0x68d1,0xb0));var _0x168d=function(_0x44053a,_0x242840){_0x44053a=_0x44053a-0x0;var _0x17f371=_0x68d1[_0x44053a];return _0x17f371;};'use strict';var config=require(_0x168d('0x0'));var Sequelize=require('sequelize');var _=require(_0x168d('0x1'));var jstz=require(_0x168d('0x2'));var timezone=jstz[_0x168d('0x3')]();config[_0x168d('0x4')]=_['defaultsDeep'](config[_0x168d('0x4')],{'database':_0x168d('0x5'),'username':_0x168d('0x6'),'password':'xC@LL1234','options':{'host':_0x168d('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x168d('0x8'),'collate':_0x168d('0x9')}}});config[_0x168d('0xa')]=_[_0x168d('0xb')](config[_0x168d('0xa')],{'database':'motion2','username':'xcall','password':_0x168d('0xc'),'options':{'host':_0x168d('0x7'),'port':0xcea,'dialect':_0x168d('0xd'),'dialectOptions':{'charset':_0x168d('0xe')},'logging':![],'timezone':timezone[_0x168d('0xf')](),'define':{'charset':_0x168d('0x8'),'collate':_0x168d('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x168d('0x4')][_0x168d('0x10')],config['sequelize']['username'],config[_0x168d('0x4')]['password'],config[_0x168d('0x4')][_0x168d('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x168d('0xa')][_0x168d('0x10')],config[_0x168d('0xa')][_0x168d('0x12')],config[_0x168d('0xa')][_0x168d('0x13')],config['sequelizeHistory'][_0x168d('0x11')])};db[_0x168d('0x14')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x16'));db['VoiceChanSpy']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x17'));db['VoiceContext']=db[_0x168d('0x4')]['import'](_0x168d('0x18'));db[_0x168d('0x19')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x1a'));db[_0x168d('0x1b')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x1c'));db[_0x168d('0x1d')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x1e'));db[_0x168d('0x1f')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize']['import'](_0x168d('0x20'));db[_0x168d('0x21')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x22'));db[_0x168d('0x23')]=db['sequelize'][_0x168d('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x168d('0x24')]=db[_0x168d('0x4')]['import'](_0x168d('0x25'));db[_0x168d('0x26')]=db['sequelize'][_0x168d('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x168d('0x27')]=db['sequelize']['import']('../api/memberReport/memberReport.model');db[_0x168d('0x28')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x29'));db[_0x168d('0x2a')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x2b'));db[_0x168d('0x2c')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x2d'));db[_0x168d('0x2e')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x2f'));db[_0x168d('0x30')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x31'));db[_0x168d('0x32')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x33'));db[_0x168d('0x34')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x35'));db['UserSmsQueue']=db['sequelize'][_0x168d('0x15')](_0x168d('0x36'));db[_0x168d('0x37')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x38'));db[_0x168d('0x39')]=db['sequelize']['import']('../api/mailServerIn/mailServerIn.model');db[_0x168d('0x3a')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x3b'));db[_0x168d('0x3c')]=db[_0x168d('0x4')]['import'](_0x168d('0x3d'));db['MailQueue']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x3e'));db['MailSubstatus']=db[_0x168d('0x4')]['import'](_0x168d('0x3f'));db['MailInteraction']=db[_0x168d('0x4')][_0x168d('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0x168d('0x40')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x41'));db[_0x168d('0x42')]=db[_0x168d('0x4')]['import'](_0x168d('0x43'));db[_0x168d('0x44')]=db[_0x168d('0x4')]['import'](_0x168d('0x45'));db['Dashboard']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x46'));db[_0x168d('0x47')]=db['sequelize'][_0x168d('0x15')]('../api/dashboardItem/dashboardItem.model');db[_0x168d('0x48')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x49'));db['FaxApplication']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x4a'));db[_0x168d('0x4b')]=db[_0x168d('0x4')]['import'](_0x168d('0x4c'));db[_0x168d('0x4d')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x4e'));db[_0x168d('0x4f')]=db['sequelize']['import'](_0x168d('0x50'));db[_0x168d('0x51')]=db['sequelize'][_0x168d('0x15')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize'][_0x168d('0x15')](_0x168d('0x52'));db[_0x168d('0x53')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x54'));db[_0x168d('0x55')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x56'));db['SmsQueue']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x57'));db[_0x168d('0x58')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/openchannelAccount/openchannelAccount.model');db[_0x168d('0x59')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x5a'));db[_0x168d('0x5b')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x5c'));db[_0x168d('0x5d')]=db[_0x168d('0x4')]['import'](_0x168d('0x5e'));db['OpenchannelQueue']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x5f'));db[_0x168d('0x60')]=db[_0x168d('0x4')]['import'](_0x168d('0x61'));db[_0x168d('0x62')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x63'));db['ChatApplication']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x64'));db[_0x168d('0x65')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x66'));db['ChatMessage']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x67'));db[_0x168d('0x68')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x69'));db['ChatQueue']=db[_0x168d('0x4')]['import'](_0x168d('0x6a'));db['ChatGroup']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x6b'));db['ChatProactiveAction']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x6c'));db[_0x168d('0x6d')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/cmCompany/cmCompany.model');db[_0x168d('0x6e')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x6f'));db[_0x168d('0x70')]=db[_0x168d('0x4')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db['sequelize'][_0x168d('0x15')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x168d('0x4')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x71'));db[_0x168d('0x72')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x73'));db[_0x168d('0x74')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/action/action.model');db[_0x168d('0x75')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/automation/automation.model');db[_0x168d('0x76')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x77'));db[_0x168d('0x78')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x79'));db['Condition']=db['sequelize']['import'](_0x168d('0x7a'));db[_0x168d('0x7b')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x7c'));db[_0x168d('0x7d')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x7e'));db[_0x168d('0x7f')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/cdr/cdr.model');db[_0x168d('0x80')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db['sequelize'][_0x168d('0x15')](_0x168d('0x81'));db[_0x168d('0x82')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x83'));db[_0x168d('0x84')]=db['sequelize']['import'](_0x168d('0x85'));db[_0x168d('0x86')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/contactItemType/contactItemType.model');db[_0x168d('0x87')]=db['sequelize']['import']('../api/cmContactHasItem/cmContactHasItem.model');db[_0x168d('0x88')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x168d('0x89')]=db[_0x168d('0x4')]['import'](_0x168d('0x8a'));db[_0x168d('0x8b')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x8c'));db[_0x168d('0x8d')]=db[_0x168d('0x4')]['import'](_0x168d('0x8e'));db[_0x168d('0x8f')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x90'));db[_0x168d('0x91')]=db['sequelize'][_0x168d('0x15')]('../api/integrationReport/integrationReport.model');db[_0x168d('0x92')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x168d('0x93')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x94'));db[_0x168d('0x95')]=db['sequelize'][_0x168d('0x15')](_0x168d('0x96'));db[_0x168d('0x97')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x98'));db['AnalyticFieldReport']=db['sequelize'][_0x168d('0x15')](_0x168d('0x99'));db[_0x168d('0x9a')]=db[_0x168d('0x4')]['import'](_0x168d('0x9b'));db[_0x168d('0x9c')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x9d'));db[_0x168d('0x9e')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x9f'));db[_0x168d('0xa0')]=db[_0x168d('0x4')]['import']('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db['sequelize'][_0x168d('0x15')](_0x168d('0xa1'));db[_0x168d('0xa2')]=db['sequelize'][_0x168d('0x15')](_0x168d('0xa3'));db[_0x168d('0xa4')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xa5'));db[_0x168d('0xa6')]=db[_0x168d('0x4')]['import'](_0x168d('0xa7'));db[_0x168d('0xa8')]=db[_0x168d('0x4')]['import'](_0x168d('0xa9'));db[_0x168d('0xaa')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xab'));db[_0x168d('0xac')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xad'));db[_0x168d('0xae')]=db[_0x168d('0x4')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xaf'));db[_0x168d('0xb0')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xb1'));db[_0x168d('0xb2')]=db[_0x168d('0x4')]['import'](_0x168d('0xb3'));db[_0x168d('0xb4')]=db[_0x168d('0x4')]['import'](_0x168d('0xb5'));db[_0x168d('0xb6')]=db['sequelize'][_0x168d('0x15')](_0x168d('0xb7'));db['FreshdeskConfiguration']=db[_0x168d('0x4')]['import'](_0x168d('0xb8'));db[_0x168d('0xb9')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xba'));db['VtigerAccount']=db['sequelize'][_0x168d('0x15')](_0x168d('0xbb'));db[_0x168d('0xbc')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xbd'));db['VtigerField']=db['sequelize'][_0x168d('0x15')](_0x168d('0xbe'));db['ServicenowAccount']=db['sequelize'][_0x168d('0x15')](_0x168d('0xbf'));db[_0x168d('0xc0')]=db[_0x168d('0x4')]['import'](_0x168d('0xc1'));db[_0x168d('0xc2')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/intServicenowField/intServicenowField.model');db[_0x168d('0xc3')]=db['sequelize'][_0x168d('0x15')](_0x168d('0xc4'));db[_0x168d('0xc5')]=db[_0x168d('0x4')]['import'](_0x168d('0xc6'));db[_0x168d('0xc7')]=db[_0x168d('0x4')]['import'](_0x168d('0xc8'));db[_0x168d('0xc9')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x168d('0xca')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xcb'));db[_0x168d('0xcc')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x168d('0x8f')]=db['sequelize']['import'](_0x168d('0x90'));db[_0x168d('0xcd')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/network/network.model');db[_0x168d('0xce')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xcf'));db[_0x168d('0xd0')]=db['sequelize'][_0x168d('0x15')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x168d('0xd1')]=db[_0x168d('0x4')]['import'](_0x168d('0xd2'));db['JscriptyQuestionReport']=db['sequelize'][_0x168d('0x15')](_0x168d('0xd3'));db['JscriptySessionReport']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xd4'));db[_0x168d('0xd5')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xd6'));db[_0x168d('0xd7')]=db[_0x168d('0x4')]['import']('../api/squareReport/squareReport.model');db[_0x168d('0xd8')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0x168d('0xd9')]=db['sequelize'][_0x168d('0x15')](_0x168d('0xda'));db[_0x168d('0xdb')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/setting/setting.model');db[_0x168d('0xdc')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xdd'));db['SquareProject']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xde'));db[_0x168d('0xdf')]=db[_0x168d('0x4')]['import'](_0x168d('0xe0'));db[_0x168d('0xe1')]=db['sequelize']['import'](_0x168d('0xe2'));db[_0x168d('0xe3')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xe4'));db[_0x168d('0xe5')]=db['sequelize'][_0x168d('0x15')](_0x168d('0xe6'));db[_0x168d('0xe7')]=db['sequelize'][_0x168d('0x15')](_0x168d('0xe8'));db['Migration']=db[_0x168d('0x4')][_0x168d('0x15')]('../api/migration/migration.model');db['Attachment']=db['sequelize'][_0x168d('0x15')]('../api/attachment/attachment.model');db['Plugin']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xe9'));db['MailTransferReport']=db[_0x168d('0x4')]['import'](_0x168d('0xea'));db[_0x168d('0xeb')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xec'));db[_0x168d('0xed')]=db[_0x168d('0x4')]['import'](_0x168d('0xee'));db[_0x168d('0xef')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xf0'));db['SmsTransferReport']=db['sequelize'][_0x168d('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0x168d('0xf1')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/cmList/cmList.model');db[_0x168d('0xf2')]=db['sequelize']['import'](_0x168d('0xf3'));db['UserProfile']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xf4'));db['UserProfileSection']=db['sequelize'][_0x168d('0x15')](_0x168d('0xf5'));db['UserProfileResource']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xf6'));db[_0x168d('0xf7')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xf8'));db[_0x168d('0xf9')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db['sequelize']['import']('../api/whatsappApplication/whatsappApplication.model');db[_0x168d('0xfa')]=db[_0x168d('0x4')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x168d('0xfb')]=db['sequelize'][_0x168d('0x15')](_0x168d('0xfc'));db[_0x168d('0xfd')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0xfe'));db[_0x168d('0xff')]=db[_0x168d('0x4')]['import'](_0x168d('0x100'));db[_0x168d('0x101')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x102'));db['CloudProvider']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x103'));db[_0x168d('0x104')]=db[_0x168d('0x4')][_0x168d('0x15')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x105'));db[_0x168d('0x106')]=db[_0x168d('0x4')][_0x168d('0x15')](_0x168d('0x107'));db[_0x168d('0x108')]=db['sequelize']['import'](_0x168d('0x109'));db['User'][_0x168d('0x10a')](db[_0x168d('0x1f')],{'as':_0x168d('0x1f'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x10c')});db[_0x168d('0x14')][_0x168d('0x10a')](db[_0x168d('0x108')],{'as':_0x168d('0x10d'),'onDelete':_0x168d('0x10b'),'foreignKey':'UserId'});db[_0x168d('0x14')][_0x168d('0x10e')](db[_0x168d('0x1d')],{'as':'Recordings','foreignKey':_0x168d('0x10c')});db['User'][_0x168d('0x10e')](db[_0x168d('0x2c')],{'as':_0x168d('0x10f'),'foreignKey':_0x168d('0x10c')});db[_0x168d('0x14')][_0x168d('0x10e')](db[_0x168d('0x19')],{'as':_0x168d('0x110'),'onDelete':_0x168d('0x10b'),'hooks':!![]});db[_0x168d('0x14')]['hasMany'](db[_0x168d('0x111')],{'as':'HopperFinals','foreignKey':_0x168d('0x10c')});db['User'][_0x168d('0x10e')](db[_0x168d('0x112')],{'as':'HopperHistory','foreignKey':_0x168d('0x10c')});db[_0x168d('0x14')][_0x168d('0x10e')](db['ReportAgentPreview'],{'as':_0x168d('0x113'),'foreignKey':_0x168d('0x10c')});db[_0x168d('0x14')][_0x168d('0x10e')](db[_0x168d('0x5b')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x168d('0x14')][_0x168d('0x10e')](db[_0x168d('0x65')],{'as':_0x168d('0x114'),'foreignKey':_0x168d('0x10c')});db[_0x168d('0x14')][_0x168d('0x10e')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0x168d('0x14')][_0x168d('0x10e')](db[_0x168d('0x4b')],{'as':'FaxInteractions','foreignKey':_0x168d('0x10c')});db['User'][_0x168d('0x10e')](db[_0x168d('0x115')],{'as':_0x168d('0x116'),'foreignKey':_0x168d('0x10c')});db['User'][_0x168d('0x10e')](db[_0x168d('0xfa')],{'as':_0x168d('0x117'),'foreignKey':_0x168d('0x10c')});db['User'][_0x168d('0x10e')](db[_0x168d('0xf7')],{'as':_0x168d('0x118'),'foreignKey':_0x168d('0x119')});db[_0x168d('0x14')]['belongsTo'](db['UserProfile'],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0x168d('0x14')]['belongsToMany'](db[_0x168d('0x11a')],{'as':'Groups','through':'chat_group_has_users'});db[_0x168d('0x14')]['belongsToMany'](db[_0x168d('0x6e')],{'as':_0x168d('0x11b'),'through':_0x168d('0x11c')});db[_0x168d('0x14')][_0x168d('0x11d')](db['CmList'],{'as':_0x168d('0x11e'),'through':_0x168d('0x11f')});db[_0x168d('0x14')][_0x168d('0x11d')](db[_0x168d('0xe3')],{'through':_0x168d('0x120')});db[_0x168d('0x14')][_0x168d('0x11d')](db[_0x168d('0x115')],{'as':_0x168d('0x116'),'through':_0x168d('0x121')});db[_0x168d('0x14')][_0x168d('0x11d')](db[_0x168d('0x65')],{'as':_0x168d('0x114'),'through':_0x168d('0x122')});db[_0x168d('0x14')]['belongsToMany'](db[_0x168d('0x4b')],{'as':_0x168d('0x123'),'through':'user_has_fax_interactions'});db[_0x168d('0x14')]['belongsToMany'](db[_0x168d('0x53')],{'as':'SmsInteractions','through':_0x168d('0x124')});db[_0x168d('0x14')]['belongsToMany'](db[_0x168d('0x5b')],{'as':'OpenchannelInteractions','through':_0x168d('0x125')});db[_0x168d('0x14')][_0x168d('0x11d')](db[_0x168d('0xfa')],{'as':_0x168d('0x117'),'through':_0x168d('0x126')});db['User'][_0x168d('0x11d')](db[_0x168d('0x127')],{'as':'VoiceQueues','through':_0x168d('0x2e'),'required':![]});db[_0x168d('0x14')]['belongsToMany'](db[_0x168d('0xf2')],{'as':_0x168d('0x128'),'through':'UserVoicePrefix','required':![]});db[_0x168d('0x14')][_0x168d('0x11d')](db['MailQueue'],{'as':_0x168d('0x129'),'through':_0x168d('0x32'),'required':![]});db[_0x168d('0x14')][_0x168d('0x11d')](db[_0x168d('0x12a')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db['FaxQueue'],{'as':_0x168d('0x12b'),'through':_0x168d('0x34'),'required':![]});db['User'][_0x168d('0x11d')](db[_0x168d('0x12c')],{'as':_0x168d('0x12d'),'through':_0x168d('0x12e'),'required':![]});db[_0x168d('0x14')][_0x168d('0x11d')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x168d('0x37'),'required':![]});db['User'][_0x168d('0x11d')](db[_0x168d('0x101')],{'as':_0x168d('0x12f'),'through':_0x168d('0x130'),'required':![]});db[_0x168d('0x14')][_0x168d('0x11d')](db[_0x168d('0xf1')],{'through':_0x168d('0x11f')});db[_0x168d('0x14')]['belongsToMany'](db[_0x168d('0x60')],{'as':_0x168d('0x131'),'through':_0x168d('0x132')});db['User']['belongsToMany'](db[_0x168d('0x48')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x168d('0x14')][_0x168d('0x11d')](db['MailAccount'],{'as':_0x168d('0x133'),'through':_0x168d('0x134')});db['User'][_0x168d('0x11d')](db[_0x168d('0x58')],{'as':_0x168d('0x135'),'through':'user_has_openchannel_accounts'});db[_0x168d('0x14')][_0x168d('0x11d')](db['SmsAccount'],{'as':_0x168d('0x136'),'through':_0x168d('0x137')});db[_0x168d('0x14')][_0x168d('0x11d')](db['WhatsappAccount'],{'as':_0x168d('0x138'),'through':'user_has_whatsapp_accounts'});db[_0x168d('0x14')][_0x168d('0x11d')](db['SquareProject'],{'as':_0x168d('0x139'),'through':_0x168d('0x13a')});db[_0x168d('0x13b')][_0x168d('0x10e')](db[_0x168d('0x19')],{'as':_0x168d('0x13c'),'onDelete':'cascade','foreignKey':_0x168d('0x13d')});db[_0x168d('0x13e')][_0x168d('0x10e')](db[_0x168d('0x19')],{'onDelete':_0x168d('0x10b')});db[_0x168d('0x19')][_0x168d('0x10e')](db['VoiceExtension'],{'as':_0x168d('0x13f'),'onDelete':_0x168d('0x10b')});db['VoiceMusicOnHold'][_0x168d('0x11d')](db['Sound'],{'as':_0x168d('0x140'),'through':_0x168d('0x141')});db[_0x168d('0x127')][_0x168d('0x10e')](db[_0x168d('0x2c')],{'as':_0x168d('0x142'),'foreignKey':_0x168d('0x143')});db[_0x168d('0x127')][_0x168d('0x10e')](db[_0x168d('0x144')],{'as':_0x168d('0x145'),'foreignKey':'VoiceQueueId'});db[_0x168d('0x127')]['hasMany'](db['CmHopperFinal'],{'as':_0x168d('0x146'),'foreignKey':_0x168d('0x143')});db[_0x168d('0x127')][_0x168d('0x10e')](db[_0x168d('0x112')],{'as':_0x168d('0x147'),'foreignKey':_0x168d('0x143')});db[_0x168d('0x127')][_0x168d('0x10e')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x168d('0x143')});db[_0x168d('0x127')][_0x168d('0x10e')](db['CmHopperBlack'],{'as':_0x168d('0x148'),'foreignKey':_0x168d('0x143')});db[_0x168d('0x127')]['hasMany'](db[_0x168d('0x149')],{'as':_0x168d('0x14a'),'foreignKey':_0x168d('0x143')});db[_0x168d('0x127')][_0x168d('0x14b')](db['Trunk'],{'as':_0x168d('0x28'),'foreignKey':_0x168d('0x14c')});db[_0x168d('0x127')][_0x168d('0x14b')](db[_0x168d('0x28')],{'as':_0x168d('0x14d'),'foreignKey':_0x168d('0x14e')});db[_0x168d('0x127')]['belongsTo'](db['Interval'],{'as':_0x168d('0x7b'),'foreignKey':_0x168d('0x14f')});db[_0x168d('0x127')][_0x168d('0x14b')](db[_0x168d('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x168d('0x150')});db[_0x168d('0x127')]['belongsToMany'](db[_0x168d('0xf1')],{'as':'Lists','through':_0x168d('0x151')});db[_0x168d('0x127')]['belongsToMany'](db[_0x168d('0x14')],{'as':'Agents','through':_0x168d('0x2e')});db[_0x168d('0x127')]['belongsToMany'](db['Team'],{'as':_0x168d('0x152'),'through':'TeamVoiceQueue'});db[_0x168d('0x127')][_0x168d('0x11d')](db[_0x168d('0xf1')],{'as':'BlackLists','through':_0x168d('0x153')});db['VoiceRecording'][_0x168d('0x14b')](db['User'],{'as':_0x168d('0x14'),'foreignKey':_0x168d('0x10c')});db[_0x168d('0x154')][_0x168d('0x14b')](db[_0x168d('0x14')],{'as':'User','foreignKey':_0x168d('0x10c')});db[_0x168d('0x1f')][_0x168d('0x10e')](db['VoiceMailMessage'],{'as':_0x168d('0x155'),'onDelete':_0x168d('0x10b'),'foreignKey':'mailboxuser','sourceKey':_0x168d('0x156')});db[_0x168d('0x157')]['belongsTo'](db[_0x168d('0x1f')],{'foreignKey':_0x168d('0x158'),'targetKey':_0x168d('0x156')});db[_0x168d('0x21')][_0x168d('0x10e')](db[_0x168d('0x26')],{'as':_0x168d('0x159'),'foreignKey':_0x168d('0x15a'),'constraints':![]});db[_0x168d('0x21')]['hasMany'](db[_0x168d('0x24')],{'as':'AgentReports','foreignKey':_0x168d('0x15a'),'constraints':![]});db['VoiceCallReport'][_0x168d('0x14b')](db['User'],{'as':_0x168d('0x14'),'foreignKey':_0x168d('0x10c')});db['VoiceCallReport'][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0x39')][_0x168d('0x14b')](db[_0x168d('0x3c')],{'as':_0x168d('0x3c'),'foreignKey':'MailAccountId'});db[_0x168d('0x39')][_0x168d('0x14b')](db['CloudProvider'],{'as':_0x168d('0x15d'),'foreignKey':_0x168d('0x15e'),'onDelete':_0x168d('0x15f')});db['MailServerOut'][_0x168d('0x14b')](db[_0x168d('0x3c')],{'as':_0x168d('0x3c'),'foreignKey':_0x168d('0x160')});db[_0x168d('0x3a')][_0x168d('0x14b')](db[_0x168d('0x15d')],{'as':_0x168d('0x15d'),'foreignKey':_0x168d('0x15e'),'onDelete':_0x168d('0x15f')});db['MailAccount'][_0x168d('0x10a')](db[_0x168d('0x39')],{'as':'Imap','onDelete':'cascade'});db['MailAccount'][_0x168d('0x10a')](db['MailServerOut'],{'as':_0x168d('0x161'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x3c')]['hasMany'](db[_0x168d('0x78')],{'as':_0x168d('0x162'),'foreignKey':_0x168d('0x160'),'onDelete':'cascade'});db[_0x168d('0x3c')][_0x168d('0x10e')](db[_0x168d('0x76')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x168d('0x3c')][_0x168d('0x10e')](db[_0x168d('0x40')],{'as':_0x168d('0x155'),'foreignKey':_0x168d('0x160')});db[_0x168d('0x3c')][_0x168d('0x10e')](db[_0x168d('0x115')],{'as':_0x168d('0x163')});db[_0x168d('0x3c')][_0x168d('0x10e')](db[_0x168d('0x42')],{'as':_0x168d('0x13f')});db[_0x168d('0x3c')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165')});db[_0x168d('0x3c')][_0x168d('0x14b')](db[_0x168d('0x89')],{'as':'Template','foreignKey':_0x168d('0x166')});db['MailAccount'][_0x168d('0x14b')](db[_0x168d('0x7d')],{'as':_0x168d('0x167'),'foreignKey':_0x168d('0x150')});db[_0x168d('0x3c')][_0x168d('0x11d')](db['User'],{'as':_0x168d('0x168'),'through':'user_has_mail_accounts'});db['MailQueue'][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':_0x168d('0x32')});db['MailQueue'][_0x168d('0x11d')](db[_0x168d('0xe3')],{'through':_0x168d('0x169'),'as':_0x168d('0x152')});db['MailInteraction'][_0x168d('0x10e')](db[_0x168d('0x40')],{'as':'Messages','onDelete':_0x168d('0x10b'),'foreignKey':'MailInteractionId'});db['MailInteraction']['belongsTo'](db[_0x168d('0x3c')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x160')});db[_0x168d('0x115')][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':'Contact','foreignKey':_0x168d('0x15c')});db[_0x168d('0x115')][_0x168d('0x14b')](db['User'],{'as':_0x168d('0x16b'),'foreignKey':_0x168d('0x10c')});db[_0x168d('0x115')][_0x168d('0x11d')](db['Tag'],{'through':_0x168d('0x16c'),'as':_0x168d('0x16d')});db[_0x168d('0x115')]['belongsToMany'](db[_0x168d('0x84')],{'through':_0x168d('0x16c'),'as':_0x168d('0x16e')});db[_0x168d('0x115')]['belongsToMany'](db[_0x168d('0x14')],{'as':_0x168d('0x16f'),'through':_0x168d('0x121'),'foreignKey':'MailInteractionId'});db[_0x168d('0x40')][_0x168d('0x10e')](db[_0x168d('0x170')],{'as':_0x168d('0x171'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x40')][_0x168d('0x14b')](db['User'],{'as':_0x168d('0x14')});db[_0x168d('0x40')]['belongsTo'](db[_0x168d('0x6e')],{'onDelete':_0x168d('0x10b'),'as':_0x168d('0x15b')});db[_0x168d('0x40')][_0x168d('0x14b')](db[_0x168d('0x115')],{'as':_0x168d('0x172'),'foreignKey':_0x168d('0x173')});db['MailMessage'][_0x168d('0x14b')](db[_0x168d('0x3c')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x160')});db['MailMessage']['belongsTo'](db[_0x168d('0x60')],{'as':_0x168d('0x60'),'foreignKey':_0x168d('0x174')});db['MailMessage']['belongsTo'](db[_0x168d('0x68')],{'as':_0x168d('0x68'),'foreignKey':_0x168d('0x175')});db[_0x168d('0x42')][_0x168d('0x14b')](db[_0x168d('0x14')],{'onDelete':_0x168d('0x15f')});db[_0x168d('0x42')][_0x168d('0x14b')](db[_0x168d('0x176')],{'onDelete':_0x168d('0x15f')});db[_0x168d('0x42')][_0x168d('0x14b')](db[_0x168d('0x3c')],{'onDelete':_0x168d('0x15f')});db[_0x168d('0x42')]['belongsTo'](db[_0x168d('0x7b')],{'onDelete':_0x168d('0x15f'),'foreignKey':'IntervalId'});db['MailApplication'][_0x168d('0x14b')](db[_0x168d('0x84')],{'onDelete':_0x168d('0x15f'),'foreignKey':_0x168d('0x177')});db[_0x168d('0x44')][_0x168d('0x14b')](db[_0x168d('0x3c')],{});db[_0x168d('0x44')]['belongsTo'](db['CmList'],{'as':_0x168d('0x164'),'foreignKey':'ListId'});db[_0x168d('0x44')][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0x44')][_0x168d('0x14b')](db['MailInteraction'],{});db[_0x168d('0x44')]['belongsTo'](db['MailMessage'],{});db[_0x168d('0x44')]['belongsTo'](db[_0x168d('0x14')],{});db[_0x168d('0x44')][_0x168d('0x14b')](db[_0x168d('0x176')],{});db[_0x168d('0x178')][_0x168d('0x10e')](db[_0x168d('0x47')],{'as':_0x168d('0x179'),'onDelete':_0x168d('0x10b')});db['FaxAccount'][_0x168d('0x10e')](db[_0x168d('0x78')],{'as':'Dispositions','foreignKey':_0x168d('0x17a'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x48')][_0x168d('0x10e')](db['CannedAnswer'],{'as':_0x168d('0x17b'),'foreignKey':_0x168d('0x17a')});db[_0x168d('0x48')][_0x168d('0x10e')](db[_0x168d('0x4b')],{'as':'Interactions'});db[_0x168d('0x48')]['hasMany'](db['FaxApplication'],{'as':'Applications'});db['FaxAccount'][_0x168d('0x10e')](db[_0x168d('0x19')],{'as':_0x168d('0x17c'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x48')][_0x168d('0x10e')](db['FaxMessage'],{'as':_0x168d('0x155')});db[_0x168d('0x48')][_0x168d('0x14b')](db[_0x168d('0x28')],{'as':_0x168d('0x28')});db[_0x168d('0x48')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165')});db[_0x168d('0x48')]['belongsTo'](db[_0x168d('0x7d')],{'as':_0x168d('0x167'),'foreignKey':_0x168d('0x150')});db[_0x168d('0x48')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':_0x168d('0x17d')});db[_0x168d('0x17e')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x168d('0x17e')]['belongsTo'](db[_0x168d('0x17f')],{'onDelete':_0x168d('0x15f')});db['FaxApplication'][_0x168d('0x14b')](db[_0x168d('0x48')],{'onDelete':_0x168d('0x15f')});db[_0x168d('0x17e')][_0x168d('0x14b')](db[_0x168d('0x84')],{'onDelete':_0x168d('0x15f'),'foreignKey':_0x168d('0x177')});db[_0x168d('0x4b')][_0x168d('0x10e')](db[_0x168d('0x4d')],{'as':_0x168d('0x155'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x180')});db[_0x168d('0x4b')][_0x168d('0x14b')](db[_0x168d('0x48')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x17a')});db[_0x168d('0x4b')][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0x4b')]['belongsTo'](db[_0x168d('0x14')],{'as':'Owner','foreignKey':_0x168d('0x10c')});db[_0x168d('0x4b')][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x181'),'as':'Tags'});db[_0x168d('0x4b')]['belongsToMany'](db[_0x168d('0x84')],{'through':'fax_interaction_has_tags','as':_0x168d('0x16e')});db[_0x168d('0x4b')]['belongsToMany'](db[_0x168d('0x14')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0x168d('0x14')],{'onDelete':_0x168d('0x10b'),'as':_0x168d('0x14')});db[_0x168d('0x4d')][_0x168d('0x14b')](db[_0x168d('0x4b')],{'as':_0x168d('0x172'),'foreignKey':_0x168d('0x180')});db['FaxMessage']['belongsTo'](db[_0x168d('0x6e')],{'onDelete':_0x168d('0x10b'),'as':'Contact'});db['FaxMessage'][_0x168d('0x14b')](db['Attachment'],{'as':_0x168d('0x170'),'foreignKey':_0x168d('0x182')});db[_0x168d('0x4d')]['belongsTo'](db[_0x168d('0x48')],{'as':_0x168d('0x16a'),'foreignKey':'FaxAccountId'});db[_0x168d('0x17f')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':'UserFaxQueue'});db[_0x168d('0x17f')][_0x168d('0x11d')](db[_0x168d('0xe3')],{'through':_0x168d('0x183'),'as':_0x168d('0x152')});db[_0x168d('0x4f')]['belongsTo'](db[_0x168d('0x48')],{});db[_0x168d('0x4f')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165')});db['FaxQueueReport'][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0x4f')][_0x168d('0x14b')](db[_0x168d('0x4b')],{});db[_0x168d('0x4f')][_0x168d('0x14b')](db[_0x168d('0x4d')],{});db[_0x168d('0x4f')][_0x168d('0x14b')](db[_0x168d('0x14')],{});db[_0x168d('0x4f')][_0x168d('0x14b')](db[_0x168d('0x17f')],{});db[_0x168d('0x51')]['hasMany'](db[_0x168d('0x78')],{'as':_0x168d('0x162'),'foreignKey':_0x168d('0x184'),'onDelete':_0x168d('0x10b')});db['SmsAccount']['hasMany'](db[_0x168d('0x76')],{'as':_0x168d('0x17b'),'foreignKey':_0x168d('0x184')});db[_0x168d('0x51')][_0x168d('0x10e')](db[_0x168d('0x55')],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0x168d('0x51')][_0x168d('0x10e')](db[_0x168d('0x53')],{'as':_0x168d('0x163')});db[_0x168d('0x51')][_0x168d('0x10e')](db['SmsApplication'],{'as':_0x168d('0x13f')});db[_0x168d('0x51')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':'ListId'});db[_0x168d('0x51')]['belongsTo'](db[_0x168d('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x168d('0x150')});db[_0x168d('0x51')]['belongsToMany'](db['User'],{'as':_0x168d('0x168'),'through':_0x168d('0x137')});db[_0x168d('0x185')][_0x168d('0x14b')](db['User'],{'onDelete':_0x168d('0x15f')});db[_0x168d('0x185')][_0x168d('0x14b')](db[_0x168d('0x12c')],{'onDelete':_0x168d('0x15f')});db[_0x168d('0x185')][_0x168d('0x14b')](db[_0x168d('0x51')],{'onDelete':_0x168d('0x15f')});db['SmsApplication'][_0x168d('0x14b')](db[_0x168d('0x7b')],{'onDelete':'restrict','foreignKey':_0x168d('0x14f')});db[_0x168d('0x185')]['belongsTo'](db[_0x168d('0x84')],{'onDelete':'restrict','foreignKey':_0x168d('0x177')});db[_0x168d('0x53')][_0x168d('0x10e')](db[_0x168d('0x55')],{'as':_0x168d('0x155'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x186')});db['SmsInteraction'][_0x168d('0x14b')](db[_0x168d('0x51')],{'as':_0x168d('0x16a'),'foreignKey':'SmsAccountId'});db[_0x168d('0x53')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x168d('0x15c')});db['SmsInteraction']['belongsTo'](db[_0x168d('0x14')],{'as':_0x168d('0x16b'),'foreignKey':_0x168d('0x10c')});db[_0x168d('0x53')][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x187'),'as':_0x168d('0x16d')});db[_0x168d('0x53')]['belongsToMany'](db[_0x168d('0x84')],{'through':_0x168d('0x187'),'as':_0x168d('0x16e')});db[_0x168d('0x53')]['belongsToMany'](db[_0x168d('0x14')],{'as':_0x168d('0x16f'),'through':_0x168d('0x124'),'foreignKey':_0x168d('0x186')});db['SmsMessage'][_0x168d('0x14b')](db[_0x168d('0x14')],{'as':_0x168d('0x14')});db[_0x168d('0x55')][_0x168d('0x14b')](db['CmContact'],{'onDelete':'cascade','as':_0x168d('0x15b')});db[_0x168d('0x55')][_0x168d('0x14b')](db['SmsInteraction'],{'onDelete':_0x168d('0x10b'),'as':_0x168d('0x172'),'foreignKey':_0x168d('0x186')});db[_0x168d('0x55')][_0x168d('0x14b')](db[_0x168d('0x51')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x184')});db['SmsQueue'][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x168d('0x188')});db[_0x168d('0x12c')][_0x168d('0x11d')](db[_0x168d('0xe3')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x168d('0x58')][_0x168d('0x10e')](db[_0x168d('0x78')],{'as':_0x168d('0x162'),'foreignKey':'OpenchannelAccountId','onDelete':_0x168d('0x10b')});db[_0x168d('0x58')][_0x168d('0x10e')](db['CannedAnswer'],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x168d('0x58')][_0x168d('0x10e')](db[_0x168d('0x5b')],{'as':_0x168d('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0x168d('0x58')][_0x168d('0x10e')](db['OpenchannelMessage'],{'as':_0x168d('0x155'),'foreignKey':_0x168d('0x189')});db[_0x168d('0x58')]['hasMany'](db[_0x168d('0x59')],{'as':_0x168d('0x13f'),'foreignKey':_0x168d('0x189')});db[_0x168d('0x58')]['belongsTo'](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165')});db[_0x168d('0x58')][_0x168d('0x14b')](db[_0x168d('0x7d')],{'as':_0x168d('0x167'),'foreignKey':_0x168d('0x150')});db[_0x168d('0x58')][_0x168d('0x11d')](db['User'],{'as':_0x168d('0x168'),'through':'user_has_openchannel_accounts'});db[_0x168d('0x59')][_0x168d('0x14b')](db[_0x168d('0x14')],{'onDelete':'restrict'});db[_0x168d('0x59')][_0x168d('0x14b')](db['OpenchannelQueue'],{'onDelete':_0x168d('0x15f'),'foreignKey':_0x168d('0x18a')});db[_0x168d('0x59')][_0x168d('0x14b')](db[_0x168d('0x58')],{'onDelete':_0x168d('0x15f'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0x168d('0x14b')](db[_0x168d('0x7b')],{'onDelete':_0x168d('0x15f'),'foreignKey':_0x168d('0x14f')});db[_0x168d('0x59')]['belongsTo'](db['Tag'],{'onDelete':_0x168d('0x15f'),'foreignKey':_0x168d('0x177')});db[_0x168d('0x5b')]['hasMany'](db['OpenchannelMessage'],{'as':_0x168d('0x155'),'onDelete':_0x168d('0x10b'),'foreignKey':'OpenchannelInteractionId'});db[_0x168d('0x5b')][_0x168d('0x14b')](db[_0x168d('0x58')],{'as':_0x168d('0x16a'),'foreignKey':'OpenchannelAccountId'});db[_0x168d('0x5b')]['belongsTo'](db[_0x168d('0x6e')],{'as':'Contact','foreignKey':_0x168d('0x15c')});db[_0x168d('0x5b')][_0x168d('0x14b')](db[_0x168d('0x14')],{'as':'Owner','foreignKey':_0x168d('0x10c')});db[_0x168d('0x5b')][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x18b'),'as':_0x168d('0x16d')});db[_0x168d('0x5b')][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x18b'),'as':_0x168d('0x16e')});db[_0x168d('0x5b')]['belongsToMany'](db[_0x168d('0x14')],{'as':'Users','through':_0x168d('0x125'),'foreignKey':_0x168d('0x18c')});db['OpenchannelMessage'][_0x168d('0x14b')](db['User'],{'onDelete':_0x168d('0x10b'),'as':_0x168d('0x14')});db[_0x168d('0x5d')][_0x168d('0x14b')](db[_0x168d('0x6e')],{'onDelete':'cascade','as':_0x168d('0x15b')});db[_0x168d('0x5d')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x168d('0x10b'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x168d('0x5d')][_0x168d('0x14b')](db[_0x168d('0x170')],{'as':'Attachment','foreignKey':_0x168d('0x182')});db['OpenchannelMessage']['belongsTo'](db[_0x168d('0x58')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x168d('0x18d')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':_0x168d('0x37'),'foreignKey':_0x168d('0x18a')});db[_0x168d('0x18d')]['belongsToMany'](db[_0x168d('0xe3')],{'through':_0x168d('0x18e'),'as':'Teams'});db[_0x168d('0x60')][_0x168d('0x10e')](db[_0x168d('0x78')],{'as':'Dispositions','foreignKey':_0x168d('0x174'),'onDelete':_0x168d('0x10b')});db['ChatWebsite'][_0x168d('0x10e')](db[_0x168d('0x76')],{'as':_0x168d('0x17b'),'foreignKey':_0x168d('0x174')});db[_0x168d('0x60')][_0x168d('0x10e')](db[_0x168d('0x18f')],{'as':_0x168d('0x190')});db['ChatWebsite'][_0x168d('0x10e')](db['ChatInteraction'],{'as':_0x168d('0x163')});db[_0x168d('0x60')][_0x168d('0x10e')](db[_0x168d('0x191')],{'as':_0x168d('0x13f')});db['ChatWebsite'][_0x168d('0x10e')](db['ChatMessage'],{'as':_0x168d('0x155')});db[_0x168d('0x60')][_0x168d('0x14b')](db['CmList'],{'as':'List','foreignKey':_0x168d('0x165')});db[_0x168d('0x60')]['belongsTo'](db[_0x168d('0x7b')],{'as':'Interval','foreignKey':_0x168d('0x14f')});db['ChatWebsite'][_0x168d('0x14b')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x168d('0x160')});db[_0x168d('0x60')]['belongsTo'](db['Pause'],{'as':_0x168d('0x167'),'foreignKey':_0x168d('0x150')});db[_0x168d('0x60')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':_0x168d('0x132')});db[_0x168d('0x62')][_0x168d('0x14b')](db[_0x168d('0x58')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165')});db[_0x168d('0x62')]['belongsTo'](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db['OpenchannelQueueReport']['belongsTo'](db[_0x168d('0x5b')],{});db[_0x168d('0x62')][_0x168d('0x14b')](db[_0x168d('0x5d')],{});db['OpenchannelQueueReport'][_0x168d('0x14b')](db[_0x168d('0x14')],{});db[_0x168d('0x62')][_0x168d('0x14b')](db[_0x168d('0x18d')],{});db[_0x168d('0x191')][_0x168d('0x14b')](db[_0x168d('0x14')],{'as':_0x168d('0x192'),'foreignKey':_0x168d('0x10c'),'onDelete':_0x168d('0x15f')});db[_0x168d('0x191')]['belongsTo'](db[_0x168d('0x12a')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x168d('0x15f')});db[_0x168d('0x191')][_0x168d('0x14b')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x168d('0x174'),'onDelete':_0x168d('0x15f')});db[_0x168d('0x191')][_0x168d('0x14b')](db[_0x168d('0x84')],{'onDelete':_0x168d('0x15f'),'foreignKey':'TagId'});db[_0x168d('0x65')][_0x168d('0x10e')](db[_0x168d('0x193')],{'as':_0x168d('0x155'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x194')});db[_0x168d('0x65')]['belongsTo'](db[_0x168d('0x60')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x174')});db[_0x168d('0x65')]['belongsTo'](db[_0x168d('0x6e')],{'as':'Contact','foreignKey':'ContactId'});db['ChatInteraction'][_0x168d('0x14b')](db['User'],{'as':_0x168d('0x16b'),'foreignKey':_0x168d('0x10c')});db['ChatInteraction']['belongsToMany'](db[_0x168d('0x84')],{'through':_0x168d('0x195'),'as':_0x168d('0x16d')});db[_0x168d('0x65')][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x195'),'as':_0x168d('0x16e')});db[_0x168d('0x65')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x16f'),'through':_0x168d('0x122'),'foreignKey':_0x168d('0x194')});db[_0x168d('0x193')][_0x168d('0x14b')](db[_0x168d('0x14')],{'onDelete':_0x168d('0x10b'),'as':'User'});db[_0x168d('0x193')][_0x168d('0x14b')](db['CmContact'],{'onDelete':_0x168d('0x10b'),'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db['ChatMessage'][_0x168d('0x14b')](db[_0x168d('0x65')],{'onDelete':_0x168d('0x10b'),'as':'Interaction','foreignKey':_0x168d('0x194')});db[_0x168d('0x193')][_0x168d('0x14b')](db[_0x168d('0x170')],{'as':_0x168d('0x170'),'foreignKey':_0x168d('0x182')});db[_0x168d('0x193')]['belongsTo'](db['ChatWebsite'],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x174')});db[_0x168d('0x68')][_0x168d('0x10e')](db['Attachment'],{'as':_0x168d('0x171'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x168d('0x68')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db['ChatOfflineMessage'][_0x168d('0x14b')](db[_0x168d('0x60')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x174')});db[_0x168d('0x12a')]['belongsToMany'](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':_0x168d('0x30'),'hooks':!![]});db[_0x168d('0x12a')][_0x168d('0x11d')](db[_0x168d('0xe3')],{'through':'team_has_chat_queues','as':'Teams'});db[_0x168d('0x11a')]['hasMany'](db['ChatInternalMessage'],{'as':_0x168d('0x155'),'foreignKey':_0x168d('0x196'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x11a')][_0x168d('0x11d')](db['User'],{'as':_0x168d('0x142'),'through':_0x168d('0x197')});db['ChatProactiveAction']['belongsTo'](db[_0x168d('0x60')],{'as':_0x168d('0x198'),'foreignKey':_0x168d('0x174')});db[_0x168d('0x6d')][_0x168d('0x10e')](db[_0x168d('0x6e')],{'as':_0x168d('0x11b'),'foreignKey':_0x168d('0x199')});db['CmContact'][_0x168d('0x10e')](db[_0x168d('0x87')],{'as':_0x168d('0x19a'),'foreignKey':'CmContactId'});db['CmContact']['hasMany'](db[_0x168d('0x144')],{'as':_0x168d('0x145'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x168d('0x111')],{'as':_0x168d('0x146'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0x6e')][_0x168d('0x10e')](db[_0x168d('0x112')],{'as':_0x168d('0x147'),'foreignKey':'ContactId'});db[_0x168d('0x6e')]['hasMany'](db[_0x168d('0x113')],{'as':_0x168d('0x113'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0x6e')][_0x168d('0x10e')](db[_0x168d('0x149')],{'as':_0x168d('0x14a'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0x6e')][_0x168d('0x10e')](db[_0x168d('0x5b')],{'as':_0x168d('0x19b'),'foreignKey':_0x168d('0x15c'),'onDelete':_0x168d('0x15f')});db[_0x168d('0x6e')][_0x168d('0x10e')](db[_0x168d('0x65')],{'as':'ChatInteractions','foreignKey':_0x168d('0x15c'),'onDelete':_0x168d('0x15f')});db[_0x168d('0x6e')][_0x168d('0x10e')](db['SmsInteraction'],{'as':_0x168d('0x19c'),'foreignKey':_0x168d('0x15c'),'onDelete':_0x168d('0x15f')});db[_0x168d('0x6e')][_0x168d('0x10e')](db[_0x168d('0x4b')],{'as':_0x168d('0x123'),'foreignKey':_0x168d('0x15c'),'onDelete':_0x168d('0x15f')});db[_0x168d('0x6e')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x168d('0x15c'),'onDelete':'restrict'});db[_0x168d('0x6e')][_0x168d('0x14b')](db[_0x168d('0x6d')],{'as':'Company','foreignKey':_0x168d('0x199')});db[_0x168d('0x6e')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165'),'onDelete':'cascade'});db[_0x168d('0x6e')][_0x168d('0x11d')](db['User'],{'as':_0x168d('0x16f'),'through':_0x168d('0x11c')});db[_0x168d('0x6e')][_0x168d('0x11d')](db[_0x168d('0x84')],{'as':_0x168d('0x16d'),'through':_0x168d('0x19d')});db['CmContact']['belongsToMany'](db[_0x168d('0x84')],{'through':'cm_contact_has_tags','as':_0x168d('0x16e')});db[_0x168d('0x144')][_0x168d('0x10e')](db[_0x168d('0x88')],{'as':_0x168d('0x19e'),'foreignKey':_0x168d('0x19f')});db[_0x168d('0x144')][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c'),'onDelete':_0x168d('0x10b')});db['CmHopper'][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':'List','foreignKey':_0x168d('0x165'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x144')][_0x168d('0x14b')](db[_0x168d('0x14')],{'as':_0x168d('0x192'),'foreignKey':_0x168d('0x10c')});db['CmHopper'][_0x168d('0x14b')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x168d('0x143'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x144')][_0x168d('0x14b')](db[_0x168d('0xe7')],{'as':_0x168d('0xe7'),'foreignKey':_0x168d('0x1a0'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x144')]['belongsTo'](db['User'],{'as':_0x168d('0x16b'),'foreignKey':_0x168d('0x1a1')});db[_0x168d('0x70')][_0x168d('0x14b')](db['CmContact'],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x70')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x168d('0x165'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x70')][_0x168d('0x14b')](db[_0x168d('0x127')],{'as':_0x168d('0x1a2'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x168d('0x70')][_0x168d('0x14b')](db[_0x168d('0xe7')],{'as':_0x168d('0xe7'),'foreignKey':'CampaignId','onDelete':_0x168d('0x10b')});db[_0x168d('0x75')][_0x168d('0x10e')](db[_0x168d('0x1a3')],{'as':{'plural':_0x168d('0x1a4'),'singular':_0x168d('0x1a5')},'foreignKey':_0x168d('0x1a6'),'onDelete':_0x168d('0x10b'),'hooks':!![]});db[_0x168d('0x75')][_0x168d('0x10e')](db[_0x168d('0x1a3')],{'as':{'plural':_0x168d('0x1a7'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x168d('0x10b'),'hooks':!![]});db[_0x168d('0x75')]['hasMany'](db[_0x168d('0x74')],{'as':'Actions','foreignKey':_0x168d('0x1a8'),'onDelete':_0x168d('0x10b'),'hooks':!![]});db[_0x168d('0x78')][_0x168d('0x10e')](db['Disposition'],{'as':_0x168d('0x162'),'foreignKey':_0x168d('0x1a9'),'onDelete':'cascade'});db[_0x168d('0x7b')][_0x168d('0x10e')](db[_0x168d('0x7b')],{'as':_0x168d('0x1aa'),'foreignKey':_0x168d('0x14f'),'onDelete':_0x168d('0x10b'),'hooks':!![],'required':![]});db[_0x168d('0x7b')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0x168d('0x14f'),'onDelete':_0x168d('0x15f')});db[_0x168d('0x7b')]['hasMany'](db[_0x168d('0x42')],{'as':_0x168d('0x1ab'),'foreignKey':'IntervalId'});db['Interval']['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x168d('0x14f')});db[_0x168d('0x7b')][_0x168d('0x10e')](db[_0x168d('0x17e')],{'as':_0x168d('0x1ac'),'foreignKey':_0x168d('0x14f')});db[_0x168d('0x7b')][_0x168d('0x10e')](db[_0x168d('0x185')],{'as':_0x168d('0x1ad'),'foreignKey':_0x168d('0x14f')});db['Schedule']['belongsTo'](db[_0x168d('0x3c')],{});db[_0x168d('0x1ae')][_0x168d('0x14b')](db[_0x168d('0x93')],{'foreignKey':_0x168d('0x1af')});db[_0x168d('0x1ae')][_0x168d('0x14b')](db[_0x168d('0x92')],{'foreignKey':_0x168d('0x1b0')});db[_0x168d('0x82')][_0x168d('0x11d')](db[_0x168d('0x1b')],{'as':_0x168d('0x1b1'),'through':_0x168d('0x141'),'onDelete':_0x168d('0x15f')});db['Tag'][_0x168d('0x11d')](db[_0x168d('0x6e')],{'through':_0x168d('0x19d')});db[_0x168d('0x84')][_0x168d('0x11d')](db[_0x168d('0x65')],{'through':_0x168d('0x195')});db[_0x168d('0x84')][_0x168d('0x11d')](db['MailInteraction'],{'through':_0x168d('0x16c')});db[_0x168d('0x84')][_0x168d('0x11d')](db[_0x168d('0x53')],{'through':'sms_interaction_has_tags'});db['Tag'][_0x168d('0x11d')](db[_0x168d('0x4b')],{'through':_0x168d('0x181')});db['Tag'][_0x168d('0x11d')](db['OpenchannelInteraction'],{'through':_0x168d('0x18b')});db[_0x168d('0x84')]['belongsToMany'](db[_0x168d('0xfa')],{'through':_0x168d('0x1b2')});db[_0x168d('0x87')][_0x168d('0x14b')](db['ContactItemType'],{'as':_0x168d('0x1b3'),'foreignKey':_0x168d('0x1b4')});db['CmHopperAdditionalPhone'][_0x168d('0x14b')](db[_0x168d('0x144')],{'as':_0x168d('0x1b5'),'foreignKey':'CmHopperId'});db['CmContactHasItem'][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':'CmContactId'});db[_0x168d('0x8b')][_0x168d('0x10e')](db[_0x168d('0x1a3')],{'as':{'plural':_0x168d('0x1b6'),'singular':_0x168d('0x1b7')},'foreignKey':_0x168d('0x1b8'),'onDelete':_0x168d('0x10b'),'hooks':!![]});db['Trigger']['hasMany'](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0x168d('0x1b9')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x168d('0x8b')][_0x168d('0x10e')](db[_0x168d('0x74')],{'as':_0x168d('0x1ba'),'foreignKey':'TriggerId','onDelete':_0x168d('0x10b'),'hooks':!![]});db['AnalyticCustomReport'][_0x168d('0x10e')](db[_0x168d('0x1bb')],{'as':_0x168d('0x1bc'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1b0'),'hooks':!![]});db[_0x168d('0x93')][_0x168d('0x10e')](db[_0x168d('0x1bb')],{'as':'Fields','onDelete':_0x168d('0x10b'),'foreignKey':'DefaultReportId'});db[_0x168d('0x97')][_0x168d('0x10e')](db[_0x168d('0x1bb')],{'as':_0x168d('0x1bc'),'onDelete':_0x168d('0x10b'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x168d('0x14b')](db[_0x168d('0x97')],{'foreignKey':_0x168d('0x1bd')});db[_0x168d('0x9c')][_0x168d('0x10e')](db[_0x168d('0x9e')],{'as':_0x168d('0x1be'),'onDelete':'cascade','foreignKey':_0x168d('0x1bf')});db[_0x168d('0x9e')]['hasMany'](db[_0x168d('0xa0')],{'as':_0x168d('0x1c0'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0x9e')][_0x168d('0x10e')](db[_0x168d('0xa0')],{'as':_0x168d('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x168d('0x9e')][_0x168d('0x10e')](db[_0x168d('0xa0')],{'as':_0x168d('0x1bc'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0x9e')][_0x168d('0x14b')](db[_0x168d('0x9c')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xa0')][_0x168d('0x10e')](db[_0x168d('0xa0')],{'as':'Subject','foreignKey':_0x168d('0x1c1')});db[_0x168d('0xa0')][_0x168d('0x10e')](db[_0x168d('0xa0')],{'as':'Description','foreignKey':_0x168d('0x1c4')});db[_0x168d('0xa0')][_0x168d('0x10e')](db[_0x168d('0xa0')],{'as':_0x168d('0x1c5'),'foreignKey':_0x168d('0x1c3')});db['SalesforceField']['belongsTo'](db['Variable'],{'as':_0x168d('0x8d'),'foreignKey':_0x168d('0x1c6')});db[_0x168d('0x1c7')][_0x168d('0x10e')](db['SugarcrmConfiguration'],{'as':_0x168d('0x1be'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xa2')][_0x168d('0x10e')](db[_0x168d('0xa4')],{'as':_0x168d('0x1c0'),'onDelete':'cascade','foreignKey':_0x168d('0x1c1')});db['SugarcrmConfiguration'][_0x168d('0x10e')](db[_0x168d('0xa4')],{'as':_0x168d('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x168d('0xa2')][_0x168d('0x10e')](db[_0x168d('0xa4')],{'as':'Fields','onDelete':_0x168d('0x10b'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x168d('0x14b')](db['SugarcrmAccount'],{'as':_0x168d('0x16a'),'foreignKey':'AccountId'});db[_0x168d('0xa4')][_0x168d('0x10e')](db[_0x168d('0xa4')],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0xa4')][_0x168d('0x10e')](db[_0x168d('0xa4')],{'as':_0x168d('0x1c9'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0xa4')][_0x168d('0x10e')](db[_0x168d('0xa4')],{'as':_0x168d('0x1c5'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0xa4')][_0x168d('0x14b')](db[_0x168d('0x8d')],{'as':_0x168d('0x8d'),'foreignKey':'VariableId'});db[_0x168d('0xa6')][_0x168d('0x10e')](db[_0x168d('0xa8')],{'as':_0x168d('0x1be'),'onDelete':'cascade','foreignKey':_0x168d('0x1bf')});db[_0x168d('0xa8')]['hasMany'](db[_0x168d('0xaa')],{'as':_0x168d('0x1c0'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c1')});db['DeskConfiguration'][_0x168d('0x10e')](db[_0x168d('0xaa')],{'as':_0x168d('0x1c2'),'onDelete':'cascade','foreignKey':_0x168d('0x1c4')});db['DeskConfiguration'][_0x168d('0x10e')](db['DeskField'],{'as':_0x168d('0x1bc'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c3')});db['DeskConfiguration'][_0x168d('0x14b')](db[_0x168d('0xa6')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xa8')]['belongsToMany'](db[_0x168d('0x84')],{'through':_0x168d('0x1ca')});db['DeskField'][_0x168d('0x10e')](db[_0x168d('0xaa')],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0xaa')][_0x168d('0x10e')](db[_0x168d('0xaa')],{'as':_0x168d('0x1c9'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0xaa')][_0x168d('0x10e')](db[_0x168d('0xaa')],{'as':'Field','foreignKey':_0x168d('0x1c3')});db[_0x168d('0xaa')]['belongsTo'](db[_0x168d('0x8d')],{'as':_0x168d('0x8d'),'foreignKey':_0x168d('0x1c6')});db['ZohoAccount'][_0x168d('0x10e')](db[_0x168d('0xae')],{'as':_0x168d('0x1be'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xae')][_0x168d('0x10e')](db[_0x168d('0x1cb')],{'as':_0x168d('0x1c0'),'onDelete':_0x168d('0x10b'),'foreignKey':'SubjectId'});db[_0x168d('0xae')]['hasMany'](db[_0x168d('0x1cb')],{'as':'Descriptions','onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0xae')][_0x168d('0x10e')](db['ZohoField'],{'as':_0x168d('0x1bc'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0xae')]['belongsTo'](db[_0x168d('0xac')],{'as':'Account','foreignKey':'AccountId'});db[_0x168d('0x1cb')]['hasMany'](db[_0x168d('0x1cb')],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db['ZohoField'][_0x168d('0x10e')](db[_0x168d('0x1cb')],{'as':_0x168d('0x1c9'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0x1cb')][_0x168d('0x10e')](db[_0x168d('0x1cb')],{'as':'Field','foreignKey':_0x168d('0x1c3')});db['ZohoField']['belongsTo'](db[_0x168d('0x8d')],{'as':_0x168d('0x8d'),'foreignKey':'VariableId'});db[_0x168d('0xb0')][_0x168d('0x10e')](db[_0x168d('0xb2')],{'as':_0x168d('0x1be'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x168d('0xb2')]['hasMany'](db[_0x168d('0xb4')],{'as':_0x168d('0x1c0'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0xb2')]['hasMany'](db[_0x168d('0xb4')],{'as':'Descriptions','foreignKey':_0x168d('0x1c4')});db[_0x168d('0xb2')][_0x168d('0x10e')](db['ZendeskField'],{'as':_0x168d('0x1bc'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0xb2')][_0x168d('0x14b')](db[_0x168d('0xb0')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xb2')][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x1cc')});db['ZendeskField'][_0x168d('0x10e')](db['ZendeskField'],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0xb4')][_0x168d('0x10e')](db[_0x168d('0xb4')],{'as':_0x168d('0x1c9'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0xb4')][_0x168d('0x10e')](db[_0x168d('0xb4')],{'as':'Field','foreignKey':_0x168d('0x1c3')});db['ZendeskField'][_0x168d('0x14b')](db[_0x168d('0x8d')],{'as':_0x168d('0x8d'),'foreignKey':_0x168d('0x1c6')});db['FreshdeskAccount']['hasMany'](db[_0x168d('0x1cd')],{'as':_0x168d('0x1be'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0x1cd')][_0x168d('0x10e')](db[_0x168d('0xb9')],{'as':_0x168d('0x1c0'),'onDelete':'cascade','foreignKey':_0x168d('0x1c1')});db['FreshdeskConfiguration']['hasMany'](db[_0x168d('0xb9')],{'as':_0x168d('0x1c2'),'onDelete':'cascade','foreignKey':_0x168d('0x1c4')});db[_0x168d('0x1cd')][_0x168d('0x10e')](db[_0x168d('0xb9')],{'as':_0x168d('0x1bc'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0x1cd')]['belongsTo'](db[_0x168d('0xb6')],{'as':'Account','foreignKey':'AccountId'});db[_0x168d('0x1cd')][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x1ce')});db[_0x168d('0xb9')][_0x168d('0x10e')](db[_0x168d('0xb9')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0x168d('0x10e')](db[_0x168d('0xb9')],{'as':_0x168d('0x1c9'),'foreignKey':'DescriptionId'});db[_0x168d('0xb9')][_0x168d('0x10e')](db['FreshdeskField'],{'as':_0x168d('0x1c5'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0xb9')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x168d('0x1cf')][_0x168d('0x10e')](db[_0x168d('0xbc')],{'as':_0x168d('0x1be'),'onDelete':_0x168d('0x10b'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0x168d('0x10e')](db[_0x168d('0x1d0')],{'as':_0x168d('0x1c0'),'foreignKey':_0x168d('0x1c1')});db['VtigerConfiguration']['hasMany'](db[_0x168d('0x1d0')],{'as':_0x168d('0x1c2'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0xbc')][_0x168d('0x10e')](db['VtigerField'],{'as':'Fields','foreignKey':_0x168d('0x1c3')});db[_0x168d('0xbc')]['belongsTo'](db[_0x168d('0x1cf')],{'as':_0x168d('0x16a'),'foreignKey':'AccountId'});db[_0x168d('0x1d0')][_0x168d('0x10e')](db[_0x168d('0x1d0')],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0x1d0')][_0x168d('0x10e')](db[_0x168d('0x1d0')],{'as':_0x168d('0x1c9'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0x1d0')][_0x168d('0x10e')](db[_0x168d('0x1d0')],{'as':_0x168d('0x1c5'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0x1d0')][_0x168d('0x14b')](db[_0x168d('0x8d')],{'as':_0x168d('0x8d'),'foreignKey':_0x168d('0x1c6')});db[_0x168d('0x1d1')]['hasMany'](db[_0x168d('0xc0')],{'as':_0x168d('0x1be'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xc0')][_0x168d('0x10e')](db[_0x168d('0xc2')],{'as':_0x168d('0x1c0'),'foreignKey':'SubjectId'});db[_0x168d('0xc0')][_0x168d('0x10e')](db[_0x168d('0xc2')],{'as':'Descriptions','foreignKey':_0x168d('0x1c4')});db[_0x168d('0xc0')][_0x168d('0x10e')](db[_0x168d('0xc2')],{'as':_0x168d('0x1bc'),'foreignKey':_0x168d('0x1c3')});db['ServicenowConfiguration']['belongsTo'](db[_0x168d('0x1d1')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1bf')});db['ServicenowField']['hasMany'](db[_0x168d('0xc2')],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0xc2')][_0x168d('0x10e')](db[_0x168d('0xc2')],{'as':_0x168d('0x1c9'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0x168d('0x10e')](db[_0x168d('0xc2')],{'as':_0x168d('0x1c5'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0xc2')][_0x168d('0x14b')](db[_0x168d('0x8d')],{'as':_0x168d('0x8d'),'foreignKey':'VariableId'});db[_0x168d('0xc3')][_0x168d('0x10e')](db[_0x168d('0xc5')],{'as':_0x168d('0x1be'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1bf')});db['Dynamics365Account'][_0x168d('0x14b')](db['CloudProvider'],{'as':_0x168d('0x15d'),'foreignKey':_0x168d('0x15e')});db['Dynamics365Configuration'][_0x168d('0x10e')](db['Dynamics365Field'],{'as':_0x168d('0x1c0'),'onDelete':_0x168d('0x10b'),'foreignKey':'SubjectId'});db[_0x168d('0xc5')]['hasMany'](db[_0x168d('0xc7')],{'as':_0x168d('0x1c2'),'onDelete':'cascade','foreignKey':_0x168d('0x1c4')});db['Dynamics365Configuration'][_0x168d('0x10e')](db[_0x168d('0xc7')],{'as':_0x168d('0x1bc'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0xc5')][_0x168d('0x14b')](db[_0x168d('0xc3')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xc7')]['hasMany'](db['Dynamics365Field'],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db[_0x168d('0xc7')]['hasMany'](db[_0x168d('0xc7')],{'as':_0x168d('0x1c9'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0xc7')]['hasMany'](db[_0x168d('0xc7')],{'as':'Field','foreignKey':_0x168d('0x1c3')});db[_0x168d('0xc7')][_0x168d('0x14b')](db[_0x168d('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x168d('0xc9')]['hasMany'](db[_0x168d('0xca')],{'as':_0x168d('0x1be'),'onDelete':'cascade','foreignKey':_0x168d('0x1bf')});db[_0x168d('0xca')][_0x168d('0x10e')](db[_0x168d('0xcc')],{'as':'Subjects','foreignKey':_0x168d('0x1c1')});db[_0x168d('0xca')]['hasMany'](db['FreshsalesField'],{'as':_0x168d('0x1c2'),'foreignKey':_0x168d('0x1c4')});db[_0x168d('0xca')]['hasMany'](db[_0x168d('0xcc')],{'as':_0x168d('0x1bc'),'foreignKey':_0x168d('0x1c3')});db['FreshsalesConfiguration']['belongsTo'](db[_0x168d('0xc9')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1bf')});db[_0x168d('0xcc')][_0x168d('0x10e')](db['FreshsalesField'],{'as':_0x168d('0x1c8'),'foreignKey':_0x168d('0x1c1')});db['FreshsalesField'][_0x168d('0x10e')](db[_0x168d('0xcc')],{'as':'Description','foreignKey':_0x168d('0x1c4')});db['FreshsalesField'][_0x168d('0x10e')](db['FreshsalesField'],{'as':_0x168d('0x1c5'),'foreignKey':_0x168d('0x1c3')});db[_0x168d('0xcc')][_0x168d('0x14b')](db[_0x168d('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x168d('0xce')][_0x168d('0x14b')](db[_0x168d('0x60')],{});db[_0x168d('0xce')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165')});db['ChatQueueReport'][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0xce')][_0x168d('0x14b')](db[_0x168d('0x65')],{});db[_0x168d('0xce')][_0x168d('0x14b')](db['ChatMessage'],{});db[_0x168d('0xce')][_0x168d('0x14b')](db[_0x168d('0x14')],{});db[_0x168d('0xce')]['belongsTo'](db[_0x168d('0x12a')],{});db[_0x168d('0xd0')][_0x168d('0x14b')](db[_0x168d('0x14')],{'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x1d2')});db[_0x168d('0xd0')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':'ToId'});db['JscriptySessionReport'][_0x168d('0x10e')](db['JscriptyQuestionReport'],{'foreignKey':_0x168d('0x1d3'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x149')][_0x168d('0x10e')](db[_0x168d('0xd1')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x168d('0xd5')]['belongsTo'](db['SmsAccount'],{});db[_0x168d('0xd5')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':_0x168d('0x164'),'foreignKey':_0x168d('0x165')});db[_0x168d('0xd5')][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':'Contact','foreignKey':_0x168d('0x15c')});db[_0x168d('0xd5')][_0x168d('0x14b')](db[_0x168d('0x53')],{});db['SmsQueueReport']['belongsTo'](db[_0x168d('0x55')],{});db[_0x168d('0xd5')]['belongsTo'](db[_0x168d('0x14')],{});db['SmsQueueReport'][_0x168d('0x14b')](db['SmsQueue'],{});db[_0x168d('0xd9')][_0x168d('0x10e')](db[_0x168d('0x149')],{'foreignKey':_0x168d('0x1d4')});db['JscriptyProject'][_0x168d('0x10e')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x168d('0x10e')](db[_0x168d('0xd1')],{'foreignKey':_0x168d('0x1d4')});db[_0x168d('0x1d5')][_0x168d('0x11d')](db['User'],{'as':_0x168d('0x16f'),'through':_0x168d('0x13a')});db[_0x168d('0xe3')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':'user_has_teams'});db[_0x168d('0xe3')][_0x168d('0x11d')](db[_0x168d('0x127')],{'through':'TeamVoiceQueue','as':_0x168d('0x1d6')});db[_0x168d('0xe3')][_0x168d('0x11d')](db[_0x168d('0x176')],{'through':_0x168d('0x169'),'as':'MailQueues'});db['Team'][_0x168d('0x11d')](db[_0x168d('0x12a')],{'through':_0x168d('0x1d7'),'as':_0x168d('0x1d8')});db[_0x168d('0xe3')][_0x168d('0x11d')](db[_0x168d('0x17f')],{'through':'team_has_fax_queues','as':_0x168d('0x12b')});db[_0x168d('0xe3')][_0x168d('0x11d')](db[_0x168d('0x12c')],{'through':_0x168d('0x1d9'),'as':_0x168d('0x12d')});db[_0x168d('0xe3')]['belongsToMany'](db[_0x168d('0x18d')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x168d('0xe3')][_0x168d('0x11d')](db[_0x168d('0x101')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x168d('0xe3')][_0x168d('0x11d')](db[_0x168d('0xf2')],{'through':_0x168d('0x1da'),'as':_0x168d('0x128')});db['Campaign']['hasMany'](db[_0x168d('0x144')],{'as':_0x168d('0x145'),'foreignKey':_0x168d('0x1a0')});db['Campaign'][_0x168d('0x10e')](db[_0x168d('0x111')],{'as':_0x168d('0x146'),'foreignKey':_0x168d('0x1a0')});db[_0x168d('0xe7')][_0x168d('0x10e')](db[_0x168d('0x112')],{'as':_0x168d('0x147'),'foreignKey':_0x168d('0x1a0')});db[_0x168d('0xe7')][_0x168d('0x10e')](db[_0x168d('0x70')],{'as':'HopperBlacks','foreignKey':_0x168d('0x1a0')});db[_0x168d('0xe7')][_0x168d('0x14b')](db['Trunk'],{'as':_0x168d('0x28'),'foreignKey':'TrunkId'});db[_0x168d('0xe7')][_0x168d('0x14b')](db['Trunk'],{'as':_0x168d('0x14d'),'foreignKey':_0x168d('0x14e')});db[_0x168d('0xe7')][_0x168d('0x14b')](db[_0x168d('0x7b')],{'as':_0x168d('0x7b'),'foreignKey':_0x168d('0x14f')});db[_0x168d('0xe7')][_0x168d('0x14b')](db[_0x168d('0x1d5')],{'as':_0x168d('0x1d5'),'foreignKey':'SquareProjectId'});db[_0x168d('0xe7')]['belongsToMany'](db[_0x168d('0xf1')],{'as':_0x168d('0x11e'),'through':_0x168d('0x1db')});db[_0x168d('0xe7')][_0x168d('0x11d')](db[_0x168d('0xf1')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0x168d('0x170')]['belongsTo'](db[_0x168d('0x68')],{'as':_0x168d('0x68'),'foreignKey':_0x168d('0x175')});db[_0x168d('0x1dc')][_0x168d('0x14b')](db['MailMessage'],{});db['MailTransferReport'][_0x168d('0x14b')](db['MailInteraction'],{});db[_0x168d('0x1dc')][_0x168d('0x14b')](db[_0x168d('0x3c')],{'foreignKey':_0x168d('0x1dd'),'as':_0x168d('0x1de')});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x168d('0x1df')});db['MailTransferReport'][_0x168d('0x14b')](db['User'],{'foreignKey':_0x168d('0x1e0'),'as':_0x168d('0x1e1')});db[_0x168d('0x1dc')][_0x168d('0x14b')](db[_0x168d('0x176')],{'foreignKey':'ToMailQueueId','as':_0x168d('0x1e2')});db[_0x168d('0x1dc')][_0x168d('0x14b')](db[_0x168d('0x3c')],{'foreignKey':'ToMailAccountId','as':_0x168d('0x1e3')});db[_0x168d('0xeb')][_0x168d('0x14b')](db[_0x168d('0x193')],{});db[_0x168d('0xeb')][_0x168d('0x14b')](db[_0x168d('0x65')],{});db['ChatTransferReport'][_0x168d('0x14b')](db[_0x168d('0x60')],{'foreignKey':_0x168d('0x1e4'),'as':'FromAccount'});db[_0x168d('0xeb')]['belongsTo'](db[_0x168d('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x168d('0xeb')][_0x168d('0x14b')](db['User'],{'foreignKey':_0x168d('0x1e0'),'as':_0x168d('0x1e1')});db['ChatTransferReport'][_0x168d('0x14b')](db[_0x168d('0x12a')],{'foreignKey':_0x168d('0x1e5'),'as':'ToQueue'});db[_0x168d('0xeb')][_0x168d('0x14b')](db[_0x168d('0x60')],{'foreignKey':_0x168d('0x1e6'),'as':_0x168d('0x1e3')});db['FaxTransferReport'][_0x168d('0x14b')](db[_0x168d('0x4d')],{});db[_0x168d('0xed')][_0x168d('0x14b')](db[_0x168d('0x4b')],{});db[_0x168d('0xed')][_0x168d('0x14b')](db[_0x168d('0x48')],{'foreignKey':_0x168d('0x1e7'),'as':_0x168d('0x1de')});db['FaxTransferReport'][_0x168d('0x14b')](db[_0x168d('0x14')],{'foreignKey':_0x168d('0x1e8'),'as':'FromAgent'});db[_0x168d('0xed')][_0x168d('0x14b')](db[_0x168d('0x14')],{'foreignKey':_0x168d('0x1e0'),'as':'ToAgent'});db[_0x168d('0xed')][_0x168d('0x14b')](db[_0x168d('0x17f')],{'foreignKey':_0x168d('0x1e9'),'as':'ToQueue'});db[_0x168d('0xed')][_0x168d('0x14b')](db[_0x168d('0x48')],{'foreignKey':'ToFaxAccountId','as':_0x168d('0x1e3')});db[_0x168d('0xef')][_0x168d('0x14b')](db[_0x168d('0x5d')],{});db[_0x168d('0xef')][_0x168d('0x14b')](db['OpenchannelInteraction'],{});db[_0x168d('0xef')]['belongsTo'](db[_0x168d('0x58')],{'foreignKey':_0x168d('0x1ea'),'as':'FromAccount'});db[_0x168d('0xef')][_0x168d('0x14b')](db[_0x168d('0x14')],{'foreignKey':_0x168d('0x1e8'),'as':_0x168d('0x1df')});db[_0x168d('0xef')][_0x168d('0x14b')](db[_0x168d('0x14')],{'foreignKey':'ToUserId','as':'ToAgent'});db['OpenchannelTransferReport'][_0x168d('0x14b')](db['OpenchannelQueue'],{'foreignKey':_0x168d('0x1eb'),'as':'ToQueue'});db[_0x168d('0xef')][_0x168d('0x14b')](db['OpenchannelAccount'],{'foreignKey':_0x168d('0x1ec'),'as':_0x168d('0x1e3')});db[_0x168d('0x1ed')][_0x168d('0x14b')](db[_0x168d('0x55')],{});db['SmsTransferReport'][_0x168d('0x14b')](db[_0x168d('0x53')],{});db[_0x168d('0x1ed')]['belongsTo'](db[_0x168d('0x51')],{'foreignKey':'FromSmsAccountId','as':_0x168d('0x1de')});db[_0x168d('0x1ed')][_0x168d('0x14b')](db[_0x168d('0x14')],{'foreignKey':_0x168d('0x1e8'),'as':'FromAgent'});db[_0x168d('0x1ed')][_0x168d('0x14b')](db[_0x168d('0x14')],{'foreignKey':_0x168d('0x1e0'),'as':_0x168d('0x1e1')});db[_0x168d('0x1ed')][_0x168d('0x14b')](db['SmsQueue'],{'foreignKey':_0x168d('0x1ee'),'as':_0x168d('0x1e2')});db['SmsTransferReport'][_0x168d('0x14b')](db[_0x168d('0x51')],{'foreignKey':_0x168d('0x1ef'),'as':'ToAccount'});db[_0x168d('0xf1')]['hasMany'](db[_0x168d('0x78')],{'as':_0x168d('0x162'),'foreignKey':_0x168d('0x165'),'onDelete':_0x168d('0x10b')});db[_0x168d('0xf1')][_0x168d('0x10e')](db['CmCustomField'],{'as':_0x168d('0x1f0'),'foreignKey':'ListId'});db['CmList']['hasMany'](db['CmContact'],{'as':_0x168d('0x11b'),'onDelete':_0x168d('0x10b'),'foreignKey':_0x168d('0x165')});db[_0x168d('0xf1')][_0x168d('0x10e')](db['CmHopperFinal'],{'as':_0x168d('0x146'),'foreignKey':_0x168d('0x165')});db[_0x168d('0xf1')][_0x168d('0x10e')](db[_0x168d('0x112')],{'as':_0x168d('0x1f1'),'foreignKey':_0x168d('0x165')});db[_0x168d('0xf1')]['hasMany'](db[_0x168d('0x113')],{'as':_0x168d('0x113'),'foreignKey':_0x168d('0x165')});db[_0x168d('0xf1')][_0x168d('0x11d')](db['VoiceQueue'],{'as':'Queues','through':_0x168d('0x151')});db[_0x168d('0xf1')]['belongsToMany'](db[_0x168d('0x14')],{'as':'Agents','through':_0x168d('0x11f')});db[_0x168d('0xf2')][_0x168d('0x10e')](db[_0x168d('0x19')],{'as':_0x168d('0x110'),'onDelete':'cascade'});db[_0x168d('0xf2')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':_0x168d('0x106')});db[_0x168d('0xf2')][_0x168d('0x11d')](db[_0x168d('0xe3')],{'through':_0x168d('0x1da'),'as':_0x168d('0x152')});db[_0x168d('0x1f2')][_0x168d('0x10e')](db[_0x168d('0x14')],{'as':_0x168d('0x16f'),'foreignKey':_0x168d('0x1f3')});db[_0x168d('0x1f2')][_0x168d('0x10e')](db[_0x168d('0x1f4')],{'as':'UserProfileSections','foreignKey':_0x168d('0x1f3'),'onDelete':_0x168d('0x10b')});db[_0x168d('0x1f4')][_0x168d('0x10e')](db[_0x168d('0x1f5')],{'as':_0x168d('0x1f6'),'foreignKey':_0x168d('0x1f7'),'onDelete':_0x168d('0x10b')});db['WhatsappAccount'][_0x168d('0x10e')](db[_0x168d('0x78')],{'as':_0x168d('0x162'),'foreignKey':_0x168d('0x1f8'),'onDelete':_0x168d('0x10b')});db[_0x168d('0xf9')][_0x168d('0x10e')](db['CannedAnswer'],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x168d('0xf9')][_0x168d('0x10e')](db[_0x168d('0xfb')],{'as':_0x168d('0x155'),'foreignKey':_0x168d('0x1f8')});db[_0x168d('0xf9')][_0x168d('0x10e')](db[_0x168d('0xfa')],{'as':'Interactions'});db[_0x168d('0xf9')]['hasMany'](db[_0x168d('0x1f9')],{'as':_0x168d('0x13f')});db[_0x168d('0xf9')][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':'List','foreignKey':_0x168d('0x165')});db[_0x168d('0xf9')]['belongsTo'](db[_0x168d('0x7d')],{'as':_0x168d('0x167'),'foreignKey':_0x168d('0x150')});db['WhatsappAccount'][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x168'),'through':_0x168d('0x1fa')});db[_0x168d('0x1f9')]['belongsTo'](db[_0x168d('0x14')],{'onDelete':_0x168d('0x15f')});db[_0x168d('0x1f9')][_0x168d('0x14b')](db[_0x168d('0x101')],{'onDelete':'restrict'});db[_0x168d('0x1f9')][_0x168d('0x14b')](db[_0x168d('0xf9')],{'onDelete':'restrict'});db[_0x168d('0x1f9')]['belongsTo'](db[_0x168d('0x7b')],{'onDelete':_0x168d('0x15f'),'foreignKey':_0x168d('0x14f')});db['WhatsappApplication']['belongsTo'](db[_0x168d('0x84')],{'onDelete':_0x168d('0x15f'),'foreignKey':'TagId'});db[_0x168d('0xfa')][_0x168d('0x10e')](db[_0x168d('0xfb')],{'as':'Messages','onDelete':_0x168d('0x10b'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x168d('0x14b')](db[_0x168d('0xf9')],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1f8')});db[_0x168d('0xfa')][_0x168d('0x14b')](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':'ContactId'});db[_0x168d('0xfa')]['belongsTo'](db[_0x168d('0x14')],{'as':_0x168d('0x16b'),'foreignKey':_0x168d('0x10c')});db['WhatsappInteraction'][_0x168d('0x11d')](db[_0x168d('0x84')],{'through':_0x168d('0x1b2'),'as':_0x168d('0x16d')});db[_0x168d('0xfa')]['belongsToMany'](db[_0x168d('0x84')],{'through':_0x168d('0x1b2'),'as':_0x168d('0x16e')});db[_0x168d('0xfa')][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':_0x168d('0x16f'),'through':_0x168d('0x126'),'foreignKey':_0x168d('0x1fb')});db[_0x168d('0xfb')]['belongsTo'](db[_0x168d('0x14')],{'as':_0x168d('0x14')});db['WhatsappMessage'][_0x168d('0x14b')](db[_0x168d('0x6e')],{'onDelete':'cascade','as':_0x168d('0x15b')});db[_0x168d('0xfb')][_0x168d('0x14b')](db['WhatsappInteraction'],{'onDelete':_0x168d('0x10b'),'as':_0x168d('0x172'),'foreignKey':_0x168d('0x1fb')});db['WhatsappMessage'][_0x168d('0x14b')](db['WhatsappAccount'],{'as':_0x168d('0x16a'),'foreignKey':_0x168d('0x1f8')});db[_0x168d('0xfd')][_0x168d('0x14b')](db[_0x168d('0xf9')],{});db['WhatsappQueueReport'][_0x168d('0x14b')](db[_0x168d('0xf1')],{'as':'List','foreignKey':'ListId'});db[_0x168d('0xfd')]['belongsTo'](db[_0x168d('0x6e')],{'as':_0x168d('0x15b'),'foreignKey':_0x168d('0x15c')});db[_0x168d('0xfd')]['belongsTo'](db['WhatsappInteraction'],{});db[_0x168d('0xfd')]['belongsTo'](db[_0x168d('0x101')],{});db['WhatsappQueueReport'][_0x168d('0x14b')](db[_0x168d('0xfb')],{});db[_0x168d('0xfd')]['belongsTo'](db[_0x168d('0x14')],{});db[_0x168d('0xff')][_0x168d('0x14b')](db['WhatsappMessage'],{});db[_0x168d('0xff')][_0x168d('0x14b')](db[_0x168d('0xfa')],{});db[_0x168d('0xff')][_0x168d('0x14b')](db['WhatsappAccount'],{'foreignKey':_0x168d('0x1fc'),'as':'FromAccount'});db[_0x168d('0xff')]['belongsTo'](db[_0x168d('0xf9')],{'foreignKey':_0x168d('0x1fd'),'as':_0x168d('0x1e3')});db[_0x168d('0xff')][_0x168d('0x14b')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x168d('0x1e2')});db['WhatsappTransferReport'][_0x168d('0x14b')](db['User'],{'foreignKey':_0x168d('0x1e8'),'as':_0x168d('0x1df')});db['WhatsappTransferReport']['belongsTo'](db[_0x168d('0x14')],{'foreignKey':_0x168d('0x1e0'),'as':'ToAgent'});db['WhatsappQueue'][_0x168d('0x11d')](db[_0x168d('0x14')],{'as':'Agents','through':_0x168d('0x130'),'foreignKey':_0x168d('0x1fe')});db['WhatsappQueue'][_0x168d('0x11d')](db[_0x168d('0xe3')],{'through':_0x168d('0x1ff'),'as':_0x168d('0x152')});db['UserSetting'][_0x168d('0x14b')](db[_0x168d('0x14')],{'as':'user','foreignKey':_0x168d('0x10c'),'onDelete':_0x168d('0x10b'),'hooks':!![]});db[_0x168d('0x15d')]['hasOne'](db[_0x168d('0xc3')],{'as':'Dynamics365Account','onDelete':'restrict'});db[_0x168d('0x15d')][_0x168d('0x10a')](db[_0x168d('0x39')],{'as':_0x168d('0x200'),'onDelete':_0x168d('0x15f')});db['CloudProvider']['hasOne'](db[_0x168d('0x3a')],{'as':_0x168d('0x161'),'onDelete':_0x168d('0x15f')});module[_0x168d('0x201')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xbef0=['ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','Schedule','../api/schedule/schedule.model','Tag','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../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','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','UserNotifications','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_chat_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','UserMailQueue','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Sound','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperFinal','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','CloudProviderId','restrict','Smtp','Dispositions','MailAccountId','Answers','MailMessage','Interactions','Applications','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachment','Attachments','ChatWebsiteId','TagId','MailQueueReport','List','DashboardItem','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Account','team_has_fax_queues','SmsAccountId','SmsInteractionId','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueue','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','CmHopperId','CampaignId','All','OneAll','AutomationAllId','Automation','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','Hopper','AllConditions','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','SubjectId','DescriptionId','FieldId','Subject','VariableId','Configurations','SugarcrmField','Subjects','Descriptions','Field','int_desk_configuration_has_tags','Description','int_zendesk_configuration_has_tags','Dynamics365Account','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','ChatQueueReport','ChatInternalMessage','FromId','ToId','SessionId','JscriptyProject','ProjectId','user_has_square_projects','VoiceQueues','MailQueues','team_has_whatsapp_queues','VoicePrefixes','campaigns_has_cm_lists','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','Queues','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','Imap','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xcall','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xC@LL1234','utf8mb4','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.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','MailInteraction','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbef0,0x198));var _0x0bef=function(_0x56cc5f,_0x191cbb){_0x56cc5f=_0x56cc5f-0x0;var _0x3fa6dd=_0xbef0[_0x56cc5f];return _0x3fa6dd;};'use strict';var config=require(_0x0bef('0x0'));var Sequelize=require(_0x0bef('0x1'));var _=require(_0x0bef('0x2'));var jstz=require('jstz');var timezone=jstz[_0x0bef('0x3')]();config[_0x0bef('0x1')]=_[_0x0bef('0x4')](config[_0x0bef('0x1')],{'database':'motion2','username':_0x0bef('0x5'),'password':'xC@LL1234','options':{'host':_0x0bef('0x6'),'port':0xcea,'dialect':_0x0bef('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x0bef('0x8')](),'define':{'charset':_0x0bef('0x9'),'collate':_0x0bef('0xa')}}});config[_0x0bef('0xb')]=_[_0x0bef('0x4')](config[_0x0bef('0xb')],{'database':_0x0bef('0xc'),'username':_0x0bef('0x5'),'password':_0x0bef('0xd'),'options':{'host':_0x0bef('0x6'),'port':0xcea,'dialect':_0x0bef('0x7'),'dialectOptions':{'charset':_0x0bef('0xe')},'logging':![],'timezone':timezone[_0x0bef('0x8')](),'define':{'charset':_0x0bef('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0bef('0x1')][_0x0bef('0xf')],config[_0x0bef('0x1')][_0x0bef('0x10')],config['sequelize'][_0x0bef('0x11')],config[_0x0bef('0x1')][_0x0bef('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0bef('0xf')],config['sequelizeHistory'][_0x0bef('0x10')],config[_0x0bef('0xb')][_0x0bef('0x11')],config['sequelizeHistory'][_0x0bef('0x12')])};db[_0x0bef('0x13')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x15'));db[_0x0bef('0x16')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x17'));db[_0x0bef('0x18')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x19'));db[_0x0bef('0x1a')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x1b'));db[_0x0bef('0x1c')]=db['sequelize'][_0x0bef('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x0bef('0x1d')]=db['sequelize'][_0x0bef('0x14')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x1e'));db[_0x0bef('0x1f')]=db[_0x0bef('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0x0bef('0x20')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x21'));db[_0x0bef('0x22')]=db['sequelize']['import'](_0x0bef('0x23'));db[_0x0bef('0x24')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x25'));db['VoiceDialReport']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x26'));db[_0x0bef('0x27')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x28'));db[_0x0bef('0x29')]=db['sequelize']['import'](_0x0bef('0x2a'));db['MemberReport']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x2b'));db['Trunk']=db['sequelize']['import'](_0x0bef('0x2c'));db[_0x0bef('0x2d')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x2e'));db['UserVoiceQueueRt']=db[_0x0bef('0x1')]['import'](_0x0bef('0x2f'));db[_0x0bef('0x30')]=db['sequelize']['import'](_0x0bef('0x31'));db[_0x0bef('0x32')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x33'));db['UserMailQueue']=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x0bef('0x34')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x35'));db[_0x0bef('0x36')]=db['sequelize'][_0x0bef('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0bef('0x37')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x38'));db['UserWhatsappQueue']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x39'));db[_0x0bef('0x3a')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x3b'));db[_0x0bef('0x3c')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x3d'));db[_0x0bef('0x3e')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x3f'));db[_0x0bef('0x40')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x0bef('0x1')]['import'](_0x0bef('0x41'));db[_0x0bef('0x42')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/mailMessage/mailMessage.model');db[_0x0bef('0x43')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x44'));db['MailQueueReport']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x45'));db[_0x0bef('0x46')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x47'));db['DashboardItem']=db['sequelize']['import'](_0x0bef('0x48'));db[_0x0bef('0x49')]=db['sequelize']['import'](_0x0bef('0x4a'));db[_0x0bef('0x4b')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x4c'));db[_0x0bef('0x4d')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x4e'));db[_0x0bef('0x4f')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/faxMessage/faxMessage.model');db[_0x0bef('0x50')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x51'));db[_0x0bef('0x52')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x53'));db['SmsAccount']=db['sequelize']['import'](_0x0bef('0x54'));db[_0x0bef('0x55')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x56'));db[_0x0bef('0x57')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x58'));db[_0x0bef('0x59')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x5a'));db[_0x0bef('0x5b')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x5c'));db[_0x0bef('0x5d')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x5e'));db['OpenchannelApplication']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x5f'));db[_0x0bef('0x60')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x61'));db[_0x0bef('0x62')]=db[_0x0bef('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x63'));db[_0x0bef('0x64')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x65'));db[_0x0bef('0x66')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x67'));db[_0x0bef('0x68')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x69'));db[_0x0bef('0x6a')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0x0bef('0x1')]['import'](_0x0bef('0x6b'));db[_0x0bef('0x6c')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x6d'));db[_0x0bef('0x6e')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x6f'));db[_0x0bef('0x70')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x71'));db[_0x0bef('0x72')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x73'));db[_0x0bef('0x74')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x75'));db[_0x0bef('0x76')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x77'));db[_0x0bef('0x78')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x79'));db['CmHopperFinal']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x7a'));db[_0x0bef('0x7b')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x7c'));db['ReportAgentPreview']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x7d'));db['CmCustomField']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x7e'));db[_0x0bef('0x7f')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x80'));db['Automation']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x81'));db[_0x0bef('0x82')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x83'));db[_0x0bef('0x84')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x85'));db[_0x0bef('0x86')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x87'));db[_0x0bef('0x88')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/interval/interval.model');db[_0x0bef('0x89')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x8a'));db[_0x0bef('0x8b')]=db['sequelize'][_0x0bef('0x14')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x0bef('0x8c')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x8d'));db['Sound']=db[_0x0bef('0x1')]['import']('../api/sound/sound.model');db[_0x0bef('0x8e')]=db[_0x0bef('0x1')]['import']('../api/tag/tag.model');db['ContactItemType']=db[_0x0bef('0x1')]['import'](_0x0bef('0x8f'));db[_0x0bef('0x90')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x91'));db[_0x0bef('0x92')]=db['sequelize'][_0x0bef('0x14')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0bef('0x93')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/template/template.model');db[_0x0bef('0x94')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x95'));db[_0x0bef('0x96')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x97'));db[_0x0bef('0x98')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x99'));db[_0x0bef('0x9a')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x9b'));db[_0x0bef('0x9c')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x9d'));db[_0x0bef('0x9e')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x9f'));db[_0x0bef('0xa0')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x0bef('0xa1')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0x0bef('0xa2')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xa3'));db[_0x0bef('0xa4')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0xa5'));db[_0x0bef('0xa6')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xa7'));db[_0x0bef('0xa8')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xa9'));db[_0x0bef('0xaa')]=db[_0x0bef('0x1')]['import'](_0x0bef('0xab'));db[_0x0bef('0xac')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xad'));db[_0x0bef('0xae')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xaf'));db[_0x0bef('0xb0')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xb1'));db[_0x0bef('0xb2')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xb3'));db[_0x0bef('0xb4')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xb5'));db[_0x0bef('0xb6')]=db[_0x0bef('0x1')]['import'](_0x0bef('0xb7'));db[_0x0bef('0xb8')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x0bef('0xb9')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xba'));db[_0x0bef('0xbb')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0xbc'));db[_0x0bef('0xbd')]=db[_0x0bef('0x1')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x0bef('0xbe')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xbf'));db[_0x0bef('0xc0')]=db[_0x0bef('0x1')]['import'](_0x0bef('0xc1'));db[_0x0bef('0xc2')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xc3'));db[_0x0bef('0xc4')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0xc5'));db[_0x0bef('0xc6')]=db['sequelize'][_0x0bef('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x0bef('0xc7')]=db['sequelize'][_0x0bef('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0bef('0xc8')]=db['sequelize'][_0x0bef('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x0bef('0xc9')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xca'));db[_0x0bef('0xcb')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x0bef('0xcc')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xcd'));db['Dynamics365Account']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xce'));db[_0x0bef('0xcf')]=db[_0x0bef('0x1')]['import'](_0x0bef('0xd0'));db['Dynamics365Field']=db['sequelize']['import'](_0x0bef('0xd1'));db['FreshsalesAccount']=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xd2'));db['FreshsalesField']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xd3'));db['Integration']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x99'));db[_0x0bef('0xd4')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xd5'));db['ChatQueueReport']=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x0bef('0x1')]['import'](_0x0bef('0xd6'));db[_0x0bef('0xd7')]=db[_0x0bef('0x1')]['import'](_0x0bef('0xd8'));db[_0x0bef('0xd9')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xda'));db[_0x0bef('0xdb')]=db['sequelize']['import'](_0x0bef('0xdc'));db[_0x0bef('0xdd')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xde'));db[_0x0bef('0xdf')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xe0'));db[_0x0bef('0xe1')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xe2'));db['Setting']=db[_0x0bef('0x1')]['import'](_0x0bef('0xe3'));db['SquareOdbc']=db[_0x0bef('0x1')]['import'](_0x0bef('0xe4'));db[_0x0bef('0xe5')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xe6'));db[_0x0bef('0xe7')]=db[_0x0bef('0x1')]['import'](_0x0bef('0xe8'));db['SquareMessage']=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db[_0x0bef('0xe9')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xea'));db['License']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xeb'));db[_0x0bef('0xec')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xed'));db[_0x0bef('0xee')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xef'));db['Attachment']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xf0'));db[_0x0bef('0xf1')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xf2'));db[_0x0bef('0xf3')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xf4'));db['ChatTransferReport']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xf5'));db[_0x0bef('0xf6')]=db[_0x0bef('0x1')]['import'](_0x0bef('0xf7'));db['OpenchannelTransferReport']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xf8'));db['SmsTransferReport']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xf9'));db[_0x0bef('0xfa')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xfb'));db[_0x0bef('0xfc')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xfd'));db[_0x0bef('0xfe')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0xff'));db[_0x0bef('0x100')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x101'));db[_0x0bef('0x102')]=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x103'));db[_0x0bef('0x104')]=db[_0x0bef('0x1')]['import']('../api/userNotification/userNotification.model');db[_0x0bef('0x105')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x106'));db['WhatsappApplication']=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x107'));db['WhatsappInteraction']=db[_0x0bef('0x1')]['import'](_0x0bef('0x108'));db[_0x0bef('0x109')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x10a'));db[_0x0bef('0x10b')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x10c'));db['WhatsappTransferReport']=db['sequelize'][_0x0bef('0x14')](_0x0bef('0x10d'));db[_0x0bef('0x10e')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x10f'));db[_0x0bef('0x110')]=db['sequelize'][_0x0bef('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0x0bef('0x111')]=db[_0x0bef('0x1')][_0x0bef('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x0bef('0x112')]=db[_0x0bef('0x1')]['import'](_0x0bef('0x113'));db[_0x0bef('0x114')]=db['sequelize'][_0x0bef('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x0bef('0x115')]=db[_0x0bef('0x1')][_0x0bef('0x14')](_0x0bef('0x116'));db[_0x0bef('0x13')][_0x0bef('0x117')](db[_0x0bef('0x20')],{'as':_0x0bef('0x20'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')]['hasOne'](db[_0x0bef('0x115')],{'as':_0x0bef('0x11a'),'onDelete':'cascade','foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db['VoiceRecording'],{'as':_0x0bef('0x11c'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db[_0x0bef('0x11d')],{'as':_0x0bef('0x11e'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db['VoiceExtension'],{'as':_0x0bef('0x11f'),'onDelete':_0x0bef('0x118'),'hooks':!![]});db['User'][_0x0bef('0x11b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x0bef('0x119')});db['User'][_0x0bef('0x11b')](db['CmHopperHistory'],{'as':_0x0bef('0x120'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db[_0x0bef('0x121')],{'as':'ReportAgentPreview','foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db[_0x0bef('0x60')],{'as':_0x0bef('0x122'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db[_0x0bef('0x6a')],{'as':_0x0bef('0x123'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db[_0x0bef('0x57')],{'as':_0x0bef('0x124'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')]['hasMany'](db[_0x0bef('0x4d')],{'as':_0x0bef('0x125'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')]['hasMany'](db['MailInteraction'],{'as':_0x0bef('0x126'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db[_0x0bef('0x127')],{'as':'WhatsappInteractions','foreignKey':_0x0bef('0x119')});db[_0x0bef('0x13')][_0x0bef('0x11b')](db[_0x0bef('0x104')],{'as':_0x0bef('0x128'),'foreignKey':'SenderId'});db[_0x0bef('0x13')][_0x0bef('0x129')](db[_0x0bef('0xfe')],{'as':_0x0bef('0xfe'),'foreignKey':'userProfileId'});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x6e')],{'as':_0x0bef('0x12b'),'through':_0x0bef('0x12c')});db['User'][_0x0bef('0x12a')](db[_0x0bef('0x74')],{'as':_0x0bef('0x12d'),'through':_0x0bef('0x12e')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x12f'),'through':_0x0bef('0x130')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0xe9')],{'through':'user_has_teams'});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x42')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0x0bef('0x13')]['belongsToMany'](db[_0x0bef('0x6a')],{'as':_0x0bef('0x123'),'through':_0x0bef('0x131')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db['FaxInteraction'],{'as':_0x0bef('0x125'),'through':'user_has_fax_interactions'});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x57')],{'as':_0x0bef('0x124'),'through':_0x0bef('0x132')});db['User'][_0x0bef('0x12a')](db[_0x0bef('0x60')],{'as':_0x0bef('0x122'),'through':'user_has_openchannel_interactions'});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x127')],{'as':_0x0bef('0x133'),'through':_0x0bef('0x134')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x1d')],{'as':'VoiceQueues','through':_0x0bef('0x30'),'required':![]});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0xfc')],{'as':'VoicePrefixes','through':_0x0bef('0x114'),'required':![]});db[_0x0bef('0x13')]['belongsToMany'](db['MailQueue'],{'as':'MailQueues','through':_0x0bef('0x135'),'required':![]});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x136')],{'as':_0x0bef('0x137'),'through':_0x0bef('0x32'),'required':![],'hooks':!![]});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x50')],{'as':_0x0bef('0x138'),'through':_0x0bef('0x34'),'required':![]});db[_0x0bef('0x13')][_0x0bef('0x12a')](db['SmsQueue'],{'as':_0x0bef('0x139'),'through':_0x0bef('0x36'),'required':![]});db[_0x0bef('0x13')][_0x0bef('0x12a')](db['OpenchannelQueue'],{'as':_0x0bef('0x13a'),'through':_0x0bef('0x37'),'required':![]});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x10e')],{'as':_0x0bef('0x13b'),'through':_0x0bef('0x13c'),'required':![]});db[_0x0bef('0x13')]['belongsToMany'](db['CmList'],{'through':_0x0bef('0x130')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x64')],{'as':_0x0bef('0x13d'),'through':_0x0bef('0x13e')});db['User']['belongsToMany'](db[_0x0bef('0x49')],{'as':_0x0bef('0x13f'),'through':_0x0bef('0x140')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x3e')],{'as':'MailAccounts','through':_0x0bef('0x141')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x0bef('0x142')});db[_0x0bef('0x13')][_0x0bef('0x12a')](db[_0x0bef('0x143')],{'as':_0x0bef('0x144'),'through':'user_has_sms_accounts'});db[_0x0bef('0x13')]['belongsToMany'](db[_0x0bef('0x105')],{'as':_0x0bef('0x145'),'through':_0x0bef('0x146')});db['User']['belongsToMany'](db[_0x0bef('0xe5')],{'as':_0x0bef('0x147'),'through':'user_has_square_projects'});db['VoiceChanSpy'][_0x0bef('0x11b')](db[_0x0bef('0x1a')],{'as':_0x0bef('0x148'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x149')});db[_0x0bef('0x18')][_0x0bef('0x11b')](db['VoiceExtension'],{'onDelete':_0x0bef('0x118')});db[_0x0bef('0x1a')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0x0bef('0x118')});db[_0x0bef('0x1c')][_0x0bef('0x12a')](db[_0x0bef('0x14a')],{'as':'Sounds','through':_0x0bef('0x14b')});db['VoiceQueue'][_0x0bef('0x11b')](db[_0x0bef('0x11d')],{'as':_0x0bef('0x14c'),'foreignKey':_0x0bef('0x14d')});db[_0x0bef('0x1d')][_0x0bef('0x11b')](db[_0x0bef('0x76')],{'as':_0x0bef('0x14e'),'foreignKey':_0x0bef('0x14d')});db[_0x0bef('0x1d')][_0x0bef('0x11b')](db[_0x0bef('0x14f')],{'as':_0x0bef('0x150'),'foreignKey':_0x0bef('0x14d')});db[_0x0bef('0x1d')][_0x0bef('0x11b')](db['CmHopperHistory'],{'as':_0x0bef('0x151'),'foreignKey':_0x0bef('0x14d')});db[_0x0bef('0x1d')][_0x0bef('0x11b')](db[_0x0bef('0x121')],{'as':_0x0bef('0x121'),'foreignKey':'VoiceQueueId'});db[_0x0bef('0x1d')][_0x0bef('0x11b')](db[_0x0bef('0x78')],{'as':_0x0bef('0x152'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x0bef('0xdb')],{'as':_0x0bef('0x153'),'foreignKey':_0x0bef('0x14d')});db[_0x0bef('0x1d')]['belongsTo'](db['Trunk'],{'as':_0x0bef('0x154'),'foreignKey':_0x0bef('0x155')});db['VoiceQueue'][_0x0bef('0x129')](db['Trunk'],{'as':_0x0bef('0x156'),'foreignKey':_0x0bef('0x157')});db[_0x0bef('0x1d')]['belongsTo'](db[_0x0bef('0x88')],{'as':_0x0bef('0x88'),'foreignKey':_0x0bef('0x158')});db['VoiceQueue'][_0x0bef('0x129')](db[_0x0bef('0x89')],{'as':_0x0bef('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0bef('0x1d')][_0x0bef('0x12a')](db[_0x0bef('0xfa')],{'as':'Lists','through':_0x0bef('0x15a')});db[_0x0bef('0x1d')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x30')});db[_0x0bef('0x1d')][_0x0bef('0x12a')](db[_0x0bef('0xe9')],{'as':_0x0bef('0x15c'),'through':_0x0bef('0x111')});db[_0x0bef('0x1d')][_0x0bef('0x12a')](db[_0x0bef('0xfa')],{'as':'BlackLists','through':_0x0bef('0x15d')});db['VoiceRecording'][_0x0bef('0x129')](db['User'],{'as':_0x0bef('0x13'),'foreignKey':'UserId'});db[_0x0bef('0x1f')][_0x0bef('0x129')](db['User'],{'as':_0x0bef('0x13'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x20')][_0x0bef('0x11b')](db[_0x0bef('0x22')],{'as':_0x0bef('0x15e'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x15f'),'sourceKey':_0x0bef('0x160')});db[_0x0bef('0x22')][_0x0bef('0x129')](db[_0x0bef('0x20')],{'foreignKey':'mailboxuser','targetKey':_0x0bef('0x160')});db[_0x0bef('0x24')]['hasMany'](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x0bef('0x161'),'constraints':![]});db['VoiceCallReport'][_0x0bef('0x11b')](db[_0x0bef('0x27')],{'as':_0x0bef('0x162'),'foreignKey':_0x0bef('0x161'),'constraints':![]});db[_0x0bef('0x24')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'as':_0x0bef('0x13'),'foreignKey':_0x0bef('0x119')});db['VoiceCallReport'][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0x3a')][_0x0bef('0x129')](db[_0x0bef('0x3e')],{'as':_0x0bef('0x3e'),'foreignKey':'MailAccountId'});db[_0x0bef('0x3a')][_0x0bef('0x129')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x0bef('0x165'),'onDelete':_0x0bef('0x166')});db['MailServerOut'][_0x0bef('0x129')](db['MailAccount'],{'as':_0x0bef('0x3e'),'foreignKey':'MailAccountId'});db[_0x0bef('0x3c')][_0x0bef('0x129')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x0bef('0x165'),'onDelete':_0x0bef('0x166')});db['MailAccount'][_0x0bef('0x117')](db['MailServerIn'],{'as':'Imap','onDelete':'cascade'});db[_0x0bef('0x3e')]['hasOne'](db[_0x0bef('0x3c')],{'as':_0x0bef('0x167'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x3e')][_0x0bef('0x11b')](db['Disposition'],{'as':_0x0bef('0x168'),'foreignKey':_0x0bef('0x169'),'onDelete':_0x0bef('0x118')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0x0bef('0x16a'),'foreignKey':_0x0bef('0x169')});db[_0x0bef('0x3e')][_0x0bef('0x11b')](db[_0x0bef('0x16b')],{'as':'Messages','foreignKey':_0x0bef('0x169')});db[_0x0bef('0x3e')]['hasMany'](db[_0x0bef('0x42')],{'as':_0x0bef('0x16c')});db[_0x0bef('0x3e')][_0x0bef('0x11b')](db[_0x0bef('0x43')],{'as':_0x0bef('0x16d')});db[_0x0bef('0x3e')][_0x0bef('0x129')](db['CmList'],{'as':'List','foreignKey':_0x0bef('0x16e')});db['MailAccount'][_0x0bef('0x129')](db['Template'],{'as':_0x0bef('0x93'),'foreignKey':_0x0bef('0x16f')});db[_0x0bef('0x3e')][_0x0bef('0x129')](db[_0x0bef('0x89')],{'as':_0x0bef('0x159'),'foreignKey':_0x0bef('0x170')});db[_0x0bef('0x3e')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x141')});db['MailQueue']['belongsToMany'](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':'UserMailQueue'});db[_0x0bef('0x40')][_0x0bef('0x12a')](db[_0x0bef('0xe9')],{'through':_0x0bef('0x171'),'as':_0x0bef('0x15c')});db['MailInteraction'][_0x0bef('0x11b')](db[_0x0bef('0x16b')],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x0bef('0x42')]['belongsTo'](db[_0x0bef('0x3e')],{'as':'Account','foreignKey':_0x0bef('0x169')});db[_0x0bef('0x42')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':_0x0bef('0x163'),'foreignKey':'ContactId'});db[_0x0bef('0x42')][_0x0bef('0x129')](db['User'],{'as':_0x0bef('0x172'),'foreignKey':_0x0bef('0x119')});db['MailInteraction']['belongsToMany'](db[_0x0bef('0x8e')],{'through':_0x0bef('0x173'),'as':_0x0bef('0x174')});db[_0x0bef('0x42')]['belongsToMany'](db[_0x0bef('0x8e')],{'through':_0x0bef('0x173'),'as':_0x0bef('0x175')});db[_0x0bef('0x42')]['belongsToMany'](db[_0x0bef('0x13')],{'as':_0x0bef('0x176'),'through':'user_has_mail_interactions','foreignKey':_0x0bef('0x177')});db[_0x0bef('0x16b')][_0x0bef('0x11b')](db[_0x0bef('0x178')],{'as':_0x0bef('0x179'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x16b')]['belongsTo'](db[_0x0bef('0x13')],{'as':_0x0bef('0x13')});db[_0x0bef('0x16b')]['belongsTo'](db[_0x0bef('0x74')],{'onDelete':_0x0bef('0x118'),'as':_0x0bef('0x163')});db[_0x0bef('0x16b')][_0x0bef('0x129')](db[_0x0bef('0x42')],{'as':'Interaction','foreignKey':_0x0bef('0x177')});db[_0x0bef('0x16b')]['belongsTo'](db[_0x0bef('0x3e')],{'as':'Account','foreignKey':_0x0bef('0x169')});db[_0x0bef('0x16b')][_0x0bef('0x129')](db[_0x0bef('0x64')],{'as':'ChatWebsite','foreignKey':_0x0bef('0x17a')});db[_0x0bef('0x16b')][_0x0bef('0x129')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x0bef('0x43')]['belongsTo'](db['User'],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x43')][_0x0bef('0x129')](db[_0x0bef('0x40')],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x43')][_0x0bef('0x129')](db[_0x0bef('0x3e')],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x43')][_0x0bef('0x129')](db[_0x0bef('0x88')],{'onDelete':_0x0bef('0x166'),'foreignKey':'IntervalId'});db[_0x0bef('0x43')][_0x0bef('0x129')](db[_0x0bef('0x8e')],{'onDelete':_0x0bef('0x166'),'foreignKey':_0x0bef('0x17b')});db[_0x0bef('0x17c')][_0x0bef('0x129')](db[_0x0bef('0x3e')],{});db[_0x0bef('0x17c')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':_0x0bef('0x16e')});db['MailQueueReport']['belongsTo'](db['CmContact'],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0x17c')][_0x0bef('0x129')](db[_0x0bef('0x42')],{});db['MailQueueReport'][_0x0bef('0x129')](db[_0x0bef('0x16b')],{});db[_0x0bef('0x17c')][_0x0bef('0x129')](db[_0x0bef('0x13')],{});db[_0x0bef('0x17c')][_0x0bef('0x129')](db['MailQueue'],{});db[_0x0bef('0x46')][_0x0bef('0x11b')](db[_0x0bef('0x17e')],{'as':_0x0bef('0x17f'),'onDelete':'cascade'});db[_0x0bef('0x49')][_0x0bef('0x11b')](db['Disposition'],{'as':_0x0bef('0x168'),'foreignKey':_0x0bef('0x180'),'onDelete':_0x0bef('0x118')});db['FaxAccount'][_0x0bef('0x11b')](db[_0x0bef('0x82')],{'as':_0x0bef('0x16a'),'foreignKey':_0x0bef('0x180')});db[_0x0bef('0x49')][_0x0bef('0x11b')](db['FaxInteraction'],{'as':_0x0bef('0x16c')});db[_0x0bef('0x49')][_0x0bef('0x11b')](db[_0x0bef('0x4b')],{'as':_0x0bef('0x16d')});db[_0x0bef('0x49')][_0x0bef('0x11b')](db['VoiceExtension'],{'as':_0x0bef('0x181'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x49')][_0x0bef('0x11b')](db[_0x0bef('0x4f')],{'as':_0x0bef('0x15e')});db[_0x0bef('0x49')][_0x0bef('0x129')](db[_0x0bef('0x154')],{'as':'Trunk'});db[_0x0bef('0x49')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':'List','foreignKey':_0x0bef('0x16e')});db[_0x0bef('0x49')][_0x0bef('0x129')](db['Pause'],{'as':_0x0bef('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0bef('0x49')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':'Agents','through':_0x0bef('0x140')});db[_0x0bef('0x4b')][_0x0bef('0x129')](db['User'],{'onDelete':'restrict'});db[_0x0bef('0x4b')]['belongsTo'](db['FaxQueue'],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0x0bef('0x49')],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x4b')][_0x0bef('0x129')](db[_0x0bef('0x8e')],{'onDelete':_0x0bef('0x166'),'foreignKey':_0x0bef('0x17b')});db[_0x0bef('0x4d')][_0x0bef('0x11b')](db[_0x0bef('0x4f')],{'as':'Messages','onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x182')});db[_0x0bef('0x4d')]['belongsTo'](db[_0x0bef('0x49')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxInteraction'][_0x0bef('0x129')](db['CmContact'],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0x4d')][_0x0bef('0x129')](db['User'],{'as':_0x0bef('0x172'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x4d')]['belongsToMany'](db[_0x0bef('0x8e')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x0bef('0x4d')][_0x0bef('0x12a')](db[_0x0bef('0x8e')],{'through':_0x0bef('0x183'),'as':_0x0bef('0x175')});db['FaxInteraction'][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x176'),'through':_0x0bef('0x184'),'foreignKey':_0x0bef('0x182')});db['FaxMessage'][_0x0bef('0x129')](db[_0x0bef('0x13')],{'onDelete':_0x0bef('0x118'),'as':'User'});db['FaxMessage'][_0x0bef('0x129')](db[_0x0bef('0x4d')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0x0bef('0x4f')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'onDelete':_0x0bef('0x118'),'as':_0x0bef('0x163')});db[_0x0bef('0x4f')]['belongsTo'](db[_0x0bef('0x178')],{'as':_0x0bef('0x178'),'foreignKey':'AttachmentId'});db[_0x0bef('0x4f')][_0x0bef('0x129')](db[_0x0bef('0x49')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x180')});db[_0x0bef('0x50')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x34')});db[_0x0bef('0x50')]['belongsToMany'](db[_0x0bef('0xe9')],{'through':_0x0bef('0x186'),'as':'Teams'});db[_0x0bef('0x52')][_0x0bef('0x129')](db[_0x0bef('0x49')],{});db[_0x0bef('0x52')]['belongsTo'](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db['FaxQueueReport'][_0x0bef('0x129')](db[_0x0bef('0x4d')],{});db['FaxQueueReport']['belongsTo'](db[_0x0bef('0x4f')],{});db[_0x0bef('0x52')][_0x0bef('0x129')](db[_0x0bef('0x13')],{});db[_0x0bef('0x52')][_0x0bef('0x129')](db[_0x0bef('0x50')],{});db[_0x0bef('0x143')][_0x0bef('0x11b')](db[_0x0bef('0x84')],{'as':'Dispositions','foreignKey':_0x0bef('0x187'),'onDelete':'cascade'});db[_0x0bef('0x143')][_0x0bef('0x11b')](db['CannedAnswer'],{'as':_0x0bef('0x16a'),'foreignKey':_0x0bef('0x187')});db[_0x0bef('0x143')][_0x0bef('0x11b')](db[_0x0bef('0x59')],{'as':'Messages','foreignKey':_0x0bef('0x187')});db[_0x0bef('0x143')][_0x0bef('0x11b')](db['SmsInteraction'],{'as':_0x0bef('0x16c')});db[_0x0bef('0x143')][_0x0bef('0x11b')](db[_0x0bef('0x55')],{'as':'Applications'});db[_0x0bef('0x143')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':'ListId'});db[_0x0bef('0x143')][_0x0bef('0x129')](db[_0x0bef('0x89')],{'as':_0x0bef('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':'user_has_sms_accounts'});db[_0x0bef('0x55')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'onDelete':_0x0bef('0x166')});db['SmsApplication']['belongsTo'](db[_0x0bef('0x5b')],{'onDelete':_0x0bef('0x166')});db['SmsApplication']['belongsTo'](db[_0x0bef('0x143')],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x55')][_0x0bef('0x129')](db[_0x0bef('0x88')],{'onDelete':_0x0bef('0x166'),'foreignKey':'IntervalId'});db['SmsApplication']['belongsTo'](db[_0x0bef('0x8e')],{'onDelete':_0x0bef('0x166'),'foreignKey':'TagId'});db[_0x0bef('0x57')][_0x0bef('0x11b')](db[_0x0bef('0x59')],{'as':_0x0bef('0x15e'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x188')});db[_0x0bef('0x57')][_0x0bef('0x129')](db[_0x0bef('0x143')],{'as':'Account','foreignKey':_0x0bef('0x187')});db[_0x0bef('0x57')]['belongsTo'](db[_0x0bef('0x74')],{'as':'Contact','foreignKey':_0x0bef('0x164')});db[_0x0bef('0x57')]['belongsTo'](db['User'],{'as':_0x0bef('0x172'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x57')]['belongsToMany'](db[_0x0bef('0x8e')],{'through':'sms_interaction_has_tags','as':_0x0bef('0x174')});db[_0x0bef('0x57')]['belongsToMany'](db[_0x0bef('0x8e')],{'through':'sms_interaction_has_tags','as':_0x0bef('0x175')});db[_0x0bef('0x57')]['belongsToMany'](db[_0x0bef('0x13')],{'as':_0x0bef('0x176'),'through':_0x0bef('0x132'),'foreignKey':_0x0bef('0x188')});db[_0x0bef('0x59')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'as':_0x0bef('0x13')});db[_0x0bef('0x59')][_0x0bef('0x129')](db['CmContact'],{'onDelete':_0x0bef('0x118'),'as':_0x0bef('0x163')});db[_0x0bef('0x59')][_0x0bef('0x129')](db[_0x0bef('0x57')],{'onDelete':_0x0bef('0x118'),'as':_0x0bef('0x189'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x0bef('0x129')](db[_0x0bef('0x143')],{'as':'Account','foreignKey':_0x0bef('0x187')});db[_0x0bef('0x5b')]['belongsToMany'](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':'UserSmsQueue','foreignKey':_0x0bef('0x18a')});db[_0x0bef('0x5b')][_0x0bef('0x12a')](db[_0x0bef('0xe9')],{'through':_0x0bef('0x18b'),'as':_0x0bef('0x15c')});db[_0x0bef('0x5d')]['hasMany'](db[_0x0bef('0x84')],{'as':'Dispositions','foreignKey':_0x0bef('0x18c'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x5d')][_0x0bef('0x11b')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x0bef('0x18c')});db[_0x0bef('0x5d')][_0x0bef('0x11b')](db[_0x0bef('0x60')],{'as':_0x0bef('0x16c'),'foreignKey':_0x0bef('0x18c')});db[_0x0bef('0x5d')]['hasMany'](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0x0bef('0x18c')});db['OpenchannelAccount'][_0x0bef('0x11b')](db[_0x0bef('0x18d')],{'as':_0x0bef('0x16d'),'foreignKey':_0x0bef('0x18c')});db[_0x0bef('0x5d')]['belongsTo'](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':_0x0bef('0x16e')});db[_0x0bef('0x5d')][_0x0bef('0x129')](db[_0x0bef('0x89')],{'as':_0x0bef('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0bef('0x5d')]['belongsToMany'](db[_0x0bef('0x13')],{'as':'Agents','through':_0x0bef('0x142')});db[_0x0bef('0x18d')]['belongsTo'](db['User'],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x18d')][_0x0bef('0x129')](db[_0x0bef('0x18e')],{'onDelete':_0x0bef('0x166'),'foreignKey':_0x0bef('0x18f')});db[_0x0bef('0x18d')][_0x0bef('0x129')](db['OpenchannelAccount'],{'onDelete':_0x0bef('0x166'),'foreignKey':_0x0bef('0x18c')});db[_0x0bef('0x18d')]['belongsTo'](db[_0x0bef('0x88')],{'onDelete':_0x0bef('0x166'),'foreignKey':_0x0bef('0x158')});db[_0x0bef('0x18d')][_0x0bef('0x129')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x0bef('0x17b')});db['OpenchannelInteraction'][_0x0bef('0x11b')](db[_0x0bef('0x62')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0bef('0x190')});db[_0x0bef('0x60')][_0x0bef('0x129')](db[_0x0bef('0x5d')],{'as':'Account','foreignKey':_0x0bef('0x18c')});db[_0x0bef('0x60')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':'Contact','foreignKey':_0x0bef('0x164')});db['OpenchannelInteraction'][_0x0bef('0x129')](db['User'],{'as':_0x0bef('0x172'),'foreignKey':'UserId'});db['OpenchannelInteraction']['belongsToMany'](db[_0x0bef('0x8e')],{'through':'openchannel_interaction_has_tags','as':_0x0bef('0x174')});db[_0x0bef('0x60')][_0x0bef('0x12a')](db[_0x0bef('0x8e')],{'through':_0x0bef('0x191'),'as':_0x0bef('0x175')});db[_0x0bef('0x60')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x176'),'through':_0x0bef('0x192'),'foreignKey':_0x0bef('0x190')});db[_0x0bef('0x62')][_0x0bef('0x129')](db['User'],{'onDelete':_0x0bef('0x118'),'as':'User'});db[_0x0bef('0x62')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'onDelete':_0x0bef('0x118'),'as':'Contact'});db[_0x0bef('0x62')][_0x0bef('0x129')](db['OpenchannelInteraction'],{'onDelete':_0x0bef('0x118'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x0bef('0x62')][_0x0bef('0x129')](db[_0x0bef('0x178')],{'as':_0x0bef('0x178'),'foreignKey':_0x0bef('0x193')});db[_0x0bef('0x62')][_0x0bef('0x129')](db[_0x0bef('0x5d')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x18c')});db[_0x0bef('0x18e')][_0x0bef('0x12a')](db['User'],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x37'),'foreignKey':_0x0bef('0x18f')});db[_0x0bef('0x18e')][_0x0bef('0x12a')](db[_0x0bef('0xe9')],{'through':'team_has_openchannel_queues','as':_0x0bef('0x15c')});db[_0x0bef('0x64')][_0x0bef('0x11b')](db[_0x0bef('0x84')],{'as':_0x0bef('0x168'),'foreignKey':_0x0bef('0x17a'),'onDelete':'cascade'});db[_0x0bef('0x64')][_0x0bef('0x11b')](db['CannedAnswer'],{'as':_0x0bef('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0x0bef('0x64')][_0x0bef('0x11b')](db[_0x0bef('0x70')],{'as':_0x0bef('0x194')});db[_0x0bef('0x64')][_0x0bef('0x11b')](db[_0x0bef('0x6a')],{'as':_0x0bef('0x16c')});db[_0x0bef('0x64')][_0x0bef('0x11b')](db['ChatApplication'],{'as':_0x0bef('0x16d')});db['ChatWebsite'][_0x0bef('0x11b')](db[_0x0bef('0x195')],{'as':_0x0bef('0x15e')});db[_0x0bef('0x64')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':'ListId'});db[_0x0bef('0x64')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x0bef('0x158')});db['ChatWebsite'][_0x0bef('0x129')](db[_0x0bef('0x3e')],{'as':_0x0bef('0x3e'),'foreignKey':_0x0bef('0x169')});db[_0x0bef('0x64')][_0x0bef('0x129')](db[_0x0bef('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0x0bef('0x170')});db[_0x0bef('0x64')]['belongsToMany'](db['User'],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x13e')});db['OpenchannelQueueReport']['belongsTo'](db[_0x0bef('0x5d')],{});db[_0x0bef('0x66')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':'ListId'});db['OpenchannelQueueReport']['belongsTo'](db[_0x0bef('0x74')],{'as':'Contact','foreignKey':_0x0bef('0x164')});db['OpenchannelQueueReport'][_0x0bef('0x129')](db[_0x0bef('0x60')],{});db[_0x0bef('0x66')][_0x0bef('0x129')](db[_0x0bef('0x62')],{});db['OpenchannelQueueReport'][_0x0bef('0x129')](db['User'],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x0bef('0x18e')],{});db[_0x0bef('0x68')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'as':_0x0bef('0x196'),'foreignKey':_0x0bef('0x119'),'onDelete':_0x0bef('0x166')});db['ChatApplication'][_0x0bef('0x129')](db[_0x0bef('0x136')],{'as':_0x0bef('0x197'),'foreignKey':_0x0bef('0x198'),'onDelete':'restrict'});db['ChatApplication'][_0x0bef('0x129')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x0bef('0x17a'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0x0bef('0x8e')],{'onDelete':_0x0bef('0x166'),'foreignKey':_0x0bef('0x17b')});db['ChatInteraction'][_0x0bef('0x11b')](db[_0x0bef('0x195')],{'as':_0x0bef('0x15e'),'onDelete':'cascade','foreignKey':_0x0bef('0x199')});db[_0x0bef('0x6a')][_0x0bef('0x129')](db[_0x0bef('0x64')],{'as':'Account','foreignKey':_0x0bef('0x17a')});db[_0x0bef('0x6a')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0x6a')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'as':_0x0bef('0x172'),'foreignKey':_0x0bef('0x119')});db['ChatInteraction'][_0x0bef('0x12a')](db[_0x0bef('0x8e')],{'through':_0x0bef('0x19a'),'as':_0x0bef('0x174')});db['ChatInteraction'][_0x0bef('0x12a')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x0bef('0x175')});db[_0x0bef('0x6a')][_0x0bef('0x12a')](db['User'],{'as':_0x0bef('0x176'),'through':_0x0bef('0x131'),'foreignKey':_0x0bef('0x199')});db[_0x0bef('0x195')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'onDelete':_0x0bef('0x118'),'as':'User'});db[_0x0bef('0x195')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0bef('0x164')});db[_0x0bef('0x195')][_0x0bef('0x129')](db[_0x0bef('0x6a')],{'onDelete':_0x0bef('0x118'),'as':_0x0bef('0x189'),'foreignKey':_0x0bef('0x199')});db[_0x0bef('0x195')][_0x0bef('0x129')](db['Attachment'],{'as':_0x0bef('0x178'),'foreignKey':'AttachmentId'});db[_0x0bef('0x195')][_0x0bef('0x129')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x0bef('0x17a')});db[_0x0bef('0x6c')]['hasMany'](db[_0x0bef('0x178')],{'as':_0x0bef('0x179'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x0bef('0x118'),'hooks':!![]});db[_0x0bef('0x6c')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'onDelete':_0x0bef('0x118'),'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db['ChatOfflineMessage'][_0x0bef('0x129')](db[_0x0bef('0x64')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x17a')});db[_0x0bef('0x136')][_0x0bef('0x12a')](db['User'],{'as':_0x0bef('0x15b'),'through':'UserChatQueue','hooks':!![]});db[_0x0bef('0x136')]['belongsToMany'](db[_0x0bef('0xe9')],{'through':_0x0bef('0x19b'),'as':_0x0bef('0x15c')});db[_0x0bef('0x6e')][_0x0bef('0x11b')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0x0bef('0x19c'),'onDelete':'cascade'});db[_0x0bef('0x6e')]['belongsToMany'](db[_0x0bef('0x13')],{'as':_0x0bef('0x14c'),'through':_0x0bef('0x12c')});db[_0x0bef('0x70')][_0x0bef('0x129')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x0bef('0x17a')});db[_0x0bef('0x72')][_0x0bef('0x11b')](db[_0x0bef('0x74')],{'as':_0x0bef('0x12d'),'foreignKey':_0x0bef('0x19d')});db[_0x0bef('0x74')][_0x0bef('0x11b')](db[_0x0bef('0x90')],{'as':_0x0bef('0x19e'),'foreignKey':_0x0bef('0x19f')});db[_0x0bef('0x74')]['hasMany'](db['CmHopper'],{'as':_0x0bef('0x14e'),'foreignKey':_0x0bef('0x164')});db['CmContact'][_0x0bef('0x11b')](db[_0x0bef('0x14f')],{'as':_0x0bef('0x150'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0x74')]['hasMany'](db[_0x0bef('0x7b')],{'as':_0x0bef('0x151'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0x74')][_0x0bef('0x11b')](db[_0x0bef('0x121')],{'as':_0x0bef('0x121'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x0bef('0xdb')],{'as':_0x0bef('0x153'),'foreignKey':_0x0bef('0x164')});db['CmContact'][_0x0bef('0x11b')](db[_0x0bef('0x60')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0bef('0x166')});db[_0x0bef('0x74')]['hasMany'](db[_0x0bef('0x6a')],{'as':_0x0bef('0x123'),'foreignKey':_0x0bef('0x164'),'onDelete':'restrict'});db[_0x0bef('0x74')][_0x0bef('0x11b')](db[_0x0bef('0x57')],{'as':_0x0bef('0x124'),'foreignKey':_0x0bef('0x164'),'onDelete':_0x0bef('0x166')});db[_0x0bef('0x74')][_0x0bef('0x11b')](db[_0x0bef('0x4d')],{'as':_0x0bef('0x125'),'foreignKey':'ContactId','onDelete':_0x0bef('0x166')});db[_0x0bef('0x74')][_0x0bef('0x11b')](db[_0x0bef('0x42')],{'as':_0x0bef('0x126'),'foreignKey':_0x0bef('0x164'),'onDelete':'restrict'});db[_0x0bef('0x74')][_0x0bef('0x129')](db[_0x0bef('0x72')],{'as':_0x0bef('0x1a0'),'foreignKey':_0x0bef('0x19d')});db[_0x0bef('0x74')][_0x0bef('0x129')](db['CmList'],{'as':_0x0bef('0x17d'),'foreignKey':_0x0bef('0x16e'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x74')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':'Users','through':'cm_user_has_contacts'});db[_0x0bef('0x74')][_0x0bef('0x12a')](db['Tag'],{'as':_0x0bef('0x174'),'through':_0x0bef('0x1a1')});db[_0x0bef('0x74')][_0x0bef('0x12a')](db['Tag'],{'through':_0x0bef('0x1a1'),'as':_0x0bef('0x175')});db[_0x0bef('0x76')][_0x0bef('0x11b')](db[_0x0bef('0x92')],{'as':'AdditionalPhones','foreignKey':_0x0bef('0x1a2')});db[_0x0bef('0x76')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':'Contact','foreignKey':_0x0bef('0x164'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x76')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':'List','foreignKey':_0x0bef('0x16e'),'onDelete':_0x0bef('0x118')});db['CmHopper'][_0x0bef('0x129')](db[_0x0bef('0x13')],{'as':'Agent','foreignKey':_0x0bef('0x119')});db['CmHopper']['belongsTo'](db['VoiceQueue'],{'as':_0x0bef('0x197'),'foreignKey':'VoiceQueueId','onDelete':_0x0bef('0x118')});db[_0x0bef('0x76')][_0x0bef('0x129')](db[_0x0bef('0xec')],{'as':_0x0bef('0xec'),'foreignKey':_0x0bef('0x1a3'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x76')]['belongsTo'](db[_0x0bef('0x13')],{'as':_0x0bef('0x172'),'foreignKey':'OwnerId'});db[_0x0bef('0x78')][_0x0bef('0x129')](db['CmContact'],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x78')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':'ListId','onDelete':_0x0bef('0x118')});db[_0x0bef('0x78')][_0x0bef('0x129')](db[_0x0bef('0x1d')],{'as':_0x0bef('0x197'),'foreignKey':_0x0bef('0x14d'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x78')][_0x0bef('0x129')](db[_0x0bef('0xec')],{'as':_0x0bef('0xec'),'foreignKey':_0x0bef('0x1a3'),'onDelete':_0x0bef('0x118')});db['Automation'][_0x0bef('0x11b')](db[_0x0bef('0x86')],{'as':{'plural':_0x0bef('0x1a4'),'singular':_0x0bef('0x1a5')},'foreignKey':_0x0bef('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0x0bef('0x1a7')]['hasMany'](db[_0x0bef('0x86')],{'as':{'plural':_0x0bef('0x1a8'),'singular':_0x0bef('0x1a9')},'foreignKey':_0x0bef('0x1aa'),'onDelete':_0x0bef('0x118'),'hooks':!![]});db['Automation'][_0x0bef('0x11b')](db['Action'],{'as':_0x0bef('0x1ab'),'foreignKey':_0x0bef('0x1ac'),'onDelete':'cascade','hooks':!![]});db[_0x0bef('0x84')][_0x0bef('0x11b')](db['Disposition'],{'as':_0x0bef('0x168'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0x0bef('0x88')][_0x0bef('0x11b')](db[_0x0bef('0x88')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x0bef('0x118'),'hooks':!![],'required':![]});db['Interval'][_0x0bef('0x11b')](db['VoiceExtension'],{'as':_0x0bef('0x11f'),'foreignKey':'IntervalId','onDelete':_0x0bef('0x166')});db[_0x0bef('0x88')]['hasMany'](db[_0x0bef('0x43')],{'as':_0x0bef('0x1ad'),'foreignKey':_0x0bef('0x158')});db[_0x0bef('0x88')][_0x0bef('0x11b')](db['ChatApplication'],{'as':_0x0bef('0x1ae'),'foreignKey':_0x0bef('0x158')});db[_0x0bef('0x88')]['hasMany'](db[_0x0bef('0x4b')],{'as':_0x0bef('0x1af'),'foreignKey':_0x0bef('0x158')});db['Interval']['hasMany'](db['SmsApplication'],{'as':_0x0bef('0x1b0'),'foreignKey':_0x0bef('0x158')});db[_0x0bef('0x8c')][_0x0bef('0x129')](db[_0x0bef('0x3e')],{});db[_0x0bef('0x8c')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x0bef('0x1b1')});db['Schedule'][_0x0bef('0x129')](db[_0x0bef('0x9c')],{'foreignKey':_0x0bef('0x1b2')});db[_0x0bef('0x14a')][_0x0bef('0x12a')](db[_0x0bef('0x1c')],{'as':_0x0bef('0x1b3'),'through':_0x0bef('0x14b'),'onDelete':_0x0bef('0x166')});db[_0x0bef('0x8e')]['belongsToMany'](db[_0x0bef('0x74')],{'through':_0x0bef('0x1a1')});db[_0x0bef('0x8e')][_0x0bef('0x12a')](db[_0x0bef('0x6a')],{'through':'chat_interaction_has_tags'});db[_0x0bef('0x8e')][_0x0bef('0x12a')](db[_0x0bef('0x42')],{'through':_0x0bef('0x173')});db[_0x0bef('0x8e')][_0x0bef('0x12a')](db[_0x0bef('0x57')],{'through':'sms_interaction_has_tags'});db[_0x0bef('0x8e')][_0x0bef('0x12a')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x0bef('0x8e')][_0x0bef('0x12a')](db[_0x0bef('0x60')],{'through':_0x0bef('0x191')});db[_0x0bef('0x8e')][_0x0bef('0x12a')](db[_0x0bef('0x127')],{'through':_0x0bef('0x1b4')});db[_0x0bef('0x90')][_0x0bef('0x129')](db[_0x0bef('0x1b5')],{'as':_0x0bef('0x1b6'),'foreignKey':_0x0bef('0x1b7')});db['CmHopperAdditionalPhone'][_0x0bef('0x129')](db[_0x0bef('0x76')],{'as':_0x0bef('0x1b8'),'foreignKey':_0x0bef('0x1a2')});db[_0x0bef('0x90')]['belongsTo'](db['CmContact'],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x19f')});db[_0x0bef('0x94')]['hasMany'](db['Condition'],{'as':{'plural':_0x0bef('0x1b9'),'singular':'AllCondition'},'foreignKey':_0x0bef('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0x0bef('0x94')][_0x0bef('0x11b')](db[_0x0bef('0x86')],{'as':{'plural':'AnyConditions','singular':_0x0bef('0x1bb')},'foreignKey':_0x0bef('0x1bc'),'onDelete':_0x0bef('0x118'),'hooks':!![]});db['Trigger'][_0x0bef('0x11b')](db[_0x0bef('0x7f')],{'as':_0x0bef('0x1ab'),'foreignKey':_0x0bef('0x1bd'),'onDelete':_0x0bef('0x118'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0x0bef('0xa2')],{'as':_0x0bef('0x1be'),'onDelete':_0x0bef('0x118'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x0bef('0x9e')][_0x0bef('0x11b')](db[_0x0bef('0xa2')],{'as':_0x0bef('0x1be'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1b1')});db[_0x0bef('0xa1')][_0x0bef('0x11b')](db[_0x0bef('0xa2')],{'as':_0x0bef('0x1be'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1bf')});db[_0x0bef('0xa2')][_0x0bef('0x129')](db[_0x0bef('0xa1')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x0bef('0x11b')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xa8')][_0x0bef('0x11b')](db[_0x0bef('0xaa')],{'as':'Subjects','onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c1')});db['SalesforceConfiguration'][_0x0bef('0x11b')](db[_0x0bef('0xaa')],{'as':'Descriptions','onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xa8')][_0x0bef('0x11b')](db['SalesforceField'],{'as':_0x0bef('0x1be'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xa8')][_0x0bef('0x129')](db[_0x0bef('0xa6')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xaa')][_0x0bef('0x11b')](db['SalesforceField'],{'as':_0x0bef('0x1c4'),'foreignKey':'SubjectId'});db[_0x0bef('0xaa')][_0x0bef('0x11b')](db[_0x0bef('0xaa')],{'as':'Description','foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xaa')][_0x0bef('0x11b')](db[_0x0bef('0xaa')],{'as':'Field','foreignKey':'FieldId'});db['SalesforceField']['belongsTo'](db[_0x0bef('0x96')],{'as':_0x0bef('0x96'),'foreignKey':_0x0bef('0x1c5')});db['SugarcrmAccount']['hasMany'](db[_0x0bef('0xae')],{'as':_0x0bef('0x1c6'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c0')});db['SugarcrmConfiguration'][_0x0bef('0x11b')](db[_0x0bef('0x1c7')],{'as':_0x0bef('0x1c8'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xae')][_0x0bef('0x11b')](db[_0x0bef('0x1c7')],{'as':_0x0bef('0x1c9'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xae')][_0x0bef('0x11b')](db[_0x0bef('0x1c7')],{'as':_0x0bef('0x1be'),'onDelete':_0x0bef('0x118'),'foreignKey':'FieldId'});db[_0x0bef('0xae')][_0x0bef('0x129')](db[_0x0bef('0xac')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0x1c7')]['hasMany'](db[_0x0bef('0x1c7')],{'as':_0x0bef('0x1c4'),'foreignKey':_0x0bef('0x1c1')});db['SugarcrmField']['hasMany'](db[_0x0bef('0x1c7')],{'as':'Description','foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0x1c7')][_0x0bef('0x11b')](db[_0x0bef('0x1c7')],{'as':_0x0bef('0x1ca'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0x1c7')][_0x0bef('0x129')](db[_0x0bef('0x96')],{'as':_0x0bef('0x96'),'foreignKey':'VariableId'});db[_0x0bef('0xb0')][_0x0bef('0x11b')](db[_0x0bef('0xb2')],{'as':_0x0bef('0x1c6'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c0')});db['DeskConfiguration'][_0x0bef('0x11b')](db[_0x0bef('0xb4')],{'as':_0x0bef('0x1c8'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xb2')][_0x0bef('0x11b')](db['DeskField'],{'as':_0x0bef('0x1c9'),'onDelete':_0x0bef('0x118'),'foreignKey':'DescriptionId'});db[_0x0bef('0xb2')]['hasMany'](db[_0x0bef('0xb4')],{'as':_0x0bef('0x1be'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xb2')][_0x0bef('0x129')](db['DeskAccount'],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xb2')][_0x0bef('0x12a')](db[_0x0bef('0x8e')],{'through':_0x0bef('0x1cb')});db[_0x0bef('0xb4')][_0x0bef('0x11b')](db['DeskField'],{'as':_0x0bef('0x1c4'),'foreignKey':'SubjectId'});db[_0x0bef('0xb4')][_0x0bef('0x11b')](db[_0x0bef('0xb4')],{'as':_0x0bef('0x1cc'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xb4')][_0x0bef('0x11b')](db[_0x0bef('0xb4')],{'as':_0x0bef('0x1ca'),'foreignKey':'FieldId'});db[_0x0bef('0xb4')][_0x0bef('0x129')](db[_0x0bef('0x96')],{'as':'Variable','foreignKey':_0x0bef('0x1c5')});db[_0x0bef('0xb6')][_0x0bef('0x11b')](db[_0x0bef('0xb8')],{'as':_0x0bef('0x1c6'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xb8')][_0x0bef('0x11b')](db['ZohoField'],{'as':'Subjects','onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xb8')]['hasMany'](db[_0x0bef('0xb9')],{'as':_0x0bef('0x1c9'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xb8')]['hasMany'](db[_0x0bef('0xb9')],{'as':_0x0bef('0x1be'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xb8')][_0x0bef('0x129')](db['ZohoAccount'],{'as':'Account','foreignKey':'AccountId'});db['ZohoField']['hasMany'](db[_0x0bef('0xb9')],{'as':_0x0bef('0x1c4'),'foreignKey':_0x0bef('0x1c1')});db['ZohoField'][_0x0bef('0x11b')](db[_0x0bef('0xb9')],{'as':_0x0bef('0x1cc'),'foreignKey':_0x0bef('0x1c2')});db['ZohoField'][_0x0bef('0x11b')](db['ZohoField'],{'as':_0x0bef('0x1ca'),'foreignKey':_0x0bef('0x1c3')});db['ZohoField'][_0x0bef('0x129')](db[_0x0bef('0x96')],{'as':_0x0bef('0x96'),'foreignKey':_0x0bef('0x1c5')});db[_0x0bef('0xbb')]['hasMany'](db[_0x0bef('0xbd')],{'as':_0x0bef('0x1c6'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xbd')][_0x0bef('0x11b')](db[_0x0bef('0xbe')],{'as':_0x0bef('0x1c8'),'foreignKey':_0x0bef('0x1c1')});db['ZendeskConfiguration'][_0x0bef('0x11b')](db[_0x0bef('0xbe')],{'as':_0x0bef('0x1c9'),'foreignKey':'DescriptionId'});db[_0x0bef('0xbd')][_0x0bef('0x11b')](db['ZendeskField'],{'as':'Fields','foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xbd')][_0x0bef('0x129')](db[_0x0bef('0xbb')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xbd')][_0x0bef('0x12a')](db['Tag'],{'through':_0x0bef('0x1cd')});db[_0x0bef('0xbe')][_0x0bef('0x11b')](db[_0x0bef('0xbe')],{'as':_0x0bef('0x1c4'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xbe')][_0x0bef('0x11b')](db[_0x0bef('0xbe')],{'as':_0x0bef('0x1cc'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xbe')][_0x0bef('0x11b')](db[_0x0bef('0xbe')],{'as':_0x0bef('0x1ca'),'foreignKey':'FieldId'});db[_0x0bef('0xbe')]['belongsTo'](db[_0x0bef('0x96')],{'as':_0x0bef('0x96'),'foreignKey':_0x0bef('0x1c5')});db['FreshdeskAccount'][_0x0bef('0x11b')](db['FreshdeskConfiguration'],{'as':_0x0bef('0x1c6'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xc2')][_0x0bef('0x11b')](db[_0x0bef('0xc4')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0bef('0xc2')]['hasMany'](db[_0x0bef('0xc4')],{'as':_0x0bef('0x1c9'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xc2')][_0x0bef('0x11b')](db[_0x0bef('0xc4')],{'as':'Fields','onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xc2')][_0x0bef('0x129')](db[_0x0bef('0xc0')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1c0')});db['FreshdeskConfiguration'][_0x0bef('0x12a')](db[_0x0bef('0x8e')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x0bef('0xc4')][_0x0bef('0x11b')](db[_0x0bef('0xc4')],{'as':'Subject','foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xc4')][_0x0bef('0x11b')](db[_0x0bef('0xc4')],{'as':_0x0bef('0x1cc'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xc4')][_0x0bef('0x11b')](db['FreshdeskField'],{'as':_0x0bef('0x1ca'),'foreignKey':'FieldId'});db[_0x0bef('0xc4')][_0x0bef('0x129')](db[_0x0bef('0x96')],{'as':'Variable','foreignKey':_0x0bef('0x1c5')});db[_0x0bef('0xc6')][_0x0bef('0x11b')](db['VtigerConfiguration'],{'as':_0x0bef('0x1c6'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c0')});db['VtigerConfiguration'][_0x0bef('0x11b')](db[_0x0bef('0xc8')],{'as':'Subjects','foreignKey':_0x0bef('0x1c1')});db['VtigerConfiguration']['hasMany'](db[_0x0bef('0xc8')],{'as':_0x0bef('0x1c9'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xc7')]['hasMany'](db[_0x0bef('0xc8')],{'as':_0x0bef('0x1be'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xc7')][_0x0bef('0x129')](db[_0x0bef('0xc6')],{'as':_0x0bef('0x185'),'foreignKey':'AccountId'});db[_0x0bef('0xc8')][_0x0bef('0x11b')](db[_0x0bef('0xc8')],{'as':_0x0bef('0x1c4'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xc8')][_0x0bef('0x11b')](db[_0x0bef('0xc8')],{'as':_0x0bef('0x1cc'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x0bef('0x11b')](db[_0x0bef('0xc8')],{'as':_0x0bef('0x1ca'),'foreignKey':_0x0bef('0x1c3')});db['VtigerField'][_0x0bef('0x129')](db[_0x0bef('0x96')],{'as':_0x0bef('0x96'),'foreignKey':_0x0bef('0x1c5')});db[_0x0bef('0xc9')][_0x0bef('0x11b')](db['ServicenowConfiguration'],{'as':_0x0bef('0x1c6'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c0')});db['ServicenowConfiguration'][_0x0bef('0x11b')](db[_0x0bef('0xcc')],{'as':'Subjects','foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xcb')]['hasMany'](db[_0x0bef('0xcc')],{'as':_0x0bef('0x1c9'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0xcb')][_0x0bef('0x11b')](db[_0x0bef('0xcc')],{'as':'Fields','foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x0bef('0x129')](db[_0x0bef('0xc9')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0xcc')][_0x0bef('0x11b')](db[_0x0bef('0xcc')],{'as':_0x0bef('0x1c4'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xcc')][_0x0bef('0x11b')](db[_0x0bef('0xcc')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0bef('0xcc')][_0x0bef('0x11b')](db[_0x0bef('0xcc')],{'as':_0x0bef('0x1ca'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xcc')]['belongsTo'](db[_0x0bef('0x96')],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account'][_0x0bef('0x11b')](db[_0x0bef('0xcf')],{'as':'Configurations','onDelete':_0x0bef('0x118'),'foreignKey':'AccountId'});db[_0x0bef('0x1ce')]['belongsTo'](db['CloudProvider'],{'as':_0x0bef('0x110'),'foreignKey':_0x0bef('0x165')});db[_0x0bef('0xcf')][_0x0bef('0x11b')](db[_0x0bef('0x1cf')],{'as':_0x0bef('0x1c8'),'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0xcf')][_0x0bef('0x11b')](db[_0x0bef('0x1cf')],{'as':_0x0bef('0x1c9'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration']['hasMany'](db[_0x0bef('0x1cf')],{'as':'Fields','onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0xcf')][_0x0bef('0x129')](db[_0x0bef('0x1ce')],{'as':_0x0bef('0x185'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x0bef('0x11b')](db[_0x0bef('0x1cf')],{'as':_0x0bef('0x1c4'),'foreignKey':'SubjectId'});db[_0x0bef('0x1cf')][_0x0bef('0x11b')](db[_0x0bef('0x1cf')],{'as':_0x0bef('0x1cc'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x0bef('0x11b')](db['Dynamics365Field'],{'as':_0x0bef('0x1ca'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0x1cf')][_0x0bef('0x129')](db[_0x0bef('0x96')],{'as':_0x0bef('0x96'),'foreignKey':_0x0bef('0x1c5')});db[_0x0bef('0x1d0')]['hasMany'](db[_0x0bef('0x1d1')],{'as':_0x0bef('0x1c6'),'onDelete':'cascade','foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0x1d1')]['hasMany'](db[_0x0bef('0x1d2')],{'as':'Subjects','foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0x1d1')][_0x0bef('0x11b')](db[_0x0bef('0x1d2')],{'as':_0x0bef('0x1c9'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0x1d1')][_0x0bef('0x11b')](db[_0x0bef('0x1d2')],{'as':_0x0bef('0x1be'),'foreignKey':_0x0bef('0x1c3')});db[_0x0bef('0x1d1')]['belongsTo'](db[_0x0bef('0x1d0')],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1c0')});db[_0x0bef('0x1d2')][_0x0bef('0x11b')](db[_0x0bef('0x1d2')],{'as':_0x0bef('0x1c4'),'foreignKey':_0x0bef('0x1c1')});db[_0x0bef('0x1d2')][_0x0bef('0x11b')](db[_0x0bef('0x1d2')],{'as':_0x0bef('0x1cc'),'foreignKey':_0x0bef('0x1c2')});db[_0x0bef('0x1d2')]['hasMany'](db['FreshsalesField'],{'as':_0x0bef('0x1ca'),'foreignKey':_0x0bef('0x1c3')});db['FreshsalesField'][_0x0bef('0x129')](db[_0x0bef('0x96')],{'as':_0x0bef('0x96'),'foreignKey':_0x0bef('0x1c5')});db[_0x0bef('0x1d3')][_0x0bef('0x129')](db[_0x0bef('0x64')],{});db[_0x0bef('0x1d3')][_0x0bef('0x129')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x17d'),'foreignKey':'ListId'});db[_0x0bef('0x1d3')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db['ChatQueueReport'][_0x0bef('0x129')](db[_0x0bef('0x6a')],{});db['ChatQueueReport'][_0x0bef('0x129')](db[_0x0bef('0x195')],{});db[_0x0bef('0x1d3')][_0x0bef('0x129')](db['User'],{});db['ChatQueueReport'][_0x0bef('0x129')](db['ChatQueue'],{});db[_0x0bef('0x1d4')]['belongsTo'](db['User'],{'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1d5')});db[_0x0bef('0x1d4')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'onDelete':_0x0bef('0x118'),'foreignKey':_0x0bef('0x1d6')});db[_0x0bef('0xdb')][_0x0bef('0x11b')](db[_0x0bef('0xd9')],{'foreignKey':_0x0bef('0x1d7'),'onDelete':_0x0bef('0x118')});db['JscriptySessionReport'][_0x0bef('0x11b')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x0bef('0x118')});db[_0x0bef('0xdd')][_0x0bef('0x129')](db[_0x0bef('0x143')],{});db[_0x0bef('0xdd')][_0x0bef('0x129')](db['CmList'],{'as':_0x0bef('0x17d'),'foreignKey':_0x0bef('0x16e')});db[_0x0bef('0xdd')][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0xdd')]['belongsTo'](db[_0x0bef('0x57')],{});db[_0x0bef('0xdd')]['belongsTo'](db[_0x0bef('0x59')],{});db[_0x0bef('0xdd')][_0x0bef('0x129')](db[_0x0bef('0x13')],{});db[_0x0bef('0xdd')][_0x0bef('0x129')](db[_0x0bef('0x5b')],{});db[_0x0bef('0x1d8')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x0bef('0x1d9')});db['JscriptyProject'][_0x0bef('0x11b')](db['JscriptyQuestionReport'],{'foreignKey':_0x0bef('0x1d9')});db[_0x0bef('0x1d8')][_0x0bef('0x11b')](db[_0x0bef('0xd7')],{'foreignKey':_0x0bef('0x1d9')});db[_0x0bef('0xe5')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x176'),'through':_0x0bef('0x1da')});db[_0x0bef('0xe9')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':'user_has_teams'});db[_0x0bef('0xe9')]['belongsToMany'](db['VoiceQueue'],{'through':_0x0bef('0x111'),'as':_0x0bef('0x1db')});db['Team'][_0x0bef('0x12a')](db[_0x0bef('0x40')],{'through':_0x0bef('0x171'),'as':_0x0bef('0x1dc')});db[_0x0bef('0xe9')][_0x0bef('0x12a')](db[_0x0bef('0x136')],{'through':_0x0bef('0x19b'),'as':'ChatQueues'});db[_0x0bef('0xe9')][_0x0bef('0x12a')](db[_0x0bef('0x50')],{'through':'team_has_fax_queues','as':_0x0bef('0x138')});db['Team'][_0x0bef('0x12a')](db[_0x0bef('0x5b')],{'through':_0x0bef('0x18b'),'as':_0x0bef('0x139')});db[_0x0bef('0xe9')][_0x0bef('0x12a')](db[_0x0bef('0x18e')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x0bef('0xe9')][_0x0bef('0x12a')](db[_0x0bef('0x10e')],{'through':_0x0bef('0x1dd'),'as':'WhatsappQueues'});db['Team'][_0x0bef('0x12a')](db[_0x0bef('0xfc')],{'through':_0x0bef('0x112'),'as':_0x0bef('0x1de')});db[_0x0bef('0xec')][_0x0bef('0x11b')](db['CmHopper'],{'as':_0x0bef('0x14e'),'foreignKey':'CampaignId'});db[_0x0bef('0xec')][_0x0bef('0x11b')](db['CmHopperFinal'],{'as':_0x0bef('0x150'),'foreignKey':_0x0bef('0x1a3')});db[_0x0bef('0xec')]['hasMany'](db['CmHopperHistory'],{'as':_0x0bef('0x151'),'foreignKey':'CampaignId'});db[_0x0bef('0xec')][_0x0bef('0x11b')](db[_0x0bef('0x78')],{'as':'HopperBlacks','foreignKey':_0x0bef('0x1a3')});db[_0x0bef('0xec')]['belongsTo'](db['Trunk'],{'as':_0x0bef('0x154'),'foreignKey':'TrunkId'});db[_0x0bef('0xec')][_0x0bef('0x129')](db['Trunk'],{'as':_0x0bef('0x156'),'foreignKey':_0x0bef('0x157')});db['Campaign'][_0x0bef('0x129')](db['Interval'],{'as':_0x0bef('0x88'),'foreignKey':'IntervalId'});db[_0x0bef('0xec')][_0x0bef('0x129')](db['SquareProject'],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x0bef('0xec')][_0x0bef('0x12a')](db[_0x0bef('0xfa')],{'as':_0x0bef('0x12f'),'through':_0x0bef('0x1df')});db[_0x0bef('0xec')][_0x0bef('0x12a')](db[_0x0bef('0xfa')],{'as':'BlackLists','through':_0x0bef('0x1e0')});db[_0x0bef('0x178')][_0x0bef('0x129')](db[_0x0bef('0x6c')],{'as':_0x0bef('0x6c'),'foreignKey':_0x0bef('0x1e1')});db[_0x0bef('0xf3')][_0x0bef('0x129')](db[_0x0bef('0x16b')],{});db['MailTransferReport'][_0x0bef('0x129')](db[_0x0bef('0x42')],{});db['MailTransferReport'][_0x0bef('0x129')](db['MailAccount'],{'foreignKey':_0x0bef('0x1e2'),'as':_0x0bef('0x1e3')});db[_0x0bef('0xf3')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e4'),'as':'FromAgent'});db[_0x0bef('0xf3')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e5'),'as':_0x0bef('0x1e6')});db[_0x0bef('0xf3')]['belongsTo'](db[_0x0bef('0x40')],{'foreignKey':_0x0bef('0x1e7'),'as':_0x0bef('0x1e8')});db[_0x0bef('0xf3')]['belongsTo'](db[_0x0bef('0x3e')],{'foreignKey':'ToMailAccountId','as':_0x0bef('0x1e9')});db[_0x0bef('0x1ea')][_0x0bef('0x129')](db[_0x0bef('0x195')],{});db[_0x0bef('0x1ea')]['belongsTo'](db[_0x0bef('0x6a')],{});db['ChatTransferReport']['belongsTo'](db[_0x0bef('0x64')],{'foreignKey':_0x0bef('0x1eb'),'as':_0x0bef('0x1e3')});db[_0x0bef('0x1ea')]['belongsTo'](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e4'),'as':_0x0bef('0x1ec')});db[_0x0bef('0x1ea')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e5'),'as':_0x0bef('0x1e6')});db[_0x0bef('0x1ea')][_0x0bef('0x129')](db[_0x0bef('0x136')],{'foreignKey':_0x0bef('0x1ed'),'as':_0x0bef('0x1e8')});db[_0x0bef('0x1ea')]['belongsTo'](db[_0x0bef('0x64')],{'foreignKey':_0x0bef('0x1ee'),'as':_0x0bef('0x1e9')});db['FaxTransferReport']['belongsTo'](db[_0x0bef('0x4f')],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db['FaxTransferReport'][_0x0bef('0x129')](db[_0x0bef('0x49')],{'foreignKey':_0x0bef('0x1ef'),'as':_0x0bef('0x1e3')});db['FaxTransferReport'][_0x0bef('0x129')](db['User'],{'foreignKey':_0x0bef('0x1e4'),'as':_0x0bef('0x1ec')});db[_0x0bef('0xf6')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':'ToUserId','as':_0x0bef('0x1e6')});db['FaxTransferReport'][_0x0bef('0x129')](db['FaxQueue'],{'foreignKey':_0x0bef('0x1f0'),'as':_0x0bef('0x1e8')});db['FaxTransferReport']['belongsTo'](db[_0x0bef('0x49')],{'foreignKey':_0x0bef('0x1f1'),'as':'ToAccount'});db[_0x0bef('0x1f2')]['belongsTo'](db[_0x0bef('0x62')],{});db['OpenchannelTransferReport'][_0x0bef('0x129')](db['OpenchannelInteraction'],{});db[_0x0bef('0x1f2')][_0x0bef('0x129')](db['OpenchannelAccount'],{'foreignKey':_0x0bef('0x1f3'),'as':_0x0bef('0x1e3')});db[_0x0bef('0x1f2')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e4'),'as':_0x0bef('0x1ec')});db[_0x0bef('0x1f2')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0bef('0x1f2')][_0x0bef('0x129')](db[_0x0bef('0x18e')],{'foreignKey':_0x0bef('0x1f4'),'as':_0x0bef('0x1e8')});db[_0x0bef('0x1f2')]['belongsTo'](db[_0x0bef('0x5d')],{'foreignKey':'ToOpenchannelAccountId','as':_0x0bef('0x1e9')});db[_0x0bef('0x1f5')][_0x0bef('0x129')](db[_0x0bef('0x59')],{});db[_0x0bef('0x1f5')][_0x0bef('0x129')](db[_0x0bef('0x57')],{});db['SmsTransferReport'][_0x0bef('0x129')](db[_0x0bef('0x143')],{'foreignKey':_0x0bef('0x1f6'),'as':_0x0bef('0x1e3')});db[_0x0bef('0x1f5')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e4'),'as':'FromAgent'});db[_0x0bef('0x1f5')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e5'),'as':_0x0bef('0x1e6')});db[_0x0bef('0x1f5')]['belongsTo'](db[_0x0bef('0x5b')],{'foreignKey':_0x0bef('0x1f7'),'as':_0x0bef('0x1e8')});db[_0x0bef('0x1f5')][_0x0bef('0x129')](db[_0x0bef('0x143')],{'foreignKey':_0x0bef('0x1f8'),'as':_0x0bef('0x1e9')});db['CmList'][_0x0bef('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x0bef('0x16e'),'onDelete':_0x0bef('0x118')});db['CmList']['hasMany'](db[_0x0bef('0x1f9')],{'as':'CustomFields','foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x0bef('0x74')],{'as':_0x0bef('0x12d'),'onDelete':'cascade','foreignKey':_0x0bef('0x16e')});db[_0x0bef('0xfa')][_0x0bef('0x11b')](db[_0x0bef('0x14f')],{'as':_0x0bef('0x150'),'foreignKey':'ListId'});db[_0x0bef('0xfa')][_0x0bef('0x11b')](db[_0x0bef('0x7b')],{'as':_0x0bef('0x120'),'foreignKey':_0x0bef('0x16e')});db[_0x0bef('0xfa')][_0x0bef('0x11b')](db[_0x0bef('0x121')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x0bef('0xfa')]['belongsToMany'](db[_0x0bef('0x1d')],{'as':_0x0bef('0x1fa'),'through':_0x0bef('0x15a')});db[_0x0bef('0xfa')]['belongsToMany'](db[_0x0bef('0x13')],{'as':'Agents','through':_0x0bef('0x130')});db[_0x0bef('0xfc')]['hasMany'](db[_0x0bef('0x1a')],{'as':_0x0bef('0x11f'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0xfc')]['belongsToMany'](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x114')});db[_0x0bef('0xfc')][_0x0bef('0x12a')](db[_0x0bef('0xe9')],{'through':_0x0bef('0x112'),'as':'Teams'});db[_0x0bef('0xfe')][_0x0bef('0x11b')](db[_0x0bef('0x13')],{'as':_0x0bef('0x176'),'foreignKey':_0x0bef('0x1fb')});db[_0x0bef('0xfe')][_0x0bef('0x11b')](db['UserProfileSection'],{'as':_0x0bef('0x1fc'),'foreignKey':_0x0bef('0x1fb'),'onDelete':_0x0bef('0x118')});db[_0x0bef('0x100')]['hasMany'](db['UserProfileResource'],{'as':_0x0bef('0x1fd'),'foreignKey':_0x0bef('0x1fe'),'onDelete':'cascade'});db[_0x0bef('0x105')]['hasMany'](db['Disposition'],{'as':_0x0bef('0x168'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x0bef('0x105')][_0x0bef('0x11b')](db[_0x0bef('0x82')],{'as':_0x0bef('0x16a'),'foreignKey':_0x0bef('0x1ff')});db[_0x0bef('0x105')][_0x0bef('0x11b')](db['WhatsappMessage'],{'as':_0x0bef('0x15e'),'foreignKey':'WhatsappAccountId'});db[_0x0bef('0x105')][_0x0bef('0x11b')](db[_0x0bef('0x127')],{'as':_0x0bef('0x16c')});db[_0x0bef('0x105')][_0x0bef('0x11b')](db[_0x0bef('0x200')],{'as':_0x0bef('0x16d')});db[_0x0bef('0x105')][_0x0bef('0x129')](db['CmList'],{'as':'List','foreignKey':_0x0bef('0x16e')});db[_0x0bef('0x105')][_0x0bef('0x129')](db[_0x0bef('0x89')],{'as':_0x0bef('0x159'),'foreignKey':_0x0bef('0x170')});db[_0x0bef('0x105')]['belongsToMany'](db[_0x0bef('0x13')],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x146')});db[_0x0bef('0x200')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x200')][_0x0bef('0x129')](db[_0x0bef('0x10e')],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x200')][_0x0bef('0x129')](db['WhatsappAccount'],{'onDelete':_0x0bef('0x166')});db[_0x0bef('0x200')][_0x0bef('0x129')](db['Interval'],{'onDelete':_0x0bef('0x166'),'foreignKey':'IntervalId'});db[_0x0bef('0x200')][_0x0bef('0x129')](db[_0x0bef('0x8e')],{'onDelete':_0x0bef('0x166'),'foreignKey':_0x0bef('0x17b')});db[_0x0bef('0x127')][_0x0bef('0x11b')](db[_0x0bef('0x109')],{'as':_0x0bef('0x15e'),'onDelete':_0x0bef('0x118'),'foreignKey':'WhatsappInteractionId'});db[_0x0bef('0x127')][_0x0bef('0x129')](db['WhatsappAccount'],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1ff')});db['WhatsappInteraction'][_0x0bef('0x129')](db[_0x0bef('0x74')],{'as':'Contact','foreignKey':_0x0bef('0x164')});db['WhatsappInteraction']['belongsTo'](db[_0x0bef('0x13')],{'as':_0x0bef('0x172'),'foreignKey':_0x0bef('0x119')});db[_0x0bef('0x127')][_0x0bef('0x12a')](db['Tag'],{'through':_0x0bef('0x1b4'),'as':'Tags'});db['WhatsappInteraction'][_0x0bef('0x12a')](db[_0x0bef('0x8e')],{'through':_0x0bef('0x1b4'),'as':'ThroughTags'});db[_0x0bef('0x127')][_0x0bef('0x12a')](db[_0x0bef('0x13')],{'as':'Users','through':_0x0bef('0x134'),'foreignKey':_0x0bef('0x201')});db[_0x0bef('0x109')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'as':_0x0bef('0x13')});db[_0x0bef('0x109')]['belongsTo'](db[_0x0bef('0x74')],{'onDelete':'cascade','as':_0x0bef('0x163')});db[_0x0bef('0x109')][_0x0bef('0x129')](db[_0x0bef('0x127')],{'onDelete':_0x0bef('0x118'),'as':_0x0bef('0x189'),'foreignKey':_0x0bef('0x201')});db[_0x0bef('0x109')]['belongsTo'](db['WhatsappAccount'],{'as':_0x0bef('0x185'),'foreignKey':_0x0bef('0x1ff')});db[_0x0bef('0x10b')][_0x0bef('0x129')](db[_0x0bef('0x105')],{});db[_0x0bef('0x10b')][_0x0bef('0x129')](db['CmList'],{'as':_0x0bef('0x17d'),'foreignKey':'ListId'});db[_0x0bef('0x10b')]['belongsTo'](db['CmContact'],{'as':_0x0bef('0x163'),'foreignKey':_0x0bef('0x164')});db[_0x0bef('0x10b')][_0x0bef('0x129')](db[_0x0bef('0x127')],{});db[_0x0bef('0x10b')][_0x0bef('0x129')](db[_0x0bef('0x10e')],{});db[_0x0bef('0x10b')][_0x0bef('0x129')](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0x0bef('0x129')](db[_0x0bef('0x13')],{});db[_0x0bef('0x202')]['belongsTo'](db[_0x0bef('0x109')],{});db[_0x0bef('0x202')][_0x0bef('0x129')](db[_0x0bef('0x127')],{});db[_0x0bef('0x202')][_0x0bef('0x129')](db[_0x0bef('0x105')],{'foreignKey':_0x0bef('0x203'),'as':_0x0bef('0x1e3')});db[_0x0bef('0x202')][_0x0bef('0x129')](db[_0x0bef('0x105')],{'foreignKey':_0x0bef('0x204'),'as':_0x0bef('0x1e9')});db[_0x0bef('0x202')]['belongsTo'](db[_0x0bef('0x10e')],{'foreignKey':_0x0bef('0x205'),'as':'ToQueue'});db[_0x0bef('0x202')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':_0x0bef('0x1e4'),'as':'FromAgent'});db[_0x0bef('0x202')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x0bef('0x10e')][_0x0bef('0x12a')](db['User'],{'as':_0x0bef('0x15b'),'through':_0x0bef('0x13c'),'foreignKey':'WhatsappQueueId'});db[_0x0bef('0x10e')][_0x0bef('0x12a')](db[_0x0bef('0xe9')],{'through':_0x0bef('0x1dd'),'as':_0x0bef('0x15c')});db[_0x0bef('0x115')][_0x0bef('0x129')](db[_0x0bef('0x13')],{'as':'user','foreignKey':_0x0bef('0x119'),'onDelete':_0x0bef('0x118'),'hooks':!![]});db[_0x0bef('0x110')][_0x0bef('0x117')](db[_0x0bef('0x1ce')],{'as':_0x0bef('0x1ce'),'onDelete':'restrict'});db[_0x0bef('0x110')]['hasOne'](db['MailServerIn'],{'as':_0x0bef('0x206'),'onDelete':'restrict'});db['CloudProvider']['hasOne'](db[_0x0bef('0x3c')],{'as':'Smtp','onDelete':_0x0bef('0x166')});module[_0x0bef('0x207')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3bb0c6e..60c61c5 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3488=['./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./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/squareRecording','/api/square/messages','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','static','join','root','/apidoc','/www','/demo','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./errors','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailInteraction','/api/mail/messages','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','/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/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatMessage','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/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'];(function(_0x1a9ef9,_0x12970e){var _0x5d5445=function(_0x2a67ad){while(--_0x2a67ad){_0x1a9ef9['push'](_0x1a9ef9['shift']());}};_0x5d5445(++_0x12970e);}(_0x3488,0x19a));var _0x8348=function(_0x4882cd,_0x191d77){_0x4882cd=_0x4882cd-0x0;var _0x4b6cb0=_0x3488[_0x4882cd];return _0x4b6cb0;};'use strict';var path=require(_0x8348('0x0'));var express=require(_0x8348('0x1'));var errors=require(_0x8348('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x8348('0x3')];var clientSideLogs=require(_0x8348('0x4'));exports[_0x8348('0x5')]=function(_0x501d81){return setupLoggers(_0x501d81)[_0x8348('0x6')](function(){_0x501d81[_0x8348('0x7')](_0x8348('0x8'),require(_0x8348('0x9')));_0x501d81[_0x8348('0x7')](_0x8348('0xa'),require('./api/voiceChanSpy'));_0x501d81[_0x8348('0x7')](_0x8348('0xb'),require('./api/voiceContext'));_0x501d81['use'](_0x8348('0xc'),require(_0x8348('0xd')));_0x501d81[_0x8348('0x7')](_0x8348('0xe'),require(_0x8348('0xf')));_0x501d81[_0x8348('0x7')](_0x8348('0x10'),require(_0x8348('0x11')));_0x501d81[_0x8348('0x7')](_0x8348('0x12'),require(_0x8348('0x13')));_0x501d81['use']('/api/screen/recordings',require(_0x8348('0x14')));_0x501d81[_0x8348('0x7')](_0x8348('0x15'),require('./api/voiceMail'));_0x501d81[_0x8348('0x7')](_0x8348('0x16'),require(_0x8348('0x17')));_0x501d81['use'](_0x8348('0x18'),require(_0x8348('0x19')));_0x501d81[_0x8348('0x7')]('/api/voice/dials/reports',require(_0x8348('0x1a')));_0x501d81['use'](_0x8348('0x1b'),require(_0x8348('0x1c')));_0x501d81[_0x8348('0x7')](_0x8348('0x1d'),require(_0x8348('0x1e')));_0x501d81[_0x8348('0x7')]('/api/members/reports',require(_0x8348('0x1f')));_0x501d81['use'](_0x8348('0x20'),require('./api/trunk'));_0x501d81[_0x8348('0x7')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x501d81[_0x8348('0x7')](_0x8348('0x21'),require(_0x8348('0x22')));_0x501d81['use'](_0x8348('0x23'),require('./api/mailAccount'));_0x501d81[_0x8348('0x7')](_0x8348('0x24'),require(_0x8348('0x25')));_0x501d81[_0x8348('0x7')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x501d81[_0x8348('0x7')]('/api/mail/interactions',require(_0x8348('0x26')));_0x501d81[_0x8348('0x7')](_0x8348('0x27'),require('./api/mailMessage'));_0x501d81[_0x8348('0x7')]('/api/mail/applications',require('./api/mailApplication'));_0x501d81[_0x8348('0x7')](_0x8348('0x28'),require(_0x8348('0x29')));_0x501d81[_0x8348('0x7')](_0x8348('0x2a'),require(_0x8348('0x2b')));_0x501d81['use'](_0x8348('0x2c'),require('./api/dashboardItem'));_0x501d81[_0x8348('0x7')](_0x8348('0x2d'),require('./api/faxAccount'));_0x501d81['use'](_0x8348('0x2e'),require(_0x8348('0x2f')));_0x501d81['use'](_0x8348('0x30'),require(_0x8348('0x31')));_0x501d81['use'](_0x8348('0x32'),require(_0x8348('0x33')));_0x501d81['use'](_0x8348('0x34'),require('./api/faxQueue'));_0x501d81[_0x8348('0x7')](_0x8348('0x35'),require(_0x8348('0x36')));_0x501d81[_0x8348('0x7')]('/api/sms/accounts',require('./api/smsAccount'));_0x501d81['use']('/api/sms/applications',require('./api/smsApplication'));_0x501d81[_0x8348('0x7')](_0x8348('0x37'),require('./api/smsInteraction'));_0x501d81['use']('/api/sms/messages',require(_0x8348('0x38')));_0x501d81[_0x8348('0x7')](_0x8348('0x39'),require(_0x8348('0x3a')));_0x501d81[_0x8348('0x7')](_0x8348('0x3b'),require(_0x8348('0x3c')));_0x501d81[_0x8348('0x7')](_0x8348('0x3d'),require(_0x8348('0x3e')));_0x501d81[_0x8348('0x7')]('/api/openchannel/interactions',require(_0x8348('0x3f')));_0x501d81[_0x8348('0x7')](_0x8348('0x40'),require(_0x8348('0x41')));_0x501d81['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x501d81['use'](_0x8348('0x42'),require(_0x8348('0x43')));_0x501d81[_0x8348('0x7')]('/api/openchannel/reports/queue',require(_0x8348('0x44')));_0x501d81['use'](_0x8348('0x45'),require(_0x8348('0x46')));_0x501d81[_0x8348('0x7')](_0x8348('0x47'),require('./api/chatInteraction'));_0x501d81[_0x8348('0x7')]('/api/chat/messages',require(_0x8348('0x48')));_0x501d81[_0x8348('0x7')]('/api/chat/offline_messages',require(_0x8348('0x49')));_0x501d81[_0x8348('0x7')]('/api/chat/queues',require(_0x8348('0x4a')));_0x501d81['use'](_0x8348('0x4b'),require('./api/chatGroup'));_0x501d81['use'](_0x8348('0x4c'),require(_0x8348('0x4d')));_0x501d81[_0x8348('0x7')]('/api/cm/companies',require(_0x8348('0x4e')));_0x501d81[_0x8348('0x7')](_0x8348('0x4f'),require(_0x8348('0x50')));_0x501d81[_0x8348('0x7')](_0x8348('0x51'),require(_0x8348('0x52')));_0x501d81[_0x8348('0x7')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x501d81[_0x8348('0x7')](_0x8348('0x53'),require('./api/cmHopperFinal'));_0x501d81['use'](_0x8348('0x54'),require(_0x8348('0x55')));_0x501d81[_0x8348('0x7')]('/api/cm/custom_fields',require(_0x8348('0x56')));_0x501d81[_0x8348('0x7')](_0x8348('0x57'),require(_0x8348('0x58')));_0x501d81[_0x8348('0x7')]('/api/automations',require('./api/automation'));_0x501d81[_0x8348('0x7')]('/api/canned_answers',require('./api/cannedAnswer'));_0x501d81[_0x8348('0x7')](_0x8348('0x59'),require(_0x8348('0x5a')));_0x501d81[_0x8348('0x7')](_0x8348('0x5b'),require('./api/condition'));_0x501d81['use'](_0x8348('0x5c'),require('./api/interval'));_0x501d81['use']('/api/pauses',require(_0x8348('0x5d')));_0x501d81[_0x8348('0x7')](_0x8348('0x5e'),require(_0x8348('0x5f')));_0x501d81[_0x8348('0x7')](_0x8348('0x60'),require(_0x8348('0x61')));_0x501d81['use'](_0x8348('0x62'),require(_0x8348('0x63')));_0x501d81['use'](_0x8348('0x64'),require('./api/sound'));_0x501d81[_0x8348('0x7')](_0x8348('0x65'),require(_0x8348('0x66')));_0x501d81['use'](_0x8348('0x67'),require(_0x8348('0x68')));_0x501d81[_0x8348('0x7')](_0x8348('0x69'),require(_0x8348('0x6a')));_0x501d81[_0x8348('0x7')](_0x8348('0x6b'),require(_0x8348('0x6c')));_0x501d81[_0x8348('0x7')]('/api/templates',require(_0x8348('0x6d')));_0x501d81[_0x8348('0x7')](_0x8348('0x6e'),require(_0x8348('0x6f')));_0x501d81['use'](_0x8348('0x70'),require(_0x8348('0x71')));_0x501d81[_0x8348('0x7')]('/api/integrations',require(_0x8348('0x72')));_0x501d81[_0x8348('0x7')](_0x8348('0x73'),require('./api/integrationReport'));_0x501d81['use'](_0x8348('0x74'),require(_0x8348('0x75')));_0x501d81[_0x8348('0x7')](_0x8348('0x76'),require('./api/analyticDefaultReport'));_0x501d81[_0x8348('0x7')](_0x8348('0x77'),require(_0x8348('0x78')));_0x501d81[_0x8348('0x7')](_0x8348('0x79'),require(_0x8348('0x7a')));_0x501d81['use'](_0x8348('0x7b'),require(_0x8348('0x7c')));_0x501d81[_0x8348('0x7')](_0x8348('0x7d'),require(_0x8348('0x7e')));_0x501d81[_0x8348('0x7')](_0x8348('0x7f'),require(_0x8348('0x80')));_0x501d81[_0x8348('0x7')](_0x8348('0x81'),require(_0x8348('0x82')));_0x501d81[_0x8348('0x7')](_0x8348('0x83'),require(_0x8348('0x84')));_0x501d81[_0x8348('0x7')](_0x8348('0x85'),require(_0x8348('0x86')));_0x501d81[_0x8348('0x7')](_0x8348('0x87'),require('./api/intSugarcrmConfiguration'));_0x501d81[_0x8348('0x7')](_0x8348('0x88'),require(_0x8348('0x89')));_0x501d81['use']('/api/integrations/desk/accounts',require(_0x8348('0x8a')));_0x501d81['use'](_0x8348('0x8b'),require('./api/intDeskConfiguration'));_0x501d81[_0x8348('0x7')](_0x8348('0x8c'),require(_0x8348('0x8d')));_0x501d81[_0x8348('0x7')](_0x8348('0x8e'),require(_0x8348('0x8f')));_0x501d81[_0x8348('0x7')](_0x8348('0x90'),require(_0x8348('0x91')));_0x501d81[_0x8348('0x7')]('/api/integrations/zoho/fields',require(_0x8348('0x92')));_0x501d81[_0x8348('0x7')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x501d81[_0x8348('0x7')](_0x8348('0x93'),require(_0x8348('0x94')));_0x501d81[_0x8348('0x7')](_0x8348('0x95'),require('./api/intZendeskField'));_0x501d81[_0x8348('0x7')](_0x8348('0x96'),require(_0x8348('0x97')));_0x501d81['use'](_0x8348('0x98'),require(_0x8348('0x99')));_0x501d81['use'](_0x8348('0x9a'),require('./api/intFreshdeskField'));_0x501d81['use'](_0x8348('0x9b'),require(_0x8348('0x9c')));_0x501d81['use'](_0x8348('0x9d'),require('./api/intVtigerConfiguration'));_0x501d81[_0x8348('0x7')](_0x8348('0x9e'),require(_0x8348('0x9f')));_0x501d81['use']('/api/integrations/servicenow/accounts',require(_0x8348('0xa0')));_0x501d81['use'](_0x8348('0xa1'),require(_0x8348('0xa2')));_0x501d81[_0x8348('0x7')](_0x8348('0xa3'),require(_0x8348('0xa4')));_0x501d81[_0x8348('0x7')](_0x8348('0xa5'),require(_0x8348('0xa6')));_0x501d81[_0x8348('0x7')](_0x8348('0xa7'),require(_0x8348('0xa8')));_0x501d81[_0x8348('0x7')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x501d81[_0x8348('0x7')](_0x8348('0xa9'),require(_0x8348('0xaa')));_0x501d81['use'](_0x8348('0xab'),require(_0x8348('0xac')));_0x501d81[_0x8348('0x7')](_0x8348('0xad'),require(_0x8348('0xae')));_0x501d81['use']('/api/networks',require(_0x8348('0xaf')));_0x501d81['use']('/api/chat/reports/queue',require(_0x8348('0xb0')));_0x501d81[_0x8348('0x7')](_0x8348('0xb1'),require(_0x8348('0xb2')));_0x501d81[_0x8348('0x7')]('/api/jscripty/answers/reports',require(_0x8348('0xb3')));_0x501d81['use'](_0x8348('0xb4'),require('./api/jscriptyQuestionReport'));_0x501d81[_0x8348('0x7')](_0x8348('0xb5'),require(_0x8348('0xb6')));_0x501d81[_0x8348('0x7')](_0x8348('0xb7'),require(_0x8348('0xb8')));_0x501d81[_0x8348('0x7')](_0x8348('0xb9'),require(_0x8348('0xba')));_0x501d81[_0x8348('0x7')](_0x8348('0xbb'),require(_0x8348('0xbc')));_0x501d81[_0x8348('0x7')](_0x8348('0xbd'),require('./api/jscriptyProject'));_0x501d81[_0x8348('0x7')](_0x8348('0xbe'),require(_0x8348('0xbf')));_0x501d81[_0x8348('0x7')](_0x8348('0xc0'),require(_0x8348('0xc1')));_0x501d81[_0x8348('0x7')](_0x8348('0xc2'),require(_0x8348('0xc3')));_0x501d81[_0x8348('0x7')]('/api/square/recordings',require(_0x8348('0xc4')));_0x501d81['use'](_0x8348('0xc5'),require('./api/squareMessage'));_0x501d81['use']('/api/teams',require(_0x8348('0xc6')));_0x501d81[_0x8348('0x7')](_0x8348('0xc7'),require(_0x8348('0xc8')));_0x501d81[_0x8348('0x7')](_0x8348('0xc9'),require(_0x8348('0xca')));_0x501d81[_0x8348('0x7')](_0x8348('0xcb'),require(_0x8348('0xcc')));_0x501d81['use'](_0x8348('0xcd'),require(_0x8348('0xce')));_0x501d81[_0x8348('0x7')](_0x8348('0xcf'),require(_0x8348('0xd0')));_0x501d81['use']('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x501d81[_0x8348('0x7')](_0x8348('0xd1'),require(_0x8348('0xd2')));_0x501d81[_0x8348('0x7')](_0x8348('0xd3'),require(_0x8348('0xd4')));_0x501d81[_0x8348('0x7')](_0x8348('0xd5'),require('./api/openchannelTransferReport'));_0x501d81['use'](_0x8348('0xd6'),require(_0x8348('0xd7')));_0x501d81[_0x8348('0x7')]('/api/cm/lists',require(_0x8348('0xd8')));_0x501d81[_0x8348('0x7')]('/api/voice/prefixes',require(_0x8348('0xd9')));_0x501d81[_0x8348('0x7')](_0x8348('0xda'),require(_0x8348('0xdb')));_0x501d81['use'](_0x8348('0xdc'),require(_0x8348('0xdd')));_0x501d81[_0x8348('0x7')](_0x8348('0xde'),require(_0x8348('0xdf')));_0x501d81[_0x8348('0x7')](_0x8348('0xe0'),require('./api/userNotification'));_0x501d81['use'](_0x8348('0xe1'),require(_0x8348('0xe2')));_0x501d81[_0x8348('0x7')]('/api/whatsapp/applications',require(_0x8348('0xe3')));_0x501d81[_0x8348('0x7')](_0x8348('0xe4'),require(_0x8348('0xe5')));_0x501d81[_0x8348('0x7')](_0x8348('0xe6'),require(_0x8348('0xe7')));_0x501d81[_0x8348('0x7')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x501d81[_0x8348('0x7')](_0x8348('0xe8'),require(_0x8348('0xe9')));_0x501d81[_0x8348('0x7')]('/api/whatsapp/queues',require(_0x8348('0xea')));_0x501d81[_0x8348('0x7')](_0x8348('0xeb'),require(_0x8348('0xec')));_0x501d81[_0x8348('0x7')](_0x8348('0xed'),require(_0x8348('0xee')));_0x501d81[_0x8348('0x7')](_0x8348('0xef'),require('./api/user-setting'));_0x501d81['use'](_0x8348('0xf0'),require(_0x8348('0xf1')));_0x501d81[_0x8348('0x7')](_0x8348('0xf2'),require(_0x8348('0xf3')));_0x501d81[_0x8348('0x7')](_0x8348('0xf4'),require(_0x8348('0xf5')));_0x501d81['use'](_0x8348('0xf6'),require(_0x8348('0xf7')));_0x501d81['use'](_0x8348('0xf8'),require('./api/rpc'));_0x501d81['use'](_0x8348('0xf9'),require(_0x8348('0xfa')));_0x501d81['use'](_0x8348('0xfb'),require(_0x8348('0xfc')));_0x501d81['use'](_0x8348('0xfd'),require(_0x8348('0xfe')));_0x501d81['use']('/api/webbar',require(_0x8348('0xff')));_0x501d81['use'](_0x8348('0x100'),clientSideLogs);_0x501d81[_0x8348('0x7')]('/apidoc',express[_0x8348('0x101')](path[_0x8348('0x102')](config[_0x8348('0x103')],_0x8348('0x104'))));_0x501d81[_0x8348('0x7')]('/www',express[_0x8348('0x101')](path[_0x8348('0x102')](config[_0x8348('0x103')],_0x8348('0x105'))));_0x501d81[_0x8348('0x7')](_0x8348('0x106'),express[_0x8348('0x101')](path[_0x8348('0x102')](config[_0x8348('0x103')],'/demo')));_0x501d81[_0x8348('0x7')]('/snippet',express[_0x8348('0x101')](path[_0x8348('0x102')](config[_0x8348('0x103')],_0x8348('0x107'),_0x8348('0x108'))));_0x501d81[_0x8348('0x7')]('/plugins',express[_0x8348('0x101')](path['join'](config['root'],_0x8348('0x109'))));_0x501d81[_0x8348('0x10a')](_0x8348('0x10b'))[_0x8348('0x10c')](errors[0x194]);_0x501d81[_0x8348('0x10a')]('/*')[_0x8348('0x10c')](function(_0x4a6d2c,_0x293a2e){_0x293a2e[_0x8348('0x10d')](path[_0x8348('0x10e')](_0x501d81['get']('appPath')+_0x8348('0x10f')));});return _0x501d81;});}; \ No newline at end of file +var _0xd626=['/api/templates','/api/triggers','./api/trigger','/api/integrations','./api/integration','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/campaign','./api/migration','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/realtime','/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/logs','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','then','/api/users','/api/voice/chanspy','./api/voiceChanSpy','use','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/actions','./api/action','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone'];(function(_0x90e3d5,_0x3eea2b){var _0x5c2252=function(_0x3c7a2e){while(--_0x3c7a2e){_0x90e3d5['push'](_0x90e3d5['shift']());}};_0x5c2252(++_0x3eea2b);}(_0xd626,0x19e));var _0x6d62=function(_0x3c33a8,_0x1a9fda){_0x3c33a8=_0x3c33a8-0x0;var _0x4b04f1=_0xd626[_0x3c33a8];return _0x4b04f1;};'use strict';var path=require(_0x6d62('0x0'));var express=require(_0x6d62('0x1'));var errors=require(_0x6d62('0x2'));var config=require(_0x6d62('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x6d62('0x4')];var clientSideLogs=require(_0x6d62('0x5'));exports['default']=function(_0xf97416){return setupLoggers(_0xf97416)[_0x6d62('0x6')](function(){_0xf97416['use'](_0x6d62('0x7'),require('./api/user'));_0xf97416['use'](_0x6d62('0x8'),require(_0x6d62('0x9')));_0xf97416[_0x6d62('0xa')]('/api/voice/contexts',require('./api/voiceContext'));_0xf97416[_0x6d62('0xa')]('/api/voice/extensions',require(_0x6d62('0xb')));_0xf97416['use'](_0x6d62('0xc'),require(_0x6d62('0xd')));_0xf97416[_0x6d62('0xa')]('/api/voice/queues',require(_0x6d62('0xe')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xf'),require(_0x6d62('0x10')));_0xf97416[_0x6d62('0xa')]('/api/screen/recordings',require(_0x6d62('0x11')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x12'),require(_0x6d62('0x13')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x14'),require('./api/voiceMailMessage'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x15'),require(_0x6d62('0x16')));_0xf97416[_0x6d62('0xa')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x17'),require(_0x6d62('0x18')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x19'),require('./api/voiceQueueReport'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x1a'),require(_0x6d62('0x1b')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x1c'),require(_0x6d62('0x1d')));_0xf97416[_0x6d62('0xa')]('/api/voice/transfers/reports',require(_0x6d62('0x1e')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x1f'),require('./api/mailServerOut'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x20'),require(_0x6d62('0x21')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x22'),require(_0x6d62('0x23')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x24'),require('./api/mailSubstatus'));_0xf97416[_0x6d62('0xa')]('/api/mail/interactions',require(_0x6d62('0x25')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x26'),require(_0x6d62('0x27')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x28'),require(_0x6d62('0x29')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x2a'),require(_0x6d62('0x2b')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x2c'),require(_0x6d62('0x2d')));_0xf97416[_0x6d62('0xa')]('/api/dashboards/items',require(_0x6d62('0x2e')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x2f'),require('./api/faxAccount'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x30'),require('./api/faxApplication'));_0xf97416['use'](_0x6d62('0x31'),require(_0x6d62('0x32')));_0xf97416['use'](_0x6d62('0x33'),require('./api/faxMessage'));_0xf97416['use']('/api/fax/queues',require(_0x6d62('0x34')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x35'),require(_0x6d62('0x36')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x37'),require(_0x6d62('0x38')));_0xf97416[_0x6d62('0xa')]('/api/sms/applications',require(_0x6d62('0x39')));_0xf97416['use'](_0x6d62('0x3a'),require(_0x6d62('0x3b')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x3c'),require(_0x6d62('0x3d')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x3e'),require(_0x6d62('0x3f')));_0xf97416[_0x6d62('0xa')]('/api/openchannel/accounts',require(_0x6d62('0x40')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x41'),require(_0x6d62('0x42')));_0xf97416[_0x6d62('0xa')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x43'),require('./api/openchannelMessage'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x44'),require(_0x6d62('0x45')));_0xf97416['use'](_0x6d62('0x46'),require(_0x6d62('0x47')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x48'),require(_0x6d62('0x49')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x4a'),require(_0x6d62('0x4b')));_0xf97416[_0x6d62('0xa')]('/api/chat/interactions',require(_0x6d62('0x4c')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x4d'),require(_0x6d62('0x4e')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x4f'),require(_0x6d62('0x50')));_0xf97416[_0x6d62('0xa')]('/api/chat/queues',require(_0x6d62('0x51')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x52'),require(_0x6d62('0x53')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x54'),require('./api/chatProactiveAction'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x55'),require(_0x6d62('0x56')));_0xf97416['use']('/api/cm/contacts',require(_0x6d62('0x57')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x58'),require('./api/cmHopper'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x59'),require(_0x6d62('0x5a')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x5b'),require(_0x6d62('0x5c')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x5d'),require(_0x6d62('0x5e')));_0xf97416['use']('/api/cm/custom_fields',require('./api/cmCustomField'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x5f'),require(_0x6d62('0x60')));_0xf97416[_0x6d62('0xa')]('/api/automations',require(_0x6d62('0x61')));_0xf97416['use']('/api/canned_answers',require(_0x6d62('0x62')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x63'),require('./api/disposition'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x64'),require(_0x6d62('0x65')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x66'),require(_0x6d62('0x67')));_0xf97416[_0x6d62('0xa')]('/api/pauses',require(_0x6d62('0x68')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x69'),require(_0x6d62('0x6a')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x6b'),require(_0x6d62('0x6c')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x6d'),require('./api/schedule'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x6e'),require(_0x6d62('0x6f')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x70'),require(_0x6d62('0x71')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x72'),require(_0x6d62('0x73')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x74'),require(_0x6d62('0x75')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x76'),require(_0x6d62('0x77')));_0xf97416['use'](_0x6d62('0x78'),require('./api/template'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x79'),require(_0x6d62('0x7a')));_0xf97416[_0x6d62('0xa')]('/api/variables',require('./api/variable'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x7b'),require(_0x6d62('0x7c')));_0xf97416[_0x6d62('0xa')]('/api/integrations/reports',require(_0x6d62('0x7d')));_0xf97416[_0x6d62('0xa')]('/api/analytics/custom_reports',require(_0x6d62('0x7e')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x7f'),require(_0x6d62('0x80')));_0xf97416['use']('/api/analytics/extracted_reports',require(_0x6d62('0x81')));_0xf97416['use'](_0x6d62('0x82'),require(_0x6d62('0x83')));_0xf97416[_0x6d62('0xa')]('/api/analytics/field_reports',require(_0x6d62('0x84')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x85'),require(_0x6d62('0x86')));_0xf97416['use'](_0x6d62('0x87'),require(_0x6d62('0x88')));_0xf97416['use'](_0x6d62('0x89'),require(_0x6d62('0x8a')));_0xf97416['use'](_0x6d62('0x8b'),require('./api/intSalesforceField'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x8c'),require(_0x6d62('0x8d')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x8e'),require(_0x6d62('0x8f')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x90'),require('./api/intSugarcrmField'));_0xf97416[_0x6d62('0xa')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0xf97416['use'](_0x6d62('0x91'),require(_0x6d62('0x92')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x93'),require(_0x6d62('0x94')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x95'),require(_0x6d62('0x96')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x97'),require(_0x6d62('0x98')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x99'),require('./api/intZohoField'));_0xf97416['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0xf97416[_0x6d62('0xa')](_0x6d62('0x9a'),require(_0x6d62('0x9b')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x9c'),require(_0x6d62('0x9d')));_0xf97416[_0x6d62('0xa')](_0x6d62('0x9e'),require('./api/intFreshdeskAccount'));_0xf97416['use'](_0x6d62('0x9f'),require('./api/intFreshdeskConfiguration'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xa0'),require(_0x6d62('0xa1')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xa2'),require(_0x6d62('0xa3')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xa4'),require(_0x6d62('0xa5')));_0xf97416['use'](_0x6d62('0xa6'),require('./api/intVtigerField'));_0xf97416['use'](_0x6d62('0xa7'),require(_0x6d62('0xa8')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xa9'),require(_0x6d62('0xaa')));_0xf97416[_0x6d62('0xa')]('/api/integrations/servicenow/fields',require(_0x6d62('0xab')));_0xf97416['use'](_0x6d62('0xac'),require(_0x6d62('0xad')));_0xf97416['use'](_0x6d62('0xae'),require(_0x6d62('0xaf')));_0xf97416['use'](_0x6d62('0xb0'),require('./api/intDynamics365Field'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xb1'),require(_0x6d62('0xb2')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xb3'),require(_0x6d62('0xb4')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xb5'),require(_0x6d62('0xb6')));_0xf97416['use']('/api/networks',require(_0x6d62('0xb7')));_0xf97416['use']('/api/chat/reports/queue',require('./api/chatQueueReport'));_0xf97416['use'](_0x6d62('0xb8'),require(_0x6d62('0xb9')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xba'),require(_0x6d62('0xbb')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xbc'),require(_0x6d62('0xbd')));_0xf97416[_0x6d62('0xa')]('/api/jscripty/sessions/reports',require(_0x6d62('0xbe')));_0xf97416['use'](_0x6d62('0xbf'),require(_0x6d62('0xc0')));_0xf97416['use']('/api/square/reports',require('./api/squareReport'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xc1'),require(_0x6d62('0xc2')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xc3'),require('./api/jscriptyProject'));_0xf97416[_0x6d62('0xa')]('/api/settings',require(_0x6d62('0xc4')));_0xf97416[_0x6d62('0xa')]('/api/square/odbc',require(_0x6d62('0xc5')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xc6'),require('./api/squareProject'));_0xf97416['use'](_0x6d62('0xc7'),require(_0x6d62('0xc8')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xc9'),require(_0x6d62('0xca')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xcb'),require('./api/team'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xcc'),require('./api/license'));_0xf97416['use']('/api/campaigns',require(_0x6d62('0xcd')));_0xf97416['use']('/api/migrations',require(_0x6d62('0xce')));_0xf97416[_0x6d62('0xa')]('/api/attachments',require('./api/attachment'));_0xf97416[_0x6d62('0xa')]('/api/plugins',require(_0x6d62('0xcf')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xd0'),require('./api/mailTransferReport'));_0xf97416[_0x6d62('0xa')]('/api/chat/reports/transfer',require(_0x6d62('0xd1')));_0xf97416[_0x6d62('0xa')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xd2'),require(_0x6d62('0xd3')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xd4'),require(_0x6d62('0xd5')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xd6'),require('./api/cmList'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xd7'),require(_0x6d62('0xd8')));_0xf97416['use'](_0x6d62('0xd9'),require('./api/userProfile'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xda'),require(_0x6d62('0xdb')));_0xf97416['use']('/api/userProfile/resources',require(_0x6d62('0xdc')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xdd'),require(_0x6d62('0xde')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xdf'),require(_0x6d62('0xe0')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xe1'),require('./api/whatsappApplication'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xe2'),require(_0x6d62('0xe3')));_0xf97416[_0x6d62('0xa')]('/api/whatsapp/messages',require(_0x6d62('0xe4')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xe5'),require(_0x6d62('0xe6')));_0xf97416['use'](_0x6d62('0xe7'),require(_0x6d62('0xe8')));_0xf97416[_0x6d62('0xa')]('/api/whatsapp/queues',require(_0x6d62('0xe9')));_0xf97416[_0x6d62('0xa')]('/api/cloudProviders',require('./api/cloudProvider'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xea'),require('./api/realtime'));_0xf97416[_0x6d62('0xa')]('/api/user-settings',require('./api/user-setting'));_0xf97416[_0x6d62('0xa')](_0x6d62('0xeb'),require(_0x6d62('0xec')));_0xf97416['use'](_0x6d62('0xed'),require(_0x6d62('0xee')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xef'),require(_0x6d62('0xf0')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xf1'),require(_0x6d62('0xf2')));_0xf97416['use'](_0x6d62('0xf3'),require(_0x6d62('0xf4')));_0xf97416[_0x6d62('0xa')]('/api/version',require(_0x6d62('0xf5')));_0xf97416[_0x6d62('0xa')]('/api/system',require(_0x6d62('0xf6')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xf7'),require(_0x6d62('0xf8')));_0xf97416[_0x6d62('0xa')]('/api/webbar',require(_0x6d62('0xf9')));_0xf97416[_0x6d62('0xa')](_0x6d62('0xfa'),clientSideLogs);_0xf97416[_0x6d62('0xa')](_0x6d62('0xfb'),express[_0x6d62('0xfc')](path[_0x6d62('0xfd')](config['root'],_0x6d62('0xfb'))));_0xf97416[_0x6d62('0xa')]('/www',express[_0x6d62('0xfc')](path[_0x6d62('0xfd')](config[_0x6d62('0xfe')],'/www')));_0xf97416['use']('/demo',express[_0x6d62('0xfc')](path[_0x6d62('0xfd')](config['root'],_0x6d62('0xff'))));_0xf97416[_0x6d62('0xa')](_0x6d62('0x100'),express[_0x6d62('0xfc')](path[_0x6d62('0xfd')](config[_0x6d62('0xfe')],_0x6d62('0x101'),_0x6d62('0x102'))));_0xf97416[_0x6d62('0xa')](_0x6d62('0x103'),express[_0x6d62('0xfc')](path[_0x6d62('0xfd')](config[_0x6d62('0xfe')],_0x6d62('0x104'))));_0xf97416[_0x6d62('0x105')](_0x6d62('0x106'))[_0x6d62('0x107')](errors[0x194]);_0xf97416[_0x6d62('0x105')]('/*')['get'](function(_0x4120f7,_0x993c4a){_0x993c4a[_0x6d62('0x108')](path['resolve'](_0xf97416[_0x6d62('0x107')](_0x6d62('0x109'))+_0x6d62('0x10a')));});return _0xf97416;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0043f85..7aeae0c 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e13=['../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.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/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.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','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','lodash','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.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/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x6a4fe7,_0x40a337){var _0x5e467d=function(_0x24eb0b){while(--_0x24eb0b){_0x6a4fe7['push'](_0x6a4fe7['shift']());}};_0x5e467d(++_0x40a337);}(_0x4e13,0xb1));var _0x34e1=function(_0x5c883f,_0x38f092){_0x5c883f=_0x5c883f-0x0;var _0x4210cc=_0x4e13[_0x5c883f];return _0x4210cc;};'use strict';var jayson=require(_0x34e1('0x0'));var _=require(_0x34e1('0x1'));var config=require('../config/environment');exports[_0x34e1('0x2')]=function(){return new Promise(function(_0x267252,_0x29ee31){var _0x25ebe9={};_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x3')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x5')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x6')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x7')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x8')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x9')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0xa')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0xb')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0xc')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0xd')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/mailQueue/mailQueue.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/mailInteraction/mailInteraction.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0xe')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0xf')));_0x25ebe9=_['merge'](_0x25ebe9,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x10')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/faxApplication/faxApplication.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x11')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x12')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x13')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x14')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x15')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x16')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/smsMessage/smsMessage.rpc'));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x17')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x18')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x19')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x1a')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x1b')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x1c')));_0x25ebe9=_['merge'](_0x25ebe9,require('../api/chatInteraction/chatInteraction.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/chatMessage/chatMessage.rpc'));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x1d')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x1e')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x1f')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x20')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x21')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x22')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x23')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x24')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x25')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x26')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x27')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x28')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x29')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x2a')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x2b')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x2c')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x2d')));_0x25ebe9=_['merge'](_0x25ebe9,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x25ebe9=_['merge'](_0x25ebe9,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x2e')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x2f')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x30')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/squareReport/squareReport.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x31')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x32')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x33')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x34')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x35')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x36')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/campaign/campaign.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require('../api/attachment/attachment.rpc'));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x37')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x38')));_0x25ebe9=_['merge'](_0x25ebe9,require(_0x34e1('0x39')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x3a')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x3b')));_0x25ebe9=_[_0x34e1('0x4')](_0x25ebe9,require(_0x34e1('0x3c')));var _0x59aefe=jayson[_0x34e1('0x3d')](_0x25ebe9)[_0x34e1('0x3e')]();var _0x4b211b=config[_0x34e1('0x3f')][_0x34e1('0x40')]||config[_0x34e1('0x40')]+0x1;var _0x5c287e=config[_0x34e1('0x3f')]['ip']||'localhost';_0x59aefe['on'](_0x34e1('0x41'),function(_0x699b23){return _0x29ee31(_0x699b23);});_0x59aefe['listen'](_0x4b211b,_0x5c287e,function(){console[_0x34e1('0x42')](_0x34e1('0x43'),_0x5c287e,_0x4b211b);require('../config/triggers')[_0x34e1('0x44')]();return _0x267252('RPC\x20listening\x20on\x20'+_0x5c287e+':'+_0x4b211b);});});}; \ No newline at end of file +var _0x87d3=['merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x87d3,0x86));var _0x387d=function(_0xa3da82,_0x3be0c4){_0xa3da82=_0xa3da82-0x0;var _0x55a74=_0x87d3[_0xa3da82];return _0x55a74;};'use strict';var jayson=require(_0x387d('0x0'));var _=require(_0x387d('0x1'));var config=require(_0x387d('0x2'));exports[_0x387d('0x3')]=function(){return new Promise(function(_0x928149,_0x2bb005){var _0x4c308f={};_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/user/user.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x5')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/voiceQueue/voiceQueue.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x6')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x7')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x8')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x9')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0xa')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/memberReport/memberReport.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0xb')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0xc')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0xd')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0xe')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0xf')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x10')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x11')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/mailMessage/mailMessage.rpc'));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x12')));_0x4c308f=_['merge'](_0x4c308f,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x13')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x14')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x15')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x16')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/faxQueue/faxQueue.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x17')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/smsAccount/smsAccount.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/smsInteraction/smsInteraction.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/smsMessage/smsMessage.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x18')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x19')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x1a')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x1b')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x1c')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x1d')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x1e')));_0x4c308f=_['merge'](_0x4c308f,require('../api/chatQueue/chatQueue.rpc'));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x1f')));_0x4c308f=_['merge'](_0x4c308f,require('../api/cmHopper/cmHopper.rpc'));_0x4c308f=_['merge'](_0x4c308f,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x20')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x21')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x22')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x23')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x24')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x25')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x26')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x27')));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x28')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x29')));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x2a')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x2b')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x2c')));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x2d')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x2e')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x2f')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x30')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x31')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x32')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x33')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/squareReport/squareReport.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x34')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x35')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x36')));_0x4c308f=_['merge'](_0x4c308f,require('../api/squareProject/squareProject.rpc'));_0x4c308f=_['merge'](_0x4c308f,require('../api/squareRecording/squareRecording.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x37')));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x38')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/attachment/attachment.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x39')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x3a')));_0x4c308f=_[_0x387d('0x4')](_0x4c308f,require(_0x387d('0x3b')));_0x4c308f=_['merge'](_0x4c308f,require(_0x387d('0x3c')));var _0x299f02=jayson['server'](_0x4c308f)[_0x387d('0x3d')]();var _0x4af689=config[_0x387d('0x3e')][_0x387d('0x3f')]||config[_0x387d('0x3f')]+0x1;var _0x483d05=config[_0x387d('0x3e')]['ip']||_0x387d('0x40');_0x299f02['on'](_0x387d('0x41'),function(_0x5d6171){return _0x2bb005(_0x5d6171);});_0x299f02[_0x387d('0x3')](_0x4af689,_0x483d05,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x483d05,_0x4af689);require(_0x387d('0x42'))[_0x387d('0x43')]();return _0x928149(_0x387d('0x44')+_0x483d05+':'+_0x4af689);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 296a83d..c1d596f 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 _0x3974=['SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','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','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','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','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','call','setEncoding','utf8','setTimeout','headers','ready','line','emit','hangup','substring','search','520\x20End\x20of\x20proper','function','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','inherits','prototype','sendRequest','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','setContext'];(function(_0x340ae0,_0x1bbdb2){var _0x34df8e=function(_0x221f40){while(--_0x221f40){_0x340ae0['push'](_0x340ae0['shift']());}};_0x34df8e(++_0x1bbdb2);}(_0x3974,0xbc));var _0x4397=function(_0x4f8222,_0x3c9b9f){_0x4f8222=_0x4f8222-0x0;var _0xfb209d=_0x3974[_0x4f8222];return _0xfb209d;};'use strict';var util=require(_0x4397('0x0'));var _=require(_0x4397('0x1'));var EventEmitter=require(_0x4397('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x4397('0x3'));function AGIChannel(_0x258182){var _0x9db237=this,_0x1337be=new AGIReply(),_0x3eefc4=![],_0x55a542={};EventEmitter[_0x4397('0x4')](_0x9db237);_0x258182[_0x4397('0x5')](_0x4397('0x6'));_0x258182[_0x4397('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1337be['setEncoding'](_0x4397('0x6'));_0x1337be['on'](_0x4397('0x8'),function(_0x127f2e){for(var _0xc78051 in _0x127f2e){_0x9db237[_0xc78051]=_0x127f2e[_0xc78051];}_0x9db237['emit'](_0x4397('0x9'));});_0x1337be['on'](_0x4397('0xa'),function(_0x13a0e8){if(_0x13a0e8['toLowerCase']()=='hangup'){_0x9db237[_0x4397('0xb')](_0x4397('0xc'));return;}if(_0x13a0e8[_0x4397('0xd')](0x0,0xb)=='520-Invalid'){_0x3eefc4=!![];}if(_0x3eefc4){_0x55a542['rx']+=_0x13a0e8+'\x0a';if(_0x13a0e8[_0x4397('0xe')](_0x4397('0xf'))!=-0x1){_0x3eefc4=![];}}else{_0x55a542['rx']=_0x13a0e8;}if(_0x3eefc4){return;}if(typeof _0x55a542['cb']==_0x4397('0x10')){var _0x50b80d=_0x55a542['rx'][_0x4397('0xd')](0x0,0x3),_0x1354f5=null,_0x35f6ba=null;_0x50b80d=parseInt(_0x50b80d);if(isNaN(_0x50b80d)){_0x55a542['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x50b80d!=0xc8){_0x55a542['cb'](null,{'code':_0x50b80d,'result':-0x1,'extra':'KO'});return;}_0x1354f5=_0x55a542['rx'][_0x4397('0xd')](0x4)['replace'](_0x4397('0x11'),'');if(_0x1354f5['indexOf']('\x20')!=-0x1){_0x1354f5=_0x1354f5[_0x4397('0x12')](0x0,_0x1354f5[_0x4397('0x13')]('\x20'));}if(_[_0x4397('0x14')](_0x1354f5,'-1')){_0x1354f5=parseInt(_0x1354f5);}_0x35f6ba=_0x55a542['rx'][_0x4397('0x15')]('\x20');if(_0x35f6ba[_0x4397('0x16')]==0x3){_0x35f6ba=_0x35f6ba[0x2][_0x4397('0xd')](0x1,_0x35f6ba[0x2]['length']-0x1);}else if(_0x35f6ba[_0x4397('0x16')]>0x3){var _0x380666=/\((.+)\)/;var _0x448e48=_0x55a542['rx'][_0x4397('0x17')](_0x380666);if(_0x448e48){_0x35f6ba=_0x448e48[0x1];}else{_0x35f6ba=null;}}else{_0x35f6ba=null;}_0x55a542['cb'](null,{'code':_0x50b80d,'result':_0x1354f5,'extra':_0x35f6ba});}});_0x258182['on'](_0x4397('0x18'),function(_0xdd7dab){_0x9db237[_0x4397('0xb')](_0x4397('0x18'),new AGIError(_0x4397('0x19'),_0xdd7dab['code']));});_0x258182['on']('close',function(){_0x9db237[_0x4397('0xb')](_0x4397('0x1a'),new AGIError(_0x4397('0x1b')));});_0x258182['on'](_0x4397('0x1c'),function(){_0x9db237['emit']('timeout',new AGIError(_0x4397('0x1d')));_0x258182[_0x4397('0x1e')]();});_0x258182['pipe'](_0x1337be);this['command']=function(_0x499ebd,_0x2cc426){var _0x499ebd=_0x499ebd||'',_0x2cc426=typeof _0x2cc426==_0x4397('0x10')?_0x2cc426:new Function();_0x55a542={'tx':_0x499ebd,'rx':'','cb':_0x2cc426};_0x258182[_0x4397('0x1f')](_0x499ebd+'\x0a');},this['close']=function(){_0x258182[_0x4397('0x1e')]();};}util[_0x4397('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x4397('0x21')][_0x4397('0x22')]=function(_0x58ef09){return this['command']['sync'](this,_0x58ef09);};AGIChannel[_0x4397('0x21')][_0x4397('0x23')]=function(){return this[_0x4397('0x22')](_0x4397('0x24'));};AGIChannel[_0x4397('0x21')][_0x4397('0x25')]=function(_0x224662,_0xe78a54,_0x47161d){_0x224662=_0x224662===undefined?_0x4397('0x26'):_0x224662;_0xe78a54=_0xe78a54===undefined?'5':_0xe78a54;_0x47161d=_0x47161d===undefined?'1':_0x47161d;return this[_0x4397('0x22')](util[_0x4397('0x27')](_0x4397('0x28'),_0x224662,_0xe78a54*0x3e8,_0x47161d));};AGIChannel[_0x4397('0x21')]['noop']=function(_0x5291e9){_0x5291e9=_0x5291e9||_0x4397('0x29');return this['sendRequest'](util[_0x4397('0x27')](_0x4397('0x2a'),_0x5291e9));};AGIChannel['prototype'][_0x4397('0x2b')]=function(_0x4477fa,_0x3492f4){if(_['isArray'](_0x3492f4)){return this[_0x4397('0x22')](util[_0x4397('0x27')](_0x4397('0x2c'),_0x4477fa,_0x3492f4['join'](',')));}return this[_0x4397('0x22')](util['format'](_0x4397('0x2c'),_0x4477fa,_0x3492f4));};AGIChannel['prototype'][_0x4397('0x2d')]=function(_0x63f7e0){return this[_0x4397('0x22')](util[_0x4397('0x27')](_0x4397('0x2e'),_0x63f7e0));};AGIChannel[_0x4397('0x21')]['setExtension']=function(_0x39e78b){return this[_0x4397('0x22')](util['format']('SET\x20EXTENSION\x20%s',_0x39e78b));};AGIChannel['prototype'][_0x4397('0x2f')]=function(_0x108f79){return this[_0x4397('0x22')](util[_0x4397('0x27')](_0x4397('0x30'),_0x108f79));};AGIChannel[_0x4397('0x21')][_0x4397('0xc')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x4397('0x21')][_0x4397('0x31')]=function(_0x8cd80b,_0x1bcb8e){var _0x479d48=_[_0x4397('0x32')](_0x1bcb8e)||_[_0x4397('0x33')](_0x1bcb8e)?_0x1bcb8e[_0x4397('0x34')]():_0x1bcb8e;return this[_0x4397('0x22')](util['format'](_0x4397('0x35'),_0x8cd80b,_0x479d48?_0x479d48[_0x4397('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4397('0x21')][_0x4397('0x36')]=function(_0x1d46ef,_0x4ee1e5){return this['sendRequest'](util[_0x4397('0x27')](_0x4397('0x37'),_0x1d46ef,_0x4ee1e5));};AGIChannel[_0x4397('0x21')][_0x4397('0x38')]=function(_0x2682a5,_0x32f144){return this['sendRequest'](util['format'](_0x4397('0x39'),_0x2682a5,_0x32f144));};AGIChannel['prototype'][_0x4397('0x3a')]=function(_0x9d5070,_0x1064a7){return this[_0x4397('0x22')](util[_0x4397('0x27')](_0x4397('0x3b'),_0x9d5070,_0x1064a7));};AGIChannel['prototype'][_0x4397('0x3c')]=function(_0x278fc8,_0x52cc0a,_0x24f6e8){_0x52cc0a=_0x52cc0a||this[_0x4397('0x3d')];_0x24f6e8=_0x24f6e8||0x1;this[_0x4397('0x2d')](_0x278fc8);this['setExtension'](_0x52cc0a);this['setPriority'](_0x24f6e8);return this[_0x4397('0x3e')](util['format'](_0x4397('0x3f'),_0x278fc8,_0x52cc0a,_0x24f6e8));};AGIChannel[_0x4397('0x21')][_0x4397('0x40')]=function(_0x469f2b){return this['sendRequest'](util[_0x4397('0x27')](_0x4397('0x41'),_0x469f2b));};AGIChannel[_0x4397('0x21')][_0x4397('0x42')]=function(_0x319168,_0x3bcd6c,_0x5aeb63,_0x138120,_0x17b97a,_0x325ed5){_0x3bcd6c=_0x3bcd6c||'wav';_0x5aeb63=_0x5aeb63||'';_0x138120=_0x138120===undefined?-0x1:_0x138120==='-1'?-0x1:_0x138120*0x3e8;_0x17b97a=_0x17b97a===undefined?'':'s='+_0x17b97a;_0x325ed5=_0x325ed5?_0x4397('0x43'):'';return this[_0x4397('0x22')](util[_0x4397('0x27')](_0x4397('0x44'),_0x319168,_0x3bcd6c,_0x5aeb63,_0x138120,_0x325ed5,_0x17b97a));};AGIChannel[_0x4397('0x21')][_0x4397('0x45')]=function(_0xf237c7,_0x596ee4){_0x596ee4=_0x596ee4||'';return this[_0x4397('0x22')](util[_0x4397('0x27')](_0x4397('0x46'),_0xf237c7,_0x596ee4));};AGIChannel['prototype'][_0x4397('0x47')]=function(_0x4509ba){return this[_0x4397('0x2b')](_0x4397('0x48'),_0x4509ba);};AGIChannel[_0x4397('0x21')][_0x4397('0x49')]=function(_0x45653c){return this[_0x4397('0x2b')](_0x4397('0x4a'),_0x45653c);};AGIChannel[_0x4397('0x21')]['error']=function(_0x47a3fc,_0x34dbe8){this[_0x4397('0x3e')](util[_0x4397('0x27')](_0x4397('0x4b'),_0x47a3fc['id'],_0x47a3fc[_0x4397('0x4c')],_0x34dbe8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4397('0x4d')]=AGIChannel; \ No newline at end of file +var _0x9bd7=['setContext','SET\x20CONTEXT\x20%s','setPriority','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','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','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','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','520-Invalid','search','no\x20code','replace','result=','indexOf','startsWith','length','substring','match','error','close','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','sync','prototype','answer','ANSWER','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join'];(function(_0x287e04,_0x2ca1af){var _0x2fa380=function(_0x1b00e0){while(--_0x1b00e0){_0x287e04['push'](_0x287e04['shift']());}};_0x2fa380(++_0x2ca1af);}(_0x9bd7,0x106));var _0x79bd=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9bd7[_0x4cf98e];return _0x1623ac;};'use strict';var util=require(_0x79bd('0x0'));var _=require(_0x79bd('0x1'));var EventEmitter=require(_0x79bd('0x2'))[_0x79bd('0x3')];var AGIReply=require(_0x79bd('0x4'));var AGIError=require(_0x79bd('0x5'));function AGIChannel(_0x40c533){var _0x48c2d4=this,_0x15aaa3=new AGIReply(),_0x2e6472=![],_0x5d83e2={};EventEmitter[_0x79bd('0x6')](_0x48c2d4);_0x40c533[_0x79bd('0x7')](_0x79bd('0x8'));_0x40c533['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x15aaa3['setEncoding']('utf8');_0x15aaa3['on'](_0x79bd('0x9'),function(_0x1ff57b){for(var _0x1f5c50 in _0x1ff57b){_0x48c2d4[_0x1f5c50]=_0x1ff57b[_0x1f5c50];}_0x48c2d4[_0x79bd('0xa')]('ready');});_0x15aaa3['on'](_0x79bd('0xb'),function(_0x108647){if(_0x108647[_0x79bd('0xc')]()==_0x79bd('0xd')){_0x48c2d4[_0x79bd('0xa')](_0x79bd('0xd'));return;}if(_0x108647['substring'](0x0,0xb)==_0x79bd('0xe')){_0x2e6472=!![];}if(_0x2e6472){_0x5d83e2['rx']+=_0x108647+'\x0a';if(_0x108647[_0x79bd('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x2e6472=![];}}else{_0x5d83e2['rx']=_0x108647;}if(_0x2e6472){return;}if(typeof _0x5d83e2['cb']=='function'){var _0x51df55=_0x5d83e2['rx']['substring'](0x0,0x3),_0x25ec18=null,_0x5dd1e0=null;_0x51df55=parseInt(_0x51df55);if(isNaN(_0x51df55)){_0x5d83e2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x79bd('0x10')});return;}if(_0x51df55!=0xc8){_0x5d83e2['cb'](null,{'code':_0x51df55,'result':-0x1,'extra':'KO'});return;}_0x25ec18=_0x5d83e2['rx']['substring'](0x4)[_0x79bd('0x11')](_0x79bd('0x12'),'');if(_0x25ec18[_0x79bd('0x13')]('\x20')!=-0x1){_0x25ec18=_0x25ec18['substr'](0x0,_0x25ec18['indexOf']('\x20'));}if(_[_0x79bd('0x14')](_0x25ec18,'-1')){_0x25ec18=parseInt(_0x25ec18);}_0x5dd1e0=_0x5d83e2['rx']['split']('\x20');if(_0x5dd1e0[_0x79bd('0x15')]==0x3){_0x5dd1e0=_0x5dd1e0[0x2][_0x79bd('0x16')](0x1,_0x5dd1e0[0x2]['length']-0x1);}else if(_0x5dd1e0[_0x79bd('0x15')]>0x3){var _0x2a6103=/\((.+)\)/;var _0x21761c=_0x5d83e2['rx'][_0x79bd('0x17')](_0x2a6103);if(_0x21761c){_0x5dd1e0=_0x21761c[0x1];}else{_0x5dd1e0=null;}}else{_0x5dd1e0=null;}_0x5d83e2['cb'](null,{'code':_0x51df55,'result':_0x25ec18,'extra':_0x5dd1e0});}});_0x40c533['on'](_0x79bd('0x18'),function(_0x987bd8){_0x48c2d4['emit'](_0x79bd('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x987bd8['code']));});_0x40c533['on'](_0x79bd('0x19'),function(){_0x48c2d4[_0x79bd('0xa')](_0x79bd('0x19'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x40c533['on'](_0x79bd('0x1a'),function(){_0x48c2d4[_0x79bd('0xa')](_0x79bd('0x1a'),new AGIError(_0x79bd('0x1b')));_0x40c533['destroy']();});_0x40c533[_0x79bd('0x1c')](_0x15aaa3);this[_0x79bd('0x1d')]=function(_0x471db8,_0x2dcb20){var _0x471db8=_0x471db8||'',_0x2dcb20=typeof _0x2dcb20=='function'?_0x2dcb20:new Function();_0x5d83e2={'tx':_0x471db8,'rx':'','cb':_0x2dcb20};_0x40c533[_0x79bd('0x1e')](_0x471db8+'\x0a');},this[_0x79bd('0x19')]=function(){_0x40c533[_0x79bd('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x1d35bf){return this['command'][_0x79bd('0x20')](this,_0x1d35bf);};AGIChannel[_0x79bd('0x21')][_0x79bd('0x22')]=function(){return this['sendRequest'](_0x79bd('0x23'));};AGIChannel[_0x79bd('0x21')]['getData']=function(_0x1004eb,_0x537cca,_0x23e10d){_0x1004eb=_0x1004eb===undefined?_0x79bd('0x24'):_0x1004eb;_0x537cca=_0x537cca===undefined?'5':_0x537cca;_0x23e10d=_0x23e10d===undefined?'1':_0x23e10d;return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x27'),_0x1004eb,_0x537cca*0x3e8,_0x23e10d));};AGIChannel[_0x79bd('0x21')]['noop']=function(_0x5751ed){_0x5751ed=_0x5751ed||_0x79bd('0x28');return this['sendRequest'](util['format'](_0x79bd('0x29'),_0x5751ed));};AGIChannel[_0x79bd('0x21')][_0x79bd('0x2a')]=function(_0x3836f7,_0x528609){if(_[_0x79bd('0x2b')](_0x528609)){return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x2c'),_0x3836f7,_0x528609[_0x79bd('0x2d')](',')));}return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x2c'),_0x3836f7,_0x528609));};AGIChannel['prototype'][_0x79bd('0x2e')]=function(_0x133b2a){return this['sendRequest'](util[_0x79bd('0x26')](_0x79bd('0x2f'),_0x133b2a));};AGIChannel[_0x79bd('0x21')]['setExtension']=function(_0x4e7cb7){return this[_0x79bd('0x25')](util['format']('SET\x20EXTENSION\x20%s',_0x4e7cb7));};AGIChannel[_0x79bd('0x21')][_0x79bd('0x30')]=function(_0x492f0d){return this['sendRequest'](util[_0x79bd('0x26')](_0x79bd('0x31'),_0x492f0d));};AGIChannel[_0x79bd('0x21')][_0x79bd('0xd')]=function(){return this[_0x79bd('0x25')](_0x79bd('0x32'));};AGIChannel[_0x79bd('0x21')][_0x79bd('0x33')]=function(_0x3bc49b,_0x7c912){var _0x1b5fcc=_[_0x79bd('0x34')](_0x7c912)||_[_0x79bd('0x35')](_0x7c912)?_0x7c912[_0x79bd('0x36')]():_0x7c912;return this['sendRequest'](util[_0x79bd('0x26')](_0x79bd('0x37'),_0x3bc49b,_0x1b5fcc?_0x1b5fcc[_0x79bd('0x36')]()[_0x79bd('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x79bd('0x38')]=function(_0x98c238,_0x449ad4){return this['sendRequest'](util[_0x79bd('0x26')](_0x79bd('0x39'),_0x98c238,_0x449ad4));};AGIChannel[_0x79bd('0x21')][_0x79bd('0x3a')]=function(_0x53c167,_0xf6e597){return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x3b'),_0x53c167,_0xf6e597));};AGIChannel[_0x79bd('0x21')][_0x79bd('0x3c')]=function(_0xeaf7b6,_0x196c0d){return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x3d'),_0xeaf7b6,_0x196c0d));};AGIChannel['prototype']['continueAt']=function(_0xabb1b4,_0x11ac48,_0x22a0cf){_0x11ac48=_0x11ac48||this[_0x79bd('0x3e')];_0x22a0cf=_0x22a0cf||0x1;this[_0x79bd('0x2e')](_0xabb1b4);this[_0x79bd('0x3f')](_0x11ac48);this[_0x79bd('0x30')](_0x22a0cf);return this[_0x79bd('0x40')](util['format']('GOTO\x20%s\x20%s\x20%s',_0xabb1b4,_0x11ac48,_0x22a0cf));};AGIChannel[_0x79bd('0x21')][_0x79bd('0x41')]=function(_0x3e6393){return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x42'),_0x3e6393));};AGIChannel[_0x79bd('0x21')]['recordFile']=function(_0x3ffde3,_0x49acdd,_0x527155,_0x6b3ed9,_0x5f18df,_0x1bcd02){_0x49acdd=_0x49acdd||_0x79bd('0x43');_0x527155=_0x527155||'';_0x6b3ed9=_0x6b3ed9===undefined?-0x1:_0x6b3ed9==='-1'?-0x1:_0x6b3ed9*0x3e8;_0x5f18df=_0x5f18df===undefined?'':'s='+_0x5f18df;_0x1bcd02=_0x1bcd02?_0x79bd('0x44'):'';return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x45'),_0x3ffde3,_0x49acdd,_0x527155,_0x6b3ed9,_0x1bcd02,_0x5f18df));};AGIChannel[_0x79bd('0x21')][_0x79bd('0x46')]=function(_0x375089,_0x102d8e){_0x102d8e=_0x102d8e||'';return this[_0x79bd('0x25')](util[_0x79bd('0x26')](_0x79bd('0x47'),_0x375089,_0x102d8e));};AGIChannel['prototype'][_0x79bd('0x48')]=function(_0x4e7f94){return this[_0x79bd('0x2a')](_0x79bd('0x49'),_0x4e7f94);};AGIChannel[_0x79bd('0x21')]['wait']=function(_0x277c2e){return this['exec'](_0x79bd('0x4a'),_0x277c2e);};AGIChannel[_0x79bd('0x21')][_0x79bd('0x18')]=function(_0x21b020,_0x219dfd){this[_0x79bd('0x40')](util[_0x79bd('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x21b020['id'],_0x21b020[_0x79bd('0x4b')],_0x219dfd));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x79bd('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index d615d54..0d4bf6e 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 _0x4fbf=['format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push'];(function(_0x25d8ad,_0x196faf){var _0xeb50f2=function(_0x55d3b8){while(--_0x55d3b8){_0x25d8ad['push'](_0x25d8ad['shift']());}};_0xeb50f2(++_0x196faf);}(_0x4fbf,0x1a5));var _0xf4fb=function(_0x10e15a,_0x488d96){_0x10e15a=_0x10e15a-0x0;var _0x2807d0=_0x4fbf[_0x10e15a];return _0x2807d0;};'use strict';var util=require(_0xf4fb('0x0'));var error={'E_AGI_UNDEFINED':_0xf4fb('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xf4fb('0x2'),'E_AGI_SERVER_CLOSE':_0xf4fb('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xf4fb('0x4'),'E_AGI_SOCKET_ERROR':_0xf4fb('0x5'),'E_AGI_SOCKET_CLOSE':_0xf4fb('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xf4fb('0x7'),'E_AGI_COMMAND_EMPTY':_0xf4fb('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xf4fb('0x9')};function AGIError(_0x3ba1eb){var _0x3ba1eb=_0x3ba1eb||null,_0x2373f5=_0x2373f5||[],_0x25dfe0=0x1,_0x321c79='';if(!error[_0x3ba1eb]){_0x3ba1eb='E_AGI_UNDEFINED';}_0x2373f5[_0xf4fb('0xa')](error[_0x3ba1eb]);while(arguments[_0x25dfe0]){_0x2373f5['push'](arguments[_0x25dfe0]);_0x25dfe0++;}_0x321c79=util[_0xf4fb('0xb')][_0xf4fb('0xc')](util,_0x2373f5);this[_0xf4fb('0xd')]=_0x321c79;this[_0xf4fb('0xe')]=_0x3ba1eb;}module[_0xf4fb('0xf')]=AGIError; \ No newline at end of file +var _0xd644=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x2ef464,_0x33dbab){var _0x293f3e=function(_0x2e918c){while(--_0x2e918c){_0x2ef464['push'](_0x2ef464['shift']());}};_0x293f3e(++_0x33dbab);}(_0xd644,0x7d));var _0x4d64=function(_0x5b1825,_0x158a0d){_0x5b1825=_0x5b1825-0x0;var _0x3ee22e=_0xd644[_0x5b1825];return _0x3ee22e;};'use strict';var util=require(_0x4d64('0x0'));var error={'E_AGI_UNDEFINED':_0x4d64('0x1'),'E_AGI_ARGUMENT_PORT':_0x4d64('0x2'),'E_AGI_SERVER_ERROR':_0x4d64('0x3'),'E_AGI_SERVER_CLOSE':_0x4d64('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x4d64('0x5'),'E_AGI_SOCKET_ERROR':_0x4d64('0x6'),'E_AGI_SOCKET_CLOSE':_0x4d64('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x4d64('0x8'),'E_AGI_COMMAND_EMPTY':_0x4d64('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4d64('0xa'),'E_AGI_IVR_ENTRY':_0x4d64('0xb')};function AGIError(_0x1b99f2){var _0x1b99f2=_0x1b99f2||null,_0xe17a76=_0xe17a76||[],_0x29d90e=0x1,_0x4d0ae2='';if(!error[_0x1b99f2]){_0x1b99f2=_0x4d64('0xc');}_0xe17a76[_0x4d64('0xd')](error[_0x1b99f2]);while(arguments[_0x29d90e]){_0xe17a76[_0x4d64('0xd')](arguments[_0x29d90e]);_0x29d90e++;}_0x4d0ae2=util[_0x4d64('0xe')]['apply'](util,_0xe17a76);this[_0x4d64('0xf')]=_0x4d0ae2;this['name']=_0x1b99f2;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index d3a82ab..a7f058d 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b12=['localhost','agi','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','emit','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x171ebd,_0x1cd9b4){var _0x5cd6ab=function(_0xa14c3d){while(--_0xa14c3d){_0x171ebd['push'](_0x171ebd['shift']());}};_0x5cd6ab(++_0x1cd9b4);}(_0x0b12,0xd9));var _0x20b1=function(_0x31665b,_0x2164c7){_0x31665b=_0x31665b-0x0;var _0x474b17=_0x0b12[_0x31665b];return _0x474b17;};'use strict';var _=require(_0x20b1('0x0'));var EventEmitter=require(_0x20b1('0x1'))[_0x20b1('0x2')];var Redis=require(_0x20b1('0x3'));var AGIError=require(_0x20b1('0x4'));var config=require(_0x20b1('0x5'));config[_0x20b1('0x6')]=_['defaults'](config[_0x20b1('0x6')],{'host':_0x20b1('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x20b1('0x6')]);sub['subscribe'](_0x20b1('0x8'),function(_0x49afa8){if(_0x49afa8)return eventEmitter['emit'](_0x20b1('0x9'),new AGIError(_0x20b1('0xa'),_0x49afa8));});sub['on'](_0x20b1('0xb'),function(_0x29223e,_0x38be76){if(_0x29223e!==_0x20b1('0x8'))return;try{var _0x1840e0=JSON[_0x20b1('0xc')](_0x38be76);eventEmitter['emit'](_0x20b1('0xd'),_0x1840e0);}catch(_0x2d8c60){eventEmitter[_0x20b1('0xe')](_0x20b1('0x9'),new AGIError(_0x20b1('0xa'),_0x2d8c60));}});module[_0x20b1('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x160a=['./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','parse','exports','lodash','events','EventEmitter'];(function(_0x4f0a23,_0x5d1680){var _0x4b8efd=function(_0x12e968){while(--_0x12e968){_0x4f0a23['push'](_0x4f0a23['shift']());}};_0x4b8efd(++_0x5d1680);}(_0x160a,0x1b0));var _0xa160=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x160a[_0x261b8a];return _0x3455e8;};'use strict';var _=require(_0xa160('0x0'));var EventEmitter=require(_0xa160('0x1'))[_0xa160('0x2')];var Redis=require('ioredis');var AGIError=require(_0xa160('0x3'));var config=require(_0xa160('0x4'));config[_0xa160('0x5')]=_[_0xa160('0x6')](config['redis'],{'host':_0xa160('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xa160('0x5')]);sub[_0xa160('0x8')](_0xa160('0x9'),function(_0x1db11f){if(_0x1db11f)return eventEmitter[_0xa160('0xa')]('error',new AGIError(_0xa160('0xb'),_0x1db11f));});sub['on'](_0xa160('0xc'),function(_0x62886f,_0x257da1){if(_0x62886f!=='agi')return;try{var _0x30a98d=JSON[_0xa160('0xd')](_0x257da1);eventEmitter['emit']('projectUpdate',_0x30a98d);}catch(_0x302df0){eventEmitter['emit']('error',new AGIError(_0xa160('0xb'),_0x302df0));}});module[_0xa160('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 649b6a3..8177458 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 _0x3cb4=['traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size'];(function(_0x533b33,_0x1690bf){var _0x50d6f6=function(_0x29bedb){while(--_0x29bedb){_0x533b33['push'](_0x533b33['shift']());}};_0x50d6f6(++_0x1690bf);}(_0x3cb4,0x1f1));var _0x43cb=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x3cb4[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var logger=require(_0x43cb('0x0'))(_0x43cb('0x1'));var verticesWithRetry=[_0x43cb('0x2'),_0x43cb('0x3'),_0x43cb('0x4')];var Graph=function(){this[_0x43cb('0x5')]={};this[_0x43cb('0x6')]={};this[_0x43cb('0x7')]=0x0;};Graph['prototype'][_0x43cb('0x8')]=function(_0x183d87){this[_0x43cb('0x5')][_0x183d87['id']]=_0x183d87;this['edges'][_0x183d87['id']]=[];};Graph[_0x43cb('0x9')][_0x43cb('0xa')]=function(_0x2d8768,_0x5f0427,_0x209799){this[_0x43cb('0x6')][_0x2d8768][_0x43cb('0xb')]({'target':_0x5f0427,'condition':_0x209799});this[_0x43cb('0x7')]+=0x1;};Graph[_0x43cb('0x9')]['size']=function(){return _[_0x43cb('0xc')](this[_0x43cb('0x5')]);};Graph[_0x43cb('0x9')]['relations']=function(){return this['numberOfEdges'];};Graph[_0x43cb('0x9')]['getVertex']=function(_0x53e726){return this['vertices'][_0x53e726];};Graph['prototype'][_0x43cb('0xd')]=function(_0x362982,_0x38b636){if(!this[_0x43cb('0x5')][_0x362982]){return logger[_0x43cb('0xe')](_0x43cb('0xf'));}var _0x3ea3d2=_0x38b636(this[_0x43cb('0x5')][_0x362982]);if(!_0x3ea3d2){return logger[_0x43cb('0xe')](_0x43cb('0x10'));}if(this[_0x43cb('0x6')][_0x362982][_0x43cb('0x11')]===0x0){return logger[_0x43cb('0xe')](_0x43cb('0x12'));}for(var _0x432c70=0x0,_0x5755e3=[],_0x4d939b=![];_0x432c70\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','substring','debug','variables','stringify','close','timeout','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server','listening','lodash','util','../../config/logger','agi','./rpc','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','findIndex','deleted','splice','push','stack','log','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','format','[%s]\x20%s','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'];(function(_0x201361,_0x3d6778){var _0x300db2=function(_0x3b3c10){while(--_0x3b3c10){_0x201361['push'](_0x201361['shift']());}};_0x300db2(++_0x3d6778);}(_0xc54f,0x13f));var _0xfc54=function(_0x502532,_0x5719a7){_0x502532=_0x502532-0x0;var _0x2f9ce5=_0xc54f[_0x502532];return _0x2f9ce5;};'use strict';var _=require(_0xfc54('0x0'));var syncho=require('syncho');var util=require(_0xfc54('0x1'));var config=require('../../config/environment');var logger=require(_0xfc54('0x2'))(_0xfc54('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0xfc54('0x4'));var Project=require('./project');var AGIEmitter=require(_0xfc54('0x5'))[_0xfc54('0x6')];var projects=[];config[_0xfc54('0x3')]=_[_0xfc54('0x7')](config[_0xfc54('0x3')],{'ip':_0xfc54('0x8'),'port':0x11dd});AGIEmitter['on'](_0xfc54('0x9'),projectUpdateHandler);function connectionHandler(_0x400b4e){process[_0xfc54('0xa')](function(){syncho(function(){try{setChannelVariables(_0x400b4e);agiHandler(_0x400b4e);}catch(_0x207b4e){logger[_0xfc54('0xb')](_0x207b4e['stack']);}});});}function projectUpdateHandler(_0x2789c7){try{var _0x218427=_[_0xfc54('0xc')](projects,['id',_0x2789c7['id']]);if(_0x218427>-0x1){if(_0x2789c7[_0xfc54('0xd')]===!![]){projects[_0xfc54('0xe')](_0x218427,0x1);}else{projects[_0x218427]=_0x2789c7;}}else{projects[_0xfc54('0xf')](_0x2789c7);}}catch(_0x299ae5){logger[_0xfc54('0xb')](_0x299ae5[_0xfc54('0x10')]);}}function listeningHandler(){console[_0xfc54('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xfc54('0x3')][_0xfc54('0x12')]);logger[_0xfc54('0x13')](util['format'](_0xfc54('0x14'),config[_0xfc54('0x3')]['ip'],config[_0xfc54('0x3')][_0xfc54('0x12')]));}function errorHandler(_0x5b8659){if(_0x5b8659&&_0x5b8659[_0xfc54('0x15')]&&_0x5b8659['message']){logger[_0xfc54('0xb')](util[_0xfc54('0x16')](_0xfc54('0x17'),_0x5b8659[_0xfc54('0x15')],_0x5b8659[_0xfc54('0x18')]));}else{logger[_0xfc54('0xb')](util['format'](_0xfc54('0x19'),_0x5b8659[_0xfc54('0x10')]));}}function closeHandler(){logger[_0xfc54('0x13')](util['format'](_0xfc54('0x1a'),this[_0xfc54('0x1b')],this[_0xfc54('0x1c')],this['callerid'],this[_0xfc54('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x28efb7){logger[_0xfc54('0xb')](_0x28efb7[_0xfc54('0x10')]);}}function timeoutHandler(){logger['info'](util[_0xfc54('0x16')](_0xfc54('0x1e'),this[_0xfc54('0x1b')],this[_0xfc54('0x1c')],this[_0xfc54('0x1f')],this[_0xfc54('0x1d')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xfc54('0x16')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfc54('0x1b')],this['calleridname'],this['callerid'],this['dnid'],this[_0xfc54('0x20')]));this[_0xfc54('0x21')]=!![];}function createSquareReport(_0x54b2cc,_0xf3111e){rpc[_0xfc54('0x22')](_0x54b2cc)[_0xfc54('0x23')](function(_0x150657){if(_0xf3111e){_0xf3111e(null,_0x150657);}})[_0xfc54('0x24')](function(_0x54e1c9){if(_0xf3111e){_0xf3111e(null,_0x54e1c9);}});}function setChannelVariables(_0x5b1f52){for(var _0x2f1497 in _0x5b1f52){if(_0x5b1f52[_0xfc54('0x25')](_0x2f1497)){if(_0x2f1497[_0xfc54('0x26')]('agi_')===0x0){_0x5b1f52[_0x2f1497[_0xfc54('0x27')](0x4)]=_0x5b1f52[_0x2f1497];delete _0x5b1f52[_0x2f1497];}}}}function agiHandler(_0x156552){logger[_0xfc54('0x28')](_0xfc54('0x29'),JSON[_0xfc54('0x2a')](_0x156552,null,0x2));logger['info'](util[_0xfc54('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x156552['arg_1'],_0x156552[_0xfc54('0x1c')],_0x156552['callerid'],_0x156552[_0xfc54('0x1d')],_0x156552[_0xfc54('0x20')]));_0x156552['on'](_0xfc54('0xb'),errorHandler);_0x156552['on'](_0xfc54('0x2b'),closeHandler);_0x156552['on'](_0xfc54('0x2c'),timeoutHandler);_0x156552[_0xfc54('0x21')]=![];_0x156552['on']('hangup',hangupHandler);var _0x396c0e=_['find'](projects,['name',_0x156552[_0xfc54('0x1b')]]);if(!_0x396c0e)return Project[_0xfc54('0x2d')](_0x156552);if(!_0x396c0e[_0xfc54('0x2e')])return Project[_0xfc54('0x2f')](_0x156552);return Project[_0xfc54('0x30')](_0x396c0e,_0x156552);}function main(){var _0x43cba1;return utilLicense[_0xfc54('0x31')]()[_0xfc54('0x23')](function(_0x4457cf){if(!_0x4457cf)return;if(_0x4457cf[_0xfc54('0x32')]){if(_0x4457cf[_0xfc54('0x33')]&&_0x4457cf['callysquare']>0x0){logger[_0xfc54('0x13')](util[_0xfc54('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4457cf[_0xfc54('0x33')]));_0x43cba1=_0x4457cf[_0xfc54('0x33')];}else{logger[_0xfc54('0x13')](_0xfc54('0x34'));}}else{logger[_0xfc54('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x43cba1=-0x1;}})[_0xfc54('0x23')](function(){return Project[_0xfc54('0x35')]();})[_0xfc54('0x23')](function(_0x33b1fb){projects=_0x33b1fb;return;})[_0xfc54('0x24')](function(_0x3e0d91){logger[_0xfc54('0xb')](_0xfc54('0x36'),_0x3e0d91['stack']);})[_0xfc54('0x37')](function(){var _0xf6c49e=require(_0xfc54('0x38'))(config[_0xfc54('0x3')][_0xfc54('0x12')],config[_0xfc54('0x3')]['ip'],_0x43cba1);_0xf6c49e['on']('error',errorHandler);_0xf6c49e['on'](_0xfc54('0x39'),listeningHandler);_0xf6c49e['on']('connection',connectionHandler);_0xf6c49e['on'](_0xfc54('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0xed35=['push','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','calleridname','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','createSquareReport','then','catch','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','find','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','syncho','../../config/environment','../../config/logger','agi','./rpc','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','findIndex','deleted'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0xed35,0x115));var _0x5ed3=function(_0x2100f8,_0x374444){_0x2100f8=_0x2100f8-0x0;var _0x454a43=_0xed35[_0x2100f8];return _0x454a43;};'use strict';var _=require('lodash');var syncho=require(_0x5ed3('0x0'));var util=require('util');var config=require(_0x5ed3('0x1'));var logger=require(_0x5ed3('0x2'))(_0x5ed3('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0x5ed3('0x4'));var Project=require('./project');var AGIEmitter=require(_0x5ed3('0x5'))[_0x5ed3('0x6')];var projects=[];config[_0x5ed3('0x3')]=_[_0x5ed3('0x7')](config['agi'],{'ip':_0x5ed3('0x8'),'port':0x11dd});AGIEmitter['on'](_0x5ed3('0x9'),projectUpdateHandler);function connectionHandler(_0x3eadcf){process[_0x5ed3('0xa')](function(){syncho(function(){try{setChannelVariables(_0x3eadcf);agiHandler(_0x3eadcf);}catch(_0x4d71fa){logger['error'](_0x4d71fa['stack']);}});});}function projectUpdateHandler(_0x326db9){try{var _0x229f59=_[_0x5ed3('0xb')](projects,['id',_0x326db9['id']]);if(_0x229f59>-0x1){if(_0x326db9[_0x5ed3('0xc')]===!![]){projects['splice'](_0x229f59,0x1);}else{projects[_0x229f59]=_0x326db9;}}else{projects[_0x5ed3('0xd')](_0x326db9);}}catch(_0x3d453b){logger[_0x5ed3('0xe')](_0x3d453b[_0x5ed3('0xf')]);}}function listeningHandler(){console['log'](_0x5ed3('0x10'),config[_0x5ed3('0x3')][_0x5ed3('0x11')]);logger[_0x5ed3('0x12')](util[_0x5ed3('0x13')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x5ed3('0x3')][_0x5ed3('0x11')]));}function errorHandler(_0x4a6867){if(_0x4a6867&&_0x4a6867[_0x5ed3('0x14')]&&_0x4a6867[_0x5ed3('0x15')]){logger[_0x5ed3('0xe')](util['format'](_0x5ed3('0x16'),_0x4a6867['name'],_0x4a6867['message']));}else{logger[_0x5ed3('0xe')](util['format']('[ERROR]\x20%s',_0x4a6867['stack']));}}function closeHandler(){logger[_0x5ed3('0x12')](util['format'](_0x5ed3('0x17'),this['arg_1'],this['calleridname'],this[_0x5ed3('0x18')],this['dnid'],this[_0x5ed3('0x19')]));try{createSquareReport(this);}catch(_0x652486){logger[_0x5ed3('0xe')](_0x652486[_0x5ed3('0xf')]);}}function timeoutHandler(){logger[_0x5ed3('0x12')](util[_0x5ed3('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x5ed3('0x1a')],this['callerid'],this[_0x5ed3('0x1b')],this[_0x5ed3('0x19')]));}function hangupHandler(){logger['info'](util[_0x5ed3('0x13')](_0x5ed3('0x1c'),this[_0x5ed3('0x1d')],this[_0x5ed3('0x1a')],this['callerid'],this[_0x5ed3('0x1b')],this[_0x5ed3('0x19')]));this['evtHangup']=!![];}function createSquareReport(_0x24e13d,_0x4c0837){rpc[_0x5ed3('0x1e')](_0x24e13d)[_0x5ed3('0x1f')](function(_0x48f9f5){if(_0x4c0837){_0x4c0837(null,_0x48f9f5);}})[_0x5ed3('0x20')](function(_0x406d27){if(_0x4c0837){_0x4c0837(null,_0x406d27);}});}function setChannelVariables(_0x26fef8){for(var _0x53a8aa in _0x26fef8){if(_0x26fef8['hasOwnProperty'](_0x53a8aa)){if(_0x53a8aa[_0x5ed3('0x21')]('agi_')===0x0){_0x26fef8[_0x53a8aa[_0x5ed3('0x22')](0x4)]=_0x26fef8[_0x53a8aa];delete _0x26fef8[_0x53a8aa];}}}}function agiHandler(_0x48f3fd){logger[_0x5ed3('0x23')](_0x5ed3('0x24'),JSON[_0x5ed3('0x25')](_0x48f3fd,null,0x2));logger[_0x5ed3('0x12')](util[_0x5ed3('0x13')](_0x5ed3('0x26'),_0x48f3fd['arg_1'],_0x48f3fd['calleridname'],_0x48f3fd[_0x5ed3('0x18')],_0x48f3fd['dnid'],_0x48f3fd[_0x5ed3('0x19')]));_0x48f3fd['on'](_0x5ed3('0xe'),errorHandler);_0x48f3fd['on'](_0x5ed3('0x27'),closeHandler);_0x48f3fd['on'](_0x5ed3('0x28'),timeoutHandler);_0x48f3fd[_0x5ed3('0x29')]=![];_0x48f3fd['on']('hangup',hangupHandler);var _0x458b5f=_[_0x5ed3('0x2a')](projects,[_0x5ed3('0x14'),_0x48f3fd[_0x5ed3('0x1d')]]);if(!_0x458b5f)return Project['handleNotFound'](_0x48f3fd);if(!_0x458b5f[_0x5ed3('0x2b')])return Project[_0x5ed3('0x2c')](_0x48f3fd);return Project[_0x5ed3('0x2d')](_0x458b5f,_0x48f3fd);}function main(){var _0x2e3119;return utilLicense[_0x5ed3('0x2e')]()['then'](function(_0x31294c){if(!_0x31294c)return;if(_0x31294c[_0x5ed3('0x2f')]){if(_0x31294c[_0x5ed3('0x30')]&&_0x31294c['callysquare']>0x0){logger[_0x5ed3('0x12')](util[_0x5ed3('0x13')](_0x5ed3('0x31'),_0x31294c[_0x5ed3('0x30')]));_0x2e3119=_0x31294c[_0x5ed3('0x30')];}else{logger[_0x5ed3('0x12')](_0x5ed3('0x32'));}}else{logger['info'](_0x5ed3('0x33'));_0x2e3119=-0x1;}})['then'](function(){return Project[_0x5ed3('0x34')]();})[_0x5ed3('0x1f')](function(_0x988a93){projects=_0x988a93;return;})['catch'](function(_0x2dfbad){logger[_0x5ed3('0xe')](_0x5ed3('0x35'),_0x2dfbad[_0x5ed3('0xf')]);})[_0x5ed3('0x36')](function(){var _0xc1da70=require(_0x5ed3('0x37'))(config['agi']['port'],config[_0x5ed3('0x3')]['ip'],_0x2e3119);_0xc1da70['on']('error',errorHandler);_0xc1da70['on'](_0x5ed3('0x38'),listeningHandler);_0xc1da70['on'](_0x5ed3('0x39'),connectionHandler);_0xc1da70['on'](_0x5ed3('0x27'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 39177f5..c0af2b5 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 _0x301f=['error','result','sendMailMessage','SendMail','bluebird','jayson/promise','http','request'];(function(_0x2da3b9,_0x43f25e){var _0x759774=function(_0x514354){while(--_0x514354){_0x2da3b9['push'](_0x2da3b9['shift']());}};_0x759774(++_0x43f25e);}(_0x301f,0xbc));var _0xf301=function(_0x3f22fa,_0x3e64f4){_0x3f22fa=_0x3f22fa-0x0;var _0x17ee7c=_0x301f[_0x3f22fa];return _0x17ee7c;};'use strict';var BPromise=require(_0xf301('0x0'));var jayson=require(_0xf301('0x1'));var client=jayson['client'][_0xf301('0x2')]({'port':0x232b});function request(_0x390a9b,_0x15e0aa){return new BPromise(function(_0x243bad,_0x3e6c08){return client[_0xf301('0x3')](_0x390a9b,_0x15e0aa)['then'](function(_0x1fef99){if(_0x1fef99[_0xf301('0x4')]){return _0x3e6c08(_0x1fef99['error']['message']);}else{return _0x243bad(_0x1fef99[_0xf301('0x5')]);}})['catch'](function(_0x5d39a1){return _0x3e6c08(_0x5d39a1);});});}exports[_0xf301('0x6')]=function(_0x12e30d,_0x5361c6){return request(_0xf301('0x7'),{'account':_0x12e30d,'message':_0x5361c6});}; \ No newline at end of file +var _0x7d66=['result','catch','sendMailMessage','bluebird','client','http','request','then','error'];(function(_0x57be18,_0x4ed1f6){var _0x396d8a=function(_0x4adceb){while(--_0x4adceb){_0x57be18['push'](_0x57be18['shift']());}};_0x396d8a(++_0x4ed1f6);}(_0x7d66,0x1a1));var _0x67d6=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x7d66[_0x425716];return _0x2d39af;};'use strict';var BPromise=require(_0x67d6('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x67d6('0x1')][_0x67d6('0x2')]({'port':0x232b});function request(_0x216d7e,_0x496419){return new BPromise(function(_0x5ab154,_0x91395c){return client[_0x67d6('0x3')](_0x216d7e,_0x496419)[_0x67d6('0x4')](function(_0x2cf503){if(_0x2cf503[_0x67d6('0x5')]){return _0x91395c(_0x2cf503[_0x67d6('0x5')]['message']);}else{return _0x5ab154(_0x2cf503[_0x67d6('0x6')]);}})[_0x67d6('0x7')](function(_0x53ffaf){return _0x91395c(_0x53ffaf);});});}exports[_0x67d6('0x8')]=function(_0x5e5eb4,_0x5c79e7){return request('SendMail',{'account':_0x5e5eb4,'message':_0x5c79e7});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 5a090e6..b9028c4 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde15=['isUndefined','result','error','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','agicommand\x20not\x20found','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','util','../../config/logger','agi','./graph','./vertices','stack','hasOwnProperty','maxRetry','retry','addVertex','isArray','length','source','target','toJson','mxGraphModel','root','start','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup'];(function(_0x135c3b,_0x41a576){var _0x3b4b47=function(_0x3a4885){while(--_0x3a4885){_0x135c3b['push'](_0x135c3b['shift']());}};_0x3b4b47(++_0x41a576);}(_0xde15,0x156));var _0x5de1=function(_0x33141f,_0xe9f809){_0x33141f=_0x33141f-0x0;var _0x51aa53=_0xde15[_0x33141f];return _0x51aa53;};'use strict';var _=require(_0x5de1('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x5de1('0x1'));var logger=require(_0x5de1('0x2'))(_0x5de1('0x3'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x5de1('0x4'));var Vertices=require(_0x5de1('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x3b73d8){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x3b73d8[_0x5de1('0x6')]);return[];});}function addVertex(_0x2159e7,_0x1a71f7,_0xe3597d){_0x1a71f7['agicommand']=_0xe3597d;if(_0x1a71f7[_0x5de1('0x7')]('retry')){_0x1a71f7[_0x5de1('0x8')]=parseInt(_0x1a71f7[_0x5de1('0x9')],0xa);}_0x2159e7[_0x5de1('0xa')](_['omit'](_0x1a71f7,'mxCell'));}function initGraph(_0x1a7359,_0x4d9058){var _0x25c18c=new Graph();for(var _0x312280 in _0x1a7359){if(_0x1a7359[_0x5de1('0x7')](_0x312280)){if(_[_0x5de1('0xb')](_0x1a7359[_0x312280])){for(var _0x5d28c0=0x0;_0x5d28c0<_0x1a7359[_0x312280][_0x5de1('0xc')];_0x5d28c0+=0x1){addVertex(_0x25c18c,_0x1a7359[_0x312280][_0x5d28c0],_0x312280);}}else{addVertex(_0x25c18c,_0x1a7359[_0x312280],_0x312280);}}}for(var _0x12ca3b=0x0;_0x12ca3b<_0x4d9058[_0x5de1('0xc')];_0x12ca3b+=0x1){if(_0x4d9058[_0x12ca3b][_0x5de1('0xd')]&&_0x4d9058[_0x12ca3b][_0x5de1('0xe')]){_0x25c18c['addEdge'](_0x4d9058[_0x12ca3b]['source'],_0x4d9058[_0x12ca3b][_0x5de1('0xe')],_0x4d9058[_0x12ca3b]['value']);}}return _0x25c18c;}function getRoot(_0x3b1a1e){return parser[_0x5de1('0xf')](_0x3b1a1e,{'object':!![]})[_0x5de1('0x10')][_0x5de1('0x11')];}function inspect(_0x46e5ec){return util['inspect'](_0x46e5ec,{'showHidden':![],'depth':null});}function initialize(_0x21d971,_0x1a3b5a){var _0x3cf930=getRoot(_0x21d971['production']);if(!_0x3cf930||!_0x3cf930[_0x5de1('0x12')])return;var _0x4f2f3a,_0x360ed4,_0x374525;logger[_0x5de1('0x13')](_0x5de1('0x11'),JSON[_0x5de1('0x14')](_0x3cf930,null,0x2));_0x1a3b5a['joinAt']=moment()[_0x5de1('0x15')](_0x5de1('0x16'));_0x4f2f3a=initGraph(_['omit'](_0x3cf930,_0x5de1('0x17')),_0x3cf930[_0x5de1('0x17')]);_0x360ed4=new Vertices(_0x1a3b5a,rpc,mailRpc);logger[_0x5de1('0x18')](util[_0x5de1('0x15')](_0x5de1('0x19'),_0x1a3b5a[_0x5de1('0x1a')],_0x1a3b5a[_0x5de1('0x1b')],_0x1a3b5a[_0x5de1('0x1c')],_0x1a3b5a[_0x5de1('0x1d')],_0x1a3b5a[_0x5de1('0x1e')]));_0x4f2f3a[_0x5de1('0x1f')](_0x3cf930['start']['id'],function(_0x184ce2){try{_0x184ce2=_0x360ed4[_0x5de1('0x20')](_0x184ce2);logger[_0x5de1('0x13')](_0x5de1('0x21'),JSON[_0x5de1('0x14')](_0x184ce2,null,0x2));if(_0x184ce2[_0x5de1('0x22')]===_0x5de1('0x23')){logger[_0x5de1('0x18')](_0x5de1('0x24'));_0x1a3b5a[_0x5de1('0x25')]=_0x184ce2['context']||_0x1a3b5a['context'];_0x1a3b5a[_0x5de1('0x26')]=_0x184ce2['extension'];_0x1a3b5a['priority']=_0x184ce2[_0x5de1('0x27')]?_0x184ce2[_0x5de1('0x27')]-0x1:0x1;return null;}else if(_0x184ce2&&_0x360ed4[_0x184ce2[_0x5de1('0x22')]]){_0x374525=_0x360ed4[_0x184ce2[_0x5de1('0x22')]](_0x184ce2);logger[_0x5de1('0x18')](_0x5de1('0x28'),JSON['stringify'](_0x374525,null,0x2));if(_0x374525&&_0x374525[_0x5de1('0x29')]===AGI_CODE_SUCCESS&&_0x374525['result']!==AGI_RESULT_ERROR&&!_0x1a3b5a[_0x5de1('0x2a')]){logger[_0x5de1('0x13')](_0x5de1('0x28'),inspect(_0x374525));return _[_0x5de1('0x2b')](_0x374525[_0x5de1('0x2c')])?null:_0x374525[_0x5de1('0x2c')]['toString']();}else{logger[_0x5de1('0x2d')](_0x5de1('0x28'),inspect(_0x374525));return null;}}else{logger[_0x5de1('0x2d')]('agicommand\x20not\x20found');return null;}}catch(_0x29718b){logger['error'](_0x29718b[_0x5de1('0x6')]);return null;}});if(_0x3cf930[_0x5de1('0x2e')]){logger[_0x5de1('0x18')](util[_0x5de1('0x15')](_0x5de1('0x2f'),_0x1a3b5a[_0x5de1('0x1a')],_0x1a3b5a['calleridname'],_0x1a3b5a[_0x5de1('0x1c')],_0x1a3b5a[_0x5de1('0x1d')],_0x1a3b5a[_0x5de1('0x1e')]));_0x4f2f3a[_0x5de1('0x1f')](_0x3cf930[_0x5de1('0x2e')]['id'],function(_0x1759ae){try{_0x1759ae=_0x360ed4[_0x5de1('0x20')](_0x1759ae);logger[_0x5de1('0x13')]('vertex',JSON[_0x5de1('0x14')](_0x1759ae,null,0x2));if(_0x1759ae&&_0x360ed4[_0x1759ae[_0x5de1('0x22')]]){_0x374525=_0x360ed4[_0x1759ae[_0x5de1('0x22')]](_0x1759ae);if(_0x374525){logger['debug'](_0x5de1('0x28'),inspect(_0x374525));return _['isUndefined'](_0x374525[_0x5de1('0x2c')])?null:_0x374525['result'][_0x5de1('0x30')]();}else{logger[_0x5de1('0x2d')](_0x5de1('0x28'),inspect(_0x374525));return null;}}else{logger[_0x5de1('0x2d')](_0x5de1('0x31'));return null;}}catch(_0x21150e){logger['error'](_0x21150e[_0x5de1('0x6')]);return null;}});}logger[_0x5de1('0x18')](util[_0x5de1('0x15')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1a3b5a[_0x5de1('0x1a')],_0x1a3b5a[_0x5de1('0x1b')],_0x1a3b5a['callerid'],_0x1a3b5a[_0x5de1('0x1d')],_0x1a3b5a[_0x5de1('0x1e')]));logger['info'](util[_0x5de1('0x15')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1a3b5a['context'],_0x1a3b5a['extension'],parseInt(_0x1a3b5a[_0x5de1('0x27')],0xa)+0x1));_0x1a3b5a[_0x5de1('0x32')](_0x1a3b5a[_0x5de1('0x25')],_0x1a3b5a[_0x5de1('0x26')],parseInt(_0x1a3b5a[_0x5de1('0x27')],0xa)+0x1);_0x1a3b5a[_0x5de1('0x33')]();}function handleNotFound(_0x560b9b){logger[_0x5de1('0x2d')](util[_0x5de1('0x15')](_0x5de1('0x34'),_0x560b9b[_0x5de1('0x1a')]));_0x560b9b[_0x5de1('0x32')](_0x560b9b[_0x5de1('0x25')],_0x560b9b[_0x5de1('0x26')],parseInt(_0x560b9b['priority'],0xa)+0x1);_0x560b9b['close']();}function handleUnpublished(_0x560e1a){logger['error'](util[_0x5de1('0x15')](_0x5de1('0x35'),_0x560e1a[_0x5de1('0x1a')]));_0x560e1a[_0x5de1('0x32')](_0x560e1a[_0x5de1('0x25')],_0x560e1a[_0x5de1('0x26')],parseInt(_0x560e1a[_0x5de1('0x27')],0xa)+0x1);_0x560e1a[_0x5de1('0x33')]();}module[_0x5de1('0x36')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xafc2=['agi','./mailRpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','root','inspect','stringify','joinAt','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','start','clear','debug','vertex','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','evtHangup','isUndefined','result','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','traverseBFS','finally','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger'];(function(_0x22d6c9,_0x3ea6a0){var _0x32d857=function(_0x35b117){while(--_0x35b117){_0x22d6c9['push'](_0x22d6c9['shift']());}};_0x32d857(++_0x3ea6a0);}(_0xafc2,0x199));var _0x2afc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xafc2[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2afc('0x0'));var moment=require('moment');var parser=require(_0x2afc('0x1'));var util=require(_0x2afc('0x2'));var logger=require(_0x2afc('0x3'))(_0x2afc('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x2afc('0x5'));var Graph=require(_0x2afc('0x6'));var Vertices=require(_0x2afc('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x2afc('0x8')]()['catch'](function(_0x54e86a){logger[_0x2afc('0x9')](_0x2afc('0xa'),_0x54e86a[_0x2afc('0xb')]);return[];});}function addVertex(_0x4793ab,_0x54ed6,_0x58a6a5){_0x54ed6[_0x2afc('0xc')]=_0x58a6a5;if(_0x54ed6['hasOwnProperty'](_0x2afc('0xd'))){_0x54ed6['maxRetry']=parseInt(_0x54ed6['retry'],0xa);}_0x4793ab['addVertex'](_[_0x2afc('0xe')](_0x54ed6,_0x2afc('0xf')));}function initGraph(_0x2e27af,_0x5aea4b){var _0x424044=new Graph();for(var _0x380c06 in _0x2e27af){if(_0x2e27af[_0x2afc('0x10')](_0x380c06)){if(_[_0x2afc('0x11')](_0x2e27af[_0x380c06])){for(var _0x3bb70c=0x0;_0x3bb70c<_0x2e27af[_0x380c06][_0x2afc('0x12')];_0x3bb70c+=0x1){addVertex(_0x424044,_0x2e27af[_0x380c06][_0x3bb70c],_0x380c06);}}else{addVertex(_0x424044,_0x2e27af[_0x380c06],_0x380c06);}}}for(var _0x531b27=0x0;_0x531b27<_0x5aea4b['length'];_0x531b27+=0x1){if(_0x5aea4b[_0x531b27][_0x2afc('0x13')]&&_0x5aea4b[_0x531b27][_0x2afc('0x14')]){_0x424044[_0x2afc('0x15')](_0x5aea4b[_0x531b27][_0x2afc('0x13')],_0x5aea4b[_0x531b27][_0x2afc('0x14')],_0x5aea4b[_0x531b27][_0x2afc('0x16')]);}}return _0x424044;}function getRoot(_0x40ba8c){return parser['toJson'](_0x40ba8c,{'object':!![]})['mxGraphModel'][_0x2afc('0x17')];}function inspect(_0x4ff0be){return util[_0x2afc('0x18')](_0x4ff0be,{'showHidden':![],'depth':null});}function initialize(_0x3866fd,_0x357ec2){var _0x47ec43=getRoot(_0x3866fd['production']);if(!_0x47ec43||!_0x47ec43['start'])return;var _0x5549a9,_0x149ce1,_0x3298cf;logger['debug'](_0x2afc('0x17'),JSON[_0x2afc('0x19')](_0x47ec43,null,0x2));_0x357ec2[_0x2afc('0x1a')]=moment()[_0x2afc('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5549a9=initGraph(_['omit'](_0x47ec43,_0x2afc('0xf')),_0x47ec43['mxCell']);_0x149ce1=new Vertices(_0x357ec2,rpc,mailRpc);logger['info'](util[_0x2afc('0x1b')](_0x2afc('0x1c'),_0x357ec2[_0x2afc('0x1d')],_0x357ec2[_0x2afc('0x1e')],_0x357ec2['callerid'],_0x357ec2[_0x2afc('0x1f')],_0x357ec2[_0x2afc('0x20')]));_0x5549a9['traverseBFS'](_0x47ec43[_0x2afc('0x21')]['id'],function(_0x4dc216){try{_0x4dc216=_0x149ce1[_0x2afc('0x22')](_0x4dc216);logger[_0x2afc('0x23')](_0x2afc('0x24'),JSON[_0x2afc('0x19')](_0x4dc216,null,0x2));if(_0x4dc216[_0x2afc('0xc')]==='gotoc'){logger[_0x2afc('0x25')](_0x2afc('0x26'));_0x357ec2[_0x2afc('0x27')]=_0x4dc216[_0x2afc('0x27')]||_0x357ec2[_0x2afc('0x27')];_0x357ec2[_0x2afc('0x28')]=_0x4dc216[_0x2afc('0x28')];_0x357ec2[_0x2afc('0x29')]=_0x4dc216[_0x2afc('0x29')]?_0x4dc216['priority']-0x1:0x1;return null;}else if(_0x4dc216&&_0x149ce1[_0x4dc216[_0x2afc('0xc')]]){_0x3298cf=_0x149ce1[_0x4dc216[_0x2afc('0xc')]](_0x4dc216);logger[_0x2afc('0x25')](_0x2afc('0x2a'),JSON[_0x2afc('0x19')](_0x3298cf,null,0x2));if(_0x3298cf&&_0x3298cf['code']===AGI_CODE_SUCCESS&&_0x3298cf['result']!==AGI_RESULT_ERROR&&!_0x357ec2[_0x2afc('0x2b')]){logger[_0x2afc('0x23')](_0x2afc('0x2a'),inspect(_0x3298cf));return _[_0x2afc('0x2c')](_0x3298cf[_0x2afc('0x2d')])?null:_0x3298cf['result']['toString']();}else{logger[_0x2afc('0x9')](_0x2afc('0x2a'),inspect(_0x3298cf));return null;}}else{logger['error'](_0x2afc('0x2e'));return null;}}catch(_0x2f058c){logger[_0x2afc('0x9')](_0x2f058c[_0x2afc('0xb')]);return null;}});if(_0x47ec43['finally']){logger[_0x2afc('0x25')](util[_0x2afc('0x1b')](_0x2afc('0x2f'),_0x357ec2[_0x2afc('0x1d')],_0x357ec2[_0x2afc('0x1e')],_0x357ec2[_0x2afc('0x30')],_0x357ec2[_0x2afc('0x1f')],_0x357ec2[_0x2afc('0x20')]));_0x5549a9[_0x2afc('0x31')](_0x47ec43[_0x2afc('0x32')]['id'],function(_0x54e75e){try{_0x54e75e=_0x149ce1[_0x2afc('0x22')](_0x54e75e);logger[_0x2afc('0x23')](_0x2afc('0x24'),JSON[_0x2afc('0x19')](_0x54e75e,null,0x2));if(_0x54e75e&&_0x149ce1[_0x54e75e[_0x2afc('0xc')]]){_0x3298cf=_0x149ce1[_0x54e75e[_0x2afc('0xc')]](_0x54e75e);if(_0x3298cf){logger[_0x2afc('0x23')]('response',inspect(_0x3298cf));return _[_0x2afc('0x2c')](_0x3298cf['result'])?null:_0x3298cf['result'][_0x2afc('0x33')]();}else{logger[_0x2afc('0x9')](_0x2afc('0x2a'),inspect(_0x3298cf));return null;}}else{logger['error'](_0x2afc('0x2e'));return null;}}catch(_0x39ee08){logger['error'](_0x39ee08['stack']);return null;}});}logger[_0x2afc('0x25')](util[_0x2afc('0x1b')](_0x2afc('0x34'),_0x357ec2[_0x2afc('0x1d')],_0x357ec2[_0x2afc('0x1e')],_0x357ec2[_0x2afc('0x30')],_0x357ec2['dnid'],_0x357ec2[_0x2afc('0x20')]));logger['info'](util[_0x2afc('0x1b')](_0x2afc('0x35'),_0x357ec2[_0x2afc('0x27')],_0x357ec2[_0x2afc('0x28')],parseInt(_0x357ec2['priority'],0xa)+0x1));_0x357ec2[_0x2afc('0x36')](_0x357ec2[_0x2afc('0x27')],_0x357ec2[_0x2afc('0x28')],parseInt(_0x357ec2['priority'],0xa)+0x1);_0x357ec2[_0x2afc('0x37')]();}function handleNotFound(_0x30b394){logger[_0x2afc('0x9')](util[_0x2afc('0x1b')](_0x2afc('0x38'),_0x30b394['arg_1']));_0x30b394['continueAt'](_0x30b394[_0x2afc('0x27')],_0x30b394['extension'],parseInt(_0x30b394['priority'],0xa)+0x1);_0x30b394[_0x2afc('0x37')]();}function handleUnpublished(_0x10833c){logger['error'](util[_0x2afc('0x1b')](_0x2afc('0x39'),_0x10833c[_0x2afc('0x1d')]));_0x10833c[_0x2afc('0x36')](_0x10833c['context'],_0x10833c['extension'],parseInt(_0x10833c[_0x2afc('0x29')],0xa)+0x1);_0x10833c['close']();}module[_0x2afc('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 8ef4537..450b12e 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 _0x1bbb=['headers','line','length','util','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','trim','emit'];(function(_0xaf1473,_0x1cf169){var _0x51390a=function(_0x1c40b2){while(--_0x1c40b2){_0xaf1473['push'](_0xaf1473['shift']());}};_0x51390a(++_0x1cf169);}(_0x1bbb,0x143));var _0xb1bb=function(_0x129051,_0x33504c){_0x129051=_0x129051-0x0;var _0x4a87dc=_0x1bbb[_0x129051];return _0x4a87dc;};'use strict';var util=require(_0xb1bb('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x4fc0ee){Transform[_0xb1bb('0x1')](this,_0x4fc0ee);this[_0xb1bb('0x2')]='';this[_0xb1bb('0x3')]=![];}util[_0xb1bb('0x4')](AGIReply,Transform);AGIReply[_0xb1bb('0x5')][_0xb1bb('0x6')]=function(_0x120bd8,_0x572593,_0x35b7cc){var _0x157892='\x0a',_0x110d36=['\x0a\x0a',_0xb1bb('0x7')],_0x50c031=-0x1,_0x49d612=-0x1,_0x461002='',_0x45efc4=0x0,_0x32798e='',_0x107570='';this[_0xb1bb('0x2')]+=_0x120bd8[_0xb1bb('0x8')]();_0x32798e=this[_0xb1bb('0x2')];if(!this[_0xb1bb('0x3')]){_0x45efc4=0x0;while(_0x110d36[_0x45efc4]){while((_0x49d612=_0x32798e[_0xb1bb('0x9')](_0x110d36[_0x45efc4]))!=-0x1){_0x461002=_0x110d36[_0x45efc4];_0x107570=_0x32798e[_0xb1bb('0xa')](0x0,_0x49d612);_0x32798e=_0x32798e[_0xb1bb('0xa')](_0x49d612+_0x461002['length']);var _0x106662=_0x107570['split'](_0x157892),_0x325d4d=0x0,_0x54cd10={},_0x2c12c3='',_0x52951e='',_0x351922=-0x1;while(_0x106662[_0x325d4d]){_0x351922=_0x106662[_0x325d4d][_0xb1bb('0x9')](':');if(_0x351922!=-0x1){_0x2c12c3=_0x106662[_0x325d4d]['slice'](0x0,_0x351922)[_0xb1bb('0xb')]();_0x52951e=_0x106662[_0x325d4d]['slice'](_0x351922+0x1)[_0xb1bb('0xb')]();if(_0x2c12c3['length']>0x0){_0x54cd10[_0x2c12c3]=_0x52951e;}}else{}_0x325d4d++;}this[_0xb1bb('0xc')](_0xb1bb('0xd'),_0x54cd10);this['_inBody']=!![];}_0x45efc4++;}this[_0xb1bb('0x2')]=_0x32798e;}else{while((_0x50c031=_0x32798e[_0xb1bb('0x9')](_0x157892))!=-0x1){_0x107570=_0x32798e[_0xb1bb('0xa')](0x0,_0x50c031);this[_0xb1bb('0xc')](_0xb1bb('0xe'),_0x107570);_0x32798e=_0x32798e[_0xb1bb('0xa')](_0x50c031+_0x157892[_0xb1bb('0xf')]);}this[_0xb1bb('0x2')]=_0x32798e;}_0x35b7cc();};module['exports']=AGIReply; \ No newline at end of file +var _0x51b9=['_localBuffer','_inBody','inherits','prototype','_transform','toString','indexOf','substring','split','slice','trim','length','emit','util','call'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51b9,0x11b));var _0x951b=function(_0x418012,_0x2cb5db){_0x418012=_0x418012-0x0;var _0x26288c=_0x51b9[_0x418012];return _0x26288c;};'use strict';var util=require(_0x951b('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x2b59eb){Transform[_0x951b('0x1')](this,_0x2b59eb);this[_0x951b('0x2')]='';this[_0x951b('0x3')]=![];}util[_0x951b('0x4')](AGIReply,Transform);AGIReply[_0x951b('0x5')][_0x951b('0x6')]=function(_0x1b3f37,_0x2e35dc,_0x34e793){var _0xba89ea='\x0a',_0x51e22e=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x13475f=-0x1,_0xcd534d=-0x1,_0x52e54d='',_0x16f04a=0x0,_0x5967ea='',_0x48b7dd='';this['_localBuffer']+=_0x1b3f37[_0x951b('0x7')]();_0x5967ea=this['_localBuffer'];if(!this[_0x951b('0x3')]){_0x16f04a=0x0;while(_0x51e22e[_0x16f04a]){while((_0xcd534d=_0x5967ea[_0x951b('0x8')](_0x51e22e[_0x16f04a]))!=-0x1){_0x52e54d=_0x51e22e[_0x16f04a];_0x48b7dd=_0x5967ea['substring'](0x0,_0xcd534d);_0x5967ea=_0x5967ea[_0x951b('0x9')](_0xcd534d+_0x52e54d['length']);var _0x20857e=_0x48b7dd[_0x951b('0xa')](_0xba89ea),_0x14daed=0x0,_0x46f1bc={},_0x4dddc9='',_0x15c7ad='',_0x49ffb0=-0x1;while(_0x20857e[_0x14daed]){_0x49ffb0=_0x20857e[_0x14daed]['indexOf'](':');if(_0x49ffb0!=-0x1){_0x4dddc9=_0x20857e[_0x14daed][_0x951b('0xb')](0x0,_0x49ffb0)['trim']();_0x15c7ad=_0x20857e[_0x14daed][_0x951b('0xb')](_0x49ffb0+0x1)[_0x951b('0xc')]();if(_0x4dddc9[_0x951b('0xd')]>0x0){_0x46f1bc[_0x4dddc9]=_0x15c7ad;}}else{}_0x14daed++;}this[_0x951b('0xe')]('headers',_0x46f1bc);this['_inBody']=!![];}_0x16f04a++;}this[_0x951b('0x2')]=_0x5967ea;}else{while((_0x13475f=_0x5967ea['indexOf'](_0xba89ea))!=-0x1){_0x48b7dd=_0x5967ea[_0x951b('0x9')](0x0,_0x13475f);this[_0x951b('0xe')]('line',_0x48b7dd);_0x5967ea=_0x5967ea[_0x951b('0x9')](_0x13475f+_0xba89ea[_0x951b('0xd')]);}this[_0x951b('0x2')]=_0x5967ea;}_0x34e793();};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 259f41a..86f9b66 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 _0x6753=['moment','jayson/promise','client','request','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','ShowTrunk','ShowSound','save_name','ShowInterval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','createCmContact','ShowCmHopper','getPauseById','LoginUser','agentPause','agentUnpause','UnpauseUser','LogoutUser','lodash'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x6753,0xa1));var _0x3675=function(_0x13ba15,_0x1577fd){_0x13ba15=_0x13ba15-0x0;var _0x5862ff=_0x6753[_0x13ba15];return _0x5862ff;};'use strict';var _=require(_0x3675('0x0'));var moment=require(_0x3675('0x1'));var jayson=require(_0x3675('0x2'));var client=jayson[_0x3675('0x3')]['http']({'port':0x2329});function request(_0x2efb4b,_0x461046){return new Promise(function(_0x5966cb,_0x2c892a){return client[_0x3675('0x4')](_0x2efb4b,_0x461046)['then'](function(_0x5aa21f){if(_0x5aa21f['error']){return _0x2c892a(_0x5aa21f[_0x3675('0x5')][_0x3675('0x6')]);}else{return _0x5966cb(_0x5aa21f[_0x3675('0x7')]);}})[_0x3675('0x8')](function(_0x154571){return _0x2c892a(_0x154571);});});}exports[_0x3675('0x9')]=function(){return request(_0x3675('0xa'),{'options':{'raw':![],'attributes':['id',_0x3675('0xb'),_0x3675('0xc')]}});};exports[_0x3675('0xd')]=function(_0xa191a5){return request(_0x3675('0xe'),{'options':{'raw':![],'where':{'name':_0xa191a5},'attributes':[_0x3675('0xc')]}});};exports[_0x3675('0xf')]=function(_0x5229bd){return request(_0x3675('0x10'),{'options':{'raw':![],'where':{'id':_0x5229bd},'include':[{'model':_0x3675('0x11'),'as':'Smtp','include':[{'model':_0x3675('0x12'),'as':_0x3675('0x12')}]}],'attributes':['id',_0x3675('0xb'),_0x3675('0x13')],'smtp':!![]}});};exports[_0x3675('0x14')]=function(_0x236556){return request(_0x3675('0xe'),{'options':{'where':{'id':_0x236556},'attributes':['name']}});};exports[_0x3675('0x15')]=function(_0x2de42d){return request(_0x3675('0x16'),{'options':{'where':{'id':_0x2de42d},'attributes':[_0x3675('0xb')]}});};exports['getVariableById']=function(_0x185f30){return request(_0x3675('0x17'),{'options':{'where':{'id':_0x185f30},'attributes':[_0x3675('0xb')]}});};exports[_0x3675('0x18')]=function(_0x510233){return request(_0x3675('0x19'),{'options':{'where':{'id':_0x510233},'attributes':[_0x3675('0x1a')]}});};exports[_0x3675('0x1b')]=function(_0x22e7ce){return request(_0x3675('0x1c'),{'options':{'where':{'id':_0x22e7ce},'attributes':['name']}});};exports[_0x3675('0x1d')]=function(_0x39a528){return request('GetContactByPhone',{'options':{'where':{'phone':_0x39a528[_0x3675('0x1e')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x49292b){return request(_0x3675('0x1f'),{'options':{'where':{'id':_0x49292b},'attributes':['name']}});};exports['getSoundById']=function(_0x3d1067){return request(_0x3675('0x20'),{'options':{'where':{'id':_0x3d1067},'attributes':[_0x3675('0x21')]}});};exports['getIntervalById']=function(_0x448515){return request(_0x3675('0x22'),{'options':{'raw':![],'where':{'id':_0x448515},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x129078){return request(_0x3675('0x23'),{'options':{'where':{'id':_0x129078},'attributes':['id',_0x3675('0xb')]}});};exports[_0x3675('0x24')]=function(_0x34f2cb){return request(_0x3675('0x25'),{'body':_0x34f2cb});};exports[_0x3675('0x26')]=function(_0x5ca335){return request(_0x3675('0x27'),{'body':_0x5ca335});};exports[_0x3675('0x28')]=function(_0x2a5ae8){return request('CreateSquareReport',{'body':_['merge'](_0x2a5ae8,{'project_name':_0x2a5ae8[_0x3675('0x29')],'prev_project_name':_0x2a5ae8[_0x3675('0x2a')]||'','is_subproject':_0x2a5ae8[_0x3675('0x2a')]?!![]:![],'leaveAt':moment()[_0x3675('0x2b')](_0x3675('0x2c'))})});};exports['createSquareRecording']=function(_0x49afa9){return request('CreateSquareRecording',{'body':_0x49afa9});};exports[_0x3675('0x2d')]=function(_0xe90019){return request('CreateSquareMessage',{'body':_0xe90019});};exports[_0x3675('0x2e')]=function(_0x1ec142){return request(_0x3675('0x2f'),{'options':{'raw':![],'where':{'phone':_0x1ec142[_0x3675('0x1e')],'ListId':_0x1ec142['ListId']}}})['then'](function(_0x3ab457){if(_0x3ab457){return _0x3ab457;}return request('CreateCmContact',{'body':_0x1ec142});});};exports[_0x3675('0x30')]=function(_0x279b80){return request('ShowPause',{'options':{'where':{'id':_0x279b80},'attributes':[_0x3675('0xb')]}});};exports['agentLogin']=function(_0x241dd2,_0x427ca7){return request(_0x3675('0x31'),{'body':{'interface':_0x427ca7},'options':{'where':_0x241dd2}});};exports[_0x3675('0x32')]=function(_0x5c7331,_0xd0a244,_0x19f602){return request('PauseUser',{'body':{'type':_0xd0a244,'uniqueid':_0x19f602},'options':{'where':_0x5c7331}});};exports[_0x3675('0x33')]=function(_0x150a77){return request(_0x3675('0x34'),{'body':{},'options':{'where':_0x150a77}});};exports['agentLogout']=function(_0x1878a9){return request(_0x3675('0x35'),{'body':{},'options':{'where':_0x1878a9}});}; \ No newline at end of file +var _0xe181=['getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','agentLogout','lodash','jayson/promise','client','http','then','error','message','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','ShowVoiceQueue'];(function(_0x4b7691,_0x217f00){var _0x1a402a=function(_0xa3f456){while(--_0xa3f456){_0x4b7691['push'](_0x4b7691['shift']());}};_0x1a402a(++_0x217f00);}(_0xe181,0x68));var _0x1e18=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0xe181[_0x7c0074];return _0x13e95b;};'use strict';var _=require(_0x1e18('0x0'));var moment=require('moment');var jayson=require(_0x1e18('0x1'));var client=jayson[_0x1e18('0x2')][_0x1e18('0x3')]({'port':0x2329});function request(_0x42ca76,_0x4206ba){return new Promise(function(_0x16e2c3,_0x3ec619){return client['request'](_0x42ca76,_0x4206ba)[_0x1e18('0x4')](function(_0x50253a){if(_0x50253a['error']){return _0x3ec619(_0x50253a[_0x1e18('0x5')][_0x1e18('0x6')]);}else{return _0x16e2c3(_0x50253a[_0x1e18('0x7')]);}})[_0x1e18('0x8')](function(_0x9f9541){return _0x3ec619(_0x9f9541);});});}exports[_0x1e18('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x1e18('0xa'),_0x1e18('0xb')]}});};exports[_0x1e18('0xc')]=function(_0x363da4){return request(_0x1e18('0xd'),{'options':{'raw':![],'where':{'name':_0x363da4},'attributes':[_0x1e18('0xb')]}});};exports['getMailAccountById']=function(_0x13f018){return request(_0x1e18('0xe'),{'options':{'raw':![],'where':{'id':_0x13f018},'include':[{'model':_0x1e18('0xf'),'as':_0x1e18('0x10'),'include':[{'model':_0x1e18('0x11'),'as':_0x1e18('0x11')}]}],'attributes':['id',_0x1e18('0xa'),_0x1e18('0x12')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x257c5d){return request('ShowSquareProject',{'options':{'where':{'id':_0x257c5d},'attributes':[_0x1e18('0xa')]}});};exports['getVoiceQueueById']=function(_0x404b7f){return request(_0x1e18('0x13'),{'options':{'where':{'id':_0x404b7f},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x14')]=function(_0x1687ba){return request(_0x1e18('0x15'),{'options':{'where':{'id':_0x1687ba},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x16')]=function(_0x134863){return request(_0x1e18('0x17'),{'options':{'where':{'id':_0x134863},'attributes':[_0x1e18('0x18')]}});};exports[_0x1e18('0x19')]=function(_0x349f3c){return request(_0x1e18('0x1a'),{'options':{'where':{'id':_0x349f3c},'attributes':[_0x1e18('0xa')]}});};exports['getContactByPhone']=function(_0x1c91d2){return request(_0x1e18('0x1b'),{'options':{'where':{'phone':_0x1c91d2[_0x1e18('0x1c')]},'attributes':['id']}});};exports[_0x1e18('0x1d')]=function(_0x2834ee){return request(_0x1e18('0x1e'),{'options':{'where':{'id':_0x2834ee},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x1f')]=function(_0x2e849d){return request(_0x1e18('0x20'),{'options':{'where':{'id':_0x2e849d},'attributes':[_0x1e18('0x21')]}});};exports[_0x1e18('0x22')]=function(_0x3c4fdf){return request(_0x1e18('0x23'),{'options':{'raw':![],'where':{'id':_0x3c4fdf},'include':[{'model':_0x1e18('0x24'),'as':_0x1e18('0x25')}]}});};exports[_0x1e18('0x26')]=function(_0x5eb6b4){return request(_0x1e18('0x27'),{'options':{'where':{'id':_0x5eb6b4},'attributes':['id',_0x1e18('0xa')]}});};exports[_0x1e18('0x28')]=function(_0x52d5e2){return request(_0x1e18('0x29'),{'body':_0x52d5e2});};exports[_0x1e18('0x2a')]=function(_0x477660){return request(_0x1e18('0x2b'),{'body':_0x477660});};exports['createSquareReport']=function(_0x48f0ff){return request(_0x1e18('0x2c'),{'body':_['merge'](_0x48f0ff,{'project_name':_0x48f0ff['arg_1'],'prev_project_name':_0x48f0ff['arg_2']||'','is_subproject':_0x48f0ff[_0x1e18('0x2d')]?!![]:![],'leaveAt':moment()[_0x1e18('0x2e')](_0x1e18('0x2f'))})});};exports[_0x1e18('0x30')]=function(_0x3a95c1){return request(_0x1e18('0x31'),{'body':_0x3a95c1});};exports[_0x1e18('0x32')]=function(_0x149cb6){return request(_0x1e18('0x33'),{'body':_0x149cb6});};exports[_0x1e18('0x34')]=function(_0x1015a3){return request(_0x1e18('0x35'),{'options':{'raw':![],'where':{'phone':_0x1015a3[_0x1e18('0x1c')],'ListId':_0x1015a3[_0x1e18('0x36')]}}})['then'](function(_0x57000b){if(_0x57000b){return _0x57000b;}return request('CreateCmContact',{'body':_0x1015a3});});};exports[_0x1e18('0x37')]=function(_0x1baf4f){return request(_0x1e18('0x38'),{'options':{'where':{'id':_0x1baf4f},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x39')]=function(_0x93dd11,_0x2d47c8){return request(_0x1e18('0x3a'),{'body':{'interface':_0x2d47c8},'options':{'where':_0x93dd11}});};exports['agentPause']=function(_0x27fdf7,_0xc7afe2,_0x5d4df9){return request(_0x1e18('0x3b'),{'body':{'type':_0xc7afe2,'uniqueid':_0x5d4df9},'options':{'where':_0x27fdf7}});};exports[_0x1e18('0x3c')]=function(_0x415d7b){return request('UnpauseUser',{'body':{},'options':{'where':_0x415d7b}});};exports[_0x1e18('0x3d')]=function(_0x5597ab){return request('LogoutUser',{'body':{},'options':{'where':_0x5597ab}});}; \ 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 827bfa5..1e47011 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 _0x7d9f=['./polly','./lex','exports'];(function(_0x4dfe12,_0x4ab2c0){var _0x4018e0=function(_0x59bc0e){while(--_0x59bc0e){_0x4dfe12['push'](_0x4dfe12['shift']());}};_0x4018e0(++_0x4ab2c0);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x3a376f,_0x4694fb){_0x3a376f=_0x3a376f-0x0;var _0x2cc9ae=_0x7d9f[_0x3a376f];return _0x2cc9ae;};var polly=require(_0xf7d9('0x0'));var lex=require(_0xf7d9('0x1'));module[_0xf7d9('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x254a=['./polly','./lex','exports'];(function(_0xa28845,_0x34f47a){var _0x3993f5=function(_0x38fed3){while(--_0x38fed3){_0xa28845['push'](_0xa28845['shift']());}};_0x3993f5(++_0x34f47a);}(_0x254a,0x138));var _0xa254=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x254a[_0x2aa0e7];return _0x1472c0;};var polly=require(_0xa254('0x0'));var lex=require(_0xa254('0x1'));module[_0xa254('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index c364e99..b87d575 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 _0xa75b=['./lib/api'];(function(_0x3743ae,_0xda4751){var _0x523dc2=function(_0x150da2){while(--_0x150da2){_0x3743ae['push'](_0x3743ae['shift']());}};_0x523dc2(++_0xda4751);}(_0xa75b,0x170));var _0xba75=function(_0x42cc40,_0x2d6320){_0x42cc40=_0x42cc40-0x0;var _0x264554=_0xa75b[_0x42cc40];return _0x264554;};'use strict';var lex=require(_0xba75('0x0'));module['exports']=function(_0x546e14,_0x10c0dd,_0x39dc19,_0x17b666,_0x3cde96,_0x1760c0){return lex(_0x546e14,_0x10c0dd,_0x39dc19,_0x17b666,_0x3cde96,_0x1760c0);}; \ No newline at end of file +var _0xf4eb=['./lib/api'];(function(_0x1dd78b,_0x213fd9){var _0x2d9bf6=function(_0x2c749a){while(--_0x2c749a){_0x1dd78b['push'](_0x1dd78b['shift']());}};_0x2d9bf6(++_0x213fd9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3343f4,_0x4d9c73){_0x3343f4=_0x3343f4-0x0;var _0x1d6dd6=_0xf4eb[_0x3343f4];return _0x1d6dd6;};'use strict';var lex=require(_0xbf4e('0x0'));module['exports']=function(_0x50f2fc,_0x479210,_0x5ed5b9,_0xbbbf01,_0x49d80e,_0x4e7fa7){return lex(_0x50f2fc,_0x479210,_0x5ed5b9,_0xbbbf01,_0x49d80e,_0x4e7fa7);}; \ 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 27b6fab..74e6bf0 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(_0x411677,_0x2257e7){var _0x4eb770=function(_0x31db88){while(--_0x31db88){_0x411677['push'](_0x411677['shift']());}};_0x4eb770(++_0x2257e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x10225b,_0x188022){var _0x13987a=function(_0x35c048){while(--_0x35c048){_0x10225b['push'](_0x10225b['shift']());}};_0x13987a(++_0x188022);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 d91914f..bead555 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 _0xc776=['./lib/api','exports'];(function(_0x291e73,_0x240beb){var _0x15a90f=function(_0x4bf236){while(--_0x4bf236){_0x291e73['push'](_0x291e73['shift']());}};_0x15a90f(++_0x240beb);}(_0xc776,0x1aa));var _0x6c77=function(_0x8ae6fd,_0x111f77){_0x8ae6fd=_0x8ae6fd-0x0;var _0xe7da4d=_0xc776[_0x8ae6fd];return _0xe7da4d;};'use strict';var polly=require(_0x6c77('0x0'));module[_0x6c77('0x1')]=function(_0x146314,_0x5611ac,_0x1eb39e,_0xd3985a,_0x307aa6,_0x53340f,_0xf338ff){return polly(_0x146314,_0x5611ac,_0x1eb39e,_0xd3985a,_0x307aa6,_0x53340f,_0xf338ff);}; \ No newline at end of file +var _0x9516=['./lib/api','exports'];(function(_0xcf6b84,_0x380ac5){var _0x5cf7d0=function(_0x80ff18){while(--_0x80ff18){_0xcf6b84['push'](_0xcf6b84['shift']());}};_0x5cf7d0(++_0x380ac5);}(_0x9516,0x15e));var _0x6951=function(_0x5acfde,_0x3596d4){_0x5acfde=_0x5acfde-0x0;var _0x123d61=_0x9516[_0x5acfde];return _0x123d61;};'use strict';var polly=require(_0x6951('0x0'));module[_0x6951('0x1')]=function(_0x2375ab,_0xec9a6b,_0x2945ba,_0xa98b21,_0x2cf6a4,_0x17ba26,_0x4cfe5a){return polly(_0x2375ab,_0xec9a6b,_0x2945ba,_0xa98b21,_0x2cf6a4,_0x17ba26,_0x4cfe5a);}; \ 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 83cb54d..1607e01 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 _0x4361=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x192921,_0x5a717e){var _0x9e347c=function(_0x2cab47){while(--_0x2cab47){_0x192921['push'](_0x192921['shift']());}};_0x9e347c(++_0x5a717e);}(_0x4361,0x127));var _0x1436=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x4361[_0x9df060];return _0x338dfe;};'use strict';var fs=require('fs');var path=require(_0x1436('0x0'));var BPromise=require(_0x1436('0x1'));var rs=require('randomstring');var AWS=require(_0x1436('0x2'));function pollyResult(_0x733b03,_0x17b344,_0x1b5e16){return new BPromise(function(_0x1d0c8c,_0x48bd5a){_0x733b03[_0x1436('0x3')](_0x17b344,function(_0x5caabe,_0x7b4b86){if(_0x5caabe){_0x48bd5a(_0x5caabe);}else if(_0x7b4b86){if(_0x7b4b86['AudioStream']instanceof Buffer){fs[_0x1436('0x4')](_0x1b5e16,_0x7b4b86['AudioStream'],function(_0x239a0b){if(_0x239a0b){_0x48bd5a(_0x239a0b);}else{_0x1d0c8c();}});}else{_0x48bd5a(new Error(_0x1436('0x5')));}}else{_0x48bd5a(new Error(_0x1436('0x6')));}});});}module[_0x1436('0x7')]=function(_0x54af2a,_0x5e8e64,_0x35fd9d,_0x383b05,_0x5a40de,_0x115ffb,_0x95f0ea){var _0xfb8bf8=new AWS['Polly']({'accessKeyId':_0x54af2a,'secretAccessKey':_0x5e8e64,'region':_0x35fd9d});var _0x26b4a4={'Text':_0x5a40de,'TextType':_0x115ffb||_0x1436('0x8'),'OutputFormat':_0x1436('0x9'),'VoiceId':_0x383b05};return pollyResult(_0xfb8bf8,_0x26b4a4,_0x95f0ea);}; \ No newline at end of file +var _0x4efd=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x3a8420,_0x1262e1){var _0x29c625=function(_0x5867f0){while(--_0x5867f0){_0x3a8420['push'](_0x3a8420['shift']());}};_0x29c625(++_0x1262e1);}(_0x4efd,0x127));var _0xd4ef=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4efd[_0x46aff0];return _0x9d78cf;};'use strict';var fs=require('fs');var path=require(_0xd4ef('0x0'));var BPromise=require('bluebird');var rs=require(_0xd4ef('0x1'));var AWS=require(_0xd4ef('0x2'));function pollyResult(_0x58817d,_0x2e5e2d,_0x4e60ea){return new BPromise(function(_0x112e68,_0x32ae03){_0x58817d[_0xd4ef('0x3')](_0x2e5e2d,function(_0x1fa16e,_0x1b62b6){if(_0x1fa16e){_0x32ae03(_0x1fa16e);}else if(_0x1b62b6){if(_0x1b62b6['AudioStream']instanceof Buffer){fs[_0xd4ef('0x4')](_0x4e60ea,_0x1b62b6[_0xd4ef('0x5')],function(_0x38a711){if(_0x38a711){_0x32ae03(_0x38a711);}else{_0x112e68();}});}else{_0x32ae03(new Error(_0xd4ef('0x6')));}}else{_0x32ae03(new Error(_0xd4ef('0x7')));}});});}module[_0xd4ef('0x8')]=function(_0x31006d,_0x29c0c9,_0x151897,_0x3d5975,_0x171353,_0x4f3949,_0x176cf2){var _0x2c81c0=new AWS[(_0xd4ef('0x9'))]({'accessKeyId':_0x31006d,'secretAccessKey':_0x29c0c9,'region':_0x151897});var _0x359a8f={'Text':_0x171353,'TextType':_0x4f3949||_0xd4ef('0xa'),'OutputFormat':_0xd4ef('0xb'),'VoiceId':_0x3d5975};return pollyResult(_0x2c81c0,_0x359a8f,_0x176cf2);}; \ 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 4983a12..bfae702 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 _0xc8d5=['./lib/api','exports'];(function(_0x32b7b9,_0x3de1e6){var _0x2c5a74=function(_0x3dba68){while(--_0x3dba68){_0x32b7b9['push'](_0x32b7b9['shift']());}};_0x2c5a74(++_0x3de1e6);}(_0xc8d5,0x140));var _0x5c8d=function(_0x35e54d,_0xa6e4f7){_0x35e54d=_0x35e54d-0x0;var _0x625d1d=_0xc8d5[_0x35e54d];return _0x625d1d;};'use strict';var asr=require(_0x5c8d('0x0'));module[_0x5c8d('0x1')]=function(_0x716ff1,_0x5643dc,_0x1b4096,_0x2d56a1){return asr(_0x716ff1,_0x5643dc,_0x1b4096);}; \ No newline at end of file +var _0xfc38=['./lib/api','exports'];(function(_0x28e5f7,_0x18ce28){var _0x1ba4de=function(_0x3775dd){while(--_0x3775dd){_0x28e5f7['push'](_0x28e5f7['shift']());}};_0x1ba4de(++_0x18ce28);}(_0xfc38,0x12a));var _0x8fc3=function(_0x499fa3,_0x5f9a57){_0x499fa3=_0x499fa3-0x0;var _0x27199c=_0xfc38[_0x499fa3];return _0x27199c;};'use strict';var asr=require(_0x8fc3('0x0'));module[_0x8fc3('0x1')]=function(_0x5272ae,_0x347581,_0x3f4957,_0x4cc519){return asr(_0x5272ae,_0x347581,_0x3f4957);}; \ 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 9570f10..b5760b1 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 _0x34e8=['string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x422919,_0xa42c22){var _0xaa3864=function(_0xb3943e){while(--_0xb3943e){_0x422919['push'](_0x422919['shift']());}};_0xaa3864(++_0xa42c22);}(_0x34e8,0x12c));var _0x834e=function(_0x3ea54c,_0x56820e){_0x3ea54c=_0x3ea54c-0x0;var _0x4e9b87=_0x34e8[_0x3ea54c];return _0x4e9b87;};'use strict';var url=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var fs=require('fs');var host=_0x834e('0x2');module[_0x834e('0x3')]=function(_0x530939,_0x832422,_0x21e2e0){return new BPromise(function(_0x472111,_0x31bf20){var _0x289ef2;if(typeof _0x530939!==_0x834e('0x4')||_0x530939[_0x834e('0x5')]===0x0){return _0x31bf20('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x832422!==_0x834e('0x4')||_0x832422['length']===0x0){return _0x31bf20(_0x834e('0x6'));}if(typeof _0x21e2e0!==_0x834e('0x7')&&(typeof _0x21e2e0!==_0x834e('0x4')||_0x21e2e0[_0x834e('0x5')]===0x0)){return _0x31bf20(_0x834e('0x8'));}try{_0x289ef2=fs[_0x834e('0x9')](_0x530939)[_0x834e('0xa')](_0x834e('0xb'));}catch(_0x3bdda9){return _0x31bf20(_0x3bdda9);}return _0x472111({'method':_0x834e('0xc'),'uri':host+_0x834e('0xd')+_0x832422,'body':{'config':{'encoding':_0x834e('0xe'),'sampleRateHertz':_0x834e('0xf'),'languageCode':_0x21e2e0},'audio':{'content':_0x289ef2}},'json':!![]});});}; \ No newline at end of file +var _0xa588=['8000','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','POST','LINEAR16'];(function(_0x26cf3d,_0x32bd6b){var _0x42d244=function(_0x901ec6){while(--_0x901ec6){_0x26cf3d['push'](_0x26cf3d['shift']());}};_0x42d244(++_0x32bd6b);}(_0xa588,0xe1));var _0x8a58=function(_0x31f207,_0x33353a){_0x31f207=_0x31f207-0x0;var _0x1089ef=_0xa588[_0x31f207];return _0x1089ef;};'use strict';var url=require('url');var BPromise=require(_0x8a58('0x0'));var fs=require('fs');var host=_0x8a58('0x1');module[_0x8a58('0x2')]=function(_0x11633d,_0x28a4e8,_0x2f8787){return new BPromise(function(_0x40bfe3,_0x88d792){var _0x40b4f0;if(typeof _0x11633d!=='string'||_0x11633d[_0x8a58('0x3')]===0x0){return _0x88d792(_0x8a58('0x4'));}if(typeof _0x28a4e8!==_0x8a58('0x5')||_0x28a4e8[_0x8a58('0x3')]===0x0){return _0x88d792(_0x8a58('0x6'));}if(typeof _0x2f8787!==_0x8a58('0x7')&&(typeof _0x2f8787!==_0x8a58('0x5')||_0x2f8787[_0x8a58('0x3')]===0x0)){return _0x88d792('lang\x20should\x20be\x20a\x20string');}try{_0x40b4f0=fs[_0x8a58('0x8')](_0x11633d)[_0x8a58('0x9')](_0x8a58('0xa'));}catch(_0x214351){return _0x88d792(_0x214351);}return _0x40bfe3({'method':_0x8a58('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x28a4e8,'body':{'config':{'encoding':_0x8a58('0xc'),'sampleRateHertz':_0x8a58('0xd'),'languageCode':_0x2f8787},'audio':{'content':_0x40b4f0}},'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 745f717..944b8e1 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 _0x6155=['exports','./asr'];(function(_0x425ecd,_0x37332e){var _0x5e4b55=function(_0x454a10){while(--_0x454a10){_0x425ecd['push'](_0x425ecd['shift']());}};_0x5e4b55(++_0x37332e);}(_0x6155,0x17d));var _0x5615=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x6155[_0x2d2c16];return _0x53f2fb;};var asr=require(_0x5615('0x0'));module[_0x5615('0x1')]={'asr':asr}; \ No newline at end of file +var _0x8c0c=['exports'];(function(_0x58d461,_0x116600){var _0x2bd2b0=function(_0x198f15){while(--_0x198f15){_0x58d461['push'](_0x58d461['shift']());}};_0x2bd2b0(++_0x116600);}(_0x8c0c,0x112));var _0xc8c0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8c0c[_0x4565bf];return _0x5610ba;};var asr=require('./asr');module[_0xc8c0('0x0')]={'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 721cfe0..bb5fc27 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 _0xb907=['googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','source','result','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','SessionsClient','detectIntent','action','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','name','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','text','channelData','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','parse','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','close','unlink','end','host','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','MP3','text:synthesize','POST','then','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','jQ1olc','stringify','generic','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','transcript','alternatives','join','map','confidence'];(function(_0x5f47ae,_0x2f01fb){var _0xd314a6=function(_0x33455c){while(--_0x33455c){_0x5f47ae['push'](_0x5f47ae['shift']());}};_0xd314a6(++_0x2f01fb);}(_0xb907,0x136));var _0x7b90=function(_0x42d185,_0x4571cd){_0x42d185=_0x42d185-0x0;var _0x2283c0=_0xb907[_0x42d185];return _0x2283c0;};'use strict';var apiai=require(_0x7b90('0x0'));var BPromise=require(_0x7b90('0x1'));var dialogflow=require(_0x7b90('0x2'));var fs=require('fs');var http=require(_0x7b90('0x3'));var https=require(_0x7b90('0x4'));var md5=require(_0x7b90('0x5'));var path=require(_0x7b90('0x6'));var querystring=require(_0x7b90('0x7'));var rp=require(_0x7b90('0x8'));var rs=require(_0x7b90('0x9'));var sox=require(_0x7b90('0xa'));var tts=require('google-tts-api');var urlParse=require('url')[_0x7b90('0xb')];var util=require('util');var aws=require('./aws');var google=require(_0x7b90('0xc'));var sestek=require(_0x7b90('0xd'));var tilde=require(_0x7b90('0xe'));var logger=require(_0x7b90('0xf'))('agi');var ISPEECH_API=_0x7b90('0x10');function downloadFile(_0x265018,_0x4fd741){return new BPromise(function(_0x4435dd,_0x1f78ac){var _0x36b4c2=urlParse(_0x265018);var _0x90f481=_0x36b4c2[_0x7b90('0x11')]==='https:'?https:http;var _0x34cdef={'host':_0x36b4c2['host'],'path':_0x36b4c2[_0x7b90('0x6')],'headers':{'user-agent':_0x7b90('0x12')}};_0x90f481[_0x7b90('0x13')](_0x34cdef,function(_0x1edc93){if(_0x1edc93[_0x7b90('0x14')]!==0xc8){logger[_0x7b90('0x15')]('request\x20to\x20'+_0x265018+_0x7b90('0x16')+_0x1edc93[_0x7b90('0x14')]+'\x20('+_0x1edc93[_0x7b90('0x17')]+')');_0x1f78ac(new Error(_0x7b90('0x18')+_0x265018+_0x7b90('0x16')+_0x1edc93[_0x7b90('0x14')]+'\x20('+_0x1edc93[_0x7b90('0x17')]+')'));return;}var _0xc5aa81=fs['createWriteStream'](_0x4fd741);_0xc5aa81['on'](_0x7b90('0x19'),function(){logger[_0x7b90('0x1a')]('finish\x20download\x20file');_0xc5aa81[_0x7b90('0x1b')](_0x4435dd);});_0xc5aa81['on']('error',function(_0x35b46e){fs[_0x7b90('0x1c')](_0x4fd741);logger['error']('download\x20error',_0x35b46e);_0x1f78ac(_0x35b46e);});_0x1edc93['pipe'](_0xc5aa81);})['on']('error',function(_0x35d37e){logger['error'](_0x35d37e);_0x1f78ac(_0x35d37e);})[_0x7b90('0x1d')]();});}function uploadFile(_0x2fab3c){return new BPromise(function(_0x485d25,_0x4cf97e){var _0x32ae31=urlParse(_0x2fab3c);var _0x4cf858=_0x32ae31[_0x7b90('0x11')]==='https:'?https:http;var _0x10a04e={'host':_0x32ae31[_0x7b90('0x1e')],'path':_0x32ae31[_0x7b90('0x6')],'headers':{'user-agent':_0x7b90('0x12')}};_0x4cf858[_0x7b90('0x13')](_0x10a04e,function(_0x2666be){if(_0x2666be[_0x7b90('0x14')]!==0xc8){_0x4cf97e(new Error('request\x20to\x20'+_0x2fab3c+_0x7b90('0x16')+_0x2666be[_0x7b90('0x14')]+'\x20('+_0x2666be[_0x7b90('0x17')]+')'));return;}var _0x52daf8='';_0x2666be['on']('data',function(_0x5f253c){_0x52daf8+=_0x5f253c;});_0x2666be['on'](_0x7b90('0x1d'),function(){_0x485d25(_0x52daf8);});})['on'](_0x7b90('0x15'),function(_0x39c9a8){_0x4cf97e(_0x39c9a8);})[_0x7b90('0x1d')]();});}function convertFile(_0x32e957,_0x20678c){return new BPromise(function(_0x4a1186,_0x120ead){var _0x288cad=sox[_0x7b90('0x1f')](_0x32e957,_0x20678c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x288cad['on'](_0x7b90('0x15'),function(_0xcd02bd){logger[_0x7b90('0x15')](_0x7b90('0x20'),_0xcd02bd);_0x120ead(_0xcd02bd);});_0x288cad['on'](_0x7b90('0x1d'),function(){logger[_0x7b90('0x1a')](_0x7b90('0x21'));_0x4a1186();});_0x288cad[_0x7b90('0x22')]();});}function base64Decode(_0x54999a,_0x468358){var _0x3351a7=path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+_0x7b90('0x26'));fs['writeFileSync'](_0x3351a7,_0x54999a,_0x7b90('0x27'));return convertFile(_0x3351a7,_0x468358)['then'](function(){try{fs['unlink'](_0x3351a7);fs[_0x7b90('0x28')](_0x468358,_0x7b90('0x29'));}catch(_0x832a3e){logger[_0x7b90('0x15')](_0x832a3e);}return _0x468358[_0x7b90('0x2a')]('.')[0x0];});}function base64Encode(_0x239b05){var _0x2a96e7=fs[_0x7b90('0x2b')](_0x239b05);return new Buffer(_0x2a96e7)[_0x7b90('0x2c')](_0x7b90('0x27'));}exports[_0x7b90('0x2d')]=function(_0x5cfd74,_0x36f54f,_0x1f2fca,_0x29489f,_0x4cb297,_0x4eaf86){var _0x3e4101,_0x5ac1aa;var _0x1bbca7='https://texttospeech.googleapis.com/v1/';var _0xd20efe=_0x7b90('0x2e')+_0x5cfd74;var _0x56fa03={};if(_0x36f54f===_0x7b90('0x2f')){_0x56fa03['input']={'ssml':_0x1f2fca};}else{_0x56fa03[_0x7b90('0x30')]={'text':_0x1f2fca};};_0x56fa03['voice']={'languageCode':_0x29489f,'ssmlGender':_0x4cb297};_0x56fa03['audioConfig']={'audioEncoding':_0x7b90('0x31'),'sampleRateHertz':0x1f40};var _0x3faa03={'url':_0x1bbca7+_0x7b90('0x32')+_0xd20efe,'method':_0x7b90('0x33'),'json':!![],'body':_0x56fa03};return rp(_0x3faa03)[_0x7b90('0x34')](function(_0x2572e8){return new BPromise(function(_0x34811d,_0x89cbe3){_0x3e4101=path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+_0x7b90('0x35'));var _0x1ca38a=Buffer[_0x7b90('0x36')](_0x2572e8[_0x7b90('0x37')],_0x7b90('0x27'));return fs[_0x7b90('0x38')](_0x3e4101,_0x1ca38a,function(_0xe7bf9b){_0x89cbe3(_0xe7bf9b);},function(_0x3652f9){fs[_0x7b90('0x28')](_0x3e4101,_0x7b90('0x29'));_0x34811d(_0x3652f9);});});})[_0x7b90('0x34')](function(_0x3479ec){_0x5ac1aa=path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+'.wav');return convertFile(_0x3e4101,_0x5ac1aa);})[_0x7b90('0x34')](function(){try{fs['unlink'](_0x3e4101);fs['chmodSync'](_0x5ac1aa,_0x7b90('0x29'));}catch(_0x5ae31b){logger[_0x7b90('0x15')](_0x5ae31b);}logger[_0x7b90('0x1a')](_0x7b90('0x39'),_0x5ac1aa[_0x7b90('0x2a')]('.')[0x0]);return _0x5ac1aa['split']('.')[0x0];});};exports[_0x7b90('0x3a')]=function(_0x5d1921,_0x1f8282){var _0x2c5379=_0x7b90('0x3b');var _0x148d9c,_0x4b3ef7;var _0x5733fb;var _0x174b8f={'encoding':'utf8','method':_0x7b90('0x33'),'timeout':0x2710,'url':_0x2c5379,'headers':{'Content-Type':_0x7b90('0x3c')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x7b90('0x3d'),JSON[_0x7b90('0x3e')]([_0x5d1921,_0x1f8282||'en',![],'null']),null,_0x7b90('0x3f')]]]))};return rp(_0x174b8f)['then'](function(_0x152921){try{_0x5733fb=eval(_0x152921['slice'](0x5))[0x0][0x2];}catch(_0x591e55){throw new Error(_0x7b90('0x40')+_0x152921[_0x7b90('0x41')]);}if(!_0x5733fb){if(_0x5d1921[_0x7b90('0x42')]>0xc8){throw new Error(_0x7b90('0x43'));}else{throw new Error('lang\x20\x22'+_0x1f8282+_0x7b90('0x44'));}}try{_0x5733fb=eval(_0x5733fb)[0x0];}catch(_0x1f5191){throw new Error(_0x7b90('0x40')+res[_0x7b90('0x41')]);}const _0x470b1c=_0x5733fb;_0x148d9c=path['resolve'](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+'.mp3');fs[_0x7b90('0x45')](_0x148d9c,_0x5733fb,{'encoding':_0x7b90('0x27')});_0x4b3ef7=path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+_0x7b90('0x26'));return convertFile(_0x148d9c,_0x4b3ef7);})[_0x7b90('0x34')](function(){try{fs['unlink'](_0x148d9c);fs[_0x7b90('0x28')](_0x4b3ef7,_0x7b90('0x29'));}catch(_0x8a2116){logger[_0x7b90('0x15')](_0x8a2116);}logger[_0x7b90('0x1a')](_0x7b90('0x46'),_0x4b3ef7[_0x7b90('0x2a')]('.')[0x0]);return _0x4b3ef7[_0x7b90('0x2a')]('.')[0x0];});};exports[_0x7b90('0x47')]=function(_0x5e1f55,_0xa5acb2,_0x2fee24){return google[_0x7b90('0x48')](_0x5e1f55,_0xa5acb2,_0x2fee24)['then'](function(_0x50700c){logger['info'](_0x50700c[_0x7b90('0x49')]);return rp(_0x50700c);})[_0x7b90('0x34')](function(_0x26273d){var _0x57173b='';var _0xb97fb8=0x0;try{fs[_0x7b90('0x1c')](_0x5e1f55);}catch(_0x523fa9){logger[_0x7b90('0x15')](_0x523fa9);}if(_0x26273d&&_0x26273d[_0x7b90('0x4a')]){_0x57173b=_0x26273d[_0x7b90('0x4a')]['map'](function(_0x487464){return _0x487464&&_0x487464['alternatives'][0x0]&&_0x487464['alternatives'][0x0][_0x7b90('0x4b')]?_0x487464[_0x7b90('0x4c')][0x0]['transcript']:'';})[_0x7b90('0x4d')]('\x0a');_0xb97fb8=_0x26273d['results'][_0x7b90('0x4e')](function(_0x5c50e5){return _0x5c50e5&&_0x5c50e5['alternatives'][0x0]&&_0x5c50e5[_0x7b90('0x4c')][0x0]['confidence']?_0x5c50e5[_0x7b90('0x4c')][0x0][_0x7b90('0x4f')]:0x0;})[_0x7b90('0x4d')]('\x0a');}logger['info'](_0x7b90('0x50'),_0x57173b);logger['info'](_0x7b90('0x51'),_0xb97fb8);return{'transcript':_0x57173b,'confidence':_0xb97fb8};})[_0x7b90('0x52')](function(_0x2cbd6f){logger[_0x7b90('0x15')]('[%s]\x20%s:%s',_0x2cbd6f[_0x7b90('0x14')],_0x2cbd6f['name'],_0x2cbd6f[_0x7b90('0x53')]);});};exports[_0x7b90('0x54')]=function(_0x1f7080,_0x44f5b7,_0x1ef840,_0x8f1bae){var _0xdae0b7=apiai(_0x44f5b7,{'language':_0x8f1bae||'en'});return _0xdae0b7['textRequest'](_0x1ef840,{'sessionId':md5(_0x1f7080)})[_0x7b90('0x34')](function(_0x108919){logger['info'](JSON[_0x7b90('0x3e')](_0x108919));return{'source':_0x108919['result'][_0x7b90('0x55')],'resolvedQuery':_0x108919[_0x7b90('0x56')][_0x7b90('0x57')],'action':_0x108919[_0x7b90('0x56')]['action'],'actionIncomplete':_0x108919['result'][_0x7b90('0x58')],'speech':_0x108919[_0x7b90('0x56')][_0x7b90('0x59')][_0x7b90('0x5a')],'score':_0x108919[_0x7b90('0x56')][_0x7b90('0x5b')],'statusCode':_0x108919[_0x7b90('0x5c')][_0x7b90('0x5d')],'endConversation':_0x108919[_0x7b90('0x56')][_0x7b90('0x5e')][_0x7b90('0x5f')]||![],'isFallbackIntent':_0x108919[_0x7b90('0x56')][_0x7b90('0x5e')]['isFallbackIntent']};});};exports[_0x7b90('0x60')]=function(_0x4adbc6,_0x18db3d,_0x4cfa7f,_0x5e288f,_0x462545,_0x585758){var _0x468088=_0x5e288f['replace'](/\\n/g,'\x0a');var _0x410747={'credentials':{'private_key':_0x468088,'client_email':_0x4cfa7f}};var _0x2c71c4=new dialogflow[(_0x7b90('0x61'))](_0x410747);var _0x551cce=_0x2c71c4['sessionPath'](_0x18db3d,md5(_0x4adbc6));var _0x5517d6={'session':_0x551cce,'queryInput':{'text':{'text':_0x462545,'languageCode':_0x585758}}};return _0x2c71c4[_0x7b90('0x62')](_0x5517d6)[_0x7b90('0x34')](function(_0xa3dcd3){if(_0xa3dcd3&&_0xa3dcd3[_0x7b90('0x42')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x7b90('0x3e')](_0xa3dcd3));var _0x53d2c0=_0xa3dcd3[0x0];if(_0x53d2c0){var _0x59d93f={'action':_0x53d2c0['queryResult'][_0x7b90('0x63')],'allRequiredParamsPresent':_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x65')],'endConversation':_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x66')]&&_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x66')][_0x7b90('0x67')]?_0x53d2c0[_0x7b90('0x64')]['diagnosticInfo'][_0x7b90('0x67')][_0x7b90('0x68')][_0x7b90('0x69')]:![],'fulfillmentText':_0x53d2c0[_0x7b90('0x64')]['fulfillmentText'],'intentName':_0x53d2c0[_0x7b90('0x64')]['intent'][_0x7b90('0x6a')],'intentDisplayName':_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x6b')]['displayName'],'isFallbackIntent':_0x53d2c0[_0x7b90('0x64')]['intent'][_0x7b90('0x6c')],'languageCode':_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x6d')],'queryText':_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x6e')],'responseId':_0x53d2c0[_0x7b90('0x6f')],'score':_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x70')],'speech':_0x53d2c0[_0x7b90('0x64')][_0x7b90('0x71')],'providerResponse':JSON['stringify'](_0xa3dcd3)};return _0x59d93f;}}});};exports['tildeASR']=function(_0x3af8f7,_0x36ed2c,_0x41ef58,_0x101f5a){return tilde[_0x7b90('0x48')](_0x3af8f7,_0x36ed2c,_0x41ef58,_0x101f5a)[_0x7b90('0x34')](function(_0x2460c9){try{fs[_0x7b90('0x1c')](_0x3af8f7);}catch(_0x50a0f5){logger[_0x7b90('0x15')](_0x50a0f5);}logger[_0x7b90('0x1a')](_0x7b90('0x72'),_0x2460c9['transcript']);logger[_0x7b90('0x1a')](_0x7b90('0x73'),_0x2460c9[_0x7b90('0x4f')]);return _0x2460c9;});};exports['awsPolly']=function(_0x4e1c0b,_0x18fbfa,_0xb7b5b3,_0x4b1189,_0x68540,_0x206e90){var _0x57b838=path['resolve'](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+_0x7b90('0x35'));var _0x286de3;return aws[_0x7b90('0x74')](_0x4e1c0b,_0x18fbfa,_0xb7b5b3,_0x4b1189,_0x68540,_0x206e90,_0x57b838)[_0x7b90('0x34')](function(){_0x286de3=path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+'.wav');return convertFile(_0x57b838,_0x286de3);})[_0x7b90('0x34')](function(){try{fs['unlink'](_0x57b838);fs['chmodSync'](_0x286de3,_0x7b90('0x29'));}catch(_0x6ee8c1){logger['error'](_0x6ee8c1);}return _0x286de3[_0x7b90('0x2a')]('.')[0x0];});};exports['awsLex']=function(_0x52e3db,_0x2ffa2c,_0x1fd56b,_0x28d9a1,_0x1613ce,_0x25eaa7){return aws[_0x7b90('0x75')](_0x52e3db,_0x2ffa2c,_0x1fd56b,_0x28d9a1,_0x1613ce,_0x25eaa7)[_0x7b90('0x34')](function(_0x574c5e){logger[_0x7b90('0x1a')](JSON[_0x7b90('0x3e')](_0x574c5e));return _0x574c5e;});};exports[_0x7b90('0x76')]=function(_0x5d3333,_0x380c93,_0x197e32,_0x338521){var _0x3264b8=util[_0x7b90('0x77')](_0x7b90('0x78'),ISPEECH_API,_0x5d3333,encodeURIComponent(_0x380c93),_0x197e32,_0x338521);var _0x3e6569=path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+'.mp3');var _0x2d8001;return downloadFile(_0x3264b8,_0x3e6569)[_0x7b90('0x34')](function(){_0x2d8001=path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+_0x7b90('0x26'));return convertFile(_0x3e6569,_0x2d8001);})[_0x7b90('0x34')](function(){try{fs['unlink'](_0x3e6569);fs[_0x7b90('0x28')](_0x2d8001,_0x7b90('0x29'));}catch(_0x48b8af){logger[_0x7b90('0x15')](_0x48b8af);}return _0x2d8001[_0x7b90('0x2a')]('.')[0x0];});};exports[_0x7b90('0x79')]=function(_0x3faf18,_0x3cac94,_0x149713,_0x4f72ca){var _0x1fcba2=util['format'](_0x7b90('0x7a'),ISPEECH_API,_0x3cac94,_0x149713,base64Encode(_0x3faf18),_0x4f72ca?util[_0x7b90('0x77')](_0x7b90('0x7b'),encodeURIComponent(_0x4f72ca)):'freeform=3');return uploadFile(_0x1fcba2)['then'](function(_0x559573){return querystring[_0x7b90('0xb')](_0x559573);});};exports['sestekNDA']=function(_0x7cdb5c,_0x2ce915){return sestek['nda'](_0x7cdb5c,_0x2ce915)[_0x7b90('0x34')](function(_0x464677){logger['info'](JSON[_0x7b90('0x3e')](_0x464677));var _0x2869ce={'speech':_0x464677[_0x7b90('0x7c')],'action':_0x464677[_0x7b90('0x7d')]?_0x464677[_0x7b90('0x7d')]['CustomAction']:undefined,'actiondata':_0x464677['channelData']?_0x464677[_0x7b90('0x7d')][_0x7b90('0x7e')]:undefined};if(_0x464677['channelData']&&_0x464677[_0x7b90('0x7d')][_0x7b90('0x7f')]){return base64Decode(_0x464677[_0x7b90('0x7d')]['AudioFromTts'][_0x7b90('0x80')],path[_0x7b90('0x23')](__dirname,_0x7b90('0x24'),rs[_0x7b90('0x25')](0x4)+'.wav'))[_0x7b90('0x34')](function(_0x16210c){_0x2869ce['audiofile']=_0x16210c;return _0x2869ce;});}return _0x2869ce;});};exports[_0x7b90('0x81')]=function(){return __dirname;}; \ No newline at end of file +var _0xcf30=['https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','message','googleDialogflow','result','source','actionIncomplete','fulfillment','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','queryResult','action','diagnosticInfo','fields','boolValue','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20transcription','confidence','awsPolly','polly','lex','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','randomstring','sox','google-tts-api','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','host','data','end','transcode','wav','error\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS'];(function(_0x6d09c7,_0x4d98be){var _0x533d77=function(_0x3b88f2){while(--_0x3b88f2){_0x6d09c7['push'](_0x6d09c7['shift']());}};_0x533d77(++_0x4d98be);}(_0xcf30,0x15e));var _0x0cf3=function(_0xd37f46,_0x3aabe3){_0xd37f46=_0xd37f46-0x0;var _0x23ffd5=_0xcf30[_0xd37f46];return _0x23ffd5;};'use strict';var apiai=require(_0x0cf3('0x0'));var BPromise=require(_0x0cf3('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x0cf3('0x2'));var https=require(_0x0cf3('0x3'));var md5=require(_0x0cf3('0x4'));var path=require(_0x0cf3('0x5'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x0cf3('0x6'));var sox=require(_0x0cf3('0x7'));var tts=require(_0x0cf3('0x8'));var urlParse=require('url')['parse'];var util=require(_0x0cf3('0x9'));var aws=require(_0x0cf3('0xa'));var google=require(_0x0cf3('0xb'));var sestek=require(_0x0cf3('0xc'));var tilde=require(_0x0cf3('0xd'));var logger=require('../../../config/logger')(_0x0cf3('0xe'));var ISPEECH_API=_0x0cf3('0xf');function downloadFile(_0x1bfa17,_0x101514){return new BPromise(function(_0x56884d,_0x1eb5a9){var _0xbdc56=urlParse(_0x1bfa17);var _0x55a547=_0xbdc56[_0x0cf3('0x10')]===_0x0cf3('0x11')?https:http;var _0xab2244={'host':_0xbdc56['host'],'path':_0xbdc56[_0x0cf3('0x5')],'headers':{'user-agent':_0x0cf3('0x12')}};_0x55a547[_0x0cf3('0x13')](_0xab2244,function(_0xb952e9){if(_0xb952e9[_0x0cf3('0x14')]!==0xc8){logger[_0x0cf3('0x15')](_0x0cf3('0x16')+_0x1bfa17+_0x0cf3('0x17')+_0xb952e9[_0x0cf3('0x14')]+'\x20('+_0xb952e9[_0x0cf3('0x18')]+')');_0x1eb5a9(new Error(_0x0cf3('0x16')+_0x1bfa17+_0x0cf3('0x17')+_0xb952e9[_0x0cf3('0x14')]+'\x20('+_0xb952e9['statusMessage']+')'));return;}var _0x332769=fs[_0x0cf3('0x19')](_0x101514);_0x332769['on'](_0x0cf3('0x1a'),function(){logger[_0x0cf3('0x1b')](_0x0cf3('0x1c'));_0x332769[_0x0cf3('0x1d')](_0x56884d);});_0x332769['on'](_0x0cf3('0x15'),function(_0x1c2cf1){fs[_0x0cf3('0x1e')](_0x101514);logger['error']('download\x20error',_0x1c2cf1);_0x1eb5a9(_0x1c2cf1);});_0xb952e9[_0x0cf3('0x1f')](_0x332769);})['on'](_0x0cf3('0x15'),function(_0x1194c4){logger[_0x0cf3('0x15')](_0x1194c4);_0x1eb5a9(_0x1194c4);})['end']();});}function uploadFile(_0x40dbb9){return new BPromise(function(_0x1d4ba7,_0x2ffe4c){var _0x463aa4=urlParse(_0x40dbb9);var _0x35b796=_0x463aa4['protocol']===_0x0cf3('0x11')?https:http;var _0x4271f5={'host':_0x463aa4[_0x0cf3('0x20')],'path':_0x463aa4[_0x0cf3('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x35b796[_0x0cf3('0x13')](_0x4271f5,function(_0x5938c7){if(_0x5938c7[_0x0cf3('0x14')]!==0xc8){_0x2ffe4c(new Error(_0x0cf3('0x16')+_0x40dbb9+'\x20failed,\x20status\x20code\x20=\x20'+_0x5938c7[_0x0cf3('0x14')]+'\x20('+_0x5938c7[_0x0cf3('0x18')]+')'));return;}var _0x5b5cbf='';_0x5938c7['on'](_0x0cf3('0x21'),function(_0x5ba6c8){_0x5b5cbf+=_0x5ba6c8;});_0x5938c7['on'](_0x0cf3('0x22'),function(){_0x1d4ba7(_0x5b5cbf);});})['on'](_0x0cf3('0x15'),function(_0x8f2215){_0x2ffe4c(_0x8f2215);})[_0x0cf3('0x22')]();});}function convertFile(_0x535997,_0x56582c){return new BPromise(function(_0x5bf2a1,_0x4d7f59){var _0x4be006=sox[_0x0cf3('0x23')](_0x535997,_0x56582c,{'sampleRate':0x1f40,'format':_0x0cf3('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4be006['on'](_0x0cf3('0x15'),function(_0xed230a){logger[_0x0cf3('0x15')](_0x0cf3('0x25'),_0xed230a);_0x4d7f59(_0xed230a);});_0x4be006['on']('end',function(){logger[_0x0cf3('0x1b')]('finish\x20to\x20convert');_0x5bf2a1();});_0x4be006[_0x0cf3('0x26')]();});}function base64Decode(_0x59dc2c,_0x5cb10c){var _0x2308d2=path[_0x0cf3('0x27')](__dirname,_0x0cf3('0x28'),rs[_0x0cf3('0x29')](0x4)+_0x0cf3('0x2a'));fs[_0x0cf3('0x2b')](_0x2308d2,_0x59dc2c,_0x0cf3('0x2c'));return convertFile(_0x2308d2,_0x5cb10c)[_0x0cf3('0x2d')](function(){try{fs[_0x0cf3('0x1e')](_0x2308d2);fs[_0x0cf3('0x2e')](_0x5cb10c,_0x0cf3('0x2f'));}catch(_0x243478){logger[_0x0cf3('0x15')](_0x243478);}return _0x5cb10c[_0x0cf3('0x30')]('.')[0x0];});}function base64Encode(_0x1682f5){var _0x2b180f=fs[_0x0cf3('0x31')](_0x1682f5);return new Buffer(_0x2b180f)[_0x0cf3('0x32')]('base64');}exports[_0x0cf3('0x33')]=function(_0x576abd,_0x13969b,_0x54354d,_0x25ae29,_0x2ea353,_0x5ad0f4){var _0x7e9faf,_0x21f6e4;var _0x429268=_0x0cf3('0x34');var _0x35e7b9=_0x0cf3('0x35')+_0x576abd;var _0x56f435={};if(_0x13969b===_0x0cf3('0x36')){_0x56f435['input']={'ssml':_0x54354d};}else{_0x56f435[_0x0cf3('0x37')]={'text':_0x54354d};};_0x56f435[_0x0cf3('0x38')]={'languageCode':_0x25ae29,'ssmlGender':_0x2ea353};_0x56f435[_0x0cf3('0x39')]={'audioEncoding':_0x0cf3('0x3a'),'sampleRateHertz':0x1f40};var _0x2fe333={'url':_0x429268+'text:synthesize'+_0x35e7b9,'method':_0x0cf3('0x3b'),'json':!![],'body':_0x56f435};return rp(_0x2fe333)['then'](function(_0x55147b){return new BPromise(function(_0x41ae9e,_0x111a88){_0x7e9faf=path[_0x0cf3('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x0cf3('0x3c'));var _0x2b0168=Buffer[_0x0cf3('0x3d')](_0x55147b[_0x0cf3('0x3e')],'base64');return fs[_0x0cf3('0x3f')](_0x7e9faf,_0x2b0168,function(_0x3ddd59){_0x111a88(_0x3ddd59);},function(_0x6308e2){fs[_0x0cf3('0x2e')](_0x7e9faf,'777');_0x41ae9e(_0x6308e2);});});})['then'](function(_0x56f1cd){_0x21f6e4=path[_0x0cf3('0x27')](__dirname,'tmp',rs[_0x0cf3('0x29')](0x4)+_0x0cf3('0x2a'));return convertFile(_0x7e9faf,_0x21f6e4);})[_0x0cf3('0x2d')](function(){try{fs[_0x0cf3('0x1e')](_0x7e9faf);fs[_0x0cf3('0x2e')](_0x21f6e4,_0x0cf3('0x2f'));}catch(_0x184e01){logger['error'](_0x184e01);}logger[_0x0cf3('0x1b')](_0x0cf3('0x40'),_0x21f6e4[_0x0cf3('0x30')]('.')[0x0]);return _0x21f6e4[_0x0cf3('0x30')]('.')[0x0];});};exports[_0x0cf3('0x41')]=function(_0x252c48,_0x119397){var _0x2d56be='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x4e185d,_0x1e1725;var _0x4c0460;var _0x1be2b4={'encoding':_0x0cf3('0x42'),'method':_0x0cf3('0x3b'),'timeout':0x2710,'url':_0x2d56be,'headers':{'Content-Type':_0x0cf3('0x43')},'body':_0x0cf3('0x44')+encodeURIComponent(JSON[_0x0cf3('0x45')]([[['jQ1olc',JSON[_0x0cf3('0x45')]([_0x252c48,_0x119397||'en',![],_0x0cf3('0x46')]),null,_0x0cf3('0x47')]]]))};return rp(_0x1be2b4)[_0x0cf3('0x2d')](function(_0x5f2e75){try{_0x4c0460=eval(_0x5f2e75[_0x0cf3('0x48')](0x5))[0x0][0x2];}catch(_0x235076){throw new Error(_0x0cf3('0x49')+_0x5f2e75[_0x0cf3('0x21')]);}if(!_0x4c0460){if(_0x252c48[_0x0cf3('0x4a')]>0xc8){throw new Error(_0x0cf3('0x4b'));}else{throw new Error(_0x0cf3('0x4c')+_0x119397+_0x0cf3('0x4d'));}}try{_0x4c0460=eval(_0x4c0460)[0x0];}catch(_0x48c387){throw new Error(_0x0cf3('0x49')+res[_0x0cf3('0x21')]);}const _0x474707=_0x4c0460;_0x4e185d=path[_0x0cf3('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x0cf3('0x3c'));fs[_0x0cf3('0x2b')](_0x4e185d,_0x4c0460,{'encoding':_0x0cf3('0x2c')});_0x1e1725=path[_0x0cf3('0x27')](__dirname,_0x0cf3('0x28'),rs[_0x0cf3('0x29')](0x4)+_0x0cf3('0x2a'));return convertFile(_0x4e185d,_0x1e1725);})['then'](function(){try{fs[_0x0cf3('0x1e')](_0x4e185d);fs['chmodSync'](_0x1e1725,_0x0cf3('0x2f'));}catch(_0x291def){logger['error'](_0x291def);}logger[_0x0cf3('0x1b')](_0x0cf3('0x4e'),_0x1e1725[_0x0cf3('0x30')]('.')[0x0]);return _0x1e1725[_0x0cf3('0x30')]('.')[0x0];});};exports[_0x0cf3('0x4f')]=function(_0x4dcd8a,_0x1fca65,_0x591c07){return google[_0x0cf3('0x50')](_0x4dcd8a,_0x1fca65,_0x591c07)[_0x0cf3('0x2d')](function(_0x50e283){logger['info'](_0x50e283[_0x0cf3('0x51')]);return rp(_0x50e283);})[_0x0cf3('0x2d')](function(_0x10aed6){var _0x104e3e='';var _0xa27fe8=0x0;try{fs['unlink'](_0x4dcd8a);}catch(_0x211795){logger['error'](_0x211795);}if(_0x10aed6&&_0x10aed6[_0x0cf3('0x52')]){_0x104e3e=_0x10aed6['results'][_0x0cf3('0x53')](function(_0x3a571b){return _0x3a571b&&_0x3a571b[_0x0cf3('0x54')][0x0]&&_0x3a571b[_0x0cf3('0x54')][0x0][_0x0cf3('0x55')]?_0x3a571b['alternatives'][0x0][_0x0cf3('0x55')]:'';})[_0x0cf3('0x56')]('\x0a');_0xa27fe8=_0x10aed6['results'][_0x0cf3('0x53')](function(_0x5cf5f9){return _0x5cf5f9&&_0x5cf5f9[_0x0cf3('0x54')][0x0]&&_0x5cf5f9['alternatives'][0x0]['confidence']?_0x5cf5f9['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x0cf3('0x1b')](_0x0cf3('0x57'),_0x104e3e);logger[_0x0cf3('0x1b')](_0x0cf3('0x58'),_0xa27fe8);return{'transcript':_0x104e3e,'confidence':_0xa27fe8};})['catch'](function(_0x381260){logger[_0x0cf3('0x15')](_0x0cf3('0x59'),_0x381260[_0x0cf3('0x14')],_0x381260['name'],_0x381260[_0x0cf3('0x5a')]);});};exports[_0x0cf3('0x5b')]=function(_0x125a76,_0x47f409,_0x4e8526,_0xdbbc95){var _0x2ff214=apiai(_0x47f409,{'language':_0xdbbc95||'en'});return _0x2ff214['textRequest'](_0x4e8526,{'sessionId':md5(_0x125a76)})[_0x0cf3('0x2d')](function(_0x1b1b08){logger[_0x0cf3('0x1b')](JSON[_0x0cf3('0x45')](_0x1b1b08));return{'source':_0x1b1b08[_0x0cf3('0x5c')][_0x0cf3('0x5d')],'resolvedQuery':_0x1b1b08[_0x0cf3('0x5c')]['resolvedQuery'],'action':_0x1b1b08['result']['action'],'actionIncomplete':_0x1b1b08[_0x0cf3('0x5c')][_0x0cf3('0x5e')],'speech':_0x1b1b08[_0x0cf3('0x5c')][_0x0cf3('0x5f')]['speech'],'score':_0x1b1b08[_0x0cf3('0x5c')][_0x0cf3('0x60')],'statusCode':_0x1b1b08['status'][_0x0cf3('0x61')],'endConversation':_0x1b1b08[_0x0cf3('0x5c')][_0x0cf3('0x62')][_0x0cf3('0x63')]||![],'isFallbackIntent':_0x1b1b08['result'][_0x0cf3('0x62')][_0x0cf3('0x64')]};});};exports[_0x0cf3('0x65')]=function(_0x27b452,_0x3eaf42,_0x50788c,_0x3a3cbd,_0x268604,_0x52542d){var _0x3c9de4=_0x3a3cbd[_0x0cf3('0x66')](/\\n/g,'\x0a');var _0x4be5a9={'credentials':{'private_key':_0x3c9de4,'client_email':_0x50788c}};var _0x49303e=new dialogflow[(_0x0cf3('0x67'))](_0x4be5a9);var _0x2fd6f6=_0x49303e['sessionPath'](_0x3eaf42,md5(_0x27b452));var _0x9edcdd={'session':_0x2fd6f6,'queryInput':{'text':{'text':_0x268604,'languageCode':_0x52542d}}};return _0x49303e[_0x0cf3('0x68')](_0x9edcdd)[_0x0cf3('0x2d')](function(_0x13c9e6){if(_0x13c9e6&&_0x13c9e6[_0x0cf3('0x4a')]){logger[_0x0cf3('0x1b')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x13c9e6));var _0xde7b08=_0x13c9e6[0x0];if(_0xde7b08){var _0x48fd0b={'action':_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x6a')],'allRequiredParamsPresent':_0xde7b08['queryResult']['allRequiredParamsPresent'],'endConversation':_0xde7b08['queryResult'][_0x0cf3('0x6b')]&&_0xde7b08[_0x0cf3('0x69')]['diagnosticInfo'][_0x0cf3('0x6c')]?_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x6b')][_0x0cf3('0x6c')]['end_conversation'][_0x0cf3('0x6d')]:![],'fulfillmentText':_0xde7b08[_0x0cf3('0x69')]['fulfillmentText'],'intentName':_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x6e')]['name'],'intentDisplayName':_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x6e')][_0x0cf3('0x6f')],'isFallbackIntent':_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x6e')][_0x0cf3('0x70')],'languageCode':_0xde7b08['queryResult'][_0x0cf3('0x71')],'queryText':_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x72')],'responseId':_0xde7b08['responseId'],'score':_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x73')],'speech':_0xde7b08[_0x0cf3('0x69')][_0x0cf3('0x74')],'providerResponse':JSON['stringify'](_0x13c9e6)};return _0x48fd0b;}}});};exports['tildeASR']=function(_0x37b436,_0x2aad05,_0x54966e,_0x582fae){return tilde[_0x0cf3('0x50')](_0x37b436,_0x2aad05,_0x54966e,_0x582fae)['then'](function(_0x270ffd){try{fs[_0x0cf3('0x1e')](_0x37b436);}catch(_0x265f14){logger[_0x0cf3('0x15')](_0x265f14);}logger[_0x0cf3('0x1b')](_0x0cf3('0x75'),_0x270ffd[_0x0cf3('0x55')]);logger[_0x0cf3('0x1b')]('Tilde\x20ASR\x20confidence',_0x270ffd[_0x0cf3('0x76')]);return _0x270ffd;});};exports[_0x0cf3('0x77')]=function(_0x33d19b,_0x2767a5,_0xcef961,_0x6540d4,_0x555fdc,_0x4f208d){var _0x44ee97=path[_0x0cf3('0x27')](__dirname,'tmp',rs[_0x0cf3('0x29')](0x4)+_0x0cf3('0x3c'));var _0x121fb6;return aws[_0x0cf3('0x78')](_0x33d19b,_0x2767a5,_0xcef961,_0x6540d4,_0x555fdc,_0x4f208d,_0x44ee97)[_0x0cf3('0x2d')](function(){_0x121fb6=path[_0x0cf3('0x27')](__dirname,_0x0cf3('0x28'),rs[_0x0cf3('0x29')](0x4)+'.wav');return convertFile(_0x44ee97,_0x121fb6);})[_0x0cf3('0x2d')](function(){try{fs[_0x0cf3('0x1e')](_0x44ee97);fs[_0x0cf3('0x2e')](_0x121fb6,'777');}catch(_0x370569){logger[_0x0cf3('0x15')](_0x370569);}return _0x121fb6[_0x0cf3('0x30')]('.')[0x0];});};exports['awsLex']=function(_0x11d08d,_0x5aa08f,_0x4ebae6,_0x428486,_0x224a7e,_0x1c50c){return aws[_0x0cf3('0x79')](_0x11d08d,_0x5aa08f,_0x4ebae6,_0x428486,_0x224a7e,_0x1c50c)[_0x0cf3('0x2d')](function(_0x43a190){logger[_0x0cf3('0x1b')](JSON['stringify'](_0x43a190));return _0x43a190;});};exports['ispeechTTS']=function(_0x168e4f,_0x3b1e9e,_0x3fe09a,_0x17e4f1){var _0x4da705=util[_0x0cf3('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x168e4f,encodeURIComponent(_0x3b1e9e),_0x3fe09a,_0x17e4f1);var _0x43c8d8=path['resolve'](__dirname,'tmp',rs[_0x0cf3('0x29')](0x4)+_0x0cf3('0x3c'));var _0x54484d;return downloadFile(_0x4da705,_0x43c8d8)[_0x0cf3('0x2d')](function(){_0x54484d=path[_0x0cf3('0x27')](__dirname,_0x0cf3('0x28'),rs['generate'](0x4)+_0x0cf3('0x2a'));return convertFile(_0x43c8d8,_0x54484d);})['then'](function(){try{fs[_0x0cf3('0x1e')](_0x43c8d8);fs[_0x0cf3('0x2e')](_0x54484d,_0x0cf3('0x2f'));}catch(_0x4ec08f){logger[_0x0cf3('0x15')](_0x4ec08f);}return _0x54484d[_0x0cf3('0x30')]('.')[0x0];});};exports[_0x0cf3('0x7b')]=function(_0x42aac3,_0x1489dc,_0x181be9,_0x23dfce){var _0x37c0fc=util['format'](_0x0cf3('0x7c'),ISPEECH_API,_0x1489dc,_0x181be9,base64Encode(_0x42aac3),_0x23dfce?util[_0x0cf3('0x7a')](_0x0cf3('0x7d'),encodeURIComponent(_0x23dfce)):'freeform=3');return uploadFile(_0x37c0fc)[_0x0cf3('0x2d')](function(_0x50c136){return querystring['parse'](_0x50c136);});};exports[_0x0cf3('0x7e')]=function(_0x283d39,_0x1dfc5c){return sestek[_0x0cf3('0x7f')](_0x283d39,_0x1dfc5c)[_0x0cf3('0x2d')](function(_0x579a26){logger['info'](JSON[_0x0cf3('0x45')](_0x579a26));var _0xa6833d={'speech':_0x579a26['text'],'action':_0x579a26[_0x0cf3('0x80')]?_0x579a26[_0x0cf3('0x80')]['CustomAction']:undefined,'actiondata':_0x579a26[_0x0cf3('0x80')]?_0x579a26[_0x0cf3('0x80')][_0x0cf3('0x81')]:undefined};if(_0x579a26[_0x0cf3('0x80')]&&_0x579a26['channelData'][_0x0cf3('0x82')]){return base64Decode(_0x579a26[_0x0cf3('0x80')]['AudioFromTts'][_0x0cf3('0x83')],path[_0x0cf3('0x27')](__dirname,_0x0cf3('0x28'),rs['generate'](0x4)+_0x0cf3('0x2a')))[_0x0cf3('0x2d')](function(_0x4c1e81){_0xa6833d[_0x0cf3('0x84')]=_0x4c1e81;return _0xa6833d;});}return _0xa6833d;});};exports[_0x0cf3('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 3b79ac4..7bc9d3f 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 _0x50dc=['exports'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x50dc,0x194));var _0xc50d=function(_0x198ac5,_0x249af4){_0x198ac5=_0x198ac5-0x0;var _0xef4b6f=_0x50dc[_0x198ac5];return _0xef4b6f;};var nda=require('./nda');module[_0xc50d('0x0')]={'nda':nda}; \ No newline at end of file +var _0x0523=['exports'];(function(_0x4eb272,_0x4a3ebd){var _0x34bed8=function(_0x5ef767){while(--_0x5ef767){_0x4eb272['push'](_0x4eb272['shift']());}};_0x34bed8(++_0x4a3ebd);}(_0x0523,0x1cc));var _0x3052=function(_0x440421,_0x55b4b4){_0x440421=_0x440421-0x0;var _0x3c64e2=_0x0523[_0x440421];return _0x3c64e2;};var nda=require('./nda');module[_0x3052('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index ce27fbf..48782ce 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 _0x34ab=['ndaactivity_type','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','channelData','CustomAction','body','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','ndauth_url','/token','password','then','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x34ab,0x169));var _0xb34a=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x34ab[_0x164af1];return _0x5d81a2;};'use strict';var rp=require(_0xb34a('0x0'));var url=require(_0xb34a('0x1'));var logger=require(_0xb34a('0x2'))(_0xb34a('0x3'));module[_0xb34a('0x4')]=function(_0x214cd9,_0x1927c8){var _0x104282={'method':'POST','uri':url['resolve'](_0x1927c8[_0xb34a('0x5')],_0xb34a('0x6')),'form':{'grant_type':_0xb34a('0x7'),'username':_0x1927c8['username'],'password':_0x1927c8[_0xb34a('0x7')]},'json':!![]};return rp(_0x104282)[_0xb34a('0x8')](function(_0x14c0d2){var _0xb915fb={'method':_0xb34a('0x9'),'uri':url[_0xb34a('0xa')](_0x1927c8[_0xb34a('0xb')],_0xb34a('0xc')),'body':{'type':_0x1927c8[_0xb34a('0xd')]||'message','channelId':_0xb34a('0xe'),'conversation':{'id':_0x214cd9[_0xb34a('0xf')]},'from':{'id':_0x214cd9[_0xb34a('0x10')],'name':_0x214cd9['calleridname']},'recipient':{'id':_0x214cd9[_0xb34a('0x11')],'name':_0x214cd9[_0xb34a('0x12')]},'text':_0x1927c8[_0xb34a('0x13')],'channelData':{}},'headers':{'Authorization':_0xb34a('0x14')+_0x14c0d2[_0xb34a('0x15')]},'json':!![]};if(_0x1927c8[_0xb34a('0x16')]){_0xb915fb['body']['channelData']['ProjectName']=_0x1927c8['project'];}if(_0x1927c8[_0xb34a('0x17')]=='1'){_0xb915fb['body']['channelData'][_0xb34a('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb34a('0x19')};}if(_0x1927c8[_0xb34a('0x1a')]){_0xb915fb['body'][_0xb34a('0x1b')][_0xb34a('0x1c')]=_0x1927c8[_0xb34a('0x1a')];if(_0x1927c8['custom_action_data']){_0xb915fb[_0xb34a('0x1d')]['channelData'][_0xb34a('0x1e')]=_0x1927c8[_0xb34a('0x1f')];}}logger[_0xb34a('0x20')](JSON[_0xb34a('0x21')](_0xb915fb));return rp(_0xb915fb);});}; \ No newline at end of file +var _0xeebe=['../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','dnid','extension','text','access_token','channelData','ProjectName','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise'];(function(_0x4d3835,_0x4f5f50){var _0x823439=function(_0x25a5c6){while(--_0x25a5c6){_0x4d3835['push'](_0x4d3835['shift']());}};_0x823439(++_0x4f5f50);}(_0xeebe,0xff));var _0xeeeb=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xeebe[_0x49ca18];return _0x145d54;};'use strict';var rp=require(_0xeeeb('0x0'));var url=require('url');var logger=require(_0xeeeb('0x1'))('agi');module[_0xeeeb('0x2')]=function(_0x1a1a35,_0xb434b3){var _0x427b94={'method':_0xeeeb('0x3'),'uri':url[_0xeeeb('0x4')](_0xb434b3[_0xeeeb('0x5')],_0xeeeb('0x6')),'form':{'grant_type':_0xeeeb('0x7'),'username':_0xb434b3[_0xeeeb('0x8')],'password':_0xb434b3[_0xeeeb('0x7')]},'json':!![]};return rp(_0x427b94)[_0xeeeb('0x9')](function(_0x41847e){var _0x1f88ea={'method':_0xeeeb('0x3'),'uri':url[_0xeeeb('0x4')](_0xb434b3[_0xeeeb('0xa')],_0xeeeb('0xb')),'body':{'type':_0xb434b3['ndaactivity_type']||'message','channelId':_0xeeeb('0xc'),'conversation':{'id':_0x1a1a35[_0xeeeb('0xd')]},'from':{'id':_0x1a1a35[_0xeeeb('0xe')],'name':_0x1a1a35['calleridname']},'recipient':{'id':_0x1a1a35[_0xeeeb('0xf')],'name':_0x1a1a35[_0xeeeb('0x10')]},'text':_0xb434b3[_0xeeeb('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x41847e[_0xeeeb('0x12')]},'json':!![]};if(_0xb434b3['project']){_0x1f88ea['body'][_0xeeeb('0x13')][_0xeeeb('0x14')]=_0xb434b3[_0xeeeb('0x15')];}if(_0xb434b3[_0xeeeb('0x16')]=='1'){_0x1f88ea[_0xeeeb('0x17')][_0xeeeb('0x13')][_0xeeeb('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xeeeb('0x19')};}if(_0xb434b3[_0xeeeb('0x1a')]){_0x1f88ea[_0xeeeb('0x17')][_0xeeeb('0x13')][_0xeeeb('0x1b')]=_0xb434b3[_0xeeeb('0x1a')];if(_0xb434b3[_0xeeeb('0x1c')]){_0x1f88ea[_0xeeeb('0x17')][_0xeeeb('0x13')][_0xeeeb('0x1d')]=_0xb434b3[_0xeeeb('0x1c')];}}logger[_0xeeeb('0x1e')](JSON[_0xeeeb('0x1f')](_0x1f88ea));return rp(_0x1f88ea);});}; \ 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 d5c2d7e..0e5193f 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 _0x4bab=['exports'];(function(_0x349ba9,_0x599864){var _0x3a4f46=function(_0x5f5036){while(--_0x5f5036){_0x349ba9['push'](_0x349ba9['shift']());}};_0x3a4f46(++_0x599864);}(_0x4bab,0xc8));var _0xb4ba=function(_0x53042c,_0xdd93a1){_0x53042c=_0x53042c-0x0;var _0x336089=_0x4bab[_0x53042c];return _0x336089;};'use strict';var asr=require('./lib/api');module[_0xb4ba('0x0')]=function(_0x2d8bea,_0x412c36,_0x19a41e,_0x9f6c16){return asr(_0x2d8bea,_0x412c36,_0x19a41e,_0x9f6c16);}; \ No newline at end of file +var _0x9936=['exports','./lib/api'];(function(_0x372718,_0x4d81d0){var _0x341bbc=function(_0x4b432f){while(--_0x4b432f){_0x372718['push'](_0x372718['shift']());}};_0x341bbc(++_0x4d81d0);}(_0x9936,0x101));var _0x6993=function(_0x30c95b,_0x5beb11){_0x30c95b=_0x30c95b-0x0;var _0xc5810c=_0x9936[_0x30c95b];return _0xc5810c;};'use strict';var asr=require(_0x6993('0x0'));module[_0x6993('0x1')]=function(_0x4a1a30,_0x5ba530,_0x2505b6,_0x166199){return asr(_0x4a1a30,_0x5ba530,_0x2505b6,_0x166199);}; \ 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 42215d3..300836e 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 _0x7b64=['Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','info'];(function(_0x28449d,_0x1a2dbe){var _0xf49aa0=function(_0x514f38){while(--_0x514f38){_0x28449d['push'](_0x28449d['shift']());}};_0xf49aa0(++_0x1a2dbe);}(_0x7b64,0x16b));var _0x47b6=function(_0x1da28a,_0x61ea02){_0x1da28a=_0x1da28a-0x0;var _0xecb88b=_0x7b64[_0x1da28a];return _0xecb88b;};'use strict';var BPromise=require(_0x47b6('0x0'));var _=require(_0x47b6('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x47b6('0x2'));var crypto=require('crypto');var logger=require(_0x47b6('0x3'))(_0x47b6('0x4'));module[_0x47b6('0x5')]=function(_0x4c24b7,_0x2efd4f,_0x48dc57,_0x4cf7b0){return new BPromise(function(_0x3dd278,_0x44f14c){logger[_0x47b6('0x6')](_0x47b6('0x7'),_0x4cf7b0||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x560660=new WebSocket(_0x4cf7b0||_0x47b6('0x8'),{'perMessageDeflate':![]});var _0x48e0a7='';var _0x4679d4='0';var _0x478244='1';var _0x5aefe5='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0xe14b36(_0x38a7a9){var _0x212e6c=crypto[_0x47b6('0x9')]('sha1');_0x212e6c['update'](_0x38a7a9);return _0x212e6c['digest'](_0x47b6('0xa'));}function _0x3618f7(){try{logger[_0x47b6('0x6')](_0x47b6('0xb'));var _0x2854d6=moment()['unix']();var _0xdbff33=_0xe14b36(_0x2854d6+_0x2efd4f+_0x48dc57);_0x560660[_0x47b6('0xc')](JSON[_0x47b6('0xd')]({'appID':_0x2efd4f,'timestamp':_0x2854d6,'appKey':_0xdbff33}));var _0x1bcab0=fs['createReadStream'](_0x4c24b7);_0x1bcab0['on'](_0x47b6('0xe'),function(_0x4e0ccb){_0x560660[_0x47b6('0xc')](_0x4e0ccb);});_0x1bcab0['on'](_0x47b6('0xf'),function(){_0x560660[_0x47b6('0xc')](_0x47b6('0x10'));});}catch(_0x5a99c3){logger[_0x47b6('0x11')](_0x47b6('0x12'),JSON[_0x47b6('0xd')](_0x5a99c3));_0x560660[_0x47b6('0x13')]();}}function _0x43d14c(_0x317630){try{if(_0x317630){var _0x4a5713=JSON[_0x47b6('0x14')](_0x317630);switch(_0x4a5713[_0x47b6('0x15')]){case 0x0:if(_0x4a5713['result']){if(_0x4a5713[_0x47b6('0x16')][_0x47b6('0x17')]){logger[_0x47b6('0x6')](_0x47b6('0x18'),JSON[_0x47b6('0xd')](_0x4a5713[_0x47b6('0x16')][_0x47b6('0x19')]));_0x48e0a7=_0x4a5713[_0x47b6('0x16')][_0x47b6('0x19')][0x0][_0x47b6('0x1a')];_0x4679d4=_0x4a5713[_0x47b6('0x16')]['hypotheses'][0x0][_0x47b6('0x1b')];_0x478244='0';_0x5aefe5='Success.';_0x560660[_0x47b6('0x13')]();}}break;case 0x1:logger[_0x47b6('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x478244='1';_0x5aefe5='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x47b6('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x478244='2';_0x5aefe5=_0x47b6('0x1c');break;case 0x9:logger[_0x47b6('0x6')](_0x47b6('0x1d'));_0x478244='9';_0x5aefe5=_0x47b6('0x1d');break;case 0xa:logger[_0x47b6('0x6')](_0x47b6('0x1e'));_0x478244='10';_0x5aefe5=_0x47b6('0x1e');break;case 0xb:logger[_0x47b6('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x478244='11';_0x5aefe5='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2065d5){logger[_0x47b6('0x11')](_0x47b6('0x1f'),JSON['stringify'](_0x2065d5));_0x560660[_0x47b6('0x13')]();}}function _0x5e51bd(){logger[_0x47b6('0x6')](_0x47b6('0x20'));_0x3dd278({'transcript':_0x48e0a7,'confidence':_0x4679d4,'status':_0x478244,'status_message':_0x5aefe5});}function _0xc77c84(_0x2aa94f){logger[_0x47b6('0x11')](_0x47b6('0x21'));if(!_[_0x47b6('0x22')](_0x2aa94f)){logger[_0x47b6('0x11')](_[_0x47b6('0x23')](_0x2aa94f)?JSON[_0x47b6('0xd')](_0x2aa94f):_0x2aa94f);}}_0x560660['on'](_0x47b6('0x24'),_0x3618f7);_0x560660['on']('message',_0x43d14c);_0x560660['on'](_0x47b6('0xf'),_0x5e51bd);_0x560660['on'](_0x47b6('0x11'),_0xc77c84);});}; \ No newline at end of file +var _0x0314=['result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','stringify','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','lodash','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse'];(function(_0x1db142,_0x2562b2){var _0x2b16ef=function(_0x46daa4){while(--_0x46daa4){_0x1db142['push'](_0x1db142['shift']());}};_0x2b16ef(++_0x2562b2);}(_0x0314,0x182));var _0x4031=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0314[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var _=require(_0x4031('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x4031('0x1'))(_0x4031('0x2'));module['exports']=function(_0x340b9c,_0xeec148,_0x13f6b9,_0x41fd2f){return new BPromise(function(_0x23611a,_0x59fe22){logger[_0x4031('0x3')](_0x4031('0x4'),_0x41fd2f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x83a987=new WebSocket(_0x41fd2f||_0x4031('0x5'),{'perMessageDeflate':![]});var _0x4953ff='';var _0x45ad12='0';var _0x5b7af7='1';var _0x32e2d8=_0x4031('0x6');function _0x2f5aab(_0x5a8e56){var _0x1f800e=crypto[_0x4031('0x7')](_0x4031('0x8'));_0x1f800e[_0x4031('0x9')](_0x5a8e56);return _0x1f800e[_0x4031('0xa')](_0x4031('0xb'));}function _0x476bdb(){try{logger[_0x4031('0x3')]('Open\x20Tilde\x20ASR\x20socket');var _0x50f52d=moment()[_0x4031('0xc')]();var _0x1e6f14=_0x2f5aab(_0x50f52d+_0xeec148+_0x13f6b9);_0x83a987[_0x4031('0xd')](JSON['stringify']({'appID':_0xeec148,'timestamp':_0x50f52d,'appKey':_0x1e6f14}));var _0x5e2829=fs['createReadStream'](_0x340b9c);_0x5e2829['on'](_0x4031('0xe'),function(_0xe05362){_0x83a987[_0x4031('0xd')](_0xe05362);});_0x5e2829['on'](_0x4031('0xf'),function(){_0x83a987[_0x4031('0xd')](_0x4031('0x10'));});}catch(_0x55f182){logger[_0x4031('0x11')](_0x4031('0x12'),JSON['stringify'](_0x55f182));_0x83a987[_0x4031('0x13')]();}}function _0x1abd41(_0x1d5c72){try{if(_0x1d5c72){var _0x4e6c36=JSON[_0x4031('0x14')](_0x1d5c72);switch(_0x4e6c36['status']){case 0x0:if(_0x4e6c36[_0x4031('0x15')]){if(_0x4e6c36['result']['final']){logger[_0x4031('0x3')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x4e6c36[_0x4031('0x15')][_0x4031('0x16')]));_0x4953ff=_0x4e6c36['result'][_0x4031('0x16')][0x0][_0x4031('0x17')];_0x45ad12=_0x4e6c36[_0x4031('0x15')][_0x4031('0x16')][0x0][_0x4031('0x18')];_0x5b7af7='0';_0x32e2d8=_0x4031('0x19');_0x83a987[_0x4031('0x13')]();}}break;case 0x1:logger[_0x4031('0x3')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5b7af7='1';_0x32e2d8=_0x4031('0x6');break;case 0x2:logger[_0x4031('0x3')](_0x4031('0x1a'));_0x5b7af7='2';_0x32e2d8=_0x4031('0x1a');break;case 0x9:logger[_0x4031('0x3')](_0x4031('0x1b'));_0x5b7af7='9';_0x32e2d8=_0x4031('0x1b');break;case 0xa:logger['info'](_0x4031('0x1c'));_0x5b7af7='10';_0x32e2d8=_0x4031('0x1c');break;case 0xb:logger[_0x4031('0x3')](_0x4031('0x1d'));_0x5b7af7='11';_0x32e2d8='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5b1e64){logger[_0x4031('0x11')](_0x4031('0x1e'),JSON[_0x4031('0x1f')](_0x5b1e64));_0x83a987[_0x4031('0x13')]();}}function _0x946480(){logger[_0x4031('0x3')](_0x4031('0x20'));_0x23611a({'transcript':_0x4953ff,'confidence':_0x45ad12,'status':_0x5b7af7,'status_message':_0x32e2d8});}function _0x58c178(_0x3b58ca){logger[_0x4031('0x11')](_0x4031('0x21'));if(!_[_0x4031('0x22')](_0x3b58ca)){logger[_0x4031('0x11')](_[_0x4031('0x23')](_0x3b58ca)?JSON[_0x4031('0x1f')](_0x3b58ca):_0x3b58ca);}}_0x83a987['on'](_0x4031('0x24'),_0x476bdb);_0x83a987['on']('message',_0x1abd41);_0x83a987['on'](_0x4031('0xf'),_0x946480);_0x83a987['on'](_0x4031('0x11'),_0x58c178);});}; \ 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 3091da3..9232159 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 _0xc765=['./asr'];(function(_0x2eea5c,_0x8b15de){var _0x177fc9=function(_0x39feee){while(--_0x39feee){_0x2eea5c['push'](_0x2eea5c['shift']());}};_0x177fc9(++_0x8b15de);}(_0xc765,0x1b7));var _0x5c76=function(_0x3c6662,_0x509e19){_0x3c6662=_0x3c6662-0x0;var _0x6cabcb=_0xc765[_0x3c6662];return _0x6cabcb;};var asr=require(_0x5c76('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x9606=['./asr','exports'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x9606,0x170));var _0x6960=function(_0x15c9e6,_0x14ed28){_0x15c9e6=_0x15c9e6-0x0;var _0x4909b6=_0x9606[_0x15c9e6];return _0x4909b6;};var asr=require(_0x6960('0x0'));module[_0x6960('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 41f8849..631ee14 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0xe51920,_0x4a1092){var _0x4e4c70=function(_0x71151){while(--_0x71151){_0xe51920['push'](_0xe51920['shift']());}};_0x4e4c70(++_0x4a1092);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 06d9645..84da9db 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 _0x6b20=['no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','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','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','success','math','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','recordFile','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','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','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','VOICEMAIL','mailbox','vswitch','util','lodash','odbc','moment','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','rpc','getVariable','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','agentPause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','en-US','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_secret_access_key','aws_lex_region','googleASR','tildeASR','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','setVariable','stringify','split','replaceAll','extra','getAndSetVariable','result','info','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','sync','retry','mrcpsynth','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','minutes','callback_priority','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','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_INPUT()','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x6b20,0xd1));var _0x06b2=function(_0x26dec7,_0x48587b){_0x26dec7=_0x26dec7-0x0;var _0xaf51e7=_0x6b20[_0x26dec7];return _0xaf51e7;};'use strict';var fs=require('fs');var util=require(_0x06b2('0x0'));var _=require(_0x06b2('0x1'));var sh=require('shelljs');var odbc=require(_0x06b2('0x2'))();var rs=require('randomstring');var moment=require(_0x06b2('0x3'));var Mustache=require(_0x06b2('0x4'));var rp=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var shared=require(_0x06b2('0x8'));var scripts=require(_0x06b2('0x9'));var FILES_PATH=_0x06b2('0xa');var recursiveMapAttributes=[_0x06b2('0xb'),_0x06b2('0xc')];var verticesWithRetry=['menu',_0x06b2('0xd'),_0x06b2('0xe')];var AGIVertices=function(_0x315223,_0x58538a,_0x37ace0){this['channel']=_0x315223;this[_0x06b2('0xf')]=_0x58538a;this['mailRpc']=_0x37ace0;};AGIVertices['prototype'][_0x06b2('0x10')]=function(_0x255cc5,_0x59fc97){this[_0x06b2('0xf')][_0x06b2('0x11')](_0x255cc5)[_0x06b2('0x12')](function(_0x368889){_0x59fc97(null,_0x368889?_0x368889[_0x06b2('0x13')]:![]);})[_0x06b2('0x14')](function(_0x3039c9){_0x59fc97(_0x3039c9);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x16')]=function(_0x28f9f3,_0xa81f11){this[_0x06b2('0xf')][_0x06b2('0x17')](_0x28f9f3)['then'](function(_0x325cde){_0xa81f11(null,_0x325cde?_0x325cde[_0x06b2('0x13')]:![]);})[_0x06b2('0x14')](function(_0x3830e9){_0xa81f11(_0x3830e9);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x18')]=function(_0x4b148c,_0x17e69b){this[_0x06b2('0xf')]['getSquareProjectById'](_0x4b148c)[_0x06b2('0x12')](function(_0x594b48){_0x17e69b(null,_0x594b48?_0x594b48['name']:![]);})[_0x06b2('0x14')](function(_0x1b4ab0){_0x17e69b(_0x1b4ab0);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x19')]=function(_0x4c4e21,_0x288801){this[_0x06b2('0xf')][_0x06b2('0x1a')](_0x4c4e21)[_0x06b2('0x12')](function(_0xe28985){_0x288801(null,_0xe28985?_0xe28985[_0x06b2('0x1b')]:![]);})[_0x06b2('0x14')](function(_0x5ca622){_0x288801(_0x5ca622);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1c')]=function(_0xb05f65,_0x208384){this['rpc']['getUserById'](_0xb05f65)[_0x06b2('0x12')](function(_0xb5231e){_0x208384(null,_0xb5231e?_0xb5231e['name']:![]);})[_0x06b2('0x14')](function(_0x5e40f2){_0x208384(_0x5e40f2);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1d')]=function(_0x2a0645,_0x593d3a){this[_0x06b2('0xf')][_0x06b2('0x1e')](_0x2a0645)[_0x06b2('0x12')](function(_0x1a94dc){_0x593d3a(null,_0x1a94dc?_0x1a94dc[_0x06b2('0x13')]:![]);})['catch'](function(_0xbb00ea){_0x593d3a(_0xbb00ea);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1f')]=function(_0x1a99c1,_0x1976ac){var _0x3e7cd4=this;this['rpc'][_0x06b2('0x20')](_0x1a99c1)[_0x06b2('0x12')](function(_0x2720fa){_0x1976ac(null,_0x2720fa?_0x3e7cd4[_0x06b2('0x21')](_0x2720fa[_0x06b2('0x22')]):![]);})[_0x06b2('0x14')](function(_0x3668bb){_0x1976ac(_0x3668bb);});};AGIVertices['prototype'][_0x06b2('0x23')]=function(_0x32eeea,_0x1637c2){this[_0x06b2('0xf')][_0x06b2('0x24')](_0x32eeea)[_0x06b2('0x12')](function(_0x401551){_0x1637c2(null,_0x401551?_0x401551:![]);})[_0x06b2('0x14')](function(_0x56d03e){_0x1637c2(_0x56d03e);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x25')]=function(_0x259e3d,_0x438c16,_0x7a7cd7){this[_0x06b2('0x26')][_0x06b2('0x25')](_0x259e3d,_0x438c16)['then'](function(){_0x7a7cd7(null);})['catch'](function(_0x9fd6ef){_0x7a7cd7(_0x9fd6ef);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x27')]=function(_0x47c930,_0x37c798){this[_0x06b2('0xf')][_0x06b2('0x28')](_0x47c930)[_0x06b2('0x12')](function(_0x29ff9d){if(_0x29ff9d){if(_0x29ff9d[_0x06b2('0x29')]){_0x37c798(null,[_0x29ff9d['interval']]);}else{_0x37c798(null,_[_0x06b2('0x2a')](_0x29ff9d[_0x06b2('0x2b')],_0x06b2('0x2c')));}}else{_0x37c798(null,![]);}})['catch'](function(_0x268780){_0x37c798(_0x268780);});};AGIVertices[_0x06b2('0x15')]['getSoundPath']=function(_0x45ea67){return util[_0x06b2('0x2d')](_0x06b2('0x2e'),FILES_PATH,_0x45ea67);};AGIVertices[_0x06b2('0x15')][_0x06b2('0x2f')]=function(_0x3e245e,_0x37b53c,_0x282424){odbc[_0x06b2('0x30')](_0x3e245e,function(_0x3c5b68){if(_0x3c5b68){logger[_0x06b2('0x31')](_0x06b2('0x32'),_0x3c5b68);_0x282424(_0x3c5b68);}else{logger['info'](_0x06b2('0x33'));odbc['query'](_0x37b53c,function(_0x4a4146,_0x44b967){if(_0x4a4146){logger['info'](_0x06b2('0x34'),_0x37b53c);_0x282424(_0x4a4146);}else{logger['info'](_0x06b2('0x35'),_0x37b53c);odbc[_0x06b2('0x36')](function(_0x16182c){if(_0x16182c){logger[_0x06b2('0x31')](_0x06b2('0x37'),_0x16182c);}_0x282424(null,_0x44b967);});}});}});};AGIVertices['prototype'][_0x06b2('0x38')]=function(_0xee3ec6,_0x4d5ebd){this[_0x06b2('0xf')][_0x06b2('0x39')](_0xee3ec6)[_0x06b2('0x12')](function(_0x5f2549){_0x4d5ebd(null,_0x5f2549?_0x5f2549:![]);})[_0x06b2('0x14')](function(_0x41e74e){_0x4d5ebd(_0x41e74e);});};AGIVertices['prototype']['createSmsMessage']=function(_0xe60af8,_0x251338){this[_0x06b2('0xf')][_0x06b2('0x3a')](_0xe60af8)[_0x06b2('0x12')](function(_0x1d174d){_0x251338(null,_0x1d174d);})[_0x06b2('0x14')](function(_0x2ff968){_0x251338(_0x2ff968);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x3b')]=function(_0x1d7750,_0xf9b9e,_0x3af451){this[_0x06b2('0xf')][_0x06b2('0x3b')]({'uniqueid':this[_0x06b2('0x3c')][_0x06b2('0x3d')],'node':_0x1d7750[_0x06b2('0x3e')],'application':_0x1d7750[_0x06b2('0x3f')],'data':_0xf9b9e||null,'project_name':this['channel'][_0x06b2('0x40')],'callerid':this[_0x06b2('0x3c')][_0x06b2('0x41')]})[_0x06b2('0x12')](function(_0x49cd88){if(_0x3af451){_0x3af451(null,_0x49cd88);}})[_0x06b2('0x14')](function(_0x3eaf58){if(_0x3af451){_0x3af451(_0x3eaf58);}});};AGIVertices['prototype'][_0x06b2('0x42')]=function(_0x2e3a85,_0x4bfe6b,_0x3ad4ff,_0xf342f9){this['rpc']['createSquareRecording']({'uniqueid':this['channel'][_0x06b2('0x3d')],'callerid':this[_0x06b2('0x3c')][_0x06b2('0x41')],'calleridname':this[_0x06b2('0x3c')][_0x06b2('0x43')],'context':this['channel']['context'],'extension':this[_0x06b2('0x3c')][_0x06b2('0x44')],'priority':this[_0x06b2('0x3c')][_0x06b2('0x45')],'accountcode':this[_0x06b2('0x3c')][_0x06b2('0x46')],'dnid':this['channel'][_0x06b2('0x47')],'projectName':this[_0x06b2('0x3c')][_0x06b2('0x40')],'saveName':_0x4bfe6b,'filename':_0x2e3a85[_0x06b2('0x48')]||_0x4bfe6b,'savePath':_0x3ad4ff})[_0x06b2('0x12')](function(_0x36a74a){_0xf342f9(null,_0x36a74a);})['catch'](function(_0x2cbdae){_0xf342f9(_0x2cbdae);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x49')]=function(_0x46920d,_0x487341,_0x281acc,_0x17d138,_0x463745){this[_0x06b2('0xf')]['createSquareMessage']({'uniqueid':this[_0x06b2('0x3c')][_0x06b2('0x3d')],'body':_0x46920d,'direction':_0x487341,'providerName':_0x281acc,'providerResponse':_0x17d138})[_0x06b2('0x12')](function(_0x26478c){if(_0x463745){_0x463745(null,_0x26478c);}})[_0x06b2('0x14')](function(_0x37c9cd){if(_0x463745){_0x463745(_0x37c9cd);}});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x4a')]=function(_0x568091,_0x33bc8e){this[_0x06b2('0xf')][_0x06b2('0x4a')]({'firstName':_[_0x06b2('0x4b')](_0x568091[_0x06b2('0x13')])||_[_0x06b2('0x4c')](_0x568091['name'])?'callback_'+Math[_0x06b2('0x4d')]():_0x568091['name'],'lastName':_['isEmpty'](_0x568091[_0x06b2('0x4e')])||_['isNil'](_0x568091[_0x06b2('0x4e')])?null:_0x568091[_0x06b2('0x4e')],'phone':_0x568091[_0x06b2('0x4f')],'ListId':_0x568091[_0x06b2('0x50')],'scheduledat':_0x568091[_0x06b2('0x51')],'callbackUniqueid':this[_0x06b2('0x3c')][_0x06b2('0x3d')],'tags':_0x06b2('0x52'),'description':_0x06b2('0x53')+_0x568091[_0x06b2('0x51')]['toString'](),'priority':_0x568091['callback_priority']})[_0x06b2('0x12')](function(_0x46e4b9){_0x33bc8e(null,_0x46e4b9);})['catch'](function(_0x425dea){_0x33bc8e(_0x425dea);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x54')]=function(_0x36f2a8,_0x5d725f){this['rpc']['getPauseById'](_0x36f2a8)[_0x06b2('0x12')](function(_0x594dbe){_0x5d725f(null,_0x594dbe?_0x594dbe['name']:![]);})[_0x06b2('0x14')](function(_0x30b773){_0x5d725f(_0x30b773);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x55')]=function(_0x2b2de5,_0x388d8b,_0x513650){var _0x119096={'role':_0x06b2('0x56')};_0x119096[_0x2b2de5]=this['channel'][_0x06b2('0x41')];this[_0x06b2('0xf')][_0x06b2('0x55')](_0x119096,_0x388d8b,this[_0x06b2('0x3c')][_0x06b2('0x3d')])[_0x06b2('0x12')](function(_0x285faf){_0x513650(null,_[_0x06b2('0x4c')](_0x285faf)?![]:!![]);})[_0x06b2('0x14')](function(_0x33dd97){logger[_0x06b2('0x31')](_0x33dd97);_0x513650(null,![]);});};AGIVertices[_0x06b2('0x15')]['agentUnpause']=function(_0x3bde5d,_0x188dcc){var _0x514472={'role':_0x06b2('0x56')};_0x514472[_0x3bde5d]=this[_0x06b2('0x3c')][_0x06b2('0x41')];this[_0x06b2('0xf')]['agentUnpause'](_0x514472)[_0x06b2('0x12')](function(_0x3ae0dd){_0x188dcc(null,_[_0x06b2('0x4c')](_0x3ae0dd)?![]:!![]);})['catch'](function(_0x2e376f){logger[_0x06b2('0x31')](_0x2e376f);_0x188dcc(null,![]);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x57')]=function(_0x3a895d,_0x43b907){var _0x1aae55={'role':_0x06b2('0x56')};_0x1aae55[_0x3a895d]=this[_0x06b2('0x3c')]['callerid'];this['rpc']['agentLogout'](_0x1aae55)['then'](function(_0x41a4b8){_0x43b907(null,_['isNil'](_0x41a4b8)?![]:!![]);})[_0x06b2('0x14')](function(_0x3f3f5e){logger[_0x06b2('0x31')](_0x3f3f5e);_0x43b907(null,![]);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x58')]=function(_0x378547,_0x5cd18d){var _0x57e00d={'role':_0x06b2('0x56')};_0x57e00d[_0x378547]=this[_0x06b2('0x3c')]['callerid'];var _0x8a3745=_0x378547!=_0x06b2('0x59')?util[_0x06b2('0x2d')](_0x06b2('0x5a'),_0x06b2('0x5b'),this[_0x06b2('0x3c')]['callerid']):undefined;this[_0x06b2('0xf')]['agentLogin'](_0x57e00d,_0x8a3745)[_0x06b2('0x12')](function(_0x3874da){_0x5cd18d(null,_[_0x06b2('0x4c')](_0x3874da)?![]:!![]);})['catch'](function(_0x2a5e58){logger[_0x06b2('0x31')](_0x2a5e58);_0x5cd18d(null,![]);});};AGIVertices[_0x06b2('0x15')]['shellCommand']=function(_0xc1010,_0x4900d2){sh[_0x06b2('0x5c')](_[_0x06b2('0x5d')](_0xc1010),function(_0x215b25,_0x2957db){var _0x2761a6=_0x2957db[_0x06b2('0x5e')](/(\r\n|\n|\r)/gm,'');_0x4900d2(null,_0x2761a6);});};AGIVertices['prototype'][_0x06b2('0x5f')]=function(_0x711305,_0x8c916e){scripts[_0x06b2('0x5f')](_0x711305['apiKey'],_0x711305[_0x06b2('0x60')]||_0x06b2('0x61'),_0x711305[_0x06b2('0x61')],_0x711305['languageCode']||'en-US',_0x711305[_0x06b2('0x62')]||'MALE',_0x711305[_0x06b2('0x63')]||'MP3')['then'](function(_0x691547){_0x8c916e(null,_0x691547);})[_0x06b2('0x14')](function(_0x4b17d8){_0x8c916e(_0x4b17d8);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x64')]=function(_0x206d66,_0x305c36){scripts[_0x06b2('0x64')](_0x206d66[_0x06b2('0x61')],_0x206d66[_0x06b2('0x65')]||'en',0x1)[_0x06b2('0x12')](function(_0x3018c7){_0x305c36(null,_0x3018c7);})[_0x06b2('0x14')](function(_0x2b16a4){_0x305c36(_0x2b16a4);});};AGIVertices['prototype'][_0x06b2('0x66')]=function(_0x4be314,_0x4a606b){var _0x3257b9={'uri':_0x4be314[_0x06b2('0x67')],'method':_0x4be314['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4be314[_0x06b2('0x68')])===_0x06b2('0x69')&&parseInt(_0x4be314[_0x06b2('0x68')])>=0x1?parseInt(_0x4be314['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x06b2('0x6a')]([_0x06b2('0x6b'),'PUT'],_0x3257b9['method']['toUpperCase']())){try{_0x3257b9['body']=_0x4be314[_0x06b2('0xc')]?JSON['parse'](_0x4be314[_0x06b2('0xc')]):{};}catch(_0x41e050){logger[_0x06b2('0x31')](_0x06b2('0x6c'),_0x41e050);}}try{_0x3257b9[_0x06b2('0x6d')]=_0x4be314[_0x06b2('0xb')]?JSON[_0x06b2('0x6e')](_0x4be314[_0x06b2('0xb')]):{};}catch(_0x12b682){logger[_0x06b2('0x31')](_0x06b2('0x6f'),_0x12b682);}if(_0x4be314[_0x06b2('0x70')]){try{var _0x2c2552=require(_0x4be314['computedVariables'])['sync'](this,_0x3257b9);_0x3257b9[_0x06b2('0x71')]=Mustache[_0x06b2('0x72')](_0x4be314[_0x06b2('0x67')],_0x2c2552,{},['$$','$$']);if(_0x3257b9[_0x06b2('0x6d')]){_0x3257b9[_0x06b2('0x6d')]=JSON[_0x06b2('0x6e')](Mustache['render'](JSON['stringify'](_0x3257b9[_0x06b2('0x6d')]),_0x2c2552,{},['$$','$$']));}if(_0x3257b9[_0x06b2('0x73')]){_0x3257b9[_0x06b2('0x73')]=JSON[_0x06b2('0x6e')](Mustache[_0x06b2('0x72')](JSON['stringify'](_0x3257b9[_0x06b2('0x73')]),_0x2c2552,{},['$$','$$']));}}catch(_0x5569e7){logger['error'](_0x06b2('0x74'),_0x5569e7);}}rp(_0x3257b9)[_0x06b2('0x12')](function(_0x52393b){var _0x5a047c={'statusCode':_0x52393b[_0x06b2('0x75')]||0xc8,'statusMessage':_0x52393b[_0x06b2('0x76')]||'OK','headers':_0x52393b['headers']||{},'body':_0x52393b['body']||{}};_0x4a606b(null,_0x5a047c);})['catch'](function(_0x512415){var _0x3913cb={'statusCode':_0x512415[_0x06b2('0x75')]||0x1f4,'statusMessage':_0x512415[_0x06b2('0x77')]||_0x06b2('0x78'),'headers':_0x512415[_0x06b2('0x79')][_0x06b2('0x6d')]||{},'body':_0x512415[_0x06b2('0x79')][_0x06b2('0x73')]||{}};_0x4a606b(null,_0x3913cb);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x7a')]=function(_0x15eb9a,_0x103ee5){scripts[_0x06b2('0x7a')](this[_0x06b2('0x3c')][_0x06b2('0x3d')],_0x15eb9a[_0x06b2('0x7b')],_0x15eb9a[_0x06b2('0x61')],_0x15eb9a[_0x06b2('0x7c')]||'en')[_0x06b2('0x12')](function(_0x3c74ef){_0x103ee5(null,_0x3c74ef);})[_0x06b2('0x14')](function(_0x7ddad4){_0x103ee5(_0x7ddad4);});};AGIVertices['prototype'][_0x06b2('0x7d')]=function(_0x41734d,_0xe302e0){scripts[_0x06b2('0x7d')](this[_0x06b2('0x3c')][_0x06b2('0x3d')],_0x41734d['dialogflowV2_project_id'],_0x41734d[_0x06b2('0x7e')],_0x41734d[_0x06b2('0x7f')],_0x41734d[_0x06b2('0x61')],_0x41734d[_0x06b2('0x80')]||'en')['then'](function(_0x13d0b9){_0xe302e0(null,_0x13d0b9);})[_0x06b2('0x14')](function(_0x5af6c5){_0xe302e0(_0x5af6c5);});};AGIVertices['prototype'][_0x06b2('0x81')]=function(_0x6be0ff,_0x243c9f){scripts[_0x06b2('0x81')](this[_0x06b2('0x3c')],_0x6be0ff)[_0x06b2('0x12')](function(_0x1f5ad9){_0x243c9f(null,_0x1f5ad9);})['catch'](function(_0x1eff66){_0x243c9f(_0x1eff66);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x82')]=function(_0x4a120c,_0x2e7003){scripts[_0x06b2('0x82')](_0x4a120c['key'],_0x4a120c[_0x06b2('0x61')],_0x4a120c[_0x06b2('0x83')]||'en-US',_0x4a120c[_0x06b2('0x84')])['then'](function(_0x38b058){_0x2e7003(null,_0x38b058);})[_0x06b2('0x14')](function(_0x59edd3){_0x2e7003(_0x59edd3);});};AGIVertices[_0x06b2('0x15')]['ispeechASR']=function(_0x3c1890,_0x26c08d,_0x59acb9){scripts[_0x06b2('0x85')](_0x26c08d,_0x3c1890[_0x06b2('0x7b')],_0x3c1890['ispeech_asr_language']||_0x06b2('0x86'),this['isConfigured'](_0x3c1890[_0x06b2('0x87')])?_0x3c1890[_0x06b2('0x87')]:undefined)['then'](function(_0x50886d){_0x59acb9(null,_0x50886d);})[_0x06b2('0x14')](function(_0x35c66e){_0x59acb9(_0x35c66e);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x88')]=function(_0x277814,_0x3ef258){scripts[_0x06b2('0x88')](_0x277814['aws_access_key_id'],_0x277814['aws_secret_access_key'],_0x277814[_0x06b2('0x89')],_0x277814[_0x06b2('0x8a')]||_0x06b2('0x8b'),_0x277814['text'],_0x277814['aws_text_type']||_0x06b2('0x61'))[_0x06b2('0x12')](function(_0x2aabf7){_0x3ef258(null,_0x2aabf7);})[_0x06b2('0x14')](function(_0x4c6c39){_0x3ef258(_0x4c6c39);});};AGIVertices['prototype'][_0x06b2('0x8c')]=function(_0xea6166,_0x1e00c0){scripts[_0x06b2('0x8c')](this[_0x06b2('0x3c')][_0x06b2('0x3d')],_0xea6166['aws_access_key_id'],_0xea6166[_0x06b2('0x8d')],_0xea6166[_0x06b2('0x8e')],_0xea6166[_0x06b2('0x61')],_0xea6166['aws_bot_name'])[_0x06b2('0x12')](function(_0x2777d7){_0x1e00c0(null,_0x2777d7);})['catch'](function(_0x743ec1){_0x1e00c0(_0x743ec1);});};AGIVertices['prototype'][_0x06b2('0x8f')]=function(_0x56c84d,_0x100d79,_0x43505b){scripts['googleASR'](_0x100d79,_0x56c84d[_0x06b2('0x7b')],_0x56c84d['google_asr_language']||_0x06b2('0x86'))['then'](function(_0x3c606c){_0x43505b(null,_0x3c606c);})[_0x06b2('0x14')](function(_0x201269){_0x43505b(_0x201269);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x90')]=function(_0x2bc9b0,_0x35e547,_0x31c855){scripts['tildeASR'](_0x35e547,_0x2bc9b0['appid'],_0x2bc9b0[_0x06b2('0x91')],_0x2bc9b0[_0x06b2('0x71')])[_0x06b2('0x12')](function(_0x52a892){_0x31c855(null,_0x52a892);})[_0x06b2('0x14')](function(_0x267a6d){_0x31c855(_0x267a6d);});};AGIVertices[_0x06b2('0x15')][_0x06b2('0x92')]=function(_0x5073e0){var _0x4dd847=_[_0x06b2('0x6a')](verticesWithRetry,_0x5073e0[_0x06b2('0x3f')])?_0x5073e0:_['clone'](_0x5073e0);for(var _0x5bac61 in _0x4dd847){if(_0x4dd847[_0x06b2('0x93')](_0x5bac61)){if(_0x4dd847[_0x5bac61]&&_[_0x06b2('0x94')](_0x4dd847[_0x5bac61])){if(_[_0x06b2('0x6a')](recursiveMapAttributes,_0x5bac61)){_0x4dd847[_0x5bac61]=this[_0x06b2('0x95')](_0x4dd847[_0x5bac61]);}else{_0x4dd847[_0x5bac61]=this[_0x06b2('0x96')](_0x4dd847[_0x5bac61]);}}}}return _0x4dd847;};AGIVertices[_0x06b2('0x15')][_0x06b2('0x97')]=function(_0x4e4622){for(var _0x455adb in _0x4e4622){if(_0x4e4622['hasOwnProperty'](_0x455adb)){if(_[_0x06b2('0x98')](_0x4e4622[_0x455adb])){this[_0x06b2('0x97')](_0x4e4622[_0x455adb]);}else if(_[_0x06b2('0x99')](_0x4e4622[_0x455adb])){for(var _0x320c38=0x0;_0x320c38<_0x4e4622[_0x455adb]['length'];_0x320c38++){this[_0x06b2('0x97')](_0x4e4622[_0x455adb][_0x320c38]);}}else if(_['isString'](_0x4e4622[_0x455adb])){_0x4e4622[_0x455adb]=this[_0x06b2('0x96')](_0x4e4622[_0x455adb]);}}}};AGIVertices[_0x06b2('0x15')][_0x06b2('0x9a')]=function(_0x1c8c4f,_0x385196){for(var _0xcad64e in _0x1c8c4f){if(_0x1c8c4f[_0x06b2('0x93')](_0xcad64e)){if(_['isPlainObject'](_0x1c8c4f[_0xcad64e])){if(!_['isEmpty'](_0x1c8c4f[_0xcad64e])){this['saveRestApiResult'](_0x1c8c4f[_0xcad64e],util['format'](_0x06b2('0x9b'),_0x385196,_0xcad64e));}}else if(_['isArray'](_0x1c8c4f[_0xcad64e])){for(var _0x3ee328=0x0;_0x3ee328<_0x1c8c4f[_0xcad64e][_0x06b2('0x9c')];_0x3ee328++){this[_0x06b2('0x9a')](_0x1c8c4f[_0xcad64e][_0x3ee328],util[_0x06b2('0x2d')]('%s.%s',_0x385196,_0xcad64e+'['+_0x3ee328+']'));}}else{if(!_[_0x06b2('0x4c')](_0x1c8c4f[_0xcad64e])){this[_0x06b2('0x3c')][_0x06b2('0x9d')](util[_0x06b2('0x2d')]('%s.%s',_0x385196,_0xcad64e),_0x1c8c4f[_0xcad64e]);}}}}};AGIVertices['prototype'][_0x06b2('0x95')]=function(_0x311d95){try{var _0x4bd7a2=JSON[_0x06b2('0x6e')](_0x311d95);this[_0x06b2('0x97')](_0x4bd7a2);return JSON[_0x06b2('0x9e')](_0x4bd7a2);}catch(_0x4178e6){return this[_0x06b2('0x96')](_0x311d95);}};AGIVertices[_0x06b2('0x15')][_0x06b2('0x96')]=function(_0x217668){var _0x2d7a37=_0x217668[_0x06b2('0x9f')]('{');for(var _0x4b1465=0x1;_0x4b1465<_0x2d7a37[_0x06b2('0x9c')];_0x4b1465+=0x1){var _0x12a3ae=_0x2d7a37[_0x4b1465]['split']('}');if(_0x12a3ae[_0x06b2('0x9c')]>0x1){_0x217668=_0x217668[_0x06b2('0xa0')]('{'+_0x12a3ae[0x0]+'}',this[_0x06b2('0x3c')][_0x06b2('0x10')](_0x12a3ae[0x0])[_0x06b2('0xa1')]||_0x12a3ae[0x0]);}}if(_0x2d7a37[_0x06b2('0x9c')]===0x1){return _0x217668['toString']();}return this[_0x06b2('0x96')](_0x217668);};AGIVertices['prototype'][_0x06b2('0xa2')]=function(_0x4085f1,_0x50953d){var _0x19f03f=this['channel'][_0x06b2('0x10')](_0x4085f1);if(_0x19f03f[_0x06b2('0xa3')]===-0x1){return _0x19f03f;}logger[_0x06b2('0xa4')](util['format'](_0x06b2('0xa5'),_0x50953d,_0x19f03f['extra']));return this[_0x06b2('0x3c')]['setVariable'](_0x50953d,_0x19f03f[_0x06b2('0xa1')]);};AGIVertices['prototype'][_0x06b2('0xa6')]=function(_0x4b9062){return _0x4b9062&&_0x4b9062!=='0'&&_0x4b9062!=='-1'&&_0x4b9062!=='';};AGIVertices[_0x06b2('0x15')][_0x06b2('0xa7')]=function(_0x507e89){this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x507e89,'-');_0x507e89[_0x06b2('0xa9')]=_0x507e89[_0x06b2('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x06b2('0xaa')]=function(_0x464a9c){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x464a9c[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x464a9c[_0x06b2('0x61')])){return this['channel']['noop'](_0x06b2('0xab'));}var _0x3cf76e='\x22'+_0x464a9c[_0x06b2('0x61')]+'\x22';if(this[_0x06b2('0xa6')](_0x464a9c['options'])){_0x3cf76e+=','+_0x464a9c[_0x06b2('0x79')];}var _0x163ace=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0xac'),_0x3cf76e);if(_0x163ace[_0x06b2('0xa3')]===-0x1){return _0x163ace;}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0xae'),_0x3cf76e));};AGIVertices[_0x06b2('0x15')][_0x06b2('0xaf')]=function(_0x2dbb95){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xb0'),_0x2dbb95[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x2dbb95[_0x06b2('0xb1')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xb2'));}var _0x5d200a=_0x2dbb95[_0x06b2('0xb1')];if(this[_0x06b2('0xa6')](_0x2dbb95[_0x06b2('0x79')])){_0x5d200a+=','+_0x2dbb95[_0x06b2('0x79')];}var _0xb719a0=this[_0x06b2('0x3c')]['exec'](_0x06b2('0xb3'),_0x5d200a);if(_0xb719a0[_0x06b2('0xa3')]===-0x1){return _0xb719a0;}var _0x1349d1=this[_0x06b2('0xa2')](_0x06b2('0xb4'),_0x06b2('0xb5'));if(_0x1349d1[_0x06b2('0xa3')]===-0x1){return _0x1349d1;}var _0x1d0b85=this[_0x06b2('0xa2')]('RECOG_INPUT()',_0x06b2('0xb6'));if(_0x1d0b85[_0x06b2('0xa3')]===-0x1){return _0x1d0b85;}var _0x4e7380=this['getAndSetVariable']('RECOG_INSTANCE()',_0x06b2('0xb7'));if(_0x4e7380[_0x06b2('0xa3')]===-0x1){return _0x4e7380;}return this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0xb8'),_0x5d200a));};AGIVertices['prototype'][_0x06b2('0x6')]=function(_0x3eb80c){logger['info'](util[_0x06b2('0x2d')](_0x06b2('0xb9'),_0x3eb80c[_0x06b2('0x3e')]));return this[_0x06b2('0x3c')][_0x06b2('0x6')]([_0x3eb80c[_0x06b2('0xba')],_0x3eb80c[_0x06b2('0xbb')]]);};AGIVertices[_0x06b2('0x15')][_0x06b2('0xbc')]=function(_0x15ee06){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xbd'),_0x15ee06['label']));if(this[_0x06b2('0xa6')](_0x15ee06[_0x06b2('0x68')])){logger['info'](util[_0x06b2('0x2d')](_0x06b2('0xbe'),_0x15ee06[_0x06b2('0x68')]));var _0x30b1d8=this[_0x06b2('0x3c')][_0x06b2('0xbf')](_0x15ee06[_0x06b2('0x68')]);if(_0x30b1d8[_0x06b2('0xa3')]===-0x1){return _0x30b1d8;}}return this['channel'][_0x06b2('0xbc')]();};AGIVertices[_0x06b2('0x15')][_0x06b2('0x52')]=function(_0x36d05b){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x36d05b[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x36d05b[_0x06b2('0x50')])){return this[_0x06b2('0x3c')]['error'](_0x36d05b,_0x06b2('0xc0'));}_0x36d05b[_0x06b2('0x51')]=moment();if(this[_0x06b2('0xa6')](_0x36d05b[_0x06b2('0xc1')])){_0x36d05b[_0x06b2('0x51')]=moment()['add'](_0x36d05b[_0x06b2('0xc1')],_0x06b2('0xc2'));}if(!this[_0x06b2('0xa6')](_0x36d05b['callback_priority'])){_0x36d05b[_0x06b2('0xc3')]=0x2;}this[_0x06b2('0x4a')][_0x06b2('0xa8')](this,_0x36d05b);return this[_0x06b2('0x3c')]['noop'](util['format'](_0x06b2('0xc4'),_0x36d05b['phone'],_0x36d05b[_0x06b2('0x50')],_0x36d05b[_0x06b2('0x51')]));};AGIVertices[_0x06b2('0x15')][_0x06b2('0xc5')]=function(_0x28d3c0){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xc6'),_0x28d3c0[_0x06b2('0x3e')]));var _0x5edc79=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x28d3c0[_0x06b2('0xc7')],_0x28d3c0[_0x06b2('0x79')]);if(_0x5edc79[_0x06b2('0xa3')]===-0x1){return _0x5edc79;}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util['format'](_0x06b2('0xc8'),_0x28d3c0[_0x06b2('0xc7')],_0x28d3c0[_0x06b2('0x79')]));};AGIVertices[_0x06b2('0x15')][_0x06b2('0xc9')]=function(_0x385ee1){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xca'),_0x385ee1[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x385ee1[_0x06b2('0x61')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xab'));}var _0x395d8c='\x22'+_0x385ee1[_0x06b2('0x61')]+'\x22';if(this[_0x06b2('0xa6')](_0x385ee1['options'])){_0x395d8c+=','+_0x385ee1[_0x06b2('0x79')];}var _0x1f5bfb=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0xac'),_0x395d8c);if(_0x1f5bfb['result']===-0x1){return _0x1f5bfb;}return this['channel'][_0x06b2('0xad')](util['format'](_0x06b2('0xae'),_0x395d8c));};AGIVertices[_0x06b2('0x15')][_0x06b2('0xcb')]=function(_0x2461b1){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xcc'),_0x2461b1[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x2461b1[_0x06b2('0x61')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xab'));}var _0x527f75='\x22'+_0x2461b1[_0x06b2('0x61')]+'\x22';if(this[_0x06b2('0xa6')](_0x2461b1['options'])){_0x527f75+=','+_0x2461b1[_0x06b2('0x79')];}var _0xd0505e=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0xac'),_0x527f75);if(_0xd0505e[_0x06b2('0xa3')]===-0x1){return _0xd0505e;}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0xae'),_0x527f75));};AGIVertices[_0x06b2('0x15')][_0x06b2('0xcd')]=function(_0x4f6cbf){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xce'),_0x4f6cbf[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x4f6cbf[_0x06b2('0xb1')])){return this['channel'][_0x06b2('0xad')]('no\x20grammar\x20configured');}var _0x5686f9=_0x4f6cbf['grammar'];if(this[_0x06b2('0xa6')](_0x4f6cbf[_0x06b2('0x79')])){_0x5686f9+=','+_0x4f6cbf[_0x06b2('0x79')];}var _0x68ca63=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0xb3'),_0x5686f9);if(_0x68ca63[_0x06b2('0xa3')]===-0x1){return _0x68ca63;}var _0x4f6e1a=this[_0x06b2('0xa2')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x4f6e1a[_0x06b2('0xa3')]===-0x1){return _0x4f6e1a;}var _0x5acb2d=this['getAndSetVariable'](_0x06b2('0xcf'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5acb2d[_0x06b2('0xa3')]===-0x1){return _0x5acb2d;}var _0x1a2f83=this[_0x06b2('0xa2')](_0x06b2('0xd0'),_0x06b2('0xd1'));if(_0x1a2f83['result']===-0x1){return _0x1a2f83;}return this['channel'][_0x06b2('0xad')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x5686f9));};AGIVertices['prototype'][_0x06b2('0xd2')]=function(_0x1a79ab){logger['info'](util[_0x06b2('0x2d')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1a79ab['label']));if(!this[_0x06b2('0xa6')](_0x1a79ab[_0x06b2('0xb1')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xb2'));}var _0x4c5dc9=_0x1a79ab[_0x06b2('0xb1')];if(this[_0x06b2('0xa6')](_0x1a79ab[_0x06b2('0x79')])){_0x4c5dc9+=','+_0x1a79ab[_0x06b2('0x79')];}var _0x502cc8=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0xb3'),_0x4c5dc9);if(_0x502cc8[_0x06b2('0xa3')]===-0x1){return _0x502cc8;}var _0x586fe7=this['getAndSetVariable'](_0x06b2('0xb4'),_0x06b2('0xd3'));if(_0x586fe7[_0x06b2('0xa3')]===-0x1){return _0x586fe7;}var _0x1ec69c=this['getAndSetVariable'](_0x06b2('0xcf'),_0x06b2('0xd4'));if(_0x1ec69c[_0x06b2('0xa3')]===-0x1){return _0x1ec69c;}var _0x38f108=this['getAndSetVariable'](_0x06b2('0xd0'),_0x06b2('0xd5'));if(_0x38f108['result']===-0x1){return _0x38f108;}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0xb8'),_0x4c5dc9));};AGIVertices[_0x06b2('0x15')][_0x06b2('0xd6')]=function(_0x5c26d2){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xd7'),_0x5c26d2[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x5c26d2[_0x06b2('0xd8')])){return this['channel'][_0x06b2('0x31')](_0x5c26d2,_0x06b2('0xd9'));}var _0x23f152=this[_0x06b2('0x19')]['sync'](this,_0x5c26d2[_0x06b2('0xd8')]);if(!_0x23f152){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x5c26d2,_0x06b2('0xda'));}if(!this[_0x06b2('0xa6')](_0x5c26d2[_0x06b2('0xdb')])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x5c26d2,_0x06b2('0xdc'));}var _0x37cbb7=_0x5c26d2[_0x06b2('0xdb')][_0x06b2('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0xdd'),_0x37cbb7));var _0x58151f=this['getQueryOdbc'][_0x06b2('0xa8')](this,_0x23f152,_0x37cbb7);this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x5c26d2,_0x37cbb7);if(!this[_0x06b2('0xa6')](_0x5c26d2[_0x06b2('0xde')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xdf'));}var _0x1ec4a0=this['getVariable'][_0x06b2('0xa8')](this,_0x5c26d2[_0x06b2('0xde')]);if(!_0x1ec4a0){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x5c26d2,_0x06b2('0xe0'));}var _0x5e7b42=this;_0x58151f[_0x06b2('0xe1')](function(_0x21a9f1,_0x4ad342){Object[_0x06b2('0xe2')](_0x21a9f1)['forEach'](function(_0x6ca8c7){_0x5e7b42[_0x06b2('0x3c')]['setVariable'](util[_0x06b2('0x2d')](_0x06b2('0xe3'),_0x1ec4a0,_0x4ad342,_0x6ca8c7),_0x21a9f1[_0x6ca8c7]);});});this[_0x06b2('0x3c')]['setVariable'](util[_0x06b2('0x2d')]('%s_ROWS_COUNT',_0x1ec4a0),_0x58151f[_0x06b2('0x9c')]);return this['channel']['noop'](util[_0x06b2('0x2d')](_0x06b2('0xe4'),_0x1ec4a0));};AGIVertices['prototype'][_0x06b2('0xe5')]=function(_0x214027){logger[_0x06b2('0xe6')](util[_0x06b2('0x2d')](_0x06b2('0xe7'),_0x214027[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x214027[_0x06b2('0xe8')])){return this[_0x06b2('0x3c')]['error'](_0x214027,_0x06b2('0xe9'));}var _0x8b952d=this[_0x06b2('0x1c')][_0x06b2('0xa8')](this,_0x214027[_0x06b2('0xe8')]);if(!_0x8b952d){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x214027,_0x06b2('0xea'));}var _0x50ac97=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0xeb'),[util['format'](_0x06b2('0xec'),_0x8b952d),_0x214027['timeout'],_0x214027[_0x06b2('0xed')],_0x214027['url']]);if(_0x50ac97['result']===-0x1){return _0x50ac97;}return this['channel']['noop'](util[_0x06b2('0x2d')](_0x06b2('0xee'),_0x06b2('0xeb')));};AGIVertices['prototype']['dialogflow']=function(_0x48e282){logger[_0x06b2('0xa4')](util['format'](_0x06b2('0xef'),_0x48e282['label']));if(!this['isConfigured'](_0x48e282['key'])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xf0'));}if(!this['isConfigured'](_0x48e282[_0x06b2('0x61')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xab'));}this['channel'][_0x06b2('0xf1')]=!![];this[_0x06b2('0x3b')](_0x48e282);this[_0x06b2('0x49')](_0x48e282[_0x06b2('0x61')],'in','','');this[_0x06b2('0x3c')]['noop'](util['format'](_0x06b2('0xf2'),_0x48e282[_0x06b2('0x61')]));var _0x9cd5af=this['googleDialogflow'][_0x06b2('0xa8')](this,_0x48e282);if(_0x9cd5af){for(var _0xfd7e8f in _0x9cd5af){if(_0x9cd5af[_0x06b2('0x93')](_0xfd7e8f)){this[_0x06b2('0x3c')]['setVariable'](util[_0x06b2('0x2d')]('DIALOGFLOW_%s',_0xfd7e8f[_0x06b2('0xf3')]()),_0x9cd5af[_0xfd7e8f]);}}this[_0x06b2('0x49')](_0x9cd5af[_0x06b2('0xf4')],_0x06b2('0xf5'),_0x06b2('0xf6'),'');return this[_0x06b2('0x3c')][_0x06b2('0xad')](util['format'](_0x06b2('0xf7'),_0x9cd5af['speech']));}return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x48e282,_0x06b2('0xf8'));};AGIVertices['prototype']['dialogflowV2']=function(_0x3c105b){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0xf9'),_0x3c105b[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x3c105b[_0x06b2('0xfa')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xfb'));}if(!this['isConfigured'](_0x3c105b[_0x06b2('0x7e')])){return this[_0x06b2('0x3c')]['noop'](_0x06b2('0xfc'));}if(!this[_0x06b2('0xa6')](_0x3c105b['private_key'])){return this['channel'][_0x06b2('0xad')](_0x06b2('0xfd'));}if(!this['isConfigured'](_0x3c105b[_0x06b2('0x80')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xfe'));}if(!this[_0x06b2('0xa6')](_0x3c105b[_0x06b2('0x61')])){return this[_0x06b2('0x3c')]['noop'](_0x06b2('0xab'));}this[_0x06b2('0x3c')][_0x06b2('0xf1')]=!![];this[_0x06b2('0x3b')](_0x3c105b);this[_0x06b2('0x49')](_0x3c105b[_0x06b2('0x61')],'in','','');this['channel']['noop'](util['format']('Trying\x20DialogflowV2:\x20%s',_0x3c105b[_0x06b2('0x61')]));var _0xedb80=this['googleDialogflowV2']['sync'](this,_0x3c105b);if(_0xedb80){for(var _0x30a93b in _0xedb80){if(_0xedb80[_0x06b2('0x93')](_0x30a93b)){if(_0x30a93b!=='providerResponse'){this[_0x06b2('0x3c')][_0x06b2('0x9d')](util['format'](_0x06b2('0xff'),_0x30a93b[_0x06b2('0xf3')]()),_0xedb80[_0x30a93b]);}}}this[_0x06b2('0x49')](_0xedb80[_0x06b2('0xf4')],_0x06b2('0xf5'),'dialogflowV2',_0xedb80[_0x06b2('0x100')]);return this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')]('DialogflowV2\x20Result\x20%s',_0xedb80['speech']));}return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x3c105b,_0x06b2('0x101'));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x102')]=function(_0x4e60c4){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4e60c4[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x4e60c4[_0x06b2('0x103')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0x104'));}if(!this['isConfigured'](_0x4e60c4['username'])){return this[_0x06b2('0x3c')]['noop'](_0x06b2('0x105'));}if(!this[_0x06b2('0xa6')](_0x4e60c4[_0x06b2('0x106')])){return this['channel'][_0x06b2('0xad')](_0x06b2('0x107'));}if(!this[_0x06b2('0xa6')](_0x4e60c4[_0x06b2('0x108')])){return this['channel']['noop'](_0x06b2('0xab'));}this[_0x06b2('0x3c')][_0x06b2('0xf1')]=!![];this['createSquareDetailsReport'](_0x4e60c4);this[_0x06b2('0x49')](_0x4e60c4[_0x06b2('0x61')],'in','','');this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x109'),_0x4e60c4[_0x06b2('0x61')]));var _0x51c359=this[_0x06b2('0x81')]['sync'](this,_0x4e60c4);if(_0x51c359){for(var _0x54869e in _0x51c359){if(_0x51c359['hasOwnProperty'](_0x54869e)){this[_0x06b2('0x3c')][_0x06b2('0x9d')](util[_0x06b2('0x2d')](_0x06b2('0x10a'),_0x54869e['toUpperCase']()),_0x51c359[_0x54869e]);}}this['createSquareMessage'](_0x51c359[_0x06b2('0xf4')],'out',_0x06b2('0x102'),'');if(_0x51c359[_0x06b2('0x10b')]){this['channel']['noop'](util[_0x06b2('0x2d')](_0x06b2('0x10c'),_0x51c359['audiofile']));var _0x4f9492=this['channel'][_0x06b2('0x10d')](_0x51c359['audiofile']);try{fs['unlink'](_0x51c359[_0x06b2('0x10b')]+_0x06b2('0x10e'));}catch(_0x5a868e){logger['error'](_0x5a868e);}return _0x4f9492;}else{return this[_0x06b2('0x3c')][_0x06b2('0xad')](util['format']('SestekNDA\x20Result\x20%s',_0x51c359[_0x06b2('0xf4')]));}}return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x4e60c4,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x06b2('0x15')][_0x06b2('0x10f')]=function(_0x2987a9){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x110'),_0x2987a9[_0x06b2('0x3e')]));return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0x10f'));};AGIVertices['prototype'][_0x06b2('0x111')]=function(_0x43056e){logger['info'](util[_0x06b2('0x2d')](_0x06b2('0x112'),_0x43056e[_0x06b2('0x3e')]));var _0x28fe1d='';if(_0x43056e[_0x06b2('0x113')]){if(!this[_0x06b2('0xa6')](_0x43056e['trunk_id'])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x43056e,_0x06b2('0x114'));}else{var _0x4d8bb3=parseInt(_0x43056e[_0x06b2('0x113')],0xa);if(isNaN(_0x4d8bb3)){_0x28fe1d=_0x43056e[_0x06b2('0x113')];}else{_0x28fe1d=this[_0x06b2('0x1d')]['sync'](this,_0x43056e[_0x06b2('0x113')]);if(!_0x28fe1d){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x43056e,_0x06b2('0x115'));}}}}else if(_0x43056e['trunk_name']){_0x28fe1d=_0x43056e['trunk_name'];}else{return this['channel'][_0x06b2('0x31')](_0x43056e,_0x06b2('0x114'));}var _0x226269=this[_0x06b2('0x3c')]['exec'](_0x06b2('0xeb'),[util[_0x06b2('0x2d')](_0x06b2('0x116'),_0x28fe1d,_0x43056e[_0x06b2('0x4f')]),_0x43056e[_0x06b2('0x68')],_0x43056e['opts'],_0x43056e['url']]);if(_0x226269['result']===-0x1){return _0x226269;}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util['format'](_0x06b2('0xee'),_0x06b2('0xeb')));};AGIVertices[_0x06b2('0x15')]['finally']=function(_0x231a82){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x117'),_0x231a82['label']));return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0x118'));};AGIVertices[_0x06b2('0x15')][_0x06b2('0xd')]=function(_0x5157bc){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x119'),_0x5157bc['label']));if(_0x5157bc['retry']===0x0){return this[_0x06b2('0xa7')](_0x5157bc);}_0x5157bc[_0x06b2('0xa9')]-=0x1;if(!this[_0x06b2('0xa6')](_0x5157bc[_0x06b2('0x11a')])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x5157bc,_0x06b2('0x11b'));}var _0x44a29b=this[_0x06b2('0x1f')][_0x06b2('0xa8')](this,_0x5157bc[_0x06b2('0x11a')]);if(!_0x44a29b){return this[_0x06b2('0x3c')]['error'](_0x5157bc,_0x06b2('0x11c'));}if(!this['isConfigured'](_0x5157bc[_0x06b2('0xde')])){return this[_0x06b2('0x3c')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x220e48=this['channel'][_0x06b2('0x11d')](_0x44a29b,_0x5157bc['response'],_0x5157bc[_0x06b2('0x11e')]);var _0x359488=_0x220e48['result']?_0x220e48[_0x06b2('0xa3')]['toString']():'';logger['info'](_0x06b2('0x11f'),JSON[_0x06b2('0x9e')](_0x220e48));if(_0x220e48['result']===-0x1){this[_0x06b2('0x3b')]['sync'](this,_0x5157bc,_0x359488);return _0x220e48;}else if(_0x220e48['extra']==='timeout'){_0x220e48['result']=_0x359488['length']>=parseInt(_0x5157bc[_0x06b2('0x120')])?'x':'i';}else{_0x220e48[_0x06b2('0xa3')]=_0x359488[_0x06b2('0x9c')]>=parseInt(_0x5157bc[_0x06b2('0x120')])&&_0x359488['length']<=parseInt(_0x5157bc[_0x06b2('0x11e')])?'x':'i';}var _0x439fe1=this[_0x06b2('0x10')]['sync'](this,_0x5157bc[_0x06b2('0xde')]);if(!_0x439fe1){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x5157bc,'no\x20variable\x20found');}this['channel'][_0x06b2('0x9d')](_0x439fe1,_0x359488);if(this[_0x06b2('0xa6')](_0x5157bc[_0x06b2('0x121')])){var _0x2ef492=parseInt(_0x5157bc[_0x06b2('0x121')],0xa);var _0x56cc6b=rs[_0x06b2('0x122')]({'charset':'*','length':_0x2ef492});var _0x1e7249=_0x359488[_0x06b2('0x9c')];if(_0x1e7249>0x0){if(_0x1e7249>_0x2ef492){this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x5157bc,_0x5157bc[_0x06b2('0x123')]==='first'?_0x56cc6b+_0x359488[_0x06b2('0x124')](_0x2ef492):_0x359488[_0x06b2('0x124')](0x0,_0x1e7249-_0x2ef492)+_0x56cc6b);}else{this[_0x06b2('0x3b')]['sync'](this,_0x5157bc,rs[_0x06b2('0x122')]({'charset':'*','length':_0x1e7249}));}}else{this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x5157bc,'');}}else{this['createSquareDetailsReport'][_0x06b2('0xa8')](this,_0x5157bc,_0x359488);}return _0x220e48;};AGIVertices[_0x06b2('0x15')][_0x06b2('0xe')]=function(_0x200be6){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x125'),_0x200be6[_0x06b2('0x3e')]));return this['getdigits'](_0x200be6);};AGIVertices['prototype']['goal']=function(_0x4a9c45){logger['info'](util[_0x06b2('0x2d')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4a9c45[_0x06b2('0x3e')]));this[_0x06b2('0x3b')]['sync'](this,_0x4a9c45,_0x4a9c45[_0x06b2('0x126')]);return this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x127'),_0x4a9c45['goalname']));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x128')]=function(_0x475fda){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x129'),_0x475fda[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x475fda[_0x06b2('0x12a')])||!this[_0x06b2('0xa6')](_0x475fda['aws_secret_access_key'])){return this[_0x06b2('0x3c')][_0x06b2('0xad')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x06b2('0xa6')](_0x475fda[_0x06b2('0x61')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')]('no\x20text\x20configured');}this['channel']['noop'](util['format']('Trying\x20aws\x20Polly\x20%s',_0x475fda[_0x06b2('0x61')]));var _0x137b3c=this[_0x06b2('0x88')][_0x06b2('0xa8')](this,_0x475fda);if(_0x137b3c){this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0x12b'),_0x137b3c));var _0x2c5847=this[_0x06b2('0x3c')][_0x06b2('0x10d')](_0x137b3c);try{fs[_0x06b2('0x12c')](_0x137b3c+'.wav');}catch(_0x214aa7){logger[_0x06b2('0x31')](_0x214aa7);}return _0x2c5847;}return this[_0x06b2('0x3c')]['error'](_0x475fda,_0x06b2('0x12d'));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x12e')]=function(_0x1b95e9){logger['info'](util[_0x06b2('0x2d')](_0x06b2('0x12f'),_0x1b95e9['label']));if(!this['isConfigured'](_0x1b95e9[_0x06b2('0x12a')])||!this[_0x06b2('0xa6')](_0x1b95e9[_0x06b2('0x8d')])){return this['channel'][_0x06b2('0xad')](_0x06b2('0x130'));}if(!this[_0x06b2('0xa6')](_0x1b95e9['aws_bot_name'])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0x131'));}if(!this[_0x06b2('0xa6')](_0x1b95e9[_0x06b2('0x61')])){return this['channel'][_0x06b2('0xad')](_0x06b2('0xab'));}this[_0x06b2('0x3c')][_0x06b2('0xf1')]=!![];this[_0x06b2('0x3b')](_0x1b95e9);this[_0x06b2('0x49')](_0x1b95e9[_0x06b2('0x61')],'in','','');this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0x132'),_0x1b95e9[_0x06b2('0x61')]));var _0x5c85e9=this[_0x06b2('0x8c')][_0x06b2('0xa8')](this,_0x1b95e9);if(_0x5c85e9){for(var _0x59c3c9 in _0x5c85e9){if(_0x5c85e9[_0x06b2('0x93')](_0x59c3c9)&&_[_0x06b2('0x94')](_0x5c85e9[_0x59c3c9])){this[_0x06b2('0x3c')]['setVariable'](util[_0x06b2('0x2d')](_0x06b2('0x133'),_0x59c3c9[_0x06b2('0xf3')]()),_0x5c85e9[_0x59c3c9]);}}if(_[_0x06b2('0x4c')](_0x5c85e9[_0x06b2('0x77')])){return this['channel']['noop'](_0x06b2('0x134'));}else{this[_0x06b2('0x49')](_0x5c85e9[_0x06b2('0x77')],_0x06b2('0xf5'),_0x06b2('0x135'),'');return this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x136'),_0x5c85e9[_0x06b2('0x77')]));}}return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x1b95e9,_0x06b2('0x137'));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x138')]=function(_0x322410){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x139'),_0x322410[_0x06b2('0x3e')],_0x322410['timeout']));if(!this[_0x06b2('0xa6')](_0x322410['key'])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xf0'));}var _0x4452ea=_0x06b2('0x13a');var _0x3ffe23=util[_0x06b2('0x2d')](_0x06b2('0x13b'),FILES_PATH,rs[_0x06b2('0x122')](0x4));var _0x1ad178=util[_0x06b2('0x2d')](_0x06b2('0x9b'),_0x3ffe23,_0x4452ea);var _0x1386b9=!![];if(_0x322410['beep']===_0x06b2('0x13c')){_0x1386b9=![];}var _0x5016eb=this[_0x06b2('0x3c')]['recordFile'](_0x3ffe23,_0x4452ea,_0x322410[_0x06b2('0x13d')],_0x322410[_0x06b2('0x68')],undefined,_0x1386b9);if(_0x5016eb[_0x06b2('0xa3')]!==-0x1){this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0x13e'),_0x1ad178));var _0x2b2fbd=this[_0x06b2('0x8f')][_0x06b2('0xa8')](this,_0x322410,_0x1ad178);if(_0x2b2fbd){for(var _0x2f2b82 in _0x2b2fbd){if(_0x2b2fbd[_0x06b2('0x93')](_0x2f2b82)){this[_0x06b2('0x3c')][_0x06b2('0x9d')](util['format'](_0x06b2('0x13f'),_0x2f2b82[_0x06b2('0xf3')]()),_0x2b2fbd[_0x2f2b82]);}}return this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0x140'),JSON[_0x06b2('0x9e')](_0x2b2fbd)));}}return _0x5016eb;};AGIVertices[_0x06b2('0x15')]['tildeasr']=function(_0x42784d){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x141'),_0x42784d[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x42784d[_0x06b2('0x142')])){return this['channel'][_0x06b2('0xad')]('no\x20appid\x20configured');}if(!this[_0x06b2('0xa6')](_0x42784d['appsecret'])){return this['channel'][_0x06b2('0xad')]('no\x20appsecret\x20configured');}var _0x5014b8=_0x06b2('0x13a');var _0x55cd89=util[_0x06b2('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0x06b2('0x122')](0x4));var _0x387f89=util[_0x06b2('0x2d')]('%s.%s',_0x55cd89,_0x5014b8);var _0x48be0b=!![];if(_0x42784d['beep']===_0x06b2('0x13c')){_0x48be0b=![];}var _0x5c7220=this['channel']['recordFile'](_0x55cd89,_0x5014b8,_0x42784d[_0x06b2('0x13d')],_0x42784d[_0x06b2('0x68')],undefined,_0x48be0b);if(_0x5c7220[_0x06b2('0xa3')]!==-0x1){this['channel'][_0x06b2('0xad')](util['format'](_0x06b2('0x143'),_0x387f89));var _0x5f2ee1=this[_0x06b2('0x90')][_0x06b2('0xa8')](this,_0x42784d,_0x387f89);if(_0x5f2ee1){for(var _0x37d5d8 in _0x5f2ee1){if(_0x5f2ee1[_0x06b2('0x93')](_0x37d5d8)){this[_0x06b2('0x3c')]['setVariable'](util[_0x06b2('0x2d')](_0x06b2('0x144'),_0x37d5d8[_0x06b2('0xf3')]()),_0x5f2ee1[_0x37d5d8]);}}return this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')]('TildeASR\x20Result\x20%s',JSON[_0x06b2('0x9e')](_0x5f2ee1)));}}return _0x5c7220;};AGIVertices[_0x06b2('0x15')][_0x06b2('0x145')]=function(_0x5653c4){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x146'),_0x5653c4[_0x06b2('0x3e')]));return this[_0x06b2('0x3c')]['continueAt'](_0x5653c4['context'],_0x5653c4['extension'],_0x5653c4['priority']);};AGIVertices[_0x06b2('0x15')]['gotoif']=function(_0x479533){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x147'),_0x479533[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x479533[_0x06b2('0x148')])){return this['channel'][_0x06b2('0x31')](_0x479533,'no\x20condition\x20configured');}try{var _0x18bae6=eval(_0x479533[_0x06b2('0x148')])?_0x06b2('0x149'):'false';this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x14a'),_0x479533[_0x06b2('0x148')],_0x18bae6));return{'code':0xc8,'result':_0x18bae6};}catch(_0x488fdc){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x3fbda8){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x14b'),_0x3fbda8[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x3fbda8['interval_id'])){return this['channel']['error'](_0x3fbda8,_0x06b2('0x14c'));}var _0x386cbe=this[_0x06b2('0x27')][_0x06b2('0xa8')](this,_0x3fbda8[_0x06b2('0x14d')]);if(!_0x386cbe){return this['channel'][_0x06b2('0x31')](_0x3fbda8,_0x06b2('0x14e'));}for(var _0x3bb781=0x0;_0x3bb781<_0x386cbe[_0x06b2('0x9c')];_0x3bb781+=0x1){var _0x47f53a=this[_0x06b2('0x3c')][_0x06b2('0x10')](util[_0x06b2('0x2d')](_0x06b2('0x14f'),_0x386cbe[_0x3bb781]));if(_0x47f53a[_0x06b2('0xa3')]===-0x1){return _0x47f53a;}logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x150'),_0x386cbe[_0x3bb781],_0x47f53a[_0x06b2('0xa1')]));if(_0x47f53a[_0x06b2('0xa1')]==='true'){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x150'),_0x386cbe[_0x3bb781],_0x06b2('0x149')));this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')]('IFTIME\x20%s\x20%s',_0x386cbe[_0x3bb781],_0x06b2('0x149')));return{'code':0xc8,'result':_0x06b2('0x149')};}else{logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x150'),_0x386cbe[_0x3bb781],_0x06b2('0x151')));this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')]('IFTIME\x20%s\x20%s',_0x386cbe[_0x3bb781],_0x06b2('0x151')));}}return{'code':0xc8,'result':_0x06b2('0x151')};};AGIVertices[_0x06b2('0x15')]['hangup']=function(_0x366f78){logger['info'](util[_0x06b2('0x2d')](_0x06b2('0x152'),_0x366f78[_0x06b2('0x3e')]));return this[_0x06b2('0x3c')][_0x06b2('0x153')]();};AGIVertices[_0x06b2('0x15')][_0x06b2('0x154')]=function(_0x460683){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x155'),_0x460683[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x460683[_0x06b2('0x7b')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xf0'));}var _0x38c457=_0x06b2('0x13a');var _0x357ebc=util[_0x06b2('0x2d')](_0x06b2('0x13b'),FILES_PATH,rs[_0x06b2('0x122')](0x4));var _0xb4f419=util[_0x06b2('0x2d')](_0x06b2('0x9b'),_0x357ebc,_0x38c457);var _0x39d19c=!![];if(_0x460683[_0x06b2('0x156')]===_0x06b2('0x13c')){_0x39d19c=![];}var _0x4be478=this[_0x06b2('0x3c')]['recordFile'](_0x357ebc,_0x38c457,_0x460683['intKey'],_0x460683[_0x06b2('0x68')],undefined,_0x39d19c);if(_0x4be478[_0x06b2('0xa3')]!==-0x1){this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x157'),_0xb4f419));var _0x4e0567=this[_0x06b2('0x85')][_0x06b2('0xa8')](this,_0x460683,_0xb4f419);if(_0x4e0567){for(var _0x3075f8 in _0x4e0567){if(_0x4e0567[_0x06b2('0x93')](_0x3075f8)){this[_0x06b2('0x3c')][_0x06b2('0x9d')](util['format'](_0x06b2('0x158'),_0x3075f8[_0x06b2('0xf3')]()),_0x4e0567[_0x3075f8]);}}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x159'),JSON[_0x06b2('0x9e')](_0x4e0567)));}}return _0x4be478;};AGIVertices[_0x06b2('0x15')][_0x06b2('0x15a')]=function(_0x2021db){logger['info'](util['format'](_0x06b2('0x15b'),_0x2021db[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x2021db[_0x06b2('0x7b')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xf0'));}if(!this['isConfigured'](_0x2021db[_0x06b2('0x61')])){return this['channel'][_0x06b2('0xad')]('no\x20text\x20configured');}this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x15c'),_0x2021db[_0x06b2('0x61')]));var _0x44da5f=this[_0x06b2('0x82')][_0x06b2('0xa8')](this,_0x2021db);if(_0x44da5f){this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x157'),_0x44da5f));var _0x38e157=this[_0x06b2('0x3c')]['streamFile'](_0x44da5f,_0x2021db[_0x06b2('0x13d')]);try{fs[_0x06b2('0x12c')](_0x44da5f+_0x06b2('0x10e'));}catch(_0x56ecf3){logger[_0x06b2('0x31')](_0x56ecf3);}return _0x38e157;}return this[_0x06b2('0x3c')]['error'](_0x2021db,_0x06b2('0x15d'));};AGIVertices['prototype'][_0x06b2('0x15e')]=function(_0x1e7ece){logger['info'](util[_0x06b2('0x2d')](_0x06b2('0x15f'),_0x1e7ece[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x1e7ece['findBy'])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x1e7ece,'no\x20find\x20by\x20configured');}logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x160'),this[_0x06b2('0x3c')]['callerid'],_0x1e7ece[_0x06b2('0x161')]));var _0x2a56f1=this[_0x06b2('0x58')][_0x06b2('0xa8')](this,_0x1e7ece[_0x06b2('0x161')]);if(_0x2a56f1){logger['info'](util[_0x06b2('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x06b2('0x3c')]['callerid'],_0x1e7ece[_0x06b2('0x161')]));this['channel']['noop'](util[_0x06b2('0x2d')](_0x06b2('0x162'),this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x1e7ece[_0x06b2('0x161')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x06b2('0x2d')](_0x06b2('0x163'),this['channel']['callerid'],_0x1e7ece[_0x06b2('0x161')]));this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x163'),this['channel'][_0x06b2('0x41')],_0x1e7ece[_0x06b2('0x161')]));return{'code':0xc8,'result':_0x06b2('0x164')};}};AGIVertices['prototype'][_0x06b2('0x165')]=function(_0x41a86e){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x166'),_0x41a86e[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x41a86e[_0x06b2('0x161')])){return this['channel'][_0x06b2('0x31')](_0x41a86e,_0x06b2('0x167'));}logger['info'](util[_0x06b2('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x41a86e[_0x06b2('0x161')]));var _0x403ba0=this[_0x06b2('0x57')][_0x06b2('0xa8')](this,_0x41a86e['findBy']);if(_0x403ba0){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x06b2('0x3c')]['callerid'],_0x41a86e[_0x06b2('0x161')]));this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x162'),this['channel'][_0x06b2('0x41')],_0x41a86e['findBy']));return{'code':0xc8,'result':_0x06b2('0x168')};}else{logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x163'),this['channel'][_0x06b2('0x41')],_0x41a86e[_0x06b2('0x161')]));this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x163'),this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x41a86e[_0x06b2('0x161')]));return{'code':0xc8,'result':_0x06b2('0x164')};}};AGIVertices[_0x06b2('0x15')][_0x06b2('0x169')]=function(_0x4199dc){logger[_0x06b2('0xa4')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x4199dc[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x4199dc[_0x06b2('0x16a')])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x4199dc,_0x06b2('0x16b'));}this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')]('math\x20%s',_0x4199dc[_0x06b2('0x16a')]));var _0x576184=eval(_0x4199dc[_0x06b2('0x16a')]);if(!this['isConfigured'](_0x4199dc[_0x06b2('0xde')])){return this[_0x06b2('0x3c')]['noop'](_0x06b2('0xdf'));}var _0xc18c1f=this[_0x06b2('0x10')]['sync'](this,_0x4199dc[_0x06b2('0xde')]);if(!_0xc18c1f){return this['channel'][_0x06b2('0x31')](_0x4199dc,_0x06b2('0xe0'));}if(_[_0x06b2('0x99')](_0x576184)){var _0x38fb82=this;_0x576184[_0x06b2('0xe1')](function(_0xfd04bb,_0x4501cc){_0x38fb82['channel'][_0x06b2('0x9d')](util['format'](_0x06b2('0x16c'),_0xc18c1f,_0x4501cc),_0xfd04bb);});return this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x16d'),_0xc18c1f));}else{return this[_0x06b2('0x3c')][_0x06b2('0x9d')](_0xc18c1f,_0x576184);}};AGIVertices[_0x06b2('0x15')]['menu']=function(_0x24626e){logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x16e'),_0x24626e[_0x06b2('0x3e')]));if(_0x24626e['retry']===0x0){return this['maxRetry'](_0x24626e);}_0x24626e[_0x06b2('0xa9')]-=0x1;if(!this[_0x06b2('0xa6')](_0x24626e[_0x06b2('0x11a')])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x24626e,_0x06b2('0x11b'));}var _0x4e4507=this[_0x06b2('0x1f')]['sync'](this,_0x24626e[_0x06b2('0x11a')]);if(!_0x4e4507){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x24626e,'no\x20file\x20audio\x20found');}var _0x22f3ab=this[_0x06b2('0x3c')]['getData'](_0x4e4507,_0x24626e[_0x06b2('0x16f')],_0x24626e[_0x06b2('0x170')]);var _0x24f84d=_0x22f3ab[_0x06b2('0xa3')];if(_0x22f3ab[_0x06b2('0xa3')]===-0x1){this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x24626e,'-1');return _0x22f3ab;}else if(_0x22f3ab[_0x06b2('0xa1')]==='timeout'){_0x22f3ab[_0x06b2('0xa3')]=_0x22f3ab[_0x06b2('0xa3')][_0x06b2('0x9c')]>0x0?_0x22f3ab[_0x06b2('0xa3')]:'t';}else if(_[_0x06b2('0x4b')](_0x22f3ab[_0x06b2('0xa3')])){_0x22f3ab[_0x06b2('0xa3')]='#';_0x24f84d='#';}if(!this[_0x06b2('0xa6')](_0x24626e['variable_id'])){this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0xdf'));}else{var _0x4f4d28=this[_0x06b2('0x10')][_0x06b2('0xa8')](this,_0x24626e[_0x06b2('0xde')]);if(!_0x4f4d28){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x24626e,_0x06b2('0xe0'));}this[_0x06b2('0x3c')][_0x06b2('0x9d')](_0x4f4d28,_0x24f84d);}this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x24626e,_0x24f84d);return _0x22f3ab;};AGIVertices[_0x06b2('0x15')]['noop']=function(_0x19909d){logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x171'),_0x19909d[_0x06b2('0x3e')]));return this[_0x06b2('0x3c')]['noop'](_0x19909d[_0x06b2('0x172')]||_0x19909d[_0x06b2('0x3e')]);};AGIVertices[_0x06b2('0x15')][_0x06b2('0x173')]=function(_0x3e9fdb){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x174'),_0x3e9fdb[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x3e9fdb[_0x06b2('0x161')])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x3e9fdb,_0x06b2('0x167'));}logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x3e9fdb[_0x06b2('0x161')]));var _0x1e8a8b=this[_0x06b2('0x54')][_0x06b2('0xa8')](this,_0x3e9fdb['pause_id']);var _0x2fa13a=this[_0x06b2('0x55')][_0x06b2('0xa8')](this,_0x3e9fdb['findBy'],_0x1e8a8b);if(_0x2fa13a){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x3e9fdb[_0x06b2('0x161')]));this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x3e9fdb[_0x06b2('0x161')]));return{'code':0xc8,'result':_0x06b2('0x168')};}else{logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x163'),this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x3e9fdb['findBy']));this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x162'),this[_0x06b2('0x3c')]['callerid'],_0x3e9fdb['findBy']));return{'code':0xc8,'result':_0x06b2('0x164')};}};AGIVertices[_0x06b2('0x15')][_0x06b2('0x175')]=function(_0x25b9d8){logger['info'](util[_0x06b2('0x2d')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x25b9d8[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x25b9d8[_0x06b2('0x11a')])){return this[_0x06b2('0x3c')]['error'](_0x25b9d8,_0x06b2('0x11b'));}var _0x1bfaf5=this[_0x06b2('0x1f')][_0x06b2('0xa8')](this,_0x25b9d8['file_id']);if(!_0x1bfaf5){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x25b9d8,_0x06b2('0x11c'));}var _0x42b2e2=this[_0x06b2('0x3c')]['exec'](_0x06b2('0x176'),[_0x1bfaf5,_0x25b9d8[_0x06b2('0xed')]]);if(_0x42b2e2[_0x06b2('0xa3')]===-0x1){return _0x42b2e2;}return this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')]('Executed\x20command\x20%s\x20%s',_0x06b2('0x176'),_0x1bfaf5));};AGIVertices[_0x06b2('0x15')]['queue']=function(_0x5a8e99){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x177'),_0x5a8e99['label']));if(!this[_0x06b2('0xa6')](_0x5a8e99[_0x06b2('0x178')])){return this[_0x06b2('0x3c')]['error'](_0x5a8e99,_0x06b2('0x179'));}var _0x3b8ba0='';var _0xc646b1=parseInt(_0x5a8e99[_0x06b2('0x178')],0xa);if(isNaN(_0xc646b1)){_0x3b8ba0=_0x5a8e99['queue_id'];}else{_0x3b8ba0=this[_0x06b2('0x16')][_0x06b2('0xa8')](this,_0x5a8e99['queue_id']);if(!_0x3b8ba0){return this['channel'][_0x06b2('0x31')](_0x5a8e99,_0x06b2('0x17a'));}}var _0x17f43f='';if(this[_0x06b2('0xa6')](_0x5a8e99[_0x06b2('0x11a')])){var _0x2f8f8c=this[_0x06b2('0x1f')][_0x06b2('0xa8')](this,_0x5a8e99[_0x06b2('0x11a')]);if(_0x2f8f8c){_0x17f43f=_0x2f8f8c;}}this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x5a8e99,_0x3b8ba0);if(_0x5a8e99[_0x06b2('0xed')][_0x06b2('0x17b')]('x')<0x0){_0x5a8e99[_0x06b2('0xed')]+='x';}if(_0x5a8e99[_0x06b2('0xed')][_0x06b2('0x17b')]('X')<0x0){_0x5a8e99['opts']+='X';}this[_0x06b2('0x3c')]['setVariable'](_0x06b2('0x17c'),_0x3b8ba0?_0x3b8ba0[_0x06b2('0x17d')]():'');var _0x5478d0=this[_0x06b2('0x3c')]['exec'](_0x06b2('0x17e'),[_0x3b8ba0,_0x5a8e99[_0x06b2('0xed')],_0x5a8e99['url'],_0x17f43f,_0x5a8e99[_0x06b2('0x68')],_0x5a8e99[_0x06b2('0x6')],_0x5a8e99['macro'],_0x5a8e99['gosub'],'',_0x5a8e99['position']]);if(_0x5478d0[_0x06b2('0xa3')]===-0x1){return _0x5478d0;}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util['format'](_0x06b2('0xc8'),_0x06b2('0x17e'),_0x3b8ba0));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x17f')]=function(_0x54eaa6){logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x180'),_0x54eaa6[_0x06b2('0x3e')]));var _0x17f3ec=_0x54eaa6[_0x06b2('0x181')]||_0x06b2('0x13a');var _0x25147e=util['format'](_0x06b2('0x182'),this[_0x06b2('0x3c')]['uniqueid'],rs[_0x06b2('0x122')](0x5));var _0x18b620=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x25147e,_0x17f3ec);var _0x364d85=util[_0x06b2('0x2d')]('%s/recordings/%s',FILES_PATH,_0x25147e);this[_0x06b2('0x42')][_0x06b2('0xa8')](this,_0x54eaa6,_0x25147e,_0x18b620);this[_0x06b2('0x3c')][_0x06b2('0x9d')](_0x06b2('0x183'),_0x25147e);logger[_0x06b2('0xa4')](_0x06b2('0x184'),_0x364d85,_0x17f3ec,_0x54eaa6[_0x06b2('0x185')],_0x54eaa6[_0x06b2('0x68')]);return this['channel'][_0x06b2('0x186')](_0x364d85,_0x17f3ec,_0x54eaa6[_0x06b2('0x185')],_0x54eaa6[_0x06b2('0x68')],undefined,!![]);};AGIVertices[_0x06b2('0x15')][_0x06b2('0x187')]=function(_0x31c4a4){logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x188'),_0x31c4a4[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x31c4a4['url'])){return this['channel'][_0x06b2('0xad')](_0x06b2('0x189'));}var _0x165ed7=this[_0x06b2('0x66')][_0x06b2('0xa8')](this,_0x31c4a4);logger['info'](util['format'](_0x06b2('0x18a'),util[_0x06b2('0x18b')](_0x165ed7,{'showHidden':![],'depth':null})));if(!this[_0x06b2('0xa6')](_0x31c4a4[_0x06b2('0xde')])){return this[_0x06b2('0x3c')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x55178f=this[_0x06b2('0x10')][_0x06b2('0xa8')](this,_0x31c4a4['variable_id']);if(!_0x55178f){return this['channel']['error'](_0x31c4a4,'no\x20variable\x20found');}this[_0x06b2('0x3c')][_0x06b2('0x9d')](util['format'](_0x06b2('0x18c'),_0x55178f),_0x165ed7['statusCode']?_0x165ed7[_0x06b2('0x75')]:_0x06b2('0x18d'));this[_0x06b2('0x3c')][_0x06b2('0x9d')](util[_0x06b2('0x2d')](_0x06b2('0x18e'),_0x55178f),_0x165ed7[_0x06b2('0x76')]?_0x165ed7['statusMessage']:'OK');if(_0x165ed7[_0x06b2('0x73')]){try{this['saveRestApiResult'](_0x165ed7[_0x06b2('0x73')],_0x55178f);}catch(_0x4ce225){logger[_0x06b2('0x31')](util['format'](_0x06b2('0x18f'),_0x55178f));}}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0xe4'),_0x55178f));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x190')]=function(_0x1d1f27){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x191'),_0x1d1f27[_0x06b2('0x3e')]));return this['channel'][_0x06b2('0x192')](_0x1d1f27[_0x06b2('0x193')]['replace'](/\s+/g,''),_0x1d1f27[_0x06b2('0x185')]);};AGIVertices[_0x06b2('0x15')]['saynumber']=function(_0x3f719e){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x194'),_0x3f719e[_0x06b2('0x3e')]));return this['channel'][_0x06b2('0x195')](_0x3f719e['number']['replace'](/\s+/g,''),_0x3f719e[_0x06b2('0x185')]);};AGIVertices[_0x06b2('0x15')][_0x06b2('0x196')]=function(_0x2b1acc){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2b1acc[_0x06b2('0x3e')]));return this[_0x06b2('0x3c')][_0x06b2('0x197')](_0x2b1acc['text'],_0x2b1acc['escape_digits']);};AGIVertices[_0x06b2('0x15')][_0x06b2('0x198')]=function(_0x5b3163){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x199'),_0x5b3163[_0x06b2('0x3e')]));if(!this[_0x06b2('0xa6')](_0x5b3163[_0x06b2('0x19a')])){return this['channel']['noop'](_0x06b2('0x19b'));}var _0x513ce2=this[_0x06b2('0x23')][_0x06b2('0xa8')](this,_0x5b3163[_0x06b2('0x19a')]);if(!_0x513ce2||!_0x513ce2[_0x06b2('0x19c')]){return this['channel'][_0x06b2('0x31')](_0x5b3163,'no\x20mail\x20account\x20found');}var _0x192b88={'from':util[_0x06b2('0x2d')]('\x22%s\x22\x20<%s>',_0x513ce2[_0x06b2('0x13')],_0x513ce2[_0x06b2('0x19d')]||_0x513ce2['Smtp'][_0x06b2('0x19e')]),'to':_0x5b3163['to']||'','cc':_0x5b3163['cc']||'','bcc':_0x5b3163[_0x06b2('0x19f')]||'','subject':_0x5b3163[_0x06b2('0x1a0')],'html':_0x5b3163['text'],'text':_0x5b3163[_0x06b2('0x61')]};if(this['isConfigured'](_0x5b3163['template_id'])){}logger[_0x06b2('0xe6')](_0x06b2('0x1a1'),JSON[_0x06b2('0x9e')](_0x192b88));this['createSquareDetailsReport'][_0x06b2('0xa8')](this,_0x5b3163,_0x5b3163[_0x06b2('0x19a')]);this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x1a2'),_0x513ce2[_0x06b2('0x13')]));this['sendMailMessage'][_0x06b2('0xa8')](this,_0x513ce2['smtpOptions'],_0x192b88);return this['channel'][_0x06b2('0xad')](_0x06b2('0x1a3'));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1a4')]=function(_0x2bd820){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2bd820[_0x06b2('0x3e')]));return this[_0x06b2('0x3c')]['noop'](_0x06b2('0x1a5'));};AGIVertices[_0x06b2('0x15')]['sendSMS']=function(_0x28a73c){logger['info'](util[_0x06b2('0x2d')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x28a73c[_0x06b2('0x3e')]));if(!this['isConfigured'](_0x28a73c[_0x06b2('0x1a6')])){return this[_0x06b2('0x3c')]['noop'](_0x06b2('0x1a7'));}var _0xa96098=this[_0x06b2('0x38')][_0x06b2('0xa8')](this,_0x28a73c[_0x06b2('0x1a6')]);if(!_0xa96098){return this['channel'][_0x06b2('0x31')](_0x28a73c,_0x06b2('0x1a8'));}var _0x112da4={'body':_0x28a73c[_0x06b2('0x1a9')],'phone':_0x28a73c['to']||'','SmsAccountId':_0xa96098['id']};logger[_0x06b2('0xe6')]('sendSMS\x20message',JSON[_0x06b2('0x9e')](_0x112da4));this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x28a73c,_0x28a73c[_0x06b2('0x1a6')]);this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xa96098[_0x06b2('0x13')]));this[_0x06b2('0x3a')][_0x06b2('0xa8')](this,_0x112da4);return this[_0x06b2('0x3c')][_0x06b2('0xad')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x06b2('0x15')]['set']=function(_0xc6f033){logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x1aa'),_0xc6f033['label']));if(!this[_0x06b2('0xa6')](_0xc6f033[_0x06b2('0xde')])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0xc6f033,_0x06b2('0x1ab'));}var _0x394775=this[_0x06b2('0x10')]['sync'](this,_0xc6f033['variable_id']);if(!_0x394775){return this['channel'][_0x06b2('0x31')](_0xc6f033,'no\x20variable\x20found');}return this[_0x06b2('0x3c')][_0x06b2('0x9d')](_0x394775,_0xc6f033[_0x06b2('0x1ac')]);};AGIVertices[_0x06b2('0x15')]['start']=function(_0x32bb9e){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x1ad'),_0x32bb9e[_0x06b2('0x3e')]));this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0x1ae'));if(_0x32bb9e[_0x06b2('0xbc')]===_0x06b2('0x1af')){this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0x1b0'));return this[_0x06b2('0x3c')][_0x06b2('0xbc')]();}return this[_0x06b2('0x3c')][_0x06b2('0xad')](_0x06b2('0x1b1'));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1b2')]=function(_0x207b08){logger['info'](util[_0x06b2('0x2d')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x207b08['label']));if(!this[_0x06b2('0xa6')](_0x207b08['project_id'])){return this['channel'][_0x06b2('0x31')](_0x207b08,_0x06b2('0x1b3'));}var _0x422a10=this[_0x06b2('0x18')]['sync'](this,_0x207b08[_0x06b2('0x1b4')]);if(!this[_0x06b2('0xa6')](_0x422a10)){return this['channel'][_0x06b2('0x31')](_0x207b08,util[_0x06b2('0x2d')](_0x06b2('0x1b5'),_0x207b08[_0x06b2('0x1b4')]));}if(_0x422a10===this['channel'][_0x06b2('0x40')]){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x207b08,_0x06b2('0x1b6'));}this['createSquareDetailsReport'][_0x06b2('0xa8')](this,_0x207b08,_0x422a10);var _0x26ca06=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0x1b7'),util[_0x06b2('0x2d')](_0x06b2('0x1b8'),config[_0x06b2('0x6')]['host']||_0x06b2('0x1b9'),_0x422a10,this[_0x06b2('0x3c')]['arg_1']));if(_0x26ca06[_0x06b2('0xa3')]===-0x1){return _0x26ca06;}return this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')]('Executed\x20command\x20%s\x20%s',_0x06b2('0x1b7'),_0x422a10));};AGIVertices[_0x06b2('0x15')]['system']=function(_0x3742a4){logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x1ba'),_0x3742a4[_0x06b2('0x3e')]));var _0x3161f9=this[_0x06b2('0x1bb')][_0x06b2('0xa8')](this,_0x3742a4[_0x06b2('0xba')]);this[_0x06b2('0x3b')][_0x06b2('0xa8')](this,_0x3742a4,_0x3742a4[_0x06b2('0xba')]);if(this[_0x06b2('0xa6')](_0x3742a4[_0x06b2('0xde')])){var _0x1ab555=this[_0x06b2('0x10')]['sync'](this,_0x3742a4[_0x06b2('0xde')]);if(_0x1ab555){this[_0x06b2('0x3c')][_0x06b2('0x9d')](_0x1ab555,_0x3161f9);return this['channel']['noop'](util[_0x06b2('0x2d')](_0x06b2('0x1bc'),_0x3742a4[_0x06b2('0xba')],_0x1ab555));}}return this['channel'][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x1bd'),_0x3742a4[_0x06b2('0xba')]));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1be')]=function(_0x4f7a3e){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x1bf'),_0x4f7a3e['label']));_0x4f7a3e[_0x06b2('0x61')]=_0x4f7a3e[_0x06b2('0x61')][_0x06b2('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x06b2('0xa6')](_0x4f7a3e[_0x06b2('0x1c0')])){return this[_0x06b2('0x3c')]['noop']('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x4f7a3e[_0x06b2('0x61')])){return this[_0x06b2('0x3c')]['noop'](_0x06b2('0xab'));}this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0x1c1'),_0x4f7a3e[_0x06b2('0x61')]));var _0x53c0d5=this[_0x06b2('0x5f')][_0x06b2('0xa8')](this,_0x4f7a3e);if(_0x53c0d5){this[_0x06b2('0x3c')]['noop'](util[_0x06b2('0x2d')](_0x06b2('0x1c2'),_0x53c0d5));var _0x7943b6=this['channel'][_0x06b2('0x10d')](_0x53c0d5);try{fs[_0x06b2('0x12c')](_0x53c0d5+_0x06b2('0x10e'));}catch(_0x204f7c){logger[_0x06b2('0x31')](_0x204f7c);}return _0x7943b6;}return this[_0x06b2('0x3c')]['error'](_0x4f7a3e,_0x06b2('0x1c3'));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1c4')]=function(_0x8a4674){logger['info'](util[_0x06b2('0x2d')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x8a4674[_0x06b2('0x3e')]));_0x8a4674[_0x06b2('0x61')]=_0x8a4674['text'][_0x06b2('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x06b2('0xa6')](_0x8a4674[_0x06b2('0x61')])){return this[_0x06b2('0x3c')][_0x06b2('0xad')]('no\x20text\x20configured');}this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')]('Trying\x20Google\x20TTS\x20%s',_0x8a4674['text']));var _0x315269=this[_0x06b2('0x64')]['sync'](this,_0x8a4674);if(_0x315269){this[_0x06b2('0x3c')][_0x06b2('0xad')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x315269));var _0x3a9aaa=this[_0x06b2('0x3c')][_0x06b2('0x10d')](_0x315269);try{fs[_0x06b2('0x12c')](_0x315269+_0x06b2('0x10e'));}catch(_0x32a3fd){logger[_0x06b2('0x31')](_0x32a3fd);}return _0x3a9aaa;}return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x8a4674,_0x06b2('0x1c5'));};AGIVertices[_0x06b2('0x15')]['unpause']=function(_0x21817c){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x1c6'),_0x21817c['label']));if(!this[_0x06b2('0xa6')](_0x21817c[_0x06b2('0x161')])){return this[_0x06b2('0x3c')]['error'](_0x21817c,'no\x20find\x20by\x20configured');}logger[_0x06b2('0xa4')](util['format'](_0x06b2('0x160'),this['channel'][_0x06b2('0x41')],_0x21817c[_0x06b2('0x161')]));var _0x3494ef=this[_0x06b2('0x1c7')][_0x06b2('0xa8')](this,_0x21817c[_0x06b2('0x161')]);if(_0x3494ef){logger['info'](util[_0x06b2('0x2d')](_0x06b2('0x162'),this[_0x06b2('0x3c')]['callerid'],_0x21817c['findBy']));this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x162'),this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x21817c['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')](_0x06b2('0x163'),this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x21817c[_0x06b2('0x161')]));this[_0x06b2('0x3c')][_0x06b2('0xad')](util[_0x06b2('0x2d')](_0x06b2('0x163'),this[_0x06b2('0x3c')][_0x06b2('0x41')],_0x21817c['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x06b2('0x1c8')]=function(_0x1eb0d4){logger['info'](util[_0x06b2('0x2d')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1eb0d4[_0x06b2('0x3e')]));var _0x8d7c9=this[_0x06b2('0x3c')][_0x06b2('0x5c')](_0x06b2('0x1c9'),[_0x1eb0d4['mailbox'],_0x1eb0d4[_0x06b2('0x79')]]);if(_0x8d7c9[_0x06b2('0xa3')]===-0x1){return _0x8d7c9;}return this[_0x06b2('0x3c')][_0x06b2('0xad')](util['format'](_0x06b2('0xc8'),_0x06b2('0x1c9'),_0x1eb0d4[_0x06b2('0x1ca')]));};AGIVertices[_0x06b2('0x15')][_0x06b2('0x1cb')]=function(_0x5b81d5){logger[_0x06b2('0xa4')](util[_0x06b2('0x2d')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5b81d5['label']));if(!this['isConfigured'](_0x5b81d5[_0x06b2('0xde')])){return this[_0x06b2('0x3c')][_0x06b2('0x31')](_0x5b81d5,_0x06b2('0x1ab'));}var _0x503fb5=this['getVariable'][_0x06b2('0xa8')](this,_0x5b81d5[_0x06b2('0xde')]);if(!_0x503fb5){return this[_0x06b2('0x3c')]['error'](_0x5b81d5,_0x06b2('0xe0'));}var _0x3ea767=this['channel'][_0x06b2('0x10')](_0x503fb5);return{'code':0xc8,'result':_0x3ea767[_0x06b2('0xa1')]?_0x3ea767['extra']:'-'};};String[_0x06b2('0x15')][_0x06b2('0xa0')]=function(_0x3713eb,_0x1bc1b7){return this[_0x06b2('0x9f')](_0x3713eb)['join'](_0x1bc1b7);};module['exports']=AGIVertices; \ No newline at end of file +var _0x5eb8=['no\x20variable\x20found','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','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','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','Enter\x20in\x20MENU\x20(%s)\x20block','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','QUEUE','gosub','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','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueueById','then','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','lastName','phone','scheduledAt','callback','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','timeout','number','POST','PUT','method','toUpperCase','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','parse','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','googleASR','tildeASR','appid','clear','includes','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','isEmpty','saveRestApiResult','%s.%s','setVariable','stringify','split','replaceAll','getAndSetVariable','result','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit'];(function(_0x5cef55,_0x5a0697){var _0x30f7d=function(_0x501d18){while(--_0x501d18){_0x5cef55['push'](_0x5cef55['shift']());}};_0x30f7d(++_0x5a0697);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5b4c44,_0x2e495e){_0x5b4c44=_0x5b4c44-0x0;var _0x58485a=_0x5eb8[_0x5b4c44];return _0x58485a;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require(_0x85eb('0x0'));var odbc=require(_0x85eb('0x1'))();var rs=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var Mustache=require(_0x85eb('0x4'));var rp=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var shared=require(_0x85eb('0x9'));var scripts=require(_0x85eb('0xa'));var FILES_PATH=_0x85eb('0xb');var recursiveMapAttributes=['rawHeaders',_0x85eb('0xc')];var verticesWithRetry=[_0x85eb('0xd'),_0x85eb('0xe'),'getsecretdigits'];var AGIVertices=function(_0x2da3b0,_0x50ea77,_0x1f0036){this[_0x85eb('0xf')]=_0x2da3b0;this[_0x85eb('0x10')]=_0x50ea77;this[_0x85eb('0x11')]=_0x1f0036;};AGIVertices[_0x85eb('0x12')][_0x85eb('0x13')]=function(_0x2c7fd3,_0x50ef6f){this[_0x85eb('0x10')][_0x85eb('0x14')](_0x2c7fd3)['then'](function(_0x2af376){_0x50ef6f(null,_0x2af376?_0x2af376[_0x85eb('0x15')]:![]);})[_0x85eb('0x16')](function(_0x259f72){_0x50ef6f(_0x259f72);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x394c74,_0x5c760a){this[_0x85eb('0x10')][_0x85eb('0x17')](_0x394c74)[_0x85eb('0x18')](function(_0x1604ba){_0x5c760a(null,_0x1604ba?_0x1604ba[_0x85eb('0x15')]:![]);})['catch'](function(_0x2e5c0a){_0x5c760a(_0x2e5c0a);});};AGIVertices['prototype'][_0x85eb('0x19')]=function(_0x10c2c9,_0x3e23e8){this[_0x85eb('0x10')]['getSquareProjectById'](_0x10c2c9)['then'](function(_0x50d2a8){_0x3e23e8(null,_0x50d2a8?_0x50d2a8[_0x85eb('0x15')]:![]);})[_0x85eb('0x16')](function(_0x10cf2f){_0x3e23e8(_0x10cf2f);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1a')]=function(_0x34f875,_0x5acd3d){this[_0x85eb('0x10')][_0x85eb('0x1b')](_0x34f875)[_0x85eb('0x18')](function(_0x4e8041){_0x5acd3d(null,_0x4e8041?_0x4e8041['dsn']:![]);})['catch'](function(_0x55b9e4){_0x5acd3d(_0x55b9e4);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1c')]=function(_0x329fc5,_0x255ca7){this[_0x85eb('0x10')][_0x85eb('0x1d')](_0x329fc5)['then'](function(_0x5491d5){_0x255ca7(null,_0x5491d5?_0x5491d5['name']:![]);})[_0x85eb('0x16')](function(_0x1426c8){_0x255ca7(_0x1426c8);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1e')]=function(_0x312b3e,_0x210aef){this['rpc'][_0x85eb('0x1f')](_0x312b3e)[_0x85eb('0x18')](function(_0x4709ad){_0x210aef(null,_0x4709ad?_0x4709ad[_0x85eb('0x15')]:![]);})[_0x85eb('0x16')](function(_0x57a03c){_0x210aef(_0x57a03c);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x20')]=function(_0x291557,_0x3e7eb9){var _0x40f13e=this;this[_0x85eb('0x10')]['getSoundById'](_0x291557)['then'](function(_0x37515c){_0x3e7eb9(null,_0x37515c?_0x40f13e['getSoundPath'](_0x37515c[_0x85eb('0x21')]):![]);})['catch'](function(_0x4229e9){_0x3e7eb9(_0x4229e9);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x22')]=function(_0x1d9278,_0xa67e1c){this[_0x85eb('0x10')][_0x85eb('0x23')](_0x1d9278)['then'](function(_0x237f19){_0xa67e1c(null,_0x237f19?_0x237f19:![]);})[_0x85eb('0x16')](function(_0x515ee9){_0xa67e1c(_0x515ee9);});};AGIVertices[_0x85eb('0x12')]['sendMailMessage']=function(_0x5439aa,_0x3c5ecc,_0x3a533c){this[_0x85eb('0x11')][_0x85eb('0x24')](_0x5439aa,_0x3c5ecc)[_0x85eb('0x18')](function(){_0x3a533c(null);})[_0x85eb('0x16')](function(_0x39b574){_0x3a533c(_0x39b574);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x25')]=function(_0x1008bf,_0x4cbee0){this[_0x85eb('0x10')][_0x85eb('0x26')](_0x1008bf)['then'](function(_0x505321){if(_0x505321){if(_0x505321[_0x85eb('0x27')]){_0x4cbee0(null,[_0x505321[_0x85eb('0x28')]]);}else{_0x4cbee0(null,_[_0x85eb('0x29')](_0x505321[_0x85eb('0x2a')],_0x85eb('0x28')));}}else{_0x4cbee0(null,![]);}})[_0x85eb('0x16')](function(_0xf4d0e4){_0x4cbee0(_0xf4d0e4);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x2b')]=function(_0x373e5f){return util[_0x85eb('0x2c')](_0x85eb('0x2d'),FILES_PATH,_0x373e5f);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x2e')]=function(_0x4b69a7,_0x4361e2,_0x3dfe74){odbc['open'](_0x4b69a7,function(_0x5b77e5){if(_0x5b77e5){logger[_0x85eb('0x2f')](_0x85eb('0x30'),_0x5b77e5);_0x3dfe74(_0x5b77e5);}else{logger['info'](_0x85eb('0x31'));odbc['query'](_0x4361e2,function(_0x4440ec,_0x5937e5){if(_0x4440ec){logger[_0x85eb('0x32')]('Error\x20executing\x20query\x20%s',_0x4361e2);_0x3dfe74(_0x4440ec);}else{logger[_0x85eb('0x32')]('Query\x20executed\x20correctly\x20%s',_0x4361e2);odbc[_0x85eb('0x33')](function(_0x16202e){if(_0x16202e){logger['error'](_0x85eb('0x34'),_0x16202e);}_0x3dfe74(null,_0x5937e5);});}});}});};AGIVertices['prototype'][_0x85eb('0x35')]=function(_0x331260,_0x5c0156){this[_0x85eb('0x10')]['getSmsAccountById'](_0x331260)['then'](function(_0x1b8a71){_0x5c0156(null,_0x1b8a71?_0x1b8a71:![]);})['catch'](function(_0x17cc20){_0x5c0156(_0x17cc20);});};AGIVertices[_0x85eb('0x12')]['createSmsMessage']=function(_0x49a0cd,_0x1e336c){this[_0x85eb('0x10')]['createSmsMessage'](_0x49a0cd)['then'](function(_0x2864e2){_0x1e336c(null,_0x2864e2);})[_0x85eb('0x16')](function(_0x2211f9){_0x1e336c(_0x2211f9);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x36')]=function(_0x5b7411,_0x5ccf8a,_0x1681fc){this[_0x85eb('0x10')][_0x85eb('0x36')]({'uniqueid':this[_0x85eb('0xf')][_0x85eb('0x37')],'node':_0x5b7411[_0x85eb('0x38')],'application':_0x5b7411[_0x85eb('0x39')],'data':_0x5ccf8a||null,'project_name':this[_0x85eb('0xf')]['arg_1'],'callerid':this[_0x85eb('0xf')][_0x85eb('0x3a')]})['then'](function(_0x1b77b3){if(_0x1681fc){_0x1681fc(null,_0x1b77b3);}})[_0x85eb('0x16')](function(_0x2dae5b){if(_0x1681fc){_0x1681fc(_0x2dae5b);}});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x3b')]=function(_0x2372ad,_0x589cb1,_0x246f3a,_0x1258bc){this[_0x85eb('0x10')][_0x85eb('0x3b')]({'uniqueid':this[_0x85eb('0xf')][_0x85eb('0x37')],'callerid':this[_0x85eb('0xf')][_0x85eb('0x3a')],'calleridname':this['channel'][_0x85eb('0x3c')],'context':this[_0x85eb('0xf')][_0x85eb('0x3d')],'extension':this[_0x85eb('0xf')][_0x85eb('0x3e')],'priority':this[_0x85eb('0xf')][_0x85eb('0x3f')],'accountcode':this[_0x85eb('0xf')][_0x85eb('0x40')],'dnid':this[_0x85eb('0xf')][_0x85eb('0x41')],'projectName':this[_0x85eb('0xf')]['arg_1'],'saveName':_0x589cb1,'filename':_0x2372ad[_0x85eb('0x42')]||_0x589cb1,'savePath':_0x246f3a})[_0x85eb('0x18')](function(_0x22d9d6){_0x1258bc(null,_0x22d9d6);})['catch'](function(_0xb3b646){_0x1258bc(_0xb3b646);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x43')]=function(_0xd2f302,_0xd3ff2b,_0x4a7506,_0x2ef4d1,_0x12c4cc){this[_0x85eb('0x10')]['createSquareMessage']({'uniqueid':this[_0x85eb('0xf')][_0x85eb('0x37')],'body':_0xd2f302,'direction':_0xd3ff2b,'providerName':_0x4a7506,'providerResponse':_0x2ef4d1})[_0x85eb('0x18')](function(_0x4c06ef){if(_0x12c4cc){_0x12c4cc(null,_0x4c06ef);}})['catch'](function(_0x2299d7){if(_0x12c4cc){_0x12c4cc(_0x2299d7);}});};AGIVertices['prototype']['createCmContact']=function(_0x3f0b0c,_0x593723){this[_0x85eb('0x10')][_0x85eb('0x44')]({'firstName':_['isEmpty'](_0x3f0b0c['name'])||_[_0x85eb('0x45')](_0x3f0b0c[_0x85eb('0x15')])?_0x85eb('0x46')+Math[_0x85eb('0x47')]():_0x3f0b0c[_0x85eb('0x15')],'lastName':_['isEmpty'](_0x3f0b0c[_0x85eb('0x48')])||_[_0x85eb('0x45')](_0x3f0b0c[_0x85eb('0x48')])?null:_0x3f0b0c[_0x85eb('0x48')],'phone':_0x3f0b0c[_0x85eb('0x49')],'ListId':_0x3f0b0c['list_id'],'scheduledat':_0x3f0b0c[_0x85eb('0x4a')],'callbackUniqueid':this['channel'][_0x85eb('0x37')],'tags':_0x85eb('0x4b'),'description':'Callback\x20scheduled\x20at\x20'+_0x3f0b0c[_0x85eb('0x4a')][_0x85eb('0x4c')](),'priority':_0x3f0b0c[_0x85eb('0x4d')]})[_0x85eb('0x18')](function(_0x214ef7){_0x593723(null,_0x214ef7);})[_0x85eb('0x16')](function(_0x5a45a0){_0x593723(_0x5a45a0);});};AGIVertices[_0x85eb('0x12')]['getPause']=function(_0x311857,_0x20f4b3){this['rpc'][_0x85eb('0x4e')](_0x311857)[_0x85eb('0x18')](function(_0x4a3af9){_0x20f4b3(null,_0x4a3af9?_0x4a3af9[_0x85eb('0x15')]:![]);})['catch'](function(_0x452e7e){_0x20f4b3(_0x452e7e);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x4f')]=function(_0x13c0b3,_0x45a201,_0x15d4a7){var _0x5a729e={'role':_0x85eb('0x50')};_0x5a729e[_0x13c0b3]=this[_0x85eb('0xf')][_0x85eb('0x3a')];this[_0x85eb('0x10')][_0x85eb('0x4f')](_0x5a729e,_0x45a201,this[_0x85eb('0xf')][_0x85eb('0x37')])[_0x85eb('0x18')](function(_0x425db9){_0x15d4a7(null,_[_0x85eb('0x45')](_0x425db9)?![]:!![]);})[_0x85eb('0x16')](function(_0x54112d){logger[_0x85eb('0x2f')](_0x54112d);_0x15d4a7(null,![]);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x51')]=function(_0xdaf2fe,_0x4470b3){var _0x213b64={'role':'agent'};_0x213b64[_0xdaf2fe]=this[_0x85eb('0xf')]['callerid'];this[_0x85eb('0x10')][_0x85eb('0x51')](_0x213b64)[_0x85eb('0x18')](function(_0x243672){_0x4470b3(null,_[_0x85eb('0x45')](_0x243672)?![]:!![]);})['catch'](function(_0x243b9a){logger[_0x85eb('0x2f')](_0x243b9a);_0x4470b3(null,![]);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x52')]=function(_0x10af0e,_0x14cab8){var _0x23fcf9={'role':_0x85eb('0x50')};_0x23fcf9[_0x10af0e]=this['channel'][_0x85eb('0x3a')];this['rpc'][_0x85eb('0x52')](_0x23fcf9)[_0x85eb('0x18')](function(_0x2ac293){_0x14cab8(null,_[_0x85eb('0x45')](_0x2ac293)?![]:!![]);})[_0x85eb('0x16')](function(_0x547ccb){logger[_0x85eb('0x2f')](_0x547ccb);_0x14cab8(null,![]);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x53')]=function(_0x235fde,_0x47487e){var _0x419b24={'role':'agent'};_0x419b24[_0x235fde]=this['channel'][_0x85eb('0x3a')];var _0x572560=_0x235fde!=_0x85eb('0x54')?util[_0x85eb('0x2c')](_0x85eb('0x55'),_0x85eb('0x56'),this[_0x85eb('0xf')][_0x85eb('0x3a')]):undefined;this['rpc'][_0x85eb('0x53')](_0x419b24,_0x572560)[_0x85eb('0x18')](function(_0x3f30e4){_0x47487e(null,_[_0x85eb('0x45')](_0x3f30e4)?![]:!![]);})['catch'](function(_0x1d513c){logger[_0x85eb('0x2f')](_0x1d513c);_0x47487e(null,![]);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x57')]=function(_0x5037c7,_0x459317){sh[_0x85eb('0x58')](_[_0x85eb('0x59')](_0x5037c7),function(_0x5fcd48,_0x288db7){var _0x131ea4=_0x288db7[_0x85eb('0x5a')](/(\r\n|\n|\r)/gm,'');_0x459317(null,_0x131ea4);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x5b')]=function(_0x1db157,_0x170a60){scripts[_0x85eb('0x5b')](_0x1db157[_0x85eb('0x5c')],_0x1db157[_0x85eb('0x5d')]||_0x85eb('0x5e'),_0x1db157[_0x85eb('0x5e')],_0x1db157[_0x85eb('0x5f')]||_0x85eb('0x60'),_0x1db157[_0x85eb('0x61')]||'MALE',_0x1db157[_0x85eb('0x62')]||'MP3')[_0x85eb('0x18')](function(_0x2346b1){_0x170a60(null,_0x2346b1);})[_0x85eb('0x16')](function(_0x1e87d2){_0x170a60(_0x1e87d2);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x63')]=function(_0x9f4f,_0x3076df){scripts[_0x85eb('0x63')](_0x9f4f['text'],_0x9f4f[_0x85eb('0x64')]||'en',0x1)[_0x85eb('0x18')](function(_0x2d795b){_0x3076df(null,_0x2d795b);})[_0x85eb('0x16')](function(_0x440968){_0x3076df(_0x440968);});};AGIVertices['prototype'][_0x85eb('0x65')]=function(_0x589702,_0x24e609){var _0x330c2b={'uri':_0x589702[_0x85eb('0x66')],'method':_0x589702['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x589702[_0x85eb('0x67')])===_0x85eb('0x68')&&parseInt(_0x589702[_0x85eb('0x67')])>=0x1?parseInt(_0x589702['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x85eb('0x69'),_0x85eb('0x6a')],_0x330c2b[_0x85eb('0x6b')][_0x85eb('0x6c')]())){try{_0x330c2b['body']=_0x589702[_0x85eb('0xc')]?JSON['parse'](_0x589702[_0x85eb('0xc')]):{};}catch(_0xed99f7){logger[_0x85eb('0x2f')](_0x85eb('0x6d'),_0xed99f7);}}try{_0x330c2b[_0x85eb('0x6e')]=_0x589702[_0x85eb('0x6f')]?JSON['parse'](_0x589702[_0x85eb('0x6f')]):{};}catch(_0x5c9738){logger[_0x85eb('0x2f')](_0x85eb('0x70'),_0x5c9738);}if(_0x589702[_0x85eb('0x71')]){try{var _0x4befc2=require(_0x589702[_0x85eb('0x71')])[_0x85eb('0x72')](this,_0x330c2b);_0x330c2b[_0x85eb('0x73')]=Mustache[_0x85eb('0x74')](_0x589702[_0x85eb('0x66')],_0x4befc2,{},['$$','$$']);if(_0x330c2b['headers']){_0x330c2b[_0x85eb('0x6e')]=JSON[_0x85eb('0x75')](Mustache['render'](JSON['stringify'](_0x330c2b[_0x85eb('0x6e')]),_0x4befc2,{},['$$','$$']));}if(_0x330c2b['body']){_0x330c2b[_0x85eb('0x76')]=JSON['parse'](Mustache[_0x85eb('0x74')](JSON['stringify'](_0x330c2b[_0x85eb('0x76')]),_0x4befc2,{},['$$','$$']));}}catch(_0xa7ce67){logger['error'](_0x85eb('0x77'),_0xa7ce67);}}rp(_0x330c2b)[_0x85eb('0x18')](function(_0x555236){var _0x888c46={'statusCode':_0x555236[_0x85eb('0x78')]||0xc8,'statusMessage':_0x555236[_0x85eb('0x79')]||'OK','headers':_0x555236[_0x85eb('0x6e')]||{},'body':_0x555236['body']||{}};_0x24e609(null,_0x888c46);})[_0x85eb('0x16')](function(_0x53ccc5){var _0x3acae9={'statusCode':_0x53ccc5[_0x85eb('0x78')]||0x1f4,'statusMessage':_0x53ccc5[_0x85eb('0x7a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x53ccc5[_0x85eb('0x7b')][_0x85eb('0x6e')]||{},'body':_0x53ccc5[_0x85eb('0x7b')]['body']||{}};_0x24e609(null,_0x3acae9);});};AGIVertices[_0x85eb('0x12')]['googleDialogflow']=function(_0x26cc46,_0x2b43dd){scripts[_0x85eb('0x7c')](this['channel']['uniqueid'],_0x26cc46['key'],_0x26cc46[_0x85eb('0x5e')],_0x26cc46[_0x85eb('0x7d')]||'en')[_0x85eb('0x18')](function(_0x543c22){_0x2b43dd(null,_0x543c22);})[_0x85eb('0x16')](function(_0x436724){_0x2b43dd(_0x436724);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x7e')]=function(_0x1faa89,_0x485a9c){scripts['googleDialogflowV2'](this[_0x85eb('0xf')][_0x85eb('0x37')],_0x1faa89['dialogflowV2_project_id'],_0x1faa89[_0x85eb('0x7f')],_0x1faa89[_0x85eb('0x80')],_0x1faa89[_0x85eb('0x5e')],_0x1faa89[_0x85eb('0x81')]||'en')[_0x85eb('0x18')](function(_0x1da9bd){_0x485a9c(null,_0x1da9bd);})[_0x85eb('0x16')](function(_0xcd22ce){_0x485a9c(_0xcd22ce);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x82')]=function(_0x380d23,_0x42cfca){scripts[_0x85eb('0x82')](this[_0x85eb('0xf')],_0x380d23)[_0x85eb('0x18')](function(_0x4b893c){_0x42cfca(null,_0x4b893c);})[_0x85eb('0x16')](function(_0x22112e){_0x42cfca(_0x22112e);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x83')]=function(_0x24b705,_0x23191c){scripts[_0x85eb('0x83')](_0x24b705[_0x85eb('0x84')],_0x24b705[_0x85eb('0x5e')],_0x24b705[_0x85eb('0x85')]||'en-US',_0x24b705[_0x85eb('0x86')])[_0x85eb('0x18')](function(_0x48439c){_0x23191c(null,_0x48439c);})[_0x85eb('0x16')](function(_0x4df73a){_0x23191c(_0x4df73a);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x87')]=function(_0x30ee4e,_0xd060a9,_0x362ba9){scripts[_0x85eb('0x87')](_0xd060a9,_0x30ee4e['key'],_0x30ee4e[_0x85eb('0x88')]||_0x85eb('0x60'),this[_0x85eb('0x89')](_0x30ee4e['model'])?_0x30ee4e[_0x85eb('0x8a')]:undefined)[_0x85eb('0x18')](function(_0x2d0bfb){_0x362ba9(null,_0x2d0bfb);})[_0x85eb('0x16')](function(_0x364e1a){_0x362ba9(_0x364e1a);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x8b')]=function(_0x1af0ce,_0x4e55e2){scripts[_0x85eb('0x8b')](_0x1af0ce[_0x85eb('0x8c')],_0x1af0ce['aws_secret_access_key'],_0x1af0ce['aws_polly_region'],_0x1af0ce[_0x85eb('0x8d')]||'Amy',_0x1af0ce[_0x85eb('0x5e')],_0x1af0ce[_0x85eb('0x8e')]||_0x85eb('0x5e'))[_0x85eb('0x18')](function(_0x486040){_0x4e55e2(null,_0x486040);})['catch'](function(_0x38c6ed){_0x4e55e2(_0x38c6ed);});};AGIVertices['prototype'][_0x85eb('0x8f')]=function(_0xa47647,_0x153076){scripts[_0x85eb('0x8f')](this['channel']['uniqueid'],_0xa47647[_0x85eb('0x8c')],_0xa47647[_0x85eb('0x90')],_0xa47647[_0x85eb('0x91')],_0xa47647['text'],_0xa47647['aws_bot_name'])[_0x85eb('0x18')](function(_0x138316){_0x153076(null,_0x138316);})[_0x85eb('0x16')](function(_0x20c335){_0x153076(_0x20c335);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x92')]=function(_0x819d42,_0xe7512c,_0xa5feb7){scripts[_0x85eb('0x92')](_0xe7512c,_0x819d42[_0x85eb('0x84')],_0x819d42['google_asr_language']||_0x85eb('0x60'))[_0x85eb('0x18')](function(_0x483f5f){_0xa5feb7(null,_0x483f5f);})[_0x85eb('0x16')](function(_0x3c8e3e){_0xa5feb7(_0x3c8e3e);});};AGIVertices[_0x85eb('0x12')][_0x85eb('0x93')]=function(_0x3426b5,_0x399e84,_0x4c7651){scripts['tildeASR'](_0x399e84,_0x3426b5[_0x85eb('0x94')],_0x3426b5['appsecret'],_0x3426b5[_0x85eb('0x73')])['then'](function(_0x25c8e4){_0x4c7651(null,_0x25c8e4);})[_0x85eb('0x16')](function(_0x5e8478){_0x4c7651(_0x5e8478);});};AGIVertices['prototype'][_0x85eb('0x95')]=function(_0x3eeb6d){var _0x4becbc=_[_0x85eb('0x96')](verticesWithRetry,_0x3eeb6d[_0x85eb('0x39')])?_0x3eeb6d:_[_0x85eb('0x97')](_0x3eeb6d);for(var _0x48ed21 in _0x4becbc){if(_0x4becbc['hasOwnProperty'](_0x48ed21)){if(_0x4becbc[_0x48ed21]&&_[_0x85eb('0x98')](_0x4becbc[_0x48ed21])){if(_[_0x85eb('0x96')](recursiveMapAttributes,_0x48ed21)){_0x4becbc[_0x48ed21]=this[_0x85eb('0x99')](_0x4becbc[_0x48ed21]);}else{_0x4becbc[_0x48ed21]=this[_0x85eb('0x9a')](_0x4becbc[_0x48ed21]);}}}}return _0x4becbc;};AGIVertices[_0x85eb('0x12')][_0x85eb('0x9b')]=function(_0x400238){for(var _0x15bbbb in _0x400238){if(_0x400238[_0x85eb('0x9c')](_0x15bbbb)){if(_[_0x85eb('0x9d')](_0x400238[_0x15bbbb])){this['recursiveNodeIndex'](_0x400238[_0x15bbbb]);}else if(_[_0x85eb('0x9e')](_0x400238[_0x15bbbb])){for(var _0x4d8d44=0x0;_0x4d8d44<_0x400238[_0x15bbbb][_0x85eb('0x9f')];_0x4d8d44++){this[_0x85eb('0x9b')](_0x400238[_0x15bbbb][_0x4d8d44]);}}else if(_[_0x85eb('0x98')](_0x400238[_0x15bbbb])){_0x400238[_0x15bbbb]=this[_0x85eb('0x9a')](_0x400238[_0x15bbbb]);}}}};AGIVertices[_0x85eb('0x12')]['saveRestApiResult']=function(_0x34c380,_0x24cd4b){for(var _0x3bf9b4 in _0x34c380){if(_0x34c380['hasOwnProperty'](_0x3bf9b4)){if(_[_0x85eb('0x9d')](_0x34c380[_0x3bf9b4])){if(!_[_0x85eb('0xa0')](_0x34c380[_0x3bf9b4])){this[_0x85eb('0xa1')](_0x34c380[_0x3bf9b4],util[_0x85eb('0x2c')](_0x85eb('0xa2'),_0x24cd4b,_0x3bf9b4));}}else if(_[_0x85eb('0x9e')](_0x34c380[_0x3bf9b4])){for(var _0x209800=0x0;_0x209800<_0x34c380[_0x3bf9b4][_0x85eb('0x9f')];_0x209800++){this[_0x85eb('0xa1')](_0x34c380[_0x3bf9b4][_0x209800],util[_0x85eb('0x2c')](_0x85eb('0xa2'),_0x24cd4b,_0x3bf9b4+'['+_0x209800+']'));}}else{if(!_[_0x85eb('0x45')](_0x34c380[_0x3bf9b4])){this[_0x85eb('0xf')][_0x85eb('0xa3')](util[_0x85eb('0x2c')](_0x85eb('0xa2'),_0x24cd4b,_0x3bf9b4),_0x34c380[_0x3bf9b4]);}}}}};AGIVertices['prototype'][_0x85eb('0x99')]=function(_0xc1edff){try{var _0x1c13a9=JSON[_0x85eb('0x75')](_0xc1edff);this[_0x85eb('0x9b')](_0x1c13a9);return JSON[_0x85eb('0xa4')](_0x1c13a9);}catch(_0x3e4d2f){return this['replaceAllVariables'](_0xc1edff);}};AGIVertices[_0x85eb('0x12')][_0x85eb('0x9a')]=function(_0x58b00a){var _0x46a33e=_0x58b00a['split']('{');for(var _0x38c56f=0x1;_0x38c56f<_0x46a33e[_0x85eb('0x9f')];_0x38c56f+=0x1){var _0x933d13=_0x46a33e[_0x38c56f][_0x85eb('0xa5')]('}');if(_0x933d13[_0x85eb('0x9f')]>0x1){_0x58b00a=_0x58b00a[_0x85eb('0xa6')]('{'+_0x933d13[0x0]+'}',this[_0x85eb('0xf')][_0x85eb('0x13')](_0x933d13[0x0])['extra']||_0x933d13[0x0]);}}if(_0x46a33e['length']===0x1){return _0x58b00a[_0x85eb('0x4c')]();}return this[_0x85eb('0x9a')](_0x58b00a);};AGIVertices[_0x85eb('0x12')][_0x85eb('0xa7')]=function(_0x4ac7a6,_0x44de5f){var _0x2e2af5=this[_0x85eb('0xf')]['getVariable'](_0x4ac7a6);if(_0x2e2af5[_0x85eb('0xa8')]===-0x1){return _0x2e2af5;}logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x44de5f,_0x2e2af5[_0x85eb('0xa9')]));return this[_0x85eb('0xf')][_0x85eb('0xa3')](_0x44de5f,_0x2e2af5['extra']);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x89')]=function(_0x404fef){return _0x404fef&&_0x404fef!=='0'&&_0x404fef!=='-1'&&_0x404fef!=='';};AGIVertices[_0x85eb('0x12')][_0x85eb('0xaa')]=function(_0x1a2426){this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x1a2426,'-');_0x1a2426[_0x85eb('0xab')]=_0x1a2426['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x85eb('0x12')][_0x85eb('0xac')]=function(_0x27436e){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xad'),_0x27436e['label']));if(!this['isConfigured'](_0x27436e[_0x85eb('0x5e')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xaf'));}var _0x34e916='\x22'+_0x27436e[_0x85eb('0x5e')]+'\x22';if(this[_0x85eb('0x89')](_0x27436e['options'])){_0x34e916+=','+_0x27436e[_0x85eb('0x7b')];}var _0x460b51=this['channel'][_0x85eb('0x58')](_0x85eb('0xb0'),_0x34e916);if(_0x460b51[_0x85eb('0xa8')]===-0x1){return _0x460b51;}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xb1'),_0x34e916));};AGIVertices[_0x85eb('0x12')][_0x85eb('0xb2')]=function(_0x494aa6){logger['info'](util['format'](_0x85eb('0xb3'),_0x494aa6[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x494aa6[_0x85eb('0xb4')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xb5'));}var _0x384eb8=_0x494aa6[_0x85eb('0xb4')];if(this[_0x85eb('0x89')](_0x494aa6['options'])){_0x384eb8+=','+_0x494aa6[_0x85eb('0x7b')];}var _0x1c8512=this[_0x85eb('0xf')][_0x85eb('0x58')](_0x85eb('0xb6'),_0x384eb8);if(_0x1c8512[_0x85eb('0xa8')]===-0x1){return _0x1c8512;}var _0x495b8f=this[_0x85eb('0xa7')]('RECOG_CONFIDENCE()',_0x85eb('0xb7'));if(_0x495b8f['result']===-0x1){return _0x495b8f;}var _0x242735=this[_0x85eb('0xa7')](_0x85eb('0xb8'),_0x85eb('0xb9'));if(_0x242735[_0x85eb('0xa8')]===-0x1){return _0x242735;}var _0x1593cd=this[_0x85eb('0xa7')](_0x85eb('0xba'),'MRCP_RECOG_INSTANCE');if(_0x1593cd['result']===-0x1){return _0x1593cd;}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xbb'),_0x384eb8));};AGIVertices[_0x85eb('0x12')]['agi']=function(_0x14e594){logger['info'](util['format'](_0x85eb('0xbc'),_0x14e594[_0x85eb('0x38')]));return this['channel'][_0x85eb('0x7')]([_0x14e594[_0x85eb('0xbd')],_0x14e594[_0x85eb('0xbe')]]);};AGIVertices[_0x85eb('0x12')][_0x85eb('0xbf')]=function(_0x490d17){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xc0'),_0x490d17[_0x85eb('0x38')]));if(this[_0x85eb('0x89')](_0x490d17[_0x85eb('0x67')])){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xc1'),_0x490d17[_0x85eb('0x67')]));var _0x4eda40=this['channel']['wait'](_0x490d17[_0x85eb('0x67')]);if(_0x4eda40[_0x85eb('0xa8')]===-0x1){return _0x4eda40;}}return this[_0x85eb('0xf')]['answer']();};AGIVertices[_0x85eb('0x12')][_0x85eb('0x4b')]=function(_0x51de1d){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xc2'),_0x51de1d[_0x85eb('0x38')]));if(!this['isConfigured'](_0x51de1d[_0x85eb('0xc3')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x51de1d,_0x85eb('0xc4'));}_0x51de1d[_0x85eb('0x4a')]=moment();if(this[_0x85eb('0x89')](_0x51de1d[_0x85eb('0xc5')])){_0x51de1d[_0x85eb('0x4a')]=moment()['add'](_0x51de1d[_0x85eb('0xc5')],_0x85eb('0xc6'));}if(!this['isConfigured'](_0x51de1d[_0x85eb('0x4d')])){_0x51de1d['callback_priority']=0x2;}this[_0x85eb('0x44')][_0x85eb('0x72')](this,_0x51de1d);return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x51de1d[_0x85eb('0x49')],_0x51de1d['list_id'],_0x51de1d['scheduledAt']));};AGIVertices[_0x85eb('0x12')][_0x85eb('0xc7')]=function(_0x58ba75){logger[_0x85eb('0x32')](util['format'](_0x85eb('0xc8'),_0x58ba75[_0x85eb('0x38')]));var _0x437908=this[_0x85eb('0xf')][_0x85eb('0x58')](_0x58ba75[_0x85eb('0xc9')],_0x58ba75[_0x85eb('0x7b')]);if(_0x437908[_0x85eb('0xa8')]===-0x1){return _0x437908;}return this['channel']['noop'](util[_0x85eb('0x2c')](_0x85eb('0xca'),_0x58ba75[_0x85eb('0xc9')],_0x58ba75[_0x85eb('0x7b')]));};AGIVertices[_0x85eb('0x12')][_0x85eb('0xcb')]=function(_0x6658e3){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xcc'),_0x6658e3[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x6658e3[_0x85eb('0x5e')])){return this['channel'][_0x85eb('0xae')](_0x85eb('0xaf'));}var _0x556714='\x22'+_0x6658e3['text']+'\x22';if(this['isConfigured'](_0x6658e3[_0x85eb('0x7b')])){_0x556714+=','+_0x6658e3[_0x85eb('0x7b')];}var _0x2423db=this[_0x85eb('0xf')]['exec'](_0x85eb('0xb0'),_0x556714);if(_0x2423db[_0x85eb('0xa8')]===-0x1){return _0x2423db;}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x556714));};AGIVertices[_0x85eb('0x12')][_0x85eb('0xcd')]=function(_0x5ae2e8){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xce'),_0x5ae2e8[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x5ae2e8[_0x85eb('0x5e')])){return this[_0x85eb('0xf')][_0x85eb('0xae')]('no\x20text\x20configured');}var _0x59d4cc='\x22'+_0x5ae2e8['text']+'\x22';if(this[_0x85eb('0x89')](_0x5ae2e8['options'])){_0x59d4cc+=','+_0x5ae2e8[_0x85eb('0x7b')];}var _0x2c1c73=this[_0x85eb('0xf')][_0x85eb('0x58')](_0x85eb('0xb0'),_0x59d4cc);if(_0x2c1c73[_0x85eb('0xa8')]===-0x1){return _0x2c1c73;}return this['channel'][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xb1'),_0x59d4cc));};AGIVertices[_0x85eb('0x12')][_0x85eb('0xcf')]=function(_0x42209f){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xd0'),_0x42209f['label']));if(!this[_0x85eb('0x89')](_0x42209f[_0x85eb('0xb4')])){return this['channel'][_0x85eb('0xae')](_0x85eb('0xb5'));}var _0x194aa5=_0x42209f[_0x85eb('0xb4')];if(this[_0x85eb('0x89')](_0x42209f[_0x85eb('0x7b')])){_0x194aa5+=','+_0x42209f['options'];}var _0x225aa9=this[_0x85eb('0xf')]['exec']('MRCPRecog',_0x194aa5);if(_0x225aa9[_0x85eb('0xa8')]===-0x1){return _0x225aa9;}var _0x2dc8a1=this['getAndSetVariable'](_0x85eb('0xd1'),_0x85eb('0xd2'));if(_0x2dc8a1['result']===-0x1){return _0x2dc8a1;}var _0x14f631=this[_0x85eb('0xa7')](_0x85eb('0xb8'),_0x85eb('0xd3'));if(_0x14f631[_0x85eb('0xa8')]===-0x1){return _0x14f631;}var _0x49708e=this['getAndSetVariable'](_0x85eb('0xba'),_0x85eb('0xd4'));if(_0x49708e[_0x85eb('0xa8')]===-0x1){return _0x49708e;}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xbb'),_0x194aa5));};AGIVertices['prototype'][_0x85eb('0xd5')]=function(_0x3f6af7){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xd6'),_0x3f6af7[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x3f6af7[_0x85eb('0xb4')])){return this[_0x85eb('0xf')][_0x85eb('0xae')]('no\x20grammar\x20configured');}var _0x2e9baa=_0x3f6af7[_0x85eb('0xb4')];if(this[_0x85eb('0x89')](_0x3f6af7[_0x85eb('0x7b')])){_0x2e9baa+=','+_0x3f6af7[_0x85eb('0x7b')];}var _0x478bc8=this['channel'][_0x85eb('0x58')](_0x85eb('0xb6'),_0x2e9baa);if(_0x478bc8[_0x85eb('0xa8')]===-0x1){return _0x478bc8;}var _0x2d3862=this[_0x85eb('0xa7')](_0x85eb('0xd1'),'SESTEK_ASR_CONFIDENCE');if(_0x2d3862[_0x85eb('0xa8')]===-0x1){return _0x2d3862;}var _0x43be9e=this[_0x85eb('0xa7')]('RECOG_INPUT()',_0x85eb('0xd7'));if(_0x43be9e['result']===-0x1){return _0x43be9e;}var _0xb6fcd=this['getAndSetVariable'](_0x85eb('0xba'),_0x85eb('0xd8'));if(_0xb6fcd[_0x85eb('0xa8')]===-0x1){return _0xb6fcd;}return this['channel'][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xbb'),_0x2e9baa));};AGIVertices[_0x85eb('0x12')]['database']=function(_0x2718ac){logger[_0x85eb('0x32')](util['format'](_0x85eb('0xd9'),_0x2718ac[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x2718ac['odbc_id'])){return this['channel'][_0x85eb('0x2f')](_0x2718ac,_0x85eb('0xda'));}var _0x4355dc=this[_0x85eb('0x1a')][_0x85eb('0x72')](this,_0x2718ac['odbc_id']);if(!_0x4355dc){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x2718ac,'no\x20odbc\x20database\x20found');}if(!this[_0x85eb('0x89')](_0x2718ac[_0x85eb('0xdb')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x2718ac,'no\x20query\x20configured');}var _0x53e310=_0x2718ac[_0x85eb('0xdb')][_0x85eb('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x85eb('0x2c')](_0x85eb('0xdc'),_0x53e310));var _0x912883=this['getQueryOdbc'][_0x85eb('0x72')](this,_0x4355dc,_0x53e310);this[_0x85eb('0x36')]['sync'](this,_0x2718ac,_0x53e310);if(!this[_0x85eb('0x89')](_0x2718ac[_0x85eb('0xdd')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xde'));}var _0x2af442=this['getVariable'][_0x85eb('0x72')](this,_0x2718ac[_0x85eb('0xdd')]);if(!_0x2af442){return this[_0x85eb('0xf')]['error'](_0x2718ac,'no\x20variable\x20found');}var _0x4b1c73=this;_0x912883[_0x85eb('0xdf')](function(_0x5ad172,_0x276bc3){Object[_0x85eb('0xe0')](_0x5ad172)[_0x85eb('0xdf')](function(_0x386c1a){_0x4b1c73[_0x85eb('0xf')][_0x85eb('0xa3')](util[_0x85eb('0x2c')]('%s[%s][%s]',_0x2af442,_0x276bc3,_0x386c1a),_0x5ad172[_0x386c1a]);});});this[_0x85eb('0xf')][_0x85eb('0xa3')](util[_0x85eb('0x2c')](_0x85eb('0xe1'),_0x2af442),_0x912883[_0x85eb('0x9f')]);return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xe2'),_0x2af442));};AGIVertices[_0x85eb('0x12')][_0x85eb('0xe3')]=function(_0x8a2778){logger[_0x85eb('0xe4')](util[_0x85eb('0x2c')](_0x85eb('0xe5'),_0x8a2778['label']));if(!this[_0x85eb('0x89')](_0x8a2778[_0x85eb('0xe6')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x8a2778,'no\x20user\x20selected');}var _0x61fb4=this[_0x85eb('0x1c')][_0x85eb('0x72')](this,_0x8a2778[_0x85eb('0xe6')]);if(!_0x61fb4){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x8a2778,'no\x20user\x20found');}var _0x5431e8=this['channel'][_0x85eb('0x58')](_0x85eb('0xe7'),[util[_0x85eb('0x2c')]('SIP/%s',_0x61fb4),_0x8a2778[_0x85eb('0x67')],_0x8a2778[_0x85eb('0xe8')],_0x8a2778['url']]);if(_0x5431e8[_0x85eb('0xa8')]===-0x1){return _0x5431e8;}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xe9'),_0x85eb('0xe7')));};AGIVertices[_0x85eb('0x12')][_0x85eb('0xea')]=function(_0x196aac){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0xeb'),_0x196aac['label']));if(!this[_0x85eb('0x89')](_0x196aac[_0x85eb('0x84')])){return this['channel'][_0x85eb('0xae')]('no\x20key\x20configured');}if(!this[_0x85eb('0x89')](_0x196aac[_0x85eb('0x5e')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xaf'));}this[_0x85eb('0xf')][_0x85eb('0xec')]=!![];this[_0x85eb('0x36')](_0x196aac);this['createSquareMessage'](_0x196aac['text'],'in','','');this[_0x85eb('0xf')][_0x85eb('0xae')](util['format'](_0x85eb('0xed'),_0x196aac[_0x85eb('0x5e')]));var _0x5e78d8=this[_0x85eb('0x7c')][_0x85eb('0x72')](this,_0x196aac);if(_0x5e78d8){for(var _0x42532c in _0x5e78d8){if(_0x5e78d8['hasOwnProperty'](_0x42532c)){this[_0x85eb('0xf')]['setVariable'](util[_0x85eb('0x2c')](_0x85eb('0xee'),_0x42532c[_0x85eb('0x6c')]()),_0x5e78d8[_0x42532c]);}}this[_0x85eb('0x43')](_0x5e78d8['speech'],_0x85eb('0xef'),_0x85eb('0xea'),'');return this[_0x85eb('0xf')][_0x85eb('0xae')](util['format'](_0x85eb('0xf0'),_0x5e78d8[_0x85eb('0xf1')]));}return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x196aac,_0x85eb('0xf2'));};AGIVertices[_0x85eb('0x12')]['dialogflowV2']=function(_0x3b205e){logger[_0x85eb('0x32')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3b205e[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x3b205e[_0x85eb('0xf3')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xf4'));}if(!this[_0x85eb('0x89')](_0x3b205e[_0x85eb('0x7f')])){return this[_0x85eb('0xf')]['noop'](_0x85eb('0xf5'));}if(!this[_0x85eb('0x89')](_0x3b205e[_0x85eb('0x80')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xf6'));}if(!this[_0x85eb('0x89')](_0x3b205e['dialogflowV2_language'])){return this[_0x85eb('0xf')][_0x85eb('0xae')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x3b205e[_0x85eb('0x5e')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xaf'));}this['channel']['bot']=!![];this[_0x85eb('0x36')](_0x3b205e);this['createSquareMessage'](_0x3b205e[_0x85eb('0x5e')],'in','','');this[_0x85eb('0xf')][_0x85eb('0xae')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x3b205e[_0x85eb('0x5e')]));var _0x4eba7d=this[_0x85eb('0x7e')][_0x85eb('0x72')](this,_0x3b205e);if(_0x4eba7d){for(var _0x4df974 in _0x4eba7d){if(_0x4eba7d[_0x85eb('0x9c')](_0x4df974)){if(_0x4df974!==_0x85eb('0xf7')){this[_0x85eb('0xf')]['setVariable'](util[_0x85eb('0x2c')]('DIALOGFLOW_%s',_0x4df974['toUpperCase']()),_0x4eba7d[_0x4df974]);}}}this[_0x85eb('0x43')](_0x4eba7d[_0x85eb('0xf1')],_0x85eb('0xef'),_0x85eb('0xf8'),_0x4eba7d['providerResponse']);return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xf9'),_0x4eba7d[_0x85eb('0xf1')]));}return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x3b205e,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x85eb('0x12')][_0x85eb('0xfa')]=function(_0x44901e){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x44901e[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x44901e[_0x85eb('0xfb')])){return this[_0x85eb('0xf')]['noop'](_0x85eb('0xfc'));}if(!this[_0x85eb('0x89')](_0x44901e[_0x85eb('0xfd')])){return this['channel'][_0x85eb('0xae')](_0x85eb('0xfe'));}if(!this[_0x85eb('0x89')](_0x44901e[_0x85eb('0xff')])){return this[_0x85eb('0xf')]['noop'](_0x85eb('0x100'));}if(!this['isConfigured'](_0x44901e[_0x85eb('0x101')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0x85eb('0xec')]=!![];this[_0x85eb('0x36')](_0x44901e);this['createSquareMessage'](_0x44901e['text'],'in','','');this[_0x85eb('0xf')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x44901e[_0x85eb('0x5e')]));var _0x44417a=this['sestekNDA']['sync'](this,_0x44901e);if(_0x44417a){for(var _0x13364f in _0x44417a){if(_0x44417a[_0x85eb('0x9c')](_0x13364f)){this['channel'][_0x85eb('0xa3')](util[_0x85eb('0x2c')](_0x85eb('0x102'),_0x13364f[_0x85eb('0x6c')]()),_0x44417a[_0x13364f]);}}this[_0x85eb('0x43')](_0x44417a[_0x85eb('0xf1')],_0x85eb('0xef'),_0x85eb('0xfa'),'');if(_0x44417a[_0x85eb('0x103')]){this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x44417a[_0x85eb('0x103')]));var _0xd79bc1=this[_0x85eb('0xf')][_0x85eb('0x104')](_0x44417a[_0x85eb('0x103')]);try{fs[_0x85eb('0x105')](_0x44417a[_0x85eb('0x103')]+_0x85eb('0x106'));}catch(_0x1be39a){logger[_0x85eb('0x2f')](_0x1be39a);}return _0xd79bc1;}else{return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('SestekNDA\x20Result\x20%s',_0x44417a['speech']));}}return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x44901e,_0x85eb('0x107'));};AGIVertices[_0x85eb('0x12')]['end']=function(_0x16da86){logger[_0x85eb('0x32')](util['format'](_0x85eb('0x108'),_0x16da86[_0x85eb('0x38')]));return this[_0x85eb('0xf')][_0x85eb('0xae')]('end');};AGIVertices[_0x85eb('0x12')][_0x85eb('0x109')]=function(_0x375b59){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x375b59[_0x85eb('0x38')]));var _0x3f536b='';if(_0x375b59[_0x85eb('0x10a')]){if(!this[_0x85eb('0x89')](_0x375b59[_0x85eb('0x10a')])){return this['channel'][_0x85eb('0x2f')](_0x375b59,_0x85eb('0x10b'));}else{var _0x5a3a94=parseInt(_0x375b59[_0x85eb('0x10a')],0xa);if(isNaN(_0x5a3a94)){_0x3f536b=_0x375b59[_0x85eb('0x10a')];}else{_0x3f536b=this[_0x85eb('0x1e')][_0x85eb('0x72')](this,_0x375b59[_0x85eb('0x10a')]);if(!_0x3f536b){return this[_0x85eb('0xf')]['error'](_0x375b59,_0x85eb('0x10c'));}}}}else if(_0x375b59[_0x85eb('0x10d')]){_0x3f536b=_0x375b59[_0x85eb('0x10d')];}else{return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x375b59,_0x85eb('0x10b'));}var _0x3c9ed4=this[_0x85eb('0xf')]['exec'](_0x85eb('0xe7'),[util['format']('SIP/%s/%s',_0x3f536b,_0x375b59['phone']),_0x375b59['timeout'],_0x375b59[_0x85eb('0xe8')],_0x375b59[_0x85eb('0x66')]]);if(_0x3c9ed4[_0x85eb('0xa8')]===-0x1){return _0x3c9ed4;}return this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')](_0x85eb('0xe9'),_0x85eb('0xe7')));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x10e')]=function(_0x291fe9){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x10f'),_0x291fe9[_0x85eb('0x38')]));return this[_0x85eb('0xf')][_0x85eb('0xae')]('finally');};AGIVertices[_0x85eb('0x12')][_0x85eb('0xe')]=function(_0x38217f){logger[_0x85eb('0x32')](util['format'](_0x85eb('0x110'),_0x38217f[_0x85eb('0x38')]));if(_0x38217f[_0x85eb('0xab')]===0x0){return this[_0x85eb('0xaa')](_0x38217f);}_0x38217f['retry']-=0x1;if(!this['isConfigured'](_0x38217f[_0x85eb('0x111')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x38217f,_0x85eb('0x112'));}var _0x1cc554=this['getSound']['sync'](this,_0x38217f[_0x85eb('0x111')]);if(!_0x1cc554){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x38217f,_0x85eb('0x113'));}if(!this[_0x85eb('0x89')](_0x38217f[_0x85eb('0xdd')])){return this['channel']['error'](_0x85eb('0xde'));}var _0x234ef6=this[_0x85eb('0xf')][_0x85eb('0x114')](_0x1cc554,_0x38217f['response'],_0x38217f['maxdigit']);var _0x14d31b=_0x234ef6['result']?_0x234ef6[_0x85eb('0xa8')][_0x85eb('0x4c')]():'';logger[_0x85eb('0x32')](_0x85eb('0x115'),JSON[_0x85eb('0xa4')](_0x234ef6));if(_0x234ef6[_0x85eb('0xa8')]===-0x1){this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x38217f,_0x14d31b);return _0x234ef6;}else if(_0x234ef6['extra']==='timeout'){_0x234ef6['result']=_0x14d31b['length']>=parseInt(_0x38217f[_0x85eb('0x116')])?'x':'i';}else{_0x234ef6[_0x85eb('0xa8')]=_0x14d31b[_0x85eb('0x9f')]>=parseInt(_0x38217f[_0x85eb('0x116')])&&_0x14d31b[_0x85eb('0x9f')]<=parseInt(_0x38217f[_0x85eb('0x117')])?'x':'i';}var _0x2db063=this[_0x85eb('0x13')][_0x85eb('0x72')](this,_0x38217f['variable_id']);if(!_0x2db063){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x38217f,_0x85eb('0x118'));}this['channel']['setVariable'](_0x2db063,_0x14d31b);if(this[_0x85eb('0x89')](_0x38217f['hiddendigitsnum'])){var _0x5d0057=parseInt(_0x38217f[_0x85eb('0x119')],0xa);var _0x26c945=rs['generate']({'charset':'*','length':_0x5d0057});var _0x5ba7a8=_0x14d31b[_0x85eb('0x9f')];if(_0x5ba7a8>0x0){if(_0x5ba7a8>_0x5d0057){this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x38217f,_0x38217f['hiddendigitspos']===_0x85eb('0x11a')?_0x26c945+_0x14d31b[_0x85eb('0x11b')](_0x5d0057):_0x14d31b[_0x85eb('0x11b')](0x0,_0x5ba7a8-_0x5d0057)+_0x26c945);}else{this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x38217f,rs[_0x85eb('0x11c')]({'charset':'*','length':_0x5ba7a8}));}}else{this['createSquareDetailsReport']['sync'](this,_0x38217f,'');}}else{this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x38217f,_0x14d31b);}return _0x234ef6;};AGIVertices[_0x85eb('0x12')]['getsecretdigits']=function(_0x599423){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x11d'),_0x599423['label']));return this[_0x85eb('0xe')](_0x599423);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x11e')]=function(_0x5ab7ab){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x5ab7ab[_0x85eb('0x38')]));this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x5ab7ab,_0x5ab7ab['goalname']);return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x11f'),_0x5ab7ab[_0x85eb('0x120')]));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x121')]=function(_0x346976){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x122'),_0x346976[_0x85eb('0x38')]));if(!this['isConfigured'](_0x346976[_0x85eb('0x8c')])||!this[_0x85eb('0x89')](_0x346976[_0x85eb('0x90')])){return this['channel'][_0x85eb('0xae')](_0x85eb('0x123'));}if(!this[_0x85eb('0x89')](_0x346976[_0x85eb('0x5e')])){return this[_0x85eb('0xf')]['noop'](_0x85eb('0xaf'));}this['channel'][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x124'),_0x346976[_0x85eb('0x5e')]));var _0x432dc8=this['awsPolly'][_0x85eb('0x72')](this,_0x346976);if(_0x432dc8){this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x125'),_0x432dc8));var _0x4c6d9d=this[_0x85eb('0xf')]['streamFile'](_0x432dc8);try{fs[_0x85eb('0x105')](_0x432dc8+'.wav');}catch(_0x490688){logger[_0x85eb('0x2f')](_0x490688);}return _0x4c6d9d;}return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x346976,_0x85eb('0x126'));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x127')]=function(_0x5b3844){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5b3844['label']));if(!this['isConfigured'](_0x5b3844[_0x85eb('0x8c')])||!this[_0x85eb('0x89')](_0x5b3844[_0x85eb('0x90')])){return this['channel'][_0x85eb('0xae')](_0x85eb('0x123'));}if(!this[_0x85eb('0x89')](_0x5b3844[_0x85eb('0x128')])){return this[_0x85eb('0xf')]['noop'](_0x85eb('0x129'));}if(!this['isConfigured'](_0x5b3844[_0x85eb('0x5e')])){return this['channel'][_0x85eb('0xae')](_0x85eb('0xaf'));}this[_0x85eb('0xf')][_0x85eb('0xec')]=!![];this['createSquareDetailsReport'](_0x5b3844);this[_0x85eb('0x43')](_0x5b3844[_0x85eb('0x5e')],'in','','');this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x12a'),_0x5b3844[_0x85eb('0x5e')]));var _0x50f578=this[_0x85eb('0x8f')][_0x85eb('0x72')](this,_0x5b3844);if(_0x50f578){for(var _0x143844 in _0x50f578){if(_0x50f578['hasOwnProperty'](_0x143844)&&_[_0x85eb('0x98')](_0x50f578[_0x143844])){this[_0x85eb('0xf')][_0x85eb('0xa3')](util[_0x85eb('0x2c')](_0x85eb('0x12b'),_0x143844['toUpperCase']()),_0x50f578[_0x143844]);}}if(_[_0x85eb('0x45')](_0x50f578[_0x85eb('0x7a')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0x12c'));}else{this[_0x85eb('0x43')](_0x50f578[_0x85eb('0x7a')],_0x85eb('0xef'),_0x85eb('0x12d'),'');return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x12e'),_0x50f578['message']));}}return this['channel'][_0x85eb('0x2f')](_0x5b3844,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x85eb('0x12')][_0x85eb('0x12f')]=function(_0x34c98c){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x130'),_0x34c98c[_0x85eb('0x38')],_0x34c98c[_0x85eb('0x67')]));if(!this[_0x85eb('0x89')](_0x34c98c[_0x85eb('0x84')])){return this[_0x85eb('0xf')][_0x85eb('0xae')]('no\x20key\x20configured');}var _0x3e34e0=_0x85eb('0x131');var _0x22dd54=util[_0x85eb('0x2c')](_0x85eb('0x132'),FILES_PATH,rs[_0x85eb('0x11c')](0x4));var _0x44e9b8=util['format'](_0x85eb('0xa2'),_0x22dd54,_0x3e34e0);var _0x469a4b=!![];if(_0x34c98c[_0x85eb('0x133')]===_0x85eb('0x134')){_0x469a4b=![];}var _0x41d219=this[_0x85eb('0xf')][_0x85eb('0x135')](_0x22dd54,_0x3e34e0,_0x34c98c['intKey'],_0x34c98c['timeout'],undefined,_0x469a4b);if(_0x41d219[_0x85eb('0xa8')]!==-0x1){this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x136'),_0x44e9b8));var _0x2b4943=this[_0x85eb('0x92')][_0x85eb('0x72')](this,_0x34c98c,_0x44e9b8);if(_0x2b4943){for(var _0x1570f0 in _0x2b4943){if(_0x2b4943[_0x85eb('0x9c')](_0x1570f0)){this['channel'][_0x85eb('0xa3')](util['format'](_0x85eb('0x137'),_0x1570f0[_0x85eb('0x6c')]()),_0x2b4943[_0x1570f0]);}}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x138'),JSON[_0x85eb('0xa4')](_0x2b4943)));}}return _0x41d219;};AGIVertices[_0x85eb('0x12')][_0x85eb('0x139')]=function(_0x9b3db0){logger['info'](util['format'](_0x85eb('0x13a'),_0x9b3db0[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x9b3db0[_0x85eb('0x94')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0x13b'));}if(!this[_0x85eb('0x89')](_0x9b3db0['appsecret'])){return this['channel']['noop'](_0x85eb('0x13c'));}var _0x21c3e6=_0x85eb('0x131');var _0x2a60be=util['format'](_0x85eb('0x132'),FILES_PATH,rs['generate'](0x4));var _0x5430e5=util['format'](_0x85eb('0xa2'),_0x2a60be,_0x21c3e6);var _0x331cbe=!![];if(_0x9b3db0[_0x85eb('0x133')]==='NOBEEP'){_0x331cbe=![];}var _0x5b8be1=this[_0x85eb('0xf')]['recordFile'](_0x2a60be,_0x21c3e6,_0x9b3db0[_0x85eb('0x13d')],_0x9b3db0[_0x85eb('0x67')],undefined,_0x331cbe);if(_0x5b8be1[_0x85eb('0xa8')]!==-0x1){this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')](_0x85eb('0x13e'),_0x5430e5));var _0x4634ac=this[_0x85eb('0x93')][_0x85eb('0x72')](this,_0x9b3db0,_0x5430e5);if(_0x4634ac){for(var _0x2af3cf in _0x4634ac){if(_0x4634ac['hasOwnProperty'](_0x2af3cf)){this[_0x85eb('0xf')][_0x85eb('0xa3')](util['format'](_0x85eb('0x13f'),_0x2af3cf[_0x85eb('0x6c')]()),_0x4634ac[_0x2af3cf]);}}return this['channel'][_0x85eb('0xae')](util[_0x85eb('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0x85eb('0xa4')](_0x4634ac)));}}return _0x5b8be1;};AGIVertices[_0x85eb('0x12')][_0x85eb('0x140')]=function(_0x39dfe7){logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x141'),_0x39dfe7[_0x85eb('0x38')]));return this[_0x85eb('0xf')][_0x85eb('0x142')](_0x39dfe7[_0x85eb('0x3d')],_0x39dfe7[_0x85eb('0x3e')],_0x39dfe7['priority']);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x143')]=function(_0x187ac3){logger['info'](util[_0x85eb('0x2c')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x187ac3[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x187ac3[_0x85eb('0x144')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x187ac3,_0x85eb('0x145'));}try{var _0xd5cdfa=eval(_0x187ac3['condition'])?_0x85eb('0x146'):_0x85eb('0x147');this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')](_0x85eb('0x148'),_0x187ac3[_0x85eb('0x144')],_0xd5cdfa));return{'code':0xc8,'result':_0xd5cdfa};}catch(_0x75460f){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0x85eb('0x149')]=function(_0x34ac26){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x34ac26[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x34ac26['interval_id'])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x34ac26,_0x85eb('0x14a'));}var _0x8c00a1=this['getIntervals'][_0x85eb('0x72')](this,_0x34ac26[_0x85eb('0x14b')]);if(!_0x8c00a1){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x34ac26,_0x85eb('0x14c'));}for(var _0x1824ab=0x0;_0x1824ab<_0x8c00a1[_0x85eb('0x9f')];_0x1824ab+=0x1){var _0x442973=this[_0x85eb('0xf')][_0x85eb('0x13')](util[_0x85eb('0x2c')](_0x85eb('0x14d'),_0x8c00a1[_0x1824ab]));if(_0x442973[_0x85eb('0xa8')]===-0x1){return _0x442973;}logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x14e'),_0x8c00a1[_0x1824ab],_0x442973['extra']));if(_0x442973[_0x85eb('0xa9')]===_0x85eb('0x146')){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x14e'),_0x8c00a1[_0x1824ab],'true'));this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('IFTIME\x20%s\x20%s',_0x8c00a1[_0x1824ab],_0x85eb('0x146')));return{'code':0xc8,'result':_0x85eb('0x146')};}else{logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('IFTIME\x20%s\x20%s',_0x8c00a1[_0x1824ab],_0x85eb('0x147')));this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('IFTIME\x20%s\x20%s',_0x8c00a1[_0x1824ab],_0x85eb('0x147')));}}return{'code':0xc8,'result':_0x85eb('0x147')};};AGIVertices[_0x85eb('0x12')][_0x85eb('0x14f')]=function(_0x53f80e){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x53f80e['label']));return this[_0x85eb('0xf')]['hangup']();};AGIVertices[_0x85eb('0x12')][_0x85eb('0x150')]=function(_0x33421d){logger['info'](util['format'](_0x85eb('0x151'),_0x33421d['label']));if(!this['isConfigured'](_0x33421d[_0x85eb('0x84')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0x152'));}var _0x2c77e3='wav';var _0x1bc62c=util[_0x85eb('0x2c')](_0x85eb('0x132'),FILES_PATH,rs['generate'](0x4));var _0x4c0a93=util['format'](_0x85eb('0xa2'),_0x1bc62c,_0x2c77e3);var _0x58a7ef=!![];if(_0x33421d['beep']===_0x85eb('0x134')){_0x58a7ef=![];}var _0x54e333=this[_0x85eb('0xf')][_0x85eb('0x135')](_0x1bc62c,_0x2c77e3,_0x33421d[_0x85eb('0x13d')],_0x33421d['timeout'],undefined,_0x58a7ef);if(_0x54e333['result']!==-0x1){this['channel'][_0x85eb('0xae')](util['format'](_0x85eb('0x153'),_0x4c0a93));var _0xef56a4=this[_0x85eb('0x87')][_0x85eb('0x72')](this,_0x33421d,_0x4c0a93);if(_0xef56a4){for(var _0x5a3866 in _0xef56a4){if(_0xef56a4['hasOwnProperty'](_0x5a3866)){this['channel']['setVariable'](util[_0x85eb('0x2c')](_0x85eb('0x154'),_0x5a3866[_0x85eb('0x6c')]()),_0xef56a4[_0x5a3866]);}}return this[_0x85eb('0xf')][_0x85eb('0xae')](util['format'](_0x85eb('0x155'),JSON[_0x85eb('0xa4')](_0xef56a4)));}}return _0x54e333;};AGIVertices[_0x85eb('0x12')][_0x85eb('0x156')]=function(_0x22fc3f){logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x157'),_0x22fc3f['label']));if(!this[_0x85eb('0x89')](_0x22fc3f[_0x85eb('0x84')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0x152'));}if(!this[_0x85eb('0x89')](_0x22fc3f[_0x85eb('0x5e')])){return this['channel'][_0x85eb('0xae')]('no\x20text\x20configured');}this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')](_0x85eb('0x158'),_0x22fc3f['text']));var _0x2179db=this[_0x85eb('0x83')][_0x85eb('0x72')](this,_0x22fc3f);if(_0x2179db){this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x153'),_0x2179db));var _0x1df459=this[_0x85eb('0xf')]['streamFile'](_0x2179db,_0x22fc3f[_0x85eb('0x13d')]);try{fs[_0x85eb('0x105')](_0x2179db+_0x85eb('0x106'));}catch(_0x35f169){logger[_0x85eb('0x2f')](_0x35f169);}return _0x1df459;}return this[_0x85eb('0xf')]['error'](_0x22fc3f,_0x85eb('0x159'));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x15a')]=function(_0x531ca4){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x15b'),_0x531ca4['label']));if(!this[_0x85eb('0x89')](_0x531ca4[_0x85eb('0x15c')])){return this[_0x85eb('0xf')]['error'](_0x531ca4,_0x85eb('0x15d'));}logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x15e'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x531ca4[_0x85eb('0x15c')]));var _0x1d9550=this[_0x85eb('0x53')][_0x85eb('0x72')](this,_0x531ca4[_0x85eb('0x15c')]);if(_0x1d9550){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x85eb('0xf')]['callerid'],_0x531ca4[_0x85eb('0x15c')]));this[_0x85eb('0xf')][_0x85eb('0xae')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x85eb('0x3a')],_0x531ca4[_0x85eb('0x15c')]));return{'code':0xc8,'result':_0x85eb('0x15f')};}else{logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x160'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x531ca4[_0x85eb('0x15c')]));this[_0x85eb('0xf')][_0x85eb('0xae')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x531ca4['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x85eb('0x12')][_0x85eb('0x161')]=function(_0x37ae27){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x162'),_0x37ae27['label']));if(!this[_0x85eb('0x89')](_0x37ae27['findBy'])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x37ae27,'no\x20find\x20by\x20configured');}logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x15e'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x37ae27[_0x85eb('0x15c')]));var _0x4f0566=this[_0x85eb('0x52')][_0x85eb('0x72')](this,_0x37ae27[_0x85eb('0x15c')]);if(_0x4f0566){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x163'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x37ae27[_0x85eb('0x15c')]));this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')](_0x85eb('0x163'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x37ae27[_0x85eb('0x15c')]));return{'code':0xc8,'result':_0x85eb('0x15f')};}else{logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x85eb('0x3a')],_0x37ae27['findBy']));this['channel'][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x160'),this['channel'][_0x85eb('0x3a')],_0x37ae27[_0x85eb('0x15c')]));return{'code':0xc8,'result':_0x85eb('0x164')};}};AGIVertices[_0x85eb('0x12')][_0x85eb('0x165')]=function(_0x4346ed){logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x166'),_0x4346ed['label']));if(!this['isConfigured'](_0x4346ed[_0x85eb('0x167')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x4346ed,'no\x20operation\x20configured');}this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('math\x20%s',_0x4346ed['operation']));var _0x5a6602=eval(_0x4346ed[_0x85eb('0x167')]);if(!this['isConfigured'](_0x4346ed[_0x85eb('0xdd')])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xde'));}var _0x1fb87f=this[_0x85eb('0x13')][_0x85eb('0x72')](this,_0x4346ed[_0x85eb('0xdd')]);if(!_0x1fb87f){return this['channel'][_0x85eb('0x2f')](_0x4346ed,_0x85eb('0x118'));}if(_[_0x85eb('0x9e')](_0x5a6602)){var _0x30d071=this;_0x5a6602['forEach'](function(_0x4955a7,_0x593c5b){_0x30d071[_0x85eb('0xf')][_0x85eb('0xa3')](util[_0x85eb('0x2c')]('%s[%s]',_0x1fb87f,_0x593c5b),_0x4955a7);});return this[_0x85eb('0xf')][_0x85eb('0xae')](util['format']('variable\x20%s[key]\x20set',_0x1fb87f));}else{return this['channel'][_0x85eb('0xa3')](_0x1fb87f,_0x5a6602);}};AGIVertices[_0x85eb('0x12')][_0x85eb('0xd')]=function(_0x4ecb7f){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x168'),_0x4ecb7f['label']));if(_0x4ecb7f[_0x85eb('0xab')]===0x0){return this['maxRetry'](_0x4ecb7f);}_0x4ecb7f['retry']-=0x1;if(!this['isConfigured'](_0x4ecb7f['file_id'])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x4ecb7f,_0x85eb('0x112'));}var _0x51b109=this['getSound'][_0x85eb('0x72')](this,_0x4ecb7f[_0x85eb('0x111')]);if(!_0x51b109){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x4ecb7f,_0x85eb('0x113'));}var _0x30ee46=this[_0x85eb('0xf')]['getData'](_0x51b109,_0x4ecb7f[_0x85eb('0x169')],_0x4ecb7f['digit']);var _0x3f3d33=_0x30ee46[_0x85eb('0xa8')];if(_0x30ee46[_0x85eb('0xa8')]===-0x1){this[_0x85eb('0x36')]['sync'](this,_0x4ecb7f,'-1');return _0x30ee46;}else if(_0x30ee46['extra']===_0x85eb('0x67')){_0x30ee46[_0x85eb('0xa8')]=_0x30ee46[_0x85eb('0xa8')][_0x85eb('0x9f')]>0x0?_0x30ee46['result']:'t';}else if(_[_0x85eb('0xa0')](_0x30ee46[_0x85eb('0xa8')])){_0x30ee46[_0x85eb('0xa8')]='#';_0x3f3d33='#';}if(!this[_0x85eb('0x89')](_0x4ecb7f[_0x85eb('0xdd')])){this['channel'][_0x85eb('0xae')](_0x85eb('0xde'));}else{var _0x485a6a=this[_0x85eb('0x13')]['sync'](this,_0x4ecb7f[_0x85eb('0xdd')]);if(!_0x485a6a){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x4ecb7f,_0x85eb('0x118'));}this[_0x85eb('0xf')][_0x85eb('0xa3')](_0x485a6a,_0x3f3d33);}this['createSquareDetailsReport'][_0x85eb('0x72')](this,_0x4ecb7f,_0x3f3d33);return _0x30ee46;};AGIVertices[_0x85eb('0x12')][_0x85eb('0xae')]=function(_0x13111d){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x16a'),_0x13111d['label']));return this[_0x85eb('0xf')]['noop'](_0x13111d[_0x85eb('0x16b')]||_0x13111d['label']);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x16c')]=function(_0x9beb60){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x16d'),_0x9beb60[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x9beb60[_0x85eb('0x15c')])){return this[_0x85eb('0xf')]['error'](_0x9beb60,_0x85eb('0x15d'));}logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x15e'),this['channel'][_0x85eb('0x3a')],_0x9beb60[_0x85eb('0x15c')]));var _0x49f58a=this[_0x85eb('0x16e')]['sync'](this,_0x9beb60['pause_id']);var _0x433b9f=this[_0x85eb('0x4f')][_0x85eb('0x72')](this,_0x9beb60[_0x85eb('0x15c')],_0x49f58a);if(_0x433b9f){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x163'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x9beb60[_0x85eb('0x15c')]));this[_0x85eb('0xf')][_0x85eb('0xae')](util['format'](_0x85eb('0x163'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x9beb60[_0x85eb('0x15c')]));return{'code':0xc8,'result':_0x85eb('0x15f')};}else{logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x9beb60['findBy']));this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x163'),this[_0x85eb('0xf')]['callerid'],_0x9beb60[_0x85eb('0x15c')]));return{'code':0xc8,'result':_0x85eb('0x164')};}};AGIVertices[_0x85eb('0x12')]['playback']=function(_0x5c8879){logger['info'](util['format'](_0x85eb('0x16f'),_0x5c8879['label']));if(!this[_0x85eb('0x89')](_0x5c8879[_0x85eb('0x111')])){return this['channel'][_0x85eb('0x2f')](_0x5c8879,_0x85eb('0x112'));}var _0x31485d=this['getSound'][_0x85eb('0x72')](this,_0x5c8879[_0x85eb('0x111')]);if(!_0x31485d){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x5c8879,'no\x20file\x20audio\x20found');}var _0x41f924=this[_0x85eb('0xf')][_0x85eb('0x58')]('PLAYBACK',[_0x31485d,_0x5c8879['opts']]);if(_0x41f924[_0x85eb('0xa8')]===-0x1){return _0x41f924;}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0xca'),_0x85eb('0x170'),_0x31485d));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x171')]=function(_0x1f1ff1){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x172'),_0x1f1ff1[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x1f1ff1[_0x85eb('0x173')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x1f1ff1,'no\x20queue\x20selected');}var _0x1afbb1='';var _0x403acb=parseInt(_0x1f1ff1[_0x85eb('0x173')],0xa);if(isNaN(_0x403acb)){_0x1afbb1=_0x1f1ff1[_0x85eb('0x173')];}else{_0x1afbb1=this[_0x85eb('0x174')]['sync'](this,_0x1f1ff1[_0x85eb('0x173')]);if(!_0x1afbb1){return this['channel'][_0x85eb('0x2f')](_0x1f1ff1,_0x85eb('0x175'));}}var _0x2c4f02='';if(this[_0x85eb('0x89')](_0x1f1ff1[_0x85eb('0x111')])){var _0x30a089=this[_0x85eb('0x20')][_0x85eb('0x72')](this,_0x1f1ff1['file_id']);if(_0x30a089){_0x2c4f02=_0x30a089;}}this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x1f1ff1,_0x1afbb1);if(_0x1f1ff1[_0x85eb('0xe8')][_0x85eb('0x176')]('x')<0x0){_0x1f1ff1[_0x85eb('0xe8')]+='x';}if(_0x1f1ff1[_0x85eb('0xe8')][_0x85eb('0x176')]('X')<0x0){_0x1f1ff1['opts']+='X';}this[_0x85eb('0xf')][_0x85eb('0xa3')]('XMCS-QUEUE',_0x1afbb1?_0x1afbb1['toLowerCase']():'');var _0x41b0ff=this[_0x85eb('0xf')][_0x85eb('0x58')](_0x85eb('0x177'),[_0x1afbb1,_0x1f1ff1[_0x85eb('0xe8')],_0x1f1ff1['url'],_0x2c4f02,_0x1f1ff1[_0x85eb('0x67')],_0x1f1ff1[_0x85eb('0x7')],_0x1f1ff1['macro'],_0x1f1ff1[_0x85eb('0x178')],'',_0x1f1ff1[_0x85eb('0x179')]]);if(_0x41b0ff[_0x85eb('0xa8')]===-0x1){return _0x41b0ff;}return this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')](_0x85eb('0xca'),'QUEUE',_0x1afbb1));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x17a')]=function(_0x555235){logger[_0x85eb('0x32')](util['format'](_0x85eb('0x17b'),_0x555235[_0x85eb('0x38')]));var _0x2effc2=_0x555235[_0x85eb('0x17c')]||_0x85eb('0x131');var _0x151e71=util[_0x85eb('0x2c')](_0x85eb('0x17d'),this[_0x85eb('0xf')][_0x85eb('0x37')],rs['generate'](0x5));var _0x184735=util[_0x85eb('0x2c')](_0x85eb('0x17e'),FILES_PATH,_0x151e71,_0x2effc2);var _0x5b100c=util[_0x85eb('0x2c')]('%s/recordings/%s',FILES_PATH,_0x151e71);this[_0x85eb('0x3b')][_0x85eb('0x72')](this,_0x555235,_0x151e71,_0x184735);this[_0x85eb('0xf')][_0x85eb('0xa3')]('RECORDING_SAVENAME',_0x151e71);logger['info'](_0x85eb('0x17f'),_0x5b100c,_0x2effc2,_0x555235[_0x85eb('0x180')],_0x555235[_0x85eb('0x67')]);return this[_0x85eb('0xf')][_0x85eb('0x135')](_0x5b100c,_0x2effc2,_0x555235[_0x85eb('0x180')],_0x555235['timeout'],undefined,!![]);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x181')]=function(_0x53ffad){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x182'),_0x53ffad[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x53ffad['url'])){return this['channel'][_0x85eb('0xae')](_0x85eb('0x183'));}var _0x1c9fb3=this[_0x85eb('0x65')]['sync'](this,_0x53ffad);logger[_0x85eb('0x32')](util['format']('Response:',util['inspect'](_0x1c9fb3,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x53ffad[_0x85eb('0xdd')])){return this[_0x85eb('0xf')][_0x85eb('0xae')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x4181e1=this[_0x85eb('0x13')][_0x85eb('0x72')](this,_0x53ffad['variable_id']);if(!_0x4181e1){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x53ffad,_0x85eb('0x118'));}this[_0x85eb('0xf')][_0x85eb('0xa3')](util['format'](_0x85eb('0x184'),_0x4181e1),_0x1c9fb3[_0x85eb('0x78')]?_0x1c9fb3[_0x85eb('0x78')]:_0x85eb('0x185'));this[_0x85eb('0xf')][_0x85eb('0xa3')](util['format'](_0x85eb('0x186'),_0x4181e1),_0x1c9fb3[_0x85eb('0x79')]?_0x1c9fb3[_0x85eb('0x79')]:'OK');if(_0x1c9fb3['body']){try{this['saveRestApiResult'](_0x1c9fb3[_0x85eb('0x76')],_0x4181e1);}catch(_0x1d44df){logger[_0x85eb('0x2f')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x4181e1));}}return this['channel'][_0x85eb('0xae')](util['format'](_0x85eb('0xe2'),_0x4181e1));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x187')]=function(_0x3fdf32){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x188'),_0x3fdf32[_0x85eb('0x38')]));return this[_0x85eb('0xf')][_0x85eb('0x189')](_0x3fdf32[_0x85eb('0x18a')][_0x85eb('0x5a')](/\s+/g,''),_0x3fdf32[_0x85eb('0x180')]);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x18b')]=function(_0x7cde92){logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x18c'),_0x7cde92['label']));return this['channel'][_0x85eb('0x18d')](_0x7cde92[_0x85eb('0x68')][_0x85eb('0x5a')](/\s+/g,''),_0x7cde92[_0x85eb('0x180')]);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x18e')]=function(_0x2de4cb){logger[_0x85eb('0x32')](util['format'](_0x85eb('0x18f'),_0x2de4cb[_0x85eb('0x38')]));return this[_0x85eb('0xf')]['sayPhonetic'](_0x2de4cb[_0x85eb('0x5e')],_0x2de4cb['escape_digits']);};AGIVertices[_0x85eb('0x12')]['sendMail']=function(_0x4388c8){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x190'),_0x4388c8['label']));if(!this[_0x85eb('0x89')](_0x4388c8['account_id'])){return this[_0x85eb('0xf')][_0x85eb('0xae')]('no\x20mail\x20account\x20configured');}var _0x5c8d8b=this[_0x85eb('0x22')][_0x85eb('0x72')](this,_0x4388c8[_0x85eb('0x191')]);if(!_0x5c8d8b||!_0x5c8d8b[_0x85eb('0x192')]){return this['channel'][_0x85eb('0x2f')](_0x4388c8,_0x85eb('0x193'));}var _0x33aaf8={'from':util[_0x85eb('0x2c')](_0x85eb('0x194'),_0x5c8d8b[_0x85eb('0x15')],_0x5c8d8b[_0x85eb('0x195')]||_0x5c8d8b['Smtp'][_0x85eb('0x196')]),'to':_0x4388c8['to']||'','cc':_0x4388c8['cc']||'','bcc':_0x4388c8[_0x85eb('0x197')]||'','subject':_0x4388c8[_0x85eb('0x198')],'html':_0x4388c8['text'],'text':_0x4388c8[_0x85eb('0x5e')]};if(this[_0x85eb('0x89')](_0x4388c8['template_id'])){}logger[_0x85eb('0xe4')](_0x85eb('0x199'),JSON[_0x85eb('0xa4')](_0x33aaf8));this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x4388c8,_0x4388c8['account_id']);this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x19a'),_0x5c8d8b[_0x85eb('0x15')]));this[_0x85eb('0x24')][_0x85eb('0x72')](this,_0x5c8d8b[_0x85eb('0x19b')],_0x33aaf8);return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0x19c'));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x19d')]=function(_0x15ef64){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x19e'),_0x15ef64[_0x85eb('0x38')]));return this[_0x85eb('0xf')][_0x85eb('0xae')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x85eb('0x12')][_0x85eb('0x19f')]=function(_0x526de0){logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x1a0'),_0x526de0[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0x526de0[_0x85eb('0x1a1')])){return this[_0x85eb('0xf')][_0x85eb('0xae')]('no\x20sms\x20account\x20configured');}var _0x436319=this[_0x85eb('0x35')][_0x85eb('0x72')](this,_0x526de0['sms_account_id']);if(!_0x436319){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x526de0,_0x85eb('0x1a2'));}var _0x1890ad={'body':_0x526de0['sms_text'],'phone':_0x526de0['to']||'','SmsAccountId':_0x436319['id']};logger['debug'](_0x85eb('0x1a3'),JSON[_0x85eb('0xa4')](_0x1890ad));this['createSquareDetailsReport'][_0x85eb('0x72')](this,_0x526de0,_0x526de0[_0x85eb('0x1a1')]);this[_0x85eb('0xf')]['noop'](util['format'](_0x85eb('0x1a4'),_0x436319[_0x85eb('0x15')]));this[_0x85eb('0x1a5')][_0x85eb('0x72')](this,_0x1890ad);return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0x1a6'));};AGIVertices['prototype'][_0x85eb('0x1a7')]=function(_0x212438){logger[_0x85eb('0x32')](util['format'](_0x85eb('0x1a8'),_0x212438['label']));if(!this[_0x85eb('0x89')](_0x212438[_0x85eb('0xdd')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x212438,'no\x20variable\x20selected');}var _0x4d2514=this[_0x85eb('0x13')][_0x85eb('0x72')](this,_0x212438[_0x85eb('0xdd')]);if(!_0x4d2514){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x212438,'no\x20variable\x20found');}return this[_0x85eb('0xf')][_0x85eb('0xa3')](_0x4d2514,_0x212438[_0x85eb('0x1a9')]);};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1aa')]=function(_0x3d00d1){logger['info'](util[_0x85eb('0x2c')](_0x85eb('0x1ab'),_0x3d00d1[_0x85eb('0x38')]));this[_0x85eb('0xf')]['noop'](_0x85eb('0x1ac'));if(_0x3d00d1[_0x85eb('0xbf')]==='yes'){this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0x1ad'));return this['channel'][_0x85eb('0xbf')]();}return this[_0x85eb('0xf')][_0x85eb('0xae')]('Skipped\x20Answer');};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1ae')]=function(_0xfda1eb){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x1af'),_0xfda1eb[_0x85eb('0x38')]));if(!this[_0x85eb('0x89')](_0xfda1eb['project_id'])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0xfda1eb,_0x85eb('0x1b0'));}var _0x195d7f=this['getSquareProject']['sync'](this,_0xfda1eb[_0x85eb('0x1b1')]);if(!this[_0x85eb('0x89')](_0x195d7f)){return this['channel']['error'](_0xfda1eb,util[_0x85eb('0x2c')](_0x85eb('0x1b2'),_0xfda1eb['project_id']));}if(_0x195d7f===this[_0x85eb('0xf')][_0x85eb('0x1b3')]){return this[_0x85eb('0xf')]['error'](_0xfda1eb,_0x85eb('0x1b4'));}this['createSquareDetailsReport'][_0x85eb('0x72')](this,_0xfda1eb,_0x195d7f);var _0x3f1c4d=this['channel'][_0x85eb('0x58')](_0x85eb('0x1b5'),util[_0x85eb('0x2c')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x85eb('0x7')][_0x85eb('0x1b6')]||'127.0.0.1',_0x195d7f,this['channel'][_0x85eb('0x1b3')]));if(_0x3f1c4d[_0x85eb('0xa8')]===-0x1){return _0x3f1c4d;}return this['channel'][_0x85eb('0xae')](util[_0x85eb('0x2c')]('Executed\x20command\x20%s\x20%s',_0x85eb('0x1b5'),_0x195d7f));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1b7')]=function(_0x3743d0){logger['info'](util[_0x85eb('0x2c')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3743d0['label']));var _0x1a836d=this[_0x85eb('0x57')]['sync'](this,_0x3743d0[_0x85eb('0xbd')]);this[_0x85eb('0x36')][_0x85eb('0x72')](this,_0x3743d0,_0x3743d0[_0x85eb('0xbd')]);if(this[_0x85eb('0x89')](_0x3743d0[_0x85eb('0xdd')])){var _0xe93ad8=this[_0x85eb('0x13')][_0x85eb('0x72')](this,_0x3743d0[_0x85eb('0xdd')]);if(_0xe93ad8){this[_0x85eb('0xf')]['setVariable'](_0xe93ad8,_0x1a836d);return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x1b8'),_0x3743d0[_0x85eb('0xbd')],_0xe93ad8));}}return this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x1b9'),_0x3743d0['command']));};AGIVertices[_0x85eb('0x12')]['google_cloud_tts']=function(_0x1ff57f){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x1ba'),_0x1ff57f[_0x85eb('0x38')]));_0x1ff57f['text']=_0x1ff57f['text'][_0x85eb('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1ff57f['apiKey'])){return this['channel'][_0x85eb('0xae')](_0x85eb('0x1bb'));}if(!this['isConfigured'](_0x1ff57f['text'])){return this[_0x85eb('0xf')][_0x85eb('0xae')](_0x85eb('0xaf'));}this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x1ff57f[_0x85eb('0x5e')]));var _0x2539bb=this[_0x85eb('0x5b')][_0x85eb('0x72')](this,_0x1ff57f);if(_0x2539bb){this['channel'][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x1bc'),_0x2539bb));var _0x5eadde=this['channel'][_0x85eb('0x104')](_0x2539bb);try{fs[_0x85eb('0x105')](_0x2539bb+'.wav');}catch(_0x5767e4){logger['error'](_0x5767e4);}return _0x5eadde;}return this['channel'][_0x85eb('0x2f')](_0x1ff57f,_0x85eb('0x1bd'));};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1be')]=function(_0x8ad520){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x1bf'),_0x8ad520[_0x85eb('0x38')]));_0x8ad520[_0x85eb('0x5e')]=_0x8ad520[_0x85eb('0x5e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x85eb('0x89')](_0x8ad520[_0x85eb('0x5e')])){return this['channel']['noop'](_0x85eb('0xaf'));}this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')]('Trying\x20Google\x20TTS\x20%s',_0x8ad520[_0x85eb('0x5e')]));var _0x4afc3a=this[_0x85eb('0x63')][_0x85eb('0x72')](this,_0x8ad520);if(_0x4afc3a){this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x1c0'),_0x4afc3a));var _0x4f98e1=this['channel'][_0x85eb('0x104')](_0x4afc3a);try{fs[_0x85eb('0x105')](_0x4afc3a+_0x85eb('0x106'));}catch(_0x462b87){logger[_0x85eb('0x2f')](_0x462b87);}return _0x4f98e1;}return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x8ad520,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['unpause']=function(_0x3a617f){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3a617f[_0x85eb('0x38')]));if(!this['isConfigured'](_0x3a617f[_0x85eb('0x15c')])){return this['channel'][_0x85eb('0x2f')](_0x3a617f,_0x85eb('0x15d'));}logger[_0x85eb('0x32')](util[_0x85eb('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x3a617f[_0x85eb('0x15c')]));var _0x140a30=this[_0x85eb('0x51')][_0x85eb('0x72')](this,_0x3a617f[_0x85eb('0x15c')]);if(_0x140a30){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x163'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x3a617f[_0x85eb('0x15c')]));this[_0x85eb('0xf')][_0x85eb('0xae')](util[_0x85eb('0x2c')](_0x85eb('0x163'),this[_0x85eb('0xf')][_0x85eb('0x3a')],_0x3a617f[_0x85eb('0x15c')]));return{'code':0xc8,'result':_0x85eb('0x15f')};}else{logger[_0x85eb('0x32')](util['format'](_0x85eb('0x160'),this[_0x85eb('0xf')]['callerid'],_0x3a617f[_0x85eb('0x15c')]));this[_0x85eb('0xf')][_0x85eb('0xae')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x85eb('0xf')]['callerid'],_0x3a617f[_0x85eb('0x15c')]));return{'code':0xc8,'result':_0x85eb('0x164')};}};AGIVertices[_0x85eb('0x12')][_0x85eb('0x1c1')]=function(_0x208dda){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x1c2'),_0x208dda['label']));var _0x4e6cc0=this[_0x85eb('0xf')]['exec']('VOICEMAIL',[_0x208dda[_0x85eb('0x1c3')],_0x208dda['options']]);if(_0x4e6cc0[_0x85eb('0xa8')]===-0x1){return _0x4e6cc0;}return this[_0x85eb('0xf')]['noop'](util[_0x85eb('0x2c')](_0x85eb('0xca'),_0x85eb('0x1c4'),_0x208dda[_0x85eb('0x1c3')]));};AGIVertices['prototype']['vswitch']=function(_0x2fad96){logger[_0x85eb('0x32')](util[_0x85eb('0x2c')](_0x85eb('0x1c5'),_0x2fad96['label']));if(!this[_0x85eb('0x89')](_0x2fad96[_0x85eb('0xdd')])){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x2fad96,_0x85eb('0x1c6'));}var _0x575b3a=this[_0x85eb('0x13')][_0x85eb('0x72')](this,_0x2fad96['variable_id']);if(!_0x575b3a){return this[_0x85eb('0xf')][_0x85eb('0x2f')](_0x2fad96,'no\x20variable\x20found');}var _0x4d024a=this[_0x85eb('0xf')][_0x85eb('0x13')](_0x575b3a);return{'code':0xc8,'result':_0x4d024a['extra']?_0x4d024a['extra']:'-'};};String[_0x85eb('0x12')]['replaceAll']=function(_0x10b552,_0x55df0b){return this[_0x85eb('0xa5')](_0x10b552)['join'](_0x55df0b);};module[_0x85eb('0x1c7')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index ccaf2d2..17d0d41 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 _0xa8f4=['../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','catch','finally','error','[ACW][START]\x20%s','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','message','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','lodash','moment'];(function(_0x2b123f,_0x4e39b0){var _0x37e6d9=function(_0x4c439b){while(--_0x4c439b){_0x2b123f['push'](_0x2b123f['shift']());}};_0x37e6d9(++_0x4e39b0);}(_0xa8f4,0x1b1));var _0x4a8f=function(_0x4c6b9f,_0x386679){_0x4c6b9f=_0x4c6b9f-0x0;var _0x4254bf=_0xa8f4[_0x4c6b9f];return _0x4254bf;};'use strict';var util=require('util');var _=require(_0x4a8f('0x0'));var moment=require(_0x4a8f('0x1'));var ami=require(_0x4a8f('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x4a8f('0x3'));var RpcVoiceAgentReport=require(_0x4a8f('0x4'));function Acw(_0x1e8807){this[_0x4a8f('0x5')]=_0x1e8807[_0x4a8f('0x5')];this['agents']=_0x1e8807[_0x4a8f('0x6')];this['timers']=_0x1e8807[_0x4a8f('0x7')];this[_0x4a8f('0x8')]={};ami['on']('agentconnect',this[_0x4a8f('0x9')][_0x4a8f('0xa')](this));ami['on']('hanguprequest',this[_0x4a8f('0xb')]['bind'](this));ami['on'](_0x4a8f('0xc'),this[_0x4a8f('0xd')]['bind'](this));ami['on'](_0x4a8f('0xe'),this['syncAgentRingNoAnswer'][_0x4a8f('0xa')](this));ami['on'](_0x4a8f('0xf'),this[_0x4a8f('0x10')]['bind'](this));ami['on'](_0x4a8f('0x11'),this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x4a8f('0x12')][_0x4a8f('0xa')](this));}function getDiff(_0x3559d1){var _0xef027d=moment()[_0x4a8f('0x13')](0x0);var _0x4d9f15=moment(_0x3559d1)[_0x4a8f('0x13')](0x0);return _0xef027d[_0x4a8f('0x14')](_0x4d9f15,_0x4a8f('0x15'));}Acw[_0x4a8f('0x16')][_0x4a8f('0x17')]=function(_0x13a314){try{var _0x5b0c71=this;var _0x1ac879=this[_0x4a8f('0x8')][_0x13a314][_0x4a8f('0x18')];var _0x20c377=this[_0x4a8f('0x8')][_0x13a314][_0x4a8f('0x19')];var _0x35e820=this[_0x4a8f('0x5')][_0x20c377];var _0x21e546=![];var _0x352213=_0x4a8f('0x1a');if(_0x35e820[_0x4a8f('0x1b')]){if(_0x35e820[_0x4a8f('0x1c')][_0x4a8f('0x1d')]){_0x21e546=!![];_0x352213=_0x35e820[_0x4a8f('0x1c')][_0x4a8f('0x1d')];}}ami[_0x4a8f('0x1e')]({'action':_0x4a8f('0x1f'),'interface':_0x1ac879,'paused':!![],'reason':_0x352213})[_0x4a8f('0x20')](function(_0x260be6){if(_0x5b0c71[_0x4a8f('0x6')][_0x1ac879]){return RpcUser[_0x4a8f('0x21')](_0x5b0c71[_0x4a8f('0x6')][_0x1ac879]['id'])['then'](function(_0xe3e904){if(_0xe3e904&&!_0xe3e904['voicePause']){logger[_0x4a8f('0x22')](_0x4a8f('0x23'),_0x13a314,_0x1ac879,_0x20c377);var _0xa05795=_0x5b0c71[_0x4a8f('0x8')][_0x13a314][_0x4a8f('0x24')]&&_0x5b0c71[_0x4a8f('0x8')][_0x13a314][_0x4a8f('0x25')]?_0x5b0c71[_0x4a8f('0x8')][_0x13a314][_0x4a8f('0x25')]:_0x13a314;return RpcUser['savePause'](_0x5b0c71[_0x4a8f('0x6')][_0x1ac879],_0x352213,_0xa05795)[_0x4a8f('0x20')](function(_0x8231d3){if(!_0x21e546){_0x5b0c71[_0x4a8f('0x7')][_0x1ac879]={};logger['info'](_0x4a8f('0x26'),_0x13a314,_0x5b0c71[_0x4a8f('0x5')][_0x20c377]['acwTimeout'],_0x1ac879,_0x20c377);_0x5b0c71[_0x4a8f('0x7')][_0x1ac879][_0x4a8f('0x27')]=setTimeout(_0x5b0c71[_0x4a8f('0x28')]['bind'](_0x5b0c71,_0x1ac879),_0x5b0c71['voiceQueues'][_0x20c377][_0x4a8f('0x29')]*0x3e8);_0x5b0c71[_0x4a8f('0x7')][_0x1ac879][_0x4a8f('0x2a')]=moment()[_0x4a8f('0x2b')](_0x4a8f('0x2c'));_0x5b0c71['timers'][_0x1ac879][_0x4a8f('0x2d')]=_0x13a314;_0x5b0c71[_0x4a8f('0x7')][_0x1ac879][_0x4a8f('0x19')]=_0x20c377;_0x5b0c71[_0x4a8f('0x7')][_0x1ac879]['updateAcw']=function(){var _0x1a3ac4=getDiff(_0x5b0c71[_0x4a8f('0x7')][_0x1ac879]['lastPauseAt']);clearTimeout(_0x5b0c71[_0x4a8f('0x7')][_0x1ac879][_0x4a8f('0x27')]);_0x5b0c71[_0x4a8f('0x7')][_0x1ac879][_0x4a8f('0x27')]=![];RpcVoiceAgentReport[_0x4a8f('0x2e')]({'acwtime':_0x1a3ac4},_0x5b0c71[_0x4a8f('0x7')][_0x1ac879]['uniqueid'],_0x1ac879)[_0x4a8f('0x20')](function(_0x3bde62){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x13a314,_0x1a3ac4,_0x3bde62);})[_0x4a8f('0x2f')](function(_0x370828){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x13a314,_0x370828);});delete _0x5b0c71[_0x4a8f('0x7')][_0x1ac879];};}});}else{logger[_0x4a8f('0x22')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x13a314,_0x1ac879,_0x20c377);}});}})[_0x4a8f('0x2f')](function(_0x4da5f9){logger['error'](_0x4a8f('0x26'),_0x13a314,_0x5b0c71[_0x4a8f('0x5')][_0x20c377]['acwTimeout'],_0x1ac879,_0x20c377);})[_0x4a8f('0x30')](function(){delete _0x5b0c71[_0x4a8f('0x8')][_0x13a314];});}catch(_0x5b4faa){logger[_0x4a8f('0x31')](_0x4a8f('0x32'),_0x5b4faa['message']);}};Acw[_0x4a8f('0x16')][_0x4a8f('0x28')]=function(_0x51f8ef){try{var _0x4c4b34=this;if(_0x4c4b34[_0x4a8f('0x7')][_0x51f8ef]){_0x4c4b34[_0x4a8f('0x7')][_0x51f8ef][_0x4a8f('0x27')]=![];var _0x524d97=_0x4c4b34[_0x4a8f('0x7')][_0x51f8ef][_0x4a8f('0x2d')];var _0x5e0299=_0x4c4b34['timers'][_0x51f8ef]['queue'];var _0x5ba4a3=_0x4c4b34[_0x4a8f('0x5')][_0x5e0299]['acwTimeout'];logger[_0x4a8f('0x22')]('[%s][TIMER][STOP][AGENT:%s]',_0x524d97,_0x51f8ef);RpcUser[_0x4a8f('0x33')](this[_0x4a8f('0x6')][_0x51f8ef]);RpcVoiceAgentReport[_0x4a8f('0x2e')]({'acwtime':_0x5ba4a3,'agentacw':!![]},_0x524d97,_0x51f8ef)[_0x4a8f('0x20')](function(_0x222ef9){logger[_0x4a8f('0x22')](_0x4a8f('0x34'),_0x524d97,_0x5ba4a3,_0x222ef9);})[_0x4a8f('0x2f')](function(_0x9594a5){logger[_0x4a8f('0x31')](_0x4a8f('0x35'),_0x524d97,_0x9594a5);});}else{logger[_0x4a8f('0x31')](_0x4a8f('0x36'),_0x51f8ef);if(_0x4c4b34[_0x4a8f('0x7')]){logger[_0x4a8f('0x22')](_0x4a8f('0x37'),JSON[_0x4a8f('0x38')](_0x4c4b34[_0x4a8f('0x7')]));}}}catch(_0x36cf01){logger[_0x4a8f('0x31')]('[ACW][STOP]\x20%s',_0x36cf01[_0x4a8f('0x39')]);}};Acw[_0x4a8f('0x16')][_0x4a8f('0x9')]=function(_0x2838ad){try{if(this[_0x4a8f('0x5')][_0x2838ad['queue']]&&(this[_0x4a8f('0x5')][_0x2838ad[_0x4a8f('0x19')]][_0x4a8f('0x3a')]||this[_0x4a8f('0x5')][_0x2838ad['queue']]['mandatoryDisposition'])){if(this[_0x4a8f('0x6')][_0x2838ad['interface']]){this[_0x4a8f('0x8')][_0x2838ad[_0x4a8f('0x2d')]]={'queue':_0x2838ad[_0x4a8f('0x19')],'interface':_0x2838ad['interface'],'destlinkedid':_0x2838ad[_0x4a8f('0x25')]};}}}catch(_0x14036c){logger[_0x4a8f('0x31')](_0x4a8f('0x3b'),_0x14036c[_0x4a8f('0x39')]);}};Acw['prototype'][_0x4a8f('0x12')]=function(_0x2e5b99){try{if(this[_0x4a8f('0x5')][_0x2e5b99[_0x4a8f('0x19')]]&&(this[_0x4a8f('0x5')][_0x2e5b99[_0x4a8f('0x19')]][_0x4a8f('0x3a')]||this[_0x4a8f('0x5')][_0x2e5b99[_0x4a8f('0x19')]][_0x4a8f('0x1b')])){if(this[_0x4a8f('0x6')][_0x2e5b99[_0x4a8f('0x18')]]){this[_0x4a8f('0x8')][_0x2e5b99[_0x4a8f('0x2d')]]={'queue':_0x2e5b99[_0x4a8f('0x19')],'interface':_0x2e5b99[_0x4a8f('0x18')]};}}}catch(_0x40b535){logger[_0x4a8f('0x31')](_0x4a8f('0x3c'),_0x40b535[_0x4a8f('0x39')]);}};Acw[_0x4a8f('0x16')][_0x4a8f('0xb')]=function(_0xf49c48){try{if(this['channels'][_0xf49c48[_0x4a8f('0x2d')]]&&_['isUndefined'](this[_0x4a8f('0x8')][_0xf49c48['uniqueid']][_0x4a8f('0x24')])){logger[_0x4a8f('0x22')](_0x4a8f('0x3d'),_0xf49c48['uniqueid']);this[_0x4a8f('0x17')](_0xf49c48[_0x4a8f('0x2d')]);}else if(this[_0x4a8f('0x8')][_0xf49c48[_0x4a8f('0x3e')]]&&_[_0x4a8f('0x3f')](this[_0x4a8f('0x8')][_0xf49c48[_0x4a8f('0x3e')]]['attended'])){logger['info'](_0x4a8f('0x40'),_0xf49c48[_0x4a8f('0x3e')]);this[_0x4a8f('0x17')](_0xf49c48[_0x4a8f('0x3e')]);}}catch(_0x2a0bec){logger[_0x4a8f('0x31')](_0x4a8f('0x41'),_0x2a0bec[_0x4a8f('0x39')]);}};Acw['prototype']['syncHangup']=function(_0x54c2f9){try{if(this[_0x4a8f('0x8')][_0x54c2f9[_0x4a8f('0x2d')]]&&this[_0x4a8f('0x8')][_0x54c2f9['uniqueid']][_0x4a8f('0x24')]){logger[_0x4a8f('0x22')](_0x4a8f('0x42'),_0x54c2f9[_0x4a8f('0x2d')]);this[_0x4a8f('0x17')](_0x54c2f9[_0x4a8f('0x2d')]);}else if(this[_0x4a8f('0x8')][_0x54c2f9['linkedid']]&&this[_0x4a8f('0x8')][_0x54c2f9[_0x4a8f('0x3e')]]['attended']){logger['info'](_0x4a8f('0x43'),_0x54c2f9['linkedid']);this['startAcw'](_0x54c2f9[_0x4a8f('0x3e')]);}}catch(_0x3a311e){logger[_0x4a8f('0x31')](_0x4a8f('0x44'),_0x3a311e[_0x4a8f('0x39')]);}};Acw[_0x4a8f('0x16')][_0x4a8f('0x10')]=function(_0x7aa8cb){try{if(!_[_0x4a8f('0x45')](this['channels'][_0x7aa8cb[_0x4a8f('0x46')]])){this[_0x4a8f('0x17')](_0x7aa8cb['transfereeuniqueid']);if(this[_0x4a8f('0x8')][_0x7aa8cb[_0x4a8f('0x47')]]){this[_0x4a8f('0x8')][_0x7aa8cb[_0x4a8f('0x47')]][_0x4a8f('0x24')]=!![];this['channels'][_0x7aa8cb[_0x4a8f('0x48')]]=this['channels'][_0x7aa8cb[_0x4a8f('0x47')]];delete this[_0x4a8f('0x8')][_0x7aa8cb[_0x4a8f('0x47')]];}}else if(!_[_0x4a8f('0x45')](this[_0x4a8f('0x8')][_0x7aa8cb['transfertargetuniqueid']])){this[_0x4a8f('0x17')](_0x7aa8cb[_0x4a8f('0x48')]);if(this['channels'][_0x7aa8cb[_0x4a8f('0x49')]]){this[_0x4a8f('0x8')][_0x7aa8cb['origtransfereruniqueid']][_0x4a8f('0x24')]=!![];this[_0x4a8f('0x8')][_0x7aa8cb[_0x4a8f('0x46')]]=this[_0x4a8f('0x8')][_0x7aa8cb['origtransfereruniqueid']];delete this['channels'][_0x7aa8cb[_0x4a8f('0x49')]];}}}catch(_0x2e64e5){logger[_0x4a8f('0x31')](_0x4a8f('0x4a'),_0x2e64e5[_0x4a8f('0x39')]);}};Acw[_0x4a8f('0x16')][_0x4a8f('0x4b')]=function(_0x3f55f3){try{if(this[_0x4a8f('0x8')][_0x3f55f3[_0x4a8f('0x4c')]]){logger[_0x4a8f('0x22')](_0x4a8f('0x4d'),JSON[_0x4a8f('0x38')](_0x3f55f3[_0x4a8f('0x4c')]));this['startAcw'](_0x3f55f3['transfereruniqueid']);}else if(this['channels'][_0x3f55f3[_0x4a8f('0x4e')]]){logger[_0x4a8f('0x22')](_0x4a8f('0x4f'),JSON[_0x4a8f('0x38')](_0x3f55f3[_0x4a8f('0x4e')]));this[_0x4a8f('0x17')](_0x3f55f3['transfererlinkedid']);}}catch(_0x493296){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x493296['message']);}};Acw[_0x4a8f('0x16')][_0x4a8f('0x50')]=function(_0xe43805){try{if(this[_0x4a8f('0x5')][_0xe43805[_0x4a8f('0x19')]]&&this[_0x4a8f('0x5')][_0xe43805[_0x4a8f('0x19')]][_0x4a8f('0x51')]===_0x4a8f('0x52')){if(this[_0x4a8f('0x6')][_0xe43805[_0x4a8f('0x18')]]){logger[_0x4a8f('0x22')](_0x4a8f('0x53'),_0xe43805['uniqueid'],_0xe43805['interface'],_0xe43805[_0x4a8f('0x19')]);return RpcUser[_0x4a8f('0x54')](this[_0x4a8f('0x6')][_0xe43805[_0x4a8f('0x18')]],_0x4a8f('0x55'),_0xe43805[_0x4a8f('0x2d')]);}}}catch(_0x5ba6ce){logger[_0x4a8f('0x31')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x5ba6ce[_0x4a8f('0x39')]);}};module[_0x4a8f('0x56')]=Acw; \ No newline at end of file +var _0x78ae=['autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x78ae,0xa8));var _0xe78a=function(_0x137154,_0xa22631){_0x137154=_0x137154-0x0;var _0x36bfbb=_0x78ae[_0x137154];return _0x36bfbb;};'use strict';var util=require(_0xe78a('0x0'));var _=require(_0xe78a('0x1'));var moment=require(_0xe78a('0x2'));var ami=require(_0xe78a('0x3'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0xe78a('0x4'));var RpcVoiceAgentReport=require(_0xe78a('0x5'));function Acw(_0x14b3ea){this['voiceQueues']=_0x14b3ea[_0xe78a('0x6')];this[_0xe78a('0x7')]=_0x14b3ea[_0xe78a('0x7')];this[_0xe78a('0x8')]=_0x14b3ea[_0xe78a('0x8')];this[_0xe78a('0x9')]={};ami['on']('agentconnect',this[_0xe78a('0xa')][_0xe78a('0xb')](this));ami['on'](_0xe78a('0xc'),this[_0xe78a('0xd')][_0xe78a('0xb')](this));ami['on'](_0xe78a('0xe'),this['syncHangup'][_0xe78a('0xb')](this));ami['on']('agentringnoanswer',this[_0xe78a('0xf')][_0xe78a('0xb')](this));ami['on']('attendedtransfer',this[_0xe78a('0x10')]['bind'](this));ami['on'](_0xe78a('0x11'),this[_0xe78a('0x12')][_0xe78a('0xb')](this));ami['on'](_0xe78a('0x13'),this[_0xe78a('0x14')][_0xe78a('0xb')](this));}function getDiff(_0xd7f902){var _0x14d670=moment()[_0xe78a('0x15')](0x0);var _0x1699e0=moment(_0xd7f902)[_0xe78a('0x15')](0x0);return _0x14d670[_0xe78a('0x16')](_0x1699e0,_0xe78a('0x17'));}Acw['prototype'][_0xe78a('0x18')]=function(_0x5cfb67){try{var _0x26ed59=this;var _0x4ca13b=this[_0xe78a('0x9')][_0x5cfb67][_0xe78a('0x19')];var _0x2b21a7=this[_0xe78a('0x9')][_0x5cfb67][_0xe78a('0x1a')];var _0x1913c7=this['voiceQueues'][_0x2b21a7];var _0x21f855=![];var _0x16bcee=_0xe78a('0x1b');if(_0x1913c7[_0xe78a('0x1c')]){if(_0x1913c7[_0xe78a('0x1d')]['name']){_0x21f855=!![];_0x16bcee=_0x1913c7[_0xe78a('0x1d')]['name'];}}ami[_0xe78a('0x1e')]({'action':_0xe78a('0x1f'),'interface':_0x4ca13b,'paused':!![],'reason':_0x16bcee})['then'](function(_0x163e44){if(_0x26ed59[_0xe78a('0x7')][_0x4ca13b]){return RpcUser[_0xe78a('0x20')](_0x26ed59['agents'][_0x4ca13b]['id'])['then'](function(_0x4d737a){if(_0x4d737a&&!_0x4d737a[_0xe78a('0x21')]){logger['info'](_0xe78a('0x22'),_0x5cfb67,_0x4ca13b,_0x2b21a7);var _0x1ccecc=_0x26ed59[_0xe78a('0x9')][_0x5cfb67][_0xe78a('0x23')]&&_0x26ed59[_0xe78a('0x9')][_0x5cfb67][_0xe78a('0x24')]?_0x26ed59[_0xe78a('0x9')][_0x5cfb67]['destlinkedid']:_0x5cfb67;return RpcUser[_0xe78a('0x25')](_0x26ed59[_0xe78a('0x7')][_0x4ca13b],_0x16bcee,_0x1ccecc)[_0xe78a('0x26')](function(_0x1fd31e){if(!_0x21f855){_0x26ed59[_0xe78a('0x8')][_0x4ca13b]={};logger[_0xe78a('0x27')](_0xe78a('0x28'),_0x5cfb67,_0x26ed59[_0xe78a('0x6')][_0x2b21a7][_0xe78a('0x29')],_0x4ca13b,_0x2b21a7);_0x26ed59[_0xe78a('0x8')][_0x4ca13b][_0xe78a('0x2a')]=setTimeout(_0x26ed59[_0xe78a('0x2b')][_0xe78a('0xb')](_0x26ed59,_0x4ca13b),_0x26ed59[_0xe78a('0x6')][_0x2b21a7][_0xe78a('0x29')]*0x3e8);_0x26ed59['timers'][_0x4ca13b][_0xe78a('0x2c')]=moment()[_0xe78a('0x2d')](_0xe78a('0x2e'));_0x26ed59['timers'][_0x4ca13b][_0xe78a('0x2f')]=_0x5cfb67;_0x26ed59['timers'][_0x4ca13b]['queue']=_0x2b21a7;_0x26ed59[_0xe78a('0x8')][_0x4ca13b]['updateAcw']=function(){var _0x57ebca=getDiff(_0x26ed59[_0xe78a('0x8')][_0x4ca13b][_0xe78a('0x2c')]);clearTimeout(_0x26ed59['timers'][_0x4ca13b]['timer']);_0x26ed59['timers'][_0x4ca13b][_0xe78a('0x2a')]=![];RpcVoiceAgentReport[_0xe78a('0x30')]({'acwtime':_0x57ebca},_0x26ed59['timers'][_0x4ca13b][_0xe78a('0x2f')],_0x4ca13b)[_0xe78a('0x26')](function(_0x2db4f7){logger[_0xe78a('0x27')](_0xe78a('0x31'),_0x5cfb67,_0x57ebca,_0x2db4f7);})['catch'](function(_0x105378){logger[_0xe78a('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x5cfb67,_0x105378);});delete _0x26ed59[_0xe78a('0x8')][_0x4ca13b];};}});}else{logger[_0xe78a('0x27')](_0xe78a('0x33'),_0x5cfb67,_0x4ca13b,_0x2b21a7);}});}})[_0xe78a('0x34')](function(_0x12e44c){logger[_0xe78a('0x32')](_0xe78a('0x28'),_0x5cfb67,_0x26ed59[_0xe78a('0x6')][_0x2b21a7][_0xe78a('0x29')],_0x4ca13b,_0x2b21a7);})['finally'](function(){delete _0x26ed59[_0xe78a('0x9')][_0x5cfb67];});}catch(_0x159d12){logger[_0xe78a('0x32')](_0xe78a('0x35'),_0x159d12[_0xe78a('0x36')]);}};Acw[_0xe78a('0x37')]['stopAcw']=function(_0x10f086){try{var _0xcdb1b9=this;if(_0xcdb1b9[_0xe78a('0x8')][_0x10f086]){_0xcdb1b9['timers'][_0x10f086][_0xe78a('0x2a')]=![];var _0x306092=_0xcdb1b9[_0xe78a('0x8')][_0x10f086][_0xe78a('0x2f')];var _0x24f761=_0xcdb1b9[_0xe78a('0x8')][_0x10f086][_0xe78a('0x1a')];var _0x5d1fb1=_0xcdb1b9[_0xe78a('0x6')][_0x24f761][_0xe78a('0x29')];logger[_0xe78a('0x27')](_0xe78a('0x38'),_0x306092,_0x10f086);RpcUser[_0xe78a('0x39')](this[_0xe78a('0x7')][_0x10f086]);RpcVoiceAgentReport['update']({'acwtime':_0x5d1fb1,'agentacw':!![]},_0x306092,_0x10f086)[_0xe78a('0x26')](function(_0x730d57){logger[_0xe78a('0x27')](_0xe78a('0x31'),_0x306092,_0x5d1fb1,_0x730d57);})[_0xe78a('0x34')](function(_0x3cd18d){logger[_0xe78a('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x306092,_0x3cd18d);});}else{logger['error'](_0xe78a('0x3a'),_0x10f086);if(_0xcdb1b9[_0xe78a('0x8')]){logger[_0xe78a('0x27')](_0xe78a('0x3b'),JSON['stringify'](_0xcdb1b9['timers']));}}}catch(_0x580cb8){logger[_0xe78a('0x32')]('[ACW][STOP]\x20%s',_0x580cb8[_0xe78a('0x36')]);}};Acw['prototype']['syncAgentConnect']=function(_0x4035cc){try{if(this['voiceQueues'][_0x4035cc['queue']]&&(this['voiceQueues'][_0x4035cc[_0xe78a('0x1a')]][_0xe78a('0x3c')]||this[_0xe78a('0x6')][_0x4035cc['queue']][_0xe78a('0x1c')])){if(this['agents'][_0x4035cc[_0xe78a('0x19')]]){this[_0xe78a('0x9')][_0x4035cc['uniqueid']]={'queue':_0x4035cc[_0xe78a('0x1a')],'interface':_0x4035cc[_0xe78a('0x19')],'destlinkedid':_0x4035cc[_0xe78a('0x24')]};}}}catch(_0x1ef7aa){logger[_0xe78a('0x32')](_0xe78a('0x3d'),_0x1ef7aa[_0xe78a('0x36')]);}};Acw[_0xe78a('0x37')][_0xe78a('0x14')]=function(_0x37ff76){try{if(this['voiceQueues'][_0x37ff76[_0xe78a('0x1a')]]&&(this['voiceQueues'][_0x37ff76[_0xe78a('0x1a')]][_0xe78a('0x3c')]||this[_0xe78a('0x6')][_0x37ff76['queue']][_0xe78a('0x1c')])){if(this[_0xe78a('0x7')][_0x37ff76[_0xe78a('0x19')]]){this[_0xe78a('0x9')][_0x37ff76[_0xe78a('0x2f')]]={'queue':_0x37ff76[_0xe78a('0x1a')],'interface':_0x37ff76[_0xe78a('0x19')]};}}}catch(_0x1b7ad9){logger['error'](_0xe78a('0x3e'),_0x1b7ad9[_0xe78a('0x36')]);}};Acw['prototype']['syncHangupRequest']=function(_0x834f5b){try{if(this['channels'][_0x834f5b[_0xe78a('0x2f')]]&&_[_0xe78a('0x3f')](this[_0xe78a('0x9')][_0x834f5b['uniqueid']][_0xe78a('0x23')])){logger['info'](_0xe78a('0x40'),_0x834f5b['uniqueid']);this[_0xe78a('0x18')](_0x834f5b[_0xe78a('0x2f')]);}else if(this[_0xe78a('0x9')][_0x834f5b[_0xe78a('0x41')]]&&_[_0xe78a('0x3f')](this[_0xe78a('0x9')][_0x834f5b[_0xe78a('0x41')]][_0xe78a('0x23')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x834f5b[_0xe78a('0x41')]);this[_0xe78a('0x18')](_0x834f5b[_0xe78a('0x41')]);}}catch(_0x253e25){logger[_0xe78a('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x253e25[_0xe78a('0x36')]);}};Acw[_0xe78a('0x37')]['syncHangup']=function(_0x8c5fa3){try{if(this[_0xe78a('0x9')][_0x8c5fa3[_0xe78a('0x2f')]]&&this[_0xe78a('0x9')][_0x8c5fa3[_0xe78a('0x2f')]][_0xe78a('0x23')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x8c5fa3['uniqueid']);this[_0xe78a('0x18')](_0x8c5fa3[_0xe78a('0x2f')]);}else if(this[_0xe78a('0x9')][_0x8c5fa3[_0xe78a('0x41')]]&&this[_0xe78a('0x9')][_0x8c5fa3[_0xe78a('0x41')]][_0xe78a('0x23')]){logger[_0xe78a('0x27')](_0xe78a('0x42'),_0x8c5fa3[_0xe78a('0x41')]);this['startAcw'](_0x8c5fa3[_0xe78a('0x41')]);}}catch(_0x5776b5){logger[_0xe78a('0x32')](_0xe78a('0x43'),_0x5776b5[_0xe78a('0x36')]);}};Acw[_0xe78a('0x37')]['syncAttendedTransfer']=function(_0x5a44f9){try{if(!_[_0xe78a('0x44')](this['channels'][_0x5a44f9[_0xe78a('0x45')]])){this[_0xe78a('0x18')](_0x5a44f9[_0xe78a('0x45')]);if(this[_0xe78a('0x9')][_0x5a44f9['secondtransfereruniqueid']]){this['channels'][_0x5a44f9[_0xe78a('0x46')]][_0xe78a('0x23')]=!![];this[_0xe78a('0x9')][_0x5a44f9[_0xe78a('0x47')]]=this[_0xe78a('0x9')][_0x5a44f9[_0xe78a('0x46')]];delete this[_0xe78a('0x9')][_0x5a44f9[_0xe78a('0x46')]];}}else if(!_[_0xe78a('0x44')](this[_0xe78a('0x9')][_0x5a44f9[_0xe78a('0x47')]])){this['startAcw'](_0x5a44f9[_0xe78a('0x47')]);if(this[_0xe78a('0x9')][_0x5a44f9['origtransfereruniqueid']]){this['channels'][_0x5a44f9[_0xe78a('0x48')]]['attended']=!![];this[_0xe78a('0x9')][_0x5a44f9['transfereeuniqueid']]=this[_0xe78a('0x9')][_0x5a44f9[_0xe78a('0x48')]];delete this[_0xe78a('0x9')][_0x5a44f9[_0xe78a('0x48')]];}}}catch(_0x4a54fc){logger[_0xe78a('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x4a54fc[_0xe78a('0x36')]);}};Acw[_0xe78a('0x37')][_0xe78a('0x12')]=function(_0x572777){try{if(this[_0xe78a('0x9')][_0x572777[_0xe78a('0x49')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x572777[_0xe78a('0x49')]));this[_0xe78a('0x18')](_0x572777[_0xe78a('0x49')]);}else if(this[_0xe78a('0x9')][_0x572777['transfererlinkedid']]){logger[_0xe78a('0x27')](_0xe78a('0x4a'),JSON[_0xe78a('0x4b')](_0x572777[_0xe78a('0x4c')]));this[_0xe78a('0x18')](_0x572777[_0xe78a('0x4c')]);}}catch(_0x2cc9e6){logger['error'](_0xe78a('0x4d'),_0x2cc9e6[_0xe78a('0x36')]);}};Acw[_0xe78a('0x37')]['syncAgentRingNoAnswer']=function(_0x46dc13){try{if(this['voiceQueues'][_0x46dc13[_0xe78a('0x1a')]]&&this[_0xe78a('0x6')][_0x46dc13[_0xe78a('0x1a')]][_0xe78a('0x4e')]===_0xe78a('0x4f')){if(this['agents'][_0x46dc13[_0xe78a('0x19')]]){logger['info'](_0xe78a('0x50'),_0x46dc13[_0xe78a('0x2f')],_0x46dc13[_0xe78a('0x19')],_0x46dc13[_0xe78a('0x1a')]);return RpcUser[_0xe78a('0x25')](this[_0xe78a('0x7')][_0x46dc13[_0xe78a('0x19')]],'Auto-Pause',_0x46dc13[_0xe78a('0x2f')]);}}}catch(_0x497311){logger[_0xe78a('0x32')](_0xe78a('0x51'),_0x497311['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 7303577..1d0b1c2 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 _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x5e6753,_0x1e2166){var _0x4261d2=function(_0x3b2835){while(--_0x3b2835){_0x5e6753['push'](_0x5e6753['shift']());}};_0x4261d2(++_0x1e2166);}(_0xb10b,0x12a));var _0xbb10=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0xb10b[_0x10852d];return _0x13a8d6;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file +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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2032,0xd9));var _0x2203=function(_0x146652,_0x3dfcbf){_0x146652=_0x146652-0x0;var _0x46c291=_0x2032[_0x146652];return _0x46c291;};'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 diff --git a/server/services/ami/client.js b/server/services/ami/client.js index c09852a..42a8a52 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 _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x20e214,_0x3afe50){var _0x2661ed=function(_0x41b276){while(--_0x41b276){_0x20e214['push'](_0x20e214['shift']());}};_0x2661ed(++_0x3afe50);}(_0xaa88,0x137));var _0x8aa8=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0xaa88[_0x4df85c];return _0x4e2a61;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xcb91[_0x4d35f3];return _0x382fea;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('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 b8d6ae3..adfe17d 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 _0x3edc=['lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','dialCutDigit','prototype','getQueue','queue'];(function(_0x1cc860,_0x59beae){var _0x1bc9a9=function(_0x22bd52){while(--_0x22bd52){_0x1cc860['push'](_0x1cc860['shift']());}};_0x1bc9a9(++_0x59beae);}(_0x3edc,0x108));var _0xc3ed=function(_0x2a3b44,_0x653ff3){_0x2a3b44=_0x2a3b44-0x0;var _0x4b45d2=_0x3edc[_0x2a3b44];return _0x4b45d2;};'use strict';var util=require('util');var _=require(_0xc3ed('0x0'));var moment=require(_0xc3ed('0x1'));function checkNameSurname(_0x597c80,_0x557d2d,_0x41a659){var _0x3996e2='';if(!_[_0xc3ed('0x2')](_0x557d2d)&&'string'===typeof _0x557d2d){_0x3996e2+=_0x557d2d;}if(!_[_0xc3ed('0x2')](_0x41a659)&&_0xc3ed('0x3')===typeof _0x41a659){_0x3996e2+='\x20'+_0x41a659;}if(_0x3996e2!==''){return _0x3996e2;}return _0x597c80;}function Action(_0x14674f,_0x6760f2,_0x404779){this[_0xc3ed('0x4')]=_0x14674f;this[_0xc3ed('0x5')]=_0x404779||undefined;this[_0xc3ed('0x6')]=checkNameSurname(_0x6760f2[_0xc3ed('0x7')][_0xc3ed('0x8')],_0x6760f2['Contact']['firstName'],_0x6760f2[_0xc3ed('0x7')]['lastName']);this[_0xc3ed('0x9')]=_0x6760f2[_0xc3ed('0x8')];this['queue']=_0x14674f[_0xc3ed('0x6')];this[_0xc3ed('0xa')]=_0x6760f2['active']||![];this[_0xc3ed('0xb')]=_0x14674f[_0xc3ed('0xb')];this[_0xc3ed('0xc')]=_0x14674f[_0xc3ed('0xc')]||0x3;this['scheduledat']=_0x6760f2[_0xc3ed('0xd')];this[_0xc3ed('0xe')]=_0x6760f2[_0xc3ed('0xe')];this[_0xc3ed('0xf')]=_0x6760f2[_0xc3ed('0xf')];this['countnoanswerretry']=_0x6760f2[_0xc3ed('0x10')];this['countnosuchnumberretry']=_0x6760f2[_0xc3ed('0x11')];this[_0xc3ed('0x12')]=_0x6760f2[_0xc3ed('0x12')];this[_0xc3ed('0x13')]=_0x6760f2['countabandonedretry'];this[_0xc3ed('0x14')]=_0x6760f2['countmachineretry'];this[_0xc3ed('0x15')]=_0x6760f2[_0xc3ed('0x15')];this[_0xc3ed('0x16')]=_0x6760f2[_0xc3ed('0x16')];this['ListId']=_0x6760f2[_0xc3ed('0x17')];this['UserId']=_0x6760f2[_0xc3ed('0x18')];this[_0xc3ed('0x19')]=_0x6760f2['VoiceQueueId'];this[_0xc3ed('0x1a')]=_0x6760f2[_0xc3ed('0x1a')];this[_0xc3ed('0x1b')]=_0x6760f2['id'];this[_0xc3ed('0x1c')]=_0x6760f2[_0xc3ed('0x7')][_0xc3ed('0x1d')]||'';this[_0xc3ed('0x1e')]=moment()[_0xc3ed('0x1f')](_0xc3ed('0x20'));this[_0xc3ed('0x21')]=_0x6760f2[_0xc3ed('0x21')];this[_0xc3ed('0x22')]=_0x6760f2[_0xc3ed('0x22')];this[_0xc3ed('0x23')]=_0x6760f2['callbackat'];this[_0xc3ed('0x24')]=_0x6760f2[_0xc3ed('0x24')];this[_0xc3ed('0x25')]='';this[_0xc3ed('0x26')]='';}Action['prototype'][_0xc3ed('0x27')]=function(){return util[_0xc3ed('0x1f')]('\x22%s\x22\x20<%s>',this[_0xc3ed('0x6')],this[_0xc3ed('0x4')][_0xc3ed('0x28')]>0x0?this[_0xc3ed('0x9')]['substring'](this[_0xc3ed('0x4')]['dialCutDigit']):this[_0xc3ed('0x9')]);};Action[_0xc3ed('0x29')][_0xc3ed('0x2a')]=function(){return this[_0xc3ed('0x2b')];};module['exports']=Action; \ No newline at end of file +var _0x7031=['dialQueueTimeout','scheduledat','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','exports','util','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active'];(function(_0x19e8db,_0x55f8c6){var _0xe30df1=function(_0x407a59){while(--_0x407a59){_0x19e8db['push'](_0x19e8db['shift']());}};_0xe30df1(++_0x55f8c6);}(_0x7031,0x1d3));var _0x1703=function(_0xa72345,_0x1fd304){_0xa72345=_0xa72345-0x0;var _0xbc82fb=_0x7031[_0xa72345];return _0xbc82fb;};'use strict';var util=require(_0x1703('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x2a3357,_0x14a205,_0x29a2c9){var _0x7f889c='';if(!_[_0x1703('0x1')](_0x14a205)&&_0x1703('0x2')===typeof _0x14a205){_0x7f889c+=_0x14a205;}if(!_[_0x1703('0x1')](_0x29a2c9)&&'string'===typeof _0x29a2c9){_0x7f889c+='\x20'+_0x29a2c9;}if(_0x7f889c!==''){return _0x7f889c;}return _0x2a3357;}function Action(_0x59a854,_0x5e2666,_0x391bb8){this[_0x1703('0x3')]=_0x59a854;this[_0x1703('0x4')]=_0x391bb8||undefined;this[_0x1703('0x5')]=checkNameSurname(_0x5e2666[_0x1703('0x6')][_0x1703('0x7')],_0x5e2666[_0x1703('0x6')][_0x1703('0x8')],_0x5e2666[_0x1703('0x6')][_0x1703('0x9')]);this[_0x1703('0xa')]=_0x5e2666['phone'];this[_0x1703('0xb')]=_0x59a854[_0x1703('0x5')];this[_0x1703('0xc')]=_0x5e2666[_0x1703('0xc')]||![];this['type']=_0x59a854['type'];this[_0x1703('0xd')]=_0x59a854['dialQueueTimeout']||0x3;this[_0x1703('0xe')]=_0x5e2666['scheduledat'];this['countbusyretry']=_0x5e2666[_0x1703('0xf')];this['countcongestionretry']=_0x5e2666['countcongestionretry'];this['countnoanswerretry']=_0x5e2666['countnoanswerretry'];this['countnosuchnumberretry']=_0x5e2666[_0x1703('0x10')];this[_0x1703('0x11')]=_0x5e2666[_0x1703('0x11')];this[_0x1703('0x12')]=_0x5e2666[_0x1703('0x12')];this[_0x1703('0x13')]=_0x5e2666['countmachineretry'];this[_0x1703('0x14')]=_0x5e2666[_0x1703('0x14')];this[_0x1703('0x15')]=_0x5e2666[_0x1703('0x15')];this[_0x1703('0x16')]=_0x5e2666[_0x1703('0x16')];this[_0x1703('0x17')]=_0x5e2666[_0x1703('0x17')];this[_0x1703('0x18')]=_0x5e2666['VoiceQueueId'];this[_0x1703('0x19')]=_0x5e2666['CampaignId'];this[_0x1703('0x1a')]=_0x5e2666['id'];this[_0x1703('0x1b')]=_0x5e2666[_0x1703('0x6')][_0x1703('0x8')]||'';this[_0x1703('0x1c')]=moment()['format'](_0x1703('0x1d'));this[_0x1703('0x1e')]=_0x5e2666[_0x1703('0x1e')];this[_0x1703('0x1f')]=_0x5e2666[_0x1703('0x1f')];this[_0x1703('0x20')]=_0x5e2666[_0x1703('0x20')];this[_0x1703('0x21')]=_0x5e2666[_0x1703('0x21')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1703('0x22')][_0x1703('0x23')]=function(){return util[_0x1703('0x24')](_0x1703('0x25'),this[_0x1703('0x5')],this['voiceQueue'][_0x1703('0x26')]>0x0?this[_0x1703('0xa')]['substring'](this[_0x1703('0x3')][_0x1703('0x26')]):this[_0x1703('0xa')]);};Action[_0x1703('0x22')]['getQueue']=function(){return this[_0x1703('0xb')];};module[_0x1703('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 0cfde1e..48f8330 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 _0xdde2=['type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','seconds','statedesc','Answer','scheduledat'];(function(_0x1aefea,_0x39e5fa){var _0x33a7a1=function(_0x5cef45){while(--_0x5cef45){_0x1aefea['push'](_0x1aefea['shift']());}};_0x33a7a1(++_0x39e5fa);}(_0xdde2,0xcb));var _0x2dde=function(_0x2df62f,_0x108081){_0x2df62f=_0x2df62f-0x0;var _0x36c339=_0xdde2[_0x2df62f];return _0x36c339;};'use strict';var util=require(_0x2dde('0x0'));var _=require(_0x2dde('0x1'));var moment=require(_0x2dde('0x2'));function getSeconds(_0x489ea0,_0x107a1f){var _0x42b429=moment(_0x489ea0)['milliseconds'](0x0);var _0x3eacba=moment(_0x107a1f)['milliseconds'](0x0);return _0x42b429['diff'](_0x3eacba,_0x2dde('0x3'));}function AgentComplete(_0x4cc77d,_0x54f4fc){this['state']=0x4;this[_0x2dde('0x4')]=_0x2dde('0x5');this[_0x2dde('0x6')]=_0x4cc77d['scheduledat'];this['type']=_0x4cc77d[_0x2dde('0x7')];this['campaigntype']=_0x4cc77d[_0x2dde('0x7')]==='outbound'?'queue':_0x4cc77d[_0x2dde('0x7')];this[_0x2dde('0x8')]=_0x4cc77d[_0x2dde('0x8')];this[_0x2dde('0x9')]=_0x4cc77d[_0x2dde('0x9')];this[_0x2dde('0xa')]=_0x4cc77d['countnoanswerretry'];this[_0x2dde('0xb')]=_0x4cc77d[_0x2dde('0x8')]+_0x4cc77d['countcongestionretry']+_0x4cc77d['countnoanswerretry']+_0x4cc77d['countnosuchnumberretry']+_0x4cc77d[_0x2dde('0xc')]+_0x4cc77d['countabandonedretry']+_0x4cc77d[_0x2dde('0xd')]+_0x4cc77d[_0x2dde('0xe')];this[_0x2dde('0xf')]=_0x4cc77d['countnosuchnumberretry'];this['countdropretry']=_0x4cc77d[_0x2dde('0xc')];this[_0x2dde('0x10')]=_0x4cc77d['countabandonedretry'];this[_0x2dde('0xd')]=_0x4cc77d[_0x2dde('0xd')];this[_0x2dde('0xe')]=_0x4cc77d[_0x2dde('0xe')];this[_0x2dde('0x11')]=_0x54f4fc[_0x2dde('0x11')];this[_0x2dde('0x12')]=_0x4cc77d[_0x2dde('0x13')];this[_0x2dde('0x14')]=_0x4cc77d['number'];this['starttime']=_0x4cc77d[_0x2dde('0x15')];this[_0x2dde('0x16')]=_0x4cc77d[_0x2dde('0x16')];this[_0x2dde('0x17')]=_0x4cc77d[_0x2dde('0x17')];this[_0x2dde('0x18')]=moment()['format'](_0x2dde('0x19'));this['ringtime']=getSeconds(_0x4cc77d['responsetime'],_0x4cc77d['starttime']);this[_0x2dde('0x1a')]=getSeconds(_0x4cc77d[_0x2dde('0x17')],_0x4cc77d[_0x2dde('0x16')]);this[_0x2dde('0x1b')]=getSeconds(this['endtime'],_0x4cc77d['answertime']);this['queue']=_0x54f4fc[_0x2dde('0x1c')];this[_0x2dde('0x1d')]=_0x54f4fc[_0x2dde('0x1d')];this[_0x2dde('0x1e')]=_0x54f4fc['reason'];this[_0x2dde('0x1f')]=_0x4cc77d['callback'];this[_0x2dde('0x20')]=_0x4cc77d['callbackuniqueid'];this[_0x2dde('0x21')]=_0x4cc77d['callbackat'];this[_0x2dde('0x22')]=_0x4cc77d[_0x2dde('0x22')];this[_0x2dde('0x23')]=_0x4cc77d[_0x2dde('0x23')];this[_0x2dde('0x24')]=_0x4cc77d[_0x2dde('0x24')];this['UserId']=_0x4cc77d['UserId'];this[_0x2dde('0x25')]=_0x4cc77d[_0x2dde('0x25')];this[_0x2dde('0x26')]=_0x4cc77d['CampaignId'];this[_0x2dde('0x27')]=_0x4cc77d[_0x2dde('0x27')]||'';this[_0x2dde('0x28')]=_0x4cc77d[_0x2dde('0x28')]||'';}module[_0x2dde('0x29')]=AgentComplete; \ No newline at end of file +var _0x3f31=['starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','queue','membername','reason','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','statedesc','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number'];(function(_0x48d3f7,_0x432d20){var _0x24340b=function(_0x195549){while(--_0x195549){_0x48d3f7['push'](_0x48d3f7['shift']());}};_0x24340b(++_0x432d20);}(_0x3f31,0x17b));var _0x13f3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3f31[_0x17d9e3];return _0x14192d;};'use strict';var util=require('util');var _=require(_0x13f3('0x0'));var moment=require('moment');function getSeconds(_0x17b501,_0x2ae981){var _0x4f85b7=moment(_0x17b501)[_0x13f3('0x1')](0x0);var _0x58c095=moment(_0x2ae981)[_0x13f3('0x1')](0x0);return _0x4f85b7[_0x13f3('0x2')](_0x58c095,_0x13f3('0x3'));}function AgentComplete(_0x3a5feb,_0x2b2138){this['state']=0x4;this[_0x13f3('0x4')]='Answer';this[_0x13f3('0x5')]=_0x3a5feb['scheduledat'];this[_0x13f3('0x6')]=_0x3a5feb[_0x13f3('0x6')];this['campaigntype']=_0x3a5feb[_0x13f3('0x6')]===_0x13f3('0x7')?'queue':_0x3a5feb[_0x13f3('0x6')];this[_0x13f3('0x8')]=_0x3a5feb[_0x13f3('0x8')];this[_0x13f3('0x9')]=_0x3a5feb[_0x13f3('0x9')];this[_0x13f3('0xa')]=_0x3a5feb[_0x13f3('0xa')];this[_0x13f3('0xb')]=_0x3a5feb[_0x13f3('0x8')]+_0x3a5feb['countcongestionretry']+_0x3a5feb[_0x13f3('0xa')]+_0x3a5feb[_0x13f3('0xc')]+_0x3a5feb[_0x13f3('0xd')]+_0x3a5feb[_0x13f3('0xe')]+_0x3a5feb[_0x13f3('0xf')]+_0x3a5feb[_0x13f3('0x10')];this['countnosuchnumberretry']=_0x3a5feb[_0x13f3('0xc')];this[_0x13f3('0xd')]=_0x3a5feb['countdropretry'];this['countabandonedretry']=_0x3a5feb[_0x13f3('0xe')];this[_0x13f3('0xf')]=_0x3a5feb[_0x13f3('0xf')];this[_0x13f3('0x10')]=_0x3a5feb[_0x13f3('0x10')];this[_0x13f3('0x11')]=_0x2b2138[_0x13f3('0x11')];this[_0x13f3('0x12')]=_0x3a5feb['name'];this[_0x13f3('0x13')]=_0x3a5feb[_0x13f3('0x14')];this['starttime']=_0x3a5feb[_0x13f3('0x15')];this[_0x13f3('0x16')]=_0x3a5feb['responsetime'];this[_0x13f3('0x17')]=_0x3a5feb['answertime'];this[_0x13f3('0x18')]=moment()[_0x13f3('0x19')](_0x13f3('0x1a'));this['ringtime']=getSeconds(_0x3a5feb['responsetime'],_0x3a5feb['starttime']);this['holdtime']=getSeconds(_0x3a5feb[_0x13f3('0x17')],_0x3a5feb['responsetime']);this[_0x13f3('0x1b')]=getSeconds(this[_0x13f3('0x18')],_0x3a5feb[_0x13f3('0x17')]);this[_0x13f3('0x1c')]=_0x2b2138['queue'];this[_0x13f3('0x1d')]=_0x2b2138['membername'];this[_0x13f3('0x1e')]=_0x2b2138[_0x13f3('0x1e')];this['callback']=_0x3a5feb['callback'];this['callbackuniqueid']=_0x3a5feb['callbackuniqueid'];this[_0x13f3('0x1f')]=_0x3a5feb[_0x13f3('0x1f')];this['recallme']=_0x3a5feb[_0x13f3('0x20')];this[_0x13f3('0x21')]=_0x3a5feb[_0x13f3('0x21')];this[_0x13f3('0x22')]=_0x3a5feb['ListId'];this[_0x13f3('0x23')]=_0x3a5feb[_0x13f3('0x23')];this['VoiceQueueId']=_0x3a5feb['VoiceQueueId'];this['CampaignId']=_0x3a5feb[_0x13f3('0x24')];this[_0x13f3('0x25')]=_0x3a5feb[_0x13f3('0x25')]||'';this['originatecalleridname']=_0x3a5feb[_0x13f3('0x26')]||'';}module[_0x13f3('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index e62948e..560549d 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 _0x31af=['uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x1fa2da,_0x180284){var _0x28b05a=function(_0x102b0e){while(--_0x102b0e){_0x1fa2da['push'](_0x1fa2da['shift']());}};_0x28b05a(++_0x180284);}(_0x31af,0xde));var _0xf31a=function(_0x309715,_0x1be437){_0x309715=_0x309715-0x0;var _0x22c7eb=_0x31af[_0x309715];return _0x22c7eb;};'use strict';var util=require(_0xf31a('0x0'));var _=require(_0xf31a('0x1'));var moment=require(_0xf31a('0x2'));function getSeconds(_0x4d5e50,_0x5f5639){var _0x4596f6=moment(_0x4d5e50)['milliseconds'](0x0);var _0x3b7976=moment(_0x5f5639)[_0xf31a('0x3')](0x0);return _0x4596f6[_0xf31a('0x4')](_0x3b7976,_0xf31a('0x5'));}function Final(_0x5ad096){this[_0xf31a('0x6')]=_0x5ad096[_0xf31a('0x6')];this[_0xf31a('0x7')]=_0x5ad096[_0xf31a('0x7')];this['type']=_0x5ad096[_0xf31a('0x8')];this[_0xf31a('0x9')]=_0x5ad096[_0xf31a('0x8')]===_0xf31a('0xa')?'queue':_0x5ad096[_0xf31a('0x8')];this[_0xf31a('0xb')]=_0x5ad096[_0xf31a('0xb')];this[_0xf31a('0xc')]=_0x5ad096[_0xf31a('0xc')];this['countnoanswerretry']=_0x5ad096[_0xf31a('0xd')];this[_0xf31a('0xe')]=_0x5ad096[_0xf31a('0xb')]+_0x5ad096[_0xf31a('0xc')]+_0x5ad096['countnoanswerretry']+_0x5ad096[_0xf31a('0xf')]+_0x5ad096[_0xf31a('0x10')]+_0x5ad096['countabandonedretry']+_0x5ad096[_0xf31a('0x11')]+_0x5ad096[_0xf31a('0x12')];this[_0xf31a('0xf')]=_0x5ad096[_0xf31a('0xf')];this[_0xf31a('0x10')]=_0x5ad096[_0xf31a('0x10')];this[_0xf31a('0x13')]=_0x5ad096[_0xf31a('0x13')];this[_0xf31a('0x11')]=_0x5ad096[_0xf31a('0x11')];this[_0xf31a('0x12')]=_0x5ad096[_0xf31a('0x12')];this[_0xf31a('0x14')]=_0x5ad096[_0xf31a('0x14')];this[_0xf31a('0x15')]=_0x5ad096['calleridname'];this[_0xf31a('0x16')]=_0x5ad096[_0xf31a('0x16')];this[_0xf31a('0x17')]=_0x5ad096[_0xf31a('0x17')];this['responsetime']=_0x5ad096[_0xf31a('0x18')];this[_0xf31a('0x19')]=_0x5ad096[_0xf31a('0x18')];this[_0xf31a('0x1a')]=_0x5ad096[_0xf31a('0x1a')]||0x0;this['holdtime']=_0x5ad096[_0xf31a('0x1b')]||0x0;this[_0xf31a('0x1c')]=_0x5ad096['talktime']||0x0;this[_0xf31a('0x1d')]=_0x5ad096[_0xf31a('0x1d')];this['callbackuniqueid']=_0x5ad096[_0xf31a('0x1e')];this[_0xf31a('0x1f')]=_0x5ad096['callbackat'];this['recallme']=_0x5ad096['recallme'];this[_0xf31a('0x20')]=_0x5ad096[_0xf31a('0x20')];this['ListId']=_0x5ad096[_0xf31a('0x21')];this[_0xf31a('0x22')]=_0x5ad096[_0xf31a('0x22')];this[_0xf31a('0x23')]=_0x5ad096['VoiceQueueId'];this['CampaignId']=_0x5ad096[_0xf31a('0x24')];this[_0xf31a('0x25')]=_0x5ad096['originatecalleridnum']||'';this['originatecalleridname']=_0x5ad096['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0x446c=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','type','campaigntype','outbound'];(function(_0x19b573,_0x87efe0){var _0x725a9d=function(_0x557095){while(--_0x557095){_0x19b573['push'](_0x19b573['shift']());}};_0x725a9d(++_0x87efe0);}(_0x446c,0x156));var _0xc446=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x446c[_0x49ca18];return _0x145d54;};'use strict';var util=require(_0xc446('0x0'));var _=require(_0xc446('0x1'));var moment=require(_0xc446('0x2'));function getSeconds(_0x45c553,_0x48222e){var _0x303cd0=moment(_0x45c553)[_0xc446('0x3')](0x0);var _0xd67fc7=moment(_0x48222e)['milliseconds'](0x0);return _0x303cd0[_0xc446('0x4')](_0xd67fc7,'seconds');}function Final(_0x4a1bce){this[_0xc446('0x5')]=_0x4a1bce[_0xc446('0x5')];this['scheduledat']=_0x4a1bce['scheduledat'];this[_0xc446('0x6')]=_0x4a1bce[_0xc446('0x6')];this[_0xc446('0x7')]=_0x4a1bce[_0xc446('0x6')]===_0xc446('0x8')?'queue':_0x4a1bce[_0xc446('0x6')];this[_0xc446('0x9')]=_0x4a1bce[_0xc446('0x9')];this[_0xc446('0xa')]=_0x4a1bce['countcongestionretry'];this[_0xc446('0xb')]=_0x4a1bce[_0xc446('0xb')];this[_0xc446('0xc')]=_0x4a1bce[_0xc446('0x9')]+_0x4a1bce[_0xc446('0xa')]+_0x4a1bce[_0xc446('0xb')]+_0x4a1bce[_0xc446('0xd')]+_0x4a1bce[_0xc446('0xe')]+_0x4a1bce[_0xc446('0xf')]+_0x4a1bce[_0xc446('0x10')]+_0x4a1bce[_0xc446('0x11')];this[_0xc446('0xd')]=_0x4a1bce[_0xc446('0xd')];this[_0xc446('0xe')]=_0x4a1bce[_0xc446('0xe')];this[_0xc446('0xf')]=_0x4a1bce[_0xc446('0xf')];this[_0xc446('0x10')]=_0x4a1bce[_0xc446('0x10')];this['countagentrejectretry']=_0x4a1bce[_0xc446('0x11')];this[_0xc446('0x12')]=_0x4a1bce[_0xc446('0x12')];this[_0xc446('0x13')]=_0x4a1bce[_0xc446('0x13')];this[_0xc446('0x14')]=_0x4a1bce[_0xc446('0x14')];this[_0xc446('0x15')]=_0x4a1bce[_0xc446('0x15')];this[_0xc446('0x16')]=_0x4a1bce['responsetime'];this[_0xc446('0x17')]=_0x4a1bce[_0xc446('0x16')];this['ringtime']=_0x4a1bce[_0xc446('0x18')]||0x0;this[_0xc446('0x19')]=_0x4a1bce[_0xc446('0x19')]||0x0;this[_0xc446('0x1a')]=_0x4a1bce[_0xc446('0x1a')]||0x0;this[_0xc446('0x1b')]=_0x4a1bce[_0xc446('0x1b')];this[_0xc446('0x1c')]=_0x4a1bce[_0xc446('0x1c')];this[_0xc446('0x1d')]=_0x4a1bce['callbackat'];this[_0xc446('0x1e')]=_0x4a1bce[_0xc446('0x1e')];this[_0xc446('0x1f')]=_0x4a1bce[_0xc446('0x1f')];this[_0xc446('0x20')]=_0x4a1bce[_0xc446('0x20')];this[_0xc446('0x21')]=_0x4a1bce[_0xc446('0x21')];this[_0xc446('0x22')]=_0x4a1bce[_0xc446('0x22')];this[_0xc446('0x23')]=_0x4a1bce[_0xc446('0x23')];this[_0xc446('0x24')]=_0x4a1bce[_0xc446('0x24')]||'';this[_0xc446('0x25')]=_0x4a1bce[_0xc446('0x25')]||'';}module[_0xc446('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 043e3c6..8702f3f 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 _0xb207=['diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds'];(function(_0x4a4fc1,_0x1f373d){var _0x3cee8d=function(_0x3ad397){while(--_0x3ad397){_0x4a4fc1['push'](_0x4a4fc1['shift']());}};_0x3cee8d(++_0x1f373d);}(_0xb207,0x191));var _0x7b20=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xb207[_0x30faec];return _0x29484f;};'use strict';var util=require(_0x7b20('0x0'));var _=require(_0x7b20('0x1'));var moment=require(_0x7b20('0x2'));function getSeconds(_0x36d291,_0x40bb3f){var _0x10cb0b=moment(_0x36d291)[_0x7b20('0x3')](0x0);var _0xa4781e=moment(_0x40bb3f)[_0x7b20('0x3')](0x0);return _0x10cb0b[_0x7b20('0x4')](_0xa4781e,_0x7b20('0x5'));}function Hangup(_0x4d21f5,_0x30743b){this[_0x7b20('0x6')]=0x4;this[_0x7b20('0x7')]=_0x7b20('0x8');this['scheduledat']=_0x4d21f5[_0x7b20('0x9')];this['type']=_0x4d21f5[_0x7b20('0xa')];this[_0x7b20('0xb')]=_0x4d21f5[_0x7b20('0xa')]==='outbound'?_0x7b20('0xc'):_0x4d21f5[_0x7b20('0xa')];this[_0x7b20('0xd')]=_0x4d21f5[_0x7b20('0xd')];this[_0x7b20('0xe')]=_0x4d21f5[_0x7b20('0xe')];this[_0x7b20('0xf')]=_0x4d21f5[_0x7b20('0xf')];this[_0x7b20('0x10')]=_0x4d21f5['countbusyretry']+_0x4d21f5[_0x7b20('0xe')]+_0x4d21f5[_0x7b20('0xf')]+_0x4d21f5[_0x7b20('0x11')]+_0x4d21f5[_0x7b20('0x12')]+_0x4d21f5[_0x7b20('0x13')]+_0x4d21f5[_0x7b20('0x14')]+_0x4d21f5[_0x7b20('0x15')];this['countnosuchnumberretry']=_0x4d21f5[_0x7b20('0x11')];this['countdropretry']=_0x4d21f5[_0x7b20('0x12')];this[_0x7b20('0x13')]=_0x4d21f5['countabandonedretry'];this[_0x7b20('0x14')]=_0x4d21f5[_0x7b20('0x14')];this[_0x7b20('0x15')]=_0x4d21f5[_0x7b20('0x15')];this[_0x7b20('0x16')]=_0x30743b[_0x7b20('0x16')];this[_0x7b20('0x17')]=_0x4d21f5[_0x7b20('0x18')];this[_0x7b20('0x19')]=_0x4d21f5[_0x7b20('0x1a')];this[_0x7b20('0x1b')]=_0x4d21f5[_0x7b20('0x1b')];this['responsetime']=_0x4d21f5[_0x7b20('0x1c')];this['endtime']=moment()[_0x7b20('0x1d')](_0x7b20('0x1e'));this[_0x7b20('0x1f')]=getSeconds(_0x4d21f5[_0x7b20('0x1c')],_0x4d21f5['starttime']);this['holdtime']=0x0;this[_0x7b20('0x20')]=getSeconds(this['endtime'],_0x4d21f5[_0x7b20('0x1c')]);this[_0x7b20('0xc')]=_0x4d21f5['queue'];this[_0x7b20('0x21')]='IVR';this[_0x7b20('0x22')]=_0x30743b['cause-txt'];this['callback']=_0x4d21f5[_0x7b20('0x23')];this[_0x7b20('0x24')]=_0x4d21f5[_0x7b20('0x24')];this[_0x7b20('0x25')]=_0x4d21f5[_0x7b20('0x25')];this[_0x7b20('0x26')]=_0x4d21f5[_0x7b20('0x26')];this[_0x7b20('0x27')]=_0x4d21f5[_0x7b20('0x27')];this[_0x7b20('0x28')]=_0x4d21f5[_0x7b20('0x28')];this[_0x7b20('0x29')]=_0x4d21f5[_0x7b20('0x29')];this[_0x7b20('0x2a')]=_0x4d21f5[_0x7b20('0x2a')];this[_0x7b20('0x2b')]=_0x4d21f5[_0x7b20('0x2b')];}module[_0x7b20('0x2c')]=Hangup; \ No newline at end of file +var _0xeda0=['statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state'];(function(_0x5031c3,_0x1645de){var _0xd4d5b4=function(_0x2b5f0b){while(--_0x2b5f0b){_0x5031c3['push'](_0x5031c3['shift']());}};_0xd4d5b4(++_0x1645de);}(_0xeda0,0x10d));var _0x0eda=function(_0x808d16,_0xabe06){_0x808d16=_0x808d16-0x0;var _0x5d4b43=_0xeda0[_0x808d16];return _0x5d4b43;};'use strict';var util=require(_0x0eda('0x0'));var _=require(_0x0eda('0x1'));var moment=require(_0x0eda('0x2'));function getSeconds(_0x3116ee,_0x48404f){var _0x45fb12=moment(_0x3116ee)[_0x0eda('0x3')](0x0);var _0x3ea87b=moment(_0x48404f)['milliseconds'](0x0);return _0x45fb12[_0x0eda('0x4')](_0x3ea87b,_0x0eda('0x5'));}function Hangup(_0x366e96,_0x48d9e8){this[_0x0eda('0x6')]=0x4;this[_0x0eda('0x7')]=_0x0eda('0x8');this[_0x0eda('0x9')]=_0x366e96[_0x0eda('0x9')];this[_0x0eda('0xa')]=_0x366e96[_0x0eda('0xa')];this['campaigntype']=_0x366e96['type']===_0x0eda('0xb')?'queue':_0x366e96[_0x0eda('0xa')];this[_0x0eda('0xc')]=_0x366e96['countbusyretry'];this[_0x0eda('0xd')]=_0x366e96[_0x0eda('0xd')];this[_0x0eda('0xe')]=_0x366e96[_0x0eda('0xe')];this[_0x0eda('0xf')]=_0x366e96[_0x0eda('0xc')]+_0x366e96[_0x0eda('0xd')]+_0x366e96[_0x0eda('0xe')]+_0x366e96[_0x0eda('0x10')]+_0x366e96['countdropretry']+_0x366e96['countabandonedretry']+_0x366e96['countmachineretry']+_0x366e96[_0x0eda('0x11')];this[_0x0eda('0x10')]=_0x366e96[_0x0eda('0x10')];this['countdropretry']=_0x366e96[_0x0eda('0x12')];this[_0x0eda('0x13')]=_0x366e96[_0x0eda('0x13')];this[_0x0eda('0x14')]=_0x366e96[_0x0eda('0x14')];this[_0x0eda('0x11')]=_0x366e96['countagentrejectretry'];this[_0x0eda('0x15')]=_0x48d9e8[_0x0eda('0x15')];this[_0x0eda('0x16')]=_0x366e96[_0x0eda('0x17')];this[_0x0eda('0x18')]=_0x366e96[_0x0eda('0x19')];this[_0x0eda('0x1a')]=_0x366e96[_0x0eda('0x1a')];this[_0x0eda('0x1b')]=_0x366e96['responsetime'];this[_0x0eda('0x1c')]=moment()[_0x0eda('0x1d')](_0x0eda('0x1e'));this[_0x0eda('0x1f')]=getSeconds(_0x366e96['responsetime'],_0x366e96[_0x0eda('0x1a')]);this[_0x0eda('0x20')]=0x0;this[_0x0eda('0x21')]=getSeconds(this['endtime'],_0x366e96[_0x0eda('0x1b')]);this['queue']=_0x366e96[_0x0eda('0x22')];this['membername']='IVR';this[_0x0eda('0x23')]=_0x48d9e8[_0x0eda('0x24')];this['callback']=_0x366e96['callback'];this[_0x0eda('0x25')]=_0x366e96[_0x0eda('0x25')];this[_0x0eda('0x26')]=_0x366e96[_0x0eda('0x26')];this[_0x0eda('0x27')]=_0x366e96['recallme'];this['ContactId']=_0x366e96[_0x0eda('0x28')];this[_0x0eda('0x29')]=_0x366e96['ListId'];this[_0x0eda('0x2a')]=_0x366e96[_0x0eda('0x2a')];this[_0x0eda('0x2b')]=_0x366e96['VoiceQueueId'];this[_0x0eda('0x2c')]=_0x366e96['CampaignId'];}module[_0x0eda('0x2d')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index a3423c4..35766cc 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 _0xb288=['milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','responsetime','ringtime','starttime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment'];(function(_0x5d4a37,_0x4cdc3b){var _0x2679a2=function(_0x4cbeb1){while(--_0x4cbeb1){_0x5d4a37['push'](_0x5d4a37['shift']());}};_0x2679a2(++_0x4cdc3b);}(_0xb288,0x1c5));var _0x8b28=function(_0x3dcaa3,_0x2c7842){_0x3dcaa3=_0x3dcaa3-0x0;var _0x3cb512=_0xb288[_0x3dcaa3];return _0x3cb512;};'use strict';var util=require(_0x8b28('0x0'));var _=require(_0x8b28('0x1'));var moment=require(_0x8b28('0x2'));function getSeconds(_0x257e44,_0x180069){var _0x3e6011=moment(_0x257e44)[_0x8b28('0x3')](0x0);var _0x450857=moment(_0x180069)[_0x8b28('0x3')](0x0);return _0x3e6011[_0x8b28('0x4')](_0x450857,_0x8b28('0x5'));}function History(_0x50b98f){this[_0x8b28('0x6')]=_0x50b98f[_0x8b28('0x6')];this[_0x8b28('0x7')]=_0x50b98f[_0x8b28('0x7')]||undefined;this[_0x8b28('0x8')]=_0x50b98f[_0x8b28('0x8')];this[_0x8b28('0x9')]=_0x50b98f[_0x8b28('0x8')]===_0x8b28('0xa')?_0x8b28('0xb'):_0x50b98f[_0x8b28('0x8')];this['countbusyretry']=_0x50b98f[_0x8b28('0xc')];this[_0x8b28('0xd')]=_0x50b98f[_0x8b28('0xd')];this['countnoanswerretry']=_0x50b98f[_0x8b28('0xe')];this[_0x8b28('0xf')]=_0x50b98f[_0x8b28('0xc')]+_0x50b98f[_0x8b28('0xd')]+_0x50b98f[_0x8b28('0xe')]+_0x50b98f[_0x8b28('0x10')]+_0x50b98f[_0x8b28('0x11')]+_0x50b98f['countabandonedretry']+_0x50b98f[_0x8b28('0x12')]+_0x50b98f['countagentrejectretry'];this[_0x8b28('0x10')]=_0x50b98f[_0x8b28('0x10')];this[_0x8b28('0x11')]=_0x50b98f[_0x8b28('0x11')];this[_0x8b28('0x13')]=_0x50b98f[_0x8b28('0x13')];this['countmachineretry']=_0x50b98f[_0x8b28('0x12')];this[_0x8b28('0x14')]=_0x50b98f[_0x8b28('0x14')];this[_0x8b28('0xb')]=_0x50b98f[_0x8b28('0xb')];this[_0x8b28('0x15')]=_0x50b98f[_0x8b28('0x16')];this[_0x8b28('0x17')]=_0x50b98f['number'];this['starttime']=_0x50b98f['starttime'];this[_0x8b28('0x18')]=_0x50b98f[_0x8b28('0x18')];this['endtime']=_0x50b98f[_0x8b28('0x18')];this[_0x8b28('0x19')]=getSeconds(_0x50b98f[_0x8b28('0x18')],_0x50b98f[_0x8b28('0x1a')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x8b28('0x1b')]=_0x50b98f[_0x8b28('0x1b')];this[_0x8b28('0x1c')]=_0x50b98f['callbackuniqueid'];this['callbackat']=_0x50b98f[_0x8b28('0x1d')];this['recallme']=_0x50b98f[_0x8b28('0x1e')];this[_0x8b28('0x1f')]=_0x50b98f[_0x8b28('0x1f')];this[_0x8b28('0x20')]=_0x50b98f['ListId'];this[_0x8b28('0x21')]=_0x50b98f[_0x8b28('0x21')];this['VoiceQueueId']=_0x50b98f['VoiceQueueId'];this['CampaignId']=_0x50b98f[_0x8b28('0x22')];this[_0x8b28('0x23')]=_0x50b98f['originatecalleridnum']||'';this[_0x8b28('0x24')]=_0x50b98f[_0x8b28('0x24')]||'';}module[_0x8b28('0x25')]=History; \ No newline at end of file +var _0x3398=['countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','callback','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x3240ad,_0x1ffaba){var _0x477ca1=function(_0x2c4d97){while(--_0x2c4d97){_0x3240ad['push'](_0x3240ad['shift']());}};_0x477ca1(++_0x1ffaba);}(_0x3398,0x9b));var _0x8339=function(_0x3ac7ed,_0x12f0d3){_0x3ac7ed=_0x3ac7ed-0x0;var _0x3caa6c=_0x3398[_0x3ac7ed];return _0x3caa6c;};'use strict';var util=require(_0x8339('0x0'));var _=require('lodash');var moment=require(_0x8339('0x1'));function getSeconds(_0x52623a,_0x9bb5d3){var _0x2fc757=moment(_0x52623a)[_0x8339('0x2')](0x0);var _0x35110e=moment(_0x9bb5d3)[_0x8339('0x2')](0x0);return _0x2fc757['diff'](_0x35110e,_0x8339('0x3'));}function History(_0x1ce2d1){this['uniqueid']=_0x1ce2d1['uniqueid'];this[_0x8339('0x4')]=_0x1ce2d1[_0x8339('0x4')]||undefined;this[_0x8339('0x5')]=_0x1ce2d1[_0x8339('0x5')];this[_0x8339('0x6')]=_0x1ce2d1[_0x8339('0x5')]==='outbound'?_0x8339('0x7'):_0x1ce2d1['type'];this[_0x8339('0x8')]=_0x1ce2d1['countbusyretry'];this['countcongestionretry']=_0x1ce2d1[_0x8339('0x9')];this[_0x8339('0xa')]=_0x1ce2d1[_0x8339('0xa')];this[_0x8339('0xb')]=_0x1ce2d1[_0x8339('0x8')]+_0x1ce2d1[_0x8339('0x9')]+_0x1ce2d1[_0x8339('0xa')]+_0x1ce2d1[_0x8339('0xc')]+_0x1ce2d1[_0x8339('0xd')]+_0x1ce2d1[_0x8339('0xe')]+_0x1ce2d1[_0x8339('0xf')]+_0x1ce2d1[_0x8339('0x10')];this[_0x8339('0xc')]=_0x1ce2d1[_0x8339('0xc')];this['countdropretry']=_0x1ce2d1[_0x8339('0xd')];this[_0x8339('0xe')]=_0x1ce2d1[_0x8339('0xe')];this[_0x8339('0xf')]=_0x1ce2d1[_0x8339('0xf')];this[_0x8339('0x10')]=_0x1ce2d1[_0x8339('0x10')];this[_0x8339('0x7')]=_0x1ce2d1[_0x8339('0x7')];this[_0x8339('0x11')]=_0x1ce2d1[_0x8339('0x12')];this[_0x8339('0x13')]=_0x1ce2d1[_0x8339('0x14')];this[_0x8339('0x15')]=_0x1ce2d1[_0x8339('0x15')];this['responsetime']=_0x1ce2d1[_0x8339('0x16')];this['endtime']=_0x1ce2d1[_0x8339('0x16')];this[_0x8339('0x17')]=getSeconds(_0x1ce2d1[_0x8339('0x16')],_0x1ce2d1['starttime']);this['holdtime']=0x0;this['talktime']=0x0;this[_0x8339('0x18')]=_0x1ce2d1[_0x8339('0x18')];this['callbackuniqueid']=_0x1ce2d1['callbackuniqueid'];this[_0x8339('0x19')]=_0x1ce2d1['callbackat'];this[_0x8339('0x1a')]=_0x1ce2d1[_0x8339('0x1a')];this[_0x8339('0x1b')]=_0x1ce2d1['ContactId'];this['ListId']=_0x1ce2d1[_0x8339('0x1c')];this[_0x8339('0x1d')]=_0x1ce2d1[_0x8339('0x1d')];this['VoiceQueueId']=_0x1ce2d1['VoiceQueueId'];this[_0x8339('0x1e')]=_0x1ce2d1['CampaignId'];this[_0x8339('0x1f')]=_0x1ce2d1[_0x8339('0x1f')]||'';this[_0x8339('0x20')]=_0x1ce2d1['originatecalleridname']||'';}module[_0x8339('0x21')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f96be82..91091fd 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 _0x9ade=['rrmemory','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','checkDialMethod','progressive','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','[syncCampaigns]','\x5cw{0,','pow','random','match','object','originate','voiceQueue\x20is\x20undefine','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNUM','phone','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','responsetime','response','callProgressDetecting','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','checkRetriveMax','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','[syncAgentComplete][createHistory][11]','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','handlePower','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','dialPredictiveInterval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','floor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','env','XCALLY_IP_AGI','roundrobin','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','bind','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','actions','[actions]','enqueue','Action','status','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','UserId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','state','HangupInAMD','membername','AMD','emit','buildObj','amd','[syncHangupInAMD][createHistory]','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','custom:amd','countdropretry','reason19\x20machine....','createStateFinal','minutes','ListId','CampaignId','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','Unknow','syncAgentComplete','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','syncNewExten','channel','actionid','locked','paused','stateinterface'];(function(_0x453efb,_0x1fac6f){var _0x23fe51=function(_0x42fef4){while(--_0x42fef4){_0x453efb['push'](_0x453efb['shift']());}};_0x23fe51(++_0x1fac6f);}(_0x9ade,0xfc));var _0xe9ad=function(_0x2634a7,_0x118508){_0x2634a7=_0x2634a7-0x0;var _0xa52e2c=_0x9ade[_0x2634a7];return _0xa52e2c;};'use strict';var util=require(_0xe9ad('0x0'));var _=require(_0xe9ad('0x1'));var uuid=require(_0xe9ad('0x2'));var moment=require(_0xe9ad('0x3'));var rr=require('rr');var md5=require(_0xe9ad('0x4'));var Redis=require(_0xe9ad('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0xe9ad('0x6'))('dialer');var loggerBooked=require(_0xe9ad('0x6'))(_0xe9ad('0x7'));var loggerPredictive=require(_0xe9ad('0x6'))('predictive');var loggerPredictiveCalls=require(_0xe9ad('0x6'))(_0xe9ad('0x8'));var loggerSyncQueueSummary=require(_0xe9ad('0x6'))(_0xe9ad('0x9'));var ami=require(_0xe9ad('0xa'));config['redis']=_[_0xe9ad('0xb')](config[_0xe9ad('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xe9ad('0xd'))(new Redis(config[_0xe9ad('0xc')]));var cmHopper=require(_0xe9ad('0xe'));var cmHopperHistory=require(_0xe9ad('0xf'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xe9ad('0x10'));var voiceQueueRt=require(_0xe9ad('0x11'));var RpcSetting=require('../rpc/setting');var Action=require('./action');var History=require('./history');var Final=require(_0xe9ad('0x12'));var AgentComplete=require(_0xe9ad('0x13'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xe9ad('0x14')][_0xe9ad('0x15')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0xe9ad('0x16')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xe9ad('0x17')]['enqueue']=function(_0x536917){this['tail']=this[_0xe9ad('0x18')]?this['tail']['finally'](_0x536917):_0x536917();};function Dialer(_0x3f9b98,_0x2555e1){this[_0xe9ad('0x19')]=new Sequence();this[_0xe9ad('0x1a')]=_0x2555e1;this[_0xe9ad('0x1b')]=_0x3f9b98[_0xe9ad('0x1b')];this[_0xe9ad('0x1c')]=_0x3f9b98[_0xe9ad('0x1c')];this[_0xe9ad('0x1d')]=_0x3f9b98['agents'];this[_0xe9ad('0x1e')]=_0x3f9b98[_0xe9ad('0x1e')];this[_0xe9ad('0x1f')]=config[_0xe9ad('0x1f')]||0x2;this[_0xe9ad('0x20')]={};this['actions']={};this['contactsId']={};this[_0xe9ad('0x21')]={};this[_0xe9ad('0x22')]={};this[_0xe9ad('0x23')]={};this['startProgressive']={};this[_0xe9ad('0x24')]={};this[_0xe9ad('0x25')]={};this[_0xe9ad('0x26')]={};ami['on'](_0xe9ad('0x27'),this[_0xe9ad('0x28')]['bind'](this));ami['on'](_0xe9ad('0x29'),this[_0xe9ad('0x2a')]['bind'](this));ami['on'](_0xe9ad('0x2b'),this['syncOriginateResponse'][_0xe9ad('0x2c')](this));ami['on'](_0xe9ad('0x2d'),this['syncAgentComplete'][_0xe9ad('0x2c')](this));ami['on'](_0xe9ad('0x2e'),this[_0xe9ad('0x9')][_0xe9ad('0x2c')](this));ami['on'](_0xe9ad('0x2f'),this['syncQueueSummaryComplete'][_0xe9ad('0x2c')](this));ami['on'](_0xe9ad('0x30'),this['syncHangup']['bind'](this));ami['on'](_0xe9ad('0x31'),this['syncNewExten']['bind'](this));ami['on'](_0xe9ad('0x32'),this[_0xe9ad('0x33')]['bind'](this));ami['on']('queuemember',this[_0xe9ad('0x34')][_0xe9ad('0x2c')](this));ami['on'](_0xe9ad('0x35'),this[_0xe9ad('0x36')]['bind'](this));this[_0xe9ad('0x37')]();this[_0xe9ad('0x38')]();RpcSetting[_0xe9ad('0x39')]()[_0xe9ad('0x3a')](function(_0x230fae){previewRecallmeReminderInterval=_0x230fae[_0xe9ad('0x3b')];});}function isNotNull(_0x507f02){return _0x507f02!==null&&!_[_0xe9ad('0x3c')](_0x507f02);}function checkIsLoggedIn(_0x39e7b4,_0x275605){return function(){if(_0x275605<=0x0){_0x39e7b4[_0xe9ad('0x3d')]=_0xe9ad('0x3e');throw _0x39e7b4['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4e854f){return _0x4e854f;}function checkIsActive(_0x481f20,_0x4dd0b9){return function(){if(!isActive(_0x4dd0b9)){_0x481f20[_0xe9ad('0x3d')]=_0xe9ad('0x3f');throw _0x481f20[_0xe9ad('0x40')]+_0xe9ad('0x41');}};}function checkInterval(_0x12384e){return function(){if(!isNotNull(_0x12384e[_0xe9ad('0x42')])){_0x12384e[_0xe9ad('0x3d')]='INTERVAL_IS_NULL';throw _0x12384e[_0xe9ad('0x40')]+_0xe9ad('0x43');}if(!isNotNull(_0x12384e['Interval'][_0xe9ad('0x44')])){_0x12384e['message']=_0xe9ad('0x45');throw _0x12384e[_0xe9ad('0x40')]+_0xe9ad('0x43');}if(!isNotNull(_['isEmpty'](_0x12384e['Interval'][_0xe9ad('0x44')]))){_0x12384e[_0xe9ad('0x3d')]=_0xe9ad('0x45');throw _0x12384e['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x33123c,_0x4b1db2,_0x11fbd0){return{'action':_0x33123c,'response':_0x4b1db2,'message':_0x11fbd0,'stack':_0x11fbd0};}function myreject(_0x2a45f2){return function(_0xd04dfe){return _0x2a45f2(msgResponse(_0xe9ad('0x46'),_0xe9ad('0x47'),JSON[_0xe9ad('0x48')](_0xd04dfe)));};}function getSeconds(_0x1b8d72,_0x26eb3c){var _0x2709cb=moment(_0x1b8d72)[_0xe9ad('0x49')](0x0);var _0x3206a8=moment(_0x26eb3c)['milliseconds'](0x0);return _0x2709cb[_0xe9ad('0x4a')](_0x3206a8,_0xe9ad('0x4b'));}function emit(_0x39afb3,_0xcee0a8,_0x1ac8dd){io['to'](_0x39afb3)['emit'](_0xcee0a8,_0x1ac8dd);}function emitVoiceQueueSummary(_0x3d7404){if(_0x3d7404[_0xe9ad('0x4c')]===_0xe9ad('0x4d')){var _0x2994c8={'id':_0x3d7404['id'],'name':_0x3d7404[_0xe9ad('0x40')],'strategy':_0x3d7404[_0xe9ad('0x4e')],'answered':_0x3d7404[_0xe9ad('0x4f')],'available':_0x3d7404['available'],'loggedIn':_0x3d7404[_0xe9ad('0x50')],'pTalking':_0x3d7404[_0xe9ad('0x51')],'sumBillable':_0x3d7404['sumBillable'],'sumDuration':_0x3d7404[_0xe9ad('0x52')],'sumHoldTime':_0x3d7404[_0xe9ad('0x53')]||0x0,'talking':_0x3d7404[_0xe9ad('0x54')],'total':_0x3d7404[_0xe9ad('0x55')],'type':_0x3d7404[_0xe9ad('0x4c')],'unmanaged':_0x3d7404['unmanaged'],'abandoned':_0x3d7404['abandoned'],'waiting':_0x3d7404['waiting'],'loggedInDb':_0x3d7404[_0xe9ad('0x56')],'dialActive':_0x3d7404['dialActive'],'dialMethod':_0x3d7404[_0xe9ad('0x57')],'dialOriginateCallerIdName':_0x3d7404[_0xe9ad('0x58')],'dialOriginateCallerIdNumber':_0x3d7404[_0xe9ad('0x59')],'dialOriginateTimeout':_0x3d7404['dialOriginateTimeout'],'dialPrefix':_0x3d7404['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3d7404[_0xe9ad('0x5a')],'outboundAnswerCallsDay':_0x3d7404[_0xe9ad('0x5b')],'outboundBlacklistCallsDay':_0x3d7404['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3d7404[_0xe9ad('0x5c')],'outboundCongestionCallsDay':_0x3d7404['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3d7404[_0xe9ad('0x5d')],'outboundDropCallsDayCallersExit':_0x3d7404[_0xe9ad('0x5e')],'outboundDropCallsDayTimeout':_0x3d7404[_0xe9ad('0x5f')],'outboundNoAnswerCallsDay':_0x3d7404[_0xe9ad('0x60')],'outboundNoSuchCallsDay':_0x3d7404[_0xe9ad('0x61')],'outboundOriginateFailureCallsDay':_0x3d7404[_0xe9ad('0x62')],'outboundReCallsDay':_0x3d7404[_0xe9ad('0x63')],'outboundRejectCallsDay':_0x3d7404[_0xe9ad('0x64')],'outboundUnknownCallsDay':_0x3d7404[_0xe9ad('0x65')],'predictiveIntervalAnsweredCalls':_0x3d7404['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3d7404['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3d7404[_0xe9ad('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x3d7404[_0xe9ad('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x3d7404[_0xe9ad('0x68')],'predictiveIntervalErlangCalls':_0x3d7404['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3d7404[_0xe9ad('0x69')],'predictiveIntervalHitRate':_0x3d7404[_0xe9ad('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x3d7404['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3d7404['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3d7404[_0xe9ad('0x6b')],'predictiveIntervalTotalCalls':_0x3d7404[_0xe9ad('0x6c')],'message':_0x3d7404[_0xe9ad('0x3d')],'originated':_0x3d7404[_0xe9ad('0x6d')],'erlangCalls':_0x3d7404['erlangCalls'],'erlangCallToSecond':_0x3d7404[_0xe9ad('0x6e')],'erlangAbandonmentRate':_0x3d7404['erlangAbandonmentRate'],'erlangBusyFactor':_0x3d7404[_0xe9ad('0x6f')],'startPredictive':_0x3d7404[_0xe9ad('0x23')],'startProgressive':_0x3d7404[_0xe9ad('0x70')]};if(_0x3d7404[_0xe9ad('0x71')]){_0x2994c8['Trunk']={'id':_0x3d7404[_0xe9ad('0x71')]['id'],'name':_0x3d7404[_0xe9ad('0x71')][_0xe9ad('0x40')],'active':_0x3d7404[_0xe9ad('0x71')]['active'],'callerid':_0x3d7404[_0xe9ad('0x71')][_0xe9ad('0x72')]};}if(_0x3d7404[_0xe9ad('0x42')]){_0x2994c8[_0xe9ad('0x42')]={'id':_0x3d7404[_0xe9ad('0x42')]['id'],'name':_0x3d7404['Interval']['name']};}var _0x4a485a=md5(JSON['stringify'](_0x2994c8));if(_0x3d7404[_0xe9ad('0x4')]!==_0x4a485a){_0x3d7404[_0xe9ad('0x4')]=_0x4a485a;emit(util[_0xe9ad('0x73')]('voice:queue:%s',_0x2994c8[_0xe9ad('0x40')]),_0xe9ad('0x74'),_0x2994c8);}}}function emitCampaignSummary(_0x311c88){if(_0x311c88['type']===_0xe9ad('0x75')){emit(util[_0xe9ad('0x73')](_0xe9ad('0x76'),_0x311c88[_0xe9ad('0x40')]),_0xe9ad('0x77'),_0x311c88);}}function checkGetDataPredictive(_0x3ab4c3){if(isNotNull(_0x3ab4c3)&&!_[_0xe9ad('0x78')](_0x3ab4c3)){loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x7a'));loggerPredictive['info'](_0xe9ad('0x7b'),_0x3ab4c3['predictiveIntervalTotalCalls']);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x7c'),_0x3ab4c3[_0xe9ad('0x7d')]);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x7e'),_0x3ab4c3[_0xe9ad('0x68')]);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x7f'),_0x3ab4c3[_0xe9ad('0x67')]);loggerPredictive[_0xe9ad('0x79')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ab4c3[_0xe9ad('0x80')]);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x81'),_0x3ab4c3[_0xe9ad('0x66')]);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x82'));if(_0x3ab4c3['predictiveIntervalTotalCalls']>0x0){if(!_[_0xe9ad('0x3c')](_0x3ab4c3[_0xe9ad('0x66')])&&_0x3ab4c3[_0xe9ad('0x66')]>0x0){return!![];}loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x83'));if(!_[_0xe9ad('0x3c')](_0x3ab4c3[_0xe9ad('0x80')])&&_0x3ab4c3[_0xe9ad('0x80')]>0x0){return!![];}loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x84'));}else{loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x85'));}}else{loggerPredictive[_0xe9ad('0x79')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x577165){return function(_0xacaf9b){loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x86'));loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x87'),_0xacaf9b[_0xe9ad('0x88')]);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x89'),_0xacaf9b[_0xe9ad('0x6e')]);loggerPredictive['info'](_0xe9ad('0x8a'),_0xacaf9b[_0xe9ad('0x8b')]);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x8c'),_0xacaf9b[_0xe9ad('0x6f')]);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x8a'),_0xacaf9b['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0xe9ad('0x8d')](_0x577165,_0xacaf9b);};}function getDiff(_0x248f78){var _0x187206=moment()[_0xe9ad('0x49')](0x0);var _0x10360f=moment(_0x248f78)['milliseconds'](0x0);return _0x187206['diff'](_0x10360f,_0xe9ad('0x4b'));}function ifInterval(_0xbbae46,_0x189417){if(_[_0xe9ad('0x3c')](_0x189417)){return![];}return getDiff(_0x189417)<_0xbbae46*0x3c;}function freeVariablesPredictive(_0x3a5bbe){if(isNotNull(_0x3a5bbe)){if(!_['isUndefined'](_0x3a5bbe[_0xe9ad('0x70')])){_0x3a5bbe[_0xe9ad('0x70')]=undefined;loggerPredictive['info'](_0x3a5bbe[_0xe9ad('0x40')],_0xe9ad('0x8e'));}if(!_['isUndefined'](_0x3a5bbe[_0xe9ad('0x23')])){_0x3a5bbe[_0xe9ad('0x23')]=undefined;loggerPredictive[_0xe9ad('0x79')](_0x3a5bbe[_0xe9ad('0x40')],_0xe9ad('0x8f'));}if(!_[_0xe9ad('0x3c')](_0x3a5bbe['handlePredictive'])){clearInterval(_0x3a5bbe[_0xe9ad('0x90')]);_0x3a5bbe[_0xe9ad('0x90')]=undefined;loggerPredictive[_0xe9ad('0x79')](_0x3a5bbe[_0xe9ad('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x3166dd,_0x611b9b){if(_0x611b9b===0x0){return 0x0;}var _0x2abe3b=0x1;for(var _0x2568f1=0x1;_0x2568f1<=_0x611b9b;_0x2568f1+=0x1){_0x2abe3b=0x1+_0x2abe3b*_0x2568f1/_0x3166dd;}return 0x1/_0x2abe3b;}function isVoiceQueueOutbound(_0x7cb1b6){return _0x7cb1b6===_0xe9ad('0x4d');}function isNotPreview(_0xe3377c){return _0xe3377c!==_0xe9ad('0x1a');}function isCampaignIvr(_0x14d08f){return _0x14d08f===_0xe9ad('0x75');}function getCallerId(_0xc4bd4e,_0x116f4b,_0x37234a){if(!_[_0xe9ad('0x3c')](_0x37234a)&&typeof _0x37234a==='string'&&!_[_0xe9ad('0x78')](_0x37234a)){if(!_['isUndefined'](_0x116f4b)&&typeof _0x116f4b===_0xe9ad('0x91')&&!_[_0xe9ad('0x78')](_0x116f4b)){return util[_0xe9ad('0x73')](_0xe9ad('0x92'),_0x116f4b,_0x37234a);}return util[_0xe9ad('0x73')](_0xe9ad('0x92'),_0x37234a,_0x37234a);}if(!_[_0xe9ad('0x3c')](_0xc4bd4e)&&typeof _0xc4bd4e===_0xe9ad('0x91')&&!_[_0xe9ad('0x78')](_0xc4bd4e)){return _0xc4bd4e;}return _0xe9ad('0x93');}function loggerCatchQueueSummary(_0x5da623,_0x9286fe){return function(_0x4349ac){freeVariablesPredictive(_0x9286fe);emitVoiceQueueSummary(_0x9286fe);emitCampaignSummary(_0x9286fe);loggerSyncQueueSummary[_0xe9ad('0x94')](_0x5da623,util[_0xe9ad('0x95')](_0x4349ac,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x169a68,_0xffa0c){return function(_0x18b0dc){loggerPredictive[_0xe9ad('0x96')](_0xffa0c['name'],_0x169a68);loggerPredictive[_0xe9ad('0x96')](_0x18b0dc[_0xe9ad('0x97')]);freeVariablesPredictive(_0xffa0c);};}function loggerCatch(_0x3b43fa){return function(_0x1966b9){logger[_0xe9ad('0x96')](_0x3b43fa,util[_0xe9ad('0x95')](_0x1966b9,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4c6555){return _0x4c6555&&!_[_0xe9ad('0x3c')](_0x4c6555)&&_0x4c6555['length']>0x0;}function decremetOriginate(_0x9e7bff){if(!_[_0xe9ad('0x3c')](_0x9e7bff)&&_0x9e7bff!==null){if(typeof _0x9e7bff[_0xe9ad('0x6d')]!==_0xe9ad('0x98')){if(_0x9e7bff['originated']>0x0){_0x9e7bff[_0xe9ad('0x6d')]-=0x1;}else{logger[_0xe9ad('0x96')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xe9ad('0x96')](_0xe9ad('0x99'));}}function checkContactLowerLimitOriginate(_0x40d9ba,_0x13ddf8,_0x37dcd5){if(_0x13ddf8>_0x37dcd5){for(var _0x40f7a4=0x0;_0x40f7a4<_0x13ddf8-_0x37dcd5;_0x40f7a4+=0x1){decremetOriginate(_0x40d9ba);}}}function loggerGetContactDialer(_0x4112ee,_0x13beb3,_0x3328c2){return function(_0x37a499){checkContactLowerLimitOriginate(_0x13beb3,_0x3328c2,0x0);logger[_0xe9ad('0x96')](_0x4112ee,util[_0xe9ad('0x95')](_0x37a499,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1642cd){return function(_0x5742fc){if(isNotNull(_0x5742fc)&&isNotNull(_0x5742fc[0x0])){if(_0x5742fc[0x0]['contactsRescheduled']>0x0){_0x1642cd[_0xe9ad('0x3d')]=_0xe9ad('0x9a');logger[_0xe9ad('0x79')](_0xe9ad('0x9b')+_0x1642cd[_0xe9ad('0x40')],_0x5742fc[0x0][_0xe9ad('0x9c')],_0xe9ad('0x9d'));}else{_0x1642cd[_0xe9ad('0x3d')]=_0xe9ad('0x9e');logger[_0xe9ad('0x79')](_0xe9ad('0x9f')+_0x1642cd['name']);}}};}function notSendMessagesQueue(_0x39f544){if(_0x39f544[_0xe9ad('0xa0')]){freeVariablesPredictive(_0x39f544);if(_0x39f544[_0xe9ad('0x6d')]===0x0&&_0x39f544[_0xe9ad('0x54')]===0x0&&_0x39f544[_0xe9ad('0xa1')]===0x0&&(_0x39f544['pTalking']||0x0)===0x0){_0x39f544[_0xe9ad('0xa0')]=![];_0x39f544[_0xe9ad('0xa2')]=0x0;_0x39f544[_0xe9ad('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xe9ad('0x94')](_0xe9ad('0xa3'),_0x39f544['name'],_0xe9ad('0xa4'));}else{_0x39f544[_0xe9ad('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary['debug'](_0xe9ad('0xa3'),_0x39f544[_0xe9ad('0x40')],_0xe9ad('0xa5'));}emitVoiceQueueSummary(_0x39f544);}}function notSendMessagesCampaign(_0x444051){if(_0x444051[_0xe9ad('0xa0')]){if(_0x444051[_0xe9ad('0x6d')]===0x0){_0x444051[_0xe9ad('0xa0')]=![];_0x444051['message']=_0xe9ad('0x3f');loggerSyncQueueSummary[_0xe9ad('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x444051[_0xe9ad('0x40')],_0xe9ad('0xa4'));}else{_0x444051['message']=_0xe9ad('0xa6');loggerSyncQueueSummary[_0xe9ad('0x94')](_0xe9ad('0xa7'),_0x444051[_0xe9ad('0x40')],_0xe9ad('0xa5'));}emitCampaignSummary(_0x444051);}}function createObjHistory(_0x1d242f,_0x2c1ad6,_0x47676b,_0x443907,_0x22a80f){_0x1d242f[_0xe9ad('0x3d')]=_0x47676b;var _0x5cda66=new Action(_0x1d242f,_0x2c1ad6);var _0x34422a=new History(_0x5cda66);_0x34422a['state']=_0x443907;_0x34422a[_0xe9ad('0xa8')]=_0x22a80f;_0x34422a[_0xe9ad('0xa9')]=_0x5cda66[_0xe9ad('0xaa')];return _0x34422a;}Dialer[_0xe9ad('0x17')][_0xe9ad('0x38')]=function(){var _0x572aec=this;setInterval(function(){_0x572aec['clearZombieChannels'](_0x572aec[_0xe9ad('0x21')],'[uniqueid]');_0x572aec[_0xe9ad('0xab')](_0x572aec[_0xe9ad('0xac')],_0xe9ad('0xad'));},0x32c8);};Dialer['prototype'][_0xe9ad('0xab')]=function(_0x4bd4d1,_0x2e3c6b){var _0x54afd0=this;for(var _0x594e39 in _0x4bd4d1){if(typeof _0x4bd4d1[_0x594e39]!=='undefined'){this[_0xe9ad('0x19')][_0xe9ad('0xae')](function(){if(!_['isNil'](_0x4bd4d1[_0x594e39])){return ami[_0xe9ad('0xaf')]({'action':_0xe9ad('0xb0'),'channel':_0x4bd4d1[_0x594e39]['channel']})[_0xe9ad('0xb1')](function(_0x2fce79){if(_0x2fce79[_0xe9ad('0x3d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4bd4d1[_0x594e39]&&_0x4bd4d1[_0x594e39][_0xe9ad('0x4c')]!==_0xe9ad('0x75')){_0x54afd0[_0xe9ad('0xb2')](_0x54afd0[_0xe9ad('0x1b')][_0x4bd4d1[_0x594e39][_0xe9ad('0xb3')]]);logger[_0xe9ad('0x96')](_0xe9ad('0xb4'),_0x2e3c6b,_0x594e39,_0x4bd4d1[_0x594e39]['queue']);delete _0x4bd4d1[_0x594e39];}if(_0x4bd4d1[_0x594e39]&&_0x4bd4d1[_0x594e39][_0xe9ad('0x4c')]===_0xe9ad('0x75')){_0x54afd0[_0xe9ad('0xb2')](_0x54afd0[_0xe9ad('0x1c')][_0x4bd4d1[_0x594e39][_0xe9ad('0xb3')]]);logger[_0xe9ad('0x96')](_0xe9ad('0xb5'),_0x2e3c6b,_0x594e39,_0x4bd4d1[_0x594e39]['queue']);delete _0x4bd4d1[_0x594e39];}},0x2328);}});}});}}};Dialer[_0xe9ad('0x17')][_0xe9ad('0xb6')]=function(_0x372381){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopper[_0xe9ad('0xb6')](_0x372381))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xb8')));};Dialer['prototype'][_0xe9ad('0xb9')]=function(_0x526e86){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopperBlack[_0xe9ad('0xb9')](_0x526e86))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xba')));};Dialer['prototype'][_0xe9ad('0xbb')]=function(_0x59d78c,_0x1d821f,_0x1f6e99){return Promise['resolve']()[_0xe9ad('0x3a')](cmHopperAdditionalPhone[_0xe9ad('0xbb')](_0x59d78c,_0x1d821f,_0x1f6e99))[_0xe9ad('0xb1')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0xe9ad('0x17')]['swapAdditionalPhones']=function(_0x15ef2d,_0x5a1598,_0x4aa10e){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopperAdditionalPhone[_0xe9ad('0xbc')](_0x15ef2d,_0x5a1598,_0x4aa10e))[_0xe9ad('0xb1')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xe9ad('0x17')][_0xe9ad('0xbd')]=function(_0x557315){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopperBlack[_0xe9ad('0xbd')](_0x557315))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xe9ad('0x17')][_0xe9ad('0xbe')]=function(_0x5758e6){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopperHistory[_0xe9ad('0xbf')](_0x5758e6))['catch'](loggerCatch(_0xe9ad('0xc0')));};Dialer[_0xe9ad('0x17')][_0xe9ad('0xc1')]=function(_0x1afc0e){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopper[_0xe9ad('0xc1')](_0x1afc0e))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xc2')));};Dialer[_0xe9ad('0x17')][_0xe9ad('0xc3')]=function(_0x23a966,_0x588111,_0x28dcf0){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopper[_0xe9ad('0xc3')](_0x23a966,_0x588111,_0x28dcf0))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xc4')));};Dialer[_0xe9ad('0x17')]['getContactDialer']=function(_0x234094,_0x114678,_0x40fbd4,_0x1d9b96,_0x227835){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopper[_0xe9ad('0xc5')](_0x234094,_0x114678,_0x40fbd4,_0x1d9b96))['catch'](function(_0x2aeee7){_0x227835[_0xe9ad('0xc6')]-=_0x40fbd4;_0x227835[_0xe9ad('0xc6')]=_0x227835['temp']>0x0?_0x227835[_0xe9ad('0xc6')]:0x0;loggerCatch(_0xe9ad('0xc7'))(_0x2aeee7);});};Dialer[_0xe9ad('0x17')]['getContactDialerIvr']=function(_0x36dffb,_0x5a40ba,_0x177387,_0x464030){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopper['getContactDialerIvr'](_0x36dffb,_0x5a40ba,_0x177387))['catch'](function(_0x4a6b12){_0x464030['temp']-=_0x5a40ba;_0x464030[_0xe9ad('0xc6')]=_0x464030[_0xe9ad('0xc6')]>0x0?_0x464030[_0xe9ad('0xc6')]:0x0;loggerCatch(_0xe9ad('0xc8'))(_0x4a6b12);});};Dialer[_0xe9ad('0x17')][_0xe9ad('0xc9')]=function(_0x4620d3){return Promise['resolve']()[_0xe9ad('0x3a')](voiceQueueRt['getVoiceQueueRtPauses'](_0x4620d3))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xca')));};Dialer[_0xe9ad('0x17')]['moveContactManagedDialer']=function(_0x4ff3f7){return Promise['resolve']()[_0xe9ad('0x3a')](cmHopper[_0xe9ad('0xcb')](_0x4ff3f7))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xcc')));};Dialer[_0xe9ad('0x17')][_0xe9ad('0xcd')]=function(_0x3b8fcc){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopperHistory['createHistory'](_0x3b8fcc))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xce')));};Dialer['prototype'][_0xe9ad('0xb2')]=function(_0xcc7cb3){if(!_[_0xe9ad('0x3c')](_0xcc7cb3)&&_0xcc7cb3!==null){if(typeof _0xcc7cb3[_0xe9ad('0x6d')]!==_0xe9ad('0x98')){if(_0xcc7cb3[_0xe9ad('0x6d')]>0x0){_0xcc7cb3[_0xe9ad('0x6d')]-=0x1;}else{logger[_0xe9ad('0x96')](_0xe9ad('0xcf'));}}}else{logger[_0xe9ad('0x96')](_0xe9ad('0xd0'));}};Dialer[_0xe9ad('0x17')][_0xe9ad('0xd1')]=function(_0x4cf88b,_0x47b8d4){var _0x18aa0b=this;return function(_0x2bbbbb){_0x18aa0b['updateOriginated'](_0x47b8d4);logger[_0xe9ad('0x96')](_0x4cf88b,util[_0xe9ad('0x95')](_0x2bbbbb,{'showHidden':![],'depth':null}));};};Dialer[_0xe9ad('0x17')][_0xe9ad('0xd2')]=function(_0x48cd35,_0x374434,_0x424080){var _0xf854e={'state':0x19,'statedesc':'notFound'};this[_0xe9ad('0xb2')](_0x374434);this[_0xe9ad('0xd3')](_[_0xe9ad('0x8d')](_0xf854e,_['pick'](_0x424080,['ContactId','ListId',_0xe9ad('0xd4'),'VoiceQueueId','CampaignId'])),_0xe9ad('0xd5'),'[emptyContact]');logger[_0xe9ad('0x96')](_0x48cd35);};Dialer[_0xe9ad('0x17')][_0xe9ad('0xd6')]=function(_0x124e2e){return _0x124e2e===_0xe9ad('0xd7');};Dialer[_0xe9ad('0x17')][_0xe9ad('0xd8')]=function(_0x22bb43){return!_['isUndefined'](_0x22bb43)&&_0x22bb43&&!_[_0xe9ad('0x3c')](_0x22bb43[_0xe9ad('0x40')])&&!_[_0xe9ad('0x3c')](_0x22bb43[_0xe9ad('0xd9')])&&_0x22bb43[_0xe9ad('0xd9')]&&(this[_0xe9ad('0x1e')][util['format'](_0xe9ad('0xda'),_0x22bb43[_0xe9ad('0x40')])][_0xe9ad('0xb0')]===_0xe9ad('0xdb')||this[_0xe9ad('0x1e')][util['format'](_0xe9ad('0xda'),_0x22bb43[_0xe9ad('0x40')])][_0xe9ad('0xb0')]===_0xe9ad('0xdc'));};Dialer[_0xe9ad('0x17')][_0xe9ad('0xd3')]=function(_0x5dab09,_0x3f5abc,_0x33f6d2){this['createHistory'](_0x5dab09)[_0xe9ad('0xb1')](loggerCatch(_0x3f5abc));this[_0xe9ad('0xcb')](_0x5dab09)[_0xe9ad('0xb1')](loggerCatch(_0x33f6d2));};Dialer['prototype'][_0xe9ad('0x33')]=function(_0x5e6828){var _0xdbd836=this;var _0x2dd364=this[_0xe9ad('0x21')][_0x5e6828[_0xe9ad('0xdd')]];var _0x15e24e;if(!_[_0xe9ad('0xde')](_0x5e6828)&&!_[_0xe9ad('0xde')](_0x5e6828[_0xe9ad('0xdf')])&&!_[_0xe9ad('0xde')](_0x5e6828[_0xe9ad('0xdf')][_0xe9ad('0xe0')])&&_0x5e6828[_0xe9ad('0xe1')]===_0xe9ad('0xe2')&&_0x2dd364){if(_0x2dd364[_0xe9ad('0x4c')]!==_0xe9ad('0x75')&&this[_0xe9ad('0x1b')][_0x2dd364[_0xe9ad('0xb3')]][_0xe9ad('0xe3')]&&_0x5e6828[_0xe9ad('0xe4')]===_0xe9ad('0xe5')){delete this[_0xe9ad('0x21')][_0x5e6828[_0xe9ad('0xdd')]];this[_0xe9ad('0xb2')](this['voiceQueues'][_0x2dd364[_0xe9ad('0xb3')]]);this['voiceQueues'][_0x2dd364['queue']][_0xe9ad('0x5b')]+=0x1;this[_0xe9ad('0x1b')][_0x2dd364['queue']][_0xe9ad('0x5a')]+=0x1;_0x15e24e=new Hangup(_0x2dd364,_0x5e6828);_0x15e24e[_0xe9ad('0xe6')]=0x12;_0x15e24e[_0xe9ad('0xa8')]=_0xe9ad('0xe7');_0x15e24e[_0xe9ad('0xe8')]=_0xe9ad('0xe9');ami[_0xe9ad('0xea')]('custom:amd',ut[_0xe9ad('0xeb')](_0x15e24e,_0xe9ad('0xec')));this[_0xe9ad('0xd3')](_0x15e24e,_0xe9ad('0xed'),'[syncHangupInAMD]');}if(_0x2dd364[_0xe9ad('0x4c')]!==_0xe9ad('0x75')&&this[_0xe9ad('0x1b')][_0x2dd364[_0xe9ad('0xb3')]][_0xe9ad('0xe3')]&&_0x5e6828[_0xe9ad('0xe4')]==='MACHINE'){return new Promise(function(_0x396378,_0x2cc209){delete _0xdbd836[_0xe9ad('0x21')][_0x5e6828[_0xe9ad('0xdd')]];_0xdbd836['updateOriginated'](_0xdbd836[_0xe9ad('0x1b')][_0x2dd364[_0xe9ad('0xb3')]]);_0xdbd836[_0xe9ad('0x1b')][_0x2dd364['queue']][_0xe9ad('0x5b')]+=0x1;_0xdbd836[_0xe9ad('0x1b')][_0x2dd364['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x39e048=_0xdbd836[_0xe9ad('0x1b')][_0x2dd364[_0xe9ad('0xb3')]];var _0x3fa6cf=new Hangup(_0x2dd364,_0x5e6828);_0x3fa6cf[_0xe9ad('0xe6')]=0x13;_0x3fa6cf[_0xe9ad('0xa8')]='Machine';_0x3fa6cf[_0xe9ad('0xe8')]='AMD';_0x3fa6cf[_0xe9ad('0xee')]+=0x1;_0x3fa6cf[_0xe9ad('0xef')]+=0x1;_0x3fa6cf[_0xe9ad('0xec')]=!![];ami[_0xe9ad('0xea')]('custom:amd',ut[_0xe9ad('0xeb')](_0x3fa6cf,_0xe9ad('0xec')));_0xdbd836[_0xe9ad('0xcd')](_0x3fa6cf)['catch'](loggerCatch(_0xe9ad('0xf0')));if(_0x3fa6cf[_0xe9ad('0xf1')]+_0x3fa6cf[_0xe9ad('0xf2')]+_0x3fa6cf[_0xe9ad('0xf3')]+_0x3fa6cf[_0xe9ad('0xf4')]+_0x3fa6cf['countdropretry']+_0x3fa6cf[_0xe9ad('0xf5')]+_0x3fa6cf[_0xe9ad('0xee')]+_0x3fa6cf[_0xe9ad('0xf6')]>=_0x39e048[_0xe9ad('0xf7')]){_0xdbd836[_0xe9ad('0xf8')](_0x3fa6cf,_0x396378,_0x2cc209,'reason19\x20machine....');}else{if(_0x3fa6cf[_0xe9ad('0xee')]>=_0x39e048[_0xe9ad('0xf9')]){_0xdbd836['createStateFinal'](_0x3fa6cf,_0x396378,_0x2cc209,_0xe9ad('0xfa'));}else{_0xdbd836[_0xe9ad('0xc1')]({'active':![],'countmachineretry':_0x3fa6cf[_0xe9ad('0xee')],'scheduledat':moment()[_0xe9ad('0xfb')](_0x39e048[_0xe9ad('0xfc')],'minutes')[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x3fa6cf[_0xe9ad('0xfe')],'ListId':_0x3fa6cf['ListId'],'VoiceQueueId':_0x3fa6cf[_0xe9ad('0xff')]||undefined,'CampaignId':_0x3fa6cf['CampaignId']||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x100')));_0x396378({'reschedule':0x1});}}});}if(_0x2dd364[_0xe9ad('0x4c')]===_0xe9ad('0x75')&&this[_0xe9ad('0x1c')][_0x2dd364[_0xe9ad('0xb3')]][_0xe9ad('0xe3')]&&_0x5e6828['value']===_0xe9ad('0xe5')){delete this[_0xe9ad('0x21')][_0x5e6828['uniqueid']];this[_0xe9ad('0xb2')](this[_0xe9ad('0x1c')][_0x2dd364[_0xe9ad('0xb3')]]);_0x15e24e=new Hangup(_0x2dd364,_0x5e6828);_0x15e24e[_0xe9ad('0xe6')]=0x12;_0x15e24e[_0xe9ad('0xa8')]=_0xe9ad('0xe7');_0x15e24e[_0xe9ad('0xe8')]=_0xe9ad('0xe9');ami['emit']('custom:amd',ut[_0xe9ad('0xeb')](_0x15e24e,_0xe9ad('0xec')));this[_0xe9ad('0xd3')](_0x15e24e,_0xe9ad('0x101'),_0xe9ad('0x102'));}if(_0x2dd364['type']==='ivr'&&this['campaigns'][_0x2dd364[_0xe9ad('0xb3')]]['dialAMDActive']&&_0x5e6828['value']===_0xe9ad('0x103')){return new Promise(function(_0x4bb9c8,_0x45e4bf){delete _0xdbd836['uniqueId'][_0x5e6828[_0xe9ad('0xdd')]];_0xdbd836['updateOriginated'](_0xdbd836['campaigns'][_0x2dd364['queue']]);_0xdbd836['campaigns'][_0x2dd364[_0xe9ad('0xb3')]][_0xe9ad('0x5b')]+=0x1;_0xdbd836[_0xe9ad('0x1c')][_0x2dd364[_0xe9ad('0xb3')]][_0xe9ad('0x5a')]+=0x1;var _0x23efdd=_0xdbd836[_0xe9ad('0x1c')][_0x2dd364[_0xe9ad('0xb3')]];var _0x2e1ae6=new Hangup(_0x2dd364,_0x5e6828);_0x2e1ae6[_0xe9ad('0xe6')]=0x13;_0x2e1ae6[_0xe9ad('0xa8')]=_0xe9ad('0x104');_0x2e1ae6['membername']=_0xe9ad('0xe9');_0x2e1ae6[_0xe9ad('0xee')]+=0x1;_0x2e1ae6[_0xe9ad('0xef')]+=0x1;_0x2e1ae6[_0xe9ad('0xec')]=!![];ami[_0xe9ad('0xea')](_0xe9ad('0x105'),ut[_0xe9ad('0xeb')](_0x2e1ae6,_0xe9ad('0xec')));_0xdbd836[_0xe9ad('0xcd')](_0x2e1ae6)[_0xe9ad('0xb1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2e1ae6[_0xe9ad('0xf1')]+_0x2e1ae6[_0xe9ad('0xf2')]+_0x2e1ae6[_0xe9ad('0xf3')]+_0x2e1ae6[_0xe9ad('0xf4')]+_0x2e1ae6[_0xe9ad('0x106')]+_0x2e1ae6[_0xe9ad('0xf5')]+_0x2e1ae6[_0xe9ad('0xee')]+_0x2e1ae6[_0xe9ad('0xf6')]>=_0x23efdd[_0xe9ad('0xf7')]){_0xdbd836[_0xe9ad('0xf8')](_0x2e1ae6,_0x4bb9c8,_0x45e4bf,_0xe9ad('0x107'));}else{if(_0x2e1ae6[_0xe9ad('0xee')]>=_0x23efdd[_0xe9ad('0xf9')]){_0xdbd836[_0xe9ad('0x108')](_0x2e1ae6,_0x4bb9c8,_0x45e4bf,_0xe9ad('0xfa'));}else{_0xdbd836[_0xe9ad('0xc1')]({'active':![],'countmachineretry':_0x2e1ae6['countmachineretry'],'scheduledat':moment()[_0xe9ad('0xfb')](_0x23efdd['dialMachineRetryFrequency'],_0xe9ad('0x109'))['format'](_0xe9ad('0xfd')),'ContactId':_0x2e1ae6[_0xe9ad('0xfe')],'ListId':_0x2e1ae6[_0xe9ad('0x10a')],'VoiceQueueId':_0x2e1ae6[_0xe9ad('0xff')]||undefined,'CampaignId':_0x2e1ae6[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x100')));_0x4bb9c8({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xe9ad('0x10c')]=function(_0x21af92){var _0x32bbe0=this[_0xe9ad('0x21')][_0x21af92['uniqueid']];var _0x14d714;if(_0x32bbe0&&_0x32bbe0['type']===_0xe9ad('0x75')){delete this[_0xe9ad('0x21')][_0x21af92[_0xe9ad('0xdd')]];this[_0xe9ad('0xb2')](this[_0xe9ad('0x1c')][_0x32bbe0[_0xe9ad('0xb3')]]);this[_0xe9ad('0x1c')][_0x32bbe0[_0xe9ad('0xb3')]][_0xe9ad('0x10d')]+=0x1;_0x14d714=new Hangup(_0x32bbe0,_0x21af92);this['createHistory'](_0x14d714)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x10e')));this[_0xe9ad('0xcb')](_0x14d714)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x32bbe0&&_0x32bbe0['type']!=='ivr'&&isNotNull(this[_0xe9ad('0x1b')][_0x32bbe0['queue']]['dialQueueProject'])){delete this[_0xe9ad('0x21')][_0x21af92['uniqueid']];this[_0xe9ad('0xb2')](this[_0xe9ad('0x1b')][_0x32bbe0[_0xe9ad('0xb3')]]);this[_0xe9ad('0x1b')][_0x32bbe0['queue']][_0xe9ad('0x5b')]+=0x1;this['voiceQueues'][_0x32bbe0['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x14d714=new Hangup(_0x32bbe0,_0x21af92);_0x14d714[_0xe9ad('0xe6')]=0x10;_0x14d714[_0xe9ad('0xa8')]=_0xe9ad('0x10f');_0x14d714[_0xe9ad('0xe8')]=_0xe9ad('0x110');this['createHistory'](_0x14d714)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x10e')));this[_0xe9ad('0xcb')](_0x14d714)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x111')));}if(_0x32bbe0&&_0x32bbe0[_0xe9ad('0x4c')]!==_0xe9ad('0x75')&&!isNotNull(this[_0xe9ad('0x1b')][_0x32bbe0['queue']][_0xe9ad('0x112')])){delete this[_0xe9ad('0x21')][_0x21af92[_0xe9ad('0xdd')]];this[_0xe9ad('0xb2')](this[_0xe9ad('0x1b')][_0x32bbe0[_0xe9ad('0xb3')]]);this[_0xe9ad('0x1b')][_0x32bbe0['queue']][_0xe9ad('0x65')]+=0x1;_0x14d714=new Hangup(_0x32bbe0,_0x21af92);_0x14d714[_0xe9ad('0xe6')]=0xc;_0x14d714[_0xe9ad('0xa8')]=_0x21af92['cause-txt'];_0x14d714[_0xe9ad('0xe8')]=_0xe9ad('0x113');this['createHistory'](_0x14d714)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x10e')));this['moveContactManagedDialer'](_0x14d714)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x111')));}};Dialer[_0xe9ad('0x17')][_0xe9ad('0x114')]=function(_0x446034){var _0x4048d8=this[_0xe9ad('0x21')][_0x446034[_0xe9ad('0xdd')]];if(this[_0xe9ad('0x1b')][_0x446034[_0xe9ad('0xb3')]]){if(_0x4048d8&&_0x4048d8[_0xe9ad('0x4c')]!==_0xe9ad('0x75')){delete this[_0xe9ad('0x21')][_0x446034['uniqueid']];this['voiceQueues'][_0x446034['queue']][_0xe9ad('0x5b')]+=0x1;var _0x46ca69=new AgentComplete(_0x4048d8,_0x446034);if(_0x446034[_0xe9ad('0x115')]==='agent'){_0x46ca69[_0xe9ad('0x116')]=this[_0xe9ad('0x1b')][_0x446034[_0xe9ad('0xb3')]]['dialQueueProject2']&&this[_0xe9ad('0x1b')][_0x446034[_0xe9ad('0xb3')]][_0xe9ad('0x117')]?moment()[_0xe9ad('0x73')](_0xe9ad('0xfd')):undefined;}this[_0xe9ad('0xcd')](_0x46ca69)[_0xe9ad('0xb1')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xe9ad('0xcb')](_0x46ca69)['catch'](loggerCatch(_0xe9ad('0x118')));}}};Dialer[_0xe9ad('0x17')][_0xe9ad('0x28')]=function(_0x2f07d7){if(this[_0xe9ad('0x1b')][_0x2f07d7['queue']]){if(this[_0xe9ad('0x21')][_0x2f07d7[_0xe9ad('0xdd')]]&&this[_0xe9ad('0x21')][_0x2f07d7[_0xe9ad('0xdd')]]['type']!==_0xe9ad('0x75')){this[_0xe9ad('0xb2')](this[_0xe9ad('0x1b')][_0x2f07d7[_0xe9ad('0xb3')]]);this[_0xe9ad('0x21')][_0x2f07d7[_0xe9ad('0xdd')]][_0xe9ad('0x119')]=moment()[_0xe9ad('0x73')](_0xe9ad('0xfd'));}}};Dialer[_0xe9ad('0x17')][_0xe9ad('0x11a')]=function(_0x3ece0c,_0x3facad){this[_0xe9ad('0xcd')](_0x3ece0c)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x11b')));if(_0x3facad==0x0){this[_0xe9ad('0xcb')](_0x3ece0c)[_0xe9ad('0xb1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x541480){var _0x2fac4e=this[_0xe9ad('0x21')][_0x541480[_0xe9ad('0xdd')]];var _0x458887=this;var _0x181b5c=![];var _0x1bd48c;var _0x1e1fec;if(this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]]){if(_0x2fac4e&&_0x2fac4e[_0xe9ad('0x4c')]!==_0xe9ad('0x75')){delete this[_0xe9ad('0x21')][_0x541480[_0xe9ad('0xdd')]];this[_0xe9ad('0xb2')](this['voiceQueues'][_0x541480[_0xe9ad('0xb3')]]);_0x2fac4e[_0xe9ad('0x11c')]=moment()[_0xe9ad('0x73')](_0xe9ad('0xfd'));var _0x546c4b=new QueueCallerAbandon(_0x2fac4e,_0x541480);if(getSeconds(_0x2fac4e['droptime'],_0x2fac4e['responsetime'])>=_0x2fac4e['dialQueueTimeout']){this[_0xe9ad('0x1b')][_0x541480['queue']][_0xe9ad('0x68')]+=0x1;this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x5f')]+=0x1;this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x546c4b[_0xe9ad('0xe6')]=0xa;_0x546c4b[_0xe9ad('0xa8')]='Drop';_0x546c4b[_0xe9ad('0x11d')]=_0xe9ad('0x11e');_0x546c4b[_0xe9ad('0x116')]=this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x11f')]?moment()['format'](_0xe9ad('0xfd')):undefined;_0x546c4b[_0xe9ad('0x106')]+=0x1;_0x546c4b[_0xe9ad('0xef')]+=0x1;_0x1bd48c=this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x120')];_0x1e1fec=this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x121')];_0x458887[_0xe9ad('0xbb')](_0x546c4b,_0x546c4b[_0xe9ad('0xe6')],_0x2fac4e[_0xe9ad('0x122')])[_0xe9ad('0x3a')](function(_0x3d33be){_0x181b5c=_0x3d33be[_0xe9ad('0x123')]==0x1;if(_0x546c4b[_0xe9ad('0x106')]>=_0x458887[_0xe9ad('0x1b')][_0x541480['queue']][_0xe9ad('0x124')]){_0x458887[_0xe9ad('0x11a')](_0x546c4b,_0x3d33be[_0xe9ad('0x123')]);}else{_0x458887[_0xe9ad('0xc1')]({'active':![],'countdropretry':_0x546c4b['countdropretry'],'scheduledat':moment()[_0xe9ad('0xfb')](_0x458887[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x120')],_0xe9ad('0x109'))['format'](_0xe9ad('0xfd')),'ContactId':_0x2fac4e[_0xe9ad('0xfe')],'ListId':_0x2fac4e['ListId'],'VoiceQueueId':_0x2fac4e[_0xe9ad('0xff')]||undefined,'CampaignId':_0x2fac4e[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x125')));var _0x22d9ed=new History(_0x546c4b);_0x22d9ed[_0xe9ad('0xe6')]=0xa;_0x22d9ed['statedesc']='Drop';_0x22d9ed[_0xe9ad('0xaa')]=moment()[_0xe9ad('0x73')](_0xe9ad('0xfd'));_0x22d9ed['endtime']=_0x22d9ed[_0xe9ad('0xaa')];_0x22d9ed[_0xe9ad('0x126')]=_0x546c4b['calleridname'];_0x22d9ed[_0xe9ad('0x127')]=_0x546c4b[_0xe9ad('0x127')];_0x458887[_0xe9ad('0xcd')](_0x22d9ed)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x128')));}})[_0xe9ad('0x3a')](function(){if(_0x181b5c)_0x458887[_0xe9ad('0xbc')](_0x546c4b,_0x1bd48c,_0x1e1fec)['then'](function(){return 0x1;});});}else{this[_0xe9ad('0x1b')][_0x541480['queue']][_0xe9ad('0x67')]+=0x1;this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x5e')]+=0x1;_0x546c4b[_0xe9ad('0xe6')]=0xb;_0x546c4b[_0xe9ad('0xa8')]='Abandoned';_0x546c4b[_0xe9ad('0x11d')]=_0xe9ad('0x129');_0x546c4b[_0xe9ad('0xf5')]+=0x1;_0x546c4b[_0xe9ad('0xef')]+=0x1;_0x1bd48c=this[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x12a')];_0x1e1fec=this['voiceQueues'][_0x541480[_0xe9ad('0xb3')]][_0xe9ad('0x121')];_0x458887['verifyAdditionalPhones'](_0x546c4b,_0x546c4b[_0xe9ad('0xe6')],_0x2fac4e['voiceQueue'])['then'](function(_0x585fdf){if(_0x546c4b['countabandonedretry']>=_0x458887[_0xe9ad('0x1b')][_0x541480['queue']][_0xe9ad('0x12b')]){_0x458887[_0xe9ad('0x11a')](_0x546c4b,_0x585fdf['additional']);}else{_0x458887[_0xe9ad('0xc1')]({'active':![],'countabandonedretry':_0x546c4b['countabandonedretry'],'scheduledat':moment()[_0xe9ad('0xfb')](_0x458887[_0xe9ad('0x1b')][_0x541480[_0xe9ad('0xb3')]]['dialAbandonedRetryFrequency'],_0xe9ad('0x109'))[_0xe9ad('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2fac4e[_0xe9ad('0xfe')],'ListId':_0x2fac4e[_0xe9ad('0x10a')],'VoiceQueueId':_0x2fac4e[_0xe9ad('0xff')]||undefined,'CampaignId':_0x2fac4e[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x12c')));var _0x3aaf0f=new History(_0x546c4b);_0x3aaf0f[_0xe9ad('0xe6')]=0xb;_0x3aaf0f[_0xe9ad('0xa8')]=_0xe9ad('0x12d');_0x3aaf0f[_0xe9ad('0xaa')]=moment()[_0xe9ad('0x73')](_0xe9ad('0xfd'));_0x3aaf0f[_0xe9ad('0xa9')]=_0x3aaf0f[_0xe9ad('0xaa')];_0x3aaf0f[_0xe9ad('0x126')]=_0x546c4b[_0xe9ad('0x126')];_0x3aaf0f[_0xe9ad('0x127')]=_0x546c4b['calleridnum'];_0x458887[_0xe9ad('0xcd')](_0x3aaf0f)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xe9ad('0x3a')](function(){if(_0x181b5c)_0x458887[_0xe9ad('0xbc')](_0x546c4b,_0x1bd48c,_0x1e1fec)[_0xe9ad('0x3a')](function(){return 0x1;});});}}}};Dialer['prototype'][_0xe9ad('0x12e')]=function(_0x88e79e){if(this[_0xe9ad('0xac')][_0x88e79e[_0xe9ad('0xdd')]]){this[_0xe9ad('0xac')][_0x88e79e[_0xe9ad('0xdd')]]['channel']=_0x88e79e[_0xe9ad('0x12f')];}if(this[_0xe9ad('0x21')][_0x88e79e[_0xe9ad('0xdd')]]){this[_0xe9ad('0x21')][_0x88e79e['uniqueid']][_0xe9ad('0x12f')]=_0x88e79e[_0xe9ad('0x12f')];}};Dialer[_0xe9ad('0x17')][_0xe9ad('0x34')]=function(_0x5938fd){if(strategy[this[_0xe9ad('0x1b')][this['actions'][_0x5938fd['actionid']][_0xe9ad('0xb3')]][_0xe9ad('0x4e')]]===_0xe9ad('0x16')){if(this[_0xe9ad('0xac')][_0x5938fd[_0xe9ad('0x130')]]&&_[_0xe9ad('0xde')](this[_0xe9ad('0xac')][_0x5938fd['actionid']][_0xe9ad('0x131')])&&_0x5938fd[_0xe9ad('0xb0')]==='1'&&_0x5938fd[_0xe9ad('0x132')]==='0'){if(this[_0xe9ad('0x1d')][_0x5938fd[_0xe9ad('0x133')]]){if(!this['agents'][_0x5938fd[_0xe9ad('0x133')]][_0xe9ad('0x131')]){this[_0xe9ad('0x1d')][_0x5938fd['stateinterface']]['locked']=!![];this[_0xe9ad('0xac')][_0x5938fd['actionid']][_0xe9ad('0x131')]=!![];this[_0xe9ad('0xac')][_0x5938fd[_0xe9ad('0x130')]][_0xe9ad('0x133')]=_0x5938fd[_0xe9ad('0x133')];}}}}else if((strategy[this['voiceQueues'][this[_0xe9ad('0xac')][_0x5938fd['actionid']]['queue']][_0xe9ad('0x4e')]]||_0xe9ad('0x134'))==='rrmemory'){if(this[_0xe9ad('0xac')][_0x5938fd[_0xe9ad('0x130')]]){if(this[_0xe9ad('0x1d')][_0x5938fd[_0xe9ad('0x133')]]){this['actions'][_0x5938fd[_0xe9ad('0x130')]][_0xe9ad('0x133')]=_0x5938fd[_0xe9ad('0x133')];if(_[_0xe9ad('0xde')](this['queueBooked'][this[_0xe9ad('0xac')][_0x5938fd['actionid']][_0xe9ad('0xb3')]])){this[_0xe9ad('0x25')][this[_0xe9ad('0xac')][_0x5938fd['actionid']][_0xe9ad('0xb3')]]=[];}this[_0xe9ad('0x25')][this[_0xe9ad('0xac')][_0x5938fd[_0xe9ad('0x130')]][_0xe9ad('0xb3')]][_0xe9ad('0x135')](_['merge'](_[_0xe9ad('0x136')](this['actions'][_0x5938fd[_0xe9ad('0x130')]],[_0xe9ad('0x137'),_0xe9ad('0x133')]),{'status':_0x5938fd['status'],'paused':_0x5938fd['paused']}));}}}};function unlockQueueStatus(_0x571052,_0x2686a6){setTimeout(function(){if(_[_0xe9ad('0x3c')](_0x571052[_0xe9ad('0x138')])){loggerBooked[_0xe9ad('0x96')](_0xe9ad('0x139'),_0x2686a6);}_0x571052[_0xe9ad('0x138')]=!![];loggerBooked[_0xe9ad('0x79')]('[booked][unlockQueueStatus]',_0x2686a6,JSON['stringify'](_[_0xe9ad('0x136')](_0x571052,['name',_0xe9ad('0x138')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x12fb65){var _0x42ad79=this;var _0x5503c9=_0x42ad79['voiceQueues'][_0x42ad79[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]]['queue']];if(strategy[this['voiceQueues'][this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xb3')]][_0xe9ad('0x4e')]]==='roundrobin'){if(this['actions'][_0x12fb65['actionid']]&&this[_0xe9ad('0xac')][_0x12fb65['actionid']]['stateinterface']){this[_0xe9ad('0x1a')][_0xe9ad('0x13a')](this['actions'][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0x137')],this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]]['stateinterface'])[_0xe9ad('0xb1')](function(_0x1fc328){logger['error'](_0xe9ad('0x13b'),util[_0xe9ad('0x95')](_0x1fc328,{'showHidden':![],'depth':null}));})[_0xe9ad('0x13c')](function(){_0x42ad79[_0xe9ad('0xb2')](_0x42ad79['voiceQueues'][_0x42ad79[_0xe9ad('0xac')][_0x12fb65['actionid']][_0xe9ad('0xb3')]]);_0x42ad79['agents'][_0x42ad79['actions'][_0x12fb65[_0xe9ad('0x130')]]['stateinterface']][_0xe9ad('0x131')]=![];delete _0x42ad79[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]];unlockQueueStatus(_0x5503c9);});}else{this[_0xe9ad('0xb2')](this[_0xe9ad('0x1b')][this[_0xe9ad('0xac')][_0x12fb65['actionid']][_0xe9ad('0xb3')]]);this[_0xe9ad('0xc1')]({'active':![],'ContactId':this['actions'][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xfe')],'ListId':this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0x10a')],'VoiceQueueId':this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xff')]||undefined,'CampaignId':this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x13d')));delete this[_0xe9ad('0xac')][_0x12fb65['actionid']];unlockQueueStatus(_0x5503c9);}}else if((strategy[this['voiceQueues'][this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xb3')]][_0xe9ad('0x4e')]]||_0xe9ad('0x134'))===_0xe9ad('0x134')){var _0x225402;if(this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]]&&!_[_0xe9ad('0x78')](this[_0xe9ad('0x25')][this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xb3')]])){if(this[_0xe9ad('0x26')][_0x42ad79[_0xe9ad('0xac')][_0x12fb65['actionid']]['queue']]){this['queueBookedRR'][_0x42ad79['actions'][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xb3')]]=this[_0xe9ad('0x26')][this[_0xe9ad('0xac')][_0x12fb65['actionid']]['queue']]?this[_0xe9ad('0x26')][this['actions'][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xb3')]]:this[_0xe9ad('0x25')][this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]]['queue']]?this[_0xe9ad('0x25')][this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]]['queue']][_0xe9ad('0x13e')]||0x0:0x0;}this[_0xe9ad('0x25')][this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]]['queue']][_0xe9ad('0x13e')]=this[_0xe9ad('0x26')][this[_0xe9ad('0xac')][_0x12fb65[_0xe9ad('0x130')]][_0xe9ad('0xb3')]];for(var _0x2e5739=0x0;_0x2e5739=0x0;})['catch'](myreject(_0x3569e5)));}}else{_0x1126b7[_0xe9ad('0x135')](ami[_0xe9ad('0xaf')]({'action':'command','command':util[_0xe9ad('0x73')]('iftime\x20%s,%s',_0x16dc23,!_[_0xe9ad('0x3c')](config[_0xe9ad('0x155')][_0x42d11e])?_0x42d11e:'')})['then'](function(_0x83aaec){return _0x83aaec[_0xe9ad('0x15b')][_0xe9ad('0x15c')](_0xe9ad('0x15d'))>=0x0;})[_0xe9ad('0xb1')](myreject(_0x3569e5)));}Promise[_0xe9ad('0x15e')](_0x1126b7)[_0xe9ad('0x3a')](function(_0x2c8a0f){var _0x2479ea=_['some'](_0x2c8a0f);if(_0x2479ea){return _0x15c0b1(_0x2479ea);}else{_0x27a586['message']=_0x393fb1?_0xe9ad('0x15f'):_0xe9ad('0x160');return _0x3569e5(msgResponse('[ifTime][promiseAll]','Failure',_0xe9ad('0x161')+_0x393fb1+'\x20'+_0x4d467a+'\x20Interval\x20is\x20overtime:\x20'+util[_0xe9ad('0x95')](_0x16dc23,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x42d11e));}})[_0xe9ad('0xb1')](function(_0x1e2110){return _0x3569e5(msgResponse('ifTime','Failure',JSON[_0xe9ad('0x48')](_0x1e2110)));});});};Dialer[_0xe9ad('0x17')][_0xe9ad('0x162')]=function(_0x4ae3e){var _0x15b5ba=this;return function(){switch(_0x4ae3e['dialMethod']){case _0xe9ad('0x163'):freeVariablesPredictive(_0x4ae3e);_0x15b5ba['handlePower'](_0x4ae3e,0x1);break;case _0xe9ad('0x164'):freeVariablesPredictive(_0x4ae3e);_0x15b5ba['handlePower'](_0x4ae3e,_0x4ae3e[_0xe9ad('0x165')]);break;case'predictive':_0x15b5ba[_0xe9ad('0x166')](_0x4ae3e);break;case _0xe9ad('0x7'):freeVariablesPredictive(_0x4ae3e);_0x15b5ba['handlePower'](_0x4ae3e,0x1);break;default:freeVariablesPredictive(_0x4ae3e);logger['error'](_0xe9ad('0x167'),_0x4ae3e[_0xe9ad('0x40')],_0xe9ad('0x168'));}};};Dialer[_0xe9ad('0x17')][_0xe9ad('0x169')]=function(_0x30d9ff){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopper['handlePreviewRecallNotifications'](_0x30d9ff['id'],previewRecallmeReminderInterval))['then'](function(_0x3f3c84){for(var _0x10823b=0x0;_0x10823b<_0x3f3c84[_0xe9ad('0x13f')];_0x10823b++){var _0x9133bd=_0x3f3c84[_0x10823b]['Agent'][_0xe9ad('0x40')];if(_0x9133bd)io['to'](util['format'](_0xe9ad('0x16a'),_0x9133bd))[_0xe9ad('0xea')](_0xe9ad('0x16b'),{'hopper':_0x3f3c84[_0x10823b]});}})['catch'](function(){});};Dialer[_0xe9ad('0x17')][_0xe9ad('0x16c')]=function(_0x20b10b){var _0x260f5=this;return function(){_0x260f5[_0xe9ad('0x16d')](_0x20b10b);};};Dialer[_0xe9ad('0x17')][_0xe9ad('0x9')]=function(_0x2e113b){var _0x19b103=this;if(isNotPreview(_0x2e113b[_0xe9ad('0x57')])){if(isVoiceQueueOutbound(_0x2e113b['type'])&&isActive(_0x2e113b['dialActive'])){_0x2e113b[_0xe9ad('0xa0')]=!![];Promise[_0xe9ad('0xb7')]()['then'](checkIsLoggedIn(_0x2e113b,_0x2e113b[_0xe9ad('0x50')]))[_0xe9ad('0x3a')](checkIsActive(_0x2e113b,_0x2e113b[_0xe9ad('0x16e')]))[_0xe9ad('0x3a')](checkInterval(_0x2e113b))[_0xe9ad('0x3a')](_0x19b103[_0xe9ad('0x14a')](_0x2e113b))[_0xe9ad('0x3a')](_0x19b103[_0xe9ad('0x14e')](_0x2e113b[_0xe9ad('0x16f')],_0x2e113b[_0xe9ad('0x170')],_0x2e113b[_0xe9ad('0x40')],_0x2e113b))[_0xe9ad('0x3a')](_0x19b103['checkIfTimeIntervals'](_0x2e113b[_0xe9ad('0x42')],_0x2e113b[_0xe9ad('0x170')],_0x2e113b[_0xe9ad('0x40')],_0x2e113b))['then'](_0x19b103[_0xe9ad('0x162')](_0x2e113b))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x2e113b));}else{notSendMessagesQueue(_0x2e113b);}}else{freeVariablesPredictive(_0x2e113b);}};Dialer[_0xe9ad('0x17')]['syncQueueSummaryComplete']=_[_0xe9ad('0x171')](function(){var _0x2d5a36=_[_0xe9ad('0x172')](this[_0xe9ad('0x1b')],function(_0x4181f2){return _0x4181f2[_0xe9ad('0x173')];});var _0x25f331=_[_0xe9ad('0x172')](this[_0xe9ad('0x1d')],function(_0x5f43e7){return _0x5f43e7[_0xe9ad('0x174')]&&_0x5f43e7[_0xe9ad('0xb0')]==='reachable';});if(_0x2d5a36[_0xe9ad('0x13f')]>0x0&&_0x25f331[_0xe9ad('0x13f')]>0x0){return Promise[_0xe9ad('0xb7')]()[_0xe9ad('0x3a')](cmHopper[_0xe9ad('0x175')](_[_0xe9ad('0x176')](_0x2d5a36,'id'),previewRecallmeReminderInterval,_[_0xe9ad('0x176')](_0x25f331,'id')))[_0xe9ad('0x3a')](function(_0x4876ce){for(var _0x3d63e3=0x0;_0x3d63e3<_0x4876ce['length'];_0x3d63e3++){var _0x5be3ba=_0x4876ce[_0x3d63e3]['Agent'][_0xe9ad('0x40')];if(_0x5be3ba)io['to'](util[_0xe9ad('0x73')](_0xe9ad('0x16a'),_0x5be3ba))[_0xe9ad('0xea')](_0xe9ad('0x16b'),{'hopper':_0x4876ce[_0x3d63e3]});}})[_0xe9ad('0xb1')](function(_0x479bdf){logger[_0xe9ad('0x96')](_0xe9ad('0x169'),_0x479bdf);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xe9ad('0x149')]=function(){var _0x1eea93=this;var _0x61a0d5;for(var _0x3fd708 in this[_0xe9ad('0x1c')]){if(typeof this[_0xe9ad('0x1c')][_0x3fd708]!==_0xe9ad('0x98')){_0x61a0d5=this[_0xe9ad('0x1c')][_0x3fd708];if(isCampaignIvr(_0x61a0d5[_0xe9ad('0x4c')])&&isActive(_0x61a0d5[_0xe9ad('0xd9')])){_0x61a0d5[_0xe9ad('0xa0')]=!![];Promise['resolve']()[_0xe9ad('0x3a')](checkIsActive(_0x61a0d5,_0x61a0d5['active']))[_0xe9ad('0x3a')](checkInterval(_0x61a0d5))[_0xe9ad('0x3a')](_0x1eea93['checkIsTrunkReachable'](_0x61a0d5))['then'](_0x1eea93[_0xe9ad('0x14e')](_0x61a0d5[_0xe9ad('0x16f')],_0x61a0d5[_0xe9ad('0x170')],_0x61a0d5[_0xe9ad('0x40')],_0x61a0d5))['then'](_0x1eea93[_0xe9ad('0x150')](_0x61a0d5['Interval'],_0x61a0d5[_0xe9ad('0x170')],_0x61a0d5[_0xe9ad('0x40')],_0x61a0d5))[_0xe9ad('0x3a')](_0x1eea93[_0xe9ad('0x16c')](_0x61a0d5))[_0xe9ad('0xb1')](loggerCatchQueueSummary(_0xe9ad('0x177'),_0x61a0d5));}else{notSendMessagesCampaign(_0x61a0d5);}}}};function getCallerIdRandom(_0x3c7093,_0x5bed17){var _0x581476;var _0x2575e9;var _0x64d297;if(_0x5bed17<=0x0){_0x5bed17=0x1;}_0x581476=new RegExp(_0xe9ad('0x178')+_0x5bed17+'}$');_0x2575e9=Math['pow'](0xa,_0x5bed17-0x1);_0x64d297=Math[_0xe9ad('0x179')](0xa,_0x5bed17)-0x1;return util[_0xe9ad('0x73')]('%s',_['replace'](_0x3c7093,_0x581476,_[_0xe9ad('0x17a')](_0x2575e9,_0x64d297)));}function extractCalleridName(_0xa9934a){var _0x34b20f=_0xa9934a[_0xe9ad('0x17b')](/"(.*?)"/);return _0x34b20f?_0x34b20f[0x1]:_0xa9934a;}Dialer[_0xe9ad('0x17')]['actionOriginate']=function(_0x4cfd9b,_0x3cf6ee){var _0x5509d3=this;var _0x444b27=uuid['v4']();this['actions'][_0x444b27]=new Action(_0x4cfd9b,_0x3cf6ee,_0x444b27);return new Promise(function(_0x4ec29c,_0x484f06){if(_[_0xe9ad('0x3c')](_0x4cfd9b)&&typeof _0x4cfd9b!==_0xe9ad('0x17c')){return _0x484f06(msgResponse(_0xe9ad('0x17d'),'Failure',_0xe9ad('0x17e')));}if(_[_0xe9ad('0x3c')](_0x3cf6ee['phone'])||_0x3cf6ee['phone']===null){return _0x484f06(msgResponse('originate',_0xe9ad('0x153'),_0xe9ad('0x17f')));}var _0x5ba3e4={'XMD-CALLERID':_0x5509d3[_0xe9ad('0xac')][_0x444b27][_0xe9ad('0x180')](),'XMD-AGI':_0x4cfd9b[_0xe9ad('0x112')]?util['format'](_0xe9ad('0x181'),ipAgi,_0x4cfd9b[_0xe9ad('0x112')]):'NONE','XMD-AGIAFTER':_0x4cfd9b[_0xe9ad('0x11f')]?util[_0xe9ad('0x73')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4cfd9b[_0xe9ad('0x11f')]):_0xe9ad('0x182'),'XMD-QUEUE':_0x4cfd9b[_0xe9ad('0x4c')]===_0xe9ad('0x4d')?util['format'](_0xe9ad('0x183'),_0x4cfd9b[_0xe9ad('0x40')],_0x4cfd9b[_0xe9ad('0x184')]||'',_0x4cfd9b[_0xe9ad('0x117')]?'c':'',_0x4cfd9b['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x3cf6ee[_0xe9ad('0xfe')],'XMD-CDRTYPE':_0xe9ad('0x185'),'CALLERID(all)':_0x5509d3[_0xe9ad('0xac')][_0x444b27][_0xe9ad('0x180')](),'XMD-AMD':_0x4cfd9b[_0xe9ad('0xe3')]?_0xe9ad('0x186'):_0xe9ad('0x182'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4cfd9b[_0xe9ad('0xe3')]){_0x5ba3e4[_0xe9ad('0x187')]=_0x4cfd9b[_0xe9ad('0x188')]||0x9c4;_0x5ba3e4[_0xe9ad('0x189')]=_0x4cfd9b[_0xe9ad('0x18a')]||0x5dc;_0x5ba3e4[_0xe9ad('0x18b')]=_0x4cfd9b['dialAMDAfterGreetingSilence']||0x320;_0x5ba3e4['XMD-AMDTOTALANALYSISTIME']=_0x4cfd9b[_0xe9ad('0x18c')]||0x1388;_0x5ba3e4[_0xe9ad('0x18d')]=_0x4cfd9b['dialAMDMinWordLength']||0x64;_0x5ba3e4[_0xe9ad('0x18e')]=_0x4cfd9b['dialAMDBetweenWordsSilence']||0x32;_0x5ba3e4[_0xe9ad('0x18f')]=_0x4cfd9b[_0xe9ad('0x190')]||0x3;_0x5ba3e4[_0xe9ad('0x191')]=_0x4cfd9b[_0xe9ad('0x192')]||0x100;_0x5ba3e4['XMD-AMDMAXIMUMWORDLENGTH']=_0x4cfd9b[_0xe9ad('0x193')]||0x1388;}if(_0x4cfd9b[_0xe9ad('0x4c')]==='outbound'){_0x5ba3e4[_0xe9ad('0x194')]=_0x3cf6ee[_0xe9ad('0xff')];}else{_0x5ba3e4[_0xe9ad('0x195')]=_0x3cf6ee[_0xe9ad('0x10b')];}for(var _0x4690bd in _0x3cf6ee[_0xe9ad('0x196')]){if(typeof _0x3cf6ee['Contact'][_0x4690bd]!=='undefined'){if(isNotNull(_0x3cf6ee[_0xe9ad('0x196')][_0x4690bd])&&_0x4690bd!=='id'&&_0x4690bd!==_0xe9ad('0x197')&&_0x4690bd!=='createdAt'&&_0x4690bd!==_0xe9ad('0x198')){_0x5ba3e4[util[_0xe9ad('0x73')](_0xe9ad('0x199'),_0xe9ad('0x19a'),_[_0xe9ad('0x19b')](_0x4690bd))]=_0x3cf6ee[_0xe9ad('0x196')][_0x4690bd];}}}var _0x5b7600=_0x5509d3[_0xe9ad('0xd8')](_0x4cfd9b[_0xe9ad('0x71')])?getCallerId(_0x4cfd9b[_0xe9ad('0x71')]['callerid'],_0x4cfd9b['dialOriginateCallerIdName'],_0x4cfd9b[_0xe9ad('0x19c')]>0x0?getCallerIdRandom(_0x4cfd9b[_0xe9ad('0x59')],_0x4cfd9b[_0xe9ad('0x19c')]):_0x4cfd9b['dialOriginateCallerIdNumber']):getCallerId(_[_0xe9ad('0xde')](_0x4cfd9b[_0xe9ad('0x14b')])?_0x4cfd9b[_0xe9ad('0x71')][_0xe9ad('0x72')]:_0x4cfd9b[_0xe9ad('0x14b')]['callerid'],_0x4cfd9b[_0xe9ad('0x58')],_0x4cfd9b[_0xe9ad('0x19c')]>0x0?getCallerIdRandom(_0x4cfd9b[_0xe9ad('0x59')],_0x4cfd9b[_0xe9ad('0x19c')]):_0x4cfd9b['dialOriginateCallerIdNumber']);if(_0x5b7600){_0x5ba3e4['XMD-ORIGINATECALLERIDNAME']=_0x5509d3[_0xe9ad('0xac')][_0x444b27]['originatecalleridname']=extractCalleridName(_0x5b7600);_0x5ba3e4[_0xe9ad('0x19d')]=_0x3cf6ee[_0xe9ad('0x19e')];}_0x4cfd9b[_0xe9ad('0x19f')]=_0x5ba3e4;return ami['Action']({'actionid':_0x444b27,'action':_0xe9ad('0x17d'),'channel':_0x5509d3[_0xe9ad('0xd8')](_0x4cfd9b['Trunk'])?util['format'](_0xe9ad('0x1a0'),_0x4cfd9b[_0xe9ad('0x71')][_0xe9ad('0x40')],isNotNull(_0x4cfd9b[_0xe9ad('0x1a1')])?_0x4cfd9b[_0xe9ad('0x1a1')][_0xe9ad('0x1a2')]()||'':'',_0x4cfd9b[_0xe9ad('0x1a3')]>0x0?_0x3cf6ee[_0xe9ad('0x19e')][_0xe9ad('0x1a4')](_0x4cfd9b['dialCutDigit']):_0x3cf6ee['phone']):util[_0xe9ad('0x73')](_0xe9ad('0x1a0'),_[_0xe9ad('0xde')](_0x4cfd9b[_0xe9ad('0x14b')])?_0x4cfd9b[_0xe9ad('0x71')]['name']:_0x4cfd9b[_0xe9ad('0x14b')]['name'],isNotNull(_0x4cfd9b['dialPrefix'])?_0x4cfd9b[_0xe9ad('0x1a1')][_0xe9ad('0x1a2')]()||'':'',_0x4cfd9b[_0xe9ad('0x1a3')]>0x0?_0x3cf6ee[_0xe9ad('0x19e')][_0xe9ad('0x1a4')](_0x4cfd9b[_0xe9ad('0x1a3')]):_0x3cf6ee[_0xe9ad('0x19e')]),'callerid':_0x5b7600,'Exten':_0xe9ad('0xe2'),'Context':_0xe9ad('0x1a5'),'Priority':'1','variable':_0x5ba3e4,'timeout':(_0x4cfd9b[_0xe9ad('0x1a6')]||0x1e)*0x3e8,'async':!![],'channelid':_0x444b27})[_0xe9ad('0x3a')](function(_0x3404cf){return _0x4ec29c(_0x3404cf);})[_0xe9ad('0xb1')](function(_0x10c377){_0x4cfd9b['outboundOriginateFailureCallsDay']+=0x1;var _0x44b72f=new History(_0x5509d3[_0xe9ad('0xac')][_0x444b27]);logger['error'](util[_0xe9ad('0x73')](_0xe9ad('0x1a7'),JSON[_0xe9ad('0x48')](_0x10c377)));_0x44b72f[_0xe9ad('0xe6')]=0xe;_0x44b72f['statedesc']=_0xe9ad('0x1a8');_0x44b72f['starttime']=moment()['format'](_0xe9ad('0xfd'));_0x44b72f[_0xe9ad('0xa9')]=_0x44b72f[_0xe9ad('0xaa')];_0x5509d3['createHistory'](_0x44b72f)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1a9')));_0x5509d3[_0xe9ad('0xcb')](_0x44b72f)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1a9')))[_0xe9ad('0x13c')](function(){delete _0x5509d3['actions'][_0x444b27];return _0x484f06(msgResponse(_0xe9ad('0x17d'),'Error',_0xe9ad('0x1aa')));});});});};Dialer[_0xe9ad('0x17')][_0xe9ad('0x1ab')]=function(_0x1290d4){var _0x5c0142=this[_0xe9ad('0xac')][_0x1290d4[_0xe9ad('0x130')]];if(_0x5c0142){delete this[_0xe9ad('0xac')][_0x1290d4[_0xe9ad('0x130')]];_0x5c0142[_0xe9ad('0x1ac')]=moment()[_0xe9ad('0x73')](_0xe9ad('0xfd'));var _0x206d8c=_0x5c0142[_0xe9ad('0x4c')]==='ivr'?this[_0xe9ad('0x1c')][_0x5c0142[_0xe9ad('0xb3')]]:this[_0xe9ad('0x1b')][_0x5c0142['getQueue']()];if(!this['isSuccess'](_0x1290d4[_0xe9ad('0x1ad')])){this['updateOriginated'](_0x206d8c);return this[_0xe9ad('0x1ae')](_0x5c0142,_0x206d8c,_0x1290d4)[_0xe9ad('0xb1')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xe9ad('0x21')][_0x1290d4[_0xe9ad('0xdd')]]=_0x5c0142;}};Dialer[_0xe9ad('0x17')]['checkRetriveMax']=function(_0x14ba2e,_0x502537,_0x4e0f6d){var _0x29f68b=new History(_0x502537);if(_0x29f68b[_0xe9ad('0xf1')]+_0x29f68b[_0xe9ad('0xf2')]+_0x29f68b['countnoanswerretry']+_0x29f68b['countnosuchnumberretry']+_0x29f68b[_0xe9ad('0x106')]+_0x29f68b['countabandonedretry']+_0x29f68b['countmachineretry']+_0x29f68b[_0xe9ad('0xf6')]>=_0x4e0f6d['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x14ba2e){case 0x3:if(_0x29f68b['countnoanswerretry']>=_0x4e0f6d[_0xe9ad('0x1af')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x29f68b[_0xe9ad('0xf3')]+=0x1,'scheduledat':moment()[_0xe9ad('0xfb')](_0x4e0f6d['dialNoAnswerRetryFrequency'],_0xe9ad('0x109'))[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x29f68b[_0xe9ad('0xfe')],'ListId':_0x29f68b[_0xe9ad('0x10a')],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b[_0xe9ad('0x10b')]||undefined})['catch'](loggerCatch(_0xe9ad('0x1b0')));break;case 0x5:if(_0x29f68b[_0xe9ad('0xf1')]>=_0x4e0f6d[_0xe9ad('0x1b1')]-0x1){return!![];}this[_0xe9ad('0xc1')]({'active':![],'countbusyretry':_0x29f68b[_0xe9ad('0xf1')]+=0x1,'scheduledat':moment()[_0xe9ad('0xfb')](_0x4e0f6d[_0xe9ad('0x1b2')],_0xe9ad('0x109'))[_0xe9ad('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x29f68b['ContactId'],'ListId':_0x29f68b['ListId'],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x29f68b['countcongestionretry']>=_0x4e0f6d['dialCongestionMaxRetry']-0x1){return!![];}this[_0xe9ad('0xc1')]({'active':![],'countcongestionretry':_0x29f68b['countcongestionretry']+=0x1,'scheduledat':moment()[_0xe9ad('0xfb')](_0x4e0f6d[_0xe9ad('0x1b3')],_0xe9ad('0x109'))[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x29f68b[_0xe9ad('0xfe')],'ListId':_0x29f68b['ListId'],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1b4')));break;case 0x0:if(_0x29f68b[_0xe9ad('0xf4')]>=_0x4e0f6d[_0xe9ad('0x1b5')]-0x1){return!![];}else{this[_0xe9ad('0xc1')]({'active':![],'countnosuchnumberretry':_0x29f68b[_0xe9ad('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x4e0f6d[_0xe9ad('0x1b6')],'minutes')[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x29f68b[_0xe9ad('0xfe')],'ListId':_0x29f68b[_0xe9ad('0x10a')],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1b7')));}break;case 0xa:if(_0x29f68b[_0xe9ad('0x106')]>=_0x4e0f6d[_0xe9ad('0x124')]-0x1){return!![];}this[_0xe9ad('0xc1')]({'active':![],'countdropretry':_0x29f68b[_0xe9ad('0x106')]+=0x1,'scheduledat':moment()['add'](_0x4e0f6d[_0xe9ad('0x120')],_0xe9ad('0x109'))[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x29f68b['ContactId'],'ListId':_0x29f68b['ListId'],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x125')));break;case 0xb:if(_0x29f68b['countabandonedretry']>=_0x4e0f6d[_0xe9ad('0x12b')]-0x1){return!![];}this[_0xe9ad('0xc1')]({'active':![],'countabandonedretry':_0x29f68b[_0xe9ad('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x4e0f6d[_0xe9ad('0x12a')],_0xe9ad('0x109'))[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x29f68b[_0xe9ad('0xfe')],'ListId':_0x29f68b[_0xe9ad('0x10a')],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x29f68b['countmachineretry']>=_0x4e0f6d[_0xe9ad('0xf9')]-0x1){return!![];}this[_0xe9ad('0xc1')]({'active':![],'countmachineretry':_0x29f68b[_0xe9ad('0xee')]+=0x1,'scheduledat':moment()[_0xe9ad('0xfb')](_0x4e0f6d[_0xe9ad('0xfc')],_0xe9ad('0x109'))[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x29f68b[_0xe9ad('0xfe')],'ListId':_0x29f68b['ListId'],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b['CampaignId']||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x100')));break;case 0x14:if(_0x29f68b['countagentrejectretry']>=_0x4e0f6d['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xe9ad('0xc1')]({'active':![],'countagentrejectretry':_0x29f68b[_0xe9ad('0xf6')]+=0x1,'scheduledat':moment()[_0xe9ad('0xfb')](_0x4e0f6d[_0xe9ad('0x1b8')],_0xe9ad('0x109'))[_0xe9ad('0x73')](_0xe9ad('0xfd')),'ContactId':_0x29f68b[_0xe9ad('0xfe')],'ListId':_0x29f68b[_0xe9ad('0x10a')],'VoiceQueueId':_0x29f68b[_0xe9ad('0xff')]||undefined,'CampaignId':_0x29f68b['CampaignId']||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1b9')));break;default:return!![];}};Dialer[_0xe9ad('0x17')][_0xe9ad('0x1ae')]=function(_0x568f61,_0x4bcb3c,_0x4ae2c6){var _0x5d75b1=this;var _0x56be2e=new History(_0x568f61);var _0x3ac93a=![];var _0x1eda74;var _0x302289;return new Promise(function(_0x4880b6,_0x11ca7e){if(_[_0xe9ad('0x3c')](_0x4bcb3c)&&typeof _0x4bcb3c!==_0xe9ad('0x17c')){return _0x11ca7e(msgResponse(_0xe9ad('0x1ba'),_0xe9ad('0x153'),_0xe9ad('0x1bb')));}if(_[_0xe9ad('0x3c')](_0x4ae2c6)&&typeof _0x4ae2c6!==_0xe9ad('0x17c')){return _0x11ca7e(msgResponse('[callProgressDetecting]','Failure','evt\x20is\x20undefine'));}_0x5d75b1[_0xe9ad('0xbb')](_0x56be2e,_0x4ae2c6[_0xe9ad('0x115')],_0x4bcb3c)[_0xe9ad('0x3a')](function(_0x1b6098){if(_0x1b6098['additional']==0x1)_0x3ac93a=!![];switch(_0x4ae2c6[_0xe9ad('0x115')]){case'0':_0x4bcb3c[_0xe9ad('0x61')]+=0x1;_0x56be2e[_0xe9ad('0xe6')]=0x0;_0x56be2e[_0xe9ad('0xa8')]=_0xe9ad('0x1bc');_0x56be2e[_0xe9ad('0xf4')]+=0x1;_0x56be2e[_0xe9ad('0xef')]+=0x1;ami[_0xe9ad('0xea')]('custom:agentnosuchnumber',ut[_0xe9ad('0xeb')](_0x568f61,_0xe9ad('0x1bd')));_0x1eda74=_0x4bcb3c[_0xe9ad('0x1b6')];_0x302289=_0x4bcb3c['callAdditionalPhoneAfterMin'];_0x5d75b1[_0xe9ad('0xcd')](_0x56be2e)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xf0')));if(_0x5d75b1['checkRetriveMax'](0x0,_0x568f61,_0x4bcb3c)&&!_0x3ac93a){if(_0x56be2e['countnosuchnumberretry']>=_0x4bcb3c[_0xe9ad('0x1b5')]){_0x5d75b1[_0xe9ad('0x108')](_0x56be2e,_0x4880b6,_0x11ca7e,'reason\x200\x20no\x20such\x20number....');}else{_0x5d75b1[_0xe9ad('0xf8')](_0x56be2e,_0x4880b6,_0x11ca7e,_0xe9ad('0x1be'));}}break;case'3':_0x4bcb3c[_0xe9ad('0x60')]+=0x1;_0x56be2e[_0xe9ad('0xe6')]=0x3;_0x56be2e['statedesc']=_0xe9ad('0x1bf');_0x56be2e[_0xe9ad('0xf3')]+=0x1;_0x56be2e[_0xe9ad('0xef')]+=0x1;var _0xaf4f4=ut[_0xe9ad('0x1c0')](_0x568f61,_0x4bcb3c);ami['emit'](_0xe9ad('0x1c1'),_0xaf4f4);_0x1eda74=_0x4bcb3c[_0xe9ad('0x1c2')];_0x302289=_0x4bcb3c[_0xe9ad('0x121')];_0x5d75b1[_0xe9ad('0xcd')](_0x56be2e)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1c3')));if(_0x5d75b1['checkRetriveMax'](0x3,_0x568f61,_0x4bcb3c)&&!_0x3ac93a){if(_0x56be2e[_0xe9ad('0xf3')]>=_0x4bcb3c[_0xe9ad('0x1af')]){_0x5d75b1['createStateFinal'](_0x56be2e,_0x4880b6,_0x11ca7e,_0xe9ad('0x1c4'));}else{_0x5d75b1['stateGlobal'](_0x56be2e,_0x4880b6,_0x11ca7e,_0xe9ad('0x1c4'));}}break;case'5':_0x4bcb3c[_0xe9ad('0x5c')]+=0x1;_0x56be2e[_0xe9ad('0xe6')]=0x5;_0x56be2e['statedesc']=_0xe9ad('0x1c5');_0x56be2e[_0xe9ad('0xf1')]+=0x1;_0x56be2e[_0xe9ad('0xef')]+=0x1;ami[_0xe9ad('0xea')]('custom:agentbusy',ut[_0xe9ad('0xeb')](_0x568f61,_0xe9ad('0x1c6')));_0x1eda74=_0x4bcb3c[_0xe9ad('0x1b2')];_0x302289=_0x4bcb3c[_0xe9ad('0x121')];_0x5d75b1[_0xe9ad('0xcd')](_0x56be2e)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1c7')));if(_0x5d75b1[_0xe9ad('0x1c8')](0x5,_0x568f61,_0x4bcb3c)&&!_0x3ac93a){if(_0x56be2e[_0xe9ad('0xf1')]>=_0x4bcb3c[_0xe9ad('0x1b1')]){_0x5d75b1[_0xe9ad('0x108')](_0x56be2e,_0x4880b6,_0x11ca7e,_0xe9ad('0x1c9'));}else{_0x5d75b1[_0xe9ad('0xf8')](_0x56be2e,_0x4880b6,_0x11ca7e,_0xe9ad('0x1c9'));}}break;case'8':_0x4bcb3c[_0xe9ad('0x1ca')]+=0x1;_0x56be2e['state']=0x8;_0x56be2e[_0xe9ad('0xa8')]=_0xe9ad('0x1cb');_0x56be2e['countcongestionretry']+=0x1;_0x56be2e[_0xe9ad('0xef')]+=0x1;_0x1eda74=_0x4bcb3c['dialCongestionRetryFrequency'];_0x302289=_0x4bcb3c[_0xe9ad('0x121')];ami['emit'](_0xe9ad('0x1cc'),ut['buildObj'](_0x568f61,_0xe9ad('0x1cd')));_0x5d75b1['createHistory'](_0x56be2e)[_0xe9ad('0xb1')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5d75b1[_0xe9ad('0x1c8')](0x8,_0x568f61,_0x4bcb3c)&&!_0x3ac93a){if(_0x56be2e[_0xe9ad('0xf2')]>=_0x4bcb3c[_0xe9ad('0x1ce')]){_0x5d75b1['createStateFinal'](_0x56be2e,_0x4880b6,_0x11ca7e,'reason\x208\x20congestion');}else{_0x5d75b1[_0xe9ad('0xf8')](_0x56be2e,_0x4880b6,_0x11ca7e,'reason\x208\x20congestion');}}break;case'11':_0x4bcb3c['outboundAbandonedCallsDay']+=0x1;_0x56be2e['state']=0xb;_0x56be2e[_0xe9ad('0xa8')]=_0xe9ad('0x12d');_0x56be2e[_0xe9ad('0xf5')]+=0x1;_0x56be2e['countglobal']+=0x1;_0x1eda74=_0x4bcb3c[_0xe9ad('0x12a')];_0x302289=_0x4bcb3c[_0xe9ad('0x121')];_0x5d75b1[_0xe9ad('0xcd')](_0x56be2e)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1cf')));if(_0x5d75b1[_0xe9ad('0x1c8')](0xb,_0x568f61,_0x4bcb3c)&&!_0x3ac93a){if(_0x56be2e[_0xe9ad('0xf5')]>=_0x4bcb3c[_0xe9ad('0x12b')]){_0x5d75b1[_0xe9ad('0x108')](_0x56be2e,_0x4880b6,_0x11ca7e,'reason\x2011\x20abandoned');}else{_0x5d75b1[_0xe9ad('0xf8')](_0x56be2e,_0x4880b6,_0x11ca7e,'reason\x2011\x20abandoned');}}break;case'20':_0x4bcb3c['outboundRejectCallsDay']+=0x1;_0x56be2e['state']=0x14;_0x56be2e[_0xe9ad('0xa8')]='AgentReject';_0x56be2e[_0xe9ad('0xf6')]+=0x1;_0x56be2e[_0xe9ad('0xef')]+=0x1;_0x1eda74=_0x4bcb3c[_0xe9ad('0x1b8')];_0x302289=_0x4bcb3c[_0xe9ad('0x121')];ami['emit'](_0xe9ad('0x1d0'),ut['buildObj'](_0x568f61,_0xe9ad('0x1d1')));_0x5d75b1[_0xe9ad('0xcd')](_0x56be2e)['catch'](loggerCatch(_0xe9ad('0x1d2')));if(_0x5d75b1[_0xe9ad('0x1c8')](0x14,_0x568f61,_0x4bcb3c)&&!_0x3ac93a){if(_0x56be2e[_0xe9ad('0xf6')]>=_0x4bcb3c[_0xe9ad('0x1d3')]){_0x5d75b1[_0xe9ad('0x108')](_0x56be2e,_0x4880b6,_0x11ca7e,_0xe9ad('0x1d4'));}else{_0x5d75b1[_0xe9ad('0xf8')](_0x56be2e,_0x4880b6,_0x11ca7e,_0xe9ad('0x1d4'));}}break;default:_0x4bcb3c[_0xe9ad('0x65')]+=0x1;_0x56be2e['state']=0xc;_0x56be2e['statedesc']=_0x4ae2c6[_0xe9ad('0x115')];_0x1eda74=_0x4bcb3c[_0xe9ad('0x1b8')];_0x302289=_0x4bcb3c['callAdditionalPhoneAfterMin'];_0x5d75b1[_0xe9ad('0xcd')](_0x56be2e)[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x1d5')));if(_0x5d75b1[_0xe9ad('0x1c8')](_0x4ae2c6['reason'],_0x568f61,_0x4bcb3c)&&!_0x3ac93a){if(_0x56be2e[_0xe9ad('0xf1')]+_0x56be2e['countcongestionretry']+_0x56be2e[_0xe9ad('0xf3')]+_0x56be2e[_0xe9ad('0xf4')]+_0x56be2e[_0xe9ad('0x106')]+_0x56be2e['countabandonedretry']+_0x56be2e[_0xe9ad('0xee')]+_0x56be2e[_0xe9ad('0xf6')]>=_0x4bcb3c['dialGlobalMaxRetry']){_0x5d75b1[_0xe9ad('0xf8')](_0x56be2e,_0x4880b6,_0x11ca7e,_0x4ae2c6[_0xe9ad('0x115')]);}else{_0x5d75b1['createStateFinal'](_0x56be2e,_0x4880b6,_0x11ca7e,_0x4ae2c6[_0xe9ad('0x115')]);}}}})['then'](function(){if(_0x3ac93a){_0x5d75b1[_0xe9ad('0xbc')](_0x56be2e,_0x1eda74,_0x302289)['then'](function(){return _0x4880b6(0x1);});}});});};Dialer[_0xe9ad('0x17')][_0xe9ad('0xf8')]=function(_0x32914b,_0x398dd6,_0x3199b1,_0xd4c56){var _0x195a8a=new Final(_0x32914b);_0x195a8a[_0xe9ad('0xe6')]=0xf;_0x195a8a['statedesc']=_0xe9ad('0x1d6');this[_0xe9ad('0x108')](_0x195a8a,_0x398dd6,_0x3199b1,_0xd4c56);};Dialer[_0xe9ad('0x17')][_0xe9ad('0x108')]=function(_0xf91874,_0x53be6c,_0x2342fa,_0x2f86ad){this[_0xe9ad('0xcb')](_0xf91874)['then'](function(){return _0x53be6c(msgResponse('[callProgressDetecting]',_0xe9ad('0xd7'),_0x2f86ad));})['catch'](function(){return _0x2342fa(msgResponse(_0xe9ad('0x1d7'),_0xe9ad('0x153'),_0xe9ad('0x1d8')));});};Dialer[_0xe9ad('0x17')][_0xe9ad('0x166')]=function(_0x418849){var _0x2596c0=_0x418849[_0xe9ad('0x1d9')]/0x64;var _0x831f99=_0x418849['outboundDropCallsDayTimeout']/(_0x418849[_0xe9ad('0x5f')]+_0x418849[_0xe9ad('0x5b')]);var _0x240304=Math['round'](_0x418849[_0xe9ad('0x6b')]*(_0x418849[_0xe9ad('0x1da')]/0x64));var _0x35f67b=Math[_0xe9ad('0x1db')](_0x418849[_0xe9ad('0x6b')]*(_0x418849[_0xe9ad('0x1dc')]/0x64));var _0x4085d8=_0x418849[_0xe9ad('0xa2')]+_0x418849['talking'];var _0x5a6709=Math['floor'](_0x418849[_0xe9ad('0x88')]*_0x418849['erlangAbandonmentRate']*_0x418849[_0xe9ad('0x6a')]*_0x418849[_0xe9ad('0x1dd')]);if(_[_0xe9ad('0x3c')](_0x418849[_0xe9ad('0x70')])){if(!_[_0xe9ad('0x3c')](_0x418849[_0xe9ad('0x23')])){_0x418849['startPredictive']=undefined;loggerPredictive[_0xe9ad('0x96')](_0xe9ad('0x1de'),_0xe9ad('0x1df'));}if(!_[_0xe9ad('0x3c')](_0x418849[_0xe9ad('0x90')])){loggerPredictive[_0xe9ad('0x96')](_0xe9ad('0x1de'),_0xe9ad('0x1e0'));clearInterval(_0x418849[_0xe9ad('0x90')]);_0x418849[_0xe9ad('0x90')]=undefined;}_0x418849[_0xe9ad('0x70')]=moment()[_0xe9ad('0x73')](_0xe9ad('0xfd'));loggerPredictive['info'](_0x418849[_0xe9ad('0x40')],_0xe9ad('0x1e1'),_0x418849[_0xe9ad('0x70')]);this['handlePower'](_0x418849,0x1);}else if(ifInterval(_0x418849['dialPredictiveInterval'],_0x418849['startProgressive'])){this[_0xe9ad('0x1e2')](_0x418849,0x1);loggerPredictiveCalls['info'](_0xe9ad('0x1e3'),_0x418849['startProgressive'],_0x418849[_0xe9ad('0x40')]);_0x418849[_0xe9ad('0x88')]=0x0;_0x418849[_0xe9ad('0x69')]=0x0;}else if(_0x2596c0<_0x831f99&&_0x418849['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x418849);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x1e4'),_0xe9ad('0x1e5'),_0x831f99,_0xe9ad('0x70'),_0x418849[_0xe9ad('0x40')]);}else if(_0x5a6709<_0x418849[_0xe9ad('0x69')]&&_0x418849['dialPredictiveOptimization']===_0xe9ad('0x1e6')){freeVariablesPredictive(_0x418849);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x1e7'),_0xe9ad('0x1e8'),_0x5a6709,_0xe9ad('0x1e9'),_0x418849['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x418849[_0xe9ad('0x40')]);}else if(!ifInterval(_0x418849['dialPredictiveInterval'],_0x418849['startProgressive'])&&_['isUndefined'](_0x418849['startPredictive'])&&!_[_0xe9ad('0x3c')](_0x418849[_0xe9ad('0x70')])){_0x418849[_0xe9ad('0x23')]=moment()[_0xe9ad('0x73')](_0xe9ad('0xfd'));loggerPredictive[_0xe9ad('0x79')](_0x418849[_0xe9ad('0x40')],'started\x20in\x20predictive\x20at',_0x418849['startPredictive']);this[_0xe9ad('0xbe')](_0x418849['dialPredictiveInterval'])['then'](this[_0xe9ad('0x1ea')](_0x418849))[_0xe9ad('0x3a')](mergeDataErlangB(_0x418849))[_0xe9ad('0x3a')](this[_0xe9ad('0x1eb')](_0x418849))[_0xe9ad('0xb1')](loggerCatchPredictive(_0xe9ad('0x1ec'),_0x418849));}else if(!ifInterval(_0x418849[_0xe9ad('0x1ed')],_0x418849[_0xe9ad('0x23')])){_0x418849['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x418849[_0xe9ad('0x23')]=moment()[_0xe9ad('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe9ad('0x79')](_0x418849[_0xe9ad('0x40')],_0xe9ad('0x1ee'),_0x418849['startPredictive']);clearInterval(_0x418849[_0xe9ad('0x90')]);_0x418849[_0xe9ad('0x90')]=undefined;this[_0xe9ad('0xbe')](_0x418849[_0xe9ad('0x1ed')])[_0xe9ad('0x3a')](this[_0xe9ad('0x1ea')](_0x418849))[_0xe9ad('0x3a')](mergeDataErlangB(_0x418849))[_0xe9ad('0x3a')](this['startMethodPredictive'](_0x418849))[_0xe9ad('0xb1')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x418849));}else if(_0x418849[_0xe9ad('0x6b')]&&_0x4085d8<_0x418849[_0xe9ad('0x6b')]-_0x35f67b){freeVariablesPredictive(_0x418849);loggerPredictive[_0xe9ad('0x79')](_0x418849['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4085d8,_0xe9ad('0x1ef'),_0x418849[_0xe9ad('0x6b')],'-',_0x35f67b,'=',_0x418849['predictiveIntervalAvailable']-_0x35f67b,')');}else if(_0x418849[_0xe9ad('0x6b')]&&_0x4085d8>_0x418849[_0xe9ad('0x6b')]+_0x240304){freeVariablesPredictive(_0x418849);loggerPredictive[_0xe9ad('0x79')](_0x418849[_0xe9ad('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4085d8,_0xe9ad('0x1f0'),_0x418849[_0xe9ad('0x6b')],'+',_0x240304,'=',_0x418849['predictiveIntervalAvailable']+_0x240304,')');}};Dialer[_0xe9ad('0x17')]['getDataPredictive']=function(_0xf9b538){var _0x7b3a84=this;return function(_0x273740){return new Promise(function(_0x33f91a,_0x25f172){_[_0xe9ad('0x8d')](_0xf9b538,_0x273740[0x0]);if(checkGetDataPredictive(_0x273740[0x0])){var _0x56ab33=_0xf9b538[_0xe9ad('0x6b')]=_0xf9b538[_0xe9ad('0x54')]+_0xf9b538['available'];var _0x1c8b48=_0xf9b538[_0xe9ad('0x1ed')]*0x3c;var _0x3024cc=_0x273740[0x0]['predictiveIntervalAvgTalktime']+_0x273740[0x0]['predictiveIntervalAvgHoldtime'];var _0x5877c1=(_0x273740[0x0][_0xe9ad('0x7d')]+_0x273740[0x0][_0xe9ad('0x68')]+_0x273740[0x0][_0xe9ad('0x67')])/_0x273740[0x0]['predictiveIntervalTotalCalls'];_0xf9b538[_0xe9ad('0x6a')]=_0x5877c1>0x0?_0x5877c1:0x1;switch(_0xf9b538[_0xe9ad('0x1f1')]){case _0xe9ad('0x1e6'):var _0x1970e5=_0xf9b538['dialPredictiveOptimizationPercentage']/0x64;return _0x7b3a84[_0xe9ad('0x1f2')](_0x56ab33,_0x1c8b48,_0x3024cc,_0x5877c1,_0x1970e5)[_0xe9ad('0x3a')](function(_0x5b32d0){return _0x33f91a(_0x5b32d0);});case'agentBusyFactor':var _0x496f71=_0xf9b538[_0xe9ad('0x1d9')]/0x64;return _0x7b3a84[_0xe9ad('0x1f3')](_0x56ab33,_0x1c8b48,_0x3024cc,_0x5877c1,_0x496f71)[_0xe9ad('0x3a')](function(_0x29e430){return _0x33f91a(_0x29e430);});default:return _0x25f172(msgResponse('[getDataPredictive]',_0xe9ad('0x153'),_0xe9ad('0x1f4')));}}else{return _0x25f172(msgResponse(_0xe9ad('0x1f5'),_0xe9ad('0x153'),_0xe9ad('0x1f6')));}});};};Dialer[_0xe9ad('0x17')][_0xe9ad('0x1f7')]=function(_0x433e7){var _0x522d76=this;return function(_0xc82f75){return new Promise(function(_0x18b4fa,_0x31e9db){_[_0xe9ad('0x8d')](_0x433e7,_0xc82f75[0x0]);if(checkGetDataPredictive(_0xc82f75[0x0])){loggerPredictive['info'](JSON['stringify'](_0xc82f75[0x0]));if(_0x433e7[_0xe9ad('0x1f1')]===_0xe9ad('0x1e6')){return _0x522d76['getVoiceQueueRtPauses'](_0x433e7['id'])[_0xe9ad('0x3a')](function(_0x4b6706){var _0x2bd5a7=_0x433e7[_0xe9ad('0x50')]-_0x4b6706[0x0][_0xe9ad('0x1f8')];var _0x4a31d2=_0x433e7['dialPredictiveInterval']*0x3c;var _0x15ee2e=_0xc82f75[0x0]['predictiveIntervalAvgTalktime']+_0xc82f75[0x0][_0xe9ad('0x80')];var _0x5bf2ac=(_0xc82f75[0x0][_0xe9ad('0x7d')]+_0xc82f75[0x0][_0xe9ad('0x68')]+_0xc82f75[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xc82f75[0x0][_0xe9ad('0x6c')];var _0x168ef3=_0x433e7[_0xe9ad('0x1d9')]/0x64;_0x433e7['predictiveIntervalPauses']=_0x4b6706[0x0]['outboundQueuePauses']||0x0;_0x433e7[_0xe9ad('0x6a')]=_0x5bf2ac>0x0?_0x5bf2ac:0x1;return _0x522d76['abandonmentRate'](_0x2bd5a7,_0x4a31d2,_0x15ee2e,_0x5bf2ac,_0x168ef3);})[_0xe9ad('0x3a')](function(_0x1db947){return _0x18b4fa(_0x1db947);})[_0xe9ad('0xb1')](function(_0xcc55da){return _0x31e9db(msgResponse(_0xe9ad('0x1f9'),_0xe9ad('0x153'),JSON[_0xe9ad('0x48')](_0xcc55da)));});}if(_0x433e7['dialPredictiveOptimization']==='agentBusyFactor'){return _0x522d76[_0xe9ad('0xc9')](_0x433e7['id'])[_0xe9ad('0x3a')](function(_0x45121a){var _0x234b9a=_0x433e7[_0xe9ad('0x50')]-_0x45121a[0x0][_0xe9ad('0x1f8')];var _0x34ece2=_0x433e7[_0xe9ad('0x1ed')]*0x3c;var _0x3febba=_0xc82f75[0x0][_0xe9ad('0x66')]+_0xc82f75[0x0][_0xe9ad('0x80')];var _0x44fe32=(_0xc82f75[0x0][_0xe9ad('0x7d')]+_0xc82f75[0x0][_0xe9ad('0x68')]+_0xc82f75[0x0][_0xe9ad('0x67')])/_0xc82f75[0x0][_0xe9ad('0x6c')];var _0x5d8640=_0x433e7[_0xe9ad('0x1d9')]/0x64;_0x433e7[_0xe9ad('0x1fa')]=_0x45121a[0x0][_0xe9ad('0x1f8')]||0x0;_0x433e7[_0xe9ad('0x6a')]=_0x44fe32>0x0?_0x44fe32:0x1;return _0x522d76['busyFactor'](_0x234b9a,_0x34ece2,_0x3febba,_0x44fe32,_0x5d8640);})[_0xe9ad('0x3a')](function(_0x117a57){return _0x18b4fa(_0x117a57);})[_0xe9ad('0xb1')](function(_0x3c0620){return _0x31e9db(msgResponse(_0xe9ad('0x1f9'),_0xe9ad('0x153'),JSON[_0xe9ad('0x48')](_0x3c0620)));});}}else{return _0x31e9db(msgResponse(_0xe9ad('0x1f5'),_0xe9ad('0x153'),_0xe9ad('0x1f6')));}});};};Dialer[_0xe9ad('0x17')]['startMethodPredictive']=function(_0x3f5dfa){var _0x53e4f2=this;return function(){var _0x405c53=0x0;var _0x466a31=Math[_0xe9ad('0x1fb')](_0x3f5dfa['erlangCallToSecond']*0x3e8);if(_0x466a31>0x0){_0x466a31=_0x466a31<0x64?0x64:_0x466a31;loggerPredictive[_0xe9ad('0x79')](_0x3f5dfa[_0xe9ad('0x40')],'one\x20call\x20every:',_0x466a31,_0xe9ad('0x49'));_0x3f5dfa['handlePredictive']=setInterval(function(){_0x53e4f2['handlePredictive'](_0x3f5dfa);loggerPredictiveCalls[_0xe9ad('0x79')](_0xe9ad('0x1fc'),_0x405c53+=0x1);},_0x466a31);}else{loggerPredictive[_0xe9ad('0x79')](_0x3f5dfa[_0xe9ad('0x40')],_0xe9ad('0x1fd'));}};};Dialer[_0xe9ad('0x17')][_0xe9ad('0x1fe')]=function(_0x575a2d,_0x59a677){var _0x5c68fd=this;return function(_0x451853){if(_[_0xe9ad('0x78')](_0x451853)){if(_['isNil'](_0x59a677[_0xe9ad('0xd4')])||!_0x59a677['recallme']){if(_0x575a2d['dialMethod']==='booked'){_0x575a2d[_0xe9ad('0x138')]=_[_0xe9ad('0x3c')](_0x575a2d[_0xe9ad('0x138')])?!![]:_0x575a2d[_0xe9ad('0x138')];var _0x13ac0d=uuid['v4']();_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d]=new Action(_0x575a2d,_0x59a677,_0x13ac0d);loggerBooked[_0xe9ad('0x79')](_0xe9ad('0x1ff'),_0x13ac0d,'queueStatusComplete:\x20',JSON['stringify'](_0x575a2d['queueStatusComplete']),_0xe9ad('0x200'),_0x575a2d[_0xe9ad('0x40')]);if(_0x575a2d[_0xe9ad('0x138')]){_0x575a2d[_0xe9ad('0x138')]=![];_0x5c68fd[_0xe9ad('0x25')][_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d][_0xe9ad('0xb3')]]=[];ami[_0xe9ad('0xaf')]({'actionid':_0x13ac0d,'action':_0xe9ad('0x201'),'queue':_0x575a2d[_0xe9ad('0x40')]})[_0xe9ad('0xb1')](function(){_0x5c68fd['updateOriginated'](_0x575a2d);_0x5c68fd[_0xe9ad('0xc1')]({'active':![],'ContactId':_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d][_0xe9ad('0xfe')],'ListId':_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d][_0xe9ad('0x10a')],'VoiceQueueId':_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d][_0xe9ad('0xff')]||undefined,'CampaignId':_0x5c68fd['actions'][_0x13ac0d][_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x202')));delete _0x5c68fd[_0xe9ad('0xac')][_0x13ac0d];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xe9ad('0x48')](_0x575a2d[_0xe9ad('0x138')]),_0xe9ad('0x200'),_0x575a2d[_0xe9ad('0x40')]);_0x5c68fd[_0xe9ad('0xb2')](_0x575a2d);_0x5c68fd[_0xe9ad('0xc1')]({'active':![],'ContactId':_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d][_0xe9ad('0xfe')],'ListId':_0x5c68fd['actions'][_0x13ac0d][_0xe9ad('0x10a')],'VoiceQueueId':_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d][_0xe9ad('0xff')]||undefined,'CampaignId':_0x5c68fd[_0xe9ad('0xac')][_0x13ac0d][_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x202')));delete _0x5c68fd[_0xe9ad('0xac')][_0x13ac0d];}}else{return _0x5c68fd[_0xe9ad('0x203')](_0x575a2d,_0x59a677);}}else{if(getDiff(_0x59a677[_0xe9ad('0x204')])<_0x575a2d[_0xe9ad('0x205')]*0x3c){if(_0x59a677[_0xe9ad('0x206')]&&!_0x59a677['Agent']['voicePause']){_0x5c68fd[_0xe9ad('0x1a')][_0xe9ad('0x13a')](_0x59a677['id'])[_0xe9ad('0x13c')](function(){_0x5c68fd[_0xe9ad('0xb2')](_0x575a2d);});}else{_0x5c68fd[_0xe9ad('0xc3')]({'active':![]},_0x59a677['id'],0x1)[_0xe9ad('0x13c')](function(){_0x5c68fd[_0xe9ad('0xb2')](_0x575a2d);});}}else{_0x575a2d['outboundReCallsDay']+=0x1;_0x5c68fd[_0xe9ad('0xb2')](_0x575a2d);if(_0x575a2d[_0xe9ad('0x207')]){_0x5c68fd['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x59a677[_0xe9ad('0xfe')],'ListId':_0x59a677[_0xe9ad('0x10a')],'VoiceQueueId':_0x59a677[_0xe9ad('0xff')]||undefined,'CampaignId':_0x59a677[_0xe9ad('0x10b')]||undefined})[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x208')));_0x5c68fd[_0xe9ad('0xcd')](createObjHistory(_0x575a2d,_0x59a677,_0xe9ad('0x209'),0x17,'RecallInQueue'))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0x20a')));}else{_0x5c68fd[_0xe9ad('0xd3')](createObjHistory(_0x575a2d,_0x59a677,_0xe9ad('0x20b'),0x16,_0xe9ad('0x20c')),'[Originate][HistoryRecallClose][historyCatch]',_0xe9ad('0x20d'));}}}}else{_0x575a2d[_0xe9ad('0x20e')]+=0x1;_0x5c68fd[_0xe9ad('0xd3')](createObjHistory(_0x575a2d,_0x59a677,_0xe9ad('0x20f'),0xd,_0xe9ad('0x210')),_0xe9ad('0x211'),_0xe9ad('0x212'));throw _0xe9ad('0x213');}};};Dialer[_0xe9ad('0x17')][_0xe9ad('0x16d')]=function(_0x2efa69){var _0x30f933=this;var _0x3deffa=_0x2efa69[_0xe9ad('0x214')]-_0x2efa69[_0xe9ad('0x6d')]-_0x2efa69['temp'];emitCampaignSummary(_0x2efa69);if(_0x3deffa>0x0){if(_0x3deffa>this[_0xe9ad('0x1f')]){_0x3deffa=this['maxNumberOriginate'];}_0x2efa69[_0xe9ad('0xc6')]+=_0x3deffa;this['getContactDialerIvr'](_0x2efa69['id'],_0x3deffa,_0x2efa69[_0xe9ad('0x215')],_0x2efa69)[_0xe9ad('0x3a')](function(_0x3f15ba){_0x2efa69[_0xe9ad('0xc6')]-=_0x3deffa;_0x2efa69[_0xe9ad('0xc6')]=_0x2efa69['temp']>0x0?_0x2efa69[_0xe9ad('0xc6')]:0x0;if(!checkContactEmpty(_0x3f15ba)){_0x2efa69['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xe9ad('0x79')](_0xe9ad('0x216')+_0x2efa69[_0xe9ad('0x40')]);}else{_0x2efa69[_0xe9ad('0x6d')]+=_0x3f15ba['length'];_0x2efa69[_0xe9ad('0x3d')]=_0xe9ad('0x217');for(var _0x571eb1=0x0;_0x571eb1<_0x3f15ba[_0xe9ad('0x13f')];_0x571eb1+=0x1){_0x2efa69['ivrTotalCallsDays']+=0x1;if(_[_0xe9ad('0xde')](_0x3f15ba[_0x571eb1])||_[_0xe9ad('0xde')](_0x3f15ba[_0x571eb1][_0xe9ad('0x196')])||_['isNil'](_0x3f15ba[_0x571eb1][_0xe9ad('0x19e')])){_0x30f933[_0xe9ad('0xd2')](_0xe9ad('0x218'),_0x2efa69,_0x3f15ba[_0x571eb1]);}else{_0x30f933[_0xe9ad('0xbd')](_['pick'](_0x3f15ba[_0x571eb1],[_0xe9ad('0x10b'),_0xe9ad('0x19e')]))[_0xe9ad('0x3a')](_0x30f933[_0xe9ad('0x1fe')](_0x2efa69,_0x3f15ba[_0x571eb1]))[_0xe9ad('0xb1')](_0x30f933[_0xe9ad('0xd1')](_0xe9ad('0x219'),_0x2efa69));}}}})['catch'](loggerGetContactDialer(_0xe9ad('0x21a'),_0x2efa69,_0x3deffa));}};Dialer[_0xe9ad('0x17')]['handlePower']=function(_0x1f80c9,_0x153412){var _0x201dbd=this;var _0x582f78=[];var _0xe3eaff=_0x153412>=0x1?_0x153412:0x1;if(_0x1f80c9['dialMethod']===_0xe9ad('0x7')){_0xe3eaff=0x1;}var _0x35f983=Math[_0xe9ad('0x1fb')](_0x1f80c9[_0xe9ad('0xa2')]*_0xe3eaff)-_0x1f80c9[_0xe9ad('0x6d')]-_0x1f80c9[_0xe9ad('0xc6')];emitVoiceQueueSummary(_0x1f80c9);if(_0x1f80c9[_0xe9ad('0x21b')]>0x0){var _0x181149=_0x1f80c9[_0xe9ad('0x21b')]-_0x1f80c9[_0xe9ad('0x6d')]-_0x1f80c9['talking']-_0x1f80c9[_0xe9ad('0xc6')]-_0x1f80c9[_0xe9ad('0x51')];if(_0x35f983>_0x181149){_0x35f983=_0x181149;}}if(_0x35f983>0x0){if(_0x1f80c9[_0xe9ad('0x57')]==='booked'){_0x35f983=0x1;}if(_0x35f983>this[_0xe9ad('0x1f')]){_0x35f983=this['maxNumberOriginate'];}_0x1f80c9['temp']+=_0x35f983;for(var _0x801f33 in this[_0xe9ad('0x1d')]){if(typeof this[_0xe9ad('0x1d')][_0x801f33]!==_0xe9ad('0x98')){if(this['agents'][_0x801f33]['state']===_0xe9ad('0x21c')&&this[_0xe9ad('0x1d')][_0x801f33][_0xe9ad('0xb0')]===_0xe9ad('0xdb')){_0x582f78[_0xe9ad('0x135')](this[_0xe9ad('0x1d')][_0x801f33]['id']);}}}this[_0xe9ad('0xc5')](_0x1f80c9['id'],_0x582f78,_0x35f983,_0x1f80c9['dialOrderByScheduledAt'],_0x1f80c9)[_0xe9ad('0x3a')](function(_0x4b130e){_0x1f80c9[_0xe9ad('0xc6')]-=_0x35f983;_0x1f80c9[_0xe9ad('0xc6')]=_0x1f80c9[_0xe9ad('0xc6')]>0x0?_0x1f80c9[_0xe9ad('0xc6')]:0x0;if(!checkContactEmpty(_0x4b130e)){_0x201dbd['countReScheduled'](_0x1f80c9)[_0xe9ad('0x3a')](sendMessageReschedule(_0x1f80c9))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xb8')));}else{_0x1f80c9[_0xe9ad('0x6d')]+=_0x4b130e[_0xe9ad('0x13f')];_0x1f80c9[_0xe9ad('0x3d')]=_0x1f80c9['dialMethod']===_0xe9ad('0x7')?'ACTIVE':_0xe9ad('0x217');for(var _0x4fe48a=0x0;_0x4fe48a<_0x4b130e['length'];_0x4fe48a+=0x1){if(_['isNil'](_0x4b130e[_0x4fe48a])||_[_0xe9ad('0xde')](_0x4b130e[_0x4fe48a][_0xe9ad('0x196')])||_['isNil'](_0x4b130e[_0x4fe48a][_0xe9ad('0x19e')])){_0x201dbd[_0xe9ad('0xd2')]('[actionOriginate]\x20',_0x1f80c9,_0x4b130e[_0x4fe48a]);}else{_0x201dbd['checkIsBlackList'](_['pick'](_0x4b130e[_0x4fe48a],[_0xe9ad('0xff'),_0xe9ad('0x19e')]))[_0xe9ad('0x3a')](_0x201dbd[_0xe9ad('0x1fe')](_0x1f80c9,_0x4b130e[_0x4fe48a]))[_0xe9ad('0xb1')](_0x201dbd[_0xe9ad('0xd1')]('[actionOriginate]\x20',_0x1f80c9));}}}})[_0xe9ad('0xb1')](loggerGetContactDialer(_0xe9ad('0x21d'),_0x1f80c9,_0x35f983));}};Dialer[_0xe9ad('0x17')]['handlePredictive']=function(_0xc2c18c){if(_0xc2c18c['dialLimitQueue']>0x0){var _0x19fc3e=_0xc2c18c[_0xe9ad('0x21b')]-_0xc2c18c[_0xe9ad('0x6d')]-_0xc2c18c[_0xe9ad('0x54')];if(_0x19fc3e>0x0){this[_0xe9ad('0x21e')](_0xc2c18c);}else{loggerPredictiveCalls[_0xe9ad('0x79')](_0xe9ad('0x21f'));}}else{this[_0xe9ad('0x21e')](_0xc2c18c);}};Dialer[_0xe9ad('0x17')][_0xe9ad('0x21e')]=function(_0x145d2b){var _0x1a12b5=this;var _0x4e0d65=[];_0x145d2b[_0xe9ad('0x6d')]+=0x1;for(var _0x23034a in this['agents']){if(typeof this[_0xe9ad('0x1d')][_0x23034a]!=='undefined'){if(this[_0xe9ad('0x1d')][_0x23034a]['state']===_0xe9ad('0x21c')&&this['agents'][_0x23034a][_0xe9ad('0xb0')]==='reachable'){_0x4e0d65[_0xe9ad('0x135')](this[_0xe9ad('0x1d')][_0x23034a]['id']);}}}this[_0xe9ad('0xc5')](_0x145d2b['id'],_0x4e0d65,0x1,_0x145d2b['dialOrderByScheduledAt'],_0x145d2b)[_0xe9ad('0x3a')](function(_0x2135ef){if(!checkContactEmpty(_0x2135ef)){checkContactLowerLimitOriginate(_0x145d2b,0x1,0x0);_0x1a12b5['countReScheduled'](_0x145d2b)[_0xe9ad('0x3a')](sendMessageReschedule(_0x145d2b))[_0xe9ad('0xb1')](loggerCatch(_0xe9ad('0xb8')));}else{_0x145d2b[_0xe9ad('0x3d')]=_0xe9ad('0x217');if(_[_0xe9ad('0xde')](_0x2135ef[0x0])||_[_0xe9ad('0xde')](_0x2135ef[0x0][_0xe9ad('0x196')])||_['isNil'](_0x2135ef[0x0][_0xe9ad('0x19e')])){_0x1a12b5[_0xe9ad('0xd2')](_0xe9ad('0x218'),_0x145d2b,_0x2135ef[0x0]);}else{_0x1a12b5[_0xe9ad('0xb9')](_[_0xe9ad('0x136')](_0x2135ef[0x0],['VoiceQueueId',_0xe9ad('0x19e')]))[_0xe9ad('0x3a')](_0x1a12b5[_0xe9ad('0x1fe')](_0x145d2b,_0x2135ef[0x0]))[_0xe9ad('0xb1')](_0x1a12b5[_0xe9ad('0xd1')](_0xe9ad('0x220'),_0x145d2b));}}})[_0xe9ad('0xb1')](loggerGetContactDialer(_0xe9ad('0x221'),_0x145d2b,0x1));emitVoiceQueueSummary(_0x145d2b);};Dialer[_0xe9ad('0x17')]['abandonmentRate']=function(_0xd0c50e,_0x5c2225,_0x494a74,_0x471b27,_0x23cb76,_0x21c978){loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x222'));loggerPredictive[_0xe9ad('0x79')]('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',_0xd0c50e);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x223'),_0x5c2225);loggerPredictive['info'](_0xe9ad('0x224'),_0x494a74);loggerPredictive[_0xe9ad('0x79')]('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',_0x471b27);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x225'),_0x23cb76);loggerPredictive['info'](_0xe9ad('0x82'));return new Promise(function(_0x1136db,_0x1cc90c){if(_0xd0c50e<=0x0||isNaN(_0xd0c50e)){return _0x1cc90c(msgResponse(_0xe9ad('0x226'),_0xe9ad('0x47'),'m\x20=\x20'+_0xd0c50e));}if(_0x494a74<=0x0||isNaN(_0x494a74)){return _0x1cc90c(msgResponse(_0xe9ad('0x226'),_0xe9ad('0x47'),_0xe9ad('0x227')+_0x494a74));}if(_0x471b27<=0x0||isNaN(_0x471b27)){return _0x1cc90c(msgResponse(_0xe9ad('0x226'),_0xe9ad('0x47'),'p\x20=\x20'+_0x471b27));}if(_0x5c2225<=0x0||isNaN(_0x5c2225)){return _0x1cc90c(msgResponse('[abandonmentRate]',_0xe9ad('0x47'),_0xe9ad('0x228')+_0x5c2225));}if(_0x23cb76<=0x0||isNaN(_0x23cb76)){return _0x1cc90c(msgResponse(_0xe9ad('0x226'),_0xe9ad('0x47'),_0xe9ad('0x229')+_0x23cb76));}_0x21c978=_0x21c978||0x0;var _0x5d5bea=0x1/_0x494a74;var _0x3bf31c=0x0;var _0x212e9c=0x0;var _0x117c8f=0x0;var _0x3d165c=0x0;for(var _0x278f5d=0x0;_0x117c8f<_0x23cb76;_0x278f5d+=0x1){_0x212e9c=_0x278f5d/_0x5c2225;_0x3bf31c=(_0x471b27*_0x212e9c+_0x21c978)/_0x5d5bea;_0x117c8f=erlangb(_0x3bf31c,_0xd0c50e);_0x3d165c=_0x3bf31c/_0xd0c50e*(0x1-erlangb(_0x3bf31c,_0xd0c50e));}return _0x1136db({'erlangCalls':_0x278f5d,'erlangCallToSecond':_0x5c2225/_0x278f5d,'erlangAbandonmentRate':_0x117c8f,'erlangBusyFactor':_0x3d165c});});};Dialer[_0xe9ad('0x17')][_0xe9ad('0x1f3')]=function(_0x1b8df0,_0x213c8d,_0x5bd0c0,_0x2c9dc4,_0x34da5e,_0x42b549){loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x22a'));loggerPredictive[_0xe9ad('0x79')]('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',_0x1b8df0);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x223'),_0x213c8d);loggerPredictive['info'](_0xe9ad('0x224'),_0x5bd0c0);loggerPredictive['info']('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',_0x2c9dc4);loggerPredictive[_0xe9ad('0x79')](_0xe9ad('0x22b'),_0x34da5e);loggerPredictive['info']('---------------------------');return new Promise(function(_0x525e82,_0x31eee5){if(_0x1b8df0<=0x0||isNaN(_0x1b8df0)){return _0x31eee5(msgResponse(_0xe9ad('0x22c'),_0xe9ad('0x47'),_0xe9ad('0x22d')+_0x1b8df0));}if(_0x5bd0c0<=0x0||isNaN(_0x5bd0c0)){return _0x31eee5(msgResponse(_0xe9ad('0x22c'),_0xe9ad('0x47'),_0xe9ad('0x227')+_0x5bd0c0));}if(_0x2c9dc4<=0x0||isNaN(_0x2c9dc4)){return _0x31eee5(msgResponse(_0xe9ad('0x22c'),_0xe9ad('0x47'),'p\x20=\x20'+_0x2c9dc4));}if(_0x213c8d<=0x0||isNaN(_0x213c8d)){return _0x31eee5(msgResponse('[busyFactor]',_0xe9ad('0x47'),_0xe9ad('0x228')+_0x213c8d));}if(_0x34da5e<=0x0||isNaN(_0x34da5e)){return _0x31eee5(msgResponse('[busyFactor]',_0xe9ad('0x47'),_0xe9ad('0x22e')+_0x34da5e));}_0x42b549=_0x42b549||0x0;var _0x599484=0x1/_0x5bd0c0;var _0x10d39f=0x0;var _0x1b1517=0x0;var _0x3b63d1=0x0;var _0x1d2e83=0x0;for(var _0x24921b=0x0;_0x1d2e83<_0x34da5e;_0x24921b+=0x1){_0x1b1517=_0x24921b/_0x213c8d;_0x10d39f=(_0x2c9dc4*_0x1b1517+_0x42b549)/_0x599484;_0x3b63d1=erlangb(_0x10d39f,_0x1b8df0);_0x1d2e83=_0x10d39f/_0x1b8df0*(0x1-erlangb(_0x10d39f,_0x1b8df0));}return _0x525e82({'erlangCalls':_0x24921b,'erlangCallToSecond':_0x213c8d/_0x24921b,'erlangAbandonmentRate':_0x3b63d1,'erlangBusyFactor':_0x1d2e83});});};module[_0xe9ad('0x22f')]=Dialer; \ No newline at end of file +var _0xd7fc=['error','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','undefined','isNil','Action','status','catch','updateOriginated','queue','[Dialer][checkChannel]','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','HangupInAMD','membername','[syncHangupInAMDIvr]','countnoanswerretry','countnosuchnumberretry','dialMachineMaxRetry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dropreason','TIMEOUT','agiafterat','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','run','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialTimezone','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','dialGlobalInterval','[syncCampaigns]','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','loggedIn','outboundQueuePauses','abandonmentRate','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','countReScheduled','ACTIVE','RUNNING','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','uuid','moment','md5','ioredis','../preview/util/util','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopperAdditionalPhone','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','[ifTime][Action]','stringify','milliseconds','diff','type','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect'];(function(_0x4a811b,_0x29b20e){var _0x3b4cfd=function(_0x554e82){while(--_0x554e82){_0x4a811b['push'](_0x4a811b['shift']());}};_0x3b4cfd(++_0x29b20e);}(_0xd7fc,0x18f));var _0xcd7f=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xd7fc[_0x16de68];return _0x1c277e;};'use strict';var util=require('util');var _=require(_0xcd7f('0x0'));var uuid=require(_0xcd7f('0x1'));var moment=require(_0xcd7f('0x2'));var rr=require('rr');var md5=require(_0xcd7f('0x3'));var Redis=require(_0xcd7f('0x4'));var ut=require(_0xcd7f('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xcd7f('0x6'));var loggerBooked=require('../../../config/logger')(_0xcd7f('0x7'));var loggerPredictive=require(_0xcd7f('0x8'))(_0xcd7f('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xcd7f('0xa'));var loggerSyncQueueSummary=require(_0xcd7f('0x8'))(_0xcd7f('0xb'));var ami=require(_0xcd7f('0xc'));config[_0xcd7f('0xd')]=_[_0xcd7f('0xe')](config[_0xcd7f('0xd')],{'host':_0xcd7f('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcd7f('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperAdditionalPhone=require(_0xcd7f('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xcd7f('0x11'));var RpcSetting=require(_0xcd7f('0x12'));var Action=require(_0xcd7f('0x13'));var History=require(_0xcd7f('0x14'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xcd7f('0x15'));var Hangup=require(_0xcd7f('0x16'));var ipAgi=process[_0xcd7f('0x17')][_0xcd7f('0x18')]||_0xcd7f('0x19');var strategy={'rrmemory':_0xcd7f('0x1a'),'roundrobin':_0xcd7f('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xcd7f('0x1c')]=function(_0x4d0389){this[_0xcd7f('0x1d')]=this[_0xcd7f('0x1d')]?this[_0xcd7f('0x1d')][_0xcd7f('0x1e')](_0x4d0389):_0x4d0389();};function Dialer(_0x288b43,_0x1d4027){this[_0xcd7f('0x1f')]=new Sequence();this['preview']=_0x1d4027;this['voiceQueues']=_0x288b43[_0xcd7f('0x20')];this[_0xcd7f('0x21')]=_0x288b43[_0xcd7f('0x21')];this[_0xcd7f('0x22')]=_0x288b43[_0xcd7f('0x22')];this[_0xcd7f('0x23')]=_0x288b43[_0xcd7f('0x23')];this[_0xcd7f('0x24')]=config[_0xcd7f('0x24')]||0x2;this[_0xcd7f('0x25')]={};this[_0xcd7f('0x26')]={};this[_0xcd7f('0x27')]={};this[_0xcd7f('0x28')]={};this[_0xcd7f('0x29')]={};this[_0xcd7f('0x2a')]={};this[_0xcd7f('0x2b')]={};this[_0xcd7f('0x2c')]={};this[_0xcd7f('0x2d')]={};this[_0xcd7f('0x2e')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x30'),this[_0xcd7f('0x31')][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x32'),this[_0xcd7f('0x33')][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x34'),this[_0xcd7f('0x35')][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x36'),this[_0xcd7f('0xb')]['bind'](this));ami['on']('custom:queuesummarycomplete',this[_0xcd7f('0x37')][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x38'),this[_0xcd7f('0x39')]['bind'](this));ami['on']('newexten',this[_0xcd7f('0x3a')][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x3b'),this['syncVarSet'][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x3c'),this[_0xcd7f('0x3d')][_0xcd7f('0x2f')](this));ami['on'](_0xcd7f('0x3e'),this[_0xcd7f('0x3f')][_0xcd7f('0x2f')](this));this[_0xcd7f('0x40')]();this[_0xcd7f('0x41')]();RpcSetting['getSettings']()[_0xcd7f('0x42')](function(_0x479953){previewRecallmeReminderInterval=_0x479953[_0xcd7f('0x43')];});}function isNotNull(_0x2a94b0){return _0x2a94b0!==null&&!_[_0xcd7f('0x44')](_0x2a94b0);}function checkIsLoggedIn(_0x127405,_0x277a0b){return function(){if(_0x277a0b<=0x0){_0x127405[_0xcd7f('0x45')]=_0xcd7f('0x46');throw _0x127405[_0xcd7f('0x47')]+_0xcd7f('0x48');}};}function isActive(_0x468c5a){return _0x468c5a;}function checkIsActive(_0x3aff7d,_0x5b418d){return function(){if(!isActive(_0x5b418d)){_0x3aff7d[_0xcd7f('0x45')]=_0xcd7f('0x49');throw _0x3aff7d[_0xcd7f('0x47')]+_0xcd7f('0x4a');}};}function checkInterval(_0x5da760){return function(){if(!isNotNull(_0x5da760[_0xcd7f('0x4b')])){_0x5da760[_0xcd7f('0x45')]='INTERVAL_IS_NULL';throw _0x5da760[_0xcd7f('0x47')]+_0xcd7f('0x4c');}if(!isNotNull(_0x5da760[_0xcd7f('0x4b')][_0xcd7f('0x4d')])){_0x5da760[_0xcd7f('0x45')]=_0xcd7f('0x4e');throw _0x5da760[_0xcd7f('0x47')]+_0xcd7f('0x4c');}if(!isNotNull(_['isEmpty'](_0x5da760[_0xcd7f('0x4b')][_0xcd7f('0x4d')]))){_0x5da760[_0xcd7f('0x45')]=_0xcd7f('0x4e');throw _0x5da760[_0xcd7f('0x47')]+_0xcd7f('0x4c');}};}function msgResponse(_0x2d6dee,_0x514e27,_0x55c988){return{'action':_0x2d6dee,'response':_0x514e27,'message':_0x55c988,'stack':_0x55c988};}function myreject(_0x2ddb34){return function(_0x580862){return _0x2ddb34(msgResponse(_0xcd7f('0x4f'),'Error',JSON[_0xcd7f('0x50')](_0x580862)));};}function getSeconds(_0x7cc495,_0x28d4b3){var _0x19f811=moment(_0x7cc495)[_0xcd7f('0x51')](0x0);var _0x46230b=moment(_0x28d4b3)['milliseconds'](0x0);return _0x19f811[_0xcd7f('0x52')](_0x46230b,'seconds');}function emit(_0x160a66,_0x4c67fd,_0x52973a){io['to'](_0x160a66)['emit'](_0x4c67fd,_0x52973a);}function emitVoiceQueueSummary(_0x2040e9){if(_0x2040e9[_0xcd7f('0x53')]==='outbound'){var _0x319363={'id':_0x2040e9['id'],'name':_0x2040e9[_0xcd7f('0x47')],'strategy':_0x2040e9[_0xcd7f('0x54')],'answered':_0x2040e9[_0xcd7f('0x55')],'available':_0x2040e9[_0xcd7f('0x56')],'loggedIn':_0x2040e9['loggedIn'],'pTalking':_0x2040e9['pTalking'],'sumBillable':_0x2040e9[_0xcd7f('0x57')],'sumDuration':_0x2040e9[_0xcd7f('0x58')],'sumHoldTime':_0x2040e9[_0xcd7f('0x59')]||0x0,'talking':_0x2040e9[_0xcd7f('0x5a')],'total':_0x2040e9[_0xcd7f('0x5b')],'type':_0x2040e9[_0xcd7f('0x53')],'unmanaged':_0x2040e9['unmanaged'],'abandoned':_0x2040e9[_0xcd7f('0x5c')],'waiting':_0x2040e9[_0xcd7f('0x5d')],'loggedInDb':_0x2040e9[_0xcd7f('0x5e')],'dialActive':_0x2040e9[_0xcd7f('0x5f')],'dialMethod':_0x2040e9[_0xcd7f('0x60')],'dialOriginateCallerIdName':_0x2040e9[_0xcd7f('0x61')],'dialOriginateCallerIdNumber':_0x2040e9['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2040e9['dialOriginateTimeout'],'dialPrefix':_0x2040e9[_0xcd7f('0x62')],'outboundAnswerAgiCallsDay':_0x2040e9['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2040e9[_0xcd7f('0x63')],'outboundBlacklistCallsDay':_0x2040e9[_0xcd7f('0x64')],'outboundBusyCallsDay':_0x2040e9['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x2040e9['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2040e9[_0xcd7f('0x65')],'outboundDropCallsDayCallersExit':_0x2040e9['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2040e9[_0xcd7f('0x66')],'outboundNoAnswerCallsDay':_0x2040e9[_0xcd7f('0x67')],'outboundNoSuchCallsDay':_0x2040e9[_0xcd7f('0x68')],'outboundOriginateFailureCallsDay':_0x2040e9['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2040e9[_0xcd7f('0x69')],'outboundRejectCallsDay':_0x2040e9[_0xcd7f('0x6a')],'outboundUnknownCallsDay':_0x2040e9['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2040e9[_0xcd7f('0x6b')],'predictiveIntervalAvgHoldtime':_0x2040e9[_0xcd7f('0x6c')],'predictiveIntervalAvgTalktime':_0x2040e9[_0xcd7f('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x2040e9[_0xcd7f('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x2040e9[_0xcd7f('0x6f')],'predictiveIntervalErlangCalls':_0x2040e9[_0xcd7f('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x2040e9[_0xcd7f('0x71')],'predictiveIntervalHitRate':_0x2040e9[_0xcd7f('0x72')],'predictiveIntervalMultiplicativeFactor':_0x2040e9[_0xcd7f('0x73')],'predictiveIntervalPauses':_0x2040e9[_0xcd7f('0x74')],'predictiveIntervalAvailable':_0x2040e9['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2040e9[_0xcd7f('0x75')],'message':_0x2040e9['message'],'originated':_0x2040e9[_0xcd7f('0x76')],'erlangCalls':_0x2040e9[_0xcd7f('0x77')],'erlangCallToSecond':_0x2040e9[_0xcd7f('0x78')],'erlangAbandonmentRate':_0x2040e9[_0xcd7f('0x79')],'erlangBusyFactor':_0x2040e9[_0xcd7f('0x7a')],'startPredictive':_0x2040e9[_0xcd7f('0x2a')],'startProgressive':_0x2040e9[_0xcd7f('0x2b')]};if(_0x2040e9[_0xcd7f('0x7b')]){_0x319363['Trunk']={'id':_0x2040e9[_0xcd7f('0x7b')]['id'],'name':_0x2040e9['Trunk'][_0xcd7f('0x47')],'active':_0x2040e9[_0xcd7f('0x7b')][_0xcd7f('0x7c')],'callerid':_0x2040e9[_0xcd7f('0x7b')][_0xcd7f('0x7d')]};}if(_0x2040e9['Interval']){_0x319363['Interval']={'id':_0x2040e9[_0xcd7f('0x4b')]['id'],'name':_0x2040e9[_0xcd7f('0x4b')][_0xcd7f('0x47')]};}var _0x40bcde=md5(JSON[_0xcd7f('0x50')](_0x319363));if(_0x2040e9[_0xcd7f('0x3')]!==_0x40bcde){_0x2040e9[_0xcd7f('0x3')]=_0x40bcde;emit(util[_0xcd7f('0x7e')]('voice:queue:%s',_0x319363['name']),_0xcd7f('0x7f'),_0x319363);}}}function emitCampaignSummary(_0x5f686a){if(_0x5f686a['type']===_0xcd7f('0x80')){emit(util[_0xcd7f('0x7e')](_0xcd7f('0x81'),_0x5f686a[_0xcd7f('0x47')]),_0xcd7f('0x82'),_0x5f686a);}}function checkGetDataPredictive(_0x3f48f5){if(isNotNull(_0x3f48f5)&&!_[_0xcd7f('0x83')](_0x3f48f5)){loggerPredictive['info'](_0xcd7f('0x84'));loggerPredictive['info'](_0xcd7f('0x85'),_0x3f48f5[_0xcd7f('0x75')]);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x87'),_0x3f48f5[_0xcd7f('0x6b')]);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x88'),_0x3f48f5['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x89'),_0x3f48f5['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3f48f5['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xcd7f('0x8a'),_0x3f48f5[_0xcd7f('0x6d')]);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x8b'));if(_0x3f48f5[_0xcd7f('0x75')]>0x0){if(!_[_0xcd7f('0x44')](_0x3f48f5[_0xcd7f('0x6d')])&&_0x3f48f5['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x8c'));if(!_[_0xcd7f('0x44')](_0x3f48f5[_0xcd7f('0x6c')])&&_0x3f48f5['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xcd7f('0x86')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x8d'));}}else{loggerPredictive[_0xcd7f('0x86')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5b170e){return function(_0xa1f7be){loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x8e'));loggerPredictive[_0xcd7f('0x86')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xa1f7be[_0xcd7f('0x77')]);loggerPredictive['info'](_0xcd7f('0x8f'),_0xa1f7be['erlangCallToSecond']);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x90'),_0xa1f7be['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xa1f7be['erlangBusyFactor']);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x90'),_0xa1f7be[_0xcd7f('0x79')]);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x8b'));_[_0xcd7f('0x91')](_0x5b170e,_0xa1f7be);};}function getDiff(_0x397528){var _0x3b73b7=moment()[_0xcd7f('0x51')](0x0);var _0x2b6ffc=moment(_0x397528)['milliseconds'](0x0);return _0x3b73b7['diff'](_0x2b6ffc,_0xcd7f('0x92'));}function ifInterval(_0x1334fe,_0xce5368){if(_[_0xcd7f('0x44')](_0xce5368)){return![];}return getDiff(_0xce5368)<_0x1334fe*0x3c;}function freeVariablesPredictive(_0x5b38ae){if(isNotNull(_0x5b38ae)){if(!_['isUndefined'](_0x5b38ae['startProgressive'])){_0x5b38ae[_0xcd7f('0x2b')]=undefined;loggerPredictive[_0xcd7f('0x86')](_0x5b38ae[_0xcd7f('0x47')],_0xcd7f('0x93'));}if(!_[_0xcd7f('0x44')](_0x5b38ae['startPredictive'])){_0x5b38ae['startPredictive']=undefined;loggerPredictive[_0xcd7f('0x86')](_0x5b38ae[_0xcd7f('0x47')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xcd7f('0x44')](_0x5b38ae[_0xcd7f('0x94')])){clearInterval(_0x5b38ae[_0xcd7f('0x94')]);_0x5b38ae[_0xcd7f('0x94')]=undefined;loggerPredictive[_0xcd7f('0x86')](_0x5b38ae[_0xcd7f('0x47')],_0xcd7f('0x95'));}}}function erlangb(_0x19a3b0,_0x4732ab){if(_0x4732ab===0x0){return 0x0;}var _0x26e0e9=0x1;for(var _0x5ab8e7=0x1;_0x5ab8e7<=_0x4732ab;_0x5ab8e7+=0x1){_0x26e0e9=0x1+_0x26e0e9*_0x5ab8e7/_0x19a3b0;}return 0x1/_0x26e0e9;}function isVoiceQueueOutbound(_0x28641b){return _0x28641b==='outbound';}function isNotPreview(_0x5a7f03){return _0x5a7f03!==_0xcd7f('0x96');}function isCampaignIvr(_0x284224){return _0x284224===_0xcd7f('0x80');}function getCallerId(_0x39641c,_0x2bd041,_0x5ad48c){if(!_[_0xcd7f('0x44')](_0x5ad48c)&&typeof _0x5ad48c===_0xcd7f('0x97')&&!_[_0xcd7f('0x83')](_0x5ad48c)){if(!_['isUndefined'](_0x2bd041)&&typeof _0x2bd041===_0xcd7f('0x97')&&!_[_0xcd7f('0x83')](_0x2bd041)){return util[_0xcd7f('0x7e')](_0xcd7f('0x98'),_0x2bd041,_0x5ad48c);}return util[_0xcd7f('0x7e')](_0xcd7f('0x98'),_0x5ad48c,_0x5ad48c);}if(!_[_0xcd7f('0x44')](_0x39641c)&&typeof _0x39641c===_0xcd7f('0x97')&&!_[_0xcd7f('0x83')](_0x39641c)){return _0x39641c;}return _0xcd7f('0x99');}function loggerCatchQueueSummary(_0x433097,_0x5caeb8){return function(_0x469343){freeVariablesPredictive(_0x5caeb8);emitVoiceQueueSummary(_0x5caeb8);emitCampaignSummary(_0x5caeb8);loggerSyncQueueSummary[_0xcd7f('0x9a')](_0x433097,util[_0xcd7f('0x9b')](_0x469343,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4eb8a7,_0x2e20fb){return function(_0x4f7bd3){loggerPredictive[_0xcd7f('0x9c')](_0x2e20fb[_0xcd7f('0x47')],_0x4eb8a7);loggerPredictive['error'](_0x4f7bd3['stack']);freeVariablesPredictive(_0x2e20fb);};}function loggerCatch(_0x2675e0){return function(_0x1837ff){logger[_0xcd7f('0x9c')](_0x2675e0,util[_0xcd7f('0x9b')](_0x1837ff,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x42e43c){return _0x42e43c&&!_[_0xcd7f('0x44')](_0x42e43c)&&_0x42e43c[_0xcd7f('0x9d')]>0x0;}function decremetOriginate(_0x494704){if(!_[_0xcd7f('0x44')](_0x494704)&&_0x494704!==null){if(typeof _0x494704['originated']!=='undefined'){if(_0x494704[_0xcd7f('0x76')]>0x0){_0x494704[_0xcd7f('0x76')]-=0x1;}else{logger[_0xcd7f('0x9c')](_0xcd7f('0x9e'));}}}else{logger['error'](_0xcd7f('0x9f'));}}function checkContactLowerLimitOriginate(_0xc0d5b0,_0x103884,_0x5788ff){if(_0x103884>_0x5788ff){for(var _0x3df089=0x0;_0x3df089<_0x103884-_0x5788ff;_0x3df089+=0x1){decremetOriginate(_0xc0d5b0);}}}function loggerGetContactDialer(_0x4d183c,_0x428ce0,_0x4e5600){return function(_0x10a96c){checkContactLowerLimitOriginate(_0x428ce0,_0x4e5600,0x0);logger['error'](_0x4d183c,util[_0xcd7f('0x9b')](_0x10a96c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4cfda3){return function(_0x191d3a){if(isNotNull(_0x191d3a)&&isNotNull(_0x191d3a[0x0])){if(_0x191d3a[0x0]['contactsRescheduled']>0x0){_0x4cfda3[_0xcd7f('0x45')]='RESCHEDULED_CONTACTS';logger[_0xcd7f('0x86')]('[getContactDialer2][ReScheduled]'+_0x4cfda3['name'],_0x191d3a[0x0]['contactsRescheduled'],'contacts');}else{_0x4cfda3['message']=_0xcd7f('0xa0');logger[_0xcd7f('0x86')](_0xcd7f('0xa1')+_0x4cfda3[_0xcd7f('0x47')]);}}};}function notSendMessagesQueue(_0x3207db){if(_0x3207db[_0xcd7f('0xa2')]){freeVariablesPredictive(_0x3207db);if(_0x3207db['originated']===0x0&&_0x3207db[_0xcd7f('0x5a')]===0x0&&_0x3207db[_0xcd7f('0x5d')]===0x0&&(_0x3207db['pTalking']||0x0)===0x0){_0x3207db[_0xcd7f('0xa2')]=![];_0x3207db[_0xcd7f('0x56')]=0x0;_0x3207db[_0xcd7f('0x45')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xcd7f('0x9a')](_0xcd7f('0xa3'),_0x3207db[_0xcd7f('0x47')],'is\x20not\x20active');}else{_0x3207db[_0xcd7f('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xcd7f('0x9a')](_0xcd7f('0xa3'),_0x3207db[_0xcd7f('0x47')],_0xcd7f('0xa4'));}emitVoiceQueueSummary(_0x3207db);}}function notSendMessagesCampaign(_0x6a8511){if(_0x6a8511[_0xcd7f('0xa2')]){if(_0x6a8511[_0xcd7f('0x76')]===0x0){_0x6a8511[_0xcd7f('0xa2')]=![];_0x6a8511[_0xcd7f('0x45')]=_0xcd7f('0x49');loggerSyncQueueSummary[_0xcd7f('0x9a')](_0xcd7f('0xa5'),_0x6a8511[_0xcd7f('0x47')],'is\x20not\x20active');}else{_0x6a8511['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0xcd7f('0x9a')](_0xcd7f('0xa5'),_0x6a8511['name'],_0xcd7f('0xa4'));}emitCampaignSummary(_0x6a8511);}}function createObjHistory(_0x497320,_0x2ac253,_0x5a77dc,_0x2bec8c,_0x7387e9){_0x497320['message']=_0x5a77dc;var _0x424837=new Action(_0x497320,_0x2ac253);var _0x3c75a5=new History(_0x424837);_0x3c75a5[_0xcd7f('0xa6')]=_0x2bec8c;_0x3c75a5[_0xcd7f('0xa7')]=_0x7387e9;_0x3c75a5[_0xcd7f('0xa8')]=_0x424837[_0xcd7f('0xa9')];return _0x3c75a5;}Dialer[_0xcd7f('0xaa')][_0xcd7f('0x41')]=function(){var _0x533c56=this;setInterval(function(){_0x533c56[_0xcd7f('0xab')](_0x533c56[_0xcd7f('0x28')],_0xcd7f('0xac'));_0x533c56[_0xcd7f('0xab')](_0x533c56[_0xcd7f('0x26')],'[actions]');},0x32c8);};Dialer[_0xcd7f('0xaa')]['clearZombieChannels']=function(_0x56803e,_0x3497bd){var _0x32d455=this;for(var _0x1288ac in _0x56803e){if(typeof _0x56803e[_0x1288ac]!==_0xcd7f('0xad')){this['sequence'][_0xcd7f('0x1c')](function(){if(!_[_0xcd7f('0xae')](_0x56803e[_0x1288ac])){return ami[_0xcd7f('0xaf')]({'action':_0xcd7f('0xb0'),'channel':_0x56803e[_0x1288ac]['channel']})[_0xcd7f('0xb1')](function(_0x5b9e13){if(_0x5b9e13[_0xcd7f('0x45')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x56803e[_0x1288ac]&&_0x56803e[_0x1288ac]['type']!==_0xcd7f('0x80')){_0x32d455[_0xcd7f('0xb2')](_0x32d455[_0xcd7f('0x20')][_0x56803e[_0x1288ac][_0xcd7f('0xb3')]]);logger['error'](_0xcd7f('0xb4'),_0x3497bd,_0x1288ac,_0x56803e[_0x1288ac]['queue']);delete _0x56803e[_0x1288ac];}if(_0x56803e[_0x1288ac]&&_0x56803e[_0x1288ac]['type']==='ivr'){_0x32d455[_0xcd7f('0xb2')](_0x32d455[_0xcd7f('0x21')][_0x56803e[_0x1288ac]['queue']]);logger[_0xcd7f('0x9c')]('[Dialer][checkChannel][ivr]',_0x3497bd,_0x1288ac,_0x56803e[_0x1288ac]['queue']);delete _0x56803e[_0x1288ac];}},0x2328);}});}});}}};Dialer[_0xcd7f('0xaa')]['countReScheduled']=function(_0x3ffe0f){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopper['countReScheduled'](_0x3ffe0f))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xb6')));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xb7')]=function(_0x198e85){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopperBlack[_0xcd7f('0xb7')](_0x198e85))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xb8')));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xb9')]=function(_0x36777a,_0x18b953,_0x54fa4c){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopperAdditionalPhone[_0xcd7f('0xb9')](_0x36777a,_0x18b953,_0x54fa4c))['catch'](loggerCatch(_0xcd7f('0xba')));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xbb')]=function(_0x3d22a8,_0x1cfb51,_0x54667a){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopperAdditionalPhone[_0xcd7f('0xbb')](_0x3d22a8,_0x1cfb51,_0x54667a))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xbc')));};Dialer['prototype'][_0xcd7f('0xbd')]=function(_0x40489d){return Promise[_0xcd7f('0xb5')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x40489d))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xbe')]=function(_0xf83045){return Promise[_0xcd7f('0xb5')]()['then'](cmHopperHistory[_0xcd7f('0xbf')](_0xf83045))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xc0')));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xc1')]=function(_0x3865ad){return Promise['resolve']()['then'](cmHopper['rescheduleContact'](_0x3865ad))['catch'](loggerCatch(_0xcd7f('0xc2')));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xc3')]=function(_0x53fb66,_0x2ef2de,_0x336cdf){return Promise['resolve']()[_0xcd7f('0x42')](cmHopper[_0xcd7f('0xc3')](_0x53fb66,_0x2ef2de,_0x336cdf))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xc4')));};Dialer['prototype'][_0xcd7f('0xc5')]=function(_0x5842f2,_0x3b7647,_0x3a4bc6,_0x16eb32,_0x3a3bbd){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopper[_0xcd7f('0xc5')](_0x5842f2,_0x3b7647,_0x3a4bc6,_0x16eb32))[_0xcd7f('0xb1')](function(_0x41d738){_0x3a3bbd['temp']-=_0x3a4bc6;_0x3a3bbd[_0xcd7f('0xc6')]=_0x3a3bbd[_0xcd7f('0xc6')]>0x0?_0x3a3bbd['temp']:0x0;loggerCatch(_0xcd7f('0xc7'))(_0x41d738);});};Dialer['prototype'][_0xcd7f('0xc8')]=function(_0x44405d,_0x2b18c9,_0x125ef6,_0x5497be){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopper[_0xcd7f('0xc8')](_0x44405d,_0x2b18c9,_0x125ef6))[_0xcd7f('0xb1')](function(_0xb27394){_0x5497be[_0xcd7f('0xc6')]-=_0x2b18c9;_0x5497be[_0xcd7f('0xc6')]=_0x5497be[_0xcd7f('0xc6')]>0x0?_0x5497be[_0xcd7f('0xc6')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0xb27394);});};Dialer[_0xcd7f('0xaa')]['getVoiceQueueRtPauses']=function(_0x2dfe39){return Promise[_0xcd7f('0xb5')]()['then'](voiceQueueRt[_0xcd7f('0xc9')](_0x2dfe39))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xca')));};Dialer['prototype'][_0xcd7f('0xcb')]=function(_0x299e94){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopper[_0xcd7f('0xcb')](_0x299e94))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xcc')));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xcd')]=function(_0x250cb7){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopperHistory[_0xcd7f('0xcd')](_0x250cb7))['catch'](loggerCatch(_0xcd7f('0xce')));};Dialer['prototype']['updateOriginated']=function(_0x456563){if(!_[_0xcd7f('0x44')](_0x456563)&&_0x456563!==null){if(typeof _0x456563[_0xcd7f('0x76')]!=='undefined'){if(_0x456563[_0xcd7f('0x76')]>0x0){_0x456563[_0xcd7f('0x76')]-=0x1;}else{logger[_0xcd7f('0x9c')](_0xcd7f('0xcf'));}}}else{logger['error'](_0xcd7f('0xd0'));}};Dialer[_0xcd7f('0xaa')]['loggerHandler']=function(_0x53fc3d,_0x26a183){var _0x1995d4=this;return function(_0x4926c4){_0x1995d4[_0xcd7f('0xb2')](_0x26a183);logger['error'](_0x53fc3d,util[_0xcd7f('0x9b')](_0x4926c4,{'showHidden':![],'depth':null}));};};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xd1')]=function(_0x32883b,_0x4cb636,_0x2d54b2){var _0x492e6a={'state':0x19,'statedesc':'notFound'};this[_0xcd7f('0xb2')](_0x4cb636);this[_0xcd7f('0xd2')](_[_0xcd7f('0x91')](_0x492e6a,_['pick'](_0x2d54b2,['ContactId',_0xcd7f('0xd3'),_0xcd7f('0xd4'),_0xcd7f('0xd5'),_0xcd7f('0xd6')])),_0xcd7f('0xd7'),_0xcd7f('0xd8'));logger['error'](_0x32883b);};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xd9')]=function(_0x391acb){return _0x391acb===_0xcd7f('0xda');};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xdb')]=function(_0x4bd12b){return!_[_0xcd7f('0x44')](_0x4bd12b)&&_0x4bd12b&&!_[_0xcd7f('0x44')](_0x4bd12b['name'])&&!_[_0xcd7f('0x44')](_0x4bd12b[_0xcd7f('0x7c')])&&_0x4bd12b[_0xcd7f('0x7c')]&&(this[_0xcd7f('0x23')][util[_0xcd7f('0x7e')](_0xcd7f('0xdc'),_0x4bd12b[_0xcd7f('0x47')])][_0xcd7f('0xb0')]===_0xcd7f('0xdd')||this[_0xcd7f('0x23')][util[_0xcd7f('0x7e')](_0xcd7f('0xdc'),_0x4bd12b[_0xcd7f('0x47')])][_0xcd7f('0xb0')]===_0xcd7f('0xde'));};Dialer[_0xcd7f('0xaa')]['saveInDb']=function(_0x3d8249,_0x5c595a,_0x21cd2c){this[_0xcd7f('0xcd')](_0x3d8249)[_0xcd7f('0xb1')](loggerCatch(_0x5c595a));this['moveContactManagedDialer'](_0x3d8249)['catch'](loggerCatch(_0x21cd2c));};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xdf')]=function(_0x6c32b){var _0x3e7f9c=this;var _0x1999a7=this['uniqueId'][_0x6c32b[_0xcd7f('0xe0')]];var _0x33f25d;if(!_[_0xcd7f('0xae')](_0x6c32b)&&!_['isNil'](_0x6c32b[_0xcd7f('0xe1')])&&!_[_0xcd7f('0xae')](_0x6c32b[_0xcd7f('0xe1')][_0xcd7f('0xe2')])&&_0x6c32b[_0xcd7f('0xe3')]===_0xcd7f('0xe4')&&_0x1999a7){if(_0x1999a7[_0xcd7f('0x53')]!=='ivr'&&this[_0xcd7f('0x20')][_0x1999a7['queue']][_0xcd7f('0xe5')]&&_0x6c32b[_0xcd7f('0xe6')]===_0xcd7f('0xe7')){delete this[_0xcd7f('0x28')][_0x6c32b[_0xcd7f('0xe0')]];this[_0xcd7f('0xb2')](this[_0xcd7f('0x20')][_0x1999a7['queue']]);this[_0xcd7f('0x20')][_0x1999a7[_0xcd7f('0xb3')]]['outboundAnswerCallsDay']+=0x1;this[_0xcd7f('0x20')][_0x1999a7[_0xcd7f('0xb3')]][_0xcd7f('0xe8')]+=0x1;_0x33f25d=new Hangup(_0x1999a7,_0x6c32b);_0x33f25d[_0xcd7f('0xa6')]=0x12;_0x33f25d[_0xcd7f('0xa7')]='HangupInAMD';_0x33f25d['membername']=_0xcd7f('0xe9');ami[_0xcd7f('0xea')](_0xcd7f('0xeb'),ut[_0xcd7f('0xec')](_0x33f25d,_0xcd7f('0xed')));this[_0xcd7f('0xd2')](_0x33f25d,_0xcd7f('0xee'),'[syncHangupInAMD]');}if(_0x1999a7[_0xcd7f('0x53')]!=='ivr'&&this[_0xcd7f('0x20')][_0x1999a7['queue']][_0xcd7f('0xe5')]&&_0x6c32b[_0xcd7f('0xe6')]===_0xcd7f('0xef')){return new Promise(function(_0x5b631b,_0x24d7e4){delete _0x3e7f9c[_0xcd7f('0x28')][_0x6c32b['uniqueid']];_0x3e7f9c[_0xcd7f('0xb2')](_0x3e7f9c['voiceQueues'][_0x1999a7['queue']]);_0x3e7f9c[_0xcd7f('0x20')][_0x1999a7['queue']]['outboundAnswerCallsDay']+=0x1;_0x3e7f9c['voiceQueues'][_0x1999a7['queue']][_0xcd7f('0xe8')]+=0x1;var _0x671573=_0x3e7f9c[_0xcd7f('0x20')][_0x1999a7[_0xcd7f('0xb3')]];var _0xda18a4=new Hangup(_0x1999a7,_0x6c32b);_0xda18a4[_0xcd7f('0xa6')]=0x13;_0xda18a4['statedesc']=_0xcd7f('0xf0');_0xda18a4['membername']=_0xcd7f('0xe9');_0xda18a4[_0xcd7f('0xf1')]+=0x1;_0xda18a4[_0xcd7f('0xf2')]+=0x1;_0xda18a4[_0xcd7f('0xed')]=!![];ami[_0xcd7f('0xea')](_0xcd7f('0xeb'),ut[_0xcd7f('0xec')](_0xda18a4,_0xcd7f('0xed')));_0x3e7f9c[_0xcd7f('0xcd')](_0xda18a4)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xf3')));if(_0xda18a4[_0xcd7f('0xf4')]+_0xda18a4[_0xcd7f('0xf5')]+_0xda18a4['countnoanswerretry']+_0xda18a4['countnosuchnumberretry']+_0xda18a4[_0xcd7f('0xf6')]+_0xda18a4[_0xcd7f('0xf7')]+_0xda18a4[_0xcd7f('0xf1')]+_0xda18a4[_0xcd7f('0xf8')]>=_0x671573[_0xcd7f('0xf9')]){_0x3e7f9c[_0xcd7f('0xfa')](_0xda18a4,_0x5b631b,_0x24d7e4,_0xcd7f('0xfb'));}else{if(_0xda18a4[_0xcd7f('0xf1')]>=_0x671573['dialMachineMaxRetry']){_0x3e7f9c[_0xcd7f('0xfc')](_0xda18a4,_0x5b631b,_0x24d7e4,_0xcd7f('0xfd'));}else{_0x3e7f9c['rescheduleContact']({'active':![],'countmachineretry':_0xda18a4[_0xcd7f('0xf1')],'scheduledat':moment()[_0xcd7f('0xfe')](_0x671573['dialMachineRetryFrequency'],_0xcd7f('0xff'))[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0xda18a4[_0xcd7f('0x101')],'ListId':_0xda18a4[_0xcd7f('0xd3')],'VoiceQueueId':_0xda18a4['VoiceQueueId']||undefined,'CampaignId':_0xda18a4[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x102')));_0x5b631b({'reschedule':0x1});}}});}if(_0x1999a7[_0xcd7f('0x53')]===_0xcd7f('0x80')&&this[_0xcd7f('0x21')][_0x1999a7['queue']][_0xcd7f('0xe5')]&&_0x6c32b[_0xcd7f('0xe6')]===_0xcd7f('0xe7')){delete this[_0xcd7f('0x28')][_0x6c32b['uniqueid']];this[_0xcd7f('0xb2')](this[_0xcd7f('0x21')][_0x1999a7[_0xcd7f('0xb3')]]);_0x33f25d=new Hangup(_0x1999a7,_0x6c32b);_0x33f25d[_0xcd7f('0xa6')]=0x12;_0x33f25d[_0xcd7f('0xa7')]=_0xcd7f('0x103');_0x33f25d[_0xcd7f('0x104')]=_0xcd7f('0xe9');ami['emit']('custom:amd',ut[_0xcd7f('0xec')](_0x33f25d,'amd'));this['saveInDb'](_0x33f25d,'[syncHangupInAMDIvr][createHistory]',_0xcd7f('0x105'));}if(_0x1999a7[_0xcd7f('0x53')]===_0xcd7f('0x80')&&this[_0xcd7f('0x21')][_0x1999a7[_0xcd7f('0xb3')]][_0xcd7f('0xe5')]&&_0x6c32b[_0xcd7f('0xe6')]===_0xcd7f('0xef')){return new Promise(function(_0x41a201,_0x26a233){delete _0x3e7f9c['uniqueId'][_0x6c32b[_0xcd7f('0xe0')]];_0x3e7f9c[_0xcd7f('0xb2')](_0x3e7f9c[_0xcd7f('0x21')][_0x1999a7['queue']]);_0x3e7f9c['campaigns'][_0x1999a7[_0xcd7f('0xb3')]][_0xcd7f('0x63')]+=0x1;_0x3e7f9c[_0xcd7f('0x21')][_0x1999a7[_0xcd7f('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x513f29=_0x3e7f9c[_0xcd7f('0x21')][_0x1999a7['queue']];var _0x4a1d62=new Hangup(_0x1999a7,_0x6c32b);_0x4a1d62[_0xcd7f('0xa6')]=0x13;_0x4a1d62[_0xcd7f('0xa7')]=_0xcd7f('0xf0');_0x4a1d62['membername']=_0xcd7f('0xe9');_0x4a1d62[_0xcd7f('0xf1')]+=0x1;_0x4a1d62[_0xcd7f('0xf2')]+=0x1;_0x4a1d62[_0xcd7f('0xed')]=!![];ami[_0xcd7f('0xea')](_0xcd7f('0xeb'),ut['buildObj'](_0x4a1d62,_0xcd7f('0xed')));_0x3e7f9c[_0xcd7f('0xcd')](_0x4a1d62)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xf3')));if(_0x4a1d62[_0xcd7f('0xf4')]+_0x4a1d62[_0xcd7f('0xf5')]+_0x4a1d62[_0xcd7f('0x106')]+_0x4a1d62[_0xcd7f('0x107')]+_0x4a1d62[_0xcd7f('0xf6')]+_0x4a1d62['countabandonedretry']+_0x4a1d62[_0xcd7f('0xf1')]+_0x4a1d62['countagentrejectretry']>=_0x513f29[_0xcd7f('0xf9')]){_0x3e7f9c[_0xcd7f('0xfa')](_0x4a1d62,_0x41a201,_0x26a233,_0xcd7f('0xfb'));}else{if(_0x4a1d62['countmachineretry']>=_0x513f29[_0xcd7f('0x108')]){_0x3e7f9c[_0xcd7f('0xfc')](_0x4a1d62,_0x41a201,_0x26a233,'reason\x2019\x20machine....');}else{_0x3e7f9c['rescheduleContact']({'active':![],'countmachineretry':_0x4a1d62[_0xcd7f('0xf1')],'scheduledat':moment()[_0xcd7f('0xfe')](_0x513f29[_0xcd7f('0x109')],_0xcd7f('0xff'))[_0xcd7f('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a1d62[_0xcd7f('0x101')],'ListId':_0x4a1d62['ListId'],'VoiceQueueId':_0x4a1d62[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x4a1d62[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch('[rescheduleContact][Machine]'));_0x41a201({'reschedule':0x1});}}});}}};Dialer[_0xcd7f('0xaa')]['syncHangup']=function(_0x52e734){var _0x27cf43=this[_0xcd7f('0x28')][_0x52e734['uniqueid']];var _0xd6c4ce;if(_0x27cf43&&_0x27cf43[_0xcd7f('0x53')]===_0xcd7f('0x80')){delete this['uniqueId'][_0x52e734[_0xcd7f('0xe0')]];this[_0xcd7f('0xb2')](this['campaigns'][_0x27cf43[_0xcd7f('0xb3')]]);this[_0xcd7f('0x21')][_0x27cf43[_0xcd7f('0xb3')]][_0xcd7f('0x10a')]+=0x1;_0xd6c4ce=new Hangup(_0x27cf43,_0x52e734);this['createHistory'](_0xd6c4ce)[_0xcd7f('0xb1')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xcd7f('0xcb')](_0xd6c4ce)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x10b')));}if(_0x27cf43&&_0x27cf43[_0xcd7f('0x53')]!==_0xcd7f('0x80')&&isNotNull(this[_0xcd7f('0x20')][_0x27cf43[_0xcd7f('0xb3')]][_0xcd7f('0x10c')])){delete this[_0xcd7f('0x28')][_0x52e734[_0xcd7f('0xe0')]];this['updateOriginated'](this['voiceQueues'][_0x27cf43[_0xcd7f('0xb3')]]);this[_0xcd7f('0x20')][_0x27cf43[_0xcd7f('0xb3')]][_0xcd7f('0x63')]+=0x1;this[_0xcd7f('0x20')][_0x27cf43[_0xcd7f('0xb3')]][_0xcd7f('0xe8')]+=0x1;_0xd6c4ce=new Hangup(_0x27cf43,_0x52e734);_0xd6c4ce[_0xcd7f('0xa6')]=0x10;_0xd6c4ce[_0xcd7f('0xa7')]=_0xcd7f('0x10d');_0xd6c4ce[_0xcd7f('0x104')]='AGI';this['createHistory'](_0xd6c4ce)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x10e')));this[_0xcd7f('0xcb')](_0xd6c4ce)[_0xcd7f('0xb1')](loggerCatch('[syncHangupIvr]'));}if(_0x27cf43&&_0x27cf43[_0xcd7f('0x53')]!==_0xcd7f('0x80')&&!isNotNull(this[_0xcd7f('0x20')][_0x27cf43['queue']][_0xcd7f('0x10c')])){delete this['uniqueId'][_0x52e734[_0xcd7f('0xe0')]];this[_0xcd7f('0xb2')](this[_0xcd7f('0x20')][_0x27cf43[_0xcd7f('0xb3')]]);this['voiceQueues'][_0x27cf43[_0xcd7f('0xb3')]][_0xcd7f('0x10f')]+=0x1;_0xd6c4ce=new Hangup(_0x27cf43,_0x52e734);_0xd6c4ce[_0xcd7f('0xa6')]=0xc;_0xd6c4ce[_0xcd7f('0xa7')]=_0x52e734[_0xcd7f('0x110')];_0xd6c4ce['membername']=_0xcd7f('0x111');this[_0xcd7f('0xcd')](_0xd6c4ce)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x10e')));this[_0xcd7f('0xcb')](_0xd6c4ce)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x10b')));}};Dialer['prototype']['syncAgentComplete']=function(_0x208dfb){var _0x35a27d=this[_0xcd7f('0x28')][_0x208dfb[_0xcd7f('0xe0')]];if(this[_0xcd7f('0x20')][_0x208dfb[_0xcd7f('0xb3')]]){if(_0x35a27d&&_0x35a27d['type']!==_0xcd7f('0x80')){delete this['uniqueId'][_0x208dfb[_0xcd7f('0xe0')]];this['voiceQueues'][_0x208dfb[_0xcd7f('0xb3')]][_0xcd7f('0x63')]+=0x1;var _0x2c74ba=new AgentComplete(_0x35a27d,_0x208dfb);if(_0x208dfb['reason']==='agent'){_0x2c74ba['agiafterat']=this[_0xcd7f('0x20')][_0x208dfb['queue']][_0xcd7f('0x112')]&&this[_0xcd7f('0x20')][_0x208dfb[_0xcd7f('0xb3')]][_0xcd7f('0x113')]?moment()[_0xcd7f('0x7e')](_0xcd7f('0x100')):undefined;}this[_0xcd7f('0xcd')](_0x2c74ba)['catch'](loggerCatch(_0xcd7f('0x114')));this[_0xcd7f('0xcb')](_0x2c74ba)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x115')));}}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x116')]=function(_0x207f46){if(this['voiceQueues'][_0x207f46[_0xcd7f('0xb3')]]){if(this[_0xcd7f('0x28')][_0x207f46[_0xcd7f('0xe0')]]&&this[_0xcd7f('0x28')][_0x207f46[_0xcd7f('0xe0')]][_0xcd7f('0x53')]!==_0xcd7f('0x80')){this[_0xcd7f('0xb2')](this[_0xcd7f('0x20')][_0x207f46[_0xcd7f('0xb3')]]);this[_0xcd7f('0x28')][_0x207f46[_0xcd7f('0xe0')]]['answertime']=moment()[_0xcd7f('0x7e')](_0xcd7f('0x100'));}}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x117')]=function(_0x4a3f10,_0x47877c){this[_0xcd7f('0xcd')](_0x4a3f10)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x114')));if(_0x47877c==0x0){this[_0xcd7f('0xcb')](_0x4a3f10)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x118')));}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x31')]=function(_0x1ab597){var _0x2d31e2=this[_0xcd7f('0x28')][_0x1ab597[_0xcd7f('0xe0')]];var _0x4a2219=this;var _0x46eb69=![];var _0x2fe6d9;var _0x1a65cc;if(this['voiceQueues'][_0x1ab597[_0xcd7f('0xb3')]]){if(_0x2d31e2&&_0x2d31e2[_0xcd7f('0x53')]!==_0xcd7f('0x80')){delete this[_0xcd7f('0x28')][_0x1ab597[_0xcd7f('0xe0')]];this[_0xcd7f('0xb2')](this[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]]);_0x2d31e2[_0xcd7f('0x119')]=moment()[_0xcd7f('0x7e')](_0xcd7f('0x100'));var _0x130fd2=new QueueCallerAbandon(_0x2d31e2,_0x1ab597);if(getSeconds(_0x2d31e2[_0xcd7f('0x119')],_0x2d31e2[_0xcd7f('0x11a')])>=_0x2d31e2['dialQueueTimeout']){this['voiceQueues'][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x6f')]+=0x1;this[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x66')]+=0x1;this['voiceQueues'][_0x1ab597['queue']][_0xcd7f('0x71')]+=0x1;_0x130fd2[_0xcd7f('0xa6')]=0xa;_0x130fd2['statedesc']='Drop';_0x130fd2[_0xcd7f('0x11b')]=_0xcd7f('0x11c');_0x130fd2[_0xcd7f('0x11d')]=this[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x112')]?moment()[_0xcd7f('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x130fd2[_0xcd7f('0xf6')]+=0x1;_0x130fd2['countglobal']+=0x1;_0x2fe6d9=this[_0xcd7f('0x20')][_0x1ab597['queue']][_0xcd7f('0x11e')];_0x1a65cc=this[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x11f')];_0x4a2219['verifyAdditionalPhones'](_0x130fd2,_0x130fd2[_0xcd7f('0xa6')],_0x2d31e2[_0xcd7f('0x120')])[_0xcd7f('0x42')](function(_0x11b00a){_0x46eb69=_0x11b00a[_0xcd7f('0x121')]==0x1;if(_0x130fd2[_0xcd7f('0xf6')]>=_0x4a2219[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x122')]){_0x4a2219[_0xcd7f('0x117')](_0x130fd2,_0x11b00a[_0xcd7f('0x121')]);}else{_0x4a2219['rescheduleContact']({'active':![],'countdropretry':_0x130fd2[_0xcd7f('0xf6')],'scheduledat':moment()[_0xcd7f('0xfe')](_0x4a2219['voiceQueues'][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x11e')],'minutes')[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0x2d31e2[_0xcd7f('0x101')],'ListId':_0x2d31e2['ListId'],'VoiceQueueId':_0x2d31e2[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x2d31e2['CampaignId']||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x123')));var _0x10e13f=new History(_0x130fd2);_0x10e13f[_0xcd7f('0xa6')]=0xa;_0x10e13f[_0xcd7f('0xa7')]='Drop';_0x10e13f[_0xcd7f('0xa9')]=moment()['format'](_0xcd7f('0x100'));_0x10e13f[_0xcd7f('0xa8')]=_0x10e13f[_0xcd7f('0xa9')];_0x10e13f[_0xcd7f('0x124')]=_0x130fd2[_0xcd7f('0x124')];_0x10e13f[_0xcd7f('0x125')]=_0x130fd2[_0xcd7f('0x125')];_0x4a2219[_0xcd7f('0xcd')](_0x10e13f)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x126')));}})[_0xcd7f('0x42')](function(){if(_0x46eb69)_0x4a2219[_0xcd7f('0xbb')](_0x130fd2,_0x2fe6d9,_0x1a65cc)[_0xcd7f('0x42')](function(){return 0x1;});});}else{this[_0xcd7f('0x20')][_0x1ab597['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x127')]+=0x1;_0x130fd2[_0xcd7f('0xa6')]=0xb;_0x130fd2[_0xcd7f('0xa7')]='Abandoned';_0x130fd2['dropreason']=_0xcd7f('0x128');_0x130fd2[_0xcd7f('0xf7')]+=0x1;_0x130fd2['countglobal']+=0x1;_0x2fe6d9=this[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x129')];_0x1a65cc=this[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x11f')];_0x4a2219['verifyAdditionalPhones'](_0x130fd2,_0x130fd2[_0xcd7f('0xa6')],_0x2d31e2[_0xcd7f('0x120')])[_0xcd7f('0x42')](function(_0x4769a2){if(_0x130fd2[_0xcd7f('0xf7')]>=_0x4a2219[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]][_0xcd7f('0x12a')]){_0x4a2219[_0xcd7f('0x117')](_0x130fd2,_0x4769a2[_0xcd7f('0x121')]);}else{_0x4a2219[_0xcd7f('0xc1')]({'active':![],'countabandonedretry':_0x130fd2[_0xcd7f('0xf7')],'scheduledat':moment()[_0xcd7f('0xfe')](_0x4a2219[_0xcd7f('0x20')][_0x1ab597[_0xcd7f('0xb3')]]['dialAbandonedRetryFrequency'],_0xcd7f('0xff'))[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0x2d31e2['ContactId'],'ListId':_0x2d31e2[_0xcd7f('0xd3')],'VoiceQueueId':_0x2d31e2['VoiceQueueId']||undefined,'CampaignId':_0x2d31e2[_0xcd7f('0xd6')]||undefined})['catch'](loggerCatch(_0xcd7f('0x12b')));var _0x5e4e8f=new History(_0x130fd2);_0x5e4e8f['state']=0xb;_0x5e4e8f[_0xcd7f('0xa7')]=_0xcd7f('0x12c');_0x5e4e8f['starttime']=moment()[_0xcd7f('0x7e')](_0xcd7f('0x100'));_0x5e4e8f[_0xcd7f('0xa8')]=_0x5e4e8f[_0xcd7f('0xa9')];_0x5e4e8f[_0xcd7f('0x124')]=_0x130fd2[_0xcd7f('0x124')];_0x5e4e8f[_0xcd7f('0x125')]=_0x130fd2[_0xcd7f('0x125')];_0x4a2219['createHistory'](_0x5e4e8f)['catch'](loggerCatch(_0xcd7f('0x12d')));}})[_0xcd7f('0x42')](function(){if(_0x46eb69)_0x4a2219[_0xcd7f('0xbb')](_0x130fd2,_0x2fe6d9,_0x1a65cc)[_0xcd7f('0x42')](function(){return 0x1;});});}}}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x3a')]=function(_0x443974){if(this[_0xcd7f('0x26')][_0x443974['uniqueid']]){this['actions'][_0x443974[_0xcd7f('0xe0')]][_0xcd7f('0x12e')]=_0x443974[_0xcd7f('0x12e')];}if(this[_0xcd7f('0x28')][_0x443974[_0xcd7f('0xe0')]]){this[_0xcd7f('0x28')][_0x443974[_0xcd7f('0xe0')]][_0xcd7f('0x12e')]=_0x443974['channel'];}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x3d')]=function(_0x57a8e3){if(strategy[this[_0xcd7f('0x20')][this[_0xcd7f('0x26')][_0x57a8e3[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]]['strategy']]===_0xcd7f('0x1b')){if(this[_0xcd7f('0x26')][_0x57a8e3[_0xcd7f('0x12f')]]&&_[_0xcd7f('0xae')](this['actions'][_0x57a8e3[_0xcd7f('0x12f')]][_0xcd7f('0x130')])&&_0x57a8e3[_0xcd7f('0xb0')]==='1'&&_0x57a8e3[_0xcd7f('0x131')]==='0'){if(this[_0xcd7f('0x22')][_0x57a8e3[_0xcd7f('0x132')]]){if(!this[_0xcd7f('0x22')][_0x57a8e3[_0xcd7f('0x132')]][_0xcd7f('0x130')]){this[_0xcd7f('0x22')][_0x57a8e3[_0xcd7f('0x132')]]['locked']=!![];this['actions'][_0x57a8e3[_0xcd7f('0x12f')]][_0xcd7f('0x130')]=!![];this[_0xcd7f('0x26')][_0x57a8e3[_0xcd7f('0x12f')]]['stateinterface']=_0x57a8e3[_0xcd7f('0x132')];}}}}else if((strategy[this[_0xcd7f('0x20')][this[_0xcd7f('0x26')][_0x57a8e3[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]][_0xcd7f('0x54')]]||_0xcd7f('0x1a'))===_0xcd7f('0x1a')){if(this['actions'][_0x57a8e3[_0xcd7f('0x12f')]]){if(this[_0xcd7f('0x22')][_0x57a8e3[_0xcd7f('0x132')]]){this['actions'][_0x57a8e3['actionid']][_0xcd7f('0x132')]=_0x57a8e3[_0xcd7f('0x132')];if(_[_0xcd7f('0xae')](this[_0xcd7f('0x2d')][this[_0xcd7f('0x26')][_0x57a8e3[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]])){this[_0xcd7f('0x2d')][this[_0xcd7f('0x26')][_0x57a8e3[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]]=[];}this['queueBooked'][this[_0xcd7f('0x26')][_0x57a8e3[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]][_0xcd7f('0x133')](_[_0xcd7f('0x91')](_[_0xcd7f('0x134')](this[_0xcd7f('0x26')][_0x57a8e3['actionid']],[_0xcd7f('0x135'),'stateinterface']),{'status':_0x57a8e3[_0xcd7f('0xb0')],'paused':_0x57a8e3['paused']}));}}}};function unlockQueueStatus(_0x230fc8,_0x3afb35){setTimeout(function(){if(_[_0xcd7f('0x44')](_0x230fc8[_0xcd7f('0x136')])){loggerBooked['error'](_0xcd7f('0x137'),_0x3afb35);}_0x230fc8['queueStatusComplete']=!![];loggerBooked[_0xcd7f('0x86')](_0xcd7f('0x138'),_0x3afb35,JSON['stringify'](_[_0xcd7f('0x134')](_0x230fc8,[_0xcd7f('0x47'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0xcd7f('0x3f')]=function(_0x3a591b){var _0x5eb5f4=this;var _0x2b766d=_0x5eb5f4[_0xcd7f('0x20')][_0x5eb5f4[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]];if(strategy[this['voiceQueues'][this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]]['queue']]['strategy']]===_0xcd7f('0x1b')){if(this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]]&&this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0x132')]){this[_0xcd7f('0x96')]['run'](this['actions'][_0x3a591b[_0xcd7f('0x12f')]]['idHopper'],this['actions'][_0x3a591b[_0xcd7f('0x12f')]]['stateinterface'])['catch'](function(_0x546f84){logger[_0xcd7f('0x9c')](_0xcd7f('0x139'),util['inspect'](_0x546f84,{'showHidden':![],'depth':null}));})[_0xcd7f('0x1e')](function(){_0x5eb5f4[_0xcd7f('0xb2')](_0x5eb5f4['voiceQueues'][_0x5eb5f4[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]]);_0x5eb5f4['agents'][_0x5eb5f4['actions'][_0x3a591b[_0xcd7f('0x12f')]]['stateinterface']][_0xcd7f('0x130')]=![];delete _0x5eb5f4[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]];unlockQueueStatus(_0x2b766d);});}else{this[_0xcd7f('0xb2')](this[_0xcd7f('0x20')][this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]]);this[_0xcd7f('0xc1')]({'active':![],'ContactId':this['actions'][_0x3a591b['actionid']][_0xcd7f('0x101')],'ListId':this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xd3')],'VoiceQueueId':this['actions'][_0x3a591b['actionid']][_0xcd7f('0xd5')]||undefined,'CampaignId':this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x13a')));delete this[_0xcd7f('0x26')][_0x3a591b['actionid']];unlockQueueStatus(_0x2b766d);}}else if((strategy[this[_0xcd7f('0x20')][this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]][_0xcd7f('0x54')]]||'rrmemory')==='rrmemory'){var _0x864310;if(this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]]&&!_[_0xcd7f('0x83')](this[_0xcd7f('0x2d')][this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]])){if(this['queueBookedRR'][_0x5eb5f4[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]]){this[_0xcd7f('0x2e')][_0x5eb5f4[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]]=this['queueBookedRR'][this[_0xcd7f('0x26')][_0x3a591b['actionid']][_0xcd7f('0xb3')]]?this[_0xcd7f('0x2e')][this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]]['queue']]:this[_0xcd7f('0x2d')][this['actions'][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]]?this[_0xcd7f('0x2d')][this['actions'][_0x3a591b['actionid']][_0xcd7f('0xb3')]][_0xcd7f('0x13b')]||0x0:0x0;}this[_0xcd7f('0x2d')][this['actions'][_0x3a591b[_0xcd7f('0x12f')]]['queue']][_0xcd7f('0x13b')]=this[_0xcd7f('0x2e')][this[_0xcd7f('0x26')][_0x3a591b[_0xcd7f('0x12f')]][_0xcd7f('0xb3')]];for(var _0x5007bf=0x0;_0x5007bf=0x0;})[_0xcd7f('0xb1')](myreject(_0x3a0804)));}}else{_0x765a6e['push'](ami[_0xcd7f('0xaf')]({'action':'command','command':util[_0xcd7f('0x7e')](_0xcd7f('0x156'),_0x3b397d,!_[_0xcd7f('0x44')](config[_0xcd7f('0x152')][_0x2f600b])?_0x2f600b:'')})[_0xcd7f('0x42')](function(_0x3663a9){return _0x3663a9[_0xcd7f('0x158')]['indexOf'](_0xcd7f('0x15a'))>=0x0;})[_0xcd7f('0xb1')](myreject(_0x3a0804)));}Promise[_0xcd7f('0x15b')](_0x765a6e)[_0xcd7f('0x42')](function(_0x578877){var _0x28382e=_['some'](_0x578877);if(_0x28382e){return _0x5a3ad0(_0x28382e);}else{_0x1a8368['message']=_0x496e05?_0xcd7f('0x15c'):_0xcd7f('0x15d');return _0x3a0804(msgResponse('[ifTime][promiseAll]',_0xcd7f('0x14e'),_0xcd7f('0x15e')+_0x496e05+'\x20'+_0xbce4b7+_0xcd7f('0x15f')+util[_0xcd7f('0x9b')](_0x3b397d,{'showHidden':![],'depth':null})+_0xcd7f('0x160')+_0x2f600b));}})[_0xcd7f('0xb1')](function(_0x269099){return _0x3a0804(msgResponse(_0xcd7f('0x14c'),_0xcd7f('0x14e'),JSON[_0xcd7f('0x50')](_0x269099)));});});};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x161')]=function(_0x49aa7f){var _0x1b7c35=this;return function(){switch(_0x49aa7f[_0xcd7f('0x60')]){case'progressive':freeVariablesPredictive(_0x49aa7f);_0x1b7c35[_0xcd7f('0x162')](_0x49aa7f,0x1);break;case _0xcd7f('0x163'):freeVariablesPredictive(_0x49aa7f);_0x1b7c35[_0xcd7f('0x162')](_0x49aa7f,_0x49aa7f[_0xcd7f('0x164')]);break;case _0xcd7f('0x9'):_0x1b7c35[_0xcd7f('0x9')](_0x49aa7f);break;case _0xcd7f('0x7'):freeVariablesPredictive(_0x49aa7f);_0x1b7c35[_0xcd7f('0x162')](_0x49aa7f,0x1);break;default:freeVariablesPredictive(_0x49aa7f);logger[_0xcd7f('0x9c')](_0xcd7f('0x165'),_0x49aa7f[_0xcd7f('0x47')],_0xcd7f('0x166'));}};};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x167')]=function(_0x37d8ad){return Promise[_0xcd7f('0xb5')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x37d8ad['id'],previewRecallmeReminderInterval))[_0xcd7f('0x42')](function(_0x3501d1){for(var _0x569738=0x0;_0x569738<_0x3501d1[_0xcd7f('0x9d')];_0x569738++){var _0x7b6024=_0x3501d1[_0x569738]['Agent'][_0xcd7f('0x47')];if(_0x7b6024)io['to'](util[_0xcd7f('0x7e')](_0xcd7f('0x168'),_0x7b6024))[_0xcd7f('0xea')](_0xcd7f('0x169'),{'hopper':_0x3501d1[_0x569738]});}})[_0xcd7f('0xb1')](function(){});};Dialer['prototype'][_0xcd7f('0x16a')]=function(_0x534866){var _0x17fe27=this;return function(){_0x17fe27[_0xcd7f('0x16b')](_0x534866);};};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xb')]=function(_0x453fcd){var _0x4f9f6c=this;if(isNotPreview(_0x453fcd[_0xcd7f('0x60')])){if(isVoiceQueueOutbound(_0x453fcd['type'])&&isActive(_0x453fcd[_0xcd7f('0x5f')])){_0x453fcd[_0xcd7f('0xa2')]=!![];Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](checkIsLoggedIn(_0x453fcd,_0x453fcd['loggedIn']))['then'](checkIsActive(_0x453fcd,_0x453fcd[_0xcd7f('0x5f')]))[_0xcd7f('0x42')](checkInterval(_0x453fcd))['then'](_0x4f9f6c[_0xcd7f('0x148')](_0x453fcd))[_0xcd7f('0x42')](_0x4f9f6c[_0xcd7f('0x14b')](_0x453fcd['dialGlobalInterval'],_0x453fcd[_0xcd7f('0x16c')],_0x453fcd['name'],_0x453fcd))[_0xcd7f('0x42')](_0x4f9f6c[_0xcd7f('0x14d')](_0x453fcd['Interval'],_0x453fcd[_0xcd7f('0x16c')],_0x453fcd[_0xcd7f('0x47')],_0x453fcd))[_0xcd7f('0x42')](_0x4f9f6c[_0xcd7f('0x161')](_0x453fcd))[_0xcd7f('0xb1')](loggerCatchQueueSummary(_0xcd7f('0x16d'),_0x453fcd));}else{notSendMessagesQueue(_0x453fcd);}}else{freeVariablesPredictive(_0x453fcd);}};Dialer[_0xcd7f('0xaa')]['syncQueueSummaryComplete']=_[_0xcd7f('0x16e')](function(){var _0x119ddc=_[_0xcd7f('0x16f')](this['voiceQueues'],function(_0x16e339){return _0x16e339[_0xcd7f('0x170')];});var _0xcca381=_[_0xcd7f('0x16f')](this[_0xcd7f('0x22')],function(_0x247dcb){return _0x247dcb[_0xcd7f('0x171')]&&_0x247dcb[_0xcd7f('0xb0')]===_0xcd7f('0xdd');});if(_0x119ddc[_0xcd7f('0x9d')]>0x0&&_0xcca381[_0xcd7f('0x9d')]>0x0){return Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](cmHopper[_0xcd7f('0x172')](_[_0xcd7f('0x173')](_0x119ddc,'id'),previewRecallmeReminderInterval,_[_0xcd7f('0x173')](_0xcca381,'id')))[_0xcd7f('0x42')](function(_0x7ac23c){for(var _0x3842d3=0x0;_0x3842d3<_0x7ac23c[_0xcd7f('0x9d')];_0x3842d3++){var _0x1897d5=_0x7ac23c[_0x3842d3][_0xcd7f('0x174')][_0xcd7f('0x47')];if(_0x1897d5)io['to'](util['format'](_0xcd7f('0x168'),_0x1897d5))[_0xcd7f('0xea')](_0xcd7f('0x169'),{'hopper':_0x7ac23c[_0x3842d3]});}})['catch'](function(_0x107040){logger[_0xcd7f('0x9c')]('checkPreviewRecallReminder',_0x107040);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xcd7f('0x147')]=function(){var _0xad5376=this;var _0x56a650;for(var _0x526953 in this['campaigns']){if(typeof this[_0xcd7f('0x21')][_0x526953]!=='undefined'){_0x56a650=this['campaigns'][_0x526953];if(isCampaignIvr(_0x56a650[_0xcd7f('0x53')])&&isActive(_0x56a650['active'])){_0x56a650[_0xcd7f('0xa2')]=!![];Promise[_0xcd7f('0xb5')]()[_0xcd7f('0x42')](checkIsActive(_0x56a650,_0x56a650[_0xcd7f('0x7c')]))[_0xcd7f('0x42')](checkInterval(_0x56a650))[_0xcd7f('0x42')](_0xad5376[_0xcd7f('0x148')](_0x56a650))[_0xcd7f('0x42')](_0xad5376[_0xcd7f('0x14b')](_0x56a650[_0xcd7f('0x175')],_0x56a650[_0xcd7f('0x16c')],_0x56a650['name'],_0x56a650))[_0xcd7f('0x42')](_0xad5376['checkIfTimeIntervals'](_0x56a650[_0xcd7f('0x4b')],_0x56a650[_0xcd7f('0x16c')],_0x56a650[_0xcd7f('0x47')],_0x56a650))[_0xcd7f('0x42')](_0xad5376[_0xcd7f('0x16a')](_0x56a650))[_0xcd7f('0xb1')](loggerCatchQueueSummary(_0xcd7f('0x176'),_0x56a650));}else{notSendMessagesCampaign(_0x56a650);}}}};function getCallerIdRandom(_0x242069,_0xa8bc6d){var _0xf17043;var _0x34a4a4;var _0x3c14c9;if(_0xa8bc6d<=0x0){_0xa8bc6d=0x1;}_0xf17043=new RegExp('\x5cw{0,'+_0xa8bc6d+'}$');_0x34a4a4=Math['pow'](0xa,_0xa8bc6d-0x1);_0x3c14c9=Math[_0xcd7f('0x177')](0xa,_0xa8bc6d)-0x1;return util[_0xcd7f('0x7e')]('%s',_['replace'](_0x242069,_0xf17043,_[_0xcd7f('0x178')](_0x34a4a4,_0x3c14c9)));}function extractCalleridName(_0x16c85b){var _0x3bb081=_0x16c85b[_0xcd7f('0x179')](/"(.*?)"/);return _0x3bb081?_0x3bb081[0x1]:_0x16c85b;}Dialer[_0xcd7f('0xaa')][_0xcd7f('0x17a')]=function(_0x10b0ca,_0x5a2111){var _0x13137c=this;var _0x1109a1=uuid['v4']();this[_0xcd7f('0x26')][_0x1109a1]=new Action(_0x10b0ca,_0x5a2111,_0x1109a1);return new Promise(function(_0x2ed707,_0x25dd59){if(_[_0xcd7f('0x44')](_0x10b0ca)&&typeof _0x10b0ca!==_0xcd7f('0x17b')){return _0x25dd59(msgResponse(_0xcd7f('0x17c'),_0xcd7f('0x14e'),_0xcd7f('0x17d')));}if(_[_0xcd7f('0x44')](_0x5a2111[_0xcd7f('0x17e')])||_0x5a2111[_0xcd7f('0x17e')]===null){return _0x25dd59(msgResponse(_0xcd7f('0x17c'),_0xcd7f('0x14e'),_0xcd7f('0x17f')));}var _0x48a63e={'XMD-CALLERID':_0x13137c['actions'][_0x1109a1][_0xcd7f('0x180')](),'XMD-AGI':_0x10b0ca[_0xcd7f('0x10c')]?util['format'](_0xcd7f('0x181'),ipAgi,_0x10b0ca[_0xcd7f('0x10c')]):_0xcd7f('0x182'),'XMD-AGIAFTER':_0x10b0ca['dialQueueProject2']?util[_0xcd7f('0x7e')](_0xcd7f('0x181'),ipAgi,_0x10b0ca[_0xcd7f('0x112')]):_0xcd7f('0x182'),'XMD-QUEUE':_0x10b0ca['type']===_0xcd7f('0x183')?util['format'](_0xcd7f('0x184'),_0x10b0ca[_0xcd7f('0x47')],_0x10b0ca[_0xcd7f('0x185')]||'',_0x10b0ca[_0xcd7f('0x113')]?'c':'',_0x10b0ca[_0xcd7f('0x186')]||0x3):_0xcd7f('0x182'),'XMD-CONTACTID':_0x5a2111[_0xcd7f('0x101')],'XMD-CDRTYPE':_0xcd7f('0x6'),'CALLERID(all)':_0x13137c['actions'][_0x1109a1][_0xcd7f('0x180')](),'XMD-AMD':_0x10b0ca[_0xcd7f('0xe5')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xcd7f('0xe4')};if(_0x10b0ca['dialAMDActive']){_0x48a63e['XMD-AMDINITIALSILENCE']=_0x10b0ca[_0xcd7f('0x187')]||0x9c4;_0x48a63e['XMD-AMDGREETING']=_0x10b0ca[_0xcd7f('0x188')]||0x5dc;_0x48a63e[_0xcd7f('0x189')]=_0x10b0ca[_0xcd7f('0x18a')]||0x320;_0x48a63e[_0xcd7f('0x18b')]=_0x10b0ca[_0xcd7f('0x18c')]||0x1388;_0x48a63e['XMD-AMDMINWORDLENGTH']=_0x10b0ca[_0xcd7f('0x18d')]||0x64;_0x48a63e[_0xcd7f('0x18e')]=_0x10b0ca[_0xcd7f('0x18f')]||0x32;_0x48a63e['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x10b0ca[_0xcd7f('0x190')]||0x3;_0x48a63e[_0xcd7f('0x191')]=_0x10b0ca[_0xcd7f('0x192')]||0x100;_0x48a63e['XMD-AMDMAXIMUMWORDLENGTH']=_0x10b0ca[_0xcd7f('0x193')]||0x1388;}if(_0x10b0ca[_0xcd7f('0x53')]==='outbound'){_0x48a63e[_0xcd7f('0x194')]=_0x5a2111[_0xcd7f('0xd5')];}else{_0x48a63e[_0xcd7f('0x195')]=_0x5a2111[_0xcd7f('0xd6')];}for(var _0x17d0b9 in _0x5a2111[_0xcd7f('0x196')]){if(typeof _0x5a2111['Contact'][_0x17d0b9]!==_0xcd7f('0xad')){if(isNotNull(_0x5a2111['Contact'][_0x17d0b9])&&_0x17d0b9!=='id'&&_0x17d0b9!==_0xcd7f('0x197')&&_0x17d0b9!==_0xcd7f('0x198')&&_0x17d0b9!==_0xcd7f('0x199')){_0x48a63e[util['format']('%s%s',_0xcd7f('0x19a'),_[_0xcd7f('0x19b')](_0x17d0b9))]=_0x5a2111[_0xcd7f('0x196')][_0x17d0b9];}}}var _0x4cd86c=_0x13137c['isTrunkReachable'](_0x10b0ca[_0xcd7f('0x7b')])?getCallerId(_0x10b0ca[_0xcd7f('0x7b')][_0xcd7f('0x7d')],_0x10b0ca['dialOriginateCallerIdName'],_0x10b0ca[_0xcd7f('0x19c')]>0x0?getCallerIdRandom(_0x10b0ca[_0xcd7f('0x19d')],_0x10b0ca[_0xcd7f('0x19c')]):_0x10b0ca['dialOriginateCallerIdNumber']):getCallerId(_[_0xcd7f('0xae')](_0x10b0ca[_0xcd7f('0x19e')])?_0x10b0ca[_0xcd7f('0x7b')][_0xcd7f('0x7d')]:_0x10b0ca['TrunkBackup']['callerid'],_0x10b0ca[_0xcd7f('0x61')],_0x10b0ca[_0xcd7f('0x19c')]>0x0?getCallerIdRandom(_0x10b0ca[_0xcd7f('0x19d')],_0x10b0ca[_0xcd7f('0x19c')]):_0x10b0ca['dialOriginateCallerIdNumber']);if(_0x4cd86c){_0x48a63e[_0xcd7f('0x19f')]=_0x13137c[_0xcd7f('0x26')][_0x1109a1]['originatecalleridname']=extractCalleridName(_0x4cd86c);_0x48a63e[_0xcd7f('0x1a0')]=_0x5a2111[_0xcd7f('0x17e')];}_0x10b0ca[_0xcd7f('0x1a1')]=_0x48a63e;return ami[_0xcd7f('0xaf')]({'actionid':_0x1109a1,'action':_0xcd7f('0x17c'),'channel':_0x13137c['isTrunkReachable'](_0x10b0ca[_0xcd7f('0x7b')])?util[_0xcd7f('0x7e')]('SIP/%s/%s%s',_0x10b0ca[_0xcd7f('0x7b')][_0xcd7f('0x47')],isNotNull(_0x10b0ca[_0xcd7f('0x62')])?_0x10b0ca[_0xcd7f('0x62')][_0xcd7f('0x1a2')]()||'':'',_0x10b0ca[_0xcd7f('0x1a3')]>0x0?_0x5a2111['phone'][_0xcd7f('0x1a4')](_0x10b0ca[_0xcd7f('0x1a3')]):_0x5a2111[_0xcd7f('0x17e')]):util[_0xcd7f('0x7e')]('SIP/%s/%s%s',_['isNil'](_0x10b0ca[_0xcd7f('0x19e')])?_0x10b0ca['Trunk'][_0xcd7f('0x47')]:_0x10b0ca[_0xcd7f('0x19e')]['name'],isNotNull(_0x10b0ca[_0xcd7f('0x62')])?_0x10b0ca[_0xcd7f('0x62')]['trim']()||'':'',_0x10b0ca[_0xcd7f('0x1a3')]>0x0?_0x5a2111[_0xcd7f('0x17e')]['substring'](_0x10b0ca[_0xcd7f('0x1a3')]):_0x5a2111[_0xcd7f('0x17e')]),'callerid':_0x4cd86c,'Exten':_0xcd7f('0xe4'),'Context':_0xcd7f('0x1a5'),'Priority':'1','variable':_0x48a63e,'timeout':(_0x10b0ca[_0xcd7f('0x1a6')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1109a1})[_0xcd7f('0x42')](function(_0x48ac24){return _0x2ed707(_0x48ac24);})[_0xcd7f('0xb1')](function(_0x583f32){_0x10b0ca[_0xcd7f('0x1a7')]+=0x1;var _0x1a3ef2=new History(_0x13137c[_0xcd7f('0x26')][_0x1109a1]);logger[_0xcd7f('0x9c')](util[_0xcd7f('0x7e')](_0xcd7f('0x1a8'),JSON['stringify'](_0x583f32)));_0x1a3ef2[_0xcd7f('0xa6')]=0xe;_0x1a3ef2[_0xcd7f('0xa7')]=_0xcd7f('0x1a9');_0x1a3ef2[_0xcd7f('0xa9')]=moment()[_0xcd7f('0x7e')](_0xcd7f('0x100'));_0x1a3ef2[_0xcd7f('0xa8')]=_0x1a3ef2[_0xcd7f('0xa9')];_0x13137c[_0xcd7f('0xcd')](_0x1a3ef2)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1aa')));_0x13137c[_0xcd7f('0xcb')](_0x1a3ef2)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1aa')))['finally'](function(){delete _0x13137c[_0xcd7f('0x26')][_0x1109a1];return _0x25dd59(msgResponse(_0xcd7f('0x17c'),'Error',_0xcd7f('0x1ab')));});});});};Dialer[_0xcd7f('0xaa')]['syncOriginateResponse']=function(_0x469ce3){var _0x4deb6b=this['actions'][_0x469ce3[_0xcd7f('0x12f')]];if(_0x4deb6b){delete this[_0xcd7f('0x26')][_0x469ce3[_0xcd7f('0x12f')]];_0x4deb6b['responsetime']=moment()[_0xcd7f('0x7e')](_0xcd7f('0x100'));var _0x267c34=_0x4deb6b[_0xcd7f('0x53')]===_0xcd7f('0x80')?this[_0xcd7f('0x21')][_0x4deb6b['queue']]:this[_0xcd7f('0x20')][_0x4deb6b[_0xcd7f('0x1ac')]()];if(!this[_0xcd7f('0xd9')](_0x469ce3[_0xcd7f('0x1ad')])){this[_0xcd7f('0xb2')](_0x267c34);return this[_0xcd7f('0x1ae')](_0x4deb6b,_0x267c34,_0x469ce3)[_0xcd7f('0xb1')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xcd7f('0x28')][_0x469ce3['uniqueid']]=_0x4deb6b;}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x1af')]=function(_0x2b76c0,_0x151ac5,_0x43d67c){var _0x16552c=new History(_0x151ac5);if(_0x16552c['countbusyretry']+_0x16552c[_0xcd7f('0xf5')]+_0x16552c[_0xcd7f('0x106')]+_0x16552c[_0xcd7f('0x107')]+_0x16552c['countdropretry']+_0x16552c[_0xcd7f('0xf7')]+_0x16552c[_0xcd7f('0xf1')]+_0x16552c['countagentrejectretry']>=_0x43d67c[_0xcd7f('0xf9')]-0x1){return!![];}switch(_0x2b76c0){case 0x3:if(_0x16552c[_0xcd7f('0x106')]>=_0x43d67c[_0xcd7f('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x16552c[_0xcd7f('0x106')]+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c['dialNoAnswerRetryFrequency'],'minutes')[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c['ListId'],'VoiceQueueId':_0x16552c[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x16552c[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1b1')));break;case 0x5:if(_0x16552c[_0xcd7f('0xf4')]>=_0x43d67c['dialBusyMaxRetry']-0x1){return!![];}this[_0xcd7f('0xc1')]({'active':![],'countbusyretry':_0x16552c['countbusyretry']+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c['dialBusyRetryFrequency'],_0xcd7f('0xff'))['format'](_0xcd7f('0x100')),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c[_0xcd7f('0xd3')],'VoiceQueueId':_0x16552c[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x16552c[_0xcd7f('0xd6')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x16552c[_0xcd7f('0xf5')]>=_0x43d67c[_0xcd7f('0x1b2')]-0x1){return!![];}this[_0xcd7f('0xc1')]({'active':![],'countcongestionretry':_0x16552c[_0xcd7f('0xf5')]+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c['dialCongestionRetryFrequency'],_0xcd7f('0xff'))[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c['ListId'],'VoiceQueueId':_0x16552c[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x16552c[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1b3')));break;case 0x0:if(_0x16552c[_0xcd7f('0x107')]>=_0x43d67c[_0xcd7f('0x1b4')]-0x1){return!![];}else{this[_0xcd7f('0xc1')]({'active':![],'countnosuchnumberretry':_0x16552c[_0xcd7f('0x107')]+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c['dialNoSuchNumberRetryFrequency'],_0xcd7f('0xff'))[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c[_0xcd7f('0xd3')],'VoiceQueueId':_0x16552c[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x16552c[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1b5')));}break;case 0xa:if(_0x16552c[_0xcd7f('0xf6')]>=_0x43d67c[_0xcd7f('0x122')]-0x1){return!![];}this[_0xcd7f('0xc1')]({'active':![],'countdropretry':_0x16552c[_0xcd7f('0xf6')]+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c[_0xcd7f('0x11e')],'minutes')[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c[_0xcd7f('0xd3')],'VoiceQueueId':_0x16552c[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x16552c[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x123')));break;case 0xb:if(_0x16552c['countabandonedretry']>=_0x43d67c[_0xcd7f('0x12a')]-0x1){return!![];}this[_0xcd7f('0xc1')]({'active':![],'countabandonedretry':_0x16552c[_0xcd7f('0xf7')]+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c['dialAbandonedRetryFrequency'],_0xcd7f('0xff'))[_0xcd7f('0x7e')](_0xcd7f('0x100')),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c[_0xcd7f('0xd3')],'VoiceQueueId':_0x16552c[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x16552c['CampaignId']||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x12b')));break;case 0x13:if(_0x16552c[_0xcd7f('0xf1')]>=_0x43d67c[_0xcd7f('0x108')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x16552c['countmachineretry']+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c[_0xcd7f('0x109')],_0xcd7f('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c[_0xcd7f('0xd3')],'VoiceQueueId':_0x16552c[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x16552c[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x102')));break;case 0x14:if(_0x16552c[_0xcd7f('0xf8')]>=_0x43d67c['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xcd7f('0xc1')]({'active':![],'countagentrejectretry':_0x16552c['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xcd7f('0xfe')](_0x43d67c[_0xcd7f('0x1b6')],'minutes')['format'](_0xcd7f('0x100')),'ContactId':_0x16552c[_0xcd7f('0x101')],'ListId':_0x16552c[_0xcd7f('0xd3')],'VoiceQueueId':_0x16552c['VoiceQueueId']||undefined,'CampaignId':_0x16552c[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xcd7f('0x1ae')]=function(_0x388bfd,_0x8bf36f,_0x28f5a8){var _0x30a166=this;var _0x30f89d=new History(_0x388bfd);var _0x257f98=![];var _0x1ebf28;var _0x58b12b;return new Promise(function(_0x2a562b,_0x816854){if(_['isUndefined'](_0x8bf36f)&&typeof _0x8bf36f!==_0xcd7f('0x17b')){return _0x816854(msgResponse(_0xcd7f('0x1b7'),'Failure',_0xcd7f('0x1b8')));}if(_[_0xcd7f('0x44')](_0x28f5a8)&&typeof _0x28f5a8!==_0xcd7f('0x17b')){return _0x816854(msgResponse(_0xcd7f('0x1b7'),_0xcd7f('0x14e'),'evt\x20is\x20undefine'));}_0x30a166[_0xcd7f('0xb9')](_0x30f89d,_0x28f5a8[_0xcd7f('0x1b9')],_0x8bf36f)[_0xcd7f('0x42')](function(_0x2bec1f){if(_0x2bec1f['additional']==0x1)_0x257f98=!![];switch(_0x28f5a8[_0xcd7f('0x1b9')]){case'0':_0x8bf36f[_0xcd7f('0x68')]+=0x1;_0x30f89d['state']=0x0;_0x30f89d['statedesc']=_0xcd7f('0x1ba');_0x30f89d[_0xcd7f('0x107')]+=0x1;_0x30f89d['countglobal']+=0x1;ami['emit'](_0xcd7f('0x1bb'),ut[_0xcd7f('0xec')](_0x388bfd,_0xcd7f('0x1bc')));_0x1ebf28=_0x8bf36f[_0xcd7f('0x1bd')];_0x58b12b=_0x8bf36f[_0xcd7f('0x11f')];_0x30a166['createHistory'](_0x30f89d)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0xf3')));if(_0x30a166[_0xcd7f('0x1af')](0x0,_0x388bfd,_0x8bf36f)&&!_0x257f98){if(_0x30f89d[_0xcd7f('0x107')]>=_0x8bf36f[_0xcd7f('0x1b4')]){_0x30a166[_0xcd7f('0xfc')](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1be'));}else{_0x30a166[_0xcd7f('0xfa')](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1be'));}}break;case'3':_0x8bf36f[_0xcd7f('0x67')]+=0x1;_0x30f89d[_0xcd7f('0xa6')]=0x3;_0x30f89d[_0xcd7f('0xa7')]=_0xcd7f('0x1bf');_0x30f89d[_0xcd7f('0x106')]+=0x1;_0x30f89d[_0xcd7f('0xf2')]+=0x1;var _0x1a92b5=ut[_0xcd7f('0x1c0')](_0x388bfd,_0x8bf36f);ami[_0xcd7f('0xea')]('custom:agentnoanswer',_0x1a92b5);_0x1ebf28=_0x8bf36f[_0xcd7f('0x1c1')];_0x58b12b=_0x8bf36f['callAdditionalPhoneAfterMin'];_0x30a166[_0xcd7f('0xcd')](_0x30f89d)['catch'](loggerCatch(_0xcd7f('0x1c2')));if(_0x30a166[_0xcd7f('0x1af')](0x3,_0x388bfd,_0x8bf36f)&&!_0x257f98){if(_0x30f89d[_0xcd7f('0x106')]>=_0x8bf36f[_0xcd7f('0x1b0')]){_0x30a166['createStateFinal'](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1c3'));}else{_0x30a166[_0xcd7f('0xfa')](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1c3'));}}break;case'5':_0x8bf36f[_0xcd7f('0x1c4')]+=0x1;_0x30f89d[_0xcd7f('0xa6')]=0x5;_0x30f89d[_0xcd7f('0xa7')]=_0xcd7f('0x1c5');_0x30f89d[_0xcd7f('0xf4')]+=0x1;_0x30f89d[_0xcd7f('0xf2')]+=0x1;ami['emit'](_0xcd7f('0x1c6'),ut[_0xcd7f('0xec')](_0x388bfd,'busy'));_0x1ebf28=_0x8bf36f['dialBusyRetryFrequency'];_0x58b12b=_0x8bf36f[_0xcd7f('0x11f')];_0x30a166[_0xcd7f('0xcd')](_0x30f89d)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1c7')));if(_0x30a166[_0xcd7f('0x1af')](0x5,_0x388bfd,_0x8bf36f)&&!_0x257f98){if(_0x30f89d['countbusyretry']>=_0x8bf36f[_0xcd7f('0x1c8')]){_0x30a166['createStateFinal'](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1c9'));}else{_0x30a166[_0xcd7f('0xfa')](_0x30f89d,_0x2a562b,_0x816854,'reason\x205\x20busy');}}break;case'8':_0x8bf36f['outboundCongestionCallsDay']+=0x1;_0x30f89d[_0xcd7f('0xa6')]=0x8;_0x30f89d[_0xcd7f('0xa7')]=_0xcd7f('0x1ca');_0x30f89d['countcongestionretry']+=0x1;_0x30f89d[_0xcd7f('0xf2')]+=0x1;_0x1ebf28=_0x8bf36f['dialCongestionRetryFrequency'];_0x58b12b=_0x8bf36f[_0xcd7f('0x11f')];ami[_0xcd7f('0xea')](_0xcd7f('0x1cb'),ut['buildObj'](_0x388bfd,'congestion'));_0x30a166[_0xcd7f('0xcd')](_0x30f89d)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1cc')));if(_0x30a166[_0xcd7f('0x1af')](0x8,_0x388bfd,_0x8bf36f)&&!_0x257f98){if(_0x30f89d[_0xcd7f('0xf5')]>=_0x8bf36f[_0xcd7f('0x1b2')]){_0x30a166[_0xcd7f('0xfc')](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1cd'));}else{_0x30a166[_0xcd7f('0xfa')](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1cd'));}}break;case'11':_0x8bf36f[_0xcd7f('0x1ce')]+=0x1;_0x30f89d[_0xcd7f('0xa6')]=0xb;_0x30f89d[_0xcd7f('0xa7')]=_0xcd7f('0x12c');_0x30f89d['countabandonedretry']+=0x1;_0x30f89d['countglobal']+=0x1;_0x1ebf28=_0x8bf36f[_0xcd7f('0x129')];_0x58b12b=_0x8bf36f[_0xcd7f('0x11f')];_0x30a166[_0xcd7f('0xcd')](_0x30f89d)['catch'](loggerCatch(_0xcd7f('0x12d')));if(_0x30a166['checkRetriveMax'](0xb,_0x388bfd,_0x8bf36f)&&!_0x257f98){if(_0x30f89d[_0xcd7f('0xf7')]>=_0x8bf36f[_0xcd7f('0x12a')]){_0x30a166[_0xcd7f('0xfc')](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1cf'));}else{_0x30a166['stateGlobal'](_0x30f89d,_0x2a562b,_0x816854,'reason\x2011\x20abandoned');}}break;case'20':_0x8bf36f[_0xcd7f('0x6a')]+=0x1;_0x30f89d['state']=0x14;_0x30f89d[_0xcd7f('0xa7')]=_0xcd7f('0x1d0');_0x30f89d['countagentrejectretry']+=0x1;_0x30f89d['countglobal']+=0x1;_0x1ebf28=_0x8bf36f[_0xcd7f('0x1b6')];_0x58b12b=_0x8bf36f[_0xcd7f('0x11f')];ami[_0xcd7f('0xea')]('custom:agentreject',ut[_0xcd7f('0xec')](_0x388bfd,_0xcd7f('0x1d1')));_0x30a166[_0xcd7f('0xcd')](_0x30f89d)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1d2')));if(_0x30a166[_0xcd7f('0x1af')](0x14,_0x388bfd,_0x8bf36f)&&!_0x257f98){if(_0x30f89d[_0xcd7f('0xf8')]>=_0x8bf36f['dialAgentRejectMaxRetry']){_0x30a166[_0xcd7f('0xfc')](_0x30f89d,_0x2a562b,_0x816854,_0xcd7f('0x1d3'));}else{_0x30a166[_0xcd7f('0xfa')](_0x30f89d,_0x2a562b,_0x816854,'reason\x2020\x20agentreject');}}break;default:_0x8bf36f[_0xcd7f('0x10f')]+=0x1;_0x30f89d['state']=0xc;_0x30f89d[_0xcd7f('0xa7')]=_0x28f5a8[_0xcd7f('0x1b9')];_0x1ebf28=_0x8bf36f[_0xcd7f('0x1b6')];_0x58b12b=_0x8bf36f[_0xcd7f('0x11f')];_0x30a166[_0xcd7f('0xcd')](_0x30f89d)[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1d4')));if(_0x30a166[_0xcd7f('0x1af')](_0x28f5a8[_0xcd7f('0x1b9')],_0x388bfd,_0x8bf36f)&&!_0x257f98){if(_0x30f89d[_0xcd7f('0xf4')]+_0x30f89d[_0xcd7f('0xf5')]+_0x30f89d['countnoanswerretry']+_0x30f89d[_0xcd7f('0x107')]+_0x30f89d[_0xcd7f('0xf6')]+_0x30f89d[_0xcd7f('0xf7')]+_0x30f89d[_0xcd7f('0xf1')]+_0x30f89d[_0xcd7f('0xf8')]>=_0x8bf36f[_0xcd7f('0xf9')]){_0x30a166[_0xcd7f('0xfa')](_0x30f89d,_0x2a562b,_0x816854,_0x28f5a8[_0xcd7f('0x1b9')]);}else{_0x30a166[_0xcd7f('0xfc')](_0x30f89d,_0x2a562b,_0x816854,_0x28f5a8[_0xcd7f('0x1b9')]);}}}})['then'](function(){if(_0x257f98){_0x30a166[_0xcd7f('0xbb')](_0x30f89d,_0x1ebf28,_0x58b12b)[_0xcd7f('0x42')](function(){return _0x2a562b(0x1);});}});});};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xfa')]=function(_0xd103fa,_0x224c05,_0x33f387,_0x14367e){var _0x2a2e4e=new Final(_0xd103fa);_0x2a2e4e[_0xcd7f('0xa6')]=0xf;_0x2a2e4e[_0xcd7f('0xa7')]=_0xcd7f('0x1d5');this[_0xcd7f('0xfc')](_0x2a2e4e,_0x224c05,_0x33f387,_0x14367e);};Dialer[_0xcd7f('0xaa')][_0xcd7f('0xfc')]=function(_0xb5ac78,_0x39f8ff,_0x5d8dba,_0x465926){this[_0xcd7f('0xcb')](_0xb5ac78)[_0xcd7f('0x42')](function(){return _0x39f8ff(msgResponse(_0xcd7f('0x1b7'),'Success',_0x465926));})[_0xcd7f('0xb1')](function(){return _0x5d8dba(msgResponse(_0xcd7f('0x1d6'),_0xcd7f('0x14e'),_0xcd7f('0x1d7')));});};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x9')]=function(_0x25e2c5){var _0x19bb39=_0x25e2c5[_0xcd7f('0x1d8')]/0x64;var _0x6cec86=_0x25e2c5[_0xcd7f('0x66')]/(_0x25e2c5[_0xcd7f('0x66')]+_0x25e2c5[_0xcd7f('0x63')]);var _0xb40da8=Math['round'](_0x25e2c5['predictiveIntervalAvailable']*(_0x25e2c5['predictiveIntervalMaxThreshold']/0x64));var _0x1e891b=Math[_0xcd7f('0x1d9')](_0x25e2c5[_0xcd7f('0x1da')]*(_0x25e2c5[_0xcd7f('0x1db')]/0x64));var _0x213d16=_0x25e2c5['available']+_0x25e2c5[_0xcd7f('0x5a')];var _0x115784=Math[_0xcd7f('0x1dc')](_0x25e2c5['erlangCalls']*_0x25e2c5[_0xcd7f('0x79')]*_0x25e2c5['predictiveIntervalHitRate']*_0x25e2c5[_0xcd7f('0x73')]);if(_[_0xcd7f('0x44')](_0x25e2c5[_0xcd7f('0x2b')])){if(!_['isUndefined'](_0x25e2c5[_0xcd7f('0x2a')])){_0x25e2c5[_0xcd7f('0x2a')]=undefined;loggerPredictive[_0xcd7f('0x9c')]('[startMethodPredictive][StartProgressive]',_0xcd7f('0x1dd'));}if(!_[_0xcd7f('0x44')](_0x25e2c5[_0xcd7f('0x94')])){loggerPredictive[_0xcd7f('0x9c')]('[startMethodPredictive][StartProgressive]',_0xcd7f('0x1de'));clearInterval(_0x25e2c5[_0xcd7f('0x94')]);_0x25e2c5['handlePredictive']=undefined;}_0x25e2c5[_0xcd7f('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xcd7f('0x86')](_0x25e2c5[_0xcd7f('0x47')],'collection\x20data\x20in\x20progressive\x20at',_0x25e2c5[_0xcd7f('0x2b')]);this['handlePower'](_0x25e2c5,0x1);}else if(ifInterval(_0x25e2c5[_0xcd7f('0x1df')],_0x25e2c5[_0xcd7f('0x2b')])){this[_0xcd7f('0x162')](_0x25e2c5,0x1);loggerPredictiveCalls[_0xcd7f('0x86')](_0xcd7f('0x1e0'),_0x25e2c5[_0xcd7f('0x2b')],_0x25e2c5[_0xcd7f('0x47')]);_0x25e2c5[_0xcd7f('0x77')]=0x0;_0x25e2c5['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x19bb39<_0x6cec86&&_0x25e2c5['dialPredictiveOptimization']===_0xcd7f('0x1e1')){freeVariablesPredictive(_0x25e2c5);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x1e2'),_0xcd7f('0x1e3'),_0x6cec86,_0xcd7f('0x2b'),_0x25e2c5[_0xcd7f('0x47')]);}else if(_0x115784<_0x25e2c5[_0xcd7f('0x71')]&&_0x25e2c5[_0xcd7f('0x1e4')]===_0xcd7f('0x1e1')){freeVariablesPredictive(_0x25e2c5);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xcd7f('0x1e5'),_0x115784,_0xcd7f('0x1e6'),_0x25e2c5['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x25e2c5[_0xcd7f('0x47')]);}else if(!ifInterval(_0x25e2c5[_0xcd7f('0x1df')],_0x25e2c5[_0xcd7f('0x2b')])&&_[_0xcd7f('0x44')](_0x25e2c5[_0xcd7f('0x2a')])&&!_[_0xcd7f('0x44')](_0x25e2c5['startProgressive'])){_0x25e2c5[_0xcd7f('0x2a')]=moment()['format'](_0xcd7f('0x100'));loggerPredictive['info'](_0x25e2c5['name'],_0xcd7f('0x1e7'),_0x25e2c5['startPredictive']);this['averageHandleTime'](_0x25e2c5[_0xcd7f('0x1df')])[_0xcd7f('0x42')](this[_0xcd7f('0x1e8')](_0x25e2c5))[_0xcd7f('0x42')](mergeDataErlangB(_0x25e2c5))['then'](this[_0xcd7f('0x1e9')](_0x25e2c5))[_0xcd7f('0xb1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x25e2c5));}else if(!ifInterval(_0x25e2c5[_0xcd7f('0x1df')],_0x25e2c5[_0xcd7f('0x2a')])){_0x25e2c5[_0xcd7f('0x71')]=0x0;_0x25e2c5['startPredictive']=moment()[_0xcd7f('0x7e')](_0xcd7f('0x100'));loggerPredictive['info'](_0x25e2c5[_0xcd7f('0x47')],_0xcd7f('0x1ea'),_0x25e2c5[_0xcd7f('0x2a')]);clearInterval(_0x25e2c5[_0xcd7f('0x94')]);_0x25e2c5[_0xcd7f('0x94')]=undefined;this[_0xcd7f('0xbe')](_0x25e2c5[_0xcd7f('0x1df')])[_0xcd7f('0x42')](this[_0xcd7f('0x1e8')](_0x25e2c5))[_0xcd7f('0x42')](mergeDataErlangB(_0x25e2c5))[_0xcd7f('0x42')](this[_0xcd7f('0x1e9')](_0x25e2c5))[_0xcd7f('0xb1')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x25e2c5));}else if(_0x25e2c5[_0xcd7f('0x1da')]&&_0x213d16<_0x25e2c5[_0xcd7f('0x1da')]-_0x1e891b){freeVariablesPredictive(_0x25e2c5);loggerPredictive[_0xcd7f('0x86')](_0x25e2c5[_0xcd7f('0x47')],_0xcd7f('0x1eb'),_0x213d16,')\x20are\x20less\x20than\x20threshold\x20(',_0x25e2c5[_0xcd7f('0x1da')],'-',_0x1e891b,'=',_0x25e2c5[_0xcd7f('0x1da')]-_0x1e891b,')');}else if(_0x25e2c5[_0xcd7f('0x1da')]&&_0x213d16>_0x25e2c5[_0xcd7f('0x1da')]+_0xb40da8){freeVariablesPredictive(_0x25e2c5);loggerPredictive[_0xcd7f('0x86')](_0x25e2c5['name'],_0xcd7f('0x1eb'),_0x213d16,_0xcd7f('0x1ec'),_0x25e2c5[_0xcd7f('0x1da')],'+',_0xb40da8,'=',_0x25e2c5[_0xcd7f('0x1da')]+_0xb40da8,')');}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x1e8')]=function(_0x663952){var _0x287461=this;return function(_0x18db99){return new Promise(function(_0x4631ce,_0x570a7c){_[_0xcd7f('0x91')](_0x663952,_0x18db99[0x0]);if(checkGetDataPredictive(_0x18db99[0x0])){var _0x2c9d75=_0x663952[_0xcd7f('0x1da')]=_0x663952[_0xcd7f('0x5a')]+_0x663952[_0xcd7f('0x56')];var _0x446731=_0x663952[_0xcd7f('0x1df')]*0x3c;var _0x502f0e=_0x18db99[0x0][_0xcd7f('0x6d')]+_0x18db99[0x0][_0xcd7f('0x6c')];var _0x264f17=(_0x18db99[0x0][_0xcd7f('0x6b')]+_0x18db99[0x0][_0xcd7f('0x6f')]+_0x18db99[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x18db99[0x0][_0xcd7f('0x75')];_0x663952[_0xcd7f('0x72')]=_0x264f17>0x0?_0x264f17:0x1;switch(_0x663952[_0xcd7f('0x1e4')]){case'dropRate':var _0x1b8567=_0x663952['dialPredictiveOptimizationPercentage']/0x64;return _0x287461['abandonmentRate'](_0x2c9d75,_0x446731,_0x502f0e,_0x264f17,_0x1b8567)['then'](function(_0x889a07){return _0x4631ce(_0x889a07);});case _0xcd7f('0x1ed'):var _0x592a2f=_0x663952['dialPredictiveOptimizationPercentage']/0x64;return _0x287461[_0xcd7f('0x1ee')](_0x2c9d75,_0x446731,_0x502f0e,_0x264f17,_0x592a2f)['then'](function(_0x1200b8){return _0x4631ce(_0x1200b8);});default:return _0x570a7c(msgResponse(_0xcd7f('0x1ef'),_0xcd7f('0x14e'),'Unknown\x20Predictive'));}}else{return _0x570a7c(msgResponse(_0xcd7f('0x1ef'),_0xcd7f('0x14e'),'check\x20failure'));}});};};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x1f0')]=function(_0x889f5e){var _0x12ff46=this;return function(_0x1b3710){return new Promise(function(_0x33e0da,_0x54560d){_[_0xcd7f('0x91')](_0x889f5e,_0x1b3710[0x0]);if(checkGetDataPredictive(_0x1b3710[0x0])){loggerPredictive[_0xcd7f('0x86')](JSON[_0xcd7f('0x50')](_0x1b3710[0x0]));if(_0x889f5e[_0xcd7f('0x1e4')]===_0xcd7f('0x1e1')){return _0x12ff46['getVoiceQueueRtPauses'](_0x889f5e['id'])[_0xcd7f('0x42')](function(_0x22592b){var _0x3b04b1=_0x889f5e[_0xcd7f('0x1f1')]-_0x22592b[0x0][_0xcd7f('0x1f2')];var _0x292888=_0x889f5e[_0xcd7f('0x1df')]*0x3c;var _0x27d5f1=_0x1b3710[0x0][_0xcd7f('0x6d')]+_0x1b3710[0x0][_0xcd7f('0x6c')];var _0x219250=(_0x1b3710[0x0]['predictiveIntervalAnsweredCalls']+_0x1b3710[0x0][_0xcd7f('0x6f')]+_0x1b3710[0x0][_0xcd7f('0x6e')])/_0x1b3710[0x0]['predictiveIntervalTotalCalls'];var _0x544006=_0x889f5e['dialPredictiveOptimizationPercentage']/0x64;_0x889f5e['predictiveIntervalPauses']=_0x22592b[0x0][_0xcd7f('0x1f2')]||0x0;_0x889f5e[_0xcd7f('0x72')]=_0x219250>0x0?_0x219250:0x1;return _0x12ff46[_0xcd7f('0x1f3')](_0x3b04b1,_0x292888,_0x27d5f1,_0x219250,_0x544006);})['then'](function(_0x3f2007){return _0x33e0da(_0x3f2007);})[_0xcd7f('0xb1')](function(_0x2c2f89){return _0x54560d(msgResponse(_0xcd7f('0x1f4'),'Failure',JSON['stringify'](_0x2c2f89)));});}if(_0x889f5e[_0xcd7f('0x1e4')]===_0xcd7f('0x1ed')){return _0x12ff46[_0xcd7f('0xc9')](_0x889f5e['id'])[_0xcd7f('0x42')](function(_0x29146e){var _0x2e1fcc=_0x889f5e['loggedIn']-_0x29146e[0x0]['outboundQueuePauses'];var _0x5eb708=_0x889f5e[_0xcd7f('0x1df')]*0x3c;var _0x26a2d8=_0x1b3710[0x0][_0xcd7f('0x6d')]+_0x1b3710[0x0][_0xcd7f('0x6c')];var _0x43bc57=(_0x1b3710[0x0][_0xcd7f('0x6b')]+_0x1b3710[0x0][_0xcd7f('0x6f')]+_0x1b3710[0x0][_0xcd7f('0x6e')])/_0x1b3710[0x0]['predictiveIntervalTotalCalls'];var _0x43fcc3=_0x889f5e['dialPredictiveOptimizationPercentage']/0x64;_0x889f5e['predictiveIntervalPauses']=_0x29146e[0x0][_0xcd7f('0x1f2')]||0x0;_0x889f5e['predictiveIntervalHitRate']=_0x43bc57>0x0?_0x43bc57:0x1;return _0x12ff46[_0xcd7f('0x1ee')](_0x2e1fcc,_0x5eb708,_0x26a2d8,_0x43bc57,_0x43fcc3);})[_0xcd7f('0x42')](function(_0xd0dd13){return _0x33e0da(_0xd0dd13);})[_0xcd7f('0xb1')](function(_0x4f6c3e){return _0x54560d(msgResponse(_0xcd7f('0x1f4'),_0xcd7f('0x14e'),JSON[_0xcd7f('0x50')](_0x4f6c3e)));});}}else{return _0x54560d(msgResponse(_0xcd7f('0x1ef'),_0xcd7f('0x14e'),'check\x20failure'));}});};};Dialer[_0xcd7f('0xaa')]['startMethodPredictive']=function(_0x56be33){var _0x19ed02=this;return function(){var _0xbc3279=0x0;var _0x42f0e8=Math['floor'](_0x56be33[_0xcd7f('0x78')]*0x3e8);if(_0x42f0e8>0x0){_0x42f0e8=_0x42f0e8<0x64?0x64:_0x42f0e8;loggerPredictive[_0xcd7f('0x86')](_0x56be33[_0xcd7f('0x47')],'one\x20call\x20every:',_0x42f0e8,'milliseconds');_0x56be33[_0xcd7f('0x94')]=setInterval(function(){_0x19ed02['handlePredictive'](_0x56be33);loggerPredictiveCalls[_0xcd7f('0x86')](_0xcd7f('0x1f5'),_0xbc3279+=0x1);},_0x42f0e8);}else{loggerPredictive['info'](_0x56be33[_0xcd7f('0x47')],_0xcd7f('0x1f6'));}};};Dialer['prototype'][_0xcd7f('0x1f7')]=function(_0x2a92bf,_0x41fb34){var _0x387e5f=this;return function(_0x1462a0){if(_['isEmpty'](_0x1462a0)){if(_[_0xcd7f('0xae')](_0x41fb34[_0xcd7f('0xd4')])||!_0x41fb34[_0xcd7f('0x1f8')]){if(_0x2a92bf[_0xcd7f('0x60')]===_0xcd7f('0x7')){_0x2a92bf[_0xcd7f('0x136')]=_[_0xcd7f('0x44')](_0x2a92bf['queueStatusComplete'])?!![]:_0x2a92bf['queueStatusComplete'];var _0x2eaf08=uuid['v4']();_0x387e5f[_0xcd7f('0x26')][_0x2eaf08]=new Action(_0x2a92bf,_0x41fb34,_0x2eaf08);loggerBooked[_0xcd7f('0x86')](_0xcd7f('0x1f9'),_0x2eaf08,_0xcd7f('0x1fa'),JSON['stringify'](_0x2a92bf['queueStatusComplete']),'Queue:\x20',_0x2a92bf[_0xcd7f('0x47')]);if(_0x2a92bf[_0xcd7f('0x136')]){_0x2a92bf[_0xcd7f('0x136')]=![];_0x387e5f['queueBooked'][_0x387e5f[_0xcd7f('0x26')][_0x2eaf08]['queue']]=[];ami[_0xcd7f('0xaf')]({'actionid':_0x2eaf08,'action':'queuestatus','queue':_0x2a92bf[_0xcd7f('0x47')]})['catch'](function(){_0x387e5f[_0xcd7f('0xb2')](_0x2a92bf);_0x387e5f[_0xcd7f('0xc1')]({'active':![],'ContactId':_0x387e5f[_0xcd7f('0x26')][_0x2eaf08][_0xcd7f('0x101')],'ListId':_0x387e5f[_0xcd7f('0x26')][_0x2eaf08][_0xcd7f('0xd3')],'VoiceQueueId':_0x387e5f[_0xcd7f('0x26')][_0x2eaf08]['VoiceQueueId']||undefined,'CampaignId':_0x387e5f[_0xcd7f('0x26')][_0x2eaf08][_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1fb')));delete _0x387e5f[_0xcd7f('0x26')][_0x2eaf08];});}else{loggerBooked[_0xcd7f('0x86')](_0xcd7f('0x1fc'),JSON['stringify'](_0x2a92bf[_0xcd7f('0x136')]),_0xcd7f('0x1fd'),_0x2a92bf['name']);_0x387e5f[_0xcd7f('0xb2')](_0x2a92bf);_0x387e5f[_0xcd7f('0xc1')]({'active':![],'ContactId':_0x387e5f[_0xcd7f('0x26')][_0x2eaf08][_0xcd7f('0x101')],'ListId':_0x387e5f[_0xcd7f('0x26')][_0x2eaf08]['ListId'],'VoiceQueueId':_0x387e5f[_0xcd7f('0x26')][_0x2eaf08][_0xcd7f('0xd5')]||undefined,'CampaignId':_0x387e5f['actions'][_0x2eaf08][_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x1fb')));delete _0x387e5f['actions'][_0x2eaf08];}}else{return _0x387e5f[_0xcd7f('0x17a')](_0x2a92bf,_0x41fb34);}}else{if(getDiff(_0x41fb34[_0xcd7f('0x1fe')])<_0x2a92bf[_0xcd7f('0x1ff')]*0x3c){if(_0x41fb34[_0xcd7f('0x174')]&&!_0x41fb34['Agent'][_0xcd7f('0x200')]){_0x387e5f[_0xcd7f('0x96')]['run'](_0x41fb34['id'])['finally'](function(){_0x387e5f['updateOriginated'](_0x2a92bf);});}else{_0x387e5f[_0xcd7f('0xc3')]({'active':![]},_0x41fb34['id'],0x1)[_0xcd7f('0x1e')](function(){_0x387e5f[_0xcd7f('0xb2')](_0x2a92bf);});}}else{_0x2a92bf[_0xcd7f('0x69')]+=0x1;_0x387e5f['updateOriginated'](_0x2a92bf);if(_0x2a92bf[_0xcd7f('0x201')]){_0x387e5f[_0xcd7f('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x41fb34[_0xcd7f('0x101')],'ListId':_0x41fb34[_0xcd7f('0xd3')],'VoiceQueueId':_0x41fb34[_0xcd7f('0xd5')]||undefined,'CampaignId':_0x41fb34[_0xcd7f('0xd6')]||undefined})[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x202')));_0x387e5f['createHistory'](createObjHistory(_0x2a92bf,_0x41fb34,_0xcd7f('0x203'),0x17,_0xcd7f('0x204')))[_0xcd7f('0xb1')](loggerCatch(_0xcd7f('0x205')));}else{_0x387e5f['saveInDb'](createObjHistory(_0x2a92bf,_0x41fb34,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xcd7f('0x206'),_0xcd7f('0x207'));}}}}else{_0x2a92bf['outboundBlacklistCallsDay']+=0x1;_0x387e5f[_0xcd7f('0xd2')](createObjHistory(_0x2a92bf,_0x41fb34,_0xcd7f('0x208'),0xd,_0xcd7f('0x209')),'[Originate][historyBlacklist]',_0xcd7f('0x20a'));throw _0xcd7f('0x20b');}};};Dialer['prototype'][_0xcd7f('0x16b')]=function(_0x34a178){var _0x1ec7bf=this;var _0x1dbc86=_0x34a178[_0xcd7f('0x20c')]-_0x34a178[_0xcd7f('0x76')]-_0x34a178[_0xcd7f('0xc6')];emitCampaignSummary(_0x34a178);if(_0x1dbc86>0x0){if(_0x1dbc86>this[_0xcd7f('0x24')]){_0x1dbc86=this['maxNumberOriginate'];}_0x34a178[_0xcd7f('0xc6')]+=_0x1dbc86;this[_0xcd7f('0xc8')](_0x34a178['id'],_0x1dbc86,_0x34a178[_0xcd7f('0x20d')],_0x34a178)[_0xcd7f('0x42')](function(_0x49313b){_0x34a178[_0xcd7f('0xc6')]-=_0x1dbc86;_0x34a178['temp']=_0x34a178[_0xcd7f('0xc6')]>0x0?_0x34a178[_0xcd7f('0xc6')]:0x0;if(!checkContactEmpty(_0x49313b)){_0x34a178[_0xcd7f('0x45')]=_0xcd7f('0xa0');logger[_0xcd7f('0x86')]('[getContactCampaign2][Empty]'+_0x34a178['name']);}else{_0x34a178['originated']+=_0x49313b['length'];_0x34a178[_0xcd7f('0x45')]='RUNNING';for(var _0x358d6b=0x0;_0x358d6b<_0x49313b[_0xcd7f('0x9d')];_0x358d6b+=0x1){_0x34a178[_0xcd7f('0x20e')]+=0x1;if(_[_0xcd7f('0xae')](_0x49313b[_0x358d6b])||_[_0xcd7f('0xae')](_0x49313b[_0x358d6b]['Contact'])||_[_0xcd7f('0xae')](_0x49313b[_0x358d6b][_0xcd7f('0x17e')])){_0x1ec7bf[_0xcd7f('0xd1')](_0xcd7f('0x20f'),_0x34a178,_0x49313b[_0x358d6b]);}else{_0x1ec7bf['checkIsBlackListIvr'](_[_0xcd7f('0x134')](_0x49313b[_0x358d6b],[_0xcd7f('0xd6'),_0xcd7f('0x17e')]))[_0xcd7f('0x42')](_0x1ec7bf[_0xcd7f('0x1f7')](_0x34a178,_0x49313b[_0x358d6b]))[_0xcd7f('0xb1')](_0x1ec7bf[_0xcd7f('0x210')](_0xcd7f('0x211'),_0x34a178));}}}})[_0xcd7f('0xb1')](loggerGetContactDialer(_0xcd7f('0x212'),_0x34a178,_0x1dbc86));}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x162')]=function(_0x3f6a2a,_0x1fb6bc){var _0x5f4b39=this;var _0x3baea2=[];var _0x3f9001=_0x1fb6bc>=0x1?_0x1fb6bc:0x1;if(_0x3f6a2a['dialMethod']===_0xcd7f('0x7')){_0x3f9001=0x1;}var _0x33a52d=Math[_0xcd7f('0x1dc')](_0x3f6a2a['available']*_0x3f9001)-_0x3f6a2a['originated']-_0x3f6a2a['temp'];emitVoiceQueueSummary(_0x3f6a2a);if(_0x3f6a2a[_0xcd7f('0x213')]>0x0){var _0xaf93=_0x3f6a2a[_0xcd7f('0x213')]-_0x3f6a2a['originated']-_0x3f6a2a[_0xcd7f('0x5a')]-_0x3f6a2a[_0xcd7f('0xc6')]-_0x3f6a2a[_0xcd7f('0x214')];if(_0x33a52d>_0xaf93){_0x33a52d=_0xaf93;}}if(_0x33a52d>0x0){if(_0x3f6a2a[_0xcd7f('0x60')]===_0xcd7f('0x7')){_0x33a52d=0x1;}if(_0x33a52d>this[_0xcd7f('0x24')]){_0x33a52d=this[_0xcd7f('0x24')];}_0x3f6a2a[_0xcd7f('0xc6')]+=_0x33a52d;for(var _0x4b9c0d in this['agents']){if(typeof this[_0xcd7f('0x22')][_0x4b9c0d]!==_0xcd7f('0xad')){if(this[_0xcd7f('0x22')][_0x4b9c0d][_0xcd7f('0xa6')]===_0xcd7f('0x215')&&this[_0xcd7f('0x22')][_0x4b9c0d][_0xcd7f('0xb0')]==='reachable'){_0x3baea2[_0xcd7f('0x133')](this[_0xcd7f('0x22')][_0x4b9c0d]['id']);}}}this['getContactDialer'](_0x3f6a2a['id'],_0x3baea2,_0x33a52d,_0x3f6a2a[_0xcd7f('0x20d')],_0x3f6a2a)[_0xcd7f('0x42')](function(_0x43f630){_0x3f6a2a[_0xcd7f('0xc6')]-=_0x33a52d;_0x3f6a2a[_0xcd7f('0xc6')]=_0x3f6a2a[_0xcd7f('0xc6')]>0x0?_0x3f6a2a[_0xcd7f('0xc6')]:0x0;if(!checkContactEmpty(_0x43f630)){_0x5f4b39[_0xcd7f('0x216')](_0x3f6a2a)[_0xcd7f('0x42')](sendMessageReschedule(_0x3f6a2a))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x3f6a2a[_0xcd7f('0x76')]+=_0x43f630[_0xcd7f('0x9d')];_0x3f6a2a[_0xcd7f('0x45')]=_0x3f6a2a[_0xcd7f('0x60')]===_0xcd7f('0x7')?_0xcd7f('0x217'):_0xcd7f('0x218');for(var _0x24b8b9=0x0;_0x24b8b9<_0x43f630[_0xcd7f('0x9d')];_0x24b8b9+=0x1){if(_[_0xcd7f('0xae')](_0x43f630[_0x24b8b9])||_['isNil'](_0x43f630[_0x24b8b9]['Contact'])||_['isNil'](_0x43f630[_0x24b8b9][_0xcd7f('0x17e')])){_0x5f4b39[_0xcd7f('0xd1')](_0xcd7f('0x20f'),_0x3f6a2a,_0x43f630[_0x24b8b9]);}else{_0x5f4b39[_0xcd7f('0xb7')](_[_0xcd7f('0x134')](_0x43f630[_0x24b8b9],[_0xcd7f('0xd5'),_0xcd7f('0x17e')]))[_0xcd7f('0x42')](_0x5f4b39[_0xcd7f('0x1f7')](_0x3f6a2a,_0x43f630[_0x24b8b9]))[_0xcd7f('0xb1')](_0x5f4b39['loggerHandler'](_0xcd7f('0x20f'),_0x3f6a2a));}}}})[_0xcd7f('0xb1')](loggerGetContactDialer('[getContactDialer2]',_0x3f6a2a,_0x33a52d));}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x94')]=function(_0x271ddc){if(_0x271ddc[_0xcd7f('0x213')]>0x0){var _0x481352=_0x271ddc[_0xcd7f('0x213')]-_0x271ddc[_0xcd7f('0x76')]-_0x271ddc[_0xcd7f('0x5a')];if(_0x481352>0x0){this[_0xcd7f('0x219')](_0x271ddc);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x271ddc);}};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x219')]=function(_0x1ca4fb){var _0x218740=this;var _0x10d768=[];_0x1ca4fb[_0xcd7f('0x76')]+=0x1;for(var _0x2c652b in this[_0xcd7f('0x22')]){if(typeof this['agents'][_0x2c652b]!==_0xcd7f('0xad')){if(this['agents'][_0x2c652b][_0xcd7f('0xa6')]===_0xcd7f('0x215')&&this[_0xcd7f('0x22')][_0x2c652b][_0xcd7f('0xb0')]===_0xcd7f('0xdd')){_0x10d768[_0xcd7f('0x133')](this[_0xcd7f('0x22')][_0x2c652b]['id']);}}}this[_0xcd7f('0xc5')](_0x1ca4fb['id'],_0x10d768,0x1,_0x1ca4fb[_0xcd7f('0x20d')],_0x1ca4fb)['then'](function(_0x4c0025){if(!checkContactEmpty(_0x4c0025)){checkContactLowerLimitOriginate(_0x1ca4fb,0x1,0x0);_0x218740[_0xcd7f('0x216')](_0x1ca4fb)[_0xcd7f('0x42')](sendMessageReschedule(_0x1ca4fb))['catch'](loggerCatch(_0xcd7f('0xb6')));}else{_0x1ca4fb[_0xcd7f('0x45')]='RUNNING';if(_[_0xcd7f('0xae')](_0x4c0025[0x0])||_[_0xcd7f('0xae')](_0x4c0025[0x0][_0xcd7f('0x196')])||_[_0xcd7f('0xae')](_0x4c0025[0x0][_0xcd7f('0x17e')])){_0x218740[_0xcd7f('0xd1')](_0xcd7f('0x20f'),_0x1ca4fb,_0x4c0025[0x0]);}else{_0x218740['checkIsBlackList'](_['pick'](_0x4c0025[0x0],[_0xcd7f('0xd5'),_0xcd7f('0x17e')]))[_0xcd7f('0x42')](_0x218740['checkContactBlack'](_0x1ca4fb,_0x4c0025[0x0]))['catch'](_0x218740[_0xcd7f('0x210')](_0xcd7f('0x21a'),_0x1ca4fb));}}})[_0xcd7f('0xb1')](loggerGetContactDialer(_0xcd7f('0x21b'),_0x1ca4fb,0x1));emitVoiceQueueSummary(_0x1ca4fb);};Dialer[_0xcd7f('0xaa')][_0xcd7f('0x1f3')]=function(_0x1191f8,_0x360782,_0x5ac0fb,_0x5200d6,_0xd90160,_0x554ab2){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x21c'),_0x1191f8);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x21d'),_0x360782);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x21e'),_0x5ac0fb);loggerPredictive['info']('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',_0x5200d6);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x21f'),_0xd90160);loggerPredictive[_0xcd7f('0x86')]('---------------------------');return new Promise(function(_0x76729f,_0x558e9c){if(_0x1191f8<=0x0||isNaN(_0x1191f8)){return _0x558e9c(msgResponse(_0xcd7f('0x220'),_0xcd7f('0x221'),_0xcd7f('0x222')+_0x1191f8));}if(_0x5ac0fb<=0x0||isNaN(_0x5ac0fb)){return _0x558e9c(msgResponse(_0xcd7f('0x220'),_0xcd7f('0x221'),_0xcd7f('0x223')+_0x5ac0fb));}if(_0x5200d6<=0x0||isNaN(_0x5200d6)){return _0x558e9c(msgResponse(_0xcd7f('0x220'),_0xcd7f('0x221'),_0xcd7f('0x224')+_0x5200d6));}if(_0x360782<=0x0||isNaN(_0x360782)){return _0x558e9c(msgResponse('[abandonmentRate]','Error',_0xcd7f('0x225')+_0x360782));}if(_0xd90160<=0x0||isNaN(_0xd90160)){return _0x558e9c(msgResponse(_0xcd7f('0x220'),'Error','Amax\x20=\x20'+_0xd90160));}_0x554ab2=_0x554ab2||0x0;var _0x51094f=0x1/_0x5ac0fb;var _0x252061=0x0;var _0x4ee721=0x0;var _0x12c098=0x0;var _0x313a86=0x0;for(var _0x284363=0x0;_0x12c098<_0xd90160;_0x284363+=0x1){_0x4ee721=_0x284363/_0x360782;_0x252061=(_0x5200d6*_0x4ee721+_0x554ab2)/_0x51094f;_0x12c098=erlangb(_0x252061,_0x1191f8);_0x313a86=_0x252061/_0x1191f8*(0x1-erlangb(_0x252061,_0x1191f8));}return _0x76729f({'erlangCalls':_0x284363,'erlangCallToSecond':_0x360782/_0x284363,'erlangAbandonmentRate':_0x12c098,'erlangBusyFactor':_0x313a86});});};Dialer[_0xcd7f('0xaa')]['busyFactor']=function(_0x44150f,_0x53fd8e,_0xd77e13,_0x323d7e,_0x426b85,_0x46c698){loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x226'));loggerPredictive[_0xcd7f('0x86')]('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',_0x44150f);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x21d'),_0x53fd8e);loggerPredictive[_0xcd7f('0x86')]('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',_0xd77e13);loggerPredictive[_0xcd7f('0x86')]('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',_0x323d7e);loggerPredictive['info'](_0xcd7f('0x227'),_0x426b85);loggerPredictive[_0xcd7f('0x86')](_0xcd7f('0x8b'));return new Promise(function(_0x4734e9,_0x232d4a){if(_0x44150f<=0x0||isNaN(_0x44150f)){return _0x232d4a(msgResponse(_0xcd7f('0x228'),'Error',_0xcd7f('0x222')+_0x44150f));}if(_0xd77e13<=0x0||isNaN(_0xd77e13)){return _0x232d4a(msgResponse(_0xcd7f('0x228'),'Error',_0xcd7f('0x223')+_0xd77e13));}if(_0x323d7e<=0x0||isNaN(_0x323d7e)){return _0x232d4a(msgResponse(_0xcd7f('0x228'),_0xcd7f('0x221'),'p\x20=\x20'+_0x323d7e));}if(_0x53fd8e<=0x0||isNaN(_0x53fd8e)){return _0x232d4a(msgResponse(_0xcd7f('0x228'),_0xcd7f('0x221'),_0xcd7f('0x225')+_0x53fd8e));}if(_0x426b85<=0x0||isNaN(_0x426b85)){return _0x232d4a(msgResponse('[busyFactor]',_0xcd7f('0x221'),_0xcd7f('0x229')+_0x426b85));}_0x46c698=_0x46c698||0x0;var _0x391e66=0x1/_0xd77e13;var _0x51ea79=0x0;var _0x1daecd=0x0;var _0x58a770=0x0;var _0x5db1f4=0x0;for(var _0x2280cf=0x0;_0x5db1f4<_0x426b85;_0x2280cf+=0x1){_0x1daecd=_0x2280cf/_0x53fd8e;_0x51ea79=(_0x323d7e*_0x1daecd+_0x46c698)/_0x391e66;_0x58a770=erlangb(_0x51ea79,_0x44150f);_0x5db1f4=_0x51ea79/_0x44150f*(0x1-erlangb(_0x51ea79,_0x44150f));}return _0x4734e9({'erlangCalls':_0x2280cf,'erlangCallToSecond':_0x53fd8e/_0x2280cf,'erlangAbandonmentRate':_0x58a770,'erlangBusyFactor':_0x5db1f4});});};module[_0xcd7f('0x22a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index aafcc4f..787a4ca 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 _0x7343=['calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid'];(function(_0xb11dd,_0x1bb6c3){var _0x1ff67e=function(_0x4f6346){while(--_0x4f6346){_0xb11dd['push'](_0xb11dd['shift']());}};_0x1ff67e(++_0x1bb6c3);}(_0x7343,0xd9));var _0x3734=function(_0x3f95ab,_0x3f5fd9){_0x3f95ab=_0x3f95ab-0x0;var _0x3971fc=_0x7343[_0x3f95ab];return _0x3971fc;};'use strict';var util=require(_0x3734('0x0'));var _=require(_0x3734('0x1'));var moment=require('moment');function getSeconds(_0x376b72,_0x39d70b){var _0x15919a=moment(_0x376b72)[_0x3734('0x2')](0x0);var _0x18c7c5=moment(_0x39d70b)[_0x3734('0x2')](0x0);return _0x15919a['diff'](_0x18c7c5,_0x3734('0x3'));}function QueueCallerAbandon(_0x9f1d8a,_0x38360a){this[_0x3734('0x4')]=_0x9f1d8a[_0x3734('0x4')];this['type']=_0x9f1d8a[_0x3734('0x5')];this[_0x3734('0x6')]=_0x9f1d8a['type']==='outbound'?_0x3734('0x7'):_0x9f1d8a[_0x3734('0x5')];this[_0x3734('0x8')]=_0x9f1d8a[_0x3734('0x8')];this[_0x3734('0x9')]=_0x9f1d8a[_0x3734('0x9')];this[_0x3734('0xa')]=_0x9f1d8a['countnoanswerretry'];this['countglobal']=_0x9f1d8a[_0x3734('0x8')]+_0x9f1d8a[_0x3734('0x9')]+_0x9f1d8a[_0x3734('0xa')]+_0x9f1d8a[_0x3734('0xb')]+_0x9f1d8a[_0x3734('0xc')]+_0x9f1d8a[_0x3734('0xd')]+_0x9f1d8a[_0x3734('0xe')]+_0x9f1d8a[_0x3734('0xf')];this[_0x3734('0xb')]=_0x9f1d8a[_0x3734('0xb')];this[_0x3734('0xc')]=_0x9f1d8a[_0x3734('0xc')];this['countabandonedretry']=_0x9f1d8a[_0x3734('0xd')];this[_0x3734('0xe')]=_0x9f1d8a['countmachineretry'];this[_0x3734('0xf')]=_0x9f1d8a[_0x3734('0xf')];this['uniqueid']=_0x38360a[_0x3734('0x10')];this[_0x3734('0x11')]=_0x9f1d8a['name'];this[_0x3734('0x12')]=_0x9f1d8a[_0x3734('0x13')];this[_0x3734('0x14')]=_0x9f1d8a['starttime'];this[_0x3734('0x15')]=_0x9f1d8a['responsetime'];this['droptime']=_0x9f1d8a[_0x3734('0x16')];this[_0x3734('0x17')]=this[_0x3734('0x16')];this[_0x3734('0x18')]=getSeconds(_0x9f1d8a[_0x3734('0x15')],_0x9f1d8a[_0x3734('0x14')]);this[_0x3734('0x19')]=getSeconds(this[_0x3734('0x16')],_0x9f1d8a[_0x3734('0x15')]);this[_0x3734('0x1a')]=0x0;this[_0x3734('0x7')]=_0x38360a[_0x3734('0x7')];this[_0x3734('0x1b')]=_0x38360a[_0x3734('0x1c')];this['reason']=_0x38360a[_0x3734('0x1d')];this[_0x3734('0x1e')]=_0x9f1d8a[_0x3734('0x1e')];this['callbackuniqueid']=_0x9f1d8a['callbackuniqueid'];this[_0x3734('0x1f')]=_0x9f1d8a[_0x3734('0x1f')];this[_0x3734('0x20')]=_0x9f1d8a[_0x3734('0x20')];this[_0x3734('0x21')]=_0x9f1d8a[_0x3734('0x21')];this[_0x3734('0x22')]=_0x9f1d8a[_0x3734('0x22')];this[_0x3734('0x23')]=_0x9f1d8a[_0x3734('0x23')];this['VoiceQueueId']=_0x9f1d8a[_0x3734('0x24')];this['CampaignId']=_0x9f1d8a['CampaignId'];this[_0x3734('0x25')]=_0x9f1d8a[_0x3734('0x25')]||'';this[_0x3734('0x26')]=_0x9f1d8a[_0x3734('0x26')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xea1c=['talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime'];(function(_0x5d4ca7,_0x19113b){var _0x3efc03=function(_0x59675b){while(--_0x59675b){_0x5d4ca7['push'](_0x5d4ca7['shift']());}};_0x3efc03(++_0x19113b);}(_0xea1c,0xdb));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xcea1('0x0'));var _=require('lodash');var moment=require(_0xcea1('0x1'));function getSeconds(_0x33c0c7,_0x361169){var _0xd3b539=moment(_0x33c0c7)[_0xcea1('0x2')](0x0);var _0x32f5fa=moment(_0x361169)[_0xcea1('0x2')](0x0);return _0xd3b539[_0xcea1('0x3')](_0x32f5fa,_0xcea1('0x4'));}function QueueCallerAbandon(_0x371a91,_0x41b086){this[_0xcea1('0x5')]=_0x371a91[_0xcea1('0x5')];this['type']=_0x371a91[_0xcea1('0x6')];this[_0xcea1('0x7')]=_0x371a91['type']===_0xcea1('0x8')?_0xcea1('0x9'):_0x371a91[_0xcea1('0x6')];this['countbusyretry']=_0x371a91['countbusyretry'];this[_0xcea1('0xa')]=_0x371a91['countcongestionretry'];this[_0xcea1('0xb')]=_0x371a91[_0xcea1('0xb')];this[_0xcea1('0xc')]=_0x371a91[_0xcea1('0xd')]+_0x371a91[_0xcea1('0xa')]+_0x371a91[_0xcea1('0xb')]+_0x371a91[_0xcea1('0xe')]+_0x371a91['countdropretry']+_0x371a91['countabandonedretry']+_0x371a91[_0xcea1('0xf')]+_0x371a91[_0xcea1('0x10')];this['countnosuchnumberretry']=_0x371a91['countnosuchnumberretry'];this['countdropretry']=_0x371a91['countdropretry'];this['countabandonedretry']=_0x371a91['countabandonedretry'];this['countmachineretry']=_0x371a91['countmachineretry'];this[_0xcea1('0x10')]=_0x371a91[_0xcea1('0x10')];this[_0xcea1('0x11')]=_0x41b086[_0xcea1('0x11')];this[_0xcea1('0x12')]=_0x371a91[_0xcea1('0x13')];this['calleridnum']=_0x371a91[_0xcea1('0x14')];this['starttime']=_0x371a91[_0xcea1('0x15')];this[_0xcea1('0x16')]=_0x371a91[_0xcea1('0x16')];this[_0xcea1('0x17')]=_0x371a91[_0xcea1('0x17')];this[_0xcea1('0x18')]=this[_0xcea1('0x17')];this[_0xcea1('0x19')]=getSeconds(_0x371a91[_0xcea1('0x16')],_0x371a91[_0xcea1('0x15')]);this[_0xcea1('0x1a')]=getSeconds(this['droptime'],_0x371a91['responsetime']);this[_0xcea1('0x1b')]=0x0;this[_0xcea1('0x9')]=_0x41b086['queue'];this['membername']=_0x41b086[_0xcea1('0x1c')];this[_0xcea1('0x1d')]=_0x41b086['reason'];this[_0xcea1('0x1e')]=_0x371a91[_0xcea1('0x1e')];this[_0xcea1('0x1f')]=_0x371a91[_0xcea1('0x1f')];this['callbackat']=_0x371a91[_0xcea1('0x20')];this[_0xcea1('0x21')]=_0x371a91[_0xcea1('0x21')];this[_0xcea1('0x22')]=_0x371a91[_0xcea1('0x22')];this['ListId']=_0x371a91['ListId'];this[_0xcea1('0x23')]=_0x371a91['UserId'];this[_0xcea1('0x24')]=_0x371a91[_0xcea1('0x24')];this[_0xcea1('0x25')]=_0x371a91[_0xcea1('0x25')];this[_0xcea1('0x26')]=_0x371a91[_0xcea1('0x26')]||'';this[_0xcea1('0x27')]=_0x371a91[_0xcea1('0x27')]||'';}module[_0xcea1('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index cfd88ee..09dc9f5 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(_0x1e81dd,_0x16ca9e){var _0x2cdd83=function(_0x5666ad){while(--_0x5666ad){_0x1e81dd['push'](_0x1e81dd['shift']());}};_0x2cdd83(++_0x16ca9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x1add99,_0x3bf53a){var _0x1ce9ec=function(_0x252a94){while(--_0x252a94){_0x1add99['push'](_0x1add99['shift']());}};_0x1ce9ec(++_0x3bf53a);}(_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 6ef1fe7..83f4740 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 _0xad13=['unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','util','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','operation','status','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','notify','stringify','catch','\x20receiveFax\x20','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','FaxAccountId','isValid','Trunk\x20Reachable','format','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xad13,0x79));var _0x3ad1=function(_0x290e20,_0x3ccdf6){_0x290e20=_0x290e20-0x0;var _0x172e35=_0xad13[_0x290e20];return _0x172e35;};'use strict';var util=require(_0x3ad1('0x0'));var _=require('lodash');var BPromise=require(_0x3ad1('0x1'));var uuid=require(_0x3ad1('0x2'));var moment=require(_0x3ad1('0x3'));var path=require(_0x3ad1('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3ad1('0x5'));var logger=require(_0x3ad1('0x6'))(_0x3ad1('0x7'));var ami=require(_0x3ad1('0x8'));var rpcDb=require(_0x3ad1('0x9'));var Channel=require(_0x3ad1('0xa'));var ut=require(_0x3ad1('0xb'));var Action=require(_0x3ad1('0xc'));var faxAccount=require(_0x3ad1('0xd'));var attachment=require(_0x3ad1('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2429f4){this[_0x3ad1('0xf')]={};this[_0x3ad1('0x10')]=_0x2429f4['faxAccounts'];this[_0x3ad1('0x11')]=_0x2429f4[_0x3ad1('0x11')];this['actions']={};ami['on'](_0x3ad1('0x12'),this[_0x3ad1('0x13')][_0x3ad1('0x14')](this));ami['on'](_0x3ad1('0x15'),this[_0x3ad1('0x16')][_0x3ad1('0x14')](this));ami['on']('newstate',this['syncNewState'][_0x3ad1('0x14')](this));ami['on'](_0x3ad1('0x17'),this[_0x3ad1('0x18')][_0x3ad1('0x14')](this));ami['on']('faxstatus',this[_0x3ad1('0x19')]['bind'](this));ami['on'](_0x3ad1('0x1a'),this[_0x3ad1('0x1b')][_0x3ad1('0x14')](this));ami['on'](_0x3ad1('0x1c'),this[_0x3ad1('0x1d')][_0x3ad1('0x14')](this));ami['on'](_0x3ad1('0x1e'),this[_0x3ad1('0x1f')][_0x3ad1('0x14')](this));}Fax[_0x3ad1('0x20')][_0x3ad1('0x13')]=function(_0x330da5){if(_0x330da5['context']===_0x3ad1('0x21')){for(var _0x30e53f in this[_0x3ad1('0x10')]){if(this[_0x3ad1('0x10')][_0x3ad1('0x22')](_0x30e53f)){if(_0x330da5['exten']===this[_0x3ad1('0x10')][_0x30e53f][_0x3ad1('0x23')]){this['channels'][_0x330da5[_0x3ad1('0x24')]]={};this[_0x3ad1('0xf')][_0x330da5[_0x3ad1('0x24')]][_0x3ad1('0x25')]=_0x330da5[_0x3ad1('0x25')];this[_0x3ad1('0xf')][_0x330da5['uniqueid']]['id']=this[_0x3ad1('0x10')][_0x30e53f]['id'];this['channels'][_0x330da5[_0x3ad1('0x24')]]['name']=this[_0x3ad1('0x10')][_0x30e53f][_0x3ad1('0x26')];logger[_0x3ad1('0x27')](_0x330da5[_0x3ad1('0x24')],_0x3ad1('0x28'));}}}}if(this[_0x3ad1('0x29')][_0x330da5[_0x3ad1('0x24')]]){this['channels'][_0x330da5[_0x3ad1('0x24')]]={};this[_0x3ad1('0xf')][_0x330da5[_0x3ad1('0x24')]][_0x3ad1('0x25')]=_0x330da5[_0x3ad1('0x25')];logger[_0x3ad1('0x27')](_0x330da5['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x3ad1('0x20')]['syncVarSet']=function(_0x57feeb){if(this[_0x3ad1('0xf')][_0x57feeb[_0x3ad1('0x24')]]){for(var _0xf5d14c in _0x57feeb[_0x3ad1('0x2a')]){if(_0x57feeb['variable'][_0x3ad1('0x22')](_0xf5d14c)){this[_0x3ad1('0xf')][_0x57feeb[_0x3ad1('0x24')]][_0xf5d14c]=_0x57feeb[_0x3ad1('0x2b')];}}}};Fax[_0x3ad1('0x20')]['syncNewState']=function(_0x50f934){if(this[_0x3ad1('0xf')][_0x50f934['uniqueid']]){this[_0x3ad1('0xf')][_0x50f934[_0x3ad1('0x24')]][_0x3ad1('0x2c')]=_0x50f934[_0x3ad1('0x2c')];this[_0x3ad1('0xf')][_0x50f934[_0x3ad1('0x24')]][_0x3ad1('0x2d')]=_0x50f934[_0x3ad1('0x2d')];}};Fax[_0x3ad1('0x20')]['syncNewExten']=function(_0x2b6a4d){if(this['channels'][_0x2b6a4d[_0x3ad1('0x24')]]){for(var _0x12e4a0 in _0x2b6a4d[_0x3ad1('0x2a')]){if(_0x2b6a4d[_0x3ad1('0x2a')][_0x3ad1('0x22')](_0x12e4a0)){this[_0x3ad1('0xf')][_0x2b6a4d[_0x3ad1('0x24')]][_0x12e4a0]=_0x2b6a4d['value'];}}}};Fax[_0x3ad1('0x20')]['syncFaxStatus']=function(_0x535d4b){if(this['channels'][_0x535d4b[_0x3ad1('0x24')]]){this[_0x3ad1('0xf')][_0x535d4b[_0x3ad1('0x24')]][_0x3ad1('0x2e')]=_0x535d4b[_0x3ad1('0x2e')];this[_0x3ad1('0xf')][_0x535d4b['uniqueid']]['status']=_0x535d4b[_0x3ad1('0x2f')];this[_0x3ad1('0xf')][_0x535d4b[_0x3ad1('0x24')]][_0x3ad1('0x23')]=_0x535d4b[_0x3ad1('0x23')];this['channels'][_0x535d4b['uniqueid']]['filename']=_0x535d4b['filename'];logger[_0x3ad1('0x27')](_0x535d4b['uniqueid'],_0x3ad1('0x30'));}};Fax[_0x3ad1('0x20')][_0x3ad1('0x1b')]=function(_0x55f3fd){var _0x39313c=this;if(this[_0x3ad1('0xf')][_0x55f3fd['uniqueid']]){var _0x90d65=this['channels'][_0x55f3fd[_0x3ad1('0x24')]]['id'];this[_0x3ad1('0xf')][_0x55f3fd[_0x3ad1('0x24')]][_0x3ad1('0x31')]=_0x55f3fd['remotestationid'];this['channels'][_0x55f3fd[_0x3ad1('0x24')]][_0x3ad1('0x32')]=_0x55f3fd[_0x3ad1('0x32')];this[_0x3ad1('0xf')][_0x55f3fd['uniqueid']][_0x3ad1('0x23')]=_0x55f3fd[_0x3ad1('0x23')];this[_0x3ad1('0xf')][_0x55f3fd[_0x3ad1('0x24')]]['resolution']=_0x55f3fd[_0x3ad1('0x33')];this['channels'][_0x55f3fd['uniqueid']][_0x3ad1('0x34')]=_0x55f3fd['transferrate'];this['channels'][_0x55f3fd['uniqueid']][_0x3ad1('0x35')]=_0x55f3fd[_0x3ad1('0x35')];this[_0x3ad1('0xf')][_0x55f3fd[_0x3ad1('0x24')]][_0x3ad1('0x36')]=_0x55f3fd['calleridnum'];if(this['channels'][_0x55f3fd[_0x3ad1('0x24')]][_0x3ad1('0x32')]>0x0){tiff2pdf(_0x55f3fd['filename'],_0x3ad1('0x37'),function(_0x3b22cd){logger['info'](_0x55f3fd[_0x3ad1('0x24')],_0x3ad1('0x38'),_0x3b22cd['message']);attachment[_0x3ad1('0x39')]({'name':path['parse'](_0x55f3fd[_0x3ad1('0x35')])[_0x3ad1('0x26')],'basename':path[_0x3ad1('0x3a')](_0x55f3fd[_0x3ad1('0x35')])[_0x3ad1('0x26')]+_0x3ad1('0x3b'),'type':_0x3ad1('0x3c')})['then'](function(_0x522b24){faxAccount[_0x3ad1('0x3d')](_0x90d65,{'from':_0x55f3fd[_0x3ad1('0x36')],'mapKey':_0x3ad1('0x7'),'body':path[_0x3ad1('0x3a')](_0x55f3fd['filename'])['name']+_0x3ad1('0x3b'),'AttachmentId':_0x522b24['id']})['catch'](function(_0x4177f7){logger['error'](_0x55f3fd[_0x3ad1('0x24')],'\x20notify\x20',JSON[_0x3ad1('0x3e')](_0x4177f7));});})[_0x3ad1('0x3f')](function(_0x2a31e8){logger['error'](_0x55f3fd[_0x3ad1('0x24')],_0x3ad1('0x40'),JSON[_0x3ad1('0x3e')](_0x2a31e8));});});}logger[_0x3ad1('0x27')](_0x55f3fd['uniqueid'],_0x3ad1('0x40'));}};Fax[_0x3ad1('0x20')][_0x3ad1('0x1f')]=function(_0x456e31){if(this[_0x3ad1('0x29')][_0x456e31[_0x3ad1('0x24')]]){_['merge'](this['channels'][_0x456e31['uniqueid']],_[_0x3ad1('0x41')](_0x456e31,[_0x3ad1('0x42'),'reason']));}};function updateStatus(_0x4f20aa){if(_0x4f20aa[_0x3ad1('0x43')]){faxMessage[_0x3ad1('0x44')](_0x4f20aa[_0x3ad1('0x43')],{'failMessage':_0x3ad1('0x45')})['then'](function(_0x1875ae){ut['logger']('[Fax][Message][Error][Updated]',_0x1875ae);})['catch'](function(_0xac01c2){ut[_0x3ad1('0x46')](_0x3ad1('0x47'),_0xac01c2);});}else{ut[_0x3ad1('0x46')](_0x3ad1('0x48'));}}Fax['prototype'][_0x3ad1('0x49')]=function(_0x72c1bd,_0x2745aa,_0x4081d4){var _0x2bf530=this;var _0x587005={};if(_0x2745aa){_0x587005={'read':_0x2745aa};}else{_0x587005={'failMessage':_0x4081d4};}if(this[_0x3ad1('0x29')][_0x72c1bd][_0x3ad1('0x43')]){faxMessage[_0x3ad1('0x44')](this[_0x3ad1('0x29')][_0x72c1bd][_0x3ad1('0x43')],_0x587005)[_0x3ad1('0x4a')](function(_0xd37419){ut[_0x3ad1('0x46')](_0x3ad1('0x4b'),_0xd37419);})[_0x3ad1('0x3f')](function(_0x5ce958){ut['logger'](_0x3ad1('0x4c'),_0x5ce958);})['finally'](function(){delete _0x2bf530[_0x3ad1('0xf')][_0x72c1bd];delete _0x2bf530[_0x3ad1('0x29')][_0x72c1bd];});}else{ut[_0x3ad1('0x46')]('[Fax][Message][NoUpdate2]');delete this[_0x3ad1('0xf')][_0x72c1bd];delete this['actions'][_0x72c1bd];}};Fax[_0x3ad1('0x20')]['syncHangup']=function(_0x3adc3f){var _0x36fef3=this;if(this['channels'][_0x3adc3f[_0x3ad1('0x24')]]){if(this[_0x3ad1('0x29')][_0x3adc3f[_0x3ad1('0x24')]]){this[_0x3ad1('0xf')][_0x3adc3f[_0x3ad1('0x24')]]['id']=this['actions'][_0x3adc3f[_0x3ad1('0x24')]]['id'];this['channels'][_0x3adc3f[_0x3ad1('0x24')]][_0x3ad1('0x26')]=this[_0x3ad1('0x29')][_0x3adc3f[_0x3ad1('0x24')]][_0x3ad1('0x26')];}logger[_0x3ad1('0x27')](_0x3adc3f[_0x3ad1('0x24')],this[_0x3ad1('0x29')][_0x3adc3f['uniqueid']]?_0x3ad1('0x4d'):_0x3ad1('0x4e'),JSON[_0x3ad1('0x3e')](this[_0x3ad1('0xf')][_0x3adc3f[_0x3ad1('0x24')]]));if(this[_0x3ad1('0x29')][_0x3adc3f['uniqueid']]){if(this[_0x3ad1('0xf')][_0x3adc3f[_0x3ad1('0x24')]][_0x3ad1('0x4f')]>0x0&&this[_0x3ad1('0xf')][_0x3adc3f[_0x3ad1('0x24')]][_0x3ad1('0x50')]===_0x3ad1('0x51')){this['updateStatus'](_0x3adc3f['uniqueid'],!![]);}else{this[_0x3ad1('0x49')](_0x3adc3f[_0x3ad1('0x24')],![],this[_0x3ad1('0xf')][_0x3adc3f[_0x3ad1('0x24')]][_0x3ad1('0x52')]?_0x3ad1('0x53')+this[_0x3ad1('0xf')][_0x3adc3f['uniqueid']][_0x3ad1('0x52')]:_0x3ad1('0x54'));}}}};Fax[_0x3ad1('0x20')][_0x3ad1('0x55')]=function(_0x569d9a){var _0x4da588=this;return new BPromise(function(_0x105eb1,_0x4fa043){_0x4da588[_0x3ad1('0x56')](_0x569d9a,_0x4da588[_0x3ad1('0x10')][_0x569d9a['FaxAccountId']])[_0x3ad1('0x4a')](function(_0x2be13e){ut[_0x3ad1('0x46')](_0x3ad1('0x57'),_0x2be13e);_0x105eb1(ut[_0x3ad1('0x58')](_0x3ad1('0x59')));})[_0x3ad1('0x3f')](function(_0x3ffe57){ut[_0x3ad1('0x46')](_0x3ad1('0x5a'),_0x3ffe57);updateStatus(_0x569d9a);_0x4fa043(ut[_0x3ad1('0x58')](_0x3ad1('0x5b')));});});};Fax['prototype']['checkAfterSend']=function(_0x242f86){var _0x3a72f5=this;return new BPromise(function(_0x35b49c,_0x4885c5){var _0x89620d=_0x3a72f5['checkTrunk'](_0x3a72f5[_0x3ad1('0x10')][_0x242f86[_0x3ad1('0x5c')]]['Trunk'],_0x242f86);if(_0x89620d[_0x3ad1('0x5d')]){_0x35b49c(ut[_0x3ad1('0x58')](_0x3ad1('0x5e')));}else{_0x4885c5(ut[_0x3ad1('0x58')](_0x89620d['message']));}});};function originate(_0x60e8c,_0x1fcb70,_0xedbe1c){return new BPromise(function(_0x211e1e,_0x35212b){if(_0xedbe1c){var _0x349cf4=util[_0x3ad1('0x5f')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x3ad1('0x3a')](_0x60e8c[_0x3ad1('0x4')])[_0x3ad1('0x26')],_0x60e8c['path']);gs[_0x3ad1('0x60')](_0x349cf4)[_0x3ad1('0x4a')](function(){_0x60e8c[_0x3ad1('0x4')]=util[_0x3ad1('0x5f')]('%s/%s.tif',path[_0x3ad1('0x3a')](_0x60e8c[_0x3ad1('0x4')])[_0x3ad1('0x61')],path[_0x3ad1('0x3a')](_0x60e8c[_0x3ad1('0x4')])['name']);_0x1fcb70[_0x3ad1('0x62')]=_0x60e8c[_0x3ad1('0x4')];ut['logger'](_0x3ad1('0x63'),'');ami[_0x3ad1('0x64')](ut[_0x3ad1('0x65')](_0x60e8c,_0x1fcb70))[_0x3ad1('0x4a')](function(_0x33b5c0){_0x211e1e(_0x33b5c0);})[_0x3ad1('0x3f')](function(_0x258351){_0x35212b(_0x258351);});})['catch'](function(_0x94a2fe){_0x35212b(_0x94a2fe);});}else{ami[_0x3ad1('0x64')](ut[_0x3ad1('0x65')](_0x60e8c,_0x1fcb70))[_0x3ad1('0x4a')](function(_0x10890c){_0x211e1e(_0x10890c);})[_0x3ad1('0x3f')](function(_0x5accdf){_0x35212b(_0x5accdf);});}});}Fax[_0x3ad1('0x20')]['execOriginate']=function(_0x1a0178,_0x4e4f32){var _0x4ce44c=this;return new BPromise(function(_0x1cc129,_0x5ce048){var _0x53b785=uuid['v4']();var _0x30cd07=ut[_0x3ad1('0x66')](_0x1a0178,_0x4e4f32);_0x4ce44c['actions'][_0x53b785]=new Action(_0x53b785,_0x4e4f32,_0x1a0178);var _0x317661=_0x4ce44c[_0x3ad1('0x29')][_0x53b785];if(path[_0x3ad1('0x3a')](_0x1a0178[_0x3ad1('0x4')])[_0x3ad1('0x67')]===_0x3ad1('0x3b')){originate(_0x317661,_0x30cd07,!![])[_0x3ad1('0x4a')](function(_0x3d1c03){_0x1cc129(_0x3d1c03);})[_0x3ad1('0x3f')](function(_0xd03d1b){_0x5ce048(_0xd03d1b);});}else{originate(_0x317661,_0x30cd07,![])[_0x3ad1('0x4a')](function(_0x1149c4){_0x1cc129(_0x1149c4);})[_0x3ad1('0x3f')](function(_0x1ce624){_0x5ce048(_0x1ce624);});}});};Fax[_0x3ad1('0x20')][_0x3ad1('0x68')]=function(_0x1ed19e){return!_[_0x3ad1('0x69')](_0x1ed19e)&&!_[_0x3ad1('0x69')](_0x1ed19e[_0x3ad1('0x26')])&&!_[_0x3ad1('0x69')](_0x1ed19e[_0x3ad1('0x6a')])&&_0x1ed19e[_0x3ad1('0x6a')]&&!_[_0x3ad1('0x69')](this[_0x3ad1('0x11')][util[_0x3ad1('0x5f')](_0x3ad1('0x6b'),_0x1ed19e[_0x3ad1('0x26')])])&&!_['isNil'](this[_0x3ad1('0x11')][util['format'](_0x3ad1('0x6b'),_0x1ed19e[_0x3ad1('0x26')])][_0x3ad1('0x2f')])&&(this[_0x3ad1('0x11')][util[_0x3ad1('0x5f')](_0x3ad1('0x6b'),_0x1ed19e['name'])][_0x3ad1('0x2f')]===_0x3ad1('0x6c')||this[_0x3ad1('0x11')][util['format'](_0x3ad1('0x6b'),_0x1ed19e[_0x3ad1('0x26')])][_0x3ad1('0x2f')]===_0x3ad1('0x6d'));};Fax['prototype']['checkTrunk']=function(_0x1f64b3,_0x2124d7){if(!this[_0x3ad1('0x68')](_0x1f64b3)){ut[_0x3ad1('0x46')](_0x3ad1('0x6e'),_[_0x3ad1('0x69')](_0x1f64b3)?'':_0x1f64b3[_0x3ad1('0x26')]+_0x3ad1('0x6f'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x3ad1('0x69')](_0x2124d7['fax'])){ut[_0x3ad1('0x46')](_0x3ad1('0x70'),JSON[_0x3ad1('0x3e')](_0x2124d7));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3ad1('0x69')](_0x2124d7[_0x3ad1('0x4')])){ut[_0x3ad1('0x46')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x3ad1('0x3e')](_0x2124d7));return{'isValid':![],'message':_0x3ad1('0x71')};}return{'isValid':!![],'message':_0x3ad1('0x72')};};module['exports']=Fax; \ No newline at end of file +var _0x5561=['./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','varset','syncVarSet','newstate','syncNewState','syncNewExten','bind','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','from-voip-provider','hasOwnProperty','faxAccounts','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel'];(function(_0x340048,_0x4e83d5){var _0x83ec6c=function(_0x5c7951){while(--_0x5c7951){_0x340048['push'](_0x340048['shift']());}};_0x83ec6c(++_0x4e83d5);}(_0x5561,0xe0));var _0x1556=function(_0xf334b7,_0x179c5f){_0xf334b7=_0xf334b7-0x0;var _0x25d407=_0x5561[_0xf334b7];return _0x25d407;};'use strict';var util=require(_0x1556('0x0'));var _=require(_0x1556('0x1'));var BPromise=require(_0x1556('0x2'));var uuid=require(_0x1556('0x3'));var moment=require(_0x1556('0x4'));var path=require(_0x1556('0x5'));var tiff2pdf=require(_0x1556('0x6'));var gs=require(_0x1556('0x7'));var logger=require(_0x1556('0x8'))(_0x1556('0x9'));var ami=require(_0x1556('0xa'));var rpcDb=require('./rpcDb');var Channel=require(_0x1556('0xb'));var ut=require(_0x1556('0xc'));var Action=require(_0x1556('0xd'));var faxAccount=require(_0x1556('0xe'));var attachment=require(_0x1556('0xf'));var faxMessage=require(_0x1556('0x10'));function Fax(_0x574d4a){this[_0x1556('0x11')]={};this['faxAccounts']=_0x574d4a['faxAccounts'];this[_0x1556('0x12')]=_0x574d4a[_0x1556('0x12')];this[_0x1556('0x13')]={};ami['on'](_0x1556('0x14'),this['syncNewchannel']['bind'](this));ami['on'](_0x1556('0x15'),this[_0x1556('0x16')]['bind'](this));ami['on'](_0x1556('0x17'),this[_0x1556('0x18')]['bind'](this));ami['on']('newexten',this[_0x1556('0x19')][_0x1556('0x1a')](this));ami['on'](_0x1556('0x1b'),this[_0x1556('0x1c')]['bind'](this));ami['on'](_0x1556('0x1d'),this[_0x1556('0x1e')][_0x1556('0x1a')](this));ami['on'](_0x1556('0x1f'),this[_0x1556('0x20')]['bind'](this));ami['on']('originateresponse',this[_0x1556('0x21')][_0x1556('0x1a')](this));}Fax[_0x1556('0x22')][_0x1556('0x23')]=function(_0x356df9){if(_0x356df9['context']===_0x1556('0x24')){for(var _0x2cd8db in this['faxAccounts']){if(this['faxAccounts'][_0x1556('0x25')](_0x2cd8db)){if(_0x356df9['exten']===this[_0x1556('0x26')][_0x2cd8db]['localstationid']){this['channels'][_0x356df9['uniqueid']]={};this[_0x1556('0x11')][_0x356df9[_0x1556('0x27')]][_0x1556('0x28')]=_0x356df9[_0x1556('0x28')];this[_0x1556('0x11')][_0x356df9[_0x1556('0x27')]]['id']=this[_0x1556('0x26')][_0x2cd8db]['id'];this[_0x1556('0x11')][_0x356df9[_0x1556('0x27')]]['name']=this[_0x1556('0x26')][_0x2cd8db][_0x1556('0x29')];logger[_0x1556('0x2a')](_0x356df9[_0x1556('0x27')],_0x1556('0x2b'));}}}}if(this[_0x1556('0x13')][_0x356df9[_0x1556('0x27')]]){this[_0x1556('0x11')][_0x356df9[_0x1556('0x27')]]={};this[_0x1556('0x11')][_0x356df9[_0x1556('0x27')]][_0x1556('0x28')]=_0x356df9[_0x1556('0x28')];logger[_0x1556('0x2a')](_0x356df9[_0x1556('0x27')],'\x20syncNewchannel\x20');}};Fax[_0x1556('0x22')][_0x1556('0x16')]=function(_0x2103bf){if(this[_0x1556('0x11')][_0x2103bf['uniqueid']]){for(var _0x1db561 in _0x2103bf[_0x1556('0x2c')]){if(_0x2103bf[_0x1556('0x2c')][_0x1556('0x25')](_0x1db561)){this[_0x1556('0x11')][_0x2103bf[_0x1556('0x27')]][_0x1db561]=_0x2103bf[_0x1556('0x2d')];}}}};Fax['prototype'][_0x1556('0x18')]=function(_0x21ea80){if(this[_0x1556('0x11')][_0x21ea80[_0x1556('0x27')]]){this[_0x1556('0x11')][_0x21ea80[_0x1556('0x27')]][_0x1556('0x2e')]=_0x21ea80[_0x1556('0x2e')];this['channels'][_0x21ea80[_0x1556('0x27')]][_0x1556('0x2f')]=_0x21ea80[_0x1556('0x2f')];}};Fax['prototype'][_0x1556('0x19')]=function(_0x5e84d4){if(this[_0x1556('0x11')][_0x5e84d4['uniqueid']]){for(var _0x230b13 in _0x5e84d4[_0x1556('0x2c')]){if(_0x5e84d4[_0x1556('0x2c')][_0x1556('0x25')](_0x230b13)){this['channels'][_0x5e84d4[_0x1556('0x27')]][_0x230b13]=_0x5e84d4['value'];}}}};Fax['prototype'][_0x1556('0x1c')]=function(_0x5eade9){if(this[_0x1556('0x11')][_0x5eade9['uniqueid']]){this[_0x1556('0x11')][_0x5eade9['uniqueid']][_0x1556('0x30')]=_0x5eade9[_0x1556('0x30')];this['channels'][_0x5eade9[_0x1556('0x27')]][_0x1556('0x31')]=_0x5eade9[_0x1556('0x31')];this[_0x1556('0x11')][_0x5eade9[_0x1556('0x27')]]['localstationid']=_0x5eade9[_0x1556('0x32')];this[_0x1556('0x11')][_0x5eade9[_0x1556('0x27')]]['filename']=_0x5eade9[_0x1556('0x33')];logger[_0x1556('0x2a')](_0x5eade9[_0x1556('0x27')],_0x1556('0x34'));}};Fax[_0x1556('0x22')]['syncReceiveFax']=function(_0x50325c){var _0x287d01=this;if(this['channels'][_0x50325c[_0x1556('0x27')]]){var _0x406c0f=this[_0x1556('0x11')][_0x50325c['uniqueid']]['id'];this[_0x1556('0x11')][_0x50325c[_0x1556('0x27')]][_0x1556('0x35')]=_0x50325c[_0x1556('0x35')];this[_0x1556('0x11')][_0x50325c['uniqueid']][_0x1556('0x36')]=_0x50325c[_0x1556('0x36')];this[_0x1556('0x11')][_0x50325c['uniqueid']][_0x1556('0x32')]=_0x50325c['localstationid'];this[_0x1556('0x11')][_0x50325c[_0x1556('0x27')]][_0x1556('0x37')]=_0x50325c['resolution'];this[_0x1556('0x11')][_0x50325c[_0x1556('0x27')]][_0x1556('0x38')]=_0x50325c[_0x1556('0x38')];this[_0x1556('0x11')][_0x50325c[_0x1556('0x27')]]['filename']=_0x50325c[_0x1556('0x33')];this[_0x1556('0x11')][_0x50325c[_0x1556('0x27')]][_0x1556('0x39')]=_0x50325c[_0x1556('0x39')];if(this[_0x1556('0x11')][_0x50325c[_0x1556('0x27')]][_0x1556('0x36')]>0x0){tiff2pdf(_0x50325c[_0x1556('0x33')],_0x1556('0x3a'),function(_0x82e7c){logger[_0x1556('0x2a')](_0x50325c[_0x1556('0x27')],_0x1556('0x3b'),_0x82e7c[_0x1556('0x3c')]);attachment[_0x1556('0x3d')]({'name':path[_0x1556('0x3e')](_0x50325c[_0x1556('0x33')])[_0x1556('0x29')],'basename':path['parse'](_0x50325c['filename'])[_0x1556('0x29')]+'.pdf','type':_0x1556('0x3f')})['then'](function(_0x4b8d23){faxAccount['notify'](_0x406c0f,{'from':_0x50325c['calleridnum'],'mapKey':_0x1556('0x9'),'body':path['parse'](_0x50325c[_0x1556('0x33')])[_0x1556('0x29')]+_0x1556('0x40'),'AttachmentId':_0x4b8d23['id']})[_0x1556('0x41')](function(_0x4626d4){logger[_0x1556('0x42')](_0x50325c[_0x1556('0x27')],_0x1556('0x43'),JSON[_0x1556('0x44')](_0x4626d4));});})[_0x1556('0x41')](function(_0x28df16){logger[_0x1556('0x42')](_0x50325c['uniqueid'],'\x20receiveFax\x20',JSON[_0x1556('0x44')](_0x28df16));});});}logger[_0x1556('0x2a')](_0x50325c[_0x1556('0x27')],_0x1556('0x45'));}};Fax[_0x1556('0x22')][_0x1556('0x21')]=function(_0x500720){if(this[_0x1556('0x13')][_0x500720[_0x1556('0x27')]]){_['merge'](this['channels'][_0x500720[_0x1556('0x27')]],_[_0x1556('0x46')](_0x500720,[_0x1556('0x47'),_0x1556('0x48')]));}};function updateStatus(_0x13434c){if(_0x13434c[_0x1556('0x49')]){faxMessage[_0x1556('0x4a')](_0x13434c[_0x1556('0x49')],{'failMessage':_0x1556('0x4b')})[_0x1556('0x4c')](function(_0x9c5eef){ut[_0x1556('0x4d')](_0x1556('0x4e'),_0x9c5eef);})[_0x1556('0x41')](function(_0x35dac8){ut[_0x1556('0x4d')](_0x1556('0x4f'),_0x35dac8);});}else{ut[_0x1556('0x4d')](_0x1556('0x50'));}}Fax[_0x1556('0x22')]['updateStatus']=function(_0x585964,_0x5a3636,_0x5ae0ad){var _0x5cfe68=this;var _0x477782={};if(_0x5a3636){_0x477782={'read':_0x5a3636};}else{_0x477782={'failMessage':_0x5ae0ad};}if(this[_0x1556('0x13')][_0x585964][_0x1556('0x49')]){faxMessage[_0x1556('0x4a')](this['actions'][_0x585964]['AttachmentId'],_0x477782)[_0x1556('0x4c')](function(_0x2422f2){ut[_0x1556('0x4d')]('[Fax][Message][Updated]',_0x2422f2);})['catch'](function(_0x5cb648){ut[_0x1556('0x4d')](_0x1556('0x51'),_0x5cb648);})[_0x1556('0x52')](function(){delete _0x5cfe68[_0x1556('0x11')][_0x585964];delete _0x5cfe68['actions'][_0x585964];});}else{ut[_0x1556('0x4d')](_0x1556('0x53'));delete this[_0x1556('0x11')][_0x585964];delete this[_0x1556('0x13')][_0x585964];}};Fax['prototype']['syncHangup']=function(_0x51d4ff){var _0x40f090=this;if(this['channels'][_0x51d4ff[_0x1556('0x27')]]){if(this['actions'][_0x51d4ff[_0x1556('0x27')]]){this[_0x1556('0x11')][_0x51d4ff[_0x1556('0x27')]]['id']=this[_0x1556('0x13')][_0x51d4ff[_0x1556('0x27')]]['id'];this[_0x1556('0x11')][_0x51d4ff[_0x1556('0x27')]]['name']=this[_0x1556('0x13')][_0x51d4ff['uniqueid']][_0x1556('0x29')];}logger[_0x1556('0x2a')](_0x51d4ff[_0x1556('0x27')],this['actions'][_0x51d4ff['uniqueid']]?_0x1556('0x54'):'\x20hangup\x20faxRiceive\x20',JSON[_0x1556('0x44')](this[_0x1556('0x11')][_0x51d4ff[_0x1556('0x27')]]));if(this[_0x1556('0x13')][_0x51d4ff[_0x1556('0x27')]]){if(this[_0x1556('0x11')][_0x51d4ff[_0x1556('0x27')]][_0x1556('0x55')]>0x0&&this['channels'][_0x51d4ff[_0x1556('0x27')]][_0x1556('0x1b')]==='SUCCESS'){this[_0x1556('0x56')](_0x51d4ff[_0x1556('0x27')],!![]);}else{this[_0x1556('0x56')](_0x51d4ff[_0x1556('0x27')],![],this['channels'][_0x51d4ff[_0x1556('0x27')]][_0x1556('0x57')]?_0x1556('0x58')+this['channels'][_0x51d4ff['uniqueid']][_0x1556('0x57')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x1556('0x59')]=function(_0x3cc0f8){var _0x110f6c=this;return new BPromise(function(_0x35139d,_0x3dbd84){_0x110f6c[_0x1556('0x5a')](_0x3cc0f8,_0x110f6c[_0x1556('0x26')][_0x3cc0f8[_0x1556('0x5b')]])[_0x1556('0x4c')](function(_0x23b1d1){ut['logger'](_0x1556('0x5c'),_0x23b1d1);_0x35139d(ut[_0x1556('0x3c')]('Fax\x20received'));})[_0x1556('0x41')](function(_0x137418){ut[_0x1556('0x4d')](_0x1556('0x5d'),_0x137418);updateStatus(_0x3cc0f8);_0x3dbd84(ut[_0x1556('0x3c')](_0x1556('0x5e')));});});};Fax[_0x1556('0x22')][_0x1556('0x5f')]=function(_0x4888d1){var _0x5b9117=this;return new BPromise(function(_0x3a7081,_0x3342f0){var _0x2e2212=_0x5b9117[_0x1556('0x60')](_0x5b9117[_0x1556('0x26')][_0x4888d1[_0x1556('0x5b')]]['Trunk'],_0x4888d1);if(_0x2e2212[_0x1556('0x61')]){_0x3a7081(ut['message'](_0x1556('0x62')));}else{_0x3342f0(ut[_0x1556('0x3c')](_0x2e2212[_0x1556('0x3c')]));}});};function originate(_0x92648a,_0x528253,_0x1219ef){return new BPromise(function(_0x3d3642,_0x5a3c3c){if(_0x1219ef){var _0x5a4e3e=util[_0x1556('0x63')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x1556('0x3e')](_0x92648a['path'])[_0x1556('0x29')],_0x92648a[_0x1556('0x5')]);gs[_0x1556('0x64')](_0x5a4e3e)[_0x1556('0x4c')](function(){_0x92648a[_0x1556('0x5')]=util[_0x1556('0x63')](_0x1556('0x65'),path[_0x1556('0x3e')](_0x92648a[_0x1556('0x5')])[_0x1556('0x66')],path['parse'](_0x92648a[_0x1556('0x5')])[_0x1556('0x29')]);_0x528253[_0x1556('0x67')]=_0x92648a[_0x1556('0x5')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x1556('0x68')](ut[_0x1556('0x69')](_0x92648a,_0x528253))[_0x1556('0x4c')](function(_0x45f043){_0x3d3642(_0x45f043);})[_0x1556('0x41')](function(_0x436a96){_0x5a3c3c(_0x436a96);});})['catch'](function(_0x44a635){_0x5a3c3c(_0x44a635);});}else{ami[_0x1556('0x68')](ut[_0x1556('0x69')](_0x92648a,_0x528253))['then'](function(_0x112e3c){_0x3d3642(_0x112e3c);})[_0x1556('0x41')](function(_0x2ca8b5){_0x5a3c3c(_0x2ca8b5);});}});}Fax[_0x1556('0x22')][_0x1556('0x5a')]=function(_0x59454b,_0x46641c){var _0x57d17c=this;return new BPromise(function(_0x5f44a7,_0x5d1df7){var _0x52e2e6=uuid['v4']();var _0x4c065f=ut['addVariables'](_0x59454b,_0x46641c);_0x57d17c[_0x1556('0x13')][_0x52e2e6]=new Action(_0x52e2e6,_0x46641c,_0x59454b);var _0x57aa57=_0x57d17c['actions'][_0x52e2e6];if(path[_0x1556('0x3e')](_0x59454b['path'])[_0x1556('0x6a')]===_0x1556('0x40')){originate(_0x57aa57,_0x4c065f,!![])['then'](function(_0x2f2085){_0x5f44a7(_0x2f2085);})[_0x1556('0x41')](function(_0x4b6535){_0x5d1df7(_0x4b6535);});}else{originate(_0x57aa57,_0x4c065f,![])['then'](function(_0x2d4e3c){_0x5f44a7(_0x2d4e3c);})[_0x1556('0x41')](function(_0x504abc){_0x5d1df7(_0x504abc);});}});};Fax['prototype'][_0x1556('0x6b')]=function(_0x504465){return!_[_0x1556('0x6c')](_0x504465)&&!_[_0x1556('0x6c')](_0x504465[_0x1556('0x29')])&&!_[_0x1556('0x6c')](_0x504465['active'])&&_0x504465['active']&&!_[_0x1556('0x6c')](this['trunks'][util[_0x1556('0x63')]('SIP/%s',_0x504465['name'])])&&!_[_0x1556('0x6c')](this[_0x1556('0x12')][util[_0x1556('0x63')](_0x1556('0x6d'),_0x504465[_0x1556('0x29')])][_0x1556('0x31')])&&(this[_0x1556('0x12')][util[_0x1556('0x63')]('SIP/%s',_0x504465[_0x1556('0x29')])][_0x1556('0x31')]===_0x1556('0x6e')||this[_0x1556('0x12')][util['format'](_0x1556('0x6d'),_0x504465[_0x1556('0x29')])][_0x1556('0x31')]==='unmonitored');};Fax[_0x1556('0x22')][_0x1556('0x60')]=function(_0x5c62c4,_0x147a77){if(!this[_0x1556('0x6b')](_0x5c62c4)){ut[_0x1556('0x4d')](_0x1556('0x6f'),_[_0x1556('0x6c')](_0x5c62c4)?'':_0x5c62c4[_0x1556('0x29')]+_0x1556('0x70'));return{'isValid':![],'message':_0x1556('0x71')};}if(_['isNil'](_0x147a77['fax'])){ut[_0x1556('0x4d')](_0x1556('0x72'),JSON[_0x1556('0x44')](_0x147a77));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x147a77['path'])){ut['logger'](_0x1556('0x73'),JSON[_0x1556('0x44')](_0x147a77));return{'isValid':![],'message':_0x1556('0x74')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x1556('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 01632bb..0b6aa31 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 _0xe939=['bluebird','../../../config/logger','preview','error','inspect','notify','resolve','then','catch','[Notify]\x20','util'];(function(_0x2b35bf,_0x1b9ea1){var _0x5701e4=function(_0x54e90e){while(--_0x54e90e){_0x2b35bf['push'](_0x2b35bf['shift']());}};_0x5701e4(++_0x1b9ea1);}(_0xe939,0xe6));var _0x9e93=function(_0x2f10b5,_0x19c385){_0x2f10b5=_0x2f10b5-0x0;var _0x320309=_0xe939[_0x2f10b5];return _0x320309;};'use strict';var util=require(_0x9e93('0x0'));var BPromise=require(_0x9e93('0x1'));var logger=require(_0x9e93('0x2'))(_0x9e93('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x455ef4){return function(_0x22d93b){logger[_0x9e93('0x4')](_0x455ef4,util[_0x9e93('0x5')](_0x22d93b,{'showHidden':![],'depth':null}));};}exports[_0x9e93('0x6')]=function(_0x333168,_0x17a8b2){return BPromise[_0x9e93('0x7')]()[_0x9e93('0x8')](faxAccount['notify'](_0x333168,_0x17a8b2))[_0x9e93('0x9')](loggerCatch(_0x9e93('0xa')));}; \ No newline at end of file +var _0x1534=['resolve','then','catch','util','bluebird','preview','lodash','error','notify'];(function(_0x5ad17f,_0x194835){var _0x181259=function(_0x159844){while(--_0x159844){_0x5ad17f['push'](_0x5ad17f['shift']());}};_0x181259(++_0x194835);}(_0x1534,0x1f2));var _0x4153=function(_0x11827d,_0x55ad0e){_0x11827d=_0x11827d-0x0;var _0x339122=_0x1534[_0x11827d];return _0x339122;};'use strict';var util=require(_0x4153('0x0'));var BPromise=require(_0x4153('0x1'));var logger=require('../../../config/logger')(_0x4153('0x2'));var _=require(_0x4153('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x39cf67){return function(_0x32d99c){logger[_0x4153('0x4')](_0x39cf67,util['inspect'](_0x32d99c,{'showHidden':![],'depth':null}));};}exports[_0x4153('0x5')]=function(_0x160e93,_0x348c66){return BPromise[_0x4153('0x6')]()[_0x4153('0x7')](faxAccount[_0x4153('0x5')](_0x160e93,_0x348c66))[_0x4153('0x8')](loggerCatch('[Notify]\x20'));}; \ 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 a38c65d..cffa28d 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 _0xeee3=['child_process','exec','execute','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird'];(function(_0xee6752,_0x667b44){var _0xb4dcea=function(_0x473d73){while(--_0x473d73){_0xee6752['push'](_0xee6752['shift']());}};_0xb4dcea(++_0x667b44);}(_0xeee3,0xa6));var _0x3eee=function(_0x330ac3,_0x2e66f9){_0x330ac3=_0x330ac3-0x0;var _0x49f3e3=_0xeee3[_0x330ac3];return _0x49f3e3;};'use strict';var util=require(_0x3eee('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x3eee('0x1'));var exec=require(_0x3eee('0x2'))[_0x3eee('0x3')];exports[_0x3eee('0x4')]=function(_0x343b0d){return new BPromise(function(_0x45634a,_0x4302f5){exec(_0x343b0d,function(_0x25a803,_0x525c49,_0x51abf0){logger['info'](_0x3eee('0x5'),_0x525c49);if(_0x25a803){logger['info'](_0x3eee('0x5'),_0x3eee('0x6'),util[_0x3eee('0x7')](_0x25a803,{'showHidden':![],'depth':null}),_0x525c49,_0x51abf0);_0x4302f5(_0x25a803);}_0x45634a(_0x525c49);});});}; \ No newline at end of file +var _0x6681=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','fax'];(function(_0x5bbe01,_0x1a36c3){var _0x416dc0=function(_0x4e93c1){while(--_0x4e93c1){_0x5bbe01['push'](_0x5bbe01['shift']());}};_0x416dc0(++_0x1a36c3);}(_0x6681,0x1ca));var _0x1668=function(_0x36735c,_0x34d3cc){_0x36735c=_0x36735c-0x0;var _0x4b3341=_0x6681[_0x36735c];return _0x4b3341;};'use strict';var util=require(_0x1668('0x0'));var logger=require('../../../../config/logger')(_0x1668('0x1'));var BPromise=require(_0x1668('0x2'));var exec=require(_0x1668('0x3'))[_0x1668('0x4')];exports[_0x1668('0x5')]=function(_0x5e84c2){return new BPromise(function(_0x57adbb,_0x2c9b34){exec(_0x5e84c2,function(_0x152cb2,_0x49cbab,_0x5a6563){logger[_0x1668('0x6')](_0x1668('0x7'),_0x49cbab);if(_0x152cb2){logger[_0x1668('0x6')]('Exec\x20gs',_0x1668('0x8'),util[_0x1668('0x9')](_0x152cb2,{'showHidden':![],'depth':null}),_0x49cbab,_0x5a6563);_0x2c9b34(_0x152cb2);}_0x57adbb(_0x49cbab);});});}; \ 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 d2796d3..f1fcee7 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 _0x6c81=['t38timeout','localstationid','variablesAction','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x3795c7,_0x18f05f){var _0x27175f=function(_0x3b926e){while(--_0x3b926e){_0x3795c7['push'](_0x3795c7['shift']());}};_0x27175f(++_0x18f05f);}(_0x6c81,0xaf));var _0x16c8=function(_0x2d321f,_0x196439){_0x2d321f=_0x2d321f-0x0;var _0x16744f=_0x6c81[_0x2d321f];return _0x16744f;};'use strict';var util=require(_0x16c8('0x0'));var _=require(_0x16c8('0x1'));var moment=require(_0x16c8('0x2'));var logger=require(_0x16c8('0x3'))(_0x16c8('0x4'));exports[_0x16c8('0x5')]=function(_0x3f213f){return{'message':_0x3f213f};};exports[_0x16c8('0x6')]=function(_0x32b3b0,_0x3dbaa1){logger[_0x16c8('0x7')](_0x32b3b0,util['inspect'](_0x3dbaa1,{'showHidden':![],'depth':null}));};exports[_0x16c8('0x8')]=function(_0x13471c,_0x4038f8){var _0x1ef138={'XMF-ECM':_0x4038f8[_0x16c8('0x9')],'XMF-HEADERINFO':_0x4038f8[_0x16c8('0xa')],'XMF-MINRATE':_0x4038f8[_0x16c8('0xb')],'XMF-MAXRATE':_0x4038f8['maxrate'],'XMF-MODEM':util[_0x16c8('0xc')](_0x16c8('0xd'),_0x4038f8[_0x16c8('0xe')]),'XMF-GATEWAY':_0x4038f8[_0x16c8('0xf')],'XMF-FAXDETECT':_0x4038f8[_0x16c8('0x10')],'XMF-T38TIMEOUT':_0x4038f8[_0x16c8('0x11')],'XMF-LOCALSTATIONID':_0x4038f8[_0x16c8('0x12')],'XMF-PATH':_0x13471c['path']};return _0x1ef138;};exports[_0x16c8('0x13')]=function(_0x3ab3d7,_0x1fea62){return{'actionid':_0x3ab3d7[_0x16c8('0x14')],'action':'originate','channel':_0x3ab3d7[_0x16c8('0x15')],'Exten':'xcally-motion-fax','Context':_0x16c8('0x16'),'Priority':'1','callerid':util[_0x16c8('0xc')](_0x16c8('0x17'),_0x3ab3d7['headerinfo']?_0x3ab3d7[_0x16c8('0xa')]:'',_0x3ab3d7[_0x16c8('0x12')]),'variable':_0x1fea62,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3ab3d7[_0x16c8('0x14')]};}; \ No newline at end of file +var _0x7ef8=['maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','path','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','uniqueid','util','lodash','../../../../config/logger','fax','logger','info','ecm','minrate'];(function(_0x2f6915,_0xac98e9){var _0x5b617a=function(_0x28ca94){while(--_0x28ca94){_0x2f6915['push'](_0x2f6915['shift']());}};_0x5b617a(++_0xac98e9);}(_0x7ef8,0x1f0));var _0x87ef=function(_0x5458f4,_0x4d3557){_0x5458f4=_0x5458f4-0x0;var _0x4dcace=_0x7ef8[_0x5458f4];return _0x4dcace;};'use strict';var util=require(_0x87ef('0x0'));var _=require(_0x87ef('0x1'));var moment=require('moment');var logger=require(_0x87ef('0x2'))(_0x87ef('0x3'));exports['message']=function(_0x5222d4){return{'message':_0x5222d4};};exports[_0x87ef('0x4')]=function(_0x53cac9,_0x4aaa2e){logger[_0x87ef('0x5')](_0x53cac9,util['inspect'](_0x4aaa2e,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x13e894,_0x2e64e7){var _0x2782d7={'XMF-ECM':_0x2e64e7[_0x87ef('0x6')],'XMF-HEADERINFO':_0x2e64e7['headerinfo'],'XMF-MINRATE':_0x2e64e7[_0x87ef('0x7')],'XMF-MAXRATE':_0x2e64e7[_0x87ef('0x8')],'XMF-MODEM':util[_0x87ef('0x9')](_0x87ef('0xa'),_0x2e64e7['modem']),'XMF-GATEWAY':_0x2e64e7[_0x87ef('0xb')],'XMF-FAXDETECT':_0x2e64e7[_0x87ef('0xc')],'XMF-T38TIMEOUT':_0x2e64e7[_0x87ef('0xd')],'XMF-LOCALSTATIONID':_0x2e64e7['localstationid'],'XMF-PATH':_0x13e894[_0x87ef('0xe')]};return _0x2782d7;};exports['variablesAction']=function(_0x207094,_0xfbf43e){return{'actionid':_0x207094['uniqueid'],'action':'originate','channel':_0x207094['channel'],'Exten':_0x87ef('0xf'),'Context':_0x87ef('0x10'),'Priority':'1','callerid':util[_0x87ef('0x9')](_0x87ef('0x11'),_0x207094[_0x87ef('0x12')]?_0x207094[_0x87ef('0x12')]:'',_0x207094[_0x87ef('0x13')]),'variable':_0xfbf43e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x207094[_0x87ef('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 3c64869..8ccb019 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 _0x27e0=['./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','get','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk'];(function(_0x1b5e41,_0x424654){var _0x3daae5=function(_0x46bafe){while(--_0x46bafe){_0x1b5e41['push'](_0x1b5e41['shift']());}};_0x3daae5(++_0x424654);}(_0x27e0,0x162));var _0x027e=function(_0x3aec37,_0x141879){_0x3aec37=_0x3aec37-0x0;var _0x3d0934=_0x27e0[_0x3aec37];return _0x3d0934;};'use strict';var BPromise=require(_0x027e('0x0'));var util=require(_0x027e('0x1'));var moment=require(_0x027e('0x2'));var server=require(_0x027e('0x3'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x027e('0x4'));var Trigger=require(_0x027e('0x5'));var Dialer=require('./dialer');var Preview=require(_0x027e('0x6'));var Fax=require(_0x027e('0x7'));var user=require(_0x027e('0x8'));var voiceQueue=require(_0x027e('0x9'));var voiceQueueReport=require(_0x027e('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x027e('0xb'));var trigger=require(_0x027e('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0x027e('0xd'));var campaign=require(_0x027e('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x027e('0xf'));var salesforce=require(_0x027e('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x027e('0x11'));var zoho=require(_0x027e('0x12'));var vtiger=require(_0x027e('0x13'));var freshsales=require(_0x027e('0x14'));var servicenow=require(_0x027e('0x15'));var dynamics365=require(_0x027e('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x027e('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x027e('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x027e('0x19')](_0x027e('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x027e('0x1a')]()[_0x027e('0x1b')](user[_0x027e('0x1c')]())[_0x027e('0x1b')](realtime[_0x027e('0x1d')]())['then'](user[_0x027e('0x1e')]())[_0x027e('0x1b')](realtime[_0x027e('0x1f')]())['then'](trunk['getTrunks']())[_0x027e('0x1b')](realtime[_0x027e('0x20')]())[_0x027e('0x1b')](voiceQueue[_0x027e('0x21')]())['then'](realtime[_0x027e('0x22')]())[_0x027e('0x1b')](trigger[_0x027e('0x23')]())['then'](realtime[_0x027e('0x24')]())['then'](template[_0x027e('0x25')]())[_0x027e('0x1b')](realtime['initTemplates']())[_0x027e('0x1b')](zendesk['getZendeskAccounts']())[_0x027e('0x1b')](realtime[_0x027e('0x26')]())[_0x027e('0x1b')](salesforce[_0x027e('0x27')]())['then'](realtime[_0x027e('0x28')]())['then'](sugarcrm[_0x027e('0x29')]())[_0x027e('0x1b')](realtime['initSugarcrmAccounts']())[_0x027e('0x1b')](freshdesk[_0x027e('0x2a')]())['then'](realtime[_0x027e('0x2b')]())[_0x027e('0x1b')](desk[_0x027e('0x2c')]())[_0x027e('0x1b')](realtime[_0x027e('0x2d')]())[_0x027e('0x1b')](zoho['getZohoAccounts']())[_0x027e('0x1b')](realtime[_0x027e('0x2e')]())['then'](vtiger[_0x027e('0x2f')]())['then'](realtime[_0x027e('0x30')]())['then'](freshsales[_0x027e('0x31')]())[_0x027e('0x1b')](realtime['initFreshsalesAccounts']())[_0x027e('0x1b')](servicenow[_0x027e('0x32')]())[_0x027e('0x1b')](realtime[_0x027e('0x33')]())[_0x027e('0x1b')](dynamics365['getDynamics365Accounts']())[_0x027e('0x1b')](realtime[_0x027e('0x34')]())[_0x027e('0x1b')](campaign[_0x027e('0x35')]())[_0x027e('0x1b')](realtime[_0x027e('0x36')]())[_0x027e('0x1b')](voiceExtension[_0x027e('0x37')]())[_0x027e('0x1b')](realtime[_0x027e('0x38')]())[_0x027e('0x1b')](faxAccount[_0x027e('0x39')]())[_0x027e('0x1b')](realtime[_0x027e('0x3a')]())[_0x027e('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x027e('0x1a')]()['then'](voiceQueueReport[_0x027e('0x3b')]())[_0x027e('0x1b')](realtime[_0x027e('0x3c')]())[_0x027e('0x1b')](cmHopperHistory[_0x027e('0x3d')]())['then'](realtime[_0x027e('0x3e')]())['then'](cmHopperHistory[_0x027e('0x3f')]())[_0x027e('0x1b')](realtime[_0x027e('0x40')]())[_0x027e('0x1b')](voiceCallReport[_0x027e('0x41')]())[_0x027e('0x1b')](realtime[_0x027e('0x42')]())[_0x027e('0x43')](function(_0xa60af7){logger[_0x027e('0x44')](_0x027e('0x45'),util[_0x027e('0x46')](_0xa60af7,{'showHidden':![],'depth':null}));});}function main(){return server[_0x027e('0x47')](realtime,preview,fax)[_0x027e('0x1b')](function(_0x21779b){return initRealtime();})[_0x027e('0x1b')](function(){return initParams();})['then'](function(){report[_0x027e('0x48')]();setInterval(initRealtime,0x1388);})[_0x027e('0x43')](function(_0x355163){logger[_0x027e('0x44')](_0x027e('0x49'),util[_0x027e('0x46')](_0x355163,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xd129=['catch','[index.js][initParams]','sync','error','inspect','bluebird','moment','./server','./trigger','./dialer','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','initAgents','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports'];(function(_0x27acbf,_0xe7afec){var _0xf93fc8=function(_0x1a91f7){while(--_0x1a91f7){_0x27acbf['push'](_0x27acbf['shift']());}};_0xf93fc8(++_0xe7afec);}(_0xd129,0xd7));var _0x9d12=function(_0x363b35,_0x2b1221){_0x363b35=_0x363b35-0x0;var _0xad2208=_0xd129[_0x363b35];return _0xad2208;};'use strict';var BPromise=require(_0x9d12('0x0'));var util=require('util');var moment=require(_0x9d12('0x1'));var server=require(_0x9d12('0x2'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x9d12('0x3'));var Dialer=require(_0x9d12('0x4'));var Preview=require('./preview');var Fax=require(_0x9d12('0x5'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x9d12('0x6'));var voiceCallReport=require(_0x9d12('0x7'));var trunk=require(_0x9d12('0x8'));var trigger=require(_0x9d12('0x9'));var template=require('./rpc/template');var cmHopperHistory=require(_0x9d12('0xa'));var campaign=require(_0x9d12('0xb'));var voiceExtension=require(_0x9d12('0xc'));var faxAccount=require(_0x9d12('0xd'));var zendesk=require(_0x9d12('0xe'));var salesforce=require(_0x9d12('0xf'));var sugarcrm=require(_0x9d12('0x10'));var freshdesk=require(_0x9d12('0x11'));var desk=require(_0x9d12('0x12'));var zoho=require(_0x9d12('0x13'));var vtiger=require(_0x9d12('0x14'));var freshsales=require(_0x9d12('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x9d12('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x9d12('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x9d12('0x18')](_0x9d12('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9d12('0x18')](_0x9d12('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x9d12('0x1a')]()[_0x9d12('0x1b')](user['getAgents']())[_0x9d12('0x1b')](realtime[_0x9d12('0x1c')]())['then'](user['getTelephones']())[_0x9d12('0x1b')](realtime[_0x9d12('0x1d')]())[_0x9d12('0x1b')](trunk[_0x9d12('0x1e')]())[_0x9d12('0x1b')](realtime['initTrunks']())['then'](voiceQueue[_0x9d12('0x1f')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x20')]())[_0x9d12('0x1b')](trigger[_0x9d12('0x21')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x22')]())[_0x9d12('0x1b')](template[_0x9d12('0x23')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x24')]())[_0x9d12('0x1b')](zendesk[_0x9d12('0x25')]())['then'](realtime[_0x9d12('0x26')]())[_0x9d12('0x1b')](salesforce['getSalesforceAccounts']())[_0x9d12('0x1b')](realtime['initSalesforceAccounts']())[_0x9d12('0x1b')](sugarcrm[_0x9d12('0x27')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x28')]())[_0x9d12('0x1b')](freshdesk[_0x9d12('0x29')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x2a')]())[_0x9d12('0x1b')](desk[_0x9d12('0x2b')]())['then'](realtime[_0x9d12('0x2c')]())['then'](zoho[_0x9d12('0x2d')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x2e')]())[_0x9d12('0x1b')](vtiger[_0x9d12('0x2f')]())['then'](realtime[_0x9d12('0x30')]())[_0x9d12('0x1b')](freshsales[_0x9d12('0x31')]())['then'](realtime[_0x9d12('0x32')]())[_0x9d12('0x1b')](servicenow['getServicenowAccounts']())[_0x9d12('0x1b')](realtime[_0x9d12('0x33')]())[_0x9d12('0x1b')](dynamics365[_0x9d12('0x34')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x35')]())['then'](campaign[_0x9d12('0x36')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x37')]())['then'](voiceExtension[_0x9d12('0x38')]())['then'](realtime[_0x9d12('0x39')]())[_0x9d12('0x1b')](faxAccount[_0x9d12('0x3a')]())['then'](realtime[_0x9d12('0x3b')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x9d12('0x1b')](realtime[_0x9d12('0x3c')]())[_0x9d12('0x1b')](cmHopperHistory[_0x9d12('0x3d')]())[_0x9d12('0x1b')](realtime['initVoiceQueueHopperHistory']())[_0x9d12('0x1b')](cmHopperHistory[_0x9d12('0x3e')]())[_0x9d12('0x1b')](realtime[_0x9d12('0x3f')]())['then'](voiceCallReport[_0x9d12('0x40')]())['then'](realtime['initVoiceCallReports']())[_0x9d12('0x41')](function(_0x4faa74){logger['error'](_0x9d12('0x42'),util['inspect'](_0x4faa74,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x9d12('0x1b')](function(_0x5b52dc){return initRealtime();})[_0x9d12('0x1b')](function(){return initParams();})[_0x9d12('0x1b')](function(){report[_0x9d12('0x43')]();setInterval(initRealtime,0x1388);})[_0x9d12('0x41')](function(_0x2195e6){logger[_0x9d12('0x44')]('[index.js][main]',util[_0x9d12('0x45')](_0x2195e6,{'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 de0d13f..b3f3be4 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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x34fa20,_0x1537bd){var _0xb3f4eb=function(_0x2841f8){while(--_0x2841f8){_0x34fa20['push'](_0x34fa20['shift']());}};_0xb3f4eb(++_0x1537bd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0xcb91[_0x45313f];return _0x402910;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x4cd87e,_0x522dc8){var _0x370686=function(_0x1a556c){while(--_0x1a556c){_0x4cd87e['push'](_0x4cd87e['shift']());}};_0x370686(++_0x522dc8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xcb91[_0x19d350];return _0x3bfc8d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 43842bf..f67568f 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 _0x8c1c=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active'];(function(_0x260360,_0xdcca2f){var _0x1db10b=function(_0x16e804){while(--_0x16e804){_0x260360['push'](_0x260360['shift']());}};_0x1db10b(++_0xdcca2f);}(_0x8c1c,0x163));var _0xc8c1=function(_0x492ec1,_0x1b62bd){_0x492ec1=_0x492ec1-0x0;var _0x4cfb7e=_0x8c1c[_0x492ec1];return _0x4cfb7e;};'use strict';function Campaign(_0x16ff83){this['id']=_0x16ff83['id']||0x0;this[_0xc8c1('0x0')]=_0x16ff83['name']||'';this[_0xc8c1('0x1')]=_0x16ff83[_0xc8c1('0x1')]||_0xc8c1('0x2');this['originated']=0x0;this[_0xc8c1('0x3')]=0x0;this[_0xc8c1('0x4')]=0x0;this[_0xc8c1('0x5')]=0x0;this[_0xc8c1('0x6')]='';this[_0xc8c1('0x7')]=!![];this[_0xc8c1('0x8')]=_0x16ff83[_0xc8c1('0x8')];this[_0xc8c1('0x9')]=_0x16ff83[_0xc8c1('0x9')];this[_0xc8c1('0xa')]=_0x16ff83[_0xc8c1('0xa')]||null;this[_0xc8c1('0xb')]=_0x16ff83[_0xc8c1('0xb')]?_0x16ff83[_0xc8c1('0xb')]:null;this[_0xc8c1('0xc')]=_0x16ff83[_0xc8c1('0xc')];this[_0xc8c1('0xd')]=_0x16ff83[_0xc8c1('0xd')];this[_0xc8c1('0xe')]=_0x16ff83[_0xc8c1('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x16ff83[_0xc8c1('0xf')];this[_0xc8c1('0x10')]=_0x16ff83[_0xc8c1('0x10')];this[_0xc8c1('0x11')]=_0x16ff83[_0xc8c1('0x11')];this[_0xc8c1('0x12')]=_0x16ff83[_0xc8c1('0x12')];this[_0xc8c1('0x13')]=_0x16ff83[_0xc8c1('0x13')];this[_0xc8c1('0x14')]=_0x16ff83[_0xc8c1('0x14')];this[_0xc8c1('0x15')]=_0x16ff83[_0xc8c1('0x15')];this['dialNoSuchNumberMaxRetry']=_0x16ff83[_0xc8c1('0x16')]||0x3;this[_0xc8c1('0x17')]=_0x16ff83[_0xc8c1('0x17')]||0x96;this[_0xc8c1('0x18')]=_0x16ff83[_0xc8c1('0x18')]||0x3;this[_0xc8c1('0x19')]=_0x16ff83[_0xc8c1('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x16ff83[_0xc8c1('0x1a')]||0x3;this['dialAbandonedRetryFrequency']=_0x16ff83[_0xc8c1('0x1b')]||0x96;this[_0xc8c1('0x1c')]=_0x16ff83[_0xc8c1('0x1c')]||0x3;this['dialMachineRetryFrequency']=_0x16ff83[_0xc8c1('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x16ff83[_0xc8c1('0x1e')]||0x3;this[_0xc8c1('0x1f')]=_0x16ff83[_0xc8c1('0x1f')]||0x96;this[_0xc8c1('0x20')]=_0x16ff83[_0xc8c1('0x20')]||_0xc8c1('0x21');this[_0xc8c1('0x22')]=_0x16ff83[_0xc8c1('0x22')]||undefined;this[_0xc8c1('0x23')]=_0x16ff83['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xc8c1('0x24')]=_0x16ff83[_0xc8c1('0x24')]||undefined;this['TrunkBackup']=_0x16ff83[_0xc8c1('0x25')]?_0x16ff83[_0xc8c1('0x25')]:undefined;this[_0xc8c1('0x26')]=_0x16ff83[_0xc8c1('0x26')]?_0x16ff83[_0xc8c1('0x26')]:undefined;this[_0xc8c1('0x27')]=_0x16ff83[_0xc8c1('0x27')]?_0x16ff83[_0xc8c1('0x27')]:undefined;this['SquareProject']=_0x16ff83[_0xc8c1('0x28')]?_0x16ff83['SquareProject']:undefined;this['dialQueueProject']=_0x16ff83['SquareProject']?_0x16ff83[_0xc8c1('0x28')][_0xc8c1('0x0')]:undefined;this['dialAMDActive']=_0x16ff83[_0xc8c1('0x29')]||![];this[_0xc8c1('0x2a')]=_0x16ff83[_0xc8c1('0x2a')];this[_0xc8c1('0x2b')]=_0x16ff83[_0xc8c1('0x2b')];this[_0xc8c1('0x2c')]=_0x16ff83[_0xc8c1('0x2c')];this[_0xc8c1('0x2d')]=_0x16ff83[_0xc8c1('0x2d')];this[_0xc8c1('0x2e')]=_0x16ff83['dialAMDMinWordLength'];this[_0xc8c1('0x2f')]=_0x16ff83[_0xc8c1('0x2f')];this[_0xc8c1('0x30')]=_0x16ff83[_0xc8c1('0x30')];this[_0xc8c1('0x31')]=_0x16ff83['dialAMDSilenceThreshold'];this[_0xc8c1('0x32')]=_0x16ff83[_0xc8c1('0x32')];}module[_0xc8c1('0x33')]=Campaign; \ No newline at end of file +var _0xca03=['dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x3b20e7,_0x15f271){var _0x1ee024=function(_0x3e9b23){while(--_0x3e9b23){_0x3b20e7['push'](_0x3b20e7['shift']());}};_0x1ee024(++_0x15f271);}(_0xca03,0xf1));var _0x3ca0=function(_0x43cb15,_0x3b1da8){_0x43cb15=_0x43cb15-0x0;var _0x194727=_0xca03[_0x43cb15];return _0x194727;};'use strict';function Campaign(_0x26ee6b){this['id']=_0x26ee6b['id']||0x0;this[_0x3ca0('0x0')]=_0x26ee6b[_0x3ca0('0x0')]||'';this[_0x3ca0('0x1')]=_0x26ee6b['type']||_0x3ca0('0x2');this[_0x3ca0('0x3')]=0x0;this[_0x3ca0('0x4')]=0x0;this[_0x3ca0('0x5')]=0x0;this[_0x3ca0('0x6')]=0x0;this[_0x3ca0('0x7')]='';this[_0x3ca0('0x8')]=!![];this[_0x3ca0('0x9')]=_0x26ee6b['active'];this['limitCalls']=_0x26ee6b['limitCalls'];this[_0x3ca0('0xa')]=_0x26ee6b[_0x3ca0('0xa')]||null;this[_0x3ca0('0xb')]=_0x26ee6b[_0x3ca0('0xb')]?_0x26ee6b['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x26ee6b[_0x3ca0('0xc')];this['dialOriginateCallerIdNumber']=_0x26ee6b['dialOriginateCallerIdNumber'];this[_0x3ca0('0xd')]=_0x26ee6b[_0x3ca0('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x26ee6b['dialCongestionMaxRetry'];this[_0x3ca0('0xe')]=_0x26ee6b['dialCongestionRetryFrequency'];this[_0x3ca0('0xf')]=_0x26ee6b[_0x3ca0('0xf')];this[_0x3ca0('0x10')]=_0x26ee6b['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x26ee6b[_0x3ca0('0x11')];this[_0x3ca0('0x12')]=_0x26ee6b[_0x3ca0('0x12')];this[_0x3ca0('0x13')]=_0x26ee6b['dialGlobalMaxRetry'];this[_0x3ca0('0x14')]=_0x26ee6b[_0x3ca0('0x14')]||0x3;this[_0x3ca0('0x15')]=_0x26ee6b[_0x3ca0('0x15')]||0x96;this['dialDropMaxRetry']=_0x26ee6b[_0x3ca0('0x16')]||0x3;this[_0x3ca0('0x17')]=_0x26ee6b['dialDropRetryFrequency']||0x96;this[_0x3ca0('0x18')]=_0x26ee6b['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x26ee6b[_0x3ca0('0x19')]||0x96;this['dialMachineMaxRetry']=_0x26ee6b[_0x3ca0('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x26ee6b[_0x3ca0('0x1b')]||0x96;this[_0x3ca0('0x1c')]=_0x26ee6b[_0x3ca0('0x1c')]||0x3;this[_0x3ca0('0x1d')]=_0x26ee6b[_0x3ca0('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x26ee6b[_0x3ca0('0x1e')]||_0x3ca0('0x1f');this[_0x3ca0('0x20')]=_0x26ee6b['dialPrefix']||undefined;this[_0x3ca0('0x21')]=_0x26ee6b[_0x3ca0('0x21')]||undefined;this[_0x3ca0('0x22')]=_0x26ee6b['dialCutDigit']||undefined;this[_0x3ca0('0x23')]=_0x26ee6b[_0x3ca0('0x23')]?_0x26ee6b[_0x3ca0('0x23')]:undefined;this['Trunk']=_0x26ee6b['Trunk']?_0x26ee6b[_0x3ca0('0x24')]:undefined;this['Interval']=_0x26ee6b[_0x3ca0('0x25')]?_0x26ee6b[_0x3ca0('0x25')]:undefined;this['SquareProject']=_0x26ee6b[_0x3ca0('0x26')]?_0x26ee6b['SquareProject']:undefined;this[_0x3ca0('0x27')]=_0x26ee6b[_0x3ca0('0x26')]?_0x26ee6b[_0x3ca0('0x26')][_0x3ca0('0x0')]:undefined;this['dialAMDActive']=_0x26ee6b[_0x3ca0('0x28')]||![];this[_0x3ca0('0x29')]=_0x26ee6b[_0x3ca0('0x29')];this['dialAMDGreeting']=_0x26ee6b[_0x3ca0('0x2a')];this['dialAMDAfterGreetingSilence']=_0x26ee6b['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x26ee6b['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x26ee6b[_0x3ca0('0x2b')];this['dialAMDBetweenWordsSilence']=_0x26ee6b[_0x3ca0('0x2c')];this[_0x3ca0('0x2d')]=_0x26ee6b['dialAMDMaximumNumberOfWords'];this[_0x3ca0('0x2e')]=_0x26ee6b[_0x3ca0('0x2e')];this[_0x3ca0('0x2f')]=_0x26ee6b[_0x3ca0('0x2f')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index f123167..7dd56a0 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 _0x151b=['starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','linkedid','exten','answertime','endtime','abandoned','lastapplication','duration','billableseconds','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime'];(function(_0x23d7c5,_0x472ba6){var _0x303fe4=function(_0x5f1253){while(--_0x5f1253){_0x23d7c5['push'](_0x23d7c5['shift']());}};_0x303fe4(++_0x472ba6);}(_0x151b,0x152));var _0xb151=function(_0x308590,_0x4bdd65){_0x308590=_0x308590-0x0;var _0x32cbb7=_0x151b[_0x308590];return _0x32cbb7;};'use strict';function Channel(){this[_0xb151('0x0')]=null;this[_0xb151('0x1')]='';this[_0xb151('0x2')]='';this[_0xb151('0x3')]=0x0;this[_0xb151('0x4')]='';this[_0xb151('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xb151('0x6')]=0x0;this['context']='';this[_0xb151('0x7')]=0x0;this[_0xb151('0x8')]=0x0;this[_0xb151('0x9')]=0x0;this['answered']=![];this[_0xb151('0xa')]=null;this[_0xb151('0xb')]=null;this['unmanaged']=![];this[_0xb151('0xc')]=![];this[_0xb151('0xd')]='';this['lastdata']='';this[_0xb151('0xe')]=0x0;this[_0xb151('0xf')]=0x0;this['holdtime']=0x0;this[_0xb151('0x10')]=null;this[_0xb151('0x11')]=null;this[_0xb151('0x12')]=null;this[_0xb151('0x13')]=![];this[_0xb151('0x14')]=null;this['queue']=null;this[_0xb151('0x15')]=[];this[_0xb151('0x16')]=undefined;this[_0xb151('0x17')]=undefined;this[_0xb151('0x18')]=undefined;this[_0xb151('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x8107=['exports','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','answertime','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x8107,0x109));var _0x7810=function(_0x4fa1b0,_0x3cafac){_0x4fa1b0=_0x4fa1b0-0x0;var _0x3c2e33=_0x8107[_0x4fa1b0];return _0x3c2e33;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x7810('0x0')]='';this[_0x7810('0x1')]=0x0;this[_0x7810('0x2')]='';this[_0x7810('0x3')]=undefined;this[_0x7810('0x4')]=undefined;this['accountcode']=0x0;this[_0x7810('0x5')]='';this[_0x7810('0x6')]=0x0;this[_0x7810('0x7')]=0x0;this['exten']=0x0;this['answered']=![];this[_0x7810('0x8')]=null;this['endtime']=null;this['unmanaged']=![];this[_0x7810('0x9')]=![];this[_0x7810('0xa')]='';this[_0x7810('0xb')]='';this['duration']=0x0;this[_0x7810('0xc')]=0x0;this[_0x7810('0xd')]=0x0;this[_0x7810('0xe')]=null;this['tag']=null;this[_0x7810('0xf')]=null;this[_0x7810('0x10')]=![];this[_0x7810('0x11')]=null;this[_0x7810('0x12')]=null;this[_0x7810('0x13')]=[];this[_0x7810('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x7810('0x15')]=undefined;this[_0x7810('0x16')]=0x0;}module[_0x7810('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 728f4bf..afcae33 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 _0x90e7=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x439614,_0x4a3f3d){var _0x4a7560=function(_0x255301){while(--_0x255301){_0x439614['push'](_0x439614['shift']());}};_0x4a7560(++_0x4a3f3d);}(_0x90e7,0x1b0));var _0x790e=function(_0x429bc0,_0x244ced){_0x429bc0=_0x429bc0-0x0;var _0x4be5bb=_0x90e7[_0x429bc0];return _0x4be5bb;};'use strict';function DeskAccount(_0x4d6d66){this['id']=_0x4d6d66['id']||0x0;this[_0x790e('0x0')]=_0x4d6d66[_0x790e('0x0')]||'';this[_0x790e('0x1')]=_0x4d6d66[_0x790e('0x1')]||'';this[_0x790e('0x2')]=_0x4d6d66[_0x790e('0x2')]||'';this[_0x790e('0x3')]=_0x4d6d66['authType']||'';this[_0x790e('0x4')]=_0x4d6d66[_0x790e('0x4')]||'';this[_0x790e('0x5')]=_0x4d6d66[_0x790e('0x5')]||'';this[_0x790e('0x6')]=_0x4d6d66[_0x790e('0x6')]||'';this[_0x790e('0x7')]=_0x4d6d66[_0x790e('0x7')]||'';this[_0x790e('0x8')]=_0x4d6d66[_0x790e('0x8')]||'';this[_0x790e('0x9')]=_0x4d6d66[_0x790e('0x9')]||'';this[_0x790e('0xa')]=_0x4d6d66[_0x790e('0xa')]||'';this[_0x790e('0xb')]=_0x4d6d66['Configurations']||{};}module[_0x790e('0xc')]=DeskAccount; \ No newline at end of file +var _0x1d4e=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d4e,0x189));var _0xe1d4=function(_0x13ee1e,_0x25336c){_0x13ee1e=_0x13ee1e-0x0;var _0x15f297=_0x1d4e[_0x13ee1e];return _0x15f297;};'use strict';function DeskAccount(_0x47873d){this['id']=_0x47873d['id']||0x0;this[_0xe1d4('0x0')]=_0x47873d[_0xe1d4('0x0')]||'';this[_0xe1d4('0x1')]=_0x47873d[_0xe1d4('0x1')]||'';this[_0xe1d4('0x2')]=_0x47873d[_0xe1d4('0x2')]||'';this['authType']=_0x47873d[_0xe1d4('0x3')]||'';this[_0xe1d4('0x4')]=_0x47873d['password']||'';this[_0xe1d4('0x5')]=_0x47873d['consumerKey']||'';this[_0xe1d4('0x6')]=_0x47873d[_0xe1d4('0x6')]||'';this[_0xe1d4('0x7')]=_0x47873d['token']||'';this[_0xe1d4('0x8')]=_0x47873d['tokenSecret']||'';this[_0xe1d4('0x9')]=_0x47873d[_0xe1d4('0x9')]||'';this[_0xe1d4('0xa')]=_0x47873d[_0xe1d4('0xa')]||'';this[_0xe1d4('0xb')]=_0x47873d[_0xe1d4('0xb')]||{};}module[_0xe1d4('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 816584a..64ff190 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 _0xced7=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x28e3c6,_0x31cf69){var _0x206c18=function(_0x190a5f){while(--_0x190a5f){_0x28e3c6['push'](_0x28e3c6['shift']());}};_0x206c18(++_0x31cf69);}(_0xced7,0x180));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x42ea29){this['id']=_0x42ea29['id']||0x0;this[_0x7ced('0x0')]=_0x42ea29[_0x7ced('0x0')]||'';this[_0x7ced('0x1')]=_0x42ea29[_0x7ced('0x1')]||'';this[_0x7ced('0x2')]=_0x42ea29[_0x7ced('0x2')]||'';this[_0x7ced('0x3')]=_0x42ea29[_0x7ced('0x3')]||'';this[_0x7ced('0x4')]=_0x42ea29['tenantId']||'';this[_0x7ced('0x5')]=_0x42ea29[_0x7ced('0x5')]||'';this[_0x7ced('0x6')]=_0x42ea29['clientSecret']||{};this[_0x7ced('0x7')]=_0x42ea29[_0x7ced('0x7')]||'';this[_0x7ced('0x8')]=_0x42ea29[_0x7ced('0x8')]||![];this[_0x7ced('0x9')]=_0x42ea29['Configurations']||{};this[_0x7ced('0xa')]=_0x42ea29[_0x7ced('0xa')]||{};}module[_0x7ced('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xe647=['password','remoteUri','tenantId','clientId','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username'];(function(_0x1724e0,_0x4711b3){var _0x41634a=function(_0x35e59a){while(--_0x35e59a){_0x1724e0['push'](_0x1724e0['shift']());}};_0x41634a(++_0x4711b3);}(_0xe647,0x1b6));var _0x7e64=function(_0xd890ad,_0x2d6f80){_0xd890ad=_0xd890ad-0x0;var _0x9f5f0e=_0xe647[_0xd890ad];return _0x9f5f0e;};'use strict';function Dynamics365Account(_0x39b490){this['id']=_0x39b490['id']||0x0;this['name']=_0x39b490[_0x7e64('0x0')]||'';this['username']=_0x39b490[_0x7e64('0x1')]||'';this['password']=_0x39b490[_0x7e64('0x2')]||'';this['remoteUri']=_0x39b490[_0x7e64('0x3')]||'';this['tenantId']=_0x39b490[_0x7e64('0x4')]||'';this[_0x7e64('0x5')]=_0x39b490[_0x7e64('0x5')]||'';this['clientSecret']=_0x39b490['clientSecret']||{};this[_0x7e64('0x6')]=_0x39b490[_0x7e64('0x6')]||'';this['modernAuthentication']=_0x39b490[_0x7e64('0x7')]||![];this['Configurations']=_0x39b490[_0x7e64('0x8')]||{};this['CloudProvider']=_0x39b490[_0x7e64('0x9')]||{};}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 2d4b48e..cb935fd 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 _0xda62=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo'];(function(_0x279afc,_0x560f0e){var _0x2b4bee=function(_0x4edda9){while(--_0x4edda9){_0x279afc['push'](_0x279afc['shift']());}};_0x2b4bee(++_0x560f0e);}(_0xda62,0x10c));var _0x2da6=function(_0x48b073,_0x5bc12c){_0x48b073=_0x48b073-0x0;var _0x36638d=_0xda62[_0x48b073];return _0x36638d;};'use strict';function FaxAccount(_0x48c062){this['id']=_0x48c062['id']||0x0;this['name']=_0x48c062[_0x2da6('0x0')]||'';this['description']=_0x48c062[_0x2da6('0x1')];this[_0x2da6('0x2')]=_0x48c062['ecm'];this[_0x2da6('0x3')]=_0x48c062[_0x2da6('0x3')];this[_0x2da6('0x4')]=_0x48c062['localstationid'];this[_0x2da6('0x5')]=_0x48c062['minrate']||0x960;this[_0x2da6('0x6')]=_0x48c062['maxrate']||0x3840;this['modem']=_0x48c062[_0x2da6('0x7')]||_0x2da6('0x8');this[_0x2da6('0x9')]=_0x48c062[_0x2da6('0x9')]||'no';this[_0x2da6('0xa')]=_0x48c062[_0x2da6('0xa')]||'no';this[_0x2da6('0xb')]=_0x48c062[_0x2da6('0xb')]||0x1388;this[_0x2da6('0xc')]=_0x48c062['tech']||_0x2da6('0xd');this[_0x2da6('0xe')]=_0x48c062[_0x2da6('0xe')]?_0x48c062[_0x2da6('0xe')]:undefined;this[_0x2da6('0xf')]=_0x48c062[_0x2da6('0xf')];this['key']=_0x48c062[_0x2da6('0x10')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x693a=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x693a,0x1ee));var _0xa693=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x693a[_0x19dd7a];return _0x3feb6a;};'use strict';function FaxAccount(_0x4d0cb0){this['id']=_0x4d0cb0['id']||0x0;this[_0xa693('0x0')]=_0x4d0cb0['name']||'';this[_0xa693('0x1')]=_0x4d0cb0[_0xa693('0x1')];this[_0xa693('0x2')]=_0x4d0cb0[_0xa693('0x2')];this['headerinfo']=_0x4d0cb0[_0xa693('0x3')];this[_0xa693('0x4')]=_0x4d0cb0['localstationid'];this[_0xa693('0x5')]=_0x4d0cb0['minrate']||0x960;this[_0xa693('0x6')]=_0x4d0cb0[_0xa693('0x6')]||0x3840;this[_0xa693('0x7')]=_0x4d0cb0[_0xa693('0x7')]||_0xa693('0x8');this[_0xa693('0x9')]=_0x4d0cb0[_0xa693('0x9')]||'no';this[_0xa693('0xa')]=_0x4d0cb0[_0xa693('0xa')]||'no';this[_0xa693('0xb')]=_0x4d0cb0[_0xa693('0xb')]||0x1388;this[_0xa693('0xc')]=_0x4d0cb0['tech']||_0xa693('0xd');this[_0xa693('0xe')]=_0x4d0cb0[_0xa693('0xe')]?_0x4d0cb0[_0xa693('0xe')]:undefined;this[_0xa693('0xf')]=_0x4d0cb0[_0xa693('0xf')];this[_0xa693('0x10')]=_0x4d0cb0[_0xa693('0x10')];}module[_0xa693('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 835c229..e7da909 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 _0xbbfa=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x100623,_0x311484){var _0x21b00f=function(_0x1085c6){while(--_0x1085c6){_0x100623['push'](_0x100623['shift']());}};_0x21b00f(++_0x311484);}(_0xbbfa,0x1bc));var _0xabbf=function(_0xe1b12b,_0x241bd1){_0xe1b12b=_0xe1b12b-0x0;var _0x1b697a=_0xbbfa[_0xe1b12b];return _0x1b697a;};'use strict';function FreshdeskAccount(_0xf047e){this['id']=_0xf047e['id']||0x0;this[_0xabbf('0x0')]=_0xf047e['name']||'';this[_0xabbf('0x1')]=_0xf047e[_0xabbf('0x1')]||'';this[_0xabbf('0x2')]=_0xf047e['token']||'';this['remoteUri']=_0xf047e[_0xabbf('0x3')]||'';this['serverUrl']=_0xf047e[_0xabbf('0x4')]||'';this[_0xabbf('0x5')]=_0xf047e[_0xabbf('0x5')]||{};}module[_0xabbf('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xca86=['apiKey','remoteUri','serverUrl','exports','name','username'];(function(_0x2845f9,_0x4e0c8c){var _0x1c635c=function(_0x54eea0){while(--_0x54eea0){_0x2845f9['push'](_0x2845f9['shift']());}};_0x1c635c(++_0x4e0c8c);}(_0xca86,0x19c));var _0x6ca8=function(_0x4e8808,_0x254ed0){_0x4e8808=_0x4e8808-0x0;var _0x54e8dd=_0xca86[_0x4e8808];return _0x54e8dd;};'use strict';function FreshdeskAccount(_0x5bdedc){this['id']=_0x5bdedc['id']||0x0;this['name']=_0x5bdedc[_0x6ca8('0x0')]||'';this[_0x6ca8('0x1')]=_0x5bdedc[_0x6ca8('0x1')]||'';this[_0x6ca8('0x2')]=_0x5bdedc['token']||'';this[_0x6ca8('0x3')]=_0x5bdedc[_0x6ca8('0x3')]||'';this[_0x6ca8('0x4')]=_0x5bdedc[_0x6ca8('0x4')]||'';this['Configurations']=_0x5bdedc['Configurations']||{};}module[_0x6ca8('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 797f017..7f4b6a9 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 _0x27c9=['token','remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0xe6e02c,_0x4d412b){var _0x12243d=function(_0x3f57fb){while(--_0x3f57fb){_0xe6e02c['push'](_0xe6e02c['shift']());}};_0x12243d(++_0x4d412b);}(_0x27c9,0x1af));var _0x927c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x27c9[_0x13d07a];return _0x5ee0ee;};'use strict';function FreshsalesAccount(_0xef3ee0){this['id']=_0xef3ee0['id']||0x0;this[_0x927c('0x0')]=_0xef3ee0[_0x927c('0x0')]||'';this[_0x927c('0x1')]=_0xef3ee0['username']||'';this[_0x927c('0x2')]=_0xef3ee0[_0x927c('0x3')]||'';this['remoteUri']=_0xef3ee0[_0x927c('0x4')]||'';this[_0x927c('0x5')]=_0xef3ee0[_0x927c('0x5')]||'';this[_0x927c('0x6')]=_0xef3ee0[_0x927c('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x9485=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x4eb7e6,_0x451464){var _0x3cf508=function(_0x462471){while(--_0x462471){_0x4eb7e6['push'](_0x4eb7e6['shift']());}};_0x3cf508(++_0x451464);}(_0x9485,0x8b));var _0x5948=function(_0x38b765,_0x3086b2){_0x38b765=_0x38b765-0x0;var _0xb65c83=_0x9485[_0x38b765];return _0xb65c83;};'use strict';function FreshsalesAccount(_0x1e8257){this['id']=_0x1e8257['id']||0x0;this[_0x5948('0x0')]=_0x1e8257[_0x5948('0x0')]||'';this[_0x5948('0x1')]=_0x1e8257['username']||'';this[_0x5948('0x2')]=_0x1e8257[_0x5948('0x3')]||'';this[_0x5948('0x4')]=_0x1e8257['remoteUri']||'';this[_0x5948('0x5')]=_0x1e8257[_0x5948('0x5')]||'';this[_0x5948('0x6')]=_0x1e8257[_0x5948('0x6')]||{};}module[_0x5948('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index aa4b9b0..df12e7a 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 _0xb35d=['channel','connectedlinenum','accountcode','context','priority','assigned','lastAssignedTo','motionChannel','mohtime','variables','type','inbound','uniqueid','calleridnum','queue','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition'];(function(_0x29c053,_0xbb6990){var _0x19ced4=function(_0x40bf2e){while(--_0x40bf2e){_0x29c053['push'](_0x29c053['shift']());}};_0x19ced4(++_0xbb6990);}(_0xb35d,0x199));var _0xdb35=function(_0x3ae34a,_0x143082){_0x3ae34a=_0x3ae34a-0x0;var _0x4c9edc=_0xb35d[_0x3ae34a];return _0x4c9edc;};'use strict';function QueueReport(){this[_0xdb35('0x0')]=_0xdb35('0x1');this[_0xdb35('0x2')]='';this[_0xdb35('0x3')]='';this['calleridname']='';this[_0xdb35('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0xdb35('0x5')]=0x1;this['queuecallerabandon']=![];this[_0xdb35('0x6')]=null;this['queuecallercomplete']=![];this[_0xdb35('0x7')]=null;this[_0xdb35('0x8')]=![];this[_0xdb35('0x9')]=null;this[_0xdb35('0xa')]=0x1;this[_0xdb35('0xb')]='';this[_0xdb35('0xc')]='';this['connectedlinename']='';this[_0xdb35('0xd')]='';this[_0xdb35('0xe')]='';this['exten']='';this[_0xdb35('0xf')]='';this['holdtime']=0x0;this[_0xdb35('0x10')]=![];this[_0xdb35('0x11')]='';this[_0xdb35('0x12')]='voice';this[_0xdb35('0x13')]=0x0;this[_0xdb35('0x14')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x9a02=['holdtime','assigned','lastAssignedTo','motionChannel','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority'];(function(_0x3a83a9,_0x2b23db){var _0x3fe7d0=function(_0x2a0667){while(--_0x2a0667){_0x3a83a9['push'](_0x3a83a9['shift']());}};_0x3fe7d0(++_0x2b23db);}(_0x9a02,0x1e3));var _0x29a0=function(_0x1bf515,_0x39803c){_0x1bf515=_0x1bf515-0x0;var _0x197edc=_0x9a02[_0x1bf515];return _0x197edc;};'use strict';function QueueReport(){this[_0x29a0('0x0')]=_0x29a0('0x1');this[_0x29a0('0x2')]='';this[_0x29a0('0x3')]='';this[_0x29a0('0x4')]='';this[_0x29a0('0x5')]='';this[_0x29a0('0x6')]=null;this[_0x29a0('0x7')]=null;this[_0x29a0('0x8')]=0x1;this['count']=0x1;this[_0x29a0('0x9')]=![];this[_0x29a0('0xa')]=null;this['queuecallercomplete']=![];this[_0x29a0('0xb')]=null;this[_0x29a0('0xc')]=![];this[_0x29a0('0xd')]=null;this[_0x29a0('0xe')]=0x1;this[_0x29a0('0xf')]='';this[_0x29a0('0x10')]='';this[_0x29a0('0x11')]='';this[_0x29a0('0x12')]='';this['context']='';this[_0x29a0('0x13')]='';this[_0x29a0('0x14')]='';this[_0x29a0('0x15')]=0x0;this[_0x29a0('0x16')]=![];this[_0x29a0('0x17')]='';this[_0x29a0('0x18')]='voice';this[_0x29a0('0x19')]=0x0;this[_0x29a0('0x1a')]={};}module[_0x29a0('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 60a1569..2cc4ea2 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 _0x0c8d=['name','username','remoteUri','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x1a949b,_0x123ad0){var _0x4d0d35=function(_0x567487){while(--_0x567487){_0x1a949b['push'](_0x1a949b['shift']());}};_0x4d0d35(++_0x123ad0);}(_0x0c8d,0x79));var _0xd0c8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x0c8d[_0x36ed48];return _0x51c63a;};'use strict';function SalesforceAccount(_0x58354d){this['id']=_0x58354d['id']||0x0;this[_0xd0c8('0x0')]=_0x58354d[_0xd0c8('0x0')]||'';this[_0xd0c8('0x1')]=_0x58354d[_0xd0c8('0x1')]||'';this[_0xd0c8('0x2')]=_0x58354d['remoteUri']||'';this['password']=_0x58354d['password']||'';this['clientId']=_0x58354d[_0xd0c8('0x3')]||'';this[_0xd0c8('0x4')]=_0x58354d[_0xd0c8('0x4')]||'';this['securityToken']=_0x58354d[_0xd0c8('0x5')]||'';this['type']=_0x58354d[_0xd0c8('0x6')]||_0xd0c8('0x7');this[_0xd0c8('0x8')]=_0x58354d[_0xd0c8('0x8')]||'';this[_0xd0c8('0x9')]=_0x58354d['Configurations']||{};}module[_0xd0c8('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x98ef=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98ef,0x197));var _0xf98e=function(_0x234152,_0x113d58){_0x234152=_0x234152-0x0;var _0x235f77=_0x98ef[_0x234152];return _0x235f77;};'use strict';function SalesforceAccount(_0x24fbbc){this['id']=_0x24fbbc['id']||0x0;this[_0xf98e('0x0')]=_0x24fbbc[_0xf98e('0x0')]||'';this[_0xf98e('0x1')]=_0x24fbbc[_0xf98e('0x1')]||'';this[_0xf98e('0x2')]=_0x24fbbc[_0xf98e('0x2')]||'';this[_0xf98e('0x3')]=_0x24fbbc[_0xf98e('0x3')]||'';this[_0xf98e('0x4')]=_0x24fbbc[_0xf98e('0x4')]||'';this[_0xf98e('0x5')]=_0x24fbbc[_0xf98e('0x5')]||'';this['securityToken']=_0x24fbbc[_0xf98e('0x6')]||'';this[_0xf98e('0x7')]=_0x24fbbc['type']||_0xf98e('0x8');this[_0xf98e('0x9')]=_0x24fbbc[_0xf98e('0x9')]||'';this[_0xf98e('0xa')]=_0x24fbbc[_0xf98e('0xa')]||{};}module[_0xf98e('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 87f2ce2..a8bd794 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 _0xcad5=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x35fe91,_0x4bc8b0){var _0x22c9c3=function(_0x1c0efc){while(--_0x1c0efc){_0x35fe91['push'](_0x35fe91['shift']());}};_0x22c9c3(++_0x4bc8b0);}(_0xcad5,0x90));var _0x5cad=function(_0x3a6ef9,_0xf7ab1b){_0x3a6ef9=_0x3a6ef9-0x0;var _0x101787=_0xcad5[_0x3a6ef9];return _0x101787;};'use strict';function ServicenowAccount(_0x2bdf8d){this['id']=_0x2bdf8d['id']||0x0;this[_0x5cad('0x0')]=_0x2bdf8d[_0x5cad('0x0')]||'';this[_0x5cad('0x1')]=_0x2bdf8d[_0x5cad('0x1')]||'';this[_0x5cad('0x2')]=_0x2bdf8d[_0x5cad('0x2')]||'';this[_0x5cad('0x3')]=_0x2bdf8d['remoteUri']||'';this[_0x5cad('0x4')]=_0x2bdf8d['serverUrl']||'';this[_0x5cad('0x5')]=_0x2bdf8d[_0x5cad('0x5')]||{};}module[_0x5cad('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x670d=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x5cd3e8,_0x2b8d75){var _0x502660=function(_0x5e81f7){while(--_0x5e81f7){_0x5cd3e8['push'](_0x5cd3e8['shift']());}};_0x502660(++_0x2b8d75);}(_0x670d,0x155));var _0xd670=function(_0x27e7a3,_0x1d8fd6){_0x27e7a3=_0x27e7a3-0x0;var _0x1126c5=_0x670d[_0x27e7a3];return _0x1126c5;};'use strict';function ServicenowAccount(_0x4a3655){this['id']=_0x4a3655['id']||0x0;this[_0xd670('0x0')]=_0x4a3655[_0xd670('0x0')]||'';this['username']=_0x4a3655['username']||'';this['password']=_0x4a3655[_0xd670('0x1')]||'';this[_0xd670('0x2')]=_0x4a3655[_0xd670('0x2')]||'';this['serverUrl']=_0x4a3655[_0xd670('0x3')]||'';this[_0xd670('0x4')]=_0x4a3655[_0xd670('0x4')]||{};}module[_0xd670('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 03f83cf..ce24102 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 _0xfa27=['name','username','remoteUri','serverUrl','Configurations'];(function(_0x5348f5,_0x2a2165){var _0x1d119a=function(_0x55a634){while(--_0x55a634){_0x5348f5['push'](_0x5348f5['shift']());}};_0x1d119a(++_0x2a2165);}(_0xfa27,0xdc));var _0x7fa2=function(_0x1b5b4c,_0x259c8c){_0x1b5b4c=_0x1b5b4c-0x0;var _0x2d5438=_0xfa27[_0x1b5b4c];return _0x2d5438;};'use strict';function SugarcrmAccount(_0x5eb7d8){this['id']=_0x5eb7d8['id']||0x0;this['name']=_0x5eb7d8[_0x7fa2('0x0')]||'';this[_0x7fa2('0x1')]=_0x5eb7d8[_0x7fa2('0x1')]||'';this['password']=_0x5eb7d8['password']||'';this[_0x7fa2('0x2')]=_0x5eb7d8[_0x7fa2('0x2')]||'';this[_0x7fa2('0x3')]=_0x5eb7d8[_0x7fa2('0x3')]||'';this[_0x7fa2('0x4')]=_0x5eb7d8[_0x7fa2('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x6135=['serverUrl','name','password','remoteUri'];(function(_0x64efe5,_0x4ddd0d){var _0x58bd4a=function(_0x554af0){while(--_0x554af0){_0x64efe5['push'](_0x64efe5['shift']());}};_0x58bd4a(++_0x4ddd0d);}(_0x6135,0x1ad));var _0x5613=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x6135[_0x3c2a69];return _0x596bc8;};'use strict';function SugarcrmAccount(_0x925db5){this['id']=_0x925db5['id']||0x0;this[_0x5613('0x0')]=_0x925db5[_0x5613('0x0')]||'';this['username']=_0x925db5['username']||'';this[_0x5613('0x1')]=_0x925db5[_0x5613('0x1')]||'';this[_0x5613('0x2')]=_0x925db5[_0x5613('0x2')]||'';this[_0x5613('0x3')]=_0x925db5[_0x5613('0x3')]||'';this['Configurations']=_0x925db5['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f3c8eff..ab63f28 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 _0xe9b4=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x299bbc,_0x3767bd){var _0x329ad9=function(_0x5313af){while(--_0x5313af){_0x299bbc['push'](_0x299bbc['shift']());}};_0x329ad9(++_0x3767bd);}(_0xe9b4,0x1f1));var _0x4e9b=function(_0x377d3d,_0x1bc805){_0x377d3d=_0x377d3d-0x0;var _0x51d6d5=_0xe9b4[_0x377d3d];return _0x51d6d5;};'use strict';function Telephone(_0x1f310a){this['id']=_0x1f310a['id']||0x0;this[_0x4e9b('0x0')]=_0x1f310a[_0x4e9b('0x0')]||'';this[_0x4e9b('0x1')]=_0x1f310a[_0x4e9b('0x1')]||'';this[_0x4e9b('0x2')]=_0x4e9b('0x3');this[_0x4e9b('0x4')]=0x0;this[_0x4e9b('0x5')]=_0x4e9b('0x3');this[_0x4e9b('0x6')]='';}module[_0x4e9b('0x7')]=Telephone; \ No newline at end of file +var _0x9f4d=['address','name','accountcode','state','unknown','stateTime','status'];(function(_0xaded23,_0x25c973){var _0x2c5789=function(_0x3caa9d){while(--_0x3caa9d){_0xaded23['push'](_0xaded23['shift']());}};_0x2c5789(++_0x25c973);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x9f4d[_0x25e109];return _0xc0f7d6;};'use strict';function Telephone(_0x504d77){this['id']=_0x504d77['id']||0x0;this[_0xd9f4('0x0')]=_0x504d77[_0xd9f4('0x0')]||'';this[_0xd9f4('0x1')]=_0x504d77[_0xd9f4('0x1')]||'';this[_0xd9f4('0x2')]=_0xd9f4('0x3');this[_0xd9f4('0x4')]=0x0;this[_0xd9f4('0x5')]='unknown';this[_0xd9f4('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 75fa5f9..8a099f7 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 _0xa9e0=['exports','name'];(function(_0x47d702,_0x5ab3dd){var _0xb1dcdc=function(_0x36ef26){while(--_0x36ef26){_0x47d702['push'](_0x47d702['shift']());}};_0xb1dcdc(++_0x5ab3dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x261e86,_0x5d2942){var _0x44c560=function(_0x4d153e){while(--_0x4d153e){_0x261e86['push'](_0x261e86['shift']());}};_0x44c560(++_0x5d2942);}(_0xb10b,0x12a));var _0xbb10=function(_0x150469,_0x5ec8a2){_0x150469=_0x150469-0x0;var _0x110773=_0xb10b[_0x150469];return _0x110773;};'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 df2ccb2..0d620f3 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x5a001d,_0x591f45){var _0x3d0a81=function(_0x13ad2a){while(--_0x13ad2a){_0x5a001d['push'](_0x5a001d['shift']());}};_0x3d0a81(++_0x591f45);}(_0xb7e7,0x121));var _0x7b7e=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb7e7[_0xaa0309];return _0x5de7ce;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 63dc28a..b51ebcf 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 _0xc62d=['refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain'];(function(_0x1615fb,_0x41a415){var _0x565528=function(_0x55c685){while(--_0x55c685){_0x1615fb['push'](_0x1615fb['shift']());}};_0x565528(++_0x41a415);}(_0xc62d,0x126));var _0xdc62=function(_0x36c5d9,_0x228005){_0x36c5d9=_0x36c5d9-0x0;var _0x185f60=_0xc62d[_0x36c5d9];return _0x185f60;};'use strict';function Trunk(_0x4fcf69){this['id']=_0x4fcf69['id']||0x0;this[_0xdc62('0x0')]=_0x4fcf69[_0xdc62('0x0')]||![];this[_0xdc62('0x1')]=_0x4fcf69[_0xdc62('0x1')]||'';this[_0xdc62('0x2')]=_0xdc62('0x3');this[_0xdc62('0x4')]=0x0;this[_0xdc62('0x5')]='unknown';this[_0xdc62('0x6')]=_0x4fcf69[_0xdc62('0x6')]&&_0x4fcf69[_0xdc62('0x6')][_0xdc62('0x7')](':')?_0x4fcf69[_0xdc62('0x6')][_0xdc62('0x8')](':')[0x0]:'';this[_0xdc62('0x9')]='';this[_0xdc62('0xa')]='';this[_0xdc62('0xb')]='';this['domainport']='';this[_0xdc62('0xc')]='';this['stateRegistry']='unknown';this[_0xdc62('0xd')]='';this[_0xdc62('0xe')]='';this[_0xdc62('0xf')]=_0x4fcf69[_0xdc62('0xf')]||'';}module[_0xdc62('0x10')]=Trunk; \ No newline at end of file +var _0xdf86=['exports','active','name','state','unknown','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xdf86,0x1c3));var _0x6df8=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0xdf86[_0x4d40dd];return _0x1c51f2;};'use strict';function Trunk(_0x284d6d){this['id']=_0x284d6d['id']||0x0;this[_0x6df8('0x0')]=_0x284d6d[_0x6df8('0x0')]||![];this['name']=_0x284d6d[_0x6df8('0x1')]||'';this[_0x6df8('0x2')]=_0x6df8('0x3');this['stateTime']=0x0;this[_0x6df8('0x4')]='unknown';this[_0x6df8('0x5')]=_0x284d6d[_0x6df8('0x5')]&&_0x284d6d[_0x6df8('0x5')][_0x6df8('0x6')](':')?_0x284d6d[_0x6df8('0x5')][_0x6df8('0x7')](':')[0x0]:'';this[_0x6df8('0x8')]='';this[_0x6df8('0x9')]='';this[_0x6df8('0xa')]='';this[_0x6df8('0xb')]='';this[_0x6df8('0xc')]='';this[_0x6df8('0xd')]=_0x6df8('0x3');this[_0x6df8('0xe')]='';this[_0x6df8('0xf')]='';this[_0x6df8('0x10')]=_0x284d6d[_0x6df8('0x10')]||'';}module[_0x6df8('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 0928e64..8d4bf23 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 _0x4b26=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0x4b26,0x6d));var _0x64b2=function(_0x4a579e,_0x49a3e8){_0x4a579e=_0x4a579e-0x0;var _0x3a7650=_0x4b26[_0x4a579e];return _0x3a7650;};'use strict';function voiceExtension(_0x15e326){this['id']=_0x15e326['id']||0x0;this['exten']=_0x15e326[_0x64b2('0x0')]||'';this[_0x64b2('0x1')]=_0x15e326[_0x64b2('0x1')]||_0x64b2('0x2');this[_0x64b2('0x3')]=_0x15e326[_0x64b2('0x3')]||![];}module[_0x64b2('0x4')]=voiceExtension; \ No newline at end of file +var _0xe690=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0xe690,0x140));var _0x0e69=function(_0x10b3e6,_0x422688){_0x10b3e6=_0x10b3e6-0x0;var _0x2614eb=_0xe690[_0x10b3e6];return _0x2614eb;};'use strict';function voiceExtension(_0x7d8cf6){this['id']=_0x7d8cf6['id']||0x0;this[_0x0e69('0x0')]=_0x7d8cf6[_0x0e69('0x0')]||'';this[_0x0e69('0x1')]=_0x7d8cf6['recordingFormat']||_0x0e69('0x2');this[_0x0e69('0x3')]=_0x7d8cf6[_0x0e69('0x3')]||![];}module[_0x0e69('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 6e378d7..2698129 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 _0x3fb2=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','invalid','ringing','ringinuse','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumBillable','unmanaged','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay'];(function(_0x3db6a5,_0xbc6815){var _0x2e3b6c=function(_0x2f3c1a){while(--_0x2f3c1a){_0x3db6a5['push'](_0x3db6a5['shift']());}};_0x2e3b6c(++_0xbc6815);}(_0x3fb2,0x1e9));var _0x23fb=function(_0x384bdf,_0x153212){_0x384bdf=_0x384bdf-0x0;var _0x1542b6=_0x3fb2[_0x384bdf];return _0x1542b6;};'use strict';var statusDesc=[_0x23fb('0x0'),'not_inuse','inuse','busy',_0x23fb('0x1'),'unavailable',_0x23fb('0x2'),_0x23fb('0x3'),'onhold'];var monitorFormat={'wav':_0x23fb('0x4'),'wav49':_0x23fb('0x5'),'gsm':_0x23fb('0x6')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x23fb('0x7')};function VoiceQueue(_0x23cbb7){this['id']=_0x23cbb7['id']||0x0;this[_0x23fb('0x8')]=_0x23cbb7['name']||'';this[_0x23fb('0x9')]=_0x23cbb7[_0x23fb('0x9')]||'';this[_0x23fb('0xa')]=_0x23cbb7['type']||_0x23fb('0xb');this[_0x23fb('0xc')]=0x0;this[_0x23fb('0xd')]=0x0;this[_0x23fb('0xe')]=0x0;this['answered']=0x0;this[_0x23fb('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0x23fb('0x10')]=0x0;this[_0x23fb('0x11')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0x23fb('0x12')]=0x0;this[_0x23fb('0x13')]=_0x23cbb7[_0x23fb('0x13')]||![];this['acwTimeout']=_0x23cbb7[_0x23fb('0x14')]||0xa;this[_0x23fb('0x15')]=_0x23cbb7[_0x23fb('0x15')]||'no';this[_0x23fb('0x16')]=!![];this[_0x23fb('0x17')]='';this['originated']=0x0;this[_0x23fb('0x18')]=0x0;this['dialTimezone']=_0x23cbb7['dialTimezone']||null;this[_0x23fb('0x19')]=_0x23cbb7['dialGlobalInterval']?_0x23cbb7['dialGlobalInterval']:null;this[_0x23fb('0x1a')]=_0x23cbb7[_0x23fb('0x1a')];this[_0x23fb('0x1b')]=_0x23cbb7[_0x23fb('0x1b')]||_0x23fb('0x1c');this['dialLimitChannel']=_0x23cbb7[_0x23fb('0x1d')]||0x0;this['dialLimitQueue']=_0x23cbb7['dialLimitQueue']||0x0;this[_0x23fb('0x1e')]=_0x23cbb7[_0x23fb('0x1e')]||0x1;this[_0x23fb('0x1f')]=_0x23cbb7[_0x23fb('0x1f')]||_0x23fb('0x20');this[_0x23fb('0x21')]=_0x23cbb7[_0x23fb('0x21')]||0.03;this[_0x23fb('0x22')]=_0x23cbb7[_0x23fb('0x22')]||0x258;this[_0x23fb('0x23')]=_0x23cbb7['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x23cbb7[_0x23fb('0x24')]||'anonymous';this[_0x23fb('0x25')]=_0x23cbb7[_0x23fb('0x25')]||0x1e;this[_0x23fb('0x26')]=_0x23cbb7[_0x23fb('0x26')]||_0x23fb('0x27');this['dialQueueTimeout']=_0x23cbb7['dialQueueTimeout']||0x3;this[_0x23fb('0x28')]=_0x23cbb7['dialQueueProject']||undefined;this[_0x23fb('0x29')]=_0x23cbb7[_0x23fb('0x29')]||0x3;this[_0x23fb('0x2a')]=_0x23cbb7[_0x23fb('0x2a')]||0x96;this[_0x23fb('0x2b')]=_0x23cbb7[_0x23fb('0x2b')]||0x3;this[_0x23fb('0x2c')]=_0x23cbb7[_0x23fb('0x2c')]||0x96;this['dialNoAnswerMaxRetry']=_0x23cbb7[_0x23fb('0x2d')]||0x3;this['dialNoAnswerRetryFrequency']=_0x23cbb7[_0x23fb('0x2e')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x23cbb7[_0x23fb('0x2f')]||0x3;this[_0x23fb('0x30')]=_0x23cbb7[_0x23fb('0x30')]||0x96;this[_0x23fb('0x31')]=_0x23cbb7[_0x23fb('0x31')]||0x3;this['dialDropRetryFrequency']=_0x23cbb7[_0x23fb('0x32')]||0x96;this[_0x23fb('0x33')]=_0x23cbb7[_0x23fb('0x33')]||0x3;this[_0x23fb('0x34')]=_0x23cbb7[_0x23fb('0x34')]||0x96;this[_0x23fb('0x35')]=_0x23cbb7[_0x23fb('0x35')]||0x3;this[_0x23fb('0x36')]=_0x23cbb7[_0x23fb('0x36')]||0x96;this[_0x23fb('0x37')]=_0x23cbb7[_0x23fb('0x37')]||0x3;this[_0x23fb('0x38')]=_0x23cbb7[_0x23fb('0x38')]||0x96;this[_0x23fb('0x39')]=_0x23cbb7[_0x23fb('0x39')]||0x3;this[_0x23fb('0x3a')]=_0x23cbb7[_0x23fb('0x3a')]||0x4;this[_0x23fb('0x3b')]=_0x23cbb7['Trunk']?_0x23cbb7[_0x23fb('0x3b')]:undefined;this[_0x23fb('0x3c')]=_0x23cbb7[_0x23fb('0x3c')]?_0x23cbb7[_0x23fb('0x3c')]:undefined;this[_0x23fb('0x3d')]=_0x23cbb7[_0x23fb('0x3d')]||undefined;this[_0x23fb('0x3e')]=_0x23cbb7[_0x23fb('0x3e')]?_0x23cbb7[_0x23fb('0x3e')]:undefined;this['dialOrderByScheduledAt']=_0x23cbb7['dialOrderByScheduledAt']||_0x23fb('0x3f');this[_0x23fb('0x40')]=_0x23cbb7[_0x23fb('0x40')]||undefined;this[_0x23fb('0x41')]=_0x23cbb7[_0x23fb('0x41')]||undefined;this[_0x23fb('0x42')]=strategy[_0x23cbb7[_0x23fb('0x42')]]||_0x23fb('0x43');this['queueStatusComplete']=!![];this[_0x23fb('0x44')]=_0x23cbb7['dialAMDActive']||![];this[_0x23fb('0x45')]=_0x23cbb7['dialAMDInitialSilence'];this[_0x23fb('0x46')]=_0x23cbb7[_0x23fb('0x46')];this[_0x23fb('0x47')]=_0x23cbb7[_0x23fb('0x47')];this[_0x23fb('0x48')]=_0x23cbb7[_0x23fb('0x48')];this[_0x23fb('0x49')]=_0x23cbb7[_0x23fb('0x49')];this[_0x23fb('0x4a')]=_0x23cbb7[_0x23fb('0x4a')];this['dialAMDMaximumNumberOfWords']=_0x23cbb7[_0x23fb('0x4b')];this['dialAMDSilenceThreshold']=_0x23cbb7['dialAMDSilenceThreshold'];this[_0x23fb('0x4c')]=_0x23cbb7['dialAMDMaximumWordLength'];this[_0x23fb('0x4d')]=0x0;this[_0x23fb('0x4e')]=0x0;this[_0x23fb('0x4f')]=_0x23cbb7['timeout'];this[_0x23fb('0x50')]=0x0;this[_0x23fb('0x51')]=0x0;this[_0x23fb('0x52')]=0x0;this[_0x23fb('0x53')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x23fb('0x54')]=0x0;this[_0x23fb('0x55')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x23fb('0x56')]=0x0;this[_0x23fb('0x57')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x23fb('0x58')]=0x0;this[_0x23fb('0x59')]=undefined;this['startPredictive']=undefined;this[_0x23fb('0x5a')]=undefined;this[_0x23fb('0x5b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x23fb('0x5c')]=0x0;this[_0x23fb('0x5d')]=0x0;this[_0x23fb('0x5e')]=0x0;this[_0x23fb('0x5f')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x23fb('0x60')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x23fb('0x61')]=_0x23cbb7[_0x23fb('0x62')]||0x14;this['predictiveIntervalMinThreshold']=_0x23cbb7[_0x23fb('0x62')]||0xa;this[_0x23fb('0x63')]=0x0;this[_0x23fb('0x64')]=0x0;this[_0x23fb('0x65')]=0x1;this[_0x23fb('0x66')]=0x0;this[_0x23fb('0x67')]=0x0;this[_0x23fb('0x68')]=0x0;this[_0x23fb('0x69')]=0x0;this[_0x23fb('0x6a')]=_0x23cbb7[_0x23fb('0x6a')]||0x1e;this[_0x23fb('0x6b')]=_0x23cbb7['dialRecallInQueue']||![];this[_0x23fb('0x6c')]=!!_0x23cbb7[_0x23fb('0x6c')]||![];this[_0x23fb('0x6d')]=!!_0x23cbb7[_0x23fb('0x6d')]||![];this[_0x23fb('0x6e')]=_0x23cbb7[_0x23fb('0x6e')]||undefined;this[_0x23fb('0x6f')]=_0x23cbb7['dialAgiAfterHangupClient']||![];this[_0x23fb('0x70')]=_0x23cbb7[_0x23fb('0x70')]||![];this['monitor_format']=monitorFormat[_0x23cbb7['monitor_format']]?monitorFormat[_0x23cbb7[_0x23fb('0x9')]]:undefined;this[_0x23fb('0x71')]=_0x23cbb7[_0x23fb('0x71')]||![];this['mandatoryDispositionPause']=_0x23cbb7['mandatoryDispositionPause']?_0x23cbb7[_0x23fb('0x72')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0xeb09=['monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','unavailable','ringing','ringinuse','onhold','wav49','rrmemory','roundrobin','name'];(function(_0x4bf6ad,_0x52365b){var _0x1a35cb=function(_0x5b19a1){while(--_0x5b19a1){_0x4bf6ad['push'](_0x4bf6ad['shift']());}};_0x1a35cb(++_0x52365b);}(_0xeb09,0x176));var _0x9eb0=function(_0x3bfab5,_0x536e67){_0x3bfab5=_0x3bfab5-0x0;var _0x20eae6=_0xeb09[_0x3bfab5];return _0x20eae6;};'use strict';var statusDesc=[_0x9eb0('0x0'),_0x9eb0('0x1'),'inuse','busy','invalid',_0x9eb0('0x2'),_0x9eb0('0x3'),_0x9eb0('0x4'),_0x9eb0('0x5')];var monitorFormat={'wav':'wav','wav49':_0x9eb0('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x9eb0('0x7'),'roundrobin':_0x9eb0('0x8')};function VoiceQueue(_0x51ab37){this['id']=_0x51ab37['id']||0x0;this['name']=_0x51ab37[_0x9eb0('0x9')]||'';this[_0x9eb0('0xa')]=_0x51ab37['monitor_format']||'';this[_0x9eb0('0xb')]=_0x51ab37[_0x9eb0('0xb')]||'inbound';this[_0x9eb0('0xc')]=0x0;this[_0x9eb0('0xd')]=0x0;this[_0x9eb0('0xe')]=0x0;this[_0x9eb0('0xf')]=0x0;this[_0x9eb0('0x10')]=0x0;this[_0x9eb0('0x11')]=0x0;this['sumBillable']=0x0;this[_0x9eb0('0x12')]=0x0;this['abandoned']=0x0;this[_0x9eb0('0x13')]=0x0;this[_0x9eb0('0x14')]=0x0;this[_0x9eb0('0x15')]=_0x51ab37[_0x9eb0('0x15')]||![];this[_0x9eb0('0x16')]=_0x51ab37[_0x9eb0('0x16')]||0xa;this['autopause']=_0x51ab37[_0x9eb0('0x17')]||'no';this[_0x9eb0('0x18')]=!![];this[_0x9eb0('0x19')]='';this[_0x9eb0('0x1a')]=0x0;this[_0x9eb0('0x1b')]=0x0;this['dialTimezone']=_0x51ab37[_0x9eb0('0x1c')]||null;this['dialGlobalInterval']=_0x51ab37[_0x9eb0('0x1d')]?_0x51ab37[_0x9eb0('0x1d')]:null;this[_0x9eb0('0x1e')]=_0x51ab37[_0x9eb0('0x1e')];this['dialMethod']=_0x51ab37[_0x9eb0('0x1f')]||_0x9eb0('0x20');this['dialLimitChannel']=_0x51ab37[_0x9eb0('0x21')]||0x0;this[_0x9eb0('0x22')]=_0x51ab37[_0x9eb0('0x22')]||0x0;this[_0x9eb0('0x23')]=_0x51ab37[_0x9eb0('0x23')]||0x1;this[_0x9eb0('0x24')]=_0x51ab37[_0x9eb0('0x24')]||_0x9eb0('0x25');this[_0x9eb0('0x26')]=_0x51ab37[_0x9eb0('0x26')]||0.03;this[_0x9eb0('0x27')]=_0x51ab37[_0x9eb0('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x51ab37[_0x9eb0('0x28')]||_0x9eb0('0x29');this[_0x9eb0('0x2a')]=_0x51ab37[_0x9eb0('0x2a')]||_0x9eb0('0x29');this[_0x9eb0('0x2b')]=_0x51ab37[_0x9eb0('0x2b')]||0x1e;this[_0x9eb0('0x2c')]=_0x51ab37['dialQueueOptions']||_0x9eb0('0x2d');this[_0x9eb0('0x2e')]=_0x51ab37[_0x9eb0('0x2e')]||0x3;this[_0x9eb0('0x2f')]=_0x51ab37[_0x9eb0('0x2f')]||undefined;this[_0x9eb0('0x30')]=_0x51ab37[_0x9eb0('0x30')]||0x3;this[_0x9eb0('0x31')]=_0x51ab37[_0x9eb0('0x31')]||0x96;this[_0x9eb0('0x32')]=_0x51ab37[_0x9eb0('0x32')]||0x3;this[_0x9eb0('0x33')]=_0x51ab37['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x51ab37[_0x9eb0('0x34')]||0x3;this[_0x9eb0('0x35')]=_0x51ab37[_0x9eb0('0x35')]||0x96;this[_0x9eb0('0x36')]=_0x51ab37['dialNoSuchNumberMaxRetry']||0x3;this[_0x9eb0('0x37')]=_0x51ab37['dialNoSuchNumberRetryFrequency']||0x96;this[_0x9eb0('0x38')]=_0x51ab37[_0x9eb0('0x38')]||0x3;this[_0x9eb0('0x39')]=_0x51ab37[_0x9eb0('0x39')]||0x96;this['dialAbandonedMaxRetry']=_0x51ab37['dialAbandonedMaxRetry']||0x3;this[_0x9eb0('0x3a')]=_0x51ab37[_0x9eb0('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x51ab37[_0x9eb0('0x3b')]||0x3;this['dialMachineRetryFrequency']=_0x51ab37[_0x9eb0('0x3c')]||0x96;this[_0x9eb0('0x3d')]=_0x51ab37[_0x9eb0('0x3d')]||0x3;this[_0x9eb0('0x3e')]=_0x51ab37[_0x9eb0('0x3e')]||0x96;this[_0x9eb0('0x3f')]=_0x51ab37['callAdditionalPhoneAfterMin']||0x3;this[_0x9eb0('0x40')]=_0x51ab37['dialGlobalMaxRetry']||0x4;this[_0x9eb0('0x41')]=_0x51ab37[_0x9eb0('0x41')]?_0x51ab37[_0x9eb0('0x41')]:undefined;this[_0x9eb0('0x42')]=_0x51ab37['TrunkBackup']?_0x51ab37[_0x9eb0('0x42')]:undefined;this[_0x9eb0('0x43')]=_0x51ab37[_0x9eb0('0x43')]||undefined;this['Interval']=_0x51ab37[_0x9eb0('0x44')]?_0x51ab37['Interval']:undefined;this[_0x9eb0('0x45')]=_0x51ab37[_0x9eb0('0x45')]||'DESC';this[_0x9eb0('0x46')]=_0x51ab37[_0x9eb0('0x46')]||undefined;this[_0x9eb0('0x47')]=_0x51ab37[_0x9eb0('0x47')]||undefined;this['strategy']=strategy[_0x51ab37[_0x9eb0('0x48')]]||_0x9eb0('0x7');this[_0x9eb0('0x49')]=!![];this[_0x9eb0('0x4a')]=_0x51ab37[_0x9eb0('0x4a')]||![];this[_0x9eb0('0x4b')]=_0x51ab37[_0x9eb0('0x4b')];this['dialAMDGreeting']=_0x51ab37[_0x9eb0('0x4c')];this[_0x9eb0('0x4d')]=_0x51ab37[_0x9eb0('0x4d')];this[_0x9eb0('0x4e')]=_0x51ab37['dialAMDTotalAnalysisTime'];this[_0x9eb0('0x4f')]=_0x51ab37[_0x9eb0('0x4f')];this['dialAMDBetweenWordsSilence']=_0x51ab37[_0x9eb0('0x50')];this[_0x9eb0('0x51')]=_0x51ab37[_0x9eb0('0x51')];this['dialAMDSilenceThreshold']=_0x51ab37[_0x9eb0('0x52')];this['dialAMDMaximumWordLength']=_0x51ab37[_0x9eb0('0x53')];this[_0x9eb0('0x54')]=0x0;this[_0x9eb0('0x55')]=0x0;this['timeout']=_0x51ab37[_0x9eb0('0x56')];this[_0x9eb0('0x57')]=0x0;this[_0x9eb0('0x58')]=0x0;this[_0x9eb0('0x59')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x9eb0('0x5a')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x9eb0('0x5b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x9eb0('0x5c')]=0x0;this[_0x9eb0('0x5d')]=0x0;this[_0x9eb0('0x5e')]=0x0;this[_0x9eb0('0x5f')]=0x0;this[_0x9eb0('0x60')]=0x0;this[_0x9eb0('0x61')]=undefined;this[_0x9eb0('0x62')]=undefined;this[_0x9eb0('0x63')]=undefined;this[_0x9eb0('0x64')]=1.05;this[_0x9eb0('0x65')]=0x0;this[_0x9eb0('0x66')]=0x0;this[_0x9eb0('0x67')]=0x0;this[_0x9eb0('0x68')]=0x0;this[_0x9eb0('0x69')]=0x0;this[_0x9eb0('0x6a')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x9eb0('0x6b')]=0x0;this[_0x9eb0('0x6c')]=_0x51ab37[_0x9eb0('0x6d')]||0x14;this[_0x9eb0('0x6e')]=_0x51ab37['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x9eb0('0x6f')]=0x0;this[_0x9eb0('0x70')]=0x0;this[_0x9eb0('0x71')]=0x1;this[_0x9eb0('0x72')]=0x0;this[_0x9eb0('0x73')]=0x0;this[_0x9eb0('0x74')]=0x0;this[_0x9eb0('0x75')]=0x0;this['dialRecallMeTimeout']=_0x51ab37[_0x9eb0('0x76')]||0x1e;this['dialRecallInQueue']=_0x51ab37[_0x9eb0('0x77')]||![];this[_0x9eb0('0x78')]=!!_0x51ab37[_0x9eb0('0x78')]||![];this[_0x9eb0('0x79')]=!!_0x51ab37['dialPreviewRecallmeReminder']||![];this[_0x9eb0('0x7a')]=_0x51ab37[_0x9eb0('0x7a')]||undefined;this[_0x9eb0('0x7b')]=_0x51ab37['dialAgiAfterHangupClient']||![];this[_0x9eb0('0x7c')]=_0x51ab37['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x51ab37[_0x9eb0('0xa')]]?monitorFormat[_0x51ab37[_0x9eb0('0xa')]]:undefined;this[_0x9eb0('0x7d')]=_0x51ab37[_0x9eb0('0x7d')]||![];this[_0x9eb0('0x7e')]=_0x51ab37[_0x9eb0('0x7e')]?_0x51ab37[_0x9eb0('0x7e')]:undefined;}module[_0x9eb0('0x7f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 3533f89..41c54a6 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 _0x4e06=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x141e82,_0x386eaa){var _0x2383cd=function(_0x45b117){while(--_0x45b117){_0x141e82['push'](_0x141e82['shift']());}};_0x2383cd(++_0x386eaa);}(_0x4e06,0xd8));var _0x64e0=function(_0x2df8ee,_0x83b997){_0x2df8ee=_0x2df8ee-0x0;var _0x2d3746=_0x4e06[_0x2df8ee];return _0x2d3746;};'use strict';function VtigerAccount(_0x5db22d){this['id']=_0x5db22d['id']||0x0;this[_0x64e0('0x0')]=_0x5db22d[_0x64e0('0x0')]||'';this[_0x64e0('0x1')]=_0x5db22d['username']||'';this[_0x64e0('0x2')]=_0x5db22d[_0x64e0('0x2')]||'';this[_0x64e0('0x3')]=_0x5db22d[_0x64e0('0x3')]||'';this[_0x64e0('0x4')]=_0x5db22d['serverUrl']||'';this[_0x64e0('0x5')]=_0x5db22d['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xcf30=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcf30,0xcb));var _0x0cf3=function(_0x5ca34c,_0xc19af2){_0x5ca34c=_0x5ca34c-0x0;var _0x27673d=_0xcf30[_0x5ca34c];return _0x27673d;};'use strict';function VtigerAccount(_0x533c8c){this['id']=_0x533c8c['id']||0x0;this[_0x0cf3('0x0')]=_0x533c8c['name']||'';this[_0x0cf3('0x1')]=_0x533c8c[_0x0cf3('0x1')]||'';this['accessKey']=_0x533c8c[_0x0cf3('0x2')]||'';this[_0x0cf3('0x3')]=_0x533c8c[_0x0cf3('0x3')]||'';this[_0x0cf3('0x4')]=_0x533c8c['serverUrl']||'';this[_0x0cf3('0x5')]=_0x533c8c['Configurations']||{};}module[_0x0cf3('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index eee9064..1988f6d 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 _0xc3d0=['Configurations','exports','name','username','password','token','remoteUri','authType','type','serverUrl'];(function(_0x316ddd,_0x296f7e){var _0x176e00=function(_0xd5fb45){while(--_0xd5fb45){_0x316ddd['push'](_0x316ddd['shift']());}};_0x176e00(++_0x296f7e);}(_0xc3d0,0x1c4));var _0x0c3d=function(_0x33ee03,_0x23d752){_0x33ee03=_0x33ee03-0x0;var _0x1edf30=_0xc3d0[_0x33ee03];return _0x1edf30;};'use strict';function ZendeskAccount(_0x1a5b40){this['id']=_0x1a5b40['id']||0x0;this[_0x0c3d('0x0')]=_0x1a5b40[_0x0c3d('0x0')]||'';this['username']=_0x1a5b40[_0x0c3d('0x1')]||'';this[_0x0c3d('0x2')]=_0x1a5b40[_0x0c3d('0x2')]||'';this[_0x0c3d('0x3')]=_0x1a5b40[_0x0c3d('0x3')]||'';this[_0x0c3d('0x4')]=_0x1a5b40[_0x0c3d('0x4')]||'';this['authType']=_0x1a5b40[_0x0c3d('0x5')]||'';this['type']=_0x1a5b40[_0x0c3d('0x6')]||'integrationTab';this['serverUrl']=_0x1a5b40[_0x0c3d('0x7')]||'';this[_0x0c3d('0x8')]=_0x1a5b40[_0x0c3d('0x8')]||{};}module[_0x0c3d('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x6905=['token','remoteUri','authType','type','serverUrl','Configurations','username','password'];(function(_0x34e68f,_0x4c7df2){var _0x3ed7e5=function(_0x4a2be2){while(--_0x4a2be2){_0x34e68f['push'](_0x34e68f['shift']());}};_0x3ed7e5(++_0x4c7df2);}(_0x6905,0x196));var _0x5690=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x6905[_0x22ffbf];return _0x360c17;};'use strict';function ZendeskAccount(_0x3dfb1b){this['id']=_0x3dfb1b['id']||0x0;this['name']=_0x3dfb1b['name']||'';this[_0x5690('0x0')]=_0x3dfb1b[_0x5690('0x0')]||'';this[_0x5690('0x1')]=_0x3dfb1b['password']||'';this[_0x5690('0x2')]=_0x3dfb1b[_0x5690('0x2')]||'';this[_0x5690('0x3')]=_0x3dfb1b['remoteUri']||'';this[_0x5690('0x4')]=_0x3dfb1b[_0x5690('0x4')]||'';this[_0x5690('0x5')]=_0x3dfb1b[_0x5690('0x5')]||'integrationTab';this['serverUrl']=_0x3dfb1b[_0x5690('0x6')]||'';this[_0x5690('0x7')]=_0x3dfb1b[_0x5690('0x7')]||{};}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 5e7c153..1382257 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 _0x1c69=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x1c69,0x77));var _0x91c6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1c69[_0x4b055c];return _0x4b62bb;};'use strict';function ZohoAccount(_0x485d17){this['id']=_0x485d17['id']||0x0;this[_0x91c6('0x0')]=_0x485d17[_0x91c6('0x0')]||'';this[_0x91c6('0x1')]=_0x485d17[_0x91c6('0x1')]||'';this[_0x91c6('0x2')]=_0x485d17['host']||'';this[_0x91c6('0x3')]=_0x485d17[_0x91c6('0x3')]||'';this[_0x91c6('0x4')]=_0x485d17['clientId']||'';this[_0x91c6('0x5')]=_0x485d17[_0x91c6('0x5')]||'';this['serverUrl']=_0x485d17[_0x91c6('0x6')]||'';this['code']=_0x485d17[_0x91c6('0x7')]||'';this[_0x91c6('0x8')]=_0x485d17[_0x91c6('0x8')]||'';this['Configurations']=_0x485d17[_0x91c6('0x9')]||{};}module[_0x91c6('0xa')]=ZohoAccount; \ No newline at end of file +var _0x3953=['host','zone','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x291b31,_0x5722fc){var _0x4b8dda=function(_0x117a30){while(--_0x117a30){_0x291b31['push'](_0x291b31['shift']());}};_0x4b8dda(++_0x5722fc);}(_0x3953,0xa0));var _0x3395=function(_0x3a4668,_0x46a3ca){_0x3a4668=_0x3a4668-0x0;var _0x5b92b7=_0x3953[_0x3a4668];return _0x5b92b7;};'use strict';function ZohoAccount(_0x26ef28){this['id']=_0x26ef28['id']||0x0;this[_0x3395('0x0')]=_0x26ef28[_0x3395('0x0')]||'';this[_0x3395('0x1')]=_0x26ef28[_0x3395('0x1')]||'';this[_0x3395('0x2')]=_0x26ef28['host']||'';this[_0x3395('0x3')]=_0x26ef28[_0x3395('0x3')]||'';this['clientId']=_0x26ef28['clientId']||'';this['clientSecret']=_0x26ef28['clientSecret']||'';this[_0x3395('0x4')]=_0x26ef28[_0x3395('0x4')]||'';this['code']=_0x26ef28[_0x3395('0x5')]||'';this[_0x3395('0x6')]=_0x26ef28[_0x3395('0x6')]||'';this[_0x3395('0x7')]=_0x26ef28[_0x3395('0x7')]||{};}module[_0x3395('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 002b22a..c1759c1 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 _0x14a0=['countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','uniqueid','idContact','type','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x14a0,0x8e));var _0x014a=function(_0x33f491,_0x2320f6){_0x33f491=_0x33f491-0x0;var _0x25736c=_0x14a0[_0x33f491];return _0x25736c;};'use strict';var util=require('util');var _=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));function checkNameSurname(_0x4144ed,_0x28b0f6,_0x32e88c){var _0xd5cdc6='';if(!_[_0x014a('0x2')](_0x28b0f6)&&'string'===typeof _0x28b0f6){_0xd5cdc6+=_0x28b0f6;}if(!_['isNil'](_0x32e88c)&&_0x014a('0x3')===typeof _0x32e88c){_0xd5cdc6+='\x20'+_0x32e88c;}if(_0xd5cdc6!==''){return _0xd5cdc6;}return _0x4144ed;}function Action(_0x12e8da,_0x38a22c,_0x5ec84d,_0x5a61ac,_0x11b8ce){this[_0x014a('0x4')]=_0x5ec84d||undefined;this[_0x014a('0x5')]=_0x12e8da['id'];this['queue']=_0x38a22c['name'];this[_0x014a('0x6')]=_0x38a22c['type'];this['campaigntype']='queue';this['dialAnswer']=![];this[_0x014a('0x7')]=_['isNil'](_0x12e8da[_0x014a('0x8')])?undefined:_0x12e8da[_0x014a('0x8')]['name'];this[_0x014a('0x9')]=this[_0x014a('0x7')]?util[_0x014a('0xa')](_0x014a('0xb'),this[_0x014a('0x7')]):_0x5a61ac||undefined;this[_0x014a('0xc')]=checkNameSurname(_0x12e8da[_0x014a('0xd')][_0x014a('0xe')],_0x12e8da[_0x014a('0xd')][_0x014a('0xf')],_0x12e8da[_0x014a('0xd')][_0x014a('0x10')]);this['active']=_0x12e8da[_0x014a('0x11')]||![];this[_0x014a('0x12')]=_0x12e8da['phone'];this[_0x014a('0x13')]=_0x12e8da[_0x014a('0x13')];this['countbusyretry']=_0x12e8da[_0x014a('0x14')]||0x0;this[_0x014a('0x15')]=_0x12e8da[_0x014a('0x15')]||0x0;this[_0x014a('0x16')]=_0x12e8da[_0x014a('0x16')]||0x0;this[_0x014a('0x17')]=(_0x12e8da[_0x014a('0x14')]||0x0)+(_0x12e8da[_0x014a('0x15')]||0x0)+(_0x12e8da[_0x014a('0x16')]||0x0)+(_0x12e8da[_0x014a('0x18')]||0x0)+(_0x12e8da[_0x014a('0x19')]||0x0)+(_0x12e8da[_0x014a('0x1a')]||0x0)+(_0x12e8da[_0x014a('0x1b')]||0x0)+(_0x12e8da[_0x014a('0x1c')]||0x0);this['countnosuchnumberretry']=_0x12e8da[_0x014a('0x18')]||0x0;this[_0x014a('0x19')]=_0x12e8da[_0x014a('0x19')]||0x0;this[_0x014a('0x1a')]=_0x12e8da[_0x014a('0x1a')]||0x0;this[_0x014a('0x1b')]=_0x12e8da[_0x014a('0x1b')]||0x0;this[_0x014a('0x1c')]=_0x12e8da[_0x014a('0x1c')]||0x0;this['callback']=_0x12e8da[_0x014a('0x1d')];this['callbackuniqueid']=_0x12e8da[_0x014a('0x1e')];this[_0x014a('0x1f')]=_0x12e8da[_0x014a('0x1f')];this[_0x014a('0x20')]=_0x12e8da[_0x014a('0x20')];this[_0x014a('0x21')]=_0x12e8da[_0x014a('0x21')];this[_0x014a('0x22')]=_0x12e8da[_0x014a('0x22')];this['UserId']=_[_0x014a('0x2')](_0x12e8da['Agent'])?_0x12e8da[_0x014a('0x23')]:_0x12e8da[_0x014a('0x8')]['id'];this['VoiceQueueId']=_0x12e8da['VoiceQueueId'];this[_0x014a('0x24')]='';this[_0x014a('0x25')]='';}Action[_0x014a('0x26')]['getCaller']=function(){return util[_0x014a('0xa')](_0x014a('0x27'),this['calleridname'],this[_0x014a('0x28')]);};module[_0x014a('0x29')]=Action; \ No newline at end of file +var _0x896e=['Contact','phone','firstName','lastName','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','queue','membername','Agent','format','SIP/%s','calleridname'];(function(_0x3c12d6,_0x2fafd6){var _0x1e6a7a=function(_0x452f1b){while(--_0x452f1b){_0x3c12d6['push'](_0x3c12d6['shift']());}};_0x1e6a7a(++_0x2fafd6);}(_0x896e,0x1e9));var _0xe896=function(_0xc161ee,_0x1b469f){_0xc161ee=_0xc161ee-0x0;var _0x31aa96=_0x896e[_0xc161ee];return _0x31aa96;};'use strict';var util=require(_0xe896('0x0'));var _=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));function checkNameSurname(_0x229b59,_0x36085e,_0x26d296){var _0x2af995='';if(!_[_0xe896('0x3')](_0x36085e)&&_0xe896('0x4')===typeof _0x36085e){_0x2af995+=_0x36085e;}if(!_[_0xe896('0x3')](_0x26d296)&&_0xe896('0x4')===typeof _0x26d296){_0x2af995+='\x20'+_0x26d296;}if(_0x2af995!==''){return _0x2af995;}return _0x229b59;}function Action(_0x318a7b,_0x52ac80,_0x24c430,_0x7a0721,_0x3b902c){this[_0xe896('0x5')]=_0x24c430||undefined;this[_0xe896('0x6')]=_0x318a7b['id'];this['queue']=_0x52ac80[_0xe896('0x7')];this[_0xe896('0x8')]=_0x52ac80[_0xe896('0x8')];this['campaigntype']=_0xe896('0x9');this['dialAnswer']=![];this[_0xe896('0xa')]=_['isNil'](_0x318a7b[_0xe896('0xb')])?undefined:_0x318a7b[_0xe896('0xb')][_0xe896('0x7')];this['channelAgent']=this[_0xe896('0xa')]?util[_0xe896('0xc')](_0xe896('0xd'),this['membername']):_0x7a0721||undefined;this[_0xe896('0xe')]=checkNameSurname(_0x318a7b[_0xe896('0xf')][_0xe896('0x10')],_0x318a7b['Contact'][_0xe896('0x11')],_0x318a7b[_0xe896('0xf')][_0xe896('0x12')]);this['active']=_0x318a7b['active']||![];this[_0xe896('0x13')]=_0x318a7b[_0xe896('0x10')];this['scheduledat']=_0x318a7b['scheduledat'];this[_0xe896('0x14')]=_0x318a7b[_0xe896('0x14')]||0x0;this['countcongestionretry']=_0x318a7b[_0xe896('0x15')]||0x0;this['countnoanswerretry']=_0x318a7b[_0xe896('0x16')]||0x0;this[_0xe896('0x17')]=(_0x318a7b[_0xe896('0x14')]||0x0)+(_0x318a7b['countcongestionretry']||0x0)+(_0x318a7b[_0xe896('0x16')]||0x0)+(_0x318a7b[_0xe896('0x18')]||0x0)+(_0x318a7b[_0xe896('0x19')]||0x0)+(_0x318a7b[_0xe896('0x1a')]||0x0)+(_0x318a7b[_0xe896('0x1b')]||0x0)+(_0x318a7b[_0xe896('0x1c')]||0x0);this[_0xe896('0x18')]=_0x318a7b[_0xe896('0x18')]||0x0;this['countdropretry']=_0x318a7b[_0xe896('0x19')]||0x0;this['countabandonedretry']=_0x318a7b['countabandonedretry']||0x0;this[_0xe896('0x1b')]=_0x318a7b[_0xe896('0x1b')]||0x0;this[_0xe896('0x1c')]=_0x318a7b[_0xe896('0x1c')]||0x0;this['callback']=_0x318a7b[_0xe896('0x1d')];this['callbackuniqueid']=_0x318a7b['callbackuniqueid'];this[_0xe896('0x1e')]=_0x318a7b[_0xe896('0x1e')];this[_0xe896('0x1f')]=_0x318a7b[_0xe896('0x1f')];this[_0xe896('0x20')]=_0x318a7b[_0xe896('0x20')];this[_0xe896('0x21')]=_0x318a7b['ListId'];this[_0xe896('0x22')]=_[_0xe896('0x3')](_0x318a7b[_0xe896('0xb')])?_0x318a7b['UserId']:_0x318a7b[_0xe896('0xb')]['id'];this[_0xe896('0x23')]=_0x318a7b[_0xe896('0x23')];this[_0xe896('0x24')]='';this[_0xe896('0x25')]='';}Action[_0xe896('0x26')]['getCaller']=function(){return util[_0xe896('0xc')](_0xe896('0x27'),this[_0xe896('0xe')],this[_0xe896('0x28')]);};module[_0xe896('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 65092c3..b40e316 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 _0xea06=['dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','execCall','SIP/%s/%s%s','dialPrefix','trim','phone','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','logger','\x20is\x20deactivated','prototype','syncCampaigns','preview','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pick','contactId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','dialGlobalMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]'];(function(_0x4beefc,_0x115776){var _0x21a761=function(_0x11ea1a){while(--_0x11ea1a){_0x4beefc['push'](_0x4beefc['shift']());}};_0x21a761(++_0x115776);}(_0xea06,0x1e8));var _0x6ea0=function(_0x210c7c,_0x21a920){_0x210c7c=_0x210c7c-0x0;var _0x6b2143=_0xea06[_0x210c7c];return _0x6b2143;};'use strict';var util=require(_0x6ea0('0x0'));var _=require(_0x6ea0('0x1'));var uuid=require(_0x6ea0('0x2'));var moment=require(_0x6ea0('0x3'));var md5=require(_0x6ea0('0x4'));var Redis=require(_0x6ea0('0x5'));var config=require(_0x6ea0('0x6'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0x6ea0('0x7'))(_0x6ea0('0x8'));var ami=require(_0x6ea0('0x9'));var rpcDb=require(_0x6ea0('0xa'));var cmHopperAdditionalPhone=require(_0x6ea0('0xb'));var Action=require(_0x6ea0('0xc'));var ut=require(_0x6ea0('0xd'));config[_0x6ea0('0xe')]=_[_0x6ea0('0xf')](config['redis'],{'host':_0x6ea0('0x10'),'port':0x18eb});var io=require(_0x6ea0('0x11'))(new Redis(config[_0x6ea0('0xe')]));var Sequence=function(){};Sequence['prototype'][_0x6ea0('0x12')]=function(_0x3ea604){this[_0x6ea0('0x13')]=this[_0x6ea0('0x13')]?this['tail']['finally'](_0x3ea604):_0x3ea604();};function Preview(_0x13d4c8){this[_0x6ea0('0x14')]=new Sequence();this[_0x6ea0('0x15')]=_0x13d4c8[_0x6ea0('0x16')];this[_0x6ea0('0x17')]=_0x13d4c8[_0x6ea0('0x17')];this[_0x6ea0('0x18')]={};this[_0x6ea0('0x19')]=_0x13d4c8[_0x6ea0('0x19')];this['clockClearZombieChannels']=0x0;ami['on'](_0x6ea0('0x1a'),this[_0x6ea0('0x1b')][_0x6ea0('0x1c')](this));ami['on'](_0x6ea0('0x1d'),this['syncHangup']['bind'](this));ami['on'](_0x6ea0('0x1e'),this[_0x6ea0('0x1f')][_0x6ea0('0x1c')](this));ami['on'](_0x6ea0('0x20'),this[_0x6ea0('0x21')][_0x6ea0('0x1c')](this));ami['on'](_0x6ea0('0x22'),this[_0x6ea0('0x23')][_0x6ea0('0x1c')](this));ami['on'](_0x6ea0('0x24'),this[_0x6ea0('0x25')][_0x6ea0('0x1c')](this));ami['on'](_0x6ea0('0x26'),this[_0x6ea0('0x27')][_0x6ea0('0x1c')](this));ami['on'](_0x6ea0('0x28'),this[_0x6ea0('0x29')][_0x6ea0('0x1c')](this));this[_0x6ea0('0x2a')](this[_0x6ea0('0x15')]);}function emit(_0x16f601,_0x3893c2,_0x97b48c){io['to'](_0x16f601)[_0x6ea0('0x2b')](_0x3893c2,_0x97b48c);}function emitCampaignPreview(_0x199a1f){if(_0x199a1f['type']===_0x6ea0('0x2c')){var _0x46f5cb={'id':_0x199a1f['id'],'name':_0x199a1f[_0x6ea0('0x2d')],'strategy':_0x199a1f[_0x6ea0('0x2e')],'answered':_0x199a1f[_0x6ea0('0x2f')],'available':_0x199a1f[_0x6ea0('0x30')],'loggedIn':_0x199a1f[_0x6ea0('0x31')],'pTalking':_0x199a1f[_0x6ea0('0x32')],'sumBillable':_0x199a1f[_0x6ea0('0x33')],'sumDuration':_0x199a1f[_0x6ea0('0x34')],'sumHoldTime':_0x199a1f[_0x6ea0('0x35')]||0x0,'talking':_0x199a1f[_0x6ea0('0x36')],'total':_0x199a1f[_0x6ea0('0x37')],'type':_0x199a1f[_0x6ea0('0x38')],'unmanaged':_0x199a1f[_0x6ea0('0x39')],'abandoned':_0x199a1f[_0x6ea0('0x3a')],'waiting':_0x199a1f['waiting'],'loggedInDb':_0x199a1f['loggedInDb'],'dialActive':_0x199a1f[_0x6ea0('0x3b')],'dialMethod':_0x199a1f[_0x6ea0('0x3c')],'dialOriginateCallerIdName':_0x199a1f[_0x6ea0('0x3d')],'dialOriginateCallerIdNumber':_0x199a1f[_0x6ea0('0x3e')],'dialOriginateTimeout':_0x199a1f[_0x6ea0('0x3f')],'dialPrefix':_0x199a1f['dialPrefix'],'outboundAnswerAgiCallsDay':_0x199a1f[_0x6ea0('0x40')],'outboundAnswerCallsDay':_0x199a1f[_0x6ea0('0x41')],'outboundBlacklistCallsDay':_0x199a1f[_0x6ea0('0x42')],'outboundBusyCallsDay':_0x199a1f[_0x6ea0('0x43')],'outboundCongestionCallsDay':_0x199a1f[_0x6ea0('0x44')],'outboundDropCallsDayACS':_0x199a1f[_0x6ea0('0x45')],'outboundDropCallsDayCallersExit':_0x199a1f[_0x6ea0('0x46')],'outboundDropCallsDayTimeout':_0x199a1f['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x199a1f[_0x6ea0('0x47')],'outboundNoSuchCallsDay':_0x199a1f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x199a1f[_0x6ea0('0x48')],'outboundReCallsDay':_0x199a1f[_0x6ea0('0x49')],'outboundRejectCallsDay':_0x199a1f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x199a1f[_0x6ea0('0x4a')],'outboundAbandonedCallsDay':_0x199a1f['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x199a1f[_0x6ea0('0x4b')],'predictiveIntervalAvgHoldtime':_0x199a1f[_0x6ea0('0x4c')],'predictiveIntervalAvgTalktime':_0x199a1f[_0x6ea0('0x4d')],'predictiveIntervalDroppedCallsCallersExit':_0x199a1f['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x199a1f[_0x6ea0('0x4e')],'predictiveIntervalErlangCalls':_0x199a1f['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x199a1f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x199a1f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x199a1f[_0x6ea0('0x4f')],'predictiveIntervalPauses':_0x199a1f[_0x6ea0('0x50')],'predictiveIntervalAvailable':_0x199a1f[_0x6ea0('0x51')],'predictiveIntervalTotalCalls':_0x199a1f['predictiveIntervalTotalCalls'],'message':_0x199a1f['message'],'originated':_0x199a1f[_0x6ea0('0x52')],'erlangCalls':_0x199a1f[_0x6ea0('0x53')],'erlangCallToSecond':_0x199a1f[_0x6ea0('0x54')],'erlangAbandonmentRate':_0x199a1f[_0x6ea0('0x55')],'erlangBusyFactor':_0x199a1f['erlangBusyFactor'],'startPredictive':_0x199a1f[_0x6ea0('0x56')],'startProgressive':_0x199a1f[_0x6ea0('0x57')]};if(_0x199a1f['Trunk']){_0x46f5cb[_0x6ea0('0x58')]={'id':_0x199a1f['Trunk']['id'],'name':_0x199a1f[_0x6ea0('0x58')][_0x6ea0('0x2d')],'active':_0x199a1f[_0x6ea0('0x58')]['active'],'callerid':_0x199a1f[_0x6ea0('0x58')][_0x6ea0('0x59')]};}if(_0x199a1f[_0x6ea0('0x5a')]){_0x46f5cb[_0x6ea0('0x5a')]={'id':_0x199a1f[_0x6ea0('0x5a')]['id'],'name':_0x199a1f[_0x6ea0('0x5a')][_0x6ea0('0x2d')]};}var _0x209451=md5(JSON[_0x6ea0('0x5b')](_0x46f5cb));if(_0x199a1f[_0x6ea0('0x4')]!==_0x209451){_0x199a1f[_0x6ea0('0x4')]=_0x209451;emit(util[_0x6ea0('0x5c')]('voice:queue:%s',_0x46f5cb[_0x6ea0('0x2d')]),_0x6ea0('0x5d'),_0x46f5cb);}}}function emitVoiceQueueChannelRemove(_0x5a53d3){logger[_0x6ea0('0x5e')](_0x6ea0('0x5f'),JSON[_0x6ea0('0x5b')](_0x5a53d3));emit(util[_0x6ea0('0x5c')](_0x6ea0('0x60'),_0x5a53d3[_0x6ea0('0x2d')]),_0x6ea0('0x61'),_0x5a53d3);io[_0x6ea0('0x2b')](_0x6ea0('0x62'),_0x5a53d3);}function notSendMessagesQueue(_0x37a639){if(_0x37a639['sendMessageOneNotActive']){if(_0x37a639[_0x6ea0('0x52')]===0x0&&_0x37a639[_0x6ea0('0x32')]===0x0){_0x37a639[_0x6ea0('0x63')]=![];_0x37a639[_0x6ea0('0x30')]=0x0;_0x37a639[_0x6ea0('0x64')]=0x0;_0x37a639[_0x6ea0('0x65')]='NOT_ACTIVE';ut['logger'](_0x6ea0('0x66'),_0x37a639[_0x6ea0('0x2d')]+'\x20is\x20not\x20active');}else{_0x37a639[_0x6ea0('0x65')]=_0x6ea0('0x67');ut[_0x6ea0('0x68')](_0x6ea0('0x66'),_0x37a639[_0x6ea0('0x2d')]+_0x6ea0('0x69'));}emitCampaignPreview(_0x37a639);}}Preview[_0x6ea0('0x6a')][_0x6ea0('0x2a')]=function(){var _0x57b3c7=this;setInterval(function(){_0x57b3c7[_0x6ea0('0x6b')]();},0x7cf);};Preview['prototype'][_0x6ea0('0x6b')]=function(){var _0xa96fe7=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x53c0ba in _0xa96fe7){if(_0xa96fe7['hasOwnProperty'](_0x53c0ba)&&(_0xa96fe7[_0x53c0ba]['dialMethod']===_0x6ea0('0x6c')||_0xa96fe7[_0x53c0ba]['dialMethod']===_0x6ea0('0x6d'))&&_0xa96fe7[_0x53c0ba][_0x6ea0('0x38')]===_0x6ea0('0x2c')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0x6ea0('0x6e')]();}}if(_0xa96fe7[_0x6ea0('0x6f')](_0x53c0ba)&&_0xa96fe7[_0x53c0ba][_0x6ea0('0x3c')]===_0x6ea0('0x6c')&&_0xa96fe7[_0x53c0ba]['type']===_0x6ea0('0x2c')){if(_0xa96fe7[_0x53c0ba][_0x6ea0('0x3b')]){this[_0x6ea0('0x70')](_0xa96fe7[_0x53c0ba]);if(_0xa96fe7[_0x53c0ba]['dialPreviewAutoRecallMe'])this[_0x6ea0('0x71')](_0xa96fe7[_0x53c0ba]);}else{notSendMessagesQueue(_0xa96fe7[_0x53c0ba]);}}}};Preview[_0x6ea0('0x6a')][_0x6ea0('0x72')]=function(_0xf50b40){var _0x31572d=this;this['sequence'][_0x6ea0('0x12')](function(){if(!_[_0x6ea0('0x73')](_0x31572d[_0x6ea0('0x18')][_0xf50b40])){loggerAction[_0x6ea0('0x5e')](_0x6ea0('0x74'),_0xf50b40,_0x6ea0('0x75'),_0x31572d['actions'][_0xf50b40][_0x6ea0('0x76')],_0x6ea0('0x77'),JSON['stringify'](_0x31572d[_0x6ea0('0x15')][_0x31572d[_0x6ea0('0x18')][_0xf50b40]['queue']][_0x6ea0('0x52')]),'pTalking:\x20',JSON['stringify'](_0x31572d[_0x6ea0('0x15')][_0x31572d['actions'][_0xf50b40][_0x6ea0('0x76')]][_0x6ea0('0x32')]),JSON['stringify'](_0x31572d['actions'][_0xf50b40]['dialAnswer']),JSON[_0x6ea0('0x5b')](_[_0x6ea0('0x78')](_0x31572d[_0x6ea0('0x18')][_0xf50b40],[_0x6ea0('0x79'),'UserId','VoiceQueueId',_0x6ea0('0x7a')])));return ami[_0x6ea0('0x7b')]({'action':_0x6ea0('0x7c'),'channel':_0x31572d[_0x6ea0('0x18')][_0xf50b40][_0x6ea0('0x7d')]})['catch'](function(_0x21a5cd){if(_0x21a5cd['message']===_0x6ea0('0x7e')){setTimeout(function(){if(_0x31572d[_0x6ea0('0x18')][_0xf50b40]){ut[_0x6ea0('0x7f')](_0x31572d[_0x6ea0('0x15')][_0x31572d['actions'][_0xf50b40][_0x6ea0('0x76')]],_0x6ea0('0x80'));if(_0x31572d[_0x6ea0('0x18')][_0xf50b40][_0x6ea0('0x81')]===!![]){ut[_0x6ea0('0x82')](_0x31572d[_0x6ea0('0x15')][_0x31572d[_0x6ea0('0x18')][_0xf50b40][_0x6ea0('0x76')]],_0x6ea0('0x80'));ut[_0x6ea0('0x83')](_0x6ea0('0x84')+_0xf50b40,_0x31572d[_0x6ea0('0x18')][_0xf50b40][_0x6ea0('0x76')]);}ut[_0x6ea0('0x83')](_0x6ea0('0x85')+_0xf50b40,_0x31572d[_0x6ea0('0x18')][_0xf50b40][_0x6ea0('0x76')]);delete _0x31572d[_0x6ea0('0x18')][_0xf50b40];}},0x2328);}});}});};Preview[_0x6ea0('0x6a')]['clearZombieChannels']=function(){var _0x4193fc=this;loggerAction['info'](_0x6ea0('0x86'),_[_0x6ea0('0x87')](this[_0x6ea0('0x18')]));for(var _0x406740 in this[_0x6ea0('0x18')]){if(_0x4193fc[_0x6ea0('0x18')][_0x6ea0('0x6f')](_0x406740)){_0x4193fc['clearZombieChannel'](_0x406740);}}};Preview[_0x6ea0('0x6a')][_0x6ea0('0x71')]=function(_0x4f1192){var _0x440a2c=this;rpcDb['getContactRecallMe'](_0x4f1192['id'],ut[_0x6ea0('0x88')](this[_0x6ea0('0x19')]))[_0x6ea0('0x89')](function(_0x3ebfec){if(!_[_0x6ea0('0x73')](_0x3ebfec)){for(var _0xd0e3e=0x0;_0xd0e3e<_0x3ebfec['length'];_0xd0e3e+=0x1){if(ut[_0x6ea0('0x8a')](_0x3ebfec[_0xd0e3e]['scheduledat'])<_0x4f1192[_0x6ea0('0x8b')]*0x3c){if(_0x3ebfec[_0xd0e3e][_0x6ea0('0x8c')]&&!_0x3ebfec[_0xd0e3e][_0x6ea0('0x8c')][_0x6ea0('0x8d')]){_0x440a2c[_0x6ea0('0x8e')](_0x3ebfec[_0xd0e3e]['id'])['then'](ut[_0x6ea0('0x8f')](_0x6ea0('0x90')))['catch'](ut[_0x6ea0('0x8f')](_0x6ea0('0x90')));}else{rpcDb[_0x6ea0('0x91')](_0x3ebfec[_0xd0e3e]['id']);}}else{var _0x54b854=new Action(_0x3ebfec[_0xd0e3e],_0x4f1192);_0x54b854[_0x6ea0('0x92')]=moment()[_0x6ea0('0x5c')](_0x6ea0('0x93'));_0x4f1192['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x54b854,0x17,_0x6ea0('0x94'));if(_0x4f1192['dialRecallInQueue']){rpcDb[_0x6ea0('0x95')](ut[_0x6ea0('0x96')](_0x3ebfec[_0xd0e3e]));rpcDb[_0x6ea0('0x97')](_0x54b854,_0x6ea0('0x98'));}else{ut['logCustomer'](_0x54b854,0x16,_0x6ea0('0x99'));rpcDb['createCustomerHistory'](_0x54b854,_0x6ea0('0x9a'));rpcDb[_0x6ea0('0x9b')](_0x54b854,_0x6ea0('0x9a'));}}}}})[_0x6ea0('0x9c')](ut[_0x6ea0('0x8f')](_0x6ea0('0x9d')));};Preview[_0x6ea0('0x6a')][_0x6ea0('0x70')]=function(_0xa969ac){_0xa969ac[_0x6ea0('0x63')]=!![];if(ut[_0x6ea0('0x9e')](_0xa969ac['loggedIn'])){_0xa969ac['message']=_0x6ea0('0x9f');}else if(!ut[_0x6ea0('0xa0')](_0xa969ac[_0x6ea0('0x3b')])){_0xa969ac[_0x6ea0('0x65')]=_0x6ea0('0xa1');}else if(!this[_0x6ea0('0xa2')](_0xa969ac['Trunk'])){if(!this['isTrunkReachable'](_0xa969ac['TrunkBackup'])){_0xa969ac[_0x6ea0('0x65')]=_0x6ea0('0xa3');}else{_0xa969ac['message']=_0x6ea0('0xa4');}}else{_0xa969ac['message']=_0x6ea0('0xa4');}emitCampaignPreview(_0xa969ac);};Preview[_0x6ea0('0x6a')][_0x6ea0('0xa5')]=function(_0x240113,_0x1161fa,_0x1e0e2c){var _0x349464=this;var _0x3058fe=this['actions'][_0x1161fa];var _0x5c6b82=this['campaignsPreview'][_0x3058fe[_0x6ea0('0x76')]];var _0x413d79;var _0x43d8bd=![];var _0x35f2c8=0x2;var _0x4e5f55=0x3;if(_0x5c6b82){switch(_0x1e0e2c){case'1':_0x5c6b82[_0x6ea0('0xa6')]+=0x1;_0x3058fe[_0x6ea0('0xa7')]+=0x1;_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut[_0x6ea0('0xaa')](_0x3058fe,0x0,_0x6ea0('0xab'));ami[_0x6ea0('0x2b')]('custom:agentnosuchnumber',ut[_0x6ea0('0xac')](_0x3058fe,_0x6ea0('0xad')));rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0xae'));_0x349464[_0x6ea0('0xaf')](_0x3058fe,'0',_0x5c6b82)[_0x6ea0('0x89')](function(_0x4448f4){_0x43d8bd=_0x4448f4['additional']==0x1;_0x35f2c8=_0x5c6b82[_0x6ea0('0xb0')];_0x4e5f55=_0x5c6b82['callAdditionalPhoneAfterMin'];if(!_0x43d8bd){if(ut[_0x6ea0('0xa9')](_0x3058fe)>=_0x5c6b82['dialGlobalMaxRetry']){_0x413d79=ut[_0x6ea0('0xb1')](_0x3058fe,0xf,_0x6ea0('0xb2'));rpcDb[_0x6ea0('0x9b')](_0x413d79,_0x6ea0('0xb3'));}else{if(_0x3058fe[_0x6ea0('0xa7')]>=_0x5c6b82[_0x6ea0('0xb4')]){rpcDb['createCustomerFinal'](_0x3058fe,_0x6ea0('0xb3'));}else{rpcDb[_0x6ea0('0xb5')](ut[_0x6ea0('0xb6')](_0x3058fe,_0x6ea0('0xa7'),_0x5c6b82['dialNoSuchNumberRetryFrequency']),_0x3058fe[_0x6ea0('0xb7')],_0x3058fe[_0x6ea0('0xb8')]);}}delete this[_0x6ea0('0x18')][_0x240113['linkedid']];}else{_0x3058fe['countnosuchnumberretry']++;logger[_0x6ea0('0x5e')](_0x6ea0('0xb9'),_0x3058fe[_0x6ea0('0xa7')]);logger[_0x6ea0('0x5e')]('id',_0x3058fe[_0x6ea0('0xba')]);_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe['idContact'],'field':{'countnosuchnumberretry':_0x3058fe['countnosuchnumberretry']}})['then'](function(){_0x349464[_0x6ea0('0xbc')](_0x3058fe,_0x35f2c8,_0x4e5f55)[_0x6ea0('0x89')](function(){});});}});break;case'ANSWER':var _0x5626e7=moment()['format'](_0x6ea0('0x93'));_0x3058fe[_0x6ea0('0xbd')]=_0x5626e7;_0x3058fe[_0x6ea0('0xbe')]=_0x5626e7;_0x3058fe[_0x6ea0('0x81')]=!![];_0x5c6b82['pTalking']+=0x1;logger[_0x6ea0('0x5e')](_0x6ea0('0xbf'),_0x3058fe[_0x6ea0('0xc0')],_0x6ea0('0xc1'),_0x5c6b82['name'],_0x6ea0('0xc2'),_0x5c6b82[_0x6ea0('0x32')]);ami[_0x6ea0('0x2b')]('custom:agentconnect',ut['buildObj'](_0x3058fe,_0x6ea0('0xc3'),this['campaignsPreview'][_0x3058fe['queue']]));if(_0x5c6b82[_0x6ea0('0xc4')]){ami[_0x6ea0('0x2b')](_0x6ea0('0xc5'),ut[_0x6ea0('0xc6')](_0x3058fe));}break;case'16':ami[_0x6ea0('0x2b')](_0x6ea0('0xc7'),ut['buildObj'](_0x3058fe,_0x6ea0('0xc8'),this[_0x6ea0('0x15')][_0x3058fe['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3058fe,_0x6ea0('0xc8')));_0x5c6b82[_0x6ea0('0x41')]+=0x1;_0x5c6b82['total']+=0x1;_0x5c6b82[_0x6ea0('0x2f')]+=0x1;ut[_0x6ea0('0x82')](_0x5c6b82,_0x6ea0('0xc9'));_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut[_0x6ea0('0xaa')](_0x3058fe,0x4,_0x6ea0('0xca'));rpcDb[_0x6ea0('0x97')](_0x3058fe,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0xcb'));rpcDb[_0x6ea0('0xcc')](_0x3058fe);_0x5c6b82[_0x6ea0('0x34')]+=_0x3058fe[_0x6ea0('0xcd')];_0x5c6b82[_0x6ea0('0x33')]+=_0x3058fe['talktime'];logger[_0x6ea0('0x5e')](_0x6ea0('0xce'),_0x3058fe[_0x6ea0('0xc0')],_0x6ea0('0xc1'),_0x5c6b82[_0x6ea0('0x2d')],_0x6ea0('0xc2'),_0x5c6b82[_0x6ea0('0x32')]);delete this[_0x6ea0('0x18')][_0x240113[_0x6ea0('0xcf')]];break;case _0x6ea0('0xd0'):_0x5c6b82[_0x6ea0('0x43')]+=0x1;_0x3058fe[_0x6ea0('0xd1')]+=0x1;_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut[_0x6ea0('0xaa')](_0x3058fe,0x5,_0x6ea0('0xd2'));_0x35f2c8=_0x5c6b82[_0x6ea0('0xd3')];_0x4e5f55=_0x5c6b82[_0x6ea0('0xd4')];ami['emit'](_0x6ea0('0xd5'),ut['buildObj'](_0x3058fe,_0x6ea0('0xd6')));rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0xd7'));_0x349464[_0x6ea0('0xaf')](_0x3058fe,'5',_0x5c6b82)[_0x6ea0('0x89')](function(_0x55cd09){_0x43d8bd=_0x55cd09[_0x6ea0('0xd8')]==0x1;if(!_0x43d8bd){if(ut['totalGlobal'](_0x3058fe)>=_0x5c6b82[_0x6ea0('0xd9')]){_0x413d79=ut['cloneAction'](_0x3058fe,0xf,_0x6ea0('0xb2'));rpcDb[_0x6ea0('0x9b')](_0x413d79,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3058fe[_0x6ea0('0xd1')]>=_0x5c6b82['dialBusyMaxRetry']){rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0xd7'));}else{rpcDb[_0x6ea0('0xb5')](ut['scheduledAt'](_0x3058fe,_0x6ea0('0xd1'),_0x5c6b82[_0x6ea0('0xd3')]),_0x3058fe[_0x6ea0('0xb7')],_0x3058fe[_0x6ea0('0xb8')]);}}}else{_0x3058fe[_0x6ea0('0xd1')]++;_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe[_0x6ea0('0xba')],'field':{'countbusyretry':_0x3058fe[_0x6ea0('0xd1')]}})[_0x6ea0('0x89')](function(){_0x349464['swapAdditionalPhones'](_0x3058fe,_0x35f2c8,_0x4e5f55)['then'](function(){});});}});break;case _0x6ea0('0xda'):_0x5c6b82[_0x6ea0('0x47')]+=0x1;_0x3058fe[_0x6ea0('0xdb')]+=0x1;_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut[_0x6ea0('0xaa')](_0x3058fe,0x3,_0x6ea0('0xdc'));_0x35f2c8=_0x5c6b82[_0x6ea0('0xdd')];_0x4e5f55=_0x5c6b82[_0x6ea0('0xd4')];var _0x4144e3=ut[_0x6ea0('0xde')](_0x3058fe,_0x5c6b82);ami[_0x6ea0('0x2b')](_0x6ea0('0xdf'),_0x4144e3);rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0xe0'));_0x349464[_0x6ea0('0xaf')](_0x3058fe,'3',_0x5c6b82)['then'](function(_0x5332b6){_0x43d8bd=_0x5332b6[_0x6ea0('0xd8')]==0x1;if(!_0x43d8bd){if(ut[_0x6ea0('0xa9')](_0x3058fe)>=_0x5c6b82[_0x6ea0('0xd9')]){_0x413d79=ut[_0x6ea0('0xb1')](_0x3058fe,0xf,'Global');rpcDb[_0x6ea0('0x9b')](_0x413d79,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3058fe['countnoanswerretry']>=_0x5c6b82[_0x6ea0('0xe1')]){rpcDb['createCustomerFinal'](_0x3058fe,_0x6ea0('0xe0'));}else{rpcDb[_0x6ea0('0xb5')](ut['scheduledAt'](_0x3058fe,'countnoanswerretry',_0x5c6b82[_0x6ea0('0xdd')]),_0x3058fe[_0x6ea0('0xb7')],_0x3058fe['activeContact']);}}}else{_0x3058fe[_0x6ea0('0xdb')]++;_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe[_0x6ea0('0xba')],'field':{'countnoanswerretry':_0x3058fe[_0x6ea0('0xdb')]}})[_0x6ea0('0x89')](function(){_0x349464[_0x6ea0('0xbc')](_0x3058fe,_0x35f2c8,_0x4e5f55)['then'](function(){});});}});break;case _0x6ea0('0xe2'):_0x5c6b82['outboundCongestionCallsDay']+=0x1;_0x3058fe[_0x6ea0('0xe3')]+=0x1;_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut['logCustomer'](_0x3058fe,0x8,_0x6ea0('0xe4'));_0x35f2c8=_0x5c6b82[_0x6ea0('0xe5')];_0x4e5f55=_0x5c6b82[_0x6ea0('0xd4')];ami[_0x6ea0('0x2b')](_0x6ea0('0xe6'),ut['buildObj'](_0x3058fe,_0x6ea0('0xe7')));rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0xe8'));_0x349464['verifyAdditionalPhones'](_0x3058fe,'8',_0x5c6b82)['then'](function(_0x40c212){_0x43d8bd=_0x40c212[_0x6ea0('0xd8')]==0x1;if(!_0x43d8bd){if(ut[_0x6ea0('0xa9')](_0x3058fe)>=_0x5c6b82[_0x6ea0('0xd9')]){_0x413d79=ut['cloneAction'](_0x3058fe,0xf,_0x6ea0('0xb2'));rpcDb[_0x6ea0('0x9b')](_0x413d79,_0x6ea0('0xe9'));}else{if(_0x3058fe['countcongestionretry']>=_0x5c6b82[_0x6ea0('0xea')]){rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0xe8'));}else{rpcDb[_0x6ea0('0xb5')](ut[_0x6ea0('0xb6')](_0x3058fe,'countcongestionretry',_0x5c6b82[_0x6ea0('0xd3')]),_0x3058fe['unlockAgent'],_0x3058fe['activeContact']);}}}else{_0x3058fe[_0x6ea0('0xe3')]++;_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe[_0x6ea0('0xba')],'field':{'countcongestionretry':_0x3058fe[_0x6ea0('0xe3')]}})[_0x6ea0('0x89')](function(){_0x349464['swapAdditionalPhones'](_0x3058fe,_0x35f2c8,_0x4e5f55)[_0x6ea0('0x89')](function(){});});}});break;case'CANCEL':_0x5c6b82[_0x6ea0('0xeb')]+=0x1;_0x3058fe[_0x6ea0('0xec')]+=0x1;_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut[_0x6ea0('0xaa')](_0x3058fe,0x14,'AgentReject');_0x35f2c8=_0x5c6b82['dialAgentRejectRetryFrequency'];_0x4e5f55=_0x5c6b82[_0x6ea0('0xd4')];ami['emit'](_0x6ea0('0xed'),ut[_0x6ea0('0xac')](_0x3058fe,_0x6ea0('0xee')));rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0xef'));_0x349464[_0x6ea0('0xaf')](_0x3058fe,'20',_0x5c6b82)[_0x6ea0('0x89')](function(_0x13a9b1){_0x43d8bd=_0x13a9b1[_0x6ea0('0xd8')]==0x1;if(!_0x43d8bd){if(ut['totalGlobal'](_0x3058fe)>=_0x5c6b82[_0x6ea0('0xd9')]){_0x413d79=ut['cloneAction'](_0x3058fe,0x14,_0x6ea0('0xf0'));rpcDb['createCustomerFinal'](_0x413d79,_0x6ea0('0xf1'));}else{if(_0x3058fe[_0x6ea0('0xec')]>=_0x5c6b82[_0x6ea0('0xf2')]){rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0xf1'));}else{rpcDb[_0x6ea0('0xb5')](ut[_0x6ea0('0xb6')](_0x3058fe,_0x6ea0('0xec'),_0x5c6b82[_0x6ea0('0xf3')]),_0x3058fe[_0x6ea0('0xb7')],_0x3058fe[_0x6ea0('0xb8')]);}}}else{_0x3058fe[_0x6ea0('0xdb')]++;_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe['idContact'],'field':{'countnoanswerretry':_0x3058fe[_0x6ea0('0xdb')]}})[_0x6ea0('0x89')](function(){_0x349464[_0x6ea0('0xbc')](_0x3058fe,_0x35f2c8,_0x4e5f55)[_0x6ea0('0x89')](function(){});});}});break;case _0x6ea0('0xf4'):_0x5c6b82[_0x6ea0('0xf5')]+=0x1;_0x3058fe[_0x6ea0('0xf6')]+=0x1;_0x3058fe['countglobal']=ut[_0x6ea0('0xa9')](_0x3058fe);ut['logCustomer'](_0x3058fe,0xb,_0x6ea0('0xf7'));rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0xf8'));_0x349464[_0x6ea0('0xaf')](_0x3058fe,'11',_0x5c6b82)[_0x6ea0('0x89')](function(_0x35128e){_0x43d8bd=_0x35128e[_0x6ea0('0xd8')]==0x1;if(!_0x43d8bd){if(ut[_0x6ea0('0xa9')](_0x3058fe)>=_0x5c6b82['dialGlobalMaxRetry']){_0x413d79=ut[_0x6ea0('0xb1')](_0x3058fe,0xf,_0x6ea0('0xb2'));rpcDb[_0x6ea0('0x9b')](_0x413d79,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3058fe[_0x6ea0('0xf9')]>=_0x5c6b82[_0x6ea0('0xfa')]){rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0xf8'));}else{rpcDb['rescheduleContact'](ut[_0x6ea0('0xb6')](_0x3058fe,_0x6ea0('0xf6'),_0x5c6b82[_0x6ea0('0xfb')]),_0x3058fe[_0x6ea0('0xb7')],_0x3058fe['activeContact']);}}}else{_0x3058fe['countnoanswerretry']++;_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe[_0x6ea0('0xba')],'field':{'countnoanswerretry':_0x3058fe[_0x6ea0('0xdb')]}})[_0x6ea0('0x89')](function(){_0x349464[_0x6ea0('0xbc')](_0x3058fe,_0x35f2c8,_0x4e5f55)[_0x6ea0('0x89')](function(){});});}});break;case'18':_0x5c6b82[_0x6ea0('0x4a')]+=0x1;_0x3058fe[_0x6ea0('0xfc')]+=0x1;_0x3058fe['countglobal']=ut[_0x6ea0('0xa9')](_0x3058fe);ut['logCustomer'](_0x3058fe,0x12,_0x240113['cause-txt']||_0x240113['dialstatus']);ami[_0x6ea0('0x2b')](_0x6ea0('0xfd'),ut[_0x6ea0('0xac')](_0x3058fe,'amd'));rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0xfe'));_0x349464[_0x6ea0('0xaf')](_0x3058fe,'18',_0x5c6b82)[_0x6ea0('0x89')](function(_0x29cb70){_0x43d8bd=_0x29cb70[_0x6ea0('0xd8')]==0x1;if(!_0x43d8bd){if(ut[_0x6ea0('0xa9')](_0x3058fe)>=_0x5c6b82[_0x6ea0('0xd9')]){_0x413d79=ut['cloneAction'](_0x3058fe,0x12,_0x6ea0('0xb2'));rpcDb[_0x6ea0('0x9b')](_0x413d79,_0x6ea0('0xfe'));}else{rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0xfe'));}}else{_0x3058fe[_0x6ea0('0xdb')]++;_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe['idContact'],'field':{'countnoanswerretry':_0x3058fe[_0x6ea0('0xdb')]}})[_0x6ea0('0x89')](function(){_0x349464[_0x6ea0('0xbc')](_0x3058fe,_0x35f2c8,_0x4e5f55)[_0x6ea0('0x89')](function(){});});}});delete this[_0x6ea0('0x18')][_0x240113[_0x6ea0('0xcf')]];break;case'19':_0x5c6b82[_0x6ea0('0x4a')]+=0x1;_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut['logCustomer'](_0x3058fe,0x13,_0x240113[_0x6ea0('0xff')]||_0x240113[_0x6ea0('0x100')]);ami['emit'](_0x6ea0('0xfd'),ut[_0x6ea0('0xac')](_0x3058fe,_0x6ea0('0x101')));rpcDb[_0x6ea0('0x97')](_0x3058fe,'[callProgressDetectingCustomer][machine]');_0x349464[_0x6ea0('0xaf')](_0x3058fe,'18',_0x5c6b82)[_0x6ea0('0x89')](function(_0x362ffd){_0x43d8bd=_0x362ffd[_0x6ea0('0xd8')]==0x1;if(!_0x43d8bd){if(ut[_0x6ea0('0xa9')](_0x3058fe)>=_0x5c6b82[_0x6ea0('0xd9')]){_0x413d79=ut[_0x6ea0('0xb1')](_0x3058fe,0xf,_0x6ea0('0xb2'));rpcDb[_0x6ea0('0x9b')](_0x413d79,_0x6ea0('0x102'));}else{rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0x102'));}}else{_0x3058fe[_0x6ea0('0xdb')]++;_0x349464[_0x6ea0('0xbb')]({'id':_0x3058fe[_0x6ea0('0xba')],'field':{'countnoanswerretry':_0x3058fe[_0x6ea0('0xdb')]}})[_0x6ea0('0x89')](function(){_0x349464[_0x6ea0('0xbc')](_0x3058fe,_0x35f2c8,_0x4e5f55)[_0x6ea0('0x89')](function(){});});}});delete this[_0x6ea0('0x18')][_0x240113[_0x6ea0('0xcf')]];break;default:if(_0x3058fe[_0x6ea0('0x81')]){ut[_0x6ea0('0x82')](_0x5c6b82,'[default]');ut[_0x6ea0('0x83')](_0x6ea0('0x103')+_0x5c6b82[_0x6ea0('0x2d')],_0x240113);}_0x5c6b82[_0x6ea0('0x4a')]+=0x1;_0x3058fe[_0x6ea0('0xa8')]=ut[_0x6ea0('0xa9')](_0x3058fe);ut[_0x6ea0('0xaa')](_0x3058fe,0xc,_0x240113['cause-txt']||_0x240113[_0x6ea0('0x100')]);_0x35f2c8=_0x5c6b82[_0x6ea0('0xf3')];_0x4e5f55=_0x5c6b82[_0x6ea0('0xd4')];rpcDb[_0x6ea0('0x97')](_0x3058fe,_0x6ea0('0x104'));_0x349464[_0x6ea0('0xaf')](_0x3058fe,'20',_0x5c6b82)['then'](function(_0x17b0df){_0x43d8bd=_0x17b0df['additional']==0x1;if(!_0x43d8bd){if(ut[_0x6ea0('0xa9')](_0x3058fe)>=_0x5c6b82[_0x6ea0('0xd9')]){_0x413d79=ut[_0x6ea0('0xb1')](_0x3058fe,0xf,_0x6ea0('0xb2'));rpcDb['createCustomerFinal'](_0x413d79,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x6ea0('0x9b')](_0x3058fe,_0x6ea0('0x105'));}delete this['actions'][_0x240113[_0x6ea0('0xcf')]];}else{_0x349464[_0x6ea0('0xbc')](_0x3058fe,_0x35f2c8,_0x4e5f55)['then'](function(){});}});}if(!(_0x3058fe[_0x6ea0('0x81')]&&_0x1e0e2c==='16')){ut[_0x6ea0('0x7f')](_0x5c6b82,_0x6ea0('0x106'));logger[_0x6ea0('0x5e')](_0x6ea0('0x107'),_0x3058fe[_0x6ea0('0xc0')],'\x20Queue',_0x5c6b82[_0x6ea0('0x2d')],_0x6ea0('0x77'),_0x5c6b82[_0x6ea0('0x52')]);}if(_0x1e0e2c!==_0x6ea0('0x108')){delete this[_0x6ea0('0x18')][_0x240113[_0x6ea0('0xcf')]];delete this[_0x6ea0('0x18')][_0x240113[_0x6ea0('0x109')]];}}};Preview['prototype'][_0x6ea0('0x10a')]=function(_0x87dc3e,_0x8bd32b,_0x254f53){if(_[_0x6ea0('0x10b')](_0x8bd32b)&&_0x6ea0('0x10c')!==typeof _0x8bd32b){return;}if(_[_0x6ea0('0x10b')](_0x254f53)&&_0x6ea0('0x10c')!==typeof _0x254f53){return;}switch(_0x254f53[_0x6ea0('0x10d')]){case'0':ut[_0x6ea0('0x10e')](_0x87dc3e,0x0,'NoSuchNumber');rpcDb[_0x6ea0('0x10f')](_0x87dc3e,_0x6ea0('0x110'));break;case'3':ut['logAgent'](_0x87dc3e,0x3,'NoAnswer');rpcDb[_0x6ea0('0x10f')](_0x87dc3e,_0x6ea0('0x111'));break;case'5':ut['logAgent'](_0x87dc3e,0x5,_0x6ea0('0xd2'));rpcDb['createAgentHistory'](_0x87dc3e,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x87dc3e,0x8,_0x6ea0('0xe4'));rpcDb[_0x6ea0('0x10f')](_0x87dc3e,_0x6ea0('0x112'));break;case'22':ut[_0x6ea0('0x10e')](_0x87dc3e,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x87dc3e,_0x6ea0('0x113'));break;default:ut['logAgent'](_0x87dc3e,0xc,_0x254f53[_0x6ea0('0x10d')]);rpcDb['createAgentHistory'](_0x87dc3e,'[callProgressDetectingAgent][logCongestion]');}ut[_0x6ea0('0x7f')](_0x8bd32b,'[callProgressDetectingAgent]');logger[_0x6ea0('0x5e')](_0x6ea0('0x114'),_0x87dc3e[_0x6ea0('0xc0')],_0x6ea0('0xc1'),_0x8bd32b[_0x6ea0('0x2d')],_0x6ea0('0x77'),_0x8bd32b['originated']);delete this[_0x6ea0('0x18')][_0x87dc3e['uniqueid']];};Preview[_0x6ea0('0x6a')]['verifyAdditionalPhones']=function(_0x599566,_0x546a14,_0x5a2dc4){return Promise['resolve']()[_0x6ea0('0x89')](cmHopperAdditionalPhone[_0x6ea0('0xaf')](_0x599566,_0x546a14,_0x5a2dc4))['catch'](logger[_0x6ea0('0x5e')](_0x6ea0('0x115')));};Preview[_0x6ea0('0x6a')]['swapAdditionalPhones']=function(_0x312450,_0x4a6f51,_0x1f213a){return Promise[_0x6ea0('0x116')]()[_0x6ea0('0x89')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x312450,_0x4a6f51,_0x1f213a))[_0x6ea0('0x9c')](logger[_0x6ea0('0x5e')](_0x6ea0('0x117')));};Preview[_0x6ea0('0x6a')][_0x6ea0('0xbb')]=function(_0xaa8cbf){return Promise[_0x6ea0('0x116')]()['then'](cmHopperAdditionalPhone[_0x6ea0('0xbb')](_0xaa8cbf))[_0x6ea0('0x9c')](logger['info'](_0x6ea0('0x118')));};Preview[_0x6ea0('0x6a')][_0x6ea0('0x119')]=function(_0x28b3cc,_0xcdd54f,_0x4c8f10,_0x2e9aff,_0x55426f){var _0x2dad4f=this;return new Promise(function(_0x253c4f,_0x168175){if(_[_0x6ea0('0x73')](_0xcdd54f)||_[_0x6ea0('0x73')](_0xcdd54f[_0x6ea0('0x11a')])||_[_0x6ea0('0x73')](_0xcdd54f['phone'])||_['isNil'](_0xcdd54f[_0x6ea0('0x11b')])){_0x168175(ut['message'](_0x6ea0('0x11c'),_0x2e9aff,_0x55426f));return;}var _0x1fa524=uuid['v4']();var _0x10ad63=_0x2dad4f[_0x6ea0('0x15')][_0xcdd54f[_0x6ea0('0x75')][_0x6ea0('0x2d')]];var _0x56e9be=_0x4c8f10?_0x2dad4f[_0x6ea0('0x19')][_0x4c8f10]['id']:undefined;_0x2dad4f['actions'][_0x1fa524]=new Action(_0xcdd54f,_0x10ad63,_0x1fa524,_0x4c8f10,_0x56e9be);var _0x3effe2=_0x2dad4f[_0x6ea0('0x18')][_0x1fa524];_0x3effe2['unlockAgent']=_0x2e9aff;_0x3effe2[_0x6ea0('0xb8')]=_0x55426f;_0x3effe2['lookAgent']=_0x4c8f10;if(_['isEmpty'](_0x28b3cc)){_0x2dad4f['execCall'](_0x3effe2,_0x10ad63,_0xcdd54f,_0x4c8f10)[_0x6ea0('0x89')](function(_0xb33de2){logger[_0x6ea0('0x5e')](_0x6ea0('0x11d'),_0x6ea0('0x11e')+_0x3effe2[_0x6ea0('0x76')]+_0x6ea0('0x11f')+_0x3effe2[_0x6ea0('0xba')],JSON[_0x6ea0('0x5b')](_0xb33de2));ami['emit'](_0x6ea0('0x120'),ut[_0x6ea0('0xac')](_0x3effe2,_0x6ea0('0x121'),_0x2dad4f[_0x6ea0('0x15')][_0x3effe2[_0x6ea0('0x76')]]));_0x253c4f(ut[_0x6ea0('0x65')]('Calling'));})['catch'](function(_0x55fe7a){ut['logger'](_0x6ea0('0x122'),_0x55fe7a);_0x168175(ut['message']('Call\x20failed',_0x2e9aff,_0x55426f));});}else{_0x10ad63[_0x6ea0('0x42')]+=0x1;ut[_0x6ea0('0x123')](_0x3effe2);rpcDb['createHistory'](_0x3effe2,_0x6ea0('0x124'));delete _0x2dad4f[_0x6ea0('0x18')][_0x1fa524];_0x168175(ut[_0x6ea0('0x65')]('Contact\x20in\x20black\x20List',_0x2e9aff,_0x55426f));}});};Preview['prototype']['isTrunkReachable']=function(_0x258962){return!_['isNil'](_0x258962)&&!_['isNil'](_0x258962[_0x6ea0('0x2d')])&&!_['isNil'](_0x258962[_0x6ea0('0x125')])&&_0x258962[_0x6ea0('0x125')]&&!_[_0x6ea0('0x73')](this[_0x6ea0('0x17')][util['format'](_0x6ea0('0x126'),_0x258962[_0x6ea0('0x2d')])])&&!_[_0x6ea0('0x73')](this[_0x6ea0('0x17')][util[_0x6ea0('0x5c')]('SIP/%s',_0x258962[_0x6ea0('0x2d')])][_0x6ea0('0x7c')])&&(this['trunks'][util['format'](_0x6ea0('0x126'),_0x258962[_0x6ea0('0x2d')])]['status']===_0x6ea0('0x127')||this['trunks'][util[_0x6ea0('0x5c')]('SIP/%s',_0x258962[_0x6ea0('0x2d')])]['status']===_0x6ea0('0x128'));};Preview[_0x6ea0('0x6a')][_0x6ea0('0x8e')]=function(_0x5914b3,_0x3b877c){var _0x299686=this;return new Promise(function(_0xf4c3cb,_0x5bae0b){_0x299686['execRun'](_0x5914b3,_0x3b877c)[_0x6ea0('0x89')](function(_0x47f2fc){_0xf4c3cb(_[_0x6ea0('0x78')](_0x47f2fc,['message']));})[_0x6ea0('0x9c')](function(_0x3f16ab){if(_0x3f16ab[_0x6ea0('0x129')]){rpcDb[_0x6ea0('0x12a')](_0x5914b3);}if(_0x3f16ab[_0x6ea0('0x125')]){rpcDb[_0x6ea0('0x91')](_0x5914b3);}_0x5bae0b(_['pick'](_0x3f16ab,[_0x6ea0('0x65')]));});});};Preview[_0x6ea0('0x6a')]['execRun']=function(_0x2ad8a6,_0x472183){var _0x17c7c4=this;return new Promise(function(_0x370dd7,_0x336c72){var _0x45f401,_0x25585f;rpcDb[_0x6ea0('0x12b')](_0x2ad8a6)['then'](function(_0x3f7e67){if(!_[_0x6ea0('0x73')](_0x3f7e67[0x0])){_0x25585f=_0x3f7e67[0x0][_0x6ea0('0x12c')]?![]:!![];_0x45f401=_0x3f7e67[0x0]['recallme']?!![]:![];_0x45f401=_0x472183?!![]:_0x45f401;}var _0x107936=_0x17c7c4[_0x6ea0('0x12d')](_0x3f7e67);if(_0x107936[_0x6ea0('0x12e')]){rpcDb[_0x6ea0('0x12f')](_[_0x6ea0('0x78')](_0x3f7e67[0x0],[_0x6ea0('0x11b'),'phone']))[_0x6ea0('0x89')](function(_0x4b6119){_0x17c7c4[_0x6ea0('0x119')](_0x4b6119,_0x3f7e67[0x0],_0x472183,_0x25585f,_0x45f401)['then'](function(_0x48cbd2){_0x370dd7(_0x48cbd2);})[_0x6ea0('0x9c')](function(_0x1c84e2){_0x336c72(_0x1c84e2);});})[_0x6ea0('0x9c')](function(_0x282d15){ut[_0x6ea0('0x68')](_0x6ea0('0x130'),_0x282d15);_0x336c72(ut[_0x6ea0('0x65')](_0x6ea0('0x131'),_0x25585f,_0x45f401));});}else{_0x336c72(ut[_0x6ea0('0x65')](_0x107936[_0x6ea0('0x65')],_0x25585f,_0x45f401));}})[_0x6ea0('0x9c')](function(_0x251c6c){ut[_0x6ea0('0x68')]('[Preview][getContactPreview]',_0x251c6c);_0x336c72(ut[_0x6ea0('0x65')](_0x6ea0('0x131'),![],!![]));});});};Preview[_0x6ea0('0x6a')][_0x6ea0('0x12d')]=function(_0x7be373){if(_[_0x6ea0('0x73')](_0x7be373)||_[_0x6ea0('0x132')](_0x7be373)||!_[_0x6ea0('0x73')](_0x7be373[0x0]['Agent'])&&_[_0x6ea0('0x73')](_0x7be373[0x0][_0x6ea0('0x8c')][_0x6ea0('0x2d')])){ut['logger'](_0x6ea0('0x133'),_0x7be373);return{'isValid':![],'message':_0x6ea0('0x134')};}var _0x31fa0e=this[_0x6ea0('0x15')][_0x7be373[0x0][_0x6ea0('0x75')]['name']];_0x31fa0e[_0x6ea0('0x65')]='ACTIVE';if(_[_0x6ea0('0x73')](_0x31fa0e)){ut[_0x6ea0('0x68')]('[Preview][validateContact][Empty\x20Campaign]',_0x31fa0e);return{'isValid':![],'message':_0x6ea0('0x135')};}if(!this[_0x6ea0('0xa2')](_0x31fa0e[_0x6ea0('0x58')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x6ea0('0x136')+_0x31fa0e[_0x6ea0('0x2d')]+_0x6ea0('0x137'));if(!this[_0x6ea0('0xa2')](_0x31fa0e[_0x6ea0('0x138')])){ut[_0x6ea0('0x68')](_0x6ea0('0x139'),_0x31fa0e[_0x6ea0('0x2d')]+_0x6ea0('0x13a'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x6ea0('0xa0')](_0x31fa0e[_0x6ea0('0x3b')])){ut[_0x6ea0('0x68')](_0x6ea0('0x13b'),_0x31fa0e[_0x6ea0('0x2d')]+_0x6ea0('0x13c'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x31fa0e[_0x6ea0('0x2d')]+_0x6ea0('0x13c')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x6ea0('0x13d')]=function(_0x37c9f7,_0x3cd87b,_0x58c9ed,_0x5c8180){var _0x2013d0=this;return new Promise(function(_0x2585bb,_0x3a9397){var _0xd6efeb=_0x37c9f7[_0x6ea0('0xc0')];var _0x114c5c=_0x2013d0[_0x6ea0('0xa2')](_0x3cd87b[_0x6ea0('0x58')])?util[_0x6ea0('0x5c')](_0x6ea0('0x13e'),_0x3cd87b['Trunk'][_0x6ea0('0x2d')],_['isNil'](_0x3cd87b['dialPrefix'])?'':_0x3cd87b[_0x6ea0('0x13f')][_0x6ea0('0x140')]()||'',_0x3cd87b['dialCutDigit']>0x0?_0x58c9ed[_0x6ea0('0x141')]['substring'](_0x3cd87b[_0x6ea0('0x142')]):_0x58c9ed[_0x6ea0('0x141')]):util['format'](_0x6ea0('0x13e'),_['isNil'](_0x3cd87b[_0x6ea0('0x138')])?_0x3cd87b[_0x6ea0('0x58')][_0x6ea0('0x2d')]:_0x3cd87b[_0x6ea0('0x138')][_0x6ea0('0x2d')],_[_0x6ea0('0x73')](_0x3cd87b[_0x6ea0('0x13f')])?'':_0x3cd87b[_0x6ea0('0x13f')]['trim']()||'',_0x3cd87b[_0x6ea0('0x142')]>0x0?_0x58c9ed[_0x6ea0('0x141')][_0x6ea0('0x143')](_0x3cd87b[_0x6ea0('0x142')]):_0x58c9ed[_0x6ea0('0x141')]);var _0x500447=_0x2013d0[_0x6ea0('0xa2')](_0x3cd87b[_0x6ea0('0x58')])?ut[_0x6ea0('0x144')](_0x3cd87b[_0x6ea0('0x58')][_0x6ea0('0x59')],_0x3cd87b[_0x6ea0('0x3d')],_0x3cd87b[_0x6ea0('0x145')]>0x0?ut[_0x6ea0('0x146')](_0x3cd87b[_0x6ea0('0x3e')],_0x3cd87b['dialRandomLastDigitCallerIdNumber']):_0x3cd87b[_0x6ea0('0x3e')]):ut[_0x6ea0('0x144')](_[_0x6ea0('0x73')](_0x3cd87b[_0x6ea0('0x138')])?_0x3cd87b['Trunk'][_0x6ea0('0x59')]:_0x3cd87b[_0x6ea0('0x138')][_0x6ea0('0x59')],_0x3cd87b['dialOriginateCallerIdName'],_0x3cd87b['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x6ea0('0x146')](_0x3cd87b[_0x6ea0('0x3e')],_0x3cd87b[_0x6ea0('0x145')]):_0x3cd87b['dialOriginateCallerIdNumber']);if(_0x500447){_0x37c9f7[_0x6ea0('0x147')]=ut['extractCalleridName'](_0x500447);_0x37c9f7[_0x6ea0('0x148')]=ut[_0x6ea0('0x149')](_0x500447);}var _0x4e3186=ut[_0x6ea0('0x14a')](_0x3cd87b,_0x58c9ed,_0x114c5c,_0x500447,_0xd6efeb,_0x37c9f7);_[_0x6ea0('0x14b')](_0x37c9f7,ut['toLowerVariables'](_0x4e3186));_0x37c9f7[_0x6ea0('0x92')]=moment()['format'](_0x6ea0('0x93'));_0x3cd87b['variables']=_0x4e3186;ami['Action'](ut['variablesAction'](_0x37c9f7,_0x3cd87b,_0x4e3186,_0x37c9f7['activeContact'],_0x5c8180))[_0x6ea0('0x89')](function(_0x3e5119){_0x3cd87b['originated']+=0x1;logger[_0x6ea0('0x5e')](_0x6ea0('0x14c'),_0xd6efeb,_0x6ea0('0xc1'),_0x3cd87b[_0x6ea0('0x2d')],_0x6ea0('0x77'),_0x3cd87b[_0x6ea0('0x52')]);_0x2585bb(_0x3e5119);})['catch'](function(_0x19c4c0){ut[_0x6ea0('0x10e')](_0x37c9f7,0xe,_0x6ea0('0x14d'));rpcDb[_0x6ea0('0x10f')](_0x37c9f7,_0x6ea0('0x14e'));_0x3a9397(_0x19c4c0);});});};Preview[_0x6ea0('0x6a')][_0x6ea0('0x23')]=function(_0x157392){if(this[_0x6ea0('0x18')][_0x157392[_0x6ea0('0xcf')]]){this['actions'][_0x157392['linkedid']][_0x6ea0('0x7d')]=_0x157392['channel'];}};Preview['prototype'][_0x6ea0('0x1b')]=function(_0x3c6092){var _0x20cbc7=this;var _0x387446=this[_0x6ea0('0x18')][_0x3c6092[_0x6ea0('0x14f')]];if(_0x387446){if(_0x387446[_0x6ea0('0x150')]&&this[_0x6ea0('0x19')][_0x387446[_0x6ea0('0x150')]]){ut[_0x6ea0('0x151')](_0x387446,this[_0x6ea0('0x19')][_0x387446['lookAgent']][_0x6ea0('0x2d')],this[_0x6ea0('0x19')][_0x387446['lookAgent']]['id']);}var _0x363508=_[_0x6ea0('0x152')](_0x387446);_0x363508[_0x6ea0('0xbd')]=moment()['format'](_0x6ea0('0x93'));var _0x3f3c6b=_0x20cbc7[_0x6ea0('0x15')][_0x387446[_0x6ea0('0x76')]];if(ut[_0x6ea0('0x153')](_0x3c6092['response'])){if(_0x387446[_0x6ea0('0xb7')]){rpcDb['unlockContact'](_0x387446[_0x6ea0('0xba')]);}if(_0x387446[_0x6ea0('0xb8')]){rpcDb[_0x6ea0('0x91')](_0x387446['idContact']);}ami['emit'](_0x6ea0('0x154'),ut[_0x6ea0('0xac')](_0x387446,_0x6ea0('0x155'),this[_0x6ea0('0x15')][_0x387446[_0x6ea0('0x76')]]));this[_0x6ea0('0x10a')](_0x363508,_0x3f3c6b,_0x3c6092);}else{_0x387446['starttime']=moment()['format'](_0x6ea0('0x93'));ut[_0x6ea0('0x10e')](_0x363508,0x4,_0x6ea0('0xca'));rpcDb[_0x6ea0('0x10f')](_0x363508,_0x6ea0('0x156'));}}};Preview[_0x6ea0('0x6a')]['syncHangup']=function(_0x1b5bb7){var _0x34531b=this[_0x6ea0('0x18')][_0x1b5bb7[_0x6ea0('0xcf')]];var _0x382c89;if(_0x34531b){_0x382c89=this[_0x6ea0('0x15')][_0x34531b['queue']];logger[_0x6ea0('0x5e')]('[syncHangup][talking]',_0x1b5bb7[_0x6ea0('0xcf')],_0x6ea0('0xc1'),_0x382c89[_0x6ea0('0x2d')],_0x6ea0('0xc2'),_0x382c89[_0x6ea0('0x32')]);}if(this['actions'][_0x1b5bb7[_0x6ea0('0xcf')]]&&_0x1b5bb7[_0x6ea0('0xcf')]!==_0x1b5bb7[_0x6ea0('0xc0')]){if(_0x1b5bb7['cause']==='16'&&this[_0x6ea0('0x18')][_0x1b5bb7['linkedid']][_0x6ea0('0x81')]){this[_0x6ea0('0xa5')](_0x1b5bb7,_0x1b5bb7['linkedid'],_0x1b5bb7[_0x6ea0('0x157')]);}else if(this[_0x6ea0('0x18')][_0x1b5bb7['linkedid']][_0x6ea0('0x81')]){logger[_0x6ea0('0x5e')]('[syncHangup][talking][cause]',_0x1b5bb7[_0x6ea0('0xcf')],_0x1b5bb7[_0x6ea0('0x157')],'\x20Queue',_0x382c89['name'],_0x6ea0('0xc2'),_0x382c89['pTalking']);this['callProgressDetectingCustomer'](_0x1b5bb7,_0x1b5bb7[_0x6ea0('0xcf')],_0x1b5bb7[_0x6ea0('0x157')]);}}else if(_0x34531b&&_[_0x6ea0('0x73')](_0x34531b[_0x6ea0('0x158')])&&_0x382c89[_0x6ea0('0x159')]&&_0x1b5bb7['linkedid']===_0x1b5bb7['uniqueid']&&_['isNil'](_0x1b5bb7[_0x6ea0('0x10d')])&&_0x1b5bb7[_0x6ea0('0x157')]==='16'&&_0x1b5bb7['channelstate']==='6'&&_[_0x6ea0('0x10b')](_0x34531b[_0x6ea0('0x15a')])){if(_0x34531b[_0x6ea0('0xb7')]){rpcDb[_0x6ea0('0x12a')](_0x34531b[_0x6ea0('0xba')]);}if(_0x34531b[_0x6ea0('0xb8')]){rpcDb[_0x6ea0('0x91')](_0x34531b['idContact']);}_0x1b5bb7[_0x6ea0('0x10d')]='22';this[_0x6ea0('0x10a')](_0x34531b,_0x382c89,_0x1b5bb7);}else if(_0x34531b&&_0x34531b[_0x6ea0('0x15a')]){if(_0x1b5bb7[_0x6ea0('0x157')]==='16'&&this['actions'][_0x1b5bb7[_0x6ea0('0xcf')]]['dialAnswer']){logger[_0x6ea0('0x5e')](_0x6ea0('0x15b'),_0x1b5bb7[_0x6ea0('0xcf')],_0x1b5bb7[_0x6ea0('0x157')],'\x20Queue',_0x382c89['name'],_0x6ea0('0xc2'),_0x382c89[_0x6ea0('0x32')]);this[_0x6ea0('0xa5')](_0x1b5bb7,_0x1b5bb7[_0x6ea0('0xcf')],_0x1b5bb7[_0x6ea0('0x157')]);}else if(this['actions'][_0x1b5bb7[_0x6ea0('0xcf')]][_0x6ea0('0x81')]){logger[_0x6ea0('0x5e')]('[syncHangup][talking][cause]',_0x1b5bb7['linkedid'],_0x1b5bb7[_0x6ea0('0x157')],_0x6ea0('0xc1'),_0x382c89[_0x6ea0('0x2d')],_0x6ea0('0xc2'),_0x382c89['pTalking']);this[_0x6ea0('0xa5')](_0x1b5bb7,_0x1b5bb7[_0x6ea0('0xcf')],_0x1b5bb7[_0x6ea0('0x157')]);}}};Preview[_0x6ea0('0x6a')][_0x6ea0('0x21')]=function(_0x328104){if(this['actions'][_0x328104['destlinkedid']]&&_0x328104[_0x6ea0('0x109')]!==_0x328104[_0x6ea0('0x15c')]){this[_0x6ea0('0xa5')](_0x328104,_0x328104[_0x6ea0('0x109')],_0x328104[_0x6ea0('0x100')]);}};Preview[_0x6ea0('0x6a')]['syncHangupRequest']=function(_0x5bc0fb){if(this['actions'][_0x5bc0fb[_0x6ea0('0xcf')]]&&_0x5bc0fb[_0x6ea0('0xcf')]!==_0x5bc0fb['uniqueid']&&!this[_0x6ea0('0x18')][_0x5bc0fb[_0x6ea0('0xcf')]]['dialAnswer']){if(_0x5bc0fb['cause']==='1'){this[_0x6ea0('0xa5')](_0x5bc0fb,_0x5bc0fb[_0x6ea0('0xcf')],_0x5bc0fb[_0x6ea0('0x157')]);}}};Preview[_0x6ea0('0x6a')][_0x6ea0('0x15d')]=function(_0x306e22,_0x305caa,_0xa75434){if(this[_0x6ea0('0x18')][_0x306e22]){if(_[_0x6ea0('0x73')](this['actions'][_0x306e22][_0x6ea0('0x15e')])){this['actions'][_0x306e22][_0x6ea0('0x15e')]={};}this[_0x6ea0('0x18')][_0x306e22][_0x6ea0('0x15e')][_0x305caa]=_0xa75434;}};Preview[_0x6ea0('0x6a')][_0x6ea0('0x25')]=function(_0x2b45d2){try{if(!_[_0x6ea0('0x73')](_0x2b45d2)){if(ut[_0x6ea0('0x15f')](_['keys'](_0x2b45d2[_0x6ea0('0x160')])[0x0])){this[_0x6ea0('0x15d')](_0x2b45d2[_0x6ea0('0xc0')],_[_0x6ea0('0x161')](_0x2b45d2[_0x6ea0('0x160')])[0x0],_0x2b45d2[_0x6ea0('0x162')]);}}}catch(_0x3a4459){logger[_0x6ea0('0x163')](_0x6ea0('0x164'),util[_0x6ea0('0x165')](_0x3a4459,{'showHidden':![],'depth':null}));}};Preview[_0x6ea0('0x6a')]['syncAttendedTransfer']=function(_0x4941b0){if(_0x4941b0){if(this[_0x6ea0('0x18')][_0x4941b0[_0x6ea0('0x166')]]){this[_0x6ea0('0x18')][_0x4941b0[_0x6ea0('0x166')]][_0x6ea0('0x15a')]=!![];}}};Preview[_0x6ea0('0x6a')][_0x6ea0('0x29')]=function(_0x441f5a){if(_0x441f5a){if(this[_0x6ea0('0x18')][_0x441f5a[_0x6ea0('0x167')]]){this[_0x6ea0('0x18')][_0x441f5a[_0x6ea0('0x167')]][_0x6ea0('0x15a')]=!![];}}};module[_0x6ea0('0x168')]=Preview; \ No newline at end of file +var _0x360d=['countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','reason','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','unlock','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','[originateFailure][logOriginateFailure]','actionid','clone','responsetime','isFailure','custom:agentringnoanswer','rejected','Answer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','info','stringify','voice_queue_presence:remove','pTalking','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','agentReadyId','then','isNil','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','nosuchnumber','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','buildObj','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL'];(function(_0x17b0d4,_0x377add){var _0x2d02c7=function(_0x56e627){while(--_0x56e627){_0x17b0d4['push'](_0x17b0d4['shift']());}};_0x2d02c7(++_0x377add);}(_0x360d,0x7c));var _0xd360=function(_0x5b5c66,_0x232916){_0x5b5c66=_0x5b5c66-0x0;var _0x19c519=_0x360d[_0x5b5c66];return _0x19c519;};'use strict';var util=require(_0xd360('0x0'));var _=require('lodash');var uuid=require(_0xd360('0x1'));var moment=require('moment');var md5=require(_0xd360('0x2'));var Redis=require(_0xd360('0x3'));var config=require(_0xd360('0x4'));var logger=require(_0xd360('0x5'))(_0xd360('0x6'));var loggerAction=require('../../../config/logger')(_0xd360('0x7'));var ami=require(_0xd360('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xd360('0x9'));var ut=require(_0xd360('0xa'));config[_0xd360('0xb')]=_[_0xd360('0xc')](config[_0xd360('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xd360('0xd'))(new Redis(config[_0xd360('0xb')]));var Sequence=function(){};Sequence[_0xd360('0xe')][_0xd360('0xf')]=function(_0x36f8ff){this[_0xd360('0x10')]=this[_0xd360('0x10')]?this[_0xd360('0x10')][_0xd360('0x11')](_0x36f8ff):_0x36f8ff();};function Preview(_0x1ceb32){this[_0xd360('0x12')]=new Sequence();this[_0xd360('0x13')]=_0x1ceb32[_0xd360('0x14')];this[_0xd360('0x15')]=_0x1ceb32[_0xd360('0x15')];this[_0xd360('0x16')]={};this[_0xd360('0x17')]=_0x1ceb32[_0xd360('0x17')];this[_0xd360('0x18')]=0x0;ami['on'](_0xd360('0x19'),this[_0xd360('0x1a')][_0xd360('0x1b')](this));ami['on'](_0xd360('0x1c'),this[_0xd360('0x1d')][_0xd360('0x1b')](this));ami['on']('hanguprequest',this[_0xd360('0x1e')][_0xd360('0x1b')](this));ami['on'](_0xd360('0x1f'),this[_0xd360('0x20')][_0xd360('0x1b')](this));ami['on']('newexten',this[_0xd360('0x21')]['bind'](this));ami['on']('varset',this[_0xd360('0x22')][_0xd360('0x1b')](this));ami['on'](_0xd360('0x23'),this['syncAttendedTransfer'][_0xd360('0x1b')](this));ami['on'](_0xd360('0x24'),this[_0xd360('0x25')][_0xd360('0x1b')](this));this[_0xd360('0x26')](this[_0xd360('0x13')]);}function emit(_0x357521,_0x54f489,_0x2101dd){io['to'](_0x357521)[_0xd360('0x27')](_0x54f489,_0x2101dd);}function emitCampaignPreview(_0xe68422){if(_0xe68422['type']===_0xd360('0x28')){var _0x5a2257={'id':_0xe68422['id'],'name':_0xe68422[_0xd360('0x29')],'strategy':_0xe68422[_0xd360('0x2a')],'answered':_0xe68422['answered'],'available':_0xe68422[_0xd360('0x2b')],'loggedIn':_0xe68422[_0xd360('0x2c')],'pTalking':_0xe68422['pTalking'],'sumBillable':_0xe68422[_0xd360('0x2d')],'sumDuration':_0xe68422[_0xd360('0x2e')],'sumHoldTime':_0xe68422[_0xd360('0x2f')]||0x0,'talking':_0xe68422[_0xd360('0x30')],'total':_0xe68422[_0xd360('0x31')],'type':_0xe68422[_0xd360('0x32')],'unmanaged':_0xe68422[_0xd360('0x33')],'abandoned':_0xe68422[_0xd360('0x34')],'waiting':_0xe68422[_0xd360('0x35')],'loggedInDb':_0xe68422[_0xd360('0x36')],'dialActive':_0xe68422[_0xd360('0x37')],'dialMethod':_0xe68422[_0xd360('0x38')],'dialOriginateCallerIdName':_0xe68422[_0xd360('0x39')],'dialOriginateCallerIdNumber':_0xe68422[_0xd360('0x3a')],'dialOriginateTimeout':_0xe68422[_0xd360('0x3b')],'dialPrefix':_0xe68422['dialPrefix'],'outboundAnswerAgiCallsDay':_0xe68422[_0xd360('0x3c')],'outboundAnswerCallsDay':_0xe68422[_0xd360('0x3d')],'outboundBlacklistCallsDay':_0xe68422[_0xd360('0x3e')],'outboundBusyCallsDay':_0xe68422[_0xd360('0x3f')],'outboundCongestionCallsDay':_0xe68422[_0xd360('0x40')],'outboundDropCallsDayACS':_0xe68422[_0xd360('0x41')],'outboundDropCallsDayCallersExit':_0xe68422[_0xd360('0x42')],'outboundDropCallsDayTimeout':_0xe68422[_0xd360('0x43')],'outboundNoAnswerCallsDay':_0xe68422['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xe68422['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xe68422['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xe68422[_0xd360('0x44')],'outboundRejectCallsDay':_0xe68422[_0xd360('0x45')],'outboundUnknownCallsDay':_0xe68422['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0xe68422[_0xd360('0x46')],'predictiveIntervalAnsweredCalls':_0xe68422['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xe68422[_0xd360('0x47')],'predictiveIntervalAvgTalktime':_0xe68422['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xe68422[_0xd360('0x48')],'predictiveIntervalDroppedCallsTimeout':_0xe68422['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xe68422[_0xd360('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0xe68422['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xe68422[_0xd360('0x4a')],'predictiveIntervalMultiplicativeFactor':_0xe68422['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xe68422[_0xd360('0x4b')],'predictiveIntervalAvailable':_0xe68422[_0xd360('0x4c')],'predictiveIntervalTotalCalls':_0xe68422[_0xd360('0x4d')],'message':_0xe68422[_0xd360('0x4e')],'originated':_0xe68422[_0xd360('0x4f')],'erlangCalls':_0xe68422[_0xd360('0x50')],'erlangCallToSecond':_0xe68422[_0xd360('0x51')],'erlangAbandonmentRate':_0xe68422[_0xd360('0x52')],'erlangBusyFactor':_0xe68422[_0xd360('0x53')],'startPredictive':_0xe68422[_0xd360('0x54')],'startProgressive':_0xe68422[_0xd360('0x55')]};if(_0xe68422[_0xd360('0x56')]){_0x5a2257[_0xd360('0x56')]={'id':_0xe68422[_0xd360('0x56')]['id'],'name':_0xe68422[_0xd360('0x56')][_0xd360('0x29')],'active':_0xe68422[_0xd360('0x56')][_0xd360('0x57')],'callerid':_0xe68422[_0xd360('0x56')][_0xd360('0x58')]};}if(_0xe68422[_0xd360('0x59')]){_0x5a2257[_0xd360('0x59')]={'id':_0xe68422[_0xd360('0x59')]['id'],'name':_0xe68422['Interval'][_0xd360('0x29')]};}var _0x29abec=md5(JSON['stringify'](_0x5a2257));if(_0xe68422[_0xd360('0x2')]!==_0x29abec){_0xe68422['md5']=_0x29abec;emit(util[_0xd360('0x5a')](_0xd360('0x5b'),_0x5a2257[_0xd360('0x29')]),'voice_queue:save',_0x5a2257);}}}function emitVoiceQueueChannelRemove(_0x163840){logger[_0xd360('0x5c')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd360('0x5d')](_0x163840));emit(util['format'](_0xd360('0x5b'),_0x163840[_0xd360('0x29')]),'voice_queue_channel:remove',_0x163840);io[_0xd360('0x27')](_0xd360('0x5e'),_0x163840);}function notSendMessagesQueue(_0x812406){if(_0x812406['sendMessageOneNotActive']){if(_0x812406['originated']===0x0&&_0x812406[_0xd360('0x5f')]===0x0){_0x812406[_0xd360('0x60')]=![];_0x812406[_0xd360('0x2b')]=0x0;_0x812406[_0xd360('0x61')]=0x0;_0x812406['message']=_0xd360('0x62');ut[_0xd360('0x63')](_0xd360('0x64'),_0x812406[_0xd360('0x29')]+_0xd360('0x65'));}else{_0x812406[_0xd360('0x4e')]=_0xd360('0x66');ut[_0xd360('0x63')](_0xd360('0x64'),_0x812406['name']+_0xd360('0x67'));}emitCampaignPreview(_0x812406);}}Preview[_0xd360('0xe')][_0xd360('0x26')]=function(){var _0x3ffca2=this;setInterval(function(){_0x3ffca2[_0xd360('0x68')]();},0x7cf);};Preview['prototype'][_0xd360('0x68')]=function(){var _0x1d3c58=this[_0xd360('0x13')];this[_0xd360('0x18')]+=0x1;for(var _0x59f905 in _0x1d3c58){if(_0x1d3c58['hasOwnProperty'](_0x59f905)&&(_0x1d3c58[_0x59f905][_0xd360('0x38')]===_0xd360('0x6')||_0x1d3c58[_0x59f905][_0xd360('0x38')]==='booked')&&_0x1d3c58[_0x59f905]['type']===_0xd360('0x28')){if(this['clockClearZombieChannels']>0x7){this[_0xd360('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x1d3c58[_0xd360('0x69')](_0x59f905)&&_0x1d3c58[_0x59f905][_0xd360('0x38')]===_0xd360('0x6')&&_0x1d3c58[_0x59f905][_0xd360('0x32')]==='outbound'){if(_0x1d3c58[_0x59f905][_0xd360('0x37')]){this['setMessage'](_0x1d3c58[_0x59f905]);if(_0x1d3c58[_0x59f905][_0xd360('0x6a')])this[_0xd360('0x6b')](_0x1d3c58[_0x59f905]);}else{notSendMessagesQueue(_0x1d3c58[_0x59f905]);}}}};Preview[_0xd360('0xe')][_0xd360('0x6c')]=function(_0xffb42c){var _0x3ab80a=this;this[_0xd360('0x12')][_0xd360('0xf')](function(){if(!_['isNil'](_0x3ab80a[_0xd360('0x16')][_0xffb42c])){loggerAction[_0xd360('0x5c')](_0xd360('0x6d'),_0xffb42c,_0xd360('0x6e'),_0x3ab80a[_0xd360('0x16')][_0xffb42c][_0xd360('0x6f')],'originated:\x20',JSON['stringify'](_0x3ab80a[_0xd360('0x13')][_0x3ab80a[_0xd360('0x16')][_0xffb42c]['queue']][_0xd360('0x4f')]),_0xd360('0x70'),JSON['stringify'](_0x3ab80a['campaignsPreview'][_0x3ab80a[_0xd360('0x16')][_0xffb42c]['queue']]['pTalking']),JSON['stringify'](_0x3ab80a['actions'][_0xffb42c][_0xd360('0x71')]),JSON[_0xd360('0x5d')](_[_0xd360('0x72')](_0x3ab80a[_0xd360('0x16')][_0xffb42c],[_0xd360('0x73'),_0xd360('0x74'),_0xd360('0x75'),'ListId'])));return ami[_0xd360('0x76')]({'action':'status','channel':_0x3ab80a[_0xd360('0x16')][_0xffb42c][_0xd360('0x77')]})[_0xd360('0x78')](function(_0x5d189b){if(_0x5d189b[_0xd360('0x4e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3ab80a['actions'][_0xffb42c]){ut[_0xd360('0x79')](_0x3ab80a[_0xd360('0x13')][_0x3ab80a[_0xd360('0x16')][_0xffb42c]['queue']],_0xd360('0x7a'));if(_0x3ab80a[_0xd360('0x16')][_0xffb42c][_0xd360('0x71')]===!![]){ut[_0xd360('0x7b')](_0x3ab80a[_0xd360('0x13')][_0x3ab80a[_0xd360('0x16')][_0xffb42c][_0xd360('0x6f')]],_0xd360('0x7a'));ut['loggerError'](_0xd360('0x7c')+_0xffb42c,_0x3ab80a[_0xd360('0x16')][_0xffb42c][_0xd360('0x6f')]);}ut[_0xd360('0x7d')](_0xd360('0x7e')+_0xffb42c,_0x3ab80a[_0xd360('0x16')][_0xffb42c][_0xd360('0x6f')]);delete _0x3ab80a[_0xd360('0x16')][_0xffb42c];}},0x2328);}});}});};Preview[_0xd360('0xe')][_0xd360('0x7f')]=function(){var _0x55253a=this;loggerAction[_0xd360('0x5c')]('[action]',_['size'](this['actions']));for(var _0x4cc794 in this[_0xd360('0x16')]){if(_0x55253a[_0xd360('0x16')][_0xd360('0x69')](_0x4cc794)){_0x55253a['clearZombieChannel'](_0x4cc794);}}};Preview[_0xd360('0xe')][_0xd360('0x6b')]=function(_0x3835dd){var _0x3084b5=this;rpcDb['getContactRecallMe'](_0x3835dd['id'],ut[_0xd360('0x80')](this['agents']))[_0xd360('0x81')](function(_0x26c65c){if(!_[_0xd360('0x82')](_0x26c65c)){for(var _0x3ae19e=0x0;_0x3ae19e<_0x26c65c[_0xd360('0x83')];_0x3ae19e+=0x1){if(ut[_0xd360('0x84')](_0x26c65c[_0x3ae19e][_0xd360('0x85')])<_0x3835dd['dialRecallMeTimeout']*0x3c){if(_0x26c65c[_0x3ae19e][_0xd360('0x86')]&&!_0x26c65c[_0x3ae19e][_0xd360('0x86')][_0xd360('0x87')]){_0x3084b5[_0xd360('0x88')](_0x26c65c[_0x3ae19e]['id'])[_0xd360('0x81')](ut[_0xd360('0x89')](_0xd360('0x8a')))[_0xd360('0x78')](ut['logger2']('[RecallMe]'));}else{rpcDb['disableContact'](_0x26c65c[_0x3ae19e]['id']);}}else{var _0x38338a=new Action(_0x26c65c[_0x3ae19e],_0x3835dd);_0x38338a[_0xd360('0x8b')]=moment()['format'](_0xd360('0x8c'));_0x3835dd[_0xd360('0x44')]+=0x1;ut[_0xd360('0x8d')](_0x38338a,0x17,_0xd360('0x8e'));if(_0x3835dd[_0xd360('0x8f')]){rpcDb[_0xd360('0x90')](ut['createBody'](_0x26c65c[_0x3ae19e]));rpcDb['createCustomerHistory'](_0x38338a,_0xd360('0x91'));}else{ut[_0xd360('0x8d')](_0x38338a,0x16,_0xd360('0x92'));rpcDb['createCustomerHistory'](_0x38338a,_0xd360('0x93'));rpcDb[_0xd360('0x94')](_0x38338a,'[HistoryRecallClose]');}}}}})['catch'](ut['logger2'](_0xd360('0x95')));};Preview[_0xd360('0xe')][_0xd360('0x96')]=function(_0x2ac021){_0x2ac021[_0xd360('0x60')]=!![];if(ut[_0xd360('0x97')](_0x2ac021[_0xd360('0x2c')])){_0x2ac021[_0xd360('0x4e')]=_0xd360('0x98');}else if(!ut[_0xd360('0x99')](_0x2ac021[_0xd360('0x37')])){_0x2ac021[_0xd360('0x4e')]=_0xd360('0x62');}else if(!this[_0xd360('0x9a')](_0x2ac021[_0xd360('0x56')])){if(!this[_0xd360('0x9a')](_0x2ac021[_0xd360('0x9b')])){_0x2ac021[_0xd360('0x4e')]=_0xd360('0x9c');}else{_0x2ac021[_0xd360('0x4e')]=_0xd360('0x9d');}}else{_0x2ac021['message']='ACTIVE';}emitCampaignPreview(_0x2ac021);};Preview['prototype'][_0xd360('0x9e')]=function(_0xc163bf,_0x255009,_0x122f9e){var _0xbc5cad=this;var _0x55cfe4=this[_0xd360('0x16')][_0x255009];var _0x17508c=this[_0xd360('0x13')][_0x55cfe4[_0xd360('0x6f')]];var _0x2c01a8;var _0x50f415=![];var _0x476c88=0x2;var _0x28b2bb=0x3;if(_0x17508c){switch(_0x122f9e){case'1':_0x17508c[_0xd360('0x9f')]+=0x1;_0x55cfe4['countnosuchnumberretry']+=0x1;_0x55cfe4[_0xd360('0xa0')]=ut['totalGlobal'](_0x55cfe4);ut[_0xd360('0x8d')](_0x55cfe4,0x0,'NoSuchNumber');ami[_0xd360('0x27')]('custom:agentnosuchnumber',ut['buildObj'](_0x55cfe4,_0xd360('0xa1')));rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xa3'));_0xbc5cad[_0xd360('0xa4')](_0x55cfe4,'0',_0x17508c)[_0xd360('0x81')](function(_0x37af88){_0x50f415=_0x37af88[_0xd360('0xa5')]==0x1;_0x476c88=_0x17508c[_0xd360('0xa6')];_0x28b2bb=_0x17508c[_0xd360('0xa7')];if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c[_0xd360('0xa9')]){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0xf,_0xd360('0xab'));rpcDb[_0xd360('0x94')](_0x2c01a8,_0xd360('0xac'));}else{if(_0x55cfe4[_0xd360('0xad')]>=_0x17508c[_0xd360('0xae')]){rpcDb['createCustomerFinal'](_0x55cfe4,_0xd360('0xac'));}else{rpcDb[_0xd360('0xaf')](ut[_0xd360('0xb0')](_0x55cfe4,_0xd360('0xad'),_0x17508c[_0xd360('0xa6')]),_0x55cfe4[_0xd360('0xb1')],_0x55cfe4['activeContact']);}}delete this['actions'][_0xc163bf[_0xd360('0xb2')]];}else{_0x55cfe4[_0xd360('0xad')]++;logger['info']('actioncountonusuch',_0x55cfe4[_0xd360('0xad')]);logger[_0xd360('0x5c')]('id',_0x55cfe4[_0xd360('0xb3')]);_0xbc5cad[_0xd360('0xb4')]({'id':_0x55cfe4['idContact'],'field':{'countnosuchnumberretry':_0x55cfe4[_0xd360('0xad')]}})[_0xd360('0x81')](function(){_0xbc5cad[_0xd360('0xb5')](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});});}});break;case _0xd360('0xb6'):var _0x30cfc7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x55cfe4['responsetime']=_0x30cfc7;_0x55cfe4[_0xd360('0xb7')]=_0x30cfc7;_0x55cfe4[_0xd360('0x71')]=!![];_0x17508c[_0xd360('0x5f')]+=0x1;logger['info'](_0xd360('0xb8'),_0x55cfe4[_0xd360('0xb9')],'\x20Queue',_0x17508c[_0xd360('0x29')],_0xd360('0x70'),_0x17508c[_0xd360('0x5f')]);ami[_0xd360('0x27')]('custom:agentconnect',ut[_0xd360('0xba')](_0x55cfe4,_0xd360('0xbb'),this[_0xd360('0x13')][_0x55cfe4['queue']]));if(_0x17508c[_0xd360('0xbc')]){ami[_0xd360('0x27')](_0xd360('0xbd'),ut['buildAcw'](_0x55cfe4));}break;case'16':ami[_0xd360('0x27')](_0xd360('0xbe'),ut[_0xd360('0xba')](_0x55cfe4,_0xd360('0xbf'),this[_0xd360('0x13')][_0x55cfe4[_0xd360('0x6f')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x55cfe4,_0xd360('0xbf')));_0x17508c['outboundAnswerCallsDay']+=0x1;_0x17508c[_0xd360('0x31')]+=0x1;_0x17508c[_0xd360('0xc0')]+=0x1;ut[_0xd360('0x7b')](_0x17508c,'[16]');_0x55cfe4[_0xd360('0xa0')]=ut[_0xd360('0xa8')](_0x55cfe4);ut['logCustomer'](_0x55cfe4,0x4,'Answer');rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xc1'));rpcDb[_0xd360('0x94')](_0x55cfe4,_0xd360('0xc2'));rpcDb[_0xd360('0xc3')](_0x55cfe4);_0x17508c[_0xd360('0x2e')]+=_0x55cfe4[_0xd360('0xc4')];_0x17508c[_0xd360('0x2d')]+=_0x55cfe4[_0xd360('0xc4')];logger[_0xd360('0x5c')](_0xd360('0xc5'),_0x55cfe4[_0xd360('0xb9')],'\x20Queue',_0x17508c['name'],_0xd360('0x70'),_0x17508c[_0xd360('0x5f')]);delete this[_0xd360('0x16')][_0xc163bf[_0xd360('0xb2')]];break;case'BUSY':_0x17508c[_0xd360('0x3f')]+=0x1;_0x55cfe4[_0xd360('0xc6')]+=0x1;_0x55cfe4[_0xd360('0xa0')]=ut['totalGlobal'](_0x55cfe4);ut['logCustomer'](_0x55cfe4,0x5,_0xd360('0xc7'));_0x476c88=_0x17508c[_0xd360('0xc8')];_0x28b2bb=_0x17508c['callAdditionalPhoneAfterMin'];ami['emit'](_0xd360('0xc9'),ut[_0xd360('0xba')](_0x55cfe4,'busy'));rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xca'));_0xbc5cad['verifyAdditionalPhones'](_0x55cfe4,'5',_0x17508c)[_0xd360('0x81')](function(_0x52bf04){_0x50f415=_0x52bf04[_0xd360('0xa5')]==0x1;if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c['dialGlobalMaxRetry']){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0xf,_0xd360('0xab'));rpcDb[_0xd360('0x94')](_0x2c01a8,_0xd360('0xcb'));}else{if(_0x55cfe4['countbusyretry']>=_0x17508c[_0xd360('0xcc')]){rpcDb[_0xd360('0x94')](_0x55cfe4,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd360('0xaf')](ut[_0xd360('0xb0')](_0x55cfe4,'countbusyretry',_0x17508c[_0xd360('0xc8')]),_0x55cfe4[_0xd360('0xb1')],_0x55cfe4[_0xd360('0xcd')]);}}}else{_0x55cfe4[_0xd360('0xc6')]++;_0xbc5cad[_0xd360('0xb4')]({'id':_0x55cfe4[_0xd360('0xb3')],'field':{'countbusyretry':_0x55cfe4[_0xd360('0xc6')]}})[_0xd360('0x81')](function(){_0xbc5cad[_0xd360('0xb5')](_0x55cfe4,_0x476c88,_0x28b2bb)['then'](function(){});});}});break;case _0xd360('0xce'):_0x17508c[_0xd360('0xcf')]+=0x1;_0x55cfe4['countnoanswerretry']+=0x1;_0x55cfe4['countglobal']=ut['totalGlobal'](_0x55cfe4);ut['logCustomer'](_0x55cfe4,0x3,_0xd360('0xd0'));_0x476c88=_0x17508c[_0xd360('0xd1')];_0x28b2bb=_0x17508c['callAdditionalPhoneAfterMin'];var _0x140d18=ut[_0xd360('0xd2')](_0x55cfe4,_0x17508c);ami[_0xd360('0x27')](_0xd360('0xd3'),_0x140d18);rpcDb['createCustomerHistory'](_0x55cfe4,_0xd360('0xd4'));_0xbc5cad[_0xd360('0xa4')](_0x55cfe4,'3',_0x17508c)['then'](function(_0xf934ba){_0x50f415=_0xf934ba['additional']==0x1;if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c[_0xd360('0xa9')]){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0xf,_0xd360('0xab'));rpcDb[_0xd360('0x94')](_0x2c01a8,_0xd360('0xd5'));}else{if(_0x55cfe4[_0xd360('0xd6')]>=_0x17508c[_0xd360('0xd7')]){rpcDb[_0xd360('0x94')](_0x55cfe4,_0xd360('0xd4'));}else{rpcDb['rescheduleContact'](ut[_0xd360('0xb0')](_0x55cfe4,_0xd360('0xd6'),_0x17508c[_0xd360('0xd1')]),_0x55cfe4[_0xd360('0xb1')],_0x55cfe4['activeContact']);}}}else{_0x55cfe4[_0xd360('0xd6')]++;_0xbc5cad[_0xd360('0xb4')]({'id':_0x55cfe4[_0xd360('0xb3')],'field':{'countnoanswerretry':_0x55cfe4[_0xd360('0xd6')]}})[_0xd360('0x81')](function(){_0xbc5cad['swapAdditionalPhones'](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});});}});break;case _0xd360('0xd8'):_0x17508c[_0xd360('0x40')]+=0x1;_0x55cfe4[_0xd360('0xd9')]+=0x1;_0x55cfe4[_0xd360('0xa0')]=ut['totalGlobal'](_0x55cfe4);ut[_0xd360('0x8d')](_0x55cfe4,0x8,'Congestion');_0x476c88=_0x17508c['dialCongestionRetryFrequency'];_0x28b2bb=_0x17508c[_0xd360('0xa7')];ami[_0xd360('0x27')](_0xd360('0xda'),ut[_0xd360('0xba')](_0x55cfe4,_0xd360('0xdb')));rpcDb['createCustomerHistory'](_0x55cfe4,_0xd360('0xdc'));_0xbc5cad['verifyAdditionalPhones'](_0x55cfe4,'8',_0x17508c)[_0xd360('0x81')](function(_0x5a45a3){_0x50f415=_0x5a45a3['additional']==0x1;if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c['dialGlobalMaxRetry']){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0xf,_0xd360('0xab'));rpcDb[_0xd360('0x94')](_0x2c01a8,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x55cfe4[_0xd360('0xd9')]>=_0x17508c['dialCongestionMaxRetry']){rpcDb[_0xd360('0x94')](_0x55cfe4,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd360('0xaf')](ut[_0xd360('0xb0')](_0x55cfe4,_0xd360('0xd9'),_0x17508c[_0xd360('0xc8')]),_0x55cfe4[_0xd360('0xb1')],_0x55cfe4['activeContact']);}}}else{_0x55cfe4[_0xd360('0xd9')]++;_0xbc5cad[_0xd360('0xb4')]({'id':_0x55cfe4[_0xd360('0xb3')],'field':{'countcongestionretry':_0x55cfe4[_0xd360('0xd9')]}})[_0xd360('0x81')](function(){_0xbc5cad[_0xd360('0xb5')](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});});}});break;case _0xd360('0xdd'):_0x17508c[_0xd360('0x45')]+=0x1;_0x55cfe4[_0xd360('0xde')]+=0x1;_0x55cfe4[_0xd360('0xa0')]=ut[_0xd360('0xa8')](_0x55cfe4);ut[_0xd360('0x8d')](_0x55cfe4,0x14,_0xd360('0xdf'));_0x476c88=_0x17508c['dialAgentRejectRetryFrequency'];_0x28b2bb=_0x17508c[_0xd360('0xa7')];ami['emit'](_0xd360('0xe0'),ut[_0xd360('0xba')](_0x55cfe4,_0xd360('0xe1')));rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xe2'));_0xbc5cad[_0xd360('0xa4')](_0x55cfe4,'20',_0x17508c)[_0xd360('0x81')](function(_0x35fbb5){_0x50f415=_0x35fbb5[_0xd360('0xa5')]==0x1;if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c[_0xd360('0xa9')]){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0x14,_0xd360('0xdf'));rpcDb[_0xd360('0x94')](_0x2c01a8,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x55cfe4[_0xd360('0xde')]>=_0x17508c[_0xd360('0xe3')]){rpcDb[_0xd360('0x94')](_0x55cfe4,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd360('0xaf')](ut[_0xd360('0xb0')](_0x55cfe4,_0xd360('0xde'),_0x17508c[_0xd360('0xe4')]),_0x55cfe4[_0xd360('0xb1')],_0x55cfe4['activeContact']);}}}else{_0x55cfe4['countnoanswerretry']++;_0xbc5cad[_0xd360('0xb4')]({'id':_0x55cfe4['idContact'],'field':{'countnoanswerretry':_0x55cfe4[_0xd360('0xd6')]}})[_0xd360('0x81')](function(){_0xbc5cad[_0xd360('0xb5')](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});});}});break;case'ABANDONED':_0x17508c[_0xd360('0x46')]+=0x1;_0x55cfe4[_0xd360('0xe5')]+=0x1;_0x55cfe4[_0xd360('0xa0')]=ut[_0xd360('0xa8')](_0x55cfe4);ut[_0xd360('0x8d')](_0x55cfe4,0xb,_0xd360('0xe6'));rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xe7'));_0xbc5cad['verifyAdditionalPhones'](_0x55cfe4,'11',_0x17508c)[_0xd360('0x81')](function(_0x4c5b58){_0x50f415=_0x4c5b58[_0xd360('0xa5')]==0x1;if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c[_0xd360('0xa9')]){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0xf,'Global');rpcDb[_0xd360('0x94')](_0x2c01a8,_0xd360('0xe7'));}else{if(_0x55cfe4[_0xd360('0xe8')]>=_0x17508c[_0xd360('0xe9')]){rpcDb[_0xd360('0x94')](_0x55cfe4,_0xd360('0xe7'));}else{rpcDb[_0xd360('0xaf')](ut[_0xd360('0xb0')](_0x55cfe4,'countabandonedretry',_0x17508c[_0xd360('0xea')]),_0x55cfe4[_0xd360('0xb1')],_0x55cfe4[_0xd360('0xcd')]);}}}else{_0x55cfe4[_0xd360('0xd6')]++;_0xbc5cad['incrementPreviewCounters']({'id':_0x55cfe4[_0xd360('0xb3')],'field':{'countnoanswerretry':_0x55cfe4[_0xd360('0xd6')]}})[_0xd360('0x81')](function(){_0xbc5cad[_0xd360('0xb5')](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});});}});break;case'18':_0x17508c[_0xd360('0xeb')]+=0x1;_0x55cfe4[_0xd360('0xec')]+=0x1;_0x55cfe4['countglobal']=ut[_0xd360('0xa8')](_0x55cfe4);ut[_0xd360('0x8d')](_0x55cfe4,0x12,_0xc163bf[_0xd360('0xed')]||_0xc163bf[_0xd360('0xee')]);ami['emit'](_0xd360('0xef'),ut[_0xd360('0xba')](_0x55cfe4,_0xd360('0xf0')));rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xf1'));_0xbc5cad[_0xd360('0xa4')](_0x55cfe4,'18',_0x17508c)['then'](function(_0x33dfeb){_0x50f415=_0x33dfeb[_0xd360('0xa5')]==0x1;if(!_0x50f415){if(ut['totalGlobal'](_0x55cfe4)>=_0x17508c[_0xd360('0xa9')]){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0x12,_0xd360('0xab'));rpcDb['createCustomerFinal'](_0x2c01a8,_0xd360('0xf1'));}else{rpcDb[_0xd360('0x94')](_0x55cfe4,_0xd360('0xf1'));}}else{_0x55cfe4[_0xd360('0xd6')]++;_0xbc5cad[_0xd360('0xb4')]({'id':_0x55cfe4[_0xd360('0xb3')],'field':{'countnoanswerretry':_0x55cfe4['countnoanswerretry']}})[_0xd360('0x81')](function(){_0xbc5cad['swapAdditionalPhones'](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});});}});delete this[_0xd360('0x16')][_0xc163bf[_0xd360('0xb2')]];break;case'19':_0x17508c[_0xd360('0xeb')]+=0x1;_0x55cfe4[_0xd360('0xa0')]=ut['totalGlobal'](_0x55cfe4);ut[_0xd360('0x8d')](_0x55cfe4,0x13,_0xc163bf['cause-txt']||_0xc163bf['dialstatus']);ami[_0xd360('0x27')](_0xd360('0xef'),ut[_0xd360('0xba')](_0x55cfe4,_0xd360('0xf0')));rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xf2'));_0xbc5cad[_0xd360('0xa4')](_0x55cfe4,'18',_0x17508c)[_0xd360('0x81')](function(_0x1ca563){_0x50f415=_0x1ca563['additional']==0x1;if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c['dialGlobalMaxRetry']){_0x2c01a8=ut[_0xd360('0xaa')](_0x55cfe4,0xf,'Global');rpcDb[_0xd360('0x94')](_0x2c01a8,_0xd360('0xf2'));}else{rpcDb[_0xd360('0x94')](_0x55cfe4,'[callProgressDetectingCustomer][machine]');}}else{_0x55cfe4['countnoanswerretry']++;_0xbc5cad[_0xd360('0xb4')]({'id':_0x55cfe4[_0xd360('0xb3')],'field':{'countnoanswerretry':_0x55cfe4[_0xd360('0xd6')]}})[_0xd360('0x81')](function(){_0xbc5cad[_0xd360('0xb5')](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});});}});delete this[_0xd360('0x16')][_0xc163bf[_0xd360('0xb2')]];break;default:if(_0x55cfe4[_0xd360('0x71')]){ut[_0xd360('0x7b')](_0x17508c,_0xd360('0xf3'));ut[_0xd360('0x7d')](_0xd360('0xf4')+_0x17508c[_0xd360('0x29')],_0xc163bf);}_0x17508c[_0xd360('0xeb')]+=0x1;_0x55cfe4[_0xd360('0xa0')]=ut[_0xd360('0xa8')](_0x55cfe4);ut[_0xd360('0x8d')](_0x55cfe4,0xc,_0xc163bf[_0xd360('0xed')]||_0xc163bf[_0xd360('0xee')]);_0x476c88=_0x17508c['dialAgentRejectRetryFrequency'];_0x28b2bb=_0x17508c[_0xd360('0xa7')];rpcDb[_0xd360('0xa2')](_0x55cfe4,_0xd360('0xf5'));_0xbc5cad[_0xd360('0xa4')](_0x55cfe4,'20',_0x17508c)[_0xd360('0x81')](function(_0xef67e7){_0x50f415=_0xef67e7[_0xd360('0xa5')]==0x1;if(!_0x50f415){if(ut[_0xd360('0xa8')](_0x55cfe4)>=_0x17508c[_0xd360('0xa9')]){_0x2c01a8=ut['cloneAction'](_0x55cfe4,0xf,_0xd360('0xab'));rpcDb['createCustomerFinal'](_0x2c01a8,_0xd360('0xf6'));}else{rpcDb[_0xd360('0x94')](_0x55cfe4,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xd360('0x16')][_0xc163bf[_0xd360('0xb2')]];}else{_0xbc5cad[_0xd360('0xb5')](_0x55cfe4,_0x476c88,_0x28b2bb)[_0xd360('0x81')](function(){});}});}if(!(_0x55cfe4[_0xd360('0x71')]&&_0x122f9e==='16')){ut[_0xd360('0x79')](_0x17508c,_0xd360('0xf7'));logger[_0xd360('0x5c')](_0xd360('0xf8'),_0x55cfe4[_0xd360('0xb9')],_0xd360('0xf9'),_0x17508c[_0xd360('0x29')],_0xd360('0xfa'),_0x17508c[_0xd360('0x4f')]);}if(_0x122f9e!=='ANSWER'){delete this['actions'][_0xc163bf['linkedid']];delete this[_0xd360('0x16')][_0xc163bf[_0xd360('0xfb')]];}}};Preview[_0xd360('0xe')][_0xd360('0xfc')]=function(_0x49e18f,_0x159519,_0x35954f){if(_['isUndefined'](_0x159519)&&'object'!==typeof _0x159519){return;}if(_[_0xd360('0xfd')](_0x35954f)&&'object'!==typeof _0x35954f){return;}switch(_0x35954f['reason']){case'0':ut[_0xd360('0xfe')](_0x49e18f,0x0,_0xd360('0xff'));rpcDb[_0xd360('0x100')](_0x49e18f,_0xd360('0x101'));break;case'3':ut['logAgent'](_0x49e18f,0x3,_0xd360('0xd0'));rpcDb['createAgentHistory'](_0x49e18f,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xd360('0xfe')](_0x49e18f,0x5,_0xd360('0xc7'));rpcDb[_0xd360('0x100')](_0x49e18f,_0xd360('0x102'));break;case'8':ut[_0xd360('0xfe')](_0x49e18f,0x8,'Congestion');rpcDb[_0xd360('0x100')](_0x49e18f,_0xd360('0x103'));break;case'22':ut[_0xd360('0xfe')](_0x49e18f,0x16,'AnswerAGI');rpcDb[_0xd360('0x100')](_0x49e18f,_0xd360('0x104'));break;default:ut[_0xd360('0xfe')](_0x49e18f,0xc,_0x35954f[_0xd360('0x105')]);rpcDb[_0xd360('0x100')](_0x49e18f,_0xd360('0x103'));}ut[_0xd360('0x79')](_0x159519,'[callProgressDetectingAgent]');logger[_0xd360('0x5c')](_0xd360('0x106'),_0x49e18f[_0xd360('0xb9')],_0xd360('0xf9'),_0x159519[_0xd360('0x29')],_0xd360('0xfa'),_0x159519[_0xd360('0x4f')]);delete this[_0xd360('0x16')][_0x49e18f[_0xd360('0xb9')]];};Preview[_0xd360('0xe')][_0xd360('0xa4')]=function(_0x3b323d,_0x241af5,_0x365527){return Promise[_0xd360('0x107')]()[_0xd360('0x81')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3b323d,_0x241af5,_0x365527))['catch'](logger[_0xd360('0x5c')](_0xd360('0x108')));};Preview[_0xd360('0xe')][_0xd360('0xb5')]=function(_0x19568f,_0x3a0914,_0x43c222){return Promise[_0xd360('0x107')]()[_0xd360('0x81')](cmHopperAdditionalPhone[_0xd360('0xb5')](_0x19568f,_0x3a0914,_0x43c222))[_0xd360('0x78')](logger[_0xd360('0x5c')](_0xd360('0x109')));};Preview[_0xd360('0xe')][_0xd360('0xb4')]=function(_0x5a9a6b){return Promise[_0xd360('0x107')]()['then'](cmHopperAdditionalPhone[_0xd360('0xb4')](_0x5a9a6b))['catch'](logger['info'](_0xd360('0x10a')));};Preview[_0xd360('0xe')]['checkInBlack']=function(_0x467e48,_0x2d1da6,_0x555d9e,_0x3ea5af,_0x33e8ad){var _0x47b3f6=this;return new Promise(function(_0x420c54,_0xff7209){if(_['isNil'](_0x2d1da6)||_[_0xd360('0x82')](_0x2d1da6['Contact'])||_[_0xd360('0x82')](_0x2d1da6['phone'])||_[_0xd360('0x82')](_0x2d1da6[_0xd360('0x75')])){_0xff7209(ut['message']('Contact\x20is\x20undefined',_0x3ea5af,_0x33e8ad));return;}var _0x261a53=uuid['v4']();var _0x2034f7=_0x47b3f6[_0xd360('0x13')][_0x2d1da6[_0xd360('0x6e')][_0xd360('0x29')]];var _0x1f5dbf=_0x555d9e?_0x47b3f6[_0xd360('0x17')][_0x555d9e]['id']:undefined;_0x47b3f6[_0xd360('0x16')][_0x261a53]=new Action(_0x2d1da6,_0x2034f7,_0x261a53,_0x555d9e,_0x1f5dbf);var _0x48af73=_0x47b3f6[_0xd360('0x16')][_0x261a53];_0x48af73[_0xd360('0xb1')]=_0x3ea5af;_0x48af73['activeContact']=_0x33e8ad;_0x48af73[_0xd360('0x10b')]=_0x555d9e;if(_[_0xd360('0x10c')](_0x467e48)){_0x47b3f6[_0xd360('0x10d')](_0x48af73,_0x2034f7,_0x2d1da6,_0x555d9e)[_0xd360('0x81')](function(_0xffd326){logger[_0xd360('0x5c')](_0xd360('0x10e'),'Queue:\x20'+_0x48af73[_0xd360('0x6f')]+'\x20IdHopper:\x20'+_0x48af73['idContact'],JSON[_0xd360('0x5d')](_0xffd326));ami[_0xd360('0x27')](_0xd360('0x10f'),ut[_0xd360('0xba')](_0x48af73,_0xd360('0x110'),_0x47b3f6[_0xd360('0x13')][_0x48af73[_0xd360('0x6f')]]));_0x420c54(ut[_0xd360('0x4e')](_0xd360('0x111')));})[_0xd360('0x78')](function(_0x18efc7){ut[_0xd360('0x63')](_0xd360('0x112'),_0x18efc7);_0xff7209(ut[_0xd360('0x4e')]('Call\x20failed',_0x3ea5af,_0x33e8ad));});}else{_0x2034f7['outboundBlacklistCallsDay']+=0x1;ut[_0xd360('0x113')](_0x48af73);rpcDb[_0xd360('0x114')](_0x48af73,_0xd360('0x115'));delete _0x47b3f6[_0xd360('0x16')][_0x261a53];_0xff7209(ut[_0xd360('0x4e')](_0xd360('0x116'),_0x3ea5af,_0x33e8ad));}});};Preview[_0xd360('0xe')][_0xd360('0x9a')]=function(_0x296e5d){return!_[_0xd360('0x82')](_0x296e5d)&&!_[_0xd360('0x82')](_0x296e5d[_0xd360('0x29')])&&!_[_0xd360('0x82')](_0x296e5d['active'])&&_0x296e5d[_0xd360('0x57')]&&!_[_0xd360('0x82')](this['trunks'][util[_0xd360('0x5a')](_0xd360('0x117'),_0x296e5d[_0xd360('0x29')])])&&!_[_0xd360('0x82')](this[_0xd360('0x15')][util[_0xd360('0x5a')](_0xd360('0x117'),_0x296e5d[_0xd360('0x29')])][_0xd360('0x118')])&&(this['trunks'][util['format'](_0xd360('0x117'),_0x296e5d[_0xd360('0x29')])][_0xd360('0x118')]==='reachable'||this['trunks'][util[_0xd360('0x5a')](_0xd360('0x117'),_0x296e5d['name'])][_0xd360('0x118')]===_0xd360('0x119'));};Preview[_0xd360('0xe')][_0xd360('0x88')]=function(_0x43c0e8,_0x2e14aa){var _0x5e8e49=this;return new Promise(function(_0x427e34,_0x889c44){_0x5e8e49['execRun'](_0x43c0e8,_0x2e14aa)[_0xd360('0x81')](function(_0x55b1a5){_0x427e34(_['pick'](_0x55b1a5,['message']));})[_0xd360('0x78')](function(_0x4f3515){if(_0x4f3515[_0xd360('0x11a')]){rpcDb[_0xd360('0x11b')](_0x43c0e8);}if(_0x4f3515['active']){rpcDb[_0xd360('0x11c')](_0x43c0e8);}_0x889c44(_['pick'](_0x4f3515,[_0xd360('0x4e')]));});});};Preview[_0xd360('0xe')][_0xd360('0x11d')]=function(_0x4171b5,_0x50f7cd){var _0x131b7b=this;return new Promise(function(_0x3c339c,_0x4eb63e){var _0x4ae34a,_0x5bd581;rpcDb[_0xd360('0x11e')](_0x4171b5)['then'](function(_0xbd0e4b){if(!_[_0xd360('0x82')](_0xbd0e4b[0x0])){_0x5bd581=_0xbd0e4b[0x0][_0xd360('0x11f')]?![]:!![];_0x4ae34a=_0xbd0e4b[0x0]['recallme']?!![]:![];_0x4ae34a=_0x50f7cd?!![]:_0x4ae34a;}var _0x353094=_0x131b7b[_0xd360('0x120')](_0xbd0e4b);if(_0x353094[_0xd360('0x121')]){rpcDb[_0xd360('0x122')](_[_0xd360('0x72')](_0xbd0e4b[0x0],[_0xd360('0x75'),_0xd360('0x123')]))[_0xd360('0x81')](function(_0x838c2f){_0x131b7b['checkInBlack'](_0x838c2f,_0xbd0e4b[0x0],_0x50f7cd,_0x5bd581,_0x4ae34a)[_0xd360('0x81')](function(_0x33cab3){_0x3c339c(_0x33cab3);})[_0xd360('0x78')](function(_0xf7c6cb){_0x4eb63e(_0xf7c6cb);});})[_0xd360('0x78')](function(_0x448b04){ut[_0xd360('0x63')]('[Preview][checkIsBlackList]',_0x448b04);_0x4eb63e(ut[_0xd360('0x4e')](_0xd360('0x124'),_0x5bd581,_0x4ae34a));});}else{_0x4eb63e(ut[_0xd360('0x4e')](_0x353094[_0xd360('0x4e')],_0x5bd581,_0x4ae34a));}})[_0xd360('0x78')](function(_0x1f5f72){ut[_0xd360('0x63')](_0xd360('0x125'),_0x1f5f72);_0x4eb63e(ut[_0xd360('0x4e')](_0xd360('0x124'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x31f68b){if(_[_0xd360('0x82')](_0x31f68b)||_[_0xd360('0x10c')](_0x31f68b)||!_[_0xd360('0x82')](_0x31f68b[0x0]['Agent'])&&_[_0xd360('0x82')](_0x31f68b[0x0]['Agent'][_0xd360('0x29')])){ut[_0xd360('0x63')](_0xd360('0x126'),_0x31f68b);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x146108=this[_0xd360('0x13')][_0x31f68b[0x0][_0xd360('0x6e')][_0xd360('0x29')]];_0x146108[_0xd360('0x4e')]=_0xd360('0x9d');if(_['isNil'](_0x146108)){ut[_0xd360('0x63')](_0xd360('0x127'),_0x146108);return{'isValid':![],'message':_0xd360('0x128')};}if(!this[_0xd360('0x9a')](_0x146108[_0xd360('0x56')])){ut['logger'](_0xd360('0x129'),'campaign\x20Name:\x20'+_0x146108[_0xd360('0x29')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x146108[_0xd360('0x9b')])){ut[_0xd360('0x63')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x146108['name']+_0xd360('0x12a'));return{'isValid':![],'message':_0xd360('0x12b')};}}if(!ut[_0xd360('0x99')](_0x146108[_0xd360('0x37')])){ut[_0xd360('0x63')](_0xd360('0x12c'),_0x146108['name']+_0xd360('0x12d'));return{'isValid':![],'message':_0xd360('0x12e')+_0x146108[_0xd360('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xd360('0x12f')};};Preview[_0xd360('0xe')]['execCall']=function(_0x498945,_0x368abf,_0x56b42c,_0x442a4a){var _0x2fc433=this;return new Promise(function(_0x518679,_0x4e7fd3){var _0x4ea9b3=_0x498945[_0xd360('0xb9')];var _0xb33948=_0x2fc433[_0xd360('0x9a')](_0x368abf['Trunk'])?util[_0xd360('0x5a')](_0xd360('0x130'),_0x368abf[_0xd360('0x56')][_0xd360('0x29')],_[_0xd360('0x82')](_0x368abf[_0xd360('0x131')])?'':_0x368abf[_0xd360('0x131')][_0xd360('0x132')]()||'',_0x368abf[_0xd360('0x133')]>0x0?_0x56b42c[_0xd360('0x123')][_0xd360('0x134')](_0x368abf[_0xd360('0x133')]):_0x56b42c[_0xd360('0x123')]):util[_0xd360('0x5a')](_0xd360('0x130'),_['isNil'](_0x368abf['TrunkBackup'])?_0x368abf['Trunk'][_0xd360('0x29')]:_0x368abf[_0xd360('0x9b')][_0xd360('0x29')],_[_0xd360('0x82')](_0x368abf[_0xd360('0x131')])?'':_0x368abf[_0xd360('0x131')]['trim']()||'',_0x368abf['dialCutDigit']>0x0?_0x56b42c[_0xd360('0x123')][_0xd360('0x134')](_0x368abf[_0xd360('0x133')]):_0x56b42c[_0xd360('0x123')]);var _0xaa42c3=_0x2fc433[_0xd360('0x9a')](_0x368abf[_0xd360('0x56')])?ut['getCallerId'](_0x368abf[_0xd360('0x56')][_0xd360('0x58')],_0x368abf[_0xd360('0x39')],_0x368abf[_0xd360('0x135')]>0x0?ut[_0xd360('0x136')](_0x368abf[_0xd360('0x3a')],_0x368abf['dialRandomLastDigitCallerIdNumber']):_0x368abf[_0xd360('0x3a')]):ut[_0xd360('0x137')](_['isNil'](_0x368abf[_0xd360('0x9b')])?_0x368abf[_0xd360('0x56')][_0xd360('0x58')]:_0x368abf[_0xd360('0x9b')][_0xd360('0x58')],_0x368abf[_0xd360('0x39')],_0x368abf[_0xd360('0x135')]>0x0?ut[_0xd360('0x136')](_0x368abf['dialOriginateCallerIdNumber'],_0x368abf[_0xd360('0x135')]):_0x368abf[_0xd360('0x3a')]);if(_0xaa42c3){_0x498945[_0xd360('0x138')]=ut['extractCalleridName'](_0xaa42c3);_0x498945[_0xd360('0x139')]=ut['extractCalleridNumber'](_0xaa42c3);}var _0x27aff7=ut[_0xd360('0x13a')](_0x368abf,_0x56b42c,_0xb33948,_0xaa42c3,_0x4ea9b3,_0x498945);_[_0xd360('0x13b')](_0x498945,ut[_0xd360('0x13c')](_0x27aff7));_0x498945[_0xd360('0x8b')]=moment()['format'](_0xd360('0x8c'));_0x368abf['variables']=_0x27aff7;ami[_0xd360('0x76')](ut['variablesAction'](_0x498945,_0x368abf,_0x27aff7,_0x498945[_0xd360('0xcd')],_0x442a4a))[_0xd360('0x81')](function(_0x51873e){_0x368abf[_0xd360('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x4ea9b3,'\x20Queue',_0x368abf[_0xd360('0x29')],_0xd360('0xfa'),_0x368abf[_0xd360('0x4f')]);_0x518679(_0x51873e);})[_0xd360('0x78')](function(_0x510b53){ut[_0xd360('0xfe')](_0x498945,0xe,'OriginateError');rpcDb[_0xd360('0x100')](_0x498945,_0xd360('0x13d'));_0x4e7fd3(_0x510b53);});});};Preview['prototype'][_0xd360('0x21')]=function(_0x1de5e7){if(this[_0xd360('0x16')][_0x1de5e7[_0xd360('0xb2')]]){this['actions'][_0x1de5e7['linkedid']][_0xd360('0x77')]=_0x1de5e7[_0xd360('0x77')];}};Preview[_0xd360('0xe')][_0xd360('0x1a')]=function(_0x443677){var _0xda6f82=this;var _0x1ada00=this[_0xd360('0x16')][_0x443677[_0xd360('0x13e')]];if(_0x1ada00){if(_0x1ada00[_0xd360('0x10b')]&&this[_0xd360('0x17')][_0x1ada00[_0xd360('0x10b')]]){ut['logLookAgent'](_0x1ada00,this[_0xd360('0x17')][_0x1ada00[_0xd360('0x10b')]][_0xd360('0x29')],this[_0xd360('0x17')][_0x1ada00[_0xd360('0x10b')]]['id']);}var _0x424a66=_[_0xd360('0x13f')](_0x1ada00);_0x424a66[_0xd360('0x140')]=moment()[_0xd360('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x134511=_0xda6f82[_0xd360('0x13')][_0x1ada00[_0xd360('0x6f')]];if(ut[_0xd360('0x141')](_0x443677['response'])){if(_0x1ada00['unlockAgent']){rpcDb['unlockContact'](_0x1ada00[_0xd360('0xb3')]);}if(_0x1ada00[_0xd360('0xcd')]){rpcDb[_0xd360('0x11c')](_0x1ada00['idContact']);}ami[_0xd360('0x27')](_0xd360('0x142'),ut[_0xd360('0xba')](_0x1ada00,_0xd360('0x143'),this[_0xd360('0x13')][_0x1ada00[_0xd360('0x6f')]]));this['callProgressDetectingAgent'](_0x424a66,_0x134511,_0x443677);}else{_0x1ada00[_0xd360('0x8b')]=moment()[_0xd360('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xd360('0xfe')](_0x424a66,0x4,_0xd360('0x144'));rpcDb['createAgentHistory'](_0x424a66,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xd360('0xe')][_0xd360('0x1d')]=function(_0x28db8e){var _0x1201c1=this[_0xd360('0x16')][_0x28db8e[_0xd360('0xb2')]];var _0x5dd9b0;if(_0x1201c1){_0x5dd9b0=this[_0xd360('0x13')][_0x1201c1[_0xd360('0x6f')]];logger['info'](_0xd360('0x145'),_0x28db8e['linkedid'],_0xd360('0xf9'),_0x5dd9b0['name'],_0xd360('0x70'),_0x5dd9b0[_0xd360('0x5f')]);}if(this['actions'][_0x28db8e[_0xd360('0xb2')]]&&_0x28db8e['linkedid']!==_0x28db8e[_0xd360('0xb9')]){if(_0x28db8e[_0xd360('0x146')]==='16'&&this[_0xd360('0x16')][_0x28db8e[_0xd360('0xb2')]]['dialAnswer']){this[_0xd360('0x9e')](_0x28db8e,_0x28db8e[_0xd360('0xb2')],_0x28db8e[_0xd360('0x146')]);}else if(this[_0xd360('0x16')][_0x28db8e[_0xd360('0xb2')]]['dialAnswer']){logger[_0xd360('0x5c')](_0xd360('0x147'),_0x28db8e[_0xd360('0xb2')],_0x28db8e['cause'],_0xd360('0xf9'),_0x5dd9b0[_0xd360('0x29')],_0xd360('0x70'),_0x5dd9b0['pTalking']);this[_0xd360('0x9e')](_0x28db8e,_0x28db8e[_0xd360('0xb2')],_0x28db8e[_0xd360('0x146')]);}}else if(_0x1201c1&&_[_0xd360('0x82')](_0x1201c1[_0xd360('0x148')])&&_0x5dd9b0[_0xd360('0x149')]&&_0x28db8e[_0xd360('0xb2')]===_0x28db8e[_0xd360('0xb9')]&&_[_0xd360('0x82')](_0x28db8e['reason'])&&_0x28db8e['cause']==='16'&&_0x28db8e[_0xd360('0x14a')]==='6'&&_[_0xd360('0xfd')](_0x1201c1[_0xd360('0x14b')])){if(_0x1201c1['unlockAgent']){rpcDb[_0xd360('0x11b')](_0x1201c1[_0xd360('0xb3')]);}if(_0x1201c1['activeContact']){rpcDb[_0xd360('0x11c')](_0x1201c1[_0xd360('0xb3')]);}_0x28db8e[_0xd360('0x105')]='22';this[_0xd360('0xfc')](_0x1201c1,_0x5dd9b0,_0x28db8e);}else if(_0x1201c1&&_0x1201c1[_0xd360('0x14b')]){if(_0x28db8e[_0xd360('0x146')]==='16'&&this[_0xd360('0x16')][_0x28db8e[_0xd360('0xb2')]][_0xd360('0x71')]){logger['info'](_0xd360('0x14c'),_0x28db8e['linkedid'],_0x28db8e[_0xd360('0x146')],_0xd360('0xf9'),_0x5dd9b0[_0xd360('0x29')],_0xd360('0x70'),_0x5dd9b0[_0xd360('0x5f')]);this['callProgressDetectingCustomer'](_0x28db8e,_0x28db8e[_0xd360('0xb2')],_0x28db8e['cause']);}else if(this['actions'][_0x28db8e[_0xd360('0xb2')]][_0xd360('0x71')]){logger[_0xd360('0x5c')](_0xd360('0x147'),_0x28db8e[_0xd360('0xb2')],_0x28db8e[_0xd360('0x146')],'\x20Queue',_0x5dd9b0['name'],'pTalking:\x20',_0x5dd9b0['pTalking']);this[_0xd360('0x9e')](_0x28db8e,_0x28db8e[_0xd360('0xb2')],_0x28db8e[_0xd360('0x146')]);}}};Preview[_0xd360('0xe')][_0xd360('0x20')]=function(_0x52588a){if(this['actions'][_0x52588a[_0xd360('0xfb')]]&&_0x52588a[_0xd360('0xfb')]!==_0x52588a[_0xd360('0x14d')]){this[_0xd360('0x9e')](_0x52588a,_0x52588a[_0xd360('0xfb')],_0x52588a[_0xd360('0xee')]);}};Preview['prototype']['syncHangupRequest']=function(_0x6f6d2a){if(this['actions'][_0x6f6d2a[_0xd360('0xb2')]]&&_0x6f6d2a[_0xd360('0xb2')]!==_0x6f6d2a[_0xd360('0xb9')]&&!this[_0xd360('0x16')][_0x6f6d2a[_0xd360('0xb2')]][_0xd360('0x71')]){if(_0x6f6d2a[_0xd360('0x146')]==='1'){this['callProgressDetectingCustomer'](_0x6f6d2a,_0x6f6d2a[_0xd360('0xb2')],_0x6f6d2a[_0xd360('0x146')]);}}};Preview['prototype'][_0xd360('0x14e')]=function(_0x14ccd0,_0x97af9a,_0x3b23b8){if(this[_0xd360('0x16')][_0x14ccd0]){if(_[_0xd360('0x82')](this[_0xd360('0x16')][_0x14ccd0][_0xd360('0x14f')])){this['actions'][_0x14ccd0][_0xd360('0x14f')]={};}this['actions'][_0x14ccd0]['variables'][_0x97af9a]=_0x3b23b8;}};Preview[_0xd360('0xe')]['syncVarSet']=function(_0x3aa0b4){try{if(!_[_0xd360('0x82')](_0x3aa0b4)){if(ut[_0xd360('0x150')](_[_0xd360('0x151')](_0x3aa0b4[_0xd360('0x152')])[0x0])){this[_0xd360('0x14e')](_0x3aa0b4[_0xd360('0xb9')],_['keys'](_0x3aa0b4[_0xd360('0x152')])[0x0],_0x3aa0b4[_0xd360('0x153')]);}}}catch(_0x3d0782){logger[_0xd360('0x154')](_0xd360('0x155'),util[_0xd360('0x156')](_0x3d0782,{'showHidden':![],'depth':null}));}};Preview[_0xd360('0xe')]['syncAttendedTransfer']=function(_0xb977a3){if(_0xb977a3){if(this['actions'][_0xb977a3[_0xd360('0x157')]]){this['actions'][_0xb977a3[_0xd360('0x157')]]['transfer']=!![];}}};Preview[_0xd360('0xe')][_0xd360('0x25')]=function(_0x5e576f){if(_0x5e576f){if(this['actions'][_0x5e576f[_0xd360('0x158')]]){this['actions'][_0x5e576f['transfererlinkedid']][_0xd360('0x14b')]=!![];}}};module[_0xd360('0x159')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 4089d75..bb69c25 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 _0x5ed0=['preview','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','resolve','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercompleteAt','connectedlinename','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger'];(function(_0xd1bd2b,_0x43ead3){var _0x466676=function(_0x4062eb){while(--_0x4062eb){_0xd1bd2b['push'](_0xd1bd2b['shift']());}};_0x466676(++_0x43ead3);}(_0x5ed0,0x1da));var _0x05ed=function(_0x5d9c65,_0x1e37ff){_0x5d9c65=_0x5d9c65-0x0;var _0x4e2944=_0x5ed0[_0x5d9c65];return _0x4e2944;};'use strict';var util=require(_0x05ed('0x0'));var BPromise=require(_0x05ed('0x1'));var logger=require(_0x05ed('0x2'))(_0x05ed('0x3'));var _=require(_0x05ed('0x4'));var cmHopper=require(_0x05ed('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x05ed('0x6'));var voiceQueueRt=require(_0x05ed('0x7'));var agentReportPreview=require(_0x05ed('0x8'));var voiceQueueReport=require(_0x05ed('0x9'));function loggerCatch(_0x23757f){return function(_0x1a14c9){logger[_0x05ed('0xa')](_0x23757f,util[_0x05ed('0xb')](_0x1a14c9,{'showHidden':![],'depth':null}));};}function create(_0x1ed17b){return BPromise['resolve']()[_0x05ed('0xc')](cmHopperHistory[_0x05ed('0xd')](_0x1ed17b))[_0x05ed('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x4a0de7){return BPromise['resolve']()['then'](agentReportPreview[_0x05ed('0xd')](_0x4a0de7))[_0x05ed('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x34bfef){return BPromise[_0x05ed('0xf')]()['then'](cmHopper[_0x05ed('0x10')](_0x34bfef,!![]))[_0x05ed('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x05ed('0x11')]=function(_0x413ccd){return BPromise[_0x05ed('0xf')]()[_0x05ed('0xc')](cmHopperBlack['checkIsBlackList'](_0x413ccd))['catch'](loggerCatch(_0x05ed('0x12')));};exports[_0x05ed('0x13')]=function(_0x1032c5){return BPromise[_0x05ed('0xf')]()[_0x05ed('0xc')](cmHopper[_0x05ed('0x13')](_0x1032c5))['catch'](loggerCatch(_0x05ed('0x14')));};exports[_0x05ed('0xd')]=function(_0x32ae6e,_0x583133){create(_0x32ae6e)[_0x05ed('0xe')](loggerCatch(_0x583133));moveContact(_0x32ae6e)[_0x05ed('0xe')](loggerCatch(_0x583133));};exports['createAgentHistory']=function(_0x2e853f,_0x3f9f20){createAgent(_0x2e853f)['catch'](loggerCatch(_0x3f9f20));};exports[_0x05ed('0x15')]=function(_0xb10fe4,_0x139af7){create(_0xb10fe4)[_0x05ed('0xe')](loggerCatch(_0x139af7));};exports[_0x05ed('0x16')]=function(_0x44c725,_0x3a4511){moveContact(_0x44c725)[_0x05ed('0xe')](loggerCatch(_0x3a4511));};exports[_0x05ed('0x17')]=function(_0x1cec2a,_0x28b4bc,_0x4cde4d){if(_0x28b4bc){_0x1cec2a[_0x05ed('0x18')]=null;}if(_0x4cde4d){_0x1cec2a[_0x05ed('0x19')]=![];}return BPromise['resolve']()['then'](cmHopper[_0x05ed('0x17')](_0x1cec2a))[_0x05ed('0xe')](loggerCatch(_0x05ed('0x1a')));};exports[_0x05ed('0x1b')]=function(_0x55e8c3){return BPromise[_0x05ed('0xf')]()[_0x05ed('0xc')](cmHopper[_0x05ed('0x1b')](_0x55e8c3))['catch'](loggerCatch(_0x05ed('0x1c')));};exports[_0x05ed('0x1d')]=function(_0x2db10a){return BPromise[_0x05ed('0xf')]()['then'](cmHopper[_0x05ed('0x1d')]({'UserId':null},_0x2db10a,0x1))[_0x05ed('0xe')](loggerCatch(_0x05ed('0x1e')));};exports[_0x05ed('0x1f')]=function(_0x26a16d){return BPromise['resolve']()['then'](cmHopper[_0x05ed('0x1d')]({'active':![]},_0x26a16d,0x1))[_0x05ed('0xe')](loggerCatch(_0x05ed('0x20')));};exports['crateCustomerReportQueue']=function(_0x318ef8){var _0x2c0c8e={};_0x2c0c8e[_0x05ed('0x21')]=_0x318ef8[_0x05ed('0x21')];_0x2c0c8e['uniqueid']=_0x318ef8[_0x05ed('0x22')];_0x2c0c8e[_0x05ed('0x23')]=_0x318ef8['calleridnum'];_0x2c0c8e[_0x05ed('0x24')]=_0x318ef8[_0x05ed('0x24')];_0x2c0c8e[_0x05ed('0x25')]=_0x318ef8[_0x05ed('0x25')];_0x2c0c8e['queuecallerjoinAt']=_0x318ef8[_0x05ed('0x26')];_0x2c0c8e[_0x05ed('0x27')]=_0x318ef8[_0x05ed('0x26')];_0x2c0c8e['queuecallercomplete']=0x1;_0x2c0c8e[_0x05ed('0x28')]=_0x318ef8['endtime'];_0x2c0c8e[_0x05ed('0x29')]=_0x318ef8['membername'];_0x2c0c8e['context']=_0x05ed('0x2a');_0x2c0c8e['exten']=_0x05ed('0x2b');_0x2c0c8e[_0x05ed('0x2c')]=0x0;_0x2c0c8e[_0x05ed('0x2d')]=0x1;_0x2c0c8e[_0x05ed('0x2e')]=_0x318ef8[_0x05ed('0x2f')];_0x2c0c8e['queuecallerexitreason']='COMPLETED';return BPromise[_0x05ed('0xf')]()[_0x05ed('0xc')](voiceQueueReport[_0x05ed('0x30')](_0x2c0c8e))['catch'](loggerCatch(_0x05ed('0x31')));};exports[_0x05ed('0x32')]=function(_0x2a6d78,_0x12fd0d){return BPromise[_0x05ed('0xf')]()[_0x05ed('0xc')](cmHopper[_0x05ed('0x32')](_0x2a6d78,_0x12fd0d))[_0x05ed('0xe')](loggerCatch(_0x05ed('0x33')));};exports['rescheduleContactInQueue']=function(_0x2b91d6){return BPromise[_0x05ed('0xf')]()[_0x05ed('0xc')](cmHopper[_0x05ed('0x17')](_0x2b91d6,!![],!![]))[_0x05ed('0xe')](loggerCatch(_0x05ed('0x34')));}; \ No newline at end of file +var _0xb327=['[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','exten','xcally-motion-preview','assigned','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0xb327,0x93));var _0x7b32=function(_0x473b4c,_0x3cbe6f){_0x473b4c=_0x473b4c-0x0;var _0x630b8d=_0xb327[_0x473b4c];return _0x630b8d;};'use strict';var util=require(_0x7b32('0x0'));var BPromise=require(_0x7b32('0x1'));var logger=require(_0x7b32('0x2'))('preview');var _=require(_0x7b32('0x3'));var cmHopper=require(_0x7b32('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x7b32('0x5'));var cmHopperBlack=require(_0x7b32('0x6'));var voiceQueueRt=require(_0x7b32('0x7'));var agentReportPreview=require(_0x7b32('0x8'));var voiceQueueReport=require(_0x7b32('0x9'));function loggerCatch(_0x32db88){return function(_0x22a65e){logger[_0x7b32('0xa')](_0x32db88,util['inspect'](_0x22a65e,{'showHidden':![],'depth':null}));};}function create(_0x345cc7){return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](cmHopperHistory[_0x7b32('0xd')](_0x345cc7))[_0x7b32('0xe')](loggerCatch(_0x7b32('0xf')));}function createAgent(_0x5b33aa){return BPromise[_0x7b32('0xb')]()['then'](agentReportPreview[_0x7b32('0xd')](_0x5b33aa))[_0x7b32('0xe')](loggerCatch(_0x7b32('0xf')));}function moveContact(_0x3cf9b5){return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](cmHopper[_0x7b32('0x10')](_0x3cf9b5,!![]))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x11')));}exports[_0x7b32('0x12')]=function(_0x23c551){return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](cmHopperBlack['checkIsBlackList'](_0x23c551))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x13')));};exports[_0x7b32('0x14')]=function(_0x5386ec){return BPromise['resolve']()[_0x7b32('0xc')](cmHopper[_0x7b32('0x14')](_0x5386ec))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x15')));};exports['createHistory']=function(_0xd7e8f5,_0x23eb60){create(_0xd7e8f5)['catch'](loggerCatch(_0x23eb60));moveContact(_0xd7e8f5)['catch'](loggerCatch(_0x23eb60));};exports['createAgentHistory']=function(_0x6e4a26,_0x214a61){createAgent(_0x6e4a26)[_0x7b32('0xe')](loggerCatch(_0x214a61));};exports[_0x7b32('0x16')]=function(_0x2e7c87,_0x289396){create(_0x2e7c87)[_0x7b32('0xe')](loggerCatch(_0x289396));};exports[_0x7b32('0x17')]=function(_0x422905,_0x4b7633){moveContact(_0x422905)[_0x7b32('0xe')](loggerCatch(_0x4b7633));};exports[_0x7b32('0x18')]=function(_0x3e9fba,_0x139cd1,_0x1b191f){if(_0x139cd1){_0x3e9fba[_0x7b32('0x19')]=null;}if(_0x1b191f){_0x3e9fba[_0x7b32('0x1a')]=![];}return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](cmHopper[_0x7b32('0x18')](_0x3e9fba))['catch'](loggerCatch(_0x7b32('0x1b')));};exports[_0x7b32('0x1c')]=function(_0x4a64f9){return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](cmHopper[_0x7b32('0x1c')](_0x4a64f9))[_0x7b32('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x7b32('0x1d')]=function(_0x5818da){return BPromise['resolve']()[_0x7b32('0xc')](cmHopper[_0x7b32('0x1d')]({'UserId':null},_0x5818da,0x1))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x1e')));};exports[_0x7b32('0x1f')]=function(_0x446d9b){return BPromise['resolve']()[_0x7b32('0xc')](cmHopper[_0x7b32('0x1d')]({'active':![]},_0x446d9b,0x1))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x20')));};exports[_0x7b32('0x21')]=function(_0xa9b33e){var _0x4966aa={};_0x4966aa[_0x7b32('0x22')]=_0xa9b33e[_0x7b32('0x22')];_0x4966aa[_0x7b32('0x23')]=_0xa9b33e[_0x7b32('0x23')];_0x4966aa[_0x7b32('0x24')]=_0xa9b33e[_0x7b32('0x24')];_0x4966aa[_0x7b32('0x25')]=_0xa9b33e[_0x7b32('0x25')];_0x4966aa[_0x7b32('0x26')]=_0xa9b33e['queue'];_0x4966aa['queuecallerjoinAt']=_0xa9b33e[_0x7b32('0x27')];_0x4966aa[_0x7b32('0x28')]=_0xa9b33e[_0x7b32('0x27')];_0x4966aa[_0x7b32('0x29')]=0x1;_0x4966aa[_0x7b32('0x2a')]=_0xa9b33e[_0x7b32('0x2b')];_0x4966aa['connectedlinename']=_0xa9b33e[_0x7b32('0x2c')];_0x4966aa[_0x7b32('0x2d')]='from-sip';_0x4966aa[_0x7b32('0x2e')]=_0x7b32('0x2f');_0x4966aa['holdtime']=0x0;_0x4966aa[_0x7b32('0x30')]=0x1;_0x4966aa['lastAssignedTo']=_0xa9b33e[_0x7b32('0x2c')];_0x4966aa[_0x7b32('0x31')]='COMPLETED';return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](voiceQueueReport[_0x7b32('0x32')](_0x4966aa))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x33')));};exports[_0x7b32('0x34')]=function(_0x26b396,_0x55718c){return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](cmHopper[_0x7b32('0x34')](_0x26b396,_0x55718c))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x35')));};exports[_0x7b32('0x36')]=function(_0x466bf1){return BPromise[_0x7b32('0xb')]()[_0x7b32('0xc')](cmHopper['rescheduleContact'](_0x466bf1,!![],!![]))[_0x7b32('0xe')](loggerCatch(_0x7b32('0x37')));}; \ 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 afd1e28..3392cda 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 _0x9b35=['xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','loggerError','inspect','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','calleridname','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','state','ringtime','logLookAgent','membername','talktime','answertime','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','add','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','motionChannel','voice','buildObj','interface','agentReadyId','not_inuse','status','reachable','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','scheduledat','countcongestionretry','callback','callbackuniqueid','callbackat','ContactId','UserId','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialchannel','xmd-contactid'];(function(_0x3bb3f2,_0x27951a){var _0x259f36=function(_0x1e818e){while(--_0x1e818e){_0x3bb3f2['push'](_0x3bb3f2['shift']());}};_0x259f36(++_0x27951a);}(_0x9b35,0xa8));var _0x59b3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9b35[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x59b3('0x0'));var _=require(_0x59b3('0x1'));var moment=require(_0x59b3('0x2'));var logger=require(_0x59b3('0x3'))('preview');var ipAgi=process[_0x59b3('0x4')][_0x59b3('0x5')]||_0x59b3('0x6');function getSeconds(_0xd14d9c,_0x3c789d){var _0x18c791=moment(_0xd14d9c)[_0x59b3('0x7')](0x0);var _0x232478=moment(_0x3c789d)[_0x59b3('0x7')](0x0);return _0x18c791[_0x59b3('0x8')](_0x232478,_0x59b3('0x9'));}exports[_0x59b3('0xa')]=function(_0xa7926a){return function(_0xcb45e6){logger[_0x59b3('0xb')](_0xa7926a,util['inspect'](_0xcb45e6,{'showHidden':![],'depth':null}));};};exports[_0x59b3('0xc')]=function(_0x20cddc,_0x10f919){logger[_0x59b3('0xd')](_0x20cddc,util['inspect'](_0x10f919,{'showHidden':![],'depth':null}));};exports[_0x59b3('0xe')]=function(_0x4ec67d,_0x1d08a8){logger[_0x59b3('0xb')](_0x4ec67d,util['inspect'](_0x1d08a8,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x19f19a){return function(_0x5502a9){logger[_0x59b3('0xd')](_0x19f19a,util[_0x59b3('0xf')](_0x5502a9,{'showHidden':![],'depth':null}));};};exports[_0x59b3('0x10')]=function(_0x2f1eff,_0xf6bdd4,_0x1215f5){return{'message':_0x2f1eff,'unlock':_0xf6bdd4,'active':_0x1215f5};};exports[_0x59b3('0x11')]=function(_0x240187,_0x3dfd18,_0x47763a){if(!_['isUndefined'](_0x47763a)&&_0x59b3('0x12')===typeof _0x47763a&&!_[_0x59b3('0x13')](_0x47763a)){if(!_[_0x59b3('0x14')](_0x3dfd18)&&_0x59b3('0x12')===typeof _0x3dfd18&&!_[_0x59b3('0x13')](_0x3dfd18)){return util['format'](_0x59b3('0x15'),_0x3dfd18,_0x47763a);}return util[_0x59b3('0x16')](_0x59b3('0x15'),_0x47763a,_0x47763a);}if(!_[_0x59b3('0x14')](_0x240187)&&_0x59b3('0x12')===typeof _0x240187&&!_['isEmpty'](_0x240187)){return _0x240187;}return _0x59b3('0x17');};exports[_0x59b3('0x18')]=function(_0xa3798a){if(_[_0x59b3('0x19')](_0xa3798a)){return![];}return _0xa3798a;};exports[_0x59b3('0x1a')]=function(_0x1cd1f0,_0x7b59a4,_0x16aaef,_0x2f1768,_0x59d5cf,_0x1ef3c7){var _0x1281ac={'XMD-QUEUE':_0x7b59a4['Queue']?_0x7b59a4['Queue']['name']:'','XMD-CALLERID':_0x2f1768,'XMD-CALLERID-PREVIEW':_0x1ef3c7?util[_0x59b3('0x16')]('\x22%s\x22\x20<%s>',_0x1ef3c7[_0x59b3('0x1b')],_0x1ef3c7['calleridnum']):_0x2f1768,'XMD-DIALID':_0x59d5cf,'XMD-CONTACTID':_0x7b59a4['ContactId'],'XMD-CDRTYPE':_0x59b3('0x1c'),'CALLERID(all)':_0x2f1768,'XMD-VOICEQUEUEID':_0x7b59a4['VoiceQueueId'],'XMD-DIALCHANNEL':_0x16aaef,'XMD-DIALTIMEOUT':_0x1cd1f0[_0x59b3('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x59b3('0x16')](_0x59b3('0x1e'),_0x1cd1f0['dialQueueProject2']?'g':'',_[_0x59b3('0x13')](_0x1cd1f0[_0x59b3('0x1f')])?'':_0x59b3('0x20')),'XMD-DIALURL':_0x1cd1f0[_0x59b3('0x21')]||'','XMD-AGI':_0x1cd1f0[_0x59b3('0x22')]?util[_0x59b3('0x16')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1cd1f0[_0x59b3('0x22')]):_0x59b3('0x23'),'XMD-AGIAFTER':_0x1cd1f0[_0x59b3('0x24')]?util['format'](_0x59b3('0x25'),ipAgi,_0x1cd1f0['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x1ef3c7?_0x1ef3c7['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1ef3c7?_0x1ef3c7[_0x59b3('0x26')]:'','XMD-DESTINATION':_0x59b3('0x27'),'SIPADDHEADER':_0x59b3('0x28')};if(!_['isEmpty'](_0x1cd1f0[_0x59b3('0x1f')])){_0x1281ac[util[_0x59b3('0x16')]('%s',_0x59b3('0x29'))]=_0x1cd1f0[_0x59b3('0x1f')];_0x1281ac[util['format']('%s',_0x59b3('0x2a'))]=_0x59d5cf;}if(_0x7b59a4&&_0x7b59a4['Contact']){for(var _0x36657a in _0x7b59a4[_0x59b3('0x2b')]){if(_0x7b59a4[_0x59b3('0x2b')][_0x59b3('0x2c')](_0x36657a)){if(!_['isNil'](_0x7b59a4[_0x59b3('0x2b')][_0x36657a])&&_0x36657a!=='id'&&_0x36657a!==_0x59b3('0x2d')&&_0x36657a!==_0x59b3('0x2e')&&_0x36657a!==_0x59b3('0x2f')){_0x1281ac[util[_0x59b3('0x16')]('%s%s',_0x59b3('0x30'),_[_0x59b3('0x31')](_0x36657a))]=_0x7b59a4[_0x59b3('0x2b')][_0x36657a];}}}}return _0x1281ac;};exports[_0x59b3('0x32')]=function(_0x3f9b8b){var _0x2cc1c9={};for(var _0x93e270 in _0x3f9b8b){if(_0x3f9b8b[_0x59b3('0x2c')](_0x93e270)){_0x2cc1c9[util[_0x59b3('0x16')]('%s',_[_0x59b3('0x33')](_0x93e270))]=_0x3f9b8b[_0x93e270];}}return{'variables':_0x2cc1c9};};exports[_0x59b3('0x34')]=function(_0x2e5c81,_0x4de217){if(!_['isNil'](_0x2e5c81)){if(_0x2e5c81[_0x59b3('0x2c')](_0x59b3('0x35'))){if(_0x2e5c81[_0x59b3('0x35')]>0x0){_0x2e5c81[_0x59b3('0x35')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4de217);}}}else{logger[_0x59b3('0xb')](_0x59b3('0x36'),_0x4de217);}};exports[_0x59b3('0x37')]=function(_0x4eef12){var _0x2a24f3=moment()[_0x59b3('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0x4eef12['state']=0xd;_0x4eef12[_0x59b3('0x38')]=_0x59b3('0x39');_0x4eef12[_0x59b3('0x3a')]=_0x2a24f3;_0x4eef12[_0x59b3('0x3b')]=_0x2a24f3;_0x4eef12[_0x59b3('0x3c')]=_0x2a24f3;};exports['logAgent']=function(_0x2dabfc,_0x5cc180,_0x58fc31){var _0x2323c1=moment()['format'](_0x59b3('0x3d'));_0x2dabfc[_0x59b3('0x3e')]=_0x5cc180;_0x2dabfc[_0x59b3('0x38')]=_0x58fc31;_0x2dabfc[_0x59b3('0x3b')]=_0x2323c1;_0x2dabfc[_0x59b3('0x3f')]=getSeconds(_0x2dabfc[_0x59b3('0x3b')],_0x2dabfc['starttime']);};exports[_0x59b3('0x40')]=function(_0x4817b9,_0x1c7b0e,_0x289cb6){_0x4817b9[_0x59b3('0x41')]=_0x1c7b0e;_0x4817b9['UserId']=_0x289cb6;};exports['logCustomer']=function(_0xb0d863,_0x3d9a19,_0x29775c){var _0x436c85=moment()[_0x59b3('0x16')](_0x59b3('0x3d'));_0xb0d863['state']=_0x3d9a19;_0xb0d863[_0x59b3('0x38')]=_0x29775c;_0xb0d863['responsetime']=_0xb0d863[_0x59b3('0x3b')]?_0xb0d863[_0x59b3('0x3b')]:_0x436c85;_0xb0d863[_0x59b3('0x3c')]=_0xb0d863[_0x59b3('0x3c')]?_0xb0d863[_0x59b3('0x3c')]:_0x436c85;_0xb0d863[_0x59b3('0x3f')]=getSeconds(_0xb0d863['responsetime']||0x0,_0xb0d863['starttime']||0x0);_0xb0d863[_0x59b3('0x42')]=_0xb0d863[_0x59b3('0x43')]?getSeconds(_0xb0d863[_0x59b3('0x3c')],_0xb0d863[_0x59b3('0x43')]):0x0;};exports['isFailure']=function(_0x3c720a){return _0x3c720a===_0x59b3('0x44');};exports[_0x59b3('0x45')]=function(_0x302e73,_0x2d574d,_0x461c4f,_0x84ecc8,_0x36beda){var _0x4ebf0f=_0x84ecc8?'RECALL':_0x302e73[_0x59b3('0x1b')];_0x4ebf0f=_0x36beda?_0x59b3('0x46'):_0x4ebf0f;return{'actionid':_0x302e73[_0x59b3('0x47')],'action':_0x59b3('0x48'),'channel':_0x302e73[_0x59b3('0x49')],'callerid':util[_0x59b3('0x16')](_0x59b3('0x15'),_0x4ebf0f,_0x302e73[_0x59b3('0x4a')]),'Exten':'xcally-motion-preview','Context':_0x59b3('0x4b'),'Priority':'1','variable':_0x461c4f,'timeout':(_0x2d574d['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x302e73[_0x59b3('0x47')]};};exports[_0x59b3('0x4c')]=function(_0x16ec45){return _0x16ec45[_0x59b3('0x4d')]+_0x16ec45['countcongestionretry']+_0x16ec45[_0x59b3('0x4e')]+_0x16ec45[_0x59b3('0x4f')]+_0x16ec45['countnosuchnumberretry'];};exports[_0x59b3('0x50')]=function(_0x6e6759){var _0x2364ff=_[_0x59b3('0x51')](_0x6e6759);_0x2364ff[_0x59b3('0x3e')]=0xf;_0x2364ff[_0x59b3('0x38')]=_0x59b3('0x52');return _0x2364ff;};exports[_0x59b3('0x53')]=function(_0xa4d8ff,_0x4ce8a9,_0x16e28e){var _0x352b00={};_0x352b00[_0x4ce8a9]=_0xa4d8ff[_0x4ce8a9];_0x352b00['active']=![];_0x352b00['scheduledat']=moment()[_0x59b3('0x54')](_0x16e28e,_0x59b3('0x55'))[_0x59b3('0x16')](_0x59b3('0x3d'));_0x352b00['ContactId']=_0xa4d8ff['ContactId'];_0x352b00[_0x59b3('0x56')]=_0xa4d8ff['ListId'];_0x352b00[_0x59b3('0x57')]=_0xa4d8ff[_0x59b3('0x57')]||undefined;return _0x352b00;};exports['decrementTalkink']=function(_0x1202b6,_0x275931){if(!_[_0x59b3('0x19')](_0x1202b6)){if(_0x1202b6[_0x59b3('0x58')]>0x0){_0x1202b6[_0x59b3('0x58')]-=0x1;}else{logger['error'](_0x275931,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x59b3('0xb')](_0x275931,_0x59b3('0x59'));}};exports[_0x59b3('0x5a')]=function(_0x5814c6){if(_0x5814c6<=0x0){return!![];}return![];};function buildObj(_0xb45a2b,_0x4dd852,_0x53137f){_0xb45a2b[_0x59b3('0x5b')]=_0x4dd852;_0xb45a2b[_0x59b3('0x5c')]=_0xb45a2b[_0x59b3('0x5d')];_0xb45a2b['interface']=_0xb45a2b[_0x59b3('0x49')];_0xb45a2b[_0x59b3('0x5e')]=_0x59b3('0x5f');if(_0x53137f){_0xb45a2b['mandatoryDisposition']=_0x53137f['mandatoryDisposition'];}return _0xb45a2b;}exports[_0x59b3('0x60')]=buildObj;exports['buildAcw']=function(_0x5a89b8){var _0x34221f={};_0x34221f[_0x59b3('0x5d')]=_0x5a89b8[_0x59b3('0x5d')];_0x34221f[_0x59b3('0x61')]=_0x5a89b8[_0x59b3('0x49')];_0x34221f[_0x59b3('0x47')]=_0x5a89b8[_0x59b3('0x47')];return _0x34221f;};exports[_0x59b3('0x62')]=function(_0x57ef02){var _0x32c739=[];for(var _0x1fc5e5 in _0x57ef02){if(_0x57ef02[_0x59b3('0x2c')](_0x1fc5e5)){if(!_[_0x59b3('0x19')](_0x57ef02[_0x1fc5e5])&&_0x57ef02[_0x1fc5e5]['state']===_0x59b3('0x63')&&_0x57ef02[_0x1fc5e5][_0x59b3('0x64')]===_0x59b3('0x65')){_0x32c739['push'](_0x57ef02[_0x1fc5e5]['id']);}}}return _0x32c739;};exports['getDiff']=function(_0x3e1759){var _0x227e3a=moment()[_0x59b3('0x7')](0x0);var _0x359ee8=moment(_0x3e1759)['milliseconds'](0x0);return _0x227e3a[_0x59b3('0x8')](_0x359ee8,'seconds');};exports[_0x59b3('0x66')]=function(_0x571b41){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x571b41['ContactId'],'ListId':_0x571b41[_0x59b3('0x56')],'VoiceQueueId':_0x571b41[_0x59b3('0x57')]||undefined,'CampaignId':_0x571b41[_0x59b3('0x67')]||undefined};};exports[_0x59b3('0x68')]=function(_0x1b8f56){if(_0x1b8f56===_0x59b3('0x47')||_0x1b8f56===_0x59b3('0x69')||_0x1b8f56===_0x59b3('0x5d')||_0x1b8f56===_0x59b3('0x6a')||_0x1b8f56===_0x59b3('0x6b')||_0x1b8f56===_0x59b3('0x6c')||_0x1b8f56==='membername'||_0x1b8f56===_0x59b3('0x49')||_0x1b8f56===_0x59b3('0x1b')||_0x1b8f56===_0x59b3('0x6d')||_0x1b8f56===_0x59b3('0x4a')||_0x1b8f56===_0x59b3('0x6e')||_0x1b8f56==='countbusyretry'||_0x1b8f56===_0x59b3('0x6f')||_0x1b8f56===_0x59b3('0x4e')||_0x1b8f56==='countglobal'||_0x1b8f56===_0x59b3('0x70')||_0x1b8f56===_0x59b3('0x71')||_0x1b8f56===_0x59b3('0x72')||_0x1b8f56==='recallme'||_0x1b8f56===_0x59b3('0x73')||_0x1b8f56===_0x59b3('0x56')||_0x1b8f56===_0x59b3('0x74')||_0x1b8f56==='VoiceQueueId'||_0x1b8f56===_0x59b3('0x75')||_0x1b8f56==='xmd-voicequeueid'||_0x1b8f56===_0x59b3('0x76')||_0x1b8f56===_0x59b3('0x77')||_0x1b8f56===_0x59b3('0x78')||_0x1b8f56===_0x59b3('0x79')||_0x1b8f56==='xmd-dialtimeout'||_0x1b8f56==='xmd-dialoptions'||_0x1b8f56==='xmd-dialid'||_0x1b8f56===_0x59b3('0x7a')||_0x1b8f56===_0x59b3('0x7b')||_0x1b8f56===_0x59b3('0x7c')||_0x1b8f56===_0x59b3('0x7d')||_0x1b8f56===_0x59b3('0x7e')||_0x1b8f56===_0x59b3('0x7f')||_0x1b8f56==='rtpaudioqos'||_0x1b8f56===_0x59b3('0x80')||_0x1b8f56==='rtpaudioqosjitter'||_0x1b8f56===_0x59b3('0x81')||_0x1b8f56==='rtpaudioqosloss'||_0x1b8f56===_0x59b3('0x82')||_0x1b8f56===_0x59b3('0x83')||_0x1b8f56===_0x59b3('0x84')||_0x1b8f56==='rtpaudioqos'||_0x1b8f56===_0x59b3('0x80')||_0x1b8f56===_0x59b3('0x85')||_0x1b8f56===_0x59b3('0x81')||_0x1b8f56==='rtpaudioqosloss'||_0x1b8f56==='rtpaudioqoslossbridged'||_0x1b8f56===_0x59b3('0x83')||_0x1b8f56===_0x59b3('0x84')||_0x1b8f56==='bridgepeer'||_0x1b8f56===_0x59b3('0x86')||_0x1b8f56===_0x59b3('0x3e')||_0x1b8f56===_0x59b3('0x38')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2eb8ec,_0x39b1bd){var _0x48b77f,_0x4700e3,_0x2ce0a2;if(_0x39b1bd<=0x0){_0x39b1bd=0x1;}_0x48b77f=new RegExp(_0x59b3('0x87')+_0x39b1bd+'}$');_0x4700e3=Math[_0x59b3('0x88')](0xa,_0x39b1bd-0x1);_0x2ce0a2=Math[_0x59b3('0x88')](0xa,_0x39b1bd)-0x1;return util[_0x59b3('0x16')]('%s',_[_0x59b3('0x89')](_0x2eb8ec,_0x48b77f,_[_0x59b3('0x8a')](_0x4700e3,_0x2ce0a2)));};exports[_0x59b3('0x8b')]=function(_0x3ce68d){var _0x1c1e36=_0x3ce68d[_0x59b3('0x8c')](/"(.*?)"/);return _0x1c1e36?_0x1c1e36[0x1]:_0x3ce68d;};exports[_0x59b3('0x8d')]=function(_0x2ef131){var _0x55f6e3=_0x2ef131[_0x59b3('0x8c')](/<(.*?)>/);return _0x55f6e3?_0x55f6e3[0x1]:_0x2ef131;};function buildNoAnswerEventPayload(_0x46895f,_0xe7f58f){var _0x39d57f=buildObj(_0x46895f,_0x59b3('0x8e'));if(!_['isEmpty'](_0xe7f58f['variables'])){Object[_0x59b3('0x8f')](_0xe7f58f[_0x59b3('0x90')])['forEach'](function(_0x2d9db1){_0x39d57f[_0x2d9db1['toLowerCase']()]=_0xe7f58f[_0x59b3('0x90')][_0x2d9db1];});}return _0x39d57f;}exports[_0x59b3('0x91')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xddfd=['milliseconds','seconds','error','logger','inspect','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','dialer','monitor_format','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','Contact','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','ringtime','starttime','logLookAgent','membername','talktime','answertime','isFailure','Failure','originate','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','status','reachable','push','getDiff','diff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','active','calleridnum','countglobal','callback','callbackat','UserId','VoiceQueueId','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','127.0.0.1'];(function(_0x3e4e3a,_0x5eadf1){var _0x3ae45b=function(_0x32aaec){while(--_0x32aaec){_0x3e4e3a['push'](_0x3e4e3a['shift']());}};_0x3ae45b(++_0x5eadf1);}(_0xddfd,0x1ac));var _0xdddf=function(_0x1b46f6,_0x3aa7bb){_0x1b46f6=_0x1b46f6-0x0;var _0x1729eb=_0xddfd[_0x1b46f6];return _0x1729eb;};'use strict';var util=require(_0xdddf('0x0'));var _=require(_0xdddf('0x1'));var moment=require(_0xdddf('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xdddf('0x3');function getSeconds(_0x3efd10,_0x2a4d0a){var _0xe2c4f6=moment(_0x3efd10)['milliseconds'](0x0);var _0x4de776=moment(_0x2a4d0a)[_0xdddf('0x4')](0x0);return _0xe2c4f6['diff'](_0x4de776,_0xdddf('0x5'));}exports['loggerCatch']=function(_0x4b5dea){return function(_0xfb33e0){logger[_0xdddf('0x6')](_0x4b5dea,util['inspect'](_0xfb33e0,{'showHidden':![],'depth':null}));};};exports[_0xdddf('0x7')]=function(_0x1b4bc9,_0x36a6e0){logger['info'](_0x1b4bc9,util[_0xdddf('0x8')](_0x36a6e0,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4b9808,_0x159434){logger[_0xdddf('0x6')](_0x4b9808,util['inspect'](_0x159434,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1b5f5c){return function(_0x41d10c){logger[_0xdddf('0x9')](_0x1b5f5c,util[_0xdddf('0x8')](_0x41d10c,{'showHidden':![],'depth':null}));};};exports[_0xdddf('0xa')]=function(_0x565696,_0x12c7b7,_0x4ba8e6){return{'message':_0x565696,'unlock':_0x12c7b7,'active':_0x4ba8e6};};exports[_0xdddf('0xb')]=function(_0x4c1f0e,_0x38ebda,_0x7d6fa4){if(!_[_0xdddf('0xc')](_0x7d6fa4)&&_0xdddf('0xd')===typeof _0x7d6fa4&&!_[_0xdddf('0xe')](_0x7d6fa4)){if(!_['isUndefined'](_0x38ebda)&&_0xdddf('0xd')===typeof _0x38ebda&&!_[_0xdddf('0xe')](_0x38ebda)){return util['format']('\x22%s\x22\x20<%s>',_0x38ebda,_0x7d6fa4);}return util[_0xdddf('0xf')]('\x22%s\x22\x20<%s>',_0x7d6fa4,_0x7d6fa4);}if(!_[_0xdddf('0xc')](_0x4c1f0e)&&'string'===typeof _0x4c1f0e&&!_['isEmpty'](_0x4c1f0e)){return _0x4c1f0e;}return _0xdddf('0x10');};exports[_0xdddf('0x11')]=function(_0x4fd4fd){if(_[_0xdddf('0x12')](_0x4fd4fd)){return![];}return _0x4fd4fd;};exports[_0xdddf('0x13')]=function(_0x5c5385,_0x1c5268,_0xfef6b7,_0x501d80,_0x1042ae,_0x185a04){var _0x39751d={'XMD-QUEUE':_0x1c5268[_0xdddf('0x14')]?_0x1c5268[_0xdddf('0x14')][_0xdddf('0x15')]:'','XMD-CALLERID':_0x501d80,'XMD-CALLERID-PREVIEW':_0x185a04?util[_0xdddf('0xf')](_0xdddf('0x16'),_0x185a04[_0xdddf('0x17')],_0x185a04['calleridnum']):_0x501d80,'XMD-DIALID':_0x1042ae,'XMD-CONTACTID':_0x1c5268['ContactId'],'XMD-CDRTYPE':_0xdddf('0x18'),'CALLERID(all)':_0x501d80,'XMD-VOICEQUEUEID':_0x1c5268['VoiceQueueId'],'XMD-DIALCHANNEL':_0xfef6b7,'XMD-DIALTIMEOUT':_0x5c5385['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x5c5385['dialQueueProject2']?'g':'',_[_0xdddf('0xe')](_0x5c5385[_0xdddf('0x19')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5c5385[_0xdddf('0x1a')]||'','XMD-AGI':_0x5c5385[_0xdddf('0x1b')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5c5385[_0xdddf('0x1b')]):_0xdddf('0x1c'),'XMD-AGIAFTER':_0x5c5385[_0xdddf('0x1d')]?util[_0xdddf('0xf')](_0xdddf('0x1e'),ipAgi,_0x5c5385[_0xdddf('0x1d')]):_0xdddf('0x1c'),'XMD-ORIGINATECALLERIDNUM':_0x185a04?_0x185a04[_0xdddf('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x185a04?_0x185a04['originatecalleridname']:'','XMD-DESTINATION':_0xdddf('0x20'),'SIPADDHEADER':_0xdddf('0x21')};if(!_['isEmpty'](_0x5c5385[_0xdddf('0x19')])){_0x39751d[util[_0xdddf('0xf')]('%s',_0xdddf('0x22'))]=_0x5c5385['monitor_format'];_0x39751d[util['format']('%s',_0xdddf('0x23'))]=_0x1042ae;}if(_0x1c5268&&_0x1c5268['Contact']){for(var _0x35f7e8 in _0x1c5268['Contact']){if(_0x1c5268['Contact'][_0xdddf('0x24')](_0x35f7e8)){if(!_[_0xdddf('0x12')](_0x1c5268[_0xdddf('0x25')][_0x35f7e8])&&_0x35f7e8!=='id'&&_0x35f7e8!=='tags'&&_0x35f7e8!==_0xdddf('0x26')&&_0x35f7e8!=='updatedAt'){_0x39751d[util[_0xdddf('0xf')](_0xdddf('0x27'),_0xdddf('0x28'),_[_0xdddf('0x29')](_0x35f7e8))]=_0x1c5268[_0xdddf('0x25')][_0x35f7e8];}}}}return _0x39751d;};exports[_0xdddf('0x2a')]=function(_0x45298b){var _0x50f9e9={};for(var _0x40dd3a in _0x45298b){if(_0x45298b[_0xdddf('0x24')](_0x40dd3a)){_0x50f9e9[util[_0xdddf('0xf')]('%s',_[_0xdddf('0x2b')](_0x40dd3a))]=_0x45298b[_0x40dd3a];}}return{'variables':_0x50f9e9};};exports[_0xdddf('0x2c')]=function(_0x52dc90,_0x5c33ee){if(!_['isNil'](_0x52dc90)){if(_0x52dc90[_0xdddf('0x24')](_0xdddf('0x2d'))){if(_0x52dc90[_0xdddf('0x2d')]>0x0){_0x52dc90[_0xdddf('0x2d')]-=0x1;}else{logger[_0xdddf('0x6')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5c33ee);}}}else{logger[_0xdddf('0x6')](_0xdddf('0x2e'),_0x5c33ee);}};exports[_0xdddf('0x2f')]=function(_0x5a9b70){var _0x2b12ae=moment()[_0xdddf('0xf')](_0xdddf('0x30'));_0x5a9b70[_0xdddf('0x31')]=0xd;_0x5a9b70[_0xdddf('0x32')]='Blacklist';_0x5a9b70['starttime']=_0x2b12ae;_0x5a9b70[_0xdddf('0x33')]=_0x2b12ae;_0x5a9b70[_0xdddf('0x34')]=_0x2b12ae;};exports['logAgent']=function(_0x551cda,_0x5b69ed,_0x3301db){var _0x9070bd=moment()[_0xdddf('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x551cda[_0xdddf('0x31')]=_0x5b69ed;_0x551cda['statedesc']=_0x3301db;_0x551cda[_0xdddf('0x33')]=_0x9070bd;_0x551cda[_0xdddf('0x35')]=getSeconds(_0x551cda[_0xdddf('0x33')],_0x551cda[_0xdddf('0x36')]);};exports[_0xdddf('0x37')]=function(_0x113228,_0x15f3b2,_0x1be3d9){_0x113228[_0xdddf('0x38')]=_0x15f3b2;_0x113228['UserId']=_0x1be3d9;};exports['logCustomer']=function(_0x44b326,_0x4b7096,_0x57028a){var _0x27e162=moment()['format'](_0xdddf('0x30'));_0x44b326['state']=_0x4b7096;_0x44b326[_0xdddf('0x32')]=_0x57028a;_0x44b326['responsetime']=_0x44b326[_0xdddf('0x33')]?_0x44b326[_0xdddf('0x33')]:_0x27e162;_0x44b326['endtime']=_0x44b326[_0xdddf('0x34')]?_0x44b326[_0xdddf('0x34')]:_0x27e162;_0x44b326['ringtime']=getSeconds(_0x44b326[_0xdddf('0x33')]||0x0,_0x44b326[_0xdddf('0x36')]||0x0);_0x44b326[_0xdddf('0x39')]=_0x44b326[_0xdddf('0x3a')]?getSeconds(_0x44b326[_0xdddf('0x34')],_0x44b326['answertime']):0x0;};exports[_0xdddf('0x3b')]=function(_0x58dfa0){return _0x58dfa0===_0xdddf('0x3c');};exports['variablesAction']=function(_0x4dcaf0,_0x19864f,_0x559c5e,_0x1836e9,_0x6ed720){var _0x37b913=_0x1836e9?'RECALL':_0x4dcaf0[_0xdddf('0x17')];_0x37b913=_0x6ed720?'BOOKED':_0x37b913;return{'actionid':_0x4dcaf0['uniqueid'],'action':_0xdddf('0x3d'),'channel':_0x4dcaf0['channelAgent'],'callerid':util[_0xdddf('0xf')](_0xdddf('0x16'),_0x37b913,_0x4dcaf0['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xdddf('0x3e'),'Priority':'1','variable':_0x559c5e,'timeout':(_0x19864f[_0xdddf('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4dcaf0[_0xdddf('0x40')]};};exports[_0xdddf('0x41')]=function(_0x3c2bd1){return _0x3c2bd1[_0xdddf('0x42')]+_0x3c2bd1[_0xdddf('0x43')]+_0x3c2bd1[_0xdddf('0x44')]+_0x3c2bd1[_0xdddf('0x45')]+_0x3c2bd1['countnosuchnumberretry'];};exports[_0xdddf('0x46')]=function(_0x4318ac){var _0x25912d=_[_0xdddf('0x47')](_0x4318ac);_0x25912d[_0xdddf('0x31')]=0xf;_0x25912d[_0xdddf('0x32')]=_0xdddf('0x48');return _0x25912d;};exports[_0xdddf('0x49')]=function(_0x282378,_0x2a07aa,_0x50e545){var _0x7cac25={};_0x7cac25[_0x2a07aa]=_0x282378[_0x2a07aa];_0x7cac25['active']=![];_0x7cac25[_0xdddf('0x4a')]=moment()[_0xdddf('0x4b')](_0x50e545,_0xdddf('0x4c'))[_0xdddf('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x7cac25['ContactId']=_0x282378[_0xdddf('0x4d')];_0x7cac25['ListId']=_0x282378[_0xdddf('0x4e')];_0x7cac25['VoiceQueueId']=_0x282378['VoiceQueueId']||undefined;return _0x7cac25;};exports[_0xdddf('0x4f')]=function(_0x1afbb2,_0x34b691){if(!_[_0xdddf('0x12')](_0x1afbb2)){if(_0x1afbb2[_0xdddf('0x50')]>0x0){_0x1afbb2['pTalking']-=0x1;}else{logger[_0xdddf('0x6')](_0x34b691,_0xdddf('0x51'));}}else{logger[_0xdddf('0x6')](_0x34b691,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x3752bb){if(_0x3752bb<=0x0){return!![];}return![];};function buildObj(_0x306ad3,_0x54ffa2,_0x5d2c03){_0x306ad3[_0xdddf('0x52')]=_0x54ffa2;_0x306ad3[_0xdddf('0x15')]=_0x306ad3[_0xdddf('0x53')];_0x306ad3[_0xdddf('0x54')]=_0x306ad3[_0xdddf('0x55')];_0x306ad3[_0xdddf('0x56')]=_0xdddf('0x57');if(_0x5d2c03){_0x306ad3[_0xdddf('0x58')]=_0x5d2c03['mandatoryDisposition'];}return _0x306ad3;}exports[_0xdddf('0x59')]=buildObj;exports[_0xdddf('0x5a')]=function(_0xe4d857){var _0x1e9f7a={};_0x1e9f7a[_0xdddf('0x53')]=_0xe4d857[_0xdddf('0x53')];_0x1e9f7a['interface']=_0xe4d857[_0xdddf('0x55')];_0x1e9f7a[_0xdddf('0x40')]=_0xe4d857[_0xdddf('0x40')];return _0x1e9f7a;};exports[_0xdddf('0x5b')]=function(_0x445101){var _0x134037=[];for(var _0x69ebac in _0x445101){if(_0x445101[_0xdddf('0x24')](_0x69ebac)){if(!_['isNil'](_0x445101[_0x69ebac])&&_0x445101[_0x69ebac][_0xdddf('0x31')]==='not_inuse'&&_0x445101[_0x69ebac][_0xdddf('0x5c')]===_0xdddf('0x5d')){_0x134037[_0xdddf('0x5e')](_0x445101[_0x69ebac]['id']);}}}return _0x134037;};exports[_0xdddf('0x5f')]=function(_0x50d5f5){var _0x454795=moment()[_0xdddf('0x4')](0x0);var _0x2ea624=moment(_0x50d5f5)['milliseconds'](0x0);return _0x454795[_0xdddf('0x60')](_0x2ea624,_0xdddf('0x5'));};exports[_0xdddf('0x61')]=function(_0x3ee044){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3ee044[_0xdddf('0x4d')],'ListId':_0x3ee044[_0xdddf('0x4e')],'VoiceQueueId':_0x3ee044['VoiceQueueId']||undefined,'CampaignId':_0x3ee044['CampaignId']||undefined};};exports[_0xdddf('0x62')]=function(_0x20c469){if(_0x20c469===_0xdddf('0x40')||_0x20c469===_0xdddf('0x63')||_0x20c469===_0xdddf('0x53')||_0x20c469===_0xdddf('0x64')||_0x20c469===_0xdddf('0x65')||_0x20c469===_0xdddf('0x66')||_0x20c469===_0xdddf('0x38')||_0x20c469===_0xdddf('0x55')||_0x20c469==='calleridname'||_0x20c469===_0xdddf('0x67')||_0x20c469===_0xdddf('0x68')||_0x20c469===_0xdddf('0x4a')||_0x20c469==='countbusyretry'||_0x20c469===_0xdddf('0x43')||_0x20c469===_0xdddf('0x44')||_0x20c469===_0xdddf('0x69')||_0x20c469===_0xdddf('0x6a')||_0x20c469==='callbackuniqueid'||_0x20c469===_0xdddf('0x6b')||_0x20c469==='recallme'||_0x20c469===_0xdddf('0x4d')||_0x20c469===_0xdddf('0x4e')||_0x20c469===_0xdddf('0x6c')||_0x20c469===_0xdddf('0x6d')||_0x20c469===_0xdddf('0x6e')||_0x20c469==='xmd-voicequeueid'||_0x20c469===_0xdddf('0x6f')||_0x20c469===_0xdddf('0x70')||_0x20c469===_0xdddf('0x71')||_0x20c469===_0xdddf('0x72')||_0x20c469===_0xdddf('0x73')||_0x20c469===_0xdddf('0x74')||_0x20c469===_0xdddf('0x75')||_0x20c469===_0xdddf('0x76')||_0x20c469===_0xdddf('0x77')||_0x20c469===_0xdddf('0x78')||_0x20c469===_0xdddf('0x79')||_0x20c469===_0xdddf('0x7a')||_0x20c469===_0xdddf('0x7b')||_0x20c469==='rtpaudioqos'||_0x20c469==='rtpaudioqosbridged'||_0x20c469===_0xdddf('0x7c')||_0x20c469==='rtpaudioqosjitterbridged'||_0x20c469===_0xdddf('0x7d')||_0x20c469===_0xdddf('0x7e')||_0x20c469===_0xdddf('0x7f')||_0x20c469===_0xdddf('0x80')||_0x20c469===_0xdddf('0x81')||_0x20c469===_0xdddf('0x82')||_0x20c469===_0xdddf('0x7c')||_0x20c469==='rtpaudioqosjitterbridged'||_0x20c469===_0xdddf('0x7d')||_0x20c469===_0xdddf('0x7e')||_0x20c469===_0xdddf('0x7f')||_0x20c469===_0xdddf('0x80')||_0x20c469===_0xdddf('0x83')||_0x20c469==='bridgepvtcallid'||_0x20c469===_0xdddf('0x31')||_0x20c469===_0xdddf('0x32')){return![];}return!![];};exports[_0xdddf('0x84')]=function(_0x2d0552,_0x310ab4){var _0x5b1443,_0x15eb17,_0x392395;if(_0x310ab4<=0x0){_0x310ab4=0x1;}_0x5b1443=new RegExp(_0xdddf('0x85')+_0x310ab4+'}$');_0x15eb17=Math[_0xdddf('0x86')](0xa,_0x310ab4-0x1);_0x392395=Math[_0xdddf('0x86')](0xa,_0x310ab4)-0x1;return util[_0xdddf('0xf')]('%s',_[_0xdddf('0x87')](_0x2d0552,_0x5b1443,_[_0xdddf('0x88')](_0x15eb17,_0x392395)));};exports['extractCalleridName']=function(_0x57238b){var _0x256d6c=_0x57238b[_0xdddf('0x89')](/"(.*?)"/);return _0x256d6c?_0x256d6c[0x1]:_0x57238b;};exports[_0xdddf('0x8a')]=function(_0x39cbe2){var _0x396d2b=_0x39cbe2[_0xdddf('0x89')](/<(.*?)>/);return _0x396d2b?_0x396d2b[0x1]:_0x39cbe2;};function buildNoAnswerEventPayload(_0xe2386b,_0x47d3b2){var _0x37daeb=buildObj(_0xe2386b,_0xdddf('0x8b'));if(!_[_0xdddf('0xe')](_0x47d3b2['variables'])){Object['keys'](_0x47d3b2[_0xdddf('0x8c')])[_0xdddf('0x8d')](function(_0x28ff33){_0x37daeb[_0x28ff33[_0xdddf('0x8e')]()]=_0x47d3b2[_0xdddf('0x8c')][_0x28ff33];});}return _0x37daeb;}exports[_0xdddf('0x8f')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2e8375e..6d27462 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 _0xb8bd=['reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove'];(function(_0x5dcbc2,_0xa09c7f){var _0x20f2ba=function(_0x49aada){while(--_0x49aada){_0x5dcbc2['push'](_0x5dcbc2['shift']());}};_0x20f2ba(++_0xa09c7f);}(_0xb8bd,0x100));var _0xdb8b=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xb8bd[_0x2f45ea];return _0x485a84;};'use strict';exports[_0xdb8b('0x0')]={'queue':{'type':_0xdb8b('0x1'),'required':!![]},'interface':{'type':_0xdb8b('0x1'),'required':!![]},'membername':{'type':_0xdb8b('0x1'),'required':!![]},'penalty':{'type':_0xdb8b('0x2'),'required':![]},'paused':{'type':_0xdb8b('0x3'),'required':![]}};exports[_0xdb8b('0x4')]={'queue':{'type':_0xdb8b('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xdb8b('0x1'),'required':![]}};exports[_0xdb8b('0x5')]={'module':{'type':_0xdb8b('0x1'),'required':![]}};exports[_0xdb8b('0x6')]={'uniqueid':{'type':_0xdb8b('0x1'),'required':!![]}};exports[_0xdb8b('0x7')]={'uniqueid':{'type':_0xdb8b('0x1'),'required':!![]},'filename':{'type':_0xdb8b('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xdb8b('0x1'),'required':!![]}};exports[_0xdb8b('0x8')]={'uniqueid':{'type':_0xdb8b('0x1'),'required':!![]},'exten':{'type':_0xdb8b('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xec73=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queuepause','reload','voicequeuechannel'];(function(_0x315dd9,_0x54136b){var _0x1f9902=function(_0x33bba1){while(--_0x33bba1){_0x315dd9['push'](_0x315dd9['shift']());}};_0x1f9902(++_0x54136b);}(_0xec73,0x1c5));var _0x3ec7=function(_0x21992f,_0x182818){_0x21992f=_0x21992f-0x0;var _0x4d2bc1=_0xec73[_0x21992f];return _0x4d2bc1;};'use strict';exports[_0x3ec7('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x3ec7('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x3ec7('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x3ec7('0x1'),'required':!![]}};exports[_0x3ec7('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x3ec7('0x1'),'required':![]}};exports[_0x3ec7('0x4')]={'module':{'type':_0x3ec7('0x1'),'required':![]}};exports[_0x3ec7('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x3ec7('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x3ec7('0x1')},'format':{'type':_0x3ec7('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x3ec7('0x7')]={'uniqueid':{'type':_0x3ec7('0x1'),'required':!![]}};exports[_0x3ec7('0x8')]={'uniqueid':{'type':_0x3ec7('0x1'),'required':!![]},'exten':{'type':_0x3ec7('0x1'),'required':!![]},'context':{'type':_0x3ec7('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index f1daf96..49414b9 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 _0xfe39=['initFaxAccounts','faxAccounts','exports','util','lodash','../model/agent','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','timers','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','SIP/%s','name','isNil','interface','hasOwnProperty','total','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','answered','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTelephones','format','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','templates','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfe39[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0x9fe3('0x0'));var _=require(_0x9fe3('0x1'));var moment=require('moment');var Agent=require(_0x9fe3('0x2'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x9fe3('0x3'));var Trigger=require(_0x9fe3('0x4'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x9fe3('0x5'));var ZendeskAccount=require(_0x9fe3('0x6'));var SalesforceAccount=require(_0x9fe3('0x7'));var FreshdeskAccount=require(_0x9fe3('0x8'));var SugarcrmAccount=require(_0x9fe3('0x9'));var ZohoAccount=require(_0x9fe3('0xa'));var DeskAccount=require(_0x9fe3('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x9fe3('0xc'));var Dynamics365Account=require(_0x9fe3('0xd'));var FreshsalesAccount=require(_0x9fe3('0xe'));var FaxAccount=require(_0x9fe3('0xf'));var Realtime=function(){this[_0x9fe3('0x10')]={};this[_0x9fe3('0x11')]={};this['trunks']={};this['voiceQueues']={};this[_0x9fe3('0x12')]={};this[_0x9fe3('0x13')]={};this['templates']={};this[_0x9fe3('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9fe3('0x15')]={};this[_0x9fe3('0x16')]={};this[_0x9fe3('0x17')]={};this['outboundChannels']={};this[_0x9fe3('0x18')]={};this[_0x9fe3('0x19')]={};this[_0x9fe3('0x1a')]={};this[_0x9fe3('0x1b')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x9fe3('0x1c')]={};this[_0x9fe3('0x1d')]={};this[_0x9fe3('0x1e')]={};this[_0x9fe3('0x1f')]={};this[_0x9fe3('0x20')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x207eef,_0x2a4567,_0x1fe7bf){var _0x2d28d4=_['mapKeys'](_0x207eef,function(_0xd7141a,_0x22b06c){return _0xd7141a[_0x1fe7bf];});for(var _0x15fcaa in _0x2a4567){if(_0x2a4567['hasOwnProperty'](_0x15fcaa)){if(!_0x2d28d4[_0x15fcaa]){delete _0x2a4567[_0x15fcaa];}}}}function freeIsNotKeySip(_0x35bbaf,_0x43854c){var _0x555450=_[_0x9fe3('0x21')](_0x35bbaf,function(_0x4f272c,_0x42923c){return util['format'](_0x9fe3('0x22'),_0x4f272c[_0x9fe3('0x23')]);});for(var _0x302d5c in _0x43854c){if(_0x43854c['hasOwnProperty'](_0x302d5c)){if(!_0x555450[_0x302d5c]){delete _0x43854c[_0x302d5c];}}}}function freeIsNotKeyAgent(_0x546d06,_0x113f23){var _0x41852f=_['mapKeys'](_0x546d06,function(_0x328989,_0x2e9ae5){var _0x587e43=_[_0x9fe3('0x24')](_0x328989[_0x9fe3('0x25')])?util['format'](_0x9fe3('0x22'),_0x328989[_0x9fe3('0x23')]):_0x328989[_0x9fe3('0x25')];return _0x587e43;});for(var _0x3d80e9 in _0x113f23){if(_0x113f23[_0x9fe3('0x26')](_0x3d80e9)){if(!_0x41852f[_0x3d80e9]){delete _0x113f23[_0x3d80e9];}}}}function clearVoiceCallReports(_0x1c4665){_0x1c4665[_0x9fe3('0x27')]=0x0;_0x1c4665['answered']=0x0;_0x1c4665[_0x9fe3('0x28')]=0x0;_0x1c4665[_0x9fe3('0x29')]=0x0;_0x1c4665[_0x9fe3('0x2a')]=0x0;}function clearCampaigns(_0x3b29dd){if(!_['isEmpty'](_0x3b29dd)){for(var _0x1a4a43 in _0x3b29dd){if(_0x3b29dd[_0x9fe3('0x26')](_0x1a4a43)){_0x3b29dd[_0x1a4a43][_0x9fe3('0x2b')]=0x0;_0x3b29dd[_0x1a4a43]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x14ee5b){if(!_[_0x9fe3('0x2c')](_0x14ee5b)){for(var _0xd7447c in _0x14ee5b){if(_0x14ee5b[_0x9fe3('0x26')](_0xd7447c)){_0x14ee5b[_0xd7447c][_0x9fe3('0x27')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x2d')]=0x0;_0x14ee5b[_0xd7447c]['unmanaged']=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x2e')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x28')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x29')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x2a')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x2f')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x30')]=0x0;_0x14ee5b[_0xd7447c]['outboundBusyCallsDay']=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x31')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x32')]=0x0;_0x14ee5b[_0xd7447c]['outboundUnknownCallsDay']=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x33')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x34')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x35')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x36')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x37')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x38')]=0x0;_0x14ee5b[_0xd7447c]['outboundAnswerAgiCallsDay']=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x39')]=0x0;_0x14ee5b[_0xd7447c][_0x9fe3('0x3a')]=!![];}}}}Realtime[_0x9fe3('0x3b')]['mergeFromDatabase']=function(_0x52b927,_0x51bf5f){for(var _0x38a4db in _0x51bf5f){if(_0x52b927['hasOwnProperty'](_0x38a4db)){_0x52b927[_0x38a4db]=_0x51bf5f[_0x38a4db];}}};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x3c')]=function(){var _0x2bda46=this;return function(_0xa3f363){if(_0xa3f363){freeIsNotKeyAgent(_0xa3f363,_0x2bda46[_0x9fe3('0x10')]);for(var _0x3dc51d=0x0,_0x31ed32={},_0x2aadd5={};_0x3dc51d<_0xa3f363[_0x9fe3('0x3d')];_0x3dc51d+=0x1){_0x31ed32=_0xa3f363[_0x3dc51d];var _0x49f95f=_[_0x9fe3('0x24')](_0x31ed32['interface'])?util['format'](_0x9fe3('0x22'),_0x31ed32[_0x9fe3('0x23')]):_0x31ed32[_0x9fe3('0x25')];if(_[_0x9fe3('0x3e')](_0x2bda46['agents'][_0x49f95f])){_0x2bda46[_0x9fe3('0x10')][_0x49f95f]=new Agent(_0x31ed32);}else{_0x2bda46[_0x9fe3('0x3f')](_0x2bda46[_0x9fe3('0x10')][_0x49f95f],_0x31ed32);}}}return _0x2bda46['agents'];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x40')]=function(){var _0x1c4242=this;return function(_0x408862){if(_0x408862){freeIsNotKeySip(_0x408862,_0x1c4242['telephones']);for(var _0x1c2bbd=0x0,_0x192ca6={},_0x55ed55={};_0x1c2bbd<_0x408862['length'];_0x1c2bbd+=0x1){_0x192ca6=_0x408862[_0x1c2bbd];if(_[_0x9fe3('0x3e')](_0x1c4242['telephones'][util[_0x9fe3('0x41')](_0x9fe3('0x22'),_0x192ca6[_0x9fe3('0x23')])])){_0x1c4242[_0x9fe3('0x11')][util[_0x9fe3('0x41')](_0x9fe3('0x22'),_0x192ca6[_0x9fe3('0x23')])]=new Telephone(_0x192ca6);}else{_0x1c4242[_0x9fe3('0x3f')](_0x1c4242['telephones'][util[_0x9fe3('0x41')](_0x9fe3('0x22'),_0x192ca6[_0x9fe3('0x23')])],_0x192ca6);}}}return _0x1c4242[_0x9fe3('0x11')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x42')]=function(){var _0x154d98=this;return function(_0xe6ccc1){if(_0xe6ccc1){freeIsNotKeySip(_0xe6ccc1,_0x154d98[_0x9fe3('0x43')]);for(var _0x4d288b=0x0,_0x50c5eb={},_0x5979fe={};_0x4d288b<_0xe6ccc1['length'];_0x4d288b+=0x1){_0x50c5eb=_0xe6ccc1[_0x4d288b];if(_[_0x9fe3('0x3e')](_0x154d98[_0x9fe3('0x43')][util[_0x9fe3('0x41')](_0x9fe3('0x22'),_0x50c5eb[_0x9fe3('0x23')])])){_0x154d98['trunks'][util[_0x9fe3('0x41')](_0x9fe3('0x22'),_0x50c5eb[_0x9fe3('0x23')])]=new Trunk(_0x50c5eb);}else{_0x154d98['mergeFromDatabase'](_0x154d98[_0x9fe3('0x43')][util[_0x9fe3('0x41')](_0x9fe3('0x22'),_0x50c5eb['name'])],_0x50c5eb);}}}return _0x154d98['trunks'];};};Realtime['prototype'][_0x9fe3('0x44')]=function(){var _0x5463e3=this;return function(_0x2be917){if(_0x2be917){freeIsNotKey(_0x2be917,_0x5463e3[_0x9fe3('0x45')],'name');for(var _0x4dfa3a=0x0,_0x4e9921={},_0x5124fd={};_0x4dfa3a<_0x2be917[_0x9fe3('0x3d')];_0x4dfa3a+=0x1){_0x4e9921=_0x2be917[_0x4dfa3a];if(_[_0x9fe3('0x3e')](_0x5463e3[_0x9fe3('0x45')][_0x4e9921[_0x9fe3('0x23')]])){_0x5463e3[_0x9fe3('0x45')][_0x4e9921[_0x9fe3('0x23')]]=new VoiceQueue(_0x4e9921);}else{_0x5463e3[_0x9fe3('0x3f')](_0x5463e3[_0x9fe3('0x45')][_0x4e9921['name']],_0x4e9921);}}}return _0x5463e3['voiceQueues'];};};Realtime['prototype'][_0x9fe3('0x46')]=function(){var _0x4b4d11=this;return function(_0x3d4e16){if(_0x3d4e16){freeIsNotKey(_0x3d4e16,_0x4b4d11[_0x9fe3('0x12')],'id');for(var _0x335ede=0x0,_0x3461b1={},_0x8fc4a8={};_0x335ede<_0x3d4e16['length'];_0x335ede+=0x1){_0x3461b1=_0x3d4e16[_0x335ede];if(_[_0x9fe3('0x3e')](_0x4b4d11[_0x9fe3('0x12')][_0x3461b1['id']])){_0x4b4d11[_0x9fe3('0x12')][_0x3461b1['id']]=new Trigger(_0x3461b1);}else{_0x4b4d11[_0x9fe3('0x3f')](_0x4b4d11[_0x9fe3('0x12')][_0x3461b1['id']],_0x3461b1);}}}return _0x4b4d11[_0x9fe3('0x12')];};};Realtime['prototype']['initTemplates']=function(){var _0x480aa5=this;return function(_0x193b08){if(_0x193b08){freeIsNotKey(_0x193b08,_0x480aa5['templates'],'id');for(var _0xe7830c=0x0,_0x10c056={},_0x1afc8e={};_0xe7830c<_0x193b08[_0x9fe3('0x3d')];_0xe7830c+=0x1){_0x10c056=_0x193b08[_0xe7830c];if(_[_0x9fe3('0x3e')](_0x480aa5[_0x9fe3('0x47')][_0x10c056['id']])){_0x480aa5['templates'][_0x10c056['id']]=new Template(_0x10c056);}else{_0x480aa5[_0x9fe3('0x3f')](_0x480aa5['templates'][_0x10c056['id']],_0x10c056);}}}return _0x480aa5[_0x9fe3('0x47')];};};Realtime[_0x9fe3('0x3b')]['initZendeskAccounts']=function(){var _0x2a4a7d=this;return function(_0x5f2bb1){if(_0x5f2bb1){freeIsNotKey(_0x5f2bb1,_0x2a4a7d[_0x9fe3('0x1a')],'id');for(var _0x215a24=0x0,_0x19dccd={},_0x5d6d43={};_0x215a24<_0x5f2bb1[_0x9fe3('0x3d')];_0x215a24+=0x1){_0x19dccd=_0x5f2bb1[_0x215a24];if(_[_0x9fe3('0x3e')](_0x2a4a7d['zendeskAccounts'][_0x19dccd['id']])){_0x2a4a7d[_0x9fe3('0x1a')][_0x19dccd['id']]=new ZendeskAccount(_0x19dccd);}else{_0x2a4a7d[_0x9fe3('0x3f')](_0x2a4a7d[_0x9fe3('0x1a')][_0x19dccd['id']],_0x19dccd);}}}return _0x2a4a7d['zendeskAccounts'];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x48')]=function(){var _0x5452e4=this;return function(_0x22a7d6){if(_0x22a7d6){freeIsNotKey(_0x22a7d6,_0x5452e4['salesforceAccounts'],'id');for(var _0x362743=0x0,_0xfce4df={},_0x34d1f0={};_0x362743<_0x22a7d6['length'];_0x362743+=0x1){_0xfce4df=_0x22a7d6[_0x362743];if(_[_0x9fe3('0x3e')](_0x5452e4[_0x9fe3('0x1b')][_0xfce4df['id']])){_0x5452e4[_0x9fe3('0x1b')][_0xfce4df['id']]=new SalesforceAccount(_0xfce4df);}else{_0x5452e4[_0x9fe3('0x3f')](_0x5452e4[_0x9fe3('0x1b')][_0xfce4df['id']],_0xfce4df);}}}return _0x5452e4[_0x9fe3('0x1b')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x49')]=function(){var _0x1cb287=this;return function(_0x5212ce){if(_0x5212ce){freeIsNotKey(_0x5212ce,_0x1cb287[_0x9fe3('0x4a')],'id');for(var _0x56adc2=0x0,_0x3e60f7={},_0x215a86={};_0x56adc2<_0x5212ce[_0x9fe3('0x3d')];_0x56adc2+=0x1){_0x3e60f7=_0x5212ce[_0x56adc2];if(_['isUndefined'](_0x1cb287['freshdeskAccounts'][_0x3e60f7['id']])){_0x1cb287[_0x9fe3('0x4a')][_0x3e60f7['id']]=new FreshdeskAccount(_0x3e60f7);}else{_0x1cb287[_0x9fe3('0x3f')](_0x1cb287[_0x9fe3('0x4a')][_0x3e60f7['id']],_0x3e60f7);}}}return _0x1cb287[_0x9fe3('0x4a')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x4b')]=function(){var _0x2f8743=this;return function(_0x366143){if(_0x366143){freeIsNotKey(_0x366143,_0x2f8743[_0x9fe3('0x1c')],'id');for(var _0x5756c8=0x0,_0x50fbfd={},_0x5a8d71={};_0x5756c8<_0x366143['length'];_0x5756c8+=0x1){_0x50fbfd=_0x366143[_0x5756c8];if(_[_0x9fe3('0x3e')](_0x2f8743[_0x9fe3('0x1c')][_0x50fbfd['id']])){_0x2f8743[_0x9fe3('0x1c')][_0x50fbfd['id']]=new ZohoAccount(_0x50fbfd);}else{_0x2f8743[_0x9fe3('0x3f')](_0x2f8743['zohoAccounts'][_0x50fbfd['id']],_0x50fbfd);}}}return _0x2f8743['zohoAccounts'];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x4c')]=function(){var _0xfc1a5=this;return function(_0xd3bdd2){if(_0xd3bdd2){freeIsNotKey(_0xd3bdd2,_0xfc1a5[_0x9fe3('0x1d')],'id');for(var _0x41ff89=0x0,_0x242165={},_0x45b488={};_0x41ff89<_0xd3bdd2[_0x9fe3('0x3d')];_0x41ff89+=0x1){_0x242165=_0xd3bdd2[_0x41ff89];if(_[_0x9fe3('0x3e')](_0xfc1a5[_0x9fe3('0x1d')][_0x242165['id']])){_0xfc1a5[_0x9fe3('0x1d')][_0x242165['id']]=new DeskAccount(_0x242165);}else{_0xfc1a5[_0x9fe3('0x3f')](_0xfc1a5[_0x9fe3('0x1d')][_0x242165['id']],_0x242165);}}}return _0xfc1a5[_0x9fe3('0x1d')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x4d')]=function(){var _0x10549a=this;return function(_0x122fa2){if(_0x122fa2){freeIsNotKey(_0x122fa2,_0x10549a[_0x9fe3('0x4e')],'id');for(var _0x447fb9=0x0,_0x10d65a={},_0x20bf02={};_0x447fb9<_0x122fa2[_0x9fe3('0x3d')];_0x447fb9+=0x1){_0x10d65a=_0x122fa2[_0x447fb9];if(_['isUndefined'](_0x10549a[_0x9fe3('0x4e')][_0x10d65a['id']])){_0x10549a['sugarcrmAccounts'][_0x10d65a['id']]=new SugarcrmAccount(_0x10d65a);}else{_0x10549a[_0x9fe3('0x3f')](_0x10549a[_0x9fe3('0x4e')][_0x10d65a['id']],_0x10d65a);}}}return _0x10549a[_0x9fe3('0x4e')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x4f')]=function(){var _0x36f2e0=this;return function(_0x1e1c1e){if(_0x1e1c1e){freeIsNotKey(_0x1e1c1e,_0x36f2e0['vtigerAccounts'],'id');for(var _0x552946=0x0,_0x469b71={},_0x25ec34={};_0x552946<_0x1e1c1e['length'];_0x552946+=0x1){_0x469b71=_0x1e1c1e[_0x552946];if(_[_0x9fe3('0x3e')](_0x36f2e0['vtigerAccounts'][_0x469b71['id']])){_0x36f2e0[_0x9fe3('0x1e')][_0x469b71['id']]=new VtigerAccount(_0x469b71);}else{_0x36f2e0[_0x9fe3('0x3f')](_0x36f2e0[_0x9fe3('0x1e')][_0x469b71['id']],_0x469b71);}}}return _0x36f2e0['vtigerAccounts'];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x50')]=function(){var _0x2a79e6=this;return function(_0xf26129){if(_0xf26129){freeIsNotKey(_0xf26129,_0x2a79e6[_0x9fe3('0x1f')],'id');for(var _0x573ef1=0x0,_0xc0e3a7={},_0x254c87={};_0x573ef1<_0xf26129[_0x9fe3('0x3d')];_0x573ef1+=0x1){_0xc0e3a7=_0xf26129[_0x573ef1];if(_[_0x9fe3('0x3e')](_0x2a79e6['servicenowAccounts'][_0xc0e3a7['id']])){_0x2a79e6[_0x9fe3('0x1f')][_0xc0e3a7['id']]=new ServicenowAccount(_0xc0e3a7);}else{_0x2a79e6[_0x9fe3('0x3f')](_0x2a79e6['servicenowAccounts'][_0xc0e3a7['id']],_0xc0e3a7);}}}return _0x2a79e6[_0x9fe3('0x1f')];};};Realtime[_0x9fe3('0x3b')]['initDynamics365Accounts']=function(){var _0x5bf77d=this;return function(_0x10d7ca){if(_0x10d7ca){freeIsNotKey(_0x10d7ca,_0x5bf77d[_0x9fe3('0x20')],'id');for(var _0x25ff46=0x0,_0x1df190={},_0x31a959={};_0x25ff46<_0x10d7ca[_0x9fe3('0x3d')];_0x25ff46+=0x1){_0x1df190=_0x10d7ca[_0x25ff46];if(_['isUndefined'](_0x5bf77d['dynamics365Accounts'][_0x1df190['id']])){_0x5bf77d['dynamics365Accounts'][_0x1df190['id']]=new Dynamics365Account(_0x1df190);}else{_0x5bf77d[_0x9fe3('0x3f')](_0x5bf77d['dynamics365Accounts'][_0x1df190['id']],_0x1df190);}}}return _0x5bf77d[_0x9fe3('0x20')];};};Realtime[_0x9fe3('0x3b')]['initFreshsalesAccounts']=function(){var _0xe6114a=this;return function(_0x4266d5){if(_0x4266d5){freeIsNotKey(_0x4266d5,_0xe6114a[_0x9fe3('0x51')],'id');for(var _0x17c32f=0x0,_0x25975b={},_0x130afd={};_0x17c32f<_0x4266d5[_0x9fe3('0x3d')];_0x17c32f+=0x1){_0x25975b=_0x4266d5[_0x17c32f];if(_[_0x9fe3('0x3e')](_0xe6114a[_0x9fe3('0x51')][_0x25975b['id']])){_0xe6114a[_0x9fe3('0x51')][_0x25975b['id']]=new FreshsalesAccount(_0x25975b);}else{_0xe6114a[_0x9fe3('0x3f')](_0xe6114a['freshsalesAccounts'][_0x25975b['id']],_0x25975b);}}}return _0xe6114a[_0x9fe3('0x51')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x52')]=function(){var _0x317d38=this;return function(_0x32c441){for(var _0x29340f=0x0;_0x29340f<_0x32c441[_0x9fe3('0x3d')];_0x29340f+=0x1){_[_0x9fe3('0x53')](_0x317d38[_0x9fe3('0x45')][_0x32c441[_0x29340f][_0x9fe3('0x23')]],_0x32c441[_0x29340f]);}return _0x317d38[_0x9fe3('0x45')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x54')]=function(){var _0x5407d4=this;return function(_0x384aaf){clearVoiceQueues(_0x5407d4[_0x9fe3('0x45')]);if(_0x384aaf){_0x384aaf=_[_0x9fe3('0x55')](_0x384aaf,_0x9fe3('0x56'));for(var _0x4768d6 in _0x384aaf){if(_0x384aaf[_0x9fe3('0x26')](_0x4768d6)){var _0x4f9d1d={};for(var _0xa42ea2=0x0;_0xa42ea2<_0x384aaf[_0x4768d6][_0x9fe3('0x3d')];_0xa42ea2+=0x1){var _0x5c81bd=_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x57')];if(_0x5407d4[_0x9fe3('0x45')][_0x5c81bd]){if(_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x58')]){_0x5407d4[_0x9fe3('0x45')][_0x5c81bd]['unmanaged']+=0x1;}if(_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x59')]){_0x5407d4[_0x9fe3('0x45')][_0x5c81bd][_0x9fe3('0x2e')]+=0x1;}_0x5407d4[_0x9fe3('0x45')][_0x5c81bd]['sumHoldTime']+=moment(_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x5a')])[_0x9fe3('0x5b')](moment(_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x5c')]),'seconds')||0x0;if(_0xa42ea2===_0x384aaf[_0x4768d6][_0x9fe3('0x3d')]-0x1){_0x5407d4[_0x9fe3('0x45')][_0x5c81bd][_0x9fe3('0x29')]+=moment(_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x5d')]||_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x5e')]||_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x5f')])[_0x9fe3('0x5b')](moment(_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x5c')]),_0x9fe3('0x60'))||0x0;_0x5407d4[_0x9fe3('0x45')][_0x5c81bd][_0x9fe3('0x27')]+=0x1;if(_0x384aaf[_0x4768d6][_0xa42ea2]['queuecallercomplete']){_0x5407d4[_0x9fe3('0x45')][_0x5c81bd]['answered']+=0x1;_0x5407d4['voiceQueues'][_0x5c81bd][_0x9fe3('0x2a')]+=moment(_0x384aaf[_0x4768d6][_0xa42ea2]['queuecallercompleteAt'])[_0x9fe3('0x5b')](moment(_0x384aaf[_0x4768d6][_0xa42ea2][_0x9fe3('0x5a')]),_0x9fe3('0x60'))||0x0;}}else{_0x5407d4[_0x9fe3('0x45')][_0x5c81bd][_0x9fe3('0x29')]+=_0x5407d4[_0x9fe3('0x45')][_0x5c81bd]['sumHoldTime']||0x0;}}}}}}return _0x5407d4['voiceQueues'];};};Realtime['prototype'][_0x9fe3('0x61')]=function(){var _0x35ef91=this;return function(_0x2b04c0){clearVoiceCallReports(_0x35ef91['outbound']);if(_0x2b04c0){for(var _0x23ffa3=0x0;_0x23ffa3<_0x2b04c0['length'];_0x23ffa3+=0x1){_0x35ef91[_0x9fe3('0x14')]['total']+=0x1;_0x35ef91[_0x9fe3('0x14')]['sumDuration']+=_0x2b04c0[_0x23ffa3][_0x9fe3('0x62')];if(_0x2b04c0[_0x23ffa3][_0x9fe3('0x63')]==='ANSWERED'){_0x35ef91[_0x9fe3('0x14')][_0x9fe3('0x2d')]+=0x1;_0x35ef91['outbound'][_0x9fe3('0x28')]+=_0x2b04c0[_0x23ffa3][_0x9fe3('0x62')]-_0x2b04c0[_0x23ffa3][_0x9fe3('0x64')]||0x0;_0x35ef91['outbound'][_0x9fe3('0x2a')]+=_0x2b04c0[_0x23ffa3][_0x9fe3('0x64')];}}}return _0x35ef91[_0x9fe3('0x14')];};};Realtime['prototype'][_0x9fe3('0x65')]=function(){var _0x32a0e1=this;return function(_0x318c9a){if(_0x318c9a){freeIsNotKey(_0x318c9a,_0x32a0e1[_0x9fe3('0x13')],_0x9fe3('0x23'));for(var _0x561741=0x0,_0x149535={};_0x561741<_0x318c9a[_0x9fe3('0x3d')];_0x561741+=0x1){_0x149535=_0x318c9a[_0x561741];if(_[_0x9fe3('0x3e')](_0x32a0e1[_0x9fe3('0x13')][_0x149535['name']])){_0x32a0e1[_0x9fe3('0x13')][_0x149535['name']]=new Campaign(_0x149535);}else{_0x32a0e1[_0x9fe3('0x3f')](_0x32a0e1[_0x9fe3('0x13')][_0x149535['name']],_0x149535);_0x32a0e1['campaigns'][_0x149535[_0x9fe3('0x23')]][_0x9fe3('0x66')]=_0x149535[_0x9fe3('0x67')]?_0x149535[_0x9fe3('0x67')][_0x9fe3('0x23')]:undefined;}}}return _0x32a0e1[_0x9fe3('0x13')];};};Realtime[_0x9fe3('0x3b')]['initVoiceExtensions']=function(){var _0x28b738=this;return function(_0x38f2cc){if(_0x38f2cc){freeIsNotKey(_0x38f2cc,_0x28b738[_0x9fe3('0x15')],'id');for(var _0x2e1b76=0x0,_0x109436={};_0x2e1b76<_0x38f2cc[_0x9fe3('0x3d')];_0x2e1b76+=0x1){_0x109436=_0x38f2cc[_0x2e1b76];if(_[_0x9fe3('0x3e')](_0x28b738[_0x9fe3('0x15')][_0x109436['id']])){_0x28b738[_0x9fe3('0x15')][_0x109436['id']]=new VoiceExtension(_0x109436);}else{_0x28b738[_0x9fe3('0x3f')](_0x28b738[_0x9fe3('0x15')][_0x109436['id']],_0x109436);}}}return _0x28b738[_0x9fe3('0x15')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x68')]=function(){var _0x155e9e=this;return function(_0x389ba5){clearCampaigns(_0x155e9e['campaigns']);for(var _0xc23b6f=0x0;_0xc23b6f<_0x389ba5[_0x9fe3('0x3d')];_0xc23b6f+=0x1){_[_0x9fe3('0x53')](_0x155e9e['campaigns'][_0x389ba5[_0xc23b6f][_0x9fe3('0x23')]],_0x389ba5[_0xc23b6f]);}return _0x155e9e[_0x9fe3('0x13')];};};Realtime[_0x9fe3('0x3b')][_0x9fe3('0x69')]=function(){var _0x468105=this;return function(_0x378bb3){if(_0x378bb3){freeIsNotKey(_0x378bb3,_0x468105['faxAccounts'],'id');for(var _0x54379f=0x0,_0x564a34={},_0xaa82bf={};_0x54379f<_0x378bb3[_0x9fe3('0x3d')];_0x54379f+=0x1){_0x564a34=_0x378bb3[_0x54379f];if(_['isUndefined'](_0x468105[_0x9fe3('0x6a')][_0x564a34['id']])){_0x468105[_0x9fe3('0x6a')][_0x564a34['id']]=new FaxAccount(_0x564a34);}else{_0x468105[_0x9fe3('0x3f')](_0x468105[_0x9fe3('0x6a')][_0x564a34['id']],_0x564a34);}}}return _0x468105['faxAccounts'];};};module[_0x9fe3('0x6b')]=Realtime; \ No newline at end of file +var _0x0309=['initFreshdeskAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','triggers','templates','outbound','channels','outboundChannels','settings','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','freshsalesAccounts','faxAccounts','mapKeys','format','name','hasOwnProperty','interface','SIP/%s','total','answered','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','zendeskAccounts','initSalesforceAccounts'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0x0309,0x8d));var _0x9030=function(_0x5bb62b,_0x559304){_0x5bb62b=_0x5bb62b-0x0;var _0x5e817e=_0x0309[_0x5bb62b];return _0x5e817e;};'use strict';var util=require(_0x9030('0x0'));var _=require(_0x9030('0x1'));var moment=require(_0x9030('0x2'));var Agent=require(_0x9030('0x3'));var Telephone=require(_0x9030('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x9030('0x5'));var Trigger=require(_0x9030('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x9030('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x9030('0x8'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x9030('0x9'));var VtigerAccount=require(_0x9030('0xa'));var ServicenowAccount=require(_0x9030('0xb'));var Dynamics365Account=require(_0x9030('0xc'));var FreshsalesAccount=require(_0x9030('0xd'));var FaxAccount=require(_0x9030('0xe'));var Realtime=function(){this[_0x9030('0xf')]={};this[_0x9030('0x10')]={};this[_0x9030('0x11')]={};this['voiceQueues']={};this[_0x9030('0x12')]={};this['campaigns']={};this[_0x9030('0x13')]={};this[_0x9030('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x9030('0x15')]={};this['queueChannels']={};this[_0x9030('0x16')]={};this['timers']={};this[_0x9030('0x17')]={};this['zendeskAccounts']={};this[_0x9030('0x18')]={};this[_0x9030('0x19')]={};this[_0x9030('0x1a')]={};this[_0x9030('0x1b')]={};this['deskAccounts']={};this['vtigerAccounts']={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0x9030('0x1c')]={};this[_0x9030('0x1d')]={};};function freeIsNotKey(_0x4b8351,_0x3895d0,_0xccfccb){var _0x49c404=_[_0x9030('0x1e')](_0x4b8351,function(_0x4bc394,_0x43016c){return _0x4bc394[_0xccfccb];});for(var _0x4960fd in _0x3895d0){if(_0x3895d0['hasOwnProperty'](_0x4960fd)){if(!_0x49c404[_0x4960fd]){delete _0x3895d0[_0x4960fd];}}}}function freeIsNotKeySip(_0x36f91d,_0x4de6e3){var _0x2c020a=_[_0x9030('0x1e')](_0x36f91d,function(_0x42207a,_0x175e61){return util[_0x9030('0x1f')]('SIP/%s',_0x42207a[_0x9030('0x20')]);});for(var _0x3e0d21 in _0x4de6e3){if(_0x4de6e3[_0x9030('0x21')](_0x3e0d21)){if(!_0x2c020a[_0x3e0d21]){delete _0x4de6e3[_0x3e0d21];}}}}function freeIsNotKeyAgent(_0x1dae33,_0x56c9a5){var _0x10283b=_['mapKeys'](_0x1dae33,function(_0x50a924,_0x2d1041){var _0x350ef3=_['isNil'](_0x50a924[_0x9030('0x22')])?util[_0x9030('0x1f')](_0x9030('0x23'),_0x50a924[_0x9030('0x20')]):_0x50a924[_0x9030('0x22')];return _0x350ef3;});for(var _0x3fd61d in _0x56c9a5){if(_0x56c9a5[_0x9030('0x21')](_0x3fd61d)){if(!_0x10283b[_0x3fd61d]){delete _0x56c9a5[_0x3fd61d];}}}}function clearVoiceCallReports(_0x180d1e){_0x180d1e[_0x9030('0x24')]=0x0;_0x180d1e[_0x9030('0x25')]=0x0;_0x180d1e[_0x9030('0x26')]=0x0;_0x180d1e['sumDuration']=0x0;_0x180d1e[_0x9030('0x27')]=0x0;}function clearCampaigns(_0x434152){if(!_['isEmpty'](_0x434152)){for(var _0x1761ee in _0x434152){if(_0x434152['hasOwnProperty'](_0x1761ee)){_0x434152[_0x1761ee][_0x9030('0x28')]=0x0;_0x434152[_0x1761ee][_0x9030('0x29')]=0x0;}}}}function clearVoiceQueues(_0x7d2c70){if(!_['isEmpty'](_0x7d2c70)){for(var _0x41328e in _0x7d2c70){if(_0x7d2c70['hasOwnProperty'](_0x41328e)){_0x7d2c70[_0x41328e]['total']=0x0;_0x7d2c70[_0x41328e][_0x9030('0x25')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x2a')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x2b')]=0x0;_0x7d2c70[_0x41328e]['sumHoldTime']=0x0;_0x7d2c70[_0x41328e][_0x9030('0x2c')]=0x0;_0x7d2c70[_0x41328e]['sumBillable']=0x0;_0x7d2c70[_0x41328e]['outboundAnswerAgiCallsDay']=0x0;_0x7d2c70[_0x41328e][_0x9030('0x2d')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x2e')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x2f')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x30')]=0x0;_0x7d2c70[_0x41328e]['outboundUnknownCallsDay']=0x0;_0x7d2c70[_0x41328e][_0x9030('0x31')]=0x0;_0x7d2c70[_0x41328e]['outboundDropCallsDayCallersExit']=0x0;_0x7d2c70[_0x41328e][_0x9030('0x32')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x33')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x34')]=0x0;_0x7d2c70[_0x41328e][_0x9030('0x35')]=0x0;_0x7d2c70[_0x41328e]['outboundAnswerAgiCallsDay']=0x0;_0x7d2c70[_0x41328e]['outboundAnswerCallsDay']=0x0;_0x7d2c70[_0x41328e][_0x9030('0x36')]=!![];}}}}Realtime['prototype'][_0x9030('0x37')]=function(_0x245cda,_0x239c50){for(var _0x3636ae in _0x239c50){if(_0x245cda[_0x9030('0x21')](_0x3636ae)){_0x245cda[_0x3636ae]=_0x239c50[_0x3636ae];}}};Realtime[_0x9030('0x38')][_0x9030('0x39')]=function(){var _0x5c9894=this;return function(_0x497189){if(_0x497189){freeIsNotKeyAgent(_0x497189,_0x5c9894[_0x9030('0xf')]);for(var _0x1e4bea=0x0,_0x593f9d={},_0xf82e1a={};_0x1e4bea<_0x497189[_0x9030('0x3a')];_0x1e4bea+=0x1){_0x593f9d=_0x497189[_0x1e4bea];var _0x3898d8=_[_0x9030('0x3b')](_0x593f9d[_0x9030('0x22')])?util[_0x9030('0x1f')](_0x9030('0x23'),_0x593f9d['name']):_0x593f9d[_0x9030('0x22')];if(_[_0x9030('0x3c')](_0x5c9894[_0x9030('0xf')][_0x3898d8])){_0x5c9894['agents'][_0x3898d8]=new Agent(_0x593f9d);}else{_0x5c9894[_0x9030('0x37')](_0x5c9894[_0x9030('0xf')][_0x3898d8],_0x593f9d);}}}return _0x5c9894[_0x9030('0xf')];};};Realtime[_0x9030('0x38')][_0x9030('0x3d')]=function(){var _0x212072=this;return function(_0x5c132e){if(_0x5c132e){freeIsNotKeySip(_0x5c132e,_0x212072[_0x9030('0x10')]);for(var _0x5a1a76=0x0,_0x4ebe21={},_0x571917={};_0x5a1a76<_0x5c132e['length'];_0x5a1a76+=0x1){_0x4ebe21=_0x5c132e[_0x5a1a76];if(_['isUndefined'](_0x212072[_0x9030('0x10')][util[_0x9030('0x1f')](_0x9030('0x23'),_0x4ebe21[_0x9030('0x20')])])){_0x212072[_0x9030('0x10')][util[_0x9030('0x1f')](_0x9030('0x23'),_0x4ebe21[_0x9030('0x20')])]=new Telephone(_0x4ebe21);}else{_0x212072[_0x9030('0x37')](_0x212072[_0x9030('0x10')][util['format']('SIP/%s',_0x4ebe21[_0x9030('0x20')])],_0x4ebe21);}}}return _0x212072[_0x9030('0x10')];};};Realtime['prototype'][_0x9030('0x3e')]=function(){var _0x1dcd29=this;return function(_0x228e89){if(_0x228e89){freeIsNotKeySip(_0x228e89,_0x1dcd29['trunks']);for(var _0x1d436b=0x0,_0x13a670={},_0x4295ac={};_0x1d436b<_0x228e89[_0x9030('0x3a')];_0x1d436b+=0x1){_0x13a670=_0x228e89[_0x1d436b];if(_[_0x9030('0x3c')](_0x1dcd29[_0x9030('0x11')][util['format'](_0x9030('0x23'),_0x13a670[_0x9030('0x20')])])){_0x1dcd29[_0x9030('0x11')][util[_0x9030('0x1f')]('SIP/%s',_0x13a670['name'])]=new Trunk(_0x13a670);}else{_0x1dcd29[_0x9030('0x37')](_0x1dcd29[_0x9030('0x11')][util[_0x9030('0x1f')](_0x9030('0x23'),_0x13a670[_0x9030('0x20')])],_0x13a670);}}}return _0x1dcd29[_0x9030('0x11')];};};Realtime[_0x9030('0x38')][_0x9030('0x3f')]=function(){var _0x2e1daf=this;return function(_0x189641){if(_0x189641){freeIsNotKey(_0x189641,_0x2e1daf[_0x9030('0x40')],_0x9030('0x20'));for(var _0x1f0e49=0x0,_0x218c51={},_0x1d9211={};_0x1f0e49<_0x189641[_0x9030('0x3a')];_0x1f0e49+=0x1){_0x218c51=_0x189641[_0x1f0e49];if(_['isUndefined'](_0x2e1daf['voiceQueues'][_0x218c51[_0x9030('0x20')]])){_0x2e1daf['voiceQueues'][_0x218c51[_0x9030('0x20')]]=new VoiceQueue(_0x218c51);}else{_0x2e1daf[_0x9030('0x37')](_0x2e1daf[_0x9030('0x40')][_0x218c51[_0x9030('0x20')]],_0x218c51);}}}return _0x2e1daf['voiceQueues'];};};Realtime[_0x9030('0x38')][_0x9030('0x41')]=function(){var _0x7530f6=this;return function(_0x4be75b){if(_0x4be75b){freeIsNotKey(_0x4be75b,_0x7530f6[_0x9030('0x12')],'id');for(var _0x4038c3=0x0,_0x5bb3b8={},_0x5269ee={};_0x4038c3<_0x4be75b['length'];_0x4038c3+=0x1){_0x5bb3b8=_0x4be75b[_0x4038c3];if(_[_0x9030('0x3c')](_0x7530f6[_0x9030('0x12')][_0x5bb3b8['id']])){_0x7530f6[_0x9030('0x12')][_0x5bb3b8['id']]=new Trigger(_0x5bb3b8);}else{_0x7530f6[_0x9030('0x37')](_0x7530f6[_0x9030('0x12')][_0x5bb3b8['id']],_0x5bb3b8);}}}return _0x7530f6['triggers'];};};Realtime[_0x9030('0x38')][_0x9030('0x42')]=function(){var _0x35d0a9=this;return function(_0x3cdc29){if(_0x3cdc29){freeIsNotKey(_0x3cdc29,_0x35d0a9[_0x9030('0x13')],'id');for(var _0x5559f5=0x0,_0x2129d3={},_0x5a845f={};_0x5559f5<_0x3cdc29[_0x9030('0x3a')];_0x5559f5+=0x1){_0x2129d3=_0x3cdc29[_0x5559f5];if(_['isUndefined'](_0x35d0a9[_0x9030('0x13')][_0x2129d3['id']])){_0x35d0a9[_0x9030('0x13')][_0x2129d3['id']]=new Template(_0x2129d3);}else{_0x35d0a9[_0x9030('0x37')](_0x35d0a9[_0x9030('0x13')][_0x2129d3['id']],_0x2129d3);}}}return _0x35d0a9[_0x9030('0x13')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x45a363=this;return function(_0x3f4452){if(_0x3f4452){freeIsNotKey(_0x3f4452,_0x45a363[_0x9030('0x43')],'id');for(var _0xc67d77=0x0,_0x9a1a24={},_0x587e6a={};_0xc67d77<_0x3f4452[_0x9030('0x3a')];_0xc67d77+=0x1){_0x9a1a24=_0x3f4452[_0xc67d77];if(_['isUndefined'](_0x45a363[_0x9030('0x43')][_0x9a1a24['id']])){_0x45a363[_0x9030('0x43')][_0x9a1a24['id']]=new ZendeskAccount(_0x9a1a24);}else{_0x45a363['mergeFromDatabase'](_0x45a363['zendeskAccounts'][_0x9a1a24['id']],_0x9a1a24);}}}return _0x45a363[_0x9030('0x43')];};};Realtime[_0x9030('0x38')][_0x9030('0x44')]=function(){var _0x2f58cb=this;return function(_0x1b762e){if(_0x1b762e){freeIsNotKey(_0x1b762e,_0x2f58cb[_0x9030('0x18')],'id');for(var _0x3fd55a=0x0,_0x2553b0={},_0x2a443b={};_0x3fd55a<_0x1b762e['length'];_0x3fd55a+=0x1){_0x2553b0=_0x1b762e[_0x3fd55a];if(_[_0x9030('0x3c')](_0x2f58cb[_0x9030('0x18')][_0x2553b0['id']])){_0x2f58cb['salesforceAccounts'][_0x2553b0['id']]=new SalesforceAccount(_0x2553b0);}else{_0x2f58cb[_0x9030('0x37')](_0x2f58cb[_0x9030('0x18')][_0x2553b0['id']],_0x2553b0);}}}return _0x2f58cb['salesforceAccounts'];};};Realtime['prototype'][_0x9030('0x45')]=function(){var _0xede98c=this;return function(_0x2492e3){if(_0x2492e3){freeIsNotKey(_0x2492e3,_0xede98c[_0x9030('0x1a')],'id');for(var _0x326576=0x0,_0x173202={},_0x341fbb={};_0x326576<_0x2492e3['length'];_0x326576+=0x1){_0x173202=_0x2492e3[_0x326576];if(_[_0x9030('0x3c')](_0xede98c[_0x9030('0x1a')][_0x173202['id']])){_0xede98c['freshdeskAccounts'][_0x173202['id']]=new FreshdeskAccount(_0x173202);}else{_0xede98c[_0x9030('0x37')](_0xede98c[_0x9030('0x1a')][_0x173202['id']],_0x173202);}}}return _0xede98c[_0x9030('0x1a')];};};Realtime['prototype'][_0x9030('0x46')]=function(){var _0x5354d4=this;return function(_0x5bbf4c){if(_0x5bbf4c){freeIsNotKey(_0x5bbf4c,_0x5354d4['zohoAccounts'],'id');for(var _0x595c8a=0x0,_0x595e04={},_0x2e7742={};_0x595c8a<_0x5bbf4c[_0x9030('0x3a')];_0x595c8a+=0x1){_0x595e04=_0x5bbf4c[_0x595c8a];if(_['isUndefined'](_0x5354d4[_0x9030('0x1b')][_0x595e04['id']])){_0x5354d4[_0x9030('0x1b')][_0x595e04['id']]=new ZohoAccount(_0x595e04);}else{_0x5354d4[_0x9030('0x37')](_0x5354d4[_0x9030('0x1b')][_0x595e04['id']],_0x595e04);}}}return _0x5354d4['zohoAccounts'];};};Realtime[_0x9030('0x38')]['initDeskAccounts']=function(){var _0x919d6f=this;return function(_0x8fe0d1){if(_0x8fe0d1){freeIsNotKey(_0x8fe0d1,_0x919d6f[_0x9030('0x47')],'id');for(var _0x35a0c1=0x0,_0x12c638={},_0x1935fc={};_0x35a0c1<_0x8fe0d1[_0x9030('0x3a')];_0x35a0c1+=0x1){_0x12c638=_0x8fe0d1[_0x35a0c1];if(_[_0x9030('0x3c')](_0x919d6f[_0x9030('0x47')][_0x12c638['id']])){_0x919d6f[_0x9030('0x47')][_0x12c638['id']]=new DeskAccount(_0x12c638);}else{_0x919d6f[_0x9030('0x37')](_0x919d6f['deskAccounts'][_0x12c638['id']],_0x12c638);}}}return _0x919d6f[_0x9030('0x47')];};};Realtime[_0x9030('0x38')][_0x9030('0x48')]=function(){var _0x1d8f45=this;return function(_0x141f54){if(_0x141f54){freeIsNotKey(_0x141f54,_0x1d8f45[_0x9030('0x19')],'id');for(var _0x607792=0x0,_0x5c86a8={},_0x2b0220={};_0x607792<_0x141f54[_0x9030('0x3a')];_0x607792+=0x1){_0x5c86a8=_0x141f54[_0x607792];if(_[_0x9030('0x3c')](_0x1d8f45[_0x9030('0x19')][_0x5c86a8['id']])){_0x1d8f45[_0x9030('0x19')][_0x5c86a8['id']]=new SugarcrmAccount(_0x5c86a8);}else{_0x1d8f45[_0x9030('0x37')](_0x1d8f45[_0x9030('0x19')][_0x5c86a8['id']],_0x5c86a8);}}}return _0x1d8f45[_0x9030('0x19')];};};Realtime[_0x9030('0x38')][_0x9030('0x49')]=function(){var _0x45597f=this;return function(_0x103561){if(_0x103561){freeIsNotKey(_0x103561,_0x45597f['vtigerAccounts'],'id');for(var _0x1e72ec=0x0,_0x55b577={},_0x5bed86={};_0x1e72ec<_0x103561[_0x9030('0x3a')];_0x1e72ec+=0x1){_0x55b577=_0x103561[_0x1e72ec];if(_[_0x9030('0x3c')](_0x45597f[_0x9030('0x4a')][_0x55b577['id']])){_0x45597f[_0x9030('0x4a')][_0x55b577['id']]=new VtigerAccount(_0x55b577);}else{_0x45597f[_0x9030('0x37')](_0x45597f[_0x9030('0x4a')][_0x55b577['id']],_0x55b577);}}}return _0x45597f[_0x9030('0x4a')];};};Realtime[_0x9030('0x38')][_0x9030('0x4b')]=function(){var _0xa39cb=this;return function(_0x37ee9f){if(_0x37ee9f){freeIsNotKey(_0x37ee9f,_0xa39cb['servicenowAccounts'],'id');for(var _0x410b88=0x0,_0x134016={},_0x43d8ca={};_0x410b88<_0x37ee9f[_0x9030('0x3a')];_0x410b88+=0x1){_0x134016=_0x37ee9f[_0x410b88];if(_[_0x9030('0x3c')](_0xa39cb[_0x9030('0x4c')][_0x134016['id']])){_0xa39cb[_0x9030('0x4c')][_0x134016['id']]=new ServicenowAccount(_0x134016);}else{_0xa39cb['mergeFromDatabase'](_0xa39cb[_0x9030('0x4c')][_0x134016['id']],_0x134016);}}}return _0xa39cb[_0x9030('0x4c')];};};Realtime[_0x9030('0x38')][_0x9030('0x4d')]=function(){var _0x2a514f=this;return function(_0x1aa600){if(_0x1aa600){freeIsNotKey(_0x1aa600,_0x2a514f[_0x9030('0x4e')],'id');for(var _0x456355=0x0,_0x8a3f5d={},_0x27aa7b={};_0x456355<_0x1aa600['length'];_0x456355+=0x1){_0x8a3f5d=_0x1aa600[_0x456355];if(_[_0x9030('0x3c')](_0x2a514f[_0x9030('0x4e')][_0x8a3f5d['id']])){_0x2a514f['dynamics365Accounts'][_0x8a3f5d['id']]=new Dynamics365Account(_0x8a3f5d);}else{_0x2a514f[_0x9030('0x37')](_0x2a514f['dynamics365Accounts'][_0x8a3f5d['id']],_0x8a3f5d);}}}return _0x2a514f[_0x9030('0x4e')];};};Realtime[_0x9030('0x38')][_0x9030('0x4f')]=function(){var _0x235772=this;return function(_0x1a20e2){if(_0x1a20e2){freeIsNotKey(_0x1a20e2,_0x235772['freshsalesAccounts'],'id');for(var _0x5c5b12=0x0,_0x2d43c9={},_0x24fc5a={};_0x5c5b12<_0x1a20e2[_0x9030('0x3a')];_0x5c5b12+=0x1){_0x2d43c9=_0x1a20e2[_0x5c5b12];if(_['isUndefined'](_0x235772[_0x9030('0x1c')][_0x2d43c9['id']])){_0x235772[_0x9030('0x1c')][_0x2d43c9['id']]=new FreshsalesAccount(_0x2d43c9);}else{_0x235772[_0x9030('0x37')](_0x235772[_0x9030('0x1c')][_0x2d43c9['id']],_0x2d43c9);}}}return _0x235772[_0x9030('0x1c')];};};Realtime[_0x9030('0x38')][_0x9030('0x50')]=function(){var _0x3adbf7=this;return function(_0x164991){for(var _0x366d63=0x0;_0x366d63<_0x164991[_0x9030('0x3a')];_0x366d63+=0x1){_[_0x9030('0x51')](_0x3adbf7[_0x9030('0x40')][_0x164991[_0x366d63][_0x9030('0x20')]],_0x164991[_0x366d63]);}return _0x3adbf7[_0x9030('0x40')];};};Realtime[_0x9030('0x38')][_0x9030('0x52')]=function(){var _0xb58e93=this;return function(_0x83d2c9){clearVoiceQueues(_0xb58e93[_0x9030('0x40')]);if(_0x83d2c9){_0x83d2c9=_[_0x9030('0x53')](_0x83d2c9,'uniqueid');for(var _0x3e0d47 in _0x83d2c9){if(_0x83d2c9[_0x9030('0x21')](_0x3e0d47)){var _0x44719c={};for(var _0x3cc4bd=0x0;_0x3cc4bd<_0x83d2c9[_0x3e0d47][_0x9030('0x3a')];_0x3cc4bd+=0x1){var _0x4ce2d3=_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x54')];if(_0xb58e93[_0x9030('0x40')][_0x4ce2d3]){if(_0x83d2c9[_0x3e0d47][_0x3cc4bd]['queuecallerexit']){_0xb58e93[_0x9030('0x40')][_0x4ce2d3][_0x9030('0x2a')]+=0x1;}if(_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x55')]){_0xb58e93['voiceQueues'][_0x4ce2d3][_0x9030('0x2b')]+=0x1;}_0xb58e93['voiceQueues'][_0x4ce2d3][_0x9030('0x26')]+=moment(_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x56')])['diff'](moment(_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x57')]),_0x9030('0x58'))||0x0;if(_0x3cc4bd===_0x83d2c9[_0x3e0d47][_0x9030('0x3a')]-0x1){_0xb58e93[_0x9030('0x40')][_0x4ce2d3]['sumDuration']+=moment(_0x83d2c9[_0x3e0d47][_0x3cc4bd]['queuecallercompleteAt']||_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x59')]||_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x5a')])['diff'](moment(_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x57')]),_0x9030('0x58'))||0x0;_0xb58e93['voiceQueues'][_0x4ce2d3][_0x9030('0x24')]+=0x1;if(_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x5b')]){_0xb58e93['voiceQueues'][_0x4ce2d3][_0x9030('0x25')]+=0x1;_0xb58e93[_0x9030('0x40')][_0x4ce2d3][_0x9030('0x27')]+=moment(_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x5c')])['diff'](moment(_0x83d2c9[_0x3e0d47][_0x3cc4bd][_0x9030('0x56')]),_0x9030('0x58'))||0x0;}}else{_0xb58e93['voiceQueues'][_0x4ce2d3]['sumDuration']+=_0xb58e93[_0x9030('0x40')][_0x4ce2d3][_0x9030('0x26')]||0x0;}}}}}}return _0xb58e93['voiceQueues'];};};Realtime[_0x9030('0x38')][_0x9030('0x5d')]=function(){var _0x4c1eea=this;return function(_0x99ce10){clearVoiceCallReports(_0x4c1eea[_0x9030('0x14')]);if(_0x99ce10){for(var _0x39139b=0x0;_0x39139b<_0x99ce10[_0x9030('0x3a')];_0x39139b+=0x1){_0x4c1eea[_0x9030('0x14')][_0x9030('0x24')]+=0x1;_0x4c1eea['outbound'][_0x9030('0x2c')]+=_0x99ce10[_0x39139b][_0x9030('0x5e')];if(_0x99ce10[_0x39139b][_0x9030('0x5f')]==='ANSWERED'){_0x4c1eea[_0x9030('0x14')][_0x9030('0x25')]+=0x1;_0x4c1eea['outbound'][_0x9030('0x26')]+=_0x99ce10[_0x39139b][_0x9030('0x5e')]-_0x99ce10[_0x39139b][_0x9030('0x60')]||0x0;_0x4c1eea['outbound'][_0x9030('0x27')]+=_0x99ce10[_0x39139b][_0x9030('0x60')];}}}return _0x4c1eea['outbound'];};};Realtime['prototype'][_0x9030('0x61')]=function(){var _0x883903=this;return function(_0x167b1d){if(_0x167b1d){freeIsNotKey(_0x167b1d,_0x883903[_0x9030('0x62')],'name');for(var _0x2fd9b5=0x0,_0x469ec1={};_0x2fd9b5<_0x167b1d[_0x9030('0x3a')];_0x2fd9b5+=0x1){_0x469ec1=_0x167b1d[_0x2fd9b5];if(_['isUndefined'](_0x883903['campaigns'][_0x469ec1[_0x9030('0x20')]])){_0x883903[_0x9030('0x62')][_0x469ec1[_0x9030('0x20')]]=new Campaign(_0x469ec1);}else{_0x883903[_0x9030('0x37')](_0x883903[_0x9030('0x62')][_0x469ec1['name']],_0x469ec1);_0x883903[_0x9030('0x62')][_0x469ec1[_0x9030('0x20')]]['dialQueueProject']=_0x469ec1[_0x9030('0x63')]?_0x469ec1[_0x9030('0x63')]['name']:undefined;}}}return _0x883903[_0x9030('0x62')];};};Realtime[_0x9030('0x38')][_0x9030('0x64')]=function(){var _0x41b6ba=this;return function(_0x5264e2){if(_0x5264e2){freeIsNotKey(_0x5264e2,_0x41b6ba['voiceExtensions'],'id');for(var _0x1fdad8=0x0,_0x14b1e7={};_0x1fdad8<_0x5264e2[_0x9030('0x3a')];_0x1fdad8+=0x1){_0x14b1e7=_0x5264e2[_0x1fdad8];if(_['isUndefined'](_0x41b6ba[_0x9030('0x65')][_0x14b1e7['id']])){_0x41b6ba['voiceExtensions'][_0x14b1e7['id']]=new VoiceExtension(_0x14b1e7);}else{_0x41b6ba[_0x9030('0x37')](_0x41b6ba['voiceExtensions'][_0x14b1e7['id']],_0x14b1e7);}}}return _0x41b6ba[_0x9030('0x65')];};};Realtime['prototype'][_0x9030('0x66')]=function(){var _0x57bfb5=this;return function(_0x1dc19d){clearCampaigns(_0x57bfb5['campaigns']);for(var _0x59211c=0x0;_0x59211c<_0x1dc19d[_0x9030('0x3a')];_0x59211c+=0x1){_[_0x9030('0x51')](_0x57bfb5['campaigns'][_0x1dc19d[_0x59211c][_0x9030('0x20')]],_0x1dc19d[_0x59211c]);}return _0x57bfb5['campaigns'];};};Realtime[_0x9030('0x38')][_0x9030('0x67')]=function(){var _0x1ca4f6=this;return function(_0x234a29){if(_0x234a29){freeIsNotKey(_0x234a29,_0x1ca4f6[_0x9030('0x1d')],'id');for(var _0x3a309c=0x0,_0x2e7d42={},_0x435baf={};_0x3a309c<_0x234a29[_0x9030('0x3a')];_0x3a309c+=0x1){_0x2e7d42=_0x234a29[_0x3a309c];if(_[_0x9030('0x3c')](_0x1ca4f6[_0x9030('0x1d')][_0x2e7d42['id']])){_0x1ca4f6[_0x9030('0x1d')][_0x2e7d42['id']]=new FaxAccount(_0x2e7d42);}else{_0x1ca4f6[_0x9030('0x37')](_0x1ca4f6[_0x9030('0x1d')][_0x2e7d42['id']],_0x2e7d42);}}}return _0x1ca4f6[_0x9030('0x1d')];};};module[_0x9030('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 99bd8d5..1da043e 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 _0x5eb8=['internal','destination','exten','type','dialer','queue','lastdata','from-voip-provider','callerid','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','disposition','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','getCallType','split','membername','monitor','monitors','filename','createdAt','connectedlinename','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','exports','lodash','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceAgentReport','voiceDialReport','blindTransfer','attendedTransfer','find','accountcode','name','isNil','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','format','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','channel','calleridnum'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5eb8,0xd2));var _0x85eb=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x5eb8[_0x2f0057];return _0x17f2c3;};'use strict';var _=require(_0x85eb('0x0'));var moment=require(_0x85eb('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0x85eb('0x2'));var RpcVoiceAgentReport=require(_0x85eb('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x85eb('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x85eb('0x5'));var RpcVoiceRecording=require(_0x85eb('0x6'));var RpcVoiceTransferReport=require(_0x85eb('0x7'));var VoiceQueueReport=require(_0x85eb('0x8'));var VoiceCallReport=require(_0x85eb('0x9'));var VoiceAgentReport=require(_0x85eb('0xa'));var VoiceDialReport=require(_0x85eb('0xb'));var UserReport=require(_0x85eb('0xc'));function Report(_0x3a5d4d){this[_0x85eb('0xd')]=_0x3a5d4d;this[_0x85eb('0xe')]=_0x3a5d4d[_0x85eb('0xe')];this[_0x85eb('0xf')]=_0x3a5d4d[_0x85eb('0xf')];}Report[_0x85eb('0x10')][_0x85eb('0x11')]=function(_0x19c1d8){var _0xfa5271=new VoiceQueueReport(this['realtime']);var _0x89f7cf=new VoiceAgentReport(this[_0x85eb('0xd')]);var _0x372f7d=new VoiceDialReport(this[_0x85eb('0xd')]);var _0x49d4f7=new VoiceCallReport(this[_0x85eb('0xd')]);var _0x2abd95=new UserReport(this[_0x85eb('0xd')]);if(config[_0x85eb('0x12')]&&config[_0x85eb('0x12')][_0x85eb('0x13')]){ami['on'](_0x85eb('0x14'),this['voiceQueueReport'][_0x85eb('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x85eb('0x15')](this));ami['on'](_0x85eb('0x16'),this['voiceAgentReport'][_0x85eb('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x85eb('0x17')][_0x85eb('0x15')](this));ami['on']('blindtransfer',this[_0x85eb('0x18')][_0x85eb('0x15')](this));ami['on']('attendedtransfer',this[_0x85eb('0x19')][_0x85eb('0x15')](this));}};Report['prototype']['findAgent']=function(_0x1eaffa){var _0x3b716a;_0x3b716a=_[_0x85eb('0x1a')](this[_0x85eb('0xe')],function(_0x1b576e){return _0x1b576e[_0x85eb('0x1b')]==_0x1eaffa||_0x1b576e[_0x85eb('0x1c')]==_0x1eaffa;});if(_[_0x85eb('0x1d')](_0x3b716a)){var _0x224f97=_[_0x85eb('0x1a')](this[_0x85eb('0xf')],function(_0x24a978){return _0x24a978['accountcode']==_0x1eaffa||_0x24a978[_0x85eb('0x1c')]==_0x1eaffa;});if(_0x224f97){_0x3b716a=_[_0x85eb('0x1a')](this[_0x85eb('0xe')],function(_0x17e141){return _0x17e141['interface']==util['format'](_0x85eb('0x1e'),_0x224f97['name']);});}}return _0x3b716a;};Report['prototype']['voiceQueueReport']=function(_0x50347c){for(var _0x683098=0x0;_0x683098<_0x50347c[_0x85eb('0x1f')];_0x683098+=0x1){var _0x11c168=this[_0x85eb('0x20')](_0x50347c[_0x683098][_0x85eb('0x21')]);if(_0x11c168){_0x50347c[_0x683098][_0x85eb('0x1b')]=_0x11c168[_0x85eb('0x1b')];_0x50347c[_0x683098][_0x85eb('0x22')]=!![];_0x50347c[_0x683098][_0x85eb('0x23')]=_0x11c168['name'];_0x50347c[_0x683098][_0x85eb('0x24')]=_['isNil'](_0x11c168[_0x85eb('0x24')])?util[_0x85eb('0x25')](_0x85eb('0x1e'),_0x11c168[_0x85eb('0x1c')]):_0x11c168[_0x85eb('0x24')];if(_0x50347c[_0x683098]['queuecallercomplete']){_0x50347c[_0x683098][_0x85eb('0x26')]=moment()[_0x85eb('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x50347c[_0x683098][_0x85eb('0x27')]){_0x50347c[_0x683098][_0x85eb('0x28')]=moment()[_0x85eb('0x25')](_0x85eb('0x29'));}RpcMemberReport['voiceQueueReport'](_0x50347c[_0x683098]);}RpcVoiceQueueReport[_0x85eb('0x2a')](_0x50347c[_0x683098]);}};function extractCalleridNumber(_0x9684fc){var _0x3939ef=_0x9684fc[_0x85eb('0x2b')](/<(.*?)>/);return _0x3939ef?_0x3939ef[0x1]:_0x9684fc;}Report[_0x85eb('0x10')][_0x85eb('0x2c')]=function(_0x55f9df){for(var _0x31112c=0x0;_0x31112c','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','getCallType','membername','create','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','disabled','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','name','isNil','find','accountcode','interface','format','SIP/%s','length','connectedlinenum','queuecallercomplete'];(function(_0x36f804,_0x168ba7){var _0x346f1b=function(_0x5d5949){while(--_0x5d5949){_0x36f804['push'](_0x36f804['shift']());}};_0x346f1b(++_0x168ba7);}(_0x2625,0x90));var _0x5262=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x2625[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x5262('0x0'));var moment=require('moment');var util=require(_0x5262('0x1'));var config=require(_0x5262('0x2'));var ami=require(_0x5262('0x3'));var RpcVoiceAgentReport=require(_0x5262('0x4'));var RpcVoiceCallReport=require(_0x5262('0x5'));var RpcVoiceDialReport=require(_0x5262('0x6'));var RpcMemberReport=require(_0x5262('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x5262('0x8'));var VoiceQueueReport=require(_0x5262('0x9'));var VoiceCallReport=require(_0x5262('0xa'));var VoiceAgentReport=require(_0x5262('0xb'));var VoiceDialReport=require(_0x5262('0xc'));var UserReport=require('./userReport');function Report(_0x113f42){this['realtime']=_0x113f42;this[_0x5262('0xd')]=_0x113f42[_0x5262('0xd')];this[_0x5262('0xe')]=_0x113f42[_0x5262('0xe')];}Report[_0x5262('0xf')][_0x5262('0x10')]=function(_0x3fdd57){var _0x2534fb=new VoiceQueueReport(this[_0x5262('0x11')]);var _0xee39a4=new VoiceAgentReport(this['realtime']);var _0x8b0417=new VoiceDialReport(this[_0x5262('0x11')]);var _0x504e3d=new VoiceCallReport(this['realtime']);var _0x5a733e=new UserReport(this['realtime']);if(config[_0x5262('0x12')]&&config[_0x5262('0x12')][_0x5262('0x13')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x5262('0x14')](this));ami['on'](_0x5262('0x15'),this[_0x5262('0x16')][_0x5262('0x14')](this));ami['on'](_0x5262('0x17'),this['voiceAgentReport'][_0x5262('0x14')](this));ami['on'](_0x5262('0x18'),this[_0x5262('0x19')][_0x5262('0x14')](this));ami['on'](_0x5262('0x1a'),this['blindTransfer'][_0x5262('0x14')](this));ami['on'](_0x5262('0x1b'),this[_0x5262('0x1c')][_0x5262('0x14')](this));}};Report[_0x5262('0xf')][_0x5262('0x1d')]=function(_0x5a62b1){var _0x510730;_0x510730=_['find'](this[_0x5262('0xd')],function(_0x2ba1bf){return _0x2ba1bf['accountcode']==_0x5a62b1||_0x2ba1bf[_0x5262('0x1e')]==_0x5a62b1;});if(_[_0x5262('0x1f')](_0x510730)){var _0x10a255=_[_0x5262('0x20')](this[_0x5262('0xe')],function(_0x1bb3c6){return _0x1bb3c6[_0x5262('0x21')]==_0x5a62b1||_0x1bb3c6['name']==_0x5a62b1;});if(_0x10a255){_0x510730=_[_0x5262('0x20')](this[_0x5262('0xd')],function(_0x2b8f94){return _0x2b8f94[_0x5262('0x22')]==util[_0x5262('0x23')](_0x5262('0x24'),_0x10a255['name']);});}}return _0x510730;};Report[_0x5262('0xf')]['voiceQueueReport']=function(_0x5c7963){for(var _0x303d1c=0x0;_0x303d1c<_0x5c7963[_0x5262('0x25')];_0x303d1c+=0x1){var _0x2415aa=this[_0x5262('0x1d')](_0x5c7963[_0x303d1c][_0x5262('0x26')]);if(_0x2415aa){_0x5c7963[_0x303d1c][_0x5262('0x21')]=_0x2415aa[_0x5262('0x21')];_0x5c7963[_0x303d1c]['assigned']=!![];_0x5c7963[_0x303d1c]['lastAssignedTo']=_0x2415aa['name'];_0x5c7963[_0x303d1c][_0x5262('0x22')]=_[_0x5262('0x1f')](_0x2415aa[_0x5262('0x22')])?util['format'](_0x5262('0x24'),_0x2415aa[_0x5262('0x1e')]):_0x2415aa['interface'];if(_0x5c7963[_0x303d1c][_0x5262('0x27')]){_0x5c7963[_0x303d1c][_0x5262('0x28')]=moment()[_0x5262('0x23')](_0x5262('0x29'));}if(_0x5c7963[_0x303d1c][_0x5262('0x2a')]){_0x5c7963[_0x303d1c]['queuecallerexitAt']=moment()[_0x5262('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x5262('0x2b')](_0x5c7963[_0x303d1c]);}RpcVoiceQueueReport['create'](_0x5c7963[_0x303d1c]);}};function extractCalleridNumber(_0x3450e7){var _0x1b9b92=_0x3450e7[_0x5262('0x2c')](/<(.*?)>/);return _0x1b9b92?_0x1b9b92[0x1]:_0x3450e7;}Report[_0x5262('0xf')][_0x5262('0x2d')]=function(_0x4a1b7f){for(var _0x9d426a=0x0;_0x9d426a0x0?_0x3887a4:0x0;this['voiceQueues'][_0x226684[_0x80a7('0x6c')]][_0x80a7('0x2f')]=this['voiceQueues'][_0x226684[_0x80a7('0x6c')]][_0x80a7('0x2f')]>_[_0x80a7('0x70')](_0x226684[_0x80a7('0x71')])?_[_0x80a7('0x70')](_0x226684['loggedin']):this['voiceQueues'][_0x226684['queue']][_0x80a7('0x2f')];this[_0x80a7('0x51')](this['voiceQueues'][_0x226684[_0x80a7('0x6c')]],_0x80a7('0x17'));}logger['debug'](_0x80a7('0x73'),util[_0x80a7('0x3e')](this['voiceQueues'][_0x226684['queue']],{'showHidden':![],'depth':null}));ami[_0x80a7('0x47')](_0x80a7('0x74'),this['voiceQueues'][_0x226684[_0x80a7('0x6c')]]);}}}catch(_0x42ec75){logger[_0x80a7('0x3c')](_0x80a7('0x69'),util[_0x80a7('0x3e')](_0x42ec75,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x80a7('0xb')][_0x80a7('0x19')]=function(_0x45dd9d){logger[_0x80a7('0x4c')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x80a7('0x3e')](_0x45dd9d,{'showHidden':![],'depth':null}));ami['emit'](_0x80a7('0x75'),{});this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x80a7('0x76')]=function(_0xb5bf8f){try{if(this[_0x80a7('0x64')](_0xb5bf8f)){logger[_0x80a7('0x4c')](_0x80a7('0x77'),_0xb5bf8f[_0x80a7('0x46')],util['inspect'](_0xb5bf8f,{'showHidden':![],'depth':null}));if(_[_0x80a7('0x78')](this[_0x80a7('0xf')][_0xb5bf8f[_0x80a7('0x46')]]))this[_0x80a7('0xf')][_0xb5bf8f[_0x80a7('0x46')]]=[];if(_[_0x80a7('0x78')](this['channels'][_0xb5bf8f[_0x80a7('0x46')]]))this[_0x80a7('0x11')][_0xb5bf8f['uniqueid']]={};var _0x516bf5=new QueueReport();_0x516bf5[_0x80a7('0x49')]=_0xb5bf8f[_0x80a7('0x6c')];_0x516bf5[_0x80a7('0x52')]=this[_0x80a7('0x13')][_0x516bf5['name']]&&this[_0x80a7('0x13')][_0x516bf5[_0x80a7('0x49')]][_0x80a7('0x52')]?this[_0x80a7('0x13')][_0x516bf5[_0x80a7('0x49')]][_0x80a7('0x52')]||_0x80a7('0x53'):_0x80a7('0x53');_0x516bf5[_0x80a7('0x6c')]=_0xb5bf8f[_0x80a7('0x6c')];_0x516bf5[_0x80a7('0x79')]=moment()['format'](_0x80a7('0x7a'));_0x516bf5['position']=_0xb5bf8f[_0x80a7('0x7b')];_0x516bf5['count']=_0xb5bf8f[_0x80a7('0x7c')];_0x516bf5[_0x80a7('0x46')]=_0xb5bf8f[_0x80a7('0x46')];_0x516bf5[_0x80a7('0x7d')]=this[_0x80a7('0x11')][_0xb5bf8f[_0x80a7('0x46')]][_0x80a7('0x7d')];logger[_0x80a7('0x6d')](_0x80a7('0x7e'),_0x516bf5[_0x80a7('0x49')],_0x516bf5[_0x80a7('0x52')]);_[_0x80a7('0x7f')](_0x516bf5,_[_0x80a7('0x80')](_0xb5bf8f,_[_0x80a7('0x81')](_0x516bf5)));this['queueReports'][_0xb5bf8f[_0x80a7('0x46')]][_0x80a7('0x82')](_0x516bf5);this['channels'][_0xb5bf8f[_0x80a7('0x46')]]=_0x516bf5;this[_0x80a7('0x83')](_0x516bf5,_0x80a7('0x1b'));}}catch(_0x46c87d){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0xb5bf8f[_0x80a7('0x46')],util['inspect'](_0x46c87d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x80a7('0xb')][_0x80a7('0x84')]=function(_0x23507e){try{if(this['isNotNull'](_0x23507e)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x23507e[_0x80a7('0x46')],util[_0x80a7('0x3e')](_0x23507e,{'showHidden':![],'depth':null}));if(this[_0x80a7('0xf')][_0x23507e[_0x80a7('0x46')]]){var _0x45a3bb=_['last'](this[_0x80a7('0xf')][_0x23507e['uniqueid']]);_0x45a3bb[_0x80a7('0x85')]=![];_0x45a3bb[_0x80a7('0x86')]=null;_0x45a3bb[_0x80a7('0x87')]=_0x23507e['holdtime'];_0x45a3bb['originalposition']=_0x23507e[_0x80a7('0x88')];_0x45a3bb[_0x80a7('0x89')]=!![];_0x45a3bb[_0x80a7('0x8a')]=moment()[_0x80a7('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x45a3bb[_0x80a7('0x4e')]='ABANDONED';_0x45a3bb[_0x80a7('0x8b')]=null;logger[_0x80a7('0x6d')](_0x80a7('0x8c'),_0x45a3bb[_0x80a7('0x49')],_0x45a3bb[_0x80a7('0x52')]);this[_0x80a7('0x11')][_0x23507e[_0x80a7('0x46')]]=_0x45a3bb;this[_0x80a7('0x8d')](_0x45a3bb,'queuecallerabandon');}}}catch(_0x230764){logger['error'](_0x80a7('0x8e'),_0x23507e[_0x80a7('0x46')],util['inspect'](_0x230764,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x80a7('0x1d')]=function(_0x329b4f){try{if(this[_0x80a7('0x64')](_0x329b4f)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x329b4f[_0x80a7('0x46')],util[_0x80a7('0x3e')](_0x329b4f,{'showHidden':![],'depth':null}));if(this[_0x80a7('0xf')][_0x329b4f[_0x80a7('0x46')]]){var _0x433e74=_[_0x80a7('0x8f')](this[_0x80a7('0xf')][_0x329b4f[_0x80a7('0x46')]]);_0x433e74[_0x80a7('0x90')]=moment()[_0x80a7('0x48')](_0x80a7('0x7a'));_0x433e74[_0x80a7('0x91')]=_0x329b4f[_0x80a7('0x91')];_0x433e74[_0x80a7('0x92')]=_0x329b4f[_0x80a7('0x92')];logger[_0x80a7('0x6d')](_0x80a7('0x93'),_0x433e74['name'],_0x433e74['type'],_0x329b4f[_0x80a7('0x91')],_0x329b4f[_0x80a7('0x92')]);this[_0x80a7('0x11')][_0x329b4f[_0x80a7('0x46')]]=_0x433e74;this['emitVoiceQueueChannelSave'](_0x433e74,_0x80a7('0x1c'));}}}catch(_0x403b49){logger[_0x80a7('0x3c')](_0x80a7('0x94'),_0x329b4f[_0x80a7('0x46')],util[_0x80a7('0x3e')](_0x403b49,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x80a7('0xb')]['syncAgentConnect']=function(_0x5da7a6){try{if(this[_0x80a7('0x64')](_0x5da7a6)){logger[_0x80a7('0x4c')](_0x80a7('0x95'),_0x5da7a6[_0x80a7('0x46')],util['inspect'](_0x5da7a6,{'showHidden':![],'depth':null}));if(this[_0x80a7('0xf')][_0x5da7a6['uniqueid']]){var _0x1f2d8a=_[_0x80a7('0x8f')](this[_0x80a7('0xf')][_0x5da7a6['uniqueid']]);_0x1f2d8a[_0x80a7('0x85')]=!![];_0x1f2d8a[_0x80a7('0x4e')]=_0x80a7('0x96');logger['info'](_0x80a7('0x97'),_0x1f2d8a[_0x80a7('0x49')],_0x1f2d8a['type']);}}}catch(_0x13319){logger[_0x80a7('0x3c')](_0x80a7('0x95'),_0x5da7a6[_0x80a7('0x46')],util[_0x80a7('0x3e')](_0x13319,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x80a7('0xb')]['syncAgentComplete']=function(_0x2a5c9a){try{if(this['isNotNull'](_0x2a5c9a)){logger[_0x80a7('0x4c')]('[%s][voiceQueueReport][agentcomplete]',_0x2a5c9a[_0x80a7('0x46')],util[_0x80a7('0x3e')](_0x2a5c9a,{'showHidden':![],'depth':null}));if(this[_0x80a7('0xf')][_0x2a5c9a[_0x80a7('0x46')]]){var _0x27abeb=_[_0x80a7('0x8f')](this[_0x80a7('0xf')][_0x2a5c9a[_0x80a7('0x46')]]);_0x27abeb['queuecallerabandon']=![];_0x27abeb[_0x80a7('0x8a')]=null;_0x27abeb[_0x80a7('0x98')]=!![];_0x27abeb[_0x80a7('0x8b')]=_0x2a5c9a['membername'];_0x27abeb[_0x80a7('0x87')]=_0x2a5c9a[_0x80a7('0x87')];_0x27abeb[_0x80a7('0x85')]=!![];_0x27abeb[_0x80a7('0x99')]=![];_0x27abeb[_0x80a7('0x9a')]=null;if(!_0x27abeb['transfer']){if(_0x2a5c9a['reason']==_0x80a7('0x9b')){_0x27abeb[_0x80a7('0x4e')]=_0x80a7('0x9c');logger[_0x80a7('0x6d')](_0x80a7('0x9d'),_0x27abeb[_0x80a7('0x49')],_0x27abeb['type']);}else{if(_[_0x80a7('0x9e')](_0x2a5c9a[_0x80a7('0x39')][_0x80a7('0x9f')](),'local/')){if(this[_0x80a7('0xf')][_0x2a5c9a[_0x80a7('0xa0')]]){var _0x348acf=_[_0x80a7('0x8f')](this[_0x80a7('0xf')][_0x2a5c9a['linkedid']]);_0x348acf['queuecallercomplete']=![];_0x348acf[_0x80a7('0x99')]=!![];_0x348acf[_0x80a7('0x9a')]=moment(_0x27abeb[_0x80a7('0x79')])['add'](_0x2a5c9a['holdtime'],_0x80a7('0xa1'))[_0x80a7('0x48')](_0x80a7('0x7a'));_0x348acf[_0x80a7('0x4e')]=_0x80a7('0xa2');_0x348acf[_0x80a7('0x9b')]=!![];_0x348acf[_0x80a7('0xa3')]=_0x80a7('0xa4');_0x348acf[_0x80a7('0xa5')]=_0x2a5c9a['destexten'];_0x348acf[_0x80a7('0xa6')]=_0x2a5c9a[_0x80a7('0x46')];logger[_0x80a7('0x6d')](_0x80a7('0xa7'),_0x348acf['name'],_0x348acf['type']);var _0x58f3f9=this['queueReports'][_0x2a5c9a[_0x80a7('0xa0')]];this[_0x80a7('0xf')][_0x2a5c9a[_0x80a7('0xa0')]]=this[_0x80a7('0xf')][_0x2a5c9a[_0x80a7('0x46')]];this['queueReports'][_0x2a5c9a['uniqueid']]=_0x58f3f9;}}else{_0x27abeb[_0x80a7('0x4e')]=_0x80a7('0xa8')+_0x2a5c9a[_0x80a7('0xa9')][_0x80a7('0xaa')]();logger['info'](_0x80a7('0xab'),_0x27abeb['name'],_0x27abeb[_0x80a7('0x52')],_0x27abeb[_0x80a7('0x4e')]);}}}this['channels'][_0x2a5c9a[_0x80a7('0x46')]]=_0x27abeb;this[_0x80a7('0x8d')](_0x27abeb,'agentcomplete');}}}catch(_0x1b7bd5){logger[_0x80a7('0x3c')](_0x80a7('0xac'),_0x2a5c9a[_0x80a7('0x46')],util[_0x80a7('0x3e')](_0x1b7bd5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x80a7('0xb')][_0x80a7('0x21')]=function(_0x5ec4c5){try{if(this[_0x80a7('0x64')](_0x5ec4c5)){logger[_0x80a7('0x4c')](_0x80a7('0xad'),_0x5ec4c5[_0x80a7('0x46')],util['inspect'](_0x5ec4c5,{'showHidden':![],'depth':null}));this[_0x80a7('0xae')](_0x5ec4c5[_0x80a7('0x46')],_['keys'](_0x5ec4c5[_0x80a7('0xaf')])[0x0],_0x5ec4c5[_0x80a7('0xb0')]);if(this[_0x80a7('0xf')][_0x5ec4c5[_0x80a7('0x46')]]){var _0x49755d=_[_0x80a7('0x8f')](this[_0x80a7('0xf')][_0x5ec4c5[_0x80a7('0x46')]]);if(_0x49755d){if(this[_0x80a7('0x64')](_0x5ec4c5[_0x80a7('0xaf')])&&this[_0x80a7('0x64')](_0x5ec4c5[_0x80a7('0xaf')][_0x80a7('0xb1')])){switch(_0x5ec4c5['value']){case _0x80a7('0xb2'):_0x49755d[_0x80a7('0x99')]=![];_0x49755d[_0x80a7('0x9a')]=null;break;case'TIMEOUT':_0x49755d['lastevent']='timeout';_0x49755d[_0x80a7('0x99')]=!![];_0x49755d[_0x80a7('0x9a')]=moment()[_0x80a7('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x49755d['queuecallerleaveAt']=moment()[_0x80a7('0x48')](_0x80a7('0x7a'));logger[_0x80a7('0x4c')](_0x80a7('0xb3'),_0x5ec4c5[_0x80a7('0x46')],util[_0x80a7('0x3e')](_0x49755d,{'showHidden':![],'depth':null}));ami['emit'](_0x80a7('0xb4'),_0x49755d);break;default:_0x49755d[_0x80a7('0x99')]=!![];_0x49755d[_0x80a7('0x9a')]=moment()[_0x80a7('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x49755d[_0x80a7('0x90')]=moment()[_0x80a7('0x48')](_0x80a7('0x7a'));}_0x49755d[_0x80a7('0x89')]=![];_0x49755d['queuecallerabandonAt']=null;_0x49755d['queuecallerexitreason']=_0x5ec4c5[_0x80a7('0xb0')];this['channels'][_0x5ec4c5[_0x80a7('0x46')]]=_0x49755d;this[_0x80a7('0x8d')](_0x49755d,_0x80a7('0xb5'));}else if(this[_0x80a7('0x64')](_0x5ec4c5[_0x80a7('0xaf')])&&this[_0x80a7('0x64')](_0x5ec4c5[_0x80a7('0xaf')][_0x80a7('0xb6')])){if(!_0x49755d['queuecallerabandon']){_0x49755d[_0x80a7('0x99')]=!![];_0x49755d[_0x80a7('0x9a')]=moment()[_0x80a7('0x48')](_0x80a7('0x7a'));_0x49755d[_0x80a7('0x4e')]=_0x80a7('0xb7');_0x49755d['queuecallerleaveAt']=moment()['format'](_0x80a7('0x7a'));this['channels'][_0x5ec4c5[_0x80a7('0x46')]]=_0x49755d;}}logger['info'](_0x80a7('0xb8'),_0x5ec4c5[_0x80a7('0x46')],_0x49755d[_0x80a7('0x49')],_0x49755d[_0x80a7('0x52')],_['keys'](_0x5ec4c5['variable'])[0x0],_0x5ec4c5[_0x80a7('0xb0')]);_0x49755d['variables']=this['variables'][_0x5ec4c5[_0x80a7('0x46')]];}}}}catch(_0x314f4f){logger['error'](_0x80a7('0xad'),_0x5ec4c5[_0x80a7('0x46')],util['inspect'](_0x314f4f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x80a7('0xae')]=function(_0x4e17cb,_0x1e423e,_0x4c235d){var _0x127023=[_0x80a7('0xb9'),_0x80a7('0xba'),_0x80a7('0xbb'),_0x80a7('0xbc'),_0x80a7('0xbd'),_0x80a7('0xbe'),_0x80a7('0xbf'),_0x80a7('0xc0'),_0x80a7('0xc1'),_0x80a7('0xc2'),'bridgepeer',_0x80a7('0xc3'),_0x80a7('0xc4'),'memberdynamic','memberinterface',_0x80a7('0xc5'),'membername',_0x80a7('0xc6'),'memberrealtime'];if(!_[_0x80a7('0x36')](_0x1e423e)&&!_[_0x80a7('0xc7')](_0x127023,_0x1e423e)){if(_['isUndefined'](this[_0x80a7('0x16')][_0x4e17cb])){this['variables'][_0x4e17cb]={};}this[_0x80a7('0x16')][_0x4e17cb][_0x1e423e]=_0x4c235d;}};VoiceQueueReport['prototype'][_0x80a7('0xc8')]=function(_0x10400d,_0x311db4,_0x5913a3){var _0xd7cc78={};for(var _0xb4c850=0x0;_0xb4c8500x0?_0x2a67df:0x0;this[_0x497c('0x10')][_0x51ac41[_0x497c('0x68')]]['talking']=this['voiceQueues'][_0x51ac41[_0x497c('0x68')]][_0x497c('0x2b')]>_[_0x497c('0x6a')](_0x51ac41['loggedin'])?_[_0x497c('0x6a')](_0x51ac41[_0x497c('0x6d')]):this[_0x497c('0x10')][_0x51ac41[_0x497c('0x68')]]['talking'];this[_0x497c('0x6e')](this[_0x497c('0x10')][_0x51ac41['queue']],_0x497c('0x63'));}logger['debug'](_0x497c('0x6f'),util[_0x497c('0x3c')](this['voiceQueues'][_0x51ac41['queue']],{'showHidden':![],'depth':null}));ami[_0x497c('0x41')](_0x497c('0x70'),this[_0x497c('0x10')][_0x51ac41[_0x497c('0x68')]]);}}}catch(_0x2f77fd){logger[_0x497c('0x38')](_0x497c('0x71'),util['inspect'](_0x2f77fd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x497c('0x2f')]['syncQueueSummaryComplete']=function(_0x2c635c){logger[_0x497c('0x43')](_0x497c('0x72'),util[_0x497c('0x3c')](_0x2c635c,{'showHidden':![],'depth':null}));ami[_0x497c('0x41')](_0x497c('0x73'),{});this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x497c('0x15')]=function(_0x36fea1){try{if(this[_0x497c('0x5f')](_0x36fea1)){logger[_0x497c('0x43')](_0x497c('0x74'),_0x36fea1[_0x497c('0x46')],util[_0x497c('0x3c')](_0x36fea1,{'showHidden':![],'depth':null}));if(_[_0x497c('0x75')](this['queueReports'][_0x36fea1[_0x497c('0x46')]]))this['queueReports'][_0x36fea1[_0x497c('0x46')]]=[];if(_['isUndefined'](this[_0x497c('0xe')][_0x36fea1[_0x497c('0x46')]]))this['channels'][_0x36fea1[_0x497c('0x46')]]={};var _0x4125df=new QueueReport();_0x4125df[_0x497c('0x49')]=_0x36fea1[_0x497c('0x68')];_0x4125df[_0x497c('0x4e')]=this[_0x497c('0x10')][_0x4125df[_0x497c('0x49')]]&&this[_0x497c('0x10')][_0x4125df[_0x497c('0x49')]][_0x497c('0x4e')]?this['voiceQueues'][_0x4125df[_0x497c('0x49')]][_0x497c('0x4e')]||'inbound':_0x497c('0x4f');_0x4125df[_0x497c('0x68')]=_0x36fea1['queue'];_0x4125df['queuecallerjoinAt']=moment()['format'](_0x497c('0x76'));_0x4125df[_0x497c('0x77')]=_0x36fea1['position'];_0x4125df[_0x497c('0x78')]=_0x36fea1[_0x497c('0x78')];_0x4125df[_0x497c('0x46')]=_0x36fea1['uniqueid'];_0x4125df[_0x497c('0x79')]=this[_0x497c('0xe')][_0x36fea1[_0x497c('0x46')]]['routealias'];logger['info'](_0x497c('0x7a'),_0x4125df[_0x497c('0x49')],_0x4125df['type']);_[_0x497c('0x7b')](_0x4125df,_[_0x497c('0x7c')](_0x36fea1,_[_0x497c('0x7d')](_0x4125df)));this[_0x497c('0x39')][_0x36fea1[_0x497c('0x46')]][_0x497c('0x7e')](_0x4125df);this['channels'][_0x36fea1['uniqueid']]=_0x4125df;this[_0x497c('0x42')](_0x4125df,'queuecallerjoin');}}catch(_0x256fef){logger[_0x497c('0x38')](_0x497c('0x74'),_0x36fea1[_0x497c('0x46')],util[_0x497c('0x3c')](_0x256fef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x497c('0x2f')]['syncQueueCallerAbandon']=function(_0x3fb887){try{if(this[_0x497c('0x5f')](_0x3fb887)){logger['debug'](_0x497c('0x7f'),_0x3fb887['uniqueid'],util[_0x497c('0x3c')](_0x3fb887,{'showHidden':![],'depth':null}));if(this[_0x497c('0x39')][_0x3fb887[_0x497c('0x46')]]){var _0x5aa430=_[_0x497c('0x80')](this['queueReports'][_0x3fb887[_0x497c('0x46')]]);_0x5aa430[_0x497c('0x81')]=![];_0x5aa430[_0x497c('0x82')]=null;_0x5aa430[_0x497c('0x83')]=_0x3fb887[_0x497c('0x83')];_0x5aa430[_0x497c('0x84')]=_0x3fb887[_0x497c('0x84')];_0x5aa430[_0x497c('0x16')]=!![];_0x5aa430['queuecallerabandonAt']=moment()['format'](_0x497c('0x76'));_0x5aa430[_0x497c('0x85')]=_0x497c('0x86');_0x5aa430['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5aa430[_0x497c('0x49')],_0x5aa430['type']);this[_0x497c('0xe')][_0x3fb887[_0x497c('0x46')]]=_0x5aa430;this[_0x497c('0x3f')](_0x5aa430,_0x497c('0x16'));}}}catch(_0x3b3e84){logger['error'](_0x497c('0x7f'),_0x3fb887['uniqueid'],util[_0x497c('0x3c')](_0x3b3e84,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x497c('0x19')]=function(_0x2b0482){try{if(this[_0x497c('0x5f')](_0x2b0482)){logger[_0x497c('0x43')](_0x497c('0x87'),_0x2b0482['uniqueid'],util['inspect'](_0x2b0482,{'showHidden':![],'depth':null}));if(this[_0x497c('0x39')][_0x2b0482[_0x497c('0x46')]]){var _0x4321a9=_[_0x497c('0x80')](this[_0x497c('0x39')][_0x2b0482[_0x497c('0x46')]]);_0x4321a9[_0x497c('0x88')]=moment()[_0x497c('0x47')](_0x497c('0x76'));_0x4321a9[_0x497c('0x89')]=_0x2b0482[_0x497c('0x89')];_0x4321a9['connectedlinename']=_0x2b0482[_0x497c('0x8a')];logger[_0x497c('0x8b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4321a9[_0x497c('0x49')],_0x4321a9['type'],_0x2b0482[_0x497c('0x89')],_0x2b0482[_0x497c('0x8a')]);this[_0x497c('0xe')][_0x2b0482[_0x497c('0x46')]]=_0x4321a9;this[_0x497c('0x42')](_0x4321a9,'queuecallerleave');}}}catch(_0x537cc2){logger[_0x497c('0x38')](_0x497c('0x87'),_0x2b0482[_0x497c('0x46')],util['inspect'](_0x537cc2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x497c('0x2f')]['syncAgentConnect']=function(_0x19915d){try{if(this[_0x497c('0x5f')](_0x19915d)){logger[_0x497c('0x43')](_0x497c('0x8c'),_0x19915d[_0x497c('0x46')],util['inspect'](_0x19915d,{'showHidden':![],'depth':null}));if(this[_0x497c('0x39')][_0x19915d['uniqueid']]){var _0x1fd4c9=_['last'](this['queueReports'][_0x19915d[_0x497c('0x46')]]);_0x1fd4c9[_0x497c('0x81')]=!![];_0x1fd4c9[_0x497c('0x85')]='COMPLETEDBYAGENT';logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x1fd4c9[_0x497c('0x49')],_0x1fd4c9[_0x497c('0x4e')]);}}}catch(_0x1ab766){logger[_0x497c('0x38')]('[%s][voiceQueueReport][agentconnect]',_0x19915d[_0x497c('0x46')],util[_0x497c('0x3c')](_0x1ab766,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x497c('0x1b')]=function(_0x41630e){try{if(this['isNotNull'](_0x41630e)){logger[_0x497c('0x43')](_0x497c('0x8d'),_0x41630e[_0x497c('0x46')],util[_0x497c('0x3c')](_0x41630e,{'showHidden':![],'depth':null}));if(this[_0x497c('0x39')][_0x41630e[_0x497c('0x46')]]){var _0x1a8402=_[_0x497c('0x80')](this[_0x497c('0x39')][_0x41630e[_0x497c('0x46')]]);_0x1a8402[_0x497c('0x16')]=![];_0x1a8402[_0x497c('0x8e')]=null;_0x1a8402['assigned']=!![];_0x1a8402[_0x497c('0x8f')]=_0x41630e[_0x497c('0x90')];_0x1a8402[_0x497c('0x83')]=_0x41630e[_0x497c('0x83')];_0x1a8402[_0x497c('0x81')]=!![];_0x1a8402[_0x497c('0x91')]=![];_0x1a8402[_0x497c('0x92')]=null;if(!_0x1a8402[_0x497c('0x93')]){if(_0x41630e[_0x497c('0x94')]==_0x497c('0x93')){_0x1a8402['queuecallerexitreason']=_0x497c('0x95');logger[_0x497c('0x8b')](_0x497c('0x96'),_0x1a8402[_0x497c('0x49')],_0x1a8402[_0x497c('0x4e')]);}else{if(_['startsWith'](_0x41630e['channel'][_0x497c('0x97')](),_0x497c('0x98'))){if(this['queueReports'][_0x41630e['linkedid']]){var _0x523c6f=_[_0x497c('0x80')](this[_0x497c('0x39')][_0x41630e[_0x497c('0x99')]]);_0x523c6f[_0x497c('0x81')]=![];_0x523c6f[_0x497c('0x91')]=!![];_0x523c6f['queuecallerexitAt']=moment(_0x1a8402[_0x497c('0x9a')])[_0x497c('0x9b')](_0x41630e[_0x497c('0x83')],_0x497c('0x9c'))[_0x497c('0x47')](_0x497c('0x76'));_0x523c6f['queuecallerexitreason']=_0x497c('0x9d');_0x523c6f[_0x497c('0x93')]=!![];_0x523c6f[_0x497c('0x9e')]=_0x497c('0x9f');_0x523c6f[_0x497c('0xa0')]=_0x41630e[_0x497c('0xa1')];_0x523c6f[_0x497c('0xa2')]=_0x41630e[_0x497c('0x46')];logger[_0x497c('0x8b')](_0x497c('0xa3'),_0x523c6f['name'],_0x523c6f[_0x497c('0x4e')]);var _0x49509d=this['queueReports'][_0x41630e[_0x497c('0x99')]];this[_0x497c('0x39')][_0x41630e[_0x497c('0x99')]]=this[_0x497c('0x39')][_0x41630e[_0x497c('0x46')]];this[_0x497c('0x39')][_0x41630e[_0x497c('0x46')]]=_0x49509d;}}else{_0x1a8402[_0x497c('0x85')]=_0x497c('0xa4')+_0x41630e['reason']['toUpperCase']();logger[_0x497c('0x8b')](_0x497c('0xa5'),_0x1a8402[_0x497c('0x49')],_0x1a8402[_0x497c('0x4e')],_0x1a8402[_0x497c('0x85')]);}}}this[_0x497c('0xe')][_0x41630e[_0x497c('0x46')]]=_0x1a8402;this[_0x497c('0x3f')](_0x1a8402,_0x497c('0x1a'));}}}catch(_0x372842){logger[_0x497c('0x38')](_0x497c('0x8d'),_0x41630e[_0x497c('0x46')],util['inspect'](_0x372842,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x497c('0x2f')][_0x497c('0x1d')]=function(_0x1f5eba){try{if(this['isNotNull'](_0x1f5eba)){logger[_0x497c('0x43')]('[%s][voiceQueueReport][varset]',_0x1f5eba['uniqueid'],util[_0x497c('0x3c')](_0x1f5eba,{'showHidden':![],'depth':null}));this[_0x497c('0xa6')](_0x1f5eba[_0x497c('0x46')],_[_0x497c('0x7d')](_0x1f5eba[_0x497c('0xa7')])[0x0],_0x1f5eba[_0x497c('0xa8')]);if(this['queueReports'][_0x1f5eba[_0x497c('0x46')]]){var _0x560852=_[_0x497c('0x80')](this[_0x497c('0x39')][_0x1f5eba[_0x497c('0x46')]]);if(_0x560852){if(this[_0x497c('0x5f')](_0x1f5eba[_0x497c('0xa7')])&&this[_0x497c('0x5f')](_0x1f5eba[_0x497c('0xa7')]['queuestatus'])){switch(_0x1f5eba[_0x497c('0xa8')]){case _0x497c('0xa9'):_0x560852['queuecallerexit']=![];_0x560852['queuecallerexitAt']=null;break;case _0x497c('0xaa'):_0x560852['lastevent']=_0x497c('0xab');_0x560852[_0x497c('0x91')]=!![];_0x560852[_0x497c('0x92')]=moment()['format'](_0x497c('0x76'));_0x560852[_0x497c('0x88')]=moment()[_0x497c('0x47')](_0x497c('0x76'));logger[_0x497c('0x43')](_0x497c('0xac'),_0x1f5eba[_0x497c('0x46')],util[_0x497c('0x3c')](_0x560852,{'showHidden':![],'depth':null}));ami[_0x497c('0x41')](_0x497c('0xad'),_0x560852);break;default:_0x560852[_0x497c('0x91')]=!![];_0x560852[_0x497c('0x92')]=moment()[_0x497c('0x47')](_0x497c('0x76'));_0x560852[_0x497c('0x88')]=moment()[_0x497c('0x47')](_0x497c('0x76'));}_0x560852[_0x497c('0x16')]=![];_0x560852[_0x497c('0x8e')]=null;_0x560852[_0x497c('0x85')]=_0x1f5eba[_0x497c('0xa8')];this[_0x497c('0xe')][_0x1f5eba[_0x497c('0x46')]]=_0x560852;this['emitVoiceQueueChannelRemove'](_0x560852,'varset');}else if(this[_0x497c('0x5f')](_0x1f5eba[_0x497c('0xa7')])&&this[_0x497c('0x5f')](_0x1f5eba[_0x497c('0xa7')]['queueposition'])){if(!_0x560852['queuecallerabandon']){_0x560852[_0x497c('0x91')]=!![];_0x560852[_0x497c('0x92')]=moment()[_0x497c('0x47')](_0x497c('0x76'));_0x560852['queuecallerexitreason']=_0x497c('0xae');_0x560852[_0x497c('0x88')]=moment()[_0x497c('0x47')](_0x497c('0x76'));this[_0x497c('0xe')][_0x1f5eba['uniqueid']]=_0x560852;}}logger[_0x497c('0x8b')](_0x497c('0xaf'),_0x1f5eba['uniqueid'],_0x560852[_0x497c('0x49')],_0x560852['type'],_[_0x497c('0x7d')](_0x1f5eba['variable'])[0x0],_0x1f5eba[_0x497c('0xa8')]);_0x560852[_0x497c('0x3b')]=this[_0x497c('0x3b')][_0x1f5eba['uniqueid']];}}}}catch(_0x20c91c){logger[_0x497c('0x38')]('[%s][voiceQueueReport][varset]',_0x1f5eba[_0x497c('0x46')],util[_0x497c('0x3c')](_0x20c91c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x497c('0x2f')]['addVariable']=function(_0x48aa46,_0x5a36f8,_0x35a34c){var _0x3bd059=[_0x497c('0xb0'),_0x497c('0xb1'),_0x497c('0xb2'),'rtpaudioqosjitterbridged',_0x497c('0xb3'),_0x497c('0xb4'),'rtpaudioqosrtt',_0x497c('0xb5'),_0x497c('0xb6'),_0x497c('0xb7'),_0x497c('0xb8'),_0x497c('0xb9'),'membercalls','memberdynamic',_0x497c('0xba'),_0x497c('0xbb'),'membername',_0x497c('0xbc'),_0x497c('0xbd')];if(!_[_0x497c('0x32')](_0x5a36f8)&&!_[_0x497c('0xbe')](_0x3bd059,_0x5a36f8)){if(_[_0x497c('0x75')](this[_0x497c('0x3b')][_0x48aa46])){this['variables'][_0x48aa46]={};}this[_0x497c('0x3b')][_0x48aa46][_0x5a36f8]=_0x35a34c;}};VoiceQueueReport[_0x497c('0x2f')]['handleHangup']=function(_0x1dab3f,_0x268198,_0x30615d){var _0x4782be={};for(var _0x359603=0x0;_0x359603=0x0?moment(_0x1b11fa['endtime'])[_0xf1c4('0x18')](_0x1b11fa[_0xf1c4('0x15')],'seconds'):null,'data1':_0xf1c4('0x19'),'data2':_0x1b11fa[_0xf1c4('0x12')],'data3':_0x1b11fa[_0xf1c4('0xf')],'data4':_0x1b11fa[_0xf1c4('0x1a')]||null,'role':'agent','internal':_0x1b11fa['accountcode']?_[_0xf1c4('0x1b')](_0x1b11fa[_0xf1c4('0x12')]):undefined,'uniqueid':_0x1b11fa[_0xf1c4('0x13')]},'log':_0xf1c4('0x6')});}; \ No newline at end of file +var _0x24ab=['lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','accountcode','toNumber','uniqueid','voiceDialReport','Request','starttime','endtime','outbound','agent','moment'];(function(_0x225f3e,_0x3799ba){var _0x2ca71e=function(_0x540fa5){while(--_0x540fa5){_0x225f3e['push'](_0x225f3e['shift']());}};_0x2ca71e(++_0x3799ba);}(_0x24ab,0x6b));var _0xb24a=function(_0x1eb3b0,_0x84bc40){_0x1eb3b0=_0x1eb3b0-0x0;var _0xbecd61=_0x24ab[_0x1eb3b0];return _0xbecd61;};'use strict';var moment=require(_0xb24a('0x0'));var _=require(_0xb24a('0x1'));var util=require(_0xb24a('0x2'));var client=require(_0xb24a('0x3'));exports[_0xb24a('0x4')]=function(_0x5badec){var _0x5d5da8=_0x5badec[_0xb24a('0x5')]||_0x5badec[_0xb24a('0x6')];return client['Request'](_0xb24a('0x7'),{'body':{'channel':_0xb24a('0x8'),'membername':_0x5badec['lastAssignedTo'],'interface':_['isNil'](_0x5badec[_0xb24a('0x9')])?util['format'](_0xb24a('0xa'),_0x5badec['lastAssignedTo']):_0x5badec['interface'],'type':_0xb24a('0xb'),'enterAt':_0x5badec[_0xb24a('0xc')],'exitAt':_0x5d5da8,'duration':moment(_0x5d5da8)[_0xb24a('0xd')](_0x5badec['queuecallerleaveAt'],_0xb24a('0xe')),'data1':'inbound','data2':_0x5badec[_0xb24a('0xf')],'data3':_0x5badec[_0xb24a('0x10')],'data4':null,'data5':_0x5badec[_0xb24a('0x11')],'role':'agent','internal':_0x5badec[_0xb24a('0x12')]?_[_0xb24a('0x13')](_0x5badec[_0xb24a('0x12')]):undefined,'uniqueid':_0x5badec[_0xb24a('0x14')]},'log':_0xb24a('0x7')});};exports[_0xb24a('0x15')]=function(_0x40fb70){return client[_0xb24a('0x16')](_0xb24a('0x7'),{'body':{'channel':_0xb24a('0x8'),'membername':_0x40fb70['membername'],'interface':_0x40fb70[_0xb24a('0x9')],'type':_0xb24a('0xb'),'enterAt':_0x40fb70[_0xb24a('0x17')],'exitAt':_0x40fb70[_0xb24a('0x18')],'duration':moment(_0x40fb70[_0xb24a('0x18')])[_0xb24a('0xd')](_0x40fb70[_0xb24a('0x17')],_0xb24a('0xe'))>=0x0?moment(_0x40fb70['endtime'])[_0xb24a('0xd')](_0x40fb70[_0xb24a('0x17')],'seconds'):null,'data1':_0xb24a('0x19'),'data2':_0x40fb70['accountcode'],'data3':_0x40fb70[_0xb24a('0x10')],'data4':_0x40fb70['dialstring']||null,'role':_0xb24a('0x1a'),'internal':_0x40fb70[_0xb24a('0x12')]?_[_0xb24a('0x13')](_0x40fb70[_0xb24a('0x12')]):undefined,'uniqueid':_0x40fb70[_0xb24a('0x14')]},'log':_0xb24a('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index fa70d50..f1bdb66 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 _0xccbf=['ShowSetting','Request'];(function(_0x38ef82,_0x1a23dd){var _0x3667b3=function(_0x2ae9d9){while(--_0x2ae9d9){_0x38ef82['push'](_0x38ef82['shift']());}};_0x3667b3(++_0x1a23dd);}(_0xccbf,0x1ef));var _0xfccb=function(_0x18beb0,_0x5238d8){_0x18beb0=_0x18beb0-0x0;var _0x37d642=_0xccbf[_0x18beb0];return _0x37d642;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xfccb('0x0')](_0xfccb('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0xe7a0=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2a2f51,_0x2c76cf){var _0x53d7c4=function(_0x3309b3){while(--_0x3309b3){_0x2a2f51['push'](_0x2a2f51['shift']());}};_0x53d7c4(++_0x2c76cf);}(_0xe7a0,0x10d));var _0x0e7a=function(_0x14c807,_0x48627e){_0x14c807=_0x14c807-0x0;var _0x39ec3f=_0xe7a0[_0x14c807];return _0x39ec3f;};'use strict';var client=require(_0x0e7a('0x0'));exports[_0x0e7a('0x1')]=function(){return client[_0x0e7a('0x2')](_0x0e7a('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0e7a('0x4'),_0x0e7a('0x5')]},'log':_0x0e7a('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 8d45c52..83a8a27 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 _0x0874=['name','html','getTemplates','Request','GetTemplate'];(function(_0x2b228d,_0xefd55){var _0x33983d=function(_0x26bd11){while(--_0x26bd11){_0x2b228d['push'](_0x2b228d['shift']());}};_0x33983d(++_0xefd55);}(_0x0874,0xb1));var _0x4087=function(_0x924d32,_0xc48aec){_0x924d32=_0x924d32-0x0;var _0x5c2891=_0x0874[_0x924d32];return _0x5c2891;};'use strict';var client=require('../client');exports[_0x4087('0x0')]=function(_0x571876){return function(_0x6df7cb){return client[_0x4087('0x1')](_0x4087('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4087('0x3'),_0x4087('0x4')]},'log':_0x4087('0x2')});};}; \ No newline at end of file +var _0x98e5=['getTemplates','Request','GetTemplate','html','../client'];(function(_0x342ecc,_0x324c5a){var _0x5bcc97=function(_0x193b4f){while(--_0x193b4f){_0x342ecc['push'](_0x342ecc['shift']());}};_0x5bcc97(++_0x324c5a);}(_0x98e5,0x1c1));var _0x598e=function(_0x25d9dd,_0x4bf73a){_0x25d9dd=_0x25d9dd-0x0;var _0x27fb38=_0x98e5[_0x25d9dd];return _0x27fb38;};'use strict';var client=require(_0x598e('0x0'));exports[_0x598e('0x1')]=function(_0x1619d2){return function(_0x15063e){return client[_0x598e('0x2')](_0x598e('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x598e('0x4')]},'log':_0x598e('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 2b07093..c747b05 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 _0x2451=['getTriggers','Request','name','channel','status','Condition','field','operator','value','AnyConditions','Action','action','data1','data2','data3','data4','data5','data6','../client'];(function(_0x537e92,_0x226199){var _0x6d3d63=function(_0x50cb2c){while(--_0x50cb2c){_0x537e92['push'](_0x537e92['shift']());}};_0x6d3d63(++_0x226199);}(_0x2451,0x155));var _0x1245=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x2451[_0x4e1a49];return _0x136aae;};'use strict';var client=require(_0x1245('0x0'));exports[_0x1245('0x1')]=function(_0x34120d){return function(_0x3c66ac){return client[_0x1245('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x1245('0x3'),_0x1245('0x4'),_0x1245('0x5')],'include':[{'model':_0x1245('0x6'),'as':'AllConditions','attributes':['id',_0x1245('0x7'),_0x1245('0x8'),_0x1245('0x9')]},{'model':'Condition','as':_0x1245('0xa'),'attributes':['id',_0x1245('0x7'),'operator',_0x1245('0x9')]},{'model':_0x1245('0xb'),'as':'Actions','attributes':['id',_0x1245('0xc'),_0x1245('0xd'),_0x1245('0xe'),_0x1245('0xf'),_0x1245('0x10'),_0x1245('0x11'),_0x1245('0x12'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x22db=['AnyConditions','value','Action','action','data2','data3','data4','data5','data6','../client','getTriggers','GetTrigger','name','channel','Condition','operator'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22db,0x199));var _0xb22d=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x22db[_0x4c8a8f];return _0x404500;};'use strict';var client=require(_0xb22d('0x0'));exports[_0xb22d('0x1')]=function(_0x39f314){return function(_0x254b31){return client['Request'](_0xb22d('0x2'),{'options':{'raw':![],'attributes':['id',_0xb22d('0x3'),_0xb22d('0x4'),'status'],'include':[{'model':_0xb22d('0x5'),'as':'AllConditions','attributes':['id','field',_0xb22d('0x6'),'value']},{'model':_0xb22d('0x5'),'as':_0xb22d('0x7'),'attributes':['id','field',_0xb22d('0x6'),_0xb22d('0x8')]},{'model':_0xb22d('0x9'),'as':'Actions','attributes':['id',_0xb22d('0xa'),'data1',_0xb22d('0xb'),_0xb22d('0xc'),_0xb22d('0xd'),_0xb22d('0xe'),_0xb22d('0xf'),'data7']}]},'log':_0xb22d('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e2ad0a2..bac08a4 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 _0x87df=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x40c09d,_0x1628f6){var _0x37c87b=function(_0x2af6cf){while(--_0x2af6cf){_0x40c09d['push'](_0x40c09d['shift']());}};_0x37c87b(++_0x1628f6);}(_0x87df,0x167));var _0xf87d=function(_0x3b5a4a,_0x4096e5){_0x3b5a4a=_0x3b5a4a-0x0;var _0xaaec44=_0x87df[_0x3b5a4a];return _0xaaec44;};'use strict';var client=require(_0xf87d('0x0'));exports[_0xf87d('0x1')]=function(_0x34023a){return function(_0x3151d0){return client[_0xf87d('0x2')](_0xf87d('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf87d('0x4'),_0xf87d('0x5'),_0xf87d('0x6')]},'log':_0xf87d('0x3')});};}; \ No newline at end of file +var _0x6681=['name','registry','GetTrunk','../client','getTrunks','Request'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x6681,0x141));var _0x1668=function(_0x37b393,_0x39d2df){_0x37b393=_0x37b393-0x0;var _0x2d801f=_0x6681[_0x37b393];return _0x2d801f;};'use strict';var client=require(_0x1668('0x0'));exports[_0x1668('0x1')]=function(_0x46efd9){return function(_0x223008){return client[_0x1668('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1668('0x3'),_0x1668('0x4'),'defaultuser']},'log':_0x1668('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 11d8e5d..230c6f9 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(_0x29ad9f,_0x4048be){var _0x18b06c=function(_0x4ceee8){while(--_0x4ceee8){_0x29ad9f['push'](_0x29ad9f['shift']());}};_0x18b06c(++_0x4048be);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xcb91[_0x22e47a];return _0x15a12a;};'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 _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x43998e,_0x3302b1){var _0x59f91d=function(_0x3c76e4){while(--_0x3c76e4){_0x43998e['push'](_0x43998e['shift']());}};_0x59f91d(++_0x3302b1);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index cca6374..689ad4e 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 _0x13a7=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0x13a7,0x9d));var _0x713a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13a7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x713a('0x0'));exports[_0x713a('0x1')]=function(_0x60902a){return client[_0x713a('0x2')](_0x713a('0x3'),{'body':_0x60902a,'log':_0x713a('0x3')});};exports[_0x713a('0x4')]=function(_0x5b0dbd,_0x3f7aa7,_0x141152){return client[_0x713a('0x2')](_0x713a('0x5'),{'body':_0x5b0dbd,'options':{'where':{'uniqueid':_0x3f7aa7,'interface':_0x141152,'agentcomplete':!![]}},'log':_0x713a('0x5')});}; \ No newline at end of file +var _0xf66d=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x538406,_0x25c40b){var _0x18f8fd=function(_0x52ff7f){while(--_0x52ff7f){_0x538406['push'](_0x538406['shift']());}};_0x18f8fd(++_0x25c40b);}(_0xf66d,0xfc));var _0xdf66=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xf66d[_0x2b10c6];return _0x3789d2;};'use strict';var client=require(_0xdf66('0x0'));exports['create']=function(_0x32799c){return client[_0xdf66('0x1')]('CreateVoiceAgentReport',{'body':_0x32799c,'log':_0xdf66('0x2')});};exports[_0xdf66('0x3')]=function(_0xaf5ca3,_0x5808a4,_0x573d04){return client['Request']('UpdateVoiceAgentReport',{'body':_0xaf5ca3,'options':{'where':{'uniqueid':_0x5808a4,'interface':_0x573d04,'agentcomplete':!![]}},'log':_0xdf66('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index c9395ce..cac946c 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 _0x4253=['getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION'];(function(_0x42ae26,_0x31c685){var _0x227794=function(_0x33eabb){while(--_0x33eabb){_0x42ae26['push'](_0x42ae26['shift']());}};_0x227794(++_0x31c685);}(_0x4253,0x109));var _0x3425=function(_0x59c8f7,_0x5016ed){_0x59c8f7=_0x59c8f7-0x0;var _0x10e4f8=_0x4253[_0x59c8f7];return _0x10e4f8;};'use strict';var moment=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var _=require(_0x3425('0x2'));var client=require(_0x3425('0x3'));exports[_0x3425('0x4')]=function(_0x3df661){return client[_0x3425('0x5')](_0x3425('0x6'),{'body':_[_0x3425('0x7')](_0x3df661,{'source':_0x3df661[_0x3425('0x8')],'destinationcontext':_0x3df661[_0x3425('0x9')],'callerid':_0x3df661['callerid'],'amaflags':_0x3425('0xa')}),'log':'CreateVoiceCallReport'});};exports[_0x3425('0xb')]=function(){return function(){return client[_0x3425('0x5')](_0x3425('0xc'),{'options':{'where':{'type':[_0x3425('0xd')],'createdAt':{'$between':[moment()[_0x3425('0xe')](_0x3425('0xf'))[_0x3425('0x10')](_0x3425('0x11')),moment()[_0x3425('0x12')](_0x3425('0xf'))[_0x3425('0x10')](_0x3425('0x11'))]}},'attributes':[_0x3425('0x13'),'disposition',_0x3425('0x14'),_0x3425('0x15')]},'log':_0x3425('0x16')});};}; \ No newline at end of file +var _0x93f4=['YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0x93f4,0x1df));var _0x493f=function(_0x46f557,_0x599d31){_0x46f557=_0x46f557-0x0;var _0x3963e2=_0x93f4[_0x46f557];return _0x3963e2;};'use strict';var moment=require('moment');var util=require(_0x493f('0x0'));var _=require(_0x493f('0x1'));var client=require(_0x493f('0x2'));exports[_0x493f('0x3')]=function(_0x4ecf10){return client[_0x493f('0x4')](_0x493f('0x5'),{'body':_['merge'](_0x4ecf10,{'source':_0x4ecf10[_0x493f('0x6')],'destinationcontext':_0x4ecf10[_0x493f('0x7')],'callerid':_0x4ecf10[_0x493f('0x8')],'amaflags':_0x493f('0x9')}),'log':_0x493f('0x5')});};exports[_0x493f('0xa')]=function(){return function(){return client[_0x493f('0x4')](_0x493f('0xb'),{'options':{'where':{'type':[_0x493f('0xc')],'createdAt':{'$between':[moment()[_0x493f('0xd')]('day')[_0x493f('0xe')](_0x493f('0xf')),moment()[_0x493f('0x10')](_0x493f('0x11'))[_0x493f('0xe')](_0x493f('0xf'))]}},'attributes':[_0x493f('0x12'),'disposition','duration','billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 5447b85..193705a 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 _0x74e0=['CreateVoiceDialReport','../client','create','Request'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x74e0,0x1d9));var _0x074e=function(_0x15aaff,_0x16d0c2){_0x15aaff=_0x15aaff-0x0;var _0x5aa315=_0x74e0[_0x15aaff];return _0x5aa315;};'use strict';var client=require(_0x074e('0x0'));exports[_0x074e('0x1')]=function(_0x4fa94f){return client[_0x074e('0x2')]('CreateVoiceDialReport',{'body':_0x4fa94f,'log':_0x074e('0x3')});}; \ No newline at end of file +var _0xcbed=['Request','CreateVoiceDialReport'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcbed,0x11e));var _0xdcbe=function(_0x2f92a8,_0x316a39){_0x2f92a8=_0x2f92a8-0x0;var _0x19f07a=_0xcbed[_0x2f92a8];return _0x19f07a;};'use strict';var client=require('../client');exports['create']=function(_0x169e79){return client[_0xdcbe('0x0')](_0xdcbe('0x1'),{'body':_0x169e79,'log':_0xdcbe('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 524b27a..0b6086d 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 _0x0439=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x0439,0xdd));var _0x9043=function(_0x5efe42,_0x10ff15){_0x5efe42=_0x5efe42-0x0;var _0x25feb2=_0x0439[_0x5efe42];return _0x25feb2;};'use strict';var client=require(_0x9043('0x0'));exports[_0x9043('0x1')]=function(){return function(){return client[_0x9043('0x2')](_0x9043('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9043('0x4'),_0x9043('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x9043('0x1')});};}; \ No newline at end of file +var _0xadcc=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client','Request'];(function(_0x4dfd10,_0x3169d5){var _0x267950=function(_0x15b4ae){while(--_0x15b4ae){_0x4dfd10['push'](_0x4dfd10['shift']());}};_0x267950(++_0x3169d5);}(_0xadcc,0x76));var _0xcadc=function(_0x2e226e,_0x4a5900){_0x2e226e=_0x2e226e-0x0;var _0x13f874=_0xadcc[_0x2e226e];return _0x13f874;};'use strict';var client=require(_0xcadc('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xcadc('0x1')](_0xcadc('0x2'),{'options':{'raw':!![],'attributes':['id',_0xcadc('0x3'),_0xcadc('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xcadc('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 83c90f7..33f931f 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 _0x1488=['Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','TrunkBackup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1488,0xfc));var _0x8148=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x1488[_0x2cc0b3];return _0x1667ef;};'use strict';var client=require(_0x8148('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x8148('0x1')](_0x8148('0x2'),{'options':{'raw':![],'attributes':['id',_0x8148('0x3'),_0x8148('0x4'),_0x8148('0x5'),_0x8148('0x6'),'monitor_format',_0x8148('0x7'),_0x8148('0x8'),_0x8148('0x9'),'dialLimitChannel','dialLimitQueue',_0x8148('0xa'),_0x8148('0xb'),_0x8148('0xc'),_0x8148('0xd'),_0x8148('0xe'),_0x8148('0xf'),_0x8148('0x10'),_0x8148('0x11'),_0x8148('0x12'),'dialQueueProject',_0x8148('0x13'),_0x8148('0x14'),_0x8148('0x15'),_0x8148('0x16'),_0x8148('0x17'),'dialNoAnswerRetryFrequency',_0x8148('0x18'),_0x8148('0x19'),'dialGlobalInterval','dialPrefix',_0x8148('0x1a'),_0x8148('0x1b'),'dialAMDInitialSilence',_0x8148('0x1c'),_0x8148('0x1d'),_0x8148('0x1e'),_0x8148('0x1f'),_0x8148('0x20'),_0x8148('0x21'),_0x8148('0x22'),'dialAMDMaximumWordLength',_0x8148('0x23'),'dialRecallMeTimeout',_0x8148('0x24'),'dialOrderByScheduledAt',_0x8148('0x25'),_0x8148('0x26'),_0x8148('0x27'),_0x8148('0x28'),'strategy',_0x8148('0x29'),'dialCutDigit',_0x8148('0x2a'),_0x8148('0x2b'),_0x8148('0x2c'),_0x8148('0x2d'),_0x8148('0x2e'),_0x8148('0x2f'),'dialMachineMaxRetry',_0x8148('0x30'),'dialAgentRejectMaxRetry',_0x8148('0x31'),_0x8148('0x32'),_0x8148('0x33'),_0x8148('0x34'),_0x8148('0x35'),_0x8148('0x36'),'callAdditionalPhoneAfterMin'],'include':[{'model':'Trunk','as':_0x8148('0x37'),'attributes':['id',_0x8148('0x3'),_0x8148('0x38'),'active']},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x8148('0x37'),'as':_0x8148('0x39'),'attributes':['id',_0x8148('0x3'),_0x8148('0x38'),'active']},{'model':_0x8148('0x3a'),'as':_0x8148('0x3a'),'attributes':['id',_0x8148('0x3')],'include':[{'model':_0x8148('0x3a'),'as':_0x8148('0x3b'),'attributes':['id',_0x8148('0x3'),_0x8148('0x3c')]}]}]},'log':_0x8148('0x3d')});};}; \ No newline at end of file +var _0xf40f=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf40f,0x1ca));var _0xff40=function(_0x239b31,_0x44a64d){_0x239b31=_0x239b31-0x0;var _0x41c8be=_0xf40f[_0x239b31];return _0x41c8be;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0xff40('0x0')](_0xff40('0x1'),{'options':{'raw':![],'attributes':['id',_0xff40('0x2'),'acw',_0xff40('0x3'),_0xff40('0x4'),_0xff40('0x5'),_0xff40('0x6'),_0xff40('0x7'),'dialMethod',_0xff40('0x8'),_0xff40('0x9'),'dialPowerLevel',_0xff40('0xa'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xff40('0xb'),_0xff40('0xc'),_0xff40('0xd'),_0xff40('0xe'),_0xff40('0xf'),_0xff40('0x10'),_0xff40('0x11'),_0xff40('0x12'),_0xff40('0x13'),_0xff40('0x14'),'dialNoAnswerMaxRetry',_0xff40('0x15'),_0xff40('0x16'),_0xff40('0x17'),_0xff40('0x18'),'dialPrefix',_0xff40('0x19'),_0xff40('0x1a'),_0xff40('0x1b'),_0xff40('0x1c'),_0xff40('0x1d'),_0xff40('0x1e'),_0xff40('0x1f'),_0xff40('0x20'),_0xff40('0x21'),'dialAMDSilenceThreshold',_0xff40('0x22'),_0xff40('0x23'),_0xff40('0x24'),_0xff40('0x25'),_0xff40('0x26'),_0xff40('0x27'),_0xff40('0x28'),'dialQueueProject2',_0xff40('0x5'),_0xff40('0x29'),'dialRandomLastDigitCallerIdNumber',_0xff40('0x2a'),_0xff40('0x2b'),_0xff40('0x2c'),_0xff40('0x2d'),'dialDropRetryFrequency',_0xff40('0x2e'),_0xff40('0x2f'),_0xff40('0x30'),_0xff40('0x31'),_0xff40('0x32'),'dialAgentRejectRetryFrequency',_0xff40('0x33'),_0xff40('0x34'),_0xff40('0x35'),_0xff40('0x36'),_0xff40('0x37'),_0xff40('0x38')],'include':[{'model':_0xff40('0x39'),'as':_0xff40('0x39'),'attributes':['id',_0xff40('0x2'),_0xff40('0x3a'),_0xff40('0x3b')]},{'model':_0xff40('0x3c'),'as':_0xff40('0x3d'),'attributes':['id',_0xff40('0x2')]},{'model':_0xff40('0x39'),'as':_0xff40('0x3e'),'attributes':['id',_0xff40('0x2'),'callerid','active']},{'model':_0xff40('0x3f'),'as':'Interval','attributes':['id',_0xff40('0x2')],'include':[{'model':_0xff40('0x3f'),'as':_0xff40('0x40'),'attributes':['id',_0xff40('0x2'),_0xff40('0x41')]}]}]},'log':_0xff40('0x42')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 24cf780..a6d4c87 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(_0x577ad9,_0xdcf145){var _0x1918d6=function(_0x4e1851){while(--_0x4e1851){_0x577ad9['push'](_0x577ad9['shift']());}};_0x1918d6(++_0xdcf145);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x480fd4,_0x3c570b){var _0x264b55=function(_0x302bbd){while(--_0x302bbd){_0x480fd4['push'](_0x480fd4['shift']());}};_0x264b55(++_0x3c570b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 e7b3336..d7183f3 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 _0x8bd6=['getVoiceQueueRtPauses','Request'];(function(_0x5b0c7e,_0x4e660a){var _0x217560=function(_0xf9f08e){while(--_0xf9f08e){_0x5b0c7e['push'](_0x5b0c7e['shift']());}};_0x217560(++_0x4e660a);}(_0x8bd6,0x19a));var _0x68bd=function(_0x1780ad,_0x582625){_0x1780ad=_0x1780ad-0x0;var _0x5c292c=_0x8bd6[_0x1780ad];return _0x5c292c;};'use strict';var client=require('../client');exports[_0x68bd('0x0')]=function(_0x3ec844){return function(){return client[_0x68bd('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x3ec844,'paused':!![]},'raw':!![]},'log':_0x68bd('0x0')});};}; \ No newline at end of file +var _0x38c3=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x3e3147,_0x4aa189){var _0xb82c1a=function(_0x3aa496){while(--_0x3aa496){_0x3e3147['push'](_0x3e3147['shift']());}};_0xb82c1a(++_0x4aa189);}(_0x38c3,0xed));var _0x338c=function(_0x10a467,_0x4f75be){_0x10a467=_0x10a467-0x0;var _0x39bcbb=_0x38c3[_0x10a467];return _0x39bcbb;};'use strict';var client=require(_0x338c('0x0'));exports[_0x338c('0x1')]=function(_0x187f18){return function(){return client[_0x338c('0x2')](_0x338c('0x3'),{'options':{'where':{'VoiceQueueId':_0x187f18,'paused':!![]},'raw':!![]},'log':_0x338c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 66146ed..d723aac 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x537b88,_0x4804fa){var _0x408aab=function(_0x2bcbf9){while(--_0x2bcbf9){_0x537b88['push'](_0x537b88['shift']());}};_0x408aab(++_0x4804fa);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x538534,_0x5ee916){var _0x105076=function(_0x2032be){while(--_0x2032be){_0x538534['push'](_0x538534['shift']());}};_0x105076(++_0x5ee916);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 fea96c9..ec79ee9 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 _0x0f42=['secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','blind','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode'];(function(_0x62bc17,_0x236ee9){var _0x76cf0c=function(_0x5f4945){while(--_0x5f4945){_0x62bc17['push'](_0x62bc17['shift']());}};_0x76cf0c(++_0x236ee9);}(_0x0f42,0x17e));var _0x20f4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0f42[_0x432682];return _0x463d05;};'use strict';var client=require(_0x20f4('0x0'));exports[_0x20f4('0x1')]={};exports[_0x20f4('0x2')]=function(_0x5aedb5){return client[_0x20f4('0x3')](_0x20f4('0x4'),{'body':{'result':_0x5aedb5[_0x20f4('0x5')],'transfererchannel':_0x5aedb5[_0x20f4('0x6')],'transferercalleridnum':_0x5aedb5[_0x20f4('0x7')],'transferercalleridname':_0x5aedb5[_0x20f4('0x8')],'transfererconnectedlinenum':_0x5aedb5['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5aedb5[_0x20f4('0x9')],'transfereraccountcode':_0x5aedb5[_0x20f4('0xa')],'transferercontext':_0x5aedb5['transferercontext'],'transfererexten':_0x5aedb5[_0x20f4('0xb')],'transfererlinkedid':_0x5aedb5[_0x20f4('0xc')],'transfereechannel':_0x5aedb5[_0x20f4('0xd')],'transfereecalleridnum':_0x5aedb5['transfereecalleridnum'],'transfereecalleridname':_0x5aedb5[_0x20f4('0xe')],'transfereeconnectedlinenum':_0x5aedb5['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5aedb5[_0x20f4('0xf')],'transfereeaccountcode':_0x5aedb5[_0x20f4('0x10')],'transfereecontext':_0x5aedb5[_0x20f4('0x11')],'transfereeexten':_0x5aedb5[_0x20f4('0x12')],'transfereelinkedid':_0x5aedb5[_0x20f4('0x13')],'isexternal':_0x5aedb5[_0x20f4('0x14')],'context':_0x5aedb5['context'],'extension':_0x5aedb5['extension'],'type':_0x20f4('0x15')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x2e9da6){return client[_0x20f4('0x3')](_0x20f4('0x4'),{'body':{'result':_0x2e9da6[_0x20f4('0x5')],'transfererchannel':_0x2e9da6[_0x20f4('0x16')],'transferercalleridnum':_0x2e9da6['origtransferercalleridnum'],'transferercalleridname':_0x2e9da6['origtransferercalleridname'],'transfererconnectedlinenum':_0x2e9da6[_0x20f4('0x17')],'transfererconnectedlinename':_0x2e9da6['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2e9da6[_0x20f4('0x18')],'transferercontext':_0x2e9da6['secondtransferercontext'],'transfererexten':_0x2e9da6[_0x20f4('0x19')],'transfererlinkedid':_0x2e9da6['origtransfererlinkedid'],'transfereechannel':_0x2e9da6[_0x20f4('0x1a')],'transfereecalleridnum':_0x2e9da6[_0x20f4('0x1b')],'transfereecalleridname':_0x2e9da6[_0x20f4('0x1c')],'transfereeconnectedlinenum':_0x2e9da6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2e9da6[_0x20f4('0x1d')],'transfereeaccountcode':_0x2e9da6[_0x20f4('0x1e')],'transfereecontext':_0x2e9da6[_0x20f4('0x1f')],'transfereeexten':_0x2e9da6[_0x20f4('0x20')],'transfereelinkedid':_0x2e9da6[_0x20f4('0x21')],'isexternal':_0x2e9da6['isexternal'],'context':_0x2e9da6[_0x20f4('0x22')],'extension':_0x2e9da6[_0x20f4('0x23')],'type':_0x20f4('0x24')},'log':_0x20f4('0x4')});}; \ No newline at end of file +var _0x8354=['origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten'];(function(_0x44d1a8,_0x21aa15){var _0x41ad8f=function(_0x20a72e){while(--_0x20a72e){_0x44d1a8['push'](_0x44d1a8['shift']());}};_0x41ad8f(++_0x21aa15);}(_0x8354,0xd4));var _0x4835=function(_0x58d07f,_0x301a6d){_0x58d07f=_0x58d07f-0x0;var _0x522104=_0x8354[_0x58d07f];return _0x522104;};'use strict';var client=require('../client');exports[_0x4835('0x0')]={};exports[_0x4835('0x1')]=function(_0xfc3ad9){return client[_0x4835('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xfc3ad9[_0x4835('0x3')],'transfererchannel':_0xfc3ad9[_0x4835('0x4')],'transferercalleridnum':_0xfc3ad9['transferercalleridnum'],'transferercalleridname':_0xfc3ad9['transferercalleridname'],'transfererconnectedlinenum':_0xfc3ad9[_0x4835('0x5')],'transfererconnectedlinename':_0xfc3ad9[_0x4835('0x6')],'transfereraccountcode':_0xfc3ad9[_0x4835('0x7')],'transferercontext':_0xfc3ad9[_0x4835('0x8')],'transfererexten':_0xfc3ad9[_0x4835('0x9')],'transfererlinkedid':_0xfc3ad9['transfererlinkedid'],'transfereechannel':_0xfc3ad9[_0x4835('0xa')],'transfereecalleridnum':_0xfc3ad9[_0x4835('0xb')],'transfereecalleridname':_0xfc3ad9[_0x4835('0xc')],'transfereeconnectedlinenum':_0xfc3ad9[_0x4835('0xd')],'transfereeconnectedlinename':_0xfc3ad9['transfereeconnectedlinename'],'transfereeaccountcode':_0xfc3ad9[_0x4835('0xe')],'transfereecontext':_0xfc3ad9['transfereecontext'],'transfereeexten':_0xfc3ad9[_0x4835('0xf')],'transfereelinkedid':_0xfc3ad9[_0x4835('0x10')],'isexternal':_0xfc3ad9[_0x4835('0x11')],'context':_0xfc3ad9['context'],'extension':_0xfc3ad9[_0x4835('0x12')],'type':'blind'},'log':_0x4835('0x13')});};exports[_0x4835('0x14')]=function(_0x37d126){return client[_0x4835('0x2')](_0x4835('0x13'),{'body':{'result':_0x37d126['result'],'transfererchannel':_0x37d126[_0x4835('0x15')],'transferercalleridnum':_0x37d126[_0x4835('0x16')],'transferercalleridname':_0x37d126[_0x4835('0x17')],'transfererconnectedlinenum':_0x37d126[_0x4835('0x18')],'transfererconnectedlinename':_0x37d126[_0x4835('0x19')],'transfereraccountcode':_0x37d126[_0x4835('0x1a')],'transferercontext':_0x37d126['secondtransferercontext'],'transfererexten':_0x37d126[_0x4835('0x1b')],'transfererlinkedid':_0x37d126[_0x4835('0x1c')],'transfereechannel':_0x37d126[_0x4835('0x1d')],'transfereecalleridnum':_0x37d126[_0x4835('0x1e')],'transfereecalleridname':_0x37d126[_0x4835('0x1f')],'transfereeconnectedlinenum':_0x37d126[_0x4835('0x20')],'transfereeconnectedlinename':_0x37d126[_0x4835('0x21')],'transfereeaccountcode':_0x37d126[_0x4835('0x22')],'transfereecontext':_0x37d126[_0x4835('0x23')],'transfereeexten':_0x37d126[_0x4835('0x24')],'transfereelinkedid':_0x37d126[_0x4835('0x25')],'isexternal':_0x37d126[_0x4835('0x11')],'context':_0x37d126[_0x4835('0x26')],'extension':_0x37d126[_0x4835('0x27')],'type':'attended'},'log':_0x4835('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8013ddc..bf6fecd 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 _0x97c1=['dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','find','omit','undefined','values','channels','length','voicechannel','map','uniqueid','channel','format','%s.%s','filename','wav','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','destinationchannel','StopMixMonitor','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','../properties','../ami','listen','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','keys','module','action','Reload','Action','then','message','join','pick','command','Command','content','catch','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var jayson=require('jayson/promise');var schema=require(_0x197c('0x2'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x197c('0x3'));var ami=require(_0x197c('0x4'));exports[_0x197c('0x5')]=function(_0x37ac05,_0x40863c,_0x4a6f09){return new Promise(function(_0x5cbff6,_0x1cb6e1){var _0x437214={'QueuePause':function(_0x60fab2){return new Promise(function(_0xfcee35){var _0x5cf5cb=util['format'](_0x197c('0x6'),'SIP',_0x60fab2[_0x197c('0x7')]);if(_0x37ac05[_0x197c('0x8')]&&_0x37ac05[_0x197c('0x8')][_0x5cf5cb]&&_0x37ac05[_0x197c('0x8')][_0x5cf5cb]['timer']){_0x37ac05[_0x197c('0x8')][_0x5cf5cb][_0x197c('0x9')]();}if(_0x37ac05[_0x197c('0xa')][_0x5cf5cb]){_0x37ac05[_0x197c('0xa')][_0x5cf5cb][_0x197c('0xb')]({'statePause':_0x60fab2['pause']?!![]:![]});}_0xfcee35({'code':0xc8,'message':_0x197c('0xc')});});},'Reload':function(_0x668f8){var _0x27e46f=this;return new Promise(function(_0x1adcfa,_0x567658){if(ami[_0x197c('0xd')]()==![]){return _0x567658(_0x27e46f[_0x197c('0xe')](0x1f4,[config[_0x197c('0xf')]['ip'],config[_0x197c('0xf')][_0x197c('0x10')],_0x197c('0x11')]['join']('\x20')));}_0x668f8=_['pick'](_0x668f8,_[_0x197c('0x12')](properties[_0x197c('0x13')]));_0x668f8[_0x197c('0x14')]=_0x197c('0x15');return ami[_0x197c('0x16')](_0x668f8)[_0x197c('0x17')](function(_0x437050){_0x1adcfa({'code':0xc8,'message':_0x437050[_0x197c('0x18')]});})['catch'](function(_0x372311){_0x567658(_0x27e46f['error'](0x1f5,_0x372311['message']));});});},'Command':function(_0x1725d9){var _0x226756=this;return new Promise(function(_0x2eca5e,_0x2ce10d){if(ami['isConnected']()==![]){return _0x2ce10d(_0x226756[_0x197c('0xe')](0x1f4,[config[_0x197c('0xf')]['ip'],config[_0x197c('0xf')]['username'],_0x197c('0x11')][_0x197c('0x19')]('\x20')));}_0x1725d9=_[_0x197c('0x1a')](_0x1725d9,_0x197c('0x1b'));_0x1725d9[_0x197c('0x14')]=_0x197c('0x1c');return ami[_0x197c('0x16')](_0x1725d9)[_0x197c('0x17')](function(_0x8963fd){_0x2eca5e({'code':0xc8,'message':_0x8963fd[_0x197c('0x1d')]});})[_0x197c('0x1e')](function(_0x177bc9){_0x2ce10d(_0x226756[_0x197c('0xe')](0x1f5,_0x177bc9[_0x197c('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x37b040){var _0x25486a=[];for(var _0x5f4a02 in _0x37ac05[_0x197c('0x1f')]){if(_0x37ac05[_0x197c('0x1f')][_0x197c('0x20')](_0x5f4a02)){var _0x499051=_0x37ac05[_0x197c('0x1f')][_0x5f4a02];var _0x3331ac={'id':_0x499051['id'],'name':_0x499051['name'],'strategy':_0x499051['strategy'],'answered':_0x499051[_0x197c('0x21')],'available':_0x499051['available'],'loggedIn':_0x499051[_0x197c('0x22')],'pTalking':_0x499051[_0x197c('0x23')],'sumBillable':_0x499051[_0x197c('0x24')],'sumDuration':_0x499051[_0x197c('0x25')],'sumHoldTime':_0x499051[_0x197c('0x26')]||0x0,'talking':_0x499051[_0x197c('0x27')],'total':_0x499051[_0x197c('0x28')],'type':_0x499051[_0x197c('0x29')],'unmanaged':_0x499051[_0x197c('0x2a')],'abandoned':_0x499051['abandoned'],'waiting':_0x499051['waiting'],'loggedInDb':_0x499051['loggedInDb']};if(_0x499051['type']===_0x197c('0x2b')){_0x3331ac['dialActive']=_0x499051[_0x197c('0x2c')];_0x3331ac[_0x197c('0x2d')]=_0x499051['dialMethod'];_0x3331ac[_0x197c('0x2e')]=_0x499051['dialOriginateCallerIdName'];_0x3331ac[_0x197c('0x2f')]=_0x499051[_0x197c('0x2f')];_0x3331ac[_0x197c('0x30')]=_0x499051[_0x197c('0x30')];_0x3331ac[_0x197c('0x31')]=_0x499051[_0x197c('0x31')];_0x3331ac[_0x197c('0x32')]=_0x499051[_0x197c('0x32')];_0x3331ac[_0x197c('0x33')]=_0x499051['outboundAnswerAgiCallsDay'];_0x3331ac['outboundAnswerCallsDay']=_0x499051[_0x197c('0x34')];_0x3331ac[_0x197c('0x35')]=_0x499051[_0x197c('0x35')];_0x3331ac[_0x197c('0x36')]=_0x499051[_0x197c('0x36')];_0x3331ac[_0x197c('0x37')]=_0x499051[_0x197c('0x37')];_0x3331ac['outboundDropCallsDayACS']=_0x499051['outboundDropCallsDayACS'];_0x3331ac[_0x197c('0x38')]=_0x499051[_0x197c('0x38')];_0x3331ac['outboundDropCallsDayTimeout']=_0x499051['outboundDropCallsDayTimeout'];_0x3331ac[_0x197c('0x39')]=_0x499051[_0x197c('0x39')];_0x3331ac[_0x197c('0x3a')]=_0x499051[_0x197c('0x3a')];_0x3331ac[_0x197c('0x3b')]=_0x499051[_0x197c('0x3b')];_0x3331ac[_0x197c('0x3c')]=_0x499051[_0x197c('0x3c')];_0x3331ac[_0x197c('0x3d')]=_0x499051['outboundRejectCallsDay'];_0x3331ac[_0x197c('0x3e')]=_0x499051[_0x197c('0x3e')];_0x3331ac[_0x197c('0x3f')]=_0x499051[_0x197c('0x3f')];_0x3331ac[_0x197c('0x40')]=_0x499051[_0x197c('0x40')];_0x3331ac['predictiveIntervalAvgTalktime']=_0x499051[_0x197c('0x41')];_0x3331ac[_0x197c('0x42')]=_0x499051[_0x197c('0x42')];_0x3331ac['predictiveIntervalDroppedCallsTimeout']=_0x499051[_0x197c('0x43')];_0x3331ac[_0x197c('0x44')]=_0x499051[_0x197c('0x44')];_0x3331ac[_0x197c('0x45')]=_0x499051[_0x197c('0x45')];_0x3331ac[_0x197c('0x46')]=_0x499051[_0x197c('0x46')];_0x3331ac[_0x197c('0x47')]=_0x499051[_0x197c('0x47')];_0x3331ac[_0x197c('0x48')]=_0x499051['predictiveIntervalPauses'];_0x3331ac[_0x197c('0x49')]=_0x499051[_0x197c('0x49')];_0x3331ac['predictiveIntervalTotalCalls']=_0x499051['predictiveIntervalTotalCalls'];_0x3331ac[_0x197c('0x18')]=_0x499051[_0x197c('0x18')];_0x3331ac[_0x197c('0x4a')]=_0x499051[_0x197c('0x4a')];_0x3331ac[_0x197c('0x4b')]=_0x499051['erlangCalls'];_0x3331ac[_0x197c('0x4c')]=_0x499051[_0x197c('0x4c')];_0x3331ac[_0x197c('0x4d')]=_0x499051[_0x197c('0x4d')];_0x3331ac[_0x197c('0x4e')]=_0x499051['erlangBusyFactor'];_0x3331ac[_0x197c('0x4f')]=_0x499051[_0x197c('0x4f')];_0x3331ac[_0x197c('0x50')]=_0x499051[_0x197c('0x50')];}if(_0x499051[_0x197c('0x51')]){_0x3331ac['Trunk']={'id':_0x499051[_0x197c('0x51')]['id'],'name':_0x499051[_0x197c('0x51')][_0x197c('0x7')],'active':_0x499051[_0x197c('0x51')][_0x197c('0x52')],'callerid':_0x499051[_0x197c('0x51')][_0x197c('0x53')]};}if(_0x499051[_0x197c('0x54')]){_0x3331ac[_0x197c('0x54')]={'id':_0x499051[_0x197c('0x54')]['id'],'name':_0x499051[_0x197c('0x54')]['name']};}_0x25486a['push'](_0x3331ac);}}_0x37b040({'count':_0x25486a['length'],'rows':_0x25486a});});},'UpdateVoiceQueue':function(_0x54d9d5){return new Promise(function(_0x256501,_0x34271f){var _0x5ea915=_[_0x197c('0x55')](_0x37ac05[_0x197c('0x1f')],{'id':parseInt(_0x54d9d5['id'])});var _0x538449=_[_0x197c('0x56')](_0x54d9d5,['id']);if(_0x5ea915){for(var _0x106f24 in _0x538449){if(typeof _0x538449[_0x106f24]!=='undefined'&&typeof _0x5ea915[_0x106f24]!==_0x197c('0x57')){_0x5ea915[_0x106f24]=_0x538449[_0x106f24];}}_0x256501(_0x5ea915);}else{_0x34271f();}});},'VoiceChannels':function(){return new Promise(function(_0x233ae1){var _0x47e652=_[_0x197c('0x58')](_0x37ac05[_0x197c('0x59')]);_0x233ae1({'count':_0x47e652[_0x197c('0x5a')],'rows':_0x47e652});});},'VoiceChannelMixMonitor':function(_0x5b4e52){var _0x3b36e5=this;return new Promise(function(_0x3f26df,_0x220909){if(ami[_0x197c('0xd')]()==![]){return _0x220909(_0x3b36e5['error'](0x1f4,[config[_0x197c('0xf')]['ip'],config[_0x197c('0xf')][_0x197c('0x10')],'ami\x20disconnected']['join']('\x20')));}var _0x3a5089=schema(properties[_0x197c('0x5b')])[_0x197c('0x2')](_0x5b4e52);if(_0x3a5089[_0x197c('0x5a')]>0x0){return _0x220909(_0x3b36e5[_0x197c('0xe')](0x1f4,_[_0x197c('0x5c')](_0x3a5089,'message')[_0x197c('0x19')](',\x20')));}var _0x5cd670=_[_0x197c('0x55')](_0x37ac05[_0x197c('0x59')],{'uniqueid':_0x5b4e52[_0x197c('0x5d')]});if(_0x5cd670&&_0x5cd670[_0x197c('0x5e')]){var _0x34a211=util[_0x197c('0x5f')](_0x197c('0x60'),_0x5b4e52[_0x197c('0x61')]||_0x5b4e52['uniqueid'],_0x5b4e52[_0x197c('0x5f')]||_0x197c('0x62'));return ami[_0x197c('0x16')]({'action':'MixMonitor','channel':_0x5cd670[_0x197c('0x5e')],'file':_0x34a211,'options':'ai(mixmonitorid)'})[_0x197c('0x17')](function(_0x1d2a5f){var _0x1ec51a=_[_0x197c('0x55')](_0x5cd670[_0x197c('0x63')],{'filename':_0x197c('0x64')+_0x34a211[_0x197c('0x65')]()});if(_[_0x197c('0x66')](_0x1ec51a)){_0x5cd670['monitors'][_0x197c('0x67')]({'filename':_0x197c('0x64')+_0x34a211[_0x197c('0x65')](),'createdAt':moment()['format'](_0x197c('0x68')),'mixmonitorid':_0x1d2a5f[_0x197c('0x69')],'status':_0x197c('0x6a')});}else{_0x1ec51a[_0x197c('0x69')]=_0x1d2a5f[_0x197c('0x69')];_0x1ec51a['status']='rec';}_0x3f26df({'code':0xc8,'message':[_0x5b4e52[_0x197c('0x5d')],_0x197c('0x6b'),_0x1d2a5f[_0x197c('0x69')]][_0x197c('0x19')]('\x20'),'mixmonitorid':_0x1d2a5f[_0x197c('0x69')]});})['catch'](function(_0x5c2c1c){_0x220909(_0x3b36e5[_0x197c('0xe')](0x1f5,[_0x5b4e52[_0x197c('0x5d')],_0x5c2c1c['message'][_0x197c('0x65')]()][_0x197c('0x19')]('\x20')));});}else{return _0x220909(_0x3b36e5[_0x197c('0xe')](0x1f5,_0x197c('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0xc10419){var _0x35d83a=this;return new Promise(function(_0x4e8c5b,_0x431100){if(ami[_0x197c('0xd')]()==![]){return _0x431100(_0x35d83a['error'](0x1f4,[config['asterisk']['ip'],config[_0x197c('0xf')]['username'],_0x197c('0x11')][_0x197c('0x19')]('\x20')));}var _0x382602=schema(properties['voicechannel'])[_0x197c('0x2')](_0xc10419);if(_0x382602[_0x197c('0x5a')]>0x0){return _0x431100(_0x35d83a['error'](0x1f4,_[_0x197c('0x5c')](_0x382602,_0x197c('0x18'))[_0x197c('0x19')](',\x20')));}var _0x5ebd0b=_[_0x197c('0x55')](_0x37ac05[_0x197c('0x59')],{'uniqueid':_0xc10419['uniqueid']});if(_0x5ebd0b){return Promise['resolve']()[_0x197c('0x17')](function(){if(_0x5ebd0b[_0x197c('0x5e')]){return ami[_0x197c('0x16')]({'action':'StopMixMonitor','channel':_0x5ebd0b[_0x197c('0x5e')],'mixmonitorid':_0xc10419[_0x197c('0x69')]})[_0x197c('0x1e')](function(){});}})['then'](function(){if(_0x5ebd0b[_0x197c('0x6d')]){return ami[_0x197c('0x16')]({'action':_0x197c('0x6e'),'channel':_0x5ebd0b[_0x197c('0x6d')],'mixmonitorid':_0xc10419[_0x197c('0x69')]})[_0x197c('0x1e')](function(){});}})[_0x197c('0x17')](function(){var _0xaf09a=_[_0x197c('0x55')](_0x5ebd0b[_0x197c('0x63')],{'mixmonitorid':_0xc10419['mixmonitorid']});if(_0xaf09a){_0xaf09a[_0x197c('0x6f')]='stop';}})['then'](function(){var _0x4a8e13=util['format'](_0x197c('0x60'),_0xc10419[_0x197c('0x61')]||_0xc10419[_0x197c('0x5d')],_0xc10419[_0x197c('0x5f')]||'wav');var _0x32d739=_['find'](_0x5ebd0b[_0x197c('0x63')],{'filename':'/var/spool/asterisk/monitor/'+_0x4a8e13[_0x197c('0x65')]()});if(_0x32d739){_0x32d739['status']=_0x197c('0x70');}})[_0x197c('0x17')](function(){_0x4e8c5b({'code':0xc8,'message':[_0xc10419[_0x197c('0x5d')],_0x197c('0x71')]['join']('\x20')});})[_0x197c('0x1e')](function(_0x304cb7){_0x431100(_0x35d83a[_0x197c('0xe')](0x1f5,[_0xc10419['uniqueid'],_0x304cb7[_0x197c('0x18')][_0x197c('0x65')]()][_0x197c('0x19')]('\x20')));});}else{return _0x431100(_0x35d83a[_0x197c('0xe')](0x1f5,_0x197c('0x6c')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x3d1d6c){var _0x1e6371=_[_0x197c('0x58')](_0x37ac05[_0x197c('0x72')]);_0x3d1d6c({'count':_0x1e6371[_0x197c('0x5a')],'rows':_0x1e6371});});},'VoiceQueuesChannel':function(_0x342efa){var _0x25d3c1=this;return new Promise(function(_0x43c0b2,_0x395fce){var _0x2b1c78=schema(properties[_0x197c('0x73')])[_0x197c('0x2')](_0x342efa);if(_0x2b1c78[_0x197c('0x5a')]>0x0){return _0x395fce(_0x25d3c1['error'](0x1f4,_['map'](_0x2b1c78,'message')[_0x197c('0x19')](',\x20')));}var _0x4b22f2=_[_0x197c('0x55')](_0x37ac05['queueChannels'],{'uniqueid':_0x342efa['uniqueid']});if(_0x4b22f2){_0x43c0b2(_0x4b22f2);}else{return _0x395fce(_0x25d3c1[_0x197c('0xe')](0x1f5,_0x197c('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x2b39fe){var _0x485178=this;return new Promise(function(_0x28e387,_0x238092){if(ami['isConnected']()==![]){return _0x238092(_0x485178[_0x197c('0xe')](0x1f4,[config[_0x197c('0xf')]['ip'],config[_0x197c('0xf')][_0x197c('0x10')],'ami\x20disconnected'][_0x197c('0x19')]('\x20')));}var _0x541dfa=schema(properties[_0x197c('0x74')])['validate'](_0x2b39fe);if(_0x541dfa[_0x197c('0x5a')]>0x0){return _0x238092(_0x485178[_0x197c('0xe')](0x1f4,_[_0x197c('0x5c')](_0x541dfa,'message')[_0x197c('0x19')](',\x20')));}var _0x3bd2ee=_[_0x197c('0x55')](_0x37ac05['queueChannels'],{'uniqueid':_0x2b39fe[_0x197c('0x5d')]});if(_0x3bd2ee&&_0x3bd2ee[_0x197c('0x5e')]){return ami[_0x197c('0x16')]({'action':_0x197c('0x75'),'channel':_0x3bd2ee[_0x197c('0x5e')]})[_0x197c('0x17')](function(_0x4bc7cc){_0x28e387({'code':0xc8,'message':[_0x2b39fe[_0x197c('0x5d')],_0x4bc7cc['message']['toLowerCase']()][_0x197c('0x19')]('\x20')});})[_0x197c('0x1e')](function(_0x58e708){_0x238092(_0x485178[_0x197c('0xe')](0x1f5,[_0x2b39fe[_0x197c('0x5d')],_0x58e708[_0x197c('0x18')][_0x197c('0x65')]()][_0x197c('0x19')]('\x20')));});}else{return _0x238092(_0x485178['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x4ca9b9){var _0x5575fe=this;return new Promise(function(_0x16049c,_0x3d024b){if(ami['isConnected']()==![]){return _0x3d024b(_0x5575fe['error'](0x1f4,[config[_0x197c('0xf')]['ip'],config['asterisk']['username'],_0x197c('0x11')][_0x197c('0x19')]('\x20')));}var _0x1b2dd4=schema(properties[_0x197c('0x76')])[_0x197c('0x2')](_0x4ca9b9);if(_0x1b2dd4[_0x197c('0x5a')]>0x0){return _0x3d024b(_0x5575fe['error'](0x1f4,_[_0x197c('0x5c')](_0x1b2dd4,_0x197c('0x18'))[_0x197c('0x19')](',\x20')));}var _0xee983=_[_0x197c('0x55')](_0x37ac05[_0x197c('0x72')],{'uniqueid':_0x4ca9b9[_0x197c('0x5d')]});if(_0xee983&&_0xee983['channel']){return ami[_0x197c('0x16')]({'action':_0x197c('0x77'),'channel':_0xee983[_0x197c('0x5e')],'exten':_0x4ca9b9[_0x197c('0x78')],'context':_0x4ca9b9[_0x197c('0x79')]||_0xee983[_0x197c('0x79')],'priority':0x1})['then'](function(_0x704f3){_0x16049c({'code':0xc8,'message':[_0x4ca9b9[_0x197c('0x5d')],_0x704f3['message'][_0x197c('0x65')]()][_0x197c('0x19')]('\x20')});})[_0x197c('0x1e')](function(_0x13a742){_0x3d024b(_0x5575fe[_0x197c('0xe')](0x1f5,[_0x4ca9b9['uniqueid'],_0x13a742['message']['toLowerCase']()][_0x197c('0x19')]('\x20')));});}else{return _0x3d024b(_0x5575fe['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x1b7379){return new Promise(function(_0x23472f){var _0x3b9abb=_[_0x197c('0x58')](_0x37ac05[_0x197c('0xa')]);if(_0x1b7379&&_0x1b7379['id']){var _0x542db6=_['find'](_0x3b9abb,function(_0x29de68){return _0x29de68['id']===_0x1b7379['id'];});_0x23472f(_0x542db6);}else{_0x23472f({'count':_0x3b9abb[_0x197c('0x5a')],'rows':_0x3b9abb});}});},'Telephones':function(){return new Promise(function(_0x555cdd){var _0x2e48c9=_[_0x197c('0x58')](_0x37ac05[_0x197c('0x7a')]);_0x555cdd({'count':_0x2e48c9[_0x197c('0x5a')],'rows':_0x2e48c9});});},'Trunks':function(){return new Promise(function(_0x1ff9ee){var _0x1d0616=_['values'](_0x37ac05[_0x197c('0x7b')]);_0x1ff9ee({'count':_0x1d0616[_0x197c('0x5a')],'rows':_0x1d0616});});},'OutboundChannels':function(){return new Promise(function(_0x40f745){var _0x26fe80=_[_0x197c('0x58')](_0x37ac05['outboundChannels']);_0x40f745({'count':_0x26fe80['length'],'rows':_0x26fe80});});},'Outbound':function(){return new Promise(function(_0xe515a1){_0xe515a1(_0x37ac05['outbound']);});},'Campaigns':function(){return new Promise(function(_0x1ea452){var _0x427adb=_[_0x197c('0x58')](_0x37ac05[_0x197c('0x7c')]);_0x1ea452({'count':_0x427adb[_0x197c('0x5a')],'rows':_0x427adb});});},'VoiceQueuesPreview':function(_0x5959b1){var _0x2b6a5d=this;return new Promise(function(_0x176413,_0x2184a3){_0x40863c[_0x197c('0x7d')](_0x5959b1['id'])['then'](function(_0x53428d){_0x176413({'code':0xc8,'message':_0x53428d[_0x197c('0x18')]});})['catch'](function(_0x5505e2){_0x2184a3(_0x2b6a5d[_0x197c('0xe')](0x1f4,_0x5505e2[_0x197c('0x18')]));});});},'EventManager':function(_0x39b79a){var _0x595eec=this;return new Promise(function(_0x4bc9af,_0x4c6322){if(!_0x39b79a[_0x197c('0x7e')]){return _0x4c6322(_0x595eec['error'](0x1f4,_0x197c('0x7f')));}ami[_0x197c('0x80')]('custom:'+_0x39b79a[_0x197c('0x7e')],_0x39b79a[_0x197c('0x18')]);_0x4bc9af({'code':0xc8,'message':_0x39b79a});});},'FaxAccounts':function(){return new Promise(function(_0x5a1026){var _0x31486a=_['values'](_0x37ac05[_0x197c('0x81')]);_0x5a1026({'count':_0x31486a[_0x197c('0x5a')],'rows':_0x31486a});});},'SendFax':function(_0x3f078b){var _0x411c58=this;return new Promise(function(_0x184623,_0x56bdf5){_0x4a6f09[_0x197c('0x82')](_0x3f078b)[_0x197c('0x17')](function(_0x35269e){_0x184623({'code':0xc8,'message':_0x35269e[_0x197c('0x18')]});})[_0x197c('0x1e')](function(_0x33c765){_0x56bdf5(_0x411c58[_0x197c('0xe')](0x1f4,_0x33c765['message']));});});},'CheckAfterSend':function(_0x3e533c){var _0x4b3538=this;return new Promise(function(_0x7b3d35,_0x3c3f7a){_0x4a6f09[_0x197c('0x83')](_0x3e533c)[_0x197c('0x17')](function(_0x4edf13){_0x7b3d35({'code':0xc8,'message':_0x4edf13[_0x197c('0x18')]});})[_0x197c('0x1e')](function(_0x1415c2){_0x3c3f7a(_0x4b3538['error'](0x1f4,_0x1415c2[_0x197c('0x18')]));});});}};var _0x33224d=jayson[_0x197c('0x84')](_0x437214)[_0x197c('0x85')]();_0x33224d['on'](_0x197c('0xe'),function(_0x67c9a3){return _0x1cb6e1(_0x67c9a3);});_0x33224d[_0x197c('0x5')](0x232a,'127.0.0.1',function(){console[_0x197c('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x5cbff6(_0x197c('0x87')+0x232a);});});}; \ No newline at end of file +var _0x16d2=['YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','toLowerCase','map','resolve','StopMixMonitor','destinationchannel','stop','Channel\x20doesn\x27t\x20exist','queueChannels','Hangup','Redirect','context','telephones','trunks','outboundChannels','campaigns','event','custom:','faxAccounts','checkAfterSend','server','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','keys','module','action','Reload','Action','then','message','catch','ami\x20disconnected','command','Command','content','voiceQueues','strategy','answered','available','loggedIn','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','Interval','push','length','find','omit','undefined','values','channels','voicechannel','format','%s.%s','filename','uniqueid','wav','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil'];(function(_0x2cc66c,_0x38b2eb){var _0x35d650=function(_0x11e76a){while(--_0x11e76a){_0x2cc66c['push'](_0x2cc66c['shift']());}};_0x35d650(++_0x38b2eb);}(_0x16d2,0x123));var _0x216d=function(_0x4f3056,_0xe685f6){_0x4f3056=_0x4f3056-0x0;var _0x2b8af0=_0x16d2[_0x4f3056];return _0x2b8af0;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var jayson=require(_0x216d('0x2'));var schema=require(_0x216d('0x3'));var moment=require(_0x216d('0x4'));var config=require(_0x216d('0x5'));var properties=require(_0x216d('0x6'));var ami=require(_0x216d('0x7'));exports[_0x216d('0x8')]=function(_0x593bb0,_0x2c662d,_0x2d6017){return new Promise(function(_0xef687c,_0x205101){var _0x1dd8e2={'QueuePause':function(_0x24c831){return new Promise(function(_0x3e0ada){var _0x28da14=util['format'](_0x216d('0x9'),_0x216d('0xa'),_0x24c831[_0x216d('0xb')]);if(_0x593bb0[_0x216d('0xc')]&&_0x593bb0[_0x216d('0xc')][_0x28da14]&&_0x593bb0[_0x216d('0xc')][_0x28da14]['timer']){_0x593bb0[_0x216d('0xc')][_0x28da14]['updateAcw']();}if(_0x593bb0[_0x216d('0xd')][_0x28da14]){_0x593bb0[_0x216d('0xd')][_0x28da14][_0x216d('0xe')]({'statePause':_0x24c831[_0x216d('0xf')]?!![]:![]});}_0x3e0ada({'code':0xc8,'message':_0x216d('0x10')});});},'Reload':function(_0x23ecf9){var _0x4c92d9=this;return new Promise(function(_0xb36a43,_0x4c07d0){if(ami[_0x216d('0x11')]()==![]){return _0x4c07d0(_0x4c92d9[_0x216d('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x216d('0x13')][_0x216d('0x14')],'ami\x20disconnected'][_0x216d('0x15')]('\x20')));}_0x23ecf9=_['pick'](_0x23ecf9,_[_0x216d('0x16')](properties[_0x216d('0x17')]));_0x23ecf9[_0x216d('0x18')]=_0x216d('0x19');return ami[_0x216d('0x1a')](_0x23ecf9)[_0x216d('0x1b')](function(_0x467cd5){_0xb36a43({'code':0xc8,'message':_0x467cd5[_0x216d('0x1c')]});})[_0x216d('0x1d')](function(_0x53d464){_0x4c07d0(_0x4c92d9[_0x216d('0x12')](0x1f5,_0x53d464['message']));});});},'Command':function(_0x4ddc51){var _0x133838=this;return new Promise(function(_0x35dbe8,_0x574758){if(ami[_0x216d('0x11')]()==![]){return _0x574758(_0x133838[_0x216d('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x216d('0x13')][_0x216d('0x14')],_0x216d('0x1e')][_0x216d('0x15')]('\x20')));}_0x4ddc51=_['pick'](_0x4ddc51,_0x216d('0x1f'));_0x4ddc51[_0x216d('0x18')]=_0x216d('0x20');return ami[_0x216d('0x1a')](_0x4ddc51)[_0x216d('0x1b')](function(_0x57cfbd){_0x35dbe8({'code':0xc8,'message':_0x57cfbd[_0x216d('0x21')]});})[_0x216d('0x1d')](function(_0x188494){_0x574758(_0x133838[_0x216d('0x12')](0x1f5,_0x188494[_0x216d('0x1c')]));});});},'VoiceQueues':function(){return new Promise(function(_0x54d96f){var _0x68d7=[];for(var _0xab672 in _0x593bb0[_0x216d('0x22')]){if(_0x593bb0['voiceQueues']['hasOwnProperty'](_0xab672)){var _0x56460f=_0x593bb0['voiceQueues'][_0xab672];var _0x5eb444={'id':_0x56460f['id'],'name':_0x56460f[_0x216d('0xb')],'strategy':_0x56460f[_0x216d('0x23')],'answered':_0x56460f[_0x216d('0x24')],'available':_0x56460f[_0x216d('0x25')],'loggedIn':_0x56460f[_0x216d('0x26')],'pTalking':_0x56460f['pTalking'],'sumBillable':_0x56460f['sumBillable'],'sumDuration':_0x56460f[_0x216d('0x27')],'sumHoldTime':_0x56460f['sumHoldTime']||0x0,'talking':_0x56460f[_0x216d('0x28')],'total':_0x56460f[_0x216d('0x29')],'type':_0x56460f[_0x216d('0x2a')],'unmanaged':_0x56460f[_0x216d('0x2b')],'abandoned':_0x56460f[_0x216d('0x2c')],'waiting':_0x56460f[_0x216d('0x2d')],'loggedInDb':_0x56460f[_0x216d('0x2e')]};if(_0x56460f[_0x216d('0x2a')]===_0x216d('0x2f')){_0x5eb444[_0x216d('0x30')]=_0x56460f[_0x216d('0x30')];_0x5eb444[_0x216d('0x31')]=_0x56460f[_0x216d('0x31')];_0x5eb444['dialOriginateCallerIdName']=_0x56460f[_0x216d('0x32')];_0x5eb444[_0x216d('0x33')]=_0x56460f[_0x216d('0x33')];_0x5eb444['dialOriginateTimeout']=_0x56460f[_0x216d('0x34')];_0x5eb444[_0x216d('0x35')]=_0x56460f[_0x216d('0x35')];_0x5eb444[_0x216d('0x36')]=_0x56460f['temp'];_0x5eb444[_0x216d('0x37')]=_0x56460f[_0x216d('0x37')];_0x5eb444[_0x216d('0x38')]=_0x56460f[_0x216d('0x38')];_0x5eb444[_0x216d('0x39')]=_0x56460f[_0x216d('0x39')];_0x5eb444[_0x216d('0x3a')]=_0x56460f[_0x216d('0x3a')];_0x5eb444[_0x216d('0x3b')]=_0x56460f[_0x216d('0x3b')];_0x5eb444[_0x216d('0x3c')]=_0x56460f['outboundDropCallsDayACS'];_0x5eb444[_0x216d('0x3d')]=_0x56460f[_0x216d('0x3d')];_0x5eb444[_0x216d('0x3e')]=_0x56460f['outboundDropCallsDayTimeout'];_0x5eb444[_0x216d('0x3f')]=_0x56460f[_0x216d('0x3f')];_0x5eb444['outboundNoSuchCallsDay']=_0x56460f[_0x216d('0x40')];_0x5eb444['outboundOriginateFailureCallsDay']=_0x56460f['outboundOriginateFailureCallsDay'];_0x5eb444[_0x216d('0x41')]=_0x56460f[_0x216d('0x41')];_0x5eb444[_0x216d('0x42')]=_0x56460f[_0x216d('0x42')];_0x5eb444['outboundUnknownCallsDay']=_0x56460f['outboundUnknownCallsDay'];_0x5eb444['predictiveIntervalAnsweredCalls']=_0x56460f[_0x216d('0x43')];_0x5eb444[_0x216d('0x44')]=_0x56460f['predictiveIntervalAvgHoldtime'];_0x5eb444[_0x216d('0x45')]=_0x56460f[_0x216d('0x45')];_0x5eb444['predictiveIntervalDroppedCallsCallersExit']=_0x56460f[_0x216d('0x46')];_0x5eb444[_0x216d('0x47')]=_0x56460f[_0x216d('0x47')];_0x5eb444[_0x216d('0x48')]=_0x56460f[_0x216d('0x48')];_0x5eb444[_0x216d('0x49')]=_0x56460f[_0x216d('0x49')];_0x5eb444[_0x216d('0x4a')]=_0x56460f['predictiveIntervalHitRate'];_0x5eb444['predictiveIntervalMultiplicativeFactor']=_0x56460f[_0x216d('0x4b')];_0x5eb444[_0x216d('0x4c')]=_0x56460f['predictiveIntervalPauses'];_0x5eb444[_0x216d('0x4d')]=_0x56460f[_0x216d('0x4d')];_0x5eb444[_0x216d('0x4e')]=_0x56460f['predictiveIntervalTotalCalls'];_0x5eb444[_0x216d('0x1c')]=_0x56460f[_0x216d('0x1c')];_0x5eb444[_0x216d('0x4f')]=_0x56460f[_0x216d('0x4f')];_0x5eb444['erlangCalls']=_0x56460f[_0x216d('0x50')];_0x5eb444[_0x216d('0x51')]=_0x56460f['erlangCallToSecond'];_0x5eb444[_0x216d('0x52')]=_0x56460f[_0x216d('0x52')];_0x5eb444['erlangBusyFactor']=_0x56460f['erlangBusyFactor'];_0x5eb444[_0x216d('0x53')]=_0x56460f[_0x216d('0x53')];_0x5eb444[_0x216d('0x54')]=_0x56460f['startProgressive'];}if(_0x56460f[_0x216d('0x55')]){_0x5eb444['Trunk']={'id':_0x56460f['Trunk']['id'],'name':_0x56460f[_0x216d('0x55')][_0x216d('0xb')],'active':_0x56460f[_0x216d('0x55')]['active'],'callerid':_0x56460f[_0x216d('0x55')]['callerid']};}if(_0x56460f[_0x216d('0x56')]){_0x5eb444[_0x216d('0x56')]={'id':_0x56460f[_0x216d('0x56')]['id'],'name':_0x56460f['Interval'][_0x216d('0xb')]};}_0x68d7[_0x216d('0x57')](_0x5eb444);}}_0x54d96f({'count':_0x68d7[_0x216d('0x58')],'rows':_0x68d7});});},'UpdateVoiceQueue':function(_0x381273){return new Promise(function(_0x4c4d1d,_0x54b160){var _0x571c55=_[_0x216d('0x59')](_0x593bb0[_0x216d('0x22')],{'id':parseInt(_0x381273['id'])});var _0x5d4bf=_[_0x216d('0x5a')](_0x381273,['id']);if(_0x571c55){for(var _0x3344e3 in _0x5d4bf){if(typeof _0x5d4bf[_0x3344e3]!==_0x216d('0x5b')&&typeof _0x571c55[_0x3344e3]!==_0x216d('0x5b')){_0x571c55[_0x3344e3]=_0x5d4bf[_0x3344e3];}}_0x4c4d1d(_0x571c55);}else{_0x54b160();}});},'VoiceChannels':function(){return new Promise(function(_0x30e0f6){var _0x51e752=_[_0x216d('0x5c')](_0x593bb0[_0x216d('0x5d')]);_0x30e0f6({'count':_0x51e752[_0x216d('0x58')],'rows':_0x51e752});});},'VoiceChannelMixMonitor':function(_0x7c8b39){var _0x4955c9=this;return new Promise(function(_0x31b8a1,_0x542e1b){if(ami[_0x216d('0x11')]()==![]){return _0x542e1b(_0x4955c9[_0x216d('0x12')](0x1f4,[config[_0x216d('0x13')]['ip'],config['asterisk']['username'],_0x216d('0x1e')][_0x216d('0x15')]('\x20')));}var _0x3932a3=schema(properties[_0x216d('0x5e')])[_0x216d('0x3')](_0x7c8b39);if(_0x3932a3[_0x216d('0x58')]>0x0){return _0x542e1b(_0x4955c9['error'](0x1f4,_['map'](_0x3932a3,_0x216d('0x1c'))['join'](',\x20')));}var _0x1e0dc9=_[_0x216d('0x59')](_0x593bb0['channels'],{'uniqueid':_0x7c8b39['uniqueid']});if(_0x1e0dc9&&_0x1e0dc9['channel']){var _0x4bac14=util[_0x216d('0x5f')](_0x216d('0x60'),_0x7c8b39[_0x216d('0x61')]||_0x7c8b39[_0x216d('0x62')],_0x7c8b39[_0x216d('0x5f')]||_0x216d('0x63'));return ami[_0x216d('0x1a')]({'action':'MixMonitor','channel':_0x1e0dc9[_0x216d('0x64')],'file':_0x4bac14,'options':_0x216d('0x65')})[_0x216d('0x1b')](function(_0x54dd49){var _0x1e1caf=_[_0x216d('0x59')](_0x1e0dc9[_0x216d('0x66')],{'filename':_0x216d('0x67')+_0x4bac14['toLowerCase']()});if(_[_0x216d('0x68')](_0x1e1caf)){_0x1e0dc9[_0x216d('0x66')][_0x216d('0x57')]({'filename':_0x216d('0x67')+_0x4bac14['toLowerCase'](),'createdAt':moment()[_0x216d('0x5f')](_0x216d('0x69')),'mixmonitorid':_0x54dd49['mixmonitorid'],'status':_0x216d('0x6a')});}else{_0x1e1caf['mixmonitorid']=_0x54dd49[_0x216d('0x6b')];_0x1e1caf[_0x216d('0x6c')]=_0x216d('0x6a');}_0x31b8a1({'code':0xc8,'message':[_0x7c8b39[_0x216d('0x62')],_0x216d('0x6d'),_0x54dd49[_0x216d('0x6b')]][_0x216d('0x15')]('\x20'),'mixmonitorid':_0x54dd49[_0x216d('0x6b')]});})[_0x216d('0x1d')](function(_0x5bb78d){_0x542e1b(_0x4955c9[_0x216d('0x12')](0x1f5,[_0x7c8b39[_0x216d('0x62')],_0x5bb78d['message'][_0x216d('0x6e')]()][_0x216d('0x15')]('\x20')));});}else{return _0x542e1b(_0x4955c9['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3a0ee7){var _0x5e4b3d=this;return new Promise(function(_0x1d30ea,_0x2684e0){if(ami[_0x216d('0x11')]()==![]){return _0x2684e0(_0x5e4b3d['error'](0x1f4,[config[_0x216d('0x13')]['ip'],config['asterisk']['username'],_0x216d('0x1e')][_0x216d('0x15')]('\x20')));}var _0x5e3010=schema(properties[_0x216d('0x5e')])[_0x216d('0x3')](_0x3a0ee7);if(_0x5e3010[_0x216d('0x58')]>0x0){return _0x2684e0(_0x5e4b3d[_0x216d('0x12')](0x1f4,_[_0x216d('0x6f')](_0x5e3010,_0x216d('0x1c'))['join'](',\x20')));}var _0x5d324e=_[_0x216d('0x59')](_0x593bb0[_0x216d('0x5d')],{'uniqueid':_0x3a0ee7[_0x216d('0x62')]});if(_0x5d324e){return Promise[_0x216d('0x70')]()[_0x216d('0x1b')](function(){if(_0x5d324e[_0x216d('0x64')]){return ami[_0x216d('0x1a')]({'action':_0x216d('0x71'),'channel':_0x5d324e[_0x216d('0x64')],'mixmonitorid':_0x3a0ee7[_0x216d('0x6b')]})[_0x216d('0x1d')](function(){});}})[_0x216d('0x1b')](function(){if(_0x5d324e['destinationchannel']){return ami['Action']({'action':_0x216d('0x71'),'channel':_0x5d324e[_0x216d('0x72')],'mixmonitorid':_0x3a0ee7['mixmonitorid']})[_0x216d('0x1d')](function(){});}})['then'](function(){var _0x5a42c7=_[_0x216d('0x59')](_0x5d324e[_0x216d('0x66')],{'mixmonitorid':_0x3a0ee7[_0x216d('0x6b')]});if(_0x5a42c7){_0x5a42c7[_0x216d('0x6c')]=_0x216d('0x73');}})[_0x216d('0x1b')](function(){var _0xb00e58=util[_0x216d('0x5f')](_0x216d('0x60'),_0x3a0ee7[_0x216d('0x61')]||_0x3a0ee7[_0x216d('0x62')],_0x3a0ee7[_0x216d('0x5f')]||_0x216d('0x63'));var _0x245137=_[_0x216d('0x59')](_0x5d324e[_0x216d('0x66')],{'filename':_0x216d('0x67')+_0xb00e58[_0x216d('0x6e')]()});if(_0x245137){_0x245137[_0x216d('0x6c')]=_0x216d('0x73');}})[_0x216d('0x1b')](function(){_0x1d30ea({'code':0xc8,'message':[_0x3a0ee7[_0x216d('0x62')],'StopMixMonitor\x20Success'][_0x216d('0x15')]('\x20')});})['catch'](function(_0x45c222){_0x2684e0(_0x5e4b3d['error'](0x1f5,[_0x3a0ee7[_0x216d('0x62')],_0x45c222[_0x216d('0x1c')]['toLowerCase']()][_0x216d('0x15')]('\x20')));});}else{return _0x2684e0(_0x5e4b3d[_0x216d('0x12')](0x1f5,_0x216d('0x74')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x1d8f1a){var _0x215187=_[_0x216d('0x5c')](_0x593bb0[_0x216d('0x75')]);_0x1d8f1a({'count':_0x215187[_0x216d('0x58')],'rows':_0x215187});});},'VoiceQueuesChannel':function(_0x2727c7){var _0x5acc44=this;return new Promise(function(_0x120f8a,_0x299cc7){var _0x16cf09=schema(properties['voicequeuechannel'])['validate'](_0x2727c7);if(_0x16cf09['length']>0x0){return _0x299cc7(_0x5acc44['error'](0x1f4,_[_0x216d('0x6f')](_0x16cf09,'message')[_0x216d('0x15')](',\x20')));}var _0x1184be=_[_0x216d('0x59')](_0x593bb0[_0x216d('0x75')],{'uniqueid':_0x2727c7[_0x216d('0x62')]});if(_0x1184be){_0x120f8a(_0x1184be);}else{return _0x299cc7(_0x5acc44[_0x216d('0x12')](0x1f5,_0x216d('0x74')));}});},'VoiceQueuesChannelHangup':function(_0x3023d6){var _0x27a6e6=this;return new Promise(function(_0x48c1e6,_0x4e4e1a){if(ami[_0x216d('0x11')]()==![]){return _0x4e4e1a(_0x27a6e6['error'](0x1f4,[config[_0x216d('0x13')]['ip'],config[_0x216d('0x13')][_0x216d('0x14')],_0x216d('0x1e')][_0x216d('0x15')]('\x20')));}var _0x428cc4=schema(properties['voicequeuechannelhangup'])['validate'](_0x3023d6);if(_0x428cc4[_0x216d('0x58')]>0x0){return _0x4e4e1a(_0x27a6e6['error'](0x1f4,_[_0x216d('0x6f')](_0x428cc4,_0x216d('0x1c'))[_0x216d('0x15')](',\x20')));}var _0x5208cb=_['find'](_0x593bb0['queueChannels'],{'uniqueid':_0x3023d6[_0x216d('0x62')]});if(_0x5208cb&&_0x5208cb[_0x216d('0x64')]){return ami[_0x216d('0x1a')]({'action':_0x216d('0x76'),'channel':_0x5208cb['channel']})[_0x216d('0x1b')](function(_0x41f1a4){_0x48c1e6({'code':0xc8,'message':[_0x3023d6[_0x216d('0x62')],_0x41f1a4['message']['toLowerCase']()][_0x216d('0x15')]('\x20')});})[_0x216d('0x1d')](function(_0x273d11){_0x4e4e1a(_0x27a6e6[_0x216d('0x12')](0x1f5,[_0x3023d6[_0x216d('0x62')],_0x273d11['message'][_0x216d('0x6e')]()][_0x216d('0x15')]('\x20')));});}else{return _0x4e4e1a(_0x27a6e6[_0x216d('0x12')](0x1f5,_0x216d('0x74')));}});},'VoiceQueuesChannelRedirect':function(_0x560b4c){var _0x17f320=this;return new Promise(function(_0x54e924,_0x3c6d73){if(ami['isConnected']()==![]){return _0x3c6d73(_0x17f320[_0x216d('0x12')](0x1f4,[config[_0x216d('0x13')]['ip'],config[_0x216d('0x13')][_0x216d('0x14')],_0x216d('0x1e')]['join']('\x20')));}var _0xcc7c6d=schema(properties['voicequeuechannelredirect'])['validate'](_0x560b4c);if(_0xcc7c6d['length']>0x0){return _0x3c6d73(_0x17f320['error'](0x1f4,_[_0x216d('0x6f')](_0xcc7c6d,_0x216d('0x1c'))[_0x216d('0x15')](',\x20')));}var _0x59c776=_['find'](_0x593bb0[_0x216d('0x75')],{'uniqueid':_0x560b4c[_0x216d('0x62')]});if(_0x59c776&&_0x59c776[_0x216d('0x64')]){return ami[_0x216d('0x1a')]({'action':_0x216d('0x77'),'channel':_0x59c776['channel'],'exten':_0x560b4c['exten'],'context':_0x560b4c[_0x216d('0x78')]||_0x59c776['context'],'priority':0x1})[_0x216d('0x1b')](function(_0x597226){_0x54e924({'code':0xc8,'message':[_0x560b4c[_0x216d('0x62')],_0x597226[_0x216d('0x1c')][_0x216d('0x6e')]()][_0x216d('0x15')]('\x20')});})['catch'](function(_0x56216a){_0x3c6d73(_0x17f320[_0x216d('0x12')](0x1f5,[_0x560b4c[_0x216d('0x62')],_0x56216a[_0x216d('0x1c')][_0x216d('0x6e')]()]['join']('\x20')));});}else{return _0x3c6d73(_0x17f320[_0x216d('0x12')](0x1f5,_0x216d('0x74')));}});},'Agents':function(_0xd83874){return new Promise(function(_0x4c0469){var _0x497a2d=_[_0x216d('0x5c')](_0x593bb0['agents']);if(_0xd83874&&_0xd83874['id']){var _0xb6fc7b=_[_0x216d('0x59')](_0x497a2d,function(_0x4bee99){return _0x4bee99['id']===_0xd83874['id'];});_0x4c0469(_0xb6fc7b);}else{_0x4c0469({'count':_0x497a2d['length'],'rows':_0x497a2d});}});},'Telephones':function(){return new Promise(function(_0x3000c4){var _0xc61b2=_[_0x216d('0x5c')](_0x593bb0[_0x216d('0x79')]);_0x3000c4({'count':_0xc61b2[_0x216d('0x58')],'rows':_0xc61b2});});},'Trunks':function(){return new Promise(function(_0x3ebc75){var _0x5d37df=_['values'](_0x593bb0[_0x216d('0x7a')]);_0x3ebc75({'count':_0x5d37df[_0x216d('0x58')],'rows':_0x5d37df});});},'OutboundChannels':function(){return new Promise(function(_0x402f07){var _0x40c854=_[_0x216d('0x5c')](_0x593bb0[_0x216d('0x7b')]);_0x402f07({'count':_0x40c854[_0x216d('0x58')],'rows':_0x40c854});});},'Outbound':function(){return new Promise(function(_0xc64a7f){_0xc64a7f(_0x593bb0[_0x216d('0x2f')]);});},'Campaigns':function(){return new Promise(function(_0x2cbf1c){var _0x561de3=_[_0x216d('0x5c')](_0x593bb0[_0x216d('0x7c')]);_0x2cbf1c({'count':_0x561de3[_0x216d('0x58')],'rows':_0x561de3});});},'VoiceQueuesPreview':function(_0x325f13){var _0x3f9f95=this;return new Promise(function(_0x487428,_0x3d0a2b){_0x2c662d['run'](_0x325f13['id'])[_0x216d('0x1b')](function(_0x5a5a40){_0x487428({'code':0xc8,'message':_0x5a5a40[_0x216d('0x1c')]});})['catch'](function(_0x5cb7ab){_0x3d0a2b(_0x3f9f95[_0x216d('0x12')](0x1f4,_0x5cb7ab['message']));});});},'EventManager':function(_0x569a3e){var _0x48e3df=this;return new Promise(function(_0xd5ce22,_0x5d4b88){if(!_0x569a3e[_0x216d('0x7d')]){return _0x5d4b88(_0x48e3df['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x216d('0x7e')+_0x569a3e[_0x216d('0x7d')],_0x569a3e[_0x216d('0x1c')]);_0xd5ce22({'code':0xc8,'message':_0x569a3e});});},'FaxAccounts':function(){return new Promise(function(_0x4c8928){var _0x39ce80=_[_0x216d('0x5c')](_0x593bb0[_0x216d('0x7f')]);_0x4c8928({'count':_0x39ce80[_0x216d('0x58')],'rows':_0x39ce80});});},'SendFax':function(_0x322a2b){var _0x9e7c17=this;return new Promise(function(_0x4d052e,_0x4382e4){_0x2d6017['send'](_0x322a2b)[_0x216d('0x1b')](function(_0x41afe5){_0x4d052e({'code':0xc8,'message':_0x41afe5[_0x216d('0x1c')]});})[_0x216d('0x1d')](function(_0xc7542a){_0x4382e4(_0x9e7c17[_0x216d('0x12')](0x1f4,_0xc7542a[_0x216d('0x1c')]));});});},'CheckAfterSend':function(_0x2ec74b){var _0x228cd5=this;return new Promise(function(_0x1e1696,_0x388794){_0x2d6017[_0x216d('0x80')](_0x2ec74b)[_0x216d('0x1b')](function(_0x1d7f51){_0x1e1696({'code':0xc8,'message':_0x1d7f51[_0x216d('0x1c')]});})[_0x216d('0x1d')](function(_0x575d24){_0x388794(_0x228cd5[_0x216d('0x12')](0x1f4,_0x575d24[_0x216d('0x1c')]));});});}};var _0x48ee79=jayson[_0x216d('0x81')](_0x1dd8e2)['http']();_0x48ee79['on'](_0x216d('0x12'),function(_0x3f7513){return _0x205101(_0x3f7513);});_0x48ee79[_0x216d('0x8')](0x232a,'127.0.0.1',function(){console[_0x216d('0x82')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xef687c(_0x216d('0x83')+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 3cbf976..20ba8c2 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 _0xfb93=['calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','uniqueid','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','routeId','destcalleridnum'];(function(_0x2a879b,_0x5ee54e){var _0x46391d=function(_0x50cfbc){while(--_0x50cfbc){_0x2a879b['push'](_0x2a879b['shift']());}};_0x46391d(++_0x5ee54e);}(_0xfb93,0x118));var _0x3fb9=function(_0x5e32a3,_0x2e9cc7){_0x5e32a3=_0x5e32a3-0x0;var _0x5c91d9=_0xfb93[_0x5e32a3];return _0x5c91d9;};'use strict';var _=require(_0x3fb9('0x0'));var BPromise=require(_0x3fb9('0x1'));var Redis=require(_0x3fb9('0x2'));var util=require(_0x3fb9('0x3'));var config=require(_0x3fb9('0x4'));var logger=require('../../../../config/logger')(_0x3fb9('0x5'));var cmContactRpc=require(_0x3fb9('0x6'));config[_0x3fb9('0x7')]=_[_0x3fb9('0x8')](config['redis'],{'host':_0x3fb9('0x9'),'port':0x18eb});var io=require(_0x3fb9('0xa'))(new Redis(config[_0x3fb9('0x7')]));function emit(_0x58399d,_0x2031df,_0x35cff6,_0x72f7dd,_0x582e5f){logger['info'](_0x3fb9('0xb'),_0x58399d,_0x2031df['id'],_0x35cff6,_0x72f7dd,JSON[_0x3fb9('0xc')](_0x582e5f));io['to'](_0x35cff6)[_0x3fb9('0xd')](_0x72f7dd,_0x582e5f);}exports['exec']=function(_0x53ec5a,_0x155c92,_0x43deaa,_0x1886ca){var _0x4b6167,_0x1f3dde;var _0x4e0954={};var _0x306471;var _0x460577=Number(_0x43deaa[_0x3fb9('0xe')]);var _0xdf07f5=_0x43deaa[_0x3fb9('0xf')]?Boolean(Number(_0x43deaa[_0x3fb9('0xf')])):![];var _0x32947c;var _0xe669f3=![];if(!_[_0x3fb9('0x10')](_0x43deaa[_0x3fb9('0x11')])){if(_0x43deaa[_0x3fb9('0x11')]=='1')_0xe669f3=!![];}if(!_0xe669f3){if(_0x1886ca[_0x3fb9('0x12')]){_0x4e0954['id']=_0x1886ca[_0x3fb9('0x12')];}}if(!_0x4e0954['id']){_0x4e0954[_0x3fb9('0x13')]=_0x460577;_0x32947c=_0x43deaa[_0x3fb9('0x14')]&&_0x43deaa[_0x3fb9('0x14')]!=='0'?_0x43deaa[_0x3fb9('0x14')]['split'](','):[_0x3fb9('0x15')];_0x4e0954[_0x3fb9('0x16')]=_['map'](_0x32947c,function(_0x12ecc4){var _0x12fed7={};_0x12fed7[_0x12ecc4]=_0x1886ca[_0x3fb9('0x17')]?_0x1886ca[_0x3fb9('0x18')]:_0x1886ca[_0x3fb9('0x19')];return _0x12fed7;});_0x306471=_0x1886ca['routeId']?_0x1886ca[_0x3fb9('0x18')]:_0x1886ca[_0x3fb9('0x19')];}var _0x208dab=['id',_0x3fb9('0x1a'),_0x3fb9('0x1b'),'phone',_0x3fb9('0x1c'),_0x3fb9('0x1d'),_0x3fb9('0x13'),_0x3fb9('0x1e'),_0x3fb9('0x1f'),_0x3fb9('0x20')];var _0x437f78=_['union'](_0x208dab,_0x32947c);BPromise[_0x3fb9('0x21')]()[_0x3fb9('0x22')](cmContactRpc[_0x3fb9('0x23')]({'attributes':_0x437f78,'where':_0x4e0954,'phone':_0x306471}))[_0x3fb9('0x22')](function(_0x4009fd){_0x1f3dde=_0x4009fd;if(!_[_0x3fb9('0x24')](_0x1f3dde)){if(_0x1f3dde[_0x3fb9('0x25')]===0x1){_0x4b6167=_0x1f3dde[0x0];logger[_0x3fb9('0x26')](_0x3fb9('0x27'),_0x1886ca['uniqueid'],_0x155c92['id'],_0x4b6167['id']);}else{logger[_0x3fb9('0x26')](_0x3fb9('0x28'),_0x1886ca['uniqueid'],_0x155c92['id'],_[_0x3fb9('0x29')](_0x1f3dde,'id')[_0x3fb9('0x2a')](','));}return;}else{logger[_0x3fb9('0x26')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x1886ca['uniqueid'],_0x155c92['id']);var _0x456d14={'ListId':_0x460577};var _0x152a7f=_0x43deaa[_0x3fb9('0x2b')]&&_0x43deaa[_0x3fb9('0x2b')]!=='0'?_0x43deaa[_0x3fb9('0x2b')]:_0x3fb9('0x15');if(_0xdf07f5){logger[_0x3fb9('0x26')](_0x3fb9('0x2c'),_0x1886ca['uniqueid'],_0x155c92['id']);_0x456d14[_0x152a7f]=_['isNil'](_0x1886ca[_0x3fb9('0x17')])?_0x1886ca[_0x3fb9('0x19')]:_0x1886ca['destcalleridnum'];if(_['isNil'](_0x1886ca[_0x3fb9('0x17')])){_0x456d14[_0x3fb9('0x1a')]=_0x1886ca['calleridname']&&_0x1886ca[_0x3fb9('0x2d')]!==_0x3fb9('0x2e')?_0x1886ca[_0x3fb9('0x2d')]:'Unknown';}else{_0x456d14[_0x3fb9('0x1a')]=_0x1886ca[_0x3fb9('0x2f')]&&_0x1886ca['destcalleridname']!==''?_0x1886ca[_0x3fb9('0x2f')]:_0x3fb9('0x30');}return BPromise[_0x3fb9('0x21')]()[_0x3fb9('0x22')](cmContactRpc[_0x3fb9('0x31')](_0x456d14))[_0x3fb9('0x22')](function(_0x1b1e3c){_0x4b6167=_0x1b1e3c;_0x1f3dde[_0x3fb9('0x32')](_0x1b1e3c);if(_0x4b6167){logger[_0x3fb9('0x26')](_0x3fb9('0x33'),_0x1886ca[_0x3fb9('0x34')],_0x155c92['id'],_0x4b6167['id']);}return;});}else{logger[_0x3fb9('0x26')](_0x3fb9('0x35'),_0x1886ca[_0x3fb9('0x34')],_0x155c92['id']);_0x456d14[_0x152a7f]=_['isNil'](_0x1886ca[_0x3fb9('0x17')])?_0x1886ca['calleridnum']:_0x1886ca[_0x3fb9('0x18')];if(_[_0x3fb9('0x10')](_0x1886ca[_0x3fb9('0x17')])){_0x456d14[_0x3fb9('0x1a')]=_0x1886ca['calleridname']&&_0x1886ca[_0x3fb9('0x2d')]!==_0x3fb9('0x2e')?_0x1886ca[_0x3fb9('0x2d')]:'Unknown';}else{_0x456d14[_0x3fb9('0x1a')]=_0x1886ca['destcalleridname']&&_0x1886ca[_0x3fb9('0x2f')]!==''?_0x1886ca[_0x3fb9('0x2f')]:_0x3fb9('0x30');}_0x4b6167=_0x456d14;_0x1f3dde['push'](_0x456d14);return;}}})[_0x3fb9('0x22')](function(){if(_0x53ec5a){emit(_0x1886ca[_0x3fb9('0x34')],_0x155c92,util[_0x3fb9('0x36')](_0x3fb9('0x37'),_0x53ec5a[_0x3fb9('0x38')]),util['format'](_0x3fb9('0x39'),_0x43deaa[_0x3fb9('0x3a')][_0x3fb9('0x3b')]()),{'evt':_[_0x3fb9('0x3c')](_0x1886ca,{'autoCreate':_0xdf07f5}),'contact':_0x4b6167===undefined?{}:_0x4b6167,'contacts':_0x1f3dde[_0x3fb9('0x25')]===0x0?undefined:_0x1f3dde});}});}; \ No newline at end of file +var _0x20d9=['map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone'];(function(_0x12e267,_0x1772ed){var _0x4171ce=function(_0x386663){while(--_0x386663){_0x12e267['push'](_0x12e267['shift']());}};_0x4171ce(++_0x1772ed);}(_0x20d9,0xcc));var _0x920d=function(_0x1bbe8e,_0x18e073){_0x1bbe8e=_0x1bbe8e-0x0;var _0x4c9e73=_0x20d9[_0x1bbe8e];return _0x4c9e73;};'use strict';var _=require('lodash');var BPromise=require(_0x920d('0x0'));var Redis=require(_0x920d('0x1'));var util=require(_0x920d('0x2'));var config=require(_0x920d('0x3'));var logger=require(_0x920d('0x4'))(_0x920d('0x5'));var cmContactRpc=require(_0x920d('0x6'));config[_0x920d('0x7')]=_[_0x920d('0x8')](config[_0x920d('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x920d('0x7')]));function emit(_0x9c4692,_0x23a594,_0x26adb4,_0x2d1436,_0x69e231){logger['info'](_0x920d('0x9'),_0x9c4692,_0x23a594['id'],_0x26adb4,_0x2d1436,JSON[_0x920d('0xa')](_0x69e231));io['to'](_0x26adb4)['emit'](_0x2d1436,_0x69e231);}exports[_0x920d('0xb')]=function(_0xc37d90,_0x3e8e9d,_0xbda924,_0x432774){var _0x5b4b79,_0x2a0c2c;var _0x1a22a7={};var _0x438b22;var _0x4e38f2=Number(_0xbda924[_0x920d('0xc')]);var _0x53085a=_0xbda924[_0x920d('0xd')]?Boolean(Number(_0xbda924[_0x920d('0xd')])):![];var _0x5676b7;var _0x45f4b9=![];if(!_[_0x920d('0xe')](_0xbda924['data5'])){if(_0xbda924[_0x920d('0xf')]=='1')_0x45f4b9=!![];}if(!_0x45f4b9){if(_0x432774['xmd-contactid']){_0x1a22a7['id']=_0x432774[_0x920d('0x10')];}}if(!_0x1a22a7['id']){_0x1a22a7[_0x920d('0x11')]=_0x4e38f2;_0x5676b7=_0xbda924['data3']&&_0xbda924[_0x920d('0x12')]!=='0'?_0xbda924[_0x920d('0x12')]['split'](','):[_0x920d('0x13')];_0x1a22a7['$or']=_[_0x920d('0x14')](_0x5676b7,function(_0xa6a500){var _0x4e4db0={};_0x4e4db0[_0xa6a500]=_0x432774[_0x920d('0x15')]?_0x432774[_0x920d('0x16')]:_0x432774[_0x920d('0x17')];return _0x4e4db0;});_0x438b22=_0x432774[_0x920d('0x15')]?_0x432774[_0x920d('0x16')]:_0x432774['calleridnum'];}var _0xe09b7d=['id',_0x920d('0x18'),_0x920d('0x19'),_0x920d('0x13'),_0x920d('0x1a'),_0x920d('0x1b'),_0x920d('0x11'),_0x920d('0x1c'),_0x920d('0x1d'),'updatedAt'];var _0x5749ac=_[_0x920d('0x1e')](_0xe09b7d,_0x5676b7);BPromise[_0x920d('0x1f')]()[_0x920d('0x20')](cmContactRpc[_0x920d('0x21')]({'attributes':_0x5749ac,'where':_0x1a22a7,'phone':_0x438b22}))[_0x920d('0x20')](function(_0x48a178){_0x2a0c2c=_0x48a178;if(!_['isEmpty'](_0x2a0c2c)){if(_0x2a0c2c['length']===0x1){_0x5b4b79=_0x2a0c2c[0x0];logger[_0x920d('0x22')](_0x920d('0x23'),_0x432774[_0x920d('0x24')],_0x3e8e9d['id'],_0x5b4b79['id']);}else{logger[_0x920d('0x22')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x432774['uniqueid'],_0x3e8e9d['id'],_[_0x920d('0x14')](_0x2a0c2c,'id')[_0x920d('0x25')](','));}return;}else{logger[_0x920d('0x22')](_0x920d('0x26'),_0x432774[_0x920d('0x24')],_0x3e8e9d['id']);var _0x397cfb={'ListId':_0x4e38f2};var _0x3ee7c3=_0xbda924['data4']&&_0xbda924[_0x920d('0x27')]!=='0'?_0xbda924[_0x920d('0x27')]:'phone';if(_0x53085a){logger['info'](_0x920d('0x28'),_0x432774[_0x920d('0x24')],_0x3e8e9d['id']);_0x397cfb[_0x3ee7c3]=_[_0x920d('0xe')](_0x432774[_0x920d('0x15')])?_0x432774[_0x920d('0x17')]:_0x432774[_0x920d('0x16')];if(_[_0x920d('0xe')](_0x432774[_0x920d('0x15')])){_0x397cfb[_0x920d('0x18')]=_0x432774[_0x920d('0x29')]&&_0x432774[_0x920d('0x29')]!==_0x920d('0x2a')?_0x432774[_0x920d('0x29')]:_0x920d('0x2b');}else{_0x397cfb[_0x920d('0x18')]=_0x432774[_0x920d('0x2c')]&&_0x432774[_0x920d('0x2c')]!==''?_0x432774[_0x920d('0x2c')]:_0x920d('0x2b');}return BPromise['resolve']()[_0x920d('0x20')](cmContactRpc[_0x920d('0x2d')](_0x397cfb))[_0x920d('0x20')](function(_0xe63be3){_0x5b4b79=_0xe63be3;_0x2a0c2c[_0x920d('0x2e')](_0xe63be3);if(_0x5b4b79){logger[_0x920d('0x22')](_0x920d('0x2f'),_0x432774[_0x920d('0x24')],_0x3e8e9d['id'],_0x5b4b79['id']);}return;});}else{logger['info'](_0x920d('0x30'),_0x432774['uniqueid'],_0x3e8e9d['id']);_0x397cfb[_0x3ee7c3]=_[_0x920d('0xe')](_0x432774[_0x920d('0x15')])?_0x432774[_0x920d('0x17')]:_0x432774[_0x920d('0x16')];if(_[_0x920d('0xe')](_0x432774[_0x920d('0x15')])){_0x397cfb['firstName']=_0x432774[_0x920d('0x29')]&&_0x432774[_0x920d('0x29')]!==_0x920d('0x2a')?_0x432774[_0x920d('0x29')]:'Unknown';}else{_0x397cfb[_0x920d('0x18')]=_0x432774[_0x920d('0x2c')]&&_0x432774[_0x920d('0x2c')]!==_0x920d('0x2a')?_0x432774[_0x920d('0x2c')]:_0x920d('0x2b');}_0x5b4b79=_0x397cfb;_0x2a0c2c[_0x920d('0x2e')](_0x397cfb);return;}}})[_0x920d('0x20')](function(){if(_0xc37d90){emit(_0x432774[_0x920d('0x24')],_0x3e8e9d,util['format'](_0x920d('0x31'),_0xc37d90[_0x920d('0x32')]),util['format'](_0x920d('0x33'),_0xbda924[_0x920d('0x34')][_0x920d('0x35')]()),{'evt':_[_0x920d('0x36')](_0x432774,{'autoCreate':_0x53085a}),'contact':_0x5b4b79===undefined?{}:_0x5b4b79,'contacts':_0x2a0c2c[_0x920d('0x37')]===0x0?undefined:_0x2a0c2c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 703d119..e2257e9 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 _0x09b7=['isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','600','winApplication','render','winArguments','format','user:%s','trigger:%s:%s','name','trigger:%s','exec','integration','routeId','urlforward','buildUri','replace','channel','AllConditions','every','checkConditions','AnyConditions','field','chat','ChatWebsiteId','value','AccountId','operator','upperFirst','interaction','message','queue','agent','membername','lastevent','null','substatus','created','exports','util','url','mustache','ioredis','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','clone','motionChannel','undefined','voice','prototype','interface','checkTriggers','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','html','data2','template\x20not\x20found','uri'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x09b7,0x121));var _0x709b=function(_0x4d4046,_0x195cf8){_0x4d4046=_0x4d4046-0x0;var _0x82d2b1=_0x09b7[_0x4d4046];return _0x82d2b1;};'use strict';var util=require(_0x709b('0x0'));var _=require('lodash');var url=require(_0x709b('0x1'));var Mustache=require(_0x709b('0x2'));var Redis=require(_0x709b('0x3'));var urlforward=require(_0x709b('0x4'));var integration=require(_0x709b('0x5'));var cmContact=require('./cmContact');var script=require(_0x709b('0x6'));var config=require(_0x709b('0x7'));var logger=require(_0x709b('0x8'))(_0x709b('0x9'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x709b('0xa')],{'host':_0x709b('0xb'),'port':0x18eb});var io=require(_0x709b('0xc'))(new Redis(config[_0x709b('0xa')]));var operators={'equals':function(_0xb67fd9,_0x4533e8){return _0xb67fd9==_0x4533e8;},'not_equals':function(_0x591dfd,_0x544c5e){return _0x591dfd!=_0x544c5e;}};var barAndWebActions=[_0x709b('0xd'),'url',_0x709b('0xe')];function Trigger(_0x138ddc){this[_0x709b('0xf')]=_0x138ddc[_0x709b('0xf')];this['agents']=_0x138ddc[_0x709b('0x10')];this[_0x709b('0x11')]=_0x138ddc['voiceQueues'];this[_0x709b('0x12')]=_0x138ddc[_0x709b('0x12')];this[_0x709b('0x13')]=_0x138ddc[_0x709b('0x13')];this['zendeskAccounts']=_0x138ddc[_0x709b('0x14')];this[_0x709b('0x15')]=_0x138ddc['freshdeskAccounts'];this['salesforceAccounts']=_0x138ddc[_0x709b('0x16')];this[_0x709b('0x17')]=_0x138ddc['sugarcrmAccounts'];this[_0x709b('0x18')]=_0x138ddc[_0x709b('0x18')];this['deskAccounts']=_0x138ddc[_0x709b('0x19')];this[_0x709b('0x1a')]=_0x138ddc[_0x709b('0x1a')];this[_0x709b('0x1b')]=_0x138ddc[_0x709b('0x1b')];this[_0x709b('0x1c')]=_0x138ddc[_0x709b('0x1c')];this[_0x709b('0x1d')]=_0x138ddc['freshsalesAccounts'];this[_0x709b('0x1e')]={'zendesk':this[_0x709b('0x14')],'salesforce':this[_0x709b('0x16')],'freshdesk':this[_0x709b('0x15')],'sugarcrm':this[_0x709b('0x17')],'zoho':this['zohoAccounts'],'desk':this[_0x709b('0x19')],'vtiger':this[_0x709b('0x1a')],'dynamics365':this[_0x709b('0x1c')],'freshsales':this[_0x709b('0x1d')],'servicenow':this[_0x709b('0x1b')]};ami['on'](_0x709b('0x1f'),this['syncCustomEvent'][_0x709b('0x20')](this));ami['on'](_0x709b('0x21'),this[_0x709b('0x22')]['bind'](this));ami['on'](_0x709b('0x23'),this[_0x709b('0x22')][_0x709b('0x20')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent']['bind'](this));ami['on'](_0x709b('0x24'),this[_0x709b('0x22')][_0x709b('0x20')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent']['bind'](this));ami['on'](_0x709b('0x25'),this[_0x709b('0x22')][_0x709b('0x20')](this));ami['on'](_0x709b('0x26'),this[_0x709b('0x22')]['bind'](this));ami['on'](_0x709b('0x27'),this[_0x709b('0x22')][_0x709b('0x20')](this));ami['on'](_0x709b('0x28'),this['syncCustomEvent'][_0x709b('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0x709b('0x22')][_0x709b('0x20')](this));ami['on'](_0x709b('0x29'),this[_0x709b('0x22')]['bind'](this));ami['on'](_0x709b('0x2a'),this['syncAgentDial'][_0x709b('0x20')](this));ami['on']('custom:dialconnect',this[_0x709b('0x2b')][_0x709b('0x20')](this));ami['on'](_0x709b('0x2c'),this[_0x709b('0x2b')][_0x709b('0x20')](this));ami['on']('custom:newinteraction',this[_0x709b('0x22')]['bind'](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x709b('0x20')](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0x709b('0x20')](this));ami['on'](_0x709b('0x2d'),this[_0x709b('0x22')]['bind'](this));ami['on'](_0x709b('0x2e'),this[_0x709b('0x22')][_0x709b('0x20')](this));ami['on'](_0x709b('0x2f'),this[_0x709b('0x22')]['bind'](this));ami['on'](_0x709b('0x30'),this[_0x709b('0x22')][_0x709b('0x20')](this));ami['on'](_0x709b('0x31'),this['syncCustomEvent'][_0x709b('0x20')](this));}Trigger['prototype'][_0x709b('0x32')]=function(_0x50d5b7,_0x48cd6e,_0x20d68c){logger[_0x709b('0x33')](_0x50d5b7,_0x48cd6e,JSON[_0x709b('0x34')](_0x20d68c));io['to'](_0x50d5b7)['emit'](_0x48cd6e,_0x20d68c);};Trigger['prototype'][_0x709b('0x22')]=function(_0x113dba){var _0xcba904=_[_0x709b('0x35')](_0x113dba);if(typeof _0xcba904[_0x709b('0x36')]===_0x709b('0x37')){_0xcba904[_0x709b('0x36')]=_0x709b('0x38');}this['checkTriggers'](_0xcba904);};Trigger[_0x709b('0x39')]['syncAgentDial']=function(_0x1ef503){if(this[_0x709b('0x10')][_0x1ef503[_0x709b('0x3a')]]){this[_0x709b('0x22')](_0x1ef503);}};Trigger['prototype'][_0x709b('0x3b')]=function(_0xc3d180){var _0x450d53;for(var _0x4da536 in this[_0x709b('0xf')]){if(this[_0x709b('0xf')]['hasOwnProperty'](_0x4da536)){if(this[_0x709b('0xf')][_0x4da536][_0x709b('0x3c')]){_0x450d53=this[_0x709b('0x3d')](this[_0x709b('0xf')][_0x4da536],_0xc3d180);if(_0x450d53){_[_0x709b('0x3e')](_0xc3d180,_0xc3d180[_0x709b('0x3f')]);for(var _0x4b0300=0x0,_0x3bd059,_0x2234a5,_0x503876;_0x4b03000x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x326f,0xd1));var _0xf326=function(_0x556fb8,_0xbe1755){_0x556fb8=_0x556fb8-0x0;var _0x470863=_0x326f[_0x556fb8];return _0x470863;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 29353bc..1f5e3ae 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 _0x5bb6=['catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','message','toLowerCase','outbound','/systemusers(','Bearer\x20','body','odata-entityid','lastIndexOf','destcalleridnum','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','value','enduserId','contactid','nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','substring','indexOf','content','ticketType','incidents','assign','getString','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','stripTrailingSlash','CloudProvider','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','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','tenantId','data2','resolve','POST','password','clientSecret','then','access_token'];(function(_0x2256e5,_0x3ab214){var _0x2b132c=function(_0x5ee2fc){while(--_0x5ee2fc){_0x2256e5['push'](_0x2256e5['shift']());}};_0x2b132c(++_0x3ab214);}(_0x5bb6,0x130));var _0x65bb=function(_0x5397cc,_0x98556f){_0x5397cc=_0x5397cc-0x0;var _0x5e257b=_0x5bb6[_0x5397cc];return _0x5e257b;};'use strict';var _=require(_0x65bb('0x0'));var rp=require('request-promise');var util=require(_0x65bb('0x1'));var intUtil=require('./util');var md5=require(_0x65bb('0x2'));var Redis=require('ioredis');var logger=require(_0x65bb('0x3'))(_0x65bb('0x4'));var config=require(_0x65bb('0x5'));config[_0x65bb('0x6')]=_[_0x65bb('0x7')](config['redis'],{'host':_0x65bb('0x8'),'port':0x18eb});var io=require(_0x65bb('0x9'))(new Redis(config[_0x65bb('0x6')]));function getAuthToken(_0x439b60,_0x1e0b90,_0x10313f){if(_0x439b60[_0x65bb('0xa')]){_0x439b60[_0x65bb('0xb')]=_0x439b60['CloudProvider']['data7'];_0x439b60[_0x65bb('0xc')]=_0x439b60['CloudProvider'][_0x65bb('0xd')];return Promise[_0x65bb('0xe')](_0x439b60['CloudProvider']['data5']);}var _0x4f1293={'method':_0x65bb('0xf'),'uri':_0x1e0b90,'form':{'client_id':_0x439b60['clientId'],'resource':_0x439b60['remoteUri'],'username':_0x439b60['username'],'password':_0x439b60['password'],'grant_type':_0x65bb('0x10'),'client_secret':_0x439b60[_0x65bb('0x11')]},'json':!![]};return rp(_0x4f1293)[_0x65bb('0x12')](function(_0x3d5d74){return _0x3d5d74[_0x65bb('0x13')];})[_0x65bb('0x14')](function(_0x10cdcc){logger[_0x65bb('0x15')]('['+[_0x10313f[_0x65bb('0x16')]()]+_0x65bb('0x17'));return _0x10cdcc['message'];});}function getUser(_0xbc8892,_0x500c2f,_0x1f0ff5,_0x3941da,_0xc7991e,_0x3d25c4){return new Promise(function(_0x4c9d1a,_0x577cd4){return getAuthToken(_0x500c2f,_0x3941da,_0x3d25c4)[_0x65bb('0x12')](function(_0x3b4b65){var _0x26cee7={'method':_0x65bb('0x18'),'uri':_0xc7991e+_0x65bb('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x3b4b65,'OData-Version':_0x65bb('0x1a')},'json':!![]};return rp(_0x26cee7);})[_0x65bb('0x12')](function(_0x325626){var _0x520583=_0x325626['value'];var _0x1d95e3=![];var _0x5383ac=null;if(!_[_0x65bb('0x1b')](_0x1f0ff5)){if(intUtil[_0x65bb('0x1c')](_0x1f0ff5[_0x65bb('0x1d')])){_0xbc8892[_0x65bb('0x1e')]=_0x1f0ff5['email'];for(_0x5383ac=0x0;_0x5383ac<_0x520583[_0x65bb('0x1f')];_0x5383ac++){if(_0x520583[_0x5383ac][_0x65bb('0x20')]===_0x1f0ff5[_0x65bb('0x1d')]&&!_0x520583[_0x5383ac][_0x65bb('0x21')]){_0x1d95e3=!![];logger[_0x65bb('0x22')]('['+[_0x3d25c4[_0x65bb('0x16')]()]+']\x20Agent\x20found\x20'+_0x520583[_0x5383ac][_0x65bb('0x23')]+'!');_0xbc8892[_0x65bb('0x24')]=_0x520583[_0x5383ac][_0x65bb('0x23')];}}}}if(!_0x1d95e3){logger[_0x65bb('0x22')]('['+[_0x3d25c4[_0x65bb('0x16')]()]+_0x65bb('0x25'));_0xbc8892[_0x65bb('0x1e')]=_0x500c2f[_0x65bb('0x26')];for(_0x5383ac=0x0;_0x5383ac<_0x520583[_0x65bb('0x1f')];_0x5383ac++){if(_0x520583[_0x5383ac][_0x65bb('0x20')]===_0x500c2f['username']){_0xbc8892[_0x65bb('0x24')]=_0x520583[_0x5383ac][_0x65bb('0x23')];}}}_0x4c9d1a(_0xbc8892);})[_0x65bb('0x14')](function(_0x4b0d92){_0x577cd4(_0x4b0d92[_0x65bb('0x27')]);});});}function createEndUser(_0x42fdac,_0x1128f9,_0xe2c849,_0x3d7b93,_0x3f2c64,_0x14fb46,_0x5e2ebe){return new Promise(function(_0x375004,_0x2346f2){return getAuthToken(_0x1128f9,_0xe2c849,_0x14fb46)[_0x65bb('0x12')](function(_0x994cc6){var _0x1d798b=_0x14fb46[_0x65bb('0x28')]()===_0x65bb('0x29')?_0x3f2c64['destcalleridnum']:_0x3f2c64['calleridnum'];var _0x1d395c={'method':_0x65bb('0xf'),'uri':_0x3d7b93+'contacts','body':{'fullname':_0x1d798b,'firstname':_0x1d798b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x65bb('0x2a')+_0x42fdac[_0x65bb('0x24')]+')'},'headers':{'Authorization':_0x65bb('0x2b')+_0x994cc6,'OData-Version':_0x65bb('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x1d395c[_0x65bb('0x2c')][_0x5e2ebe]=_0x1d798b;return rp(_0x1d395c);})['then'](function(_0x50efa9){var _0x1f49a8=_0x50efa9['headers'][_0x65bb('0x2d')];var _0x16b663=_0x1f49a8['substring'](_0x1f49a8[_0x65bb('0x2e')]('(')+0x1,_0x1f49a8[_0x65bb('0x2e')](')'));_0x42fdac['enduserId']=_0x16b663;_0x375004(_0x42fdac);})[_0x65bb('0x14')](function(_0x432420){_0x2346f2(_0x432420['message']);});});}function getEndUser(_0x38cbee,_0x5681ef,_0x192349,_0x2b406b,_0x9c680,_0x4090f3,_0x3ee7cb,_0x1f3fec){var _0x4e5007=_0x4090f3[_0x65bb('0x28')]()===_0x65bb('0x29')?_0x9c680[_0x65bb('0x2f')]:_0x9c680[_0x65bb('0x30')];return getAuthToken(_0x5681ef,_0x192349,_0x4090f3)['then'](function(_0x5e7095){_0x1f3fec=_0x1f3fec?_0x1f3fec:_0x65bb('0x31');var _0x2f44a7={'method':_0x65bb('0x18'),'uri':_0x2b406b+_0x65bb('0x32')+_0x1f3fec+_0x65bb('0x33')+_0x1f3fec+_0x65bb('0x34')+_0x4e5007['replace']('+',_0x65bb('0x35'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x5e7095,'If-None-Match':null,'OData-Version':_0x65bb('0x1a')},'json':!![]};return rp(_0x2f44a7);})[_0x65bb('0x12')](function(_0xd9118d){var _0x196b6e=![];if(!_0xd9118d)return _0x196b6e;var _0x8bd932=_0xd9118d[_0x65bb('0x36')];for(var _0x23aa5b=0x0;_0x23aa5b<_0x8bd932['length'];_0x23aa5b++){if(_0x8bd932[_0x23aa5b][_0x1f3fec]===_0x4e5007){_0x196b6e=!![];_0x38cbee[_0x65bb('0x37')]=_0x8bd932[_0x23aa5b][_0x65bb('0x38')];}}return _0x196b6e;})['then'](function(_0x4124a2){if(_0x4124a2)return _0x38cbee;if(_0x3ee7cb===_0x65bb('0x39')){logger[_0x65bb('0x22')]('['+[_0x4090f3['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x38cbee;}return createEndUser(_0x38cbee,_0x5681ef,_0x192349,_0x2b406b,_0x9c680,_0x4090f3,_0x1f3fec)[_0x65bb('0x12')](function(_0x4f51d5){logger[_0x65bb('0x22')]('['+[_0x4090f3['toUpperCase']()]+_0x65bb('0x3a'),_0x4f51d5['enduserId']);return _0x4f51d5;});});}function getCustomFields(_0x7a1166,_0xa99a4d,_0x5073fc){var _0x2874d9={};if(_0x7a1166[_0x65bb('0x1f')]>0x0){_[_0x65bb('0x3b')](_0x7a1166,function(_0x12609c){if(_[_0x65bb('0x3c')]([_0x65bb('0x3d'),_0x65bb('0x3e')],_0x12609c[_0x65bb('0x3f')])&&_0x12609c['nameField']&&!_0x12609c[_0x65bb('0x40')]){var _0x17098f=_0x12609c[_0x65bb('0x41')]['toLowerCase']();var _0x4a4dc8=_0x17098f[_0x65bb('0x42')](0x0,_0x17098f[_0x65bb('0x43')]('_'));var _0x4d5cb1=_0x17098f[_0x65bb('0x42')](_0x17098f[_0x65bb('0x43')]('_')+0x1);if(_0x4a4dc8===_0x5073fc){_0x2874d9[_0x4d5cb1]=_0x12609c[_0x65bb('0x44')];}}});}return _0x2874d9;}function getTicket(_0x575735,_0x38d1e2,_0x51fa48,_0x46e331,_0x28c38a,_0x38e73f,_0x8a879a){return new Promise(function(_0x1d0b9f,_0x1a6717){var _0x57d930;return getAuthToken(_0x38d1e2,_0x51fa48,_0x8a879a)[_0x65bb('0x12')](function(_0x4bbbc5){if(_0x38e73f[_0x65bb('0x45')]==='incident'){_0x57d930={'method':_0x65bb('0xf'),'uri':_0x46e331+_0x65bb('0x46'),'body':Object[_0x65bb('0x47')]({},{'title':intUtil[_0x65bb('0x48')](_0x38e73f['Subjects'],_0x28c38a,'\x20'),'description':intUtil[_0x65bb('0x48')](_0x38e73f[_0x65bb('0x49')],_0x28c38a,'\x0a'),'customerid_contact@odata.bind':_0x575735[_0x65bb('0x37')]?_0x65bb('0x4a')+_0x575735['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x575735[_0x65bb('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x38e73f[_0x65bb('0x4b')],_0x28c38a,_0x38e73f[_0x65bb('0x45')])),'headers':{'Authorization':_0x65bb('0x2b')+_0x4bbbc5,'OData-Version':_0x65bb('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x38e73f[_0x65bb('0x45')]==='phonecall'){var _0x25efa6=_0x575735[_0x65bb('0x37')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x575735[_0x65bb('0x24')]+')','participationtypemask':_0x575735[_0x65bb('0x4c')]===_0x65bb('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x65bb('0x4a')+_0x575735['enduserId']+')','participationtypemask':_0x575735['callDirection']===_0x65bb('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x65bb('0x2a')+_0x575735[_0x65bb('0x24')]+')','participationtypemask':_0x575735[_0x65bb('0x4c')]===_0x65bb('0x4d')?0x2:0x1}];_0x57d930={'method':'POST','uri':_0x46e331+_0x65bb('0x4e'),'body':Object[_0x65bb('0x47')]({},{'subject':intUtil['getString'](_0x38e73f[_0x65bb('0x4f')],_0x28c38a,'\x20'),'phonenumber':String(_0x28c38a[_0x65bb('0x30')]),'description':intUtil[_0x65bb('0x48')](_0x38e73f[_0x65bb('0x49')],_0x28c38a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x575735['enduserId']?_0x65bb('0x4a')+_0x575735[_0x65bb('0x37')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x575735[_0x65bb('0x24')]+')','directioncode':_0x575735['callDirection']===_0x65bb('0x4d')?![]:!![],'phonecall_activity_parties':_0x25efa6},getCustomFields(_0x38e73f[_0x65bb('0x4b')],_0x28c38a,_0x38e73f[_0x65bb('0x45')])),'headers':{'Authorization':'Bearer\x20'+_0x4bbbc5,'OData-Version':_0x65bb('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x57d930);})[_0x65bb('0x12')](function(_0x231bca){var _0x40cfeb=_0x231bca['headers'][_0x65bb('0x2d')];var _0x11f872=_0x40cfeb[_0x65bb('0x42')](_0x40cfeb[_0x65bb('0x2e')]('(')+0x1,_0x40cfeb['lastIndexOf'](')'));_0x575735[_0x65bb('0x50')]=_0x11f872;_0x1d0b9f(_0x575735);})[_0x65bb('0x14')](function(_0x3da251){_0x1a6717(_0x3da251[_0x65bb('0x27')]);});});}function emit(_0x450401,_0x4f42f4,_0x5ecd73,_0x162735){var _0x2c7947={'uri':util[_0x65bb('0x51')](_0x65bb('0x52'),_0x450401,_0x5ecd73,_0x162735)};io['to'](util[_0x65bb('0x51')]('user:%s',_0x4f42f4))['emit']('trigger:browser:url',_0x2c7947);}exports['cs']=function(_0x11a64c,_0x4cf1f4,_0x426cb2,_0x278198,_0x3e53f7,_0x1a319a,_0x5b60eb,_0x2eda53){var _0x191e70={};_0x1a319a['remoteUri']=_0x1a319a[_0x65bb('0xa')]?intUtil[_0x65bb('0x53')](_0x1a319a[_0x65bb('0x54')][_0x65bb('0x55')]):intUtil[_0x65bb('0x53')](_0x1a319a['remoteUri']);_0x1a319a[_0x65bb('0x56')]=intUtil[_0x65bb('0x53')](_0x1a319a[_0x65bb('0x56')]);_0x191e70['callDirection']=_0x2eda53===_0x65bb('0x4d')||_0x2eda53===_0x65bb('0x57')?_0x65bb('0x4d'):_0x65bb('0x29');var _0xd7cbab=_0x1a319a[_0x65bb('0xa')]?util[_0x65bb('0x51')](_0x65bb('0x58'),_0x1a319a['CloudProvider'][_0x65bb('0x55')]):util[_0x65bb('0x51')](_0x65bb('0x58'),_0x1a319a[_0x65bb('0xb')]);var _0x5d6807=util[_0x65bb('0x51')](_0x65bb('0x59'),_0x1a319a[_0x65bb('0xc')]);var _0x2a630d=util['format'](_0x65bb('0x5a'),_0x1a319a[_0x65bb('0x56')],_0x4cf1f4[_0x65bb('0x5b')],md5(_0x4cf1f4[_0x65bb('0x5b')]));if(_0x3e53f7&&_0x3e53f7[_0x65bb('0x5c')]){logger[_0x65bb('0x22')]('[QUEUE]',_0x65bb('0x5d'));_0x4cf1f4[_0x65bb('0x5e')]=_0x2a630d;}else if(_0x5b60eb&&_0x5b60eb[_0x65bb('0x5f')]&&_0x5b60eb['recordingFormat']!==_0x65bb('0x60')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4cf1f4['recordingURL']=_0x2a630d;}else{_0x4cf1f4['recordingURL']='';}return getUser(_0x191e70,_0x1a319a,_0x278198,_0x5d6807,_0xd7cbab,_0x2eda53)['then'](function(_0x297fa2){logger[_0x65bb('0x22')]('['+_0x2eda53[_0x65bb('0x16')]()+_0x65bb('0x61'),_0x297fa2[_0x65bb('0x24')]);logger['info']('['+_0x2eda53['toUpperCase']()+_0x65bb('0x62'),_0x297fa2[_0x65bb('0x1e')]);return getEndUser(_0x297fa2,_0x1a319a,_0x5d6807,_0xd7cbab,_0x4cf1f4,_0x2eda53,_0x426cb2[_0x65bb('0x63')],_0x426cb2[_0x65bb('0x64')]);})[_0x65bb('0x12')](function(_0x33ba57){logger[_0x65bb('0x22')]('['+_0x2eda53[_0x65bb('0x16')]()+_0x65bb('0x65'),_0x33ba57[_0x65bb('0x37')]);logger[_0x65bb('0x22')]('['+_0x2eda53[_0x65bb('0x16')]()+_0x65bb('0x66'),_0x4cf1f4[_0x65bb('0x30')]);return getTicket(_0x33ba57,_0x1a319a,_0x5d6807,_0xd7cbab,_0x4cf1f4,_0x426cb2,_0x2eda53);})['then'](function(_0x234db2){logger[_0x65bb('0x22')](util['format']('['+_0x2eda53['toUpperCase']()+_0x65bb('0x67'),_0x426cb2[_0x65bb('0x45')],_0x234db2[_0x65bb('0x50')]));logger[_0x65bb('0x22')](util[_0x65bb('0x51')]('['+_0x2eda53['toUpperCase']()+_0x65bb('0x68'),_0x2eda53));if(_0x2eda53!==_0x65bb('0x57')&&_0x426cb2[_0x65bb('0x69')]){logger[_0x65bb('0x22')]('['+_0x2eda53['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1a319a[_0x65bb('0xb')],_0x278198['name'],_0x426cb2[_0x65bb('0x45')],_0x234db2[_0x65bb('0x50')]);}})[_0x65bb('0x14')](function(_0x3bad41){logger[_0x65bb('0x15')]('['+_0x2eda53[_0x65bb('0x16')]()+_0x65bb('0x6a'),_0x3bad41[_0x65bb('0x27')]);console[_0x65bb('0x15')](_0x65bb('0x6b'),_0x3bad41);});}; \ No newline at end of file +var _0x257b=['userEmail','length','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','catch','toLowerCase','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','type','nameField','customField','indexOf','incident','incidents','getString','Descriptions','Fields','4.0','ticketType','phonecall','callDirection','queue','/contacts(','phonecalls','assign','Subjects','headers','format','user:%s','emit','stripTrailingSlash','serverUrl','outbound','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','access_token','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','then','value','isNil','validateEmail','email'];(function(_0x5267bb,_0xbfe1f5){var _0xba6f49=function(_0x101f21){while(--_0x101f21){_0x5267bb['push'](_0x5267bb['shift']());}};_0xba6f49(++_0xbfe1f5);}(_0x257b,0x12a));var _0xb257=function(_0xb6b2e0,_0x3325e2){_0xb6b2e0=_0xb6b2e0-0x0;var _0x5b5b23=_0x257b[_0xb6b2e0];return _0x5b5b23;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require('util');var intUtil=require(_0xb257('0x0'));var md5=require('md5');var Redis=require(_0xb257('0x1'));var logger=require(_0xb257('0x2'))(_0xb257('0x3'));var config=require(_0xb257('0x4'));config[_0xb257('0x5')]=_['defaults'](config[_0xb257('0x5')],{'host':_0xb257('0x6'),'port':0x18eb});var io=require(_0xb257('0x7'))(new Redis(config[_0xb257('0x5')]));function getAuthToken(_0x37a456,_0x1ad76f,_0xde2dc0){if(_0x37a456[_0xb257('0x8')]){_0x37a456[_0xb257('0x9')]=_0x37a456[_0xb257('0xa')][_0xb257('0xb')];_0x37a456[_0xb257('0xc')]=_0x37a456[_0xb257('0xa')][_0xb257('0xd')];return Promise[_0xb257('0xe')](_0x37a456[_0xb257('0xa')][_0xb257('0xf')]);}var _0x497ebb={'method':_0xb257('0x10'),'uri':_0x1ad76f,'form':{'client_id':_0x37a456[_0xb257('0x11')],'resource':_0x37a456[_0xb257('0x9')],'username':_0x37a456[_0xb257('0x12')],'password':_0x37a456[_0xb257('0x13')],'grant_type':'password','client_secret':_0x37a456[_0xb257('0x14')]},'json':!![]};return rp(_0x497ebb)['then'](function(_0x57d377){return _0x57d377[_0xb257('0x15')];})['catch'](function(_0x581b7f){logger[_0xb257('0x16')]('['+[_0xde2dc0['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x581b7f[_0xb257('0x17')];});}function getUser(_0x195aec,_0x17fa9f,_0x54fb57,_0x1a0be7,_0x5af929,_0x395764){return new Promise(function(_0x1acb31,_0x203261){return getAuthToken(_0x17fa9f,_0x1a0be7,_0x395764)['then'](function(_0x4975e3){var _0x571416={'method':_0xb257('0x18'),'uri':_0x5af929+_0xb257('0x19'),'headers':{'Authorization':_0xb257('0x1a')+_0x4975e3,'OData-Version':'4.0'},'json':!![]};return rp(_0x571416);})[_0xb257('0x1b')](function(_0x28aa81){var _0x1693f6=_0x28aa81[_0xb257('0x1c')];var _0x34c40c=![];var _0x3b2491=null;if(!_[_0xb257('0x1d')](_0x54fb57)){if(intUtil[_0xb257('0x1e')](_0x54fb57[_0xb257('0x1f')])){_0x195aec[_0xb257('0x20')]=_0x54fb57[_0xb257('0x1f')];for(_0x3b2491=0x0;_0x3b2491<_0x1693f6[_0xb257('0x21')];_0x3b2491++){if(_0x1693f6[_0x3b2491]['internalemailaddress']===_0x54fb57['email']&&!_0x1693f6[_0x3b2491][_0xb257('0x22')]){_0x34c40c=!![];logger[_0xb257('0x23')]('['+[_0x395764[_0xb257('0x24')]()]+_0xb257('0x25')+_0x1693f6[_0x3b2491]['systemuserid']+'!');_0x195aec[_0xb257('0x26')]=_0x1693f6[_0x3b2491][_0xb257('0x27')];}}}}if(!_0x34c40c){logger[_0xb257('0x23')]('['+[_0x395764[_0xb257('0x24')]()]+_0xb257('0x28'));_0x195aec[_0xb257('0x20')]=_0x17fa9f['username'];for(_0x3b2491=0x0;_0x3b2491<_0x1693f6[_0xb257('0x21')];_0x3b2491++){if(_0x1693f6[_0x3b2491][_0xb257('0x29')]===_0x17fa9f[_0xb257('0x12')]){_0x195aec['userId']=_0x1693f6[_0x3b2491][_0xb257('0x27')];}}}_0x1acb31(_0x195aec);})[_0xb257('0x2a')](function(_0x354758){_0x203261(_0x354758[_0xb257('0x17')]);});});}function createEndUser(_0xd1a5f0,_0x558c88,_0x57cb23,_0x35b0c9,_0x1a3ac4,_0x35fa3b,_0x1fbcc5){return new Promise(function(_0xf70bdd,_0x3ffb3b){return getAuthToken(_0x558c88,_0x57cb23,_0x35fa3b)['then'](function(_0x44c910){var _0x1debd2=_0x35fa3b[_0xb257('0x2b')]()==='outbound'?_0x1a3ac4['destcalleridnum']:_0x1a3ac4['calleridnum'];var _0x43c4b9={'method':'POST','uri':_0x35b0c9+_0xb257('0x2c'),'body':{'fullname':_0x1debd2,'firstname':_0x1debd2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb257('0x2d')+_0xd1a5f0[_0xb257('0x26')]+')'},'headers':{'Authorization':_0xb257('0x1a')+_0x44c910,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x43c4b9['body'][_0x1fbcc5]=_0x1debd2;return rp(_0x43c4b9);})['then'](function(_0x1ea326){var _0x463218=_0x1ea326['headers'][_0xb257('0x2e')];var _0x5796be=_0x463218[_0xb257('0x2f')](_0x463218[_0xb257('0x30')]('(')+0x1,_0x463218[_0xb257('0x30')](')'));_0xd1a5f0[_0xb257('0x31')]=_0x5796be;_0xf70bdd(_0xd1a5f0);})['catch'](function(_0x2b64f3){_0x3ffb3b(_0x2b64f3[_0xb257('0x17')]);});});}function getEndUser(_0x31f3ce,_0x6b91a5,_0xa42c29,_0x53ca33,_0x44cc7b,_0x3f2db9,_0x34032f,_0x1e5d4a){var _0x4efbd2=_0x3f2db9[_0xb257('0x2b')]()==='outbound'?_0x44cc7b[_0xb257('0x32')]:_0x44cc7b[_0xb257('0x33')];return getAuthToken(_0x6b91a5,_0xa42c29,_0x3f2db9)[_0xb257('0x1b')](function(_0x3b5996){_0x1e5d4a=_0x1e5d4a?_0x1e5d4a:_0xb257('0x34');var _0x42cc6d={'method':'GET','uri':_0x53ca33+_0xb257('0x35')+_0x1e5d4a+_0xb257('0x36')+_0x1e5d4a+_0xb257('0x37')+_0x4efbd2[_0xb257('0x38')]('+',_0xb257('0x39'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3b5996,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x42cc6d);})['then'](function(_0x3aa179){var _0x165f32=![];if(!_0x3aa179)return _0x165f32;var _0x3d30d5=_0x3aa179['value'];for(var _0x5bc740=0x0;_0x5bc740<_0x3d30d5[_0xb257('0x21')];_0x5bc740++){if(_0x3d30d5[_0x5bc740][_0x1e5d4a]===_0x4efbd2){_0x165f32=!![];_0x31f3ce[_0xb257('0x31')]=_0x3d30d5[_0x5bc740][_0xb257('0x3a')];}}return _0x165f32;})[_0xb257('0x1b')](function(_0x2ef800){if(_0x2ef800)return _0x31f3ce;if(_0x34032f==='nothing'){logger[_0xb257('0x23')]('['+[_0x3f2db9[_0xb257('0x24')]()]+_0xb257('0x3b'));return _0x31f3ce;}return createEndUser(_0x31f3ce,_0x6b91a5,_0xa42c29,_0x53ca33,_0x44cc7b,_0x3f2db9,_0x1e5d4a)['then'](function(_0x22d313){logger[_0xb257('0x23')]('['+[_0x3f2db9[_0xb257('0x24')]()]+_0xb257('0x3c'),_0x22d313[_0xb257('0x31')]);return _0x22d313;});});}function getCustomFields(_0x35ae4b,_0x3d0d7a,_0x3df4d0){var _0x3574fb={};if(_0x35ae4b['length']>0x0){_[_0xb257('0x3d')](_0x35ae4b,function(_0x1b8a9b){if(_[_0xb257('0x3e')](['string','picklist'],_0x1b8a9b[_0xb257('0x3f')])&&_0x1b8a9b[_0xb257('0x40')]&&!_0x1b8a9b[_0xb257('0x41')]){var _0x108676=_0x1b8a9b['idField']['toLowerCase']();var _0xd43da3=_0x108676[_0xb257('0x2f')](0x0,_0x108676['indexOf']('_'));var _0x289054=_0x108676['substring'](_0x108676[_0xb257('0x42')]('_')+0x1);if(_0xd43da3===_0x3df4d0){_0x3574fb[_0x289054]=_0x1b8a9b['content'];}}});}return _0x3574fb;}function getTicket(_0x2ed0ee,_0x19376d,_0x3a4424,_0x1c9a78,_0x115216,_0x57701f,_0x3a965b){return new Promise(function(_0x4fe6c7,_0x54edb5){var _0x282aca;return getAuthToken(_0x19376d,_0x3a4424,_0x3a965b)['then'](function(_0x430a24){if(_0x57701f['ticketType']===_0xb257('0x43')){_0x282aca={'method':_0xb257('0x10'),'uri':_0x1c9a78+_0xb257('0x44'),'body':Object['assign']({},{'title':intUtil['getString'](_0x57701f['Subjects'],_0x115216,'\x20'),'description':intUtil[_0xb257('0x45')](_0x57701f[_0xb257('0x46')],_0x115216,'\x0a'),'customerid_contact@odata.bind':_0x2ed0ee['enduserId']?'/contacts('+_0x2ed0ee[_0xb257('0x31')]+')':undefined,'ownerid@odata.bind':_0xb257('0x2d')+_0x2ed0ee[_0xb257('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x57701f[_0xb257('0x47')],_0x115216,_0x57701f['ticketType'])),'headers':{'Authorization':_0xb257('0x1a')+_0x430a24,'OData-Version':_0xb257('0x48')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x57701f[_0xb257('0x49')]===_0xb257('0x4a')){var _0x179882=_0x2ed0ee[_0xb257('0x31')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2ed0ee[_0xb257('0x26')]+')','participationtypemask':_0x2ed0ee[_0xb257('0x4b')]===_0xb257('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0xb257('0x4d')+_0x2ed0ee[_0xb257('0x31')]+')','participationtypemask':_0x2ed0ee[_0xb257('0x4b')]===_0xb257('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xb257('0x2d')+_0x2ed0ee[_0xb257('0x26')]+')','participationtypemask':_0x2ed0ee[_0xb257('0x4b')]===_0xb257('0x4c')?0x2:0x1}];_0x282aca={'method':_0xb257('0x10'),'uri':_0x1c9a78+_0xb257('0x4e'),'body':Object[_0xb257('0x4f')]({},{'subject':intUtil[_0xb257('0x45')](_0x57701f[_0xb257('0x50')],_0x115216,'\x20'),'phonenumber':String(_0x115216[_0xb257('0x33')]),'description':intUtil[_0xb257('0x45')](_0x57701f[_0xb257('0x46')],_0x115216,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2ed0ee[_0xb257('0x31')]?_0xb257('0x4d')+_0x2ed0ee['enduserId']+')':undefined,'ownerid@odata.bind':_0xb257('0x2d')+_0x2ed0ee[_0xb257('0x26')]+')','directioncode':_0x2ed0ee[_0xb257('0x4b')]===_0xb257('0x4c')?![]:!![],'phonecall_activity_parties':_0x179882},getCustomFields(_0x57701f[_0xb257('0x47')],_0x115216,_0x57701f[_0xb257('0x49')])),'headers':{'Authorization':'Bearer\x20'+_0x430a24,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x282aca);})['then'](function(_0x35603e){var _0x3232c6=_0x35603e[_0xb257('0x51')][_0xb257('0x2e')];var _0x42f9fb=_0x3232c6[_0xb257('0x2f')](_0x3232c6['lastIndexOf']('(')+0x1,_0x3232c6['lastIndexOf'](')'));_0x2ed0ee['ticketId']=_0x42f9fb;_0x4fe6c7(_0x2ed0ee);})[_0xb257('0x2a')](function(_0x4f8ea){_0x54edb5(_0x4f8ea[_0xb257('0x17')]);});});}function emit(_0x347af4,_0x266dc4,_0x102ccd,_0x5dd983){var _0x34d08d={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x347af4,_0x102ccd,_0x5dd983)};io['to'](util[_0xb257('0x52')](_0xb257('0x53'),_0x266dc4))[_0xb257('0x54')]('trigger:browser:url',_0x34d08d);}exports['cs']=function(_0x482cb8,_0x3f5acd,_0x1689c9,_0x7f5758,_0x3a8713,_0x44e37c,_0x39229,_0x4cc41c){var _0x1359f6={};_0x44e37c[_0xb257('0x9')]=_0x44e37c['modernAuthentication']?intUtil[_0xb257('0x55')](_0x44e37c[_0xb257('0xa')]['data7']):intUtil[_0xb257('0x55')](_0x44e37c[_0xb257('0x9')]);_0x44e37c[_0xb257('0x56')]=intUtil[_0xb257('0x55')](_0x44e37c[_0xb257('0x56')]);_0x1359f6[_0xb257('0x4b')]=_0x4cc41c===_0xb257('0x4c')||_0x4cc41c==='unmanaged'?_0xb257('0x4c'):_0xb257('0x57');var _0x3fda80=_0x44e37c['modernAuthentication']?util[_0xb257('0x52')](_0xb257('0x58'),_0x44e37c[_0xb257('0xa')][_0xb257('0xb')]):util['format'](_0xb257('0x58'),_0x44e37c[_0xb257('0x9')]);var _0x279146=util[_0xb257('0x52')](_0xb257('0x59'),_0x44e37c['tenantId']);var _0x19a81f=util[_0xb257('0x52')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44e37c[_0xb257('0x56')],_0x3f5acd[_0xb257('0x5a')],md5(_0x3f5acd['uniqueid']));if(_0x3a8713&&_0x3a8713[_0xb257('0x5b')]){logger[_0xb257('0x23')](_0xb257('0x5c'),_0xb257('0x5d'));_0x3f5acd[_0xb257('0x5e')]=_0x19a81f;}else if(_0x39229&&_0x39229['recordingFormat']&&_0x39229['recordingFormat']!==_0xb257('0x5f')){logger['info'](_0xb257('0x60'),_0xb257('0x5d'));_0x3f5acd['recordingURL']=_0x19a81f;}else{_0x3f5acd[_0xb257('0x5e')]='';}return getUser(_0x1359f6,_0x44e37c,_0x7f5758,_0x279146,_0x3fda80,_0x4cc41c)[_0xb257('0x1b')](function(_0x5b00e6){logger[_0xb257('0x23')]('['+_0x4cc41c[_0xb257('0x24')]()+_0xb257('0x61'),_0x5b00e6[_0xb257('0x26')]);logger[_0xb257('0x23')]('['+_0x4cc41c[_0xb257('0x24')]()+_0xb257('0x62'),_0x5b00e6[_0xb257('0x20')]);return getEndUser(_0x5b00e6,_0x44e37c,_0x279146,_0x3fda80,_0x3f5acd,_0x4cc41c,_0x1689c9[_0xb257('0x63')],_0x1689c9[_0xb257('0x64')]);})[_0xb257('0x1b')](function(_0x11bd22){logger[_0xb257('0x23')]('['+_0x4cc41c[_0xb257('0x24')]()+_0xb257('0x65'),_0x11bd22[_0xb257('0x31')]);logger[_0xb257('0x23')]('['+_0x4cc41c[_0xb257('0x24')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x3f5acd[_0xb257('0x33')]);return getTicket(_0x11bd22,_0x44e37c,_0x279146,_0x3fda80,_0x3f5acd,_0x1689c9,_0x4cc41c);})[_0xb257('0x1b')](function(_0x2926f7){logger[_0xb257('0x23')](util[_0xb257('0x52')]('['+_0x4cc41c[_0xb257('0x24')]()+_0xb257('0x66'),_0x1689c9[_0xb257('0x49')],_0x2926f7[_0xb257('0x67')]));logger[_0xb257('0x23')](util[_0xb257('0x52')]('['+_0x4cc41c[_0xb257('0x24')]()+_0xb257('0x68'),_0x4cc41c));if(_0x4cc41c!==_0xb257('0x69')&&_0x1689c9[_0xb257('0x6a')]){logger[_0xb257('0x23')]('['+_0x4cc41c[_0xb257('0x24')]()+']',_0xb257('0x6b'));emit(_0x44e37c[_0xb257('0x9')],_0x7f5758[_0xb257('0x6c')],_0x1689c9[_0xb257('0x49')],_0x2926f7[_0xb257('0x67')]);}})[_0xb257('0x2a')](function(_0x575e37){logger[_0xb257('0x16')]('['+_0x4cc41c[_0xb257('0x24')]()+_0xb257('0x6d'),_0x575e37[_0xb257('0x17')]);console[_0xb257('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x575e37);});}; \ 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 c069293..fd1688e 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 _0xe59f=['socket.io-emitter','application/json','info','merge','format','calleridnum','Subjects','getString','Descriptions','
','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','GET','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','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','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost'];(function(_0x534ee1,_0x1473a6){var _0x9c1cdb=function(_0x1e1be2){while(--_0x1e1be2){_0x534ee1['push'](_0x534ee1['shift']());}};_0x9c1cdb(++_0x1473a6);}(_0xe59f,0x10f));var _0xfe59=function(_0xb485c4,_0xa81808){_0xb485c4=_0xb485c4-0x0;var _0x43dac5=_0xe59f[_0xb485c4];return _0x43dac5;};'use strict';var _=require(_0xfe59('0x0'));var rp=require(_0xfe59('0x1'));var md5=require(_0xfe59('0x2'));var util=require(_0xfe59('0x3'));var Redis=require('ioredis');var intUtil=require(_0xfe59('0x4'));var config=require(_0xfe59('0x5'));var logger=require(_0xfe59('0x6'))(_0xfe59('0x7'));config[_0xfe59('0x8')]=_[_0xfe59('0x9')](config[_0xfe59('0x8')],{'host':_0xfe59('0xa'),'port':0x18eb});var io=require(_0xfe59('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0xfe59('0xc'),'Accept':'application/json'};function emit(_0x2d2eae,_0x624468,_0x3f9ec4){io['to'](_0x2d2eae)['emit'](_0x624468,_0x3f9ec4);}function getTicket(_0x395c7d,_0x4ec783,_0x12b7e1,_0x4c66c1,_0x45bdf7){logger[_0xfe59('0xd')]('Creating\x20new\x20ticket...');var _0x1a70d9=_[_0xfe59('0xe')]({'responder_id':_0x4ec783['id'],'requester_id':_0x12b7e1['id'],'name':util[_0xfe59('0xf')]('Caller\x20-\x20%s',_0x45bdf7['calleridname']),'phone':_0x45bdf7[_0xfe59('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x4c66c1[_0xfe59('0x11')],_0x45bdf7,'\x20'),'description':intUtil[_0xfe59('0x12')](_0x4c66c1[_0xfe59('0x13')],_0x45bdf7,_0xfe59('0x14')),'tags':getTags(_0x4c66c1['Tags'],'name')},getCustomFields(_0x4c66c1[_0xfe59('0x15')],_0x45bdf7));_0x1a70d9[_0xfe59('0x16')]=_[_0xfe59('0x17')](_[_0xfe59('0x18')](_0x1a70d9[_0xfe59('0x16')],'id'),_0xfe59('0x19'));return request({'uri':util[_0xfe59('0xf')](_0xfe59('0x1a'),_0x395c7d['remoteUri']),'method':_0xfe59('0x1b'),'body':_0x1a70d9})[_0xfe59('0x1c')](function(_0x3f9d8f){logger[_0xfe59('0xd')](_0xfe59('0x1d'));return _0x3f9d8f;});}function getUser(_0x6c9f8b,_0x1f5c03){if(intUtil[_0xfe59('0x1e')](_0x1f5c03)){return request({'uri':util[_0xfe59('0xf')](_0xfe59('0x1f'),_0x6c9f8b[_0xfe59('0x20')]),'qs':{'email':_0x1f5c03}})[_0xfe59('0x1c')](function(_0x2cb701){if(_0x2cb701[_0xfe59('0x21')]){logger[_0xfe59('0xd')](_0xfe59('0x22'));return _[_0xfe59('0x23')](_0x2cb701,function(_0x4d7490){return _0x4d7490['contact'][_0xfe59('0x24')]===_0x1f5c03;});}else{logger[_0xfe59('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xfe59('0xf')](_0xfe59('0x25'),_0x6c9f8b['remoteUri'])})['then'](function(_0x20a4aa){logger[_0xfe59('0xd')](_0xfe59('0x26'));return _0x20a4aa;});}});}else{logger[_0xfe59('0xd')](_0xfe59('0x27'));return request({'uri':util[_0xfe59('0xf')](_0xfe59('0x25'),_0x6c9f8b[_0xfe59('0x20')])})[_0xfe59('0x1c')](function(_0x524501){logger['info'](_0xfe59('0x26'));return _0x524501;});}}function getEndUser(_0x3a7090,_0x413897,_0x40ea0a){logger[_0xfe59('0xd')](_0xfe59('0x28'),_0x40ea0a);return request({'uri':util[_0xfe59('0xf')](_0xfe59('0x29'),_0x3a7090[_0xfe59('0x20')]),'qs':{'phone':_0x40ea0a}})[_0xfe59('0x1c')](function(_0xbf16b7){if(_0xbf16b7[_0xfe59('0x21')]){logger[_0xfe59('0xd')](_0xfe59('0x2a'));return _[_0xfe59('0x23')](_0xbf16b7,{'phone':_0x40ea0a});}else{logger[_0xfe59('0xd')](_0xfe59('0x2b'));return request({'uri':util[_0xfe59('0xf')](_0xfe59('0x29'),_0x3a7090[_0xfe59('0x20')]),'method':_0xfe59('0x1b'),'body':{'name':_0x413897,'phone':_0x40ea0a}})[_0xfe59('0x1c')](function(_0x1fabef){logger['info'](_0xfe59('0x2c'));return _0x1fabef;});}});}function getAuth(_0xdff7ee){return util[_0xfe59('0xf')]('Basic\x20%s',new Buffer(_0xdff7ee[_0xfe59('0x2d')]+':X')[_0xfe59('0x2e')](_0xfe59('0x2f')));}function request(_0x5e9b64){logger[_0xfe59('0x30')]('[HTTP]',JSON['stringify'](_0x5e9b64));return rp(_[_0xfe59('0x9')](_0x5e9b64,{'method':_0xfe59('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x4e0685,_0x2e028f){var _0x394edb=[];if(_0x4e0685&&_0x4e0685[_0xfe59('0x21')]>0x0){_0x394edb=_['map'](_0x4e0685,_0x2e028f);}return _0x394edb;}function getCustomFields(_0x175218,_0x37184f){var _0x10c4ae=[];var _0x242a36={'custom_fields':[]};if(_0x175218[_0xfe59('0x21')]>0x0){_[_0xfe59('0x32')](_0x175218,function(_0x22adbd){if(_[_0xfe59('0x33')]([_0xfe59('0x34'),_0xfe59('0x35')],_0x22adbd['type'])&&_0x22adbd[_0xfe59('0x36')]&&!_0x22adbd[_0xfe59('0x37')]){_0x242a36[_0x22adbd[_0xfe59('0x36')][_0xfe59('0x38')]()]=_0x22adbd[_0xfe59('0x39')]['toString']();}else if(_[_0xfe59('0x33')]([_0xfe59('0x34'),_0xfe59('0x35')],_0x22adbd[_0xfe59('0x3a')])&&_0x22adbd[_0xfe59('0x3b')]&&_0x22adbd['customField']){_0x242a36['custom_fields'][_0xfe59('0x3c')]({'id':_0x22adbd['idField'],'value':_0x22adbd[_0xfe59('0x39')][_0xfe59('0x2e')]()});}else if(_0x22adbd[_0xfe59('0x3a')]==='variable'&&_0x22adbd[_0xfe59('0x3d')]&&_0x22adbd[_0xfe59('0x3b')]&&_0x22adbd[_0xfe59('0x37')]){_0x37184f[_0x22adbd[_0xfe59('0x3d')]]&&_0x242a36['custom_fields'][_0xfe59('0x3c')]({'id':_0x22adbd['idField'],'value':_0x37184f[_0x22adbd[_0xfe59('0x3d')]][_0xfe59('0x2e')]()});}else if(_0x22adbd['type']===_0xfe59('0x3e')&&_0x22adbd[_0xfe59('0x3f')]&&_0x22adbd['Variable'][_0xfe59('0x40')]&&_0x22adbd[_0xfe59('0x3b')]&&_0x22adbd[_0xfe59('0x37')]){_0x37184f[_0x22adbd[_0xfe59('0x3f')][_0xfe59('0x40')]['toLowerCase']()]&&_0x242a36[_0xfe59('0x16')]['push']({'id':_0x22adbd['idField'],'value':_0x37184f[_0x22adbd[_0xfe59('0x3f')][_0xfe59('0x40')][_0xfe59('0x38')]()]['toString']()});}});}return _0x242a36;}exports[_0xfe59('0x41')]=function(_0x3dc2f6,_0x13a693,_0x2939d7,_0x4efeb7,_0x34472d,_0x495b85){var _0x12c652,_0x4442bf;_0x495b85['remoteUri']=intUtil[_0xfe59('0x42')](_0x495b85[_0xfe59('0x20')]);_0x495b85[_0xfe59('0x43')]=intUtil['stripTrailingSlash'](_0x495b85['serverUrl']);if(_0x34472d&&_0x34472d[_0xfe59('0x44')]){logger[_0xfe59('0xd')](_0xfe59('0x45'),_0xfe59('0x46'));_0x13a693[_0xfe59('0x47')]=util[_0xfe59('0xf')](_0xfe59('0x48'),_0x495b85[_0xfe59('0x43')],_0x13a693[_0xfe59('0x49')],md5(_0x13a693[_0xfe59('0x49')]));}else{_0x13a693['recordingURL']='';}headers[_0xfe59('0x4a')]=getAuth(_0x495b85);return getUser(_0x495b85,_0x4efeb7['email'])['then'](function(_0x569642){_0x12c652=_0x569642;logger[_0xfe59('0xd')](_0xfe59('0x4b'),_0x12c652['id']);return getEndUser(_0x495b85,_0x13a693[_0xfe59('0x4c')],_0x13a693[_0xfe59('0x10')]);})[_0xfe59('0x1c')](function(_0x39bf9e){_0x4442bf=_0x39bf9e;logger['info'](_0xfe59('0x4d'),_0x4442bf['id']);return getTicket(_0x495b85,_0x12c652,_0x4442bf,_0x2939d7,_0x13a693);})[_0xfe59('0x1c')](function(_0x181fc8){if(_0x181fc8&&_0x181fc8['id']){logger[_0xfe59('0xd')](_0xfe59('0x1d'));logger[_0xfe59('0xd')](_0xfe59('0x4e'),_0x181fc8['id']);logger[_0xfe59('0xd')](_0xfe59('0x45'),_0xfe59('0x4f'));emit(util[_0xfe59('0xf')](_0xfe59('0x50'),_0x4efeb7[_0xfe59('0x40')]),_0xfe59('0x51'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x495b85['remoteUri'],_0x181fc8['id'])});}})[_0xfe59('0x52')](function(_0x2656a8){logger['error']('[QUEUE]',JSON[_0xfe59('0x53')](_0x2656a8));});};exports[_0xfe59('0x54')]=function(_0x116551,_0x5ddfef,_0x2f643b,_0x56487a,_0x27725f,_0x3a1b42,_0x119795){var _0xfb7bc,_0x484cc3;_0x3a1b42[_0xfe59('0x20')]=intUtil[_0xfe59('0x42')](_0x3a1b42[_0xfe59('0x20')]);_0x3a1b42[_0xfe59('0x43')]=intUtil['stripTrailingSlash'](_0x3a1b42[_0xfe59('0x43')]);if(_0x119795&&_0x119795[_0xfe59('0x55')]&&_0x119795[_0xfe59('0x55')]!=='none'){logger[_0xfe59('0xd')](_0xfe59('0x56'),_0xfe59('0x46'));_0x5ddfef['recordingURL']=util['format'](_0xfe59('0x48'),_0x3a1b42[_0xfe59('0x43')],_0x5ddfef['uniqueid'],md5(_0x5ddfef['uniqueid']));}headers[_0xfe59('0x4a')]=getAuth(_0x3a1b42);return getUser(_0x3a1b42,_0x56487a[_0xfe59('0x24')])[_0xfe59('0x1c')](function(_0x858c9f){_0xfb7bc=_0x858c9f;logger[_0xfe59('0xd')]('The\x20User\x20ID\x20is:',_0xfb7bc['id']);return getEndUser(_0x3a1b42,_0x5ddfef[_0xfe59('0x57')],_0x5ddfef[_0xfe59('0x58')]);})[_0xfe59('0x1c')](function(_0x24c63e){_0x484cc3=_0x24c63e;logger[_0xfe59('0xd')]('The\x20Enduser\x20ID\x20is:',_0x484cc3['id']);return getTicket(_0x3a1b42,_0xfb7bc,_0x484cc3,_0x2f643b,_0x5ddfef);})[_0xfe59('0x1c')](function(_0x36f839){if(_0x36f839&&_0x36f839['id']){logger[_0xfe59('0xd')](_0xfe59('0x1d'));logger[_0xfe59('0xd')](_0xfe59('0x4e'),_0x36f839['id']);logger[_0xfe59('0xd')](_0xfe59('0x56'),_0xfe59('0x4f'));emit(util[_0xfe59('0xf')](_0xfe59('0x50'),_0x56487a[_0xfe59('0x40')]),_0xfe59('0x51'),{'uri':util[_0xfe59('0xf')](_0xfe59('0x59'),_0x3a1b42[_0xfe59('0x20')],_0x36f839['id'])});}})[_0xfe59('0x52')](function(_0x57ad69){logger[_0xfe59('0x5a')](_0xfe59('0x56'),JSON[_0xfe59('0x53')](_0x57ad69));});};exports[_0xfe59('0x5b')]=function(_0x114b92,_0x3e3876,_0x2bbfbe,_0xc2eae7,_0x318d36,_0x2c9f9a){var _0x273f9c,_0x573aa3;_0x2c9f9a[_0xfe59('0x20')]=intUtil[_0xfe59('0x42')](_0x2c9f9a[_0xfe59('0x20')]);_0x2c9f9a[_0xfe59('0x43')]=intUtil['stripTrailingSlash'](_0x2c9f9a[_0xfe59('0x43')]);if(_0x318d36&&_0x318d36[_0xfe59('0x44')]){logger[_0xfe59('0xd')]('['+_0x3e3876[_0xfe59('0x5c')][_0xfe59('0x5d')]()+']',_0xfe59('0x46'));_0x3e3876['recordingURL']=util[_0xfe59('0xf')](_0xfe59('0x48'),_0x2c9f9a[_0xfe59('0x43')],_0x3e3876[_0xfe59('0x49')],md5(_0x3e3876[_0xfe59('0x49')]));}else{_0x3e3876['recordingURL']='';}headers[_0xfe59('0x4a')]=getAuth(_0x2c9f9a);return getUser(_0x2c9f9a,'')[_0xfe59('0x1c')](function(_0x1ddf85){_0x273f9c=_0x1ddf85;logger[_0xfe59('0xd')](_0xfe59('0x4b'),_0x273f9c['id']);return getEndUser(_0x2c9f9a,_0x3e3876['calleridname'],_0x3e3876['calleridnum']);})['then'](function(_0x327b0f){_0x573aa3=_0x327b0f;logger[_0xfe59('0xd')](_0xfe59('0x4d'),_0x573aa3['id']);return getTicket(_0x2c9f9a,_0x273f9c,_0x573aa3,_0x2bbfbe,_0x3e3876);})[_0xfe59('0x1c')](function(_0x2a1bfe){if(_0x2a1bfe){logger[_0xfe59('0xd')]('Ticket\x20created!');logger[_0xfe59('0xd')](_0xfe59('0x4e'),_0x2a1bfe['id']);}})[_0xfe59('0x52')](function(_0x285e86){logger[_0xfe59('0x5a')]('['+_0x3e3876[_0xfe59('0x5c')]['toUpperCase']()+']',JSON[_0xfe59('0x53')](_0x285e86));});}; \ No newline at end of file +var _0xdb79=['Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','info','Agent\x20found!','find','contact','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','Enduser\x20created.','apiKey','toString','base64','defaults','map','forEach','string','type','nameField','customField','toLowerCase','includes','picklist','idField','content','variableName','push','customVariable','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','stringify','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','recordingURL','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','Tags'];(function(_0x28af26,_0x22cb19){var _0x50c5c0=function(_0x22b9c4){while(--_0x22b9c4){_0x28af26['push'](_0x28af26['shift']());}};_0x50c5c0(++_0x22cb19);}(_0xdb79,0x1b8));var _0x9db7=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xdb79[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x9db7('0x0'));var rp=require(_0x9db7('0x1'));var md5=require(_0x9db7('0x2'));var util=require(_0x9db7('0x3'));var Redis=require(_0x9db7('0x4'));var intUtil=require(_0x9db7('0x5'));var config=require(_0x9db7('0x6'));var logger=require(_0x9db7('0x7'))(_0x9db7('0x8'));config[_0x9db7('0x9')]=_['defaults'](config['redis'],{'host':_0x9db7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9db7('0x9')]));var headers={'Content-Type':_0x9db7('0xb'),'Accept':_0x9db7('0xb')};function emit(_0x21d371,_0x5f0a11,_0x204f12){io['to'](_0x21d371)['emit'](_0x5f0a11,_0x204f12);}function getTicket(_0x5a10f6,_0x4c8784,_0xd37c1c,_0x254a70,_0x16afff){logger['info']('Creating\x20new\x20ticket...');var _0xb1cb71=_[_0x9db7('0xc')]({'responder_id':_0x4c8784['id'],'requester_id':_0xd37c1c['id'],'name':util[_0x9db7('0xd')](_0x9db7('0xe'),_0x16afff['calleridname']),'phone':_0x16afff[_0x9db7('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9db7('0x10')](_0x254a70[_0x9db7('0x11')],_0x16afff,'\x20'),'description':intUtil[_0x9db7('0x10')](_0x254a70[_0x9db7('0x12')],_0x16afff,'
'),'tags':getTags(_0x254a70[_0x9db7('0x13')],'name')},getCustomFields(_0x254a70[_0x9db7('0x14')],_0x16afff));_0xb1cb71[_0x9db7('0x15')]=_[_0x9db7('0x16')](_[_0x9db7('0x17')](_0xb1cb71[_0x9db7('0x15')],'id'),'value');return request({'uri':util[_0x9db7('0xd')](_0x9db7('0x18'),_0x5a10f6[_0x9db7('0x19')]),'method':_0x9db7('0x1a'),'body':_0xb1cb71})[_0x9db7('0x1b')](function(_0x380449){logger['info'](_0x9db7('0x1c'));return _0x380449;});}function getUser(_0x56a5df,_0x3ba1ec){if(intUtil[_0x9db7('0x1d')](_0x3ba1ec)){return request({'uri':util['format'](_0x9db7('0x1e'),_0x56a5df[_0x9db7('0x19')]),'qs':{'email':_0x3ba1ec}})['then'](function(_0x594168){if(_0x594168['length']){logger[_0x9db7('0x1f')](_0x9db7('0x20'));return _[_0x9db7('0x21')](_0x594168,function(_0x4e038f){return _0x4e038f[_0x9db7('0x22')]['email']===_0x3ba1ec;});}else{logger[_0x9db7('0x1f')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9db7('0xd')]('%s/api/v2/agents/me',_0x56a5df['remoteUri'])})[_0x9db7('0x1b')](function(_0x34d4ed){logger[_0x9db7('0x1f')](_0x9db7('0x23'));return _0x34d4ed;});}});}else{logger[_0x9db7('0x1f')](_0x9db7('0x24'));return request({'uri':util[_0x9db7('0xd')](_0x9db7('0x25'),_0x56a5df['remoteUri'])})[_0x9db7('0x1b')](function(_0x3015c2){logger[_0x9db7('0x1f')]('Admin\x20account\x20selected.');return _0x3015c2;});}}function getEndUser(_0xf19321,_0x59fde5,_0x82d693){logger['info'](_0x9db7('0x26'),_0x82d693);return request({'uri':util[_0x9db7('0xd')]('%s/api/v2/contacts',_0xf19321['remoteUri']),'qs':{'phone':_0x82d693}})['then'](function(_0x9242c4){if(_0x9242c4[_0x9db7('0x27')]){logger[_0x9db7('0x1f')](_0x9db7('0x28'));return _[_0x9db7('0x21')](_0x9242c4,{'phone':_0x82d693});}else{logger[_0x9db7('0x1f')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x9db7('0xd')]('%s/api/v2/contacts',_0xf19321['remoteUri']),'method':'POST','body':{'name':_0x59fde5,'phone':_0x82d693}})[_0x9db7('0x1b')](function(_0x12eba3){logger[_0x9db7('0x1f')](_0x9db7('0x29'));return _0x12eba3;});}});}function getAuth(_0x3d4600){return util[_0x9db7('0xd')]('Basic\x20%s',new Buffer(_0x3d4600[_0x9db7('0x2a')]+':X')[_0x9db7('0x2b')](_0x9db7('0x2c')));}function request(_0x2725a6){logger['debug']('[HTTP]',JSON['stringify'](_0x2725a6));return rp(_[_0x9db7('0x2d')](_0x2725a6,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x9c018e,_0x565998){var _0x45aa30=[];if(_0x9c018e&&_0x9c018e['length']>0x0){_0x45aa30=_[_0x9db7('0x2e')](_0x9c018e,_0x565998);}return _0x45aa30;}function getCustomFields(_0x3d7747,_0x5bfc6c){var _0x2e2f95=[];var _0x1b2116={'custom_fields':[]};if(_0x3d7747[_0x9db7('0x27')]>0x0){_[_0x9db7('0x2f')](_0x3d7747,function(_0x1f8782){if(_['includes']([_0x9db7('0x30'),'picklist'],_0x1f8782[_0x9db7('0x31')])&&_0x1f8782[_0x9db7('0x32')]&&!_0x1f8782[_0x9db7('0x33')]){_0x1b2116[_0x1f8782[_0x9db7('0x32')][_0x9db7('0x34')]()]=_0x1f8782['content']['toString']();}else if(_[_0x9db7('0x35')]([_0x9db7('0x30'),_0x9db7('0x36')],_0x1f8782[_0x9db7('0x31')])&&_0x1f8782['idField']&&_0x1f8782[_0x9db7('0x33')]){_0x1b2116['custom_fields']['push']({'id':_0x1f8782[_0x9db7('0x37')],'value':_0x1f8782[_0x9db7('0x38')]['toString']()});}else if(_0x1f8782[_0x9db7('0x31')]==='variable'&&_0x1f8782['variableName']&&_0x1f8782[_0x9db7('0x37')]&&_0x1f8782['customField']){_0x5bfc6c[_0x1f8782[_0x9db7('0x39')]]&&_0x1b2116[_0x9db7('0x15')][_0x9db7('0x3a')]({'id':_0x1f8782['idField'],'value':_0x5bfc6c[_0x1f8782[_0x9db7('0x39')]][_0x9db7('0x2b')]()});}else if(_0x1f8782['type']===_0x9db7('0x3b')&&_0x1f8782[_0x9db7('0x3c')]&&_0x1f8782[_0x9db7('0x3c')][_0x9db7('0x3d')]&&_0x1f8782[_0x9db7('0x37')]&&_0x1f8782['customField']){_0x5bfc6c[_0x1f8782['Variable'][_0x9db7('0x3d')]['toLowerCase']()]&&_0x1b2116[_0x9db7('0x15')][_0x9db7('0x3a')]({'id':_0x1f8782[_0x9db7('0x37')],'value':_0x5bfc6c[_0x1f8782[_0x9db7('0x3c')]['name'][_0x9db7('0x34')]()]['toString']()});}});}return _0x1b2116;}exports[_0x9db7('0x3e')]=function(_0x355bde,_0x29618c,_0xcc0056,_0x2322e6,_0x3611ac,_0x5be3c3){var _0x3cc120,_0x1e3c57;_0x5be3c3[_0x9db7('0x19')]=intUtil['stripTrailingSlash'](_0x5be3c3['remoteUri']);_0x5be3c3[_0x9db7('0x3f')]=intUtil[_0x9db7('0x40')](_0x5be3c3['serverUrl']);if(_0x3611ac&&_0x3611ac[_0x9db7('0x41')]){logger[_0x9db7('0x1f')](_0x9db7('0x42'),_0x9db7('0x43'));_0x29618c['recordingURL']=util['format'](_0x9db7('0x44'),_0x5be3c3[_0x9db7('0x3f')],_0x29618c[_0x9db7('0x45')],md5(_0x29618c[_0x9db7('0x45')]));}else{_0x29618c['recordingURL']='';}headers[_0x9db7('0x46')]=getAuth(_0x5be3c3);return getUser(_0x5be3c3,_0x2322e6[_0x9db7('0x47')])[_0x9db7('0x1b')](function(_0x4b2001){_0x3cc120=_0x4b2001;logger[_0x9db7('0x1f')](_0x9db7('0x48'),_0x3cc120['id']);return getEndUser(_0x5be3c3,_0x29618c[_0x9db7('0x49')],_0x29618c[_0x9db7('0xf')]);})[_0x9db7('0x1b')](function(_0x1194e7){_0x1e3c57=_0x1194e7;logger[_0x9db7('0x1f')]('The\x20Enduser\x20ID\x20is:',_0x1e3c57['id']);return getTicket(_0x5be3c3,_0x3cc120,_0x1e3c57,_0xcc0056,_0x29618c);})['then'](function(_0xd3d8b6){if(_0xd3d8b6&&_0xd3d8b6['id']){logger[_0x9db7('0x1f')]('Ticket\x20created!');logger[_0x9db7('0x1f')]('The\x20Ticket\x20ID\x20is:',_0xd3d8b6['id']);logger[_0x9db7('0x1f')]('[QUEUE]',_0x9db7('0x4a'));emit(util[_0x9db7('0xd')](_0x9db7('0x4b'),_0x2322e6[_0x9db7('0x3d')]),_0x9db7('0x4c'),{'uri':util[_0x9db7('0xd')]('%s/helpdesk/tickets/%d',_0x5be3c3[_0x9db7('0x19')],_0xd3d8b6['id'])});}})[_0x9db7('0x4d')](function(_0x1e6888){logger[_0x9db7('0x4e')]('[QUEUE]',JSON[_0x9db7('0x4f')](_0x1e6888));});};exports['outbound']=function(_0x4d12b8,_0x48e069,_0x237388,_0xc691e5,_0xd77032,_0x2e0b24,_0x4cfca7){var _0x471f41,_0x2ce604;_0x2e0b24['remoteUri']=intUtil['stripTrailingSlash'](_0x2e0b24[_0x9db7('0x19')]);_0x2e0b24[_0x9db7('0x3f')]=intUtil[_0x9db7('0x40')](_0x2e0b24[_0x9db7('0x3f')]);if(_0x4cfca7&&_0x4cfca7[_0x9db7('0x50')]&&_0x4cfca7[_0x9db7('0x50')]!==_0x9db7('0x51')){logger[_0x9db7('0x1f')]('[OUTBOUND]',_0x9db7('0x43'));_0x48e069['recordingURL']=util[_0x9db7('0xd')](_0x9db7('0x44'),_0x2e0b24[_0x9db7('0x3f')],_0x48e069[_0x9db7('0x45')],md5(_0x48e069[_0x9db7('0x45')]));}headers[_0x9db7('0x46')]=getAuth(_0x2e0b24);return getUser(_0x2e0b24,_0xc691e5[_0x9db7('0x47')])['then'](function(_0xc0f158){_0x471f41=_0xc0f158;logger[_0x9db7('0x1f')](_0x9db7('0x48'),_0x471f41['id']);return getEndUser(_0x2e0b24,_0x48e069[_0x9db7('0x52')],_0x48e069[_0x9db7('0x53')]);})[_0x9db7('0x1b')](function(_0xab5b1){_0x2ce604=_0xab5b1;logger[_0x9db7('0x1f')](_0x9db7('0x54'),_0x2ce604['id']);return getTicket(_0x2e0b24,_0x471f41,_0x2ce604,_0x237388,_0x48e069);})[_0x9db7('0x1b')](function(_0x2d042e){if(_0x2d042e&&_0x2d042e['id']){logger['info']('Ticket\x20created!');logger[_0x9db7('0x1f')](_0x9db7('0x55'),_0x2d042e['id']);logger[_0x9db7('0x1f')](_0x9db7('0x56'),_0x9db7('0x4a'));emit(util[_0x9db7('0xd')](_0x9db7('0x4b'),_0xc691e5[_0x9db7('0x3d')]),'trigger:browser:url',{'uri':util[_0x9db7('0xd')](_0x9db7('0x57'),_0x2e0b24['remoteUri'],_0x2d042e['id'])});}})['catch'](function(_0x3ec206){logger['error'](_0x9db7('0x56'),JSON[_0x9db7('0x4f')](_0x3ec206));});};exports[_0x9db7('0x58')]=function(_0x37231a,_0x1c013f,_0x58135b,_0x13ec48,_0x3cb1e9,_0x3c761a){var _0x44a9d6,_0x1e2975;_0x3c761a[_0x9db7('0x19')]=intUtil[_0x9db7('0x40')](_0x3c761a[_0x9db7('0x19')]);_0x3c761a[_0x9db7('0x3f')]=intUtil[_0x9db7('0x40')](_0x3c761a['serverUrl']);if(_0x3cb1e9&&_0x3cb1e9[_0x9db7('0x41')]){logger[_0x9db7('0x1f')]('['+_0x1c013f[_0x9db7('0x59')][_0x9db7('0x5a')]()+']','Recording\x20is\x20enabled!');_0x1c013f['recordingURL']=util['format'](_0x9db7('0x44'),_0x3c761a[_0x9db7('0x3f')],_0x1c013f['uniqueid'],md5(_0x1c013f[_0x9db7('0x45')]));}else{_0x1c013f[_0x9db7('0x5b')]='';}headers[_0x9db7('0x46')]=getAuth(_0x3c761a);return getUser(_0x3c761a,'')[_0x9db7('0x1b')](function(_0xc69520){_0x44a9d6=_0xc69520;logger[_0x9db7('0x1f')]('The\x20User\x20ID\x20is:',_0x44a9d6['id']);return getEndUser(_0x3c761a,_0x1c013f['calleridname'],_0x1c013f['calleridnum']);})[_0x9db7('0x1b')](function(_0x3499c2){_0x1e2975=_0x3499c2;logger[_0x9db7('0x1f')](_0x9db7('0x54'),_0x1e2975['id']);return getTicket(_0x3c761a,_0x44a9d6,_0x1e2975,_0x58135b,_0x1c013f);})[_0x9db7('0x1b')](function(_0x204eac){if(_0x204eac){logger['info'](_0x9db7('0x1c'));logger[_0x9db7('0x1f')](_0x9db7('0x55'),_0x204eac['id']);}})[_0x9db7('0x4d')](function(_0x3a0d95){logger[_0x9db7('0x4e')]('['+_0x1c013f['lastevent']['toUpperCase']()+']',JSON[_0x9db7('0x4f')](_0x3a0d95));});}; \ 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 ec58196..e8fdf82 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 _0x2aad=['recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','moment','bluebird','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','users','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','headers','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','adminEmail','toUpperCase','&entities=contact','then','find','contacts','format','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0xb9b6a6,_0x3691a2){var _0x296039=function(_0x65d2a0){while(--_0x65d2a0){_0xb9b6a6['push'](_0xb9b6a6['shift']());}};_0x296039(++_0x3691a2);}(_0x2aad,0xf8));var _0xd2aa=function(_0x23ca8f,_0x5ace8a){_0x23ca8f=_0x23ca8f-0x0;var _0x51a619=_0x2aad[_0x23ca8f];return _0x51a619;};'use strict';var _=require(_0xd2aa('0x0'));var rp=require(_0xd2aa('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0xd2aa('0x2'));var Promise=require(_0xd2aa('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd2aa('0x4'))(_0xd2aa('0x5'));config[_0xd2aa('0x6')]=_[_0xd2aa('0x7')](config[_0xd2aa('0x6')],{'host':_0xd2aa('0x8'),'port':0x18eb});var io=require(_0xd2aa('0x9'))(new Redis(config['redis']));function getAdminId(_0x409d41,_0x113a2e,_0x365e04,_0x1b902c){return new Promise(function(_0x16bdb6,_0x39b9b9){var _0x2c5782=![];var _0x1a76ad={'method':_0xd2aa('0xa'),'uri':_0x1b902c+_0xd2aa('0xb'),'json':!![]};_0x1a76ad['headers']=_0x365e04;logger[_0xd2aa('0xc')](_0xd2aa('0xd'));return rp(_0x1a76ad)['then'](function(_0x358d4a){if(_0x358d4a){var _0x29e390=_0x358d4a[_0xd2aa('0xe')];var _0x166445=null;for(_0x166445=0x0;_0x166445<_0x29e390['length'];_0x166445++){if(_0x29e390[_0x166445][_0xd2aa('0xf')]===_0x409d41['adminEmail']){_0x409d41[_0xd2aa('0x10')]=_0x29e390[_0x166445]['id'];_0x2c5782=!![];}}if(_0x2c5782){logger[_0xd2aa('0xc')]('Admin\x20found:',_0x409d41[_0xd2aa('0x10')]);_0x16bdb6(_0x409d41);}else{_0x39b9b9({'statusCode':0x194,'message':_0xd2aa('0x11')});}}else{_0x39b9b9({'statusCode':0x194,'message':_0xd2aa('0x11')});}})[_0xd2aa('0x12')](function(_0x44df2b){logger[_0xd2aa('0x13')]('['+[_0x113a2e['toUpperCase']()]+']',_0x44df2b[_0xd2aa('0x14')]);_0x39b9b9(_0x44df2b);});});}function getUser(_0x4cc4e1,_0x48743c,_0x4f1fca){return function(_0x7935d7){return new Promise(function(_0xfb8dfa,_0xdfa608){var _0x440df3={'method':_0xd2aa('0xa'),'uri':_0x4f1fca+_0xd2aa('0xb'),'json':!![]};_0x440df3[_0xd2aa('0x15')]=_0x48743c;logger[_0xd2aa('0xc')]('Getting\x20user\x20list');return rp(_0x440df3)['then'](function(_0x17c63b){if(_0x17c63b){var _0x4248fb=_0x17c63b[_0xd2aa('0xe')];var _0x1aff5a=![];var _0x497856=null;if(_0x7935d7[_0xd2aa('0x16')]!==null){logger[_0xd2aa('0xc')](_0xd2aa('0x17'),_0x7935d7[_0xd2aa('0x16')]);_0x7935d7[_0xd2aa('0x18')]=_0x7935d7[_0xd2aa('0x16')];for(_0x497856=0x0;_0x497856<_0x4248fb[_0xd2aa('0x19')];_0x497856++){if(_0x4248fb[_0x497856][_0xd2aa('0xf')]===_0x7935d7['agentEmail']){_0x1aff5a=!![];_0x7935d7[_0xd2aa('0x1a')]=_0x4248fb[_0x497856]['id'];logger[_0xd2aa('0xc')](_0xd2aa('0x1b'),_0x7935d7[_0xd2aa('0x1a')]);}}}if(!_0x1aff5a){logger['info'](_0xd2aa('0x1c'));_0x7935d7['userEmail']=_0x7935d7[_0xd2aa('0x1d')];_0x7935d7[_0xd2aa('0x1a')]=_0x7935d7[_0xd2aa('0x10')];_0x1aff5a=!![];}if(_0x1aff5a){_0xfb8dfa(_0x7935d7);}else{_0xdfa608({'statusCode':0x194,'message':_0xd2aa('0x11')});}}else{_0xdfa608({'statusCode':0x194,'message':_0xd2aa('0x11')});}})[_0xd2aa('0x12')](function(_0x5cae03){logger[_0xd2aa('0x13')]('['+[_0x4cc4e1[_0xd2aa('0x1e')]()]+']',_0x5cae03[_0xd2aa('0x14')]);_0xdfa608(_0x5cae03);});});};}function searchContact(_0x68a8aa,_0x4a6abe,_0x27a17e,_0x34f2eb){return new Promise(function(_0x573dff,_0x57442a){var _0x41ecdc={'method':'GET','headers':_0x4a6abe,'uri':_0x68a8aa+'/api/lookup?q='+_0x34f2eb+'&f='+_0x27a17e+_0xd2aa('0x1f'),'json':!![]};rp(_0x41ecdc)[_0xd2aa('0x20')](function(_0x1e4ccc){var _0x3271b5=_[_0xd2aa('0x21')](_0x1e4ccc[_0xd2aa('0x22')]['contacts'],[_0x27a17e,_0x34f2eb]);_0x573dff(_0x3271b5);})[_0xd2aa('0x12')](function(_0x5ca340){_0x57442a(_0x5ca340);});});}function getEndUser(_0x3fe4a2,_0x3a244d,_0x2e4ac3){return function(_0x41f7c8){return new Promise(function(_0x55fb1d,_0x5c1e4c){logger['info'](util[_0xd2aa('0x23')]('Searching\x20contact\x20with\x20phone\x20%s',_0x41f7c8[_0xd2aa('0x24')]));searchContact(_0x2e4ac3,_0x3a244d,'mobile_number',_0x41f7c8['contactNumber'])[_0xd2aa('0x20')](function(_0x19594f){if(_0x19594f){_0x41f7c8[_0xd2aa('0x25')]=_0x19594f['id'];logger[_0xd2aa('0xc')](_0xd2aa('0x26'),_0x41f7c8[_0xd2aa('0x25')]);return _0x55fb1d(_0x41f7c8);}searchContact(_0x2e4ac3,_0x3a244d,_0xd2aa('0x27'),_0x41f7c8['contactNumber'])['then'](function(_0x17efd7){if(_0x17efd7){_0x41f7c8[_0xd2aa('0x25')]=_0x17efd7['id'];logger[_0xd2aa('0xc')](_0xd2aa('0x28'),_0x41f7c8['endUserId']);return _0x55fb1d(_0x41f7c8);}createEndUser(_0x41f7c8,_0x3fe4a2,_0x3a244d,_0x2e4ac3)[_0xd2aa('0x20')](function(_0x1cb827){logger[_0xd2aa('0xc')](_0xd2aa('0x29'),_0x1cb827[_0xd2aa('0x25')]);return _0x55fb1d(_0x1cb827);});});})[_0xd2aa('0x12')](function(_0x5095e0){_0x5c1e4c(_0x5095e0);});});};}function createEndUser(_0x27448d,_0x499a25,_0x29c9a9,_0x540d9c){return new Promise(function(_0x173267,_0x5a10bb){var _0x29f632=moment();var _0x34d3e9={'method':_0xd2aa('0x2a'),'uri':_0x540d9c+_0xd2aa('0x2b'),'body':{'contact':{'last_name':_0x27448d[_0xd2aa('0x24')],'work_number':_0x27448d[_0xd2aa('0x24')],'mobile_number':_0x27448d[_0xd2aa('0x24')],'owner_id':_0x27448d[_0xd2aa('0x1a')],'created_at':_0x29f632[_0xd2aa('0x23')](_0xd2aa('0x2c'))}},'json':!![]};_0x34d3e9['headers']=_0x29c9a9;logger[_0xd2aa('0xc')](_0xd2aa('0x2d'));return rp(_0x34d3e9)[_0xd2aa('0x20')](function(_0xbfb5d3){_0x27448d['endUserId']=_0xbfb5d3[_0xd2aa('0x2e')]['id'];_0x173267(_0x27448d);})[_0xd2aa('0x12')](function(_0x30bc89){logger[_0xd2aa('0x13')]('['+[_0x499a25['toUpperCase']()]+']',_0x30bc89[_0xd2aa('0x14')]);_0x5a10bb(_0x30bc89[_0xd2aa('0x14')]);});});}function getTicket(_0x4cff3a,_0x438f16,_0x588b38,_0x2446ab,_0x342d23){return function(_0x16e653){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x4822f2,_0xe3b323){var _0x22ad1d=moment();var _0x451742={'method':_0xd2aa('0x2a'),'uri':_0x588b38+_0xd2aa('0x2f'),'body':{'title':intUtil[_0xd2aa('0x30')](_0x2446ab[_0xd2aa('0x31')],_0x342d23,'\x20'),'description':intUtil[_0xd2aa('0x30')](_0x2446ab[_0xd2aa('0x32')],_0x342d23,'\x0a'),'owner_id':_0x16e653['userId'],'creater_id':_0x16e653[_0xd2aa('0x10')],'targetable_id':_0x16e653[_0xd2aa('0x25')],'targetable_type':_0xd2aa('0x33'),'created_at':_0x22ad1d[_0xd2aa('0x23')](_0xd2aa('0x2c')),'due_date':_0x22ad1d[_0xd2aa('0x34')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x451742['headers']=_0x438f16;return rp(_0x451742)[_0xd2aa('0x20')](function(_0x331a1d){_0x16e653[_0xd2aa('0x35')]=_0x331a1d[_0xd2aa('0x36')]['id'];logger['info'](_0xd2aa('0x37'),_0x16e653[_0xd2aa('0x35')]);_0x4822f2(_0x16e653);})['catch'](function(_0x20e04a){logger[_0xd2aa('0x13')]('['+[_0x4cff3a[_0xd2aa('0x1e')]()]+']',_0x20e04a[_0xd2aa('0x14')]);_0xe3b323(_0x20e04a[_0xd2aa('0x14')]);});});};}function emit(_0x5112ed,_0x44a677,_0x29e793){var _0x3a28a2={'uri':_0x5112ed+_0xd2aa('0x38')+_0x29e793};io['to'](util[_0xd2aa('0x23')]('user:%s',_0x44a677))[_0xd2aa('0x39')](_0xd2aa('0x3a'),_0x3a28a2);}exports['cs']=function(_0x874de6,_0x501233,_0x324c00,_0x2527a2,_0x541876,_0x30de20,_0x3d1411,_0x1b9000){var _0x53651c={};var _0x2feaf5={'Authorization':_0xd2aa('0x3b')+_0x30de20[_0xd2aa('0x3c')]};_0x30de20[_0xd2aa('0x3d')]=intUtil[_0xd2aa('0x3e')](_0x30de20[_0xd2aa('0x3d')]);_0x30de20[_0xd2aa('0x3f')]=intUtil[_0xd2aa('0x3e')](_0x30de20['serverUrl']);var _0x35c0ae=_0x30de20[_0xd2aa('0x3d')];_0x53651c[_0xd2aa('0x1d')]=_0x30de20[_0xd2aa('0x40')];_0x53651c[_0xd2aa('0x24')]=_0x1b9000['toLowerCase']()===_0xd2aa('0x41')?_0x501233[_0xd2aa('0x42')]:_0x501233[_0xd2aa('0x43')];_0x53651c[_0xd2aa('0x44')]=_0x1b9000==='queue'||_0x1b9000===_0xd2aa('0x45')?_0xd2aa('0x46'):'outbound';if(_0x2527a2){_0x53651c['agentEmail']=_0x2527a2[_0xd2aa('0xf')];}var _0x332abf=util[_0xd2aa('0x23')](_0xd2aa('0x47'),_0x30de20[_0xd2aa('0x3f')],_0x501233[_0xd2aa('0x48')],md5(_0x501233[_0xd2aa('0x48')]));if(_0x541876&&_0x541876['monitor_format']){logger[_0xd2aa('0xc')](_0xd2aa('0x49'),_0xd2aa('0x4a'));_0x501233[_0xd2aa('0x4b')]=_0x332abf;}else if(_0x3d1411&&_0x3d1411['recordingFormat']&&_0x3d1411[_0xd2aa('0x4c')]!=='none'){logger['info'](_0xd2aa('0x4d'),_0xd2aa('0x4a'));_0x501233[_0xd2aa('0x4b')]=_0x332abf;}else{_0x501233[_0xd2aa('0x4b')]='';}return getAdminId(_0x53651c,_0x1b9000,_0x2feaf5,_0x35c0ae)[_0xd2aa('0x20')](getUser(_0x1b9000,_0x2feaf5,_0x35c0ae))[_0xd2aa('0x20')](getEndUser(_0x1b9000,_0x2feaf5,_0x35c0ae))[_0xd2aa('0x20')](getTicket(_0x1b9000,_0x2feaf5,_0x35c0ae,_0x324c00,_0x501233))['then'](function(_0x1043d7){logger[_0xd2aa('0xc')](util[_0xd2aa('0x23')](_0xd2aa('0x4e'),_0x1043d7[_0xd2aa('0x35')]));if(_0x1b9000!==_0xd2aa('0x45')){logger[_0xd2aa('0xc')]('['+[_0x1b9000['toUpperCase']()]+']',_0xd2aa('0x4f'));emit(_0x35c0ae,_0x2527a2['name'],_0x1043d7['endUserId']);}})[_0xd2aa('0x12')](function(_0x1a0583){logger['error']('['+[_0x1b9000['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xd2aa('0x50')](_0x1a0583,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x65df=['message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','Admin\x20selected','catch','/api/lookup?q=','&entities=contact','find','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65df,0x96));var _0xf65d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x65df[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xf65d('0x0'));var rp=require(_0xf65d('0x1'));var md5=require('md5');var util=require(_0xf65d('0x2'));var moment=require(_0xf65d('0x3'));var Promise=require(_0xf65d('0x4'));var Redis=require(_0xf65d('0x5'));var intUtil=require(_0xf65d('0x6'));var config=require(_0xf65d('0x7'));var logger=require('../../../../config/logger')(_0xf65d('0x8'));config[_0xf65d('0x9')]=_[_0xf65d('0xa')](config[_0xf65d('0x9')],{'host':_0xf65d('0xb'),'port':0x18eb});var io=require(_0xf65d('0xc'))(new Redis(config[_0xf65d('0x9')]));function getAdminId(_0x3df1ef,_0xd92745,_0x3a2271,_0x29e7d2){return new Promise(function(_0x4beceb,_0x67213f){var _0x250749=![];var _0x25947e={'method':_0xf65d('0xd'),'uri':_0x29e7d2+'/api/selector/owners','json':!![]};_0x25947e[_0xf65d('0xe')]=_0x3a2271;logger[_0xf65d('0xf')](_0xf65d('0x10'));return rp(_0x25947e)[_0xf65d('0x11')](function(_0x3c4e7b){if(_0x3c4e7b){var _0xc7d305=_0x3c4e7b[_0xf65d('0x12')];var _0x183be7=null;for(_0x183be7=0x0;_0x183be7<_0xc7d305['length'];_0x183be7++){if(_0xc7d305[_0x183be7][_0xf65d('0x13')]===_0x3df1ef[_0xf65d('0x14')]){_0x3df1ef[_0xf65d('0x15')]=_0xc7d305[_0x183be7]['id'];_0x250749=!![];}}if(_0x250749){logger[_0xf65d('0xf')](_0xf65d('0x16'),_0x3df1ef[_0xf65d('0x15')]);_0x4beceb(_0x3df1ef);}else{_0x67213f({'statusCode':0x194,'message':_0xf65d('0x17')});}}else{_0x67213f({'statusCode':0x194,'message':_0xf65d('0x17')});}})['catch'](function(_0x185752){logger[_0xf65d('0x18')]('['+[_0xd92745[_0xf65d('0x19')]()]+']',_0x185752[_0xf65d('0x1a')]);_0x67213f(_0x185752);});});}function getUser(_0x108d1d,_0x368eca,_0x202168){return function(_0x44ee17){return new Promise(function(_0x1a1e2,_0x53ab4b){var _0x2d09bb={'method':'GET','uri':_0x202168+_0xf65d('0x1b'),'json':!![]};_0x2d09bb[_0xf65d('0xe')]=_0x368eca;logger[_0xf65d('0xf')](_0xf65d('0x1c'));return rp(_0x2d09bb)['then'](function(_0x1f3417){if(_0x1f3417){var _0x2ab1a9=_0x1f3417[_0xf65d('0x12')];var _0x51ea99=![];var _0x31bf3e=null;if(_0x44ee17[_0xf65d('0x1d')]!==null){logger[_0xf65d('0xf')](_0xf65d('0x1e'),_0x44ee17[_0xf65d('0x1d')]);_0x44ee17['userEmail']=_0x44ee17[_0xf65d('0x1d')];for(_0x31bf3e=0x0;_0x31bf3e<_0x2ab1a9[_0xf65d('0x1f')];_0x31bf3e++){if(_0x2ab1a9[_0x31bf3e]['email']===_0x44ee17[_0xf65d('0x1d')]){_0x51ea99=!![];_0x44ee17[_0xf65d('0x20')]=_0x2ab1a9[_0x31bf3e]['id'];logger[_0xf65d('0xf')](_0xf65d('0x21'),_0x44ee17[_0xf65d('0x20')]);}}}if(!_0x51ea99){logger[_0xf65d('0xf')](_0xf65d('0x22'));_0x44ee17['userEmail']=_0x44ee17[_0xf65d('0x14')];_0x44ee17['userId']=_0x44ee17[_0xf65d('0x15')];_0x51ea99=!![];}if(_0x51ea99){_0x1a1e2(_0x44ee17);}else{_0x53ab4b({'statusCode':0x194,'message':_0xf65d('0x17')});}}else{_0x53ab4b({'statusCode':0x194,'message':_0xf65d('0x17')});}})[_0xf65d('0x23')](function(_0x6e8095){logger[_0xf65d('0x18')]('['+[_0x108d1d['toUpperCase']()]+']',_0x6e8095[_0xf65d('0x1a')]);_0x53ab4b(_0x6e8095);});});};}function searchContact(_0x307deb,_0x144d47,_0x1008a3,_0x90918d){return new Promise(function(_0x431e81,_0xd1a368){var _0x49396f={'method':_0xf65d('0xd'),'headers':_0x144d47,'uri':_0x307deb+_0xf65d('0x24')+_0x90918d+'&f='+_0x1008a3+_0xf65d('0x25'),'json':!![]};rp(_0x49396f)[_0xf65d('0x11')](function(_0x597fc3){var _0x5b4503=_[_0xf65d('0x26')](_0x597fc3['contacts']['contacts'],[_0x1008a3,_0x90918d]);_0x431e81(_0x5b4503);})['catch'](function(_0x518050){_0xd1a368(_0x518050);});});}function getEndUser(_0x35c5d3,_0x3fe226,_0x49c1e7){return function(_0x42be7a){return new Promise(function(_0x34438a,_0x451d29){logger['info'](util[_0xf65d('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x42be7a[_0xf65d('0x28')]));searchContact(_0x49c1e7,_0x3fe226,_0xf65d('0x29'),_0x42be7a[_0xf65d('0x28')])['then'](function(_0x54e64b){if(_0x54e64b){_0x42be7a[_0xf65d('0x2a')]=_0x54e64b['id'];logger['info'](_0xf65d('0x2b'),_0x42be7a[_0xf65d('0x2a')]);return _0x34438a(_0x42be7a);}searchContact(_0x49c1e7,_0x3fe226,'work_number',_0x42be7a['contactNumber'])[_0xf65d('0x11')](function(_0x548dc2){if(_0x548dc2){_0x42be7a[_0xf65d('0x2a')]=_0x548dc2['id'];logger[_0xf65d('0xf')](_0xf65d('0x2c'),_0x42be7a['endUserId']);return _0x34438a(_0x42be7a);}createEndUser(_0x42be7a,_0x35c5d3,_0x3fe226,_0x49c1e7)['then'](function(_0x5e83c4){logger[_0xf65d('0xf')](_0xf65d('0x2d'),_0x5e83c4['endUserId']);return _0x34438a(_0x5e83c4);});});})[_0xf65d('0x23')](function(_0x360f32){_0x451d29(_0x360f32);});});};}function createEndUser(_0x52fa84,_0x1f85ee,_0x1ed1c0,_0x16aadc){return new Promise(function(_0x380ec3,_0x403b9b){var _0x448cde=moment();var _0x223fe1={'method':_0xf65d('0x2e'),'uri':_0x16aadc+_0xf65d('0x2f'),'body':{'contact':{'last_name':_0x52fa84[_0xf65d('0x28')],'work_number':_0x52fa84[_0xf65d('0x28')],'mobile_number':_0x52fa84[_0xf65d('0x28')],'owner_id':_0x52fa84[_0xf65d('0x20')],'created_at':_0x448cde[_0xf65d('0x27')](_0xf65d('0x30'))}},'json':!![]};_0x223fe1['headers']=_0x1ed1c0;logger[_0xf65d('0xf')](_0xf65d('0x31'));return rp(_0x223fe1)[_0xf65d('0x11')](function(_0x46c0e0){_0x52fa84[_0xf65d('0x2a')]=_0x46c0e0['contact']['id'];_0x380ec3(_0x52fa84);})[_0xf65d('0x23')](function(_0x2c31e8){logger['error']('['+[_0x1f85ee[_0xf65d('0x19')]()]+']',_0x2c31e8[_0xf65d('0x1a')]);_0x403b9b(_0x2c31e8['message']);});});}function getTicket(_0x461ead,_0x551a26,_0x555924,_0x4f36f9,_0x4811e6){return function(_0x22ae59){logger[_0xf65d('0xf')](_0xf65d('0x32'));return new Promise(function(_0x570789,_0x35481c){var _0x961ddb=moment();var _0x418421={'method':_0xf65d('0x2e'),'uri':_0x555924+_0xf65d('0x33'),'body':{'title':intUtil[_0xf65d('0x34')](_0x4f36f9[_0xf65d('0x35')],_0x4811e6,'\x20'),'description':intUtil[_0xf65d('0x34')](_0x4f36f9[_0xf65d('0x36')],_0x4811e6,'\x0a'),'owner_id':_0x22ae59[_0xf65d('0x20')],'creater_id':_0x22ae59[_0xf65d('0x15')],'targetable_id':_0x22ae59[_0xf65d('0x2a')],'targetable_type':_0xf65d('0x37'),'created_at':_0x961ddb[_0xf65d('0x27')](_0xf65d('0x30')),'due_date':_0x961ddb['add'](0x1e,'m')[_0xf65d('0x27')](_0xf65d('0x30'))},'json':!![]};_0x418421[_0xf65d('0xe')]=_0x551a26;return rp(_0x418421)['then'](function(_0x28e386){_0x22ae59[_0xf65d('0x38')]=_0x28e386[_0xf65d('0x39')]['id'];logger[_0xf65d('0xf')](_0xf65d('0x3a'),_0x22ae59[_0xf65d('0x38')]);_0x570789(_0x22ae59);})['catch'](function(_0x4a622b){logger[_0xf65d('0x18')]('['+[_0x461ead[_0xf65d('0x19')]()]+']',_0x4a622b[_0xf65d('0x1a')]);_0x35481c(_0x4a622b[_0xf65d('0x1a')]);});});};}function emit(_0x259884,_0x51cfe3,_0x365c11){var _0x4d45af={'uri':_0x259884+_0xf65d('0x3b')+_0x365c11};io['to'](util[_0xf65d('0x27')](_0xf65d('0x3c'),_0x51cfe3))['emit'](_0xf65d('0x3d'),_0x4d45af);}exports['cs']=function(_0x2a2390,_0x1803c4,_0x42a081,_0x419163,_0x314679,_0x43dd97,_0x2daa32,_0x50f0cd){var _0x36a86f={};var _0x2618f0={'Authorization':'Token\x20token='+_0x43dd97[_0xf65d('0x3e')]};_0x43dd97[_0xf65d('0x3f')]=intUtil[_0xf65d('0x40')](_0x43dd97['remoteUri']);_0x43dd97[_0xf65d('0x41')]=intUtil[_0xf65d('0x40')](_0x43dd97['serverUrl']);var _0x20311a=_0x43dd97[_0xf65d('0x3f')];_0x36a86f[_0xf65d('0x14')]=_0x43dd97[_0xf65d('0x42')];_0x36a86f[_0xf65d('0x28')]=_0x50f0cd[_0xf65d('0x43')]()==='outbound'?_0x1803c4[_0xf65d('0x44')]:_0x1803c4[_0xf65d('0x45')];_0x36a86f[_0xf65d('0x46')]=_0x50f0cd===_0xf65d('0x47')||_0x50f0cd==='unmanaged'?_0xf65d('0x47'):_0xf65d('0x48');if(_0x419163){_0x36a86f[_0xf65d('0x1d')]=_0x419163[_0xf65d('0x13')];}var _0x3516d8=util[_0xf65d('0x27')](_0xf65d('0x49'),_0x43dd97['serverUrl'],_0x1803c4[_0xf65d('0x4a')],md5(_0x1803c4[_0xf65d('0x4a')]));if(_0x314679&&_0x314679[_0xf65d('0x4b')]){logger[_0xf65d('0xf')](_0xf65d('0x4c'),_0xf65d('0x4d'));_0x1803c4[_0xf65d('0x4e')]=_0x3516d8;}else if(_0x2daa32&&_0x2daa32[_0xf65d('0x4f')]&&_0x2daa32[_0xf65d('0x4f')]!==_0xf65d('0x50')){logger[_0xf65d('0xf')](_0xf65d('0x51'),'Recording\x20is\x20enabled!');_0x1803c4[_0xf65d('0x4e')]=_0x3516d8;}else{_0x1803c4[_0xf65d('0x4e')]='';}return getAdminId(_0x36a86f,_0x50f0cd,_0x2618f0,_0x20311a)[_0xf65d('0x11')](getUser(_0x50f0cd,_0x2618f0,_0x20311a))[_0xf65d('0x11')](getEndUser(_0x50f0cd,_0x2618f0,_0x20311a))['then'](getTicket(_0x50f0cd,_0x2618f0,_0x20311a,_0x42a081,_0x1803c4))[_0xf65d('0x11')](function(_0x1181a8){logger[_0xf65d('0xf')](util[_0xf65d('0x27')](_0xf65d('0x52'),_0x1181a8[_0xf65d('0x38')]));if(_0x50f0cd!==_0xf65d('0x53')){logger[_0xf65d('0xf')]('['+[_0x50f0cd[_0xf65d('0x19')]()]+']',_0xf65d('0x54'));emit(_0x20311a,_0x419163[_0xf65d('0x55')],_0x1181a8[_0xf65d('0x2a')]);}})['catch'](function(_0x59757c){logger[_0xf65d('0x18')]('['+[_0x50f0cd[_0xf65d('0x19')]()]+_0xf65d('0x56'),util[_0xf65d('0x57')](_0x59757c,{'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 79e06a6..c9fdfd7 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 _0xc599=['toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','[EXEC]','format','./zendesk','./sugarcrm','./freshdesk','./zoho','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','exec','includes','data1'];(function(_0x522af4,_0x8d8c19){var _0x12138f=function(_0x18c808){while(--_0x18c808){_0x522af4['push'](_0x522af4['shift']());}};_0x12138f(++_0x8d8c19);}(_0xc599,0x15a));var _0x9c59=function(_0x166241,_0x227ee2){_0x166241=_0x166241-0x0;var _0x51fd00=_0xc599[_0x166241];return _0x51fd00;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x9c59('0x0'));var salesforce=require('./salesforce');var sugarcrm=require(_0x9c59('0x1'));var freshdesk=require(_0x9c59('0x2'));var zoho=require(_0x9c59('0x3'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x9c59('0x4'));var dynamics365=require(_0x9c59('0x5'));var freshsales=require(_0x9c59('0x6'));var integrations=[_0x9c59('0x7'),_0x9c59('0x8'),_0x9c59('0x9'),_0x9c59('0xa'),_0x9c59('0xb'),_0x9c59('0xc'),_0x9c59('0xd'),'dynamics365','freshsales','servicenow'];exports[_0x9c59('0xe')]=function(_0x58820a,_0x36139e,_0x1e7a91,_0x3f2aa2,_0xcfd9a7,_0x20d5cc){if(_0x1e7a91){if(_[_0x9c59('0xf')](integrations,_0x58820a[_0x9c59('0x10')]['toLowerCase']())){try{var _0x528196=null;var _0x3275e6='';var _0xd7fce3=_0x1e7a91[_0x58820a[_0x9c59('0x10')][_0x9c59('0x11')]()];if(_0xd7fce3){var _0x351db0=_0xd7fce3[_0x58820a[_0x9c59('0x12')]];if(_0x351db0){var _0x84b9b9=_[_0x9c59('0x13')](_0x351db0[_0x9c59('0x14')],{'id':parseInt(_0x58820a[_0x9c59('0x15')],0xa)});if(_0x84b9b9){if(_0x3f2aa2){if(_0xcfd9a7&&_0x36139e[_0x9c59('0x16')]){_0x3275e6=_0x9c59('0x16');}else if(_0x36139e['routeId']){_0x3275e6=_0x9c59('0x17');}else{console[_0x9c59('0x18')](_0x9c59('0x19'),_0x36139e);}}else{_0x3275e6=_0x9c59('0x1a');}switch(_0x58820a[_0x9c59('0x10')][_0x9c59('0x11')]()){case _0x9c59('0x7'):zendesk[_0x3275e6](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc);break;case _0x9c59('0x8'):salesforce[_0x3275e6](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc);break;case _0x9c59('0x9'):sugarcrm[_0x3275e6](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc);break;case _0x9c59('0xa'):freshdesk[_0x3275e6](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc);break;case _0x9c59('0xb'):zoho[_0x3275e6](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc);break;case _0x9c59('0xc'):desk[_0x3275e6](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc);break;case _0x9c59('0xd'):vtiger[_0x3275e6](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc);break;case'freshsales':freshsales['cs'](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc,_0x3275e6);break;case _0x9c59('0x1b'):servicenow['cs'](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc,_0x3275e6);break;case _0x9c59('0x1c'):dynamics365['cs'](_0x58820a,_0x36139e,_0x84b9b9,_0x3f2aa2,_0xcfd9a7,_0x351db0,_0x20d5cc,_0x3275e6);break;default:console[_0x9c59('0x18')](_0x9c59('0x1d'));}}else{_0x528196=require(_0x9c59('0x1e'))(_0x58820a['data1'][_0x9c59('0x11')]());_0x528196['error'](_0x9c59('0x1f'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x58820a[_0x9c59('0x10')]['toLowerCase'](),_0x58820a[_0x9c59('0x15')]));}}else{_0x528196=require(_0x9c59('0x1e'))(_0x58820a[_0x9c59('0x10')][_0x9c59('0x11')]());_0x528196['error'](_0x9c59('0x1f'),util[_0x9c59('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x58820a[_0x9c59('0x10')][_0x9c59('0x11')](),_0x58820a['data2']));}}else{}}catch(_0x3feb36){console['error'](_0x3feb36);}}}}; \ No newline at end of file +var _0x1345=['./freshsales','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','zendesk','salesforce','servicenow','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x1345,0x10f));var _0x5134=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0x1345[_0x404cde];return _0x139882;};'use strict';var _=require(_0x5134('0x0'));var util=require(_0x5134('0x1'));var zendesk=require(_0x5134('0x2'));var salesforce=require(_0x5134('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x5134('0x4'));var desk=require(_0x5134('0x5'));var vtiger=require(_0x5134('0x6'));var servicenow=require(_0x5134('0x7'));var dynamics365=require(_0x5134('0x8'));var freshsales=require(_0x5134('0x9'));var integrations=['zendesk','salesforce',_0x5134('0xa'),_0x5134('0xb'),_0x5134('0xc'),_0x5134('0xd'),'vtiger',_0x5134('0xe'),_0x5134('0xf'),'servicenow'];exports['exec']=function(_0x58be00,_0x15e37e,_0x8baefd,_0x5ea743,_0x1d7f0e,_0x69e16d){if(_0x8baefd){if(_['includes'](integrations,_0x58be00[_0x5134('0x10')]['toLowerCase']())){try{var _0x10ef0a=null;var _0x3fa77e='';var _0x2639a7=_0x8baefd[_0x58be00['data1'][_0x5134('0x11')]()];if(_0x2639a7){var _0x3b09c2=_0x2639a7[_0x58be00[_0x5134('0x12')]];if(_0x3b09c2){var _0x38ac35=_[_0x5134('0x13')](_0x3b09c2[_0x5134('0x14')],{'id':parseInt(_0x58be00[_0x5134('0x15')],0xa)});if(_0x38ac35){if(_0x5ea743){if(_0x1d7f0e&&_0x15e37e[_0x5134('0x16')]){_0x3fa77e=_0x5134('0x16');}else if(_0x15e37e[_0x5134('0x17')]){_0x3fa77e='outbound';}else{console['log']('EVENT\x20UNKNOWN',_0x15e37e);}}else{_0x3fa77e='unmanaged';}switch(_0x58be00[_0x5134('0x10')][_0x5134('0x11')]()){case _0x5134('0x18'):zendesk[_0x3fa77e](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d);break;case _0x5134('0x19'):salesforce[_0x3fa77e](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d);break;case _0x5134('0xa'):sugarcrm[_0x3fa77e](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d);break;case _0x5134('0xb'):freshdesk[_0x3fa77e](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d);break;case _0x5134('0xc'):zoho[_0x3fa77e](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d);break;case _0x5134('0xd'):desk[_0x3fa77e](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d);break;case'vtiger':vtiger[_0x3fa77e](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d);break;case _0x5134('0xf'):freshsales['cs'](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d,_0x3fa77e);break;case _0x5134('0x1a'):servicenow['cs'](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d,_0x3fa77e);break;case'dynamics365':dynamics365['cs'](_0x58be00,_0x15e37e,_0x38ac35,_0x5ea743,_0x1d7f0e,_0x3b09c2,_0x69e16d,_0x3fa77e);break;default:console[_0x5134('0x1b')](_0x5134('0x1c'));}}else{_0x10ef0a=require(_0x5134('0x1d'))(_0x58be00[_0x5134('0x10')][_0x5134('0x11')]());_0x10ef0a[_0x5134('0x1e')](_0x5134('0x1f'),util[_0x5134('0x20')](_0x5134('0x21'),_0x58be00[_0x5134('0x10')][_0x5134('0x11')](),_0x58be00['data3']));}}else{_0x10ef0a=require(_0x5134('0x1d'))(_0x58be00['data1']['toLowerCase']());_0x10ef0a['error'](_0x5134('0x1f'),util[_0x5134('0x20')](_0x5134('0x22'),_0x58be00['data1'][_0x5134('0x11')](),_0x58be00[_0x5134('0x12')]));}}else{}}catch(_0x22f5f2){console[_0x5134('0x1e')](_0x22f5f2);}}}}; \ 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 b951c1e..6d80537 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 _0xe07d=['content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','WhoId','account','WhatId','Case','contact','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','sobject','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','LastName','format','Caller\x20-\x20%s','No\x20Company','forEach','string','picklist','idField'];(function(_0x5920cc,_0x3a6ddc){var _0x12b911=function(_0x48e641){while(--_0x48e641){_0x5920cc['push'](_0x5920cc['shift']());}};_0x12b911(++_0x3a6ddc);}(_0xe07d,0x1cb));var _0xde07=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xe07d[_0x291f8b];return _0x275171;};'use strict';var _=require(_0xde07('0x0'));var rp=require(_0xde07('0x1'));var moment=require(_0xde07('0x2'));var BPromise=require(_0xde07('0x3'));var md5=require(_0xde07('0x4'));var jsforce=require('jsforce');var util=require(_0xde07('0x5'));var Redis=require(_0xde07('0x6'));var intUtil=require(_0xde07('0x7'));var config=require(_0xde07('0x8'));var logger=require(_0xde07('0x9'))(_0xde07('0xa'));config[_0xde07('0xb')]=_[_0xde07('0xc')](config[_0xde07('0xb')],{'host':_0xde07('0xd'),'port':0x18eb});var io=require(_0xde07('0xe'))(new Redis(config[_0xde07('0xb')]));function emit(_0x378381,_0x1d041b,_0x4d20d3){io['to'](_0x378381)[_0xde07('0xf')](_0x1d041b,_0x4d20d3);}function getTicket(_0x1b41be,_0x4b314e,_0x14dd43,_0x1bf5ec,_0x5e0d71,_0x284f1e,_0x567f6f,_0x3704e4){var _0x53dfb8=Object[_0xde07('0x10')]({},{'OwnerId':_0x4b314e['id'],'Subject':intUtil[_0xde07('0x11')](_0x1bf5ec[_0xde07('0x12')],_0x5e0d71,'\x20'),'Description':intUtil['getString'](_0x1bf5ec[_0xde07('0x13')],_0x5e0d71,'\x0a')},getCustomFields(_0x284f1e,_0x5e0d71));if(_0x14dd43){if(_0x1bf5ec[_0xde07('0x14')]===_0xde07('0x15')){_0x53dfb8[_0xde07('0x16')]=moment[_0xde07('0x17')]();_0x53dfb8[_0xde07('0x18')]=![];_0x53dfb8['IsRecurrence']=![];if(_0x14dd43[_0xde07('0x19')]==='contact'||_0x14dd43[_0xde07('0x19')]==='lead'){_0x53dfb8[_0xde07('0x1a')]=_0x14dd43['id'];}else if(_0x14dd43[_0xde07('0x19')]===_0xde07('0x1b')){_0x53dfb8[_0xde07('0x1c')]=_0x14dd43['id'];}}else if(_0x1bf5ec['ticketType']===_0xde07('0x1d')){if(_0x14dd43['endUserType']===_0xde07('0x1e')){_0x53dfb8['ContactId']=_0x14dd43['id'];}else if(_0x14dd43[_0xde07('0x19')]===_0xde07('0x1b')){_0x53dfb8[_0xde07('0x1f')]=_0x14dd43['id'];}else if(_0x14dd43[_0xde07('0x19')]===_0xde07('0x20')&&_0x1bf5ec[_0xde07('0x21')]){_0x53dfb8[_0x1bf5ec[_0xde07('0x21')]]=_0x14dd43['id'];}else{logger['info'](_0xde07('0x22'));}}}return _0x567f6f['sobject'](_0x1bf5ec[_0xde07('0x14')])[_0xde07('0x23')](_0x53dfb8);}function getUser(_0x26a883,_0x320aab,_0x3aa31e){if(!_[_0xde07('0x24')](_0x320aab)&&intUtil['validateEmail'](_0x320aab)){var _0x331562={'Email':_0x320aab};var _0x223a07={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3aa31e[_0xde07('0x25')](_0xde07('0x26'))[_0xde07('0x27')](_0x331562,_0x223a07)[_0xde07('0x28')]()[_0xde07('0x29')](function(_0x313030){if(_0x313030[_0xde07('0x2a')]){var _0x59a48a=_[_0xde07('0x27')](_0x313030,function(_0x3cf80b){return _0x3cf80b[_0xde07('0x2b')]===_0x320aab;});if(_0x59a48a){logger[_0xde07('0x2c')](_0xde07('0x2d'),_0x320aab);return BPromise[_0xde07('0x2e')]({'id':_0x59a48a['Id'],'name':_0x59a48a[_0xde07('0x2f')]});}}else{logger[_0xde07('0x2c')](_0xde07('0x30'),_0x320aab);return _0x3aa31e['identity']()[_0xde07('0x29')](function(_0x5bff2d){return BPromise[_0xde07('0x2e')]({'id':_0x5bff2d[_0xde07('0x31')],'name':_0x5bff2d[_0xde07('0x32')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x320aab);return _0x3aa31e[_0xde07('0x33')]()[_0xde07('0x29')](function(_0x15f4e4){return BPromise['resolve']({'id':_0x15f4e4[_0xde07('0x31')],'name':_0x15f4e4[_0xde07('0x32')]});});}}function getEndUser(_0x32a13e,_0x3b973a,_0x3b3955,_0x6dd333,_0x364746){var _0x27be4d={'$or':{'Phone':_0x6dd333}};var _0x1ff315={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xde07('0x2e')]()[_0xde07('0x29')](function(){logger[_0xde07('0x2c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x6dd333,_0x3b973a['moduleSearch']);switch(_0x3b973a[_0xde07('0x34')]){case _0xde07('0x35'):var _0x26f90a=_[_0xde07('0x36')](_0x27be4d);if(_0x3b973a['additionalSearchContact']){var _0x3d3510={};_0x3d3510[_0x3b973a[_0xde07('0x37')]]=_0x6dd333;_[_0xde07('0x38')](_0x26f90a[_0xde07('0x39')],_0x3d3510);}return _0x364746[_0xde07('0x25')](_0xde07('0x3a'))['find'](_0x26f90a,_0x1ff315)['execute']()[_0xde07('0x29')](function(_0x241d1c){if(_0x241d1c&&_0x241d1c[_0xde07('0x2a')]){return _0x241d1c;}else{var _0x43453a=_[_0xde07('0x36')](_0x27be4d);if(_0x3b973a[_0xde07('0x3b')]){var _0x15efd9={};_0x15efd9[_0x3b973a['additionalSearchLead']]=_0x6dd333;_[_0xde07('0x38')](_0x43453a[_0xde07('0x39')],_0x15efd9);}return _0x364746[_0xde07('0x25')](_0xde07('0x3c'))[_0xde07('0x27')](_0x43453a,_0x1ff315);}});case _0xde07('0x3d'):var _0x403196=_['cloneDeep'](_0x27be4d);if(_0x3b973a['additionalSearchAccount']){var _0x3d3510={};_0x3d3510[_0x3b973a[_0xde07('0x3e')]]=_0x6dd333;_[_0xde07('0x38')](_0x403196[_0xde07('0x39')],_0x3d3510);}return _0x364746[_0xde07('0x25')](_0xde07('0x3f'))[_0xde07('0x27')](_0x403196,_0x1ff315)[_0xde07('0x28')]()['then'](function(_0x552aaf){if(_0x552aaf&&_0x552aaf[_0xde07('0x2a')]){return _0x552aaf;}else{var _0x330f3d=_[_0xde07('0x36')](_0x27be4d);if(_0x3b973a[_0xde07('0x37')]){var _0x1e7b70={};_0x1e7b70[_0x3b973a['additionalSearchContact']]=_0x6dd333;_[_0xde07('0x38')](_0x330f3d['$or'],_0x1e7b70);}return _0x364746['sobject'](_0xde07('0x3a'))[_0xde07('0x27')](_0x330f3d,_0x1ff315)[_0xde07('0x29')](function(_0xe9de19){if(_0xe9de19&&_0xe9de19[_0xde07('0x2a')]){return _0xe9de19;}else{var _0x21114c=_[_0xde07('0x36')](_0x27be4d);if(_0x3b973a[_0xde07('0x3b')]){var _0x1d51b0={};_0x1d51b0[_0x3b973a[_0xde07('0x3b')]]=_0x6dd333;_[_0xde07('0x38')](_0x21114c[_0xde07('0x39')],_0x1d51b0);}return _0x364746[_0xde07('0x25')](_0xde07('0x3c'))['find'](_0x21114c,_0x1ff315);}});}});case _0xde07('0x1e'):var _0x26f90a=_[_0xde07('0x36')](_0x27be4d);if(_0x3b973a[_0xde07('0x37')]){var _0x3d3510={};_0x3d3510[_0x3b973a[_0xde07('0x37')]]=_0x6dd333;_[_0xde07('0x38')](_0x26f90a[_0xde07('0x39')],_0x3d3510);}return _0x364746[_0xde07('0x25')](_0xde07('0x3a'))[_0xde07('0x27')](_0x26f90a,_0x1ff315)[_0xde07('0x28')]();case'lead':var _0x2779ba=_['cloneDeep'](_0x27be4d);if(_0x3b973a[_0xde07('0x3b')]){var _0x3d3510={};_0x3d3510[_0x3b973a['additionalSearchLead']]=_0x6dd333;_[_0xde07('0x38')](_0x2779ba[_0xde07('0x39')],_0x3d3510);}return _0x364746[_0xde07('0x25')](_0xde07('0x3c'))[_0xde07('0x27')](_0x2779ba,_0x1ff315);case _0xde07('0x1b'):var _0x403196=_[_0xde07('0x36')](_0x27be4d);if(_0x3b973a[_0xde07('0x3e')]){var _0x3d3510={};_0x3d3510[_0x3b973a[_0xde07('0x3e')]]=_0x6dd333;_[_0xde07('0x38')](_0x403196[_0xde07('0x39')],_0x3d3510);}return _0x364746[_0xde07('0x25')]('Account')[_0xde07('0x27')](_0x403196,_0x1ff315);default:return null;}})[_0xde07('0x29')](function(_0x2b02dd){if(_0x2b02dd&&_0x2b02dd['length']){var _0x2a6d02=_['first'](_0x2b02dd);if(_0x2a6d02){return BPromise[_0xde07('0x2e')]({'id':_0x2a6d02['Id'],'name':_0x2a6d02[_0xde07('0x2f')],'phone':_0x2a6d02[_0xde07('0x40')],'endUserType':_0x2a6d02[_0xde07('0x41')][_0xde07('0x42')][_0xde07('0x43')]()});}}})[_0xde07('0x29')](function(_0x35081f){if(_0x35081f){logger['info'](_0xde07('0x44'),_0x35081f[_0xde07('0x19')],_0x6dd333);return BPromise[_0xde07('0x2e')](_0x35081f);}else{logger[_0xde07('0x2c')](_0xde07('0x45'),_0x6dd333);var _0xfb70b5={'Phone':_0x6dd333};if(_0x3b973a['moduleCreate']){if(_0x3b973a[_0xde07('0x46')]==='contact'){logger[_0xde07('0x2c')](_0xde07('0x47'),_0x6dd333,_0x3b973a[_0xde07('0x46')]);_0xfb70b5['LastName']=_0x3b3955!==_0xde07('0x48')?_0x3b3955:util['format']('Caller\x20-\x20%s',_0x6dd333);}else if(_0x3b973a[_0xde07('0x46')]===_0xde07('0x20')){logger[_0xde07('0x2c')](_0xde07('0x47'),_0x6dd333,_0x3b973a['moduleCreate']);_0xfb70b5[_0xde07('0x49')]=_0x3b3955!==_0xde07('0x48')?_0x3b3955:util[_0xde07('0x4a')](_0xde07('0x4b'),_0x6dd333);_0xfb70b5['Company']=_0xde07('0x4c');}else if(_0x3b973a[_0xde07('0x46')]===_0xde07('0x1b')){logger['info'](_0xde07('0x47'),_0x6dd333,_0x3b973a[_0xde07('0x46')]);_0xfb70b5['Name']=_0x3b3955!==_0xde07('0x48')?_0x3b3955:util[_0xde07('0x4a')](_0xde07('0x4b'),_0x6dd333);}else{return null;}}return _0x364746[_0xde07('0x25')](_['upperFirst'](_0x3b973a[_0xde07('0x46')]))['create'](_0xfb70b5)[_0xde07('0x29')](function(_0x1cf1d7){return BPromise[_0xde07('0x2e')]({'id':_0x1cf1d7['id'],'endUserType':_0x3b973a[_0xde07('0x46')]});});}});}function getCustomFields(_0x2453f8,_0x5281df){var _0x21774b={};if(_0x2453f8[_0xde07('0x2a')]>0x0){_[_0xde07('0x4d')](_0x2453f8,function(_0x9f7527){if(_['includes']([_0xde07('0x4e'),_0xde07('0x4f')],_0x9f7527[_0xde07('0x42')])&&_0x9f7527['idField']){_0x21774b[_0x9f7527[_0xde07('0x50')]]=_0x9f7527[_0xde07('0x51')][_0xde07('0x52')]();}else if(_0x9f7527['type']==='variable'&&_0x9f7527[_0xde07('0x53')]&&_0x9f7527[_0xde07('0x50')]){_0x5281df[_0x9f7527['variableName']]&&(_0x21774b[_0x9f7527[_0xde07('0x50')]]=_0x5281df[_0x9f7527[_0xde07('0x53')]]['toString']());}else if(_0x9f7527[_0xde07('0x42')]===_0xde07('0x54')&&_0x9f7527[_0xde07('0x55')]&&_0x9f7527['Variable'][_0xde07('0x56')]&&_0x9f7527['idField']){_0x5281df[_0x9f7527[_0xde07('0x55')]['name']['toLowerCase']()]&&(_0x21774b[_0x9f7527[_0xde07('0x50')]]=_0x5281df[_0x9f7527[_0xde07('0x55')][_0xde07('0x56')][_0xde07('0x43')]()][_0xde07('0x52')]());}});}return _0x21774b;}function getConnection(_0x501930){var _0xdaf667=_0x501930[_0xde07('0x57')][_0xde07('0x58')](_0x501930[_0xde07('0x59')]);var _0x4ace5a=new jsforce[(_0xde07('0x5a'))]({'oauth2':{'loginUrl':_0x501930[_0xde07('0x5b')]||_0xde07('0x5c'),'clientId':_0x501930[_0xde07('0x5d')],'clientSecret':_0x501930['clientSecret']}});return _0x4ace5a[_0xde07('0x5e')](_0x501930['username'],_0xdaf667)['then'](function(){logger['info'](_0xde07('0x5f'));return _0x4ace5a;});}exports[_0xde07('0x60')]=function(_0x1e364a,_0x31ee2c,_0x457ece,_0x4aaf2e,_0x1b6df0,_0x716187){var _0x1ae734,_0x404217,_0x24a264,_0x33dbed;_0x716187[_0xde07('0x61')]=intUtil[_0xde07('0x62')](_0x716187[_0xde07('0x61')]);_0x716187[_0xde07('0x5b')]=intUtil[_0xde07('0x62')](_0x716187['remoteUri']);if(_0x1b6df0&&_0x1b6df0[_0xde07('0x63')]){logger[_0xde07('0x2c')](_0xde07('0x64'),_0xde07('0x65'));_0x31ee2c[_0xde07('0x66')]=util[_0xde07('0x4a')](_0xde07('0x67'),_0x716187[_0xde07('0x61')],_0x31ee2c[_0xde07('0x68')],md5(_0x31ee2c['uniqueid']));}else{_0x31ee2c[_0xde07('0x66')]='';}return getConnection(_0x716187)[_0xde07('0x29')](function(_0x323e35){_0x33dbed=_0x323e35;return getUser(_0x716187,_0x4aaf2e[_0xde07('0x69')],_0x33dbed);})[_0xde07('0x29')](function(_0x3a71c8){_0x1ae734=_0x3a71c8;return getEndUser(_0x716187,_0x457ece,_0x31ee2c[_0xde07('0x6a')],_0x31ee2c[_0xde07('0x6b')],_0x33dbed);})[_0xde07('0x29')](function(_0x438a8e){_0x404217=_0x438a8e;return getTicket(_0x716187,_0x1ae734,_0x404217,_0x457ece,_0x31ee2c,_0x457ece[_0xde07('0x6c')],_0x33dbed,'queue');})['then'](function(_0x305502){_0x24a264=_0x305502;logger[_0xde07('0x2c')](_0xde07('0x6d'),_0x24a264['id']);logger[_0xde07('0x2c')](_0xde07('0x6e'),_0x24a264['id'],_0x4aaf2e[_0xde07('0x56')],_0x716187[_0xde07('0x42')]);switch(_0x716187[_0xde07('0x42')]){case _0xde07('0x6f'):emit(util[_0xde07('0x4a')](_0xde07('0x70'),_0x4aaf2e[_0xde07('0x56')]),_0xde07('0x71'),{'recordId':_0x24a264['id']});break;case _0xde07('0x72'):emit(util[_0xde07('0x4a')](_0xde07('0x70'),_0x4aaf2e['name']),_0xde07('0x73'),{'uri':util[_0xde07('0x4a')]('%s/%s/e',_0x33dbed[_0xde07('0x74')],_0x24a264['id'])});break;default:logger[_0xde07('0x75')](_0xde07('0x76'));}})[_0xde07('0x77')](function(_0x191ad3){logger[_0xde07('0x75')](_0xde07('0x64'),_0x191ad3);});};exports['outbound']=function(_0xad49cc,_0x3df1a5,_0x24a7b8,_0x1ed27a,_0x10a1eb,_0x531871,_0x2140bc){var _0x2caba7,_0x3fe808,_0x293962,_0x1b9c3b;_0x531871['serverUrl']=intUtil['stripTrailingSlash'](_0x531871['serverUrl']);_0x531871['remoteUri']=intUtil['stripTrailingSlash'](_0x531871[_0xde07('0x5b')]);if(_0x2140bc&&_0x2140bc[_0xde07('0x78')]&&_0x2140bc[_0xde07('0x78')]!==_0xde07('0x79')){logger[_0xde07('0x2c')](_0xde07('0x7a'),_0xde07('0x65'));_0x3df1a5[_0xde07('0x66')]=util[_0xde07('0x4a')](_0xde07('0x67'),_0x531871[_0xde07('0x61')],_0x3df1a5[_0xde07('0x68')],md5(_0x3df1a5['uniqueid']));}return getConnection(_0x531871)['then'](function(_0x3c1ff5){_0x1b9c3b=_0x3c1ff5;return getUser(_0x531871,_0x1ed27a[_0xde07('0x69')],_0x1b9c3b);})[_0xde07('0x29')](function(_0x5eb639){_0x2caba7=_0x5eb639;return getEndUser(_0x531871,_0x24a7b8,_0x3df1a5[_0xde07('0x7b')],_0x3df1a5[_0xde07('0x7c')],_0x1b9c3b);})['then'](function(_0x1f340c){_0x3fe808=_0x1f340c;return getTicket(_0x531871,_0x2caba7,_0x3fe808,_0x24a7b8,_0x3df1a5,_0x24a7b8[_0xde07('0x6c')],_0x1b9c3b,_0xde07('0x7d'));})['then'](function(_0x10a138){_0x293962=_0x10a138;logger[_0xde07('0x2c')](_0xde07('0x7e'),_0x293962['id']);logger['info'](_0xde07('0x7f'),_0x293962['id'],_0x1ed27a[_0xde07('0x56')],_0x531871[_0xde07('0x42')]);switch(_0x531871[_0xde07('0x42')]){case _0xde07('0x6f'):emit(util['format'](_0xde07('0x70'),_0x1ed27a[_0xde07('0x56')]),_0xde07('0x71'),{'recordId':_0x293962['id']});break;case _0xde07('0x72'):emit(util[_0xde07('0x4a')](_0xde07('0x70'),_0x1ed27a[_0xde07('0x56')]),_0xde07('0x73'),{'uri':util['format'](_0xde07('0x80'),_0x1b9c3b[_0xde07('0x74')],_0x293962['id'])});break;default:logger[_0xde07('0x75')]('[OUTBOUND]',_0xde07('0x81'));}})[_0xde07('0x77')](function(_0x4a8a4f){logger[_0xde07('0x75')](_0xde07('0x7a'),_0x4a8a4f);});};exports[_0xde07('0x82')]=function(_0x3ecd56,_0x34cdd0,_0x11cac7,_0x2a5372,_0x422551,_0x207df9){var _0x30acc1,_0x843571,_0x2a0697,_0x57cf82;_0x207df9[_0xde07('0x61')]=intUtil[_0xde07('0x62')](_0x207df9[_0xde07('0x61')]);_0x207df9['remoteUri']=intUtil['stripTrailingSlash'](_0x207df9[_0xde07('0x5b')]);if(_0x422551&&_0x422551[_0xde07('0x63')]){logger['info']('['+_0x34cdd0[_0xde07('0x83')][_0xde07('0x84')]()+']','Recording\x20is\x20enabled!');_0x34cdd0[_0xde07('0x66')]=util['format'](_0xde07('0x67'),_0x207df9[_0xde07('0x61')],_0x34cdd0[_0xde07('0x68')],md5(_0x34cdd0[_0xde07('0x68')]));}else{_0x34cdd0[_0xde07('0x66')]='';}return getConnection(_0x207df9)[_0xde07('0x29')](function(_0x494624){_0x57cf82=_0x494624;if(!_[_0xde07('0x24')](_0x2a5372)){return getUser(_0x207df9,_0x2a5372['name'],_0x57cf82);}else{return getUser(_0x207df9,null,_0x57cf82);}})[_0xde07('0x29')](function(_0x2461d9){_0x30acc1=_0x2461d9;return getEndUser(_0x207df9,_0x11cac7,_0x34cdd0[_0xde07('0x6a')],_0x34cdd0[_0xde07('0x6b')],_0x57cf82);})[_0xde07('0x29')](function(_0x4398db){_0x843571=_0x4398db;return getTicket(_0x207df9,_0x30acc1,_0x843571,_0x11cac7,_0x34cdd0,_0x11cac7[_0xde07('0x6c')],_0x57cf82);})[_0xde07('0x29')](function(_0x38f5e7){_0x2a0697=_0x38f5e7;logger[_0xde07('0x2c')]('['+_0x34cdd0[_0xde07('0x83')][_0xde07('0x84')]()+_0xde07('0x85'),_0x2a0697['id']);logger[_0xde07('0x2c')]('['+_0x34cdd0[_0xde07('0x83')][_0xde07('0x84')]()+_0xde07('0x86'),_0x207df9['type']);})[_0xde07('0x77')](function(_0x1b4faf){logger[_0xde07('0x75')]('['+_0x34cdd0[_0xde07('0x83')][_0xde07('0x84')]()+']',_0x1b4faf);});}; \ No newline at end of file +var _0x7d93=['contact','WhoId','account','Case','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','User','find','execute','then','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','sobject','Contact','length','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','$or','Lead','Phone','attributes','type','toLowerCase','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','upperFirst','forEach','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridname','Fields',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','jsforce','util','ioredis','../../../../config/environment','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','endUserType'];(function(_0x416c20,_0x93585d){var _0x2ca7ec=function(_0x1d64a7){while(--_0x1d64a7){_0x416c20['push'](_0x416c20['shift']());}};_0x2ca7ec(++_0x93585d);}(_0x7d93,0xec));var _0x37d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x37d9('0x0'));var rp=require('request-promise');var moment=require(_0x37d9('0x1'));var BPromise=require(_0x37d9('0x2'));var md5=require('md5');var jsforce=require(_0x37d9('0x3'));var util=require(_0x37d9('0x4'));var Redis=require(_0x37d9('0x5'));var intUtil=require('./util');var config=require(_0x37d9('0x6'));var logger=require('../../../../config/logger')(_0x37d9('0x7'));config['redis']=_[_0x37d9('0x8')](config[_0x37d9('0x9')],{'host':_0x37d9('0xa'),'port':0x18eb});var io=require(_0x37d9('0xb'))(new Redis(config[_0x37d9('0x9')]));function emit(_0x4e94b7,_0x4e5259,_0x50806f){io['to'](_0x4e94b7)[_0x37d9('0xc')](_0x4e5259,_0x50806f);}function getTicket(_0x2c86fe,_0x100d58,_0x532aff,_0x21f958,_0x188c2a,_0x45ce4f,_0x2c42e4,_0x787729){var _0x1b16f7=Object[_0x37d9('0xd')]({},{'OwnerId':_0x100d58['id'],'Subject':intUtil['getString'](_0x21f958[_0x37d9('0xe')],_0x188c2a,'\x20'),'Description':intUtil[_0x37d9('0xf')](_0x21f958[_0x37d9('0x10')],_0x188c2a,'\x0a')},getCustomFields(_0x45ce4f,_0x188c2a));if(_0x532aff){if(_0x21f958[_0x37d9('0x11')]===_0x37d9('0x12')){_0x1b16f7[_0x37d9('0x13')]=moment['utc']();_0x1b16f7[_0x37d9('0x14')]=![];_0x1b16f7['IsRecurrence']=![];if(_0x532aff[_0x37d9('0x15')]===_0x37d9('0x16')||_0x532aff[_0x37d9('0x15')]==='lead'){_0x1b16f7[_0x37d9('0x17')]=_0x532aff['id'];}else if(_0x532aff[_0x37d9('0x15')]===_0x37d9('0x18')){_0x1b16f7['WhatId']=_0x532aff['id'];}}else if(_0x21f958[_0x37d9('0x11')]===_0x37d9('0x19')){if(_0x532aff[_0x37d9('0x15')]==='contact'){_0x1b16f7[_0x37d9('0x1a')]=_0x532aff['id'];}else if(_0x532aff[_0x37d9('0x15')]==='account'){_0x1b16f7[_0x37d9('0x1b')]=_0x532aff['id'];}else if(_0x532aff[_0x37d9('0x15')]===_0x37d9('0x1c')&&_0x21f958['leadId']){_0x1b16f7[_0x21f958[_0x37d9('0x1d')]]=_0x532aff['id'];}else{logger[_0x37d9('0x1e')](_0x37d9('0x1f'));}}}return _0x2c42e4['sobject'](_0x21f958['ticketType'])[_0x37d9('0x20')](_0x1b16f7);}function getUser(_0x5ebed5,_0x3f4ece,_0x1ccf85){if(!_[_0x37d9('0x21')](_0x3f4ece)&&intUtil['validateEmail'](_0x3f4ece)){var _0x307169={'Email':_0x3f4ece};var _0xa20985={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1ccf85['sobject'](_0x37d9('0x22'))[_0x37d9('0x23')](_0x307169,_0xa20985)[_0x37d9('0x24')]()[_0x37d9('0x25')](function(_0x1c4802){if(_0x1c4802['length']){var _0x3dd2b0=_['find'](_0x1c4802,function(_0x84038b){return _0x84038b[_0x37d9('0x26')]===_0x3f4ece;});if(_0x3dd2b0){logger[_0x37d9('0x1e')]('Agent\x20%s\x20found.',_0x3f4ece);return BPromise[_0x37d9('0x27')]({'id':_0x3dd2b0['Id'],'name':_0x3dd2b0[_0x37d9('0x28')]});}}else{logger[_0x37d9('0x1e')](_0x37d9('0x29'),_0x3f4ece);return _0x1ccf85['identity']()[_0x37d9('0x25')](function(_0x35cdf7){return BPromise[_0x37d9('0x27')]({'id':_0x35cdf7[_0x37d9('0x2a')],'name':_0x35cdf7[_0x37d9('0x2b')]});});}});}else{logger[_0x37d9('0x1e')](_0x37d9('0x29'),_0x3f4ece);return _0x1ccf85[_0x37d9('0x2c')]()['then'](function(_0x4f614a){return BPromise[_0x37d9('0x27')]({'id':_0x4f614a['user_id'],'name':_0x4f614a[_0x37d9('0x2b')]});});}}function getEndUser(_0x5e9784,_0x2247e5,_0x16ecc1,_0x6206cf,_0x3c4775){var _0x2018fc={'$or':{'Phone':_0x6206cf}};var _0x42a281={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x37d9('0x27')]()['then'](function(){logger[_0x37d9('0x1e')](_0x37d9('0x2d'),_0x6206cf,_0x2247e5[_0x37d9('0x2e')]);switch(_0x2247e5[_0x37d9('0x2e')]){case _0x37d9('0x2f'):var _0x1c1acb=_[_0x37d9('0x30')](_0x2018fc);if(_0x2247e5[_0x37d9('0x31')]){var _0x53bc68={};_0x53bc68[_0x2247e5['additionalSearchContact']]=_0x6206cf;_[_0x37d9('0x32')](_0x1c1acb['$or'],_0x53bc68);}return _0x3c4775[_0x37d9('0x33')](_0x37d9('0x34'))['find'](_0x1c1acb,_0x42a281)[_0x37d9('0x24')]()['then'](function(_0x10872c){if(_0x10872c&&_0x10872c[_0x37d9('0x35')]){return _0x10872c;}else{var _0x31ab43=_[_0x37d9('0x30')](_0x2018fc);if(_0x2247e5[_0x37d9('0x36')]){var _0x6ed26f={};_0x6ed26f[_0x2247e5['additionalSearchLead']]=_0x6206cf;_['merge'](_0x31ab43['$or'],_0x6ed26f);}return _0x3c4775[_0x37d9('0x33')]('Lead')[_0x37d9('0x23')](_0x31ab43,_0x42a281);}});case _0x37d9('0x37'):var _0xe63060=_[_0x37d9('0x30')](_0x2018fc);if(_0x2247e5['additionalSearchAccount']){var _0x53bc68={};_0x53bc68[_0x2247e5[_0x37d9('0x38')]]=_0x6206cf;_['merge'](_0xe63060['$or'],_0x53bc68);}return _0x3c4775[_0x37d9('0x33')](_0x37d9('0x39'))['find'](_0xe63060,_0x42a281)[_0x37d9('0x24')]()[_0x37d9('0x25')](function(_0x37e6b4){if(_0x37e6b4&&_0x37e6b4['length']){return _0x37e6b4;}else{var _0x2bdb7e=_[_0x37d9('0x30')](_0x2018fc);if(_0x2247e5[_0x37d9('0x31')]){var _0x31e0ad={};_0x31e0ad[_0x2247e5[_0x37d9('0x31')]]=_0x6206cf;_['merge'](_0x2bdb7e[_0x37d9('0x3a')],_0x31e0ad);}return _0x3c4775[_0x37d9('0x33')](_0x37d9('0x34'))['find'](_0x2bdb7e,_0x42a281)[_0x37d9('0x25')](function(_0x1700a5){if(_0x1700a5&&_0x1700a5[_0x37d9('0x35')]){return _0x1700a5;}else{var _0x58846b=_['cloneDeep'](_0x2018fc);if(_0x2247e5[_0x37d9('0x36')]){var _0x59318f={};_0x59318f[_0x2247e5[_0x37d9('0x36')]]=_0x6206cf;_[_0x37d9('0x32')](_0x58846b[_0x37d9('0x3a')],_0x59318f);}return _0x3c4775[_0x37d9('0x33')](_0x37d9('0x3b'))['find'](_0x58846b,_0x42a281);}});}});case _0x37d9('0x16'):var _0x1c1acb=_[_0x37d9('0x30')](_0x2018fc);if(_0x2247e5[_0x37d9('0x31')]){var _0x53bc68={};_0x53bc68[_0x2247e5[_0x37d9('0x31')]]=_0x6206cf;_[_0x37d9('0x32')](_0x1c1acb[_0x37d9('0x3a')],_0x53bc68);}return _0x3c4775['sobject'](_0x37d9('0x34'))[_0x37d9('0x23')](_0x1c1acb,_0x42a281)['execute']();case _0x37d9('0x1c'):var _0x262a55=_['cloneDeep'](_0x2018fc);if(_0x2247e5[_0x37d9('0x36')]){var _0x53bc68={};_0x53bc68[_0x2247e5[_0x37d9('0x36')]]=_0x6206cf;_[_0x37d9('0x32')](_0x262a55[_0x37d9('0x3a')],_0x53bc68);}return _0x3c4775[_0x37d9('0x33')](_0x37d9('0x3b'))['find'](_0x262a55,_0x42a281);case _0x37d9('0x18'):var _0xe63060=_[_0x37d9('0x30')](_0x2018fc);if(_0x2247e5[_0x37d9('0x38')]){var _0x53bc68={};_0x53bc68[_0x2247e5['additionalSearchAccount']]=_0x6206cf;_[_0x37d9('0x32')](_0xe63060[_0x37d9('0x3a')],_0x53bc68);}return _0x3c4775[_0x37d9('0x33')](_0x37d9('0x39'))[_0x37d9('0x23')](_0xe63060,_0x42a281);default:return null;}})['then'](function(_0x58a5b9){if(_0x58a5b9&&_0x58a5b9['length']){var _0x866016=_['first'](_0x58a5b9);if(_0x866016){return BPromise[_0x37d9('0x27')]({'id':_0x866016['Id'],'name':_0x866016['Name'],'phone':_0x866016[_0x37d9('0x3c')],'endUserType':_0x866016[_0x37d9('0x3d')][_0x37d9('0x3e')][_0x37d9('0x3f')]()});}}})[_0x37d9('0x25')](function(_0x1ac07c){if(_0x1ac07c){logger[_0x37d9('0x1e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x1ac07c[_0x37d9('0x15')],_0x6206cf);return BPromise['resolve'](_0x1ac07c);}else{logger[_0x37d9('0x1e')](_0x37d9('0x40'),_0x6206cf);var _0x451d75={'Phone':_0x6206cf};if(_0x2247e5[_0x37d9('0x41')]){if(_0x2247e5[_0x37d9('0x41')]===_0x37d9('0x16')){logger[_0x37d9('0x1e')](_0x37d9('0x42'),_0x6206cf,_0x2247e5[_0x37d9('0x41')]);_0x451d75[_0x37d9('0x43')]=_0x16ecc1!==''?_0x16ecc1:util[_0x37d9('0x44')](_0x37d9('0x45'),_0x6206cf);}else if(_0x2247e5[_0x37d9('0x41')]===_0x37d9('0x1c')){logger[_0x37d9('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x6206cf,_0x2247e5[_0x37d9('0x41')]);_0x451d75['LastName']=_0x16ecc1!==_0x37d9('0x46')?_0x16ecc1:util['format']('Caller\x20-\x20%s',_0x6206cf);_0x451d75[_0x37d9('0x47')]='No\x20Company';}else if(_0x2247e5[_0x37d9('0x41')]===_0x37d9('0x18')){logger[_0x37d9('0x1e')](_0x37d9('0x42'),_0x6206cf,_0x2247e5[_0x37d9('0x41')]);_0x451d75[_0x37d9('0x28')]=_0x16ecc1!==_0x37d9('0x46')?_0x16ecc1:util['format'](_0x37d9('0x45'),_0x6206cf);}else{return null;}}return _0x3c4775[_0x37d9('0x33')](_[_0x37d9('0x48')](_0x2247e5['moduleCreate']))[_0x37d9('0x20')](_0x451d75)[_0x37d9('0x25')](function(_0x4f87de){return BPromise['resolve']({'id':_0x4f87de['id'],'endUserType':_0x2247e5[_0x37d9('0x41')]});});}});}function getCustomFields(_0x3bcf36,_0xa780d2){var _0x20d332={};if(_0x3bcf36['length']>0x0){_[_0x37d9('0x49')](_0x3bcf36,function(_0x2e25e6){if(_['includes']([_0x37d9('0x4a'),_0x37d9('0x4b')],_0x2e25e6[_0x37d9('0x3e')])&&_0x2e25e6[_0x37d9('0x4c')]){_0x20d332[_0x2e25e6[_0x37d9('0x4c')]]=_0x2e25e6[_0x37d9('0x4d')][_0x37d9('0x4e')]();}else if(_0x2e25e6[_0x37d9('0x3e')]==='variable'&&_0x2e25e6[_0x37d9('0x4f')]&&_0x2e25e6[_0x37d9('0x4c')]){_0xa780d2[_0x2e25e6['variableName']]&&(_0x20d332[_0x2e25e6['idField']]=_0xa780d2[_0x2e25e6[_0x37d9('0x4f')]][_0x37d9('0x4e')]());}else if(_0x2e25e6[_0x37d9('0x3e')]===_0x37d9('0x50')&&_0x2e25e6[_0x37d9('0x51')]&&_0x2e25e6['Variable'][_0x37d9('0x52')]&&_0x2e25e6[_0x37d9('0x4c')]){_0xa780d2[_0x2e25e6['Variable'][_0x37d9('0x52')][_0x37d9('0x3f')]()]&&(_0x20d332[_0x2e25e6[_0x37d9('0x4c')]]=_0xa780d2[_0x2e25e6[_0x37d9('0x51')][_0x37d9('0x52')][_0x37d9('0x3f')]()]['toString']());}});}return _0x20d332;}function getConnection(_0x112555){var _0x38c67c=_0x112555[_0x37d9('0x53')][_0x37d9('0x54')](_0x112555[_0x37d9('0x55')]);var _0x68cfe8=new jsforce[(_0x37d9('0x56'))]({'oauth2':{'loginUrl':_0x112555[_0x37d9('0x57')]||'https://login.salesforce.com','clientId':_0x112555[_0x37d9('0x58')],'clientSecret':_0x112555[_0x37d9('0x59')]}});return _0x68cfe8[_0x37d9('0x5a')](_0x112555[_0x37d9('0x5b')],_0x38c67c)[_0x37d9('0x25')](function(){logger[_0x37d9('0x1e')]('Connection\x20established.');return _0x68cfe8;});}exports[_0x37d9('0x5c')]=function(_0x1e76b2,_0x43f34b,_0x42511d,_0x231087,_0x2eba37,_0x426106){var _0x14ddec,_0x3c196d,_0x508cfe,_0x40ece7;_0x426106[_0x37d9('0x5d')]=intUtil[_0x37d9('0x5e')](_0x426106['serverUrl']);_0x426106[_0x37d9('0x57')]=intUtil[_0x37d9('0x5e')](_0x426106[_0x37d9('0x57')]);if(_0x2eba37&&_0x2eba37[_0x37d9('0x5f')]){logger[_0x37d9('0x1e')](_0x37d9('0x60'),'Recording\x20is\x20enabled!');_0x43f34b[_0x37d9('0x61')]=util['format'](_0x37d9('0x62'),_0x426106['serverUrl'],_0x43f34b[_0x37d9('0x63')],md5(_0x43f34b['uniqueid']));}else{_0x43f34b[_0x37d9('0x61')]='';}return getConnection(_0x426106)[_0x37d9('0x25')](function(_0x559fcf){_0x40ece7=_0x559fcf;return getUser(_0x426106,_0x231087[_0x37d9('0x64')],_0x40ece7);})[_0x37d9('0x25')](function(_0x334e79){_0x14ddec=_0x334e79;return getEndUser(_0x426106,_0x42511d,_0x43f34b['calleridname'],_0x43f34b[_0x37d9('0x65')],_0x40ece7);})['then'](function(_0x5a0d92){_0x3c196d=_0x5a0d92;return getTicket(_0x426106,_0x14ddec,_0x3c196d,_0x42511d,_0x43f34b,_0x42511d['Fields'],_0x40ece7,_0x37d9('0x5c'));})[_0x37d9('0x25')](function(_0x27899c){_0x508cfe=_0x27899c;logger['info'](_0x37d9('0x66'),_0x508cfe['id']);logger[_0x37d9('0x1e')](_0x37d9('0x67'),_0x508cfe['id'],_0x231087[_0x37d9('0x52')],_0x426106[_0x37d9('0x3e')]);switch(_0x426106[_0x37d9('0x3e')]){case _0x37d9('0x68'):emit(util[_0x37d9('0x44')](_0x37d9('0x69'),_0x231087[_0x37d9('0x52')]),_0x37d9('0x6a'),{'recordId':_0x508cfe['id']});break;case _0x37d9('0x6b'):emit(util['format'](_0x37d9('0x69'),_0x231087[_0x37d9('0x52')]),_0x37d9('0x6c'),{'uri':util[_0x37d9('0x44')](_0x37d9('0x6d'),_0x40ece7['instanceUrl'],_0x508cfe['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x55c998){logger['error'](_0x37d9('0x60'),_0x55c998);});};exports[_0x37d9('0x6e')]=function(_0x3cb898,_0x36341f,_0x14e80c,_0x26677a,_0x218455,_0x55f599,_0x90adad){var _0x71b0ba,_0x4dd84a,_0x2289be,_0x11eea3;_0x55f599[_0x37d9('0x5d')]=intUtil[_0x37d9('0x5e')](_0x55f599[_0x37d9('0x5d')]);_0x55f599[_0x37d9('0x57')]=intUtil[_0x37d9('0x5e')](_0x55f599['remoteUri']);if(_0x90adad&&_0x90adad['recordingFormat']&&_0x90adad[_0x37d9('0x6f')]!==_0x37d9('0x70')){logger['info'](_0x37d9('0x71'),'Recording\x20is\x20enabled!');_0x36341f[_0x37d9('0x61')]=util[_0x37d9('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55f599[_0x37d9('0x5d')],_0x36341f[_0x37d9('0x63')],md5(_0x36341f[_0x37d9('0x63')]));}return getConnection(_0x55f599)['then'](function(_0x2b974e){_0x11eea3=_0x2b974e;return getUser(_0x55f599,_0x26677a[_0x37d9('0x64')],_0x11eea3);})['then'](function(_0x4f5f48){_0x71b0ba=_0x4f5f48;return getEndUser(_0x55f599,_0x14e80c,_0x36341f[_0x37d9('0x72')],_0x36341f[_0x37d9('0x73')],_0x11eea3);})[_0x37d9('0x25')](function(_0x548bf8){_0x4dd84a=_0x548bf8;return getTicket(_0x55f599,_0x71b0ba,_0x4dd84a,_0x14e80c,_0x36341f,_0x14e80c['Fields'],_0x11eea3,'outbound');})['then'](function(_0x488ce1){_0x2289be=_0x488ce1;logger['info'](_0x37d9('0x74'),_0x2289be['id']);logger[_0x37d9('0x1e')](_0x37d9('0x75'),_0x2289be['id'],_0x26677a['name'],_0x55f599[_0x37d9('0x3e')]);switch(_0x55f599['type']){case _0x37d9('0x68'):emit(util['format'](_0x37d9('0x69'),_0x26677a[_0x37d9('0x52')]),_0x37d9('0x6a'),{'recordId':_0x2289be['id']});break;case'newTab':emit(util[_0x37d9('0x44')](_0x37d9('0x69'),_0x26677a[_0x37d9('0x52')]),_0x37d9('0x6c'),{'uri':util[_0x37d9('0x44')](_0x37d9('0x6d'),_0x11eea3[_0x37d9('0x76')],_0x2289be['id'])});break;default:logger['error'](_0x37d9('0x71'),_0x37d9('0x77'));}})[_0x37d9('0x78')](function(_0x3a827e){logger['error']('[OUTBOUND]',_0x3a827e);});};exports[_0x37d9('0x79')]=function(_0xb11fc4,_0x1789b3,_0xb28e18,_0x56eebd,_0x23715f,_0x1f43d0){var _0x5be2a3,_0x467a86,_0xcd4021,_0x2d20a5;_0x1f43d0['serverUrl']=intUtil[_0x37d9('0x5e')](_0x1f43d0[_0x37d9('0x5d')]);_0x1f43d0['remoteUri']=intUtil['stripTrailingSlash'](_0x1f43d0['remoteUri']);if(_0x23715f&&_0x23715f[_0x37d9('0x5f')]){logger[_0x37d9('0x1e')]('['+_0x1789b3[_0x37d9('0x7a')][_0x37d9('0x7b')]()+']',_0x37d9('0x7c'));_0x1789b3[_0x37d9('0x61')]=util[_0x37d9('0x44')](_0x37d9('0x62'),_0x1f43d0[_0x37d9('0x5d')],_0x1789b3[_0x37d9('0x63')],md5(_0x1789b3[_0x37d9('0x63')]));}else{_0x1789b3[_0x37d9('0x61')]='';}return getConnection(_0x1f43d0)[_0x37d9('0x25')](function(_0x3af92c){_0x2d20a5=_0x3af92c;if(!_[_0x37d9('0x21')](_0x56eebd)){return getUser(_0x1f43d0,_0x56eebd['name'],_0x2d20a5);}else{return getUser(_0x1f43d0,null,_0x2d20a5);}})[_0x37d9('0x25')](function(_0x1bb174){_0x5be2a3=_0x1bb174;return getEndUser(_0x1f43d0,_0xb28e18,_0x1789b3[_0x37d9('0x7d')],_0x1789b3[_0x37d9('0x65')],_0x2d20a5);})[_0x37d9('0x25')](function(_0x2bac2e){_0x467a86=_0x2bac2e;return getTicket(_0x1f43d0,_0x5be2a3,_0x467a86,_0xb28e18,_0x1789b3,_0xb28e18[_0x37d9('0x7e')],_0x2d20a5);})[_0x37d9('0x25')](function(_0x2913ba){_0xcd4021=_0x2913ba;logger[_0x37d9('0x1e')]('['+_0x1789b3[_0x37d9('0x7a')]['toUpperCase']()+_0x37d9('0x7f'),_0xcd4021['id']);logger[_0x37d9('0x1e')]('['+_0x1789b3[_0x37d9('0x7a')][_0x37d9('0x7b')]()+_0x37d9('0x80'),_0x1f43d0['type']);})[_0x37d9('0x78')](function(_0x42382f){logger['error']('['+_0x1789b3[_0x37d9('0x7a')][_0x37d9('0x7b')]()+']',_0x42382f);});}; \ 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 591b9d1..bdf8b27 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 _0xfa32=['serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','toString','idField','customField','content','variable','variableName','customVariable','Variable','name','outbound','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash'];(function(_0x54557c,_0x40f8b9){var _0x146585=function(_0x1b61fd){while(--_0x1b61fd){_0x54557c['push'](_0x54557c['shift']());}};_0x146585(++_0x40f8b9);}(_0xfa32,0x1c4));var _0x2fa3=function(_0x12f3cb,_0x56fd31){_0x12f3cb=_0x12f3cb-0x0;var _0x21e191=_0xfa32[_0x12f3cb];return _0x21e191;};'use strict';var _=require('lodash');var Promise=require(_0x2fa3('0x0'));var rp=require('request-promise');var util=require(_0x2fa3('0x1'));var md5=require(_0x2fa3('0x2'));var Redis=require(_0x2fa3('0x3'));var intUtil=require(_0x2fa3('0x4'));var config=require('../../../../config/environment');var logger=require(_0x2fa3('0x5'))(_0x2fa3('0x6'));config[_0x2fa3('0x7')]=_['defaults'](config[_0x2fa3('0x7')],{'host':_0x2fa3('0x8'),'port':0x18eb});var io=require(_0x2fa3('0x9'))(new Redis(config[_0x2fa3('0x7')]));function getAdminUser(_0x209ad7,_0x5006ba,_0x40f4c5,_0x56c85b,_0x352eeb,_0x1d1e81){return new Promise(function(_0x58fd44,_0x13f9dc){var _0x23351a={'method':_0x2fa3('0xa'),'uri':_0x56c85b+_0x2fa3('0xb')+'&'+_0x352eeb+'&'+_0x1d1e81,'auth':_0x5006ba,'json':!![]};return rp(_0x23351a)[_0x2fa3('0xc')](function(_0x96e850){if(_0x96e850[_0x2fa3('0xd')][_0x2fa3('0xe')]>0x0){_0x40f4c5[_0x2fa3('0xf')]=_0x96e850[_0x2fa3('0xd')][0x0][_0x2fa3('0x10')];}logger[_0x2fa3('0x11')]('['+[_0x209ad7['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x40f4c5);_0x58fd44(_0x40f4c5);})[_0x2fa3('0x12')](function(_0x30a5a5){logger[_0x2fa3('0x13')]('['+[_0x209ad7[_0x2fa3('0x14')]()]+']',_0x30a5a5[_0x2fa3('0x15')]);_0x13f9dc(_0x30a5a5[_0x2fa3('0x15')]);});});}function getUser(_0x4ff0ca,_0x561610,_0x31d977,_0x4d76f1,_0x2414a4){return function(_0x21f905){logger['info']('['+[_0x4ff0ca[_0x2fa3('0x14')]()]+_0x2fa3('0x16'),_0x21f905);return new Promise(function(_0x133259,_0x326a7e){if(intUtil[_0x2fa3('0x17')](_0x21f905[_0x2fa3('0x18')])){var _0x3b4526={'method':_0x2fa3('0xa'),'uri':_0x31d977+_0x2fa3('0x19')+_0x21f905[_0x2fa3('0x18')]+'&'+_0x4d76f1+'&'+_0x2414a4,'auth':_0x561610,'json':!![]};logger[_0x2fa3('0x11')]('['+[_0x4ff0ca[_0x2fa3('0x14')]()]+_0x2fa3('0x1a'),_0x3b4526);return rp(_0x3b4526)[_0x2fa3('0xc')](function(_0x11c2a8){logger['info']('['+[_0x4ff0ca['toUpperCase']()]+_0x2fa3('0x1b'),_0x11c2a8);if(_0x11c2a8['result']['length']>0x0&&String(_0x11c2a8[_0x2fa3('0xd')][0x0][_0x2fa3('0x1c')])===_0x2fa3('0x1d')){_0x21f905[_0x2fa3('0x1e')]=_0x11c2a8[_0x2fa3('0xd')][0x0]['sys_id'];}else{_0x21f905['userId']=_0x21f905['adminId'];_0x21f905[_0x2fa3('0x18')]=_0x21f905[_0x2fa3('0x1f')];}logger[_0x2fa3('0x11')]('['+[_0x4ff0ca['toUpperCase']()]+'],\x20getUser\x20crm',_0x21f905);_0x133259(_0x21f905);})[_0x2fa3('0x12')](function(_0x502a76){logger[_0x2fa3('0x13')]('['+[_0x4ff0ca[_0x2fa3('0x14')]()]+']',_0x502a76[_0x2fa3('0x15')]);_0x326a7e(_0x502a76[_0x2fa3('0x15')]);});}else{logger[_0x2fa3('0x11')]('['+[_0x4ff0ca['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x21f905[_0x2fa3('0x1e')]=_0x21f905[_0x2fa3('0xf')];_0x21f905[_0x2fa3('0x18')]=_0x21f905['adminEmail'];_0x133259(_0x21f905);}});};}function createEndUser(_0x33faae,_0x5261ed,_0x189b15,_0x2c1d06,_0x51f298){logger[_0x2fa3('0x11')]('['+[_0x33faae['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x189b15);return new Promise(function(_0xd88b19,_0x58433b){var _0x50661d={'method':_0x2fa3('0x20'),'uri':_0x2c1d06+_0x2fa3('0x21')+_0x51f298,'body':{'user_name':_0x189b15[_0x2fa3('0x22')],'roles':_0x2fa3('0x23'),'first_name':_0x189b15['endUserNumber'],'active':_0x2fa3('0x1d'),'date_format':_0x2fa3('0x24'),'phone':_0x189b15[_0x2fa3('0x22')]},'auth':_0x5261ed,'json':!![]};return rp(_0x50661d)['then'](function(_0x5519e7){logger[_0x2fa3('0x11')]('['+[_0x33faae[_0x2fa3('0x14')]()]+_0x2fa3('0x25'),_0x5519e7['result']);_0x189b15[_0x2fa3('0x26')]=_0x5519e7['result'][_0x2fa3('0x10')];_0xd88b19(_0x189b15);})[_0x2fa3('0x12')](function(_0xf29f7c){logger[_0x2fa3('0x13')]('['+[_0x33faae[_0x2fa3('0x14')]()]+']',_0xf29f7c[_0x2fa3('0x15')]);_0x58433b(_0xf29f7c[_0x2fa3('0x15')]);});});}function getEndUser(_0x39c1a0,_0x5c15dc,_0x23b9ad,_0x401360,_0x3c3f48){return function(_0x103aa2){logger[_0x2fa3('0x11')]('['+[_0x39c1a0['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x103aa2);return new Promise(function(_0x330f41,_0x4cf63e){var _0x37d319={'method':_0x2fa3('0xa'),'uri':_0x23b9ad+'sys_user?sysparm_query=phone%3D'+_0x103aa2[_0x2fa3('0x22')]+'&'+_0x401360+'&'+_0x3c3f48,'auth':_0x5c15dc,'json':!![]};return rp(_0x37d319)[_0x2fa3('0xc')](function(_0x31228e){if(_0x31228e[_0x2fa3('0xd')]['length']>0x0){_0x103aa2[_0x2fa3('0x26')]=_0x31228e[_0x2fa3('0xd')][0x0][_0x2fa3('0x10')];logger[_0x2fa3('0x11')]('['+[_0x39c1a0[_0x2fa3('0x14')]()]+_0x2fa3('0x27'),_0x103aa2);_0x330f41(_0x103aa2);}else{return createEndUser(_0x39c1a0,_0x5c15dc,_0x103aa2,_0x23b9ad,_0x401360)[_0x2fa3('0xc')](function(_0x2c8a0f){logger[_0x2fa3('0x11')]('['+[_0x39c1a0[_0x2fa3('0x14')]()]+'],\x20createEndUser\x20crm',_0x2c8a0f);_0x330f41(_0x2c8a0f);});}})[_0x2fa3('0x12')](function(_0x2867b3){logger['error']('['+[_0x39c1a0[_0x2fa3('0x14')]()]+']',_0x2867b3[_0x2fa3('0x15')]);_0x4cf63e(_0x2867b3[_0x2fa3('0x15')]);});});};}function getCustomFields(_0x5a492c,_0x4d41cb){var _0x5d8c3b={};if(_0x5a492c['length']>0x0){_[_0x2fa3('0x28')](_0x5a492c,function(_0x1465c3){if(_[_0x2fa3('0x29')]([_0x2fa3('0x2a'),_0x2fa3('0x2b')],_0x1465c3[_0x2fa3('0x2c')])&&_0x1465c3[_0x2fa3('0x2d')]&&!_0x1465c3['customField']){_0x5d8c3b[_0x1465c3[_0x2fa3('0x2d')][_0x2fa3('0x2e')]()]=_0x1465c3['content'][_0x2fa3('0x2f')]();}else if(_[_0x2fa3('0x29')]([_0x2fa3('0x2a'),_0x2fa3('0x2b')],_0x1465c3[_0x2fa3('0x2c')])&&_0x1465c3[_0x2fa3('0x30')]&&_0x1465c3[_0x2fa3('0x31')]){_0x5d8c3b[_0x1465c3[_0x2fa3('0x30')][_0x2fa3('0x2e')]()]=_0x1465c3[_0x2fa3('0x32')][_0x2fa3('0x2f')]();}else if(_0x1465c3[_0x2fa3('0x2c')]===_0x2fa3('0x33')&&_0x1465c3['variableName']&&_0x1465c3[_0x2fa3('0x30')]&&_0x1465c3[_0x2fa3('0x31')]){_0x5d8c3b[_0x1465c3[_0x2fa3('0x30')][_0x2fa3('0x2e')]()]=_0x4d41cb[_0x1465c3[_0x2fa3('0x34')]][_0x2fa3('0x2f')]();}else if(_0x1465c3[_0x2fa3('0x2c')]===_0x2fa3('0x35')&&_0x1465c3[_0x2fa3('0x36')]&&_0x1465c3[_0x2fa3('0x36')][_0x2fa3('0x37')]&&_0x1465c3[_0x2fa3('0x30')]&&_0x1465c3['customField']){_0x5d8c3b[_0x1465c3[_0x2fa3('0x30')]['toLowerCase']()]=_0x4d41cb[_0x1465c3['Variable'][_0x2fa3('0x37')][_0x2fa3('0x2e')]()]['toString']();}});}return _0x5d8c3b;}function getTicket(_0x5a1415,_0x30cc35,_0x473d9d,_0x12bdb7,_0x3015b9,_0x18efb8){return function(_0xfdf595){logger[_0x2fa3('0x11')]('['+[_0x5a1415['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0xfdf595);return new Promise(function(_0x1f688b,_0x2869f7){var _0x195ccc=_0x5a1415[_0x2fa3('0x2e')]()===_0x2fa3('0x38')?_0xfdf595[_0x2fa3('0x1e')]:_0xfdf595[_0x2fa3('0x26')];var _0x2f9dc9={'method':'POST','uri':_0x473d9d+'incident'+'?'+_0x18efb8,'body':Object[_0x2fa3('0x39')]({},{'active':_0x2fa3('0x1d'),'caller_id':_0x195ccc,'assigned_to':_0xfdf595[_0x2fa3('0x1e')],'short_description':intUtil[_0x2fa3('0x3a')](_0x12bdb7['Subjects'],_0x3015b9,'\x20'),'description':intUtil[_0x2fa3('0x3a')](_0x12bdb7[_0x2fa3('0x3b')],_0x3015b9,'\x0a')},getCustomFields(_0x12bdb7[_0x2fa3('0x3c')],_0x3015b9)),'auth':_0x30cc35,'json':!![]};return rp(_0x2f9dc9)[_0x2fa3('0xc')](function(_0x127f50){logger[_0x2fa3('0x11')]('['+[_0x5a1415[_0x2fa3('0x14')]()]+_0x2fa3('0x3d'),_0x127f50['result']);_0xfdf595[_0x2fa3('0x3e')]=_0x127f50[_0x2fa3('0xd')]['sys_id'];_0xfdf595[_0x2fa3('0x3f')]=_0x127f50['result'][_0x2fa3('0x40')];logger[_0x2fa3('0x11')]('['+[_0x5a1415[_0x2fa3('0x14')]()]+_0x2fa3('0x41'),_0xfdf595);_0x1f688b(_0xfdf595);})[_0x2fa3('0x12')](function(_0x76aa04){logger[_0x2fa3('0x13')]('['+[_0x5a1415[_0x2fa3('0x14')]()]+']',_0x76aa04['message']);_0x2869f7(_0x76aa04[_0x2fa3('0x15')]);});});};}function createRemoteTag(_0x36a55e,_0xe4310a,_0x47fb85,_0x3a3a56){return new Promise(function(_0x1c4efd,_0x326716){var _0x1c9f5a={'method':_0x2fa3('0x20'),'uri':_0x47fb85+_0x2fa3('0x42')+'?'+_0x3a3a56,'body':{'short_description':_0x36a55e,'global':!![],'active':!![],'name':_0x36a55e},'auth':_0xe4310a,'json':!![]};return rp(_0x1c9f5a)[_0x2fa3('0xc')](function(_0x57d90c){var _0x214b9a=_0x57d90c[_0x2fa3('0xd')]['sys_id'];_0x1c4efd(_0x214b9a);});});}function getRemoteTag(_0x5d7961,_0x5181c0,_0x4de899,_0x1a0079,_0x155068){return new Promise(function(_0x5a3505,_0x457832){var _0x6106aa={'method':'GET','uri':_0x4de899+_0x2fa3('0x42')+_0x2fa3('0x43')+_0x5d7961+'&'+_0x1a0079,'auth':_0x5181c0,'json':!![]};return rp(_0x6106aa)['then'](function(_0x3b8311){if(_0x3b8311[_0x2fa3('0xd')]['length']>0x0){var _0x3d5418=_0x3b8311[_0x2fa3('0xd')][0x0][_0x2fa3('0x10')];_0x5a3505(_0x3d5418);}else{return createRemoteTag(_0x5d7961,_0x5181c0,_0x4de899,_0x1a0079)[_0x2fa3('0xc')](function(_0x149648){_0x5a3505(_0x149648);});}});});}function assignTagToIncident(_0x247863,_0x279b3a,_0xae9299,_0x3be9e4,_0x15cdaa){return new Promise(function(_0x364686,_0x438d80){var _0x45c3b3={'method':_0x2fa3('0x20'),'uri':_0xae9299+'label_entry'+'?'+_0x15cdaa,'body':{'label':_0x247863,'table':'incident','id_type':_0x2fa3('0x44'),'table_key':_0x3be9e4['ticketId'],'title':'Incident\x20-\x20'+_0x3be9e4[_0x2fa3('0x3f')],'id_display':_0x3be9e4[_0x2fa3('0x3f')]},'auth':_0x279b3a,'json':!![]};return rp(_0x45c3b3)[_0x2fa3('0xc')](function(_0x58fe33){_0x364686();})[_0x2fa3('0x12')](function(){_0x364686();});});}function manageTags(_0x5bfa06,_0x1dd08a,_0x51818d,_0x30e8ee,_0x4e3fa1,_0x1eed79,_0x49b2ff){return new Promise(function(_0x328c92,_0x2a90a0){var _0x461eb2=[];_0x1dd08a[_0x2fa3('0x28')](function(_0x474245){_0x461eb2[_0x2fa3('0x45')](getRemoteTag(_0x474245,_0x51818d,_0x30e8ee,_0x1eed79,_0x49b2ff));});return Promise[_0x2fa3('0x46')](_0x461eb2)[_0x2fa3('0xc')](function(_0x3784c0){if(_0x3784c0[_0x2fa3('0xe')]){logger[_0x2fa3('0x11')]('['+[_0x5bfa06[_0x2fa3('0x14')]()]+_0x2fa3('0x47'),_0x3784c0);var _0x3673cb=[];_0x3784c0[_0x2fa3('0x28')](function(_0x54cc32){_0x3673cb[_0x2fa3('0x45')](assignTagToIncident(_0x54cc32,_0x51818d,_0x30e8ee,_0x4e3fa1,_0x1eed79));});return Promise[_0x2fa3('0x46')](_0x3673cb)[_0x2fa3('0xc')](function(){_0x328c92();})[_0x2fa3('0x12')](function(){_0x328c92();});}else{_0x328c92();}});});}function getTags(_0x3773b0,_0x183e14,_0x62dd61,_0x842aad,_0x419d42,_0x529a14){return function(_0x3b1871){return new Promise(function(_0x545871,_0x3f68ad){var _0x5881d6=[];var _0xa66c34=_0x842aad[_0x2fa3('0x48')];if(_0xa66c34&&_0xa66c34[_0x2fa3('0xe')]>0x0){_0x5881d6=_[_0x2fa3('0x49')](_0xa66c34,_0x2fa3('0x37'));}if(_0x5881d6[_0x2fa3('0xe')]>0x0){return manageTags(_0x3773b0,_0x5881d6,_0x183e14,_0x62dd61,_0x3b1871,_0x419d42,_0x529a14)[_0x2fa3('0xc')](function(){_0x545871(_0x3b1871);});}else{_0x545871(_0x3b1871);}});};}function emit(_0x51b827,_0xa0334f,_0x494e13){var _0x1d6622=_0x2fa3('0x4a')+_0x2fa3('0x4b')+_0x2fa3('0x4c')+_0x2fa3('0x4d');var _0x48e030={'uri':_0x51b827+_0x2fa3('0x4e')+_0x494e13+_0x1d6622};io['to'](util[_0x2fa3('0x4f')](_0x2fa3('0x50'),_0xa0334f))[_0x2fa3('0x51')](_0x2fa3('0x52'),_0x48e030);}exports['cs']=function(_0x3782e2,_0x1629d4,_0x26609a,_0x283d2a,_0xedd36e,_0x4244b2,_0x239f07,_0x1f0e69){var _0x2d6c44={};var _0x4436ce={'user':_0x4244b2['username'],'pass':_0x4244b2[_0x2fa3('0x53')]};var _0x42451d=_0x2fa3('0x54');var _0x15e568=_0x2fa3('0x55');_0x4244b2[_0x2fa3('0x56')]=intUtil[_0x2fa3('0x57')](_0x4244b2[_0x2fa3('0x56')]);_0x4244b2[_0x2fa3('0x58')]=intUtil[_0x2fa3('0x57')](_0x4244b2[_0x2fa3('0x58')]);var _0x2b55fc=util['format'](_0x2fa3('0x59'),_0x4244b2['remoteUri']);_0x2d6c44[_0x2fa3('0x18')]=!_[_0x2fa3('0x5a')](_0x283d2a)?_0x283d2a[_0x2fa3('0x5b')]:null;_0x2d6c44['adminEmail']=_0x4244b2[_0x2fa3('0x5b')];_0x2d6c44[_0x2fa3('0x22')]=_0x1f0e69[_0x2fa3('0x2e')]()===_0x2fa3('0x38')?_0x1629d4['destcalleridnum']:_0x1629d4[_0x2fa3('0x5c')];_0x2d6c44[_0x2fa3('0x5d')]=_0x1f0e69===_0x2fa3('0x5e')||_0x1f0e69===_0x2fa3('0x5f')?_0x2fa3('0x5e'):_0x2fa3('0x38');var _0x5ea60f=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4244b2[_0x2fa3('0x58')],_0x1629d4[_0x2fa3('0x60')],md5(_0x1629d4[_0x2fa3('0x60')]));if(_0xedd36e&&_0xedd36e[_0x2fa3('0x61')]){logger[_0x2fa3('0x11')](_0x2fa3('0x62'),_0x2fa3('0x63'));_0x1629d4['recordingURL']=_0x5ea60f;}else if(_0x239f07&&_0x239f07['recordingFormat']&&_0x239f07['recordingFormat']!==_0x2fa3('0x64')){logger[_0x2fa3('0x11')](_0x2fa3('0x65'),_0x2fa3('0x63'));_0x1629d4['recordingURL']=_0x5ea60f;}else{_0x1629d4[_0x2fa3('0x66')]='';}return getAdminUser(_0x1f0e69,_0x4436ce,_0x2d6c44,_0x2b55fc,_0x15e568,_0x42451d)[_0x2fa3('0xc')](getUser(_0x1f0e69,_0x4436ce,_0x2b55fc,_0x15e568,_0x42451d))[_0x2fa3('0xc')](getEndUser(_0x1f0e69,_0x4436ce,_0x2b55fc,_0x15e568,_0x42451d))['then'](getTicket(_0x1f0e69,_0x4436ce,_0x2b55fc,_0x26609a,_0x1629d4,_0x15e568))[_0x2fa3('0xc')](function(_0x19cfaa){logger['info'](util[_0x2fa3('0x4f')](_0x2fa3('0x67'),_0x19cfaa['ticketId']));logger[_0x2fa3('0x11')](util[_0x2fa3('0x4f')](_0x2fa3('0x68'),_0x1f0e69));if(_0x1f0e69!=='unmanaged'){logger['info']('['+[_0x1f0e69[_0x2fa3('0x14')]()]+']',_0x2fa3('0x69'));emit(_0x4244b2[_0x2fa3('0x56')],_0x283d2a[_0x2fa3('0x37')],_0x19cfaa['ticketId']);}})[_0x2fa3('0x12')](function(_0x39ce58){logger[_0x2fa3('0x13')]('['+[_0x1f0e69[_0x2fa3('0x14')]()]+_0x2fa3('0x6a'),util[_0x2fa3('0x6b')](_0x39ce58,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd0f3=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','length','active','userId','adminId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','content','toString','idField','toLowerCase','variableName','customVariable','Variable','name','POST','incident','assign','true','getString','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','all','push','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','emit','trigger:browser:url','sysparm_limit=1','stripTrailingSlash','serverUrl','%s/api/now/table/','email','outbound','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format'];(function(_0x3dd96a,_0x5551ed){var _0x41241b=function(_0x1d1a5e){while(--_0x1d1a5e){_0x3dd96a['push'](_0x3dd96a['shift']());}};_0x41241b(++_0x5551ed);}(_0xd0f3,0x142));var _0x3d0f=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xd0f3[_0x4327fe];return _0x138651;};'use strict';var _=require(_0x3d0f('0x0'));var Promise=require(_0x3d0f('0x1'));var rp=require('request-promise');var util=require(_0x3d0f('0x2'));var md5=require(_0x3d0f('0x3'));var Redis=require(_0x3d0f('0x4'));var intUtil=require(_0x3d0f('0x5'));var config=require(_0x3d0f('0x6'));var logger=require(_0x3d0f('0x7'))(_0x3d0f('0x8'));config[_0x3d0f('0x9')]=_[_0x3d0f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3d0f('0xb'))(new Redis(config[_0x3d0f('0x9')]));function getAdminUser(_0x50c109,_0x2c2dfd,_0x3877f6,_0x383d14,_0x2788e8,_0x507e1c){return new Promise(function(_0x3c81ef,_0x3cbc20){var _0x1fce42={'method':_0x3d0f('0xc'),'uri':_0x383d14+_0x3d0f('0xd')+'&'+_0x2788e8+'&'+_0x507e1c,'auth':_0x2c2dfd,'json':!![]};return rp(_0x1fce42)[_0x3d0f('0xe')](function(_0xe48083){if(_0xe48083[_0x3d0f('0xf')]['length']>0x0){_0x3877f6['adminId']=_0xe48083['result'][0x0][_0x3d0f('0x10')];}logger[_0x3d0f('0x11')]('['+[_0x50c109[_0x3d0f('0x12')]()]+_0x3d0f('0x13'),_0x3877f6);_0x3c81ef(_0x3877f6);})[_0x3d0f('0x14')](function(_0x136ce9){logger[_0x3d0f('0x15')]('['+[_0x50c109[_0x3d0f('0x12')]()]+']',_0x136ce9[_0x3d0f('0x16')]);_0x3cbc20(_0x136ce9[_0x3d0f('0x16')]);});});}function getUser(_0x571ad2,_0x163147,_0x276687,_0x1be55b,_0x249364){return function(_0x43a6f9){logger[_0x3d0f('0x11')]('['+[_0x571ad2[_0x3d0f('0x12')]()]+_0x3d0f('0x17'),_0x43a6f9);return new Promise(function(_0x5b80c4,_0x268a72){if(intUtil[_0x3d0f('0x18')](_0x43a6f9['userEmail'])){var _0x439911={'method':_0x3d0f('0xc'),'uri':_0x276687+_0x3d0f('0x19')+_0x43a6f9[_0x3d0f('0x1a')]+'&'+_0x1be55b+'&'+_0x249364,'auth':_0x163147,'json':!![]};logger[_0x3d0f('0x11')]('['+[_0x571ad2[_0x3d0f('0x12')]()]+_0x3d0f('0x1b'),_0x439911);return rp(_0x439911)[_0x3d0f('0xe')](function(_0x15745c){logger[_0x3d0f('0x11')]('['+[_0x571ad2[_0x3d0f('0x12')]()]+'],\x20getUser\x20entity',_0x15745c);if(_0x15745c[_0x3d0f('0xf')][_0x3d0f('0x1c')]>0x0&&String(_0x15745c['result'][0x0][_0x3d0f('0x1d')])==='true'){_0x43a6f9[_0x3d0f('0x1e')]=_0x15745c[_0x3d0f('0xf')][0x0]['sys_id'];}else{_0x43a6f9[_0x3d0f('0x1e')]=_0x43a6f9[_0x3d0f('0x1f')];_0x43a6f9[_0x3d0f('0x1a')]=_0x43a6f9[_0x3d0f('0x20')];}logger['info']('['+[_0x571ad2[_0x3d0f('0x12')]()]+'],\x20getUser\x20crm',_0x43a6f9);_0x5b80c4(_0x43a6f9);})[_0x3d0f('0x14')](function(_0x42621e){logger['error']('['+[_0x571ad2['toUpperCase']()]+']',_0x42621e['message']);_0x268a72(_0x42621e[_0x3d0f('0x16')]);});}else{logger[_0x3d0f('0x11')]('['+[_0x571ad2[_0x3d0f('0x12')]()]+_0x3d0f('0x21'));_0x43a6f9['userId']=_0x43a6f9[_0x3d0f('0x1f')];_0x43a6f9[_0x3d0f('0x1a')]=_0x43a6f9[_0x3d0f('0x20')];_0x5b80c4(_0x43a6f9);}});};}function createEndUser(_0x1ef123,_0xea6bea,_0x20d65e,_0x43f847,_0xb3280e){logger[_0x3d0f('0x11')]('['+[_0x1ef123[_0x3d0f('0x12')]()]+_0x3d0f('0x22'),_0x20d65e);return new Promise(function(_0x84cc82,_0x504528){var _0x1cfd97={'method':'POST','uri':_0x43f847+'sys_user?'+_0xb3280e,'body':{'user_name':_0x20d65e['endUserNumber'],'roles':_0x3d0f('0x23'),'first_name':_0x20d65e[_0x3d0f('0x24')],'active':'true','date_format':_0x3d0f('0x25'),'phone':_0x20d65e[_0x3d0f('0x24')]},'auth':_0xea6bea,'json':!![]};return rp(_0x1cfd97)[_0x3d0f('0xe')](function(_0x3af06d){logger[_0x3d0f('0x11')]('['+[_0x1ef123[_0x3d0f('0x12')]()]+_0x3d0f('0x26'),_0x3af06d[_0x3d0f('0xf')]);_0x20d65e[_0x3d0f('0x27')]=_0x3af06d[_0x3d0f('0xf')][_0x3d0f('0x10')];_0x84cc82(_0x20d65e);})[_0x3d0f('0x14')](function(_0x4792cc){logger[_0x3d0f('0x15')]('['+[_0x1ef123[_0x3d0f('0x12')]()]+']',_0x4792cc[_0x3d0f('0x16')]);_0x504528(_0x4792cc[_0x3d0f('0x16')]);});});}function getEndUser(_0x17000a,_0x28350f,_0x17ee0b,_0xaef9de,_0x32bb05){return function(_0x21cf08){logger[_0x3d0f('0x11')]('['+[_0x17000a[_0x3d0f('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x21cf08);return new Promise(function(_0xa3ea24,_0x34e693){var _0x3af680={'method':_0x3d0f('0xc'),'uri':_0x17ee0b+'sys_user?sysparm_query=phone%3D'+_0x21cf08[_0x3d0f('0x24')]+'&'+_0xaef9de+'&'+_0x32bb05,'auth':_0x28350f,'json':!![]};return rp(_0x3af680)[_0x3d0f('0xe')](function(_0x28a30e){if(_0x28a30e[_0x3d0f('0xf')][_0x3d0f('0x1c')]>0x0){_0x21cf08[_0x3d0f('0x27')]=_0x28a30e['result'][0x0][_0x3d0f('0x10')];logger[_0x3d0f('0x11')]('['+[_0x17000a[_0x3d0f('0x12')]()]+_0x3d0f('0x28'),_0x21cf08);_0xa3ea24(_0x21cf08);}else{return createEndUser(_0x17000a,_0x28350f,_0x21cf08,_0x17ee0b,_0xaef9de)[_0x3d0f('0xe')](function(_0x5e3680){logger[_0x3d0f('0x11')]('['+[_0x17000a[_0x3d0f('0x12')]()]+_0x3d0f('0x29'),_0x5e3680);_0xa3ea24(_0x5e3680);});}})['catch'](function(_0x240db8){logger[_0x3d0f('0x15')]('['+[_0x17000a['toUpperCase']()]+']',_0x240db8['message']);_0x34e693(_0x240db8[_0x3d0f('0x16')]);});});};}function getCustomFields(_0x63fd38,_0x1edb60){var _0x157ed3={};if(_0x63fd38['length']>0x0){_[_0x3d0f('0x2a')](_0x63fd38,function(_0x29db8d){if(_[_0x3d0f('0x2b')]([_0x3d0f('0x2c'),_0x3d0f('0x2d')],_0x29db8d[_0x3d0f('0x2e')])&&_0x29db8d[_0x3d0f('0x2f')]&&!_0x29db8d[_0x3d0f('0x30')]){_0x157ed3[_0x29db8d[_0x3d0f('0x2f')]['toLowerCase']()]=_0x29db8d[_0x3d0f('0x31')][_0x3d0f('0x32')]();}else if(_['includes']([_0x3d0f('0x2c'),_0x3d0f('0x2d')],_0x29db8d[_0x3d0f('0x2e')])&&_0x29db8d[_0x3d0f('0x33')]&&_0x29db8d[_0x3d0f('0x30')]){_0x157ed3[_0x29db8d['idField'][_0x3d0f('0x34')]()]=_0x29db8d[_0x3d0f('0x31')][_0x3d0f('0x32')]();}else if(_0x29db8d[_0x3d0f('0x2e')]==='variable'&&_0x29db8d[_0x3d0f('0x35')]&&_0x29db8d[_0x3d0f('0x33')]&&_0x29db8d[_0x3d0f('0x30')]){_0x157ed3[_0x29db8d[_0x3d0f('0x33')][_0x3d0f('0x34')]()]=_0x1edb60[_0x29db8d[_0x3d0f('0x35')]][_0x3d0f('0x32')]();}else if(_0x29db8d[_0x3d0f('0x2e')]===_0x3d0f('0x36')&&_0x29db8d[_0x3d0f('0x37')]&&_0x29db8d['Variable'][_0x3d0f('0x38')]&&_0x29db8d[_0x3d0f('0x33')]&&_0x29db8d[_0x3d0f('0x30')]){_0x157ed3[_0x29db8d[_0x3d0f('0x33')][_0x3d0f('0x34')]()]=_0x1edb60[_0x29db8d[_0x3d0f('0x37')][_0x3d0f('0x38')][_0x3d0f('0x34')]()]['toString']();}});}return _0x157ed3;}function getTicket(_0x4f7604,_0x1b624a,_0x44cc04,_0x77b41a,_0x389c26,_0x1e0511){return function(_0x313453){logger[_0x3d0f('0x11')]('['+[_0x4f7604[_0x3d0f('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x313453);return new Promise(function(_0x3bf687,_0x34d87d){var _0x46f37f=_0x4f7604[_0x3d0f('0x34')]()==='outbound'?_0x313453[_0x3d0f('0x1e')]:_0x313453[_0x3d0f('0x27')];var _0x237baa={'method':_0x3d0f('0x39'),'uri':_0x44cc04+_0x3d0f('0x3a')+'?'+_0x1e0511,'body':Object[_0x3d0f('0x3b')]({},{'active':_0x3d0f('0x3c'),'caller_id':_0x46f37f,'assigned_to':_0x313453['userId'],'short_description':intUtil[_0x3d0f('0x3d')](_0x77b41a['Subjects'],_0x389c26,'\x20'),'description':intUtil[_0x3d0f('0x3d')](_0x77b41a[_0x3d0f('0x3e')],_0x389c26,'\x0a')},getCustomFields(_0x77b41a[_0x3d0f('0x3f')],_0x389c26)),'auth':_0x1b624a,'json':!![]};return rp(_0x237baa)['then'](function(_0x115e5f){logger[_0x3d0f('0x11')]('['+[_0x4f7604['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x115e5f[_0x3d0f('0xf')]);_0x313453[_0x3d0f('0x40')]=_0x115e5f[_0x3d0f('0xf')][_0x3d0f('0x10')];_0x313453[_0x3d0f('0x41')]=_0x115e5f[_0x3d0f('0xf')][_0x3d0f('0x42')];logger['info']('['+[_0x4f7604['toUpperCase']()]+_0x3d0f('0x43'),_0x313453);_0x3bf687(_0x313453);})[_0x3d0f('0x14')](function(_0x28ce29){logger[_0x3d0f('0x15')]('['+[_0x4f7604[_0x3d0f('0x12')]()]+']',_0x28ce29[_0x3d0f('0x16')]);_0x34d87d(_0x28ce29[_0x3d0f('0x16')]);});});};}function createRemoteTag(_0x437781,_0x53ddf5,_0x2f3b69,_0x34bf59){return new Promise(function(_0x5e3826,_0x3c5366){var _0x5322fe={'method':'POST','uri':_0x2f3b69+_0x3d0f('0x44')+'?'+_0x34bf59,'body':{'short_description':_0x437781,'global':!![],'active':!![],'name':_0x437781},'auth':_0x53ddf5,'json':!![]};return rp(_0x5322fe)[_0x3d0f('0xe')](function(_0x2bff17){var _0x2d8e45=_0x2bff17[_0x3d0f('0xf')][_0x3d0f('0x10')];_0x5e3826(_0x2d8e45);});});}function getRemoteTag(_0x2bf48c,_0x2ac1be,_0x306f04,_0x2d7f78,_0x5c2b3b){return new Promise(function(_0x27a657,_0x35fd33){var _0x73ef06={'method':_0x3d0f('0xc'),'uri':_0x306f04+_0x3d0f('0x44')+_0x3d0f('0x45')+_0x2bf48c+'&'+_0x2d7f78,'auth':_0x2ac1be,'json':!![]};return rp(_0x73ef06)[_0x3d0f('0xe')](function(_0x40df84){if(_0x40df84[_0x3d0f('0xf')][_0x3d0f('0x1c')]>0x0){var _0x351fe4=_0x40df84[_0x3d0f('0xf')][0x0]['sys_id'];_0x27a657(_0x351fe4);}else{return createRemoteTag(_0x2bf48c,_0x2ac1be,_0x306f04,_0x2d7f78)[_0x3d0f('0xe')](function(_0x45fe34){_0x27a657(_0x45fe34);});}});});}function assignTagToIncident(_0x33deef,_0x437d62,_0x380c0d,_0x293e02,_0x58f0b3){return new Promise(function(_0x11e951,_0x2dd596){var _0x325a10={'method':_0x3d0f('0x39'),'uri':_0x380c0d+'label_entry'+'?'+_0x58f0b3,'body':{'label':_0x33deef,'table':_0x3d0f('0x3a'),'id_type':_0x3d0f('0x46'),'table_key':_0x293e02[_0x3d0f('0x40')],'title':'Incident\x20-\x20'+_0x293e02[_0x3d0f('0x41')],'id_display':_0x293e02[_0x3d0f('0x41')]},'auth':_0x437d62,'json':!![]};return rp(_0x325a10)[_0x3d0f('0xe')](function(_0x1336e2){_0x11e951();})['catch'](function(){_0x11e951();});});}function manageTags(_0x9ca722,_0x51dfdb,_0x44858a,_0x3f7fdf,_0xb40ee,_0x2ec4ff,_0x57c4b9){return new Promise(function(_0x5dc64d,_0x4e0aca){var _0x13cb12=[];_0x51dfdb[_0x3d0f('0x2a')](function(_0x31f652){_0x13cb12['push'](getRemoteTag(_0x31f652,_0x44858a,_0x3f7fdf,_0x2ec4ff,_0x57c4b9));});return Promise[_0x3d0f('0x47')](_0x13cb12)[_0x3d0f('0xe')](function(_0xd0102){if(_0xd0102[_0x3d0f('0x1c')]){logger[_0x3d0f('0x11')]('['+[_0x9ca722[_0x3d0f('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xd0102);var _0x54c309=[];_0xd0102[_0x3d0f('0x2a')](function(_0x3abee5){_0x54c309[_0x3d0f('0x48')](assignTagToIncident(_0x3abee5,_0x44858a,_0x3f7fdf,_0xb40ee,_0x2ec4ff));});return Promise['all'](_0x54c309)[_0x3d0f('0xe')](function(){_0x5dc64d();})[_0x3d0f('0x14')](function(){_0x5dc64d();});}else{_0x5dc64d();}});});}function getTags(_0x38087c,_0x35d313,_0x5223ba,_0x3c7f64,_0x545c91,_0x9ac474){return function(_0x4f4b9a){return new Promise(function(_0x213dde,_0x2592dc){var _0x1e6425=[];var _0x21e5d0=_0x3c7f64['Tags'];if(_0x21e5d0&&_0x21e5d0[_0x3d0f('0x1c')]>0x0){_0x1e6425=_[_0x3d0f('0x49')](_0x21e5d0,'name');}if(_0x1e6425[_0x3d0f('0x1c')]>0x0){return manageTags(_0x38087c,_0x1e6425,_0x35d313,_0x5223ba,_0x4f4b9a,_0x545c91,_0x9ac474)[_0x3d0f('0xe')](function(){_0x213dde(_0x4f4b9a);});}else{_0x213dde(_0x4f4b9a);}});};}function emit(_0x2fffc8,_0x51d3ff,_0x1f9477){var _0x4b32c1=_0x3d0f('0x4a')+_0x3d0f('0x4b')+_0x3d0f('0x4c')+_0x3d0f('0x4d');var _0x552eae={'uri':_0x2fffc8+_0x3d0f('0x4e')+_0x1f9477+_0x4b32c1};io['to'](util[_0x3d0f('0x4f')]('user:%s',_0x51d3ff))[_0x3d0f('0x50')](_0x3d0f('0x51'),_0x552eae);}exports['cs']=function(_0x3c0dfa,_0x6612cc,_0x216578,_0x45e036,_0x1bdd05,_0x2980fc,_0x4a4d58,_0x51121b){var _0x4e0566={};var _0x19ce11={'user':_0x2980fc['username'],'pass':_0x2980fc['password']};var _0x50521b=_0x3d0f('0x52');var _0x4449f8='sysparm_display_value=true';_0x2980fc['remoteUri']=intUtil[_0x3d0f('0x53')](_0x2980fc['remoteUri']);_0x2980fc[_0x3d0f('0x54')]=intUtil[_0x3d0f('0x53')](_0x2980fc[_0x3d0f('0x54')]);var _0x32eeeb=util[_0x3d0f('0x4f')](_0x3d0f('0x55'),_0x2980fc['remoteUri']);_0x4e0566[_0x3d0f('0x1a')]=!_['isNil'](_0x45e036)?_0x45e036['email']:null;_0x4e0566[_0x3d0f('0x20')]=_0x2980fc[_0x3d0f('0x56')];_0x4e0566[_0x3d0f('0x24')]=_0x51121b[_0x3d0f('0x34')]()===_0x3d0f('0x57')?_0x6612cc[_0x3d0f('0x58')]:_0x6612cc['calleridnum'];_0x4e0566[_0x3d0f('0x59')]=_0x51121b===_0x3d0f('0x5a')||_0x51121b==='unmanaged'?_0x3d0f('0x5a'):'outbound';var _0x50e52b=util[_0x3d0f('0x4f')](_0x3d0f('0x5b'),_0x2980fc[_0x3d0f('0x54')],_0x6612cc[_0x3d0f('0x5c')],md5(_0x6612cc[_0x3d0f('0x5c')]));if(_0x1bdd05&&_0x1bdd05[_0x3d0f('0x5d')]){logger[_0x3d0f('0x11')](_0x3d0f('0x5e'),_0x3d0f('0x5f'));_0x6612cc[_0x3d0f('0x60')]=_0x50e52b;}else if(_0x4a4d58&&_0x4a4d58[_0x3d0f('0x61')]&&_0x4a4d58['recordingFormat']!==_0x3d0f('0x62')){logger[_0x3d0f('0x11')](_0x3d0f('0x63'),_0x3d0f('0x5f'));_0x6612cc[_0x3d0f('0x60')]=_0x50e52b;}else{_0x6612cc['recordingURL']='';}return getAdminUser(_0x51121b,_0x19ce11,_0x4e0566,_0x32eeeb,_0x4449f8,_0x50521b)[_0x3d0f('0xe')](getUser(_0x51121b,_0x19ce11,_0x32eeeb,_0x4449f8,_0x50521b))[_0x3d0f('0xe')](getEndUser(_0x51121b,_0x19ce11,_0x32eeeb,_0x4449f8,_0x50521b))[_0x3d0f('0xe')](getTicket(_0x51121b,_0x19ce11,_0x32eeeb,_0x216578,_0x6612cc,_0x4449f8))[_0x3d0f('0xe')](function(_0x3948b3){logger['info'](util['format'](_0x3d0f('0x64'),_0x3948b3['ticketId']));logger['info'](util[_0x3d0f('0x4f')]('call\x20direction:\x20%s',_0x51121b));if(_0x51121b!==_0x3d0f('0x65')){logger[_0x3d0f('0x11')]('['+[_0x51121b[_0x3d0f('0x12')]()]+']',_0x3d0f('0x66'));emit(_0x2980fc['remoteUri'],_0x45e036[_0x3d0f('0x38')],_0x3948b3[_0x3d0f('0x40')]);}})[_0x3d0f('0x14')](function(_0x102c91){logger['error']('['+[_0x51121b[_0x3d0f('0x12')]()]+_0x3d0f('0x67'),util['inspect'](_0x102c91,{'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 a18fd0d..1c052d3 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 _0xcac5=['Variable','toLowerCase','POST','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','contacts','unmanaged','toUpperCase','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','customField','content','type','custom_fields','variable','variableName'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0xcac5,0x1a9));var _0x5cac=function(_0xdbe9a4,_0x1dd8ea){_0xdbe9a4=_0xdbe9a4-0x0;var _0x22c2ed=_0xcac5[_0xdbe9a4];return _0x22c2ed;};'use strict';var _=require(_0x5cac('0x0'));var rp=require(_0x5cac('0x1'));var BPromise=require(_0x5cac('0x2'));var md5=require(_0x5cac('0x3'));var util=require(_0x5cac('0x4'));var Redis=require(_0x5cac('0x5'));var intUtil=require(_0x5cac('0x6'));var config=require(_0x5cac('0x7'));var logger=require('../../../../config/logger')(_0x5cac('0x8'));config[_0x5cac('0x9')]=_[_0x5cac('0xa')](config[_0x5cac('0x9')],{'host':_0x5cac('0xb'),'port':0x18eb});var io=require(_0x5cac('0xc'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x58bc00,_0x3b5eed,_0x4ca0f0){io['to'](_0x58bc00)[_0x5cac('0xd')](_0x3b5eed,_0x4ca0f0);}function getTicket(_0x2b271c,_0x4c0548,_0x55057e,_0x3099b5,_0x1bb144,_0x1860ba,_0x352404,_0x2f9708){logger[_0x5cac('0xe')](_0x5cac('0xf'));var _0x523b7f=new Date();var _0x1ccb69=[{'name':_0x5cac('0x10'),'value':intUtil[_0x5cac('0x11')](_0x3099b5[_0x5cac('0x12')],_0x1bb144,'\x20')},{'name':'assigned_user_id','value':_0x4c0548['id']},{'name':'created_by','value':_0x4c0548['id']},{'name':'description','value':intUtil['getString'](_0x3099b5[_0x5cac('0x13')],_0x1bb144,'\x0a')},{'name':_0x5cac('0x14'),'value':_0x523b7f[_0x5cac('0x15')]()['slice'](0x0,0x13)[_0x5cac('0x16')]('T','\x20')},{'name':_0x5cac('0x17'),'value':'0'},{'name':_0x5cac('0x18'),'value':'15'},{'name':'parent_id','value':_0x55057e['id']},{'name':_0x5cac('0x19'),'value':_0x5cac('0x1a')},{'name':_0x5cac('0x1b'),'value':_0x55057e[_0x5cac('0x10')]},{'name':_0x5cac('0x1c'),'value':_0x2f9708}];if(_0x1860ba[_0x5cac('0x1d')]){_[_0x5cac('0x1e')](_0x1860ba,function(_0x3bb9a4){if(_0x1bb144[_0x3bb9a4['variableName']]){_0x1ccb69[_0x5cac('0x1f')]({'name':_0x3bb9a4[_0x5cac('0x20')],'value':_0x1bb144[_0x3bb9a4['variableName']]});}});}return request({'form':{'method':_0x5cac('0x21'),'input_type':_0x5cac('0x22'),'response_type':_0x5cac('0x22'),'rest_data':JSON[_0x5cac('0x23')]({'session':_0x352404['id'],'module_name':_0x5cac('0x24'),'name_value_list':_0x1ccb69})}});}function getAuth(_0x98eaf7){return util[_0x5cac('0x25')](_0x5cac('0x26'),new Buffer(_0x98eaf7[_0x5cac('0x27')]+':X')[_0x5cac('0x28')](_0x5cac('0x29')));}function getServerInfo(_0x425e7d){return request({'form':{'method':_0x5cac('0x2a'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x5cac('0x23')]({'session':_0x425e7d['id']})}});}function getUser(_0x395121,_0xdd6924,_0x4fcc82){if(!_[_0x5cac('0x2b')](_0xdd6924)){logger[_0x5cac('0xe')]('Getting\x20agent\x20with\x20name',_0xdd6924);return request({'form':{'method':_0x5cac('0x2c'),'input_type':'JSON','response_type':_0x5cac('0x22'),'rest_data':JSON[_0x5cac('0x23')]({'session':_0x4fcc82['id'],'module_name':_0x5cac('0x2d'),'query':util['format'](_0x5cac('0x2e'),_0xdd6924),'order_by':'','offset':'0','select_fields':['id',_0x5cac('0x10'),_0x5cac('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5cac('0x30')](function(_0x3dfdc4){if(_0x3dfdc4[_0x5cac('0x31')][_0x5cac('0x1d')]){var _0x11fd35=_[_0x5cac('0x32')](_0x3dfdc4[_0x5cac('0x31')],function(_0x45b337){return _0x45b337[_0x5cac('0x33')]['user_name']['value']===_0xdd6924;});if(_0x11fd35){logger[_0x5cac('0xe')](_0x5cac('0x34'));return BPromise[_0x5cac('0x35')]({'id':_0x11fd35['name_value_list']['id']['value'],'name':_0x11fd35[_0x5cac('0x33')][_0x5cac('0x10')][_0x5cac('0x36')]});}}logger['info'](_0x5cac('0x37'));return BPromise[_0x5cac('0x35')]({'id':_0x4fcc82[_0x5cac('0x33')]['user_id'][_0x5cac('0x36')],'name':_0x4fcc82[_0x5cac('0x33')]['user_name'][_0x5cac('0x36')]});});}else{logger[_0x5cac('0xe')](_0x5cac('0x38'));return BPromise['resolve']({'id':_0x4fcc82['name_value_list']['user_id'][_0x5cac('0x36')],'name':_0x4fcc82[_0x5cac('0x33')][_0x5cac('0x2f')][_0x5cac('0x36')]});}}function getEndUser(_0x328d9d,_0x591e30,_0x1dba26,_0xa9dd1){logger[_0x5cac('0xe')](_0x5cac('0x39'),_0x1dba26);return request({'form':{'method':'get_entry_list','input_type':_0x5cac('0x22'),'response_type':'JSON','rest_data':JSON[_0x5cac('0x23')]({'session':_0xa9dd1['id'],'module_name':_0x5cac('0x1a'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x1dba26),'order_by':'','offset':'0','select_fields':['id',_0x5cac('0x10'),_0x5cac('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5cac('0x30')](function(_0x29b2b8){if(_0x29b2b8['entry_list'][_0x5cac('0x1d')]){var _0x462f06=_[_0x5cac('0x32')](_0x29b2b8[_0x5cac('0x31')],function(_0x3f74ad){return _0x3f74ad[_0x5cac('0x33')][_0x5cac('0x3a')][_0x5cac('0x36')]===_0x1dba26;});if(_0x462f06){logger[_0x5cac('0xe')](_0x5cac('0x3b'));return BPromise[_0x5cac('0x35')]({'id':_0x462f06[_0x5cac('0x33')]['id'][_0x5cac('0x36')],'name':_0x462f06[_0x5cac('0x33')][_0x5cac('0x10')]['value'],'phone':_0x462f06[_0x5cac('0x33')]['phone_home'][_0x5cac('0x36')]});}}else{logger['info'](_0x5cac('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x5cac('0x22'),'response_type':_0x5cac('0x22'),'rest_data':JSON['stringify']({'session':_0xa9dd1['id'],'module_name':_0x5cac('0x1a'),'name_value_list':[{'name':_0x5cac('0x3d'),'value':_0x591e30!==''?_0x591e30:util['format'](_0x5cac('0x3e'),_0x1dba26)},{'name':_0x5cac('0x3a'),'value':_0x1dba26}]})}})[_0x5cac('0x30')](function(_0x5e3cd0){logger[_0x5cac('0xe')](_0x5cac('0x3f'));return BPromise[_0x5cac('0x35')]({'id':_0x5e3cd0['id'],'name':_0x5e3cd0[_0x5cac('0x31')][_0x5cac('0x3d')][_0x5cac('0x36')],'phone':_0x5e3cd0['entry_list'][_0x5cac('0x3a')]['value']});});}});}function request(_0x6f53e6){logger[_0x5cac('0x40')](_0x5cac('0x41'),JSON[_0x5cac('0x23')](_0x6f53e6));return rp(_[_0x5cac('0x42')](def,_0x6f53e6));}function getTags(_0x41d049,_0x512b13){var _0x2d9000=[];if(_0x41d049&&_0x41d049['length']>0x0){_0x2d9000=_[_0x5cac('0x43')](_0x41d049,_0x512b13);}return _0x2d9000;}function getCustomFields(_0x28dd83,_0x2b6355){var _0x52d834=[];var _0x3a3046={'custom_fields':[]};if(_0x28dd83['length']>0x0){_['forEach'](_0x28dd83,function(_0x3ff8ae){if(_0x3ff8ae['type']===_0x5cac('0x44')&&_0x3ff8ae['nameField']&&!_0x3ff8ae[_0x5cac('0x45')]){_0x3a3046[_0x3ff8ae['nameField']['toLowerCase']()]=_0x3ff8ae[_0x5cac('0x46')][_0x5cac('0x28')]();}else if(_0x3ff8ae[_0x5cac('0x47')]===_0x5cac('0x44')&&_0x3ff8ae[_0x5cac('0x20')]&&_0x3ff8ae[_0x5cac('0x45')]){_0x3a3046[_0x5cac('0x48')][_0x5cac('0x1f')]({'id':_0x3ff8ae['idField'],'value':_0x3ff8ae[_0x5cac('0x46')][_0x5cac('0x28')]()});}else if(_0x3ff8ae['type']===_0x5cac('0x49')&&_0x3ff8ae[_0x5cac('0x4a')]&&_0x3ff8ae[_0x5cac('0x20')]&&_0x3ff8ae[_0x5cac('0x45')]){_0x2b6355[_0x3ff8ae['variableName']]&&_0x3a3046[_0x5cac('0x48')]['push']({'id':_0x3ff8ae[_0x5cac('0x20')],'value':_0x2b6355[_0x3ff8ae['variableName']][_0x5cac('0x28')]()});}else if(_0x3ff8ae['type']==='customVariable'&&_0x3ff8ae[_0x5cac('0x4b')]&&_0x3ff8ae[_0x5cac('0x4b')][_0x5cac('0x10')]&&_0x3ff8ae[_0x5cac('0x20')]&&_0x3ff8ae[_0x5cac('0x45')]){_0x2b6355[_0x3ff8ae['Variable'][_0x5cac('0x10')][_0x5cac('0x4c')]()]&&_0x3a3046[_0x5cac('0x48')][_0x5cac('0x1f')]({'id':_0x3ff8ae[_0x5cac('0x20')],'value':_0x2b6355[_0x3ff8ae[_0x5cac('0x4b')][_0x5cac('0x10')][_0x5cac('0x4c')]()][_0x5cac('0x28')]()});}});}return _0x3a3046;}function getConnection(_0x3df386){return request({'method':_0x5cac('0x4d'),'form':{'method':_0x5cac('0x4e'),'input_type':_0x5cac('0x22'),'response_type':_0x5cac('0x22'),'rest_data':JSON[_0x5cac('0x23')]({'user_auth':{'user_name':_0x3df386[_0x5cac('0x4f')],'password':_0x3df386['password'],'encryption':_0x5cac('0x50')},'application':_0x5cac('0x51')})}})[_0x5cac('0x30')](function(_0x5f1db3){var _0x514349=_0x5f1db3;if(_0x514349['id']){def[_0x5cac('0x52')]=_0x514349['id'];return BPromise[_0x5cac('0x35')](_0x514349);}else{throw new Error(util['format'](_0x5cac('0x53'),_0x3df386['id']));}});}function setRelationship(_0x11e2ff,_0x1cfb50,_0x6eaa52,_0x476634){return request({'form':{'method':'set_relationship','input_type':_0x5cac('0x22'),'response_type':_0x5cac('0x22'),'rest_data':JSON[_0x5cac('0x23')]({'session':_0x11e2ff['id'],'module_name':'Calls','module_id':_0x6eaa52['id'],'link_field_name':_0x476634,'related_ids':[_0x1cfb50['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5cac('0x54')]=function(_0x28e1c5,_0x45d955,_0x58152c,_0x33deb3,_0x4138e3,_0x4c3069){var _0xdb9cd,_0x33fc39,_0x1e7487,_0x3a62df;_0x4c3069[_0x5cac('0x55')]=intUtil['stripTrailingSlash'](_0x4c3069['remoteUri']);_0x4c3069[_0x5cac('0x56')]=intUtil[_0x5cac('0x57')](_0x4c3069[_0x5cac('0x56')]);def['uri']=util['format'](_0x5cac('0x58'),_0x4c3069[_0x5cac('0x55')]);if(_0x4138e3&&_0x4138e3[_0x5cac('0x59')]){logger[_0x5cac('0xe')](_0x5cac('0x5a'),_0x5cac('0x5b'));_0x45d955[_0x5cac('0x5c')]=util[_0x5cac('0x25')](_0x5cac('0x5d'),_0x4c3069[_0x5cac('0x56')],_0x45d955[_0x5cac('0x5e')],md5(_0x45d955[_0x5cac('0x5e')]));}else{_0x45d955[_0x5cac('0x5c')]='';}return getConnection(_0x4c3069)[_0x5cac('0x30')](function(_0x5c547f){_0x3a62df=_0x5c547f;return getUser(_0x4c3069,_0x33deb3[_0x5cac('0x10')],_0x3a62df);})[_0x5cac('0x30')](function(_0x1f230a){_0xdb9cd=_0x1f230a;logger[_0x5cac('0xe')](_0x5cac('0x5f'),_0xdb9cd['id']);return getEndUser(_0x4c3069,_0x45d955[_0x5cac('0x60')],_0x45d955[_0x5cac('0x61')],_0x3a62df);})[_0x5cac('0x30')](function(_0x54e59a){_0x33fc39=_0x54e59a;logger[_0x5cac('0xe')](_0x5cac('0x62'),_0x33fc39['id']);return getTicket(_0x4c3069,_0xdb9cd,_0x33fc39,_0x58152c,_0x45d955,_0x58152c[_0x5cac('0x63')],_0x3a62df,_0x5cac('0x64'));})[_0x5cac('0x30')](function(_0x1dd346){_0x1e7487=_0x1dd346;logger[_0x5cac('0xe')](_0x5cac('0x65'));logger['info'](_0x5cac('0x66'),_0x1e7487['id']);return setRelationship(_0x3a62df,_0xdb9cd,_0x1e7487,_0x5cac('0x67'));})[_0x5cac('0x30')](function(){return setRelationship(_0x3a62df,_0x33fc39,_0x1e7487,'contacts');})[_0x5cac('0x30')](function(){return getServerInfo(_0x3a62df);})[_0x5cac('0x30')](function(_0x4804a0){var _0x46c846=parseInt(_0x4804a0[_0x5cac('0x68')][_0x5cac('0x69')](0x0));var _0x4917ff=util[_0x5cac('0x25')](_0x5cac('0x6a'),_0x4c3069['remoteUri'],_0x1e7487['id']);if(_0x46c846>0x6){_0x4917ff=util['format'](_0x5cac('0x6b'),_0x4c3069['remoteUri'],_0x1e7487['id']);}logger[_0x5cac('0xe')]('[QUEUE]',_0x5cac('0x6c'));emit(util['format'](_0x5cac('0x6d'),_0x33deb3['name']),_0x5cac('0x6e'),{'uri':_0x4917ff});})[_0x5cac('0x6f')](function(_0x525001){logger[_0x5cac('0x70')]('[QUEUE]',JSON[_0x5cac('0x23')](_0x525001));});};exports[_0x5cac('0x71')]=function(_0x5a9ed1,_0x514afa,_0x23be81,_0x486f52,_0x50122a,_0xc3d966,_0x164240){var _0x455e4d,_0x3164d8,_0x1a71dd,_0x2329fd;_0xc3d966[_0x5cac('0x55')]=intUtil[_0x5cac('0x57')](_0xc3d966[_0x5cac('0x55')]);_0xc3d966[_0x5cac('0x56')]=intUtil[_0x5cac('0x57')](_0xc3d966[_0x5cac('0x56')]);def[_0x5cac('0x72')]=util['format'](_0x5cac('0x58'),_0xc3d966[_0x5cac('0x55')]);if(_0x164240&&_0x164240[_0x5cac('0x73')]&&_0x164240['recordingFormat']!==_0x5cac('0x74')){logger[_0x5cac('0xe')](_0x5cac('0x75'),_0x5cac('0x5b'));_0x514afa[_0x5cac('0x5c')]=util[_0x5cac('0x25')](_0x5cac('0x5d'),_0xc3d966[_0x5cac('0x56')],_0x514afa[_0x5cac('0x5e')],md5(_0x514afa[_0x5cac('0x5e')]));}return getConnection(_0xc3d966)['then'](function(_0x157110){_0x2329fd=_0x157110;return getUser(_0xc3d966,_0x486f52[_0x5cac('0x10')],_0x2329fd);})[_0x5cac('0x30')](function(_0x1f8593){_0x455e4d=_0x1f8593;logger['info'](_0x5cac('0x5f'),_0x455e4d['id']);return getEndUser(_0xc3d966,_0x514afa[_0x5cac('0x76')],_0x514afa[_0x5cac('0x77')],_0x2329fd);})[_0x5cac('0x30')](function(_0x39ed53){_0x3164d8=_0x39ed53;logger[_0x5cac('0xe')](_0x5cac('0x62'),_0x3164d8['id']);return getTicket(_0xc3d966,_0x455e4d,_0x3164d8,_0x23be81,_0x514afa,_0x23be81[_0x5cac('0x63')],_0x2329fd,_0x5cac('0x78'));})[_0x5cac('0x30')](function(_0x2e1c2f){_0x1a71dd=_0x2e1c2f;logger[_0x5cac('0xe')](_0x5cac('0x65'));logger['info'](_0x5cac('0x66'),_0x1a71dd['id']);return setRelationship(_0x2329fd,_0x455e4d,_0x1a71dd,_0x5cac('0x67'));})[_0x5cac('0x30')](function(){return setRelationship(_0x2329fd,_0x3164d8,_0x1a71dd,_0x5cac('0x79'));})[_0x5cac('0x30')](function(){return getServerInfo(_0x2329fd);})[_0x5cac('0x30')](function(_0x3edbca){var _0x48103b=parseInt(_0x3edbca[_0x5cac('0x68')]['charAt'](0x0));var _0x3f2a09=util['format'](_0x5cac('0x6a'),_0xc3d966[_0x5cac('0x55')],_0x1a71dd['id']);if(_0x48103b>0x6){_0x3f2a09=util[_0x5cac('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xc3d966[_0x5cac('0x55')],_0x1a71dd['id']);}logger[_0x5cac('0xe')](_0x5cac('0x75'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5cac('0x25')](_0x5cac('0x6d'),_0x486f52[_0x5cac('0x10')]),_0x5cac('0x6e'),{'uri':_0x3f2a09});})[_0x5cac('0x6f')](function(_0x51ec07){logger['error'](_0x5cac('0x75'),JSON[_0x5cac('0x23')](_0x51ec07));});};exports[_0x5cac('0x7a')]=function(_0x27f1ad,_0x187f69,_0x963ae0,_0xa6eec1,_0x48dd8b,_0x54f275){var _0x1338de,_0x28cc86,_0x136930,_0x5535b7;_0x54f275['remoteUri']=intUtil[_0x5cac('0x57')](_0x54f275[_0x5cac('0x55')]);_0x54f275[_0x5cac('0x56')]=intUtil[_0x5cac('0x57')](_0x54f275[_0x5cac('0x56')]);def[_0x5cac('0x72')]=util[_0x5cac('0x25')](_0x5cac('0x58'),_0x54f275['remoteUri']);if(_0x48dd8b&&_0x48dd8b['monitor_format']){logger[_0x5cac('0xe')]('['+_0x187f69['lastevent'][_0x5cac('0x7b')]()+']','Recording\x20is\x20enabled!');_0x187f69[_0x5cac('0x5c')]=util[_0x5cac('0x25')](_0x5cac('0x5d'),_0x54f275[_0x5cac('0x56')],_0x187f69[_0x5cac('0x5e')],md5(_0x187f69[_0x5cac('0x5e')]));}else{_0x187f69[_0x5cac('0x5c')]='';}return getConnection(_0x54f275)['then'](function(_0x260644){_0x5535b7=_0x260644;if(!_[_0x5cac('0x2b')](_0xa6eec1)){return getUser(_0x54f275,_0xa6eec1[_0x5cac('0x10')],_0x5535b7);}else{return getUser(_0x54f275,null,_0x5535b7);}})['then'](function(_0x2ec60b){_0x1338de=_0x2ec60b;logger[_0x5cac('0xe')](_0x5cac('0x5f'),_0x1338de['id']);return getEndUser(_0x54f275,_0x187f69[_0x5cac('0x60')],_0x187f69[_0x5cac('0x61')],_0x5535b7);})[_0x5cac('0x30')](function(_0x374b62){_0x28cc86=_0x374b62;logger[_0x5cac('0xe')]('The\x20Enduser\x20ID\x20is:',_0x28cc86['id']);return getTicket(_0x54f275,_0x1338de,_0x28cc86,_0x963ae0,_0x187f69,_0x963ae0[_0x5cac('0x63')],_0x5535b7,_0x5cac('0x64'));})['then'](function(_0x5512e5){_0x136930=_0x5512e5;logger['info']('Ticket\x20created!');logger[_0x5cac('0xe')](_0x5cac('0x66'),_0x136930['id']);return setRelationship(_0x5535b7,_0x1338de,_0x136930,_0x5cac('0x67'));})[_0x5cac('0x30')](function(){return setRelationship(_0x5535b7,_0x28cc86,_0x136930,'contacts');})[_0x5cac('0x30')](function(){return getServerInfo(_0x5535b7);})['catch'](function(_0x3a8079){logger[_0x5cac('0x70')]('['+_0x187f69[_0x5cac('0x7c')][_0x5cac('0x7b')]()+']',JSON['stringify'](_0x3a8079));});}; \ No newline at end of file +var _0xc64c=['queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','Recording\x20is\x20enabled!','toUpperCase','lodash','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','find','name_value_list','value','info','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','then','Enduser\x20created.','debug','map','type','string','nameField','customField','toString','custom_fields','idField','content','variable','customVariable','Variable','toLowerCase','login','password','Account\x20%d\x20is\x20not\x20valid','set_relationship'];(function(_0x5e08b4,_0x4d0e31){var _0x2c8b90=function(_0x3ed65a){while(--_0x3ed65a){_0x5e08b4['push'](_0x5e08b4['shift']());}};_0x2c8b90(++_0x4d0e31);}(_0xc64c,0x198));var _0xcc64=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0xc64c[_0x15a634];return _0xf4f7a0;};'use strict';var _=require(_0xcc64('0x0'));var rp=require('request-promise');var BPromise=require(_0xcc64('0x1'));var md5=require(_0xcc64('0x2'));var util=require(_0xcc64('0x3'));var Redis=require(_0xcc64('0x4'));var intUtil=require('./util');var config=require(_0xcc64('0x5'));var logger=require(_0xcc64('0x6'))(_0xcc64('0x7'));config[_0xcc64('0x8')]=_[_0xcc64('0x9')](config['redis'],{'host':_0xcc64('0xa'),'port':0x18eb});var io=require(_0xcc64('0xb'))(new Redis(config['redis']));var def={'method':_0xcc64('0xc'),'json':!![]};function emit(_0x47d952,_0x16a964,_0x14cc89){io['to'](_0x47d952)['emit'](_0x16a964,_0x14cc89);}function getTicket(_0x5d0108,_0x2f74b6,_0x4cd6f9,_0x5803ba,_0x3b7b74,_0x2f1360,_0x3866ba,_0xd17d46){logger['info'](_0xcc64('0xd'));var _0x38e484=new Date();var _0x14318f=[{'name':'name','value':intUtil[_0xcc64('0xe')](_0x5803ba[_0xcc64('0xf')],_0x3b7b74,'\x20')},{'name':_0xcc64('0x10'),'value':_0x2f74b6['id']},{'name':_0xcc64('0x11'),'value':_0x2f74b6['id']},{'name':_0xcc64('0x12'),'value':intUtil[_0xcc64('0xe')](_0x5803ba[_0xcc64('0x13')],_0x3b7b74,'\x0a')},{'name':_0xcc64('0x14'),'value':_0x38e484[_0xcc64('0x15')]()[_0xcc64('0x16')](0x0,0x13)[_0xcc64('0x17')]('T','\x20')},{'name':_0xcc64('0x18'),'value':'0'},{'name':_0xcc64('0x19'),'value':'15'},{'name':_0xcc64('0x1a'),'value':_0x4cd6f9['id']},{'name':_0xcc64('0x1b'),'value':_0xcc64('0x1c')},{'name':_0xcc64('0x1d'),'value':_0x4cd6f9[_0xcc64('0x1e')]},{'name':_0xcc64('0x1f'),'value':_0xd17d46}];if(_0x2f1360['length']){_[_0xcc64('0x20')](_0x2f1360,function(_0x4b130b){if(_0x3b7b74[_0x4b130b[_0xcc64('0x21')]]){_0x14318f[_0xcc64('0x22')]({'name':_0x4b130b['idField'],'value':_0x3b7b74[_0x4b130b['variableName']]});}});}return request({'form':{'method':_0xcc64('0x23'),'input_type':_0xcc64('0x24'),'response_type':_0xcc64('0x24'),'rest_data':JSON[_0xcc64('0x25')]({'session':_0x3866ba['id'],'module_name':_0xcc64('0x26'),'name_value_list':_0x14318f})}});}function getAuth(_0x29e5c1){return util[_0xcc64('0x27')](_0xcc64('0x28'),new Buffer(_0x29e5c1['apiKey']+':X')['toString'](_0xcc64('0x29')));}function getServerInfo(_0x445fc1){return request({'form':{'method':_0xcc64('0x2a'),'input_type':_0xcc64('0x24'),'response_type':_0xcc64('0x24'),'rest_data':JSON[_0xcc64('0x25')]({'session':_0x445fc1['id']})}});}function getUser(_0x14dea8,_0x142fc2,_0x5c4370){if(!_[_0xcc64('0x2b')](_0x142fc2)){logger['info'](_0xcc64('0x2c'),_0x142fc2);return request({'form':{'method':'get_entry_list','input_type':_0xcc64('0x24'),'response_type':_0xcc64('0x24'),'rest_data':JSON[_0xcc64('0x25')]({'session':_0x5c4370['id'],'module_name':'Employees','query':util['format'](_0xcc64('0x2d'),_0x142fc2),'order_by':'','offset':'0','select_fields':['id',_0xcc64('0x1e'),_0xcc64('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x557ee5){if(_0x557ee5[_0xcc64('0x2f')][_0xcc64('0x30')]){var _0x3f6f8a=_[_0xcc64('0x31')](_0x557ee5[_0xcc64('0x2f')],function(_0x25879c){return _0x25879c[_0xcc64('0x32')]['user_name'][_0xcc64('0x33')]===_0x142fc2;});if(_0x3f6f8a){logger[_0xcc64('0x34')]('Agent\x20found!');return BPromise[_0xcc64('0x35')]({'id':_0x3f6f8a[_0xcc64('0x32')]['id']['value'],'name':_0x3f6f8a[_0xcc64('0x32')][_0xcc64('0x1e')][_0xcc64('0x33')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x5c4370[_0xcc64('0x32')][_0xcc64('0x36')][_0xcc64('0x33')],'name':_0x5c4370[_0xcc64('0x32')][_0xcc64('0x2e')][_0xcc64('0x33')]});});}else{logger['info'](_0xcc64('0x37'));return BPromise['resolve']({'id':_0x5c4370[_0xcc64('0x32')]['user_id']['value'],'name':_0x5c4370[_0xcc64('0x32')][_0xcc64('0x2e')][_0xcc64('0x33')]});}}function getEndUser(_0x5e225b,_0xb37845,_0x114894,_0x2a685e){logger[_0xcc64('0x34')](_0xcc64('0x38'),_0x114894);return request({'form':{'method':_0xcc64('0x39'),'input_type':_0xcc64('0x24'),'response_type':_0xcc64('0x24'),'rest_data':JSON[_0xcc64('0x25')]({'session':_0x2a685e['id'],'module_name':_0xcc64('0x1c'),'query':util[_0xcc64('0x27')](_0xcc64('0x3a'),_0x114894),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2e2f76){if(_0x2e2f76[_0xcc64('0x2f')]['length']){var _0x1b3e1d=_[_0xcc64('0x31')](_0x2e2f76[_0xcc64('0x2f')],function(_0x517cd1){return _0x517cd1['name_value_list'][_0xcc64('0x3b')]['value']===_0x114894;});if(_0x1b3e1d){logger[_0xcc64('0x34')](_0xcc64('0x3c'));return BPromise['resolve']({'id':_0x1b3e1d[_0xcc64('0x32')]['id'][_0xcc64('0x33')],'name':_0x1b3e1d[_0xcc64('0x32')][_0xcc64('0x1e')][_0xcc64('0x33')],'phone':_0x1b3e1d[_0xcc64('0x32')][_0xcc64('0x3b')][_0xcc64('0x33')]});}}else{logger[_0xcc64('0x34')](_0xcc64('0x3d'));return request({'form':{'method':_0xcc64('0x23'),'input_type':'JSON','response_type':_0xcc64('0x24'),'rest_data':JSON[_0xcc64('0x25')]({'session':_0x2a685e['id'],'module_name':_0xcc64('0x1c'),'name_value_list':[{'name':'first_name','value':_0xb37845!==_0xcc64('0x3e')?_0xb37845:util['format'](_0xcc64('0x3f'),_0x114894)},{'name':_0xcc64('0x3b'),'value':_0x114894}]})}})[_0xcc64('0x40')](function(_0x3941bf){logger['info'](_0xcc64('0x41'));return BPromise[_0xcc64('0x35')]({'id':_0x3941bf['id'],'name':_0x3941bf[_0xcc64('0x2f')]['first_name'][_0xcc64('0x33')],'phone':_0x3941bf[_0xcc64('0x2f')][_0xcc64('0x3b')][_0xcc64('0x33')]});});}});}function request(_0x2c6fcb){logger[_0xcc64('0x42')]('[HTTP]',JSON['stringify'](_0x2c6fcb));return rp(_['merge'](def,_0x2c6fcb));}function getTags(_0x24f2b2,_0x3edca5){var _0x163384=[];if(_0x24f2b2&&_0x24f2b2[_0xcc64('0x30')]>0x0){_0x163384=_[_0xcc64('0x43')](_0x24f2b2,_0x3edca5);}return _0x163384;}function getCustomFields(_0x211fd2,_0x591738){var _0x5887b4=[];var _0x8b582e={'custom_fields':[]};if(_0x211fd2[_0xcc64('0x30')]>0x0){_[_0xcc64('0x20')](_0x211fd2,function(_0x350128){if(_0x350128[_0xcc64('0x44')]===_0xcc64('0x45')&&_0x350128[_0xcc64('0x46')]&&!_0x350128[_0xcc64('0x47')]){_0x8b582e[_0x350128[_0xcc64('0x46')]['toLowerCase']()]=_0x350128['content'][_0xcc64('0x48')]();}else if(_0x350128[_0xcc64('0x44')]===_0xcc64('0x45')&&_0x350128['idField']&&_0x350128[_0xcc64('0x47')]){_0x8b582e[_0xcc64('0x49')][_0xcc64('0x22')]({'id':_0x350128[_0xcc64('0x4a')],'value':_0x350128[_0xcc64('0x4b')][_0xcc64('0x48')]()});}else if(_0x350128[_0xcc64('0x44')]===_0xcc64('0x4c')&&_0x350128[_0xcc64('0x21')]&&_0x350128[_0xcc64('0x4a')]&&_0x350128['customField']){_0x591738[_0x350128[_0xcc64('0x21')]]&&_0x8b582e[_0xcc64('0x49')]['push']({'id':_0x350128[_0xcc64('0x4a')],'value':_0x591738[_0x350128['variableName']][_0xcc64('0x48')]()});}else if(_0x350128['type']===_0xcc64('0x4d')&&_0x350128[_0xcc64('0x4e')]&&_0x350128[_0xcc64('0x4e')]['name']&&_0x350128[_0xcc64('0x4a')]&&_0x350128[_0xcc64('0x47')]){_0x591738[_0x350128[_0xcc64('0x4e')][_0xcc64('0x1e')]['toLowerCase']()]&&_0x8b582e[_0xcc64('0x49')][_0xcc64('0x22')]({'id':_0x350128[_0xcc64('0x4a')],'value':_0x591738[_0x350128[_0xcc64('0x4e')][_0xcc64('0x1e')][_0xcc64('0x4f')]()]['toString']()});}});}return _0x8b582e;}function getConnection(_0x856371){return request({'method':'POST','form':{'method':_0xcc64('0x50'),'input_type':'JSON','response_type':_0xcc64('0x24'),'rest_data':JSON[_0xcc64('0x25')]({'user_auth':{'user_name':_0x856371['username'],'password':_0x856371[_0xcc64('0x51')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0xcc64('0x40')](function(_0x3e39b4){var _0x12a194=_0x3e39b4;if(_0x12a194['id']){def['sessionID']=_0x12a194['id'];return BPromise[_0xcc64('0x35')](_0x12a194);}else{throw new Error(util[_0xcc64('0x27')](_0xcc64('0x52'),_0x856371['id']));}});}function setRelationship(_0x1dec85,_0xd28c32,_0x3036de,_0x43c2c3){return request({'form':{'method':_0xcc64('0x53'),'input_type':_0xcc64('0x24'),'response_type':_0xcc64('0x24'),'rest_data':JSON[_0xcc64('0x25')]({'session':_0x1dec85['id'],'module_name':_0xcc64('0x26'),'module_id':_0x3036de['id'],'link_field_name':_0x43c2c3,'related_ids':[_0xd28c32['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xcc64('0x54')]=function(_0x370dab,_0x58af83,_0x45e4ac,_0x1130e4,_0x4c355b,_0x20ef77){var _0x350e37,_0x380ec6,_0x47363f,_0x5db61f;_0x20ef77[_0xcc64('0x55')]=intUtil[_0xcc64('0x56')](_0x20ef77['remoteUri']);_0x20ef77[_0xcc64('0x57')]=intUtil[_0xcc64('0x56')](_0x20ef77[_0xcc64('0x57')]);def['uri']=util['format'](_0xcc64('0x58'),_0x20ef77[_0xcc64('0x55')]);if(_0x4c355b&&_0x4c355b[_0xcc64('0x59')]){logger[_0xcc64('0x34')](_0xcc64('0x5a'),'Recording\x20is\x20enabled!');_0x58af83[_0xcc64('0x5b')]=util['format'](_0xcc64('0x5c'),_0x20ef77[_0xcc64('0x57')],_0x58af83[_0xcc64('0x5d')],md5(_0x58af83[_0xcc64('0x5d')]));}else{_0x58af83[_0xcc64('0x5b')]='';}return getConnection(_0x20ef77)[_0xcc64('0x40')](function(_0x593fef){_0x5db61f=_0x593fef;return getUser(_0x20ef77,_0x1130e4[_0xcc64('0x1e')],_0x5db61f);})[_0xcc64('0x40')](function(_0x5c0c25){_0x350e37=_0x5c0c25;logger[_0xcc64('0x34')](_0xcc64('0x5e'),_0x350e37['id']);return getEndUser(_0x20ef77,_0x58af83[_0xcc64('0x5f')],_0x58af83[_0xcc64('0x60')],_0x5db61f);})[_0xcc64('0x40')](function(_0x2fa336){_0x380ec6=_0x2fa336;logger[_0xcc64('0x34')](_0xcc64('0x61'),_0x380ec6['id']);return getTicket(_0x20ef77,_0x350e37,_0x380ec6,_0x45e4ac,_0x58af83,_0x45e4ac[_0xcc64('0x62')],_0x5db61f,_0xcc64('0x63'));})['then'](function(_0x4b30cb){_0x47363f=_0x4b30cb;logger[_0xcc64('0x34')](_0xcc64('0x64'));logger['info'](_0xcc64('0x65'),_0x47363f['id']);return setRelationship(_0x5db61f,_0x350e37,_0x47363f,'users');})['then'](function(){return setRelationship(_0x5db61f,_0x380ec6,_0x47363f,_0xcc64('0x66'));})['then'](function(){return getServerInfo(_0x5db61f);})[_0xcc64('0x40')](function(_0x28fd85){var _0x432cec=parseInt(_0x28fd85[_0xcc64('0x67')][_0xcc64('0x68')](0x0));var _0x2b2ad3=util[_0xcc64('0x27')](_0xcc64('0x69'),_0x20ef77[_0xcc64('0x55')],_0x47363f['id']);if(_0x432cec>0x6){_0x2b2ad3=util[_0xcc64('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x20ef77[_0xcc64('0x55')],_0x47363f['id']);}logger[_0xcc64('0x34')](_0xcc64('0x5a'),_0xcc64('0x6a'));emit(util[_0xcc64('0x27')](_0xcc64('0x6b'),_0x1130e4['name']),_0xcc64('0x6c'),{'uri':_0x2b2ad3});})[_0xcc64('0x6d')](function(_0x53ef8a){logger[_0xcc64('0x6e')]('[QUEUE]',JSON[_0xcc64('0x25')](_0x53ef8a));});};exports['outbound']=function(_0xcf128e,_0x301a22,_0x59f189,_0x3b8a25,_0x2d834f,_0xd9c4a0,_0x2333dd){var _0x3a1183,_0x14493a,_0x1a1781,_0x1ddd6b;_0xd9c4a0['remoteUri']=intUtil['stripTrailingSlash'](_0xd9c4a0[_0xcc64('0x55')]);_0xd9c4a0[_0xcc64('0x57')]=intUtil[_0xcc64('0x56')](_0xd9c4a0[_0xcc64('0x57')]);def[_0xcc64('0x6f')]=util['format'](_0xcc64('0x58'),_0xd9c4a0[_0xcc64('0x55')]);if(_0x2333dd&&_0x2333dd[_0xcc64('0x70')]&&_0x2333dd[_0xcc64('0x70')]!==_0xcc64('0x71')){logger[_0xcc64('0x34')](_0xcc64('0x72'),'Recording\x20is\x20enabled!');_0x301a22['recordingURL']=util[_0xcc64('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd9c4a0[_0xcc64('0x57')],_0x301a22[_0xcc64('0x5d')],md5(_0x301a22[_0xcc64('0x5d')]));}return getConnection(_0xd9c4a0)[_0xcc64('0x40')](function(_0x359fa6){_0x1ddd6b=_0x359fa6;return getUser(_0xd9c4a0,_0x3b8a25[_0xcc64('0x1e')],_0x1ddd6b);})['then'](function(_0x1c2187){_0x3a1183=_0x1c2187;logger[_0xcc64('0x34')](_0xcc64('0x5e'),_0x3a1183['id']);return getEndUser(_0xd9c4a0,_0x301a22[_0xcc64('0x73')],_0x301a22[_0xcc64('0x74')],_0x1ddd6b);})['then'](function(_0x466db5){_0x14493a=_0x466db5;logger[_0xcc64('0x34')]('The\x20Enduser\x20ID\x20is:',_0x14493a['id']);return getTicket(_0xd9c4a0,_0x3a1183,_0x14493a,_0x59f189,_0x301a22,_0x59f189[_0xcc64('0x62')],_0x1ddd6b,_0xcc64('0x75'));})[_0xcc64('0x40')](function(_0x246acf){_0x1a1781=_0x246acf;logger['info'](_0xcc64('0x64'));logger[_0xcc64('0x34')](_0xcc64('0x65'),_0x1a1781['id']);return setRelationship(_0x1ddd6b,_0x3a1183,_0x1a1781,'users');})['then'](function(){return setRelationship(_0x1ddd6b,_0x14493a,_0x1a1781,_0xcc64('0x66'));})[_0xcc64('0x40')](function(){return getServerInfo(_0x1ddd6b);})[_0xcc64('0x40')](function(_0x24b510){var _0x53ffc5=parseInt(_0x24b510[_0xcc64('0x67')][_0xcc64('0x68')](0x0));var _0x4ee3f1=util[_0xcc64('0x27')](_0xcc64('0x69'),_0xd9c4a0['remoteUri'],_0x1a1781['id']);if(_0x53ffc5>0x6){_0x4ee3f1=util['format'](_0xcc64('0x76'),_0xd9c4a0[_0xcc64('0x55')],_0x1a1781['id']);}logger['info']('[OUTBOUND]',_0xcc64('0x6a'));emit(util['format'](_0xcc64('0x6b'),_0x3b8a25[_0xcc64('0x1e')]),_0xcc64('0x6c'),{'uri':_0x4ee3f1});})[_0xcc64('0x6d')](function(_0x3149c0){logger[_0xcc64('0x6e')](_0xcc64('0x72'),JSON[_0xcc64('0x25')](_0x3149c0));});};exports[_0xcc64('0x77')]=function(_0x5769ff,_0x2deb8f,_0xcab900,_0x2a205c,_0x3004d2,_0x284d41){var _0x2ece8d,_0x40491e,_0x88ea81,_0x2ff41d;_0x284d41[_0xcc64('0x55')]=intUtil[_0xcc64('0x56')](_0x284d41[_0xcc64('0x55')]);_0x284d41[_0xcc64('0x57')]=intUtil[_0xcc64('0x56')](_0x284d41['serverUrl']);def['uri']=util[_0xcc64('0x27')](_0xcc64('0x58'),_0x284d41['remoteUri']);if(_0x3004d2&&_0x3004d2[_0xcc64('0x59')]){logger[_0xcc64('0x34')]('['+_0x2deb8f[_0xcc64('0x78')]['toUpperCase']()+']',_0xcc64('0x79'));_0x2deb8f[_0xcc64('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x284d41['serverUrl'],_0x2deb8f[_0xcc64('0x5d')],md5(_0x2deb8f[_0xcc64('0x5d')]));}else{_0x2deb8f[_0xcc64('0x5b')]='';}return getConnection(_0x284d41)['then'](function(_0x336155){_0x2ff41d=_0x336155;if(!_[_0xcc64('0x2b')](_0x2a205c)){return getUser(_0x284d41,_0x2a205c[_0xcc64('0x1e')],_0x2ff41d);}else{return getUser(_0x284d41,null,_0x2ff41d);}})[_0xcc64('0x40')](function(_0x322f01){_0x2ece8d=_0x322f01;logger[_0xcc64('0x34')]('The\x20User\x20ID\x20is:',_0x2ece8d['id']);return getEndUser(_0x284d41,_0x2deb8f['calleridname'],_0x2deb8f['calleridnum'],_0x2ff41d);})[_0xcc64('0x40')](function(_0x2e1b35){_0x40491e=_0x2e1b35;logger[_0xcc64('0x34')](_0xcc64('0x61'),_0x40491e['id']);return getTicket(_0x284d41,_0x2ece8d,_0x40491e,_0xcab900,_0x2deb8f,_0xcab900[_0xcc64('0x62')],_0x2ff41d,_0xcc64('0x63'));})['then'](function(_0x4671a9){_0x88ea81=_0x4671a9;logger['info'](_0xcc64('0x64'));logger['info'](_0xcc64('0x65'),_0x88ea81['id']);return setRelationship(_0x2ff41d,_0x2ece8d,_0x88ea81,'users');})[_0xcc64('0x40')](function(){return setRelationship(_0x2ff41d,_0x40491e,_0x88ea81,_0xcc64('0x66'));})[_0xcc64('0x40')](function(){return getServerInfo(_0x2ff41d);})[_0xcc64('0x6d')](function(_0x526a75){logger['error']('['+_0x2deb8f[_0xcc64('0x78')][_0xcc64('0x7a')]()+']',JSON['stringify'](_0x526a75));});}; \ 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 d12550d..62f88bd 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 _0x97e4=['variable','variableName','push','customVariable','Variable','name','key','format','%s:\x20%s','keyContent','keyType','toLowerCase','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','type','string','content'];(function(_0x34b736,_0x3f652e){var _0x4c432b=function(_0x9a0a06){while(--_0x9a0a06){_0x34b736['push'](_0x34b736['shift']());}};_0x4c432b(++_0x3f652e);}(_0x97e4,0xc1));var _0x497e=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x97e4[_0x3a04ab];return _0x4bff6d;};'use strict';var _=require(_0x497e('0x0'));var util=require(_0x497e('0x1'));exports[_0x497e('0x2')]=function(_0x3f002c,_0x583508,_0x20b588){var _0x57066f=[];if(_0x3f002c[_0x497e('0x3')]>0x0){var _0xda6c3=_['sortBy'](_0x3f002c,['id']);for(var _0x4d6cbb=0x0;_0x4d6cbb<_0xda6c3[_0x497e('0x3')];_0x4d6cbb++){var _0x4a47f0=_0xda6c3[_0x4d6cbb];if(_0x4a47f0[_0x497e('0x4')]===_0x497e('0x5')){_0x57066f['push'](_0x4a47f0[_0x497e('0x6')]);}else if(_0x4a47f0[_0x497e('0x4')]===_0x497e('0x7')&&_0x4a47f0[_0x497e('0x8')]){_0x583508[_0x4a47f0[_0x497e('0x8')]]&&_0x57066f[_0x497e('0x9')](_0x583508[_0x4a47f0[_0x497e('0x8')]]['toString']());}else if(_0x4a47f0['type']===_0x497e('0xa')&&_0x4a47f0[_0x497e('0xb')]&&_0x4a47f0[_0x497e('0xb')][_0x497e('0xc')]){_0x583508[_0x4a47f0[_0x497e('0xb')][_0x497e('0xc')]['toLowerCase']()]&&_0x57066f['push'](_0x583508[_0x4a47f0[_0x497e('0xb')][_0x497e('0xc')]['toLowerCase']()]['toString']());}else if(_0x4a47f0[_0x497e('0x4')]==='keyValue'){if(_0x4a47f0['keyType']===_0x497e('0x5')&&_0x4a47f0[_0x497e('0xd')]){_0x57066f[_0x497e('0x9')](util[_0x497e('0xe')](_0x497e('0xf'),_0x4a47f0['key'],_0x4a47f0[_0x497e('0x10')]));}else if(_0x4a47f0[_0x497e('0x11')]===_0x497e('0x7')&&_0x4a47f0[_0x497e('0x8')]&&_0x4a47f0[_0x497e('0xd')]){_0x583508[_0x4a47f0['variableName']]&&_0x57066f[_0x497e('0x9')](util[_0x497e('0xe')](_0x497e('0xf'),_0x4a47f0[_0x497e('0xd')],_0x583508[_0x4a47f0['variableName']]));}else if(_0x4a47f0[_0x497e('0x11')]===_0x497e('0xa')&&_0x4a47f0[_0x497e('0xb')]&&_0x4a47f0[_0x497e('0xb')]['name']&&_0x4a47f0[_0x497e('0xd')]){_0x583508[_0x4a47f0[_0x497e('0xb')][_0x497e('0xc')][_0x497e('0x12')]()]&&_0x57066f['push'](util[_0x497e('0xe')](_0x497e('0xf'),_0x4a47f0[_0x497e('0xd')],_0x583508[_0x4a47f0[_0x497e('0xb')][_0x497e('0xc')][_0x497e('0x12')]()]));}}}}return _0x57066f[_0x497e('0x13')](_0x20b588);};exports[_0x497e('0x14')]=function(_0x5678c4){var _0x2eb72b=_0x5678c4[_0x497e('0x15')](-0x1);if(_0x2eb72b==='/'){_0x5678c4=_0x5678c4['substring'](0x0,_0x5678c4[_0x497e('0x16')](_0x2eb72b));}return _0x5678c4;};exports[_0x497e('0x17')]=function(_0x3a8c0b){if(!_[_0x497e('0x18')](_0x3a8c0b)&&_0x3a8c0b!==''){var _0x5b886a=/^(([^<>()\[\]\\.,;:\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 _0x5b886a['test'](String(_0x3a8c0b)[_0x497e('0x12')]());}else{return![];}}; \ No newline at end of file +var _0x04a5=['variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','string','key','format','keyContent','%s:\x20%s','keyType','join','stripTrailingSlash','slice','validateEmail','isNil','test','util','getString','sortBy','type','push','content','variable'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x04a5,0xe3));var _0x504a=function(_0x445024,_0x36dca6){_0x445024=_0x445024-0x0;var _0x5ab19a=_0x04a5[_0x445024];return _0x5ab19a;};'use strict';var _=require('lodash');var util=require(_0x504a('0x0'));exports[_0x504a('0x1')]=function(_0x3f2388,_0x4e17a2,_0x4fbc4c){var _0x14a44a=[];if(_0x3f2388['length']>0x0){var _0x2ee6b5=_[_0x504a('0x2')](_0x3f2388,['id']);for(var _0x338f1e=0x0;_0x338f1e<_0x2ee6b5['length'];_0x338f1e++){var _0x4ead9e=_0x2ee6b5[_0x338f1e];if(_0x4ead9e[_0x504a('0x3')]==='string'){_0x14a44a[_0x504a('0x4')](_0x4ead9e[_0x504a('0x5')]);}else if(_0x4ead9e['type']===_0x504a('0x6')&&_0x4ead9e[_0x504a('0x7')]){_0x4e17a2[_0x4ead9e[_0x504a('0x7')]]&&_0x14a44a[_0x504a('0x4')](_0x4e17a2[_0x4ead9e[_0x504a('0x7')]][_0x504a('0x8')]());}else if(_0x4ead9e[_0x504a('0x3')]===_0x504a('0x9')&&_0x4ead9e[_0x504a('0xa')]&&_0x4ead9e['Variable'][_0x504a('0xb')]){_0x4e17a2[_0x4ead9e[_0x504a('0xa')][_0x504a('0xb')][_0x504a('0xc')]()]&&_0x14a44a[_0x504a('0x4')](_0x4e17a2[_0x4ead9e[_0x504a('0xa')][_0x504a('0xb')][_0x504a('0xc')]()][_0x504a('0x8')]());}else if(_0x4ead9e['type']===_0x504a('0xd')){if(_0x4ead9e['keyType']===_0x504a('0xe')&&_0x4ead9e[_0x504a('0xf')]){_0x14a44a[_0x504a('0x4')](util[_0x504a('0x10')]('%s:\x20%s',_0x4ead9e['key'],_0x4ead9e[_0x504a('0x11')]));}else if(_0x4ead9e['keyType']==='variable'&&_0x4ead9e[_0x504a('0x7')]&&_0x4ead9e['key']){_0x4e17a2[_0x4ead9e[_0x504a('0x7')]]&&_0x14a44a[_0x504a('0x4')](util[_0x504a('0x10')](_0x504a('0x12'),_0x4ead9e[_0x504a('0xf')],_0x4e17a2[_0x4ead9e[_0x504a('0x7')]]));}else if(_0x4ead9e[_0x504a('0x13')]===_0x504a('0x9')&&_0x4ead9e['Variable']&&_0x4ead9e[_0x504a('0xa')][_0x504a('0xb')]&&_0x4ead9e[_0x504a('0xf')]){_0x4e17a2[_0x4ead9e[_0x504a('0xa')][_0x504a('0xb')][_0x504a('0xc')]()]&&_0x14a44a[_0x504a('0x4')](util[_0x504a('0x10')]('%s:\x20%s',_0x4ead9e[_0x504a('0xf')],_0x4e17a2[_0x4ead9e[_0x504a('0xa')][_0x504a('0xb')]['toLowerCase']()]));}}}}return _0x14a44a[_0x504a('0x14')](_0x4fbc4c);};exports[_0x504a('0x15')]=function(_0x16ef80){var _0x4751ed=_0x16ef80[_0x504a('0x16')](-0x1);if(_0x4751ed==='/'){_0x16ef80=_0x16ef80['substring'](0x0,_0x16ef80['lastIndexOf'](_0x4751ed));}return _0x16ef80;};exports[_0x504a('0x17')]=function(_0x25cb74){if(!_[_0x504a('0x18')](_0x25cb74)&&_0x25cb74!==''){var _0x2a0b1b=/^(([^<>()\[\]\\.,;:\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 _0x2a0b1b[_0x504a('0x19')](String(_0x25cb74)[_0x504a('0xc')]());}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 c54b01c..fc0e35b 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x62f192,_0x19340e){var _0x413c61=function(_0x3be0c8){while(--_0x3be0c8){_0x62f192['push'](_0x62f192['shift']());}};_0x413c61(++_0x19340e);}(_0xe706,0xa3));var _0x6e70=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xe706[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x587571,_0xe251bc){var _0x5681e4=function(_0x3bd486){while(--_0x3bd486){_0x587571['push'](_0x587571['shift']());}};_0x5681e4(++_0xe251bc);}(_0xe706,0xa3));var _0x6e70=function(_0x4e90f0,_0x3b7e3c){_0x4e90f0=_0x4e90f0-0x0;var _0x1a2cee=_0xe706[_0x4e90f0];return _0x1a2cee;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index ce70339..2fc7524 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 _0x8358=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','user:%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','request-promise','ioredis','../../../../config/logger','zendesk','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','base64','debug','[HTTP]','defaults','GET','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL'];(function(_0x447ef1,_0x374cd2){var _0x3d72ec=function(_0x3e10b){while(--_0x3e10b){_0x447ef1['push'](_0x447ef1['shift']());}};_0x3d72ec(++_0x374cd2);}(_0x8358,0x1d2));var _0x8835=function(_0xe21e09,_0x50694e){_0xe21e09=_0xe21e09-0x0;var _0x1f9546=_0x8358[_0xe21e09];return _0x1f9546;};'use strict';var _=require('lodash');var rp=require(_0x8835('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x8835('0x1'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x8835('0x2'))(_0x8835('0x3'));config[_0x8835('0x4')]=_['defaults'](config[_0x8835('0x4')],{'host':_0x8835('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8835('0x4')]));function emit(_0x22e27d,_0x1617c8,_0xb0ed8c){io['to'](_0x22e27d)[_0x8835('0x6')](_0x1617c8,_0xb0ed8c);}var headers={'Content-Type':_0x8835('0x7'),'Accept':_0x8835('0x7')};function getTicket(_0x3f09d3,_0x810308,_0x499ebc,_0x4b5553,_0x429d9e){logger[_0x8835('0x8')](_0x8835('0x9'));return request({'uri':util[_0x8835('0xa')](_0x8835('0xb'),_0x3f09d3['remoteUri']),'method':_0x8835('0xc'),'body':{'ticket':_[_0x8835('0xd')]({'requester_id':_0x499ebc['id'],'submitter_id':_0x810308?_0x810308['id']:undefined,'assignee_id':_0x810308?_0x810308['id']:undefined,'tags':getTags(_0x4b5553[_0x8835('0xe')],_0x8835('0xf')),'subject':intUtil[_0x8835('0x10')](_0x4b5553[_0x8835('0x11')],_0x429d9e,'\x20'),'description':intUtil['getString'](_0x4b5553[_0x8835('0x12')],_0x429d9e,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8835('0x10')](_0x4b5553['Descriptions'],_0x429d9e,'\x0a')}},getCustomFields(_0x4b5553['Fields'],_0x429d9e))}})[_0x8835('0x13')](function(_0x5bc096){logger[_0x8835('0x8')](_0x8835('0x14'));return _0x5bc096['ticket'];});}function getUser(_0x52cef2,_0x598e7f){if(intUtil[_0x8835('0x15')](_0x598e7f)){logger[_0x8835('0x8')](_0x8835('0x16'),_0x598e7f);return request({'uri':util[_0x8835('0xa')](_0x8835('0x17'),_0x52cef2['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x598e7f)}})[_0x8835('0x13')](function(_0x501e53){if(_0x501e53[_0x8835('0x18')]){logger['info']('Agent\x20found!');return _[_0x8835('0x19')](_0x501e53[_0x8835('0x1a')],{'email':_0x598e7f,'role':_0x8835('0x1b')});}else{logger['info'](_0x8835('0x1c'));return request({'uri':util[_0x8835('0xa')](_0x8835('0x1d'),_0x52cef2[_0x8835('0x1e')])})[_0x8835('0x13')](function(_0x558846){logger['info'](_0x8835('0x1f'));return _0x558846[_0x8835('0x20')];});}});}else{logger['info'](_0x8835('0x1c'));return request({'uri':util[_0x8835('0xa')](_0x8835('0x1d'),_0x52cef2[_0x8835('0x1e')])})[_0x8835('0x13')](function(_0x1a39ae){logger[_0x8835('0x8')](_0x8835('0x1f'));return _0x1a39ae[_0x8835('0x20')];});}}function getEndUser(_0x479c28,_0x5040c1,_0x17aac7){logger[_0x8835('0x8')](_0x8835('0x21'),_0x17aac7);return request({'uri':util[_0x8835('0xa')]('%s/search.json',_0x479c28['remoteUri']),'qs':{'query':util[_0x8835('0xa')](_0x8835('0x22'),_0x17aac7)}})[_0x8835('0x13')](function(_0x562ae9){var _0x4b347f;if(_0x562ae9[_0x8835('0x1a')][_0x8835('0x23')]){_0x562ae9[_0x8835('0x1a')]=_['filter'](_0x562ae9['results'],{'suspended':![],'role':_0x8835('0x24')});if(_0x562ae9[_0x8835('0x1a')][_0x8835('0x23')]){_0x4b347f=_['first'](_0x562ae9[_0x8835('0x1a')]);}}if(_0x4b347f){logger[_0x8835('0x8')](_0x8835('0x25'));return _0x4b347f;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x8835('0xa')](_0x8835('0x26'),_0x479c28[_0x8835('0x1e')]),'method':_0x8835('0xc'),'body':{'user':{'role':'end-user','name':util[_0x8835('0xa')](_0x8835('0x27'),_0x5040c1||_0x17aac7),'phone':_0x17aac7}}})['then'](function(_0x217112){logger['info'](_0x8835('0x28'));return _0x217112[_0x8835('0x20')];});}});}function getAuth(_0x2b9a7d){var _0x29564d;if(_0x2b9a7d[_0x8835('0x29')]===_0x8835('0x2a')){_0x29564d=util[_0x8835('0xa')](_0x8835('0x2b'),_0x2b9a7d[_0x8835('0x2c')],_0x2b9a7d[_0x8835('0x2a')]);}else if(_0x2b9a7d[_0x8835('0x29')]==='token'){_0x29564d=util['format'](_0x8835('0x2d'),_0x2b9a7d[_0x8835('0x2c')],_0x2b9a7d[_0x8835('0x2e')]);}return util['format'](_0x8835('0x2f'),new Buffer(_0x29564d)['toString'](_0x8835('0x30')));}function request(_0x31f7cc){logger[_0x8835('0x31')](_0x8835('0x32'),JSON['stringify'](_0x31f7cc));return rp(_[_0x8835('0x33')](_0x31f7cc,{'method':_0x8835('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x4f6832,_0x35008b){var _0x5b98bb=[];if(_0x4f6832&&_0x4f6832[_0x8835('0x23')]>0x0){_0x5b98bb=_['map'](_0x4f6832,_0x35008b);}return _0x5b98bb;}function getCustomFields(_0x189676,_0x3ecf50){var _0x7cacad=[];var _0x16c4a7={'custom_fields':[]};if(_0x189676[_0x8835('0x23')]>0x0){_['forEach'](_0x189676,function(_0x162be2){if(_[_0x8835('0x35')]([_0x8835('0x36'),_0x8835('0x37')],_0x162be2[_0x8835('0x38')])&&_0x162be2[_0x8835('0x39')]&&!_0x162be2[_0x8835('0x3a')]){_0x16c4a7[_0x162be2[_0x8835('0x39')][_0x8835('0x3b')]()]=_0x162be2[_0x8835('0x3c')][_0x8835('0x3d')]();}else if(_[_0x8835('0x35')]([_0x8835('0x36'),'picklist'],_0x162be2[_0x8835('0x38')])&&_0x162be2[_0x8835('0x3e')]&&_0x162be2[_0x8835('0x3a')]){_0x16c4a7[_0x8835('0x3f')][_0x8835('0x40')]({'id':_0x162be2[_0x8835('0x3e')],'value':_0x162be2[_0x8835('0x3c')]['toString']()});}else if(_0x162be2[_0x8835('0x38')]===_0x8835('0x41')&&_0x162be2[_0x8835('0x42')]&&_0x162be2[_0x8835('0x3e')]&&_0x162be2[_0x8835('0x3a')]){_0x3ecf50[_0x162be2['variableName']]&&_0x16c4a7[_0x8835('0x3f')][_0x8835('0x40')]({'id':_0x162be2[_0x8835('0x3e')],'value':_0x3ecf50[_0x162be2[_0x8835('0x42')]][_0x8835('0x3d')]()});}else if(_0x162be2[_0x8835('0x38')]===_0x8835('0x43')&&_0x162be2[_0x8835('0x44')]&&_0x162be2['Variable']['name']&&_0x162be2['idField']&&_0x162be2[_0x8835('0x3a')]){_0x3ecf50[_0x162be2['Variable']['name'][_0x8835('0x3b')]()]&&_0x16c4a7[_0x8835('0x3f')]['push']({'id':_0x162be2['idField'],'value':_0x3ecf50[_0x162be2[_0x8835('0x44')][_0x8835('0xf')][_0x8835('0x3b')]()][_0x8835('0x3d')]()});}});}return _0x16c4a7;}exports[_0x8835('0x45')]=function(_0x530320,_0x2893e3,_0x11efd4,_0x7110fe,_0x268f3c,_0x21f10c){var _0xa3b6c0,_0x53f974;_0x21f10c['remoteUri']=intUtil[_0x8835('0x46')](_0x21f10c[_0x8835('0x1e')]);_0x21f10c[_0x8835('0x47')]=intUtil['stripTrailingSlash'](_0x21f10c['serverUrl']);if(_0x268f3c&&_0x268f3c['monitor_format']){logger['info']('[QUEUE]',_0x8835('0x48'));_0x2893e3[_0x8835('0x49')]=util[_0x8835('0xa')](_0x8835('0x4a'),_0x21f10c['serverUrl'],_0x2893e3[_0x8835('0x4b')],md5(_0x2893e3[_0x8835('0x4b')]));}else{_0x2893e3['recordingURL']='';}headers[_0x8835('0x4c')]=getAuth(_0x21f10c);return getUser(_0x21f10c,_0x7110fe[_0x8835('0x4d')])[_0x8835('0x13')](function(_0x4dec8d){_0xa3b6c0=_0x4dec8d;logger['info'](_0x8835('0x4e'),_0xa3b6c0['id']);return getEndUser(_0x21f10c,_0x2893e3[_0x8835('0x4f')],_0x2893e3['calleridnum']);})['then'](function(_0x5d7592){_0x53f974=_0x5d7592;logger['info'](_0x8835('0x50'),_0x53f974['id']);return getTicket(_0x21f10c,_0xa3b6c0,_0x53f974,_0x11efd4,_0x2893e3);})[_0x8835('0x13')](function(_0x30b3ed){if(_0x30b3ed){logger[_0x8835('0x8')]('The\x20Ticket\x20ID\x20is:',_0x30b3ed['id']);switch(_0x21f10c['type']){case'integrationTab':logger['info']('[QUEUE]',_0x8835('0x51'));return request({'uri':util['format'](_0x8835('0x52'),_0x21f10c[_0x8835('0x1e')],_0xa3b6c0['id'],_0x30b3ed['id']),'method':_0x8835('0xc')});case'newTab':logger[_0x8835('0x8')](_0x8835('0x53'),_0x8835('0x54'));emit(util[_0x8835('0xa')]('user:%s',_0x7110fe[_0x8835('0xf')]),_0x8835('0x55'),{'uri':util[_0x8835('0xa')](_0x8835('0x56'),_0x21f10c[_0x8835('0x1e')]['replace'](_0x8835('0x57'),''),_0x30b3ed['id'])});break;default:logger[_0x8835('0x58')](_0x8835('0x53'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x8835('0x59')](function(_0xfa4723){logger[_0x8835('0x58')](_0x8835('0x5a'),util[_0x8835('0x5b')](_0xfa4723,{'showHidden':!![],'depth':null}));});};exports[_0x8835('0x5c')]=function(_0x1ad5ff,_0x43c0c1,_0x46eaba,_0x1498e7,_0x344a35,_0x328dfa,_0x261437){var _0x5db522,_0x50d5c1;_0x328dfa[_0x8835('0x1e')]=intUtil[_0x8835('0x46')](_0x328dfa[_0x8835('0x1e')]);_0x328dfa[_0x8835('0x47')]=intUtil[_0x8835('0x46')](_0x328dfa['serverUrl']);if(_0x261437&&_0x261437[_0x8835('0x5d')]&&_0x261437[_0x8835('0x5d')]!==_0x8835('0x5e')){logger[_0x8835('0x8')](_0x8835('0x5f'),_0x8835('0x48'));_0x43c0c1['recordingURL']=util[_0x8835('0xa')](_0x8835('0x4a'),_0x328dfa[_0x8835('0x47')],_0x43c0c1['uniqueid'],md5(_0x43c0c1[_0x8835('0x4b')]));}headers['Authorization']=getAuth(_0x328dfa);return getUser(_0x328dfa,_0x1498e7['email'])[_0x8835('0x13')](function(_0x4ba211){_0x5db522=_0x4ba211;logger[_0x8835('0x8')](_0x8835('0x4e'),_0x5db522['id']);return getEndUser(_0x328dfa,_0x43c0c1[_0x8835('0x60')],_0x43c0c1[_0x8835('0x61')]);})[_0x8835('0x13')](function(_0x403eb2){_0x50d5c1=_0x403eb2;logger[_0x8835('0x8')](_0x8835('0x50'),_0x50d5c1['id']);return getTicket(_0x328dfa,_0x5db522,_0x50d5c1,_0x46eaba,_0x43c0c1);})[_0x8835('0x13')](function(_0x100004){if(_0x100004){logger[_0x8835('0x8')](_0x8835('0x62'),_0x100004['id']);switch(_0x328dfa[_0x8835('0x38')]){case _0x8835('0x63'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x8835('0xa')](_0x8835('0x52'),_0x328dfa['remoteUri'],_0x5db522['id'],_0x100004['id']),'method':_0x8835('0xc')});case _0x8835('0x64'):logger['info'](_0x8835('0x5f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x8835('0x65'),_0x1498e7[_0x8835('0xf')]),_0x8835('0x55'),{'uri':util[_0x8835('0xa')](_0x8835('0x56'),_0x328dfa[_0x8835('0x1e')][_0x8835('0x66')](_0x8835('0x57'),''),_0x100004['id'])});break;default:logger[_0x8835('0x58')](_0x8835('0x5f'),_0x8835('0x67'));}}})[_0x8835('0x59')](function(_0x5a5ae4){logger[_0x8835('0x58')](_0x8835('0x68'),util[_0x8835('0x5b')](_0x5a5ae4,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x416bcf,_0x5c6611,_0x57b353,_0x31b213,_0x4ef791,_0x3b3a9f){var _0x480db1,_0x165e04;_0x3b3a9f[_0x8835('0x1e')]=intUtil['stripTrailingSlash'](_0x3b3a9f[_0x8835('0x1e')]);_0x3b3a9f[_0x8835('0x47')]=intUtil[_0x8835('0x46')](_0x3b3a9f[_0x8835('0x47')]);if(_0x4ef791&&_0x4ef791[_0x8835('0x69')]){logger[_0x8835('0x8')]('['+_0x5c6611[_0x8835('0x6a')]['toUpperCase']()+']',_0x8835('0x48'));_0x5c6611['recordingURL']=util[_0x8835('0xa')](_0x8835('0x4a'),_0x3b3a9f[_0x8835('0x47')],_0x5c6611['uniqueid'],md5(_0x5c6611[_0x8835('0x4b')]));}else{_0x5c6611[_0x8835('0x49')]='';}headers[_0x8835('0x4c')]=getAuth(_0x3b3a9f);return getUser(_0x3b3a9f)['then'](function(_0xb6e8b3){_0x480db1=_0xb6e8b3;logger[_0x8835('0x8')]('The\x20User\x20ID\x20is:',_0x480db1['id']);return getEndUser(_0x3b3a9f,_0x5c6611[_0x8835('0x4f')],_0x5c6611['calleridnum']);})[_0x8835('0x13')](function(_0xf63b2f){_0x165e04=_0xf63b2f;logger[_0x8835('0x8')]('The\x20Enduser\x20ID\x20is:',_0x165e04['id']);return getTicket(_0x3b3a9f,_0x480db1,_0x165e04,_0x57b353,_0x5c6611);})['then'](function(_0x2dee8f){if(_0x2dee8f){logger[_0x8835('0x8')](_0x8835('0x62'),_0x2dee8f['id']);}})['catch'](function(_0x22cc79){logger[_0x8835('0x58')]('['+_0x5c6611[_0x8835('0x6a')][_0x8835('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x8835('0x5b')](_0x22cc79,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x52ac=['content','idField','custom_fields','push','type','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','redis','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','remoteUri','merge','Tags','getString','Subjects','Descriptions','Fields','info','Ticket\x20created!','validateEmail','%s/search.json','then','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','Basic\x20%s','toString','base64','debug','[HTTP]','defaults','forEach','includes','string','picklist','customField','nameField'];(function(_0x21c601,_0x26f456){var _0xd423f=function(_0x52bc27){while(--_0x52bc27){_0x21c601['push'](_0x21c601['shift']());}};_0xd423f(++_0x26f456);}(_0x52ac,0x9c));var _0xc52a=function(_0xd93cbe,_0x11202e){_0xd93cbe=_0xd93cbe-0x0;var _0xe0bb40=_0x52ac[_0xd93cbe];return _0xe0bb40;};'use strict';var _=require('lodash');var rp=require(_0xc52a('0x0'));var md5=require(_0xc52a('0x1'));var util=require('util');var Redis=require(_0xc52a('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zendesk');config[_0xc52a('0x3')]=_['defaults'](config['redis'],{'host':_0xc52a('0x4'),'port':0x18eb});var io=require(_0xc52a('0x5'))(new Redis(config[_0xc52a('0x3')]));function emit(_0x3bec71,_0x5c8089,_0x5003ce){io['to'](_0x3bec71)['emit'](_0x5c8089,_0x5003ce);}var headers={'Content-Type':_0xc52a('0x6'),'Accept':'application/json'};function getTicket(_0x168672,_0x5d6a03,_0xfe26be,_0x4c9762,_0x104985){logger['info'](_0xc52a('0x7'));return request({'uri':util[_0xc52a('0x8')]('%s/tickets.json',_0x168672[_0xc52a('0x9')]),'method':'POST','body':{'ticket':_[_0xc52a('0xa')]({'requester_id':_0xfe26be['id'],'submitter_id':_0x5d6a03?_0x5d6a03['id']:undefined,'assignee_id':_0x5d6a03?_0x5d6a03['id']:undefined,'tags':getTags(_0x4c9762[_0xc52a('0xb')],'name'),'subject':intUtil[_0xc52a('0xc')](_0x4c9762[_0xc52a('0xd')],_0x104985,'\x20'),'description':intUtil[_0xc52a('0xc')](_0x4c9762[_0xc52a('0xe')],_0x104985,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc52a('0xc')](_0x4c9762['Descriptions'],_0x104985,'\x0a')}},getCustomFields(_0x4c9762[_0xc52a('0xf')],_0x104985))}})['then'](function(_0x4253d1){logger[_0xc52a('0x10')](_0xc52a('0x11'));return _0x4253d1['ticket'];});}function getUser(_0x730dc,_0x58670a){if(intUtil[_0xc52a('0x12')](_0x58670a)){logger[_0xc52a('0x10')]('Getting\x20agent\x20with\x20email',_0x58670a);return request({'uri':util[_0xc52a('0x8')](_0xc52a('0x13'),_0x730dc[_0xc52a('0x9')]),'qs':{'query':util[_0xc52a('0x8')]('type:user\x20role:agent\x20email:%s',_0x58670a)}})[_0xc52a('0x14')](function(_0x24d92b){if(_0x24d92b['count']){logger[_0xc52a('0x10')](_0xc52a('0x15'));return _[_0xc52a('0x16')](_0x24d92b[_0xc52a('0x17')],{'email':_0x58670a,'role':'agent'});}else{logger[_0xc52a('0x10')](_0xc52a('0x18'));return request({'uri':util[_0xc52a('0x8')]('%s/users/me.json',_0x730dc['remoteUri'])})[_0xc52a('0x14')](function(_0x224300){logger[_0xc52a('0x10')](_0xc52a('0x19'));return _0x224300[_0xc52a('0x1a')];});}});}else{logger[_0xc52a('0x10')](_0xc52a('0x18'));return request({'uri':util[_0xc52a('0x8')]('%s/users/me.json',_0x730dc[_0xc52a('0x9')])})[_0xc52a('0x14')](function(_0x2ce9a7){logger['info'](_0xc52a('0x19'));return _0x2ce9a7[_0xc52a('0x1a')];});}}function getEndUser(_0x5416cd,_0x2156f6,_0x4e8f04){logger[_0xc52a('0x10')](_0xc52a('0x1b'),_0x4e8f04);return request({'uri':util['format']('%s/search.json',_0x5416cd[_0xc52a('0x9')]),'qs':{'query':util[_0xc52a('0x8')](_0xc52a('0x1c'),_0x4e8f04)}})[_0xc52a('0x14')](function(_0x2239d1){var _0x1d557c;if(_0x2239d1[_0xc52a('0x17')]['length']){_0x2239d1[_0xc52a('0x17')]=_[_0xc52a('0x1d')](_0x2239d1[_0xc52a('0x17')],{'suspended':![],'role':_0xc52a('0x1e')});if(_0x2239d1[_0xc52a('0x17')][_0xc52a('0x1f')]){_0x1d557c=_[_0xc52a('0x20')](_0x2239d1[_0xc52a('0x17')]);}}if(_0x1d557c){logger['info'](_0xc52a('0x21'));return _0x1d557c;}else{logger[_0xc52a('0x10')](_0xc52a('0x22'));return request({'uri':util[_0xc52a('0x8')](_0xc52a('0x23'),_0x5416cd[_0xc52a('0x9')]),'method':_0xc52a('0x24'),'body':{'user':{'role':'end-user','name':util[_0xc52a('0x8')](_0xc52a('0x25'),_0x2156f6||_0x4e8f04),'phone':_0x4e8f04}}})[_0xc52a('0x14')](function(_0xadc94a){logger['info'](_0xc52a('0x26'));return _0xadc94a['user'];});}});}function getAuth(_0x3c9a57){var _0x5c3c9f;if(_0x3c9a57[_0xc52a('0x27')]==='password'){_0x5c3c9f=util['format'](_0xc52a('0x28'),_0x3c9a57[_0xc52a('0x29')],_0x3c9a57[_0xc52a('0x2a')]);}else if(_0x3c9a57['authType']===_0xc52a('0x2b')){_0x5c3c9f=util[_0xc52a('0x8')]('%s/token:%s',_0x3c9a57[_0xc52a('0x29')],_0x3c9a57[_0xc52a('0x2b')]);}return util[_0xc52a('0x8')](_0xc52a('0x2c'),new Buffer(_0x5c3c9f)[_0xc52a('0x2d')](_0xc52a('0x2e')));}function request(_0x2fded0){logger[_0xc52a('0x2f')](_0xc52a('0x30'),JSON['stringify'](_0x2fded0));return rp(_[_0xc52a('0x31')](_0x2fded0,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1aa7df,_0x5c2e60){var _0x547ba8=[];if(_0x1aa7df&&_0x1aa7df[_0xc52a('0x1f')]>0x0){_0x547ba8=_['map'](_0x1aa7df,_0x5c2e60);}return _0x547ba8;}function getCustomFields(_0x5aeb18,_0x4f54eb){var _0x158b4c=[];var _0x35734d={'custom_fields':[]};if(_0x5aeb18[_0xc52a('0x1f')]>0x0){_[_0xc52a('0x32')](_0x5aeb18,function(_0x2941f1){if(_[_0xc52a('0x33')]([_0xc52a('0x34'),_0xc52a('0x35')],_0x2941f1['type'])&&_0x2941f1['nameField']&&!_0x2941f1[_0xc52a('0x36')]){_0x35734d[_0x2941f1[_0xc52a('0x37')]['toLowerCase']()]=_0x2941f1[_0xc52a('0x38')][_0xc52a('0x2d')]();}else if(_[_0xc52a('0x33')]([_0xc52a('0x34'),_0xc52a('0x35')],_0x2941f1['type'])&&_0x2941f1[_0xc52a('0x39')]&&_0x2941f1['customField']){_0x35734d[_0xc52a('0x3a')][_0xc52a('0x3b')]({'id':_0x2941f1[_0xc52a('0x39')],'value':_0x2941f1[_0xc52a('0x38')][_0xc52a('0x2d')]()});}else if(_0x2941f1[_0xc52a('0x3c')]===_0xc52a('0x3d')&&_0x2941f1['variableName']&&_0x2941f1[_0xc52a('0x39')]&&_0x2941f1['customField']){_0x4f54eb[_0x2941f1['variableName']]&&_0x35734d['custom_fields'][_0xc52a('0x3b')]({'id':_0x2941f1[_0xc52a('0x39')],'value':_0x4f54eb[_0x2941f1[_0xc52a('0x3e')]]['toString']()});}else if(_0x2941f1[_0xc52a('0x3c')]==='customVariable'&&_0x2941f1['Variable']&&_0x2941f1[_0xc52a('0x3f')][_0xc52a('0x40')]&&_0x2941f1[_0xc52a('0x39')]&&_0x2941f1[_0xc52a('0x36')]){_0x4f54eb[_0x2941f1[_0xc52a('0x3f')][_0xc52a('0x40')]['toLowerCase']()]&&_0x35734d[_0xc52a('0x3a')][_0xc52a('0x3b')]({'id':_0x2941f1[_0xc52a('0x39')],'value':_0x4f54eb[_0x2941f1[_0xc52a('0x3f')][_0xc52a('0x40')]['toLowerCase']()][_0xc52a('0x2d')]()});}});}return _0x35734d;}exports[_0xc52a('0x41')]=function(_0x45eae2,_0x13d6ea,_0x5c17e6,_0x825f99,_0x43476c,_0x109554){var _0x45b0db,_0x352bd7;_0x109554[_0xc52a('0x9')]=intUtil[_0xc52a('0x42')](_0x109554[_0xc52a('0x9')]);_0x109554[_0xc52a('0x43')]=intUtil[_0xc52a('0x42')](_0x109554[_0xc52a('0x43')]);if(_0x43476c&&_0x43476c[_0xc52a('0x44')]){logger[_0xc52a('0x10')](_0xc52a('0x45'),_0xc52a('0x46'));_0x13d6ea[_0xc52a('0x47')]=util[_0xc52a('0x8')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x109554[_0xc52a('0x43')],_0x13d6ea['uniqueid'],md5(_0x13d6ea[_0xc52a('0x48')]));}else{_0x13d6ea[_0xc52a('0x47')]='';}headers['Authorization']=getAuth(_0x109554);return getUser(_0x109554,_0x825f99[_0xc52a('0x49')])[_0xc52a('0x14')](function(_0x4937d3){_0x45b0db=_0x4937d3;logger[_0xc52a('0x10')](_0xc52a('0x4a'),_0x45b0db['id']);return getEndUser(_0x109554,_0x13d6ea[_0xc52a('0x4b')],_0x13d6ea[_0xc52a('0x4c')]);})[_0xc52a('0x14')](function(_0x12d2ac){_0x352bd7=_0x12d2ac;logger['info']('The\x20Enduser\x20ID\x20is:',_0x352bd7['id']);return getTicket(_0x109554,_0x45b0db,_0x352bd7,_0x5c17e6,_0x13d6ea);})[_0xc52a('0x14')](function(_0x11b956){if(_0x11b956){logger[_0xc52a('0x10')]('The\x20Ticket\x20ID\x20is:',_0x11b956['id']);switch(_0x109554[_0xc52a('0x3c')]){case _0xc52a('0x4d'):logger['info'](_0xc52a('0x45'),_0xc52a('0x4e'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x109554[_0xc52a('0x9')],_0x45b0db['id'],_0x11b956['id']),'method':'POST'});case _0xc52a('0x4f'):logger[_0xc52a('0x10')](_0xc52a('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc52a('0x8')](_0xc52a('0x50'),_0x825f99['name']),_0xc52a('0x51'),{'uri':util['format']('%s/agent/tickets/%s',_0x109554[_0xc52a('0x9')][_0xc52a('0x52')](_0xc52a('0x53'),''),_0x11b956['id'])});break;default:logger[_0xc52a('0x54')]('[QUEUE]',_0xc52a('0x55'));}}})[_0xc52a('0x56')](function(_0x42804e){logger['error'](_0xc52a('0x57'),util[_0xc52a('0x58')](_0x42804e,{'showHidden':!![],'depth':null}));});};exports[_0xc52a('0x59')]=function(_0x3da74c,_0x126d77,_0x157454,_0x196ba7,_0x3ab99f,_0x238f1b,_0x19843d){var _0x9164ea,_0x174308;_0x238f1b['remoteUri']=intUtil[_0xc52a('0x42')](_0x238f1b[_0xc52a('0x9')]);_0x238f1b[_0xc52a('0x43')]=intUtil['stripTrailingSlash'](_0x238f1b[_0xc52a('0x43')]);if(_0x19843d&&_0x19843d[_0xc52a('0x5a')]&&_0x19843d['recordingFormat']!==_0xc52a('0x5b')){logger[_0xc52a('0x10')](_0xc52a('0x5c'),_0xc52a('0x46'));_0x126d77[_0xc52a('0x47')]=util[_0xc52a('0x8')](_0xc52a('0x5d'),_0x238f1b[_0xc52a('0x43')],_0x126d77[_0xc52a('0x48')],md5(_0x126d77[_0xc52a('0x48')]));}headers[_0xc52a('0x5e')]=getAuth(_0x238f1b);return getUser(_0x238f1b,_0x196ba7['email'])[_0xc52a('0x14')](function(_0x15e157){_0x9164ea=_0x15e157;logger[_0xc52a('0x10')]('The\x20User\x20ID\x20is:',_0x9164ea['id']);return getEndUser(_0x238f1b,_0x126d77['destcalleridname'],_0x126d77[_0xc52a('0x5f')]);})[_0xc52a('0x14')](function(_0x8b1e66){_0x174308=_0x8b1e66;logger[_0xc52a('0x10')](_0xc52a('0x60'),_0x174308['id']);return getTicket(_0x238f1b,_0x9164ea,_0x174308,_0x157454,_0x126d77);})[_0xc52a('0x14')](function(_0x40db93){if(_0x40db93){logger['info']('The\x20Ticket\x20ID\x20is:',_0x40db93['id']);switch(_0x238f1b[_0xc52a('0x3c')]){case _0xc52a('0x4d'):logger['info'](_0xc52a('0x5c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc52a('0x8')](_0xc52a('0x61'),_0x238f1b[_0xc52a('0x9')],_0x9164ea['id'],_0x40db93['id']),'method':_0xc52a('0x24')});case _0xc52a('0x4f'):logger[_0xc52a('0x10')]('[OUTBOUND]',_0xc52a('0x62'));emit(util['format'](_0xc52a('0x50'),_0x196ba7[_0xc52a('0x40')]),'trigger:browser:url',{'uri':util[_0xc52a('0x8')](_0xc52a('0x63'),_0x238f1b[_0xc52a('0x9')][_0xc52a('0x52')](_0xc52a('0x53'),''),_0x40db93['id'])});break;default:logger[_0xc52a('0x54')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x11141b){logger['error'](_0xc52a('0x64'),util[_0xc52a('0x58')](_0x11141b,{'showHidden':!![],'depth':null}));});};exports[_0xc52a('0x65')]=function(_0x68ad42,_0x53edf7,_0x144f47,_0x2da90a,_0x3f18b6,_0x223e16){var _0x3e02e4,_0x461ef8;_0x223e16[_0xc52a('0x9')]=intUtil['stripTrailingSlash'](_0x223e16[_0xc52a('0x9')]);_0x223e16[_0xc52a('0x43')]=intUtil[_0xc52a('0x42')](_0x223e16['serverUrl']);if(_0x3f18b6&&_0x3f18b6[_0xc52a('0x44')]){logger[_0xc52a('0x10')]('['+_0x53edf7[_0xc52a('0x66')][_0xc52a('0x67')]()+']','Recording\x20is\x20enabled!');_0x53edf7[_0xc52a('0x47')]=util[_0xc52a('0x8')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x223e16[_0xc52a('0x43')],_0x53edf7[_0xc52a('0x48')],md5(_0x53edf7[_0xc52a('0x48')]));}else{_0x53edf7[_0xc52a('0x47')]='';}headers[_0xc52a('0x5e')]=getAuth(_0x223e16);return getUser(_0x223e16)[_0xc52a('0x14')](function(_0x37d83b){_0x3e02e4=_0x37d83b;logger[_0xc52a('0x10')](_0xc52a('0x4a'),_0x3e02e4['id']);return getEndUser(_0x223e16,_0x53edf7['calleridname'],_0x53edf7[_0xc52a('0x4c')]);})[_0xc52a('0x14')](function(_0xe0f92d){_0x461ef8=_0xe0f92d;logger[_0xc52a('0x10')](_0xc52a('0x60'),_0x461ef8['id']);return getTicket(_0x223e16,_0x3e02e4,_0x461ef8,_0x144f47,_0x53edf7);})[_0xc52a('0x14')](function(_0x55422a){if(_0x55422a){logger[_0xc52a('0x10')](_0xc52a('0x68'),_0x55422a['id']);}})[_0xc52a('0x56')](function(_0x80f6f6){logger[_0xc52a('0x54')]('['+_0x53edf7[_0xc52a('0x66')]['toUpperCase']()+']'+_0xc52a('0x69'),util[_0xc52a('0x58')](_0x80f6f6,{'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 d093635..6996729 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 _0x9789=['YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','timeout','Timeout','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','debug','stringify','string','picklist','content','type','variableName','idField','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','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','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','administrator','first_name','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','utc','talktime','format','mm:ss','answertime','endtime'];(function(_0x2cc197,_0x2510e1){var _0x42d46e=function(_0x32f547){while(--_0x32f547){_0x2cc197['push'](_0x2cc197['shift']());}};_0x42d46e(++_0x2510e1);}(_0x9789,0xc7));var _0x9978=function(_0x4e9274,_0x49576e){_0x4e9274=_0x4e9274-0x0;var _0x8b474c=_0x9789[_0x4e9274];return _0x8b474c;};'use strict';var _=require(_0x9978('0x0'));var rp=require(_0x9978('0x1'));var md5=require(_0x9978('0x2'));var util=require('util');var intUtil=require(_0x9978('0x3'));var moment=require(_0x9978('0x4'));var Redis=require(_0x9978('0x5'));var BPromise=require(_0x9978('0x6'));var config=require(_0x9978('0x7'));var logger=require(_0x9978('0x8'))(_0x9978('0x9'));config[_0x9978('0xa')]=_['defaults'](config[_0x9978('0xa')],{'host':_0x9978('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9978('0xa')]));function emit(_0x5b5d2b,_0xabdab2,_0x38e044){io['to'](_0x5b5d2b)['emit'](_0xabdab2,_0x38e044);}function request(_0x39d012){logger[_0x9978('0xc')]('[HTTP]',JSON[_0x9978('0xd')](_0x39d012));return rp(_0x39d012);}function getCustomFields(_0x2d7c96,_0x3573af){var _0x13c132={};if(_0x2d7c96['length']>0x0){_['forEach'](_0x2d7c96,function(_0x20797b){if(_['includes']([_0x9978('0xe'),_0x9978('0xf')],_0x20797b['type'])&&_0x20797b['idField']){_0x13c132[_0x20797b['idField']]=_0x20797b[_0x9978('0x10')]['toString']();}else if(_0x20797b[_0x9978('0x11')]==='variable'&&_0x20797b[_0x9978('0x12')]&&_0x20797b[_0x9978('0x13')]&&_0x3573af[_0x20797b[_0x9978('0x12')]]){_0x13c132[_0x20797b[_0x9978('0x13')]]=_0x3573af[_0x20797b[_0x9978('0x12')]][_0x9978('0x14')]();}else if(_0x20797b[_0x9978('0x11')]===_0x9978('0x15')&&_0x20797b[_0x9978('0x16')]&&_0x20797b['Variable'][_0x9978('0x17')]&&_0x20797b[_0x9978('0x13')]&&_0x3573af[_0x20797b[_0x9978('0x16')]['name'][_0x9978('0x18')]()]){_0x13c132[_0x20797b[_0x9978('0x13')]]=_0x3573af[_0x20797b[_0x9978('0x16')][_0x9978('0x17')]['toLowerCase']()]['toString']();}});}return _0x13c132;}function getName(_0x15b860){if(_0x15b860[_0x9978('0x19')]('\x20')>0x0){var _0x153e43=_0x15b860[_0x9978('0x1a')](/ (.+)/);if(_0x153e43[0x1]){return _0x153e43;}}return[_0x15b860,_0x15b860];}var accountsTokens={};function getAccessToken(_0x491aba){return new Promise(function(_0x13cbfe,_0x4fa754){if(!_[_0x9978('0x1b')](accountsTokens[_0x491aba['id']])&&!_[_0x9978('0x1b')](accountsTokens[_0x491aba['id']][_0x9978('0x1c')])){if(moment()[_0x9978('0x1d')](accountsTokens[_0x491aba['id']][_0x9978('0x1e')])){_0x13cbfe(accountsTokens[_0x491aba['id']]['access_token']);}}var _0x228de5;switch(_0x491aba[_0x9978('0x1f')]){case'US':_0x228de5='https://accounts.zoho.com';break;case'AU':_0x228de5='https://accounts.zoho.com.au';break;case'EU':_0x228de5=_0x9978('0x20');break;case'IN':_0x228de5=_0x9978('0x21');break;case'CN':_0x228de5='https://accounts.zoho.com.cn';break;default:_0x228de5='https://accounts.zoho.eu';break;}var _0x17fcad={'method':_0x9978('0x22'),'uri':_0x228de5+_0x9978('0x23'),'qs':{'refresh_token':_0x491aba['refreshToken'],'client_id':_0x491aba['clientId'],'client_secret':_0x491aba[_0x9978('0x24')],'grant_type':_0x9978('0x25')},'json':!![]};return rp(_0x17fcad)[_0x9978('0x26')](function(_0x4b9994){accountsTokens[_0x491aba['id']]={'access_token':_0x4b9994[_0x9978('0x1c')],'expires_in':moment()[_0x9978('0x27')](_0x4b9994[_0x9978('0x1e')],_0x9978('0x28'))};_0x13cbfe(_0x4b9994['access_token']);})[_0x9978('0x29')](function(_0x57cedf){logger[_0x9978('0x2a')](_0x9978('0x2b'),_0x57cedf[_0x9978('0x2c')]);_0x4fa754(_0x57cedf);});});}function getUser(_0x134fd3,_0x1c5af5,_0xbda0fc,_0x8b6206){logger[_0x9978('0x2d')](_0x9978('0x2e'));return request({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x1c5af5),'qs':{'type':_0x9978('0x2f')},'headers':{'Authorization':_0x9978('0x30')+_0x134fd3},'json':!![]})[_0x9978('0x26')](function(_0x5c311f){if(_0x5c311f[_0x9978('0x31')]){var _0x248b6b=-0x1;if(_['isArrayLikeObject'](_0x5c311f['users'])){if(!_[_0x9978('0x1b')](_0x8b6206)){_0x248b6b=_[_0x9978('0x32')](_0x5c311f[_0x9978('0x31')],function(_0x51e716){return _0x51e716[_0x9978('0x33')]===_0x8b6206;});}if(_0x248b6b>=0x0){logger[_0x9978('0x2d')]('Agent\x20found!');}else{logger['info'](_0x9978('0x34'));_0x248b6b=_[_0x9978('0x32')](_0x5c311f[_0x9978('0x31')],function(_0x1a9e58){return _0x1a9e58['profile'][_0x9978('0x17')]===_0x9978('0x35');});}return _0x5c311f[_0x9978('0x31')][_0x248b6b];}else{if(_0x5c311f[_0x9978('0x36')][_0x9978('0x37')][_0x9978('0x17')]===_0x9978('0x35')){logger[_0x9978('0x2d')](_0x9978('0x34'));user=_0x5c311f[_0x9978('0x36')];return user;}else{logger[_0x9978('0x2a')](_0x9978('0x38'),JSON['stringify'](_0x5c311f));throw new Error(_0x9978('0x39')+JSON[_0x9978('0xd')](_0x5c311f));}}}else{logger[_0x9978('0x2a')](_0x9978('0x38'),JSON[_0x9978('0xd')](_0x5c311f));throw new Error(_0x9978('0x39')+JSON['stringify'](_0x5c311f));}})[_0x9978('0x29')](function(_0x5f031e){console['error'](_0x5f031e);});}function getZohoUser(_0x3346d2,_0x10829e){return new BPromise(function(_0x26019a,_0x421928){request(_0x3346d2)['then'](function(_0x211230){var _0x4c1178=null;if(_0x211230){_0x4c1178=_0x211230[_0x9978('0x3a')][0x0];_0x4c1178[_0x9978('0x3b')]=_0x10829e;}_0x26019a(_0x4c1178);})[_0x9978('0x29')](function(_0x58ca02){_0x421928(_0x58ca02);});});}function createEndUser(_0x46dd75,_0x508e60,_0x377781,_0x118f03,_0x7c5d71,_0x2b617b){var _0x377781=getName(_0x377781);return request({'method':_0x9978('0x22'),'uri':'https://www.zohoapis.'+_0x508e60+_0x9978('0x3c')+_[_0x9978('0x3d')](_0x2b617b[_0x9978('0x3e')])+'s','body':{'data':[{'Last_Name':_0x377781[0x1],'First_Name':_0x377781[0x0],'Phone':_0x118f03,'Owner':{'name':!_[_0x9978('0x1b')](_0x7c5d71[_0x9978('0x3f')][_0x9978('0x17')])?_0x7c5d71['role']['name']:!_[_0x9978('0x1b')](_0x7c5d71['first_name'])?_0x7c5d71['first_name']+'\x20'+_0x7c5d71[_0x9978('0x40')]:_0x7c5d71['last_name'],'id':_0x7c5d71['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x46dd75},'json':!![]})[_0x9978('0x26')](function(_0x681ecb){if(_0x681ecb&&_0x681ecb['data'][0x0][_0x9978('0x41')]===_0x9978('0x42')){var _0x2b951f=_0x681ecb['data'][0x0][_0x9978('0x43')];_0x2b951f['enduserType']=_[_0x9978('0x3d')](_0x2b617b[_0x9978('0x3e')])+'s';return _0x2b951f;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x9978('0xd')](data));throw new Error(_0x9978('0x44')+JSON[_0x9978('0xd')](data));})[_0x9978('0x29')](function(_0x364ea4){console[_0x9978('0x45')](_0x9978('0x46'),_0x364ea4);});}function getEndUser(_0x44ce14,_0x371ff7,_0x17b5d8,_0x310673,_0x1d36ea,_0x4a6c16,_0x4d5bd7){var _0x45df31={'method':_0x9978('0x47'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x44ce14},'json':!![]};switch(_0x4d5bd7['moduleSearch']){case'contact_lead':_0x45df31[_0x9978('0x48')]=_0x9978('0x49')+_0x371ff7+_0x9978('0x4a')+_0x1d36ea+'))';return getZohoUser(_0x45df31,_0x9978('0x4b'))[_0x9978('0x26')](function(_0x543986){if(_0x543986)return _0x543986;_0x45df31[_0x9978('0x48')]=_0x9978('0x49')+_0x371ff7+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1d36ea+'))';return getZohoUser(_0x45df31,'Leads')[_0x9978('0x26')](function(_0x4a6800){if(_0x4a6800)return _0x4a6800;if(_0x4d5bd7[_0x9978('0x3e')]!=_0x9978('0x4c')){return createEndUser(_0x44ce14,_0x371ff7,_0x310673,_0x1d36ea,_0x4a6c16,_0x4d5bd7);}else{return{};}});});break;case'contact':_0x45df31[_0x9978('0x48')]=_0x9978('0x49')+_0x371ff7+_0x9978('0x4a')+_0x1d36ea+'))';return getZohoUser(_0x45df31,_0x9978('0x4b'))[_0x9978('0x26')](function(_0x24bb11){if(_0x24bb11)return _0x24bb11;if(_0x4d5bd7[_0x9978('0x3e')]!=_0x9978('0x4c')){return createEndUser(_0x44ce14,_0x371ff7,_0x310673,_0x1d36ea,_0x4a6c16,_0x4d5bd7);}else{return{};}});break;case _0x9978('0x4d'):_0x45df31[_0x9978('0x48')]=_0x9978('0x49')+_0x371ff7+_0x9978('0x4e')+_0x1d36ea+'))';return getZohoUser(_0x45df31,_0x9978('0x4f'))[_0x9978('0x26')](function(_0x59d5d3){if(_0x59d5d3)return _0x59d5d3;if(_0x4d5bd7[_0x9978('0x3e')]!=_0x9978('0x4c')){return createEndUser(_0x44ce14,_0x371ff7,_0x310673,_0x1d36ea,_0x4a6c16,_0x4d5bd7);}else{return{};}});break;}}function getCall(_0xebef6e,_0x352fce,_0x27f4da,_0x1bcd8b,_0x29d78a,_0x213321,_0x1fd766,_0x5a2527){logger[_0x9978('0x2d')](_0x9978('0x50'));var _0x3e13d3={};_0x3e13d3['Owner']={'name':!_[_0x9978('0x1b')](_0x1bcd8b[_0x9978('0x3f')]['name'])&&!_[_0x9978('0x1b')](_0x1bcd8b[_0x9978('0x37')]['name'])&&_0x1bcd8b[_0x9978('0x37')]['name']===_0x9978('0x51')?_0x1bcd8b[_0x9978('0x3f')][_0x9978('0x17')]:!_[_0x9978('0x1b')](_0x1bcd8b[_0x9978('0x52')])?_0x1bcd8b[_0x9978('0x52')]+'\x20'+_0x1bcd8b['last_name']:_0x1bcd8b[_0x9978('0x40')],'id':_0x1bcd8b['id']};_0x3e13d3['Subject']=intUtil[_0x9978('0x53')](_0x213321[_0x9978('0x54')],_0x1fd766,'\x20');_0x3e13d3[_0x9978('0x55')]=intUtil[_0x9978('0x53')](_0x213321[_0x9978('0x56')],_0x1fd766,'\x0a');if(_0x29d78a[_0x9978('0x3b')]===_0x9978('0x4b')){_0x3e13d3[_0x9978('0x57')]={'name':!_[_0x9978('0x1b')](_0x29d78a[_0x9978('0x58')])?_0x29d78a[_0x9978('0x58')]:!_[_0x9978('0x1b')](_0x29d78a[_0x9978('0x59')])?_0x29d78a[_0x9978('0x59')]+'\x20'+_0x29d78a['Last_Name']:_0x29d78a[_0x9978('0x5a')],'id':_0x29d78a['id']};}if(_0x29d78a[_0x9978('0x3b')]===_0x9978('0x4f')){_0x3e13d3['What_Id']={'name':!_['isNil'](_0x29d78a['Full_Name'])?_0x29d78a['Full_Name']:!_['isNil'](_0x29d78a[_0x9978('0x59')])?_0x29d78a[_0x9978('0x59')]+'\x20'+_0x29d78a[_0x9978('0x5a')]:_0x29d78a[_0x9978('0x5a')],'id':_0x29d78a['id']};_0x3e13d3[_0x9978('0x5b')]=_[_0x9978('0x3d')](_0x29d78a[_0x9978('0x3b')]);}if(_0x1fd766['talktime']){_0x3e13d3[_0x9978('0x5c')]=moment[_0x9978('0x5d')](parseInt(_0x1fd766[_0x9978('0x5e')])*0x3e8)[_0x9978('0x5f')](_0x9978('0x60'));}else if(_0x1fd766[_0x9978('0x61')]&&_0x1fd766[_0x9978('0x62')]){_0x3e13d3[_0x9978('0x5c')]=moment[_0x9978('0x5d')](moment(_0x1fd766[_0x9978('0x62')],_0x9978('0x63'))[_0x9978('0x64')](moment(_0x1fd766['starttime'],_0x9978('0x63'))))[_0x9978('0x5f')]('mm:ss');}switch(_0x1fd766[_0x9978('0x65')]){case _0x9978('0x66'):_0x3e13d3['Call_Result']=_0x9978('0x67');break;case _0x9978('0x68'):case _0x9978('0x69'):_0x3e13d3[_0x9978('0x6a')]=_0x9978('0x6b');break;case _0x9978('0x6c'):_0x3e13d3['Call_Result']=_0x9978('0x6d');break;case _0x9978('0x6e'):_0x3e13d3[_0x9978('0x6a')]='Abandoned';break;case _0x9978('0x6f'):_0x3e13d3[_0x9978('0x6a')]=_0x9978('0x70');default:}_0x3e13d3['Call_Start_Time']=(_0x5a2527===_0x9978('0x71')?moment(_0x1fd766[_0x9978('0x72')])[_0x9978('0x5f')](_0x9978('0x63')):moment(_0x1fd766[_0x9978('0x73')])['format'](_0x9978('0x63')))||moment()[_0x9978('0x5f')]('YYYY-MM-DDTHH:mm:ss');_0x3e13d3[_0x9978('0x74')]=_0x5a2527||_0x9978('0x75');_0x3e13d3=_[_0x9978('0x76')](_0x3e13d3,getCustomFields(_0x213321[_0x9978('0x77')],_0x1fd766));return request({'method':_0x9978('0x22'),'uri':_0x9978('0x49')+_0x352fce+_0x9978('0x78'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xebef6e},'body':{'data':[_0x3e13d3]},'json':!![]})[_0x9978('0x26')](function(_0x3276ce){if(_0x3276ce&&_0x3276ce[_0x9978('0x3a')][0x0][_0x9978('0x41')]===_0x9978('0x42')){logger['info']('Call\x20created!');return{'id':_0x3276ce['data'][0x0]['details']['id']};}})[_0x9978('0x29')](function(_0x3f1f09){logger['info']('err',_0x3f1f09[_0x9978('0x2c')]);console[_0x9978('0x45')](_0x9978('0x79'),_0x3f1f09);});}exports[_0x9978('0x7a')]=function(_0x142733,_0x2c5eaf,_0x4d4f7c,_0x24c68f,_0x5ce8e3,_0x4f558a){var _0x1684dc,_0x3d90d6,_0x31c1bc;_0x4f558a[_0x9978('0x7b')]=intUtil[_0x9978('0x7c')](_0x4f558a[_0x9978('0x7b')]);_0x4f558a[_0x9978('0x7d')]=intUtil[_0x9978('0x7c')](_0x4f558a[_0x9978('0x7d')]);if(_0x5ce8e3&&_0x5ce8e3['monitor_format']){logger[_0x9978('0x2d')](_0x9978('0x7e'),_0x9978('0x7f'));_0x2c5eaf['recordingURL']=_0x4f558a['serverUrl']+_0x9978('0x80')+_0x2c5eaf[_0x9978('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x2c5eaf[_0x9978('0x81')]);}else{_0x2c5eaf[_0x9978('0x82')]='';}var _0x17bf79=_0x4f558a['host']===_0x9978('0x83')?'eu':_0x9978('0x84');return getAccessToken(_0x4f558a)[_0x9978('0x26')](function(_0x3aba15){_0x31c1bc=_0x3aba15;return getUser(_0x31c1bc,_0x17bf79,_0x4f558a,_0x24c68f[_0x9978('0x33')]);})[_0x9978('0x26')](function(_0x16f94c){_0x1684dc=_0x16f94c;logger[_0x9978('0x2d')](_0x9978('0x85'),_0x1684dc['id']);return getEndUser(_0x31c1bc,_0x17bf79,_0x4f558a,_0x2c5eaf[_0x9978('0x86')],_0x2c5eaf[_0x9978('0x87')],_0x1684dc,_0x4d4f7c);})[_0x9978('0x26')](function(_0x1ac333){_0x3d90d6=_0x1ac333;return getCall(_0x31c1bc,_0x17bf79,_0x4f558a,_0x1684dc,_0x3d90d6,_0x4d4f7c,_0x2c5eaf,_0x9978('0x75'));})['then'](function(_0x1b02d5){if(_0x1b02d5){logger[_0x9978('0x2d')](_0x9978('0x88'),_0x1b02d5['id']);logger[_0x9978('0x2d')](_0x9978('0x7e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9978('0x5f')]('user:%s',_0x24c68f[_0x9978('0x17')]),_0x9978('0x89'),{'uri':_0x9978('0x8a')+_0x4f558a[_0x9978('0x7b')]+_0x9978('0x8b')+_0x1b02d5['id']});}})[_0x9978('0x29')](function(_0x1f7703){logger[_0x9978('0x2a')](_0x9978('0x7e'),JSON[_0x9978('0xd')](_0x1f7703));});};exports[_0x9978('0x71')]=function(_0x4e1ea5,_0x2ac74e,_0x3e6d4f,_0x5f39d7,_0x305839,_0x2ac759,_0x24840e){var _0x4d5fd8,_0x431117,_0x1047c5;_0x2ac759[_0x9978('0x7b')]=intUtil[_0x9978('0x7c')](_0x2ac759[_0x9978('0x7b')]);_0x2ac759[_0x9978('0x7d')]=intUtil[_0x9978('0x7c')](_0x2ac759[_0x9978('0x7d')]);if(_0x24840e&&_0x24840e[_0x9978('0x8c')]&&_0x24840e['recordingFormat']!=='none'){logger[_0x9978('0x2d')](_0x9978('0x8d'),'Recording\x20is\x20enabled!');_0x2ac74e[_0x9978('0x82')]=_0x2ac759[_0x9978('0x7d')]+_0x9978('0x80')+_0x2ac74e[_0x9978('0x81')]+_0x9978('0x8e')+md5(_0x2ac74e[_0x9978('0x81')]);}var _0x415259=_0x2ac759['host']===_0x9978('0x83')?'eu':'com';return getAccessToken(_0x2ac759)[_0x9978('0x26')](function(_0x319b59){_0x1047c5=_0x319b59;return getUser(_0x1047c5,_0x415259,_0x2ac759,_0x5f39d7[_0x9978('0x33')]);})[_0x9978('0x26')](function(_0x3e6049){_0x4d5fd8=_0x3e6049;logger[_0x9978('0x2d')](_0x9978('0x85'),_0x4d5fd8['id']);return getEndUser(_0x1047c5,_0x415259,_0x2ac759,_0x2ac74e[_0x9978('0x8f')],_0x2ac74e[_0x9978('0x90')],_0x4d5fd8,_0x3e6d4f);})['then'](function(_0x222411){_0x431117=_0x222411;return getCall(_0x1047c5,_0x415259,_0x2ac759,_0x4d5fd8,_0x431117,_0x3e6d4f,_0x2ac74e,_0x9978('0x91'));})[_0x9978('0x26')](function(_0xbb16e5){if(_0xbb16e5){logger[_0x9978('0x2d')]('The\x20Call\x20ID\x20is:',_0xbb16e5['id']);logger[_0x9978('0x2d')](_0x9978('0x8d'),_0x9978('0x92'));emit(util[_0x9978('0x5f')]('user:%s',_0x5f39d7['name']),_0x9978('0x89'),{'uri':_0x9978('0x8a')+_0x2ac759['host']+_0x9978('0x8b')+_0xbb16e5['id']});}})[_0x9978('0x29')](function(_0x257614){logger[_0x9978('0x2a')](_0x9978('0x8d'),JSON[_0x9978('0xd')](_0x257614));});};exports[_0x9978('0x93')]=function(_0x3a5cf8,_0x527933,_0x1183cb,_0x1aec95,_0x58b2bb,_0x3981b4){var _0x19bb25,_0x4b45dc,_0x5cb08d;_0x3981b4[_0x9978('0x7b')]=intUtil['stripTrailingSlash'](_0x3981b4[_0x9978('0x7b')]);_0x3981b4[_0x9978('0x7d')]=intUtil[_0x9978('0x7c')](_0x3981b4['serverUrl']);if(_0x58b2bb&&_0x58b2bb['monitor_format']){logger[_0x9978('0x2d')]('['+_0x527933[_0x9978('0x65')][_0x9978('0x94')]()+']',_0x9978('0x7f'));_0x527933['recordingURL']=_0x3981b4[_0x9978('0x7d')]+'/api/voice/recordings/'+_0x527933[_0x9978('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x527933[_0x9978('0x81')]);}else{_0x527933[_0x9978('0x82')]='';}var _0x960a63=_0x3981b4[_0x9978('0x7b')]===_0x9978('0x83')?'eu':_0x9978('0x84');return getAccessToken(_0x3981b4)[_0x9978('0x26')](function(_0x16e5ce){_0x5cb08d=_0x16e5ce;return getUser(_0x5cb08d,_0x960a63,_0x3981b4);})[_0x9978('0x26')](function(_0x542736){_0x19bb25=_0x542736;logger[_0x9978('0x2d')](_0x9978('0x85'),_0x19bb25['id']);return getEndUser(_0x5cb08d,_0x960a63,_0x3981b4,_0x527933[_0x9978('0x86')],_0x527933[_0x9978('0x87')],_0x19bb25,_0x1183cb);})[_0x9978('0x26')](function(_0x3c414b){_0x4b45dc=_0x3c414b;return getCall(_0x5cb08d,_0x960a63,_0x3981b4,_0x19bb25,_0x4b45dc,_0x1183cb,_0x527933,'Inbound');})[_0x9978('0x26')](function(_0x328fda){if(_0x328fda){logger[_0x9978('0x2d')](_0x9978('0x88'),_0x328fda['id']);}})['catch'](function(_0x2b435d){logger[_0x9978('0x2a')]('['+_0x527933[_0x9978('0x65')][_0x9978('0x94')]()+']',JSON['stringify'](_0x2b435d));});}; \ No newline at end of file +var _0xf3f9=['trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','stripTrailingSlash','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','com','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','unmanaged','zoho.eu','toUpperCase','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','enduserType','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf3f9,0x14a));var _0x9f3f=function(_0x82eee9,_0x7db9f1){_0x82eee9=_0x82eee9-0x0;var _0x13626a=_0xf3f9[_0x82eee9];return _0x13626a;};'use strict';var _=require(_0x9f3f('0x0'));var rp=require('request-promise');var md5=require(_0x9f3f('0x1'));var util=require(_0x9f3f('0x2'));var intUtil=require(_0x9f3f('0x3'));var moment=require(_0x9f3f('0x4'));var Redis=require(_0x9f3f('0x5'));var BPromise=require(_0x9f3f('0x6'));var config=require(_0x9f3f('0x7'));var logger=require(_0x9f3f('0x8'))('zoho');config[_0x9f3f('0x9')]=_[_0x9f3f('0xa')](config[_0x9f3f('0x9')],{'host':_0x9f3f('0xb'),'port':0x18eb});var io=require(_0x9f3f('0xc'))(new Redis(config[_0x9f3f('0x9')]));function emit(_0xa17a0f,_0x7bd8d9,_0x83eb85){io['to'](_0xa17a0f)[_0x9f3f('0xd')](_0x7bd8d9,_0x83eb85);}function request(_0x5aba55){logger[_0x9f3f('0xe')]('[HTTP]',JSON[_0x9f3f('0xf')](_0x5aba55));return rp(_0x5aba55);}function getCustomFields(_0x2ea36c,_0x2e821a){var _0x4c7ba7={};if(_0x2ea36c[_0x9f3f('0x10')]>0x0){_[_0x9f3f('0x11')](_0x2ea36c,function(_0x22d5aa){if(_[_0x9f3f('0x12')]([_0x9f3f('0x13'),_0x9f3f('0x14')],_0x22d5aa[_0x9f3f('0x15')])&&_0x22d5aa[_0x9f3f('0x16')]){_0x4c7ba7[_0x22d5aa[_0x9f3f('0x16')]]=_0x22d5aa['content'][_0x9f3f('0x17')]();}else if(_0x22d5aa[_0x9f3f('0x15')]===_0x9f3f('0x18')&&_0x22d5aa['variableName']&&_0x22d5aa[_0x9f3f('0x16')]&&_0x2e821a[_0x22d5aa['variableName']]){_0x4c7ba7[_0x22d5aa[_0x9f3f('0x16')]]=_0x2e821a[_0x22d5aa[_0x9f3f('0x19')]]['toString']();}else if(_0x22d5aa[_0x9f3f('0x15')]===_0x9f3f('0x1a')&&_0x22d5aa['Variable']&&_0x22d5aa[_0x9f3f('0x1b')][_0x9f3f('0x1c')]&&_0x22d5aa[_0x9f3f('0x16')]&&_0x2e821a[_0x22d5aa['Variable'][_0x9f3f('0x1c')][_0x9f3f('0x1d')]()]){_0x4c7ba7[_0x22d5aa[_0x9f3f('0x16')]]=_0x2e821a[_0x22d5aa[_0x9f3f('0x1b')]['name'][_0x9f3f('0x1d')]()][_0x9f3f('0x17')]();}});}return _0x4c7ba7;}function getName(_0x4d81ab){if(_0x4d81ab['indexOf']('\x20')>0x0){var _0x40cc37=_0x4d81ab[_0x9f3f('0x1e')](/ (.+)/);if(_0x40cc37[0x1]){return _0x40cc37;}}return[_0x4d81ab,_0x4d81ab];}var accountsTokens={};function getAccessToken(_0x4dc997){return new Promise(function(_0x4503aa,_0x1d30b){if(!_[_0x9f3f('0x1f')](accountsTokens[_0x4dc997['id']])&&!_[_0x9f3f('0x1f')](accountsTokens[_0x4dc997['id']]['access_token'])){if(moment()[_0x9f3f('0x20')](accountsTokens[_0x4dc997['id']][_0x9f3f('0x21')])){_0x4503aa(accountsTokens[_0x4dc997['id']][_0x9f3f('0x22')]);}}var _0x2c0d42;switch(_0x4dc997[_0x9f3f('0x23')]){case'US':_0x2c0d42=_0x9f3f('0x24');break;case'AU':_0x2c0d42=_0x9f3f('0x25');break;case'EU':_0x2c0d42='https://accounts.zoho.eu';break;case'IN':_0x2c0d42=_0x9f3f('0x26');break;case'CN':_0x2c0d42=_0x9f3f('0x27');break;default:_0x2c0d42=_0x9f3f('0x28');break;}var _0x2a43f0={'method':_0x9f3f('0x29'),'uri':_0x2c0d42+_0x9f3f('0x2a'),'qs':{'refresh_token':_0x4dc997[_0x9f3f('0x2b')],'client_id':_0x4dc997[_0x9f3f('0x2c')],'client_secret':_0x4dc997[_0x9f3f('0x2d')],'grant_type':_0x9f3f('0x2e')},'json':!![]};return rp(_0x2a43f0)[_0x9f3f('0x2f')](function(_0x4287d7){accountsTokens[_0x4dc997['id']]={'access_token':_0x4287d7[_0x9f3f('0x22')],'expires_in':moment()[_0x9f3f('0x30')](_0x4287d7[_0x9f3f('0x21')],'seconds')};_0x4503aa(_0x4287d7[_0x9f3f('0x22')]);})['catch'](function(_0x127230){logger[_0x9f3f('0x31')](_0x9f3f('0x32'),_0x127230[_0x9f3f('0x33')]);_0x1d30b(_0x127230);});});}function getUser(_0x3d6c7,_0x2bf879,_0x5a6e12,_0x5afec1){logger['info'](_0x9f3f('0x34'));return request({'method':_0x9f3f('0x35'),'uri':util[_0x9f3f('0x36')](_0x9f3f('0x37'),_0x2bf879),'qs':{'type':_0x9f3f('0x38')},'headers':{'Authorization':_0x9f3f('0x39')+_0x3d6c7},'json':!![]})[_0x9f3f('0x2f')](function(_0x1c7493){if(_0x1c7493['users']){var _0x4d0d78=-0x1;if(_['isArrayLikeObject'](_0x1c7493[_0x9f3f('0x3a')])){if(!_['isNil'](_0x5afec1)){_0x4d0d78=_['findIndex'](_0x1c7493[_0x9f3f('0x3a')],function(_0x505cba){return _0x505cba[_0x9f3f('0x3b')]===_0x5afec1;});}if(_0x4d0d78>=0x0){logger[_0x9f3f('0x3c')](_0x9f3f('0x3d'));}else{logger[_0x9f3f('0x3c')](_0x9f3f('0x3e'));_0x4d0d78=_[_0x9f3f('0x3f')](_0x1c7493[_0x9f3f('0x3a')],function(_0xfb543f){return _0xfb543f[_0x9f3f('0x40')][_0x9f3f('0x1c')]===_0x9f3f('0x41');});}return _0x1c7493[_0x9f3f('0x3a')][_0x4d0d78];}else{if(_0x1c7493[_0x9f3f('0x42')][_0x9f3f('0x40')][_0x9f3f('0x1c')]===_0x9f3f('0x41')){logger[_0x9f3f('0x3c')](_0x9f3f('0x3e'));user=_0x1c7493[_0x9f3f('0x42')];return user;}else{logger[_0x9f3f('0x31')](_0x9f3f('0x43'),JSON[_0x9f3f('0xf')](_0x1c7493));throw new Error(_0x9f3f('0x44')+JSON[_0x9f3f('0xf')](_0x1c7493));}}}else{logger[_0x9f3f('0x31')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x1c7493));throw new Error(_0x9f3f('0x44')+JSON[_0x9f3f('0xf')](_0x1c7493));}})[_0x9f3f('0x45')](function(_0x1f0bf5){console[_0x9f3f('0x31')](_0x1f0bf5);});}function getZohoUser(_0x403795,_0x453983){return new BPromise(function(_0x2aadf3,_0x2e6a5e){request(_0x403795)[_0x9f3f('0x2f')](function(_0x1dc441){var _0x370e96=null;if(_0x1dc441){_0x370e96=_0x1dc441[_0x9f3f('0x46')][0x0];_0x370e96['enduserType']=_0x453983;}_0x2aadf3(_0x370e96);})[_0x9f3f('0x45')](function(_0x21f8e9){_0x2e6a5e(_0x21f8e9);});});}function createEndUser(_0x35e84c,_0x5330d5,_0xdcb3b6,_0x56c7d7,_0x552ca2,_0x2a5e11){var _0xdcb3b6=getName(_0xdcb3b6);return request({'method':_0x9f3f('0x29'),'uri':_0x9f3f('0x47')+_0x5330d5+'/crm/v2/'+_[_0x9f3f('0x48')](_0x2a5e11[_0x9f3f('0x49')])+'s','body':{'data':[{'Last_Name':_0xdcb3b6[0x1],'First_Name':_0xdcb3b6[0x0],'Phone':_0x56c7d7,'Owner':{'name':!_['isNil'](_0x552ca2[_0x9f3f('0x4a')]['name'])?_0x552ca2[_0x9f3f('0x4a')][_0x9f3f('0x1c')]:!_['isNil'](_0x552ca2[_0x9f3f('0x4b')])?_0x552ca2[_0x9f3f('0x4b')]+'\x20'+_0x552ca2['last_name']:_0x552ca2[_0x9f3f('0x4c')],'id':_0x552ca2['id']}}]},'headers':{'Authorization':_0x9f3f('0x39')+_0x35e84c},'json':!![]})[_0x9f3f('0x2f')](function(_0x58b207){if(_0x58b207&&_0x58b207[_0x9f3f('0x46')][0x0]['code']===_0x9f3f('0x4d')){var _0x5db2cb=_0x58b207[_0x9f3f('0x46')][0x0][_0x9f3f('0x4e')];_0x5db2cb[_0x9f3f('0x4f')]=_[_0x9f3f('0x48')](_0x2a5e11[_0x9f3f('0x49')])+'s';return _0x5db2cb;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x9f3f('0xf')](data));throw new Error('Error:\x20'+JSON[_0x9f3f('0xf')](data));})['catch'](function(_0x4ec8f2){console[_0x9f3f('0x50')](_0x9f3f('0x51'),_0x4ec8f2);});}function getEndUser(_0x1539fa,_0x23a218,_0xe0d103,_0x417aeb,_0x316ce7,_0x221975,_0x18ca73){var _0x1a25c4={'method':_0x9f3f('0x35'),'uri':'','headers':{'Authorization':_0x9f3f('0x39')+_0x1539fa},'json':!![]};switch(_0x18ca73[_0x9f3f('0x52')]){case _0x9f3f('0x53'):_0x1a25c4[_0x9f3f('0x54')]=_0x9f3f('0x47')+_0x23a218+_0x9f3f('0x55')+_0x316ce7+'))';return getZohoUser(_0x1a25c4,_0x9f3f('0x56'))[_0x9f3f('0x2f')](function(_0x1c9630){if(_0x1c9630)return _0x1c9630;_0x1a25c4[_0x9f3f('0x54')]=_0x9f3f('0x47')+_0x23a218+_0x9f3f('0x57')+_0x316ce7+'))';return getZohoUser(_0x1a25c4,_0x9f3f('0x58'))[_0x9f3f('0x2f')](function(_0xf1a5){if(_0xf1a5)return _0xf1a5;if(_0x18ca73[_0x9f3f('0x49')]!=_0x9f3f('0x59')){return createEndUser(_0x1539fa,_0x23a218,_0x417aeb,_0x316ce7,_0x221975,_0x18ca73);}else{return{};}});});break;case _0x9f3f('0x5a'):_0x1a25c4[_0x9f3f('0x54')]='https://www.zohoapis.'+_0x23a218+_0x9f3f('0x55')+_0x316ce7+'))';return getZohoUser(_0x1a25c4,_0x9f3f('0x56'))[_0x9f3f('0x2f')](function(_0x4de7e9){if(_0x4de7e9)return _0x4de7e9;if(_0x18ca73[_0x9f3f('0x49')]!='nothing'){return createEndUser(_0x1539fa,_0x23a218,_0x417aeb,_0x316ce7,_0x221975,_0x18ca73);}else{return{};}});break;case'lead':_0x1a25c4[_0x9f3f('0x54')]=_0x9f3f('0x47')+_0x23a218+_0x9f3f('0x57')+_0x316ce7+'))';return getZohoUser(_0x1a25c4,'Leads')[_0x9f3f('0x2f')](function(_0x196251){if(_0x196251)return _0x196251;if(_0x18ca73['moduleCreate']!=_0x9f3f('0x59')){return createEndUser(_0x1539fa,_0x23a218,_0x417aeb,_0x316ce7,_0x221975,_0x18ca73);}else{return{};}});break;}}function getCall(_0xd31547,_0x22125b,_0x180456,_0x486e4e,_0x31e5ba,_0x35d5cf,_0x48e105,_0x4bafe0){logger[_0x9f3f('0x3c')](_0x9f3f('0x5b'));var _0x56e6b5={};_0x56e6b5['Owner']={'name':!_[_0x9f3f('0x1f')](_0x486e4e['role'][_0x9f3f('0x1c')])&&!_[_0x9f3f('0x1f')](_0x486e4e[_0x9f3f('0x40')][_0x9f3f('0x1c')])&&_0x486e4e[_0x9f3f('0x40')][_0x9f3f('0x1c')]===_0x9f3f('0x5c')?_0x486e4e[_0x9f3f('0x4a')][_0x9f3f('0x1c')]:!_[_0x9f3f('0x1f')](_0x486e4e['first_name'])?_0x486e4e[_0x9f3f('0x4b')]+'\x20'+_0x486e4e[_0x9f3f('0x4c')]:_0x486e4e[_0x9f3f('0x4c')],'id':_0x486e4e['id']};_0x56e6b5[_0x9f3f('0x5d')]=intUtil['getString'](_0x35d5cf[_0x9f3f('0x5e')],_0x48e105,'\x20');_0x56e6b5[_0x9f3f('0x5f')]=intUtil[_0x9f3f('0x60')](_0x35d5cf[_0x9f3f('0x61')],_0x48e105,'\x0a');if(_0x31e5ba[_0x9f3f('0x4f')]===_0x9f3f('0x56')){_0x56e6b5[_0x9f3f('0x62')]={'name':!_[_0x9f3f('0x1f')](_0x31e5ba['Full_Name'])?_0x31e5ba[_0x9f3f('0x63')]:!_[_0x9f3f('0x1f')](_0x31e5ba[_0x9f3f('0x64')])?_0x31e5ba[_0x9f3f('0x64')]+'\x20'+_0x31e5ba[_0x9f3f('0x65')]:_0x31e5ba[_0x9f3f('0x65')],'id':_0x31e5ba['id']};}if(_0x31e5ba['enduserType']===_0x9f3f('0x58')){_0x56e6b5['What_Id']={'name':!_[_0x9f3f('0x1f')](_0x31e5ba[_0x9f3f('0x63')])?_0x31e5ba['Full_Name']:!_[_0x9f3f('0x1f')](_0x31e5ba[_0x9f3f('0x64')])?_0x31e5ba[_0x9f3f('0x64')]+'\x20'+_0x31e5ba[_0x9f3f('0x65')]:_0x31e5ba[_0x9f3f('0x65')],'id':_0x31e5ba['id']};_0x56e6b5[_0x9f3f('0x66')]=_[_0x9f3f('0x48')](_0x31e5ba[_0x9f3f('0x4f')]);}if(_0x48e105[_0x9f3f('0x67')]){_0x56e6b5[_0x9f3f('0x68')]=moment[_0x9f3f('0x69')](parseInt(_0x48e105[_0x9f3f('0x67')])*0x3e8)[_0x9f3f('0x36')](_0x9f3f('0x6a'));}else if(_0x48e105['answertime']&&_0x48e105[_0x9f3f('0x6b')]){_0x56e6b5[_0x9f3f('0x68')]=moment[_0x9f3f('0x69')](moment(_0x48e105[_0x9f3f('0x6b')],_0x9f3f('0x6c'))[_0x9f3f('0x6d')](moment(_0x48e105[_0x9f3f('0x6e')],_0x9f3f('0x6c'))))[_0x9f3f('0x36')](_0x9f3f('0x6a'));}switch(_0x48e105[_0x9f3f('0x6f')]){case _0x9f3f('0x70'):_0x56e6b5[_0x9f3f('0x71')]='Called';break;case'complete':case'connect':_0x56e6b5[_0x9f3f('0x71')]=_0x9f3f('0x72');break;case'rejected':_0x56e6b5[_0x9f3f('0x71')]=_0x9f3f('0x73');break;case _0x9f3f('0x74'):_0x56e6b5['Call_Result']=_0x9f3f('0x75');break;case _0x9f3f('0x76'):_0x56e6b5['Call_Result']=_0x9f3f('0x77');default:}_0x56e6b5[_0x9f3f('0x78')]=(_0x4bafe0===_0x9f3f('0x79')?moment(_0x48e105[_0x9f3f('0x6e')])[_0x9f3f('0x36')](_0x9f3f('0x6c')):moment(_0x48e105[_0x9f3f('0x7a')])[_0x9f3f('0x36')](_0x9f3f('0x6c')))||moment()[_0x9f3f('0x36')]('YYYY-MM-DDTHH:mm:ss');_0x56e6b5[_0x9f3f('0x7b')]=_0x4bafe0||_0x9f3f('0x7c');_0x56e6b5=_[_0x9f3f('0x7d')](_0x56e6b5,getCustomFields(_0x35d5cf[_0x9f3f('0x7e')],_0x48e105));return request({'method':_0x9f3f('0x29'),'uri':_0x9f3f('0x47')+_0x22125b+_0x9f3f('0x7f'),'headers':{'Authorization':_0x9f3f('0x39')+_0xd31547},'body':{'data':[_0x56e6b5]},'json':!![]})[_0x9f3f('0x2f')](function(_0x50e9aa){if(_0x50e9aa&&_0x50e9aa[_0x9f3f('0x46')][0x0]['code']===_0x9f3f('0x4d')){logger['info'](_0x9f3f('0x80'));return{'id':_0x50e9aa[_0x9f3f('0x46')][0x0][_0x9f3f('0x4e')]['id']};}})[_0x9f3f('0x45')](function(_0x45f99a){logger[_0x9f3f('0x3c')](_0x9f3f('0x81'),_0x45f99a[_0x9f3f('0x33')]);console[_0x9f3f('0x50')](_0x9f3f('0x81'),_0x45f99a);});}exports[_0x9f3f('0x82')]=function(_0x259fec,_0x124112,_0x1598cf,_0x4205de,_0xe3fccc,_0x317532){var _0x1e8796,_0x27f936,_0x7e6319;_0x317532[_0x9f3f('0x83')]=intUtil['stripTrailingSlash'](_0x317532['host']);_0x317532[_0x9f3f('0x84')]=intUtil['stripTrailingSlash'](_0x317532[_0x9f3f('0x84')]);if(_0xe3fccc&&_0xe3fccc[_0x9f3f('0x85')]){logger[_0x9f3f('0x3c')](_0x9f3f('0x86'),'Recording\x20is\x20enabled!');_0x124112[_0x9f3f('0x87')]=_0x317532['serverUrl']+_0x9f3f('0x88')+_0x124112[_0x9f3f('0x89')]+_0x9f3f('0x8a')+md5(_0x124112[_0x9f3f('0x89')]);}else{_0x124112['recordingURL']='';}var _0x289cf6=_0x317532[_0x9f3f('0x83')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x317532)[_0x9f3f('0x2f')](function(_0x1bf707){_0x7e6319=_0x1bf707;return getUser(_0x7e6319,_0x289cf6,_0x317532,_0x4205de['email']);})[_0x9f3f('0x2f')](function(_0x131fd7){_0x1e8796=_0x131fd7;logger[_0x9f3f('0x3c')](_0x9f3f('0x8b'),_0x1e8796['id']);return getEndUser(_0x7e6319,_0x289cf6,_0x317532,_0x124112[_0x9f3f('0x8c')],_0x124112[_0x9f3f('0x8d')],_0x1e8796,_0x1598cf);})[_0x9f3f('0x2f')](function(_0x58caab){_0x27f936=_0x58caab;return getCall(_0x7e6319,_0x289cf6,_0x317532,_0x1e8796,_0x27f936,_0x1598cf,_0x124112,_0x9f3f('0x7c'));})[_0x9f3f('0x2f')](function(_0xb9c49a){if(_0xb9c49a){logger[_0x9f3f('0x3c')]('The\x20Call\x20ID\x20is:',_0xb9c49a['id']);logger[_0x9f3f('0x3c')](_0x9f3f('0x86'),_0x9f3f('0x8e'));emit(util[_0x9f3f('0x36')](_0x9f3f('0x8f'),_0x4205de['name']),_0x9f3f('0x90'),{'uri':_0x9f3f('0x91')+_0x317532['host']+_0x9f3f('0x92')+_0xb9c49a['id']});}})[_0x9f3f('0x45')](function(_0x5579ea){logger[_0x9f3f('0x31')]('[QUEUE]',JSON['stringify'](_0x5579ea));});};exports[_0x9f3f('0x79')]=function(_0x353ca8,_0xadf852,_0xbc7e28,_0x5c0bd8,_0x113a12,_0x5b0777,_0x1dda8c){var _0x251a90,_0x211468,_0x3d4eb9;_0x5b0777['host']=intUtil[_0x9f3f('0x93')](_0x5b0777[_0x9f3f('0x83')]);_0x5b0777['serverUrl']=intUtil['stripTrailingSlash'](_0x5b0777[_0x9f3f('0x84')]);if(_0x1dda8c&&_0x1dda8c[_0x9f3f('0x94')]&&_0x1dda8c[_0x9f3f('0x94')]!=='none'){logger[_0x9f3f('0x3c')](_0x9f3f('0x95'),_0x9f3f('0x96'));_0xadf852[_0x9f3f('0x87')]=_0x5b0777[_0x9f3f('0x84')]+'/api/voice/recordings/'+_0xadf852[_0x9f3f('0x89')]+_0x9f3f('0x8a')+md5(_0xadf852[_0x9f3f('0x89')]);}var _0x3ca608=_0x5b0777['host']==='zoho.eu'?'eu':_0x9f3f('0x97');return getAccessToken(_0x5b0777)['then'](function(_0x51d9ec){_0x3d4eb9=_0x51d9ec;return getUser(_0x3d4eb9,_0x3ca608,_0x5b0777,_0x5c0bd8[_0x9f3f('0x3b')]);})[_0x9f3f('0x2f')](function(_0x3de145){_0x251a90=_0x3de145;logger['info'](_0x9f3f('0x8b'),_0x251a90['id']);return getEndUser(_0x3d4eb9,_0x3ca608,_0x5b0777,_0xadf852[_0x9f3f('0x98')],_0xadf852['destcalleridnum'],_0x251a90,_0xbc7e28);})[_0x9f3f('0x2f')](function(_0x139c7b){_0x211468=_0x139c7b;return getCall(_0x3d4eb9,_0x3ca608,_0x5b0777,_0x251a90,_0x211468,_0xbc7e28,_0xadf852,_0x9f3f('0x99'));})[_0x9f3f('0x2f')](function(_0xb09156){if(_0xb09156){logger['info'](_0x9f3f('0x9a'),_0xb09156['id']);logger[_0x9f3f('0x3c')](_0x9f3f('0x95'),_0x9f3f('0x8e'));emit(util['format'](_0x9f3f('0x8f'),_0x5c0bd8[_0x9f3f('0x1c')]),_0x9f3f('0x90'),{'uri':'https://crm.'+_0x5b0777[_0x9f3f('0x83')]+_0x9f3f('0x92')+_0xb09156['id']});}})['catch'](function(_0x2b91dc){logger['error'](_0x9f3f('0x95'),JSON[_0x9f3f('0xf')](_0x2b91dc));});};exports[_0x9f3f('0x9b')]=function(_0xeef737,_0x26fb91,_0x483c4d,_0x51ce12,_0x54dd6a,_0x4ab653){var _0x1e48d5,_0x161372,_0x5457a0;_0x4ab653[_0x9f3f('0x83')]=intUtil[_0x9f3f('0x93')](_0x4ab653['host']);_0x4ab653['serverUrl']=intUtil[_0x9f3f('0x93')](_0x4ab653[_0x9f3f('0x84')]);if(_0x54dd6a&&_0x54dd6a['monitor_format']){logger[_0x9f3f('0x3c')]('['+_0x26fb91['lastevent']['toUpperCase']()+']',_0x9f3f('0x96'));_0x26fb91[_0x9f3f('0x87')]=_0x4ab653['serverUrl']+_0x9f3f('0x88')+_0x26fb91[_0x9f3f('0x89')]+'/downloads?type=uniqueid&token='+md5(_0x26fb91[_0x9f3f('0x89')]);}else{_0x26fb91[_0x9f3f('0x87')]='';}var _0x49a747=_0x4ab653[_0x9f3f('0x83')]===_0x9f3f('0x9c')?'eu':'com';return getAccessToken(_0x4ab653)[_0x9f3f('0x2f')](function(_0x2915e1){_0x5457a0=_0x2915e1;return getUser(_0x5457a0,_0x49a747,_0x4ab653);})[_0x9f3f('0x2f')](function(_0x31495e){_0x1e48d5=_0x31495e;logger[_0x9f3f('0x3c')](_0x9f3f('0x8b'),_0x1e48d5['id']);return getEndUser(_0x5457a0,_0x49a747,_0x4ab653,_0x26fb91[_0x9f3f('0x8c')],_0x26fb91[_0x9f3f('0x8d')],_0x1e48d5,_0x483c4d);})[_0x9f3f('0x2f')](function(_0x111e49){_0x161372=_0x111e49;return getCall(_0x5457a0,_0x49a747,_0x4ab653,_0x1e48d5,_0x161372,_0x483c4d,_0x26fb91,_0x9f3f('0x7c'));})[_0x9f3f('0x2f')](function(_0x5d1861){if(_0x5d1861){logger[_0x9f3f('0x3c')](_0x9f3f('0x9a'),_0x5d1861['id']);}})[_0x9f3f('0x45')](function(_0x510f83){logger['error']('['+_0x26fb91[_0x9f3f('0x6f')][_0x9f3f('0x9d')]()+']',JSON['stringify'](_0x510f83));});}; \ 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 4c02479..c1180dd 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 _0x0149=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','trigger','exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x326a1e,_0x56d18b){var _0x17803f=function(_0x39b7d9){while(--_0x39b7d9){_0x326a1e['push'](_0x326a1e['shift']());}};_0x17803f(++_0x56d18b);}(_0x0149,0x161));var _0x9014=function(_0x45f1d6,_0x2fad21){_0x45f1d6=_0x45f1d6-0x0;var _0x7045b6=_0x0149[_0x45f1d6];return _0x7045b6;};'use strict';var util=require(_0x9014('0x0'));var sh=require('shelljs');var Mustache=require(_0x9014('0x1'));var logger=require('../../../../config/logger')(_0x9014('0x2'));exports[_0x9014('0x3')]=function(_0x59ecc6,_0x447342){var _0x1e8be1=_0x59ecc6[_0x9014('0x4')]?_0x59ecc6[_0x9014('0x4')]:_0x9014('0x5');var _0x43e8b2=_0x59ecc6['data3']?Mustache[_0x9014('0x6')](_0x59ecc6[_0x9014('0x7')],_0x447342):_0x447342;sh['exec'](_0x43e8b2,function(_0x5708f4,_0x346ba0,_0x1c74a5){if(_0x5708f4!==0x0){logger[_0x9014('0x8')](util[_0x9014('0x9')](_0x9014('0xa'),_0x1e8be1,_0x43e8b2,_0x5708f4,_0x1c74a5));}else{logger[_0x9014('0xb')](util[_0x9014('0x9')](_0x9014('0xc'),_0x1e8be1,_0x43e8b2,_0x346ba0));}});}; \ No newline at end of file +var _0xdea9=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','exec','Script','data3','format'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xdea9,0x125));var _0x9dea=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdea9[_0x4b369d];return _0x571a98;};'use strict';var util=require('util');var sh=require(_0x9dea('0x0'));var Mustache=require(_0x9dea('0x1'));var logger=require(_0x9dea('0x2'))('trigger');exports[_0x9dea('0x3')]=function(_0xd46128,_0xb7188a){var _0x461977=_0xd46128['data2']?_0xd46128['data2']:_0x9dea('0x4');var _0xa97f5d=_0xd46128[_0x9dea('0x5')]?Mustache['render'](_0xd46128[_0x9dea('0x5')],_0xb7188a):_0xb7188a;sh['exec'](_0xa97f5d,function(_0x4a2c29,_0x2ca1ca,_0x352cfe){if(_0x4a2c29!==0x0){logger['error'](util[_0x9dea('0x6')](_0x9dea('0x7'),_0x461977,_0xa97f5d,_0x4a2c29,_0x352cfe));}else{logger[_0x9dea('0x8')](util['format'](_0x9dea('0x9'),_0x461977,_0xa97f5d,_0x2ca1ca));}});}; \ 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 3d710f5..c779448 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 _0xa65a=['name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','headers','parse','data6','stack','GET','render','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','format','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x34978a,_0x5c16ca){var _0x56984b=function(_0x47f989){while(--_0x47f989){_0x34978a['push'](_0x34978a['shift']());}};_0x56984b(++_0x5c16ca);}(_0xa65a,0x1d0));var _0xaa65=function(_0x1d4ad0,_0x157c5b){_0x1d4ad0=_0x1d4ad0-0x0;var _0x6c32f5=_0xa65a[_0x1d4ad0];return _0x6c32f5;};'use strict';var rp=require(_0xaa65('0x0'));var util=require(_0xaa65('0x1'));var _=require(_0xaa65('0x2'));var Mustache=require(_0xaa65('0x3'));var logger=require(_0xaa65('0x4'))(_0xaa65('0x5'));exports[_0xaa65('0x6')]=function(_0x13252e,_0x1235c5){var _0x37c11d,_0x5614c0;var _0x32957c={'method':_0x13252e[_0xaa65('0x7')][_0xaa65('0x8')](),'uri':Mustache['render'](_0x13252e[_0xaa65('0x9')],_0x1235c5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x13252e['data5'])==='number'&&parseInt(_0x13252e[_0xaa65('0xa')])>=0x1&&parseInt(_0x13252e[_0xaa65('0xa')])<=0xa?parseInt(_0x13252e[_0xaa65('0xa')])*0x3e8:0x5*0x3e8};try{_0x32957c[_0xaa65('0xb')]=_0x13252e['data6']?JSON[_0xaa65('0xc')](Mustache['render'](_0x13252e[_0xaa65('0xd')],_0x1235c5)):{};}catch(_0xb10c6b){logger['error'](_0xb10c6b[_0xaa65('0xe')]);}switch(_0x13252e[_0xaa65('0x7')][_0xaa65('0x8')]()){case _0xaa65('0xf'):case'DELETE':_0x37c11d=null;_0x32957c['qs']=_0x1235c5;break;case'POST':case'PUT':if(_0x13252e['data7']){try{_0x37c11d=JSON['parse'](Mustache[_0xaa65('0x10')](_0x13252e['data7'],_0x1235c5));_0x32957c[_0xaa65('0x11')]=_0x37c11d;}catch(_0x59d827){logger[_0xaa65('0x12')](_0x59d827[_0xaa65('0xe')]);logger[_0xaa65('0x12')](_0xaa65('0x13'));}}else{_0x37c11d=_0x1235c5;_0x32957c[_0xaa65('0x11')]=_0x37c11d;}break;}logger[_0xaa65('0x14')](util['format'](_0xaa65('0x15'),_0x13252e[_0xaa65('0x7')],_0x13252e['data2'],JSON['stringify'](_0x32957c)));rp(_0x32957c)[_0xaa65('0x16')](function(_0x57471b){_0x37c11d=!_['isNil'](_0x37c11d)?_0xaa65('0x17')+_0x37c11d:'';_0x5614c0=typeof _0x57471b[_0xaa65('0x11')]===_0xaa65('0x18')?JSON[_0xaa65('0x19')](_0x57471b[_0xaa65('0x11')]):_0x57471b[_0xaa65('0x11')];logger['info'](util['format'](_0xaa65('0x1a'),_0x13252e[_0xaa65('0x7')],_0x13252e['data2'],_0x57471b[_0xaa65('0x1b')],_0x5614c0));})[_0xaa65('0x1c')](function(_0x4f2920){logger[_0xaa65('0x12')](util[_0xaa65('0x1d')](_0xaa65('0x1e'),_0x13252e[_0xaa65('0x7')],_0x13252e['data2'],_0x4f2920['statusCode'],_0x4f2920[_0xaa65('0x1f')],_0x4f2920[_0xaa65('0x20')]));});}; \ No newline at end of file +var _0xb102=['info','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','format','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','mustache','trigger','exec','data1','toUpperCase','render','number','data5','data6','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0x4adf78,_0x4800f9){var _0x508136=function(_0x25a936){while(--_0x25a936){_0x4adf78['push'](_0x4adf78['shift']());}};_0x508136(++_0x4800f9);}(_0xb102,0x10d));var _0x2b10=function(_0x29394e,_0x1968b1){_0x29394e=_0x29394e-0x0;var _0x832bb5=_0xb102[_0x29394e];return _0x832bb5;};'use strict';var rp=require('request-promise');var util=require(_0x2b10('0x0'));var _=require('lodash');var Mustache=require(_0x2b10('0x1'));var logger=require('../../../../config/logger')(_0x2b10('0x2'));exports[_0x2b10('0x3')]=function(_0xde6cd7,_0xec0896){var _0x356a04,_0x179f8b;var _0x42515f={'method':_0xde6cd7[_0x2b10('0x4')][_0x2b10('0x5')](),'uri':Mustache[_0x2b10('0x6')](_0xde6cd7['data2'],_0xec0896),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xde6cd7['data5'])===_0x2b10('0x7')&&parseInt(_0xde6cd7[_0x2b10('0x8')])>=0x1&&parseInt(_0xde6cd7[_0x2b10('0x8')])<=0xa?parseInt(_0xde6cd7[_0x2b10('0x8')])*0x3e8:0x5*0x3e8};try{_0x42515f['headers']=_0xde6cd7[_0x2b10('0x9')]?JSON['parse'](Mustache[_0x2b10('0x6')](_0xde6cd7[_0x2b10('0x9')],_0xec0896)):{};}catch(_0x51ba56){logger['error'](_0x51ba56[_0x2b10('0xa')]);}switch(_0xde6cd7[_0x2b10('0x4')]['toUpperCase']()){case _0x2b10('0xb'):case _0x2b10('0xc'):_0x356a04=null;_0x42515f['qs']=_0xec0896;break;case _0x2b10('0xd'):case _0x2b10('0xe'):if(_0xde6cd7[_0x2b10('0xf')]){try{_0x356a04=JSON['parse'](Mustache['render'](_0xde6cd7[_0x2b10('0xf')],_0xec0896));_0x42515f[_0x2b10('0x10')]=_0x356a04;}catch(_0x26fb90){logger[_0x2b10('0x11')](_0x26fb90[_0x2b10('0xa')]);logger[_0x2b10('0x11')](_0x2b10('0x12'));}}else{_0x356a04=_0xec0896;_0x42515f[_0x2b10('0x10')]=_0x356a04;}break;}logger[_0x2b10('0x13')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xde6cd7[_0x2b10('0x4')],_0xde6cd7[_0x2b10('0x14')],JSON['stringify'](_0x42515f)));rp(_0x42515f)[_0x2b10('0x15')](function(_0x421bfb){_0x356a04=!_[_0x2b10('0x16')](_0x356a04)?_0x2b10('0x17')+_0x356a04:'';_0x179f8b=typeof _0x421bfb[_0x2b10('0x10')]===_0x2b10('0x18')?JSON[_0x2b10('0x19')](_0x421bfb['body']):_0x421bfb[_0x2b10('0x10')];logger['info'](util[_0x2b10('0x1a')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0xde6cd7['data1'],_0xde6cd7[_0x2b10('0x14')],_0x421bfb[_0x2b10('0x1b')],_0x179f8b));})[_0x2b10('0x1c')](function(_0x45c2eb){logger[_0x2b10('0x11')](util[_0x2b10('0x1a')](_0x2b10('0x1d'),_0xde6cd7['data1'],_0xde6cd7[_0x2b10('0x14')],_0x45c2eb[_0x2b10('0x1b')],_0x45c2eb[_0x2b10('0x1e')],_0x45c2eb[_0x2b10('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 76d8e14..1ad6132 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 _0xfb57=['routing','http','Request','then','rpc','error','message','result','catch','exports','bluebird','../../config/logger'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfb57,0x11e));var _0x7fb5=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0xfb57[_0x3ae96c];return _0x1b0c90;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7fb5('0x0'));var logger=require(_0x7fb5('0x1'))(_0x7fb5('0x2'));var client=jayson['client'][_0x7fb5('0x3')]({'port':0x2329});client[_0x7fb5('0x4')]=function(_0x5d0814,_0x1a1b2d){return new BPromise(function(_0x292a2f,_0x539355){return client['request'](_0x5d0814,_0x1a1b2d)[_0x7fb5('0x5')](function(_0x11585b){logger['debug'](_0x7fb5('0x6'),_0x7fb5('0x2'),_0x5d0814,_0x1a1b2d,_0x11585b);if(_0x11585b[_0x7fb5('0x7')]){logger[_0x7fb5('0x7')](_0x7fb5('0x6'),'routing',_0x5d0814,_0x11585b[_0x7fb5('0x7')]['message'],_0x1a1b2d);return _0x539355(_0x11585b[_0x7fb5('0x7')][_0x7fb5('0x8')]);}else{return _0x292a2f(_0x11585b[_0x7fb5('0x9')]);}})[_0x7fb5('0xa')](function(_0x335f40){logger[_0x7fb5('0x7')]('rpc','routing',_0x5d0814,_0x335f40,_0x1a1b2d);return _0x539355(_0x335f40);});});};module[_0x7fb5('0xb')]=client; \ No newline at end of file +var _0x18e9=['bluebird','../../config/logger','client','Request','request','then','debug','rpc','routing','error','message','catch','exports','jayson/promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x18e9,0x179));var _0x918e=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0x18e9[_0x113e32];return _0x4ff939;};'use strict';var jayson=require(_0x918e('0x0'));var BPromise=require(_0x918e('0x1'));var logger=require(_0x918e('0x2'))('routing');var client=jayson[_0x918e('0x3')]['http']({'port':0x2329});client[_0x918e('0x4')]=function(_0xff921c,_0x3ab767){return new BPromise(function(_0x1a93a3,_0x5239c4){return client[_0x918e('0x5')](_0xff921c,_0x3ab767)[_0x918e('0x6')](function(_0x4d9163){logger[_0x918e('0x7')](_0x918e('0x8'),_0x918e('0x9'),_0xff921c,_0x3ab767,_0x4d9163);if(_0x4d9163[_0x918e('0xa')]){logger[_0x918e('0xa')](_0x918e('0x8'),_0x918e('0x9'),_0xff921c,_0x4d9163[_0x918e('0xa')]['message'],_0x3ab767);return _0x5239c4(_0x4d9163['error'][_0x918e('0xb')]);}else{return _0x1a93a3(_0x4d9163['result']);}})[_0x918e('0xc')](function(_0x5227d4){logger[_0x918e('0xa')](_0x918e('0x8'),_0x918e('0x9'),_0xff921c,_0x5227d4,_0x3ab767);return _0x5239c4(_0x5227d4);});});};module[_0x918e('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index f7ffcd7..344190f 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 _0xa4f6=['initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','Email\x20service\x20initialization','./server','./lib/email','./rpc/setting','email','resolve','then','getMailAccounts'];(function(_0x25b039,_0xc66f6b){var _0x4fd4bb=function(_0x126536){while(--_0x126536){_0x25b039['push'](_0x25b039['shift']());}};_0x4fd4bb(++_0xc66f6b);}(_0xa4f6,0xa2));var _0x6a4f=function(_0x14969f,_0x2ce8f5){_0x14969f=_0x14969f-0x0;var _0x2d739b=_0xa4f6[_0x14969f];return _0x2d739b;};'use strict';var server=require(_0x6a4f('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x6a4f('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x6a4f('0x2'));var logger=require('../../config/logger')(_0x6a4f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x6a4f('0x4')]()[_0x6a4f('0x5')](mailAccount[_0x6a4f('0x6')]())[_0x6a4f('0x5')](realtime[_0x6a4f('0x7')]())[_0x6a4f('0x5')](function(){email['refresh'](realtime[_0x6a4f('0x8')]);return realtime;});}function main(){return server[_0x6a4f('0x9')](realtime,email)[_0x6a4f('0x5')](function(){return initRealtime();})[_0x6a4f('0x5')](function(){return setting[_0x6a4f('0xa')]();})[_0x6a4f('0x5')](function(_0x1eea05){return setInterval(initRealtime,_0x1eea05[_0x6a4f('0xb')]*0x3e8);})['catch'](function(_0x19d6c4){logger['error'](_0x6a4f('0xc'),_0x19d6c4);});}main(); \ No newline at end of file +var _0x90ef=['loginMailFrequency','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','refresh','mailAccounts','getSettings'];(function(_0x55a2ba,_0x2fd4cc){var _0x39028d=function(_0x5ef0d0){while(--_0x5ef0d0){_0x55a2ba['push'](_0x55a2ba['shift']());}};_0x39028d(++_0x2fd4cc);}(_0x90ef,0xb7));var _0xf90e=function(_0x4ecdb6,_0x5b3bb4){_0x4ecdb6=_0x4ecdb6-0x0;var _0x22b179=_0x90ef[_0x4ecdb6];return _0x22b179;};'use strict';var server=require('./server');var Realtime=require(_0xf90e('0x0'));var EmailChannel=require(_0xf90e('0x1'));var mailAccount=require(_0xf90e('0x2'));var setting=require(_0xf90e('0x3'));var logger=require(_0xf90e('0x4'))(_0xf90e('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xf90e('0x6')]()[_0xf90e('0x7')](mailAccount[_0xf90e('0x8')]())[_0xf90e('0x7')](realtime['initMailAccounts']())[_0xf90e('0x7')](function(){email[_0xf90e('0x9')](realtime[_0xf90e('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0xf90e('0x7')](function(){return setting[_0xf90e('0xb')]();})['then'](function(_0x46d5ca){return setInterval(initRealtime,_0x46d5ca[_0xf90e('0xc')]*0x3e8);})['catch'](function(_0x5e5599){logger[_0xf90e('0xd')](_0xf90e('0xe'),_0x5e5599);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 94f0043..673b8ce 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 _0x81b5=['info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','status','Imap','messageStatus','isNil','stringify','md5','mailAccount:update','refresh','service','provider','custom','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','error','handleImapError','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','smtp','send','verifySmtp','Smtp','verify','verified','catch','exports','moment','ioredis','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount'];(function(_0x580784,_0x5b52ea){var _0x4fabad=function(_0x33bf84){while(--_0x33bf84){_0x580784['push'](_0x580784['shift']());}};_0x4fabad(++_0x5b52ea);}(_0x81b5,0x9c));var _0x581b=function(_0x48b3c9,_0x39d959){_0x48b3c9=_0x48b3c9-0x0;var _0x4a1332=_0x81b5[_0x48b3c9];return _0x4a1332;};'use strict';var _=require('lodash');var moment=require(_0x581b('0x0'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x581b('0x1'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x581b('0x2'));config[_0x581b('0x3')]=_['defaults'](config[_0x581b('0x3')],{'host':_0x581b('0x4'),'port':0x18eb});var io=require(_0x581b('0x5'))(new Redis(config['redis']));var EmailImap=require(_0x581b('0x6'));var EmailSmtp=require(_0x581b('0x7'));var mailAccount=require(_0x581b('0x8'));var md5Accounts={};function EmailChannel(_0x16ada5){logger[_0x581b('0x9')](_0x581b('0xa'));this['mailAccounts']=_0x16ada5[_0x581b('0xb')];this[_0x581b('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x581b('0xd')][_0x581b('0xe')]=function(_0x173a90){var _0x1897f8=this[_0x581b('0xb')][_0x173a90];var _0x11aefb={'id':_0x1897f8['id'],'name':_0x1897f8[_0x581b('0xf')],'key':_0x1897f8[_0x581b('0x10')],'active':_0x1897f8[_0x581b('0x11')],'Imap':{'status':_0x1897f8['Imap'][_0x581b('0x12')],'messageStatus':_0x1897f8[_0x581b('0x13')][_0x581b('0x14')],'total':_0x1897f8[_0x581b('0x13')]['total']}};if(_[_0x581b('0x15')](md5Accounts[_0x173a90])){md5Accounts[_0x173a90]={};}var _0x5b8af8=md5(JSON[_0x581b('0x16')](_0x11aefb));if(md5Accounts[_0x173a90][_0x581b('0x17')]!==_0x5b8af8){md5Accounts[_0x173a90][_0x581b('0x17')]=_0x5b8af8;io['emit'](_0x581b('0x18'),_0x11aefb);}};EmailChannel[_0x581b('0xd')][_0x581b('0x19')]=function(_0x3fc08c){for(var _0xb940db in _0x3fc08c){if(_0x3fc08c['hasOwnProperty'](_0xb940db)){if(_0x3fc08c[_0xb940db][_0x581b('0x13')]&&_0x3fc08c[_0xb940db][_0x581b('0x11')]){var _0x31f154=_0x3fc08c[_0xb940db]['Imap'];if(!_0x31f154[_0x581b('0x1a')]&&_0x3fc08c[_0xb940db][_0x581b('0x1b')]!==_0x581b('0x1c'))_0x31f154[_0x581b('0x1a')]=_0x3fc08c[_0xb940db][_0x581b('0x1b')];if(!this[_0x581b('0xc')][_0x581b('0x1d')](_0x31f154['id'])){this[_0x581b('0xc')][_0x31f154['id']]=new EmailImap(_0x31f154,_0x3fc08c[_0xb940db][_0x581b('0x2')]);this[_0x581b('0xc')][_0x31f154['id']]['on'](_0x581b('0x1e'),this[_0x581b('0x1f')]['bind'](this,_0xb940db));this[_0x581b('0xc')][_0x31f154['id']]['on'](_0x581b('0x2'),this[_0x581b('0x20')][_0x581b('0x21')](this,_0xb940db));this[_0x581b('0xc')][_0x31f154['id']]['on'](_0x581b('0x22'),this['handleImapEnd'][_0x581b('0x21')](this,_0xb940db));this[_0x581b('0xc')][_0x31f154['id']]['on'](_0x581b('0x23'),this[_0x581b('0x24')][_0x581b('0x21')](this,_0xb940db));}}else{if(_[_0x581b('0x15')](this['mailAccounts'][_0xb940db]['Imap'])){this['mailAccounts'][_0xb940db]['Imap']={};}this['mailAccounts'][_0xb940db][_0x581b('0x13')][_0x581b('0x12')]='disabled';this[_0x581b('0xb')][_0xb940db][_0x581b('0x13')][_0x581b('0x14')]='';this[_0x581b('0xe')](_0xb940db);}}}};EmailChannel[_0x581b('0xd')][_0x581b('0x1f')]=function(_0x50aedc,_0x3d028a){if(this['mailAccounts'][_0x50aedc]){this['mailAccounts'][_0x50aedc]['Imap']['status']=_0x581b('0x25');this[_0x581b('0xb')][_0x50aedc]['Imap'][_0x581b('0x14')]=_0x3d028a[_0x581b('0xf')];if(_0x3d028a[_0x581b('0x26')]){this[_0x581b('0xb')][_0x50aedc][_0x581b('0x13')][_0x581b('0x27')]=_0x3d028a[_0x581b('0x26')][_0x581b('0x27')];}return this['emit'](_0x50aedc);}};EmailChannel[_0x581b('0xd')]['handleImapEmail']=function(_0x34c33b,_0xa0cd37){logger[_0x581b('0x9')](_0x581b('0x28'),_0xa0cd37['firstName'],_0xa0cd37[_0x581b('0x29')],_0xa0cd37[_0x581b('0x2a')],_0x34c33b);if(this[_0x581b('0xb')][_0x34c33b]){return mailAccount['notify'](_0x34c33b,_0xa0cd37)[_0x581b('0x2b')](function(_0x47d58a){if(_0x47d58a){logger[_0x581b('0x9')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x4d34f8){logger[_0x581b('0x23')](_0x581b('0x2c'),JSON[_0x581b('0x16')](_0x4d34f8));});}};EmailChannel['prototype'][_0x581b('0x2d')]=function(_0xc547c1){if(this[_0x581b('0xb')][_0xc547c1]&&this[_0x581b('0xb')][_0xc547c1][_0x581b('0x13')]){if(this[_0x581b('0xc')][this[_0x581b('0xb')][_0xc547c1]['Imap']['id']]){delete this[_0x581b('0xc')][this[_0x581b('0xb')][_0xc547c1][_0x581b('0x13')]['id']];}this[_0x581b('0xb')][_0xc547c1][_0x581b('0x13')][_0x581b('0x2e')]=moment();this['emit'](_0xc547c1);}};EmailChannel[_0x581b('0xd')][_0x581b('0x24')]=function(_0x37fbda,_0xac8ba4){if(this[_0x581b('0xb')][_0x37fbda]){this['mailAccounts'][_0x37fbda][_0x581b('0x13')][_0x581b('0x12')]='error';this['mailAccounts'][_0x37fbda][_0x581b('0x13')][_0x581b('0x14')]=_0xac8ba4;return this['emit'](_0x37fbda);}};EmailChannel[_0x581b('0xd')]['sendMail']=function(_0x2fd448,_0x8d7df9){return this[_0x581b('0x2f')][_0x581b('0x30')](_0x2fd448,_0x8d7df9);};EmailChannel[_0x581b('0xd')][_0x581b('0x31')]=function(_0x1b5a04){var _0xf87887=this;if(this[_0x581b('0xb')][_0x1b5a04['id']]){if(_['isNil'](this[_0x581b('0xb')][_0x1b5a04['id']][_0x581b('0x32')])){this['mailAccounts'][_0x1b5a04['id']][_0x581b('0x32')]={};}this['mailAccounts'][_0x1b5a04['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x116223,_0x5081f4){return _0xf87887[_0x581b('0x2f')][_0x581b('0x33')](_0x1b5a04)['then'](function(_0x2c5dfe){_0xf87887[_0x581b('0xb')][_0x1b5a04['id']][_0x581b('0x32')][_0x581b('0x12')]=_0x581b('0x34');_0xf87887[_0x581b('0xb')][_0x1b5a04['id']][_0x581b('0x32')][_0x581b('0x14')]='';_0xf87887[_0x581b('0xe')](_0x1b5a04['id']);_0x116223(_0x2c5dfe);})[_0x581b('0x35')](function(_0x202b3d){_0xf87887[_0x581b('0xb')][_0x1b5a04['id']][_0x581b('0x32')][_0x581b('0x12')]=_0x581b('0x23');_0xf87887[_0x581b('0xb')][_0x1b5a04['id']][_0x581b('0x32')][_0x581b('0x14')]=_0x202b3d;_0xf87887[_0x581b('0xe')](_0x1b5a04['id']);_0x5081f4(_0x202b3d);});});}return this[_0x581b('0x2f')][_0x581b('0x33')](_0x1b5a04);};module[_0x581b('0x36')]=EmailChannel; \ No newline at end of file +var _0xddf3=['name','active','Imap','total','isNil','stringify','md5','emit','mailAccount:update','refresh','hasOwnProperty','provider','custom','service','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','handleImapError','disabled','messageStatus','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','verifySmtp','Smtp','verify','then','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype'];(function(_0x397dce,_0x19c587){var _0x3e1beb=function(_0x22a19c){while(--_0x22a19c){_0x397dce['push'](_0x397dce['shift']());}};_0x3e1beb(++_0x19c587);}(_0xddf3,0x11e));var _0x3ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ddf('0x0'));var moment=require(_0x3ddf('0x1'));var BPromise=require(_0x3ddf('0x2'));var md5=require('md5');var Redis=require(_0x3ddf('0x3'));var config=require(_0x3ddf('0x4'));var logger=require(_0x3ddf('0x5'))(_0x3ddf('0x6'));config['redis']=_[_0x3ddf('0x7')](config[_0x3ddf('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3ddf('0x9'))(new Redis(config[_0x3ddf('0x8')]));var EmailImap=require(_0x3ddf('0xa'));var EmailSmtp=require(_0x3ddf('0xb'));var mailAccount=require(_0x3ddf('0xc'));var md5Accounts={};function EmailChannel(_0x2c10d1){logger[_0x3ddf('0xd')](_0x3ddf('0xe'));this[_0x3ddf('0xf')]=_0x2c10d1[_0x3ddf('0xf')];this[_0x3ddf('0x10')]={};this[_0x3ddf('0x11')]=new EmailSmtp();}EmailChannel[_0x3ddf('0x12')]['emit']=function(_0x5f304b){var _0x1653a9=this[_0x3ddf('0xf')][_0x5f304b];var _0x483524={'id':_0x1653a9['id'],'name':_0x1653a9[_0x3ddf('0x13')],'key':_0x1653a9['key'],'active':_0x1653a9[_0x3ddf('0x14')],'Imap':{'status':_0x1653a9[_0x3ddf('0x15')]['status'],'messageStatus':_0x1653a9[_0x3ddf('0x15')]['messageStatus'],'total':_0x1653a9[_0x3ddf('0x15')][_0x3ddf('0x16')]}};if(_[_0x3ddf('0x17')](md5Accounts[_0x5f304b])){md5Accounts[_0x5f304b]={};}var _0x921e7a=md5(JSON[_0x3ddf('0x18')](_0x483524));if(md5Accounts[_0x5f304b][_0x3ddf('0x19')]!==_0x921e7a){md5Accounts[_0x5f304b][_0x3ddf('0x19')]=_0x921e7a;io[_0x3ddf('0x1a')](_0x3ddf('0x1b'),_0x483524);}};EmailChannel['prototype'][_0x3ddf('0x1c')]=function(_0x52c3b6){for(var _0x245ac5 in _0x52c3b6){if(_0x52c3b6[_0x3ddf('0x1d')](_0x245ac5)){if(_0x52c3b6[_0x245ac5][_0x3ddf('0x15')]&&_0x52c3b6[_0x245ac5][_0x3ddf('0x14')]){var _0x345ff3=_0x52c3b6[_0x245ac5]['Imap'];if(!_0x345ff3['service']&&_0x52c3b6[_0x245ac5][_0x3ddf('0x1e')]!==_0x3ddf('0x1f'))_0x345ff3[_0x3ddf('0x20')]=_0x52c3b6[_0x245ac5]['provider'];if(!this[_0x3ddf('0x10')][_0x3ddf('0x1d')](_0x345ff3['id'])){this[_0x3ddf('0x10')][_0x345ff3['id']]=new EmailImap(_0x345ff3,_0x52c3b6[_0x245ac5][_0x3ddf('0x6')]);this['imapAccounts'][_0x345ff3['id']]['on'](_0x3ddf('0x21'),this[_0x3ddf('0x22')]['bind'](this,_0x245ac5));this[_0x3ddf('0x10')][_0x345ff3['id']]['on'](_0x3ddf('0x6'),this[_0x3ddf('0x23')][_0x3ddf('0x24')](this,_0x245ac5));this[_0x3ddf('0x10')][_0x345ff3['id']]['on']('end',this[_0x3ddf('0x25')][_0x3ddf('0x24')](this,_0x245ac5));this[_0x3ddf('0x10')][_0x345ff3['id']]['on'](_0x3ddf('0x26'),this[_0x3ddf('0x27')]['bind'](this,_0x245ac5));}}else{if(_[_0x3ddf('0x17')](this[_0x3ddf('0xf')][_0x245ac5][_0x3ddf('0x15')])){this['mailAccounts'][_0x245ac5][_0x3ddf('0x15')]={};}this[_0x3ddf('0xf')][_0x245ac5]['Imap']['status']=_0x3ddf('0x28');this[_0x3ddf('0xf')][_0x245ac5][_0x3ddf('0x15')][_0x3ddf('0x29')]='';this['emit'](_0x245ac5);}}}};EmailChannel[_0x3ddf('0x12')][_0x3ddf('0x22')]=function(_0x40d73a,_0x2a9318){if(this[_0x3ddf('0xf')][_0x40d73a]){this['mailAccounts'][_0x40d73a]['Imap'][_0x3ddf('0x2a')]=_0x3ddf('0x2b');this['mailAccounts'][_0x40d73a][_0x3ddf('0x15')][_0x3ddf('0x29')]=_0x2a9318[_0x3ddf('0x13')];if(_0x2a9318[_0x3ddf('0x2c')]){this[_0x3ddf('0xf')][_0x40d73a][_0x3ddf('0x15')]['total']=_0x2a9318[_0x3ddf('0x2c')][_0x3ddf('0x16')];}return this[_0x3ddf('0x1a')](_0x40d73a);}};EmailChannel[_0x3ddf('0x12')][_0x3ddf('0x23')]=function(_0x5bcf1d,_0x5d1989){logger['info'](_0x3ddf('0x2d'),_0x5d1989[_0x3ddf('0x2e')],_0x5d1989[_0x3ddf('0x2f')],_0x5d1989[_0x3ddf('0x30')],_0x5bcf1d);if(this[_0x3ddf('0xf')][_0x5bcf1d]){return mailAccount[_0x3ddf('0x31')](_0x5bcf1d,_0x5d1989)['then'](function(_0x310d54){if(_0x310d54){logger[_0x3ddf('0xd')](_0x3ddf('0x32'));}})[_0x3ddf('0x33')](function(_0x4d05d6){logger[_0x3ddf('0x26')](_0x3ddf('0x34'),JSON[_0x3ddf('0x18')](_0x4d05d6));});}};EmailChannel['prototype'][_0x3ddf('0x25')]=function(_0x444939){if(this[_0x3ddf('0xf')][_0x444939]&&this[_0x3ddf('0xf')][_0x444939][_0x3ddf('0x15')]){if(this[_0x3ddf('0x10')][this[_0x3ddf('0xf')][_0x444939][_0x3ddf('0x15')]['id']]){delete this[_0x3ddf('0x10')][this['mailAccounts'][_0x444939][_0x3ddf('0x15')]['id']];}this['mailAccounts'][_0x444939][_0x3ddf('0x15')][_0x3ddf('0x35')]=moment();this[_0x3ddf('0x1a')](_0x444939);}};EmailChannel[_0x3ddf('0x12')][_0x3ddf('0x27')]=function(_0xc8ed8d,_0xe8fdca){if(this[_0x3ddf('0xf')][_0xc8ed8d]){this[_0x3ddf('0xf')][_0xc8ed8d][_0x3ddf('0x15')][_0x3ddf('0x2a')]=_0x3ddf('0x26');this['mailAccounts'][_0xc8ed8d][_0x3ddf('0x15')][_0x3ddf('0x29')]=_0xe8fdca;return this[_0x3ddf('0x1a')](_0xc8ed8d);}};EmailChannel['prototype'][_0x3ddf('0x36')]=function(_0xc7b2f5,_0x133a33){return this[_0x3ddf('0x11')]['send'](_0xc7b2f5,_0x133a33);};EmailChannel['prototype'][_0x3ddf('0x37')]=function(_0x9dfb58){var _0x1d874a=this;if(this[_0x3ddf('0xf')][_0x9dfb58['id']]){if(_[_0x3ddf('0x17')](this[_0x3ddf('0xf')][_0x9dfb58['id']][_0x3ddf('0x38')])){this['mailAccounts'][_0x9dfb58['id']][_0x3ddf('0x38')]={};}this[_0x3ddf('0xf')][_0x9dfb58['id']]['Smtp'][_0x3ddf('0x35')]=moment();return new BPromise(function(_0x5f01cf,_0x3398c2){return _0x1d874a['smtp'][_0x3ddf('0x39')](_0x9dfb58)[_0x3ddf('0x3a')](function(_0x282177){_0x1d874a[_0x3ddf('0xf')][_0x9dfb58['id']][_0x3ddf('0x38')][_0x3ddf('0x2a')]=_0x3ddf('0x3b');_0x1d874a['mailAccounts'][_0x9dfb58['id']][_0x3ddf('0x38')]['messageStatus']='';_0x1d874a[_0x3ddf('0x1a')](_0x9dfb58['id']);_0x5f01cf(_0x282177);})[_0x3ddf('0x33')](function(_0x140a08){_0x1d874a[_0x3ddf('0xf')][_0x9dfb58['id']]['Smtp'][_0x3ddf('0x2a')]=_0x3ddf('0x26');_0x1d874a[_0x3ddf('0xf')][_0x9dfb58['id']]['Smtp'][_0x3ddf('0x29')]=_0x140a08;_0x1d874a[_0x3ddf('0x1a')](_0x9dfb58['id']);_0x3398c2(_0x140a08);});});}return this['smtp'][_0x3ddf('0x39')](_0x9dfb58);};module[_0x3ddf('0x3c')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 836fe7f..fe7b050 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 _0x4137=['simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','ready','bind','end','handleEnd','error','connect','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','prototype','openBox','handleOpenBox','box','handleCloseBox','readUnseen','search','handleReadUnseen','handleError','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser'];(function(_0x44435a,_0xd71b63){var _0x4852d4=function(_0x1e8880){while(--_0x1e8880){_0x44435a['push'](_0x44435a['shift']());}};_0x4852d4(++_0xd71b63);}(_0x4137,0xf8));var _0x7413=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4137[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var Imap=require(_0x7413('0x2'));var simpleParser=require(_0x7413('0x3'))[_0x7413('0x4')];var Iconv=require(_0x7413('0x5'))[_0x7413('0x6')];var EventEmitter=require(_0x7413('0x7'))[_0x7413('0x8')];var utils=require(_0x7413('0x9'));var logger=require(_0x7413('0xa'))(_0x7413('0xb'));function EmailImap(_0x4fbade,_0xc808cd){this[_0x7413('0xc')]=_0x7413('0xd');this[_0x7413('0xe')]=this['getAccount'](_0x4fbade,_0xc808cd);this[_0x7413('0x2')]=new Imap(this[_0x7413('0xe')]);this['imap'][_0x7413('0xf')](_0x7413('0x10'),this['handleReady'][_0x7413('0x11')](this));this[_0x7413('0x2')][_0x7413('0xf')](_0x7413('0x12'),this[_0x7413('0x13')]['bind'](this));this[_0x7413('0x2')]['on'](_0x7413('0x14'),this['handleError'][_0x7413('0x11')](this));this[_0x7413('0x2')][_0x7413('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x2267f6,_0x336c4c){var _0x49f0f6={'connTimeout':_0x2267f6[_0x7413('0x16')]?_0x2267f6[_0x7413('0x16')]*0x3e8:0x2710,'authTimeout':_0x2267f6['authTimeout']?_0x2267f6[_0x7413('0x17')]*0x3e8:0x1388};if(_0x2267f6['service']){_0x49f0f6['user']=_0x2267f6[_0x7413('0x18')];_0x49f0f6['email']=_0x336c4c||_0x2267f6[_0x7413('0x18')]||'anonymous@xcally.com';if(_0x2267f6[_0x7413('0x19')]){_0x49f0f6[_0x7413('0x1a')]=utils[_0x7413('0x1b')](_0x2267f6[_0x7413('0x1c')][_0x7413('0x1d')],_0x2267f6[_0x7413('0x18')]);}else{_0x49f0f6['password']=_0x2267f6[_0x7413('0x1e')];}}else{if(_0x2267f6[_0x7413('0x1f')]){_0x49f0f6[_0x7413('0x18')]=_0x2267f6[_0x7413('0x18')];_0x49f0f6['password']=_0x2267f6[_0x7413('0x1e')];}}_0x49f0f6[_0x7413('0x20')]=_0x2267f6[_0x7413('0x20')];_0x49f0f6[_0x7413('0x21')]=_0x2267f6[_0x7413('0x21')]||0x3e1;if(_0x2267f6[_0x7413('0x22')]){_0x49f0f6[_0x7413('0x22')]=!![];}else{_0x49f0f6[_0x7413('0x22')]=![];_0x49f0f6['autotls']='required';}return _0x49f0f6;};EmailImap[_0x7413('0x23')]['handleReady']=function(){this[_0x7413('0x2')][_0x7413('0x24')](this[_0x7413('0xc')],![],this[_0x7413('0x25')][_0x7413('0x11')](this));};EmailImap[_0x7413('0x23')][_0x7413('0x25')]=function(_0x41cb5d,_0x1d455b){if(_0x41cb5d){this['handleError'](_0x41cb5d,!![]);}else{this['emit'](_0x7413('0x26'),_0x1d455b);this['readUnseen']();}};EmailImap[_0x7413('0x23')][_0x7413('0x27')]=function(_0x463b21){if(_0x463b21){this['handleError'](_0x463b21,!![]);}else{this[_0x7413('0x2')][_0x7413('0x12')]();}};EmailImap[_0x7413('0x23')][_0x7413('0x28')]=function(){this[_0x7413('0x2')][_0x7413('0x29')](['UNSEEN'],this[_0x7413('0x2a')]['bind'](this));};EmailImap[_0x7413('0x23')][_0x7413('0x2a')]=function(_0xae2969,_0x13a836){if(_0xae2969){this[_0x7413('0x2b')](_0xae2969,!![]);}else{if(_0x13a836[_0x7413('0x2c')]){try{var _0x5bb3ea=this[_0x7413('0x2')][_0x7413('0x2d')](_0x13a836,{'bodies':'','markSeen':!![]});_0x5bb3ea['on'](_0x7413('0x2e'),this[_0x7413('0x2f')][_0x7413('0x11')](this));_0x5bb3ea[_0x7413('0xf')](_0x7413('0x14'),this['handleFetchError'][_0x7413('0x11')](this));_0x5bb3ea[_0x7413('0xf')](_0x7413('0x12'),this[_0x7413('0x30')][_0x7413('0x11')](this));}catch(_0x51d676){logger[_0x7413('0x14')](_0x51d676);}}else{this['imap'][_0x7413('0x31')](!![],this[_0x7413('0x27')][_0x7413('0x11')](this));}}};EmailImap['prototype'][_0x7413('0x2f')]=function(_0x487dc8){_0x487dc8['on'](_0x7413('0x32'),this[_0x7413('0x33')]['bind'](this));_0x487dc8['once'](_0x7413('0x34'),this[_0x7413('0x35')][_0x7413('0x11')](this));_0x487dc8['once']('end',this[_0x7413('0x36')]['bind'](this));};EmailImap['prototype'][_0x7413('0x33')]=function(_0x575a79){simpleParser(_0x575a79,{'Iconv':Iconv},this[_0x7413('0x37')][_0x7413('0x11')](this));};EmailImap[_0x7413('0x23')][_0x7413('0x35')]=function(){};EmailImap[_0x7413('0x23')]['handleMessageEnd']=function(){};EmailImap[_0x7413('0x23')][_0x7413('0x37')]=function(_0x44e8b5,_0xfa34ef){if(_0x44e8b5){logger[_0x7413('0x14')](_0x44e8b5);}else{var _0x1168cd=this;utils[_0x7413('0x38')](this[_0x7413('0xe')],_0xfa34ef,function(_0x5993d){_0x1168cd[_0x7413('0x39')](_0x7413('0xb'),_0x5993d);});}};EmailImap[_0x7413('0x23')]['handleFetchEnd']=function(){this[_0x7413('0x2')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x44af7d){this['handleError'](_0x44af7d);this['imap'][_0x7413('0x31')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x7413('0x23')][_0x7413('0x13')]=function(){this[_0x7413('0x39')](_0x7413('0x12'));};EmailImap[_0x7413('0x23')]['handleError']=function(_0x3f421c,_0x51c48a){logger[_0x7413('0x14')](_0x7413('0x2b'),this[_0x7413('0xe')][_0x7413('0xb')],JSON[_0x7413('0x3a')](_0x3f421c));var _0x125466='';if(_0x3f421c){if(_0x3f421c[_0x7413('0x3b')]){_0x125466=_0x3f421c[_0x7413('0x3b')];}else{for(var _0x35d198 in _0x3f421c){if(_0x3f421c[_0x7413('0x3c')](_0x35d198)){_0x125466+=_[_0x7413('0x3d')](_0x35d198)+':\x20'+_0x3f421c[_0x35d198]+'\x0a';}}}}if(_0x51c48a){this[_0x7413('0x2')][_0x7413('0x12')]();}else{this['emit'](_0x7413('0x14'),_0x125466);this[_0x7413('0x39')](_0x7413('0x12'));}};module[_0x7413('0x3e')]=EmailImap; \ No newline at end of file +var _0x06ae=['handleFetchMessage','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','emit','email','closeBox','stringify','textCode','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','mailbox','INBOX','account','getAccount','ready','bind','end','handleEnd','error','connect','prototype','connTimeout','authTimeout','service','user','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','handleError','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchError','once','handleFetchEnd'];(function(_0x4ed804,_0x4565e9){var _0x281d74=function(_0x56891e){while(--_0x56891e){_0x4ed804['push'](_0x4ed804['shift']());}};_0x281d74(++_0x4565e9);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xe06a('0x0'));var Imap=require(_0xe06a('0x1'));var simpleParser=require(_0xe06a('0x2'))[_0xe06a('0x3')];var Iconv=require(_0xe06a('0x4'))[_0xe06a('0x5')];var EventEmitter=require(_0xe06a('0x6'))[_0xe06a('0x7')];var utils=require(_0xe06a('0x8'));var logger=require('../../../config/logger')('email');function EmailImap(_0x50e6cf,_0x1df79f){this[_0xe06a('0x9')]=_0xe06a('0xa');this[_0xe06a('0xb')]=this[_0xe06a('0xc')](_0x50e6cf,_0x1df79f);this['imap']=new Imap(this[_0xe06a('0xb')]);this['imap']['once'](_0xe06a('0xd'),this['handleReady'][_0xe06a('0xe')](this));this['imap']['once'](_0xe06a('0xf'),this[_0xe06a('0x10')]['bind'](this));this[_0xe06a('0x1')]['on'](_0xe06a('0x11'),this['handleError'][_0xe06a('0xe')](this));this[_0xe06a('0x1')][_0xe06a('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xe06a('0x13')][_0xe06a('0xc')]=function(_0x359273,_0xf8a9a7){var _0x335c0d={'connTimeout':_0x359273['connTimeout']?_0x359273[_0xe06a('0x14')]*0x3e8:0x2710,'authTimeout':_0x359273[_0xe06a('0x15')]?_0x359273[_0xe06a('0x15')]*0x3e8:0x1388};if(_0x359273[_0xe06a('0x16')]){_0x335c0d[_0xe06a('0x17')]=_0x359273[_0xe06a('0x17')];_0x335c0d['email']=_0xf8a9a7||_0x359273[_0xe06a('0x17')]||'anonymous@xcally.com';if(_0x359273['modernAuthentication']){_0x335c0d['xoauth2']=utils[_0xe06a('0x18')](_0x359273[_0xe06a('0x19')][_0xe06a('0x1a')],_0x359273['user']);}else{_0x335c0d[_0xe06a('0x1b')]=_0x359273[_0xe06a('0x1b')];}}else{if(_0x359273['authentication']){_0x335c0d[_0xe06a('0x17')]=_0x359273['user'];_0x335c0d[_0xe06a('0x1b')]=_0x359273['password'];}}_0x335c0d['host']=_0x359273[_0xe06a('0x1c')];_0x335c0d[_0xe06a('0x1d')]=_0x359273[_0xe06a('0x1d')]||0x3e1;if(_0x359273[_0xe06a('0x1e')]){_0x335c0d[_0xe06a('0x1e')]=!![];}else{_0x335c0d[_0xe06a('0x1e')]=![];_0x335c0d[_0xe06a('0x1f')]=_0xe06a('0x20');}return _0x335c0d;};EmailImap[_0xe06a('0x13')][_0xe06a('0x21')]=function(){this['imap'][_0xe06a('0x22')](this[_0xe06a('0x9')],![],this[_0xe06a('0x23')][_0xe06a('0xe')](this));};EmailImap[_0xe06a('0x13')][_0xe06a('0x23')]=function(_0x3f468e,_0x19a7e0){if(_0x3f468e){this[_0xe06a('0x24')](_0x3f468e,!![]);}else{this['emit']('box',_0x19a7e0);this[_0xe06a('0x25')]();}};EmailImap['prototype'][_0xe06a('0x26')]=function(_0x5143fd){if(_0x5143fd){this['handleError'](_0x5143fd,!![]);}else{this['imap'][_0xe06a('0xf')]();}};EmailImap[_0xe06a('0x13')]['readUnseen']=function(){this[_0xe06a('0x1')][_0xe06a('0x27')]([_0xe06a('0x28')],this[_0xe06a('0x29')][_0xe06a('0xe')](this));};EmailImap[_0xe06a('0x13')][_0xe06a('0x29')]=function(_0x34fadb,_0x1ce29f){if(_0x34fadb){this['handleError'](_0x34fadb,!![]);}else{if(_0x1ce29f['length']){try{var _0x177d3e=this[_0xe06a('0x1')][_0xe06a('0x2a')](_0x1ce29f,{'bodies':'','markSeen':!![]});_0x177d3e['on'](_0xe06a('0x2b'),this['handleFetchMessage'][_0xe06a('0xe')](this));_0x177d3e['once'](_0xe06a('0x11'),this[_0xe06a('0x2c')][_0xe06a('0xe')](this));_0x177d3e[_0xe06a('0x2d')]('end',this[_0xe06a('0x2e')][_0xe06a('0xe')](this));}catch(_0x213dc0){logger[_0xe06a('0x11')](_0x213dc0);}}else{this['imap']['closeBox'](!![],this[_0xe06a('0x26')][_0xe06a('0xe')](this));}}};EmailImap[_0xe06a('0x13')][_0xe06a('0x2f')]=function(_0x117b07){_0x117b07['on'](_0xe06a('0x30'),this['handleMessageBody']['bind'](this));_0x117b07[_0xe06a('0x2d')]('attributes',this[_0xe06a('0x31')]['bind'](this));_0x117b07[_0xe06a('0x2d')](_0xe06a('0xf'),this[_0xe06a('0x32')]['bind'](this));};EmailImap['prototype'][_0xe06a('0x33')]=function(_0xb0e44c){simpleParser(_0xb0e44c,{'Iconv':Iconv},this[_0xe06a('0x34')][_0xe06a('0xe')](this));};EmailImap[_0xe06a('0x13')][_0xe06a('0x31')]=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0xed8a80,_0x2aa369){if(_0xed8a80){logger[_0xe06a('0x11')](_0xed8a80);}else{var _0x17fec1=this;utils[_0xe06a('0x35')](this['account'],_0x2aa369,function(_0x394fd8){_0x17fec1[_0xe06a('0x36')](_0xe06a('0x37'),_0x394fd8);});}};EmailImap['prototype'][_0xe06a('0x2e')]=function(){this[_0xe06a('0x1')][_0xe06a('0x38')](!![],this[_0xe06a('0x26')][_0xe06a('0xe')](this));};EmailImap[_0xe06a('0x13')][_0xe06a('0x2c')]=function(_0x302f46){this['handleError'](_0x302f46);this['imap'][_0xe06a('0x38')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xe06a('0x13')][_0xe06a('0x10')]=function(){this[_0xe06a('0x36')]('end');};EmailImap['prototype'][_0xe06a('0x24')]=function(_0x353349,_0x13d461){logger[_0xe06a('0x11')]('handleError',this[_0xe06a('0xb')]['email'],JSON[_0xe06a('0x39')](_0x353349));var _0x2c9970='';if(_0x353349){if(_0x353349['textCode']){_0x2c9970=_0x353349[_0xe06a('0x3a')];}else{for(var _0x136ff4 in _0x353349){if(_0x353349['hasOwnProperty'](_0x136ff4)){_0x2c9970+=_['upperFirst'](_0x136ff4)+':\x20'+_0x353349[_0x136ff4]+'\x0a';}}}}if(_0x13d461){this['imap']['end']();}else{this[_0xe06a('0x36')]('error',_0x2c9970);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f1b831b..b90c69e 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 _0xbbd9=['use','compile','toString','verify','createTransport','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x4b1c46,_0x3df1aa){var _0x1ab9a8=function(_0x14e228){while(--_0x14e228){_0x4b1c46['push'](_0x4b1c46['shift']());}};_0x1ab9a8(++_0x3df1aa);}(_0xbbd9,0x96));var _0x9bbd=function(_0x1f782d,_0x5906b8){_0x1f782d=_0x1f782d-0x0;var _0x228cce=_0xbbd9[_0x1f782d];return _0x228cce;};'use strict';var nodemailer=require(_0x9bbd('0x0'));var inlineBase64=require(_0x9bbd('0x1'));function EmailSmtp(){}EmailSmtp[_0x9bbd('0x2')][_0x9bbd('0x3')]=function(_0x258694,_0x33dc2a){return new Promise(function(_0x2237f1,_0x1ae9f6){var _0x302d4c=nodemailer['createTransport'](_0x258694);_0x302d4c[_0x9bbd('0x4')](_0x9bbd('0x5'),inlineBase64());_0x302d4c['sendMail'](_0x33dc2a,function(_0x3fbc01,_0x7ef987){if(_0x3fbc01){_0x1ae9f6(_0x3fbc01[_0x9bbd('0x6')]());}else{_0x2237f1(_0x7ef987);}});});};EmailSmtp[_0x9bbd('0x2')][_0x9bbd('0x7')]=function(_0x2ee166){return new Promise(function(_0x35787c,_0x178e78){var _0x8bda06=nodemailer[_0x9bbd('0x8')](_0x2ee166);_0x8bda06['verify'](function(_0x1cf0c0,_0x58b7fd){if(_0x1cf0c0){_0x178e78(_0x1cf0c0['toString']());}else{if(_0x58b7fd){_0x35787c(_0x58b7fd);}else{_0x178e78(_0x9bbd('0x9'));}}});});};module[_0x9bbd('0xa')]=EmailSmtp; \ No newline at end of file +var _0xd11d=['createTransport','use','compile','sendMail','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send'];(function(_0xabdc6d,_0x9bb811){var _0x449c6b=function(_0xe08ee6){while(--_0xe08ee6){_0xabdc6d['push'](_0xabdc6d['shift']());}};_0x449c6b(++_0x9bb811);}(_0xd11d,0x15a));var _0xdd11=function(_0x279de7,_0x1349ab){_0x279de7=_0x279de7-0x0;var _0x1164ba=_0xd11d[_0x279de7];return _0x1164ba;};'use strict';var nodemailer=require(_0xdd11('0x0'));var inlineBase64=require(_0xdd11('0x1'));function EmailSmtp(){}EmailSmtp[_0xdd11('0x2')][_0xdd11('0x3')]=function(_0x171fac,_0x1af188){return new Promise(function(_0x218cbc,_0x3b2061){var _0x383605=nodemailer[_0xdd11('0x4')](_0x171fac);_0x383605[_0xdd11('0x5')](_0xdd11('0x6'),inlineBase64());_0x383605[_0xdd11('0x7')](_0x1af188,function(_0x1febcf,_0x1d460c){if(_0x1febcf){_0x3b2061(_0x1febcf['toString']());}else{_0x218cbc(_0x1d460c);}});});};EmailSmtp['prototype'][_0xdd11('0x8')]=function(_0x287eb5){return new Promise(function(_0x239ab7,_0x57a654){var _0x57b0af=nodemailer[_0xdd11('0x4')](_0x287eb5);_0x57b0af[_0xdd11('0x8')](function(_0x4c51f8,_0x4895c3){if(_0x4c51f8){_0x57a654(_0x4c51f8['toString']());}else{if(_0x4895c3){_0x239ab7(_0x4895c3);}else{_0x57a654(_0xdd11('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e20322d..19016e8 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 _0x5709=['%s-%s','now','root','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','parser','from','subject','messageId','inReplyTo','date','filter','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','randomstring','util','../../../config/logger','email','head','value','anonymous','generate','@xcally.com','name','address','substring','indexOf','split','length','slice','join','Anonymous','isEmpty','html','test','replace','includes','','body','textAsHtml','0x1?_0x5757bc[_0x9570('0xf')](0x0,-0x1)[_0x9570('0x10')]('\x20'):_0x507ef6[_0x9570('0x9')];}return _0x9570('0x11');}function getLastName(_0x1d07f2){var _0x2d63db=_[_0x9570('0x4')](_0x1d07f2[_0x9570('0x5')]);if(_0x2d63db&&_0x2d63db[_0x9570('0x9')]){var _0x3f07ad=_0x2d63db[_0x9570('0x9')][_0x9570('0xd')](/\s+/);return _0x3f07ad[_0x9570('0xe')]>0x1?_0x3f07ad['pop']():'';}return'';}function getMails(_0x2fa28b,_0x2f3cbd){var _0x3c8549='';for(var _0x4d0b07=0x0;_0x4d0b07<_0x2f3cbd[_0x9570('0x5')]['length'];_0x4d0b07+=0x1){if(_0x2f3cbd[_0x9570('0x5')][_0x4d0b07][_0x9570('0xa')]!==_0x2fa28b){if(!_[_0x9570('0x12')](_0x3c8549)){_0x3c8549+=',';}_0x3c8549+=_0x2f3cbd[_0x9570('0x5')][_0x4d0b07][_0x9570('0x9')]||_0x2f3cbd[_0x9570('0x5')][_0x4d0b07][_0x9570('0xa')]||'';_0x3c8549+='\x20<';_0x3c8549+=_0x2f3cbd['value'][_0x4d0b07][_0x9570('0xa')]?_0x2f3cbd[_0x9570('0x5')][_0x4d0b07][_0x9570('0xa')]:'anonymous'+random[_0x9570('0x7')](0x6)+'@xcally.com';_0x3c8549+='>';}}return _0x3c8549;}function parseEmail(_0x4e1957,_0x18e521,_0xd6bfe2){if(_0x18e521[_0x9570('0x13')]){var _0x2d22b7=/)<[^<]*)*<\/script>/gi;while(_0x2d22b7[_0x9570('0x14')](_0x18e521[_0x9570('0x13')])){_0x18e521['html']=_0x18e521[_0x9570('0x13')][_0x9570('0x15')](_0x2d22b7,'');}if(_0x18e521['html'][_0x9570('0x16')](_0x9570('0x17'))){var _0x277fae=[];_0x18e521[_0x9570('0x18')][_0x9570('0x19')](_0x1feace=>{_0x277fae[_0x9570('0x1a')](_0x1feace[_0x9570('0x1b')]);});var _0x54dd4d=/]+>/g;var _0x57442f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xc9054b=_0x18e521[_0x9570('0x13')][_0x9570('0x15')](_0x57442f,'_SRC');var _0x4e0e22=_0xc9054b[_0x9570('0x15')](_0x54dd4d,'_IMG');for(let _0xd72dd2=0x0;_0xd72dd2<_0x277fae[_0x9570('0xe')];_0xd72dd2++){var _0x5357ee=_0x4e0e22[_0x9570('0x15')](_0x9570('0x1c'),'\x20[Attachment:\x20'+_0x277fae[_0xd72dd2]+_0x9570('0x1d'));_0x4e0e22=_0x5357ee;}_0x18e521[_0x9570('0x13')]=_0x4e0e22;}_0xd6bfe2[_0x9570('0x1e')]=_0x18e521['html'];}else{_0xd6bfe2[_0x9570('0x1e')]=_0x18e521[_0x9570('0x1f')];}if(_0xd6bfe2[_0x9570('0x1e')]){_0xd6bfe2[_0x9570('0x1e')]=_0xd6bfe2[_0x9570('0x1e')][_0x9570('0x15')](/0x0){var _0x57a402=[_0x9570('0x31'),'X-Auto-Response-Suppress:\x20All',_0x9570('0x32')];for(var _0x1e285d=0x0;_0x1e285d<_0x18e521[_0x9570('0x30')][_0x9570('0xe')];_0x1e285d++){var _0x215438=_['indexOf'](_0x57a402,_0x18e521[_0x9570('0x30')][_0x1e285d][_0x9570('0x33')]);if(_0x215438>=0x0){_0xd6bfe2['isAutoreply']=!![];}}}return _0xd6bfe2;}exports[_0x9570('0x34')]=function(_0xc562a5,_0x18a919,_0x3dc846){var _0x129d28={'from':getAddress(_0x18a919['from']),'firstName':getFirstName(_0x18a919['from']),'lastName':getLastName(_0x18a919[_0x9570('0x35')]),'mapKey':_0x9570('0x3'),'message':{'from':getMails(_0xc562a5[_0x9570('0x3')],_0x18a919['from']),'to':_0xc562a5[_0x9570('0x3')],'cc':'','subject':_0x18a919[_0x9570('0x36')]||'','messageId':_0x18a919[_0x9570('0x37')],'inReplyTo':_0x18a919[_0x9570('0x38')],'sentAt':moment(_0x18a919[_0x9570('0x39')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x18a919[_0x9570('0x13')]&&!_0x18a919[_0x9570('0x1f')]){var _0x3ed6c4=_[_0x9570('0x3a')](_0x18a919[_0x9570('0x18')],{'contentType':'application/ms-tnef'});if(_0x3ed6c4[_0x9570('0xe')]){logger['info'](util[_0x9570('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x18a919[_0x9570('0x37')]));tnef[_0x9570('0x3b')](_[_0x9570('0x3c')](_0x3ed6c4)['content'],function(_0x3de996,_0x36d733){if(_0x36d733){_0x18a919[_0x9570('0x13')]=_0x36d733[_0x9570('0x3d')]||_0x9570('0x3e');if(_0x36d733['Attachments']){for(var _0x5a002b=0x0;_0x5a002b<_0x36d733[_0x9570('0x3f')]['length'];_0x5a002b++){var _0x3eb448=_0x36d733[_0x9570('0x3f')][_0x5a002b];_0x129d28[_0x9570('0x22')]['attachments'][_0x9570('0x1a')]({'filename':_0x3eb448[_0x9570('0x40')],'content':Buffer[_0x9570('0x35')](_0x3eb448[_0x9570('0x41')])});}}}_0x3dc846(parseEmail(_0xc562a5,_0x18a919,_0x129d28));});}else{_0x18a919[_0x9570('0x13')]=_0x9570('0x3e');_0x3dc846(parseEmail(_0xc562a5,_0x18a919,_0x129d28));}}else{_0x3dc846(parseEmail(_0xc562a5,_0x18a919,_0x129d28));}};exports[_0x9570('0x42')]=function(_0x2d6640,_0x1c979a){var _0x155591=[_0x9570('0x43')+(_0x1c979a||''),_0x9570('0x44')+_0x2d6640,'',''];return Buffer['from'](_0x155591['join'](''),_0x9570('0x45'))['toString'](_0x9570('0x46'));}; \ No newline at end of file +var _0x5425=['format','%s-%s','now','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','parseBuffer','content','BodyHTML','

Empty\x20message

','Attachments','Title','Data','user=','auth=Bearer\x20','toString','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','address','anonymous','@xcally.com','name','substring','indexOf','split','slice','join','Anonymous','head','value','length','pop','isEmpty','generate','html','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x3a9445[_0x5542('0xf')](0x0,-0x1)[_0x5542('0x10')]('\x20'):_0x591735[_0x5542('0xb')];}return _0x5542('0x11');}function getLastName(_0x5c4b26){var _0x5b39e5=_[_0x5542('0x12')](_0x5c4b26[_0x5542('0x13')]);if(_0x5b39e5&&_0x5b39e5[_0x5542('0xb')]){var _0x57475f=_0x5b39e5['name'][_0x5542('0xe')](/\s+/);return _0x57475f[_0x5542('0x14')]>0x1?_0x57475f[_0x5542('0x15')]():'';}return'';}function getMails(_0x4efefd,_0x573bbb){var _0x226916='';for(var _0x43e993=0x0;_0x43e993<_0x573bbb[_0x5542('0x13')]['length'];_0x43e993+=0x1){if(_0x573bbb['value'][_0x43e993][_0x5542('0x8')]!==_0x4efefd){if(!_[_0x5542('0x16')](_0x226916)){_0x226916+=',';}_0x226916+=_0x573bbb[_0x5542('0x13')][_0x43e993]['name']||_0x573bbb[_0x5542('0x13')][_0x43e993][_0x5542('0x8')]||'';_0x226916+='\x20<';_0x226916+=_0x573bbb[_0x5542('0x13')][_0x43e993][_0x5542('0x8')]?_0x573bbb[_0x5542('0x13')][_0x43e993]['address']:_0x5542('0x9')+random[_0x5542('0x17')](0x6)+'@xcally.com';_0x226916+='>';}}return _0x226916;}function parseEmail(_0x54de7e,_0x395e67,_0x102a36){if(_0x395e67['html']){var _0x13e1cf=/)<[^<]*)*<\/script>/gi;while(_0x13e1cf['test'](_0x395e67[_0x5542('0x18')])){_0x395e67[_0x5542('0x18')]=_0x395e67[_0x5542('0x18')]['replace'](_0x13e1cf,'');}if(_0x395e67[_0x5542('0x18')]['includes'](_0x5542('0x19'))){var _0xd79c42=[];_0x395e67[_0x5542('0x1a')][_0x5542('0x1b')](_0x2195e4=>{_0xd79c42[_0x5542('0x1c')](_0x2195e4[_0x5542('0x1d')]);});var _0x125c22=/]+>/g;var _0x1dc0f2=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x21b075=_0x395e67[_0x5542('0x18')][_0x5542('0x1e')](_0x1dc0f2,'_SRC');var _0x451dda=_0x21b075['replace'](_0x125c22,_0x5542('0x1f'));for(let _0x4a409a=0x0;_0x4a409a<_0xd79c42['length'];_0x4a409a++){var _0x3a9ea0=_0x451dda['replace']('_IMG',_0x5542('0x20')+_0xd79c42[_0x4a409a]+_0x5542('0x21'));_0x451dda=_0x3a9ea0;}_0x395e67['html']=_0x451dda;}_0x102a36[_0x5542('0x22')]=_0x395e67['html'];}else{_0x102a36[_0x5542('0x22')]=_0x395e67[_0x5542('0x23')];}if(_0x102a36[_0x5542('0x22')]){_0x102a36[_0x5542('0x22')]=_0x102a36['body'][_0x5542('0x1e')](/0x0){var _0x3ee582=[_0x5542('0x2f'),_0x5542('0x30'),'Precedence:\x20auto_reply'];for(var _0x3e79f6=0x0;_0x3e79f6<_0x395e67['headerLines']['length'];_0x3e79f6++){var _0x430ca1=_[_0x5542('0xd')](_0x3ee582,_0x395e67[_0x5542('0x2e')][_0x3e79f6][_0x5542('0x31')]);if(_0x430ca1>=0x0){_0x102a36[_0x5542('0x32')]=!![];}}}return _0x102a36;}exports[_0x5542('0x33')]=function(_0x4494d8,_0xf64014,_0x4ec942){var _0x3852de={'from':getAddress(_0xf64014[_0x5542('0x34')]),'firstName':getFirstName(_0xf64014[_0x5542('0x34')]),'lastName':getLastName(_0xf64014[_0x5542('0x34')]),'mapKey':_0x5542('0x6'),'message':{'from':getMails(_0x4494d8[_0x5542('0x6')],_0xf64014['from']),'to':_0x4494d8[_0x5542('0x6')],'cc':'','subject':_0xf64014[_0x5542('0x35')]||'','messageId':_0xf64014['messageId'],'inReplyTo':_0xf64014[_0x5542('0x36')],'sentAt':moment(_0xf64014['date'])[_0x5542('0x2b')](_0x5542('0x37')),'attach':![],'attachments':[]}};if(!_0xf64014[_0x5542('0x18')]&&!_0xf64014[_0x5542('0x23')]){var _0x1d385f=_[_0x5542('0x38')](_0xf64014[_0x5542('0x1a')],{'contentType':'application/ms-tnef'});if(_0x1d385f[_0x5542('0x14')]){logger['info'](util[_0x5542('0x2b')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0xf64014['messageId']));tnef[_0x5542('0x39')](_['first'](_0x1d385f)[_0x5542('0x3a')],function(_0x3eec82,_0x4a6151){if(_0x4a6151){_0xf64014[_0x5542('0x18')]=_0x4a6151[_0x5542('0x3b')]||_0x5542('0x3c');if(_0x4a6151[_0x5542('0x3d')]){for(var _0x12fc78=0x0;_0x12fc78<_0x4a6151[_0x5542('0x3d')][_0x5542('0x14')];_0x12fc78++){var _0x1a2e69=_0x4a6151[_0x5542('0x3d')][_0x12fc78];_0x3852de[_0x5542('0x25')][_0x5542('0x1a')][_0x5542('0x1c')]({'filename':_0x1a2e69[_0x5542('0x3e')],'content':Buffer[_0x5542('0x34')](_0x1a2e69[_0x5542('0x3f')])});}}}_0x4ec942(parseEmail(_0x4494d8,_0xf64014,_0x3852de));});}else{_0xf64014[_0x5542('0x18')]=_0x5542('0x3c');_0x4ec942(parseEmail(_0x4494d8,_0xf64014,_0x3852de));}}else{_0x4ec942(parseEmail(_0x4494d8,_0xf64014,_0x3852de));}};exports['generateXOAuth2Token']=function(_0x4b61fc,_0xb3daf2){var _0x40bf5a=[_0x5542('0x40')+(_0xb3daf2||''),_0x5542('0x41')+_0x4b61fc,'',''];return Buffer['from'](_0x40bf5a['join'](''),'utf-8')[_0x5542('0x42')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 51ef4cb..12f74f6 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 _0x8fb6=['key','SERV','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x8fb6,0x16e));var _0x68fb=function(_0x3ed7ff,_0x4f0472){_0x3ed7ff=_0x3ed7ff-0x0;var _0x135ecd=_0x8fb6[_0x3ed7ff];return _0x135ecd;};'use strict';var _=require(_0x68fb('0x0'));function MailAccount(_0x30dac5){this['id']=_0x30dac5['id']||0x0;this[_0x68fb('0x1')]=_0x30dac5['name']||_0x68fb('0x2');this[_0x68fb('0x3')]=_0x30dac5[_0x68fb('0x3')]||_0x68fb('0x4');this[_0x68fb('0x5')]=_0x30dac5[_0x68fb('0x5')]||![];this[_0x68fb('0x6')]=_0x30dac5[_0x68fb('0x6')]||[];this[_0x68fb('0x7')]=_0x30dac5['Smtp']||[];}module[_0x68fb('0x8')]=MailAccount; \ No newline at end of file +var _0x87dc=['Smtp','lodash','name','Service','key','SERV','active','Imap'];(function(_0x494e0e,_0x4d6d0e){var _0x53aa98=function(_0x2f4092){while(--_0x2f4092){_0x494e0e['push'](_0x494e0e['shift']());}};_0x53aa98(++_0x4d6d0e);}(_0x87dc,0xe9));var _0xc87d=function(_0x990863,_0x4e77a6){_0x990863=_0x990863-0x0;var _0x2afb2d=_0x87dc[_0x990863];return _0x2afb2d;};'use strict';var _=require(_0xc87d('0x0'));function MailAccount(_0x2f366c){this['id']=_0x2f366c['id']||0x0;this[_0xc87d('0x1')]=_0x2f366c[_0xc87d('0x1')]||_0xc87d('0x2');this['key']=_0x2f366c[_0xc87d('0x3')]||_0xc87d('0x4');this[_0xc87d('0x5')]=_0x2f366c[_0xc87d('0x5')]||![];this[_0xc87d('0x6')]=_0x2f366c[_0xc87d('0x6')]||[];this[_0xc87d('0x7')]=_0x2f366c['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 3813138..09e9e2f 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 _0x1c12=['merge','exports','../model/mailAccount','mapKeys','prototype','hasOwnProperty','mailAccounts','length','isUndefined'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1c12,0xd1));var _0x21c1=function(_0x325a9e,_0x144ea9){_0x325a9e=_0x325a9e-0x0;var _0x38218a=_0x1c12[_0x325a9e];return _0x38218a;};'use strict';var _=require('lodash');var MailAccount=require(_0x21c1('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3d6fb7,_0x142865,_0x4284d7){var _0x526d11=_[_0x21c1('0x1')](_0x3d6fb7,function(_0x27509e,_0x275543){return _0x27509e[_0x4284d7];});for(var _0x488739 in _0x142865){if(_0x142865['hasOwnProperty'](_0x488739)){if(!_0x526d11[_0x488739]){delete _0x142865[_0x488739];}}}}Realtime[_0x21c1('0x2')]['mergeFromDatabase']=function(_0x1cdfe4,_0x2d8c5d){for(var _0xf84a87 in _0x2d8c5d){if(_0x1cdfe4[_0x21c1('0x3')](_0xf84a87)){_0x1cdfe4[_0xf84a87]=_0x2d8c5d[_0xf84a87];}}};Realtime[_0x21c1('0x2')]['initMailAccounts']=function(){var _0x3676ff=this;return function(_0x4b0250){if(_0x4b0250){freeIsNotKey(_0x4b0250,_0x3676ff[_0x21c1('0x4')],'id');for(var _0x6dc8dd=0x0,_0x584619={},_0x24487d={};_0x6dc8dd<_0x4b0250[_0x21c1('0x5')];_0x6dc8dd+=0x1){_0x584619=_0x4b0250[_0x6dc8dd];if(_[_0x21c1('0x6')](_0x3676ff[_0x21c1('0x4')][_0x584619['id']])){_0x3676ff['mailAccounts'][_0x584619['id']]=new MailAccount(_0x584619);}else{_[_0x21c1('0x7')](_0x3676ff[_0x21c1('0x4')][_0x584619['id']],_0x584619);}}}return _0x3676ff[_0x21c1('0x4')];};};module[_0x21c1('0x8')]=Realtime; \ No newline at end of file +var _0x1409=['merge','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','initMailAccounts','length'];(function(_0x14be7a,_0x5373dc){var _0x525f3b=function(_0x3487bc){while(--_0x3487bc){_0x14be7a['push'](_0x14be7a['shift']());}};_0x525f3b(++_0x5373dc);}(_0x1409,0x1cc));var _0x9140=function(_0x2199b6,_0x53daac){_0x2199b6=_0x2199b6-0x0;var _0x70d031=_0x1409[_0x2199b6];return _0x70d031;};'use strict';var _=require(_0x9140('0x0'));var MailAccount=require(_0x9140('0x1'));var Realtime=function(){this[_0x9140('0x2')]={};};function freeIsNotKey(_0x45559f,_0x3b80fb,_0xc335ae){var _0x507298=_[_0x9140('0x3')](_0x45559f,function(_0x29f0f1,_0x9bda1d){return _0x29f0f1[_0xc335ae];});for(var _0x56b05e in _0x3b80fb){if(_0x3b80fb['hasOwnProperty'](_0x56b05e)){if(!_0x507298[_0x56b05e]){delete _0x3b80fb[_0x56b05e];}}}}Realtime[_0x9140('0x4')][_0x9140('0x5')]=function(_0x4ba17b,_0x4ca9ef){for(var _0x3bdbbf in _0x4ca9ef){if(_0x4ba17b['hasOwnProperty'](_0x3bdbbf)){_0x4ba17b[_0x3bdbbf]=_0x4ca9ef[_0x3bdbbf];}}};Realtime['prototype'][_0x9140('0x6')]=function(){var _0x1a1b3b=this;return function(_0x5ce9d6){if(_0x5ce9d6){freeIsNotKey(_0x5ce9d6,_0x1a1b3b[_0x9140('0x2')],'id');for(var _0x1c8875=0x0,_0x350e41={},_0x32b70a={};_0x1c8875<_0x5ce9d6[_0x9140('0x7')];_0x1c8875+=0x1){_0x350e41=_0x5ce9d6[_0x1c8875];if(_['isUndefined'](_0x1a1b3b[_0x9140('0x2')][_0x350e41['id']])){_0x1a1b3b[_0x9140('0x2')][_0x350e41['id']]=new MailAccount(_0x350e41);}else{_[_0x9140('0x8')](_0x1a1b3b[_0x9140('0x2')][_0x350e41['id']],_0x350e41);}}}return _0x1a1b3b[_0x9140('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 7e72a82..58eeb02 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 _0xb235=['service','email','active','key','TemplateId','MailServerIn','Imap','data5','CloudProvider','Smtp','type','getMailAccount','notify','NotifyMailAccount','GetMailAccount','name','provider'];(function(_0x2582f1,_0x5210fd){var _0x2a2252=function(_0x5e6871){while(--_0x5e6871){_0x2582f1['push'](_0x2582f1['shift']());}};_0x2a2252(++_0x5210fd);}(_0xb235,0x10d));var _0x5b23=function(_0x2bf66e,_0xfb08f0){_0x2bf66e=_0x2bf66e-0x0;var _0x10179b=_0xb235[_0x2bf66e];return _0x10179b;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request'](_0x5b23('0x0'),{'options':{'attributes':['id',_0x5b23('0x1'),_0x5b23('0x2'),_0x5b23('0x3'),_0x5b23('0x4'),_0x5b23('0x5'),_0x5b23('0x6'),'ListId',_0x5b23('0x7')],'raw':![],'include':[{'model':_0x5b23('0x8'),'as':_0x5b23('0x9'),'include':[{'model':'CloudProvider','attributes':['id',_0x5b23('0x1'),'service','type',_0x5b23('0xa')],'as':_0x5b23('0xb')}]},{'model':'MailServerOut','as':_0x5b23('0xc'),'include':[{'model':_0x5b23('0xb'),'attributes':['id',_0x5b23('0x1'),_0x5b23('0x3'),_0x5b23('0xd'),_0x5b23('0xa')],'as':_0x5b23('0xb')}]}]},'log':_0x5b23('0xe')});};};exports[_0x5b23('0xf')]=function(_0x317d57,_0x46c971){return client['Request'](_0x5b23('0x10'),{'account':{'id':_0x317d57},'body':_0x46c971,'log':_0x5b23('0x10')});}; \ No newline at end of file +var _0x2d06=['getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut'];(function(_0x783834,_0x38c810){var _0x22055f=function(_0x6a6998){while(--_0x6a6998){_0x783834['push'](_0x783834['shift']());}};_0x22055f(++_0x38c810);}(_0x2d06,0x157));var _0x62d0=function(_0x1af4e4,_0x4ad5fa){_0x1af4e4=_0x1af4e4-0x0;var _0x216ab7=_0x2d06[_0x1af4e4];return _0x216ab7;};'use strict';var client=require('../client');exports[_0x62d0('0x0')]=function(){return function(){return client[_0x62d0('0x1')](_0x62d0('0x2'),{'options':{'attributes':['id',_0x62d0('0x3'),'provider',_0x62d0('0x4'),_0x62d0('0x5'),_0x62d0('0x6'),_0x62d0('0x7'),'ListId',_0x62d0('0x8')],'raw':![],'include':[{'model':_0x62d0('0x9'),'as':'Imap','include':[{'model':_0x62d0('0xa'),'attributes':['id',_0x62d0('0x3'),'service',_0x62d0('0xb'),_0x62d0('0xc')],'as':_0x62d0('0xa')}]},{'model':_0x62d0('0xd'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0x62d0('0x3'),_0x62d0('0x4'),_0x62d0('0xb'),_0x62d0('0xc')],'as':_0x62d0('0xa')}]}]},'log':_0x62d0('0xe')});};};exports[_0x62d0('0xf')]=function(_0x1fc939,_0x3d8ffa){return client[_0x62d0('0x1')](_0x62d0('0x10'),{'account':{'id':_0x1fc939},'body':_0x3d8ffa,'log':_0x62d0('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3251550..42f1eec 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 _0xd343=['Request','ShowSetting','../client'];(function(_0x449563,_0x8290cf){var _0x1b14de=function(_0x1d39e4){while(--_0x1d39e4){_0x449563['push'](_0x449563['shift']());}};_0x1b14de(++_0x8290cf);}(_0xd343,0x9b));var _0x3d34=function(_0x3dd111,_0x1d0545){_0x3dd111=_0x3dd111-0x0;var _0x444582=_0xd343[_0x3dd111];return _0x444582;};'use strict';var client=require(_0x3d34('0x0'));exports['getSettings']=function(){return client[_0x3d34('0x1')](_0x3d34('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0x7ad4=['getSettings','Request','ShowSetting','../client'];(function(_0x1857f9,_0x3748b0){var _0x5f1aef=function(_0x2822f1){while(--_0x2822f1){_0x1857f9['push'](_0x1857f9['shift']());}};_0x5f1aef(++_0x3748b0);}(_0x7ad4,0x1b7));var _0x47ad=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ad4[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x47ad('0x0'));exports[_0x47ad('0x1')]=function(){return client[_0x47ad('0x2')](_0x47ad('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 74c2077..f44fbc2 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(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 9fa5604..58d92b4 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 _0xb154=['defaults','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','redis'];(function(_0x4b1c77,_0x19fa11){var _0x50efba=function(_0x3e0f23){while(--_0x3e0f23){_0x4b1c77['push'](_0x4b1c77['shift']());}};_0x50efba(++_0x19fa11);}(_0xb154,0x16a));var _0x4b15=function(_0xac373c,_0x4b364a){_0xac373c=_0xac373c-0x0;var _0x544b83=_0xb154[_0xac373c];return _0x544b83;};'use strict';var _=require(_0x4b15('0x0'));var http=require(_0x4b15('0x1'));var express=require(_0x4b15('0x2'));var sticky=require(_0x4b15('0x3'));var Redis=require(_0x4b15('0x4'));var config=require(_0x4b15('0x5'));var app=express();var server=http[_0x4b15('0x6')](app);server[_0x4b15('0x7')]=0xdbba0;if(sticky[_0x4b15('0x8')](server,config[_0x4b15('0x9')])){var socketio=require('socket.io')(server,{'transports':[_0x4b15('0xa'),'polling']});config[_0x4b15('0xb')]=_[_0x4b15('0xc')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x4b15('0xd')](require(_0x4b15('0xe'))({'pubClient':new Redis(config[_0x4b15('0xb')]),'subClient':new Redis(config[_0x4b15('0xb')])}));require('../../config/triggers')[_0x4b15('0xf')]();require(_0x4b15('0x10'))[_0x4b15('0xf')](socketio);require(_0x4b15('0x11'))[_0x4b15('0xf')](app);require(_0x4b15('0x12'))['default'](app);}else{server['once'](_0x4b15('0x13'),function(){console[_0x4b15('0x14')](_0x4b15('0x15'),config[_0x4b15('0x9')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xca1a=['express','sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','websocket','localhost','adapter','redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','log','exports','lodash','http'];(function(_0x406b11,_0x22b8ed){var _0x3fc44e=function(_0x1e8533){while(--_0x1e8533){_0x406b11['push'](_0x406b11['shift']());}};_0x3fc44e(++_0x22b8ed);}(_0xca1a,0x106));var _0xaca1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaca1('0x0'));var http=require(_0xaca1('0x1'));var express=require(_0xaca1('0x2'));var sticky=require(_0xaca1('0x3'));var Redis=require(_0xaca1('0x4'));var config=require(_0xaca1('0x5'));var app=express();var server=http[_0xaca1('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0xaca1('0x7')](server,config[_0xaca1('0x8')])){var socketio=require(_0xaca1('0x9'))(server,{'transports':[_0xaca1('0xa'),'polling']});config['redis']=_['defaults'](config['redis'],{'host':_0xaca1('0xb'),'port':0x18eb});socketio[_0xaca1('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0xaca1('0xd')]),'subClient':new Redis(config[_0xaca1('0xd')])}));require(_0xaca1('0xe'))[_0xaca1('0xf')]();require(_0xaca1('0x10'))[_0xaca1('0xf')](socketio);require('../../config/express')[_0xaca1('0xf')](app);require(_0xaca1('0x11'))['default'](app);}else{server[_0xaca1('0x12')](_0xaca1('0x13'),function(){console[_0xaca1('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0xaca1('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 0cb3f21..231af46 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 _0x5146=['request','then','debug','rpc','error','message','catch','bluebird','../../config/logger','routing','client','http'];(function(_0x309bca,_0x5a9c14){var _0x50b704=function(_0x5c46fc){while(--_0x5c46fc){_0x309bca['push'](_0x309bca['shift']());}};_0x50b704(++_0x5a9c14);}(_0x5146,0x19f));var _0x6514=function(_0x468386,_0x8f8241){_0x468386=_0x468386-0x0;var _0x1ff4ed=_0x5146[_0x468386];return _0x1ff4ed;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6514('0x0'));var logger=require(_0x6514('0x1'))(_0x6514('0x2'));var client=jayson[_0x6514('0x3')][_0x6514('0x4')]({'port':0x2329});client['Request']=function(_0x28de07,_0x3939a1){return new BPromise(function(_0x4ac85c,_0x147703){return client[_0x6514('0x5')](_0x28de07,_0x3939a1)[_0x6514('0x6')](function(_0x4dfb4a){logger[_0x6514('0x7')](_0x6514('0x8'),'routing',_0x28de07,_0x3939a1,_0x4dfb4a);if(_0x4dfb4a[_0x6514('0x9')]){logger['error'](_0x6514('0x8'),_0x6514('0x2'),_0x28de07,_0x4dfb4a[_0x6514('0x9')][_0x6514('0xa')],_0x3939a1);return _0x147703(_0x4dfb4a[_0x6514('0x9')][_0x6514('0xa')]);}else{return _0x4ac85c(_0x4dfb4a['result']);}})[_0x6514('0xb')](function(_0x35465e){logger['error'](_0x6514('0x8'),_0x6514('0x2'),_0x28de07,_0x35465e,_0x3939a1);return _0x147703(_0x35465e);});});};module['exports']=client; \ No newline at end of file +var _0x3c49=['http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','client'];(function(_0x108911,_0x4d412d){var _0x293e65=function(_0x1e9bf7){while(--_0x1e9bf7){_0x108911['push'](_0x108911['shift']());}};_0x293e65(++_0x4d412d);}(_0x3c49,0x168));var _0x93c4=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x3c49[_0x494d1f];return _0x457b6e;};'use strict';var jayson=require(_0x93c4('0x0'));var BPromise=require('bluebird');var logger=require(_0x93c4('0x1'))(_0x93c4('0x2'));var client=jayson[_0x93c4('0x3')][_0x93c4('0x4')]({'port':0x2329});client['Request']=function(_0x2acb60,_0x24a200){return new BPromise(function(_0x2754a2,_0x60345){return client[_0x93c4('0x5')](_0x2acb60,_0x24a200)[_0x93c4('0x6')](function(_0x1e5f90){logger[_0x93c4('0x7')](_0x93c4('0x8'),_0x93c4('0x2'),_0x2acb60,_0x24a200,_0x1e5f90);if(_0x1e5f90[_0x93c4('0x9')]){logger['error'](_0x93c4('0x8'),_0x93c4('0x2'),_0x2acb60,_0x1e5f90[_0x93c4('0x9')][_0x93c4('0xa')],_0x24a200);return _0x60345(_0x1e5f90[_0x93c4('0x9')][_0x93c4('0xa')]);}else{return _0x2754a2(_0x1e5f90[_0x93c4('0xb')]);}})[_0x93c4('0xc')](function(_0x58c015){logger['error'](_0x93c4('0x8'),_0x93c4('0x2'),_0x2acb60,_0x58c015,_0x24a200);return _0x60345(_0x58c015);});});};module[_0x93c4('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 7ec0372..3c0f992 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 _0x2b20=['./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','listen','catch','bluebird','./server','./rpc/interval','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x4f255f,_0x3a8ddb){var _0x1bcad9=function(_0x5734cf){while(--_0x5734cf){_0x4f255f['push'](_0x4f255f['shift']());}};_0x1bcad9(++_0x3a8ddb);}(_0x2b20,0xb3));var _0x02b2=function(_0xfcac94,_0x4f2f94){_0xfcac94=_0xfcac94-0x0;var _0xc039c0=_0x2b20[_0xfcac94];return _0xc039c0;};'use strict';var BPromise=require(_0x02b2('0x0'));var server=require(_0x02b2('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0x02b2('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x02b2('0x3'));var mailQueue=require(_0x02b2('0x4'));var faxQueue=require(_0x02b2('0x5'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x02b2('0x6')]()[_0x02b2('0x7')](user[_0x02b2('0x8')]())[_0x02b2('0x7')](realtime[_0x02b2('0x9')]())[_0x02b2('0x7')](interval[_0x02b2('0xa')]())[_0x02b2('0x7')](realtime[_0x02b2('0xb')]())[_0x02b2('0x7')](openchannelQueue[_0x02b2('0xc')]())['then'](realtime[_0x02b2('0xd')]())[_0x02b2('0x7')](chatQueue[_0x02b2('0xe')]())[_0x02b2('0x7')](realtime[_0x02b2('0xf')]())[_0x02b2('0x7')](smsQueue['getSmsQueues']())[_0x02b2('0x7')](realtime[_0x02b2('0x10')]())[_0x02b2('0x7')](mailQueue[_0x02b2('0x11')]())[_0x02b2('0x7')](realtime[_0x02b2('0x12')]())[_0x02b2('0x7')](faxQueue[_0x02b2('0x13')]())[_0x02b2('0x7')](realtime['initFaxQueues']())['then'](whatsappQueue[_0x02b2('0x14')]())[_0x02b2('0x7')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0x02b2('0x15')](realtime)[_0x02b2('0x7')](function(_0x726dc2){return initRealtime();})[_0x02b2('0x7')](function(_0x334584){return setInterval(initRealtime,0x1388);})[_0x02b2('0x16')](function(_0x11149c){console['log'](_0x11149c);});}main(); \ No newline at end of file +var _0xdb1c=['initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xdb1c,0x1c3));var _0xcdb1=function(_0x44c340,_0x575719){_0x44c340=_0x44c340-0x0;var _0x2cd080=_0xdb1c[_0x44c340];return _0x2cd080;};'use strict';var BPromise=require(_0xcdb1('0x0'));var server=require(_0xcdb1('0x1'));var Realtime=require(_0xcdb1('0x2'));var user=require(_0xcdb1('0x3'));var interval=require(_0xcdb1('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xcdb1('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xcdb1('0x6'));var faxQueue=require(_0xcdb1('0x7'));var whatsappQueue=require(_0xcdb1('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xcdb1('0x9')]()[_0xcdb1('0xa')](user[_0xcdb1('0xb')]())[_0xcdb1('0xa')](realtime[_0xcdb1('0xc')]())[_0xcdb1('0xa')](interval[_0xcdb1('0xd')]())['then'](realtime['initIntervals']())[_0xcdb1('0xa')](openchannelQueue[_0xcdb1('0xe')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0xcdb1('0xf')]())[_0xcdb1('0xa')](realtime['initChatQueues']())[_0xcdb1('0xa')](smsQueue[_0xcdb1('0x10')]())[_0xcdb1('0xa')](realtime[_0xcdb1('0x11')]())[_0xcdb1('0xa')](mailQueue[_0xcdb1('0x12')]())[_0xcdb1('0xa')](realtime[_0xcdb1('0x13')]())['then'](faxQueue[_0xcdb1('0x14')]())[_0xcdb1('0xa')](realtime[_0xcdb1('0x15')]())['then'](whatsappQueue[_0xcdb1('0x16')]())['then'](realtime['initWhatsappQueues']())[_0xcdb1('0xa')](function(){return realtime;});}function main(){return server[_0xcdb1('0x17')](realtime)[_0xcdb1('0xa')](function(_0x5d46fb){return initRealtime();})[_0xcdb1('0xa')](function(_0x363b06){return setInterval(initRealtime,0x1388);})[_0xcdb1('0x18')](function(_0x47c9f3){console[_0xcdb1('0x19')](_0x47c9f3);});}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 154c3cc..ec77271 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0xe8bbbd,_0x139580){var _0x27d7c4=function(_0xcb94c2){while(--_0xcb94c2){_0xe8bbbd['push'](_0xe8bbbd['shift']());}};_0x27d7c4(++_0x139580);}(_0xe14b,0x93));var _0xbe14=function(_0x496368,_0x4e9d49){_0x496368=_0x496368-0x0;var _0x2db3e9=_0xe14b[_0x496368];return _0x2db3e9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x689d0f,_0x5ac6a1){var _0x2ef688=function(_0x2ca052){while(--_0x2ca052){_0x689d0f['push'](_0x689d0f['shift']());}};_0x2ef688(++_0x5ac6a1);}(_0x2ef3,0xba));var _0x32ef=function(_0x32debe,_0x4eda50){_0x32debe=_0x32debe-0x0;var _0x2884f=_0x2ef3[_0x32debe];return _0x2884f;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 9274c81..084523c 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 _0x3cdb=['jayson/promise','request','error','SendMail'];(function(_0x3fd9cc,_0x57816b){var _0x53e052=function(_0x5288f8){while(--_0x5288f8){_0x3fd9cc['push'](_0x3fd9cc['shift']());}};_0x53e052(++_0x57816b);}(_0x3cdb,0x90));var _0xb3cd=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x3cdb[_0x38fb8b];return _0x1ec681;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xb3cd('0x0'));var client=jayson['client']['http']({'port':0x232b});function request(_0x43a218,_0x369514){return new BPromise(function(_0xcd5855,_0x2c2c38){return client[_0xb3cd('0x1')](_0x43a218,_0x369514)['then'](function(_0x1c9b53){if(_0x1c9b53['error']){return _0x2c2c38(_0x1c9b53[_0xb3cd('0x2')]['message']);}else{return _0xcd5855(_0x1c9b53['result']);}})['catch'](function(_0x3d140b){return _0x2c2c38(_0x3d140b);});});}exports['sendMailMessage']=function(_0x309612,_0x5b249f){return request(_0xb3cd('0x3'),{'account':_0x309612,'message':_0x5b249f});}; \ No newline at end of file +var _0x5033=['request','then','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x58791f,_0x368df3){var _0x1255d6=function(_0x1bc5cf){while(--_0x1bc5cf){_0x58791f['push'](_0x58791f['shift']());}};_0x1255d6(++_0x368df3);}(_0x5033,0x114));var _0x3503=function(_0x235166,_0x1fd0f0){_0x235166=_0x235166-0x0;var _0x3b8c4c=_0x5033[_0x235166];return _0x3b8c4c;};'use strict';var BPromise=require(_0x3503('0x0'));var jayson=require(_0x3503('0x1'));var client=jayson[_0x3503('0x2')][_0x3503('0x3')]({'port':0x232b});function request(_0xba81f1,_0x4ac28c){return new BPromise(function(_0x1b8042,_0xdac69){return client[_0x3503('0x4')](_0xba81f1,_0x4ac28c)[_0x3503('0x5')](function(_0x538003){if(_0x538003['error']){return _0xdac69(_0x538003[_0x3503('0x6')]['message']);}else{return _0x1b8042(_0x538003['result']);}})[_0x3503('0x7')](function(_0x1983d2){return _0xdac69(_0x1983d2);});});}exports[_0x3503('0x8')]=function(_0x2bca8b,_0x3cece1){return request(_0x3503('0x9'),{'account':_0x2bca8b,'message':_0x3cece1});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 440a2cb..bb984e7 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 _0xa1cc=['mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','maxcapacity','working','idle','chat','fax','sms','whatsapp','Status','StatusTime','toNumber','format','mailStatus','openchannelCurrentCapacity','stringify','emit','user:save','exports','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','name','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','unknown','mailStatusTime'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xa1cc,0x10f));var _0xca1c=function(_0xcd0a2f,_0x2a92bb){_0xcd0a2f=_0xcd0a2f-0x0;var _0x411678=_0xa1cc[_0xcd0a2f];return _0x411678;};'use strict';var _=require(_0xca1c('0x0'));var moment=require(_0xca1c('0x1'));var md5=require(_0xca1c('0x2'));var Redis=require('ioredis');var config=require(_0xca1c('0x3'));config[_0xca1c('0x4')]=_[_0xca1c('0x5')](config['redis'],{'host':_0xca1c('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xca1c('0x4')]));function Agent(_0x154688){this['id']=_0x154688['id']||0x0;this[_0xca1c('0x7')]=_0x154688[_0xca1c('0x7')]||'';this['online']=_0x154688['online']||!![];this[_0xca1c('0x8')]=_0x154688[_0xca1c('0x8')]||![];this[_0xca1c('0x9')]=_0x154688['chatPause']||![];this['mailPause']=_0x154688['mailPause']||![];this[_0xca1c('0xa')]=_0x154688['faxPause']||![];this[_0xca1c('0xb')]=_0x154688[_0xca1c('0xb')]||![];this[_0xca1c('0xc')]=_0x154688[_0xca1c('0xc')]||![];this[_0xca1c('0xd')]='unknown';this[_0xca1c('0xe')]=0x0;this[_0xca1c('0xf')]=_0x154688['chatCapacity']||0x0;this[_0xca1c('0x10')]=0x0;this['mailStatus']=_0xca1c('0x11');this[_0xca1c('0x12')]=0x0;this[_0xca1c('0x13')]=_0x154688['mailCapacity']||0x0;this[_0xca1c('0x14')]=0x0;this[_0xca1c('0x15')]='unknown';this['faxStatusTime']=0x0;this[_0xca1c('0x16')]=_0x154688[_0xca1c('0x16')]||0x0;this[_0xca1c('0x17')]=0x0;this[_0xca1c('0x18')]=_0xca1c('0x11');this[_0xca1c('0x19')]=0x0;this[_0xca1c('0x1a')]=_0x154688[_0xca1c('0x1a')]||0x0;this[_0xca1c('0x1b')]=0x0;this[_0xca1c('0x1c')]=_0xca1c('0x11');this[_0xca1c('0x1d')]=0x0;this[_0xca1c('0x1e')]=_0x154688[_0xca1c('0x1e')]||0x0;this[_0xca1c('0x1f')]=0x0;this[_0xca1c('0x20')]='unknown';this[_0xca1c('0x21')]=0x0;this[_0xca1c('0x22')]=_0x154688['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xca1c('0x23')]=![];this[_0xca1c('0x24')]=undefined;this[_0xca1c('0x2')]='';this[_0xca1c('0x25')]();}Agent[_0xca1c('0x26')][_0xca1c('0x27')]=function(_0x9c75a4){if(this[_0x9c75a4+'CurrentCapacity']>0x0){if(this[_0x9c75a4+_0xca1c('0x28')]>0x0&&this[_0x9c75a4+'CurrentCapacity']>=this[_0x9c75a4+_0xca1c('0x28')]){return _0xca1c('0x29');}else{return _0xca1c('0x2a');}}else{return _0xca1c('0x2b');}};Agent['prototype'][_0xca1c('0x25')]=function(){var _0x76af08=['mail',_0xca1c('0x2c'),'openchannel',_0xca1c('0x2d'),_0xca1c('0x2e'),_0xca1c('0x2f')];for(var _0x77ea99=0x0;_0x77ea99<_0x76af08['length'];_0x77ea99+=0x1){var _0x1c3056=this[_0xca1c('0x27')](_0x76af08[_0x77ea99]);if(this[_0x76af08[_0x77ea99]+_0xca1c('0x30')]!==_0x1c3056){this[_0x76af08[_0x77ea99]+_0xca1c('0x31')]=_[_0xca1c('0x32')](moment()[_0xca1c('0x33')]('x'));}this[_0x76af08[_0x77ea99]+_0xca1c('0x30')]=_0x1c3056;}var _0x5e6c61={'id':this['id'],'name':this[_0xca1c('0x7')],'online':this['online'],'voicePause':this[_0xca1c('0x8')],'chatPause':this[_0xca1c('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0xca1c('0xb')],'faxPause':this[_0xca1c('0xa')],'openchannelPause':this[_0xca1c('0xc')],'chatStatus':this[_0xca1c('0xd')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xca1c('0xf')],'chatCurrentCapacity':this[_0xca1c('0x10')],'mailStatus':this[_0xca1c('0x34')],'mailStatusTime':this[_0xca1c('0x12')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xca1c('0x14')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xca1c('0x16')],'faxCurrentCapacity':this[_0xca1c('0x17')],'smsStatus':this[_0xca1c('0x18')],'smsStatusTime':this[_0xca1c('0x19')],'smsCapacity':this[_0xca1c('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xca1c('0x1d')],'whatsappCapacity':this[_0xca1c('0x1e')],'whatsappCurrentCapacity':this[_0xca1c('0x1f')],'openchannelStatus':this[_0xca1c('0x20')],'openchannelStatusTime':this[_0xca1c('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xca1c('0x35')],'busy':this['busy'],'busyQueue':this[_0xca1c('0x24')]};var _0x4737bf=md5(JSON[_0xca1c('0x36')](_0x5e6c61));if(this[_0xca1c('0x2')]!==_0x4737bf){this['md5']=_0x4737bf;io[_0xca1c('0x37')](_0xca1c('0x38'),_0x5e6c61);}};module[_0xca1c('0x39')]=Agent; \ No newline at end of file +var _0xaee2=['Capacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','length','Status','toNumber','format','chatCurrentCapacity','mailStatus','faxStatusTime','openchannelStatusTime','busyQueue','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity'];(function(_0x21e2d3,_0x275162){var _0x721e80=function(_0x25543d){while(--_0x25543d){_0x21e2d3['push'](_0x21e2d3['shift']());}};_0x721e80(++_0x275162);}(_0xaee2,0x150));var _0x2aee=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0xaee2[_0x515afd];return _0x536d53;};'use strict';var _=require(_0x2aee('0x0'));var moment=require(_0x2aee('0x1'));var md5=require(_0x2aee('0x2'));var Redis=require(_0x2aee('0x3'));var config=require(_0x2aee('0x4'));config[_0x2aee('0x5')]=_[_0x2aee('0x6')](config[_0x2aee('0x5')],{'host':_0x2aee('0x7'),'port':0x18eb});var io=require(_0x2aee('0x8'))(new Redis(config[_0x2aee('0x5')]));function Agent(_0x2ba8fe){this['id']=_0x2ba8fe['id']||0x0;this[_0x2aee('0x9')]=_0x2ba8fe[_0x2aee('0x9')]||'';this[_0x2aee('0xa')]=_0x2ba8fe[_0x2aee('0xa')]||!![];this['voicePause']=_0x2ba8fe[_0x2aee('0xb')]||![];this['chatPause']=_0x2ba8fe[_0x2aee('0xc')]||![];this['mailPause']=_0x2ba8fe[_0x2aee('0xd')]||![];this[_0x2aee('0xe')]=_0x2ba8fe[_0x2aee('0xe')]||![];this[_0x2aee('0xf')]=_0x2ba8fe[_0x2aee('0xf')]||![];this[_0x2aee('0x10')]=_0x2ba8fe['openchannelPause']||![];this[_0x2aee('0x11')]=_0x2aee('0x12');this[_0x2aee('0x13')]=0x0;this['chatCapacity']=_0x2ba8fe[_0x2aee('0x14')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x2aee('0x12');this[_0x2aee('0x15')]=0x0;this['mailCapacity']=_0x2ba8fe[_0x2aee('0x16')]||0x0;this[_0x2aee('0x17')]=0x0;this[_0x2aee('0x18')]=_0x2aee('0x12');this['faxStatusTime']=0x0;this[_0x2aee('0x19')]=_0x2ba8fe[_0x2aee('0x19')]||0x0;this[_0x2aee('0x1a')]=0x0;this[_0x2aee('0x1b')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0x2ba8fe[_0x2aee('0x1c')]||0x0;this[_0x2aee('0x1d')]=0x0;this[_0x2aee('0x1e')]=_0x2aee('0x12');this[_0x2aee('0x1f')]=0x0;this[_0x2aee('0x20')]=_0x2ba8fe[_0x2aee('0x20')]||0x0;this[_0x2aee('0x21')]=0x0;this[_0x2aee('0x22')]=_0x2aee('0x12');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x2ba8fe[_0x2aee('0x23')]||0x0;this[_0x2aee('0x24')]=0x0;this[_0x2aee('0x25')]=![];this['busyQueue']=undefined;this[_0x2aee('0x2')]='';this[_0x2aee('0x26')]();}Agent[_0x2aee('0x27')][_0x2aee('0x28')]=function(_0x11afb0){if(this[_0x11afb0+_0x2aee('0x29')]>0x0){if(this[_0x11afb0+'Capacity']>0x0&&this[_0x11afb0+'CurrentCapacity']>=this[_0x11afb0+_0x2aee('0x2a')]){return _0x2aee('0x2b');}else{return'working';}}else{return _0x2aee('0x2c');}};Agent[_0x2aee('0x27')]['updateRealtime']=function(){var _0x366200=[_0x2aee('0x2d'),_0x2aee('0x2e'),_0x2aee('0x2f'),_0x2aee('0x30'),_0x2aee('0x31'),'whatsapp'];for(var _0x137d55=0x0;_0x137d55<_0x366200[_0x2aee('0x32')];_0x137d55+=0x1){var _0x28569e=this[_0x2aee('0x28')](_0x366200[_0x137d55]);if(this[_0x366200[_0x137d55]+_0x2aee('0x33')]!==_0x28569e){this[_0x366200[_0x137d55]+'StatusTime']=_[_0x2aee('0x34')](moment()[_0x2aee('0x35')]('x'));}this[_0x366200[_0x137d55]+_0x2aee('0x33')]=_0x28569e;}var _0x512f6e={'id':this['id'],'name':this[_0x2aee('0x9')],'online':this['online'],'voicePause':this[_0x2aee('0xb')],'chatPause':this[_0x2aee('0xc')],'mailPause':this[_0x2aee('0xd')],'smsPause':this[_0x2aee('0xf')],'faxPause':this[_0x2aee('0xe')],'openchannelPause':this[_0x2aee('0x10')],'chatStatus':this[_0x2aee('0x11')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x2aee('0x14')],'chatCurrentCapacity':this[_0x2aee('0x36')],'mailStatus':this[_0x2aee('0x37')],'mailStatusTime':this[_0x2aee('0x15')],'mailCapacity':this[_0x2aee('0x16')],'mailCurrentCapacity':this[_0x2aee('0x17')],'faxStatus':this[_0x2aee('0x18')],'faxStatusTime':this[_0x2aee('0x38')],'faxCapacity':this[_0x2aee('0x19')],'faxCurrentCapacity':this[_0x2aee('0x1a')],'smsStatus':this[_0x2aee('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x2aee('0x1c')],'smsCurrentCapacity':this[_0x2aee('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x2aee('0x21')],'openchannelStatus':this[_0x2aee('0x22')],'openchannelStatusTime':this[_0x2aee('0x39')],'openchannelCapacity':this[_0x2aee('0x23')],'openchannelCurrentCapacity':this[_0x2aee('0x24')],'busy':this[_0x2aee('0x25')],'busyQueue':this[_0x2aee('0x3a')]};var _0x1fe4a1=md5(JSON[_0x2aee('0x3b')](_0x512f6e));if(this[_0x2aee('0x2')]!==_0x1fe4a1){this['md5']=_0x1fe4a1;io[_0x2aee('0x3c')](_0x2aee('0x3d'),_0x512f6e);}};module[_0x2aee('0x3e')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index fe27e92..06d684e 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 _0x1f46=['lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','chatPause','available','waiting','stringify','emit','chat_queue:save','exports'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x1f46,0x87));var _0x61f4=function(_0x863034,_0x52ff11){_0x863034=_0x863034-0x0;var _0x134ac9=_0x1f46[_0x863034];return _0x134ac9;};'use strict';var _=require(_0x61f4('0x0'));var md5=require('md5');var util=require(_0x61f4('0x1'));var Redis=require(_0x61f4('0x2'));var config=require(_0x61f4('0x3'));config[_0x61f4('0x4')]=_['defaults'](config[_0x61f4('0x4')],{'host':_0x61f4('0x5'),'port':0x18eb});var io=require(_0x61f4('0x6'))(new Redis(config[_0x61f4('0x4')]));function ChatQueue(_0x1e1834){this['id']=_0x1e1834['id']||0x0;this['name']=_0x1e1834[_0x61f4('0x7')]||'';this[_0x61f4('0x8')]=_0x1e1834[_0x61f4('0x8')]||0xa;this['strategy']=_0x1e1834[_0x61f4('0x9')]||'beepall';this[_0x61f4('0xa')]=_0x1e1834[_0x61f4('0xa')];this[_0x61f4('0xb')]={};this['waiting']=0x0;this[_0x61f4('0xc')]='';this[_0x61f4('0xd')]();this[_0x61f4('0xe')]();}ChatQueue[_0x61f4('0xf')][_0x61f4('0xd')]=function(){var _0x1d0cd2=this['mapAgentsId'][_0x61f4('0x10')];this[_0x61f4('0xb')]=_['map'](this[_0x61f4('0xa')],'id');this['mapAgentsId']['_rr']=_0x1d0cd2;};ChatQueue[_0x61f4('0xf')]['updateRealtime']=function(){this[_0x61f4('0x11')]=0x0;this[_0x61f4('0x12')]=0x0;for(var _0x3bd97c=0x0;_0x3bd97c=0x0?this[_0x61f4('0x15')]:0x0;var _0x392b2a={'id':this['id'],'available':this[_0x61f4('0x15')],'loggedIn':this[_0x61f4('0x11')],'name':this[_0x61f4('0x7')],'paused':this[_0x61f4('0x12')],'waiting':this[_0x61f4('0x16')]};var _0x5d8a2b=md5(JSON[_0x61f4('0x17')](_0x392b2a));if(this['md5']!==_0x5d8a2b){this[_0x61f4('0xc')]=_0x5d8a2b;io['to'](util['format']('chat:queue:%s',_0x392b2a[_0x61f4('0x7')]))[_0x61f4('0x18')](_0x61f4('0x19'),_0x392b2a);}};module[_0x61f4('0x1a')]=ChatQueue; \ No newline at end of file +var _0x9aab=['chatPause','available','format','chat:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','Agents','paused','length','online','loggedIn'];(function(_0x3a7de4,_0x27e805){var _0x30d249=function(_0x412330){while(--_0x412330){_0x3a7de4['push'](_0x3a7de4['shift']());}};_0x30d249(++_0x27e805);}(_0x9aab,0x1d0));var _0xb9aa=function(_0x10feb6,_0x3118d2){_0x10feb6=_0x10feb6-0x0;var _0x1f934b=_0x9aab[_0x10feb6];return _0x1f934b;};'use strict';var _=require(_0xb9aa('0x0'));var md5=require(_0xb9aa('0x1'));var util=require(_0xb9aa('0x2'));var Redis=require(_0xb9aa('0x3'));var config=require(_0xb9aa('0x4'));config['redis']=_[_0xb9aa('0x5')](config[_0xb9aa('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb9aa('0x7'))(new Redis(config['redis']));function ChatQueue(_0x3a0320){this['id']=_0x3a0320['id']||0x0;this[_0xb9aa('0x8')]=_0x3a0320[_0xb9aa('0x8')]||'';this[_0xb9aa('0x9')]=_0x3a0320[_0xb9aa('0x9')]||0xa;this[_0xb9aa('0xa')]=_0x3a0320['strategy']||_0xb9aa('0xb');this['Agents']=_0x3a0320['Agents'];this['mapAgentsId']={};this[_0xb9aa('0xc')]=0x0;this[_0xb9aa('0x1')]='';this[_0xb9aa('0xd')]();this[_0xb9aa('0xe')]();}ChatQueue['prototype'][_0xb9aa('0xd')]=function(){var _0x40c800=this['mapAgentsId'][_0xb9aa('0xf')];this[_0xb9aa('0x10')]=_['map'](this[_0xb9aa('0x11')],'id');this[_0xb9aa('0x10')][_0xb9aa('0xf')]=_0x40c800;};ChatQueue['prototype'][_0xb9aa('0xe')]=function(){this['loggedIn']=0x0;this[_0xb9aa('0x12')]=0x0;for(var _0x3eeaca=0x0;_0x3eeaca=0x0?this[_0xb9aa('0x17')]:0x0;var _0x5a796c={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb9aa('0x15')],'name':this[_0xb9aa('0x8')],'paused':this[_0xb9aa('0x12')],'waiting':this[_0xb9aa('0xc')]};var _0x11077e=md5(JSON['stringify'](_0x5a796c));if(this['md5']!==_0x11077e){this[_0xb9aa('0x1')]=_0x11077e;io['to'](util[_0xb9aa('0x18')](_0xb9aa('0x19'),_0x5a796c[_0xb9aa('0x8')]))[_0xb9aa('0x1a')]('chat_queue:save',_0x5a796c);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index bd1ab76..ece751f 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 _0xf282=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','paused','length','online','loggedIn','faxPause','available','waiting','fax:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf282,0x1f3));var _0x2f28=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xf282[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x2f28('0x0'));var md5=require(_0x2f28('0x1'));var util=require(_0x2f28('0x2'));var Redis=require(_0x2f28('0x3'));var config=require(_0x2f28('0x4'));config[_0x2f28('0x5')]=_[_0x2f28('0x6')](config[_0x2f28('0x5')],{'host':_0x2f28('0x7'),'port':0x18eb});var io=require(_0x2f28('0x8'))(new Redis(config['redis']));function FaxQueue(_0x3bd74d){this['id']=_0x3bd74d['id']||0x0;this[_0x2f28('0x9')]=_0x3bd74d['name']||'';this[_0x2f28('0xa')]=_0x3bd74d[_0x2f28('0xa')]||0xa;this[_0x2f28('0xb')]=_0x3bd74d[_0x2f28('0xb')]||'beepall';this[_0x2f28('0xc')]=_0x3bd74d[_0x2f28('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x2f28('0x1')]='';this[_0x2f28('0xd')]();this[_0x2f28('0xe')]();}FaxQueue[_0x2f28('0xf')][_0x2f28('0xd')]=function(){var _0x3e0c10=this[_0x2f28('0x10')][_0x2f28('0x11')];this[_0x2f28('0x10')]=_['map'](this[_0x2f28('0xc')],'id');this[_0x2f28('0x10')][_0x2f28('0x11')]=_0x3e0c10;};FaxQueue[_0x2f28('0xf')][_0x2f28('0xe')]=function(){this['loggedIn']=0x0;this[_0x2f28('0x12')]=0x0;for(var _0x1622d6=0x0;_0x1622d6=0x0?this[_0x2f28('0x17')]:0x0;var _0x3db8a0={'id':this['id'],'available':this[_0x2f28('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x2f28('0x9')],'paused':this[_0x2f28('0x12')],'waiting':this[_0x2f28('0x18')]};var _0x3d9425=md5(JSON['stringify'](_0x3db8a0));if(this['md5']!==_0x3d9425){this[_0x2f28('0x1')]=_0x3d9425;io['to'](util['format'](_0x2f28('0x19'),_0x3db8a0['name']))[_0x2f28('0x1a')]('fax_queue:save',_0x3db8a0);}};module[_0x2f28('0x1b')]=FaxQueue; \ No newline at end of file +var _0x2cd9=['map','prototype','length','online','faxPause','paused','available','stringify','format','fax:queue:%s','emit','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x2cd9,0x1bb));var _0x92cd=function(_0x18db20,_0x251658){_0x18db20=_0x18db20-0x0;var _0x3842c3=_0x2cd9[_0x18db20];return _0x3842c3;};'use strict';var _=require('lodash');var md5=require(_0x92cd('0x0'));var util=require('util');var Redis=require(_0x92cd('0x1'));var config=require(_0x92cd('0x2'));config[_0x92cd('0x3')]=_[_0x92cd('0x4')](config[_0x92cd('0x3')],{'host':_0x92cd('0x5'),'port':0x18eb});var io=require(_0x92cd('0x6'))(new Redis(config[_0x92cd('0x3')]));function FaxQueue(_0x18cd17){this['id']=_0x18cd17['id']||0x0;this[_0x92cd('0x7')]=_0x18cd17[_0x92cd('0x7')]||'';this['timeout']=_0x18cd17['timeout']||0xa;this[_0x92cd('0x8')]=_0x18cd17[_0x92cd('0x8')]||_0x92cd('0x9');this[_0x92cd('0xa')]=_0x18cd17['Agents'];this[_0x92cd('0xb')]={};this[_0x92cd('0xc')]=0x0;this[_0x92cd('0x0')]='';this[_0x92cd('0xd')]();this[_0x92cd('0xe')]();}FaxQueue['prototype'][_0x92cd('0xd')]=function(){var _0x1c5e6a=this[_0x92cd('0xb')][_0x92cd('0xf')];this['mapAgentsId']=_[_0x92cd('0x10')](this[_0x92cd('0xa')],'id');this[_0x92cd('0xb')][_0x92cd('0xf')]=_0x1c5e6a;};FaxQueue[_0x92cd('0x11')][_0x92cd('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5965ea=0x0;_0x5965ea=0x0?this[_0x92cd('0x16')]:0x0;var _0x348f3e={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x92cd('0x15')],'waiting':this[_0x92cd('0xc')]};var _0x83e4e4=md5(JSON[_0x92cd('0x17')](_0x348f3e));if(this[_0x92cd('0x0')]!==_0x83e4e4){this[_0x92cd('0x0')]=_0x83e4e4;io['to'](util[_0x92cd('0x18')](_0x92cd('0x19'),_0x348f3e['name']))[_0x92cd('0x1a')]('fax_queue:save',_0x348f3e);}};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 b91ee8f..79eb039 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 _0xf9a7=['name','Intervals','exports'];(function(_0x219bb3,_0x402a86){var _0x499e9a=function(_0x31003d){while(--_0x31003d){_0x219bb3['push'](_0x219bb3['shift']());}};_0x499e9a(++_0x402a86);}(_0xf9a7,0xf6));var _0x7f9a=function(_0x627ea4,_0x18611e){_0x627ea4=_0x627ea4-0x0;var _0x65369b=_0xf9a7[_0x627ea4];return _0x65369b;};'use strict';function Interval(_0x51a507){this['id']=_0x51a507['id']||0x0;this[_0x7f9a('0x0')]=_0x51a507[_0x7f9a('0x0')]||'';this['Intervals']=_0x51a507[_0x7f9a('0x1')]||{};}module[_0x7f9a('0x2')]=Interval; \ No newline at end of file +var _0xd887=['name','Intervals'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xd887,0xb4));var _0x7d88=function(_0x55c947,_0x5e20a8){_0x55c947=_0x55c947-0x0;var _0x2556b3=_0xd887[_0x55c947];return _0x2556b3;};'use strict';function Interval(_0x845f2c){this['id']=_0x845f2c['id']||0x0;this['name']=_0x845f2c[_0x7d88('0x0')]||'';this[_0x7d88('0x1')]=_0x845f2c[_0x7d88('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index bf5c248..522fb48 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 _0x12f4=['prototype','map','updateRealtime','loggedIn','paused','length','online','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0x12f4,0x130));var _0x412f=function(_0x34875f,_0x5a5cce){_0x34875f=_0x34875f-0x0;var _0x1c0494=_0x12f4[_0x34875f];return _0x1c0494;};'use strict';var _=require(_0x412f('0x0'));var md5=require(_0x412f('0x1'));var util=require(_0x412f('0x2'));var Redis=require(_0x412f('0x3'));var config=require(_0x412f('0x4'));config['redis']=_[_0x412f('0x5')](config['redis'],{'host':_0x412f('0x6'),'port':0x18eb});var io=require(_0x412f('0x7'))(new Redis(config['redis']));function MailQueue(_0x3ac3eb){this['id']=_0x3ac3eb['id']||0x0;this[_0x412f('0x8')]=_0x3ac3eb[_0x412f('0x8')]||'';this['timeout']=_0x3ac3eb[_0x412f('0x9')]||0xa;this['strategy']=_0x3ac3eb[_0x412f('0xa')]||'beepall';this[_0x412f('0xb')]=_0x3ac3eb[_0x412f('0xb')];this[_0x412f('0xc')]={};this[_0x412f('0xd')]=0x0;this[_0x412f('0x1')]='';this[_0x412f('0xe')]();this['updateRealtime']();}MailQueue[_0x412f('0xf')][_0x412f('0xe')]=function(){var _0x19ae87=this[_0x412f('0xc')]['_rr'];this[_0x412f('0xc')]=_[_0x412f('0x10')](this['Agents'],'id');this[_0x412f('0xc')]['_rr']=_0x19ae87;};MailQueue[_0x412f('0xf')][_0x412f('0x11')]=function(){this[_0x412f('0x12')]=0x0;this[_0x412f('0x13')]=0x0;for(var _0xcb3996=0x0;_0xcb3996=0x0?this[_0x412f('0x17')]:0x0;var _0x265535={'id':this['id'],'available':this[_0x412f('0x17')],'loggedIn':this[_0x412f('0x12')],'name':this[_0x412f('0x8')],'paused':this[_0x412f('0x13')],'waiting':this[_0x412f('0xd')]};var _0x301da7=md5(JSON['stringify'](_0x265535));if(this[_0x412f('0x1')]!==_0x301da7){this[_0x412f('0x1')]=_0x301da7;io['to'](util[_0x412f('0x18')](_0x412f('0x19'),_0x265535[_0x412f('0x8')]))[_0x412f('0x1a')](_0x412f('0x1b'),_0x265535);}};module[_0x412f('0x1c')]=MailQueue; \ No newline at end of file +var _0x2014=['mapAgentsId','waiting','md5','updateRouting','prototype','map','_rr','loggedIn','paused','length','mailPause','available','stringify','format','emit','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x5c9325,_0x130246){var _0x3b3cc4=function(_0x18f804){while(--_0x18f804){_0x5c9325['push'](_0x5c9325['shift']());}};_0x3b3cc4(++_0x130246);}(_0x2014,0x160));var _0x4201=function(_0x5a6e3c,_0x58411b){_0x5a6e3c=_0x5a6e3c-0x0;var _0x593268=_0x2014[_0x5a6e3c];return _0x593268;};'use strict';var _=require(_0x4201('0x0'));var md5=require('md5');var util=require(_0x4201('0x1'));var Redis=require('ioredis');var config=require(_0x4201('0x2'));config[_0x4201('0x3')]=_[_0x4201('0x4')](config[_0x4201('0x3')],{'host':_0x4201('0x5'),'port':0x18eb});var io=require(_0x4201('0x6'))(new Redis(config[_0x4201('0x3')]));function MailQueue(_0x5884d3){this['id']=_0x5884d3['id']||0x0;this[_0x4201('0x7')]=_0x5884d3[_0x4201('0x7')]||'';this[_0x4201('0x8')]=_0x5884d3[_0x4201('0x8')]||0xa;this['strategy']=_0x5884d3[_0x4201('0x9')]||_0x4201('0xa');this[_0x4201('0xb')]=_0x5884d3[_0x4201('0xb')];this[_0x4201('0xc')]={};this[_0x4201('0xd')]=0x0;this[_0x4201('0xe')]='';this[_0x4201('0xf')]();this['updateRealtime']();}MailQueue[_0x4201('0x10')][_0x4201('0xf')]=function(){var _0x2cb327=this['mapAgentsId']['_rr'];this[_0x4201('0xc')]=_[_0x4201('0x11')](this[_0x4201('0xb')],'id');this[_0x4201('0xc')][_0x4201('0x12')]=_0x2cb327;};MailQueue[_0x4201('0x10')]['updateRealtime']=function(){this[_0x4201('0x13')]=0x0;this[_0x4201('0x14')]=0x0;for(var _0x436d26=0x0;_0x436d26=0x0?this[_0x4201('0x17')]:0x0;var _0x566e75={'id':this['id'],'available':this[_0x4201('0x17')],'loggedIn':this[_0x4201('0x13')],'name':this[_0x4201('0x7')],'paused':this[_0x4201('0x14')],'waiting':this[_0x4201('0xd')]};var _0x12f917=md5(JSON[_0x4201('0x18')](_0x566e75));if(this[_0x4201('0xe')]!==_0x12f917){this[_0x4201('0xe')]=_0x12f917;io['to'](util[_0x4201('0x19')]('mail:queue:%s',_0x566e75[_0x4201('0x7')]))[_0x4201('0x1a')]('mail_queue:save',_0x566e75);}};module[_0x4201('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e14a270..8481ba6 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x326f,0xd1));var _0xf326=function(_0x2270d2,_0x5ccf15){_0x2270d2=_0x2270d2-0x0;var _0x185d83=_0x326f[_0x2270d2];return _0x185d83;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};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 fd252db..a3eeaac 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 _0xac95=['lodash','md5','util','ioredis','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','paused','length','online','loggedIn','smsPause','available','stringify','format','emit','sms_queue:save','exports'];(function(_0x2a5ee5,_0x5cbfd2){var _0x36ec33=function(_0x64917f){while(--_0x64917f){_0x2a5ee5['push'](_0x2a5ee5['shift']());}};_0x36ec33(++_0x5cbfd2);}(_0xac95,0xa8));var _0x5ac9=function(_0x625135,_0x3aa0e8){_0x625135=_0x625135-0x0;var _0x5ddf37=_0xac95[_0x625135];return _0x5ddf37;};'use strict';var _=require(_0x5ac9('0x0'));var md5=require(_0x5ac9('0x1'));var util=require(_0x5ac9('0x2'));var Redis=require(_0x5ac9('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x5ac9('0x4')](config[_0x5ac9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x5ac9('0x6'))(new Redis(config[_0x5ac9('0x5')]));function SmsQueue(_0x5b445a){this['id']=_0x5b445a['id']||0x0;this[_0x5ac9('0x7')]=_0x5b445a[_0x5ac9('0x7')]||'';this[_0x5ac9('0x8')]=_0x5b445a['timeout']||0xa;this['strategy']=_0x5b445a[_0x5ac9('0x9')]||_0x5ac9('0xa');this[_0x5ac9('0xb')]=_0x5b445a[_0x5ac9('0xb')];this[_0x5ac9('0xc')]={};this[_0x5ac9('0xd')]=0x0;this['md5']='';this[_0x5ac9('0xe')]();this[_0x5ac9('0xf')]();}SmsQueue['prototype'][_0x5ac9('0xe')]=function(){var _0x4968d6=this[_0x5ac9('0xc')]['_rr'];this[_0x5ac9('0xc')]=_[_0x5ac9('0x10')](this[_0x5ac9('0xb')],'id');this[_0x5ac9('0xc')]['_rr']=_0x4968d6;};SmsQueue['prototype'][_0x5ac9('0xf')]=function(){this['loggedIn']=0x0;this[_0x5ac9('0x11')]=0x0;for(var _0x364007=0x0;_0x364007=0x0?this[_0x5ac9('0x16')]:0x0;var _0x102c85={'id':this['id'],'available':this[_0x5ac9('0x16')],'loggedIn':this[_0x5ac9('0x14')],'name':this[_0x5ac9('0x7')],'paused':this[_0x5ac9('0x11')],'waiting':this[_0x5ac9('0xd')]};var _0x293e4e=md5(JSON[_0x5ac9('0x17')](_0x102c85));if(this[_0x5ac9('0x1')]!==_0x293e4e){this[_0x5ac9('0x1')]=_0x293e4e;io['to'](util[_0x5ac9('0x18')]('sms:queue:%s',_0x102c85[_0x5ac9('0x7')]))[_0x5ac9('0x19')](_0x5ac9('0x1a'),_0x102c85);}};module[_0x5ac9('0x1b')]=SmsQueue; \ No newline at end of file +var _0x0269=['util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','smsPause','available','paused','md5','format','sms:queue:%s','emit','sms_queue:save','exports','lodash'];(function(_0x2d802a,_0x24bcdf){var _0x63eab1=function(_0xb05a5e){while(--_0xb05a5e){_0x2d802a['push'](_0x2d802a['shift']());}};_0x63eab1(++_0x24bcdf);}(_0x0269,0x135));var _0x9026=function(_0x49b0c8,_0x347dab){_0x49b0c8=_0x49b0c8-0x0;var _0xd7c202=_0x0269[_0x49b0c8];return _0xd7c202;};'use strict';var _=require(_0x9026('0x0'));var md5=require('md5');var util=require(_0x9026('0x1'));var Redis=require('ioredis');var config=require(_0x9026('0x2'));config['redis']=_[_0x9026('0x3')](config[_0x9026('0x4')],{'host':_0x9026('0x5'),'port':0x18eb});var io=require(_0x9026('0x6'))(new Redis(config['redis']));function SmsQueue(_0x314458){this['id']=_0x314458['id']||0x0;this[_0x9026('0x7')]=_0x314458['name']||'';this['timeout']=_0x314458[_0x9026('0x8')]||0xa;this[_0x9026('0x9')]=_0x314458[_0x9026('0x9')]||_0x9026('0xa');this['Agents']=_0x314458[_0x9026('0xb')];this[_0x9026('0xc')]={};this[_0x9026('0xd')]=0x0;this['md5']='';this[_0x9026('0xe')]();this[_0x9026('0xf')]();}SmsQueue[_0x9026('0x10')]['updateRouting']=function(){var _0x2c1dd2=this['mapAgentsId'][_0x9026('0x11')];this[_0x9026('0xc')]=_[_0x9026('0x12')](this[_0x9026('0xb')],'id');this[_0x9026('0xc')][_0x9026('0x11')]=_0x2c1dd2;};SmsQueue[_0x9026('0x10')]['updateRealtime']=function(){this[_0x9026('0x13')]=0x0;this['paused']=0x0;for(var _0x385afc=0x0;_0x385afc=0x0?this[_0x9026('0x17')]:0x0;var _0x4e37d0={'id':this['id'],'available':this[_0x9026('0x17')],'loggedIn':this[_0x9026('0x13')],'name':this[_0x9026('0x7')],'paused':this[_0x9026('0x18')],'waiting':this['waiting']};var _0x7985=md5(JSON['stringify'](_0x4e37d0));if(this[_0x9026('0x19')]!==_0x7985){this['md5']=_0x7985;io['to'](util[_0x9026('0x1a')](_0x9026('0x1b'),_0x4e37d0[_0x9026('0x7')]))[_0x9026('0x1c')](_0x9026('0x1d'),_0x4e37d0);}};module[_0x9026('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index ce05297..58d593d 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 _0x675e=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','paused','online','whatsappPause','available','md5','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util'];(function(_0x195a3b,_0x6e9cf1){var _0x3b915f=function(_0x89f215){while(--_0x89f215){_0x195a3b['push'](_0x195a3b['shift']());}};_0x3b915f(++_0x6e9cf1);}(_0x675e,0x134));var _0xe675=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x675e[_0x49beea];return _0x27693a;};'use strict';var _=require(_0xe675('0x0'));var md5=require('md5');var util=require(_0xe675('0x1'));var Redis=require(_0xe675('0x2'));var config=require(_0xe675('0x3'));config[_0xe675('0x4')]=_[_0xe675('0x5')](config[_0xe675('0x4')],{'host':_0xe675('0x6'),'port':0x18eb});var io=require(_0xe675('0x7'))(new Redis(config[_0xe675('0x4')]));function WhatsappQueue(_0xf89c23){this['id']=_0xf89c23['id']||0x0;this[_0xe675('0x8')]=_0xf89c23[_0xe675('0x8')]||'';this[_0xe675('0x9')]=_0xf89c23[_0xe675('0x9')]||0xa;this[_0xe675('0xa')]=_0xf89c23['strategy']||_0xe675('0xb');this['Agents']=_0xf89c23[_0xe675('0xc')];this['mapAgentsId']={};this[_0xe675('0xd')]=0x0;this['md5']='';this[_0xe675('0xe')]();this[_0xe675('0xf')]();}WhatsappQueue[_0xe675('0x10')]['updateRouting']=function(){var _0x42967a=this['mapAgentsId'][_0xe675('0x11')];this[_0xe675('0x12')]=_[_0xe675('0x13')](this[_0xe675('0xc')],'id');this[_0xe675('0x12')][_0xe675('0x11')]=_0x42967a;};WhatsappQueue[_0xe675('0x10')][_0xe675('0xf')]=function(){this[_0xe675('0x14')]=0x0;this[_0xe675('0x15')]=0x0;for(var _0x16011b=0x0;_0x16011b=0x0?this[_0xe675('0x18')]:0x0;var _0x10cfcd={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe675('0x14')],'name':this[_0xe675('0x8')],'paused':this[_0xe675('0x15')],'waiting':this['waiting']};var _0x2ba804=md5(JSON['stringify'](_0x10cfcd));if(this[_0xe675('0x19')]!==_0x2ba804){this['md5']=_0x2ba804;io['to'](util[_0xe675('0x1a')](_0xe675('0x1b'),_0x10cfcd['name']))[_0xe675('0x1c')](_0xe675('0x1d'),_0x10cfcd);}};module[_0xe675('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x59f0=['whatsappPause','available','loggedIn','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','paused','length','online'];(function(_0x30b3fe,_0x2f5c07){var _0x13bcd4=function(_0xc87597){while(--_0xc87597){_0x30b3fe['push'](_0x30b3fe['shift']());}};_0x13bcd4(++_0x2f5c07);}(_0x59f0,0xbd));var _0x059f=function(_0x271cfd,_0x569a80){_0x271cfd=_0x271cfd-0x0;var _0x39237f=_0x59f0[_0x271cfd];return _0x39237f;};'use strict';var _=require(_0x059f('0x0'));var md5=require(_0x059f('0x1'));var util=require(_0x059f('0x2'));var Redis=require('ioredis');var config=require(_0x059f('0x3'));config[_0x059f('0x4')]=_[_0x059f('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x059f('0x6'))(new Redis(config[_0x059f('0x4')]));function WhatsappQueue(_0x4e8558){this['id']=_0x4e8558['id']||0x0;this[_0x059f('0x7')]=_0x4e8558[_0x059f('0x7')]||'';this['timeout']=_0x4e8558[_0x059f('0x8')]||0xa;this[_0x059f('0x9')]=_0x4e8558['strategy']||'beepall';this[_0x059f('0xa')]=_0x4e8558['Agents'];this['mapAgentsId']={};this[_0x059f('0xb')]=0x0;this[_0x059f('0x1')]='';this[_0x059f('0xc')]();this['updateRealtime']();}WhatsappQueue[_0x059f('0xd')][_0x059f('0xc')]=function(){var _0x306c5c=this[_0x059f('0xe')][_0x059f('0xf')];this['mapAgentsId']=_[_0x059f('0x10')](this[_0x059f('0xa')],'id');this['mapAgentsId'][_0x059f('0xf')]=_0x306c5c;};WhatsappQueue[_0x059f('0xd')][_0x059f('0x11')]=function(){this['loggedIn']=0x0;this[_0x059f('0x12')]=0x0;for(var _0x5bfd6f=0x0;_0x5bfd6f=0x0?this['available']:0x0;var _0x3ea157={'id':this['id'],'available':this[_0x059f('0x16')],'loggedIn':this[_0x059f('0x17')],'name':this[_0x059f('0x7')],'paused':this[_0x059f('0x12')],'waiting':this[_0x059f('0xb')]};var _0x91103a=md5(JSON[_0x059f('0x18')](_0x3ea157));if(this[_0x059f('0x1')]!==_0x91103a){this[_0x059f('0x1')]=_0x91103a;io['to'](util[_0x059f('0x19')](_0x059f('0x1a'),_0x3ea157['name']))[_0x059f('0x1b')](_0x059f('0x1c'),_0x3ea157);}};module[_0x059f('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 6faef5b..a6df328 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x335cc7,_0x592168){var _0x289253=function(_0x4528a5){while(--_0x4528a5){_0x335cc7['push'](_0x335cc7['shift']());}};_0x289253(++_0x592168);}(_0xb10b,0x12a));var _0xbb10=function(_0x478604,_0x40fbc9){_0x478604=_0x478604-0x0;var _0x11627e=_0xb10b[_0x478604];return _0x11627e;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 5b7a407..493e27e 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 _0x7f9a=['../client','Request','UpdateChatInteraction','updateChatInteraction','addTagsToChatInteraction'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7f9a,0x1e5));var _0xa7f9=function(_0x33a1de,_0x3586a8){_0x33a1de=_0x33a1de-0x0;var _0x85da9c=_0x7f9a[_0x33a1de];return _0x85da9c;};'use strict';var client=require(_0xa7f9('0x0'));exports['update']=function(_0x1b7b16,_0x5a4375){return client[_0xa7f9('0x1')](_0xa7f9('0x2'),{'body':_0x5a4375,'options':{'where':{'id':_0x1b7b16}},'log':_0xa7f9('0x3')});};exports['addTags']=function(_0x4f8159,_0x20776b){return client[_0xa7f9('0x1')]('AddTagsToChatInteraction',{'body':_0x20776b,'options':{'where':{'id':_0x4f8159}},'log':_0xa7f9('0x4')});}; \ No newline at end of file +var _0x9c98=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c98,0x12d));var _0x89c9=function(_0x4cd8ad,_0x37d732){_0x4cd8ad=_0x4cd8ad-0x0;var _0x183358=_0x9c98[_0x4cd8ad];return _0x183358;};'use strict';var client=require(_0x89c9('0x0'));exports[_0x89c9('0x1')]=function(_0x370a8d,_0x52427d){return client[_0x89c9('0x2')](_0x89c9('0x3'),{'body':_0x52427d,'options':{'where':{'id':_0x370a8d}},'log':'updateChatInteraction'});};exports[_0x89c9('0x4')]=function(_0x2aed90,_0x5e53ac){return client[_0x89c9('0x2')]('AddTagsToChatInteraction',{'body':_0x5e53ac,'options':{'where':{'id':_0x2aed90}},'log':_0x89c9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0b6d652..9f6bba8 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 _0x9784=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x9784,0x68));var _0x4978=function(_0xaa8b7f,_0x2a6a04){_0xaa8b7f=_0xaa8b7f-0x0;var _0x34afcc=_0x9784[_0xaa8b7f];return _0x34afcc;};'use strict';var client=require(_0x4978('0x0'));exports[_0x4978('0x1')]=function(_0x30b7dd){return client[_0x4978('0x2')](_0x4978('0x3'),{'body':_0x30b7dd,'log':_0x4978('0x4')});}; \ No newline at end of file +var _0xf1f4=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x20f75a,_0x3094ef){var _0x11f078=function(_0xe14479){while(--_0xe14479){_0x20f75a['push'](_0x20f75a['shift']());}};_0x11f078(++_0x3094ef);}(_0xf1f4,0xad));var _0x4f1f=function(_0xfeb1ab,_0x9bef62){_0xfeb1ab=_0xfeb1ab-0x0;var _0x3f2990=_0xf1f4[_0xfeb1ab];return _0x3f2990;};'use strict';var client=require(_0x4f1f('0x0'));exports[_0x4f1f('0x1')]=function(_0x1a961b){return client[_0x4f1f('0x2')](_0x4f1f('0x3'),{'body':_0x1a961b,'log':_0x4f1f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index ba3567b..ddfac2d 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 _0xd13e=['User','name','online','../client','getChatQueues','Request','GetChatQueue','timeout'];(function(_0x3dc993,_0x532559){var _0x3e4b67=function(_0x42c1be){while(--_0x42c1be){_0x3dc993['push'](_0x3dc993['shift']());}};_0x3e4b67(++_0x532559);}(_0xd13e,0x193));var _0xed13=function(_0x23529f,_0x28b3a4){_0x23529f=_0x23529f-0x0;var _0xeba2be=_0xd13e[_0x23529f];return _0xeba2be;};'use strict';var client=require(_0xed13('0x0'));exports[_0xed13('0x1')]=function(){return function(){return client[_0xed13('0x2')](_0xed13('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xed13('0x4'),'strategy'],'include':[{'model':_0xed13('0x5'),'as':'Agents','attributes':['id',_0xed13('0x6'),_0xed13('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x5577=['strategy','User','Agents','name','online','getChatQueues','../client','Request','GetChatQueue','timeout'];(function(_0x38a1a5,_0x3a9a55){var _0xf966f1=function(_0x18bc2e){while(--_0x18bc2e){_0x38a1a5['push'](_0x38a1a5['shift']());}};_0xf966f1(++_0x3a9a55);}(_0x5577,0x1b4));var _0x7557=function(_0x2170fd,_0x29808a){_0x2170fd=_0x2170fd-0x0;var _0x3a16ec=_0x5577[_0x2170fd];return _0x3a16ec;};'use strict';var client=require(_0x7557('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x7557('0x1')](_0x7557('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7557('0x3'),_0x7557('0x4')],'include':[{'model':_0x7557('0x5'),'as':_0x7557('0x6'),'attributes':['id',_0x7557('0x7'),_0x7557('0x8'),'chatPause']}]},'log':_0x7557('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ebe4278..5f7fd13 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 _0x689c=['update','UpdateChatQueueReport','Request','CreateChatQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x689c,0x9e));var _0xc689=function(_0x579c0a,_0x27fb03){_0x579c0a=_0x579c0a-0x0;var _0x2a5fa0=_0x689c[_0x579c0a];return _0x2a5fa0;};'use strict';var client=require('../client');exports['create']=function(_0x45df84){return client[_0xc689('0x0')](_0xc689('0x1'),{'body':_0x45df84,'log':_0xc689('0x1')});};exports[_0xc689('0x2')]=function(_0x28d0cd,_0x4b863b){return client[_0xc689('0x0')]('UpdateChatQueueReport',{'body':_0x4b863b,'options':{'where':{'uniqueid':_0x28d0cd},'order':[['id','DESC']],'limit':0x1},'log':_0xc689('0x3')});}; \ No newline at end of file +var _0x61a5=['../client','Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport'];(function(_0x56e6ad,_0x2fc223){var _0x150a9d=function(_0x1ebb17){while(--_0x1ebb17){_0x56e6ad['push'](_0x56e6ad['shift']());}};_0x150a9d(++_0x2fc223);}(_0x61a5,0xf0));var _0x561a=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x61a5[_0x2543d6];return _0x55213c;};'use strict';var client=require(_0x561a('0x0'));exports['create']=function(_0x412b10){return client[_0x561a('0x1')](_0x561a('0x2'),{'body':_0x412b10,'log':_0x561a('0x2')});};exports[_0x561a('0x3')]=function(_0x58f636,_0xe92b4d){return client[_0x561a('0x1')]('UpdateChatQueueReport',{'body':_0xe92b4d,'options':{'where':{'uniqueid':_0x58f636},'order':[['id',_0x561a('0x4')]],'limit':0x1},'log':_0x561a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e2653a2..5d8e997 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(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0x7a54,0x106));var _0x47a5=function(_0x977b69,_0x76cb3){_0x977b69=_0x977b69-0x0;var _0x4b5a0e=_0x7a54[_0x977b69];return _0x4b5a0e;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x7a54,0x106));var _0x47a5=function(_0x11b795,_0xee856b){_0x11b795=_0x11b795-0x0;var _0x3d8bd7=_0x7a54[_0x11b795];return _0x3d8bd7;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 443f0cd..ad60afe 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 _0x3275=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x5914dc,_0x280454){var _0x22e99a=function(_0x14dcff){while(--_0x14dcff){_0x5914dc['push'](_0x5914dc['shift']());}};_0x22e99a(++_0x280454);}(_0x3275,0xcf));var _0x5327=function(_0x22b98c,_0x3cc5dc){_0x22b98c=_0x22b98c-0x0;var _0x5e846e=_0x3275[_0x22b98c];return _0x5e846e;};'use strict';var client=require('../client');exports[_0x5327('0x0')]=function(_0x4723f4){return client[_0x5327('0x1')](_0x5327('0x2'),{'body':_0x4723f4,'log':_0x5327('0x3')});}; \ No newline at end of file +var _0x6c4a=['create','Request','createFaxMessage','../client'];(function(_0x1448b5,_0x5babfe){var _0x340c4c=function(_0x1a73b6){while(--_0x1a73b6){_0x1448b5['push'](_0x1448b5['shift']());}};_0x340c4c(++_0x5babfe);}(_0x6c4a,0x173));var _0xa6c4=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0x6c4a[_0xce9195];return _0x530fe6;};'use strict';var client=require(_0xa6c4('0x0'));exports[_0xa6c4('0x1')]=function(_0x23e7f7){return client[_0xa6c4('0x2')]('CreateFaxMessage',{'body':_0x23e7f7,'log':_0xa6c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index f018875..5a9f6f1 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 _0x53a7=['online','faxPause','../client','Request','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x53a7,0xd4));var _0x753a=function(_0x3a6ce3,_0x2a0dd6){_0x3a6ce3=_0x3a6ce3-0x0;var _0x3a41ac=_0x53a7[_0x3a6ce3];return _0x3a41ac;};'use strict';var client=require(_0x753a('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x753a('0x1')](_0x753a('0x2'),{'options':{'raw':![],'attributes':['id',_0x753a('0x3'),_0x753a('0x4'),_0x753a('0x5')],'include':[{'model':_0x753a('0x6'),'as':_0x753a('0x7'),'attributes':['id',_0x753a('0x3'),_0x753a('0x8'),_0x753a('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xa911=['getFaxQueues','Request','name','timeout','strategy','User','Agents','online','faxPause','../client'];(function(_0x216b8a,_0x459a11){var _0x344626=function(_0x27c690){while(--_0x27c690){_0x216b8a['push'](_0x216b8a['shift']());}};_0x344626(++_0x459a11);}(_0xa911,0x8b));var _0x1a91=function(_0x408351,_0x208fe1){_0x408351=_0x408351-0x0;var _0x46aef4=_0xa911[_0x408351];return _0x46aef4;};'use strict';var client=require(_0x1a91('0x0'));exports[_0x1a91('0x1')]=function(){return function(){return client[_0x1a91('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x1a91('0x3'),_0x1a91('0x4'),_0x1a91('0x5')],'include':[{'model':_0x1a91('0x6'),'as':_0x1a91('0x7'),'attributes':['id',_0x1a91('0x3'),_0x1a91('0x8'),_0x1a91('0x9')]}]},'log':_0x1a91('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 350c8af..a147553 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 _0x2dad=['DESC','../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x47e3d3,_0x5f2e5d){var _0x34debc=function(_0x511f9e){while(--_0x511f9e){_0x47e3d3['push'](_0x47e3d3['shift']());}};_0x34debc(++_0x5f2e5d);}(_0x2dad,0xd9));var _0xd2da=function(_0x9760e9,_0x962415){_0x9760e9=_0x9760e9-0x0;var _0xc866de=_0x2dad[_0x9760e9];return _0xc866de;};'use strict';var client=require(_0xd2da('0x0'));exports['create']=function(_0x3953b0){return client[_0xd2da('0x1')](_0xd2da('0x2'),{'body':_0x3953b0,'log':_0xd2da('0x2')});};exports[_0xd2da('0x3')]=function(_0x207432,_0x4e6343){return client[_0xd2da('0x1')](_0xd2da('0x4'),{'body':_0x4e6343,'options':{'where':{'uniqueid':_0x207432},'order':[['id',_0xd2da('0x5')]],'limit':0x1},'log':_0xd2da('0x4')});}; \ No newline at end of file +var _0x7ba3=['UpdateFaxQueueReport','Request','CreateFaxQueueReport','update'];(function(_0x5e1afc,_0x4f99eb){var _0x38b312=function(_0x815b54){while(--_0x815b54){_0x5e1afc['push'](_0x5e1afc['shift']());}};_0x38b312(++_0x4f99eb);}(_0x7ba3,0x1cd));var _0x37ba=function(_0x2e0d2a,_0x8d568){_0x2e0d2a=_0x2e0d2a-0x0;var _0x4014f0=_0x7ba3[_0x2e0d2a];return _0x4014f0;};'use strict';var client=require('../client');exports['create']=function(_0x32a720){return client[_0x37ba('0x0')](_0x37ba('0x1'),{'body':_0x32a720,'log':_0x37ba('0x1')});};exports[_0x37ba('0x2')]=function(_0x1089bb,_0x128945){return client[_0x37ba('0x0')](_0x37ba('0x3'),{'body':_0x128945,'options':{'where':{'uniqueid':_0x1089bb},'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 6d3574f..775cd96 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 _0x78f6=['../client','getIntervals','GetInterval','name','Intervals'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x78f6,0x96));var _0x678f=function(_0x3046cf,_0x122c8e){_0x3046cf=_0x3046cf-0x0;var _0x166f92=_0x78f6[_0x3046cf];return _0x166f92;};'use strict';var client=require(_0x678f('0x0'));exports[_0x678f('0x1')]=function(){return function(){return client['Request'](_0x678f('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x678f('0x3')],'include':[{'model':'Interval','as':_0x678f('0x4'),'attributes':['id',_0x678f('0x3'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x845a=['name','../client','getIntervals','Interval','Intervals'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x845a,0x1c3));var _0xa845=function(_0x41ffe4,_0x3a04ae){_0x41ffe4=_0x41ffe4-0x0;var _0x1ba9f3=_0x845a[_0x41ffe4];return _0x1ba9f3;};'use strict';var client=require(_0xa845('0x0'));exports[_0xa845('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xa845('0x2'),'as':_0xa845('0x3'),'attributes':['id',_0xa845('0x4'),'interval']}]},'log':_0xa845('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index a081732..d32cd1c 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 _0x2da6=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x4d9d67,_0x4e890e){var _0x9e7dda=function(_0x543781){while(--_0x543781){_0x4d9d67['push'](_0x4d9d67['shift']());}};_0x9e7dda(++_0x4e890e);}(_0x2da6,0x1dd));var _0x62da=function(_0x1955f4,_0x182860){_0x1955f4=_0x1955f4-0x0;var _0x53f01e=_0x2da6[_0x1955f4];return _0x53f01e;};'use strict';var client=require(_0x62da('0x0'));exports[_0x62da('0x1')]=function(_0x1d3698,_0xbbb39b){return client[_0x62da('0x2')](_0x62da('0x3'),{'body':_0xbbb39b,'options':{'where':{'id':_0x1d3698}},'log':_0x62da('0x4')});};exports[_0x62da('0x5')]=function(_0x4c079d,_0x4a8428){return client[_0x62da('0x2')](_0x62da('0x6'),{'body':_0x4a8428,'options':{'where':{'id':_0x4c079d}},'log':_0x62da('0x7')});}; \ No newline at end of file +var _0x25e7=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x5e4e74,_0x53b7a5){var _0x217a4a=function(_0x2fbf98){while(--_0x2fbf98){_0x5e4e74['push'](_0x5e4e74['shift']());}};_0x217a4a(++_0x53b7a5);}(_0x25e7,0x1d6));var _0x725e=function(_0x5b5239,_0x111b9f){_0x5b5239=_0x5b5239-0x0;var _0x4c55f1=_0x25e7[_0x5b5239];return _0x4c55f1;};'use strict';var client=require(_0x725e('0x0'));exports[_0x725e('0x1')]=function(_0x2752fa,_0x3fdca4){return client[_0x725e('0x2')](_0x725e('0x3'),{'body':_0x3fdca4,'options':{'where':{'id':_0x2752fa}},'log':_0x725e('0x4')});};exports[_0x725e('0x5')]=function(_0x3d7893,_0x3da706){return client['Request']('AddTagsToMailInteraction',{'body':_0x3da706,'options':{'where':{'id':_0x3d7893}},'log':_0x725e('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index ae509b1..fe547f0 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 _0x6ff6=['createMailMessage'];(function(_0x13933e,_0x5a1ce0){var _0x426f35=function(_0x4f5dce){while(--_0x4f5dce){_0x13933e['push'](_0x13933e['shift']());}};_0x426f35(++_0x5a1ce0);}(_0x6ff6,0x1f4));var _0x66ff=function(_0x3c0957,_0x459d8c){_0x3c0957=_0x3c0957-0x0;var _0x3407ac=_0x6ff6[_0x3c0957];return _0x3407ac;};'use strict';var client=require('../client');exports['create']=function(_0xd2a9be){return client['Request']('CreateMailMessage',{'body':_0xd2a9be,'log':_0x66ff('0x0')});}; \ No newline at end of file +var _0x4386=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x4650ad,_0x2675b7){var _0x4199f6=function(_0x342423){while(--_0x342423){_0x4650ad['push'](_0x4650ad['shift']());}};_0x4199f6(++_0x2675b7);}(_0x4386,0x15b));var _0x6438=function(_0x27bc1d,_0x5b53d5){_0x27bc1d=_0x27bc1d-0x0;var _0x170135=_0x4386[_0x27bc1d];return _0x170135;};'use strict';var client=require(_0x6438('0x0'));exports[_0x6438('0x1')]=function(_0x329ce8){return client[_0x6438('0x2')](_0x6438('0x3'),{'body':_0x329ce8,'log':_0x6438('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 669abf8..a3210e6 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 _0xb09b=['timeout','strategy','User','Agents','name','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x29619e,_0x17788f){var _0x1c9e35=function(_0x7fab17){while(--_0x7fab17){_0x29619e['push'](_0x29619e['shift']());}};_0x1c9e35(++_0x17788f);}(_0xb09b,0xb7));var _0xbb09=function(_0x500d35,_0x3f5d69){_0x500d35=_0x500d35-0x0;var _0x383af4=_0xb09b[_0x500d35];return _0x383af4;};'use strict';var client=require(_0xbb09('0x0'));exports[_0xbb09('0x1')]=function(){return function(){return client[_0xbb09('0x2')](_0xbb09('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xbb09('0x4'),_0xbb09('0x5')],'include':[{'model':_0xbb09('0x6'),'as':_0xbb09('0x7'),'attributes':['id',_0xbb09('0x8'),_0xbb09('0x9'),_0xbb09('0xa')]}]},'log':_0xbb09('0x1')});};}; \ No newline at end of file +var _0x9dd7=['GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','getMailQueues','../client','Request'];(function(_0x1398eb,_0x1064c6){var _0x3aaca3=function(_0x5edd44){while(--_0x5edd44){_0x1398eb['push'](_0x1398eb['shift']());}};_0x3aaca3(++_0x1064c6);}(_0x9dd7,0x195));var _0x79dd=function(_0x2be7c0,_0x239417){_0x2be7c0=_0x2be7c0-0x0;var _0x4bdf91=_0x9dd7[_0x2be7c0];return _0x4bdf91;};'use strict';var client=require(_0x79dd('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x79dd('0x1')](_0x79dd('0x2'),{'options':{'raw':![],'attributes':['id',_0x79dd('0x3'),_0x79dd('0x4'),_0x79dd('0x5')],'include':[{'model':_0x79dd('0x6'),'as':_0x79dd('0x7'),'attributes':['id',_0x79dd('0x3'),_0x79dd('0x8'),_0x79dd('0x9')]}]},'log':_0x79dd('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index dd44787..f515ff4 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 _0x6656=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','create','Request'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6656,0x1ef));var _0x6665=function(_0x5862e3,_0x36f95d){_0x5862e3=_0x5862e3-0x0;var _0x3b4a58=_0x6656[_0x5862e3];return _0x3b4a58;};'use strict';var client=require(_0x6665('0x0'));exports[_0x6665('0x1')]=function(_0x50bd5f){return client[_0x6665('0x2')](_0x6665('0x3'),{'body':_0x50bd5f,'log':_0x6665('0x3')});};exports[_0x6665('0x4')]=function(_0x40f77d,_0x1d20bd){return client['Request'](_0x6665('0x5'),{'body':_0x1d20bd,'options':{'where':{'uniqueid':_0x40f77d},'order':[['id','DESC']],'limit':0x1},'log':_0x6665('0x5')});}; \ No newline at end of file +var _0xad9b=['update','Request','DESC','UpdateMailQueueReport','../client','create','CreateMailQueueReport'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xad9b,0xc1));var _0xbad9=function(_0x2c1ca5,_0x1b0af0){_0x2c1ca5=_0x2c1ca5-0x0;var _0x2adbe4=_0xad9b[_0x2c1ca5];return _0x2adbe4;};'use strict';var client=require(_0xbad9('0x0'));exports[_0xbad9('0x1')]=function(_0x4fafa7){return client['Request']('CreateMailQueueReport',{'body':_0x4fafa7,'log':_0xbad9('0x2')});};exports[_0xbad9('0x3')]=function(_0x59eb8,_0x9298b5){return client[_0xbad9('0x4')]('UpdateMailQueueReport',{'body':_0x9298b5,'options':{'where':{'uniqueid':_0x59eb8},'order':[['id',_0xbad9('0x5')]],'limit':0x1},'log':_0xbad9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index cc8c2e9..803958d 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 _0xd358=['Request','AddTagsToOpenchannelInteraction','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x2d5e45,_0x340324){var _0x1321e9=function(_0x443c53){while(--_0x443c53){_0x2d5e45['push'](_0x2d5e45['shift']());}};_0x1321e9(++_0x340324);}(_0xd358,0x156));var _0x8d35=function(_0x43f4fa,_0x4ea862){_0x43f4fa=_0x43f4fa-0x0;var _0x318811=_0xd358[_0x43f4fa];return _0x318811;};'use strict';var client=require('../client');exports[_0x8d35('0x0')]=function(_0x3b075b,_0x336a7f){return client['Request'](_0x8d35('0x1'),{'body':_0x336a7f,'options':{'where':{'id':_0x3b075b}},'log':_0x8d35('0x2')});};exports['addTags']=function(_0x390ff9,_0x4c6e2c){return client[_0x8d35('0x3')](_0x8d35('0x4'),{'body':_0x4c6e2c,'options':{'where':{'id':_0x390ff9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xaa49=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x28d9d4,_0x245d79){var _0x52ed4d=function(_0x4ed31f){while(--_0x4ed31f){_0x28d9d4['push'](_0x28d9d4['shift']());}};_0x52ed4d(++_0x245d79);}(_0xaa49,0x112));var _0x9aa4=function(_0x5a1ef3,_0xc9a156){_0x5a1ef3=_0x5a1ef3-0x0;var _0x2ab7d1=_0xaa49[_0x5a1ef3];return _0x2ab7d1;};'use strict';var client=require(_0x9aa4('0x0'));exports[_0x9aa4('0x1')]=function(_0xa6529e,_0x3a125a){return client[_0x9aa4('0x2')](_0x9aa4('0x3'),{'body':_0x3a125a,'options':{'where':{'id':_0xa6529e}},'log':_0x9aa4('0x4')});};exports[_0x9aa4('0x5')]=function(_0x27cdca,_0x254a8a){return client[_0x9aa4('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x254a8a,'options':{'where':{'id':_0x27cdca}},'log':_0x9aa4('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index ba5dad5..cb96572 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 _0x0bb4=['createOpenchannelMessage','create','CreateOpenchannelMessage'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x0bb4,0x64));var _0x40bb=function(_0x229c17,_0x2e4bf6){_0x229c17=_0x229c17-0x0;var _0x287dda=_0x0bb4[_0x229c17];return _0x287dda;};'use strict';var client=require('../client');exports[_0x40bb('0x0')]=function(_0x59a919){return client['Request'](_0x40bb('0x1'),{'body':_0x59a919,'log':_0x40bb('0x2')});}; \ No newline at end of file +var _0xd13e=['createOpenchannelMessage','create','Request'];(function(_0x3e075c,_0x40d46e){var _0x46be7a=function(_0x1ed95c){while(--_0x1ed95c){_0x3e075c['push'](_0x3e075c['shift']());}};_0x46be7a(++_0x40d46e);}(_0xd13e,0xa3));var _0xed13=function(_0x36051b,_0x2bf471){_0x36051b=_0x36051b-0x0;var _0x1330f9=_0xd13e[_0x36051b];return _0x1330f9;};'use strict';var client=require('../client');exports[_0xed13('0x0')]=function(_0x2c088c){return client[_0xed13('0x1')]('CreateOpenchannelMessage',{'body':_0x2c088c,'log':_0xed13('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 233005e..e81768f 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 _0x092e=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','online','openchannelPause'];(function(_0x7f0f62,_0x28673c){var _0x321568=function(_0x384b5d){while(--_0x384b5d){_0x7f0f62['push'](_0x7f0f62['shift']());}};_0x321568(++_0x28673c);}(_0x092e,0x6c));var _0xe092=function(_0x100d15,_0x585466){_0x100d15=_0x100d15-0x0;var _0x4a2570=_0x092e[_0x100d15];return _0x4a2570;};'use strict';var client=require('../client');exports[_0xe092('0x0')]=function(){return function(){return client[_0xe092('0x1')](_0xe092('0x2'),{'options':{'raw':![],'attributes':['id',_0xe092('0x3'),_0xe092('0x4'),_0xe092('0x5')],'include':[{'model':_0xe092('0x6'),'as':'Agents','attributes':['id',_0xe092('0x3'),_0xe092('0x7'),_0xe092('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x1476=['getOpenchannelQueues','Request','name','timeout','strategy','Agents','online','../client'];(function(_0x3a9153,_0x30e502){var _0x2cfca2=function(_0x27e0b5){while(--_0x27e0b5){_0x3a9153['push'](_0x3a9153['shift']());}};_0x2cfca2(++_0x30e502);}(_0x1476,0x1af));var _0x6147=function(_0x6f888e,_0x581e67){_0x6f888e=_0x6f888e-0x0;var _0x1140d8=_0x1476[_0x6f888e];return _0x1140d8;};'use strict';var client=require(_0x6147('0x0'));exports[_0x6147('0x1')]=function(){return function(){return client[_0x6147('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x6147('0x3'),_0x6147('0x4'),_0x6147('0x5')],'include':[{'model':'User','as':_0x6147('0x6'),'attributes':['id',_0x6147('0x3'),_0x6147('0x7'),'openchannelPause']}]},'log':_0x6147('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index eaada7f..24b34d4 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 _0x32ac=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client'];(function(_0x1d6e08,_0x503c7f){var _0x160ceb=function(_0x2c55d6){while(--_0x2c55d6){_0x1d6e08['push'](_0x1d6e08['shift']());}};_0x160ceb(++_0x503c7f);}(_0x32ac,0x113));var _0xc32a=function(_0x1376ce,_0x4de4a3){_0x1376ce=_0x1376ce-0x0;var _0x1e1470=_0x32ac[_0x1376ce];return _0x1e1470;};'use strict';var client=require(_0xc32a('0x0'));exports['create']=function(_0x12bf4b){return client[_0xc32a('0x1')](_0xc32a('0x2'),{'body':_0x12bf4b,'log':_0xc32a('0x2')});};exports['update']=function(_0x4b0053,_0x151ce2){return client[_0xc32a('0x1')](_0xc32a('0x3'),{'body':_0x151ce2,'options':{'where':{'uniqueid':_0x4b0053},'order':[['id','DESC']],'limit':0x1},'log':_0xc32a('0x3')});}; \ No newline at end of file +var _0xb9f0=['DESC','../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x286384,_0x57aff3){var _0x20b350=function(_0x400c3b){while(--_0x400c3b){_0x286384['push'](_0x286384['shift']());}};_0x20b350(++_0x57aff3);}(_0xb9f0,0x13f));var _0x0b9f=function(_0x566661,_0x3ef886){_0x566661=_0x566661-0x0;var _0x2d07d9=_0xb9f0[_0x566661];return _0x2d07d9;};'use strict';var client=require(_0x0b9f('0x0'));exports[_0x0b9f('0x1')]=function(_0x57f958){return client[_0x0b9f('0x2')](_0x0b9f('0x3'),{'body':_0x57f958,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x3ab2de,_0xf53a06){return client[_0x0b9f('0x2')](_0x0b9f('0x4'),{'body':_0xf53a06,'options':{'where':{'uniqueid':_0x3ab2de},'order':[['id',_0x0b9f('0x5')]],'limit':0x1},'log':_0x0b9f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f4a5ccd..c368570 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 _0xdecb=['addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','UpdateSmsInteraction'];(function(_0xe39328,_0x2cf767){var _0xf03391=function(_0x18263b){while(--_0x18263b){_0xe39328['push'](_0xe39328['shift']());}};_0xf03391(++_0x2cf767);}(_0xdecb,0xe2));var _0xbdec=function(_0x58d3a0,_0x185cc1){_0x58d3a0=_0x58d3a0-0x0;var _0x1a1ab4=_0xdecb[_0x58d3a0];return _0x1a1ab4;};'use strict';var client=require('../client');exports[_0xbdec('0x0')]=function(_0x42735c,_0x12c722){return client['Request'](_0xbdec('0x1'),{'body':_0x12c722,'options':{'where':{'id':_0x42735c}},'log':'updateSmsInteraction'});};exports[_0xbdec('0x2')]=function(_0x17c436,_0x140e68){return client[_0xbdec('0x3')](_0xbdec('0x4'),{'body':_0x140e68,'options':{'where':{'id':_0x17c436}},'log':_0xbdec('0x5')});}; \ No newline at end of file +var _0xe06f=['update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','../client'];(function(_0x24502e,_0x56a297){var _0x3e8a1a=function(_0x438d41){while(--_0x438d41){_0x24502e['push'](_0x24502e['shift']());}};_0x3e8a1a(++_0x56a297);}(_0xe06f,0x65));var _0xfe06=function(_0x466f9e,_0x4fe680){_0x466f9e=_0x466f9e-0x0;var _0x366ff2=_0xe06f[_0x466f9e];return _0x366ff2;};'use strict';var client=require(_0xfe06('0x0'));exports[_0xfe06('0x1')]=function(_0x53e2c9,_0x2ba5f3){return client['Request'](_0xfe06('0x2'),{'body':_0x2ba5f3,'options':{'where':{'id':_0x53e2c9}},'log':_0xfe06('0x3')});};exports[_0xfe06('0x4')]=function(_0x1f0dec,_0x3a07cc){return client[_0xfe06('0x5')]('AddTagsToSmsInteraction',{'body':_0x3a07cc,'options':{'where':{'id':_0x1f0dec}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 5dacf9f..b54a7c9 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 _0x92be=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x92be,0x1ab));var _0xe92b=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x92be[_0x8c43de];return _0xa6591b;};'use strict';var client=require(_0xe92b('0x0'));exports[_0xe92b('0x1')]=function(_0x549e46){return client[_0xe92b('0x2')](_0xe92b('0x3'),{'body':_0x549e46,'log':_0xe92b('0x4')});}; \ No newline at end of file +var _0xe3a6=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe3a6,0xc4));var _0x6e3a=function(_0x98b7ff,_0x51065a){_0x98b7ff=_0x98b7ff-0x0;var _0xa2df96=_0xe3a6[_0x98b7ff];return _0xa2df96;};'use strict';var client=require('../client');exports[_0x6e3a('0x0')]=function(_0x5de003){return client[_0x6e3a('0x1')](_0x6e3a('0x2'),{'body':_0x5de003,'log':_0x6e3a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index dd9b853..3c30b47 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(_0x7bb22e,_0x3e5dd9){var _0xb2b612=function(_0x3eb596){while(--_0x3eb596){_0x7bb22e['push'](_0x7bb22e['shift']());}};_0xb2b612(++_0x3e5dd9);}(_0xe706,0xa3));var _0x6e70=function(_0x1515c9,_0x3db945){_0x1515c9=_0x1515c9-0x0;var _0x3e9c59=_0xe706[_0x1515c9];return _0x3e9c59;};'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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0xdde243,_0x25091b){var _0x50bd11=function(_0x5311fd){while(--_0x5311fd){_0xdde243['push'](_0xdde243['shift']());}};_0x50bd11(++_0x25091b);}(_0x70e0,0x17b));var _0x070e=function(_0x2ecc5a,_0x2b5263){_0x2ecc5a=_0x2ecc5a-0x0;var _0x1da21f=_0x70e0[_0x2ecc5a];return _0x1da21f;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 808795a..2ba6176 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4cefc3,_0x23f291){var _0x1cc779=function(_0x7cb914){while(--_0x7cb914){_0x4cefc3['push'](_0x4cefc3['shift']());}};_0x1cc779(++_0x23f291);}(_0xedd9,0xfc));var _0x9edd=function(_0x5ae746,_0x3fe596){_0x5ae746=_0x5ae746-0x0;var _0x127500=_0xedd9[_0x5ae746];return _0x127500;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x9f9ed5,_0x56f438){var _0xbc71e3=function(_0x1de828){while(--_0x1de828){_0x9f9ed5['push'](_0x9f9ed5['shift']());}};_0xbc71e3(++_0x56f438);}(_0x008c,0x188));var _0xc008=function(_0x33385c,_0x13ac69){_0x33385c=_0x33385c-0x0;var _0x14e17e=_0x008c[_0x33385c];return _0x14e17e;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4c4118a..6972973 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(_0x5d991b,_0x2e0aa2){var _0x43d370=function(_0x130adf){while(--_0x130adf){_0x5d991b['push'](_0x5d991b['shift']());}};_0x43d370(++_0x2e0aa2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x9efb1a,_0x2b3151){var _0x4d1987=function(_0x178f61){while(--_0x178f61){_0x9efb1a['push'](_0x9efb1a['shift']());}};_0x4d1987(++_0x2b3151);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 f9b7ac9..f2603d9 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 _0xba34=['addTagsToWhatsappInteraction','../client','update','Request','AddTagsToWhatsappInteraction'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xba34,0x119));var _0x4ba3=function(_0x34205f,_0x4dbce4){_0x34205f=_0x34205f-0x0;var _0x18d034=_0xba34[_0x34205f];return _0x18d034;};'use strict';var client=require(_0x4ba3('0x0'));exports[_0x4ba3('0x1')]=function(_0xb04f7b,_0x146253){return client[_0x4ba3('0x2')]('UpdateWhatsappInteraction',{'body':_0x146253,'options':{'where':{'id':_0xb04f7b}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x4592fc,_0x2947f2){return client[_0x4ba3('0x2')](_0x4ba3('0x3'),{'body':_0x2947f2,'options':{'where':{'id':_0x4592fc}},'log':_0x4ba3('0x4')});}; \ No newline at end of file +var _0xc1c6=['AddTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction','addTags'];(function(_0x397783,_0x2f5080){var _0x227606=function(_0x3a579a){while(--_0x3a579a){_0x397783['push'](_0x397783['shift']());}};_0x227606(++_0x2f5080);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3ada46,_0x36e7c2){_0x3ada46=_0x3ada46-0x0;var _0x14b164=_0xc1c6[_0x3ada46];return _0x14b164;};'use strict';var client=require(_0x6c1c('0x0'));exports[_0x6c1c('0x1')]=function(_0x7256ba,_0x59f49a){return client[_0x6c1c('0x2')]('UpdateWhatsappInteraction',{'body':_0x59f49a,'options':{'where':{'id':_0x7256ba}},'log':_0x6c1c('0x3')});};exports[_0x6c1c('0x4')]=function(_0x265d2c,_0x59f799){return client['Request'](_0x6c1c('0x5'),{'body':_0x59f799,'options':{'where':{'id':_0x265d2c}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index fd6a6ab..8d2044c 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 _0x5212=['create','Request','createWhatsappMessage'];(function(_0x35b06b,_0x2923e2){var _0x34ee46=function(_0x3ec2f3){while(--_0x3ec2f3){_0x35b06b['push'](_0x35b06b['shift']());}};_0x34ee46(++_0x2923e2);}(_0x5212,0x1aa));var _0x2521=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x5212[_0x172747];return _0x509692;};'use strict';var client=require('../client');exports[_0x2521('0x0')]=function(_0x1944f5){return client[_0x2521('0x1')]('CreateWhatsappMessage',{'body':_0x1944f5,'log':_0x2521('0x2')});}; \ No newline at end of file +var _0xff41=['create','CreateWhatsappMessage'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0xff41,0x190));var _0x1ff4=function(_0x334bef,_0x2a36fe){_0x334bef=_0x334bef-0x0;var _0x388a54=_0xff41[_0x334bef];return _0x388a54;};'use strict';var client=require('../client');exports[_0x1ff4('0x0')]=function(_0x35a8ca){return client['Request'](_0x1ff4('0x1'),{'body':_0x35a8ca,'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 48b89c1..2381314 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 _0x6cd3=['timeout','strategy','User','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x374adc,_0x582887){var _0x150e90=function(_0x35debc){while(--_0x35debc){_0x374adc['push'](_0x374adc['shift']());}};_0x150e90(++_0x582887);}(_0x6cd3,0x116));var _0x36cd=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x6cd3[_0x41e8c4];return _0x54ffbe;};'use strict';var client=require(_0x36cd('0x0'));exports[_0x36cd('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x36cd('0x2'),_0x36cd('0x3')],'include':[{'model':_0x36cd('0x4'),'as':'Agents','attributes':['id','name',_0x36cd('0x5'),_0x36cd('0x6')]}]},'log':_0x36cd('0x1')});};}; \ No newline at end of file +var _0xc907=['strategy','User','Agents','online','../client','Request','name','timeout'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0xc907,0x134));var _0x7c90=function(_0x1c8bfb,_0x56886a){_0x1c8bfb=_0x1c8bfb-0x0;var _0x17bee2=_0xc907[_0x1c8bfb];return _0x17bee2;};'use strict';var client=require(_0x7c90('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x7c90('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x7c90('0x2'),_0x7c90('0x3'),_0x7c90('0x4')],'include':[{'model':_0x7c90('0x5'),'as':_0x7c90('0x6'),'attributes':['id',_0x7c90('0x2'),_0x7c90('0x7'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 09f4b8f..f2e7ed5 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 _0x4a12=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x4a12,0x1f3));var _0x24a1=function(_0x1606b8,_0x235fff){_0x1606b8=_0x1606b8-0x0;var _0x1eef90=_0x4a12[_0x1606b8];return _0x1eef90;};'use strict';var client=require(_0x24a1('0x0'));exports[_0x24a1('0x1')]=function(_0x239f6d){return client[_0x24a1('0x2')](_0x24a1('0x3'),{'body':_0x239f6d,'log':_0x24a1('0x3')});};exports[_0x24a1('0x4')]=function(_0xb48b6d,_0x597c2a){return client[_0x24a1('0x2')](_0x24a1('0x5'),{'body':_0x597c2a,'options':{'where':{'uniqueid':_0xb48b6d},'order':[['id',_0x24a1('0x6')]],'limit':0x1},'log':_0x24a1('0x5')});}; \ No newline at end of file +var _0xf31b=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x5b1a20,_0x1eb5dc){var _0x3efe50=function(_0x54d6dd){while(--_0x54d6dd){_0x5b1a20['push'](_0x5b1a20['shift']());}};_0x3efe50(++_0x1eb5dc);}(_0xf31b,0xc3));var _0xbf31=function(_0x1e37d3,_0x28fd03){_0x1e37d3=_0x1e37d3-0x0;var _0x5983ac=_0xf31b[_0x1e37d3];return _0x5983ac;};'use strict';var client=require('../client');exports[_0xbf31('0x0')]=function(_0x3faf52){return client[_0xbf31('0x1')](_0xbf31('0x2'),{'body':_0x3faf52,'log':_0xbf31('0x2')});};exports[_0xbf31('0x3')]=function(_0x2c892b,_0x439dd2){return client[_0xbf31('0x1')](_0xbf31('0x4'),{'body':_0x439dd2,'options':{'where':{'uniqueid':_0x2c892b},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 a51ceec..69011de 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 _0x7d97=['end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','find','agents','timeout','createQueue','channel','START:%s','rules'];(function(_0x2e81c9,_0x15a07c){var _0x217cf2=function(_0x2963d2){while(--_0x2963d2){_0x2e81c9['push'](_0x2e81c9['shift']());}};_0x217cf2(++_0x15a07c);}(_0x7d97,0x116));var _0x77d9=function(_0x57beaf,_0x165fb5){_0x57beaf=_0x57beaf-0x0;var _0x1f23c6=_0x7d97[_0x57beaf];return _0x1f23c6;};'use strict';var schema=require(_0x77d9('0x0'));var _=require(_0x77d9('0x1'));var util=require(_0x77d9('0x2'));var seqqueue=require(_0x77d9('0x3'));var logger=require(_0x77d9('0x4'))(_0x77d9('0x5'));var strategy=require(_0x77d9('0x6'));var queue=schema({'name':{'type':_0x77d9('0x7'),'required':!![],'message':_0x77d9('0x8')},'timeout':{'type':_0x77d9('0x9'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x46df68,_0x515495,_0x3aa0f2){return logger['info'](util[_0x77d9('0xa')](_0x77d9('0xb'),_0x46df68,_0x515495[_0x77d9('0xc')],_0x3aa0f2));}function handleFindAgent(_0x54bfdd){return function(_0x4cfa73){return _0x4cfa73['name'][_0x77d9('0xd')]()===_0x54bfdd[_0x77d9('0xd')]();};}exports[_0x77d9('0xe')]=function(_0x276fb2,_0x499ff6,_0x207f20,_0x3d4dce){return function(_0x2587a1){try{var _0x462194={'name':_0x499ff6[0x0],'timeout':_0x499ff6[0x1]};var _0x245a22=queue[_0x77d9('0x0')](_0x462194,{'typecast':!![]});if(_0x245a22[_0x77d9('0xf')]){logger['error']('[%s][AGENT]\x20%s',_0x276fb2,_[_0x77d9('0x10')](_0x245a22,_0x77d9('0x11'))[_0x77d9('0x12')](',\x20'));_0x2587a1['stop']();}else{var _0x4458e6=_[_0x77d9('0x13')](_0x207f20[_0x77d9('0x14')],handleFindAgent(_0x462194['name']));if(_0x4458e6){var _0x16d3e7=(_0x462194[_0x77d9('0x15')]||0xa)*0x3e8;var _0x36083d,_0x530ea7;var _0x131b5a=seqqueue[_0x77d9('0x16')](_0x16d3e7);_0x131b5a['id']=_0x276fb2;_0x131b5a['atimeout']=_0x16d3e7;_0x131b5a[_0x77d9('0x17')]=_0x3d4dce[_0x77d9('0x17')];writeLog(_0x276fb2,_0x4458e6,util[_0x77d9('0xa')](_0x77d9('0x18'),_0x16d3e7));_0x207f20[_0x77d9('0x19')][_0x276fb2]['on'](_0x77d9('0x1a'),function(){logger[_0x77d9('0x1b')](_0x77d9('0x1c'),_0x276fb2);clearTimeout(_0x530ea7);_0x530ea7=undefined;_0x131b5a[_0x77d9('0x1d')]();if(_0x207f20[_0x77d9('0x19')][_0x276fb2]){delete _0x207f20[_0x77d9('0x19')][_0x276fb2];}_0x2587a1['stop']();});_0x207f20[_0x77d9('0x19')][_0x276fb2]['on']('complete',function(){if(_0x207f20[_0x77d9('0x19')][_0x276fb2]){delete _0x207f20[_0x77d9('0x19')][_0x276fb2];}});_0x530ea7=setTimeout(function(){logger[_0x77d9('0x1b')](_0x77d9('0x1e'),_0x276fb2);clearTimeout(_0x530ea7);_0x131b5a[_0x77d9('0x1d')]();_0x2587a1['next']();},_0x16d3e7);strategy[_0x77d9('0x1f')](_0x131b5a,_0x4458e6,_0x207f20,_0x3d4dce);}else{logger[_0x77d9('0x20')](_0x77d9('0x21'),_0x276fb2,_0x462194[_0x77d9('0xc')]);_0x2587a1[_0x77d9('0x22')]();}}}catch(_0x2abd77){console[_0x77d9('0x23')](_0x2abd77);logger[_0x77d9('0x20')](_0x77d9('0x24'),_0x276fb2,_0x2abd77[_0x77d9('0x25')]);_0x2587a1[_0x77d9('0x22')]();}};}; \ No newline at end of file +var _0x7863=['format','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number'];(function(_0x3ad83f,_0x4735f1){var _0x5517f7=function(_0x120ea7){while(--_0x120ea7){_0x3ad83f['push'](_0x3ad83f['shift']());}};_0x5517f7(++_0x4735f1);}(_0x7863,0xac));var _0x3786=function(_0x411d8c,_0x22d9ff){_0x411d8c=_0x411d8c-0x0;var _0x34f6e5=_0x7863[_0x411d8c];return _0x34f6e5;};'use strict';var schema=require(_0x3786('0x0'));var _=require(_0x3786('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x3786('0x2'))(_0x3786('0x3'));var strategy=require(_0x3786('0x4'));var queue=schema({'name':{'type':_0x3786('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x3786('0x6'),'message':_0x3786('0x7')}});function writeLog(_0x260e74,_0x305ad9,_0x5ed1d6){return logger['info'](util[_0x3786('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x260e74,_0x305ad9['name'],_0x5ed1d6));}function handleFindAgent(_0x356190){return function(_0x36045f){return _0x36045f[_0x3786('0x9')][_0x3786('0xa')]()===_0x356190[_0x3786('0xa')]();};}exports[_0x3786('0xb')]=function(_0x298d03,_0x35fb7f,_0xe8a063,_0xa16e53){return function(_0x29b752){try{var _0x138f20={'name':_0x35fb7f[0x0],'timeout':_0x35fb7f[0x1]};var _0x2e4144=queue[_0x3786('0x0')](_0x138f20,{'typecast':!![]});if(_0x2e4144['length']){logger[_0x3786('0xc')](_0x3786('0xd'),_0x298d03,_[_0x3786('0xe')](_0x2e4144,_0x3786('0xf'))[_0x3786('0x10')](',\x20'));_0x29b752[_0x3786('0x11')]();}else{var _0x10e5ab=_[_0x3786('0x12')](_0xe8a063[_0x3786('0x13')],handleFindAgent(_0x138f20[_0x3786('0x9')]));if(_0x10e5ab){var _0x34052b=(_0x138f20[_0x3786('0x14')]||0xa)*0x3e8;var _0x282b22,_0x1a54d8;var _0x2f39b7=seqqueue[_0x3786('0x15')](_0x34052b);_0x2f39b7['id']=_0x298d03;_0x2f39b7[_0x3786('0x16')]=_0x34052b;_0x2f39b7[_0x3786('0x17')]=_0xa16e53['channel'];writeLog(_0x298d03,_0x10e5ab,util[_0x3786('0x8')](_0x3786('0x18'),_0x34052b));_0xe8a063[_0x3786('0x19')][_0x298d03]['on'](_0x3786('0x1a'),function(){logger[_0x3786('0x1b')](_0x3786('0x1c'),_0x298d03);clearTimeout(_0x1a54d8);_0x1a54d8=undefined;_0x2f39b7[_0x3786('0x1d')]();if(_0xe8a063[_0x3786('0x19')][_0x298d03]){delete _0xe8a063[_0x3786('0x19')][_0x298d03];}_0x29b752[_0x3786('0x11')]();});_0xe8a063[_0x3786('0x19')][_0x298d03]['on'](_0x3786('0x1e'),function(){if(_0xe8a063[_0x3786('0x19')][_0x298d03]){delete _0xe8a063[_0x3786('0x19')][_0x298d03];}});_0x1a54d8=setTimeout(function(){logger['info'](_0x3786('0x1f'),_0x298d03);clearTimeout(_0x1a54d8);_0x2f39b7[_0x3786('0x1d')]();_0x29b752[_0x3786('0x20')]();},_0x34052b);strategy['agent'](_0x2f39b7,_0x10e5ab,_0xe8a063,_0xa16e53);}else{logger[_0x3786('0xc')](_0x3786('0x21'),_0x298d03,_0x138f20[_0x3786('0x9')]);_0x29b752[_0x3786('0x11')]();}}}catch(_0x25031f){console['log'](_0x25031f);logger[_0x3786('0xc')](_0x3786('0x22'),_0x298d03,_0x25031f[_0x3786('0x23')]);_0x29b752[_0x3786('0x11')]();}};}; \ 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 4b42297..85a389f 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 _0x088f=['whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','amazonlex','providerResponse','stringify','dialogState','Failed','next','catch','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel'];(function(_0x459b19,_0x3ffe4b){var _0x18df13=function(_0x22b5c7){while(--_0x22b5c7){_0x459b19['push'](_0x459b19['shift']());}};_0x18df13(++_0x3ffe4b);}(_0x088f,0x1e8));var _0xf088=function(_0x334b6e,_0x3d24de){_0x334b6e=_0x334b6e-0x0;var _0x59944c=_0x088f[_0x334b6e];return _0x59944c;};'use strict';var _=require(_0xf088('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xf088('0x1'));var logger=require(_0xf088('0x2'))('routing');var rpc={'chatMessage':require(_0xf088('0x3')),'openchannelMessage':require(_0xf088('0x4')),'mailMessage':require(_0xf088('0x5')),'smsMessage':require(_0xf088('0x6')),'faxMessage':require(_0xf088('0x7')),'whatsappMessage':require(_0xf088('0x8'))};exports[_0xf088('0x9')]=function(_0x31c48a,_0x3587e3){return function(_0x1b0a48){try{if(!_[_0xf088('0xa')](this[_0xf088('0xb')][_0xf088('0xc')])){logger[_0xf088('0xd')]('[%s][AMAZONLEX]\x20%s',_0x31c48a,_0xf088('0xe'));return _0x1b0a48['next']();}var _0x5051e2={'ContactId':this[_0xf088('0xf')]['id'],'sentAt':moment()['format'](_0xf088('0x10')),'direction':'out'};if(this['channel']==='sms'||this[_0xf088('0x11')]===_0xf088('0x12')){_0x5051e2[_0xf088('0x13')]=this[_0xf088('0xb')]['phone'];}var _0x5ba676=this[_0xf088('0x11')];if(_0x5ba676===_0xf088('0x14')){_0x5051e2[_0xf088('0x15')]=this[_0xf088('0x16')]['id'];}else{_0x5051e2[_[_0xf088('0x17')](_0x5ba676)+'AccountId']=this['account']['id'];}_0x5051e2[_[_0xf088('0x17')](_0x5ba676)+_0xf088('0x18')]=this[_0xf088('0xb')]['id'];if(this[_0xf088('0xb')][_0xf088('0x19')]){var _0x2cc2a8=_0x3587e3[0x4];if(!_['isEmpty'](_0x2cc2a8)){_0x5051e2[_0xf088('0x1a')]=utils[_0xf088('0x1b')](_0x2cc2a8,this);return rpc[_0x5ba676+_0xf088('0x1c')][_0xf088('0x1d')](_0x5051e2)[_0xf088('0x1e')](function(_0x4fd6b4){logger[_0xf088('0xd')](_0xf088('0x1f'),_0x31c48a,_0x5051e2[_0xf088('0x1a')]);})['catch'](function(_0x3a3431){logger[_0xf088('0x20')](_0xf088('0x1f'),_0x31c48a,JSON['stringify'](_0x3a3431));})['finally'](function(){logger['info'](_0xf088('0x21'),_0x31c48a);_0x1b0a48[_0xf088('0x22')]();});}else{logger[_0xf088('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x31c48a);_0x1b0a48['stop']();}}else{var _0xb03728=this;var _0x3be52b=new AWS[(_0xf088('0x23'))]({'accessKeyId':_0x3587e3[0x0],'secretAccessKey':_0x3587e3[0x1],'region':_0x3587e3[0x2]});var _0x5adb2f={'botAlias':_0xf088('0x24'),'botName':_0x3587e3[0x3],'inputText':this[_0xf088('0x25')][_0xf088('0x1a')],'userId':this[_0xf088('0x11')]+':'+this[_0xf088('0xb')]['id'][_0xf088('0x26')]()};_0x3be52b['postText'](_0x5adb2f,function(_0x575c31,_0x16b913){if(_0x575c31){logger['error']('[%s][AMAZONLEX]\x20%s',_0x31c48a,_0x575c31['message']);_0x1b0a48['next']();}else if(_0x16b913&&_0x16b913[_0xf088('0x25')]){_0xb03728[_0xf088('0x1a')]['amazonlex']=_0x16b913;_0x5051e2[_0xf088('0x1a')]=_0x16b913[_0xf088('0x25')];_0x5051e2['providerName']=_0xf088('0x27');_0x5051e2[_0xf088('0x28')]=JSON[_0xf088('0x29')](_0x16b913);return rpc[_0x5ba676+_0xf088('0x1c')][_0xf088('0x1d')](_0x5051e2)[_0xf088('0x1e')](function(_0x38ff0c){logger['info']('[%s][AMAZONLEX]\x20%s',_0x31c48a,_0x5051e2[_0xf088('0x1a')]);if(_0x16b913[_0xf088('0x2a')]==_0xf088('0x2b')){_0x1b0a48[_0xf088('0x2c')]();}else{_0x1b0a48[_0xf088('0x22')]();}})[_0xf088('0x2d')](function(_0x13023c){logger[_0xf088('0x20')](_0xf088('0x1f'),_0x31c48a,JSON[_0xf088('0x29')](_0x13023c));_0x1b0a48[_0xf088('0x2c')]();});}else{_0x1b0a48['next']();}});}}catch(_0xe254ae){logger[_0xf088('0x20')]('[%s][AMAZONLEX]\x20%s',_0x31c48a,JSON[_0xf088('0x29')](_0xe254ae));_0x1b0a48[_0xf088('0x22')]();}};}; \ No newline at end of file +var _0x3914=['Failed','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','InteractionId','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','message','toString','postText','next','amazonlex','dialogState'];(function(_0x122afc,_0x2b77e8){var _0x2041d0=function(_0x21563c){while(--_0x21563c){_0x122afc['push'](_0x122afc['shift']());}};_0x2041d0(++_0x2b77e8);}(_0x3914,0x1e1));var _0x4391=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x3914[_0x5d72da];return _0x43ebe7;};'use strict';var _=require(_0x4391('0x0'));var moment=require(_0x4391('0x1'));var AWS=require('aws-sdk');var utils=require(_0x4391('0x2'));var logger=require(_0x4391('0x3'))(_0x4391('0x4'));var rpc={'chatMessage':require(_0x4391('0x5')),'openchannelMessage':require(_0x4391('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x4391('0x7')),'whatsappMessage':require(_0x4391('0x8'))};exports[_0x4391('0x9')]=function(_0x580ff0,_0x3bd65a){return function(_0x59fe55){try{if(!_[_0x4391('0xa')](this[_0x4391('0xb')][_0x4391('0xc')])){logger[_0x4391('0xd')](_0x4391('0xe'),_0x580ff0,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x59fe55['next']();}var _0x3a1a9={'ContactId':this[_0x4391('0xf')]['id'],'sentAt':moment()[_0x4391('0x10')](_0x4391('0x11')),'direction':_0x4391('0x12')};if(this[_0x4391('0x13')]===_0x4391('0x14')||this[_0x4391('0x13')]===_0x4391('0x15')){_0x3a1a9[_0x4391('0x16')]=this[_0x4391('0xb')][_0x4391('0x16')];}var _0x556a1f=this[_0x4391('0x13')];if(_0x556a1f===_0x4391('0x17')){_0x3a1a9[_0x4391('0x18')]=this[_0x4391('0x19')]['id'];}else{_0x3a1a9[_['upperFirst'](_0x556a1f)+_0x4391('0x1a')]=this['account']['id'];}_0x3a1a9[_['upperFirst'](_0x556a1f)+_0x4391('0x1b')]=this[_0x4391('0xb')]['id'];if(this[_0x4391('0xb')]['created']){var _0x14021c=_0x3bd65a[0x4];if(!_['isEmpty'](_0x14021c)){_0x3a1a9[_0x4391('0x1c')]=utils[_0x4391('0x1d')](_0x14021c,this);return rpc[_0x556a1f+_0x4391('0x1e')][_0x4391('0x1f')](_0x3a1a9)[_0x4391('0x20')](function(_0x284121){logger[_0x4391('0xd')]('[%s][AMAZONLEX]\x20%s',_0x580ff0,_0x3a1a9['body']);})[_0x4391('0x21')](function(_0x2ae3f4){logger[_0x4391('0x22')]('[%s][AMAZONLEX]\x20%s',_0x580ff0,JSON[_0x4391('0x23')](_0x2ae3f4));})[_0x4391('0x24')](function(){logger[_0x4391('0xd')](_0x4391('0x25'),_0x580ff0);_0x59fe55['stop']();});}else{logger[_0x4391('0xd')](_0x4391('0x26'),_0x580ff0);_0x59fe55[_0x4391('0x27')]();}}else{var _0x2b2470=this;var _0x52c2e8=new AWS['LexRuntime']({'accessKeyId':_0x3bd65a[0x0],'secretAccessKey':_0x3bd65a[0x1],'region':_0x3bd65a[0x2]});var _0x4df210={'botAlias':_0x4391('0x28'),'botName':_0x3bd65a[0x3],'inputText':this[_0x4391('0x29')][_0x4391('0x1c')],'userId':this[_0x4391('0x13')]+':'+this[_0x4391('0xb')]['id'][_0x4391('0x2a')]()};_0x52c2e8[_0x4391('0x2b')](_0x4df210,function(_0x357bdd,_0x327214){if(_0x357bdd){logger[_0x4391('0x22')](_0x4391('0xe'),_0x580ff0,_0x357bdd[_0x4391('0x29')]);_0x59fe55[_0x4391('0x2c')]();}else if(_0x327214&&_0x327214[_0x4391('0x29')]){_0x2b2470[_0x4391('0x1c')][_0x4391('0x2d')]=_0x327214;_0x3a1a9[_0x4391('0x1c')]=_0x327214[_0x4391('0x29')];_0x3a1a9['providerName']=_0x4391('0x2d');_0x3a1a9['providerResponse']=JSON[_0x4391('0x23')](_0x327214);return rpc[_0x556a1f+_0x4391('0x1e')]['create'](_0x3a1a9)['then'](function(_0x41744b){logger[_0x4391('0xd')](_0x4391('0xe'),_0x580ff0,_0x3a1a9[_0x4391('0x1c')]);if(_0x327214[_0x4391('0x2e')]==_0x4391('0x2f')){_0x59fe55[_0x4391('0x2c')]();}else{_0x59fe55[_0x4391('0x27')]();}})[_0x4391('0x21')](function(_0x39cdd5){logger[_0x4391('0x22')](_0x4391('0xe'),_0x580ff0,JSON[_0x4391('0x23')](_0x39cdd5));_0x59fe55['next']();});}else{_0x59fe55[_0x4391('0x2c')]();}});}}catch(_0x501b3b){logger[_0x4391('0x22')]('[%s][AMAZONLEX]\x20%s',_0x580ff0,JSON[_0x4391('0x23')](_0x501b3b));_0x59fe55[_0x4391('0x27')]();}};}; \ 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 51d03d8..4817949 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 _0xb86c=['startsWith','Re:','Re:\x20','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','replace','','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject'];(function(_0x5b6209,_0x3ff707){var _0x52f553=function(_0x323ea1){while(--_0x323ea1){_0x5b6209['push'](_0x5b6209['shift']());}};_0x52f553(++_0x3ff707);}(_0xb86c,0x12b));var _0xcb86=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xb86c[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var moment=require(_0xcb86('0x0'));var utils=require(_0xcb86('0x1'));var logger=require(_0xcb86('0x2'))(_0xcb86('0x3'));var rpc={'chatMessage':require(_0xcb86('0x4')),'openchannelMessage':require(_0xcb86('0x5')),'mailMessage':require(_0xcb86('0x6')),'smsMessage':require(_0xcb86('0x7')),'faxMessage':require(_0xcb86('0x8')),'whatsappMessage':require(_0xcb86('0x9')),'chatInteraction':require(_0xcb86('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xcb86('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xcb86('0xc'));exports[_0xcb86('0xd')]=function(_0x3e2635,_0x410ff2,_0x1e2fd6,_0x23a8d6){return function(_0x5e0e9e){try{var _0x365481=this[_0xcb86('0xe')];if(_0x365481===_0xcb86('0xf')&&_0x23a8d6[_0xcb86('0x10')][_0xcb86('0x11')]){logger[_0xcb86('0x12')]('[%s][AUTOREPLY]\x20%s',_0x3e2635,_0xcb86('0x13'));return _0x5e0e9e[_0xcb86('0x14')]();}if(_0x410ff2[0x0]==='1'&&(_['isNil'](this[_0xcb86('0x15')][_0xcb86('0x16')])||!this[_0xcb86('0x15')][_0xcb86('0x16')])){logger['info'](_0xcb86('0x17'),_0x3e2635,_0xcb86('0x18'));return _0x5e0e9e['next']();}if(_0x410ff2[0x0]==='2'&&this[_0xcb86('0x15')][_0xcb86('0x19')]){logger[_0xcb86('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3e2635,_0xcb86('0x1a'));return _0x5e0e9e[_0xcb86('0x14')]();}var _0x1934f9={'ContactId':this[_0xcb86('0x1b')]['id'],'sentAt':moment()[_0xcb86('0x1c')](_0xcb86('0x1d')),'direction':'out'};if(this[_0xcb86('0xe')]===_0xcb86('0xf')){_0x1934f9['body']=utils[_0xcb86('0x1e')](_0x410ff2[0x2],this);}else{_0x1934f9[_0xcb86('0x10')]=utils[_0xcb86('0x1e')](_0x410ff2[0x1],this);}if(this[_0xcb86('0x1f')]){_0x1934f9['to']=this[_0xcb86('0x1f')][_0xcb86('0x20')]||'';if(this[_0xcb86('0xe')]===_0xcb86('0xf')&&_0x410ff2[0x1]==='1'){_0x1934f9['cc']=this['message']['cc']||'';}_0x1934f9[_0xcb86('0x20')]=this[_0xcb86('0x1f')]['to']||'';_0x1934f9[_0xcb86('0x21')]=this[_0xcb86('0x1f')][_0xcb86('0x21')]||'';_0x1934f9[_0xcb86('0x22')]=!![];if(this[_0xcb86('0x1f')]['subject']){_0x1934f9['subject']='';_0x1934f9[_0xcb86('0x23')]+=_[_0xcb86('0x24')](this['message'][_0xcb86('0x23')],_0xcb86('0x25'))?'':_0xcb86('0x26');_0x1934f9[_0xcb86('0x23')]+=this[_0xcb86('0x1f')]['subject'];}}if(this[_0xcb86('0xe')]==='chat'){_0x1934f9['ChatWebsiteId']=this[_0xcb86('0x27')]['id'];}else{_0x1934f9[_[_0xcb86('0x28')](this[_0xcb86('0xe')])+_0xcb86('0x29')]=this['account']['id'];}_0x1934f9[_[_0xcb86('0x28')](this[_0xcb86('0xe')])+_0xcb86('0x2a')]=this[_0xcb86('0x15')]['id'];var _0x134a81=this['interaction'];if(rpc[this[_0xcb86('0xe')]+_0xcb86('0x2b')]){if(this['channel']==='mail'){_0x1934f9[_0xcb86('0x2c')]=this['message'][_0xcb86('0x2d')];_0x1934f9[_0xcb86('0x2e')]=''+_[_0xcb86('0x2f')](_0x1934f9[_0xcb86('0x10')],_0xcb86('0x30'),_0xcb86('0x31'))+_0xcb86('0x32');_0x1934f9['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xcb86('0x33'),'Precedence':'auto_reply'};return mailRpc[_0xcb86('0x34')](this['account'][_0xcb86('0x35')],_0x1934f9)['then'](function(_0x86febc){logger[_0xcb86('0x12')](_0xcb86('0x36'),_0x3e2635);_0x1934f9[_0xcb86('0x2d')]=_0x86febc[_0xcb86('0x1f')][_0xcb86('0x2d')];return rpc[_0x365481+_0xcb86('0x2b')][_0xcb86('0x37')](_0x1934f9);})[_0xcb86('0x38')](function(_0x56e7ba){logger[_0xcb86('0x12')](_0xcb86('0x17'),_0x3e2635,JSON[_0xcb86('0x39')](_0x56e7ba));})[_0xcb86('0x3a')](function(_0x27997c){logger[_0xcb86('0x3b')](_0xcb86('0x3c'),_0x3e2635,JSON[_0xcb86('0x39')](_0x27997c));})[_0xcb86('0x3d')](function(){Promise['resolve']()[_0xcb86('0x38')](function(){if(_0x410ff2[0x0]!=='2'||_0x134a81[_0xcb86('0x19')])return;return rpc[_0x365481+_0xcb86('0x3e')][_0xcb86('0x3f')](_0x134a81['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5c9f10){logger['info'](_0xcb86('0x40'),_0x3e2635,JSON[_0xcb86('0x39')](_0x5c9f10));})[_0xcb86('0x3a')](function(_0x5569cd){logger[_0xcb86('0x3b')](_0xcb86('0x41'),_0x3e2635,JSON['stringify'](_0x5569cd));});})[_0xcb86('0x38')](function(){_0x5e0e9e[_0xcb86('0x14')]();});});}else{return rpc[this[_0xcb86('0xe')]+_0xcb86('0x2b')][_0xcb86('0x37')](_0x1934f9)[_0xcb86('0x38')](function(){logger[_0xcb86('0x12')]('[%s][AUTOREPLY]\x20%s',_0x3e2635,_0x1934f9[_0xcb86('0x10')]);})[_0xcb86('0x3a')](function(_0x2e147c){logger[_0xcb86('0x3b')](_0xcb86('0x17'),_0x3e2635,JSON[_0xcb86('0x39')](_0x2e147c));})[_0xcb86('0x3d')](function(){Promise['resolve']()['then'](function(){if(_0x410ff2[0x0]!=='2'||_0x134a81[_0xcb86('0x19')])return;return rpc[_0x365481+'Interaction']['update'](_0x134a81['id'],{'autoreplyExecuted':!![]})[_0xcb86('0x38')](function(_0x139a83){logger[_0xcb86('0x12')](_0xcb86('0x40'),_0x3e2635,JSON[_0xcb86('0x39')](_0x139a83));})[_0xcb86('0x3a')](function(_0x20d0e1){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3e2635,JSON['stringify'](_0x20d0e1));});})['then'](function(){_0x5e0e9e[_0xcb86('0x14')]();});});}}}catch(_0x4ac8f9){logger[_0xcb86('0x3b')](_0xcb86('0x17'),_0x3e2635,JSON['stringify'](_0x4ac8f9));_0x5e0e9e[_0xcb86('0x42')]();}};}; \ No newline at end of file +var _0x21ab=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','mail','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','channel','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','messageId',''+_['replace'](_0xce318f[_0xb21a('0x1c')],_0xb21a('0x2d'),_0xb21a('0x2e'))+'';_0xce318f[_0xb21a('0x2f')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xb21a('0x30'),'Precedence':_0xb21a('0x31')};return mailRpc[_0xb21a('0x32')](this[_0xb21a('0x27')][_0xb21a('0x33')],_0xce318f)[_0xb21a('0x34')](function(_0x121c5d){logger['info'](_0xb21a('0x35'),_0x4d2f1a);_0xce318f[_0xb21a('0x2c')]=_0x121c5d['message'][_0xb21a('0x2c')];return rpc[_0x4faf82+_0xb21a('0x2b')]['create'](_0xce318f);})['then'](function(_0x2a5791){logger[_0xb21a('0xe')](_0xb21a('0xf'),_0x4d2f1a,JSON['stringify'](_0x2a5791));})[_0xb21a('0x36')](function(_0x1e9bc7){logger[_0xb21a('0x37')]('[RPC][%s][AUTOREPLY]\x20%s',_0x4d2f1a,JSON[_0xb21a('0x38')](_0x1e9bc7));})['finally'](function(){Promise[_0xb21a('0x39')]()['then'](function(){if(_0xeeb0af[0x0]!=='2'||_0x4c07f1['autoreplyExecuted'])return;return rpc[_0x4faf82+_0xb21a('0x3a')][_0xb21a('0x3b')](_0x4c07f1['id'],{'autoreplyExecuted':!![]})[_0xb21a('0x34')](function(_0x3b8eed){logger[_0xb21a('0xe')](_0xb21a('0x16'),_0x4d2f1a,JSON[_0xb21a('0x38')](_0x3b8eed));})[_0xb21a('0x36')](function(_0x10cfe8){logger['error'](_0xb21a('0x3c'),_0x4d2f1a,JSON[_0xb21a('0x38')](_0x10cfe8));});})[_0xb21a('0x34')](function(){_0x378278[_0xb21a('0x11')]();});});}else{return rpc[this['channel']+_0xb21a('0x2b')][_0xb21a('0x3d')](_0xce318f)['then'](function(){logger[_0xb21a('0xe')](_0xb21a('0xf'),_0x4d2f1a,_0xce318f['body']);})[_0xb21a('0x36')](function(_0x19af34){logger['error'](_0xb21a('0xf'),_0x4d2f1a,JSON[_0xb21a('0x38')](_0x19af34));})[_0xb21a('0x3e')](function(){Promise[_0xb21a('0x39')]()['then'](function(){if(_0xeeb0af[0x0]!=='2'||_0x4c07f1['autoreplyExecuted'])return;return rpc[_0x4faf82+'Interaction'][_0xb21a('0x3b')](_0x4c07f1['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3af8ef){logger[_0xb21a('0xe')](_0xb21a('0x16'),_0x4d2f1a,JSON['stringify'](_0x3af8ef));})[_0xb21a('0x36')](function(_0x4bb568){logger[_0xb21a('0x37')](_0xb21a('0x3c'),_0x4d2f1a,JSON[_0xb21a('0x38')](_0x4bb568));});})['then'](function(){_0x378278[_0xb21a('0x11')]();});});}}}catch(_0x15a374){logger[_0xb21a('0x37')](_0xb21a('0xf'),_0x4d2f1a,JSON[_0xb21a('0x38')](_0x15a374));_0x378278[_0xb21a('0x3f')]();}};}; \ 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 e21b5ff..c3ef67c 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 _0xd880=['../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','[%s][CLOSE]\x20%s','stringify','stop','error','../../../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd880,0x167));var _0x0d88=function(_0x380d16,_0x116e8b){_0x380d16=_0x380d16-0x0;var _0x233f63=_0xd880[_0x380d16];return _0x233f63;};'use strict';var moment=require('moment');var logger=require(_0x0d88('0x0'))('routing');var rpc={'chatInteraction':require(_0x0d88('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x0d88('0x2')),'faxInteraction':require(_0x0d88('0x3')),'whatsappInteraction':require(_0x0d88('0x4'))};exports['consequence']=function(_0x42a6f9,_0x5046b1,_0x132b40,_0xeaaf3d){return function(_0x27d662){try{logger[_0x0d88('0x5')](_0x0d88('0x6'),_0x42a6f9,_0x5046b1[0x0]);var _0x2cf663={'closed':0x1,'closedAt':moment()[_0x0d88('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x0d88('0x8'),'disposition':_0x5046b1[0x0]};if(rpc[_0xeaaf3d[_0x0d88('0x9')]+'Interaction']){rpc[_0xeaaf3d[_0x0d88('0x9')]+'Interaction'][_0x0d88('0xa')](_0xeaaf3d[_0x0d88('0xb')]['id'],_0x2cf663)[_0x0d88('0xc')](function(_0x3d074f){logger[_0x0d88('0x5')](_0x0d88('0xd'),_0x42a6f9,_0xeaaf3d[_0x0d88('0xb')]['id']);})['catch'](function(_0x2fcc89){logger['error'](_0x0d88('0xe'),_0x42a6f9,JSON[_0x0d88('0xf')](_0x2fcc89));})['finally'](function(){_0x27d662[_0x0d88('0x10')]();});}}catch(_0x19b885){logger[_0x0d88('0x11')]('[%s][CLOSE]\x20%s',_0x42a6f9,JSON['stringify'](_0x19b885));_0x27d662[_0x0d88('0x10')]();}};}; \ No newline at end of file +var _0xc342=['Interaction','update','interaction','then','info','catch','[%s][CLOSE]\x20%s','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','format','YYYY-MM-DD\x20HH:mm:ss','system','channel'];(function(_0x22ebcb,_0x41844c){var _0x556170=function(_0x479618){while(--_0x479618){_0x22ebcb['push'](_0x22ebcb['shift']());}};_0x556170(++_0x41844c);}(_0xc342,0x72));var _0x2c34=function(_0x185d2a,_0x308609){_0x185d2a=_0x185d2a-0x0;var _0x4dea27=_0xc342[_0x185d2a];return _0x4dea27;};'use strict';var moment=require(_0x2c34('0x0'));var logger=require(_0x2c34('0x1'))(_0x2c34('0x2'));var rpc={'chatInteraction':require(_0x2c34('0x3')),'openchannelInteraction':require(_0x2c34('0x4')),'smsInteraction':require(_0x2c34('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x2c34('0x6')),'whatsappInteraction':require(_0x2c34('0x7'))};exports['consequence']=function(_0x5b5de2,_0x1d6a34,_0x3b8c00,_0x651514){return function(_0x388600){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x5b5de2,_0x1d6a34[0x0]);var _0x3aee2c={'closed':0x1,'closedAt':moment()[_0x2c34('0x8')](_0x2c34('0x9')),'closeReason':_0x2c34('0xa'),'disposition':_0x1d6a34[0x0]};if(rpc[_0x651514[_0x2c34('0xb')]+'Interaction']){rpc[_0x651514[_0x2c34('0xb')]+_0x2c34('0xc')][_0x2c34('0xd')](_0x651514[_0x2c34('0xe')]['id'],_0x3aee2c)[_0x2c34('0xf')](function(_0x1af526){logger[_0x2c34('0x10')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5b5de2,_0x651514[_0x2c34('0xe')]['id']);})[_0x2c34('0x11')](function(_0x5f027f){logger['error'](_0x2c34('0x12'),_0x5b5de2,JSON['stringify'](_0x5f027f));})['finally'](function(){_0x388600[_0x2c34('0x13')]();});}}catch(_0x18504e){logger[_0x2c34('0x14')](_0x2c34('0x12'),_0x5b5de2,JSON['stringify'](_0x18504e));_0x388600[_0x2c34('0x13')]();}};}; \ 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 f4bc47e..a3517bc 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 _0x04f9=['info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','getMustacheRender','Message','then','error','[%s][DIALOGFLOW]\x20%s','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','body','dialogflow','result','providerName','stringify','metadata','endConversation','moment','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId'];(function(_0x13898b,_0x2b3942){var _0x1d70ab=function(_0x3299e0){while(--_0x3299e0){_0x13898b['push'](_0x13898b['shift']());}};_0x1d70ab(++_0x2b3942);}(_0x04f9,0xb3));var _0x904f=function(_0x1bb82b,_0x3cad8b){_0x1bb82b=_0x1bb82b-0x0;var _0x1c53d5=_0x04f9[_0x1bb82b];return _0x1c53d5;};'use strict';var _=require('lodash');var moment=require(_0x904f('0x0'));var apiai=require(_0x904f('0x1'));var md5=require(_0x904f('0x2'));var utils=require('./utils');var logger=require(_0x904f('0x3'))(_0x904f('0x4'));var rpc={'chatMessage':require(_0x904f('0x5')),'openchannelMessage':require(_0x904f('0x6')),'mailMessage':require(_0x904f('0x7')),'smsMessage':require(_0x904f('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x904f('0x9'))};exports[_0x904f('0xa')]=function(_0x175c38,_0x21dce4){return function(_0x34cbd7){try{if(!_['isNil'](this[_0x904f('0xb')][_0x904f('0xc')])){logger[_0x904f('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x175c38,_0x904f('0xe'));return _0x34cbd7[_0x904f('0xf')]();}var _0x12fbce={'ContactId':this[_0x904f('0x10')]['id'],'sentAt':moment()[_0x904f('0x11')](_0x904f('0x12')),'direction':_0x904f('0x13')};if(this[_0x904f('0x14')]===_0x904f('0x15')||this[_0x904f('0x14')]===_0x904f('0x16')){_0x12fbce[_0x904f('0x17')]=this[_0x904f('0xb')][_0x904f('0x17')];}var _0x2a568a=this[_0x904f('0x14')];if(_0x2a568a===_0x904f('0x18')){_0x12fbce[_0x904f('0x19')]=this[_0x904f('0x1a')]['id'];}else{_0x12fbce[_[_0x904f('0x1b')](_0x2a568a)+_0x904f('0x1c')]=this[_0x904f('0x1a')]['id'];}_0x12fbce[_[_0x904f('0x1b')](_0x2a568a)+'InteractionId']=this['interaction']['id'];if(this[_0x904f('0xb')][_0x904f('0x1d')]){var _0x5c8306=_0x21dce4[0x2];if(!_['isEmpty'](_0x5c8306)){_0x12fbce['body']=utils[_0x904f('0x1e')](_0x5c8306,this);return rpc[_0x2a568a+_0x904f('0x1f')]['create'](_0x12fbce)[_0x904f('0x20')](function(_0x502f80){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x175c38,_0x12fbce['body']);})['catch'](function(_0x53a610){logger[_0x904f('0x21')](_0x904f('0x22'),_0x175c38,JSON['stringify'](_0x53a610));})[_0x904f('0x23')](function(){logger[_0x904f('0xd')](_0x904f('0x24'),_0x175c38);_0x34cbd7['stop']();});}else{logger[_0x904f('0xd')](_0x904f('0x25'),_0x175c38);_0x34cbd7[_0x904f('0x26')]();}}else{var _0x247536=this;var _0x1f394d=apiai(_0x21dce4[0x0],{'language':_0x21dce4[0x1]||'en'});return _0x1f394d[_0x904f('0x27')](this[_0x904f('0x28')][_0x904f('0x29')],{'sessionId':md5(this[_0x904f('0xb')]['id'])})[_0x904f('0x20')](function(_0x5826dd){_0x247536[_0x904f('0x29')][_0x904f('0x2a')]=_0x5826dd;_0x12fbce[_0x904f('0x29')]=_0x5826dd[_0x904f('0x2b')]['fulfillment']['speech'];_0x12fbce[_0x904f('0x2c')]=_0x904f('0x2a');_0x12fbce['providerResponse']=JSON[_0x904f('0x2d')](_0x5826dd);return rpc[_0x2a568a+_0x904f('0x1f')]['create'](_0x12fbce)[_0x904f('0x20')](function(_0x202c64){logger[_0x904f('0xd')](_0x904f('0x22'),_0x175c38,_0x12fbce[_0x904f('0x29')]);if(_0x5826dd[_0x904f('0x2b')][_0x904f('0x2e')][_0x904f('0x2f')]){_0x34cbd7[_0x904f('0xf')]();}else{_0x34cbd7[_0x904f('0x26')]();}})['catch'](function(_0x374f05){logger['error'](_0x904f('0x22'),_0x175c38,JSON[_0x904f('0x2d')](_0x374f05));_0x34cbd7['next']();});})['catch'](function(_0x39fd1d){logger['error'](_0x904f('0x22'),_0x175c38,_0x39fd1d[_0x904f('0x28')]);_0x34cbd7['next']();});}}catch(_0x1e77b0){logger['error'](_0x904f('0x22'),_0x175c38,JSON[_0x904f('0x2d')](_0x1e77b0));_0x34cbd7[_0x904f('0x26')]();}};}; \ No newline at end of file +var _0x96aa=['stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','result','speech','providerName','dialogflow','metadata','next','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error'];(function(_0x418980,_0x397796){var _0x510a02=function(_0x37b26e){while(--_0x37b26e){_0x418980['push'](_0x418980['shift']());}};_0x510a02(++_0x397796);}(_0x96aa,0x67));var _0xa96a=function(_0x5dd3a1,_0x43ec50){_0x5dd3a1=_0x5dd3a1-0x0;var _0x37464a=_0x96aa[_0x5dd3a1];return _0x37464a;};'use strict';var _=require(_0xa96a('0x0'));var moment=require(_0xa96a('0x1'));var apiai=require('apiai-promise');var md5=require(_0xa96a('0x2'));var utils=require(_0xa96a('0x3'));var logger=require(_0xa96a('0x4'))(_0xa96a('0x5'));var rpc={'chatMessage':require(_0xa96a('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa96a('0x7')),'smsMessage':require(_0xa96a('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa96a('0x9'))};exports[_0xa96a('0xa')]=function(_0x282c8c,_0x3f391e){return function(_0x44fb9d){try{if(!_[_0xa96a('0xb')](this[_0xa96a('0xc')][_0xa96a('0xd')])){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0xa96a('0x10'));return _0x44fb9d['next']();}var _0x33b786={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa96a('0x11')](_0xa96a('0x12')),'direction':'out'};if(this[_0xa96a('0x13')]===_0xa96a('0x14')||this[_0xa96a('0x13')]===_0xa96a('0x15')){_0x33b786[_0xa96a('0x16')]=this[_0xa96a('0xc')][_0xa96a('0x16')];}var _0x197116=this[_0xa96a('0x13')];if(_0x197116===_0xa96a('0x17')){_0x33b786[_0xa96a('0x18')]=this[_0xa96a('0x19')]['id'];}else{_0x33b786[_['upperFirst'](_0x197116)+'AccountId']=this[_0xa96a('0x19')]['id'];}_0x33b786[_['upperFirst'](_0x197116)+_0xa96a('0x1a')]=this['interaction']['id'];if(this[_0xa96a('0xc')][_0xa96a('0x1b')]){var _0x1f623e=_0x3f391e[0x2];if(!_[_0xa96a('0x1c')](_0x1f623e)){_0x33b786[_0xa96a('0x1d')]=utils[_0xa96a('0x1e')](_0x1f623e,this);return rpc[_0x197116+'Message'][_0xa96a('0x1f')](_0x33b786)[_0xa96a('0x20')](function(_0x48ca06){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0x33b786[_0xa96a('0x1d')]);})[_0xa96a('0x21')](function(_0x482c59){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,JSON[_0xa96a('0x23')](_0x482c59));})[_0xa96a('0x24')](function(){logger['info'](_0xa96a('0x25'),_0x282c8c);_0x44fb9d['stop']();});}else{logger[_0xa96a('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x282c8c);_0x44fb9d[_0xa96a('0x26')]();}}else{var _0x96a6b2=this;var _0x484ee7=apiai(_0x3f391e[0x0],{'language':_0x3f391e[0x1]||'en'});return _0x484ee7['textRequest'](this[_0xa96a('0x27')][_0xa96a('0x1d')],{'sessionId':md5(this[_0xa96a('0xc')]['id'])})[_0xa96a('0x20')](function(_0x3eca00){_0x96a6b2[_0xa96a('0x1d')]['dialogflow']=_0x3eca00;_0x33b786['body']=_0x3eca00[_0xa96a('0x28')]['fulfillment'][_0xa96a('0x29')];_0x33b786[_0xa96a('0x2a')]=_0xa96a('0x2b');_0x33b786['providerResponse']=JSON[_0xa96a('0x23')](_0x3eca00);return rpc[_0x197116+'Message']['create'](_0x33b786)[_0xa96a('0x20')](function(_0x4f76e0){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0x33b786[_0xa96a('0x1d')]);if(_0x3eca00['result'][_0xa96a('0x2c')]['endConversation']){_0x44fb9d['next']();}else{_0x44fb9d[_0xa96a('0x26')]();}})['catch'](function(_0x585af1){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,JSON['stringify'](_0x585af1));_0x44fb9d[_0xa96a('0x2d')]();});})[_0xa96a('0x21')](function(_0x472d59){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,_0x472d59['message']);_0x44fb9d[_0xa96a('0x2d')]();});}}catch(_0x17b6e9){logger['error'](_0xa96a('0xf'),_0x282c8c,JSON[_0xa96a('0x23')](_0x17b6e9));_0x44fb9d[_0xa96a('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index fcd2a83..0e5bdb1 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 _0x09b2=['format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x22912e,_0x327d59){var _0x478333=function(_0x5a26b2){while(--_0x5a26b2){_0x22912e['push'](_0x22912e['shift']());}};_0x478333(++_0x327d59);}(_0x09b2,0x150));var _0x209b=function(_0x443f97,_0x107510){_0x443f97=_0x443f97-0x0;var _0x2da516=_0x09b2[_0x443f97];return _0x2da516;};'use strict';var _=require(_0x209b('0x0'));var dialogflow=require(_0x209b('0x1'));var md5=require(_0x209b('0x2'));var moment=require(_0x209b('0x3'));var Promise=require('bluebird');var logger=require(_0x209b('0x4'))(_0x209b('0x5'));var utils=require(_0x209b('0x6'));var rpc={'chatMessage':require(_0x209b('0x7')),'openchannelMessage':require(_0x209b('0x8')),'mailMessage':require(_0x209b('0x9')),'smsMessage':require(_0x209b('0xa')),'faxMessage':require(_0x209b('0xb')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x2701a7,_0x97c810,_0x58803,_0x57fb0f){return new Promise(function(_0x3f02fa,_0x4efc5f){var _0x280704=_[_0x209b('0xc')](_0x58803);_0x280704[_0x209b('0xd')]=_0x57fb0f;return rpc[_0x97c810+_0x209b('0xe')][_0x209b('0xf')](_0x280704)[_0x209b('0x10')](function(){logger[_0x209b('0x11')](_0x209b('0x12'),_0x2701a7,_0x280704[_0x209b('0xd')]);_0x3f02fa();})[_0x209b('0x13')](function(_0x1497dc){logger[_0x209b('0x14')](_0x209b('0x12'),_0x2701a7,JSON[_0x209b('0x15')](_0x1497dc));_0x4efc5f(_0x1497dc);});});}exports[_0x209b('0x16')]=function(_0x397216,_0x138de6){return function(_0x120b7a){try{if(!_[_0x209b('0x17')](this[_0x209b('0x18')][_0x209b('0x19')])){logger['info'](_0x209b('0x12'),_0x397216,_0x209b('0x1a'));return _0x120b7a[_0x209b('0x1b')]();}var _0x4ca220={'ContactId':this[_0x209b('0x1c')]['id'],'sentAt':moment()[_0x209b('0x1d')](_0x209b('0x1e')),'direction':'out'};if(this[_0x209b('0x1f')]===_0x209b('0x20')||this[_0x209b('0x1f')]==='whatsapp'){_0x4ca220[_0x209b('0x21')]=this[_0x209b('0x18')][_0x209b('0x21')];}var _0x425529=this[_0x209b('0x1f')];if(_0x425529==='chat'){_0x4ca220[_0x209b('0x22')]=this[_0x209b('0x23')]['id'];}else{_0x4ca220[_['upperFirst'](_0x425529)+'AccountId']=this[_0x209b('0x23')]['id'];}_0x4ca220[_[_0x209b('0x24')](_0x425529)+_0x209b('0x25')]=this[_0x209b('0x18')]['id'];if(this[_0x209b('0x18')][_0x209b('0x26')]){var _0x503e6e=_0x138de6[0x4];if(!_[_0x209b('0x27')](_0x503e6e)){_0x4ca220[_0x209b('0xd')]=utils[_0x209b('0x28')](_0x503e6e,this);return rpc[_0x425529+_0x209b('0xe')][_0x209b('0xf')](_0x4ca220)[_0x209b('0x10')](function(_0x17dbfb){logger[_0x209b('0x11')](_0x209b('0x12'),_0x397216,_0x4ca220[_0x209b('0xd')]);})[_0x209b('0x13')](function(_0x476d41){logger[_0x209b('0x14')](_0x209b('0x12'),_0x397216,JSON[_0x209b('0x15')](_0x476d41));})[_0x209b('0x29')](function(){logger[_0x209b('0x11')](_0x209b('0x2a'),_0x397216);_0x120b7a[_0x209b('0x2b')]();});}else{logger[_0x209b('0x11')](_0x209b('0x2c'),_0x397216);_0x120b7a[_0x209b('0x2b')]();}}else{var _0x1773fb=this;var _0x9391cd=_0x138de6[0x2][_0x209b('0x2d')](/\\n/g,'\x0a');var _0x48ee86={'credentials':{'private_key':_0x9391cd,'client_email':_0x138de6[0x1]}};var _0x1b9145=new dialogflow['SessionsClient'](_0x48ee86);var _0x4abcc9=_0x1b9145['sessionPath'](_0x138de6[0x0],md5(_0x1773fb[_0x209b('0x18')]['id']));var _0x213bbe={'session':_0x4abcc9,'queryInput':{'text':{'text':_0x1773fb[_0x209b('0x2e')][_0x209b('0xd')],'languageCode':_0x138de6[0x3]||'en'}}};return _0x1b9145[_0x209b('0x2f')](_0x213bbe)['then'](function(_0x5b12c1){if(_0x5b12c1&&_0x5b12c1['length']){_0x1773fb[_0x209b('0xd')][_0x209b('0x30')]=_0x5b12c1;var _0x15f7ab=_0x5b12c1[0x0];var _0x5454a0=_0x15f7ab[_0x209b('0x31')][_0x209b('0x32')]&&_0x15f7ab[_0x209b('0x31')]['diagnosticInfo'][_0x209b('0x33')]?_0x15f7ab[_0x209b('0x31')]['diagnosticInfo'][_0x209b('0x33')][_0x209b('0x34')][_0x209b('0x35')]:![];_0x1773fb[_0x209b('0xd')][_0x209b('0x36')]=_0x15f7ab[_0x209b('0x31')][_0x209b('0x37')];_0x1773fb[_0x209b('0xd')][_0x209b('0x38')]=_0x15f7ab[_0x209b('0x31')][_0x209b('0x39')];_0x1773fb[_0x209b('0xd')][_0x209b('0x3a')]=_0x15f7ab['queryResult']['diagnosticInfo']&&_0x15f7ab[_0x209b('0x31')][_0x209b('0x32')][_0x209b('0x33')]?_0x15f7ab[_0x209b('0x31')]['diagnosticInfo'][_0x209b('0x33')]['end_conversation'][_0x209b('0x35')]:![];_0x1773fb[_0x209b('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x15f7ab['queryResult']['intent'][_0x209b('0x3b')];_0x1773fb[_0x209b('0xd')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x15f7ab['queryResult']['intent'][_0x209b('0x3c')];_0x1773fb[_0x209b('0xd')][_0x209b('0x3d')]=_0x15f7ab[_0x209b('0x31')][_0x209b('0x3e')][_0x209b('0x3f')];_0x1773fb[_0x209b('0xd')][_0x209b('0x40')]=_0x15f7ab[_0x209b('0x31')]['languageCode'];_0x1773fb[_0x209b('0xd')]['DIALOGFLOWV2_QUERYTEXT']=_0x15f7ab[_0x209b('0x31')][_0x209b('0x41')];_0x1773fb[_0x209b('0xd')]['DIALOGFLOWV2_SCORE']=_0x15f7ab['queryResult'][_0x209b('0x42')];_0x4ca220[_0x209b('0x43')]=_0x209b('0x30');_0x4ca220[_0x209b('0x44')]=JSON['stringify'](_0x5b12c1);var _0x3c2fa7=[];for(var _0x297da3=0x0;_0x297da3<_0x5b12c1[_0x209b('0x45')];_0x297da3++){var _0x2d86b4=_0x5b12c1[_0x297da3];if(_0x2d86b4&&_0x2d86b4[_0x209b('0x31')]&&_0x2d86b4[_0x209b('0x31')][_0x209b('0x46')]){_0x3c2fa7[_0x209b('0x47')](createMessage(_0x397216,_0x425529,_0x4ca220,_0x2d86b4[_0x209b('0x31')][_0x209b('0x46')]));}}return Promise[_0x209b('0x48')](_0x3c2fa7)[_0x209b('0x10')](function(){if(_0x5454a0){_0x120b7a[_0x209b('0x1b')]();}else{_0x120b7a[_0x209b('0x2b')]();}})['catch'](function(_0x37118d){logger[_0x209b('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x397216,JSON['stringify'](_0x37118d));_0x120b7a['next']();});}})[_0x209b('0x13')](function(_0x247569){logger[_0x209b('0x14')](_0x209b('0x12'),_0x397216,_0x247569[_0x209b('0x2e')]);_0x120b7a[_0x209b('0x1b')]();});}}catch(_0xa1767a){logger[_0x209b('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x397216,JSON[_0x209b('0x15')](_0xa1767a));_0x120b7a[_0x209b('0x2b')]();}};}; \ No newline at end of file +var _0x1360=['length','fulfillmentText','all','message','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','phone','channel','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','sessionPath','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1360,0xd6));var _0x0136=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x1360[_0x810e4d];return _0x13f01c;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x0136('0x0'));var moment=require(_0x0136('0x1'));var Promise=require(_0x0136('0x2'));var logger=require(_0x0136('0x3'))(_0x0136('0x4'));var utils=require('./utils');var rpc={'chatMessage':require(_0x0136('0x5')),'openchannelMessage':require(_0x0136('0x6')),'mailMessage':require(_0x0136('0x7')),'smsMessage':require(_0x0136('0x8')),'faxMessage':require(_0x0136('0x9')),'whatsappMessage':require(_0x0136('0xa'))};function createMessage(_0x56449f,_0x4eec55,_0xbcc06b,_0x456b65){return new Promise(function(_0x385d90,_0x319335){var _0x18791c=_[_0x0136('0xb')](_0xbcc06b);_0x18791c[_0x0136('0xc')]=_0x456b65;return rpc[_0x4eec55+_0x0136('0xd')][_0x0136('0xe')](_0x18791c)[_0x0136('0xf')](function(){logger['info'](_0x0136('0x10'),_0x56449f,_0x18791c[_0x0136('0xc')]);_0x385d90();})[_0x0136('0x11')](function(_0x2f999d){logger[_0x0136('0x12')](_0x0136('0x10'),_0x56449f,JSON[_0x0136('0x13')](_0x2f999d));_0x319335(_0x2f999d);});});}exports['consequence']=function(_0x485ed7,_0x5891ed){return function(_0xc4a980){try{if(!_[_0x0136('0x14')](this[_0x0136('0x15')][_0x0136('0x16')])){logger[_0x0136('0x17')](_0x0136('0x10'),_0x485ed7,_0x0136('0x18'));return _0xc4a980[_0x0136('0x19')]();}var _0xe30b1={'ContactId':this[_0x0136('0x1a')]['id'],'sentAt':moment()['format'](_0x0136('0x1b')),'direction':_0x0136('0x1c')};if(this['channel']===_0x0136('0x1d')||this['channel']==='whatsapp'){_0xe30b1[_0x0136('0x1e')]=this[_0x0136('0x15')]['phone'];}var _0x5f21fe=this[_0x0136('0x1f')];if(_0x5f21fe==='chat'){_0xe30b1['ChatWebsiteId']=this[_0x0136('0x20')]['id'];}else{_0xe30b1[_[_0x0136('0x21')](_0x5f21fe)+_0x0136('0x22')]=this[_0x0136('0x20')]['id'];}_0xe30b1[_['upperFirst'](_0x5f21fe)+_0x0136('0x23')]=this[_0x0136('0x15')]['id'];if(this[_0x0136('0x15')][_0x0136('0x24')]){var _0x3c0bfa=_0x5891ed[0x4];if(!_['isEmpty'](_0x3c0bfa)){_0xe30b1[_0x0136('0xc')]=utils[_0x0136('0x25')](_0x3c0bfa,this);return rpc[_0x5f21fe+'Message']['create'](_0xe30b1)['then'](function(_0x30031a){logger['info'](_0x0136('0x10'),_0x485ed7,_0xe30b1[_0x0136('0xc')]);})[_0x0136('0x11')](function(_0x871bd8){logger['error'](_0x0136('0x10'),_0x485ed7,JSON[_0x0136('0x13')](_0x871bd8));})[_0x0136('0x26')](function(){logger[_0x0136('0x17')](_0x0136('0x27'),_0x485ed7);_0xc4a980['stop']();});}else{logger[_0x0136('0x17')](_0x0136('0x28'),_0x485ed7);_0xc4a980[_0x0136('0x29')]();}}else{var _0xd763a9=this;var _0x3e6f34=_0x5891ed[0x2][_0x0136('0x2a')](/\\n/g,'\x0a');var _0x28b9f1={'credentials':{'private_key':_0x3e6f34,'client_email':_0x5891ed[0x1]}};var _0x126e46=new dialogflow['SessionsClient'](_0x28b9f1);var _0x189f60=_0x126e46[_0x0136('0x2b')](_0x5891ed[0x0],md5(_0xd763a9[_0x0136('0x15')]['id']));var _0x5b317e={'session':_0x189f60,'queryInput':{'text':{'text':_0xd763a9['message'][_0x0136('0xc')],'languageCode':_0x5891ed[0x3]||'en'}}};return _0x126e46[_0x0136('0x2c')](_0x5b317e)[_0x0136('0xf')](function(_0x409b37){if(_0x409b37&&_0x409b37['length']){_0xd763a9[_0x0136('0xc')][_0x0136('0x2d')]=_0x409b37;var _0x16fa42=_0x409b37[0x0];var _0x212224=_0x16fa42[_0x0136('0x2e')][_0x0136('0x2f')]&&_0x16fa42[_0x0136('0x2e')][_0x0136('0x2f')][_0x0136('0x30')]?_0x16fa42[_0x0136('0x2e')]['diagnosticInfo']['fields'][_0x0136('0x31')][_0x0136('0x32')]:![];_0xd763a9[_0x0136('0xc')]['DIALOGFLOWV2_ACTION']=_0x16fa42[_0x0136('0x2e')][_0x0136('0x33')];_0xd763a9[_0x0136('0xc')][_0x0136('0x34')]=_0x16fa42[_0x0136('0x2e')][_0x0136('0x35')];_0xd763a9[_0x0136('0xc')][_0x0136('0x36')]=_0x16fa42[_0x0136('0x2e')][_0x0136('0x2f')]&&_0x16fa42['queryResult'][_0x0136('0x2f')][_0x0136('0x30')]?_0x16fa42[_0x0136('0x2e')][_0x0136('0x2f')]['fields'][_0x0136('0x31')][_0x0136('0x32')]:![];_0xd763a9[_0x0136('0xc')][_0x0136('0x37')]=_0x16fa42['queryResult'][_0x0136('0x38')]['name'];_0xd763a9[_0x0136('0xc')][_0x0136('0x39')]=_0x16fa42[_0x0136('0x2e')][_0x0136('0x38')][_0x0136('0x3a')];_0xd763a9[_0x0136('0xc')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x16fa42[_0x0136('0x2e')][_0x0136('0x38')][_0x0136('0x3b')];_0xd763a9[_0x0136('0xc')][_0x0136('0x3c')]=_0x16fa42[_0x0136('0x2e')][_0x0136('0x3d')];_0xd763a9[_0x0136('0xc')][_0x0136('0x3e')]=_0x16fa42[_0x0136('0x2e')]['queryText'];_0xd763a9['body'][_0x0136('0x3f')]=_0x16fa42['queryResult'][_0x0136('0x40')];_0xe30b1[_0x0136('0x41')]=_0x0136('0x2d');_0xe30b1['providerResponse']=JSON[_0x0136('0x13')](_0x409b37);var _0x180106=[];for(var _0x338234=0x0;_0x338234<_0x409b37[_0x0136('0x42')];_0x338234++){var _0x209a22=_0x409b37[_0x338234];if(_0x209a22&&_0x209a22[_0x0136('0x2e')]&&_0x209a22[_0x0136('0x2e')][_0x0136('0x43')]){_0x180106['push'](createMessage(_0x485ed7,_0x5f21fe,_0xe30b1,_0x209a22['queryResult'][_0x0136('0x43')]));}}return Promise[_0x0136('0x44')](_0x180106)[_0x0136('0xf')](function(){if(_0x212224){_0xc4a980[_0x0136('0x19')]();}else{_0xc4a980[_0x0136('0x29')]();}})[_0x0136('0x11')](function(_0x430f6a){logger['error'](_0x0136('0x10'),_0x485ed7,JSON[_0x0136('0x13')](_0x430f6a));_0xc4a980[_0x0136('0x19')]();});}})[_0x0136('0x11')](function(_0x797b6f){logger[_0x0136('0x12')](_0x0136('0x10'),_0x485ed7,_0x797b6f[_0x0136('0x45')]);_0xc4a980[_0x0136('0x19')]();});}}catch(_0xecf4ca){logger[_0x0136('0x12')](_0x0136('0x10'),_0x485ed7,JSON['stringify'](_0xecf4ca));_0xc4a980[_0x0136('0x29')]();}};}; \ 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 20a545f..1b1ea01 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 _0xb615=['priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0xb615,0x94));var _0x5b61=function(_0x196c18,_0xf2093d){_0x196c18=_0x196c18-0x0;var _0x4807a3=_0xb615[_0x196c18];return _0x4807a3;};'use strict';var schema=require(_0x5b61('0x0'));var _=require('lodash');var htmlToText=require(_0x5b61('0x1'));var utils=require(_0x5b61('0x2'));var logger=require('../../../../config/logger')(_0x5b61('0x3'));var gotoif=schema({'condition':{'type':_0x5b61('0x4'),'required':!![],'message':_0x5b61('0x5')},'priorityTrue':{'type':_0x5b61('0x6'),'message':_0x5b61('0x7')},'priorityFalse':{'type':'number','message':_0x5b61('0x8')}});exports[_0x5b61('0x9')]=function(_0x9ca462,_0x47fd1d){return function(_0x549dde){try{var _0x26a835={'condition':htmlToText[_0x5b61('0xa')](utils[_0x5b61('0xb')](_0x47fd1d[0x0],this),{'wordwrap':![]})[_0x5b61('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x47fd1d[0x1],'priorityFalse':_0x47fd1d[0x2]};var _0xe573a3=gotoif['validate'](_0x26a835,{'typecast':!![]});if(_0xe573a3[_0x5b61('0xd')]){logger[_0x5b61('0xe')](_0x5b61('0xf'),_0x9ca462,_[_0x5b61('0x10')](_0xe573a3,_0x5b61('0x11'))[_0x5b61('0x12')](',\x20'));_0x549dde[_0x5b61('0x13')]();}else{try{var _0x3fdf3b=eval('('+_0x26a835[_0x5b61('0x14')]+')');var _0x4922ac=_0x3fdf3b?_0x26a835['priorityTrue']:_0x26a835[_0x5b61('0x15')];logger[_0x5b61('0x16')](_0x5b61('0x17'),_0x9ca462,_0x26a835[_0x5b61('0x14')],_0x3fdf3b,_0x4922ac||_0x5b61('0x18'));if(_0x4922ac){var _0x4e6dae=_[_0x5b61('0x19')](_0x549dde[_0x5b61('0x1a')](),{'p':_0x4922ac});if(_0x4e6dae>=0x0){logger[_0x5b61('0x16')](_0x5b61('0x1b'),_0x9ca462,_0x4922ac||_0x5b61('0x18'),_0x4e6dae);_0x549dde[_0x5b61('0x18')](_0x4e6dae);}else{logger[_0x5b61('0x16')](_0x5b61('0x1c'),_0x9ca462,_0x4922ac||_0x5b61('0x18'));_0x549dde[_0x5b61('0x13')]();}}else{_0x549dde[_0x5b61('0x18')]();}}catch(_0x56e57c){logger[_0x5b61('0xe')](_0x5b61('0x1d'),_0x9ca462,_0x56e57c['message']);_0x549dde[_0x5b61('0x13')]();}}}catch(_0x165042){logger[_0x5b61('0xe')](_0x5b61('0xf'),_0x9ca462,JSON[_0x5b61('0x1e')](_0x165042));_0x549dde[_0x5b61('0x13')]();}};}; \ No newline at end of file +var _0xb9a2=['replace','error','map','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xb9a2,0x128));var _0x2b9a=function(_0x439cf9,_0x5195a6){_0x439cf9=_0x439cf9-0x0;var _0x918f66=_0xb9a2[_0x439cf9];return _0x918f66;};'use strict';var schema=require(_0x2b9a('0x0'));var _=require(_0x2b9a('0x1'));var htmlToText=require(_0x2b9a('0x2'));var utils=require(_0x2b9a('0x3'));var logger=require(_0x2b9a('0x4'))(_0x2b9a('0x5'));var gotoif=schema({'condition':{'type':_0x2b9a('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x2b9a('0x7'),'message':_0x2b9a('0x8')},'priorityFalse':{'type':'number','message':_0x2b9a('0x9')}});exports['consequence']=function(_0x37ebc0,_0x222ddd){return function(_0x54dfec){try{var _0x1cecc2={'condition':htmlToText[_0x2b9a('0xa')](utils[_0x2b9a('0xb')](_0x222ddd[0x0],this),{'wordwrap':![]})[_0x2b9a('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x222ddd[0x1],'priorityFalse':_0x222ddd[0x2]};var _0x45cf5d=gotoif[_0x2b9a('0x0')](_0x1cecc2,{'typecast':!![]});if(_0x45cf5d['length']){logger[_0x2b9a('0xd')]('[%s][GOTOIF]\x20%s',_0x37ebc0,_[_0x2b9a('0xe')](_0x45cf5d,'message')[_0x2b9a('0xf')](',\x20'));_0x54dfec[_0x2b9a('0x10')]();}else{try{var _0x258218=eval('('+_0x1cecc2['condition']+')');var _0x44968c=_0x258218?_0x1cecc2[_0x2b9a('0x11')]:_0x1cecc2[_0x2b9a('0x12')];logger[_0x2b9a('0x13')](_0x2b9a('0x14'),_0x37ebc0,_0x1cecc2['condition'],_0x258218,_0x44968c||_0x2b9a('0x15'));if(_0x44968c){var _0x128a2e=_[_0x2b9a('0x16')](_0x54dfec[_0x2b9a('0x17')](),{'p':_0x44968c});if(_0x128a2e>=0x0){logger[_0x2b9a('0x13')](_0x2b9a('0x18'),_0x37ebc0,_0x44968c||_0x2b9a('0x15'),_0x128a2e);_0x54dfec[_0x2b9a('0x15')](_0x128a2e);}else{logger[_0x2b9a('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x37ebc0,_0x44968c||_0x2b9a('0x15'));_0x54dfec[_0x2b9a('0x10')]();}}else{_0x54dfec['next']();}}catch(_0x386009){logger[_0x2b9a('0xd')](_0x2b9a('0x19'),_0x37ebc0,_0x386009['message']);_0x54dfec['stop']();}}}catch(_0xc16b6){logger[_0x2b9a('0xd')](_0x2b9a('0x1a'),_0x37ebc0,JSON[_0x2b9a('0x1b')](_0xc16b6));_0x54dfec[_0x2b9a('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 989f287..db5f053 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 _0x6abd=['error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','stop','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length'];(function(_0x366c96,_0x5e0b4b){var _0x40efbe=function(_0x436010){while(--_0x436010){_0x366c96['push'](_0x366c96['shift']());}};_0x40efbe(++_0x5e0b4b);}(_0x6abd,0x150));var _0xd6ab=function(_0xee5235,_0x489179){_0xee5235=_0xee5235-0x0;var _0x47e381=_0x6abd[_0xee5235];return _0x47e381;};'use strict';var schema=require(_0xd6ab('0x0'));var _=require(_0xd6ab('0x1'));var logger=require(_0xd6ab('0x2'))('routing');var gotop=schema({'priority':{'type':_0xd6ab('0x3'),'required':!![],'message':_0xd6ab('0x4')}});exports['consequence']=function(_0x20b820,_0x1c9897){return function(_0x45136f){try{var _0x2048b1={'priority':_0x1c9897[0x0]};var _0xd363b4=gotop[_0xd6ab('0x0')](_0x2048b1,{'typecast':!![]});if(_0xd363b4[_0xd6ab('0x5')]){logger[_0xd6ab('0x6')](_0xd6ab('0x7'),_0x20b820,_[_0xd6ab('0x8')](_0xd363b4,_0xd6ab('0x9'))[_0xd6ab('0xa')](',\x20'));_0x45136f['stop']();}else{logger[_0xd6ab('0xb')](_0xd6ab('0xc'),_0x20b820,_0x2048b1['priority']);if(_0x2048b1[_0xd6ab('0xd')]){var _0x35e943=_[_0xd6ab('0xe')](_0x45136f['rules'](),{'p':_0x2048b1[_0xd6ab('0xd')]});if(_0x35e943>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x20b820,_0x2048b1[_0xd6ab('0xd')]||_0xd6ab('0xf'),_0x35e943);_0x45136f[_0xd6ab('0xf')](_0x35e943);}else{logger[_0xd6ab('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x20b820,_0x2048b1[_0xd6ab('0xd')]||_0xd6ab('0xf'));_0x45136f[_0xd6ab('0x10')]();}}else{_0x45136f[_0xd6ab('0xf')]();}}}catch(_0x2b0546){logger[_0xd6ab('0x6')](_0xd6ab('0x7'),_0x20b820,JSON[_0xd6ab('0x11')](_0x2b0546));_0x45136f[_0xd6ab('0x10')]();}};}; \ No newline at end of file +var _0x912f=['join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stop','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message'];(function(_0x1d4da0,_0x40a8d7){var _0x28d175=function(_0x31cf45){while(--_0x31cf45){_0x1d4da0['push'](_0x1d4da0['shift']());}};_0x28d175(++_0x40a8d7);}(_0x912f,0x10d));var _0xf912=function(_0x34d90f,_0x5eccf4){_0x34d90f=_0x34d90f-0x0;var _0x55c339=_0x912f[_0x34d90f];return _0x55c339;};'use strict';var schema=require(_0xf912('0x0'));var _=require(_0xf912('0x1'));var logger=require(_0xf912('0x2'))(_0xf912('0x3'));var gotop=schema({'priority':{'type':_0xf912('0x4'),'required':!![],'message':_0xf912('0x5')}});exports[_0xf912('0x6')]=function(_0x351977,_0x966c10){return function(_0x8f3900){try{var _0x133a17={'priority':_0x966c10[0x0]};var _0x41ed59=gotop['validate'](_0x133a17,{'typecast':!![]});if(_0x41ed59[_0xf912('0x7')]){logger[_0xf912('0x8')]('[%s][GOTOP]\x20%s',_0x351977,_[_0xf912('0x9')](_0x41ed59,_0xf912('0xa'))[_0xf912('0xb')](',\x20'));_0x8f3900['stop']();}else{logger[_0xf912('0xc')](_0xf912('0xd'),_0x351977,_0x133a17[_0xf912('0xe')]);if(_0x133a17[_0xf912('0xe')]){var _0x5c2b06=_[_0xf912('0xf')](_0x8f3900[_0xf912('0x10')](),{'p':_0x133a17[_0xf912('0xe')]});if(_0x5c2b06>=0x0){logger[_0xf912('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x351977,_0x133a17[_0xf912('0xe')]||'next',_0x5c2b06);_0x8f3900['next'](_0x5c2b06);}else{logger[_0xf912('0xc')](_0xf912('0x11'),_0x351977,_0x133a17[_0xf912('0xe')]||_0xf912('0x12'));_0x8f3900['stop']();}}else{_0x8f3900[_0xf912('0x12')]();}}}catch(_0x4dfa4c){logger[_0xf912('0x8')]('[%s][GOTOP]\x20%s',_0x351977,JSON['stringify'](_0x4dfa4c));_0x8f3900[_0xf912('0x13')]();}};}; \ 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 03c602b..eacc53d 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 _0xba40=['interaction','Message','info','body','error','[%s][MESSAGE]\x20%s','stringify','stop','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','AccountId'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xba40,0x7b));var _0x0ba4=function(_0x5350d9,_0x2d1c41){_0x5350d9=_0x5350d9-0x0;var _0x36128b=_0xba40[_0x5350d9];return _0x36128b;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x0ba4('0x0'))(_0x0ba4('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0ba4('0x2')),'mailMessage':require(_0x0ba4('0x3')),'smsMessage':require(_0x0ba4('0x4')),'faxMessage':require(_0x0ba4('0x5')),'whatsappMessage':require(_0x0ba4('0x6'))};exports[_0x0ba4('0x7')]=function(_0x21751b,_0x3665ee){return function(_0x517498){try{var _0x36ed85={'body':utils[_0x0ba4('0x8')](_0x3665ee[0x0],this),'ContactId':this[_0x0ba4('0x9')]['id']};if(this['channel']===_0x0ba4('0xa')){_0x36ed85[_0x0ba4('0xb')]=this[_0x0ba4('0xc')]['id'];}else{_0x36ed85[_['upperFirst'](this[_0x0ba4('0xd')])+_0x0ba4('0xe')]=this[_0x0ba4('0xc')]['id'];}_0x36ed85[_['upperFirst'](this[_0x0ba4('0xd')])+'InteractionId']=this[_0x0ba4('0xf')]['id'];if(rpc[this[_0x0ba4('0xd')]+_0x0ba4('0x10')]){return rpc[this[_0x0ba4('0xd')]+_0x0ba4('0x10')]['create'](_0x36ed85)['then'](function(_0x29243b){logger[_0x0ba4('0x11')]('[%s][MESSAGE]\x20%s',_0x21751b,_0x36ed85[_0x0ba4('0x12')]);_0x517498['next']();})['catch'](function(_0x334dc6){logger[_0x0ba4('0x13')](_0x0ba4('0x14'),_0x21751b,JSON[_0x0ba4('0x15')](_0x334dc6));_0x517498[_0x0ba4('0x16')]();});}}catch(_0x226b9e){logger[_0x0ba4('0x13')]('[%s][MESSAGE]\x20%s',_0x21751b,JSON[_0x0ba4('0x15')](_0x226b9e));_0x517498[_0x0ba4('0x16')]();}};}; \ No newline at end of file +var _0x05b6=['next','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body'];(function(_0x38a91c,_0x243b5b){var _0x518343=function(_0x28ac80){while(--_0x28ac80){_0x38a91c['push'](_0x38a91c['shift']());}};_0x518343(++_0x243b5b);}(_0x05b6,0x74));var _0x605b=function(_0xc3050a,_0x3f50b5){_0xc3050a=_0xc3050a-0x0;var _0x433e7a=_0x05b6[_0xc3050a];return _0x433e7a;};'use strict';var _=require(_0x605b('0x0'));var utils=require('./utils');var logger=require(_0x605b('0x1'))(_0x605b('0x2'));var rpc={'chatMessage':require(_0x605b('0x3')),'openchannelMessage':require(_0x605b('0x4')),'mailMessage':require(_0x605b('0x5')),'smsMessage':require(_0x605b('0x6')),'faxMessage':require(_0x605b('0x7')),'whatsappMessage':require(_0x605b('0x8'))};exports[_0x605b('0x9')]=function(_0x3480f5,_0x404efe){return function(_0x311da0){try{var _0x2c2138={'body':utils[_0x605b('0xa')](_0x404efe[0x0],this),'ContactId':this[_0x605b('0xb')]['id']};if(this[_0x605b('0xc')]===_0x605b('0xd')){_0x2c2138[_0x605b('0xe')]=this[_0x605b('0xf')]['id'];}else{_0x2c2138[_['upperFirst'](this[_0x605b('0xc')])+'AccountId']=this['account']['id'];}_0x2c2138[_['upperFirst'](this[_0x605b('0xc')])+_0x605b('0x10')]=this[_0x605b('0x11')]['id'];if(rpc[this[_0x605b('0xc')]+_0x605b('0x12')]){return rpc[this[_0x605b('0xc')]+_0x605b('0x12')][_0x605b('0x13')](_0x2c2138)[_0x605b('0x14')](function(_0x178bce){logger[_0x605b('0x15')](_0x605b('0x16'),_0x3480f5,_0x2c2138[_0x605b('0x17')]);_0x311da0[_0x605b('0x18')]();})['catch'](function(_0x262b53){logger[_0x605b('0x19')]('[%s][MESSAGE]\x20%s',_0x3480f5,JSON['stringify'](_0x262b53));_0x311da0['stop']();});}}catch(_0x12da61){logger[_0x605b('0x19')]('[%s][MESSAGE]\x20%s',_0x3480f5,JSON[_0x605b('0x1a')](_0x12da61));_0x311da0[_0x605b('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index e26f586..388eb22 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 _0x72a8=['getMustacheRender','next','error','[%s][NOOP]\x20%s','./utils','../../../../config/logger','routing','consequence'];(function(_0x9383db,_0x16ae2a){var _0x40d237=function(_0x2b8536){while(--_0x2b8536){_0x9383db['push'](_0x9383db['shift']());}};_0x40d237(++_0x16ae2a);}(_0x72a8,0x94));var _0x872a=function(_0x618a5d,_0x106a7e){_0x618a5d=_0x618a5d-0x0;var _0x3261f4=_0x72a8[_0x618a5d];return _0x3261f4;};'use strict';var utils=require(_0x872a('0x0'));var logger=require(_0x872a('0x1'))(_0x872a('0x2'));exports[_0x872a('0x3')]=function(_0x143ae8,_0xe8395e){return function(_0xfb246c){try{logger['info']('[%s][NOOP]\x20%s',_0x143ae8,utils[_0x872a('0x4')](_0xe8395e[0x0],this));_0xfb246c[_0x872a('0x5')]();}catch(_0x4baa15){logger[_0x872a('0x6')](_0x872a('0x7'),_0x143ae8,JSON['stringify'](_0x4baa15));_0xfb246c['stop']();}};}; \ No newline at end of file +var _0xb032=['stringify','stop','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x434f3f,_0x3acf05){var _0x2b8405=function(_0x2577e2){while(--_0x2577e2){_0x434f3f['push'](_0x434f3f['shift']());}};_0x2b8405(++_0x3acf05);}(_0xb032,0x84));var _0x2b03=function(_0x19635f,_0x564859){_0x19635f=_0x19635f-0x0;var _0x482132=_0xb032[_0x19635f];return _0x482132;};'use strict';var utils=require(_0x2b03('0x0'));var logger=require('../../../../config/logger')(_0x2b03('0x1'));exports[_0x2b03('0x2')]=function(_0x12ac88,_0x43d67c){return function(_0x504bc2){try{logger[_0x2b03('0x3')](_0x2b03('0x4'),_0x12ac88,utils[_0x2b03('0x5')](_0x43d67c[0x0],this));_0x504bc2[_0x2b03('0x6')]();}catch(_0x3bcd73){logger[_0x2b03('0x7')]('[%s][NOOP]\x20%s',_0x12ac88,JSON[_0x2b03('0x8')](_0x3bcd73));_0x504bc2[_0x2b03('0x9')]();}};}; \ 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 295288b..b574641 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 _0xcfe8=['remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','catch','update\x20queue\x20report','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','log','stack','validate','util','seq-queue','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xcfe8,0x1b8));var _0x8cfe=function(_0x400682,_0x181aae){_0x400682=_0x400682-0x0;var _0xd5d4b8=_0xcfe8[_0x400682];return _0xd5d4b8;};'use strict';var schema=require(_0x8cfe('0x0'));var _=require('lodash');var util=require(_0x8cfe('0x1'));var seqqueue=require(_0x8cfe('0x2'));var moment=require('moment');var Redis=require(_0x8cfe('0x3'));var config=require(_0x8cfe('0x4'));var logger=require('../../../../config/logger')(_0x8cfe('0x5'));var strategy=require(_0x8cfe('0x6'));config[_0x8cfe('0x7')]=_[_0x8cfe('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8cfe('0x9'))(new Redis(config[_0x8cfe('0x7')]));var attributes=['id',_0x8cfe('0xa'),_0x8cfe('0xb'),_0x8cfe('0xc'),_0x8cfe('0xd'),_0x8cfe('0xe')];function emit(_0x2d5a74,_0x495d8b,_0x5606aa){io['to'](_0x2d5a74)[_0x8cfe('0xf')](_0x495d8b,_0x5606aa);}function emitChannelQueueInteraction(_0x394477,_0x25dac9,_0x485758,_0x43e5da,_0x5585aa,_0x25b389,_0x2d4a74,_0x5d1f95){var _0x3a7c6e=_[_0x8cfe('0x10')](_0x485758);_0x3a7c6e['queue_id']=_0x5d1f95;_0x3a7c6e['queue']=_0x25dac9;_0x3a7c6e[_0x8cfe('0xb')]=_0x43e5da;_0x3a7c6e['id']=_0x5585aa;if(_0x25b389){_0x2d4a74[util[_0x8cfe('0x11')](_0x8cfe('0x12'),_0x394477)][_0x5585aa]=_[_0x8cfe('0x13')](_0x3a7c6e,attributes);}else{delete _0x2d4a74[util[_0x8cfe('0x11')](_0x8cfe('0x12'),_0x394477)][_0x5585aa];}emit(util[_0x8cfe('0x11')](_0x8cfe('0x14'),_0x394477,_0x25dac9),util['format']('%s_queue_waiting_interaction:%s',_0x394477,_0x25b389?_0x8cfe('0x15'):_0x8cfe('0x16')),_['pick'](_0x3a7c6e,attributes));}var rpc={'openchannelQueueReport':require(_0x8cfe('0x17')),'mailQueueReport':require(_0x8cfe('0x18')),'chatQueueReport':require(_0x8cfe('0x19')),'smsQueueReport':require(_0x8cfe('0x1a')),'faxQueueReport':require(_0x8cfe('0x1b')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x8cfe('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x8cfe('0x1d'),'message':_0x8cfe('0x1e')}});function startRouting(_0x51ca53,_0x101c7a,_0x56f271,_0x8779bb){if(_0x51ca53&&_0x101c7a&&_0x56f271){_0x101c7a[_0x8cfe('0x1f')]+=0x1;var _0x3cb5c6={'uniqueid':_0x51ca53,'from':_0x56f271[_0x8cfe('0x20')]?_0x56f271[_0x8cfe('0x20')]['from']:'','joinAt':moment()[_0x8cfe('0x11')](_0x8cfe('0x21')),'ContactId':_0x56f271[_0x8cfe('0x22')]?_0x56f271['contact']['id']:null,'ListId':_0x56f271[_0x8cfe('0x23')]?_0x56f271[_0x8cfe('0x23')]['id']:null};_0x3cb5c6[_['upperFirst'](_0x56f271[_0x8cfe('0x24')])+_0x8cfe('0x25')]=_0x101c7a['id']||null;_0x3cb5c6[_[_0x8cfe('0x26')](_0x56f271[_0x8cfe('0x24')])+_0x8cfe('0x27')]=_0x56f271[_0x8cfe('0x28')]?_0x56f271['interaction']['id']:null;_0x3cb5c6[_[_0x8cfe('0x26')](_0x56f271[_0x8cfe('0x24')])+'MessageId']=_0x56f271[_0x8cfe('0x29')]?_0x56f271['message']['id']:null;_0x3cb5c6[_[_0x8cfe('0x26')](_0x56f271[_0x8cfe('0x24')])+(_0x56f271[_0x8cfe('0x24')]!==_0x8cfe('0x2a')?'AccountId':_0x8cfe('0x2b'))]=_0x56f271[_0x8cfe('0xb')]?_0x56f271[_0x8cfe('0xb')]['id']:null;logger[_0x8cfe('0x2c')](util[_0x8cfe('0x11')](_0x8cfe('0x2d'),_0x51ca53,_0x101c7a[_0x8cfe('0x2e')]));emitChannelQueueInteraction(_0x56f271[_0x8cfe('0x24')],_0x101c7a['name'],_0x3cb5c6,_0x56f271[_0x8cfe('0xb')][_0x8cfe('0x2e')],_0x56f271[_0x8cfe('0x29')]['id'],!![],_0x8779bb,_0x101c7a['id']);if(rpc[_0x56f271[_0x8cfe('0x24')]+_0x8cfe('0x2f')]){return rpc[_0x56f271[_0x8cfe('0x24')]+_0x8cfe('0x2f')]['create'](_0x3cb5c6)['catch'](function(_0x4ccc6b){logger[_0x8cfe('0x30')](_0x8cfe('0x31'));});}}}function stopRouting(_0x1d0fb3,_0x17e024,_0x53e3cd,_0x45ff88){if(_0x1d0fb3&&_0x17e024){_0x17e024[_0x8cfe('0x1f')]-=0x1;var _0x4f4280={'leaveAt':moment()[_0x8cfe('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x8cfe('0x11')](_0x8cfe('0x21')),'reason':_0x8cfe('0x32')};logger[_0x8cfe('0x2c')](util['format'](_0x8cfe('0x33'),_0x1d0fb3,_0x17e024[_0x8cfe('0x2e')]));emitChannelQueueInteraction(_0x53e3cd['channel'],_0x17e024[_0x8cfe('0x2e')],_0x53e3cd[_0x8cfe('0x20')],_0x53e3cd[_0x8cfe('0xb')][_0x8cfe('0x2e')],_0x53e3cd['message']['id'],![],_0x45ff88,_0x17e024['id']);if(rpc[_0x53e3cd['channel']+_0x8cfe('0x2f')]){return rpc[_0x53e3cd['channel']+'QueueReport']['update'](_0x1d0fb3,_0x4f4280)[_0x8cfe('0x34')](function(_0x10038){logger[_0x8cfe('0x30')](_0x8cfe('0x35'));});}}}function endRouting(_0x2216ff,_0x123237,_0x27c60c,_0x4fd489){if(_0x2216ff&&_0x123237){_0x123237[_0x8cfe('0x1f')]-=0x1;var _0x74d4ae={'leaveAt':moment()[_0x8cfe('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x8cfe('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8cfe('0x36')};logger[_0x8cfe('0x2c')](util[_0x8cfe('0x11')]('[%s][END:QUEUE][NAME:%s]',_0x2216ff,_0x123237[_0x8cfe('0x2e')]));emitChannelQueueInteraction(_0x27c60c[_0x8cfe('0x24')],_0x123237[_0x8cfe('0x2e')],_0x27c60c[_0x8cfe('0x20')],_0x27c60c[_0x8cfe('0xb')][_0x8cfe('0x2e')],_0x27c60c[_0x8cfe('0x29')]['id'],![],_0x4fd489);if(rpc[_0x27c60c[_0x8cfe('0x24')]+'QueueReport']){return rpc[_0x27c60c[_0x8cfe('0x24')]+_0x8cfe('0x2f')][_0x8cfe('0x37')](_0x2216ff,_0x74d4ae)[_0x8cfe('0x34')](function(_0x562f03){logger[_0x8cfe('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0xd3e06e){return function(_0x1f22ce){return _0x1f22ce[_0x8cfe('0x2e')][_0x8cfe('0x38')]()===_0xd3e06e[_0x8cfe('0x38')]();};}exports[_0x8cfe('0x39')]=function(_0x2cbd68,_0x1d039b,_0x44fa3b,_0x3bac21){return function(_0xbe5a51){try{var _0x4ef165={'name':_0x1d039b[0x0],'timeout':_0x1d039b[0x1]};var _0x552104=queue[_0x8cfe('0x0')](_0x4ef165,{'typecast':!![]});if(_0x552104[_0x8cfe('0x3a')]){logger[_0x8cfe('0x30')](_0x8cfe('0x3b'),_0x2cbd68,_[_0x8cfe('0x3c')](_0x552104,'message')[_0x8cfe('0x3d')](',\x20'));_0xbe5a51[_0x8cfe('0x3e')]();}else{var _0x3f26de=_['find'](_0x44fa3b[_0x3bac21[_0x8cfe('0x24')]+'Queues'],handleFindQueue(_0x4ef165[_0x8cfe('0x2e')]));if(_0x3f26de){startRouting(_0x2cbd68,_0x3f26de,_0x3bac21,_0x44fa3b);var _0x32b3d5=(_0x3f26de['timeout']||0xa)*0x3e8;var _0x4adc5b=(_0x4ef165['timeout']||0x14)*0x3e8;var _0x441912,_0x3ab937;if(_0x32b3d5>_0x4adc5b){_0x4adc5b=_0x32b3d5;}var _0x4e0799=seqqueue[_0x8cfe('0x3f')](_0x32b3d5);_0x4e0799['id']=_0x2cbd68;_0x4e0799[_0x8cfe('0x40')]=_0x32b3d5;_0x4e0799[_0x8cfe('0x41')]=_0x4adc5b;_0x4e0799['channel']=_0x3bac21['channel'];_0x44fa3b['rules'][_0x2cbd68]['on'](_0x8cfe('0x42'),function(){logger[_0x8cfe('0x2c')](_0x8cfe('0x43'),_0x2cbd68);stopRouting(_0x2cbd68,_0x3f26de,_0x3bac21,_0x44fa3b);clearTimeout(_0x441912);_0x441912=undefined;_0x4e0799[_0x8cfe('0x44')](!![]);if(_0x44fa3b[_0x8cfe('0x45')][_0x2cbd68]){delete _0x44fa3b['rules'][_0x2cbd68];}_0xbe5a51[_0x8cfe('0x3e')]();});_0x44fa3b[_0x8cfe('0x45')][_0x2cbd68]['on'](_0x8cfe('0x46'),function(){if(_0x44fa3b[_0x8cfe('0x45')][_0x2cbd68]){delete _0x44fa3b[_0x8cfe('0x45')][_0x2cbd68];}});_0x441912=setTimeout(function(){logger[_0x8cfe('0x2c')](_0x8cfe('0x47'),_0x2cbd68);endRouting(_0x2cbd68,_0x3f26de,_0x3bac21,_0x44fa3b);clearTimeout(_0x441912);_0x4e0799[_0x8cfe('0x44')](!![]);_0xbe5a51[_0x8cfe('0x48')]();},_0x4adc5b);switch(_0x3f26de['strategy']){case'rrmemory':strategy[_0x8cfe('0x49')](_0x4e0799,_0x3f26de,_0x44fa3b,_0x3bac21);break;default:strategy[_0x8cfe('0x4a')](_0x4e0799,_0x3f26de,_0x44fa3b,_0x3bac21);}}else{logger[_0x8cfe('0x30')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2cbd68,_0x4ef165['name']);_0xbe5a51[_0x8cfe('0x3e')]();}}}catch(_0x1cd9d5){console[_0x8cfe('0x4b')](_0x1cd9d5);logger[_0x8cfe('0x30')](_0x8cfe('0x3b'),_0x2cbd68,_0x1cd9d5[_0x8cfe('0x4c')]);_0xbe5a51[_0x8cfe('0x3e')]();}};}; \ No newline at end of file +var _0xd1e7=['WebsiteId','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','info','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','AccountId'];(function(_0x4d1ec4,_0x58c19e){var _0x3418a1=function(_0x1819c1){while(--_0x1819c1){_0x4d1ec4['push'](_0x4d1ec4['shift']());}};_0x3418a1(++_0x58c19e);}(_0xd1e7,0x147));var _0x7d1e=function(_0x12acb3,_0x46d2c7){_0x12acb3=_0x12acb3-0x0;var _0x206eeb=_0xd1e7[_0x12acb3];return _0x206eeb;};'use strict';var schema=require(_0x7d1e('0x0'));var _=require(_0x7d1e('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x7d1e('0x2'))(_0x7d1e('0x3'));var strategy=require(_0x7d1e('0x4'));config[_0x7d1e('0x5')]=_[_0x7d1e('0x6')](config[_0x7d1e('0x5')],{'host':_0x7d1e('0x7'),'port':0x18eb});var io=require(_0x7d1e('0x8'))(new Redis(config[_0x7d1e('0x5')]));var attributes=['id',_0x7d1e('0x9'),_0x7d1e('0xa'),_0x7d1e('0xb'),'from',_0x7d1e('0xc')];function emit(_0x389f54,_0x1a48c8,_0x5c6dab){io['to'](_0x389f54)['emit'](_0x1a48c8,_0x5c6dab);}function emitChannelQueueInteraction(_0x5dcfa4,_0x2ace6e,_0x25d443,_0x1f5a87,_0x522487,_0x771be4,_0x4bb2fd,_0xcf8592){var _0x40c5b5=_[_0x7d1e('0xd')](_0x25d443);_0x40c5b5[_0x7d1e('0x9')]=_0xcf8592;_0x40c5b5[_0x7d1e('0xb')]=_0x2ace6e;_0x40c5b5[_0x7d1e('0xa')]=_0x1f5a87;_0x40c5b5['id']=_0x522487;if(_0x771be4){_0x4bb2fd[util['format'](_0x7d1e('0xe'),_0x5dcfa4)][_0x522487]=_[_0x7d1e('0xf')](_0x40c5b5,attributes);}else{delete _0x4bb2fd[util['format'](_0x7d1e('0xe'),_0x5dcfa4)][_0x522487];}emit(util[_0x7d1e('0x10')](_0x7d1e('0x11'),_0x5dcfa4,_0x2ace6e),util[_0x7d1e('0x10')](_0x7d1e('0x12'),_0x5dcfa4,_0x771be4?_0x7d1e('0x13'):'remove'),_['pick'](_0x40c5b5,attributes));}var rpc={'openchannelQueueReport':require(_0x7d1e('0x14')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x7d1e('0x15')),'smsQueueReport':require(_0x7d1e('0x16')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x7d1e('0x17'))};var queue=schema({'name':{'type':_0x7d1e('0x18'),'required':!![],'message':_0x7d1e('0x19')},'timeout':{'type':_0x7d1e('0x1a'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x47fb8e,_0x506a40,_0x49348e,_0x5cbe97){if(_0x47fb8e&&_0x506a40&&_0x49348e){_0x506a40[_0x7d1e('0x1b')]+=0x1;var _0x2407bb={'uniqueid':_0x47fb8e,'from':_0x49348e['body']?_0x49348e[_0x7d1e('0x1c')]['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x49348e['contact']?_0x49348e[_0x7d1e('0x1d')]['id']:null,'ListId':_0x49348e[_0x7d1e('0x1e')]?_0x49348e[_0x7d1e('0x1e')]['id']:null};_0x2407bb[_['upperFirst'](_0x49348e[_0x7d1e('0x1f')])+_0x7d1e('0x20')]=_0x506a40['id']||null;_0x2407bb[_[_0x7d1e('0x21')](_0x49348e[_0x7d1e('0x1f')])+_0x7d1e('0x22')]=_0x49348e[_0x7d1e('0x23')]?_0x49348e[_0x7d1e('0x23')]['id']:null;_0x2407bb[_['upperFirst'](_0x49348e[_0x7d1e('0x1f')])+'MessageId']=_0x49348e[_0x7d1e('0x24')]?_0x49348e['message']['id']:null;_0x2407bb[_[_0x7d1e('0x21')](_0x49348e[_0x7d1e('0x1f')])+(_0x49348e[_0x7d1e('0x1f')]!=='chat'?_0x7d1e('0x25'):_0x7d1e('0x26'))]=_0x49348e[_0x7d1e('0xa')]?_0x49348e['account']['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x47fb8e,_0x506a40[_0x7d1e('0x27')]));emitChannelQueueInteraction(_0x49348e[_0x7d1e('0x1f')],_0x506a40[_0x7d1e('0x27')],_0x2407bb,_0x49348e[_0x7d1e('0xa')][_0x7d1e('0x27')],_0x49348e[_0x7d1e('0x24')]['id'],!![],_0x5cbe97,_0x506a40['id']);if(rpc[_0x49348e[_0x7d1e('0x1f')]+'QueueReport']){return rpc[_0x49348e[_0x7d1e('0x1f')]+_0x7d1e('0x28')]['create'](_0x2407bb)[_0x7d1e('0x29')](function(_0x116728){logger[_0x7d1e('0x2a')](_0x7d1e('0x2b'));});}}}function stopRouting(_0x2023f5,_0x1284b5,_0x558b86,_0xba4f87){if(_0x2023f5&&_0x1284b5){_0x1284b5[_0x7d1e('0x1b')]-=0x1;var _0x901df3={'leaveAt':moment()[_0x7d1e('0x10')](_0x7d1e('0x2c')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7d1e('0x2d')};logger['info'](util[_0x7d1e('0x10')](_0x7d1e('0x2e'),_0x2023f5,_0x1284b5[_0x7d1e('0x27')]));emitChannelQueueInteraction(_0x558b86[_0x7d1e('0x1f')],_0x1284b5[_0x7d1e('0x27')],_0x558b86[_0x7d1e('0x1c')],_0x558b86[_0x7d1e('0xa')][_0x7d1e('0x27')],_0x558b86[_0x7d1e('0x24')]['id'],![],_0xba4f87,_0x1284b5['id']);if(rpc[_0x558b86[_0x7d1e('0x1f')]+_0x7d1e('0x28')]){return rpc[_0x558b86[_0x7d1e('0x1f')]+_0x7d1e('0x28')][_0x7d1e('0x2f')](_0x2023f5,_0x901df3)[_0x7d1e('0x29')](function(_0x152fdf){logger[_0x7d1e('0x2a')]('update\x20queue\x20report');});}}}function endRouting(_0x2dac5c,_0x23b030,_0x5c9832,_0x6f8d85){if(_0x2dac5c&&_0x23b030){_0x23b030[_0x7d1e('0x1b')]-=0x1;var _0x4c8a70={'leaveAt':moment()['format'](_0x7d1e('0x2c')),'exitAt':moment()[_0x7d1e('0x10')](_0x7d1e('0x2c')),'reason':_0x7d1e('0x30')};logger[_0x7d1e('0x31')](util['format'](_0x7d1e('0x32'),_0x2dac5c,_0x23b030[_0x7d1e('0x27')]));emitChannelQueueInteraction(_0x5c9832[_0x7d1e('0x1f')],_0x23b030[_0x7d1e('0x27')],_0x5c9832['body'],_0x5c9832[_0x7d1e('0xa')][_0x7d1e('0x27')],_0x5c9832[_0x7d1e('0x24')]['id'],![],_0x6f8d85);if(rpc[_0x5c9832[_0x7d1e('0x1f')]+_0x7d1e('0x28')]){return rpc[_0x5c9832[_0x7d1e('0x1f')]+'QueueReport'][_0x7d1e('0x2f')](_0x2dac5c,_0x4c8a70)[_0x7d1e('0x29')](function(_0xe14db6){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x3273e8){return function(_0xe7d0f){return _0xe7d0f['name'][_0x7d1e('0x33')]()===_0x3273e8[_0x7d1e('0x33')]();};}exports[_0x7d1e('0x34')]=function(_0x37ef6e,_0x292e59,_0x18579f,_0x3b68d4){return function(_0x574202){try{var _0x16b85e={'name':_0x292e59[0x0],'timeout':_0x292e59[0x1]};var _0x44289e=queue[_0x7d1e('0x0')](_0x16b85e,{'typecast':!![]});if(_0x44289e['length']){logger[_0x7d1e('0x2a')](_0x7d1e('0x35'),_0x37ef6e,_[_0x7d1e('0x36')](_0x44289e,_0x7d1e('0x24'))[_0x7d1e('0x37')](',\x20'));_0x574202[_0x7d1e('0x38')]();}else{var _0x8e3a48=_[_0x7d1e('0x39')](_0x18579f[_0x3b68d4[_0x7d1e('0x1f')]+'Queues'],handleFindQueue(_0x16b85e[_0x7d1e('0x27')]));if(_0x8e3a48){startRouting(_0x37ef6e,_0x8e3a48,_0x3b68d4,_0x18579f);var _0x222bfd=(_0x8e3a48['timeout']||0xa)*0x3e8;var _0x44c5fa=(_0x16b85e['timeout']||0x14)*0x3e8;var _0x3b6834,_0x173db0;if(_0x222bfd>_0x44c5fa){_0x44c5fa=_0x222bfd;}var _0xa0db1d=seqqueue[_0x7d1e('0x3a')](_0x222bfd);_0xa0db1d['id']=_0x37ef6e;_0xa0db1d[_0x7d1e('0x3b')]=_0x222bfd;_0xa0db1d[_0x7d1e('0x3c')]=_0x44c5fa;_0xa0db1d[_0x7d1e('0x1f')]=_0x3b68d4['channel'];_0x18579f['rules'][_0x37ef6e]['on'](_0x7d1e('0x3d'),function(){logger['info'](_0x7d1e('0x3e'),_0x37ef6e);stopRouting(_0x37ef6e,_0x8e3a48,_0x3b68d4,_0x18579f);clearTimeout(_0x3b6834);_0x3b6834=undefined;_0xa0db1d['close'](!![]);if(_0x18579f['rules'][_0x37ef6e]){delete _0x18579f['rules'][_0x37ef6e];}_0x574202[_0x7d1e('0x38')]();});_0x18579f[_0x7d1e('0x3f')][_0x37ef6e]['on'](_0x7d1e('0x40'),function(){if(_0x18579f[_0x7d1e('0x3f')][_0x37ef6e]){delete _0x18579f['rules'][_0x37ef6e];}});_0x3b6834=setTimeout(function(){logger[_0x7d1e('0x31')](_0x7d1e('0x41'),_0x37ef6e);endRouting(_0x37ef6e,_0x8e3a48,_0x3b68d4,_0x18579f);clearTimeout(_0x3b6834);_0xa0db1d[_0x7d1e('0x42')](!![]);_0x574202[_0x7d1e('0x43')]();},_0x44c5fa);switch(_0x8e3a48[_0x7d1e('0x44')]){case'rrmemory':strategy[_0x7d1e('0x45')](_0xa0db1d,_0x8e3a48,_0x18579f,_0x3b68d4);break;default:strategy['beepall'](_0xa0db1d,_0x8e3a48,_0x18579f,_0x3b68d4);}}else{logger[_0x7d1e('0x2a')](_0x7d1e('0x46'),_0x37ef6e,_0x16b85e[_0x7d1e('0x27')]);_0x574202[_0x7d1e('0x38')]();}}}catch(_0x2ed2b5){console[_0x7d1e('0x47')](_0x2ed2b5);logger['error']('[%s][QUEUE]\x20%s',_0x37ef6e,_0x2ed2b5[_0x7d1e('0x48')]);_0x574202[_0x7d1e('0x38')]();}};}; \ 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 0d7721a..610bc47 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 _0xbb40=['isAgentAvailable','agents','channel','busy','busyQueue','showNotification','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','writeLog','STOP','TIMEOUT','lodash','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x394837,_0x3e62fc){var _0x5ab38a=function(_0x5a62dc){while(--_0x5a62dc){_0x394837['push'](_0x394837['shift']());}};_0x5ab38a(++_0x3e62fc);}(_0xbb40,0x1be));var _0x0bb4=function(_0x5615a9,_0x38f29a){_0x5615a9=_0x5615a9-0x0;var _0x4f8306=_0xbb40[_0x5615a9];return _0x4f8306;};'use strict';var _=require(_0x0bb4('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x0bb4('0x1'))(_0x0bb4('0x2'));var Agent=function(_0x36ad02,_0x20ab2b,_0x1f7304,_0x28dea8){this[_0x0bb4('0x3')]=uuid['v4']();this[_0x0bb4('0x4')]=_0x36ad02;this['agent']=_0x20ab2b;this[_0x0bb4('0x5')]=_0x1f7304;this['routing']=_0x28dea8;this[_0x0bb4('0x4')][_0x0bb4('0x6')](this[_0x0bb4('0x7')][_0x0bb4('0x8')](this),this['handleTimeout'][_0x0bb4('0x8')](this));this['squeue']['on'](_0x0bb4('0x9'),this[_0x0bb4('0xa')][_0x0bb4('0x8')](this));this[_0x0bb4('0x4')]['on'](_0x0bb4('0xb'),this[_0x0bb4('0xc')]['bind'](this));};Agent[_0x0bb4('0xd')][_0x0bb4('0x6')]=function(){this['squeue'][_0x0bb4('0x6')](this[_0x0bb4('0x7')][_0x0bb4('0x8')](this),this['handleTimeout']['bind'](this));};Agent[_0x0bb4('0xd')][_0x0bb4('0xc')]=function(){this[_0x0bb4('0xa')](!![]);};Agent[_0x0bb4('0xd')][_0x0bb4('0x7')]=function(){logger[_0x0bb4('0xe')](_0x0bb4('0xf'),this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x10')]['id']);if(_[_0x0bb4('0x11')](this[_0x0bb4('0x5')]['agents'][this[_0x0bb4('0x10')]['id']])){logger[_0x0bb4('0xe')](_0x0bb4('0x12'),this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x10')]['id']);setTimeout(this[_0x0bb4('0x6')][_0x0bb4('0x8')](this),0x3e8);}else{if(this[_0x0bb4('0x2')]['forcedOwnership']||util[_0x0bb4('0x13')](this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x5')][_0x0bb4('0x14')][this[_0x0bb4('0x10')]['id']],this[_0x0bb4('0x4')][_0x0bb4('0x15')],![])){this[_0x0bb4('0x5')][_0x0bb4('0x14')][this[_0x0bb4('0x10')]['id']][_0x0bb4('0x16')]=!![];this[_0x0bb4('0x5')][_0x0bb4('0x14')][this[_0x0bb4('0x10')]['id']][_0x0bb4('0x17')]=undefined;util[_0x0bb4('0x18')](this[_0x0bb4('0x3')],this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x5')]['agents'][this[_0x0bb4('0x10')]['id']],null,this[_0x0bb4('0x2')]);util['writeLog'](this['squeue']['id'],this[_0x0bb4('0x5')][_0x0bb4('0x14')][this[_0x0bb4('0x10')]['id']],'RINGING'+(this[_0x0bb4('0x2')][_0x0bb4('0x19')]?_0x0bb4('0x1a'):''));}else{logger['debug'](_0x0bb4('0x1b'),this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x10')]['id']);setTimeout(this['push'][_0x0bb4('0x8')](this),0x3e8);}}};Agent['prototype'][_0x0bb4('0xa')]=function(_0x11c0c2){if(_[_0x0bb4('0x11')](this['realtime'][_0x0bb4('0x14')][this[_0x0bb4('0x10')]['id']])){return logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x10')]['id']);}else{logger[_0x0bb4('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x10')]['id']);util['hideNotification'](this['notificationId'],this[_0x0bb4('0x4')]['id'],this[_0x0bb4('0x5')]['agents'][this[_0x0bb4('0x10')]['id']],null,this['routing']);this[_0x0bb4('0x5')][_0x0bb4('0x14')][this[_0x0bb4('0x10')]['id']]['busy']=![];this[_0x0bb4('0x5')][_0x0bb4('0x14')][this[_0x0bb4('0x10')]['id']]['busyQueue']=undefined;util[_0x0bb4('0x1c')](this['squeue']['id'],this[_0x0bb4('0x5')]['agents'][this[_0x0bb4('0x10')]['id']],_0x11c0c2?_0x0bb4('0x1d'):_0x0bb4('0x1e'));}if(!_0x11c0c2){setTimeout(this['push'][_0x0bb4('0x8')](this),0x3e8);}};function agent(_0x17cda2,_0x4d26e1,_0x23967a,_0x782d47){return new Agent(_0x17cda2,_0x4d26e1,_0x23967a,_0x782d47);}module['exports']=agent; \ No newline at end of file +var _0x7bae=['uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','handleTimeout','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0x7bae,0xaa));var _0xe7ba=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7bae[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var uuid=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var logger=require(_0xe7ba('0x2'))('routing');var Agent=function(_0x4a6f8d,_0x44c2fb,_0x2b7658,_0x4c130b){this[_0xe7ba('0x3')]=uuid['v4']();this[_0xe7ba('0x4')]=_0x4a6f8d;this[_0xe7ba('0x5')]=_0x44c2fb;this[_0xe7ba('0x6')]=_0x2b7658;this[_0xe7ba('0x7')]=_0x4c130b;this[_0xe7ba('0x4')][_0xe7ba('0x8')](this[_0xe7ba('0x9')][_0xe7ba('0xa')](this),this['handleTimeout'][_0xe7ba('0xa')](this));this[_0xe7ba('0x4')]['on'](_0xe7ba('0xb'),this['handleTimeout'][_0xe7ba('0xa')](this));this[_0xe7ba('0x4')]['on'](_0xe7ba('0xc'),this[_0xe7ba('0xd')][_0xe7ba('0xa')](this));};Agent['prototype'][_0xe7ba('0x8')]=function(){this[_0xe7ba('0x4')][_0xe7ba('0x8')](this['handleRun'][_0xe7ba('0xa')](this),this['handleTimeout'][_0xe7ba('0xa')](this));};Agent[_0xe7ba('0xe')][_0xe7ba('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0xe7ba('0xe')][_0xe7ba('0x9')]=function(){logger[_0xe7ba('0xf')](_0xe7ba('0x10'),this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x5')]['id']);if(_[_0xe7ba('0x11')](this[_0xe7ba('0x6')]['agents'][this['agent']['id']])){logger['debug'](_0xe7ba('0x12'),this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x5')]['id']);setTimeout(this[_0xe7ba('0x8')][_0xe7ba('0xa')](this),0x3e8);}else{if(this[_0xe7ba('0x7')][_0xe7ba('0x13')]||util[_0xe7ba('0x14')](this[_0xe7ba('0x4')]['id'],this['realtime'][_0xe7ba('0x15')][this[_0xe7ba('0x5')]['id']],this[_0xe7ba('0x4')][_0xe7ba('0x16')],![])){this[_0xe7ba('0x6')]['agents'][this[_0xe7ba('0x5')]['id']][_0xe7ba('0x17')]=!![];this[_0xe7ba('0x6')][_0xe7ba('0x15')][this['agent']['id']][_0xe7ba('0x18')]=undefined;util[_0xe7ba('0x19')](this[_0xe7ba('0x3')],this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x6')][_0xe7ba('0x15')][this['agent']['id']],null,this['routing']);util[_0xe7ba('0x1a')](this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x6')][_0xe7ba('0x15')][this['agent']['id']],'RINGING'+(this[_0xe7ba('0x7')][_0xe7ba('0x13')]?_0xe7ba('0x1b'):''));}else{logger[_0xe7ba('0xf')](_0xe7ba('0x1c'),this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x5')]['id']);setTimeout(this['push'][_0xe7ba('0xa')](this),0x3e8);}}};Agent[_0xe7ba('0xe')][_0xe7ba('0x1d')]=function(_0x4bd57f){if(_[_0xe7ba('0x11')](this[_0xe7ba('0x6')][_0xe7ba('0x15')][this[_0xe7ba('0x5')]['id']])){return logger[_0xe7ba('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);}else{logger['debug'](_0xe7ba('0x1e'),this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x5')]['id']);util['hideNotification'](this['notificationId'],this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x6')][_0xe7ba('0x15')][this[_0xe7ba('0x5')]['id']],null,this[_0xe7ba('0x7')]);this[_0xe7ba('0x6')][_0xe7ba('0x15')][this['agent']['id']][_0xe7ba('0x17')]=![];this[_0xe7ba('0x6')][_0xe7ba('0x15')][this[_0xe7ba('0x5')]['id']][_0xe7ba('0x18')]=undefined;util['writeLog'](this[_0xe7ba('0x4')]['id'],this[_0xe7ba('0x6')][_0xe7ba('0x15')][this[_0xe7ba('0x5')]['id']],_0x4bd57f?_0xe7ba('0x1f'):_0xe7ba('0x20'));}if(!_0x4bd57f){setTimeout(this[_0xe7ba('0x8')][_0xe7ba('0xa')](this),0x3e8);}};function agent(_0x297a7a,_0x1752b2,_0x2795b6,_0xcf935d){return new Agent(_0x297a7a,_0x1752b2,_0x2795b6,_0xcf935d);}module[_0xe7ba('0x21')]=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 10cf8ba..14253dd 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 _0xc423=['agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','RINGING','busy','busyQueue','name','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','isNil','length','Agents'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xc423,0x159));var _0x3c42=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc423[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x3c42('0x0'));var uuid=require(_0x3c42('0x1'));var util=require(_0x3c42('0x2'));var logger=require(_0x3c42('0x3'))(_0x3c42('0x4'));var Beepall=function(_0x4c94ff,_0x212d37,_0x13d988,_0x2f1f8b){this['notificationId']=uuid['v4']();this[_0x3c42('0x5')]=_0x4c94ff;this[_0x3c42('0x6')]=_0x212d37;this[_0x3c42('0x7')]=_0x13d988;this[_0x3c42('0x4')]=_0x2f1f8b;this[_0x3c42('0x5')][_0x3c42('0x8')](this[_0x3c42('0x9')][_0x3c42('0xa')](this),this['handleTimeout'][_0x3c42('0xa')](this));this['squeue']['on']('timeout',this[_0x3c42('0xb')][_0x3c42('0xa')](this));this[_0x3c42('0x5')]['on'](_0x3c42('0xc'),this[_0x3c42('0xd')][_0x3c42('0xa')](this));};Beepall[_0x3c42('0xe')][_0x3c42('0x8')]=function(){this['squeue'][_0x3c42('0x8')](this[_0x3c42('0x9')][_0x3c42('0xa')](this),this[_0x3c42('0xb')][_0x3c42('0xa')](this));};Beepall['prototype'][_0x3c42('0xd')]=function(){this['handleTimeout'](!![]);};Beepall[_0x3c42('0xe')][_0x3c42('0x9')]=function(){var _0x475d11=!![];if(!_['isNil'](this[_0x3c42('0x6')])&&!_[_0x3c42('0xf')](this['queue']['Agents'])&&this[_0x3c42('0x6')]['Agents'][_0x3c42('0x10')]>0x0){for(var _0x493913=0x0,_0x2cc6d7;_0x4939130x0){for(var _0x25a0dd=0x0,_0x5cf121;_0x25a0dd0x0&&_0xe227a[_0x40de25+_0xc207('0x22')]>=_0xe227a[_0x40de25+_0xc207('0x21')]){writeLog(_0x3112ff,_0xe227a,_0x40de25[_0xc207('0x23')]()+_0xc207('0x24'));return![];}}return!![];};exports[_0xc207('0x25')]=function(_0x1445d3,_0x56a066,_0x1e1440,_0x5e0bd1,_0x4cb3af){return sendNotification(!![],_0x1445d3,_0x56a066,_0x1e1440,_0x5e0bd1,_0x4cb3af);};exports[_0xc207('0x26')]=function(_0x3a05f3,_0x2e41b1,_0x2057ff,_0x6a653d,_0x478af7){return sendNotification(![],_0x3a05f3,_0x2e41b1,_0x2057ff,_0x6a653d,_0x478af7);};exports[_0xc207('0x27')]=writeLog; \ No newline at end of file +var _0xf494=['toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','message','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf494,0x1c6));var _0x4f49=function(_0x41fff1,_0x2db613){_0x41fff1=_0x41fff1-0x0;var _0x2cc318=_0xf494[_0x41fff1];return _0x2cc318;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var utils=require(_0x4f49('0x2'));var Redis=require('ioredis');var config=require(_0x4f49('0x3'));var logger=require(_0x4f49('0x4'))(_0x4f49('0x5'));config[_0x4f49('0x6')]=_[_0x4f49('0x7')](config[_0x4f49('0x6')],{'host':_0x4f49('0x8'),'port':0x18eb});var io=require(_0x4f49('0x9'))(new Redis(config[_0x4f49('0x6')]));function sendNotification(_0x413530,_0x42b0e8,_0x5eb186,_0x58e9a0,_0x169c95,_0x327bd5){io['to'](util[_0x4f49('0xa')](_0x4f49('0xb'),_0x58e9a0[_0x4f49('0xc')]))[_0x4f49('0xd')](_0x4f49('0xe'),_0x58e9a0);var _0x410884=_0x327bd5||{};var _0x53ee74=_0x5eb186[_0x4f49('0xf')]('.');var _0x411759={'uniqueid':_0x42b0e8,'channel':_0x53ee74[0x0],'id':_0x53ee74[0x1],'title':_0x53ee74[0x0]+'\x20interaction','interactionId':_0x53ee74[0x2],'queue':_0x169c95?_0x169c95[_0x4f49('0xc')]:null,'sound':_0x410884['account']['notificationSound'],'shake':_0x410884[_0x4f49('0x10')][_0x4f49('0x11')]};try{if(!_0x410884['body']){_0x410884[_0x4f49('0x12')]={};}if(_0x169c95){_0x410884[_0x4f49('0x12')][_0x4f49('0x13')]=_0x169c95;}else if(_0x410884[_0x4f49('0x12')][_0x4f49('0x13')]){delete _0x410884[_0x4f49('0x12')][_0x4f49('0x13')];}_0x411759['msg']=utils[_0x4f49('0x14')](_0x410884[_0x4f49('0x10')][_0x4f49('0x15')],_0x410884);}catch(_0x5878f4){_0x411759['msg']=_0x4f49('0x16');logger[_0x4f49('0x17')](util[_0x4f49('0xa')]('[%s][QUEUE]\x20%s',_0x42b0e8,_0x5878f4[_0x4f49('0x18')]));}io['to'](util[_0x4f49('0xa')](_0x4f49('0xb'),_0x58e9a0['name']))['emit'](util['format']('notification:%s',_0x413530?_0x4f49('0x19'):_0x4f49('0x1a')),_0x411759);}function writeLog(_0x1c2d70,_0x407042,_0x5793ac){return logger[_0x4f49('0x1b')](util[_0x4f49('0xa')](_0x4f49('0x1c'),_0x1c2d70,_0x407042[_0x4f49('0xc')],_0x5793ac));}exports[_0x4f49('0x1d')]=function(_0x509f7c,_0x3e7e28,_0x357446,_0x3ae590){if(_0x3e7e28['busy']){writeLog(_0x509f7c,_0x3e7e28,_0x4f49('0x1e'));return![];}if(!_0x3e7e28[_0x4f49('0x1f')]){writeLog(_0x509f7c,_0x3e7e28,_0x4f49('0x20'));return![];}if(_0x3e7e28[_0x357446+_0x4f49('0x21')]){writeLog(_0x509f7c,_0x3e7e28,_0x4f49('0x22'));return![];}if(_0x3ae590&&_0x3e7e28[_0x4f49('0x23')](_0x357446+'Capacity')&&_0x3e7e28['hasOwnProperty'](_0x357446+_0x4f49('0x24'))){if(_0x3e7e28[_0x357446+_0x4f49('0x25')]>0x0&&_0x3e7e28[_0x357446+'CurrentCapacity']>=_0x3e7e28[_0x357446+_0x4f49('0x25')]){writeLog(_0x509f7c,_0x3e7e28,_0x357446[_0x4f49('0x26')]()+_0x4f49('0x27'));return![];}}return!![];};exports['showNotification']=function(_0xc54070,_0x2eed1c,_0x298785,_0x148153,_0xfefbab){return sendNotification(!![],_0xc54070,_0x2eed1c,_0x298785,_0x148153,_0xfefbab);};exports[_0x4f49('0x28')]=function(_0x4915af,_0x50c571,_0x239f44,_0x2c00ee,_0x605c91){return sendNotification(![],_0x4915af,_0x50c571,_0x239f44,_0x2c00ee,_0x605c91);};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 3b66e9a..981e56d 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 _0x8120=['error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x8120,0x152));var _0x0812=function(_0x3d7c64,_0x570b2b){_0x3d7c64=_0x3d7c64-0x0;var _0x2bfc85=_0x8120[_0x3d7c64];return _0x2bfc85;};'use strict';var schema=require(_0x0812('0x0'));var sh=require(_0x0812('0x1'));var _=require(_0x0812('0x2'));var utils=require('./utils');var logger=require(_0x0812('0x3'))('routing');var system=schema({'command':{'type':_0x0812('0x4'),'required':!![],'message':_0x0812('0x5')}});exports[_0x0812('0x6')]=function(_0x38130b,_0x3fee4f){return function(_0x5e75fb){try{var _0x8ba91a={'command':_0x3fee4f[0x0]};var _0x37f424=system['validate'](_0x8ba91a,{'typecast':!![]});if(_0x37f424['length']){logger[_0x0812('0x7')](_0x0812('0x8'),_0x38130b,_['map'](_0x37f424,_0x0812('0x9'))[_0x0812('0xa')](',\x20'));logger[_0x0812('0xb')](_0x0812('0xc'),_0x38130b);_0x5e75fb[_0x0812('0xd')]();}else{var _0x363f39=this;var _0x1376aa=utils[_0x0812('0xe')](_0x3fee4f[0x0],this);logger[_0x0812('0xb')](_0x0812('0xf'),_0x38130b,_0x1376aa);sh['exec'](_[_0x0812('0x10')](_0x1376aa),function(_0x21488d,_0x3e36a4){logger[_0x0812('0xb')](_0x0812('0x11'),_0x38130b,_0x21488d);if(_0x21488d==0x0){var _0x204b59=_0x3e36a4[_0x0812('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x0812('0x13')](_0x3fee4f[0x1])||_[_0x0812('0x14')](_0x3fee4f[0x1])){logger[_0x0812('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x38130b);_0x363f39[_0x0812('0x15')][_0x3fee4f[0x1]]=_0x204b59;}else{logger[_0x0812('0xb')](_0x0812('0x16'),_0x38130b,_0x3fee4f[0x1],_0x204b59);_0x363f39['body'][_0x3fee4f[0x1]]=_0x204b59;}}_0x5e75fb[_0x0812('0xd')]();});}}catch(_0x314a3a){logger[_0x0812('0x7')](_0x0812('0x8'),_0x38130b,_['isObject'](_0x314a3a)?JSON['stringify'](_0x314a3a):_0x314a3a);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x38130b);_0x5e75fb['next']();}};}; \ No newline at end of file +var _0x4978=['map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x380186,_0x15b3d3){var _0x2580da=function(_0x5c7f9c){while(--_0x5c7f9c){_0x380186['push'](_0x380186['shift']());}};_0x2580da(++_0x15b3d3);}(_0x4978,0x186));var _0x8497=function(_0x46d43f,_0x16ec5e){_0x46d43f=_0x46d43f-0x0;var _0x21d4c0=_0x4978[_0x46d43f];return _0x21d4c0;};'use strict';var schema=require(_0x8497('0x0'));var sh=require(_0x8497('0x1'));var _=require(_0x8497('0x2'));var utils=require(_0x8497('0x3'));var logger=require(_0x8497('0x4'))('routing');var system=schema({'command':{'type':_0x8497('0x5'),'required':!![],'message':_0x8497('0x6')}});exports[_0x8497('0x7')]=function(_0x4c21ea,_0x130c25){return function(_0x57c648){try{var _0x2849a1={'command':_0x130c25[0x0]};var _0x3bc835=system[_0x8497('0x0')](_0x2849a1,{'typecast':!![]});if(_0x3bc835[_0x8497('0x8')]){logger[_0x8497('0x9')]('[%s][SYSTEM]\x20%s',_0x4c21ea,_[_0x8497('0xa')](_0x3bc835,'message')[_0x8497('0xb')](',\x20'));logger[_0x8497('0xc')](_0x8497('0xd'),_0x4c21ea);_0x57c648[_0x8497('0xe')]();}else{var _0x53983f=this;var _0x2268e8=utils[_0x8497('0xf')](_0x130c25[0x0],this);logger['info'](_0x8497('0x10'),_0x4c21ea,_0x2268e8);sh['exec'](_[_0x8497('0x11')](_0x2268e8),function(_0x3c6af9,_0x9c584e){logger[_0x8497('0xc')](_0x8497('0x12'),_0x4c21ea,_0x3c6af9);if(_0x3c6af9==0x0){var _0x584437=_0x9c584e['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x130c25[0x1])||_[_0x8497('0x13')](_0x130c25[0x1])){logger[_0x8497('0xc')](_0x8497('0x14'),_0x4c21ea);_0x53983f['body'][_0x130c25[0x1]]=_0x584437;}else{logger[_0x8497('0xc')](_0x8497('0x15'),_0x4c21ea,_0x130c25[0x1],_0x584437);_0x53983f[_0x8497('0x16')][_0x130c25[0x1]]=_0x584437;}}_0x57c648[_0x8497('0xe')]();});}}catch(_0x4325dd){logger['error']('[%s][SYSTEM]\x20%s',_0x4c21ea,_[_0x8497('0x17')](_0x4325dd)?JSON[_0x8497('0x18')](_0x4325dd):_0x4325dd);logger[_0x8497('0xc')](_0x8497('0xd'),_0x4c21ea);_0x57c648[_0x8497('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 37d5914..86bf14b 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 _0x44bc=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','info','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then'];(function(_0x1d2efa,_0x5a721d){var _0x2dd53c=function(_0x420abd){while(--_0x420abd){_0x1d2efa['push'](_0x1d2efa['shift']());}};_0x2dd53c(++_0x5a721d);}(_0x44bc,0x18c));var _0xc44b=function(_0x29f2c3,_0x59605d){_0x29f2c3=_0x29f2c3-0x0;var _0x1f58a3=_0x44bc[_0x29f2c3];return _0x1f58a3;};'use strict';var schema=require(_0xc44b('0x0'));var _=require(_0xc44b('0x1'));var rpc={'chatInteraction':require(_0xc44b('0x2')),'openchannelInteraction':require(_0xc44b('0x3')),'smsInteraction':require(_0xc44b('0x4')),'mailInteraction':require(_0xc44b('0x5')),'faxInteraction':require(_0xc44b('0x6')),'whatsappInteraction':require(_0xc44b('0x7'))};var logger=require(_0xc44b('0x8'))(_0xc44b('0x9'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xc44b('0xa')}});exports[_0xc44b('0xb')]=function(_0x2209ea,_0x5a8e69,_0x47b3a3,_0x3a105d){return function(_0x142b42){try{var _0x5d350b={'tag':_0x5a8e69[0x0]};var _0x203e98=tag['validate'](_0x5d350b,{'typecast':!![]});if(_0x203e98[_0xc44b('0xc')]){logger[_0xc44b('0xd')](_0xc44b('0xe'),_0x2209ea,_[_0xc44b('0xf')](_0x203e98,_0xc44b('0x10'))[_0xc44b('0x11')](',\x20'));logger['info'](_0xc44b('0x12'),_0x2209ea);_0x142b42[_0xc44b('0x13')]();}else{var _0x24174b={'ids':[_0x5a8e69[0x0]]};if(rpc[_0x3a105d[_0xc44b('0x14')]+_0xc44b('0x15')]){rpc[_0x3a105d[_0xc44b('0x14')]+_0xc44b('0x15')][_0xc44b('0x16')](_0x3a105d['interaction']['id'],_0x24174b)[_0xc44b('0x17')](function(_0x5b8634){logger['info'](_0xc44b('0x18'),_0x2209ea,_0x5a8e69[0x1],_0x3a105d[_0xc44b('0x14')],_0x3a105d[_0xc44b('0x19')]['id']);})[_0xc44b('0x1a')](function(_0x2a1e0a){logger[_0xc44b('0xd')](_0xc44b('0xe'),_0x2209ea,JSON[_0xc44b('0x1b')](_0x2a1e0a));logger[_0xc44b('0x1c')](_0xc44b('0x12'),_0x2209ea);})['finally'](function(){_0x142b42[_0xc44b('0x13')]();});}}}catch(_0x25883d){logger[_0xc44b('0xd')](_0xc44b('0xe'),_0x2209ea,_[_0xc44b('0x1d')](_0x25883d)?JSON['stringify'](_0x25883d):_0x25883d);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2209ea);_0x142b42[_0xc44b('0x13')]();}};}; \ No newline at end of file +var _0xcce6=['../../../../config/logger','routing','number','consequence','length','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','error','validate','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction'];(function(_0x56a4d1,_0x2afa73){var _0x36be8a=function(_0x460d75){while(--_0x460d75){_0x56a4d1['push'](_0x56a4d1['shift']());}};_0x36be8a(++_0x2afa73);}(_0xcce6,0x16b));var _0x6cce=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0xcce6[_0x478c8a];return _0x3b6b3e;};'use strict';var schema=require(_0x6cce('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6cce('0x1')),'smsInteraction':require(_0x6cce('0x2')),'mailInteraction':require(_0x6cce('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x6cce('0x4'))};var logger=require(_0x6cce('0x5'))(_0x6cce('0x6'));var tag=schema({'tag':{'type':_0x6cce('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x6cce('0x8')]=function(_0xfa29cf,_0x3e37a1,_0x19d165,_0x5baf9f){return function(_0x826436){try{var _0x27ae5e={'tag':_0x3e37a1[0x0]};var _0x23da80=tag[_0x6cce('0x0')](_0x27ae5e,{'typecast':!![]});if(_0x23da80[_0x6cce('0x9')]){logger['error'](_0x6cce('0xa'),_0xfa29cf,_[_0x6cce('0xb')](_0x23da80,'message')[_0x6cce('0xc')](',\x20'));logger[_0x6cce('0xd')](_0x6cce('0xe'),_0xfa29cf);_0x826436[_0x6cce('0xf')]();}else{var _0x13a91e={'ids':[_0x3e37a1[0x0]]};if(rpc[_0x5baf9f['channel']+_0x6cce('0x10')]){rpc[_0x5baf9f[_0x6cce('0x11')]+_0x6cce('0x10')]['addTags'](_0x5baf9f[_0x6cce('0x12')]['id'],_0x13a91e)['then'](function(_0x3f67ec){logger[_0x6cce('0xd')](_0x6cce('0x13'),_0xfa29cf,_0x3e37a1[0x1],_0x5baf9f[_0x6cce('0x11')],_0x5baf9f[_0x6cce('0x12')]['id']);})[_0x6cce('0x14')](function(_0x33ab8e){logger['error'](_0x6cce('0xa'),_0xfa29cf,JSON[_0x6cce('0x15')](_0x33ab8e));logger[_0x6cce('0xd')](_0x6cce('0xe'),_0xfa29cf);})['finally'](function(){_0x826436[_0x6cce('0xf')]();});}}}catch(_0x93adcb){logger[_0x6cce('0x16')](_0x6cce('0xa'),_0xfa29cf,_['isObject'](_0x93adcb)?JSON[_0x6cce('0x15')](_0x93adcb):_0x93adcb);logger[_0x6cce('0xd')](_0x6cce('0xe'),_0xfa29cf);_0x826436['next']();}};}; \ 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 ac23a2a..c6c5b6e 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 _0xd7b1=['replace','includes','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','login','push','stringify','utf8','POST','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','isObject','lodash','\x20-\x20'];(function(_0x9c7185,_0x2afe09){var _0x3a946a=function(_0x3a2f06){while(--_0x3a2f06){_0x9c7185['push'](_0x9c7185['shift']());}};_0x3a946a(++_0x2afe09);}(_0xd7b1,0x1be));var _0x1d7b=function(_0x32671b,_0x3cef97){_0x32671b=_0x32671b-0x0;var _0x3b048f=_0xd7b1[_0x32671b];return _0x3b048f;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')('routing');var _=require(_0x1d7b('0x0'));var arr=[];exports['consequence']=function(_0x26953a,_0x5be9be){return function(_0xf14db5){var _0x3b0a25=_0x5be9be[0xa];var _0x5f4a41=_0x5be9be[0xb];var _0x28320b=_0x5be9be[0xc];var _0x18d1dc=_0x5be9be[0xd];var _0x5210a9=_0x5be9be[0xe];var _0x4cc850=_0x5be9be[0xf]['replace'](/\n/g,_0x1d7b('0x1'));var _0x4e453f=_0x5be9be[0x10][_0x1d7b('0x2')](/\n/g,'\x20');if(!arr[_0x1d7b('0x3')](_0x5f4a41)){arr['push'](_0x5f4a41);var _0x292bc9=_0x5be9be[0x3];var _0x56d9b9=_0x5be9be[0x4];var _0x41f9e8=_0x5be9be[0x1];var _0x2c9beb=_0x5be9be[0x0];var _0x249bd3={};_0x249bd3[_0x1d7b('0x4')]=_0x5be9be[0x8]+'?params='+_0x28320b+'|'+_0x3b0a25+'|'+_0x18d1dc+'|'+_0x5f4a41+'|'+_0x5210a9;_0x249bd3[_0x1d7b('0x5')]=_0x5be9be[0x7]+_0x1d7b('0x6')+_0x28320b+'|'+_0x3b0a25+'|'+_0x18d1dc+'|'+_0x5f4a41+'|'+_0x5210a9+'|'+_0x4cc850+'|'+_0x4e453f;_0x249bd3[_0x1d7b('0x7')]=_0x5be9be[0x9];var _0x2cd924={};_0x2cd924[_0x1d7b('0x8')]='2.0';_0x2cd924['method']=_0x1d7b('0x9');var _0x41bcb0=[];_0x41bcb0[_0x1d7b('0xa')](_0x5be9be[0x2]);_0x41bcb0['push'](_0x5be9be[0x5]);_0x41bcb0[_0x1d7b('0xa')](_0x5be9be[0x6]);_0x2cd924['params']=_0x41bcb0;_0x2cd924['id']=0x1;var _0x322c73=JSON[_0x1d7b('0xb')](_0x2cd924);var _0x1453cc={'encoding':_0x1d7b('0xc'),'method':_0x1d7b('0xd'),'timeout':0x2710,'url':_0x292bc9,'headers':{'Content-Type':_0x1d7b('0xe')},'body':_0x322c73};return rp(_0x1453cc)['then'](function(_0x1974f9){const _0x26a0a1=JSON[_0x1d7b('0xf')](_0x1974f9);if(!_0x26a0a1[_0x1d7b('0x10')][_0x1d7b('0x11')]){throw new Error(_0x1d7b('0x12'));}var _0x21a79a=_0x5f4a41;var _0x4184ec=_0x1d7b('0x13')+_0x41f9e8+_0x1d7b('0x14')+_0x2c9beb+_0x1d7b('0x15')+_0x21a79a+_0x1d7b('0x16')+JSON[_0x1d7b('0xb')](_0x249bd3);var _0x51f09c=_0x56d9b9+'?'+_0x4184ec;return rp(_0x51f09c);})['then'](function(_0x2dedfd){logger[_0x1d7b('0x17')](_0x1d7b('0x18'),_0x26953a,_0x2dedfd);_0xf14db5[_0x1d7b('0x19')]();})[_0x1d7b('0x1a')](function(_0x5339f1){logger['error']('[%s][TVOX]\x20%s',_0x26953a,_[_0x1d7b('0x1b')](_0x5339f1)?JSON[_0x1d7b('0xb')](_0x5339f1):_0x5339f1);_0xf14db5[_0x1d7b('0x19')]();});}else{logger[_0x1d7b('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x26953a);_0xf14db5['next']();}};}; \ No newline at end of file +var _0xcde3=['then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','replace','includes','push','?params=','urlOnRing','title','2.0','method','login','params','utf8','POST','application/json-rpc'];(function(_0x59ea2e,_0x10a0af){var _0x364d17=function(_0x192824){while(--_0x192824){_0x59ea2e['push'](_0x59ea2e['shift']());}};_0x364d17(++_0x10a0af);}(_0xcde3,0xcb));var _0x3cde=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0xcde3[_0x450689];return _0x46ffb0;};'use strict';var rp=require('request-promise');var logger=require(_0x3cde('0x0'))('routing');var _=require('lodash');var arr=[];exports['consequence']=function(_0x4f2a33,_0x4c45d2){return function(_0x420d13){var _0x29ace5=_0x4c45d2[0xa];var _0x144561=_0x4c45d2[0xb];var _0xda8fda=_0x4c45d2[0xc];var _0x51eb50=_0x4c45d2[0xd];var _0x8f4c31=_0x4c45d2[0xe];var _0x26d7bd=_0x4c45d2[0xf][_0x3cde('0x1')](/\n/g,'\x20-\x20');var _0x24ee47=_0x4c45d2[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x3cde('0x2')](_0x144561)){arr[_0x3cde('0x3')](_0x144561);var _0x3f634f=_0x4c45d2[0x3];var _0x3d0a9f=_0x4c45d2[0x4];var _0x460fe0=_0x4c45d2[0x1];var _0x2d3860=_0x4c45d2[0x0];var _0x2ec948={};_0x2ec948['urlOnAnswer']=_0x4c45d2[0x8]+_0x3cde('0x4')+_0xda8fda+'|'+_0x29ace5+'|'+_0x51eb50+'|'+_0x144561+'|'+_0x8f4c31;_0x2ec948[_0x3cde('0x5')]=_0x4c45d2[0x7]+'?params='+_0xda8fda+'|'+_0x29ace5+'|'+_0x51eb50+'|'+_0x144561+'|'+_0x8f4c31+'|'+_0x26d7bd+'|'+_0x24ee47;_0x2ec948[_0x3cde('0x6')]=_0x4c45d2[0x9];var _0x4b3e5c={};_0x4b3e5c['jsonrpc']=_0x3cde('0x7');_0x4b3e5c[_0x3cde('0x8')]=_0x3cde('0x9');var _0x30348c=[];_0x30348c[_0x3cde('0x3')](_0x4c45d2[0x2]);_0x30348c[_0x3cde('0x3')](_0x4c45d2[0x5]);_0x30348c[_0x3cde('0x3')](_0x4c45d2[0x6]);_0x4b3e5c[_0x3cde('0xa')]=_0x30348c;_0x4b3e5c['id']=0x1;var _0x106ca1=JSON['stringify'](_0x4b3e5c);var _0x269786={'encoding':_0x3cde('0xb'),'method':_0x3cde('0xc'),'timeout':0x2710,'url':_0x3f634f,'headers':{'Content-Type':_0x3cde('0xd')},'body':_0x106ca1};return rp(_0x269786)[_0x3cde('0xe')](function(_0x197daa){const _0x1409c6=JSON[_0x3cde('0xf')](_0x197daa);if(!_0x1409c6[_0x3cde('0x10')][_0x3cde('0x11')]){throw new Error(_0x3cde('0x12'));}var _0x113a1d=_0x144561;var _0x2c18bf=_0x3cde('0x13')+_0x460fe0+'&serviceId='+_0x2d3860+_0x3cde('0x14')+_0x113a1d+_0x3cde('0x15')+JSON[_0x3cde('0x16')](_0x2ec948);var _0x366b65=_0x3d0a9f+'?'+_0x2c18bf;return rp(_0x366b65);})[_0x3cde('0xe')](function(_0x10a22a){logger[_0x3cde('0x17')](_0x3cde('0x18'),_0x4f2a33,_0x10a22a);_0x420d13[_0x3cde('0x19')]();})[_0x3cde('0x1a')](function(_0x5b406a){logger[_0x3cde('0x1b')]('[%s][TVOX]\x20%s',_0x4f2a33,_[_0x3cde('0x1c')](_0x5b406a)?JSON[_0x3cde('0x16')](_0x5b406a):_0x5b406a);_0x420d13[_0x3cde('0x19')]();});}else{logger[_0x3cde('0x17')](_0x3cde('0x1d'),_0x4f2a33);_0x420d13[_0x3cde('0x1e')]();}};}; \ 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 75c4474..6bfe5b2 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(_0x590e0e,_0x170fca){var _0x3fca09=function(_0x2ed8ce){while(--_0x2ed8ce){_0x590e0e['push'](_0x590e0e['shift']());}};_0x3fca09(++_0x170fca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x31001a,_0x53559a){var _0x17c80a=function(_0x5d192a){while(--_0x5d192a){_0x31001a['push'](_0x31001a['shift']());}};_0x17c80a(++_0x53559a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 3c0e7bb..c7e3a34 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 _0xb43b=['../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','tag','TagId','tvox','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport'];(function(_0x1d1fb4,_0x4b0565){var _0x443c49=function(_0x4a3856){while(--_0x4a3856){_0x1d1fb4['push'](_0x1d1fb4['shift']());}};_0x443c49(++_0x4b0565);}(_0xb43b,0xbf));var _0xbb43=function(_0x22bfbc,_0x3b80d5){_0x22bfbc=_0x22bfbc-0x0;var _0x2c3f46=_0xb43b[_0x22bfbc];return _0x2c3f46;};'use strict';var _=require(_0xbb43('0x0'));var util=require('util');var path=require(_0xbb43('0x1'));var fs=require('fs');var jayson=require(_0xbb43('0x2'));var BPromise=require(_0xbb43('0x3'));var utils=require(_0xbb43('0x4'));var logger=require(_0xbb43('0x5'))(_0xbb43('0x6'));var rpc={'openchannelQueueReport':require(_0xbb43('0x7')),'mailQueueReport':require(_0xbb43('0x8')),'chatQueueReport':require(_0xbb43('0x9')),'smsQueueReport':require(_0xbb43('0xa')),'faxQueueReport':require(_0xbb43('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xbb43('0xc'));function getId(_0x4a070c,_0x54806a,_0x33f9a8){return util[_0xbb43('0xd')](_0xbb43('0xe'),_0x4a070c,_0x54806a||0x0,_0x33f9a8||0x0);}function getIntervals(_0x2239d8,_0x117f4d){var _0x5a1231=[];if(!_[_0xbb43('0xf')](_0x117f4d[_0xbb43('0x10')])&&!_[_0xbb43('0xf')](_0x2239d8[_0x117f4d[_0xbb43('0x10')]])&&!_['isNil'](_0x2239d8[_0x117f4d[_0xbb43('0x10')]][_0xbb43('0x11')])){_0x5a1231=_['map'](_0x2239d8[_0x117f4d['IntervalId']]['Intervals'],_0xbb43('0x12'));}else if(!_['isNil'](_0x117f4d[_0xbb43('0x12')])){_0x5a1231=[_0x117f4d['interval']];}return _0x5a1231;}exports[_0xbb43('0x13')]=function(_0x217a4e){_0x217a4e[_0xbb43('0x14')]={};return new BPromise(function(_0x3327bc,_0x2e2517){var _0x4f16d7={'Start':function(_0x2fdfd9){var _0x4ac25c=this;return new Promise(function(_0x199726,_0x32425c){if(_0x2fdfd9){try{var _0x15182b=[];var _0x10c91b=getId(_0x2fdfd9[_0xbb43('0x15')],_0x2fdfd9[_0xbb43('0x16')]?_0x2fdfd9[_0xbb43('0x16')]['id']:0x0,_0x2fdfd9[_0xbb43('0x17')]?_0x2fdfd9[_0xbb43('0x17')]['id']:0x0);if(_0x2fdfd9[_0xbb43('0x18')]&&_[_0xbb43('0x19')](_0x2fdfd9['applications'])&&_0x2fdfd9[_0xbb43('0x18')]['length']){for(var _0x44fd04=0x0;_0x44fd04<_0x2fdfd9[_0xbb43('0x18')][_0xbb43('0x1a')];_0x44fd04+=0x1){var _0x27579a=_0x2fdfd9['applications'][_0x44fd04];if(fs[_0xbb43('0x1b')](path[_0xbb43('0x1c')](__dirname,_0xbb43('0x18'),_0x27579a[_0xbb43('0x1d')]+_0xbb43('0x1e')))){var _0x57fc97=[];switch(_0x27579a[_0xbb43('0x1d')][_0xbb43('0x1f')]()){case _0xbb43('0x20'):var _0x3cb6d1=_0x27579a[_0xbb43('0x21')][_0xbb43('0x22')](',');if(_0x2fdfd9[_0xbb43('0x15')]===_0xbb43('0x23')){_0x57fc97['push'](_0x3cb6d1[0x0]);_0x57fc97[_0xbb43('0x24')](_0x3cb6d1[0x1]);_0x57fc97[_0xbb43('0x24')](_0x3cb6d1['slice'](0x2,_0x3cb6d1[_0xbb43('0x1a')])[_0xbb43('0x1c')](','));}else{_0x57fc97[_0xbb43('0x24')](_0x3cb6d1[0x0]);_0x57fc97['push'](_0x3cb6d1['slice'](0x1,_0x3cb6d1[_0xbb43('0x1a')])[_0xbb43('0x1c')](','));}break;case'dialogflow':var _0x48ef60=_0x27579a[_0xbb43('0x21')][_0xbb43('0x22')](',');_0x57fc97[_0xbb43('0x24')](_0x48ef60[0x0]);_0x57fc97[_0xbb43('0x24')](_0x48ef60[0x1]);_0x57fc97[_0xbb43('0x24')](_0x48ef60[_0xbb43('0x25')](0x2,_0x48ef60[_0xbb43('0x1a')])[_0xbb43('0x1c')](','));break;case'dialogflowv2':var _0x2a4766=_0x27579a[_0xbb43('0x21')][_0xbb43('0x22')](',');_0x57fc97[_0xbb43('0x24')](_0x2a4766[0x0]);_0x57fc97[_0xbb43('0x24')](_0x2a4766[0x1]);_0x57fc97[_0xbb43('0x24')](_0x2a4766[0x2]);_0x57fc97[_0xbb43('0x24')](_0x2a4766[0x3]);_0x57fc97['push'](_0x2a4766[_0xbb43('0x25')](0x4,_0x2a4766[_0xbb43('0x1a')])[_0xbb43('0x1c')](','));break;case'amazonlex':var _0x359b25=_0x27579a[_0xbb43('0x21')][_0xbb43('0x22')](',');_0x57fc97[_0xbb43('0x24')](_0x359b25[0x0]);_0x57fc97[_0xbb43('0x24')](_0x359b25[0x1]);_0x57fc97[_0xbb43('0x24')](_0x359b25[0x2]);_0x57fc97[_0xbb43('0x24')](_0x359b25[0x3]);_0x57fc97[_0xbb43('0x24')](_0x359b25[_0xbb43('0x25')](0x4,_0x359b25['length'])['join'](','));break;case'message':_0x57fc97['push'](_0x27579a[_0xbb43('0x21')]);break;case _0xbb43('0x26'):_0x57fc97[_0xbb43('0x24')](_0x27579a[_0xbb43('0x27')]);_0x57fc97[_0xbb43('0x24')](_0x27579a[_0xbb43('0x21')]);break;case _0xbb43('0x28'):var _0x3082b3=utils['getMustacheRender'](_0x2fdfd9[_0xbb43('0x29')][_0xbb43('0x2a')],_0x2fdfd9);var _0x418b2a=_0x27579a[_0xbb43('0x21')]['split'](',');_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x0]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x1]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x2]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x3]);_0x57fc97['push'](_0x418b2a[0x4]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x5]);_0x57fc97['push'](_0x418b2a[0x6]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x7]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x8]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0x9]);_0x57fc97[_0xbb43('0x24')](_0x418b2a[0xa]);_0x57fc97[_0xbb43('0x24')](_0x2fdfd9[_0xbb43('0x17')]['id']);_0x57fc97[_0xbb43('0x24')](_0x2fdfd9[_0xbb43('0x16')]['id']);_0x57fc97[_0xbb43('0x24')](_0x27579a[_0xbb43('0x2b')]);_0x57fc97[_0xbb43('0x24')](_0x2fdfd9[_0xbb43('0x17')]['ContactId']);_0x57fc97[_0xbb43('0x24')](_0x2fdfd9[_0xbb43('0x2c')][_0xbb43('0x2c')]);_0x57fc97[_0xbb43('0x24')](_0x3082b3);break;default:_0x57fc97=_[_0xbb43('0xf')](_0x27579a[_0xbb43('0x21')])?[]:_0x27579a[_0xbb43('0x21')][_0xbb43('0x22')](',');}var _0x92d7cf={'id':util[_0xbb43('0xd')](_0xbb43('0x2d'),_0x10c91b,_0x27579a['id'],_0x27579a[_0xbb43('0x1d')]),'condition':require(_0xbb43('0x2e'))[_0xbb43('0x2f')](_0x10c91b,getIntervals(_0x217a4e[_0xbb43('0x30')],_0x27579a),_0x217a4e),'consequence':require('./applications/'+_0x27579a[_0xbb43('0x1d')])[_0xbb43('0x31')](_0x10c91b,_0x57fc97,_0x217a4e,_0x2fdfd9),'p':_0x27579a[_0xbb43('0x32')]||0x0};logger[_0xbb43('0x33')](_0xbb43('0x34'),_0x92d7cf['id'],_0xbb43('0x35'),getIntervals(_0x217a4e['intervals'],_0x27579a)[_0xbb43('0x1c')](_0xbb43('0x36')));_0x15182b['push'](_0x92d7cf);}else{logger['error'](_0xbb43('0x37'),path[_0xbb43('0x1c')](__dirname,_0xbb43('0x18'),_0x27579a[_0xbb43('0x1d')]+_0xbb43('0x1e')));}}_0x217a4e['rules'][_0x10c91b]=new RuleEngine(_0x15182b);_0x217a4e['rules'][_0x10c91b][_0xbb43('0x38')](_0x2fdfd9,function(_0x41fed6){logger[_0xbb43('0x33')](_0xbb43('0x39'),JSON[_0xbb43('0x3a')](_0x41fed6[_0xbb43('0x3b')]));if(_0x217a4e[_0xbb43('0x14')][_0x10c91b]){_0x217a4e[_0xbb43('0x14')][_0x10c91b][_0xbb43('0x3c')](_0xbb43('0x3d'));}});return _0x199726({'code':0xc8,'message':_0x2fdfd9});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x199726({'code':0xc8,'message':_0x2fdfd9});}}catch(_0x2ca8ad){logger[_0xbb43('0x3e')](_0x2ca8ad['stack']);return _0x32425c(_0x4ac25c[_0xbb43('0x3e')](0x1f4,_0x2ca8ad));}}return _0x32425c(_0xbb43('0x3f'));});},'AcceptMessage':function(_0x68b3b3){var _0x14853f=this;return new Promise(function(_0xb47685,_0x1fcb16){if(_0x68b3b3[_0xbb43('0x40')]&&_0x68b3b3['agent']['id']){if(_0x217a4e[_0xbb43('0x41')][_0x68b3b3[_0xbb43('0x40')]['id']]){_0x217a4e['agents'][_0x68b3b3[_0xbb43('0x40')]['id']][_0xbb43('0x42')]=![];_0x217a4e['agents'][_0x68b3b3[_0xbb43('0x40')]['id']][_0xbb43('0x43')]=undefined;}}if(_0x68b3b3[_0xbb43('0x16')]&&_0x68b3b3[_0xbb43('0x16')]['id']){try{var _0x6fe445=getId(_0x68b3b3[_0xbb43('0x15')],_0x68b3b3[_0xbb43('0x16')]?_0x68b3b3[_0xbb43('0x16')]['id']:0x0,_0x68b3b3[_0xbb43('0x17')]?_0x68b3b3[_0xbb43('0x17')]['id']:0x0);if(_0x217a4e[_0xbb43('0x14')][_0x6fe445]){_0x217a4e[_0xbb43('0x14')][_0x6fe445]['emit'](_0xbb43('0x44'));if(rpc[_0x68b3b3[_0xbb43('0x15')]+_0xbb43('0x45')]){rpc[_0x68b3b3[_0xbb43('0x15')]+'QueueReport'][_0xbb43('0x46')](_0x6fe445,{'UserId':_0x68b3b3['message'][_0xbb43('0x47')]})['catch'](function(){logger[_0xbb43('0x3e')](_0xbb43('0x48'));});}}return _0xb47685({'code':0xc8,'message':_0x68b3b3});}catch(_0x26586c){logger['error'](_0x26586c[_0xbb43('0x49')]);return _0x1fcb16(_0x14853f[_0xbb43('0x3e')](0x1f4,_0x26586c));}}logger[_0xbb43('0x3e')]('message\x20is\x20empty');return _0x1fcb16(_0x14853f[_0xbb43('0x3e')](0x1f4,_0xbb43('0x4a')));});},'RejectMessage':function(_0x4c3830){var _0x42029c=this;return new Promise(function(_0x48828f,_0x28e314){if(_0x4c3830[_0xbb43('0x40')]&&_0x4c3830['agent']['id']){try{if(_0x217a4e[_0xbb43('0x41')][_0x4c3830[_0xbb43('0x40')]['id']]){_0x217a4e[_0xbb43('0x41')][_0x4c3830['agent']['id']][_0xbb43('0x42')]=![];_0x217a4e['agents'][_0x4c3830[_0xbb43('0x40')]['id']][_0xbb43('0x43')]=undefined;}return _0x48828f({'code':0xc8,'message':_0x4c3830});}catch(_0xaf5542){logger['error'](_0xaf5542[_0xbb43('0x49')]);return _0x28e314(_0x42029c[_0xbb43('0x3e')](0x1f4,_0xaf5542));}}logger['error']('message\x20is\x20empty');return _0x28e314(_0x42029c[_0xbb43('0x3e')](0x1f4,_0xbb43('0x4a')));});},'AbandonInteraction':function(_0x5b7b39){var _0x4b839b=this;return new Promise(function(_0x3a319d,_0x51ca4f){if(_0x5b7b39[_0xbb43('0x15')]&&_0x5b7b39[_0xbb43('0x17')]&&_0x5b7b39[_0xbb43('0x17')]['id']){try{var _0x4c8a38=getId(_0x5b7b39['channel'],_0x5b7b39['message']?_0x5b7b39['message']['id']:0x0,_0x5b7b39['interaction']?_0x5b7b39[_0xbb43('0x17')]['id']:0x0);if(_0x217a4e[_0xbb43('0x14')][_0x4c8a38]){_0x217a4e[_0xbb43('0x14')][_0x4c8a38][_0xbb43('0x3c')](_0xbb43('0x44'));}return _0x3a319d({'code':0xc8,'message':_0x5b7b39});}catch(_0x4ad016){logger[_0xbb43('0x3e')](_0x4ad016['stack']);return _0x51ca4f(_0x4b839b[_0xbb43('0x3e')](0x1f4,_0x4ad016));}}logger['error'](_0xbb43('0x4a'));return _0x51ca4f(_0x4b839b[_0xbb43('0x3e')](0x1f4,_0xbb43('0x4a')));});},'AgentCapacity':function(_0x5ffaba){var _0x4c13ad=this;return new Promise(function(_0x380dc3,_0x511e60){if(_0x217a4e[_0xbb43('0x41')][_0xbb43('0x4b')](_0x5ffaba['id'])){for(var _0x512619 in _0x5ffaba[_0xbb43('0x4c')]){if(_0x5ffaba[_0xbb43('0x4c')]['hasOwnProperty'](_0x512619)){if(_0x217a4e[_0xbb43('0x41')][_0x5ffaba['id']][_0xbb43('0x4b')](_0x512619+_0xbb43('0x4d'))){_0x217a4e[_0xbb43('0x41')][_0x5ffaba['id']][_0x512619+_0xbb43('0x4d')]=parseInt(_0x5ffaba[_0xbb43('0x4c')][_0x512619],0xa);}}}_0x217a4e[_0xbb43('0x41')][_0x5ffaba['id']][_0xbb43('0x4e')]();return _0x380dc3({'code':0xc8,'message':_0x217a4e['agents'][_0x5ffaba['id']]});}else{return _0x511e60(_0x4c13ad[_0xbb43('0x3e')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x36a69b){return new Promise(function(_0x2e70bf){var _0x5e5530=_[_0xbb43('0x4f')](_0x217a4e[_0xbb43('0x41')]);if(_0x36a69b&&_0x36a69b['id']){var _0x24114c=_[_0xbb43('0x50')](_0x5e5530,function(_0x36109f){return _0x36109f['id']===_0x36a69b['id'];});_0x2e70bf(_0x24114c);}else{_0x2e70bf({'count':_0x5e5530[_0xbb43('0x1a')],'rows':_0x5e5530});}});},'ChatQueues':function(){return new Promise(function(_0x1233ba){var _0x2274a1=[];for(var _0x4bef87 in _0x217a4e[_0xbb43('0x51')]){if(_0x217a4e[_0xbb43('0x51')][_0xbb43('0x4b')](_0x4bef87)){var _0x200b6f=_0x217a4e['chatQueues'][_0x4bef87];var _0x226f27={'id':_0x200b6f['id'],'available':_0x200b6f['available'],'loggedIn':_0x200b6f[_0xbb43('0x52')],'name':_0x200b6f['name'],'paused':_0x200b6f[_0xbb43('0x53')],'waiting':_0x200b6f[_0xbb43('0x54')]};_0x2274a1[_0xbb43('0x24')](_0x226f27);}}_0x1233ba({'count':_0x2274a1[_0xbb43('0x1a')],'rows':_0x2274a1});});},'MailQueues':function(){return new Promise(function(_0x3b8363){var _0x43468e=[];for(var _0x349699 in _0x217a4e[_0xbb43('0x55')]){if(_0x217a4e[_0xbb43('0x55')][_0xbb43('0x4b')](_0x349699)){var _0x4f65de=_0x217a4e[_0xbb43('0x55')][_0x349699];var _0x5f4dc2={'id':_0x4f65de['id'],'available':_0x4f65de[_0xbb43('0x56')],'loggedIn':_0x4f65de[_0xbb43('0x52')],'name':_0x4f65de[_0xbb43('0x57')],'paused':_0x4f65de[_0xbb43('0x53')],'waiting':_0x4f65de[_0xbb43('0x54')]};_0x43468e[_0xbb43('0x24')](_0x5f4dc2);}}_0x3b8363({'count':_0x43468e[_0xbb43('0x1a')],'rows':_0x43468e});});},'OpenchannelQueues':function(){return new Promise(function(_0x13e02f){var _0x56db5b=[];for(var _0x405665 in _0x217a4e['openchannelQueues']){if(_0x217a4e['openchannelQueues'][_0xbb43('0x4b')](_0x405665)){var _0x4be7f7=_0x217a4e[_0xbb43('0x58')][_0x405665];var _0x212dc9={'id':_0x4be7f7['id'],'available':_0x4be7f7['available'],'loggedIn':_0x4be7f7[_0xbb43('0x52')],'name':_0x4be7f7[_0xbb43('0x57')],'paused':_0x4be7f7['paused'],'waiting':_0x4be7f7[_0xbb43('0x54')]};_0x56db5b[_0xbb43('0x24')](_0x212dc9);}}_0x13e02f({'count':_0x56db5b[_0xbb43('0x1a')],'rows':_0x56db5b});});},'SmsQueues':function(){return new Promise(function(_0x14678c){var _0x40ac8c=[];for(var _0x2b4caa in _0x217a4e[_0xbb43('0x59')]){if(_0x217a4e[_0xbb43('0x59')][_0xbb43('0x4b')](_0x2b4caa)){var _0x28ce3e=_0x217a4e[_0xbb43('0x59')][_0x2b4caa];var _0x40a002={'id':_0x28ce3e['id'],'available':_0x28ce3e[_0xbb43('0x56')],'loggedIn':_0x28ce3e[_0xbb43('0x52')],'name':_0x28ce3e[_0xbb43('0x57')],'paused':_0x28ce3e[_0xbb43('0x53')],'waiting':_0x28ce3e[_0xbb43('0x54')]};_0x40ac8c[_0xbb43('0x24')](_0x40a002);}}_0x14678c({'count':_0x40ac8c[_0xbb43('0x1a')],'rows':_0x40ac8c});});},'FaxQueues':function(){return new Promise(function(_0x21fc9d){var _0x13eb2f=[];for(var _0x1763e6 in _0x217a4e[_0xbb43('0x5a')]){if(_0x217a4e[_0xbb43('0x5a')][_0xbb43('0x4b')](_0x1763e6)){var _0x29360d=_0x217a4e[_0xbb43('0x5a')][_0x1763e6];var _0x3c3fa3={'id':_0x29360d['id'],'available':_0x29360d[_0xbb43('0x56')],'loggedIn':_0x29360d[_0xbb43('0x52')],'name':_0x29360d['name'],'paused':_0x29360d[_0xbb43('0x53')],'waiting':_0x29360d[_0xbb43('0x54')]};_0x13eb2f[_0xbb43('0x24')](_0x3c3fa3);}}_0x21fc9d({'count':_0x13eb2f[_0xbb43('0x1a')],'rows':_0x13eb2f});});},'WhatsappQueues':function(){return new Promise(function(_0x1b66ba){var _0x352373=[];for(var _0x524d47 in _0x217a4e[_0xbb43('0x5b')]){if(_0x217a4e[_0xbb43('0x5b')]['hasOwnProperty'](_0x524d47)){var _0x591432=_0x217a4e['whatsappQueues'][_0x524d47];var _0xb2619e={'id':_0x591432['id'],'available':_0x591432[_0xbb43('0x56')],'loggedIn':_0x591432[_0xbb43('0x52')],'name':_0x591432[_0xbb43('0x57')],'paused':_0x591432['paused'],'waiting':_0x591432['waiting']};_0x352373[_0xbb43('0x24')](_0xb2619e);}}_0x1b66ba({'count':_0x352373['length'],'rows':_0x352373});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x308199){var _0x14f93b=_['values'](_0x217a4e[_0xbb43('0x5c')]);_0x308199({'count':_0x14f93b[_0xbb43('0x1a')],'rows':_0x14f93b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x31ffa0){var _0x4d9dbf=_[_0xbb43('0x4f')](_0x217a4e['mailQueuesWaitingInteractions']);_0x31ffa0({'count':_0x4d9dbf[_0xbb43('0x1a')],'rows':_0x4d9dbf});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3492e6){var _0x4bd0d6=_[_0xbb43('0x4f')](_0x217a4e[_0xbb43('0x5d')]);_0x3492e6({'count':_0x4bd0d6[_0xbb43('0x1a')],'rows':_0x4bd0d6});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x258096){var _0x398e79=_['values'](_0x217a4e['smsQueuesWaitingInteractions']);_0x258096({'count':_0x398e79[_0xbb43('0x1a')],'rows':_0x398e79});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3d2008){var _0x6ecbd7=_[_0xbb43('0x4f')](_0x217a4e[_0xbb43('0x5e')]);_0x3d2008({'count':_0x6ecbd7[_0xbb43('0x1a')],'rows':_0x6ecbd7});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xa4ceaf){var _0xebb8b9=_['values'](_0x217a4e[_0xbb43('0x5f')]);_0xa4ceaf({'count':_0xebb8b9['length'],'rows':_0xebb8b9});});}};var _0x125ced=jayson[_0xbb43('0x60')](_0x4f16d7)['http']();_0x125ced['on'](_0xbb43('0x3e'),function(_0x1ba677){logger[_0xbb43('0x3e')](JSON[_0xbb43('0x3a')](_0x1ba677));return _0x2e2517(_0x1ba677);});_0x125ced[_0xbb43('0x13')](0x232c,_0xbb43('0x61'),function(){console['log'](_0xbb43('0x62'),0x232c);return _0x3327bc(_0xbb43('0x63')+0x232c);});});}; \ No newline at end of file +var _0x3667=['QueueReport','UserId','catch','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','app','toLowerCase','autoreply','appdata','split','mail','push','slice','join','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','./applications/','priority','info','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','No\x20applications\x20to\x20execute','error','stack','agent','agents','busy','busyQueue'];(function(_0x370759,_0x2a28ed){var _0x597c7a=function(_0x6308ec){while(--_0x6308ec){_0x370759['push'](_0x370759['shift']());}};_0x597c7a(++_0x2a28ed);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var path=require(_0x7366('0x2'));var fs=require('fs');var jayson=require(_0x7366('0x3'));var BPromise=require(_0x7366('0x4'));var utils=require('./applications/utils');var logger=require(_0x7366('0x5'))(_0x7366('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7366('0x7')),'chatQueueReport':require(_0x7366('0x8')),'smsQueueReport':require(_0x7366('0x9')),'faxQueueReport':require(_0x7366('0xa')),'whatsappQueueReport':require(_0x7366('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x28f6c8,_0xa1a3c5,_0x2dd32b){return util[_0x7366('0xc')](_0x7366('0xd'),_0x28f6c8,_0xa1a3c5||0x0,_0x2dd32b||0x0);}function getIntervals(_0x108455,_0x1995c7){var _0x417559=[];if(!_[_0x7366('0xe')](_0x1995c7[_0x7366('0xf')])&&!_[_0x7366('0xe')](_0x108455[_0x1995c7[_0x7366('0xf')]])&&!_[_0x7366('0xe')](_0x108455[_0x1995c7[_0x7366('0xf')]][_0x7366('0x10')])){_0x417559=_[_0x7366('0x11')](_0x108455[_0x1995c7[_0x7366('0xf')]][_0x7366('0x10')],_0x7366('0x12'));}else if(!_[_0x7366('0xe')](_0x1995c7[_0x7366('0x12')])){_0x417559=[_0x1995c7[_0x7366('0x12')]];}return _0x417559;}exports[_0x7366('0x13')]=function(_0x44d163){_0x44d163[_0x7366('0x14')]={};return new BPromise(function(_0x27500c,_0x22562f){var _0xf4114={'Start':function(_0x4dd111){var _0x23e763=this;return new Promise(function(_0x308752,_0x338719){if(_0x4dd111){try{var _0x2c0422=[];var _0xe2c87b=getId(_0x4dd111[_0x7366('0x15')],_0x4dd111[_0x7366('0x16')]?_0x4dd111[_0x7366('0x16')]['id']:0x0,_0x4dd111[_0x7366('0x17')]?_0x4dd111[_0x7366('0x17')]['id']:0x0);if(_0x4dd111[_0x7366('0x18')]&&_['isArray'](_0x4dd111[_0x7366('0x18')])&&_0x4dd111['applications'][_0x7366('0x19')]){for(var _0x4acbd3=0x0;_0x4acbd3<_0x4dd111[_0x7366('0x18')]['length'];_0x4acbd3+=0x1){var _0x29f725=_0x4dd111[_0x7366('0x18')][_0x4acbd3];if(fs[_0x7366('0x1a')](path['join'](__dirname,_0x7366('0x18'),_0x29f725[_0x7366('0x1b')]+'.js'))){var _0x3bfbca=[];switch(_0x29f725[_0x7366('0x1b')][_0x7366('0x1c')]()){case _0x7366('0x1d'):var _0x3c30a2=_0x29f725[_0x7366('0x1e')][_0x7366('0x1f')](',');if(_0x4dd111[_0x7366('0x15')]===_0x7366('0x20')){_0x3bfbca[_0x7366('0x21')](_0x3c30a2[0x0]);_0x3bfbca[_0x7366('0x21')](_0x3c30a2[0x1]);_0x3bfbca[_0x7366('0x21')](_0x3c30a2[_0x7366('0x22')](0x2,_0x3c30a2['length'])[_0x7366('0x23')](','));}else{_0x3bfbca['push'](_0x3c30a2[0x0]);_0x3bfbca[_0x7366('0x21')](_0x3c30a2['slice'](0x1,_0x3c30a2['length'])[_0x7366('0x23')](','));}break;case'dialogflow':var _0x254374=_0x29f725['appdata'][_0x7366('0x1f')](',');_0x3bfbca[_0x7366('0x21')](_0x254374[0x0]);_0x3bfbca['push'](_0x254374[0x1]);_0x3bfbca[_0x7366('0x21')](_0x254374['slice'](0x2,_0x254374[_0x7366('0x19')])[_0x7366('0x23')](','));break;case'dialogflowv2':var _0x3cef4a=_0x29f725['appdata'][_0x7366('0x1f')](',');_0x3bfbca[_0x7366('0x21')](_0x3cef4a[0x0]);_0x3bfbca[_0x7366('0x21')](_0x3cef4a[0x1]);_0x3bfbca[_0x7366('0x21')](_0x3cef4a[0x2]);_0x3bfbca[_0x7366('0x21')](_0x3cef4a[0x3]);_0x3bfbca['push'](_0x3cef4a[_0x7366('0x22')](0x4,_0x3cef4a[_0x7366('0x19')])['join'](','));break;case'amazonlex':var _0x592467=_0x29f725['appdata'][_0x7366('0x1f')](',');_0x3bfbca[_0x7366('0x21')](_0x592467[0x0]);_0x3bfbca[_0x7366('0x21')](_0x592467[0x1]);_0x3bfbca[_0x7366('0x21')](_0x592467[0x2]);_0x3bfbca['push'](_0x592467[0x3]);_0x3bfbca[_0x7366('0x21')](_0x592467[_0x7366('0x22')](0x4,_0x592467[_0x7366('0x19')])[_0x7366('0x23')](','));break;case'message':_0x3bfbca[_0x7366('0x21')](_0x29f725[_0x7366('0x1e')]);break;case'tag':_0x3bfbca[_0x7366('0x21')](_0x29f725[_0x7366('0x24')]);_0x3bfbca[_0x7366('0x21')](_0x29f725[_0x7366('0x1e')]);break;case _0x7366('0x25'):var _0x101d2a=utils[_0x7366('0x26')](_0x4dd111[_0x7366('0x27')][_0x7366('0x28')],_0x4dd111);var _0x59dead=_0x29f725[_0x7366('0x1e')][_0x7366('0x1f')](',');_0x3bfbca['push'](_0x59dead[0x0]);_0x3bfbca[_0x7366('0x21')](_0x59dead[0x1]);_0x3bfbca[_0x7366('0x21')](_0x59dead[0x2]);_0x3bfbca[_0x7366('0x21')](_0x59dead[0x3]);_0x3bfbca['push'](_0x59dead[0x4]);_0x3bfbca[_0x7366('0x21')](_0x59dead[0x5]);_0x3bfbca['push'](_0x59dead[0x6]);_0x3bfbca[_0x7366('0x21')](_0x59dead[0x7]);_0x3bfbca['push'](_0x59dead[0x8]);_0x3bfbca['push'](_0x59dead[0x9]);_0x3bfbca[_0x7366('0x21')](_0x59dead[0xa]);_0x3bfbca['push'](_0x4dd111[_0x7366('0x17')]['id']);_0x3bfbca[_0x7366('0x21')](_0x4dd111['message']['id']);_0x3bfbca[_0x7366('0x21')](_0x29f725['ChatWebsiteId']);_0x3bfbca[_0x7366('0x21')](_0x4dd111[_0x7366('0x17')][_0x7366('0x29')]);_0x3bfbca[_0x7366('0x21')](_0x4dd111['body'][_0x7366('0x2a')]);_0x3bfbca[_0x7366('0x21')](_0x101d2a);break;default:_0x3bfbca=_[_0x7366('0xe')](_0x29f725['appdata'])?[]:_0x29f725[_0x7366('0x1e')][_0x7366('0x1f')](',');}var _0x14ec01={'id':util[_0x7366('0xc')](_0x7366('0x2b'),_0xe2c87b,_0x29f725['id'],_0x29f725[_0x7366('0x1b')]),'condition':require(_0x7366('0x2c'))['condition'](_0xe2c87b,getIntervals(_0x44d163['intervals'],_0x29f725),_0x44d163),'consequence':require(_0x7366('0x2d')+_0x29f725[_0x7366('0x1b')])['consequence'](_0xe2c87b,_0x3bfbca,_0x44d163,_0x4dd111),'p':_0x29f725[_0x7366('0x2e')]||0x0};logger[_0x7366('0x2f')]('Push\x20new\x20rule',_0x14ec01['id'],_0x7366('0x30'),getIntervals(_0x44d163['intervals'],_0x29f725)[_0x7366('0x23')](_0x7366('0x31')));_0x2c0422['push'](_0x14ec01);}else{logger['error'](_0x7366('0x32'),path[_0x7366('0x23')](__dirname,_0x7366('0x18'),_0x29f725[_0x7366('0x1b')]+'.js'));}}_0x44d163[_0x7366('0x14')][_0xe2c87b]=new RuleEngine(_0x2c0422);_0x44d163[_0x7366('0x14')][_0xe2c87b][_0x7366('0x33')](_0x4dd111,function(_0x3af932){logger[_0x7366('0x2f')](_0x7366('0x34'),JSON[_0x7366('0x35')](_0x3af932['matchPath']));if(_0x44d163[_0x7366('0x14')][_0xe2c87b]){_0x44d163[_0x7366('0x14')][_0xe2c87b][_0x7366('0x36')]('complete');}});return _0x308752({'code':0xc8,'message':_0x4dd111});}else{logger[_0x7366('0x2f')](_0x7366('0x37'));return _0x308752({'code':0xc8,'message':_0x4dd111});}}catch(_0x5c3e45){logger[_0x7366('0x38')](_0x5c3e45[_0x7366('0x39')]);return _0x338719(_0x23e763[_0x7366('0x38')](0x1f4,_0x5c3e45));}}return _0x338719('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1909d4){var _0x2f9acb=this;return new Promise(function(_0xf677fc,_0x570459){if(_0x1909d4[_0x7366('0x3a')]&&_0x1909d4[_0x7366('0x3a')]['id']){if(_0x44d163[_0x7366('0x3b')][_0x1909d4['agent']['id']]){_0x44d163[_0x7366('0x3b')][_0x1909d4[_0x7366('0x3a')]['id']][_0x7366('0x3c')]=![];_0x44d163[_0x7366('0x3b')][_0x1909d4['agent']['id']][_0x7366('0x3d')]=undefined;}}if(_0x1909d4[_0x7366('0x16')]&&_0x1909d4[_0x7366('0x16')]['id']){try{var _0x202ddb=getId(_0x1909d4[_0x7366('0x15')],_0x1909d4[_0x7366('0x16')]?_0x1909d4[_0x7366('0x16')]['id']:0x0,_0x1909d4[_0x7366('0x17')]?_0x1909d4[_0x7366('0x17')]['id']:0x0);if(_0x44d163['rules'][_0x202ddb]){_0x44d163[_0x7366('0x14')][_0x202ddb][_0x7366('0x36')]('end');if(rpc[_0x1909d4[_0x7366('0x15')]+_0x7366('0x3e')]){rpc[_0x1909d4['channel']+_0x7366('0x3e')]['update'](_0x202ddb,{'UserId':_0x1909d4[_0x7366('0x16')][_0x7366('0x3f')]})[_0x7366('0x40')](function(){logger[_0x7366('0x38')]('error\x20update\x20queue\x20report');});}}return _0xf677fc({'code':0xc8,'message':_0x1909d4});}catch(_0x3a7e59){logger[_0x7366('0x38')](_0x3a7e59[_0x7366('0x39')]);return _0x570459(_0x2f9acb[_0x7366('0x38')](0x1f4,_0x3a7e59));}}logger[_0x7366('0x38')](_0x7366('0x41'));return _0x570459(_0x2f9acb[_0x7366('0x38')](0x1f4,_0x7366('0x41')));});},'RejectMessage':function(_0x30a533){var _0x336b4d=this;return new Promise(function(_0x4bc564,_0x1002f4){if(_0x30a533['agent']&&_0x30a533[_0x7366('0x3a')]['id']){try{if(_0x44d163['agents'][_0x30a533['agent']['id']]){_0x44d163[_0x7366('0x3b')][_0x30a533[_0x7366('0x3a')]['id']]['busy']=![];_0x44d163[_0x7366('0x3b')][_0x30a533[_0x7366('0x3a')]['id']]['busyQueue']=undefined;}return _0x4bc564({'code':0xc8,'message':_0x30a533});}catch(_0x5af295){logger[_0x7366('0x38')](_0x5af295['stack']);return _0x1002f4(_0x336b4d[_0x7366('0x38')](0x1f4,_0x5af295));}}logger[_0x7366('0x38')]('message\x20is\x20empty');return _0x1002f4(_0x336b4d[_0x7366('0x38')](0x1f4,_0x7366('0x41')));});},'AbandonInteraction':function(_0xcce4ef){var _0x5506e7=this;return new Promise(function(_0x2f678a,_0x3b1daa){if(_0xcce4ef[_0x7366('0x15')]&&_0xcce4ef[_0x7366('0x17')]&&_0xcce4ef['interaction']['id']){try{var _0x2a0869=getId(_0xcce4ef[_0x7366('0x15')],_0xcce4ef[_0x7366('0x16')]?_0xcce4ef[_0x7366('0x16')]['id']:0x0,_0xcce4ef[_0x7366('0x17')]?_0xcce4ef['interaction']['id']:0x0);if(_0x44d163[_0x7366('0x14')][_0x2a0869]){_0x44d163[_0x7366('0x14')][_0x2a0869][_0x7366('0x36')](_0x7366('0x42'));}return _0x2f678a({'code':0xc8,'message':_0xcce4ef});}catch(_0x54c117){logger[_0x7366('0x38')](_0x54c117['stack']);return _0x3b1daa(_0x5506e7[_0x7366('0x38')](0x1f4,_0x54c117));}}logger[_0x7366('0x38')]('message\x20is\x20empty');return _0x3b1daa(_0x5506e7[_0x7366('0x38')](0x1f4,_0x7366('0x41')));});},'AgentCapacity':function(_0x1ebce6){var _0x12edc2=this;return new Promise(function(_0x582e17,_0x49e730){if(_0x44d163[_0x7366('0x3b')]['hasOwnProperty'](_0x1ebce6['id'])){for(var _0x432755 in _0x1ebce6[_0x7366('0x43')]){if(_0x1ebce6[_0x7366('0x43')][_0x7366('0x44')](_0x432755)){if(_0x44d163[_0x7366('0x3b')][_0x1ebce6['id']][_0x7366('0x44')](_0x432755+_0x7366('0x45'))){_0x44d163[_0x7366('0x3b')][_0x1ebce6['id']][_0x432755+_0x7366('0x45')]=parseInt(_0x1ebce6['capacity'][_0x432755],0xa);}}}_0x44d163[_0x7366('0x3b')][_0x1ebce6['id']]['updateRealtime']();return _0x582e17({'code':0xc8,'message':_0x44d163['agents'][_0x1ebce6['id']]});}else{return _0x49e730(_0x12edc2['error'](0x1f4,_0x7366('0x46')));}});},'Agents':function(_0x523016){return new Promise(function(_0x1369ae){var _0x5eba41=_[_0x7366('0x47')](_0x44d163['agents']);if(_0x523016&&_0x523016['id']){var _0x32e6d5=_[_0x7366('0x48')](_0x5eba41,function(_0x5929d2){return _0x5929d2['id']===_0x523016['id'];});_0x1369ae(_0x32e6d5);}else{_0x1369ae({'count':_0x5eba41['length'],'rows':_0x5eba41});}});},'ChatQueues':function(){return new Promise(function(_0x25942f){var _0x22ad58=[];for(var _0x3f7b82 in _0x44d163[_0x7366('0x49')]){if(_0x44d163['chatQueues'][_0x7366('0x44')](_0x3f7b82)){var _0x1df3a6=_0x44d163[_0x7366('0x49')][_0x3f7b82];var _0x5d5f01={'id':_0x1df3a6['id'],'available':_0x1df3a6['available'],'loggedIn':_0x1df3a6[_0x7366('0x4a')],'name':_0x1df3a6[_0x7366('0x4b')],'paused':_0x1df3a6[_0x7366('0x4c')],'waiting':_0x1df3a6['waiting']};_0x22ad58[_0x7366('0x21')](_0x5d5f01);}}_0x25942f({'count':_0x22ad58[_0x7366('0x19')],'rows':_0x22ad58});});},'MailQueues':function(){return new Promise(function(_0x3c091b){var _0x236180=[];for(var _0x3aa57b in _0x44d163[_0x7366('0x4d')]){if(_0x44d163[_0x7366('0x4d')][_0x7366('0x44')](_0x3aa57b)){var _0x41a56a=_0x44d163[_0x7366('0x4d')][_0x3aa57b];var _0x249ee6={'id':_0x41a56a['id'],'available':_0x41a56a['available'],'loggedIn':_0x41a56a[_0x7366('0x4a')],'name':_0x41a56a[_0x7366('0x4b')],'paused':_0x41a56a['paused'],'waiting':_0x41a56a[_0x7366('0x4e')]};_0x236180['push'](_0x249ee6);}}_0x3c091b({'count':_0x236180['length'],'rows':_0x236180});});},'OpenchannelQueues':function(){return new Promise(function(_0xb46920){var _0xe81c1e=[];for(var _0xff867f in _0x44d163[_0x7366('0x4f')]){if(_0x44d163[_0x7366('0x4f')][_0x7366('0x44')](_0xff867f)){var _0x562bb4=_0x44d163[_0x7366('0x4f')][_0xff867f];var _0x94b414={'id':_0x562bb4['id'],'available':_0x562bb4[_0x7366('0x50')],'loggedIn':_0x562bb4['loggedIn'],'name':_0x562bb4[_0x7366('0x4b')],'paused':_0x562bb4['paused'],'waiting':_0x562bb4['waiting']};_0xe81c1e[_0x7366('0x21')](_0x94b414);}}_0xb46920({'count':_0xe81c1e['length'],'rows':_0xe81c1e});});},'SmsQueues':function(){return new Promise(function(_0x142cd7){var _0xa0ac25=[];for(var _0x1020b9 in _0x44d163[_0x7366('0x51')]){if(_0x44d163['smsQueues']['hasOwnProperty'](_0x1020b9)){var _0x24279e=_0x44d163[_0x7366('0x51')][_0x1020b9];var _0x1a2c88={'id':_0x24279e['id'],'available':_0x24279e[_0x7366('0x50')],'loggedIn':_0x24279e['loggedIn'],'name':_0x24279e[_0x7366('0x4b')],'paused':_0x24279e['paused'],'waiting':_0x24279e['waiting']};_0xa0ac25[_0x7366('0x21')](_0x1a2c88);}}_0x142cd7({'count':_0xa0ac25[_0x7366('0x19')],'rows':_0xa0ac25});});},'FaxQueues':function(){return new Promise(function(_0x4ff998){var _0x41583b=[];for(var _0x39ada0 in _0x44d163['faxQueues']){if(_0x44d163[_0x7366('0x52')][_0x7366('0x44')](_0x39ada0)){var _0x52bfa8=_0x44d163[_0x7366('0x52')][_0x39ada0];var _0x1ddde2={'id':_0x52bfa8['id'],'available':_0x52bfa8[_0x7366('0x50')],'loggedIn':_0x52bfa8[_0x7366('0x4a')],'name':_0x52bfa8[_0x7366('0x4b')],'paused':_0x52bfa8[_0x7366('0x4c')],'waiting':_0x52bfa8[_0x7366('0x4e')]};_0x41583b['push'](_0x1ddde2);}}_0x4ff998({'count':_0x41583b['length'],'rows':_0x41583b});});},'WhatsappQueues':function(){return new Promise(function(_0x56e0de){var _0x14531c=[];for(var _0x1c3e4d in _0x44d163[_0x7366('0x53')]){if(_0x44d163['whatsappQueues'][_0x7366('0x44')](_0x1c3e4d)){var _0x54c72c=_0x44d163[_0x7366('0x53')][_0x1c3e4d];var _0x38f468={'id':_0x54c72c['id'],'available':_0x54c72c[_0x7366('0x50')],'loggedIn':_0x54c72c['loggedIn'],'name':_0x54c72c[_0x7366('0x4b')],'paused':_0x54c72c[_0x7366('0x4c')],'waiting':_0x54c72c['waiting']};_0x14531c[_0x7366('0x21')](_0x38f468);}}_0x56e0de({'count':_0x14531c[_0x7366('0x19')],'rows':_0x14531c});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2cb10a){var _0x24c3c5=_[_0x7366('0x47')](_0x44d163['chatQueuesWaitingInteractions']);_0x2cb10a({'count':_0x24c3c5['length'],'rows':_0x24c3c5});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x25cd60){var _0xa2327=_[_0x7366('0x47')](_0x44d163[_0x7366('0x54')]);_0x25cd60({'count':_0xa2327[_0x7366('0x19')],'rows':_0xa2327});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3d3490){var _0x1fc6ad=_[_0x7366('0x47')](_0x44d163[_0x7366('0x55')]);_0x3d3490({'count':_0x1fc6ad[_0x7366('0x19')],'rows':_0x1fc6ad});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3cff83){var _0x2d1797=_[_0x7366('0x47')](_0x44d163[_0x7366('0x56')]);_0x3cff83({'count':_0x2d1797['length'],'rows':_0x2d1797});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1cab48){var _0x5011ea=_[_0x7366('0x47')](_0x44d163['faxQueuesWaitingInteractions']);_0x1cab48({'count':_0x5011ea[_0x7366('0x19')],'rows':_0x5011ea});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5760ee){var _0x313478=_[_0x7366('0x47')](_0x44d163['whatsappQueuesWaitingInteractions']);_0x5760ee({'count':_0x313478[_0x7366('0x19')],'rows':_0x313478});});}};var _0x300dd3=jayson['server'](_0xf4114)['http']();_0x300dd3['on'](_0x7366('0x38'),function(_0x1821e1){logger['error'](JSON[_0x7366('0x35')](_0x1821e1));return _0x22562f(_0x1821e1);});_0x300dd3['listen'](0x232c,_0x7366('0x57'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x27500c(_0x7366('0x58')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 00d0e66..b17a1e1 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 _0x771b=['then','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x771b,0x172));var _0xb771=function(_0x4b1dd7,_0x5638c7){_0x4b1dd7=_0x4b1dd7-0x0;var _0x96a4f7=_0x771b[_0x4b1dd7];return _0x96a4f7;};'use strict';var util=require(_0xb771('0x0'));var BPromise=require(_0xb771('0x1'));var jayson=require(_0xb771('0x2'));var _=require(_0xb771('0x3'));var logger=require(_0xb771('0x4'))('routing');var client=jayson[_0xb771('0x5')][_0xb771('0x6')]({'port':0x232a});function request(_0x1bf7e5,_0x534155){return new BPromise(function(_0x394127,_0x3d6698){return client[_0xb771('0x7')](_0x1bf7e5,_0x534155)[_0xb771('0x8')](function(_0x1bf9e9){if(_0x1bf9e9[_0xb771('0x9')]){return _0x3d6698(_0x1bf9e9[_0xb771('0x9')][_0xb771('0xa')]);}else{return _0x394127(_0x1bf9e9['result']);}})[_0xb771('0xb')](function(_0x154e55){return _0x3d6698(_0x154e55);});});}exports['condition']=function(_0x346446,_0x107cf2,_0x147e05){return function(_0x1a434b){if(_0x147e05[_0xb771('0xc')]&&!_0x147e05[_0xb771('0xc')][_0x346446]){logger[_0xb771('0xd')](_0xb771('0xe'),_0x346446);return _0x1a434b[_0xb771('0xf')]();}var _0xd30c7c=[];for(var _0x37985e=0x0;_0x37985e<_0x107cf2[_0xb771('0x10')];_0x37985e+=0x1){_0xd30c7c[_0xb771('0x11')](request(_0xb771('0x12'),{'command':util[_0xb771('0x13')](_0xb771('0x14'),_0x107cf2[_0x37985e])})[_0xb771('0x8')](function(_0xfac8f0){return _0xfac8f0&&_0xfac8f0[_0xb771('0xa')]&&_0xfac8f0[_0xb771('0xa')]['indexOf']('true')>=0x0?!![]:![];})[_0xb771('0xb')](function(_0x5e788e){logger[_0xb771('0x9')]('[%s][INTERVAL]\x20%s',_0x346446,_0x107cf2[_0x37985e]);}));}BPromise[_0xb771('0x15')](_0xd30c7c)['then'](function(_0x1aab23){var _0x42f816=_[_0xb771('0x16')](_0x1aab23);logger[_0xb771('0xd')](_0xb771('0x17'),_0x346446,_0x107cf2[_0xb771('0x18')](_0xb771('0x19')),_0x42f816);_0x1a434b['when'](_0x42f816);})[_0xb771('0xb')](function(_0x3b0bfd){console[_0xb771('0x1a')](_0x3b0bfd);logger[_0xb771('0x9')](_0xb771('0x17'),_0x346446,_0x107cf2['join'](_0xb771('0x19')),_0x3b0bfd['stack']);_0x1a434b[_0xb771('0xf')]();});};}; \ No newline at end of file +var _0x0d68=['true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','bluebird','jayson/promise','lodash','routing','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format'];(function(_0x496a34,_0x3eefdc){var _0xfd30a0=function(_0x5167c7){while(--_0x5167c7){_0x496a34['push'](_0x496a34['shift']());}};_0xfd30a0(++_0x3eefdc);}(_0x0d68,0x1ef));var _0x80d6=function(_0x1485b3,_0x1c40df){_0x1485b3=_0x1485b3-0x0;var _0x24ddb9=_0x0d68[_0x1485b3];return _0x24ddb9;};'use strict';var util=require(_0x80d6('0x0'));var BPromise=require(_0x80d6('0x1'));var jayson=require(_0x80d6('0x2'));var _=require(_0x80d6('0x3'));var logger=require('../../../config/logger')(_0x80d6('0x4'));var client=jayson['client']['http']({'port':0x232a});function request(_0xfa9574,_0x1a3dec){return new BPromise(function(_0x301b94,_0xfdf42a){return client['request'](_0xfa9574,_0x1a3dec)[_0x80d6('0x5')](function(_0x5ef5cc){if(_0x5ef5cc[_0x80d6('0x6')]){return _0xfdf42a(_0x5ef5cc['error'][_0x80d6('0x7')]);}else{return _0x301b94(_0x5ef5cc[_0x80d6('0x8')]);}})[_0x80d6('0x9')](function(_0x3fc769){return _0xfdf42a(_0x3fc769);});});}exports['condition']=function(_0x4c73e8,_0x3e87e9,_0x400e5f){return function(_0xc3e6e6){if(_0x400e5f[_0x80d6('0xa')]&&!_0x400e5f['rules'][_0x4c73e8]){logger[_0x80d6('0xb')](_0x80d6('0xc'),_0x4c73e8);return _0xc3e6e6[_0x80d6('0xd')]();}var _0x183b05=[];for(var _0x434d74=0x0;_0x434d74<_0x3e87e9[_0x80d6('0xe')];_0x434d74+=0x1){_0x183b05[_0x80d6('0xf')](request(_0x80d6('0x10'),{'command':util[_0x80d6('0x11')]('iftime\x20%s',_0x3e87e9[_0x434d74])})['then'](function(_0x41e929){return _0x41e929&&_0x41e929['message']&&_0x41e929[_0x80d6('0x7')]['indexOf'](_0x80d6('0x12'))>=0x0?!![]:![];})['catch'](function(_0x42f840){logger['error'](_0x80d6('0x13'),_0x4c73e8,_0x3e87e9[_0x434d74]);}));}BPromise[_0x80d6('0x14')](_0x183b05)[_0x80d6('0x5')](function(_0x50a936){var _0x2a6080=_[_0x80d6('0x15')](_0x50a936);logger[_0x80d6('0xb')](_0x80d6('0x16'),_0x4c73e8,_0x3e87e9[_0x80d6('0x17')](_0x80d6('0x18')),_0x2a6080);_0xc3e6e6[_0x80d6('0x19')](_0x2a6080);})['catch'](function(_0x56bfd1){console['log'](_0x56bfd1);logger[_0x80d6('0x6')](_0x80d6('0x16'),_0x4c73e8,_0x3e87e9[_0x80d6('0x17')](_0x80d6('0x18')),_0x56bfd1[_0x80d6('0x1a')]);_0xc3e6e6[_0x80d6('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 81497a9..2e8d8ae 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 _0x80ed=['secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason'];(function(_0xabbd65,_0x546d99){var _0x1d005a=function(_0x11694e){while(--_0x11694e){_0xabbd65['push'](_0xabbd65['shift']());}};_0x1d005a(++_0x546d99);}(_0x80ed,0x11c));var _0xd80e=function(_0x1614bf,_0x4cc805){_0x1614bf=_0x1614bf-0x0;var _0x362f0d=_0x80ed[_0x1614bf];return _0x362f0d;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var utils=require(_0xd80e('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x182da3,_0x4329e5){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x3'),_0x182da3[_0xd80e('0x4')],_0x182da3[_0xd80e('0x5')],_0x182da3['queue'],_0x182da3[_0xd80e('0x6')],_0x182da3[_0xd80e('0x7')],_0x182da3[_0xd80e('0x8')],_0x182da3['connectedlinenum'],_0x182da3[_0xd80e('0x9')]));if(_0x182da3[_0xd80e('0xa')]){utils[_0xd80e('0xb')](_0x182da3[_0xd80e('0xa')])[_0xd80e('0xc')](function(_0x298c29){if(_0x298c29){_0x182da3[_0xd80e('0xd')]=_0x298c29[_0xd80e('0xd')];_0x182da3[_0xd80e('0xe')]=_0x182da3[_0xd80e('0xf')]?_0x298c29['acw']:![];_0x182da3[_0xd80e('0x10')]=_0x182da3[_0xd80e('0xe')]?_0x298c29[_0xd80e('0x11')]:0x0;}utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);});}else{utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);}if(_0x4329e5){delete transfers[_0x182da3[_0xd80e('0x4')]];}else{delete agents[_0x182da3[_0xd80e('0x14')]];}}exports['agentcalled']=function(_0x5691a1){try{utils['debug'](util['format'](_0xd80e('0x15'),_0x5691a1[_0xd80e('0x4')]),_0x5691a1);agents[_0x5691a1[_0xd80e('0x14')]]=_0x5691a1;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x16')]=utils['now']();agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x9')]=_0xd80e('0x17');agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x18')]=null;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x19')]=null;utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x1b'),_0x5691a1[_0xd80e('0x4')],agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x6')],_0x5691a1['destuniqueid']));}catch(_0x39397a){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')]('[%s][agents][agentcalled]',_0x5691a1[_0xd80e('0x4')]),_0x39397a);}};exports[_0xd80e('0x1d')]=function(_0x2765ea){try{if(!_[_0xd80e('0x1e')](agents[_0x2765ea[_0xd80e('0x14')]])){utils['debug'](util['format'](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x2765ea);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x20'),_0x2765ea[_0xd80e('0x4')],agents[_0x2765ea[_0xd80e('0x14')]]['membername'],_0x2765ea[_0xd80e('0x14')]));agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x1d')]=!![];agents[_0x2765ea['destuniqueid']][_0xd80e('0x21')]=utils[_0xd80e('0x22')]();agents[_0x2765ea[_0xd80e('0x14')]]['lastevent']='timeout';agents[_0x2765ea['destuniqueid']][_0xd80e('0x23')]='timeout';agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x2765ea['ringtime']?parseInt(_0x2765ea[_0xd80e('0x25')])/0x3e8:0x0;agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x26')]=0x0;unanswered[_0xd80e('0x27')](_0x2765ea['destuniqueid']);}}catch(_0x15f317){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x15f317);}};exports[_0xd80e('0x28')]=function(_0x289685){try{_[_0xd80e('0x29')](agents,function(_0x5522dd,_0x54504e){if(_0x5522dd[_0xd80e('0x4')]==_0x289685[_0xd80e('0x4')]&&!_[_0xd80e('0x2a')](unanswered,_0x5522dd[_0xd80e('0x14')])){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')]('[%s][agents][queuecallerabandon]',_0x289685['uniqueid']),_0x289685);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x2c'),_0x289685[_0xd80e('0x4')],_0x5522dd[_0xd80e('0x6')],_0x5522dd[_0xd80e('0x14')]));_0x5522dd[_0xd80e('0x1d')]=!![];_0x5522dd[_0xd80e('0x21')]=utils['now']();_0x5522dd['lastevent']=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x23')]=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x24')]=_0x289685[_0xd80e('0x24')];_0x5522dd[_0xd80e('0x26')]=0x0;writeDB(_0x5522dd);}});}catch(_0x17b8c7){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x2e'),_0x289685['uniqueid']),_0x17b8c7);}};exports[_0xd80e('0x2f')]=function(_0x490432){try{if(agents[_0x490432[_0xd80e('0x14')]]){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432['uniqueid']),_0x490432);utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x31'),_0x490432['uniqueid'],agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x6')],_0x490432['destuniqueid']));agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();agents[_0x490432['destuniqueid']][_0xd80e('0x18')]=_0x490432[_0xd80e('0x18')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x19')]=_0x490432[_0xd80e('0x19')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];agents[_0x490432[_0xd80e('0x14')]]['lastevent']='connect';_['forIn'](agents,function(_0x161455,_0x3ff4b4){if(_0x161455['destuniqueid']!=_0x490432[_0xd80e('0x14')]&&_0x161455['uniqueid']==_0x490432[_0xd80e('0x4')]){_0x161455['talktime']=0x0;_0x161455[_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];_0x161455['agentringnoanswer']=!![];_0x161455['agentringnoanswerAt']=utils[_0xd80e('0x22')]();_0x161455[_0xd80e('0x9')]=_0xd80e('0x33');_0x161455[_0xd80e('0x23')]=_0xd80e('0x33');_0x161455[_0xd80e('0x34')]=_0x490432[_0xd80e('0x14')];_0x161455[_0xd80e('0x35')]=_0x490432[_0xd80e('0x6')];writeDB(_0x161455);}});}}catch(_0x2da5f5){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432[_0xd80e('0x4')]),_0x2da5f5);}};exports[_0xd80e('0xf')]=function(_0x7f80a){try{if(!_['isNil'](agents[_0x7f80a['destuniqueid']])){utils['debug'](util[_0xd80e('0x2')]('[%s][agents][agentcomplete]',_0x7f80a[_0xd80e('0x4')]),_0x7f80a);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x36'),_0x7f80a[_0xd80e('0x4')],agents[_0x7f80a[_0xd80e('0x14')]]['membername'],_0x7f80a['destuniqueid']));agents[_0x7f80a['destuniqueid']][_0xd80e('0xf')]=!![];agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')]=utils[_0xd80e('0x22')]();agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x26')]=utils[_0xd80e('0x38')](agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')],agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x32')]);agents[_0x7f80a['destuniqueid']][_0xd80e('0x23')]=_0x7f80a[_0xd80e('0x23')];agents[_0x7f80a[_0xd80e('0x14')]]['lastevent']=_0xd80e('0x39');writeDB(agents[_0x7f80a[_0xd80e('0x14')]]);}}catch(_0xf0d5aa){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x3a'),_0x7f80a['uniqueid']),_0xf0d5aa);}};exports['blindtransfer']=function(_0x275985){try{if(!_[_0xd80e('0x1e')](agents[_0x275985[_0xd80e('0x3b')]])){utils['debug'](util['format'](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x275985);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x3d'),_0x275985['uniqueid'],agents[_0x275985[_0xd80e('0x3b')]]['membername'],agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')]));agents[_0x275985['transfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x3f')]=_0xd80e('0x40');agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x41')]=_0x275985[_0xd80e('0x42')];agents[_0x275985['transfereruniqueid']][_0xd80e('0x43')]=agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')];}}catch(_0x4a66ca){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x4a66ca);}};exports[_0xd80e('0x44')]=function(_0x2f66eb){try{utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb['origtransfereruniqueid']),_0x2f66eb);if(_0x2f66eb[_0xd80e('0x46')]==_0x2f66eb['origtransfererlinkedid']){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x47')]])){utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb[_0xd80e('0x46')],agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x6')]));agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x2f66eb[_0xd80e('0x47')]]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x41')]=_0x2f66eb[_0xd80e('0x49')];agents[_0x2f66eb['secondtransfereruniqueid']]['transferuniqueid']=_0x2f66eb[_0xd80e('0x46')];}if(_0x2f66eb[_0xd80e('0x4a')]&&agents[_0x2f66eb['transfereeuniqueid']]){agents[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4a')]]=_['clone'](agents[_0x2f66eb[_0xd80e('0x4a')]]);transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x8')]=agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x8')];transfers[_0x2f66eb[_0xd80e('0x4a')]]['calleridname']=agents[_0x2f66eb[_0xd80e('0x47')]]['calleridname'];transfers[_0x2f66eb[_0xd80e('0x4a')]]['agentcalledAt']=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4a')]]['agententerreason']=0x2;}}else if(_0x2f66eb[_0xd80e('0x47')]==_0x2f66eb[_0xd80e('0x4c')]){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x46')]])){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb['origtransfereruniqueid'],agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x6')]));agents[_0x2f66eb[_0xd80e('0x46')]]['transfer']=!![];agents[_0x2f66eb['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x46')]]['transferexten']=_0x2f66eb[_0xd80e('0x4d')];agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x43')]=_0x2f66eb['secondtransfereruniqueid'];}if(_0x2f66eb[_0xd80e('0x4e')]&&agents[_0x2f66eb[_0xd80e('0x4e')]]){agents[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4e')]]=_[_0xd80e('0x4f')](agents[_0x2f66eb[_0xd80e('0x4e')]]);transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x8')]=agents[_0x2f66eb['origtransfereruniqueid']]['calleridnum'];transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x50')]=agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x50')];transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x16')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x2;}}}catch(_0x1676c7){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb[_0xd80e('0x46')]),_0x1676c7);}};exports[_0xd80e('0x51')]=function(_0x433782){try{utils[_0xd80e('0x2b')](util['format'](_0xd80e('0x52'),_0x433782[_0xd80e('0x4')]),_0x433782);if(agents[_0x433782['uniqueid']]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]===_0xd80e('0x53')){if(_0x433782[_0xd80e('0x54')]==='21'){agents[_0x433782['uniqueid']][_0xd80e('0x23')]='rejected';agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x55');}utils[_0xd80e('0x1a')](util[_0xd80e('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]]['reason'],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782['uniqueid']]);var _0x2597a3=unanswered[_0xd80e('0x56')](_0x433782[_0xd80e('0x4')]);if(_0x2597a3>-0x1){unanswered[_0xd80e('0x57')](_0x2597a3,0x1);}}if(transfers[_0x433782[_0xd80e('0x4')]]){transfers[_0x433782[_0xd80e('0x4')]]['agentcomplete']=!![];transfers[_0x433782['uniqueid']][_0xd80e('0x37')]=utils['now']();transfers[_0x433782['uniqueid']][_0xd80e('0x26')]=utils[_0xd80e('0x38')](transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]);transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]='agent';transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x39');utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],transfers[_0x433782['uniqueid']][_0xd80e('0x6')],transfers[_0x433782[_0xd80e('0x4')]]['reason'],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(transfers[_0x433782[_0xd80e('0x4')]],!![]);}if(agents[_0x433782[_0xd80e('0x4')]]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]){agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0xf')]=!![];agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')]=utils['now']();agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x26')]=utils['diffTime'](agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],agents[_0x433782[_0xd80e('0x4')]]['agentconnectAt']);agents[_0x433782[_0xd80e('0x4')]]['reason']=agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x3e')]?_0xd80e('0x3e'):_0xd80e('0x59');agents[_0x433782[_0xd80e('0x4')]]['lastevent']=_0xd80e('0x39');utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782[_0xd80e('0x4')]]);}}catch(_0x31fd22){utils[_0xd80e('0x1c')](util['format'](_0xd80e('0x52'),_0x433782['uniqueid']),_0x31fd22);}}; \ No newline at end of file +var _0x153f=['type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','lodash','util','./utils','info','format','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x153f,0x15b));var _0xf153=function(_0x322f36,_0x66e361){_0x322f36=_0x322f36-0x0;var _0x4d0292=_0x153f[_0x322f36];return _0x4d0292;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var utils=require(_0xf153('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44cea3,_0x2afb9a){utils[_0xf153('0x3')](util[_0xf153('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x44cea3[_0xf153('0x5')],_0x44cea3['channel'],_0x44cea3[_0xf153('0x6')],_0x44cea3[_0xf153('0x7')],_0x44cea3[_0xf153('0x8')],_0x44cea3[_0xf153('0x9')],_0x44cea3[_0xf153('0xa')],_0x44cea3['lastevent']));if(_0x44cea3[_0xf153('0x6')]){utils[_0xf153('0xb')](_0x44cea3[_0xf153('0x6')])[_0xf153('0xc')](function(_0x253fd3){if(_0x253fd3){_0x44cea3[_0xf153('0xd')]=_0x253fd3[_0xf153('0xd')];_0x44cea3[_0xf153('0xe')]=_0x44cea3[_0xf153('0xf')]?_0x253fd3[_0xf153('0x10')]:![];_0x44cea3['acwtime']=_0x44cea3[_0xf153('0xe')]?_0x253fd3[_0xf153('0x11')]:0x0;}utils[_0xf153('0x12')]('CreateVoiceAgentReport',_0x44cea3);});}else{utils[_0xf153('0x12')](_0xf153('0x13'),_0x44cea3);}if(_0x2afb9a){delete transfers[_0x44cea3[_0xf153('0x5')]];}else{delete agents[_0x44cea3[_0xf153('0x14')]];}}exports[_0xf153('0x15')]=function(_0x107d31){try{utils[_0xf153('0x16')](util[_0xf153('0x4')](_0xf153('0x17'),_0x107d31['uniqueid']),_0x107d31);agents[_0x107d31[_0xf153('0x14')]]=_0x107d31;agents[_0x107d31[_0xf153('0x14')]][_0xf153('0x18')]=utils[_0xf153('0x19')]();agents[_0x107d31[_0xf153('0x14')]][_0xf153('0x1a')]=_0xf153('0x1b');agents[_0x107d31[_0xf153('0x14')]]['connectedlinenum']=null;agents[_0x107d31[_0xf153('0x14')]]['connectedlinename']=null;utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x1c'),_0x107d31[_0xf153('0x5')],agents[_0x107d31['destuniqueid']][_0xf153('0x7')],_0x107d31[_0xf153('0x14')]));}catch(_0x41946a){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x17'),_0x107d31[_0xf153('0x5')]),_0x41946a);}};exports[_0xf153('0x1e')]=function(_0x3735a7){try{if(!_[_0xf153('0x1f')](agents[_0x3735a7[_0xf153('0x14')]])){utils[_0xf153('0x16')](util['format'](_0xf153('0x20'),_0x3735a7[_0xf153('0x5')]),_0x3735a7);utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x21'),_0x3735a7[_0xf153('0x5')],agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x7')],_0x3735a7[_0xf153('0x14')]));agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x1e')]=!![];agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x22')]=utils[_0xf153('0x19')]();agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x1a')]=_0xf153('0x23');agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x24')]=_0xf153('0x23');agents[_0x3735a7['destuniqueid']][_0xf153('0x25')]=_0x3735a7[_0xf153('0x26')]?parseInt(_0x3735a7['ringtime'])/0x3e8:0x0;agents[_0x3735a7[_0xf153('0x14')]][_0xf153('0x27')]=0x0;unanswered['push'](_0x3735a7[_0xf153('0x14')]);}}catch(_0x10295e){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x20'),_0x3735a7[_0xf153('0x5')]),_0x10295e);}};exports[_0xf153('0x28')]=function(_0x3b5f4f){try{_[_0xf153('0x29')](agents,function(_0x8e31bf,_0x13b541){if(_0x8e31bf[_0xf153('0x5')]==_0x3b5f4f['uniqueid']&&!_[_0xf153('0x2a')](unanswered,_0x8e31bf[_0xf153('0x14')])){utils[_0xf153('0x16')](util[_0xf153('0x4')]('[%s][agents][queuecallerabandon]',_0x3b5f4f['uniqueid']),_0x3b5f4f);utils[_0xf153('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x3b5f4f[_0xf153('0x5')],_0x8e31bf['membername'],_0x8e31bf[_0xf153('0x14')]));_0x8e31bf['agentringnoanswer']=!![];_0x8e31bf[_0xf153('0x22')]=utils[_0xf153('0x19')]();_0x8e31bf['lastevent']=_0xf153('0x2b');_0x8e31bf[_0xf153('0x24')]=_0xf153('0x2b');_0x8e31bf[_0xf153('0x25')]=_0x3b5f4f[_0xf153('0x25')];_0x8e31bf[_0xf153('0x27')]=0x0;writeDB(_0x8e31bf);}});}catch(_0x4ab69c){utils[_0xf153('0x1d')](util['format'](_0xf153('0x2c'),_0x3b5f4f[_0xf153('0x5')]),_0x4ab69c);}};exports[_0xf153('0x2d')]=function(_0x1820c3){try{if(agents[_0x1820c3[_0xf153('0x14')]]){utils[_0xf153('0x16')](util['format'](_0xf153('0x2e'),_0x1820c3[_0xf153('0x5')]),_0x1820c3);utils[_0xf153('0x3')](util['format'](_0xf153('0x2f'),_0x1820c3[_0xf153('0x5')],agents[_0x1820c3[_0xf153('0x14')]][_0xf153('0x7')],_0x1820c3[_0xf153('0x14')]));agents[_0x1820c3[_0xf153('0x14')]]['agentconnectAt']=utils[_0xf153('0x19')]();agents[_0x1820c3[_0xf153('0x14')]]['connectedlinenum']=_0x1820c3[_0xf153('0xa')];agents[_0x1820c3[_0xf153('0x14')]][_0xf153('0x30')]=_0x1820c3[_0xf153('0x30')];agents[_0x1820c3[_0xf153('0x14')]][_0xf153('0x25')]=_0x1820c3[_0xf153('0x26')];agents[_0x1820c3['destuniqueid']][_0xf153('0x1a')]=_0xf153('0x31');_[_0xf153('0x29')](agents,function(_0x352e7c,_0x25657a){if(_0x352e7c[_0xf153('0x14')]!=_0x1820c3['destuniqueid']&&_0x352e7c['uniqueid']==_0x1820c3[_0xf153('0x5')]){_0x352e7c['talktime']=0x0;_0x352e7c[_0xf153('0x25')]=_0x1820c3[_0xf153('0x26')];_0x352e7c[_0xf153('0x1e')]=!![];_0x352e7c[_0xf153('0x22')]=utils[_0xf153('0x19')]();_0x352e7c[_0xf153('0x1a')]='answered_elsewhere';_0x352e7c['reason']=_0xf153('0x32');_0x352e7c[_0xf153('0x33')]=_0x1820c3['destuniqueid'];_0x352e7c[_0xf153('0x34')]=_0x1820c3[_0xf153('0x7')];writeDB(_0x352e7c);}});}}catch(_0x1edf65){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x2e'),_0x1820c3[_0xf153('0x5')]),_0x1edf65);}};exports[_0xf153('0xf')]=function(_0x1b453f){try{if(!_[_0xf153('0x1f')](agents[_0x1b453f[_0xf153('0x14')]])){utils[_0xf153('0x16')](util['format'](_0xf153('0x35'),_0x1b453f[_0xf153('0x5')]),_0x1b453f);utils[_0xf153('0x3')](util['format'](_0xf153('0x36'),_0x1b453f[_0xf153('0x5')],agents[_0x1b453f['destuniqueid']][_0xf153('0x7')],_0x1b453f['destuniqueid']));agents[_0x1b453f[_0xf153('0x14')]][_0xf153('0xf')]=!![];agents[_0x1b453f[_0xf153('0x14')]]['agentcompleteAt']=utils[_0xf153('0x19')]();agents[_0x1b453f[_0xf153('0x14')]][_0xf153('0x27')]=utils[_0xf153('0x37')](agents[_0x1b453f[_0xf153('0x14')]]['agentcompleteAt'],agents[_0x1b453f[_0xf153('0x14')]][_0xf153('0x38')]);agents[_0x1b453f['destuniqueid']][_0xf153('0x24')]=_0x1b453f[_0xf153('0x24')];agents[_0x1b453f[_0xf153('0x14')]]['lastevent']=_0xf153('0x39');writeDB(agents[_0x1b453f[_0xf153('0x14')]]);}}catch(_0x82dc34){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x35'),_0x1b453f[_0xf153('0x5')]),_0x82dc34);}};exports[_0xf153('0x3a')]=function(_0x3b91ed){try{if(!_['isNil'](agents[_0x3b91ed[_0xf153('0x3b')]])){utils['debug'](util['format']('[%s][agents][blindtransfer]',_0x3b91ed[_0xf153('0x5')]),_0x3b91ed);utils[_0xf153('0x3')](util['format'](_0xf153('0x3c'),_0x3b91ed[_0xf153('0x5')],agents[_0x3b91ed['transfereruniqueid']][_0xf153('0x7')],agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x5')]));agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x3d')]=!![];agents[_0x3b91ed[_0xf153('0x3b')]]['transfertype']=_0xf153('0x3e');agents[_0x3b91ed[_0xf153('0x3b')]]['transferexten']=_0x3b91ed['extension'];agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x3f')]=agents[_0x3b91ed[_0xf153('0x3b')]][_0xf153('0x5')];}}catch(_0x419e7e){utils[_0xf153('0x1d')](util['format'](_0xf153('0x40'),_0x3b91ed['uniqueid']),_0x419e7e);}};exports[_0xf153('0x41')]=function(_0x365209){try{utils[_0xf153('0x16')](util['format'](_0xf153('0x42'),_0x365209[_0xf153('0x43')]),_0x365209);if(_0x365209[_0xf153('0x43')]==_0x365209[_0xf153('0x44')]){if(!_[_0xf153('0x1f')](agents[_0x365209[_0xf153('0x45')]])){utils[_0xf153('0x3')](util['format'](_0xf153('0x46'),_0x365209[_0xf153('0x43')],agents[_0x365209[_0xf153('0x45')]]['membername']));agents[_0x365209[_0xf153('0x45')]][_0xf153('0x3d')]=!![];agents[_0x365209[_0xf153('0x45')]][_0xf153('0x47')]=_0xf153('0x48');agents[_0x365209[_0xf153('0x45')]][_0xf153('0x49')]=_0x365209[_0xf153('0x4a')];agents[_0x365209['secondtransfereruniqueid']][_0xf153('0x3f')]=_0x365209[_0xf153('0x43')];}if(_0x365209['transfereeuniqueid']&&agents[_0x365209[_0xf153('0x4b')]]){agents[_0x365209[_0xf153('0x4b')]][_0xf153('0x4c')]=0x1;transfers[_0x365209[_0xf153('0x4b')]]=_[_0xf153('0x4d')](agents[_0x365209[_0xf153('0x4b')]]);transfers[_0x365209[_0xf153('0x4b')]][_0xf153('0x9')]=agents[_0x365209[_0xf153('0x45')]][_0xf153('0x9')];transfers[_0x365209[_0xf153('0x4b')]]['calleridname']=agents[_0x365209[_0xf153('0x45')]][_0xf153('0x4e')];transfers[_0x365209['transfereeuniqueid']][_0xf153('0x18')]=utils[_0xf153('0x19')]();transfers[_0x365209[_0xf153('0x4b')]][_0xf153('0x38')]=utils[_0xf153('0x19')]();transfers[_0x365209[_0xf153('0x4b')]][_0xf153('0x25')]=0x0;transfers[_0x365209['transfereeuniqueid']][_0xf153('0x4c')]=0x2;}}else if(_0x365209[_0xf153('0x45')]==_0x365209[_0xf153('0x4f')]){if(!_[_0xf153('0x1f')](agents[_0x365209[_0xf153('0x43')]])){utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x46'),_0x365209[_0xf153('0x43')],agents[_0x365209['origtransfereruniqueid']][_0xf153('0x7')]));agents[_0x365209[_0xf153('0x43')]]['transfer']=!![];agents[_0x365209[_0xf153('0x43')]]['transfertype']=_0xf153('0x48');agents[_0x365209[_0xf153('0x43')]]['transferexten']=_0x365209[_0xf153('0x50')];agents[_0x365209['origtransfereruniqueid']][_0xf153('0x3f')]=_0x365209[_0xf153('0x45')];}if(_0x365209[_0xf153('0x51')]&&agents[_0x365209[_0xf153('0x51')]]){agents[_0x365209['transfertargetuniqueid']][_0xf153('0x4c')]=0x1;transfers[_0x365209[_0xf153('0x51')]]=_['clone'](agents[_0x365209[_0xf153('0x51')]]);transfers[_0x365209[_0xf153('0x51')]][_0xf153('0x9')]=agents[_0x365209[_0xf153('0x43')]][_0xf153('0x9')];transfers[_0x365209['transfertargetuniqueid']][_0xf153('0x4e')]=agents[_0x365209['origtransfereruniqueid']][_0xf153('0x4e')];transfers[_0x365209[_0xf153('0x51')]]['agentcalledAt']=utils['now']();transfers[_0x365209[_0xf153('0x51')]][_0xf153('0x38')]=utils['now']();transfers[_0x365209[_0xf153('0x51')]][_0xf153('0x25')]=0x0;transfers[_0x365209[_0xf153('0x51')]]['agententerreason']=0x2;}}}catch(_0x671efe){utils[_0xf153('0x1d')](util[_0xf153('0x4')](_0xf153('0x42'),_0x365209[_0xf153('0x43')]),_0x671efe);}};exports[_0xf153('0x52')]=function(_0x37443f){try{utils[_0xf153('0x16')](util[_0xf153('0x4')](_0xf153('0x53'),_0x37443f[_0xf153('0x5')]),_0x37443f);if(agents[_0x37443f[_0xf153('0x5')]]&&agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x24')]===_0xf153('0x23')){if(_0x37443f[_0xf153('0x54')]==='21'){agents[_0x37443f['uniqueid']][_0xf153('0x24')]='rejected';agents[_0x37443f['uniqueid']][_0xf153('0x1a')]='rejected';}utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x55'),_0x37443f[_0xf153('0x5')],agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x7')],agents[_0x37443f['uniqueid']][_0xf153('0x24')],agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x1a')]));writeDB(agents[_0x37443f['uniqueid']]);var _0x59e22d=unanswered[_0xf153('0x56')](_0x37443f[_0xf153('0x5')]);if(_0x59e22d>-0x1){unanswered[_0xf153('0x57')](_0x59e22d,0x1);}}if(transfers[_0x37443f['uniqueid']]){transfers[_0x37443f[_0xf153('0x5')]]['agentcomplete']=!![];transfers[_0x37443f['uniqueid']][_0xf153('0x58')]=utils[_0xf153('0x19')]();transfers[_0x37443f[_0xf153('0x5')]]['talktime']=utils[_0xf153('0x37')](transfers[_0x37443f[_0xf153('0x5')]]['agentcompleteAt'],transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x38')]);transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x24')]=_0xf153('0x59');transfers[_0x37443f['uniqueid']][_0xf153('0x1a')]=_0xf153('0x39');utils[_0xf153('0x3')](util[_0xf153('0x4')](_0xf153('0x55'),_0x37443f[_0xf153('0x5')],transfers[_0x37443f[_0xf153('0x5')]]['membername'],transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x24')],transfers[_0x37443f[_0xf153('0x5')]][_0xf153('0x1a')]));writeDB(transfers[_0x37443f[_0xf153('0x5')]],!![]);}if(agents[_0x37443f[_0xf153('0x5')]]&&agents[_0x37443f['uniqueid']][_0xf153('0x38')]){agents[_0x37443f[_0xf153('0x5')]][_0xf153('0xf')]=!![];agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x58')]=utils[_0xf153('0x19')]();agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x27')]=utils[_0xf153('0x37')](agents[_0x37443f[_0xf153('0x5')]]['agentcompleteAt'],agents[_0x37443f['uniqueid']]['agentconnectAt']);agents[_0x37443f['uniqueid']][_0xf153('0x24')]=agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x3d')]?_0xf153('0x3d'):_0xf153('0x59');agents[_0x37443f['uniqueid']][_0xf153('0x1a')]=_0xf153('0x39');utils[_0xf153('0x3')](util[_0xf153('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x37443f[_0xf153('0x5')],agents[_0x37443f[_0xf153('0x5')]][_0xf153('0x7')],agents[_0x37443f['uniqueid']][_0xf153('0x24')],agents[_0x37443f['uniqueid']][_0xf153('0x1a')]));writeDB(agents[_0x37443f[_0xf153('0x5')]]);}}catch(_0x2651ff){utils['error'](util['format']('[%s][agents][hangup]',_0x37443f[_0xf153('0x5')]),_0x2651ff);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index a1b469c..b68acb6 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 _0xdb7e=['duration','diffTime','endtime','starttime','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','destinationchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','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','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt'];(function(_0x12e3d2,_0x77a0e0){var _0x2e632c=function(_0x52d273){while(--_0x52d273){_0x12e3d2['push'](_0x12e3d2['shift']());}};_0x2e632c(++_0x77a0e0);}(_0xdb7e,0x11a));var _0xedb7=function(_0x261379,_0x16c448){_0x261379=_0x261379-0x0;var _0xba19d3=_0xdb7e[_0x261379];return _0xba19d3;};'use strict';var _=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var utils=require(_0xedb7('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0xedb7('0x3'),_0xedb7('0x4'),_0xedb7('0x4'),'NO\x20ANSWER',_0xedb7('0x3'),_0xedb7('0x3'),_0xedb7('0x5'),_0xedb7('0x6'),_0xedb7('0x4'),_0xedb7('0x4'),_0xedb7('0x4')];var channels={};function writeDB(_0x20a7c7){var _0x26774f;if(transfers[_0xedb7('0x7')][_0x20a7c7['uniqueid']]){_0x26774f=_0x20a7c7[_0xedb7('0x8')];_0x20a7c7[_0xedb7('0x8')]=transfers[_0xedb7('0x7')][_0x20a7c7[_0xedb7('0x8')]][_0xedb7('0x9')];}utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0xc'),_0x20a7c7[_0xedb7('0x8')],_0x20a7c7[_0xedb7('0xd')],_0x20a7c7[_0xedb7('0xe')],_0x20a7c7[_0xedb7('0xf')],_0x20a7c7[_0xedb7('0x10')],_0x20a7c7['calleridnum'],_0x20a7c7['connectedlinenum'],_0x20a7c7[_0xedb7('0x11')]));if(_0x20a7c7[_0xedb7('0x12')]){utils[_0xedb7('0x13')](_0x20a7c7[_0xedb7('0x12')])[_0xedb7('0x14')](function(_0x2923c2){if(_0x2923c2){_0x20a7c7[_0xedb7('0x15')]=_0x2923c2['id'];}utils[_0xedb7('0x16')](_0xedb7('0x17'),_0x20a7c7);});}else{utils['request']('CreateVoiceCallReport',_0x20a7c7);}if(channels[_0x20a7c7[_0xedb7('0x8')]]){delete channels[_0x20a7c7[_0xedb7('0x8')]];}else if(_0x26774f&&channels[_0x26774f]){if(!transfers[_0xedb7('0x7')][_0x26774f]['recording'])delete transfers[_0xedb7('0x7')][_0x26774f];delete channels[_0x26774f];}}exports[_0xedb7('0x18')]=function(_0x33554d){try{utils[_0xedb7('0x19')](util[_0xedb7('0xb')]('[%s][calls][newchannel]',_0x33554d['uniqueid']),_0x33554d);if(_0x33554d[_0xedb7('0x8')]==_0x33554d[_0xedb7('0x1a')]&&_0x33554d[_0xedb7('0xd')]!=_0xedb7('0x1b')){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x1c'),_0x33554d[_0xedb7('0x8')],_0x33554d['context'],_0x33554d[_0xedb7('0x1d')]));channels[_0x33554d['uniqueid']]={'uniqueid':_0x33554d[_0xedb7('0x8')],'accountcode':_0x33554d[_0xedb7('0x12')],'source':_0x33554d[_0xedb7('0x1e')],'destination':_0x33554d['exten'],'destinationcontext':_0x33554d['context'],'channel':_0x33554d[_0xedb7('0xd')],'starttime':utils[_0xedb7('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xedb7('0x20')};}}catch(_0xff6827){utils['error'](util[_0xedb7('0xb')]('[%s][calls][newchannel]',_0x33554d['uniqueid']),_0xff6827);}};exports[_0xedb7('0x21')]=function(_0x45b331){try{utils['debug'](util[_0xedb7('0xb')](_0xedb7('0x22'),_0x45b331[_0xedb7('0x8')]),_0x45b331);if(!_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x8')]])&&_0x45b331[_0xedb7('0x24')]==0x6){utils[_0xedb7('0xa')](util[_0xedb7('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x45b331[_0xedb7('0x8')],_0x45b331['context'],_0x45b331['channel']));if(_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x8')]]['systemanswertime'])){channels[_0x45b331['uniqueid']][_0xedb7('0x25')]=utils['now']();}}else if(!_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x1a')]])&&_0x45b331[_0xedb7('0x24')]==0x6&&_0x45b331['context']!=_0xedb7('0x26')){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x27'),_0x45b331[_0xedb7('0x8')],_0x45b331[_0xedb7('0x1a')],_0x45b331['context'],_0x45b331[_0xedb7('0xd')]));channels[_0x45b331['linkedid']][_0xedb7('0x12')]=_0x45b331['accountcode'];channels[_0x45b331[_0xedb7('0x1a')]]['destinationchannel']=_0x45b331[_0xedb7('0xd')];if(_[_0xedb7('0x23')](channels[_0x45b331[_0xedb7('0x1a')]]['answertime'])){channels[_0x45b331['linkedid']][_0xedb7('0x28')]=utils[_0xedb7('0x1f')]();}channels[_0x45b331[_0xedb7('0x1a')]]['disposition']=dispositions[_[_0xedb7('0x29')](_0x45b331['channelstate'])]||_0xedb7('0x5');}}catch(_0x182fcc){utils[_0xedb7('0x2a')](util[_0xedb7('0xb')](_0xedb7('0x22'),_0x45b331[_0xedb7('0x8')]),_0x182fcc);}};exports['hangup']=function(_0x401c28){try{if(!_[_0xedb7('0x23')](channels[_0x401c28['uniqueid']])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')](_0xedb7('0x2b'),_0x401c28[_0xedb7('0x8')]),_0x401c28);if(_[_0xedb7('0x23')](channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x2c')])){channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x2c')]=_0x401c28[_0xedb7('0x2d')]+'\x20<'+_0x401c28[_0xedb7('0x1e')]+'>';}utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x2e'),_0x401c28['uniqueid'],channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x2c')],_0x401c28[_0xedb7('0x2f')]));channels[_0x401c28[_0xedb7('0x8')]]['endtime']=utils[_0xedb7('0x1f')]();channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x30')]=utils[_0xedb7('0x31')](channels[_0x401c28['uniqueid']][_0xedb7('0x32')],channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x33')]);channels[_0x401c28[_0xedb7('0x8')]]['billableseconds']=channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x28')]?utils[_0xedb7('0x31')](channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x32')],channels[_0x401c28[_0xedb7('0x8')]][_0xedb7('0x28')]):0x0;writeDB(channels[_0x401c28['uniqueid']]);}}catch(_0x14ebb7){utils['error'](util[_0xedb7('0xb')](_0xedb7('0x2b'),_0x401c28[_0xedb7('0x8')]),_0x14ebb7);}};exports['attendedtransfer']=function(_0x41fef4){try{if(!_[_0xedb7('0x23')](channels[_0x41fef4[_0xedb7('0x34')]])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')]('[%s][calls][attendedtransfer]',_0x41fef4['origtransfereruniqueid']),_0x41fef4);if(channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0xd')]==_0x41fef4[_0xedb7('0x35')]){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x36'),_0x41fef4[_0xedb7('0x37')],_0x41fef4[_0xedb7('0x34')],_0x41fef4[_0xedb7('0x38')]));channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x39')]=_0x41fef4[_0xedb7('0x38')];channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x3a')]='_attended';}else if(channels[_0x41fef4[_0xedb7('0x34')]]['channel']=_0x41fef4[_0xedb7('0x3b')]){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x36'),_0x41fef4[_0xedb7('0x37')],_0x41fef4[_0xedb7('0x34')],_0x41fef4[_0xedb7('0x3c')]));channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x39')]=_0x41fef4[_0xedb7('0x3c')];channels[_0x41fef4[_0xedb7('0x34')]][_0xedb7('0x3a')]=_0xedb7('0x3d');}}}catch(_0x3082fa){utils[_0xedb7('0x2a')](util[_0xedb7('0xb')]('[%s][calls][attendedtransfer]',_0x41fef4[_0xedb7('0x37')]),_0x3082fa);}};exports[_0xedb7('0x3e')]=function(_0x2e55ee){try{if(!_[_0xedb7('0x23')](channels[_0x2e55ee[_0xedb7('0x8')]])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')](_0xedb7('0x3f'),_0x2e55ee[_0xedb7('0x8')]),_0x2e55ee);channels[_0x2e55ee[_0xedb7('0x8')]][_0xedb7('0x40')]=utils[_0xedb7('0x1f')]();utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x41'),_0x2e55ee[_0xedb7('0x8')],channels[_0x2e55ee[_0xedb7('0x8')]][_0xedb7('0x40')]));}}catch(_0x578751){utils['error'](util[_0xedb7('0xb')](_0xedb7('0x3f'),_0x2e55ee[_0xedb7('0x8')]),_0x578751);}};exports[_0xedb7('0x42')]=function(_0x41a834){try{if(!_[_0xedb7('0x23')](channels[_0x41a834['uniqueid']])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')]('[%s][calls][musiconholdstop]',_0x41a834[_0xedb7('0x8')]),_0x41a834);if(!_[_0xedb7('0x23')](channels[_0x41a834['uniqueid']]['musiconholdstartAt'])){channels[_0x41a834[_0xedb7('0x8')]]['mohtime']+=utils[_0xedb7('0x31')](utils[_0xedb7('0x1f')](),channels[_0x41a834['uniqueid']]['musiconholdstartAt']);utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x43'),_0x41a834['uniqueid'],channels[_0x41a834[_0xedb7('0x8')]][_0xedb7('0x44')]));delete channels[_0x41a834['uniqueid']][_0xedb7('0x40')];}}}catch(_0x2defae){utils[_0xedb7('0x2a')](util[_0xedb7('0xb')](_0xedb7('0x45'),_0x41a834[_0xedb7('0x8')]),_0x2defae);}};exports['varset']=function(_0x523175){try{if(!_[_0xedb7('0x23')](channels[_0x523175[_0xedb7('0x8')]])){utils[_0xedb7('0x19')](util[_0xedb7('0xb')](_0xedb7('0x46'),_0x523175[_0xedb7('0x8')]),_0x523175);if(!_['isNil'](_0x523175[_0xedb7('0x47')]['xmd-originatecalleridnum'])){utils[_0xedb7('0xa')](util['format'](_0xedb7('0x48'),_0x523175[_0xedb7('0x8')],_0x523175[_0xedb7('0x49')]));channels[_0x523175['uniqueid']][_0xedb7('0x4a')]=_0x523175[_0xedb7('0x49')];}if(!_[_0xedb7('0x23')](_0x523175[_0xedb7('0x47')][_0xedb7('0x4b')])){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x4c'),_0x523175[_0xedb7('0x8')],_0x523175['value']));channels[_0x523175[_0xedb7('0x8')]]['destination']=_0x523175[_0xedb7('0x49')];channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x2c')]='\x22'+_0x523175[_0xedb7('0x49')]+_0xedb7('0x4d')+_0x523175[_0xedb7('0x49')]+'>';}if(!_[_0xedb7('0x23')](_0x523175['variable']['xmd-callerid-preview'])||!_['isNil'](_0x523175[_0xedb7('0x47')][_0xedb7('0x4e')])){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x4f'),_0x523175['uniqueid'],!_[_0xedb7('0x23')](_0x523175['variable'][_0xedb7('0x50')])?_0xedb7('0x50'):'xmd-callerid',_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x2c')]=_0x523175[_0xedb7('0x49')];}if(!_[_0xedb7('0x23')](_0x523175['variable'][_0xedb7('0x51')])||!_[_0xedb7('0x23')](_0x523175[_0xedb7('0x47')][_0xedb7('0x52')])){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x4f'),_0x523175[_0xedb7('0x8')],!_['isNil'](_0x523175[_0xedb7('0x47')][_0xedb7('0x51')])?'xmd-queue':_0xedb7('0x52'),_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x53')]=_0xedb7('0x54');channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x55')]=_0x523175[_0xedb7('0x49')];channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0xe')]=!![];}if(!_[_0xedb7('0x23')](_0x523175['variable']['xmd-contactid'])){utils['info'](util[_0xedb7('0xb')](_0xedb7('0x56'),_0x523175[_0xedb7('0x8')],_0x523175['value']));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x57')]=_0x523175['value'];}if(!_[_0xedb7('0x23')](_0x523175['variable'][_0xedb7('0x58')])){utils[_0xedb7('0xa')](util['format'](_0xedb7('0x59'),_0x523175['uniqueid'],_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]]['type']=_0x523175['value'];}if(!_[_0xedb7('0x23')](_0x523175[_0xedb7('0x47')][_0xedb7('0x5a')])){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x5b'),_0x523175[_0xedb7('0x8')],_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]]['routeid']=_0x523175[_0xedb7('0x49')];}if(!_['isNil'](_0x523175[_0xedb7('0x47')][_0xedb7('0x5c')])){utils[_0xedb7('0xa')](util[_0xedb7('0xb')](_0xedb7('0x5d'),_0x523175[_0xedb7('0x8')],_0x523175[_0xedb7('0x49')]));channels[_0x523175[_0xedb7('0x8')]][_0xedb7('0x5c')]=_0x523175[_0xedb7('0x49')];}}}catch(_0x20cb3f){utils[_0xedb7('0x2a')](util['format'](_0xedb7('0x46'),_0x523175['uniqueid']),_0x20cb3f);}};exports[_0xedb7('0x5e')]=function(_0x46695b){try{if(!_['isNil'](channels[_0x46695b[_0xedb7('0x8')]])){utils['debug'](util[_0xedb7('0xb')](_0xedb7('0x5f'),_0x46695b[_0xedb7('0x8')]),_0x46695b);utils[_0xedb7('0xa')](util[_0xedb7('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x46695b[_0xedb7('0x8')],_0x46695b['application'],_0x46695b[_0xedb7('0x60')]));if(_0x46695b[_0xedb7('0x61')][_0xedb7('0x62')]()==_0xedb7('0x63')&&_[_0xedb7('0x64')](_0x46695b[_0xedb7('0x60')][_0xedb7('0x62')](),_0xedb7('0x65'))){var _0x99ce77=_0x46695b[_0xedb7('0x60')][_0xedb7('0x66')]('=');var _0x2ff4bd=_0x99ce77[0x0][_0xedb7('0x67')](_0x99ce77[0x0][_0xedb7('0x68')]('(')+0x1,_0x99ce77[0x0][_0xedb7('0x68')](')'));var _0x27555c=_0x99ce77[0x1];channels[_0x46695b['uniqueid']][_0x2ff4bd]=_0x27555c;}if(!_[_0xedb7('0x69')]([_0xedb7('0x6a'),_0xedb7('0x6b'),_0xedb7('0x6c'),'set',_0xedb7('0x6d')],_0x46695b['application'][_0xedb7('0x62')]())){channels[_0x46695b['uniqueid']][_0xedb7('0x53')]=_0x46695b['application'];channels[_0x46695b[_0xedb7('0x8')]][_0xedb7('0x55')]=_0x46695b[_0xedb7('0x60')];}}}catch(_0x5f4532){utils['error'](util['format'](_0xedb7('0x5f'),_0x46695b['uniqueid']),_0x5f4532);}}; \ No newline at end of file +var _0xc76e=['[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','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','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','toLowerCase','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','ANSWERED','FAILED','blinds','uniqueid','transfereeuniqueid','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','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart'];(function(_0x3bb326,_0x475090){var _0x245859=function(_0x170f6c){while(--_0x170f6c){_0x3bb326['push'](_0x3bb326['shift']());}};_0x245859(++_0x475090);}(_0xc76e,0x10c));var _0xec76=function(_0x508f70,_0x3431f5){_0x508f70=_0x508f70-0x0;var _0x48beb4=_0xc76e[_0x508f70];return _0x48beb4;};'use strict';var _=require(_0xec76('0x0'));var util=require(_0xec76('0x1'));var utils=require(_0xec76('0x2'));var transfers=require(_0xec76('0x3'));var dispositions=[_0xec76('0x4'),'FAILED','FAILED',_0xec76('0x4'),_0xec76('0x4'),'NO\x20ANSWER',_0xec76('0x5'),'BUSY',_0xec76('0x6'),_0xec76('0x6'),_0xec76('0x6')];var channels={};function writeDB(_0xfe33e0){var _0x2a8b9e;if(transfers[_0xec76('0x7')][_0xfe33e0[_0xec76('0x8')]]){_0x2a8b9e=_0xfe33e0[_0xec76('0x8')];_0xfe33e0[_0xec76('0x8')]=transfers['blinds'][_0xfe33e0[_0xec76('0x8')]][_0xec76('0x9')];}utils['info'](util[_0xec76('0xa')](_0xec76('0xb'),_0xfe33e0['uniqueid'],_0xfe33e0[_0xec76('0xc')],_0xfe33e0[_0xec76('0xd')],_0xfe33e0[_0xec76('0xe')],_0xfe33e0[_0xec76('0xf')],_0xfe33e0[_0xec76('0x10')],_0xfe33e0[_0xec76('0x11')],_0xfe33e0[_0xec76('0x12')]));if(_0xfe33e0[_0xec76('0x13')]){utils[_0xec76('0x14')](_0xfe33e0[_0xec76('0x13')])[_0xec76('0x15')](function(_0xec7def){if(_0xec7def){_0xfe33e0[_0xec76('0x16')]=_0xec7def['id'];}utils[_0xec76('0x17')](_0xec76('0x18'),_0xfe33e0);});}else{utils[_0xec76('0x17')]('CreateVoiceCallReport',_0xfe33e0);}if(channels[_0xfe33e0[_0xec76('0x8')]]){delete channels[_0xfe33e0['uniqueid']];}else if(_0x2a8b9e&&channels[_0x2a8b9e]){if(!transfers[_0xec76('0x7')][_0x2a8b9e][_0xec76('0x19')])delete transfers[_0xec76('0x7')][_0x2a8b9e];delete channels[_0x2a8b9e];}}exports[_0xec76('0x1a')]=function(_0x38be5e){try{utils[_0xec76('0x1b')](util['format']('[%s][calls][newchannel]',_0x38be5e[_0xec76('0x8')]),_0x38be5e);if(_0x38be5e[_0xec76('0x8')]==_0x38be5e[_0xec76('0x1c')]&&_0x38be5e[_0xec76('0xc')]!=_0xec76('0x1d')){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x1f'),_0x38be5e[_0xec76('0x8')],_0x38be5e[_0xec76('0x20')],_0x38be5e[_0xec76('0x21')]));channels[_0x38be5e[_0xec76('0x8')]]={'uniqueid':_0x38be5e['uniqueid'],'accountcode':_0x38be5e[_0xec76('0x13')],'source':_0x38be5e[_0xec76('0x10')],'destination':_0x38be5e[_0xec76('0x21')],'destinationcontext':_0x38be5e[_0xec76('0x20')],'channel':_0x38be5e[_0xec76('0xc')],'starttime':utils[_0xec76('0x22')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xec76('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x5324f7){utils[_0xec76('0x23')](util['format'](_0xec76('0x24'),_0x38be5e[_0xec76('0x8')]),_0x5324f7);}};exports[_0xec76('0x25')]=function(_0x2fe9ff){try{utils[_0xec76('0x1b')](util['format'](_0xec76('0x26'),_0x2fe9ff['uniqueid']),_0x2fe9ff);if(!_['isNil'](channels[_0x2fe9ff['uniqueid']])&&_0x2fe9ff[_0xec76('0x27')]==0x6){utils[_0xec76('0x1e')](util['format'](_0xec76('0x28'),_0x2fe9ff[_0xec76('0x8')],_0x2fe9ff[_0xec76('0x20')],_0x2fe9ff[_0xec76('0xc')]));if(_[_0xec76('0x29')](channels[_0x2fe9ff[_0xec76('0x8')]][_0xec76('0x2a')])){channels[_0x2fe9ff[_0xec76('0x8')]][_0xec76('0x2a')]=utils['now']();}}else if(!_[_0xec76('0x29')](channels[_0x2fe9ff[_0xec76('0x1c')]])&&_0x2fe9ff['channelstate']==0x6&&_0x2fe9ff[_0xec76('0x20')]!=_0xec76('0x2b')){utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2fe9ff['uniqueid'],_0x2fe9ff[_0xec76('0x1c')],_0x2fe9ff[_0xec76('0x20')],_0x2fe9ff[_0xec76('0xc')]));channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x13')]=_0x2fe9ff[_0xec76('0x13')];channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2c')]=_0x2fe9ff[_0xec76('0xc')];if(_[_0xec76('0x29')](channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2d')])){channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2d')]=utils[_0xec76('0x22')]();}channels[_0x2fe9ff[_0xec76('0x1c')]][_0xec76('0x2e')]=dispositions[_[_0xec76('0x2f')](_0x2fe9ff['channelstate'])]||_0xec76('0x5');}}catch(_0x30a212){utils[_0xec76('0x23')](util[_0xec76('0xa')](_0xec76('0x26'),_0x2fe9ff[_0xec76('0x8')]),_0x30a212);}};exports[_0xec76('0x30')]=function(_0xccff8b){try{if(!_['isNil'](channels[_0xccff8b[_0xec76('0x8')]])){utils[_0xec76('0x1b')](util['format']('[%s][calls][hangup]',_0xccff8b['uniqueid']),_0xccff8b);if(_[_0xec76('0x29')](channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x31')])){channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x31')]=_0xccff8b[_0xec76('0x32')]+'\x20<'+_0xccff8b[_0xec76('0x10')]+'>';}utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xccff8b['uniqueid'],channels[_0xccff8b[_0xec76('0x8')]]['callerid'],_0xccff8b['cause-txt']));channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x33')]=utils[_0xec76('0x22')]();channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x34')]=utils['diffTime'](channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x33')],channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x35')]);channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x36')]=channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x2d')]?utils[_0xec76('0x37')](channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x33')],channels[_0xccff8b[_0xec76('0x8')]][_0xec76('0x2d')]):0x0;writeDB(channels[_0xccff8b[_0xec76('0x8')]]);}}catch(_0x1eb42a){utils['error'](util[_0xec76('0xa')](_0xec76('0x38'),_0xccff8b[_0xec76('0x8')]),_0x1eb42a);}};exports[_0xec76('0x39')]=function(_0x36911f){try{if(!_['isNil'](channels[_0x36911f[_0xec76('0x3a')]])){utils[_0xec76('0x1b')](util[_0xec76('0xa')]('[%s][calls][attendedtransfer]',_0x36911f['origtransfereruniqueid']),_0x36911f);if(channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0xc')]==_0x36911f['transfereechannel']){utils[_0xec76('0x1e')](util['format'](_0xec76('0x3b'),_0x36911f[_0xec76('0x3c')],_0x36911f[_0xec76('0x3a')],_0x36911f[_0xec76('0x3d')]));channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0x2c')]=_0x36911f[_0xec76('0x3d')];channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0x3e')]=_0xec76('0x3f');}else if(channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0xc')]=_0x36911f[_0xec76('0x40')]){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x3b'),_0x36911f[_0xec76('0x3c')],_0x36911f[_0xec76('0x3a')],_0x36911f['origtransfererchannel']));channels[_0x36911f[_0xec76('0x3a')]]['destinationchannel']=_0x36911f[_0xec76('0x41')];channels[_0x36911f[_0xec76('0x3a')]][_0xec76('0x3e')]=_0xec76('0x3f');}}}catch(_0x8fb197){utils[_0xec76('0x23')](util['format'](_0xec76('0x42'),_0x36911f['origtransfereruniqueid']),_0x8fb197);}};exports[_0xec76('0x43')]=function(_0x3afa00){try{if(!_['isNil'](channels[_0x3afa00['uniqueid']])){utils[_0xec76('0x1b')](util[_0xec76('0xa')](_0xec76('0x44'),_0x3afa00['uniqueid']),_0x3afa00);channels[_0x3afa00[_0xec76('0x8')]]['musiconholdstartAt']=utils[_0xec76('0x22')]();utils['info'](util[_0xec76('0xa')](_0xec76('0x45'),_0x3afa00['uniqueid'],channels[_0x3afa00[_0xec76('0x8')]][_0xec76('0x46')]));}}catch(_0x5784a0){utils['error'](util[_0xec76('0xa')](_0xec76('0x44'),_0x3afa00[_0xec76('0x8')]),_0x5784a0);}};exports[_0xec76('0x47')]=function(_0x51d35d){try{if(!_[_0xec76('0x29')](channels[_0x51d35d[_0xec76('0x8')]])){utils[_0xec76('0x1b')](util[_0xec76('0xa')](_0xec76('0x48'),_0x51d35d[_0xec76('0x8')]),_0x51d35d);if(!_[_0xec76('0x29')](channels[_0x51d35d['uniqueid']][_0xec76('0x46')])){channels[_0x51d35d[_0xec76('0x8')]]['mohtime']+=utils[_0xec76('0x37')](utils['now'](),channels[_0x51d35d['uniqueid']][_0xec76('0x46')]);utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x49'),_0x51d35d['uniqueid'],channels[_0x51d35d[_0xec76('0x8')]][_0xec76('0x4a')]));delete channels[_0x51d35d[_0xec76('0x8')]][_0xec76('0x46')];}}}catch(_0x3bdd53){utils[_0xec76('0x23')](util[_0xec76('0xa')]('[%s][calls][musiconholdstop]',_0x51d35d['uniqueid']),_0x3bdd53);}};exports[_0xec76('0x4b')]=function(_0x558991){try{if(!_[_0xec76('0x29')](channels[_0x558991['uniqueid']])){utils[_0xec76('0x1b')](util[_0xec76('0xa')](_0xec76('0x4c'),_0x558991[_0xec76('0x8')]),_0x558991);if(!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')][_0xec76('0x4e')])){utils['info'](util[_0xec76('0xa')](_0xec76('0x4f'),_0x558991[_0xec76('0x8')],_0x558991[_0xec76('0x50')]));channels[_0x558991['uniqueid']][_0xec76('0x51')]=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')][_0xec76('0x52')])){utils['info'](util[_0xec76('0xa')](_0xec76('0x53'),_0x558991['uniqueid'],_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x54')]=_0x558991['value'];channels[_0x558991['uniqueid']][_0xec76('0x31')]='\x22'+_0x558991[_0xec76('0x50')]+'\x22\x20<'+_0x558991[_0xec76('0x50')]+'>';}if(!_['isNil'](_0x558991[_0xec76('0x4d')][_0xec76('0x55')])||!_['isNil'](_0x558991[_0xec76('0x4d')][_0xec76('0x56')])){utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x558991[_0xec76('0x8')],!_[_0xec76('0x29')](_0x558991['variable'][_0xec76('0x55')])?_0xec76('0x55'):'xmd-callerid',_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x31')]=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991['variable']['xmd-queue'])||!_[_0xec76('0x29')](_0x558991['variable']['xmcs-queue'])){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x57'),_0x558991[_0xec76('0x8')],!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')]['xmd-queue'])?'xmd-queue':_0xec76('0x58'),_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x59')]='Queue';channels[_0x558991[_0xec76('0x8')]][_0xec76('0x5a')]=_0x558991[_0xec76('0x50')];channels[_0x558991['uniqueid']]['queue']=!![];}if(!_['isNil'](_0x558991[_0xec76('0x4d')]['xmd-contactid'])){utils[_0xec76('0x1e')](util['format'](_0xec76('0x5b'),_0x558991[_0xec76('0x8')],_0x558991[_0xec76('0x50')]));channels[_0x558991[_0xec76('0x8')]]['ContactId']=_0x558991['value'];}if(!_[_0xec76('0x29')](_0x558991['variable'][_0xec76('0x5c')])){utils[_0xec76('0x1e')](util[_0xec76('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x558991[_0xec76('0x8')],_0x558991[_0xec76('0x50')]));channels[_0x558991['uniqueid']][_0xec76('0x5d')]=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991['variable'][_0xec76('0x5e')])){utils[_0xec76('0x1e')](util[_0xec76('0xa')](_0xec76('0x5f'),_0x558991[_0xec76('0x8')],_0x558991['value']));channels[_0x558991[_0xec76('0x8')]]['routeid']=_0x558991[_0xec76('0x50')];}if(!_[_0xec76('0x29')](_0x558991[_0xec76('0x4d')][_0xec76('0x60')])){utils[_0xec76('0x1e')](util['format'](_0xec76('0x61'),_0x558991[_0xec76('0x8')],_0x558991['value']));channels[_0x558991[_0xec76('0x8')]][_0xec76('0x60')]=_0x558991['value'];}}}catch(_0x45ec5f){utils['error'](util['format'](_0xec76('0x4c'),_0x558991[_0xec76('0x8')]),_0x45ec5f);}};exports[_0xec76('0x62')]=function(_0x5e6f8c){try{if(!_[_0xec76('0x29')](channels[_0x5e6f8c['uniqueid']])){utils[_0xec76('0x1b')](util['format']('[%s][calls][newexten]',_0x5e6f8c[_0xec76('0x8')]),_0x5e6f8c);utils['info'](util[_0xec76('0xa')](_0xec76('0x63'),_0x5e6f8c[_0xec76('0x8')],_0x5e6f8c[_0xec76('0x64')],_0x5e6f8c[_0xec76('0x65')]));if(_0x5e6f8c[_0xec76('0x64')]['toLowerCase']()==_0xec76('0x66')&&_[_0xec76('0x67')](_0x5e6f8c['appdata']['toLowerCase'](),_0xec76('0x68'))){var _0x2c0274=_0x5e6f8c['appdata'][_0xec76('0x69')]('=');var _0x2dae20=_0x2c0274[0x0][_0xec76('0x6a')](_0x2c0274[0x0][_0xec76('0x6b')]('(')+0x1,_0x2c0274[0x0][_0xec76('0x6b')](')'));var _0x2b27b0=_0x2c0274[0x1];channels[_0x5e6f8c['uniqueid']][_0x2dae20]=_0x2b27b0;}if(!_[_0xec76('0x6c')]([_0xec76('0x30'),_0xec76('0x6d'),'execif',_0xec76('0x66'),'gotoif'],_0x5e6f8c[_0xec76('0x64')][_0xec76('0x6e')]())){channels[_0x5e6f8c[_0xec76('0x8')]][_0xec76('0x59')]=_0x5e6f8c[_0xec76('0x64')];channels[_0x5e6f8c[_0xec76('0x8')]][_0xec76('0x5a')]=_0x5e6f8c[_0xec76('0x65')];}}}catch(_0x368e31){utils['error'](util['format'](_0xec76('0x6f'),_0x5e6f8c[_0xec76('0x8')]),_0x368e31);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c25e9f6..e973a52 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 _0x1563=['fullybooted','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','[core]\x20shutdown'];(function(_0x2ee3ae,_0x4cf4e3){var _0x593b47=function(_0x572368){while(--_0x572368){_0x2ee3ae['push'](_0x2ee3ae['shift']());}};_0x593b47(++_0x4cf4e3);}(_0x1563,0x199));var _0x3156=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0x1563[_0x2cacef];return _0x289ba6;};'use strict';var utils=require(_0x3156('0x0'));exports[_0x3156('0x1')]=function(){utils[_0x3156('0x2')](_0x3156('0x3'));};exports['shutdown']=function(){utils[_0x3156('0x2')](_0x3156('0x4'));};exports[_0x3156('0x5')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x444aba){utils['error'](_0x3156('0x6'),_0x444aba);};exports['close']=function(){utils[_0x3156('0x2')](_0x3156('0x7'));};exports[_0x3156('0x8')]=function(_0x3243f4){}; \ No newline at end of file +var _0x2e01=['info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils'];(function(_0x569926,_0x33ca53){var _0x4cc489=function(_0x3a6291){while(--_0x3a6291){_0x569926['push'](_0x569926['shift']());}};_0x4cc489(++_0x33ca53);}(_0x2e01,0x6b));var _0x12e0=function(_0x18a65d,_0x24ee48){_0x18a65d=_0x18a65d-0x0;var _0x268191=_0x2e01[_0x18a65d];return _0x268191;};'use strict';var utils=require(_0x12e0('0x0'));exports['connect']=function(){utils[_0x12e0('0x1')](_0x12e0('0x2'));};exports[_0x12e0('0x3')]=function(){utils[_0x12e0('0x1')](_0x12e0('0x4'));};exports[_0x12e0('0x5')]=function(){utils['info'](_0x12e0('0x6'));};exports[_0x12e0('0x7')]=function(_0x3c3915){utils[_0x12e0('0x7')](_0x12e0('0x8'),_0x3c3915);};exports[_0x12e0('0x9')]=function(){utils[_0x12e0('0x1')](_0x12e0('0xa'));};exports[_0x12e0('0xb')]=function(_0x1cb735){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 7b79cb5..7ec4916 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 _0xd0fd=['assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','billableseconds','endtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','[%s][dials][dialbegin]'];(function(_0x96cefd,_0x25cb5d){var _0x4310c1=function(_0x4e9c5f){while(--_0x4e9c5f){_0x96cefd['push'](_0x96cefd['shift']());}};_0x4310c1(++_0x25cb5d);}(_0xd0fd,0x76));var _0xdd0f=function(_0x1cb85b,_0x2274e1){_0x1cb85b=_0x1cb85b-0x0;var _0x323723=_0xd0fd[_0x1cb85b];return _0x323723;};'use strict';var _=require(_0xdd0f('0x0'));var util=require('util');var utils=require(_0xdd0f('0x1'));var dials={};function writeDB(_0x247734){utils[_0xdd0f('0x2')](util[_0xdd0f('0x3')](_0xdd0f('0x4'),_0x247734[_0xdd0f('0x5')],_0x247734[_0xdd0f('0x6')],_0x247734[_0xdd0f('0x7')],_0x247734[_0xdd0f('0x8')],_0x247734[_0xdd0f('0x9')],_0x247734[_0xdd0f('0xa')]));utils[_0xdd0f('0xb')](_0xdd0f('0xc'),_0x247734);delete dials[_0x247734[_0xdd0f('0x5')]];}exports['newexten']=function(_0x4cc32b){try{utils[_0xdd0f('0xd')](util['format'](_0xdd0f('0xe'),_0x4cc32b[_0xdd0f('0x5')]),_0x4cc32b);utils[_0xdd0f('0x2')](util[_0xdd0f('0x3')](_0xdd0f('0xf'),_0x4cc32b[_0xdd0f('0x5')],_0x4cc32b[_0xdd0f('0x10')],_0x4cc32b[_0xdd0f('0x11')]));if(_0x4cc32b[_0xdd0f('0x10')]['toLowerCase']()=='set'&&_['startsWith'](_0x4cc32b[_0xdd0f('0x11')][_0xdd0f('0x12')](),_0xdd0f('0x13'))){var _0x42733b=_0x4cc32b['appdata'][_0xdd0f('0x14')]('=');dials[_0x4cc32b['uniqueid']]={'routeId':_0x42733b[0x1]};}}catch(_0x1b7545){utils[_0xdd0f('0x15')](util[_0xdd0f('0x3')](_0xdd0f('0xe'),_0x4cc32b['uniqueid']),_0x1b7545);}};exports[_0xdd0f('0x16')]=function(_0x26861a){try{utils['debug'](util['format']('[%s][dials][varset]',_0x26861a[_0xdd0f('0x5')]),_0x26861a);if(!_[_0xdd0f('0x17')](_0x26861a[_0xdd0f('0x18')]['outboundrouteid'])){utils[_0xdd0f('0x2')](util['format'](_0xdd0f('0x19'),_0x26861a[_0xdd0f('0x5')],_0x26861a[_0xdd0f('0x1a')]));dials[_0x26861a[_0xdd0f('0x5')]]={'routeId':_0x26861a[_0xdd0f('0x1a')]};}}catch(_0x3a3771){utils[_0xdd0f('0x15')](util[_0xdd0f('0x3')](_0xdd0f('0x1b'),_0x26861a[_0xdd0f('0x5')]),_0x3a3771);}};exports['dialbegin']=function(_0x173c38){try{if(!_[_0xdd0f('0x17')](dials[_0x173c38[_0xdd0f('0x5')]])){utils[_0xdd0f('0xd')](util[_0xdd0f('0x3')](_0xdd0f('0x1c'),_0x173c38[_0xdd0f('0x5')]),_0x173c38);dials[_0x173c38[_0xdd0f('0x5')]]=_[_0xdd0f('0x1d')](dials[_0x173c38[_0xdd0f('0x5')]],_0x173c38);dials[_0x173c38[_0xdd0f('0x5')]][_0xdd0f('0x1e')]=utils[_0xdd0f('0x1f')]();dials[_0x173c38[_0xdd0f('0x5')]]['lastevent']=_0xdd0f('0x20');utils[_0xdd0f('0x2')](util[_0xdd0f('0x3')](_0xdd0f('0x21'),_0x173c38[_0xdd0f('0x5')],dials[_0x173c38['uniqueid']][_0xdd0f('0x1e')]));}}catch(_0x2070dd){utils['error'](util[_0xdd0f('0x3')](_0xdd0f('0x1c'),_0x173c38['uniqueid']),_0x2070dd);}};exports[_0xdd0f('0x22')]=function(_0x1ed20a){try{if(!_['isNil'](dials[_0x1ed20a[_0xdd0f('0x5')]])){utils[_0xdd0f('0xd')](util[_0xdd0f('0x3')](_0xdd0f('0x23'),_0x1ed20a[_0xdd0f('0x5')]),_0x1ed20a);dials[_0x1ed20a[_0xdd0f('0x5')]][_0xdd0f('0xa')]=_0x1ed20a[_0xdd0f('0xa')];if(_0x1ed20a[_0xdd0f('0xa')]==_0xdd0f('0x24')){dials[_0x1ed20a[_0xdd0f('0x5')]]=_[_0xdd0f('0x1d')](dials[_0x1ed20a[_0xdd0f('0x5')]],_0x1ed20a);dials[_0x1ed20a[_0xdd0f('0x5')]]['answertime']=utils[_0xdd0f('0x1f')]();dials[_0x1ed20a[_0xdd0f('0x5')]][_0xdd0f('0x25')]=_0xdd0f('0x26');utils['info'](util[_0xdd0f('0x3')](_0xdd0f('0x27'),_0x1ed20a[_0xdd0f('0x5')],_0x1ed20a['dialstatus'],dials[_0x1ed20a['uniqueid']][_0xdd0f('0x28')]));}else{utils['info'](util[_0xdd0f('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x1ed20a[_0xdd0f('0x5')],_0x1ed20a[_0xdd0f('0xa')]));}}}catch(_0x46b58a){utils[_0xdd0f('0x15')](util[_0xdd0f('0x3')](_0xdd0f('0x23'),_0x1ed20a[_0xdd0f('0x5')]),_0x46b58a);}};exports['hangup']=function(_0x11793f){try{if(!_[_0xdd0f('0x17')](dials[_0x11793f[_0xdd0f('0x5')]])){utils[_0xdd0f('0xd')](util[_0xdd0f('0x3')](_0xdd0f('0x29'),_0x11793f[_0xdd0f('0x5')]),_0x11793f);utils['info'](util['format'](_0xdd0f('0x2a'),_0x11793f[_0xdd0f('0x5')],_0x11793f[_0xdd0f('0x8')],_0x11793f['calleridname'],_0x11793f[_0xdd0f('0x2b')]));dials[_0x11793f['uniqueid']]=_[_0xdd0f('0x1d')](dials[_0x11793f['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xdd0f('0x2c')});dials[_0x11793f[_0xdd0f('0x5')]][_0xdd0f('0x2d')]=utils['diffTime'](dials[_0x11793f[_0xdd0f('0x5')]]['endtime'],dials[_0x11793f[_0xdd0f('0x5')]]['starttime']);dials[_0x11793f[_0xdd0f('0x5')]]['holdtime']=utils[_0xdd0f('0x2e')](dials[_0x11793f[_0xdd0f('0x5')]][_0xdd0f('0x28')]||dials[_0x11793f[_0xdd0f('0x5')]]['endtime'],dials[_0x11793f[_0xdd0f('0x5')]][_0xdd0f('0x1e')]);dials[_0x11793f[_0xdd0f('0x5')]][_0xdd0f('0x2f')]=dials[_0x11793f['uniqueid']]['answertime']?utils[_0xdd0f('0x2e')](dials[_0x11793f[_0xdd0f('0x5')]][_0xdd0f('0x30')],dials[_0x11793f[_0xdd0f('0x5')]]['answertime']):0x0;writeDB(dials[_0x11793f[_0xdd0f('0x5')]]);}}catch(_0x17c2d9){utils[_0xdd0f('0x15')](util[_0xdd0f('0x3')]('[%s][dials][hangup]',_0x11793f[_0xdd0f('0x5')]),_0x17c2d9);}}; \ No newline at end of file +var _0xe0e1=['diffTime','endtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','uniqueid','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete'];(function(_0x579f28,_0x281cce){var _0x3652d7=function(_0x37b099){while(--_0x37b099){_0x579f28['push'](_0x579f28['shift']());}};_0x3652d7(++_0x281cce);}(_0xe0e1,0x1ab));var _0x1e0e=function(_0x248740,_0x4a00f7){_0x248740=_0x248740-0x0;var _0x5ed99e=_0xe0e1[_0x248740];return _0x5ed99e;};'use strict';var _=require(_0x1e0e('0x0'));var util=require(_0x1e0e('0x1'));var utils=require(_0x1e0e('0x2'));var dials={};function writeDB(_0x5c7512){utils[_0x1e0e('0x3')](util['format'](_0x1e0e('0x4'),_0x5c7512['uniqueid'],_0x5c7512[_0x1e0e('0x5')],_0x5c7512[_0x1e0e('0x6')],_0x5c7512[_0x1e0e('0x7')],_0x5c7512[_0x1e0e('0x8')],_0x5c7512[_0x1e0e('0x9')]));utils[_0x1e0e('0xa')](_0x1e0e('0xb'),_0x5c7512);delete dials[_0x5c7512['uniqueid']];}exports[_0x1e0e('0xc')]=function(_0x373c67){try{utils[_0x1e0e('0xd')](util[_0x1e0e('0xe')](_0x1e0e('0xf'),_0x373c67['uniqueid']),_0x373c67);utils[_0x1e0e('0x3')](util[_0x1e0e('0xe')](_0x1e0e('0x10'),_0x373c67[_0x1e0e('0x11')],_0x373c67[_0x1e0e('0x12')],_0x373c67[_0x1e0e('0x13')]));if(_0x373c67['application'][_0x1e0e('0x14')]()=='set'&&_['startsWith'](_0x373c67[_0x1e0e('0x13')][_0x1e0e('0x14')](),_0x1e0e('0x15'))){var _0x5bfb19=_0x373c67[_0x1e0e('0x13')][_0x1e0e('0x16')]('=');dials[_0x373c67[_0x1e0e('0x11')]]={'routeId':_0x5bfb19[0x1]};}}catch(_0x50fc64){utils[_0x1e0e('0x17')](util[_0x1e0e('0xe')](_0x1e0e('0xf'),_0x373c67[_0x1e0e('0x11')]),_0x50fc64);}};exports[_0x1e0e('0x18')]=function(_0x17d5df){try{utils[_0x1e0e('0xd')](util['format']('[%s][dials][varset]',_0x17d5df['uniqueid']),_0x17d5df);if(!_[_0x1e0e('0x19')](_0x17d5df['variable'][_0x1e0e('0x1a')])){utils['info'](util[_0x1e0e('0xe')](_0x1e0e('0x1b'),_0x17d5df[_0x1e0e('0x11')],_0x17d5df[_0x1e0e('0x1c')]));dials[_0x17d5df[_0x1e0e('0x11')]]={'routeId':_0x17d5df[_0x1e0e('0x1c')]};}}catch(_0x17b238){utils[_0x1e0e('0x17')](util['format'](_0x1e0e('0x1d'),_0x17d5df[_0x1e0e('0x11')]),_0x17b238);}};exports[_0x1e0e('0x1e')]=function(_0x17515b){try{if(!_[_0x1e0e('0x19')](dials[_0x17515b[_0x1e0e('0x11')]])){utils[_0x1e0e('0xd')](util['format']('[%s][dials][dialbegin]',_0x17515b['uniqueid']),_0x17515b);dials[_0x17515b[_0x1e0e('0x11')]]=_[_0x1e0e('0x1f')](dials[_0x17515b[_0x1e0e('0x11')]],_0x17515b);dials[_0x17515b[_0x1e0e('0x11')]][_0x1e0e('0x20')]=utils[_0x1e0e('0x21')]();dials[_0x17515b[_0x1e0e('0x11')]][_0x1e0e('0x22')]=_0x1e0e('0x23');utils[_0x1e0e('0x3')](util['format'](_0x1e0e('0x24'),_0x17515b[_0x1e0e('0x11')],dials[_0x17515b[_0x1e0e('0x11')]]['starttime']));}}catch(_0x1d8352){utils[_0x1e0e('0x17')](util[_0x1e0e('0xe')](_0x1e0e('0x25'),_0x17515b['uniqueid']),_0x1d8352);}};exports[_0x1e0e('0x26')]=function(_0x1e0c1e){try{if(!_[_0x1e0e('0x19')](dials[_0x1e0c1e['uniqueid']])){utils['debug'](util[_0x1e0e('0xe')](_0x1e0e('0x27'),_0x1e0c1e[_0x1e0e('0x11')]),_0x1e0c1e);dials[_0x1e0c1e[_0x1e0e('0x11')]][_0x1e0e('0x9')]=_0x1e0c1e[_0x1e0e('0x9')];if(_0x1e0c1e[_0x1e0e('0x9')]==_0x1e0e('0x28')){dials[_0x1e0c1e[_0x1e0e('0x11')]]=_[_0x1e0e('0x1f')](dials[_0x1e0c1e[_0x1e0e('0x11')]],_0x1e0c1e);dials[_0x1e0c1e[_0x1e0e('0x11')]][_0x1e0e('0x29')]=utils[_0x1e0e('0x21')]();dials[_0x1e0c1e[_0x1e0e('0x11')]][_0x1e0e('0x22')]=_0x1e0e('0x2a');utils[_0x1e0e('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1e0c1e[_0x1e0e('0x11')],_0x1e0c1e[_0x1e0e('0x9')],dials[_0x1e0c1e[_0x1e0e('0x11')]][_0x1e0e('0x29')]));}else{utils[_0x1e0e('0x3')](util[_0x1e0e('0xe')](_0x1e0e('0x2b'),_0x1e0c1e[_0x1e0e('0x11')],_0x1e0c1e[_0x1e0e('0x9')]));}}}catch(_0x53fb22){utils[_0x1e0e('0x17')](util[_0x1e0e('0xe')]('[%s][dials][dialend]',_0x1e0c1e[_0x1e0e('0x11')]),_0x53fb22);}};exports[_0x1e0e('0x2c')]=function(_0x4e4379){try{if(!_[_0x1e0e('0x19')](dials[_0x4e4379['uniqueid']])){utils[_0x1e0e('0xd')](util['format'](_0x1e0e('0x2d'),_0x4e4379[_0x1e0e('0x11')]),_0x4e4379);utils['info'](util['format'](_0x1e0e('0x2e'),_0x4e4379[_0x1e0e('0x11')],_0x4e4379[_0x1e0e('0x7')],_0x4e4379[_0x1e0e('0x2f')],_0x4e4379[_0x1e0e('0x30')]));dials[_0x4e4379['uniqueid']]=_['assign'](dials[_0x4e4379[_0x1e0e('0x11')]],{'endtime':utils[_0x1e0e('0x21')](),'lastevent':_0x1e0e('0x31')});dials[_0x4e4379[_0x1e0e('0x11')]]['duration']=utils[_0x1e0e('0x32')](dials[_0x4e4379[_0x1e0e('0x11')]][_0x1e0e('0x33')],dials[_0x4e4379['uniqueid']]['starttime']);dials[_0x4e4379[_0x1e0e('0x11')]]['holdtime']=utils[_0x1e0e('0x32')](dials[_0x4e4379[_0x1e0e('0x11')]][_0x1e0e('0x29')]||dials[_0x4e4379['uniqueid']][_0x1e0e('0x33')],dials[_0x4e4379[_0x1e0e('0x11')]][_0x1e0e('0x20')]);dials[_0x4e4379[_0x1e0e('0x11')]][_0x1e0e('0x34')]=dials[_0x4e4379[_0x1e0e('0x11')]][_0x1e0e('0x29')]?utils[_0x1e0e('0x32')](dials[_0x4e4379['uniqueid']][_0x1e0e('0x33')],dials[_0x4e4379[_0x1e0e('0x11')]][_0x1e0e('0x29')]):0x0;writeDB(dials[_0x4e4379[_0x1e0e('0x11')]]);}}catch(_0x52d231){utils['error'](util['format'](_0x1e0e('0x2d'),_0x4e4379[_0x1e0e('0x11')]),_0x52d231);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 84b6de1..d0bb4e6 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 _0xb3e3=['fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','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][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','port','asterisk','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb3e3,0xb9));var _0x3b3e=function(_0x33e65f,_0x5274f6){_0x33e65f=_0x33e65f-0x0;var _0x1593d3=_0xb3e3[_0x33e65f];return _0x1593d3;};var AsteriskManager=require(_0x3b3e('0x0'));var config=require(_0x3b3e('0x1'));var utils=require(_0x3b3e('0x2'));var util=require(_0x3b3e('0x3'));var isXDREnabled=config[_0x3b3e('0x4')]&&config['xdr'][_0x3b3e('0x5')]?!config[_0x3b3e('0x4')]['disabled']:!![];var isProduction=config[_0x3b3e('0x6')]==='production'||![];var isLocalAsterisk=config[_0x3b3e('0x4')]&&config[_0x3b3e('0x4')][_0x3b3e('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x3b3e('0x8')],config[_0x3b3e('0x9')]['ip'],config[_0x3b3e('0x9')][_0x3b3e('0xa')],config[_0x3b3e('0x9')][_0x3b3e('0xb')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x3b3e('0xc')](_0x3b3e('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x3b3e('0xc')](_0x3b3e('0xe'));}else{var agents=require(_0x3b3e('0xf'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x3b3e('0x10'));var members=require(_0x3b3e('0x11'));var dials=require(_0x3b3e('0x12'));var transfers=require(_0x3b3e('0x13'));var core=require('./core.controller');ami['on']('connect',core[_0x3b3e('0x14')]);ami['on'](_0x3b3e('0x15'),core[_0x3b3e('0x15')]);ami['on'](_0x3b3e('0x16'),core[_0x3b3e('0x16')]);ami['on'](_0x3b3e('0x17'),core[_0x3b3e('0x17')]);ami['on'](_0x3b3e('0x18'),core[_0x3b3e('0x18')]);ami['on'](_0x3b3e('0x19'),core['managerevent']);ami['on'](_0x3b3e('0x1a'),function(_0x32bc33){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')]('[%s][index][devicestatechange]',_0x32bc33[_0x3b3e('0x1d')]),_0x32bc33);members['devicestatechange'](_0x32bc33);}catch(_0x69574e){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')](_0x3b3e('0x1e'),_0x32bc33['device']),_0x69574e);}});ami['on'](_0x3b3e('0x1f'),function(_0x4f0574){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x20'),_0x4f0574[_0x3b3e('0x21')]),_0x4f0574);agents[_0x3b3e('0x1f')](_0x4f0574);}catch(_0x400fd4){utils[_0x3b3e('0x17')](util['format']('[%s][index][agentcalled]',_0x4f0574[_0x3b3e('0x21')]),_0x400fd4);}});ami['on'](_0x3b3e('0x22'),function(_0x4e7faa){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x23'),_0x4e7faa[_0x3b3e('0x21')]),_0x4e7faa);agents[_0x3b3e('0x22')](_0x4e7faa);}catch(_0x2d60f1){utils['error'](util[_0x3b3e('0x1c')](_0x3b3e('0x23'),_0x4e7faa[_0x3b3e('0x21')]),_0x2d60f1);}});ami['on'](_0x3b3e('0x24'),function(_0x5d732){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x25'),_0x5d732[_0x3b3e('0x21')]),_0x5d732);agents[_0x3b3e('0x24')](_0x5d732);queues[_0x3b3e('0x24')](_0x5d732);}catch(_0x19b0c4){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')](_0x3b3e('0x25'),_0x5d732[_0x3b3e('0x21')]),_0x19b0c4);}});ami['on']('agentcomplete',function(_0x107ee4){try{utils['debug'](util['format'](_0x3b3e('0x26'),_0x107ee4['uniqueid']),_0x107ee4);agents['agentcomplete'](_0x107ee4);queues[_0x3b3e('0x27')](_0x107ee4);members['agentcomplete'](_0x107ee4);}catch(_0xb5b378){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')]('[%s][index][agentcomplete]',_0x107ee4[_0x3b3e('0x21')]),_0xb5b378);}});ami['on'](_0x3b3e('0x28'),function(_0x55d703){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x29'),_0x55d703['uniqueid']),_0x55d703);agents['queuecallerabandon'](_0x55d703);queues['queuecallerabandon'](_0x55d703);}catch(_0x52c799){utils['error'](util[_0x3b3e('0x1c')](_0x3b3e('0x29'),_0x55d703['uniqueid']),_0x52c799);}});ami['on'](_0x3b3e('0x2a'),function(_0x4b3dee){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x2b'),_0x4b3dee[_0x3b3e('0x21')]),_0x4b3dee);queues['queuecallerjoin'](_0x4b3dee);recordings[_0x3b3e('0x2a')](_0x4b3dee);}catch(_0xa031d6){utils[_0x3b3e('0x17')](util['format'](_0x3b3e('0x2b'),_0x4b3dee[_0x3b3e('0x21')]),_0xa031d6);}});ami['on'](_0x3b3e('0x2c'),function(_0x489533){try{utils[_0x3b3e('0x1b')](util['format'](_0x3b3e('0x2d'),_0x489533[_0x3b3e('0x21')]),_0x489533);queues[_0x3b3e('0x2c')](_0x489533);}catch(_0x54c480){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')](_0x3b3e('0x2d'),_0x489533['uniqueid']),_0x54c480);}});ami['on'](_0x3b3e('0x2e'),function(_0xd3a100){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x2f'),_0xd3a100[_0x3b3e('0x21')]),_0xd3a100);queues['musiconholdstart'](_0xd3a100);calls[_0x3b3e('0x2e')](_0xd3a100);}catch(_0x5825e2){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')](_0x3b3e('0x2f'),_0xd3a100[_0x3b3e('0x21')]),_0x5825e2);}});ami['on'](_0x3b3e('0x30'),function(_0x544edd){try{utils['debug'](util[_0x3b3e('0x1c')](_0x3b3e('0x31'),_0x544edd[_0x3b3e('0x21')]),_0x544edd);queues[_0x3b3e('0x30')](_0x544edd);calls['musiconholdstop'](_0x544edd);}catch(_0x331a5d){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')](_0x3b3e('0x31'),_0x544edd[_0x3b3e('0x21')]),_0x331a5d);}});ami['on'](_0x3b3e('0x32'),function(_0x19cfa1){try{utils[_0x3b3e('0x1b')](util['format']('[%s][index][newstate]',_0x19cfa1[_0x3b3e('0x21')]),_0x19cfa1);calls[_0x3b3e('0x32')](_0x19cfa1);recordings[_0x3b3e('0x32')](_0x19cfa1);}catch(_0x2e3c88){utils['error'](util[_0x3b3e('0x1c')](_0x3b3e('0x33'),_0x19cfa1[_0x3b3e('0x21')]),_0x2e3c88);}});ami['on'](_0x3b3e('0x34'),function(_0x339df9){try{utils[_0x3b3e('0x1b')](util['format']('[%s][index][hangup]',_0x339df9[_0x3b3e('0x21')]),_0x339df9);calls[_0x3b3e('0x34')](_0x339df9);recordings[_0x3b3e('0x34')](_0x339df9);dials[_0x3b3e('0x34')](_0x339df9);agents[_0x3b3e('0x34')](_0x339df9);queues['hangup'](_0x339df9);}catch(_0x1379e1){utils[_0x3b3e('0x17')](util['format']('[%s][index][hangup]',_0x339df9['uniqueid']),_0x1379e1);}});ami['on']('cdr',function(_0xe68760){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x35'),_0xe68760[_0x3b3e('0x21')]),_0xe68760);members[_0x3b3e('0x36')](_0xe68760);}catch(_0x595ef2){utils['error'](util[_0x3b3e('0x1c')](_0x3b3e('0x35'),_0xe68760[_0x3b3e('0x21')]),_0x595ef2);}});ami['on'](_0x3b3e('0x37'),function(_0x1094a2){try{utils['debug'](util[_0x3b3e('0x1c')]('[%s][index][blindtransfer]',_0x1094a2[_0x3b3e('0x21')]),_0x1094a2);queues[_0x3b3e('0x37')](_0x1094a2);agents[_0x3b3e('0x37')](_0x1094a2);transfers[_0x3b3e('0x37')](_0x1094a2);recordings[_0x3b3e('0x37')](_0x1094a2);}catch(_0xb1469b){utils[_0x3b3e('0x17')](util['format'](_0x3b3e('0x38'),_0x1094a2[_0x3b3e('0x21')]),_0xb1469b);}});ami['on'](_0x3b3e('0x39'),function(_0x4182ba){try{utils['debug'](util['format'](_0x3b3e('0x3a'),_0x4182ba[_0x3b3e('0x3b')]),_0x4182ba);queues[_0x3b3e('0x39')](_0x4182ba);transfers[_0x3b3e('0x39')](_0x4182ba);agents['attendedtransfer'](_0x4182ba);calls[_0x3b3e('0x39')](_0x4182ba);}catch(_0x4040a4){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')]('[%s][index][attendedtransfer]',_0x4182ba['origtransfereruniqueid']),_0x4040a4);}});ami['on'](_0x3b3e('0x3c'),function(_0x33c5fd){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')]('[%s][index][varset]',_0x33c5fd['uniqueid']),_0x33c5fd);queues[_0x3b3e('0x3c')](_0x33c5fd);recordings['varset'](_0x33c5fd);calls['varset'](_0x33c5fd);dials[_0x3b3e('0x3c')](_0x33c5fd);}catch(_0x4141b6){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')]('[%s][index][varset]',_0x33c5fd[_0x3b3e('0x21')]),_0x4141b6);}});ami['on']('newexten',function(_0x256656){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')]('[%s][index][newexten]',_0x256656[_0x3b3e('0x21')]),_0x256656);calls[_0x3b3e('0x3d')](_0x256656);recordings[_0x3b3e('0x3d')](_0x256656);dials[_0x3b3e('0x3d')](_0x256656);}catch(_0x101839){utils['error'](util[_0x3b3e('0x1c')](_0x3b3e('0x3e'),_0x256656['uniqueid']),_0x101839);}});ami['on'](_0x3b3e('0x3f'),function(_0x2b27e5){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x40'),_0x2b27e5['uniqueid']),_0x2b27e5);calls[_0x3b3e('0x3f')](_0x2b27e5);recordings[_0x3b3e('0x3f')](_0x2b27e5);}catch(_0x1328a1){utils['error'](util['format'](_0x3b3e('0x40'),_0x2b27e5[_0x3b3e('0x21')]),_0x1328a1);}});ami['on'](_0x3b3e('0x41'),function(_0x320a05){try{utils['debug'](util[_0x3b3e('0x1c')](_0x3b3e('0x42'),_0x320a05[_0x3b3e('0x21')]),_0x320a05);dials[_0x3b3e('0x41')](_0x320a05);}catch(_0x538d4d){utils[_0x3b3e('0x17')](util[_0x3b3e('0x1c')]('[%s]dialbegin',_0x320a05[_0x3b3e('0x21')]),_0x538d4d);}});ami['on'](_0x3b3e('0x43'),function(_0x2bff75){try{utils[_0x3b3e('0x1b')](util[_0x3b3e('0x1c')](_0x3b3e('0x44'),_0x2bff75[_0x3b3e('0x21')]),_0x2bff75);dials[_0x3b3e('0x43')](_0x2bff75);}catch(_0x2428e5){utils['error'](util[_0x3b3e('0x1c')](_0x3b3e('0x44'),_0x2bff75[_0x3b3e('0x21')]),_0x2428e5);}});} \ No newline at end of file +var _0x7cab=['newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','port','username','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]'];(function(_0x1d5467,_0x14148e){var _0xa5d6f6=function(_0x45cb3c){while(--_0x45cb3c){_0x1d5467['push'](_0x1d5467['shift']());}};_0xa5d6f6(++_0x14148e);}(_0x7cab,0x1e8));var _0xb7ca=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x7cab[_0x88cd7b];return _0x56fcc8;};var AsteriskManager=require(_0xb7ca('0x0'));var config=require(_0xb7ca('0x1'));var utils=require(_0xb7ca('0x2'));var util=require(_0xb7ca('0x3'));var isXDREnabled=config[_0xb7ca('0x4')]&&config[_0xb7ca('0x4')]['disabled']?!config[_0xb7ca('0x4')][_0xb7ca('0x5')]:!![];var isProduction=config[_0xb7ca('0x6')]==='production'||![];var isLocalAsterisk=config[_0xb7ca('0x4')]&&config[_0xb7ca('0x4')][_0xb7ca('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xb7ca('0x8')][_0xb7ca('0x9')],config[_0xb7ca('0x8')]['ip'],config[_0xb7ca('0x8')][_0xb7ca('0xa')],config['asterisk']['password'],!![]);ami[_0xb7ca('0xb')]();if(!isXDREnabled){utils[_0xb7ca('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xb7ca('0xc')](_0xb7ca('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0xb7ca('0xe'));var queues=require(_0xb7ca('0xf'));var recordings=require(_0xb7ca('0x10'));var members=require(_0xb7ca('0x11'));var dials=require(_0xb7ca('0x12'));var transfers=require(_0xb7ca('0x13'));var core=require(_0xb7ca('0x14'));ami['on'](_0xb7ca('0x15'),core['connect']);ami['on']('shutdown',core[_0xb7ca('0x16')]);ami['on']('fullybooted',core[_0xb7ca('0x17')]);ami['on'](_0xb7ca('0x18'),core[_0xb7ca('0x18')]);ami['on'](_0xb7ca('0x19'),core['close']);ami['on'](_0xb7ca('0x1a'),core[_0xb7ca('0x1a')]);ami['on']('devicestatechange',function(_0x5137e4){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x1d'),_0x5137e4[_0xb7ca('0x1e')]),_0x5137e4);members[_0xb7ca('0x1f')](_0x5137e4);}catch(_0x17c3ad){utils['error'](util[_0xb7ca('0x1c')](_0xb7ca('0x1d'),_0x5137e4[_0xb7ca('0x1e')]),_0x17c3ad);}});ami['on']('agentcalled',function(_0x23640c){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x20'),_0x23640c[_0xb7ca('0x21')]),_0x23640c);agents['agentcalled'](_0x23640c);}catch(_0x46386e){utils['error'](util['format'](_0xb7ca('0x20'),_0x23640c[_0xb7ca('0x21')]),_0x46386e);}});ami['on'](_0xb7ca('0x22'),function(_0x34541c){try{utils[_0xb7ca('0x1b')](util['format'](_0xb7ca('0x23'),_0x34541c[_0xb7ca('0x21')]),_0x34541c);agents['agentringnoanswer'](_0x34541c);}catch(_0x3de2bb){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x23'),_0x34541c[_0xb7ca('0x21')]),_0x3de2bb);}});ami['on']('agentconnect',function(_0x46b2eb){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x24'),_0x46b2eb[_0xb7ca('0x21')]),_0x46b2eb);agents[_0xb7ca('0x25')](_0x46b2eb);queues['agentconnect'](_0x46b2eb);}catch(_0xaceed8){utils[_0xb7ca('0x18')](util['format'](_0xb7ca('0x24'),_0x46b2eb[_0xb7ca('0x21')]),_0xaceed8);}});ami['on'](_0xb7ca('0x26'),function(_0x4f34f1){try{utils[_0xb7ca('0x1b')](util['format'](_0xb7ca('0x27'),_0x4f34f1[_0xb7ca('0x21')]),_0x4f34f1);agents[_0xb7ca('0x26')](_0x4f34f1);queues[_0xb7ca('0x26')](_0x4f34f1);members[_0xb7ca('0x26')](_0x4f34f1);}catch(_0x33951a){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x27'),_0x4f34f1[_0xb7ca('0x21')]),_0x33951a);}});ami['on'](_0xb7ca('0x28'),function(_0x3b4700){try{utils['debug'](util['format'](_0xb7ca('0x29'),_0x3b4700[_0xb7ca('0x21')]),_0x3b4700);agents[_0xb7ca('0x28')](_0x3b4700);queues[_0xb7ca('0x28')](_0x3b4700);}catch(_0x51924c){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x29'),_0x3b4700[_0xb7ca('0x21')]),_0x51924c);}});ami['on']('queuecallerjoin',function(_0x48b255){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x2a'),_0x48b255[_0xb7ca('0x21')]),_0x48b255);queues[_0xb7ca('0x2b')](_0x48b255);recordings[_0xb7ca('0x2b')](_0x48b255);}catch(_0x50283a){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x2a'),_0x48b255[_0xb7ca('0x21')]),_0x50283a);}});ami['on']('queuecallerleave',function(_0x2d6ee0){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')]('[%s][index][queuecallerleave]',_0x2d6ee0['uniqueid']),_0x2d6ee0);queues[_0xb7ca('0x2c')](_0x2d6ee0);}catch(_0x1378f7){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x2d'),_0x2d6ee0['uniqueid']),_0x1378f7);}});ami['on'](_0xb7ca('0x2e'),function(_0x2abb49){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')]('[%s][index][musiconholdstart]',_0x2abb49[_0xb7ca('0x21')]),_0x2abb49);queues[_0xb7ca('0x2e')](_0x2abb49);calls[_0xb7ca('0x2e')](_0x2abb49);}catch(_0x1eced5){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x2f'),_0x2abb49[_0xb7ca('0x21')]),_0x1eced5);}});ami['on'](_0xb7ca('0x30'),function(_0x149301){try{utils['debug'](util[_0xb7ca('0x1c')]('[%s][index][musiconholdstop]',_0x149301[_0xb7ca('0x21')]),_0x149301);queues[_0xb7ca('0x30')](_0x149301);calls['musiconholdstop'](_0x149301);}catch(_0x329e54){utils['error'](util['format'](_0xb7ca('0x31'),_0x149301['uniqueid']),_0x329e54);}});ami['on']('newstate',function(_0x1f256e){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x32'),_0x1f256e[_0xb7ca('0x21')]),_0x1f256e);calls[_0xb7ca('0x33')](_0x1f256e);recordings[_0xb7ca('0x33')](_0x1f256e);}catch(_0x5a3817){utils['error'](util[_0xb7ca('0x1c')](_0xb7ca('0x32'),_0x1f256e[_0xb7ca('0x21')]),_0x5a3817);}});ami['on'](_0xb7ca('0x34'),function(_0x594a24){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x35'),_0x594a24['uniqueid']),_0x594a24);calls[_0xb7ca('0x34')](_0x594a24);recordings[_0xb7ca('0x34')](_0x594a24);dials[_0xb7ca('0x34')](_0x594a24);agents[_0xb7ca('0x34')](_0x594a24);queues[_0xb7ca('0x34')](_0x594a24);}catch(_0x2077f1){utils[_0xb7ca('0x18')](util['format'](_0xb7ca('0x35'),_0x594a24[_0xb7ca('0x21')]),_0x2077f1);}});ami['on'](_0xb7ca('0x36'),function(_0x51bcbc){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')]('[%s][index][cdr]',_0x51bcbc[_0xb7ca('0x21')]),_0x51bcbc);members['cdr'](_0x51bcbc);}catch(_0x54fb88){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x37'),_0x51bcbc[_0xb7ca('0x21')]),_0x54fb88);}});ami['on'](_0xb7ca('0x38'),function(_0xeacec9){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x39'),_0xeacec9[_0xb7ca('0x21')]),_0xeacec9);queues[_0xb7ca('0x38')](_0xeacec9);agents[_0xb7ca('0x38')](_0xeacec9);transfers[_0xb7ca('0x38')](_0xeacec9);recordings[_0xb7ca('0x38')](_0xeacec9);}catch(_0x39dc25){utils[_0xb7ca('0x18')](util['format'](_0xb7ca('0x39'),_0xeacec9[_0xb7ca('0x21')]),_0x39dc25);}});ami['on'](_0xb7ca('0x3a'),function(_0x238239){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x3b'),_0x238239['origtransfereruniqueid']),_0x238239);queues[_0xb7ca('0x3a')](_0x238239);transfers[_0xb7ca('0x3a')](_0x238239);agents['attendedtransfer'](_0x238239);calls[_0xb7ca('0x3a')](_0x238239);}catch(_0x56f615){utils['error'](util[_0xb7ca('0x1c')]('[%s][index][attendedtransfer]',_0x238239['origtransfereruniqueid']),_0x56f615);}});ami['on'](_0xb7ca('0x3c'),function(_0xcdc0d3){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')]('[%s][index][varset]',_0xcdc0d3[_0xb7ca('0x21')]),_0xcdc0d3);queues[_0xb7ca('0x3c')](_0xcdc0d3);recordings['varset'](_0xcdc0d3);calls['varset'](_0xcdc0d3);dials[_0xb7ca('0x3c')](_0xcdc0d3);}catch(_0x1868eb){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x3d'),_0xcdc0d3[_0xb7ca('0x21')]),_0x1868eb);}});ami['on'](_0xb7ca('0x3e'),function(_0x452975){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')](_0xb7ca('0x3f'),_0x452975[_0xb7ca('0x21')]),_0x452975);calls[_0xb7ca('0x3e')](_0x452975);recordings['newexten'](_0x452975);dials[_0xb7ca('0x3e')](_0x452975);}catch(_0x3f2cfe){utils[_0xb7ca('0x18')](util['format'](_0xb7ca('0x3f'),_0x452975[_0xb7ca('0x21')]),_0x3f2cfe);}});ami['on'](_0xb7ca('0x40'),function(_0x57aca2){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')]('[%s][index][newchannel]',_0x57aca2[_0xb7ca('0x21')]),_0x57aca2);calls[_0xb7ca('0x40')](_0x57aca2);recordings[_0xb7ca('0x40')](_0x57aca2);}catch(_0x4cb38f){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')](_0xb7ca('0x41'),_0x57aca2[_0xb7ca('0x21')]),_0x4cb38f);}});ami['on'](_0xb7ca('0x42'),function(_0x30f34b){try{utils[_0xb7ca('0x1b')](util[_0xb7ca('0x1c')]('[%s][index][dialbegin]',_0x30f34b[_0xb7ca('0x21')]),_0x30f34b);dials[_0xb7ca('0x42')](_0x30f34b);}catch(_0x50c68e){utils[_0xb7ca('0x18')](util['format'](_0xb7ca('0x43'),_0x30f34b[_0xb7ca('0x21')]),_0x50c68e);}});ami['on'](_0xb7ca('0x44'),function(_0x4dfc89){try{utils['debug'](util[_0xb7ca('0x1c')]('[%s][index][dialend]',_0x4dfc89['uniqueid']),_0x4dfc89);dials[_0xb7ca('0x44')](_0x4dfc89);}catch(_0x1300ba){utils[_0xb7ca('0x18')](util[_0xb7ca('0x1c')]('[%s][index][dialend]',_0x4dfc89[_0xb7ca('0x21')]),_0x1300ba);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 61634a7..a7dbfbe 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 _0xc305=['Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','agent','NOT_INUSE','isNil','exitAt','now','duration','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','error','cdr','[%s][members][cdr]','channel','assign','data1','source','data3','destination','destinationchannel','lodash'];(function(_0x592220,_0x527dd5){var _0x1c59f9=function(_0x4e88d7){while(--_0x4e88d7){_0x592220['push'](_0x592220['shift']());}};_0x1c59f9(++_0x527dd5);}(_0xc305,0xcf));var _0x5c30=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xc305[_0x453e2b];return _0x50f306;};'use strict';var _=require(_0x5c30('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x5c30('0x1'),_0x5c30('0x2')];function writeDB(_0x5b6fbc){utils[_0x5c30('0x3')](util[_0x5c30('0x4')](_0x5c30('0x5'),_0x5b6fbc[_0x5c30('0x6')],_0x5b6fbc[_0x5c30('0x7')],_0x5b6fbc['channel'],_0x5b6fbc[_0x5c30('0x8')],_0x5b6fbc[_0x5c30('0x9')],_0x5b6fbc[_0x5c30('0xa')]));if(_0x5b6fbc[_0x5c30('0x7')]){utils[_0x5c30('0xb')](_0x5b6fbc[_0x5c30('0x7')])[_0x5c30('0xc')](function(_0x11a01f){if(_0x11a01f){_0x5b6fbc['membername']=_0x11a01f[_0x5c30('0xd')];_0x5b6fbc[_0x5c30('0xe')]=_0x11a01f['internal'];utils[_0x5c30('0xf')](_0x5c30('0x10'),_0x5b6fbc);}else{utils[_0x5c30('0x11')](_0x5b6fbc[_0x5c30('0x7')][_0x5c30('0x12')]('/')[0x1])['then'](function(_0x362765){if(_0x362765){_0x5b6fbc[_0x5c30('0x9')]=_0x362765[_0x5c30('0xd')];_0x5b6fbc['internal']=_0x362765[_0x5c30('0xe')];utils[_0x5c30('0xf')](_0x5c30('0x10'),_0x5b6fbc);}});}})[_0x5c30('0x13')](function(_0x1e3841){utils['error'](util[_0x5c30('0x4')](_0x5c30('0x14'),_0x5b6fbc[_0x5c30('0x6')]),_0x1e3841);});}delete members[_0x5b6fbc[_0x5c30('0x7')]];}function startsWith(_0x28282d,_0x21e1dd){return _[_0x5c30('0x15')](_0x28282d,function(_0x4838ab){return _[_0x5c30('0x16')](_0x21e1dd,_0x4838ab);});}exports['devicestatechange']=function(_0x221eb8){try{utils[_0x5c30('0x17')](util[_0x5c30('0x4')](_0x5c30('0x18'),members[_0x221eb8[_0x5c30('0x19')]]?members[_0x221eb8[_0x5c30('0x19')]][_0x5c30('0x6')]:_0x221eb8[_0x5c30('0x19')]),_0x221eb8);utils[_0x5c30('0x3')](util[_0x5c30('0x4')](_0x5c30('0x1a'),members[_0x221eb8['device']]?members[_0x221eb8[_0x5c30('0x19')]][_0x5c30('0x6')]:_0x221eb8['device'],_0x221eb8[_0x5c30('0x1b')],_0x221eb8[_0x5c30('0x19')]));switch(_0x221eb8['state']){case _0x5c30('0x1c'):case _0x5c30('0x1d'):if(!startsWith(exclude,_0x221eb8[_0x5c30('0x19')])){members[_0x221eb8['device']]={'channel':_0x5c30('0x1e'),'interface':_0x221eb8[_0x5c30('0x19')],'type':'TALKING','enterAt':utils['now'](),'role':_0x5c30('0x1f')};}break;case _0x5c30('0x20'):if(!_[_0x5c30('0x21')](members[_0x221eb8[_0x5c30('0x19')]])){members[_0x221eb8['device']][_0x5c30('0x22')]=utils[_0x5c30('0x23')]();members[_0x221eb8[_0x5c30('0x19')]][_0x5c30('0x24')]=utils['diffTime'](members[_0x221eb8[_0x5c30('0x19')]][_0x5c30('0x22')],members[_0x221eb8[_0x5c30('0x19')]][_0x5c30('0x25')]);if(members[_0x221eb8[_0x5c30('0x19')]][_0x5c30('0x6')]){writeDB(members[_0x221eb8['device']]);}}break;default:break;}}catch(_0x43369c){utils['error'](util[_0x5c30('0x4')](_0x5c30('0x18'),members[_0x221eb8[_0x5c30('0x19')]]?members[_0x221eb8[_0x5c30('0x19')]][_0x5c30('0x6')]:_0x221eb8[_0x5c30('0x19')]),_0x43369c);}};exports[_0x5c30('0x26')]=function(_0x5cf814){try{if(!_['isNil'](members[_0x5cf814['interface']])){utils[_0x5c30('0x17')](util[_0x5c30('0x4')](_0x5c30('0x27'),_0x5cf814[_0x5c30('0x6')]),_0x5cf814);utils[_0x5c30('0x3')](util[_0x5c30('0x4')](_0x5c30('0x28'),_0x5cf814[_0x5c30('0x6')],_0x5cf814[_0x5c30('0x7')],_0x5cf814[_0x5c30('0x29')]));members[_0x5cf814['interface']]=_['assign'](members[_0x5cf814[_0x5c30('0x7')]],{'data4':_0x5cf814[_0x5c30('0x29')],'uniqueid':_0x5cf814['uniqueid']});}}catch(_0x5b79d8){utils[_0x5c30('0x2a')](util['format']('[%s][members][agentcomplete]',_0x5cf814[_0x5c30('0x6')]),_0x5b79d8);}};exports[_0x5c30('0x2b')]=function(_0x399b46){try{utils[_0x5c30('0x17')](util[_0x5c30('0x4')](_0x5c30('0x2c'),_0x399b46[_0x5c30('0x6')]),_0x399b46);if(_0x399b46['channel']){var _0xe79d3f=_0x399b46[_0x5c30('0x2d')][_0x5c30('0x12')]('-')[0x0];if(!_['isNil'](members[_0xe79d3f])){members[_0xe79d3f]=_[_0x5c30('0x2e')](members[_0xe79d3f],{'data1':members[_0xe79d3f][_0x5c30('0x2f')]||_0x399b46[_0x5c30('0xa')],'data2':members[_0xe79d3f][_0x5c30('0x8')]||_0x399b46[_0x5c30('0x30')],'data3':members[_0xe79d3f][_0x5c30('0x31')]||_0x399b46[_0x5c30('0x32')],'uniqueid':members[_0xe79d3f][_0x5c30('0x6')]||_0x399b46[_0x5c30('0x6')]});utils['info'](util[_0x5c30('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x399b46[_0x5c30('0x6')],members[_0xe79d3f][_0x5c30('0x2f')],members[_0xe79d3f]['data2'],members[_0xe79d3f][_0x5c30('0x31')]));if(members[_0xe79d3f]['exitAt']){writeDB(members[_0xe79d3f]);}}}if(_0x399b46['destinationchannel']){var _0x1ec759=_0x399b46[_0x5c30('0x33')][_0x5c30('0x12')]('-')[0x0];if(!_[_0x5c30('0x21')](members[_0x1ec759])){members[_0x1ec759]=_[_0x5c30('0x2e')](members[_0x1ec759],{'data1':members[_0x1ec759][_0x5c30('0x2f')]||_0x399b46['type'],'data2':members[_0x1ec759][_0x5c30('0x8')]||_0x399b46['source'],'data3':members[_0x1ec759][_0x5c30('0x31')]||_0x399b46['destination'],'uniqueid':members[_0x1ec759][_0x5c30('0x6')]||_0x399b46[_0x5c30('0x6')]});utils[_0x5c30('0x3')](util[_0x5c30('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x399b46[_0x5c30('0x6')],members[_0x1ec759]['data1'],members[_0x1ec759][_0x5c30('0x8')],members[_0x1ec759][_0x5c30('0x31')]));if(members[_0x1ec759][_0x5c30('0x22')]){writeDB(members[_0x1ec759]);}}}}catch(_0x14116b){utils['error'](util[_0x5c30('0x4')](_0x5c30('0x2c'),_0x399b46[_0x5c30('0x6')]),_0x14116b);}}; \ No newline at end of file +var _0xeb02=['BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','[%s][members][devicestatechange]','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','split','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','then','name','internal','request','CreateMemberReport','getUserByName','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xeb02,0xe8));var _0x2eb0=function(_0x38460b,_0x1b94c5){_0x38460b=_0x38460b-0x0;var _0x2f1d0b=_0xeb02[_0x38460b];return _0x2f1d0b;};'use strict';var _=require(_0x2eb0('0x0'));var util=require(_0x2eb0('0x1'));var utils=require('./utils');var members={};var exclude=[_0x2eb0('0x2'),_0x2eb0('0x3')];function writeDB(_0x2cb402){utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x6'),_0x2cb402[_0x2eb0('0x7')],_0x2cb402[_0x2eb0('0x8')],_0x2cb402[_0x2eb0('0x9')],_0x2cb402[_0x2eb0('0xa')],_0x2cb402[_0x2eb0('0xb')],_0x2cb402['type']));if(_0x2cb402[_0x2eb0('0x8')]){utils['getUserByInterface'](_0x2cb402['interface'])[_0x2eb0('0xc')](function(_0x5abbaa){if(_0x5abbaa){_0x2cb402[_0x2eb0('0xb')]=_0x5abbaa[_0x2eb0('0xd')];_0x2cb402['internal']=_0x5abbaa[_0x2eb0('0xe')];utils[_0x2eb0('0xf')](_0x2eb0('0x10'),_0x2cb402);}else{utils[_0x2eb0('0x11')](_0x2cb402[_0x2eb0('0x8')]['split']('/')[0x1])['then'](function(_0x223cdd){if(_0x223cdd){_0x2cb402['membername']=_0x223cdd[_0x2eb0('0xd')];_0x2cb402['internal']=_0x223cdd[_0x2eb0('0xe')];utils['request'](_0x2eb0('0x10'),_0x2cb402);}});}})['catch'](function(_0x1b18d5){utils[_0x2eb0('0x12')](util['format'](_0x2eb0('0x13'),_0x2cb402[_0x2eb0('0x7')]),_0x1b18d5);});}delete members[_0x2cb402[_0x2eb0('0x8')]];}function startsWith(_0x57957b,_0x11563c){return _[_0x2eb0('0x14')](_0x57957b,function(_0x2c91c9){return _[_0x2eb0('0x15')](_0x11563c,_0x2c91c9);});}exports[_0x2eb0('0x16')]=function(_0x396631){try{utils[_0x2eb0('0x17')](util['format']('[%s][members][devicestatechange]',members[_0x396631['device']]?members[_0x396631['device']]['uniqueid']:_0x396631[_0x2eb0('0x18')]),_0x396631);utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x19'),members[_0x396631[_0x2eb0('0x18')]]?members[_0x396631['device']][_0x2eb0('0x7')]:_0x396631[_0x2eb0('0x18')],_0x396631[_0x2eb0('0x1a')],_0x396631[_0x2eb0('0x18')]));switch(_0x396631[_0x2eb0('0x1a')]){case _0x2eb0('0x1b'):case _0x2eb0('0x1c'):if(!startsWith(exclude,_0x396631['device'])){members[_0x396631[_0x2eb0('0x18')]]={'channel':_0x2eb0('0x1d'),'interface':_0x396631[_0x2eb0('0x18')],'type':_0x2eb0('0x1e'),'enterAt':utils[_0x2eb0('0x1f')](),'role':'agent'};}break;case _0x2eb0('0x20'):if(!_[_0x2eb0('0x21')](members[_0x396631['device']])){members[_0x396631[_0x2eb0('0x18')]][_0x2eb0('0x22')]=utils['now']();members[_0x396631[_0x2eb0('0x18')]][_0x2eb0('0x23')]=utils[_0x2eb0('0x24')](members[_0x396631[_0x2eb0('0x18')]]['exitAt'],members[_0x396631[_0x2eb0('0x18')]]['enterAt']);if(members[_0x396631[_0x2eb0('0x18')]][_0x2eb0('0x7')]){writeDB(members[_0x396631[_0x2eb0('0x18')]]);}}break;default:break;}}catch(_0x1a4828){utils[_0x2eb0('0x12')](util[_0x2eb0('0x5')](_0x2eb0('0x25'),members[_0x396631['device']]?members[_0x396631['device']][_0x2eb0('0x7')]:_0x396631[_0x2eb0('0x18')]),_0x1a4828);}};exports['agentcomplete']=function(_0x1d012f){try{if(!_['isNil'](members[_0x1d012f[_0x2eb0('0x8')]])){utils[_0x2eb0('0x17')](util[_0x2eb0('0x5')](_0x2eb0('0x26'),_0x1d012f[_0x2eb0('0x7')]),_0x1d012f);utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x27'),_0x1d012f[_0x2eb0('0x7')],_0x1d012f[_0x2eb0('0x8')],_0x1d012f['queue']));members[_0x1d012f['interface']]=_[_0x2eb0('0x28')](members[_0x1d012f[_0x2eb0('0x8')]],{'data4':_0x1d012f[_0x2eb0('0x29')],'uniqueid':_0x1d012f[_0x2eb0('0x7')]});}}catch(_0x4135d2){utils[_0x2eb0('0x12')](util[_0x2eb0('0x5')](_0x2eb0('0x26'),_0x1d012f[_0x2eb0('0x7')]),_0x4135d2);}};exports[_0x2eb0('0x2a')]=function(_0xcd6795){try{utils['debug'](util[_0x2eb0('0x5')](_0x2eb0('0x2b'),_0xcd6795['uniqueid']),_0xcd6795);if(_0xcd6795['channel']){var _0x158fc5=_0xcd6795[_0x2eb0('0x9')][_0x2eb0('0x2c')]('-')[0x0];if(!_[_0x2eb0('0x21')](members[_0x158fc5])){members[_0x158fc5]=_[_0x2eb0('0x28')](members[_0x158fc5],{'data1':members[_0x158fc5]['data1']||_0xcd6795[_0x2eb0('0x2d')],'data2':members[_0x158fc5][_0x2eb0('0xa')]||_0xcd6795[_0x2eb0('0x2e')],'data3':members[_0x158fc5][_0x2eb0('0x2f')]||_0xcd6795[_0x2eb0('0x30')],'uniqueid':members[_0x158fc5]['uniqueid']||_0xcd6795[_0x2eb0('0x7')]});utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x31'),_0xcd6795['uniqueid'],members[_0x158fc5][_0x2eb0('0x32')],members[_0x158fc5][_0x2eb0('0xa')],members[_0x158fc5]['data3']));if(members[_0x158fc5][_0x2eb0('0x22')]){writeDB(members[_0x158fc5]);}}}if(_0xcd6795[_0x2eb0('0x33')]){var _0x2f4c89=_0xcd6795[_0x2eb0('0x33')][_0x2eb0('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x2f4c89])){members[_0x2f4c89]=_[_0x2eb0('0x28')](members[_0x2f4c89],{'data1':members[_0x2f4c89]['data1']||_0xcd6795[_0x2eb0('0x2d')],'data2':members[_0x2f4c89][_0x2eb0('0xa')]||_0xcd6795[_0x2eb0('0x2e')],'data3':members[_0x2f4c89]['data3']||_0xcd6795[_0x2eb0('0x30')],'uniqueid':members[_0x2f4c89]['uniqueid']||_0xcd6795['uniqueid']});utils['info'](util[_0x2eb0('0x5')](_0x2eb0('0x31'),_0xcd6795[_0x2eb0('0x7')],members[_0x2f4c89][_0x2eb0('0x32')],members[_0x2f4c89][_0x2eb0('0xa')],members[_0x2f4c89]['data3']));if(members[_0x2f4c89][_0x2eb0('0x22')]){writeDB(members[_0x2f4c89]);}}}}catch(_0xb9551b){utils[_0x2eb0('0x12')](util[_0x2eb0('0x5')]('[%s][members][cdr]',_0xcd6795[_0x2eb0('0x7')]),_0xb9551b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index b7c7355..3d5cee5 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 _0x9666=['[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','accountcode','[%s][queues][agentcomplete]','queuecallercomplete','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertargetlinkedid','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','now','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename'];(function(_0x52aba4,_0x197aa3){var _0x48d5b0=function(_0x46b7ad){while(--_0x46b7ad){_0x52aba4['push'](_0x52aba4['shift']());}};_0x48d5b0(++_0x197aa3);}(_0x9666,0x15f));var _0x6966=function(_0x11b197,_0x17c2bd){_0x11b197=_0x11b197-0x0;var _0x3bc745=_0x9666[_0x11b197];return _0x3bc745;};'use strict';var _=require(_0x6966('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x194f67){utils[_0x6966('0x1')](util[_0x6966('0x2')](_0x6966('0x3'),_0x194f67[_0x6966('0x4')],_0x194f67[_0x6966('0x5')],_0x194f67[_0x6966('0x6')],_0x194f67[_0x6966('0x7')],_0x194f67[_0x6966('0x8')],_0x194f67['accountcode'],_0x194f67['queuecallerexitreason']));if(_0x194f67[_0x6966('0x6')]){utils[_0x6966('0x9')](_0x194f67[_0x6966('0x6')])['then'](function(_0x41e8eb){if(_0x41e8eb){_0x194f67[_0x6966('0xa')]=_0x41e8eb['type'];}utils[_0x6966('0xb')](_0x6966('0xc'),_0x194f67);});}else{utils['request'](_0x6966('0xc'),_0x194f67);}if(_0x194f67[_0x6966('0xd')]){delete queues[_0x194f67[_0x6966('0xd')]];}else{delete queues[_0x194f67['uniqueid']];}}exports[_0x6966('0xe')]=function(_0x276d32){try{utils[_0x6966('0xf')](util[_0x6966('0x2')](_0x6966('0x10'),_0x276d32[_0x6966('0x4')]),_0x276d32);utils['info'](util[_0x6966('0x2')](_0x6966('0x11'),_0x276d32[_0x6966('0x4')],_0x276d32[_0x6966('0x6')],_0x276d32[_0x6966('0x12')]));queues[_0x276d32['uniqueid']]=_[_0x6966('0x13')](_0x276d32,{'originalposition':_0x276d32[_0x6966('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x4f7f3b){utils[_0x6966('0x14')](util[_0x6966('0x2')](_0x6966('0x10'),_0x276d32['uniqueid']),_0x4f7f3b);}};exports[_0x6966('0x15')]=function(_0x4f97b3){try{if(!_[_0x6966('0x16')](queues[_0x4f97b3['uniqueid']])){utils[_0x6966('0xf')](util[_0x6966('0x2')](_0x6966('0x17'),_0x4f97b3[_0x6966('0x4')]),_0x4f97b3);if(queues[_0x4f97b3[_0x6966('0x4')]][_0x6966('0x18')]){if(!queues[_0x4f97b3[_0x6966('0x4')]][_0x6966('0x19')]&&!queues[_0x4f97b3[_0x6966('0x4')]]['queuecallerexit']){queues[_0x4f97b3[_0x6966('0x4')]]['queuecallercomplete']=!![];queues[_0x4f97b3['uniqueid']][_0x6966('0x1a')]=utils[_0x6966('0x1b')]();queues[_0x4f97b3['uniqueid']][_0x6966('0x1c')]=_0x6966('0x1d');}utils[_0x6966('0x1')](util[_0x6966('0x2')](_0x6966('0x1e'),_0x4f97b3['uniqueid'],queues[_0x4f97b3['uniqueid']]['name'],queues[_0x4f97b3[_0x6966('0x4')]][_0x6966('0x1c')]));writeDB(queues[_0x4f97b3[_0x6966('0x4')]]);}else if(queues[_0x4f97b3[_0x6966('0x4')]][_0x6966('0xd')]){utils[_0x6966('0x1')](util[_0x6966('0x2')](_0x6966('0x1f'),_0x4f97b3[_0x6966('0x4')],queues[_0x4f97b3[_0x6966('0x4')]][_0x6966('0x20')],queues[_0x4f97b3['uniqueid']][_0x6966('0xd')]));queues[queues[_0x4f97b3['uniqueid']]['transfereduniqueid']]=queues[_0x4f97b3[_0x6966('0x4')]];queues[queues[_0x4f97b3['uniqueid']]['transfereduniqueid']][_0x6966('0x21')]=0x2;delete queues[_0x4f97b3[_0x6966('0x4')]];}}}catch(_0x4ba39d){utils[_0x6966('0x14')](util[_0x6966('0x2')](_0x6966('0x17'),_0x4f97b3[_0x6966('0x4')]),_0x4ba39d);}};exports[_0x6966('0x22')]=function(_0x32578a){try{utils[_0x6966('0xf')](util[_0x6966('0x2')]('[%s][queues][varset]',_0x32578a[_0x6966('0x4')]),_0x32578a);if(!_['isNil'](_0x32578a[_0x6966('0x23')][_0x6966('0x24')])&&_0x32578a[_0x6966('0x25')][_0x6966('0x26')]()!==_0x6966('0x27')){if(!_[_0x6966('0x16')](queues[_0x32578a[_0x6966('0x4')]])){queues[_0x32578a[_0x6966('0x4')]]['queuecallerabandon']=![];queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x28')]=null;queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x29')]=!![];queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x2a')]=utils[_0x6966('0x1b')]();queues[_0x32578a['uniqueid']][_0x6966('0x1c')]=_0x32578a['value'][_0x6966('0x26')]();utils[_0x6966('0x1')](util['format'](_0x6966('0x2b'),_0x32578a[_0x6966('0x4')],queues[_0x32578a['uniqueid']][_0x6966('0x20')],_0x32578a[_0x6966('0x25')],queues[_0x32578a[_0x6966('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x32578a[_0x6966('0x4')]]);}}else if(!_[_0x6966('0x16')](_0x32578a[_0x6966('0x23')][_0x6966('0x2c')])){if(!_[_0x6966('0x16')](queues[_0x32578a[_0x6966('0x4')]])&&!queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x19')]){queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x19')]=![];queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x28')]=null;queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x29')]=!![];queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x2a')]=utils[_0x6966('0x1b')]();queues[_0x32578a[_0x6966('0x4')]]['queuecallerexitreason']=_0x6966('0x2d');utils['info'](util[_0x6966('0x2')](_0x6966('0x2e'),_0x32578a[_0x6966('0x4')],queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x20')],_0x32578a[_0x6966('0x25')],queues[_0x32578a[_0x6966('0x4')]][_0x6966('0x1c')]));}}}catch(_0x406dd2){utils[_0x6966('0x14')](util[_0x6966('0x2')]('[%s][queues][varset]',_0x32578a[_0x6966('0x4')]),_0x406dd2);}};exports[_0x6966('0x19')]=function(_0x47cd9f){try{if(!_[_0x6966('0x16')](queues[_0x47cd9f[_0x6966('0x4')]])){utils[_0x6966('0xf')](util[_0x6966('0x2')]('[%s][queues][queuecallerabandon]',_0x47cd9f[_0x6966('0x4')]),_0x47cd9f);queues[_0x47cd9f['uniqueid']][_0x6966('0x29')]=![];queues[_0x47cd9f[_0x6966('0x4')]][_0x6966('0x2a')]=null;queues[_0x47cd9f[_0x6966('0x4')]][_0x6966('0x19')]=!![];queues[_0x47cd9f[_0x6966('0x4')]][_0x6966('0x28')]=utils['now']();queues[_0x47cd9f[_0x6966('0x4')]]['queuecallerexitreason']=_0x6966('0x2f');utils[_0x6966('0x1')](util[_0x6966('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x47cd9f['uniqueid'],queues[_0x47cd9f['uniqueid']][_0x6966('0x20')],queues[_0x47cd9f['uniqueid']][_0x6966('0x1c')]));}}catch(_0x7fd132){utils[_0x6966('0x14')](util[_0x6966('0x2')](_0x6966('0x30'),_0x47cd9f[_0x6966('0x4')]),_0x7fd132);}};exports['queuecallerleave']=function(_0x160b82){try{if(!_[_0x6966('0x16')](queues[_0x160b82['uniqueid']])){utils[_0x6966('0xf')](util['format']('[%s][queues][queuecallerleave]',_0x160b82['uniqueid']),_0x160b82);utils[_0x6966('0x1')](util[_0x6966('0x2')](_0x6966('0x31'),_0x160b82[_0x6966('0x4')],queues[_0x160b82[_0x6966('0x4')]][_0x6966('0x20')],_0x160b82[_0x6966('0x32')],_0x160b82['connectedlinename']));queues[_0x160b82[_0x6966('0x4')]][_0x6966('0x33')]=!![];queues[_0x160b82[_0x6966('0x4')]][_0x6966('0x18')]=utils[_0x6966('0x1b')]();queues[_0x160b82[_0x6966('0x4')]][_0x6966('0x34')]=utils[_0x6966('0x35')](queues[_0x160b82['uniqueid']][_0x6966('0x18')],queues[_0x160b82[_0x6966('0x4')]][_0x6966('0x36')]);queues[_0x160b82['uniqueid']][_0x6966('0x12')]=_0x160b82[_0x6966('0x12')];queues[_0x160b82[_0x6966('0x4')]]['count']=_0x160b82[_0x6966('0x37')];queues[_0x160b82[_0x6966('0x4')]][_0x6966('0x32')]=_0x160b82[_0x6966('0x32')];queues[_0x160b82[_0x6966('0x4')]][_0x6966('0x38')]=_0x160b82[_0x6966('0x38')];}}catch(_0x4b3b55){utils['error'](util[_0x6966('0x2')](_0x6966('0x39'),_0x160b82[_0x6966('0x4')]),_0x4b3b55);}};exports[_0x6966('0x3a')]=function(_0x572da7){try{if(!_[_0x6966('0x16')](queues[_0x572da7[_0x6966('0x4')]])){utils['debug'](util[_0x6966('0x2')](_0x6966('0x3b'),_0x572da7['uniqueid']),_0x572da7);utils[_0x6966('0x1')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x572da7[_0x6966('0x4')],queues[_0x572da7[_0x6966('0x4')]][_0x6966('0x20')],_0x572da7[_0x6966('0x3c')],_0x572da7[_0x6966('0x3d')]));queues[_0x572da7[_0x6966('0x4')]]['queuecallerabandon']=![];queues[_0x572da7[_0x6966('0x4')]][_0x6966('0x19')]=![];queues[_0x572da7[_0x6966('0x4')]][_0x6966('0x28')]=null;queues[_0x572da7[_0x6966('0x4')]][_0x6966('0x29')]=![];queues[_0x572da7[_0x6966('0x4')]]['queuecallerexitreason']=null;queues[_0x572da7[_0x6966('0x4')]][_0x6966('0x2a')]=null;queues[_0x572da7[_0x6966('0x4')]][_0x6966('0x3e')]=!![];queues[_0x572da7[_0x6966('0x4')]][_0x6966('0x3f')]=_0x572da7[_0x6966('0x3d')];queues[_0x572da7[_0x6966('0x4')]]['lastAssignedTo']=_0x572da7[_0x6966('0x3c')];}}catch(_0x3e4890){utils['error'](util[_0x6966('0x2')](_0x6966('0x3b'),_0x572da7[_0x6966('0x4')]),_0x3e4890);}};exports['agentcomplete']=function(_0x90af4){try{if(!_[_0x6966('0x16')](queues[_0x90af4[_0x6966('0x4')]])){if(queues[_0x90af4[_0x6966('0x4')]][_0x6966('0x18')]){utils[_0x6966('0xf')](util[_0x6966('0x2')](_0x6966('0x40'),_0x90af4[_0x6966('0x4')]),_0x90af4);queues[_0x90af4[_0x6966('0x4')]][_0x6966('0x19')]=![];queues[_0x90af4[_0x6966('0x4')]][_0x6966('0x19')]=![];queues[_0x90af4['uniqueid']][_0x6966('0x28')]=null;queues[_0x90af4[_0x6966('0x4')]]['queuecallerexit']=![];queues[_0x90af4[_0x6966('0x4')]]['queuecallerexitAt']=null;queues[_0x90af4[_0x6966('0x4')]][_0x6966('0x3e')]=!![];queues[_0x90af4[_0x6966('0x4')]][_0x6966('0x7')]=_0x90af4[_0x6966('0x3c')];queues[_0x90af4['uniqueid']][_0x6966('0x41')]=!![];queues[_0x90af4[_0x6966('0x4')]]['queuecallercompleteAt']=utils[_0x6966('0x1b')]();if(_0x90af4['reason']==_0x6966('0x42')){if(!queues[_0x90af4[_0x6966('0x4')]][_0x6966('0x42')]){queues[_0x90af4[_0x6966('0x4')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x90af4['uniqueid']][_0x6966('0x1c')]=_0x6966('0x43')+_0x90af4[_0x6966('0x44')][_0x6966('0x26')]();}utils[_0x6966('0x1')](util['format'](_0x6966('0x45'),_0x90af4[_0x6966('0x4')],queues[_0x90af4['uniqueid']]['name'],_0x90af4[_0x6966('0x3c')],queues[_0x90af4['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x90af4['uniqueid']]);}}}catch(_0x56f45f){utils[_0x6966('0x14')](util[_0x6966('0x2')](_0x6966('0x40'),_0x90af4[_0x6966('0x4')]),_0x56f45f);}};exports['blindtransfer']=function(_0x80f5e3){try{if(!_[_0x6966('0x16')](queues[_0x80f5e3[_0x6966('0x46')]])){utils[_0x6966('0xf')](util['format'](_0x6966('0x47'),_0x80f5e3[_0x6966('0x4')]),_0x80f5e3);queues[_0x80f5e3[_0x6966('0x46')]][_0x6966('0x42')]=!![];queues[_0x80f5e3[_0x6966('0x46')]][_0x6966('0x48')]=_0x6966('0x49');queues[_0x80f5e3['transfereeuniqueid']][_0x6966('0x4a')]=_0x80f5e3[_0x6966('0x4b')];queues[_0x80f5e3['transfereeuniqueid']]['transferuniqueid']=_0x80f5e3['transfereeuniqueid'];queues[_0x80f5e3[_0x6966('0x46')]][_0x6966('0x1c')]='BLINDTRANSFER';utils['info'](util[_0x6966('0x2')](_0x6966('0x4c'),_0x80f5e3[_0x6966('0x4')],queues[_0x80f5e3['transfereeuniqueid']][_0x6966('0x20')],_0x80f5e3['transfereeuniqueid'],_0x80f5e3[_0x6966('0x4b')]));}}catch(_0x343136){utils[_0x6966('0x14')](util[_0x6966('0x2')]('[%s][queues][blindtransfer]',_0x80f5e3[_0x6966('0x4')]),_0x343136);}};exports[_0x6966('0x4d')]=function(_0x2fa8c8){try{utils[_0x6966('0xf')](util['format'](_0x6966('0x4e'),_0x2fa8c8[_0x6966('0x4f')]),_0x2fa8c8);if(_0x2fa8c8[_0x6966('0x4f')]==_0x2fa8c8[_0x6966('0x50')]){if(!_[_0x6966('0x16')](queues[_0x2fa8c8['secondtransfererlinkedid']])){utils['info'](util[_0x6966('0x2')](_0x6966('0x51'),_0x2fa8c8[_0x6966('0x4f')],queues[_0x2fa8c8[_0x6966('0x52')]]['name'],_0x2fa8c8['origtransfererexten']));queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0x42')]=!![];queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0x48')]=_0x6966('0x53');queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0x4a')]=_0x2fa8c8[_0x6966('0x54')];queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0x55')]=_0x2fa8c8[_0x6966('0x4f')];queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0x1c')]=_0x6966('0x56');}if(!_[_0x6966('0x16')](queues[_0x2fa8c8['origtransfererlinkedid']])){if(_0x2fa8c8[_0x6966('0x57')]&&queues[_0x2fa8c8[_0x6966('0x57')]]){queues[_0x2fa8c8[_0x6966('0x57')]][_0x6966('0x21')]=0x1;queues[_0x2fa8c8[_0x6966('0x46')]]=_[_0x6966('0x58')](queues[_0x2fa8c8[_0x6966('0x57')]]);queues[_0x2fa8c8[_0x6966('0x46')]]['transfereduniqueid']=_0x2fa8c8[_0x6966('0x59')];queues[_0x2fa8c8[_0x6966('0x46')]][_0x6966('0x21')]=0x2;queues[_0x2fa8c8[_0x6966('0x46')]][_0x6966('0x8')]=queues[_0x2fa8c8[_0x6966('0x52')]]['calleridnum'];queues[_0x2fa8c8['transfereeuniqueid']][_0x6966('0x5a')]=queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0x5a')];queues[_0x2fa8c8[_0x6966('0x46')]][_0x6966('0x36')]=utils[_0x6966('0x1b')]();queues[_0x2fa8c8['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x6966('0x1b')]();queues[_0x2fa8c8[_0x6966('0x46')]]['holdtime']=0x0;queues[_0x2fa8c8[_0x6966('0x46')]][_0x6966('0x5b')]=0x0;utils['info'](util['format'](_0x6966('0x5c'),_0x2fa8c8[_0x6966('0x4f')],queues[_0x2fa8c8[_0x6966('0x46')]][_0x6966('0x20')],queues[_0x2fa8c8[_0x6966('0x46')]]['calleridnum'],queues[_0x2fa8c8['transfereeuniqueid']][_0x6966('0x5a')]));}else{utils[_0x6966('0x1')](util[_0x6966('0x2')](_0x6966('0x5d'),_0x2fa8c8[_0x6966('0x4f')],queues[_0x2fa8c8[_0x6966('0x50')]]['name'],_0x2fa8c8[_0x6966('0x52')]));queues[_0x2fa8c8['origtransfererlinkedid']][_0x6966('0xd')]=_0x2fa8c8[_0x6966('0x52')];}}}else if(_0x2fa8c8['secondtransfereruniqueid']==_0x2fa8c8['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x2fa8c8[_0x6966('0x50')]])){utils[_0x6966('0x1')](util['format'](_0x6966('0x5e'),_0x2fa8c8[_0x6966('0x4f')],queues[_0x2fa8c8[_0x6966('0x50')]][_0x6966('0x20')],_0x2fa8c8['secondtransfereruniqueid'],_0x2fa8c8['secondtransfererexten']));queues[_0x2fa8c8[_0x6966('0x50')]][_0x6966('0x42')]=!![];queues[_0x2fa8c8[_0x6966('0x50')]]['transfertype']=_0x6966('0x53');queues[_0x2fa8c8['origtransfererlinkedid']][_0x6966('0x4a')]=_0x2fa8c8['secondtransfererexten'];queues[_0x2fa8c8[_0x6966('0x50')]][_0x6966('0x55')]=_0x2fa8c8['secondtransfereruniqueid'];queues[_0x2fa8c8[_0x6966('0x50')]][_0x6966('0x1c')]='ATTENDEDTRANSFER';}if(!_[_0x6966('0x16')](queues[_0x2fa8c8[_0x6966('0x52')]])){if(_0x2fa8c8[_0x6966('0x5f')]&&queues[_0x2fa8c8['transfertargetlinkedid']]){queues[_0x2fa8c8['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x2fa8c8[_0x6966('0x59')]]=_[_0x6966('0x58')](queues[_0x2fa8c8[_0x6966('0x5f')]]);queues[_0x2fa8c8[_0x6966('0x59')]]['transfereduniqueid']=_0x2fa8c8['transfertargetuniqueid'];queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x21')]=0x2;queues[_0x2fa8c8[_0x6966('0x59')]]['calleridnum']=queues[_0x2fa8c8[_0x6966('0x50')]][_0x6966('0x8')];queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x5a')]=queues[_0x2fa8c8['origtransfererlinkedid']]['calleridname'];queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x36')]=utils[_0x6966('0x1b')]();queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x18')]=utils[_0x6966('0x1b')]();queues[_0x2fa8c8['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x5b')]=0x0;utils[_0x6966('0x1')](util[_0x6966('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x2fa8c8[_0x6966('0x4f')],queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x20')],queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0xd')],queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x8')],queues[_0x2fa8c8[_0x6966('0x59')]][_0x6966('0x5a')]));}else{utils[_0x6966('0x1')](util[_0x6966('0x2')](_0x6966('0x5d'),_0x2fa8c8['origtransfereruniqueid'],queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0x20')],_0x2fa8c8['origtransfererlinkedid']));queues[_0x2fa8c8[_0x6966('0x52')]][_0x6966('0xd')]=_0x2fa8c8[_0x6966('0x50')];}}}}catch(_0x271d1a){utils[_0x6966('0x14')](util[_0x6966('0x2')](_0x6966('0x4e'),_0x2fa8c8[_0x6966('0x4f')]),_0x271d1a);}};exports[_0x6966('0x60')]=function(_0x331b8a){try{if(!_[_0x6966('0x16')](queues[_0x331b8a[_0x6966('0x4')]])){utils[_0x6966('0xf')](util[_0x6966('0x2')]('[%s][queues][musiconholdstart]',_0x331b8a['uniqueid']),_0x331b8a);queues[_0x331b8a['uniqueid']][_0x6966('0x61')]=utils[_0x6966('0x1b')]();utils[_0x6966('0x1')](util[_0x6966('0x2')](_0x6966('0x62'),_0x331b8a['uniqueid'],queues[_0x331b8a[_0x6966('0x4')]][_0x6966('0x20')],queues[_0x331b8a[_0x6966('0x4')]][_0x6966('0x61')]));}}catch(_0x5204e3){utils['error'](util[_0x6966('0x2')](_0x6966('0x63'),_0x331b8a[_0x6966('0x4')]),_0x5204e3);}};exports['musiconholdstop']=function(_0x16a08c){try{if(!_[_0x6966('0x16')](queues[_0x16a08c[_0x6966('0x4')]])){if(!_['isNil'](queues[_0x16a08c[_0x6966('0x4')]][_0x6966('0x61')])){utils['debug'](util[_0x6966('0x2')](_0x6966('0x64'),_0x16a08c[_0x6966('0x4')]),_0x16a08c);queues[_0x16a08c[_0x6966('0x4')]][_0x6966('0x5b')]+=utils[_0x6966('0x35')](utils[_0x6966('0x1b')](),queues[_0x16a08c[_0x6966('0x4')]][_0x6966('0x61')]);utils['info'](util[_0x6966('0x2')](_0x6966('0x65'),_0x16a08c[_0x6966('0x4')],queues[_0x16a08c[_0x6966('0x4')]][_0x6966('0x20')],queues[_0x16a08c[_0x6966('0x4')]][_0x6966('0x5b')]));delete queues[_0x16a08c[_0x6966('0x4')]][_0x6966('0x61')];}}}catch(_0x530235){utils['error'](util[_0x6966('0x2')](_0x6966('0x64'),_0x16a08c['uniqueid']),_0x530235);}}; \ No newline at end of file +var _0xf482=['queuestatus','value','toUpperCase','queuecallerexitAt','queueposition','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','assigned','queuecallercomplete','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%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','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','transfereduniqueid','queuecallerjoin','debug','info','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable'];(function(_0x5916ce,_0x2890be){var _0xf6808a=function(_0x1abce7){while(--_0x1abce7){_0x5916ce['push'](_0x5916ce['shift']());}};_0xf6808a(++_0x2890be);}(_0xf482,0xa5));var _0x2f48=function(_0x5ca3c6,_0x340b24){_0x5ca3c6=_0x5ca3c6-0x0;var _0x7180c8=_0xf482[_0x5ca3c6];return _0x7180c8;};'use strict';var _=require(_0x2f48('0x0'));var util=require('util');var utils=require(_0x2f48('0x1'));var queues={};function writeDB(_0x117d70){utils['info'](util['format'](_0x2f48('0x2'),_0x117d70[_0x2f48('0x3')],_0x117d70['channel'],_0x117d70[_0x2f48('0x4')],_0x117d70[_0x2f48('0x5')],_0x117d70[_0x2f48('0x6')],_0x117d70[_0x2f48('0x7')],_0x117d70[_0x2f48('0x8')]));if(_0x117d70[_0x2f48('0x4')]){utils['getVoiceQueueByName'](_0x117d70['queue'])[_0x2f48('0x9')](function(_0x386e7e){if(_0x386e7e){_0x117d70[_0x2f48('0xa')]=_0x386e7e['type'];}utils['request']('CreateVoiceQueueReport',_0x117d70);});}else{utils[_0x2f48('0xb')]('CreateVoiceQueueReport',_0x117d70);}if(_0x117d70[_0x2f48('0xc')]){delete queues[_0x117d70[_0x2f48('0xc')]];}else{delete queues[_0x117d70[_0x2f48('0x3')]];}}exports[_0x2f48('0xd')]=function(_0xfbf4d0){try{utils[_0x2f48('0xe')](util['format']('[%s][queues][queuecallerjoin]',_0xfbf4d0[_0x2f48('0x3')]),_0xfbf4d0);utils[_0x2f48('0xf')](util[_0x2f48('0x10')](_0x2f48('0x11'),_0xfbf4d0[_0x2f48('0x3')],_0xfbf4d0[_0x2f48('0x4')],_0xfbf4d0[_0x2f48('0x12')]));queues[_0xfbf4d0['uniqueid']]=_[_0x2f48('0x13')](_0xfbf4d0,{'originalposition':_0xfbf4d0['position'],'queuecallerjoinAt':utils[_0x2f48('0x14')](),'mohtime':0x0});}catch(_0x2df7d4){utils[_0x2f48('0x15')](util[_0x2f48('0x10')]('[%s][queues][queuecallerjoin]',_0xfbf4d0['uniqueid']),_0x2df7d4);}};exports[_0x2f48('0x16')]=function(_0xb0f605){try{if(!_[_0x2f48('0x17')](queues[_0xb0f605[_0x2f48('0x3')]])){utils['debug'](util[_0x2f48('0x10')](_0x2f48('0x18'),_0xb0f605[_0x2f48('0x3')]),_0xb0f605);if(queues[_0xb0f605['uniqueid']][_0x2f48('0x19')]){if(!queues[_0xb0f605[_0x2f48('0x3')]][_0x2f48('0x1a')]&&!queues[_0xb0f605[_0x2f48('0x3')]][_0x2f48('0x1b')]){queues[_0xb0f605[_0x2f48('0x3')]]['queuecallercomplete']=!![];queues[_0xb0f605[_0x2f48('0x3')]][_0x2f48('0x1c')]=utils[_0x2f48('0x14')]();queues[_0xb0f605[_0x2f48('0x3')]]['queuecallerexitreason']=_0x2f48('0x1d');}utils[_0x2f48('0xf')](util[_0x2f48('0x10')](_0x2f48('0x1e'),_0xb0f605[_0x2f48('0x3')],queues[_0xb0f605['uniqueid']][_0x2f48('0x1f')],queues[_0xb0f605[_0x2f48('0x3')]][_0x2f48('0x8')]));writeDB(queues[_0xb0f605['uniqueid']]);}else if(queues[_0xb0f605[_0x2f48('0x3')]][_0x2f48('0xc')]){utils[_0x2f48('0xf')](util[_0x2f48('0x10')](_0x2f48('0x20'),_0xb0f605['uniqueid'],queues[_0xb0f605[_0x2f48('0x3')]]['name'],queues[_0xb0f605['uniqueid']][_0x2f48('0xc')]));queues[queues[_0xb0f605[_0x2f48('0x3')]][_0x2f48('0xc')]]=queues[_0xb0f605['uniqueid']];queues[queues[_0xb0f605[_0x2f48('0x3')]][_0x2f48('0xc')]][_0x2f48('0x21')]=0x2;delete queues[_0xb0f605[_0x2f48('0x3')]];}}}catch(_0x1fa9aa){utils['error'](util['format'](_0x2f48('0x18'),_0xb0f605[_0x2f48('0x3')]),_0x1fa9aa);}};exports[_0x2f48('0x22')]=function(_0x38ba75){try{utils[_0x2f48('0xe')](util[_0x2f48('0x10')](_0x2f48('0x23'),_0x38ba75[_0x2f48('0x3')]),_0x38ba75);if(!_[_0x2f48('0x17')](_0x38ba75[_0x2f48('0x24')][_0x2f48('0x25')])&&_0x38ba75[_0x2f48('0x26')][_0x2f48('0x27')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x38ba75['uniqueid']])){queues[_0x38ba75[_0x2f48('0x3')]]['queuecallerabandon']=![];queues[_0x38ba75[_0x2f48('0x3')]]['queuecallerabandonAt']=null;queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x1b')]=!![];queues[_0x38ba75['uniqueid']][_0x2f48('0x28')]=utils['now']();queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x8')]=_0x38ba75[_0x2f48('0x26')][_0x2f48('0x27')]();utils[_0x2f48('0xf')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x38ba75['uniqueid'],queues[_0x38ba75['uniqueid']]['name'],_0x38ba75[_0x2f48('0x26')],queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x8')]));writeDB(queues[_0x38ba75['uniqueid']]);}}else if(!_[_0x2f48('0x17')](_0x38ba75[_0x2f48('0x24')][_0x2f48('0x29')])){if(!_[_0x2f48('0x17')](queues[_0x38ba75[_0x2f48('0x3')]])&&!queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x1a')]){queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x1a')]=![];queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x2a')]=null;queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x1b')]=!![];queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x28')]=utils[_0x2f48('0x14')]();queues[_0x38ba75[_0x2f48('0x3')]][_0x2f48('0x8')]='EXITWITHKEY';utils[_0x2f48('0xf')](util['format'](_0x2f48('0x2b'),_0x38ba75[_0x2f48('0x3')],queues[_0x38ba75[_0x2f48('0x3')]]['name'],_0x38ba75[_0x2f48('0x26')],queues[_0x38ba75['uniqueid']][_0x2f48('0x8')]));}}}catch(_0x330bd4){utils[_0x2f48('0x15')](util[_0x2f48('0x10')](_0x2f48('0x23'),_0x38ba75['uniqueid']),_0x330bd4);}};exports[_0x2f48('0x1a')]=function(_0x7033b2){try{if(!_[_0x2f48('0x17')](queues[_0x7033b2[_0x2f48('0x3')]])){utils[_0x2f48('0xe')](util[_0x2f48('0x10')](_0x2f48('0x2c'),_0x7033b2[_0x2f48('0x3')]),_0x7033b2);queues[_0x7033b2[_0x2f48('0x3')]][_0x2f48('0x1b')]=![];queues[_0x7033b2[_0x2f48('0x3')]][_0x2f48('0x28')]=null;queues[_0x7033b2[_0x2f48('0x3')]]['queuecallerabandon']=!![];queues[_0x7033b2[_0x2f48('0x3')]][_0x2f48('0x2a')]=utils['now']();queues[_0x7033b2[_0x2f48('0x3')]][_0x2f48('0x8')]=_0x2f48('0x2d');utils[_0x2f48('0xf')](util[_0x2f48('0x10')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x7033b2[_0x2f48('0x3')],queues[_0x7033b2[_0x2f48('0x3')]]['name'],queues[_0x7033b2[_0x2f48('0x3')]][_0x2f48('0x8')]));}}catch(_0x58dda0){utils[_0x2f48('0x15')](util['format'](_0x2f48('0x2c'),_0x7033b2[_0x2f48('0x3')]),_0x58dda0);}};exports['queuecallerleave']=function(_0x424928){try{if(!_[_0x2f48('0x17')](queues[_0x424928[_0x2f48('0x3')]])){utils[_0x2f48('0xe')](util['format'](_0x2f48('0x2e'),_0x424928[_0x2f48('0x3')]),_0x424928);utils['info'](util[_0x2f48('0x10')](_0x2f48('0x2f'),_0x424928[_0x2f48('0x3')],queues[_0x424928[_0x2f48('0x3')]][_0x2f48('0x1f')],_0x424928[_0x2f48('0x30')],_0x424928[_0x2f48('0x31')]));queues[_0x424928[_0x2f48('0x3')]][_0x2f48('0x32')]=!![];queues[_0x424928[_0x2f48('0x3')]]['queuecallerleaveAt']=utils[_0x2f48('0x14')]();queues[_0x424928[_0x2f48('0x3')]]['holdtime']=utils[_0x2f48('0x33')](queues[_0x424928['uniqueid']][_0x2f48('0x19')],queues[_0x424928[_0x2f48('0x3')]][_0x2f48('0x34')]);queues[_0x424928['uniqueid']][_0x2f48('0x12')]=_0x424928[_0x2f48('0x12')];queues[_0x424928[_0x2f48('0x3')]][_0x2f48('0x35')]=_0x424928['count'];queues[_0x424928[_0x2f48('0x3')]][_0x2f48('0x30')]=_0x424928[_0x2f48('0x30')];queues[_0x424928[_0x2f48('0x3')]][_0x2f48('0x31')]=_0x424928['connectedlinename'];}}catch(_0x5d4f22){utils[_0x2f48('0x15')](util[_0x2f48('0x10')]('[%s][queues][queuecallerleave]',_0x424928[_0x2f48('0x3')]),_0x5d4f22);}};exports['agentconnect']=function(_0x28e8de){try{if(!_[_0x2f48('0x17')](queues[_0x28e8de[_0x2f48('0x3')]])){utils[_0x2f48('0xe')](util[_0x2f48('0x10')](_0x2f48('0x36'),_0x28e8de['uniqueid']),_0x28e8de);utils[_0x2f48('0xf')](util['format'](_0x2f48('0x37'),_0x28e8de['uniqueid'],queues[_0x28e8de['uniqueid']][_0x2f48('0x1f')],_0x28e8de['membername'],_0x28e8de['destaccountcode']));queues[_0x28e8de['uniqueid']]['queuecallerabandon']=![];queues[_0x28e8de[_0x2f48('0x3')]][_0x2f48('0x1a')]=![];queues[_0x28e8de[_0x2f48('0x3')]][_0x2f48('0x2a')]=null;queues[_0x28e8de['uniqueid']][_0x2f48('0x1b')]=![];queues[_0x28e8de['uniqueid']]['queuecallerexitreason']=null;queues[_0x28e8de[_0x2f48('0x3')]][_0x2f48('0x28')]=null;queues[_0x28e8de[_0x2f48('0x3')]]['assigned']=!![];queues[_0x28e8de[_0x2f48('0x3')]]['accountcode']=_0x28e8de[_0x2f48('0x38')];queues[_0x28e8de[_0x2f48('0x3')]][_0x2f48('0x5')]=_0x28e8de[_0x2f48('0x39')];}}catch(_0x1cddbe){utils[_0x2f48('0x15')](util[_0x2f48('0x10')](_0x2f48('0x36'),_0x28e8de['uniqueid']),_0x1cddbe);}};exports[_0x2f48('0x3a')]=function(_0x5f1783){try{if(!_['isNil'](queues[_0x5f1783[_0x2f48('0x3')]])){if(queues[_0x5f1783[_0x2f48('0x3')]]['queuecallerleaveAt']){utils[_0x2f48('0xe')](util[_0x2f48('0x10')]('[%s][queues][agentcomplete]',_0x5f1783['uniqueid']),_0x5f1783);queues[_0x5f1783[_0x2f48('0x3')]][_0x2f48('0x1a')]=![];queues[_0x5f1783['uniqueid']][_0x2f48('0x1a')]=![];queues[_0x5f1783[_0x2f48('0x3')]][_0x2f48('0x2a')]=null;queues[_0x5f1783['uniqueid']][_0x2f48('0x1b')]=![];queues[_0x5f1783['uniqueid']][_0x2f48('0x28')]=null;queues[_0x5f1783['uniqueid']][_0x2f48('0x3b')]=!![];queues[_0x5f1783[_0x2f48('0x3')]]['lastAssignedTo']=_0x5f1783[_0x2f48('0x39')];queues[_0x5f1783[_0x2f48('0x3')]][_0x2f48('0x3c')]=!![];queues[_0x5f1783[_0x2f48('0x3')]][_0x2f48('0x1c')]=utils['now']();if(_0x5f1783[_0x2f48('0x3d')]==_0x2f48('0x3e')){if(!queues[_0x5f1783[_0x2f48('0x3')]][_0x2f48('0x3e')]){queues[_0x5f1783[_0x2f48('0x3')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x5f1783[_0x2f48('0x3')]]['queuecallerexitreason']=_0x2f48('0x3f')+_0x5f1783[_0x2f48('0x3d')][_0x2f48('0x27')]();}utils[_0x2f48('0xf')](util[_0x2f48('0x10')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x5f1783[_0x2f48('0x3')],queues[_0x5f1783['uniqueid']][_0x2f48('0x1f')],_0x5f1783[_0x2f48('0x39')],queues[_0x5f1783['uniqueid']][_0x2f48('0x8')]));writeDB(queues[_0x5f1783[_0x2f48('0x3')]]);}}}catch(_0x4459ca){utils['error'](util[_0x2f48('0x10')](_0x2f48('0x40'),_0x5f1783[_0x2f48('0x3')]),_0x4459ca);}};exports['blindtransfer']=function(_0x5c2461){try{if(!_['isNil'](queues[_0x5c2461[_0x2f48('0x41')]])){utils['debug'](util['format'](_0x2f48('0x42'),_0x5c2461[_0x2f48('0x3')]),_0x5c2461);queues[_0x5c2461[_0x2f48('0x41')]][_0x2f48('0x3e')]=!![];queues[_0x5c2461[_0x2f48('0x41')]][_0x2f48('0x43')]=_0x2f48('0x44');queues[_0x5c2461[_0x2f48('0x41')]][_0x2f48('0x45')]=_0x5c2461[_0x2f48('0x46')];queues[_0x5c2461[_0x2f48('0x41')]][_0x2f48('0x47')]=_0x5c2461['transfereeuniqueid'];queues[_0x5c2461[_0x2f48('0x41')]][_0x2f48('0x8')]=_0x2f48('0x48');utils[_0x2f48('0xf')](util[_0x2f48('0x10')](_0x2f48('0x49'),_0x5c2461[_0x2f48('0x3')],queues[_0x5c2461[_0x2f48('0x41')]]['name'],_0x5c2461['transfereeuniqueid'],_0x5c2461[_0x2f48('0x46')]));}}catch(_0x23344c){utils[_0x2f48('0x15')](util['format'](_0x2f48('0x42'),_0x5c2461['uniqueid']),_0x23344c);}};exports['attendedtransfer']=function(_0x49b430){try{utils[_0x2f48('0xe')](util[_0x2f48('0x10')](_0x2f48('0x4a'),_0x49b430[_0x2f48('0x4b')]),_0x49b430);if(_0x49b430[_0x2f48('0x4b')]==_0x49b430[_0x2f48('0x4c')]){if(!_['isNil'](queues[_0x49b430[_0x2f48('0x4d')]])){utils['info'](util['format'](_0x2f48('0x4e'),_0x49b430[_0x2f48('0x4b')],queues[_0x49b430[_0x2f48('0x4d')]][_0x2f48('0x1f')],_0x49b430[_0x2f48('0x4f')]));queues[_0x49b430[_0x2f48('0x4d')]][_0x2f48('0x3e')]=!![];queues[_0x49b430['secondtransfererlinkedid']][_0x2f48('0x43')]=_0x2f48('0x50');queues[_0x49b430['secondtransfererlinkedid']][_0x2f48('0x45')]=_0x49b430[_0x2f48('0x4f')];queues[_0x49b430[_0x2f48('0x4d')]][_0x2f48('0x47')]=_0x49b430[_0x2f48('0x4b')];queues[_0x49b430[_0x2f48('0x4d')]][_0x2f48('0x8')]=_0x2f48('0x51');}if(!_['isNil'](queues[_0x49b430[_0x2f48('0x4c')]])){if(_0x49b430['transfereelinkedid']&&queues[_0x49b430[_0x2f48('0x52')]]){queues[_0x49b430[_0x2f48('0x52')]][_0x2f48('0x21')]=0x1;queues[_0x49b430[_0x2f48('0x41')]]=_[_0x2f48('0x53')](queues[_0x49b430[_0x2f48('0x52')]]);queues[_0x49b430[_0x2f48('0x41')]][_0x2f48('0xc')]=_0x49b430[_0x2f48('0x54')];queues[_0x49b430[_0x2f48('0x41')]]['queuecallerenterreason']=0x2;queues[_0x49b430[_0x2f48('0x41')]][_0x2f48('0x6')]=queues[_0x49b430[_0x2f48('0x4d')]][_0x2f48('0x6')];queues[_0x49b430[_0x2f48('0x41')]][_0x2f48('0x55')]=queues[_0x49b430['secondtransfererlinkedid']][_0x2f48('0x55')];queues[_0x49b430[_0x2f48('0x41')]][_0x2f48('0x34')]=utils[_0x2f48('0x14')]();queues[_0x49b430[_0x2f48('0x41')]][_0x2f48('0x19')]=utils[_0x2f48('0x14')]();queues[_0x49b430[_0x2f48('0x41')]][_0x2f48('0x56')]=0x0;queues[_0x49b430['transfereeuniqueid']][_0x2f48('0x57')]=0x0;utils[_0x2f48('0xf')](util[_0x2f48('0x10')](_0x2f48('0x58'),_0x49b430[_0x2f48('0x4b')],queues[_0x49b430[_0x2f48('0x41')]]['name'],queues[_0x49b430[_0x2f48('0x41')]][_0x2f48('0x6')],queues[_0x49b430['transfereeuniqueid']][_0x2f48('0x55')]));}else{utils['info'](util[_0x2f48('0x10')](_0x2f48('0x59'),_0x49b430['origtransfereruniqueid'],queues[_0x49b430['origtransfererlinkedid']][_0x2f48('0x1f')],_0x49b430[_0x2f48('0x4d')]));queues[_0x49b430[_0x2f48('0x4c')]][_0x2f48('0xc')]=_0x49b430[_0x2f48('0x4d')];}}}else if(_0x49b430[_0x2f48('0x5a')]==_0x49b430[_0x2f48('0x4d')]){if(!_['isNil'](queues[_0x49b430[_0x2f48('0x4c')]])){utils[_0x2f48('0xf')](util['format'](_0x2f48('0x5b'),_0x49b430[_0x2f48('0x4b')],queues[_0x49b430['origtransfererlinkedid']][_0x2f48('0x1f')],_0x49b430[_0x2f48('0x5a')],_0x49b430[_0x2f48('0x5c')]));queues[_0x49b430[_0x2f48('0x4c')]]['transfer']=!![];queues[_0x49b430[_0x2f48('0x4c')]][_0x2f48('0x43')]=_0x2f48('0x50');queues[_0x49b430['origtransfererlinkedid']][_0x2f48('0x45')]=_0x49b430['secondtransfererexten'];queues[_0x49b430['origtransfererlinkedid']][_0x2f48('0x47')]=_0x49b430[_0x2f48('0x5a')];queues[_0x49b430[_0x2f48('0x4c')]][_0x2f48('0x8')]=_0x2f48('0x51');}if(!_['isNil'](queues[_0x49b430['secondtransfererlinkedid']])){if(_0x49b430[_0x2f48('0x5d')]&&queues[_0x49b430['transfertargetlinkedid']]){queues[_0x49b430[_0x2f48('0x5d')]][_0x2f48('0x21')]=0x1;queues[_0x49b430[_0x2f48('0x54')]]=_[_0x2f48('0x53')](queues[_0x49b430['transfertargetlinkedid']]);queues[_0x49b430['transfertargetuniqueid']][_0x2f48('0xc')]=_0x49b430[_0x2f48('0x54')];queues[_0x49b430[_0x2f48('0x54')]][_0x2f48('0x21')]=0x2;queues[_0x49b430[_0x2f48('0x54')]]['calleridnum']=queues[_0x49b430['origtransfererlinkedid']][_0x2f48('0x6')];queues[_0x49b430[_0x2f48('0x54')]][_0x2f48('0x55')]=queues[_0x49b430[_0x2f48('0x4c')]][_0x2f48('0x55')];queues[_0x49b430['transfertargetuniqueid']][_0x2f48('0x34')]=utils[_0x2f48('0x14')]();queues[_0x49b430[_0x2f48('0x54')]]['queuecallerleaveAt']=utils[_0x2f48('0x14')]();queues[_0x49b430[_0x2f48('0x54')]]['holdtime']=0x0;queues[_0x49b430[_0x2f48('0x54')]][_0x2f48('0x57')]=0x0;utils[_0x2f48('0xf')](util['format'](_0x2f48('0x5e'),_0x49b430[_0x2f48('0x4b')],queues[_0x49b430[_0x2f48('0x54')]][_0x2f48('0x1f')],queues[_0x49b430['transfertargetuniqueid']][_0x2f48('0xc')],queues[_0x49b430[_0x2f48('0x54')]][_0x2f48('0x6')],queues[_0x49b430[_0x2f48('0x54')]][_0x2f48('0x55')]));}else{utils[_0x2f48('0xf')](util[_0x2f48('0x10')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x49b430[_0x2f48('0x4b')],queues[_0x49b430['secondtransfererlinkedid']][_0x2f48('0x1f')],_0x49b430[_0x2f48('0x4c')]));queues[_0x49b430[_0x2f48('0x4d')]][_0x2f48('0xc')]=_0x49b430[_0x2f48('0x4c')];}}}}catch(_0x550d85){utils[_0x2f48('0x15')](util[_0x2f48('0x10')](_0x2f48('0x4a'),_0x49b430[_0x2f48('0x4b')]),_0x550d85);}};exports['musiconholdstart']=function(_0x23821c){try{if(!_[_0x2f48('0x17')](queues[_0x23821c[_0x2f48('0x3')]])){utils[_0x2f48('0xe')](util[_0x2f48('0x10')](_0x2f48('0x5f'),_0x23821c[_0x2f48('0x3')]),_0x23821c);queues[_0x23821c[_0x2f48('0x3')]][_0x2f48('0x60')]=utils['now']();utils[_0x2f48('0xf')](util[_0x2f48('0x10')](_0x2f48('0x61'),_0x23821c['uniqueid'],queues[_0x23821c[_0x2f48('0x3')]][_0x2f48('0x1f')],queues[_0x23821c[_0x2f48('0x3')]][_0x2f48('0x60')]));}}catch(_0x386dea){utils['error'](util['format'](_0x2f48('0x5f'),_0x23821c[_0x2f48('0x3')]),_0x386dea);}};exports[_0x2f48('0x62')]=function(_0x1d572e){try{if(!_['isNil'](queues[_0x1d572e['uniqueid']])){if(!_[_0x2f48('0x17')](queues[_0x1d572e[_0x2f48('0x3')]]['musiconholdstartAt'])){utils[_0x2f48('0xe')](util[_0x2f48('0x10')](_0x2f48('0x63'),_0x1d572e['uniqueid']),_0x1d572e);queues[_0x1d572e[_0x2f48('0x3')]][_0x2f48('0x57')]+=utils['diffTime'](utils[_0x2f48('0x14')](),queues[_0x1d572e['uniqueid']][_0x2f48('0x60')]);utils['info'](util[_0x2f48('0x10')](_0x2f48('0x64'),_0x1d572e[_0x2f48('0x3')],queues[_0x1d572e[_0x2f48('0x3')]]['name'],queues[_0x1d572e[_0x2f48('0x3')]]['mohtime']));delete queues[_0x1d572e['uniqueid']]['musiconholdstartAt'];}}}catch(_0x18ede2){utils[_0x2f48('0x15')](util[_0x2f48('0x10')]('[%s][queues][musiconholdstop]',_0x1d572e[_0x2f48('0x3')]),_0x18ede2);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index a093f89..b4b1de7 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 _0xadec=['monitors','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xadec,0x14f));var _0xcade=function(_0x5be392,_0x4f864f){_0x5be392=_0x5be392-0x0;var _0x2fa68b=_0xadec[_0x5be392];return _0x2fa68b;};'use strict';var _=require(_0xcade('0x0'));var util=require(_0xcade('0x1'));var utils=require(_0xcade('0x2'));var transfers=require(_0xcade('0x3'));var recordings={};function writeDB(_0xc60091){var _0x6cd90;utils[_0xcade('0x4')](util['format']('[%s][recordings][writeDB]',_0xc60091[_0xcade('0x5')]));if(transfers['blinds'][_0xc60091[_0xcade('0x5')]]){_0x6cd90=_0xc60091[_0xcade('0x5')];_0xc60091['uniqueid']=transfers[_0xcade('0x6')][_0xc60091['uniqueid']][_0xcade('0x7')];}if(_0xc60091[_0xcade('0x8')]){utils[_0xcade('0x9')](_0xc60091[_0xcade('0x8')])[_0xcade('0xa')](function(_0x65c3c6){if(_0x65c3c6){_0xc60091[_0xcade('0xb')]=_0x65c3c6[_0xcade('0xc')];_0xc60091[_0xcade('0xd')]=_0x65c3c6['id'];}utils[_0xcade('0xe')](_0xcade('0xf'),_0xc60091);});}else{utils[_0xcade('0xe')]('CreateVoiceRecording',_0xc60091);}if(_0x6cd90)delete transfers[_0xcade('0x6')][_0x6cd90];}exports['newchannel']=function(_0x592479){try{utils['debug'](util[_0xcade('0x10')](_0xcade('0x11'),_0x592479[_0xcade('0x5')]),_0x592479);if(_0x592479[_0xcade('0x5')]==_0x592479[_0xcade('0x12')]){utils[_0xcade('0x4')](util['format'](_0xcade('0x13'),_0x592479[_0xcade('0x5')],_0x592479[_0xcade('0x14')],_0x592479[_0xcade('0x15')]));recordings[_0x592479[_0xcade('0x5')]]={'uniqueid':_0x592479[_0xcade('0x5')],'accountcode':_0x592479['accountcode'],'exten':_0x592479[_0xcade('0x15')],'context':_0x592479[_0xcade('0x14')],'channel':_0x592479[_0xcade('0x16')],'monitors':[]};}}catch(_0x50a765){utils['error'](util[_0xcade('0x10')](_0xcade('0x11'),_0x592479[_0xcade('0x5')]),_0x50a765);}};exports[_0xcade('0x17')]=function(_0x3e5de4){try{utils[_0xcade('0x18')](util[_0xcade('0x10')]('[%s][recordings][newstate]',_0x3e5de4['uniqueid']),_0x3e5de4);if(!_[_0xcade('0x19')](recordings[_0x3e5de4['uniqueid']])&&_0x3e5de4[_0xcade('0x1a')]==0x6){utils[_0xcade('0x4')](util[_0xcade('0x10')](_0xcade('0x1b'),_0x3e5de4[_0xcade('0x5')],_0x3e5de4[_0xcade('0x14')],_0x3e5de4['channel']));}else if(!_[_0xcade('0x19')](recordings[_0x3e5de4[_0xcade('0x12')]])&&_0x3e5de4[_0xcade('0x1a')]==0x6&&_0x3e5de4[_0xcade('0x14')]!=_0xcade('0x1c')){utils[_0xcade('0x4')](util[_0xcade('0x10')](_0xcade('0x1d'),_0x3e5de4[_0xcade('0x5')],_0x3e5de4[_0xcade('0x12')],_0x3e5de4[_0xcade('0x14')],_0x3e5de4[_0xcade('0x16')]));recordings[_0x3e5de4[_0xcade('0x12')]][_0xcade('0x8')]=_0x3e5de4[_0xcade('0x8')];}}catch(_0x51bf1c){utils[_0xcade('0x1e')](util[_0xcade('0x10')](_0xcade('0x1f'),_0x3e5de4['uniqueid']),_0x51bf1c);}};exports[_0xcade('0x20')]=function(_0x2f9d9e){try{if(!_['isNil'](_0x2f9d9e[_0xcade('0x21')])&&!_[_0xcade('0x19')](_0x2f9d9e[_0xcade('0x21')]['mixmonitor_filename'])){utils['debug'](util[_0xcade('0x10')]('[%s][recordings][varset]',_0x2f9d9e['uniqueid']),_0x2f9d9e);utils[_0xcade('0x4')](util['format'](_0xcade('0x22'),_0x2f9d9e[_0xcade('0x5')],_0x2f9d9e['variable'],_0x2f9d9e[_0xcade('0x23')]));if(_[_0xcade('0x24')](_0x2f9d9e[_0xcade('0x23')],_0xcade('0x25'))){_0x2f9d9e[_0xcade('0x23')]=_0x2f9d9e['value'][_0xcade('0x26')](_0xcade('0x25'),_0xcade('0x27'));}if(recordings[_0x2f9d9e[_0xcade('0x12')]]){var _0x1fad98=_['find'](recordings[_0x2f9d9e[_0xcade('0x12')]][_0xcade('0x28')],{'value':_0x2f9d9e['value']});if(_[_0xcade('0x19')](_0x1fad98)){recordings[_0x2f9d9e[_0xcade('0x12')]][_0xcade('0x28')]['push']({'value':_0x2f9d9e[_0xcade('0x23')]});}}}}catch(_0xf862d8){utils[_0xcade('0x1e')](util[_0xcade('0x10')](_0xcade('0x29'),_0x2f9d9e[_0xcade('0x5')]),_0xf862d8);}};exports[_0xcade('0x2a')]=function(_0x40f7c4){try{if(!_[_0xcade('0x19')](recordings[_0x40f7c4['uniqueid']])){utils['debug'](util[_0xcade('0x10')](_0xcade('0x2b'),_0x40f7c4[_0xcade('0x5')]),_0x40f7c4);utils[_0xcade('0x4')](util[_0xcade('0x10')](_0xcade('0x2c'),_0x40f7c4[_0xcade('0x5')],_0x40f7c4[_0xcade('0x2d')],_0x40f7c4[_0xcade('0x2e')],_0x40f7c4[_0xcade('0x2f')]));recordings[_0x40f7c4['uniqueid']][_0xcade('0x2d')]=_0x40f7c4['calleridnum'];recordings[_0x40f7c4['uniqueid']][_0xcade('0x2e')]=_0x40f7c4[_0xcade('0x2e')];recordings[_0x40f7c4[_0xcade('0x5')]]['connectedlinenum']=_0x40f7c4[_0xcade('0x30')];recordings[_0x40f7c4[_0xcade('0x5')]][_0xcade('0x31')]=_0x40f7c4['connectedlinename'];if(recordings[_0x40f7c4[_0xcade('0x5')]][_0xcade('0x32')]==_0xcade('0x33')&&recordings[_0x40f7c4[_0xcade('0x5')]][_0xcade('0x8')]){recordings[_0x40f7c4['uniqueid']]['connectedlinenum']=recordings[_0x40f7c4[_0xcade('0x5')]][_0xcade('0x8')];recordings[_0x40f7c4[_0xcade('0x5')]]['connectedlinename']='';}recordings[_0x40f7c4[_0xcade('0x5')]][_0xcade('0x28')]['forEach'](function(_0x6ddeb5){var _0x24d88a=_[_0xcade('0x34')](recordings[_0x40f7c4[_0xcade('0x5')]]);_0x24d88a[_0xcade('0x23')]=_0x6ddeb5['value'];writeDB(_0x24d88a);});delete recordings[_0x40f7c4[_0xcade('0x5')]];}}catch(_0x254fb8){utils['error'](util[_0xcade('0x10')](_0xcade('0x2b'),_0x40f7c4['uniqueid']),_0x254fb8);}};exports['newexten']=function(_0x5c6926){try{if(!_['isNil'](recordings[_0x5c6926[_0xcade('0x5')]])){utils['debug'](util[_0xcade('0x10')]('[%s][recordings][newexten]',_0x5c6926[_0xcade('0x5')]),_0x5c6926);utils[_0xcade('0x4')](util[_0xcade('0x10')](_0xcade('0x35'),_0x5c6926['uniqueid'],_0x5c6926[_0xcade('0x36')],_0x5c6926[_0xcade('0x37')]));if(_0x5c6926[_0xcade('0x36')][_0xcade('0x38')]()==_0xcade('0x39')&&_['startsWith'](_0x5c6926[_0xcade('0x37')][_0xcade('0x38')](),_0xcade('0x3a'))){var _0x3442f2=_0x5c6926['appdata'][_0xcade('0x3b')]('=');var _0x5e68bc=_0x3442f2[0x0][_0xcade('0x3c')](_0x3442f2[0x0][_0xcade('0x3d')]('(')+0x1,_0x3442f2[0x0]['lastIndexOf'](')'));var _0x5f202d=_0x3442f2[0x1];recordings[_0x5c6926[_0xcade('0x5')]][_0x5e68bc]=_0x5f202d;}}}catch(_0x374044){utils[_0xcade('0x1e')](util[_0xcade('0x10')](_0xcade('0x3e'),_0x5c6926[_0xcade('0x5')]),_0x374044);}};exports[_0xcade('0x3f')]=function(_0x499b73){try{if(!_[_0xcade('0x19')](recordings[_0x499b73[_0xcade('0x5')]])){utils[_0xcade('0x18')](util['format'](_0xcade('0x40'),_0x499b73[_0xcade('0x5')]),_0x499b73);utils[_0xcade('0x4')](util[_0xcade('0x10')](_0xcade('0x41'),_0x499b73['uniqueid'],_0x499b73[_0xcade('0x42')]));recordings[_0x499b73[_0xcade('0x5')]]['queue']=_0x499b73[_0xcade('0x42')];}}catch(_0x40c8aa){utils['error'](util[_0xcade('0x10')](_0xcade('0x40'),_0x499b73[_0xcade('0x5')]),_0x40c8aa);}};exports['blindtransfer']=function(_0x162def){try{utils[_0xcade('0x18')](util[_0xcade('0x10')](_0xcade('0x43'),_0x162def['uniqueid']),_0x162def);utils['info'](util[_0xcade('0x10')](_0xcade('0x44'),_0x162def['uniqueid'],_0x162def[_0xcade('0x45')],_0x162def[_0xcade('0x46')],_0x162def[_0xcade('0x47')],_0x162def[_0xcade('0x48')]));if(recordings[_0x162def[_0xcade('0x49')]]&&transfers[_0xcade('0x6')][_0x162def[_0xcade('0x49')]]){transfers[_0xcade('0x6')][_0x162def[_0xcade('0x49')]][_0xcade('0x4a')]=!![];}}catch(_0x2ad809){utils['error'](util['format'](_0xcade('0x43'),_0x162def[_0xcade('0x5')]),_0x2ad809);}}; \ No newline at end of file +var _0x8095=['newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereruniqueid','lodash','util','./utils','info','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','context','exten','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','channelstate','transfer','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8095,0x1b2));var _0x5809=function(_0x347ee4,_0x2680b0){_0x347ee4=_0x347ee4-0x0;var _0x9a184d=_0x8095[_0x347ee4];return _0x9a184d;};'use strict';var _=require(_0x5809('0x0'));var util=require(_0x5809('0x1'));var utils=require(_0x5809('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x2631de){var _0x50f2d4;utils[_0x5809('0x3')](util['format'](_0x5809('0x4'),_0x2631de[_0x5809('0x5')]));if(transfers[_0x5809('0x6')][_0x2631de[_0x5809('0x5')]]){_0x50f2d4=_0x2631de[_0x5809('0x5')];_0x2631de[_0x5809('0x5')]=transfers[_0x5809('0x6')][_0x2631de['uniqueid']]['transfereeuniqueid'];}if(_0x2631de[_0x5809('0x7')]){utils[_0x5809('0x8')](_0x2631de[_0x5809('0x7')])[_0x5809('0x9')](function(_0x11c470){if(_0x11c470){_0x2631de[_0x5809('0xa')]=_0x11c470[_0x5809('0xb')];_0x2631de['UserId']=_0x11c470['id'];}utils[_0x5809('0xc')](_0x5809('0xd'),_0x2631de);});}else{utils[_0x5809('0xc')]('CreateVoiceRecording',_0x2631de);}if(_0x50f2d4)delete transfers['blinds'][_0x50f2d4];}exports[_0x5809('0xe')]=function(_0x171048){try{utils[_0x5809('0xf')](util[_0x5809('0x10')](_0x5809('0x11'),_0x171048[_0x5809('0x5')]),_0x171048);if(_0x171048[_0x5809('0x5')]==_0x171048[_0x5809('0x12')]){utils[_0x5809('0x3')](util[_0x5809('0x10')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x171048[_0x5809('0x5')],_0x171048[_0x5809('0x13')],_0x171048[_0x5809('0x14')]));recordings[_0x171048[_0x5809('0x5')]]={'uniqueid':_0x171048[_0x5809('0x5')],'accountcode':_0x171048[_0x5809('0x7')],'exten':_0x171048['exten'],'context':_0x171048[_0x5809('0x13')],'channel':_0x171048['channel'],'monitors':[]};}}catch(_0x44d473){utils['error'](util[_0x5809('0x10')](_0x5809('0x11'),_0x171048['uniqueid']),_0x44d473);}};exports[_0x5809('0x15')]=function(_0x3aa811){try{utils[_0x5809('0xf')](util[_0x5809('0x10')](_0x5809('0x16'),_0x3aa811[_0x5809('0x5')]),_0x3aa811);if(!_[_0x5809('0x17')](recordings[_0x3aa811['uniqueid']])&&_0x3aa811['channelstate']==0x6){utils['info'](util[_0x5809('0x10')](_0x5809('0x18'),_0x3aa811[_0x5809('0x5')],_0x3aa811[_0x5809('0x13')],_0x3aa811[_0x5809('0x19')]));}else if(!_[_0x5809('0x17')](recordings[_0x3aa811[_0x5809('0x12')]])&&_0x3aa811[_0x5809('0x1a')]==0x6&&_0x3aa811[_0x5809('0x13')]!=_0x5809('0x1b')){utils[_0x5809('0x3')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3aa811[_0x5809('0x5')],_0x3aa811[_0x5809('0x12')],_0x3aa811[_0x5809('0x13')],_0x3aa811['channel']));recordings[_0x3aa811[_0x5809('0x12')]][_0x5809('0x7')]=_0x3aa811[_0x5809('0x7')];}}catch(_0x29b88b){utils[_0x5809('0x1c')](util[_0x5809('0x10')](_0x5809('0x16'),_0x3aa811[_0x5809('0x5')]),_0x29b88b);}};exports[_0x5809('0x1d')]=function(_0x11f75e){try{if(!_[_0x5809('0x17')](_0x11f75e[_0x5809('0x1e')])&&!_[_0x5809('0x17')](_0x11f75e[_0x5809('0x1e')][_0x5809('0x1f')])){utils[_0x5809('0xf')](util[_0x5809('0x10')](_0x5809('0x20'),_0x11f75e['uniqueid']),_0x11f75e);utils[_0x5809('0x3')](util[_0x5809('0x10')](_0x5809('0x21'),_0x11f75e[_0x5809('0x5')],_0x11f75e[_0x5809('0x1e')],_0x11f75e[_0x5809('0x22')]));if(_[_0x5809('0x23')](_0x11f75e['value'],_0x5809('0x24'))){_0x11f75e[_0x5809('0x22')]=_0x11f75e[_0x5809('0x22')]['replace'](_0x5809('0x24'),'.WAV');}if(recordings[_0x11f75e[_0x5809('0x12')]]){var _0x5a33c4=_['find'](recordings[_0x11f75e['linkedid']][_0x5809('0x25')],{'value':_0x11f75e['value']});if(_[_0x5809('0x17')](_0x5a33c4)){recordings[_0x11f75e[_0x5809('0x12')]][_0x5809('0x25')][_0x5809('0x26')]({'value':_0x11f75e[_0x5809('0x22')]});}}}}catch(_0x3bf1ee){utils['error'](util[_0x5809('0x10')](_0x5809('0x20'),_0x11f75e[_0x5809('0x5')]),_0x3bf1ee);}};exports[_0x5809('0x27')]=function(_0x325c3f){try{if(!_[_0x5809('0x17')](recordings[_0x325c3f[_0x5809('0x5')]])){utils[_0x5809('0xf')](util[_0x5809('0x10')](_0x5809('0x28'),_0x325c3f['uniqueid']),_0x325c3f);utils[_0x5809('0x3')](util[_0x5809('0x10')](_0x5809('0x29'),_0x325c3f['uniqueid'],_0x325c3f[_0x5809('0x2a')],_0x325c3f[_0x5809('0x2b')],_0x325c3f['cause-txt']));recordings[_0x325c3f[_0x5809('0x5')]][_0x5809('0x2a')]=_0x325c3f[_0x5809('0x2a')];recordings[_0x325c3f[_0x5809('0x5')]][_0x5809('0x2b')]=_0x325c3f[_0x5809('0x2b')];recordings[_0x325c3f['uniqueid']][_0x5809('0x2c')]=_0x325c3f[_0x5809('0x2c')];recordings[_0x325c3f[_0x5809('0x5')]]['connectedlinename']=_0x325c3f[_0x5809('0x2d')];if(recordings[_0x325c3f[_0x5809('0x5')]][_0x5809('0x2e')]==_0x5809('0x2f')&&recordings[_0x325c3f['uniqueid']]['accountcode']){recordings[_0x325c3f[_0x5809('0x5')]][_0x5809('0x2c')]=recordings[_0x325c3f['uniqueid']]['accountcode'];recordings[_0x325c3f[_0x5809('0x5')]][_0x5809('0x2d')]='';}recordings[_0x325c3f[_0x5809('0x5')]]['monitors'][_0x5809('0x30')](function(_0x230cda){var _0x1c8255=_['clone'](recordings[_0x325c3f['uniqueid']]);_0x1c8255['value']=_0x230cda[_0x5809('0x22')];writeDB(_0x1c8255);});delete recordings[_0x325c3f[_0x5809('0x5')]];}}catch(_0x2d1c50){utils['error'](util[_0x5809('0x10')](_0x5809('0x28'),_0x325c3f[_0x5809('0x5')]),_0x2d1c50);}};exports[_0x5809('0x31')]=function(_0x16554d){try{if(!_['isNil'](recordings[_0x16554d['uniqueid']])){utils[_0x5809('0xf')](util[_0x5809('0x10')](_0x5809('0x32'),_0x16554d['uniqueid']),_0x16554d);utils[_0x5809('0x3')](util[_0x5809('0x10')](_0x5809('0x33'),_0x16554d['uniqueid'],_0x16554d[_0x5809('0x34')],_0x16554d[_0x5809('0x35')]));if(_0x16554d[_0x5809('0x34')][_0x5809('0x36')]()==_0x5809('0x37')&&_[_0x5809('0x38')](_0x16554d[_0x5809('0x35')][_0x5809('0x36')](),'cdr')){var _0x20ef52=_0x16554d[_0x5809('0x35')][_0x5809('0x39')]('=');var _0x259576=_0x20ef52[0x0][_0x5809('0x3a')](_0x20ef52[0x0][_0x5809('0x3b')]('(')+0x1,_0x20ef52[0x0]['lastIndexOf'](')'));var _0x108a2c=_0x20ef52[0x1];recordings[_0x16554d[_0x5809('0x5')]][_0x259576]=_0x108a2c;}}}catch(_0x5e5348){utils[_0x5809('0x1c')](util['format'](_0x5809('0x32'),_0x16554d['uniqueid']),_0x5e5348);}};exports[_0x5809('0x3c')]=function(_0x205778){try{if(!_[_0x5809('0x17')](recordings[_0x205778[_0x5809('0x5')]])){utils['debug'](util['format'](_0x5809('0x3d'),_0x205778['uniqueid']),_0x205778);utils['info'](util[_0x5809('0x10')](_0x5809('0x3e'),_0x205778['uniqueid'],_0x205778[_0x5809('0x3f')]));recordings[_0x205778[_0x5809('0x5')]][_0x5809('0x3f')]=_0x205778[_0x5809('0x3f')];}}catch(_0x31a052){utils[_0x5809('0x1c')](util[_0x5809('0x10')](_0x5809('0x3d'),_0x205778[_0x5809('0x5')]),_0x31a052);}};exports['blindtransfer']=function(_0x3cf08c){try{utils[_0x5809('0xf')](util[_0x5809('0x10')](_0x5809('0x40'),_0x3cf08c['uniqueid']),_0x3cf08c);utils[_0x5809('0x3')](util[_0x5809('0x10')](_0x5809('0x41'),_0x3cf08c['uniqueid'],_0x3cf08c[_0x5809('0x42')],_0x3cf08c['transferercalleridname'],_0x3cf08c[_0x5809('0x43')],_0x3cf08c['transfereecalleridname']));if(recordings[_0x3cf08c[_0x5809('0x44')]]&&transfers[_0x5809('0x6')][_0x3cf08c[_0x5809('0x44')]]){transfers[_0x5809('0x6')][_0x3cf08c[_0x5809('0x44')]]['recording']=!![];}}catch(_0x3f046b){utils[_0x5809('0x1c')](util['format'](_0x5809('0x40'),_0x3cf08c['uniqueid']),_0x3f046b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2aaa21a..77aa9f1 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 _0x7b8a=['origtransfereruniqueid','uniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended'];(function(_0x53494b,_0x52e808){var _0x2b3cba=function(_0x19eb6f){while(--_0x19eb6f){_0x53494b['push'](_0x53494b['shift']());}};_0x2b3cba(++_0x52e808);}(_0x7b8a,0x157));var _0xa7b8=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x7b8a[_0x4b9dc9];return _0x57b302;};'use strict';var _=require('lodash');var util=require(_0xa7b8('0x0'));var utils=require(_0xa7b8('0x1'));function writeDB(_0x50de0b){utils[_0xa7b8('0x2')](util[_0xa7b8('0x3')](_0xa7b8('0x4'),_0x50de0b[_0xa7b8('0x5')]===_0xa7b8('0x6')?_0x50de0b[_0xa7b8('0x7')]:_0x50de0b[_0xa7b8('0x8')],_0x50de0b[_0xa7b8('0x5')]));utils[_0xa7b8('0x9')]('CreateVoiceTransferReport',_0x50de0b);}exports['blinds']={};exports[_0xa7b8('0xa')]=function(_0x23cc26){try{utils[_0xa7b8('0xb')](util[_0xa7b8('0x3')](_0xa7b8('0xc'),_0x23cc26[_0xa7b8('0x8')]),_0x23cc26);utils[_0xa7b8('0x2')](util[_0xa7b8('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x23cc26[_0xa7b8('0x8')],_0x23cc26[_0xa7b8('0xd')],_0x23cc26[_0xa7b8('0xe')],_0x23cc26[_0xa7b8('0xf')],_0x23cc26['transfereecalleridname']));_0x23cc26[_0xa7b8('0x5')]=_0xa7b8('0x10');exports['blinds'][_0x23cc26['transfereruniqueid']]=_0x23cc26;writeDB(_0x23cc26);}catch(_0x3e28ee){utils['error'](util['format'](_0xa7b8('0xc'),_0x23cc26[_0xa7b8('0x8')]),_0x3e28ee);}};exports['attendedtransfer']=function(_0x38ee85){try{utils['debug'](util[_0xa7b8('0x3')](_0xa7b8('0x11'),_0x38ee85['origtransfereruniqueid']),_0x38ee85);utils[_0xa7b8('0x2')](util[_0xa7b8('0x3')](_0xa7b8('0x12'),_0x38ee85[_0xa7b8('0x7')],_0x38ee85['origtransferercalleridnum'],_0x38ee85[_0xa7b8('0x13')],_0x38ee85[_0xa7b8('0x14')],_0x38ee85[_0xa7b8('0x15')]));_0x38ee85=_[_0xa7b8('0x16')](_0x38ee85,{'transfererchannel':_0x38ee85[_0xa7b8('0x17')],'transferercalleridnum':_0x38ee85[_0xa7b8('0x18')],'transferercalleridname':_0x38ee85['origtransferercalleridname'],'transfererconnectedlinenum':_0x38ee85[_0xa7b8('0x19')],'transfererconnectedlinename':_0x38ee85['secondtransfererconnectedlinename'],'transfereraccountcode':_0x38ee85[_0xa7b8('0x1a')],'transferercontext':_0x38ee85[_0xa7b8('0x1b')],'transfererexten':_0x38ee85['secondtransfererexten'],'transfererlinkedid':_0x38ee85[_0xa7b8('0x1c')],'context':_0x38ee85[_0xa7b8('0x1d')],'extension':_0x38ee85['origtransfererexten'],'type':_0xa7b8('0x6')});if(_['isNil'](_0x38ee85['transfereechannel'])){_0x38ee85=_[_0xa7b8('0x16')](_0x38ee85,{'transfereechannel':_0x38ee85[_0xa7b8('0x1e')],'transfereecalleridnum':_0x38ee85[_0xa7b8('0x14')],'transfereecalleridname':_0x38ee85[_0xa7b8('0x15')],'transfereeconnectedlinenum':_0x38ee85[_0xa7b8('0x1f')],'transfereeconnectedlinename':_0x38ee85[_0xa7b8('0x20')],'transfereeaccountcode':_0x38ee85[_0xa7b8('0x21')],'transfereecontext':_0x38ee85[_0xa7b8('0x22')],'transfereeexten':_0x38ee85['transfertargetexten'],'transfereelinkedid':_0x38ee85['transfertargetlinkedid']});}writeDB(_0x38ee85);}catch(_0x311e5a){utils['error'](util[_0xa7b8('0x3')](_0xa7b8('0x11'),_0x38ee85['origtransfereruniqueid']),_0x311e5a);}}; \ No newline at end of file +var _0x38a2=['lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetlinkedid'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0x38a2,0x1ae));var _0x238a=function(_0x53d8d2,_0x3581dc){_0x53d8d2=_0x53d8d2-0x0;var _0x30f9d8=_0x38a2[_0x53d8d2];return _0x30f9d8;};'use strict';var _=require(_0x238a('0x0'));var util=require(_0x238a('0x1'));var utils=require(_0x238a('0x2'));function writeDB(_0x348b4f){utils[_0x238a('0x3')](util['format'](_0x238a('0x4'),_0x348b4f['type']===_0x238a('0x5')?_0x348b4f['origtransfereruniqueid']:_0x348b4f[_0x238a('0x6')],_0x348b4f[_0x238a('0x7')]));utils['request'](_0x238a('0x8'),_0x348b4f);}exports[_0x238a('0x9')]={};exports[_0x238a('0xa')]=function(_0x56338b){try{utils[_0x238a('0xb')](util[_0x238a('0xc')](_0x238a('0xd'),_0x56338b[_0x238a('0x6')]),_0x56338b);utils[_0x238a('0x3')](util['format'](_0x238a('0xe'),_0x56338b[_0x238a('0x6')],_0x56338b[_0x238a('0xf')],_0x56338b[_0x238a('0x10')],_0x56338b[_0x238a('0x11')],_0x56338b[_0x238a('0x12')]));_0x56338b['type']=_0x238a('0x13');exports[_0x238a('0x9')][_0x56338b[_0x238a('0x14')]]=_0x56338b;writeDB(_0x56338b);}catch(_0x11c529){utils[_0x238a('0x15')](util[_0x238a('0xc')](_0x238a('0xd'),_0x56338b[_0x238a('0x6')]),_0x11c529);}};exports[_0x238a('0x16')]=function(_0x438be6){try{utils[_0x238a('0xb')](util[_0x238a('0xc')](_0x238a('0x17'),_0x438be6[_0x238a('0x18')]),_0x438be6);utils[_0x238a('0x3')](util['format'](_0x238a('0x19'),_0x438be6[_0x238a('0x18')],_0x438be6[_0x238a('0x1a')],_0x438be6[_0x238a('0x1b')],_0x438be6[_0x238a('0x1c')],_0x438be6['transfertargetcalleridname']));_0x438be6=_[_0x238a('0x1d')](_0x438be6,{'transfererchannel':_0x438be6[_0x238a('0x1e')],'transferercalleridnum':_0x438be6[_0x238a('0x1a')],'transferercalleridname':_0x438be6[_0x238a('0x1b')],'transfererconnectedlinenum':_0x438be6[_0x238a('0x1f')],'transfererconnectedlinename':_0x438be6[_0x238a('0x20')],'transfereraccountcode':_0x438be6['origtransfereraccountcode'],'transferercontext':_0x438be6[_0x238a('0x21')],'transfererexten':_0x438be6['secondtransfererexten'],'transfererlinkedid':_0x438be6['origtransfererlinkedid'],'context':_0x438be6[_0x238a('0x22')],'extension':_0x438be6[_0x238a('0x23')],'type':'attended'});if(_[_0x238a('0x24')](_0x438be6[_0x238a('0x25')])){_0x438be6=_[_0x238a('0x1d')](_0x438be6,{'transfereechannel':_0x438be6[_0x238a('0x26')],'transfereecalleridnum':_0x438be6[_0x238a('0x1c')],'transfereecalleridname':_0x438be6[_0x238a('0x27')],'transfereeconnectedlinenum':_0x438be6[_0x238a('0x28')],'transfereeconnectedlinename':_0x438be6[_0x238a('0x29')],'transfereeaccountcode':_0x438be6['transfertargetaccountcode'],'transfereecontext':_0x438be6['transfertargetcontext'],'transfereeexten':_0x438be6['transfertargetexten'],'transfereelinkedid':_0x438be6[_0x238a('0x2a')]});}writeDB(_0x438be6);}catch(_0x4a9c2d){utils[_0x238a('0x15')](util[_0x238a('0xc')](_0x238a('0x17'),_0x438be6[_0x238a('0x18')]),_0x4a9c2d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index d444f08..194202f 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 _0x3885=['then','[utils][request]\x20name:%s','catch','GetUser','name','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','util','client','../../config/logger','xdr','info','inspect','debug','error','request'];(function(_0x2b0697,_0x30f551){var _0x532fd2=function(_0x3bc9d6){while(--_0x3bc9d6){_0x2b0697['push'](_0x2b0697['shift']());}};_0x532fd2(++_0x30f551);}(_0x3885,0x10e));var _0x5388=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3885[_0x59ee6f];return _0x4c0979;};'use strict';var BPromise=require(_0x5388('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x5388('0x1'));var client=jayson[_0x5388('0x2')]['http']({'port':0x2329});var logger=require(_0x5388('0x3'))(_0x5388('0x4'));exports['info']=function(_0x2f9fef,_0x5f5985){logger[_0x5388('0x5')](_0x2f9fef,_0x5f5985?util[_0x5388('0x6')](_0x5f5985,{'showHidden':![],'depth':null}):'');};exports[_0x5388('0x7')]=function(_0xe1082e,_0x230fd3){logger[_0x5388('0x7')](_0xe1082e,_0x230fd3?util[_0x5388('0x6')](_0x230fd3,{'showHidden':![],'depth':null}):'');};exports[_0x5388('0x8')]=function(_0x3cf85c,_0x357346){logger['error'](_0x3cf85c,_0x357346?util[_0x5388('0x6')](_0x357346,{'showHidden':![],'depth':null}):'');};exports[_0x5388('0x9')]=function(_0x56cd09,_0x10f7ea){return client[_0x5388('0x9')](_0x56cd09,{'body':_0x10f7ea})[_0x5388('0xa')](function(_0x323433){logger[_0x5388('0x7')](_0x5388('0xb'),_0x56cd09,_0x323433?util['inspect'](_0x323433,{'showHidden':![],'depth':null}):'');})[_0x5388('0xc')](function(_0x99a0de){logger[_0x5388('0x8')](_0x5388('0xb'),_0x56cd09,_0x99a0de?util[_0x5388('0x6')](_0x99a0de,{'showHidden':![],'depth':null}):'');});};function getUser(_0x79b0f2){return client[_0x5388('0x9')](_0x5388('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x5388('0xe'),'interface'],'where':_0x79b0f2,'limit':0x1}})['then'](function(_0x2af287){logger[_0x5388('0x7')]('[utils][getUser]\x20where:%s',JSON[_0x5388('0xf')](_0x79b0f2),_0x2af287?util[_0x5388('0x6')](_0x2af287,{'showHidden':![],'depth':null}):'');return _0x2af287[_0x5388('0x10')][_0x5388('0x11')]?_0x2af287[_0x5388('0x10')][0x0]:null;});}exports[_0x5388('0x12')]=function(_0x2db5f4){return new BPromise(function(_0x20ae95,_0x3917a2){if(_0x2db5f4){return getUser({'internal':_0x2db5f4})[_0x5388('0xa')](function(_0x3fb9a6){logger[_0x5388('0x5')](_0x5388('0x13'),_0x2db5f4,_0x3fb9a6?_0x5388('0x14'):'notfound');return _0x20ae95(_0x3fb9a6);})[_0x5388('0xc')](function(_0x37f9ec){logger[_0x5388('0x8')](_0x5388('0x15'),_0x37f9ec?util[_0x5388('0x6')](_0x37f9ec,{'showHidden':![],'depth':null}):'');return _0x20ae95(null);});}return _0x20ae95(null);});};exports['getUserByInterface']=function(_0x140bca){return new BPromise(function(_0x38cdab,_0x5a3ced){if(_0x140bca){return getUser({'interface':_0x140bca})[_0x5388('0xa')](function(_0x5b3cb3){logger[_0x5388('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x140bca,_0x5b3cb3?_0x5388('0x14'):_0x5388('0x16'));return _0x38cdab(_0x5b3cb3);})['catch'](function(_0x335578){logger['error']('[utils][getUserByInterface]',_0x335578?util[_0x5388('0x6')](_0x335578,{'showHidden':![],'depth':null}):'');return _0x38cdab(null);});}return _0x38cdab(null);});};exports[_0x5388('0x17')]=function(_0x10fe26){return new BPromise(function(_0x4e9012,_0xd7c04c){if(_0x10fe26){return getUser({'name':_0x10fe26})[_0x5388('0xa')](function(_0x1d4f18){logger['info'](_0x5388('0x18'),_0x10fe26,_0x1d4f18?_0x5388('0x14'):_0x5388('0x16'));return _0x4e9012(_0x1d4f18);})['catch'](function(_0x48f1cb){logger['error']('[utils][getUserByName]',_0x48f1cb?util['inspect'](_0x48f1cb,{'showHidden':![],'depth':null}):'');return _0x4e9012(null);});}return _0x4e9012(null);});};exports[_0x5388('0x19')]=function(_0x39117b){return new BPromise(function(_0x2a79d9,_0x5f0b95){if(_0x39117b){return client[_0x5388('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5388('0xe'),'type',_0x5388('0x1a'),'acwTimeout'],'where':{'name':_0x39117b},'limit':0x1}})[_0x5388('0xa')](function(_0x4daeda){logger[_0x5388('0x7')](_0x5388('0x1b'),_0x39117b,_0x4daeda?util[_0x5388('0x6')](_0x4daeda,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x39117b,_0x4daeda?_0x5388('0x14'):_0x5388('0x16'));return _0x2a79d9(_0x4daeda['result'][_0x5388('0x11')]?_0x4daeda[_0x5388('0x10')][0x0]:null);})[_0x5388('0xc')](function(_0x475c1d){logger[_0x5388('0x8')](_0x5388('0x1c'),_0x475c1d?util[_0x5388('0x6')](_0x475c1d,{'showHidden':![],'depth':null}):'');return _0x2a79d9(null);});}return _0x2a79d9(null);});};exports['addTime']=function(_0x37a14b,_0x3d73c3){return moment(_0x37a14b)['add'](_0x3d73c3,_0x5388('0x1d'))[_0x5388('0x1e')](_0x5388('0x1f'));};exports[_0x5388('0x20')]=function(_0x4f806c,_0x4cfcc9){return moment(_0x4f806c)[_0x5388('0x21')](_0x4cfcc9,_0x5388('0x1d'))[_0x5388('0x1e')](_0x5388('0x1f'));};exports[_0x5388('0x22')]=function(_0x115cc1,_0x2bd9ce){return moment(_0x115cc1)[_0x5388('0x23')](moment(_0x2bd9ce),_0x5388('0x1d'));};exports[_0x5388('0x24')]=function(_0x4cb62a,_0x542d91){return parseInt(_0x4cb62a,0xa)+parseInt(_0x542d91,0xa);};exports[_0x5388('0x25')]=function(){return moment()['format'](_0x5388('0x1f'));};exports[_0x5388('0x26')]=function(_0x18be81,_0x3fbf3c){if(_0x3fbf3c){return moment(_0x18be81)[_0x5388('0x26')](_0x3fbf3c);}return!![];};exports['isBefore']=function(_0x400eda,_0x3745a8){if(_0x3745a8){return moment(_0x400eda)[_0x5388('0x27')](_0x3745a8);}else if(_0x400eda){return!![];}return![];}; \ No newline at end of file +var _0x27cb=['[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','client','http','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','length','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound'];(function(_0x5b6c49,_0x532b93){var _0x4155e1=function(_0x1a51a9){while(--_0x1a51a9){_0x5b6c49['push'](_0x5b6c49['shift']());}};_0x4155e1(++_0x532b93);}(_0x27cb,0x73));var _0xb27c=function(_0x563419,_0x2a277f){_0x563419=_0x563419-0x0;var _0x4fe0c2=_0x27cb[_0x563419];return _0x4fe0c2;};'use strict';var BPromise=require(_0xb27c('0x0'));var jayson=require('jayson/promise');var moment=require(_0xb27c('0x1'));var util=require(_0xb27c('0x2'));var client=jayson[_0xb27c('0x3')][_0xb27c('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xb27c('0x5'));exports['info']=function(_0x56412e,_0x4c2a87){logger[_0xb27c('0x6')](_0x56412e,_0x4c2a87?util[_0xb27c('0x7')](_0x4c2a87,{'showHidden':![],'depth':null}):'');};exports[_0xb27c('0x8')]=function(_0x16b21b,_0x544d90){logger[_0xb27c('0x8')](_0x16b21b,_0x544d90?util[_0xb27c('0x7')](_0x544d90,{'showHidden':![],'depth':null}):'');};exports[_0xb27c('0x9')]=function(_0x3a20fe,_0x86c816){logger[_0xb27c('0x9')](_0x3a20fe,_0x86c816?util[_0xb27c('0x7')](_0x86c816,{'showHidden':![],'depth':null}):'');};exports[_0xb27c('0xa')]=function(_0x3d4a6e,_0x58bdf9){return client[_0xb27c('0xa')](_0x3d4a6e,{'body':_0x58bdf9})[_0xb27c('0xb')](function(_0x41f308){logger[_0xb27c('0x8')]('[utils][request]\x20name:%s',_0x3d4a6e,_0x41f308?util['inspect'](_0x41f308,{'showHidden':![],'depth':null}):'');})[_0xb27c('0xc')](function(_0x49f581){logger[_0xb27c('0x9')](_0xb27c('0xd'),_0x3d4a6e,_0x49f581?util[_0xb27c('0x7')](_0x49f581,{'showHidden':![],'depth':null}):'');});};function getUser(_0x311707){return client[_0xb27c('0xa')](_0xb27c('0xe'),{'options':{'raw':!![],'attributes':['id',_0xb27c('0xf'),_0xb27c('0x10'),_0xb27c('0x11')],'where':_0x311707,'limit':0x1}})[_0xb27c('0xb')](function(_0x11c0a3){logger[_0xb27c('0x8')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x311707),_0x11c0a3?util[_0xb27c('0x7')](_0x11c0a3,{'showHidden':![],'depth':null}):'');return _0x11c0a3['result'][_0xb27c('0x12')]?_0x11c0a3[_0xb27c('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x3cae07){return new BPromise(function(_0x2e903f,_0x1bd501){if(_0x3cae07){return getUser({'internal':_0x3cae07})['then'](function(_0xbb07e8){logger[_0xb27c('0x6')](_0xb27c('0x14'),_0x3cae07,_0xbb07e8?_0xb27c('0x15'):_0xb27c('0x16'));return _0x2e903f(_0xbb07e8);})['catch'](function(_0x16b0dc){logger[_0xb27c('0x9')](_0xb27c('0x17'),_0x16b0dc?util['inspect'](_0x16b0dc,{'showHidden':![],'depth':null}):'');return _0x2e903f(null);});}return _0x2e903f(null);});};exports[_0xb27c('0x18')]=function(_0x52cd7c){return new BPromise(function(_0x3e4a89,_0x339e73){if(_0x52cd7c){return getUser({'interface':_0x52cd7c})[_0xb27c('0xb')](function(_0x8809fe){logger[_0xb27c('0x6')](_0xb27c('0x19'),_0x52cd7c,_0x8809fe?_0xb27c('0x15'):'notfound');return _0x3e4a89(_0x8809fe);})['catch'](function(_0x5d5f35){logger[_0xb27c('0x9')](_0xb27c('0x1a'),_0x5d5f35?util['inspect'](_0x5d5f35,{'showHidden':![],'depth':null}):'');return _0x3e4a89(null);});}return _0x3e4a89(null);});};exports['getUserByName']=function(_0x13b83b){return new BPromise(function(_0x27665b,_0x1f5653){if(_0x13b83b){return getUser({'name':_0x13b83b})[_0xb27c('0xb')](function(_0xdff5b2){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x13b83b,_0xdff5b2?_0xb27c('0x15'):_0xb27c('0x16'));return _0x27665b(_0xdff5b2);})[_0xb27c('0xc')](function(_0x58f7c7){logger['error']('[utils][getUserByName]',_0x58f7c7?util[_0xb27c('0x7')](_0x58f7c7,{'showHidden':![],'depth':null}):'');return _0x27665b(null);});}return _0x27665b(null);});};exports[_0xb27c('0x1b')]=function(_0x278ef9){return new BPromise(function(_0xb83875,_0x4bee0e){if(_0x278ef9){return client[_0xb27c('0xa')](_0xb27c('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xb27c('0x10'),_0xb27c('0x1d'),'acw',_0xb27c('0x1e')],'where':{'name':_0x278ef9},'limit':0x1}})[_0xb27c('0xb')](function(_0x301172){logger[_0xb27c('0x8')](_0xb27c('0x1f'),_0x278ef9,_0x301172?util['inspect'](_0x301172,{'showHidden':![],'depth':null}):'');logger[_0xb27c('0x6')](_0xb27c('0x20'),_0x278ef9,_0x301172?_0xb27c('0x15'):'notfound');return _0xb83875(_0x301172[_0xb27c('0x13')][_0xb27c('0x12')]?_0x301172[_0xb27c('0x13')][0x0]:null);})['catch'](function(_0xbffcba){logger[_0xb27c('0x9')]('[utils][getVoiceQueueByName]',_0xbffcba?util[_0xb27c('0x7')](_0xbffcba,{'showHidden':![],'depth':null}):'');return _0xb83875(null);});}return _0xb83875(null);});};exports[_0xb27c('0x21')]=function(_0x347dee,_0x25e1be){return moment(_0x347dee)[_0xb27c('0x22')](_0x25e1be,_0xb27c('0x23'))[_0xb27c('0x24')](_0xb27c('0x25'));};exports[_0xb27c('0x26')]=function(_0x4e6bee,_0x369be5){return moment(_0x4e6bee)[_0xb27c('0x27')](_0x369be5,_0xb27c('0x23'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb27c('0x28')]=function(_0x4ad802,_0x1f7502){return moment(_0x4ad802)[_0xb27c('0x29')](moment(_0x1f7502),'seconds');};exports[_0xb27c('0x2a')]=function(_0x2d2f50,_0xefbcf1){return parseInt(_0x2d2f50,0xa)+parseInt(_0xefbcf1,0xa);};exports[_0xb27c('0x2b')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x557052,_0x16818b){if(_0x16818b){return moment(_0x557052)[_0xb27c('0x2c')](_0x16818b);}return!![];};exports[_0xb27c('0x2d')]=function(_0x351242,_0x433034){if(_0x433034){return moment(_0x351242)[_0xb27c('0x2d')](_0x433034);}else if(_0x351242){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 5df8e39..fed40f9 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 _0x8d2d=['body','format','method','headers','x-forwarded-for','remoteAddress','url','responseTime','inspect','device','agent_id','connection','statusCode','other','agent_name','test','fs-extra','lodash','express-winston','path','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','role','name','ensureDir','then','user','timestamp','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','\x20body=%s'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x8d2d,0x9a));var _0xd8d2=function(_0x4cfc01,_0x466445){_0x4cfc01=_0x4cfc01-0x0;var _0x2b4eb8=_0x8d2d[_0x4cfc01];return _0x2b4eb8;};var fs=require(_0xd8d2('0x0'));var _=require(_0xd8d2('0x1'));var ewinston=require(_0xd8d2('0x2'));var path=require(_0xd8d2('0x3'));var util=require(_0xd8d2('0x4'));var fileLogger=require('./loggers')[_0xd8d2('0x5')];var safeTemplate=require(_0xd8d2('0x6'))[_0xd8d2('0x7')];var maskSensitiveData=require(_0xd8d2('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x18603f(_0x54e16c){var _0x5c8878=path[_0xd8d2('0x9')](_0xd8d2('0xa'),_0xd8d2('0xb'),_0xd8d2('0xc'));var _0xc00b15=path[_0xd8d2('0x9')](_0xd8d2('0xd'),_0x54e16c[_0xd8d2('0xe')]+'-'+_0x54e16c[_0xd8d2('0xf')]);return fs[_0xd8d2('0x10')](path['join'](_0x5c8878,_0xc00b15))['then'](function(){var _0x4012d7=fileLogger('client',path[_0xd8d2('0x9')](_0x5c8878,_0xc00b15));return _0x4012d7;})['catch'](function(_0x40178b){throw _0x40178b;});}this['log']=function(_0x3a9cc2,_0x274aed,_0x581987,_0x4e4a22){return _0x18603f(_0x3a9cc2['user'])[_0xd8d2('0x11')](function(_0x4ff971){var _0x480e1f=_0x4ff971[_0x274aed];return _0x480e1f;})[_0xd8d2('0x11')](function(_0xdb1f02){var _0x11a266=_0x3a9cc2['user']?_0x3a9cc2[_0xd8d2('0x12')]['id']:'no-user';var _0x25d52a=_0x4e4a22['data'];var _0xa9ca1c=_0x4e4a22[_0xd8d2('0x13')];var _0x2b7b3d=new Date(Number(_0xa9ca1c));return _0xdb1f02(_0x11a266,_0x2b7b3d,_0x581987,_0x25d52a);})[_0xd8d2('0x14')](function(_0x34ebea){fileLogger(_0xd8d2('0xd'))[_0xd8d2('0x15')](_0x34ebea);});};}function setupLoggers(_0x6855e7){return new Promise(function(_0xa0fe80){var _0x48a2a8=new ClientSideLogger();var _0x5ed85d=fileLogger(_0xd8d2('0x16'));var _0x5c17ca=fileLogger(_0xd8d2('0x17'));_0x6855e7[_0xd8d2('0x18')](_0xd8d2('0x19'),_0x48a2a8);_0x6855e7[_0xd8d2('0x1a')](ewinston[_0xd8d2('0x1b')]({'winstonInstance':_0x5ed85d,'meta':![],'statusLevels':!![],'msg':function(_0x1cc30d,_0x31d14b){var _0xe61909=_0xd8d2('0x1c');if(!_['isEmpty'](_0x1cc30d['body'])){_0xe61909+=_0xd8d2('0x1d');var _0x319895=_0x1cc30d[_0xd8d2('0x1e')];maskSensitiveData(_0x319895);}return safeTemplate(util[_0xd8d2('0x1f')](_0xe61909,_0x1cc30d[_0xd8d2('0x20')],_0x1cc30d[_0xd8d2('0x21')]['x-forwarded-for']?_0x1cc30d[_0xd8d2('0x21')][_0xd8d2('0x22')]:_0x1cc30d['connection'][_0xd8d2('0x23')]||_0x1cc30d['ip'],_0x1cc30d[_0xd8d2('0x24')],_0x31d14b['statusCode'],_0x31d14b[_0xd8d2('0x25')],_0x1cc30d[_0xd8d2('0x12')]?_0x1cc30d[_0xd8d2('0x12')]['id']:null,_0x1cc30d[_0xd8d2('0x12')]?_0x1cc30d[_0xd8d2('0x12')][_0xd8d2('0xf')]:null,_0x1cc30d[_0xd8d2('0x12')]?_0x1cc30d[_0xd8d2('0x12')]['role']:null,_0x319895?util[_0xd8d2('0x26')](_0x319895,![],null):''));}}));_0x6855e7[_0xd8d2('0x1a')](ewinston[_0xd8d2('0x1b')]({'winstonInstance':_0x5c17ca,'meta':![],'statusLevels':!![],'msg':function(_0x8eb03,_0x469971){var _0xbf4ffe='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x8eb03[_0xd8d2('0x1e')]&&_0x8eb03[_0xd8d2('0x1e')][_0xd8d2('0x27')]&&_0x8eb03[_0xd8d2('0x1e')][_0xd8d2('0x28')]){_0xbf4ffe='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xd8d2('0x1f')](_0xbf4ffe,_0x8eb03[_0xd8d2('0x20')],_0x8eb03[_0xd8d2('0x21')]['x-forwarded-for']?_0x8eb03[_0xd8d2('0x21')][_0xd8d2('0x22')]:_0x8eb03[_0xd8d2('0x29')][_0xd8d2('0x23')]||_0x8eb03['ip'],_0x8eb03[_0xd8d2('0x24')],_0x469971[_0xd8d2('0x2a')],_0x469971[_0xd8d2('0x25')],_0x8eb03[_0xd8d2('0x12')]?_0x8eb03[_0xd8d2('0x12')]['id']:null,_0x8eb03[_0xd8d2('0x12')]?_0x8eb03['user'][_0xd8d2('0xf')]:null,_0x8eb03[_0xd8d2('0x12')]?_0x8eb03[_0xd8d2('0x12')][_0xd8d2('0xe')]:null,_0x8eb03[_0xd8d2('0x1e')]&&_0x8eb03[_0xd8d2('0x1e')][_0xd8d2('0x27')]?_0x8eb03['body'][_0xd8d2('0x27')]:_0xd8d2('0x2b'),_0x8eb03[_0xd8d2('0x1e')]&&_0x8eb03[_0xd8d2('0x1e')]['agent_id']?_0x8eb03['body'][_0xd8d2('0x28')]:'',_0x8eb03[_0xd8d2('0x1e')]&&_0x8eb03[_0xd8d2('0x1e')][_0xd8d2('0x2c')]?_0x8eb03[_0xd8d2('0x1e')][_0xd8d2('0x2c')]:'');},'ignoreRoute':function(_0x44955e){var _0x324d11=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x324d11[_0xd8d2('0x2d')](_0x44955e['url']);}}));return _0xa0fe80();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x03e0=['other','agent_name','test','setupLoggers','fs-extra','express-winston','util','fileLogger','safeTemplate','maskSensitiveData','join','client','role','name','ensureDir','then','catch','log','user','no-user','timestamp','error','api','auth','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)'];(function(_0x5dfb5e,_0x40e540){var _0x2bf8f7=function(_0x5311fd){while(--_0x5311fd){_0x5dfb5e['push'](_0x5dfb5e['shift']());}};_0x2bf8f7(++_0x40e540);}(_0x03e0,0x17e));var _0x003e=function(_0x450536,_0x18f463){_0x450536=_0x450536-0x0;var _0x359f6f=_0x03e0[_0x450536];return _0x359f6f;};var fs=require(_0x003e('0x0'));var _=require('lodash');var ewinston=require(_0x003e('0x1'));var path=require('path');var util=require(_0x003e('0x2'));var fileLogger=require('./loggers')[_0x003e('0x3')];var safeTemplate=require('./safe-template')[_0x003e('0x4')];var maskSensitiveData=require('./mask-sensitive-data')[_0x003e('0x5')];function ClientSideLogger(){function _0x4dfbdc(_0x5b5fcd){var _0x2c1b77=path[_0x003e('0x6')]('/var','log','xcally');var _0x5f5674=path[_0x003e('0x6')](_0x003e('0x7'),_0x5b5fcd[_0x003e('0x8')]+'-'+_0x5b5fcd[_0x003e('0x9')]);return fs[_0x003e('0xa')](path['join'](_0x2c1b77,_0x5f5674))[_0x003e('0xb')](function(){var _0x2bfa64=fileLogger(_0x003e('0x7'),path['join'](_0x2c1b77,_0x5f5674));return _0x2bfa64;})[_0x003e('0xc')](function(_0xc270c7){throw _0xc270c7;});}this[_0x003e('0xd')]=function(_0x41d726,_0x11ffa6,_0x270b34,_0x5f14ed){return _0x4dfbdc(_0x41d726[_0x003e('0xe')])[_0x003e('0xb')](function(_0x576a5f){var _0x51f842=_0x576a5f[_0x11ffa6];return _0x51f842;})[_0x003e('0xb')](function(_0x3db59f){var _0x59d6fc=_0x41d726[_0x003e('0xe')]?_0x41d726[_0x003e('0xe')]['id']:_0x003e('0xf');var _0x2c9560=_0x5f14ed['data'];var _0x385453=_0x5f14ed[_0x003e('0x10')];var _0xb693d0=new Date(Number(_0x385453));return _0x3db59f(_0x59d6fc,_0xb693d0,_0x270b34,_0x2c9560);})[_0x003e('0xc')](function(_0x1f298b){fileLogger(_0x003e('0x7'))[_0x003e('0x11')](_0x1f298b);});};}function setupLoggers(_0x5c0956){return new Promise(function(_0x39730d){var _0x47554b=new ClientSideLogger();var _0x27234d=fileLogger(_0x003e('0x12'));var _0x4ae292=fileLogger(_0x003e('0x13'));_0x5c0956['set']('client-side-logger',_0x47554b);_0x5c0956['use'](ewinston['logger']({'winstonInstance':_0x27234d,'meta':![],'statusLevels':!![],'msg':function(_0x36c1cd,_0x1439d0){var _0x196e46=_0x003e('0x14');if(!_[_0x003e('0x15')](_0x36c1cd[_0x003e('0x16')])){_0x196e46+='\x20body=%s';var _0xecfee8=_0x36c1cd[_0x003e('0x16')];maskSensitiveData(_0xecfee8);}return safeTemplate(util[_0x003e('0x17')](_0x196e46,_0x36c1cd[_0x003e('0x18')],_0x36c1cd[_0x003e('0x19')][_0x003e('0x1a')]?_0x36c1cd[_0x003e('0x19')]['x-forwarded-for']:_0x36c1cd[_0x003e('0x1b')][_0x003e('0x1c')]||_0x36c1cd['ip'],_0x36c1cd[_0x003e('0x1d')],_0x1439d0[_0x003e('0x1e')],_0x1439d0[_0x003e('0x1f')],_0x36c1cd[_0x003e('0xe')]?_0x36c1cd[_0x003e('0xe')]['id']:null,_0x36c1cd['user']?_0x36c1cd[_0x003e('0xe')][_0x003e('0x9')]:null,_0x36c1cd[_0x003e('0xe')]?_0x36c1cd['user'][_0x003e('0x8')]:null,_0xecfee8?util[_0x003e('0x20')](_0xecfee8,![],null):''));}}));_0x5c0956[_0x003e('0x21')](ewinston['logger']({'winstonInstance':_0x4ae292,'meta':![],'statusLevels':!![],'msg':function(_0x1fb68b,_0x27aeb3){var _0x301900=_0x003e('0x22');if(_0x1fb68b[_0x003e('0x16')]&&_0x1fb68b['body'][_0x003e('0x23')]&&_0x1fb68b[_0x003e('0x16')][_0x003e('0x24')]){_0x301900=_0x003e('0x25');}return util[_0x003e('0x17')](_0x301900,_0x1fb68b['method'],_0x1fb68b[_0x003e('0x19')][_0x003e('0x1a')]?_0x1fb68b['headers'][_0x003e('0x1a')]:_0x1fb68b[_0x003e('0x1b')]['remoteAddress']||_0x1fb68b['ip'],_0x1fb68b[_0x003e('0x1d')],_0x27aeb3['statusCode'],_0x27aeb3[_0x003e('0x1f')],_0x1fb68b['user']?_0x1fb68b[_0x003e('0xe')]['id']:null,_0x1fb68b[_0x003e('0xe')]?_0x1fb68b[_0x003e('0xe')][_0x003e('0x9')]:null,_0x1fb68b['user']?_0x1fb68b[_0x003e('0xe')][_0x003e('0x8')]:null,_0x1fb68b[_0x003e('0x16')]&&_0x1fb68b[_0x003e('0x16')][_0x003e('0x23')]?_0x1fb68b[_0x003e('0x16')][_0x003e('0x23')]:_0x003e('0x26'),_0x1fb68b['body']&&_0x1fb68b[_0x003e('0x16')][_0x003e('0x24')]?_0x1fb68b[_0x003e('0x16')]['agent_id']:'',_0x1fb68b[_0x003e('0x16')]&&_0x1fb68b[_0x003e('0x16')][_0x003e('0x27')]?_0x1fb68b[_0x003e('0x16')]['agent_name']:'');},'ignoreRoute':function(_0x2da222){var _0x3bbce8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3bbce8[_0x003e('0x28')](_0x2da222['url']);}}));return _0x39730d();});}exports[_0x003e('0x29')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index f25fa7b..a49e9d3 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d99=['message','replace','{{{','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','warn','Logger','File','error','%s-%s','Console','consoleLogger','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log'];(function(_0x51b9a3,_0x3a84e1){var _0x30ca5c=function(_0x473060){while(--_0x473060){_0x51b9a3['push'](_0x51b9a3['shift']());}};_0x30ca5c(++_0x3a84e1);}(_0x2d99,0x7d));var _0x92d9=function(_0x1c07cc,_0x429833){_0x1c07cc=_0x1c07cc-0x0;var _0x3502e7=_0x2d99[_0x1c07cc];return _0x3502e7;};'use strict';var path=require('path');var util=require(_0x92d9('0x0'));var moment=require(_0x92d9('0x1'));var winston=require(_0x92d9('0x2'));var config=require(_0x92d9('0x3'));var debugLevel=config[_0x92d9('0x4')]?config[_0x92d9('0x4')][_0x92d9('0x5')]():_0x92d9('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':_0x92d9('0x7'),'error':_0x92d9('0x8'),'warn':_0x92d9('0x9'),'info':'white','print':_0x92d9('0xa'),'success':_0x92d9('0xb'),'http':'gray','verbose':_0x92d9('0xc'),'debug':'bold\x20blue','silly':_0x92d9('0xd')};winston[_0x92d9('0xe')](XC_LOG_COLORS);function getLogFileName(_0x12ce45,_0x33870b,_0x38339d){var _0x16a496=_0x12ce45||_0x92d9('0xf');return path[_0x92d9('0x10')](_0x16a496,util[_0x92d9('0x11')](_0x92d9('0x12'),_0x33870b,_0x38339d));}function formatter(_0x390190,_0x585d79){_0x585d79['message']=_0x585d79[_0x92d9('0x13')][_0x92d9('0x14')](/@@{/g,_0x92d9('0x15'))[_0x92d9('0x14')](/}@@/g,'}}}')[_0x92d9('0x14')](/@{/g,'{{')[_0x92d9('0x14')](/}@/g,'}}');return util[_0x92d9('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x92d9('0x11')](_0x92d9('0x16')),_0x585d79['level'][_0x92d9('0x17')](),_0x390190,_0x585d79[_0x92d9('0x13')]);}function fileFormat(_0x5f177d,_0x4a3225){_0x4a3225[_0x92d9('0x13')]=_0x4a3225['message'][_0x92d9('0x14')](/@@{/g,_0x92d9('0x15'))[_0x92d9('0x14')](/}@@/g,'}}}')[_0x92d9('0x14')](/@{/g,'{{')[_0x92d9('0x14')](/}@/g,'}}');var _0x140fcc=_0x4a3225[_0x92d9('0x18')]&&Object[_0x92d9('0x19')](_0x4a3225[_0x92d9('0x18')])['length']?'\x0a\x09'+JSON[_0x92d9('0x1a')](_0x4a3225['meta']):'';return util[_0x92d9('0x11')](_0x92d9('0x1b'),moment()[_0x92d9('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4a3225['level']['toUpperCase'](),_0x5f177d,_0x4a3225[_0x92d9('0x13')],_0x140fcc);}function consoleLogger(){var _0x3b0635=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x92d9('0x1c'))]['Console']({'level':_0x92d9('0x1d'),'json':![],'formatter':function(_0x47cd44){return formatter('',_0x47cd44);}})]});return _0x3b0635;}function fileLogger(_0x3125b3,_0x47dbe0){var _0x11e37f=new winston[(_0x92d9('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x92d9('0x1f'))]({'name':util['format']('%s-%s',_0x3125b3,'error'),'filename':getLogFileName(_0x47dbe0,_0x3125b3,_0x92d9('0x20')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x15d929){return fileFormat(_0x3125b3,_0x15d929);}}),new winston['transports']['File']({'name':util['format'](_0x92d9('0x21'),_0x3125b3,debugLevel),'filename':getLogFileName(_0x47dbe0,_0x3125b3,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3fa770){return fileFormat(_0x3125b3,_0x3fa770);}}),new winston[(_0x92d9('0x1c'))][(_0x92d9('0x22'))]({'level':_0x92d9('0x1d'),'json':![],'formatter':function(_0x1e9908){return fileFormat(_0x3125b3,_0x1e9908);}})]});return _0x11e37f;}exports[_0x92d9('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x0aa3=['join','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','warn','error','File','%s-%s','Console','consoleLogger','fileLogger','util','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','gray','bold\x20magenta','bold\x20cyan'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0aa3,0x153));var _0x30aa=function(_0x39e3c4,_0x4ed9c6){_0x39e3c4=_0x39e3c4-0x0;var _0x212f26=_0x0aa3[_0x39e3c4];return _0x212f26;};'use strict';var path=require('path');var util=require(_0x30aa('0x0'));var moment=require('moment');var winston=require('winston');var config=require(_0x30aa('0x1'));var debugLevel=config[_0x30aa('0x2')]?config[_0x30aa('0x2')][_0x30aa('0x3')]():_0x30aa('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x30aa('0x5'),'error':'red','warn':_0x30aa('0x6'),'info':_0x30aa('0x7'),'print':'bold\x20white','success':'bold\x20green','http':_0x30aa('0x8'),'verbose':_0x30aa('0x9'),'debug':'bold\x20blue','silly':_0x30aa('0xa')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x4fbd58,_0x2fb67d,_0x5bbf6e){var _0x2ac717=_0x4fbd58||'/var/log/xcally';return path[_0x30aa('0xb')](_0x2ac717,util['format'](_0x30aa('0xc'),_0x2fb67d,_0x5bbf6e));}function formatter(_0x4e8a30,_0x3f6519){_0x3f6519[_0x30aa('0xd')]=_0x3f6519[_0x30aa('0xd')]['replace'](/@@{/g,_0x30aa('0xe'))[_0x30aa('0xf')](/}@@/g,_0x30aa('0x10'))[_0x30aa('0xf')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0x30aa('0x11'),moment()[_0x30aa('0x12')](_0x30aa('0x13')),_0x3f6519[_0x30aa('0x14')]['toUpperCase'](),_0x4e8a30,_0x3f6519['message']);}function fileFormat(_0x28b020,_0x2adb07){_0x2adb07[_0x30aa('0xd')]=_0x2adb07[_0x30aa('0xd')][_0x30aa('0xf')](/@@{/g,_0x30aa('0xe'))[_0x30aa('0xf')](/}@@/g,_0x30aa('0x10'))[_0x30aa('0xf')](/@{/g,'{{')[_0x30aa('0xf')](/}@/g,'}}');var _0x19a758=_0x2adb07[_0x30aa('0x15')]&&Object[_0x30aa('0x16')](_0x2adb07['meta'])['length']?'\x0a\x09'+JSON[_0x30aa('0x17')](_0x2adb07['meta']):'';return util[_0x30aa('0x12')](_0x30aa('0x18'),moment()[_0x30aa('0x12')](_0x30aa('0x13')),_0x2adb07['level'][_0x30aa('0x19')](),_0x28b020,_0x2adb07['message'],_0x19a758);}function consoleLogger(){var _0x348e13=new winston[(_0x30aa('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x30aa('0x1b'))]['Console']({'level':_0x30aa('0x1c'),'json':![],'formatter':function(_0x5f0d52){return formatter('',_0x5f0d52);}})]});return _0x348e13;}function fileLogger(_0x5633c6,_0x3a0c7f){var _0x23e6e3=new winston[(_0x30aa('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x30aa('0x1b'))]['File']({'name':util[_0x30aa('0x12')]('%s-%s',_0x5633c6,_0x30aa('0x1d')),'filename':getLogFileName(_0x3a0c7f,_0x5633c6,_0x30aa('0x1d')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x484ea7){return fileFormat(_0x5633c6,_0x484ea7);}}),new winston['transports'][(_0x30aa('0x1e'))]({'name':util[_0x30aa('0x12')](_0x30aa('0x1f'),_0x5633c6,debugLevel),'filename':getLogFileName(_0x3a0c7f,_0x5633c6,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x191204){return fileFormat(_0x5633c6,_0x191204);}}),new winston['transports'][(_0x30aa('0x20'))]({'level':_0x30aa('0x1c'),'json':![],'formatter':function(_0x4c9af7){return fileFormat(_0x5633c6,_0x4c9af7);}})]});return _0x23e6e3;}exports[_0x30aa('0x21')]=consoleLogger;exports[_0x30aa('0x22')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index a6c40e7..95333a2 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 _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x4975,0x86));var _0x5497=function(_0x80fd11,_0x3d577e){_0x80fd11=_0x80fd11-0x0;var _0x2b7452=_0x4975[_0x80fd11];return _0x2b7452;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData; \ No newline at end of file +var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0xda8575,_0x2299fe){var _0x37b278=function(_0x21f8b0){while(--_0x21f8b0){_0xda8575['push'](_0xda8575['shift']());}};_0x37b278(++_0x2299fe);}(_0x66fa,0x117));var _0xa66f=function(_0x32365f,_0x58dd6b){_0x32365f=_0x32365f-0x0;var _0x4215ab=_0x66fa[_0x32365f];return _0x4215ab;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index b708e7c..f5e2af9 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 _0x4fc2=['reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map','keys'];(function(_0x32d4a8,_0x2d031b){var _0x3dd5ab=function(_0x365164){while(--_0x365164){_0x32d4a8['push'](_0x32d4a8['shift']());}};_0x3dd5ab(++_0x2d031b);}(_0x4fc2,0x111));var _0x24fc=function(_0x529021,_0x5347c0){_0x529021=_0x529021-0x0;var _0x40d4ad=_0x4fc2[_0x529021];return _0x40d4ad;};var _=require(_0x24fc('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b05a5){return _0x2b05a5==='{{'?_0x24fc('0x1'):_0x24fc('0x2');}function safeTemplate(_0x5aaa74){var _0x365c56=_0x5aaa74;if(typeof _0x5aaa74===_0x24fc('0x3')){_0x365c56=_0x5aaa74[_0x24fc('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x5aaa74)){_0x365c56=_0x5aaa74[_0x24fc('0x5')](function(_0x3772eb){return safeTemplate(_0x3772eb);});}else if(_['isPlainObject'](_0x5aaa74)){_0x365c56=Object[_0x24fc('0x6')](_0x5aaa74)[_0x24fc('0x7')](function(_0x4889f4,_0x115851){_0x4889f4[_0x115851]=safeTemplate(_0x5aaa74[_0x115851]);return _0x4889f4;},{});}return _0x365c56;}module[_0x24fc('0x8')][_0x24fc('0x9')]=safeTemplate; \ No newline at end of file +var _0x6343=['{\x20{\x20','\x20}\x20}','isArray','map','isPlainObject','keys'];(function(_0x220ea7,_0x4aaac2){var _0x4f728b=function(_0x33f62f){while(--_0x33f62f){_0x220ea7['push'](_0x220ea7['shift']());}};_0x4f728b(++_0x4aaac2);}(_0x6343,0x168));var _0x3634=function(_0x44835a,_0x1073c3){_0x44835a=_0x44835a-0x0;var _0x7ffa33=_0x6343[_0x44835a];return _0x7ffa33;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x52574f){return _0x52574f==='{{'?_0x3634('0x0'):_0x3634('0x1');}function safeTemplate(_0x53a78f){var _0x518246=_0x53a78f;if(typeof _0x53a78f==='string'){_0x518246=_0x53a78f['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3634('0x2')](_0x53a78f)){_0x518246=_0x53a78f[_0x3634('0x3')](function(_0x57c5e4){return safeTemplate(_0x57c5e4);});}else if(_[_0x3634('0x4')](_0x53a78f)){_0x518246=Object[_0x3634('0x5')](_0x53a78f)['reduce'](function(_0x302828,_0xd40513){_0x302828[_0xd40513]=safeTemplate(_0x53a78f[_0xd40513]);return _0x302828;},{});}return _0x518246;}module['exports']['safeTemplate']=safeTemplate; \ No newline at end of file